From 5e4ecf9050c9059e1764a2a1b1dfa82d89e63fd4 Mon Sep 17 00:00:00 2001 From: norayr Date: Wed, 20 May 2015 14:20:50 +0400 Subject: [PATCH 001/580] JmpBufCheck added to Kernel.Mod as in ofront; -- noch Former-commit-id: 337f7d754a9f8e98b78ca0e207e625ee92bbbea3 --- src/lib/system/darwin/clang/Kernel.Mod | 23 ++++++++++++++++++++++- src/lib/system/darwin/clang/Kernel0.Mod | 23 ++++++++++++++++++++++- src/lib/system/freebsd/clang/Kernel.Mod | 23 ++++++++++++++++++++++- src/lib/system/freebsd/clang/Kernel0.Mod | 23 ++++++++++++++++++++++- src/lib/system/linux/clang/Kernel.Mod | 23 ++++++++++++++++++++++- src/lib/system/linux/clang/Kernel0.Mod | 23 ++++++++++++++++++++++- src/lib/system/linux/gcc/Kernel.Mod | 23 ++++++++++++++++++++++- src/lib/system/linux/gcc/Kernel0.Mod | 23 ++++++++++++++++++++++- 8 files changed, 176 insertions(+), 8 deletions(-) diff --git a/src/lib/system/darwin/clang/Kernel.Mod b/src/lib/system/darwin/clang/Kernel.Mod index e84e5eae..cd516916 100644 --- a/src/lib/system/darwin/clang/Kernel.Mod +++ b/src/lib/system/darwin/clang/Kernel.Mod @@ -156,6 +156,26 @@ MODULE Kernel; SYSTEM.GET(i, littleEndian); (* indirection via i avoids warning on SUN cc -O *) END EndianTest; + PROCEDURE -SizeofUnixJmpBuf(): INTEGER + "sizeof(Unix_JmpBuf)"; + + PROCEDURE -SizeofSigJmpBuf(): INTEGER + "sizeof(sigjmp_buf)"; + + PROCEDURE -Error(msg: ARRAY OF CHAR; len: INTEGER) + "write(1/*stdout*/, msg, len); char ch = 0xa; write(1, &ch, 1)"; + + PROCEDURE JmpBufCheck; (* check for inconsistent usage of sigjmp_buf *) + VAR x, y: LONGINT; + BEGIN + x := SizeofUnixJmpBuf(); + y := SizeofSigJmpBuf(); + IF x < y THEN + Error("Kernel.JmpBufCheck: inconsistent usage of sigjmp_buf", 52); + Exit(1); + END + END JmpBufCheck; + BEGIN EndianTest(); SetHalt(Halt); @@ -163,5 +183,6 @@ BEGIN getcwd(CWD); Args.GetEnv("OBERON", OBERON); Args.GetEnv("OBERON_LIB", LIB); - TimeUnit := 1000; timeStart := 0; timeStart := Time() + TimeUnit := 1000; timeStart := 0; timeStart := Time(); + JmpBufCheck() END Kernel. diff --git a/src/lib/system/darwin/clang/Kernel0.Mod b/src/lib/system/darwin/clang/Kernel0.Mod index c128b73d..6a58650f 100644 --- a/src/lib/system/darwin/clang/Kernel0.Mod +++ b/src/lib/system/darwin/clang/Kernel0.Mod @@ -160,6 +160,26 @@ MODULE Kernel0; SYSTEM.GET(i, littleEndian); (* indirection via i avoids warning on SUN cc -O *) END EndianTest; + PROCEDURE -SizeofUnixJmpBuf(): INTEGER + "sizeof(Unix_JmpBuf)"; + + PROCEDURE -SizeofSigJmpBuf(): INTEGER + "sizeof(sigjmp_buf)"; + + PROCEDURE -Error(msg: ARRAY OF CHAR; len: INTEGER) + "write(1/*stdout*/, msg, len); char ch = 0xa; write(1, &ch, 1)"; + + PROCEDURE JmpBufCheck; (* check for inconsistent usage of sigjmp_buf *) + VAR x, y: LONGINT; + BEGIN + x := SizeofUnixJmpBuf(); + y := SizeofSigJmpBuf(); + IF x < y THEN + Error("Kernel.JmpBufCheck: inconsistent usage of sigjmp_buf", 52); + Exit(1); + END + END JmpBufCheck; + BEGIN EndianTest(); SetHalt(Halt); @@ -175,5 +195,6 @@ BEGIN Strings.Append(version.prefix, OBERON); Strings.Append("/lib/voc/sym:", OBERON); Args.GetEnv("OBERON_LIB", LIB); - TimeUnit := 1000; timeStart := 0; timeStart := Time() + TimeUnit := 1000; timeStart := 0; timeStart := Time(); + JmpBufCheck() END Kernel0. diff --git a/src/lib/system/freebsd/clang/Kernel.Mod b/src/lib/system/freebsd/clang/Kernel.Mod index e84e5eae..cd516916 100644 --- a/src/lib/system/freebsd/clang/Kernel.Mod +++ b/src/lib/system/freebsd/clang/Kernel.Mod @@ -156,6 +156,26 @@ MODULE Kernel; SYSTEM.GET(i, littleEndian); (* indirection via i avoids warning on SUN cc -O *) END EndianTest; + PROCEDURE -SizeofUnixJmpBuf(): INTEGER + "sizeof(Unix_JmpBuf)"; + + PROCEDURE -SizeofSigJmpBuf(): INTEGER + "sizeof(sigjmp_buf)"; + + PROCEDURE -Error(msg: ARRAY OF CHAR; len: INTEGER) + "write(1/*stdout*/, msg, len); char ch = 0xa; write(1, &ch, 1)"; + + PROCEDURE JmpBufCheck; (* check for inconsistent usage of sigjmp_buf *) + VAR x, y: LONGINT; + BEGIN + x := SizeofUnixJmpBuf(); + y := SizeofSigJmpBuf(); + IF x < y THEN + Error("Kernel.JmpBufCheck: inconsistent usage of sigjmp_buf", 52); + Exit(1); + END + END JmpBufCheck; + BEGIN EndianTest(); SetHalt(Halt); @@ -163,5 +183,6 @@ BEGIN getcwd(CWD); Args.GetEnv("OBERON", OBERON); Args.GetEnv("OBERON_LIB", LIB); - TimeUnit := 1000; timeStart := 0; timeStart := Time() + TimeUnit := 1000; timeStart := 0; timeStart := Time(); + JmpBufCheck() END Kernel. diff --git a/src/lib/system/freebsd/clang/Kernel0.Mod b/src/lib/system/freebsd/clang/Kernel0.Mod index c128b73d..6a58650f 100644 --- a/src/lib/system/freebsd/clang/Kernel0.Mod +++ b/src/lib/system/freebsd/clang/Kernel0.Mod @@ -160,6 +160,26 @@ MODULE Kernel0; SYSTEM.GET(i, littleEndian); (* indirection via i avoids warning on SUN cc -O *) END EndianTest; + PROCEDURE -SizeofUnixJmpBuf(): INTEGER + "sizeof(Unix_JmpBuf)"; + + PROCEDURE -SizeofSigJmpBuf(): INTEGER + "sizeof(sigjmp_buf)"; + + PROCEDURE -Error(msg: ARRAY OF CHAR; len: INTEGER) + "write(1/*stdout*/, msg, len); char ch = 0xa; write(1, &ch, 1)"; + + PROCEDURE JmpBufCheck; (* check for inconsistent usage of sigjmp_buf *) + VAR x, y: LONGINT; + BEGIN + x := SizeofUnixJmpBuf(); + y := SizeofSigJmpBuf(); + IF x < y THEN + Error("Kernel.JmpBufCheck: inconsistent usage of sigjmp_buf", 52); + Exit(1); + END + END JmpBufCheck; + BEGIN EndianTest(); SetHalt(Halt); @@ -175,5 +195,6 @@ BEGIN Strings.Append(version.prefix, OBERON); Strings.Append("/lib/voc/sym:", OBERON); Args.GetEnv("OBERON_LIB", LIB); - TimeUnit := 1000; timeStart := 0; timeStart := Time() + TimeUnit := 1000; timeStart := 0; timeStart := Time(); + JmpBufCheck() END Kernel0. diff --git a/src/lib/system/linux/clang/Kernel.Mod b/src/lib/system/linux/clang/Kernel.Mod index e84e5eae..cd516916 100644 --- a/src/lib/system/linux/clang/Kernel.Mod +++ b/src/lib/system/linux/clang/Kernel.Mod @@ -156,6 +156,26 @@ MODULE Kernel; SYSTEM.GET(i, littleEndian); (* indirection via i avoids warning on SUN cc -O *) END EndianTest; + PROCEDURE -SizeofUnixJmpBuf(): INTEGER + "sizeof(Unix_JmpBuf)"; + + PROCEDURE -SizeofSigJmpBuf(): INTEGER + "sizeof(sigjmp_buf)"; + + PROCEDURE -Error(msg: ARRAY OF CHAR; len: INTEGER) + "write(1/*stdout*/, msg, len); char ch = 0xa; write(1, &ch, 1)"; + + PROCEDURE JmpBufCheck; (* check for inconsistent usage of sigjmp_buf *) + VAR x, y: LONGINT; + BEGIN + x := SizeofUnixJmpBuf(); + y := SizeofSigJmpBuf(); + IF x < y THEN + Error("Kernel.JmpBufCheck: inconsistent usage of sigjmp_buf", 52); + Exit(1); + END + END JmpBufCheck; + BEGIN EndianTest(); SetHalt(Halt); @@ -163,5 +183,6 @@ BEGIN getcwd(CWD); Args.GetEnv("OBERON", OBERON); Args.GetEnv("OBERON_LIB", LIB); - TimeUnit := 1000; timeStart := 0; timeStart := Time() + TimeUnit := 1000; timeStart := 0; timeStart := Time(); + JmpBufCheck() END Kernel. diff --git a/src/lib/system/linux/clang/Kernel0.Mod b/src/lib/system/linux/clang/Kernel0.Mod index c128b73d..6a58650f 100644 --- a/src/lib/system/linux/clang/Kernel0.Mod +++ b/src/lib/system/linux/clang/Kernel0.Mod @@ -160,6 +160,26 @@ MODULE Kernel0; SYSTEM.GET(i, littleEndian); (* indirection via i avoids warning on SUN cc -O *) END EndianTest; + PROCEDURE -SizeofUnixJmpBuf(): INTEGER + "sizeof(Unix_JmpBuf)"; + + PROCEDURE -SizeofSigJmpBuf(): INTEGER + "sizeof(sigjmp_buf)"; + + PROCEDURE -Error(msg: ARRAY OF CHAR; len: INTEGER) + "write(1/*stdout*/, msg, len); char ch = 0xa; write(1, &ch, 1)"; + + PROCEDURE JmpBufCheck; (* check for inconsistent usage of sigjmp_buf *) + VAR x, y: LONGINT; + BEGIN + x := SizeofUnixJmpBuf(); + y := SizeofSigJmpBuf(); + IF x < y THEN + Error("Kernel.JmpBufCheck: inconsistent usage of sigjmp_buf", 52); + Exit(1); + END + END JmpBufCheck; + BEGIN EndianTest(); SetHalt(Halt); @@ -175,5 +195,6 @@ BEGIN Strings.Append(version.prefix, OBERON); Strings.Append("/lib/voc/sym:", OBERON); Args.GetEnv("OBERON_LIB", LIB); - TimeUnit := 1000; timeStart := 0; timeStart := Time() + TimeUnit := 1000; timeStart := 0; timeStart := Time(); + JmpBufCheck() END Kernel0. diff --git a/src/lib/system/linux/gcc/Kernel.Mod b/src/lib/system/linux/gcc/Kernel.Mod index e84e5eae..cd516916 100644 --- a/src/lib/system/linux/gcc/Kernel.Mod +++ b/src/lib/system/linux/gcc/Kernel.Mod @@ -156,6 +156,26 @@ MODULE Kernel; SYSTEM.GET(i, littleEndian); (* indirection via i avoids warning on SUN cc -O *) END EndianTest; + PROCEDURE -SizeofUnixJmpBuf(): INTEGER + "sizeof(Unix_JmpBuf)"; + + PROCEDURE -SizeofSigJmpBuf(): INTEGER + "sizeof(sigjmp_buf)"; + + PROCEDURE -Error(msg: ARRAY OF CHAR; len: INTEGER) + "write(1/*stdout*/, msg, len); char ch = 0xa; write(1, &ch, 1)"; + + PROCEDURE JmpBufCheck; (* check for inconsistent usage of sigjmp_buf *) + VAR x, y: LONGINT; + BEGIN + x := SizeofUnixJmpBuf(); + y := SizeofSigJmpBuf(); + IF x < y THEN + Error("Kernel.JmpBufCheck: inconsistent usage of sigjmp_buf", 52); + Exit(1); + END + END JmpBufCheck; + BEGIN EndianTest(); SetHalt(Halt); @@ -163,5 +183,6 @@ BEGIN getcwd(CWD); Args.GetEnv("OBERON", OBERON); Args.GetEnv("OBERON_LIB", LIB); - TimeUnit := 1000; timeStart := 0; timeStart := Time() + TimeUnit := 1000; timeStart := 0; timeStart := Time(); + JmpBufCheck() END Kernel. diff --git a/src/lib/system/linux/gcc/Kernel0.Mod b/src/lib/system/linux/gcc/Kernel0.Mod index c128b73d..6a58650f 100644 --- a/src/lib/system/linux/gcc/Kernel0.Mod +++ b/src/lib/system/linux/gcc/Kernel0.Mod @@ -160,6 +160,26 @@ MODULE Kernel0; SYSTEM.GET(i, littleEndian); (* indirection via i avoids warning on SUN cc -O *) END EndianTest; + PROCEDURE -SizeofUnixJmpBuf(): INTEGER + "sizeof(Unix_JmpBuf)"; + + PROCEDURE -SizeofSigJmpBuf(): INTEGER + "sizeof(sigjmp_buf)"; + + PROCEDURE -Error(msg: ARRAY OF CHAR; len: INTEGER) + "write(1/*stdout*/, msg, len); char ch = 0xa; write(1, &ch, 1)"; + + PROCEDURE JmpBufCheck; (* check for inconsistent usage of sigjmp_buf *) + VAR x, y: LONGINT; + BEGIN + x := SizeofUnixJmpBuf(); + y := SizeofSigJmpBuf(); + IF x < y THEN + Error("Kernel.JmpBufCheck: inconsistent usage of sigjmp_buf", 52); + Exit(1); + END + END JmpBufCheck; + BEGIN EndianTest(); SetHalt(Halt); @@ -175,5 +195,6 @@ BEGIN Strings.Append(version.prefix, OBERON); Strings.Append("/lib/voc/sym:", OBERON); Args.GetEnv("OBERON_LIB", LIB); - TimeUnit := 1000; timeStart := 0; timeStart := Time() + TimeUnit := 1000; timeStart := 0; timeStart := Time(); + JmpBufCheck() END Kernel0. From 0c9215f5f28313272e7b844657141aaaa6772f18 Mon Sep 17 00:00:00 2001 From: norayr Date: Wed, 20 May 2015 15:38:57 +0400 Subject: [PATCH 002/580] set_jmp structure wrapper fixed; -- noch Former-commit-id: 8e31893ecb4ca71e87b76da55e2f90c5e57406d1 --- .../system/linux/clang/armv6j_hardfp/Unix.Mod | 21 ++++++- src/lib/system/linux/clang/powerpc/Unix.Mod | 3 +- src/lib/system/linux/clang/x86/Unix.Mod | 3 +- src/lib/system/linux/clang/x86_64/Unix.Mod | 61 ++++++------------- .../system/linux/gcc/armv6j_hardfp/Unix.Mod | 21 ++++++- src/lib/system/linux/gcc/powerpc/Unix.Mod | 3 +- src/lib/system/linux/gcc/x86/Unix.Mod | 3 +- src/lib/system/linux/gcc/x86_64/Unix.Mod | 61 ++++++------------- vocstatic.linux.gcc.x86_64.REMOVED.git-id | 2 +- 9 files changed, 81 insertions(+), 97 deletions(-) diff --git a/src/lib/system/linux/clang/armv6j_hardfp/Unix.Mod b/src/lib/system/linux/clang/armv6j_hardfp/Unix.Mod index e2a25ec5..228d824e 100644 --- a/src/lib/system/linux/clang/armv6j_hardfp/Unix.Mod +++ b/src/lib/system/linux/clang/armv6j_hardfp/Unix.Mod @@ -152,9 +152,26 @@ CONST TYPE + (* cpp /usr/include/setjmp.h + struct __jmp_buf_tag + { + __jmp_buf __jmpbuf; + int __mask_was_saved; + __sigset_t __saved_mask; + }; + + typedef struct __jmp_buf_tag jmp_buf[1]; + + __sigset_t is 128 byte long in glibc on arm, x86, x86_64 + __jmp_buf is 24 bytes long in glibc on x86 + 256 bytes long in glibc on armv6 + 64 bytes long in glibc on x86_64 + + *) JmpBuf* = RECORD - bx*, si*, di*, bp*, sp*, pc*: LONGINT; - maskWasSaved*, savedMask*: LONGINT; + jmpbuf: ARRAY 64 OF LONGINT; (* 256 / 4 = 64 *) + maskWasSaved*: LONGINT; + savedMask*: ARRAY 32 OF LONGINT; (* 32 * 4 = 128 *) END ; Status* = RECORD (* struct stat *) diff --git a/src/lib/system/linux/clang/powerpc/Unix.Mod b/src/lib/system/linux/clang/powerpc/Unix.Mod index e2a25ec5..aa6fdd7d 100644 --- a/src/lib/system/linux/clang/powerpc/Unix.Mod +++ b/src/lib/system/linux/clang/powerpc/Unix.Mod @@ -154,7 +154,8 @@ CONST TYPE JmpBuf* = RECORD bx*, si*, di*, bp*, sp*, pc*: LONGINT; - maskWasSaved*, savedMask*: LONGINT; + maskWasSaved*: LONGINT; + savedMask*: ARRAY 32 OF LONGINT; END ; Status* = RECORD (* struct stat *) diff --git a/src/lib/system/linux/clang/x86/Unix.Mod b/src/lib/system/linux/clang/x86/Unix.Mod index e2a25ec5..6ba884e5 100644 --- a/src/lib/system/linux/clang/x86/Unix.Mod +++ b/src/lib/system/linux/clang/x86/Unix.Mod @@ -154,7 +154,8 @@ CONST TYPE JmpBuf* = RECORD bx*, si*, di*, bp*, sp*, pc*: LONGINT; - maskWasSaved*, savedMask*: LONGINT; + maskWasSaved*: LONGINT; + savedMask*: ARRAY 32 OF LONGINT; END ; Status* = RECORD (* struct stat *) diff --git a/src/lib/system/linux/clang/x86_64/Unix.Mod b/src/lib/system/linux/clang/x86_64/Unix.Mod index e44840d0..7d7b4730 100644 --- a/src/lib/system/linux/clang/x86_64/Unix.Mod +++ b/src/lib/system/linux/clang/x86_64/Unix.Mod @@ -154,53 +154,26 @@ CONST sigsetarrlength = 1024 / 8 * SIZE(LONGINT); TYPE -(* bits/sigset.h - _SIGSET_NWORDS (1024 / (8 * sizeof (unsigned long int))) - - 1024 / 8*8 = 16 - 1024 / 8*4 = 32 -*) - sigsett* = RECORD - val : ARRAY 16 OF LONGINT (* 32 for 32 bit *) - (*val : ARRAY sigsetarrlength OF LONGINT *) - END; - - JmpBuf* = RECORD - (*bx*, si*, di*, bp*, sp*, pc*: LONGINT;*) - (* bits/setjmp.h sets up longer array in GNU libc *) - (* - # if __WORDSIZE == 64 - typedef long int __jmp_buf[8]; - # else - typedef int __jmp_buf[6]; - # endif - *) - bx*, si*, di*, bp*, sp*, pc*, ki*, ku*: LONGINT; - (* setjmp.h -/* Calling environment, plus possibly a saved signal mask. */ -struct __jmp_buf_tag + (* cpp /usr/include/setjmp.h + struct __jmp_buf_tag { - /* NOTE: The machine-dependent definitions of `__sigsetjmp' - assume that a `jmp_buf' begins with a `__jmp_buf' and that - `__mask_was_saved' follows it. Do not move these members - or add others before it. */ - __jmp_buf __jmpbuf; /* Calling environment. */ - int __mask_was_saved; /* Saved the signal mask? */ - __sigset_t __saved_mask; /* Saved signal mask. */ + __jmp_buf __jmpbuf; + int __mask_was_saved; + __sigset_t __saved_mask; }; - *) - (*maskWasSaved*, savedMask*: LONGINT;*) - maskWasSaved*: INTEGER; - (* - # define _SIGSET_NWORDS (1024 / (8 * sizeof (unsigned long int))) -typedef struct - { - unsigned long int __val[_SIGSET_NWORDS]; - } __sigset_t; - - *) - savedMask*: sigsett; + typedef struct __jmp_buf_tag jmp_buf[1]; + + __sigset_t is 128 byte long in glibc on arm, x86, x86_64 + __jmp_buf is 24 bytes long in glibc on x86 + 256 bytes long in glibc on armv6 + 64 bytes long in glibc on x86_64 + + *) + JmpBuf* = RECORD + jmpbuf: ARRAY 8 OF LONGINT; (* 8 * 8 = 64 *) + maskWasSaved*: INTEGER; + savedMask*: ARRAY 16 OF LONGINT; ( 16 * 8 = 128 *) END ; Status* = RECORD (* struct stat *) diff --git a/src/lib/system/linux/gcc/armv6j_hardfp/Unix.Mod b/src/lib/system/linux/gcc/armv6j_hardfp/Unix.Mod index e2a25ec5..228d824e 100644 --- a/src/lib/system/linux/gcc/armv6j_hardfp/Unix.Mod +++ b/src/lib/system/linux/gcc/armv6j_hardfp/Unix.Mod @@ -152,9 +152,26 @@ CONST TYPE + (* cpp /usr/include/setjmp.h + struct __jmp_buf_tag + { + __jmp_buf __jmpbuf; + int __mask_was_saved; + __sigset_t __saved_mask; + }; + + typedef struct __jmp_buf_tag jmp_buf[1]; + + __sigset_t is 128 byte long in glibc on arm, x86, x86_64 + __jmp_buf is 24 bytes long in glibc on x86 + 256 bytes long in glibc on armv6 + 64 bytes long in glibc on x86_64 + + *) JmpBuf* = RECORD - bx*, si*, di*, bp*, sp*, pc*: LONGINT; - maskWasSaved*, savedMask*: LONGINT; + jmpbuf: ARRAY 64 OF LONGINT; (* 256 / 4 = 64 *) + maskWasSaved*: LONGINT; + savedMask*: ARRAY 32 OF LONGINT; (* 32 * 4 = 128 *) END ; Status* = RECORD (* struct stat *) diff --git a/src/lib/system/linux/gcc/powerpc/Unix.Mod b/src/lib/system/linux/gcc/powerpc/Unix.Mod index e2a25ec5..aa6fdd7d 100644 --- a/src/lib/system/linux/gcc/powerpc/Unix.Mod +++ b/src/lib/system/linux/gcc/powerpc/Unix.Mod @@ -154,7 +154,8 @@ CONST TYPE JmpBuf* = RECORD bx*, si*, di*, bp*, sp*, pc*: LONGINT; - maskWasSaved*, savedMask*: LONGINT; + maskWasSaved*: LONGINT; + savedMask*: ARRAY 32 OF LONGINT; END ; Status* = RECORD (* struct stat *) diff --git a/src/lib/system/linux/gcc/x86/Unix.Mod b/src/lib/system/linux/gcc/x86/Unix.Mod index e2a25ec5..6ba884e5 100644 --- a/src/lib/system/linux/gcc/x86/Unix.Mod +++ b/src/lib/system/linux/gcc/x86/Unix.Mod @@ -154,7 +154,8 @@ CONST TYPE JmpBuf* = RECORD bx*, si*, di*, bp*, sp*, pc*: LONGINT; - maskWasSaved*, savedMask*: LONGINT; + maskWasSaved*: LONGINT; + savedMask*: ARRAY 32 OF LONGINT; END ; Status* = RECORD (* struct stat *) diff --git a/src/lib/system/linux/gcc/x86_64/Unix.Mod b/src/lib/system/linux/gcc/x86_64/Unix.Mod index e44840d0..7d7b4730 100644 --- a/src/lib/system/linux/gcc/x86_64/Unix.Mod +++ b/src/lib/system/linux/gcc/x86_64/Unix.Mod @@ -154,53 +154,26 @@ CONST sigsetarrlength = 1024 / 8 * SIZE(LONGINT); TYPE -(* bits/sigset.h - _SIGSET_NWORDS (1024 / (8 * sizeof (unsigned long int))) - - 1024 / 8*8 = 16 - 1024 / 8*4 = 32 -*) - sigsett* = RECORD - val : ARRAY 16 OF LONGINT (* 32 for 32 bit *) - (*val : ARRAY sigsetarrlength OF LONGINT *) - END; - - JmpBuf* = RECORD - (*bx*, si*, di*, bp*, sp*, pc*: LONGINT;*) - (* bits/setjmp.h sets up longer array in GNU libc *) - (* - # if __WORDSIZE == 64 - typedef long int __jmp_buf[8]; - # else - typedef int __jmp_buf[6]; - # endif - *) - bx*, si*, di*, bp*, sp*, pc*, ki*, ku*: LONGINT; - (* setjmp.h -/* Calling environment, plus possibly a saved signal mask. */ -struct __jmp_buf_tag + (* cpp /usr/include/setjmp.h + struct __jmp_buf_tag { - /* NOTE: The machine-dependent definitions of `__sigsetjmp' - assume that a `jmp_buf' begins with a `__jmp_buf' and that - `__mask_was_saved' follows it. Do not move these members - or add others before it. */ - __jmp_buf __jmpbuf; /* Calling environment. */ - int __mask_was_saved; /* Saved the signal mask? */ - __sigset_t __saved_mask; /* Saved signal mask. */ + __jmp_buf __jmpbuf; + int __mask_was_saved; + __sigset_t __saved_mask; }; - *) - (*maskWasSaved*, savedMask*: LONGINT;*) - maskWasSaved*: INTEGER; - (* - # define _SIGSET_NWORDS (1024 / (8 * sizeof (unsigned long int))) -typedef struct - { - unsigned long int __val[_SIGSET_NWORDS]; - } __sigset_t; - - *) - savedMask*: sigsett; + typedef struct __jmp_buf_tag jmp_buf[1]; + + __sigset_t is 128 byte long in glibc on arm, x86, x86_64 + __jmp_buf is 24 bytes long in glibc on x86 + 256 bytes long in glibc on armv6 + 64 bytes long in glibc on x86_64 + + *) + JmpBuf* = RECORD + jmpbuf: ARRAY 8 OF LONGINT; (* 8 * 8 = 64 *) + maskWasSaved*: INTEGER; + savedMask*: ARRAY 16 OF LONGINT; ( 16 * 8 = 128 *) END ; Status* = RECORD (* struct stat *) diff --git a/vocstatic.linux.gcc.x86_64.REMOVED.git-id b/vocstatic.linux.gcc.x86_64.REMOVED.git-id index 8a6ca190..68e5e95a 100644 --- a/vocstatic.linux.gcc.x86_64.REMOVED.git-id +++ b/vocstatic.linux.gcc.x86_64.REMOVED.git-id @@ -1 +1 @@ -924b37cbff137a08805e86eb63403bda0495cf16 \ No newline at end of file +82105aa4959ab990f96645db6fee788397ea97e2 \ No newline at end of file From 140439d5ab12a6a29f4f85797dbae000f8da2571 Mon Sep 17 00:00:00 2001 From: norayr Date: Wed, 20 May 2015 15:43:12 +0400 Subject: [PATCH 003/580] small fix Former-commit-id: aebc553e5de7b3a3fe09462a6c614bb43df2f47b --- src/lib/system/linux/clang/x86_64/Unix.Mod | 2 +- src/lib/system/linux/gcc/x86_64/Unix.Mod | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/system/linux/clang/x86_64/Unix.Mod b/src/lib/system/linux/clang/x86_64/Unix.Mod index 7d7b4730..7cb5da8e 100644 --- a/src/lib/system/linux/clang/x86_64/Unix.Mod +++ b/src/lib/system/linux/clang/x86_64/Unix.Mod @@ -173,7 +173,7 @@ TYPE JmpBuf* = RECORD jmpbuf: ARRAY 8 OF LONGINT; (* 8 * 8 = 64 *) maskWasSaved*: INTEGER; - savedMask*: ARRAY 16 OF LONGINT; ( 16 * 8 = 128 *) + savedMask*: ARRAY 16 OF LONGINT; (* 16 * 8 = 128 *) END ; Status* = RECORD (* struct stat *) diff --git a/src/lib/system/linux/gcc/x86_64/Unix.Mod b/src/lib/system/linux/gcc/x86_64/Unix.Mod index 7d7b4730..7cb5da8e 100644 --- a/src/lib/system/linux/gcc/x86_64/Unix.Mod +++ b/src/lib/system/linux/gcc/x86_64/Unix.Mod @@ -173,7 +173,7 @@ TYPE JmpBuf* = RECORD jmpbuf: ARRAY 8 OF LONGINT; (* 8 * 8 = 64 *) maskWasSaved*: INTEGER; - savedMask*: ARRAY 16 OF LONGINT; ( 16 * 8 = 128 *) + savedMask*: ARRAY 16 OF LONGINT; (* 16 * 8 = 128 *) END ; Status* = RECORD (* struct stat *) From 9dde57e9cdf5cf53eceb8353633f8cf0b5946e00 Mon Sep 17 00:00:00 2001 From: norayr Date: Fri, 8 May 2015 07:09:56 +0000 Subject: [PATCH 004/580] it seems that jmp_buf has some 4 bytes long field at the end, which is not described in header file. see http://hastebin.com/conujujeyu.pl for reference. i have also checked offsets. Former-commit-id: 6b4e51db23b63a2e68af9e7744cced618211171c --- src/lib/system/linux/clang/armv6j_hardfp/Unix.Mod | 1 + src/lib/system/linux/gcc/armv6j_hardfp/Unix.Mod | 1 + vocstatic.linux.gcc.armv6j_hardfp.REMOVED.git-id | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib/system/linux/clang/armv6j_hardfp/Unix.Mod b/src/lib/system/linux/clang/armv6j_hardfp/Unix.Mod index 228d824e..e4837302 100644 --- a/src/lib/system/linux/clang/armv6j_hardfp/Unix.Mod +++ b/src/lib/system/linux/clang/armv6j_hardfp/Unix.Mod @@ -172,6 +172,7 @@ TYPE jmpbuf: ARRAY 64 OF LONGINT; (* 256 / 4 = 64 *) maskWasSaved*: LONGINT; savedMask*: ARRAY 32 OF LONGINT; (* 32 * 4 = 128 *) + unknown*: LONGINT; (* jmp_buf seems to have unknown 4 bytes field at the end (see http://hastebin.com/conujujeyu.pl) which is not defined in header file *) END ; Status* = RECORD (* struct stat *) diff --git a/src/lib/system/linux/gcc/armv6j_hardfp/Unix.Mod b/src/lib/system/linux/gcc/armv6j_hardfp/Unix.Mod index 228d824e..e4837302 100644 --- a/src/lib/system/linux/gcc/armv6j_hardfp/Unix.Mod +++ b/src/lib/system/linux/gcc/armv6j_hardfp/Unix.Mod @@ -172,6 +172,7 @@ TYPE jmpbuf: ARRAY 64 OF LONGINT; (* 256 / 4 = 64 *) maskWasSaved*: LONGINT; savedMask*: ARRAY 32 OF LONGINT; (* 32 * 4 = 128 *) + unknown*: LONGINT; (* jmp_buf seems to have unknown 4 bytes field at the end (see http://hastebin.com/conujujeyu.pl) which is not defined in header file *) END ; Status* = RECORD (* struct stat *) diff --git a/vocstatic.linux.gcc.armv6j_hardfp.REMOVED.git-id b/vocstatic.linux.gcc.armv6j_hardfp.REMOVED.git-id index 140444df..e0ea9177 100644 --- a/vocstatic.linux.gcc.armv6j_hardfp.REMOVED.git-id +++ b/vocstatic.linux.gcc.armv6j_hardfp.REMOVED.git-id @@ -1 +1 @@ -4e13e8eb6afaaa783a650a7a9b305c092511996f \ No newline at end of file +3565dfed925394e3550b0435679db32ced7e5274 \ No newline at end of file From da7c2ed8b0feda0afb136caa0ff04233859c9baa Mon Sep 17 00:00:00 2001 From: norayr Date: Wed, 20 May 2015 18:40:48 +0400 Subject: [PATCH 005/580] added struct stat size check to Unix.Mod, will test it on different platforms. Former-commit-id: 15274cbfb0993a00982f1b923489a9a8f9860987 --- src/lib/system/darwin/clang/x86_64/Unix.Mod | 22 ++++++++++++++++++ src/lib/system/freebsd/clang/x86_64/Unix.Mod | 22 ++++++++++++++++++ .../system/linux/clang/armv6j_hardfp/Unix.Mod | 23 +++++++++++++++++++ src/lib/system/linux/clang/powerpc/Unix.Mod | 23 +++++++++++++++++++ src/lib/system/linux/clang/x86/Unix.Mod | 23 +++++++++++++++++++ src/lib/system/linux/clang/x86_64/Unix.Mod | 22 ++++++++++++++++++ .../system/linux/gcc/armv6j_hardfp/Unix.Mod | 23 +++++++++++++++++++ src/lib/system/linux/gcc/powerpc/Unix.Mod | 23 +++++++++++++++++++ src/lib/system/linux/gcc/x86/Unix.Mod | 23 +++++++++++++++++++ src/lib/system/linux/gcc/x86_64/Unix.Mod | 22 ++++++++++++++++++ vocstatic.linux.gcc.x86_64.REMOVED.git-id | 2 +- 11 files changed, 227 insertions(+), 1 deletion(-) diff --git a/src/lib/system/darwin/clang/x86_64/Unix.Mod b/src/lib/system/darwin/clang/x86_64/Unix.Mod index 635aacef..08fc1864 100644 --- a/src/lib/system/darwin/clang/x86_64/Unix.Mod +++ b/src/lib/system/darwin/clang/x86_64/Unix.Mod @@ -536,6 +536,28 @@ from man gettimeofday RETURN r END System; + PROCEDURE -SizeofUnixStat(): INTEGER + "sizeof(Unix_Status)"; + PROCEDURE -SizeofStat(): INTEGER + "sizeof(struct stat)"; + + PROCEDURE -Error(msg: ARRAY OF CHAR; len: INTEGER) + "write(1/*stdout*/, msg, len); char ch = 0xa; write(1, &ch, 1)"; + + PROCEDURE StatCheck; + VAR x, y: LONGINT; + BEGIN + x := SizeofUnixStat(); + y := SizeofStat(); + IF x # y THEN + Error("Unix.StatCheck: inconsistent usage of struct stat", 49); + Exit(1); + END + END StatCheck; + +BEGIN + + StatCheck(); END Unix. diff --git a/src/lib/system/freebsd/clang/x86_64/Unix.Mod b/src/lib/system/freebsd/clang/x86_64/Unix.Mod index 48e60a99..8d728be2 100644 --- a/src/lib/system/freebsd/clang/x86_64/Unix.Mod +++ b/src/lib/system/freebsd/clang/x86_64/Unix.Mod @@ -557,6 +557,28 @@ from man gettimeofday RETURN r END System; + PROCEDURE -SizeofUnixStat(): INTEGER + "sizeof(Unix_Status)"; + PROCEDURE -SizeofStat(): INTEGER + "sizeof(struct stat)"; + + PROCEDURE -Error(msg: ARRAY OF CHAR; len: INTEGER) + "write(1/*stdout*/, msg, len); char ch = 0xa; write(1, &ch, 1)"; + + PROCEDURE StatCheck; + VAR x, y: LONGINT; + BEGIN + x := SizeofUnixStat(); + y := SizeofStat(); + IF x # y THEN + Error("Unix.StatCheck: inconsistent usage of struct stat", 49); + Exit(1); + END + END StatCheck; + +BEGIN + + StatCheck(); END Unix. diff --git a/src/lib/system/linux/clang/armv6j_hardfp/Unix.Mod b/src/lib/system/linux/clang/armv6j_hardfp/Unix.Mod index e4837302..a882720a 100644 --- a/src/lib/system/linux/clang/armv6j_hardfp/Unix.Mod +++ b/src/lib/system/linux/clang/armv6j_hardfp/Unix.Mod @@ -456,4 +456,27 @@ TYPE RETURN r END System; + PROCEDURE -SizeofUnixStat(): INTEGER + "sizeof(Unix_Status)"; + + PROCEDURE -SizeofStat(): INTEGER + "sizeof(struct stat)"; + + PROCEDURE -Error(msg: ARRAY OF CHAR; len: INTEGER) + "write(1/*stdout*/, msg, len); char ch = 0xa; write(1, &ch, 1)"; + + PROCEDURE StatCheck; + VAR x, y: LONGINT; + BEGIN + x := SizeofUnixStat(); + y := SizeofStat(); + IF x # y THEN + Error("Unix.StatCheck: inconsistent usage of struct stat", 49); + Exit(1); + END + END StatCheck; + +BEGIN + + StatCheck(); END Unix. diff --git a/src/lib/system/linux/clang/powerpc/Unix.Mod b/src/lib/system/linux/clang/powerpc/Unix.Mod index aa6fdd7d..99c35a64 100644 --- a/src/lib/system/linux/clang/powerpc/Unix.Mod +++ b/src/lib/system/linux/clang/powerpc/Unix.Mod @@ -439,4 +439,27 @@ TYPE RETURN r END System; + PROCEDURE -SizeofUnixStat(): INTEGER + "sizeof(Unix_Status)"; + + PROCEDURE -SizeofStat(): INTEGER + "sizeof(struct stat)"; + + PROCEDURE -Error(msg: ARRAY OF CHAR; len: INTEGER) + "write(1/*stdout*/, msg, len); char ch = 0xa; write(1, &ch, 1)"; + + PROCEDURE StatCheck; + VAR x, y: LONGINT; + BEGIN + x := SizeofUnixStat(); + y := SizeofStat(); + IF x # y THEN + Error("Unix.StatCheck: inconsistent usage of struct stat", 49); + Exit(1); + END + END StatCheck; + +BEGIN + + StatCheck(); END Unix. diff --git a/src/lib/system/linux/clang/x86/Unix.Mod b/src/lib/system/linux/clang/x86/Unix.Mod index 6ba884e5..a77bccae 100644 --- a/src/lib/system/linux/clang/x86/Unix.Mod +++ b/src/lib/system/linux/clang/x86/Unix.Mod @@ -439,4 +439,27 @@ TYPE RETURN r END System; + PROCEDURE -SizeofUnixStat(): INTEGER + "sizeof(Unix_Status)"; + + PROCEDURE -SizeofStat(): INTEGER + "sizeof(struct stat)"; + + PROCEDURE -Error(msg: ARRAY OF CHAR; len: INTEGER) + "write(1/*stdout*/, msg, len); char ch = 0xa; write(1, &ch, 1)"; + + PROCEDURE StatCheck; + VAR x, y: LONGINT; + BEGIN + x := SizeofUnixStat(); + y := SizeofStat(); + IF x # y THEN + Error("Unix.StatCheck: inconsistent usage of struct stat", 49); + Exit(1); + END + END StatCheck; + +BEGIN + + StatCheck(); END Unix. diff --git a/src/lib/system/linux/clang/x86_64/Unix.Mod b/src/lib/system/linux/clang/x86_64/Unix.Mod index 7cb5da8e..151541ad 100644 --- a/src/lib/system/linux/clang/x86_64/Unix.Mod +++ b/src/lib/system/linux/clang/x86_64/Unix.Mod @@ -492,6 +492,28 @@ from man gettimeofday RETURN r END System; + PROCEDURE -SizeofUnixStat(): INTEGER + "sizeof(Unix_Status)"; + PROCEDURE -SizeofStat(): INTEGER + "sizeof(struct stat)"; + + PROCEDURE -Error(msg: ARRAY OF CHAR; len: INTEGER) + "write(1/*stdout*/, msg, len); char ch = 0xa; write(1, &ch, 1)"; + + PROCEDURE StatCheck; + VAR x, y: LONGINT; + BEGIN + x := SizeofUnixStat(); + y := SizeofStat(); + IF x # y THEN + Error("Unix.StatCheck: inconsistent usage of struct stat", 49); + Exit(1); + END + END StatCheck; + +BEGIN + + StatCheck(); END Unix. diff --git a/src/lib/system/linux/gcc/armv6j_hardfp/Unix.Mod b/src/lib/system/linux/gcc/armv6j_hardfp/Unix.Mod index e4837302..a882720a 100644 --- a/src/lib/system/linux/gcc/armv6j_hardfp/Unix.Mod +++ b/src/lib/system/linux/gcc/armv6j_hardfp/Unix.Mod @@ -456,4 +456,27 @@ TYPE RETURN r END System; + PROCEDURE -SizeofUnixStat(): INTEGER + "sizeof(Unix_Status)"; + + PROCEDURE -SizeofStat(): INTEGER + "sizeof(struct stat)"; + + PROCEDURE -Error(msg: ARRAY OF CHAR; len: INTEGER) + "write(1/*stdout*/, msg, len); char ch = 0xa; write(1, &ch, 1)"; + + PROCEDURE StatCheck; + VAR x, y: LONGINT; + BEGIN + x := SizeofUnixStat(); + y := SizeofStat(); + IF x # y THEN + Error("Unix.StatCheck: inconsistent usage of struct stat", 49); + Exit(1); + END + END StatCheck; + +BEGIN + + StatCheck(); END Unix. diff --git a/src/lib/system/linux/gcc/powerpc/Unix.Mod b/src/lib/system/linux/gcc/powerpc/Unix.Mod index aa6fdd7d..99c35a64 100644 --- a/src/lib/system/linux/gcc/powerpc/Unix.Mod +++ b/src/lib/system/linux/gcc/powerpc/Unix.Mod @@ -439,4 +439,27 @@ TYPE RETURN r END System; + PROCEDURE -SizeofUnixStat(): INTEGER + "sizeof(Unix_Status)"; + + PROCEDURE -SizeofStat(): INTEGER + "sizeof(struct stat)"; + + PROCEDURE -Error(msg: ARRAY OF CHAR; len: INTEGER) + "write(1/*stdout*/, msg, len); char ch = 0xa; write(1, &ch, 1)"; + + PROCEDURE StatCheck; + VAR x, y: LONGINT; + BEGIN + x := SizeofUnixStat(); + y := SizeofStat(); + IF x # y THEN + Error("Unix.StatCheck: inconsistent usage of struct stat", 49); + Exit(1); + END + END StatCheck; + +BEGIN + + StatCheck(); END Unix. diff --git a/src/lib/system/linux/gcc/x86/Unix.Mod b/src/lib/system/linux/gcc/x86/Unix.Mod index 6ba884e5..a77bccae 100644 --- a/src/lib/system/linux/gcc/x86/Unix.Mod +++ b/src/lib/system/linux/gcc/x86/Unix.Mod @@ -439,4 +439,27 @@ TYPE RETURN r END System; + PROCEDURE -SizeofUnixStat(): INTEGER + "sizeof(Unix_Status)"; + + PROCEDURE -SizeofStat(): INTEGER + "sizeof(struct stat)"; + + PROCEDURE -Error(msg: ARRAY OF CHAR; len: INTEGER) + "write(1/*stdout*/, msg, len); char ch = 0xa; write(1, &ch, 1)"; + + PROCEDURE StatCheck; + VAR x, y: LONGINT; + BEGIN + x := SizeofUnixStat(); + y := SizeofStat(); + IF x # y THEN + Error("Unix.StatCheck: inconsistent usage of struct stat", 49); + Exit(1); + END + END StatCheck; + +BEGIN + + StatCheck(); END Unix. diff --git a/src/lib/system/linux/gcc/x86_64/Unix.Mod b/src/lib/system/linux/gcc/x86_64/Unix.Mod index 7cb5da8e..151541ad 100644 --- a/src/lib/system/linux/gcc/x86_64/Unix.Mod +++ b/src/lib/system/linux/gcc/x86_64/Unix.Mod @@ -492,6 +492,28 @@ from man gettimeofday RETURN r END System; + PROCEDURE -SizeofUnixStat(): INTEGER + "sizeof(Unix_Status)"; + PROCEDURE -SizeofStat(): INTEGER + "sizeof(struct stat)"; + + PROCEDURE -Error(msg: ARRAY OF CHAR; len: INTEGER) + "write(1/*stdout*/, msg, len); char ch = 0xa; write(1, &ch, 1)"; + + PROCEDURE StatCheck; + VAR x, y: LONGINT; + BEGIN + x := SizeofUnixStat(); + y := SizeofStat(); + IF x # y THEN + Error("Unix.StatCheck: inconsistent usage of struct stat", 49); + Exit(1); + END + END StatCheck; + +BEGIN + + StatCheck(); END Unix. diff --git a/vocstatic.linux.gcc.x86_64.REMOVED.git-id b/vocstatic.linux.gcc.x86_64.REMOVED.git-id index 68e5e95a..e1cf150c 100644 --- a/vocstatic.linux.gcc.x86_64.REMOVED.git-id +++ b/vocstatic.linux.gcc.x86_64.REMOVED.git-id @@ -1 +1 @@ -82105aa4959ab990f96645db6fee788397ea97e2 \ No newline at end of file +7db4dcd699d480d460219139ee1d2cc1f7c9ec19 \ No newline at end of file From 4174762c96ea851ea356ee3acf51d2e1f12db1e4 Mon Sep 17 00:00:00 2001 From: norayr Date: Wed, 20 May 2015 23:12:28 +0800 Subject: [PATCH 006/580] SetJmp fixed on darwin; -- noch Former-commit-id: ffe9476fd2aa6be60f9e6e2a7119ec42778be07d --- 05vishap.conf | 2 +- src/lib/system/darwin/clang/x86_64/Unix.Mod | 52 ++------------------ src/voc/prf.Mod | 2 +- vocstatic.darwin.clang.x86_64.REMOVED.git-id | 2 +- 4 files changed, 6 insertions(+), 52 deletions(-) diff --git a/05vishap.conf b/05vishap.conf index 88a0e25c..5f24107a 100644 --- a/05vishap.conf +++ b/05vishap.conf @@ -1 +1 @@ -/opt/voc-1.1/lib +/Users/noch/local/voc-1.1/lib diff --git a/src/lib/system/darwin/clang/x86_64/Unix.Mod b/src/lib/system/darwin/clang/x86_64/Unix.Mod index 08fc1864..a7e4335b 100644 --- a/src/lib/system/darwin/clang/x86_64/Unix.Mod +++ b/src/lib/system/darwin/clang/x86_64/Unix.Mod @@ -154,61 +154,15 @@ CONST sigsetarrlength = 1024 / 8 * SIZE(LONGINT); TYPE -(* bits/sigset.h - _SIGSET_NWORDS (1024 / (8 * sizeof (unsigned long int))) - - 1024 / 8*8 = 16 - 1024 / 8*4 = 32 -*) - sigsett* = RECORD - val : ARRAY 16 OF LONGINT (* 32 for 32 bit *) - (*val : ARRAY sigsetarrlength OF LONGINT *) - END; JmpBuf* = RECORD (* macosx darwin 64bit, cpp /usr/include/setjmp.h typedef int jmp_buf[((9 * 2) + 3 + 16)]; + typedef int sigjmp_buf[((9 * 2) + 3 + 16) + 1]; *) - (*bx*, si*, di*, bp*, sp*, pc*: LONGINT;*) - (* bits/setjmp.h sets up longer array in GNU libc *) - (* - # if __WORDSIZE == 64 - typedef long int __jmp_buf[8]; - # else - typedef int __jmp_buf[6]; - # endif - *) - (*bx*, si*, di*, bp*, sp*, pc*, ki*, ku*: LONGINT;*) - f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, - f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, - f30, f31, f32, f33, f34, f35, f36: INTEGER; - (* setjmp.h -/* Calling environment, plus possibly a saved signal mask. */ -struct __jmp_buf_tag - { - /* NOTE: The machine-dependent definitions of `__sigsetjmp' - assume that a `jmp_buf' begins with a `__jmp_buf' and that - `__mask_was_saved' follows it. Do not move these members - or add others before it. */ - __jmp_buf __jmpbuf; /* Calling environment. */ - int __mask_was_saved; /* Saved the signal mask? */ - __sigset_t __saved_mask; /* Saved signal mask. */ - }; - - *) - (*maskWasSaved*, savedMask*: LONGINT;*) - (*maskWasSaved*: INTEGER; *) - (* - # define _SIGSET_NWORDS (1024 / (8 * sizeof (unsigned long int))) -typedef struct - { - unsigned long int __val[_SIGSET_NWORDS]; - } __sigset_t; - - *) - (*savedMask*: sigsett;*) - END ; + jmpbuf: ARRAY 38 OF INTEGER; + END ; Status* = RECORD (* struct stat *) dev* : INTEGER; (* dev_t 4 *) diff --git a/src/voc/prf.Mod b/src/voc/prf.Mod index 2f4d8f24..d97f3ae5 100644 --- a/src/voc/prf.Mod +++ b/src/voc/prf.Mod @@ -1,5 +1,5 @@ MODULE prf; -CONST prefix* = "/opt"; +CONST prefix* = "/Users/noch/local"; END prf. diff --git a/vocstatic.darwin.clang.x86_64.REMOVED.git-id b/vocstatic.darwin.clang.x86_64.REMOVED.git-id index 67681f22..ff1813f0 100644 --- a/vocstatic.darwin.clang.x86_64.REMOVED.git-id +++ b/vocstatic.darwin.clang.x86_64.REMOVED.git-id @@ -1 +1 @@ -d1de9860a41f9745ed7c65ba12a72d48b027254b \ No newline at end of file +8e48e37af1816a7bada0630583b22d2550196738 \ No newline at end of file From 734ee7b330f0a4b75d532f88932fa5ceb14cc5a4 Mon Sep 17 00:00:00 2001 From: norayr Date: Wed, 20 May 2015 16:20:39 +0000 Subject: [PATCH 007/580] unix module fixes for freebsd; -- noch Former-commit-id: d749f3e8e911a8dd60d809e0156b40182d5b975e --- src/lib/system/freebsd/clang/x86_64/Unix.Mod | 117 +++++++------------ src/voc/prf.Mod | 2 +- 2 files changed, 46 insertions(+), 73 deletions(-) diff --git a/src/lib/system/freebsd/clang/x86_64/Unix.Mod b/src/lib/system/freebsd/clang/x86_64/Unix.Mod index 8d728be2..9d144b41 100644 --- a/src/lib/system/freebsd/clang/x86_64/Unix.Mod +++ b/src/lib/system/freebsd/clang/x86_64/Unix.Mod @@ -154,81 +154,55 @@ CONST sigsetarrlength = 1024 / 8 * SIZE(LONGINT); TYPE -(* bits/sigset.h - _SIGSET_NWORDS (1024 / (8 * sizeof (unsigned long int))) - - 1024 / 8*8 = 16 - 1024 / 8*4 = 32 -*) - sigsett* = RECORD - val : ARRAY 16 OF LONGINT (* 32 for 32 bit *) - (*val : ARRAY sigsetarrlength OF LONGINT *) - END; JmpBuf* = RECORD - (* macosx darwin 64bit, cpp /usr/include/setjmp.h - typedef int jmp_buf[((9 * 2) + 3 + 16)]; - *) - - (*bx*, si*, di*, bp*, sp*, pc*: LONGINT;*) - (* bits/setjmp.h sets up longer array in GNU libc *) - (* - # if __WORDSIZE == 64 - typedef long int __jmp_buf[8]; - # else - typedef int __jmp_buf[6]; - # endif - *) - (*bx*, si*, di*, bp*, sp*, pc*, ki*, ku*: LONGINT;*) - f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, - f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, - f30, f31, f32, f33, f34, f35, f36: INTEGER; - (* setjmp.h -/* Calling environment, plus possibly a saved signal mask. */ -struct __jmp_buf_tag - { - /* NOTE: The machine-dependent definitions of `__sigsetjmp' - assume that a `jmp_buf' begins with a `__jmp_buf' and that - `__mask_was_saved' follows it. Do not move these members - or add others before it. */ - __jmp_buf __jmpbuf; /* Calling environment. */ - int __mask_was_saved; /* Saved the signal mask? */ - __sigset_t __saved_mask; /* Saved signal mask. */ - }; - - *) - (*maskWasSaved*, savedMask*: LONGINT;*) - (*maskWasSaved*: INTEGER; *) - (* - # define _SIGSET_NWORDS (1024 / (8 * sizeof (unsigned long int))) -typedef struct - { - unsigned long int __val[_SIGSET_NWORDS]; - } __sigset_t; - - *) - (*savedMask*: sigsett;*) + jmpbuf: ARRAY 12 OF LONGINT; END ; (* - Status* = RECORD (* struct stat *) - dev* : INTEGER; (* dev_t 4 *) - mode*: SHORTINT; mode1*: SHORTINT; (* mode_t 2 *) - nlink* : SHORTINT; nlink1*: SHORTINT; (* nlink_t 2 *) - ino* : LONGINT; (* __darwin_ino64_t 8 *) - uid*, gid*: INTEGER; (* uid_t, gid_t 4 *) - rdev*: INTEGER; (* dev_t 4 *) - atime* : LONGINT; atimences* : LONGINT; (* struct timespec 16 *) - mtime* : LONGINT; mtimences* : LONGINT; (* struct timespec 16 *) - ctime* : LONGINT; ctimences* : LONGINT; (* struct timespec 16 *) - birthtime* : LONGINT; birthtimences* : LONGINT; (* struct timespec 16 *) - size*: LONGINT; (* off_t 8 *) - blocks* : LONGINT; - blksize* : INTEGER; - flags* : INTEGER; - gen* : INTEGER; - lspare* : INTEGER; - qspare*, qspare1*: LONGINT; - END ; +from output of cpp /usr/include/sys/stat.h + +struct stat { + __dev_t st_dev; + ino_t st_ino; + mode_t st_mode; + nlink_t st_nlink; + uid_t st_uid; + gid_t st_gid; + __dev_t st_rdev; + struct timespec st_atim; + struct timespec st_mtim; + struct timespec st_ctim; + off_t st_size; + blkcnt_t st_blocks; + blksize_t st_blksize; + fflags_t st_flags; + __uint32_t st_gen; + __int32_t st_lspare; + struct timespec st_birthtim; +# 148 "/usr/include/sys/stat.h" + unsigned int :(8 / 2) * (16 - (int)sizeof(struct timespec)); + unsigned int :(8 / 2) * (16 - (int)sizeof(struct timespec)); +}; + +sizes on freebsd 64 bit +short int 2 +int 4 +long 8 +long int 8 +size_t 8 +dev_t 4 +ino_t 4 +mode_t 2 +nlink_t 2 +uid_t 4 +gid_t 4 +off_t 8 +blksize_t 4 +blkcnt_t 8 +time_t 8 +fflags_t 4 +__uint32_t 4 +__int32_t 4 *) Status* = RECORD (* struct stat *) dev* : INTEGER; (* dev_t 4 *) @@ -247,7 +221,6 @@ typedef struct gen* : INTEGER; lspare* : INTEGER; birthtime* : LONGINT; birthtimences* : LONGINT; (* struct timespec 16 *) - qspare*, qspare1*: INTEGER; END ; diff --git a/src/voc/prf.Mod b/src/voc/prf.Mod index d97f3ae5..2f4d8f24 100644 --- a/src/voc/prf.Mod +++ b/src/voc/prf.Mod @@ -1,5 +1,5 @@ MODULE prf; -CONST prefix* = "/Users/noch/local"; +CONST prefix* = "/opt"; END prf. From 93d8df0e4f09008a6c69b731fd6437683a2570a3 Mon Sep 17 00:00:00 2001 From: norayr Date: Wed, 20 May 2015 17:07:31 +0000 Subject: [PATCH 008/580] freebsd binary update. -- noch Former-commit-id: 566f40700ef50922ed914f6be3e89f27a5cd918b --- 05vishap.conf | 2 +- vocstatic.freebsd.clang.x86_64.REMOVED.git-id | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/05vishap.conf b/05vishap.conf index 5f24107a..88a0e25c 100644 --- a/05vishap.conf +++ b/05vishap.conf @@ -1 +1 @@ -/Users/noch/local/voc-1.1/lib +/opt/voc-1.1/lib diff --git a/vocstatic.freebsd.clang.x86_64.REMOVED.git-id b/vocstatic.freebsd.clang.x86_64.REMOVED.git-id index 37650040..6f361818 100644 --- a/vocstatic.freebsd.clang.x86_64.REMOVED.git-id +++ b/vocstatic.freebsd.clang.x86_64.REMOVED.git-id @@ -1 +1 @@ -ec008a6f32a2574154feb12f998db0e80033d6f6 \ No newline at end of file +07680f59739d1b75018d64a9b1e7cb438ef93411 \ No newline at end of file From 31c5b31daeee469e9c7c6900a8185f6764c1af13 Mon Sep 17 00:00:00 2001 From: Norayr Chilingarian Date: Wed, 27 May 2015 02:03:59 +0400 Subject: [PATCH 009/580] makefiles fixed Former-commit-id: fbdf562e2e510bf46d5fe935b7391d3d84870f7b --- src/test/x11/IFS/makefile | 3 +-- src/test/x11/mines/makefile | 3 +-- src/test/x11/pacman/makefile | 3 +-- src/test/x11/tetris/makefile | 3 +-- src/test/x11/tron/makefile | 3 +-- src/test/x11/vier/makefile | 3 +-- vocstatic.linux.gcc.x86_64.REMOVED.git-id | 2 +- 7 files changed, 7 insertions(+), 13 deletions(-) diff --git a/src/test/x11/IFS/makefile b/src/test/x11/IFS/makefile index d05ad8f9..eda916b9 100644 --- a/src/test/x11/IFS/makefile +++ b/src/test/x11/IFS/makefile @@ -5,8 +5,7 @@ MOD = MODULES="../../../lib/oocX11" VOC = $(MOD) /opt/voc/bin/voc all: - $(VOC) -s oocX11.Mod oocXutil.Mod oocXYplane.Mod - $(VOC) -s IFS.Mod IFStest.Mod -m + $(VOC) -s oocX11.Mod oocXutil.Mod oocXYplane.Mod IFS.Mod IFStest.Mod -m #$(VOC) -Cm test.Mod #gcc -o test test.o -fPIC -g -I /opt/voc-1.0/src/lib/system/gcc/x86_64 -I /opt/voc-1.0/lib/voc/obj -lVishapOberon -L. -L/opt/voc-1.0/lib -lX11 diff --git a/src/test/x11/mines/makefile b/src/test/x11/mines/makefile index f0c03002..02d5c8b4 100644 --- a/src/test/x11/mines/makefile +++ b/src/test/x11/mines/makefile @@ -7,8 +7,7 @@ MOD = MODULES="../../../lib/oocX11" VOC = $(MOD) /opt/voc/bin/voc all: - $(VOC) -s oocX11.Mod oocXutil.Mod oocXYplane.Mod - $(VOC) -s compatIn.Mod Linie.Mod Minesweeper.Mod -m + $(VOC) -s oocX11.Mod oocXutil.Mod oocXYplane.Mod compatIn.Mod Linie.Mod Minesweeper.Mod -m #$(VOC) -Cm test.Mod #gcc -o test test.o -fPIC -g -I /opt/voc-1.0/src/lib/system/gcc/x86_64 -I /opt/voc-1.0/lib/voc/obj -lVishapOberon -L. -L/opt/voc-1.0/lib -lX11 diff --git a/src/test/x11/pacman/makefile b/src/test/x11/pacman/makefile index 59f90e30..018f29c7 100644 --- a/src/test/x11/pacman/makefile +++ b/src/test/x11/pacman/makefile @@ -7,8 +7,7 @@ MOD = MODULES="../../../lib/oocX11" VOC = $(MOD) /opt/voc/bin/voc all: - $(VOC) -s oocX11.Mod oocXutil.Mod oocXYplane.Mod - $(VOC) -s Grafik.Mod PacMan.Mod -m + $(VOC) -s oocX11.Mod oocXutil.Mod oocXYplane.Mod Grafik.Mod PacMan.Mod -m #$(VOC) -Cm test.Mod #gcc -o test test.o -fPIC -g -I /opt/voc-1.0/src/lib/system/gcc/x86_64 -I /opt/voc-1.0/lib/voc/obj -lVishapOberon -L. -L/opt/voc-1.0/lib -lX11 diff --git a/src/test/x11/tetris/makefile b/src/test/x11/tetris/makefile index 466b17f2..ae2c5119 100644 --- a/src/test/x11/tetris/makefile +++ b/src/test/x11/tetris/makefile @@ -7,8 +7,7 @@ MOD = MODULES="../../../lib/oocX11" VOC = $(MOD) /opt/voc/bin/voc all: - $(VOC) -s oocX11.Mod oocXutil.Mod oocXYplane.Mod - $(VOC) -s compatIn.Mod Linie.Mod Ziffer.Mod Tetris.Mod -m + $(VOC) -s oocX11.Mod oocXutil.Mod oocXYplane.Mod compatIn.Mod Linie.Mod Ziffer.Mod Tetris.Mod -m #$(VOC) -Cm test.Mod #gcc -o test test.o -fPIC -g -I /opt/voc-1.0/src/lib/system/gcc/x86_64 -I /opt/voc-1.0/lib/voc/obj -lVishapOberon -L. -L/opt/voc-1.0/lib -lX11 diff --git a/src/test/x11/tron/makefile b/src/test/x11/tron/makefile index 26bee138..be94ea28 100644 --- a/src/test/x11/tron/makefile +++ b/src/test/x11/tron/makefile @@ -7,8 +7,7 @@ MOD = MODULES="../../../lib/oocX11" VOC = $(MOD) /opt/voc/bin/voc all: - $(VOC) -s oocX11.Mod oocXutil.Mod oocXYplane.Mod - $(VOC) compatIn.Mod Tron.Mod -m + $(VOC) -s oocX11.Mod oocXutil.Mod oocXYplane.Mod compatIn.Mod Tron.Mod -m #$(VOC) -Cm test.Mod #gcc -o test test.o -fPIC -g -I /opt/voc-1.0/src/lib/system/gcc/x86_64 -I /opt/voc-1.0/lib/voc/obj -lVishapOberon -L. -L/opt/voc-1.0/lib -lX11 diff --git a/src/test/x11/vier/makefile b/src/test/x11/vier/makefile index 06cdaf00..2c39f530 100644 --- a/src/test/x11/vier/makefile +++ b/src/test/x11/vier/makefile @@ -7,8 +7,7 @@ MOD = MODULES="../../../lib/oocX11" VOC = $(MOD) /opt/voc/bin/voc all: - $(VOC) -s oocX11.Mod oocXutil.Mod oocXYplane.Mod - $(VOC) -s compatIn.Mod Ausgabe.Mod Vier.Mod -m + $(VOC) -s oocX11.Mod oocXutil.Mod oocXYplane.Mod compatIn.Mod Ausgabe.Mod Vier.Mod -m #$(VOC) -Cm test.Mod #gcc -o test test.o -fPIC -g -I /opt/voc-1.0/src/lib/system/gcc/x86_64 -I /opt/voc-1.0/lib/voc/obj -lVishapOberon -L. -L/opt/voc-1.0/lib -lX11 diff --git a/vocstatic.linux.gcc.x86_64.REMOVED.git-id b/vocstatic.linux.gcc.x86_64.REMOVED.git-id index e1cf150c..28f4a771 100644 --- a/vocstatic.linux.gcc.x86_64.REMOVED.git-id +++ b/vocstatic.linux.gcc.x86_64.REMOVED.git-id @@ -1 +1 @@ -7db4dcd699d480d460219139ee1d2cc1f7c9ec19 \ No newline at end of file +af9696cb6794adf44a4b1ffe311e8e009394cd0f \ No newline at end of file From 7d5cab15905d96d0c3b4fb4133417cb087874a98 Mon Sep 17 00:00:00 2001 From: Norayr Chilingarian Date: Wed, 27 May 2015 02:56:52 +0400 Subject: [PATCH 010/580] added events example. Former-commit-id: 3665c36d276f7209ed09a93dc2e08d2e34a393c0 --- src/test/events/README.md | 7 +++++ src/test/events/clb.Mod | 55 +++++++++++++++++++++++++++++++++++++++ src/test/events/makefile | 4 +++ 3 files changed, 66 insertions(+) create mode 100644 src/test/events/README.md create mode 100644 src/test/events/clb.Mod create mode 100644 src/test/events/makefile diff --git a/src/test/events/README.md b/src/test/events/README.md new file mode 100644 index 00000000..32729f67 --- /dev/null +++ b/src/test/events/README.md @@ -0,0 +1,7 @@ +**events example in oberon** + +Just a simple example which helps to explain how events are implemented, what is callback procedure, and how easy it is. + +Some languages simplify programmer's work, hide details, so that it's not obvious to him what's going on when he defines it's own OnSomething function. + +Callbacks are common when dealing with gui events like OnClick but they can be used with any events. I guess code is simple enough, it doesn't need explanation. diff --git a/src/test/events/clb.Mod b/src/test/events/clb.Mod new file mode 100644 index 00000000..218b82b7 --- /dev/null +++ b/src/test/events/clb.Mod @@ -0,0 +1,55 @@ +MODULE clb; + +IMPORT Console; + +TYPE OnSomething = PROCEDURE (x, y : INTEGER); + +PROCEDURE ProcessEvents(x, y : INTEGER; onsomething : OnSomething); + +BEGIN + +IF onsomething # NIL THEN onsomething(x, y) +ELSE + Console.String("didn't happen"); Console.Ln +END; + +END ProcessEvents; + + +PROCEDURE OnEvent(x, y : INTEGER); + +BEGIN + +Console.String("event happened"); Console.Ln + +END OnEvent; + +PROCEDURE OnEvent2(x, y : INTEGER); + +BEGIN + +Console.String("happened"); Console.Ln + +END OnEvent2; + +PROCEDURE Something; +VAR onsmth : OnSomething; + +BEGIN + + onsmth := NIL; + ProcessEvents(0, 0, onsmth); + + onsmth := OnEvent; + ProcessEvents(0, 0, onsmth); + +END Something; + +BEGIN + Something; +(* +ProcessEvents(0, 0, NIL); +ProcessEvents(0, 0, OnEvent); +ProcessEvents(0, 0, OnEvent2); +*) +END clb. diff --git a/src/test/events/makefile b/src/test/events/makefile new file mode 100644 index 00000000..b2f73828 --- /dev/null +++ b/src/test/events/makefile @@ -0,0 +1,4 @@ + + +all: + /opt/voc/bin/voc -M clb.Mod From 015617518c5ee2a8bb2b8a5b32b6dc18544dea70 Mon Sep 17 00:00:00 2001 From: norayr Date: Wed, 3 Jun 2015 20:41:55 +0400 Subject: [PATCH 011/580] small fix; -- noch Former-commit-id: 643e79f65d0b1e03c7ee0f64cc5143c505b1155e --- src/voc/errors.Mod | 4 ++-- vocstatic.linux.gcc.x86_64.REMOVED.git-id | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/voc/errors.Mod b/src/voc/errors.Mod index 1ccdcc92..02d6b84a 100644 --- a/src/voc/errors.Mod +++ b/src/voc/errors.Mod @@ -14,8 +14,8 @@ errors[3] := "illegal character in string"; errors[4] := "identifier does not match procedure name"; errors[5] := "comment not closed"; errors[6] := ""; -errors[6] := ""; -errors[6] := ""; +errors[7] := ""; +errors[8] := ""; errors[9] := "'=' expected"; errors[10] :=""; errors[11] :=""; diff --git a/vocstatic.linux.gcc.x86_64.REMOVED.git-id b/vocstatic.linux.gcc.x86_64.REMOVED.git-id index 28f4a771..6f222cb4 100644 --- a/vocstatic.linux.gcc.x86_64.REMOVED.git-id +++ b/vocstatic.linux.gcc.x86_64.REMOVED.git-id @@ -1 +1 @@ -af9696cb6794adf44a4b1ffe311e8e009394cd0f \ No newline at end of file +80e5f927908e8441dcbdb947ac1b71a0d02e861c \ No newline at end of file From 4d34283a4eb66d10138ade54d13de901e3d7508c Mon Sep 17 00:00:00 2001 From: norayr Date: Tue, 16 Jun 2015 21:33:41 +0400 Subject: [PATCH 012/580] fixed bug found by zorko and described [here](https://code.google.com/p/ofront/issues/detail?id=6) with a little modification. Former-commit-id: 7ff54e56bde316701c8023ed84cf2e0b6aee569c --- src/voc/OPC.Mod | 2 +- vocstatic.linux.gcc.x86_64.REMOVED.git-id | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/voc/OPC.Mod b/src/voc/OPC.Mod index 77547af9..261d0f44 100644 --- a/src/voc/OPC.Mod +++ b/src/voc/OPC.Mod @@ -203,7 +203,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) ELSE pointers := 0; WHILE (typ^.strobj = NIL) & (typ^.form = Pointer) DO INC (pointers); typ := typ^.BaseTyp END ; - IF typ^.comp # DynArr THEN Stars (typ, openClause) END ; + IF (typ^.comp # DynArr) & (pointers # 0) THEN Stars (typ, openClause) END ; IF pointers > 0 THEN IF openClause THEN OPM.Write(OpenParen); openClause := FALSE END ; WHILE pointers > 0 DO OPM.Write(Star); DEC (pointers) END diff --git a/vocstatic.linux.gcc.x86_64.REMOVED.git-id b/vocstatic.linux.gcc.x86_64.REMOVED.git-id index 6f222cb4..4c874123 100644 --- a/vocstatic.linux.gcc.x86_64.REMOVED.git-id +++ b/vocstatic.linux.gcc.x86_64.REMOVED.git-id @@ -1 +1 @@ -80e5f927908e8441dcbdb947ac1b71a0d02e861c \ No newline at end of file +1bf4f972c6fb10b8b7f3c6613948482a1682528c \ No newline at end of file From d04bc11849d05d3b089767511acf847acf508cad Mon Sep 17 00:00:00 2001 From: norayr Date: Wed, 1 Jul 2015 15:52:22 +0400 Subject: [PATCH 013/580] moved Oberon.Mod to v4_compat directory. -- noch; Former-commit-id: 2beff88af5fb90ad3db088f9a332e57f0e615e67 --- makefile | 2 +- makefile.darwin.clang.x86_64 | 2 +- makefile.freebsd.clang.x86_64 | 2 +- makefile.linux.clang.powerpc | 2 +- makefile.linux.clang.x86_64 | 2 +- makefile.linux.gcc.armv6j_hardfp | 2 +- makefile.linux.gcc.powerpc | 2 +- makefile.linux.gcc.x86 | 2 +- makefile.linux.gcc.x86_64 | 2 +- src/lib/system/linux/gcc/x86_64/Unix.Mod | 2 +- src/lib/{v4 => v4_compat}/Oberon.Mod | 1 + 11 files changed, 11 insertions(+), 10 deletions(-) rename src/lib/{v4 => v4_compat}/Oberon.Mod (98%) diff --git a/makefile b/makefile index 60f338e3..c9399316 100644 --- a/makefile +++ b/makefile @@ -9,7 +9,7 @@ RELEASE = 1.1 INCLUDEPATH = -Isrc/lib/system/$(TOS)/$(CCOMP)/$(TARCH) -SETPATH = CFLAGS=$(INCLUDEPATH) PATH=.:/bin:/usr/bin MODULES=.:src/lib:src/lib/v4:src/lib/v4/$(TARCH):src/lib/system/$(TOS)/$(CCOMP):src/lib/system/$(TOS)/$(CCOMP)/$(TARCH):src/lib/ulm:src/lib/ulm/$(TARCH):src/lib/ooc2:src/lib/ooc2/$(TOS)/$(CCOMP):src/lib/ooc:src/lib/ooc/$(TOS)/$(CCOMP)/$(TARCH):src/lib/pow:src/lib/misc:src/lib/s3:src/lib/s3/$(TARCH):src/voc:src/voc/$(TOS)/$(CCOMP):src/voc/$(TOS)/$(CCOMP)/$(TARCH):src/tools/ocat:src/tools/browser:src/tools/vocparam:src/tools/vmake:src/tools/coco:src/test +SETPATH = CFLAGS=$(INCLUDEPATH) PATH=.:/bin:/usr/bin MODULES=.:src/lib:src/lib/v4:src/lib/v4/$(TARCH):src/lib/v4_compat:src/lib/system/$(TOS)/$(CCOMP):src/lib/system/$(TOS)/$(CCOMP)/$(TARCH):src/lib/ulm:src/lib/ulm/$(TARCH):src/lib/ooc2:src/lib/ooc2/$(TOS)/$(CCOMP):src/lib/ooc:src/lib/ooc/$(TOS)/$(CCOMP)/$(TARCH):src/lib/pow:src/lib/misc:src/lib/s3:src/lib/s3/$(TARCH):src/voc:src/voc/$(TOS)/$(CCOMP):src/voc/$(TOS)/$(CCOMP)/$(TARCH):src/tools/ocat:src/tools/browser:src/tools/vocparam:src/tools/vmake:src/tools/coco:src/test VOC = voc VERSION = $(TOS).$(CCOMP).$(TARCH) diff --git a/makefile.darwin.clang.x86_64 b/makefile.darwin.clang.x86_64 index 8fee0d18..a08a8d3c 100644 --- a/makefile.darwin.clang.x86_64 +++ b/makefile.darwin.clang.x86_64 @@ -9,7 +9,7 @@ RELEASE = 1.1 INCLUDEPATH = -Isrc/lib/system/$(TOS)/$(CCOMP)/$(TARCH) -SETPATH = CFLAGS=$(INCLUDEPATH) PATH=.:/bin:/usr/bin MODULES=.:src/lib:src/lib/v4:src/lib/v4/$(TARCH):src/lib/system/$(TOS)/$(CCOMP):src/lib/system/$(TOS)/$(CCOMP)/$(TARCH):src/lib/ulm:src/lib/ulm/$(TARCH):src/lib/ooc2:src/lib/ooc2/$(TOS)/$(CCOMP):src/lib/ooc:src/lib/ooc/$(TOS)/$(CCOMP)/$(TARCH):src/lib/pow:src/lib/misc:src/lib/s3:src/lib/s3/$(TARCH):src/voc:src/voc/$(TOS)/$(CCOMP):src/voc/$(TOS)/$(CCOMP)/$(TARCH):src/tools/ocat:src/tools/browser:src/tools/vocparam:src/tools/vmake:src/tools/coco:src/test +SETPATH = CFLAGS=$(INCLUDEPATH) PATH=.:/bin:/usr/bin MODULES=.:src/lib:src/lib/v4:src/lib/v4/$(TARCH):src/lib/v4_compat:src/lib/system/$(TOS)/$(CCOMP):src/lib/system/$(TOS)/$(CCOMP)/$(TARCH):src/lib/ulm:src/lib/ulm/$(TARCH):src/lib/ooc2:src/lib/ooc2/$(TOS)/$(CCOMP):src/lib/ooc:src/lib/ooc/$(TOS)/$(CCOMP)/$(TARCH):src/lib/pow:src/lib/misc:src/lib/s3:src/lib/s3/$(TARCH):src/voc:src/voc/$(TOS)/$(CCOMP):src/voc/$(TOS)/$(CCOMP)/$(TARCH):src/tools/ocat:src/tools/browser:src/tools/vocparam:src/tools/vmake:src/tools/coco:src/test VOC = voc VERSION = $(TOS).$(CCOMP).$(TARCH) diff --git a/makefile.freebsd.clang.x86_64 b/makefile.freebsd.clang.x86_64 index dd829077..57b44287 100644 --- a/makefile.freebsd.clang.x86_64 +++ b/makefile.freebsd.clang.x86_64 @@ -9,7 +9,7 @@ RELEASE = 1.1 INCLUDEPATH = -Isrc/lib/system/$(TOS)/$(CCOMP)/$(TARCH) -SETPATH = CFLAGS=$(INCLUDEPATH) PATH=.:/bin:/usr/bin MODULES=.:src/lib:src/lib/v4:src/lib/v4/$(TARCH):src/lib/system/$(TOS)/$(CCOMP):src/lib/system/$(TOS)/$(CCOMP)/$(TARCH):src/lib/ulm:src/lib/ulm/$(TARCH):src/lib/ooc2:src/lib/ooc2/$(TOS)/$(CCOMP):src/lib/ooc:src/lib/ooc/$(TOS)/$(CCOMP)/$(TARCH):src/lib/pow:src/lib/misc:src/lib/s3:src/lib/s3/$(TARCH):src/voc:src/voc/$(TOS)/$(CCOMP):src/voc/$(TOS)/$(CCOMP)/$(TARCH):src/tools/ocat:src/tools/browser:src/tools/vocparam:src/tools/vmake:src/tools/coco:src/test +SETPATH = CFLAGS=$(INCLUDEPATH) PATH=.:/bin:/usr/bin MODULES=.:src/lib:src/lib/v4:src/lib/v4/$(TARCH):src/lib/v4_compat:src/lib/system/$(TOS)/$(CCOMP):src/lib/system/$(TOS)/$(CCOMP)/$(TARCH):src/lib/ulm:src/lib/ulm/$(TARCH):src/lib/ooc2:src/lib/ooc2/$(TOS)/$(CCOMP):src/lib/ooc:src/lib/ooc/$(TOS)/$(CCOMP)/$(TARCH):src/lib/pow:src/lib/misc:src/lib/s3:src/lib/s3/$(TARCH):src/voc:src/voc/$(TOS)/$(CCOMP):src/voc/$(TOS)/$(CCOMP)/$(TARCH):src/tools/ocat:src/tools/browser:src/tools/vocparam:src/tools/vmake:src/tools/coco:src/test VOC = voc VERSION = $(TOS).$(CCOMP).$(TARCH) diff --git a/makefile.linux.clang.powerpc b/makefile.linux.clang.powerpc index 235fd695..787e0ca5 100644 --- a/makefile.linux.clang.powerpc +++ b/makefile.linux.clang.powerpc @@ -9,7 +9,7 @@ RELEASE = 1.1 INCLUDEPATH = -Isrc/lib/system/$(TOS)/$(CCOMP)/$(TARCH) -SETPATH = CFLAGS=$(INCLUDEPATH) PATH=.:/bin:/usr/bin MODULES=.:src/lib:src/lib/v4:src/lib/v4/$(TARCH):src/lib/system/$(TOS)/$(CCOMP):src/lib/system/$(TOS)/$(CCOMP)/$(TARCH):src/lib/ulm:src/lib/ulm/$(TARCH):src/lib/ooc2:src/lib/ooc2/$(TOS)/$(CCOMP):src/lib/ooc:src/lib/ooc/$(TOS)/$(CCOMP)/$(TARCH):src/lib/pow:src/lib/misc:src/lib/s3:src/lib/s3/$(TARCH):src/voc:src/voc/$(TOS)/$(CCOMP):src/voc/$(TOS)/$(CCOMP)/$(TARCH):src/tools/ocat:src/tools/browser:src/tools/vocparam:src/tools/vmake:src/tools/coco:src/test +SETPATH = CFLAGS=$(INCLUDEPATH) PATH=.:/bin:/usr/bin MODULES=.:src/lib:src/lib/v4:src/lib/v4/$(TARCH):src/lib/v4_compat:src/lib/system/$(TOS)/$(CCOMP):src/lib/system/$(TOS)/$(CCOMP)/$(TARCH):src/lib/ulm:src/lib/ulm/$(TARCH):src/lib/ooc2:src/lib/ooc2/$(TOS)/$(CCOMP):src/lib/ooc:src/lib/ooc/$(TOS)/$(CCOMP)/$(TARCH):src/lib/pow:src/lib/misc:src/lib/s3:src/lib/s3/$(TARCH):src/voc:src/voc/$(TOS)/$(CCOMP):src/voc/$(TOS)/$(CCOMP)/$(TARCH):src/tools/ocat:src/tools/browser:src/tools/vocparam:src/tools/vmake:src/tools/coco:src/test VOC = voc VERSION = $(TOS).$(CCOMP).$(TARCH) diff --git a/makefile.linux.clang.x86_64 b/makefile.linux.clang.x86_64 index c7b7d4ec..377d7e53 100644 --- a/makefile.linux.clang.x86_64 +++ b/makefile.linux.clang.x86_64 @@ -9,7 +9,7 @@ RELEASE = 1.1 INCLUDEPATH = -Isrc/lib/system/$(TOS)/$(CCOMP)/$(TARCH) -SETPATH = CFLAGS=$(INCLUDEPATH) PATH=.:/bin:/usr/bin MODULES=.:src/lib:src/lib/v4:src/lib/v4/$(TARCH):src/lib/system/$(TOS)/$(CCOMP):src/lib/system/$(TOS)/$(CCOMP)/$(TARCH):src/lib/ulm:src/lib/ulm/$(TARCH):src/lib/ooc2:src/lib/ooc2/$(TOS)/$(CCOMP):src/lib/ooc:src/lib/ooc/$(TOS)/$(CCOMP)/$(TARCH):src/lib/pow:src/lib/misc:src/lib/s3:src/lib/s3/$(TARCH):src/voc:src/voc/$(TOS)/$(CCOMP):src/voc/$(TOS)/$(CCOMP)/$(TARCH):src/tools/ocat:src/tools/browser:src/tools/vocparam:src/tools/vmake:src/tools/coco:src/test +SETPATH = CFLAGS=$(INCLUDEPATH) PATH=.:/bin:/usr/bin MODULES=.:src/lib:src/lib/v4:src/lib/v4/$(TARCH):src/lib/v4_compat:src/lib/system/$(TOS)/$(CCOMP):src/lib/system/$(TOS)/$(CCOMP)/$(TARCH):src/lib/ulm:src/lib/ulm/$(TARCH):src/lib/ooc2:src/lib/ooc2/$(TOS)/$(CCOMP):src/lib/ooc:src/lib/ooc/$(TOS)/$(CCOMP)/$(TARCH):src/lib/pow:src/lib/misc:src/lib/s3:src/lib/s3/$(TARCH):src/voc:src/voc/$(TOS)/$(CCOMP):src/voc/$(TOS)/$(CCOMP)/$(TARCH):src/tools/ocat:src/tools/browser:src/tools/vocparam:src/tools/vmake:src/tools/coco:src/test VOC = voc VERSION = $(TOS).$(CCOMP).$(TARCH) diff --git a/makefile.linux.gcc.armv6j_hardfp b/makefile.linux.gcc.armv6j_hardfp index c1484669..ed5c0a12 100644 --- a/makefile.linux.gcc.armv6j_hardfp +++ b/makefile.linux.gcc.armv6j_hardfp @@ -9,7 +9,7 @@ RELEASE = 1.1 INCLUDEPATH = -Isrc/lib/system/$(TOS)/$(CCOMP)/$(TARCH) -SETPATH = CFLAGS=$(INCLUDEPATH) PATH=.:/bin:/usr/bin MODULES=.:src/lib:src/lib/v4:src/lib/v4/$(TARCH):src/lib/system/$(TOS)/$(CCOMP):src/lib/system/$(TOS)/$(CCOMP)/$(TARCH):src/lib/ulm:src/lib/ulm/$(TARCH):src/lib/ooc2:src/lib/ooc2/$(TOS)/$(CCOMP):src/lib/ooc:src/lib/ooc/$(TOS)/$(CCOMP)/$(TARCH):src/lib/pow:src/lib/misc:src/lib/s3:src/lib/s3/$(TARCH):src/voc:src/voc/$(TOS)/$(CCOMP):src/voc/$(TOS)/$(CCOMP)/$(TARCH):src/tools/ocat:src/tools/browser:src/tools/vocparam:src/tools/vmake:src/tools/coco:src/test +SETPATH = CFLAGS=$(INCLUDEPATH) PATH=.:/bin:/usr/bin MODULES=.:src/lib:src/lib/v4:src/lib/v4/$(TARCH):src/lib/v4_compat:src/lib/system/$(TOS)/$(CCOMP):src/lib/system/$(TOS)/$(CCOMP)/$(TARCH):src/lib/ulm:src/lib/ulm/$(TARCH):src/lib/ooc2:src/lib/ooc2/$(TOS)/$(CCOMP):src/lib/ooc:src/lib/ooc/$(TOS)/$(CCOMP)/$(TARCH):src/lib/pow:src/lib/misc:src/lib/s3:src/lib/s3/$(TARCH):src/voc:src/voc/$(TOS)/$(CCOMP):src/voc/$(TOS)/$(CCOMP)/$(TARCH):src/tools/ocat:src/tools/browser:src/tools/vocparam:src/tools/vmake:src/tools/coco:src/test VOC = voc VERSION = $(TOS).$(CCOMP).$(TARCH) diff --git a/makefile.linux.gcc.powerpc b/makefile.linux.gcc.powerpc index 58f07a4c..f07c1d54 100644 --- a/makefile.linux.gcc.powerpc +++ b/makefile.linux.gcc.powerpc @@ -9,7 +9,7 @@ RELEASE = 1.1 INCLUDEPATH = -Isrc/lib/system/$(TOS)/$(CCOMP)/$(TARCH) -SETPATH = CFLAGS=$(INCLUDEPATH) PATH=.:/bin:/usr/bin MODULES=.:src/lib:src/lib/v4:src/lib/v4/$(TARCH):src/lib/system/$(TOS)/$(CCOMP):src/lib/system/$(TOS)/$(CCOMP)/$(TARCH):src/lib/ulm:src/lib/ulm/$(TARCH):src/lib/ooc2:src/lib/ooc2/$(TOS)/$(CCOMP):src/lib/ooc:src/lib/ooc/$(TOS)/$(CCOMP)/$(TARCH):src/lib/pow:src/lib/misc:src/lib/s3:src/lib/s3/$(TARCH):src/voc:src/voc/$(TOS)/$(CCOMP):src/voc/$(TOS)/$(CCOMP)/$(TARCH):src/tools/ocat:src/tools/browser:src/tools/vocparam:src/tools/vmake:src/tools/coco:src/test +SETPATH = CFLAGS=$(INCLUDEPATH) PATH=.:/bin:/usr/bin MODULES=.:src/lib:src/lib/v4:src/lib/v4/$(TARCH):src/lib/v4_compat:src/lib/system/$(TOS)/$(CCOMP):src/lib/system/$(TOS)/$(CCOMP)/$(TARCH):src/lib/ulm:src/lib/ulm/$(TARCH):src/lib/ooc2:src/lib/ooc2/$(TOS)/$(CCOMP):src/lib/ooc:src/lib/ooc/$(TOS)/$(CCOMP)/$(TARCH):src/lib/pow:src/lib/misc:src/lib/s3:src/lib/s3/$(TARCH):src/voc:src/voc/$(TOS)/$(CCOMP):src/voc/$(TOS)/$(CCOMP)/$(TARCH):src/tools/ocat:src/tools/browser:src/tools/vocparam:src/tools/vmake:src/tools/coco:src/test VOC = voc VERSION = $(TOS).$(CCOMP).$(TARCH) diff --git a/makefile.linux.gcc.x86 b/makefile.linux.gcc.x86 index af0bc83b..8edf3cd8 100644 --- a/makefile.linux.gcc.x86 +++ b/makefile.linux.gcc.x86 @@ -9,7 +9,7 @@ RELEASE = 1.1 INCLUDEPATH = -Isrc/lib/system/$(TOS)/$(CCOMP)/$(TARCH) -SETPATH = CFLAGS=$(INCLUDEPATH) PATH=.:/bin:/usr/bin MODULES=.:src/lib:src/lib/v4:src/lib/v4/$(TARCH):src/lib/system/$(TOS)/$(CCOMP):src/lib/system/$(TOS)/$(CCOMP)/$(TARCH):src/lib/ulm:src/lib/ulm/$(TARCH):src/lib/ooc2:src/lib/ooc2/$(TOS)/$(CCOMP):src/lib/ooc:src/lib/ooc/$(TOS)/$(CCOMP)/$(TARCH):src/lib/pow:src/lib/misc:src/lib/s3:src/lib/s3/$(TARCH):src/voc:src/voc/$(TOS)/$(CCOMP):src/voc/$(TOS)/$(CCOMP)/$(TARCH):src/tools/ocat:src/tools/browser:src/tools/vocparam:src/tools/vmake:src/tools/coco:src/test +SETPATH = CFLAGS=$(INCLUDEPATH) PATH=.:/bin:/usr/bin MODULES=.:src/lib:src/lib/v4:src/lib/v4/$(TARCH):src/lib/v4_compat:src/lib/system/$(TOS)/$(CCOMP):src/lib/system/$(TOS)/$(CCOMP)/$(TARCH):src/lib/ulm:src/lib/ulm/$(TARCH):src/lib/ooc2:src/lib/ooc2/$(TOS)/$(CCOMP):src/lib/ooc:src/lib/ooc/$(TOS)/$(CCOMP)/$(TARCH):src/lib/pow:src/lib/misc:src/lib/s3:src/lib/s3/$(TARCH):src/voc:src/voc/$(TOS)/$(CCOMP):src/voc/$(TOS)/$(CCOMP)/$(TARCH):src/tools/ocat:src/tools/browser:src/tools/vocparam:src/tools/vmake:src/tools/coco:src/test VOC = voc VERSION = $(TOS).$(CCOMP).$(TARCH) diff --git a/makefile.linux.gcc.x86_64 b/makefile.linux.gcc.x86_64 index 60f338e3..c9399316 100644 --- a/makefile.linux.gcc.x86_64 +++ b/makefile.linux.gcc.x86_64 @@ -9,7 +9,7 @@ RELEASE = 1.1 INCLUDEPATH = -Isrc/lib/system/$(TOS)/$(CCOMP)/$(TARCH) -SETPATH = CFLAGS=$(INCLUDEPATH) PATH=.:/bin:/usr/bin MODULES=.:src/lib:src/lib/v4:src/lib/v4/$(TARCH):src/lib/system/$(TOS)/$(CCOMP):src/lib/system/$(TOS)/$(CCOMP)/$(TARCH):src/lib/ulm:src/lib/ulm/$(TARCH):src/lib/ooc2:src/lib/ooc2/$(TOS)/$(CCOMP):src/lib/ooc:src/lib/ooc/$(TOS)/$(CCOMP)/$(TARCH):src/lib/pow:src/lib/misc:src/lib/s3:src/lib/s3/$(TARCH):src/voc:src/voc/$(TOS)/$(CCOMP):src/voc/$(TOS)/$(CCOMP)/$(TARCH):src/tools/ocat:src/tools/browser:src/tools/vocparam:src/tools/vmake:src/tools/coco:src/test +SETPATH = CFLAGS=$(INCLUDEPATH) PATH=.:/bin:/usr/bin MODULES=.:src/lib:src/lib/v4:src/lib/v4/$(TARCH):src/lib/v4_compat:src/lib/system/$(TOS)/$(CCOMP):src/lib/system/$(TOS)/$(CCOMP)/$(TARCH):src/lib/ulm:src/lib/ulm/$(TARCH):src/lib/ooc2:src/lib/ooc2/$(TOS)/$(CCOMP):src/lib/ooc:src/lib/ooc/$(TOS)/$(CCOMP)/$(TARCH):src/lib/pow:src/lib/misc:src/lib/s3:src/lib/s3/$(TARCH):src/voc:src/voc/$(TOS)/$(CCOMP):src/voc/$(TOS)/$(CCOMP)/$(TARCH):src/tools/ocat:src/tools/browser:src/tools/vocparam:src/tools/vmake:src/tools/coco:src/test VOC = voc VERSION = $(TOS).$(CCOMP).$(TARCH) diff --git a/src/lib/system/linux/gcc/x86_64/Unix.Mod b/src/lib/system/linux/gcc/x86_64/Unix.Mod index 151541ad..dbaae75f 100644 --- a/src/lib/system/linux/gcc/x86_64/Unix.Mod +++ b/src/lib/system/linux/gcc/x86_64/Unix.Mod @@ -1,5 +1,5 @@ MODULE Unix; (* Josef Templ, 5.3.90 Linux system calls *) -(* ported to gnu x86_64 and added system function, noch *) +(* ported to gnu x86_64 and added system(), sleep() functions, noch *) (* Module Unix provides a system call interface to Linux. Naming conventions: Procedure and Type-names always start with a capital letter. diff --git a/src/lib/v4/Oberon.Mod b/src/lib/v4_compat/Oberon.Mod similarity index 98% rename from src/lib/v4/Oberon.Mod rename to src/lib/v4_compat/Oberon.Mod index 710e91e4..ac12e059 100644 --- a/src/lib/v4/Oberon.Mod +++ b/src/lib/v4_compat/Oberon.Mod @@ -56,6 +56,7 @@ MODULE Oberon; BEGIN NEW(Par); NEW(Par.text); + Par.pos := 0; Texts.Open(Par.text, ""); PopulateParams; END Oberon. From 2d94e27d499c7a79e8d62b086a922ebfae61fad7 Mon Sep 17 00:00:00 2001 From: norayr Date: Wed, 1 Jul 2015 15:56:47 +0400 Subject: [PATCH 014/580] added OptionChar to Oberon.Mod; -- noch Former-commit-id: 0d5e6da7dc26f85d4beb0d306083893f84295341 --- src/lib/v4_compat/Oberon.Mod | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/v4_compat/Oberon.Mod b/src/lib/v4_compat/Oberon.Mod index ac12e059..89b111b8 100644 --- a/src/lib/v4_compat/Oberon.Mod +++ b/src/lib/v4_compat/Oberon.Mod @@ -3,7 +3,6 @@ MODULE Oberon; (* this version should not have dependency on graphics -- noch *) IMPORT Kernel, Texts, Args; - TYPE ParList* = POINTER TO ParRec; @@ -20,6 +19,7 @@ MODULE Oberon; Log*: Texts.Text; Par*: ParList; (*actual parameters*) W : Texts.Writer; + OptionChar*: CHAR; (*clocks*) PROCEDURE GetClock* (VAR t, d: LONGINT); @@ -57,6 +57,7 @@ BEGIN NEW(Par); NEW(Par.text); Par.pos := 0; + OptionChar := '-'; Texts.Open(Par.text, ""); PopulateParams; END Oberon. From ed83cf0074a74319d00863fdd056ac96cd42463a Mon Sep 17 00:00:00 2001 From: norayr Date: Sat, 18 Jul 2015 19:09:43 +0400 Subject: [PATCH 015/580] updated faq about fedora issues; -- noch Former-commit-id: 85c75c41acf4c6e00ccd97a3ae078d820a64b7f0 --- FAQ.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/FAQ.md b/FAQ.md index 0420f66b..7c21376a 100644 --- a/FAQ.md +++ b/FAQ.md @@ -17,6 +17,11 @@ compilation crashes on ARM or Raspberry Pi with recent (like 3.12) kernels. should fix that. +compilation crashes with "cannot find -lc" on recent fedoras +============================================================ + +remove -static from makefile on the line where voc binary created (first -static you'll find) + make errors on freebsd ====================== From e9f1a2710ae92051e8de310ba2d05358eb3f5052 Mon Sep 17 00:00:00 2001 From: Norayr Chilingarian Date: Sun, 19 Jul 2015 17:04:16 +0400 Subject: [PATCH 016/580] voc07R - revised oberon compiler's compatFiles module fixed to comply with new Unix.Mod, which was previously fixed to comply with x86_64 libc types. Former-commit-id: 8b66c787da358c76b141503cc9e09f5292ca856d --- src/voc07R/ORS.Mod | 4 +- src/voc07R/makefile | 2 +- src/voc07R/{ => x86}/CompatFiles.Mod | 0 src/voc07R/x86_64/CompatFiles.Mod | 677 +++++++++++++++++++++++++++ 4 files changed, 680 insertions(+), 3 deletions(-) rename src/voc07R/{ => x86}/CompatFiles.Mod (100%) create mode 100644 src/voc07R/x86_64/CompatFiles.Mod diff --git a/src/voc07R/ORS.Mod b/src/voc07R/ORS.Mod index c6909944..e17db698 100644 --- a/src/voc07R/ORS.Mod +++ b/src/voc07R/ORS.Mod @@ -1,5 +1,5 @@ MODULE ORS; (* NW 19.9.93 / 1.4.2014 Scanner in Oberon-07*) - IMPORT SYSTEM, Texts := CompatTexts, Oberon; + IMPORT SYSTEM, Texts := CompatTexts, Oberon; (* CompatTexts is voc adaptation by noch *) TYPE INTEGER = LONGINT; (* voc adaptation by noch *) @@ -63,7 +63,7 @@ MODULE ORS; (* NW 19.9.93 / 1.4.2014 Scanner in Oberon-07*) IF (p > errpos) & (errcnt < 25) THEN Texts.WriteLn(W); Texts.WriteString(W, " pos "); Texts.WriteInt(W, p, 1); Texts.Write(W, " "); Texts.WriteString(W, msg); Texts.Append(Oberon.Log, W.buf); - Oberon.DumpLog; + Oberon.DumpLog; (* voc adaptation by noch *) END ; INC(errcnt); errpos := p + 4 END Mark; diff --git a/src/voc07R/makefile b/src/voc07R/makefile index 7f9f03bd..5343361c 100644 --- a/src/voc07R/makefile +++ b/src/voc07R/makefile @@ -1,5 +1,5 @@ -SETPATH = MODULES=".:gcc:gcc/x86_64" +SETPATH = MODULES=".:x86_64" VOC0 = $(SETPATH) /opt/voc/bin/voc diff --git a/src/voc07R/CompatFiles.Mod b/src/voc07R/x86/CompatFiles.Mod similarity index 100% rename from src/voc07R/CompatFiles.Mod rename to src/voc07R/x86/CompatFiles.Mod diff --git a/src/voc07R/x86_64/CompatFiles.Mod b/src/voc07R/x86_64/CompatFiles.Mod new file mode 100644 index 00000000..785a9666 --- /dev/null +++ b/src/voc07R/x86_64/CompatFiles.Mod @@ -0,0 +1,677 @@ +MODULE CompatFiles; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files *) +(* modified version of Files, which opens only the file provided and does not scan any path in any environment variable, also ReadLine procedure added; -- noch *) + IMPORT SYSTEM, Unix, Kernel, Args, Console; + + (* standard data type I/O + + little endian, + Sint:1, Int:2, Lint:4 + ORD({0}) = 1, + false = 0, true =1 + IEEE real format, + null terminated strings, + compact numbers according to M.Odersky *) + + + CONST + nofbufs = 4; + bufsize = 4096; + fileTabSize = 64; + noDesc = -1; + notDone = -1; + + (* file states *) + open = 0; create = 1; close = 2; + + + TYPE + FileName = ARRAY 101 OF CHAR; + File* = POINTER TO Handle; + Buffer = POINTER TO BufDesc; + + Handle = RECORD + workName, registerName: FileName; + tempFile: BOOLEAN; + dev, ino, mtime: LONGINT; + fd-: INTEGER; len, pos: LONGINT; + bufs: ARRAY nofbufs OF Buffer; + swapper, state: INTEGER + END ; + + BufDesc = RECORD + f: File; + chg: BOOLEAN; + org, size: LONGINT; + data: ARRAY bufsize OF SYSTEM.BYTE + END ; + + Rider* = RECORD + res*: LONGINT; + eof*: BOOLEAN; + buf: Buffer; + org, offset: LONGINT + END ; + + Time = POINTER TO TimeDesc; + TimeDesc = RECORD + sec*, min*, hour*, mday*, mon*, year*, wday*, isdst*, zone*, gmtoff*: LONGINT; +(* sec*, min*, hour*, mday*, mon*, year*, wday*, isdst*, zone*, gmtoff*: INTEGER;*) + END ; + + VAR + fileTab: ARRAY fileTabSize OF LONGINT (*=File*); + tempno: INTEGER; + +(* for localtime *) + PROCEDURE -includetime() + '#include "time.h"'; + + PROCEDURE -localtime(VAR clock: LONGINT): Time + "(CompatFiles_Time) localtime(clock)"; + + PROCEDURE -getcwd(VAR cwd: Unix.Name) + "getcwd(cwd, cwd__len)"; + + PROCEDURE -IdxTrap "__HALT(-1)"; + + PROCEDURE^ Finalize(o: SYSTEM.PTR); + + PROCEDURE Err(s: ARRAY OF CHAR; f: File; errno: LONGINT); + BEGIN + Console.Ln; Console.String("-- "); Console.String(s); Console.String(": "); + IF f # NIL THEN + IF f.registerName # "" THEN Console.String(f.registerName) ELSE Console.String(f.workName) END + END ; + IF errno # 0 THEN Console.String(" errno = "); Console.Int(errno, 1) END ; + Console.Ln; + HALT(99) + END Err; + + PROCEDURE MakeFileName(dir, name: ARRAY OF CHAR; VAR dest: ARRAY OF CHAR); + VAR i, j: INTEGER; + BEGIN i := 0; j := 0; + WHILE dir[i] # 0X DO dest[i] := dir[i]; INC(i) END ; + IF dest[i-1] # "/" THEN dest[i] := "/"; INC(i) END ; + WHILE name[j] # 0X DO dest[i] := name[j]; INC(i); INC(j) END ; + dest[i] := 0X + END MakeFileName; + + PROCEDURE GetTempName(finalName: ARRAY OF CHAR; VAR name: ARRAY OF CHAR); + VAR n, i, j: LONGINT; + BEGIN + INC(tempno); n := tempno; i := 0; + IF finalName[0] # "/" THEN (* relative pathname *) + WHILE Kernel.CWD[i] # 0X DO name[i] := Kernel.CWD[i]; INC(i) END; + IF Kernel.CWD[i-1] # "/" THEN name[i] := "/"; INC(i) END + END; + j := 0; + WHILE finalName[j] # 0X DO name[i] := finalName[j]; INC(i); INC(j) END; + DEC(i); + WHILE name[i] # "/" DO DEC(i) END; + name[i+1] := "."; name[i+2] := "t"; name[i+3] := "m"; name[i+4] := "p"; name[i+5] := "."; INC(i, 6); + WHILE n > 0 DO name[i] := CHR(n MOD 10 + ORD("0")); n := n DIV 10; INC(i) END; + name[i] := "."; INC(i); n := SHORT(Unix.Getpid()); + WHILE n > 0 DO name[i] := CHR(n MOD 10 + ORD("0")); n := n DIV 10; INC(i) END; + name[i] := 0X + END GetTempName; + + PROCEDURE Create(f: File); + VAR stat: Unix.Status; done: BOOLEAN; + errno: LONGINT; err: ARRAY 32 OF CHAR; + BEGIN + IF f.fd = noDesc THEN + IF f.state = create THEN GetTempName(f.registerName, f.workName); f.tempFile := TRUE + ELSIF f.state = close THEN + f.workName := f.registerName; f.registerName := ""; f.tempFile := FALSE + END ; + errno := Unix.Unlink(f.workName); (*unlink first to avoid stale NFS handles and to avoid reuse of inodes*) + f.fd := Unix.Open(f.workName, SYSTEM.VAL(INTEGER, Unix.rdwr + Unix.creat + Unix.trunc), SYSTEM.VAL(LONGINT, {2, 4,5, 7,8})); + done := f.fd >= 0; errno := Unix.errno(); + IF (~done & ((errno = Unix.ENFILE) OR (errno = Unix.EMFILE))) OR (done & (f.fd >= fileTabSize)) THEN + IF done & (f.fd >= fileTabSize) THEN errno := Unix.Close(f.fd) END ; + Kernel.GC(TRUE); + f.fd := Unix.Open(f.workName, SYSTEM.VAL(INTEGER, Unix.rdwr + Unix.creat + Unix.trunc), SYSTEM.VAL(LONGINT, {2, 4,5, 7,8})); + done := f.fd >= 0 + END ; + IF done THEN + IF f.fd >= fileTabSize THEN errno := Unix.Close(f.fd); Err("too many files open", f, 0) + ELSE fileTab[f.fd] := SYSTEM.VAL(LONGINT, f); INC(Kernel.nofiles); Kernel.RegisterObject(f, Finalize); + f.state := open; f.pos := 0; errno := Unix.Fstat(f.fd, stat); + f.dev := stat.dev; f.ino := stat.ino; f.mtime := stat.mtime + END + ELSE errno := Unix.errno(); + IF errno = Unix.ENOENT THEN err := "no such directory" + ELSIF (errno = Unix.ENFILE) OR (errno = Unix.EMFILE) THEN err := "too many files open" + ELSE err := "file not created" + END ; + Err(err, f, errno) + END + END + END Create; + + PROCEDURE Flush(buf: Buffer); + VAR res: LONGINT; f: File; stat: Unix.Status; + BEGIN + IF buf.chg THEN f := buf.f; Create(f); + IF buf.org # f.pos THEN res := Unix.Lseek(f.fd, buf.org, 0) END ; + res := Unix.Write(f.fd, SYSTEM.ADR(buf.data), buf.size); + IF res < 0 THEN Err("error in writing file", f, Unix.errno()) END ; + f.pos := buf.org + buf.size; + buf.chg := FALSE; + res := Unix.Fstat(f.fd, stat); + f.mtime := stat.mtime + END + END Flush; + + PROCEDURE Close* (f: File); + VAR i, res: LONGINT; + BEGIN + IF (f.state # create) OR (f.registerName # "") THEN + Create(f); i := 0; + WHILE (i < nofbufs) & (f.bufs[i] # NIL) DO Flush(f.bufs[i]); INC(i) END ; + res := Unix.Fsync(f.fd); + IF res < 0 THEN Err("error in writing file", f, Unix.errno()) END + END + END Close; + + PROCEDURE Length* (f: File): LONGINT; + BEGIN RETURN f.len + END Length; + + PROCEDURE New* (name: ARRAY OF CHAR): File; + VAR f: File; + BEGIN + NEW(f); f.workName := ""; COPY(name, f.registerName); + f.fd := noDesc; f.state := create; f.len := 0; f.pos := 0; f.swapper := -1; (*all f.buf[i] = NIL*) + RETURN f + END New; +(* + PROCEDURE ScanPath(VAR pos: INTEGER; VAR dir: ARRAY OF CHAR); (* supports ~, ~user and blanks inside path *) + VAR i: INTEGER; ch: CHAR; home: ARRAY 256 OF CHAR; + BEGIN + i := 0; ch := Kernel.OBERON[pos]; + WHILE (ch = " ") OR (ch = ":") DO INC(pos); ch := Kernel.OBERON[pos] END ; + IF ch = "~" THEN + INC(pos); ch := Kernel.OBERON[pos]; + home := ""; Args.GetEnv("HOME", home); + WHILE home[i] # 0X DO dir[i] := home[i]; INC(i) END ; + IF (ch # "/") & (ch # 0X) & (ch # ":") & (ch # " ") THEN + WHILE (i > 0) & (dir[i-1] # "/") DO DEC(i) END + END + END ; + WHILE (ch # 0X) & (ch # ":") DO dir[i] := ch; INC(i); INC(pos); ch := Kernel.OBERON[pos] END ; + WHILE (i > 0) & (dir[i-1] = " ") DO DEC(i) END ; + dir[i] := 0X + END ScanPath; +*) + PROCEDURE HasDir(VAR name: ARRAY OF CHAR): BOOLEAN; + VAR i: INTEGER; ch: CHAR; + BEGIN i := 0; ch := name[0]; + WHILE (ch # 0X) & (ch # "/") DO INC(i); ch := name[i] END ; + RETURN ch = "/" + END HasDir; + + PROCEDURE CacheEntry(dev, ino: LONGINT; mtime: LONGINT): File; + VAR f: File; i: INTEGER; stat: Unix.Status; res: LONGINT; + BEGIN i := 0; + WHILE i < fileTabSize DO + f := SYSTEM.VAL(File, fileTab[i]); + IF (f # NIL) & (ino = f.ino) & (dev = f.dev) THEN + IF mtime # f.mtime THEN i := 0; + WHILE i < nofbufs DO + IF f.bufs[i] # NIL THEN f.bufs[i].org := -1; f.bufs[i] := NIL END ; + INC(i) + END ; + f.swapper := -1; f.mtime := mtime; + res := Unix.Fstat(f.fd, stat); f.len := stat.size + END ; + RETURN f + END ; + INC(i) + END ; + RETURN NIL + END CacheEntry; + + PROCEDURE Old* (name: ARRAY OF CHAR): File; + VAR f: File; fd, res: INTEGER; errno: LONGINT; pos: INTEGER; done: BOOLEAN; + dir, path: ARRAY 256 OF CHAR; + stat: Unix.Status; + BEGIN + IF name # "" THEN + IF HasDir(name) THEN dir := ""; COPY(name, path) + ELSE + pos := 0; + COPY(name, path); (* -- noch *) + (*ScanPath(pos, dir);*) (*MakeFileName(dir, name, path);*) (*ScanPath(pos, dir)*) + END ; + LOOP + fd := Unix.Open(path, SYSTEM.VAL(INTEGER, Unix.rdwr), (*{}*) 0); done := fd >= 0; errno := Unix.errno(); + IF (~done & ((errno = Unix.ENFILE) OR (errno = Unix.EMFILE))) OR (done & (fd >= fileTabSize)) THEN + IF done & (fd >= fileTabSize) THEN res := Unix.Close(fd) END ; + Kernel.GC(TRUE); + fd := Unix.Open(path, SYSTEM.VAL(INTEGER, Unix.rdwr), (*{}*)0); + done := fd >= 0; errno := Unix.errno(); + IF ~done & ((errno = Unix.ENFILE) OR (errno = Unix.EMFILE)) THEN Err("too many files open", f, errno) END + END ; + IF ~done & ((errno = Unix.EACCES) OR (errno = Unix.EROFS) OR (errno = Unix.EAGAIN)) THEN + (* errno EAGAIN observed on Solaris 2.4 *) + fd := Unix.Open(path, SYSTEM.VAL(INTEGER, Unix.rdonly), (*{}*)0); done := fd >= 0; errno := Unix.errno() + END ; +IF (~done) & (errno # Unix.ENOENT) THEN + Console.String("warning Files.Old "); Console.String(name); + Console.String(" errno = "); Console.Int(errno, 0); Console.Ln; +END ; + IF done THEN + res := Unix.Fstat(fd, stat); + f := CacheEntry(stat.dev, stat.ino, stat.mtime); + IF f # NIL THEN res := Unix.Close(fd); RETURN f + ELSIF fd >= fileTabSize THEN res := Unix.Close(fd); Err("too many files open", f, 0) + ELSE NEW(f); fileTab[fd] := SYSTEM.VAL(LONGINT, f); INC(Kernel.nofiles); Kernel.RegisterObject(f, Finalize); + f.fd := fd; f.state := open; f.len := stat.size; f.pos := 0; f.swapper := -1; (*all f.buf[i] = NIL*) + COPY(name, f.workName); f.registerName := ""; f.tempFile := FALSE; + f.dev := stat.dev; f.ino := stat.ino; f.mtime := stat.mtime; + RETURN f + END + ELSIF dir = "" THEN RETURN NIL + ELSE (*MakeFileName(dir, name, path);*) (*ScanPath(pos, dir)*) + RETURN NIL + END + END + ELSE RETURN NIL + END + END Old; + + PROCEDURE Purge* (f: File); + VAR i: INTEGER; stat: Unix.Status; res: LONGINT; + BEGIN i := 0; + WHILE i < nofbufs DO + IF f.bufs[i] # NIL THEN f.bufs[i].org := -1; f.bufs[i] := NIL END ; + INC(i) + END ; + IF f.fd # noDesc THEN res := Unix.Ftruncate(f.fd, 0); res := Unix.Lseek(f.fd, 0, 0) END ; + f.pos := 0; f.len := 0; f.swapper := -1; + res := Unix.Fstat(f.fd, stat); f.mtime := stat.mtime + END Purge; + + PROCEDURE GetDate* (f: File; VAR t, d: LONGINT); + VAR stat: Unix.Status; clock, res: LONGINT; time: Time; + BEGIN + Create(f); res := Unix.Fstat(f.fd, stat); + time := localtime(stat.mtime); + t := time.sec + ASH(time.min, 6) + ASH(time.hour, 12); + d := time.mday + ASH(time.mon+1, 5) + ASH(time.year MOD 100, 9) + END GetDate; + + PROCEDURE Pos* (VAR r: Rider): LONGINT; + BEGIN RETURN r.org + r.offset + END Pos; + + PROCEDURE Set* (VAR r: Rider; f: File; pos: LONGINT); + VAR org, offset, i, n, res: LONGINT; buf: Buffer; + BEGIN + IF f # NIL THEN + IF pos > f.len THEN pos := f.len ELSIF pos < 0 THEN pos := 0 END ; + offset := pos MOD bufsize; org := pos - offset; i := 0; + WHILE (i < nofbufs) & (f.bufs[i] # NIL) & (org # f.bufs[i].org) DO INC(i) END ; + IF i < nofbufs THEN + IF f.bufs[i] = NIL THEN NEW(buf); buf.chg := FALSE; buf.org := -1; buf.f := f; f.bufs[i] := buf + ELSE buf := f.bufs[i] + END + ELSE + f.swapper := (f.swapper + 1) MOD nofbufs; + buf := f.bufs[f.swapper]; + Flush(buf) + END ; + IF buf.org # org THEN + IF org = f.len THEN buf.size := 0 + ELSE Create(f); + IF f.pos # org THEN res := Unix.Lseek(f.fd, org, 0) END ; + n := Unix.ReadBlk(f.fd, buf.data); + IF n < 0 THEN Err("read from file not done", f, Unix.errno()) END ; + f.pos := org + n; + buf.size := n + END ; + buf.org := org; buf.chg := FALSE + END + ELSE buf := NIL; org := 0; offset := 0 + END ; + r.buf := buf; r.org := org; r.offset := offset; r.eof := FALSE; r.res := 0 + END Set; + + PROCEDURE Read* (VAR r: Rider; VAR x: SYSTEM.BYTE); + VAR offset: LONGINT; buf: Buffer; + BEGIN + buf := r.buf; offset := r.offset; + IF r.org # buf.org THEN Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset END ; + IF (offset < buf.size) THEN + x := buf.data[offset]; r.offset := offset + 1 + ELSIF r.org + offset < buf.f.len THEN + Set(r, r.buf.f, r.org + offset); + x := r.buf.data[0]; r.offset := 1 + ELSE + x := 0X; r.eof := TRUE + END + END Read; + + PROCEDURE ReadBytes* (VAR r: Rider; VAR x: ARRAY OF SYSTEM.BYTE; n: LONGINT); + VAR xpos, min, restInBuf, offset: LONGINT; buf: Buffer; + BEGIN + IF n > LEN(x) THEN IdxTrap END ; + xpos := 0; buf := r.buf; offset := r.offset; + WHILE n > 0 DO + IF (r.org # buf.org) OR (offset >= bufsize) THEN + Set(r, buf.f, r.org + offset); + buf := r.buf; offset := r.offset + END ; + restInBuf := buf.size - offset; + IF restInBuf = 0 THEN r.res := n; r.eof := TRUE; RETURN + ELSIF n > restInBuf THEN min := restInBuf ELSE min := n END ; + SYSTEM.MOVE(SYSTEM.ADR(buf.data) + offset, SYSTEM.ADR(x) + xpos, min); + INC(offset, min); r.offset := offset; INC(xpos, min); DEC(n, min) + END ; + r.res := 0; r.eof := FALSE + END ReadBytes; + + PROCEDURE ReadByte* (VAR r : Rider; VAR x : ARRAY OF SYSTEM.BYTE); + BEGIN + ReadBytes(r, x, 1); + END ReadByte; + + PROCEDURE Base* (VAR r: Rider): File; + BEGIN RETURN r.buf.f + END Base; + + PROCEDURE Write* (VAR r: Rider; x: SYSTEM.BYTE); + VAR buf: Buffer; offset: LONGINT; + BEGIN + buf := r.buf; offset := r.offset; + IF (r.org # buf.org) OR (offset >= bufsize) THEN + Set(r, buf.f, r.org + offset); + buf := r.buf; offset := r.offset + END ; + buf.data[offset] := x; + buf.chg := TRUE; + IF offset = buf.size THEN + INC(buf.size); INC(buf.f.len) + END ; + r.offset := offset + 1; r.res := 0 + END Write; + + PROCEDURE WriteByte* (VAR r : Rider; x : SYSTEM.BYTE); (* added for compatibility with PO 2013, -- noch *) + BEGIN + Write(r, x); + END WriteByte; + + PROCEDURE WriteBytes* (VAR r: Rider; VAR x: ARRAY OF SYSTEM.BYTE; n: LONGINT); + VAR xpos, min, restInBuf, offset: LONGINT; buf: Buffer; + BEGIN + IF n > LEN(x) THEN IdxTrap END ; + xpos := 0; buf := r.buf; offset := r.offset; + WHILE n > 0 DO + IF (r.org # buf.org) OR (offset >= bufsize) THEN + Set(r, buf.f, r.org + offset); + buf := r.buf; offset := r.offset + END ; + restInBuf := bufsize - offset; + IF n > restInBuf THEN min := restInBuf ELSE min := n END ; + SYSTEM.MOVE(SYSTEM.ADR(x) + xpos, SYSTEM.ADR(buf.data) + offset, min); + INC(offset, min); r.offset := offset; + IF offset > buf.size THEN INC(buf.f.len, offset - buf.size); buf.size := offset END ; + INC(xpos, min); DEC(n, min); buf.chg := TRUE + END ; + r.res := 0 + END WriteBytes; + +(* another solution would be one that is similar to ReadBytes, WriteBytes. +No code duplication, more symmetric, only two ifs for +Read and Write in buffer, buf.size replaced by bufsize in Write ops, buf.size and len +must be made consistent with offset (if offset > buf.size) in a lazy way. + +PROCEDURE Write* (VAR r: Rider; x: SYSTEM.BYTE); + VAR buf: Buffer; offset: LONGINT; +BEGIN + buf := r.buf; offset := r.offset; + IF (offset >= bufsize) OR (r.org # buf.org) THEN + Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset; + END ; + buf.data[offset] := x; r.offset := offset + 1; buf.chg := TRUE +END Write; + + +PROCEDURE WriteBytes ... + +PROCEDURE Read* (VAR r: Rider; VAR x: SYSTEM.BYTE); + VAR offset: LONGINT; buf: Buffer; +BEGIN + buf := r.buf; offset := r.offset; + IF (offset >= buf.size) OR (r.org # buf.org) THEN + IF r.org + offset >= buf.f.len THEN x := 0X; r.eof := TRUE; RETURN + ELSE Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset + END + END ; + x := buf.data[offset]; r.offset := offset + 1 +END Read; + +but this would also affect Set, Length, and Flush. +Especially Length would become fairly complex. +*) + + PROCEDURE Delete* (name: ARRAY OF CHAR; VAR res: INTEGER); + BEGIN + res := SHORT(Unix.Unlink(name)); + res := SHORT(Unix.errno()) + END Delete; + + PROCEDURE Rename* (old, new: ARRAY OF CHAR; VAR res: INTEGER); + VAR fdold, fdnew: INTEGER; n, errno, r: LONGINT; + ostat, nstat: Unix.Status; + buf: ARRAY 4096 OF CHAR; + BEGIN + r := Unix.Stat(old, ostat); + IF r >= 0 THEN + r := Unix.Stat(new, nstat); + IF (r >= 0) & ((ostat.dev # nstat.dev) OR (ostat.ino # nstat.ino)) THEN + Delete(new, res); (* work around stale nfs handles *) + END ; + r := Unix.Rename(old, new); + IF r < 0 THEN res := SHORT(Unix.errno()); + IF res = Unix.EXDEV THEN (* cross device link, move the file *) + fdold := Unix.Open(old, SYSTEM.VAL(INTEGER, Unix.rdonly), (*{}*)0); + IF fdold < 0 THEN res := 2; RETURN END ; + fdnew := Unix.Open(new, SYSTEM.VAL(INTEGER, Unix.rdwr + Unix.creat + Unix.trunc), SYSTEM.VAL(LONGINT, {2, 4,5, 7,8})); + IF fdnew < 0 THEN r := Unix.Close(fdold); res := 3; RETURN END ; + n := Unix.Read(fdold, SYSTEM.ADR(buf), bufsize); + WHILE n > 0 DO + r := Unix.Write(fdnew, SYSTEM.ADR(buf), n); + IF r < 0 THEN errno := Unix.errno(); r := Unix.Close(fdold); r := Unix.Close(fdnew); + Err("cannot move file", NIL, errno) + END ; + n := Unix.Read(fdold, SYSTEM.ADR(buf), bufsize) + END ; + errno := Unix.errno(); + r := Unix.Close(fdold); r := Unix.Close(fdnew); + IF n = 0 THEN r := Unix.Unlink(old); res := 0 + ELSE Err("cannot move file", NIL, errno) + END ; + ELSE RETURN (* res is Unix.Rename return code *) + END + END ; + res := 0 + ELSE res := 2 (* old file not found *) + END + END Rename; + + PROCEDURE Register* (f: File); + VAR idx, errno: INTEGER; f1: File; file: ARRAY 104 OF CHAR; + BEGIN + IF (f.state = create) & (f.registerName # "") THEN f.state := close (* shortcut renaming *) END ; + Close(f); + IF f.registerName # "" THEN + Rename(f.workName, f.registerName, errno); + IF errno # 0 THEN COPY(f.registerName, file); HALT(99) END ; + f.workName := f.registerName; f.registerName := ""; f.tempFile := FALSE + END + END Register; + + PROCEDURE ChangeDirectory*(path: ARRAY OF CHAR; VAR res: INTEGER); + BEGIN + res := SHORT(Unix.Chdir(path)); + getcwd(Kernel.CWD) + END ChangeDirectory; + + PROCEDURE FlipBytes(VAR src, dest: ARRAY OF SYSTEM.BYTE); + VAR i, j: LONGINT; + BEGIN + IF ~Kernel.littleEndian THEN i := LEN(src); j := 0; + WHILE i > 0 DO DEC(i); dest[j] := src[i]; INC(j) END + ELSE SYSTEM.MOVE(SYSTEM.ADR(src), SYSTEM.ADR(dest), LEN(src)) + END + END FlipBytes; + + PROCEDURE ReadBool* (VAR R: Rider; VAR x: BOOLEAN); + BEGIN Read(R, SYSTEM.VAL(CHAR, x)) + END ReadBool; + +(* PROCEDURE ReadInt* (VAR R: Rider; VAR x: INTEGER); + VAR b: ARRAY 2 OF CHAR; + BEGIN ReadBytes(R, b, 2); + x := ORD(b[0]) + ORD(b[1])*256 + END ReadInt; + *) + + PROCEDURE ReadInt* (VAR R: Rider; VAR x: LONGINT); (* to compile OR compiler; -- noch *) + VAR b: ARRAY 4 OF CHAR; + BEGIN ReadBytes(R, b, 4); + x := ORD(b[0]) + ORD(b[1])*100H + ORD(b[2])*10000H + ORD(b[3])*1000000H + END ReadInt; + + PROCEDURE ReadLInt* (VAR R: Rider; VAR x: LONGINT); + VAR b: ARRAY 4 OF CHAR; + BEGIN ReadBytes(R, b, 4); + x := ORD(b[0]) + ORD(b[1])*100H + ORD(b[2])*10000H + ORD(b[3])*1000000H + END ReadLInt; + + PROCEDURE ReadSet* (VAR R: Rider; VAR x: SET); + VAR b: ARRAY 4 OF CHAR; + BEGIN ReadBytes(R, b, 4); + x := SYSTEM.VAL(SET, ORD(b[0]) + ORD(b[1])*100H + ORD(b[2])*10000H + ORD(b[3])*1000000H) + END ReadSet; + + PROCEDURE ReadReal* (VAR R: Rider; VAR x: REAL); + VAR b: ARRAY 4 OF CHAR; + BEGIN ReadBytes(R, b, 4); FlipBytes(b, x) + END ReadReal; + + PROCEDURE ReadLReal* (VAR R: Rider; VAR x: LONGREAL); + VAR b: ARRAY 8 OF CHAR; + BEGIN ReadBytes(R, b, 8); FlipBytes(b, x) + END ReadLReal; + + PROCEDURE ReadString* (VAR R: Rider; VAR x: ARRAY OF CHAR); + VAR i: INTEGER; ch: CHAR; + BEGIN i := 0; + REPEAT Read(R, ch); x[i] := ch; INC(i) UNTIL ch = 0X + END ReadString; + + (* need to read line; -- noch *) + PROCEDURE ReadLine* (VAR R: Rider; VAR x: ARRAY OF CHAR); + VAR i: INTEGER; ch: CHAR; b : BOOLEAN; + BEGIN i := 0; + b := FALSE; + REPEAT + Read(R, ch); + IF ((ch = 0X) OR (ch = 0AX) OR (ch = 0DX)) THEN + b := TRUE + ELSE + x[i] := ch; + INC(i); + END; + UNTIL b + END ReadLine; + + PROCEDURE ReadNum* (VAR R: Rider; VAR x: LONGINT); + VAR s: SHORTINT; ch: CHAR; n: LONGINT; + BEGIN s := 0; n := 0; Read(R, ch); + WHILE ORD(ch) >= 128 DO INC(n, ASH(ORD(ch) - 128, s) ); INC(s, 7); Read(R, ch) END; + INC(n, ASH(ORD(ch) MOD 64 - ORD(ch) DIV 64 * 64, s) ); + x := n + END ReadNum; + + PROCEDURE WriteBool* (VAR R: Rider; x: BOOLEAN); + BEGIN Write(R, SYSTEM.VAL(CHAR, x)) + END WriteBool; + +(* PROCEDURE WriteInt* (VAR R: Rider; x: INTEGER); + VAR b: ARRAY 2 OF CHAR; + BEGIN b[0] := CHR(x); b[1] := CHR(x DIV 256); + WriteBytes(R, b, 2); + END WriteInt; + *) + PROCEDURE WriteInt* (VAR R: Rider; x: LONGINT); (* to compile OR compiler; -- noch *) + VAR b: ARRAY 4 OF CHAR; + BEGIN + b[0] := CHR(x); b[1] := CHR(x DIV 100H); b[2] := CHR(x DIV 10000H); b[3] := CHR(x DIV 1000000H); + WriteBytes(R, b, 4); + END WriteInt; + + PROCEDURE WriteLInt* (VAR R: Rider; x: LONGINT); + VAR b: ARRAY 4 OF CHAR; + BEGIN + b[0] := CHR(x); b[1] := CHR(x DIV 100H); b[2] := CHR(x DIV 10000H); b[3] := CHR(x DIV 1000000H); + WriteBytes(R, b, 4); + END WriteLInt; + + PROCEDURE WriteSet* (VAR R: Rider; x: SET); + VAR b: ARRAY 4 OF CHAR; i: LONGINT; + BEGIN i := SYSTEM.VAL(LONGINT, x); + 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; + + PROCEDURE WriteReal* (VAR R: Rider; x: REAL); + VAR b: ARRAY 4 OF CHAR; + BEGIN FlipBytes(x, b); WriteBytes(R, b, 4) + END WriteReal; + + PROCEDURE WriteLReal* (VAR R: Rider; x: LONGREAL); + VAR b: ARRAY 8 OF CHAR; + BEGIN FlipBytes(x, b); WriteBytes(R, b, 8) + END WriteLReal; + + PROCEDURE WriteString* (VAR R: Rider; x: ARRAY [1] OF CHAR); + VAR i: INTEGER; + BEGIN i := 0; + WHILE x[i] # 0X DO INC(i) END ; + WriteBytes(R, x, i+1) + END WriteString; + + PROCEDURE WriteNum* (VAR R: Rider; x: LONGINT); + BEGIN + WHILE (x < - 64) OR (x > 63) DO Write(R, CHR(x MOD 128 + 128)); x := x DIV 128 END; + Write(R, CHR(x MOD 128)) + END WriteNum; + + PROCEDURE GetName*(f: File; VAR name: ARRAY OF CHAR); + BEGIN + COPY (f.workName, name); + END GetName; + + PROCEDURE Finalize(o: SYSTEM.PTR); + VAR f: File; res: LONGINT; + BEGIN + f := SYSTEM.VAL(File, o); + IF f.fd >= 0 THEN + fileTab[f.fd] := 0; res := Unix.Close(f.fd); f.fd := -1; DEC(Kernel.nofiles); + IF f.tempFile THEN res := Unix.Unlink(f.workName) END + END + END Finalize; + + PROCEDURE Init; + VAR i: LONGINT; + BEGIN + i := 0; WHILE i < fileTabSize DO fileTab[i] := 0; INC(i) END ; + tempno := -1; Kernel.nofiles := 0 + END Init; + +BEGIN Init +END CompatFiles. From b00409910cd9993beff1e0378edd9dee19542e36 Mon Sep 17 00:00:00 2001 From: norayr Date: Tue, 15 Sep 2015 19:16:46 +0400 Subject: [PATCH 017/580] added DumpLog function to Oberon module; -- noch Former-commit-id: 6433d592bb89eabd320c878306b93395c8936b24 --- src/lib/v4_compat/Oberon.Mod | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/lib/v4_compat/Oberon.Mod b/src/lib/v4_compat/Oberon.Mod index 89b111b8..3a8038c0 100644 --- a/src/lib/v4_compat/Oberon.Mod +++ b/src/lib/v4_compat/Oberon.Mod @@ -2,7 +2,7 @@ MODULE Oberon; (* this version should not have dependency on graphics -- noch *) - IMPORT Kernel, Texts, Args; + IMPORT Kernel, Texts, Args, Out := Console; TYPE ParList* = POINTER TO ParRec; @@ -53,6 +53,18 @@ MODULE Oberon; END PopulateParams; + PROCEDURE DumpLog*; + VAR R : Texts.Reader; + ch : CHAR; + BEGIN + Texts.OpenReader(R, Log, 0); + + REPEAT + Texts.Read(R, ch); + Out.Char(ch); + UNTIL R.eot; + END DumpLog; + BEGIN NEW(Par); NEW(Par.text); From 85dc46c0366ca07bb2a74cfd514bce70878a2d5a Mon Sep 17 00:00:00 2001 From: Norayr Chilingarian Date: Thu, 8 Oct 2015 20:04:02 +0400 Subject: [PATCH 018/580] fixed endless recursion in Stars for inherited imported fie synced with Templ version of Ofront. Former-commit-id: 5afbe2cfbcbdbae9194d609b45ea30aa406a9ac8 --- src/voc/OPC.Mod | 8 ++++++-- vocstatic.linux.gcc.x86_64.REMOVED.git-id | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/voc/OPC.Mod b/src/voc/OPC.Mod index 261d0f44..2843f145 100644 --- a/src/voc/OPC.Mod +++ b/src/voc/OPC.Mod @@ -202,9 +202,13 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) OPM.Write(OpenParen); OPM.Write(Star) ELSE pointers := 0; - WHILE (typ^.strobj = NIL) & (typ^.form = Pointer) DO INC (pointers); typ := typ^.BaseTyp END ; - IF (typ^.comp # DynArr) & (pointers # 0) THEN Stars (typ, openClause) END ; + (*WHILE (typ^.strobj = NIL) & (typ^.form = Pointer) DO INC (pointers); typ := typ^.BaseTyp END ; + IF (typ^.comp # DynArr) & (pointers # 0) THEN Stars (typ, openClause) END ;*) + WHILE ((typ^.strobj = NIL) OR (typ^.strobj^.name = "")) & (typ^.form = Pointer) DO + INC (pointers); typ := typ^.BaseTyp + END ; IF pointers > 0 THEN + IF typ^.comp # DynArr THEN Stars (typ, openClause) END ; IF openClause THEN OPM.Write(OpenParen); openClause := FALSE END ; WHILE pointers > 0 DO OPM.Write(Star); DEC (pointers) END END diff --git a/vocstatic.linux.gcc.x86_64.REMOVED.git-id b/vocstatic.linux.gcc.x86_64.REMOVED.git-id index 4c874123..ba8364c4 100644 --- a/vocstatic.linux.gcc.x86_64.REMOVED.git-id +++ b/vocstatic.linux.gcc.x86_64.REMOVED.git-id @@ -1 +1 @@ -1bf4f972c6fb10b8b7f3c6613948482a1682528c \ No newline at end of file +ad35921c49d3aae4b67a6aca3f351381b4f9eadb \ No newline at end of file From 11acf6facacb2ac3fd40ccc76e6d25526874b3b3 Mon Sep 17 00:00:00 2001 From: norayr Date: Fri, 9 Oct 2015 12:21:53 +0400 Subject: [PATCH 019/580] check for IMPORT SYSTEM in CheckSysFlag, synced with jtempl's version. Former-commit-id: fced3875b71c0d37d635c9300bac179a7abc0286 --- src/voc/OPP.Mod | 4 +++- vocstatic.linux.gcc.x86_64.REMOVED.git-id | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/voc/OPP.Mod b/src/voc/OPP.Mod index 160cfec6..7971ab96 100644 --- a/src/voc/OPP.Mod +++ b/src/voc/OPP.Mod @@ -133,7 +133,9 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) PROCEDURE CheckSysFlag(VAR sysflag: INTEGER; default: INTEGER); VAR x: OPT.Node; sf: LONGINT; BEGIN - IF sym = lbrak THEN OPS.Get(sym); ConstExpression(x); + IF sym = lbrak THEN OPS.Get(sym); + IF ~OPT.SYSimported THEN err(135) END; + ConstExpression(x); IF x^.typ^.form IN intSet THEN sf := x^.conval^.intval; IF (sf < 0) OR (sf > OPM.MaxSysFlag) THEN err(220); sf := 0 END ELSE err(51); sf := 0 diff --git a/vocstatic.linux.gcc.x86_64.REMOVED.git-id b/vocstatic.linux.gcc.x86_64.REMOVED.git-id index ba8364c4..6d32b957 100644 --- a/vocstatic.linux.gcc.x86_64.REMOVED.git-id +++ b/vocstatic.linux.gcc.x86_64.REMOVED.git-id @@ -1 +1 @@ -ad35921c49d3aae4b67a6aca3f351381b4f9eadb \ No newline at end of file +a7a837dd44a4c74f85ac685d62b8179041dd783c \ No newline at end of file From df223b96a45692d4d407b520e5019ca681c7cd89 Mon Sep 17 00:00:00 2001 From: norayr Date: Fri, 9 Oct 2015 13:36:54 +0400 Subject: [PATCH 020/580] support for SYSTEM.ADR("x") added, i. e. for chars. sync with jtempl's version; -- noch Former-commit-id: 8887c4edb075acb639ade8f56a4b0557e90b80fb --- src/voc/OPB.Mod | 3 +++ vocstatic.linux.gcc.x86_64.REMOVED.git-id | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/voc/OPB.Mod b/src/voc/OPB.Mod index 1bf703a4..6e4430d0 100644 --- a/src/voc/OPB.Mod +++ b/src/voc/OPB.Mod @@ -409,6 +409,9 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) END ; z^.typ := OPT.booltyp | adr: (*SYSTEM.ADR*) + IF (z^.class = Nconst) & (f = Char) & (z^.conval^.intval >= 20H) THEN + CharToString(z); f := String + END ; IF (z^.class < Nconst) OR (f = String) THEN z := NewOp(op, typ, z) ELSE err(127) END ; diff --git a/vocstatic.linux.gcc.x86_64.REMOVED.git-id b/vocstatic.linux.gcc.x86_64.REMOVED.git-id index 6d32b957..0e677c7b 100644 --- a/vocstatic.linux.gcc.x86_64.REMOVED.git-id +++ b/vocstatic.linux.gcc.x86_64.REMOVED.git-id @@ -1 +1 @@ -a7a837dd44a4c74f85ac685d62b8179041dd783c \ No newline at end of file +a113ad22927e0094e5f94f603c617f48146ed169 \ No newline at end of file From 7607ee865179d4a8798862a8f39d8b1d35770500 Mon Sep 17 00:00:00 2001 From: norayr Date: Mon, 12 Oct 2015 20:31:28 +0400 Subject: [PATCH 021/580] sometimes it can crash because of this line. commented for now. fonts are not necessary anyway. Former-commit-id: 815795588b2911be2762b020e166abb70c48f780 --- src/lib/v4/Texts.Mod | 2 +- src/lib/v4/Texts0.Mod | 2 +- vocstatic.linux.gcc.x86_64.REMOVED.git-id | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/v4/Texts.Mod b/src/lib/v4/Texts.Mod index 2042dcf7..f2c3cf14 100644 --- a/src/lib/v4/Texts.Mod +++ b/src/lib/v4/Texts.Mod @@ -744,7 +744,7 @@ MODULE Texts; (** CAS/HM 23.9.93 -- interface based on Texts by JG/NW 6.12.91** IF plen > 0 THEN NEW(p); p.file := f; p.org := pos; p.ascii := FALSE; un := p; un.len := plen ELSE LoadElem(msg.r, pos - org, -plen, e); un := e; un.len := 1 END; - un.fnt := fnts[fno]; un.col := col; un.voff := voff; + (*un.fnt := fnts[fno];*) un.col := col; un.voff := voff; INC(pos, un.len); u.next := un; un.prev := u; u := un; Files.Read(msg.r, fno) END; u.next := T.head; T.head.prev := u; T.cache := T.head; T.corg := 0; diff --git a/src/lib/v4/Texts0.Mod b/src/lib/v4/Texts0.Mod index 19ecf5a1..4d8a3cb3 100644 --- a/src/lib/v4/Texts0.Mod +++ b/src/lib/v4/Texts0.Mod @@ -761,7 +761,7 @@ MODULE Texts0; (** CAS/HM 23.9.93 -- interface based on Texts by JG/NW 6.12.91* IF plen > 0 THEN NEW(p); p.file := f; p.org := pos; p.ascii := FALSE; un := p; un.len := plen ELSE LoadElem(msg.r, pos - org, -plen, e); un := e; un.len := 1 END; - un.fnt := fnts[fno]; un.col := col; un.voff := voff; + (*un.fnt := fnts[fno];*) un.col := col; un.voff := voff; INC(pos, un.len); u.next := un; un.prev := u; u := un; Files.Read(msg.r, fno) END; u.next := T.head; T.head.prev := u; T.cache := T.head; T.corg := 0; diff --git a/vocstatic.linux.gcc.x86_64.REMOVED.git-id b/vocstatic.linux.gcc.x86_64.REMOVED.git-id index 0e677c7b..2851a28b 100644 --- a/vocstatic.linux.gcc.x86_64.REMOVED.git-id +++ b/vocstatic.linux.gcc.x86_64.REMOVED.git-id @@ -1 +1 @@ -a113ad22927e0094e5f94f603c617f48146ed169 \ No newline at end of file +da9e240374a49ee39c08857a483a931dcbd48906 \ No newline at end of file From b8b1012e9ab0d75df5b95ba9422a1f3c2502f1dd Mon Sep 17 00:00:00 2001 From: norayr Date: Tue, 10 Nov 2015 19:52:51 +0400 Subject: [PATCH 022/580] fixed error reported by pdewacht: with -l option voc hung if error was at the last line, and no eol followed. ; -- noch Former-commit-id: fff1337578f9dcb35231701e6952ebfc4b45f9ad --- src/voc/OPM.cmdln.Mod | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/voc/OPM.cmdln.Mod b/src/voc/OPM.cmdln.Mod index 3f995c90..7492755e 100644 --- a/src/voc/OPM.cmdln.Mod +++ b/src/voc/OPM.cmdln.Mod @@ -437,15 +437,15 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) i := 0; j := 0; REPEAT IF (ORD(ch) > 31) OR (ORD(ch) = 9) THEN - IF ORD(ch)=9 THEN ch := " " END; - line[i] := ch; INC(i); line[i+1] := 0X; - ELSE - IF ch = 0AX THEN INC(j); i := 0 END - END; + IF ORD(ch)=9 THEN ch := " " END; + line[i] := ch; INC(i); line[i+1] := 0X; + ELSE + IF ch = 0AX THEN INC(j); i := 0 END + END; (* Console.Ln; Console.String("-- line["); Console.Int(i-1, 0); Console.String("] = "); Console.Char(ch); Console.Ln; *) - Files.Read(r, ch); + Files.Read(r, ch); (* Console.String("-- i "); Console.Int(i, 0); Console.Ln; @@ -453,7 +453,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) Console.Char(ch); Console.Ln; *) - UNTIL (j >= linenum) OR (i >= 1022); + UNTIL (j >= linenum) OR (i >= 1022) OR r.eof; Console.Ln; Console.String(" "); Console.String(line); Console.Ln; From edad9558219ced7bf08c81fda0f46423443a6259 Mon Sep 17 00:00:00 2001 From: norayr Date: Tue, 10 Nov 2015 22:18:35 +0400 Subject: [PATCH 023/580] reported by pdewacht: if eol is 0DX only, then voc wasn't able to handle this correctly http://paste.lisp.org/display/158971#1 this is base62 encoded test module http://paste.lisp.org/display/158971 fixed.; -- noch Former-commit-id: ebd0d78ce254c9f45c44258177b918963ea13927 --- src/voc/OPM.cmdln.Mod | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/voc/OPM.cmdln.Mod b/src/voc/OPM.cmdln.Mod index 7492755e..313e5a70 100644 --- a/src/voc/OPM.cmdln.Mod +++ b/src/voc/OPM.cmdln.Mod @@ -439,14 +439,21 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) IF (ORD(ch) > 31) OR (ORD(ch) = 9) THEN IF ORD(ch)=9 THEN ch := " " END; line[i] := ch; INC(i); line[i+1] := 0X; + Files.Read(r, ch); ELSE - IF ch = 0AX THEN INC(j); i := 0 END + IF (ch = 0AX) OR (ch = 0DX) THEN + Files.Read(r, ch); + IF (ch = 0AX) OR (ch = 0DX) THEN + Files.Read(r, ch); + ELSE + INC(j); i := 0 + END + END END; (* Console.Ln; Console.String("-- line["); Console.Int(i-1, 0); Console.String("] = "); Console.Char(ch); Console.Ln; *) - Files.Read(r, ch); -(* + (* Console.String("-- i "); Console.Int(i, 0); Console.Ln; Console.String("--j "); Console.Int(j, 0); Console.Ln; From 5305dbaa89cd6c94c73aa69d03d26f3f9e3f07d2 Mon Sep 17 00:00:00 2001 From: norayr Date: Fri, 20 Nov 2015 14:53:41 +0400 Subject: [PATCH 024/580] argc is INTEGER on 64bit; fixed. -- noch Former-commit-id: defc630a5e7fdd1d48c5aa2103bb01aaa5c9d6d7 --- src/lib/system/darwin/clang/x86_64/Args.Mod | 65 +++++++++++++++++++ src/lib/system/freebsd/clang/x86_64/Args.Mod | 65 +++++++++++++++++++ .../clang/armv6j_hardfp}/Args.Mod | 0 .../clang => linux/clang/powerpc}/Args.Mod | 0 src/lib/system/linux/clang/{ => x86}/Args.Mod | 0 src/lib/system/linux/clang/x86_64/Args.Mod | 65 +++++++++++++++++++ .../linux/gcc/{ => armv6j_hardfp}/Args.Mod | 0 src/lib/system/linux/gcc/powerpc/Args.Mod | 65 +++++++++++++++++++ src/lib/system/linux/gcc/x86/Args.Mod | 65 +++++++++++++++++++ src/lib/system/linux/gcc/x86_64/Args.Mod | 65 +++++++++++++++++++ vocstatic.linux.gcc.x86_64.REMOVED.git-id | 2 +- 11 files changed, 391 insertions(+), 1 deletion(-) create mode 100644 src/lib/system/darwin/clang/x86_64/Args.Mod create mode 100644 src/lib/system/freebsd/clang/x86_64/Args.Mod rename src/lib/system/{darwin/clang => linux/clang/armv6j_hardfp}/Args.Mod (100%) rename src/lib/system/{freebsd/clang => linux/clang/powerpc}/Args.Mod (100%) rename src/lib/system/linux/clang/{ => x86}/Args.Mod (100%) create mode 100644 src/lib/system/linux/clang/x86_64/Args.Mod rename src/lib/system/linux/gcc/{ => armv6j_hardfp}/Args.Mod (100%) create mode 100644 src/lib/system/linux/gcc/powerpc/Args.Mod create mode 100644 src/lib/system/linux/gcc/x86/Args.Mod create mode 100644 src/lib/system/linux/gcc/x86_64/Args.Mod diff --git a/src/lib/system/darwin/clang/x86_64/Args.Mod b/src/lib/system/darwin/clang/x86_64/Args.Mod new file mode 100644 index 00000000..2c0d25b5 --- /dev/null +++ b/src/lib/system/darwin/clang/x86_64/Args.Mod @@ -0,0 +1,65 @@ +MODULE Args; (* jt, 8.12.94 *) + + (* command line argument handling for voc (jet backend) *) + + + IMPORT SYSTEM; + + TYPE + ArgPtr = POINTER TO ARRAY 1024 OF CHAR; + ArgVec = POINTER TO ARRAY 1024 OF ArgPtr; + + VAR argc-: INTEGER; argv-: LONGINT; + (*PROCEDURE -includestdlib() "#include ";*) + PROCEDURE -externgetenv() "extern char *getenv(const char *name);"; (* took this from stdlib.h*) + PROCEDURE -Argc(): INTEGER "SYSTEM_argc"; + PROCEDURE -Argv(): LONGINT "(long)SYSTEM_argv"; + PROCEDURE -getenv(var: ARRAY OF CHAR): ArgPtr + "(Args_ArgPtr)getenv(var)"; + + PROCEDURE Get*(n: INTEGER; VAR val: ARRAY OF CHAR); + VAR av: ArgVec; + BEGIN + IF n < argc THEN av := SYSTEM.VAL(ArgVec, argv); COPY(av[n]^, val) END + END Get; + + PROCEDURE GetInt*(n: INTEGER; VAR val: LONGINT); + VAR s: ARRAY 64 OF CHAR; k, d, i: LONGINT; + BEGIN + s := ""; Get(n, s); i := 0; + IF s[0] = "-" THEN i := 1 END ; + k := 0; d := ORD(s[i]) - ORD("0"); + WHILE (d >= 0 ) & (d <= 9) DO k := k*10 + d; INC(i); d := ORD(s[i]) - ORD("0") END ; + IF s[0] = "-" THEN d := -d; DEC(i) END ; + IF i > 0 THEN val := k END + END GetInt; + + PROCEDURE Pos*(s: ARRAY OF CHAR): INTEGER; + VAR i: INTEGER; arg: ARRAY 256 OF CHAR; + BEGIN + i := 0; Get(i, arg); + WHILE (i < argc) & (s # arg) DO INC(i); Get(i, arg) END ; + RETURN i + END Pos; + + PROCEDURE GetEnv*(var: ARRAY OF CHAR; VAR val: ARRAY OF CHAR); + VAR p: ArgPtr; + BEGIN + p := getenv(var); + IF p # NIL THEN COPY(p^, val) END + END GetEnv; + + PROCEDURE getEnv*(var: ARRAY OF CHAR; VAR val: ARRAY OF CHAR): BOOLEAN; + VAR p: ArgPtr; + BEGIN + p := getenv(var); + IF p # NIL THEN + COPY(p^, val); + RETURN TRUE + ELSE + RETURN FALSE + END + END getEnv; + +BEGIN argc := Argc(); argv := Argv() +END Args. diff --git a/src/lib/system/freebsd/clang/x86_64/Args.Mod b/src/lib/system/freebsd/clang/x86_64/Args.Mod new file mode 100644 index 00000000..2c0d25b5 --- /dev/null +++ b/src/lib/system/freebsd/clang/x86_64/Args.Mod @@ -0,0 +1,65 @@ +MODULE Args; (* jt, 8.12.94 *) + + (* command line argument handling for voc (jet backend) *) + + + IMPORT SYSTEM; + + TYPE + ArgPtr = POINTER TO ARRAY 1024 OF CHAR; + ArgVec = POINTER TO ARRAY 1024 OF ArgPtr; + + VAR argc-: INTEGER; argv-: LONGINT; + (*PROCEDURE -includestdlib() "#include ";*) + PROCEDURE -externgetenv() "extern char *getenv(const char *name);"; (* took this from stdlib.h*) + PROCEDURE -Argc(): INTEGER "SYSTEM_argc"; + PROCEDURE -Argv(): LONGINT "(long)SYSTEM_argv"; + PROCEDURE -getenv(var: ARRAY OF CHAR): ArgPtr + "(Args_ArgPtr)getenv(var)"; + + PROCEDURE Get*(n: INTEGER; VAR val: ARRAY OF CHAR); + VAR av: ArgVec; + BEGIN + IF n < argc THEN av := SYSTEM.VAL(ArgVec, argv); COPY(av[n]^, val) END + END Get; + + PROCEDURE GetInt*(n: INTEGER; VAR val: LONGINT); + VAR s: ARRAY 64 OF CHAR; k, d, i: LONGINT; + BEGIN + s := ""; Get(n, s); i := 0; + IF s[0] = "-" THEN i := 1 END ; + k := 0; d := ORD(s[i]) - ORD("0"); + WHILE (d >= 0 ) & (d <= 9) DO k := k*10 + d; INC(i); d := ORD(s[i]) - ORD("0") END ; + IF s[0] = "-" THEN d := -d; DEC(i) END ; + IF i > 0 THEN val := k END + END GetInt; + + PROCEDURE Pos*(s: ARRAY OF CHAR): INTEGER; + VAR i: INTEGER; arg: ARRAY 256 OF CHAR; + BEGIN + i := 0; Get(i, arg); + WHILE (i < argc) & (s # arg) DO INC(i); Get(i, arg) END ; + RETURN i + END Pos; + + PROCEDURE GetEnv*(var: ARRAY OF CHAR; VAR val: ARRAY OF CHAR); + VAR p: ArgPtr; + BEGIN + p := getenv(var); + IF p # NIL THEN COPY(p^, val) END + END GetEnv; + + PROCEDURE getEnv*(var: ARRAY OF CHAR; VAR val: ARRAY OF CHAR): BOOLEAN; + VAR p: ArgPtr; + BEGIN + p := getenv(var); + IF p # NIL THEN + COPY(p^, val); + RETURN TRUE + ELSE + RETURN FALSE + END + END getEnv; + +BEGIN argc := Argc(); argv := Argv() +END Args. diff --git a/src/lib/system/darwin/clang/Args.Mod b/src/lib/system/linux/clang/armv6j_hardfp/Args.Mod similarity index 100% rename from src/lib/system/darwin/clang/Args.Mod rename to src/lib/system/linux/clang/armv6j_hardfp/Args.Mod diff --git a/src/lib/system/freebsd/clang/Args.Mod b/src/lib/system/linux/clang/powerpc/Args.Mod similarity index 100% rename from src/lib/system/freebsd/clang/Args.Mod rename to src/lib/system/linux/clang/powerpc/Args.Mod diff --git a/src/lib/system/linux/clang/Args.Mod b/src/lib/system/linux/clang/x86/Args.Mod similarity index 100% rename from src/lib/system/linux/clang/Args.Mod rename to src/lib/system/linux/clang/x86/Args.Mod diff --git a/src/lib/system/linux/clang/x86_64/Args.Mod b/src/lib/system/linux/clang/x86_64/Args.Mod new file mode 100644 index 00000000..0e90a48b --- /dev/null +++ b/src/lib/system/linux/clang/x86_64/Args.Mod @@ -0,0 +1,65 @@ +MODULE Args; (* jt, 8.12.94 *) + + (* command line argument handling for voc (jet backend) *) + + + IMPORT SYSTEM; + + TYPE + ArgPtr = POINTER TO ARRAY 1024 OF CHAR; + ArgVec = POINTER TO ARRAY 1024 OF ArgPtr; + + VAR argc-:INTEGER; argv-: LONGINT; + (*PROCEDURE -includestdlib() "#include ";*) + PROCEDURE -externgetenv() "extern char *getenv(const char *name);"; (* took this from stdlib.h*) + PROCEDURE -Argc(): INTEGER "SYSTEM_argc"; + PROCEDURE -Argv(): LONGINT "(long)SYSTEM_argv"; + PROCEDURE -getenv(var: ARRAY OF CHAR): ArgPtr + "(Args_ArgPtr)getenv(var)"; + + PROCEDURE Get*(n: INTEGER; VAR val: ARRAY OF CHAR); + VAR av: ArgVec; + BEGIN + IF n < argc THEN av := SYSTEM.VAL(ArgVec, argv); COPY(av[n]^, val) END + END Get; + + PROCEDURE GetInt*(n: INTEGER; VAR val: LONGINT); + VAR s: ARRAY 64 OF CHAR; k, d, i: LONGINT; + BEGIN + s := ""; Get(n, s); i := 0; + IF s[0] = "-" THEN i := 1 END ; + k := 0; d := ORD(s[i]) - ORD("0"); + WHILE (d >= 0 ) & (d <= 9) DO k := k*10 + d; INC(i); d := ORD(s[i]) - ORD("0") END ; + IF s[0] = "-" THEN d := -d; DEC(i) END ; + IF i > 0 THEN val := k END + END GetInt; + + PROCEDURE Pos*(s: ARRAY OF CHAR): INTEGER; + VAR i: INTEGER; arg: ARRAY 256 OF CHAR; + BEGIN + i := 0; Get(i, arg); + WHILE (i < argc) & (s # arg) DO INC(i); Get(i, arg) END ; + RETURN i + END Pos; + + PROCEDURE GetEnv*(var: ARRAY OF CHAR; VAR val: ARRAY OF CHAR); + VAR p: ArgPtr; + BEGIN + p := getenv(var); + IF p # NIL THEN COPY(p^, val) END + END GetEnv; + + PROCEDURE getEnv*(var: ARRAY OF CHAR; VAR val: ARRAY OF CHAR): BOOLEAN; + VAR p: ArgPtr; + BEGIN + p := getenv(var); + IF p # NIL THEN + COPY(p^, val); + RETURN TRUE + ELSE + RETURN FALSE + END + END getEnv; + +BEGIN argc := Argc(); argv := Argv() +END Args. diff --git a/src/lib/system/linux/gcc/Args.Mod b/src/lib/system/linux/gcc/armv6j_hardfp/Args.Mod similarity index 100% rename from src/lib/system/linux/gcc/Args.Mod rename to src/lib/system/linux/gcc/armv6j_hardfp/Args.Mod diff --git a/src/lib/system/linux/gcc/powerpc/Args.Mod b/src/lib/system/linux/gcc/powerpc/Args.Mod new file mode 100644 index 00000000..c6b7b56e --- /dev/null +++ b/src/lib/system/linux/gcc/powerpc/Args.Mod @@ -0,0 +1,65 @@ +MODULE Args; (* jt, 8.12.94 *) + + (* command line argument handling for voc (jet backend) *) + + + IMPORT SYSTEM; + + TYPE + ArgPtr = POINTER TO ARRAY 1024 OF CHAR; + ArgVec = POINTER TO ARRAY 1024 OF ArgPtr; + + VAR argc-, argv-: LONGINT; + (*PROCEDURE -includestdlib() "#include ";*) + PROCEDURE -externgetenv() "extern char *getenv(const char *name);"; (* took this from stdlib.h*) + PROCEDURE -Argc(): INTEGER "SYSTEM_argc"; + PROCEDURE -Argv(): LONGINT "(long)SYSTEM_argv"; + PROCEDURE -getenv(var: ARRAY OF CHAR): ArgPtr + "(Args_ArgPtr)getenv(var)"; + + PROCEDURE Get*(n: INTEGER; VAR val: ARRAY OF CHAR); + VAR av: ArgVec; + BEGIN + IF n < argc THEN av := SYSTEM.VAL(ArgVec, argv); COPY(av[n]^, val) END + END Get; + + PROCEDURE GetInt*(n: INTEGER; VAR val: LONGINT); + VAR s: ARRAY 64 OF CHAR; k, d, i: LONGINT; + BEGIN + s := ""; Get(n, s); i := 0; + IF s[0] = "-" THEN i := 1 END ; + k := 0; d := ORD(s[i]) - ORD("0"); + WHILE (d >= 0 ) & (d <= 9) DO k := k*10 + d; INC(i); d := ORD(s[i]) - ORD("0") END ; + IF s[0] = "-" THEN d := -d; DEC(i) END ; + IF i > 0 THEN val := k END + END GetInt; + + PROCEDURE Pos*(s: ARRAY OF CHAR): INTEGER; + VAR i: INTEGER; arg: ARRAY 256 OF CHAR; + BEGIN + i := 0; Get(i, arg); + WHILE (i < argc) & (s # arg) DO INC(i); Get(i, arg) END ; + RETURN i + END Pos; + + PROCEDURE GetEnv*(var: ARRAY OF CHAR; VAR val: ARRAY OF CHAR); + VAR p: ArgPtr; + BEGIN + p := getenv(var); + IF p # NIL THEN COPY(p^, val) END + END GetEnv; + + PROCEDURE getEnv*(var: ARRAY OF CHAR; VAR val: ARRAY OF CHAR): BOOLEAN; + VAR p: ArgPtr; + BEGIN + p := getenv(var); + IF p # NIL THEN + COPY(p^, val); + RETURN TRUE + ELSE + RETURN FALSE + END + END getEnv; + +BEGIN argc := Argc(); argv := Argv() +END Args. diff --git a/src/lib/system/linux/gcc/x86/Args.Mod b/src/lib/system/linux/gcc/x86/Args.Mod new file mode 100644 index 00000000..c6b7b56e --- /dev/null +++ b/src/lib/system/linux/gcc/x86/Args.Mod @@ -0,0 +1,65 @@ +MODULE Args; (* jt, 8.12.94 *) + + (* command line argument handling for voc (jet backend) *) + + + IMPORT SYSTEM; + + TYPE + ArgPtr = POINTER TO ARRAY 1024 OF CHAR; + ArgVec = POINTER TO ARRAY 1024 OF ArgPtr; + + VAR argc-, argv-: LONGINT; + (*PROCEDURE -includestdlib() "#include ";*) + PROCEDURE -externgetenv() "extern char *getenv(const char *name);"; (* took this from stdlib.h*) + PROCEDURE -Argc(): INTEGER "SYSTEM_argc"; + PROCEDURE -Argv(): LONGINT "(long)SYSTEM_argv"; + PROCEDURE -getenv(var: ARRAY OF CHAR): ArgPtr + "(Args_ArgPtr)getenv(var)"; + + PROCEDURE Get*(n: INTEGER; VAR val: ARRAY OF CHAR); + VAR av: ArgVec; + BEGIN + IF n < argc THEN av := SYSTEM.VAL(ArgVec, argv); COPY(av[n]^, val) END + END Get; + + PROCEDURE GetInt*(n: INTEGER; VAR val: LONGINT); + VAR s: ARRAY 64 OF CHAR; k, d, i: LONGINT; + BEGIN + s := ""; Get(n, s); i := 0; + IF s[0] = "-" THEN i := 1 END ; + k := 0; d := ORD(s[i]) - ORD("0"); + WHILE (d >= 0 ) & (d <= 9) DO k := k*10 + d; INC(i); d := ORD(s[i]) - ORD("0") END ; + IF s[0] = "-" THEN d := -d; DEC(i) END ; + IF i > 0 THEN val := k END + END GetInt; + + PROCEDURE Pos*(s: ARRAY OF CHAR): INTEGER; + VAR i: INTEGER; arg: ARRAY 256 OF CHAR; + BEGIN + i := 0; Get(i, arg); + WHILE (i < argc) & (s # arg) DO INC(i); Get(i, arg) END ; + RETURN i + END Pos; + + PROCEDURE GetEnv*(var: ARRAY OF CHAR; VAR val: ARRAY OF CHAR); + VAR p: ArgPtr; + BEGIN + p := getenv(var); + IF p # NIL THEN COPY(p^, val) END + END GetEnv; + + PROCEDURE getEnv*(var: ARRAY OF CHAR; VAR val: ARRAY OF CHAR): BOOLEAN; + VAR p: ArgPtr; + BEGIN + p := getenv(var); + IF p # NIL THEN + COPY(p^, val); + RETURN TRUE + ELSE + RETURN FALSE + END + END getEnv; + +BEGIN argc := Argc(); argv := Argv() +END Args. diff --git a/src/lib/system/linux/gcc/x86_64/Args.Mod b/src/lib/system/linux/gcc/x86_64/Args.Mod new file mode 100644 index 00000000..2c0d25b5 --- /dev/null +++ b/src/lib/system/linux/gcc/x86_64/Args.Mod @@ -0,0 +1,65 @@ +MODULE Args; (* jt, 8.12.94 *) + + (* command line argument handling for voc (jet backend) *) + + + IMPORT SYSTEM; + + TYPE + ArgPtr = POINTER TO ARRAY 1024 OF CHAR; + ArgVec = POINTER TO ARRAY 1024 OF ArgPtr; + + VAR argc-: INTEGER; argv-: LONGINT; + (*PROCEDURE -includestdlib() "#include ";*) + PROCEDURE -externgetenv() "extern char *getenv(const char *name);"; (* took this from stdlib.h*) + PROCEDURE -Argc(): INTEGER "SYSTEM_argc"; + PROCEDURE -Argv(): LONGINT "(long)SYSTEM_argv"; + PROCEDURE -getenv(var: ARRAY OF CHAR): ArgPtr + "(Args_ArgPtr)getenv(var)"; + + PROCEDURE Get*(n: INTEGER; VAR val: ARRAY OF CHAR); + VAR av: ArgVec; + BEGIN + IF n < argc THEN av := SYSTEM.VAL(ArgVec, argv); COPY(av[n]^, val) END + END Get; + + PROCEDURE GetInt*(n: INTEGER; VAR val: LONGINT); + VAR s: ARRAY 64 OF CHAR; k, d, i: LONGINT; + BEGIN + s := ""; Get(n, s); i := 0; + IF s[0] = "-" THEN i := 1 END ; + k := 0; d := ORD(s[i]) - ORD("0"); + WHILE (d >= 0 ) & (d <= 9) DO k := k*10 + d; INC(i); d := ORD(s[i]) - ORD("0") END ; + IF s[0] = "-" THEN d := -d; DEC(i) END ; + IF i > 0 THEN val := k END + END GetInt; + + PROCEDURE Pos*(s: ARRAY OF CHAR): INTEGER; + VAR i: INTEGER; arg: ARRAY 256 OF CHAR; + BEGIN + i := 0; Get(i, arg); + WHILE (i < argc) & (s # arg) DO INC(i); Get(i, arg) END ; + RETURN i + END Pos; + + PROCEDURE GetEnv*(var: ARRAY OF CHAR; VAR val: ARRAY OF CHAR); + VAR p: ArgPtr; + BEGIN + p := getenv(var); + IF p # NIL THEN COPY(p^, val) END + END GetEnv; + + PROCEDURE getEnv*(var: ARRAY OF CHAR; VAR val: ARRAY OF CHAR): BOOLEAN; + VAR p: ArgPtr; + BEGIN + p := getenv(var); + IF p # NIL THEN + COPY(p^, val); + RETURN TRUE + ELSE + RETURN FALSE + END + END getEnv; + +BEGIN argc := Argc(); argv := Argv() +END Args. diff --git a/vocstatic.linux.gcc.x86_64.REMOVED.git-id b/vocstatic.linux.gcc.x86_64.REMOVED.git-id index 2851a28b..4e53133c 100644 --- a/vocstatic.linux.gcc.x86_64.REMOVED.git-id +++ b/vocstatic.linux.gcc.x86_64.REMOVED.git-id @@ -1 +1 @@ -da9e240374a49ee39c08857a483a931dcbd48906 \ No newline at end of file +7fb043555ff9a58049dfa0758bc95ce058c619e1 \ No newline at end of file From 7d3258c2f216f9e0b907ad9e71711878632a986f Mon Sep 17 00:00:00 2001 From: Antranig Vartanian Date: Thu, 3 Dec 2015 22:50:57 +0400 Subject: [PATCH 025/580] initial of OpenBSD changes for voc on X86_64 Former-commit-id: 0170d2b442ecf74897969f0d82f42b0cc407a173 --- src/lib/system/openbsd/gcc/Console.Mod | 86 +++ src/lib/system/openbsd/gcc/Kernel.Mod | 188 ++++++ src/lib/system/openbsd/gcc/Kernel0.Mod | 200 ++++++ src/lib/system/openbsd/gcc/SYSTEM.Mod | 520 +++++++++++++++ src/lib/system/openbsd/gcc/x86_64/Args.Mod | 65 ++ src/lib/system/openbsd/gcc/x86_64/Files.Mod | 664 +++++++++++++++++++ src/lib/system/openbsd/gcc/x86_64/Files0.Mod | 636 ++++++++++++++++++ src/lib/system/openbsd/gcc/x86_64/SYSTEM.c0 | 205 ++++++ src/lib/system/openbsd/gcc/x86_64/SYSTEM.h | 238 +++++++ src/lib/system/openbsd/gcc/x86_64/Unix.Mod | 519 +++++++++++++++ src/voc/openbsd/gcc/extTools.Mod | 88 +++ src/voc/openbsd/gcc/x86_64/architecture.Mod | 4 + 12 files changed, 3413 insertions(+) create mode 100644 src/lib/system/openbsd/gcc/Console.Mod create mode 100644 src/lib/system/openbsd/gcc/Kernel.Mod create mode 100644 src/lib/system/openbsd/gcc/Kernel0.Mod create mode 100644 src/lib/system/openbsd/gcc/SYSTEM.Mod create mode 100644 src/lib/system/openbsd/gcc/x86_64/Args.Mod create mode 100644 src/lib/system/openbsd/gcc/x86_64/Files.Mod create mode 100644 src/lib/system/openbsd/gcc/x86_64/Files0.Mod create mode 100644 src/lib/system/openbsd/gcc/x86_64/SYSTEM.c0 create mode 100644 src/lib/system/openbsd/gcc/x86_64/SYSTEM.h create mode 100644 src/lib/system/openbsd/gcc/x86_64/Unix.Mod create mode 100644 src/voc/openbsd/gcc/extTools.Mod create mode 100644 src/voc/openbsd/gcc/x86_64/architecture.Mod diff --git a/src/lib/system/openbsd/gcc/Console.Mod b/src/lib/system/openbsd/gcc/Console.Mod new file mode 100644 index 00000000..e523ef7b --- /dev/null +++ b/src/lib/system/openbsd/gcc/Console.Mod @@ -0,0 +1,86 @@ +MODULE Console; (* J. Templ, 29-June-96 *) + + (* output to Unix standard output device based Write system call *) + + IMPORT SYSTEM; + + VAR line: ARRAY 128 OF CHAR; + pos: INTEGER; + + PROCEDURE -Write(adr, n: LONGINT) + "write(1/*stdout*/, adr, n)"; + + PROCEDURE -read(VAR ch: CHAR): LONGINT + "read(0/*stdin*/, ch, 1)"; + + PROCEDURE Flush*(); + BEGIN + Write(SYSTEM.ADR(line), pos); pos := 0; + END Flush; + + PROCEDURE Char*(ch: CHAR); + BEGIN + IF pos = LEN(line) THEN Flush() END ; + line[pos] := ch; INC(pos); + IF ch = 0AX THEN Flush() END + END Char; + + PROCEDURE String*(s: ARRAY OF CHAR); + VAR i: INTEGER; + BEGIN i := 0; + WHILE s[i] # 0X DO Char(s[i]); INC(i) END + END String; + + PROCEDURE Int*(i, n: LONGINT); + VAR s: ARRAY 32 OF CHAR; i1, k: LONGINT; + BEGIN + IF i = SYSTEM.LSH(LONG(LONG(1)), SIZE(LONGINT)*8 - 1) THEN + IF SIZE(LONGINT) = 8 THEN s := "8085774586302733229"; k := 19 + ELSE s := "8463847412"; k := 10 + END + ELSE + i1 := ABS(i); + s[0] := CHR(i1 MOD 10 + ORD("0")); i1 := i1 DIV 10; k := 1; + WHILE i1 > 0 DO s[k] := CHR(i1 MOD 10 + ORD("0")); i1 := i1 DIV 10; INC(k) END + END ; + IF i < 0 THEN s[k] := "-"; INC(k) END ; + WHILE n > k DO Char(" "); DEC(n) END ; + WHILE k > 0 DO DEC(k); Char(s[k]) END + END Int; + + PROCEDURE Ln*; + BEGIN Char(0AX); (* Unix end-of-line *) + END Ln; + + PROCEDURE Bool*(b: BOOLEAN); + BEGIN IF b THEN String("TRUE") ELSE String("FALSE") END + END Bool; + + PROCEDURE Hex*(i: LONGINT); + VAR k, n: LONGINT; + BEGIN + k := -28; + WHILE k <= 0 DO + n := ASH(i, k) MOD 16; + IF n <= 9 THEN Char(CHR(ORD("0") + n)) ELSE Char(CHR(ORD("A") - 10 + n)) END ; + INC(k, 4) + END + END Hex; + + PROCEDURE Read*(VAR ch: CHAR); + VAR n: LONGINT; + BEGIN Flush(); + n := read(ch); + IF n # 1 THEN ch := 0X END + END Read; + + PROCEDURE ReadLine*(VAR line: ARRAY OF CHAR); + VAR i: LONGINT; ch: CHAR; + BEGIN Flush(); + i := 0; Read(ch); + WHILE (i < LEN(line) - 1) & (ch # 0AX) & (ch # 0X) DO line[i] := ch; INC(i); Read(ch) END ; + line[i] := 0X + END ReadLine; + +BEGIN pos := 0; +END Console. diff --git a/src/lib/system/openbsd/gcc/Kernel.Mod b/src/lib/system/openbsd/gcc/Kernel.Mod new file mode 100644 index 00000000..cd516916 --- /dev/null +++ b/src/lib/system/openbsd/gcc/Kernel.Mod @@ -0,0 +1,188 @@ +MODULE Kernel; +(* + J. Templ, 16.4.95 + communication with C-runtime and storage management +*) + + IMPORT SYSTEM, Unix, Args; + + TYPE + RealTime = POINTER TO TimeDesc; + TimeDesc = RECORD + sec, min, hour, mday, mon, year, wday, isdst, zone, gmtoff: LONGINT + END ; + + KeyCmd* = PROCEDURE; + + ObjFinalizer* = PROCEDURE(obj: SYSTEM.PTR); + + + VAR + (* trap handling *) + trapEnv*: Unix.JmpBuf; (* saved stack environment for trap handling *) + + (* oberon heap management *) + nofiles*: LONGINT; + + (* input event handling *) + readSet*, readySet*: Unix.FdSet; + + FKey*: ARRAY 16 OF KeyCmd; + + littleEndian*: BOOLEAN; + + TimeUnit*: LONGINT; (* 1 sec *) + + LIB*, CWD*: ARRAY 256 OF CHAR; + OBERON*: ARRAY 1024 OF CHAR; + + + timeStart: LONGINT; (* milliseconds *) + + PROCEDURE -includesetjmp() + '#include "setjmp.h"'; +(* for localtime *) + PROCEDURE -includetime() + '#include "time.h"'; + + PROCEDURE -Lock*() + "SYSTEM_lock++"; + + PROCEDURE -Unlock*() + "SYSTEM_lock--; if (SYSTEM_interrupted && SYSTEM_lock == 0) __HALT(-9)"; + + PROCEDURE -Exit*(n: LONGINT) + "exit(n)"; + + PROCEDURE -sigsetjmp*(VAR env: Unix.JmpBuf; savemask: LONGINT): LONGINT + "__sigsetjmp(env, savemask)"; + + PROCEDURE -siglongjmp*(VAR env:Unix. JmpBuf; val: LONGINT) + "siglongjmp(env, val)"; + + PROCEDURE -heapsize*(): LONGINT + "SYSTEM_heapsize"; + + PROCEDURE -allocated*(): LONGINT + "SYSTEM_allocated"; + + PROCEDURE -localtime(VAR clock: LONGINT): RealTime + "(Kernel_RealTime)localtime(clock)"; + + PROCEDURE -malloc*(size: LONGINT): LONGINT + "(LONGINT)malloc(size)"; + + PROCEDURE -free*(adr: LONGINT) + "(void)free(adr)"; + + PROCEDURE -getcwd(VAR cwd: Unix.Name) + "getcwd(cwd, cwd__len)"; + + + PROCEDURE GetClock* (VAR t, d: LONGINT); + VAR tv: Unix.Timeval; tz: Unix.Timezone; time: RealTime; + l : LONGINT; + BEGIN + l := Unix.Gettimeofday(tv, tz); + time := localtime(tv.sec); + t := time.sec + ASH(time.min, 6) + ASH(time.hour, 12); + d := time.mday + ASH(time.mon+1, 5) + ASH(time.year MOD 100, 9); + END GetClock; + + PROCEDURE SetClock* (t, d: LONGINT); + VAR err: ARRAY 25 OF CHAR; + BEGIN err := "not yet implemented"; HALT(99) + END SetClock; + + PROCEDURE Time*(): LONGINT; + VAR timeval: Unix.Timeval; timezone: Unix.Timezone; + l : LONGINT; + BEGIN + l := Unix.Gettimeofday(timeval, timezone); + RETURN (timeval.usec DIV 1000 + timeval.sec * 1000 - timeStart) MOD 7FFFFFFFH + END Time; + +(* + PROCEDURE UserTime*(): LONGINT; + VAR rusage: Unix.Rusage; + BEGIN + Unix.Getrusage(0, S.ADR(rusage)); + RETURN rusage.utime.sec*1000 + rusage.utime.usec DIV 1000 + (* + rusage.stime.sec*1000 + rusage.stime.usec DIV 1000*) + END UserTime; +*) + + PROCEDURE Select*(delay: LONGINT); + VAR rs, ws, xs: Unix.FdSet; n: LONGINT; tv: Unix.Timeval; + BEGIN + rs := readSet; + FOR n := 0 TO 7 DO ws[n] := {}; xs[n] := {}; readySet[n] := {} END; + IF delay < 0 THEN delay := 0 END ; + tv.sec := delay DIV 1000; tv.usec := delay MOD 1000 * 1000; + n := Unix.Select(256, rs, ws, xs, tv); + IF n >= 0 THEN readySet := rs END + END Select; + + PROCEDURE -GC*(markStack: BOOLEAN) + "SYSTEM_GC(markStack)"; + + PROCEDURE -RegisterObject*(obj: SYSTEM.PTR; finalize: ObjFinalizer) + "SYSTEM_REGFIN(obj, finalize)"; + + PROCEDURE -SetHalt*(p: PROCEDURE(n: LONGINT)) + "SYSTEM_Halt = p"; + + PROCEDURE InstallTermHandler*(p: PROCEDURE); + (* not yet supported; no Modules.Free *) + END InstallTermHandler; + + PROCEDURE LargestAvailable*(): LONGINT; + BEGIN + (* dummy proc for System 3 compatibility + no meaningful value except may be the remaining swap space can be returned + in the context of an extensible heap *) + RETURN MAX(LONGINT) + END LargestAvailable; + + PROCEDURE Halt(n: LONGINT); + VAR res: LONGINT; + BEGIN res := Unix.Kill(Unix.Getpid(), 4); + END Halt; + + PROCEDURE EndianTest; + VAR i: LONGINT; dmy: INTEGER; + BEGIN + dmy := 1; i := SYSTEM.ADR(dmy); + SYSTEM.GET(i, littleEndian); (* indirection via i avoids warning on SUN cc -O *) + END EndianTest; + + PROCEDURE -SizeofUnixJmpBuf(): INTEGER + "sizeof(Unix_JmpBuf)"; + + PROCEDURE -SizeofSigJmpBuf(): INTEGER + "sizeof(sigjmp_buf)"; + + PROCEDURE -Error(msg: ARRAY OF CHAR; len: INTEGER) + "write(1/*stdout*/, msg, len); char ch = 0xa; write(1, &ch, 1)"; + + PROCEDURE JmpBufCheck; (* check for inconsistent usage of sigjmp_buf *) + VAR x, y: LONGINT; + BEGIN + x := SizeofUnixJmpBuf(); + y := SizeofSigJmpBuf(); + IF x < y THEN + Error("Kernel.JmpBufCheck: inconsistent usage of sigjmp_buf", 52); + Exit(1); + END + END JmpBufCheck; + +BEGIN + EndianTest(); + SetHalt(Halt); + CWD := ""; OBERON := "."; LIB := ""; + getcwd(CWD); + Args.GetEnv("OBERON", OBERON); + Args.GetEnv("OBERON_LIB", LIB); + TimeUnit := 1000; timeStart := 0; timeStart := Time(); + JmpBufCheck() +END Kernel. diff --git a/src/lib/system/openbsd/gcc/Kernel0.Mod b/src/lib/system/openbsd/gcc/Kernel0.Mod new file mode 100644 index 00000000..6a58650f --- /dev/null +++ b/src/lib/system/openbsd/gcc/Kernel0.Mod @@ -0,0 +1,200 @@ +MODULE Kernel0; +(* + J. Templ, 16.4.95 + communication with C-runtime and storage management +*) +(* version for bootstrapping voc *) + + IMPORT SYSTEM, Unix, Args, Strings, version; + + TYPE + RealTime = POINTER TO TimeDesc; + TimeDesc = RECORD + sec, min, hour, mday, mon, year, wday, isdst, zone, gmtoff: LONGINT +(* sec, min, hour, mday, mon, year, wday, isdst, zone, gmtoff: INTEGER*) + END ; + + KeyCmd* = PROCEDURE; + + ObjFinalizer* = PROCEDURE(obj: SYSTEM.PTR); + + + VAR + (* trap handling *) + trapEnv*: Unix.JmpBuf; (* saved stack environment for trap handling *) + + (* oberon heap management *) + nofiles*: LONGINT; + + (* input event handling *) + readSet*, readySet*: Unix.FdSet; + + FKey*: ARRAY 16 OF KeyCmd; + + littleEndian*: BOOLEAN; + + TimeUnit*: LONGINT; (* 1 sec *) + + LIB*, CWD*: ARRAY 256 OF CHAR; + OBERON*: ARRAY 1024 OF CHAR; + MODULES-: ARRAY 1024 OF CHAR; + + prefix*, fullprefix* : ARRAY 256 OF CHAR; + timeStart: LONGINT; (* milliseconds *) + + + PROCEDURE -includesetjmp() + '#include "setjmp.h"'; +(* for localtime *) + PROCEDURE -includetime() + '#include "time.h"'; + + PROCEDURE -Lock*() + "SYSTEM_lock++"; + + PROCEDURE -Unlock*() + "SYSTEM_lock--; if (SYSTEM_interrupted && SYSTEM_lock == 0) __HALT(-9)"; + + PROCEDURE -Exit*(n: LONGINT) + "exit(n)"; + + PROCEDURE -sigsetjmp*(VAR env: Unix.JmpBuf; savemask: LONGINT): LONGINT + "__sigsetjmp(env, savemask)"; + + PROCEDURE -siglongjmp*(VAR env:Unix.JmpBuf; val: LONGINT) + "siglongjmp(env, val)"; + + PROCEDURE -heapsize*(): LONGINT + "SYSTEM_heapsize"; + + PROCEDURE -allocated*(): LONGINT + "SYSTEM_allocated"; + + PROCEDURE -localtime(VAR clock: LONGINT): RealTime + "(Kernel0_RealTime)localtime(clock)"; + + PROCEDURE -malloc*(size: LONGINT): LONGINT + "(LONGINT)malloc(size)"; + + PROCEDURE -free*(adr: LONGINT) + "(void)free(adr)"; + + PROCEDURE -getcwd(VAR cwd: Unix.Name) + "getcwd(cwd, cwd__len)"; + + + PROCEDURE GetClock* (VAR t, d: LONGINT); + VAR tv: Unix.Timeval; tz: Unix.Timezone; time: RealTime; + l : LONGINT; + BEGIN + l := Unix.Gettimeofday(tv, tz); + time := localtime(tv.sec); + t := time.sec + ASH(time.min, 6) + ASH(time.hour, 12); + d := time.mday + ASH(time.mon+1, 5) + ASH(time.year MOD 100, 9); + END GetClock; + + PROCEDURE SetClock* (t, d: LONGINT); + VAR err: ARRAY 25 OF CHAR; + BEGIN err := "not yet implemented"; HALT(99) + END SetClock; + + PROCEDURE Time*(): LONGINT; + VAR timeval: Unix.Timeval; timezone: Unix.Timezone; + l : LONGINT; + BEGIN + l := Unix.Gettimeofday(timeval, timezone); + RETURN (timeval.usec DIV 1000 + timeval.sec * 1000 - timeStart) MOD 7FFFFFFFH + END Time; + +(* + PROCEDURE UserTime*(): LONGINT; + VAR rusage: Unix.Rusage; + BEGIN + Unix.Getrusage(0, S.ADR(rusage)); + RETURN rusage.utime.sec*1000 + rusage.utime.usec DIV 1000 + (* + rusage.stime.sec*1000 + rusage.stime.usec DIV 1000*) + END UserTime; +*) + + PROCEDURE Select*(delay: LONGINT); + VAR rs, ws, xs: Unix.FdSet; n: LONGINT; tv: Unix.Timeval; + BEGIN + rs := readSet; + FOR n := 0 TO 7 DO ws[n] := {}; xs[n] := {}; readySet[n] := {} END; + IF delay < 0 THEN delay := 0 END ; + tv.sec := delay DIV 1000; tv.usec := delay MOD 1000 * 1000; + n := Unix.Select(256, rs, ws, xs, tv); + IF n >= 0 THEN readySet := rs END + END Select; + + PROCEDURE -GC*(markStack: BOOLEAN) + "SYSTEM_GC(markStack)"; + + PROCEDURE -RegisterObject*(obj: SYSTEM.PTR; finalize: ObjFinalizer) + "SYSTEM_REGFIN(obj, finalize)"; + + PROCEDURE -SetHalt*(p: PROCEDURE(n: LONGINT)) + "SYSTEM_Halt = p"; + + PROCEDURE InstallTermHandler*(p: PROCEDURE); + (* not yet supported; no Modules.Free *) + END InstallTermHandler; + + PROCEDURE LargestAvailable*(): LONGINT; + BEGIN + (* dummy proc for System 3 compatibility + no meaningful value except may be the remaining swap space can be returned + in the context of an extensible heap *) + RETURN MAX(LONGINT) + END LargestAvailable; + + PROCEDURE Halt(n: LONGINT); + VAR res: LONGINT; + BEGIN res := Unix.Kill(Unix.Getpid(), 4); + END Halt; + + PROCEDURE EndianTest; + VAR i: LONGINT; dmy: INTEGER; + BEGIN + dmy := 1; i := SYSTEM.ADR(dmy); + SYSTEM.GET(i, littleEndian); (* indirection via i avoids warning on SUN cc -O *) + END EndianTest; + + PROCEDURE -SizeofUnixJmpBuf(): INTEGER + "sizeof(Unix_JmpBuf)"; + + PROCEDURE -SizeofSigJmpBuf(): INTEGER + "sizeof(sigjmp_buf)"; + + PROCEDURE -Error(msg: ARRAY OF CHAR; len: INTEGER) + "write(1/*stdout*/, msg, len); char ch = 0xa; write(1, &ch, 1)"; + + PROCEDURE JmpBufCheck; (* check for inconsistent usage of sigjmp_buf *) + VAR x, y: LONGINT; + BEGIN + x := SizeofUnixJmpBuf(); + y := SizeofSigJmpBuf(); + IF x < y THEN + Error("Kernel.JmpBufCheck: inconsistent usage of sigjmp_buf", 52); + Exit(1); + END + END JmpBufCheck; + +BEGIN + EndianTest(); + SetHalt(Halt); + CWD := ""; OBERON := "."; LIB := ""; + MODULES := ""; (* additional modules path which can be specified on commandline and will be added to the OBERON variable; noch *) + getcwd(CWD); + Args.GetEnv ("MODULES", MODULES); + Args.GetEnv("OBERON", OBERON); + (* always have current directory in module search path, noch *) + Strings.Append(":.:", OBERON); + Strings.Append(MODULES, OBERON); + Strings.Append(":", OBERON); + Strings.Append(version.prefix, OBERON); + Strings.Append("/lib/voc/sym:", OBERON); + Args.GetEnv("OBERON_LIB", LIB); + TimeUnit := 1000; timeStart := 0; timeStart := Time(); + JmpBufCheck() +END Kernel0. diff --git a/src/lib/system/openbsd/gcc/SYSTEM.Mod b/src/lib/system/openbsd/gcc/SYSTEM.Mod new file mode 100644 index 00000000..6fc08dcf --- /dev/null +++ b/src/lib/system/openbsd/gcc/SYSTEM.Mod @@ -0,0 +1,520 @@ +(* +* voc (jet backend) runtime system, Version 1.1 +* +* Copyright (c) Software Templ, 1994, 1995, 1996 +* +* Module SYSTEM is subject to change any time without prior notification. +* Software Templ disclaims all warranties with regard to module SYSTEM, +* in particular shall Software Templ not be liable for any damage resulting +* from inappropriate use or modification of module SYSTEM. +*) + +MODULE SYSTEM; (* J. Templ, 31.5.95 *) + + IMPORT SYSTEM; (*must not import other modules*) + + CONST + ModNameLen = 20; + CmdNameLen = 24; + SZL = SIZE(LONGINT); + Unit = 4*SZL; (* smallest possible heap block *) + nofLists = 9; (* number of free_lists *) + heapSize0 = 8000*Unit; (* startup heap size *) + + (* all blocks look the same: + free blocks describe themselves: size = Unit + tag = &tag++ + ->blksize + sentinel = -SZL + next + *) + + (* heap chunks *) + nextChnkOff = 0; (* next heap chunk, sorted ascendingly! *) + endOff = SZL; (* end of heap chunk *) + blkOff = 3*SZL; (* first block in a chunk *) + + (* heap blocks *) + tagOff = 0; (* block starts with tag *) + sizeOff = SZL; (* block size in free block relative to block start *) + sntlOff = 2*SZL; (* pointer offset table sentinel in free block relative to block start *) + nextOff = 3*SZL; (* next pointer in free block relative to block start *) + NoPtrSntl = LONG(LONG(-SZL)); + + + TYPE + ModuleName = ARRAY ModNameLen OF CHAR; + CmdName = ARRAY CmdNameLen OF CHAR; + + Module = POINTER TO ModuleDesc; + Cmd = POINTER TO CmdDesc; + EnumProc = PROCEDURE(P: PROCEDURE(p: SYSTEM.PTR)); + ModuleDesc = RECORD + next: Module; + name: ModuleName; + refcnt: LONGINT; + cmds: Cmd; + types: LONGINT; + enumPtrs: EnumProc; + reserved1, reserved2: LONGINT + END ; + + Command = PROCEDURE; + + CmdDesc = RECORD + next: Cmd; + name: CmdName; + cmd: Command + END ; + + Finalizer = PROCEDURE(obj: SYSTEM.PTR); + + FinNode = POINTER TO FinDesc; + FinDesc = RECORD + next: FinNode; + obj: LONGINT; (* weak pointer *) + marked: BOOLEAN; + finalize: Finalizer; + END ; + + VAR + (* the list of loaded (=initialization started) modules *) + modules*: SYSTEM.PTR; + + freeList: ARRAY nofLists + 1 OF LONGINT; (* dummy, 16, 32, 48, 64, 80, 96, 112, 128, sentinel *) + bigBlocks, allocated*: LONGINT; + firstTry: BOOLEAN; + + (* extensible heap *) + heap, (* the sorted list of heap chunks *) + heapend, (* max possible pointer value (used for stack collection) *) + heapsize*: LONGINT; (* the sum of all heap chunk sizes *) + + (* finalization candidates *) + fin: FinNode; + + (* garbage collector locking *) + gclock*: SHORTINT; + + + PROCEDURE -malloc(size: LONGINT): LONGINT "(LONGINT)malloc(size)"; + PROCEDURE -Lock() "Lock"; + PROCEDURE -Unlock() "Unlock"; + PROCEDURE -Mainfrm(): LONGINT "SYSTEM_mainfrm"; +(* + PROCEDURE TAS*(VAR flag:BOOLEAN): BOOLEAN; (* added for compatibility with ulmSYSTEM module; noch *) + VAR oldflag : BOOLEAN; + BEGIN + oldflag := flag; + flag := TRUE; + RETURN oldflag; + END TAS; +*) + PROCEDURE REGMOD*(VAR name: ModuleName; enumPtrs: EnumProc): SYSTEM.PTR; + VAR m: Module; + BEGIN + IF name = "SYSTEM" THEN (* cannot use NEW *) + SYSTEM.NEW(m, SIZE(ModuleDesc)); m.cmds := NIL + ELSE NEW(m) + END ; + COPY(name, m.name); m.refcnt := 0; m.enumPtrs := enumPtrs; m.next := SYSTEM.VAL(Module, modules); + modules := m; + RETURN m + END REGMOD; + + PROCEDURE REGCMD*(m: Module; VAR name: CmdName; cmd: Command); + VAR c: Cmd; + BEGIN NEW(c); + COPY(name, c.name); c.cmd := cmd; c.next := m.cmds; m.cmds := c + END REGCMD; + + PROCEDURE REGTYP*(m: Module; typ: LONGINT); + BEGIN SYSTEM.PUT(typ, m.types); m.types := typ + END REGTYP; + + PROCEDURE INCREF*(m: Module); + BEGIN INC(m.refcnt) + END INCREF; + + PROCEDURE NewChunk(blksz: LONGINT): LONGINT; + VAR chnk: LONGINT; + BEGIN + chnk := malloc(blksz + blkOff); + IF chnk # 0 THEN + SYSTEM.PUT(chnk + endOff, chnk + (blkOff + blksz)); + SYSTEM.PUT(chnk + blkOff, chnk + (blkOff + sizeOff)); + SYSTEM.PUT(chnk + (blkOff + sizeOff), blksz); + SYSTEM.PUT(chnk + (blkOff + sntlOff), NoPtrSntl); + SYSTEM.PUT(chnk + (blkOff + nextOff), bigBlocks); + bigBlocks := chnk + blkOff; + INC(heapsize, blksz) + END ; + RETURN chnk + END NewChunk; + + PROCEDURE ExtendHeap(blksz: LONGINT); + VAR size, chnk, j, next: LONGINT; + BEGIN + IF blksz > 10000*Unit THEN size := blksz + ELSE size := 10000*Unit (* additional heuristics *) + END ; + chnk := NewChunk(size); + IF chnk # 0 THEN + (*sorted insertion*) + IF chnk < heap THEN + SYSTEM.PUT(chnk, heap); heap := chnk + ELSE + j := heap; SYSTEM.GET(j, next); + WHILE (next # 0) & (chnk > next) DO j := next; SYSTEM.GET(j, next) END ; + SYSTEM.PUT(chnk, next); SYSTEM.PUT(j, chnk) + END ; + IF next = 0 THEN SYSTEM.GET(chnk + endOff, heapend) END + END + END ExtendHeap; + + PROCEDURE ^GC*(markStack: BOOLEAN); + + PROCEDURE NEWREC*(tag: LONGINT): SYSTEM.PTR; + VAR i, i0, di, blksz, restsize, t, adr, end, next, prev: LONGINT; new: SYSTEM.PTR; + BEGIN + Lock(); + SYSTEM.GET(tag, blksz); + ASSERT(blksz MOD Unit = 0); + i0 := blksz DIV Unit; i := i0; + IF i < nofLists THEN adr := freeList[i]; + WHILE adr = 0 DO INC(i); adr := freeList[i] END + END ; + IF i < nofLists THEN (* unlink *) + SYSTEM.GET(adr + nextOff, next); + freeList[i] := next; + IF i # i0 THEN (* split *) + di := i - i0; restsize := di * Unit; end := adr + restsize; + SYSTEM.PUT(end + sizeOff, blksz); + SYSTEM.PUT(end + sntlOff, NoPtrSntl); + SYSTEM.PUT(end, end + sizeOff); + SYSTEM.PUT(adr + sizeOff, restsize); + SYSTEM.PUT(adr + nextOff, freeList[di]); + freeList[di] := adr; + INC(adr, restsize) + END + ELSE + adr := bigBlocks; prev := 0; + LOOP + IF adr = 0 THEN + IF firstTry THEN + GC(TRUE); INC(blksz, Unit); + IF (heapsize - allocated - blksz) * 4 < heapsize THEN + (* heap is still almost full; expand to avoid thrashing *) + ExtendHeap((allocated + blksz) DIV (3*Unit) * (4*Unit) - heapsize) + END ; + firstTry := FALSE; new := NEWREC(tag); firstTry := TRUE; + IF new = NIL THEN + (* depending on the fragmentation, the heap may not have been extended by + the anti-thrashing heuristics above *) + ExtendHeap((allocated + blksz) DIV (3*Unit) * (4*Unit) - heapsize); + new := NEWREC(tag); (* will find a free block if heap has been expanded properly *) + END ; + Unlock(); RETURN new + ELSE + Unlock(); RETURN NIL + END + END ; + SYSTEM.GET(adr+sizeOff, t); + IF t >= blksz THEN EXIT END ; + prev := adr; SYSTEM.GET(adr + nextOff, adr) + END ; + restsize := t - blksz; end := adr + restsize; + SYSTEM.PUT(end + sizeOff, blksz); + SYSTEM.PUT(end + sntlOff, NoPtrSntl); + SYSTEM.PUT(end, end + sizeOff); + IF restsize > nofLists * Unit THEN (*resize*) + SYSTEM.PUT(adr + sizeOff, restsize) + ELSE (*unlink*) + SYSTEM.GET(adr + nextOff, next); + IF prev = 0 THEN bigBlocks := next + ELSE SYSTEM.PUT(prev + nextOff, next); + END ; + IF restsize > 0 THEN (*move*) + di := restsize DIV Unit; + SYSTEM.PUT(adr + sizeOff, restsize); + SYSTEM.PUT(adr + nextOff, freeList[di]); + freeList[di] := adr + END + END ; + INC(adr, restsize) + END ; + i := adr + 4*SZL; end := adr + blksz; + WHILE i < end DO (*deliberately unrolled*) + SYSTEM.PUT(i, LONG(LONG(0))); + SYSTEM.PUT(i + SZL, LONG(LONG(0))); + SYSTEM.PUT(i + 2*SZL, LONG(LONG(0))); + SYSTEM.PUT(i + 3*SZL, LONG(LONG(0))); + INC(i, 4*SZL) + END ; + SYSTEM.PUT(adr + nextOff, LONG(LONG(0))); + SYSTEM.PUT(adr, tag); + SYSTEM.PUT(adr + sizeOff, LONG(LONG(0))); + SYSTEM.PUT(adr + sntlOff, LONG(LONG(0))); + INC(allocated, blksz); + Unlock(); + RETURN SYSTEM.VAL(SYSTEM.PTR, adr + SZL) + END NEWREC; + + PROCEDURE NEWBLK*(size: LONGINT): SYSTEM.PTR; + VAR blksz, tag: LONGINT; new: SYSTEM.PTR; + BEGIN + Lock(); + blksz := (size + (4*SZL + Unit - 1)) DIV Unit * Unit; (*size + tag + meta + blksz + sntnl + UnitAlignment*) + new := NEWREC(SYSTEM.ADR(blksz)); + tag := SYSTEM.VAL(LONGINT, new) + blksz - 3*SZL; + SYSTEM.PUT(tag - SZL, LONG(LONG(0))); (*reserved for meta info*) + SYSTEM.PUT(tag, blksz); + SYSTEM.PUT(tag + SZL, NoPtrSntl); + SYSTEM.PUT(SYSTEM.VAL(LONGINT, new) - SZL, tag); + Unlock(); + RETURN new + END NEWBLK; + + PROCEDURE Mark(q: LONGINT); + VAR p, tag, fld, n, offset, tagbits: LONGINT; + BEGIN + IF q # 0 THEN SYSTEM.GET(q - SZL, tagbits); + IF ~ODD(tagbits) THEN + SYSTEM.PUT(q - SZL, tagbits + 1); + p := 0; tag := tagbits + SZL; + LOOP + SYSTEM.GET(tag, offset); + IF offset < 0 THEN + SYSTEM.PUT(q - SZL, tag + offset + 1); + IF p = 0 THEN EXIT END ; + n := q; q := p; + SYSTEM.GET(q - SZL, tag); DEC(tag, 1); + SYSTEM.GET(tag, offset); fld := q + offset; + SYSTEM.GET(fld, p); SYSTEM.PUT(fld, n) + ELSE + fld := q + offset; + SYSTEM.GET(fld, n); + IF n # 0 THEN + SYSTEM.GET(n - SZL, tagbits); + IF ~ODD(tagbits) THEN + SYSTEM.PUT(n - SZL, tagbits + 1); + SYSTEM.PUT(q - SZL, tag + 1); + SYSTEM.PUT(fld, p); p := q; q := n; + tag := tagbits + END + END + END ; + INC(tag, SZL) + END + END + END + END Mark; + + PROCEDURE MarkP(p: SYSTEM.PTR); (* for compatibility with EnumPtrs in ANSI mode *) + BEGIN + Mark(SYSTEM.VAL(LONGINT, p)) + END MarkP; + + PROCEDURE Scan; + VAR chnk, adr, end, start, tag, i, size, freesize: LONGINT; + BEGIN bigBlocks := 0; i := 1; + WHILE i < nofLists DO freeList[i] := 0; INC(i) END ; + freesize := 0; allocated := 0; chnk := heap; + WHILE chnk # 0 DO + adr := chnk + blkOff; SYSTEM.GET(chnk + endOff, end); + WHILE adr < end DO + SYSTEM.GET(adr, tag); + IF ODD(tag) THEN (*marked*) + IF freesize > 0 THEN + start := adr - freesize; + SYSTEM.PUT(start, start+SZL); + SYSTEM.PUT(start+sizeOff, freesize); + SYSTEM.PUT(start+sntlOff, NoPtrSntl); + i := freesize DIV Unit; freesize := 0; + IF i < nofLists THEN SYSTEM.PUT(start + nextOff, freeList[i]); freeList[i] := start + ELSE SYSTEM.PUT(start + nextOff, bigBlocks); bigBlocks := start + END + END ; + DEC(tag, 1); + SYSTEM.PUT(adr, tag); + SYSTEM.GET(tag, size); + INC(allocated, size); + INC(adr, size) + ELSE (*unmarked*) + SYSTEM.GET(tag, size); + INC(freesize, size); + INC(adr, size) + END + END ; + IF freesize > 0 THEN (*collect last block*) + start := adr - freesize; + SYSTEM.PUT(start, start+SZL); + SYSTEM.PUT(start+sizeOff, freesize); + SYSTEM.PUT(start+sntlOff, NoPtrSntl); + i := freesize DIV Unit; freesize := 0; + IF i < nofLists THEN SYSTEM.PUT(start + nextOff, freeList[i]); freeList[i] := start + ELSE SYSTEM.PUT(start + nextOff, bigBlocks); bigBlocks := start + END + END ; + SYSTEM.GET(chnk, chnk) + END + END Scan; + + PROCEDURE Sift (l, r: LONGINT; VAR a: ARRAY OF LONGINT); + VAR i, j, x: LONGINT; + BEGIN j := l; x := a[j]; + LOOP i := j; j := 2*j + 1; + IF (j < r) & (a[j] < a[j+1]) THEN INC(j) END; + IF (j > r) OR (a[j] <= x) THEN EXIT END; + a[i] := a[j] + END; + a[i] := x + END Sift; + + PROCEDURE HeapSort (n: LONGINT; VAR a: ARRAY OF LONGINT); + VAR l, r, x: LONGINT; + BEGIN l := n DIV 2; r := n - 1; + WHILE l > 0 DO DEC(l); Sift(l, r, a) END; + WHILE r > 0 DO x := a[0]; a[0] := a[r]; a[r] := x; DEC(r); Sift(l, r, a) END + END HeapSort; + + PROCEDURE MarkCandidates(n: LONGINT; VAR cand: ARRAY OF LONGINT); + VAR chnk, adr, tag, next, lim, lim1, i, ptr, size: LONGINT; + BEGIN + chnk := heap; i := 0; lim := cand[n-1]; + WHILE (chnk # 0 ) & (chnk < lim) DO + adr := chnk + blkOff; + SYSTEM.GET(chnk + endOff, lim1); + IF lim < lim1 THEN lim1 := lim END ; + WHILE adr < lim1 DO + SYSTEM.GET(adr, tag); + IF ODD(tag) THEN (*already marked*) + SYSTEM.GET(tag-1, size); INC(adr, size) + ELSE + SYSTEM.GET(tag, size); + ptr := adr + SZL; + WHILE cand[i] < ptr DO INC(i) END ; + IF i = n THEN RETURN END ; + next := adr + size; + IF cand[i] < next THEN Mark(ptr) END ; + adr := next + END + END ; + SYSTEM.GET(chnk, chnk) + END + END MarkCandidates; + + PROCEDURE CheckFin; + VAR n: FinNode; tag: LONGINT; + BEGIN n := fin; + WHILE n # NIL DO + SYSTEM.GET(n.obj - SZL, tag); + IF ~ODD(tag) THEN n.marked := FALSE; Mark(n.obj) + ELSE n.marked := TRUE + END ; + n := n.next + END + END CheckFin; + + PROCEDURE Finalize; + VAR n, prev: FinNode; + BEGIN n := fin; prev := NIL; + WHILE n # NIL DO + IF ~n.marked THEN + IF n = fin THEN fin := fin.next ELSE prev.next := n.next END ; + n.finalize(SYSTEM.VAL(SYSTEM.PTR, n.obj)); + (* new nodes may have been pushed in n.finalize, therefore: *) + IF prev = NIL THEN n := fin ELSE n := n.next END + ELSE prev := n; n := n.next + END + END + END Finalize; + + PROCEDURE FINALL*; + VAR n: FinNode; + BEGIN + WHILE fin # NIL DO + n := fin; fin := fin.next; + n.finalize(SYSTEM.VAL(SYSTEM.PTR, n.obj)) + END + END FINALL; + + PROCEDURE MarkStack(n: LONGINT; VAR cand: ARRAY OF LONGINT); + VAR + frame: SYSTEM.PTR; + inc, nofcand: LONGINT; + sp, p, stack0, ptr: LONGINT; + align: RECORD ch: CHAR; p: SYSTEM.PTR END ; + BEGIN + IF n > 0 THEN MarkStack(n-1, cand); (* flush register windows by means of recursive calls *) + IF n > 100 THEN RETURN END (* prevent tail recursion optimization *) + END ; + IF n = 0 THEN + nofcand := 0; sp := SYSTEM.ADR(frame); + stack0 := Mainfrm(); + (* check for minimum alignment of pointers *) + inc := SYSTEM.ADR(align.p) - SYSTEM.ADR(align); + IF sp > stack0 THEN inc := -inc END ; + WHILE sp # stack0 DO + SYSTEM.GET(sp, p); + IF (p > heap) & (p < heapend) THEN + IF nofcand = LEN(cand) THEN HeapSort(nofcand, cand); MarkCandidates(nofcand, cand); nofcand := 0 END ; + cand[nofcand] := p; INC(nofcand) + END ; + INC(sp, inc) + END ; + IF nofcand > 0 THEN HeapSort(nofcand, cand); MarkCandidates(nofcand, cand) END + END + END MarkStack; + + PROCEDURE GC*(markStack: BOOLEAN); + VAR + m: Module; + i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23: LONGINT; + cand: ARRAY 10000 OF LONGINT; + BEGIN + IF (gclock = 0) OR (gclock = 1) & ~markStack THEN + Lock(); + m := SYSTEM.VAL(Module, modules); + WHILE m # NIL DO + IF m.enumPtrs # NIL THEN m.enumPtrs(MarkP) END ; + m := m^.next + END ; + IF markStack THEN + (* generate register pressure to force callee saved registers to memory; + may be simplified by inlining OS calls or processor specific instructions + *) + i0 := -100; i1 := -101; i2 := -102; i3 := -103; i4 := -104; i5 := -105; i6 := -106; i7 := -107; + i8 := 1; i9 := 2; i10 := 3; i11 := 4; i12 := 5; i13 := 6; i14 := 7; i15 := 8; + i16 := 9; i17 := 10; i18 := 11; i19 := 12; i20 := 13; i21 := 14; i22 := 15; i23 := 16; + LOOP INC(i0, 1); INC(i1, 2); INC(i2, 3); INC(i3, 4); INC(i4, 5); INC(i5, 6); INC(i6, 7); INC(i7, 8); + INC(i8, 9); INC(i9, 10); INC(i10, 11); INC(i11, 12); INC(i12, 13); INC(i13, 14); INC(i14, 15); INC(i15, 16); + INC(i16, 17); INC(i17, 18); INC(i18, 19); INC(i19, 20); INC(i20, 21); INC(i21, 22); INC(i22, 23); INC(i23, 24); + IF (i0 = -99) & (i15 = 24) THEN MarkStack(32, cand); EXIT END + END ; + IF i0 + i1 + i2 + i3 + i4 + i5 + i6 + i7 + i8 + i9 + i10 + i11 + i12 + i13 + i14 + i15 + + i16 + i17 + i18 + i19 + i20 + i21 + i22 + i23 > 10000 THEN RETURN (* use all variables *) + END ; + END; + CheckFin; + Scan; + Finalize; + Unlock() + END + END GC; + + PROCEDURE REGFIN*(obj: SYSTEM.PTR; finalize: Finalizer); + VAR f: FinNode; + BEGIN NEW(f); + f.obj := SYSTEM.VAL(LONGINT, obj); f.finalize := finalize; f.marked := TRUE; f.next := fin; fin := f + END REGFIN; + + PROCEDURE InitHeap; (* initialized before body to enable NEW, SYSTEM.NEW *) + BEGIN + heap := NewChunk(heapSize0); + SYSTEM.GET(heap + endOff, heapend); + SYSTEM.PUT(heap, LONG(LONG(0))); + allocated := 0; firstTry := TRUE; freeList[nofLists] := 1; gclock := 0 + END InitHeap; + +END SYSTEM. diff --git a/src/lib/system/openbsd/gcc/x86_64/Args.Mod b/src/lib/system/openbsd/gcc/x86_64/Args.Mod new file mode 100644 index 00000000..2c0d25b5 --- /dev/null +++ b/src/lib/system/openbsd/gcc/x86_64/Args.Mod @@ -0,0 +1,65 @@ +MODULE Args; (* jt, 8.12.94 *) + + (* command line argument handling for voc (jet backend) *) + + + IMPORT SYSTEM; + + TYPE + ArgPtr = POINTER TO ARRAY 1024 OF CHAR; + ArgVec = POINTER TO ARRAY 1024 OF ArgPtr; + + VAR argc-: INTEGER; argv-: LONGINT; + (*PROCEDURE -includestdlib() "#include ";*) + PROCEDURE -externgetenv() "extern char *getenv(const char *name);"; (* took this from stdlib.h*) + PROCEDURE -Argc(): INTEGER "SYSTEM_argc"; + PROCEDURE -Argv(): LONGINT "(long)SYSTEM_argv"; + PROCEDURE -getenv(var: ARRAY OF CHAR): ArgPtr + "(Args_ArgPtr)getenv(var)"; + + PROCEDURE Get*(n: INTEGER; VAR val: ARRAY OF CHAR); + VAR av: ArgVec; + BEGIN + IF n < argc THEN av := SYSTEM.VAL(ArgVec, argv); COPY(av[n]^, val) END + END Get; + + PROCEDURE GetInt*(n: INTEGER; VAR val: LONGINT); + VAR s: ARRAY 64 OF CHAR; k, d, i: LONGINT; + BEGIN + s := ""; Get(n, s); i := 0; + IF s[0] = "-" THEN i := 1 END ; + k := 0; d := ORD(s[i]) - ORD("0"); + WHILE (d >= 0 ) & (d <= 9) DO k := k*10 + d; INC(i); d := ORD(s[i]) - ORD("0") END ; + IF s[0] = "-" THEN d := -d; DEC(i) END ; + IF i > 0 THEN val := k END + END GetInt; + + PROCEDURE Pos*(s: ARRAY OF CHAR): INTEGER; + VAR i: INTEGER; arg: ARRAY 256 OF CHAR; + BEGIN + i := 0; Get(i, arg); + WHILE (i < argc) & (s # arg) DO INC(i); Get(i, arg) END ; + RETURN i + END Pos; + + PROCEDURE GetEnv*(var: ARRAY OF CHAR; VAR val: ARRAY OF CHAR); + VAR p: ArgPtr; + BEGIN + p := getenv(var); + IF p # NIL THEN COPY(p^, val) END + END GetEnv; + + PROCEDURE getEnv*(var: ARRAY OF CHAR; VAR val: ARRAY OF CHAR): BOOLEAN; + VAR p: ArgPtr; + BEGIN + p := getenv(var); + IF p # NIL THEN + COPY(p^, val); + RETURN TRUE + ELSE + RETURN FALSE + END + END getEnv; + +BEGIN argc := Argc(); argv := Argv() +END Args. diff --git a/src/lib/system/openbsd/gcc/x86_64/Files.Mod b/src/lib/system/openbsd/gcc/x86_64/Files.Mod new file mode 100644 index 00000000..c8f42ca5 --- /dev/null +++ b/src/lib/system/openbsd/gcc/x86_64/Files.Mod @@ -0,0 +1,664 @@ +MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files *) +(* modified version of Files, which opens only the file provided and does not scan any path in any environment variable, also ReadLine procedure added; -- noch *) + IMPORT SYSTEM, Unix, Kernel, Args, Console; + + (* standard data type I/O + + little endian, + Sint:1, Int:2, Lint:4 + ORD({0}) = 1, + false = 0, true =1 + IEEE real format, + null terminated strings, + compact numbers according to M.Odersky *) + + + CONST + nofbufs = 4; + bufsize = 4096; + fileTabSize = 64; + noDesc = -1; + notDone = -1; + + (* file states *) + open = 0; create = 1; close = 2; + + + TYPE + FileName = ARRAY 101 OF CHAR; + File* = POINTER TO Handle; + Buffer = POINTER TO BufDesc; + + Handle = RECORD + workName, registerName: FileName; + tempFile: BOOLEAN; + dev, ino, mtime: LONGINT; + fd-: INTEGER; + len, pos: LONGINT; + bufs: ARRAY nofbufs OF Buffer; + swapper, state: INTEGER + END ; + + BufDesc = RECORD + f: File; + chg: BOOLEAN; + org, size: LONGINT; + data: ARRAY bufsize OF SYSTEM.BYTE + END ; + + Rider* = RECORD + res*: LONGINT; + eof*: BOOLEAN; + buf: Buffer; + org, offset: LONGINT + END ; + + Time = POINTER TO TimeDesc; + TimeDesc = RECORD + sec*, min*, hour*, mday*, mon*, year*, wday*, isdst*, zone*, gmtoff*: LONGINT; +(* sec*, min*, hour*, mday*, mon*, year*, wday*, isdst*, zone*, gmtoff*: INTEGER;*) + END ; + + VAR + fileTab: ARRAY fileTabSize OF LONGINT (*=File*); + tempno: INTEGER; + +(* for localtime *) + PROCEDURE -includetime() + '#include "time.h"'; + + PROCEDURE -localtime(VAR clock: LONGINT): Time + "(Files_Time) localtime(clock)"; + + PROCEDURE -getcwd(VAR cwd: Unix.Name) + "getcwd(cwd, cwd__len)"; + + PROCEDURE -IdxTrap "__HALT(-1)"; + + PROCEDURE^ Finalize(o: SYSTEM.PTR); + + PROCEDURE Err(s: ARRAY OF CHAR; f: File; errno: LONGINT); + BEGIN + Console.Ln; Console.String("-- "); Console.String(s); Console.String(": "); + IF f # NIL THEN + IF f.registerName # "" THEN Console.String(f.registerName) ELSE Console.String(f.workName) END + END ; + IF errno # 0 THEN Console.String(" errno = "); Console.Int(errno, 1) END ; + Console.Ln; + HALT(99) + END Err; + + PROCEDURE MakeFileName(dir, name: ARRAY OF CHAR; VAR dest: ARRAY OF CHAR); + VAR i, j: INTEGER; + BEGIN i := 0; j := 0; + WHILE dir[i] # 0X DO dest[i] := dir[i]; INC(i) END ; + IF dest[i-1] # "/" THEN dest[i] := "/"; INC(i) END ; + WHILE name[j] # 0X DO dest[i] := name[j]; INC(i); INC(j) END ; + dest[i] := 0X + END MakeFileName; + + PROCEDURE GetTempName(finalName: ARRAY OF CHAR; VAR name: ARRAY OF CHAR); + VAR n, i, j: LONGINT; + BEGIN + INC(tempno); n := tempno; i := 0; + IF finalName[0] # "/" THEN (* relative pathname *) + WHILE Kernel.CWD[i] # 0X DO name[i] := Kernel.CWD[i]; INC(i) END; + IF Kernel.CWD[i-1] # "/" THEN name[i] := "/"; INC(i) END + END; + j := 0; + WHILE finalName[j] # 0X DO name[i] := finalName[j]; INC(i); INC(j) END; + DEC(i); + WHILE name[i] # "/" DO DEC(i) END; + name[i+1] := "."; name[i+2] := "t"; name[i+3] := "m"; name[i+4] := "p"; name[i+5] := "."; INC(i, 6); + WHILE n > 0 DO name[i] := CHR(n MOD 10 + ORD("0")); n := n DIV 10; INC(i) END; + name[i] := "."; INC(i); n := SHORT(Unix.Getpid()); + WHILE n > 0 DO name[i] := CHR(n MOD 10 + ORD("0")); n := n DIV 10; INC(i) END; + name[i] := 0X + END GetTempName; + + PROCEDURE Create(f: File); + VAR stat: Unix.Status; done: BOOLEAN; + errno: LONGINT; err: ARRAY 32 OF CHAR; + BEGIN + IF f.fd = noDesc THEN + IF f.state = create THEN GetTempName(f.registerName, f.workName); f.tempFile := TRUE + ELSIF f.state = close THEN + f.workName := f.registerName; f.registerName := ""; f.tempFile := FALSE + END ; + errno := Unix.Unlink(f.workName); (*unlink first to avoid stale NFS handles and to avoid reuse of inodes*) + f.fd := Unix.Open(f.workName, SHORT(SYSTEM.VAL(LONGINT, Unix.rdwr + Unix.creat + Unix.trunc)), SHORT(SYSTEM.VAL(LONGINT, {2, 4,5, 7,8}))); + done := f.fd >= 0; errno := Unix.errno(); + IF (~done & ((errno = Unix.ENFILE) OR (errno = Unix.EMFILE))) OR (done & (f.fd >= fileTabSize)) THEN + IF done & (f.fd >= fileTabSize) THEN errno := Unix.Close(f.fd) END ; + Kernel.GC(TRUE); + f.fd := Unix.Open(f.workName, SHORT(SYSTEM.VAL(LONGINT, Unix.rdwr + Unix.creat + Unix.trunc)), SHORT(SYSTEM.VAL(LONGINT, {2, 4,5, 7,8}))); + done := f.fd >= 0 + END ; + IF done THEN + IF f.fd >= fileTabSize THEN errno := Unix.Close(f.fd); Err("too many files open", f, 0) + ELSE fileTab[f.fd] := SYSTEM.VAL(LONGINT, f); INC(Kernel.nofiles); Kernel.RegisterObject(f, Finalize); + f.state := open; f.pos := 0; errno := Unix.Fstat(f.fd, stat); + f.dev := stat.dev; f.ino := stat.ino; f.mtime := stat.mtime + END + ELSE errno := Unix.errno(); + IF errno = Unix.ENOENT THEN err := "no such directory" + ELSIF (errno = Unix.ENFILE) OR (errno = Unix.EMFILE) THEN err := "too many files open" + ELSE err := "file not created" + END ; + Err(err, f, errno) + END + END + END Create; + + PROCEDURE Flush(buf: Buffer); + VAR res: LONGINT; f: File; stat: Unix.Status; + BEGIN + IF buf.chg THEN f := buf.f; Create(f); + IF buf.org # f.pos THEN res := Unix.Lseek(f.fd, buf.org, 0) END ; + res := Unix.Write(f.fd, SYSTEM.ADR(buf.data), buf.size); + IF res < 0 THEN Err("error in writing file", f, Unix.errno()) END ; + f.pos := buf.org + buf.size; + buf.chg := FALSE; + res := Unix.Fstat(f.fd, stat); + f.mtime := stat.mtime + END + END Flush; + + PROCEDURE Close* (f: File); + VAR i, res: LONGINT; + BEGIN + IF (f.state # create) OR (f.registerName # "") THEN + Create(f); i := 0; + WHILE (i < nofbufs) & (f.bufs[i] # NIL) DO Flush(f.bufs[i]); INC(i) END ; + res := Unix.Fsync(f.fd); + IF res < 0 THEN Err("error in writing file", f, Unix.errno()) END + END + END Close; + + PROCEDURE Length* (f: File): LONGINT; + BEGIN RETURN f.len + END Length; + + PROCEDURE New* (name: ARRAY OF CHAR): File; + VAR f: File; + BEGIN + NEW(f); f.workName := ""; COPY(name, f.registerName); + f.fd := noDesc; f.state := create; f.len := 0; f.pos := 0; f.swapper := -1; (*all f.buf[i] = NIL*) + RETURN f + END New; +(* + PROCEDURE ScanPath(VAR pos: INTEGER; VAR dir: ARRAY OF CHAR); (* supports ~, ~user and blanks inside path *) + VAR i: INTEGER; ch: CHAR; home: ARRAY 256 OF CHAR; + BEGIN + i := 0; ch := Kernel.OBERON[pos]; + WHILE (ch = " ") OR (ch = ":") DO INC(pos); ch := Kernel.OBERON[pos] END ; + IF ch = "~" THEN + INC(pos); ch := Kernel.OBERON[pos]; + home := ""; Args.GetEnv("HOME", home); + WHILE home[i] # 0X DO dir[i] := home[i]; INC(i) END ; + IF (ch # "/") & (ch # 0X) & (ch # ":") & (ch # " ") THEN + WHILE (i > 0) & (dir[i-1] # "/") DO DEC(i) END + END + END ; + WHILE (ch # 0X) & (ch # ":") DO dir[i] := ch; INC(i); INC(pos); ch := Kernel.OBERON[pos] END ; + WHILE (i > 0) & (dir[i-1] = " ") DO DEC(i) END ; + dir[i] := 0X + END ScanPath; +*) + PROCEDURE HasDir(VAR name: ARRAY OF CHAR): BOOLEAN; + VAR i: INTEGER; ch: CHAR; + BEGIN i := 0; ch := name[0]; + WHILE (ch # 0X) & (ch # "/") DO INC(i); ch := name[i] END ; + RETURN ch = "/" + END HasDir; + + PROCEDURE CacheEntry(dev, ino: LONGINT; mtime: LONGINT): File; + VAR f: File; i: INTEGER; stat: Unix.Status; res: LONGINT; + BEGIN i := 0; + WHILE i < fileTabSize DO + f := SYSTEM.VAL(File, fileTab[i]); + IF (f # NIL) & (ino = f.ino) & (dev = f.dev) THEN + IF mtime # f.mtime THEN i := 0; + WHILE i < nofbufs DO + IF f.bufs[i] # NIL THEN f.bufs[i].org := -1; f.bufs[i] := NIL END ; + INC(i) + END ; + f.swapper := -1; f.mtime := mtime; + res := Unix.Fstat(f.fd, stat); f.len := stat.size + END ; + RETURN f + END ; + INC(i) + END ; + RETURN NIL + END CacheEntry; + + PROCEDURE Old* (name: ARRAY OF CHAR): File; + VAR f: File; fd: INTEGER; res, errno: LONGINT; pos: INTEGER; done: BOOLEAN; + dir, path: ARRAY 256 OF CHAR; + stat: Unix.Status; + BEGIN + IF name # "" THEN + IF HasDir(name) THEN dir := ""; COPY(name, path) + ELSE + pos := 0; + COPY(name, path); (* -- noch *) + (*ScanPath(pos, dir);*) (*MakeFileName(dir, name, path);*) (*ScanPath(pos, dir)*) + END ; + LOOP + fd := Unix.Open(path, SHORT(SYSTEM.VAL(LONGINT, Unix.rdwr)), SHORT(SYSTEM.VAL(LONGINT, {}))); done := fd >= 0; errno := Unix.errno(); + IF (~done & ((errno = Unix.ENFILE) OR (errno = Unix.EMFILE))) OR (done & (fd >= fileTabSize)) THEN + IF done & (fd >= fileTabSize) THEN res := Unix.Close(fd) END ; + Kernel.GC(TRUE); + fd := Unix.Open(path, SHORT(SYSTEM.VAL(LONGINT, Unix.rdwr)), SHORT(SYSTEM.VAL(LONGINT, {}))); + done := fd >= 0; errno := Unix.errno(); + IF ~done & ((errno = Unix.ENFILE) OR (errno = Unix.EMFILE)) THEN Err("too many files open", f, errno) END + END ; + IF ~done & ((errno = Unix.EACCES) OR (errno = Unix.EROFS) OR (errno = Unix.EAGAIN)) THEN + (* errno EAGAIN observed on Solaris 2.4 *) + fd := Unix.Open(path, SHORT(SYSTEM.VAL(LONGINT, Unix.rdonly)), SHORT(SYSTEM.VAL(LONGINT, {}))); done := fd >= 0; errno := Unix.errno() + END ; +IF (~done) & (errno # Unix.ENOENT) THEN + Console.String("warning Files.Old "); Console.String(name); + Console.String(" errno = "); Console.Int(errno, 0); Console.Ln; +END ; + IF done THEN + res := Unix.Fstat(fd, stat); + f := CacheEntry(stat.dev, stat.ino, stat.mtime); + IF f # NIL THEN res := Unix.Close(fd); RETURN f + ELSIF fd >= fileTabSize THEN res := Unix.Close(fd); Err("too many files open", f, 0) + ELSE NEW(f); fileTab[fd] := SYSTEM.VAL(LONGINT, f); INC(Kernel.nofiles); Kernel.RegisterObject(f, Finalize); + f.fd := fd; f.state := open; f.len := stat.size; f.pos := 0; f.swapper := -1; (*all f.buf[i] = NIL*) + COPY(name, f.workName); f.registerName := ""; f.tempFile := FALSE; + f.dev := stat.dev; f.ino := stat.ino; f.mtime := stat.mtime; + RETURN f + END + ELSIF dir = "" THEN RETURN NIL + ELSE (*MakeFileName(dir, name, path);*) (*ScanPath(pos, dir)*) + RETURN NIL + END + END + ELSE RETURN NIL + END + END Old; + + PROCEDURE Purge* (f: File); + VAR i: INTEGER; stat: Unix.Status; res: LONGINT; + BEGIN i := 0; + WHILE i < nofbufs DO + IF f.bufs[i] # NIL THEN f.bufs[i].org := -1; f.bufs[i] := NIL END ; + INC(i) + END ; + IF f.fd # noDesc THEN res := Unix.Ftruncate(f.fd, 0); res := Unix.Lseek(f.fd, 0, 0) END ; + f.pos := 0; f.len := 0; f.swapper := -1; + res := Unix.Fstat(f.fd, stat); f.mtime := stat.mtime + END Purge; + + PROCEDURE GetDate* (f: File; VAR t, d: LONGINT); + VAR stat: Unix.Status; clock, res: LONGINT; time: Time; + BEGIN + Create(f); res := Unix.Fstat(f.fd, stat); + time := localtime(stat.mtime); + t := time.sec + ASH(time.min, 6) + ASH(time.hour, 12); + d := time.mday + ASH(time.mon+1, 5) + ASH(time.year MOD 100, 9) + END GetDate; + + PROCEDURE Pos* (VAR r: Rider): LONGINT; + BEGIN RETURN r.org + r.offset + END Pos; + + PROCEDURE Set* (VAR r: Rider; f: File; pos: LONGINT); + VAR org, offset, i, n, res: LONGINT; buf: Buffer; + BEGIN + IF f # NIL THEN + IF pos > f.len THEN pos := f.len ELSIF pos < 0 THEN pos := 0 END ; + offset := pos MOD bufsize; org := pos - offset; i := 0; + WHILE (i < nofbufs) & (f.bufs[i] # NIL) & (org # f.bufs[i].org) DO INC(i) END ; + IF i < nofbufs THEN + IF f.bufs[i] = NIL THEN NEW(buf); buf.chg := FALSE; buf.org := -1; buf.f := f; f.bufs[i] := buf + ELSE buf := f.bufs[i] + END + ELSE + f.swapper := (f.swapper + 1) MOD nofbufs; + buf := f.bufs[f.swapper]; + Flush(buf) + END ; + IF buf.org # org THEN + IF org = f.len THEN buf.size := 0 + ELSE Create(f); + IF f.pos # org THEN res := Unix.Lseek(f.fd, org, 0) END ; + n := Unix.ReadBlk(f.fd, buf.data); + IF n < 0 THEN Err("read from file not done", f, Unix.errno()) END ; + f.pos := org + n; + buf.size := n + END ; + buf.org := org; buf.chg := FALSE + END + ELSE buf := NIL; org := 0; offset := 0 + END ; + r.buf := buf; r.org := org; r.offset := offset; r.eof := FALSE; r.res := 0 + END Set; + + PROCEDURE Read* (VAR r: Rider; VAR x: SYSTEM.BYTE); + VAR offset: LONGINT; buf: Buffer; + BEGIN + buf := r.buf; offset := r.offset; + IF r.org # buf.org THEN Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset END ; + IF (offset < buf.size) THEN + x := buf.data[offset]; r.offset := offset + 1 + ELSIF r.org + offset < buf.f.len THEN + Set(r, r.buf.f, r.org + offset); + x := r.buf.data[0]; r.offset := 1 + ELSE + x := 0X; r.eof := TRUE + END + END Read; + + PROCEDURE ReadBytes* (VAR r: Rider; VAR x: ARRAY OF SYSTEM.BYTE; n: LONGINT); + VAR xpos, min, restInBuf, offset: LONGINT; buf: Buffer; + BEGIN + IF n > LEN(x) THEN IdxTrap END ; + xpos := 0; buf := r.buf; offset := r.offset; + WHILE n > 0 DO + IF (r.org # buf.org) OR (offset >= bufsize) THEN + Set(r, buf.f, r.org + offset); + buf := r.buf; offset := r.offset + END ; + restInBuf := buf.size - offset; + IF restInBuf = 0 THEN r.res := n; r.eof := TRUE; RETURN + ELSIF n > restInBuf THEN min := restInBuf ELSE min := n END ; + SYSTEM.MOVE(SYSTEM.ADR(buf.data) + offset, SYSTEM.ADR(x) + xpos, min); + INC(offset, min); r.offset := offset; INC(xpos, min); DEC(n, min) + END ; + r.res := 0; r.eof := FALSE + END ReadBytes; + + PROCEDURE ReadByte* (VAR r : Rider; VAR x : ARRAY OF SYSTEM.BYTE); + BEGIN + ReadBytes(r, x, 1); + END ReadByte; + + PROCEDURE Base* (VAR r: Rider): File; + BEGIN RETURN r.buf.f + END Base; + + PROCEDURE Write* (VAR r: Rider; x: SYSTEM.BYTE); + VAR buf: Buffer; offset: LONGINT; + BEGIN + buf := r.buf; offset := r.offset; + IF (r.org # buf.org) OR (offset >= bufsize) THEN + Set(r, buf.f, r.org + offset); + buf := r.buf; offset := r.offset + END ; + buf.data[offset] := x; + buf.chg := TRUE; + IF offset = buf.size THEN + INC(buf.size); INC(buf.f.len) + END ; + r.offset := offset + 1; r.res := 0 + END Write; + + PROCEDURE WriteByte* (VAR r : Rider; x : SYSTEM.BYTE); (* added for compatibility with PO 2013, -- noch *) + BEGIN + Write(r, x); + END WriteByte; + + PROCEDURE WriteBytes* (VAR r: Rider; VAR x: ARRAY OF SYSTEM.BYTE; n: LONGINT); + VAR xpos, min, restInBuf, offset: LONGINT; buf: Buffer; + BEGIN + IF n > LEN(x) THEN IdxTrap END ; + xpos := 0; buf := r.buf; offset := r.offset; + WHILE n > 0 DO + IF (r.org # buf.org) OR (offset >= bufsize) THEN + Set(r, buf.f, r.org + offset); + buf := r.buf; offset := r.offset + END ; + restInBuf := bufsize - offset; + IF n > restInBuf THEN min := restInBuf ELSE min := n END ; + SYSTEM.MOVE(SYSTEM.ADR(x) + xpos, SYSTEM.ADR(buf.data) + offset, min); + INC(offset, min); r.offset := offset; + IF offset > buf.size THEN INC(buf.f.len, offset - buf.size); buf.size := offset END ; + INC(xpos, min); DEC(n, min); buf.chg := TRUE + END ; + r.res := 0 + END WriteBytes; + +(* another solution would be one that is similar to ReadBytes, WriteBytes. +No code duplication, more symmetric, only two ifs for +Read and Write in buffer, buf.size replaced by bufsize in Write ops, buf.size and len +must be made consistent with offset (if offset > buf.size) in a lazy way. + +PROCEDURE Write* (VAR r: Rider; x: SYSTEM.BYTE); + VAR buf: Buffer; offset: LONGINT; +BEGIN + buf := r.buf; offset := r.offset; + IF (offset >= bufsize) OR (r.org # buf.org) THEN + Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset; + END ; + buf.data[offset] := x; r.offset := offset + 1; buf.chg := TRUE +END Write; + + +PROCEDURE WriteBytes ... + +PROCEDURE Read* (VAR r: Rider; VAR x: SYSTEM.BYTE); + VAR offset: LONGINT; buf: Buffer; +BEGIN + buf := r.buf; offset := r.offset; + IF (offset >= buf.size) OR (r.org # buf.org) THEN + IF r.org + offset >= buf.f.len THEN x := 0X; r.eof := TRUE; RETURN + ELSE Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset + END + END ; + x := buf.data[offset]; r.offset := offset + 1 +END Read; + +but this would also affect Set, Length, and Flush. +Especially Length would become fairly complex. +*) + + PROCEDURE Delete* (name: ARRAY OF CHAR; VAR res: INTEGER); + BEGIN + res := SHORT(Unix.Unlink(name)); + res := SHORT(Unix.errno()) + END Delete; + + PROCEDURE Rename* (old, new: ARRAY OF CHAR; VAR res: INTEGER); + VAR fdold, fdnew: INTEGER; n, errno, r: LONGINT; + ostat, nstat: Unix.Status; + buf: ARRAY 4096 OF CHAR; + BEGIN + r := Unix.Stat(old, ostat); + IF r >= 0 THEN + r := Unix.Stat(new, nstat); + IF (r >= 0) & ((ostat.dev # nstat.dev) OR (ostat.ino # nstat.ino)) THEN + Delete(new, res); (* work around stale nfs handles *) + END ; + r := Unix.Rename(old, new); + IF r < 0 THEN res := SHORT(Unix.errno()); + IF res = Unix.EXDEV THEN (* cross device link, move the file *) + fdold := Unix.Open(old, SHORT(SYSTEM.VAL(LONGINT, Unix.rdonly)), SHORT(SYSTEM.VAL(LONGINT, {}))); + IF fdold < 0 THEN res := 2; RETURN END ; + fdnew := Unix.Open(new, SHORT(SYSTEM.VAL(LONGINT, Unix.rdwr + Unix.creat + Unix.trunc)), SHORT(SYSTEM.VAL(LONGINT, {2, 4,5, 7,8}))); + IF fdnew < 0 THEN r := Unix.Close(fdold); res := 3; RETURN END ; + n := Unix.Read(fdold, SYSTEM.ADR(buf), bufsize); + WHILE n > 0 DO + r := Unix.Write(fdnew, SYSTEM.ADR(buf), n); + IF r < 0 THEN errno := Unix.errno(); r := Unix.Close(fdold); r := Unix.Close(fdnew); + Err("cannot move file", NIL, errno) + END ; + n := Unix.Read(fdold, SYSTEM.ADR(buf), bufsize) + END ; + errno := Unix.errno(); + r := Unix.Close(fdold); r := Unix.Close(fdnew); + IF n = 0 THEN r := Unix.Unlink(old); res := 0 + ELSE Err("cannot move file", NIL, errno) + END ; + ELSE RETURN (* res is Unix.Rename return code *) + END + END ; + res := 0 + ELSE res := 2 (* old file not found *) + END + END Rename; + + PROCEDURE Register* (f: File); + VAR idx, errno: INTEGER; f1: File; file: ARRAY 104 OF CHAR; + BEGIN + IF (f.state = create) & (f.registerName # "") THEN f.state := close (* shortcut renaming *) END ; + Close(f); + IF f.registerName # "" THEN + Rename(f.workName, f.registerName, errno); + IF errno # 0 THEN COPY(f.registerName, file); HALT(99) END ; + f.workName := f.registerName; f.registerName := ""; f.tempFile := FALSE + END + END Register; + + PROCEDURE ChangeDirectory*(path: ARRAY OF CHAR; VAR res: INTEGER); + BEGIN + res := SHORT(Unix.Chdir(path)); + getcwd(Kernel.CWD) + END ChangeDirectory; + + PROCEDURE FlipBytes(VAR src, dest: ARRAY OF SYSTEM.BYTE); + VAR i, j: LONGINT; + BEGIN + IF ~Kernel.littleEndian THEN i := LEN(src); j := 0; + WHILE i > 0 DO DEC(i); dest[j] := src[i]; INC(j) END + ELSE SYSTEM.MOVE(SYSTEM.ADR(src), SYSTEM.ADR(dest), LEN(src)) + END + END FlipBytes; + + PROCEDURE ReadBool* (VAR R: Rider; VAR x: BOOLEAN); + BEGIN Read(R, SYSTEM.VAL(CHAR, x)) + END ReadBool; + + PROCEDURE ReadInt* (VAR R: Rider; VAR x: INTEGER); + VAR b: ARRAY 2 OF CHAR; + BEGIN ReadBytes(R, b, 2); + x := ORD(b[0]) + ORD(b[1])*256 + END ReadInt; + + PROCEDURE ReadLInt* (VAR R: Rider; VAR x: LONGINT); + VAR b: ARRAY 4 OF CHAR; + BEGIN ReadBytes(R, b, 4); + x := ORD(b[0]) + ORD(b[1])*100H + ORD(b[2])*10000H + ORD(b[3])*1000000H + END ReadLInt; + + PROCEDURE ReadSet* (VAR R: Rider; VAR x: SET); + VAR b: ARRAY 4 OF CHAR; + BEGIN ReadBytes(R, b, 4); + x := SYSTEM.VAL(SET, ORD(b[0]) + ORD(b[1])*100H + ORD(b[2])*10000H + ORD(b[3])*1000000H) + END ReadSet; + + PROCEDURE ReadReal* (VAR R: Rider; VAR x: REAL); + VAR b: ARRAY 4 OF CHAR; + BEGIN ReadBytes(R, b, 4); FlipBytes(b, x) + END ReadReal; + + PROCEDURE ReadLReal* (VAR R: Rider; VAR x: LONGREAL); + VAR b: ARRAY 8 OF CHAR; + BEGIN ReadBytes(R, b, 8); FlipBytes(b, x) + END ReadLReal; + + PROCEDURE ReadString* (VAR R: Rider; VAR x: ARRAY OF CHAR); + VAR i: INTEGER; ch: CHAR; + BEGIN i := 0; + REPEAT Read(R, ch); x[i] := ch; INC(i) UNTIL ch = 0X + END ReadString; + + (* need to read line; -- noch *) + PROCEDURE ReadLine* (VAR R: Rider; VAR x: ARRAY OF CHAR); + VAR i: INTEGER; ch: CHAR; b : BOOLEAN; + BEGIN i := 0; + b := FALSE; + REPEAT + Read(R, ch); + IF ((ch = 0X) OR (ch = 0AX) OR (ch = 0DX)) THEN + b := TRUE + ELSE + x[i] := ch; + INC(i); + END; + UNTIL b + END ReadLine; + + PROCEDURE ReadNum* (VAR R: Rider; VAR x: LONGINT); + VAR s: SHORTINT; ch: CHAR; n: LONGINT; + BEGIN s := 0; n := 0; Read(R, ch); + WHILE ORD(ch) >= 128 DO INC(n, ASH(ORD(ch) - 128, s) ); INC(s, 7); Read(R, ch) END; + INC(n, ASH(ORD(ch) MOD 64 - ORD(ch) DIV 64 * 64, s) ); + x := n + END ReadNum; + + PROCEDURE WriteBool* (VAR R: Rider; x: BOOLEAN); + BEGIN Write(R, SYSTEM.VAL(CHAR, x)) + END WriteBool; + + PROCEDURE WriteInt* (VAR R: Rider; x: INTEGER); + VAR b: ARRAY 2 OF CHAR; + BEGIN b[0] := CHR(x); b[1] := CHR(x DIV 256); + WriteBytes(R, b, 2); + END WriteInt; + + PROCEDURE WriteLInt* (VAR R: Rider; x: LONGINT); + VAR b: ARRAY 4 OF CHAR; + BEGIN + b[0] := CHR(x); b[1] := CHR(x DIV 100H); b[2] := CHR(x DIV 10000H); b[3] := CHR(x DIV 1000000H); + WriteBytes(R, b, 4); + END WriteLInt; + + PROCEDURE WriteSet* (VAR R: Rider; x: SET); + VAR b: ARRAY 4 OF CHAR; i: LONGINT; + BEGIN i := SYSTEM.VAL(LONGINT, x); + 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; + + PROCEDURE WriteReal* (VAR R: Rider; x: REAL); + VAR b: ARRAY 4 OF CHAR; + BEGIN FlipBytes(x, b); WriteBytes(R, b, 4) + END WriteReal; + + PROCEDURE WriteLReal* (VAR R: Rider; x: LONGREAL); + VAR b: ARRAY 8 OF CHAR; + BEGIN FlipBytes(x, b); WriteBytes(R, b, 8) + END WriteLReal; + + PROCEDURE WriteString* (VAR R: Rider; x: ARRAY [1] OF CHAR); + VAR i: INTEGER; + BEGIN i := 0; + WHILE x[i] # 0X DO INC(i) END ; + WriteBytes(R, x, i+1) + END WriteString; + + PROCEDURE WriteNum* (VAR R: Rider; x: LONGINT); + BEGIN + WHILE (x < - 64) OR (x > 63) DO Write(R, CHR(x MOD 128 + 128)); x := x DIV 128 END; + Write(R, CHR(x MOD 128)) + END WriteNum; + + PROCEDURE GetName*(f: File; VAR name: ARRAY OF CHAR); + BEGIN + COPY (f.workName, name); + END GetName; + + PROCEDURE Finalize(o: SYSTEM.PTR); + VAR f: File; res: LONGINT; + BEGIN + f := SYSTEM.VAL(File, o); + IF f.fd >= 0 THEN + fileTab[f.fd] := 0; res := Unix.Close(f.fd); f.fd := -1; DEC(Kernel.nofiles); + IF f.tempFile THEN res := Unix.Unlink(f.workName) END + END + END Finalize; + + PROCEDURE Init; + VAR i: LONGINT; + BEGIN + i := 0; WHILE i < fileTabSize DO fileTab[i] := 0; INC(i) END ; + tempno := -1; Kernel.nofiles := 0 + END Init; + +BEGIN Init +END Files. diff --git a/src/lib/system/openbsd/gcc/x86_64/Files0.Mod b/src/lib/system/openbsd/gcc/x86_64/Files0.Mod new file mode 100644 index 00000000..1d9cd953 --- /dev/null +++ b/src/lib/system/openbsd/gcc/x86_64/Files0.Mod @@ -0,0 +1,636 @@ +MODULE Files0; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files *) + +(* this module is not for use by developers and inteded to bootstrap voc *) +(* for general use import Files module *) + + IMPORT SYSTEM, Unix, Kernel := Kernel0, Args, Console; + + (* standard data type I/O + + little endian, + Sint:1, Int:2, Lint:4 + ORD({0}) = 1, + false = 0, true =1 + IEEE real format, + null terminated strings, + compact numbers according to M.Odersky *) + + + CONST + nofbufs = 4; + bufsize = 4096; + fileTabSize = 64; + noDesc = -1; + notDone = -1; + + (* file states *) + open = 0; create = 1; close = 2; + + + TYPE + FileName = ARRAY 101 OF CHAR; + File* = POINTER TO Handle; + Buffer = POINTER TO BufDesc; + + Handle = RECORD + workName, registerName: FileName; + tempFile: BOOLEAN; + dev, ino, mtime: LONGINT; + fd-: INTEGER; + len, pos: LONGINT; + bufs: ARRAY nofbufs OF Buffer; + swapper, state: INTEGER + END ; + + BufDesc = RECORD + f: File; + chg: BOOLEAN; + org, size: LONGINT; + data: ARRAY bufsize OF SYSTEM.BYTE + END ; + + Rider* = RECORD + res*: LONGINT; + eof*: BOOLEAN; + buf: Buffer; + org, offset: LONGINT + END ; + + Time = POINTER TO TimeDesc; + TimeDesc = RECORD + sec*, min*, hour*, mday*, mon*, year*, wday*, isdst*, zone*, gmtoff*: LONGINT; +(* sec*, min*, hour*, mday*, mon*, year*, wday*, isdst*, zone*, gmtoff*: INTEGER;*) + END ; + + VAR + fileTab: ARRAY fileTabSize OF LONGINT (*=File*); + tempno: INTEGER; + +(* for localtime *) + PROCEDURE -includetime() + '#include "time.h"'; + + PROCEDURE -localtime(VAR clock: LONGINT): Time + "(Files0_Time) localtime(clock)"; + + PROCEDURE -getcwd(VAR cwd: Unix.Name) + "getcwd(cwd, cwd__len)"; + + PROCEDURE -IdxTrap "__HALT(-1)"; + + PROCEDURE^ Finalize(o: SYSTEM.PTR); + + PROCEDURE Err(s: ARRAY OF CHAR; f: File; errno: LONGINT); + BEGIN + Console.Ln; Console.String("-- "); Console.String(s); Console.String(": "); + IF f # NIL THEN + IF f.registerName # "" THEN Console.String(f.registerName) ELSE Console.String(f.workName) END + END ; + IF errno # 0 THEN Console.String(" errno = "); Console.Int(errno, 1) END ; + Console.Ln; + HALT(99) + END Err; + + PROCEDURE MakeFileName(dir, name: ARRAY OF CHAR; VAR dest: ARRAY OF CHAR); + VAR i, j: INTEGER; + BEGIN i := 0; j := 0; + WHILE dir[i] # 0X DO dest[i] := dir[i]; INC(i) END ; + IF dest[i-1] # "/" THEN dest[i] := "/"; INC(i) END ; + WHILE name[j] # 0X DO dest[i] := name[j]; INC(i); INC(j) END ; + dest[i] := 0X + END MakeFileName; + + PROCEDURE GetTempName(finalName: ARRAY OF CHAR; VAR name: ARRAY OF CHAR); + VAR n, i, j: LONGINT; + BEGIN + INC(tempno); n := tempno; i := 0; + IF finalName[0] # "/" THEN (* relative pathname *) + WHILE Kernel.CWD[i] # 0X DO name[i] := Kernel.CWD[i]; INC(i) END; + IF Kernel.CWD[i-1] # "/" THEN name[i] := "/"; INC(i) END + END; + j := 0; + WHILE finalName[j] # 0X DO name[i] := finalName[j]; INC(i); INC(j) END; + DEC(i); + WHILE name[i] # "/" DO DEC(i) END; + name[i+1] := "."; name[i+2] := "t"; name[i+3] := "m"; name[i+4] := "p"; name[i+5] := "."; INC(i, 6); + WHILE n > 0 DO name[i] := CHR(n MOD 10 + ORD("0")); n := n DIV 10; INC(i) END; + name[i] := "."; INC(i); n := SHORT(Unix.Getpid()); + WHILE n > 0 DO name[i] := CHR(n MOD 10 + ORD("0")); n := n DIV 10; INC(i) END; + name[i] := 0X + END GetTempName; + + PROCEDURE Create(f: File); + VAR stat: Unix.Status; done: BOOLEAN; + errno: LONGINT; err: ARRAY 32 OF CHAR; + BEGIN + IF f.fd = noDesc THEN + IF f.state = create THEN GetTempName(f.registerName, f.workName); f.tempFile := TRUE + ELSIF f.state = close THEN + f.workName := f.registerName; f.registerName := ""; f.tempFile := FALSE + END ; + errno := Unix.Unlink(f.workName); (*unlink first to avoid stale NFS handles and to avoid reuse of inodes*) +f.fd := Unix.Open(f.workName, SHORT(SYSTEM.VAL(LONGINT, (Unix.rdwr + Unix.creat + Unix.trunc))), SHORT(SYSTEM.VAL(LONGINT, ({2, 4,5, 7,8})))); + done := f.fd >= 0; errno := Unix.errno(); + IF (~done & ((errno = Unix.ENFILE) OR (errno = Unix.EMFILE))) OR (done & (f.fd >= fileTabSize)) THEN + IF done & (f.fd >= fileTabSize) THEN errno := Unix.Close(f.fd) END ; + Kernel.GC(TRUE); + f.fd := Unix.Open(f.workName, SHORT(SYSTEM.VAL(LONGINT, (Unix.rdwr + Unix.creat + Unix.trunc))), SHORT(SYSTEM.VAL(LONGINT, {2, 4,5, 7,8}))); + done := f.fd >= 0 + END ; + IF done THEN + IF f.fd >= fileTabSize THEN errno := Unix.Close(f.fd); Err("too many files open", f, 0) + ELSE fileTab[f.fd] := SYSTEM.VAL(LONGINT, f); INC(Kernel.nofiles); Kernel.RegisterObject(f, Finalize); + f.state := open; f.pos := 0; errno := Unix.Fstat(f.fd, stat); + f.dev := stat.dev; f.ino := stat.ino; f.mtime := stat.mtime + END + ELSE errno := Unix.errno(); + IF errno = Unix.ENOENT THEN err := "no such directory" + ELSIF (errno = Unix.ENFILE) OR (errno = Unix.EMFILE) THEN err := "too many files open" + ELSE err := "file not created" + END ; + Err(err, f, errno) + END + END + END Create; + + PROCEDURE Flush(buf: Buffer); + VAR res: LONGINT; f: File; stat: Unix.Status; + BEGIN + IF buf.chg THEN f := buf.f; Create(f); + IF buf.org # f.pos THEN res := Unix.Lseek(f.fd, buf.org, 0) END ; + res := Unix.Write(f.fd, SYSTEM.ADR(buf.data), buf.size); + IF res < 0 THEN Err("error in writing file", f, Unix.errno()) END ; + f.pos := buf.org + buf.size; + buf.chg := FALSE; + res := Unix.Fstat(f.fd, stat); + f.mtime := stat.mtime + END + END Flush; + + PROCEDURE Close* (f: File); + VAR i, res: LONGINT; + BEGIN + IF (f.state # create) OR (f.registerName # "") THEN + Create(f); i := 0; + WHILE (i < nofbufs) & (f.bufs[i] # NIL) DO Flush(f.bufs[i]); INC(i) END ; + res := Unix.Fsync(f.fd); + IF res < 0 THEN Err("error in writing file", f, Unix.errno()) END + END + END Close; + + PROCEDURE Length* (f: File): LONGINT; + BEGIN RETURN f.len + END Length; + + PROCEDURE New* (name: ARRAY OF CHAR): File; + VAR f: File; + BEGIN + NEW(f); f.workName := ""; COPY(name, f.registerName); + f.fd := noDesc; f.state := create; f.len := 0; f.pos := 0; f.swapper := -1; (*all f.buf[i] = NIL*) + RETURN f + END New; + + PROCEDURE ScanPath(VAR pos: INTEGER; VAR dir: ARRAY OF CHAR); (* supports ~, ~user and blanks inside path *) + VAR i: INTEGER; ch: CHAR; home: ARRAY 256 OF CHAR; + BEGIN + i := 0; ch := Kernel.OBERON[pos]; + WHILE (ch = " ") OR (ch = ":") DO INC(pos); ch := Kernel.OBERON[pos] END ; + IF ch = "~" THEN + INC(pos); ch := Kernel.OBERON[pos]; + home := ""; Args.GetEnv("HOME", home); + WHILE home[i] # 0X DO dir[i] := home[i]; INC(i) END ; + IF (ch # "/") & (ch # 0X) & (ch # ":") & (ch # " ") THEN + WHILE (i > 0) & (dir[i-1] # "/") DO DEC(i) END + END + END ; + WHILE (ch # 0X) & (ch # ":") DO dir[i] := ch; INC(i); INC(pos); ch := Kernel.OBERON[pos] END ; + WHILE (i > 0) & (dir[i-1] = " ") DO DEC(i) END ; + dir[i] := 0X + END ScanPath; + + PROCEDURE HasDir(VAR name: ARRAY OF CHAR): BOOLEAN; + VAR i: INTEGER; ch: CHAR; + BEGIN i := 0; ch := name[0]; + WHILE (ch # 0X) & (ch # "/") DO INC(i); ch := name[i] END ; + RETURN ch = "/" + END HasDir; + + PROCEDURE CacheEntry(dev, ino: LONGINT; mtime: LONGINT): File; + VAR f: File; i: INTEGER; stat: Unix.Status; res: LONGINT; + BEGIN i := 0; + WHILE i < fileTabSize DO + f := SYSTEM.VAL(File, fileTab[i]); + IF (f # NIL) & (ino = f.ino) & (dev = f.dev) THEN + IF mtime # f.mtime THEN i := 0; + WHILE i < nofbufs DO + IF f.bufs[i] # NIL THEN f.bufs[i].org := -1; f.bufs[i] := NIL END ; + INC(i) + END ; + f.swapper := -1; f.mtime := mtime; + res := Unix.Fstat(f.fd, stat); f.len := stat.size + END ; + RETURN f + END ; + INC(i) + END ; + RETURN NIL + END CacheEntry; + + PROCEDURE Old* (name: ARRAY OF CHAR): File; + VAR f: File; fd: INTEGER; res, errno: LONGINT; pos: INTEGER; done: BOOLEAN; + dir, path: ARRAY 256 OF CHAR; + stat: Unix.Status; + BEGIN + IF name # "" THEN + IF HasDir(name) THEN dir := ""; COPY(name, path) + ELSE pos := 0; ScanPath(pos, dir); MakeFileName(dir, name, path); ScanPath(pos, dir) + END ; + LOOP + fd := Unix.Open(path, SHORT(SYSTEM.VAL(LONGINT, Unix.rdwr)), SHORT(SYSTEM.VAL(LONGINT, {}))); done := fd >= 0; errno := Unix.errno(); + IF (~done & ((errno = Unix.ENFILE) OR (errno = Unix.EMFILE))) OR (done & (fd >= fileTabSize)) THEN + IF done & (fd >= fileTabSize) THEN res := Unix.Close(fd) END ; + Kernel.GC(TRUE); + fd := Unix.Open(path, SHORT(SYSTEM.VAL(LONGINT, Unix.rdwr)), SHORT(SYSTEM.VAL(LONGINT, {}))); + done := fd >= 0; errno := Unix.errno(); + IF ~done & ((errno = Unix.ENFILE) OR (errno = Unix.EMFILE)) THEN Err("too many files open", f, errno) END + END ; + IF ~done & ((errno = Unix.EACCES) OR (errno = Unix.EROFS) OR (errno = Unix.EAGAIN)) THEN + (* errno EAGAIN observed on Solaris 2.4 *) + fd := Unix.Open(path, SHORT(SYSTEM.VAL(LONGINT, Unix.rdonly)), SHORT(SYSTEM.VAL(LONGINT, {}))); done := fd >= 0; errno := Unix.errno() + END ; +IF (~done) & (errno # Unix.ENOENT) THEN + Console.String("warning Files0.Old "); Console.String(name); + Console.String(" errno = "); Console.Int(errno, 0); Console.Ln; +END ; + IF done THEN + res := Unix.Fstat(fd, stat); + f := CacheEntry(stat.dev, stat.ino, stat.mtime); + IF f # NIL THEN res := Unix.Close(fd); RETURN f + ELSIF fd >= fileTabSize THEN res := Unix.Close(fd); Err("too many files open", f, 0) + ELSE NEW(f); fileTab[fd] := SYSTEM.VAL(LONGINT, f); INC(Kernel.nofiles); Kernel.RegisterObject(f, Finalize); + f.fd := fd; f.state := open; f.len := stat.size; f.pos := 0; f.swapper := -1; (*all f.buf[i] = NIL*) + COPY(name, f.workName); f.registerName := ""; f.tempFile := FALSE; + f.dev := stat.dev; f.ino := stat.ino; f.mtime := stat.mtime; + RETURN f + END + ELSIF dir = "" THEN RETURN NIL + ELSE MakeFileName(dir, name, path); ScanPath(pos, dir) + END + END + ELSE RETURN NIL + END + END Old; + + PROCEDURE Purge* (f: File); + VAR i: INTEGER; stat: Unix.Status; res: LONGINT; + BEGIN i := 0; + WHILE i < nofbufs DO + IF f.bufs[i] # NIL THEN f.bufs[i].org := -1; f.bufs[i] := NIL END ; + INC(i) + END ; + IF f.fd # noDesc THEN res := Unix.Ftruncate(f.fd, 0); res := Unix.Lseek(f.fd, 0, 0) END ; + f.pos := 0; f.len := 0; f.swapper := -1; + res := Unix.Fstat(f.fd, stat); f.mtime := stat.mtime + END Purge; + + PROCEDURE GetDate* (f: File; VAR t, d: LONGINT); + VAR stat: Unix.Status; clock, res: LONGINT; time: Time; + BEGIN + Create(f); res := Unix.Fstat(f.fd, stat); + time := localtime(stat.mtime); + t := time.sec + ASH(time.min, 6) + ASH(time.hour, 12); + d := time.mday + ASH(time.mon+1, 5) + ASH(time.year MOD 100, 9) + END GetDate; + + PROCEDURE Pos* (VAR r: Rider): LONGINT; + BEGIN RETURN r.org + r.offset + END Pos; + + PROCEDURE Set* (VAR r: Rider; f: File; pos: LONGINT); + VAR org, offset, i, n, res: LONGINT; buf: Buffer; + BEGIN + IF f # NIL THEN + IF pos > f.len THEN pos := f.len ELSIF pos < 0 THEN pos := 0 END ; + offset := pos MOD bufsize; org := pos - offset; i := 0; + WHILE (i < nofbufs) & (f.bufs[i] # NIL) & (org # f.bufs[i].org) DO INC(i) END ; + IF i < nofbufs THEN + IF f.bufs[i] = NIL THEN NEW(buf); buf.chg := FALSE; buf.org := -1; buf.f := f; f.bufs[i] := buf + ELSE buf := f.bufs[i] + END + ELSE + f.swapper := (f.swapper + 1) MOD nofbufs; + buf := f.bufs[f.swapper]; + Flush(buf) + END ; + IF buf.org # org THEN + IF org = f.len THEN buf.size := 0 + ELSE Create(f); + IF f.pos # org THEN res := Unix.Lseek(f.fd, org, 0) END ; + n := Unix.ReadBlk(f.fd, buf.data); + IF n < 0 THEN Err("read from file not done", f, Unix.errno()) END ; + f.pos := org + n; + buf.size := n + END ; + buf.org := org; buf.chg := FALSE + END + ELSE buf := NIL; org := 0; offset := 0 + END ; + r.buf := buf; r.org := org; r.offset := offset; r.eof := FALSE; r.res := 0 + END Set; + + PROCEDURE Read* (VAR r: Rider; VAR x: SYSTEM.BYTE); + VAR offset: LONGINT; buf: Buffer; + BEGIN + buf := r.buf; offset := r.offset; + IF r.org # buf.org THEN Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset END ; + IF (offset < buf.size) THEN + x := buf.data[offset]; r.offset := offset + 1 + ELSIF r.org + offset < buf.f.len THEN + Set(r, r.buf.f, r.org + offset); + x := r.buf.data[0]; r.offset := 1 + ELSE + x := 0X; r.eof := TRUE + END + END Read; + + PROCEDURE ReadBytes* (VAR r: Rider; VAR x: ARRAY OF SYSTEM.BYTE; n: LONGINT); + VAR xpos, min, restInBuf, offset: LONGINT; buf: Buffer; + BEGIN + IF n > LEN(x) THEN IdxTrap END ; + xpos := 0; buf := r.buf; offset := r.offset; + WHILE n > 0 DO + IF (r.org # buf.org) OR (offset >= bufsize) THEN + Set(r, buf.f, r.org + offset); + buf := r.buf; offset := r.offset + END ; + restInBuf := buf.size - offset; + IF restInBuf = 0 THEN r.res := n; r.eof := TRUE; RETURN + ELSIF n > restInBuf THEN min := restInBuf ELSE min := n END ; + SYSTEM.MOVE(SYSTEM.ADR(buf.data) + offset, SYSTEM.ADR(x) + xpos, min); + INC(offset, min); r.offset := offset; INC(xpos, min); DEC(n, min) + END ; + r.res := 0; r.eof := FALSE + END ReadBytes; + + PROCEDURE ReadByte* (VAR r : Rider; VAR x : ARRAY OF SYSTEM.BYTE); + BEGIN + ReadBytes(r, x, 1); + END ReadByte; + + PROCEDURE Base* (VAR r: Rider): File; + BEGIN RETURN r.buf.f + END Base; + + PROCEDURE Write* (VAR r: Rider; x: SYSTEM.BYTE); + VAR buf: Buffer; offset: LONGINT; + BEGIN + buf := r.buf; offset := r.offset; + IF (r.org # buf.org) OR (offset >= bufsize) THEN + Set(r, buf.f, r.org + offset); + buf := r.buf; offset := r.offset + END ; + buf.data[offset] := x; + buf.chg := TRUE; + IF offset = buf.size THEN + INC(buf.size); INC(buf.f.len) + END ; + r.offset := offset + 1; r.res := 0 + END Write; + + PROCEDURE WriteBytes* (VAR r: Rider; VAR x: ARRAY OF SYSTEM.BYTE; n: LONGINT); + VAR xpos, min, restInBuf, offset: LONGINT; buf: Buffer; + BEGIN + IF n > LEN(x) THEN IdxTrap END ; + xpos := 0; buf := r.buf; offset := r.offset; + WHILE n > 0 DO + IF (r.org # buf.org) OR (offset >= bufsize) THEN + Set(r, buf.f, r.org + offset); + buf := r.buf; offset := r.offset + END ; + restInBuf := bufsize - offset; + IF n > restInBuf THEN min := restInBuf ELSE min := n END ; + SYSTEM.MOVE(SYSTEM.ADR(x) + xpos, SYSTEM.ADR(buf.data) + offset, min); + INC(offset, min); r.offset := offset; + IF offset > buf.size THEN INC(buf.f.len, offset - buf.size); buf.size := offset END ; + INC(xpos, min); DEC(n, min); buf.chg := TRUE + END ; + r.res := 0 + END WriteBytes; + +(* another solution would be one that is similar to ReadBytes, WriteBytes. +No code duplication, more symmetric, only two ifs for +Read and Write in buffer, buf.size replaced by bufsize in Write ops, buf.size and len +must be made consistent with offset (if offset > buf.size) in a lazy way. + +PROCEDURE Write* (VAR r: Rider; x: SYSTEM.BYTE); + VAR buf: Buffer; offset: LONGINT; +BEGIN + buf := r.buf; offset := r.offset; + IF (offset >= bufsize) OR (r.org # buf.org) THEN + Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset; + END ; + buf.data[offset] := x; r.offset := offset + 1; buf.chg := TRUE +END Write; + +PROCEDURE WriteBytes ... + +PROCEDURE Read* (VAR r: Rider; VAR x: SYSTEM.BYTE); + VAR offset: LONGINT; buf: Buffer; +BEGIN + buf := r.buf; offset := r.offset; + IF (offset >= buf.size) OR (r.org # buf.org) THEN + IF r.org + offset >= buf.f.len THEN x := 0X; r.eof := TRUE; RETURN + ELSE Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset + END + END ; + x := buf.data[offset]; r.offset := offset + 1 +END Read; + +but this would also affect Set, Length, and Flush. +Especially Length would become fairly complex. +*) + + PROCEDURE Delete* (name: ARRAY OF CHAR; VAR res: INTEGER); + BEGIN + res := SHORT(Unix.Unlink(name)); + res := SHORT(Unix.errno()) + END Delete; + + PROCEDURE Rename* (old, new: ARRAY OF CHAR; VAR res: INTEGER); + VAR fdold, fdnew: INTEGER; n, errno, r: LONGINT; + ostat, nstat: Unix.Status; + buf: ARRAY 4096 OF CHAR; + BEGIN + r := Unix.Stat(old, ostat); + IF r >= 0 THEN + r := Unix.Stat(new, nstat); + IF (r >= 0) & ((ostat.dev # nstat.dev) OR (ostat.ino # nstat.ino)) THEN + Delete(new, res); (* work around stale nfs handles *) + END ; + r := Unix.Rename(old, new); + IF r < 0 THEN res := SHORT(Unix.errno()); + IF res = Unix.EXDEV THEN (* cross device link, move the file *) + fdold := Unix.Open(old, SHORT(SYSTEM.VAL(LONGINT, Unix.rdonly)), SHORT(SYSTEM.VAL(LONGINT, {}))); + IF fdold < 0 THEN res := 2; RETURN END ; + fdnew := Unix.Open(new, SHORT(SYSTEM.VAL(LONGINT, Unix.rdwr + Unix.creat + Unix.trunc)), SHORT(SYSTEM.VAL(LONGINT, {2, 4,5, 7,8}))); + IF fdnew < 0 THEN r := Unix.Close(fdold); res := 3; RETURN END ; + n := Unix.Read(fdold, SYSTEM.ADR(buf), bufsize); + WHILE n > 0 DO + r := Unix.Write(fdnew, SYSTEM.ADR(buf), n); + IF r < 0 THEN errno := Unix.errno(); r := Unix.Close(fdold); r := Unix.Close(fdnew); + Err("cannot move file", NIL, errno) + END ; + n := Unix.Read(fdold, SYSTEM.ADR(buf), bufsize) + END ; + errno := Unix.errno(); + r := Unix.Close(fdold); r := Unix.Close(fdnew); + IF n = 0 THEN r := Unix.Unlink(old); res := 0 + ELSE Err("cannot move file", NIL, errno) + END ; + ELSE RETURN (* res is Unix.Rename return code *) + END + END ; + res := 0 + ELSE res := 2 (* old file not found *) + END + END Rename; + + PROCEDURE Register* (f: File); + VAR idx, errno: INTEGER; f1: File; file: ARRAY 104 OF CHAR; + BEGIN + IF (f.state = create) & (f.registerName # "") THEN f.state := close (* shortcut renaming *) END ; + Close(f); + IF f.registerName # "" THEN + Rename(f.workName, f.registerName, errno); + IF errno # 0 THEN COPY(f.registerName, file); HALT(99) END ; + f.workName := f.registerName; f.registerName := ""; f.tempFile := FALSE + END + END Register; + + PROCEDURE ChangeDirectory*(path: ARRAY OF CHAR; VAR res: INTEGER); + BEGIN + res := SHORT(Unix.Chdir(path)); + getcwd(Kernel.CWD) + END ChangeDirectory; + + PROCEDURE FlipBytes(VAR src, dest: ARRAY OF SYSTEM.BYTE); + VAR i, j: LONGINT; + BEGIN + IF ~Kernel.littleEndian THEN i := LEN(src); j := 0; + WHILE i > 0 DO DEC(i); dest[j] := src[i]; INC(j) END + ELSE SYSTEM.MOVE(SYSTEM.ADR(src), SYSTEM.ADR(dest), LEN(src)) + END + END FlipBytes; + + PROCEDURE ReadBool* (VAR R: Rider; VAR x: BOOLEAN); + BEGIN Read(R, SYSTEM.VAL(CHAR, x)) + END ReadBool; + + PROCEDURE ReadInt* (VAR R: Rider; VAR x: INTEGER); + VAR b: ARRAY 2 OF CHAR; + BEGIN ReadBytes(R, b, 2); + x := ORD(b[0]) + ORD(b[1])*256 + END ReadInt; + + PROCEDURE ReadLInt* (VAR R: Rider; VAR x: LONGINT); + VAR b: ARRAY 4 OF CHAR; + BEGIN ReadBytes(R, b, 4); + x := ORD(b[0]) + ORD(b[1])*100H + ORD(b[2])*10000H + ORD(b[3])*1000000H + END ReadLInt; + + PROCEDURE ReadSet* (VAR R: Rider; VAR x: SET); + VAR b: ARRAY 4 OF CHAR; + BEGIN ReadBytes(R, b, 4); + x := SYSTEM.VAL(SET, ORD(b[0]) + ORD(b[1])*100H + ORD(b[2])*10000H + ORD(b[3])*1000000H) + END ReadSet; + + PROCEDURE ReadReal* (VAR R: Rider; VAR x: REAL); + VAR b: ARRAY 4 OF CHAR; + BEGIN ReadBytes(R, b, 4); FlipBytes(b, x) + END ReadReal; + + PROCEDURE ReadLReal* (VAR R: Rider; VAR x: LONGREAL); + VAR b: ARRAY 8 OF CHAR; + BEGIN ReadBytes(R, b, 8); FlipBytes(b, x) + END ReadLReal; + + PROCEDURE ReadString* (VAR R: Rider; VAR x: ARRAY OF CHAR); + VAR i: INTEGER; ch: CHAR; + BEGIN i := 0; + REPEAT Read(R, ch); x[i] := ch; INC(i) UNTIL ch = 0X + END ReadString; + + PROCEDURE ReadNum* (VAR R: Rider; VAR x: LONGINT); + VAR s: SHORTINT; ch: CHAR; n: LONGINT; + BEGIN s := 0; n := 0; Read(R, ch); + WHILE ORD(ch) >= 128 DO INC(n, ASH(ORD(ch) - 128, s) ); INC(s, 7); Read(R, ch) END; + INC(n, ASH(ORD(ch) MOD 64 - ORD(ch) DIV 64 * 64, s) ); + x := n + END ReadNum; + + PROCEDURE WriteBool* (VAR R: Rider; x: BOOLEAN); + BEGIN Write(R, SYSTEM.VAL(CHAR, x)) + END WriteBool; + + PROCEDURE WriteInt* (VAR R: Rider; x: INTEGER); + VAR b: ARRAY 2 OF CHAR; + BEGIN b[0] := CHR(x); b[1] := CHR(x DIV 256); + WriteBytes(R, b, 2); + END WriteInt; + + PROCEDURE WriteLInt* (VAR R: Rider; x: LONGINT); + VAR b: ARRAY 4 OF CHAR; + BEGIN + b[0] := CHR(x); b[1] := CHR(x DIV 100H); b[2] := CHR(x DIV 10000H); b[3] := CHR(x DIV 1000000H); + WriteBytes(R, b, 4); + END WriteLInt; + + PROCEDURE WriteSet* (VAR R: Rider; x: SET); + VAR b: ARRAY 4 OF CHAR; i: LONGINT; + BEGIN i := SYSTEM.VAL(LONGINT, x); + 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; + + PROCEDURE WriteReal* (VAR R: Rider; x: REAL); + VAR b: ARRAY 4 OF CHAR; + BEGIN FlipBytes(x, b); WriteBytes(R, b, 4) + END WriteReal; + + PROCEDURE WriteLReal* (VAR R: Rider; x: LONGREAL); + VAR b: ARRAY 8 OF CHAR; + BEGIN FlipBytes(x, b); WriteBytes(R, b, 8) + END WriteLReal; + + PROCEDURE WriteString* (VAR R: Rider; x: ARRAY [1] OF CHAR); + VAR i: INTEGER; + BEGIN i := 0; + WHILE x[i] # 0X DO INC(i) END ; + WriteBytes(R, x, i+1) + END WriteString; + + PROCEDURE WriteNum* (VAR R: Rider; x: LONGINT); + BEGIN + WHILE (x < - 64) OR (x > 63) DO Write(R, CHR(x MOD 128 + 128)); x := x DIV 128 END; + Write(R, CHR(x MOD 128)) + END WriteNum; + + PROCEDURE Finalize(o: SYSTEM.PTR); + VAR f: File; res: LONGINT; + BEGIN + f := SYSTEM.VAL(File, o); + IF f.fd >= 0 THEN + fileTab[f.fd] := 0; res := Unix.Close(f.fd); f.fd := -1; DEC(Kernel.nofiles); + IF f.tempFile THEN res := Unix.Unlink(f.workName) END + END + END Finalize; + + PROCEDURE Init; + VAR i: LONGINT; + BEGIN + i := 0; WHILE i < fileTabSize DO fileTab[i] := 0; INC(i) END ; + tempno := -1; Kernel.nofiles := 0 + END Init; + +BEGIN Init +END Files0. diff --git a/src/lib/system/openbsd/gcc/x86_64/SYSTEM.c0 b/src/lib/system/openbsd/gcc/x86_64/SYSTEM.c0 new file mode 100644 index 00000000..3d875068 --- /dev/null +++ b/src/lib/system/openbsd/gcc/x86_64/SYSTEM.c0 @@ -0,0 +1,205 @@ +/* +* The body prefix file of the voc(jet backend) runtime system, Version 1.0 +* +* Copyright (c) Software Templ, 1994, 1995 +* +* Module SYSTEM is subject to change any time without prior notification. +* Software Templ disclaims all warranties with regard to module SYSTEM, +* in particular shall Software Templ not be liable for any damage resulting +* from inappropriate use or modification of module SYSTEM. +* +* Version 1.1 jt, 24.11.95 fixes for correct pointer arithmetic on Cray computers +* jt 31.1.2007 ANSI prototypes for malloc and exit in order to avoid cc warnings +* +*/ + +#include "SYSTEM.h" +#ifdef __STDC__ +#include "stdarg.h" +#else +#include "varargs.h" +#endif + +extern void *malloc(unsigned long size); +extern void exit(int status); + +void (*SYSTEM_Halt)(); +LONGINT SYSTEM_halt; /* x in HALT(x) */ +LONGINT SYSTEM_assert; /* x in ASSERT(cond, x) */ +LONGINT SYSTEM_argc; +LONGINT SYSTEM_argv; +LONGINT SYSTEM_lock; +BOOLEAN SYSTEM_interrupted; +static LONGINT SYSTEM_mainfrm; /* adr of main proc stack frame, used for stack collection */ + +#define Lock SYSTEM_lock++ +#define Unlock SYSTEM_lock--; if (SYSTEM_interrupted && (SYSTEM_lock == 0)) __HALT(-9) + + +static void SYSTEM_InitHeap(); +void *SYSTEM__init(); + +void SYSTEM_INIT(argc, argvadr) + int argc; long argvadr; +{ + SYSTEM_mainfrm = argvadr; + SYSTEM_argc = argc; + SYSTEM_argv = *(long*)argvadr; + SYSTEM_InitHeap(); + SYSTEM_halt = -128; + SYSTEM__init(); +} + +void SYSTEM_FINI() +{ + SYSTEM_FINALL(); +} + +long SYSTEM_XCHK(i, ub) long i, ub; {return __X(i, ub);} +long SYSTEM_RCHK(i, ub) long i, ub; {return __R(i, ub);} +long SYSTEM_ASH(i, n) long i, n; {return __ASH(i, n);} +long SYSTEM_ABS(i) long i; {return __ABS(i);} +double SYSTEM_ABSD(i) double i; {return __ABS(i);} + +void SYSTEM_INHERIT(t, t0) + long *t, *t0; +{ + t -= __TPROC0OFF; + t0 -= __TPROC0OFF; + while (*t0 != __EOM) {*t = *t0; t--; t0--;} +} + +void SYSTEM_ENUMP(adr, n, P) + long *adr; + long n; + void (*P)(); +{ + while (n > 0) {P(*adr); adr++; n--;} +} + +void SYSTEM_ENUMR(adr, typ, size, n, P) + char *adr; + long *typ, size, n; + void (*P)(); +{ + long *t, off; + typ++; + while (n > 0) { + t = typ; + off = *t; + while (off >= 0) {P(*(long*)(adr+off)); t++; off = *t;} + adr += size; n--; + } +} + +long SYSTEM_DIV(x, y) + unsigned long x, y; +{ if ((long) x >= 0) return (x / y); + else return -((y - 1 - x) / y); +} + +long SYSTEM_MOD(x, y) + unsigned long x, y; +{ unsigned long m; + if ((long) x >= 0) return (x % y); + else { m = (-x) % y; + if (m != 0) return (y - m); else return 0; + } +} + +long SYSTEM_ENTIER(x) + double x; +{ + long y; + if (x >= 0) + return (long)x; + else { + y = (long)x; + if (y <= x) return y; else return y - 1; + } +} + +void SYSTEM_HALT(n) + int n; +{ + SYSTEM_halt = n; + if (SYSTEM_Halt!=0) SYSTEM_Halt(n); + exit(n); +} + +#ifdef __STDC__ +SYSTEM_PTR SYSTEM_NEWARR(long *typ, long elemsz, int elemalgn, int nofdim, int nofdyn, ...) +#else +SYSTEM_PTR SYSTEM_NEWARR(typ, elemsz, elemalgn, nofdim, nofdyn, va_alist) + long *typ, elemsz; + int elemalgn, nofdim, nofdyn; + va_dcl +#endif +{ + long nofelems, size, dataoff, n, nptr, *x, *p, nofptrs, i, *ptab, off; + va_list ap; +#ifdef __STDC__ + va_start(ap, nofdyn); +#else + va_start(ap); +#endif + nofelems = 1; + while (nofdim > 0) { + nofelems = nofelems * va_arg(ap, long); nofdim--; + if (nofelems <= 0) __HALT(-20); + } + va_end(ap); + dataoff = nofdyn * sizeof(long); + if (elemalgn > sizeof(long)) { + n = dataoff % elemalgn; + if (n != 0) dataoff += elemalgn - n; + } + size = dataoff + nofelems * elemsz; + Lock; + if (typ == NIL) { + /* element typ does not contain pointers */ + x = SYSTEM_NEWBLK(size); + } + else if (typ == POINTER__typ) { + /* element type is a pointer */ + x = SYSTEM_NEWBLK(size + nofelems * sizeof(long)); + p = (long*)x[-1]; + p[-nofelems] = *p; /* build new type desc in situ: 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ + p -= nofelems - 1; n = 1; /* n =1 for skipping the size field */ + while (n <= nofelems) {*p = n*sizeof(long); p++; n++;} + *p = - (nofelems + 1) * sizeof(long); /* sentinel */ + x[-1] -= nofelems * sizeof(long); + } + else { + /* element type is a record that contains pointers */ + ptab = typ + 1; nofptrs = 0; + while (ptab[nofptrs] >= 0) {nofptrs++;} /* number of pointers per element */ + nptr = nofelems * nofptrs; /* total number of pointers */ + x = SYSTEM_NEWBLK(size + nptr * sizeof(long)); + p = (long*)x[- 1]; + p[-nptr] = *p; /* build new type desc in situ; 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ + p -= nptr - 1; n = 0; off = dataoff; + while (n < nofelems) {i = 0; + while (i < nofptrs) {*p = off + ptab[i]; p++; i++;} + off += elemsz; n++; + } + *p = - (nptr + 1) * sizeof(long); /* sentinel */ + x[-1] -= nptr * sizeof(long); + } + if (nofdyn != 0) { + /* setup len vector for index checks */ +#ifdef __STDC__ + va_start(ap, nofdyn); +#else + va_start(ap); +#endif + p = x; + while (nofdyn > 0) {*p = va_arg(ap, long); p++, nofdyn--;} + va_end(ap); + } + Unlock; + return x; +} + +/* ----------- end of SYSTEM.co ------------- */ + diff --git a/src/lib/system/openbsd/gcc/x86_64/SYSTEM.h b/src/lib/system/openbsd/gcc/x86_64/SYSTEM.h new file mode 100644 index 00000000..2c8e71d0 --- /dev/null +++ b/src/lib/system/openbsd/gcc/x86_64/SYSTEM.h @@ -0,0 +1,238 @@ +#ifndef SYSTEM__h +#define SYSTEM__h + +/* + +voc (jet backend) runtime system interface and macros library +copyright (c) Josef Templ, 1995, 1996 + +gcc for Linux version (same as SPARC/Solaris2) +uses double # as concatenation operator + +*/ + +#include +#include /* for type sizes -- noch */ + +extern void *memcpy(void *dest, const void *src, unsigned long n); +extern void *malloc(unsigned long size); +extern void exit(int status); + +#define export +#define import extern + +/* constants */ +#define __MAXEXT 16 +#define NIL 0L +#define POINTER__typ (long*)1L /* not NIL and not a valid type */ + +/* basic types */ +//typedef char BOOLEAN; +#define BOOLEAN char +//typedef unsigned char CHAR; +#define CHAR unsigned char +//exactly two bytes +#define LONGCHAR unsigned short int +//typedef signed char SHORTINT; +#define SHORTINT signed char +//for x86 GNU/Linux +//typedef short int INTEGER; +//for x86_64 GNU/Linux +//typedef int INTEGER; +#define INTEGER int +//typedef long LONGINT; +#define LONGINT long +//typedef float REAL; +#define REAL float +//typedef double LONGREAL; +#define LONGREAL double +//typedef unsigned long SET; +#define SET unsigned long +typedef void *SYSTEM_PTR; +//#define *SYSTEM_PTR void +//typedef unsigned char SYSTEM_BYTE; +#define SYSTEM_BYTE unsigned char +typedef int8_t SYSTEM_INT8; +typedef int16_t SYSTEM_INT16; +typedef int32_t SYSTEM_INT32; +typedef int64_t SYSTEM_INT64; + +/* runtime system routines */ +extern long SYSTEM_DIV(); +extern long SYSTEM_MOD(); +extern long SYSTEM_ENTIER(); +extern long SYSTEM_ASH(); +extern long SYSTEM_ABS(); +extern long SYSTEM_XCHK(); +extern long SYSTEM_RCHK(); +extern double SYSTEM_ABSD(); +extern SYSTEM_PTR SYSTEM_NEWREC(); +extern SYSTEM_PTR SYSTEM_NEWBLK(); +#ifdef __STDC__ +extern SYSTEM_PTR SYSTEM_NEWARR(long*, long, int, int, int, ...); +#else +extern SYSTEM_PTR SYSTEM_NEWARR(); +#endif +extern SYSTEM_PTR SYSTEM_REGMOD(); +extern void SYSTEM_INCREF(); +extern void SYSTEM_REGCMD(); +extern void SYSTEM_REGTYP(); +extern void SYSTEM_REGFIN(); +extern void SYSTEM_FINALL(); +extern void SYSTEM_INIT(); +extern void SYSTEM_FINI(); +extern void SYSTEM_HALT(); +extern void SYSTEM_INHERIT(); +extern void SYSTEM_ENUMP(); +extern void SYSTEM_ENUMR(); + +/* module registry */ +#define __DEFMOD static void *m; if(m!=0)return m +#define __REGMOD(name, enum) if(m==0)m=SYSTEM_REGMOD((CHAR*)name,enum); else return m +#define __ENDMOD return m +#define __INIT(argc, argv) static void *m; SYSTEM_INIT(argc, (long)&argv); +#define __REGMAIN(name, enum) m=SYSTEM_REGMOD(name,enum) +#define __FINI SYSTEM_FINI(); return 0 +#define __IMPORT(name) SYSTEM_INCREF(name##__init()) +#define __REGCMD(name, cmd) SYSTEM_REGCMD(m, name, cmd) + +/* SYSTEM ops */ +#define __SYSNEW(p, len) p=SYSTEM_NEWBLK((long)(len)) +#define __VAL(t, x) (*(t*)&(x)) +#define __GET(a, x, t) x= *(t*)(a) +#define __PUT(a, x, t) *(t*)(a)=x +#define __LSHL(x, n, t) ((t)((unsigned t)(x)<<(n))) +#define __LSHR(x, n, t) ((t)((unsigned t)(x)>>(n))) +#define __LSH(x, n, t) ((n)>=0? __LSHL(x, n, t): __LSHR(x, -(n), t)) +#define __ROTL(x, n, t) ((t)((unsigned t)(x)<<(n)|(unsigned t)(x)>>(8*sizeof(t)-(n)))) +#define __ROTR(x, n, t) ((t)((unsigned t)(x)>>(n)|(unsigned t)(x)<<(8*sizeof(t)-(n)))) +#define __LSHR(x, n, t) ((t)((unsigned t)(x)>>(n))) +#define __LSH(x, n, t) ((n)>=0? __LSHL(x, n, t): __LSHR(x, -(n), t)) +#define __ROTL(x, n, t) ((t)((unsigned t)(x)<<(n)|(unsigned t)(x)>>(8*sizeof(t)-(n)))) +#define __ROTR(x, n, t) ((t)((unsigned t)(x)>>(n)|(unsigned t)(x)<<(8*sizeof(t)-(n)))) +#define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) +#define __BIT(x, n) (*(unsigned long*)(x)>>(n)&1) +#define __MOVE(s, d, n) memcpy((char*)(d),(char*)(s),n) + +/* std procs and operator mappings */ +#define __SHORT(x, y) ((int)((unsigned long)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) +#define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) +#define __CHR(x) ((CHAR)__R(x, 256)) +#define __CHRF(x) ((CHAR)__RF(x, 256)) +#define __DIV(x, y) ((x)>=0?(x)/(y):-(((y)-1-(x))/(y))) +#define __DIVF(x, y) SYSTEM_DIV((long)(x),(long)(y)) +#define __MOD(x, y) ((x)>=0?(x)%(y):__MODF(x,y)) +#define __MODF(x, y) SYSTEM_MOD((long)(x),(long)(y)) +#define __NEW(p, t) p=SYSTEM_NEWREC((long)t##__typ) +#define __NEWARR SYSTEM_NEWARR +#define __HALT(x) SYSTEM_HALT(x) +#define __ASSERT(cond, x) if (!(cond)) {SYSTEM_assert = x; SYSTEM_HALT(-1);} +#define __ENTIER(x) SYSTEM_ENTIER(x) +#define __ABS(x) (((x)<0)?-(x):(x)) +#define __ABSF(x) SYSTEM_ABS((long)(x)) +#define __ABSFD(x) SYSTEM_ABSD((double)(x)) +#define __CAP(ch) ((CHAR)((ch)&0x5f)) +#define __ODD(x) ((x)&1) +#define __IN(x, s) (((s)>>(x))&1) +#define __SETOF(x) ((SET)1<<(x)) +#define __SETRNG(l, h) ((~(SET)0<<(l))&~(SET)0>>(8*sizeof(SET)-1-(h))) +#define __MASK(x, m) ((x)&~(m)) +#define __COPY(s, d, n) {char*_a=(void*)s,*_b=(void*)d;long _i=0,_t=n-1;while(_i<_t&&((_b[_i]=_a[_i])!=0)){_i++;};_b[_i]=0;} +static int __STRCMP(x, y) + CHAR *x, *y; +{long i = 0; CHAR ch1, ch2; + do {ch1 = x[i]; ch2 = y[i]; i++; + if (!ch1) return -(int)ch2; + } while (ch1==ch2); + return (int)ch1 - (int)ch2; +} +#define __ASH(x, n) ((n)>=0?__ASHL(x,n):__ASHR(x,-(n))) +#define __ASHL(x, n) ((long)(x)<<(n)) +#define __ASHR(x, n) ((long)(x)>>(n)) +#define __ASHF(x, n) SYSTEM_ASH((long)(x), (long)(n)) +#define __DUP(x, l, t) x=(void*)memcpy(alloca(l*sizeof(t)),x,l*sizeof(t)) +#define __DUPARR(v, t) v=(void*)memcpy(v##__copy,v,sizeof(t)) +#define __DEL(x) /* DUP with alloca frees storage automatically */ +#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(long)typ##__typ) +#define __TYPEOF(p) (*(((long**)(p))-1)) +#define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) + +/* runtime checks */ +#define __X(i, ub) (((unsigned)(long)(i)<(unsigned long)(ub))?i:(__HALT(-2),0)) +#define __XF(i, ub) SYSTEM_XCHK((long)(i), (long)(ub)) +#define __RETCHK __retchk: __HALT(-3) +#define __CASECHK __HALT(-4) +#define __GUARDP(p, typ, level) ((typ*)(__ISP(p,typ,level)?p:(__HALT(-5),p))) +#define __GUARDR(r, typ, level) (*((typ*)(__IS(r##__typ,typ,level)?r:(__HALT(-5),r)))) +#define __GUARDA(p, typ, level) ((struct typ*)(__IS(__TYPEOF(p),typ,level)?p:(__HALT(-5),p))) +#define __GUARDEQR(p, dyntyp, typ) if(dyntyp!=typ##__typ) __HALT(-6);*(p) +#define __GUARDEQP(p, typ) if(__TYPEOF(p)!=typ##__typ)__HALT(-6);*(p) +#define __WITHCHK __HALT(-7) +#define __R(i, ub) (((unsigned)(long)(i)<(unsigned long)(ub))?i:(__HALT(-8),0)) +#define __RF(i, ub) SYSTEM_RCHK((long)(i),(long)(ub)) + +/* record type descriptors */ +#define __TDESC(t, m, n) \ + static struct t##__desc {\ + long tproc[m]; \ + long tag, next, level, module; \ + char name[24]; \ + long *base[__MAXEXT]; \ + char *rsrvd; \ + long blksz, ptr[n+1]; \ + } t##__desc + +#define __BASEOFF (__MAXEXT+1) +#define __TPROC0OFF (__BASEOFF+24/sizeof(long)+5) +#define __EOM 1 +#define __TDFLDS(name, size) {__EOM}, 1, 0, 0, 0, name, {0}, 0, size +#define __ENUMP(adr, n, P) SYSTEM_ENUMP(adr, (long)(n), P) +#define __ENUMR(adr, typ, size, n, P) SYSTEM_ENUMR(adr, typ, (long)(size), (long)(n), P) + +#define __INITYP(t, t0, level) \ + t##__typ= &t##__desc.blksz; \ + memcpy(t##__desc.base, t0##__typ - __BASEOFF, level*sizeof(long)); \ + t##__desc.base[level]=t##__typ; \ + t##__desc.module=(long)m; \ + if(t##__desc.blksz!=sizeof(struct t)) __HALT(-15); \ + t##__desc.blksz=(t##__desc.blksz+5*sizeof(long)-1)/(4*sizeof(long))*(4*sizeof(long)); \ + SYSTEM_REGTYP(m, (long)&t##__desc.next); \ + SYSTEM_INHERIT(t##__typ, t0##__typ) + +/* Oberon-2 type bound procedures support */ +#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(long)proc +#define __SEND(typ, num, funtyp, parlist) ((funtyp)(*(typ-(__TPROC0OFF+num))))parlist + +/* runtime system variables */ +extern LONGINT SYSTEM_argc; +extern LONGINT SYSTEM_argv; +extern void (*SYSTEM_Halt)(); +extern LONGINT SYSTEM_halt; +extern LONGINT SYSTEM_assert; +extern SYSTEM_PTR SYSTEM_modules; +extern LONGINT SYSTEM_heapsize; +extern LONGINT SYSTEM_allocated; +extern LONGINT SYSTEM_lock; +extern SHORTINT SYSTEM_gclock; +extern BOOLEAN SYSTEM_interrupted; + +/* ANSI prototypes; not used so far +static int __STRCMP(CHAR *x, CHAR *y); +void SYSTEM_INIT(int argc, long argvadr); +void SYSTEM_FINI(void); +long SYSTEM_XCHK(long i, long ub); +long SYSTEM_RCHK(long i, long ub); +long SYSTEM_ASH(long i, long n); +long SYSTEM_ABS(long i); +double SYSTEM_ABSD(double i); +void SYSTEM_INHERIT(long *t, long *t0); +void SYSTEM_ENUMP(long *adr, long n, void (*P)(void*)); +void SYSTEM_ENUMR(char *adr, long *typ, long size, long n, void (*P)(void*)); +long SYSTEM_DIV(unsigned long x, unsigned long y); +long SYSTEM_MOD(unsigned long x, unsigned long y); +long SYSTEM_ENTIER(double x); +void SYSTEM_HALT(int n); +*/ + +#endif + diff --git a/src/lib/system/openbsd/gcc/x86_64/Unix.Mod b/src/lib/system/openbsd/gcc/x86_64/Unix.Mod new file mode 100644 index 00000000..d119a4b8 --- /dev/null +++ b/src/lib/system/openbsd/gcc/x86_64/Unix.Mod @@ -0,0 +1,519 @@ +MODULE Unix; (* Josef Templ, 5.3.90 Linux system calls *) +(* ported to gnu x86_64 and added system(), sleep() functions, noch *) +(* Module Unix provides a system call interface to Linux. + Naming conventions: + Procedure and Type-names always start with a capital letter. + error numbers as defined in Unix + other constants start with lower case letters *) + +IMPORT SYSTEM; + +CONST + +(* various important constants *) + + stdin* = 0; stdout* =1; stderr* = 2; + + LOCKEX* = 2; LOCKUN* = 8; (* /usr/include/file.h *) + AFINET* = 2; (* /usr/include/sys/socket.h *) + PFINET* = AFINET; (* /usr/include/linux/socket.h *) + SOCKSTREAM* = 1; (* /usr/include/linux/socket.h *) + FIONREAD* = 541BH; (* in /usr/include/asm/termios.h *) + SETFL* = 4; (* set file descriptor flags; in asm/fcntl.h *) + TCP* = 0; + +(* flag sets, cf. /usr/include/asm/fcntl.h *) + rdonly* = {}; wronly* = {0}; rdwr* = {1}; creat* = {6}; excl* = {7}; trunc* = {9}; append* = {10}; ndelay = {11}; + +(* error numbers *) + + EPERM* = 1; (* Not owner *) + ENOENT* = 2; (* No such file or directory *) + ESRCH* = 3; (* No such process *) + EINTR* = 4; (* Interrupted system call *) + EIO* = 5; (* I/O error *) + ENXIO* = 6; (* No such device or address *) + E2BIG* = 7; (* Arg list too long *) + ENOEXEC* = 8; (* Exec format error *) + EBADF* = 9; (* Bad file number *) + ECHILD* = 10; (* No children *) + EAGAIN* = 11; (* No more processes *) + ENOMEM* = 12; (* Not enough core *) + EACCES* = 13; (* Permission denied *) + EFAULT* = 14; (* Bad address *) + ENOTBLK* = 15; (* Block device required *) + EBUSY* = 16; (* Mount device busy *) + EEXIST* = 17; (* File exists *) + EXDEV* = 18; (* Cross-device link *) + ENODEV* = 19; (* No such device *) + ENOTDIR* = 20; (* Not a directory*) + EISDIR* = 21; (* Is a directory *) + EINVAL* = 22; (* Invalid argument *) + ENFILE* = 23; (* File table overflow *) + EMFILE* = 24; (* Too many open files *) + ENOTTY* = 25; (* Not a typewriter *) + ETXTBSY* = 26; (* Text file busy *) + EFBIG* = 27; (* File too large *) + ENOSPC* = 28; (* No space left on device *) + ESPIPE* = 29; (* Illegal seek *) + EROFS* = 30; (* Read-only file system *) + EMLINK* = 31; (* Too many links *) + EPIPE* = 32; (* Broken pipe *) + EDOM* = 33; (* Argument too large *) + ERANGE* = 34; (* Result too large *) + EDEADLK* = 35; (* Resource deadlock would occur *) + ENAMETOOLONG* = 36; (* File name too long *) + ENOLCK* = 37; (* No record locks available *) + ENOSYS* = 38; (* Function not implemented *) + ENOTEMPTY* = 39; (* Directory not empty *) + ELOOP* = 40; (* Too many symbolic links encountered *) + EWOULDBLOCK* = EAGAIN; (* Operation would block *) + ENOMSG* = 42; (* No message of desired type *) + EIDRM* = 43; (* Identifier removed *) + ECHRNG* = 44; (* Channel number out of range *) + EL2NSYNC* = 45; (* Level 2 not synchronized *) + EL3HLT* = 46; (* Level 3 halted *) + EL3RST* = 47; (* Level 3 reset *) + ELNRNG* = 48; (* Link number out of range *) + EUNATCH* = 49; (* Protocol driver not attached *) + ENOCSI* = 50; (* No CSI structure available *) + EL2HLT* = 51; (* Level 2 halted *) + EBADE* = 52; (* Invalid exchange *) + EBADR* = 53; (* Invalid request descriptor *) + EXFULL* = 54; (* Exchange full *) + ENOANO* = 55; (* No anode *) + EBADRQC* = 56; (* Invalid request code *) + EBADSLT* = 57; (* Invalid slot *) + EDEADLOCK* = 58; (* File locking deadlock error *) + EBFONT* = 59; (* Bad font file format *) + ENOSTR* = 60; (* Device not a stream *) + ENODATA* = 61; (* No data available *) + ETIME* = 62; (* Timer expired *) + ENOSR* = 63; (* Out of streams resources *) + ENONET* = 64; (* Machine is not on the network *) + ENOPKG* = 65; (* Package not installed *) + EREMOTE* = 66; (* Object is remote *) + ENOLINK* = 67; (* Link has been severed *) + EADV* = 68; (* Advertise error *) + ESRMNT* = 69; (* Srmount error *) + ECOMM* = 70; (* Communication error on send *) + EPROTO* = 71; (* Protocol error *) + EMULTIHOP* = 72; (* Multihop attempted *) + EDOTDOT* = 73; (* RFS specific error *) + EBADMSG* = 74; (* Not a data message *) + EOVERFLOW* = 75; (* Value too large for defined data type *) + ENOTUNIQ* = 76; (* Name not unique on network *) + EBADFD* = 77; (* File descriptor in bad state *) + EREMCHG* = 78; (* Remote address changed *) + ELIBACC* = 79; (* Can not access a needed shared library *) + ELIBBAD* = 80; (* Accessing a corrupted shared library *) + ELIBSCN* = 81; (* .lib section in a.out corrupted *) + ELIBMAX* = 82; (* Attempting to link in too many shared libraries *) + ELIBEXEC* = 83; (* Cannot exec a shared library directly *) + EILSEQ* = 84; (* Illegal byte sequence *) + ERESTART* = 85; (* Interrupted system call should be restarted *) + ESTRPIPE* = 86; (* Streams pipe error *) + EUSERS* = 87; (* Too many users *) + ENOTSOCK* = 88; (* Socket operation on non-socket *) + EDESTADDRREQ* = 89; (* Destination address required *) + EMSGSIZE* = 90; (* Message too long *) + EPROTOTYPE* = 91; (* Protocol wrong type for socket *) + ENOPROTOOPT* = 92; (* Protocol not available *) + EPROTONOSUPPORT* = 93; (* Protocol not supported *) + ESOCKTNOSUPPORT* = 94; (* Socket type not supported *) + EOPNOTSUPP* = 95; (* Operation not supported on transport endpoint *) + EPFNOSUPPORT* = 96; (* Protocol family not supported *) + EAFNOSUPPORT* = 97; (* Address family not supported by protocol *) + EADDRINUSE* = 98; (* Address already in use *) + EADDRNOTAVAIL* = 99; (* Cannot assign requested address *) + ENETDOWN* = 100; (* Network is down *) + ENETUNREACH* = 101; (* Network is unreachable *) + ENETRESET* = 102; (* Network dropped connection because of reset *) + ECONNABORTED* = 103; (* Software caused connection abort *) + ECONNRESET* = 104; (* Connection reset by peer *) + ENOBUFS* = 105; (* No buffer space available *) + EISCONN* = 106; (* Transport endpoint is already connected *) + ENOTCONN* = 107; (* Transport endpoint is not connected *) + ESHUTDOWN* = 108; (* Cannot send after transport endpoint shutdown *) + ETOOMANYREFS* = 109; (* Too many references: cannot splice *) + ETIMEDOUT* = 110; (* Connection timed out *) + ECONNREFUSED* = 111; (* Connection refused *) + EHOSTDOWN* = 112; (* Host is down *) + EHOSTUNREACH* = 113; (* No route to host *) + EALREADY* = 114; (* Operation already in progress *) + EINPROGRESS* = 115; (* Operation now in progress *) + ESTALE* = 116; (* Stale NFS file handle *) + EUCLEAN* = 117; (* Structure needs cleaning *) + ENOTNAM* = 118; (* Not a XENIX named type file *) + ENAVAIL* = 119; (* No XENIX semaphores available *) + EISNAM* = 120; (* Is a named type file *) + EREMOTEIO* = 121; (* Remote I/O error *) + EDQUOT* = 122; (* Quota exceeded *) + +CONST sigsetarrlength = 1024 / 8 * SIZE(LONGINT); + + +TYPE + (* cpp /usr/include/setjmp.h + struct __jmp_buf_tag + { + __jmp_buf __jmpbuf; + int __mask_was_saved; + __sigset_t __saved_mask; + }; + + typedef struct __jmp_buf_tag jmp_buf[1]; + + __sigset_t is 128 byte long in glibc on arm, x86, x86_64 + __jmp_buf is 24 bytes long in glibc on x86 + 256 bytes long in glibc on armv6 + 64 bytes long in glibc on x86_64 + + *) + JmpBuf* = RECORD + jmpbuf: ARRAY 8 OF LONGINT; (* 8 * 8 = 64 *) + maskWasSaved*: INTEGER; + savedMask*: ARRAY 16 OF LONGINT; (* 16 * 8 = 128 *) + END ; + + Status* = RECORD (* struct stat *) + mode* : INTEGER; + dev* : INTEGER; (* dev_t 4 *) + ino* : LONGINT; (* ino 8 *) + nlink* : INTEGER; + uid*, gid*: INTEGER; + rdev* : INTEGER; + atime* : LONGINT; + atimences* : LONGINT; + mtime* : LONGINT; + mtimensec* : LONGINT; + ctime* : LONGINT; + ctimensec* : LONGINT; + size* : LONGINT; + blocks* : LONGINT; + blksize* : INTEGER; + unused0*, unused1*: INTEGER; + unused2*, unused3*: LONGINT; + END ; + +(* from /usr/include/bits/time.h + +struct timeval + { + __time_t tv_sec; /* Seconds. */ //__time_t 8 + __suseconds_t tv_usec; /* Microseconds. */ __suseconds_t 8 + }; + + +*) + + Timeval* = RECORD + sec*, usec*: LONGINT + END ; + + +(* +from man gettimeofday + + struct timezone { + int tz_minuteswest; /* minutes west of Greenwich */ int 4 + int tz_dsttime; /* type of DST correction */ int 4 + }; +*) + + + Timezone* = RECORD + (*minuteswest*, dsttime*: LONGINT*) + minuteswest*, dsttime*: INTEGER + END ; + + Itimerval* = RECORD + interval*, value*: Timeval + END ; + + FdSet* = ARRAY 8 OF SET; + + SigCtxPtr* = POINTER TO SigContext; + SigContext* = RECORD + END ; + + SignalHandler* = PROCEDURE (sig, code: LONGINT; scp: SigCtxPtr); + + Dirent* = RECORD + ino, off: LONGINT; + reclen: INTEGER; + name: ARRAY 256 OF CHAR; + END ; + + Rusage* = RECORD + utime*, stime*: Timeval; + maxrss*, ixrss*, idrss*, isrss*, + minflt*, majflt*, nswap*, inblock*, + oublock*, msgsnd*, msgrcv*, nsignals*, + nvcsw*, nivcsw*: LONGINT + END ; + + Iovec* = RECORD + base*, len*: LONGINT + END ; + + SocketPair* = ARRAY 2 OF LONGINT; + + Pollfd* = RECORD + fd*: LONGINT; + events*, revents*: INTEGER + END ; + + Sockaddr* = RECORD + family0*, family1*: SHORTINT; + pad0, pad1: SHORTINT; + pad2 : INTEGER; + (*port*: INTEGER; + internetAddr*: LONGINT;*) + pad*: ARRAY 14 OF CHAR; + END ; + + HostEntry* = POINTER [1] TO Hostent; + Hostent* = RECORD + name*, aliases*: LONGINT; + addrtype*, length*: INTEGER; + addrlist*: LONGINT; (*POINTER TO POINTER TO LONGINT, network byte order*) + END; + + Name* = ARRAY OF CHAR; + + PROCEDURE -includeStat() + "#include "; + + PROCEDURE -includeErrno() + "#include "; + + (* for read(), write() and sleep() *) + PROCEDURE -includeUnistd() + "#include "; + + (* for system() *) + PROCEDURE -includeStdlib() + "#include "; + + (* for nanosleep() *) + PROCEDURE -includeTime() + "#include "; + + (* for select() *) + PROCEDURE -includeSelect() + "#include "; + + PROCEDURE -err(): INTEGER + "errno"; + + PROCEDURE errno*(): INTEGER; + BEGIN + RETURN err() + END errno; + + PROCEDURE -Exit*(n: INTEGER) + "exit(n)"; + + PROCEDURE -Fork*(): INTEGER + "fork()"; + + PROCEDURE -Wait*(VAR status: INTEGER): INTEGER + "wait(status)"; + + PROCEDURE -Select*(width: INTEGER; VAR readfds, writefds, exceptfds: FdSet; VAR timeout: Timeval): INTEGER + "select(width, readfds, writefds, exceptfds, timeout)"; + + PROCEDURE -Gettimeofday* (VAR tv: Timeval; VAR tz: Timezone) : INTEGER + "gettimeofday(tv, tz)"; + + PROCEDURE -Read* (fd: INTEGER; buf, nbyte: LONGINT): LONGINT + "read(fd, buf, nbyte)"; + + PROCEDURE -ReadBlk* (fd: INTEGER; VAR buf: ARRAY OF SYSTEM.BYTE): LONGINT + "read(fd, buf, buf__len)"; + + PROCEDURE -Write* (fd: INTEGER; buf, nbyte: LONGINT): LONGINT + "write(fd, buf, nbyte)"; + + PROCEDURE -WriteBlk* (fd: INTEGER; VAR buf: ARRAY OF SYSTEM.BYTE): LONGINT + "write(fd, buf, buf__len)"; + + PROCEDURE -Dup*(fd: INTEGER): INTEGER + "dup(fd)"; + + PROCEDURE -Dup2*(fd1, fd2: INTEGER): INTEGER + "dup(fd1, fd2)"; + + PROCEDURE -Pipe*(fds : LONGINT): INTEGER + "pipe(fds)"; + + PROCEDURE -Getpid*(): INTEGER + "getpid()"; + + PROCEDURE -Getuid*(): INTEGER + "getuid()"; + + PROCEDURE -Geteuid*(): INTEGER + "geteuid()"; + + PROCEDURE -Getgid*(): INTEGER + "getgid()"; + + PROCEDURE -Getegid*(): INTEGER + "getegid()"; + + PROCEDURE -Unlink*(name: Name): INTEGER + "unlink(name)"; + + PROCEDURE -Open*(name: Name; flag: INTEGER; mode: LONGINT): INTEGER + "open(name, flag, mode)"; + + PROCEDURE -Close*(fd: INTEGER): INTEGER + "close(fd)"; + + PROCEDURE -stat(name: Name; VAR statbuf: Status): INTEGER + "stat((const char*)name, (struct stat*)statbuf)"; + + PROCEDURE Stat*(name: Name; VAR statbuf: Status): INTEGER; + VAR res: INTEGER; + BEGIN + res := stat(name, statbuf); + (* make the first 4 bytes as unique as possible (used in module Files for caching!) *) + (* don't understand this + INC(statbuf.dev, statbuf.devX); + INC(statbuf.rdev, statbuf.rdevX); *) + RETURN res; + END Stat; + + PROCEDURE -fstat(fd: INTEGER; VAR statbuf: Status): INTEGER + "fstat(fd, (struct stat*)statbuf)"; + + PROCEDURE Fstat*(fd: INTEGER; VAR statbuf: Status): INTEGER; + VAR res: INTEGER; + BEGIN + res := fstat(fd, statbuf); + (* make the first 4 bytes as unique as possible (used in module Files for caching!) *) + (*INC(statbuf.dev, statbuf.devX); + INC(statbuf.rdev, statbuf.rdevX); *) + RETURN res; + END Fstat; + + PROCEDURE -Fchmod*(fd, mode: INTEGER): INTEGER + "fchmod(fd, mode)"; + + PROCEDURE -Chmod*(path: Name; mode: INTEGER): INTEGER + "chmod(path, mode)"; + + PROCEDURE -Lseek*(fd: INTEGER; offset: LONGINT; origin: INTEGER): LONGINT + "lseek(fd, offset, origin)"; + + PROCEDURE -Fsync*(fd: INTEGER): INTEGER + "fsync(fd)"; + + PROCEDURE -Fcntl*(fd: INTEGER; cmd: INTEGER; arg: LONGINT ): INTEGER + "fcntl(fd, cmd, arg)"; + + PROCEDURE -Flock*(fd, operation: INTEGER): INTEGER + "flock(fd, operation)"; + + PROCEDURE -Ftruncate*(fd: INTEGER; length: LONGINT): INTEGER + "ftruncate(fd, length)"; + + PROCEDURE -Readblk*(fd: INTEGER; VAR buf: ARRAY OF SYSTEM.BYTE; len: LONGINT): LONGINT + "read(fd, buf, len)"; + + PROCEDURE -Rename*(old, new: Name): INTEGER + "rename(old, new)"; + + PROCEDURE -Chdir*(path: Name): INTEGER + "chdir(path)"; + + PROCEDURE -Ioctl*(fd: INTEGER; request, arg: LONGINT): INTEGER + "ioctl(fd, request, arg)"; + + PROCEDURE -Kill*(pid, sig: INTEGER): INTEGER + "kill(pid, sig)"; + + PROCEDURE -Sigsetmask*(mask: INTEGER): INTEGER + "sigsetmask(mask)"; + + PROCEDURE -Sleep*(ms : INTEGER): INTEGER + "(INTEGER)sleep(ms)"; + + PROCEDURE -Nanosleep*(VAR req : Timeval; VAR rem : Timeval): INTEGER + "(INTEGER)nanosleep(req, rem)"; + + (* TCP/IP networking *) + + PROCEDURE -Gethostbyname*(name: Name): HostEntry + "(Unix_HostEntry)gethostbyname(name)"; + + PROCEDURE -Gethostname*(VAR name: Name): INTEGER + "gethostname(name, name__len)"; + + PROCEDURE -Socket*(af, type, protocol: INTEGER): INTEGER + "socket(af, type, protocol)"; + + PROCEDURE -Connect*(socket: INTEGER; name: Sockaddr; namelen: INTEGER): INTEGER + "connect(socket, &(name), namelen)"; + + PROCEDURE -Getsockname*(socket: INTEGER; VAR name: Sockaddr; VAR namelen: INTEGER): INTEGER + "getsockname(socket, name, namelen)"; + + PROCEDURE -Bind*(socket: INTEGER; name: Sockaddr; namelen: INTEGER): INTEGER + "bind(socket, &(name), namelen)"; + + PROCEDURE -Listen*(socket, backlog: INTEGER): INTEGER + "listen(socket, backlog)"; + + PROCEDURE -Accept*(socket: INTEGER; VAR addr: Sockaddr; VAR addrlen: INTEGER): LONGINT + "accept(socket, addr, addrlen)"; + + PROCEDURE -Recv*(socket: INTEGER; bufadr, buflen: LONGINT; flags: INTEGER): LONGINT + "recv(socket, bufadr, buflen, flags)"; + + PROCEDURE -Send*(socket: INTEGER; bufadr, buflen: LONGINT; flags: INTEGER): LONGINT + "send(socket, bufadr, buflen, flags)"; + + PROCEDURE -sys(str: ARRAY OF CHAR): INTEGER (* need this to call external tools like gcc or gas; noch *) + "system(str)"; + + PROCEDURE system*(cmd : ARRAY OF CHAR); + VAR r : INTEGER; + BEGIN + r := sys(cmd); + END system; + + PROCEDURE System*(cmd : ARRAY OF CHAR): INTEGER; + VAR r : INTEGER; + BEGIN + r := sys(cmd); + RETURN r + END System; + + PROCEDURE -SizeofUnixStat(): INTEGER + "sizeof(Unix_Status)"; + + PROCEDURE -SizeofStat(): INTEGER + "sizeof(struct stat)"; + + PROCEDURE -Error(msg: ARRAY OF CHAR; len: INTEGER) + "write(1/*stdout*/, msg, len); char ch = 0xa; write(1, &ch, 1)"; + + PROCEDURE StatCheck; + VAR x, y: LONGINT; + BEGIN + x := SizeofUnixStat(); + y := SizeofStat(); + IF x # y THEN + Error("Unix.StatCheck: inconsistent usage of struct stat", 49); + Exit(1); + END + END StatCheck; + +BEGIN + + StatCheck(); + +END Unix. diff --git a/src/voc/openbsd/gcc/extTools.Mod b/src/voc/openbsd/gcc/extTools.Mod new file mode 100644 index 00000000..30790878 --- /dev/null +++ b/src/voc/openbsd/gcc/extTools.Mod @@ -0,0 +1,88 @@ +MODULE extTools; + IMPORT Args, Unix, Strings, Console, version; +(* +INCLUDEPATH = -Isrc/lib/system/gnuc/x86_64 +CCOPT = -fPIC $(INCLUDEPATH) -g +CLOBERONOPTS = -fPIC $(INCLUDEPATH) -L. -L/usr/lib -lOberon -static -g +CC = cc $(CCOPT) -c +*) +CONST compiler="gcc"; + +VAR incPath0, incPath1, ccOpt, ccString, CFLAGS, tmp0, tmp1 : ARRAY 1023 OF CHAR; + +PROCEDURE Assemble*(m : ARRAY OF CHAR); +VAR cmd : ARRAY 1023 OF CHAR; +cc : ARRAY 1023 OF CHAR; +ext : ARRAY 5 OF CHAR; +BEGIN +COPY (ccString, cc); +Strings.Append (" -c ", cc); +COPY(cc, cmd); +Strings.Append (" ", cmd); +Strings.Append (ccOpt, cmd); +ext := ".c"; +Strings.Append (ext, m); +Strings.Append(m, cmd); +(*Console.Ln; Console.String (cmd); Console.Ln;*) +Unix.system(cmd); +END Assemble; + + +PROCEDURE LinkMain*(VAR m : ARRAY OF CHAR; statically : BOOLEAN; additionalopts : ARRAY OF CHAR); +VAR lpath : ARRAY 1023 OF CHAR; +cc : ARRAY 1023 OF CHAR; +ccopt : ARRAY 1023 OF CHAR; +cmd : ARRAY 1023 OF CHAR; +ext : ARRAY 5 OF CHAR; +BEGIN +(* +gcc -g -o hello hello.c -I $RPATH/src/lib/system/gnuc/x86_64 -I. -I$RPATH -lOberon -L. -L$RPATH -static +*) +cmd := ""; +cc := ""; +ext := ".c"; +COPY(ccString, cc); +COPY (cc, cmd); +Strings.Append(" ", cmd); +Strings.Append(m, cmd); +Strings.Append(ext, cmd); +Strings.Append(additionalopts, cmd); +IF statically THEN Strings.Append(" -static ", cmd) END; +Strings.Append(" -o ", cmd); +Strings.Append(m, cmd); +Strings.Append(" ", cmd); + +Strings.Append (" -lVishapOberon -L. -L", ccOpt); +Strings.Append (version.prefix, ccOpt); +Strings.Append ("/lib ", ccOpt); + +Strings.Append(ccOpt, cmd); +Console.Ln; Console.String(cmd); Console.Ln; (* may be it's feasible to add debug mode later *) +Unix.system(cmd); +END LinkMain; + +BEGIN + +incPath0 := "src/lib/system/linux/"; +Strings.Append (compiler, incPath0); +incPath1 := "lib/voc/obj "; +ccOpt := " -fPIC -g "; + +COPY ("-I ", tmp1); +Strings.Append (version.prefix, tmp1); +Strings.Append("/", tmp1); +Strings.Append(incPath0, tmp1); +Strings.Append("/", tmp1); +Strings.Append(version.arch, tmp1); +Strings.Append(" -I ", tmp1); +Strings.Append(version.prefix, tmp1); +Strings.Append("/", tmp1); +Strings.Append(incPath1, tmp1); +Strings.Append(tmp1, ccOpt); +Args.GetEnv("CFLAGS", CFLAGS); +Strings.Append (CFLAGS, ccOpt); +Strings.Append (" ", ccOpt); +ccString := compiler; +Strings.Append (" ", ccString); + +END extTools. diff --git a/src/voc/openbsd/gcc/x86_64/architecture.Mod b/src/voc/openbsd/gcc/x86_64/architecture.Mod new file mode 100644 index 00000000..1f95d2fd --- /dev/null +++ b/src/voc/openbsd/gcc/x86_64/architecture.Mod @@ -0,0 +1,4 @@ +MODULE architecture; +CONST arch* = "x86_64"; + +END architecture. From 4bebc891a4d0d1184d74134908bdc1a91e3ad5be Mon Sep 17 00:00:00 2001 From: Antranig Vartanian Date: Sun, 6 Dec 2015 21:27:13 +0400 Subject: [PATCH 026/580] updated Unix.Mod for OpenBSD -- antranigv Former-commit-id: c3a5559aab52586ad690f9743125cf86a3566419 --- src/lib/system/openbsd/gcc/x86_64/Unix.Mod | 30 ++++++++++++++-------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/src/lib/system/openbsd/gcc/x86_64/Unix.Mod b/src/lib/system/openbsd/gcc/x86_64/Unix.Mod index d119a4b8..c0abebec 100644 --- a/src/lib/system/openbsd/gcc/x86_64/Unix.Mod +++ b/src/lib/system/openbsd/gcc/x86_64/Unix.Mod @@ -171,9 +171,7 @@ TYPE *) JmpBuf* = RECORD - jmpbuf: ARRAY 8 OF LONGINT; (* 8 * 8 = 64 *) - maskWasSaved*: INTEGER; - savedMask*: ARRAY 16 OF LONGINT; (* 16 * 8 = 128 *) + jmpbuf: ARRAY 11 OF LONGINT; (* 8 * 8 = 64 *) END ; Status* = RECORD (* struct stat *) @@ -206,7 +204,7 @@ struct timeval *) - +(* from sys/time.h on OpenBSD *) Timeval* = RECORD sec*, usec*: LONGINT END ; @@ -239,12 +237,16 @@ from man gettimeofday SignalHandler* = PROCEDURE (sig, code: LONGINT; scp: SigCtxPtr); +(* From sys/dirent.h on OpenBSD 5.6 *) Dirent* = RECORD ino, off: LONGINT; - reclen: INTEGER; - name: ARRAY 256 OF CHAR; + reclen: ARRAY 2 OF CHAR; + type, namlen : CHAR; + padding : ARRAY 4 OF CHAR; + name : ARRAY 256 OF CHAR; END ; +(* from sys/resource.h on OpenBSD *) Rusage* = RECORD utime*, stime*: Timeval; maxrss*, ixrss*, idrss*, isrss*, @@ -253,26 +255,34 @@ from man gettimeofday nvcsw*, nivcsw*: LONGINT END ; +(* from sys/uio.h on OpenBSD 5.6 -- antranigv*) Iovec* = RECORD base*, len*: LONGINT END ; +(* TOBEDONE *) SocketPair* = ARRAY 2 OF LONGINT; +(* from sys/poll.h on OpenBSD 5.6 -- antranigv *) Pollfd* = RECORD - fd*: LONGINT; - events*, revents*: INTEGER + fd*: INTEGER; + events*, revents*: ARRAY 2 OF CHAR; END ; +(* different from linux, written new for OpenBSD from sys/socket.h -- antranigv *) Sockaddr* = RECORD - family0*, family1*: SHORTINT; + (*family0*, family1*: SHORTINT; pad0, pad1: SHORTINT; pad2 : INTEGER; (*port*: INTEGER; internetAddr*: LONGINT;*) - pad*: ARRAY 14 OF CHAR; + pad*: ARRAY 14 OF CHAR;*) + len* : CHAR; + family* : CHAR; + data* : ARRAY 14 OF CHAR; END ; + (* identical to linux. OpenBSD 5.6 -- antranigv *) HostEntry* = POINTER [1] TO Hostent; Hostent* = RECORD name*, aliases*: LONGINT; From 10eecb8a2eb7e522765baae1e6392ba4d681134f Mon Sep 17 00:00:00 2001 From: Antranig Vartanian Date: Sun, 6 Dec 2015 21:38:43 +0400 Subject: [PATCH 027/580] changes AND makefile for OpenBSD -- antranigv Former-commit-id: 3ceda03627469131ef92c9e8b0098d0c49adeaa4 --- makefile.openbsd.gcc.x86_64 | 309 ++++++++++++++++++ src/lib/ooc/openbsd/clang/x86_64/oocC.Mod | 71 ++++ src/lib/ooc2/openbsd/clang/oocwrapperlibc.Mod | 34 ++ 3 files changed, 414 insertions(+) create mode 100644 makefile.openbsd.gcc.x86_64 create mode 100644 src/lib/ooc/openbsd/clang/x86_64/oocC.Mod create mode 100644 src/lib/ooc2/openbsd/clang/oocwrapperlibc.Mod diff --git a/makefile.openbsd.gcc.x86_64 b/makefile.openbsd.gcc.x86_64 new file mode 100644 index 00000000..c44bc033 --- /dev/null +++ b/makefile.openbsd.gcc.x86_64 @@ -0,0 +1,309 @@ +#SHELL := /bin/bash +BUILDID=$(shell date +%Y/%m/%d) +TOS = openbsd +TARCH = x86_64 +#TARCH = x86 x86_64 armv6j armv6j_hardfp armv7a_hardfp powerpc +CCOMP = gcc +RELEASE = 1.1 + + +INCLUDEPATH = -Isrc/lib/system/$(TOS)/$(CCOMP)/$(TARCH) + +SETPATH = CFLAGS=$(INCLUDEPATH) PATH=.:/bin:/usr/bin MODULES=.:src/lib:src/lib/v4:src/lib/v4/$(TARCH):src/lib/v4_compat:src/lib/system/$(TOS)/$(CCOMP):src/lib/system/$(TOS)/$(CCOMP)/$(TARCH):src/lib/ulm:src/lib/ulm/$(TARCH):src/lib/ooc2:src/lib/ooc2/$(TOS)/$(CCOMP):src/lib/ooc:src/lib/ooc/$(TOS)/$(CCOMP)/$(TARCH):src/lib/pow:src/lib/misc:src/lib/s3:src/lib/s3/$(TARCH):src/voc:src/voc/$(TOS)/$(CCOMP):src/voc/$(TOS)/$(CCOMP)/$(TARCH):src/tools/ocat:src/tools/browser:src/tools/vocparam:src/tools/vmake:src/tools/coco:src/test + +VOC = voc +VERSION = $(TOS).$(CCOMP).$(TARCH) +VOCSTATIC0 = $(SETPATH) ./vocstatic.$(TOS).$(CCOMP).$(TARCH) +VOCSTATIC = $(SETPATH) ./voc +VOCPARAM = $(shell ./vocparam > voc.par) +LIBNAME = VishapOberon +LIBRARY = lib$(LIBNAME) + +ifndef PRF +PRF = "/opt" +endif +PREFIX = $(PRF)/voc-$(RELEASE) +PREFIXLN = $(PRF)/voc + +CCOPT = -fPIC $(INCLUDEPATH) -g +SHRLIBEXT = so +CC = $(CCOMP) $(CCOPT) -c +CL = $(CCOMP) $(CCOPT) +LD = $(CCOMP) -shared -o $(LIBRARY).$(SHRLIBEXT) +# s is necessary to create index inside a archive +ARCHIVE = ar rcs $(LIBRARY).a + +#%.c: %.Mod +#%.o: %.c +# $(CC) $(input) + +all: stage2 stage3 stage4 stage5 stage6 stage7 + +# when porting to new platform: +# * put corresponding .par file into current directory. it can be generated on the target platform by compiling vocparam (stage0) and running (stage1) +# * run make port0 - this will generate C source files for the target architecture +# * move the source tree to the target machine, and compile (or compile here via crosscompiler) (port1) +port0: stage2 stage3 stage4 + +# now compile C source files for voc, showdef and ocat on target machine (or by using crosscompiler) +port1: stage5 +# after you have "voc" compiled for target architecture. replace vocstatic with it and run make on target platform to get everything compiled + +# this builds binary which generates voc.par +stage0: src/tools/vocparam/vocparam.c + $(CL) -I src/lib/system/$(TOS)/$(CCOMP)/$(TARCH) -o vocparam src/tools/vocparam/vocparam.c + +# this creates voc.par for a host architecture. +# comment this out if you need to build a compiler for a different architecture. +stage1: + #rm voc.par + #$(shell "./vocparam > voc.par") + #./vocparam > voc.par + $(VOCPARAM) + +# this copies necessary voc.par to the current directory. +# skip this if you are building compiler for the host architecture. +stage2: + cp src/par/voc.par.$(CCOMP).$(TARCH) voc.par +# cp src/par/voc.par.gnu.x86_64 voc.par +# cp src/par/voc.par.gnu.x86 voc.par +# cp src/par/voc.par.gnu.armv6 voc.par +# cp src/par/voc.par.gnu.armv7 voc.par + cp src/voc/prf.Mod_default src/voc/prf.Mod + +# this prepares modules necessary to build the compiler itself +stage3: + + $(VOCSTATIC0) -siapxPS SYSTEM.Mod + $(VOCSTATIC0) -sPFS Args.Mod Console.Mod Unix.Mod + sed -i.tmp "s#/opt#$(PRF)#g" src/voc/prf.Mod + $(VOCSTATIC0) -sPFS prf.Mod + $(VOCSTATIC0) -sPFS Strings.Mod architecture.Mod version.Mod Kernel0.Mod Modules.Mod + $(VOCSTATIC0) -sxPFS Files0.Mod + $(VOCSTATIC0) -sPFS Reals.Mod Texts0.Mod + $(VOCSTATIC0) -sPFS vt100.Mod + +# build the compiler +stage4: + $(VOCSTATIC0) -sPFS errors.Mod + $(VOCSTATIC0) -sPFS extTools.Mod + $(VOCSTATIC0) -sPFS OPM.cmdln.Mod + $(VOCSTATIC0) -sxPFS OPS.Mod + $(VOCSTATIC0) -sPFS OPT.Mod OPC.Mod OPV.Mod OPB.Mod OPP.Mod + $(VOCSTATIC0) -smPS voc.Mod + $(VOCSTATIC0) -smPS BrowserCmd.Mod + $(VOCSTATIC0) -smPS OCatCmd.Mod + +#this is to build the compiler from C sources. +#this is a way to create a bootstrap binary. +stage5: + $(CC) SYSTEM.c Args.c Console.c Modules.c Unix.c \ + Strings.c architecture.c prf.c version.c Kernel0.c Files0.c Reals.c Texts0.c vt100.c \ + extTools.c \ + OPM.c OPS.c OPT.c OPC.c OPV.c OPB.c OPP.c errors.c + + $(CL) -static voc.c -o voc \ + SYSTEM.o Args.o Console.o Modules.o Unix.o \ + Strings.o architecture.o prf.o version.o Kernel0.o Files0.o Reals.o Texts0.o vt100.o \ + extTools.o \ + OPM.o OPS.o OPT.o OPC.o OPV.o OPB.o OPP.o errors.o + $(CL) BrowserCmd.c -o showdef \ + SYSTEM.o Args.o Console.o Modules.o Unix.o Strings.o architecture.o prf.o version.o Kernel0.o Files0.o Reals.o Texts0.o vt100.o \ + OPM.o OPS.o OPT.o OPV.o OPC.o errors.o + + $(CL) OCatCmd.c -o ocat \ + SYSTEM.o Args.o Console.o Modules.o Unix.o Strings.o architecture.o prf.o version.o Kernel0.o Files0.o Reals.o Texts0.o + +# build all library files +stage6: + #v4 libs + $(VOCSTATIC) -sPF Kernel.Mod + $(VOCSTATIC) -sPF Files.Mod + $(VOCSTATIC) -sPF Texts.Mod + $(VOCSTATIC) -sPF Printer.Mod + $(VOCSTATIC) -sPF Strings.Mod + $(VOCSTATIC) -sPF Sets.Mod + $(VOCSTATIC) -sPF Sets0.Mod + $(VOCSTATIC) -sPF Oberon.Mod + + #ooc libs + $(VOCSTATIC) -sPF oocAscii.Mod + $(VOCSTATIC) -sPF oocStrings.Mod + $(VOCSTATIC) -sPF oocStrings2.Mod + $(VOCSTATIC) -sPF oocOakStrings.Mod + $(VOCSTATIC) -sPF oocCharClass.Mod + $(VOCSTATIC) -sPF oocConvTypes.Mod + $(VOCSTATIC) -sPF oocIntConv.Mod + $(VOCSTATIC) -sPF oocIntStr.Mod + $(VOCSTATIC) -sPF oocSysClock.Mod + $(VOCSTATIC) -sPF oocTime.Mod + $(VOCSTATIC) -sPF oocRandomNumbers.Mod +# $(VOCSTATIC) -s oocLongStrings.Mod +# $(CC) oocLongStrings.c +# $(VOCSTATIC) -s oocMsg.Mod +# $(CC) oocMsg.c + + + #ooc2 libs + $(VOCSTATIC) -sPF ooc2Strings.Mod + $(VOCSTATIC) -sPF ooc2Ascii.Mod + $(VOCSTATIC) -sPF ooc2CharClass.Mod + $(VOCSTATIC) -sPF ooc2ConvTypes.Mod + $(VOCSTATIC) -sPF ooc2IntConv.Mod + $(VOCSTATIC) -sPF ooc2IntStr.Mod + $(VOCSTATIC) -sPF ooc2Real0.Mod + #ooc libs + $(VOCSTATIC) -sPF oocLowReal.Mod oocLowLReal.Mod + $(VOCSTATIC) -sPF oocRealMath.Mod oocOakMath.Mod + $(VOCSTATIC) -sPF oocLRealMath.Mod + $(VOCSTATIC) -sPF oocLongInts.Mod + $(VOCSTATIC) -sPF oocComplexMath.Mod oocLComplexMath.Mod + $(VOCSTATIC) -sPF oocLRealConv.Mod oocLRealStr.Mod + $(VOCSTATIC) -sPF oocRealConv.Mod oocRealStr.Mod + $(VOCSTATIC) -sPF oocMsg.Mod oocChannel.Mod + $(VOCSTATIC) -sPF oocStrings2.Mod oocRts.Mod oocFilenames.Mod + $(VOCSTATIC) -sPF oocTextRider.Mod oocBinaryRider.Mod oocJulianDay.Mod + $(VOCSTATIC) -sPF oocFilenames.Mod + $(VOCSTATIC) -sPF oocwrapperlibc.Mod + $(VOCSTATIC) -sPF oocC.Mod + + #Ulm's Oberon system libs + $(VOCSTATIC) -sPF ulmSys.Mod + $(VOCSTATIC) -sPF ulmSYSTEM.Mod + $(VOCSTATIC) -sPF ulmASCII.Mod + $(VOCSTATIC) -sPF ulmSets.Mod + $(VOCSTATIC) -sPF ulmObjects.Mod + $(VOCSTATIC) -sPF ulmDisciplines.Mod + $(VOCSTATIC) -sPF ulmPriorities.Mod + $(VOCSTATIC) -sPF ulmServices.Mod + $(VOCSTATIC) -sPF ulmEvents.Mod + $(VOCSTATIC) -sPF ulmResources.Mod + $(VOCSTATIC) -sPF ulmForwarders.Mod + $(VOCSTATIC) -sPF ulmRelatedEvents.Mod + $(VOCSTATIC) -sPF ulmIO.Mod + $(VOCSTATIC) -sPF ulmProcess.Mod + $(VOCSTATIC) -sPF ulmTypes.Mod + $(VOCSTATIC) -sPF ulmStreams.Mod + $(VOCSTATIC) -sPF ulmAssertions.Mod + $(VOCSTATIC) -sPF ulmIndirectDisciplines.Mod + $(VOCSTATIC) -sPF ulmStreamDisciplines.Mod + $(VOCSTATIC) -sPF ulmIEEE.Mod + $(VOCSTATIC) -sPF ulmMC68881.Mod + $(VOCSTATIC) -sPF ulmReals.Mod + $(VOCSTATIC) -sPF ulmPrint.Mod + $(VOCSTATIC) -sPF ulmWrite.Mod + $(VOCSTATIC) -sPF ulmTexts.Mod + $(VOCSTATIC) -sPF ulmStrings.Mod + $(VOCSTATIC) -sPF ulmConstStrings.Mod + $(VOCSTATIC) -sPF ulmPlotters.Mod + $(VOCSTATIC) -sPF ulmSysTypes.Mod + $(VOCSTATIC) -sPF ulmSysConversions.Mod + $(VOCSTATIC) -sPF ulmErrors.Mod + $(VOCSTATIC) -sPF ulmSysErrors.Mod + $(VOCSTATIC) -sPF ulmSysIO.Mod + $(VOCSTATIC) -sPF ulmLoader.Mod + $(VOCSTATIC) -sPF ulmNetIO.Mod + $(VOCSTATIC) -sPF ulmPersistentObjects.Mod + $(VOCSTATIC) -sPF ulmPersistentDisciplines.Mod + $(VOCSTATIC) -sPF ulmOperations.Mod + $(VOCSTATIC) -sPF ulmScales.Mod + $(VOCSTATIC) -sPF ulmTimes.Mod + $(VOCSTATIC) -sPF ulmClocks.Mod + $(VOCSTATIC) -sPF ulmTimers.Mod + $(VOCSTATIC) -sPF ulmConditions.Mod + $(VOCSTATIC) -sPF ulmStreamConditions.Mod + $(VOCSTATIC) -sPF ulmTimeConditions.Mod + $(VOCSTATIC) -sPF ulmSysConversions.Mod + $(VOCSTATIC) -sPF ulmSysStat.Mod + $(VOCSTATIC) -sPF ulmCiphers.Mod + $(VOCSTATIC) -sPF ulmCipherOps.Mod + $(VOCSTATIC) -sPF ulmBlockCiphers.Mod + $(VOCSTATIC) -sPF ulmAsymmetricCiphers.Mod + $(VOCSTATIC) -sPF ulmConclusions.Mod + $(VOCSTATIC) -sPF ulmRandomGenerators.Mod + $(VOCSTATIC) -sPF ulmTCrypt.Mod + $(VOCSTATIC) -sPF ulmIntOperations.Mod + + #pow32 libs + $(VOCSTATIC) -sPF powStrings.Mod + + #misc libs + $(VOCSTATIC) -sPF MultiArrays.Mod + $(VOCSTATIC) -sPF MultiArrayRiders.Mod + $(VOCSTATIC) -sPF MersenneTwister.Mod + $(VOCSTATIC) -sPF Listen.Mod + + #s3 libs + $(VOCSTATIC) -sPF ethBTrees.Mod + $(VOCSTATIC) -sPF ethMD5.Mod + $(VOCSTATIC) -sPF ethSets.Mod + $(VOCSTATIC) -sPF ethZlib.Mod + $(VOCSTATIC) -sPF ethZlibBuffers.Mod + $(VOCSTATIC) -sPF ethZlibInflate.Mod + $(VOCSTATIC) -sPF ethZlibDeflate.Mod + $(VOCSTATIC) -sPF ethZlibReaders.Mod + $(VOCSTATIC) -sPF ethZlibWriters.Mod + $(VOCSTATIC) -sPF ethZip.Mod + $(VOCSTATIC) -sPF ethRandomNumbers.Mod + $(VOCSTATIC) -sPF ethGZReaders.Mod + $(VOCSTATIC) -sPF ethGZWriters.Mod + $(VOCSTATIC) -sPF ethUnicode.Mod + $(VOCSTATIC) -sPF ethDates.Mod + $(VOCSTATIC) -sPF ethReals.Mod + $(VOCSTATIC) -sPF ethStrings.Mod + +# build remaining tools +# $(VOCSTATIC0) -sPFS compatIn.Mod +# $(VOCSTATIC0) -smPS vmake.Mod +# $(CC) compatIn.c +# $(CL) vmake.c -o vmake SYSTEM.o Args.o compatIn.o Texts.o Console.o Files.o Reals.o Modules.o Kernel.o Unix.o Strings.o oocIntStr.o oocConvTypes.o oocIntConv.o + + + +stage7: + #remove non library objects + rm -f Kernel0.o Files0.o Texts0.o architecture.o prf.o version.o extTools.o OPM.o OPS.o OPT.o OPC.o OPV.o OPB.o OPP.o errors.o + #objects := $(wildcard *.o) + #$(LD) objects + $(ARCHIVE) *.o + #$(ARCHIVE) objects + $(LD) *.o + echo "$(PREFIX)/lib" > 05vishap.conf + +clean: +# rm_objects := rm $(wildcard *.o) +# objects + rm *.h + rm *.c + rm *.sym + rm *.o + rm *.a + rm *.$(SHRLIBEXT) + +install: + test -d $(PREFIX)/bin | mkdir -p $(PREFIX)/bin + cp voc $(PREFIX)/bin/ + cp showdef $(PREFIX)/bin/ + cp ocat $(PREFIX)/bin/ + #cp vmake $(PREFIX)/bin/ + cp -RPp src $(PREFIX)/ + + test -d $(PREFIX)/lib/voc | mkdir -p $(PREFIX)/lib/voc + test -d $(PREFIX)/lib/voc/ | mkdir -p $(PREFIX)/lib/voc + test -d $(PREFIX)/lib/voc/obj | mkdir -p $(PREFIX)/lib/voc/obj + test -d $(PREFIX)/lib/voc/sym | mkdir -p $(PREFIX)/lib/voc/sym + + cp $(LIBRARY).$(SHRLIBEXT) $(PREFIX)/lib + cp $(LIBRARY).a $(PREFIX)/lib + cp *.c $(PREFIX)/lib/voc/obj/ + cp *.h $(PREFIX)/lib/voc/obj/ + cp *.sym $(PREFIX)/lib/voc/sym/ + + #cp 05vishap.conf /etc/ld.so.conf.d/ + ldconfig -m $(PREFIX)/lib + ln -s $(PREFIX) $(PREFIXLN) + +# cp *.o $(PREFIX)/lib/voc/$(RELEASE)/obj/ +uninstall: + rm -rf $(PREFIX) + rm -rf $(PREFIXLN) diff --git a/src/lib/ooc/openbsd/clang/x86_64/oocC.Mod b/src/lib/ooc/openbsd/clang/x86_64/oocC.Mod new file mode 100644 index 00000000..14638e75 --- /dev/null +++ b/src/lib/ooc/openbsd/clang/x86_64/oocC.Mod @@ -0,0 +1,71 @@ +(* $Id: C.Mod,v 1.9 1999/10/03 11:46:01 ooc-devel Exp $ *) +MODULE oocC; +(* Basic data types for interfacing to C code. + Copyright (C) 1997-1998 Michael van Acken + + This module is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public License + as published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + This module is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with OOC. If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*) + +IMPORT + SYSTEM; + +(* +These types are intended to be equivalent to their C counterparts. +They may vary depending on your system, but as long as you stick to a 32 Bit +Unix they should be fairly safe. +*) + +TYPE + char* = CHAR; + signedchar* = SHORTINT; (* signed char *) + shortint* = RECORD a,b : SYSTEM.BYTE END; (* 2 bytes on x64_64 *) (* short int *) + int* = INTEGER; + set* = INTEGER;(*SET;*) (* unsigned int, used as set *) + longint* = LONGINT; (* long int *) + longset* = SET; (*SYSTEM.SET64; *) (* unsigned long, used as set *) + address* = LONGINT; (*SYSTEM.ADDRESS;*) + float* = REAL; + double* = LONGREAL; + + enum1* = int; + enum2* = int; + enum4* = int; + + (* if your C compiler uses short enumerations, you'll have to replace the + declarations above with + enum1* = SHORTINT; + enum2* = INTEGER; + enum4* = LONGINT; + *) + + FILE* = address; (* this is acually a replacement for `FILE*', i.e., for a pointer type *) + sizet* = longint; + uidt* = int; + gidt* = int; + + +TYPE (* some commonly used C array types *) + charPtr1d* = POINTER TO ARRAY OF char; + charPtr2d* = POINTER TO ARRAY OF charPtr1d; + intPtr1d* = POINTER TO ARRAY OF int; + +TYPE (* C string type, assignment compatible with character arrays and + string constants *) + string* = POINTER (*[CSTRING]*) TO ARRAY OF char; + +TYPE + Proc* = PROCEDURE; + +END oocC. diff --git a/src/lib/ooc2/openbsd/clang/oocwrapperlibc.Mod b/src/lib/ooc2/openbsd/clang/oocwrapperlibc.Mod new file mode 100644 index 00000000..0d0cf9b6 --- /dev/null +++ b/src/lib/ooc2/openbsd/clang/oocwrapperlibc.Mod @@ -0,0 +1,34 @@ +MODULE oocwrapperlibc; +IMPORT SYSTEM; +PROCEDURE -includeStdio() + "#include "; + +PROCEDURE -sys(str: ARRAY OF CHAR): INTEGER + "system(str)"; + +PROCEDURE system*(cmd : ARRAY OF CHAR); +VAR r : INTEGER; +BEGIN +r := sys(cmd); +END system; +(* +PROCEDURE strtod* (string: C.address; + VAR tailptr: C.charPtr1d): C.double; +PROCEDURE strtof* (string: C.address; + VAR tailptr: C.charPtr1d): C.float; +PROCEDURE sscanf* (s: C.address; template: ARRAY OF CHAR; ...) : C.int; +*) + +PROCEDURE -sprntf(s, t0, t1, t2: ARRAY OF CHAR): INTEGER + "sprintf(s, t0, t1, t2)"; + +PROCEDURE sprintf* (VAR s: ARRAY OF CHAR; template0: ARRAY OF CHAR; template1: ARRAY OF CHAR; template2: ARRAY OF CHAR); +VAR r : INTEGER; +BEGIN + r := sprntf (s, template0, template1, template2); +END sprintf; + +BEGIN + + +END oocwrapperlibc. From 4366edec8513b5a286c3b45b34f1463c467fb6e6 Mon Sep 17 00:00:00 2001 From: Antranig Vartanian Date: Sun, 6 Dec 2015 21:59:45 +0400 Subject: [PATCH 028/580] changes on SYSTEM.h for Malloc -- antranigv Former-commit-id: ab04bdfdc62089ffb48f04f0c3f2939105a4715e --- src/lib/system/openbsd/gcc/x86_64/SYSTEM.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/system/openbsd/gcc/x86_64/SYSTEM.h b/src/lib/system/openbsd/gcc/x86_64/SYSTEM.h index 2c8e71d0..becece08 100644 --- a/src/lib/system/openbsd/gcc/x86_64/SYSTEM.h +++ b/src/lib/system/openbsd/gcc/x86_64/SYSTEM.h @@ -11,8 +11,9 @@ uses double # as concatenation operator */ -#include +//#include #include /* for type sizes -- noch */ +#include /* for malloc -- antranigv */ extern void *memcpy(void *dest, const void *src, unsigned long n); extern void *malloc(unsigned long size); From 5143a1557eee6f84b85440f20532d27ac983f2ea Mon Sep 17 00:00:00 2001 From: Antranig Vartanian Date: Sat, 12 Dec 2015 20:30:40 +0400 Subject: [PATCH 029/580] fixed FdSet size -- antranigv Former-commit-id: a80cd3b643237630569b82192b2024884c0e9fc4 --- src/lib/system/openbsd/gcc/x86_64/Unix.Mod | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/system/openbsd/gcc/x86_64/Unix.Mod b/src/lib/system/openbsd/gcc/x86_64/Unix.Mod index c0abebec..8f009f1f 100644 --- a/src/lib/system/openbsd/gcc/x86_64/Unix.Mod +++ b/src/lib/system/openbsd/gcc/x86_64/Unix.Mod @@ -229,7 +229,7 @@ from man gettimeofday interval*, value*: Timeval END ; - FdSet* = ARRAY 8 OF SET; + FdSet* = ARRAY 16 OF SET; SigCtxPtr* = POINTER TO SigContext; SigContext* = RECORD @@ -527,3 +527,4 @@ BEGIN StatCheck(); END Unix. + From b5bf7f48fcd02421471cda84c7514d265b526af8 Mon Sep 17 00:00:00 2001 From: Antranig Vartanian Date: Sat, 12 Dec 2015 20:57:00 +0400 Subject: [PATCH 030/580] changed Kernel0.Mod for TimeDesc -- antranigv Former-commit-id: 90ef9158d405bf7d8d41a2a3e7c03c2723525b6f --- src/lib/system/openbsd/gcc/Kernel0.Mod | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/lib/system/openbsd/gcc/Kernel0.Mod b/src/lib/system/openbsd/gcc/Kernel0.Mod index 6a58650f..ac049110 100644 --- a/src/lib/system/openbsd/gcc/Kernel0.Mod +++ b/src/lib/system/openbsd/gcc/Kernel0.Mod @@ -8,9 +8,26 @@ MODULE Kernel0; IMPORT SYSTEM, Unix, Args, Strings, version; TYPE +(* from time.h on OpenBSD; added yday; changed gmtoff, zone order; + sec to isdst changed to INTEGER; -- antranigv + struct tm { + int tm_sec; + int tm_min; + int tm_hour; + int tm_mday; + int tm_mon; + int tm_year; + int tm_wday; + int tm_yday; + int tm_isdst; + long tm_gmtoff; + char *tm_zone; +}; *) + RealTime = POINTER TO TimeDesc; TimeDesc = RECORD - sec, min, hour, mday, mon, year, wday, isdst, zone, gmtoff: LONGINT + sec, min, hour, mday, mon, year, wday, yday, isdst : INTEGER; + gmtoff, zone : LONGINT (* sec, min, hour, mday, mon, year, wday, isdst, zone, gmtoff: INTEGER*) END ; From 40441e13aeda28145cfd8239a7088594e4fff361 Mon Sep 17 00:00:00 2001 From: Antranig Vartanian Date: Sat, 12 Dec 2015 21:03:26 +0400 Subject: [PATCH 031/580] changed Kernel.Mod from Kernel0.Mod -- antranigv Former-commit-id: 47d97361f627492e1605090b1955c72bcb5c744f --- src/lib/system/openbsd/gcc/Kernel.Mod | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/lib/system/openbsd/gcc/Kernel.Mod b/src/lib/system/openbsd/gcc/Kernel.Mod index cd516916..e76d11d9 100644 --- a/src/lib/system/openbsd/gcc/Kernel.Mod +++ b/src/lib/system/openbsd/gcc/Kernel.Mod @@ -7,9 +7,27 @@ MODULE Kernel; IMPORT SYSTEM, Unix, Args; TYPE +(* from time.h on OpenBSD; added yday; changed gmtoff, zone order; + sec to isdst changed to INTEGER; -- antranigv + struct tm { + int tm_sec; + int tm_min; + int tm_hour; + int tm_mday; + int tm_mon; + int tm_year; + int tm_wday; + int tm_yday; + int tm_isdst; + long tm_gmtoff; + char *tm_zone; +}; *) + RealTime = POINTER TO TimeDesc; TimeDesc = RECORD - sec, min, hour, mday, mon, year, wday, isdst, zone, gmtoff: LONGINT + sec, min, hour, mday, mon, year, wday, yday, isdst : INTEGER; + gmtoff, zone : LONGINT +(* sec, min, hour, mday, mon, year, wday, isdst, zone, gmtoff: INTEGER*) END ; KeyCmd* = PROCEDURE; From 1a2082bfc2100a3b19a695b990e9c33b9150fa81 Mon Sep 17 00:00:00 2001 From: Antranig Vartanian Date: Sat, 12 Dec 2015 21:26:06 +0400 Subject: [PATCH 032/580] changed variable l type from LONGINT to INTEGER in Kernel.Mod and Kernel0.Mod --antranigv Former-commit-id: 135f9ec6b489a63826e00a06be8af679fb5e921b --- src/lib/system/openbsd/gcc/Kernel.Mod | 2 +- src/lib/system/openbsd/gcc/Kernel0.Mod | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/system/openbsd/gcc/Kernel.Mod b/src/lib/system/openbsd/gcc/Kernel.Mod index e76d11d9..dd99ceb5 100644 --- a/src/lib/system/openbsd/gcc/Kernel.Mod +++ b/src/lib/system/openbsd/gcc/Kernel.Mod @@ -99,7 +99,7 @@ MODULE Kernel; PROCEDURE GetClock* (VAR t, d: LONGINT); VAR tv: Unix.Timeval; tz: Unix.Timezone; time: RealTime; - l : LONGINT; + l : INTEGER; BEGIN l := Unix.Gettimeofday(tv, tz); time := localtime(tv.sec); diff --git a/src/lib/system/openbsd/gcc/Kernel0.Mod b/src/lib/system/openbsd/gcc/Kernel0.Mod index ac049110..dd44b415 100644 --- a/src/lib/system/openbsd/gcc/Kernel0.Mod +++ b/src/lib/system/openbsd/gcc/Kernel0.Mod @@ -102,7 +102,7 @@ MODULE Kernel0; PROCEDURE GetClock* (VAR t, d: LONGINT); VAR tv: Unix.Timeval; tz: Unix.Timezone; time: RealTime; - l : LONGINT; + l : INTEGER; BEGIN l := Unix.Gettimeofday(tv, tz); time := localtime(tv.sec); From 10e2d4c8075f120c77101f60a8a20f9d90e7501e Mon Sep 17 00:00:00 2001 From: Antranig Vartanian Date: Sat, 12 Dec 2015 21:58:47 +0400 Subject: [PATCH 033/580] chaned TimeDesc in File0.Mod and File.Mod -- antranigv Former-commit-id: 3cdb5b1d3acdce6a952e9d063059ca9452a78e7d --- src/lib/system/openbsd/gcc/x86_64/Files.Mod | 21 ++++++++++++++++++-- src/lib/system/openbsd/gcc/x86_64/Files0.Mod | 21 ++++++++++++++++++-- 2 files changed, 38 insertions(+), 4 deletions(-) diff --git a/src/lib/system/openbsd/gcc/x86_64/Files.Mod b/src/lib/system/openbsd/gcc/x86_64/Files.Mod index c8f42ca5..344cb213 100644 --- a/src/lib/system/openbsd/gcc/x86_64/Files.Mod +++ b/src/lib/system/openbsd/gcc/x86_64/Files.Mod @@ -53,10 +53,27 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files org, offset: LONGINT END ; +(* from time.h on OpenBSD; added yday; changed gmtoff, zone order; + sec to isdst changed to INTEGER; -- antranigv + struct tm { + int tm_sec; + int tm_min; + int tm_hour; + int tm_mday; + int tm_mon; + int tm_year; + int tm_wday; + int tm_yday; + int tm_isdst; + long tm_gmtoff; + char *tm_zone; +}; *) + Time = POINTER TO TimeDesc; TimeDesc = RECORD - sec*, min*, hour*, mday*, mon*, year*, wday*, isdst*, zone*, gmtoff*: LONGINT; -(* sec*, min*, hour*, mday*, mon*, year*, wday*, isdst*, zone*, gmtoff*: INTEGER;*) + sec, min, hour, mday, mon, year, wday, yday, isdst : INTEGER; + gmtoff, zone : LONGINT +(* sec, min, hour, mday, mon, year, wday, isdst, zone, gmtoff: INTEGER*) END ; VAR diff --git a/src/lib/system/openbsd/gcc/x86_64/Files0.Mod b/src/lib/system/openbsd/gcc/x86_64/Files0.Mod index 1d9cd953..4d2661fd 100644 --- a/src/lib/system/openbsd/gcc/x86_64/Files0.Mod +++ b/src/lib/system/openbsd/gcc/x86_64/Files0.Mod @@ -56,10 +56,27 @@ MODULE Files0; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files org, offset: LONGINT END ; +(* from time.h on OpenBSD; added yday; changed gmtoff, zone order; + sec to isdst changed to INTEGER; -- antranigv + struct tm { + int tm_sec; + int tm_min; + int tm_hour; + int tm_mday; + int tm_mon; + int tm_year; + int tm_wday; + int tm_yday; + int tm_isdst; + long tm_gmtoff; + char *tm_zone; +}; *) + Time = POINTER TO TimeDesc; TimeDesc = RECORD - sec*, min*, hour*, mday*, mon*, year*, wday*, isdst*, zone*, gmtoff*: LONGINT; -(* sec*, min*, hour*, mday*, mon*, year*, wday*, isdst*, zone*, gmtoff*: INTEGER;*) + sec, min, hour, mday, mon, year, wday, yday, isdst : INTEGER; + gmtoff, zone : LONGINT +(* sec, min, hour, mday, mon, year, wday, isdst, zone, gmtoff: INTEGER*) END ; VAR From f3089c9942cbc1451a43ec54b0c9bfcc888818c7 Mon Sep 17 00:00:00 2001 From: Antranig Vartanian Date: Wed, 13 Jan 2016 14:24:08 +0400 Subject: [PATCH 034/580] some changes for OpenBSD Former-commit-id: d570c60e3c1f1fdd4e162aa2979f3fac1fb9d3c8 --- 05vishap.conf | 2 +- makefile.openbsd.gcc.x86_64 | 6 +- src/lib/system/openbsd/gcc/x86_64/Unix.Mod | 99 ++++++++++++++++++---- src/voc/openbsd/gcc/extTools.Mod | 2 +- src/voc/prf.Mod | 2 +- src/voc/version.Mod | 2 +- 6 files changed, 90 insertions(+), 23 deletions(-) diff --git a/05vishap.conf b/05vishap.conf index 88a0e25c..29efccf6 100644 --- a/05vishap.conf +++ b/05vishap.conf @@ -1 +1 @@ -/opt/voc-1.1/lib +/home/noch/local/voc-1.1/lib diff --git a/makefile.openbsd.gcc.x86_64 b/makefile.openbsd.gcc.x86_64 index c44bc033..2c627314 100644 --- a/makefile.openbsd.gcc.x86_64 +++ b/makefile.openbsd.gcc.x86_64 @@ -20,7 +20,8 @@ LIBNAME = VishapOberon LIBRARY = lib$(LIBNAME) ifndef PRF -PRF = "/opt" +#PRF = "/opt" +PRF = "/home/noch/local" endif PREFIX = $(PRF)/voc-$(RELEASE) PREFIXLN = $(PRF)/voc @@ -76,7 +77,8 @@ stage3: $(VOCSTATIC0) -siapxPS SYSTEM.Mod $(VOCSTATIC0) -sPFS Args.Mod Console.Mod Unix.Mod - sed -i.tmp "s#/opt#$(PRF)#g" src/voc/prf.Mod + sed "s#/opt#$(PRF)#g" src/voc/prf.Mod > tmp.Mod + mv tmp.Mod src/voc/prf.Mod $(VOCSTATIC0) -sPFS prf.Mod $(VOCSTATIC0) -sPFS Strings.Mod architecture.Mod version.Mod Kernel0.Mod Modules.Mod $(VOCSTATIC0) -sxPFS Files0.Mod diff --git a/src/lib/system/openbsd/gcc/x86_64/Unix.Mod b/src/lib/system/openbsd/gcc/x86_64/Unix.Mod index 8f009f1f..1e1e7ecb 100644 --- a/src/lib/system/openbsd/gcc/x86_64/Unix.Mod +++ b/src/lib/system/openbsd/gcc/x86_64/Unix.Mod @@ -6,7 +6,7 @@ MODULE Unix; (* Josef Templ, 5.3.90 Linux system calls *) error numbers as defined in Unix other constants start with lower case letters *) -IMPORT SYSTEM; +IMPORT SYSTEM(*, Console*); CONST @@ -170,28 +170,33 @@ TYPE 64 bytes long in glibc on x86_64 *) + (* on openbsd + typedef long sigjmp_buf[11 + 1]; + typedef long jmp_buf[11]; + it seems we need sigjmp_buf + *) JmpBuf* = RECORD - jmpbuf: ARRAY 11 OF LONGINT; (* 8 * 8 = 64 *) + jmpbuf: ARRAY 12 OF LONGINT; (* 8 * 8 = 64 *) END ; Status* = RECORD (* struct stat *) - mode* : INTEGER; + mode* : INTEGER; (* mode_t *) dev* : INTEGER; (* dev_t 4 *) - ino* : LONGINT; (* ino 8 *) - nlink* : INTEGER; - uid*, gid*: INTEGER; - rdev* : INTEGER; + ino* : LONGINT; (* ino_t 8 *) + nlink* : INTEGER; (* nlink_t *) + uid*, gid*: INTEGER; (* uid_t, gid_t *) + rdev* : INTEGER; (* dev_t *) atime* : LONGINT; atimences* : LONGINT; mtime* : LONGINT; mtimensec* : LONGINT; ctime* : LONGINT; ctimensec* : LONGINT; - size* : LONGINT; - blocks* : LONGINT; - blksize* : INTEGER; - unused0*, unused1*: INTEGER; - unused2*, unused3*: LONGINT; + size* : LONGINT; (* off_t *) + blocks* : LONGINT; (* int64_t *) + blksize* : INTEGER; (* u_int32_t *) + flags, gen*: INTEGER; (* u_int32_t *) + birthtim: ARRAY 2 OF LONGINT; END ; (* from /usr/include/bits/time.h @@ -294,11 +299,26 @@ from man gettimeofday PROCEDURE -includeStat() "#include "; + (* for jmp_buf *) + PROCEDURE -includeSetjmp() + "#include "; + + (* for dirent *) + PROCEDURE -includeDirent() + "#include "; + + (* for rusage *) + PROCEDURE -includeResource() + "#include "; + + (* for iovec *) + PROCEDURE -includeIovec() + "#include "; PROCEDURE -includeErrno() "#include "; - (* for read(), write() and sleep() *) + (* for read(), write() and sleep(), and fd_set *) PROCEDURE -includeUnistd() "#include "; @@ -508,6 +528,30 @@ from man gettimeofday PROCEDURE -SizeofStat(): INTEGER "sizeof(struct stat)"; + PROCEDURE -SizeofJmpBuf(): INTEGER + "sizeof(jmp_buf)"; + + PROCEDURE -SizeofSigJmpBuf(): INTEGER + "sizeof(sigjmp_buf)"; + + PROCEDURE -SizeofTimeval(): INTEGER + "sizeof(struct timeval)"; + + PROCEDURE -SizeofTimezone(): INTEGER + "sizeof(struct timezone)"; + + PROCEDURE -SizeofRusage(): INTEGER + "sizeof(struct rusage)"; + + PROCEDURE -SizeofFdSet(): INTEGER + "sizeof(fd_set)"; + + PROCEDURE -SizeofDirent(): INTEGER + "sizeof(struct dirent)"; + + PROCEDURE -SizeofIovec(): INTEGER + "sizeof(struct iovec)"; + PROCEDURE -Error(msg: ARRAY OF CHAR; len: INTEGER) "write(1/*stdout*/, msg, len); char ch = 0xa; write(1, &ch, 1)"; @@ -516,14 +560,35 @@ from man gettimeofday BEGIN x := SizeofUnixStat(); y := SizeofStat(); - IF x # y THEN + IF x # y THEN Error("Unix.StatCheck: inconsistent usage of struct stat", 49); - Exit(1); + Exit(1); END END StatCheck; - +(* + PROCEDURE Check; + BEGIN + Console.String("struct stat size: "); Console.Int(SizeofStat(), 0); Console.Ln; + Console.String("Unix.Stat size: "); Console.Int(SIZE(Status), 0); Console.Ln; + Console.String("Unix.JmpBuf size: "); Console.Int(SIZE(JmpBuf), 0); Console.Ln; + Console.String("sigjmp_buf size: "); Console.Int(SizeofSigJmpBuf(), 0); Console.Ln; + Console.String("Unix.Timeval size: "); Console.Int(SIZE(Timeval), 0); Console.Ln; + Console.String("struct timeval size: "); Console.Int(SizeofTimeval(), 0); Console.Ln; + Console.String("Unix.Timezone size: "); Console.Int(SIZE(Timezone), 0); Console.Ln; + Console.String("struct timezone size: "); Console.Int(SizeofTimezone(), 0); Console.Ln; + Console.String("Unix.Rusage size: "); Console.Int(SIZE(Rusage), 0); Console.Ln; + Console.String("struct rusage size: "); Console.Int(SizeofRusage(), 0); Console.Ln; + Console.String("Unix.FdSet size: "); Console.Int(SIZE(FdSet), 0); Console.Ln; + Console.String("fdset size: "); Console.Int(SizeofFdSet(), 0); Console.Ln; + Console.String("Unix.Dirent size: "); Console.Int(SIZE(Dirent), 0); Console.Ln; + Console.String("struct dirent size: "); Console.Int(SizeofDirent(), 0); Console.Ln; + Console.String("Unix.Iovec size: "); Console.Int(SIZE(Iovec), 0); Console.Ln; + Console.String("struct iovec size: "); Console.Int(SizeofIovec(), 0); Console.Ln; + END Check; +*) BEGIN - + + (*Check;*) StatCheck(); END Unix. diff --git a/src/voc/openbsd/gcc/extTools.Mod b/src/voc/openbsd/gcc/extTools.Mod index 30790878..92110890 100644 --- a/src/voc/openbsd/gcc/extTools.Mod +++ b/src/voc/openbsd/gcc/extTools.Mod @@ -63,7 +63,7 @@ END LinkMain; BEGIN -incPath0 := "src/lib/system/linux/"; +incPath0 := "src/lib/system/openbsd/"; Strings.Append (compiler, incPath0); incPath1 := "lib/voc/obj "; ccOpt := " -fPIC -g "; diff --git a/src/voc/prf.Mod b/src/voc/prf.Mod index 2f4d8f24..20fb1a8c 100644 --- a/src/voc/prf.Mod +++ b/src/voc/prf.Mod @@ -1,5 +1,5 @@ MODULE prf; -CONST prefix* = "/opt"; +CONST prefix* = "/home/noch/local"; END prf. diff --git a/src/voc/version.Mod b/src/voc/version.Mod index 5edcd27e..0dc5e636 100644 --- a/src/voc/version.Mod +++ b/src/voc/version.Mod @@ -8,7 +8,7 @@ VAR arch-, version-, date-, versionLong-, prefix0-, prefix- : ARRAY 256 OF CHAR; defaultTarget* : INTEGER; BEGIN arch := architecture.arch; -date := " [2015/02/02]"; +date := " [2016/01/12]"; version := "1.1"; versionLong := ""; COPY(version, versionLong); From ecc94a305b110aee10d1f2bc22da34d3f6e10779 Mon Sep 17 00:00:00 2001 From: norayr Date: Wed, 13 Jan 2016 14:34:16 +0400 Subject: [PATCH 035/580] fixed home path Former-commit-id: f494740aadd2584f3994f1dc5746f9c4ddf0429e --- makefile.openbsd.gcc.x86_64 | 3 +-- src/lib/system/darwin/clang/Kernel.Mod | 2 +- src/lib/system/freebsd/clang/Kernel.Mod | 2 +- src/lib/system/linux/clang/Kernel.Mod | 2 +- src/lib/system/linux/gcc/Kernel.Mod | 2 +- src/lib/system/openbsd/gcc/Kernel.Mod | 2 +- 6 files changed, 6 insertions(+), 7 deletions(-) diff --git a/makefile.openbsd.gcc.x86_64 b/makefile.openbsd.gcc.x86_64 index 2c627314..801e1c18 100644 --- a/makefile.openbsd.gcc.x86_64 +++ b/makefile.openbsd.gcc.x86_64 @@ -20,8 +20,7 @@ LIBNAME = VishapOberon LIBRARY = lib$(LIBNAME) ifndef PRF -#PRF = "/opt" -PRF = "/home/noch/local" +PRF = "/opt" endif PREFIX = $(PRF)/voc-$(RELEASE) PREFIXLN = $(PRF)/voc diff --git a/src/lib/system/darwin/clang/Kernel.Mod b/src/lib/system/darwin/clang/Kernel.Mod index cd516916..4fa025ab 100644 --- a/src/lib/system/darwin/clang/Kernel.Mod +++ b/src/lib/system/darwin/clang/Kernel.Mod @@ -57,7 +57,7 @@ MODULE Kernel; PROCEDURE -sigsetjmp*(VAR env: Unix.JmpBuf; savemask: LONGINT): LONGINT "__sigsetjmp(env, savemask)"; - PROCEDURE -siglongjmp*(VAR env:Unix. JmpBuf; val: LONGINT) + PROCEDURE -siglongjmp*(VAR env:Unix.JmpBuf; val: LONGINT) "siglongjmp(env, val)"; PROCEDURE -heapsize*(): LONGINT diff --git a/src/lib/system/freebsd/clang/Kernel.Mod b/src/lib/system/freebsd/clang/Kernel.Mod index cd516916..4fa025ab 100644 --- a/src/lib/system/freebsd/clang/Kernel.Mod +++ b/src/lib/system/freebsd/clang/Kernel.Mod @@ -57,7 +57,7 @@ MODULE Kernel; PROCEDURE -sigsetjmp*(VAR env: Unix.JmpBuf; savemask: LONGINT): LONGINT "__sigsetjmp(env, savemask)"; - PROCEDURE -siglongjmp*(VAR env:Unix. JmpBuf; val: LONGINT) + PROCEDURE -siglongjmp*(VAR env:Unix.JmpBuf; val: LONGINT) "siglongjmp(env, val)"; PROCEDURE -heapsize*(): LONGINT diff --git a/src/lib/system/linux/clang/Kernel.Mod b/src/lib/system/linux/clang/Kernel.Mod index cd516916..4fa025ab 100644 --- a/src/lib/system/linux/clang/Kernel.Mod +++ b/src/lib/system/linux/clang/Kernel.Mod @@ -57,7 +57,7 @@ MODULE Kernel; PROCEDURE -sigsetjmp*(VAR env: Unix.JmpBuf; savemask: LONGINT): LONGINT "__sigsetjmp(env, savemask)"; - PROCEDURE -siglongjmp*(VAR env:Unix. JmpBuf; val: LONGINT) + PROCEDURE -siglongjmp*(VAR env:Unix.JmpBuf; val: LONGINT) "siglongjmp(env, val)"; PROCEDURE -heapsize*(): LONGINT diff --git a/src/lib/system/linux/gcc/Kernel.Mod b/src/lib/system/linux/gcc/Kernel.Mod index cd516916..4fa025ab 100644 --- a/src/lib/system/linux/gcc/Kernel.Mod +++ b/src/lib/system/linux/gcc/Kernel.Mod @@ -57,7 +57,7 @@ MODULE Kernel; PROCEDURE -sigsetjmp*(VAR env: Unix.JmpBuf; savemask: LONGINT): LONGINT "__sigsetjmp(env, savemask)"; - PROCEDURE -siglongjmp*(VAR env:Unix. JmpBuf; val: LONGINT) + PROCEDURE -siglongjmp*(VAR env:Unix.JmpBuf; val: LONGINT) "siglongjmp(env, val)"; PROCEDURE -heapsize*(): LONGINT diff --git a/src/lib/system/openbsd/gcc/Kernel.Mod b/src/lib/system/openbsd/gcc/Kernel.Mod index dd99ceb5..73cc80f3 100644 --- a/src/lib/system/openbsd/gcc/Kernel.Mod +++ b/src/lib/system/openbsd/gcc/Kernel.Mod @@ -75,7 +75,7 @@ MODULE Kernel; PROCEDURE -sigsetjmp*(VAR env: Unix.JmpBuf; savemask: LONGINT): LONGINT "__sigsetjmp(env, savemask)"; - PROCEDURE -siglongjmp*(VAR env:Unix. JmpBuf; val: LONGINT) + PROCEDURE -siglongjmp*(VAR env:Unix.JmpBuf; val: LONGINT) "siglongjmp(env, val)"; PROCEDURE -heapsize*(): LONGINT From 6425e7f89903ed97ce2d49c130fad84aaea93174 Mon Sep 17 00:00:00 2001 From: norayr Date: Wed, 13 Jan 2016 14:35:10 +0400 Subject: [PATCH 036/580] fixed default prefix in darwin makefile Former-commit-id: 9f1ee2651fabb7519ac0dfd74bba6d439674629e --- makefile.darwin.clang.x86_64 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/makefile.darwin.clang.x86_64 b/makefile.darwin.clang.x86_64 index a08a8d3c..10309ead 100644 --- a/makefile.darwin.clang.x86_64 +++ b/makefile.darwin.clang.x86_64 @@ -20,8 +20,8 @@ LIBNAME = VishapOberon LIBRARY = lib$(LIBNAME) ifndef PRF -#PRF = "/opt" -PRF = "/Users/noch/local" +PRF = "/opt" +#PRF = "/Users/noch/local" endif PREFIX = $(PRF)/voc-$(RELEASE) PREFIXLN = $(PRF)/voc From 93335d846070b66b2482ac4398add20b8e8293ab Mon Sep 17 00:00:00 2001 From: norayr Date: Wed, 13 Jan 2016 15:48:37 +0400 Subject: [PATCH 037/580] updated documentation. Former-commit-id: a97fc806e7a76069b323a27db060227923941b82 --- COMPILE | 78 ++++++++++++++++++++++++++++++++-------- README.md | 105 ++++++++++++++++++++++++++++++++++++++++-------------- 2 files changed, 143 insertions(+), 40 deletions(-) diff --git a/COMPILE b/COMPILE index b10eddef..827a3cf6 100644 --- a/COMPILE +++ b/COMPILE @@ -1,21 +1,71 @@ -currently three bootstrap static binaries provided, for x86_64, x86, and armv6j_hardfp (works on raspberry pi) gnu/linux targets. +Platforms +=======: +several bootstrap static binaries provided, for -0) prerequisites: libc6-dev on debian, glibc-devel, glibc-static on fedora. - -1) make with corresponding makefile - if it's rasp pi or other armhf platform then do - # make -f makefile.gcc.armv6j_hardfp - if it's x86 then - # make -f makefile.gcc.x86 - and if it's x86_64, then default makefile is for this platform - # make +gnu/linux on x86_64 +gnu/linux on x86 +gnu/linux on armv6j_hardfp (i. e. raspberry pi) +darwin on x86_64 (read osx) +freebsd on x86_64 +openbsd on x86_64 - (theoretically you can also change TARCH in makefile and type make) +Prerequisites: +========== +on Debian GNU/Linux: -2) # sudo make install +gcc, libc6-dev on debian -this will install voc in /opt/voc- and create /opt/voc symlink to it. +on RHEL/CentOS/Fedora: + +gcc, glibc-devel, glibc-static + +on OSX: +clang, Xcode. + +How to install +============== + +By default, voc will be installed to /opt/voc- and /opt/voc symlink to it will be created. +If you want it in other prefix, then edit makefile for your platform, and change PRF = "/opt" to the path you need. + +Then just cd into source directory and type + +>make -f makefile.linux.gcc.x86_64 + +if you are on GNU/Linux x86_64 platform and you want voc to use gcc as backend. + +otherwise use corresponding makefile. + +Note for FreeBSD, OpenBSD and OSX users: +use gmake instead of make, i. e. + +>gmake -f makefile.clang.darwin.x86_64 + +then type + +>sudo make install + +or +>sudo gmake -f makefile.clang.darwin.x86_64 install + +on MacOSX/Darwin. + +build rpm +========= + +if you'd like to build an rpm installer, then + +* compress sources as voc-1.0.src.tar.bz2 + assuming you in voc directory +> cd .. +> tar -jcvpf voc-1.0.src.tar.bz2 voc +* put them to ~/rpmbuild/SOURCES (on some systems as root to /usr/src/redhat/SOURCES/) or other similar location. +> mkdir -p ~/rpmbuild/SOURCES +> cp voc-1.0.src.tar.bz2 ~/rpmbuild/SOURCES +* cd to voc directory and run +> rpmbuild -ba voc.spec + +this should create voc rpm installers. -add /opt/voc/bin to your PATH and enjoy, compile, have fun! -- noch diff --git a/README.md b/README.md index 8e35d61f..8af7d5f2 100644 --- a/README.md +++ b/README.md @@ -2,30 +2,95 @@ vishap oberon compiler ====================== -How to install -============== +#â±±ishap Oberon Compiler (voc) is a free (GPLv3) professional oberon-2 compiler. -just cd into source directory and type +Platforms: +========= +voc produces x86_64, x86, ppc, armv{4-7} binaries and works on those platforms. +On x86_64 it supports 64bit LONGINT and 64bit SET types. +By using currently stable C backend voc is easily ported to any platform for which C compiler exists. ->make -f makefile.linux.gcc.x86_64 +Operating Systems: +================== +Currently only GNU/Linux, Mac OS X and FreeBSD sources (with bootstrap binaries) are published. -if you are on linux x86_64 system and you want voc to use gcc as backend. +Ports to Solaris, AIX will be made and published in case there is an interest from community. +voc should work on MS Windows/ReactOS via Cygwin/gcc, however we did not test it on Windows compatible machine. -otherwise use corresponding makefile. +Backends: +========= +voc has stable C backend, which generates human readable and easily debuggable C code. +Generated C code is fairly efficient and does not cause a noticeable overhead. voc was used to generate code even for low end 8 bit devices like nmos6502 and AVR micros. -then type +Work on native backends for arm and x86_64 is in progress. ->sudo make install +Libraries: +========== +voc comes with a useful set of libraries, in particular: +– Oberon V4 and S3 compatible library set. +– ooc (optimizing oberon-2 compiler) library port. +– Ulm’s Oberon system library port. + +This makes it easier to compile/port software which was developed by using those compilers. + +Work on other compatibility layers is in progress. +voc team also works on bindings to existing C/Pascal libraries. + +Some other freely redistributable libraries are available as a part of voc distribution. + +Licensing: +========== +voc’s frontend and C backend engine is a fork of Josef Templ’s Ofront, which has been released under FreeBSD License. Unlike Ofront, it does not include Oberon v4 environment. +Ulm Oberon Library is distributed under GPL. +ooc library is distributed under GPL. + +voc tools are distributed under GPLv3. +most of the runtime in libVishapOberon is distributed under GPLv3 with runtime exception. +ulm and ooc libraries were distributed under GPL, thus static linking to those modules from libVishapOberon.a to proprietary code is disallowed. + +Naming: +======= +Vishaps are dragons inhabited in Armenian Highlands. +We decided to name the project “Vishap†because ties between compilers and dragons have ancient traditions. + +Also, Vishaps are known in tales, fiction. This page refers to some technologies as “computer science fictionâ€. Among them to Oberon. This brings another meaning, Oberon is like aliens, ghosts. And Vishaps. -- or see COMPILE file. How to use ========== +As we said previously, voc is installed in /opt/voc/bin if you did not change the prefix. +So, in order to run voc you need to type + +>/opt/voc/bin/voc + +or add /opt/voc/bin to you PATH environment variable, and then just typing voc will execute it. For that you have to know how to work in Unix shell, and this knowledge is out of the scope of this document. + Type voc and it'll show you help. -voc -M will compile your module and link it statically to libVishapOberon. -voc -m will link the module dynamically. +Simple example +============ + +Let's write hello world file: + +$ cat hey.Mod + +MODULE hey; +IMPORT Console; +BEGIN +Console.String("hey there"); Console.Ln +END hey. + +>voc -M hey.Mod + +will compile your module and link it statically to libVishapOberon. + +>voc -m hey.Mod + +will link the module dynamically. + +Example with two modules +==================== If you have more than one module, and you want them to be compiled into elf filethen: Let's assume we have module M0 which imports M1; @@ -37,6 +102,9 @@ Module M1 will be compiled with -s option, i. e. sym file will be generated. Module M0 will be compiled and linked statically. +Example with many modules +====================== + In case you have modules in different directories, like "ui", "logic", "math", then you need to export MODULES environment variable like this: >export MODULES=".:ui:logic:math" @@ -49,19 +117,4 @@ Otherwise you can use full path: >voc -s ui/ui0.Mod -build rpm -========= -if you'd like to build an rpm installer, then - -* compress sources as voc-1.0.src.tar.bz2 - assuming you in voc directory -> cd .. -> tar -jcvpf voc-1.0.src.tar.bz2 voc -* put them to ~/rpmbuild/SOURCES (on some systems as root to /usr/src/redhat/SOURCES/) or other similar location. -> mkdir -p ~/rpmbuild/SOURCES -> cp voc-1.0.src.tar.bz2 ~/rpmbuild/SOURCES -* cd to voc directory and run -> rpmbuild -ba voc.spec - -this should create voc rpm installers. From 163c316e9255a0c293ccab6f597666f699ab981a Mon Sep 17 00:00:00 2001 From: norayr Date: Wed, 13 Jan 2016 15:53:08 +0400 Subject: [PATCH 038/580] docs improvement. Former-commit-id: a986cf542ca3d51ea57f4779b6c53b2f91d6494d --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 8af7d5f2..af02cfb8 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,14 @@ -vishap oberon compiler +Vishap oberon compiler ====================== -#â±±ishap Oberon Compiler (voc) is a free (GPLv3) professional oberon-2 compiler. +â±±ishap Oberon Compiler (voc) is a free (GPLv3) professional oberon-2 compiler. Platforms: ========= voc produces x86_64, x86, ppc, armv{4-7} binaries and works on those platforms. On x86_64 it supports 64bit LONGINT and 64bit SET types. -By using currently stable C backend voc is easily ported to any platform for which C compiler exists. +By using currently stable C backend voc is relatively easy to port to any platform for which C compiler exists. Operating Systems: ================== From 12e7369e17adfe9ad0294faadb73d688fc70ee80 Mon Sep 17 00:00:00 2001 From: norayr Date: Wed, 13 Jan 2016 15:55:28 +0400 Subject: [PATCH 039/580] added site link Former-commit-id: 087d2decc936e9785d36a1bacaa3f6507b5e923e --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index af02cfb8..4e6e3ed4 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Vishap oberon compiler ====================== -â±±ishap Oberon Compiler (voc) is a free (GPLv3) professional oberon-2 compiler. +(â±±ishap Oberon Compiler](http://oberon.vishap.am) (voc) is a free (GPLv3) professional oberon-2 compiler. Platforms: ========= From 9ff2932042aa52b9ee6570e96823da71700a3792 Mon Sep 17 00:00:00 2001 From: norayr Date: Wed, 13 Jan 2016 15:58:18 +0400 Subject: [PATCH 040/580] docs update Former-commit-id: da10006200ec7ae574342c95b0f52e177878fb70 --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4e6e3ed4..4a5be2f0 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,9 @@ Also, Vishaps are known in tales, fiction. This page refers to some technologies How to use ========== -As we said previously, voc is installed in /opt/voc/bin if you did not change the prefix. +First you need to [build](https://github.com/norayr/voc/blob/master/COMPILE) it. + +As it is stated in [COMPILE](https://github.com/norayr/voc/blob/master/COMPILE) page, voc is installed in /opt/voc/bin if you did not change the prefix. So, in order to run voc you need to type >/opt/voc/bin/voc From e4d62c14190feace54b66837874caef2da436a37 Mon Sep 17 00:00:00 2001 From: norayr Date: Wed, 13 Jan 2016 16:02:13 +0400 Subject: [PATCH 041/580] fix Former-commit-id: 4bdf3528c2ecae2374aeb704924a69305b318658 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4a5be2f0..2097dea6 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Vishap oberon compiler ====================== -(â±±ishap Oberon Compiler](http://oberon.vishap.am) (voc) is a free (GPLv3) professional oberon-2 compiler. +[â±±ishap Oberon Compiler](http://oberon.vishap.am) (voc) is a free (GPLv3) professional oberon-2 compiler. Platforms: ========= From b9676648c4b04db1d3e154819b9cf23fcfdd0dbc Mon Sep 17 00:00:00 2001 From: norayr Date: Wed, 13 Jan 2016 16:03:23 +0400 Subject: [PATCH 042/580] added openbsd Former-commit-id: 1d89d43a9bc26bbf2a2dd201168d2144fa21fa34 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2097dea6..6350a326 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ By using currently stable C backend voc is relatively easy to port to any platfo Operating Systems: ================== -Currently only GNU/Linux, Mac OS X and FreeBSD sources (with bootstrap binaries) are published. +Currently GNU/Linux, Mac OS X, FreeBSD and OpenBSD sources (with bootstrap binaries) are published. Ports to Solaris, AIX will be made and published in case there is an interest from community. voc should work on MS Windows/ReactOS via Cygwin/gcc, however we did not test it on Windows compatible machine. From 0bd38727b760a4b17ab326436fb430a4b5792156 Mon Sep 17 00:00:00 2001 From: norayr Date: Wed, 13 Jan 2016 16:05:38 +0400 Subject: [PATCH 043/580] code Former-commit-id: a1e328df71183c99f4b6df1269b40789262c0e9b --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6350a326..e176c463 100644 --- a/README.md +++ b/README.md @@ -75,13 +75,15 @@ Simple example Let's write hello world file: -$ cat hey.Mod +>$ cat hey.Mod + MODULE hey; IMPORT Console; BEGIN Console.String("hey there"); Console.Ln END hey. + >voc -M hey.Mod From 7ef2017a7cd802dcbdd43315bb0d86d62e038b5c Mon Sep 17 00:00:00 2001 From: norayr Date: Wed, 13 Jan 2016 16:06:31 +0400 Subject: [PATCH 044/580] spaces Former-commit-id: eeb2006ca8007dc48eed9baadcee4982e107fad2 --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index e176c463..2e903100 100644 --- a/README.md +++ b/README.md @@ -78,11 +78,11 @@ Let's write hello world file: >$ cat hey.Mod -MODULE hey; -IMPORT Console; -BEGIN -Console.String("hey there"); Console.Ln -END hey. +MODULE hey; +IMPORT Console; +BEGIN +Console.String("hey there"); Console.Ln +END hey. >voc -M hey.Mod From c64f107f80e4580f5333984257720116b14b6a0c Mon Sep 17 00:00:00 2001 From: norayr Date: Wed, 13 Jan 2016 16:07:39 +0400 Subject: [PATCH 045/580] source of example Former-commit-id: 00eb04bf2d4b5945dfc23470415f5526281d9e6f --- README.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2e903100..028e6930 100644 --- a/README.md +++ b/README.md @@ -79,9 +79,13 @@ Let's write hello world file: MODULE hey; -IMPORT Console; + + IMPORT Console; + BEGIN -Console.String("hey there"); Console.Ln + + Console.String("hey there"); Console.Ln + END hey. From eca49ba0a41e0080e178394dba1fa8a27fc281ca Mon Sep 17 00:00:00 2001 From: norayr Date: Fri, 15 Jan 2016 13:52:34 +0400 Subject: [PATCH 046/580] fixed link in the readme Former-commit-id: bfbd8cd87dd9cf84cfaa62aea3cf7e01a14ef05a --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 028e6930..2e018dfc 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ Naming: Vishaps are dragons inhabited in Armenian Highlands. We decided to name the project “Vishap†because ties between compilers and dragons have ancient traditions. -Also, Vishaps are known in tales, fiction. This page refers to some technologies as “computer science fictionâ€. Among them to Oberon. This brings another meaning, Oberon is like aliens, ghosts. And Vishaps. +Also, Vishaps are known in tales, fiction. [This page](http://blog.fogus.me/2015/04/27/six-works-of-computer-science-fiction/) refers to some technologies as “computer science fictionâ€. Among them to Oberon. This brings another meaning, Oberon is like aliens, ghosts. And Vishaps. How to use From e5f0949578b9801907cbdcfe5398d4983d6a5f17 Mon Sep 17 00:00:00 2001 From: norayr Date: Fri, 15 Jan 2016 13:55:40 +0400 Subject: [PATCH 047/580] yet another readme fix. Former-commit-id: 9293edffacd2be1fd3dd61ef8a114023903e90c4 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2e018dfc..c090fcc6 100644 --- a/README.md +++ b/README.md @@ -100,7 +100,7 @@ will link the module dynamically. Example with two modules ==================== -If you have more than one module, and you want them to be compiled into elf filethen: +If you have more than one module, and you want them to be compiled in to elf file then: Let's assume we have module M0 which imports M1; >voc -l M1.Mod -s M0.Mod -M From bac3c2cb49e817d2580e700f5c5e1ca474ad37f6 Mon Sep 17 00:00:00 2001 From: norayr Date: Sat, 16 Jan 2016 01:09:32 +0400 Subject: [PATCH 048/580] apparently, openbsd bootstrap binary was not added to the git. (: Former-commit-id: 02a909696d0d60377099e957f56fa7fb9e51cf4c --- 05vishap.conf | 2 +- src/lib/ooc/openbsd/{clang => gcc}/x86_64/oocC.Mod | 0 src/lib/ooc2/openbsd/{clang => gcc}/oocwrapperlibc.Mod | 0 src/voc/prf.Mod | 2 +- vocstatic.openbsd.gcc.x86_64.REMOVED.git-id | 1 + 5 files changed, 3 insertions(+), 2 deletions(-) rename src/lib/ooc/openbsd/{clang => gcc}/x86_64/oocC.Mod (100%) rename src/lib/ooc2/openbsd/{clang => gcc}/oocwrapperlibc.Mod (100%) create mode 100644 vocstatic.openbsd.gcc.x86_64.REMOVED.git-id diff --git a/05vishap.conf b/05vishap.conf index 29efccf6..88a0e25c 100644 --- a/05vishap.conf +++ b/05vishap.conf @@ -1 +1 @@ -/home/noch/local/voc-1.1/lib +/opt/voc-1.1/lib diff --git a/src/lib/ooc/openbsd/clang/x86_64/oocC.Mod b/src/lib/ooc/openbsd/gcc/x86_64/oocC.Mod similarity index 100% rename from src/lib/ooc/openbsd/clang/x86_64/oocC.Mod rename to src/lib/ooc/openbsd/gcc/x86_64/oocC.Mod diff --git a/src/lib/ooc2/openbsd/clang/oocwrapperlibc.Mod b/src/lib/ooc2/openbsd/gcc/oocwrapperlibc.Mod similarity index 100% rename from src/lib/ooc2/openbsd/clang/oocwrapperlibc.Mod rename to src/lib/ooc2/openbsd/gcc/oocwrapperlibc.Mod diff --git a/src/voc/prf.Mod b/src/voc/prf.Mod index 20fb1a8c..2f4d8f24 100644 --- a/src/voc/prf.Mod +++ b/src/voc/prf.Mod @@ -1,5 +1,5 @@ MODULE prf; -CONST prefix* = "/home/noch/local"; +CONST prefix* = "/opt"; END prf. diff --git a/vocstatic.openbsd.gcc.x86_64.REMOVED.git-id b/vocstatic.openbsd.gcc.x86_64.REMOVED.git-id new file mode 100644 index 00000000..91ca8201 --- /dev/null +++ b/vocstatic.openbsd.gcc.x86_64.REMOVED.git-id @@ -0,0 +1 @@ +2e9bc38cd6d5b9a5add0c8371ca1304a2c4d2189 \ No newline at end of file From f05ecf61022de922607f9dd6fa6b83f3ec56552c Mon Sep 17 00:00:00 2001 From: Norayr Chilingarian Date: Tue, 19 Jan 2016 16:54:26 +0400 Subject: [PATCH 049/580] Unix.Timeval fix. suseconds_t is 4 bytes on osx x86_64 apparently. Therefore Timeval.usec is INTEGER. Thanks to Jon Kleiser for [raising](https://github.com/norayr/voc/issues/5) the question. bootstrap binary updated. Kernel0. Kernel modules affected. -- noch Former-commit-id: 177f08f0e0e37f9c7ba9d08a91da7c08006c92a4 --- 05vishap.conf | 2 +- makefile.darwin.clang.x86_64 | 3 ++- src/lib/system/darwin/clang/Kernel.Mod | 2 +- src/lib/system/darwin/clang/Kernel0.Mod | 2 +- src/lib/system/darwin/clang/x86_64/Unix.Mod | 3 ++- src/voc/prf.Mod | 2 +- vocstatic.darwin.clang.x86_64.REMOVED.git-id | 2 +- 7 files changed, 9 insertions(+), 7 deletions(-) diff --git a/05vishap.conf b/05vishap.conf index 88a0e25c..6d52bd32 100644 --- a/05vishap.conf +++ b/05vishap.conf @@ -1 +1 @@ -/opt/voc-1.1/lib +/Users/antranigv/local/voc-1.1/lib diff --git a/makefile.darwin.clang.x86_64 b/makefile.darwin.clang.x86_64 index 10309ead..ca070228 100644 --- a/makefile.darwin.clang.x86_64 +++ b/makefile.darwin.clang.x86_64 @@ -20,8 +20,9 @@ LIBNAME = VishapOberon LIBRARY = lib$(LIBNAME) ifndef PRF -PRF = "/opt" +#PRF = "/opt" #PRF = "/Users/noch/local" +PRF = "/Users/antranigv/local" endif PREFIX = $(PRF)/voc-$(RELEASE) PREFIXLN = $(PRF)/voc diff --git a/src/lib/system/darwin/clang/Kernel.Mod b/src/lib/system/darwin/clang/Kernel.Mod index 4fa025ab..f49d9b0c 100644 --- a/src/lib/system/darwin/clang/Kernel.Mod +++ b/src/lib/system/darwin/clang/Kernel.Mod @@ -118,7 +118,7 @@ MODULE Kernel; rs := readSet; FOR n := 0 TO 7 DO ws[n] := {}; xs[n] := {}; readySet[n] := {} END; IF delay < 0 THEN delay := 0 END ; - tv.sec := delay DIV 1000; tv.usec := delay MOD 1000 * 1000; + tv.sec := delay DIV 1000; tv.usec := SHORT(delay MOD 1000 * 1000); n := Unix.Select(256, rs, ws, xs, tv); IF n >= 0 THEN readySet := rs END END Select; diff --git a/src/lib/system/darwin/clang/Kernel0.Mod b/src/lib/system/darwin/clang/Kernel0.Mod index 6a58650f..70fe38f1 100644 --- a/src/lib/system/darwin/clang/Kernel0.Mod +++ b/src/lib/system/darwin/clang/Kernel0.Mod @@ -122,7 +122,7 @@ MODULE Kernel0; rs := readSet; FOR n := 0 TO 7 DO ws[n] := {}; xs[n] := {}; readySet[n] := {} END; IF delay < 0 THEN delay := 0 END ; - tv.sec := delay DIV 1000; tv.usec := delay MOD 1000 * 1000; + tv.sec := delay DIV 1000; tv.usec := SHORT(delay MOD 1000 * 1000); n := Unix.Select(256, rs, ws, xs, tv); IF n >= 0 THEN readySet := rs END END Select; diff --git a/src/lib/system/darwin/clang/x86_64/Unix.Mod b/src/lib/system/darwin/clang/x86_64/Unix.Mod index a7e4335b..012042a0 100644 --- a/src/lib/system/darwin/clang/x86_64/Unix.Mod +++ b/src/lib/system/darwin/clang/x86_64/Unix.Mod @@ -196,7 +196,8 @@ struct timeval *) Timeval* = RECORD - sec*, usec*: LONGINT + sec*: LONGINT; + usec*: INTEGER END ; diff --git a/src/voc/prf.Mod b/src/voc/prf.Mod index 2f4d8f24..c6ebba38 100644 --- a/src/voc/prf.Mod +++ b/src/voc/prf.Mod @@ -1,5 +1,5 @@ MODULE prf; -CONST prefix* = "/opt"; +CONST prefix* = "/Users/antranigv/local"; END prf. diff --git a/vocstatic.darwin.clang.x86_64.REMOVED.git-id b/vocstatic.darwin.clang.x86_64.REMOVED.git-id index ff1813f0..b76b930a 100644 --- a/vocstatic.darwin.clang.x86_64.REMOVED.git-id +++ b/vocstatic.darwin.clang.x86_64.REMOVED.git-id @@ -1 +1 @@ -8e48e37af1816a7bada0630583b22d2550196738 \ No newline at end of file +7aa2656d3ae7174c5bac1990daf5baac79ad3ad7 \ No newline at end of file From 63ba3074cf9dc3d253faafd7cd668c4364c69acc Mon Sep 17 00:00:00 2001 From: Norayr Chilingarian Date: Tue, 19 Jan 2016 17:05:23 +0400 Subject: [PATCH 050/580] reverted darwin makefile by fixing default prefix. -- noch Former-commit-id: 9fc7d7b6c480bacc01f93f1c819f7b7642e42bc4 --- makefile.darwin.clang.x86_64 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/makefile.darwin.clang.x86_64 b/makefile.darwin.clang.x86_64 index ca070228..10309ead 100644 --- a/makefile.darwin.clang.x86_64 +++ b/makefile.darwin.clang.x86_64 @@ -20,9 +20,8 @@ LIBNAME = VishapOberon LIBRARY = lib$(LIBNAME) ifndef PRF -#PRF = "/opt" +PRF = "/opt" #PRF = "/Users/noch/local" -PRF = "/Users/antranigv/local" endif PREFIX = $(PRF)/voc-$(RELEASE) PREFIXLN = $(PRF)/voc From f3790d78f5ae495626542c3150ef4e6468ac7038 Mon Sep 17 00:00:00 2001 From: Norayr Chilingarian Date: Tue, 19 Jan 2016 19:07:36 +0400 Subject: [PATCH 051/580] fixed makefile name in the "COMPILE" file. [issue](https://github.com/norayr/voc/issues/6); -- noch Former-commit-id: e403827d4660bd70f76fc71c372bd722992f1b06 --- COMPILE | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/COMPILE b/COMPILE index 827a3cf6..ac194fd7 100644 --- a/COMPILE +++ b/COMPILE @@ -39,14 +39,14 @@ otherwise use corresponding makefile. Note for FreeBSD, OpenBSD and OSX users: use gmake instead of make, i. e. ->gmake -f makefile.clang.darwin.x86_64 +>gmake -f makefile.darwin.clang.x86_64 then type >sudo make install or ->sudo gmake -f makefile.clang.darwin.x86_64 install +>sudo gmake -f makefile.darwin.clang.x86_64 install on MacOSX/Darwin. From 4838e919666ca52e8ae925348c4c7bc5423f4fdb Mon Sep 17 00:00:00 2001 From: Norayr Chilingarian Date: Fri, 22 Jan 2016 01:16:08 +0400 Subject: [PATCH 052/580] s/ooc/voc -- noch Former-commit-id: bdf7be9896a5c74170ab6b35df5269ab03a0ab08 --- src/test/gtk/gui.glade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/gtk/gui.glade b/src/test/gtk/gui.glade index e90f3634..b152f480 100644 --- a/src/test/gtk/gui.glade +++ b/src/test/gtk/gui.glade @@ -7,7 +7,7 @@ 150 True False - OOC-Glade-Test + voc-glade-test False From 29910268093bc1ec92fd0f9db0f981d155004fb3 Mon Sep 17 00:00:00 2001 From: Norayr Chilingarian Date: Thu, 4 Feb 2016 01:27:29 +0400 Subject: [PATCH 053/580] added problematic ubuntu version to faq file Former-commit-id: 5f80704eb0feffdf11d42f1aee7671639b209c55 --- 05vishap.conf | 2 +- FAQ.md | 2 +- src/voc/prf.Mod | 2 +- vocstatic.linux.gcc.x86_64.REMOVED.git-id | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/05vishap.conf b/05vishap.conf index 6d52bd32..88a0e25c 100644 --- a/05vishap.conf +++ b/05vishap.conf @@ -1 +1 @@ -/Users/antranigv/local/voc-1.1/lib +/opt/voc-1.1/lib diff --git a/FAQ.md b/FAQ.md index 7c21376a..805f2bec 100644 --- a/FAQ.md +++ b/FAQ.md @@ -10,7 +10,7 @@ In case you still want to use line numbers then pass -l option to voc voc -ls m.Mod -compilation crashes on ARM or Raspberry Pi with recent (like 3.12) kernels. +compilation crashes on Ubuntu 15.10 x86_64 or latest Raspbians on Raspberry Pi with recent (like 3.12) kernels. =========================================================================== > echo 1 > /proc/sys/vm/legacy_va_layout diff --git a/src/voc/prf.Mod b/src/voc/prf.Mod index c6ebba38..2f4d8f24 100644 --- a/src/voc/prf.Mod +++ b/src/voc/prf.Mod @@ -1,5 +1,5 @@ MODULE prf; -CONST prefix* = "/Users/antranigv/local"; +CONST prefix* = "/opt"; END prf. diff --git a/vocstatic.linux.gcc.x86_64.REMOVED.git-id b/vocstatic.linux.gcc.x86_64.REMOVED.git-id index 4e53133c..bbe193b7 100644 --- a/vocstatic.linux.gcc.x86_64.REMOVED.git-id +++ b/vocstatic.linux.gcc.x86_64.REMOVED.git-id @@ -1 +1 @@ -7fb043555ff9a58049dfa0758bc95ce058c619e1 \ No newline at end of file +d4650157c77c72a0f43b28452babbec30602500a \ No newline at end of file From aeadd58952fc6939c012e6547ca5ae92c9434d41 Mon Sep 17 00:00:00 2001 From: norayr Date: Wed, 24 Feb 2016 15:21:16 +0400 Subject: [PATCH 054/580] fixed Oberon.Mod; now Oberon.DumpLog works. Former-commit-id: 4e2da4f92e77fcce3db1291cbfafd2f430d7bac9 --- src/lib/v4_compat/Oberon.Mod | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/src/lib/v4_compat/Oberon.Mod b/src/lib/v4_compat/Oberon.Mod index 3a8038c0..1a0c8c69 100644 --- a/src/lib/v4_compat/Oberon.Mod +++ b/src/lib/v4_compat/Oberon.Mod @@ -52,7 +52,7 @@ MODULE Oberon; Texts.Append (Par^.text, W.buf); END PopulateParams; - +(* PROCEDURE DumpLog*; VAR R : Texts.Reader; ch : CHAR; @@ -64,6 +64,35 @@ MODULE Oberon; Out.Char(ch); UNTIL R.eot; END DumpLog; +*) + +PROCEDURE TextToString(VAR T : Texts.Text; VAR string : ARRAY OF CHAR); + VAR R : Texts.Reader; + ch : CHAR; + i : LONGINT; +BEGIN + COPY("", string); + Texts.OpenReader(R, T, 0); + i := 0; + WHILE Texts.Pos(R) < T.len DO + Texts.Read(R, ch); + string[i] := ch; + INC(i); + END; + (*string[i] := 0X;*) +END TextToString; + +PROCEDURE DumpLog*; +VAR s : POINTER TO ARRAY OF CHAR; +BEGIN + NEW(s, Log.len + 1); + COPY("", s^); + TextToString(Log, s^); + Out.String(s^); Out.Ln; + + NEW(Log); + Texts.Open(Log, ""); +END DumpLog; BEGIN NEW(Par); @@ -72,4 +101,6 @@ BEGIN OptionChar := '-'; Texts.Open(Par.text, ""); PopulateParams; + NEW(Log); + Texts.Open(Log, ""); END Oberon. From 042ff66d148296204b7e56325601a14bfd082dcb Mon Sep 17 00:00:00 2001 From: Norayr Chilingarian Date: Mon, 2 May 2016 03:13:04 +0400 Subject: [PATCH 055/580] added -fno-stack-protector to linux gcc makefiles. -- noch Former-commit-id: 7f6c73341414af134c2ae23cd5dab5629d0d5fe5 --- makefile | 2 +- makefile.linux.gcc.armv6j_hardfp | 2 +- makefile.linux.gcc.powerpc | 2 +- makefile.linux.gcc.x86 | 2 +- makefile.linux.gcc.x86_64 | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/makefile b/makefile index c9399316..e0513400 100644 --- a/makefile +++ b/makefile @@ -25,7 +25,7 @@ endif PREFIX = $(PRF)/voc-$(RELEASE) PREFIXLN = $(PRF)/voc -CCOPT = -fPIC $(INCLUDEPATH) -g +CCOPT = -fPIC $(INCLUDEPATH) -g -fno-stack-protector SHRLIBEXT = so CC = $(CCOMP) $(CCOPT) -c CL = $(CCOMP) $(CCOPT) diff --git a/makefile.linux.gcc.armv6j_hardfp b/makefile.linux.gcc.armv6j_hardfp index ed5c0a12..10d6cc29 100644 --- a/makefile.linux.gcc.armv6j_hardfp +++ b/makefile.linux.gcc.armv6j_hardfp @@ -25,7 +25,7 @@ endif PREFIX = $(PRF)/voc-$(RELEASE) PREFIXLN = $(PRF)/voc -CCOPT = -fPIC $(INCLUDEPATH) -g +CCOPT = -fPIC $(INCLUDEPATH) -g -fno-stack-protector SHRLIBEXT = so CC = $(CCOMP) $(CCOPT) -c CL = $(CCOMP) $(CCOPT) diff --git a/makefile.linux.gcc.powerpc b/makefile.linux.gcc.powerpc index f07c1d54..547ba913 100644 --- a/makefile.linux.gcc.powerpc +++ b/makefile.linux.gcc.powerpc @@ -25,7 +25,7 @@ endif PREFIX = $(PRF)/voc-$(RELEASE) PREFIXLN = $(PRF)/voc -CCOPT = -fPIC $(INCLUDEPATH) -g +CCOPT = -fPIC $(INCLUDEPATH) -g -fno-stack-protector SHRLIBEXT = so CC = $(CCOMP) $(CCOPT) -c CL = $(CCOMP) $(CCOPT) diff --git a/makefile.linux.gcc.x86 b/makefile.linux.gcc.x86 index 8edf3cd8..f283a0dc 100644 --- a/makefile.linux.gcc.x86 +++ b/makefile.linux.gcc.x86 @@ -25,7 +25,7 @@ endif PREFIX = $(PRF)/voc-$(RELEASE) PREFIXLN = $(PRF)/voc -CCOPT = -fPIC $(INCLUDEPATH) -g +CCOPT = -fPIC $(INCLUDEPATH) -g -fno-stack-protector SHRLIBEXT = so CC = $(CCOMP) $(CCOPT) -c CL = $(CCOMP) $(CCOPT) diff --git a/makefile.linux.gcc.x86_64 b/makefile.linux.gcc.x86_64 index c9399316..e0513400 100644 --- a/makefile.linux.gcc.x86_64 +++ b/makefile.linux.gcc.x86_64 @@ -25,7 +25,7 @@ endif PREFIX = $(PRF)/voc-$(RELEASE) PREFIXLN = $(PRF)/voc -CCOPT = -fPIC $(INCLUDEPATH) -g +CCOPT = -fPIC $(INCLUDEPATH) -g -fno-stack-protector SHRLIBEXT = so CC = $(CCOMP) $(CCOPT) -c CL = $(CCOMP) $(CCOPT) From 593774a3fc7e31b6a38c604fdd602069b252e3c2 Mon Sep 17 00:00:00 2001 From: David C W Brown Date: Wed, 15 Jun 2016 14:06:49 +0100 Subject: [PATCH 056/580] Remove latest vocstatic binaries Former-commit-id: 0af64a79258a79a5882d95dffd0b656be56dc472 --- vocstatic.darwin.clang.x86_64.REMOVED.git-id | 1 - vocstatic.freebsd.clang.x86_64.REMOVED.git-id | 1 - vocstatic.linux.clang.powerpc.REMOVED.git-id | 1 - vocstatic.linux.clang.x86_64.REMOVED.git-id | 1 - vocstatic.linux.gcc.armv6j_hardfp.REMOVED.git-id | 1 - vocstatic.linux.gcc.powerpc.REMOVED.git-id | 1 - vocstatic.linux.gcc.x86.REMOVED.git-id | 1 - vocstatic.linux.gcc.x86_64.REMOVED.git-id | 1 - vocstatic.openbsd.gcc.x86_64.REMOVED.git-id | 1 - 9 files changed, 9 deletions(-) delete mode 100644 vocstatic.darwin.clang.x86_64.REMOVED.git-id delete mode 100644 vocstatic.freebsd.clang.x86_64.REMOVED.git-id delete mode 100644 vocstatic.linux.clang.powerpc.REMOVED.git-id delete mode 100644 vocstatic.linux.clang.x86_64.REMOVED.git-id delete mode 100644 vocstatic.linux.gcc.armv6j_hardfp.REMOVED.git-id delete mode 100644 vocstatic.linux.gcc.powerpc.REMOVED.git-id delete mode 100644 vocstatic.linux.gcc.x86.REMOVED.git-id delete mode 100644 vocstatic.linux.gcc.x86_64.REMOVED.git-id delete mode 100644 vocstatic.openbsd.gcc.x86_64.REMOVED.git-id diff --git a/vocstatic.darwin.clang.x86_64.REMOVED.git-id b/vocstatic.darwin.clang.x86_64.REMOVED.git-id deleted file mode 100644 index b76b930a..00000000 --- a/vocstatic.darwin.clang.x86_64.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -7aa2656d3ae7174c5bac1990daf5baac79ad3ad7 \ No newline at end of file diff --git a/vocstatic.freebsd.clang.x86_64.REMOVED.git-id b/vocstatic.freebsd.clang.x86_64.REMOVED.git-id deleted file mode 100644 index 6f361818..00000000 --- a/vocstatic.freebsd.clang.x86_64.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -07680f59739d1b75018d64a9b1e7cb438ef93411 \ No newline at end of file diff --git a/vocstatic.linux.clang.powerpc.REMOVED.git-id b/vocstatic.linux.clang.powerpc.REMOVED.git-id deleted file mode 100644 index 89beeed3..00000000 --- a/vocstatic.linux.clang.powerpc.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -2f4dc20af5c16d407874c567be2a8e38066415a5 \ No newline at end of file diff --git a/vocstatic.linux.clang.x86_64.REMOVED.git-id b/vocstatic.linux.clang.x86_64.REMOVED.git-id deleted file mode 100644 index c5568552..00000000 --- a/vocstatic.linux.clang.x86_64.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -60f429e97d6f7f05367e3cb1a2b8ac20f78add86 \ No newline at end of file diff --git a/vocstatic.linux.gcc.armv6j_hardfp.REMOVED.git-id b/vocstatic.linux.gcc.armv6j_hardfp.REMOVED.git-id deleted file mode 100644 index e0ea9177..00000000 --- a/vocstatic.linux.gcc.armv6j_hardfp.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -3565dfed925394e3550b0435679db32ced7e5274 \ No newline at end of file diff --git a/vocstatic.linux.gcc.powerpc.REMOVED.git-id b/vocstatic.linux.gcc.powerpc.REMOVED.git-id deleted file mode 100644 index 48ac8ce1..00000000 --- a/vocstatic.linux.gcc.powerpc.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -a5546b6a3b8c855488524311e30f59082e8b0896 \ No newline at end of file diff --git a/vocstatic.linux.gcc.x86.REMOVED.git-id b/vocstatic.linux.gcc.x86.REMOVED.git-id deleted file mode 100644 index 73263b3c..00000000 --- a/vocstatic.linux.gcc.x86.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -aa000f8331215f4a722bf96a6914775e7b9a037f \ No newline at end of file diff --git a/vocstatic.linux.gcc.x86_64.REMOVED.git-id b/vocstatic.linux.gcc.x86_64.REMOVED.git-id deleted file mode 100644 index bbe193b7..00000000 --- a/vocstatic.linux.gcc.x86_64.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -d4650157c77c72a0f43b28452babbec30602500a \ No newline at end of file diff --git a/vocstatic.openbsd.gcc.x86_64.REMOVED.git-id b/vocstatic.openbsd.gcc.x86_64.REMOVED.git-id deleted file mode 100644 index 91ca8201..00000000 --- a/vocstatic.openbsd.gcc.x86_64.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -2e9bc38cd6d5b9a5add0c8371ca1304a2c4d2189 \ No newline at end of file From ead30cb27b73f650ddef6afa95f36a92d36ba622 Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 16 Jun 2016 11:52:06 +0100 Subject: [PATCH 057/580] Begin update to V2. Move old files to triage. --- 05vishap.conf => triage/05vishap.conf | 0 CHANGES.md => triage/CHANGES.md | 0 CHANGES0.md => triage/CHANGES0.md | 0 COMPILE => triage/COMPILE | 0 FAQ.md => triage/FAQ.md | 0 README.md => triage/README.md | 0 gen_changelog.sh => triage/gen_changelog.sh | 0 hints => triage/hints | 0 makefile => triage/makefile | 0 .../makefile.darwin.clang.x86_64 | 0 .../makefile.freebsd.clang.x86_64 | 0 .../makefile.linux.clang.powerpc | 0 makefile.linux.clang.x86_64 => triage/makefile.linux.clang.x86_64 | 0 .../makefile.linux.gcc.armv6j_hardfp | 0 makefile.linux.gcc.powerpc => triage/makefile.linux.gcc.powerpc | 0 makefile.linux.gcc.x86 => triage/makefile.linux.gcc.x86 | 0 makefile.linux.gcc.x86_64 => triage/makefile.linux.gcc.x86_64 | 0 makefile.openbsd.gcc.x86_64 => triage/makefile.openbsd.gcc.x86_64 | 0 quick_start => triage/quick_start | 0 voc.spec => triage/voc.spec | 0 20 files changed, 0 insertions(+), 0 deletions(-) rename 05vishap.conf => triage/05vishap.conf (100%) rename CHANGES.md => triage/CHANGES.md (100%) rename CHANGES0.md => triage/CHANGES0.md (100%) rename COMPILE => triage/COMPILE (100%) rename FAQ.md => triage/FAQ.md (100%) rename README.md => triage/README.md (100%) rename gen_changelog.sh => triage/gen_changelog.sh (100%) rename hints => triage/hints (100%) rename makefile => triage/makefile (100%) rename makefile.darwin.clang.x86_64 => triage/makefile.darwin.clang.x86_64 (100%) rename makefile.freebsd.clang.x86_64 => triage/makefile.freebsd.clang.x86_64 (100%) rename makefile.linux.clang.powerpc => triage/makefile.linux.clang.powerpc (100%) rename makefile.linux.clang.x86_64 => triage/makefile.linux.clang.x86_64 (100%) rename makefile.linux.gcc.armv6j_hardfp => triage/makefile.linux.gcc.armv6j_hardfp (100%) rename makefile.linux.gcc.powerpc => triage/makefile.linux.gcc.powerpc (100%) rename makefile.linux.gcc.x86 => triage/makefile.linux.gcc.x86 (100%) rename makefile.linux.gcc.x86_64 => triage/makefile.linux.gcc.x86_64 (100%) rename makefile.openbsd.gcc.x86_64 => triage/makefile.openbsd.gcc.x86_64 (100%) rename quick_start => triage/quick_start (100%) rename voc.spec => triage/voc.spec (100%) diff --git a/05vishap.conf b/triage/05vishap.conf similarity index 100% rename from 05vishap.conf rename to triage/05vishap.conf diff --git a/CHANGES.md b/triage/CHANGES.md similarity index 100% rename from CHANGES.md rename to triage/CHANGES.md diff --git a/CHANGES0.md b/triage/CHANGES0.md similarity index 100% rename from CHANGES0.md rename to triage/CHANGES0.md diff --git a/COMPILE b/triage/COMPILE similarity index 100% rename from COMPILE rename to triage/COMPILE diff --git a/FAQ.md b/triage/FAQ.md similarity index 100% rename from FAQ.md rename to triage/FAQ.md diff --git a/README.md b/triage/README.md similarity index 100% rename from README.md rename to triage/README.md diff --git a/gen_changelog.sh b/triage/gen_changelog.sh similarity index 100% rename from gen_changelog.sh rename to triage/gen_changelog.sh diff --git a/hints b/triage/hints similarity index 100% rename from hints rename to triage/hints diff --git a/makefile b/triage/makefile similarity index 100% rename from makefile rename to triage/makefile diff --git a/makefile.darwin.clang.x86_64 b/triage/makefile.darwin.clang.x86_64 similarity index 100% rename from makefile.darwin.clang.x86_64 rename to triage/makefile.darwin.clang.x86_64 diff --git a/makefile.freebsd.clang.x86_64 b/triage/makefile.freebsd.clang.x86_64 similarity index 100% rename from makefile.freebsd.clang.x86_64 rename to triage/makefile.freebsd.clang.x86_64 diff --git a/makefile.linux.clang.powerpc b/triage/makefile.linux.clang.powerpc similarity index 100% rename from makefile.linux.clang.powerpc rename to triage/makefile.linux.clang.powerpc diff --git a/makefile.linux.clang.x86_64 b/triage/makefile.linux.clang.x86_64 similarity index 100% rename from makefile.linux.clang.x86_64 rename to triage/makefile.linux.clang.x86_64 diff --git a/makefile.linux.gcc.armv6j_hardfp b/triage/makefile.linux.gcc.armv6j_hardfp similarity index 100% rename from makefile.linux.gcc.armv6j_hardfp rename to triage/makefile.linux.gcc.armv6j_hardfp diff --git a/makefile.linux.gcc.powerpc b/triage/makefile.linux.gcc.powerpc similarity index 100% rename from makefile.linux.gcc.powerpc rename to triage/makefile.linux.gcc.powerpc diff --git a/makefile.linux.gcc.x86 b/triage/makefile.linux.gcc.x86 similarity index 100% rename from makefile.linux.gcc.x86 rename to triage/makefile.linux.gcc.x86 diff --git a/makefile.linux.gcc.x86_64 b/triage/makefile.linux.gcc.x86_64 similarity index 100% rename from makefile.linux.gcc.x86_64 rename to triage/makefile.linux.gcc.x86_64 diff --git a/makefile.openbsd.gcc.x86_64 b/triage/makefile.openbsd.gcc.x86_64 similarity index 100% rename from makefile.openbsd.gcc.x86_64 rename to triage/makefile.openbsd.gcc.x86_64 diff --git a/quick_start b/triage/quick_start similarity index 100% rename from quick_start rename to triage/quick_start diff --git a/voc.spec b/triage/voc.spec similarity index 100% rename from voc.spec rename to triage/voc.spec From 9cc63cc6c272f7c63713e3486253fd9e15893a2b Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 16 Jun 2016 12:06:42 +0100 Subject: [PATCH 058/580] Compiler source directory: consolidate duplicate files. --- src/voc/{voc.Mod => Vishap.Mod} | 0 src/voc/darwin/clang/extTools.Mod | 105 ------------------ src/voc/darwin/clang/x86_64/architecture.Mod | 4 - src/voc/{linux/gcc => }/extTools.Mod | 0 src/voc/freebsd/clang/extTools.Mod | 88 --------------- src/voc/freebsd/clang/x86_64/architecture.Mod | 4 - src/voc/linux/clang/armv6j/architecture.Mod | 4 - .../clang/armv6j_hardfp/architecture.Mod | 4 - .../clang/armv7a_hardfp/architecture.Mod | 4 - src/voc/linux/clang/extTools.Mod | 88 --------------- src/voc/linux/clang/powerpc/architecture.Mod | 4 - src/voc/linux/clang/x86/architecture.Mod | 4 - src/voc/linux/clang/x86_64/architecture.Mod | 4 - src/voc/linux/gcc/armv6j/architecture.Mod | 4 - .../linux/gcc/armv6j_hardfp/architecture.Mod | 4 - .../linux/gcc/armv7a_hardfp/architecture.Mod | 4 - src/voc/linux/gcc/powerpc/architecture.Mod | 4 - src/voc/linux/gcc/x86/architecture.Mod | 4 - src/voc/linux/gcc/x86_64/architecture.Mod | 4 - src/voc/openbsd/gcc/extTools.Mod | 88 --------------- src/voc/openbsd/gcc/x86_64/architecture.Mod | 4 - src/voc/prf.Mod | 5 - src/voc/prf.Mod_default | 5 - src/voc/version.Mod | 41 ------- 24 files changed, 480 deletions(-) rename src/voc/{voc.Mod => Vishap.Mod} (100%) delete mode 100644 src/voc/darwin/clang/extTools.Mod delete mode 100644 src/voc/darwin/clang/x86_64/architecture.Mod rename src/voc/{linux/gcc => }/extTools.Mod (100%) delete mode 100644 src/voc/freebsd/clang/extTools.Mod delete mode 100644 src/voc/freebsd/clang/x86_64/architecture.Mod delete mode 100644 src/voc/linux/clang/armv6j/architecture.Mod delete mode 100644 src/voc/linux/clang/armv6j_hardfp/architecture.Mod delete mode 100644 src/voc/linux/clang/armv7a_hardfp/architecture.Mod delete mode 100644 src/voc/linux/clang/extTools.Mod delete mode 100644 src/voc/linux/clang/powerpc/architecture.Mod delete mode 100644 src/voc/linux/clang/x86/architecture.Mod delete mode 100644 src/voc/linux/clang/x86_64/architecture.Mod delete mode 100644 src/voc/linux/gcc/armv6j/architecture.Mod delete mode 100644 src/voc/linux/gcc/armv6j_hardfp/architecture.Mod delete mode 100644 src/voc/linux/gcc/armv7a_hardfp/architecture.Mod delete mode 100644 src/voc/linux/gcc/powerpc/architecture.Mod delete mode 100644 src/voc/linux/gcc/x86/architecture.Mod delete mode 100644 src/voc/linux/gcc/x86_64/architecture.Mod delete mode 100644 src/voc/openbsd/gcc/extTools.Mod delete mode 100644 src/voc/openbsd/gcc/x86_64/architecture.Mod delete mode 100644 src/voc/prf.Mod delete mode 100644 src/voc/prf.Mod_default delete mode 100644 src/voc/version.Mod diff --git a/src/voc/voc.Mod b/src/voc/Vishap.Mod similarity index 100% rename from src/voc/voc.Mod rename to src/voc/Vishap.Mod diff --git a/src/voc/darwin/clang/extTools.Mod b/src/voc/darwin/clang/extTools.Mod deleted file mode 100644 index a26e83a5..00000000 --- a/src/voc/darwin/clang/extTools.Mod +++ /dev/null @@ -1,105 +0,0 @@ -MODULE extTools; - IMPORT Args, Unix, Strings, Console, version; -(* -INCLUDEPATH = -Isrc/lib/system/linux/gnuc/x86_64 -CCOPT = -fPIC $(INCLUDEPATH) -g -CLOBERONOPTS = -fPIC $(INCLUDEPATH) -L. -L/usr/lib -lVishapOberon -static -g -CC = cc $(CCOPT) -c -*) -CONST compiler="clang"; - -VAR incPath0, incPath1, ccOpt, ccString, CFLAGS, tmp0, tmp1 : ARRAY 1023 OF CHAR; - -PROCEDURE Assemble*(m : ARRAY OF CHAR); -VAR cmd : ARRAY 1023 OF CHAR; -cc : ARRAY 1023 OF CHAR; -ext : ARRAY 5 OF CHAR; -BEGIN -COPY (ccString, cc); -Strings.Append (" -c ", cc); -COPY(cc, cmd); -Strings.Append (" ", cmd); -Strings.Append (ccOpt, cmd); -ext := ".c"; -Strings.Append (ext, m); -Strings.Append(m, cmd); -(*Console.Ln; Console.String (cmd); Console.Ln;*) -Unix.system(cmd); -END Assemble; - - -PROCEDURE LinkMain*(VAR m : ARRAY OF CHAR; statically : BOOLEAN; additionalopts : ARRAY OF CHAR); -VAR lpath : ARRAY 1023 OF CHAR; -cc : ARRAY 1023 OF CHAR; -ccopt : ARRAY 1023 OF CHAR; -cmd : ARRAY 1023 OF CHAR; -ext : ARRAY 5 OF CHAR; -cmd2 : ARRAY 1023 OF CHAR; -BEGIN -(* -gcc -g -o hello hello.c -I $RPATH/src/lib/system/linux/gnuc/x86_64 -I. -I$RPATH -lOberon -L. -L$RPATH -static -*) -cmd := ""; -cc := ""; -ext := ".c"; -COPY(ccString, cc); -COPY (cc, cmd); -Strings.Append(" ", cmd); -Strings.Append(m, cmd); -Strings.Append(ext, cmd); -Strings.Append(additionalopts, cmd); -Strings.Append(" ", cmd); -(*IF statically THEN Strings.Append(" -static ", cmd) END;*) -IF statically THEN - Strings.Append(version.prefix, cmd); - Strings.Append("/lib/libVishapOberon.a ", cmd); -END; -Strings.Append(" -o ", cmd); -Strings.Append(m, cmd); -Strings.Append(" ", cmd); -IF ~statically THEN -Strings.Append ("-lVishapOberon -L. -L", ccOpt); -Strings.Append (version.prefix, ccOpt); -Strings.Append ("/lib ", ccOpt); -END; -Strings.Append(ccOpt, cmd); - -Console.Ln; Console.String(cmd); Console.Ln; (* may be it's feasible to add debug mode later *) -Unix.system(cmd); - -IF ~statically THEN - cmd2 := ""; - COPY ("install_name_tool -change libVishapOberon.dylib ", cmd2); - Strings.Append(version.prefix, cmd2); - Strings.Append ("/lib/libVishapOberon.dylib ", cmd2); - Strings.Append (m, cmd2); - Console.String(cmd2); Console.Ln; - Unix.system(cmd2); - END -END LinkMain; - -BEGIN - -incPath0 := "src/lib/system/darwin/"; -Strings.Append (compiler, incPath0); -incPath1 := "lib/voc/obj "; -ccOpt := " -fPIC -g "; - -COPY ("-I ", tmp1); -Strings.Append (version.prefix, tmp1); -Strings.Append("/", tmp1); -Strings.Append(incPath0, tmp1); -Strings.Append("/", tmp1); -Strings.Append(version.arch, tmp1); -Strings.Append(" -I ", tmp1); -Strings.Append(version.prefix, tmp1); -Strings.Append("/", tmp1); -Strings.Append(incPath1, tmp1); -Strings.Append(tmp1, ccOpt); -Args.GetEnv("CFLAGS", CFLAGS); -Strings.Append (CFLAGS, ccOpt); -Strings.Append (" ", ccOpt); -ccString := compiler; -Strings.Append (" ", ccString); - -END extTools. diff --git a/src/voc/darwin/clang/x86_64/architecture.Mod b/src/voc/darwin/clang/x86_64/architecture.Mod deleted file mode 100644 index 1f95d2fd..00000000 --- a/src/voc/darwin/clang/x86_64/architecture.Mod +++ /dev/null @@ -1,4 +0,0 @@ -MODULE architecture; -CONST arch* = "x86_64"; - -END architecture. diff --git a/src/voc/linux/gcc/extTools.Mod b/src/voc/extTools.Mod similarity index 100% rename from src/voc/linux/gcc/extTools.Mod rename to src/voc/extTools.Mod diff --git a/src/voc/freebsd/clang/extTools.Mod b/src/voc/freebsd/clang/extTools.Mod deleted file mode 100644 index 62f7368a..00000000 --- a/src/voc/freebsd/clang/extTools.Mod +++ /dev/null @@ -1,88 +0,0 @@ -MODULE extTools; - IMPORT Args, Unix, Strings, Console, version; -(* -INCLUDEPATH = -Isrc/lib/system/gnuc/x86_64 -CCOPT = -fPIC $(INCLUDEPATH) -g -CLOBERONOPTS = -fPIC $(INCLUDEPATH) -L. -L/usr/lib -lOberon -static -g -CC = cc $(CCOPT) -c -*) -CONST compiler="clang"; - -VAR incPath0, incPath1, ccOpt, ccString, CFLAGS, tmp0, tmp1 : ARRAY 1023 OF CHAR; - -PROCEDURE Assemble*(m : ARRAY OF CHAR); -VAR cmd : ARRAY 1023 OF CHAR; -cc : ARRAY 1023 OF CHAR; -ext : ARRAY 5 OF CHAR; -BEGIN -COPY (ccString, cc); -Strings.Append (" -c ", cc); -COPY(cc, cmd); -Strings.Append (" ", cmd); -Strings.Append (ccOpt, cmd); -ext := ".c"; -Strings.Append (ext, m); -Strings.Append(m, cmd); -(*Console.Ln; Console.String (cmd); Console.Ln;*) -Unix.system(cmd); -END Assemble; - - -PROCEDURE LinkMain*(VAR m : ARRAY OF CHAR; statically : BOOLEAN; additionalopts : ARRAY OF CHAR); -VAR lpath : ARRAY 1023 OF CHAR; -cc : ARRAY 1023 OF CHAR; -ccopt : ARRAY 1023 OF CHAR; -cmd : ARRAY 1023 OF CHAR; -ext : ARRAY 5 OF CHAR; -BEGIN -(* -gcc -g -o hello hello.c -I $RPATH/src/lib/system/gnuc/x86_64 -I. -I$RPATH -lOberon -L. -L$RPATH -static -*) -cmd := ""; -cc := ""; -ext := ".c"; -COPY(ccString, cc); -COPY (cc, cmd); -Strings.Append(" ", cmd); -Strings.Append(m, cmd); -Strings.Append(ext, cmd); -Strings.Append(additionalopts, cmd); -IF statically THEN Strings.Append(" -static ", cmd) END; -Strings.Append(" -o ", cmd); -Strings.Append(m, cmd); -Strings.Append(" ", cmd); - -Strings.Append (" -lVishapOberon -L. -L", ccOpt); -Strings.Append (version.prefix, ccOpt); -Strings.Append ("/lib ", ccOpt); - -Strings.Append(ccOpt, cmd); -Console.Ln; Console.String(cmd); Console.Ln; (* may be it's feasible to add debug mode later *) -Unix.system(cmd); -END LinkMain; - -BEGIN - -incPath0 := "src/lib/system/freebsd/"; -Strings.Append (compiler, incPath0); -incPath1 := "lib/voc/obj "; -ccOpt := " -fPIC -g "; - -COPY ("-I ", tmp1); -Strings.Append (version.prefix, tmp1); -Strings.Append("/", tmp1); -Strings.Append(incPath0, tmp1); -Strings.Append("/", tmp1); -Strings.Append(version.arch, tmp1); -Strings.Append(" -I ", tmp1); -Strings.Append(version.prefix, tmp1); -Strings.Append("/", tmp1); -Strings.Append(incPath1, tmp1); -Strings.Append(tmp1, ccOpt); -Args.GetEnv("CFLAGS", CFLAGS); -Strings.Append (CFLAGS, ccOpt); -Strings.Append (" ", ccOpt); -ccString := compiler; -Strings.Append (" ", ccString); - -END extTools. diff --git a/src/voc/freebsd/clang/x86_64/architecture.Mod b/src/voc/freebsd/clang/x86_64/architecture.Mod deleted file mode 100644 index 1f95d2fd..00000000 --- a/src/voc/freebsd/clang/x86_64/architecture.Mod +++ /dev/null @@ -1,4 +0,0 @@ -MODULE architecture; -CONST arch* = "x86_64"; - -END architecture. diff --git a/src/voc/linux/clang/armv6j/architecture.Mod b/src/voc/linux/clang/armv6j/architecture.Mod deleted file mode 100644 index d8409c34..00000000 --- a/src/voc/linux/clang/armv6j/architecture.Mod +++ /dev/null @@ -1,4 +0,0 @@ -MODULE architecture; -CONST arch* = "armv6j"; - -END architecture. diff --git a/src/voc/linux/clang/armv6j_hardfp/architecture.Mod b/src/voc/linux/clang/armv6j_hardfp/architecture.Mod deleted file mode 100644 index 761f8c99..00000000 --- a/src/voc/linux/clang/armv6j_hardfp/architecture.Mod +++ /dev/null @@ -1,4 +0,0 @@ -MODULE architecture; -CONST arch* = "armv6j_hardfp"; - -END architecture. diff --git a/src/voc/linux/clang/armv7a_hardfp/architecture.Mod b/src/voc/linux/clang/armv7a_hardfp/architecture.Mod deleted file mode 100644 index fab9a0e2..00000000 --- a/src/voc/linux/clang/armv7a_hardfp/architecture.Mod +++ /dev/null @@ -1,4 +0,0 @@ -MODULE architecture; -CONST arch* = "armv7a_hardfp"; - -END architecture. diff --git a/src/voc/linux/clang/extTools.Mod b/src/voc/linux/clang/extTools.Mod deleted file mode 100644 index e18f3361..00000000 --- a/src/voc/linux/clang/extTools.Mod +++ /dev/null @@ -1,88 +0,0 @@ -MODULE extTools; - IMPORT Args, Unix, Strings, Console, version; -(* -INCLUDEPATH = -Isrc/lib/system/gnuc/x86_64 -CCOPT = -fPIC $(INCLUDEPATH) -g -CLOBERONOPTS = -fPIC $(INCLUDEPATH) -L. -L/usr/lib -lOberon -static -g -CC = cc $(CCOPT) -c -*) -CONST compiler="clang"; - -VAR incPath0, incPath1, ccOpt, ccString, CFLAGS, tmp0, tmp1 : ARRAY 1023 OF CHAR; - -PROCEDURE Assemble*(m : ARRAY OF CHAR); -VAR cmd : ARRAY 1023 OF CHAR; -cc : ARRAY 1023 OF CHAR; -ext : ARRAY 5 OF CHAR; -BEGIN -COPY (ccString, cc); -Strings.Append (" -c ", cc); -COPY(cc, cmd); -Strings.Append (" ", cmd); -Strings.Append (ccOpt, cmd); -ext := ".c"; -Strings.Append (ext, m); -Strings.Append(m, cmd); -(*Console.Ln; Console.String (cmd); Console.Ln;*) -Unix.system(cmd); -END Assemble; - - -PROCEDURE LinkMain*(VAR m : ARRAY OF CHAR; statically : BOOLEAN; additionalopts : ARRAY OF CHAR); -VAR lpath : ARRAY 1023 OF CHAR; -cc : ARRAY 1023 OF CHAR; -ccopt : ARRAY 1023 OF CHAR; -cmd : ARRAY 1023 OF CHAR; -ext : ARRAY 5 OF CHAR; -BEGIN -(* -gcc -g -o hello hello.c -I $RPATH/src/lib/system/gnuc/x86_64 -I. -I$RPATH -lOberon -L. -L$RPATH -static -*) -cmd := ""; -cc := ""; -ext := ".c"; -COPY(ccString, cc); -COPY (cc, cmd); -Strings.Append(" ", cmd); -Strings.Append(m, cmd); -Strings.Append(ext, cmd); -Strings.Append(additionalopts, cmd); -IF statically THEN Strings.Append(" -static ", cmd) END; -Strings.Append(" -o ", cmd); -Strings.Append(m, cmd); -Strings.Append(" ", cmd); - -Strings.Append (" -lVishapOberon -L. -L", ccOpt); -Strings.Append (version.prefix, ccOpt); -Strings.Append ("/lib ", ccOpt); - -Strings.Append(ccOpt, cmd); -Console.Ln; Console.String(cmd); Console.Ln; (* may be it's feasible to add debug mode later *) -Unix.system(cmd); -END LinkMain; - -BEGIN - -incPath0 := "src/lib/system/linux/"; -Strings.Append (compiler, incPath0); -incPath1 := "lib/voc/obj "; -ccOpt := " -fPIC -g "; - -COPY ("-I ", tmp1); -Strings.Append (version.prefix, tmp1); -Strings.Append("/", tmp1); -Strings.Append(incPath0, tmp1); -Strings.Append("/", tmp1); -Strings.Append(version.arch, tmp1); -Strings.Append(" -I ", tmp1); -Strings.Append(version.prefix, tmp1); -Strings.Append("/", tmp1); -Strings.Append(incPath1, tmp1); -Strings.Append(tmp1, ccOpt); -Args.GetEnv("CFLAGS", CFLAGS); -Strings.Append (CFLAGS, ccOpt); -Strings.Append (" ", ccOpt); -ccString := compiler; -Strings.Append (" ", ccString); - -END extTools. diff --git a/src/voc/linux/clang/powerpc/architecture.Mod b/src/voc/linux/clang/powerpc/architecture.Mod deleted file mode 100644 index 1cd033d5..00000000 --- a/src/voc/linux/clang/powerpc/architecture.Mod +++ /dev/null @@ -1,4 +0,0 @@ -MODULE architecture; -CONST arch* = "powerpc"; - -END architecture. diff --git a/src/voc/linux/clang/x86/architecture.Mod b/src/voc/linux/clang/x86/architecture.Mod deleted file mode 100644 index 84835238..00000000 --- a/src/voc/linux/clang/x86/architecture.Mod +++ /dev/null @@ -1,4 +0,0 @@ -MODULE architecture; -CONST arch* = "x86"; - -END architecture. diff --git a/src/voc/linux/clang/x86_64/architecture.Mod b/src/voc/linux/clang/x86_64/architecture.Mod deleted file mode 100644 index 1f95d2fd..00000000 --- a/src/voc/linux/clang/x86_64/architecture.Mod +++ /dev/null @@ -1,4 +0,0 @@ -MODULE architecture; -CONST arch* = "x86_64"; - -END architecture. diff --git a/src/voc/linux/gcc/armv6j/architecture.Mod b/src/voc/linux/gcc/armv6j/architecture.Mod deleted file mode 100644 index d8409c34..00000000 --- a/src/voc/linux/gcc/armv6j/architecture.Mod +++ /dev/null @@ -1,4 +0,0 @@ -MODULE architecture; -CONST arch* = "armv6j"; - -END architecture. diff --git a/src/voc/linux/gcc/armv6j_hardfp/architecture.Mod b/src/voc/linux/gcc/armv6j_hardfp/architecture.Mod deleted file mode 100644 index 761f8c99..00000000 --- a/src/voc/linux/gcc/armv6j_hardfp/architecture.Mod +++ /dev/null @@ -1,4 +0,0 @@ -MODULE architecture; -CONST arch* = "armv6j_hardfp"; - -END architecture. diff --git a/src/voc/linux/gcc/armv7a_hardfp/architecture.Mod b/src/voc/linux/gcc/armv7a_hardfp/architecture.Mod deleted file mode 100644 index fab9a0e2..00000000 --- a/src/voc/linux/gcc/armv7a_hardfp/architecture.Mod +++ /dev/null @@ -1,4 +0,0 @@ -MODULE architecture; -CONST arch* = "armv7a_hardfp"; - -END architecture. diff --git a/src/voc/linux/gcc/powerpc/architecture.Mod b/src/voc/linux/gcc/powerpc/architecture.Mod deleted file mode 100644 index 1cd033d5..00000000 --- a/src/voc/linux/gcc/powerpc/architecture.Mod +++ /dev/null @@ -1,4 +0,0 @@ -MODULE architecture; -CONST arch* = "powerpc"; - -END architecture. diff --git a/src/voc/linux/gcc/x86/architecture.Mod b/src/voc/linux/gcc/x86/architecture.Mod deleted file mode 100644 index 84835238..00000000 --- a/src/voc/linux/gcc/x86/architecture.Mod +++ /dev/null @@ -1,4 +0,0 @@ -MODULE architecture; -CONST arch* = "x86"; - -END architecture. diff --git a/src/voc/linux/gcc/x86_64/architecture.Mod b/src/voc/linux/gcc/x86_64/architecture.Mod deleted file mode 100644 index 1f95d2fd..00000000 --- a/src/voc/linux/gcc/x86_64/architecture.Mod +++ /dev/null @@ -1,4 +0,0 @@ -MODULE architecture; -CONST arch* = "x86_64"; - -END architecture. diff --git a/src/voc/openbsd/gcc/extTools.Mod b/src/voc/openbsd/gcc/extTools.Mod deleted file mode 100644 index 92110890..00000000 --- a/src/voc/openbsd/gcc/extTools.Mod +++ /dev/null @@ -1,88 +0,0 @@ -MODULE extTools; - IMPORT Args, Unix, Strings, Console, version; -(* -INCLUDEPATH = -Isrc/lib/system/gnuc/x86_64 -CCOPT = -fPIC $(INCLUDEPATH) -g -CLOBERONOPTS = -fPIC $(INCLUDEPATH) -L. -L/usr/lib -lOberon -static -g -CC = cc $(CCOPT) -c -*) -CONST compiler="gcc"; - -VAR incPath0, incPath1, ccOpt, ccString, CFLAGS, tmp0, tmp1 : ARRAY 1023 OF CHAR; - -PROCEDURE Assemble*(m : ARRAY OF CHAR); -VAR cmd : ARRAY 1023 OF CHAR; -cc : ARRAY 1023 OF CHAR; -ext : ARRAY 5 OF CHAR; -BEGIN -COPY (ccString, cc); -Strings.Append (" -c ", cc); -COPY(cc, cmd); -Strings.Append (" ", cmd); -Strings.Append (ccOpt, cmd); -ext := ".c"; -Strings.Append (ext, m); -Strings.Append(m, cmd); -(*Console.Ln; Console.String (cmd); Console.Ln;*) -Unix.system(cmd); -END Assemble; - - -PROCEDURE LinkMain*(VAR m : ARRAY OF CHAR; statically : BOOLEAN; additionalopts : ARRAY OF CHAR); -VAR lpath : ARRAY 1023 OF CHAR; -cc : ARRAY 1023 OF CHAR; -ccopt : ARRAY 1023 OF CHAR; -cmd : ARRAY 1023 OF CHAR; -ext : ARRAY 5 OF CHAR; -BEGIN -(* -gcc -g -o hello hello.c -I $RPATH/src/lib/system/gnuc/x86_64 -I. -I$RPATH -lOberon -L. -L$RPATH -static -*) -cmd := ""; -cc := ""; -ext := ".c"; -COPY(ccString, cc); -COPY (cc, cmd); -Strings.Append(" ", cmd); -Strings.Append(m, cmd); -Strings.Append(ext, cmd); -Strings.Append(additionalopts, cmd); -IF statically THEN Strings.Append(" -static ", cmd) END; -Strings.Append(" -o ", cmd); -Strings.Append(m, cmd); -Strings.Append(" ", cmd); - -Strings.Append (" -lVishapOberon -L. -L", ccOpt); -Strings.Append (version.prefix, ccOpt); -Strings.Append ("/lib ", ccOpt); - -Strings.Append(ccOpt, cmd); -Console.Ln; Console.String(cmd); Console.Ln; (* may be it's feasible to add debug mode later *) -Unix.system(cmd); -END LinkMain; - -BEGIN - -incPath0 := "src/lib/system/openbsd/"; -Strings.Append (compiler, incPath0); -incPath1 := "lib/voc/obj "; -ccOpt := " -fPIC -g "; - -COPY ("-I ", tmp1); -Strings.Append (version.prefix, tmp1); -Strings.Append("/", tmp1); -Strings.Append(incPath0, tmp1); -Strings.Append("/", tmp1); -Strings.Append(version.arch, tmp1); -Strings.Append(" -I ", tmp1); -Strings.Append(version.prefix, tmp1); -Strings.Append("/", tmp1); -Strings.Append(incPath1, tmp1); -Strings.Append(tmp1, ccOpt); -Args.GetEnv("CFLAGS", CFLAGS); -Strings.Append (CFLAGS, ccOpt); -Strings.Append (" ", ccOpt); -ccString := compiler; -Strings.Append (" ", ccString); - -END extTools. diff --git a/src/voc/openbsd/gcc/x86_64/architecture.Mod b/src/voc/openbsd/gcc/x86_64/architecture.Mod deleted file mode 100644 index 1f95d2fd..00000000 --- a/src/voc/openbsd/gcc/x86_64/architecture.Mod +++ /dev/null @@ -1,4 +0,0 @@ -MODULE architecture; -CONST arch* = "x86_64"; - -END architecture. diff --git a/src/voc/prf.Mod b/src/voc/prf.Mod deleted file mode 100644 index 2f4d8f24..00000000 --- a/src/voc/prf.Mod +++ /dev/null @@ -1,5 +0,0 @@ -MODULE prf; - -CONST prefix* = "/opt"; - -END prf. diff --git a/src/voc/prf.Mod_default b/src/voc/prf.Mod_default deleted file mode 100644 index 2f4d8f24..00000000 --- a/src/voc/prf.Mod_default +++ /dev/null @@ -1,5 +0,0 @@ -MODULE prf; - -CONST prefix* = "/opt"; - -END prf. diff --git a/src/voc/version.Mod b/src/voc/version.Mod deleted file mode 100644 index 0dc5e636..00000000 --- a/src/voc/version.Mod +++ /dev/null @@ -1,41 +0,0 @@ -MODULE version; - IMPORT Strings, architecture, prf; -CONST -(* targets *) - gnux86* = 0; gnux8664* = 1; gnuarmv6j* = 2; gnuarmv6jhardfp* = 3; gnuarmv7ahardfp* = 4; gnupowerpc* = 5; - -VAR arch-, version-, date-, versionLong-, prefix0-, prefix- : ARRAY 256 OF CHAR; -defaultTarget* : INTEGER; -BEGIN -arch := architecture.arch; -date := " [2016/01/12]"; -version := "1.1"; -versionLong := ""; -COPY(version, versionLong); -Strings.Append (" ", versionLong); -Strings.Append(date, versionLong); - prefix := ""; - (*prefix0 := "/opt";*) - COPY(prf.prefix, prefix0); - COPY (prefix0, prefix); - Strings.Append ("/voc-", prefix); - Strings.Append(version, prefix); (* /opt/voc-x.x *) - (* will be used later in Kernel0.Mod to set OBERON default path *) - - IF arch = "x86_64" THEN - defaultTarget := gnux8664 - ELSIF arch = "x86" THEN - defaultTarget := gnux86 - ELSIF arch = "armv6j" THEN - defaultTarget := gnuarmv6j - ELSIF arch = "armv6j_hardfp" THEN - defaultTarget := gnuarmv6jhardfp - ELSIF arch = "armv7a_hardfp" THEN - defaultTarget := gnuarmv7ahardfp - ELSIF arch = "powerpc" THEN - defaultTarget := gnupowerpc - ELSE - defaultTarget := gnux8664 - END - -END version. From e4153701eaa8797548f35a4c14b3090333b84774 Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 16 Jun 2016 12:07:37 +0100 Subject: [PATCH 059/580] Rename compiler directory to 'compiler'. --- src/{voc => compiler}/OPB.Mod | 0 src/{voc => compiler}/OPC.Mod | 0 src/{voc => compiler}/OPM.cmdln.Mod | 0 src/{voc => compiler}/OPP.Mod | 0 src/{voc => compiler}/OPS.Mod | 0 src/{voc => compiler}/OPT.Mod | 0 src/{voc => compiler}/OPV.Mod | 0 src/{voc => compiler}/Vishap.Mod | 0 src/{voc => compiler}/errors.Mod | 0 src/{voc => compiler}/extTools.Mod | 0 10 files changed, 0 insertions(+), 0 deletions(-) rename src/{voc => compiler}/OPB.Mod (100%) rename src/{voc => compiler}/OPC.Mod (100%) rename src/{voc => compiler}/OPM.cmdln.Mod (100%) rename src/{voc => compiler}/OPP.Mod (100%) rename src/{voc => compiler}/OPS.Mod (100%) rename src/{voc => compiler}/OPT.Mod (100%) rename src/{voc => compiler}/OPV.Mod (100%) rename src/{voc => compiler}/Vishap.Mod (100%) rename src/{voc => compiler}/errors.Mod (100%) rename src/{voc => compiler}/extTools.Mod (100%) diff --git a/src/voc/OPB.Mod b/src/compiler/OPB.Mod similarity index 100% rename from src/voc/OPB.Mod rename to src/compiler/OPB.Mod diff --git a/src/voc/OPC.Mod b/src/compiler/OPC.Mod similarity index 100% rename from src/voc/OPC.Mod rename to src/compiler/OPC.Mod diff --git a/src/voc/OPM.cmdln.Mod b/src/compiler/OPM.cmdln.Mod similarity index 100% rename from src/voc/OPM.cmdln.Mod rename to src/compiler/OPM.cmdln.Mod diff --git a/src/voc/OPP.Mod b/src/compiler/OPP.Mod similarity index 100% rename from src/voc/OPP.Mod rename to src/compiler/OPP.Mod diff --git a/src/voc/OPS.Mod b/src/compiler/OPS.Mod similarity index 100% rename from src/voc/OPS.Mod rename to src/compiler/OPS.Mod diff --git a/src/voc/OPT.Mod b/src/compiler/OPT.Mod similarity index 100% rename from src/voc/OPT.Mod rename to src/compiler/OPT.Mod diff --git a/src/voc/OPV.Mod b/src/compiler/OPV.Mod similarity index 100% rename from src/voc/OPV.Mod rename to src/compiler/OPV.Mod diff --git a/src/voc/Vishap.Mod b/src/compiler/Vishap.Mod similarity index 100% rename from src/voc/Vishap.Mod rename to src/compiler/Vishap.Mod diff --git a/src/voc/errors.Mod b/src/compiler/errors.Mod similarity index 100% rename from src/voc/errors.Mod rename to src/compiler/errors.Mod diff --git a/src/voc/extTools.Mod b/src/compiler/extTools.Mod similarity index 100% rename from src/voc/extTools.Mod rename to src/compiler/extTools.Mod From 72dedc9bf634e5fc63e11402089490367d0f0d4d Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 16 Jun 2016 12:09:14 +0100 Subject: [PATCH 060/580] Remove par directory and mv system directory under src. --- src/par/voc.par.clang.powerpc | 16 ---------------- src/par/voc.par.clang.x86_64 | 16 ---------------- src/par/voc.par.gcc.armv6j_hardfp | 16 ---------------- src/par/voc.par.gcc.powerpc | 16 ---------------- src/par/voc.par.gcc.x86 | 16 ---------------- src/par/voc.par.gcc.x86_64 | 16 ---------------- src/{lib => }/system/darwin/clang/Console.Mod | 0 src/{lib => }/system/darwin/clang/Files.Mod | 0 src/{lib => }/system/darwin/clang/Files0.Mod | 0 src/{lib => }/system/darwin/clang/Kernel.Mod | 0 src/{lib => }/system/darwin/clang/Kernel0.Mod | 0 src/{lib => }/system/darwin/clang/SYSTEM.Mod | 0 .../system/darwin/clang/x86_64/Args.Mod | 0 .../system/darwin/clang/x86_64/SYSTEM.c0 | 0 .../system/darwin/clang/x86_64/SYSTEM.h | 0 .../system/darwin/clang/x86_64/Unix.Mod | 0 src/{lib => }/system/freebsd/clang/Console.Mod | 0 src/{lib => }/system/freebsd/clang/Kernel.Mod | 0 src/{lib => }/system/freebsd/clang/Kernel0.Mod | 0 src/{lib => }/system/freebsd/clang/SYSTEM.Mod | 0 .../system/freebsd/clang/x86_64/Args.Mod | 0 .../system/freebsd/clang/x86_64/Files.Mod | 0 .../system/freebsd/clang/x86_64/Files0.Mod | 0 .../system/freebsd/clang/x86_64/SYSTEM.c0 | 0 .../system/freebsd/clang/x86_64/SYSTEM.h | 0 .../system/freebsd/clang/x86_64/Unix.Mod | 0 src/{lib => }/system/linux/clang/Console.Mod | 0 src/{lib => }/system/linux/clang/Kernel.Mod | 0 src/{lib => }/system/linux/clang/Kernel0.Mod | 0 src/{lib => }/system/linux/clang/SYSTEM.Mod | 0 .../system/linux/clang/armv6j_hardfp/Args.Mod | 0 .../system/linux/clang/armv6j_hardfp/Files.Mod | 0 .../system/linux/clang/armv6j_hardfp/Files0.Mod | 0 .../system/linux/clang/armv6j_hardfp/SYSTEM.c0 | 0 .../system/linux/clang/armv6j_hardfp/SYSTEM.h | 0 .../system/linux/clang/armv6j_hardfp/Unix.Mod | 0 .../system/linux/clang/powerpc/Args.Mod | 0 .../system/linux/clang/powerpc/Files.Mod | 0 .../system/linux/clang/powerpc/Files0.Mod | 0 .../system/linux/clang/powerpc/SYSTEM.c0 | 0 .../system/linux/clang/powerpc/SYSTEM.h | 0 .../system/linux/clang/powerpc/Unix.Mod | 0 src/{lib => }/system/linux/clang/x86/Args.Mod | 0 src/{lib => }/system/linux/clang/x86/Files.Mod | 0 src/{lib => }/system/linux/clang/x86/Files0.Mod | 0 src/{lib => }/system/linux/clang/x86/SYSTEM.c0 | 0 src/{lib => }/system/linux/clang/x86/SYSTEM.h | 0 src/{lib => }/system/linux/clang/x86/Unix.Mod | 0 src/{lib => }/system/linux/clang/x86_64/Args.Mod | 0 .../system/linux/clang/x86_64/Files.Mod | 0 .../system/linux/clang/x86_64/Files0.Mod | 0 .../system/linux/clang/x86_64/SYSTEM.c0 | 0 src/{lib => }/system/linux/clang/x86_64/SYSTEM.h | 0 src/{lib => }/system/linux/clang/x86_64/Unix.Mod | 0 src/{lib => }/system/linux/gcc/Console.Mod | 0 src/{lib => }/system/linux/gcc/Kernel.Mod | 0 src/{lib => }/system/linux/gcc/Kernel0.Mod | 0 src/{lib => }/system/linux/gcc/SYSTEM.Mod | 0 .../system/linux/gcc/armv6j_hardfp/Args.Mod | 0 .../system/linux/gcc/armv6j_hardfp/Files.Mod | 0 .../system/linux/gcc/armv6j_hardfp/Files0.Mod | 0 .../system/linux/gcc/armv6j_hardfp/SYSTEM.c0 | 0 .../system/linux/gcc/armv6j_hardfp/SYSTEM.h | 0 .../system/linux/gcc/armv6j_hardfp/Unix.Mod | 0 src/{lib => }/system/linux/gcc/powerpc/Args.Mod | 0 src/{lib => }/system/linux/gcc/powerpc/Files.Mod | 0 .../system/linux/gcc/powerpc/Files0.Mod | 0 src/{lib => }/system/linux/gcc/powerpc/SYSTEM.c0 | 0 src/{lib => }/system/linux/gcc/powerpc/SYSTEM.h | 0 src/{lib => }/system/linux/gcc/powerpc/Unix.Mod | 0 src/{lib => }/system/linux/gcc/x86/Args.Mod | 0 src/{lib => }/system/linux/gcc/x86/Files.Mod | 0 src/{lib => }/system/linux/gcc/x86/Files0.Mod | 0 src/{lib => }/system/linux/gcc/x86/SYSTEM.c0 | 0 src/{lib => }/system/linux/gcc/x86/SYSTEM.h | 0 src/{lib => }/system/linux/gcc/x86/Unix.Mod | 0 src/{lib => }/system/linux/gcc/x86_64/Args.Mod | 0 src/{lib => }/system/linux/gcc/x86_64/Files.Mod | 0 src/{lib => }/system/linux/gcc/x86_64/Files0.Mod | 0 src/{lib => }/system/linux/gcc/x86_64/SYSTEM.c0 | 0 src/{lib => }/system/linux/gcc/x86_64/SYSTEM.h | 0 src/{lib => }/system/linux/gcc/x86_64/Unix.Mod | 0 src/{lib => }/system/openbsd/gcc/Console.Mod | 0 src/{lib => }/system/openbsd/gcc/Kernel.Mod | 0 src/{lib => }/system/openbsd/gcc/Kernel0.Mod | 0 src/{lib => }/system/openbsd/gcc/SYSTEM.Mod | 0 src/{lib => }/system/openbsd/gcc/x86_64/Args.Mod | 0 .../system/openbsd/gcc/x86_64/Files.Mod | 0 .../system/openbsd/gcc/x86_64/Files0.Mod | 0 .../system/openbsd/gcc/x86_64/SYSTEM.c0 | 0 src/{lib => }/system/openbsd/gcc/x86_64/SYSTEM.h | 0 src/{lib => }/system/openbsd/gcc/x86_64/Unix.Mod | 0 92 files changed, 96 deletions(-) delete mode 100644 src/par/voc.par.clang.powerpc delete mode 100644 src/par/voc.par.clang.x86_64 delete mode 100644 src/par/voc.par.gcc.armv6j_hardfp delete mode 100644 src/par/voc.par.gcc.powerpc delete mode 100644 src/par/voc.par.gcc.x86 delete mode 100644 src/par/voc.par.gcc.x86_64 rename src/{lib => }/system/darwin/clang/Console.Mod (100%) rename src/{lib => }/system/darwin/clang/Files.Mod (100%) rename src/{lib => }/system/darwin/clang/Files0.Mod (100%) rename src/{lib => }/system/darwin/clang/Kernel.Mod (100%) rename src/{lib => }/system/darwin/clang/Kernel0.Mod (100%) rename src/{lib => }/system/darwin/clang/SYSTEM.Mod (100%) rename src/{lib => }/system/darwin/clang/x86_64/Args.Mod (100%) rename src/{lib => }/system/darwin/clang/x86_64/SYSTEM.c0 (100%) rename src/{lib => }/system/darwin/clang/x86_64/SYSTEM.h (100%) rename src/{lib => }/system/darwin/clang/x86_64/Unix.Mod (100%) rename src/{lib => }/system/freebsd/clang/Console.Mod (100%) rename src/{lib => }/system/freebsd/clang/Kernel.Mod (100%) rename src/{lib => }/system/freebsd/clang/Kernel0.Mod (100%) rename src/{lib => }/system/freebsd/clang/SYSTEM.Mod (100%) rename src/{lib => }/system/freebsd/clang/x86_64/Args.Mod (100%) rename src/{lib => }/system/freebsd/clang/x86_64/Files.Mod (100%) rename src/{lib => }/system/freebsd/clang/x86_64/Files0.Mod (100%) rename src/{lib => }/system/freebsd/clang/x86_64/SYSTEM.c0 (100%) rename src/{lib => }/system/freebsd/clang/x86_64/SYSTEM.h (100%) rename src/{lib => }/system/freebsd/clang/x86_64/Unix.Mod (100%) rename src/{lib => }/system/linux/clang/Console.Mod (100%) rename src/{lib => }/system/linux/clang/Kernel.Mod (100%) rename src/{lib => }/system/linux/clang/Kernel0.Mod (100%) rename src/{lib => }/system/linux/clang/SYSTEM.Mod (100%) rename src/{lib => }/system/linux/clang/armv6j_hardfp/Args.Mod (100%) rename src/{lib => }/system/linux/clang/armv6j_hardfp/Files.Mod (100%) rename src/{lib => }/system/linux/clang/armv6j_hardfp/Files0.Mod (100%) rename src/{lib => }/system/linux/clang/armv6j_hardfp/SYSTEM.c0 (100%) rename src/{lib => }/system/linux/clang/armv6j_hardfp/SYSTEM.h (100%) rename src/{lib => }/system/linux/clang/armv6j_hardfp/Unix.Mod (100%) rename src/{lib => }/system/linux/clang/powerpc/Args.Mod (100%) rename src/{lib => }/system/linux/clang/powerpc/Files.Mod (100%) rename src/{lib => }/system/linux/clang/powerpc/Files0.Mod (100%) rename src/{lib => }/system/linux/clang/powerpc/SYSTEM.c0 (100%) rename src/{lib => }/system/linux/clang/powerpc/SYSTEM.h (100%) rename src/{lib => }/system/linux/clang/powerpc/Unix.Mod (100%) rename src/{lib => }/system/linux/clang/x86/Args.Mod (100%) rename src/{lib => }/system/linux/clang/x86/Files.Mod (100%) rename src/{lib => }/system/linux/clang/x86/Files0.Mod (100%) rename src/{lib => }/system/linux/clang/x86/SYSTEM.c0 (100%) rename src/{lib => }/system/linux/clang/x86/SYSTEM.h (100%) rename src/{lib => }/system/linux/clang/x86/Unix.Mod (100%) rename src/{lib => }/system/linux/clang/x86_64/Args.Mod (100%) rename src/{lib => }/system/linux/clang/x86_64/Files.Mod (100%) rename src/{lib => }/system/linux/clang/x86_64/Files0.Mod (100%) rename src/{lib => }/system/linux/clang/x86_64/SYSTEM.c0 (100%) rename src/{lib => }/system/linux/clang/x86_64/SYSTEM.h (100%) rename src/{lib => }/system/linux/clang/x86_64/Unix.Mod (100%) rename src/{lib => }/system/linux/gcc/Console.Mod (100%) rename src/{lib => }/system/linux/gcc/Kernel.Mod (100%) rename src/{lib => }/system/linux/gcc/Kernel0.Mod (100%) rename src/{lib => }/system/linux/gcc/SYSTEM.Mod (100%) rename src/{lib => }/system/linux/gcc/armv6j_hardfp/Args.Mod (100%) rename src/{lib => }/system/linux/gcc/armv6j_hardfp/Files.Mod (100%) rename src/{lib => }/system/linux/gcc/armv6j_hardfp/Files0.Mod (100%) rename src/{lib => }/system/linux/gcc/armv6j_hardfp/SYSTEM.c0 (100%) rename src/{lib => }/system/linux/gcc/armv6j_hardfp/SYSTEM.h (100%) rename src/{lib => }/system/linux/gcc/armv6j_hardfp/Unix.Mod (100%) rename src/{lib => }/system/linux/gcc/powerpc/Args.Mod (100%) rename src/{lib => }/system/linux/gcc/powerpc/Files.Mod (100%) rename src/{lib => }/system/linux/gcc/powerpc/Files0.Mod (100%) rename src/{lib => }/system/linux/gcc/powerpc/SYSTEM.c0 (100%) rename src/{lib => }/system/linux/gcc/powerpc/SYSTEM.h (100%) rename src/{lib => }/system/linux/gcc/powerpc/Unix.Mod (100%) rename src/{lib => }/system/linux/gcc/x86/Args.Mod (100%) rename src/{lib => }/system/linux/gcc/x86/Files.Mod (100%) rename src/{lib => }/system/linux/gcc/x86/Files0.Mod (100%) rename src/{lib => }/system/linux/gcc/x86/SYSTEM.c0 (100%) rename src/{lib => }/system/linux/gcc/x86/SYSTEM.h (100%) rename src/{lib => }/system/linux/gcc/x86/Unix.Mod (100%) rename src/{lib => }/system/linux/gcc/x86_64/Args.Mod (100%) rename src/{lib => }/system/linux/gcc/x86_64/Files.Mod (100%) rename src/{lib => }/system/linux/gcc/x86_64/Files0.Mod (100%) rename src/{lib => }/system/linux/gcc/x86_64/SYSTEM.c0 (100%) rename src/{lib => }/system/linux/gcc/x86_64/SYSTEM.h (100%) rename src/{lib => }/system/linux/gcc/x86_64/Unix.Mod (100%) rename src/{lib => }/system/openbsd/gcc/Console.Mod (100%) rename src/{lib => }/system/openbsd/gcc/Kernel.Mod (100%) rename src/{lib => }/system/openbsd/gcc/Kernel0.Mod (100%) rename src/{lib => }/system/openbsd/gcc/SYSTEM.Mod (100%) rename src/{lib => }/system/openbsd/gcc/x86_64/Args.Mod (100%) rename src/{lib => }/system/openbsd/gcc/x86_64/Files.Mod (100%) rename src/{lib => }/system/openbsd/gcc/x86_64/Files0.Mod (100%) rename src/{lib => }/system/openbsd/gcc/x86_64/SYSTEM.c0 (100%) rename src/{lib => }/system/openbsd/gcc/x86_64/SYSTEM.h (100%) rename src/{lib => }/system/openbsd/gcc/x86_64/Unix.Mod (100%) diff --git a/src/par/voc.par.clang.powerpc b/src/par/voc.par.clang.powerpc deleted file mode 100644 index fdc5342a..00000000 --- a/src/par/voc.par.clang.powerpc +++ /dev/null @@ -1,16 +0,0 @@ -CHAR 1 1 -BOOLEAN 1 1 -SHORTINT 1 1 -INTEGER 2 2 -LONGINT 4 4 -SET 4 4 -REAL 4 4 -LONGREAL 8 8 -PTR 4 4 -PROC 4 4 -RECORD 1 1 -ENDIAN 0 0 -SYSTEM.INT8 1 1 -SYSTEM.INT16 2 2 -SYSTEM.INT32 4 4 -SYSTEM.INT64 8 4 diff --git a/src/par/voc.par.clang.x86_64 b/src/par/voc.par.clang.x86_64 deleted file mode 100644 index bf5ed486..00000000 --- a/src/par/voc.par.clang.x86_64 +++ /dev/null @@ -1,16 +0,0 @@ -CHAR 1 1 -BOOLEAN 1 1 -SHORTINT 1 1 -INTEGER 4 4 -LONGINT 8 8 -SET 8 8 -REAL 4 4 -LONGREAL 8 8 -PTR 8 8 -PROC 8 8 -RECORD 1 1 -ENDIAN 1 0 -SYSTEM.INT8 1 1 -SYSTEM.INT16 2 2 -SYSTEM.INT32 4 4 -SYSTEM.INT64 8 8 diff --git a/src/par/voc.par.gcc.armv6j_hardfp b/src/par/voc.par.gcc.armv6j_hardfp deleted file mode 100644 index 49740442..00000000 --- a/src/par/voc.par.gcc.armv6j_hardfp +++ /dev/null @@ -1,16 +0,0 @@ -CHAR 1 1 -BOOLEAN 1 1 -SHORTINT 1 1 -INTEGER 2 2 -LONGINT 4 4 -SET 4 4 -REAL 4 4 -LONGREAL 8 8 -PTR 4 4 -PROC 4 4 -RECORD 1 1 -ENDIAN 1 0 -SYSTEM.INT8 1 1 -SYSTEM.INT16 2 2 -SYSTEM.INT32 4 4 -SYSTEM.INT64 8 4 diff --git a/src/par/voc.par.gcc.powerpc b/src/par/voc.par.gcc.powerpc deleted file mode 100644 index fdc5342a..00000000 --- a/src/par/voc.par.gcc.powerpc +++ /dev/null @@ -1,16 +0,0 @@ -CHAR 1 1 -BOOLEAN 1 1 -SHORTINT 1 1 -INTEGER 2 2 -LONGINT 4 4 -SET 4 4 -REAL 4 4 -LONGREAL 8 8 -PTR 4 4 -PROC 4 4 -RECORD 1 1 -ENDIAN 0 0 -SYSTEM.INT8 1 1 -SYSTEM.INT16 2 2 -SYSTEM.INT32 4 4 -SYSTEM.INT64 8 4 diff --git a/src/par/voc.par.gcc.x86 b/src/par/voc.par.gcc.x86 deleted file mode 100644 index b6abadc5..00000000 --- a/src/par/voc.par.gcc.x86 +++ /dev/null @@ -1,16 +0,0 @@ -CHAR 1 1 -BOOLEAN 1 1 -SHORTINT 1 1 -INTEGER 2 2 -LONGINT 4 4 -SET 4 4 -REAL 4 4 -LONGREAL 8 4 -PTR 4 4 -PROC 4 4 -RECORD 1 1 -ENDIAN 1 0 -SYSTEM.INT8 1 1 -SYSTEM.INT16 2 2 -SYSTEM.INT32 4 4 -SYSTEM.INT64 8 4 diff --git a/src/par/voc.par.gcc.x86_64 b/src/par/voc.par.gcc.x86_64 deleted file mode 100644 index bf5ed486..00000000 --- a/src/par/voc.par.gcc.x86_64 +++ /dev/null @@ -1,16 +0,0 @@ -CHAR 1 1 -BOOLEAN 1 1 -SHORTINT 1 1 -INTEGER 4 4 -LONGINT 8 8 -SET 8 8 -REAL 4 4 -LONGREAL 8 8 -PTR 8 8 -PROC 8 8 -RECORD 1 1 -ENDIAN 1 0 -SYSTEM.INT8 1 1 -SYSTEM.INT16 2 2 -SYSTEM.INT32 4 4 -SYSTEM.INT64 8 8 diff --git a/src/lib/system/darwin/clang/Console.Mod b/src/system/darwin/clang/Console.Mod similarity index 100% rename from src/lib/system/darwin/clang/Console.Mod rename to src/system/darwin/clang/Console.Mod diff --git a/src/lib/system/darwin/clang/Files.Mod b/src/system/darwin/clang/Files.Mod similarity index 100% rename from src/lib/system/darwin/clang/Files.Mod rename to src/system/darwin/clang/Files.Mod diff --git a/src/lib/system/darwin/clang/Files0.Mod b/src/system/darwin/clang/Files0.Mod similarity index 100% rename from src/lib/system/darwin/clang/Files0.Mod rename to src/system/darwin/clang/Files0.Mod diff --git a/src/lib/system/darwin/clang/Kernel.Mod b/src/system/darwin/clang/Kernel.Mod similarity index 100% rename from src/lib/system/darwin/clang/Kernel.Mod rename to src/system/darwin/clang/Kernel.Mod diff --git a/src/lib/system/darwin/clang/Kernel0.Mod b/src/system/darwin/clang/Kernel0.Mod similarity index 100% rename from src/lib/system/darwin/clang/Kernel0.Mod rename to src/system/darwin/clang/Kernel0.Mod diff --git a/src/lib/system/darwin/clang/SYSTEM.Mod b/src/system/darwin/clang/SYSTEM.Mod similarity index 100% rename from src/lib/system/darwin/clang/SYSTEM.Mod rename to src/system/darwin/clang/SYSTEM.Mod diff --git a/src/lib/system/darwin/clang/x86_64/Args.Mod b/src/system/darwin/clang/x86_64/Args.Mod similarity index 100% rename from src/lib/system/darwin/clang/x86_64/Args.Mod rename to src/system/darwin/clang/x86_64/Args.Mod diff --git a/src/lib/system/darwin/clang/x86_64/SYSTEM.c0 b/src/system/darwin/clang/x86_64/SYSTEM.c0 similarity index 100% rename from src/lib/system/darwin/clang/x86_64/SYSTEM.c0 rename to src/system/darwin/clang/x86_64/SYSTEM.c0 diff --git a/src/lib/system/darwin/clang/x86_64/SYSTEM.h b/src/system/darwin/clang/x86_64/SYSTEM.h similarity index 100% rename from src/lib/system/darwin/clang/x86_64/SYSTEM.h rename to src/system/darwin/clang/x86_64/SYSTEM.h diff --git a/src/lib/system/darwin/clang/x86_64/Unix.Mod b/src/system/darwin/clang/x86_64/Unix.Mod similarity index 100% rename from src/lib/system/darwin/clang/x86_64/Unix.Mod rename to src/system/darwin/clang/x86_64/Unix.Mod diff --git a/src/lib/system/freebsd/clang/Console.Mod b/src/system/freebsd/clang/Console.Mod similarity index 100% rename from src/lib/system/freebsd/clang/Console.Mod rename to src/system/freebsd/clang/Console.Mod diff --git a/src/lib/system/freebsd/clang/Kernel.Mod b/src/system/freebsd/clang/Kernel.Mod similarity index 100% rename from src/lib/system/freebsd/clang/Kernel.Mod rename to src/system/freebsd/clang/Kernel.Mod diff --git a/src/lib/system/freebsd/clang/Kernel0.Mod b/src/system/freebsd/clang/Kernel0.Mod similarity index 100% rename from src/lib/system/freebsd/clang/Kernel0.Mod rename to src/system/freebsd/clang/Kernel0.Mod diff --git a/src/lib/system/freebsd/clang/SYSTEM.Mod b/src/system/freebsd/clang/SYSTEM.Mod similarity index 100% rename from src/lib/system/freebsd/clang/SYSTEM.Mod rename to src/system/freebsd/clang/SYSTEM.Mod diff --git a/src/lib/system/freebsd/clang/x86_64/Args.Mod b/src/system/freebsd/clang/x86_64/Args.Mod similarity index 100% rename from src/lib/system/freebsd/clang/x86_64/Args.Mod rename to src/system/freebsd/clang/x86_64/Args.Mod diff --git a/src/lib/system/freebsd/clang/x86_64/Files.Mod b/src/system/freebsd/clang/x86_64/Files.Mod similarity index 100% rename from src/lib/system/freebsd/clang/x86_64/Files.Mod rename to src/system/freebsd/clang/x86_64/Files.Mod diff --git a/src/lib/system/freebsd/clang/x86_64/Files0.Mod b/src/system/freebsd/clang/x86_64/Files0.Mod similarity index 100% rename from src/lib/system/freebsd/clang/x86_64/Files0.Mod rename to src/system/freebsd/clang/x86_64/Files0.Mod diff --git a/src/lib/system/freebsd/clang/x86_64/SYSTEM.c0 b/src/system/freebsd/clang/x86_64/SYSTEM.c0 similarity index 100% rename from src/lib/system/freebsd/clang/x86_64/SYSTEM.c0 rename to src/system/freebsd/clang/x86_64/SYSTEM.c0 diff --git a/src/lib/system/freebsd/clang/x86_64/SYSTEM.h b/src/system/freebsd/clang/x86_64/SYSTEM.h similarity index 100% rename from src/lib/system/freebsd/clang/x86_64/SYSTEM.h rename to src/system/freebsd/clang/x86_64/SYSTEM.h diff --git a/src/lib/system/freebsd/clang/x86_64/Unix.Mod b/src/system/freebsd/clang/x86_64/Unix.Mod similarity index 100% rename from src/lib/system/freebsd/clang/x86_64/Unix.Mod rename to src/system/freebsd/clang/x86_64/Unix.Mod diff --git a/src/lib/system/linux/clang/Console.Mod b/src/system/linux/clang/Console.Mod similarity index 100% rename from src/lib/system/linux/clang/Console.Mod rename to src/system/linux/clang/Console.Mod diff --git a/src/lib/system/linux/clang/Kernel.Mod b/src/system/linux/clang/Kernel.Mod similarity index 100% rename from src/lib/system/linux/clang/Kernel.Mod rename to src/system/linux/clang/Kernel.Mod diff --git a/src/lib/system/linux/clang/Kernel0.Mod b/src/system/linux/clang/Kernel0.Mod similarity index 100% rename from src/lib/system/linux/clang/Kernel0.Mod rename to src/system/linux/clang/Kernel0.Mod diff --git a/src/lib/system/linux/clang/SYSTEM.Mod b/src/system/linux/clang/SYSTEM.Mod similarity index 100% rename from src/lib/system/linux/clang/SYSTEM.Mod rename to src/system/linux/clang/SYSTEM.Mod diff --git a/src/lib/system/linux/clang/armv6j_hardfp/Args.Mod b/src/system/linux/clang/armv6j_hardfp/Args.Mod similarity index 100% rename from src/lib/system/linux/clang/armv6j_hardfp/Args.Mod rename to src/system/linux/clang/armv6j_hardfp/Args.Mod diff --git a/src/lib/system/linux/clang/armv6j_hardfp/Files.Mod b/src/system/linux/clang/armv6j_hardfp/Files.Mod similarity index 100% rename from src/lib/system/linux/clang/armv6j_hardfp/Files.Mod rename to src/system/linux/clang/armv6j_hardfp/Files.Mod diff --git a/src/lib/system/linux/clang/armv6j_hardfp/Files0.Mod b/src/system/linux/clang/armv6j_hardfp/Files0.Mod similarity index 100% rename from src/lib/system/linux/clang/armv6j_hardfp/Files0.Mod rename to src/system/linux/clang/armv6j_hardfp/Files0.Mod diff --git a/src/lib/system/linux/clang/armv6j_hardfp/SYSTEM.c0 b/src/system/linux/clang/armv6j_hardfp/SYSTEM.c0 similarity index 100% rename from src/lib/system/linux/clang/armv6j_hardfp/SYSTEM.c0 rename to src/system/linux/clang/armv6j_hardfp/SYSTEM.c0 diff --git a/src/lib/system/linux/clang/armv6j_hardfp/SYSTEM.h b/src/system/linux/clang/armv6j_hardfp/SYSTEM.h similarity index 100% rename from src/lib/system/linux/clang/armv6j_hardfp/SYSTEM.h rename to src/system/linux/clang/armv6j_hardfp/SYSTEM.h diff --git a/src/lib/system/linux/clang/armv6j_hardfp/Unix.Mod b/src/system/linux/clang/armv6j_hardfp/Unix.Mod similarity index 100% rename from src/lib/system/linux/clang/armv6j_hardfp/Unix.Mod rename to src/system/linux/clang/armv6j_hardfp/Unix.Mod diff --git a/src/lib/system/linux/clang/powerpc/Args.Mod b/src/system/linux/clang/powerpc/Args.Mod similarity index 100% rename from src/lib/system/linux/clang/powerpc/Args.Mod rename to src/system/linux/clang/powerpc/Args.Mod diff --git a/src/lib/system/linux/clang/powerpc/Files.Mod b/src/system/linux/clang/powerpc/Files.Mod similarity index 100% rename from src/lib/system/linux/clang/powerpc/Files.Mod rename to src/system/linux/clang/powerpc/Files.Mod diff --git a/src/lib/system/linux/clang/powerpc/Files0.Mod b/src/system/linux/clang/powerpc/Files0.Mod similarity index 100% rename from src/lib/system/linux/clang/powerpc/Files0.Mod rename to src/system/linux/clang/powerpc/Files0.Mod diff --git a/src/lib/system/linux/clang/powerpc/SYSTEM.c0 b/src/system/linux/clang/powerpc/SYSTEM.c0 similarity index 100% rename from src/lib/system/linux/clang/powerpc/SYSTEM.c0 rename to src/system/linux/clang/powerpc/SYSTEM.c0 diff --git a/src/lib/system/linux/clang/powerpc/SYSTEM.h b/src/system/linux/clang/powerpc/SYSTEM.h similarity index 100% rename from src/lib/system/linux/clang/powerpc/SYSTEM.h rename to src/system/linux/clang/powerpc/SYSTEM.h diff --git a/src/lib/system/linux/clang/powerpc/Unix.Mod b/src/system/linux/clang/powerpc/Unix.Mod similarity index 100% rename from src/lib/system/linux/clang/powerpc/Unix.Mod rename to src/system/linux/clang/powerpc/Unix.Mod diff --git a/src/lib/system/linux/clang/x86/Args.Mod b/src/system/linux/clang/x86/Args.Mod similarity index 100% rename from src/lib/system/linux/clang/x86/Args.Mod rename to src/system/linux/clang/x86/Args.Mod diff --git a/src/lib/system/linux/clang/x86/Files.Mod b/src/system/linux/clang/x86/Files.Mod similarity index 100% rename from src/lib/system/linux/clang/x86/Files.Mod rename to src/system/linux/clang/x86/Files.Mod diff --git a/src/lib/system/linux/clang/x86/Files0.Mod b/src/system/linux/clang/x86/Files0.Mod similarity index 100% rename from src/lib/system/linux/clang/x86/Files0.Mod rename to src/system/linux/clang/x86/Files0.Mod diff --git a/src/lib/system/linux/clang/x86/SYSTEM.c0 b/src/system/linux/clang/x86/SYSTEM.c0 similarity index 100% rename from src/lib/system/linux/clang/x86/SYSTEM.c0 rename to src/system/linux/clang/x86/SYSTEM.c0 diff --git a/src/lib/system/linux/clang/x86/SYSTEM.h b/src/system/linux/clang/x86/SYSTEM.h similarity index 100% rename from src/lib/system/linux/clang/x86/SYSTEM.h rename to src/system/linux/clang/x86/SYSTEM.h diff --git a/src/lib/system/linux/clang/x86/Unix.Mod b/src/system/linux/clang/x86/Unix.Mod similarity index 100% rename from src/lib/system/linux/clang/x86/Unix.Mod rename to src/system/linux/clang/x86/Unix.Mod diff --git a/src/lib/system/linux/clang/x86_64/Args.Mod b/src/system/linux/clang/x86_64/Args.Mod similarity index 100% rename from src/lib/system/linux/clang/x86_64/Args.Mod rename to src/system/linux/clang/x86_64/Args.Mod diff --git a/src/lib/system/linux/clang/x86_64/Files.Mod b/src/system/linux/clang/x86_64/Files.Mod similarity index 100% rename from src/lib/system/linux/clang/x86_64/Files.Mod rename to src/system/linux/clang/x86_64/Files.Mod diff --git a/src/lib/system/linux/clang/x86_64/Files0.Mod b/src/system/linux/clang/x86_64/Files0.Mod similarity index 100% rename from src/lib/system/linux/clang/x86_64/Files0.Mod rename to src/system/linux/clang/x86_64/Files0.Mod diff --git a/src/lib/system/linux/clang/x86_64/SYSTEM.c0 b/src/system/linux/clang/x86_64/SYSTEM.c0 similarity index 100% rename from src/lib/system/linux/clang/x86_64/SYSTEM.c0 rename to src/system/linux/clang/x86_64/SYSTEM.c0 diff --git a/src/lib/system/linux/clang/x86_64/SYSTEM.h b/src/system/linux/clang/x86_64/SYSTEM.h similarity index 100% rename from src/lib/system/linux/clang/x86_64/SYSTEM.h rename to src/system/linux/clang/x86_64/SYSTEM.h diff --git a/src/lib/system/linux/clang/x86_64/Unix.Mod b/src/system/linux/clang/x86_64/Unix.Mod similarity index 100% rename from src/lib/system/linux/clang/x86_64/Unix.Mod rename to src/system/linux/clang/x86_64/Unix.Mod diff --git a/src/lib/system/linux/gcc/Console.Mod b/src/system/linux/gcc/Console.Mod similarity index 100% rename from src/lib/system/linux/gcc/Console.Mod rename to src/system/linux/gcc/Console.Mod diff --git a/src/lib/system/linux/gcc/Kernel.Mod b/src/system/linux/gcc/Kernel.Mod similarity index 100% rename from src/lib/system/linux/gcc/Kernel.Mod rename to src/system/linux/gcc/Kernel.Mod diff --git a/src/lib/system/linux/gcc/Kernel0.Mod b/src/system/linux/gcc/Kernel0.Mod similarity index 100% rename from src/lib/system/linux/gcc/Kernel0.Mod rename to src/system/linux/gcc/Kernel0.Mod diff --git a/src/lib/system/linux/gcc/SYSTEM.Mod b/src/system/linux/gcc/SYSTEM.Mod similarity index 100% rename from src/lib/system/linux/gcc/SYSTEM.Mod rename to src/system/linux/gcc/SYSTEM.Mod diff --git a/src/lib/system/linux/gcc/armv6j_hardfp/Args.Mod b/src/system/linux/gcc/armv6j_hardfp/Args.Mod similarity index 100% rename from src/lib/system/linux/gcc/armv6j_hardfp/Args.Mod rename to src/system/linux/gcc/armv6j_hardfp/Args.Mod diff --git a/src/lib/system/linux/gcc/armv6j_hardfp/Files.Mod b/src/system/linux/gcc/armv6j_hardfp/Files.Mod similarity index 100% rename from src/lib/system/linux/gcc/armv6j_hardfp/Files.Mod rename to src/system/linux/gcc/armv6j_hardfp/Files.Mod diff --git a/src/lib/system/linux/gcc/armv6j_hardfp/Files0.Mod b/src/system/linux/gcc/armv6j_hardfp/Files0.Mod similarity index 100% rename from src/lib/system/linux/gcc/armv6j_hardfp/Files0.Mod rename to src/system/linux/gcc/armv6j_hardfp/Files0.Mod diff --git a/src/lib/system/linux/gcc/armv6j_hardfp/SYSTEM.c0 b/src/system/linux/gcc/armv6j_hardfp/SYSTEM.c0 similarity index 100% rename from src/lib/system/linux/gcc/armv6j_hardfp/SYSTEM.c0 rename to src/system/linux/gcc/armv6j_hardfp/SYSTEM.c0 diff --git a/src/lib/system/linux/gcc/armv6j_hardfp/SYSTEM.h b/src/system/linux/gcc/armv6j_hardfp/SYSTEM.h similarity index 100% rename from src/lib/system/linux/gcc/armv6j_hardfp/SYSTEM.h rename to src/system/linux/gcc/armv6j_hardfp/SYSTEM.h diff --git a/src/lib/system/linux/gcc/armv6j_hardfp/Unix.Mod b/src/system/linux/gcc/armv6j_hardfp/Unix.Mod similarity index 100% rename from src/lib/system/linux/gcc/armv6j_hardfp/Unix.Mod rename to src/system/linux/gcc/armv6j_hardfp/Unix.Mod diff --git a/src/lib/system/linux/gcc/powerpc/Args.Mod b/src/system/linux/gcc/powerpc/Args.Mod similarity index 100% rename from src/lib/system/linux/gcc/powerpc/Args.Mod rename to src/system/linux/gcc/powerpc/Args.Mod diff --git a/src/lib/system/linux/gcc/powerpc/Files.Mod b/src/system/linux/gcc/powerpc/Files.Mod similarity index 100% rename from src/lib/system/linux/gcc/powerpc/Files.Mod rename to src/system/linux/gcc/powerpc/Files.Mod diff --git a/src/lib/system/linux/gcc/powerpc/Files0.Mod b/src/system/linux/gcc/powerpc/Files0.Mod similarity index 100% rename from src/lib/system/linux/gcc/powerpc/Files0.Mod rename to src/system/linux/gcc/powerpc/Files0.Mod diff --git a/src/lib/system/linux/gcc/powerpc/SYSTEM.c0 b/src/system/linux/gcc/powerpc/SYSTEM.c0 similarity index 100% rename from src/lib/system/linux/gcc/powerpc/SYSTEM.c0 rename to src/system/linux/gcc/powerpc/SYSTEM.c0 diff --git a/src/lib/system/linux/gcc/powerpc/SYSTEM.h b/src/system/linux/gcc/powerpc/SYSTEM.h similarity index 100% rename from src/lib/system/linux/gcc/powerpc/SYSTEM.h rename to src/system/linux/gcc/powerpc/SYSTEM.h diff --git a/src/lib/system/linux/gcc/powerpc/Unix.Mod b/src/system/linux/gcc/powerpc/Unix.Mod similarity index 100% rename from src/lib/system/linux/gcc/powerpc/Unix.Mod rename to src/system/linux/gcc/powerpc/Unix.Mod diff --git a/src/lib/system/linux/gcc/x86/Args.Mod b/src/system/linux/gcc/x86/Args.Mod similarity index 100% rename from src/lib/system/linux/gcc/x86/Args.Mod rename to src/system/linux/gcc/x86/Args.Mod diff --git a/src/lib/system/linux/gcc/x86/Files.Mod b/src/system/linux/gcc/x86/Files.Mod similarity index 100% rename from src/lib/system/linux/gcc/x86/Files.Mod rename to src/system/linux/gcc/x86/Files.Mod diff --git a/src/lib/system/linux/gcc/x86/Files0.Mod b/src/system/linux/gcc/x86/Files0.Mod similarity index 100% rename from src/lib/system/linux/gcc/x86/Files0.Mod rename to src/system/linux/gcc/x86/Files0.Mod diff --git a/src/lib/system/linux/gcc/x86/SYSTEM.c0 b/src/system/linux/gcc/x86/SYSTEM.c0 similarity index 100% rename from src/lib/system/linux/gcc/x86/SYSTEM.c0 rename to src/system/linux/gcc/x86/SYSTEM.c0 diff --git a/src/lib/system/linux/gcc/x86/SYSTEM.h b/src/system/linux/gcc/x86/SYSTEM.h similarity index 100% rename from src/lib/system/linux/gcc/x86/SYSTEM.h rename to src/system/linux/gcc/x86/SYSTEM.h diff --git a/src/lib/system/linux/gcc/x86/Unix.Mod b/src/system/linux/gcc/x86/Unix.Mod similarity index 100% rename from src/lib/system/linux/gcc/x86/Unix.Mod rename to src/system/linux/gcc/x86/Unix.Mod diff --git a/src/lib/system/linux/gcc/x86_64/Args.Mod b/src/system/linux/gcc/x86_64/Args.Mod similarity index 100% rename from src/lib/system/linux/gcc/x86_64/Args.Mod rename to src/system/linux/gcc/x86_64/Args.Mod diff --git a/src/lib/system/linux/gcc/x86_64/Files.Mod b/src/system/linux/gcc/x86_64/Files.Mod similarity index 100% rename from src/lib/system/linux/gcc/x86_64/Files.Mod rename to src/system/linux/gcc/x86_64/Files.Mod diff --git a/src/lib/system/linux/gcc/x86_64/Files0.Mod b/src/system/linux/gcc/x86_64/Files0.Mod similarity index 100% rename from src/lib/system/linux/gcc/x86_64/Files0.Mod rename to src/system/linux/gcc/x86_64/Files0.Mod diff --git a/src/lib/system/linux/gcc/x86_64/SYSTEM.c0 b/src/system/linux/gcc/x86_64/SYSTEM.c0 similarity index 100% rename from src/lib/system/linux/gcc/x86_64/SYSTEM.c0 rename to src/system/linux/gcc/x86_64/SYSTEM.c0 diff --git a/src/lib/system/linux/gcc/x86_64/SYSTEM.h b/src/system/linux/gcc/x86_64/SYSTEM.h similarity index 100% rename from src/lib/system/linux/gcc/x86_64/SYSTEM.h rename to src/system/linux/gcc/x86_64/SYSTEM.h diff --git a/src/lib/system/linux/gcc/x86_64/Unix.Mod b/src/system/linux/gcc/x86_64/Unix.Mod similarity index 100% rename from src/lib/system/linux/gcc/x86_64/Unix.Mod rename to src/system/linux/gcc/x86_64/Unix.Mod diff --git a/src/lib/system/openbsd/gcc/Console.Mod b/src/system/openbsd/gcc/Console.Mod similarity index 100% rename from src/lib/system/openbsd/gcc/Console.Mod rename to src/system/openbsd/gcc/Console.Mod diff --git a/src/lib/system/openbsd/gcc/Kernel.Mod b/src/system/openbsd/gcc/Kernel.Mod similarity index 100% rename from src/lib/system/openbsd/gcc/Kernel.Mod rename to src/system/openbsd/gcc/Kernel.Mod diff --git a/src/lib/system/openbsd/gcc/Kernel0.Mod b/src/system/openbsd/gcc/Kernel0.Mod similarity index 100% rename from src/lib/system/openbsd/gcc/Kernel0.Mod rename to src/system/openbsd/gcc/Kernel0.Mod diff --git a/src/lib/system/openbsd/gcc/SYSTEM.Mod b/src/system/openbsd/gcc/SYSTEM.Mod similarity index 100% rename from src/lib/system/openbsd/gcc/SYSTEM.Mod rename to src/system/openbsd/gcc/SYSTEM.Mod diff --git a/src/lib/system/openbsd/gcc/x86_64/Args.Mod b/src/system/openbsd/gcc/x86_64/Args.Mod similarity index 100% rename from src/lib/system/openbsd/gcc/x86_64/Args.Mod rename to src/system/openbsd/gcc/x86_64/Args.Mod diff --git a/src/lib/system/openbsd/gcc/x86_64/Files.Mod b/src/system/openbsd/gcc/x86_64/Files.Mod similarity index 100% rename from src/lib/system/openbsd/gcc/x86_64/Files.Mod rename to src/system/openbsd/gcc/x86_64/Files.Mod diff --git a/src/lib/system/openbsd/gcc/x86_64/Files0.Mod b/src/system/openbsd/gcc/x86_64/Files0.Mod similarity index 100% rename from src/lib/system/openbsd/gcc/x86_64/Files0.Mod rename to src/system/openbsd/gcc/x86_64/Files0.Mod diff --git a/src/lib/system/openbsd/gcc/x86_64/SYSTEM.c0 b/src/system/openbsd/gcc/x86_64/SYSTEM.c0 similarity index 100% rename from src/lib/system/openbsd/gcc/x86_64/SYSTEM.c0 rename to src/system/openbsd/gcc/x86_64/SYSTEM.c0 diff --git a/src/lib/system/openbsd/gcc/x86_64/SYSTEM.h b/src/system/openbsd/gcc/x86_64/SYSTEM.h similarity index 100% rename from src/lib/system/openbsd/gcc/x86_64/SYSTEM.h rename to src/system/openbsd/gcc/x86_64/SYSTEM.h diff --git a/src/lib/system/openbsd/gcc/x86_64/Unix.Mod b/src/system/openbsd/gcc/x86_64/Unix.Mod similarity index 100% rename from src/lib/system/openbsd/gcc/x86_64/Unix.Mod rename to src/system/openbsd/gcc/x86_64/Unix.Mod From 5b3062f475f18551984c4f177be8572019b56360 Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 16 Jun 2016 12:29:25 +0100 Subject: [PATCH 061/580] Consolidate files in system directory. --- src/system/{darwin/clang/x86_64 => }/Args.Mod | 0 src/system/{linux/clang => }/Console.Mod | 0 src/system/{darwin/clang => }/Files.Mod | 0 src/system/{darwin/clang => }/Files0.Mod | 0 src/system/{freebsd/clang => }/Kernel.Mod | 0 src/system/{freebsd/clang => }/Kernel0.Mod | 0 src/system/{darwin/clang => }/SYSTEM.Mod | 0 src/system/{linux/clang/x86_64 => }/SYSTEM.c0 | 0 src/system/{linux/clang/x86_64 => }/SYSTEM.h | 0 src/system/{linux/gcc/x86_64 => }/Unix.Mod | 0 src/system/darwin/clang/Console.Mod | 89 --- src/system/darwin/clang/Kernel.Mod | 188 ----- src/system/darwin/clang/Kernel0.Mod | 200 ----- src/system/darwin/clang/x86_64/SYSTEM.c0 | 205 ------ src/system/darwin/clang/x86_64/SYSTEM.h | 239 ------ src/system/darwin/clang/x86_64/Unix.Mod | 518 ------------- src/system/freebsd/clang/Console.Mod | 89 --- src/system/freebsd/clang/SYSTEM.Mod | 520 ------------- src/system/freebsd/clang/x86_64/Args.Mod | 65 -- src/system/freebsd/clang/x86_64/Files.Mod | 664 ----------------- src/system/freebsd/clang/x86_64/Files0.Mod | 636 ---------------- src/system/freebsd/clang/x86_64/SYSTEM.c0 | 205 ------ src/system/freebsd/clang/x86_64/SYSTEM.h | 242 ------- src/system/freebsd/clang/x86_64/Unix.Mod | 557 -------------- src/system/linux/clang/Kernel.Mod | 188 ----- src/system/linux/clang/Kernel0.Mod | 200 ----- src/system/linux/clang/SYSTEM.Mod | 520 ------------- src/system/linux/clang/armv6j_hardfp/Args.Mod | 65 -- .../linux/clang/armv6j_hardfp/Files.Mod | 663 ----------------- .../linux/clang/armv6j_hardfp/Files0.Mod | 635 ---------------- .../linux/clang/armv6j_hardfp/SYSTEM.c0 | 205 ------ src/system/linux/clang/armv6j_hardfp/SYSTEM.h | 220 ------ src/system/linux/clang/armv6j_hardfp/Unix.Mod | 482 ------------- src/system/linux/clang/powerpc/Args.Mod | 65 -- src/system/linux/clang/powerpc/Files.Mod | 663 ----------------- src/system/linux/clang/powerpc/Files0.Mod | 635 ---------------- src/system/linux/clang/powerpc/SYSTEM.c0 | 205 ------ src/system/linux/clang/powerpc/SYSTEM.h | 220 ------ src/system/linux/clang/powerpc/Unix.Mod | 465 ------------ src/system/linux/clang/x86/Args.Mod | 65 -- src/system/linux/clang/x86/Files.Mod | 663 ----------------- src/system/linux/clang/x86/Files0.Mod | 635 ---------------- src/system/linux/clang/x86/SYSTEM.c0 | 205 ------ src/system/linux/clang/x86/SYSTEM.h | 220 ------ src/system/linux/clang/x86/Unix.Mod | 465 ------------ src/system/linux/clang/x86_64/Args.Mod | 65 -- src/system/linux/clang/x86_64/Files.Mod | 664 ----------------- src/system/linux/clang/x86_64/Files0.Mod | 636 ---------------- src/system/linux/clang/x86_64/Unix.Mod | 519 ------------- src/system/linux/gcc/Console.Mod | 86 --- src/system/linux/gcc/Kernel.Mod | 188 ----- src/system/linux/gcc/Kernel0.Mod | 200 ----- src/system/linux/gcc/SYSTEM.Mod | 520 ------------- src/system/linux/gcc/armv6j_hardfp/Args.Mod | 65 -- src/system/linux/gcc/armv6j_hardfp/Files.Mod | 663 ----------------- src/system/linux/gcc/armv6j_hardfp/Files0.Mod | 635 ---------------- src/system/linux/gcc/armv6j_hardfp/SYSTEM.c0 | 205 ------ src/system/linux/gcc/armv6j_hardfp/SYSTEM.h | 220 ------ src/system/linux/gcc/armv6j_hardfp/Unix.Mod | 482 ------------- src/system/linux/gcc/powerpc/Args.Mod | 65 -- src/system/linux/gcc/powerpc/Files.Mod | 663 ----------------- src/system/linux/gcc/powerpc/Files0.Mod | 635 ---------------- src/system/linux/gcc/powerpc/SYSTEM.c0 | 205 ------ src/system/linux/gcc/powerpc/SYSTEM.h | 220 ------ src/system/linux/gcc/powerpc/Unix.Mod | 465 ------------ src/system/linux/gcc/x86/Args.Mod | 65 -- src/system/linux/gcc/x86/Files.Mod | 663 ----------------- src/system/linux/gcc/x86/Files0.Mod | 635 ---------------- src/system/linux/gcc/x86/SYSTEM.c0 | 205 ------ src/system/linux/gcc/x86/SYSTEM.h | 220 ------ src/system/linux/gcc/x86/Unix.Mod | 465 ------------ src/system/linux/gcc/x86_64/Args.Mod | 65 -- src/system/linux/gcc/x86_64/Files.Mod | 664 ----------------- src/system/linux/gcc/x86_64/Files0.Mod | 636 ---------------- src/system/linux/gcc/x86_64/SYSTEM.c0 | 205 ------ src/system/linux/gcc/x86_64/SYSTEM.h | 238 ------ src/system/openbsd/gcc/Console.Mod | 86 --- src/system/openbsd/gcc/Kernel.Mod | 206 ------ src/system/openbsd/gcc/Kernel0.Mod | 217 ------ src/system/openbsd/gcc/SYSTEM.Mod | 520 ------------- src/system/openbsd/gcc/x86_64/Args.Mod | 65 -- src/system/openbsd/gcc/x86_64/Files.Mod | 681 ------------------ src/system/openbsd/gcc/x86_64/Files0.Mod | 653 ----------------- src/system/openbsd/gcc/x86_64/SYSTEM.c0 | 205 ------ src/system/openbsd/gcc/x86_64/SYSTEM.h | 239 ------ src/system/openbsd/gcc/x86_64/Unix.Mod | 595 --------------- 86 files changed, 27030 deletions(-) rename src/system/{darwin/clang/x86_64 => }/Args.Mod (100%) rename src/system/{linux/clang => }/Console.Mod (100%) rename src/system/{darwin/clang => }/Files.Mod (100%) rename src/system/{darwin/clang => }/Files0.Mod (100%) rename src/system/{freebsd/clang => }/Kernel.Mod (100%) rename src/system/{freebsd/clang => }/Kernel0.Mod (100%) rename src/system/{darwin/clang => }/SYSTEM.Mod (100%) rename src/system/{linux/clang/x86_64 => }/SYSTEM.c0 (100%) rename src/system/{linux/clang/x86_64 => }/SYSTEM.h (100%) rename src/system/{linux/gcc/x86_64 => }/Unix.Mod (100%) delete mode 100644 src/system/darwin/clang/Console.Mod delete mode 100644 src/system/darwin/clang/Kernel.Mod delete mode 100644 src/system/darwin/clang/Kernel0.Mod delete mode 100644 src/system/darwin/clang/x86_64/SYSTEM.c0 delete mode 100644 src/system/darwin/clang/x86_64/SYSTEM.h delete mode 100644 src/system/darwin/clang/x86_64/Unix.Mod delete mode 100644 src/system/freebsd/clang/Console.Mod delete mode 100644 src/system/freebsd/clang/SYSTEM.Mod delete mode 100644 src/system/freebsd/clang/x86_64/Args.Mod delete mode 100644 src/system/freebsd/clang/x86_64/Files.Mod delete mode 100644 src/system/freebsd/clang/x86_64/Files0.Mod delete mode 100644 src/system/freebsd/clang/x86_64/SYSTEM.c0 delete mode 100644 src/system/freebsd/clang/x86_64/SYSTEM.h delete mode 100644 src/system/freebsd/clang/x86_64/Unix.Mod delete mode 100644 src/system/linux/clang/Kernel.Mod delete mode 100644 src/system/linux/clang/Kernel0.Mod delete mode 100644 src/system/linux/clang/SYSTEM.Mod delete mode 100644 src/system/linux/clang/armv6j_hardfp/Args.Mod delete mode 100644 src/system/linux/clang/armv6j_hardfp/Files.Mod delete mode 100644 src/system/linux/clang/armv6j_hardfp/Files0.Mod delete mode 100644 src/system/linux/clang/armv6j_hardfp/SYSTEM.c0 delete mode 100644 src/system/linux/clang/armv6j_hardfp/SYSTEM.h delete mode 100644 src/system/linux/clang/armv6j_hardfp/Unix.Mod delete mode 100644 src/system/linux/clang/powerpc/Args.Mod delete mode 100644 src/system/linux/clang/powerpc/Files.Mod delete mode 100644 src/system/linux/clang/powerpc/Files0.Mod delete mode 100644 src/system/linux/clang/powerpc/SYSTEM.c0 delete mode 100644 src/system/linux/clang/powerpc/SYSTEM.h delete mode 100644 src/system/linux/clang/powerpc/Unix.Mod delete mode 100644 src/system/linux/clang/x86/Args.Mod delete mode 100644 src/system/linux/clang/x86/Files.Mod delete mode 100644 src/system/linux/clang/x86/Files0.Mod delete mode 100644 src/system/linux/clang/x86/SYSTEM.c0 delete mode 100644 src/system/linux/clang/x86/SYSTEM.h delete mode 100644 src/system/linux/clang/x86/Unix.Mod delete mode 100644 src/system/linux/clang/x86_64/Args.Mod delete mode 100644 src/system/linux/clang/x86_64/Files.Mod delete mode 100644 src/system/linux/clang/x86_64/Files0.Mod delete mode 100644 src/system/linux/clang/x86_64/Unix.Mod delete mode 100644 src/system/linux/gcc/Console.Mod delete mode 100644 src/system/linux/gcc/Kernel.Mod delete mode 100644 src/system/linux/gcc/Kernel0.Mod delete mode 100644 src/system/linux/gcc/SYSTEM.Mod delete mode 100644 src/system/linux/gcc/armv6j_hardfp/Args.Mod delete mode 100644 src/system/linux/gcc/armv6j_hardfp/Files.Mod delete mode 100644 src/system/linux/gcc/armv6j_hardfp/Files0.Mod delete mode 100644 src/system/linux/gcc/armv6j_hardfp/SYSTEM.c0 delete mode 100644 src/system/linux/gcc/armv6j_hardfp/SYSTEM.h delete mode 100644 src/system/linux/gcc/armv6j_hardfp/Unix.Mod delete mode 100644 src/system/linux/gcc/powerpc/Args.Mod delete mode 100644 src/system/linux/gcc/powerpc/Files.Mod delete mode 100644 src/system/linux/gcc/powerpc/Files0.Mod delete mode 100644 src/system/linux/gcc/powerpc/SYSTEM.c0 delete mode 100644 src/system/linux/gcc/powerpc/SYSTEM.h delete mode 100644 src/system/linux/gcc/powerpc/Unix.Mod delete mode 100644 src/system/linux/gcc/x86/Args.Mod delete mode 100644 src/system/linux/gcc/x86/Files.Mod delete mode 100644 src/system/linux/gcc/x86/Files0.Mod delete mode 100644 src/system/linux/gcc/x86/SYSTEM.c0 delete mode 100644 src/system/linux/gcc/x86/SYSTEM.h delete mode 100644 src/system/linux/gcc/x86/Unix.Mod delete mode 100644 src/system/linux/gcc/x86_64/Args.Mod delete mode 100644 src/system/linux/gcc/x86_64/Files.Mod delete mode 100644 src/system/linux/gcc/x86_64/Files0.Mod delete mode 100644 src/system/linux/gcc/x86_64/SYSTEM.c0 delete mode 100644 src/system/linux/gcc/x86_64/SYSTEM.h delete mode 100644 src/system/openbsd/gcc/Console.Mod delete mode 100644 src/system/openbsd/gcc/Kernel.Mod delete mode 100644 src/system/openbsd/gcc/Kernel0.Mod delete mode 100644 src/system/openbsd/gcc/SYSTEM.Mod delete mode 100644 src/system/openbsd/gcc/x86_64/Args.Mod delete mode 100644 src/system/openbsd/gcc/x86_64/Files.Mod delete mode 100644 src/system/openbsd/gcc/x86_64/Files0.Mod delete mode 100644 src/system/openbsd/gcc/x86_64/SYSTEM.c0 delete mode 100644 src/system/openbsd/gcc/x86_64/SYSTEM.h delete mode 100644 src/system/openbsd/gcc/x86_64/Unix.Mod diff --git a/src/system/darwin/clang/x86_64/Args.Mod b/src/system/Args.Mod similarity index 100% rename from src/system/darwin/clang/x86_64/Args.Mod rename to src/system/Args.Mod diff --git a/src/system/linux/clang/Console.Mod b/src/system/Console.Mod similarity index 100% rename from src/system/linux/clang/Console.Mod rename to src/system/Console.Mod diff --git a/src/system/darwin/clang/Files.Mod b/src/system/Files.Mod similarity index 100% rename from src/system/darwin/clang/Files.Mod rename to src/system/Files.Mod diff --git a/src/system/darwin/clang/Files0.Mod b/src/system/Files0.Mod similarity index 100% rename from src/system/darwin/clang/Files0.Mod rename to src/system/Files0.Mod diff --git a/src/system/freebsd/clang/Kernel.Mod b/src/system/Kernel.Mod similarity index 100% rename from src/system/freebsd/clang/Kernel.Mod rename to src/system/Kernel.Mod diff --git a/src/system/freebsd/clang/Kernel0.Mod b/src/system/Kernel0.Mod similarity index 100% rename from src/system/freebsd/clang/Kernel0.Mod rename to src/system/Kernel0.Mod diff --git a/src/system/darwin/clang/SYSTEM.Mod b/src/system/SYSTEM.Mod similarity index 100% rename from src/system/darwin/clang/SYSTEM.Mod rename to src/system/SYSTEM.Mod diff --git a/src/system/linux/clang/x86_64/SYSTEM.c0 b/src/system/SYSTEM.c0 similarity index 100% rename from src/system/linux/clang/x86_64/SYSTEM.c0 rename to src/system/SYSTEM.c0 diff --git a/src/system/linux/clang/x86_64/SYSTEM.h b/src/system/SYSTEM.h similarity index 100% rename from src/system/linux/clang/x86_64/SYSTEM.h rename to src/system/SYSTEM.h diff --git a/src/system/linux/gcc/x86_64/Unix.Mod b/src/system/Unix.Mod similarity index 100% rename from src/system/linux/gcc/x86_64/Unix.Mod rename to src/system/Unix.Mod diff --git a/src/system/darwin/clang/Console.Mod b/src/system/darwin/clang/Console.Mod deleted file mode 100644 index 93be9373..00000000 --- a/src/system/darwin/clang/Console.Mod +++ /dev/null @@ -1,89 +0,0 @@ -MODULE Console; (* J. Templ, 29-June-96 *) - - (* output to Unix standard output device based Write system call *) - - IMPORT SYSTEM; - - VAR line: ARRAY 128 OF CHAR; - pos: INTEGER; - - PROCEDURE -includeUnistd() - "#include "; - - PROCEDURE -Write(adr, n: LONGINT) - "write(1/*stdout*/, adr, n)"; - - PROCEDURE -read(VAR ch: CHAR): LONGINT - "read(0/*stdin*/, ch, 1)"; - - PROCEDURE Flush*(); - BEGIN - Write(SYSTEM.ADR(line), pos); pos := 0; - END Flush; - - PROCEDURE Char*(ch: CHAR); - BEGIN - IF pos = LEN(line) THEN Flush() END ; - line[pos] := ch; INC(pos); - IF ch = 0AX THEN Flush() END - END Char; - - PROCEDURE String*(s: ARRAY OF CHAR); - VAR i: INTEGER; - BEGIN i := 0; - WHILE s[i] # 0X DO Char(s[i]); INC(i) END - END String; - - PROCEDURE Int*(i, n: LONGINT); - VAR s: ARRAY 32 OF CHAR; i1, k: LONGINT; - BEGIN - IF i = SYSTEM.LSH(LONG(LONG(1)), SIZE(LONGINT)*8 - 1) THEN - IF SIZE(LONGINT) = 8 THEN s := "8085774586302733229"; k := 19 - ELSE s := "8463847412"; k := 10 - END - ELSE - i1 := ABS(i); - s[0] := CHR(i1 MOD 10 + ORD("0")); i1 := i1 DIV 10; k := 1; - WHILE i1 > 0 DO s[k] := CHR(i1 MOD 10 + ORD("0")); i1 := i1 DIV 10; INC(k) END - END ; - IF i < 0 THEN s[k] := "-"; INC(k) END ; - WHILE n > k DO Char(" "); DEC(n) END ; - WHILE k > 0 DO DEC(k); Char(s[k]) END - END Int; - - PROCEDURE Ln*; - BEGIN Char(0AX); (* Unix end-of-line *) - END Ln; - - PROCEDURE Bool*(b: BOOLEAN); - BEGIN IF b THEN String("TRUE") ELSE String("FALSE") END - END Bool; - - PROCEDURE Hex*(i: LONGINT); - VAR k, n: LONGINT; - BEGIN - k := -28; - WHILE k <= 0 DO - n := ASH(i, k) MOD 16; - IF n <= 9 THEN Char(CHR(ORD("0") + n)) ELSE Char(CHR(ORD("A") - 10 + n)) END ; - INC(k, 4) - END - END Hex; - - PROCEDURE Read*(VAR ch: CHAR); - VAR n: LONGINT; - BEGIN Flush(); - n := read(ch); - IF n # 1 THEN ch := 0X END - END Read; - - PROCEDURE ReadLine*(VAR line: ARRAY OF CHAR); - VAR i: LONGINT; ch: CHAR; - BEGIN Flush(); - i := 0; Read(ch); - WHILE (i < LEN(line) - 1) & (ch # 0AX) & (ch # 0X) DO line[i] := ch; INC(i); Read(ch) END ; - line[i] := 0X - END ReadLine; - -BEGIN pos := 0; -END Console. diff --git a/src/system/darwin/clang/Kernel.Mod b/src/system/darwin/clang/Kernel.Mod deleted file mode 100644 index f49d9b0c..00000000 --- a/src/system/darwin/clang/Kernel.Mod +++ /dev/null @@ -1,188 +0,0 @@ -MODULE Kernel; -(* - J. Templ, 16.4.95 - communication with C-runtime and storage management -*) - - IMPORT SYSTEM, Unix, Args; - - TYPE - RealTime = POINTER TO TimeDesc; - TimeDesc = RECORD - sec, min, hour, mday, mon, year, wday, isdst, zone, gmtoff: LONGINT - END ; - - KeyCmd* = PROCEDURE; - - ObjFinalizer* = PROCEDURE(obj: SYSTEM.PTR); - - - VAR - (* trap handling *) - trapEnv*: Unix.JmpBuf; (* saved stack environment for trap handling *) - - (* oberon heap management *) - nofiles*: LONGINT; - - (* input event handling *) - readSet*, readySet*: Unix.FdSet; - - FKey*: ARRAY 16 OF KeyCmd; - - littleEndian*: BOOLEAN; - - TimeUnit*: LONGINT; (* 1 sec *) - - LIB*, CWD*: ARRAY 256 OF CHAR; - OBERON*: ARRAY 1024 OF CHAR; - - - timeStart: LONGINT; (* milliseconds *) - - PROCEDURE -includesetjmp() - '#include "setjmp.h"'; -(* for localtime *) - PROCEDURE -includetime() - '#include "time.h"'; - - PROCEDURE -Lock*() - "SYSTEM_lock++"; - - PROCEDURE -Unlock*() - "SYSTEM_lock--; if (SYSTEM_interrupted && SYSTEM_lock == 0) __HALT(-9)"; - - PROCEDURE -Exit*(n: LONGINT) - "exit(n)"; - - PROCEDURE -sigsetjmp*(VAR env: Unix.JmpBuf; savemask: LONGINT): LONGINT - "__sigsetjmp(env, savemask)"; - - PROCEDURE -siglongjmp*(VAR env:Unix.JmpBuf; val: LONGINT) - "siglongjmp(env, val)"; - - PROCEDURE -heapsize*(): LONGINT - "SYSTEM_heapsize"; - - PROCEDURE -allocated*(): LONGINT - "SYSTEM_allocated"; - - PROCEDURE -localtime(VAR clock: LONGINT): RealTime - "(Kernel_RealTime)localtime(clock)"; - - PROCEDURE -malloc*(size: LONGINT): LONGINT - "(LONGINT)malloc(size)"; - - PROCEDURE -free*(adr: LONGINT) - "(void)free(adr)"; - - PROCEDURE -getcwd(VAR cwd: Unix.Name) - "getcwd(cwd, cwd__len)"; - - - PROCEDURE GetClock* (VAR t, d: LONGINT); - VAR tv: Unix.Timeval; tz: Unix.Timezone; time: RealTime; - l : LONGINT; - BEGIN - l := Unix.Gettimeofday(tv, tz); - time := localtime(tv.sec); - t := time.sec + ASH(time.min, 6) + ASH(time.hour, 12); - d := time.mday + ASH(time.mon+1, 5) + ASH(time.year MOD 100, 9); - END GetClock; - - PROCEDURE SetClock* (t, d: LONGINT); - VAR err: ARRAY 25 OF CHAR; - BEGIN err := "not yet implemented"; HALT(99) - END SetClock; - - PROCEDURE Time*(): LONGINT; - VAR timeval: Unix.Timeval; timezone: Unix.Timezone; - l : LONGINT; - BEGIN - l := Unix.Gettimeofday(timeval, timezone); - RETURN (timeval.usec DIV 1000 + timeval.sec * 1000 - timeStart) MOD 7FFFFFFFH - END Time; - -(* - PROCEDURE UserTime*(): LONGINT; - VAR rusage: Unix.Rusage; - BEGIN - Unix.Getrusage(0, S.ADR(rusage)); - RETURN rusage.utime.sec*1000 + rusage.utime.usec DIV 1000 - (* + rusage.stime.sec*1000 + rusage.stime.usec DIV 1000*) - END UserTime; -*) - - PROCEDURE Select*(delay: LONGINT); - VAR rs, ws, xs: Unix.FdSet; n: LONGINT; tv: Unix.Timeval; - BEGIN - rs := readSet; - FOR n := 0 TO 7 DO ws[n] := {}; xs[n] := {}; readySet[n] := {} END; - IF delay < 0 THEN delay := 0 END ; - tv.sec := delay DIV 1000; tv.usec := SHORT(delay MOD 1000 * 1000); - n := Unix.Select(256, rs, ws, xs, tv); - IF n >= 0 THEN readySet := rs END - END Select; - - PROCEDURE -GC*(markStack: BOOLEAN) - "SYSTEM_GC(markStack)"; - - PROCEDURE -RegisterObject*(obj: SYSTEM.PTR; finalize: ObjFinalizer) - "SYSTEM_REGFIN(obj, finalize)"; - - PROCEDURE -SetHalt*(p: PROCEDURE(n: LONGINT)) - "SYSTEM_Halt = p"; - - PROCEDURE InstallTermHandler*(p: PROCEDURE); - (* not yet supported; no Modules.Free *) - END InstallTermHandler; - - PROCEDURE LargestAvailable*(): LONGINT; - BEGIN - (* dummy proc for System 3 compatibility - no meaningful value except may be the remaining swap space can be returned - in the context of an extensible heap *) - RETURN MAX(LONGINT) - END LargestAvailable; - - PROCEDURE Halt(n: LONGINT); - VAR res: LONGINT; - BEGIN res := Unix.Kill(Unix.Getpid(), 4); - END Halt; - - PROCEDURE EndianTest; - VAR i: LONGINT; dmy: INTEGER; - BEGIN - dmy := 1; i := SYSTEM.ADR(dmy); - SYSTEM.GET(i, littleEndian); (* indirection via i avoids warning on SUN cc -O *) - END EndianTest; - - PROCEDURE -SizeofUnixJmpBuf(): INTEGER - "sizeof(Unix_JmpBuf)"; - - PROCEDURE -SizeofSigJmpBuf(): INTEGER - "sizeof(sigjmp_buf)"; - - PROCEDURE -Error(msg: ARRAY OF CHAR; len: INTEGER) - "write(1/*stdout*/, msg, len); char ch = 0xa; write(1, &ch, 1)"; - - PROCEDURE JmpBufCheck; (* check for inconsistent usage of sigjmp_buf *) - VAR x, y: LONGINT; - BEGIN - x := SizeofUnixJmpBuf(); - y := SizeofSigJmpBuf(); - IF x < y THEN - Error("Kernel.JmpBufCheck: inconsistent usage of sigjmp_buf", 52); - Exit(1); - END - END JmpBufCheck; - -BEGIN - EndianTest(); - SetHalt(Halt); - CWD := ""; OBERON := "."; LIB := ""; - getcwd(CWD); - Args.GetEnv("OBERON", OBERON); - Args.GetEnv("OBERON_LIB", LIB); - TimeUnit := 1000; timeStart := 0; timeStart := Time(); - JmpBufCheck() -END Kernel. diff --git a/src/system/darwin/clang/Kernel0.Mod b/src/system/darwin/clang/Kernel0.Mod deleted file mode 100644 index 70fe38f1..00000000 --- a/src/system/darwin/clang/Kernel0.Mod +++ /dev/null @@ -1,200 +0,0 @@ -MODULE Kernel0; -(* - J. Templ, 16.4.95 - communication with C-runtime and storage management -*) -(* version for bootstrapping voc *) - - IMPORT SYSTEM, Unix, Args, Strings, version; - - TYPE - RealTime = POINTER TO TimeDesc; - TimeDesc = RECORD - sec, min, hour, mday, mon, year, wday, isdst, zone, gmtoff: LONGINT -(* sec, min, hour, mday, mon, year, wday, isdst, zone, gmtoff: INTEGER*) - END ; - - KeyCmd* = PROCEDURE; - - ObjFinalizer* = PROCEDURE(obj: SYSTEM.PTR); - - - VAR - (* trap handling *) - trapEnv*: Unix.JmpBuf; (* saved stack environment for trap handling *) - - (* oberon heap management *) - nofiles*: LONGINT; - - (* input event handling *) - readSet*, readySet*: Unix.FdSet; - - FKey*: ARRAY 16 OF KeyCmd; - - littleEndian*: BOOLEAN; - - TimeUnit*: LONGINT; (* 1 sec *) - - LIB*, CWD*: ARRAY 256 OF CHAR; - OBERON*: ARRAY 1024 OF CHAR; - MODULES-: ARRAY 1024 OF CHAR; - - prefix*, fullprefix* : ARRAY 256 OF CHAR; - timeStart: LONGINT; (* milliseconds *) - - - PROCEDURE -includesetjmp() - '#include "setjmp.h"'; -(* for localtime *) - PROCEDURE -includetime() - '#include "time.h"'; - - PROCEDURE -Lock*() - "SYSTEM_lock++"; - - PROCEDURE -Unlock*() - "SYSTEM_lock--; if (SYSTEM_interrupted && SYSTEM_lock == 0) __HALT(-9)"; - - PROCEDURE -Exit*(n: LONGINT) - "exit(n)"; - - PROCEDURE -sigsetjmp*(VAR env: Unix.JmpBuf; savemask: LONGINT): LONGINT - "__sigsetjmp(env, savemask)"; - - PROCEDURE -siglongjmp*(VAR env:Unix.JmpBuf; val: LONGINT) - "siglongjmp(env, val)"; - - PROCEDURE -heapsize*(): LONGINT - "SYSTEM_heapsize"; - - PROCEDURE -allocated*(): LONGINT - "SYSTEM_allocated"; - - PROCEDURE -localtime(VAR clock: LONGINT): RealTime - "(Kernel0_RealTime)localtime(clock)"; - - PROCEDURE -malloc*(size: LONGINT): LONGINT - "(LONGINT)malloc(size)"; - - PROCEDURE -free*(adr: LONGINT) - "(void)free(adr)"; - - PROCEDURE -getcwd(VAR cwd: Unix.Name) - "getcwd(cwd, cwd__len)"; - - - PROCEDURE GetClock* (VAR t, d: LONGINT); - VAR tv: Unix.Timeval; tz: Unix.Timezone; time: RealTime; - l : LONGINT; - BEGIN - l := Unix.Gettimeofday(tv, tz); - time := localtime(tv.sec); - t := time.sec + ASH(time.min, 6) + ASH(time.hour, 12); - d := time.mday + ASH(time.mon+1, 5) + ASH(time.year MOD 100, 9); - END GetClock; - - PROCEDURE SetClock* (t, d: LONGINT); - VAR err: ARRAY 25 OF CHAR; - BEGIN err := "not yet implemented"; HALT(99) - END SetClock; - - PROCEDURE Time*(): LONGINT; - VAR timeval: Unix.Timeval; timezone: Unix.Timezone; - l : LONGINT; - BEGIN - l := Unix.Gettimeofday(timeval, timezone); - RETURN (timeval.usec DIV 1000 + timeval.sec * 1000 - timeStart) MOD 7FFFFFFFH - END Time; - -(* - PROCEDURE UserTime*(): LONGINT; - VAR rusage: Unix.Rusage; - BEGIN - Unix.Getrusage(0, S.ADR(rusage)); - RETURN rusage.utime.sec*1000 + rusage.utime.usec DIV 1000 - (* + rusage.stime.sec*1000 + rusage.stime.usec DIV 1000*) - END UserTime; -*) - - PROCEDURE Select*(delay: LONGINT); - VAR rs, ws, xs: Unix.FdSet; n: LONGINT; tv: Unix.Timeval; - BEGIN - rs := readSet; - FOR n := 0 TO 7 DO ws[n] := {}; xs[n] := {}; readySet[n] := {} END; - IF delay < 0 THEN delay := 0 END ; - tv.sec := delay DIV 1000; tv.usec := SHORT(delay MOD 1000 * 1000); - n := Unix.Select(256, rs, ws, xs, tv); - IF n >= 0 THEN readySet := rs END - END Select; - - PROCEDURE -GC*(markStack: BOOLEAN) - "SYSTEM_GC(markStack)"; - - PROCEDURE -RegisterObject*(obj: SYSTEM.PTR; finalize: ObjFinalizer) - "SYSTEM_REGFIN(obj, finalize)"; - - PROCEDURE -SetHalt*(p: PROCEDURE(n: LONGINT)) - "SYSTEM_Halt = p"; - - PROCEDURE InstallTermHandler*(p: PROCEDURE); - (* not yet supported; no Modules.Free *) - END InstallTermHandler; - - PROCEDURE LargestAvailable*(): LONGINT; - BEGIN - (* dummy proc for System 3 compatibility - no meaningful value except may be the remaining swap space can be returned - in the context of an extensible heap *) - RETURN MAX(LONGINT) - END LargestAvailable; - - PROCEDURE Halt(n: LONGINT); - VAR res: LONGINT; - BEGIN res := Unix.Kill(Unix.Getpid(), 4); - END Halt; - - PROCEDURE EndianTest; - VAR i: LONGINT; dmy: INTEGER; - BEGIN - dmy := 1; i := SYSTEM.ADR(dmy); - SYSTEM.GET(i, littleEndian); (* indirection via i avoids warning on SUN cc -O *) - END EndianTest; - - PROCEDURE -SizeofUnixJmpBuf(): INTEGER - "sizeof(Unix_JmpBuf)"; - - PROCEDURE -SizeofSigJmpBuf(): INTEGER - "sizeof(sigjmp_buf)"; - - PROCEDURE -Error(msg: ARRAY OF CHAR; len: INTEGER) - "write(1/*stdout*/, msg, len); char ch = 0xa; write(1, &ch, 1)"; - - PROCEDURE JmpBufCheck; (* check for inconsistent usage of sigjmp_buf *) - VAR x, y: LONGINT; - BEGIN - x := SizeofUnixJmpBuf(); - y := SizeofSigJmpBuf(); - IF x < y THEN - Error("Kernel.JmpBufCheck: inconsistent usage of sigjmp_buf", 52); - Exit(1); - END - END JmpBufCheck; - -BEGIN - EndianTest(); - SetHalt(Halt); - CWD := ""; OBERON := "."; LIB := ""; - MODULES := ""; (* additional modules path which can be specified on commandline and will be added to the OBERON variable; noch *) - getcwd(CWD); - Args.GetEnv ("MODULES", MODULES); - Args.GetEnv("OBERON", OBERON); - (* always have current directory in module search path, noch *) - Strings.Append(":.:", OBERON); - Strings.Append(MODULES, OBERON); - Strings.Append(":", OBERON); - Strings.Append(version.prefix, OBERON); - Strings.Append("/lib/voc/sym:", OBERON); - Args.GetEnv("OBERON_LIB", LIB); - TimeUnit := 1000; timeStart := 0; timeStart := Time(); - JmpBufCheck() -END Kernel0. diff --git a/src/system/darwin/clang/x86_64/SYSTEM.c0 b/src/system/darwin/clang/x86_64/SYSTEM.c0 deleted file mode 100644 index 17801802..00000000 --- a/src/system/darwin/clang/x86_64/SYSTEM.c0 +++ /dev/null @@ -1,205 +0,0 @@ -/* -* The body prefix file of the voc(jet backend) runtime system, Version 1.0 -* -* Copyright (c) Software Templ, 1994, 1995 -* -* Module SYSTEM is subject to change any time without prior notification. -* Software Templ disclaims all warranties with regard to module SYSTEM, -* in particular shall Software Templ not be liable for any damage resulting -* from inappropriate use or modification of module SYSTEM. -* -* Version 1.1 jt, 24.11.95 fixes for correct pointer arithmetic on Cray computers -* jt 31.1.2007 ANSI prototypes for malloc and exit in order to avoid cc warnings -* -*/ - -#include "SYSTEM.h" -#ifdef __STDC__ -#include "stdarg.h" -#else -#include "varargs.h" -#endif - -extern void *malloc(size_t size); -extern void exit(int status); - -void (*SYSTEM_Halt)(); -LONGINT SYSTEM_halt; /* x in HALT(x) */ -LONGINT SYSTEM_assert; /* x in ASSERT(cond, x) */ -LONGINT SYSTEM_argc; -LONGINT SYSTEM_argv; -LONGINT SYSTEM_lock; -BOOLEAN SYSTEM_interrupted; -static LONGINT SYSTEM_mainfrm; /* adr of main proc stack frame, used for stack collection */ - -#define Lock SYSTEM_lock++ -#define Unlock SYSTEM_lock--; if (SYSTEM_interrupted && (SYSTEM_lock == 0)) __HALT(-9) - - -static void SYSTEM_InitHeap(); -void *SYSTEM__init(); - -void SYSTEM_INIT(argc, argvadr) - int argc; long argvadr; -{ - SYSTEM_mainfrm = argvadr; - SYSTEM_argc = argc; - SYSTEM_argv = *(long*)argvadr; - SYSTEM_InitHeap(); - SYSTEM_halt = -128; - SYSTEM__init(); -} - -void SYSTEM_FINI() -{ - SYSTEM_FINALL(); -} - -long SYSTEM_XCHK(i, ub) long i, ub; {return __X(i, ub);} -long SYSTEM_RCHK(i, ub) long i, ub; {return __R(i, ub);} -long SYSTEM_ASH(i, n) long i, n; {return __ASH(i, n);} -long SYSTEM_ABS(i) long i; {return __ABS(i);} -double SYSTEM_ABSD(i) double i; {return __ABS(i);} - -void SYSTEM_INHERIT(t, t0) - long *t, *t0; -{ - t -= __TPROC0OFF; - t0 -= __TPROC0OFF; - while (*t0 != __EOM) {*t = *t0; t--; t0--;} -} - -void SYSTEM_ENUMP(adr, n, P) - long *adr; - long n; - void (*P)(); -{ - while (n > 0) {P(*adr); adr++; n--;} -} - -void SYSTEM_ENUMR(adr, typ, size, n, P) - char *adr; - long *typ, size, n; - void (*P)(); -{ - long *t, off; - typ++; - while (n > 0) { - t = typ; - off = *t; - while (off >= 0) {P(*(long*)(adr+off)); t++; off = *t;} - adr += size; n--; - } -} - -long SYSTEM_DIV(x, y) - unsigned long x, y; -{ if ((long) x >= 0) return (x / y); - else return -((y - 1 - x) / y); -} - -long SYSTEM_MOD(x, y) - unsigned long x, y; -{ unsigned long m; - if ((long) x >= 0) return (x % y); - else { m = (-x) % y; - if (m != 0) return (y - m); else return 0; - } -} - -long SYSTEM_ENTIER(x) - double x; -{ - long y; - if (x >= 0) - return (long)x; - else { - y = (long)x; - if (y <= x) return y; else return y - 1; - } -} - -void SYSTEM_HALT(n) - int n; -{ - SYSTEM_halt = n; - if (SYSTEM_Halt!=0) SYSTEM_Halt(n); - exit(n); -} - -#ifdef __STDC__ -SYSTEM_PTR SYSTEM_NEWARR(long *typ, long elemsz, int elemalgn, int nofdim, int nofdyn, ...) -#else -SYSTEM_PTR SYSTEM_NEWARR(typ, elemsz, elemalgn, nofdim, nofdyn, va_alist) - long *typ, elemsz; - int elemalgn, nofdim, nofdyn; - va_dcl -#endif -{ - long nofelems, size, dataoff, n, nptr, *x, *p, nofptrs, i, *ptab, off; - va_list ap; -#ifdef __STDC__ - va_start(ap, nofdyn); -#else - va_start(ap); -#endif - nofelems = 1; - while (nofdim > 0) { - nofelems = nofelems * va_arg(ap, long); nofdim--; - if (nofelems <= 0) __HALT(-20); - } - va_end(ap); - dataoff = nofdyn * sizeof(long); - if (elemalgn > sizeof(long)) { - n = dataoff % elemalgn; - if (n != 0) dataoff += elemalgn - n; - } - size = dataoff + nofelems * elemsz; - Lock; - if (typ == NIL) { - /* element typ does not contain pointers */ - x = SYSTEM_NEWBLK(size); - } - else if (typ == POINTER__typ) { - /* element type is a pointer */ - x = SYSTEM_NEWBLK(size + nofelems * sizeof(long)); - p = (long*)x[-1]; - p[-nofelems] = *p; /* build new type desc in situ: 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ - p -= nofelems - 1; n = 1; /* n =1 for skipping the size field */ - while (n <= nofelems) {*p = n*sizeof(long); p++; n++;} - *p = - (nofelems + 1) * sizeof(long); /* sentinel */ - x[-1] -= nofelems * sizeof(long); - } - else { - /* element type is a record that contains pointers */ - ptab = typ + 1; nofptrs = 0; - while (ptab[nofptrs] >= 0) {nofptrs++;} /* number of pointers per element */ - nptr = nofelems * nofptrs; /* total number of pointers */ - x = SYSTEM_NEWBLK(size + nptr * sizeof(long)); - p = (long*)x[- 1]; - p[-nptr] = *p; /* build new type desc in situ; 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ - p -= nptr - 1; n = 0; off = dataoff; - while (n < nofelems) {i = 0; - while (i < nofptrs) {*p = off + ptab[i]; p++; i++;} - off += elemsz; n++; - } - *p = - (nptr + 1) * sizeof(long); /* sentinel */ - x[-1] -= nptr * sizeof(long); - } - if (nofdyn != 0) { - /* setup len vector for index checks */ -#ifdef __STDC__ - va_start(ap, nofdyn); -#else - va_start(ap); -#endif - p = x; - while (nofdyn > 0) {*p = va_arg(ap, long); p++, nofdyn--;} - va_end(ap); - } - Unlock; - return x; -} - -/* ----------- end of SYSTEM.co ------------- */ - diff --git a/src/system/darwin/clang/x86_64/SYSTEM.h b/src/system/darwin/clang/x86_64/SYSTEM.h deleted file mode 100644 index 71ec724f..00000000 --- a/src/system/darwin/clang/x86_64/SYSTEM.h +++ /dev/null @@ -1,239 +0,0 @@ -#ifndef SYSTEM__h -#define SYSTEM__h - -/* - -voc (jet backend) runtime system interface and macros library -copyright (c) Josef Templ, 1995, 1996 - -clang for Darwin version -uses double # as concatenation operator - -*/ - -#include -#include /* for type sizes -- noch */ -//#include - -extern void *memcpy(void *dest, const void *src, unsigned long n); -extern void *malloc(size_t size); -extern void exit(int status); - -#define export -#define import extern - -/* constants */ -#define __MAXEXT 16 -#define NIL 0L -#define POINTER__typ (long*)1L /* not NIL and not a valid type */ - -/* basic types */ -//typedef char BOOLEAN; -#define BOOLEAN char -//typedef unsigned char CHAR; -#define CHAR unsigned char -//exactly two bytes -#define LONGCHAR unsigned short int -//typedef signed char SHORTINT; -#define SHORTINT signed char -//for x86 GNU/Linux -//typedef short int INTEGER; -//for x86_64 GNU/Linux -//typedef int INTEGER; -#define INTEGER int -//typedef long LONGINT; -#define LONGINT long -//typedef float REAL; -#define REAL float -//typedef double LONGREAL; -#define LONGREAL double -//typedef unsigned long SET; -#define SET unsigned long -typedef void *SYSTEM_PTR; -//#define *SYSTEM_PTR void -//typedef unsigned char SYSTEM_BYTE; -#define SYSTEM_BYTE unsigned char -typedef int8_t SYSTEM_INT8; -typedef int16_t SYSTEM_INT16; -typedef int32_t SYSTEM_INT32; -typedef int64_t SYSTEM_INT64; - -/* runtime system routines */ -extern long SYSTEM_DIV(); -extern long SYSTEM_MOD(); -extern long SYSTEM_ENTIER(); -extern long SYSTEM_ASH(); -extern long SYSTEM_ABS(); -extern long SYSTEM_XCHK(); -extern long SYSTEM_RCHK(); -extern double SYSTEM_ABSD(); -extern SYSTEM_PTR SYSTEM_NEWREC(); -extern SYSTEM_PTR SYSTEM_NEWBLK(); -#ifdef __STDC__ -extern SYSTEM_PTR SYSTEM_NEWARR(long*, long, int, int, int, ...); -#else -extern SYSTEM_PTR SYSTEM_NEWARR(); -#endif -extern SYSTEM_PTR SYSTEM_REGMOD(); -extern void SYSTEM_INCREF(); -extern void SYSTEM_REGCMD(); -extern void SYSTEM_REGTYP(); -extern void SYSTEM_REGFIN(); -extern void SYSTEM_FINALL(); -extern void SYSTEM_INIT(); -extern void SYSTEM_FINI(); -extern void SYSTEM_HALT(); -extern void SYSTEM_INHERIT(); -extern void SYSTEM_ENUMP(); -extern void SYSTEM_ENUMR(); - -/* module registry */ -#define __DEFMOD static void *m; if(m!=0)return m -#define __REGMOD(name, enum) if(m==0)m=SYSTEM_REGMOD((CHAR*)name,enum); else return m -#define __ENDMOD return m -#define __INIT(argc, argv) static void *m; SYSTEM_INIT(argc, (long)&argv); -#define __REGMAIN(name, enum) m=SYSTEM_REGMOD(name,enum) -#define __FINI SYSTEM_FINI(); return 0 -#define __IMPORT(name) SYSTEM_INCREF(name##__init()) -#define __REGCMD(name, cmd) SYSTEM_REGCMD(m, name, cmd) - -/* SYSTEM ops */ -#define __SYSNEW(p, len) p=SYSTEM_NEWBLK((long)(len)) -#define __VAL(t, x) (*(t*)&(x)) -#define __GET(a, x, t) x= *(t*)(a) -#define __PUT(a, x, t) *(t*)(a)=x -#define __LSHL(x, n, t) ((t)((unsigned t)(x)<<(n))) -#define __LSHR(x, n, t) ((t)((unsigned t)(x)>>(n))) -#define __LSH(x, n, t) ((n)>=0? __LSHL(x, n, t): __LSHR(x, -(n), t)) -#define __ROTL(x, n, t) ((t)((unsigned t)(x)<<(n)|(unsigned t)(x)>>(8*sizeof(t)-(n)))) -#define __ROTR(x, n, t) ((t)((unsigned t)(x)>>(n)|(unsigned t)(x)<<(8*sizeof(t)-(n)))) -#define __LSHR(x, n, t) ((t)((unsigned t)(x)>>(n))) -#define __LSH(x, n, t) ((n)>=0? __LSHL(x, n, t): __LSHR(x, -(n), t)) -#define __ROTL(x, n, t) ((t)((unsigned t)(x)<<(n)|(unsigned t)(x)>>(8*sizeof(t)-(n)))) -#define __ROTR(x, n, t) ((t)((unsigned t)(x)>>(n)|(unsigned t)(x)<<(8*sizeof(t)-(n)))) -#define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) -#define __BIT(x, n) (*(unsigned long*)(x)>>(n)&1) -#define __MOVE(s, d, n) memcpy((char*)(d),(char*)(s),n) - -/* std procs and operator mappings */ -#define __SHORT(x, y) ((int)((unsigned long)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) -#define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) -#define __CHR(x) ((CHAR)__R(x, 256)) -#define __CHRF(x) ((CHAR)__RF(x, 256)) -#define __DIV(x, y) ((x)>=0?(x)/(y):-(((y)-1-(x))/(y))) -#define __DIVF(x, y) SYSTEM_DIV((long)(x),(long)(y)) -#define __MOD(x, y) ((x)>=0?(x)%(y):__MODF(x,y)) -#define __MODF(x, y) SYSTEM_MOD((long)(x),(long)(y)) -#define __NEW(p, t) p=SYSTEM_NEWREC((long)t##__typ) -#define __NEWARR SYSTEM_NEWARR -#define __HALT(x) SYSTEM_HALT(x) -#define __ASSERT(cond, x) if (!(cond)) {SYSTEM_assert = x; SYSTEM_HALT(-1);} -#define __ENTIER(x) SYSTEM_ENTIER(x) -#define __ABS(x) (((x)<0)?-(x):(x)) -#define __ABSF(x) SYSTEM_ABS((long)(x)) -#define __ABSFD(x) SYSTEM_ABSD((double)(x)) -#define __CAP(ch) ((CHAR)((ch)&0x5f)) -#define __ODD(x) ((x)&1) -#define __IN(x, s) (((s)>>(x))&1) -#define __SETOF(x) ((SET)1<<(x)) -#define __SETRNG(l, h) ((~(SET)0<<(l))&~(SET)0>>(8*sizeof(SET)-1-(h))) -#define __MASK(x, m) ((x)&~(m)) -#define __COPY(s, d, n) {char*_a=(void*)s,*_b=(void*)d;long _i=0,_t=n-1;while(_i<_t&&((_b[_i]=_a[_i])!=0)){_i++;};_b[_i]=0;} -static int __STRCMP(x, y) - CHAR *x, *y; -{long i = 0; CHAR ch1, ch2; - do {ch1 = x[i]; ch2 = y[i]; i++; - if (!ch1) return -(int)ch2; - } while (ch1==ch2); - return (int)ch1 - (int)ch2; -} -#define __ASH(x, n) ((n)>=0?__ASHL(x,n):__ASHR(x,-(n))) -#define __ASHL(x, n) ((long)(x)<<(n)) -#define __ASHR(x, n) ((long)(x)>>(n)) -#define __ASHF(x, n) SYSTEM_ASH((long)(x), (long)(n)) -#define __DUP(x, l, t) x=(void*)memcpy(alloca(l*sizeof(t)),x,l*sizeof(t)) -#define __DUPARR(v, t) v=(void*)memcpy(v##__copy,v,sizeof(t)) -#define __DEL(x) /* DUP with alloca frees storage automatically */ -#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(long)typ##__typ) -#define __TYPEOF(p) (*(((long**)(p))-1)) -#define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) - -/* runtime checks */ -#define __X(i, ub) (((unsigned)(long)(i)<(unsigned long)(ub))?i:(__HALT(-2),0)) -#define __XF(i, ub) SYSTEM_XCHK((long)(i), (long)(ub)) -#define __RETCHK __retchk: __HALT(-3) -#define __CASECHK __HALT(-4) -#define __GUARDP(p, typ, level) ((typ*)(__ISP(p,typ,level)?p:(__HALT(-5),p))) -#define __GUARDR(r, typ, level) (*((typ*)(__IS(r##__typ,typ,level)?r:(__HALT(-5),r)))) -#define __GUARDA(p, typ, level) ((struct typ*)(__IS(__TYPEOF(p),typ,level)?p:(__HALT(-5),p))) -#define __GUARDEQR(p, dyntyp, typ) if(dyntyp!=typ##__typ) __HALT(-6);*(p) -#define __GUARDEQP(p, typ) if(__TYPEOF(p)!=typ##__typ)__HALT(-6);*(p) -#define __WITHCHK __HALT(-7) -#define __R(i, ub) (((unsigned)(long)(i)<(unsigned long)(ub))?i:(__HALT(-8),0)) -#define __RF(i, ub) SYSTEM_RCHK((long)(i),(long)(ub)) - -/* record type descriptors */ -#define __TDESC(t, m, n) \ - static struct t##__desc {\ - long tproc[m]; \ - long tag, next, level, module; \ - char name[24]; \ - long *base[__MAXEXT]; \ - char *rsrvd; \ - long blksz, ptr[n+1]; \ - } t##__desc - -#define __BASEOFF (__MAXEXT+1) -#define __TPROC0OFF (__BASEOFF+24/sizeof(long)+5) -#define __EOM 1 -#define __TDFLDS(name, size) {__EOM}, 1, 0, 0, 0, name, {0}, 0, size -#define __ENUMP(adr, n, P) SYSTEM_ENUMP(adr, (long)(n), P) -#define __ENUMR(adr, typ, size, n, P) SYSTEM_ENUMR(adr, typ, (long)(size), (long)(n), P) - -#define __INITYP(t, t0, level) \ - t##__typ= &t##__desc.blksz; \ - memcpy(t##__desc.base, t0##__typ - __BASEOFF, level*sizeof(long)); \ - t##__desc.base[level]=t##__typ; \ - t##__desc.module=(long)m; \ - if(t##__desc.blksz!=sizeof(struct t)) __HALT(-15); \ - t##__desc.blksz=(t##__desc.blksz+5*sizeof(long)-1)/(4*sizeof(long))*(4*sizeof(long)); \ - SYSTEM_REGTYP(m, (long)&t##__desc.next); \ - SYSTEM_INHERIT(t##__typ, t0##__typ) - -/* Oberon-2 type bound procedures support */ -#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(long)proc -#define __SEND(typ, num, funtyp, parlist) ((funtyp)(*(typ-(__TPROC0OFF+num))))parlist - -/* runtime system variables */ -extern LONGINT SYSTEM_argc; -extern LONGINT SYSTEM_argv; -extern void (*SYSTEM_Halt)(); -extern LONGINT SYSTEM_halt; -extern LONGINT SYSTEM_assert; -extern SYSTEM_PTR SYSTEM_modules; -extern LONGINT SYSTEM_heapsize; -extern LONGINT SYSTEM_allocated; -extern LONGINT SYSTEM_lock; -extern SHORTINT SYSTEM_gclock; -extern BOOLEAN SYSTEM_interrupted; - -/* ANSI prototypes; not used so far -static int __STRCMP(CHAR *x, CHAR *y); -void SYSTEM_INIT(int argc, long argvadr); -void SYSTEM_FINI(void); -long SYSTEM_XCHK(long i, long ub); -long SYSTEM_RCHK(long i, long ub); -long SYSTEM_ASH(long i, long n); -long SYSTEM_ABS(long i); -double SYSTEM_ABSD(double i); -void SYSTEM_INHERIT(long *t, long *t0); -void SYSTEM_ENUMP(long *adr, long n, void (*P)(void*)); -void SYSTEM_ENUMR(char *adr, long *typ, long size, long n, void (*P)(void*)); -long SYSTEM_DIV(unsigned long x, unsigned long y); -long SYSTEM_MOD(unsigned long x, unsigned long y); -long SYSTEM_ENTIER(double x); -void SYSTEM_HALT(int n); -*/ - -#endif - diff --git a/src/system/darwin/clang/x86_64/Unix.Mod b/src/system/darwin/clang/x86_64/Unix.Mod deleted file mode 100644 index 012042a0..00000000 --- a/src/system/darwin/clang/x86_64/Unix.Mod +++ /dev/null @@ -1,518 +0,0 @@ -MODULE Unix; (* Josef Templ, 5.3.90 Linux system calls *) -(* ported to gnu x86_64 and added system function, noch *) -(* Module Unix provides a system call interface to Linux. - Naming conventions: - Procedure and Type-names always start with a capital letter. - error numbers as defined in Unix - other constants start with lower case letters *) - -IMPORT SYSTEM; - -CONST - -(* various important constants *) - - stdin* = 0; stdout* =1; stderr* = 2; - - LOCKEX* = 2; LOCKUN* = 8; (* /usr/include/file.h *) - AFINET* = 2; (* /usr/include/sys/socket.h *) - PFINET* = AFINET; (* /usr/include/linux/socket.h *) - SOCKSTREAM* = 1; (* /usr/include/linux/socket.h *) - FIONREAD* = 541BH; (* in /usr/include/asm/termios.h *) - SETFL* = 4; (* set file descriptor flags; in asm/fcntl.h *) - TCP* = 0; - -(* flag sets, cf. /usr/include/asm/fcntl.h *) - rdonly* = {}; wronly* = {0}; rdwr* = {1}; creat* = {6}; excl* = {7}; trunc* = {9}; append* = {10}; ndelay = {11}; - -(* error numbers *) - - EPERM* = 1; (* Not owner *) - ENOENT* = 2; (* No such file or directory *) - ESRCH* = 3; (* No such process *) - EINTR* = 4; (* Interrupted system call *) - EIO* = 5; (* I/O error *) - ENXIO* = 6; (* No such device or address *) - E2BIG* = 7; (* Arg list too long *) - ENOEXEC* = 8; (* Exec format error *) - EBADF* = 9; (* Bad file number *) - ECHILD* = 10; (* No children *) - EAGAIN* = 11; (* No more processes *) - ENOMEM* = 12; (* Not enough core *) - EACCES* = 13; (* Permission denied *) - EFAULT* = 14; (* Bad address *) - ENOTBLK* = 15; (* Block device required *) - EBUSY* = 16; (* Mount device busy *) - EEXIST* = 17; (* File exists *) - EXDEV* = 18; (* Cross-device link *) - ENODEV* = 19; (* No such device *) - ENOTDIR* = 20; (* Not a directory*) - EISDIR* = 21; (* Is a directory *) - EINVAL* = 22; (* Invalid argument *) - ENFILE* = 23; (* File table overflow *) - EMFILE* = 24; (* Too many open files *) - ENOTTY* = 25; (* Not a typewriter *) - ETXTBSY* = 26; (* Text file busy *) - EFBIG* = 27; (* File too large *) - ENOSPC* = 28; (* No space left on device *) - ESPIPE* = 29; (* Illegal seek *) - EROFS* = 30; (* Read-only file system *) - EMLINK* = 31; (* Too many links *) - EPIPE* = 32; (* Broken pipe *) - EDOM* = 33; (* Argument too large *) - ERANGE* = 34; (* Result too large *) - EDEADLK* = 35; (* Resource deadlock would occur *) - ENAMETOOLONG* = 36; (* File name too long *) - ENOLCK* = 37; (* No record locks available *) - ENOSYS* = 38; (* Function not implemented *) - ENOTEMPTY* = 39; (* Directory not empty *) - ELOOP* = 40; (* Too many symbolic links encountered *) - EWOULDBLOCK* = EAGAIN; (* Operation would block *) - ENOMSG* = 42; (* No message of desired type *) - EIDRM* = 43; (* Identifier removed *) - ECHRNG* = 44; (* Channel number out of range *) - EL2NSYNC* = 45; (* Level 2 not synchronized *) - EL3HLT* = 46; (* Level 3 halted *) - EL3RST* = 47; (* Level 3 reset *) - ELNRNG* = 48; (* Link number out of range *) - EUNATCH* = 49; (* Protocol driver not attached *) - ENOCSI* = 50; (* No CSI structure available *) - EL2HLT* = 51; (* Level 2 halted *) - EBADE* = 52; (* Invalid exchange *) - EBADR* = 53; (* Invalid request descriptor *) - EXFULL* = 54; (* Exchange full *) - ENOANO* = 55; (* No anode *) - EBADRQC* = 56; (* Invalid request code *) - EBADSLT* = 57; (* Invalid slot *) - EDEADLOCK* = 58; (* File locking deadlock error *) - EBFONT* = 59; (* Bad font file format *) - ENOSTR* = 60; (* Device not a stream *) - ENODATA* = 61; (* No data available *) - ETIME* = 62; (* Timer expired *) - ENOSR* = 63; (* Out of streams resources *) - ENONET* = 64; (* Machine is not on the network *) - ENOPKG* = 65; (* Package not installed *) - EREMOTE* = 66; (* Object is remote *) - ENOLINK* = 67; (* Link has been severed *) - EADV* = 68; (* Advertise error *) - ESRMNT* = 69; (* Srmount error *) - ECOMM* = 70; (* Communication error on send *) - EPROTO* = 71; (* Protocol error *) - EMULTIHOP* = 72; (* Multihop attempted *) - EDOTDOT* = 73; (* RFS specific error *) - EBADMSG* = 74; (* Not a data message *) - EOVERFLOW* = 75; (* Value too large for defined data type *) - ENOTUNIQ* = 76; (* Name not unique on network *) - EBADFD* = 77; (* File descriptor in bad state *) - EREMCHG* = 78; (* Remote address changed *) - ELIBACC* = 79; (* Can not access a needed shared library *) - ELIBBAD* = 80; (* Accessing a corrupted shared library *) - ELIBSCN* = 81; (* .lib section in a.out corrupted *) - ELIBMAX* = 82; (* Attempting to link in too many shared libraries *) - ELIBEXEC* = 83; (* Cannot exec a shared library directly *) - EILSEQ* = 84; (* Illegal byte sequence *) - ERESTART* = 85; (* Interrupted system call should be restarted *) - ESTRPIPE* = 86; (* Streams pipe error *) - EUSERS* = 87; (* Too many users *) - ENOTSOCK* = 88; (* Socket operation on non-socket *) - EDESTADDRREQ* = 89; (* Destination address required *) - EMSGSIZE* = 90; (* Message too long *) - EPROTOTYPE* = 91; (* Protocol wrong type for socket *) - ENOPROTOOPT* = 92; (* Protocol not available *) - EPROTONOSUPPORT* = 93; (* Protocol not supported *) - ESOCKTNOSUPPORT* = 94; (* Socket type not supported *) - EOPNOTSUPP* = 95; (* Operation not supported on transport endpoint *) - EPFNOSUPPORT* = 96; (* Protocol family not supported *) - EAFNOSUPPORT* = 97; (* Address family not supported by protocol *) - EADDRINUSE* = 98; (* Address already in use *) - EADDRNOTAVAIL* = 99; (* Cannot assign requested address *) - ENETDOWN* = 100; (* Network is down *) - ENETUNREACH* = 101; (* Network is unreachable *) - ENETRESET* = 102; (* Network dropped connection because of reset *) - ECONNABORTED* = 103; (* Software caused connection abort *) - ECONNRESET* = 104; (* Connection reset by peer *) - ENOBUFS* = 105; (* No buffer space available *) - EISCONN* = 106; (* Transport endpoint is already connected *) - ENOTCONN* = 107; (* Transport endpoint is not connected *) - ESHUTDOWN* = 108; (* Cannot send after transport endpoint shutdown *) - ETOOMANYREFS* = 109; (* Too many references: cannot splice *) - ETIMEDOUT* = 110; (* Connection timed out *) - ECONNREFUSED* = 111; (* Connection refused *) - EHOSTDOWN* = 112; (* Host is down *) - EHOSTUNREACH* = 113; (* No route to host *) - EALREADY* = 114; (* Operation already in progress *) - EINPROGRESS* = 115; (* Operation now in progress *) - ESTALE* = 116; (* Stale NFS file handle *) - EUCLEAN* = 117; (* Structure needs cleaning *) - ENOTNAM* = 118; (* Not a XENIX named type file *) - ENAVAIL* = 119; (* No XENIX semaphores available *) - EISNAM* = 120; (* Is a named type file *) - EREMOTEIO* = 121; (* Remote I/O error *) - EDQUOT* = 122; (* Quota exceeded *) - -CONST sigsetarrlength = 1024 / 8 * SIZE(LONGINT); - - -TYPE - - JmpBuf* = RECORD - (* macosx darwin 64bit, cpp /usr/include/setjmp.h - typedef int jmp_buf[((9 * 2) + 3 + 16)]; - typedef int sigjmp_buf[((9 * 2) + 3 + 16) + 1]; - *) - - jmpbuf: ARRAY 38 OF INTEGER; - END ; - - Status* = RECORD (* struct stat *) - dev* : INTEGER; (* dev_t 4 *) - mode*: SHORTINT; mode1*: SHORTINT; (* mode_t 2 *) - nlink* : SHORTINT; nlink1*: SHORTINT; (* nlink_t 2 *) - ino* : LONGINT; (* __darwin_ino64_t 8 *) - uid*, gid*: INTEGER; (* uid_t, gid_t 4 *) - rdev*: INTEGER; (* dev_t 4 *) - atime* : LONGINT; atimences* : LONGINT; (* struct timespec 16 *) - mtime* : LONGINT; mtimences* : LONGINT; (* struct timespec 16 *) - ctime* : LONGINT; ctimences* : LONGINT; (* struct timespec 16 *) - birthtime* : LONGINT; birthtimences* : LONGINT; (* struct timespec 16 *) - size*: LONGINT; (* off_t 8 *) - blocks* : LONGINT; - blksize* : INTEGER; - flags* : INTEGER; - gen* : INTEGER; - lspare* : INTEGER; - qspare*, qspare1*: LONGINT; - END ; - -(* from /usr/include/bits/time.h - -struct timeval - { - __time_t tv_sec; /* Seconds. */ //__time_t 8 - __suseconds_t tv_usec; /* Microseconds. */ __suseconds_t 8 - }; - - -*) - - Timeval* = RECORD - sec*: LONGINT; - usec*: INTEGER - END ; - - -(* -from man gettimeofday - - struct timezone { - int tz_minuteswest; /* minutes west of Greenwich */ int 4 - int tz_dsttime; /* type of DST correction */ int 4 - }; -*) - - - Timezone* = RECORD - (*minuteswest*, dsttime*: LONGINT*) - minuteswest*, dsttime*: INTEGER - END ; - - Itimerval* = RECORD - interval*, value*: Timeval - END ; - - FdSet* = ARRAY 8 OF SET; - - SigCtxPtr* = POINTER TO SigContext; - SigContext* = RECORD - END ; - - SignalHandler* = PROCEDURE (sig, code: LONGINT; scp: SigCtxPtr); - - Dirent* = RECORD - ino, off: LONGINT; - reclen: INTEGER; - name: ARRAY 256 OF CHAR; - END ; - - Rusage* = RECORD - utime*, stime*: Timeval; - maxrss*, ixrss*, idrss*, isrss*, - minflt*, majflt*, nswap*, inblock*, - oublock*, msgsnd*, msgrcv*, nsignals*, - nvcsw*, nivcsw*: LONGINT - END ; - - Iovec* = RECORD - base*, len*: LONGINT - END ; - - SocketPair* = ARRAY 2 OF LONGINT; - - Pollfd* = RECORD - fd*: LONGINT; - events*, revents*: INTEGER - END ; - - Sockaddr* = RECORD - family*: INTEGER; - port*: INTEGER; - internetAddr*: LONGINT; - pad*: ARRAY 8 OF CHAR; - END ; - - HostEntry* = POINTER [1] TO Hostent; - Hostent* = RECORD - name*, aliases*: LONGINT; - addrtype*, length*: LONGINT; - addrlist*: LONGINT; (*POINTER TO POINTER TO LONGINT, network byte order*) - END; - - Name* = ARRAY OF CHAR; - - PROCEDURE -includeStat() - "#include "; - - (* for select() *) - PROCEDURE -includeSelect() - "#include "; - - (* for kill() *) - PROCEDURE -includeSignal() - "#include "; - - (* for read() also *) - PROCEDURE -includeTypes() - "#include "; - - PROCEDURE -includeUio() - "#include "; - - (* for getpid(), lseek(), close(), fsync(), ftruncate(), read(), sleep() *) - PROCEDURE -includeUnistd() - "#include "; - - - (* for rename() *) - PROCEDURE -includeStdio() - "#include "; - - PROCEDURE -includeErrno() - "#include "; - - (* for open() *) - PROCEDURE -includeFcntl() - "#include "; - - PROCEDURE -err(): INTEGER - "errno"; - - PROCEDURE errno*(): INTEGER; - BEGIN - RETURN err() - END errno; - - PROCEDURE -Exit*(n: INTEGER) - "exit(n)"; - - PROCEDURE -Fork*(): INTEGER - "fork()"; - - PROCEDURE -Wait*(VAR status: INTEGER): INTEGER - "wait(status)"; - - PROCEDURE -Select*(width: INTEGER; VAR readfds, writefds, exceptfds: FdSet; VAR timeout: Timeval): INTEGER - "select(width, readfds, writefds, exceptfds, timeout)"; - - PROCEDURE -Gettimeofday* (VAR tv: Timeval; VAR tz: Timezone) : INTEGER - "gettimeofday(tv, tz)"; - - PROCEDURE -Read* (fd: INTEGER; buf, nbyte: LONGINT): LONGINT - "read(fd, buf, nbyte)"; - - PROCEDURE -ReadBlk* (fd: INTEGER; VAR buf: ARRAY OF SYSTEM.BYTE): LONGINT - "read(fd, buf, buf__len)"; - - PROCEDURE -Write* (fd: INTEGER; buf, nbyte: LONGINT): LONGINT - "write(fd, buf, nbyte)"; - - PROCEDURE -WriteBlk* (fd: INTEGER; VAR buf: ARRAY OF SYSTEM.BYTE): LONGINT - "write(fd, buf, buf__len)"; - - PROCEDURE -Dup*(fd: INTEGER): INTEGER - "dup(fd)"; - - PROCEDURE -Dup2*(fd1, fd2: INTEGER): INTEGER - "dup(fd1, fd2)"; - - PROCEDURE -Pipe*(fds : LONGINT): INTEGER - "pipe(fds)"; - - PROCEDURE -Getpid*(): INTEGER - "getpid()"; - - PROCEDURE -Getuid*(): INTEGER - "getuid()"; - - PROCEDURE -Geteuid*(): INTEGER - "geteuid()"; - - PROCEDURE -Getgid*(): INTEGER - "getgid()"; - - PROCEDURE -Getegid*(): INTEGER - "getegid()"; - - PROCEDURE -Unlink*(name: Name): INTEGER - "unlink(name)"; - - PROCEDURE -Open*(name: Name; flag: INTEGER; mode: LONGINT): INTEGER - "open(name, flag, mode)"; - - PROCEDURE -Close*(fd: INTEGER): INTEGER - "close(fd)"; - - PROCEDURE -stat(name: Name; VAR statbuf: Status): INTEGER - "stat((const char*)name, (struct stat*)statbuf)"; - - PROCEDURE Stat*(name: Name; VAR statbuf: Status): INTEGER; - VAR res: INTEGER; - BEGIN - res := stat(name, statbuf); - (* make the first 4 bytes as unique as possible (used in module Files for caching!) *) - (* don't understand this - INC(statbuf.dev, statbuf.devX); - INC(statbuf.rdev, statbuf.rdevX); *) - RETURN res; - END Stat; - - PROCEDURE -fstat(fd: INTEGER; VAR statbuf: Status): INTEGER - "fstat(fd, (struct stat*)statbuf)"; - - PROCEDURE Fstat*(fd: INTEGER; VAR statbuf: Status): INTEGER; - VAR res: INTEGER; - BEGIN - res := fstat(fd, statbuf); - (* make the first 4 bytes as unique as possible (used in module Files for caching!) *) - (*INC(statbuf.dev, statbuf.devX); - INC(statbuf.rdev, statbuf.rdevX); *) - RETURN res; - END Fstat; - - PROCEDURE -Fchmod*(fd, mode: INTEGER): INTEGER - "fchmod(fd, mode)"; - - PROCEDURE -Chmod*(path: Name; mode: INTEGER): INTEGER - "chmod(path, mode)"; - - PROCEDURE -Lseek*(fd: INTEGER; offset: LONGINT; origin: INTEGER): LONGINT - "lseek(fd, offset, origin)"; - - PROCEDURE -Fsync*(fd: INTEGER): INTEGER - "fsync(fd)"; - - PROCEDURE -Fcntl*(fd: INTEGER; cmd: INTEGER; arg: LONGINT ): INTEGER - "fcntl(fd, cmd, arg)"; - - PROCEDURE -Flock*(fd, operation: INTEGER): INTEGER - "flock(fd, operation)"; - - PROCEDURE -Ftruncate*(fd: INTEGER; length: LONGINT): INTEGER - "ftruncate(fd, length)"; - - PROCEDURE -Readblk*(fd: INTEGER; VAR buf: ARRAY OF SYSTEM.BYTE; len: LONGINT): LONGINT - "read(fd, buf, len)"; - - PROCEDURE -Rename*(old, new: Name): INTEGER - "rename(old, new)"; - - PROCEDURE -Chdir*(path: Name): INTEGER - "chdir(path)"; - - PROCEDURE -Ioctl*(fd: INTEGER; request, arg: LONGINT): LONGINT - "ioctl(fd, request, arg)"; - - PROCEDURE -Kill*(pid, sig: INTEGER): INTEGER - "kill(pid, sig)"; - - PROCEDURE -Sigsetmask*(mask: INTEGER): INTEGER - "sigsetmask(mask)"; - - PROCEDURE -Sleep*(ms : INTEGER): INTEGER - "sleep(ms)"; - - PROCEDURE -Nanosleep*(VAR req : Timeval; VAR rem : Timeval): INTEGER - "nanosleep(req, rem)"; - - (* TCP/IP networking *) - - PROCEDURE -Gethostbyname*(name: Name): HostEntry - "(Unix_HostEntry)gethostbyname(name)"; - - PROCEDURE -Gethostname*(VAR name: Name): INTEGER - "gethostname(name, name__len)"; - - PROCEDURE -Socket*(af, type, protocol: INTEGER): INTEGER - "socket(af, type, protocol)"; - - PROCEDURE -Connect*(socket: INTEGER; name: Sockaddr; namelen: INTEGER): INTEGER - "connect(socket, &(name), namelen)"; - - PROCEDURE -Getsockname*(socket: INTEGER; VAR name: Sockaddr; VAR namelen: INTEGER): INTEGER - "getsockname(socket, name, namelen)"; - - PROCEDURE -Bind*(socket: INTEGER; name: Sockaddr; namelen: INTEGER): INTEGER - "bind(socket, &(name), namelen)"; - - PROCEDURE -Listen*(socket, backlog: INTEGER): INTEGER - "listen(socket, backlog)"; - - PROCEDURE -Accept*(socket: INTEGER; VAR addr: Sockaddr; VAR addrlen: INTEGER): LONGINT - "accept(socket, addr, addrlen)"; - - PROCEDURE -Recv*(socket: INTEGER; bufadr, buflen: LONGINT; flags: INTEGER): LONGINT - "recv(socket, bufadr, buflen, flags)"; - - PROCEDURE -Send*(socket: INTEGER; bufadr, buflen: LONGINT; flags: INTEGER): LONGINT - "send(socket, bufadr, buflen, flags)"; - - PROCEDURE -sys(str: ARRAY OF CHAR): INTEGER (* need this to call external tools like gcc or gas; noch *) - "system(str)"; - - PROCEDURE system*(cmd : ARRAY OF CHAR); - VAR r : INTEGER; - BEGIN - r := sys(cmd); - END system; - - PROCEDURE System*(cmd : ARRAY OF CHAR): INTEGER; - VAR r : INTEGER; - BEGIN - r := sys(cmd); - RETURN r - END System; - - PROCEDURE -SizeofUnixStat(): INTEGER - "sizeof(Unix_Status)"; - - PROCEDURE -SizeofStat(): INTEGER - "sizeof(struct stat)"; - - PROCEDURE -Error(msg: ARRAY OF CHAR; len: INTEGER) - "write(1/*stdout*/, msg, len); char ch = 0xa; write(1, &ch, 1)"; - - PROCEDURE StatCheck; - VAR x, y: LONGINT; - BEGIN - x := SizeofUnixStat(); - y := SizeofStat(); - IF x # y THEN - Error("Unix.StatCheck: inconsistent usage of struct stat", 49); - Exit(1); - END - END StatCheck; - -BEGIN - - StatCheck(); - -END Unix. diff --git a/src/system/freebsd/clang/Console.Mod b/src/system/freebsd/clang/Console.Mod deleted file mode 100644 index 93be9373..00000000 --- a/src/system/freebsd/clang/Console.Mod +++ /dev/null @@ -1,89 +0,0 @@ -MODULE Console; (* J. Templ, 29-June-96 *) - - (* output to Unix standard output device based Write system call *) - - IMPORT SYSTEM; - - VAR line: ARRAY 128 OF CHAR; - pos: INTEGER; - - PROCEDURE -includeUnistd() - "#include "; - - PROCEDURE -Write(adr, n: LONGINT) - "write(1/*stdout*/, adr, n)"; - - PROCEDURE -read(VAR ch: CHAR): LONGINT - "read(0/*stdin*/, ch, 1)"; - - PROCEDURE Flush*(); - BEGIN - Write(SYSTEM.ADR(line), pos); pos := 0; - END Flush; - - PROCEDURE Char*(ch: CHAR); - BEGIN - IF pos = LEN(line) THEN Flush() END ; - line[pos] := ch; INC(pos); - IF ch = 0AX THEN Flush() END - END Char; - - PROCEDURE String*(s: ARRAY OF CHAR); - VAR i: INTEGER; - BEGIN i := 0; - WHILE s[i] # 0X DO Char(s[i]); INC(i) END - END String; - - PROCEDURE Int*(i, n: LONGINT); - VAR s: ARRAY 32 OF CHAR; i1, k: LONGINT; - BEGIN - IF i = SYSTEM.LSH(LONG(LONG(1)), SIZE(LONGINT)*8 - 1) THEN - IF SIZE(LONGINT) = 8 THEN s := "8085774586302733229"; k := 19 - ELSE s := "8463847412"; k := 10 - END - ELSE - i1 := ABS(i); - s[0] := CHR(i1 MOD 10 + ORD("0")); i1 := i1 DIV 10; k := 1; - WHILE i1 > 0 DO s[k] := CHR(i1 MOD 10 + ORD("0")); i1 := i1 DIV 10; INC(k) END - END ; - IF i < 0 THEN s[k] := "-"; INC(k) END ; - WHILE n > k DO Char(" "); DEC(n) END ; - WHILE k > 0 DO DEC(k); Char(s[k]) END - END Int; - - PROCEDURE Ln*; - BEGIN Char(0AX); (* Unix end-of-line *) - END Ln; - - PROCEDURE Bool*(b: BOOLEAN); - BEGIN IF b THEN String("TRUE") ELSE String("FALSE") END - END Bool; - - PROCEDURE Hex*(i: LONGINT); - VAR k, n: LONGINT; - BEGIN - k := -28; - WHILE k <= 0 DO - n := ASH(i, k) MOD 16; - IF n <= 9 THEN Char(CHR(ORD("0") + n)) ELSE Char(CHR(ORD("A") - 10 + n)) END ; - INC(k, 4) - END - END Hex; - - PROCEDURE Read*(VAR ch: CHAR); - VAR n: LONGINT; - BEGIN Flush(); - n := read(ch); - IF n # 1 THEN ch := 0X END - END Read; - - PROCEDURE ReadLine*(VAR line: ARRAY OF CHAR); - VAR i: LONGINT; ch: CHAR; - BEGIN Flush(); - i := 0; Read(ch); - WHILE (i < LEN(line) - 1) & (ch # 0AX) & (ch # 0X) DO line[i] := ch; INC(i); Read(ch) END ; - line[i] := 0X - END ReadLine; - -BEGIN pos := 0; -END Console. diff --git a/src/system/freebsd/clang/SYSTEM.Mod b/src/system/freebsd/clang/SYSTEM.Mod deleted file mode 100644 index 6fc08dcf..00000000 --- a/src/system/freebsd/clang/SYSTEM.Mod +++ /dev/null @@ -1,520 +0,0 @@ -(* -* voc (jet backend) runtime system, Version 1.1 -* -* Copyright (c) Software Templ, 1994, 1995, 1996 -* -* Module SYSTEM is subject to change any time without prior notification. -* Software Templ disclaims all warranties with regard to module SYSTEM, -* in particular shall Software Templ not be liable for any damage resulting -* from inappropriate use or modification of module SYSTEM. -*) - -MODULE SYSTEM; (* J. Templ, 31.5.95 *) - - IMPORT SYSTEM; (*must not import other modules*) - - CONST - ModNameLen = 20; - CmdNameLen = 24; - SZL = SIZE(LONGINT); - Unit = 4*SZL; (* smallest possible heap block *) - nofLists = 9; (* number of free_lists *) - heapSize0 = 8000*Unit; (* startup heap size *) - - (* all blocks look the same: - free blocks describe themselves: size = Unit - tag = &tag++ - ->blksize - sentinel = -SZL - next - *) - - (* heap chunks *) - nextChnkOff = 0; (* next heap chunk, sorted ascendingly! *) - endOff = SZL; (* end of heap chunk *) - blkOff = 3*SZL; (* first block in a chunk *) - - (* heap blocks *) - tagOff = 0; (* block starts with tag *) - sizeOff = SZL; (* block size in free block relative to block start *) - sntlOff = 2*SZL; (* pointer offset table sentinel in free block relative to block start *) - nextOff = 3*SZL; (* next pointer in free block relative to block start *) - NoPtrSntl = LONG(LONG(-SZL)); - - - TYPE - ModuleName = ARRAY ModNameLen OF CHAR; - CmdName = ARRAY CmdNameLen OF CHAR; - - Module = POINTER TO ModuleDesc; - Cmd = POINTER TO CmdDesc; - EnumProc = PROCEDURE(P: PROCEDURE(p: SYSTEM.PTR)); - ModuleDesc = RECORD - next: Module; - name: ModuleName; - refcnt: LONGINT; - cmds: Cmd; - types: LONGINT; - enumPtrs: EnumProc; - reserved1, reserved2: LONGINT - END ; - - Command = PROCEDURE; - - CmdDesc = RECORD - next: Cmd; - name: CmdName; - cmd: Command - END ; - - Finalizer = PROCEDURE(obj: SYSTEM.PTR); - - FinNode = POINTER TO FinDesc; - FinDesc = RECORD - next: FinNode; - obj: LONGINT; (* weak pointer *) - marked: BOOLEAN; - finalize: Finalizer; - END ; - - VAR - (* the list of loaded (=initialization started) modules *) - modules*: SYSTEM.PTR; - - freeList: ARRAY nofLists + 1 OF LONGINT; (* dummy, 16, 32, 48, 64, 80, 96, 112, 128, sentinel *) - bigBlocks, allocated*: LONGINT; - firstTry: BOOLEAN; - - (* extensible heap *) - heap, (* the sorted list of heap chunks *) - heapend, (* max possible pointer value (used for stack collection) *) - heapsize*: LONGINT; (* the sum of all heap chunk sizes *) - - (* finalization candidates *) - fin: FinNode; - - (* garbage collector locking *) - gclock*: SHORTINT; - - - PROCEDURE -malloc(size: LONGINT): LONGINT "(LONGINT)malloc(size)"; - PROCEDURE -Lock() "Lock"; - PROCEDURE -Unlock() "Unlock"; - PROCEDURE -Mainfrm(): LONGINT "SYSTEM_mainfrm"; -(* - PROCEDURE TAS*(VAR flag:BOOLEAN): BOOLEAN; (* added for compatibility with ulmSYSTEM module; noch *) - VAR oldflag : BOOLEAN; - BEGIN - oldflag := flag; - flag := TRUE; - RETURN oldflag; - END TAS; -*) - PROCEDURE REGMOD*(VAR name: ModuleName; enumPtrs: EnumProc): SYSTEM.PTR; - VAR m: Module; - BEGIN - IF name = "SYSTEM" THEN (* cannot use NEW *) - SYSTEM.NEW(m, SIZE(ModuleDesc)); m.cmds := NIL - ELSE NEW(m) - END ; - COPY(name, m.name); m.refcnt := 0; m.enumPtrs := enumPtrs; m.next := SYSTEM.VAL(Module, modules); - modules := m; - RETURN m - END REGMOD; - - PROCEDURE REGCMD*(m: Module; VAR name: CmdName; cmd: Command); - VAR c: Cmd; - BEGIN NEW(c); - COPY(name, c.name); c.cmd := cmd; c.next := m.cmds; m.cmds := c - END REGCMD; - - PROCEDURE REGTYP*(m: Module; typ: LONGINT); - BEGIN SYSTEM.PUT(typ, m.types); m.types := typ - END REGTYP; - - PROCEDURE INCREF*(m: Module); - BEGIN INC(m.refcnt) - END INCREF; - - PROCEDURE NewChunk(blksz: LONGINT): LONGINT; - VAR chnk: LONGINT; - BEGIN - chnk := malloc(blksz + blkOff); - IF chnk # 0 THEN - SYSTEM.PUT(chnk + endOff, chnk + (blkOff + blksz)); - SYSTEM.PUT(chnk + blkOff, chnk + (blkOff + sizeOff)); - SYSTEM.PUT(chnk + (blkOff + sizeOff), blksz); - SYSTEM.PUT(chnk + (blkOff + sntlOff), NoPtrSntl); - SYSTEM.PUT(chnk + (blkOff + nextOff), bigBlocks); - bigBlocks := chnk + blkOff; - INC(heapsize, blksz) - END ; - RETURN chnk - END NewChunk; - - PROCEDURE ExtendHeap(blksz: LONGINT); - VAR size, chnk, j, next: LONGINT; - BEGIN - IF blksz > 10000*Unit THEN size := blksz - ELSE size := 10000*Unit (* additional heuristics *) - END ; - chnk := NewChunk(size); - IF chnk # 0 THEN - (*sorted insertion*) - IF chnk < heap THEN - SYSTEM.PUT(chnk, heap); heap := chnk - ELSE - j := heap; SYSTEM.GET(j, next); - WHILE (next # 0) & (chnk > next) DO j := next; SYSTEM.GET(j, next) END ; - SYSTEM.PUT(chnk, next); SYSTEM.PUT(j, chnk) - END ; - IF next = 0 THEN SYSTEM.GET(chnk + endOff, heapend) END - END - END ExtendHeap; - - PROCEDURE ^GC*(markStack: BOOLEAN); - - PROCEDURE NEWREC*(tag: LONGINT): SYSTEM.PTR; - VAR i, i0, di, blksz, restsize, t, adr, end, next, prev: LONGINT; new: SYSTEM.PTR; - BEGIN - Lock(); - SYSTEM.GET(tag, blksz); - ASSERT(blksz MOD Unit = 0); - i0 := blksz DIV Unit; i := i0; - IF i < nofLists THEN adr := freeList[i]; - WHILE adr = 0 DO INC(i); adr := freeList[i] END - END ; - IF i < nofLists THEN (* unlink *) - SYSTEM.GET(adr + nextOff, next); - freeList[i] := next; - IF i # i0 THEN (* split *) - di := i - i0; restsize := di * Unit; end := adr + restsize; - SYSTEM.PUT(end + sizeOff, blksz); - SYSTEM.PUT(end + sntlOff, NoPtrSntl); - SYSTEM.PUT(end, end + sizeOff); - SYSTEM.PUT(adr + sizeOff, restsize); - SYSTEM.PUT(adr + nextOff, freeList[di]); - freeList[di] := adr; - INC(adr, restsize) - END - ELSE - adr := bigBlocks; prev := 0; - LOOP - IF adr = 0 THEN - IF firstTry THEN - GC(TRUE); INC(blksz, Unit); - IF (heapsize - allocated - blksz) * 4 < heapsize THEN - (* heap is still almost full; expand to avoid thrashing *) - ExtendHeap((allocated + blksz) DIV (3*Unit) * (4*Unit) - heapsize) - END ; - firstTry := FALSE; new := NEWREC(tag); firstTry := TRUE; - IF new = NIL THEN - (* depending on the fragmentation, the heap may not have been extended by - the anti-thrashing heuristics above *) - ExtendHeap((allocated + blksz) DIV (3*Unit) * (4*Unit) - heapsize); - new := NEWREC(tag); (* will find a free block if heap has been expanded properly *) - END ; - Unlock(); RETURN new - ELSE - Unlock(); RETURN NIL - END - END ; - SYSTEM.GET(adr+sizeOff, t); - IF t >= blksz THEN EXIT END ; - prev := adr; SYSTEM.GET(adr + nextOff, adr) - END ; - restsize := t - blksz; end := adr + restsize; - SYSTEM.PUT(end + sizeOff, blksz); - SYSTEM.PUT(end + sntlOff, NoPtrSntl); - SYSTEM.PUT(end, end + sizeOff); - IF restsize > nofLists * Unit THEN (*resize*) - SYSTEM.PUT(adr + sizeOff, restsize) - ELSE (*unlink*) - SYSTEM.GET(adr + nextOff, next); - IF prev = 0 THEN bigBlocks := next - ELSE SYSTEM.PUT(prev + nextOff, next); - END ; - IF restsize > 0 THEN (*move*) - di := restsize DIV Unit; - SYSTEM.PUT(adr + sizeOff, restsize); - SYSTEM.PUT(adr + nextOff, freeList[di]); - freeList[di] := adr - END - END ; - INC(adr, restsize) - END ; - i := adr + 4*SZL; end := adr + blksz; - WHILE i < end DO (*deliberately unrolled*) - SYSTEM.PUT(i, LONG(LONG(0))); - SYSTEM.PUT(i + SZL, LONG(LONG(0))); - SYSTEM.PUT(i + 2*SZL, LONG(LONG(0))); - SYSTEM.PUT(i + 3*SZL, LONG(LONG(0))); - INC(i, 4*SZL) - END ; - SYSTEM.PUT(adr + nextOff, LONG(LONG(0))); - SYSTEM.PUT(adr, tag); - SYSTEM.PUT(adr + sizeOff, LONG(LONG(0))); - SYSTEM.PUT(adr + sntlOff, LONG(LONG(0))); - INC(allocated, blksz); - Unlock(); - RETURN SYSTEM.VAL(SYSTEM.PTR, adr + SZL) - END NEWREC; - - PROCEDURE NEWBLK*(size: LONGINT): SYSTEM.PTR; - VAR blksz, tag: LONGINT; new: SYSTEM.PTR; - BEGIN - Lock(); - blksz := (size + (4*SZL + Unit - 1)) DIV Unit * Unit; (*size + tag + meta + blksz + sntnl + UnitAlignment*) - new := NEWREC(SYSTEM.ADR(blksz)); - tag := SYSTEM.VAL(LONGINT, new) + blksz - 3*SZL; - SYSTEM.PUT(tag - SZL, LONG(LONG(0))); (*reserved for meta info*) - SYSTEM.PUT(tag, blksz); - SYSTEM.PUT(tag + SZL, NoPtrSntl); - SYSTEM.PUT(SYSTEM.VAL(LONGINT, new) - SZL, tag); - Unlock(); - RETURN new - END NEWBLK; - - PROCEDURE Mark(q: LONGINT); - VAR p, tag, fld, n, offset, tagbits: LONGINT; - BEGIN - IF q # 0 THEN SYSTEM.GET(q - SZL, tagbits); - IF ~ODD(tagbits) THEN - SYSTEM.PUT(q - SZL, tagbits + 1); - p := 0; tag := tagbits + SZL; - LOOP - SYSTEM.GET(tag, offset); - IF offset < 0 THEN - SYSTEM.PUT(q - SZL, tag + offset + 1); - IF p = 0 THEN EXIT END ; - n := q; q := p; - SYSTEM.GET(q - SZL, tag); DEC(tag, 1); - SYSTEM.GET(tag, offset); fld := q + offset; - SYSTEM.GET(fld, p); SYSTEM.PUT(fld, n) - ELSE - fld := q + offset; - SYSTEM.GET(fld, n); - IF n # 0 THEN - SYSTEM.GET(n - SZL, tagbits); - IF ~ODD(tagbits) THEN - SYSTEM.PUT(n - SZL, tagbits + 1); - SYSTEM.PUT(q - SZL, tag + 1); - SYSTEM.PUT(fld, p); p := q; q := n; - tag := tagbits - END - END - END ; - INC(tag, SZL) - END - END - END - END Mark; - - PROCEDURE MarkP(p: SYSTEM.PTR); (* for compatibility with EnumPtrs in ANSI mode *) - BEGIN - Mark(SYSTEM.VAL(LONGINT, p)) - END MarkP; - - PROCEDURE Scan; - VAR chnk, adr, end, start, tag, i, size, freesize: LONGINT; - BEGIN bigBlocks := 0; i := 1; - WHILE i < nofLists DO freeList[i] := 0; INC(i) END ; - freesize := 0; allocated := 0; chnk := heap; - WHILE chnk # 0 DO - adr := chnk + blkOff; SYSTEM.GET(chnk + endOff, end); - WHILE adr < end DO - SYSTEM.GET(adr, tag); - IF ODD(tag) THEN (*marked*) - IF freesize > 0 THEN - start := adr - freesize; - SYSTEM.PUT(start, start+SZL); - SYSTEM.PUT(start+sizeOff, freesize); - SYSTEM.PUT(start+sntlOff, NoPtrSntl); - i := freesize DIV Unit; freesize := 0; - IF i < nofLists THEN SYSTEM.PUT(start + nextOff, freeList[i]); freeList[i] := start - ELSE SYSTEM.PUT(start + nextOff, bigBlocks); bigBlocks := start - END - END ; - DEC(tag, 1); - SYSTEM.PUT(adr, tag); - SYSTEM.GET(tag, size); - INC(allocated, size); - INC(adr, size) - ELSE (*unmarked*) - SYSTEM.GET(tag, size); - INC(freesize, size); - INC(adr, size) - END - END ; - IF freesize > 0 THEN (*collect last block*) - start := adr - freesize; - SYSTEM.PUT(start, start+SZL); - SYSTEM.PUT(start+sizeOff, freesize); - SYSTEM.PUT(start+sntlOff, NoPtrSntl); - i := freesize DIV Unit; freesize := 0; - IF i < nofLists THEN SYSTEM.PUT(start + nextOff, freeList[i]); freeList[i] := start - ELSE SYSTEM.PUT(start + nextOff, bigBlocks); bigBlocks := start - END - END ; - SYSTEM.GET(chnk, chnk) - END - END Scan; - - PROCEDURE Sift (l, r: LONGINT; VAR a: ARRAY OF LONGINT); - VAR i, j, x: LONGINT; - BEGIN j := l; x := a[j]; - LOOP i := j; j := 2*j + 1; - IF (j < r) & (a[j] < a[j+1]) THEN INC(j) END; - IF (j > r) OR (a[j] <= x) THEN EXIT END; - a[i] := a[j] - END; - a[i] := x - END Sift; - - PROCEDURE HeapSort (n: LONGINT; VAR a: ARRAY OF LONGINT); - VAR l, r, x: LONGINT; - BEGIN l := n DIV 2; r := n - 1; - WHILE l > 0 DO DEC(l); Sift(l, r, a) END; - WHILE r > 0 DO x := a[0]; a[0] := a[r]; a[r] := x; DEC(r); Sift(l, r, a) END - END HeapSort; - - PROCEDURE MarkCandidates(n: LONGINT; VAR cand: ARRAY OF LONGINT); - VAR chnk, adr, tag, next, lim, lim1, i, ptr, size: LONGINT; - BEGIN - chnk := heap; i := 0; lim := cand[n-1]; - WHILE (chnk # 0 ) & (chnk < lim) DO - adr := chnk + blkOff; - SYSTEM.GET(chnk + endOff, lim1); - IF lim < lim1 THEN lim1 := lim END ; - WHILE adr < lim1 DO - SYSTEM.GET(adr, tag); - IF ODD(tag) THEN (*already marked*) - SYSTEM.GET(tag-1, size); INC(adr, size) - ELSE - SYSTEM.GET(tag, size); - ptr := adr + SZL; - WHILE cand[i] < ptr DO INC(i) END ; - IF i = n THEN RETURN END ; - next := adr + size; - IF cand[i] < next THEN Mark(ptr) END ; - adr := next - END - END ; - SYSTEM.GET(chnk, chnk) - END - END MarkCandidates; - - PROCEDURE CheckFin; - VAR n: FinNode; tag: LONGINT; - BEGIN n := fin; - WHILE n # NIL DO - SYSTEM.GET(n.obj - SZL, tag); - IF ~ODD(tag) THEN n.marked := FALSE; Mark(n.obj) - ELSE n.marked := TRUE - END ; - n := n.next - END - END CheckFin; - - PROCEDURE Finalize; - VAR n, prev: FinNode; - BEGIN n := fin; prev := NIL; - WHILE n # NIL DO - IF ~n.marked THEN - IF n = fin THEN fin := fin.next ELSE prev.next := n.next END ; - n.finalize(SYSTEM.VAL(SYSTEM.PTR, n.obj)); - (* new nodes may have been pushed in n.finalize, therefore: *) - IF prev = NIL THEN n := fin ELSE n := n.next END - ELSE prev := n; n := n.next - END - END - END Finalize; - - PROCEDURE FINALL*; - VAR n: FinNode; - BEGIN - WHILE fin # NIL DO - n := fin; fin := fin.next; - n.finalize(SYSTEM.VAL(SYSTEM.PTR, n.obj)) - END - END FINALL; - - PROCEDURE MarkStack(n: LONGINT; VAR cand: ARRAY OF LONGINT); - VAR - frame: SYSTEM.PTR; - inc, nofcand: LONGINT; - sp, p, stack0, ptr: LONGINT; - align: RECORD ch: CHAR; p: SYSTEM.PTR END ; - BEGIN - IF n > 0 THEN MarkStack(n-1, cand); (* flush register windows by means of recursive calls *) - IF n > 100 THEN RETURN END (* prevent tail recursion optimization *) - END ; - IF n = 0 THEN - nofcand := 0; sp := SYSTEM.ADR(frame); - stack0 := Mainfrm(); - (* check for minimum alignment of pointers *) - inc := SYSTEM.ADR(align.p) - SYSTEM.ADR(align); - IF sp > stack0 THEN inc := -inc END ; - WHILE sp # stack0 DO - SYSTEM.GET(sp, p); - IF (p > heap) & (p < heapend) THEN - IF nofcand = LEN(cand) THEN HeapSort(nofcand, cand); MarkCandidates(nofcand, cand); nofcand := 0 END ; - cand[nofcand] := p; INC(nofcand) - END ; - INC(sp, inc) - END ; - IF nofcand > 0 THEN HeapSort(nofcand, cand); MarkCandidates(nofcand, cand) END - END - END MarkStack; - - PROCEDURE GC*(markStack: BOOLEAN); - VAR - m: Module; - i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23: LONGINT; - cand: ARRAY 10000 OF LONGINT; - BEGIN - IF (gclock = 0) OR (gclock = 1) & ~markStack THEN - Lock(); - m := SYSTEM.VAL(Module, modules); - WHILE m # NIL DO - IF m.enumPtrs # NIL THEN m.enumPtrs(MarkP) END ; - m := m^.next - END ; - IF markStack THEN - (* generate register pressure to force callee saved registers to memory; - may be simplified by inlining OS calls or processor specific instructions - *) - i0 := -100; i1 := -101; i2 := -102; i3 := -103; i4 := -104; i5 := -105; i6 := -106; i7 := -107; - i8 := 1; i9 := 2; i10 := 3; i11 := 4; i12 := 5; i13 := 6; i14 := 7; i15 := 8; - i16 := 9; i17 := 10; i18 := 11; i19 := 12; i20 := 13; i21 := 14; i22 := 15; i23 := 16; - LOOP INC(i0, 1); INC(i1, 2); INC(i2, 3); INC(i3, 4); INC(i4, 5); INC(i5, 6); INC(i6, 7); INC(i7, 8); - INC(i8, 9); INC(i9, 10); INC(i10, 11); INC(i11, 12); INC(i12, 13); INC(i13, 14); INC(i14, 15); INC(i15, 16); - INC(i16, 17); INC(i17, 18); INC(i18, 19); INC(i19, 20); INC(i20, 21); INC(i21, 22); INC(i22, 23); INC(i23, 24); - IF (i0 = -99) & (i15 = 24) THEN MarkStack(32, cand); EXIT END - END ; - IF i0 + i1 + i2 + i3 + i4 + i5 + i6 + i7 + i8 + i9 + i10 + i11 + i12 + i13 + i14 + i15 - + i16 + i17 + i18 + i19 + i20 + i21 + i22 + i23 > 10000 THEN RETURN (* use all variables *) - END ; - END; - CheckFin; - Scan; - Finalize; - Unlock() - END - END GC; - - PROCEDURE REGFIN*(obj: SYSTEM.PTR; finalize: Finalizer); - VAR f: FinNode; - BEGIN NEW(f); - f.obj := SYSTEM.VAL(LONGINT, obj); f.finalize := finalize; f.marked := TRUE; f.next := fin; fin := f - END REGFIN; - - PROCEDURE InitHeap; (* initialized before body to enable NEW, SYSTEM.NEW *) - BEGIN - heap := NewChunk(heapSize0); - SYSTEM.GET(heap + endOff, heapend); - SYSTEM.PUT(heap, LONG(LONG(0))); - allocated := 0; firstTry := TRUE; freeList[nofLists] := 1; gclock := 0 - END InitHeap; - -END SYSTEM. diff --git a/src/system/freebsd/clang/x86_64/Args.Mod b/src/system/freebsd/clang/x86_64/Args.Mod deleted file mode 100644 index 2c0d25b5..00000000 --- a/src/system/freebsd/clang/x86_64/Args.Mod +++ /dev/null @@ -1,65 +0,0 @@ -MODULE Args; (* jt, 8.12.94 *) - - (* command line argument handling for voc (jet backend) *) - - - IMPORT SYSTEM; - - TYPE - ArgPtr = POINTER TO ARRAY 1024 OF CHAR; - ArgVec = POINTER TO ARRAY 1024 OF ArgPtr; - - VAR argc-: INTEGER; argv-: LONGINT; - (*PROCEDURE -includestdlib() "#include ";*) - PROCEDURE -externgetenv() "extern char *getenv(const char *name);"; (* took this from stdlib.h*) - PROCEDURE -Argc(): INTEGER "SYSTEM_argc"; - PROCEDURE -Argv(): LONGINT "(long)SYSTEM_argv"; - PROCEDURE -getenv(var: ARRAY OF CHAR): ArgPtr - "(Args_ArgPtr)getenv(var)"; - - PROCEDURE Get*(n: INTEGER; VAR val: ARRAY OF CHAR); - VAR av: ArgVec; - BEGIN - IF n < argc THEN av := SYSTEM.VAL(ArgVec, argv); COPY(av[n]^, val) END - END Get; - - PROCEDURE GetInt*(n: INTEGER; VAR val: LONGINT); - VAR s: ARRAY 64 OF CHAR; k, d, i: LONGINT; - BEGIN - s := ""; Get(n, s); i := 0; - IF s[0] = "-" THEN i := 1 END ; - k := 0; d := ORD(s[i]) - ORD("0"); - WHILE (d >= 0 ) & (d <= 9) DO k := k*10 + d; INC(i); d := ORD(s[i]) - ORD("0") END ; - IF s[0] = "-" THEN d := -d; DEC(i) END ; - IF i > 0 THEN val := k END - END GetInt; - - PROCEDURE Pos*(s: ARRAY OF CHAR): INTEGER; - VAR i: INTEGER; arg: ARRAY 256 OF CHAR; - BEGIN - i := 0; Get(i, arg); - WHILE (i < argc) & (s # arg) DO INC(i); Get(i, arg) END ; - RETURN i - END Pos; - - PROCEDURE GetEnv*(var: ARRAY OF CHAR; VAR val: ARRAY OF CHAR); - VAR p: ArgPtr; - BEGIN - p := getenv(var); - IF p # NIL THEN COPY(p^, val) END - END GetEnv; - - PROCEDURE getEnv*(var: ARRAY OF CHAR; VAR val: ARRAY OF CHAR): BOOLEAN; - VAR p: ArgPtr; - BEGIN - p := getenv(var); - IF p # NIL THEN - COPY(p^, val); - RETURN TRUE - ELSE - RETURN FALSE - END - END getEnv; - -BEGIN argc := Argc(); argv := Argv() -END Args. diff --git a/src/system/freebsd/clang/x86_64/Files.Mod b/src/system/freebsd/clang/x86_64/Files.Mod deleted file mode 100644 index c8f42ca5..00000000 --- a/src/system/freebsd/clang/x86_64/Files.Mod +++ /dev/null @@ -1,664 +0,0 @@ -MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files *) -(* modified version of Files, which opens only the file provided and does not scan any path in any environment variable, also ReadLine procedure added; -- noch *) - IMPORT SYSTEM, Unix, Kernel, Args, Console; - - (* standard data type I/O - - little endian, - Sint:1, Int:2, Lint:4 - ORD({0}) = 1, - false = 0, true =1 - IEEE real format, - null terminated strings, - compact numbers according to M.Odersky *) - - - CONST - nofbufs = 4; - bufsize = 4096; - fileTabSize = 64; - noDesc = -1; - notDone = -1; - - (* file states *) - open = 0; create = 1; close = 2; - - - TYPE - FileName = ARRAY 101 OF CHAR; - File* = POINTER TO Handle; - Buffer = POINTER TO BufDesc; - - Handle = RECORD - workName, registerName: FileName; - tempFile: BOOLEAN; - dev, ino, mtime: LONGINT; - fd-: INTEGER; - len, pos: LONGINT; - bufs: ARRAY nofbufs OF Buffer; - swapper, state: INTEGER - END ; - - BufDesc = RECORD - f: File; - chg: BOOLEAN; - org, size: LONGINT; - data: ARRAY bufsize OF SYSTEM.BYTE - END ; - - Rider* = RECORD - res*: LONGINT; - eof*: BOOLEAN; - buf: Buffer; - org, offset: LONGINT - END ; - - Time = POINTER TO TimeDesc; - TimeDesc = RECORD - sec*, min*, hour*, mday*, mon*, year*, wday*, isdst*, zone*, gmtoff*: LONGINT; -(* sec*, min*, hour*, mday*, mon*, year*, wday*, isdst*, zone*, gmtoff*: INTEGER;*) - END ; - - VAR - fileTab: ARRAY fileTabSize OF LONGINT (*=File*); - tempno: INTEGER; - -(* for localtime *) - PROCEDURE -includetime() - '#include "time.h"'; - - PROCEDURE -localtime(VAR clock: LONGINT): Time - "(Files_Time) localtime(clock)"; - - PROCEDURE -getcwd(VAR cwd: Unix.Name) - "getcwd(cwd, cwd__len)"; - - PROCEDURE -IdxTrap "__HALT(-1)"; - - PROCEDURE^ Finalize(o: SYSTEM.PTR); - - PROCEDURE Err(s: ARRAY OF CHAR; f: File; errno: LONGINT); - BEGIN - Console.Ln; Console.String("-- "); Console.String(s); Console.String(": "); - IF f # NIL THEN - IF f.registerName # "" THEN Console.String(f.registerName) ELSE Console.String(f.workName) END - END ; - IF errno # 0 THEN Console.String(" errno = "); Console.Int(errno, 1) END ; - Console.Ln; - HALT(99) - END Err; - - PROCEDURE MakeFileName(dir, name: ARRAY OF CHAR; VAR dest: ARRAY OF CHAR); - VAR i, j: INTEGER; - BEGIN i := 0; j := 0; - WHILE dir[i] # 0X DO dest[i] := dir[i]; INC(i) END ; - IF dest[i-1] # "/" THEN dest[i] := "/"; INC(i) END ; - WHILE name[j] # 0X DO dest[i] := name[j]; INC(i); INC(j) END ; - dest[i] := 0X - END MakeFileName; - - PROCEDURE GetTempName(finalName: ARRAY OF CHAR; VAR name: ARRAY OF CHAR); - VAR n, i, j: LONGINT; - BEGIN - INC(tempno); n := tempno; i := 0; - IF finalName[0] # "/" THEN (* relative pathname *) - WHILE Kernel.CWD[i] # 0X DO name[i] := Kernel.CWD[i]; INC(i) END; - IF Kernel.CWD[i-1] # "/" THEN name[i] := "/"; INC(i) END - END; - j := 0; - WHILE finalName[j] # 0X DO name[i] := finalName[j]; INC(i); INC(j) END; - DEC(i); - WHILE name[i] # "/" DO DEC(i) END; - name[i+1] := "."; name[i+2] := "t"; name[i+3] := "m"; name[i+4] := "p"; name[i+5] := "."; INC(i, 6); - WHILE n > 0 DO name[i] := CHR(n MOD 10 + ORD("0")); n := n DIV 10; INC(i) END; - name[i] := "."; INC(i); n := SHORT(Unix.Getpid()); - WHILE n > 0 DO name[i] := CHR(n MOD 10 + ORD("0")); n := n DIV 10; INC(i) END; - name[i] := 0X - END GetTempName; - - PROCEDURE Create(f: File); - VAR stat: Unix.Status; done: BOOLEAN; - errno: LONGINT; err: ARRAY 32 OF CHAR; - BEGIN - IF f.fd = noDesc THEN - IF f.state = create THEN GetTempName(f.registerName, f.workName); f.tempFile := TRUE - ELSIF f.state = close THEN - f.workName := f.registerName; f.registerName := ""; f.tempFile := FALSE - END ; - errno := Unix.Unlink(f.workName); (*unlink first to avoid stale NFS handles and to avoid reuse of inodes*) - f.fd := Unix.Open(f.workName, SHORT(SYSTEM.VAL(LONGINT, Unix.rdwr + Unix.creat + Unix.trunc)), SHORT(SYSTEM.VAL(LONGINT, {2, 4,5, 7,8}))); - done := f.fd >= 0; errno := Unix.errno(); - IF (~done & ((errno = Unix.ENFILE) OR (errno = Unix.EMFILE))) OR (done & (f.fd >= fileTabSize)) THEN - IF done & (f.fd >= fileTabSize) THEN errno := Unix.Close(f.fd) END ; - Kernel.GC(TRUE); - f.fd := Unix.Open(f.workName, SHORT(SYSTEM.VAL(LONGINT, Unix.rdwr + Unix.creat + Unix.trunc)), SHORT(SYSTEM.VAL(LONGINT, {2, 4,5, 7,8}))); - done := f.fd >= 0 - END ; - IF done THEN - IF f.fd >= fileTabSize THEN errno := Unix.Close(f.fd); Err("too many files open", f, 0) - ELSE fileTab[f.fd] := SYSTEM.VAL(LONGINT, f); INC(Kernel.nofiles); Kernel.RegisterObject(f, Finalize); - f.state := open; f.pos := 0; errno := Unix.Fstat(f.fd, stat); - f.dev := stat.dev; f.ino := stat.ino; f.mtime := stat.mtime - END - ELSE errno := Unix.errno(); - IF errno = Unix.ENOENT THEN err := "no such directory" - ELSIF (errno = Unix.ENFILE) OR (errno = Unix.EMFILE) THEN err := "too many files open" - ELSE err := "file not created" - END ; - Err(err, f, errno) - END - END - END Create; - - PROCEDURE Flush(buf: Buffer); - VAR res: LONGINT; f: File; stat: Unix.Status; - BEGIN - IF buf.chg THEN f := buf.f; Create(f); - IF buf.org # f.pos THEN res := Unix.Lseek(f.fd, buf.org, 0) END ; - res := Unix.Write(f.fd, SYSTEM.ADR(buf.data), buf.size); - IF res < 0 THEN Err("error in writing file", f, Unix.errno()) END ; - f.pos := buf.org + buf.size; - buf.chg := FALSE; - res := Unix.Fstat(f.fd, stat); - f.mtime := stat.mtime - END - END Flush; - - PROCEDURE Close* (f: File); - VAR i, res: LONGINT; - BEGIN - IF (f.state # create) OR (f.registerName # "") THEN - Create(f); i := 0; - WHILE (i < nofbufs) & (f.bufs[i] # NIL) DO Flush(f.bufs[i]); INC(i) END ; - res := Unix.Fsync(f.fd); - IF res < 0 THEN Err("error in writing file", f, Unix.errno()) END - END - END Close; - - PROCEDURE Length* (f: File): LONGINT; - BEGIN RETURN f.len - END Length; - - PROCEDURE New* (name: ARRAY OF CHAR): File; - VAR f: File; - BEGIN - NEW(f); f.workName := ""; COPY(name, f.registerName); - f.fd := noDesc; f.state := create; f.len := 0; f.pos := 0; f.swapper := -1; (*all f.buf[i] = NIL*) - RETURN f - END New; -(* - PROCEDURE ScanPath(VAR pos: INTEGER; VAR dir: ARRAY OF CHAR); (* supports ~, ~user and blanks inside path *) - VAR i: INTEGER; ch: CHAR; home: ARRAY 256 OF CHAR; - BEGIN - i := 0; ch := Kernel.OBERON[pos]; - WHILE (ch = " ") OR (ch = ":") DO INC(pos); ch := Kernel.OBERON[pos] END ; - IF ch = "~" THEN - INC(pos); ch := Kernel.OBERON[pos]; - home := ""; Args.GetEnv("HOME", home); - WHILE home[i] # 0X DO dir[i] := home[i]; INC(i) END ; - IF (ch # "/") & (ch # 0X) & (ch # ":") & (ch # " ") THEN - WHILE (i > 0) & (dir[i-1] # "/") DO DEC(i) END - END - END ; - WHILE (ch # 0X) & (ch # ":") DO dir[i] := ch; INC(i); INC(pos); ch := Kernel.OBERON[pos] END ; - WHILE (i > 0) & (dir[i-1] = " ") DO DEC(i) END ; - dir[i] := 0X - END ScanPath; -*) - PROCEDURE HasDir(VAR name: ARRAY OF CHAR): BOOLEAN; - VAR i: INTEGER; ch: CHAR; - BEGIN i := 0; ch := name[0]; - WHILE (ch # 0X) & (ch # "/") DO INC(i); ch := name[i] END ; - RETURN ch = "/" - END HasDir; - - PROCEDURE CacheEntry(dev, ino: LONGINT; mtime: LONGINT): File; - VAR f: File; i: INTEGER; stat: Unix.Status; res: LONGINT; - BEGIN i := 0; - WHILE i < fileTabSize DO - f := SYSTEM.VAL(File, fileTab[i]); - IF (f # NIL) & (ino = f.ino) & (dev = f.dev) THEN - IF mtime # f.mtime THEN i := 0; - WHILE i < nofbufs DO - IF f.bufs[i] # NIL THEN f.bufs[i].org := -1; f.bufs[i] := NIL END ; - INC(i) - END ; - f.swapper := -1; f.mtime := mtime; - res := Unix.Fstat(f.fd, stat); f.len := stat.size - END ; - RETURN f - END ; - INC(i) - END ; - RETURN NIL - END CacheEntry; - - PROCEDURE Old* (name: ARRAY OF CHAR): File; - VAR f: File; fd: INTEGER; res, errno: LONGINT; pos: INTEGER; done: BOOLEAN; - dir, path: ARRAY 256 OF CHAR; - stat: Unix.Status; - BEGIN - IF name # "" THEN - IF HasDir(name) THEN dir := ""; COPY(name, path) - ELSE - pos := 0; - COPY(name, path); (* -- noch *) - (*ScanPath(pos, dir);*) (*MakeFileName(dir, name, path);*) (*ScanPath(pos, dir)*) - END ; - LOOP - fd := Unix.Open(path, SHORT(SYSTEM.VAL(LONGINT, Unix.rdwr)), SHORT(SYSTEM.VAL(LONGINT, {}))); done := fd >= 0; errno := Unix.errno(); - IF (~done & ((errno = Unix.ENFILE) OR (errno = Unix.EMFILE))) OR (done & (fd >= fileTabSize)) THEN - IF done & (fd >= fileTabSize) THEN res := Unix.Close(fd) END ; - Kernel.GC(TRUE); - fd := Unix.Open(path, SHORT(SYSTEM.VAL(LONGINT, Unix.rdwr)), SHORT(SYSTEM.VAL(LONGINT, {}))); - done := fd >= 0; errno := Unix.errno(); - IF ~done & ((errno = Unix.ENFILE) OR (errno = Unix.EMFILE)) THEN Err("too many files open", f, errno) END - END ; - IF ~done & ((errno = Unix.EACCES) OR (errno = Unix.EROFS) OR (errno = Unix.EAGAIN)) THEN - (* errno EAGAIN observed on Solaris 2.4 *) - fd := Unix.Open(path, SHORT(SYSTEM.VAL(LONGINT, Unix.rdonly)), SHORT(SYSTEM.VAL(LONGINT, {}))); done := fd >= 0; errno := Unix.errno() - END ; -IF (~done) & (errno # Unix.ENOENT) THEN - Console.String("warning Files.Old "); Console.String(name); - Console.String(" errno = "); Console.Int(errno, 0); Console.Ln; -END ; - IF done THEN - res := Unix.Fstat(fd, stat); - f := CacheEntry(stat.dev, stat.ino, stat.mtime); - IF f # NIL THEN res := Unix.Close(fd); RETURN f - ELSIF fd >= fileTabSize THEN res := Unix.Close(fd); Err("too many files open", f, 0) - ELSE NEW(f); fileTab[fd] := SYSTEM.VAL(LONGINT, f); INC(Kernel.nofiles); Kernel.RegisterObject(f, Finalize); - f.fd := fd; f.state := open; f.len := stat.size; f.pos := 0; f.swapper := -1; (*all f.buf[i] = NIL*) - COPY(name, f.workName); f.registerName := ""; f.tempFile := FALSE; - f.dev := stat.dev; f.ino := stat.ino; f.mtime := stat.mtime; - RETURN f - END - ELSIF dir = "" THEN RETURN NIL - ELSE (*MakeFileName(dir, name, path);*) (*ScanPath(pos, dir)*) - RETURN NIL - END - END - ELSE RETURN NIL - END - END Old; - - PROCEDURE Purge* (f: File); - VAR i: INTEGER; stat: Unix.Status; res: LONGINT; - BEGIN i := 0; - WHILE i < nofbufs DO - IF f.bufs[i] # NIL THEN f.bufs[i].org := -1; f.bufs[i] := NIL END ; - INC(i) - END ; - IF f.fd # noDesc THEN res := Unix.Ftruncate(f.fd, 0); res := Unix.Lseek(f.fd, 0, 0) END ; - f.pos := 0; f.len := 0; f.swapper := -1; - res := Unix.Fstat(f.fd, stat); f.mtime := stat.mtime - END Purge; - - PROCEDURE GetDate* (f: File; VAR t, d: LONGINT); - VAR stat: Unix.Status; clock, res: LONGINT; time: Time; - BEGIN - Create(f); res := Unix.Fstat(f.fd, stat); - time := localtime(stat.mtime); - t := time.sec + ASH(time.min, 6) + ASH(time.hour, 12); - d := time.mday + ASH(time.mon+1, 5) + ASH(time.year MOD 100, 9) - END GetDate; - - PROCEDURE Pos* (VAR r: Rider): LONGINT; - BEGIN RETURN r.org + r.offset - END Pos; - - PROCEDURE Set* (VAR r: Rider; f: File; pos: LONGINT); - VAR org, offset, i, n, res: LONGINT; buf: Buffer; - BEGIN - IF f # NIL THEN - IF pos > f.len THEN pos := f.len ELSIF pos < 0 THEN pos := 0 END ; - offset := pos MOD bufsize; org := pos - offset; i := 0; - WHILE (i < nofbufs) & (f.bufs[i] # NIL) & (org # f.bufs[i].org) DO INC(i) END ; - IF i < nofbufs THEN - IF f.bufs[i] = NIL THEN NEW(buf); buf.chg := FALSE; buf.org := -1; buf.f := f; f.bufs[i] := buf - ELSE buf := f.bufs[i] - END - ELSE - f.swapper := (f.swapper + 1) MOD nofbufs; - buf := f.bufs[f.swapper]; - Flush(buf) - END ; - IF buf.org # org THEN - IF org = f.len THEN buf.size := 0 - ELSE Create(f); - IF f.pos # org THEN res := Unix.Lseek(f.fd, org, 0) END ; - n := Unix.ReadBlk(f.fd, buf.data); - IF n < 0 THEN Err("read from file not done", f, Unix.errno()) END ; - f.pos := org + n; - buf.size := n - END ; - buf.org := org; buf.chg := FALSE - END - ELSE buf := NIL; org := 0; offset := 0 - END ; - r.buf := buf; r.org := org; r.offset := offset; r.eof := FALSE; r.res := 0 - END Set; - - PROCEDURE Read* (VAR r: Rider; VAR x: SYSTEM.BYTE); - VAR offset: LONGINT; buf: Buffer; - BEGIN - buf := r.buf; offset := r.offset; - IF r.org # buf.org THEN Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset END ; - IF (offset < buf.size) THEN - x := buf.data[offset]; r.offset := offset + 1 - ELSIF r.org + offset < buf.f.len THEN - Set(r, r.buf.f, r.org + offset); - x := r.buf.data[0]; r.offset := 1 - ELSE - x := 0X; r.eof := TRUE - END - END Read; - - PROCEDURE ReadBytes* (VAR r: Rider; VAR x: ARRAY OF SYSTEM.BYTE; n: LONGINT); - VAR xpos, min, restInBuf, offset: LONGINT; buf: Buffer; - BEGIN - IF n > LEN(x) THEN IdxTrap END ; - xpos := 0; buf := r.buf; offset := r.offset; - WHILE n > 0 DO - IF (r.org # buf.org) OR (offset >= bufsize) THEN - Set(r, buf.f, r.org + offset); - buf := r.buf; offset := r.offset - END ; - restInBuf := buf.size - offset; - IF restInBuf = 0 THEN r.res := n; r.eof := TRUE; RETURN - ELSIF n > restInBuf THEN min := restInBuf ELSE min := n END ; - SYSTEM.MOVE(SYSTEM.ADR(buf.data) + offset, SYSTEM.ADR(x) + xpos, min); - INC(offset, min); r.offset := offset; INC(xpos, min); DEC(n, min) - END ; - r.res := 0; r.eof := FALSE - END ReadBytes; - - PROCEDURE ReadByte* (VAR r : Rider; VAR x : ARRAY OF SYSTEM.BYTE); - BEGIN - ReadBytes(r, x, 1); - END ReadByte; - - PROCEDURE Base* (VAR r: Rider): File; - BEGIN RETURN r.buf.f - END Base; - - PROCEDURE Write* (VAR r: Rider; x: SYSTEM.BYTE); - VAR buf: Buffer; offset: LONGINT; - BEGIN - buf := r.buf; offset := r.offset; - IF (r.org # buf.org) OR (offset >= bufsize) THEN - Set(r, buf.f, r.org + offset); - buf := r.buf; offset := r.offset - END ; - buf.data[offset] := x; - buf.chg := TRUE; - IF offset = buf.size THEN - INC(buf.size); INC(buf.f.len) - END ; - r.offset := offset + 1; r.res := 0 - END Write; - - PROCEDURE WriteByte* (VAR r : Rider; x : SYSTEM.BYTE); (* added for compatibility with PO 2013, -- noch *) - BEGIN - Write(r, x); - END WriteByte; - - PROCEDURE WriteBytes* (VAR r: Rider; VAR x: ARRAY OF SYSTEM.BYTE; n: LONGINT); - VAR xpos, min, restInBuf, offset: LONGINT; buf: Buffer; - BEGIN - IF n > LEN(x) THEN IdxTrap END ; - xpos := 0; buf := r.buf; offset := r.offset; - WHILE n > 0 DO - IF (r.org # buf.org) OR (offset >= bufsize) THEN - Set(r, buf.f, r.org + offset); - buf := r.buf; offset := r.offset - END ; - restInBuf := bufsize - offset; - IF n > restInBuf THEN min := restInBuf ELSE min := n END ; - SYSTEM.MOVE(SYSTEM.ADR(x) + xpos, SYSTEM.ADR(buf.data) + offset, min); - INC(offset, min); r.offset := offset; - IF offset > buf.size THEN INC(buf.f.len, offset - buf.size); buf.size := offset END ; - INC(xpos, min); DEC(n, min); buf.chg := TRUE - END ; - r.res := 0 - END WriteBytes; - -(* another solution would be one that is similar to ReadBytes, WriteBytes. -No code duplication, more symmetric, only two ifs for -Read and Write in buffer, buf.size replaced by bufsize in Write ops, buf.size and len -must be made consistent with offset (if offset > buf.size) in a lazy way. - -PROCEDURE Write* (VAR r: Rider; x: SYSTEM.BYTE); - VAR buf: Buffer; offset: LONGINT; -BEGIN - buf := r.buf; offset := r.offset; - IF (offset >= bufsize) OR (r.org # buf.org) THEN - Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset; - END ; - buf.data[offset] := x; r.offset := offset + 1; buf.chg := TRUE -END Write; - - -PROCEDURE WriteBytes ... - -PROCEDURE Read* (VAR r: Rider; VAR x: SYSTEM.BYTE); - VAR offset: LONGINT; buf: Buffer; -BEGIN - buf := r.buf; offset := r.offset; - IF (offset >= buf.size) OR (r.org # buf.org) THEN - IF r.org + offset >= buf.f.len THEN x := 0X; r.eof := TRUE; RETURN - ELSE Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset - END - END ; - x := buf.data[offset]; r.offset := offset + 1 -END Read; - -but this would also affect Set, Length, and Flush. -Especially Length would become fairly complex. -*) - - PROCEDURE Delete* (name: ARRAY OF CHAR; VAR res: INTEGER); - BEGIN - res := SHORT(Unix.Unlink(name)); - res := SHORT(Unix.errno()) - END Delete; - - PROCEDURE Rename* (old, new: ARRAY OF CHAR; VAR res: INTEGER); - VAR fdold, fdnew: INTEGER; n, errno, r: LONGINT; - ostat, nstat: Unix.Status; - buf: ARRAY 4096 OF CHAR; - BEGIN - r := Unix.Stat(old, ostat); - IF r >= 0 THEN - r := Unix.Stat(new, nstat); - IF (r >= 0) & ((ostat.dev # nstat.dev) OR (ostat.ino # nstat.ino)) THEN - Delete(new, res); (* work around stale nfs handles *) - END ; - r := Unix.Rename(old, new); - IF r < 0 THEN res := SHORT(Unix.errno()); - IF res = Unix.EXDEV THEN (* cross device link, move the file *) - fdold := Unix.Open(old, SHORT(SYSTEM.VAL(LONGINT, Unix.rdonly)), SHORT(SYSTEM.VAL(LONGINT, {}))); - IF fdold < 0 THEN res := 2; RETURN END ; - fdnew := Unix.Open(new, SHORT(SYSTEM.VAL(LONGINT, Unix.rdwr + Unix.creat + Unix.trunc)), SHORT(SYSTEM.VAL(LONGINT, {2, 4,5, 7,8}))); - IF fdnew < 0 THEN r := Unix.Close(fdold); res := 3; RETURN END ; - n := Unix.Read(fdold, SYSTEM.ADR(buf), bufsize); - WHILE n > 0 DO - r := Unix.Write(fdnew, SYSTEM.ADR(buf), n); - IF r < 0 THEN errno := Unix.errno(); r := Unix.Close(fdold); r := Unix.Close(fdnew); - Err("cannot move file", NIL, errno) - END ; - n := Unix.Read(fdold, SYSTEM.ADR(buf), bufsize) - END ; - errno := Unix.errno(); - r := Unix.Close(fdold); r := Unix.Close(fdnew); - IF n = 0 THEN r := Unix.Unlink(old); res := 0 - ELSE Err("cannot move file", NIL, errno) - END ; - ELSE RETURN (* res is Unix.Rename return code *) - END - END ; - res := 0 - ELSE res := 2 (* old file not found *) - END - END Rename; - - PROCEDURE Register* (f: File); - VAR idx, errno: INTEGER; f1: File; file: ARRAY 104 OF CHAR; - BEGIN - IF (f.state = create) & (f.registerName # "") THEN f.state := close (* shortcut renaming *) END ; - Close(f); - IF f.registerName # "" THEN - Rename(f.workName, f.registerName, errno); - IF errno # 0 THEN COPY(f.registerName, file); HALT(99) END ; - f.workName := f.registerName; f.registerName := ""; f.tempFile := FALSE - END - END Register; - - PROCEDURE ChangeDirectory*(path: ARRAY OF CHAR; VAR res: INTEGER); - BEGIN - res := SHORT(Unix.Chdir(path)); - getcwd(Kernel.CWD) - END ChangeDirectory; - - PROCEDURE FlipBytes(VAR src, dest: ARRAY OF SYSTEM.BYTE); - VAR i, j: LONGINT; - BEGIN - IF ~Kernel.littleEndian THEN i := LEN(src); j := 0; - WHILE i > 0 DO DEC(i); dest[j] := src[i]; INC(j) END - ELSE SYSTEM.MOVE(SYSTEM.ADR(src), SYSTEM.ADR(dest), LEN(src)) - END - END FlipBytes; - - PROCEDURE ReadBool* (VAR R: Rider; VAR x: BOOLEAN); - BEGIN Read(R, SYSTEM.VAL(CHAR, x)) - END ReadBool; - - PROCEDURE ReadInt* (VAR R: Rider; VAR x: INTEGER); - VAR b: ARRAY 2 OF CHAR; - BEGIN ReadBytes(R, b, 2); - x := ORD(b[0]) + ORD(b[1])*256 - END ReadInt; - - PROCEDURE ReadLInt* (VAR R: Rider; VAR x: LONGINT); - VAR b: ARRAY 4 OF CHAR; - BEGIN ReadBytes(R, b, 4); - x := ORD(b[0]) + ORD(b[1])*100H + ORD(b[2])*10000H + ORD(b[3])*1000000H - END ReadLInt; - - PROCEDURE ReadSet* (VAR R: Rider; VAR x: SET); - VAR b: ARRAY 4 OF CHAR; - BEGIN ReadBytes(R, b, 4); - x := SYSTEM.VAL(SET, ORD(b[0]) + ORD(b[1])*100H + ORD(b[2])*10000H + ORD(b[3])*1000000H) - END ReadSet; - - PROCEDURE ReadReal* (VAR R: Rider; VAR x: REAL); - VAR b: ARRAY 4 OF CHAR; - BEGIN ReadBytes(R, b, 4); FlipBytes(b, x) - END ReadReal; - - PROCEDURE ReadLReal* (VAR R: Rider; VAR x: LONGREAL); - VAR b: ARRAY 8 OF CHAR; - BEGIN ReadBytes(R, b, 8); FlipBytes(b, x) - END ReadLReal; - - PROCEDURE ReadString* (VAR R: Rider; VAR x: ARRAY OF CHAR); - VAR i: INTEGER; ch: CHAR; - BEGIN i := 0; - REPEAT Read(R, ch); x[i] := ch; INC(i) UNTIL ch = 0X - END ReadString; - - (* need to read line; -- noch *) - PROCEDURE ReadLine* (VAR R: Rider; VAR x: ARRAY OF CHAR); - VAR i: INTEGER; ch: CHAR; b : BOOLEAN; - BEGIN i := 0; - b := FALSE; - REPEAT - Read(R, ch); - IF ((ch = 0X) OR (ch = 0AX) OR (ch = 0DX)) THEN - b := TRUE - ELSE - x[i] := ch; - INC(i); - END; - UNTIL b - END ReadLine; - - PROCEDURE ReadNum* (VAR R: Rider; VAR x: LONGINT); - VAR s: SHORTINT; ch: CHAR; n: LONGINT; - BEGIN s := 0; n := 0; Read(R, ch); - WHILE ORD(ch) >= 128 DO INC(n, ASH(ORD(ch) - 128, s) ); INC(s, 7); Read(R, ch) END; - INC(n, ASH(ORD(ch) MOD 64 - ORD(ch) DIV 64 * 64, s) ); - x := n - END ReadNum; - - PROCEDURE WriteBool* (VAR R: Rider; x: BOOLEAN); - BEGIN Write(R, SYSTEM.VAL(CHAR, x)) - END WriteBool; - - PROCEDURE WriteInt* (VAR R: Rider; x: INTEGER); - VAR b: ARRAY 2 OF CHAR; - BEGIN b[0] := CHR(x); b[1] := CHR(x DIV 256); - WriteBytes(R, b, 2); - END WriteInt; - - PROCEDURE WriteLInt* (VAR R: Rider; x: LONGINT); - VAR b: ARRAY 4 OF CHAR; - BEGIN - b[0] := CHR(x); b[1] := CHR(x DIV 100H); b[2] := CHR(x DIV 10000H); b[3] := CHR(x DIV 1000000H); - WriteBytes(R, b, 4); - END WriteLInt; - - PROCEDURE WriteSet* (VAR R: Rider; x: SET); - VAR b: ARRAY 4 OF CHAR; i: LONGINT; - BEGIN i := SYSTEM.VAL(LONGINT, x); - 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; - - PROCEDURE WriteReal* (VAR R: Rider; x: REAL); - VAR b: ARRAY 4 OF CHAR; - BEGIN FlipBytes(x, b); WriteBytes(R, b, 4) - END WriteReal; - - PROCEDURE WriteLReal* (VAR R: Rider; x: LONGREAL); - VAR b: ARRAY 8 OF CHAR; - BEGIN FlipBytes(x, b); WriteBytes(R, b, 8) - END WriteLReal; - - PROCEDURE WriteString* (VAR R: Rider; x: ARRAY [1] OF CHAR); - VAR i: INTEGER; - BEGIN i := 0; - WHILE x[i] # 0X DO INC(i) END ; - WriteBytes(R, x, i+1) - END WriteString; - - PROCEDURE WriteNum* (VAR R: Rider; x: LONGINT); - BEGIN - WHILE (x < - 64) OR (x > 63) DO Write(R, CHR(x MOD 128 + 128)); x := x DIV 128 END; - Write(R, CHR(x MOD 128)) - END WriteNum; - - PROCEDURE GetName*(f: File; VAR name: ARRAY OF CHAR); - BEGIN - COPY (f.workName, name); - END GetName; - - PROCEDURE Finalize(o: SYSTEM.PTR); - VAR f: File; res: LONGINT; - BEGIN - f := SYSTEM.VAL(File, o); - IF f.fd >= 0 THEN - fileTab[f.fd] := 0; res := Unix.Close(f.fd); f.fd := -1; DEC(Kernel.nofiles); - IF f.tempFile THEN res := Unix.Unlink(f.workName) END - END - END Finalize; - - PROCEDURE Init; - VAR i: LONGINT; - BEGIN - i := 0; WHILE i < fileTabSize DO fileTab[i] := 0; INC(i) END ; - tempno := -1; Kernel.nofiles := 0 - END Init; - -BEGIN Init -END Files. diff --git a/src/system/freebsd/clang/x86_64/Files0.Mod b/src/system/freebsd/clang/x86_64/Files0.Mod deleted file mode 100644 index 1d9cd953..00000000 --- a/src/system/freebsd/clang/x86_64/Files0.Mod +++ /dev/null @@ -1,636 +0,0 @@ -MODULE Files0; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files *) - -(* this module is not for use by developers and inteded to bootstrap voc *) -(* for general use import Files module *) - - IMPORT SYSTEM, Unix, Kernel := Kernel0, Args, Console; - - (* standard data type I/O - - little endian, - Sint:1, Int:2, Lint:4 - ORD({0}) = 1, - false = 0, true =1 - IEEE real format, - null terminated strings, - compact numbers according to M.Odersky *) - - - CONST - nofbufs = 4; - bufsize = 4096; - fileTabSize = 64; - noDesc = -1; - notDone = -1; - - (* file states *) - open = 0; create = 1; close = 2; - - - TYPE - FileName = ARRAY 101 OF CHAR; - File* = POINTER TO Handle; - Buffer = POINTER TO BufDesc; - - Handle = RECORD - workName, registerName: FileName; - tempFile: BOOLEAN; - dev, ino, mtime: LONGINT; - fd-: INTEGER; - len, pos: LONGINT; - bufs: ARRAY nofbufs OF Buffer; - swapper, state: INTEGER - END ; - - BufDesc = RECORD - f: File; - chg: BOOLEAN; - org, size: LONGINT; - data: ARRAY bufsize OF SYSTEM.BYTE - END ; - - Rider* = RECORD - res*: LONGINT; - eof*: BOOLEAN; - buf: Buffer; - org, offset: LONGINT - END ; - - Time = POINTER TO TimeDesc; - TimeDesc = RECORD - sec*, min*, hour*, mday*, mon*, year*, wday*, isdst*, zone*, gmtoff*: LONGINT; -(* sec*, min*, hour*, mday*, mon*, year*, wday*, isdst*, zone*, gmtoff*: INTEGER;*) - END ; - - VAR - fileTab: ARRAY fileTabSize OF LONGINT (*=File*); - tempno: INTEGER; - -(* for localtime *) - PROCEDURE -includetime() - '#include "time.h"'; - - PROCEDURE -localtime(VAR clock: LONGINT): Time - "(Files0_Time) localtime(clock)"; - - PROCEDURE -getcwd(VAR cwd: Unix.Name) - "getcwd(cwd, cwd__len)"; - - PROCEDURE -IdxTrap "__HALT(-1)"; - - PROCEDURE^ Finalize(o: SYSTEM.PTR); - - PROCEDURE Err(s: ARRAY OF CHAR; f: File; errno: LONGINT); - BEGIN - Console.Ln; Console.String("-- "); Console.String(s); Console.String(": "); - IF f # NIL THEN - IF f.registerName # "" THEN Console.String(f.registerName) ELSE Console.String(f.workName) END - END ; - IF errno # 0 THEN Console.String(" errno = "); Console.Int(errno, 1) END ; - Console.Ln; - HALT(99) - END Err; - - PROCEDURE MakeFileName(dir, name: ARRAY OF CHAR; VAR dest: ARRAY OF CHAR); - VAR i, j: INTEGER; - BEGIN i := 0; j := 0; - WHILE dir[i] # 0X DO dest[i] := dir[i]; INC(i) END ; - IF dest[i-1] # "/" THEN dest[i] := "/"; INC(i) END ; - WHILE name[j] # 0X DO dest[i] := name[j]; INC(i); INC(j) END ; - dest[i] := 0X - END MakeFileName; - - PROCEDURE GetTempName(finalName: ARRAY OF CHAR; VAR name: ARRAY OF CHAR); - VAR n, i, j: LONGINT; - BEGIN - INC(tempno); n := tempno; i := 0; - IF finalName[0] # "/" THEN (* relative pathname *) - WHILE Kernel.CWD[i] # 0X DO name[i] := Kernel.CWD[i]; INC(i) END; - IF Kernel.CWD[i-1] # "/" THEN name[i] := "/"; INC(i) END - END; - j := 0; - WHILE finalName[j] # 0X DO name[i] := finalName[j]; INC(i); INC(j) END; - DEC(i); - WHILE name[i] # "/" DO DEC(i) END; - name[i+1] := "."; name[i+2] := "t"; name[i+3] := "m"; name[i+4] := "p"; name[i+5] := "."; INC(i, 6); - WHILE n > 0 DO name[i] := CHR(n MOD 10 + ORD("0")); n := n DIV 10; INC(i) END; - name[i] := "."; INC(i); n := SHORT(Unix.Getpid()); - WHILE n > 0 DO name[i] := CHR(n MOD 10 + ORD("0")); n := n DIV 10; INC(i) END; - name[i] := 0X - END GetTempName; - - PROCEDURE Create(f: File); - VAR stat: Unix.Status; done: BOOLEAN; - errno: LONGINT; err: ARRAY 32 OF CHAR; - BEGIN - IF f.fd = noDesc THEN - IF f.state = create THEN GetTempName(f.registerName, f.workName); f.tempFile := TRUE - ELSIF f.state = close THEN - f.workName := f.registerName; f.registerName := ""; f.tempFile := FALSE - END ; - errno := Unix.Unlink(f.workName); (*unlink first to avoid stale NFS handles and to avoid reuse of inodes*) -f.fd := Unix.Open(f.workName, SHORT(SYSTEM.VAL(LONGINT, (Unix.rdwr + Unix.creat + Unix.trunc))), SHORT(SYSTEM.VAL(LONGINT, ({2, 4,5, 7,8})))); - done := f.fd >= 0; errno := Unix.errno(); - IF (~done & ((errno = Unix.ENFILE) OR (errno = Unix.EMFILE))) OR (done & (f.fd >= fileTabSize)) THEN - IF done & (f.fd >= fileTabSize) THEN errno := Unix.Close(f.fd) END ; - Kernel.GC(TRUE); - f.fd := Unix.Open(f.workName, SHORT(SYSTEM.VAL(LONGINT, (Unix.rdwr + Unix.creat + Unix.trunc))), SHORT(SYSTEM.VAL(LONGINT, {2, 4,5, 7,8}))); - done := f.fd >= 0 - END ; - IF done THEN - IF f.fd >= fileTabSize THEN errno := Unix.Close(f.fd); Err("too many files open", f, 0) - ELSE fileTab[f.fd] := SYSTEM.VAL(LONGINT, f); INC(Kernel.nofiles); Kernel.RegisterObject(f, Finalize); - f.state := open; f.pos := 0; errno := Unix.Fstat(f.fd, stat); - f.dev := stat.dev; f.ino := stat.ino; f.mtime := stat.mtime - END - ELSE errno := Unix.errno(); - IF errno = Unix.ENOENT THEN err := "no such directory" - ELSIF (errno = Unix.ENFILE) OR (errno = Unix.EMFILE) THEN err := "too many files open" - ELSE err := "file not created" - END ; - Err(err, f, errno) - END - END - END Create; - - PROCEDURE Flush(buf: Buffer); - VAR res: LONGINT; f: File; stat: Unix.Status; - BEGIN - IF buf.chg THEN f := buf.f; Create(f); - IF buf.org # f.pos THEN res := Unix.Lseek(f.fd, buf.org, 0) END ; - res := Unix.Write(f.fd, SYSTEM.ADR(buf.data), buf.size); - IF res < 0 THEN Err("error in writing file", f, Unix.errno()) END ; - f.pos := buf.org + buf.size; - buf.chg := FALSE; - res := Unix.Fstat(f.fd, stat); - f.mtime := stat.mtime - END - END Flush; - - PROCEDURE Close* (f: File); - VAR i, res: LONGINT; - BEGIN - IF (f.state # create) OR (f.registerName # "") THEN - Create(f); i := 0; - WHILE (i < nofbufs) & (f.bufs[i] # NIL) DO Flush(f.bufs[i]); INC(i) END ; - res := Unix.Fsync(f.fd); - IF res < 0 THEN Err("error in writing file", f, Unix.errno()) END - END - END Close; - - PROCEDURE Length* (f: File): LONGINT; - BEGIN RETURN f.len - END Length; - - PROCEDURE New* (name: ARRAY OF CHAR): File; - VAR f: File; - BEGIN - NEW(f); f.workName := ""; COPY(name, f.registerName); - f.fd := noDesc; f.state := create; f.len := 0; f.pos := 0; f.swapper := -1; (*all f.buf[i] = NIL*) - RETURN f - END New; - - PROCEDURE ScanPath(VAR pos: INTEGER; VAR dir: ARRAY OF CHAR); (* supports ~, ~user and blanks inside path *) - VAR i: INTEGER; ch: CHAR; home: ARRAY 256 OF CHAR; - BEGIN - i := 0; ch := Kernel.OBERON[pos]; - WHILE (ch = " ") OR (ch = ":") DO INC(pos); ch := Kernel.OBERON[pos] END ; - IF ch = "~" THEN - INC(pos); ch := Kernel.OBERON[pos]; - home := ""; Args.GetEnv("HOME", home); - WHILE home[i] # 0X DO dir[i] := home[i]; INC(i) END ; - IF (ch # "/") & (ch # 0X) & (ch # ":") & (ch # " ") THEN - WHILE (i > 0) & (dir[i-1] # "/") DO DEC(i) END - END - END ; - WHILE (ch # 0X) & (ch # ":") DO dir[i] := ch; INC(i); INC(pos); ch := Kernel.OBERON[pos] END ; - WHILE (i > 0) & (dir[i-1] = " ") DO DEC(i) END ; - dir[i] := 0X - END ScanPath; - - PROCEDURE HasDir(VAR name: ARRAY OF CHAR): BOOLEAN; - VAR i: INTEGER; ch: CHAR; - BEGIN i := 0; ch := name[0]; - WHILE (ch # 0X) & (ch # "/") DO INC(i); ch := name[i] END ; - RETURN ch = "/" - END HasDir; - - PROCEDURE CacheEntry(dev, ino: LONGINT; mtime: LONGINT): File; - VAR f: File; i: INTEGER; stat: Unix.Status; res: LONGINT; - BEGIN i := 0; - WHILE i < fileTabSize DO - f := SYSTEM.VAL(File, fileTab[i]); - IF (f # NIL) & (ino = f.ino) & (dev = f.dev) THEN - IF mtime # f.mtime THEN i := 0; - WHILE i < nofbufs DO - IF f.bufs[i] # NIL THEN f.bufs[i].org := -1; f.bufs[i] := NIL END ; - INC(i) - END ; - f.swapper := -1; f.mtime := mtime; - res := Unix.Fstat(f.fd, stat); f.len := stat.size - END ; - RETURN f - END ; - INC(i) - END ; - RETURN NIL - END CacheEntry; - - PROCEDURE Old* (name: ARRAY OF CHAR): File; - VAR f: File; fd: INTEGER; res, errno: LONGINT; pos: INTEGER; done: BOOLEAN; - dir, path: ARRAY 256 OF CHAR; - stat: Unix.Status; - BEGIN - IF name # "" THEN - IF HasDir(name) THEN dir := ""; COPY(name, path) - ELSE pos := 0; ScanPath(pos, dir); MakeFileName(dir, name, path); ScanPath(pos, dir) - END ; - LOOP - fd := Unix.Open(path, SHORT(SYSTEM.VAL(LONGINT, Unix.rdwr)), SHORT(SYSTEM.VAL(LONGINT, {}))); done := fd >= 0; errno := Unix.errno(); - IF (~done & ((errno = Unix.ENFILE) OR (errno = Unix.EMFILE))) OR (done & (fd >= fileTabSize)) THEN - IF done & (fd >= fileTabSize) THEN res := Unix.Close(fd) END ; - Kernel.GC(TRUE); - fd := Unix.Open(path, SHORT(SYSTEM.VAL(LONGINT, Unix.rdwr)), SHORT(SYSTEM.VAL(LONGINT, {}))); - done := fd >= 0; errno := Unix.errno(); - IF ~done & ((errno = Unix.ENFILE) OR (errno = Unix.EMFILE)) THEN Err("too many files open", f, errno) END - END ; - IF ~done & ((errno = Unix.EACCES) OR (errno = Unix.EROFS) OR (errno = Unix.EAGAIN)) THEN - (* errno EAGAIN observed on Solaris 2.4 *) - fd := Unix.Open(path, SHORT(SYSTEM.VAL(LONGINT, Unix.rdonly)), SHORT(SYSTEM.VAL(LONGINT, {}))); done := fd >= 0; errno := Unix.errno() - END ; -IF (~done) & (errno # Unix.ENOENT) THEN - Console.String("warning Files0.Old "); Console.String(name); - Console.String(" errno = "); Console.Int(errno, 0); Console.Ln; -END ; - IF done THEN - res := Unix.Fstat(fd, stat); - f := CacheEntry(stat.dev, stat.ino, stat.mtime); - IF f # NIL THEN res := Unix.Close(fd); RETURN f - ELSIF fd >= fileTabSize THEN res := Unix.Close(fd); Err("too many files open", f, 0) - ELSE NEW(f); fileTab[fd] := SYSTEM.VAL(LONGINT, f); INC(Kernel.nofiles); Kernel.RegisterObject(f, Finalize); - f.fd := fd; f.state := open; f.len := stat.size; f.pos := 0; f.swapper := -1; (*all f.buf[i] = NIL*) - COPY(name, f.workName); f.registerName := ""; f.tempFile := FALSE; - f.dev := stat.dev; f.ino := stat.ino; f.mtime := stat.mtime; - RETURN f - END - ELSIF dir = "" THEN RETURN NIL - ELSE MakeFileName(dir, name, path); ScanPath(pos, dir) - END - END - ELSE RETURN NIL - END - END Old; - - PROCEDURE Purge* (f: File); - VAR i: INTEGER; stat: Unix.Status; res: LONGINT; - BEGIN i := 0; - WHILE i < nofbufs DO - IF f.bufs[i] # NIL THEN f.bufs[i].org := -1; f.bufs[i] := NIL END ; - INC(i) - END ; - IF f.fd # noDesc THEN res := Unix.Ftruncate(f.fd, 0); res := Unix.Lseek(f.fd, 0, 0) END ; - f.pos := 0; f.len := 0; f.swapper := -1; - res := Unix.Fstat(f.fd, stat); f.mtime := stat.mtime - END Purge; - - PROCEDURE GetDate* (f: File; VAR t, d: LONGINT); - VAR stat: Unix.Status; clock, res: LONGINT; time: Time; - BEGIN - Create(f); res := Unix.Fstat(f.fd, stat); - time := localtime(stat.mtime); - t := time.sec + ASH(time.min, 6) + ASH(time.hour, 12); - d := time.mday + ASH(time.mon+1, 5) + ASH(time.year MOD 100, 9) - END GetDate; - - PROCEDURE Pos* (VAR r: Rider): LONGINT; - BEGIN RETURN r.org + r.offset - END Pos; - - PROCEDURE Set* (VAR r: Rider; f: File; pos: LONGINT); - VAR org, offset, i, n, res: LONGINT; buf: Buffer; - BEGIN - IF f # NIL THEN - IF pos > f.len THEN pos := f.len ELSIF pos < 0 THEN pos := 0 END ; - offset := pos MOD bufsize; org := pos - offset; i := 0; - WHILE (i < nofbufs) & (f.bufs[i] # NIL) & (org # f.bufs[i].org) DO INC(i) END ; - IF i < nofbufs THEN - IF f.bufs[i] = NIL THEN NEW(buf); buf.chg := FALSE; buf.org := -1; buf.f := f; f.bufs[i] := buf - ELSE buf := f.bufs[i] - END - ELSE - f.swapper := (f.swapper + 1) MOD nofbufs; - buf := f.bufs[f.swapper]; - Flush(buf) - END ; - IF buf.org # org THEN - IF org = f.len THEN buf.size := 0 - ELSE Create(f); - IF f.pos # org THEN res := Unix.Lseek(f.fd, org, 0) END ; - n := Unix.ReadBlk(f.fd, buf.data); - IF n < 0 THEN Err("read from file not done", f, Unix.errno()) END ; - f.pos := org + n; - buf.size := n - END ; - buf.org := org; buf.chg := FALSE - END - ELSE buf := NIL; org := 0; offset := 0 - END ; - r.buf := buf; r.org := org; r.offset := offset; r.eof := FALSE; r.res := 0 - END Set; - - PROCEDURE Read* (VAR r: Rider; VAR x: SYSTEM.BYTE); - VAR offset: LONGINT; buf: Buffer; - BEGIN - buf := r.buf; offset := r.offset; - IF r.org # buf.org THEN Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset END ; - IF (offset < buf.size) THEN - x := buf.data[offset]; r.offset := offset + 1 - ELSIF r.org + offset < buf.f.len THEN - Set(r, r.buf.f, r.org + offset); - x := r.buf.data[0]; r.offset := 1 - ELSE - x := 0X; r.eof := TRUE - END - END Read; - - PROCEDURE ReadBytes* (VAR r: Rider; VAR x: ARRAY OF SYSTEM.BYTE; n: LONGINT); - VAR xpos, min, restInBuf, offset: LONGINT; buf: Buffer; - BEGIN - IF n > LEN(x) THEN IdxTrap END ; - xpos := 0; buf := r.buf; offset := r.offset; - WHILE n > 0 DO - IF (r.org # buf.org) OR (offset >= bufsize) THEN - Set(r, buf.f, r.org + offset); - buf := r.buf; offset := r.offset - END ; - restInBuf := buf.size - offset; - IF restInBuf = 0 THEN r.res := n; r.eof := TRUE; RETURN - ELSIF n > restInBuf THEN min := restInBuf ELSE min := n END ; - SYSTEM.MOVE(SYSTEM.ADR(buf.data) + offset, SYSTEM.ADR(x) + xpos, min); - INC(offset, min); r.offset := offset; INC(xpos, min); DEC(n, min) - END ; - r.res := 0; r.eof := FALSE - END ReadBytes; - - PROCEDURE ReadByte* (VAR r : Rider; VAR x : ARRAY OF SYSTEM.BYTE); - BEGIN - ReadBytes(r, x, 1); - END ReadByte; - - PROCEDURE Base* (VAR r: Rider): File; - BEGIN RETURN r.buf.f - END Base; - - PROCEDURE Write* (VAR r: Rider; x: SYSTEM.BYTE); - VAR buf: Buffer; offset: LONGINT; - BEGIN - buf := r.buf; offset := r.offset; - IF (r.org # buf.org) OR (offset >= bufsize) THEN - Set(r, buf.f, r.org + offset); - buf := r.buf; offset := r.offset - END ; - buf.data[offset] := x; - buf.chg := TRUE; - IF offset = buf.size THEN - INC(buf.size); INC(buf.f.len) - END ; - r.offset := offset + 1; r.res := 0 - END Write; - - PROCEDURE WriteBytes* (VAR r: Rider; VAR x: ARRAY OF SYSTEM.BYTE; n: LONGINT); - VAR xpos, min, restInBuf, offset: LONGINT; buf: Buffer; - BEGIN - IF n > LEN(x) THEN IdxTrap END ; - xpos := 0; buf := r.buf; offset := r.offset; - WHILE n > 0 DO - IF (r.org # buf.org) OR (offset >= bufsize) THEN - Set(r, buf.f, r.org + offset); - buf := r.buf; offset := r.offset - END ; - restInBuf := bufsize - offset; - IF n > restInBuf THEN min := restInBuf ELSE min := n END ; - SYSTEM.MOVE(SYSTEM.ADR(x) + xpos, SYSTEM.ADR(buf.data) + offset, min); - INC(offset, min); r.offset := offset; - IF offset > buf.size THEN INC(buf.f.len, offset - buf.size); buf.size := offset END ; - INC(xpos, min); DEC(n, min); buf.chg := TRUE - END ; - r.res := 0 - END WriteBytes; - -(* another solution would be one that is similar to ReadBytes, WriteBytes. -No code duplication, more symmetric, only two ifs for -Read and Write in buffer, buf.size replaced by bufsize in Write ops, buf.size and len -must be made consistent with offset (if offset > buf.size) in a lazy way. - -PROCEDURE Write* (VAR r: Rider; x: SYSTEM.BYTE); - VAR buf: Buffer; offset: LONGINT; -BEGIN - buf := r.buf; offset := r.offset; - IF (offset >= bufsize) OR (r.org # buf.org) THEN - Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset; - END ; - buf.data[offset] := x; r.offset := offset + 1; buf.chg := TRUE -END Write; - -PROCEDURE WriteBytes ... - -PROCEDURE Read* (VAR r: Rider; VAR x: SYSTEM.BYTE); - VAR offset: LONGINT; buf: Buffer; -BEGIN - buf := r.buf; offset := r.offset; - IF (offset >= buf.size) OR (r.org # buf.org) THEN - IF r.org + offset >= buf.f.len THEN x := 0X; r.eof := TRUE; RETURN - ELSE Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset - END - END ; - x := buf.data[offset]; r.offset := offset + 1 -END Read; - -but this would also affect Set, Length, and Flush. -Especially Length would become fairly complex. -*) - - PROCEDURE Delete* (name: ARRAY OF CHAR; VAR res: INTEGER); - BEGIN - res := SHORT(Unix.Unlink(name)); - res := SHORT(Unix.errno()) - END Delete; - - PROCEDURE Rename* (old, new: ARRAY OF CHAR; VAR res: INTEGER); - VAR fdold, fdnew: INTEGER; n, errno, r: LONGINT; - ostat, nstat: Unix.Status; - buf: ARRAY 4096 OF CHAR; - BEGIN - r := Unix.Stat(old, ostat); - IF r >= 0 THEN - r := Unix.Stat(new, nstat); - IF (r >= 0) & ((ostat.dev # nstat.dev) OR (ostat.ino # nstat.ino)) THEN - Delete(new, res); (* work around stale nfs handles *) - END ; - r := Unix.Rename(old, new); - IF r < 0 THEN res := SHORT(Unix.errno()); - IF res = Unix.EXDEV THEN (* cross device link, move the file *) - fdold := Unix.Open(old, SHORT(SYSTEM.VAL(LONGINT, Unix.rdonly)), SHORT(SYSTEM.VAL(LONGINT, {}))); - IF fdold < 0 THEN res := 2; RETURN END ; - fdnew := Unix.Open(new, SHORT(SYSTEM.VAL(LONGINT, Unix.rdwr + Unix.creat + Unix.trunc)), SHORT(SYSTEM.VAL(LONGINT, {2, 4,5, 7,8}))); - IF fdnew < 0 THEN r := Unix.Close(fdold); res := 3; RETURN END ; - n := Unix.Read(fdold, SYSTEM.ADR(buf), bufsize); - WHILE n > 0 DO - r := Unix.Write(fdnew, SYSTEM.ADR(buf), n); - IF r < 0 THEN errno := Unix.errno(); r := Unix.Close(fdold); r := Unix.Close(fdnew); - Err("cannot move file", NIL, errno) - END ; - n := Unix.Read(fdold, SYSTEM.ADR(buf), bufsize) - END ; - errno := Unix.errno(); - r := Unix.Close(fdold); r := Unix.Close(fdnew); - IF n = 0 THEN r := Unix.Unlink(old); res := 0 - ELSE Err("cannot move file", NIL, errno) - END ; - ELSE RETURN (* res is Unix.Rename return code *) - END - END ; - res := 0 - ELSE res := 2 (* old file not found *) - END - END Rename; - - PROCEDURE Register* (f: File); - VAR idx, errno: INTEGER; f1: File; file: ARRAY 104 OF CHAR; - BEGIN - IF (f.state = create) & (f.registerName # "") THEN f.state := close (* shortcut renaming *) END ; - Close(f); - IF f.registerName # "" THEN - Rename(f.workName, f.registerName, errno); - IF errno # 0 THEN COPY(f.registerName, file); HALT(99) END ; - f.workName := f.registerName; f.registerName := ""; f.tempFile := FALSE - END - END Register; - - PROCEDURE ChangeDirectory*(path: ARRAY OF CHAR; VAR res: INTEGER); - BEGIN - res := SHORT(Unix.Chdir(path)); - getcwd(Kernel.CWD) - END ChangeDirectory; - - PROCEDURE FlipBytes(VAR src, dest: ARRAY OF SYSTEM.BYTE); - VAR i, j: LONGINT; - BEGIN - IF ~Kernel.littleEndian THEN i := LEN(src); j := 0; - WHILE i > 0 DO DEC(i); dest[j] := src[i]; INC(j) END - ELSE SYSTEM.MOVE(SYSTEM.ADR(src), SYSTEM.ADR(dest), LEN(src)) - END - END FlipBytes; - - PROCEDURE ReadBool* (VAR R: Rider; VAR x: BOOLEAN); - BEGIN Read(R, SYSTEM.VAL(CHAR, x)) - END ReadBool; - - PROCEDURE ReadInt* (VAR R: Rider; VAR x: INTEGER); - VAR b: ARRAY 2 OF CHAR; - BEGIN ReadBytes(R, b, 2); - x := ORD(b[0]) + ORD(b[1])*256 - END ReadInt; - - PROCEDURE ReadLInt* (VAR R: Rider; VAR x: LONGINT); - VAR b: ARRAY 4 OF CHAR; - BEGIN ReadBytes(R, b, 4); - x := ORD(b[0]) + ORD(b[1])*100H + ORD(b[2])*10000H + ORD(b[3])*1000000H - END ReadLInt; - - PROCEDURE ReadSet* (VAR R: Rider; VAR x: SET); - VAR b: ARRAY 4 OF CHAR; - BEGIN ReadBytes(R, b, 4); - x := SYSTEM.VAL(SET, ORD(b[0]) + ORD(b[1])*100H + ORD(b[2])*10000H + ORD(b[3])*1000000H) - END ReadSet; - - PROCEDURE ReadReal* (VAR R: Rider; VAR x: REAL); - VAR b: ARRAY 4 OF CHAR; - BEGIN ReadBytes(R, b, 4); FlipBytes(b, x) - END ReadReal; - - PROCEDURE ReadLReal* (VAR R: Rider; VAR x: LONGREAL); - VAR b: ARRAY 8 OF CHAR; - BEGIN ReadBytes(R, b, 8); FlipBytes(b, x) - END ReadLReal; - - PROCEDURE ReadString* (VAR R: Rider; VAR x: ARRAY OF CHAR); - VAR i: INTEGER; ch: CHAR; - BEGIN i := 0; - REPEAT Read(R, ch); x[i] := ch; INC(i) UNTIL ch = 0X - END ReadString; - - PROCEDURE ReadNum* (VAR R: Rider; VAR x: LONGINT); - VAR s: SHORTINT; ch: CHAR; n: LONGINT; - BEGIN s := 0; n := 0; Read(R, ch); - WHILE ORD(ch) >= 128 DO INC(n, ASH(ORD(ch) - 128, s) ); INC(s, 7); Read(R, ch) END; - INC(n, ASH(ORD(ch) MOD 64 - ORD(ch) DIV 64 * 64, s) ); - x := n - END ReadNum; - - PROCEDURE WriteBool* (VAR R: Rider; x: BOOLEAN); - BEGIN Write(R, SYSTEM.VAL(CHAR, x)) - END WriteBool; - - PROCEDURE WriteInt* (VAR R: Rider; x: INTEGER); - VAR b: ARRAY 2 OF CHAR; - BEGIN b[0] := CHR(x); b[1] := CHR(x DIV 256); - WriteBytes(R, b, 2); - END WriteInt; - - PROCEDURE WriteLInt* (VAR R: Rider; x: LONGINT); - VAR b: ARRAY 4 OF CHAR; - BEGIN - b[0] := CHR(x); b[1] := CHR(x DIV 100H); b[2] := CHR(x DIV 10000H); b[3] := CHR(x DIV 1000000H); - WriteBytes(R, b, 4); - END WriteLInt; - - PROCEDURE WriteSet* (VAR R: Rider; x: SET); - VAR b: ARRAY 4 OF CHAR; i: LONGINT; - BEGIN i := SYSTEM.VAL(LONGINT, x); - 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; - - PROCEDURE WriteReal* (VAR R: Rider; x: REAL); - VAR b: ARRAY 4 OF CHAR; - BEGIN FlipBytes(x, b); WriteBytes(R, b, 4) - END WriteReal; - - PROCEDURE WriteLReal* (VAR R: Rider; x: LONGREAL); - VAR b: ARRAY 8 OF CHAR; - BEGIN FlipBytes(x, b); WriteBytes(R, b, 8) - END WriteLReal; - - PROCEDURE WriteString* (VAR R: Rider; x: ARRAY [1] OF CHAR); - VAR i: INTEGER; - BEGIN i := 0; - WHILE x[i] # 0X DO INC(i) END ; - WriteBytes(R, x, i+1) - END WriteString; - - PROCEDURE WriteNum* (VAR R: Rider; x: LONGINT); - BEGIN - WHILE (x < - 64) OR (x > 63) DO Write(R, CHR(x MOD 128 + 128)); x := x DIV 128 END; - Write(R, CHR(x MOD 128)) - END WriteNum; - - PROCEDURE Finalize(o: SYSTEM.PTR); - VAR f: File; res: LONGINT; - BEGIN - f := SYSTEM.VAL(File, o); - IF f.fd >= 0 THEN - fileTab[f.fd] := 0; res := Unix.Close(f.fd); f.fd := -1; DEC(Kernel.nofiles); - IF f.tempFile THEN res := Unix.Unlink(f.workName) END - END - END Finalize; - - PROCEDURE Init; - VAR i: LONGINT; - BEGIN - i := 0; WHILE i < fileTabSize DO fileTab[i] := 0; INC(i) END ; - tempno := -1; Kernel.nofiles := 0 - END Init; - -BEGIN Init -END Files0. diff --git a/src/system/freebsd/clang/x86_64/SYSTEM.c0 b/src/system/freebsd/clang/x86_64/SYSTEM.c0 deleted file mode 100644 index 17801802..00000000 --- a/src/system/freebsd/clang/x86_64/SYSTEM.c0 +++ /dev/null @@ -1,205 +0,0 @@ -/* -* The body prefix file of the voc(jet backend) runtime system, Version 1.0 -* -* Copyright (c) Software Templ, 1994, 1995 -* -* Module SYSTEM is subject to change any time without prior notification. -* Software Templ disclaims all warranties with regard to module SYSTEM, -* in particular shall Software Templ not be liable for any damage resulting -* from inappropriate use or modification of module SYSTEM. -* -* Version 1.1 jt, 24.11.95 fixes for correct pointer arithmetic on Cray computers -* jt 31.1.2007 ANSI prototypes for malloc and exit in order to avoid cc warnings -* -*/ - -#include "SYSTEM.h" -#ifdef __STDC__ -#include "stdarg.h" -#else -#include "varargs.h" -#endif - -extern void *malloc(size_t size); -extern void exit(int status); - -void (*SYSTEM_Halt)(); -LONGINT SYSTEM_halt; /* x in HALT(x) */ -LONGINT SYSTEM_assert; /* x in ASSERT(cond, x) */ -LONGINT SYSTEM_argc; -LONGINT SYSTEM_argv; -LONGINT SYSTEM_lock; -BOOLEAN SYSTEM_interrupted; -static LONGINT SYSTEM_mainfrm; /* adr of main proc stack frame, used for stack collection */ - -#define Lock SYSTEM_lock++ -#define Unlock SYSTEM_lock--; if (SYSTEM_interrupted && (SYSTEM_lock == 0)) __HALT(-9) - - -static void SYSTEM_InitHeap(); -void *SYSTEM__init(); - -void SYSTEM_INIT(argc, argvadr) - int argc; long argvadr; -{ - SYSTEM_mainfrm = argvadr; - SYSTEM_argc = argc; - SYSTEM_argv = *(long*)argvadr; - SYSTEM_InitHeap(); - SYSTEM_halt = -128; - SYSTEM__init(); -} - -void SYSTEM_FINI() -{ - SYSTEM_FINALL(); -} - -long SYSTEM_XCHK(i, ub) long i, ub; {return __X(i, ub);} -long SYSTEM_RCHK(i, ub) long i, ub; {return __R(i, ub);} -long SYSTEM_ASH(i, n) long i, n; {return __ASH(i, n);} -long SYSTEM_ABS(i) long i; {return __ABS(i);} -double SYSTEM_ABSD(i) double i; {return __ABS(i);} - -void SYSTEM_INHERIT(t, t0) - long *t, *t0; -{ - t -= __TPROC0OFF; - t0 -= __TPROC0OFF; - while (*t0 != __EOM) {*t = *t0; t--; t0--;} -} - -void SYSTEM_ENUMP(adr, n, P) - long *adr; - long n; - void (*P)(); -{ - while (n > 0) {P(*adr); adr++; n--;} -} - -void SYSTEM_ENUMR(adr, typ, size, n, P) - char *adr; - long *typ, size, n; - void (*P)(); -{ - long *t, off; - typ++; - while (n > 0) { - t = typ; - off = *t; - while (off >= 0) {P(*(long*)(adr+off)); t++; off = *t;} - adr += size; n--; - } -} - -long SYSTEM_DIV(x, y) - unsigned long x, y; -{ if ((long) x >= 0) return (x / y); - else return -((y - 1 - x) / y); -} - -long SYSTEM_MOD(x, y) - unsigned long x, y; -{ unsigned long m; - if ((long) x >= 0) return (x % y); - else { m = (-x) % y; - if (m != 0) return (y - m); else return 0; - } -} - -long SYSTEM_ENTIER(x) - double x; -{ - long y; - if (x >= 0) - return (long)x; - else { - y = (long)x; - if (y <= x) return y; else return y - 1; - } -} - -void SYSTEM_HALT(n) - int n; -{ - SYSTEM_halt = n; - if (SYSTEM_Halt!=0) SYSTEM_Halt(n); - exit(n); -} - -#ifdef __STDC__ -SYSTEM_PTR SYSTEM_NEWARR(long *typ, long elemsz, int elemalgn, int nofdim, int nofdyn, ...) -#else -SYSTEM_PTR SYSTEM_NEWARR(typ, elemsz, elemalgn, nofdim, nofdyn, va_alist) - long *typ, elemsz; - int elemalgn, nofdim, nofdyn; - va_dcl -#endif -{ - long nofelems, size, dataoff, n, nptr, *x, *p, nofptrs, i, *ptab, off; - va_list ap; -#ifdef __STDC__ - va_start(ap, nofdyn); -#else - va_start(ap); -#endif - nofelems = 1; - while (nofdim > 0) { - nofelems = nofelems * va_arg(ap, long); nofdim--; - if (nofelems <= 0) __HALT(-20); - } - va_end(ap); - dataoff = nofdyn * sizeof(long); - if (elemalgn > sizeof(long)) { - n = dataoff % elemalgn; - if (n != 0) dataoff += elemalgn - n; - } - size = dataoff + nofelems * elemsz; - Lock; - if (typ == NIL) { - /* element typ does not contain pointers */ - x = SYSTEM_NEWBLK(size); - } - else if (typ == POINTER__typ) { - /* element type is a pointer */ - x = SYSTEM_NEWBLK(size + nofelems * sizeof(long)); - p = (long*)x[-1]; - p[-nofelems] = *p; /* build new type desc in situ: 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ - p -= nofelems - 1; n = 1; /* n =1 for skipping the size field */ - while (n <= nofelems) {*p = n*sizeof(long); p++; n++;} - *p = - (nofelems + 1) * sizeof(long); /* sentinel */ - x[-1] -= nofelems * sizeof(long); - } - else { - /* element type is a record that contains pointers */ - ptab = typ + 1; nofptrs = 0; - while (ptab[nofptrs] >= 0) {nofptrs++;} /* number of pointers per element */ - nptr = nofelems * nofptrs; /* total number of pointers */ - x = SYSTEM_NEWBLK(size + nptr * sizeof(long)); - p = (long*)x[- 1]; - p[-nptr] = *p; /* build new type desc in situ; 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ - p -= nptr - 1; n = 0; off = dataoff; - while (n < nofelems) {i = 0; - while (i < nofptrs) {*p = off + ptab[i]; p++; i++;} - off += elemsz; n++; - } - *p = - (nptr + 1) * sizeof(long); /* sentinel */ - x[-1] -= nptr * sizeof(long); - } - if (nofdyn != 0) { - /* setup len vector for index checks */ -#ifdef __STDC__ - va_start(ap, nofdyn); -#else - va_start(ap); -#endif - p = x; - while (nofdyn > 0) {*p = va_arg(ap, long); p++, nofdyn--;} - va_end(ap); - } - Unlock; - return x; -} - -/* ----------- end of SYSTEM.co ------------- */ - diff --git a/src/system/freebsd/clang/x86_64/SYSTEM.h b/src/system/freebsd/clang/x86_64/SYSTEM.h deleted file mode 100644 index 90bdadd4..00000000 --- a/src/system/freebsd/clang/x86_64/SYSTEM.h +++ /dev/null @@ -1,242 +0,0 @@ -#ifndef SYSTEM__h -#define SYSTEM__h - -/* - -voc (jet backend) runtime system interface and macros library -copyright (c) Josef Templ, 1995, 1996 - -clang for Darwin version -uses double # as concatenation operator - -*/ -#include -//#include -#include /* for type sizes -- noch */ -//#include - -extern void *memcpy(void *dest, const void *src, unsigned long n); -extern void *malloc(size_t size); -extern void exit(int status); - -#define export -#define import extern - -/* constants */ -#define __MAXEXT 16 -#define NIL 0L -#define POINTER__typ (long*)1L /* not NIL and not a valid type */ - -/* basic types */ -//typedef char BOOLEAN; -#define BOOLEAN char -//typedef unsigned char CHAR; -#define CHAR unsigned char -//exactly two bytes -#define LONGCHAR unsigned short int -//typedef signed char SHORTINT; -#define SHORTINT signed char -//for x86 GNU/Linux -//typedef short int INTEGER; -//for x86_64 GNU/Linux -//typedef int INTEGER; -#define INTEGER int -//typedef long LONGINT; -#define LONGINT long -//typedef float REAL; -#define REAL float -//typedef double LONGREAL; -#define LONGREAL double -//typedef unsigned long SET; -#define SET unsigned long -typedef void *SYSTEM_PTR; -//#define *SYSTEM_PTR void -//typedef unsigned char SYSTEM_BYTE; -#define SYSTEM_BYTE unsigned char -typedef int8_t SYSTEM_INT8; -typedef int16_t SYSTEM_INT16; -typedef int32_t SYSTEM_INT32; -typedef int64_t SYSTEM_INT64; - -/* runtime system routines */ -extern long SYSTEM_DIV(); -extern long SYSTEM_MOD(); -extern long SYSTEM_ENTIER(); -extern long SYSTEM_ASH(); -extern long SYSTEM_ABS(); -extern long SYSTEM_XCHK(); -extern long SYSTEM_RCHK(); -extern double SYSTEM_ABSD(); -extern SYSTEM_PTR SYSTEM_NEWREC(); -extern SYSTEM_PTR SYSTEM_NEWBLK(); -#ifdef __STDC__ -extern SYSTEM_PTR SYSTEM_NEWARR(long*, long, int, int, int, ...); -#else -extern SYSTEM_PTR SYSTEM_NEWARR(); -#endif -extern SYSTEM_PTR SYSTEM_REGMOD(); -extern void SYSTEM_INCREF(); -extern void SYSTEM_REGCMD(); -extern void SYSTEM_REGTYP(); -extern void SYSTEM_REGFIN(); -extern void SYSTEM_FINALL(); -extern void SYSTEM_INIT(); -extern void SYSTEM_FINI(); -extern void SYSTEM_HALT(); -extern void SYSTEM_INHERIT(); -extern void SYSTEM_ENUMP(); -extern void SYSTEM_ENUMR(); - -/* module registry */ -#define __DEFMOD static void *m; if(m!=0)return m -#define __REGMOD(name, enum) if(m==0)m=SYSTEM_REGMOD((CHAR*)name,enum); else return m -#define __ENDMOD return m -#define __INIT(argc, argv) static void *m; SYSTEM_INIT(argc, (long)&argv); -#define __REGMAIN(name, enum) m=SYSTEM_REGMOD(name,enum) -#define __FINI SYSTEM_FINI(); return 0 -#define __IMPORT(name) SYSTEM_INCREF(name##__init()) -#define __REGCMD(name, cmd) SYSTEM_REGCMD(m, name, cmd) - -/* SYSTEM ops */ -#define __SYSNEW(p, len) p=SYSTEM_NEWBLK((long)(len)) -#define __VAL(t, x) (*(t*)&(x)) -#define __GET(a, x, t) x= *(t*)(a) -#define __PUT(a, x, t) *(t*)(a)=x -#define __LSHL(x, n, t) ((t)((unsigned t)(x)<<(n))) -#define __LSHR(x, n, t) ((t)((unsigned t)(x)>>(n))) -#define __LSH(x, n, t) ((n)>=0? __LSHL(x, n, t): __LSHR(x, -(n), t)) -#define __ROTL(x, n, t) ((t)((unsigned t)(x)<<(n)|(unsigned t)(x)>>(8*sizeof(t)-(n)))) -#define __ROTR(x, n, t) ((t)((unsigned t)(x)>>(n)|(unsigned t)(x)<<(8*sizeof(t)-(n)))) -#define __LSHR(x, n, t) ((t)((unsigned t)(x)>>(n))) -#define __LSH(x, n, t) ((n)>=0? __LSHL(x, n, t): __LSHR(x, -(n), t)) -#define __ROTL(x, n, t) ((t)((unsigned t)(x)<<(n)|(unsigned t)(x)>>(8*sizeof(t)-(n)))) -#define __ROTR(x, n, t) ((t)((unsigned t)(x)>>(n)|(unsigned t)(x)<<(8*sizeof(t)-(n)))) -#define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) -#define __BIT(x, n) (*(unsigned long*)(x)>>(n)&1) -#define __MOVE(s, d, n) memcpy((char*)(d),(char*)(s),n) - -/* std procs and operator mappings */ -#define __SHORT(x, y) ((int)((unsigned long)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) -#define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) -#define __CHR(x) ((CHAR)__R(x, 256)) -#define __CHRF(x) ((CHAR)__RF(x, 256)) -#define __DIV(x, y) ((x)>=0?(x)/(y):-(((y)-1-(x))/(y))) -#define __DIVF(x, y) SYSTEM_DIV((long)(x),(long)(y)) -#define __MOD(x, y) ((x)>=0?(x)%(y):__MODF(x,y)) -#define __MODF(x, y) SYSTEM_MOD((long)(x),(long)(y)) -#define __NEW(p, t) p=SYSTEM_NEWREC((long)t##__typ) -#define __NEWARR SYSTEM_NEWARR -#define __HALT(x) SYSTEM_HALT(x) -#define __ASSERT(cond, x) if (!(cond)) {SYSTEM_assert = x; SYSTEM_HALT(-1);} -#define __ENTIER(x) SYSTEM_ENTIER(x) -#define __ABS(x) (((x)<0)?-(x):(x)) -#define __ABSF(x) SYSTEM_ABS((long)(x)) -#define __ABSFD(x) SYSTEM_ABSD((double)(x)) -#define __CAP(ch) ((CHAR)((ch)&0x5f)) -#define __ODD(x) ((x)&1) -#define __IN(x, s) (((s)>>(x))&1) -#define __SETOF(x) ((SET)1<<(x)) -#define __SETRNG(l, h) ((~(SET)0<<(l))&~(SET)0>>(8*sizeof(SET)-1-(h))) -#define __MASK(x, m) ((x)&~(m)) -#define __COPY(s, d, n) {char*_a=(void*)s,*_b=(void*)d;long _i=0,_t=n-1;while(_i<_t&&((_b[_i]=_a[_i])!=0)){_i++;};_b[_i]=0;} -static int __STRCMP(x, y) - CHAR *x, *y; -{long i = 0; CHAR ch1, ch2; - do {ch1 = x[i]; ch2 = y[i]; i++; - if (!ch1) return -(int)ch2; - } while (ch1==ch2); - return (int)ch1 - (int)ch2; -} -#define __ASH(x, n) ((n)>=0?__ASHL(x,n):__ASHR(x,-(n))) -#define __ASHL(x, n) ((long)(x)<<(n)) -#define __ASHR(x, n) ((long)(x)>>(n)) -#define __ASHF(x, n) SYSTEM_ASH((long)(x), (long)(n)) -// commented out to use malloc -- noch -//#define __DUP(x, l, t) x=(void*)memcpy(alloca(l*sizeof(t)),x,l*sizeof(t)) -#define __DUP(x, l, t) x=(void*)memcpy(malloc(l*sizeof(t)),x,l*sizeof(t)) -#define __DUPARR(v, t) v=(void*)memcpy(v##__copy,v,sizeof(t)) -//#define __DEL(x) /* DUP with alloca frees storage automatically */ -#define __DEL(x) free(x) -#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(long)typ##__typ) -#define __TYPEOF(p) (*(((long**)(p))-1)) -#define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) - -/* runtime checks */ -#define __X(i, ub) (((unsigned)(long)(i)<(unsigned long)(ub))?i:(__HALT(-2),0)) -#define __XF(i, ub) SYSTEM_XCHK((long)(i), (long)(ub)) -#define __RETCHK __retchk: __HALT(-3) -#define __CASECHK __HALT(-4) -#define __GUARDP(p, typ, level) ((typ*)(__ISP(p,typ,level)?p:(__HALT(-5),p))) -#define __GUARDR(r, typ, level) (*((typ*)(__IS(r##__typ,typ,level)?r:(__HALT(-5),r)))) -#define __GUARDA(p, typ, level) ((struct typ*)(__IS(__TYPEOF(p),typ,level)?p:(__HALT(-5),p))) -#define __GUARDEQR(p, dyntyp, typ) if(dyntyp!=typ##__typ) __HALT(-6);*(p) -#define __GUARDEQP(p, typ) if(__TYPEOF(p)!=typ##__typ)__HALT(-6);*(p) -#define __WITHCHK __HALT(-7) -#define __R(i, ub) (((unsigned)(long)(i)<(unsigned long)(ub))?i:(__HALT(-8),0)) -#define __RF(i, ub) SYSTEM_RCHK((long)(i),(long)(ub)) - -/* record type descriptors */ -#define __TDESC(t, m, n) \ - static struct t##__desc {\ - long tproc[m]; \ - long tag, next, level, module; \ - char name[24]; \ - long *base[__MAXEXT]; \ - char *rsrvd; \ - long blksz, ptr[n+1]; \ - } t##__desc - -#define __BASEOFF (__MAXEXT+1) -#define __TPROC0OFF (__BASEOFF+24/sizeof(long)+5) -#define __EOM 1 -#define __TDFLDS(name, size) {__EOM}, 1, 0, 0, 0, name, {0}, 0, size -#define __ENUMP(adr, n, P) SYSTEM_ENUMP(adr, (long)(n), P) -#define __ENUMR(adr, typ, size, n, P) SYSTEM_ENUMR(adr, typ, (long)(size), (long)(n), P) - -#define __INITYP(t, t0, level) \ - t##__typ= &t##__desc.blksz; \ - memcpy(t##__desc.base, t0##__typ - __BASEOFF, level*sizeof(long)); \ - t##__desc.base[level]=t##__typ; \ - t##__desc.module=(long)m; \ - if(t##__desc.blksz!=sizeof(struct t)) __HALT(-15); \ - t##__desc.blksz=(t##__desc.blksz+5*sizeof(long)-1)/(4*sizeof(long))*(4*sizeof(long)); \ - SYSTEM_REGTYP(m, (long)&t##__desc.next); \ - SYSTEM_INHERIT(t##__typ, t0##__typ) - -/* Oberon-2 type bound procedures support */ -#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(long)proc -#define __SEND(typ, num, funtyp, parlist) ((funtyp)(*(typ-(__TPROC0OFF+num))))parlist - -/* runtime system variables */ -extern LONGINT SYSTEM_argc; -extern LONGINT SYSTEM_argv; -extern void (*SYSTEM_Halt)(); -extern LONGINT SYSTEM_halt; -extern LONGINT SYSTEM_assert; -extern SYSTEM_PTR SYSTEM_modules; -extern LONGINT SYSTEM_heapsize; -extern LONGINT SYSTEM_allocated; -extern LONGINT SYSTEM_lock; -extern SHORTINT SYSTEM_gclock; -extern BOOLEAN SYSTEM_interrupted; - -/* ANSI prototypes; not used so far -static int __STRCMP(CHAR *x, CHAR *y); -void SYSTEM_INIT(int argc, long argvadr); -void SYSTEM_FINI(void); -long SYSTEM_XCHK(long i, long ub); -long SYSTEM_RCHK(long i, long ub); -long SYSTEM_ASH(long i, long n); -long SYSTEM_ABS(long i); -double SYSTEM_ABSD(double i); -void SYSTEM_INHERIT(long *t, long *t0); -void SYSTEM_ENUMP(long *adr, long n, void (*P)(void*)); -void SYSTEM_ENUMR(char *adr, long *typ, long size, long n, void (*P)(void*)); -long SYSTEM_DIV(unsigned long x, unsigned long y); -long SYSTEM_MOD(unsigned long x, unsigned long y); -long SYSTEM_ENTIER(double x); -void SYSTEM_HALT(int n); -*/ - -#endif - diff --git a/src/system/freebsd/clang/x86_64/Unix.Mod b/src/system/freebsd/clang/x86_64/Unix.Mod deleted file mode 100644 index 9d144b41..00000000 --- a/src/system/freebsd/clang/x86_64/Unix.Mod +++ /dev/null @@ -1,557 +0,0 @@ -MODULE Unix; (* Josef Templ, 5.3.90 Linux system calls *) -(* ported to gnu x86_64 and added system function, noch *) -(* Module Unix provides a system call interface to Linux. - Naming conventions: - Procedure and Type-names always start with a capital letter. - error numbers as defined in Unix - other constants start with lower case letters *) - -IMPORT SYSTEM; - -CONST - -(* various important constants *) - - stdin* = 0; stdout* =1; stderr* = 2; - - LOCKEX* = 2; LOCKUN* = 8; (* /usr/include/file.h *) - AFINET* = 2; (* /usr/include/sys/socket.h *) - PFINET* = AFINET; (* /usr/include/linux/socket.h *) - SOCKSTREAM* = 1; (* /usr/include/linux/socket.h *) - FIONREAD* = 541BH; (* in /usr/include/asm/termios.h *) - SETFL* = 4; (* set file descriptor flags; in asm/fcntl.h *) - TCP* = 0; - -(* flag sets, cf. /usr/include/asm/fcntl.h *) - rdonly* = {}; wronly* = {0}; rdwr* = {1}; creat* = {6}; excl* = {7}; trunc* = {9}; append* = {10}; ndelay = {11}; - -(* error numbers *) - - EPERM* = 1; (* Not owner *) - ENOENT* = 2; (* No such file or directory *) - ESRCH* = 3; (* No such process *) - EINTR* = 4; (* Interrupted system call *) - EIO* = 5; (* I/O error *) - ENXIO* = 6; (* No such device or address *) - E2BIG* = 7; (* Arg list too long *) - ENOEXEC* = 8; (* Exec format error *) - EBADF* = 9; (* Bad file number *) - ECHILD* = 10; (* No children *) - EAGAIN* = 11; (* No more processes *) - ENOMEM* = 12; (* Not enough core *) - EACCES* = 13; (* Permission denied *) - EFAULT* = 14; (* Bad address *) - ENOTBLK* = 15; (* Block device required *) - EBUSY* = 16; (* Mount device busy *) - EEXIST* = 17; (* File exists *) - EXDEV* = 18; (* Cross-device link *) - ENODEV* = 19; (* No such device *) - ENOTDIR* = 20; (* Not a directory*) - EISDIR* = 21; (* Is a directory *) - EINVAL* = 22; (* Invalid argument *) - ENFILE* = 23; (* File table overflow *) - EMFILE* = 24; (* Too many open files *) - ENOTTY* = 25; (* Not a typewriter *) - ETXTBSY* = 26; (* Text file busy *) - EFBIG* = 27; (* File too large *) - ENOSPC* = 28; (* No space left on device *) - ESPIPE* = 29; (* Illegal seek *) - EROFS* = 30; (* Read-only file system *) - EMLINK* = 31; (* Too many links *) - EPIPE* = 32; (* Broken pipe *) - EDOM* = 33; (* Argument too large *) - ERANGE* = 34; (* Result too large *) - EDEADLK* = 35; (* Resource deadlock would occur *) - ENAMETOOLONG* = 36; (* File name too long *) - ENOLCK* = 37; (* No record locks available *) - ENOSYS* = 38; (* Function not implemented *) - ENOTEMPTY* = 39; (* Directory not empty *) - ELOOP* = 40; (* Too many symbolic links encountered *) - EWOULDBLOCK* = EAGAIN; (* Operation would block *) - ENOMSG* = 42; (* No message of desired type *) - EIDRM* = 43; (* Identifier removed *) - ECHRNG* = 44; (* Channel number out of range *) - EL2NSYNC* = 45; (* Level 2 not synchronized *) - EL3HLT* = 46; (* Level 3 halted *) - EL3RST* = 47; (* Level 3 reset *) - ELNRNG* = 48; (* Link number out of range *) - EUNATCH* = 49; (* Protocol driver not attached *) - ENOCSI* = 50; (* No CSI structure available *) - EL2HLT* = 51; (* Level 2 halted *) - EBADE* = 52; (* Invalid exchange *) - EBADR* = 53; (* Invalid request descriptor *) - EXFULL* = 54; (* Exchange full *) - ENOANO* = 55; (* No anode *) - EBADRQC* = 56; (* Invalid request code *) - EBADSLT* = 57; (* Invalid slot *) - EDEADLOCK* = 58; (* File locking deadlock error *) - EBFONT* = 59; (* Bad font file format *) - ENOSTR* = 60; (* Device not a stream *) - ENODATA* = 61; (* No data available *) - ETIME* = 62; (* Timer expired *) - ENOSR* = 63; (* Out of streams resources *) - ENONET* = 64; (* Machine is not on the network *) - ENOPKG* = 65; (* Package not installed *) - EREMOTE* = 66; (* Object is remote *) - ENOLINK* = 67; (* Link has been severed *) - EADV* = 68; (* Advertise error *) - ESRMNT* = 69; (* Srmount error *) - ECOMM* = 70; (* Communication error on send *) - EPROTO* = 71; (* Protocol error *) - EMULTIHOP* = 72; (* Multihop attempted *) - EDOTDOT* = 73; (* RFS specific error *) - EBADMSG* = 74; (* Not a data message *) - EOVERFLOW* = 75; (* Value too large for defined data type *) - ENOTUNIQ* = 76; (* Name not unique on network *) - EBADFD* = 77; (* File descriptor in bad state *) - EREMCHG* = 78; (* Remote address changed *) - ELIBACC* = 79; (* Can not access a needed shared library *) - ELIBBAD* = 80; (* Accessing a corrupted shared library *) - ELIBSCN* = 81; (* .lib section in a.out corrupted *) - ELIBMAX* = 82; (* Attempting to link in too many shared libraries *) - ELIBEXEC* = 83; (* Cannot exec a shared library directly *) - EILSEQ* = 84; (* Illegal byte sequence *) - ERESTART* = 85; (* Interrupted system call should be restarted *) - ESTRPIPE* = 86; (* Streams pipe error *) - EUSERS* = 87; (* Too many users *) - ENOTSOCK* = 88; (* Socket operation on non-socket *) - EDESTADDRREQ* = 89; (* Destination address required *) - EMSGSIZE* = 90; (* Message too long *) - EPROTOTYPE* = 91; (* Protocol wrong type for socket *) - ENOPROTOOPT* = 92; (* Protocol not available *) - EPROTONOSUPPORT* = 93; (* Protocol not supported *) - ESOCKTNOSUPPORT* = 94; (* Socket type not supported *) - EOPNOTSUPP* = 95; (* Operation not supported on transport endpoint *) - EPFNOSUPPORT* = 96; (* Protocol family not supported *) - EAFNOSUPPORT* = 97; (* Address family not supported by protocol *) - EADDRINUSE* = 98; (* Address already in use *) - EADDRNOTAVAIL* = 99; (* Cannot assign requested address *) - ENETDOWN* = 100; (* Network is down *) - ENETUNREACH* = 101; (* Network is unreachable *) - ENETRESET* = 102; (* Network dropped connection because of reset *) - ECONNABORTED* = 103; (* Software caused connection abort *) - ECONNRESET* = 104; (* Connection reset by peer *) - ENOBUFS* = 105; (* No buffer space available *) - EISCONN* = 106; (* Transport endpoint is already connected *) - ENOTCONN* = 107; (* Transport endpoint is not connected *) - ESHUTDOWN* = 108; (* Cannot send after transport endpoint shutdown *) - ETOOMANYREFS* = 109; (* Too many references: cannot splice *) - ETIMEDOUT* = 110; (* Connection timed out *) - ECONNREFUSED* = 111; (* Connection refused *) - EHOSTDOWN* = 112; (* Host is down *) - EHOSTUNREACH* = 113; (* No route to host *) - EALREADY* = 114; (* Operation already in progress *) - EINPROGRESS* = 115; (* Operation now in progress *) - ESTALE* = 116; (* Stale NFS file handle *) - EUCLEAN* = 117; (* Structure needs cleaning *) - ENOTNAM* = 118; (* Not a XENIX named type file *) - ENAVAIL* = 119; (* No XENIX semaphores available *) - EISNAM* = 120; (* Is a named type file *) - EREMOTEIO* = 121; (* Remote I/O error *) - EDQUOT* = 122; (* Quota exceeded *) - -CONST sigsetarrlength = 1024 / 8 * SIZE(LONGINT); - - -TYPE - - JmpBuf* = RECORD - jmpbuf: ARRAY 12 OF LONGINT; - END ; -(* -from output of cpp /usr/include/sys/stat.h - -struct stat { - __dev_t st_dev; - ino_t st_ino; - mode_t st_mode; - nlink_t st_nlink; - uid_t st_uid; - gid_t st_gid; - __dev_t st_rdev; - struct timespec st_atim; - struct timespec st_mtim; - struct timespec st_ctim; - off_t st_size; - blkcnt_t st_blocks; - blksize_t st_blksize; - fflags_t st_flags; - __uint32_t st_gen; - __int32_t st_lspare; - struct timespec st_birthtim; -# 148 "/usr/include/sys/stat.h" - unsigned int :(8 / 2) * (16 - (int)sizeof(struct timespec)); - unsigned int :(8 / 2) * (16 - (int)sizeof(struct timespec)); -}; - -sizes on freebsd 64 bit -short int 2 -int 4 -long 8 -long int 8 -size_t 8 -dev_t 4 -ino_t 4 -mode_t 2 -nlink_t 2 -uid_t 4 -gid_t 4 -off_t 8 -blksize_t 4 -blkcnt_t 8 -time_t 8 -fflags_t 4 -__uint32_t 4 -__int32_t 4 -*) - Status* = RECORD (* struct stat *) - dev* : INTEGER; (* dev_t 4 *) - ino* : INTEGER; (* ino_t 4 *) - mode*: SHORTINT; mode1*: SHORTINT; (* mode_t 2 *) - nlink* : SHORTINT; nlink1*: SHORTINT; (* nlink_t 2 *) - uid*, gid*: INTEGER; (* uid_t, gid_t 4 *) - rdev*: INTEGER; (* dev_t 4 *) - atime* : LONGINT; atimences* : LONGINT; (* struct timespec 16 *) - mtime* : LONGINT; mtimences* : LONGINT; (* struct timespec 16 *) - ctime* : LONGINT; ctimences* : LONGINT; (* struct timespec 16 *) - size*: LONGINT; (* off_t 8 *) - blocks* : LONGINT; - blksize* : INTEGER; - flags* : INTEGER; - gen* : INTEGER; - lspare* : INTEGER; - birthtime* : LONGINT; birthtimences* : LONGINT; (* struct timespec 16 *) - END ; - - -(* from /usr/include/bits/time.h - -struct timeval - { - __time_t tv_sec; /* Seconds. */ //__time_t 8 - __suseconds_t tv_usec; /* Microseconds. */ __suseconds_t 8 - }; - - -*) - - Timeval* = RECORD - sec*, usec*: LONGINT - END ; - - -(* -from man gettimeofday - - struct timezone { - int tz_minuteswest; /* minutes west of Greenwich */ int 4 - int tz_dsttime; /* type of DST correction */ int 4 - }; -*) - - - Timezone* = RECORD - (*minuteswest*, dsttime*: LONGINT*) - minuteswest*, dsttime*: INTEGER - END ; - - Itimerval* = RECORD - interval*, value*: Timeval - END ; - - FdSet* = ARRAY 8 OF SET; - - SigCtxPtr* = POINTER TO SigContext; - SigContext* = RECORD - END ; - - SignalHandler* = PROCEDURE (sig, code: LONGINT; scp: SigCtxPtr); - - Dirent* = RECORD - ino, off: LONGINT; - reclen: INTEGER; - name: ARRAY 256 OF CHAR; - END ; - - Rusage* = RECORD - utime*, stime*: Timeval; - maxrss*, ixrss*, idrss*, isrss*, - minflt*, majflt*, nswap*, inblock*, - oublock*, msgsnd*, msgrcv*, nsignals*, - nvcsw*, nivcsw*: LONGINT - END ; - - Iovec* = RECORD - base*, len*: LONGINT - END ; - - SocketPair* = ARRAY 2 OF LONGINT; - - Pollfd* = RECORD - fd*: LONGINT; - events*, revents*: INTEGER - END ; - - Sockaddr* = RECORD - family*: INTEGER; - port*: INTEGER; - internetAddr*: LONGINT; - pad*: ARRAY 8 OF CHAR; - END ; - - HostEntry* = POINTER [1] TO Hostent; - Hostent* = RECORD - name*, aliases*: LONGINT; - addrtype*, length*: LONGINT; - addrlist*: LONGINT; (*POINTER TO POINTER TO LONGINT, network byte order*) - END; - - Name* = ARRAY OF CHAR; - - PROCEDURE -includeStat() - "#include "; - - (* for select() *) - PROCEDURE -includeSelect() - "#include "; - - (* for kill() *) - PROCEDURE -includeSignal() - "#include "; - - (* for read() also *) - PROCEDURE -includeTypes() - "#include "; - - PROCEDURE -includeUio() - "#include "; - - (* for getpid(), lseek(), close(), fsync(), ftruncate(), read(), sleep() *) - PROCEDURE -includeUnistd() - "#include "; - - - (* for rename() *) - PROCEDURE -includeStdio() - "#include "; - - PROCEDURE -includeErrno() - "#include "; - - (* for open() *) - PROCEDURE -includeFcntl() - "#include "; - - PROCEDURE -err(): INTEGER - "errno"; - - PROCEDURE errno*(): INTEGER; - BEGIN - RETURN err() - END errno; - - PROCEDURE -Exit*(n: INTEGER) - "exit(n)"; - - PROCEDURE -Fork*(): INTEGER - "fork()"; - - PROCEDURE -Wait*(VAR status: INTEGER): INTEGER - "wait(status)"; - - PROCEDURE -Select*(width: INTEGER; VAR readfds, writefds, exceptfds: FdSet; VAR timeout: Timeval): INTEGER - "select(width, readfds, writefds, exceptfds, timeout)"; - - PROCEDURE -Gettimeofday* (VAR tv: Timeval; VAR tz: Timezone) : INTEGER - "gettimeofday(tv, tz)"; - - PROCEDURE -Read* (fd: INTEGER; buf, nbyte: LONGINT): LONGINT - "read(fd, buf, nbyte)"; - - PROCEDURE -ReadBlk* (fd: INTEGER; VAR buf: ARRAY OF SYSTEM.BYTE): LONGINT - "read(fd, buf, buf__len)"; - - PROCEDURE -Write* (fd: INTEGER; buf, nbyte: LONGINT): LONGINT - "write(fd, buf, nbyte)"; - - PROCEDURE -WriteBlk* (fd: INTEGER; VAR buf: ARRAY OF SYSTEM.BYTE): LONGINT - "write(fd, buf, buf__len)"; - - PROCEDURE -Dup*(fd: INTEGER): INTEGER - "dup(fd)"; - - PROCEDURE -Dup2*(fd1, fd2: INTEGER): INTEGER - "dup(fd1, fd2)"; - - PROCEDURE -Pipe*(fds : LONGINT): INTEGER - "pipe(fds)"; - - PROCEDURE -Getpid*(): INTEGER - "getpid()"; - - PROCEDURE -Getuid*(): INTEGER - "getuid()"; - - PROCEDURE -Geteuid*(): INTEGER - "geteuid()"; - - PROCEDURE -Getgid*(): INTEGER - "getgid()"; - - PROCEDURE -Getegid*(): INTEGER - "getegid()"; - - PROCEDURE -Unlink*(name: Name): INTEGER - "unlink(name)"; - - PROCEDURE -Open*(name: Name; flag: INTEGER; mode: LONGINT): INTEGER - "open(name, flag, mode)"; - - PROCEDURE -Close*(fd: INTEGER): INTEGER - "close(fd)"; - - PROCEDURE -stat(name: Name; VAR statbuf: Status): INTEGER - "stat((const char*)name, (struct stat*)statbuf)"; - - PROCEDURE Stat*(name: Name; VAR statbuf: Status): INTEGER; - VAR res: INTEGER; - BEGIN - res := stat(name, statbuf); - (* make the first 4 bytes as unique as possible (used in module Files for caching!) *) - (* don't understand this - INC(statbuf.dev, statbuf.devX); - INC(statbuf.rdev, statbuf.rdevX); *) - RETURN res; - END Stat; - - PROCEDURE -fstat(fd: INTEGER; VAR statbuf: Status): INTEGER - "fstat(fd, (struct stat*)statbuf)"; - - PROCEDURE Fstat*(fd: INTEGER; VAR statbuf: Status): INTEGER; - VAR res: INTEGER; - BEGIN - res := fstat(fd, statbuf); - (* make the first 4 bytes as unique as possible (used in module Files for caching!) *) - (*INC(statbuf.dev, statbuf.devX); - INC(statbuf.rdev, statbuf.rdevX); *) - RETURN res; - END Fstat; - - PROCEDURE -Fchmod*(fd, mode: INTEGER): INTEGER - "fchmod(fd, mode)"; - - PROCEDURE -Chmod*(path: Name; mode: INTEGER): INTEGER - "chmod(path, mode)"; - - PROCEDURE -Lseek*(fd: INTEGER; offset: LONGINT; origin: INTEGER): LONGINT - "lseek(fd, offset, origin)"; - - PROCEDURE -Fsync*(fd: INTEGER): INTEGER - "fsync(fd)"; - - PROCEDURE -Fcntl*(fd: INTEGER; cmd: INTEGER; arg: LONGINT ): INTEGER - "fcntl(fd, cmd, arg)"; - - PROCEDURE -Flock*(fd, operation: INTEGER): INTEGER - "flock(fd, operation)"; - - PROCEDURE -Ftruncate*(fd: INTEGER; length: LONGINT): INTEGER - "ftruncate(fd, length)"; - - PROCEDURE -Readblk*(fd: INTEGER; VAR buf: ARRAY OF SYSTEM.BYTE; len: LONGINT): LONGINT - "read(fd, buf, len)"; - - PROCEDURE -Rename*(old, new: Name): INTEGER - "rename(old, new)"; - - PROCEDURE -Chdir*(path: Name): INTEGER - "chdir(path)"; - - PROCEDURE -Ioctl*(fd: INTEGER; request, arg: LONGINT): LONGINT - "ioctl(fd, request, arg)"; - - PROCEDURE -Kill*(pid, sig: INTEGER): INTEGER - "kill(pid, sig)"; - - PROCEDURE -Sigsetmask*(mask: INTEGER): INTEGER - "sigsetmask(mask)"; - - PROCEDURE -Sleep*(ms : INTEGER): INTEGER - "sleep(ms)"; - - PROCEDURE -Nanosleep*(VAR req : Timeval; VAR rem : Timeval): INTEGER - "nanosleep(req, rem)"; - - (* TCP/IP networking *) - - PROCEDURE -Gethostbyname*(name: Name): HostEntry - "(Unix_HostEntry)gethostbyname(name)"; - - PROCEDURE -Gethostname*(VAR name: Name): INTEGER - "gethostname(name, name__len)"; - - PROCEDURE -Socket*(af, type, protocol: INTEGER): INTEGER - "socket(af, type, protocol)"; - - PROCEDURE -Connect*(socket: INTEGER; name: Sockaddr; namelen: INTEGER): INTEGER - "connect(socket, &(name), namelen)"; - - PROCEDURE -Getsockname*(socket: INTEGER; VAR name: Sockaddr; VAR namelen: INTEGER): INTEGER - "getsockname(socket, name, namelen)"; - - PROCEDURE -Bind*(socket: INTEGER; name: Sockaddr; namelen: INTEGER): INTEGER - "bind(socket, &(name), namelen)"; - - PROCEDURE -Listen*(socket, backlog: INTEGER): INTEGER - "listen(socket, backlog)"; - - PROCEDURE -Accept*(socket: INTEGER; VAR addr: Sockaddr; VAR addrlen: INTEGER): LONGINT - "accept(socket, addr, addrlen)"; - - PROCEDURE -Recv*(socket: INTEGER; bufadr, buflen: LONGINT; flags: INTEGER): LONGINT - "recv(socket, bufadr, buflen, flags)"; - - PROCEDURE -Send*(socket: INTEGER; bufadr, buflen: LONGINT; flags: INTEGER): LONGINT - "send(socket, bufadr, buflen, flags)"; - - PROCEDURE -sys(str: ARRAY OF CHAR): INTEGER (* need this to call external tools like gcc or gas; noch *) - "system(str)"; - - PROCEDURE system*(cmd : ARRAY OF CHAR); - VAR r : INTEGER; - BEGIN - r := sys(cmd); - END system; - - PROCEDURE System*(cmd : ARRAY OF CHAR): INTEGER; - VAR r : INTEGER; - BEGIN - r := sys(cmd); - RETURN r - END System; - - PROCEDURE -SizeofUnixStat(): INTEGER - "sizeof(Unix_Status)"; - - PROCEDURE -SizeofStat(): INTEGER - "sizeof(struct stat)"; - - PROCEDURE -Error(msg: ARRAY OF CHAR; len: INTEGER) - "write(1/*stdout*/, msg, len); char ch = 0xa; write(1, &ch, 1)"; - - PROCEDURE StatCheck; - VAR x, y: LONGINT; - BEGIN - x := SizeofUnixStat(); - y := SizeofStat(); - IF x # y THEN - Error("Unix.StatCheck: inconsistent usage of struct stat", 49); - Exit(1); - END - END StatCheck; - -BEGIN - - StatCheck(); - -END Unix. diff --git a/src/system/linux/clang/Kernel.Mod b/src/system/linux/clang/Kernel.Mod deleted file mode 100644 index 4fa025ab..00000000 --- a/src/system/linux/clang/Kernel.Mod +++ /dev/null @@ -1,188 +0,0 @@ -MODULE Kernel; -(* - J. Templ, 16.4.95 - communication with C-runtime and storage management -*) - - IMPORT SYSTEM, Unix, Args; - - TYPE - RealTime = POINTER TO TimeDesc; - TimeDesc = RECORD - sec, min, hour, mday, mon, year, wday, isdst, zone, gmtoff: LONGINT - END ; - - KeyCmd* = PROCEDURE; - - ObjFinalizer* = PROCEDURE(obj: SYSTEM.PTR); - - - VAR - (* trap handling *) - trapEnv*: Unix.JmpBuf; (* saved stack environment for trap handling *) - - (* oberon heap management *) - nofiles*: LONGINT; - - (* input event handling *) - readSet*, readySet*: Unix.FdSet; - - FKey*: ARRAY 16 OF KeyCmd; - - littleEndian*: BOOLEAN; - - TimeUnit*: LONGINT; (* 1 sec *) - - LIB*, CWD*: ARRAY 256 OF CHAR; - OBERON*: ARRAY 1024 OF CHAR; - - - timeStart: LONGINT; (* milliseconds *) - - PROCEDURE -includesetjmp() - '#include "setjmp.h"'; -(* for localtime *) - PROCEDURE -includetime() - '#include "time.h"'; - - PROCEDURE -Lock*() - "SYSTEM_lock++"; - - PROCEDURE -Unlock*() - "SYSTEM_lock--; if (SYSTEM_interrupted && SYSTEM_lock == 0) __HALT(-9)"; - - PROCEDURE -Exit*(n: LONGINT) - "exit(n)"; - - PROCEDURE -sigsetjmp*(VAR env: Unix.JmpBuf; savemask: LONGINT): LONGINT - "__sigsetjmp(env, savemask)"; - - PROCEDURE -siglongjmp*(VAR env:Unix.JmpBuf; val: LONGINT) - "siglongjmp(env, val)"; - - PROCEDURE -heapsize*(): LONGINT - "SYSTEM_heapsize"; - - PROCEDURE -allocated*(): LONGINT - "SYSTEM_allocated"; - - PROCEDURE -localtime(VAR clock: LONGINT): RealTime - "(Kernel_RealTime)localtime(clock)"; - - PROCEDURE -malloc*(size: LONGINT): LONGINT - "(LONGINT)malloc(size)"; - - PROCEDURE -free*(adr: LONGINT) - "(void)free(adr)"; - - PROCEDURE -getcwd(VAR cwd: Unix.Name) - "getcwd(cwd, cwd__len)"; - - - PROCEDURE GetClock* (VAR t, d: LONGINT); - VAR tv: Unix.Timeval; tz: Unix.Timezone; time: RealTime; - l : LONGINT; - BEGIN - l := Unix.Gettimeofday(tv, tz); - time := localtime(tv.sec); - t := time.sec + ASH(time.min, 6) + ASH(time.hour, 12); - d := time.mday + ASH(time.mon+1, 5) + ASH(time.year MOD 100, 9); - END GetClock; - - PROCEDURE SetClock* (t, d: LONGINT); - VAR err: ARRAY 25 OF CHAR; - BEGIN err := "not yet implemented"; HALT(99) - END SetClock; - - PROCEDURE Time*(): LONGINT; - VAR timeval: Unix.Timeval; timezone: Unix.Timezone; - l : LONGINT; - BEGIN - l := Unix.Gettimeofday(timeval, timezone); - RETURN (timeval.usec DIV 1000 + timeval.sec * 1000 - timeStart) MOD 7FFFFFFFH - END Time; - -(* - PROCEDURE UserTime*(): LONGINT; - VAR rusage: Unix.Rusage; - BEGIN - Unix.Getrusage(0, S.ADR(rusage)); - RETURN rusage.utime.sec*1000 + rusage.utime.usec DIV 1000 - (* + rusage.stime.sec*1000 + rusage.stime.usec DIV 1000*) - END UserTime; -*) - - PROCEDURE Select*(delay: LONGINT); - VAR rs, ws, xs: Unix.FdSet; n: LONGINT; tv: Unix.Timeval; - BEGIN - rs := readSet; - FOR n := 0 TO 7 DO ws[n] := {}; xs[n] := {}; readySet[n] := {} END; - IF delay < 0 THEN delay := 0 END ; - tv.sec := delay DIV 1000; tv.usec := delay MOD 1000 * 1000; - n := Unix.Select(256, rs, ws, xs, tv); - IF n >= 0 THEN readySet := rs END - END Select; - - PROCEDURE -GC*(markStack: BOOLEAN) - "SYSTEM_GC(markStack)"; - - PROCEDURE -RegisterObject*(obj: SYSTEM.PTR; finalize: ObjFinalizer) - "SYSTEM_REGFIN(obj, finalize)"; - - PROCEDURE -SetHalt*(p: PROCEDURE(n: LONGINT)) - "SYSTEM_Halt = p"; - - PROCEDURE InstallTermHandler*(p: PROCEDURE); - (* not yet supported; no Modules.Free *) - END InstallTermHandler; - - PROCEDURE LargestAvailable*(): LONGINT; - BEGIN - (* dummy proc for System 3 compatibility - no meaningful value except may be the remaining swap space can be returned - in the context of an extensible heap *) - RETURN MAX(LONGINT) - END LargestAvailable; - - PROCEDURE Halt(n: LONGINT); - VAR res: LONGINT; - BEGIN res := Unix.Kill(Unix.Getpid(), 4); - END Halt; - - PROCEDURE EndianTest; - VAR i: LONGINT; dmy: INTEGER; - BEGIN - dmy := 1; i := SYSTEM.ADR(dmy); - SYSTEM.GET(i, littleEndian); (* indirection via i avoids warning on SUN cc -O *) - END EndianTest; - - PROCEDURE -SizeofUnixJmpBuf(): INTEGER - "sizeof(Unix_JmpBuf)"; - - PROCEDURE -SizeofSigJmpBuf(): INTEGER - "sizeof(sigjmp_buf)"; - - PROCEDURE -Error(msg: ARRAY OF CHAR; len: INTEGER) - "write(1/*stdout*/, msg, len); char ch = 0xa; write(1, &ch, 1)"; - - PROCEDURE JmpBufCheck; (* check for inconsistent usage of sigjmp_buf *) - VAR x, y: LONGINT; - BEGIN - x := SizeofUnixJmpBuf(); - y := SizeofSigJmpBuf(); - IF x < y THEN - Error("Kernel.JmpBufCheck: inconsistent usage of sigjmp_buf", 52); - Exit(1); - END - END JmpBufCheck; - -BEGIN - EndianTest(); - SetHalt(Halt); - CWD := ""; OBERON := "."; LIB := ""; - getcwd(CWD); - Args.GetEnv("OBERON", OBERON); - Args.GetEnv("OBERON_LIB", LIB); - TimeUnit := 1000; timeStart := 0; timeStart := Time(); - JmpBufCheck() -END Kernel. diff --git a/src/system/linux/clang/Kernel0.Mod b/src/system/linux/clang/Kernel0.Mod deleted file mode 100644 index 6a58650f..00000000 --- a/src/system/linux/clang/Kernel0.Mod +++ /dev/null @@ -1,200 +0,0 @@ -MODULE Kernel0; -(* - J. Templ, 16.4.95 - communication with C-runtime and storage management -*) -(* version for bootstrapping voc *) - - IMPORT SYSTEM, Unix, Args, Strings, version; - - TYPE - RealTime = POINTER TO TimeDesc; - TimeDesc = RECORD - sec, min, hour, mday, mon, year, wday, isdst, zone, gmtoff: LONGINT -(* sec, min, hour, mday, mon, year, wday, isdst, zone, gmtoff: INTEGER*) - END ; - - KeyCmd* = PROCEDURE; - - ObjFinalizer* = PROCEDURE(obj: SYSTEM.PTR); - - - VAR - (* trap handling *) - trapEnv*: Unix.JmpBuf; (* saved stack environment for trap handling *) - - (* oberon heap management *) - nofiles*: LONGINT; - - (* input event handling *) - readSet*, readySet*: Unix.FdSet; - - FKey*: ARRAY 16 OF KeyCmd; - - littleEndian*: BOOLEAN; - - TimeUnit*: LONGINT; (* 1 sec *) - - LIB*, CWD*: ARRAY 256 OF CHAR; - OBERON*: ARRAY 1024 OF CHAR; - MODULES-: ARRAY 1024 OF CHAR; - - prefix*, fullprefix* : ARRAY 256 OF CHAR; - timeStart: LONGINT; (* milliseconds *) - - - PROCEDURE -includesetjmp() - '#include "setjmp.h"'; -(* for localtime *) - PROCEDURE -includetime() - '#include "time.h"'; - - PROCEDURE -Lock*() - "SYSTEM_lock++"; - - PROCEDURE -Unlock*() - "SYSTEM_lock--; if (SYSTEM_interrupted && SYSTEM_lock == 0) __HALT(-9)"; - - PROCEDURE -Exit*(n: LONGINT) - "exit(n)"; - - PROCEDURE -sigsetjmp*(VAR env: Unix.JmpBuf; savemask: LONGINT): LONGINT - "__sigsetjmp(env, savemask)"; - - PROCEDURE -siglongjmp*(VAR env:Unix.JmpBuf; val: LONGINT) - "siglongjmp(env, val)"; - - PROCEDURE -heapsize*(): LONGINT - "SYSTEM_heapsize"; - - PROCEDURE -allocated*(): LONGINT - "SYSTEM_allocated"; - - PROCEDURE -localtime(VAR clock: LONGINT): RealTime - "(Kernel0_RealTime)localtime(clock)"; - - PROCEDURE -malloc*(size: LONGINT): LONGINT - "(LONGINT)malloc(size)"; - - PROCEDURE -free*(adr: LONGINT) - "(void)free(adr)"; - - PROCEDURE -getcwd(VAR cwd: Unix.Name) - "getcwd(cwd, cwd__len)"; - - - PROCEDURE GetClock* (VAR t, d: LONGINT); - VAR tv: Unix.Timeval; tz: Unix.Timezone; time: RealTime; - l : LONGINT; - BEGIN - l := Unix.Gettimeofday(tv, tz); - time := localtime(tv.sec); - t := time.sec + ASH(time.min, 6) + ASH(time.hour, 12); - d := time.mday + ASH(time.mon+1, 5) + ASH(time.year MOD 100, 9); - END GetClock; - - PROCEDURE SetClock* (t, d: LONGINT); - VAR err: ARRAY 25 OF CHAR; - BEGIN err := "not yet implemented"; HALT(99) - END SetClock; - - PROCEDURE Time*(): LONGINT; - VAR timeval: Unix.Timeval; timezone: Unix.Timezone; - l : LONGINT; - BEGIN - l := Unix.Gettimeofday(timeval, timezone); - RETURN (timeval.usec DIV 1000 + timeval.sec * 1000 - timeStart) MOD 7FFFFFFFH - END Time; - -(* - PROCEDURE UserTime*(): LONGINT; - VAR rusage: Unix.Rusage; - BEGIN - Unix.Getrusage(0, S.ADR(rusage)); - RETURN rusage.utime.sec*1000 + rusage.utime.usec DIV 1000 - (* + rusage.stime.sec*1000 + rusage.stime.usec DIV 1000*) - END UserTime; -*) - - PROCEDURE Select*(delay: LONGINT); - VAR rs, ws, xs: Unix.FdSet; n: LONGINT; tv: Unix.Timeval; - BEGIN - rs := readSet; - FOR n := 0 TO 7 DO ws[n] := {}; xs[n] := {}; readySet[n] := {} END; - IF delay < 0 THEN delay := 0 END ; - tv.sec := delay DIV 1000; tv.usec := delay MOD 1000 * 1000; - n := Unix.Select(256, rs, ws, xs, tv); - IF n >= 0 THEN readySet := rs END - END Select; - - PROCEDURE -GC*(markStack: BOOLEAN) - "SYSTEM_GC(markStack)"; - - PROCEDURE -RegisterObject*(obj: SYSTEM.PTR; finalize: ObjFinalizer) - "SYSTEM_REGFIN(obj, finalize)"; - - PROCEDURE -SetHalt*(p: PROCEDURE(n: LONGINT)) - "SYSTEM_Halt = p"; - - PROCEDURE InstallTermHandler*(p: PROCEDURE); - (* not yet supported; no Modules.Free *) - END InstallTermHandler; - - PROCEDURE LargestAvailable*(): LONGINT; - BEGIN - (* dummy proc for System 3 compatibility - no meaningful value except may be the remaining swap space can be returned - in the context of an extensible heap *) - RETURN MAX(LONGINT) - END LargestAvailable; - - PROCEDURE Halt(n: LONGINT); - VAR res: LONGINT; - BEGIN res := Unix.Kill(Unix.Getpid(), 4); - END Halt; - - PROCEDURE EndianTest; - VAR i: LONGINT; dmy: INTEGER; - BEGIN - dmy := 1; i := SYSTEM.ADR(dmy); - SYSTEM.GET(i, littleEndian); (* indirection via i avoids warning on SUN cc -O *) - END EndianTest; - - PROCEDURE -SizeofUnixJmpBuf(): INTEGER - "sizeof(Unix_JmpBuf)"; - - PROCEDURE -SizeofSigJmpBuf(): INTEGER - "sizeof(sigjmp_buf)"; - - PROCEDURE -Error(msg: ARRAY OF CHAR; len: INTEGER) - "write(1/*stdout*/, msg, len); char ch = 0xa; write(1, &ch, 1)"; - - PROCEDURE JmpBufCheck; (* check for inconsistent usage of sigjmp_buf *) - VAR x, y: LONGINT; - BEGIN - x := SizeofUnixJmpBuf(); - y := SizeofSigJmpBuf(); - IF x < y THEN - Error("Kernel.JmpBufCheck: inconsistent usage of sigjmp_buf", 52); - Exit(1); - END - END JmpBufCheck; - -BEGIN - EndianTest(); - SetHalt(Halt); - CWD := ""; OBERON := "."; LIB := ""; - MODULES := ""; (* additional modules path which can be specified on commandline and will be added to the OBERON variable; noch *) - getcwd(CWD); - Args.GetEnv ("MODULES", MODULES); - Args.GetEnv("OBERON", OBERON); - (* always have current directory in module search path, noch *) - Strings.Append(":.:", OBERON); - Strings.Append(MODULES, OBERON); - Strings.Append(":", OBERON); - Strings.Append(version.prefix, OBERON); - Strings.Append("/lib/voc/sym:", OBERON); - Args.GetEnv("OBERON_LIB", LIB); - TimeUnit := 1000; timeStart := 0; timeStart := Time(); - JmpBufCheck() -END Kernel0. diff --git a/src/system/linux/clang/SYSTEM.Mod b/src/system/linux/clang/SYSTEM.Mod deleted file mode 100644 index 6fc08dcf..00000000 --- a/src/system/linux/clang/SYSTEM.Mod +++ /dev/null @@ -1,520 +0,0 @@ -(* -* voc (jet backend) runtime system, Version 1.1 -* -* Copyright (c) Software Templ, 1994, 1995, 1996 -* -* Module SYSTEM is subject to change any time without prior notification. -* Software Templ disclaims all warranties with regard to module SYSTEM, -* in particular shall Software Templ not be liable for any damage resulting -* from inappropriate use or modification of module SYSTEM. -*) - -MODULE SYSTEM; (* J. Templ, 31.5.95 *) - - IMPORT SYSTEM; (*must not import other modules*) - - CONST - ModNameLen = 20; - CmdNameLen = 24; - SZL = SIZE(LONGINT); - Unit = 4*SZL; (* smallest possible heap block *) - nofLists = 9; (* number of free_lists *) - heapSize0 = 8000*Unit; (* startup heap size *) - - (* all blocks look the same: - free blocks describe themselves: size = Unit - tag = &tag++ - ->blksize - sentinel = -SZL - next - *) - - (* heap chunks *) - nextChnkOff = 0; (* next heap chunk, sorted ascendingly! *) - endOff = SZL; (* end of heap chunk *) - blkOff = 3*SZL; (* first block in a chunk *) - - (* heap blocks *) - tagOff = 0; (* block starts with tag *) - sizeOff = SZL; (* block size in free block relative to block start *) - sntlOff = 2*SZL; (* pointer offset table sentinel in free block relative to block start *) - nextOff = 3*SZL; (* next pointer in free block relative to block start *) - NoPtrSntl = LONG(LONG(-SZL)); - - - TYPE - ModuleName = ARRAY ModNameLen OF CHAR; - CmdName = ARRAY CmdNameLen OF CHAR; - - Module = POINTER TO ModuleDesc; - Cmd = POINTER TO CmdDesc; - EnumProc = PROCEDURE(P: PROCEDURE(p: SYSTEM.PTR)); - ModuleDesc = RECORD - next: Module; - name: ModuleName; - refcnt: LONGINT; - cmds: Cmd; - types: LONGINT; - enumPtrs: EnumProc; - reserved1, reserved2: LONGINT - END ; - - Command = PROCEDURE; - - CmdDesc = RECORD - next: Cmd; - name: CmdName; - cmd: Command - END ; - - Finalizer = PROCEDURE(obj: SYSTEM.PTR); - - FinNode = POINTER TO FinDesc; - FinDesc = RECORD - next: FinNode; - obj: LONGINT; (* weak pointer *) - marked: BOOLEAN; - finalize: Finalizer; - END ; - - VAR - (* the list of loaded (=initialization started) modules *) - modules*: SYSTEM.PTR; - - freeList: ARRAY nofLists + 1 OF LONGINT; (* dummy, 16, 32, 48, 64, 80, 96, 112, 128, sentinel *) - bigBlocks, allocated*: LONGINT; - firstTry: BOOLEAN; - - (* extensible heap *) - heap, (* the sorted list of heap chunks *) - heapend, (* max possible pointer value (used for stack collection) *) - heapsize*: LONGINT; (* the sum of all heap chunk sizes *) - - (* finalization candidates *) - fin: FinNode; - - (* garbage collector locking *) - gclock*: SHORTINT; - - - PROCEDURE -malloc(size: LONGINT): LONGINT "(LONGINT)malloc(size)"; - PROCEDURE -Lock() "Lock"; - PROCEDURE -Unlock() "Unlock"; - PROCEDURE -Mainfrm(): LONGINT "SYSTEM_mainfrm"; -(* - PROCEDURE TAS*(VAR flag:BOOLEAN): BOOLEAN; (* added for compatibility with ulmSYSTEM module; noch *) - VAR oldflag : BOOLEAN; - BEGIN - oldflag := flag; - flag := TRUE; - RETURN oldflag; - END TAS; -*) - PROCEDURE REGMOD*(VAR name: ModuleName; enumPtrs: EnumProc): SYSTEM.PTR; - VAR m: Module; - BEGIN - IF name = "SYSTEM" THEN (* cannot use NEW *) - SYSTEM.NEW(m, SIZE(ModuleDesc)); m.cmds := NIL - ELSE NEW(m) - END ; - COPY(name, m.name); m.refcnt := 0; m.enumPtrs := enumPtrs; m.next := SYSTEM.VAL(Module, modules); - modules := m; - RETURN m - END REGMOD; - - PROCEDURE REGCMD*(m: Module; VAR name: CmdName; cmd: Command); - VAR c: Cmd; - BEGIN NEW(c); - COPY(name, c.name); c.cmd := cmd; c.next := m.cmds; m.cmds := c - END REGCMD; - - PROCEDURE REGTYP*(m: Module; typ: LONGINT); - BEGIN SYSTEM.PUT(typ, m.types); m.types := typ - END REGTYP; - - PROCEDURE INCREF*(m: Module); - BEGIN INC(m.refcnt) - END INCREF; - - PROCEDURE NewChunk(blksz: LONGINT): LONGINT; - VAR chnk: LONGINT; - BEGIN - chnk := malloc(blksz + blkOff); - IF chnk # 0 THEN - SYSTEM.PUT(chnk + endOff, chnk + (blkOff + blksz)); - SYSTEM.PUT(chnk + blkOff, chnk + (blkOff + sizeOff)); - SYSTEM.PUT(chnk + (blkOff + sizeOff), blksz); - SYSTEM.PUT(chnk + (blkOff + sntlOff), NoPtrSntl); - SYSTEM.PUT(chnk + (blkOff + nextOff), bigBlocks); - bigBlocks := chnk + blkOff; - INC(heapsize, blksz) - END ; - RETURN chnk - END NewChunk; - - PROCEDURE ExtendHeap(blksz: LONGINT); - VAR size, chnk, j, next: LONGINT; - BEGIN - IF blksz > 10000*Unit THEN size := blksz - ELSE size := 10000*Unit (* additional heuristics *) - END ; - chnk := NewChunk(size); - IF chnk # 0 THEN - (*sorted insertion*) - IF chnk < heap THEN - SYSTEM.PUT(chnk, heap); heap := chnk - ELSE - j := heap; SYSTEM.GET(j, next); - WHILE (next # 0) & (chnk > next) DO j := next; SYSTEM.GET(j, next) END ; - SYSTEM.PUT(chnk, next); SYSTEM.PUT(j, chnk) - END ; - IF next = 0 THEN SYSTEM.GET(chnk + endOff, heapend) END - END - END ExtendHeap; - - PROCEDURE ^GC*(markStack: BOOLEAN); - - PROCEDURE NEWREC*(tag: LONGINT): SYSTEM.PTR; - VAR i, i0, di, blksz, restsize, t, adr, end, next, prev: LONGINT; new: SYSTEM.PTR; - BEGIN - Lock(); - SYSTEM.GET(tag, blksz); - ASSERT(blksz MOD Unit = 0); - i0 := blksz DIV Unit; i := i0; - IF i < nofLists THEN adr := freeList[i]; - WHILE adr = 0 DO INC(i); adr := freeList[i] END - END ; - IF i < nofLists THEN (* unlink *) - SYSTEM.GET(adr + nextOff, next); - freeList[i] := next; - IF i # i0 THEN (* split *) - di := i - i0; restsize := di * Unit; end := adr + restsize; - SYSTEM.PUT(end + sizeOff, blksz); - SYSTEM.PUT(end + sntlOff, NoPtrSntl); - SYSTEM.PUT(end, end + sizeOff); - SYSTEM.PUT(adr + sizeOff, restsize); - SYSTEM.PUT(adr + nextOff, freeList[di]); - freeList[di] := adr; - INC(adr, restsize) - END - ELSE - adr := bigBlocks; prev := 0; - LOOP - IF adr = 0 THEN - IF firstTry THEN - GC(TRUE); INC(blksz, Unit); - IF (heapsize - allocated - blksz) * 4 < heapsize THEN - (* heap is still almost full; expand to avoid thrashing *) - ExtendHeap((allocated + blksz) DIV (3*Unit) * (4*Unit) - heapsize) - END ; - firstTry := FALSE; new := NEWREC(tag); firstTry := TRUE; - IF new = NIL THEN - (* depending on the fragmentation, the heap may not have been extended by - the anti-thrashing heuristics above *) - ExtendHeap((allocated + blksz) DIV (3*Unit) * (4*Unit) - heapsize); - new := NEWREC(tag); (* will find a free block if heap has been expanded properly *) - END ; - Unlock(); RETURN new - ELSE - Unlock(); RETURN NIL - END - END ; - SYSTEM.GET(adr+sizeOff, t); - IF t >= blksz THEN EXIT END ; - prev := adr; SYSTEM.GET(adr + nextOff, adr) - END ; - restsize := t - blksz; end := adr + restsize; - SYSTEM.PUT(end + sizeOff, blksz); - SYSTEM.PUT(end + sntlOff, NoPtrSntl); - SYSTEM.PUT(end, end + sizeOff); - IF restsize > nofLists * Unit THEN (*resize*) - SYSTEM.PUT(adr + sizeOff, restsize) - ELSE (*unlink*) - SYSTEM.GET(adr + nextOff, next); - IF prev = 0 THEN bigBlocks := next - ELSE SYSTEM.PUT(prev + nextOff, next); - END ; - IF restsize > 0 THEN (*move*) - di := restsize DIV Unit; - SYSTEM.PUT(adr + sizeOff, restsize); - SYSTEM.PUT(adr + nextOff, freeList[di]); - freeList[di] := adr - END - END ; - INC(adr, restsize) - END ; - i := adr + 4*SZL; end := adr + blksz; - WHILE i < end DO (*deliberately unrolled*) - SYSTEM.PUT(i, LONG(LONG(0))); - SYSTEM.PUT(i + SZL, LONG(LONG(0))); - SYSTEM.PUT(i + 2*SZL, LONG(LONG(0))); - SYSTEM.PUT(i + 3*SZL, LONG(LONG(0))); - INC(i, 4*SZL) - END ; - SYSTEM.PUT(adr + nextOff, LONG(LONG(0))); - SYSTEM.PUT(adr, tag); - SYSTEM.PUT(adr + sizeOff, LONG(LONG(0))); - SYSTEM.PUT(adr + sntlOff, LONG(LONG(0))); - INC(allocated, blksz); - Unlock(); - RETURN SYSTEM.VAL(SYSTEM.PTR, adr + SZL) - END NEWREC; - - PROCEDURE NEWBLK*(size: LONGINT): SYSTEM.PTR; - VAR blksz, tag: LONGINT; new: SYSTEM.PTR; - BEGIN - Lock(); - blksz := (size + (4*SZL + Unit - 1)) DIV Unit * Unit; (*size + tag + meta + blksz + sntnl + UnitAlignment*) - new := NEWREC(SYSTEM.ADR(blksz)); - tag := SYSTEM.VAL(LONGINT, new) + blksz - 3*SZL; - SYSTEM.PUT(tag - SZL, LONG(LONG(0))); (*reserved for meta info*) - SYSTEM.PUT(tag, blksz); - SYSTEM.PUT(tag + SZL, NoPtrSntl); - SYSTEM.PUT(SYSTEM.VAL(LONGINT, new) - SZL, tag); - Unlock(); - RETURN new - END NEWBLK; - - PROCEDURE Mark(q: LONGINT); - VAR p, tag, fld, n, offset, tagbits: LONGINT; - BEGIN - IF q # 0 THEN SYSTEM.GET(q - SZL, tagbits); - IF ~ODD(tagbits) THEN - SYSTEM.PUT(q - SZL, tagbits + 1); - p := 0; tag := tagbits + SZL; - LOOP - SYSTEM.GET(tag, offset); - IF offset < 0 THEN - SYSTEM.PUT(q - SZL, tag + offset + 1); - IF p = 0 THEN EXIT END ; - n := q; q := p; - SYSTEM.GET(q - SZL, tag); DEC(tag, 1); - SYSTEM.GET(tag, offset); fld := q + offset; - SYSTEM.GET(fld, p); SYSTEM.PUT(fld, n) - ELSE - fld := q + offset; - SYSTEM.GET(fld, n); - IF n # 0 THEN - SYSTEM.GET(n - SZL, tagbits); - IF ~ODD(tagbits) THEN - SYSTEM.PUT(n - SZL, tagbits + 1); - SYSTEM.PUT(q - SZL, tag + 1); - SYSTEM.PUT(fld, p); p := q; q := n; - tag := tagbits - END - END - END ; - INC(tag, SZL) - END - END - END - END Mark; - - PROCEDURE MarkP(p: SYSTEM.PTR); (* for compatibility with EnumPtrs in ANSI mode *) - BEGIN - Mark(SYSTEM.VAL(LONGINT, p)) - END MarkP; - - PROCEDURE Scan; - VAR chnk, adr, end, start, tag, i, size, freesize: LONGINT; - BEGIN bigBlocks := 0; i := 1; - WHILE i < nofLists DO freeList[i] := 0; INC(i) END ; - freesize := 0; allocated := 0; chnk := heap; - WHILE chnk # 0 DO - adr := chnk + blkOff; SYSTEM.GET(chnk + endOff, end); - WHILE adr < end DO - SYSTEM.GET(adr, tag); - IF ODD(tag) THEN (*marked*) - IF freesize > 0 THEN - start := adr - freesize; - SYSTEM.PUT(start, start+SZL); - SYSTEM.PUT(start+sizeOff, freesize); - SYSTEM.PUT(start+sntlOff, NoPtrSntl); - i := freesize DIV Unit; freesize := 0; - IF i < nofLists THEN SYSTEM.PUT(start + nextOff, freeList[i]); freeList[i] := start - ELSE SYSTEM.PUT(start + nextOff, bigBlocks); bigBlocks := start - END - END ; - DEC(tag, 1); - SYSTEM.PUT(adr, tag); - SYSTEM.GET(tag, size); - INC(allocated, size); - INC(adr, size) - ELSE (*unmarked*) - SYSTEM.GET(tag, size); - INC(freesize, size); - INC(adr, size) - END - END ; - IF freesize > 0 THEN (*collect last block*) - start := adr - freesize; - SYSTEM.PUT(start, start+SZL); - SYSTEM.PUT(start+sizeOff, freesize); - SYSTEM.PUT(start+sntlOff, NoPtrSntl); - i := freesize DIV Unit; freesize := 0; - IF i < nofLists THEN SYSTEM.PUT(start + nextOff, freeList[i]); freeList[i] := start - ELSE SYSTEM.PUT(start + nextOff, bigBlocks); bigBlocks := start - END - END ; - SYSTEM.GET(chnk, chnk) - END - END Scan; - - PROCEDURE Sift (l, r: LONGINT; VAR a: ARRAY OF LONGINT); - VAR i, j, x: LONGINT; - BEGIN j := l; x := a[j]; - LOOP i := j; j := 2*j + 1; - IF (j < r) & (a[j] < a[j+1]) THEN INC(j) END; - IF (j > r) OR (a[j] <= x) THEN EXIT END; - a[i] := a[j] - END; - a[i] := x - END Sift; - - PROCEDURE HeapSort (n: LONGINT; VAR a: ARRAY OF LONGINT); - VAR l, r, x: LONGINT; - BEGIN l := n DIV 2; r := n - 1; - WHILE l > 0 DO DEC(l); Sift(l, r, a) END; - WHILE r > 0 DO x := a[0]; a[0] := a[r]; a[r] := x; DEC(r); Sift(l, r, a) END - END HeapSort; - - PROCEDURE MarkCandidates(n: LONGINT; VAR cand: ARRAY OF LONGINT); - VAR chnk, adr, tag, next, lim, lim1, i, ptr, size: LONGINT; - BEGIN - chnk := heap; i := 0; lim := cand[n-1]; - WHILE (chnk # 0 ) & (chnk < lim) DO - adr := chnk + blkOff; - SYSTEM.GET(chnk + endOff, lim1); - IF lim < lim1 THEN lim1 := lim END ; - WHILE adr < lim1 DO - SYSTEM.GET(adr, tag); - IF ODD(tag) THEN (*already marked*) - SYSTEM.GET(tag-1, size); INC(adr, size) - ELSE - SYSTEM.GET(tag, size); - ptr := adr + SZL; - WHILE cand[i] < ptr DO INC(i) END ; - IF i = n THEN RETURN END ; - next := adr + size; - IF cand[i] < next THEN Mark(ptr) END ; - adr := next - END - END ; - SYSTEM.GET(chnk, chnk) - END - END MarkCandidates; - - PROCEDURE CheckFin; - VAR n: FinNode; tag: LONGINT; - BEGIN n := fin; - WHILE n # NIL DO - SYSTEM.GET(n.obj - SZL, tag); - IF ~ODD(tag) THEN n.marked := FALSE; Mark(n.obj) - ELSE n.marked := TRUE - END ; - n := n.next - END - END CheckFin; - - PROCEDURE Finalize; - VAR n, prev: FinNode; - BEGIN n := fin; prev := NIL; - WHILE n # NIL DO - IF ~n.marked THEN - IF n = fin THEN fin := fin.next ELSE prev.next := n.next END ; - n.finalize(SYSTEM.VAL(SYSTEM.PTR, n.obj)); - (* new nodes may have been pushed in n.finalize, therefore: *) - IF prev = NIL THEN n := fin ELSE n := n.next END - ELSE prev := n; n := n.next - END - END - END Finalize; - - PROCEDURE FINALL*; - VAR n: FinNode; - BEGIN - WHILE fin # NIL DO - n := fin; fin := fin.next; - n.finalize(SYSTEM.VAL(SYSTEM.PTR, n.obj)) - END - END FINALL; - - PROCEDURE MarkStack(n: LONGINT; VAR cand: ARRAY OF LONGINT); - VAR - frame: SYSTEM.PTR; - inc, nofcand: LONGINT; - sp, p, stack0, ptr: LONGINT; - align: RECORD ch: CHAR; p: SYSTEM.PTR END ; - BEGIN - IF n > 0 THEN MarkStack(n-1, cand); (* flush register windows by means of recursive calls *) - IF n > 100 THEN RETURN END (* prevent tail recursion optimization *) - END ; - IF n = 0 THEN - nofcand := 0; sp := SYSTEM.ADR(frame); - stack0 := Mainfrm(); - (* check for minimum alignment of pointers *) - inc := SYSTEM.ADR(align.p) - SYSTEM.ADR(align); - IF sp > stack0 THEN inc := -inc END ; - WHILE sp # stack0 DO - SYSTEM.GET(sp, p); - IF (p > heap) & (p < heapend) THEN - IF nofcand = LEN(cand) THEN HeapSort(nofcand, cand); MarkCandidates(nofcand, cand); nofcand := 0 END ; - cand[nofcand] := p; INC(nofcand) - END ; - INC(sp, inc) - END ; - IF nofcand > 0 THEN HeapSort(nofcand, cand); MarkCandidates(nofcand, cand) END - END - END MarkStack; - - PROCEDURE GC*(markStack: BOOLEAN); - VAR - m: Module; - i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23: LONGINT; - cand: ARRAY 10000 OF LONGINT; - BEGIN - IF (gclock = 0) OR (gclock = 1) & ~markStack THEN - Lock(); - m := SYSTEM.VAL(Module, modules); - WHILE m # NIL DO - IF m.enumPtrs # NIL THEN m.enumPtrs(MarkP) END ; - m := m^.next - END ; - IF markStack THEN - (* generate register pressure to force callee saved registers to memory; - may be simplified by inlining OS calls or processor specific instructions - *) - i0 := -100; i1 := -101; i2 := -102; i3 := -103; i4 := -104; i5 := -105; i6 := -106; i7 := -107; - i8 := 1; i9 := 2; i10 := 3; i11 := 4; i12 := 5; i13 := 6; i14 := 7; i15 := 8; - i16 := 9; i17 := 10; i18 := 11; i19 := 12; i20 := 13; i21 := 14; i22 := 15; i23 := 16; - LOOP INC(i0, 1); INC(i1, 2); INC(i2, 3); INC(i3, 4); INC(i4, 5); INC(i5, 6); INC(i6, 7); INC(i7, 8); - INC(i8, 9); INC(i9, 10); INC(i10, 11); INC(i11, 12); INC(i12, 13); INC(i13, 14); INC(i14, 15); INC(i15, 16); - INC(i16, 17); INC(i17, 18); INC(i18, 19); INC(i19, 20); INC(i20, 21); INC(i21, 22); INC(i22, 23); INC(i23, 24); - IF (i0 = -99) & (i15 = 24) THEN MarkStack(32, cand); EXIT END - END ; - IF i0 + i1 + i2 + i3 + i4 + i5 + i6 + i7 + i8 + i9 + i10 + i11 + i12 + i13 + i14 + i15 - + i16 + i17 + i18 + i19 + i20 + i21 + i22 + i23 > 10000 THEN RETURN (* use all variables *) - END ; - END; - CheckFin; - Scan; - Finalize; - Unlock() - END - END GC; - - PROCEDURE REGFIN*(obj: SYSTEM.PTR; finalize: Finalizer); - VAR f: FinNode; - BEGIN NEW(f); - f.obj := SYSTEM.VAL(LONGINT, obj); f.finalize := finalize; f.marked := TRUE; f.next := fin; fin := f - END REGFIN; - - PROCEDURE InitHeap; (* initialized before body to enable NEW, SYSTEM.NEW *) - BEGIN - heap := NewChunk(heapSize0); - SYSTEM.GET(heap + endOff, heapend); - SYSTEM.PUT(heap, LONG(LONG(0))); - allocated := 0; firstTry := TRUE; freeList[nofLists] := 1; gclock := 0 - END InitHeap; - -END SYSTEM. diff --git a/src/system/linux/clang/armv6j_hardfp/Args.Mod b/src/system/linux/clang/armv6j_hardfp/Args.Mod deleted file mode 100644 index c6b7b56e..00000000 --- a/src/system/linux/clang/armv6j_hardfp/Args.Mod +++ /dev/null @@ -1,65 +0,0 @@ -MODULE Args; (* jt, 8.12.94 *) - - (* command line argument handling for voc (jet backend) *) - - - IMPORT SYSTEM; - - TYPE - ArgPtr = POINTER TO ARRAY 1024 OF CHAR; - ArgVec = POINTER TO ARRAY 1024 OF ArgPtr; - - VAR argc-, argv-: LONGINT; - (*PROCEDURE -includestdlib() "#include ";*) - PROCEDURE -externgetenv() "extern char *getenv(const char *name);"; (* took this from stdlib.h*) - PROCEDURE -Argc(): INTEGER "SYSTEM_argc"; - PROCEDURE -Argv(): LONGINT "(long)SYSTEM_argv"; - PROCEDURE -getenv(var: ARRAY OF CHAR): ArgPtr - "(Args_ArgPtr)getenv(var)"; - - PROCEDURE Get*(n: INTEGER; VAR val: ARRAY OF CHAR); - VAR av: ArgVec; - BEGIN - IF n < argc THEN av := SYSTEM.VAL(ArgVec, argv); COPY(av[n]^, val) END - END Get; - - PROCEDURE GetInt*(n: INTEGER; VAR val: LONGINT); - VAR s: ARRAY 64 OF CHAR; k, d, i: LONGINT; - BEGIN - s := ""; Get(n, s); i := 0; - IF s[0] = "-" THEN i := 1 END ; - k := 0; d := ORD(s[i]) - ORD("0"); - WHILE (d >= 0 ) & (d <= 9) DO k := k*10 + d; INC(i); d := ORD(s[i]) - ORD("0") END ; - IF s[0] = "-" THEN d := -d; DEC(i) END ; - IF i > 0 THEN val := k END - END GetInt; - - PROCEDURE Pos*(s: ARRAY OF CHAR): INTEGER; - VAR i: INTEGER; arg: ARRAY 256 OF CHAR; - BEGIN - i := 0; Get(i, arg); - WHILE (i < argc) & (s # arg) DO INC(i); Get(i, arg) END ; - RETURN i - END Pos; - - PROCEDURE GetEnv*(var: ARRAY OF CHAR; VAR val: ARRAY OF CHAR); - VAR p: ArgPtr; - BEGIN - p := getenv(var); - IF p # NIL THEN COPY(p^, val) END - END GetEnv; - - PROCEDURE getEnv*(var: ARRAY OF CHAR; VAR val: ARRAY OF CHAR): BOOLEAN; - VAR p: ArgPtr; - BEGIN - p := getenv(var); - IF p # NIL THEN - COPY(p^, val); - RETURN TRUE - ELSE - RETURN FALSE - END - END getEnv; - -BEGIN argc := Argc(); argv := Argv() -END Args. diff --git a/src/system/linux/clang/armv6j_hardfp/Files.Mod b/src/system/linux/clang/armv6j_hardfp/Files.Mod deleted file mode 100644 index 6307407d..00000000 --- a/src/system/linux/clang/armv6j_hardfp/Files.Mod +++ /dev/null @@ -1,663 +0,0 @@ -MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files *) -(* modified version of Files, which opens only the file provided and does not scan any path in any environment variable, also ReadLine procedure added; -- noch *) - IMPORT SYSTEM, Unix, Kernel, Args, Console; - - (* standard data type I/O - - little endian, - Sint:1, Int:2, Lint:4 - ORD({0}) = 1, - false = 0, true =1 - IEEE real format, - null terminated strings, - compact numbers according to M.Odersky *) - - - CONST - nofbufs = 4; - bufsize = 4096; - fileTabSize = 64; - noDesc = -1; - notDone = -1; - - (* file states *) - open = 0; create = 1; close = 2; - - - TYPE - FileName = ARRAY 101 OF CHAR; - File* = POINTER TO Handle; - Buffer = POINTER TO BufDesc; - - Handle = RECORD - workName, registerName: FileName; - tempFile: BOOLEAN; - dev, ino, mtime: LONGINT; - fd-, len, pos: LONGINT; - bufs: ARRAY nofbufs OF Buffer; - swapper, state: INTEGER - END ; - - BufDesc = RECORD - f: File; - chg: BOOLEAN; - org, size: LONGINT; - data: ARRAY bufsize OF SYSTEM.BYTE - END ; - - Rider* = RECORD - res*: LONGINT; - eof*: BOOLEAN; - buf: Buffer; - org, offset: LONGINT - END ; - - Time = POINTER TO TimeDesc; - TimeDesc = RECORD - sec*, min*, hour*, mday*, mon*, year*, wday*, isdst*, zone*, gmtoff*: LONGINT; -(* sec*, min*, hour*, mday*, mon*, year*, wday*, isdst*, zone*, gmtoff*: INTEGER;*) - END ; - - VAR - fileTab: ARRAY fileTabSize OF LONGINT (*=File*); - tempno: INTEGER; - -(* for localtime *) - PROCEDURE -includetime() - '#include "time.h"'; - - PROCEDURE -localtime(VAR clock: LONGINT): Time - "(Files_Time) localtime(clock)"; - - PROCEDURE -getcwd(VAR cwd: Unix.Name) - "getcwd(cwd, cwd__len)"; - - PROCEDURE -IdxTrap "__HALT(-1)"; - - PROCEDURE^ Finalize(o: SYSTEM.PTR); - - PROCEDURE Err(s: ARRAY OF CHAR; f: File; errno: LONGINT); - BEGIN - Console.Ln; Console.String("-- "); Console.String(s); Console.String(": "); - IF f # NIL THEN - IF f.registerName # "" THEN Console.String(f.registerName) ELSE Console.String(f.workName) END - END ; - IF errno # 0 THEN Console.String(" errno = "); Console.Int(errno, 1) END ; - Console.Ln; - HALT(99) - END Err; - - PROCEDURE MakeFileName(dir, name: ARRAY OF CHAR; VAR dest: ARRAY OF CHAR); - VAR i, j: INTEGER; - BEGIN i := 0; j := 0; - WHILE dir[i] # 0X DO dest[i] := dir[i]; INC(i) END ; - IF dest[i-1] # "/" THEN dest[i] := "/"; INC(i) END ; - WHILE name[j] # 0X DO dest[i] := name[j]; INC(i); INC(j) END ; - dest[i] := 0X - END MakeFileName; - - PROCEDURE GetTempName(finalName: ARRAY OF CHAR; VAR name: ARRAY OF CHAR); - VAR n, i, j: LONGINT; - BEGIN - INC(tempno); n := tempno; i := 0; - IF finalName[0] # "/" THEN (* relative pathname *) - WHILE Kernel.CWD[i] # 0X DO name[i] := Kernel.CWD[i]; INC(i) END; - IF Kernel.CWD[i-1] # "/" THEN name[i] := "/"; INC(i) END - END; - j := 0; - WHILE finalName[j] # 0X DO name[i] := finalName[j]; INC(i); INC(j) END; - DEC(i); - WHILE name[i] # "/" DO DEC(i) END; - name[i+1] := "."; name[i+2] := "t"; name[i+3] := "m"; name[i+4] := "p"; name[i+5] := "."; INC(i, 6); - WHILE n > 0 DO name[i] := CHR(n MOD 10 + ORD("0")); n := n DIV 10; INC(i) END; - name[i] := "."; INC(i); n := SHORT(Unix.Getpid()); - WHILE n > 0 DO name[i] := CHR(n MOD 10 + ORD("0")); n := n DIV 10; INC(i) END; - name[i] := 0X - END GetTempName; - - PROCEDURE Create(f: File); - VAR stat: Unix.Status; done: BOOLEAN; - errno: LONGINT; err: ARRAY 32 OF CHAR; - BEGIN - IF f.fd = noDesc THEN - IF f.state = create THEN GetTempName(f.registerName, f.workName); f.tempFile := TRUE - ELSIF f.state = close THEN - f.workName := f.registerName; f.registerName := ""; f.tempFile := FALSE - END ; - errno := Unix.Unlink(f.workName); (*unlink first to avoid stale NFS handles and to avoid reuse of inodes*) - f.fd := Unix.Open(f.workName, Unix.rdwr + Unix.creat + Unix.trunc, {2, 4,5, 7,8}); - done := f.fd >= 0; errno := Unix.errno(); - IF (~done & ((errno = Unix.ENFILE) OR (errno = Unix.EMFILE))) OR (done & (f.fd >= fileTabSize)) THEN - IF done & (f.fd >= fileTabSize) THEN errno := Unix.Close(f.fd) END ; - Kernel.GC(TRUE); - f.fd := Unix.Open(f.workName, Unix.rdwr + Unix.creat + Unix.trunc, {2, 4,5, 7,8}); - done := f.fd >= 0 - END ; - IF done THEN - IF f.fd >= fileTabSize THEN errno := Unix.Close(f.fd); Err("too many files open", f, 0) - ELSE fileTab[f.fd] := SYSTEM.VAL(LONGINT, f); INC(Kernel.nofiles); Kernel.RegisterObject(f, Finalize); - f.state := open; f.pos := 0; errno := Unix.Fstat(f.fd, stat); - f.dev := stat.dev; f.ino := stat.ino; f.mtime := stat.mtime - END - ELSE errno := Unix.errno(); - IF errno = Unix.ENOENT THEN err := "no such directory" - ELSIF (errno = Unix.ENFILE) OR (errno = Unix.EMFILE) THEN err := "too many files open" - ELSE err := "file not created" - END ; - Err(err, f, errno) - END - END - END Create; - - PROCEDURE Flush(buf: Buffer); - VAR res: LONGINT; f: File; stat: Unix.Status; - BEGIN - IF buf.chg THEN f := buf.f; Create(f); - IF buf.org # f.pos THEN res := Unix.Lseek(f.fd, buf.org, 0) END ; - res := Unix.Write(f.fd, SYSTEM.ADR(buf.data), buf.size); - IF res < 0 THEN Err("error in writing file", f, Unix.errno()) END ; - f.pos := buf.org + buf.size; - buf.chg := FALSE; - res := Unix.Fstat(f.fd, stat); - f.mtime := stat.mtime - END - END Flush; - - PROCEDURE Close* (f: File); - VAR i, res: LONGINT; - BEGIN - IF (f.state # create) OR (f.registerName # "") THEN - Create(f); i := 0; - WHILE (i < nofbufs) & (f.bufs[i] # NIL) DO Flush(f.bufs[i]); INC(i) END ; - res := Unix.Fsync(f.fd); - IF res < 0 THEN Err("error in writing file", f, Unix.errno()) END - END - END Close; - - PROCEDURE Length* (f: File): LONGINT; - BEGIN RETURN f.len - END Length; - - PROCEDURE New* (name: ARRAY OF CHAR): File; - VAR f: File; - BEGIN - NEW(f); f.workName := ""; COPY(name, f.registerName); - f.fd := noDesc; f.state := create; f.len := 0; f.pos := 0; f.swapper := -1; (*all f.buf[i] = NIL*) - RETURN f - END New; -(* - PROCEDURE ScanPath(VAR pos: INTEGER; VAR dir: ARRAY OF CHAR); (* supports ~, ~user and blanks inside path *) - VAR i: INTEGER; ch: CHAR; home: ARRAY 256 OF CHAR; - BEGIN - i := 0; ch := Kernel.OBERON[pos]; - WHILE (ch = " ") OR (ch = ":") DO INC(pos); ch := Kernel.OBERON[pos] END ; - IF ch = "~" THEN - INC(pos); ch := Kernel.OBERON[pos]; - home := ""; Args.GetEnv("HOME", home); - WHILE home[i] # 0X DO dir[i] := home[i]; INC(i) END ; - IF (ch # "/") & (ch # 0X) & (ch # ":") & (ch # " ") THEN - WHILE (i > 0) & (dir[i-1] # "/") DO DEC(i) END - END - END ; - WHILE (ch # 0X) & (ch # ":") DO dir[i] := ch; INC(i); INC(pos); ch := Kernel.OBERON[pos] END ; - WHILE (i > 0) & (dir[i-1] = " ") DO DEC(i) END ; - dir[i] := 0X - END ScanPath; -*) - PROCEDURE HasDir(VAR name: ARRAY OF CHAR): BOOLEAN; - VAR i: INTEGER; ch: CHAR; - BEGIN i := 0; ch := name[0]; - WHILE (ch # 0X) & (ch # "/") DO INC(i); ch := name[i] END ; - RETURN ch = "/" - END HasDir; - - PROCEDURE CacheEntry(dev, ino: LONGINT; mtime: LONGINT): File; - VAR f: File; i: INTEGER; stat: Unix.Status; res: LONGINT; - BEGIN i := 0; - WHILE i < fileTabSize DO - f := SYSTEM.VAL(File, fileTab[i]); - IF (f # NIL) & (ino = f.ino) & (dev = f.dev) THEN - IF mtime # f.mtime THEN i := 0; - WHILE i < nofbufs DO - IF f.bufs[i] # NIL THEN f.bufs[i].org := -1; f.bufs[i] := NIL END ; - INC(i) - END ; - f.swapper := -1; f.mtime := mtime; - res := Unix.Fstat(f.fd, stat); f.len := stat.size - END ; - RETURN f - END ; - INC(i) - END ; - RETURN NIL - END CacheEntry; - - PROCEDURE Old* (name: ARRAY OF CHAR): File; - VAR f: File; fd, res, errno: LONGINT; pos: INTEGER; done: BOOLEAN; - dir, path: ARRAY 256 OF CHAR; - stat: Unix.Status; - BEGIN - IF name # "" THEN - IF HasDir(name) THEN dir := ""; COPY(name, path) - ELSE - pos := 0; - COPY(name, path); (* -- noch *) - (*ScanPath(pos, dir);*) (*MakeFileName(dir, name, path);*) (*ScanPath(pos, dir)*) - END ; - LOOP - fd := Unix.Open(path, Unix.rdwr, {}); done := fd >= 0; errno := Unix.errno(); - IF (~done & ((errno = Unix.ENFILE) OR (errno = Unix.EMFILE))) OR (done & (fd >= fileTabSize)) THEN - IF done & (fd >= fileTabSize) THEN res := Unix.Close(fd) END ; - Kernel.GC(TRUE); - fd := Unix.Open(path, Unix.rdwr, {}); - done := fd >= 0; errno := Unix.errno(); - IF ~done & ((errno = Unix.ENFILE) OR (errno = Unix.EMFILE)) THEN Err("too many files open", f, errno) END - END ; - IF ~done & ((errno = Unix.EACCES) OR (errno = Unix.EROFS) OR (errno = Unix.EAGAIN)) THEN - (* errno EAGAIN observed on Solaris 2.4 *) - fd := Unix.Open(path, Unix.rdonly, {}); done := fd >= 0; errno := Unix.errno() - END ; -IF (~done) & (errno # Unix.ENOENT) THEN - Console.String("warning Files.Old "); Console.String(name); - Console.String(" errno = "); Console.Int(errno, 0); Console.Ln; -END ; - IF done THEN - res := Unix.Fstat(fd, stat); - f := CacheEntry(stat.dev, stat.ino, stat.mtime); - IF f # NIL THEN res := Unix.Close(fd); RETURN f - ELSIF fd >= fileTabSize THEN res := Unix.Close(fd); Err("too many files open", f, 0) - ELSE NEW(f); fileTab[fd] := SYSTEM.VAL(LONGINT, f); INC(Kernel.nofiles); Kernel.RegisterObject(f, Finalize); - f.fd := fd; f.state := open; f.len := stat.size; f.pos := 0; f.swapper := -1; (*all f.buf[i] = NIL*) - COPY(name, f.workName); f.registerName := ""; f.tempFile := FALSE; - f.dev := stat.dev; f.ino := stat.ino; f.mtime := stat.mtime; - RETURN f - END - ELSIF dir = "" THEN RETURN NIL - ELSE (*MakeFileName(dir, name, path);*) (*ScanPath(pos, dir)*) - RETURN NIL - END - END - ELSE RETURN NIL - END - END Old; - - PROCEDURE Purge* (f: File); - VAR i: INTEGER; stat: Unix.Status; res: LONGINT; - BEGIN i := 0; - WHILE i < nofbufs DO - IF f.bufs[i] # NIL THEN f.bufs[i].org := -1; f.bufs[i] := NIL END ; - INC(i) - END ; - IF f.fd # noDesc THEN res := Unix.Ftruncate(f.fd, 0); res := Unix.Lseek(f.fd, 0, 0) END ; - f.pos := 0; f.len := 0; f.swapper := -1; - res := Unix.Fstat(f.fd, stat); f.mtime := stat.mtime - END Purge; - - PROCEDURE GetDate* (f: File; VAR t, d: LONGINT); - VAR stat: Unix.Status; clock, res: LONGINT; time: Time; - BEGIN - Create(f); res := Unix.Fstat(f.fd, stat); - time := localtime(stat.mtime); - t := time.sec + ASH(time.min, 6) + ASH(time.hour, 12); - d := time.mday + ASH(time.mon+1, 5) + ASH(time.year MOD 100, 9) - END GetDate; - - PROCEDURE Pos* (VAR r: Rider): LONGINT; - BEGIN RETURN r.org + r.offset - END Pos; - - PROCEDURE Set* (VAR r: Rider; f: File; pos: LONGINT); - VAR org, offset, i, n, res: LONGINT; buf: Buffer; - BEGIN - IF f # NIL THEN - IF pos > f.len THEN pos := f.len ELSIF pos < 0 THEN pos := 0 END ; - offset := pos MOD bufsize; org := pos - offset; i := 0; - WHILE (i < nofbufs) & (f.bufs[i] # NIL) & (org # f.bufs[i].org) DO INC(i) END ; - IF i < nofbufs THEN - IF f.bufs[i] = NIL THEN NEW(buf); buf.chg := FALSE; buf.org := -1; buf.f := f; f.bufs[i] := buf - ELSE buf := f.bufs[i] - END - ELSE - f.swapper := (f.swapper + 1) MOD nofbufs; - buf := f.bufs[f.swapper]; - Flush(buf) - END ; - IF buf.org # org THEN - IF org = f.len THEN buf.size := 0 - ELSE Create(f); - IF f.pos # org THEN res := Unix.Lseek(f.fd, org, 0) END ; - n := Unix.ReadBlk(f.fd, buf.data); - IF n < 0 THEN Err("read from file not done", f, Unix.errno()) END ; - f.pos := org + n; - buf.size := n - END ; - buf.org := org; buf.chg := FALSE - END - ELSE buf := NIL; org := 0; offset := 0 - END ; - r.buf := buf; r.org := org; r.offset := offset; r.eof := FALSE; r.res := 0 - END Set; - - PROCEDURE Read* (VAR r: Rider; VAR x: SYSTEM.BYTE); - VAR offset: LONGINT; buf: Buffer; - BEGIN - buf := r.buf; offset := r.offset; - IF r.org # buf.org THEN Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset END ; - IF (offset < buf.size) THEN - x := buf.data[offset]; r.offset := offset + 1 - ELSIF r.org + offset < buf.f.len THEN - Set(r, r.buf.f, r.org + offset); - x := r.buf.data[0]; r.offset := 1 - ELSE - x := 0X; r.eof := TRUE - END - END Read; - - PROCEDURE ReadBytes* (VAR r: Rider; VAR x: ARRAY OF SYSTEM.BYTE; n: LONGINT); - VAR xpos, min, restInBuf, offset: LONGINT; buf: Buffer; - BEGIN - IF n > LEN(x) THEN IdxTrap END ; - xpos := 0; buf := r.buf; offset := r.offset; - WHILE n > 0 DO - IF (r.org # buf.org) OR (offset >= bufsize) THEN - Set(r, buf.f, r.org + offset); - buf := r.buf; offset := r.offset - END ; - restInBuf := buf.size - offset; - IF restInBuf = 0 THEN r.res := n; r.eof := TRUE; RETURN - ELSIF n > restInBuf THEN min := restInBuf ELSE min := n END ; - SYSTEM.MOVE(SYSTEM.ADR(buf.data) + offset, SYSTEM.ADR(x) + xpos, min); - INC(offset, min); r.offset := offset; INC(xpos, min); DEC(n, min) - END ; - r.res := 0; r.eof := FALSE - END ReadBytes; - - PROCEDURE ReadByte* (VAR r : Rider; VAR x : ARRAY OF SYSTEM.BYTE); - BEGIN - ReadBytes(r, x, 1); - END ReadByte; - - PROCEDURE Base* (VAR r: Rider): File; - BEGIN RETURN r.buf.f - END Base; - - PROCEDURE Write* (VAR r: Rider; x: SYSTEM.BYTE); - VAR buf: Buffer; offset: LONGINT; - BEGIN - buf := r.buf; offset := r.offset; - IF (r.org # buf.org) OR (offset >= bufsize) THEN - Set(r, buf.f, r.org + offset); - buf := r.buf; offset := r.offset - END ; - buf.data[offset] := x; - buf.chg := TRUE; - IF offset = buf.size THEN - INC(buf.size); INC(buf.f.len) - END ; - r.offset := offset + 1; r.res := 0 - END Write; - - PROCEDURE WriteByte* (VAR r : Rider; x : SYSTEM.BYTE); (* added for compatibility with PO 2013, -- noch *) - BEGIN - Write(r, x); - END WriteByte; - - PROCEDURE WriteBytes* (VAR r: Rider; VAR x: ARRAY OF SYSTEM.BYTE; n: LONGINT); - VAR xpos, min, restInBuf, offset: LONGINT; buf: Buffer; - BEGIN - IF n > LEN(x) THEN IdxTrap END ; - xpos := 0; buf := r.buf; offset := r.offset; - WHILE n > 0 DO - IF (r.org # buf.org) OR (offset >= bufsize) THEN - Set(r, buf.f, r.org + offset); - buf := r.buf; offset := r.offset - END ; - restInBuf := bufsize - offset; - IF n > restInBuf THEN min := restInBuf ELSE min := n END ; - SYSTEM.MOVE(SYSTEM.ADR(x) + xpos, SYSTEM.ADR(buf.data) + offset, min); - INC(offset, min); r.offset := offset; - IF offset > buf.size THEN INC(buf.f.len, offset - buf.size); buf.size := offset END ; - INC(xpos, min); DEC(n, min); buf.chg := TRUE - END ; - r.res := 0 - END WriteBytes; - -(* another solution would be one that is similar to ReadBytes, WriteBytes. -No code duplication, more symmetric, only two ifs for -Read and Write in buffer, buf.size replaced by bufsize in Write ops, buf.size and len -must be made consistent with offset (if offset > buf.size) in a lazy way. - -PROCEDURE Write* (VAR r: Rider; x: SYSTEM.BYTE); - VAR buf: Buffer; offset: LONGINT; -BEGIN - buf := r.buf; offset := r.offset; - IF (offset >= bufsize) OR (r.org # buf.org) THEN - Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset; - END ; - buf.data[offset] := x; r.offset := offset + 1; buf.chg := TRUE -END Write; - - -PROCEDURE WriteBytes ... - -PROCEDURE Read* (VAR r: Rider; VAR x: SYSTEM.BYTE); - VAR offset: LONGINT; buf: Buffer; -BEGIN - buf := r.buf; offset := r.offset; - IF (offset >= buf.size) OR (r.org # buf.org) THEN - IF r.org + offset >= buf.f.len THEN x := 0X; r.eof := TRUE; RETURN - ELSE Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset - END - END ; - x := buf.data[offset]; r.offset := offset + 1 -END Read; - -but this would also affect Set, Length, and Flush. -Especially Length would become fairly complex. -*) - - PROCEDURE Delete* (name: ARRAY OF CHAR; VAR res: INTEGER); - BEGIN - res := SHORT(Unix.Unlink(name)); - res := SHORT(Unix.errno()) - END Delete; - - PROCEDURE Rename* (old, new: ARRAY OF CHAR; VAR res: INTEGER); - VAR fdold, fdnew, n, errno, r: LONGINT; - ostat, nstat: Unix.Status; - buf: ARRAY 4096 OF CHAR; - BEGIN - r := Unix.Stat(old, ostat); - IF r >= 0 THEN - r := Unix.Stat(new, nstat); - IF (r >= 0) & ((ostat.dev # nstat.dev) OR (ostat.ino # nstat.ino)) THEN - Delete(new, res); (* work around stale nfs handles *) - END ; - r := Unix.Rename(old, new); - IF r < 0 THEN res := SHORT(Unix.errno()); - IF res = Unix.EXDEV THEN (* cross device link, move the file *) - fdold := Unix.Open(old, Unix.rdonly, {}); - IF fdold < 0 THEN res := 2; RETURN END ; - fdnew := Unix.Open(new, Unix.rdwr + Unix.creat + Unix.trunc, {2, 4,5, 7,8}); - IF fdnew < 0 THEN r := Unix.Close(fdold); res := 3; RETURN END ; - n := Unix.Read(fdold, SYSTEM.ADR(buf), bufsize); - WHILE n > 0 DO - r := Unix.Write(fdnew, SYSTEM.ADR(buf), n); - IF r < 0 THEN errno := Unix.errno(); r := Unix.Close(fdold); r := Unix.Close(fdnew); - Err("cannot move file", NIL, errno) - END ; - n := Unix.Read(fdold, SYSTEM.ADR(buf), bufsize) - END ; - errno := Unix.errno(); - r := Unix.Close(fdold); r := Unix.Close(fdnew); - IF n = 0 THEN r := Unix.Unlink(old); res := 0 - ELSE Err("cannot move file", NIL, errno) - END ; - ELSE RETURN (* res is Unix.Rename return code *) - END - END ; - res := 0 - ELSE res := 2 (* old file not found *) - END - END Rename; - - PROCEDURE Register* (f: File); - VAR idx, errno: INTEGER; f1: File; file: ARRAY 104 OF CHAR; - BEGIN - IF (f.state = create) & (f.registerName # "") THEN f.state := close (* shortcut renaming *) END ; - Close(f); - IF f.registerName # "" THEN - Rename(f.workName, f.registerName, errno); - IF errno # 0 THEN COPY(f.registerName, file); HALT(99) END ; - f.workName := f.registerName; f.registerName := ""; f.tempFile := FALSE - END - END Register; - - PROCEDURE ChangeDirectory*(path: ARRAY OF CHAR; VAR res: INTEGER); - BEGIN - res := SHORT(Unix.Chdir(path)); - getcwd(Kernel.CWD) - END ChangeDirectory; - - PROCEDURE FlipBytes(VAR src, dest: ARRAY OF SYSTEM.BYTE); - VAR i, j: LONGINT; - BEGIN - IF ~Kernel.littleEndian THEN i := LEN(src); j := 0; - WHILE i > 0 DO DEC(i); dest[j] := src[i]; INC(j) END - ELSE SYSTEM.MOVE(SYSTEM.ADR(src), SYSTEM.ADR(dest), LEN(src)) - END - END FlipBytes; - - PROCEDURE ReadBool* (VAR R: Rider; VAR x: BOOLEAN); - BEGIN Read(R, SYSTEM.VAL(CHAR, x)) - END ReadBool; - - PROCEDURE ReadInt* (VAR R: Rider; VAR x: INTEGER); - VAR b: ARRAY 2 OF CHAR; - BEGIN ReadBytes(R, b, 2); - x := ORD(b[0]) + ORD(b[1])*256 - END ReadInt; - - PROCEDURE ReadLInt* (VAR R: Rider; VAR x: LONGINT); - VAR b: ARRAY 4 OF CHAR; - BEGIN ReadBytes(R, b, 4); - x := ORD(b[0]) + ORD(b[1])*100H + ORD(b[2])*10000H + ORD(b[3])*1000000H - END ReadLInt; - - PROCEDURE ReadSet* (VAR R: Rider; VAR x: SET); - VAR b: ARRAY 4 OF CHAR; - BEGIN ReadBytes(R, b, 4); - x := SYSTEM.VAL(SET, ORD(b[0]) + ORD(b[1])*100H + ORD(b[2])*10000H + ORD(b[3])*1000000H) - END ReadSet; - - PROCEDURE ReadReal* (VAR R: Rider; VAR x: REAL); - VAR b: ARRAY 4 OF CHAR; - BEGIN ReadBytes(R, b, 4); FlipBytes(b, x) - END ReadReal; - - PROCEDURE ReadLReal* (VAR R: Rider; VAR x: LONGREAL); - VAR b: ARRAY 8 OF CHAR; - BEGIN ReadBytes(R, b, 8); FlipBytes(b, x) - END ReadLReal; - - PROCEDURE ReadString* (VAR R: Rider; VAR x: ARRAY OF CHAR); - VAR i: INTEGER; ch: CHAR; - BEGIN i := 0; - REPEAT Read(R, ch); x[i] := ch; INC(i) UNTIL ch = 0X - END ReadString; - - (* need to read line; -- noch *) - PROCEDURE ReadLine* (VAR R: Rider; VAR x: ARRAY OF CHAR); - VAR i: INTEGER; ch: CHAR; b : BOOLEAN; - BEGIN i := 0; - b := FALSE; - REPEAT - Read(R, ch); - IF ((ch = 0X) OR (ch = 0AX) OR (ch = 0DX)) THEN - b := TRUE - ELSE - x[i] := ch; - INC(i); - END; - UNTIL b - END ReadLine; - - PROCEDURE ReadNum* (VAR R: Rider; VAR x: LONGINT); - VAR s: SHORTINT; ch: CHAR; n: LONGINT; - BEGIN s := 0; n := 0; Read(R, ch); - WHILE ORD(ch) >= 128 DO INC(n, ASH(ORD(ch) - 128, s) ); INC(s, 7); Read(R, ch) END; - INC(n, ASH(ORD(ch) MOD 64 - ORD(ch) DIV 64 * 64, s) ); - x := n - END ReadNum; - - PROCEDURE WriteBool* (VAR R: Rider; x: BOOLEAN); - BEGIN Write(R, SYSTEM.VAL(CHAR, x)) - END WriteBool; - - PROCEDURE WriteInt* (VAR R: Rider; x: INTEGER); - VAR b: ARRAY 2 OF CHAR; - BEGIN b[0] := CHR(x); b[1] := CHR(x DIV 256); - WriteBytes(R, b, 2); - END WriteInt; - - PROCEDURE WriteLInt* (VAR R: Rider; x: LONGINT); - VAR b: ARRAY 4 OF CHAR; - BEGIN - b[0] := CHR(x); b[1] := CHR(x DIV 100H); b[2] := CHR(x DIV 10000H); b[3] := CHR(x DIV 1000000H); - WriteBytes(R, b, 4); - END WriteLInt; - - PROCEDURE WriteSet* (VAR R: Rider; x: SET); - VAR b: ARRAY 4 OF CHAR; i: LONGINT; - BEGIN i := SYSTEM.VAL(LONGINT, x); - 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; - - PROCEDURE WriteReal* (VAR R: Rider; x: REAL); - VAR b: ARRAY 4 OF CHAR; - BEGIN FlipBytes(x, b); WriteBytes(R, b, 4) - END WriteReal; - - PROCEDURE WriteLReal* (VAR R: Rider; x: LONGREAL); - VAR b: ARRAY 8 OF CHAR; - BEGIN FlipBytes(x, b); WriteBytes(R, b, 8) - END WriteLReal; - - PROCEDURE WriteString* (VAR R: Rider; x: ARRAY [1] OF CHAR); - VAR i: INTEGER; - BEGIN i := 0; - WHILE x[i] # 0X DO INC(i) END ; - WriteBytes(R, x, i+1) - END WriteString; - - PROCEDURE WriteNum* (VAR R: Rider; x: LONGINT); - BEGIN - WHILE (x < - 64) OR (x > 63) DO Write(R, CHR(x MOD 128 + 128)); x := x DIV 128 END; - Write(R, CHR(x MOD 128)) - END WriteNum; - - PROCEDURE GetName*(f: File; VAR name: ARRAY OF CHAR); - BEGIN - COPY (f.workName, name); - END GetName; - - PROCEDURE Finalize(o: SYSTEM.PTR); - VAR f: File; res: LONGINT; - BEGIN - f := SYSTEM.VAL(File, o); - IF f.fd >= 0 THEN - fileTab[f.fd] := 0; res := Unix.Close(f.fd); f.fd := -1; DEC(Kernel.nofiles); - IF f.tempFile THEN res := Unix.Unlink(f.workName) END - END - END Finalize; - - PROCEDURE Init; - VAR i: LONGINT; - BEGIN - i := 0; WHILE i < fileTabSize DO fileTab[i] := 0; INC(i) END ; - tempno := -1; Kernel.nofiles := 0 - END Init; - -BEGIN Init -END Files. diff --git a/src/system/linux/clang/armv6j_hardfp/Files0.Mod b/src/system/linux/clang/armv6j_hardfp/Files0.Mod deleted file mode 100644 index 4f021ede..00000000 --- a/src/system/linux/clang/armv6j_hardfp/Files0.Mod +++ /dev/null @@ -1,635 +0,0 @@ -MODULE Files0; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files *) - -(* this module is not for use by developers and inteded to bootstrap voc *) -(* for general use import Files module *) - - IMPORT SYSTEM, Unix, Kernel := Kernel0, Args, Console; - - (* standard data type I/O - - little endian, - Sint:1, Int:2, Lint:4 - ORD({0}) = 1, - false = 0, true =1 - IEEE real format, - null terminated strings, - compact numbers according to M.Odersky *) - - - CONST - nofbufs = 4; - bufsize = 4096; - fileTabSize = 64; - noDesc = -1; - notDone = -1; - - (* file states *) - open = 0; create = 1; close = 2; - - - TYPE - FileName = ARRAY 101 OF CHAR; - File* = POINTER TO Handle; - Buffer = POINTER TO BufDesc; - - Handle = RECORD - workName, registerName: FileName; - tempFile: BOOLEAN; - dev, ino, mtime: LONGINT; - fd-, len, pos: LONGINT; - bufs: ARRAY nofbufs OF Buffer; - swapper, state: INTEGER - END ; - - BufDesc = RECORD - f: File; - chg: BOOLEAN; - org, size: LONGINT; - data: ARRAY bufsize OF SYSTEM.BYTE - END ; - - Rider* = RECORD - res*: LONGINT; - eof*: BOOLEAN; - buf: Buffer; - org, offset: LONGINT - END ; - - Time = POINTER TO TimeDesc; - TimeDesc = RECORD - sec*, min*, hour*, mday*, mon*, year*, wday*, isdst*, zone*, gmtoff*: LONGINT; -(* sec*, min*, hour*, mday*, mon*, year*, wday*, isdst*, zone*, gmtoff*: INTEGER;*) - END ; - - VAR - fileTab: ARRAY fileTabSize OF LONGINT (*=File*); - tempno: INTEGER; - -(* for localtime *) - PROCEDURE -includetime() - '#include "time.h"'; - - PROCEDURE -localtime(VAR clock: LONGINT): Time - "(Files0_Time) localtime(clock)"; - - PROCEDURE -getcwd(VAR cwd: Unix.Name) - "getcwd(cwd, cwd__len)"; - - PROCEDURE -IdxTrap "__HALT(-1)"; - - PROCEDURE^ Finalize(o: SYSTEM.PTR); - - PROCEDURE Err(s: ARRAY OF CHAR; f: File; errno: LONGINT); - BEGIN - Console.Ln; Console.String("-- "); Console.String(s); Console.String(": "); - IF f # NIL THEN - IF f.registerName # "" THEN Console.String(f.registerName) ELSE Console.String(f.workName) END - END ; - IF errno # 0 THEN Console.String(" errno = "); Console.Int(errno, 1) END ; - Console.Ln; - HALT(99) - END Err; - - PROCEDURE MakeFileName(dir, name: ARRAY OF CHAR; VAR dest: ARRAY OF CHAR); - VAR i, j: INTEGER; - BEGIN i := 0; j := 0; - WHILE dir[i] # 0X DO dest[i] := dir[i]; INC(i) END ; - IF dest[i-1] # "/" THEN dest[i] := "/"; INC(i) END ; - WHILE name[j] # 0X DO dest[i] := name[j]; INC(i); INC(j) END ; - dest[i] := 0X - END MakeFileName; - - PROCEDURE GetTempName(finalName: ARRAY OF CHAR; VAR name: ARRAY OF CHAR); - VAR n, i, j: LONGINT; - BEGIN - INC(tempno); n := tempno; i := 0; - IF finalName[0] # "/" THEN (* relative pathname *) - WHILE Kernel.CWD[i] # 0X DO name[i] := Kernel.CWD[i]; INC(i) END; - IF Kernel.CWD[i-1] # "/" THEN name[i] := "/"; INC(i) END - END; - j := 0; - WHILE finalName[j] # 0X DO name[i] := finalName[j]; INC(i); INC(j) END; - DEC(i); - WHILE name[i] # "/" DO DEC(i) END; - name[i+1] := "."; name[i+2] := "t"; name[i+3] := "m"; name[i+4] := "p"; name[i+5] := "."; INC(i, 6); - WHILE n > 0 DO name[i] := CHR(n MOD 10 + ORD("0")); n := n DIV 10; INC(i) END; - name[i] := "."; INC(i); n := SHORT(Unix.Getpid()); - WHILE n > 0 DO name[i] := CHR(n MOD 10 + ORD("0")); n := n DIV 10; INC(i) END; - name[i] := 0X - END GetTempName; - - PROCEDURE Create(f: File); - VAR stat: Unix.Status; done: BOOLEAN; - errno: LONGINT; err: ARRAY 32 OF CHAR; - BEGIN - IF f.fd = noDesc THEN - IF f.state = create THEN GetTempName(f.registerName, f.workName); f.tempFile := TRUE - ELSIF f.state = close THEN - f.workName := f.registerName; f.registerName := ""; f.tempFile := FALSE - END ; - errno := Unix.Unlink(f.workName); (*unlink first to avoid stale NFS handles and to avoid reuse of inodes*) - f.fd := Unix.Open(f.workName, Unix.rdwr + Unix.creat + Unix.trunc, {2, 4,5, 7,8}); - done := f.fd >= 0; errno := Unix.errno(); - IF (~done & ((errno = Unix.ENFILE) OR (errno = Unix.EMFILE))) OR (done & (f.fd >= fileTabSize)) THEN - IF done & (f.fd >= fileTabSize) THEN errno := Unix.Close(f.fd) END ; - Kernel.GC(TRUE); - f.fd := Unix.Open(f.workName, Unix.rdwr + Unix.creat + Unix.trunc, {2, 4,5, 7,8}); - done := f.fd >= 0 - END ; - IF done THEN - IF f.fd >= fileTabSize THEN errno := Unix.Close(f.fd); Err("too many files open", f, 0) - ELSE fileTab[f.fd] := SYSTEM.VAL(LONGINT, f); INC(Kernel.nofiles); Kernel.RegisterObject(f, Finalize); - f.state := open; f.pos := 0; errno := Unix.Fstat(f.fd, stat); - f.dev := stat.dev; f.ino := stat.ino; f.mtime := stat.mtime - END - ELSE errno := Unix.errno(); - IF errno = Unix.ENOENT THEN err := "no such directory" - ELSIF (errno = Unix.ENFILE) OR (errno = Unix.EMFILE) THEN err := "too many files open" - ELSE err := "file not created" - END ; - Err(err, f, errno) - END - END - END Create; - - PROCEDURE Flush(buf: Buffer); - VAR res: LONGINT; f: File; stat: Unix.Status; - BEGIN - IF buf.chg THEN f := buf.f; Create(f); - IF buf.org # f.pos THEN res := Unix.Lseek(f.fd, buf.org, 0) END ; - res := Unix.Write(f.fd, SYSTEM.ADR(buf.data), buf.size); - IF res < 0 THEN Err("error in writing file", f, Unix.errno()) END ; - f.pos := buf.org + buf.size; - buf.chg := FALSE; - res := Unix.Fstat(f.fd, stat); - f.mtime := stat.mtime - END - END Flush; - - PROCEDURE Close* (f: File); - VAR i, res: LONGINT; - BEGIN - IF (f.state # create) OR (f.registerName # "") THEN - Create(f); i := 0; - WHILE (i < nofbufs) & (f.bufs[i] # NIL) DO Flush(f.bufs[i]); INC(i) END ; - res := Unix.Fsync(f.fd); - IF res < 0 THEN Err("error in writing file", f, Unix.errno()) END - END - END Close; - - PROCEDURE Length* (f: File): LONGINT; - BEGIN RETURN f.len - END Length; - - PROCEDURE New* (name: ARRAY OF CHAR): File; - VAR f: File; - BEGIN - NEW(f); f.workName := ""; COPY(name, f.registerName); - f.fd := noDesc; f.state := create; f.len := 0; f.pos := 0; f.swapper := -1; (*all f.buf[i] = NIL*) - RETURN f - END New; - - PROCEDURE ScanPath(VAR pos: INTEGER; VAR dir: ARRAY OF CHAR); (* supports ~, ~user and blanks inside path *) - VAR i: INTEGER; ch: CHAR; home: ARRAY 256 OF CHAR; - BEGIN - i := 0; ch := Kernel.OBERON[pos]; - WHILE (ch = " ") OR (ch = ":") DO INC(pos); ch := Kernel.OBERON[pos] END ; - IF ch = "~" THEN - INC(pos); ch := Kernel.OBERON[pos]; - home := ""; Args.GetEnv("HOME", home); - WHILE home[i] # 0X DO dir[i] := home[i]; INC(i) END ; - IF (ch # "/") & (ch # 0X) & (ch # ":") & (ch # " ") THEN - WHILE (i > 0) & (dir[i-1] # "/") DO DEC(i) END - END - END ; - WHILE (ch # 0X) & (ch # ":") DO dir[i] := ch; INC(i); INC(pos); ch := Kernel.OBERON[pos] END ; - WHILE (i > 0) & (dir[i-1] = " ") DO DEC(i) END ; - dir[i] := 0X - END ScanPath; - - PROCEDURE HasDir(VAR name: ARRAY OF CHAR): BOOLEAN; - VAR i: INTEGER; ch: CHAR; - BEGIN i := 0; ch := name[0]; - WHILE (ch # 0X) & (ch # "/") DO INC(i); ch := name[i] END ; - RETURN ch = "/" - END HasDir; - - PROCEDURE CacheEntry(dev, ino: LONGINT; mtime: LONGINT): File; - VAR f: File; i: INTEGER; stat: Unix.Status; res: LONGINT; - BEGIN i := 0; - WHILE i < fileTabSize DO - f := SYSTEM.VAL(File, fileTab[i]); - IF (f # NIL) & (ino = f.ino) & (dev = f.dev) THEN - IF mtime # f.mtime THEN i := 0; - WHILE i < nofbufs DO - IF f.bufs[i] # NIL THEN f.bufs[i].org := -1; f.bufs[i] := NIL END ; - INC(i) - END ; - f.swapper := -1; f.mtime := mtime; - res := Unix.Fstat(f.fd, stat); f.len := stat.size - END ; - RETURN f - END ; - INC(i) - END ; - RETURN NIL - END CacheEntry; - - PROCEDURE Old* (name: ARRAY OF CHAR): File; - VAR f: File; fd, res, errno: LONGINT; pos: INTEGER; done: BOOLEAN; - dir, path: ARRAY 256 OF CHAR; - stat: Unix.Status; - BEGIN - IF name # "" THEN - IF HasDir(name) THEN dir := ""; COPY(name, path) - ELSE pos := 0; ScanPath(pos, dir); MakeFileName(dir, name, path); ScanPath(pos, dir) - END ; - LOOP - fd := Unix.Open(path, Unix.rdwr, {}); done := fd >= 0; errno := Unix.errno(); - IF (~done & ((errno = Unix.ENFILE) OR (errno = Unix.EMFILE))) OR (done & (fd >= fileTabSize)) THEN - IF done & (fd >= fileTabSize) THEN res := Unix.Close(fd) END ; - Kernel.GC(TRUE); - fd := Unix.Open(path, Unix.rdwr, {}); - done := fd >= 0; errno := Unix.errno(); - IF ~done & ((errno = Unix.ENFILE) OR (errno = Unix.EMFILE)) THEN Err("too many files open", f, errno) END - END ; - IF ~done & ((errno = Unix.EACCES) OR (errno = Unix.EROFS) OR (errno = Unix.EAGAIN)) THEN - (* errno EAGAIN observed on Solaris 2.4 *) - fd := Unix.Open(path, Unix.rdonly, {}); done := fd >= 0; errno := Unix.errno() - END ; -IF (~done) & (errno # Unix.ENOENT) THEN - Console.String("warning Files0.Old "); Console.String(name); - Console.String(" errno = "); Console.Int(errno, 0); Console.Ln; -END ; - IF done THEN - res := Unix.Fstat(fd, stat); - f := CacheEntry(stat.dev, stat.ino, stat.mtime); - IF f # NIL THEN res := Unix.Close(fd); RETURN f - ELSIF fd >= fileTabSize THEN res := Unix.Close(fd); Err("too many files open", f, 0) - ELSE NEW(f); fileTab[fd] := SYSTEM.VAL(LONGINT, f); INC(Kernel.nofiles); Kernel.RegisterObject(f, Finalize); - f.fd := fd; f.state := open; f.len := stat.size; f.pos := 0; f.swapper := -1; (*all f.buf[i] = NIL*) - COPY(name, f.workName); f.registerName := ""; f.tempFile := FALSE; - f.dev := stat.dev; f.ino := stat.ino; f.mtime := stat.mtime; - RETURN f - END - ELSIF dir = "" THEN RETURN NIL - ELSE MakeFileName(dir, name, path); ScanPath(pos, dir) - END - END - ELSE RETURN NIL - END - END Old; - - PROCEDURE Purge* (f: File); - VAR i: INTEGER; stat: Unix.Status; res: LONGINT; - BEGIN i := 0; - WHILE i < nofbufs DO - IF f.bufs[i] # NIL THEN f.bufs[i].org := -1; f.bufs[i] := NIL END ; - INC(i) - END ; - IF f.fd # noDesc THEN res := Unix.Ftruncate(f.fd, 0); res := Unix.Lseek(f.fd, 0, 0) END ; - f.pos := 0; f.len := 0; f.swapper := -1; - res := Unix.Fstat(f.fd, stat); f.mtime := stat.mtime - END Purge; - - PROCEDURE GetDate* (f: File; VAR t, d: LONGINT); - VAR stat: Unix.Status; clock, res: LONGINT; time: Time; - BEGIN - Create(f); res := Unix.Fstat(f.fd, stat); - time := localtime(stat.mtime); - t := time.sec + ASH(time.min, 6) + ASH(time.hour, 12); - d := time.mday + ASH(time.mon+1, 5) + ASH(time.year MOD 100, 9) - END GetDate; - - PROCEDURE Pos* (VAR r: Rider): LONGINT; - BEGIN RETURN r.org + r.offset - END Pos; - - PROCEDURE Set* (VAR r: Rider; f: File; pos: LONGINT); - VAR org, offset, i, n, res: LONGINT; buf: Buffer; - BEGIN - IF f # NIL THEN - IF pos > f.len THEN pos := f.len ELSIF pos < 0 THEN pos := 0 END ; - offset := pos MOD bufsize; org := pos - offset; i := 0; - WHILE (i < nofbufs) & (f.bufs[i] # NIL) & (org # f.bufs[i].org) DO INC(i) END ; - IF i < nofbufs THEN - IF f.bufs[i] = NIL THEN NEW(buf); buf.chg := FALSE; buf.org := -1; buf.f := f; f.bufs[i] := buf - ELSE buf := f.bufs[i] - END - ELSE - f.swapper := (f.swapper + 1) MOD nofbufs; - buf := f.bufs[f.swapper]; - Flush(buf) - END ; - IF buf.org # org THEN - IF org = f.len THEN buf.size := 0 - ELSE Create(f); - IF f.pos # org THEN res := Unix.Lseek(f.fd, org, 0) END ; - n := Unix.ReadBlk(f.fd, buf.data); - IF n < 0 THEN Err("read from file not done", f, Unix.errno()) END ; - f.pos := org + n; - buf.size := n - END ; - buf.org := org; buf.chg := FALSE - END - ELSE buf := NIL; org := 0; offset := 0 - END ; - r.buf := buf; r.org := org; r.offset := offset; r.eof := FALSE; r.res := 0 - END Set; - - PROCEDURE Read* (VAR r: Rider; VAR x: SYSTEM.BYTE); - VAR offset: LONGINT; buf: Buffer; - BEGIN - buf := r.buf; offset := r.offset; - IF r.org # buf.org THEN Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset END ; - IF (offset < buf.size) THEN - x := buf.data[offset]; r.offset := offset + 1 - ELSIF r.org + offset < buf.f.len THEN - Set(r, r.buf.f, r.org + offset); - x := r.buf.data[0]; r.offset := 1 - ELSE - x := 0X; r.eof := TRUE - END - END Read; - - PROCEDURE ReadBytes* (VAR r: Rider; VAR x: ARRAY OF SYSTEM.BYTE; n: LONGINT); - VAR xpos, min, restInBuf, offset: LONGINT; buf: Buffer; - BEGIN - IF n > LEN(x) THEN IdxTrap END ; - xpos := 0; buf := r.buf; offset := r.offset; - WHILE n > 0 DO - IF (r.org # buf.org) OR (offset >= bufsize) THEN - Set(r, buf.f, r.org + offset); - buf := r.buf; offset := r.offset - END ; - restInBuf := buf.size - offset; - IF restInBuf = 0 THEN r.res := n; r.eof := TRUE; RETURN - ELSIF n > restInBuf THEN min := restInBuf ELSE min := n END ; - SYSTEM.MOVE(SYSTEM.ADR(buf.data) + offset, SYSTEM.ADR(x) + xpos, min); - INC(offset, min); r.offset := offset; INC(xpos, min); DEC(n, min) - END ; - r.res := 0; r.eof := FALSE - END ReadBytes; - - PROCEDURE ReadByte* (VAR r : Rider; VAR x : ARRAY OF SYSTEM.BYTE); - BEGIN - ReadBytes(r, x, 1); - END ReadByte; - - PROCEDURE Base* (VAR r: Rider): File; - BEGIN RETURN r.buf.f - END Base; - - PROCEDURE Write* (VAR r: Rider; x: SYSTEM.BYTE); - VAR buf: Buffer; offset: LONGINT; - BEGIN - buf := r.buf; offset := r.offset; - IF (r.org # buf.org) OR (offset >= bufsize) THEN - Set(r, buf.f, r.org + offset); - buf := r.buf; offset := r.offset - END ; - buf.data[offset] := x; - buf.chg := TRUE; - IF offset = buf.size THEN - INC(buf.size); INC(buf.f.len) - END ; - r.offset := offset + 1; r.res := 0 - END Write; - - PROCEDURE WriteBytes* (VAR r: Rider; VAR x: ARRAY OF SYSTEM.BYTE; n: LONGINT); - VAR xpos, min, restInBuf, offset: LONGINT; buf: Buffer; - BEGIN - IF n > LEN(x) THEN IdxTrap END ; - xpos := 0; buf := r.buf; offset := r.offset; - WHILE n > 0 DO - IF (r.org # buf.org) OR (offset >= bufsize) THEN - Set(r, buf.f, r.org + offset); - buf := r.buf; offset := r.offset - END ; - restInBuf := bufsize - offset; - IF n > restInBuf THEN min := restInBuf ELSE min := n END ; - SYSTEM.MOVE(SYSTEM.ADR(x) + xpos, SYSTEM.ADR(buf.data) + offset, min); - INC(offset, min); r.offset := offset; - IF offset > buf.size THEN INC(buf.f.len, offset - buf.size); buf.size := offset END ; - INC(xpos, min); DEC(n, min); buf.chg := TRUE - END ; - r.res := 0 - END WriteBytes; - -(* another solution would be one that is similar to ReadBytes, WriteBytes. -No code duplication, more symmetric, only two ifs for -Read and Write in buffer, buf.size replaced by bufsize in Write ops, buf.size and len -must be made consistent with offset (if offset > buf.size) in a lazy way. - -PROCEDURE Write* (VAR r: Rider; x: SYSTEM.BYTE); - VAR buf: Buffer; offset: LONGINT; -BEGIN - buf := r.buf; offset := r.offset; - IF (offset >= bufsize) OR (r.org # buf.org) THEN - Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset; - END ; - buf.data[offset] := x; r.offset := offset + 1; buf.chg := TRUE -END Write; - -PROCEDURE WriteBytes ... - -PROCEDURE Read* (VAR r: Rider; VAR x: SYSTEM.BYTE); - VAR offset: LONGINT; buf: Buffer; -BEGIN - buf := r.buf; offset := r.offset; - IF (offset >= buf.size) OR (r.org # buf.org) THEN - IF r.org + offset >= buf.f.len THEN x := 0X; r.eof := TRUE; RETURN - ELSE Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset - END - END ; - x := buf.data[offset]; r.offset := offset + 1 -END Read; - -but this would also affect Set, Length, and Flush. -Especially Length would become fairly complex. -*) - - PROCEDURE Delete* (name: ARRAY OF CHAR; VAR res: INTEGER); - BEGIN - res := SHORT(Unix.Unlink(name)); - res := SHORT(Unix.errno()) - END Delete; - - PROCEDURE Rename* (old, new: ARRAY OF CHAR; VAR res: INTEGER); - VAR fdold, fdnew, n, errno, r: LONGINT; - ostat, nstat: Unix.Status; - buf: ARRAY 4096 OF CHAR; - BEGIN - r := Unix.Stat(old, ostat); - IF r >= 0 THEN - r := Unix.Stat(new, nstat); - IF (r >= 0) & ((ostat.dev # nstat.dev) OR (ostat.ino # nstat.ino)) THEN - Delete(new, res); (* work around stale nfs handles *) - END ; - r := Unix.Rename(old, new); - IF r < 0 THEN res := SHORT(Unix.errno()); - IF res = Unix.EXDEV THEN (* cross device link, move the file *) - fdold := Unix.Open(old, Unix.rdonly, {}); - IF fdold < 0 THEN res := 2; RETURN END ; - fdnew := Unix.Open(new, Unix.rdwr + Unix.creat + Unix.trunc, {2, 4,5, 7,8}); - IF fdnew < 0 THEN r := Unix.Close(fdold); res := 3; RETURN END ; - n := Unix.Read(fdold, SYSTEM.ADR(buf), bufsize); - WHILE n > 0 DO - r := Unix.Write(fdnew, SYSTEM.ADR(buf), n); - IF r < 0 THEN errno := Unix.errno(); r := Unix.Close(fdold); r := Unix.Close(fdnew); - Err("cannot move file", NIL, errno) - END ; - n := Unix.Read(fdold, SYSTEM.ADR(buf), bufsize) - END ; - errno := Unix.errno(); - r := Unix.Close(fdold); r := Unix.Close(fdnew); - IF n = 0 THEN r := Unix.Unlink(old); res := 0 - ELSE Err("cannot move file", NIL, errno) - END ; - ELSE RETURN (* res is Unix.Rename return code *) - END - END ; - res := 0 - ELSE res := 2 (* old file not found *) - END - END Rename; - - PROCEDURE Register* (f: File); - VAR idx, errno: INTEGER; f1: File; file: ARRAY 104 OF CHAR; - BEGIN - IF (f.state = create) & (f.registerName # "") THEN f.state := close (* shortcut renaming *) END ; - Close(f); - IF f.registerName # "" THEN - Rename(f.workName, f.registerName, errno); - IF errno # 0 THEN COPY(f.registerName, file); HALT(99) END ; - f.workName := f.registerName; f.registerName := ""; f.tempFile := FALSE - END - END Register; - - PROCEDURE ChangeDirectory*(path: ARRAY OF CHAR; VAR res: INTEGER); - BEGIN - res := SHORT(Unix.Chdir(path)); - getcwd(Kernel.CWD) - END ChangeDirectory; - - PROCEDURE FlipBytes(VAR src, dest: ARRAY OF SYSTEM.BYTE); - VAR i, j: LONGINT; - BEGIN - IF ~Kernel.littleEndian THEN i := LEN(src); j := 0; - WHILE i > 0 DO DEC(i); dest[j] := src[i]; INC(j) END - ELSE SYSTEM.MOVE(SYSTEM.ADR(src), SYSTEM.ADR(dest), LEN(src)) - END - END FlipBytes; - - PROCEDURE ReadBool* (VAR R: Rider; VAR x: BOOLEAN); - BEGIN Read(R, SYSTEM.VAL(CHAR, x)) - END ReadBool; - - PROCEDURE ReadInt* (VAR R: Rider; VAR x: INTEGER); - VAR b: ARRAY 2 OF CHAR; - BEGIN ReadBytes(R, b, 2); - x := ORD(b[0]) + ORD(b[1])*256 - END ReadInt; - - PROCEDURE ReadLInt* (VAR R: Rider; VAR x: LONGINT); - VAR b: ARRAY 4 OF CHAR; - BEGIN ReadBytes(R, b, 4); - x := ORD(b[0]) + ORD(b[1])*100H + ORD(b[2])*10000H + ORD(b[3])*1000000H - END ReadLInt; - - PROCEDURE ReadSet* (VAR R: Rider; VAR x: SET); - VAR b: ARRAY 4 OF CHAR; - BEGIN ReadBytes(R, b, 4); - x := SYSTEM.VAL(SET, ORD(b[0]) + ORD(b[1])*100H + ORD(b[2])*10000H + ORD(b[3])*1000000H) - END ReadSet; - - PROCEDURE ReadReal* (VAR R: Rider; VAR x: REAL); - VAR b: ARRAY 4 OF CHAR; - BEGIN ReadBytes(R, b, 4); FlipBytes(b, x) - END ReadReal; - - PROCEDURE ReadLReal* (VAR R: Rider; VAR x: LONGREAL); - VAR b: ARRAY 8 OF CHAR; - BEGIN ReadBytes(R, b, 8); FlipBytes(b, x) - END ReadLReal; - - PROCEDURE ReadString* (VAR R: Rider; VAR x: ARRAY OF CHAR); - VAR i: INTEGER; ch: CHAR; - BEGIN i := 0; - REPEAT Read(R, ch); x[i] := ch; INC(i) UNTIL ch = 0X - END ReadString; - - PROCEDURE ReadNum* (VAR R: Rider; VAR x: LONGINT); - VAR s: SHORTINT; ch: CHAR; n: LONGINT; - BEGIN s := 0; n := 0; Read(R, ch); - WHILE ORD(ch) >= 128 DO INC(n, ASH(ORD(ch) - 128, s) ); INC(s, 7); Read(R, ch) END; - INC(n, ASH(ORD(ch) MOD 64 - ORD(ch) DIV 64 * 64, s) ); - x := n - END ReadNum; - - PROCEDURE WriteBool* (VAR R: Rider; x: BOOLEAN); - BEGIN Write(R, SYSTEM.VAL(CHAR, x)) - END WriteBool; - - PROCEDURE WriteInt* (VAR R: Rider; x: INTEGER); - VAR b: ARRAY 2 OF CHAR; - BEGIN b[0] := CHR(x); b[1] := CHR(x DIV 256); - WriteBytes(R, b, 2); - END WriteInt; - - PROCEDURE WriteLInt* (VAR R: Rider; x: LONGINT); - VAR b: ARRAY 4 OF CHAR; - BEGIN - b[0] := CHR(x); b[1] := CHR(x DIV 100H); b[2] := CHR(x DIV 10000H); b[3] := CHR(x DIV 1000000H); - WriteBytes(R, b, 4); - END WriteLInt; - - PROCEDURE WriteSet* (VAR R: Rider; x: SET); - VAR b: ARRAY 4 OF CHAR; i: LONGINT; - BEGIN i := SYSTEM.VAL(LONGINT, x); - 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; - - PROCEDURE WriteReal* (VAR R: Rider; x: REAL); - VAR b: ARRAY 4 OF CHAR; - BEGIN FlipBytes(x, b); WriteBytes(R, b, 4) - END WriteReal; - - PROCEDURE WriteLReal* (VAR R: Rider; x: LONGREAL); - VAR b: ARRAY 8 OF CHAR; - BEGIN FlipBytes(x, b); WriteBytes(R, b, 8) - END WriteLReal; - - PROCEDURE WriteString* (VAR R: Rider; x: ARRAY [1] OF CHAR); - VAR i: INTEGER; - BEGIN i := 0; - WHILE x[i] # 0X DO INC(i) END ; - WriteBytes(R, x, i+1) - END WriteString; - - PROCEDURE WriteNum* (VAR R: Rider; x: LONGINT); - BEGIN - WHILE (x < - 64) OR (x > 63) DO Write(R, CHR(x MOD 128 + 128)); x := x DIV 128 END; - Write(R, CHR(x MOD 128)) - END WriteNum; - - PROCEDURE Finalize(o: SYSTEM.PTR); - VAR f: File; res: LONGINT; - BEGIN - f := SYSTEM.VAL(File, o); - IF f.fd >= 0 THEN - fileTab[f.fd] := 0; res := Unix.Close(f.fd); f.fd := -1; DEC(Kernel.nofiles); - IF f.tempFile THEN res := Unix.Unlink(f.workName) END - END - END Finalize; - - PROCEDURE Init; - VAR i: LONGINT; - BEGIN - i := 0; WHILE i < fileTabSize DO fileTab[i] := 0; INC(i) END ; - tempno := -1; Kernel.nofiles := 0 - END Init; - -BEGIN Init -END Files0. diff --git a/src/system/linux/clang/armv6j_hardfp/SYSTEM.c0 b/src/system/linux/clang/armv6j_hardfp/SYSTEM.c0 deleted file mode 100644 index 580449aa..00000000 --- a/src/system/linux/clang/armv6j_hardfp/SYSTEM.c0 +++ /dev/null @@ -1,205 +0,0 @@ -/* -* The body prefix file of the Ofront runtime system, Version 1.0 -* -* Copyright (c) Software Templ, 1994, 1995 -* -* Module SYSTEM is subject to change any time without prior notification. -* Software Templ disclaims all warranties with regard to module SYSTEM, -* in particular shall Software Templ not be liable for any damage resulting -* from inappropriate use or modification of module SYSTEM. -* -* Version 1.1 jt, 24.11.95 fixes for correct pointer arithmetic on Cray computers -* jt 31.1.2007 ANSI prototypes for malloc and exit in order to avoid cc warnings -* -*/ - -#include "SYSTEM.h" -#ifdef __STDC__ -#include "stdarg.h" -#else -#include "varargs.h" -#endif - -extern void *malloc(long size); -extern void exit(int status); - -void (*SYSTEM_Halt)(); -LONGINT SYSTEM_halt; /* x in HALT(x) */ -LONGINT SYSTEM_assert; /* x in ASSERT(cond, x) */ -LONGINT SYSTEM_argc; -LONGINT SYSTEM_argv; -LONGINT SYSTEM_lock; -BOOLEAN SYSTEM_interrupted; -static LONGINT SYSTEM_mainfrm; /* adr of main proc stack frame, used for stack collection */ - -#define Lock SYSTEM_lock++ -#define Unlock SYSTEM_lock--; if (SYSTEM_interrupted && (SYSTEM_lock == 0)) __HALT(-9) - - -static void SYSTEM_InitHeap(); -void *SYSTEM__init(); - -void SYSTEM_INIT(argc, argvadr) - int argc; long argvadr; -{ - SYSTEM_mainfrm = argvadr; - SYSTEM_argc = argc; - SYSTEM_argv = *(long*)argvadr; - SYSTEM_InitHeap(); - SYSTEM_halt = -128; - SYSTEM__init(); -} - -void SYSTEM_FINI() -{ - SYSTEM_FINALL(); -} - -long SYSTEM_XCHK(i, ub) long i, ub; {return __X(i, ub);} -long SYSTEM_RCHK(i, ub) long i, ub; {return __R(i, ub);} -long SYSTEM_ASH(i, n) long i, n; {return __ASH(i, n);} -long SYSTEM_ABS(i) long i; {return __ABS(i);} -double SYSTEM_ABSD(i) double i; {return __ABS(i);} - -void SYSTEM_INHERIT(t, t0) - long *t, *t0; -{ - t -= __TPROC0OFF; - t0 -= __TPROC0OFF; - while (*t0 != __EOM) {*t = *t0; t--; t0--;} -} - -void SYSTEM_ENUMP(adr, n, P) - long *adr; - long n; - void (*P)(); -{ - while (n > 0) {P(*adr); adr++; n--;} -} - -void SYSTEM_ENUMR(adr, typ, size, n, P) - char *adr; - long *typ, size, n; - void (*P)(); -{ - long *t, off; - typ++; - while (n > 0) { - t = typ; - off = *t; - while (off >= 0) {P(*(long*)(adr+off)); t++; off = *t;} - adr += size; n--; - } -} - -long SYSTEM_DIV(x, y) - unsigned long x, y; -{ if ((long) x >= 0) return (x / y); - else return -((y - 1 - x) / y); -} - -long SYSTEM_MOD(x, y) - unsigned long x, y; -{ unsigned long m; - if ((long) x >= 0) return (x % y); - else { m = (-x) % y; - if (m != 0) return (y - m); else return 0; - } -} - -long SYSTEM_ENTIER(x) - double x; -{ - long y; - if (x >= 0) - return (long)x; - else { - y = (long)x; - if (y <= x) return y; else return y - 1; - } -} - -void SYSTEM_HALT(n) - int n; -{ - SYSTEM_halt = n; - if (SYSTEM_Halt!=0) SYSTEM_Halt(n); - exit(n); -} - -#ifdef __STDC__ -SYSTEM_PTR SYSTEM_NEWARR(long *typ, long elemsz, int elemalgn, int nofdim, int nofdyn, ...) -#else -SYSTEM_PTR SYSTEM_NEWARR(typ, elemsz, elemalgn, nofdim, nofdyn, va_alist) - long *typ, elemsz; - int elemalgn, nofdim, nofdyn; - va_dcl -#endif -{ - long nofelems, size, dataoff, n, nptr, *x, *p, nofptrs, i, *ptab, off; - va_list ap; -#ifdef __STDC__ - va_start(ap, nofdyn); -#else - va_start(ap); -#endif - nofelems = 1; - while (nofdim > 0) { - nofelems = nofelems * va_arg(ap, long); nofdim--; - if (nofelems <= 0) __HALT(-20); - } - va_end(ap); - dataoff = nofdyn * sizeof(long); - if (elemalgn > sizeof(long)) { - n = dataoff % elemalgn; - if (n != 0) dataoff += elemalgn - n; - } - size = dataoff + nofelems * elemsz; - Lock; - if (typ == NIL) { - /* element typ does not contain pointers */ - x = SYSTEM_NEWBLK(size); - } - else if (typ == POINTER__typ) { - /* element type is a pointer */ - x = SYSTEM_NEWBLK(size + nofelems * sizeof(long)); - p = (long*)x[-1]; - p[-nofelems] = *p; /* build new type desc in situ: 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ - p -= nofelems - 1; n = 1; /* n =1 for skipping the size field */ - while (n <= nofelems) {*p = n*sizeof(long); p++; n++;} - *p = - (nofelems + 1) * sizeof(long); /* sentinel */ - x[-1] -= nofelems * sizeof(long); - } - else { - /* element type is a record that contains pointers */ - ptab = typ + 1; nofptrs = 0; - while (ptab[nofptrs] >= 0) {nofptrs++;} /* number of pointers per element */ - nptr = nofelems * nofptrs; /* total number of pointers */ - x = SYSTEM_NEWBLK(size + nptr * sizeof(long)); - p = (long*)x[- 1]; - p[-nptr] = *p; /* build new type desc in situ; 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ - p -= nptr - 1; n = 0; off = dataoff; - while (n < nofelems) {i = 0; - while (i < nofptrs) {*p = off + ptab[i]; p++; i++;} - off += elemsz; n++; - } - *p = - (nptr + 1) * sizeof(long); /* sentinel */ - x[-1] -= nptr * sizeof(long); - } - if (nofdyn != 0) { - /* setup len vector for index checks */ -#ifdef __STDC__ - va_start(ap, nofdyn); -#else - va_start(ap); -#endif - p = x; - while (nofdyn > 0) {*p = va_arg(ap, long); p++, nofdyn--;} - va_end(ap); - } - Unlock; - return x; -} - -/* ----------- end of SYSTEM.co ------------- */ - diff --git a/src/system/linux/clang/armv6j_hardfp/SYSTEM.h b/src/system/linux/clang/armv6j_hardfp/SYSTEM.h deleted file mode 100644 index ea9ae5d6..00000000 --- a/src/system/linux/clang/armv6j_hardfp/SYSTEM.h +++ /dev/null @@ -1,220 +0,0 @@ -#ifndef SYSTEM__h -#define SYSTEM__h - -/* - -the Ofront runtime system interface and macros library -copyright (c) Josef Templ, 1995, 1996 - -gcc for Linux version (same as SPARC/Solaris2) -uses double # as concatenation operator - -*/ - -#include -#include /* for type sizes -- noch */ - -//extern void *memcpy(void *dest, const void *src, long n); -extern void *memcpy(void *dest, const void *src, size_t n); -extern void *malloc(long size); -extern void exit(int status); - -#define export -#define import extern - -/* constants */ -#define __MAXEXT 16 -#define NIL 0L -#define POINTER__typ (long*)1L /* not NIL and not a valid type */ - -/* basic types */ -typedef char BOOLEAN; -typedef unsigned char CHAR; -typedef signed char SHORTINT; -typedef short int INTEGER; -typedef long LONGINT; -typedef float REAL; -typedef double LONGREAL; -typedef unsigned long SET; -typedef void *SYSTEM_PTR; -typedef unsigned char SYSTEM_BYTE; -typedef int8_t SYSTEM_INT8; -typedef int16_t SYSTEM_INT16; -typedef int32_t SYSTEM_INT32; -typedef int64_t SYSTEM_INT64; - -/* runtime system routines */ -extern long SYSTEM_DIV(); -extern long SYSTEM_MOD(); -extern long SYSTEM_ENTIER(); -extern long SYSTEM_ASH(); -extern long SYSTEM_ABS(); -extern long SYSTEM_XCHK(); -extern long SYSTEM_RCHK(); -extern double SYSTEM_ABSD(); -extern SYSTEM_PTR SYSTEM_NEWREC(); -extern SYSTEM_PTR SYSTEM_NEWBLK(); -#ifdef __STDC__ -extern SYSTEM_PTR SYSTEM_NEWARR(long*, long, int, int, int, ...); -#else -extern SYSTEM_PTR SYSTEM_NEWARR(); -#endif -extern SYSTEM_PTR SYSTEM_REGMOD(); -extern void SYSTEM_INCREF(); -extern void SYSTEM_REGCMD(); -extern void SYSTEM_REGTYP(); -extern void SYSTEM_REGFIN(); -extern void SYSTEM_FINALL(); -extern void SYSTEM_INIT(); -extern void SYSTEM_FINI(); -extern void SYSTEM_HALT(); -extern void SYSTEM_INHERIT(); -extern void SYSTEM_ENUMP(); -extern void SYSTEM_ENUMR(); - -/* module registry */ -#define __DEFMOD static void *m; if(m!=0)return m -#define __REGMOD(name, enum) if(m==0)m=SYSTEM_REGMOD((CHAR*)name,enum); else return m -#define __ENDMOD return m -#define __INIT(argc, argv) static void *m; SYSTEM_INIT(argc, (long)&argv); -#define __REGMAIN(name, enum) m=SYSTEM_REGMOD(name,enum) -#define __FINI SYSTEM_FINI(); return 0 -#define __IMPORT(name) SYSTEM_INCREF(name##__init()) -#define __REGCMD(name, cmd) SYSTEM_REGCMD(m, name, cmd) - -/* SYSTEM ops */ -#define __SYSNEW(p, len) p=SYSTEM_NEWBLK((long)(len)) -#define __VAL(t, x) (*(t*)&(x)) -#define __GET(a, x, t) x= *(t*)(a) -#define __PUT(a, x, t) *(t*)(a)=x -#define __LSHL(x, n, t) ((t)((unsigned)(x)<<(n))) -#define __LSHR(x, n, t) ((t)((unsigned)(x)>>(n))) -#define __LSH(x, n, t) ((n)>=0? __LSHL(x, n, t): __LSHR(x, -(n), t)) -#define __ROTL(x, n, t) ((t)((unsigned)(x)<<(n)|(unsigned)(x)>>(8*sizeof(t)-(n)))) -#define __ROTR(x, n, t) ((t)((unsigned)(x)>>(n)|(unsigned)(x)<<(8*sizeof(t)-(n)))) -#define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) -#define __BIT(x, n) (*(unsigned long*)(x)>>(n)&1) -#define __MOVE(s, d, n) memcpy((char*)(d),(char*)(s),n) - -/* std procs and operator mappings */ -#define __SHORT(x, y) ((int)((unsigned long)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) -#define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) -#define __CHR(x) ((CHAR)__R(x, 256)) -#define __CHRF(x) ((CHAR)__RF(x, 256)) -#define __DIV(x, y) ((x)>=0?(x)/(y):-(((y)-1-(x))/(y))) -#define __DIVF(x, y) SYSTEM_DIV((long)(x),(long)(y)) -#define __MOD(x, y) ((x)>=0?(x)%(y):__MODF(x,y)) -#define __MODF(x, y) SYSTEM_MOD((long)(x),(long)(y)) -#define __NEW(p, t) p=SYSTEM_NEWREC((long)t##__typ) -#define __NEWARR SYSTEM_NEWARR -#define __HALT(x) SYSTEM_HALT(x) -#define __ASSERT(cond, x) if (!(cond)) {SYSTEM_assert = x; SYSTEM_HALT(-1);} -#define __ENTIER(x) SYSTEM_ENTIER(x) -#define __ABS(x) (((x)<0)?-(x):(x)) -#define __ABSF(x) SYSTEM_ABS((long)(x)) -#define __ABSFD(x) SYSTEM_ABSD((double)(x)) -#define __CAP(ch) ((CHAR)((ch)&0x5f)) -#define __ODD(x) ((x)&1) -#define __IN(x, s) (((s)>>(x))&1) -#define __SETOF(x) ((SET)1<<(x)) -#define __SETRNG(l, h) ((~(SET)0<<(l))&~(SET)0>>(8*sizeof(SET)-1-(h))) -#define __MASK(x, m) ((x)&~(m)) -#define __COPY(s, d, n) {char*_a=(void*)s,*_b=(void*)d;long _i=0,_t=n-1;while(_i<_t&&((_b[_i]=_a[_i])!=0)){_i++;};_b[_i]=0;} -static int __STRCMP(x, y) - CHAR *x, *y; -{long i = 0; CHAR ch1, ch2; - do {ch1 = x[i]; ch2 = y[i]; i++; - if (!ch1) return -(int)ch2; - } while (ch1==ch2); - return (int)ch1 - (int)ch2; -} -#define __ASH(x, n) ((n)>=0?__ASHL(x,n):__ASHR(x,-(n))) -#define __ASHL(x, n) ((long)(x)<<(n)) -#define __ASHR(x, n) ((long)(x)>>(n)) -#define __ASHF(x, n) SYSTEM_ASH((long)(x), (long)(n)) -#define __DUP(x, l, t) x=(void*)memcpy(alloca(l*sizeof(t)),x,l*sizeof(t)) -#define __DUPARR(v, t) v=(void*)memcpy(v##__copy,v,sizeof(t)) -#define __DEL(x) /* DUP with alloca frees storage automatically */ -#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(long)typ##__typ) -#define __TYPEOF(p) (*(((long**)(p))-1)) -#define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) - -/* runtime checks */ -#define __X(i, ub) (((unsigned)(long)(i)<(unsigned long)(ub))?i:(__HALT(-2),0)) -#define __XF(i, ub) SYSTEM_XCHK((long)(i), (long)(ub)) -#define __RETCHK __retchk: __HALT(-3) -#define __CASECHK __HALT(-4) -#define __GUARDP(p, typ, level) ((typ*)(__ISP(p,typ,level)?p:(__HALT(-5),p))) -#define __GUARDR(r, typ, level) (*((typ*)(__IS(r##__typ,typ,level)?r:(__HALT(-5),r)))) -#define __GUARDA(p, typ, level) ((struct typ*)(__IS(__TYPEOF(p),typ,level)?p:(__HALT(-5),p))) -#define __GUARDEQR(p, dyntyp, typ) if(dyntyp!=typ##__typ) __HALT(-6);*(p) -#define __GUARDEQP(p, typ) if(__TYPEOF(p)!=typ##__typ)__HALT(-6);*(p) -#define __WITHCHK __HALT(-7) -#define __R(i, ub) (((unsigned)(long)(i)<(unsigned long)(ub))?i:(__HALT(-8),0)) -#define __RF(i, ub) SYSTEM_RCHK((long)(i),(long)(ub)) - -/* record type descriptors */ -#define __TDESC(t, m, n) \ - static struct t##__desc {\ - long tproc[m]; \ - long tag, next, level, module; \ - char name[24]; \ - long *base[__MAXEXT]; \ - char *rsrvd; \ - long blksz, ptr[n+1]; \ - } t##__desc - -#define __BASEOFF (__MAXEXT+1) -#define __TPROC0OFF (__BASEOFF+24/sizeof(long)+5) -#define __EOM 1 -#define __TDFLDS(name, size) {__EOM}, 1, 0, 0, 0, name, {0}, 0, size -#define __ENUMP(adr, n, P) SYSTEM_ENUMP(adr, (long)(n), P) -#define __ENUMR(adr, typ, size, n, P) SYSTEM_ENUMR(adr, typ, (long)(size), (long)(n), P) - -#define __INITYP(t, t0, level) \ - t##__typ= &t##__desc.blksz; \ - memcpy(t##__desc.base, t0##__typ - __BASEOFF, level*sizeof(long)); \ - t##__desc.base[level]=t##__typ; \ - t##__desc.module=(long)m; \ - if(t##__desc.blksz!=sizeof(struct t)) __HALT(-15); \ - t##__desc.blksz=(t##__desc.blksz+5*sizeof(long)-1)/(4*sizeof(long))*(4*sizeof(long)); \ - SYSTEM_REGTYP(m, (long)&t##__desc.next); \ - SYSTEM_INHERIT(t##__typ, t0##__typ) - -/* Oberon-2 type bound procedures support */ -#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(long)proc -#define __SEND(typ, num, funtyp, parlist) ((funtyp)(*(typ-(__TPROC0OFF+num))))parlist - -/* runtime system variables */ -extern LONGINT SYSTEM_argc; -extern LONGINT SYSTEM_argv; -extern void (*SYSTEM_Halt)(); -extern LONGINT SYSTEM_halt; -extern LONGINT SYSTEM_assert; -extern SYSTEM_PTR SYSTEM_modules; -extern LONGINT SYSTEM_heapsize; -extern LONGINT SYSTEM_allocated; -extern LONGINT SYSTEM_lock; -extern SHORTINT SYSTEM_gclock; -extern BOOLEAN SYSTEM_interrupted; - -/* ANSI prototypes; not used so far -static int __STRCMP(CHAR *x, CHAR *y); -void SYSTEM_INIT(int argc, long argvadr); -void SYSTEM_FINI(void); -long SYSTEM_XCHK(long i, long ub); -long SYSTEM_RCHK(long i, long ub); -long SYSTEM_ASH(long i, long n); -long SYSTEM_ABS(long i); -double SYSTEM_ABSD(double i); -void SYSTEM_INHERIT(long *t, long *t0); -void SYSTEM_ENUMP(long *adr, long n, void (*P)(void*)); -void SYSTEM_ENUMR(char *adr, long *typ, long size, long n, void (*P)(void*)); -long SYSTEM_DIV(unsigned long x, unsigned long y); -long SYSTEM_MOD(unsigned long x, unsigned long y); -long SYSTEM_ENTIER(double x); -void SYSTEM_HALT(int n); -*/ - -#endif - diff --git a/src/system/linux/clang/armv6j_hardfp/Unix.Mod b/src/system/linux/clang/armv6j_hardfp/Unix.Mod deleted file mode 100644 index a882720a..00000000 --- a/src/system/linux/clang/armv6j_hardfp/Unix.Mod +++ /dev/null @@ -1,482 +0,0 @@ -MODULE Unix; (* Josef Templ, 5.3.90 Linux system calls *) -(* system procedure added by noch *) -(* Module Unix provides a system call interface to Linux. - Naming conventions: - Procedure and Type-names always start with a capital letter. - error numbers as defined in Unix - other constants start with lower case letters *) - -IMPORT SYSTEM; - -CONST - -(* various important constants *) - - stdin* = 0; stdout* =1; stderr* = 2; - - LOCKEX* = 2; LOCKUN* = 8; (* /usr/include/file.h *) - AFINET* = 2; (* /usr/include/sys/socket.h *) - PFINET* = AFINET; (* /usr/include/linux/socket.h *) - SOCKSTREAM* = 1; (* /usr/include/linux/socket.h *) - FIONREAD* = 541BH; (* in /usr/include/asm/termios.h *) - SETFL* = 4; (* set file descriptor flags; in asm/fcntl.h *) - TCP* = 0; - -(* flag sets, cf. /usr/include/asm/fcntl.h *) - rdonly* = {}; wronly* = {0}; rdwr* = {1}; creat* = {6}; excl* = {7}; trunc* = {9}; append* = {10}; ndelay = {11}; - -(* error numbers *) - - EPERM* = 1; (* Not owner *) - ENOENT* = 2; (* No such file or directory *) - ESRCH* = 3; (* No such process *) - EINTR* = 4; (* Interrupted system call *) - EIO* = 5; (* I/O error *) - ENXIO* = 6; (* No such device or address *) - E2BIG* = 7; (* Arg list too long *) - ENOEXEC* = 8; (* Exec format error *) - EBADF* = 9; (* Bad file number *) - ECHILD* = 10; (* No children *) - EAGAIN* = 11; (* No more processes *) - ENOMEM* = 12; (* Not enough core *) - EACCES* = 13; (* Permission denied *) - EFAULT* = 14; (* Bad address *) - ENOTBLK* = 15; (* Block device required *) - EBUSY* = 16; (* Mount device busy *) - EEXIST* = 17; (* File exists *) - EXDEV* = 18; (* Cross-device link *) - ENODEV* = 19; (* No such device *) - ENOTDIR* = 20; (* Not a directory*) - EISDIR* = 21; (* Is a directory *) - EINVAL* = 22; (* Invalid argument *) - ENFILE* = 23; (* File table overflow *) - EMFILE* = 24; (* Too many open files *) - ENOTTY* = 25; (* Not a typewriter *) - ETXTBSY* = 26; (* Text file busy *) - EFBIG* = 27; (* File too large *) - ENOSPC* = 28; (* No space left on device *) - ESPIPE* = 29; (* Illegal seek *) - EROFS* = 30; (* Read-only file system *) - EMLINK* = 31; (* Too many links *) - EPIPE* = 32; (* Broken pipe *) - EDOM* = 33; (* Argument too large *) - ERANGE* = 34; (* Result too large *) - EDEADLK* = 35; (* Resource deadlock would occur *) - ENAMETOOLONG* = 36; (* File name too long *) - ENOLCK* = 37; (* No record locks available *) - ENOSYS* = 38; (* Function not implemented *) - ENOTEMPTY* = 39; (* Directory not empty *) - ELOOP* = 40; (* Too many symbolic links encountered *) - EWOULDBLOCK* = EAGAIN; (* Operation would block *) - ENOMSG* = 42; (* No message of desired type *) - EIDRM* = 43; (* Identifier removed *) - ECHRNG* = 44; (* Channel number out of range *) - EL2NSYNC* = 45; (* Level 2 not synchronized *) - EL3HLT* = 46; (* Level 3 halted *) - EL3RST* = 47; (* Level 3 reset *) - ELNRNG* = 48; (* Link number out of range *) - EUNATCH* = 49; (* Protocol driver not attached *) - ENOCSI* = 50; (* No CSI structure available *) - EL2HLT* = 51; (* Level 2 halted *) - EBADE* = 52; (* Invalid exchange *) - EBADR* = 53; (* Invalid request descriptor *) - EXFULL* = 54; (* Exchange full *) - ENOANO* = 55; (* No anode *) - EBADRQC* = 56; (* Invalid request code *) - EBADSLT* = 57; (* Invalid slot *) - EDEADLOCK* = 58; (* File locking deadlock error *) - EBFONT* = 59; (* Bad font file format *) - ENOSTR* = 60; (* Device not a stream *) - ENODATA* = 61; (* No data available *) - ETIME* = 62; (* Timer expired *) - ENOSR* = 63; (* Out of streams resources *) - ENONET* = 64; (* Machine is not on the network *) - ENOPKG* = 65; (* Package not installed *) - EREMOTE* = 66; (* Object is remote *) - ENOLINK* = 67; (* Link has been severed *) - EADV* = 68; (* Advertise error *) - ESRMNT* = 69; (* Srmount error *) - ECOMM* = 70; (* Communication error on send *) - EPROTO* = 71; (* Protocol error *) - EMULTIHOP* = 72; (* Multihop attempted *) - EDOTDOT* = 73; (* RFS specific error *) - EBADMSG* = 74; (* Not a data message *) - EOVERFLOW* = 75; (* Value too large for defined data type *) - ENOTUNIQ* = 76; (* Name not unique on network *) - EBADFD* = 77; (* File descriptor in bad state *) - EREMCHG* = 78; (* Remote address changed *) - ELIBACC* = 79; (* Can not access a needed shared library *) - ELIBBAD* = 80; (* Accessing a corrupted shared library *) - ELIBSCN* = 81; (* .lib section in a.out corrupted *) - ELIBMAX* = 82; (* Attempting to link in too many shared libraries *) - ELIBEXEC* = 83; (* Cannot exec a shared library directly *) - EILSEQ* = 84; (* Illegal byte sequence *) - ERESTART* = 85; (* Interrupted system call should be restarted *) - ESTRPIPE* = 86; (* Streams pipe error *) - EUSERS* = 87; (* Too many users *) - ENOTSOCK* = 88; (* Socket operation on non-socket *) - EDESTADDRREQ* = 89; (* Destination address required *) - EMSGSIZE* = 90; (* Message too long *) - EPROTOTYPE* = 91; (* Protocol wrong type for socket *) - ENOPROTOOPT* = 92; (* Protocol not available *) - EPROTONOSUPPORT* = 93; (* Protocol not supported *) - ESOCKTNOSUPPORT* = 94; (* Socket type not supported *) - EOPNOTSUPP* = 95; (* Operation not supported on transport endpoint *) - EPFNOSUPPORT* = 96; (* Protocol family not supported *) - EAFNOSUPPORT* = 97; (* Address family not supported by protocol *) - EADDRINUSE* = 98; (* Address already in use *) - EADDRNOTAVAIL* = 99; (* Cannot assign requested address *) - ENETDOWN* = 100; (* Network is down *) - ENETUNREACH* = 101; (* Network is unreachable *) - ENETRESET* = 102; (* Network dropped connection because of reset *) - ECONNABORTED* = 103; (* Software caused connection abort *) - ECONNRESET* = 104; (* Connection reset by peer *) - ENOBUFS* = 105; (* No buffer space available *) - EISCONN* = 106; (* Transport endpoint is already connected *) - ENOTCONN* = 107; (* Transport endpoint is not connected *) - ESHUTDOWN* = 108; (* Cannot send after transport endpoint shutdown *) - ETOOMANYREFS* = 109; (* Too many references: cannot splice *) - ETIMEDOUT* = 110; (* Connection timed out *) - ECONNREFUSED* = 111; (* Connection refused *) - EHOSTDOWN* = 112; (* Host is down *) - EHOSTUNREACH* = 113; (* No route to host *) - EALREADY* = 114; (* Operation already in progress *) - EINPROGRESS* = 115; (* Operation now in progress *) - ESTALE* = 116; (* Stale NFS file handle *) - EUCLEAN* = 117; (* Structure needs cleaning *) - ENOTNAM* = 118; (* Not a XENIX named type file *) - ENAVAIL* = 119; (* No XENIX semaphores available *) - EISNAM* = 120; (* Is a named type file *) - EREMOTEIO* = 121; (* Remote I/O error *) - EDQUOT* = 122; (* Quota exceeded *) - - -TYPE - (* cpp /usr/include/setjmp.h - struct __jmp_buf_tag - { - __jmp_buf __jmpbuf; - int __mask_was_saved; - __sigset_t __saved_mask; - }; - - typedef struct __jmp_buf_tag jmp_buf[1]; - - __sigset_t is 128 byte long in glibc on arm, x86, x86_64 - __jmp_buf is 24 bytes long in glibc on x86 - 256 bytes long in glibc on armv6 - 64 bytes long in glibc on x86_64 - - *) - JmpBuf* = RECORD - jmpbuf: ARRAY 64 OF LONGINT; (* 256 / 4 = 64 *) - maskWasSaved*: LONGINT; - savedMask*: ARRAY 32 OF LONGINT; (* 32 * 4 = 128 *) - unknown*: LONGINT; (* jmp_buf seems to have unknown 4 bytes field at the end (see http://hastebin.com/conujujeyu.pl) which is not defined in header file *) - END ; - - Status* = RECORD (* struct stat *) - dev*, devX*: LONGINT; (* 64 bit in Linux 2.2 *) - pad1: INTEGER; - ino*, mode*, nlink*, uid*, gid*: LONGINT; - rdev*, rdevX*: LONGINT; (* 64 bit in Linux 2.2 *) - pad2: INTEGER; - size*, blksize*, blocks*, atime*, unused1*, mtime*, unused2*, ctime*, - unused3*, unused4*, unused5*: LONGINT; - END ; - - Timeval* = RECORD - sec*, usec*: LONGINT - END ; - - Timezone* = RECORD - minuteswest*, dsttime*: LONGINT - END ; - - Itimerval* = RECORD - interval*, value*: Timeval - END ; - - FdSet* = ARRAY 8 OF SET; - - SigCtxPtr* = POINTER TO SigContext; - SigContext* = RECORD - END ; - - SignalHandler* = PROCEDURE (sig, code: LONGINT; scp: SigCtxPtr); - - Dirent* = RECORD - ino, off: LONGINT; - reclen: INTEGER; - name: ARRAY 256 OF CHAR; - END ; - - Rusage* = RECORD - utime*, stime*: Timeval; - maxrss*, ixrss*, idrss*, isrss*, - minflt*, majflt*, nswap*, inblock*, - oublock*, msgsnd*, msgrcv*, nsignals*, - nvcsw*, nivcsw*: LONGINT - END ; - - Iovec* = RECORD - base*, len*: LONGINT - END ; - - SocketPair* = ARRAY 2 OF LONGINT; - - Pollfd* = RECORD - fd*: LONGINT; - events*, revents*: INTEGER - END ; - - Sockaddr* = RECORD - family*: INTEGER; - port*: INTEGER; - internetAddr*: LONGINT; - pad*: ARRAY 8 OF CHAR; - END ; - - HostEntry* = POINTER [1] TO Hostent; - Hostent* = RECORD - name*, aliases*: LONGINT; - addrtype*, length*: LONGINT; - addrlist*: LONGINT; (*POINTER TO POINTER TO LONGINT, network byte order*) - END; - - Name* = ARRAY OF CHAR; - - PROCEDURE -includeStat() - "#include "; - - PROCEDURE -includeErrno() - "#include "; - - (* for read(), write() and sleep() *) - PROCEDURE -includeUnistd() - "#include "; - - (* for system() *) -(* commented, doesn't compile on 32bit GNU/Linux platforms - PROCEDURE -includeStdlib() - "#include "; -*) - (* for nanosleep() *) - PROCEDURE -includeTime() - "#include "; - - (* for select() *) - PROCEDURE -includeSelect() - "#include "; - - PROCEDURE -err(): LONGINT - "errno"; - - PROCEDURE errno*(): LONGINT; - BEGIN - RETURN err() - END errno; - - PROCEDURE -Exit*(n: LONGINT) - "exit(n)"; - - PROCEDURE -Fork*(): LONGINT - "fork()"; - - PROCEDURE -Wait*(VAR status: LONGINT): LONGINT - "wait(status)"; - - PROCEDURE -Select*(width: LONGINT; VAR readfds, writefds, exceptfds: FdSet; VAR timeout: Timeval): LONGINT - "select(width, readfds, writefds, exceptfds, timeout)"; - - PROCEDURE -Gettimeofday* (VAR tv: Timeval; VAR tz: Timezone) : LONGINT - "gettimeofday(tv, tz)"; - - PROCEDURE -Read* (fd, buf, nbyte: LONGINT): LONGINT - "read(fd, buf, nbyte)"; - - PROCEDURE -ReadBlk* (fd: LONGINT; VAR buf: ARRAY OF SYSTEM.BYTE): LONGINT - "read(fd, buf, buf__len)"; - - PROCEDURE -Write* (fd, buf, nbyte: LONGINT): LONGINT - "write(fd, buf, nbyte)"; - - PROCEDURE -WriteBlk* (fd: LONGINT; VAR buf: ARRAY OF SYSTEM.BYTE): LONGINT - "write(fd, buf, buf__len)"; - - PROCEDURE -Dup*(fd: LONGINT): LONGINT - "dup(fd)"; - - PROCEDURE -Dup2*(fd1, fd2: LONGINT): LONGINT - "dup(fd1, fd2)"; - - PROCEDURE -Pipe*(fds : LONGINT): LONGINT - "pipe(fds)"; - - PROCEDURE -Getpid*(): LONGINT - "getpid()"; - - PROCEDURE -Getuid*(): LONGINT - "getuid()"; - - PROCEDURE -Geteuid*(): LONGINT - "geteuid()"; - - PROCEDURE -Getgid*(): LONGINT - "getgid()"; - - PROCEDURE -Getegid*(): LONGINT - "getegid()"; - - PROCEDURE -Unlink*(name: Name): LONGINT - "unlink(name)"; - - PROCEDURE -Open*(name: Name; flag, mode: SET): LONGINT - "open(name, flag, mode)"; - - PROCEDURE -Close*(fd: LONGINT): LONGINT - "close(fd)"; - - PROCEDURE -stat(name: Name; VAR statbuf: Status): LONGINT - "stat((const char*)name, (struct stat*)statbuf)"; - - PROCEDURE Stat*(name: Name; VAR statbuf: Status): LONGINT; - VAR res: LONGINT; - BEGIN - res := stat(name, statbuf); - (* make the first 4 bytes as unique as possible (used in module Files for caching!) *) - INC(statbuf.dev, statbuf.devX); - INC(statbuf.rdev, statbuf.rdevX); - RETURN res; - END Stat; - - PROCEDURE -fstat(fd: LONGINT; VAR statbuf: Status): LONGINT - "fstat(fd, (struct stat*)statbuf)"; - - PROCEDURE Fstat*(fd: LONGINT; VAR statbuf: Status): LONGINT; - VAR res: LONGINT; - BEGIN - res := fstat(fd, statbuf); - (* make the first 4 bytes as unique as possible (used in module Files for caching!) *) - INC(statbuf.dev, statbuf.devX); - INC(statbuf.rdev, statbuf.rdevX); - RETURN res; - END Fstat; - - PROCEDURE -Fchmod*(fd, mode: LONGINT): LONGINT - "fchmod(fd, mode)"; - - PROCEDURE -Chmod*(path: Name; mode: LONGINT): LONGINT - "chmod(path, mode)"; - - PROCEDURE -Lseek*(fd, offset, origin: LONGINT): LONGINT - "lseek(fd, offset, origin)"; - - PROCEDURE -Fsync*(fd: LONGINT): LONGINT - "fsync(fd)"; - - PROCEDURE -Fcntl*(fd, cmd, arg: LONGINT ): LONGINT - "fcntl(fd, cmd, arg)"; - - PROCEDURE -Flock*(fd, operation: LONGINT): LONGINT - "flock(fd, operation)"; - - PROCEDURE -Ftruncate*(fd, length: LONGINT): LONGINT - "ftruncate(fd, length)"; - - PROCEDURE -Readblk*(fd: LONGINT; VAR buf: ARRAY OF SYSTEM.BYTE; len: LONGINT): LONGINT - "read(fd, buf, len)"; - - PROCEDURE -Rename*(old, new: Name): LONGINT - "rename(old, new)"; - - PROCEDURE -Chdir*(path: Name): LONGINT - "chdir(path)"; - - PROCEDURE -Ioctl*(fd, request, arg: LONGINT): LONGINT - "ioctl(fd, request, arg)"; - - PROCEDURE -Kill*(pid, sig: LONGINT): LONGINT - "kill(pid, sig)"; - - PROCEDURE -Sigsetmask*(mask: LONGINT): LONGINT - "sigsetmask(mask)"; - - PROCEDURE -Sleep*(ms : LONGINT): LONGINT - "sleep(ms)"; - - PROCEDURE -Nanosleep*(VAR req : Timeval; VAR rem : Timeval): LONGINT - "nanosleep(req, rem)"; - - (* TCP/IP networking *) - - PROCEDURE -Gethostbyname*(name: Name): HostEntry - "(Unix_HostEntry)gethostbyname(name)"; - - PROCEDURE -Gethostname*(VAR name: Name): LONGINT - "gethostname(name, name__len)"; - - PROCEDURE -Socket*(af, type, protocol: LONGINT): LONGINT - "socket(af, type, protocol)"; - - PROCEDURE -Connect*(socket: LONGINT; name: Sockaddr; namelen: LONGINT): LONGINT - "connect(socket, &(name), namelen)"; - - PROCEDURE -Getsockname*(socket: LONGINT; VAR name: Sockaddr; VAR namelen: LONGINT): LONGINT - "getsockname(socket, name, namelen)"; - - PROCEDURE -Bind*(socket: LONGINT; name: Sockaddr; namelen: LONGINT): LONGINT - "bind(socket, &(name), namelen)"; - - PROCEDURE -Listen*(socket, backlog: LONGINT): LONGINT - "listen(socket, backlog)"; - - PROCEDURE -Accept*(socket: LONGINT; VAR addr: Sockaddr; VAR addrlen: LONGINT): LONGINT - "accept(socket, addr, addrlen)"; - - PROCEDURE -Recv*(socket, bufadr, buflen, flags: LONGINT): LONGINT - "recv(socket, bufadr, buflen, flags)"; - - PROCEDURE -Send*(socket, bufadr, buflen, flags: LONGINT): LONGINT - "send(socket, bufadr, buflen, flags)"; - - PROCEDURE -sys(str: ARRAY OF CHAR): INTEGER (* need this to call external tools like gcc or gas; noch *) - "system(str)"; - - PROCEDURE system*(cmd : ARRAY OF CHAR); - VAR r : INTEGER; - BEGIN - r := sys(cmd); - END system; - - PROCEDURE System*(cmd : ARRAY OF CHAR): INTEGER; - VAR r : INTEGER; - BEGIN - r := sys(cmd); - RETURN r - END System; - - PROCEDURE -SizeofUnixStat(): INTEGER - "sizeof(Unix_Status)"; - - PROCEDURE -SizeofStat(): INTEGER - "sizeof(struct stat)"; - - PROCEDURE -Error(msg: ARRAY OF CHAR; len: INTEGER) - "write(1/*stdout*/, msg, len); char ch = 0xa; write(1, &ch, 1)"; - - PROCEDURE StatCheck; - VAR x, y: LONGINT; - BEGIN - x := SizeofUnixStat(); - y := SizeofStat(); - IF x # y THEN - Error("Unix.StatCheck: inconsistent usage of struct stat", 49); - Exit(1); - END - END StatCheck; - -BEGIN - - StatCheck(); -END Unix. diff --git a/src/system/linux/clang/powerpc/Args.Mod b/src/system/linux/clang/powerpc/Args.Mod deleted file mode 100644 index c6b7b56e..00000000 --- a/src/system/linux/clang/powerpc/Args.Mod +++ /dev/null @@ -1,65 +0,0 @@ -MODULE Args; (* jt, 8.12.94 *) - - (* command line argument handling for voc (jet backend) *) - - - IMPORT SYSTEM; - - TYPE - ArgPtr = POINTER TO ARRAY 1024 OF CHAR; - ArgVec = POINTER TO ARRAY 1024 OF ArgPtr; - - VAR argc-, argv-: LONGINT; - (*PROCEDURE -includestdlib() "#include ";*) - PROCEDURE -externgetenv() "extern char *getenv(const char *name);"; (* took this from stdlib.h*) - PROCEDURE -Argc(): INTEGER "SYSTEM_argc"; - PROCEDURE -Argv(): LONGINT "(long)SYSTEM_argv"; - PROCEDURE -getenv(var: ARRAY OF CHAR): ArgPtr - "(Args_ArgPtr)getenv(var)"; - - PROCEDURE Get*(n: INTEGER; VAR val: ARRAY OF CHAR); - VAR av: ArgVec; - BEGIN - IF n < argc THEN av := SYSTEM.VAL(ArgVec, argv); COPY(av[n]^, val) END - END Get; - - PROCEDURE GetInt*(n: INTEGER; VAR val: LONGINT); - VAR s: ARRAY 64 OF CHAR; k, d, i: LONGINT; - BEGIN - s := ""; Get(n, s); i := 0; - IF s[0] = "-" THEN i := 1 END ; - k := 0; d := ORD(s[i]) - ORD("0"); - WHILE (d >= 0 ) & (d <= 9) DO k := k*10 + d; INC(i); d := ORD(s[i]) - ORD("0") END ; - IF s[0] = "-" THEN d := -d; DEC(i) END ; - IF i > 0 THEN val := k END - END GetInt; - - PROCEDURE Pos*(s: ARRAY OF CHAR): INTEGER; - VAR i: INTEGER; arg: ARRAY 256 OF CHAR; - BEGIN - i := 0; Get(i, arg); - WHILE (i < argc) & (s # arg) DO INC(i); Get(i, arg) END ; - RETURN i - END Pos; - - PROCEDURE GetEnv*(var: ARRAY OF CHAR; VAR val: ARRAY OF CHAR); - VAR p: ArgPtr; - BEGIN - p := getenv(var); - IF p # NIL THEN COPY(p^, val) END - END GetEnv; - - PROCEDURE getEnv*(var: ARRAY OF CHAR; VAR val: ARRAY OF CHAR): BOOLEAN; - VAR p: ArgPtr; - BEGIN - p := getenv(var); - IF p # NIL THEN - COPY(p^, val); - RETURN TRUE - ELSE - RETURN FALSE - END - END getEnv; - -BEGIN argc := Argc(); argv := Argv() -END Args. diff --git a/src/system/linux/clang/powerpc/Files.Mod b/src/system/linux/clang/powerpc/Files.Mod deleted file mode 100644 index 6307407d..00000000 --- a/src/system/linux/clang/powerpc/Files.Mod +++ /dev/null @@ -1,663 +0,0 @@ -MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files *) -(* modified version of Files, which opens only the file provided and does not scan any path in any environment variable, also ReadLine procedure added; -- noch *) - IMPORT SYSTEM, Unix, Kernel, Args, Console; - - (* standard data type I/O - - little endian, - Sint:1, Int:2, Lint:4 - ORD({0}) = 1, - false = 0, true =1 - IEEE real format, - null terminated strings, - compact numbers according to M.Odersky *) - - - CONST - nofbufs = 4; - bufsize = 4096; - fileTabSize = 64; - noDesc = -1; - notDone = -1; - - (* file states *) - open = 0; create = 1; close = 2; - - - TYPE - FileName = ARRAY 101 OF CHAR; - File* = POINTER TO Handle; - Buffer = POINTER TO BufDesc; - - Handle = RECORD - workName, registerName: FileName; - tempFile: BOOLEAN; - dev, ino, mtime: LONGINT; - fd-, len, pos: LONGINT; - bufs: ARRAY nofbufs OF Buffer; - swapper, state: INTEGER - END ; - - BufDesc = RECORD - f: File; - chg: BOOLEAN; - org, size: LONGINT; - data: ARRAY bufsize OF SYSTEM.BYTE - END ; - - Rider* = RECORD - res*: LONGINT; - eof*: BOOLEAN; - buf: Buffer; - org, offset: LONGINT - END ; - - Time = POINTER TO TimeDesc; - TimeDesc = RECORD - sec*, min*, hour*, mday*, mon*, year*, wday*, isdst*, zone*, gmtoff*: LONGINT; -(* sec*, min*, hour*, mday*, mon*, year*, wday*, isdst*, zone*, gmtoff*: INTEGER;*) - END ; - - VAR - fileTab: ARRAY fileTabSize OF LONGINT (*=File*); - tempno: INTEGER; - -(* for localtime *) - PROCEDURE -includetime() - '#include "time.h"'; - - PROCEDURE -localtime(VAR clock: LONGINT): Time - "(Files_Time) localtime(clock)"; - - PROCEDURE -getcwd(VAR cwd: Unix.Name) - "getcwd(cwd, cwd__len)"; - - PROCEDURE -IdxTrap "__HALT(-1)"; - - PROCEDURE^ Finalize(o: SYSTEM.PTR); - - PROCEDURE Err(s: ARRAY OF CHAR; f: File; errno: LONGINT); - BEGIN - Console.Ln; Console.String("-- "); Console.String(s); Console.String(": "); - IF f # NIL THEN - IF f.registerName # "" THEN Console.String(f.registerName) ELSE Console.String(f.workName) END - END ; - IF errno # 0 THEN Console.String(" errno = "); Console.Int(errno, 1) END ; - Console.Ln; - HALT(99) - END Err; - - PROCEDURE MakeFileName(dir, name: ARRAY OF CHAR; VAR dest: ARRAY OF CHAR); - VAR i, j: INTEGER; - BEGIN i := 0; j := 0; - WHILE dir[i] # 0X DO dest[i] := dir[i]; INC(i) END ; - IF dest[i-1] # "/" THEN dest[i] := "/"; INC(i) END ; - WHILE name[j] # 0X DO dest[i] := name[j]; INC(i); INC(j) END ; - dest[i] := 0X - END MakeFileName; - - PROCEDURE GetTempName(finalName: ARRAY OF CHAR; VAR name: ARRAY OF CHAR); - VAR n, i, j: LONGINT; - BEGIN - INC(tempno); n := tempno; i := 0; - IF finalName[0] # "/" THEN (* relative pathname *) - WHILE Kernel.CWD[i] # 0X DO name[i] := Kernel.CWD[i]; INC(i) END; - IF Kernel.CWD[i-1] # "/" THEN name[i] := "/"; INC(i) END - END; - j := 0; - WHILE finalName[j] # 0X DO name[i] := finalName[j]; INC(i); INC(j) END; - DEC(i); - WHILE name[i] # "/" DO DEC(i) END; - name[i+1] := "."; name[i+2] := "t"; name[i+3] := "m"; name[i+4] := "p"; name[i+5] := "."; INC(i, 6); - WHILE n > 0 DO name[i] := CHR(n MOD 10 + ORD("0")); n := n DIV 10; INC(i) END; - name[i] := "."; INC(i); n := SHORT(Unix.Getpid()); - WHILE n > 0 DO name[i] := CHR(n MOD 10 + ORD("0")); n := n DIV 10; INC(i) END; - name[i] := 0X - END GetTempName; - - PROCEDURE Create(f: File); - VAR stat: Unix.Status; done: BOOLEAN; - errno: LONGINT; err: ARRAY 32 OF CHAR; - BEGIN - IF f.fd = noDesc THEN - IF f.state = create THEN GetTempName(f.registerName, f.workName); f.tempFile := TRUE - ELSIF f.state = close THEN - f.workName := f.registerName; f.registerName := ""; f.tempFile := FALSE - END ; - errno := Unix.Unlink(f.workName); (*unlink first to avoid stale NFS handles and to avoid reuse of inodes*) - f.fd := Unix.Open(f.workName, Unix.rdwr + Unix.creat + Unix.trunc, {2, 4,5, 7,8}); - done := f.fd >= 0; errno := Unix.errno(); - IF (~done & ((errno = Unix.ENFILE) OR (errno = Unix.EMFILE))) OR (done & (f.fd >= fileTabSize)) THEN - IF done & (f.fd >= fileTabSize) THEN errno := Unix.Close(f.fd) END ; - Kernel.GC(TRUE); - f.fd := Unix.Open(f.workName, Unix.rdwr + Unix.creat + Unix.trunc, {2, 4,5, 7,8}); - done := f.fd >= 0 - END ; - IF done THEN - IF f.fd >= fileTabSize THEN errno := Unix.Close(f.fd); Err("too many files open", f, 0) - ELSE fileTab[f.fd] := SYSTEM.VAL(LONGINT, f); INC(Kernel.nofiles); Kernel.RegisterObject(f, Finalize); - f.state := open; f.pos := 0; errno := Unix.Fstat(f.fd, stat); - f.dev := stat.dev; f.ino := stat.ino; f.mtime := stat.mtime - END - ELSE errno := Unix.errno(); - IF errno = Unix.ENOENT THEN err := "no such directory" - ELSIF (errno = Unix.ENFILE) OR (errno = Unix.EMFILE) THEN err := "too many files open" - ELSE err := "file not created" - END ; - Err(err, f, errno) - END - END - END Create; - - PROCEDURE Flush(buf: Buffer); - VAR res: LONGINT; f: File; stat: Unix.Status; - BEGIN - IF buf.chg THEN f := buf.f; Create(f); - IF buf.org # f.pos THEN res := Unix.Lseek(f.fd, buf.org, 0) END ; - res := Unix.Write(f.fd, SYSTEM.ADR(buf.data), buf.size); - IF res < 0 THEN Err("error in writing file", f, Unix.errno()) END ; - f.pos := buf.org + buf.size; - buf.chg := FALSE; - res := Unix.Fstat(f.fd, stat); - f.mtime := stat.mtime - END - END Flush; - - PROCEDURE Close* (f: File); - VAR i, res: LONGINT; - BEGIN - IF (f.state # create) OR (f.registerName # "") THEN - Create(f); i := 0; - WHILE (i < nofbufs) & (f.bufs[i] # NIL) DO Flush(f.bufs[i]); INC(i) END ; - res := Unix.Fsync(f.fd); - IF res < 0 THEN Err("error in writing file", f, Unix.errno()) END - END - END Close; - - PROCEDURE Length* (f: File): LONGINT; - BEGIN RETURN f.len - END Length; - - PROCEDURE New* (name: ARRAY OF CHAR): File; - VAR f: File; - BEGIN - NEW(f); f.workName := ""; COPY(name, f.registerName); - f.fd := noDesc; f.state := create; f.len := 0; f.pos := 0; f.swapper := -1; (*all f.buf[i] = NIL*) - RETURN f - END New; -(* - PROCEDURE ScanPath(VAR pos: INTEGER; VAR dir: ARRAY OF CHAR); (* supports ~, ~user and blanks inside path *) - VAR i: INTEGER; ch: CHAR; home: ARRAY 256 OF CHAR; - BEGIN - i := 0; ch := Kernel.OBERON[pos]; - WHILE (ch = " ") OR (ch = ":") DO INC(pos); ch := Kernel.OBERON[pos] END ; - IF ch = "~" THEN - INC(pos); ch := Kernel.OBERON[pos]; - home := ""; Args.GetEnv("HOME", home); - WHILE home[i] # 0X DO dir[i] := home[i]; INC(i) END ; - IF (ch # "/") & (ch # 0X) & (ch # ":") & (ch # " ") THEN - WHILE (i > 0) & (dir[i-1] # "/") DO DEC(i) END - END - END ; - WHILE (ch # 0X) & (ch # ":") DO dir[i] := ch; INC(i); INC(pos); ch := Kernel.OBERON[pos] END ; - WHILE (i > 0) & (dir[i-1] = " ") DO DEC(i) END ; - dir[i] := 0X - END ScanPath; -*) - PROCEDURE HasDir(VAR name: ARRAY OF CHAR): BOOLEAN; - VAR i: INTEGER; ch: CHAR; - BEGIN i := 0; ch := name[0]; - WHILE (ch # 0X) & (ch # "/") DO INC(i); ch := name[i] END ; - RETURN ch = "/" - END HasDir; - - PROCEDURE CacheEntry(dev, ino: LONGINT; mtime: LONGINT): File; - VAR f: File; i: INTEGER; stat: Unix.Status; res: LONGINT; - BEGIN i := 0; - WHILE i < fileTabSize DO - f := SYSTEM.VAL(File, fileTab[i]); - IF (f # NIL) & (ino = f.ino) & (dev = f.dev) THEN - IF mtime # f.mtime THEN i := 0; - WHILE i < nofbufs DO - IF f.bufs[i] # NIL THEN f.bufs[i].org := -1; f.bufs[i] := NIL END ; - INC(i) - END ; - f.swapper := -1; f.mtime := mtime; - res := Unix.Fstat(f.fd, stat); f.len := stat.size - END ; - RETURN f - END ; - INC(i) - END ; - RETURN NIL - END CacheEntry; - - PROCEDURE Old* (name: ARRAY OF CHAR): File; - VAR f: File; fd, res, errno: LONGINT; pos: INTEGER; done: BOOLEAN; - dir, path: ARRAY 256 OF CHAR; - stat: Unix.Status; - BEGIN - IF name # "" THEN - IF HasDir(name) THEN dir := ""; COPY(name, path) - ELSE - pos := 0; - COPY(name, path); (* -- noch *) - (*ScanPath(pos, dir);*) (*MakeFileName(dir, name, path);*) (*ScanPath(pos, dir)*) - END ; - LOOP - fd := Unix.Open(path, Unix.rdwr, {}); done := fd >= 0; errno := Unix.errno(); - IF (~done & ((errno = Unix.ENFILE) OR (errno = Unix.EMFILE))) OR (done & (fd >= fileTabSize)) THEN - IF done & (fd >= fileTabSize) THEN res := Unix.Close(fd) END ; - Kernel.GC(TRUE); - fd := Unix.Open(path, Unix.rdwr, {}); - done := fd >= 0; errno := Unix.errno(); - IF ~done & ((errno = Unix.ENFILE) OR (errno = Unix.EMFILE)) THEN Err("too many files open", f, errno) END - END ; - IF ~done & ((errno = Unix.EACCES) OR (errno = Unix.EROFS) OR (errno = Unix.EAGAIN)) THEN - (* errno EAGAIN observed on Solaris 2.4 *) - fd := Unix.Open(path, Unix.rdonly, {}); done := fd >= 0; errno := Unix.errno() - END ; -IF (~done) & (errno # Unix.ENOENT) THEN - Console.String("warning Files.Old "); Console.String(name); - Console.String(" errno = "); Console.Int(errno, 0); Console.Ln; -END ; - IF done THEN - res := Unix.Fstat(fd, stat); - f := CacheEntry(stat.dev, stat.ino, stat.mtime); - IF f # NIL THEN res := Unix.Close(fd); RETURN f - ELSIF fd >= fileTabSize THEN res := Unix.Close(fd); Err("too many files open", f, 0) - ELSE NEW(f); fileTab[fd] := SYSTEM.VAL(LONGINT, f); INC(Kernel.nofiles); Kernel.RegisterObject(f, Finalize); - f.fd := fd; f.state := open; f.len := stat.size; f.pos := 0; f.swapper := -1; (*all f.buf[i] = NIL*) - COPY(name, f.workName); f.registerName := ""; f.tempFile := FALSE; - f.dev := stat.dev; f.ino := stat.ino; f.mtime := stat.mtime; - RETURN f - END - ELSIF dir = "" THEN RETURN NIL - ELSE (*MakeFileName(dir, name, path);*) (*ScanPath(pos, dir)*) - RETURN NIL - END - END - ELSE RETURN NIL - END - END Old; - - PROCEDURE Purge* (f: File); - VAR i: INTEGER; stat: Unix.Status; res: LONGINT; - BEGIN i := 0; - WHILE i < nofbufs DO - IF f.bufs[i] # NIL THEN f.bufs[i].org := -1; f.bufs[i] := NIL END ; - INC(i) - END ; - IF f.fd # noDesc THEN res := Unix.Ftruncate(f.fd, 0); res := Unix.Lseek(f.fd, 0, 0) END ; - f.pos := 0; f.len := 0; f.swapper := -1; - res := Unix.Fstat(f.fd, stat); f.mtime := stat.mtime - END Purge; - - PROCEDURE GetDate* (f: File; VAR t, d: LONGINT); - VAR stat: Unix.Status; clock, res: LONGINT; time: Time; - BEGIN - Create(f); res := Unix.Fstat(f.fd, stat); - time := localtime(stat.mtime); - t := time.sec + ASH(time.min, 6) + ASH(time.hour, 12); - d := time.mday + ASH(time.mon+1, 5) + ASH(time.year MOD 100, 9) - END GetDate; - - PROCEDURE Pos* (VAR r: Rider): LONGINT; - BEGIN RETURN r.org + r.offset - END Pos; - - PROCEDURE Set* (VAR r: Rider; f: File; pos: LONGINT); - VAR org, offset, i, n, res: LONGINT; buf: Buffer; - BEGIN - IF f # NIL THEN - IF pos > f.len THEN pos := f.len ELSIF pos < 0 THEN pos := 0 END ; - offset := pos MOD bufsize; org := pos - offset; i := 0; - WHILE (i < nofbufs) & (f.bufs[i] # NIL) & (org # f.bufs[i].org) DO INC(i) END ; - IF i < nofbufs THEN - IF f.bufs[i] = NIL THEN NEW(buf); buf.chg := FALSE; buf.org := -1; buf.f := f; f.bufs[i] := buf - ELSE buf := f.bufs[i] - END - ELSE - f.swapper := (f.swapper + 1) MOD nofbufs; - buf := f.bufs[f.swapper]; - Flush(buf) - END ; - IF buf.org # org THEN - IF org = f.len THEN buf.size := 0 - ELSE Create(f); - IF f.pos # org THEN res := Unix.Lseek(f.fd, org, 0) END ; - n := Unix.ReadBlk(f.fd, buf.data); - IF n < 0 THEN Err("read from file not done", f, Unix.errno()) END ; - f.pos := org + n; - buf.size := n - END ; - buf.org := org; buf.chg := FALSE - END - ELSE buf := NIL; org := 0; offset := 0 - END ; - r.buf := buf; r.org := org; r.offset := offset; r.eof := FALSE; r.res := 0 - END Set; - - PROCEDURE Read* (VAR r: Rider; VAR x: SYSTEM.BYTE); - VAR offset: LONGINT; buf: Buffer; - BEGIN - buf := r.buf; offset := r.offset; - IF r.org # buf.org THEN Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset END ; - IF (offset < buf.size) THEN - x := buf.data[offset]; r.offset := offset + 1 - ELSIF r.org + offset < buf.f.len THEN - Set(r, r.buf.f, r.org + offset); - x := r.buf.data[0]; r.offset := 1 - ELSE - x := 0X; r.eof := TRUE - END - END Read; - - PROCEDURE ReadBytes* (VAR r: Rider; VAR x: ARRAY OF SYSTEM.BYTE; n: LONGINT); - VAR xpos, min, restInBuf, offset: LONGINT; buf: Buffer; - BEGIN - IF n > LEN(x) THEN IdxTrap END ; - xpos := 0; buf := r.buf; offset := r.offset; - WHILE n > 0 DO - IF (r.org # buf.org) OR (offset >= bufsize) THEN - Set(r, buf.f, r.org + offset); - buf := r.buf; offset := r.offset - END ; - restInBuf := buf.size - offset; - IF restInBuf = 0 THEN r.res := n; r.eof := TRUE; RETURN - ELSIF n > restInBuf THEN min := restInBuf ELSE min := n END ; - SYSTEM.MOVE(SYSTEM.ADR(buf.data) + offset, SYSTEM.ADR(x) + xpos, min); - INC(offset, min); r.offset := offset; INC(xpos, min); DEC(n, min) - END ; - r.res := 0; r.eof := FALSE - END ReadBytes; - - PROCEDURE ReadByte* (VAR r : Rider; VAR x : ARRAY OF SYSTEM.BYTE); - BEGIN - ReadBytes(r, x, 1); - END ReadByte; - - PROCEDURE Base* (VAR r: Rider): File; - BEGIN RETURN r.buf.f - END Base; - - PROCEDURE Write* (VAR r: Rider; x: SYSTEM.BYTE); - VAR buf: Buffer; offset: LONGINT; - BEGIN - buf := r.buf; offset := r.offset; - IF (r.org # buf.org) OR (offset >= bufsize) THEN - Set(r, buf.f, r.org + offset); - buf := r.buf; offset := r.offset - END ; - buf.data[offset] := x; - buf.chg := TRUE; - IF offset = buf.size THEN - INC(buf.size); INC(buf.f.len) - END ; - r.offset := offset + 1; r.res := 0 - END Write; - - PROCEDURE WriteByte* (VAR r : Rider; x : SYSTEM.BYTE); (* added for compatibility with PO 2013, -- noch *) - BEGIN - Write(r, x); - END WriteByte; - - PROCEDURE WriteBytes* (VAR r: Rider; VAR x: ARRAY OF SYSTEM.BYTE; n: LONGINT); - VAR xpos, min, restInBuf, offset: LONGINT; buf: Buffer; - BEGIN - IF n > LEN(x) THEN IdxTrap END ; - xpos := 0; buf := r.buf; offset := r.offset; - WHILE n > 0 DO - IF (r.org # buf.org) OR (offset >= bufsize) THEN - Set(r, buf.f, r.org + offset); - buf := r.buf; offset := r.offset - END ; - restInBuf := bufsize - offset; - IF n > restInBuf THEN min := restInBuf ELSE min := n END ; - SYSTEM.MOVE(SYSTEM.ADR(x) + xpos, SYSTEM.ADR(buf.data) + offset, min); - INC(offset, min); r.offset := offset; - IF offset > buf.size THEN INC(buf.f.len, offset - buf.size); buf.size := offset END ; - INC(xpos, min); DEC(n, min); buf.chg := TRUE - END ; - r.res := 0 - END WriteBytes; - -(* another solution would be one that is similar to ReadBytes, WriteBytes. -No code duplication, more symmetric, only two ifs for -Read and Write in buffer, buf.size replaced by bufsize in Write ops, buf.size and len -must be made consistent with offset (if offset > buf.size) in a lazy way. - -PROCEDURE Write* (VAR r: Rider; x: SYSTEM.BYTE); - VAR buf: Buffer; offset: LONGINT; -BEGIN - buf := r.buf; offset := r.offset; - IF (offset >= bufsize) OR (r.org # buf.org) THEN - Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset; - END ; - buf.data[offset] := x; r.offset := offset + 1; buf.chg := TRUE -END Write; - - -PROCEDURE WriteBytes ... - -PROCEDURE Read* (VAR r: Rider; VAR x: SYSTEM.BYTE); - VAR offset: LONGINT; buf: Buffer; -BEGIN - buf := r.buf; offset := r.offset; - IF (offset >= buf.size) OR (r.org # buf.org) THEN - IF r.org + offset >= buf.f.len THEN x := 0X; r.eof := TRUE; RETURN - ELSE Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset - END - END ; - x := buf.data[offset]; r.offset := offset + 1 -END Read; - -but this would also affect Set, Length, and Flush. -Especially Length would become fairly complex. -*) - - PROCEDURE Delete* (name: ARRAY OF CHAR; VAR res: INTEGER); - BEGIN - res := SHORT(Unix.Unlink(name)); - res := SHORT(Unix.errno()) - END Delete; - - PROCEDURE Rename* (old, new: ARRAY OF CHAR; VAR res: INTEGER); - VAR fdold, fdnew, n, errno, r: LONGINT; - ostat, nstat: Unix.Status; - buf: ARRAY 4096 OF CHAR; - BEGIN - r := Unix.Stat(old, ostat); - IF r >= 0 THEN - r := Unix.Stat(new, nstat); - IF (r >= 0) & ((ostat.dev # nstat.dev) OR (ostat.ino # nstat.ino)) THEN - Delete(new, res); (* work around stale nfs handles *) - END ; - r := Unix.Rename(old, new); - IF r < 0 THEN res := SHORT(Unix.errno()); - IF res = Unix.EXDEV THEN (* cross device link, move the file *) - fdold := Unix.Open(old, Unix.rdonly, {}); - IF fdold < 0 THEN res := 2; RETURN END ; - fdnew := Unix.Open(new, Unix.rdwr + Unix.creat + Unix.trunc, {2, 4,5, 7,8}); - IF fdnew < 0 THEN r := Unix.Close(fdold); res := 3; RETURN END ; - n := Unix.Read(fdold, SYSTEM.ADR(buf), bufsize); - WHILE n > 0 DO - r := Unix.Write(fdnew, SYSTEM.ADR(buf), n); - IF r < 0 THEN errno := Unix.errno(); r := Unix.Close(fdold); r := Unix.Close(fdnew); - Err("cannot move file", NIL, errno) - END ; - n := Unix.Read(fdold, SYSTEM.ADR(buf), bufsize) - END ; - errno := Unix.errno(); - r := Unix.Close(fdold); r := Unix.Close(fdnew); - IF n = 0 THEN r := Unix.Unlink(old); res := 0 - ELSE Err("cannot move file", NIL, errno) - END ; - ELSE RETURN (* res is Unix.Rename return code *) - END - END ; - res := 0 - ELSE res := 2 (* old file not found *) - END - END Rename; - - PROCEDURE Register* (f: File); - VAR idx, errno: INTEGER; f1: File; file: ARRAY 104 OF CHAR; - BEGIN - IF (f.state = create) & (f.registerName # "") THEN f.state := close (* shortcut renaming *) END ; - Close(f); - IF f.registerName # "" THEN - Rename(f.workName, f.registerName, errno); - IF errno # 0 THEN COPY(f.registerName, file); HALT(99) END ; - f.workName := f.registerName; f.registerName := ""; f.tempFile := FALSE - END - END Register; - - PROCEDURE ChangeDirectory*(path: ARRAY OF CHAR; VAR res: INTEGER); - BEGIN - res := SHORT(Unix.Chdir(path)); - getcwd(Kernel.CWD) - END ChangeDirectory; - - PROCEDURE FlipBytes(VAR src, dest: ARRAY OF SYSTEM.BYTE); - VAR i, j: LONGINT; - BEGIN - IF ~Kernel.littleEndian THEN i := LEN(src); j := 0; - WHILE i > 0 DO DEC(i); dest[j] := src[i]; INC(j) END - ELSE SYSTEM.MOVE(SYSTEM.ADR(src), SYSTEM.ADR(dest), LEN(src)) - END - END FlipBytes; - - PROCEDURE ReadBool* (VAR R: Rider; VAR x: BOOLEAN); - BEGIN Read(R, SYSTEM.VAL(CHAR, x)) - END ReadBool; - - PROCEDURE ReadInt* (VAR R: Rider; VAR x: INTEGER); - VAR b: ARRAY 2 OF CHAR; - BEGIN ReadBytes(R, b, 2); - x := ORD(b[0]) + ORD(b[1])*256 - END ReadInt; - - PROCEDURE ReadLInt* (VAR R: Rider; VAR x: LONGINT); - VAR b: ARRAY 4 OF CHAR; - BEGIN ReadBytes(R, b, 4); - x := ORD(b[0]) + ORD(b[1])*100H + ORD(b[2])*10000H + ORD(b[3])*1000000H - END ReadLInt; - - PROCEDURE ReadSet* (VAR R: Rider; VAR x: SET); - VAR b: ARRAY 4 OF CHAR; - BEGIN ReadBytes(R, b, 4); - x := SYSTEM.VAL(SET, ORD(b[0]) + ORD(b[1])*100H + ORD(b[2])*10000H + ORD(b[3])*1000000H) - END ReadSet; - - PROCEDURE ReadReal* (VAR R: Rider; VAR x: REAL); - VAR b: ARRAY 4 OF CHAR; - BEGIN ReadBytes(R, b, 4); FlipBytes(b, x) - END ReadReal; - - PROCEDURE ReadLReal* (VAR R: Rider; VAR x: LONGREAL); - VAR b: ARRAY 8 OF CHAR; - BEGIN ReadBytes(R, b, 8); FlipBytes(b, x) - END ReadLReal; - - PROCEDURE ReadString* (VAR R: Rider; VAR x: ARRAY OF CHAR); - VAR i: INTEGER; ch: CHAR; - BEGIN i := 0; - REPEAT Read(R, ch); x[i] := ch; INC(i) UNTIL ch = 0X - END ReadString; - - (* need to read line; -- noch *) - PROCEDURE ReadLine* (VAR R: Rider; VAR x: ARRAY OF CHAR); - VAR i: INTEGER; ch: CHAR; b : BOOLEAN; - BEGIN i := 0; - b := FALSE; - REPEAT - Read(R, ch); - IF ((ch = 0X) OR (ch = 0AX) OR (ch = 0DX)) THEN - b := TRUE - ELSE - x[i] := ch; - INC(i); - END; - UNTIL b - END ReadLine; - - PROCEDURE ReadNum* (VAR R: Rider; VAR x: LONGINT); - VAR s: SHORTINT; ch: CHAR; n: LONGINT; - BEGIN s := 0; n := 0; Read(R, ch); - WHILE ORD(ch) >= 128 DO INC(n, ASH(ORD(ch) - 128, s) ); INC(s, 7); Read(R, ch) END; - INC(n, ASH(ORD(ch) MOD 64 - ORD(ch) DIV 64 * 64, s) ); - x := n - END ReadNum; - - PROCEDURE WriteBool* (VAR R: Rider; x: BOOLEAN); - BEGIN Write(R, SYSTEM.VAL(CHAR, x)) - END WriteBool; - - PROCEDURE WriteInt* (VAR R: Rider; x: INTEGER); - VAR b: ARRAY 2 OF CHAR; - BEGIN b[0] := CHR(x); b[1] := CHR(x DIV 256); - WriteBytes(R, b, 2); - END WriteInt; - - PROCEDURE WriteLInt* (VAR R: Rider; x: LONGINT); - VAR b: ARRAY 4 OF CHAR; - BEGIN - b[0] := CHR(x); b[1] := CHR(x DIV 100H); b[2] := CHR(x DIV 10000H); b[3] := CHR(x DIV 1000000H); - WriteBytes(R, b, 4); - END WriteLInt; - - PROCEDURE WriteSet* (VAR R: Rider; x: SET); - VAR b: ARRAY 4 OF CHAR; i: LONGINT; - BEGIN i := SYSTEM.VAL(LONGINT, x); - 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; - - PROCEDURE WriteReal* (VAR R: Rider; x: REAL); - VAR b: ARRAY 4 OF CHAR; - BEGIN FlipBytes(x, b); WriteBytes(R, b, 4) - END WriteReal; - - PROCEDURE WriteLReal* (VAR R: Rider; x: LONGREAL); - VAR b: ARRAY 8 OF CHAR; - BEGIN FlipBytes(x, b); WriteBytes(R, b, 8) - END WriteLReal; - - PROCEDURE WriteString* (VAR R: Rider; x: ARRAY [1] OF CHAR); - VAR i: INTEGER; - BEGIN i := 0; - WHILE x[i] # 0X DO INC(i) END ; - WriteBytes(R, x, i+1) - END WriteString; - - PROCEDURE WriteNum* (VAR R: Rider; x: LONGINT); - BEGIN - WHILE (x < - 64) OR (x > 63) DO Write(R, CHR(x MOD 128 + 128)); x := x DIV 128 END; - Write(R, CHR(x MOD 128)) - END WriteNum; - - PROCEDURE GetName*(f: File; VAR name: ARRAY OF CHAR); - BEGIN - COPY (f.workName, name); - END GetName; - - PROCEDURE Finalize(o: SYSTEM.PTR); - VAR f: File; res: LONGINT; - BEGIN - f := SYSTEM.VAL(File, o); - IF f.fd >= 0 THEN - fileTab[f.fd] := 0; res := Unix.Close(f.fd); f.fd := -1; DEC(Kernel.nofiles); - IF f.tempFile THEN res := Unix.Unlink(f.workName) END - END - END Finalize; - - PROCEDURE Init; - VAR i: LONGINT; - BEGIN - i := 0; WHILE i < fileTabSize DO fileTab[i] := 0; INC(i) END ; - tempno := -1; Kernel.nofiles := 0 - END Init; - -BEGIN Init -END Files. diff --git a/src/system/linux/clang/powerpc/Files0.Mod b/src/system/linux/clang/powerpc/Files0.Mod deleted file mode 100644 index 4f021ede..00000000 --- a/src/system/linux/clang/powerpc/Files0.Mod +++ /dev/null @@ -1,635 +0,0 @@ -MODULE Files0; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files *) - -(* this module is not for use by developers and inteded to bootstrap voc *) -(* for general use import Files module *) - - IMPORT SYSTEM, Unix, Kernel := Kernel0, Args, Console; - - (* standard data type I/O - - little endian, - Sint:1, Int:2, Lint:4 - ORD({0}) = 1, - false = 0, true =1 - IEEE real format, - null terminated strings, - compact numbers according to M.Odersky *) - - - CONST - nofbufs = 4; - bufsize = 4096; - fileTabSize = 64; - noDesc = -1; - notDone = -1; - - (* file states *) - open = 0; create = 1; close = 2; - - - TYPE - FileName = ARRAY 101 OF CHAR; - File* = POINTER TO Handle; - Buffer = POINTER TO BufDesc; - - Handle = RECORD - workName, registerName: FileName; - tempFile: BOOLEAN; - dev, ino, mtime: LONGINT; - fd-, len, pos: LONGINT; - bufs: ARRAY nofbufs OF Buffer; - swapper, state: INTEGER - END ; - - BufDesc = RECORD - f: File; - chg: BOOLEAN; - org, size: LONGINT; - data: ARRAY bufsize OF SYSTEM.BYTE - END ; - - Rider* = RECORD - res*: LONGINT; - eof*: BOOLEAN; - buf: Buffer; - org, offset: LONGINT - END ; - - Time = POINTER TO TimeDesc; - TimeDesc = RECORD - sec*, min*, hour*, mday*, mon*, year*, wday*, isdst*, zone*, gmtoff*: LONGINT; -(* sec*, min*, hour*, mday*, mon*, year*, wday*, isdst*, zone*, gmtoff*: INTEGER;*) - END ; - - VAR - fileTab: ARRAY fileTabSize OF LONGINT (*=File*); - tempno: INTEGER; - -(* for localtime *) - PROCEDURE -includetime() - '#include "time.h"'; - - PROCEDURE -localtime(VAR clock: LONGINT): Time - "(Files0_Time) localtime(clock)"; - - PROCEDURE -getcwd(VAR cwd: Unix.Name) - "getcwd(cwd, cwd__len)"; - - PROCEDURE -IdxTrap "__HALT(-1)"; - - PROCEDURE^ Finalize(o: SYSTEM.PTR); - - PROCEDURE Err(s: ARRAY OF CHAR; f: File; errno: LONGINT); - BEGIN - Console.Ln; Console.String("-- "); Console.String(s); Console.String(": "); - IF f # NIL THEN - IF f.registerName # "" THEN Console.String(f.registerName) ELSE Console.String(f.workName) END - END ; - IF errno # 0 THEN Console.String(" errno = "); Console.Int(errno, 1) END ; - Console.Ln; - HALT(99) - END Err; - - PROCEDURE MakeFileName(dir, name: ARRAY OF CHAR; VAR dest: ARRAY OF CHAR); - VAR i, j: INTEGER; - BEGIN i := 0; j := 0; - WHILE dir[i] # 0X DO dest[i] := dir[i]; INC(i) END ; - IF dest[i-1] # "/" THEN dest[i] := "/"; INC(i) END ; - WHILE name[j] # 0X DO dest[i] := name[j]; INC(i); INC(j) END ; - dest[i] := 0X - END MakeFileName; - - PROCEDURE GetTempName(finalName: ARRAY OF CHAR; VAR name: ARRAY OF CHAR); - VAR n, i, j: LONGINT; - BEGIN - INC(tempno); n := tempno; i := 0; - IF finalName[0] # "/" THEN (* relative pathname *) - WHILE Kernel.CWD[i] # 0X DO name[i] := Kernel.CWD[i]; INC(i) END; - IF Kernel.CWD[i-1] # "/" THEN name[i] := "/"; INC(i) END - END; - j := 0; - WHILE finalName[j] # 0X DO name[i] := finalName[j]; INC(i); INC(j) END; - DEC(i); - WHILE name[i] # "/" DO DEC(i) END; - name[i+1] := "."; name[i+2] := "t"; name[i+3] := "m"; name[i+4] := "p"; name[i+5] := "."; INC(i, 6); - WHILE n > 0 DO name[i] := CHR(n MOD 10 + ORD("0")); n := n DIV 10; INC(i) END; - name[i] := "."; INC(i); n := SHORT(Unix.Getpid()); - WHILE n > 0 DO name[i] := CHR(n MOD 10 + ORD("0")); n := n DIV 10; INC(i) END; - name[i] := 0X - END GetTempName; - - PROCEDURE Create(f: File); - VAR stat: Unix.Status; done: BOOLEAN; - errno: LONGINT; err: ARRAY 32 OF CHAR; - BEGIN - IF f.fd = noDesc THEN - IF f.state = create THEN GetTempName(f.registerName, f.workName); f.tempFile := TRUE - ELSIF f.state = close THEN - f.workName := f.registerName; f.registerName := ""; f.tempFile := FALSE - END ; - errno := Unix.Unlink(f.workName); (*unlink first to avoid stale NFS handles and to avoid reuse of inodes*) - f.fd := Unix.Open(f.workName, Unix.rdwr + Unix.creat + Unix.trunc, {2, 4,5, 7,8}); - done := f.fd >= 0; errno := Unix.errno(); - IF (~done & ((errno = Unix.ENFILE) OR (errno = Unix.EMFILE))) OR (done & (f.fd >= fileTabSize)) THEN - IF done & (f.fd >= fileTabSize) THEN errno := Unix.Close(f.fd) END ; - Kernel.GC(TRUE); - f.fd := Unix.Open(f.workName, Unix.rdwr + Unix.creat + Unix.trunc, {2, 4,5, 7,8}); - done := f.fd >= 0 - END ; - IF done THEN - IF f.fd >= fileTabSize THEN errno := Unix.Close(f.fd); Err("too many files open", f, 0) - ELSE fileTab[f.fd] := SYSTEM.VAL(LONGINT, f); INC(Kernel.nofiles); Kernel.RegisterObject(f, Finalize); - f.state := open; f.pos := 0; errno := Unix.Fstat(f.fd, stat); - f.dev := stat.dev; f.ino := stat.ino; f.mtime := stat.mtime - END - ELSE errno := Unix.errno(); - IF errno = Unix.ENOENT THEN err := "no such directory" - ELSIF (errno = Unix.ENFILE) OR (errno = Unix.EMFILE) THEN err := "too many files open" - ELSE err := "file not created" - END ; - Err(err, f, errno) - END - END - END Create; - - PROCEDURE Flush(buf: Buffer); - VAR res: LONGINT; f: File; stat: Unix.Status; - BEGIN - IF buf.chg THEN f := buf.f; Create(f); - IF buf.org # f.pos THEN res := Unix.Lseek(f.fd, buf.org, 0) END ; - res := Unix.Write(f.fd, SYSTEM.ADR(buf.data), buf.size); - IF res < 0 THEN Err("error in writing file", f, Unix.errno()) END ; - f.pos := buf.org + buf.size; - buf.chg := FALSE; - res := Unix.Fstat(f.fd, stat); - f.mtime := stat.mtime - END - END Flush; - - PROCEDURE Close* (f: File); - VAR i, res: LONGINT; - BEGIN - IF (f.state # create) OR (f.registerName # "") THEN - Create(f); i := 0; - WHILE (i < nofbufs) & (f.bufs[i] # NIL) DO Flush(f.bufs[i]); INC(i) END ; - res := Unix.Fsync(f.fd); - IF res < 0 THEN Err("error in writing file", f, Unix.errno()) END - END - END Close; - - PROCEDURE Length* (f: File): LONGINT; - BEGIN RETURN f.len - END Length; - - PROCEDURE New* (name: ARRAY OF CHAR): File; - VAR f: File; - BEGIN - NEW(f); f.workName := ""; COPY(name, f.registerName); - f.fd := noDesc; f.state := create; f.len := 0; f.pos := 0; f.swapper := -1; (*all f.buf[i] = NIL*) - RETURN f - END New; - - PROCEDURE ScanPath(VAR pos: INTEGER; VAR dir: ARRAY OF CHAR); (* supports ~, ~user and blanks inside path *) - VAR i: INTEGER; ch: CHAR; home: ARRAY 256 OF CHAR; - BEGIN - i := 0; ch := Kernel.OBERON[pos]; - WHILE (ch = " ") OR (ch = ":") DO INC(pos); ch := Kernel.OBERON[pos] END ; - IF ch = "~" THEN - INC(pos); ch := Kernel.OBERON[pos]; - home := ""; Args.GetEnv("HOME", home); - WHILE home[i] # 0X DO dir[i] := home[i]; INC(i) END ; - IF (ch # "/") & (ch # 0X) & (ch # ":") & (ch # " ") THEN - WHILE (i > 0) & (dir[i-1] # "/") DO DEC(i) END - END - END ; - WHILE (ch # 0X) & (ch # ":") DO dir[i] := ch; INC(i); INC(pos); ch := Kernel.OBERON[pos] END ; - WHILE (i > 0) & (dir[i-1] = " ") DO DEC(i) END ; - dir[i] := 0X - END ScanPath; - - PROCEDURE HasDir(VAR name: ARRAY OF CHAR): BOOLEAN; - VAR i: INTEGER; ch: CHAR; - BEGIN i := 0; ch := name[0]; - WHILE (ch # 0X) & (ch # "/") DO INC(i); ch := name[i] END ; - RETURN ch = "/" - END HasDir; - - PROCEDURE CacheEntry(dev, ino: LONGINT; mtime: LONGINT): File; - VAR f: File; i: INTEGER; stat: Unix.Status; res: LONGINT; - BEGIN i := 0; - WHILE i < fileTabSize DO - f := SYSTEM.VAL(File, fileTab[i]); - IF (f # NIL) & (ino = f.ino) & (dev = f.dev) THEN - IF mtime # f.mtime THEN i := 0; - WHILE i < nofbufs DO - IF f.bufs[i] # NIL THEN f.bufs[i].org := -1; f.bufs[i] := NIL END ; - INC(i) - END ; - f.swapper := -1; f.mtime := mtime; - res := Unix.Fstat(f.fd, stat); f.len := stat.size - END ; - RETURN f - END ; - INC(i) - END ; - RETURN NIL - END CacheEntry; - - PROCEDURE Old* (name: ARRAY OF CHAR): File; - VAR f: File; fd, res, errno: LONGINT; pos: INTEGER; done: BOOLEAN; - dir, path: ARRAY 256 OF CHAR; - stat: Unix.Status; - BEGIN - IF name # "" THEN - IF HasDir(name) THEN dir := ""; COPY(name, path) - ELSE pos := 0; ScanPath(pos, dir); MakeFileName(dir, name, path); ScanPath(pos, dir) - END ; - LOOP - fd := Unix.Open(path, Unix.rdwr, {}); done := fd >= 0; errno := Unix.errno(); - IF (~done & ((errno = Unix.ENFILE) OR (errno = Unix.EMFILE))) OR (done & (fd >= fileTabSize)) THEN - IF done & (fd >= fileTabSize) THEN res := Unix.Close(fd) END ; - Kernel.GC(TRUE); - fd := Unix.Open(path, Unix.rdwr, {}); - done := fd >= 0; errno := Unix.errno(); - IF ~done & ((errno = Unix.ENFILE) OR (errno = Unix.EMFILE)) THEN Err("too many files open", f, errno) END - END ; - IF ~done & ((errno = Unix.EACCES) OR (errno = Unix.EROFS) OR (errno = Unix.EAGAIN)) THEN - (* errno EAGAIN observed on Solaris 2.4 *) - fd := Unix.Open(path, Unix.rdonly, {}); done := fd >= 0; errno := Unix.errno() - END ; -IF (~done) & (errno # Unix.ENOENT) THEN - Console.String("warning Files0.Old "); Console.String(name); - Console.String(" errno = "); Console.Int(errno, 0); Console.Ln; -END ; - IF done THEN - res := Unix.Fstat(fd, stat); - f := CacheEntry(stat.dev, stat.ino, stat.mtime); - IF f # NIL THEN res := Unix.Close(fd); RETURN f - ELSIF fd >= fileTabSize THEN res := Unix.Close(fd); Err("too many files open", f, 0) - ELSE NEW(f); fileTab[fd] := SYSTEM.VAL(LONGINT, f); INC(Kernel.nofiles); Kernel.RegisterObject(f, Finalize); - f.fd := fd; f.state := open; f.len := stat.size; f.pos := 0; f.swapper := -1; (*all f.buf[i] = NIL*) - COPY(name, f.workName); f.registerName := ""; f.tempFile := FALSE; - f.dev := stat.dev; f.ino := stat.ino; f.mtime := stat.mtime; - RETURN f - END - ELSIF dir = "" THEN RETURN NIL - ELSE MakeFileName(dir, name, path); ScanPath(pos, dir) - END - END - ELSE RETURN NIL - END - END Old; - - PROCEDURE Purge* (f: File); - VAR i: INTEGER; stat: Unix.Status; res: LONGINT; - BEGIN i := 0; - WHILE i < nofbufs DO - IF f.bufs[i] # NIL THEN f.bufs[i].org := -1; f.bufs[i] := NIL END ; - INC(i) - END ; - IF f.fd # noDesc THEN res := Unix.Ftruncate(f.fd, 0); res := Unix.Lseek(f.fd, 0, 0) END ; - f.pos := 0; f.len := 0; f.swapper := -1; - res := Unix.Fstat(f.fd, stat); f.mtime := stat.mtime - END Purge; - - PROCEDURE GetDate* (f: File; VAR t, d: LONGINT); - VAR stat: Unix.Status; clock, res: LONGINT; time: Time; - BEGIN - Create(f); res := Unix.Fstat(f.fd, stat); - time := localtime(stat.mtime); - t := time.sec + ASH(time.min, 6) + ASH(time.hour, 12); - d := time.mday + ASH(time.mon+1, 5) + ASH(time.year MOD 100, 9) - END GetDate; - - PROCEDURE Pos* (VAR r: Rider): LONGINT; - BEGIN RETURN r.org + r.offset - END Pos; - - PROCEDURE Set* (VAR r: Rider; f: File; pos: LONGINT); - VAR org, offset, i, n, res: LONGINT; buf: Buffer; - BEGIN - IF f # NIL THEN - IF pos > f.len THEN pos := f.len ELSIF pos < 0 THEN pos := 0 END ; - offset := pos MOD bufsize; org := pos - offset; i := 0; - WHILE (i < nofbufs) & (f.bufs[i] # NIL) & (org # f.bufs[i].org) DO INC(i) END ; - IF i < nofbufs THEN - IF f.bufs[i] = NIL THEN NEW(buf); buf.chg := FALSE; buf.org := -1; buf.f := f; f.bufs[i] := buf - ELSE buf := f.bufs[i] - END - ELSE - f.swapper := (f.swapper + 1) MOD nofbufs; - buf := f.bufs[f.swapper]; - Flush(buf) - END ; - IF buf.org # org THEN - IF org = f.len THEN buf.size := 0 - ELSE Create(f); - IF f.pos # org THEN res := Unix.Lseek(f.fd, org, 0) END ; - n := Unix.ReadBlk(f.fd, buf.data); - IF n < 0 THEN Err("read from file not done", f, Unix.errno()) END ; - f.pos := org + n; - buf.size := n - END ; - buf.org := org; buf.chg := FALSE - END - ELSE buf := NIL; org := 0; offset := 0 - END ; - r.buf := buf; r.org := org; r.offset := offset; r.eof := FALSE; r.res := 0 - END Set; - - PROCEDURE Read* (VAR r: Rider; VAR x: SYSTEM.BYTE); - VAR offset: LONGINT; buf: Buffer; - BEGIN - buf := r.buf; offset := r.offset; - IF r.org # buf.org THEN Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset END ; - IF (offset < buf.size) THEN - x := buf.data[offset]; r.offset := offset + 1 - ELSIF r.org + offset < buf.f.len THEN - Set(r, r.buf.f, r.org + offset); - x := r.buf.data[0]; r.offset := 1 - ELSE - x := 0X; r.eof := TRUE - END - END Read; - - PROCEDURE ReadBytes* (VAR r: Rider; VAR x: ARRAY OF SYSTEM.BYTE; n: LONGINT); - VAR xpos, min, restInBuf, offset: LONGINT; buf: Buffer; - BEGIN - IF n > LEN(x) THEN IdxTrap END ; - xpos := 0; buf := r.buf; offset := r.offset; - WHILE n > 0 DO - IF (r.org # buf.org) OR (offset >= bufsize) THEN - Set(r, buf.f, r.org + offset); - buf := r.buf; offset := r.offset - END ; - restInBuf := buf.size - offset; - IF restInBuf = 0 THEN r.res := n; r.eof := TRUE; RETURN - ELSIF n > restInBuf THEN min := restInBuf ELSE min := n END ; - SYSTEM.MOVE(SYSTEM.ADR(buf.data) + offset, SYSTEM.ADR(x) + xpos, min); - INC(offset, min); r.offset := offset; INC(xpos, min); DEC(n, min) - END ; - r.res := 0; r.eof := FALSE - END ReadBytes; - - PROCEDURE ReadByte* (VAR r : Rider; VAR x : ARRAY OF SYSTEM.BYTE); - BEGIN - ReadBytes(r, x, 1); - END ReadByte; - - PROCEDURE Base* (VAR r: Rider): File; - BEGIN RETURN r.buf.f - END Base; - - PROCEDURE Write* (VAR r: Rider; x: SYSTEM.BYTE); - VAR buf: Buffer; offset: LONGINT; - BEGIN - buf := r.buf; offset := r.offset; - IF (r.org # buf.org) OR (offset >= bufsize) THEN - Set(r, buf.f, r.org + offset); - buf := r.buf; offset := r.offset - END ; - buf.data[offset] := x; - buf.chg := TRUE; - IF offset = buf.size THEN - INC(buf.size); INC(buf.f.len) - END ; - r.offset := offset + 1; r.res := 0 - END Write; - - PROCEDURE WriteBytes* (VAR r: Rider; VAR x: ARRAY OF SYSTEM.BYTE; n: LONGINT); - VAR xpos, min, restInBuf, offset: LONGINT; buf: Buffer; - BEGIN - IF n > LEN(x) THEN IdxTrap END ; - xpos := 0; buf := r.buf; offset := r.offset; - WHILE n > 0 DO - IF (r.org # buf.org) OR (offset >= bufsize) THEN - Set(r, buf.f, r.org + offset); - buf := r.buf; offset := r.offset - END ; - restInBuf := bufsize - offset; - IF n > restInBuf THEN min := restInBuf ELSE min := n END ; - SYSTEM.MOVE(SYSTEM.ADR(x) + xpos, SYSTEM.ADR(buf.data) + offset, min); - INC(offset, min); r.offset := offset; - IF offset > buf.size THEN INC(buf.f.len, offset - buf.size); buf.size := offset END ; - INC(xpos, min); DEC(n, min); buf.chg := TRUE - END ; - r.res := 0 - END WriteBytes; - -(* another solution would be one that is similar to ReadBytes, WriteBytes. -No code duplication, more symmetric, only two ifs for -Read and Write in buffer, buf.size replaced by bufsize in Write ops, buf.size and len -must be made consistent with offset (if offset > buf.size) in a lazy way. - -PROCEDURE Write* (VAR r: Rider; x: SYSTEM.BYTE); - VAR buf: Buffer; offset: LONGINT; -BEGIN - buf := r.buf; offset := r.offset; - IF (offset >= bufsize) OR (r.org # buf.org) THEN - Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset; - END ; - buf.data[offset] := x; r.offset := offset + 1; buf.chg := TRUE -END Write; - -PROCEDURE WriteBytes ... - -PROCEDURE Read* (VAR r: Rider; VAR x: SYSTEM.BYTE); - VAR offset: LONGINT; buf: Buffer; -BEGIN - buf := r.buf; offset := r.offset; - IF (offset >= buf.size) OR (r.org # buf.org) THEN - IF r.org + offset >= buf.f.len THEN x := 0X; r.eof := TRUE; RETURN - ELSE Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset - END - END ; - x := buf.data[offset]; r.offset := offset + 1 -END Read; - -but this would also affect Set, Length, and Flush. -Especially Length would become fairly complex. -*) - - PROCEDURE Delete* (name: ARRAY OF CHAR; VAR res: INTEGER); - BEGIN - res := SHORT(Unix.Unlink(name)); - res := SHORT(Unix.errno()) - END Delete; - - PROCEDURE Rename* (old, new: ARRAY OF CHAR; VAR res: INTEGER); - VAR fdold, fdnew, n, errno, r: LONGINT; - ostat, nstat: Unix.Status; - buf: ARRAY 4096 OF CHAR; - BEGIN - r := Unix.Stat(old, ostat); - IF r >= 0 THEN - r := Unix.Stat(new, nstat); - IF (r >= 0) & ((ostat.dev # nstat.dev) OR (ostat.ino # nstat.ino)) THEN - Delete(new, res); (* work around stale nfs handles *) - END ; - r := Unix.Rename(old, new); - IF r < 0 THEN res := SHORT(Unix.errno()); - IF res = Unix.EXDEV THEN (* cross device link, move the file *) - fdold := Unix.Open(old, Unix.rdonly, {}); - IF fdold < 0 THEN res := 2; RETURN END ; - fdnew := Unix.Open(new, Unix.rdwr + Unix.creat + Unix.trunc, {2, 4,5, 7,8}); - IF fdnew < 0 THEN r := Unix.Close(fdold); res := 3; RETURN END ; - n := Unix.Read(fdold, SYSTEM.ADR(buf), bufsize); - WHILE n > 0 DO - r := Unix.Write(fdnew, SYSTEM.ADR(buf), n); - IF r < 0 THEN errno := Unix.errno(); r := Unix.Close(fdold); r := Unix.Close(fdnew); - Err("cannot move file", NIL, errno) - END ; - n := Unix.Read(fdold, SYSTEM.ADR(buf), bufsize) - END ; - errno := Unix.errno(); - r := Unix.Close(fdold); r := Unix.Close(fdnew); - IF n = 0 THEN r := Unix.Unlink(old); res := 0 - ELSE Err("cannot move file", NIL, errno) - END ; - ELSE RETURN (* res is Unix.Rename return code *) - END - END ; - res := 0 - ELSE res := 2 (* old file not found *) - END - END Rename; - - PROCEDURE Register* (f: File); - VAR idx, errno: INTEGER; f1: File; file: ARRAY 104 OF CHAR; - BEGIN - IF (f.state = create) & (f.registerName # "") THEN f.state := close (* shortcut renaming *) END ; - Close(f); - IF f.registerName # "" THEN - Rename(f.workName, f.registerName, errno); - IF errno # 0 THEN COPY(f.registerName, file); HALT(99) END ; - f.workName := f.registerName; f.registerName := ""; f.tempFile := FALSE - END - END Register; - - PROCEDURE ChangeDirectory*(path: ARRAY OF CHAR; VAR res: INTEGER); - BEGIN - res := SHORT(Unix.Chdir(path)); - getcwd(Kernel.CWD) - END ChangeDirectory; - - PROCEDURE FlipBytes(VAR src, dest: ARRAY OF SYSTEM.BYTE); - VAR i, j: LONGINT; - BEGIN - IF ~Kernel.littleEndian THEN i := LEN(src); j := 0; - WHILE i > 0 DO DEC(i); dest[j] := src[i]; INC(j) END - ELSE SYSTEM.MOVE(SYSTEM.ADR(src), SYSTEM.ADR(dest), LEN(src)) - END - END FlipBytes; - - PROCEDURE ReadBool* (VAR R: Rider; VAR x: BOOLEAN); - BEGIN Read(R, SYSTEM.VAL(CHAR, x)) - END ReadBool; - - PROCEDURE ReadInt* (VAR R: Rider; VAR x: INTEGER); - VAR b: ARRAY 2 OF CHAR; - BEGIN ReadBytes(R, b, 2); - x := ORD(b[0]) + ORD(b[1])*256 - END ReadInt; - - PROCEDURE ReadLInt* (VAR R: Rider; VAR x: LONGINT); - VAR b: ARRAY 4 OF CHAR; - BEGIN ReadBytes(R, b, 4); - x := ORD(b[0]) + ORD(b[1])*100H + ORD(b[2])*10000H + ORD(b[3])*1000000H - END ReadLInt; - - PROCEDURE ReadSet* (VAR R: Rider; VAR x: SET); - VAR b: ARRAY 4 OF CHAR; - BEGIN ReadBytes(R, b, 4); - x := SYSTEM.VAL(SET, ORD(b[0]) + ORD(b[1])*100H + ORD(b[2])*10000H + ORD(b[3])*1000000H) - END ReadSet; - - PROCEDURE ReadReal* (VAR R: Rider; VAR x: REAL); - VAR b: ARRAY 4 OF CHAR; - BEGIN ReadBytes(R, b, 4); FlipBytes(b, x) - END ReadReal; - - PROCEDURE ReadLReal* (VAR R: Rider; VAR x: LONGREAL); - VAR b: ARRAY 8 OF CHAR; - BEGIN ReadBytes(R, b, 8); FlipBytes(b, x) - END ReadLReal; - - PROCEDURE ReadString* (VAR R: Rider; VAR x: ARRAY OF CHAR); - VAR i: INTEGER; ch: CHAR; - BEGIN i := 0; - REPEAT Read(R, ch); x[i] := ch; INC(i) UNTIL ch = 0X - END ReadString; - - PROCEDURE ReadNum* (VAR R: Rider; VAR x: LONGINT); - VAR s: SHORTINT; ch: CHAR; n: LONGINT; - BEGIN s := 0; n := 0; Read(R, ch); - WHILE ORD(ch) >= 128 DO INC(n, ASH(ORD(ch) - 128, s) ); INC(s, 7); Read(R, ch) END; - INC(n, ASH(ORD(ch) MOD 64 - ORD(ch) DIV 64 * 64, s) ); - x := n - END ReadNum; - - PROCEDURE WriteBool* (VAR R: Rider; x: BOOLEAN); - BEGIN Write(R, SYSTEM.VAL(CHAR, x)) - END WriteBool; - - PROCEDURE WriteInt* (VAR R: Rider; x: INTEGER); - VAR b: ARRAY 2 OF CHAR; - BEGIN b[0] := CHR(x); b[1] := CHR(x DIV 256); - WriteBytes(R, b, 2); - END WriteInt; - - PROCEDURE WriteLInt* (VAR R: Rider; x: LONGINT); - VAR b: ARRAY 4 OF CHAR; - BEGIN - b[0] := CHR(x); b[1] := CHR(x DIV 100H); b[2] := CHR(x DIV 10000H); b[3] := CHR(x DIV 1000000H); - WriteBytes(R, b, 4); - END WriteLInt; - - PROCEDURE WriteSet* (VAR R: Rider; x: SET); - VAR b: ARRAY 4 OF CHAR; i: LONGINT; - BEGIN i := SYSTEM.VAL(LONGINT, x); - 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; - - PROCEDURE WriteReal* (VAR R: Rider; x: REAL); - VAR b: ARRAY 4 OF CHAR; - BEGIN FlipBytes(x, b); WriteBytes(R, b, 4) - END WriteReal; - - PROCEDURE WriteLReal* (VAR R: Rider; x: LONGREAL); - VAR b: ARRAY 8 OF CHAR; - BEGIN FlipBytes(x, b); WriteBytes(R, b, 8) - END WriteLReal; - - PROCEDURE WriteString* (VAR R: Rider; x: ARRAY [1] OF CHAR); - VAR i: INTEGER; - BEGIN i := 0; - WHILE x[i] # 0X DO INC(i) END ; - WriteBytes(R, x, i+1) - END WriteString; - - PROCEDURE WriteNum* (VAR R: Rider; x: LONGINT); - BEGIN - WHILE (x < - 64) OR (x > 63) DO Write(R, CHR(x MOD 128 + 128)); x := x DIV 128 END; - Write(R, CHR(x MOD 128)) - END WriteNum; - - PROCEDURE Finalize(o: SYSTEM.PTR); - VAR f: File; res: LONGINT; - BEGIN - f := SYSTEM.VAL(File, o); - IF f.fd >= 0 THEN - fileTab[f.fd] := 0; res := Unix.Close(f.fd); f.fd := -1; DEC(Kernel.nofiles); - IF f.tempFile THEN res := Unix.Unlink(f.workName) END - END - END Finalize; - - PROCEDURE Init; - VAR i: LONGINT; - BEGIN - i := 0; WHILE i < fileTabSize DO fileTab[i] := 0; INC(i) END ; - tempno := -1; Kernel.nofiles := 0 - END Init; - -BEGIN Init -END Files0. diff --git a/src/system/linux/clang/powerpc/SYSTEM.c0 b/src/system/linux/clang/powerpc/SYSTEM.c0 deleted file mode 100644 index 580449aa..00000000 --- a/src/system/linux/clang/powerpc/SYSTEM.c0 +++ /dev/null @@ -1,205 +0,0 @@ -/* -* The body prefix file of the Ofront runtime system, Version 1.0 -* -* Copyright (c) Software Templ, 1994, 1995 -* -* Module SYSTEM is subject to change any time without prior notification. -* Software Templ disclaims all warranties with regard to module SYSTEM, -* in particular shall Software Templ not be liable for any damage resulting -* from inappropriate use or modification of module SYSTEM. -* -* Version 1.1 jt, 24.11.95 fixes for correct pointer arithmetic on Cray computers -* jt 31.1.2007 ANSI prototypes for malloc and exit in order to avoid cc warnings -* -*/ - -#include "SYSTEM.h" -#ifdef __STDC__ -#include "stdarg.h" -#else -#include "varargs.h" -#endif - -extern void *malloc(long size); -extern void exit(int status); - -void (*SYSTEM_Halt)(); -LONGINT SYSTEM_halt; /* x in HALT(x) */ -LONGINT SYSTEM_assert; /* x in ASSERT(cond, x) */ -LONGINT SYSTEM_argc; -LONGINT SYSTEM_argv; -LONGINT SYSTEM_lock; -BOOLEAN SYSTEM_interrupted; -static LONGINT SYSTEM_mainfrm; /* adr of main proc stack frame, used for stack collection */ - -#define Lock SYSTEM_lock++ -#define Unlock SYSTEM_lock--; if (SYSTEM_interrupted && (SYSTEM_lock == 0)) __HALT(-9) - - -static void SYSTEM_InitHeap(); -void *SYSTEM__init(); - -void SYSTEM_INIT(argc, argvadr) - int argc; long argvadr; -{ - SYSTEM_mainfrm = argvadr; - SYSTEM_argc = argc; - SYSTEM_argv = *(long*)argvadr; - SYSTEM_InitHeap(); - SYSTEM_halt = -128; - SYSTEM__init(); -} - -void SYSTEM_FINI() -{ - SYSTEM_FINALL(); -} - -long SYSTEM_XCHK(i, ub) long i, ub; {return __X(i, ub);} -long SYSTEM_RCHK(i, ub) long i, ub; {return __R(i, ub);} -long SYSTEM_ASH(i, n) long i, n; {return __ASH(i, n);} -long SYSTEM_ABS(i) long i; {return __ABS(i);} -double SYSTEM_ABSD(i) double i; {return __ABS(i);} - -void SYSTEM_INHERIT(t, t0) - long *t, *t0; -{ - t -= __TPROC0OFF; - t0 -= __TPROC0OFF; - while (*t0 != __EOM) {*t = *t0; t--; t0--;} -} - -void SYSTEM_ENUMP(adr, n, P) - long *adr; - long n; - void (*P)(); -{ - while (n > 0) {P(*adr); adr++; n--;} -} - -void SYSTEM_ENUMR(adr, typ, size, n, P) - char *adr; - long *typ, size, n; - void (*P)(); -{ - long *t, off; - typ++; - while (n > 0) { - t = typ; - off = *t; - while (off >= 0) {P(*(long*)(adr+off)); t++; off = *t;} - adr += size; n--; - } -} - -long SYSTEM_DIV(x, y) - unsigned long x, y; -{ if ((long) x >= 0) return (x / y); - else return -((y - 1 - x) / y); -} - -long SYSTEM_MOD(x, y) - unsigned long x, y; -{ unsigned long m; - if ((long) x >= 0) return (x % y); - else { m = (-x) % y; - if (m != 0) return (y - m); else return 0; - } -} - -long SYSTEM_ENTIER(x) - double x; -{ - long y; - if (x >= 0) - return (long)x; - else { - y = (long)x; - if (y <= x) return y; else return y - 1; - } -} - -void SYSTEM_HALT(n) - int n; -{ - SYSTEM_halt = n; - if (SYSTEM_Halt!=0) SYSTEM_Halt(n); - exit(n); -} - -#ifdef __STDC__ -SYSTEM_PTR SYSTEM_NEWARR(long *typ, long elemsz, int elemalgn, int nofdim, int nofdyn, ...) -#else -SYSTEM_PTR SYSTEM_NEWARR(typ, elemsz, elemalgn, nofdim, nofdyn, va_alist) - long *typ, elemsz; - int elemalgn, nofdim, nofdyn; - va_dcl -#endif -{ - long nofelems, size, dataoff, n, nptr, *x, *p, nofptrs, i, *ptab, off; - va_list ap; -#ifdef __STDC__ - va_start(ap, nofdyn); -#else - va_start(ap); -#endif - nofelems = 1; - while (nofdim > 0) { - nofelems = nofelems * va_arg(ap, long); nofdim--; - if (nofelems <= 0) __HALT(-20); - } - va_end(ap); - dataoff = nofdyn * sizeof(long); - if (elemalgn > sizeof(long)) { - n = dataoff % elemalgn; - if (n != 0) dataoff += elemalgn - n; - } - size = dataoff + nofelems * elemsz; - Lock; - if (typ == NIL) { - /* element typ does not contain pointers */ - x = SYSTEM_NEWBLK(size); - } - else if (typ == POINTER__typ) { - /* element type is a pointer */ - x = SYSTEM_NEWBLK(size + nofelems * sizeof(long)); - p = (long*)x[-1]; - p[-nofelems] = *p; /* build new type desc in situ: 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ - p -= nofelems - 1; n = 1; /* n =1 for skipping the size field */ - while (n <= nofelems) {*p = n*sizeof(long); p++; n++;} - *p = - (nofelems + 1) * sizeof(long); /* sentinel */ - x[-1] -= nofelems * sizeof(long); - } - else { - /* element type is a record that contains pointers */ - ptab = typ + 1; nofptrs = 0; - while (ptab[nofptrs] >= 0) {nofptrs++;} /* number of pointers per element */ - nptr = nofelems * nofptrs; /* total number of pointers */ - x = SYSTEM_NEWBLK(size + nptr * sizeof(long)); - p = (long*)x[- 1]; - p[-nptr] = *p; /* build new type desc in situ; 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ - p -= nptr - 1; n = 0; off = dataoff; - while (n < nofelems) {i = 0; - while (i < nofptrs) {*p = off + ptab[i]; p++; i++;} - off += elemsz; n++; - } - *p = - (nptr + 1) * sizeof(long); /* sentinel */ - x[-1] -= nptr * sizeof(long); - } - if (nofdyn != 0) { - /* setup len vector for index checks */ -#ifdef __STDC__ - va_start(ap, nofdyn); -#else - va_start(ap); -#endif - p = x; - while (nofdyn > 0) {*p = va_arg(ap, long); p++, nofdyn--;} - va_end(ap); - } - Unlock; - return x; -} - -/* ----------- end of SYSTEM.co ------------- */ - diff --git a/src/system/linux/clang/powerpc/SYSTEM.h b/src/system/linux/clang/powerpc/SYSTEM.h deleted file mode 100644 index ea9ae5d6..00000000 --- a/src/system/linux/clang/powerpc/SYSTEM.h +++ /dev/null @@ -1,220 +0,0 @@ -#ifndef SYSTEM__h -#define SYSTEM__h - -/* - -the Ofront runtime system interface and macros library -copyright (c) Josef Templ, 1995, 1996 - -gcc for Linux version (same as SPARC/Solaris2) -uses double # as concatenation operator - -*/ - -#include -#include /* for type sizes -- noch */ - -//extern void *memcpy(void *dest, const void *src, long n); -extern void *memcpy(void *dest, const void *src, size_t n); -extern void *malloc(long size); -extern void exit(int status); - -#define export -#define import extern - -/* constants */ -#define __MAXEXT 16 -#define NIL 0L -#define POINTER__typ (long*)1L /* not NIL and not a valid type */ - -/* basic types */ -typedef char BOOLEAN; -typedef unsigned char CHAR; -typedef signed char SHORTINT; -typedef short int INTEGER; -typedef long LONGINT; -typedef float REAL; -typedef double LONGREAL; -typedef unsigned long SET; -typedef void *SYSTEM_PTR; -typedef unsigned char SYSTEM_BYTE; -typedef int8_t SYSTEM_INT8; -typedef int16_t SYSTEM_INT16; -typedef int32_t SYSTEM_INT32; -typedef int64_t SYSTEM_INT64; - -/* runtime system routines */ -extern long SYSTEM_DIV(); -extern long SYSTEM_MOD(); -extern long SYSTEM_ENTIER(); -extern long SYSTEM_ASH(); -extern long SYSTEM_ABS(); -extern long SYSTEM_XCHK(); -extern long SYSTEM_RCHK(); -extern double SYSTEM_ABSD(); -extern SYSTEM_PTR SYSTEM_NEWREC(); -extern SYSTEM_PTR SYSTEM_NEWBLK(); -#ifdef __STDC__ -extern SYSTEM_PTR SYSTEM_NEWARR(long*, long, int, int, int, ...); -#else -extern SYSTEM_PTR SYSTEM_NEWARR(); -#endif -extern SYSTEM_PTR SYSTEM_REGMOD(); -extern void SYSTEM_INCREF(); -extern void SYSTEM_REGCMD(); -extern void SYSTEM_REGTYP(); -extern void SYSTEM_REGFIN(); -extern void SYSTEM_FINALL(); -extern void SYSTEM_INIT(); -extern void SYSTEM_FINI(); -extern void SYSTEM_HALT(); -extern void SYSTEM_INHERIT(); -extern void SYSTEM_ENUMP(); -extern void SYSTEM_ENUMR(); - -/* module registry */ -#define __DEFMOD static void *m; if(m!=0)return m -#define __REGMOD(name, enum) if(m==0)m=SYSTEM_REGMOD((CHAR*)name,enum); else return m -#define __ENDMOD return m -#define __INIT(argc, argv) static void *m; SYSTEM_INIT(argc, (long)&argv); -#define __REGMAIN(name, enum) m=SYSTEM_REGMOD(name,enum) -#define __FINI SYSTEM_FINI(); return 0 -#define __IMPORT(name) SYSTEM_INCREF(name##__init()) -#define __REGCMD(name, cmd) SYSTEM_REGCMD(m, name, cmd) - -/* SYSTEM ops */ -#define __SYSNEW(p, len) p=SYSTEM_NEWBLK((long)(len)) -#define __VAL(t, x) (*(t*)&(x)) -#define __GET(a, x, t) x= *(t*)(a) -#define __PUT(a, x, t) *(t*)(a)=x -#define __LSHL(x, n, t) ((t)((unsigned)(x)<<(n))) -#define __LSHR(x, n, t) ((t)((unsigned)(x)>>(n))) -#define __LSH(x, n, t) ((n)>=0? __LSHL(x, n, t): __LSHR(x, -(n), t)) -#define __ROTL(x, n, t) ((t)((unsigned)(x)<<(n)|(unsigned)(x)>>(8*sizeof(t)-(n)))) -#define __ROTR(x, n, t) ((t)((unsigned)(x)>>(n)|(unsigned)(x)<<(8*sizeof(t)-(n)))) -#define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) -#define __BIT(x, n) (*(unsigned long*)(x)>>(n)&1) -#define __MOVE(s, d, n) memcpy((char*)(d),(char*)(s),n) - -/* std procs and operator mappings */ -#define __SHORT(x, y) ((int)((unsigned long)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) -#define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) -#define __CHR(x) ((CHAR)__R(x, 256)) -#define __CHRF(x) ((CHAR)__RF(x, 256)) -#define __DIV(x, y) ((x)>=0?(x)/(y):-(((y)-1-(x))/(y))) -#define __DIVF(x, y) SYSTEM_DIV((long)(x),(long)(y)) -#define __MOD(x, y) ((x)>=0?(x)%(y):__MODF(x,y)) -#define __MODF(x, y) SYSTEM_MOD((long)(x),(long)(y)) -#define __NEW(p, t) p=SYSTEM_NEWREC((long)t##__typ) -#define __NEWARR SYSTEM_NEWARR -#define __HALT(x) SYSTEM_HALT(x) -#define __ASSERT(cond, x) if (!(cond)) {SYSTEM_assert = x; SYSTEM_HALT(-1);} -#define __ENTIER(x) SYSTEM_ENTIER(x) -#define __ABS(x) (((x)<0)?-(x):(x)) -#define __ABSF(x) SYSTEM_ABS((long)(x)) -#define __ABSFD(x) SYSTEM_ABSD((double)(x)) -#define __CAP(ch) ((CHAR)((ch)&0x5f)) -#define __ODD(x) ((x)&1) -#define __IN(x, s) (((s)>>(x))&1) -#define __SETOF(x) ((SET)1<<(x)) -#define __SETRNG(l, h) ((~(SET)0<<(l))&~(SET)0>>(8*sizeof(SET)-1-(h))) -#define __MASK(x, m) ((x)&~(m)) -#define __COPY(s, d, n) {char*_a=(void*)s,*_b=(void*)d;long _i=0,_t=n-1;while(_i<_t&&((_b[_i]=_a[_i])!=0)){_i++;};_b[_i]=0;} -static int __STRCMP(x, y) - CHAR *x, *y; -{long i = 0; CHAR ch1, ch2; - do {ch1 = x[i]; ch2 = y[i]; i++; - if (!ch1) return -(int)ch2; - } while (ch1==ch2); - return (int)ch1 - (int)ch2; -} -#define __ASH(x, n) ((n)>=0?__ASHL(x,n):__ASHR(x,-(n))) -#define __ASHL(x, n) ((long)(x)<<(n)) -#define __ASHR(x, n) ((long)(x)>>(n)) -#define __ASHF(x, n) SYSTEM_ASH((long)(x), (long)(n)) -#define __DUP(x, l, t) x=(void*)memcpy(alloca(l*sizeof(t)),x,l*sizeof(t)) -#define __DUPARR(v, t) v=(void*)memcpy(v##__copy,v,sizeof(t)) -#define __DEL(x) /* DUP with alloca frees storage automatically */ -#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(long)typ##__typ) -#define __TYPEOF(p) (*(((long**)(p))-1)) -#define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) - -/* runtime checks */ -#define __X(i, ub) (((unsigned)(long)(i)<(unsigned long)(ub))?i:(__HALT(-2),0)) -#define __XF(i, ub) SYSTEM_XCHK((long)(i), (long)(ub)) -#define __RETCHK __retchk: __HALT(-3) -#define __CASECHK __HALT(-4) -#define __GUARDP(p, typ, level) ((typ*)(__ISP(p,typ,level)?p:(__HALT(-5),p))) -#define __GUARDR(r, typ, level) (*((typ*)(__IS(r##__typ,typ,level)?r:(__HALT(-5),r)))) -#define __GUARDA(p, typ, level) ((struct typ*)(__IS(__TYPEOF(p),typ,level)?p:(__HALT(-5),p))) -#define __GUARDEQR(p, dyntyp, typ) if(dyntyp!=typ##__typ) __HALT(-6);*(p) -#define __GUARDEQP(p, typ) if(__TYPEOF(p)!=typ##__typ)__HALT(-6);*(p) -#define __WITHCHK __HALT(-7) -#define __R(i, ub) (((unsigned)(long)(i)<(unsigned long)(ub))?i:(__HALT(-8),0)) -#define __RF(i, ub) SYSTEM_RCHK((long)(i),(long)(ub)) - -/* record type descriptors */ -#define __TDESC(t, m, n) \ - static struct t##__desc {\ - long tproc[m]; \ - long tag, next, level, module; \ - char name[24]; \ - long *base[__MAXEXT]; \ - char *rsrvd; \ - long blksz, ptr[n+1]; \ - } t##__desc - -#define __BASEOFF (__MAXEXT+1) -#define __TPROC0OFF (__BASEOFF+24/sizeof(long)+5) -#define __EOM 1 -#define __TDFLDS(name, size) {__EOM}, 1, 0, 0, 0, name, {0}, 0, size -#define __ENUMP(adr, n, P) SYSTEM_ENUMP(adr, (long)(n), P) -#define __ENUMR(adr, typ, size, n, P) SYSTEM_ENUMR(adr, typ, (long)(size), (long)(n), P) - -#define __INITYP(t, t0, level) \ - t##__typ= &t##__desc.blksz; \ - memcpy(t##__desc.base, t0##__typ - __BASEOFF, level*sizeof(long)); \ - t##__desc.base[level]=t##__typ; \ - t##__desc.module=(long)m; \ - if(t##__desc.blksz!=sizeof(struct t)) __HALT(-15); \ - t##__desc.blksz=(t##__desc.blksz+5*sizeof(long)-1)/(4*sizeof(long))*(4*sizeof(long)); \ - SYSTEM_REGTYP(m, (long)&t##__desc.next); \ - SYSTEM_INHERIT(t##__typ, t0##__typ) - -/* Oberon-2 type bound procedures support */ -#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(long)proc -#define __SEND(typ, num, funtyp, parlist) ((funtyp)(*(typ-(__TPROC0OFF+num))))parlist - -/* runtime system variables */ -extern LONGINT SYSTEM_argc; -extern LONGINT SYSTEM_argv; -extern void (*SYSTEM_Halt)(); -extern LONGINT SYSTEM_halt; -extern LONGINT SYSTEM_assert; -extern SYSTEM_PTR SYSTEM_modules; -extern LONGINT SYSTEM_heapsize; -extern LONGINT SYSTEM_allocated; -extern LONGINT SYSTEM_lock; -extern SHORTINT SYSTEM_gclock; -extern BOOLEAN SYSTEM_interrupted; - -/* ANSI prototypes; not used so far -static int __STRCMP(CHAR *x, CHAR *y); -void SYSTEM_INIT(int argc, long argvadr); -void SYSTEM_FINI(void); -long SYSTEM_XCHK(long i, long ub); -long SYSTEM_RCHK(long i, long ub); -long SYSTEM_ASH(long i, long n); -long SYSTEM_ABS(long i); -double SYSTEM_ABSD(double i); -void SYSTEM_INHERIT(long *t, long *t0); -void SYSTEM_ENUMP(long *adr, long n, void (*P)(void*)); -void SYSTEM_ENUMR(char *adr, long *typ, long size, long n, void (*P)(void*)); -long SYSTEM_DIV(unsigned long x, unsigned long y); -long SYSTEM_MOD(unsigned long x, unsigned long y); -long SYSTEM_ENTIER(double x); -void SYSTEM_HALT(int n); -*/ - -#endif - diff --git a/src/system/linux/clang/powerpc/Unix.Mod b/src/system/linux/clang/powerpc/Unix.Mod deleted file mode 100644 index 99c35a64..00000000 --- a/src/system/linux/clang/powerpc/Unix.Mod +++ /dev/null @@ -1,465 +0,0 @@ -MODULE Unix; (* Josef Templ, 5.3.90 Linux system calls *) -(* system procedure added by noch *) -(* Module Unix provides a system call interface to Linux. - Naming conventions: - Procedure and Type-names always start with a capital letter. - error numbers as defined in Unix - other constants start with lower case letters *) - -IMPORT SYSTEM; - -CONST - -(* various important constants *) - - stdin* = 0; stdout* =1; stderr* = 2; - - LOCKEX* = 2; LOCKUN* = 8; (* /usr/include/file.h *) - AFINET* = 2; (* /usr/include/sys/socket.h *) - PFINET* = AFINET; (* /usr/include/linux/socket.h *) - SOCKSTREAM* = 1; (* /usr/include/linux/socket.h *) - FIONREAD* = 541BH; (* in /usr/include/asm/termios.h *) - SETFL* = 4; (* set file descriptor flags; in asm/fcntl.h *) - TCP* = 0; - -(* flag sets, cf. /usr/include/asm/fcntl.h *) - rdonly* = {}; wronly* = {0}; rdwr* = {1}; creat* = {6}; excl* = {7}; trunc* = {9}; append* = {10}; ndelay = {11}; - -(* error numbers *) - - EPERM* = 1; (* Not owner *) - ENOENT* = 2; (* No such file or directory *) - ESRCH* = 3; (* No such process *) - EINTR* = 4; (* Interrupted system call *) - EIO* = 5; (* I/O error *) - ENXIO* = 6; (* No such device or address *) - E2BIG* = 7; (* Arg list too long *) - ENOEXEC* = 8; (* Exec format error *) - EBADF* = 9; (* Bad file number *) - ECHILD* = 10; (* No children *) - EAGAIN* = 11; (* No more processes *) - ENOMEM* = 12; (* Not enough core *) - EACCES* = 13; (* Permission denied *) - EFAULT* = 14; (* Bad address *) - ENOTBLK* = 15; (* Block device required *) - EBUSY* = 16; (* Mount device busy *) - EEXIST* = 17; (* File exists *) - EXDEV* = 18; (* Cross-device link *) - ENODEV* = 19; (* No such device *) - ENOTDIR* = 20; (* Not a directory*) - EISDIR* = 21; (* Is a directory *) - EINVAL* = 22; (* Invalid argument *) - ENFILE* = 23; (* File table overflow *) - EMFILE* = 24; (* Too many open files *) - ENOTTY* = 25; (* Not a typewriter *) - ETXTBSY* = 26; (* Text file busy *) - EFBIG* = 27; (* File too large *) - ENOSPC* = 28; (* No space left on device *) - ESPIPE* = 29; (* Illegal seek *) - EROFS* = 30; (* Read-only file system *) - EMLINK* = 31; (* Too many links *) - EPIPE* = 32; (* Broken pipe *) - EDOM* = 33; (* Argument too large *) - ERANGE* = 34; (* Result too large *) - EDEADLK* = 35; (* Resource deadlock would occur *) - ENAMETOOLONG* = 36; (* File name too long *) - ENOLCK* = 37; (* No record locks available *) - ENOSYS* = 38; (* Function not implemented *) - ENOTEMPTY* = 39; (* Directory not empty *) - ELOOP* = 40; (* Too many symbolic links encountered *) - EWOULDBLOCK* = EAGAIN; (* Operation would block *) - ENOMSG* = 42; (* No message of desired type *) - EIDRM* = 43; (* Identifier removed *) - ECHRNG* = 44; (* Channel number out of range *) - EL2NSYNC* = 45; (* Level 2 not synchronized *) - EL3HLT* = 46; (* Level 3 halted *) - EL3RST* = 47; (* Level 3 reset *) - ELNRNG* = 48; (* Link number out of range *) - EUNATCH* = 49; (* Protocol driver not attached *) - ENOCSI* = 50; (* No CSI structure available *) - EL2HLT* = 51; (* Level 2 halted *) - EBADE* = 52; (* Invalid exchange *) - EBADR* = 53; (* Invalid request descriptor *) - EXFULL* = 54; (* Exchange full *) - ENOANO* = 55; (* No anode *) - EBADRQC* = 56; (* Invalid request code *) - EBADSLT* = 57; (* Invalid slot *) - EDEADLOCK* = 58; (* File locking deadlock error *) - EBFONT* = 59; (* Bad font file format *) - ENOSTR* = 60; (* Device not a stream *) - ENODATA* = 61; (* No data available *) - ETIME* = 62; (* Timer expired *) - ENOSR* = 63; (* Out of streams resources *) - ENONET* = 64; (* Machine is not on the network *) - ENOPKG* = 65; (* Package not installed *) - EREMOTE* = 66; (* Object is remote *) - ENOLINK* = 67; (* Link has been severed *) - EADV* = 68; (* Advertise error *) - ESRMNT* = 69; (* Srmount error *) - ECOMM* = 70; (* Communication error on send *) - EPROTO* = 71; (* Protocol error *) - EMULTIHOP* = 72; (* Multihop attempted *) - EDOTDOT* = 73; (* RFS specific error *) - EBADMSG* = 74; (* Not a data message *) - EOVERFLOW* = 75; (* Value too large for defined data type *) - ENOTUNIQ* = 76; (* Name not unique on network *) - EBADFD* = 77; (* File descriptor in bad state *) - EREMCHG* = 78; (* Remote address changed *) - ELIBACC* = 79; (* Can not access a needed shared library *) - ELIBBAD* = 80; (* Accessing a corrupted shared library *) - ELIBSCN* = 81; (* .lib section in a.out corrupted *) - ELIBMAX* = 82; (* Attempting to link in too many shared libraries *) - ELIBEXEC* = 83; (* Cannot exec a shared library directly *) - EILSEQ* = 84; (* Illegal byte sequence *) - ERESTART* = 85; (* Interrupted system call should be restarted *) - ESTRPIPE* = 86; (* Streams pipe error *) - EUSERS* = 87; (* Too many users *) - ENOTSOCK* = 88; (* Socket operation on non-socket *) - EDESTADDRREQ* = 89; (* Destination address required *) - EMSGSIZE* = 90; (* Message too long *) - EPROTOTYPE* = 91; (* Protocol wrong type for socket *) - ENOPROTOOPT* = 92; (* Protocol not available *) - EPROTONOSUPPORT* = 93; (* Protocol not supported *) - ESOCKTNOSUPPORT* = 94; (* Socket type not supported *) - EOPNOTSUPP* = 95; (* Operation not supported on transport endpoint *) - EPFNOSUPPORT* = 96; (* Protocol family not supported *) - EAFNOSUPPORT* = 97; (* Address family not supported by protocol *) - EADDRINUSE* = 98; (* Address already in use *) - EADDRNOTAVAIL* = 99; (* Cannot assign requested address *) - ENETDOWN* = 100; (* Network is down *) - ENETUNREACH* = 101; (* Network is unreachable *) - ENETRESET* = 102; (* Network dropped connection because of reset *) - ECONNABORTED* = 103; (* Software caused connection abort *) - ECONNRESET* = 104; (* Connection reset by peer *) - ENOBUFS* = 105; (* No buffer space available *) - EISCONN* = 106; (* Transport endpoint is already connected *) - ENOTCONN* = 107; (* Transport endpoint is not connected *) - ESHUTDOWN* = 108; (* Cannot send after transport endpoint shutdown *) - ETOOMANYREFS* = 109; (* Too many references: cannot splice *) - ETIMEDOUT* = 110; (* Connection timed out *) - ECONNREFUSED* = 111; (* Connection refused *) - EHOSTDOWN* = 112; (* Host is down *) - EHOSTUNREACH* = 113; (* No route to host *) - EALREADY* = 114; (* Operation already in progress *) - EINPROGRESS* = 115; (* Operation now in progress *) - ESTALE* = 116; (* Stale NFS file handle *) - EUCLEAN* = 117; (* Structure needs cleaning *) - ENOTNAM* = 118; (* Not a XENIX named type file *) - ENAVAIL* = 119; (* No XENIX semaphores available *) - EISNAM* = 120; (* Is a named type file *) - EREMOTEIO* = 121; (* Remote I/O error *) - EDQUOT* = 122; (* Quota exceeded *) - - -TYPE - JmpBuf* = RECORD - bx*, si*, di*, bp*, sp*, pc*: LONGINT; - maskWasSaved*: LONGINT; - savedMask*: ARRAY 32 OF LONGINT; - END ; - - Status* = RECORD (* struct stat *) - dev*, devX*: LONGINT; (* 64 bit in Linux 2.2 *) - pad1: INTEGER; - ino*, mode*, nlink*, uid*, gid*: LONGINT; - rdev*, rdevX*: LONGINT; (* 64 bit in Linux 2.2 *) - pad2: INTEGER; - size*, blksize*, blocks*, atime*, unused1*, mtime*, unused2*, ctime*, - unused3*, unused4*, unused5*: LONGINT; - END ; - - Timeval* = RECORD - sec*, usec*: LONGINT - END ; - - Timezone* = RECORD - minuteswest*, dsttime*: LONGINT - END ; - - Itimerval* = RECORD - interval*, value*: Timeval - END ; - - FdSet* = ARRAY 8 OF SET; - - SigCtxPtr* = POINTER TO SigContext; - SigContext* = RECORD - END ; - - SignalHandler* = PROCEDURE (sig, code: LONGINT; scp: SigCtxPtr); - - Dirent* = RECORD - ino, off: LONGINT; - reclen: INTEGER; - name: ARRAY 256 OF CHAR; - END ; - - Rusage* = RECORD - utime*, stime*: Timeval; - maxrss*, ixrss*, idrss*, isrss*, - minflt*, majflt*, nswap*, inblock*, - oublock*, msgsnd*, msgrcv*, nsignals*, - nvcsw*, nivcsw*: LONGINT - END ; - - Iovec* = RECORD - base*, len*: LONGINT - END ; - - SocketPair* = ARRAY 2 OF LONGINT; - - Pollfd* = RECORD - fd*: LONGINT; - events*, revents*: INTEGER - END ; - - Sockaddr* = RECORD - family*: INTEGER; - port*: INTEGER; - internetAddr*: LONGINT; - pad*: ARRAY 8 OF CHAR; - END ; - - HostEntry* = POINTER [1] TO Hostent; - Hostent* = RECORD - name*, aliases*: LONGINT; - addrtype*, length*: LONGINT; - addrlist*: LONGINT; (*POINTER TO POINTER TO LONGINT, network byte order*) - END; - - Name* = ARRAY OF CHAR; - - PROCEDURE -includeStat() - "#include "; - - PROCEDURE -includeErrno() - "#include "; - - (* for read(), write() and sleep() *) - PROCEDURE -includeUnistd() - "#include "; - - (* for system() *) -(* commented, doesn't compile on 32bit GNU/Linux platforms - PROCEDURE -includeStdlib() - "#include "; -*) - (* for nanosleep() *) - PROCEDURE -includeTime() - "#include "; - - (* for select() *) - PROCEDURE -includeSelect() - "#include "; - - PROCEDURE -err(): LONGINT - "errno"; - - PROCEDURE errno*(): LONGINT; - BEGIN - RETURN err() - END errno; - - PROCEDURE -Exit*(n: LONGINT) - "exit(n)"; - - PROCEDURE -Fork*(): LONGINT - "fork()"; - - PROCEDURE -Wait*(VAR status: LONGINT): LONGINT - "wait(status)"; - - PROCEDURE -Select*(width: LONGINT; VAR readfds, writefds, exceptfds: FdSet; VAR timeout: Timeval): LONGINT - "select(width, readfds, writefds, exceptfds, timeout)"; - - PROCEDURE -Gettimeofday* (VAR tv: Timeval; VAR tz: Timezone) : LONGINT - "gettimeofday(tv, tz)"; - - PROCEDURE -Read* (fd, buf, nbyte: LONGINT): LONGINT - "read(fd, buf, nbyte)"; - - PROCEDURE -ReadBlk* (fd: LONGINT; VAR buf: ARRAY OF SYSTEM.BYTE): LONGINT - "read(fd, buf, buf__len)"; - - PROCEDURE -Write* (fd, buf, nbyte: LONGINT): LONGINT - "write(fd, buf, nbyte)"; - - PROCEDURE -WriteBlk* (fd: LONGINT; VAR buf: ARRAY OF SYSTEM.BYTE): LONGINT - "write(fd, buf, buf__len)"; - - PROCEDURE -Dup*(fd: LONGINT): LONGINT - "dup(fd)"; - - PROCEDURE -Dup2*(fd1, fd2: LONGINT): LONGINT - "dup(fd1, fd2)"; - - PROCEDURE -Pipe*(fds : LONGINT): LONGINT - "pipe(fds)"; - - PROCEDURE -Getpid*(): LONGINT - "getpid()"; - - PROCEDURE -Getuid*(): LONGINT - "getuid()"; - - PROCEDURE -Geteuid*(): LONGINT - "geteuid()"; - - PROCEDURE -Getgid*(): LONGINT - "getgid()"; - - PROCEDURE -Getegid*(): LONGINT - "getegid()"; - - PROCEDURE -Unlink*(name: Name): LONGINT - "unlink(name)"; - - PROCEDURE -Open*(name: Name; flag, mode: SET): LONGINT - "open(name, flag, mode)"; - - PROCEDURE -Close*(fd: LONGINT): LONGINT - "close(fd)"; - - PROCEDURE -stat(name: Name; VAR statbuf: Status): LONGINT - "stat((const char*)name, (struct stat*)statbuf)"; - - PROCEDURE Stat*(name: Name; VAR statbuf: Status): LONGINT; - VAR res: LONGINT; - BEGIN - res := stat(name, statbuf); - (* make the first 4 bytes as unique as possible (used in module Files for caching!) *) - INC(statbuf.dev, statbuf.devX); - INC(statbuf.rdev, statbuf.rdevX); - RETURN res; - END Stat; - - PROCEDURE -fstat(fd: LONGINT; VAR statbuf: Status): LONGINT - "fstat(fd, (struct stat*)statbuf)"; - - PROCEDURE Fstat*(fd: LONGINT; VAR statbuf: Status): LONGINT; - VAR res: LONGINT; - BEGIN - res := fstat(fd, statbuf); - (* make the first 4 bytes as unique as possible (used in module Files for caching!) *) - INC(statbuf.dev, statbuf.devX); - INC(statbuf.rdev, statbuf.rdevX); - RETURN res; - END Fstat; - - PROCEDURE -Fchmod*(fd, mode: LONGINT): LONGINT - "fchmod(fd, mode)"; - - PROCEDURE -Chmod*(path: Name; mode: LONGINT): LONGINT - "chmod(path, mode)"; - - PROCEDURE -Lseek*(fd, offset, origin: LONGINT): LONGINT - "lseek(fd, offset, origin)"; - - PROCEDURE -Fsync*(fd: LONGINT): LONGINT - "fsync(fd)"; - - PROCEDURE -Fcntl*(fd, cmd, arg: LONGINT ): LONGINT - "fcntl(fd, cmd, arg)"; - - PROCEDURE -Flock*(fd, operation: LONGINT): LONGINT - "flock(fd, operation)"; - - PROCEDURE -Ftruncate*(fd, length: LONGINT): LONGINT - "ftruncate(fd, length)"; - - PROCEDURE -Readblk*(fd: LONGINT; VAR buf: ARRAY OF SYSTEM.BYTE; len: LONGINT): LONGINT - "read(fd, buf, len)"; - - PROCEDURE -Rename*(old, new: Name): LONGINT - "rename(old, new)"; - - PROCEDURE -Chdir*(path: Name): LONGINT - "chdir(path)"; - - PROCEDURE -Ioctl*(fd, request, arg: LONGINT): LONGINT - "ioctl(fd, request, arg)"; - - PROCEDURE -Kill*(pid, sig: LONGINT): LONGINT - "kill(pid, sig)"; - - PROCEDURE -Sigsetmask*(mask: LONGINT): LONGINT - "sigsetmask(mask)"; - - PROCEDURE -Sleep*(ms : LONGINT): LONGINT - "sleep(ms)"; - - PROCEDURE -Nanosleep*(VAR req : Timeval; VAR rem : Timeval): LONGINT - "nanosleep(req, rem)"; - - (* TCP/IP networking *) - - PROCEDURE -Gethostbyname*(name: Name): HostEntry - "(Unix_HostEntry)gethostbyname(name)"; - - PROCEDURE -Gethostname*(VAR name: Name): LONGINT - "gethostname(name, name__len)"; - - PROCEDURE -Socket*(af, type, protocol: LONGINT): LONGINT - "socket(af, type, protocol)"; - - PROCEDURE -Connect*(socket: LONGINT; name: Sockaddr; namelen: LONGINT): LONGINT - "connect(socket, &(name), namelen)"; - - PROCEDURE -Getsockname*(socket: LONGINT; VAR name: Sockaddr; VAR namelen: LONGINT): LONGINT - "getsockname(socket, name, namelen)"; - - PROCEDURE -Bind*(socket: LONGINT; name: Sockaddr; namelen: LONGINT): LONGINT - "bind(socket, &(name), namelen)"; - - PROCEDURE -Listen*(socket, backlog: LONGINT): LONGINT - "listen(socket, backlog)"; - - PROCEDURE -Accept*(socket: LONGINT; VAR addr: Sockaddr; VAR addrlen: LONGINT): LONGINT - "accept(socket, addr, addrlen)"; - - PROCEDURE -Recv*(socket, bufadr, buflen, flags: LONGINT): LONGINT - "recv(socket, bufadr, buflen, flags)"; - - PROCEDURE -Send*(socket, bufadr, buflen, flags: LONGINT): LONGINT - "send(socket, bufadr, buflen, flags)"; - - PROCEDURE -sys(str: ARRAY OF CHAR): INTEGER (* need this to call external tools like gcc or gas; noch *) - "system(str)"; - - PROCEDURE system*(cmd : ARRAY OF CHAR); - VAR r : INTEGER; - BEGIN - r := sys(cmd); - END system; - - PROCEDURE System*(cmd : ARRAY OF CHAR): INTEGER; - VAR r : INTEGER; - BEGIN - r := sys(cmd); - RETURN r - END System; - - PROCEDURE -SizeofUnixStat(): INTEGER - "sizeof(Unix_Status)"; - - PROCEDURE -SizeofStat(): INTEGER - "sizeof(struct stat)"; - - PROCEDURE -Error(msg: ARRAY OF CHAR; len: INTEGER) - "write(1/*stdout*/, msg, len); char ch = 0xa; write(1, &ch, 1)"; - - PROCEDURE StatCheck; - VAR x, y: LONGINT; - BEGIN - x := SizeofUnixStat(); - y := SizeofStat(); - IF x # y THEN - Error("Unix.StatCheck: inconsistent usage of struct stat", 49); - Exit(1); - END - END StatCheck; - -BEGIN - - StatCheck(); -END Unix. diff --git a/src/system/linux/clang/x86/Args.Mod b/src/system/linux/clang/x86/Args.Mod deleted file mode 100644 index c6b7b56e..00000000 --- a/src/system/linux/clang/x86/Args.Mod +++ /dev/null @@ -1,65 +0,0 @@ -MODULE Args; (* jt, 8.12.94 *) - - (* command line argument handling for voc (jet backend) *) - - - IMPORT SYSTEM; - - TYPE - ArgPtr = POINTER TO ARRAY 1024 OF CHAR; - ArgVec = POINTER TO ARRAY 1024 OF ArgPtr; - - VAR argc-, argv-: LONGINT; - (*PROCEDURE -includestdlib() "#include ";*) - PROCEDURE -externgetenv() "extern char *getenv(const char *name);"; (* took this from stdlib.h*) - PROCEDURE -Argc(): INTEGER "SYSTEM_argc"; - PROCEDURE -Argv(): LONGINT "(long)SYSTEM_argv"; - PROCEDURE -getenv(var: ARRAY OF CHAR): ArgPtr - "(Args_ArgPtr)getenv(var)"; - - PROCEDURE Get*(n: INTEGER; VAR val: ARRAY OF CHAR); - VAR av: ArgVec; - BEGIN - IF n < argc THEN av := SYSTEM.VAL(ArgVec, argv); COPY(av[n]^, val) END - END Get; - - PROCEDURE GetInt*(n: INTEGER; VAR val: LONGINT); - VAR s: ARRAY 64 OF CHAR; k, d, i: LONGINT; - BEGIN - s := ""; Get(n, s); i := 0; - IF s[0] = "-" THEN i := 1 END ; - k := 0; d := ORD(s[i]) - ORD("0"); - WHILE (d >= 0 ) & (d <= 9) DO k := k*10 + d; INC(i); d := ORD(s[i]) - ORD("0") END ; - IF s[0] = "-" THEN d := -d; DEC(i) END ; - IF i > 0 THEN val := k END - END GetInt; - - PROCEDURE Pos*(s: ARRAY OF CHAR): INTEGER; - VAR i: INTEGER; arg: ARRAY 256 OF CHAR; - BEGIN - i := 0; Get(i, arg); - WHILE (i < argc) & (s # arg) DO INC(i); Get(i, arg) END ; - RETURN i - END Pos; - - PROCEDURE GetEnv*(var: ARRAY OF CHAR; VAR val: ARRAY OF CHAR); - VAR p: ArgPtr; - BEGIN - p := getenv(var); - IF p # NIL THEN COPY(p^, val) END - END GetEnv; - - PROCEDURE getEnv*(var: ARRAY OF CHAR; VAR val: ARRAY OF CHAR): BOOLEAN; - VAR p: ArgPtr; - BEGIN - p := getenv(var); - IF p # NIL THEN - COPY(p^, val); - RETURN TRUE - ELSE - RETURN FALSE - END - END getEnv; - -BEGIN argc := Argc(); argv := Argv() -END Args. diff --git a/src/system/linux/clang/x86/Files.Mod b/src/system/linux/clang/x86/Files.Mod deleted file mode 100644 index 6307407d..00000000 --- a/src/system/linux/clang/x86/Files.Mod +++ /dev/null @@ -1,663 +0,0 @@ -MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files *) -(* modified version of Files, which opens only the file provided and does not scan any path in any environment variable, also ReadLine procedure added; -- noch *) - IMPORT SYSTEM, Unix, Kernel, Args, Console; - - (* standard data type I/O - - little endian, - Sint:1, Int:2, Lint:4 - ORD({0}) = 1, - false = 0, true =1 - IEEE real format, - null terminated strings, - compact numbers according to M.Odersky *) - - - CONST - nofbufs = 4; - bufsize = 4096; - fileTabSize = 64; - noDesc = -1; - notDone = -1; - - (* file states *) - open = 0; create = 1; close = 2; - - - TYPE - FileName = ARRAY 101 OF CHAR; - File* = POINTER TO Handle; - Buffer = POINTER TO BufDesc; - - Handle = RECORD - workName, registerName: FileName; - tempFile: BOOLEAN; - dev, ino, mtime: LONGINT; - fd-, len, pos: LONGINT; - bufs: ARRAY nofbufs OF Buffer; - swapper, state: INTEGER - END ; - - BufDesc = RECORD - f: File; - chg: BOOLEAN; - org, size: LONGINT; - data: ARRAY bufsize OF SYSTEM.BYTE - END ; - - Rider* = RECORD - res*: LONGINT; - eof*: BOOLEAN; - buf: Buffer; - org, offset: LONGINT - END ; - - Time = POINTER TO TimeDesc; - TimeDesc = RECORD - sec*, min*, hour*, mday*, mon*, year*, wday*, isdst*, zone*, gmtoff*: LONGINT; -(* sec*, min*, hour*, mday*, mon*, year*, wday*, isdst*, zone*, gmtoff*: INTEGER;*) - END ; - - VAR - fileTab: ARRAY fileTabSize OF LONGINT (*=File*); - tempno: INTEGER; - -(* for localtime *) - PROCEDURE -includetime() - '#include "time.h"'; - - PROCEDURE -localtime(VAR clock: LONGINT): Time - "(Files_Time) localtime(clock)"; - - PROCEDURE -getcwd(VAR cwd: Unix.Name) - "getcwd(cwd, cwd__len)"; - - PROCEDURE -IdxTrap "__HALT(-1)"; - - PROCEDURE^ Finalize(o: SYSTEM.PTR); - - PROCEDURE Err(s: ARRAY OF CHAR; f: File; errno: LONGINT); - BEGIN - Console.Ln; Console.String("-- "); Console.String(s); Console.String(": "); - IF f # NIL THEN - IF f.registerName # "" THEN Console.String(f.registerName) ELSE Console.String(f.workName) END - END ; - IF errno # 0 THEN Console.String(" errno = "); Console.Int(errno, 1) END ; - Console.Ln; - HALT(99) - END Err; - - PROCEDURE MakeFileName(dir, name: ARRAY OF CHAR; VAR dest: ARRAY OF CHAR); - VAR i, j: INTEGER; - BEGIN i := 0; j := 0; - WHILE dir[i] # 0X DO dest[i] := dir[i]; INC(i) END ; - IF dest[i-1] # "/" THEN dest[i] := "/"; INC(i) END ; - WHILE name[j] # 0X DO dest[i] := name[j]; INC(i); INC(j) END ; - dest[i] := 0X - END MakeFileName; - - PROCEDURE GetTempName(finalName: ARRAY OF CHAR; VAR name: ARRAY OF CHAR); - VAR n, i, j: LONGINT; - BEGIN - INC(tempno); n := tempno; i := 0; - IF finalName[0] # "/" THEN (* relative pathname *) - WHILE Kernel.CWD[i] # 0X DO name[i] := Kernel.CWD[i]; INC(i) END; - IF Kernel.CWD[i-1] # "/" THEN name[i] := "/"; INC(i) END - END; - j := 0; - WHILE finalName[j] # 0X DO name[i] := finalName[j]; INC(i); INC(j) END; - DEC(i); - WHILE name[i] # "/" DO DEC(i) END; - name[i+1] := "."; name[i+2] := "t"; name[i+3] := "m"; name[i+4] := "p"; name[i+5] := "."; INC(i, 6); - WHILE n > 0 DO name[i] := CHR(n MOD 10 + ORD("0")); n := n DIV 10; INC(i) END; - name[i] := "."; INC(i); n := SHORT(Unix.Getpid()); - WHILE n > 0 DO name[i] := CHR(n MOD 10 + ORD("0")); n := n DIV 10; INC(i) END; - name[i] := 0X - END GetTempName; - - PROCEDURE Create(f: File); - VAR stat: Unix.Status; done: BOOLEAN; - errno: LONGINT; err: ARRAY 32 OF CHAR; - BEGIN - IF f.fd = noDesc THEN - IF f.state = create THEN GetTempName(f.registerName, f.workName); f.tempFile := TRUE - ELSIF f.state = close THEN - f.workName := f.registerName; f.registerName := ""; f.tempFile := FALSE - END ; - errno := Unix.Unlink(f.workName); (*unlink first to avoid stale NFS handles and to avoid reuse of inodes*) - f.fd := Unix.Open(f.workName, Unix.rdwr + Unix.creat + Unix.trunc, {2, 4,5, 7,8}); - done := f.fd >= 0; errno := Unix.errno(); - IF (~done & ((errno = Unix.ENFILE) OR (errno = Unix.EMFILE))) OR (done & (f.fd >= fileTabSize)) THEN - IF done & (f.fd >= fileTabSize) THEN errno := Unix.Close(f.fd) END ; - Kernel.GC(TRUE); - f.fd := Unix.Open(f.workName, Unix.rdwr + Unix.creat + Unix.trunc, {2, 4,5, 7,8}); - done := f.fd >= 0 - END ; - IF done THEN - IF f.fd >= fileTabSize THEN errno := Unix.Close(f.fd); Err("too many files open", f, 0) - ELSE fileTab[f.fd] := SYSTEM.VAL(LONGINT, f); INC(Kernel.nofiles); Kernel.RegisterObject(f, Finalize); - f.state := open; f.pos := 0; errno := Unix.Fstat(f.fd, stat); - f.dev := stat.dev; f.ino := stat.ino; f.mtime := stat.mtime - END - ELSE errno := Unix.errno(); - IF errno = Unix.ENOENT THEN err := "no such directory" - ELSIF (errno = Unix.ENFILE) OR (errno = Unix.EMFILE) THEN err := "too many files open" - ELSE err := "file not created" - END ; - Err(err, f, errno) - END - END - END Create; - - PROCEDURE Flush(buf: Buffer); - VAR res: LONGINT; f: File; stat: Unix.Status; - BEGIN - IF buf.chg THEN f := buf.f; Create(f); - IF buf.org # f.pos THEN res := Unix.Lseek(f.fd, buf.org, 0) END ; - res := Unix.Write(f.fd, SYSTEM.ADR(buf.data), buf.size); - IF res < 0 THEN Err("error in writing file", f, Unix.errno()) END ; - f.pos := buf.org + buf.size; - buf.chg := FALSE; - res := Unix.Fstat(f.fd, stat); - f.mtime := stat.mtime - END - END Flush; - - PROCEDURE Close* (f: File); - VAR i, res: LONGINT; - BEGIN - IF (f.state # create) OR (f.registerName # "") THEN - Create(f); i := 0; - WHILE (i < nofbufs) & (f.bufs[i] # NIL) DO Flush(f.bufs[i]); INC(i) END ; - res := Unix.Fsync(f.fd); - IF res < 0 THEN Err("error in writing file", f, Unix.errno()) END - END - END Close; - - PROCEDURE Length* (f: File): LONGINT; - BEGIN RETURN f.len - END Length; - - PROCEDURE New* (name: ARRAY OF CHAR): File; - VAR f: File; - BEGIN - NEW(f); f.workName := ""; COPY(name, f.registerName); - f.fd := noDesc; f.state := create; f.len := 0; f.pos := 0; f.swapper := -1; (*all f.buf[i] = NIL*) - RETURN f - END New; -(* - PROCEDURE ScanPath(VAR pos: INTEGER; VAR dir: ARRAY OF CHAR); (* supports ~, ~user and blanks inside path *) - VAR i: INTEGER; ch: CHAR; home: ARRAY 256 OF CHAR; - BEGIN - i := 0; ch := Kernel.OBERON[pos]; - WHILE (ch = " ") OR (ch = ":") DO INC(pos); ch := Kernel.OBERON[pos] END ; - IF ch = "~" THEN - INC(pos); ch := Kernel.OBERON[pos]; - home := ""; Args.GetEnv("HOME", home); - WHILE home[i] # 0X DO dir[i] := home[i]; INC(i) END ; - IF (ch # "/") & (ch # 0X) & (ch # ":") & (ch # " ") THEN - WHILE (i > 0) & (dir[i-1] # "/") DO DEC(i) END - END - END ; - WHILE (ch # 0X) & (ch # ":") DO dir[i] := ch; INC(i); INC(pos); ch := Kernel.OBERON[pos] END ; - WHILE (i > 0) & (dir[i-1] = " ") DO DEC(i) END ; - dir[i] := 0X - END ScanPath; -*) - PROCEDURE HasDir(VAR name: ARRAY OF CHAR): BOOLEAN; - VAR i: INTEGER; ch: CHAR; - BEGIN i := 0; ch := name[0]; - WHILE (ch # 0X) & (ch # "/") DO INC(i); ch := name[i] END ; - RETURN ch = "/" - END HasDir; - - PROCEDURE CacheEntry(dev, ino: LONGINT; mtime: LONGINT): File; - VAR f: File; i: INTEGER; stat: Unix.Status; res: LONGINT; - BEGIN i := 0; - WHILE i < fileTabSize DO - f := SYSTEM.VAL(File, fileTab[i]); - IF (f # NIL) & (ino = f.ino) & (dev = f.dev) THEN - IF mtime # f.mtime THEN i := 0; - WHILE i < nofbufs DO - IF f.bufs[i] # NIL THEN f.bufs[i].org := -1; f.bufs[i] := NIL END ; - INC(i) - END ; - f.swapper := -1; f.mtime := mtime; - res := Unix.Fstat(f.fd, stat); f.len := stat.size - END ; - RETURN f - END ; - INC(i) - END ; - RETURN NIL - END CacheEntry; - - PROCEDURE Old* (name: ARRAY OF CHAR): File; - VAR f: File; fd, res, errno: LONGINT; pos: INTEGER; done: BOOLEAN; - dir, path: ARRAY 256 OF CHAR; - stat: Unix.Status; - BEGIN - IF name # "" THEN - IF HasDir(name) THEN dir := ""; COPY(name, path) - ELSE - pos := 0; - COPY(name, path); (* -- noch *) - (*ScanPath(pos, dir);*) (*MakeFileName(dir, name, path);*) (*ScanPath(pos, dir)*) - END ; - LOOP - fd := Unix.Open(path, Unix.rdwr, {}); done := fd >= 0; errno := Unix.errno(); - IF (~done & ((errno = Unix.ENFILE) OR (errno = Unix.EMFILE))) OR (done & (fd >= fileTabSize)) THEN - IF done & (fd >= fileTabSize) THEN res := Unix.Close(fd) END ; - Kernel.GC(TRUE); - fd := Unix.Open(path, Unix.rdwr, {}); - done := fd >= 0; errno := Unix.errno(); - IF ~done & ((errno = Unix.ENFILE) OR (errno = Unix.EMFILE)) THEN Err("too many files open", f, errno) END - END ; - IF ~done & ((errno = Unix.EACCES) OR (errno = Unix.EROFS) OR (errno = Unix.EAGAIN)) THEN - (* errno EAGAIN observed on Solaris 2.4 *) - fd := Unix.Open(path, Unix.rdonly, {}); done := fd >= 0; errno := Unix.errno() - END ; -IF (~done) & (errno # Unix.ENOENT) THEN - Console.String("warning Files.Old "); Console.String(name); - Console.String(" errno = "); Console.Int(errno, 0); Console.Ln; -END ; - IF done THEN - res := Unix.Fstat(fd, stat); - f := CacheEntry(stat.dev, stat.ino, stat.mtime); - IF f # NIL THEN res := Unix.Close(fd); RETURN f - ELSIF fd >= fileTabSize THEN res := Unix.Close(fd); Err("too many files open", f, 0) - ELSE NEW(f); fileTab[fd] := SYSTEM.VAL(LONGINT, f); INC(Kernel.nofiles); Kernel.RegisterObject(f, Finalize); - f.fd := fd; f.state := open; f.len := stat.size; f.pos := 0; f.swapper := -1; (*all f.buf[i] = NIL*) - COPY(name, f.workName); f.registerName := ""; f.tempFile := FALSE; - f.dev := stat.dev; f.ino := stat.ino; f.mtime := stat.mtime; - RETURN f - END - ELSIF dir = "" THEN RETURN NIL - ELSE (*MakeFileName(dir, name, path);*) (*ScanPath(pos, dir)*) - RETURN NIL - END - END - ELSE RETURN NIL - END - END Old; - - PROCEDURE Purge* (f: File); - VAR i: INTEGER; stat: Unix.Status; res: LONGINT; - BEGIN i := 0; - WHILE i < nofbufs DO - IF f.bufs[i] # NIL THEN f.bufs[i].org := -1; f.bufs[i] := NIL END ; - INC(i) - END ; - IF f.fd # noDesc THEN res := Unix.Ftruncate(f.fd, 0); res := Unix.Lseek(f.fd, 0, 0) END ; - f.pos := 0; f.len := 0; f.swapper := -1; - res := Unix.Fstat(f.fd, stat); f.mtime := stat.mtime - END Purge; - - PROCEDURE GetDate* (f: File; VAR t, d: LONGINT); - VAR stat: Unix.Status; clock, res: LONGINT; time: Time; - BEGIN - Create(f); res := Unix.Fstat(f.fd, stat); - time := localtime(stat.mtime); - t := time.sec + ASH(time.min, 6) + ASH(time.hour, 12); - d := time.mday + ASH(time.mon+1, 5) + ASH(time.year MOD 100, 9) - END GetDate; - - PROCEDURE Pos* (VAR r: Rider): LONGINT; - BEGIN RETURN r.org + r.offset - END Pos; - - PROCEDURE Set* (VAR r: Rider; f: File; pos: LONGINT); - VAR org, offset, i, n, res: LONGINT; buf: Buffer; - BEGIN - IF f # NIL THEN - IF pos > f.len THEN pos := f.len ELSIF pos < 0 THEN pos := 0 END ; - offset := pos MOD bufsize; org := pos - offset; i := 0; - WHILE (i < nofbufs) & (f.bufs[i] # NIL) & (org # f.bufs[i].org) DO INC(i) END ; - IF i < nofbufs THEN - IF f.bufs[i] = NIL THEN NEW(buf); buf.chg := FALSE; buf.org := -1; buf.f := f; f.bufs[i] := buf - ELSE buf := f.bufs[i] - END - ELSE - f.swapper := (f.swapper + 1) MOD nofbufs; - buf := f.bufs[f.swapper]; - Flush(buf) - END ; - IF buf.org # org THEN - IF org = f.len THEN buf.size := 0 - ELSE Create(f); - IF f.pos # org THEN res := Unix.Lseek(f.fd, org, 0) END ; - n := Unix.ReadBlk(f.fd, buf.data); - IF n < 0 THEN Err("read from file not done", f, Unix.errno()) END ; - f.pos := org + n; - buf.size := n - END ; - buf.org := org; buf.chg := FALSE - END - ELSE buf := NIL; org := 0; offset := 0 - END ; - r.buf := buf; r.org := org; r.offset := offset; r.eof := FALSE; r.res := 0 - END Set; - - PROCEDURE Read* (VAR r: Rider; VAR x: SYSTEM.BYTE); - VAR offset: LONGINT; buf: Buffer; - BEGIN - buf := r.buf; offset := r.offset; - IF r.org # buf.org THEN Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset END ; - IF (offset < buf.size) THEN - x := buf.data[offset]; r.offset := offset + 1 - ELSIF r.org + offset < buf.f.len THEN - Set(r, r.buf.f, r.org + offset); - x := r.buf.data[0]; r.offset := 1 - ELSE - x := 0X; r.eof := TRUE - END - END Read; - - PROCEDURE ReadBytes* (VAR r: Rider; VAR x: ARRAY OF SYSTEM.BYTE; n: LONGINT); - VAR xpos, min, restInBuf, offset: LONGINT; buf: Buffer; - BEGIN - IF n > LEN(x) THEN IdxTrap END ; - xpos := 0; buf := r.buf; offset := r.offset; - WHILE n > 0 DO - IF (r.org # buf.org) OR (offset >= bufsize) THEN - Set(r, buf.f, r.org + offset); - buf := r.buf; offset := r.offset - END ; - restInBuf := buf.size - offset; - IF restInBuf = 0 THEN r.res := n; r.eof := TRUE; RETURN - ELSIF n > restInBuf THEN min := restInBuf ELSE min := n END ; - SYSTEM.MOVE(SYSTEM.ADR(buf.data) + offset, SYSTEM.ADR(x) + xpos, min); - INC(offset, min); r.offset := offset; INC(xpos, min); DEC(n, min) - END ; - r.res := 0; r.eof := FALSE - END ReadBytes; - - PROCEDURE ReadByte* (VAR r : Rider; VAR x : ARRAY OF SYSTEM.BYTE); - BEGIN - ReadBytes(r, x, 1); - END ReadByte; - - PROCEDURE Base* (VAR r: Rider): File; - BEGIN RETURN r.buf.f - END Base; - - PROCEDURE Write* (VAR r: Rider; x: SYSTEM.BYTE); - VAR buf: Buffer; offset: LONGINT; - BEGIN - buf := r.buf; offset := r.offset; - IF (r.org # buf.org) OR (offset >= bufsize) THEN - Set(r, buf.f, r.org + offset); - buf := r.buf; offset := r.offset - END ; - buf.data[offset] := x; - buf.chg := TRUE; - IF offset = buf.size THEN - INC(buf.size); INC(buf.f.len) - END ; - r.offset := offset + 1; r.res := 0 - END Write; - - PROCEDURE WriteByte* (VAR r : Rider; x : SYSTEM.BYTE); (* added for compatibility with PO 2013, -- noch *) - BEGIN - Write(r, x); - END WriteByte; - - PROCEDURE WriteBytes* (VAR r: Rider; VAR x: ARRAY OF SYSTEM.BYTE; n: LONGINT); - VAR xpos, min, restInBuf, offset: LONGINT; buf: Buffer; - BEGIN - IF n > LEN(x) THEN IdxTrap END ; - xpos := 0; buf := r.buf; offset := r.offset; - WHILE n > 0 DO - IF (r.org # buf.org) OR (offset >= bufsize) THEN - Set(r, buf.f, r.org + offset); - buf := r.buf; offset := r.offset - END ; - restInBuf := bufsize - offset; - IF n > restInBuf THEN min := restInBuf ELSE min := n END ; - SYSTEM.MOVE(SYSTEM.ADR(x) + xpos, SYSTEM.ADR(buf.data) + offset, min); - INC(offset, min); r.offset := offset; - IF offset > buf.size THEN INC(buf.f.len, offset - buf.size); buf.size := offset END ; - INC(xpos, min); DEC(n, min); buf.chg := TRUE - END ; - r.res := 0 - END WriteBytes; - -(* another solution would be one that is similar to ReadBytes, WriteBytes. -No code duplication, more symmetric, only two ifs for -Read and Write in buffer, buf.size replaced by bufsize in Write ops, buf.size and len -must be made consistent with offset (if offset > buf.size) in a lazy way. - -PROCEDURE Write* (VAR r: Rider; x: SYSTEM.BYTE); - VAR buf: Buffer; offset: LONGINT; -BEGIN - buf := r.buf; offset := r.offset; - IF (offset >= bufsize) OR (r.org # buf.org) THEN - Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset; - END ; - buf.data[offset] := x; r.offset := offset + 1; buf.chg := TRUE -END Write; - - -PROCEDURE WriteBytes ... - -PROCEDURE Read* (VAR r: Rider; VAR x: SYSTEM.BYTE); - VAR offset: LONGINT; buf: Buffer; -BEGIN - buf := r.buf; offset := r.offset; - IF (offset >= buf.size) OR (r.org # buf.org) THEN - IF r.org + offset >= buf.f.len THEN x := 0X; r.eof := TRUE; RETURN - ELSE Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset - END - END ; - x := buf.data[offset]; r.offset := offset + 1 -END Read; - -but this would also affect Set, Length, and Flush. -Especially Length would become fairly complex. -*) - - PROCEDURE Delete* (name: ARRAY OF CHAR; VAR res: INTEGER); - BEGIN - res := SHORT(Unix.Unlink(name)); - res := SHORT(Unix.errno()) - END Delete; - - PROCEDURE Rename* (old, new: ARRAY OF CHAR; VAR res: INTEGER); - VAR fdold, fdnew, n, errno, r: LONGINT; - ostat, nstat: Unix.Status; - buf: ARRAY 4096 OF CHAR; - BEGIN - r := Unix.Stat(old, ostat); - IF r >= 0 THEN - r := Unix.Stat(new, nstat); - IF (r >= 0) & ((ostat.dev # nstat.dev) OR (ostat.ino # nstat.ino)) THEN - Delete(new, res); (* work around stale nfs handles *) - END ; - r := Unix.Rename(old, new); - IF r < 0 THEN res := SHORT(Unix.errno()); - IF res = Unix.EXDEV THEN (* cross device link, move the file *) - fdold := Unix.Open(old, Unix.rdonly, {}); - IF fdold < 0 THEN res := 2; RETURN END ; - fdnew := Unix.Open(new, Unix.rdwr + Unix.creat + Unix.trunc, {2, 4,5, 7,8}); - IF fdnew < 0 THEN r := Unix.Close(fdold); res := 3; RETURN END ; - n := Unix.Read(fdold, SYSTEM.ADR(buf), bufsize); - WHILE n > 0 DO - r := Unix.Write(fdnew, SYSTEM.ADR(buf), n); - IF r < 0 THEN errno := Unix.errno(); r := Unix.Close(fdold); r := Unix.Close(fdnew); - Err("cannot move file", NIL, errno) - END ; - n := Unix.Read(fdold, SYSTEM.ADR(buf), bufsize) - END ; - errno := Unix.errno(); - r := Unix.Close(fdold); r := Unix.Close(fdnew); - IF n = 0 THEN r := Unix.Unlink(old); res := 0 - ELSE Err("cannot move file", NIL, errno) - END ; - ELSE RETURN (* res is Unix.Rename return code *) - END - END ; - res := 0 - ELSE res := 2 (* old file not found *) - END - END Rename; - - PROCEDURE Register* (f: File); - VAR idx, errno: INTEGER; f1: File; file: ARRAY 104 OF CHAR; - BEGIN - IF (f.state = create) & (f.registerName # "") THEN f.state := close (* shortcut renaming *) END ; - Close(f); - IF f.registerName # "" THEN - Rename(f.workName, f.registerName, errno); - IF errno # 0 THEN COPY(f.registerName, file); HALT(99) END ; - f.workName := f.registerName; f.registerName := ""; f.tempFile := FALSE - END - END Register; - - PROCEDURE ChangeDirectory*(path: ARRAY OF CHAR; VAR res: INTEGER); - BEGIN - res := SHORT(Unix.Chdir(path)); - getcwd(Kernel.CWD) - END ChangeDirectory; - - PROCEDURE FlipBytes(VAR src, dest: ARRAY OF SYSTEM.BYTE); - VAR i, j: LONGINT; - BEGIN - IF ~Kernel.littleEndian THEN i := LEN(src); j := 0; - WHILE i > 0 DO DEC(i); dest[j] := src[i]; INC(j) END - ELSE SYSTEM.MOVE(SYSTEM.ADR(src), SYSTEM.ADR(dest), LEN(src)) - END - END FlipBytes; - - PROCEDURE ReadBool* (VAR R: Rider; VAR x: BOOLEAN); - BEGIN Read(R, SYSTEM.VAL(CHAR, x)) - END ReadBool; - - PROCEDURE ReadInt* (VAR R: Rider; VAR x: INTEGER); - VAR b: ARRAY 2 OF CHAR; - BEGIN ReadBytes(R, b, 2); - x := ORD(b[0]) + ORD(b[1])*256 - END ReadInt; - - PROCEDURE ReadLInt* (VAR R: Rider; VAR x: LONGINT); - VAR b: ARRAY 4 OF CHAR; - BEGIN ReadBytes(R, b, 4); - x := ORD(b[0]) + ORD(b[1])*100H + ORD(b[2])*10000H + ORD(b[3])*1000000H - END ReadLInt; - - PROCEDURE ReadSet* (VAR R: Rider; VAR x: SET); - VAR b: ARRAY 4 OF CHAR; - BEGIN ReadBytes(R, b, 4); - x := SYSTEM.VAL(SET, ORD(b[0]) + ORD(b[1])*100H + ORD(b[2])*10000H + ORD(b[3])*1000000H) - END ReadSet; - - PROCEDURE ReadReal* (VAR R: Rider; VAR x: REAL); - VAR b: ARRAY 4 OF CHAR; - BEGIN ReadBytes(R, b, 4); FlipBytes(b, x) - END ReadReal; - - PROCEDURE ReadLReal* (VAR R: Rider; VAR x: LONGREAL); - VAR b: ARRAY 8 OF CHAR; - BEGIN ReadBytes(R, b, 8); FlipBytes(b, x) - END ReadLReal; - - PROCEDURE ReadString* (VAR R: Rider; VAR x: ARRAY OF CHAR); - VAR i: INTEGER; ch: CHAR; - BEGIN i := 0; - REPEAT Read(R, ch); x[i] := ch; INC(i) UNTIL ch = 0X - END ReadString; - - (* need to read line; -- noch *) - PROCEDURE ReadLine* (VAR R: Rider; VAR x: ARRAY OF CHAR); - VAR i: INTEGER; ch: CHAR; b : BOOLEAN; - BEGIN i := 0; - b := FALSE; - REPEAT - Read(R, ch); - IF ((ch = 0X) OR (ch = 0AX) OR (ch = 0DX)) THEN - b := TRUE - ELSE - x[i] := ch; - INC(i); - END; - UNTIL b - END ReadLine; - - PROCEDURE ReadNum* (VAR R: Rider; VAR x: LONGINT); - VAR s: SHORTINT; ch: CHAR; n: LONGINT; - BEGIN s := 0; n := 0; Read(R, ch); - WHILE ORD(ch) >= 128 DO INC(n, ASH(ORD(ch) - 128, s) ); INC(s, 7); Read(R, ch) END; - INC(n, ASH(ORD(ch) MOD 64 - ORD(ch) DIV 64 * 64, s) ); - x := n - END ReadNum; - - PROCEDURE WriteBool* (VAR R: Rider; x: BOOLEAN); - BEGIN Write(R, SYSTEM.VAL(CHAR, x)) - END WriteBool; - - PROCEDURE WriteInt* (VAR R: Rider; x: INTEGER); - VAR b: ARRAY 2 OF CHAR; - BEGIN b[0] := CHR(x); b[1] := CHR(x DIV 256); - WriteBytes(R, b, 2); - END WriteInt; - - PROCEDURE WriteLInt* (VAR R: Rider; x: LONGINT); - VAR b: ARRAY 4 OF CHAR; - BEGIN - b[0] := CHR(x); b[1] := CHR(x DIV 100H); b[2] := CHR(x DIV 10000H); b[3] := CHR(x DIV 1000000H); - WriteBytes(R, b, 4); - END WriteLInt; - - PROCEDURE WriteSet* (VAR R: Rider; x: SET); - VAR b: ARRAY 4 OF CHAR; i: LONGINT; - BEGIN i := SYSTEM.VAL(LONGINT, x); - 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; - - PROCEDURE WriteReal* (VAR R: Rider; x: REAL); - VAR b: ARRAY 4 OF CHAR; - BEGIN FlipBytes(x, b); WriteBytes(R, b, 4) - END WriteReal; - - PROCEDURE WriteLReal* (VAR R: Rider; x: LONGREAL); - VAR b: ARRAY 8 OF CHAR; - BEGIN FlipBytes(x, b); WriteBytes(R, b, 8) - END WriteLReal; - - PROCEDURE WriteString* (VAR R: Rider; x: ARRAY [1] OF CHAR); - VAR i: INTEGER; - BEGIN i := 0; - WHILE x[i] # 0X DO INC(i) END ; - WriteBytes(R, x, i+1) - END WriteString; - - PROCEDURE WriteNum* (VAR R: Rider; x: LONGINT); - BEGIN - WHILE (x < - 64) OR (x > 63) DO Write(R, CHR(x MOD 128 + 128)); x := x DIV 128 END; - Write(R, CHR(x MOD 128)) - END WriteNum; - - PROCEDURE GetName*(f: File; VAR name: ARRAY OF CHAR); - BEGIN - COPY (f.workName, name); - END GetName; - - PROCEDURE Finalize(o: SYSTEM.PTR); - VAR f: File; res: LONGINT; - BEGIN - f := SYSTEM.VAL(File, o); - IF f.fd >= 0 THEN - fileTab[f.fd] := 0; res := Unix.Close(f.fd); f.fd := -1; DEC(Kernel.nofiles); - IF f.tempFile THEN res := Unix.Unlink(f.workName) END - END - END Finalize; - - PROCEDURE Init; - VAR i: LONGINT; - BEGIN - i := 0; WHILE i < fileTabSize DO fileTab[i] := 0; INC(i) END ; - tempno := -1; Kernel.nofiles := 0 - END Init; - -BEGIN Init -END Files. diff --git a/src/system/linux/clang/x86/Files0.Mod b/src/system/linux/clang/x86/Files0.Mod deleted file mode 100644 index 4f021ede..00000000 --- a/src/system/linux/clang/x86/Files0.Mod +++ /dev/null @@ -1,635 +0,0 @@ -MODULE Files0; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files *) - -(* this module is not for use by developers and inteded to bootstrap voc *) -(* for general use import Files module *) - - IMPORT SYSTEM, Unix, Kernel := Kernel0, Args, Console; - - (* standard data type I/O - - little endian, - Sint:1, Int:2, Lint:4 - ORD({0}) = 1, - false = 0, true =1 - IEEE real format, - null terminated strings, - compact numbers according to M.Odersky *) - - - CONST - nofbufs = 4; - bufsize = 4096; - fileTabSize = 64; - noDesc = -1; - notDone = -1; - - (* file states *) - open = 0; create = 1; close = 2; - - - TYPE - FileName = ARRAY 101 OF CHAR; - File* = POINTER TO Handle; - Buffer = POINTER TO BufDesc; - - Handle = RECORD - workName, registerName: FileName; - tempFile: BOOLEAN; - dev, ino, mtime: LONGINT; - fd-, len, pos: LONGINT; - bufs: ARRAY nofbufs OF Buffer; - swapper, state: INTEGER - END ; - - BufDesc = RECORD - f: File; - chg: BOOLEAN; - org, size: LONGINT; - data: ARRAY bufsize OF SYSTEM.BYTE - END ; - - Rider* = RECORD - res*: LONGINT; - eof*: BOOLEAN; - buf: Buffer; - org, offset: LONGINT - END ; - - Time = POINTER TO TimeDesc; - TimeDesc = RECORD - sec*, min*, hour*, mday*, mon*, year*, wday*, isdst*, zone*, gmtoff*: LONGINT; -(* sec*, min*, hour*, mday*, mon*, year*, wday*, isdst*, zone*, gmtoff*: INTEGER;*) - END ; - - VAR - fileTab: ARRAY fileTabSize OF LONGINT (*=File*); - tempno: INTEGER; - -(* for localtime *) - PROCEDURE -includetime() - '#include "time.h"'; - - PROCEDURE -localtime(VAR clock: LONGINT): Time - "(Files0_Time) localtime(clock)"; - - PROCEDURE -getcwd(VAR cwd: Unix.Name) - "getcwd(cwd, cwd__len)"; - - PROCEDURE -IdxTrap "__HALT(-1)"; - - PROCEDURE^ Finalize(o: SYSTEM.PTR); - - PROCEDURE Err(s: ARRAY OF CHAR; f: File; errno: LONGINT); - BEGIN - Console.Ln; Console.String("-- "); Console.String(s); Console.String(": "); - IF f # NIL THEN - IF f.registerName # "" THEN Console.String(f.registerName) ELSE Console.String(f.workName) END - END ; - IF errno # 0 THEN Console.String(" errno = "); Console.Int(errno, 1) END ; - Console.Ln; - HALT(99) - END Err; - - PROCEDURE MakeFileName(dir, name: ARRAY OF CHAR; VAR dest: ARRAY OF CHAR); - VAR i, j: INTEGER; - BEGIN i := 0; j := 0; - WHILE dir[i] # 0X DO dest[i] := dir[i]; INC(i) END ; - IF dest[i-1] # "/" THEN dest[i] := "/"; INC(i) END ; - WHILE name[j] # 0X DO dest[i] := name[j]; INC(i); INC(j) END ; - dest[i] := 0X - END MakeFileName; - - PROCEDURE GetTempName(finalName: ARRAY OF CHAR; VAR name: ARRAY OF CHAR); - VAR n, i, j: LONGINT; - BEGIN - INC(tempno); n := tempno; i := 0; - IF finalName[0] # "/" THEN (* relative pathname *) - WHILE Kernel.CWD[i] # 0X DO name[i] := Kernel.CWD[i]; INC(i) END; - IF Kernel.CWD[i-1] # "/" THEN name[i] := "/"; INC(i) END - END; - j := 0; - WHILE finalName[j] # 0X DO name[i] := finalName[j]; INC(i); INC(j) END; - DEC(i); - WHILE name[i] # "/" DO DEC(i) END; - name[i+1] := "."; name[i+2] := "t"; name[i+3] := "m"; name[i+4] := "p"; name[i+5] := "."; INC(i, 6); - WHILE n > 0 DO name[i] := CHR(n MOD 10 + ORD("0")); n := n DIV 10; INC(i) END; - name[i] := "."; INC(i); n := SHORT(Unix.Getpid()); - WHILE n > 0 DO name[i] := CHR(n MOD 10 + ORD("0")); n := n DIV 10; INC(i) END; - name[i] := 0X - END GetTempName; - - PROCEDURE Create(f: File); - VAR stat: Unix.Status; done: BOOLEAN; - errno: LONGINT; err: ARRAY 32 OF CHAR; - BEGIN - IF f.fd = noDesc THEN - IF f.state = create THEN GetTempName(f.registerName, f.workName); f.tempFile := TRUE - ELSIF f.state = close THEN - f.workName := f.registerName; f.registerName := ""; f.tempFile := FALSE - END ; - errno := Unix.Unlink(f.workName); (*unlink first to avoid stale NFS handles and to avoid reuse of inodes*) - f.fd := Unix.Open(f.workName, Unix.rdwr + Unix.creat + Unix.trunc, {2, 4,5, 7,8}); - done := f.fd >= 0; errno := Unix.errno(); - IF (~done & ((errno = Unix.ENFILE) OR (errno = Unix.EMFILE))) OR (done & (f.fd >= fileTabSize)) THEN - IF done & (f.fd >= fileTabSize) THEN errno := Unix.Close(f.fd) END ; - Kernel.GC(TRUE); - f.fd := Unix.Open(f.workName, Unix.rdwr + Unix.creat + Unix.trunc, {2, 4,5, 7,8}); - done := f.fd >= 0 - END ; - IF done THEN - IF f.fd >= fileTabSize THEN errno := Unix.Close(f.fd); Err("too many files open", f, 0) - ELSE fileTab[f.fd] := SYSTEM.VAL(LONGINT, f); INC(Kernel.nofiles); Kernel.RegisterObject(f, Finalize); - f.state := open; f.pos := 0; errno := Unix.Fstat(f.fd, stat); - f.dev := stat.dev; f.ino := stat.ino; f.mtime := stat.mtime - END - ELSE errno := Unix.errno(); - IF errno = Unix.ENOENT THEN err := "no such directory" - ELSIF (errno = Unix.ENFILE) OR (errno = Unix.EMFILE) THEN err := "too many files open" - ELSE err := "file not created" - END ; - Err(err, f, errno) - END - END - END Create; - - PROCEDURE Flush(buf: Buffer); - VAR res: LONGINT; f: File; stat: Unix.Status; - BEGIN - IF buf.chg THEN f := buf.f; Create(f); - IF buf.org # f.pos THEN res := Unix.Lseek(f.fd, buf.org, 0) END ; - res := Unix.Write(f.fd, SYSTEM.ADR(buf.data), buf.size); - IF res < 0 THEN Err("error in writing file", f, Unix.errno()) END ; - f.pos := buf.org + buf.size; - buf.chg := FALSE; - res := Unix.Fstat(f.fd, stat); - f.mtime := stat.mtime - END - END Flush; - - PROCEDURE Close* (f: File); - VAR i, res: LONGINT; - BEGIN - IF (f.state # create) OR (f.registerName # "") THEN - Create(f); i := 0; - WHILE (i < nofbufs) & (f.bufs[i] # NIL) DO Flush(f.bufs[i]); INC(i) END ; - res := Unix.Fsync(f.fd); - IF res < 0 THEN Err("error in writing file", f, Unix.errno()) END - END - END Close; - - PROCEDURE Length* (f: File): LONGINT; - BEGIN RETURN f.len - END Length; - - PROCEDURE New* (name: ARRAY OF CHAR): File; - VAR f: File; - BEGIN - NEW(f); f.workName := ""; COPY(name, f.registerName); - f.fd := noDesc; f.state := create; f.len := 0; f.pos := 0; f.swapper := -1; (*all f.buf[i] = NIL*) - RETURN f - END New; - - PROCEDURE ScanPath(VAR pos: INTEGER; VAR dir: ARRAY OF CHAR); (* supports ~, ~user and blanks inside path *) - VAR i: INTEGER; ch: CHAR; home: ARRAY 256 OF CHAR; - BEGIN - i := 0; ch := Kernel.OBERON[pos]; - WHILE (ch = " ") OR (ch = ":") DO INC(pos); ch := Kernel.OBERON[pos] END ; - IF ch = "~" THEN - INC(pos); ch := Kernel.OBERON[pos]; - home := ""; Args.GetEnv("HOME", home); - WHILE home[i] # 0X DO dir[i] := home[i]; INC(i) END ; - IF (ch # "/") & (ch # 0X) & (ch # ":") & (ch # " ") THEN - WHILE (i > 0) & (dir[i-1] # "/") DO DEC(i) END - END - END ; - WHILE (ch # 0X) & (ch # ":") DO dir[i] := ch; INC(i); INC(pos); ch := Kernel.OBERON[pos] END ; - WHILE (i > 0) & (dir[i-1] = " ") DO DEC(i) END ; - dir[i] := 0X - END ScanPath; - - PROCEDURE HasDir(VAR name: ARRAY OF CHAR): BOOLEAN; - VAR i: INTEGER; ch: CHAR; - BEGIN i := 0; ch := name[0]; - WHILE (ch # 0X) & (ch # "/") DO INC(i); ch := name[i] END ; - RETURN ch = "/" - END HasDir; - - PROCEDURE CacheEntry(dev, ino: LONGINT; mtime: LONGINT): File; - VAR f: File; i: INTEGER; stat: Unix.Status; res: LONGINT; - BEGIN i := 0; - WHILE i < fileTabSize DO - f := SYSTEM.VAL(File, fileTab[i]); - IF (f # NIL) & (ino = f.ino) & (dev = f.dev) THEN - IF mtime # f.mtime THEN i := 0; - WHILE i < nofbufs DO - IF f.bufs[i] # NIL THEN f.bufs[i].org := -1; f.bufs[i] := NIL END ; - INC(i) - END ; - f.swapper := -1; f.mtime := mtime; - res := Unix.Fstat(f.fd, stat); f.len := stat.size - END ; - RETURN f - END ; - INC(i) - END ; - RETURN NIL - END CacheEntry; - - PROCEDURE Old* (name: ARRAY OF CHAR): File; - VAR f: File; fd, res, errno: LONGINT; pos: INTEGER; done: BOOLEAN; - dir, path: ARRAY 256 OF CHAR; - stat: Unix.Status; - BEGIN - IF name # "" THEN - IF HasDir(name) THEN dir := ""; COPY(name, path) - ELSE pos := 0; ScanPath(pos, dir); MakeFileName(dir, name, path); ScanPath(pos, dir) - END ; - LOOP - fd := Unix.Open(path, Unix.rdwr, {}); done := fd >= 0; errno := Unix.errno(); - IF (~done & ((errno = Unix.ENFILE) OR (errno = Unix.EMFILE))) OR (done & (fd >= fileTabSize)) THEN - IF done & (fd >= fileTabSize) THEN res := Unix.Close(fd) END ; - Kernel.GC(TRUE); - fd := Unix.Open(path, Unix.rdwr, {}); - done := fd >= 0; errno := Unix.errno(); - IF ~done & ((errno = Unix.ENFILE) OR (errno = Unix.EMFILE)) THEN Err("too many files open", f, errno) END - END ; - IF ~done & ((errno = Unix.EACCES) OR (errno = Unix.EROFS) OR (errno = Unix.EAGAIN)) THEN - (* errno EAGAIN observed on Solaris 2.4 *) - fd := Unix.Open(path, Unix.rdonly, {}); done := fd >= 0; errno := Unix.errno() - END ; -IF (~done) & (errno # Unix.ENOENT) THEN - Console.String("warning Files0.Old "); Console.String(name); - Console.String(" errno = "); Console.Int(errno, 0); Console.Ln; -END ; - IF done THEN - res := Unix.Fstat(fd, stat); - f := CacheEntry(stat.dev, stat.ino, stat.mtime); - IF f # NIL THEN res := Unix.Close(fd); RETURN f - ELSIF fd >= fileTabSize THEN res := Unix.Close(fd); Err("too many files open", f, 0) - ELSE NEW(f); fileTab[fd] := SYSTEM.VAL(LONGINT, f); INC(Kernel.nofiles); Kernel.RegisterObject(f, Finalize); - f.fd := fd; f.state := open; f.len := stat.size; f.pos := 0; f.swapper := -1; (*all f.buf[i] = NIL*) - COPY(name, f.workName); f.registerName := ""; f.tempFile := FALSE; - f.dev := stat.dev; f.ino := stat.ino; f.mtime := stat.mtime; - RETURN f - END - ELSIF dir = "" THEN RETURN NIL - ELSE MakeFileName(dir, name, path); ScanPath(pos, dir) - END - END - ELSE RETURN NIL - END - END Old; - - PROCEDURE Purge* (f: File); - VAR i: INTEGER; stat: Unix.Status; res: LONGINT; - BEGIN i := 0; - WHILE i < nofbufs DO - IF f.bufs[i] # NIL THEN f.bufs[i].org := -1; f.bufs[i] := NIL END ; - INC(i) - END ; - IF f.fd # noDesc THEN res := Unix.Ftruncate(f.fd, 0); res := Unix.Lseek(f.fd, 0, 0) END ; - f.pos := 0; f.len := 0; f.swapper := -1; - res := Unix.Fstat(f.fd, stat); f.mtime := stat.mtime - END Purge; - - PROCEDURE GetDate* (f: File; VAR t, d: LONGINT); - VAR stat: Unix.Status; clock, res: LONGINT; time: Time; - BEGIN - Create(f); res := Unix.Fstat(f.fd, stat); - time := localtime(stat.mtime); - t := time.sec + ASH(time.min, 6) + ASH(time.hour, 12); - d := time.mday + ASH(time.mon+1, 5) + ASH(time.year MOD 100, 9) - END GetDate; - - PROCEDURE Pos* (VAR r: Rider): LONGINT; - BEGIN RETURN r.org + r.offset - END Pos; - - PROCEDURE Set* (VAR r: Rider; f: File; pos: LONGINT); - VAR org, offset, i, n, res: LONGINT; buf: Buffer; - BEGIN - IF f # NIL THEN - IF pos > f.len THEN pos := f.len ELSIF pos < 0 THEN pos := 0 END ; - offset := pos MOD bufsize; org := pos - offset; i := 0; - WHILE (i < nofbufs) & (f.bufs[i] # NIL) & (org # f.bufs[i].org) DO INC(i) END ; - IF i < nofbufs THEN - IF f.bufs[i] = NIL THEN NEW(buf); buf.chg := FALSE; buf.org := -1; buf.f := f; f.bufs[i] := buf - ELSE buf := f.bufs[i] - END - ELSE - f.swapper := (f.swapper + 1) MOD nofbufs; - buf := f.bufs[f.swapper]; - Flush(buf) - END ; - IF buf.org # org THEN - IF org = f.len THEN buf.size := 0 - ELSE Create(f); - IF f.pos # org THEN res := Unix.Lseek(f.fd, org, 0) END ; - n := Unix.ReadBlk(f.fd, buf.data); - IF n < 0 THEN Err("read from file not done", f, Unix.errno()) END ; - f.pos := org + n; - buf.size := n - END ; - buf.org := org; buf.chg := FALSE - END - ELSE buf := NIL; org := 0; offset := 0 - END ; - r.buf := buf; r.org := org; r.offset := offset; r.eof := FALSE; r.res := 0 - END Set; - - PROCEDURE Read* (VAR r: Rider; VAR x: SYSTEM.BYTE); - VAR offset: LONGINT; buf: Buffer; - BEGIN - buf := r.buf; offset := r.offset; - IF r.org # buf.org THEN Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset END ; - IF (offset < buf.size) THEN - x := buf.data[offset]; r.offset := offset + 1 - ELSIF r.org + offset < buf.f.len THEN - Set(r, r.buf.f, r.org + offset); - x := r.buf.data[0]; r.offset := 1 - ELSE - x := 0X; r.eof := TRUE - END - END Read; - - PROCEDURE ReadBytes* (VAR r: Rider; VAR x: ARRAY OF SYSTEM.BYTE; n: LONGINT); - VAR xpos, min, restInBuf, offset: LONGINT; buf: Buffer; - BEGIN - IF n > LEN(x) THEN IdxTrap END ; - xpos := 0; buf := r.buf; offset := r.offset; - WHILE n > 0 DO - IF (r.org # buf.org) OR (offset >= bufsize) THEN - Set(r, buf.f, r.org + offset); - buf := r.buf; offset := r.offset - END ; - restInBuf := buf.size - offset; - IF restInBuf = 0 THEN r.res := n; r.eof := TRUE; RETURN - ELSIF n > restInBuf THEN min := restInBuf ELSE min := n END ; - SYSTEM.MOVE(SYSTEM.ADR(buf.data) + offset, SYSTEM.ADR(x) + xpos, min); - INC(offset, min); r.offset := offset; INC(xpos, min); DEC(n, min) - END ; - r.res := 0; r.eof := FALSE - END ReadBytes; - - PROCEDURE ReadByte* (VAR r : Rider; VAR x : ARRAY OF SYSTEM.BYTE); - BEGIN - ReadBytes(r, x, 1); - END ReadByte; - - PROCEDURE Base* (VAR r: Rider): File; - BEGIN RETURN r.buf.f - END Base; - - PROCEDURE Write* (VAR r: Rider; x: SYSTEM.BYTE); - VAR buf: Buffer; offset: LONGINT; - BEGIN - buf := r.buf; offset := r.offset; - IF (r.org # buf.org) OR (offset >= bufsize) THEN - Set(r, buf.f, r.org + offset); - buf := r.buf; offset := r.offset - END ; - buf.data[offset] := x; - buf.chg := TRUE; - IF offset = buf.size THEN - INC(buf.size); INC(buf.f.len) - END ; - r.offset := offset + 1; r.res := 0 - END Write; - - PROCEDURE WriteBytes* (VAR r: Rider; VAR x: ARRAY OF SYSTEM.BYTE; n: LONGINT); - VAR xpos, min, restInBuf, offset: LONGINT; buf: Buffer; - BEGIN - IF n > LEN(x) THEN IdxTrap END ; - xpos := 0; buf := r.buf; offset := r.offset; - WHILE n > 0 DO - IF (r.org # buf.org) OR (offset >= bufsize) THEN - Set(r, buf.f, r.org + offset); - buf := r.buf; offset := r.offset - END ; - restInBuf := bufsize - offset; - IF n > restInBuf THEN min := restInBuf ELSE min := n END ; - SYSTEM.MOVE(SYSTEM.ADR(x) + xpos, SYSTEM.ADR(buf.data) + offset, min); - INC(offset, min); r.offset := offset; - IF offset > buf.size THEN INC(buf.f.len, offset - buf.size); buf.size := offset END ; - INC(xpos, min); DEC(n, min); buf.chg := TRUE - END ; - r.res := 0 - END WriteBytes; - -(* another solution would be one that is similar to ReadBytes, WriteBytes. -No code duplication, more symmetric, only two ifs for -Read and Write in buffer, buf.size replaced by bufsize in Write ops, buf.size and len -must be made consistent with offset (if offset > buf.size) in a lazy way. - -PROCEDURE Write* (VAR r: Rider; x: SYSTEM.BYTE); - VAR buf: Buffer; offset: LONGINT; -BEGIN - buf := r.buf; offset := r.offset; - IF (offset >= bufsize) OR (r.org # buf.org) THEN - Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset; - END ; - buf.data[offset] := x; r.offset := offset + 1; buf.chg := TRUE -END Write; - -PROCEDURE WriteBytes ... - -PROCEDURE Read* (VAR r: Rider; VAR x: SYSTEM.BYTE); - VAR offset: LONGINT; buf: Buffer; -BEGIN - buf := r.buf; offset := r.offset; - IF (offset >= buf.size) OR (r.org # buf.org) THEN - IF r.org + offset >= buf.f.len THEN x := 0X; r.eof := TRUE; RETURN - ELSE Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset - END - END ; - x := buf.data[offset]; r.offset := offset + 1 -END Read; - -but this would also affect Set, Length, and Flush. -Especially Length would become fairly complex. -*) - - PROCEDURE Delete* (name: ARRAY OF CHAR; VAR res: INTEGER); - BEGIN - res := SHORT(Unix.Unlink(name)); - res := SHORT(Unix.errno()) - END Delete; - - PROCEDURE Rename* (old, new: ARRAY OF CHAR; VAR res: INTEGER); - VAR fdold, fdnew, n, errno, r: LONGINT; - ostat, nstat: Unix.Status; - buf: ARRAY 4096 OF CHAR; - BEGIN - r := Unix.Stat(old, ostat); - IF r >= 0 THEN - r := Unix.Stat(new, nstat); - IF (r >= 0) & ((ostat.dev # nstat.dev) OR (ostat.ino # nstat.ino)) THEN - Delete(new, res); (* work around stale nfs handles *) - END ; - r := Unix.Rename(old, new); - IF r < 0 THEN res := SHORT(Unix.errno()); - IF res = Unix.EXDEV THEN (* cross device link, move the file *) - fdold := Unix.Open(old, Unix.rdonly, {}); - IF fdold < 0 THEN res := 2; RETURN END ; - fdnew := Unix.Open(new, Unix.rdwr + Unix.creat + Unix.trunc, {2, 4,5, 7,8}); - IF fdnew < 0 THEN r := Unix.Close(fdold); res := 3; RETURN END ; - n := Unix.Read(fdold, SYSTEM.ADR(buf), bufsize); - WHILE n > 0 DO - r := Unix.Write(fdnew, SYSTEM.ADR(buf), n); - IF r < 0 THEN errno := Unix.errno(); r := Unix.Close(fdold); r := Unix.Close(fdnew); - Err("cannot move file", NIL, errno) - END ; - n := Unix.Read(fdold, SYSTEM.ADR(buf), bufsize) - END ; - errno := Unix.errno(); - r := Unix.Close(fdold); r := Unix.Close(fdnew); - IF n = 0 THEN r := Unix.Unlink(old); res := 0 - ELSE Err("cannot move file", NIL, errno) - END ; - ELSE RETURN (* res is Unix.Rename return code *) - END - END ; - res := 0 - ELSE res := 2 (* old file not found *) - END - END Rename; - - PROCEDURE Register* (f: File); - VAR idx, errno: INTEGER; f1: File; file: ARRAY 104 OF CHAR; - BEGIN - IF (f.state = create) & (f.registerName # "") THEN f.state := close (* shortcut renaming *) END ; - Close(f); - IF f.registerName # "" THEN - Rename(f.workName, f.registerName, errno); - IF errno # 0 THEN COPY(f.registerName, file); HALT(99) END ; - f.workName := f.registerName; f.registerName := ""; f.tempFile := FALSE - END - END Register; - - PROCEDURE ChangeDirectory*(path: ARRAY OF CHAR; VAR res: INTEGER); - BEGIN - res := SHORT(Unix.Chdir(path)); - getcwd(Kernel.CWD) - END ChangeDirectory; - - PROCEDURE FlipBytes(VAR src, dest: ARRAY OF SYSTEM.BYTE); - VAR i, j: LONGINT; - BEGIN - IF ~Kernel.littleEndian THEN i := LEN(src); j := 0; - WHILE i > 0 DO DEC(i); dest[j] := src[i]; INC(j) END - ELSE SYSTEM.MOVE(SYSTEM.ADR(src), SYSTEM.ADR(dest), LEN(src)) - END - END FlipBytes; - - PROCEDURE ReadBool* (VAR R: Rider; VAR x: BOOLEAN); - BEGIN Read(R, SYSTEM.VAL(CHAR, x)) - END ReadBool; - - PROCEDURE ReadInt* (VAR R: Rider; VAR x: INTEGER); - VAR b: ARRAY 2 OF CHAR; - BEGIN ReadBytes(R, b, 2); - x := ORD(b[0]) + ORD(b[1])*256 - END ReadInt; - - PROCEDURE ReadLInt* (VAR R: Rider; VAR x: LONGINT); - VAR b: ARRAY 4 OF CHAR; - BEGIN ReadBytes(R, b, 4); - x := ORD(b[0]) + ORD(b[1])*100H + ORD(b[2])*10000H + ORD(b[3])*1000000H - END ReadLInt; - - PROCEDURE ReadSet* (VAR R: Rider; VAR x: SET); - VAR b: ARRAY 4 OF CHAR; - BEGIN ReadBytes(R, b, 4); - x := SYSTEM.VAL(SET, ORD(b[0]) + ORD(b[1])*100H + ORD(b[2])*10000H + ORD(b[3])*1000000H) - END ReadSet; - - PROCEDURE ReadReal* (VAR R: Rider; VAR x: REAL); - VAR b: ARRAY 4 OF CHAR; - BEGIN ReadBytes(R, b, 4); FlipBytes(b, x) - END ReadReal; - - PROCEDURE ReadLReal* (VAR R: Rider; VAR x: LONGREAL); - VAR b: ARRAY 8 OF CHAR; - BEGIN ReadBytes(R, b, 8); FlipBytes(b, x) - END ReadLReal; - - PROCEDURE ReadString* (VAR R: Rider; VAR x: ARRAY OF CHAR); - VAR i: INTEGER; ch: CHAR; - BEGIN i := 0; - REPEAT Read(R, ch); x[i] := ch; INC(i) UNTIL ch = 0X - END ReadString; - - PROCEDURE ReadNum* (VAR R: Rider; VAR x: LONGINT); - VAR s: SHORTINT; ch: CHAR; n: LONGINT; - BEGIN s := 0; n := 0; Read(R, ch); - WHILE ORD(ch) >= 128 DO INC(n, ASH(ORD(ch) - 128, s) ); INC(s, 7); Read(R, ch) END; - INC(n, ASH(ORD(ch) MOD 64 - ORD(ch) DIV 64 * 64, s) ); - x := n - END ReadNum; - - PROCEDURE WriteBool* (VAR R: Rider; x: BOOLEAN); - BEGIN Write(R, SYSTEM.VAL(CHAR, x)) - END WriteBool; - - PROCEDURE WriteInt* (VAR R: Rider; x: INTEGER); - VAR b: ARRAY 2 OF CHAR; - BEGIN b[0] := CHR(x); b[1] := CHR(x DIV 256); - WriteBytes(R, b, 2); - END WriteInt; - - PROCEDURE WriteLInt* (VAR R: Rider; x: LONGINT); - VAR b: ARRAY 4 OF CHAR; - BEGIN - b[0] := CHR(x); b[1] := CHR(x DIV 100H); b[2] := CHR(x DIV 10000H); b[3] := CHR(x DIV 1000000H); - WriteBytes(R, b, 4); - END WriteLInt; - - PROCEDURE WriteSet* (VAR R: Rider; x: SET); - VAR b: ARRAY 4 OF CHAR; i: LONGINT; - BEGIN i := SYSTEM.VAL(LONGINT, x); - 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; - - PROCEDURE WriteReal* (VAR R: Rider; x: REAL); - VAR b: ARRAY 4 OF CHAR; - BEGIN FlipBytes(x, b); WriteBytes(R, b, 4) - END WriteReal; - - PROCEDURE WriteLReal* (VAR R: Rider; x: LONGREAL); - VAR b: ARRAY 8 OF CHAR; - BEGIN FlipBytes(x, b); WriteBytes(R, b, 8) - END WriteLReal; - - PROCEDURE WriteString* (VAR R: Rider; x: ARRAY [1] OF CHAR); - VAR i: INTEGER; - BEGIN i := 0; - WHILE x[i] # 0X DO INC(i) END ; - WriteBytes(R, x, i+1) - END WriteString; - - PROCEDURE WriteNum* (VAR R: Rider; x: LONGINT); - BEGIN - WHILE (x < - 64) OR (x > 63) DO Write(R, CHR(x MOD 128 + 128)); x := x DIV 128 END; - Write(R, CHR(x MOD 128)) - END WriteNum; - - PROCEDURE Finalize(o: SYSTEM.PTR); - VAR f: File; res: LONGINT; - BEGIN - f := SYSTEM.VAL(File, o); - IF f.fd >= 0 THEN - fileTab[f.fd] := 0; res := Unix.Close(f.fd); f.fd := -1; DEC(Kernel.nofiles); - IF f.tempFile THEN res := Unix.Unlink(f.workName) END - END - END Finalize; - - PROCEDURE Init; - VAR i: LONGINT; - BEGIN - i := 0; WHILE i < fileTabSize DO fileTab[i] := 0; INC(i) END ; - tempno := -1; Kernel.nofiles := 0 - END Init; - -BEGIN Init -END Files0. diff --git a/src/system/linux/clang/x86/SYSTEM.c0 b/src/system/linux/clang/x86/SYSTEM.c0 deleted file mode 100644 index 580449aa..00000000 --- a/src/system/linux/clang/x86/SYSTEM.c0 +++ /dev/null @@ -1,205 +0,0 @@ -/* -* The body prefix file of the Ofront runtime system, Version 1.0 -* -* Copyright (c) Software Templ, 1994, 1995 -* -* Module SYSTEM is subject to change any time without prior notification. -* Software Templ disclaims all warranties with regard to module SYSTEM, -* in particular shall Software Templ not be liable for any damage resulting -* from inappropriate use or modification of module SYSTEM. -* -* Version 1.1 jt, 24.11.95 fixes for correct pointer arithmetic on Cray computers -* jt 31.1.2007 ANSI prototypes for malloc and exit in order to avoid cc warnings -* -*/ - -#include "SYSTEM.h" -#ifdef __STDC__ -#include "stdarg.h" -#else -#include "varargs.h" -#endif - -extern void *malloc(long size); -extern void exit(int status); - -void (*SYSTEM_Halt)(); -LONGINT SYSTEM_halt; /* x in HALT(x) */ -LONGINT SYSTEM_assert; /* x in ASSERT(cond, x) */ -LONGINT SYSTEM_argc; -LONGINT SYSTEM_argv; -LONGINT SYSTEM_lock; -BOOLEAN SYSTEM_interrupted; -static LONGINT SYSTEM_mainfrm; /* adr of main proc stack frame, used for stack collection */ - -#define Lock SYSTEM_lock++ -#define Unlock SYSTEM_lock--; if (SYSTEM_interrupted && (SYSTEM_lock == 0)) __HALT(-9) - - -static void SYSTEM_InitHeap(); -void *SYSTEM__init(); - -void SYSTEM_INIT(argc, argvadr) - int argc; long argvadr; -{ - SYSTEM_mainfrm = argvadr; - SYSTEM_argc = argc; - SYSTEM_argv = *(long*)argvadr; - SYSTEM_InitHeap(); - SYSTEM_halt = -128; - SYSTEM__init(); -} - -void SYSTEM_FINI() -{ - SYSTEM_FINALL(); -} - -long SYSTEM_XCHK(i, ub) long i, ub; {return __X(i, ub);} -long SYSTEM_RCHK(i, ub) long i, ub; {return __R(i, ub);} -long SYSTEM_ASH(i, n) long i, n; {return __ASH(i, n);} -long SYSTEM_ABS(i) long i; {return __ABS(i);} -double SYSTEM_ABSD(i) double i; {return __ABS(i);} - -void SYSTEM_INHERIT(t, t0) - long *t, *t0; -{ - t -= __TPROC0OFF; - t0 -= __TPROC0OFF; - while (*t0 != __EOM) {*t = *t0; t--; t0--;} -} - -void SYSTEM_ENUMP(adr, n, P) - long *adr; - long n; - void (*P)(); -{ - while (n > 0) {P(*adr); adr++; n--;} -} - -void SYSTEM_ENUMR(adr, typ, size, n, P) - char *adr; - long *typ, size, n; - void (*P)(); -{ - long *t, off; - typ++; - while (n > 0) { - t = typ; - off = *t; - while (off >= 0) {P(*(long*)(adr+off)); t++; off = *t;} - adr += size; n--; - } -} - -long SYSTEM_DIV(x, y) - unsigned long x, y; -{ if ((long) x >= 0) return (x / y); - else return -((y - 1 - x) / y); -} - -long SYSTEM_MOD(x, y) - unsigned long x, y; -{ unsigned long m; - if ((long) x >= 0) return (x % y); - else { m = (-x) % y; - if (m != 0) return (y - m); else return 0; - } -} - -long SYSTEM_ENTIER(x) - double x; -{ - long y; - if (x >= 0) - return (long)x; - else { - y = (long)x; - if (y <= x) return y; else return y - 1; - } -} - -void SYSTEM_HALT(n) - int n; -{ - SYSTEM_halt = n; - if (SYSTEM_Halt!=0) SYSTEM_Halt(n); - exit(n); -} - -#ifdef __STDC__ -SYSTEM_PTR SYSTEM_NEWARR(long *typ, long elemsz, int elemalgn, int nofdim, int nofdyn, ...) -#else -SYSTEM_PTR SYSTEM_NEWARR(typ, elemsz, elemalgn, nofdim, nofdyn, va_alist) - long *typ, elemsz; - int elemalgn, nofdim, nofdyn; - va_dcl -#endif -{ - long nofelems, size, dataoff, n, nptr, *x, *p, nofptrs, i, *ptab, off; - va_list ap; -#ifdef __STDC__ - va_start(ap, nofdyn); -#else - va_start(ap); -#endif - nofelems = 1; - while (nofdim > 0) { - nofelems = nofelems * va_arg(ap, long); nofdim--; - if (nofelems <= 0) __HALT(-20); - } - va_end(ap); - dataoff = nofdyn * sizeof(long); - if (elemalgn > sizeof(long)) { - n = dataoff % elemalgn; - if (n != 0) dataoff += elemalgn - n; - } - size = dataoff + nofelems * elemsz; - Lock; - if (typ == NIL) { - /* element typ does not contain pointers */ - x = SYSTEM_NEWBLK(size); - } - else if (typ == POINTER__typ) { - /* element type is a pointer */ - x = SYSTEM_NEWBLK(size + nofelems * sizeof(long)); - p = (long*)x[-1]; - p[-nofelems] = *p; /* build new type desc in situ: 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ - p -= nofelems - 1; n = 1; /* n =1 for skipping the size field */ - while (n <= nofelems) {*p = n*sizeof(long); p++; n++;} - *p = - (nofelems + 1) * sizeof(long); /* sentinel */ - x[-1] -= nofelems * sizeof(long); - } - else { - /* element type is a record that contains pointers */ - ptab = typ + 1; nofptrs = 0; - while (ptab[nofptrs] >= 0) {nofptrs++;} /* number of pointers per element */ - nptr = nofelems * nofptrs; /* total number of pointers */ - x = SYSTEM_NEWBLK(size + nptr * sizeof(long)); - p = (long*)x[- 1]; - p[-nptr] = *p; /* build new type desc in situ; 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ - p -= nptr - 1; n = 0; off = dataoff; - while (n < nofelems) {i = 0; - while (i < nofptrs) {*p = off + ptab[i]; p++; i++;} - off += elemsz; n++; - } - *p = - (nptr + 1) * sizeof(long); /* sentinel */ - x[-1] -= nptr * sizeof(long); - } - if (nofdyn != 0) { - /* setup len vector for index checks */ -#ifdef __STDC__ - va_start(ap, nofdyn); -#else - va_start(ap); -#endif - p = x; - while (nofdyn > 0) {*p = va_arg(ap, long); p++, nofdyn--;} - va_end(ap); - } - Unlock; - return x; -} - -/* ----------- end of SYSTEM.co ------------- */ - diff --git a/src/system/linux/clang/x86/SYSTEM.h b/src/system/linux/clang/x86/SYSTEM.h deleted file mode 100644 index ea9ae5d6..00000000 --- a/src/system/linux/clang/x86/SYSTEM.h +++ /dev/null @@ -1,220 +0,0 @@ -#ifndef SYSTEM__h -#define SYSTEM__h - -/* - -the Ofront runtime system interface and macros library -copyright (c) Josef Templ, 1995, 1996 - -gcc for Linux version (same as SPARC/Solaris2) -uses double # as concatenation operator - -*/ - -#include -#include /* for type sizes -- noch */ - -//extern void *memcpy(void *dest, const void *src, long n); -extern void *memcpy(void *dest, const void *src, size_t n); -extern void *malloc(long size); -extern void exit(int status); - -#define export -#define import extern - -/* constants */ -#define __MAXEXT 16 -#define NIL 0L -#define POINTER__typ (long*)1L /* not NIL and not a valid type */ - -/* basic types */ -typedef char BOOLEAN; -typedef unsigned char CHAR; -typedef signed char SHORTINT; -typedef short int INTEGER; -typedef long LONGINT; -typedef float REAL; -typedef double LONGREAL; -typedef unsigned long SET; -typedef void *SYSTEM_PTR; -typedef unsigned char SYSTEM_BYTE; -typedef int8_t SYSTEM_INT8; -typedef int16_t SYSTEM_INT16; -typedef int32_t SYSTEM_INT32; -typedef int64_t SYSTEM_INT64; - -/* runtime system routines */ -extern long SYSTEM_DIV(); -extern long SYSTEM_MOD(); -extern long SYSTEM_ENTIER(); -extern long SYSTEM_ASH(); -extern long SYSTEM_ABS(); -extern long SYSTEM_XCHK(); -extern long SYSTEM_RCHK(); -extern double SYSTEM_ABSD(); -extern SYSTEM_PTR SYSTEM_NEWREC(); -extern SYSTEM_PTR SYSTEM_NEWBLK(); -#ifdef __STDC__ -extern SYSTEM_PTR SYSTEM_NEWARR(long*, long, int, int, int, ...); -#else -extern SYSTEM_PTR SYSTEM_NEWARR(); -#endif -extern SYSTEM_PTR SYSTEM_REGMOD(); -extern void SYSTEM_INCREF(); -extern void SYSTEM_REGCMD(); -extern void SYSTEM_REGTYP(); -extern void SYSTEM_REGFIN(); -extern void SYSTEM_FINALL(); -extern void SYSTEM_INIT(); -extern void SYSTEM_FINI(); -extern void SYSTEM_HALT(); -extern void SYSTEM_INHERIT(); -extern void SYSTEM_ENUMP(); -extern void SYSTEM_ENUMR(); - -/* module registry */ -#define __DEFMOD static void *m; if(m!=0)return m -#define __REGMOD(name, enum) if(m==0)m=SYSTEM_REGMOD((CHAR*)name,enum); else return m -#define __ENDMOD return m -#define __INIT(argc, argv) static void *m; SYSTEM_INIT(argc, (long)&argv); -#define __REGMAIN(name, enum) m=SYSTEM_REGMOD(name,enum) -#define __FINI SYSTEM_FINI(); return 0 -#define __IMPORT(name) SYSTEM_INCREF(name##__init()) -#define __REGCMD(name, cmd) SYSTEM_REGCMD(m, name, cmd) - -/* SYSTEM ops */ -#define __SYSNEW(p, len) p=SYSTEM_NEWBLK((long)(len)) -#define __VAL(t, x) (*(t*)&(x)) -#define __GET(a, x, t) x= *(t*)(a) -#define __PUT(a, x, t) *(t*)(a)=x -#define __LSHL(x, n, t) ((t)((unsigned)(x)<<(n))) -#define __LSHR(x, n, t) ((t)((unsigned)(x)>>(n))) -#define __LSH(x, n, t) ((n)>=0? __LSHL(x, n, t): __LSHR(x, -(n), t)) -#define __ROTL(x, n, t) ((t)((unsigned)(x)<<(n)|(unsigned)(x)>>(8*sizeof(t)-(n)))) -#define __ROTR(x, n, t) ((t)((unsigned)(x)>>(n)|(unsigned)(x)<<(8*sizeof(t)-(n)))) -#define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) -#define __BIT(x, n) (*(unsigned long*)(x)>>(n)&1) -#define __MOVE(s, d, n) memcpy((char*)(d),(char*)(s),n) - -/* std procs and operator mappings */ -#define __SHORT(x, y) ((int)((unsigned long)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) -#define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) -#define __CHR(x) ((CHAR)__R(x, 256)) -#define __CHRF(x) ((CHAR)__RF(x, 256)) -#define __DIV(x, y) ((x)>=0?(x)/(y):-(((y)-1-(x))/(y))) -#define __DIVF(x, y) SYSTEM_DIV((long)(x),(long)(y)) -#define __MOD(x, y) ((x)>=0?(x)%(y):__MODF(x,y)) -#define __MODF(x, y) SYSTEM_MOD((long)(x),(long)(y)) -#define __NEW(p, t) p=SYSTEM_NEWREC((long)t##__typ) -#define __NEWARR SYSTEM_NEWARR -#define __HALT(x) SYSTEM_HALT(x) -#define __ASSERT(cond, x) if (!(cond)) {SYSTEM_assert = x; SYSTEM_HALT(-1);} -#define __ENTIER(x) SYSTEM_ENTIER(x) -#define __ABS(x) (((x)<0)?-(x):(x)) -#define __ABSF(x) SYSTEM_ABS((long)(x)) -#define __ABSFD(x) SYSTEM_ABSD((double)(x)) -#define __CAP(ch) ((CHAR)((ch)&0x5f)) -#define __ODD(x) ((x)&1) -#define __IN(x, s) (((s)>>(x))&1) -#define __SETOF(x) ((SET)1<<(x)) -#define __SETRNG(l, h) ((~(SET)0<<(l))&~(SET)0>>(8*sizeof(SET)-1-(h))) -#define __MASK(x, m) ((x)&~(m)) -#define __COPY(s, d, n) {char*_a=(void*)s,*_b=(void*)d;long _i=0,_t=n-1;while(_i<_t&&((_b[_i]=_a[_i])!=0)){_i++;};_b[_i]=0;} -static int __STRCMP(x, y) - CHAR *x, *y; -{long i = 0; CHAR ch1, ch2; - do {ch1 = x[i]; ch2 = y[i]; i++; - if (!ch1) return -(int)ch2; - } while (ch1==ch2); - return (int)ch1 - (int)ch2; -} -#define __ASH(x, n) ((n)>=0?__ASHL(x,n):__ASHR(x,-(n))) -#define __ASHL(x, n) ((long)(x)<<(n)) -#define __ASHR(x, n) ((long)(x)>>(n)) -#define __ASHF(x, n) SYSTEM_ASH((long)(x), (long)(n)) -#define __DUP(x, l, t) x=(void*)memcpy(alloca(l*sizeof(t)),x,l*sizeof(t)) -#define __DUPARR(v, t) v=(void*)memcpy(v##__copy,v,sizeof(t)) -#define __DEL(x) /* DUP with alloca frees storage automatically */ -#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(long)typ##__typ) -#define __TYPEOF(p) (*(((long**)(p))-1)) -#define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) - -/* runtime checks */ -#define __X(i, ub) (((unsigned)(long)(i)<(unsigned long)(ub))?i:(__HALT(-2),0)) -#define __XF(i, ub) SYSTEM_XCHK((long)(i), (long)(ub)) -#define __RETCHK __retchk: __HALT(-3) -#define __CASECHK __HALT(-4) -#define __GUARDP(p, typ, level) ((typ*)(__ISP(p,typ,level)?p:(__HALT(-5),p))) -#define __GUARDR(r, typ, level) (*((typ*)(__IS(r##__typ,typ,level)?r:(__HALT(-5),r)))) -#define __GUARDA(p, typ, level) ((struct typ*)(__IS(__TYPEOF(p),typ,level)?p:(__HALT(-5),p))) -#define __GUARDEQR(p, dyntyp, typ) if(dyntyp!=typ##__typ) __HALT(-6);*(p) -#define __GUARDEQP(p, typ) if(__TYPEOF(p)!=typ##__typ)__HALT(-6);*(p) -#define __WITHCHK __HALT(-7) -#define __R(i, ub) (((unsigned)(long)(i)<(unsigned long)(ub))?i:(__HALT(-8),0)) -#define __RF(i, ub) SYSTEM_RCHK((long)(i),(long)(ub)) - -/* record type descriptors */ -#define __TDESC(t, m, n) \ - static struct t##__desc {\ - long tproc[m]; \ - long tag, next, level, module; \ - char name[24]; \ - long *base[__MAXEXT]; \ - char *rsrvd; \ - long blksz, ptr[n+1]; \ - } t##__desc - -#define __BASEOFF (__MAXEXT+1) -#define __TPROC0OFF (__BASEOFF+24/sizeof(long)+5) -#define __EOM 1 -#define __TDFLDS(name, size) {__EOM}, 1, 0, 0, 0, name, {0}, 0, size -#define __ENUMP(adr, n, P) SYSTEM_ENUMP(adr, (long)(n), P) -#define __ENUMR(adr, typ, size, n, P) SYSTEM_ENUMR(adr, typ, (long)(size), (long)(n), P) - -#define __INITYP(t, t0, level) \ - t##__typ= &t##__desc.blksz; \ - memcpy(t##__desc.base, t0##__typ - __BASEOFF, level*sizeof(long)); \ - t##__desc.base[level]=t##__typ; \ - t##__desc.module=(long)m; \ - if(t##__desc.blksz!=sizeof(struct t)) __HALT(-15); \ - t##__desc.blksz=(t##__desc.blksz+5*sizeof(long)-1)/(4*sizeof(long))*(4*sizeof(long)); \ - SYSTEM_REGTYP(m, (long)&t##__desc.next); \ - SYSTEM_INHERIT(t##__typ, t0##__typ) - -/* Oberon-2 type bound procedures support */ -#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(long)proc -#define __SEND(typ, num, funtyp, parlist) ((funtyp)(*(typ-(__TPROC0OFF+num))))parlist - -/* runtime system variables */ -extern LONGINT SYSTEM_argc; -extern LONGINT SYSTEM_argv; -extern void (*SYSTEM_Halt)(); -extern LONGINT SYSTEM_halt; -extern LONGINT SYSTEM_assert; -extern SYSTEM_PTR SYSTEM_modules; -extern LONGINT SYSTEM_heapsize; -extern LONGINT SYSTEM_allocated; -extern LONGINT SYSTEM_lock; -extern SHORTINT SYSTEM_gclock; -extern BOOLEAN SYSTEM_interrupted; - -/* ANSI prototypes; not used so far -static int __STRCMP(CHAR *x, CHAR *y); -void SYSTEM_INIT(int argc, long argvadr); -void SYSTEM_FINI(void); -long SYSTEM_XCHK(long i, long ub); -long SYSTEM_RCHK(long i, long ub); -long SYSTEM_ASH(long i, long n); -long SYSTEM_ABS(long i); -double SYSTEM_ABSD(double i); -void SYSTEM_INHERIT(long *t, long *t0); -void SYSTEM_ENUMP(long *adr, long n, void (*P)(void*)); -void SYSTEM_ENUMR(char *adr, long *typ, long size, long n, void (*P)(void*)); -long SYSTEM_DIV(unsigned long x, unsigned long y); -long SYSTEM_MOD(unsigned long x, unsigned long y); -long SYSTEM_ENTIER(double x); -void SYSTEM_HALT(int n); -*/ - -#endif - diff --git a/src/system/linux/clang/x86/Unix.Mod b/src/system/linux/clang/x86/Unix.Mod deleted file mode 100644 index a77bccae..00000000 --- a/src/system/linux/clang/x86/Unix.Mod +++ /dev/null @@ -1,465 +0,0 @@ -MODULE Unix; (* Josef Templ, 5.3.90 Linux system calls *) -(* system procedure added by noch *) -(* Module Unix provides a system call interface to Linux. - Naming conventions: - Procedure and Type-names always start with a capital letter. - error numbers as defined in Unix - other constants start with lower case letters *) - -IMPORT SYSTEM; - -CONST - -(* various important constants *) - - stdin* = 0; stdout* =1; stderr* = 2; - - LOCKEX* = 2; LOCKUN* = 8; (* /usr/include/file.h *) - AFINET* = 2; (* /usr/include/sys/socket.h *) - PFINET* = AFINET; (* /usr/include/linux/socket.h *) - SOCKSTREAM* = 1; (* /usr/include/linux/socket.h *) - FIONREAD* = 541BH; (* in /usr/include/asm/termios.h *) - SETFL* = 4; (* set file descriptor flags; in asm/fcntl.h *) - TCP* = 0; - -(* flag sets, cf. /usr/include/asm/fcntl.h *) - rdonly* = {}; wronly* = {0}; rdwr* = {1}; creat* = {6}; excl* = {7}; trunc* = {9}; append* = {10}; ndelay = {11}; - -(* error numbers *) - - EPERM* = 1; (* Not owner *) - ENOENT* = 2; (* No such file or directory *) - ESRCH* = 3; (* No such process *) - EINTR* = 4; (* Interrupted system call *) - EIO* = 5; (* I/O error *) - ENXIO* = 6; (* No such device or address *) - E2BIG* = 7; (* Arg list too long *) - ENOEXEC* = 8; (* Exec format error *) - EBADF* = 9; (* Bad file number *) - ECHILD* = 10; (* No children *) - EAGAIN* = 11; (* No more processes *) - ENOMEM* = 12; (* Not enough core *) - EACCES* = 13; (* Permission denied *) - EFAULT* = 14; (* Bad address *) - ENOTBLK* = 15; (* Block device required *) - EBUSY* = 16; (* Mount device busy *) - EEXIST* = 17; (* File exists *) - EXDEV* = 18; (* Cross-device link *) - ENODEV* = 19; (* No such device *) - ENOTDIR* = 20; (* Not a directory*) - EISDIR* = 21; (* Is a directory *) - EINVAL* = 22; (* Invalid argument *) - ENFILE* = 23; (* File table overflow *) - EMFILE* = 24; (* Too many open files *) - ENOTTY* = 25; (* Not a typewriter *) - ETXTBSY* = 26; (* Text file busy *) - EFBIG* = 27; (* File too large *) - ENOSPC* = 28; (* No space left on device *) - ESPIPE* = 29; (* Illegal seek *) - EROFS* = 30; (* Read-only file system *) - EMLINK* = 31; (* Too many links *) - EPIPE* = 32; (* Broken pipe *) - EDOM* = 33; (* Argument too large *) - ERANGE* = 34; (* Result too large *) - EDEADLK* = 35; (* Resource deadlock would occur *) - ENAMETOOLONG* = 36; (* File name too long *) - ENOLCK* = 37; (* No record locks available *) - ENOSYS* = 38; (* Function not implemented *) - ENOTEMPTY* = 39; (* Directory not empty *) - ELOOP* = 40; (* Too many symbolic links encountered *) - EWOULDBLOCK* = EAGAIN; (* Operation would block *) - ENOMSG* = 42; (* No message of desired type *) - EIDRM* = 43; (* Identifier removed *) - ECHRNG* = 44; (* Channel number out of range *) - EL2NSYNC* = 45; (* Level 2 not synchronized *) - EL3HLT* = 46; (* Level 3 halted *) - EL3RST* = 47; (* Level 3 reset *) - ELNRNG* = 48; (* Link number out of range *) - EUNATCH* = 49; (* Protocol driver not attached *) - ENOCSI* = 50; (* No CSI structure available *) - EL2HLT* = 51; (* Level 2 halted *) - EBADE* = 52; (* Invalid exchange *) - EBADR* = 53; (* Invalid request descriptor *) - EXFULL* = 54; (* Exchange full *) - ENOANO* = 55; (* No anode *) - EBADRQC* = 56; (* Invalid request code *) - EBADSLT* = 57; (* Invalid slot *) - EDEADLOCK* = 58; (* File locking deadlock error *) - EBFONT* = 59; (* Bad font file format *) - ENOSTR* = 60; (* Device not a stream *) - ENODATA* = 61; (* No data available *) - ETIME* = 62; (* Timer expired *) - ENOSR* = 63; (* Out of streams resources *) - ENONET* = 64; (* Machine is not on the network *) - ENOPKG* = 65; (* Package not installed *) - EREMOTE* = 66; (* Object is remote *) - ENOLINK* = 67; (* Link has been severed *) - EADV* = 68; (* Advertise error *) - ESRMNT* = 69; (* Srmount error *) - ECOMM* = 70; (* Communication error on send *) - EPROTO* = 71; (* Protocol error *) - EMULTIHOP* = 72; (* Multihop attempted *) - EDOTDOT* = 73; (* RFS specific error *) - EBADMSG* = 74; (* Not a data message *) - EOVERFLOW* = 75; (* Value too large for defined data type *) - ENOTUNIQ* = 76; (* Name not unique on network *) - EBADFD* = 77; (* File descriptor in bad state *) - EREMCHG* = 78; (* Remote address changed *) - ELIBACC* = 79; (* Can not access a needed shared library *) - ELIBBAD* = 80; (* Accessing a corrupted shared library *) - ELIBSCN* = 81; (* .lib section in a.out corrupted *) - ELIBMAX* = 82; (* Attempting to link in too many shared libraries *) - ELIBEXEC* = 83; (* Cannot exec a shared library directly *) - EILSEQ* = 84; (* Illegal byte sequence *) - ERESTART* = 85; (* Interrupted system call should be restarted *) - ESTRPIPE* = 86; (* Streams pipe error *) - EUSERS* = 87; (* Too many users *) - ENOTSOCK* = 88; (* Socket operation on non-socket *) - EDESTADDRREQ* = 89; (* Destination address required *) - EMSGSIZE* = 90; (* Message too long *) - EPROTOTYPE* = 91; (* Protocol wrong type for socket *) - ENOPROTOOPT* = 92; (* Protocol not available *) - EPROTONOSUPPORT* = 93; (* Protocol not supported *) - ESOCKTNOSUPPORT* = 94; (* Socket type not supported *) - EOPNOTSUPP* = 95; (* Operation not supported on transport endpoint *) - EPFNOSUPPORT* = 96; (* Protocol family not supported *) - EAFNOSUPPORT* = 97; (* Address family not supported by protocol *) - EADDRINUSE* = 98; (* Address already in use *) - EADDRNOTAVAIL* = 99; (* Cannot assign requested address *) - ENETDOWN* = 100; (* Network is down *) - ENETUNREACH* = 101; (* Network is unreachable *) - ENETRESET* = 102; (* Network dropped connection because of reset *) - ECONNABORTED* = 103; (* Software caused connection abort *) - ECONNRESET* = 104; (* Connection reset by peer *) - ENOBUFS* = 105; (* No buffer space available *) - EISCONN* = 106; (* Transport endpoint is already connected *) - ENOTCONN* = 107; (* Transport endpoint is not connected *) - ESHUTDOWN* = 108; (* Cannot send after transport endpoint shutdown *) - ETOOMANYREFS* = 109; (* Too many references: cannot splice *) - ETIMEDOUT* = 110; (* Connection timed out *) - ECONNREFUSED* = 111; (* Connection refused *) - EHOSTDOWN* = 112; (* Host is down *) - EHOSTUNREACH* = 113; (* No route to host *) - EALREADY* = 114; (* Operation already in progress *) - EINPROGRESS* = 115; (* Operation now in progress *) - ESTALE* = 116; (* Stale NFS file handle *) - EUCLEAN* = 117; (* Structure needs cleaning *) - ENOTNAM* = 118; (* Not a XENIX named type file *) - ENAVAIL* = 119; (* No XENIX semaphores available *) - EISNAM* = 120; (* Is a named type file *) - EREMOTEIO* = 121; (* Remote I/O error *) - EDQUOT* = 122; (* Quota exceeded *) - - -TYPE - JmpBuf* = RECORD - bx*, si*, di*, bp*, sp*, pc*: LONGINT; - maskWasSaved*: LONGINT; - savedMask*: ARRAY 32 OF LONGINT; - END ; - - Status* = RECORD (* struct stat *) - dev*, devX*: LONGINT; (* 64 bit in Linux 2.2 *) - pad1: INTEGER; - ino*, mode*, nlink*, uid*, gid*: LONGINT; - rdev*, rdevX*: LONGINT; (* 64 bit in Linux 2.2 *) - pad2: INTEGER; - size*, blksize*, blocks*, atime*, unused1*, mtime*, unused2*, ctime*, - unused3*, unused4*, unused5*: LONGINT; - END ; - - Timeval* = RECORD - sec*, usec*: LONGINT - END ; - - Timezone* = RECORD - minuteswest*, dsttime*: LONGINT - END ; - - Itimerval* = RECORD - interval*, value*: Timeval - END ; - - FdSet* = ARRAY 8 OF SET; - - SigCtxPtr* = POINTER TO SigContext; - SigContext* = RECORD - END ; - - SignalHandler* = PROCEDURE (sig, code: LONGINT; scp: SigCtxPtr); - - Dirent* = RECORD - ino, off: LONGINT; - reclen: INTEGER; - name: ARRAY 256 OF CHAR; - END ; - - Rusage* = RECORD - utime*, stime*: Timeval; - maxrss*, ixrss*, idrss*, isrss*, - minflt*, majflt*, nswap*, inblock*, - oublock*, msgsnd*, msgrcv*, nsignals*, - nvcsw*, nivcsw*: LONGINT - END ; - - Iovec* = RECORD - base*, len*: LONGINT - END ; - - SocketPair* = ARRAY 2 OF LONGINT; - - Pollfd* = RECORD - fd*: LONGINT; - events*, revents*: INTEGER - END ; - - Sockaddr* = RECORD - family*: INTEGER; - port*: INTEGER; - internetAddr*: LONGINT; - pad*: ARRAY 8 OF CHAR; - END ; - - HostEntry* = POINTER [1] TO Hostent; - Hostent* = RECORD - name*, aliases*: LONGINT; - addrtype*, length*: LONGINT; - addrlist*: LONGINT; (*POINTER TO POINTER TO LONGINT, network byte order*) - END; - - Name* = ARRAY OF CHAR; - - PROCEDURE -includeStat() - "#include "; - - PROCEDURE -includeErrno() - "#include "; - - (* for read(), write() and sleep() *) - PROCEDURE -includeUnistd() - "#include "; - - (* for system() *) -(* commented, doesn't compile on 32bit GNU/Linux platforms - PROCEDURE -includeStdlib() - "#include "; -*) - (* for nanosleep() *) - PROCEDURE -includeTime() - "#include "; - - (* for select() *) - PROCEDURE -includeSelect() - "#include "; - - PROCEDURE -err(): LONGINT - "errno"; - - PROCEDURE errno*(): LONGINT; - BEGIN - RETURN err() - END errno; - - PROCEDURE -Exit*(n: LONGINT) - "exit(n)"; - - PROCEDURE -Fork*(): LONGINT - "fork()"; - - PROCEDURE -Wait*(VAR status: LONGINT): LONGINT - "wait(status)"; - - PROCEDURE -Select*(width: LONGINT; VAR readfds, writefds, exceptfds: FdSet; VAR timeout: Timeval): LONGINT - "select(width, readfds, writefds, exceptfds, timeout)"; - - PROCEDURE -Gettimeofday* (VAR tv: Timeval; VAR tz: Timezone) : LONGINT - "gettimeofday(tv, tz)"; - - PROCEDURE -Read* (fd, buf, nbyte: LONGINT): LONGINT - "read(fd, buf, nbyte)"; - - PROCEDURE -ReadBlk* (fd: LONGINT; VAR buf: ARRAY OF SYSTEM.BYTE): LONGINT - "read(fd, buf, buf__len)"; - - PROCEDURE -Write* (fd, buf, nbyte: LONGINT): LONGINT - "write(fd, buf, nbyte)"; - - PROCEDURE -WriteBlk* (fd: LONGINT; VAR buf: ARRAY OF SYSTEM.BYTE): LONGINT - "write(fd, buf, buf__len)"; - - PROCEDURE -Dup*(fd: LONGINT): LONGINT - "dup(fd)"; - - PROCEDURE -Dup2*(fd1, fd2: LONGINT): LONGINT - "dup(fd1, fd2)"; - - PROCEDURE -Pipe*(fds : LONGINT): LONGINT - "pipe(fds)"; - - PROCEDURE -Getpid*(): LONGINT - "getpid()"; - - PROCEDURE -Getuid*(): LONGINT - "getuid()"; - - PROCEDURE -Geteuid*(): LONGINT - "geteuid()"; - - PROCEDURE -Getgid*(): LONGINT - "getgid()"; - - PROCEDURE -Getegid*(): LONGINT - "getegid()"; - - PROCEDURE -Unlink*(name: Name): LONGINT - "unlink(name)"; - - PROCEDURE -Open*(name: Name; flag, mode: SET): LONGINT - "open(name, flag, mode)"; - - PROCEDURE -Close*(fd: LONGINT): LONGINT - "close(fd)"; - - PROCEDURE -stat(name: Name; VAR statbuf: Status): LONGINT - "stat((const char*)name, (struct stat*)statbuf)"; - - PROCEDURE Stat*(name: Name; VAR statbuf: Status): LONGINT; - VAR res: LONGINT; - BEGIN - res := stat(name, statbuf); - (* make the first 4 bytes as unique as possible (used in module Files for caching!) *) - INC(statbuf.dev, statbuf.devX); - INC(statbuf.rdev, statbuf.rdevX); - RETURN res; - END Stat; - - PROCEDURE -fstat(fd: LONGINT; VAR statbuf: Status): LONGINT - "fstat(fd, (struct stat*)statbuf)"; - - PROCEDURE Fstat*(fd: LONGINT; VAR statbuf: Status): LONGINT; - VAR res: LONGINT; - BEGIN - res := fstat(fd, statbuf); - (* make the first 4 bytes as unique as possible (used in module Files for caching!) *) - INC(statbuf.dev, statbuf.devX); - INC(statbuf.rdev, statbuf.rdevX); - RETURN res; - END Fstat; - - PROCEDURE -Fchmod*(fd, mode: LONGINT): LONGINT - "fchmod(fd, mode)"; - - PROCEDURE -Chmod*(path: Name; mode: LONGINT): LONGINT - "chmod(path, mode)"; - - PROCEDURE -Lseek*(fd, offset, origin: LONGINT): LONGINT - "lseek(fd, offset, origin)"; - - PROCEDURE -Fsync*(fd: LONGINT): LONGINT - "fsync(fd)"; - - PROCEDURE -Fcntl*(fd, cmd, arg: LONGINT ): LONGINT - "fcntl(fd, cmd, arg)"; - - PROCEDURE -Flock*(fd, operation: LONGINT): LONGINT - "flock(fd, operation)"; - - PROCEDURE -Ftruncate*(fd, length: LONGINT): LONGINT - "ftruncate(fd, length)"; - - PROCEDURE -Readblk*(fd: LONGINT; VAR buf: ARRAY OF SYSTEM.BYTE; len: LONGINT): LONGINT - "read(fd, buf, len)"; - - PROCEDURE -Rename*(old, new: Name): LONGINT - "rename(old, new)"; - - PROCEDURE -Chdir*(path: Name): LONGINT - "chdir(path)"; - - PROCEDURE -Ioctl*(fd, request, arg: LONGINT): LONGINT - "ioctl(fd, request, arg)"; - - PROCEDURE -Kill*(pid, sig: LONGINT): LONGINT - "kill(pid, sig)"; - - PROCEDURE -Sigsetmask*(mask: LONGINT): LONGINT - "sigsetmask(mask)"; - - PROCEDURE -Sleep*(ms : LONGINT): LONGINT - "sleep(ms)"; - - PROCEDURE -Nanosleep*(VAR req : Timeval; VAR rem : Timeval): LONGINT - "nanosleep(req, rem)"; - - (* TCP/IP networking *) - - PROCEDURE -Gethostbyname*(name: Name): HostEntry - "(Unix_HostEntry)gethostbyname(name)"; - - PROCEDURE -Gethostname*(VAR name: Name): LONGINT - "gethostname(name, name__len)"; - - PROCEDURE -Socket*(af, type, protocol: LONGINT): LONGINT - "socket(af, type, protocol)"; - - PROCEDURE -Connect*(socket: LONGINT; name: Sockaddr; namelen: LONGINT): LONGINT - "connect(socket, &(name), namelen)"; - - PROCEDURE -Getsockname*(socket: LONGINT; VAR name: Sockaddr; VAR namelen: LONGINT): LONGINT - "getsockname(socket, name, namelen)"; - - PROCEDURE -Bind*(socket: LONGINT; name: Sockaddr; namelen: LONGINT): LONGINT - "bind(socket, &(name), namelen)"; - - PROCEDURE -Listen*(socket, backlog: LONGINT): LONGINT - "listen(socket, backlog)"; - - PROCEDURE -Accept*(socket: LONGINT; VAR addr: Sockaddr; VAR addrlen: LONGINT): LONGINT - "accept(socket, addr, addrlen)"; - - PROCEDURE -Recv*(socket, bufadr, buflen, flags: LONGINT): LONGINT - "recv(socket, bufadr, buflen, flags)"; - - PROCEDURE -Send*(socket, bufadr, buflen, flags: LONGINT): LONGINT - "send(socket, bufadr, buflen, flags)"; - - PROCEDURE -sys(str: ARRAY OF CHAR): INTEGER (* need this to call external tools like gcc or gas; noch *) - "system(str)"; - - PROCEDURE system*(cmd : ARRAY OF CHAR); - VAR r : INTEGER; - BEGIN - r := sys(cmd); - END system; - - PROCEDURE System*(cmd : ARRAY OF CHAR): INTEGER; - VAR r : INTEGER; - BEGIN - r := sys(cmd); - RETURN r - END System; - - PROCEDURE -SizeofUnixStat(): INTEGER - "sizeof(Unix_Status)"; - - PROCEDURE -SizeofStat(): INTEGER - "sizeof(struct stat)"; - - PROCEDURE -Error(msg: ARRAY OF CHAR; len: INTEGER) - "write(1/*stdout*/, msg, len); char ch = 0xa; write(1, &ch, 1)"; - - PROCEDURE StatCheck; - VAR x, y: LONGINT; - BEGIN - x := SizeofUnixStat(); - y := SizeofStat(); - IF x # y THEN - Error("Unix.StatCheck: inconsistent usage of struct stat", 49); - Exit(1); - END - END StatCheck; - -BEGIN - - StatCheck(); -END Unix. diff --git a/src/system/linux/clang/x86_64/Args.Mod b/src/system/linux/clang/x86_64/Args.Mod deleted file mode 100644 index 0e90a48b..00000000 --- a/src/system/linux/clang/x86_64/Args.Mod +++ /dev/null @@ -1,65 +0,0 @@ -MODULE Args; (* jt, 8.12.94 *) - - (* command line argument handling for voc (jet backend) *) - - - IMPORT SYSTEM; - - TYPE - ArgPtr = POINTER TO ARRAY 1024 OF CHAR; - ArgVec = POINTER TO ARRAY 1024 OF ArgPtr; - - VAR argc-:INTEGER; argv-: LONGINT; - (*PROCEDURE -includestdlib() "#include ";*) - PROCEDURE -externgetenv() "extern char *getenv(const char *name);"; (* took this from stdlib.h*) - PROCEDURE -Argc(): INTEGER "SYSTEM_argc"; - PROCEDURE -Argv(): LONGINT "(long)SYSTEM_argv"; - PROCEDURE -getenv(var: ARRAY OF CHAR): ArgPtr - "(Args_ArgPtr)getenv(var)"; - - PROCEDURE Get*(n: INTEGER; VAR val: ARRAY OF CHAR); - VAR av: ArgVec; - BEGIN - IF n < argc THEN av := SYSTEM.VAL(ArgVec, argv); COPY(av[n]^, val) END - END Get; - - PROCEDURE GetInt*(n: INTEGER; VAR val: LONGINT); - VAR s: ARRAY 64 OF CHAR; k, d, i: LONGINT; - BEGIN - s := ""; Get(n, s); i := 0; - IF s[0] = "-" THEN i := 1 END ; - k := 0; d := ORD(s[i]) - ORD("0"); - WHILE (d >= 0 ) & (d <= 9) DO k := k*10 + d; INC(i); d := ORD(s[i]) - ORD("0") END ; - IF s[0] = "-" THEN d := -d; DEC(i) END ; - IF i > 0 THEN val := k END - END GetInt; - - PROCEDURE Pos*(s: ARRAY OF CHAR): INTEGER; - VAR i: INTEGER; arg: ARRAY 256 OF CHAR; - BEGIN - i := 0; Get(i, arg); - WHILE (i < argc) & (s # arg) DO INC(i); Get(i, arg) END ; - RETURN i - END Pos; - - PROCEDURE GetEnv*(var: ARRAY OF CHAR; VAR val: ARRAY OF CHAR); - VAR p: ArgPtr; - BEGIN - p := getenv(var); - IF p # NIL THEN COPY(p^, val) END - END GetEnv; - - PROCEDURE getEnv*(var: ARRAY OF CHAR; VAR val: ARRAY OF CHAR): BOOLEAN; - VAR p: ArgPtr; - BEGIN - p := getenv(var); - IF p # NIL THEN - COPY(p^, val); - RETURN TRUE - ELSE - RETURN FALSE - END - END getEnv; - -BEGIN argc := Argc(); argv := Argv() -END Args. diff --git a/src/system/linux/clang/x86_64/Files.Mod b/src/system/linux/clang/x86_64/Files.Mod deleted file mode 100644 index c8f42ca5..00000000 --- a/src/system/linux/clang/x86_64/Files.Mod +++ /dev/null @@ -1,664 +0,0 @@ -MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files *) -(* modified version of Files, which opens only the file provided and does not scan any path in any environment variable, also ReadLine procedure added; -- noch *) - IMPORT SYSTEM, Unix, Kernel, Args, Console; - - (* standard data type I/O - - little endian, - Sint:1, Int:2, Lint:4 - ORD({0}) = 1, - false = 0, true =1 - IEEE real format, - null terminated strings, - compact numbers according to M.Odersky *) - - - CONST - nofbufs = 4; - bufsize = 4096; - fileTabSize = 64; - noDesc = -1; - notDone = -1; - - (* file states *) - open = 0; create = 1; close = 2; - - - TYPE - FileName = ARRAY 101 OF CHAR; - File* = POINTER TO Handle; - Buffer = POINTER TO BufDesc; - - Handle = RECORD - workName, registerName: FileName; - tempFile: BOOLEAN; - dev, ino, mtime: LONGINT; - fd-: INTEGER; - len, pos: LONGINT; - bufs: ARRAY nofbufs OF Buffer; - swapper, state: INTEGER - END ; - - BufDesc = RECORD - f: File; - chg: BOOLEAN; - org, size: LONGINT; - data: ARRAY bufsize OF SYSTEM.BYTE - END ; - - Rider* = RECORD - res*: LONGINT; - eof*: BOOLEAN; - buf: Buffer; - org, offset: LONGINT - END ; - - Time = POINTER TO TimeDesc; - TimeDesc = RECORD - sec*, min*, hour*, mday*, mon*, year*, wday*, isdst*, zone*, gmtoff*: LONGINT; -(* sec*, min*, hour*, mday*, mon*, year*, wday*, isdst*, zone*, gmtoff*: INTEGER;*) - END ; - - VAR - fileTab: ARRAY fileTabSize OF LONGINT (*=File*); - tempno: INTEGER; - -(* for localtime *) - PROCEDURE -includetime() - '#include "time.h"'; - - PROCEDURE -localtime(VAR clock: LONGINT): Time - "(Files_Time) localtime(clock)"; - - PROCEDURE -getcwd(VAR cwd: Unix.Name) - "getcwd(cwd, cwd__len)"; - - PROCEDURE -IdxTrap "__HALT(-1)"; - - PROCEDURE^ Finalize(o: SYSTEM.PTR); - - PROCEDURE Err(s: ARRAY OF CHAR; f: File; errno: LONGINT); - BEGIN - Console.Ln; Console.String("-- "); Console.String(s); Console.String(": "); - IF f # NIL THEN - IF f.registerName # "" THEN Console.String(f.registerName) ELSE Console.String(f.workName) END - END ; - IF errno # 0 THEN Console.String(" errno = "); Console.Int(errno, 1) END ; - Console.Ln; - HALT(99) - END Err; - - PROCEDURE MakeFileName(dir, name: ARRAY OF CHAR; VAR dest: ARRAY OF CHAR); - VAR i, j: INTEGER; - BEGIN i := 0; j := 0; - WHILE dir[i] # 0X DO dest[i] := dir[i]; INC(i) END ; - IF dest[i-1] # "/" THEN dest[i] := "/"; INC(i) END ; - WHILE name[j] # 0X DO dest[i] := name[j]; INC(i); INC(j) END ; - dest[i] := 0X - END MakeFileName; - - PROCEDURE GetTempName(finalName: ARRAY OF CHAR; VAR name: ARRAY OF CHAR); - VAR n, i, j: LONGINT; - BEGIN - INC(tempno); n := tempno; i := 0; - IF finalName[0] # "/" THEN (* relative pathname *) - WHILE Kernel.CWD[i] # 0X DO name[i] := Kernel.CWD[i]; INC(i) END; - IF Kernel.CWD[i-1] # "/" THEN name[i] := "/"; INC(i) END - END; - j := 0; - WHILE finalName[j] # 0X DO name[i] := finalName[j]; INC(i); INC(j) END; - DEC(i); - WHILE name[i] # "/" DO DEC(i) END; - name[i+1] := "."; name[i+2] := "t"; name[i+3] := "m"; name[i+4] := "p"; name[i+5] := "."; INC(i, 6); - WHILE n > 0 DO name[i] := CHR(n MOD 10 + ORD("0")); n := n DIV 10; INC(i) END; - name[i] := "."; INC(i); n := SHORT(Unix.Getpid()); - WHILE n > 0 DO name[i] := CHR(n MOD 10 + ORD("0")); n := n DIV 10; INC(i) END; - name[i] := 0X - END GetTempName; - - PROCEDURE Create(f: File); - VAR stat: Unix.Status; done: BOOLEAN; - errno: LONGINT; err: ARRAY 32 OF CHAR; - BEGIN - IF f.fd = noDesc THEN - IF f.state = create THEN GetTempName(f.registerName, f.workName); f.tempFile := TRUE - ELSIF f.state = close THEN - f.workName := f.registerName; f.registerName := ""; f.tempFile := FALSE - END ; - errno := Unix.Unlink(f.workName); (*unlink first to avoid stale NFS handles and to avoid reuse of inodes*) - f.fd := Unix.Open(f.workName, SHORT(SYSTEM.VAL(LONGINT, Unix.rdwr + Unix.creat + Unix.trunc)), SHORT(SYSTEM.VAL(LONGINT, {2, 4,5, 7,8}))); - done := f.fd >= 0; errno := Unix.errno(); - IF (~done & ((errno = Unix.ENFILE) OR (errno = Unix.EMFILE))) OR (done & (f.fd >= fileTabSize)) THEN - IF done & (f.fd >= fileTabSize) THEN errno := Unix.Close(f.fd) END ; - Kernel.GC(TRUE); - f.fd := Unix.Open(f.workName, SHORT(SYSTEM.VAL(LONGINT, Unix.rdwr + Unix.creat + Unix.trunc)), SHORT(SYSTEM.VAL(LONGINT, {2, 4,5, 7,8}))); - done := f.fd >= 0 - END ; - IF done THEN - IF f.fd >= fileTabSize THEN errno := Unix.Close(f.fd); Err("too many files open", f, 0) - ELSE fileTab[f.fd] := SYSTEM.VAL(LONGINT, f); INC(Kernel.nofiles); Kernel.RegisterObject(f, Finalize); - f.state := open; f.pos := 0; errno := Unix.Fstat(f.fd, stat); - f.dev := stat.dev; f.ino := stat.ino; f.mtime := stat.mtime - END - ELSE errno := Unix.errno(); - IF errno = Unix.ENOENT THEN err := "no such directory" - ELSIF (errno = Unix.ENFILE) OR (errno = Unix.EMFILE) THEN err := "too many files open" - ELSE err := "file not created" - END ; - Err(err, f, errno) - END - END - END Create; - - PROCEDURE Flush(buf: Buffer); - VAR res: LONGINT; f: File; stat: Unix.Status; - BEGIN - IF buf.chg THEN f := buf.f; Create(f); - IF buf.org # f.pos THEN res := Unix.Lseek(f.fd, buf.org, 0) END ; - res := Unix.Write(f.fd, SYSTEM.ADR(buf.data), buf.size); - IF res < 0 THEN Err("error in writing file", f, Unix.errno()) END ; - f.pos := buf.org + buf.size; - buf.chg := FALSE; - res := Unix.Fstat(f.fd, stat); - f.mtime := stat.mtime - END - END Flush; - - PROCEDURE Close* (f: File); - VAR i, res: LONGINT; - BEGIN - IF (f.state # create) OR (f.registerName # "") THEN - Create(f); i := 0; - WHILE (i < nofbufs) & (f.bufs[i] # NIL) DO Flush(f.bufs[i]); INC(i) END ; - res := Unix.Fsync(f.fd); - IF res < 0 THEN Err("error in writing file", f, Unix.errno()) END - END - END Close; - - PROCEDURE Length* (f: File): LONGINT; - BEGIN RETURN f.len - END Length; - - PROCEDURE New* (name: ARRAY OF CHAR): File; - VAR f: File; - BEGIN - NEW(f); f.workName := ""; COPY(name, f.registerName); - f.fd := noDesc; f.state := create; f.len := 0; f.pos := 0; f.swapper := -1; (*all f.buf[i] = NIL*) - RETURN f - END New; -(* - PROCEDURE ScanPath(VAR pos: INTEGER; VAR dir: ARRAY OF CHAR); (* supports ~, ~user and blanks inside path *) - VAR i: INTEGER; ch: CHAR; home: ARRAY 256 OF CHAR; - BEGIN - i := 0; ch := Kernel.OBERON[pos]; - WHILE (ch = " ") OR (ch = ":") DO INC(pos); ch := Kernel.OBERON[pos] END ; - IF ch = "~" THEN - INC(pos); ch := Kernel.OBERON[pos]; - home := ""; Args.GetEnv("HOME", home); - WHILE home[i] # 0X DO dir[i] := home[i]; INC(i) END ; - IF (ch # "/") & (ch # 0X) & (ch # ":") & (ch # " ") THEN - WHILE (i > 0) & (dir[i-1] # "/") DO DEC(i) END - END - END ; - WHILE (ch # 0X) & (ch # ":") DO dir[i] := ch; INC(i); INC(pos); ch := Kernel.OBERON[pos] END ; - WHILE (i > 0) & (dir[i-1] = " ") DO DEC(i) END ; - dir[i] := 0X - END ScanPath; -*) - PROCEDURE HasDir(VAR name: ARRAY OF CHAR): BOOLEAN; - VAR i: INTEGER; ch: CHAR; - BEGIN i := 0; ch := name[0]; - WHILE (ch # 0X) & (ch # "/") DO INC(i); ch := name[i] END ; - RETURN ch = "/" - END HasDir; - - PROCEDURE CacheEntry(dev, ino: LONGINT; mtime: LONGINT): File; - VAR f: File; i: INTEGER; stat: Unix.Status; res: LONGINT; - BEGIN i := 0; - WHILE i < fileTabSize DO - f := SYSTEM.VAL(File, fileTab[i]); - IF (f # NIL) & (ino = f.ino) & (dev = f.dev) THEN - IF mtime # f.mtime THEN i := 0; - WHILE i < nofbufs DO - IF f.bufs[i] # NIL THEN f.bufs[i].org := -1; f.bufs[i] := NIL END ; - INC(i) - END ; - f.swapper := -1; f.mtime := mtime; - res := Unix.Fstat(f.fd, stat); f.len := stat.size - END ; - RETURN f - END ; - INC(i) - END ; - RETURN NIL - END CacheEntry; - - PROCEDURE Old* (name: ARRAY OF CHAR): File; - VAR f: File; fd: INTEGER; res, errno: LONGINT; pos: INTEGER; done: BOOLEAN; - dir, path: ARRAY 256 OF CHAR; - stat: Unix.Status; - BEGIN - IF name # "" THEN - IF HasDir(name) THEN dir := ""; COPY(name, path) - ELSE - pos := 0; - COPY(name, path); (* -- noch *) - (*ScanPath(pos, dir);*) (*MakeFileName(dir, name, path);*) (*ScanPath(pos, dir)*) - END ; - LOOP - fd := Unix.Open(path, SHORT(SYSTEM.VAL(LONGINT, Unix.rdwr)), SHORT(SYSTEM.VAL(LONGINT, {}))); done := fd >= 0; errno := Unix.errno(); - IF (~done & ((errno = Unix.ENFILE) OR (errno = Unix.EMFILE))) OR (done & (fd >= fileTabSize)) THEN - IF done & (fd >= fileTabSize) THEN res := Unix.Close(fd) END ; - Kernel.GC(TRUE); - fd := Unix.Open(path, SHORT(SYSTEM.VAL(LONGINT, Unix.rdwr)), SHORT(SYSTEM.VAL(LONGINT, {}))); - done := fd >= 0; errno := Unix.errno(); - IF ~done & ((errno = Unix.ENFILE) OR (errno = Unix.EMFILE)) THEN Err("too many files open", f, errno) END - END ; - IF ~done & ((errno = Unix.EACCES) OR (errno = Unix.EROFS) OR (errno = Unix.EAGAIN)) THEN - (* errno EAGAIN observed on Solaris 2.4 *) - fd := Unix.Open(path, SHORT(SYSTEM.VAL(LONGINT, Unix.rdonly)), SHORT(SYSTEM.VAL(LONGINT, {}))); done := fd >= 0; errno := Unix.errno() - END ; -IF (~done) & (errno # Unix.ENOENT) THEN - Console.String("warning Files.Old "); Console.String(name); - Console.String(" errno = "); Console.Int(errno, 0); Console.Ln; -END ; - IF done THEN - res := Unix.Fstat(fd, stat); - f := CacheEntry(stat.dev, stat.ino, stat.mtime); - IF f # NIL THEN res := Unix.Close(fd); RETURN f - ELSIF fd >= fileTabSize THEN res := Unix.Close(fd); Err("too many files open", f, 0) - ELSE NEW(f); fileTab[fd] := SYSTEM.VAL(LONGINT, f); INC(Kernel.nofiles); Kernel.RegisterObject(f, Finalize); - f.fd := fd; f.state := open; f.len := stat.size; f.pos := 0; f.swapper := -1; (*all f.buf[i] = NIL*) - COPY(name, f.workName); f.registerName := ""; f.tempFile := FALSE; - f.dev := stat.dev; f.ino := stat.ino; f.mtime := stat.mtime; - RETURN f - END - ELSIF dir = "" THEN RETURN NIL - ELSE (*MakeFileName(dir, name, path);*) (*ScanPath(pos, dir)*) - RETURN NIL - END - END - ELSE RETURN NIL - END - END Old; - - PROCEDURE Purge* (f: File); - VAR i: INTEGER; stat: Unix.Status; res: LONGINT; - BEGIN i := 0; - WHILE i < nofbufs DO - IF f.bufs[i] # NIL THEN f.bufs[i].org := -1; f.bufs[i] := NIL END ; - INC(i) - END ; - IF f.fd # noDesc THEN res := Unix.Ftruncate(f.fd, 0); res := Unix.Lseek(f.fd, 0, 0) END ; - f.pos := 0; f.len := 0; f.swapper := -1; - res := Unix.Fstat(f.fd, stat); f.mtime := stat.mtime - END Purge; - - PROCEDURE GetDate* (f: File; VAR t, d: LONGINT); - VAR stat: Unix.Status; clock, res: LONGINT; time: Time; - BEGIN - Create(f); res := Unix.Fstat(f.fd, stat); - time := localtime(stat.mtime); - t := time.sec + ASH(time.min, 6) + ASH(time.hour, 12); - d := time.mday + ASH(time.mon+1, 5) + ASH(time.year MOD 100, 9) - END GetDate; - - PROCEDURE Pos* (VAR r: Rider): LONGINT; - BEGIN RETURN r.org + r.offset - END Pos; - - PROCEDURE Set* (VAR r: Rider; f: File; pos: LONGINT); - VAR org, offset, i, n, res: LONGINT; buf: Buffer; - BEGIN - IF f # NIL THEN - IF pos > f.len THEN pos := f.len ELSIF pos < 0 THEN pos := 0 END ; - offset := pos MOD bufsize; org := pos - offset; i := 0; - WHILE (i < nofbufs) & (f.bufs[i] # NIL) & (org # f.bufs[i].org) DO INC(i) END ; - IF i < nofbufs THEN - IF f.bufs[i] = NIL THEN NEW(buf); buf.chg := FALSE; buf.org := -1; buf.f := f; f.bufs[i] := buf - ELSE buf := f.bufs[i] - END - ELSE - f.swapper := (f.swapper + 1) MOD nofbufs; - buf := f.bufs[f.swapper]; - Flush(buf) - END ; - IF buf.org # org THEN - IF org = f.len THEN buf.size := 0 - ELSE Create(f); - IF f.pos # org THEN res := Unix.Lseek(f.fd, org, 0) END ; - n := Unix.ReadBlk(f.fd, buf.data); - IF n < 0 THEN Err("read from file not done", f, Unix.errno()) END ; - f.pos := org + n; - buf.size := n - END ; - buf.org := org; buf.chg := FALSE - END - ELSE buf := NIL; org := 0; offset := 0 - END ; - r.buf := buf; r.org := org; r.offset := offset; r.eof := FALSE; r.res := 0 - END Set; - - PROCEDURE Read* (VAR r: Rider; VAR x: SYSTEM.BYTE); - VAR offset: LONGINT; buf: Buffer; - BEGIN - buf := r.buf; offset := r.offset; - IF r.org # buf.org THEN Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset END ; - IF (offset < buf.size) THEN - x := buf.data[offset]; r.offset := offset + 1 - ELSIF r.org + offset < buf.f.len THEN - Set(r, r.buf.f, r.org + offset); - x := r.buf.data[0]; r.offset := 1 - ELSE - x := 0X; r.eof := TRUE - END - END Read; - - PROCEDURE ReadBytes* (VAR r: Rider; VAR x: ARRAY OF SYSTEM.BYTE; n: LONGINT); - VAR xpos, min, restInBuf, offset: LONGINT; buf: Buffer; - BEGIN - IF n > LEN(x) THEN IdxTrap END ; - xpos := 0; buf := r.buf; offset := r.offset; - WHILE n > 0 DO - IF (r.org # buf.org) OR (offset >= bufsize) THEN - Set(r, buf.f, r.org + offset); - buf := r.buf; offset := r.offset - END ; - restInBuf := buf.size - offset; - IF restInBuf = 0 THEN r.res := n; r.eof := TRUE; RETURN - ELSIF n > restInBuf THEN min := restInBuf ELSE min := n END ; - SYSTEM.MOVE(SYSTEM.ADR(buf.data) + offset, SYSTEM.ADR(x) + xpos, min); - INC(offset, min); r.offset := offset; INC(xpos, min); DEC(n, min) - END ; - r.res := 0; r.eof := FALSE - END ReadBytes; - - PROCEDURE ReadByte* (VAR r : Rider; VAR x : ARRAY OF SYSTEM.BYTE); - BEGIN - ReadBytes(r, x, 1); - END ReadByte; - - PROCEDURE Base* (VAR r: Rider): File; - BEGIN RETURN r.buf.f - END Base; - - PROCEDURE Write* (VAR r: Rider; x: SYSTEM.BYTE); - VAR buf: Buffer; offset: LONGINT; - BEGIN - buf := r.buf; offset := r.offset; - IF (r.org # buf.org) OR (offset >= bufsize) THEN - Set(r, buf.f, r.org + offset); - buf := r.buf; offset := r.offset - END ; - buf.data[offset] := x; - buf.chg := TRUE; - IF offset = buf.size THEN - INC(buf.size); INC(buf.f.len) - END ; - r.offset := offset + 1; r.res := 0 - END Write; - - PROCEDURE WriteByte* (VAR r : Rider; x : SYSTEM.BYTE); (* added for compatibility with PO 2013, -- noch *) - BEGIN - Write(r, x); - END WriteByte; - - PROCEDURE WriteBytes* (VAR r: Rider; VAR x: ARRAY OF SYSTEM.BYTE; n: LONGINT); - VAR xpos, min, restInBuf, offset: LONGINT; buf: Buffer; - BEGIN - IF n > LEN(x) THEN IdxTrap END ; - xpos := 0; buf := r.buf; offset := r.offset; - WHILE n > 0 DO - IF (r.org # buf.org) OR (offset >= bufsize) THEN - Set(r, buf.f, r.org + offset); - buf := r.buf; offset := r.offset - END ; - restInBuf := bufsize - offset; - IF n > restInBuf THEN min := restInBuf ELSE min := n END ; - SYSTEM.MOVE(SYSTEM.ADR(x) + xpos, SYSTEM.ADR(buf.data) + offset, min); - INC(offset, min); r.offset := offset; - IF offset > buf.size THEN INC(buf.f.len, offset - buf.size); buf.size := offset END ; - INC(xpos, min); DEC(n, min); buf.chg := TRUE - END ; - r.res := 0 - END WriteBytes; - -(* another solution would be one that is similar to ReadBytes, WriteBytes. -No code duplication, more symmetric, only two ifs for -Read and Write in buffer, buf.size replaced by bufsize in Write ops, buf.size and len -must be made consistent with offset (if offset > buf.size) in a lazy way. - -PROCEDURE Write* (VAR r: Rider; x: SYSTEM.BYTE); - VAR buf: Buffer; offset: LONGINT; -BEGIN - buf := r.buf; offset := r.offset; - IF (offset >= bufsize) OR (r.org # buf.org) THEN - Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset; - END ; - buf.data[offset] := x; r.offset := offset + 1; buf.chg := TRUE -END Write; - - -PROCEDURE WriteBytes ... - -PROCEDURE Read* (VAR r: Rider; VAR x: SYSTEM.BYTE); - VAR offset: LONGINT; buf: Buffer; -BEGIN - buf := r.buf; offset := r.offset; - IF (offset >= buf.size) OR (r.org # buf.org) THEN - IF r.org + offset >= buf.f.len THEN x := 0X; r.eof := TRUE; RETURN - ELSE Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset - END - END ; - x := buf.data[offset]; r.offset := offset + 1 -END Read; - -but this would also affect Set, Length, and Flush. -Especially Length would become fairly complex. -*) - - PROCEDURE Delete* (name: ARRAY OF CHAR; VAR res: INTEGER); - BEGIN - res := SHORT(Unix.Unlink(name)); - res := SHORT(Unix.errno()) - END Delete; - - PROCEDURE Rename* (old, new: ARRAY OF CHAR; VAR res: INTEGER); - VAR fdold, fdnew: INTEGER; n, errno, r: LONGINT; - ostat, nstat: Unix.Status; - buf: ARRAY 4096 OF CHAR; - BEGIN - r := Unix.Stat(old, ostat); - IF r >= 0 THEN - r := Unix.Stat(new, nstat); - IF (r >= 0) & ((ostat.dev # nstat.dev) OR (ostat.ino # nstat.ino)) THEN - Delete(new, res); (* work around stale nfs handles *) - END ; - r := Unix.Rename(old, new); - IF r < 0 THEN res := SHORT(Unix.errno()); - IF res = Unix.EXDEV THEN (* cross device link, move the file *) - fdold := Unix.Open(old, SHORT(SYSTEM.VAL(LONGINT, Unix.rdonly)), SHORT(SYSTEM.VAL(LONGINT, {}))); - IF fdold < 0 THEN res := 2; RETURN END ; - fdnew := Unix.Open(new, SHORT(SYSTEM.VAL(LONGINT, Unix.rdwr + Unix.creat + Unix.trunc)), SHORT(SYSTEM.VAL(LONGINT, {2, 4,5, 7,8}))); - IF fdnew < 0 THEN r := Unix.Close(fdold); res := 3; RETURN END ; - n := Unix.Read(fdold, SYSTEM.ADR(buf), bufsize); - WHILE n > 0 DO - r := Unix.Write(fdnew, SYSTEM.ADR(buf), n); - IF r < 0 THEN errno := Unix.errno(); r := Unix.Close(fdold); r := Unix.Close(fdnew); - Err("cannot move file", NIL, errno) - END ; - n := Unix.Read(fdold, SYSTEM.ADR(buf), bufsize) - END ; - errno := Unix.errno(); - r := Unix.Close(fdold); r := Unix.Close(fdnew); - IF n = 0 THEN r := Unix.Unlink(old); res := 0 - ELSE Err("cannot move file", NIL, errno) - END ; - ELSE RETURN (* res is Unix.Rename return code *) - END - END ; - res := 0 - ELSE res := 2 (* old file not found *) - END - END Rename; - - PROCEDURE Register* (f: File); - VAR idx, errno: INTEGER; f1: File; file: ARRAY 104 OF CHAR; - BEGIN - IF (f.state = create) & (f.registerName # "") THEN f.state := close (* shortcut renaming *) END ; - Close(f); - IF f.registerName # "" THEN - Rename(f.workName, f.registerName, errno); - IF errno # 0 THEN COPY(f.registerName, file); HALT(99) END ; - f.workName := f.registerName; f.registerName := ""; f.tempFile := FALSE - END - END Register; - - PROCEDURE ChangeDirectory*(path: ARRAY OF CHAR; VAR res: INTEGER); - BEGIN - res := SHORT(Unix.Chdir(path)); - getcwd(Kernel.CWD) - END ChangeDirectory; - - PROCEDURE FlipBytes(VAR src, dest: ARRAY OF SYSTEM.BYTE); - VAR i, j: LONGINT; - BEGIN - IF ~Kernel.littleEndian THEN i := LEN(src); j := 0; - WHILE i > 0 DO DEC(i); dest[j] := src[i]; INC(j) END - ELSE SYSTEM.MOVE(SYSTEM.ADR(src), SYSTEM.ADR(dest), LEN(src)) - END - END FlipBytes; - - PROCEDURE ReadBool* (VAR R: Rider; VAR x: BOOLEAN); - BEGIN Read(R, SYSTEM.VAL(CHAR, x)) - END ReadBool; - - PROCEDURE ReadInt* (VAR R: Rider; VAR x: INTEGER); - VAR b: ARRAY 2 OF CHAR; - BEGIN ReadBytes(R, b, 2); - x := ORD(b[0]) + ORD(b[1])*256 - END ReadInt; - - PROCEDURE ReadLInt* (VAR R: Rider; VAR x: LONGINT); - VAR b: ARRAY 4 OF CHAR; - BEGIN ReadBytes(R, b, 4); - x := ORD(b[0]) + ORD(b[1])*100H + ORD(b[2])*10000H + ORD(b[3])*1000000H - END ReadLInt; - - PROCEDURE ReadSet* (VAR R: Rider; VAR x: SET); - VAR b: ARRAY 4 OF CHAR; - BEGIN ReadBytes(R, b, 4); - x := SYSTEM.VAL(SET, ORD(b[0]) + ORD(b[1])*100H + ORD(b[2])*10000H + ORD(b[3])*1000000H) - END ReadSet; - - PROCEDURE ReadReal* (VAR R: Rider; VAR x: REAL); - VAR b: ARRAY 4 OF CHAR; - BEGIN ReadBytes(R, b, 4); FlipBytes(b, x) - END ReadReal; - - PROCEDURE ReadLReal* (VAR R: Rider; VAR x: LONGREAL); - VAR b: ARRAY 8 OF CHAR; - BEGIN ReadBytes(R, b, 8); FlipBytes(b, x) - END ReadLReal; - - PROCEDURE ReadString* (VAR R: Rider; VAR x: ARRAY OF CHAR); - VAR i: INTEGER; ch: CHAR; - BEGIN i := 0; - REPEAT Read(R, ch); x[i] := ch; INC(i) UNTIL ch = 0X - END ReadString; - - (* need to read line; -- noch *) - PROCEDURE ReadLine* (VAR R: Rider; VAR x: ARRAY OF CHAR); - VAR i: INTEGER; ch: CHAR; b : BOOLEAN; - BEGIN i := 0; - b := FALSE; - REPEAT - Read(R, ch); - IF ((ch = 0X) OR (ch = 0AX) OR (ch = 0DX)) THEN - b := TRUE - ELSE - x[i] := ch; - INC(i); - END; - UNTIL b - END ReadLine; - - PROCEDURE ReadNum* (VAR R: Rider; VAR x: LONGINT); - VAR s: SHORTINT; ch: CHAR; n: LONGINT; - BEGIN s := 0; n := 0; Read(R, ch); - WHILE ORD(ch) >= 128 DO INC(n, ASH(ORD(ch) - 128, s) ); INC(s, 7); Read(R, ch) END; - INC(n, ASH(ORD(ch) MOD 64 - ORD(ch) DIV 64 * 64, s) ); - x := n - END ReadNum; - - PROCEDURE WriteBool* (VAR R: Rider; x: BOOLEAN); - BEGIN Write(R, SYSTEM.VAL(CHAR, x)) - END WriteBool; - - PROCEDURE WriteInt* (VAR R: Rider; x: INTEGER); - VAR b: ARRAY 2 OF CHAR; - BEGIN b[0] := CHR(x); b[1] := CHR(x DIV 256); - WriteBytes(R, b, 2); - END WriteInt; - - PROCEDURE WriteLInt* (VAR R: Rider; x: LONGINT); - VAR b: ARRAY 4 OF CHAR; - BEGIN - b[0] := CHR(x); b[1] := CHR(x DIV 100H); b[2] := CHR(x DIV 10000H); b[3] := CHR(x DIV 1000000H); - WriteBytes(R, b, 4); - END WriteLInt; - - PROCEDURE WriteSet* (VAR R: Rider; x: SET); - VAR b: ARRAY 4 OF CHAR; i: LONGINT; - BEGIN i := SYSTEM.VAL(LONGINT, x); - 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; - - PROCEDURE WriteReal* (VAR R: Rider; x: REAL); - VAR b: ARRAY 4 OF CHAR; - BEGIN FlipBytes(x, b); WriteBytes(R, b, 4) - END WriteReal; - - PROCEDURE WriteLReal* (VAR R: Rider; x: LONGREAL); - VAR b: ARRAY 8 OF CHAR; - BEGIN FlipBytes(x, b); WriteBytes(R, b, 8) - END WriteLReal; - - PROCEDURE WriteString* (VAR R: Rider; x: ARRAY [1] OF CHAR); - VAR i: INTEGER; - BEGIN i := 0; - WHILE x[i] # 0X DO INC(i) END ; - WriteBytes(R, x, i+1) - END WriteString; - - PROCEDURE WriteNum* (VAR R: Rider; x: LONGINT); - BEGIN - WHILE (x < - 64) OR (x > 63) DO Write(R, CHR(x MOD 128 + 128)); x := x DIV 128 END; - Write(R, CHR(x MOD 128)) - END WriteNum; - - PROCEDURE GetName*(f: File; VAR name: ARRAY OF CHAR); - BEGIN - COPY (f.workName, name); - END GetName; - - PROCEDURE Finalize(o: SYSTEM.PTR); - VAR f: File; res: LONGINT; - BEGIN - f := SYSTEM.VAL(File, o); - IF f.fd >= 0 THEN - fileTab[f.fd] := 0; res := Unix.Close(f.fd); f.fd := -1; DEC(Kernel.nofiles); - IF f.tempFile THEN res := Unix.Unlink(f.workName) END - END - END Finalize; - - PROCEDURE Init; - VAR i: LONGINT; - BEGIN - i := 0; WHILE i < fileTabSize DO fileTab[i] := 0; INC(i) END ; - tempno := -1; Kernel.nofiles := 0 - END Init; - -BEGIN Init -END Files. diff --git a/src/system/linux/clang/x86_64/Files0.Mod b/src/system/linux/clang/x86_64/Files0.Mod deleted file mode 100644 index 1d9cd953..00000000 --- a/src/system/linux/clang/x86_64/Files0.Mod +++ /dev/null @@ -1,636 +0,0 @@ -MODULE Files0; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files *) - -(* this module is not for use by developers and inteded to bootstrap voc *) -(* for general use import Files module *) - - IMPORT SYSTEM, Unix, Kernel := Kernel0, Args, Console; - - (* standard data type I/O - - little endian, - Sint:1, Int:2, Lint:4 - ORD({0}) = 1, - false = 0, true =1 - IEEE real format, - null terminated strings, - compact numbers according to M.Odersky *) - - - CONST - nofbufs = 4; - bufsize = 4096; - fileTabSize = 64; - noDesc = -1; - notDone = -1; - - (* file states *) - open = 0; create = 1; close = 2; - - - TYPE - FileName = ARRAY 101 OF CHAR; - File* = POINTER TO Handle; - Buffer = POINTER TO BufDesc; - - Handle = RECORD - workName, registerName: FileName; - tempFile: BOOLEAN; - dev, ino, mtime: LONGINT; - fd-: INTEGER; - len, pos: LONGINT; - bufs: ARRAY nofbufs OF Buffer; - swapper, state: INTEGER - END ; - - BufDesc = RECORD - f: File; - chg: BOOLEAN; - org, size: LONGINT; - data: ARRAY bufsize OF SYSTEM.BYTE - END ; - - Rider* = RECORD - res*: LONGINT; - eof*: BOOLEAN; - buf: Buffer; - org, offset: LONGINT - END ; - - Time = POINTER TO TimeDesc; - TimeDesc = RECORD - sec*, min*, hour*, mday*, mon*, year*, wday*, isdst*, zone*, gmtoff*: LONGINT; -(* sec*, min*, hour*, mday*, mon*, year*, wday*, isdst*, zone*, gmtoff*: INTEGER;*) - END ; - - VAR - fileTab: ARRAY fileTabSize OF LONGINT (*=File*); - tempno: INTEGER; - -(* for localtime *) - PROCEDURE -includetime() - '#include "time.h"'; - - PROCEDURE -localtime(VAR clock: LONGINT): Time - "(Files0_Time) localtime(clock)"; - - PROCEDURE -getcwd(VAR cwd: Unix.Name) - "getcwd(cwd, cwd__len)"; - - PROCEDURE -IdxTrap "__HALT(-1)"; - - PROCEDURE^ Finalize(o: SYSTEM.PTR); - - PROCEDURE Err(s: ARRAY OF CHAR; f: File; errno: LONGINT); - BEGIN - Console.Ln; Console.String("-- "); Console.String(s); Console.String(": "); - IF f # NIL THEN - IF f.registerName # "" THEN Console.String(f.registerName) ELSE Console.String(f.workName) END - END ; - IF errno # 0 THEN Console.String(" errno = "); Console.Int(errno, 1) END ; - Console.Ln; - HALT(99) - END Err; - - PROCEDURE MakeFileName(dir, name: ARRAY OF CHAR; VAR dest: ARRAY OF CHAR); - VAR i, j: INTEGER; - BEGIN i := 0; j := 0; - WHILE dir[i] # 0X DO dest[i] := dir[i]; INC(i) END ; - IF dest[i-1] # "/" THEN dest[i] := "/"; INC(i) END ; - WHILE name[j] # 0X DO dest[i] := name[j]; INC(i); INC(j) END ; - dest[i] := 0X - END MakeFileName; - - PROCEDURE GetTempName(finalName: ARRAY OF CHAR; VAR name: ARRAY OF CHAR); - VAR n, i, j: LONGINT; - BEGIN - INC(tempno); n := tempno; i := 0; - IF finalName[0] # "/" THEN (* relative pathname *) - WHILE Kernel.CWD[i] # 0X DO name[i] := Kernel.CWD[i]; INC(i) END; - IF Kernel.CWD[i-1] # "/" THEN name[i] := "/"; INC(i) END - END; - j := 0; - WHILE finalName[j] # 0X DO name[i] := finalName[j]; INC(i); INC(j) END; - DEC(i); - WHILE name[i] # "/" DO DEC(i) END; - name[i+1] := "."; name[i+2] := "t"; name[i+3] := "m"; name[i+4] := "p"; name[i+5] := "."; INC(i, 6); - WHILE n > 0 DO name[i] := CHR(n MOD 10 + ORD("0")); n := n DIV 10; INC(i) END; - name[i] := "."; INC(i); n := SHORT(Unix.Getpid()); - WHILE n > 0 DO name[i] := CHR(n MOD 10 + ORD("0")); n := n DIV 10; INC(i) END; - name[i] := 0X - END GetTempName; - - PROCEDURE Create(f: File); - VAR stat: Unix.Status; done: BOOLEAN; - errno: LONGINT; err: ARRAY 32 OF CHAR; - BEGIN - IF f.fd = noDesc THEN - IF f.state = create THEN GetTempName(f.registerName, f.workName); f.tempFile := TRUE - ELSIF f.state = close THEN - f.workName := f.registerName; f.registerName := ""; f.tempFile := FALSE - END ; - errno := Unix.Unlink(f.workName); (*unlink first to avoid stale NFS handles and to avoid reuse of inodes*) -f.fd := Unix.Open(f.workName, SHORT(SYSTEM.VAL(LONGINT, (Unix.rdwr + Unix.creat + Unix.trunc))), SHORT(SYSTEM.VAL(LONGINT, ({2, 4,5, 7,8})))); - done := f.fd >= 0; errno := Unix.errno(); - IF (~done & ((errno = Unix.ENFILE) OR (errno = Unix.EMFILE))) OR (done & (f.fd >= fileTabSize)) THEN - IF done & (f.fd >= fileTabSize) THEN errno := Unix.Close(f.fd) END ; - Kernel.GC(TRUE); - f.fd := Unix.Open(f.workName, SHORT(SYSTEM.VAL(LONGINT, (Unix.rdwr + Unix.creat + Unix.trunc))), SHORT(SYSTEM.VAL(LONGINT, {2, 4,5, 7,8}))); - done := f.fd >= 0 - END ; - IF done THEN - IF f.fd >= fileTabSize THEN errno := Unix.Close(f.fd); Err("too many files open", f, 0) - ELSE fileTab[f.fd] := SYSTEM.VAL(LONGINT, f); INC(Kernel.nofiles); Kernel.RegisterObject(f, Finalize); - f.state := open; f.pos := 0; errno := Unix.Fstat(f.fd, stat); - f.dev := stat.dev; f.ino := stat.ino; f.mtime := stat.mtime - END - ELSE errno := Unix.errno(); - IF errno = Unix.ENOENT THEN err := "no such directory" - ELSIF (errno = Unix.ENFILE) OR (errno = Unix.EMFILE) THEN err := "too many files open" - ELSE err := "file not created" - END ; - Err(err, f, errno) - END - END - END Create; - - PROCEDURE Flush(buf: Buffer); - VAR res: LONGINT; f: File; stat: Unix.Status; - BEGIN - IF buf.chg THEN f := buf.f; Create(f); - IF buf.org # f.pos THEN res := Unix.Lseek(f.fd, buf.org, 0) END ; - res := Unix.Write(f.fd, SYSTEM.ADR(buf.data), buf.size); - IF res < 0 THEN Err("error in writing file", f, Unix.errno()) END ; - f.pos := buf.org + buf.size; - buf.chg := FALSE; - res := Unix.Fstat(f.fd, stat); - f.mtime := stat.mtime - END - END Flush; - - PROCEDURE Close* (f: File); - VAR i, res: LONGINT; - BEGIN - IF (f.state # create) OR (f.registerName # "") THEN - Create(f); i := 0; - WHILE (i < nofbufs) & (f.bufs[i] # NIL) DO Flush(f.bufs[i]); INC(i) END ; - res := Unix.Fsync(f.fd); - IF res < 0 THEN Err("error in writing file", f, Unix.errno()) END - END - END Close; - - PROCEDURE Length* (f: File): LONGINT; - BEGIN RETURN f.len - END Length; - - PROCEDURE New* (name: ARRAY OF CHAR): File; - VAR f: File; - BEGIN - NEW(f); f.workName := ""; COPY(name, f.registerName); - f.fd := noDesc; f.state := create; f.len := 0; f.pos := 0; f.swapper := -1; (*all f.buf[i] = NIL*) - RETURN f - END New; - - PROCEDURE ScanPath(VAR pos: INTEGER; VAR dir: ARRAY OF CHAR); (* supports ~, ~user and blanks inside path *) - VAR i: INTEGER; ch: CHAR; home: ARRAY 256 OF CHAR; - BEGIN - i := 0; ch := Kernel.OBERON[pos]; - WHILE (ch = " ") OR (ch = ":") DO INC(pos); ch := Kernel.OBERON[pos] END ; - IF ch = "~" THEN - INC(pos); ch := Kernel.OBERON[pos]; - home := ""; Args.GetEnv("HOME", home); - WHILE home[i] # 0X DO dir[i] := home[i]; INC(i) END ; - IF (ch # "/") & (ch # 0X) & (ch # ":") & (ch # " ") THEN - WHILE (i > 0) & (dir[i-1] # "/") DO DEC(i) END - END - END ; - WHILE (ch # 0X) & (ch # ":") DO dir[i] := ch; INC(i); INC(pos); ch := Kernel.OBERON[pos] END ; - WHILE (i > 0) & (dir[i-1] = " ") DO DEC(i) END ; - dir[i] := 0X - END ScanPath; - - PROCEDURE HasDir(VAR name: ARRAY OF CHAR): BOOLEAN; - VAR i: INTEGER; ch: CHAR; - BEGIN i := 0; ch := name[0]; - WHILE (ch # 0X) & (ch # "/") DO INC(i); ch := name[i] END ; - RETURN ch = "/" - END HasDir; - - PROCEDURE CacheEntry(dev, ino: LONGINT; mtime: LONGINT): File; - VAR f: File; i: INTEGER; stat: Unix.Status; res: LONGINT; - BEGIN i := 0; - WHILE i < fileTabSize DO - f := SYSTEM.VAL(File, fileTab[i]); - IF (f # NIL) & (ino = f.ino) & (dev = f.dev) THEN - IF mtime # f.mtime THEN i := 0; - WHILE i < nofbufs DO - IF f.bufs[i] # NIL THEN f.bufs[i].org := -1; f.bufs[i] := NIL END ; - INC(i) - END ; - f.swapper := -1; f.mtime := mtime; - res := Unix.Fstat(f.fd, stat); f.len := stat.size - END ; - RETURN f - END ; - INC(i) - END ; - RETURN NIL - END CacheEntry; - - PROCEDURE Old* (name: ARRAY OF CHAR): File; - VAR f: File; fd: INTEGER; res, errno: LONGINT; pos: INTEGER; done: BOOLEAN; - dir, path: ARRAY 256 OF CHAR; - stat: Unix.Status; - BEGIN - IF name # "" THEN - IF HasDir(name) THEN dir := ""; COPY(name, path) - ELSE pos := 0; ScanPath(pos, dir); MakeFileName(dir, name, path); ScanPath(pos, dir) - END ; - LOOP - fd := Unix.Open(path, SHORT(SYSTEM.VAL(LONGINT, Unix.rdwr)), SHORT(SYSTEM.VAL(LONGINT, {}))); done := fd >= 0; errno := Unix.errno(); - IF (~done & ((errno = Unix.ENFILE) OR (errno = Unix.EMFILE))) OR (done & (fd >= fileTabSize)) THEN - IF done & (fd >= fileTabSize) THEN res := Unix.Close(fd) END ; - Kernel.GC(TRUE); - fd := Unix.Open(path, SHORT(SYSTEM.VAL(LONGINT, Unix.rdwr)), SHORT(SYSTEM.VAL(LONGINT, {}))); - done := fd >= 0; errno := Unix.errno(); - IF ~done & ((errno = Unix.ENFILE) OR (errno = Unix.EMFILE)) THEN Err("too many files open", f, errno) END - END ; - IF ~done & ((errno = Unix.EACCES) OR (errno = Unix.EROFS) OR (errno = Unix.EAGAIN)) THEN - (* errno EAGAIN observed on Solaris 2.4 *) - fd := Unix.Open(path, SHORT(SYSTEM.VAL(LONGINT, Unix.rdonly)), SHORT(SYSTEM.VAL(LONGINT, {}))); done := fd >= 0; errno := Unix.errno() - END ; -IF (~done) & (errno # Unix.ENOENT) THEN - Console.String("warning Files0.Old "); Console.String(name); - Console.String(" errno = "); Console.Int(errno, 0); Console.Ln; -END ; - IF done THEN - res := Unix.Fstat(fd, stat); - f := CacheEntry(stat.dev, stat.ino, stat.mtime); - IF f # NIL THEN res := Unix.Close(fd); RETURN f - ELSIF fd >= fileTabSize THEN res := Unix.Close(fd); Err("too many files open", f, 0) - ELSE NEW(f); fileTab[fd] := SYSTEM.VAL(LONGINT, f); INC(Kernel.nofiles); Kernel.RegisterObject(f, Finalize); - f.fd := fd; f.state := open; f.len := stat.size; f.pos := 0; f.swapper := -1; (*all f.buf[i] = NIL*) - COPY(name, f.workName); f.registerName := ""; f.tempFile := FALSE; - f.dev := stat.dev; f.ino := stat.ino; f.mtime := stat.mtime; - RETURN f - END - ELSIF dir = "" THEN RETURN NIL - ELSE MakeFileName(dir, name, path); ScanPath(pos, dir) - END - END - ELSE RETURN NIL - END - END Old; - - PROCEDURE Purge* (f: File); - VAR i: INTEGER; stat: Unix.Status; res: LONGINT; - BEGIN i := 0; - WHILE i < nofbufs DO - IF f.bufs[i] # NIL THEN f.bufs[i].org := -1; f.bufs[i] := NIL END ; - INC(i) - END ; - IF f.fd # noDesc THEN res := Unix.Ftruncate(f.fd, 0); res := Unix.Lseek(f.fd, 0, 0) END ; - f.pos := 0; f.len := 0; f.swapper := -1; - res := Unix.Fstat(f.fd, stat); f.mtime := stat.mtime - END Purge; - - PROCEDURE GetDate* (f: File; VAR t, d: LONGINT); - VAR stat: Unix.Status; clock, res: LONGINT; time: Time; - BEGIN - Create(f); res := Unix.Fstat(f.fd, stat); - time := localtime(stat.mtime); - t := time.sec + ASH(time.min, 6) + ASH(time.hour, 12); - d := time.mday + ASH(time.mon+1, 5) + ASH(time.year MOD 100, 9) - END GetDate; - - PROCEDURE Pos* (VAR r: Rider): LONGINT; - BEGIN RETURN r.org + r.offset - END Pos; - - PROCEDURE Set* (VAR r: Rider; f: File; pos: LONGINT); - VAR org, offset, i, n, res: LONGINT; buf: Buffer; - BEGIN - IF f # NIL THEN - IF pos > f.len THEN pos := f.len ELSIF pos < 0 THEN pos := 0 END ; - offset := pos MOD bufsize; org := pos - offset; i := 0; - WHILE (i < nofbufs) & (f.bufs[i] # NIL) & (org # f.bufs[i].org) DO INC(i) END ; - IF i < nofbufs THEN - IF f.bufs[i] = NIL THEN NEW(buf); buf.chg := FALSE; buf.org := -1; buf.f := f; f.bufs[i] := buf - ELSE buf := f.bufs[i] - END - ELSE - f.swapper := (f.swapper + 1) MOD nofbufs; - buf := f.bufs[f.swapper]; - Flush(buf) - END ; - IF buf.org # org THEN - IF org = f.len THEN buf.size := 0 - ELSE Create(f); - IF f.pos # org THEN res := Unix.Lseek(f.fd, org, 0) END ; - n := Unix.ReadBlk(f.fd, buf.data); - IF n < 0 THEN Err("read from file not done", f, Unix.errno()) END ; - f.pos := org + n; - buf.size := n - END ; - buf.org := org; buf.chg := FALSE - END - ELSE buf := NIL; org := 0; offset := 0 - END ; - r.buf := buf; r.org := org; r.offset := offset; r.eof := FALSE; r.res := 0 - END Set; - - PROCEDURE Read* (VAR r: Rider; VAR x: SYSTEM.BYTE); - VAR offset: LONGINT; buf: Buffer; - BEGIN - buf := r.buf; offset := r.offset; - IF r.org # buf.org THEN Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset END ; - IF (offset < buf.size) THEN - x := buf.data[offset]; r.offset := offset + 1 - ELSIF r.org + offset < buf.f.len THEN - Set(r, r.buf.f, r.org + offset); - x := r.buf.data[0]; r.offset := 1 - ELSE - x := 0X; r.eof := TRUE - END - END Read; - - PROCEDURE ReadBytes* (VAR r: Rider; VAR x: ARRAY OF SYSTEM.BYTE; n: LONGINT); - VAR xpos, min, restInBuf, offset: LONGINT; buf: Buffer; - BEGIN - IF n > LEN(x) THEN IdxTrap END ; - xpos := 0; buf := r.buf; offset := r.offset; - WHILE n > 0 DO - IF (r.org # buf.org) OR (offset >= bufsize) THEN - Set(r, buf.f, r.org + offset); - buf := r.buf; offset := r.offset - END ; - restInBuf := buf.size - offset; - IF restInBuf = 0 THEN r.res := n; r.eof := TRUE; RETURN - ELSIF n > restInBuf THEN min := restInBuf ELSE min := n END ; - SYSTEM.MOVE(SYSTEM.ADR(buf.data) + offset, SYSTEM.ADR(x) + xpos, min); - INC(offset, min); r.offset := offset; INC(xpos, min); DEC(n, min) - END ; - r.res := 0; r.eof := FALSE - END ReadBytes; - - PROCEDURE ReadByte* (VAR r : Rider; VAR x : ARRAY OF SYSTEM.BYTE); - BEGIN - ReadBytes(r, x, 1); - END ReadByte; - - PROCEDURE Base* (VAR r: Rider): File; - BEGIN RETURN r.buf.f - END Base; - - PROCEDURE Write* (VAR r: Rider; x: SYSTEM.BYTE); - VAR buf: Buffer; offset: LONGINT; - BEGIN - buf := r.buf; offset := r.offset; - IF (r.org # buf.org) OR (offset >= bufsize) THEN - Set(r, buf.f, r.org + offset); - buf := r.buf; offset := r.offset - END ; - buf.data[offset] := x; - buf.chg := TRUE; - IF offset = buf.size THEN - INC(buf.size); INC(buf.f.len) - END ; - r.offset := offset + 1; r.res := 0 - END Write; - - PROCEDURE WriteBytes* (VAR r: Rider; VAR x: ARRAY OF SYSTEM.BYTE; n: LONGINT); - VAR xpos, min, restInBuf, offset: LONGINT; buf: Buffer; - BEGIN - IF n > LEN(x) THEN IdxTrap END ; - xpos := 0; buf := r.buf; offset := r.offset; - WHILE n > 0 DO - IF (r.org # buf.org) OR (offset >= bufsize) THEN - Set(r, buf.f, r.org + offset); - buf := r.buf; offset := r.offset - END ; - restInBuf := bufsize - offset; - IF n > restInBuf THEN min := restInBuf ELSE min := n END ; - SYSTEM.MOVE(SYSTEM.ADR(x) + xpos, SYSTEM.ADR(buf.data) + offset, min); - INC(offset, min); r.offset := offset; - IF offset > buf.size THEN INC(buf.f.len, offset - buf.size); buf.size := offset END ; - INC(xpos, min); DEC(n, min); buf.chg := TRUE - END ; - r.res := 0 - END WriteBytes; - -(* another solution would be one that is similar to ReadBytes, WriteBytes. -No code duplication, more symmetric, only two ifs for -Read and Write in buffer, buf.size replaced by bufsize in Write ops, buf.size and len -must be made consistent with offset (if offset > buf.size) in a lazy way. - -PROCEDURE Write* (VAR r: Rider; x: SYSTEM.BYTE); - VAR buf: Buffer; offset: LONGINT; -BEGIN - buf := r.buf; offset := r.offset; - IF (offset >= bufsize) OR (r.org # buf.org) THEN - Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset; - END ; - buf.data[offset] := x; r.offset := offset + 1; buf.chg := TRUE -END Write; - -PROCEDURE WriteBytes ... - -PROCEDURE Read* (VAR r: Rider; VAR x: SYSTEM.BYTE); - VAR offset: LONGINT; buf: Buffer; -BEGIN - buf := r.buf; offset := r.offset; - IF (offset >= buf.size) OR (r.org # buf.org) THEN - IF r.org + offset >= buf.f.len THEN x := 0X; r.eof := TRUE; RETURN - ELSE Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset - END - END ; - x := buf.data[offset]; r.offset := offset + 1 -END Read; - -but this would also affect Set, Length, and Flush. -Especially Length would become fairly complex. -*) - - PROCEDURE Delete* (name: ARRAY OF CHAR; VAR res: INTEGER); - BEGIN - res := SHORT(Unix.Unlink(name)); - res := SHORT(Unix.errno()) - END Delete; - - PROCEDURE Rename* (old, new: ARRAY OF CHAR; VAR res: INTEGER); - VAR fdold, fdnew: INTEGER; n, errno, r: LONGINT; - ostat, nstat: Unix.Status; - buf: ARRAY 4096 OF CHAR; - BEGIN - r := Unix.Stat(old, ostat); - IF r >= 0 THEN - r := Unix.Stat(new, nstat); - IF (r >= 0) & ((ostat.dev # nstat.dev) OR (ostat.ino # nstat.ino)) THEN - Delete(new, res); (* work around stale nfs handles *) - END ; - r := Unix.Rename(old, new); - IF r < 0 THEN res := SHORT(Unix.errno()); - IF res = Unix.EXDEV THEN (* cross device link, move the file *) - fdold := Unix.Open(old, SHORT(SYSTEM.VAL(LONGINT, Unix.rdonly)), SHORT(SYSTEM.VAL(LONGINT, {}))); - IF fdold < 0 THEN res := 2; RETURN END ; - fdnew := Unix.Open(new, SHORT(SYSTEM.VAL(LONGINT, Unix.rdwr + Unix.creat + Unix.trunc)), SHORT(SYSTEM.VAL(LONGINT, {2, 4,5, 7,8}))); - IF fdnew < 0 THEN r := Unix.Close(fdold); res := 3; RETURN END ; - n := Unix.Read(fdold, SYSTEM.ADR(buf), bufsize); - WHILE n > 0 DO - r := Unix.Write(fdnew, SYSTEM.ADR(buf), n); - IF r < 0 THEN errno := Unix.errno(); r := Unix.Close(fdold); r := Unix.Close(fdnew); - Err("cannot move file", NIL, errno) - END ; - n := Unix.Read(fdold, SYSTEM.ADR(buf), bufsize) - END ; - errno := Unix.errno(); - r := Unix.Close(fdold); r := Unix.Close(fdnew); - IF n = 0 THEN r := Unix.Unlink(old); res := 0 - ELSE Err("cannot move file", NIL, errno) - END ; - ELSE RETURN (* res is Unix.Rename return code *) - END - END ; - res := 0 - ELSE res := 2 (* old file not found *) - END - END Rename; - - PROCEDURE Register* (f: File); - VAR idx, errno: INTEGER; f1: File; file: ARRAY 104 OF CHAR; - BEGIN - IF (f.state = create) & (f.registerName # "") THEN f.state := close (* shortcut renaming *) END ; - Close(f); - IF f.registerName # "" THEN - Rename(f.workName, f.registerName, errno); - IF errno # 0 THEN COPY(f.registerName, file); HALT(99) END ; - f.workName := f.registerName; f.registerName := ""; f.tempFile := FALSE - END - END Register; - - PROCEDURE ChangeDirectory*(path: ARRAY OF CHAR; VAR res: INTEGER); - BEGIN - res := SHORT(Unix.Chdir(path)); - getcwd(Kernel.CWD) - END ChangeDirectory; - - PROCEDURE FlipBytes(VAR src, dest: ARRAY OF SYSTEM.BYTE); - VAR i, j: LONGINT; - BEGIN - IF ~Kernel.littleEndian THEN i := LEN(src); j := 0; - WHILE i > 0 DO DEC(i); dest[j] := src[i]; INC(j) END - ELSE SYSTEM.MOVE(SYSTEM.ADR(src), SYSTEM.ADR(dest), LEN(src)) - END - END FlipBytes; - - PROCEDURE ReadBool* (VAR R: Rider; VAR x: BOOLEAN); - BEGIN Read(R, SYSTEM.VAL(CHAR, x)) - END ReadBool; - - PROCEDURE ReadInt* (VAR R: Rider; VAR x: INTEGER); - VAR b: ARRAY 2 OF CHAR; - BEGIN ReadBytes(R, b, 2); - x := ORD(b[0]) + ORD(b[1])*256 - END ReadInt; - - PROCEDURE ReadLInt* (VAR R: Rider; VAR x: LONGINT); - VAR b: ARRAY 4 OF CHAR; - BEGIN ReadBytes(R, b, 4); - x := ORD(b[0]) + ORD(b[1])*100H + ORD(b[2])*10000H + ORD(b[3])*1000000H - END ReadLInt; - - PROCEDURE ReadSet* (VAR R: Rider; VAR x: SET); - VAR b: ARRAY 4 OF CHAR; - BEGIN ReadBytes(R, b, 4); - x := SYSTEM.VAL(SET, ORD(b[0]) + ORD(b[1])*100H + ORD(b[2])*10000H + ORD(b[3])*1000000H) - END ReadSet; - - PROCEDURE ReadReal* (VAR R: Rider; VAR x: REAL); - VAR b: ARRAY 4 OF CHAR; - BEGIN ReadBytes(R, b, 4); FlipBytes(b, x) - END ReadReal; - - PROCEDURE ReadLReal* (VAR R: Rider; VAR x: LONGREAL); - VAR b: ARRAY 8 OF CHAR; - BEGIN ReadBytes(R, b, 8); FlipBytes(b, x) - END ReadLReal; - - PROCEDURE ReadString* (VAR R: Rider; VAR x: ARRAY OF CHAR); - VAR i: INTEGER; ch: CHAR; - BEGIN i := 0; - REPEAT Read(R, ch); x[i] := ch; INC(i) UNTIL ch = 0X - END ReadString; - - PROCEDURE ReadNum* (VAR R: Rider; VAR x: LONGINT); - VAR s: SHORTINT; ch: CHAR; n: LONGINT; - BEGIN s := 0; n := 0; Read(R, ch); - WHILE ORD(ch) >= 128 DO INC(n, ASH(ORD(ch) - 128, s) ); INC(s, 7); Read(R, ch) END; - INC(n, ASH(ORD(ch) MOD 64 - ORD(ch) DIV 64 * 64, s) ); - x := n - END ReadNum; - - PROCEDURE WriteBool* (VAR R: Rider; x: BOOLEAN); - BEGIN Write(R, SYSTEM.VAL(CHAR, x)) - END WriteBool; - - PROCEDURE WriteInt* (VAR R: Rider; x: INTEGER); - VAR b: ARRAY 2 OF CHAR; - BEGIN b[0] := CHR(x); b[1] := CHR(x DIV 256); - WriteBytes(R, b, 2); - END WriteInt; - - PROCEDURE WriteLInt* (VAR R: Rider; x: LONGINT); - VAR b: ARRAY 4 OF CHAR; - BEGIN - b[0] := CHR(x); b[1] := CHR(x DIV 100H); b[2] := CHR(x DIV 10000H); b[3] := CHR(x DIV 1000000H); - WriteBytes(R, b, 4); - END WriteLInt; - - PROCEDURE WriteSet* (VAR R: Rider; x: SET); - VAR b: ARRAY 4 OF CHAR; i: LONGINT; - BEGIN i := SYSTEM.VAL(LONGINT, x); - 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; - - PROCEDURE WriteReal* (VAR R: Rider; x: REAL); - VAR b: ARRAY 4 OF CHAR; - BEGIN FlipBytes(x, b); WriteBytes(R, b, 4) - END WriteReal; - - PROCEDURE WriteLReal* (VAR R: Rider; x: LONGREAL); - VAR b: ARRAY 8 OF CHAR; - BEGIN FlipBytes(x, b); WriteBytes(R, b, 8) - END WriteLReal; - - PROCEDURE WriteString* (VAR R: Rider; x: ARRAY [1] OF CHAR); - VAR i: INTEGER; - BEGIN i := 0; - WHILE x[i] # 0X DO INC(i) END ; - WriteBytes(R, x, i+1) - END WriteString; - - PROCEDURE WriteNum* (VAR R: Rider; x: LONGINT); - BEGIN - WHILE (x < - 64) OR (x > 63) DO Write(R, CHR(x MOD 128 + 128)); x := x DIV 128 END; - Write(R, CHR(x MOD 128)) - END WriteNum; - - PROCEDURE Finalize(o: SYSTEM.PTR); - VAR f: File; res: LONGINT; - BEGIN - f := SYSTEM.VAL(File, o); - IF f.fd >= 0 THEN - fileTab[f.fd] := 0; res := Unix.Close(f.fd); f.fd := -1; DEC(Kernel.nofiles); - IF f.tempFile THEN res := Unix.Unlink(f.workName) END - END - END Finalize; - - PROCEDURE Init; - VAR i: LONGINT; - BEGIN - i := 0; WHILE i < fileTabSize DO fileTab[i] := 0; INC(i) END ; - tempno := -1; Kernel.nofiles := 0 - END Init; - -BEGIN Init -END Files0. diff --git a/src/system/linux/clang/x86_64/Unix.Mod b/src/system/linux/clang/x86_64/Unix.Mod deleted file mode 100644 index 151541ad..00000000 --- a/src/system/linux/clang/x86_64/Unix.Mod +++ /dev/null @@ -1,519 +0,0 @@ -MODULE Unix; (* Josef Templ, 5.3.90 Linux system calls *) -(* ported to gnu x86_64 and added system function, noch *) -(* Module Unix provides a system call interface to Linux. - Naming conventions: - Procedure and Type-names always start with a capital letter. - error numbers as defined in Unix - other constants start with lower case letters *) - -IMPORT SYSTEM; - -CONST - -(* various important constants *) - - stdin* = 0; stdout* =1; stderr* = 2; - - LOCKEX* = 2; LOCKUN* = 8; (* /usr/include/file.h *) - AFINET* = 2; (* /usr/include/sys/socket.h *) - PFINET* = AFINET; (* /usr/include/linux/socket.h *) - SOCKSTREAM* = 1; (* /usr/include/linux/socket.h *) - FIONREAD* = 541BH; (* in /usr/include/asm/termios.h *) - SETFL* = 4; (* set file descriptor flags; in asm/fcntl.h *) - TCP* = 0; - -(* flag sets, cf. /usr/include/asm/fcntl.h *) - rdonly* = {}; wronly* = {0}; rdwr* = {1}; creat* = {6}; excl* = {7}; trunc* = {9}; append* = {10}; ndelay = {11}; - -(* error numbers *) - - EPERM* = 1; (* Not owner *) - ENOENT* = 2; (* No such file or directory *) - ESRCH* = 3; (* No such process *) - EINTR* = 4; (* Interrupted system call *) - EIO* = 5; (* I/O error *) - ENXIO* = 6; (* No such device or address *) - E2BIG* = 7; (* Arg list too long *) - ENOEXEC* = 8; (* Exec format error *) - EBADF* = 9; (* Bad file number *) - ECHILD* = 10; (* No children *) - EAGAIN* = 11; (* No more processes *) - ENOMEM* = 12; (* Not enough core *) - EACCES* = 13; (* Permission denied *) - EFAULT* = 14; (* Bad address *) - ENOTBLK* = 15; (* Block device required *) - EBUSY* = 16; (* Mount device busy *) - EEXIST* = 17; (* File exists *) - EXDEV* = 18; (* Cross-device link *) - ENODEV* = 19; (* No such device *) - ENOTDIR* = 20; (* Not a directory*) - EISDIR* = 21; (* Is a directory *) - EINVAL* = 22; (* Invalid argument *) - ENFILE* = 23; (* File table overflow *) - EMFILE* = 24; (* Too many open files *) - ENOTTY* = 25; (* Not a typewriter *) - ETXTBSY* = 26; (* Text file busy *) - EFBIG* = 27; (* File too large *) - ENOSPC* = 28; (* No space left on device *) - ESPIPE* = 29; (* Illegal seek *) - EROFS* = 30; (* Read-only file system *) - EMLINK* = 31; (* Too many links *) - EPIPE* = 32; (* Broken pipe *) - EDOM* = 33; (* Argument too large *) - ERANGE* = 34; (* Result too large *) - EDEADLK* = 35; (* Resource deadlock would occur *) - ENAMETOOLONG* = 36; (* File name too long *) - ENOLCK* = 37; (* No record locks available *) - ENOSYS* = 38; (* Function not implemented *) - ENOTEMPTY* = 39; (* Directory not empty *) - ELOOP* = 40; (* Too many symbolic links encountered *) - EWOULDBLOCK* = EAGAIN; (* Operation would block *) - ENOMSG* = 42; (* No message of desired type *) - EIDRM* = 43; (* Identifier removed *) - ECHRNG* = 44; (* Channel number out of range *) - EL2NSYNC* = 45; (* Level 2 not synchronized *) - EL3HLT* = 46; (* Level 3 halted *) - EL3RST* = 47; (* Level 3 reset *) - ELNRNG* = 48; (* Link number out of range *) - EUNATCH* = 49; (* Protocol driver not attached *) - ENOCSI* = 50; (* No CSI structure available *) - EL2HLT* = 51; (* Level 2 halted *) - EBADE* = 52; (* Invalid exchange *) - EBADR* = 53; (* Invalid request descriptor *) - EXFULL* = 54; (* Exchange full *) - ENOANO* = 55; (* No anode *) - EBADRQC* = 56; (* Invalid request code *) - EBADSLT* = 57; (* Invalid slot *) - EDEADLOCK* = 58; (* File locking deadlock error *) - EBFONT* = 59; (* Bad font file format *) - ENOSTR* = 60; (* Device not a stream *) - ENODATA* = 61; (* No data available *) - ETIME* = 62; (* Timer expired *) - ENOSR* = 63; (* Out of streams resources *) - ENONET* = 64; (* Machine is not on the network *) - ENOPKG* = 65; (* Package not installed *) - EREMOTE* = 66; (* Object is remote *) - ENOLINK* = 67; (* Link has been severed *) - EADV* = 68; (* Advertise error *) - ESRMNT* = 69; (* Srmount error *) - ECOMM* = 70; (* Communication error on send *) - EPROTO* = 71; (* Protocol error *) - EMULTIHOP* = 72; (* Multihop attempted *) - EDOTDOT* = 73; (* RFS specific error *) - EBADMSG* = 74; (* Not a data message *) - EOVERFLOW* = 75; (* Value too large for defined data type *) - ENOTUNIQ* = 76; (* Name not unique on network *) - EBADFD* = 77; (* File descriptor in bad state *) - EREMCHG* = 78; (* Remote address changed *) - ELIBACC* = 79; (* Can not access a needed shared library *) - ELIBBAD* = 80; (* Accessing a corrupted shared library *) - ELIBSCN* = 81; (* .lib section in a.out corrupted *) - ELIBMAX* = 82; (* Attempting to link in too many shared libraries *) - ELIBEXEC* = 83; (* Cannot exec a shared library directly *) - EILSEQ* = 84; (* Illegal byte sequence *) - ERESTART* = 85; (* Interrupted system call should be restarted *) - ESTRPIPE* = 86; (* Streams pipe error *) - EUSERS* = 87; (* Too many users *) - ENOTSOCK* = 88; (* Socket operation on non-socket *) - EDESTADDRREQ* = 89; (* Destination address required *) - EMSGSIZE* = 90; (* Message too long *) - EPROTOTYPE* = 91; (* Protocol wrong type for socket *) - ENOPROTOOPT* = 92; (* Protocol not available *) - EPROTONOSUPPORT* = 93; (* Protocol not supported *) - ESOCKTNOSUPPORT* = 94; (* Socket type not supported *) - EOPNOTSUPP* = 95; (* Operation not supported on transport endpoint *) - EPFNOSUPPORT* = 96; (* Protocol family not supported *) - EAFNOSUPPORT* = 97; (* Address family not supported by protocol *) - EADDRINUSE* = 98; (* Address already in use *) - EADDRNOTAVAIL* = 99; (* Cannot assign requested address *) - ENETDOWN* = 100; (* Network is down *) - ENETUNREACH* = 101; (* Network is unreachable *) - ENETRESET* = 102; (* Network dropped connection because of reset *) - ECONNABORTED* = 103; (* Software caused connection abort *) - ECONNRESET* = 104; (* Connection reset by peer *) - ENOBUFS* = 105; (* No buffer space available *) - EISCONN* = 106; (* Transport endpoint is already connected *) - ENOTCONN* = 107; (* Transport endpoint is not connected *) - ESHUTDOWN* = 108; (* Cannot send after transport endpoint shutdown *) - ETOOMANYREFS* = 109; (* Too many references: cannot splice *) - ETIMEDOUT* = 110; (* Connection timed out *) - ECONNREFUSED* = 111; (* Connection refused *) - EHOSTDOWN* = 112; (* Host is down *) - EHOSTUNREACH* = 113; (* No route to host *) - EALREADY* = 114; (* Operation already in progress *) - EINPROGRESS* = 115; (* Operation now in progress *) - ESTALE* = 116; (* Stale NFS file handle *) - EUCLEAN* = 117; (* Structure needs cleaning *) - ENOTNAM* = 118; (* Not a XENIX named type file *) - ENAVAIL* = 119; (* No XENIX semaphores available *) - EISNAM* = 120; (* Is a named type file *) - EREMOTEIO* = 121; (* Remote I/O error *) - EDQUOT* = 122; (* Quota exceeded *) - -CONST sigsetarrlength = 1024 / 8 * SIZE(LONGINT); - - -TYPE - (* cpp /usr/include/setjmp.h - struct __jmp_buf_tag - { - __jmp_buf __jmpbuf; - int __mask_was_saved; - __sigset_t __saved_mask; - }; - - typedef struct __jmp_buf_tag jmp_buf[1]; - - __sigset_t is 128 byte long in glibc on arm, x86, x86_64 - __jmp_buf is 24 bytes long in glibc on x86 - 256 bytes long in glibc on armv6 - 64 bytes long in glibc on x86_64 - - *) - JmpBuf* = RECORD - jmpbuf: ARRAY 8 OF LONGINT; (* 8 * 8 = 64 *) - maskWasSaved*: INTEGER; - savedMask*: ARRAY 16 OF LONGINT; (* 16 * 8 = 128 *) - END ; - - Status* = RECORD (* struct stat *) - dev* : LONGINT; (* dev_t 8 *) - ino* : LONGINT; (* ino 8 *) - nlink* : LONGINT; - mode* : INTEGER; - uid*, gid*: INTEGER; - pad0* : INTEGER; - rdev* : LONGINT; - size* : LONGINT; - blksize* : LONGINT; - blocks* : LONGINT; - atime* : LONGINT; - atimences* : LONGINT; - mtime* : LONGINT; - mtimensec* : LONGINT; - ctime* : LONGINT; - ctimensec* : LONGINT; - unused0*, unused1*, unused2*: LONGINT; - END ; - -(* from /usr/include/bits/time.h - -struct timeval - { - __time_t tv_sec; /* Seconds. */ //__time_t 8 - __suseconds_t tv_usec; /* Microseconds. */ __suseconds_t 8 - }; - - -*) - - Timeval* = RECORD - sec*, usec*: LONGINT - END ; - - -(* -from man gettimeofday - - struct timezone { - int tz_minuteswest; /* minutes west of Greenwich */ int 4 - int tz_dsttime; /* type of DST correction */ int 4 - }; -*) - - - Timezone* = RECORD - (*minuteswest*, dsttime*: LONGINT*) - minuteswest*, dsttime*: INTEGER - END ; - - Itimerval* = RECORD - interval*, value*: Timeval - END ; - - FdSet* = ARRAY 8 OF SET; - - SigCtxPtr* = POINTER TO SigContext; - SigContext* = RECORD - END ; - - SignalHandler* = PROCEDURE (sig, code: LONGINT; scp: SigCtxPtr); - - Dirent* = RECORD - ino, off: LONGINT; - reclen: INTEGER; - name: ARRAY 256 OF CHAR; - END ; - - Rusage* = RECORD - utime*, stime*: Timeval; - maxrss*, ixrss*, idrss*, isrss*, - minflt*, majflt*, nswap*, inblock*, - oublock*, msgsnd*, msgrcv*, nsignals*, - nvcsw*, nivcsw*: LONGINT - END ; - - Iovec* = RECORD - base*, len*: LONGINT - END ; - - SocketPair* = ARRAY 2 OF LONGINT; - - Pollfd* = RECORD - fd*: LONGINT; - events*, revents*: INTEGER - END ; - - Sockaddr* = RECORD - family0*, family1*: SHORTINT; - pad0, pad1: SHORTINT; - pad2 : INTEGER; - (*port*: INTEGER; - internetAddr*: LONGINT;*) - pad*: ARRAY 14 OF CHAR; - END ; - - HostEntry* = POINTER [1] TO Hostent; - Hostent* = RECORD - name*, aliases*: LONGINT; - addrtype*, length*: INTEGER; - addrlist*: LONGINT; (*POINTER TO POINTER TO LONGINT, network byte order*) - END; - - Name* = ARRAY OF CHAR; - - PROCEDURE -includeStat() - "#include "; - - PROCEDURE -includeErrno() - "#include "; - - (* for read(), write() and sleep() *) - PROCEDURE -includeUnistd() - "#include "; - - (* for system() *) - PROCEDURE -includeStdlib() - "#include "; - - (* for nanosleep() *) - PROCEDURE -includeTime() - "#include "; - - (* for select() *) - PROCEDURE -includeSelect() - "#include "; - - PROCEDURE -err(): INTEGER - "errno"; - - PROCEDURE errno*(): INTEGER; - BEGIN - RETURN err() - END errno; - - PROCEDURE -Exit*(n: INTEGER) - "exit(n)"; - - PROCEDURE -Fork*(): INTEGER - "fork()"; - - PROCEDURE -Wait*(VAR status: INTEGER): INTEGER - "wait(status)"; - - PROCEDURE -Select*(width: INTEGER; VAR readfds, writefds, exceptfds: FdSet; VAR timeout: Timeval): INTEGER - "select(width, readfds, writefds, exceptfds, timeout)"; - - PROCEDURE -Gettimeofday* (VAR tv: Timeval; VAR tz: Timezone) : INTEGER - "gettimeofday(tv, tz)"; - - PROCEDURE -Read* (fd: INTEGER; buf, nbyte: LONGINT): LONGINT - "read(fd, buf, nbyte)"; - - PROCEDURE -ReadBlk* (fd: INTEGER; VAR buf: ARRAY OF SYSTEM.BYTE): LONGINT - "read(fd, buf, buf__len)"; - - PROCEDURE -Write* (fd: INTEGER; buf, nbyte: LONGINT): LONGINT - "write(fd, buf, nbyte)"; - - PROCEDURE -WriteBlk* (fd: INTEGER; VAR buf: ARRAY OF SYSTEM.BYTE): LONGINT - "write(fd, buf, buf__len)"; - - PROCEDURE -Dup*(fd: INTEGER): INTEGER - "dup(fd)"; - - PROCEDURE -Dup2*(fd1, fd2: INTEGER): INTEGER - "dup(fd1, fd2)"; - - PROCEDURE -Pipe*(fds : LONGINT): INTEGER - "pipe(fds)"; - - PROCEDURE -Getpid*(): INTEGER - "getpid()"; - - PROCEDURE -Getuid*(): INTEGER - "getuid()"; - - PROCEDURE -Geteuid*(): INTEGER - "geteuid()"; - - PROCEDURE -Getgid*(): INTEGER - "getgid()"; - - PROCEDURE -Getegid*(): INTEGER - "getegid()"; - - PROCEDURE -Unlink*(name: Name): INTEGER - "unlink(name)"; - - PROCEDURE -Open*(name: Name; flag: INTEGER; mode: LONGINT): INTEGER - "open(name, flag, mode)"; - - PROCEDURE -Close*(fd: INTEGER): INTEGER - "close(fd)"; - - PROCEDURE -stat(name: Name; VAR statbuf: Status): INTEGER - "stat((const char*)name, (struct stat*)statbuf)"; - - PROCEDURE Stat*(name: Name; VAR statbuf: Status): INTEGER; - VAR res: INTEGER; - BEGIN - res := stat(name, statbuf); - (* make the first 4 bytes as unique as possible (used in module Files for caching!) *) - (* don't understand this - INC(statbuf.dev, statbuf.devX); - INC(statbuf.rdev, statbuf.rdevX); *) - RETURN res; - END Stat; - - PROCEDURE -fstat(fd: INTEGER; VAR statbuf: Status): INTEGER - "fstat(fd, (struct stat*)statbuf)"; - - PROCEDURE Fstat*(fd: INTEGER; VAR statbuf: Status): INTEGER; - VAR res: INTEGER; - BEGIN - res := fstat(fd, statbuf); - (* make the first 4 bytes as unique as possible (used in module Files for caching!) *) - (*INC(statbuf.dev, statbuf.devX); - INC(statbuf.rdev, statbuf.rdevX); *) - RETURN res; - END Fstat; - - PROCEDURE -Fchmod*(fd, mode: INTEGER): INTEGER - "fchmod(fd, mode)"; - - PROCEDURE -Chmod*(path: Name; mode: INTEGER): INTEGER - "chmod(path, mode)"; - - PROCEDURE -Lseek*(fd: INTEGER; offset: LONGINT; origin: INTEGER): LONGINT - "lseek(fd, offset, origin)"; - - PROCEDURE -Fsync*(fd: INTEGER): INTEGER - "fsync(fd)"; - - PROCEDURE -Fcntl*(fd: INTEGER; cmd: INTEGER; arg: LONGINT ): INTEGER - "fcntl(fd, cmd, arg)"; - - PROCEDURE -Flock*(fd, operation: INTEGER): INTEGER - "flock(fd, operation)"; - - PROCEDURE -Ftruncate*(fd: INTEGER; length: LONGINT): INTEGER - "ftruncate(fd, length)"; - - PROCEDURE -Readblk*(fd: INTEGER; VAR buf: ARRAY OF SYSTEM.BYTE; len: LONGINT): LONGINT - "read(fd, buf, len)"; - - PROCEDURE -Rename*(old, new: Name): INTEGER - "rename(old, new)"; - - PROCEDURE -Chdir*(path: Name): INTEGER - "chdir(path)"; - - PROCEDURE -Ioctl*(fd: INTEGER; request, arg: LONGINT): INTEGER - "ioctl(fd, request, arg)"; - - PROCEDURE -Kill*(pid, sig: INTEGER): INTEGER - "kill(pid, sig)"; - - PROCEDURE -Sigsetmask*(mask: INTEGER): INTEGER - "sigsetmask(mask)"; - - PROCEDURE -Sleep*(ms : INTEGER): INTEGER - "(INTEGER)sleep(ms)"; - - PROCEDURE -Nanosleep*(VAR req : Timeval; VAR rem : Timeval): INTEGER - "(INTEGER)nanosleep(req, rem)"; - - (* TCP/IP networking *) - - PROCEDURE -Gethostbyname*(name: Name): HostEntry - "(Unix_HostEntry)gethostbyname(name)"; - - PROCEDURE -Gethostname*(VAR name: Name): INTEGER - "gethostname(name, name__len)"; - - PROCEDURE -Socket*(af, type, protocol: INTEGER): INTEGER - "socket(af, type, protocol)"; - - PROCEDURE -Connect*(socket: INTEGER; name: Sockaddr; namelen: INTEGER): INTEGER - "connect(socket, &(name), namelen)"; - - PROCEDURE -Getsockname*(socket: INTEGER; VAR name: Sockaddr; VAR namelen: INTEGER): INTEGER - "getsockname(socket, name, namelen)"; - - PROCEDURE -Bind*(socket: INTEGER; name: Sockaddr; namelen: INTEGER): INTEGER - "bind(socket, &(name), namelen)"; - - PROCEDURE -Listen*(socket, backlog: INTEGER): INTEGER - "listen(socket, backlog)"; - - PROCEDURE -Accept*(socket: INTEGER; VAR addr: Sockaddr; VAR addrlen: INTEGER): LONGINT - "accept(socket, addr, addrlen)"; - - PROCEDURE -Recv*(socket: INTEGER; bufadr, buflen: LONGINT; flags: INTEGER): LONGINT - "recv(socket, bufadr, buflen, flags)"; - - PROCEDURE -Send*(socket: INTEGER; bufadr, buflen: LONGINT; flags: INTEGER): LONGINT - "send(socket, bufadr, buflen, flags)"; - - PROCEDURE -sys(str: ARRAY OF CHAR): INTEGER (* need this to call external tools like gcc or gas; noch *) - "system(str)"; - - PROCEDURE system*(cmd : ARRAY OF CHAR); - VAR r : INTEGER; - BEGIN - r := sys(cmd); - END system; - - PROCEDURE System*(cmd : ARRAY OF CHAR): INTEGER; - VAR r : INTEGER; - BEGIN - r := sys(cmd); - RETURN r - END System; - - PROCEDURE -SizeofUnixStat(): INTEGER - "sizeof(Unix_Status)"; - - PROCEDURE -SizeofStat(): INTEGER - "sizeof(struct stat)"; - - PROCEDURE -Error(msg: ARRAY OF CHAR; len: INTEGER) - "write(1/*stdout*/, msg, len); char ch = 0xa; write(1, &ch, 1)"; - - PROCEDURE StatCheck; - VAR x, y: LONGINT; - BEGIN - x := SizeofUnixStat(); - y := SizeofStat(); - IF x # y THEN - Error("Unix.StatCheck: inconsistent usage of struct stat", 49); - Exit(1); - END - END StatCheck; - -BEGIN - - StatCheck(); - -END Unix. diff --git a/src/system/linux/gcc/Console.Mod b/src/system/linux/gcc/Console.Mod deleted file mode 100644 index e523ef7b..00000000 --- a/src/system/linux/gcc/Console.Mod +++ /dev/null @@ -1,86 +0,0 @@ -MODULE Console; (* J. Templ, 29-June-96 *) - - (* output to Unix standard output device based Write system call *) - - IMPORT SYSTEM; - - VAR line: ARRAY 128 OF CHAR; - pos: INTEGER; - - PROCEDURE -Write(adr, n: LONGINT) - "write(1/*stdout*/, adr, n)"; - - PROCEDURE -read(VAR ch: CHAR): LONGINT - "read(0/*stdin*/, ch, 1)"; - - PROCEDURE Flush*(); - BEGIN - Write(SYSTEM.ADR(line), pos); pos := 0; - END Flush; - - PROCEDURE Char*(ch: CHAR); - BEGIN - IF pos = LEN(line) THEN Flush() END ; - line[pos] := ch; INC(pos); - IF ch = 0AX THEN Flush() END - END Char; - - PROCEDURE String*(s: ARRAY OF CHAR); - VAR i: INTEGER; - BEGIN i := 0; - WHILE s[i] # 0X DO Char(s[i]); INC(i) END - END String; - - PROCEDURE Int*(i, n: LONGINT); - VAR s: ARRAY 32 OF CHAR; i1, k: LONGINT; - BEGIN - IF i = SYSTEM.LSH(LONG(LONG(1)), SIZE(LONGINT)*8 - 1) THEN - IF SIZE(LONGINT) = 8 THEN s := "8085774586302733229"; k := 19 - ELSE s := "8463847412"; k := 10 - END - ELSE - i1 := ABS(i); - s[0] := CHR(i1 MOD 10 + ORD("0")); i1 := i1 DIV 10; k := 1; - WHILE i1 > 0 DO s[k] := CHR(i1 MOD 10 + ORD("0")); i1 := i1 DIV 10; INC(k) END - END ; - IF i < 0 THEN s[k] := "-"; INC(k) END ; - WHILE n > k DO Char(" "); DEC(n) END ; - WHILE k > 0 DO DEC(k); Char(s[k]) END - END Int; - - PROCEDURE Ln*; - BEGIN Char(0AX); (* Unix end-of-line *) - END Ln; - - PROCEDURE Bool*(b: BOOLEAN); - BEGIN IF b THEN String("TRUE") ELSE String("FALSE") END - END Bool; - - PROCEDURE Hex*(i: LONGINT); - VAR k, n: LONGINT; - BEGIN - k := -28; - WHILE k <= 0 DO - n := ASH(i, k) MOD 16; - IF n <= 9 THEN Char(CHR(ORD("0") + n)) ELSE Char(CHR(ORD("A") - 10 + n)) END ; - INC(k, 4) - END - END Hex; - - PROCEDURE Read*(VAR ch: CHAR); - VAR n: LONGINT; - BEGIN Flush(); - n := read(ch); - IF n # 1 THEN ch := 0X END - END Read; - - PROCEDURE ReadLine*(VAR line: ARRAY OF CHAR); - VAR i: LONGINT; ch: CHAR; - BEGIN Flush(); - i := 0; Read(ch); - WHILE (i < LEN(line) - 1) & (ch # 0AX) & (ch # 0X) DO line[i] := ch; INC(i); Read(ch) END ; - line[i] := 0X - END ReadLine; - -BEGIN pos := 0; -END Console. diff --git a/src/system/linux/gcc/Kernel.Mod b/src/system/linux/gcc/Kernel.Mod deleted file mode 100644 index 4fa025ab..00000000 --- a/src/system/linux/gcc/Kernel.Mod +++ /dev/null @@ -1,188 +0,0 @@ -MODULE Kernel; -(* - J. Templ, 16.4.95 - communication with C-runtime and storage management -*) - - IMPORT SYSTEM, Unix, Args; - - TYPE - RealTime = POINTER TO TimeDesc; - TimeDesc = RECORD - sec, min, hour, mday, mon, year, wday, isdst, zone, gmtoff: LONGINT - END ; - - KeyCmd* = PROCEDURE; - - ObjFinalizer* = PROCEDURE(obj: SYSTEM.PTR); - - - VAR - (* trap handling *) - trapEnv*: Unix.JmpBuf; (* saved stack environment for trap handling *) - - (* oberon heap management *) - nofiles*: LONGINT; - - (* input event handling *) - readSet*, readySet*: Unix.FdSet; - - FKey*: ARRAY 16 OF KeyCmd; - - littleEndian*: BOOLEAN; - - TimeUnit*: LONGINT; (* 1 sec *) - - LIB*, CWD*: ARRAY 256 OF CHAR; - OBERON*: ARRAY 1024 OF CHAR; - - - timeStart: LONGINT; (* milliseconds *) - - PROCEDURE -includesetjmp() - '#include "setjmp.h"'; -(* for localtime *) - PROCEDURE -includetime() - '#include "time.h"'; - - PROCEDURE -Lock*() - "SYSTEM_lock++"; - - PROCEDURE -Unlock*() - "SYSTEM_lock--; if (SYSTEM_interrupted && SYSTEM_lock == 0) __HALT(-9)"; - - PROCEDURE -Exit*(n: LONGINT) - "exit(n)"; - - PROCEDURE -sigsetjmp*(VAR env: Unix.JmpBuf; savemask: LONGINT): LONGINT - "__sigsetjmp(env, savemask)"; - - PROCEDURE -siglongjmp*(VAR env:Unix.JmpBuf; val: LONGINT) - "siglongjmp(env, val)"; - - PROCEDURE -heapsize*(): LONGINT - "SYSTEM_heapsize"; - - PROCEDURE -allocated*(): LONGINT - "SYSTEM_allocated"; - - PROCEDURE -localtime(VAR clock: LONGINT): RealTime - "(Kernel_RealTime)localtime(clock)"; - - PROCEDURE -malloc*(size: LONGINT): LONGINT - "(LONGINT)malloc(size)"; - - PROCEDURE -free*(adr: LONGINT) - "(void)free(adr)"; - - PROCEDURE -getcwd(VAR cwd: Unix.Name) - "getcwd(cwd, cwd__len)"; - - - PROCEDURE GetClock* (VAR t, d: LONGINT); - VAR tv: Unix.Timeval; tz: Unix.Timezone; time: RealTime; - l : LONGINT; - BEGIN - l := Unix.Gettimeofday(tv, tz); - time := localtime(tv.sec); - t := time.sec + ASH(time.min, 6) + ASH(time.hour, 12); - d := time.mday + ASH(time.mon+1, 5) + ASH(time.year MOD 100, 9); - END GetClock; - - PROCEDURE SetClock* (t, d: LONGINT); - VAR err: ARRAY 25 OF CHAR; - BEGIN err := "not yet implemented"; HALT(99) - END SetClock; - - PROCEDURE Time*(): LONGINT; - VAR timeval: Unix.Timeval; timezone: Unix.Timezone; - l : LONGINT; - BEGIN - l := Unix.Gettimeofday(timeval, timezone); - RETURN (timeval.usec DIV 1000 + timeval.sec * 1000 - timeStart) MOD 7FFFFFFFH - END Time; - -(* - PROCEDURE UserTime*(): LONGINT; - VAR rusage: Unix.Rusage; - BEGIN - Unix.Getrusage(0, S.ADR(rusage)); - RETURN rusage.utime.sec*1000 + rusage.utime.usec DIV 1000 - (* + rusage.stime.sec*1000 + rusage.stime.usec DIV 1000*) - END UserTime; -*) - - PROCEDURE Select*(delay: LONGINT); - VAR rs, ws, xs: Unix.FdSet; n: LONGINT; tv: Unix.Timeval; - BEGIN - rs := readSet; - FOR n := 0 TO 7 DO ws[n] := {}; xs[n] := {}; readySet[n] := {} END; - IF delay < 0 THEN delay := 0 END ; - tv.sec := delay DIV 1000; tv.usec := delay MOD 1000 * 1000; - n := Unix.Select(256, rs, ws, xs, tv); - IF n >= 0 THEN readySet := rs END - END Select; - - PROCEDURE -GC*(markStack: BOOLEAN) - "SYSTEM_GC(markStack)"; - - PROCEDURE -RegisterObject*(obj: SYSTEM.PTR; finalize: ObjFinalizer) - "SYSTEM_REGFIN(obj, finalize)"; - - PROCEDURE -SetHalt*(p: PROCEDURE(n: LONGINT)) - "SYSTEM_Halt = p"; - - PROCEDURE InstallTermHandler*(p: PROCEDURE); - (* not yet supported; no Modules.Free *) - END InstallTermHandler; - - PROCEDURE LargestAvailable*(): LONGINT; - BEGIN - (* dummy proc for System 3 compatibility - no meaningful value except may be the remaining swap space can be returned - in the context of an extensible heap *) - RETURN MAX(LONGINT) - END LargestAvailable; - - PROCEDURE Halt(n: LONGINT); - VAR res: LONGINT; - BEGIN res := Unix.Kill(Unix.Getpid(), 4); - END Halt; - - PROCEDURE EndianTest; - VAR i: LONGINT; dmy: INTEGER; - BEGIN - dmy := 1; i := SYSTEM.ADR(dmy); - SYSTEM.GET(i, littleEndian); (* indirection via i avoids warning on SUN cc -O *) - END EndianTest; - - PROCEDURE -SizeofUnixJmpBuf(): INTEGER - "sizeof(Unix_JmpBuf)"; - - PROCEDURE -SizeofSigJmpBuf(): INTEGER - "sizeof(sigjmp_buf)"; - - PROCEDURE -Error(msg: ARRAY OF CHAR; len: INTEGER) - "write(1/*stdout*/, msg, len); char ch = 0xa; write(1, &ch, 1)"; - - PROCEDURE JmpBufCheck; (* check for inconsistent usage of sigjmp_buf *) - VAR x, y: LONGINT; - BEGIN - x := SizeofUnixJmpBuf(); - y := SizeofSigJmpBuf(); - IF x < y THEN - Error("Kernel.JmpBufCheck: inconsistent usage of sigjmp_buf", 52); - Exit(1); - END - END JmpBufCheck; - -BEGIN - EndianTest(); - SetHalt(Halt); - CWD := ""; OBERON := "."; LIB := ""; - getcwd(CWD); - Args.GetEnv("OBERON", OBERON); - Args.GetEnv("OBERON_LIB", LIB); - TimeUnit := 1000; timeStart := 0; timeStart := Time(); - JmpBufCheck() -END Kernel. diff --git a/src/system/linux/gcc/Kernel0.Mod b/src/system/linux/gcc/Kernel0.Mod deleted file mode 100644 index 6a58650f..00000000 --- a/src/system/linux/gcc/Kernel0.Mod +++ /dev/null @@ -1,200 +0,0 @@ -MODULE Kernel0; -(* - J. Templ, 16.4.95 - communication with C-runtime and storage management -*) -(* version for bootstrapping voc *) - - IMPORT SYSTEM, Unix, Args, Strings, version; - - TYPE - RealTime = POINTER TO TimeDesc; - TimeDesc = RECORD - sec, min, hour, mday, mon, year, wday, isdst, zone, gmtoff: LONGINT -(* sec, min, hour, mday, mon, year, wday, isdst, zone, gmtoff: INTEGER*) - END ; - - KeyCmd* = PROCEDURE; - - ObjFinalizer* = PROCEDURE(obj: SYSTEM.PTR); - - - VAR - (* trap handling *) - trapEnv*: Unix.JmpBuf; (* saved stack environment for trap handling *) - - (* oberon heap management *) - nofiles*: LONGINT; - - (* input event handling *) - readSet*, readySet*: Unix.FdSet; - - FKey*: ARRAY 16 OF KeyCmd; - - littleEndian*: BOOLEAN; - - TimeUnit*: LONGINT; (* 1 sec *) - - LIB*, CWD*: ARRAY 256 OF CHAR; - OBERON*: ARRAY 1024 OF CHAR; - MODULES-: ARRAY 1024 OF CHAR; - - prefix*, fullprefix* : ARRAY 256 OF CHAR; - timeStart: LONGINT; (* milliseconds *) - - - PROCEDURE -includesetjmp() - '#include "setjmp.h"'; -(* for localtime *) - PROCEDURE -includetime() - '#include "time.h"'; - - PROCEDURE -Lock*() - "SYSTEM_lock++"; - - PROCEDURE -Unlock*() - "SYSTEM_lock--; if (SYSTEM_interrupted && SYSTEM_lock == 0) __HALT(-9)"; - - PROCEDURE -Exit*(n: LONGINT) - "exit(n)"; - - PROCEDURE -sigsetjmp*(VAR env: Unix.JmpBuf; savemask: LONGINT): LONGINT - "__sigsetjmp(env, savemask)"; - - PROCEDURE -siglongjmp*(VAR env:Unix.JmpBuf; val: LONGINT) - "siglongjmp(env, val)"; - - PROCEDURE -heapsize*(): LONGINT - "SYSTEM_heapsize"; - - PROCEDURE -allocated*(): LONGINT - "SYSTEM_allocated"; - - PROCEDURE -localtime(VAR clock: LONGINT): RealTime - "(Kernel0_RealTime)localtime(clock)"; - - PROCEDURE -malloc*(size: LONGINT): LONGINT - "(LONGINT)malloc(size)"; - - PROCEDURE -free*(adr: LONGINT) - "(void)free(adr)"; - - PROCEDURE -getcwd(VAR cwd: Unix.Name) - "getcwd(cwd, cwd__len)"; - - - PROCEDURE GetClock* (VAR t, d: LONGINT); - VAR tv: Unix.Timeval; tz: Unix.Timezone; time: RealTime; - l : LONGINT; - BEGIN - l := Unix.Gettimeofday(tv, tz); - time := localtime(tv.sec); - t := time.sec + ASH(time.min, 6) + ASH(time.hour, 12); - d := time.mday + ASH(time.mon+1, 5) + ASH(time.year MOD 100, 9); - END GetClock; - - PROCEDURE SetClock* (t, d: LONGINT); - VAR err: ARRAY 25 OF CHAR; - BEGIN err := "not yet implemented"; HALT(99) - END SetClock; - - PROCEDURE Time*(): LONGINT; - VAR timeval: Unix.Timeval; timezone: Unix.Timezone; - l : LONGINT; - BEGIN - l := Unix.Gettimeofday(timeval, timezone); - RETURN (timeval.usec DIV 1000 + timeval.sec * 1000 - timeStart) MOD 7FFFFFFFH - END Time; - -(* - PROCEDURE UserTime*(): LONGINT; - VAR rusage: Unix.Rusage; - BEGIN - Unix.Getrusage(0, S.ADR(rusage)); - RETURN rusage.utime.sec*1000 + rusage.utime.usec DIV 1000 - (* + rusage.stime.sec*1000 + rusage.stime.usec DIV 1000*) - END UserTime; -*) - - PROCEDURE Select*(delay: LONGINT); - VAR rs, ws, xs: Unix.FdSet; n: LONGINT; tv: Unix.Timeval; - BEGIN - rs := readSet; - FOR n := 0 TO 7 DO ws[n] := {}; xs[n] := {}; readySet[n] := {} END; - IF delay < 0 THEN delay := 0 END ; - tv.sec := delay DIV 1000; tv.usec := delay MOD 1000 * 1000; - n := Unix.Select(256, rs, ws, xs, tv); - IF n >= 0 THEN readySet := rs END - END Select; - - PROCEDURE -GC*(markStack: BOOLEAN) - "SYSTEM_GC(markStack)"; - - PROCEDURE -RegisterObject*(obj: SYSTEM.PTR; finalize: ObjFinalizer) - "SYSTEM_REGFIN(obj, finalize)"; - - PROCEDURE -SetHalt*(p: PROCEDURE(n: LONGINT)) - "SYSTEM_Halt = p"; - - PROCEDURE InstallTermHandler*(p: PROCEDURE); - (* not yet supported; no Modules.Free *) - END InstallTermHandler; - - PROCEDURE LargestAvailable*(): LONGINT; - BEGIN - (* dummy proc for System 3 compatibility - no meaningful value except may be the remaining swap space can be returned - in the context of an extensible heap *) - RETURN MAX(LONGINT) - END LargestAvailable; - - PROCEDURE Halt(n: LONGINT); - VAR res: LONGINT; - BEGIN res := Unix.Kill(Unix.Getpid(), 4); - END Halt; - - PROCEDURE EndianTest; - VAR i: LONGINT; dmy: INTEGER; - BEGIN - dmy := 1; i := SYSTEM.ADR(dmy); - SYSTEM.GET(i, littleEndian); (* indirection via i avoids warning on SUN cc -O *) - END EndianTest; - - PROCEDURE -SizeofUnixJmpBuf(): INTEGER - "sizeof(Unix_JmpBuf)"; - - PROCEDURE -SizeofSigJmpBuf(): INTEGER - "sizeof(sigjmp_buf)"; - - PROCEDURE -Error(msg: ARRAY OF CHAR; len: INTEGER) - "write(1/*stdout*/, msg, len); char ch = 0xa; write(1, &ch, 1)"; - - PROCEDURE JmpBufCheck; (* check for inconsistent usage of sigjmp_buf *) - VAR x, y: LONGINT; - BEGIN - x := SizeofUnixJmpBuf(); - y := SizeofSigJmpBuf(); - IF x < y THEN - Error("Kernel.JmpBufCheck: inconsistent usage of sigjmp_buf", 52); - Exit(1); - END - END JmpBufCheck; - -BEGIN - EndianTest(); - SetHalt(Halt); - CWD := ""; OBERON := "."; LIB := ""; - MODULES := ""; (* additional modules path which can be specified on commandline and will be added to the OBERON variable; noch *) - getcwd(CWD); - Args.GetEnv ("MODULES", MODULES); - Args.GetEnv("OBERON", OBERON); - (* always have current directory in module search path, noch *) - Strings.Append(":.:", OBERON); - Strings.Append(MODULES, OBERON); - Strings.Append(":", OBERON); - Strings.Append(version.prefix, OBERON); - Strings.Append("/lib/voc/sym:", OBERON); - Args.GetEnv("OBERON_LIB", LIB); - TimeUnit := 1000; timeStart := 0; timeStart := Time(); - JmpBufCheck() -END Kernel0. diff --git a/src/system/linux/gcc/SYSTEM.Mod b/src/system/linux/gcc/SYSTEM.Mod deleted file mode 100644 index 6fc08dcf..00000000 --- a/src/system/linux/gcc/SYSTEM.Mod +++ /dev/null @@ -1,520 +0,0 @@ -(* -* voc (jet backend) runtime system, Version 1.1 -* -* Copyright (c) Software Templ, 1994, 1995, 1996 -* -* Module SYSTEM is subject to change any time without prior notification. -* Software Templ disclaims all warranties with regard to module SYSTEM, -* in particular shall Software Templ not be liable for any damage resulting -* from inappropriate use or modification of module SYSTEM. -*) - -MODULE SYSTEM; (* J. Templ, 31.5.95 *) - - IMPORT SYSTEM; (*must not import other modules*) - - CONST - ModNameLen = 20; - CmdNameLen = 24; - SZL = SIZE(LONGINT); - Unit = 4*SZL; (* smallest possible heap block *) - nofLists = 9; (* number of free_lists *) - heapSize0 = 8000*Unit; (* startup heap size *) - - (* all blocks look the same: - free blocks describe themselves: size = Unit - tag = &tag++ - ->blksize - sentinel = -SZL - next - *) - - (* heap chunks *) - nextChnkOff = 0; (* next heap chunk, sorted ascendingly! *) - endOff = SZL; (* end of heap chunk *) - blkOff = 3*SZL; (* first block in a chunk *) - - (* heap blocks *) - tagOff = 0; (* block starts with tag *) - sizeOff = SZL; (* block size in free block relative to block start *) - sntlOff = 2*SZL; (* pointer offset table sentinel in free block relative to block start *) - nextOff = 3*SZL; (* next pointer in free block relative to block start *) - NoPtrSntl = LONG(LONG(-SZL)); - - - TYPE - ModuleName = ARRAY ModNameLen OF CHAR; - CmdName = ARRAY CmdNameLen OF CHAR; - - Module = POINTER TO ModuleDesc; - Cmd = POINTER TO CmdDesc; - EnumProc = PROCEDURE(P: PROCEDURE(p: SYSTEM.PTR)); - ModuleDesc = RECORD - next: Module; - name: ModuleName; - refcnt: LONGINT; - cmds: Cmd; - types: LONGINT; - enumPtrs: EnumProc; - reserved1, reserved2: LONGINT - END ; - - Command = PROCEDURE; - - CmdDesc = RECORD - next: Cmd; - name: CmdName; - cmd: Command - END ; - - Finalizer = PROCEDURE(obj: SYSTEM.PTR); - - FinNode = POINTER TO FinDesc; - FinDesc = RECORD - next: FinNode; - obj: LONGINT; (* weak pointer *) - marked: BOOLEAN; - finalize: Finalizer; - END ; - - VAR - (* the list of loaded (=initialization started) modules *) - modules*: SYSTEM.PTR; - - freeList: ARRAY nofLists + 1 OF LONGINT; (* dummy, 16, 32, 48, 64, 80, 96, 112, 128, sentinel *) - bigBlocks, allocated*: LONGINT; - firstTry: BOOLEAN; - - (* extensible heap *) - heap, (* the sorted list of heap chunks *) - heapend, (* max possible pointer value (used for stack collection) *) - heapsize*: LONGINT; (* the sum of all heap chunk sizes *) - - (* finalization candidates *) - fin: FinNode; - - (* garbage collector locking *) - gclock*: SHORTINT; - - - PROCEDURE -malloc(size: LONGINT): LONGINT "(LONGINT)malloc(size)"; - PROCEDURE -Lock() "Lock"; - PROCEDURE -Unlock() "Unlock"; - PROCEDURE -Mainfrm(): LONGINT "SYSTEM_mainfrm"; -(* - PROCEDURE TAS*(VAR flag:BOOLEAN): BOOLEAN; (* added for compatibility with ulmSYSTEM module; noch *) - VAR oldflag : BOOLEAN; - BEGIN - oldflag := flag; - flag := TRUE; - RETURN oldflag; - END TAS; -*) - PROCEDURE REGMOD*(VAR name: ModuleName; enumPtrs: EnumProc): SYSTEM.PTR; - VAR m: Module; - BEGIN - IF name = "SYSTEM" THEN (* cannot use NEW *) - SYSTEM.NEW(m, SIZE(ModuleDesc)); m.cmds := NIL - ELSE NEW(m) - END ; - COPY(name, m.name); m.refcnt := 0; m.enumPtrs := enumPtrs; m.next := SYSTEM.VAL(Module, modules); - modules := m; - RETURN m - END REGMOD; - - PROCEDURE REGCMD*(m: Module; VAR name: CmdName; cmd: Command); - VAR c: Cmd; - BEGIN NEW(c); - COPY(name, c.name); c.cmd := cmd; c.next := m.cmds; m.cmds := c - END REGCMD; - - PROCEDURE REGTYP*(m: Module; typ: LONGINT); - BEGIN SYSTEM.PUT(typ, m.types); m.types := typ - END REGTYP; - - PROCEDURE INCREF*(m: Module); - BEGIN INC(m.refcnt) - END INCREF; - - PROCEDURE NewChunk(blksz: LONGINT): LONGINT; - VAR chnk: LONGINT; - BEGIN - chnk := malloc(blksz + blkOff); - IF chnk # 0 THEN - SYSTEM.PUT(chnk + endOff, chnk + (blkOff + blksz)); - SYSTEM.PUT(chnk + blkOff, chnk + (blkOff + sizeOff)); - SYSTEM.PUT(chnk + (blkOff + sizeOff), blksz); - SYSTEM.PUT(chnk + (blkOff + sntlOff), NoPtrSntl); - SYSTEM.PUT(chnk + (blkOff + nextOff), bigBlocks); - bigBlocks := chnk + blkOff; - INC(heapsize, blksz) - END ; - RETURN chnk - END NewChunk; - - PROCEDURE ExtendHeap(blksz: LONGINT); - VAR size, chnk, j, next: LONGINT; - BEGIN - IF blksz > 10000*Unit THEN size := blksz - ELSE size := 10000*Unit (* additional heuristics *) - END ; - chnk := NewChunk(size); - IF chnk # 0 THEN - (*sorted insertion*) - IF chnk < heap THEN - SYSTEM.PUT(chnk, heap); heap := chnk - ELSE - j := heap; SYSTEM.GET(j, next); - WHILE (next # 0) & (chnk > next) DO j := next; SYSTEM.GET(j, next) END ; - SYSTEM.PUT(chnk, next); SYSTEM.PUT(j, chnk) - END ; - IF next = 0 THEN SYSTEM.GET(chnk + endOff, heapend) END - END - END ExtendHeap; - - PROCEDURE ^GC*(markStack: BOOLEAN); - - PROCEDURE NEWREC*(tag: LONGINT): SYSTEM.PTR; - VAR i, i0, di, blksz, restsize, t, adr, end, next, prev: LONGINT; new: SYSTEM.PTR; - BEGIN - Lock(); - SYSTEM.GET(tag, blksz); - ASSERT(blksz MOD Unit = 0); - i0 := blksz DIV Unit; i := i0; - IF i < nofLists THEN adr := freeList[i]; - WHILE adr = 0 DO INC(i); adr := freeList[i] END - END ; - IF i < nofLists THEN (* unlink *) - SYSTEM.GET(adr + nextOff, next); - freeList[i] := next; - IF i # i0 THEN (* split *) - di := i - i0; restsize := di * Unit; end := adr + restsize; - SYSTEM.PUT(end + sizeOff, blksz); - SYSTEM.PUT(end + sntlOff, NoPtrSntl); - SYSTEM.PUT(end, end + sizeOff); - SYSTEM.PUT(adr + sizeOff, restsize); - SYSTEM.PUT(adr + nextOff, freeList[di]); - freeList[di] := adr; - INC(adr, restsize) - END - ELSE - adr := bigBlocks; prev := 0; - LOOP - IF adr = 0 THEN - IF firstTry THEN - GC(TRUE); INC(blksz, Unit); - IF (heapsize - allocated - blksz) * 4 < heapsize THEN - (* heap is still almost full; expand to avoid thrashing *) - ExtendHeap((allocated + blksz) DIV (3*Unit) * (4*Unit) - heapsize) - END ; - firstTry := FALSE; new := NEWREC(tag); firstTry := TRUE; - IF new = NIL THEN - (* depending on the fragmentation, the heap may not have been extended by - the anti-thrashing heuristics above *) - ExtendHeap((allocated + blksz) DIV (3*Unit) * (4*Unit) - heapsize); - new := NEWREC(tag); (* will find a free block if heap has been expanded properly *) - END ; - Unlock(); RETURN new - ELSE - Unlock(); RETURN NIL - END - END ; - SYSTEM.GET(adr+sizeOff, t); - IF t >= blksz THEN EXIT END ; - prev := adr; SYSTEM.GET(adr + nextOff, adr) - END ; - restsize := t - blksz; end := adr + restsize; - SYSTEM.PUT(end + sizeOff, blksz); - SYSTEM.PUT(end + sntlOff, NoPtrSntl); - SYSTEM.PUT(end, end + sizeOff); - IF restsize > nofLists * Unit THEN (*resize*) - SYSTEM.PUT(adr + sizeOff, restsize) - ELSE (*unlink*) - SYSTEM.GET(adr + nextOff, next); - IF prev = 0 THEN bigBlocks := next - ELSE SYSTEM.PUT(prev + nextOff, next); - END ; - IF restsize > 0 THEN (*move*) - di := restsize DIV Unit; - SYSTEM.PUT(adr + sizeOff, restsize); - SYSTEM.PUT(adr + nextOff, freeList[di]); - freeList[di] := adr - END - END ; - INC(adr, restsize) - END ; - i := adr + 4*SZL; end := adr + blksz; - WHILE i < end DO (*deliberately unrolled*) - SYSTEM.PUT(i, LONG(LONG(0))); - SYSTEM.PUT(i + SZL, LONG(LONG(0))); - SYSTEM.PUT(i + 2*SZL, LONG(LONG(0))); - SYSTEM.PUT(i + 3*SZL, LONG(LONG(0))); - INC(i, 4*SZL) - END ; - SYSTEM.PUT(adr + nextOff, LONG(LONG(0))); - SYSTEM.PUT(adr, tag); - SYSTEM.PUT(adr + sizeOff, LONG(LONG(0))); - SYSTEM.PUT(adr + sntlOff, LONG(LONG(0))); - INC(allocated, blksz); - Unlock(); - RETURN SYSTEM.VAL(SYSTEM.PTR, adr + SZL) - END NEWREC; - - PROCEDURE NEWBLK*(size: LONGINT): SYSTEM.PTR; - VAR blksz, tag: LONGINT; new: SYSTEM.PTR; - BEGIN - Lock(); - blksz := (size + (4*SZL + Unit - 1)) DIV Unit * Unit; (*size + tag + meta + blksz + sntnl + UnitAlignment*) - new := NEWREC(SYSTEM.ADR(blksz)); - tag := SYSTEM.VAL(LONGINT, new) + blksz - 3*SZL; - SYSTEM.PUT(tag - SZL, LONG(LONG(0))); (*reserved for meta info*) - SYSTEM.PUT(tag, blksz); - SYSTEM.PUT(tag + SZL, NoPtrSntl); - SYSTEM.PUT(SYSTEM.VAL(LONGINT, new) - SZL, tag); - Unlock(); - RETURN new - END NEWBLK; - - PROCEDURE Mark(q: LONGINT); - VAR p, tag, fld, n, offset, tagbits: LONGINT; - BEGIN - IF q # 0 THEN SYSTEM.GET(q - SZL, tagbits); - IF ~ODD(tagbits) THEN - SYSTEM.PUT(q - SZL, tagbits + 1); - p := 0; tag := tagbits + SZL; - LOOP - SYSTEM.GET(tag, offset); - IF offset < 0 THEN - SYSTEM.PUT(q - SZL, tag + offset + 1); - IF p = 0 THEN EXIT END ; - n := q; q := p; - SYSTEM.GET(q - SZL, tag); DEC(tag, 1); - SYSTEM.GET(tag, offset); fld := q + offset; - SYSTEM.GET(fld, p); SYSTEM.PUT(fld, n) - ELSE - fld := q + offset; - SYSTEM.GET(fld, n); - IF n # 0 THEN - SYSTEM.GET(n - SZL, tagbits); - IF ~ODD(tagbits) THEN - SYSTEM.PUT(n - SZL, tagbits + 1); - SYSTEM.PUT(q - SZL, tag + 1); - SYSTEM.PUT(fld, p); p := q; q := n; - tag := tagbits - END - END - END ; - INC(tag, SZL) - END - END - END - END Mark; - - PROCEDURE MarkP(p: SYSTEM.PTR); (* for compatibility with EnumPtrs in ANSI mode *) - BEGIN - Mark(SYSTEM.VAL(LONGINT, p)) - END MarkP; - - PROCEDURE Scan; - VAR chnk, adr, end, start, tag, i, size, freesize: LONGINT; - BEGIN bigBlocks := 0; i := 1; - WHILE i < nofLists DO freeList[i] := 0; INC(i) END ; - freesize := 0; allocated := 0; chnk := heap; - WHILE chnk # 0 DO - adr := chnk + blkOff; SYSTEM.GET(chnk + endOff, end); - WHILE adr < end DO - SYSTEM.GET(adr, tag); - IF ODD(tag) THEN (*marked*) - IF freesize > 0 THEN - start := adr - freesize; - SYSTEM.PUT(start, start+SZL); - SYSTEM.PUT(start+sizeOff, freesize); - SYSTEM.PUT(start+sntlOff, NoPtrSntl); - i := freesize DIV Unit; freesize := 0; - IF i < nofLists THEN SYSTEM.PUT(start + nextOff, freeList[i]); freeList[i] := start - ELSE SYSTEM.PUT(start + nextOff, bigBlocks); bigBlocks := start - END - END ; - DEC(tag, 1); - SYSTEM.PUT(adr, tag); - SYSTEM.GET(tag, size); - INC(allocated, size); - INC(adr, size) - ELSE (*unmarked*) - SYSTEM.GET(tag, size); - INC(freesize, size); - INC(adr, size) - END - END ; - IF freesize > 0 THEN (*collect last block*) - start := adr - freesize; - SYSTEM.PUT(start, start+SZL); - SYSTEM.PUT(start+sizeOff, freesize); - SYSTEM.PUT(start+sntlOff, NoPtrSntl); - i := freesize DIV Unit; freesize := 0; - IF i < nofLists THEN SYSTEM.PUT(start + nextOff, freeList[i]); freeList[i] := start - ELSE SYSTEM.PUT(start + nextOff, bigBlocks); bigBlocks := start - END - END ; - SYSTEM.GET(chnk, chnk) - END - END Scan; - - PROCEDURE Sift (l, r: LONGINT; VAR a: ARRAY OF LONGINT); - VAR i, j, x: LONGINT; - BEGIN j := l; x := a[j]; - LOOP i := j; j := 2*j + 1; - IF (j < r) & (a[j] < a[j+1]) THEN INC(j) END; - IF (j > r) OR (a[j] <= x) THEN EXIT END; - a[i] := a[j] - END; - a[i] := x - END Sift; - - PROCEDURE HeapSort (n: LONGINT; VAR a: ARRAY OF LONGINT); - VAR l, r, x: LONGINT; - BEGIN l := n DIV 2; r := n - 1; - WHILE l > 0 DO DEC(l); Sift(l, r, a) END; - WHILE r > 0 DO x := a[0]; a[0] := a[r]; a[r] := x; DEC(r); Sift(l, r, a) END - END HeapSort; - - PROCEDURE MarkCandidates(n: LONGINT; VAR cand: ARRAY OF LONGINT); - VAR chnk, adr, tag, next, lim, lim1, i, ptr, size: LONGINT; - BEGIN - chnk := heap; i := 0; lim := cand[n-1]; - WHILE (chnk # 0 ) & (chnk < lim) DO - adr := chnk + blkOff; - SYSTEM.GET(chnk + endOff, lim1); - IF lim < lim1 THEN lim1 := lim END ; - WHILE adr < lim1 DO - SYSTEM.GET(adr, tag); - IF ODD(tag) THEN (*already marked*) - SYSTEM.GET(tag-1, size); INC(adr, size) - ELSE - SYSTEM.GET(tag, size); - ptr := adr + SZL; - WHILE cand[i] < ptr DO INC(i) END ; - IF i = n THEN RETURN END ; - next := adr + size; - IF cand[i] < next THEN Mark(ptr) END ; - adr := next - END - END ; - SYSTEM.GET(chnk, chnk) - END - END MarkCandidates; - - PROCEDURE CheckFin; - VAR n: FinNode; tag: LONGINT; - BEGIN n := fin; - WHILE n # NIL DO - SYSTEM.GET(n.obj - SZL, tag); - IF ~ODD(tag) THEN n.marked := FALSE; Mark(n.obj) - ELSE n.marked := TRUE - END ; - n := n.next - END - END CheckFin; - - PROCEDURE Finalize; - VAR n, prev: FinNode; - BEGIN n := fin; prev := NIL; - WHILE n # NIL DO - IF ~n.marked THEN - IF n = fin THEN fin := fin.next ELSE prev.next := n.next END ; - n.finalize(SYSTEM.VAL(SYSTEM.PTR, n.obj)); - (* new nodes may have been pushed in n.finalize, therefore: *) - IF prev = NIL THEN n := fin ELSE n := n.next END - ELSE prev := n; n := n.next - END - END - END Finalize; - - PROCEDURE FINALL*; - VAR n: FinNode; - BEGIN - WHILE fin # NIL DO - n := fin; fin := fin.next; - n.finalize(SYSTEM.VAL(SYSTEM.PTR, n.obj)) - END - END FINALL; - - PROCEDURE MarkStack(n: LONGINT; VAR cand: ARRAY OF LONGINT); - VAR - frame: SYSTEM.PTR; - inc, nofcand: LONGINT; - sp, p, stack0, ptr: LONGINT; - align: RECORD ch: CHAR; p: SYSTEM.PTR END ; - BEGIN - IF n > 0 THEN MarkStack(n-1, cand); (* flush register windows by means of recursive calls *) - IF n > 100 THEN RETURN END (* prevent tail recursion optimization *) - END ; - IF n = 0 THEN - nofcand := 0; sp := SYSTEM.ADR(frame); - stack0 := Mainfrm(); - (* check for minimum alignment of pointers *) - inc := SYSTEM.ADR(align.p) - SYSTEM.ADR(align); - IF sp > stack0 THEN inc := -inc END ; - WHILE sp # stack0 DO - SYSTEM.GET(sp, p); - IF (p > heap) & (p < heapend) THEN - IF nofcand = LEN(cand) THEN HeapSort(nofcand, cand); MarkCandidates(nofcand, cand); nofcand := 0 END ; - cand[nofcand] := p; INC(nofcand) - END ; - INC(sp, inc) - END ; - IF nofcand > 0 THEN HeapSort(nofcand, cand); MarkCandidates(nofcand, cand) END - END - END MarkStack; - - PROCEDURE GC*(markStack: BOOLEAN); - VAR - m: Module; - i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23: LONGINT; - cand: ARRAY 10000 OF LONGINT; - BEGIN - IF (gclock = 0) OR (gclock = 1) & ~markStack THEN - Lock(); - m := SYSTEM.VAL(Module, modules); - WHILE m # NIL DO - IF m.enumPtrs # NIL THEN m.enumPtrs(MarkP) END ; - m := m^.next - END ; - IF markStack THEN - (* generate register pressure to force callee saved registers to memory; - may be simplified by inlining OS calls or processor specific instructions - *) - i0 := -100; i1 := -101; i2 := -102; i3 := -103; i4 := -104; i5 := -105; i6 := -106; i7 := -107; - i8 := 1; i9 := 2; i10 := 3; i11 := 4; i12 := 5; i13 := 6; i14 := 7; i15 := 8; - i16 := 9; i17 := 10; i18 := 11; i19 := 12; i20 := 13; i21 := 14; i22 := 15; i23 := 16; - LOOP INC(i0, 1); INC(i1, 2); INC(i2, 3); INC(i3, 4); INC(i4, 5); INC(i5, 6); INC(i6, 7); INC(i7, 8); - INC(i8, 9); INC(i9, 10); INC(i10, 11); INC(i11, 12); INC(i12, 13); INC(i13, 14); INC(i14, 15); INC(i15, 16); - INC(i16, 17); INC(i17, 18); INC(i18, 19); INC(i19, 20); INC(i20, 21); INC(i21, 22); INC(i22, 23); INC(i23, 24); - IF (i0 = -99) & (i15 = 24) THEN MarkStack(32, cand); EXIT END - END ; - IF i0 + i1 + i2 + i3 + i4 + i5 + i6 + i7 + i8 + i9 + i10 + i11 + i12 + i13 + i14 + i15 - + i16 + i17 + i18 + i19 + i20 + i21 + i22 + i23 > 10000 THEN RETURN (* use all variables *) - END ; - END; - CheckFin; - Scan; - Finalize; - Unlock() - END - END GC; - - PROCEDURE REGFIN*(obj: SYSTEM.PTR; finalize: Finalizer); - VAR f: FinNode; - BEGIN NEW(f); - f.obj := SYSTEM.VAL(LONGINT, obj); f.finalize := finalize; f.marked := TRUE; f.next := fin; fin := f - END REGFIN; - - PROCEDURE InitHeap; (* initialized before body to enable NEW, SYSTEM.NEW *) - BEGIN - heap := NewChunk(heapSize0); - SYSTEM.GET(heap + endOff, heapend); - SYSTEM.PUT(heap, LONG(LONG(0))); - allocated := 0; firstTry := TRUE; freeList[nofLists] := 1; gclock := 0 - END InitHeap; - -END SYSTEM. diff --git a/src/system/linux/gcc/armv6j_hardfp/Args.Mod b/src/system/linux/gcc/armv6j_hardfp/Args.Mod deleted file mode 100644 index c6b7b56e..00000000 --- a/src/system/linux/gcc/armv6j_hardfp/Args.Mod +++ /dev/null @@ -1,65 +0,0 @@ -MODULE Args; (* jt, 8.12.94 *) - - (* command line argument handling for voc (jet backend) *) - - - IMPORT SYSTEM; - - TYPE - ArgPtr = POINTER TO ARRAY 1024 OF CHAR; - ArgVec = POINTER TO ARRAY 1024 OF ArgPtr; - - VAR argc-, argv-: LONGINT; - (*PROCEDURE -includestdlib() "#include ";*) - PROCEDURE -externgetenv() "extern char *getenv(const char *name);"; (* took this from stdlib.h*) - PROCEDURE -Argc(): INTEGER "SYSTEM_argc"; - PROCEDURE -Argv(): LONGINT "(long)SYSTEM_argv"; - PROCEDURE -getenv(var: ARRAY OF CHAR): ArgPtr - "(Args_ArgPtr)getenv(var)"; - - PROCEDURE Get*(n: INTEGER; VAR val: ARRAY OF CHAR); - VAR av: ArgVec; - BEGIN - IF n < argc THEN av := SYSTEM.VAL(ArgVec, argv); COPY(av[n]^, val) END - END Get; - - PROCEDURE GetInt*(n: INTEGER; VAR val: LONGINT); - VAR s: ARRAY 64 OF CHAR; k, d, i: LONGINT; - BEGIN - s := ""; Get(n, s); i := 0; - IF s[0] = "-" THEN i := 1 END ; - k := 0; d := ORD(s[i]) - ORD("0"); - WHILE (d >= 0 ) & (d <= 9) DO k := k*10 + d; INC(i); d := ORD(s[i]) - ORD("0") END ; - IF s[0] = "-" THEN d := -d; DEC(i) END ; - IF i > 0 THEN val := k END - END GetInt; - - PROCEDURE Pos*(s: ARRAY OF CHAR): INTEGER; - VAR i: INTEGER; arg: ARRAY 256 OF CHAR; - BEGIN - i := 0; Get(i, arg); - WHILE (i < argc) & (s # arg) DO INC(i); Get(i, arg) END ; - RETURN i - END Pos; - - PROCEDURE GetEnv*(var: ARRAY OF CHAR; VAR val: ARRAY OF CHAR); - VAR p: ArgPtr; - BEGIN - p := getenv(var); - IF p # NIL THEN COPY(p^, val) END - END GetEnv; - - PROCEDURE getEnv*(var: ARRAY OF CHAR; VAR val: ARRAY OF CHAR): BOOLEAN; - VAR p: ArgPtr; - BEGIN - p := getenv(var); - IF p # NIL THEN - COPY(p^, val); - RETURN TRUE - ELSE - RETURN FALSE - END - END getEnv; - -BEGIN argc := Argc(); argv := Argv() -END Args. diff --git a/src/system/linux/gcc/armv6j_hardfp/Files.Mod b/src/system/linux/gcc/armv6j_hardfp/Files.Mod deleted file mode 100644 index 6307407d..00000000 --- a/src/system/linux/gcc/armv6j_hardfp/Files.Mod +++ /dev/null @@ -1,663 +0,0 @@ -MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files *) -(* modified version of Files, which opens only the file provided and does not scan any path in any environment variable, also ReadLine procedure added; -- noch *) - IMPORT SYSTEM, Unix, Kernel, Args, Console; - - (* standard data type I/O - - little endian, - Sint:1, Int:2, Lint:4 - ORD({0}) = 1, - false = 0, true =1 - IEEE real format, - null terminated strings, - compact numbers according to M.Odersky *) - - - CONST - nofbufs = 4; - bufsize = 4096; - fileTabSize = 64; - noDesc = -1; - notDone = -1; - - (* file states *) - open = 0; create = 1; close = 2; - - - TYPE - FileName = ARRAY 101 OF CHAR; - File* = POINTER TO Handle; - Buffer = POINTER TO BufDesc; - - Handle = RECORD - workName, registerName: FileName; - tempFile: BOOLEAN; - dev, ino, mtime: LONGINT; - fd-, len, pos: LONGINT; - bufs: ARRAY nofbufs OF Buffer; - swapper, state: INTEGER - END ; - - BufDesc = RECORD - f: File; - chg: BOOLEAN; - org, size: LONGINT; - data: ARRAY bufsize OF SYSTEM.BYTE - END ; - - Rider* = RECORD - res*: LONGINT; - eof*: BOOLEAN; - buf: Buffer; - org, offset: LONGINT - END ; - - Time = POINTER TO TimeDesc; - TimeDesc = RECORD - sec*, min*, hour*, mday*, mon*, year*, wday*, isdst*, zone*, gmtoff*: LONGINT; -(* sec*, min*, hour*, mday*, mon*, year*, wday*, isdst*, zone*, gmtoff*: INTEGER;*) - END ; - - VAR - fileTab: ARRAY fileTabSize OF LONGINT (*=File*); - tempno: INTEGER; - -(* for localtime *) - PROCEDURE -includetime() - '#include "time.h"'; - - PROCEDURE -localtime(VAR clock: LONGINT): Time - "(Files_Time) localtime(clock)"; - - PROCEDURE -getcwd(VAR cwd: Unix.Name) - "getcwd(cwd, cwd__len)"; - - PROCEDURE -IdxTrap "__HALT(-1)"; - - PROCEDURE^ Finalize(o: SYSTEM.PTR); - - PROCEDURE Err(s: ARRAY OF CHAR; f: File; errno: LONGINT); - BEGIN - Console.Ln; Console.String("-- "); Console.String(s); Console.String(": "); - IF f # NIL THEN - IF f.registerName # "" THEN Console.String(f.registerName) ELSE Console.String(f.workName) END - END ; - IF errno # 0 THEN Console.String(" errno = "); Console.Int(errno, 1) END ; - Console.Ln; - HALT(99) - END Err; - - PROCEDURE MakeFileName(dir, name: ARRAY OF CHAR; VAR dest: ARRAY OF CHAR); - VAR i, j: INTEGER; - BEGIN i := 0; j := 0; - WHILE dir[i] # 0X DO dest[i] := dir[i]; INC(i) END ; - IF dest[i-1] # "/" THEN dest[i] := "/"; INC(i) END ; - WHILE name[j] # 0X DO dest[i] := name[j]; INC(i); INC(j) END ; - dest[i] := 0X - END MakeFileName; - - PROCEDURE GetTempName(finalName: ARRAY OF CHAR; VAR name: ARRAY OF CHAR); - VAR n, i, j: LONGINT; - BEGIN - INC(tempno); n := tempno; i := 0; - IF finalName[0] # "/" THEN (* relative pathname *) - WHILE Kernel.CWD[i] # 0X DO name[i] := Kernel.CWD[i]; INC(i) END; - IF Kernel.CWD[i-1] # "/" THEN name[i] := "/"; INC(i) END - END; - j := 0; - WHILE finalName[j] # 0X DO name[i] := finalName[j]; INC(i); INC(j) END; - DEC(i); - WHILE name[i] # "/" DO DEC(i) END; - name[i+1] := "."; name[i+2] := "t"; name[i+3] := "m"; name[i+4] := "p"; name[i+5] := "."; INC(i, 6); - WHILE n > 0 DO name[i] := CHR(n MOD 10 + ORD("0")); n := n DIV 10; INC(i) END; - name[i] := "."; INC(i); n := SHORT(Unix.Getpid()); - WHILE n > 0 DO name[i] := CHR(n MOD 10 + ORD("0")); n := n DIV 10; INC(i) END; - name[i] := 0X - END GetTempName; - - PROCEDURE Create(f: File); - VAR stat: Unix.Status; done: BOOLEAN; - errno: LONGINT; err: ARRAY 32 OF CHAR; - BEGIN - IF f.fd = noDesc THEN - IF f.state = create THEN GetTempName(f.registerName, f.workName); f.tempFile := TRUE - ELSIF f.state = close THEN - f.workName := f.registerName; f.registerName := ""; f.tempFile := FALSE - END ; - errno := Unix.Unlink(f.workName); (*unlink first to avoid stale NFS handles and to avoid reuse of inodes*) - f.fd := Unix.Open(f.workName, Unix.rdwr + Unix.creat + Unix.trunc, {2, 4,5, 7,8}); - done := f.fd >= 0; errno := Unix.errno(); - IF (~done & ((errno = Unix.ENFILE) OR (errno = Unix.EMFILE))) OR (done & (f.fd >= fileTabSize)) THEN - IF done & (f.fd >= fileTabSize) THEN errno := Unix.Close(f.fd) END ; - Kernel.GC(TRUE); - f.fd := Unix.Open(f.workName, Unix.rdwr + Unix.creat + Unix.trunc, {2, 4,5, 7,8}); - done := f.fd >= 0 - END ; - IF done THEN - IF f.fd >= fileTabSize THEN errno := Unix.Close(f.fd); Err("too many files open", f, 0) - ELSE fileTab[f.fd] := SYSTEM.VAL(LONGINT, f); INC(Kernel.nofiles); Kernel.RegisterObject(f, Finalize); - f.state := open; f.pos := 0; errno := Unix.Fstat(f.fd, stat); - f.dev := stat.dev; f.ino := stat.ino; f.mtime := stat.mtime - END - ELSE errno := Unix.errno(); - IF errno = Unix.ENOENT THEN err := "no such directory" - ELSIF (errno = Unix.ENFILE) OR (errno = Unix.EMFILE) THEN err := "too many files open" - ELSE err := "file not created" - END ; - Err(err, f, errno) - END - END - END Create; - - PROCEDURE Flush(buf: Buffer); - VAR res: LONGINT; f: File; stat: Unix.Status; - BEGIN - IF buf.chg THEN f := buf.f; Create(f); - IF buf.org # f.pos THEN res := Unix.Lseek(f.fd, buf.org, 0) END ; - res := Unix.Write(f.fd, SYSTEM.ADR(buf.data), buf.size); - IF res < 0 THEN Err("error in writing file", f, Unix.errno()) END ; - f.pos := buf.org + buf.size; - buf.chg := FALSE; - res := Unix.Fstat(f.fd, stat); - f.mtime := stat.mtime - END - END Flush; - - PROCEDURE Close* (f: File); - VAR i, res: LONGINT; - BEGIN - IF (f.state # create) OR (f.registerName # "") THEN - Create(f); i := 0; - WHILE (i < nofbufs) & (f.bufs[i] # NIL) DO Flush(f.bufs[i]); INC(i) END ; - res := Unix.Fsync(f.fd); - IF res < 0 THEN Err("error in writing file", f, Unix.errno()) END - END - END Close; - - PROCEDURE Length* (f: File): LONGINT; - BEGIN RETURN f.len - END Length; - - PROCEDURE New* (name: ARRAY OF CHAR): File; - VAR f: File; - BEGIN - NEW(f); f.workName := ""; COPY(name, f.registerName); - f.fd := noDesc; f.state := create; f.len := 0; f.pos := 0; f.swapper := -1; (*all f.buf[i] = NIL*) - RETURN f - END New; -(* - PROCEDURE ScanPath(VAR pos: INTEGER; VAR dir: ARRAY OF CHAR); (* supports ~, ~user and blanks inside path *) - VAR i: INTEGER; ch: CHAR; home: ARRAY 256 OF CHAR; - BEGIN - i := 0; ch := Kernel.OBERON[pos]; - WHILE (ch = " ") OR (ch = ":") DO INC(pos); ch := Kernel.OBERON[pos] END ; - IF ch = "~" THEN - INC(pos); ch := Kernel.OBERON[pos]; - home := ""; Args.GetEnv("HOME", home); - WHILE home[i] # 0X DO dir[i] := home[i]; INC(i) END ; - IF (ch # "/") & (ch # 0X) & (ch # ":") & (ch # " ") THEN - WHILE (i > 0) & (dir[i-1] # "/") DO DEC(i) END - END - END ; - WHILE (ch # 0X) & (ch # ":") DO dir[i] := ch; INC(i); INC(pos); ch := Kernel.OBERON[pos] END ; - WHILE (i > 0) & (dir[i-1] = " ") DO DEC(i) END ; - dir[i] := 0X - END ScanPath; -*) - PROCEDURE HasDir(VAR name: ARRAY OF CHAR): BOOLEAN; - VAR i: INTEGER; ch: CHAR; - BEGIN i := 0; ch := name[0]; - WHILE (ch # 0X) & (ch # "/") DO INC(i); ch := name[i] END ; - RETURN ch = "/" - END HasDir; - - PROCEDURE CacheEntry(dev, ino: LONGINT; mtime: LONGINT): File; - VAR f: File; i: INTEGER; stat: Unix.Status; res: LONGINT; - BEGIN i := 0; - WHILE i < fileTabSize DO - f := SYSTEM.VAL(File, fileTab[i]); - IF (f # NIL) & (ino = f.ino) & (dev = f.dev) THEN - IF mtime # f.mtime THEN i := 0; - WHILE i < nofbufs DO - IF f.bufs[i] # NIL THEN f.bufs[i].org := -1; f.bufs[i] := NIL END ; - INC(i) - END ; - f.swapper := -1; f.mtime := mtime; - res := Unix.Fstat(f.fd, stat); f.len := stat.size - END ; - RETURN f - END ; - INC(i) - END ; - RETURN NIL - END CacheEntry; - - PROCEDURE Old* (name: ARRAY OF CHAR): File; - VAR f: File; fd, res, errno: LONGINT; pos: INTEGER; done: BOOLEAN; - dir, path: ARRAY 256 OF CHAR; - stat: Unix.Status; - BEGIN - IF name # "" THEN - IF HasDir(name) THEN dir := ""; COPY(name, path) - ELSE - pos := 0; - COPY(name, path); (* -- noch *) - (*ScanPath(pos, dir);*) (*MakeFileName(dir, name, path);*) (*ScanPath(pos, dir)*) - END ; - LOOP - fd := Unix.Open(path, Unix.rdwr, {}); done := fd >= 0; errno := Unix.errno(); - IF (~done & ((errno = Unix.ENFILE) OR (errno = Unix.EMFILE))) OR (done & (fd >= fileTabSize)) THEN - IF done & (fd >= fileTabSize) THEN res := Unix.Close(fd) END ; - Kernel.GC(TRUE); - fd := Unix.Open(path, Unix.rdwr, {}); - done := fd >= 0; errno := Unix.errno(); - IF ~done & ((errno = Unix.ENFILE) OR (errno = Unix.EMFILE)) THEN Err("too many files open", f, errno) END - END ; - IF ~done & ((errno = Unix.EACCES) OR (errno = Unix.EROFS) OR (errno = Unix.EAGAIN)) THEN - (* errno EAGAIN observed on Solaris 2.4 *) - fd := Unix.Open(path, Unix.rdonly, {}); done := fd >= 0; errno := Unix.errno() - END ; -IF (~done) & (errno # Unix.ENOENT) THEN - Console.String("warning Files.Old "); Console.String(name); - Console.String(" errno = "); Console.Int(errno, 0); Console.Ln; -END ; - IF done THEN - res := Unix.Fstat(fd, stat); - f := CacheEntry(stat.dev, stat.ino, stat.mtime); - IF f # NIL THEN res := Unix.Close(fd); RETURN f - ELSIF fd >= fileTabSize THEN res := Unix.Close(fd); Err("too many files open", f, 0) - ELSE NEW(f); fileTab[fd] := SYSTEM.VAL(LONGINT, f); INC(Kernel.nofiles); Kernel.RegisterObject(f, Finalize); - f.fd := fd; f.state := open; f.len := stat.size; f.pos := 0; f.swapper := -1; (*all f.buf[i] = NIL*) - COPY(name, f.workName); f.registerName := ""; f.tempFile := FALSE; - f.dev := stat.dev; f.ino := stat.ino; f.mtime := stat.mtime; - RETURN f - END - ELSIF dir = "" THEN RETURN NIL - ELSE (*MakeFileName(dir, name, path);*) (*ScanPath(pos, dir)*) - RETURN NIL - END - END - ELSE RETURN NIL - END - END Old; - - PROCEDURE Purge* (f: File); - VAR i: INTEGER; stat: Unix.Status; res: LONGINT; - BEGIN i := 0; - WHILE i < nofbufs DO - IF f.bufs[i] # NIL THEN f.bufs[i].org := -1; f.bufs[i] := NIL END ; - INC(i) - END ; - IF f.fd # noDesc THEN res := Unix.Ftruncate(f.fd, 0); res := Unix.Lseek(f.fd, 0, 0) END ; - f.pos := 0; f.len := 0; f.swapper := -1; - res := Unix.Fstat(f.fd, stat); f.mtime := stat.mtime - END Purge; - - PROCEDURE GetDate* (f: File; VAR t, d: LONGINT); - VAR stat: Unix.Status; clock, res: LONGINT; time: Time; - BEGIN - Create(f); res := Unix.Fstat(f.fd, stat); - time := localtime(stat.mtime); - t := time.sec + ASH(time.min, 6) + ASH(time.hour, 12); - d := time.mday + ASH(time.mon+1, 5) + ASH(time.year MOD 100, 9) - END GetDate; - - PROCEDURE Pos* (VAR r: Rider): LONGINT; - BEGIN RETURN r.org + r.offset - END Pos; - - PROCEDURE Set* (VAR r: Rider; f: File; pos: LONGINT); - VAR org, offset, i, n, res: LONGINT; buf: Buffer; - BEGIN - IF f # NIL THEN - IF pos > f.len THEN pos := f.len ELSIF pos < 0 THEN pos := 0 END ; - offset := pos MOD bufsize; org := pos - offset; i := 0; - WHILE (i < nofbufs) & (f.bufs[i] # NIL) & (org # f.bufs[i].org) DO INC(i) END ; - IF i < nofbufs THEN - IF f.bufs[i] = NIL THEN NEW(buf); buf.chg := FALSE; buf.org := -1; buf.f := f; f.bufs[i] := buf - ELSE buf := f.bufs[i] - END - ELSE - f.swapper := (f.swapper + 1) MOD nofbufs; - buf := f.bufs[f.swapper]; - Flush(buf) - END ; - IF buf.org # org THEN - IF org = f.len THEN buf.size := 0 - ELSE Create(f); - IF f.pos # org THEN res := Unix.Lseek(f.fd, org, 0) END ; - n := Unix.ReadBlk(f.fd, buf.data); - IF n < 0 THEN Err("read from file not done", f, Unix.errno()) END ; - f.pos := org + n; - buf.size := n - END ; - buf.org := org; buf.chg := FALSE - END - ELSE buf := NIL; org := 0; offset := 0 - END ; - r.buf := buf; r.org := org; r.offset := offset; r.eof := FALSE; r.res := 0 - END Set; - - PROCEDURE Read* (VAR r: Rider; VAR x: SYSTEM.BYTE); - VAR offset: LONGINT; buf: Buffer; - BEGIN - buf := r.buf; offset := r.offset; - IF r.org # buf.org THEN Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset END ; - IF (offset < buf.size) THEN - x := buf.data[offset]; r.offset := offset + 1 - ELSIF r.org + offset < buf.f.len THEN - Set(r, r.buf.f, r.org + offset); - x := r.buf.data[0]; r.offset := 1 - ELSE - x := 0X; r.eof := TRUE - END - END Read; - - PROCEDURE ReadBytes* (VAR r: Rider; VAR x: ARRAY OF SYSTEM.BYTE; n: LONGINT); - VAR xpos, min, restInBuf, offset: LONGINT; buf: Buffer; - BEGIN - IF n > LEN(x) THEN IdxTrap END ; - xpos := 0; buf := r.buf; offset := r.offset; - WHILE n > 0 DO - IF (r.org # buf.org) OR (offset >= bufsize) THEN - Set(r, buf.f, r.org + offset); - buf := r.buf; offset := r.offset - END ; - restInBuf := buf.size - offset; - IF restInBuf = 0 THEN r.res := n; r.eof := TRUE; RETURN - ELSIF n > restInBuf THEN min := restInBuf ELSE min := n END ; - SYSTEM.MOVE(SYSTEM.ADR(buf.data) + offset, SYSTEM.ADR(x) + xpos, min); - INC(offset, min); r.offset := offset; INC(xpos, min); DEC(n, min) - END ; - r.res := 0; r.eof := FALSE - END ReadBytes; - - PROCEDURE ReadByte* (VAR r : Rider; VAR x : ARRAY OF SYSTEM.BYTE); - BEGIN - ReadBytes(r, x, 1); - END ReadByte; - - PROCEDURE Base* (VAR r: Rider): File; - BEGIN RETURN r.buf.f - END Base; - - PROCEDURE Write* (VAR r: Rider; x: SYSTEM.BYTE); - VAR buf: Buffer; offset: LONGINT; - BEGIN - buf := r.buf; offset := r.offset; - IF (r.org # buf.org) OR (offset >= bufsize) THEN - Set(r, buf.f, r.org + offset); - buf := r.buf; offset := r.offset - END ; - buf.data[offset] := x; - buf.chg := TRUE; - IF offset = buf.size THEN - INC(buf.size); INC(buf.f.len) - END ; - r.offset := offset + 1; r.res := 0 - END Write; - - PROCEDURE WriteByte* (VAR r : Rider; x : SYSTEM.BYTE); (* added for compatibility with PO 2013, -- noch *) - BEGIN - Write(r, x); - END WriteByte; - - PROCEDURE WriteBytes* (VAR r: Rider; VAR x: ARRAY OF SYSTEM.BYTE; n: LONGINT); - VAR xpos, min, restInBuf, offset: LONGINT; buf: Buffer; - BEGIN - IF n > LEN(x) THEN IdxTrap END ; - xpos := 0; buf := r.buf; offset := r.offset; - WHILE n > 0 DO - IF (r.org # buf.org) OR (offset >= bufsize) THEN - Set(r, buf.f, r.org + offset); - buf := r.buf; offset := r.offset - END ; - restInBuf := bufsize - offset; - IF n > restInBuf THEN min := restInBuf ELSE min := n END ; - SYSTEM.MOVE(SYSTEM.ADR(x) + xpos, SYSTEM.ADR(buf.data) + offset, min); - INC(offset, min); r.offset := offset; - IF offset > buf.size THEN INC(buf.f.len, offset - buf.size); buf.size := offset END ; - INC(xpos, min); DEC(n, min); buf.chg := TRUE - END ; - r.res := 0 - END WriteBytes; - -(* another solution would be one that is similar to ReadBytes, WriteBytes. -No code duplication, more symmetric, only two ifs for -Read and Write in buffer, buf.size replaced by bufsize in Write ops, buf.size and len -must be made consistent with offset (if offset > buf.size) in a lazy way. - -PROCEDURE Write* (VAR r: Rider; x: SYSTEM.BYTE); - VAR buf: Buffer; offset: LONGINT; -BEGIN - buf := r.buf; offset := r.offset; - IF (offset >= bufsize) OR (r.org # buf.org) THEN - Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset; - END ; - buf.data[offset] := x; r.offset := offset + 1; buf.chg := TRUE -END Write; - - -PROCEDURE WriteBytes ... - -PROCEDURE Read* (VAR r: Rider; VAR x: SYSTEM.BYTE); - VAR offset: LONGINT; buf: Buffer; -BEGIN - buf := r.buf; offset := r.offset; - IF (offset >= buf.size) OR (r.org # buf.org) THEN - IF r.org + offset >= buf.f.len THEN x := 0X; r.eof := TRUE; RETURN - ELSE Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset - END - END ; - x := buf.data[offset]; r.offset := offset + 1 -END Read; - -but this would also affect Set, Length, and Flush. -Especially Length would become fairly complex. -*) - - PROCEDURE Delete* (name: ARRAY OF CHAR; VAR res: INTEGER); - BEGIN - res := SHORT(Unix.Unlink(name)); - res := SHORT(Unix.errno()) - END Delete; - - PROCEDURE Rename* (old, new: ARRAY OF CHAR; VAR res: INTEGER); - VAR fdold, fdnew, n, errno, r: LONGINT; - ostat, nstat: Unix.Status; - buf: ARRAY 4096 OF CHAR; - BEGIN - r := Unix.Stat(old, ostat); - IF r >= 0 THEN - r := Unix.Stat(new, nstat); - IF (r >= 0) & ((ostat.dev # nstat.dev) OR (ostat.ino # nstat.ino)) THEN - Delete(new, res); (* work around stale nfs handles *) - END ; - r := Unix.Rename(old, new); - IF r < 0 THEN res := SHORT(Unix.errno()); - IF res = Unix.EXDEV THEN (* cross device link, move the file *) - fdold := Unix.Open(old, Unix.rdonly, {}); - IF fdold < 0 THEN res := 2; RETURN END ; - fdnew := Unix.Open(new, Unix.rdwr + Unix.creat + Unix.trunc, {2, 4,5, 7,8}); - IF fdnew < 0 THEN r := Unix.Close(fdold); res := 3; RETURN END ; - n := Unix.Read(fdold, SYSTEM.ADR(buf), bufsize); - WHILE n > 0 DO - r := Unix.Write(fdnew, SYSTEM.ADR(buf), n); - IF r < 0 THEN errno := Unix.errno(); r := Unix.Close(fdold); r := Unix.Close(fdnew); - Err("cannot move file", NIL, errno) - END ; - n := Unix.Read(fdold, SYSTEM.ADR(buf), bufsize) - END ; - errno := Unix.errno(); - r := Unix.Close(fdold); r := Unix.Close(fdnew); - IF n = 0 THEN r := Unix.Unlink(old); res := 0 - ELSE Err("cannot move file", NIL, errno) - END ; - ELSE RETURN (* res is Unix.Rename return code *) - END - END ; - res := 0 - ELSE res := 2 (* old file not found *) - END - END Rename; - - PROCEDURE Register* (f: File); - VAR idx, errno: INTEGER; f1: File; file: ARRAY 104 OF CHAR; - BEGIN - IF (f.state = create) & (f.registerName # "") THEN f.state := close (* shortcut renaming *) END ; - Close(f); - IF f.registerName # "" THEN - Rename(f.workName, f.registerName, errno); - IF errno # 0 THEN COPY(f.registerName, file); HALT(99) END ; - f.workName := f.registerName; f.registerName := ""; f.tempFile := FALSE - END - END Register; - - PROCEDURE ChangeDirectory*(path: ARRAY OF CHAR; VAR res: INTEGER); - BEGIN - res := SHORT(Unix.Chdir(path)); - getcwd(Kernel.CWD) - END ChangeDirectory; - - PROCEDURE FlipBytes(VAR src, dest: ARRAY OF SYSTEM.BYTE); - VAR i, j: LONGINT; - BEGIN - IF ~Kernel.littleEndian THEN i := LEN(src); j := 0; - WHILE i > 0 DO DEC(i); dest[j] := src[i]; INC(j) END - ELSE SYSTEM.MOVE(SYSTEM.ADR(src), SYSTEM.ADR(dest), LEN(src)) - END - END FlipBytes; - - PROCEDURE ReadBool* (VAR R: Rider; VAR x: BOOLEAN); - BEGIN Read(R, SYSTEM.VAL(CHAR, x)) - END ReadBool; - - PROCEDURE ReadInt* (VAR R: Rider; VAR x: INTEGER); - VAR b: ARRAY 2 OF CHAR; - BEGIN ReadBytes(R, b, 2); - x := ORD(b[0]) + ORD(b[1])*256 - END ReadInt; - - PROCEDURE ReadLInt* (VAR R: Rider; VAR x: LONGINT); - VAR b: ARRAY 4 OF CHAR; - BEGIN ReadBytes(R, b, 4); - x := ORD(b[0]) + ORD(b[1])*100H + ORD(b[2])*10000H + ORD(b[3])*1000000H - END ReadLInt; - - PROCEDURE ReadSet* (VAR R: Rider; VAR x: SET); - VAR b: ARRAY 4 OF CHAR; - BEGIN ReadBytes(R, b, 4); - x := SYSTEM.VAL(SET, ORD(b[0]) + ORD(b[1])*100H + ORD(b[2])*10000H + ORD(b[3])*1000000H) - END ReadSet; - - PROCEDURE ReadReal* (VAR R: Rider; VAR x: REAL); - VAR b: ARRAY 4 OF CHAR; - BEGIN ReadBytes(R, b, 4); FlipBytes(b, x) - END ReadReal; - - PROCEDURE ReadLReal* (VAR R: Rider; VAR x: LONGREAL); - VAR b: ARRAY 8 OF CHAR; - BEGIN ReadBytes(R, b, 8); FlipBytes(b, x) - END ReadLReal; - - PROCEDURE ReadString* (VAR R: Rider; VAR x: ARRAY OF CHAR); - VAR i: INTEGER; ch: CHAR; - BEGIN i := 0; - REPEAT Read(R, ch); x[i] := ch; INC(i) UNTIL ch = 0X - END ReadString; - - (* need to read line; -- noch *) - PROCEDURE ReadLine* (VAR R: Rider; VAR x: ARRAY OF CHAR); - VAR i: INTEGER; ch: CHAR; b : BOOLEAN; - BEGIN i := 0; - b := FALSE; - REPEAT - Read(R, ch); - IF ((ch = 0X) OR (ch = 0AX) OR (ch = 0DX)) THEN - b := TRUE - ELSE - x[i] := ch; - INC(i); - END; - UNTIL b - END ReadLine; - - PROCEDURE ReadNum* (VAR R: Rider; VAR x: LONGINT); - VAR s: SHORTINT; ch: CHAR; n: LONGINT; - BEGIN s := 0; n := 0; Read(R, ch); - WHILE ORD(ch) >= 128 DO INC(n, ASH(ORD(ch) - 128, s) ); INC(s, 7); Read(R, ch) END; - INC(n, ASH(ORD(ch) MOD 64 - ORD(ch) DIV 64 * 64, s) ); - x := n - END ReadNum; - - PROCEDURE WriteBool* (VAR R: Rider; x: BOOLEAN); - BEGIN Write(R, SYSTEM.VAL(CHAR, x)) - END WriteBool; - - PROCEDURE WriteInt* (VAR R: Rider; x: INTEGER); - VAR b: ARRAY 2 OF CHAR; - BEGIN b[0] := CHR(x); b[1] := CHR(x DIV 256); - WriteBytes(R, b, 2); - END WriteInt; - - PROCEDURE WriteLInt* (VAR R: Rider; x: LONGINT); - VAR b: ARRAY 4 OF CHAR; - BEGIN - b[0] := CHR(x); b[1] := CHR(x DIV 100H); b[2] := CHR(x DIV 10000H); b[3] := CHR(x DIV 1000000H); - WriteBytes(R, b, 4); - END WriteLInt; - - PROCEDURE WriteSet* (VAR R: Rider; x: SET); - VAR b: ARRAY 4 OF CHAR; i: LONGINT; - BEGIN i := SYSTEM.VAL(LONGINT, x); - 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; - - PROCEDURE WriteReal* (VAR R: Rider; x: REAL); - VAR b: ARRAY 4 OF CHAR; - BEGIN FlipBytes(x, b); WriteBytes(R, b, 4) - END WriteReal; - - PROCEDURE WriteLReal* (VAR R: Rider; x: LONGREAL); - VAR b: ARRAY 8 OF CHAR; - BEGIN FlipBytes(x, b); WriteBytes(R, b, 8) - END WriteLReal; - - PROCEDURE WriteString* (VAR R: Rider; x: ARRAY [1] OF CHAR); - VAR i: INTEGER; - BEGIN i := 0; - WHILE x[i] # 0X DO INC(i) END ; - WriteBytes(R, x, i+1) - END WriteString; - - PROCEDURE WriteNum* (VAR R: Rider; x: LONGINT); - BEGIN - WHILE (x < - 64) OR (x > 63) DO Write(R, CHR(x MOD 128 + 128)); x := x DIV 128 END; - Write(R, CHR(x MOD 128)) - END WriteNum; - - PROCEDURE GetName*(f: File; VAR name: ARRAY OF CHAR); - BEGIN - COPY (f.workName, name); - END GetName; - - PROCEDURE Finalize(o: SYSTEM.PTR); - VAR f: File; res: LONGINT; - BEGIN - f := SYSTEM.VAL(File, o); - IF f.fd >= 0 THEN - fileTab[f.fd] := 0; res := Unix.Close(f.fd); f.fd := -1; DEC(Kernel.nofiles); - IF f.tempFile THEN res := Unix.Unlink(f.workName) END - END - END Finalize; - - PROCEDURE Init; - VAR i: LONGINT; - BEGIN - i := 0; WHILE i < fileTabSize DO fileTab[i] := 0; INC(i) END ; - tempno := -1; Kernel.nofiles := 0 - END Init; - -BEGIN Init -END Files. diff --git a/src/system/linux/gcc/armv6j_hardfp/Files0.Mod b/src/system/linux/gcc/armv6j_hardfp/Files0.Mod deleted file mode 100644 index 4f021ede..00000000 --- a/src/system/linux/gcc/armv6j_hardfp/Files0.Mod +++ /dev/null @@ -1,635 +0,0 @@ -MODULE Files0; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files *) - -(* this module is not for use by developers and inteded to bootstrap voc *) -(* for general use import Files module *) - - IMPORT SYSTEM, Unix, Kernel := Kernel0, Args, Console; - - (* standard data type I/O - - little endian, - Sint:1, Int:2, Lint:4 - ORD({0}) = 1, - false = 0, true =1 - IEEE real format, - null terminated strings, - compact numbers according to M.Odersky *) - - - CONST - nofbufs = 4; - bufsize = 4096; - fileTabSize = 64; - noDesc = -1; - notDone = -1; - - (* file states *) - open = 0; create = 1; close = 2; - - - TYPE - FileName = ARRAY 101 OF CHAR; - File* = POINTER TO Handle; - Buffer = POINTER TO BufDesc; - - Handle = RECORD - workName, registerName: FileName; - tempFile: BOOLEAN; - dev, ino, mtime: LONGINT; - fd-, len, pos: LONGINT; - bufs: ARRAY nofbufs OF Buffer; - swapper, state: INTEGER - END ; - - BufDesc = RECORD - f: File; - chg: BOOLEAN; - org, size: LONGINT; - data: ARRAY bufsize OF SYSTEM.BYTE - END ; - - Rider* = RECORD - res*: LONGINT; - eof*: BOOLEAN; - buf: Buffer; - org, offset: LONGINT - END ; - - Time = POINTER TO TimeDesc; - TimeDesc = RECORD - sec*, min*, hour*, mday*, mon*, year*, wday*, isdst*, zone*, gmtoff*: LONGINT; -(* sec*, min*, hour*, mday*, mon*, year*, wday*, isdst*, zone*, gmtoff*: INTEGER;*) - END ; - - VAR - fileTab: ARRAY fileTabSize OF LONGINT (*=File*); - tempno: INTEGER; - -(* for localtime *) - PROCEDURE -includetime() - '#include "time.h"'; - - PROCEDURE -localtime(VAR clock: LONGINT): Time - "(Files0_Time) localtime(clock)"; - - PROCEDURE -getcwd(VAR cwd: Unix.Name) - "getcwd(cwd, cwd__len)"; - - PROCEDURE -IdxTrap "__HALT(-1)"; - - PROCEDURE^ Finalize(o: SYSTEM.PTR); - - PROCEDURE Err(s: ARRAY OF CHAR; f: File; errno: LONGINT); - BEGIN - Console.Ln; Console.String("-- "); Console.String(s); Console.String(": "); - IF f # NIL THEN - IF f.registerName # "" THEN Console.String(f.registerName) ELSE Console.String(f.workName) END - END ; - IF errno # 0 THEN Console.String(" errno = "); Console.Int(errno, 1) END ; - Console.Ln; - HALT(99) - END Err; - - PROCEDURE MakeFileName(dir, name: ARRAY OF CHAR; VAR dest: ARRAY OF CHAR); - VAR i, j: INTEGER; - BEGIN i := 0; j := 0; - WHILE dir[i] # 0X DO dest[i] := dir[i]; INC(i) END ; - IF dest[i-1] # "/" THEN dest[i] := "/"; INC(i) END ; - WHILE name[j] # 0X DO dest[i] := name[j]; INC(i); INC(j) END ; - dest[i] := 0X - END MakeFileName; - - PROCEDURE GetTempName(finalName: ARRAY OF CHAR; VAR name: ARRAY OF CHAR); - VAR n, i, j: LONGINT; - BEGIN - INC(tempno); n := tempno; i := 0; - IF finalName[0] # "/" THEN (* relative pathname *) - WHILE Kernel.CWD[i] # 0X DO name[i] := Kernel.CWD[i]; INC(i) END; - IF Kernel.CWD[i-1] # "/" THEN name[i] := "/"; INC(i) END - END; - j := 0; - WHILE finalName[j] # 0X DO name[i] := finalName[j]; INC(i); INC(j) END; - DEC(i); - WHILE name[i] # "/" DO DEC(i) END; - name[i+1] := "."; name[i+2] := "t"; name[i+3] := "m"; name[i+4] := "p"; name[i+5] := "."; INC(i, 6); - WHILE n > 0 DO name[i] := CHR(n MOD 10 + ORD("0")); n := n DIV 10; INC(i) END; - name[i] := "."; INC(i); n := SHORT(Unix.Getpid()); - WHILE n > 0 DO name[i] := CHR(n MOD 10 + ORD("0")); n := n DIV 10; INC(i) END; - name[i] := 0X - END GetTempName; - - PROCEDURE Create(f: File); - VAR stat: Unix.Status; done: BOOLEAN; - errno: LONGINT; err: ARRAY 32 OF CHAR; - BEGIN - IF f.fd = noDesc THEN - IF f.state = create THEN GetTempName(f.registerName, f.workName); f.tempFile := TRUE - ELSIF f.state = close THEN - f.workName := f.registerName; f.registerName := ""; f.tempFile := FALSE - END ; - errno := Unix.Unlink(f.workName); (*unlink first to avoid stale NFS handles and to avoid reuse of inodes*) - f.fd := Unix.Open(f.workName, Unix.rdwr + Unix.creat + Unix.trunc, {2, 4,5, 7,8}); - done := f.fd >= 0; errno := Unix.errno(); - IF (~done & ((errno = Unix.ENFILE) OR (errno = Unix.EMFILE))) OR (done & (f.fd >= fileTabSize)) THEN - IF done & (f.fd >= fileTabSize) THEN errno := Unix.Close(f.fd) END ; - Kernel.GC(TRUE); - f.fd := Unix.Open(f.workName, Unix.rdwr + Unix.creat + Unix.trunc, {2, 4,5, 7,8}); - done := f.fd >= 0 - END ; - IF done THEN - IF f.fd >= fileTabSize THEN errno := Unix.Close(f.fd); Err("too many files open", f, 0) - ELSE fileTab[f.fd] := SYSTEM.VAL(LONGINT, f); INC(Kernel.nofiles); Kernel.RegisterObject(f, Finalize); - f.state := open; f.pos := 0; errno := Unix.Fstat(f.fd, stat); - f.dev := stat.dev; f.ino := stat.ino; f.mtime := stat.mtime - END - ELSE errno := Unix.errno(); - IF errno = Unix.ENOENT THEN err := "no such directory" - ELSIF (errno = Unix.ENFILE) OR (errno = Unix.EMFILE) THEN err := "too many files open" - ELSE err := "file not created" - END ; - Err(err, f, errno) - END - END - END Create; - - PROCEDURE Flush(buf: Buffer); - VAR res: LONGINT; f: File; stat: Unix.Status; - BEGIN - IF buf.chg THEN f := buf.f; Create(f); - IF buf.org # f.pos THEN res := Unix.Lseek(f.fd, buf.org, 0) END ; - res := Unix.Write(f.fd, SYSTEM.ADR(buf.data), buf.size); - IF res < 0 THEN Err("error in writing file", f, Unix.errno()) END ; - f.pos := buf.org + buf.size; - buf.chg := FALSE; - res := Unix.Fstat(f.fd, stat); - f.mtime := stat.mtime - END - END Flush; - - PROCEDURE Close* (f: File); - VAR i, res: LONGINT; - BEGIN - IF (f.state # create) OR (f.registerName # "") THEN - Create(f); i := 0; - WHILE (i < nofbufs) & (f.bufs[i] # NIL) DO Flush(f.bufs[i]); INC(i) END ; - res := Unix.Fsync(f.fd); - IF res < 0 THEN Err("error in writing file", f, Unix.errno()) END - END - END Close; - - PROCEDURE Length* (f: File): LONGINT; - BEGIN RETURN f.len - END Length; - - PROCEDURE New* (name: ARRAY OF CHAR): File; - VAR f: File; - BEGIN - NEW(f); f.workName := ""; COPY(name, f.registerName); - f.fd := noDesc; f.state := create; f.len := 0; f.pos := 0; f.swapper := -1; (*all f.buf[i] = NIL*) - RETURN f - END New; - - PROCEDURE ScanPath(VAR pos: INTEGER; VAR dir: ARRAY OF CHAR); (* supports ~, ~user and blanks inside path *) - VAR i: INTEGER; ch: CHAR; home: ARRAY 256 OF CHAR; - BEGIN - i := 0; ch := Kernel.OBERON[pos]; - WHILE (ch = " ") OR (ch = ":") DO INC(pos); ch := Kernel.OBERON[pos] END ; - IF ch = "~" THEN - INC(pos); ch := Kernel.OBERON[pos]; - home := ""; Args.GetEnv("HOME", home); - WHILE home[i] # 0X DO dir[i] := home[i]; INC(i) END ; - IF (ch # "/") & (ch # 0X) & (ch # ":") & (ch # " ") THEN - WHILE (i > 0) & (dir[i-1] # "/") DO DEC(i) END - END - END ; - WHILE (ch # 0X) & (ch # ":") DO dir[i] := ch; INC(i); INC(pos); ch := Kernel.OBERON[pos] END ; - WHILE (i > 0) & (dir[i-1] = " ") DO DEC(i) END ; - dir[i] := 0X - END ScanPath; - - PROCEDURE HasDir(VAR name: ARRAY OF CHAR): BOOLEAN; - VAR i: INTEGER; ch: CHAR; - BEGIN i := 0; ch := name[0]; - WHILE (ch # 0X) & (ch # "/") DO INC(i); ch := name[i] END ; - RETURN ch = "/" - END HasDir; - - PROCEDURE CacheEntry(dev, ino: LONGINT; mtime: LONGINT): File; - VAR f: File; i: INTEGER; stat: Unix.Status; res: LONGINT; - BEGIN i := 0; - WHILE i < fileTabSize DO - f := SYSTEM.VAL(File, fileTab[i]); - IF (f # NIL) & (ino = f.ino) & (dev = f.dev) THEN - IF mtime # f.mtime THEN i := 0; - WHILE i < nofbufs DO - IF f.bufs[i] # NIL THEN f.bufs[i].org := -1; f.bufs[i] := NIL END ; - INC(i) - END ; - f.swapper := -1; f.mtime := mtime; - res := Unix.Fstat(f.fd, stat); f.len := stat.size - END ; - RETURN f - END ; - INC(i) - END ; - RETURN NIL - END CacheEntry; - - PROCEDURE Old* (name: ARRAY OF CHAR): File; - VAR f: File; fd, res, errno: LONGINT; pos: INTEGER; done: BOOLEAN; - dir, path: ARRAY 256 OF CHAR; - stat: Unix.Status; - BEGIN - IF name # "" THEN - IF HasDir(name) THEN dir := ""; COPY(name, path) - ELSE pos := 0; ScanPath(pos, dir); MakeFileName(dir, name, path); ScanPath(pos, dir) - END ; - LOOP - fd := Unix.Open(path, Unix.rdwr, {}); done := fd >= 0; errno := Unix.errno(); - IF (~done & ((errno = Unix.ENFILE) OR (errno = Unix.EMFILE))) OR (done & (fd >= fileTabSize)) THEN - IF done & (fd >= fileTabSize) THEN res := Unix.Close(fd) END ; - Kernel.GC(TRUE); - fd := Unix.Open(path, Unix.rdwr, {}); - done := fd >= 0; errno := Unix.errno(); - IF ~done & ((errno = Unix.ENFILE) OR (errno = Unix.EMFILE)) THEN Err("too many files open", f, errno) END - END ; - IF ~done & ((errno = Unix.EACCES) OR (errno = Unix.EROFS) OR (errno = Unix.EAGAIN)) THEN - (* errno EAGAIN observed on Solaris 2.4 *) - fd := Unix.Open(path, Unix.rdonly, {}); done := fd >= 0; errno := Unix.errno() - END ; -IF (~done) & (errno # Unix.ENOENT) THEN - Console.String("warning Files0.Old "); Console.String(name); - Console.String(" errno = "); Console.Int(errno, 0); Console.Ln; -END ; - IF done THEN - res := Unix.Fstat(fd, stat); - f := CacheEntry(stat.dev, stat.ino, stat.mtime); - IF f # NIL THEN res := Unix.Close(fd); RETURN f - ELSIF fd >= fileTabSize THEN res := Unix.Close(fd); Err("too many files open", f, 0) - ELSE NEW(f); fileTab[fd] := SYSTEM.VAL(LONGINT, f); INC(Kernel.nofiles); Kernel.RegisterObject(f, Finalize); - f.fd := fd; f.state := open; f.len := stat.size; f.pos := 0; f.swapper := -1; (*all f.buf[i] = NIL*) - COPY(name, f.workName); f.registerName := ""; f.tempFile := FALSE; - f.dev := stat.dev; f.ino := stat.ino; f.mtime := stat.mtime; - RETURN f - END - ELSIF dir = "" THEN RETURN NIL - ELSE MakeFileName(dir, name, path); ScanPath(pos, dir) - END - END - ELSE RETURN NIL - END - END Old; - - PROCEDURE Purge* (f: File); - VAR i: INTEGER; stat: Unix.Status; res: LONGINT; - BEGIN i := 0; - WHILE i < nofbufs DO - IF f.bufs[i] # NIL THEN f.bufs[i].org := -1; f.bufs[i] := NIL END ; - INC(i) - END ; - IF f.fd # noDesc THEN res := Unix.Ftruncate(f.fd, 0); res := Unix.Lseek(f.fd, 0, 0) END ; - f.pos := 0; f.len := 0; f.swapper := -1; - res := Unix.Fstat(f.fd, stat); f.mtime := stat.mtime - END Purge; - - PROCEDURE GetDate* (f: File; VAR t, d: LONGINT); - VAR stat: Unix.Status; clock, res: LONGINT; time: Time; - BEGIN - Create(f); res := Unix.Fstat(f.fd, stat); - time := localtime(stat.mtime); - t := time.sec + ASH(time.min, 6) + ASH(time.hour, 12); - d := time.mday + ASH(time.mon+1, 5) + ASH(time.year MOD 100, 9) - END GetDate; - - PROCEDURE Pos* (VAR r: Rider): LONGINT; - BEGIN RETURN r.org + r.offset - END Pos; - - PROCEDURE Set* (VAR r: Rider; f: File; pos: LONGINT); - VAR org, offset, i, n, res: LONGINT; buf: Buffer; - BEGIN - IF f # NIL THEN - IF pos > f.len THEN pos := f.len ELSIF pos < 0 THEN pos := 0 END ; - offset := pos MOD bufsize; org := pos - offset; i := 0; - WHILE (i < nofbufs) & (f.bufs[i] # NIL) & (org # f.bufs[i].org) DO INC(i) END ; - IF i < nofbufs THEN - IF f.bufs[i] = NIL THEN NEW(buf); buf.chg := FALSE; buf.org := -1; buf.f := f; f.bufs[i] := buf - ELSE buf := f.bufs[i] - END - ELSE - f.swapper := (f.swapper + 1) MOD nofbufs; - buf := f.bufs[f.swapper]; - Flush(buf) - END ; - IF buf.org # org THEN - IF org = f.len THEN buf.size := 0 - ELSE Create(f); - IF f.pos # org THEN res := Unix.Lseek(f.fd, org, 0) END ; - n := Unix.ReadBlk(f.fd, buf.data); - IF n < 0 THEN Err("read from file not done", f, Unix.errno()) END ; - f.pos := org + n; - buf.size := n - END ; - buf.org := org; buf.chg := FALSE - END - ELSE buf := NIL; org := 0; offset := 0 - END ; - r.buf := buf; r.org := org; r.offset := offset; r.eof := FALSE; r.res := 0 - END Set; - - PROCEDURE Read* (VAR r: Rider; VAR x: SYSTEM.BYTE); - VAR offset: LONGINT; buf: Buffer; - BEGIN - buf := r.buf; offset := r.offset; - IF r.org # buf.org THEN Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset END ; - IF (offset < buf.size) THEN - x := buf.data[offset]; r.offset := offset + 1 - ELSIF r.org + offset < buf.f.len THEN - Set(r, r.buf.f, r.org + offset); - x := r.buf.data[0]; r.offset := 1 - ELSE - x := 0X; r.eof := TRUE - END - END Read; - - PROCEDURE ReadBytes* (VAR r: Rider; VAR x: ARRAY OF SYSTEM.BYTE; n: LONGINT); - VAR xpos, min, restInBuf, offset: LONGINT; buf: Buffer; - BEGIN - IF n > LEN(x) THEN IdxTrap END ; - xpos := 0; buf := r.buf; offset := r.offset; - WHILE n > 0 DO - IF (r.org # buf.org) OR (offset >= bufsize) THEN - Set(r, buf.f, r.org + offset); - buf := r.buf; offset := r.offset - END ; - restInBuf := buf.size - offset; - IF restInBuf = 0 THEN r.res := n; r.eof := TRUE; RETURN - ELSIF n > restInBuf THEN min := restInBuf ELSE min := n END ; - SYSTEM.MOVE(SYSTEM.ADR(buf.data) + offset, SYSTEM.ADR(x) + xpos, min); - INC(offset, min); r.offset := offset; INC(xpos, min); DEC(n, min) - END ; - r.res := 0; r.eof := FALSE - END ReadBytes; - - PROCEDURE ReadByte* (VAR r : Rider; VAR x : ARRAY OF SYSTEM.BYTE); - BEGIN - ReadBytes(r, x, 1); - END ReadByte; - - PROCEDURE Base* (VAR r: Rider): File; - BEGIN RETURN r.buf.f - END Base; - - PROCEDURE Write* (VAR r: Rider; x: SYSTEM.BYTE); - VAR buf: Buffer; offset: LONGINT; - BEGIN - buf := r.buf; offset := r.offset; - IF (r.org # buf.org) OR (offset >= bufsize) THEN - Set(r, buf.f, r.org + offset); - buf := r.buf; offset := r.offset - END ; - buf.data[offset] := x; - buf.chg := TRUE; - IF offset = buf.size THEN - INC(buf.size); INC(buf.f.len) - END ; - r.offset := offset + 1; r.res := 0 - END Write; - - PROCEDURE WriteBytes* (VAR r: Rider; VAR x: ARRAY OF SYSTEM.BYTE; n: LONGINT); - VAR xpos, min, restInBuf, offset: LONGINT; buf: Buffer; - BEGIN - IF n > LEN(x) THEN IdxTrap END ; - xpos := 0; buf := r.buf; offset := r.offset; - WHILE n > 0 DO - IF (r.org # buf.org) OR (offset >= bufsize) THEN - Set(r, buf.f, r.org + offset); - buf := r.buf; offset := r.offset - END ; - restInBuf := bufsize - offset; - IF n > restInBuf THEN min := restInBuf ELSE min := n END ; - SYSTEM.MOVE(SYSTEM.ADR(x) + xpos, SYSTEM.ADR(buf.data) + offset, min); - INC(offset, min); r.offset := offset; - IF offset > buf.size THEN INC(buf.f.len, offset - buf.size); buf.size := offset END ; - INC(xpos, min); DEC(n, min); buf.chg := TRUE - END ; - r.res := 0 - END WriteBytes; - -(* another solution would be one that is similar to ReadBytes, WriteBytes. -No code duplication, more symmetric, only two ifs for -Read and Write in buffer, buf.size replaced by bufsize in Write ops, buf.size and len -must be made consistent with offset (if offset > buf.size) in a lazy way. - -PROCEDURE Write* (VAR r: Rider; x: SYSTEM.BYTE); - VAR buf: Buffer; offset: LONGINT; -BEGIN - buf := r.buf; offset := r.offset; - IF (offset >= bufsize) OR (r.org # buf.org) THEN - Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset; - END ; - buf.data[offset] := x; r.offset := offset + 1; buf.chg := TRUE -END Write; - -PROCEDURE WriteBytes ... - -PROCEDURE Read* (VAR r: Rider; VAR x: SYSTEM.BYTE); - VAR offset: LONGINT; buf: Buffer; -BEGIN - buf := r.buf; offset := r.offset; - IF (offset >= buf.size) OR (r.org # buf.org) THEN - IF r.org + offset >= buf.f.len THEN x := 0X; r.eof := TRUE; RETURN - ELSE Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset - END - END ; - x := buf.data[offset]; r.offset := offset + 1 -END Read; - -but this would also affect Set, Length, and Flush. -Especially Length would become fairly complex. -*) - - PROCEDURE Delete* (name: ARRAY OF CHAR; VAR res: INTEGER); - BEGIN - res := SHORT(Unix.Unlink(name)); - res := SHORT(Unix.errno()) - END Delete; - - PROCEDURE Rename* (old, new: ARRAY OF CHAR; VAR res: INTEGER); - VAR fdold, fdnew, n, errno, r: LONGINT; - ostat, nstat: Unix.Status; - buf: ARRAY 4096 OF CHAR; - BEGIN - r := Unix.Stat(old, ostat); - IF r >= 0 THEN - r := Unix.Stat(new, nstat); - IF (r >= 0) & ((ostat.dev # nstat.dev) OR (ostat.ino # nstat.ino)) THEN - Delete(new, res); (* work around stale nfs handles *) - END ; - r := Unix.Rename(old, new); - IF r < 0 THEN res := SHORT(Unix.errno()); - IF res = Unix.EXDEV THEN (* cross device link, move the file *) - fdold := Unix.Open(old, Unix.rdonly, {}); - IF fdold < 0 THEN res := 2; RETURN END ; - fdnew := Unix.Open(new, Unix.rdwr + Unix.creat + Unix.trunc, {2, 4,5, 7,8}); - IF fdnew < 0 THEN r := Unix.Close(fdold); res := 3; RETURN END ; - n := Unix.Read(fdold, SYSTEM.ADR(buf), bufsize); - WHILE n > 0 DO - r := Unix.Write(fdnew, SYSTEM.ADR(buf), n); - IF r < 0 THEN errno := Unix.errno(); r := Unix.Close(fdold); r := Unix.Close(fdnew); - Err("cannot move file", NIL, errno) - END ; - n := Unix.Read(fdold, SYSTEM.ADR(buf), bufsize) - END ; - errno := Unix.errno(); - r := Unix.Close(fdold); r := Unix.Close(fdnew); - IF n = 0 THEN r := Unix.Unlink(old); res := 0 - ELSE Err("cannot move file", NIL, errno) - END ; - ELSE RETURN (* res is Unix.Rename return code *) - END - END ; - res := 0 - ELSE res := 2 (* old file not found *) - END - END Rename; - - PROCEDURE Register* (f: File); - VAR idx, errno: INTEGER; f1: File; file: ARRAY 104 OF CHAR; - BEGIN - IF (f.state = create) & (f.registerName # "") THEN f.state := close (* shortcut renaming *) END ; - Close(f); - IF f.registerName # "" THEN - Rename(f.workName, f.registerName, errno); - IF errno # 0 THEN COPY(f.registerName, file); HALT(99) END ; - f.workName := f.registerName; f.registerName := ""; f.tempFile := FALSE - END - END Register; - - PROCEDURE ChangeDirectory*(path: ARRAY OF CHAR; VAR res: INTEGER); - BEGIN - res := SHORT(Unix.Chdir(path)); - getcwd(Kernel.CWD) - END ChangeDirectory; - - PROCEDURE FlipBytes(VAR src, dest: ARRAY OF SYSTEM.BYTE); - VAR i, j: LONGINT; - BEGIN - IF ~Kernel.littleEndian THEN i := LEN(src); j := 0; - WHILE i > 0 DO DEC(i); dest[j] := src[i]; INC(j) END - ELSE SYSTEM.MOVE(SYSTEM.ADR(src), SYSTEM.ADR(dest), LEN(src)) - END - END FlipBytes; - - PROCEDURE ReadBool* (VAR R: Rider; VAR x: BOOLEAN); - BEGIN Read(R, SYSTEM.VAL(CHAR, x)) - END ReadBool; - - PROCEDURE ReadInt* (VAR R: Rider; VAR x: INTEGER); - VAR b: ARRAY 2 OF CHAR; - BEGIN ReadBytes(R, b, 2); - x := ORD(b[0]) + ORD(b[1])*256 - END ReadInt; - - PROCEDURE ReadLInt* (VAR R: Rider; VAR x: LONGINT); - VAR b: ARRAY 4 OF CHAR; - BEGIN ReadBytes(R, b, 4); - x := ORD(b[0]) + ORD(b[1])*100H + ORD(b[2])*10000H + ORD(b[3])*1000000H - END ReadLInt; - - PROCEDURE ReadSet* (VAR R: Rider; VAR x: SET); - VAR b: ARRAY 4 OF CHAR; - BEGIN ReadBytes(R, b, 4); - x := SYSTEM.VAL(SET, ORD(b[0]) + ORD(b[1])*100H + ORD(b[2])*10000H + ORD(b[3])*1000000H) - END ReadSet; - - PROCEDURE ReadReal* (VAR R: Rider; VAR x: REAL); - VAR b: ARRAY 4 OF CHAR; - BEGIN ReadBytes(R, b, 4); FlipBytes(b, x) - END ReadReal; - - PROCEDURE ReadLReal* (VAR R: Rider; VAR x: LONGREAL); - VAR b: ARRAY 8 OF CHAR; - BEGIN ReadBytes(R, b, 8); FlipBytes(b, x) - END ReadLReal; - - PROCEDURE ReadString* (VAR R: Rider; VAR x: ARRAY OF CHAR); - VAR i: INTEGER; ch: CHAR; - BEGIN i := 0; - REPEAT Read(R, ch); x[i] := ch; INC(i) UNTIL ch = 0X - END ReadString; - - PROCEDURE ReadNum* (VAR R: Rider; VAR x: LONGINT); - VAR s: SHORTINT; ch: CHAR; n: LONGINT; - BEGIN s := 0; n := 0; Read(R, ch); - WHILE ORD(ch) >= 128 DO INC(n, ASH(ORD(ch) - 128, s) ); INC(s, 7); Read(R, ch) END; - INC(n, ASH(ORD(ch) MOD 64 - ORD(ch) DIV 64 * 64, s) ); - x := n - END ReadNum; - - PROCEDURE WriteBool* (VAR R: Rider; x: BOOLEAN); - BEGIN Write(R, SYSTEM.VAL(CHAR, x)) - END WriteBool; - - PROCEDURE WriteInt* (VAR R: Rider; x: INTEGER); - VAR b: ARRAY 2 OF CHAR; - BEGIN b[0] := CHR(x); b[1] := CHR(x DIV 256); - WriteBytes(R, b, 2); - END WriteInt; - - PROCEDURE WriteLInt* (VAR R: Rider; x: LONGINT); - VAR b: ARRAY 4 OF CHAR; - BEGIN - b[0] := CHR(x); b[1] := CHR(x DIV 100H); b[2] := CHR(x DIV 10000H); b[3] := CHR(x DIV 1000000H); - WriteBytes(R, b, 4); - END WriteLInt; - - PROCEDURE WriteSet* (VAR R: Rider; x: SET); - VAR b: ARRAY 4 OF CHAR; i: LONGINT; - BEGIN i := SYSTEM.VAL(LONGINT, x); - 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; - - PROCEDURE WriteReal* (VAR R: Rider; x: REAL); - VAR b: ARRAY 4 OF CHAR; - BEGIN FlipBytes(x, b); WriteBytes(R, b, 4) - END WriteReal; - - PROCEDURE WriteLReal* (VAR R: Rider; x: LONGREAL); - VAR b: ARRAY 8 OF CHAR; - BEGIN FlipBytes(x, b); WriteBytes(R, b, 8) - END WriteLReal; - - PROCEDURE WriteString* (VAR R: Rider; x: ARRAY [1] OF CHAR); - VAR i: INTEGER; - BEGIN i := 0; - WHILE x[i] # 0X DO INC(i) END ; - WriteBytes(R, x, i+1) - END WriteString; - - PROCEDURE WriteNum* (VAR R: Rider; x: LONGINT); - BEGIN - WHILE (x < - 64) OR (x > 63) DO Write(R, CHR(x MOD 128 + 128)); x := x DIV 128 END; - Write(R, CHR(x MOD 128)) - END WriteNum; - - PROCEDURE Finalize(o: SYSTEM.PTR); - VAR f: File; res: LONGINT; - BEGIN - f := SYSTEM.VAL(File, o); - IF f.fd >= 0 THEN - fileTab[f.fd] := 0; res := Unix.Close(f.fd); f.fd := -1; DEC(Kernel.nofiles); - IF f.tempFile THEN res := Unix.Unlink(f.workName) END - END - END Finalize; - - PROCEDURE Init; - VAR i: LONGINT; - BEGIN - i := 0; WHILE i < fileTabSize DO fileTab[i] := 0; INC(i) END ; - tempno := -1; Kernel.nofiles := 0 - END Init; - -BEGIN Init -END Files0. diff --git a/src/system/linux/gcc/armv6j_hardfp/SYSTEM.c0 b/src/system/linux/gcc/armv6j_hardfp/SYSTEM.c0 deleted file mode 100644 index 580449aa..00000000 --- a/src/system/linux/gcc/armv6j_hardfp/SYSTEM.c0 +++ /dev/null @@ -1,205 +0,0 @@ -/* -* The body prefix file of the Ofront runtime system, Version 1.0 -* -* Copyright (c) Software Templ, 1994, 1995 -* -* Module SYSTEM is subject to change any time without prior notification. -* Software Templ disclaims all warranties with regard to module SYSTEM, -* in particular shall Software Templ not be liable for any damage resulting -* from inappropriate use or modification of module SYSTEM. -* -* Version 1.1 jt, 24.11.95 fixes for correct pointer arithmetic on Cray computers -* jt 31.1.2007 ANSI prototypes for malloc and exit in order to avoid cc warnings -* -*/ - -#include "SYSTEM.h" -#ifdef __STDC__ -#include "stdarg.h" -#else -#include "varargs.h" -#endif - -extern void *malloc(long size); -extern void exit(int status); - -void (*SYSTEM_Halt)(); -LONGINT SYSTEM_halt; /* x in HALT(x) */ -LONGINT SYSTEM_assert; /* x in ASSERT(cond, x) */ -LONGINT SYSTEM_argc; -LONGINT SYSTEM_argv; -LONGINT SYSTEM_lock; -BOOLEAN SYSTEM_interrupted; -static LONGINT SYSTEM_mainfrm; /* adr of main proc stack frame, used for stack collection */ - -#define Lock SYSTEM_lock++ -#define Unlock SYSTEM_lock--; if (SYSTEM_interrupted && (SYSTEM_lock == 0)) __HALT(-9) - - -static void SYSTEM_InitHeap(); -void *SYSTEM__init(); - -void SYSTEM_INIT(argc, argvadr) - int argc; long argvadr; -{ - SYSTEM_mainfrm = argvadr; - SYSTEM_argc = argc; - SYSTEM_argv = *(long*)argvadr; - SYSTEM_InitHeap(); - SYSTEM_halt = -128; - SYSTEM__init(); -} - -void SYSTEM_FINI() -{ - SYSTEM_FINALL(); -} - -long SYSTEM_XCHK(i, ub) long i, ub; {return __X(i, ub);} -long SYSTEM_RCHK(i, ub) long i, ub; {return __R(i, ub);} -long SYSTEM_ASH(i, n) long i, n; {return __ASH(i, n);} -long SYSTEM_ABS(i) long i; {return __ABS(i);} -double SYSTEM_ABSD(i) double i; {return __ABS(i);} - -void SYSTEM_INHERIT(t, t0) - long *t, *t0; -{ - t -= __TPROC0OFF; - t0 -= __TPROC0OFF; - while (*t0 != __EOM) {*t = *t0; t--; t0--;} -} - -void SYSTEM_ENUMP(adr, n, P) - long *adr; - long n; - void (*P)(); -{ - while (n > 0) {P(*adr); adr++; n--;} -} - -void SYSTEM_ENUMR(adr, typ, size, n, P) - char *adr; - long *typ, size, n; - void (*P)(); -{ - long *t, off; - typ++; - while (n > 0) { - t = typ; - off = *t; - while (off >= 0) {P(*(long*)(adr+off)); t++; off = *t;} - adr += size; n--; - } -} - -long SYSTEM_DIV(x, y) - unsigned long x, y; -{ if ((long) x >= 0) return (x / y); - else return -((y - 1 - x) / y); -} - -long SYSTEM_MOD(x, y) - unsigned long x, y; -{ unsigned long m; - if ((long) x >= 0) return (x % y); - else { m = (-x) % y; - if (m != 0) return (y - m); else return 0; - } -} - -long SYSTEM_ENTIER(x) - double x; -{ - long y; - if (x >= 0) - return (long)x; - else { - y = (long)x; - if (y <= x) return y; else return y - 1; - } -} - -void SYSTEM_HALT(n) - int n; -{ - SYSTEM_halt = n; - if (SYSTEM_Halt!=0) SYSTEM_Halt(n); - exit(n); -} - -#ifdef __STDC__ -SYSTEM_PTR SYSTEM_NEWARR(long *typ, long elemsz, int elemalgn, int nofdim, int nofdyn, ...) -#else -SYSTEM_PTR SYSTEM_NEWARR(typ, elemsz, elemalgn, nofdim, nofdyn, va_alist) - long *typ, elemsz; - int elemalgn, nofdim, nofdyn; - va_dcl -#endif -{ - long nofelems, size, dataoff, n, nptr, *x, *p, nofptrs, i, *ptab, off; - va_list ap; -#ifdef __STDC__ - va_start(ap, nofdyn); -#else - va_start(ap); -#endif - nofelems = 1; - while (nofdim > 0) { - nofelems = nofelems * va_arg(ap, long); nofdim--; - if (nofelems <= 0) __HALT(-20); - } - va_end(ap); - dataoff = nofdyn * sizeof(long); - if (elemalgn > sizeof(long)) { - n = dataoff % elemalgn; - if (n != 0) dataoff += elemalgn - n; - } - size = dataoff + nofelems * elemsz; - Lock; - if (typ == NIL) { - /* element typ does not contain pointers */ - x = SYSTEM_NEWBLK(size); - } - else if (typ == POINTER__typ) { - /* element type is a pointer */ - x = SYSTEM_NEWBLK(size + nofelems * sizeof(long)); - p = (long*)x[-1]; - p[-nofelems] = *p; /* build new type desc in situ: 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ - p -= nofelems - 1; n = 1; /* n =1 for skipping the size field */ - while (n <= nofelems) {*p = n*sizeof(long); p++; n++;} - *p = - (nofelems + 1) * sizeof(long); /* sentinel */ - x[-1] -= nofelems * sizeof(long); - } - else { - /* element type is a record that contains pointers */ - ptab = typ + 1; nofptrs = 0; - while (ptab[nofptrs] >= 0) {nofptrs++;} /* number of pointers per element */ - nptr = nofelems * nofptrs; /* total number of pointers */ - x = SYSTEM_NEWBLK(size + nptr * sizeof(long)); - p = (long*)x[- 1]; - p[-nptr] = *p; /* build new type desc in situ; 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ - p -= nptr - 1; n = 0; off = dataoff; - while (n < nofelems) {i = 0; - while (i < nofptrs) {*p = off + ptab[i]; p++; i++;} - off += elemsz; n++; - } - *p = - (nptr + 1) * sizeof(long); /* sentinel */ - x[-1] -= nptr * sizeof(long); - } - if (nofdyn != 0) { - /* setup len vector for index checks */ -#ifdef __STDC__ - va_start(ap, nofdyn); -#else - va_start(ap); -#endif - p = x; - while (nofdyn > 0) {*p = va_arg(ap, long); p++, nofdyn--;} - va_end(ap); - } - Unlock; - return x; -} - -/* ----------- end of SYSTEM.co ------------- */ - diff --git a/src/system/linux/gcc/armv6j_hardfp/SYSTEM.h b/src/system/linux/gcc/armv6j_hardfp/SYSTEM.h deleted file mode 100644 index ea9ae5d6..00000000 --- a/src/system/linux/gcc/armv6j_hardfp/SYSTEM.h +++ /dev/null @@ -1,220 +0,0 @@ -#ifndef SYSTEM__h -#define SYSTEM__h - -/* - -the Ofront runtime system interface and macros library -copyright (c) Josef Templ, 1995, 1996 - -gcc for Linux version (same as SPARC/Solaris2) -uses double # as concatenation operator - -*/ - -#include -#include /* for type sizes -- noch */ - -//extern void *memcpy(void *dest, const void *src, long n); -extern void *memcpy(void *dest, const void *src, size_t n); -extern void *malloc(long size); -extern void exit(int status); - -#define export -#define import extern - -/* constants */ -#define __MAXEXT 16 -#define NIL 0L -#define POINTER__typ (long*)1L /* not NIL and not a valid type */ - -/* basic types */ -typedef char BOOLEAN; -typedef unsigned char CHAR; -typedef signed char SHORTINT; -typedef short int INTEGER; -typedef long LONGINT; -typedef float REAL; -typedef double LONGREAL; -typedef unsigned long SET; -typedef void *SYSTEM_PTR; -typedef unsigned char SYSTEM_BYTE; -typedef int8_t SYSTEM_INT8; -typedef int16_t SYSTEM_INT16; -typedef int32_t SYSTEM_INT32; -typedef int64_t SYSTEM_INT64; - -/* runtime system routines */ -extern long SYSTEM_DIV(); -extern long SYSTEM_MOD(); -extern long SYSTEM_ENTIER(); -extern long SYSTEM_ASH(); -extern long SYSTEM_ABS(); -extern long SYSTEM_XCHK(); -extern long SYSTEM_RCHK(); -extern double SYSTEM_ABSD(); -extern SYSTEM_PTR SYSTEM_NEWREC(); -extern SYSTEM_PTR SYSTEM_NEWBLK(); -#ifdef __STDC__ -extern SYSTEM_PTR SYSTEM_NEWARR(long*, long, int, int, int, ...); -#else -extern SYSTEM_PTR SYSTEM_NEWARR(); -#endif -extern SYSTEM_PTR SYSTEM_REGMOD(); -extern void SYSTEM_INCREF(); -extern void SYSTEM_REGCMD(); -extern void SYSTEM_REGTYP(); -extern void SYSTEM_REGFIN(); -extern void SYSTEM_FINALL(); -extern void SYSTEM_INIT(); -extern void SYSTEM_FINI(); -extern void SYSTEM_HALT(); -extern void SYSTEM_INHERIT(); -extern void SYSTEM_ENUMP(); -extern void SYSTEM_ENUMR(); - -/* module registry */ -#define __DEFMOD static void *m; if(m!=0)return m -#define __REGMOD(name, enum) if(m==0)m=SYSTEM_REGMOD((CHAR*)name,enum); else return m -#define __ENDMOD return m -#define __INIT(argc, argv) static void *m; SYSTEM_INIT(argc, (long)&argv); -#define __REGMAIN(name, enum) m=SYSTEM_REGMOD(name,enum) -#define __FINI SYSTEM_FINI(); return 0 -#define __IMPORT(name) SYSTEM_INCREF(name##__init()) -#define __REGCMD(name, cmd) SYSTEM_REGCMD(m, name, cmd) - -/* SYSTEM ops */ -#define __SYSNEW(p, len) p=SYSTEM_NEWBLK((long)(len)) -#define __VAL(t, x) (*(t*)&(x)) -#define __GET(a, x, t) x= *(t*)(a) -#define __PUT(a, x, t) *(t*)(a)=x -#define __LSHL(x, n, t) ((t)((unsigned)(x)<<(n))) -#define __LSHR(x, n, t) ((t)((unsigned)(x)>>(n))) -#define __LSH(x, n, t) ((n)>=0? __LSHL(x, n, t): __LSHR(x, -(n), t)) -#define __ROTL(x, n, t) ((t)((unsigned)(x)<<(n)|(unsigned)(x)>>(8*sizeof(t)-(n)))) -#define __ROTR(x, n, t) ((t)((unsigned)(x)>>(n)|(unsigned)(x)<<(8*sizeof(t)-(n)))) -#define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) -#define __BIT(x, n) (*(unsigned long*)(x)>>(n)&1) -#define __MOVE(s, d, n) memcpy((char*)(d),(char*)(s),n) - -/* std procs and operator mappings */ -#define __SHORT(x, y) ((int)((unsigned long)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) -#define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) -#define __CHR(x) ((CHAR)__R(x, 256)) -#define __CHRF(x) ((CHAR)__RF(x, 256)) -#define __DIV(x, y) ((x)>=0?(x)/(y):-(((y)-1-(x))/(y))) -#define __DIVF(x, y) SYSTEM_DIV((long)(x),(long)(y)) -#define __MOD(x, y) ((x)>=0?(x)%(y):__MODF(x,y)) -#define __MODF(x, y) SYSTEM_MOD((long)(x),(long)(y)) -#define __NEW(p, t) p=SYSTEM_NEWREC((long)t##__typ) -#define __NEWARR SYSTEM_NEWARR -#define __HALT(x) SYSTEM_HALT(x) -#define __ASSERT(cond, x) if (!(cond)) {SYSTEM_assert = x; SYSTEM_HALT(-1);} -#define __ENTIER(x) SYSTEM_ENTIER(x) -#define __ABS(x) (((x)<0)?-(x):(x)) -#define __ABSF(x) SYSTEM_ABS((long)(x)) -#define __ABSFD(x) SYSTEM_ABSD((double)(x)) -#define __CAP(ch) ((CHAR)((ch)&0x5f)) -#define __ODD(x) ((x)&1) -#define __IN(x, s) (((s)>>(x))&1) -#define __SETOF(x) ((SET)1<<(x)) -#define __SETRNG(l, h) ((~(SET)0<<(l))&~(SET)0>>(8*sizeof(SET)-1-(h))) -#define __MASK(x, m) ((x)&~(m)) -#define __COPY(s, d, n) {char*_a=(void*)s,*_b=(void*)d;long _i=0,_t=n-1;while(_i<_t&&((_b[_i]=_a[_i])!=0)){_i++;};_b[_i]=0;} -static int __STRCMP(x, y) - CHAR *x, *y; -{long i = 0; CHAR ch1, ch2; - do {ch1 = x[i]; ch2 = y[i]; i++; - if (!ch1) return -(int)ch2; - } while (ch1==ch2); - return (int)ch1 - (int)ch2; -} -#define __ASH(x, n) ((n)>=0?__ASHL(x,n):__ASHR(x,-(n))) -#define __ASHL(x, n) ((long)(x)<<(n)) -#define __ASHR(x, n) ((long)(x)>>(n)) -#define __ASHF(x, n) SYSTEM_ASH((long)(x), (long)(n)) -#define __DUP(x, l, t) x=(void*)memcpy(alloca(l*sizeof(t)),x,l*sizeof(t)) -#define __DUPARR(v, t) v=(void*)memcpy(v##__copy,v,sizeof(t)) -#define __DEL(x) /* DUP with alloca frees storage automatically */ -#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(long)typ##__typ) -#define __TYPEOF(p) (*(((long**)(p))-1)) -#define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) - -/* runtime checks */ -#define __X(i, ub) (((unsigned)(long)(i)<(unsigned long)(ub))?i:(__HALT(-2),0)) -#define __XF(i, ub) SYSTEM_XCHK((long)(i), (long)(ub)) -#define __RETCHK __retchk: __HALT(-3) -#define __CASECHK __HALT(-4) -#define __GUARDP(p, typ, level) ((typ*)(__ISP(p,typ,level)?p:(__HALT(-5),p))) -#define __GUARDR(r, typ, level) (*((typ*)(__IS(r##__typ,typ,level)?r:(__HALT(-5),r)))) -#define __GUARDA(p, typ, level) ((struct typ*)(__IS(__TYPEOF(p),typ,level)?p:(__HALT(-5),p))) -#define __GUARDEQR(p, dyntyp, typ) if(dyntyp!=typ##__typ) __HALT(-6);*(p) -#define __GUARDEQP(p, typ) if(__TYPEOF(p)!=typ##__typ)__HALT(-6);*(p) -#define __WITHCHK __HALT(-7) -#define __R(i, ub) (((unsigned)(long)(i)<(unsigned long)(ub))?i:(__HALT(-8),0)) -#define __RF(i, ub) SYSTEM_RCHK((long)(i),(long)(ub)) - -/* record type descriptors */ -#define __TDESC(t, m, n) \ - static struct t##__desc {\ - long tproc[m]; \ - long tag, next, level, module; \ - char name[24]; \ - long *base[__MAXEXT]; \ - char *rsrvd; \ - long blksz, ptr[n+1]; \ - } t##__desc - -#define __BASEOFF (__MAXEXT+1) -#define __TPROC0OFF (__BASEOFF+24/sizeof(long)+5) -#define __EOM 1 -#define __TDFLDS(name, size) {__EOM}, 1, 0, 0, 0, name, {0}, 0, size -#define __ENUMP(adr, n, P) SYSTEM_ENUMP(adr, (long)(n), P) -#define __ENUMR(adr, typ, size, n, P) SYSTEM_ENUMR(adr, typ, (long)(size), (long)(n), P) - -#define __INITYP(t, t0, level) \ - t##__typ= &t##__desc.blksz; \ - memcpy(t##__desc.base, t0##__typ - __BASEOFF, level*sizeof(long)); \ - t##__desc.base[level]=t##__typ; \ - t##__desc.module=(long)m; \ - if(t##__desc.blksz!=sizeof(struct t)) __HALT(-15); \ - t##__desc.blksz=(t##__desc.blksz+5*sizeof(long)-1)/(4*sizeof(long))*(4*sizeof(long)); \ - SYSTEM_REGTYP(m, (long)&t##__desc.next); \ - SYSTEM_INHERIT(t##__typ, t0##__typ) - -/* Oberon-2 type bound procedures support */ -#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(long)proc -#define __SEND(typ, num, funtyp, parlist) ((funtyp)(*(typ-(__TPROC0OFF+num))))parlist - -/* runtime system variables */ -extern LONGINT SYSTEM_argc; -extern LONGINT SYSTEM_argv; -extern void (*SYSTEM_Halt)(); -extern LONGINT SYSTEM_halt; -extern LONGINT SYSTEM_assert; -extern SYSTEM_PTR SYSTEM_modules; -extern LONGINT SYSTEM_heapsize; -extern LONGINT SYSTEM_allocated; -extern LONGINT SYSTEM_lock; -extern SHORTINT SYSTEM_gclock; -extern BOOLEAN SYSTEM_interrupted; - -/* ANSI prototypes; not used so far -static int __STRCMP(CHAR *x, CHAR *y); -void SYSTEM_INIT(int argc, long argvadr); -void SYSTEM_FINI(void); -long SYSTEM_XCHK(long i, long ub); -long SYSTEM_RCHK(long i, long ub); -long SYSTEM_ASH(long i, long n); -long SYSTEM_ABS(long i); -double SYSTEM_ABSD(double i); -void SYSTEM_INHERIT(long *t, long *t0); -void SYSTEM_ENUMP(long *adr, long n, void (*P)(void*)); -void SYSTEM_ENUMR(char *adr, long *typ, long size, long n, void (*P)(void*)); -long SYSTEM_DIV(unsigned long x, unsigned long y); -long SYSTEM_MOD(unsigned long x, unsigned long y); -long SYSTEM_ENTIER(double x); -void SYSTEM_HALT(int n); -*/ - -#endif - diff --git a/src/system/linux/gcc/armv6j_hardfp/Unix.Mod b/src/system/linux/gcc/armv6j_hardfp/Unix.Mod deleted file mode 100644 index a882720a..00000000 --- a/src/system/linux/gcc/armv6j_hardfp/Unix.Mod +++ /dev/null @@ -1,482 +0,0 @@ -MODULE Unix; (* Josef Templ, 5.3.90 Linux system calls *) -(* system procedure added by noch *) -(* Module Unix provides a system call interface to Linux. - Naming conventions: - Procedure and Type-names always start with a capital letter. - error numbers as defined in Unix - other constants start with lower case letters *) - -IMPORT SYSTEM; - -CONST - -(* various important constants *) - - stdin* = 0; stdout* =1; stderr* = 2; - - LOCKEX* = 2; LOCKUN* = 8; (* /usr/include/file.h *) - AFINET* = 2; (* /usr/include/sys/socket.h *) - PFINET* = AFINET; (* /usr/include/linux/socket.h *) - SOCKSTREAM* = 1; (* /usr/include/linux/socket.h *) - FIONREAD* = 541BH; (* in /usr/include/asm/termios.h *) - SETFL* = 4; (* set file descriptor flags; in asm/fcntl.h *) - TCP* = 0; - -(* flag sets, cf. /usr/include/asm/fcntl.h *) - rdonly* = {}; wronly* = {0}; rdwr* = {1}; creat* = {6}; excl* = {7}; trunc* = {9}; append* = {10}; ndelay = {11}; - -(* error numbers *) - - EPERM* = 1; (* Not owner *) - ENOENT* = 2; (* No such file or directory *) - ESRCH* = 3; (* No such process *) - EINTR* = 4; (* Interrupted system call *) - EIO* = 5; (* I/O error *) - ENXIO* = 6; (* No such device or address *) - E2BIG* = 7; (* Arg list too long *) - ENOEXEC* = 8; (* Exec format error *) - EBADF* = 9; (* Bad file number *) - ECHILD* = 10; (* No children *) - EAGAIN* = 11; (* No more processes *) - ENOMEM* = 12; (* Not enough core *) - EACCES* = 13; (* Permission denied *) - EFAULT* = 14; (* Bad address *) - ENOTBLK* = 15; (* Block device required *) - EBUSY* = 16; (* Mount device busy *) - EEXIST* = 17; (* File exists *) - EXDEV* = 18; (* Cross-device link *) - ENODEV* = 19; (* No such device *) - ENOTDIR* = 20; (* Not a directory*) - EISDIR* = 21; (* Is a directory *) - EINVAL* = 22; (* Invalid argument *) - ENFILE* = 23; (* File table overflow *) - EMFILE* = 24; (* Too many open files *) - ENOTTY* = 25; (* Not a typewriter *) - ETXTBSY* = 26; (* Text file busy *) - EFBIG* = 27; (* File too large *) - ENOSPC* = 28; (* No space left on device *) - ESPIPE* = 29; (* Illegal seek *) - EROFS* = 30; (* Read-only file system *) - EMLINK* = 31; (* Too many links *) - EPIPE* = 32; (* Broken pipe *) - EDOM* = 33; (* Argument too large *) - ERANGE* = 34; (* Result too large *) - EDEADLK* = 35; (* Resource deadlock would occur *) - ENAMETOOLONG* = 36; (* File name too long *) - ENOLCK* = 37; (* No record locks available *) - ENOSYS* = 38; (* Function not implemented *) - ENOTEMPTY* = 39; (* Directory not empty *) - ELOOP* = 40; (* Too many symbolic links encountered *) - EWOULDBLOCK* = EAGAIN; (* Operation would block *) - ENOMSG* = 42; (* No message of desired type *) - EIDRM* = 43; (* Identifier removed *) - ECHRNG* = 44; (* Channel number out of range *) - EL2NSYNC* = 45; (* Level 2 not synchronized *) - EL3HLT* = 46; (* Level 3 halted *) - EL3RST* = 47; (* Level 3 reset *) - ELNRNG* = 48; (* Link number out of range *) - EUNATCH* = 49; (* Protocol driver not attached *) - ENOCSI* = 50; (* No CSI structure available *) - EL2HLT* = 51; (* Level 2 halted *) - EBADE* = 52; (* Invalid exchange *) - EBADR* = 53; (* Invalid request descriptor *) - EXFULL* = 54; (* Exchange full *) - ENOANO* = 55; (* No anode *) - EBADRQC* = 56; (* Invalid request code *) - EBADSLT* = 57; (* Invalid slot *) - EDEADLOCK* = 58; (* File locking deadlock error *) - EBFONT* = 59; (* Bad font file format *) - ENOSTR* = 60; (* Device not a stream *) - ENODATA* = 61; (* No data available *) - ETIME* = 62; (* Timer expired *) - ENOSR* = 63; (* Out of streams resources *) - ENONET* = 64; (* Machine is not on the network *) - ENOPKG* = 65; (* Package not installed *) - EREMOTE* = 66; (* Object is remote *) - ENOLINK* = 67; (* Link has been severed *) - EADV* = 68; (* Advertise error *) - ESRMNT* = 69; (* Srmount error *) - ECOMM* = 70; (* Communication error on send *) - EPROTO* = 71; (* Protocol error *) - EMULTIHOP* = 72; (* Multihop attempted *) - EDOTDOT* = 73; (* RFS specific error *) - EBADMSG* = 74; (* Not a data message *) - EOVERFLOW* = 75; (* Value too large for defined data type *) - ENOTUNIQ* = 76; (* Name not unique on network *) - EBADFD* = 77; (* File descriptor in bad state *) - EREMCHG* = 78; (* Remote address changed *) - ELIBACC* = 79; (* Can not access a needed shared library *) - ELIBBAD* = 80; (* Accessing a corrupted shared library *) - ELIBSCN* = 81; (* .lib section in a.out corrupted *) - ELIBMAX* = 82; (* Attempting to link in too many shared libraries *) - ELIBEXEC* = 83; (* Cannot exec a shared library directly *) - EILSEQ* = 84; (* Illegal byte sequence *) - ERESTART* = 85; (* Interrupted system call should be restarted *) - ESTRPIPE* = 86; (* Streams pipe error *) - EUSERS* = 87; (* Too many users *) - ENOTSOCK* = 88; (* Socket operation on non-socket *) - EDESTADDRREQ* = 89; (* Destination address required *) - EMSGSIZE* = 90; (* Message too long *) - EPROTOTYPE* = 91; (* Protocol wrong type for socket *) - ENOPROTOOPT* = 92; (* Protocol not available *) - EPROTONOSUPPORT* = 93; (* Protocol not supported *) - ESOCKTNOSUPPORT* = 94; (* Socket type not supported *) - EOPNOTSUPP* = 95; (* Operation not supported on transport endpoint *) - EPFNOSUPPORT* = 96; (* Protocol family not supported *) - EAFNOSUPPORT* = 97; (* Address family not supported by protocol *) - EADDRINUSE* = 98; (* Address already in use *) - EADDRNOTAVAIL* = 99; (* Cannot assign requested address *) - ENETDOWN* = 100; (* Network is down *) - ENETUNREACH* = 101; (* Network is unreachable *) - ENETRESET* = 102; (* Network dropped connection because of reset *) - ECONNABORTED* = 103; (* Software caused connection abort *) - ECONNRESET* = 104; (* Connection reset by peer *) - ENOBUFS* = 105; (* No buffer space available *) - EISCONN* = 106; (* Transport endpoint is already connected *) - ENOTCONN* = 107; (* Transport endpoint is not connected *) - ESHUTDOWN* = 108; (* Cannot send after transport endpoint shutdown *) - ETOOMANYREFS* = 109; (* Too many references: cannot splice *) - ETIMEDOUT* = 110; (* Connection timed out *) - ECONNREFUSED* = 111; (* Connection refused *) - EHOSTDOWN* = 112; (* Host is down *) - EHOSTUNREACH* = 113; (* No route to host *) - EALREADY* = 114; (* Operation already in progress *) - EINPROGRESS* = 115; (* Operation now in progress *) - ESTALE* = 116; (* Stale NFS file handle *) - EUCLEAN* = 117; (* Structure needs cleaning *) - ENOTNAM* = 118; (* Not a XENIX named type file *) - ENAVAIL* = 119; (* No XENIX semaphores available *) - EISNAM* = 120; (* Is a named type file *) - EREMOTEIO* = 121; (* Remote I/O error *) - EDQUOT* = 122; (* Quota exceeded *) - - -TYPE - (* cpp /usr/include/setjmp.h - struct __jmp_buf_tag - { - __jmp_buf __jmpbuf; - int __mask_was_saved; - __sigset_t __saved_mask; - }; - - typedef struct __jmp_buf_tag jmp_buf[1]; - - __sigset_t is 128 byte long in glibc on arm, x86, x86_64 - __jmp_buf is 24 bytes long in glibc on x86 - 256 bytes long in glibc on armv6 - 64 bytes long in glibc on x86_64 - - *) - JmpBuf* = RECORD - jmpbuf: ARRAY 64 OF LONGINT; (* 256 / 4 = 64 *) - maskWasSaved*: LONGINT; - savedMask*: ARRAY 32 OF LONGINT; (* 32 * 4 = 128 *) - unknown*: LONGINT; (* jmp_buf seems to have unknown 4 bytes field at the end (see http://hastebin.com/conujujeyu.pl) which is not defined in header file *) - END ; - - Status* = RECORD (* struct stat *) - dev*, devX*: LONGINT; (* 64 bit in Linux 2.2 *) - pad1: INTEGER; - ino*, mode*, nlink*, uid*, gid*: LONGINT; - rdev*, rdevX*: LONGINT; (* 64 bit in Linux 2.2 *) - pad2: INTEGER; - size*, blksize*, blocks*, atime*, unused1*, mtime*, unused2*, ctime*, - unused3*, unused4*, unused5*: LONGINT; - END ; - - Timeval* = RECORD - sec*, usec*: LONGINT - END ; - - Timezone* = RECORD - minuteswest*, dsttime*: LONGINT - END ; - - Itimerval* = RECORD - interval*, value*: Timeval - END ; - - FdSet* = ARRAY 8 OF SET; - - SigCtxPtr* = POINTER TO SigContext; - SigContext* = RECORD - END ; - - SignalHandler* = PROCEDURE (sig, code: LONGINT; scp: SigCtxPtr); - - Dirent* = RECORD - ino, off: LONGINT; - reclen: INTEGER; - name: ARRAY 256 OF CHAR; - END ; - - Rusage* = RECORD - utime*, stime*: Timeval; - maxrss*, ixrss*, idrss*, isrss*, - minflt*, majflt*, nswap*, inblock*, - oublock*, msgsnd*, msgrcv*, nsignals*, - nvcsw*, nivcsw*: LONGINT - END ; - - Iovec* = RECORD - base*, len*: LONGINT - END ; - - SocketPair* = ARRAY 2 OF LONGINT; - - Pollfd* = RECORD - fd*: LONGINT; - events*, revents*: INTEGER - END ; - - Sockaddr* = RECORD - family*: INTEGER; - port*: INTEGER; - internetAddr*: LONGINT; - pad*: ARRAY 8 OF CHAR; - END ; - - HostEntry* = POINTER [1] TO Hostent; - Hostent* = RECORD - name*, aliases*: LONGINT; - addrtype*, length*: LONGINT; - addrlist*: LONGINT; (*POINTER TO POINTER TO LONGINT, network byte order*) - END; - - Name* = ARRAY OF CHAR; - - PROCEDURE -includeStat() - "#include "; - - PROCEDURE -includeErrno() - "#include "; - - (* for read(), write() and sleep() *) - PROCEDURE -includeUnistd() - "#include "; - - (* for system() *) -(* commented, doesn't compile on 32bit GNU/Linux platforms - PROCEDURE -includeStdlib() - "#include "; -*) - (* for nanosleep() *) - PROCEDURE -includeTime() - "#include "; - - (* for select() *) - PROCEDURE -includeSelect() - "#include "; - - PROCEDURE -err(): LONGINT - "errno"; - - PROCEDURE errno*(): LONGINT; - BEGIN - RETURN err() - END errno; - - PROCEDURE -Exit*(n: LONGINT) - "exit(n)"; - - PROCEDURE -Fork*(): LONGINT - "fork()"; - - PROCEDURE -Wait*(VAR status: LONGINT): LONGINT - "wait(status)"; - - PROCEDURE -Select*(width: LONGINT; VAR readfds, writefds, exceptfds: FdSet; VAR timeout: Timeval): LONGINT - "select(width, readfds, writefds, exceptfds, timeout)"; - - PROCEDURE -Gettimeofday* (VAR tv: Timeval; VAR tz: Timezone) : LONGINT - "gettimeofday(tv, tz)"; - - PROCEDURE -Read* (fd, buf, nbyte: LONGINT): LONGINT - "read(fd, buf, nbyte)"; - - PROCEDURE -ReadBlk* (fd: LONGINT; VAR buf: ARRAY OF SYSTEM.BYTE): LONGINT - "read(fd, buf, buf__len)"; - - PROCEDURE -Write* (fd, buf, nbyte: LONGINT): LONGINT - "write(fd, buf, nbyte)"; - - PROCEDURE -WriteBlk* (fd: LONGINT; VAR buf: ARRAY OF SYSTEM.BYTE): LONGINT - "write(fd, buf, buf__len)"; - - PROCEDURE -Dup*(fd: LONGINT): LONGINT - "dup(fd)"; - - PROCEDURE -Dup2*(fd1, fd2: LONGINT): LONGINT - "dup(fd1, fd2)"; - - PROCEDURE -Pipe*(fds : LONGINT): LONGINT - "pipe(fds)"; - - PROCEDURE -Getpid*(): LONGINT - "getpid()"; - - PROCEDURE -Getuid*(): LONGINT - "getuid()"; - - PROCEDURE -Geteuid*(): LONGINT - "geteuid()"; - - PROCEDURE -Getgid*(): LONGINT - "getgid()"; - - PROCEDURE -Getegid*(): LONGINT - "getegid()"; - - PROCEDURE -Unlink*(name: Name): LONGINT - "unlink(name)"; - - PROCEDURE -Open*(name: Name; flag, mode: SET): LONGINT - "open(name, flag, mode)"; - - PROCEDURE -Close*(fd: LONGINT): LONGINT - "close(fd)"; - - PROCEDURE -stat(name: Name; VAR statbuf: Status): LONGINT - "stat((const char*)name, (struct stat*)statbuf)"; - - PROCEDURE Stat*(name: Name; VAR statbuf: Status): LONGINT; - VAR res: LONGINT; - BEGIN - res := stat(name, statbuf); - (* make the first 4 bytes as unique as possible (used in module Files for caching!) *) - INC(statbuf.dev, statbuf.devX); - INC(statbuf.rdev, statbuf.rdevX); - RETURN res; - END Stat; - - PROCEDURE -fstat(fd: LONGINT; VAR statbuf: Status): LONGINT - "fstat(fd, (struct stat*)statbuf)"; - - PROCEDURE Fstat*(fd: LONGINT; VAR statbuf: Status): LONGINT; - VAR res: LONGINT; - BEGIN - res := fstat(fd, statbuf); - (* make the first 4 bytes as unique as possible (used in module Files for caching!) *) - INC(statbuf.dev, statbuf.devX); - INC(statbuf.rdev, statbuf.rdevX); - RETURN res; - END Fstat; - - PROCEDURE -Fchmod*(fd, mode: LONGINT): LONGINT - "fchmod(fd, mode)"; - - PROCEDURE -Chmod*(path: Name; mode: LONGINT): LONGINT - "chmod(path, mode)"; - - PROCEDURE -Lseek*(fd, offset, origin: LONGINT): LONGINT - "lseek(fd, offset, origin)"; - - PROCEDURE -Fsync*(fd: LONGINT): LONGINT - "fsync(fd)"; - - PROCEDURE -Fcntl*(fd, cmd, arg: LONGINT ): LONGINT - "fcntl(fd, cmd, arg)"; - - PROCEDURE -Flock*(fd, operation: LONGINT): LONGINT - "flock(fd, operation)"; - - PROCEDURE -Ftruncate*(fd, length: LONGINT): LONGINT - "ftruncate(fd, length)"; - - PROCEDURE -Readblk*(fd: LONGINT; VAR buf: ARRAY OF SYSTEM.BYTE; len: LONGINT): LONGINT - "read(fd, buf, len)"; - - PROCEDURE -Rename*(old, new: Name): LONGINT - "rename(old, new)"; - - PROCEDURE -Chdir*(path: Name): LONGINT - "chdir(path)"; - - PROCEDURE -Ioctl*(fd, request, arg: LONGINT): LONGINT - "ioctl(fd, request, arg)"; - - PROCEDURE -Kill*(pid, sig: LONGINT): LONGINT - "kill(pid, sig)"; - - PROCEDURE -Sigsetmask*(mask: LONGINT): LONGINT - "sigsetmask(mask)"; - - PROCEDURE -Sleep*(ms : LONGINT): LONGINT - "sleep(ms)"; - - PROCEDURE -Nanosleep*(VAR req : Timeval; VAR rem : Timeval): LONGINT - "nanosleep(req, rem)"; - - (* TCP/IP networking *) - - PROCEDURE -Gethostbyname*(name: Name): HostEntry - "(Unix_HostEntry)gethostbyname(name)"; - - PROCEDURE -Gethostname*(VAR name: Name): LONGINT - "gethostname(name, name__len)"; - - PROCEDURE -Socket*(af, type, protocol: LONGINT): LONGINT - "socket(af, type, protocol)"; - - PROCEDURE -Connect*(socket: LONGINT; name: Sockaddr; namelen: LONGINT): LONGINT - "connect(socket, &(name), namelen)"; - - PROCEDURE -Getsockname*(socket: LONGINT; VAR name: Sockaddr; VAR namelen: LONGINT): LONGINT - "getsockname(socket, name, namelen)"; - - PROCEDURE -Bind*(socket: LONGINT; name: Sockaddr; namelen: LONGINT): LONGINT - "bind(socket, &(name), namelen)"; - - PROCEDURE -Listen*(socket, backlog: LONGINT): LONGINT - "listen(socket, backlog)"; - - PROCEDURE -Accept*(socket: LONGINT; VAR addr: Sockaddr; VAR addrlen: LONGINT): LONGINT - "accept(socket, addr, addrlen)"; - - PROCEDURE -Recv*(socket, bufadr, buflen, flags: LONGINT): LONGINT - "recv(socket, bufadr, buflen, flags)"; - - PROCEDURE -Send*(socket, bufadr, buflen, flags: LONGINT): LONGINT - "send(socket, bufadr, buflen, flags)"; - - PROCEDURE -sys(str: ARRAY OF CHAR): INTEGER (* need this to call external tools like gcc or gas; noch *) - "system(str)"; - - PROCEDURE system*(cmd : ARRAY OF CHAR); - VAR r : INTEGER; - BEGIN - r := sys(cmd); - END system; - - PROCEDURE System*(cmd : ARRAY OF CHAR): INTEGER; - VAR r : INTEGER; - BEGIN - r := sys(cmd); - RETURN r - END System; - - PROCEDURE -SizeofUnixStat(): INTEGER - "sizeof(Unix_Status)"; - - PROCEDURE -SizeofStat(): INTEGER - "sizeof(struct stat)"; - - PROCEDURE -Error(msg: ARRAY OF CHAR; len: INTEGER) - "write(1/*stdout*/, msg, len); char ch = 0xa; write(1, &ch, 1)"; - - PROCEDURE StatCheck; - VAR x, y: LONGINT; - BEGIN - x := SizeofUnixStat(); - y := SizeofStat(); - IF x # y THEN - Error("Unix.StatCheck: inconsistent usage of struct stat", 49); - Exit(1); - END - END StatCheck; - -BEGIN - - StatCheck(); -END Unix. diff --git a/src/system/linux/gcc/powerpc/Args.Mod b/src/system/linux/gcc/powerpc/Args.Mod deleted file mode 100644 index c6b7b56e..00000000 --- a/src/system/linux/gcc/powerpc/Args.Mod +++ /dev/null @@ -1,65 +0,0 @@ -MODULE Args; (* jt, 8.12.94 *) - - (* command line argument handling for voc (jet backend) *) - - - IMPORT SYSTEM; - - TYPE - ArgPtr = POINTER TO ARRAY 1024 OF CHAR; - ArgVec = POINTER TO ARRAY 1024 OF ArgPtr; - - VAR argc-, argv-: LONGINT; - (*PROCEDURE -includestdlib() "#include ";*) - PROCEDURE -externgetenv() "extern char *getenv(const char *name);"; (* took this from stdlib.h*) - PROCEDURE -Argc(): INTEGER "SYSTEM_argc"; - PROCEDURE -Argv(): LONGINT "(long)SYSTEM_argv"; - PROCEDURE -getenv(var: ARRAY OF CHAR): ArgPtr - "(Args_ArgPtr)getenv(var)"; - - PROCEDURE Get*(n: INTEGER; VAR val: ARRAY OF CHAR); - VAR av: ArgVec; - BEGIN - IF n < argc THEN av := SYSTEM.VAL(ArgVec, argv); COPY(av[n]^, val) END - END Get; - - PROCEDURE GetInt*(n: INTEGER; VAR val: LONGINT); - VAR s: ARRAY 64 OF CHAR; k, d, i: LONGINT; - BEGIN - s := ""; Get(n, s); i := 0; - IF s[0] = "-" THEN i := 1 END ; - k := 0; d := ORD(s[i]) - ORD("0"); - WHILE (d >= 0 ) & (d <= 9) DO k := k*10 + d; INC(i); d := ORD(s[i]) - ORD("0") END ; - IF s[0] = "-" THEN d := -d; DEC(i) END ; - IF i > 0 THEN val := k END - END GetInt; - - PROCEDURE Pos*(s: ARRAY OF CHAR): INTEGER; - VAR i: INTEGER; arg: ARRAY 256 OF CHAR; - BEGIN - i := 0; Get(i, arg); - WHILE (i < argc) & (s # arg) DO INC(i); Get(i, arg) END ; - RETURN i - END Pos; - - PROCEDURE GetEnv*(var: ARRAY OF CHAR; VAR val: ARRAY OF CHAR); - VAR p: ArgPtr; - BEGIN - p := getenv(var); - IF p # NIL THEN COPY(p^, val) END - END GetEnv; - - PROCEDURE getEnv*(var: ARRAY OF CHAR; VAR val: ARRAY OF CHAR): BOOLEAN; - VAR p: ArgPtr; - BEGIN - p := getenv(var); - IF p # NIL THEN - COPY(p^, val); - RETURN TRUE - ELSE - RETURN FALSE - END - END getEnv; - -BEGIN argc := Argc(); argv := Argv() -END Args. diff --git a/src/system/linux/gcc/powerpc/Files.Mod b/src/system/linux/gcc/powerpc/Files.Mod deleted file mode 100644 index 6307407d..00000000 --- a/src/system/linux/gcc/powerpc/Files.Mod +++ /dev/null @@ -1,663 +0,0 @@ -MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files *) -(* modified version of Files, which opens only the file provided and does not scan any path in any environment variable, also ReadLine procedure added; -- noch *) - IMPORT SYSTEM, Unix, Kernel, Args, Console; - - (* standard data type I/O - - little endian, - Sint:1, Int:2, Lint:4 - ORD({0}) = 1, - false = 0, true =1 - IEEE real format, - null terminated strings, - compact numbers according to M.Odersky *) - - - CONST - nofbufs = 4; - bufsize = 4096; - fileTabSize = 64; - noDesc = -1; - notDone = -1; - - (* file states *) - open = 0; create = 1; close = 2; - - - TYPE - FileName = ARRAY 101 OF CHAR; - File* = POINTER TO Handle; - Buffer = POINTER TO BufDesc; - - Handle = RECORD - workName, registerName: FileName; - tempFile: BOOLEAN; - dev, ino, mtime: LONGINT; - fd-, len, pos: LONGINT; - bufs: ARRAY nofbufs OF Buffer; - swapper, state: INTEGER - END ; - - BufDesc = RECORD - f: File; - chg: BOOLEAN; - org, size: LONGINT; - data: ARRAY bufsize OF SYSTEM.BYTE - END ; - - Rider* = RECORD - res*: LONGINT; - eof*: BOOLEAN; - buf: Buffer; - org, offset: LONGINT - END ; - - Time = POINTER TO TimeDesc; - TimeDesc = RECORD - sec*, min*, hour*, mday*, mon*, year*, wday*, isdst*, zone*, gmtoff*: LONGINT; -(* sec*, min*, hour*, mday*, mon*, year*, wday*, isdst*, zone*, gmtoff*: INTEGER;*) - END ; - - VAR - fileTab: ARRAY fileTabSize OF LONGINT (*=File*); - tempno: INTEGER; - -(* for localtime *) - PROCEDURE -includetime() - '#include "time.h"'; - - PROCEDURE -localtime(VAR clock: LONGINT): Time - "(Files_Time) localtime(clock)"; - - PROCEDURE -getcwd(VAR cwd: Unix.Name) - "getcwd(cwd, cwd__len)"; - - PROCEDURE -IdxTrap "__HALT(-1)"; - - PROCEDURE^ Finalize(o: SYSTEM.PTR); - - PROCEDURE Err(s: ARRAY OF CHAR; f: File; errno: LONGINT); - BEGIN - Console.Ln; Console.String("-- "); Console.String(s); Console.String(": "); - IF f # NIL THEN - IF f.registerName # "" THEN Console.String(f.registerName) ELSE Console.String(f.workName) END - END ; - IF errno # 0 THEN Console.String(" errno = "); Console.Int(errno, 1) END ; - Console.Ln; - HALT(99) - END Err; - - PROCEDURE MakeFileName(dir, name: ARRAY OF CHAR; VAR dest: ARRAY OF CHAR); - VAR i, j: INTEGER; - BEGIN i := 0; j := 0; - WHILE dir[i] # 0X DO dest[i] := dir[i]; INC(i) END ; - IF dest[i-1] # "/" THEN dest[i] := "/"; INC(i) END ; - WHILE name[j] # 0X DO dest[i] := name[j]; INC(i); INC(j) END ; - dest[i] := 0X - END MakeFileName; - - PROCEDURE GetTempName(finalName: ARRAY OF CHAR; VAR name: ARRAY OF CHAR); - VAR n, i, j: LONGINT; - BEGIN - INC(tempno); n := tempno; i := 0; - IF finalName[0] # "/" THEN (* relative pathname *) - WHILE Kernel.CWD[i] # 0X DO name[i] := Kernel.CWD[i]; INC(i) END; - IF Kernel.CWD[i-1] # "/" THEN name[i] := "/"; INC(i) END - END; - j := 0; - WHILE finalName[j] # 0X DO name[i] := finalName[j]; INC(i); INC(j) END; - DEC(i); - WHILE name[i] # "/" DO DEC(i) END; - name[i+1] := "."; name[i+2] := "t"; name[i+3] := "m"; name[i+4] := "p"; name[i+5] := "."; INC(i, 6); - WHILE n > 0 DO name[i] := CHR(n MOD 10 + ORD("0")); n := n DIV 10; INC(i) END; - name[i] := "."; INC(i); n := SHORT(Unix.Getpid()); - WHILE n > 0 DO name[i] := CHR(n MOD 10 + ORD("0")); n := n DIV 10; INC(i) END; - name[i] := 0X - END GetTempName; - - PROCEDURE Create(f: File); - VAR stat: Unix.Status; done: BOOLEAN; - errno: LONGINT; err: ARRAY 32 OF CHAR; - BEGIN - IF f.fd = noDesc THEN - IF f.state = create THEN GetTempName(f.registerName, f.workName); f.tempFile := TRUE - ELSIF f.state = close THEN - f.workName := f.registerName; f.registerName := ""; f.tempFile := FALSE - END ; - errno := Unix.Unlink(f.workName); (*unlink first to avoid stale NFS handles and to avoid reuse of inodes*) - f.fd := Unix.Open(f.workName, Unix.rdwr + Unix.creat + Unix.trunc, {2, 4,5, 7,8}); - done := f.fd >= 0; errno := Unix.errno(); - IF (~done & ((errno = Unix.ENFILE) OR (errno = Unix.EMFILE))) OR (done & (f.fd >= fileTabSize)) THEN - IF done & (f.fd >= fileTabSize) THEN errno := Unix.Close(f.fd) END ; - Kernel.GC(TRUE); - f.fd := Unix.Open(f.workName, Unix.rdwr + Unix.creat + Unix.trunc, {2, 4,5, 7,8}); - done := f.fd >= 0 - END ; - IF done THEN - IF f.fd >= fileTabSize THEN errno := Unix.Close(f.fd); Err("too many files open", f, 0) - ELSE fileTab[f.fd] := SYSTEM.VAL(LONGINT, f); INC(Kernel.nofiles); Kernel.RegisterObject(f, Finalize); - f.state := open; f.pos := 0; errno := Unix.Fstat(f.fd, stat); - f.dev := stat.dev; f.ino := stat.ino; f.mtime := stat.mtime - END - ELSE errno := Unix.errno(); - IF errno = Unix.ENOENT THEN err := "no such directory" - ELSIF (errno = Unix.ENFILE) OR (errno = Unix.EMFILE) THEN err := "too many files open" - ELSE err := "file not created" - END ; - Err(err, f, errno) - END - END - END Create; - - PROCEDURE Flush(buf: Buffer); - VAR res: LONGINT; f: File; stat: Unix.Status; - BEGIN - IF buf.chg THEN f := buf.f; Create(f); - IF buf.org # f.pos THEN res := Unix.Lseek(f.fd, buf.org, 0) END ; - res := Unix.Write(f.fd, SYSTEM.ADR(buf.data), buf.size); - IF res < 0 THEN Err("error in writing file", f, Unix.errno()) END ; - f.pos := buf.org + buf.size; - buf.chg := FALSE; - res := Unix.Fstat(f.fd, stat); - f.mtime := stat.mtime - END - END Flush; - - PROCEDURE Close* (f: File); - VAR i, res: LONGINT; - BEGIN - IF (f.state # create) OR (f.registerName # "") THEN - Create(f); i := 0; - WHILE (i < nofbufs) & (f.bufs[i] # NIL) DO Flush(f.bufs[i]); INC(i) END ; - res := Unix.Fsync(f.fd); - IF res < 0 THEN Err("error in writing file", f, Unix.errno()) END - END - END Close; - - PROCEDURE Length* (f: File): LONGINT; - BEGIN RETURN f.len - END Length; - - PROCEDURE New* (name: ARRAY OF CHAR): File; - VAR f: File; - BEGIN - NEW(f); f.workName := ""; COPY(name, f.registerName); - f.fd := noDesc; f.state := create; f.len := 0; f.pos := 0; f.swapper := -1; (*all f.buf[i] = NIL*) - RETURN f - END New; -(* - PROCEDURE ScanPath(VAR pos: INTEGER; VAR dir: ARRAY OF CHAR); (* supports ~, ~user and blanks inside path *) - VAR i: INTEGER; ch: CHAR; home: ARRAY 256 OF CHAR; - BEGIN - i := 0; ch := Kernel.OBERON[pos]; - WHILE (ch = " ") OR (ch = ":") DO INC(pos); ch := Kernel.OBERON[pos] END ; - IF ch = "~" THEN - INC(pos); ch := Kernel.OBERON[pos]; - home := ""; Args.GetEnv("HOME", home); - WHILE home[i] # 0X DO dir[i] := home[i]; INC(i) END ; - IF (ch # "/") & (ch # 0X) & (ch # ":") & (ch # " ") THEN - WHILE (i > 0) & (dir[i-1] # "/") DO DEC(i) END - END - END ; - WHILE (ch # 0X) & (ch # ":") DO dir[i] := ch; INC(i); INC(pos); ch := Kernel.OBERON[pos] END ; - WHILE (i > 0) & (dir[i-1] = " ") DO DEC(i) END ; - dir[i] := 0X - END ScanPath; -*) - PROCEDURE HasDir(VAR name: ARRAY OF CHAR): BOOLEAN; - VAR i: INTEGER; ch: CHAR; - BEGIN i := 0; ch := name[0]; - WHILE (ch # 0X) & (ch # "/") DO INC(i); ch := name[i] END ; - RETURN ch = "/" - END HasDir; - - PROCEDURE CacheEntry(dev, ino: LONGINT; mtime: LONGINT): File; - VAR f: File; i: INTEGER; stat: Unix.Status; res: LONGINT; - BEGIN i := 0; - WHILE i < fileTabSize DO - f := SYSTEM.VAL(File, fileTab[i]); - IF (f # NIL) & (ino = f.ino) & (dev = f.dev) THEN - IF mtime # f.mtime THEN i := 0; - WHILE i < nofbufs DO - IF f.bufs[i] # NIL THEN f.bufs[i].org := -1; f.bufs[i] := NIL END ; - INC(i) - END ; - f.swapper := -1; f.mtime := mtime; - res := Unix.Fstat(f.fd, stat); f.len := stat.size - END ; - RETURN f - END ; - INC(i) - END ; - RETURN NIL - END CacheEntry; - - PROCEDURE Old* (name: ARRAY OF CHAR): File; - VAR f: File; fd, res, errno: LONGINT; pos: INTEGER; done: BOOLEAN; - dir, path: ARRAY 256 OF CHAR; - stat: Unix.Status; - BEGIN - IF name # "" THEN - IF HasDir(name) THEN dir := ""; COPY(name, path) - ELSE - pos := 0; - COPY(name, path); (* -- noch *) - (*ScanPath(pos, dir);*) (*MakeFileName(dir, name, path);*) (*ScanPath(pos, dir)*) - END ; - LOOP - fd := Unix.Open(path, Unix.rdwr, {}); done := fd >= 0; errno := Unix.errno(); - IF (~done & ((errno = Unix.ENFILE) OR (errno = Unix.EMFILE))) OR (done & (fd >= fileTabSize)) THEN - IF done & (fd >= fileTabSize) THEN res := Unix.Close(fd) END ; - Kernel.GC(TRUE); - fd := Unix.Open(path, Unix.rdwr, {}); - done := fd >= 0; errno := Unix.errno(); - IF ~done & ((errno = Unix.ENFILE) OR (errno = Unix.EMFILE)) THEN Err("too many files open", f, errno) END - END ; - IF ~done & ((errno = Unix.EACCES) OR (errno = Unix.EROFS) OR (errno = Unix.EAGAIN)) THEN - (* errno EAGAIN observed on Solaris 2.4 *) - fd := Unix.Open(path, Unix.rdonly, {}); done := fd >= 0; errno := Unix.errno() - END ; -IF (~done) & (errno # Unix.ENOENT) THEN - Console.String("warning Files.Old "); Console.String(name); - Console.String(" errno = "); Console.Int(errno, 0); Console.Ln; -END ; - IF done THEN - res := Unix.Fstat(fd, stat); - f := CacheEntry(stat.dev, stat.ino, stat.mtime); - IF f # NIL THEN res := Unix.Close(fd); RETURN f - ELSIF fd >= fileTabSize THEN res := Unix.Close(fd); Err("too many files open", f, 0) - ELSE NEW(f); fileTab[fd] := SYSTEM.VAL(LONGINT, f); INC(Kernel.nofiles); Kernel.RegisterObject(f, Finalize); - f.fd := fd; f.state := open; f.len := stat.size; f.pos := 0; f.swapper := -1; (*all f.buf[i] = NIL*) - COPY(name, f.workName); f.registerName := ""; f.tempFile := FALSE; - f.dev := stat.dev; f.ino := stat.ino; f.mtime := stat.mtime; - RETURN f - END - ELSIF dir = "" THEN RETURN NIL - ELSE (*MakeFileName(dir, name, path);*) (*ScanPath(pos, dir)*) - RETURN NIL - END - END - ELSE RETURN NIL - END - END Old; - - PROCEDURE Purge* (f: File); - VAR i: INTEGER; stat: Unix.Status; res: LONGINT; - BEGIN i := 0; - WHILE i < nofbufs DO - IF f.bufs[i] # NIL THEN f.bufs[i].org := -1; f.bufs[i] := NIL END ; - INC(i) - END ; - IF f.fd # noDesc THEN res := Unix.Ftruncate(f.fd, 0); res := Unix.Lseek(f.fd, 0, 0) END ; - f.pos := 0; f.len := 0; f.swapper := -1; - res := Unix.Fstat(f.fd, stat); f.mtime := stat.mtime - END Purge; - - PROCEDURE GetDate* (f: File; VAR t, d: LONGINT); - VAR stat: Unix.Status; clock, res: LONGINT; time: Time; - BEGIN - Create(f); res := Unix.Fstat(f.fd, stat); - time := localtime(stat.mtime); - t := time.sec + ASH(time.min, 6) + ASH(time.hour, 12); - d := time.mday + ASH(time.mon+1, 5) + ASH(time.year MOD 100, 9) - END GetDate; - - PROCEDURE Pos* (VAR r: Rider): LONGINT; - BEGIN RETURN r.org + r.offset - END Pos; - - PROCEDURE Set* (VAR r: Rider; f: File; pos: LONGINT); - VAR org, offset, i, n, res: LONGINT; buf: Buffer; - BEGIN - IF f # NIL THEN - IF pos > f.len THEN pos := f.len ELSIF pos < 0 THEN pos := 0 END ; - offset := pos MOD bufsize; org := pos - offset; i := 0; - WHILE (i < nofbufs) & (f.bufs[i] # NIL) & (org # f.bufs[i].org) DO INC(i) END ; - IF i < nofbufs THEN - IF f.bufs[i] = NIL THEN NEW(buf); buf.chg := FALSE; buf.org := -1; buf.f := f; f.bufs[i] := buf - ELSE buf := f.bufs[i] - END - ELSE - f.swapper := (f.swapper + 1) MOD nofbufs; - buf := f.bufs[f.swapper]; - Flush(buf) - END ; - IF buf.org # org THEN - IF org = f.len THEN buf.size := 0 - ELSE Create(f); - IF f.pos # org THEN res := Unix.Lseek(f.fd, org, 0) END ; - n := Unix.ReadBlk(f.fd, buf.data); - IF n < 0 THEN Err("read from file not done", f, Unix.errno()) END ; - f.pos := org + n; - buf.size := n - END ; - buf.org := org; buf.chg := FALSE - END - ELSE buf := NIL; org := 0; offset := 0 - END ; - r.buf := buf; r.org := org; r.offset := offset; r.eof := FALSE; r.res := 0 - END Set; - - PROCEDURE Read* (VAR r: Rider; VAR x: SYSTEM.BYTE); - VAR offset: LONGINT; buf: Buffer; - BEGIN - buf := r.buf; offset := r.offset; - IF r.org # buf.org THEN Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset END ; - IF (offset < buf.size) THEN - x := buf.data[offset]; r.offset := offset + 1 - ELSIF r.org + offset < buf.f.len THEN - Set(r, r.buf.f, r.org + offset); - x := r.buf.data[0]; r.offset := 1 - ELSE - x := 0X; r.eof := TRUE - END - END Read; - - PROCEDURE ReadBytes* (VAR r: Rider; VAR x: ARRAY OF SYSTEM.BYTE; n: LONGINT); - VAR xpos, min, restInBuf, offset: LONGINT; buf: Buffer; - BEGIN - IF n > LEN(x) THEN IdxTrap END ; - xpos := 0; buf := r.buf; offset := r.offset; - WHILE n > 0 DO - IF (r.org # buf.org) OR (offset >= bufsize) THEN - Set(r, buf.f, r.org + offset); - buf := r.buf; offset := r.offset - END ; - restInBuf := buf.size - offset; - IF restInBuf = 0 THEN r.res := n; r.eof := TRUE; RETURN - ELSIF n > restInBuf THEN min := restInBuf ELSE min := n END ; - SYSTEM.MOVE(SYSTEM.ADR(buf.data) + offset, SYSTEM.ADR(x) + xpos, min); - INC(offset, min); r.offset := offset; INC(xpos, min); DEC(n, min) - END ; - r.res := 0; r.eof := FALSE - END ReadBytes; - - PROCEDURE ReadByte* (VAR r : Rider; VAR x : ARRAY OF SYSTEM.BYTE); - BEGIN - ReadBytes(r, x, 1); - END ReadByte; - - PROCEDURE Base* (VAR r: Rider): File; - BEGIN RETURN r.buf.f - END Base; - - PROCEDURE Write* (VAR r: Rider; x: SYSTEM.BYTE); - VAR buf: Buffer; offset: LONGINT; - BEGIN - buf := r.buf; offset := r.offset; - IF (r.org # buf.org) OR (offset >= bufsize) THEN - Set(r, buf.f, r.org + offset); - buf := r.buf; offset := r.offset - END ; - buf.data[offset] := x; - buf.chg := TRUE; - IF offset = buf.size THEN - INC(buf.size); INC(buf.f.len) - END ; - r.offset := offset + 1; r.res := 0 - END Write; - - PROCEDURE WriteByte* (VAR r : Rider; x : SYSTEM.BYTE); (* added for compatibility with PO 2013, -- noch *) - BEGIN - Write(r, x); - END WriteByte; - - PROCEDURE WriteBytes* (VAR r: Rider; VAR x: ARRAY OF SYSTEM.BYTE; n: LONGINT); - VAR xpos, min, restInBuf, offset: LONGINT; buf: Buffer; - BEGIN - IF n > LEN(x) THEN IdxTrap END ; - xpos := 0; buf := r.buf; offset := r.offset; - WHILE n > 0 DO - IF (r.org # buf.org) OR (offset >= bufsize) THEN - Set(r, buf.f, r.org + offset); - buf := r.buf; offset := r.offset - END ; - restInBuf := bufsize - offset; - IF n > restInBuf THEN min := restInBuf ELSE min := n END ; - SYSTEM.MOVE(SYSTEM.ADR(x) + xpos, SYSTEM.ADR(buf.data) + offset, min); - INC(offset, min); r.offset := offset; - IF offset > buf.size THEN INC(buf.f.len, offset - buf.size); buf.size := offset END ; - INC(xpos, min); DEC(n, min); buf.chg := TRUE - END ; - r.res := 0 - END WriteBytes; - -(* another solution would be one that is similar to ReadBytes, WriteBytes. -No code duplication, more symmetric, only two ifs for -Read and Write in buffer, buf.size replaced by bufsize in Write ops, buf.size and len -must be made consistent with offset (if offset > buf.size) in a lazy way. - -PROCEDURE Write* (VAR r: Rider; x: SYSTEM.BYTE); - VAR buf: Buffer; offset: LONGINT; -BEGIN - buf := r.buf; offset := r.offset; - IF (offset >= bufsize) OR (r.org # buf.org) THEN - Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset; - END ; - buf.data[offset] := x; r.offset := offset + 1; buf.chg := TRUE -END Write; - - -PROCEDURE WriteBytes ... - -PROCEDURE Read* (VAR r: Rider; VAR x: SYSTEM.BYTE); - VAR offset: LONGINT; buf: Buffer; -BEGIN - buf := r.buf; offset := r.offset; - IF (offset >= buf.size) OR (r.org # buf.org) THEN - IF r.org + offset >= buf.f.len THEN x := 0X; r.eof := TRUE; RETURN - ELSE Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset - END - END ; - x := buf.data[offset]; r.offset := offset + 1 -END Read; - -but this would also affect Set, Length, and Flush. -Especially Length would become fairly complex. -*) - - PROCEDURE Delete* (name: ARRAY OF CHAR; VAR res: INTEGER); - BEGIN - res := SHORT(Unix.Unlink(name)); - res := SHORT(Unix.errno()) - END Delete; - - PROCEDURE Rename* (old, new: ARRAY OF CHAR; VAR res: INTEGER); - VAR fdold, fdnew, n, errno, r: LONGINT; - ostat, nstat: Unix.Status; - buf: ARRAY 4096 OF CHAR; - BEGIN - r := Unix.Stat(old, ostat); - IF r >= 0 THEN - r := Unix.Stat(new, nstat); - IF (r >= 0) & ((ostat.dev # nstat.dev) OR (ostat.ino # nstat.ino)) THEN - Delete(new, res); (* work around stale nfs handles *) - END ; - r := Unix.Rename(old, new); - IF r < 0 THEN res := SHORT(Unix.errno()); - IF res = Unix.EXDEV THEN (* cross device link, move the file *) - fdold := Unix.Open(old, Unix.rdonly, {}); - IF fdold < 0 THEN res := 2; RETURN END ; - fdnew := Unix.Open(new, Unix.rdwr + Unix.creat + Unix.trunc, {2, 4,5, 7,8}); - IF fdnew < 0 THEN r := Unix.Close(fdold); res := 3; RETURN END ; - n := Unix.Read(fdold, SYSTEM.ADR(buf), bufsize); - WHILE n > 0 DO - r := Unix.Write(fdnew, SYSTEM.ADR(buf), n); - IF r < 0 THEN errno := Unix.errno(); r := Unix.Close(fdold); r := Unix.Close(fdnew); - Err("cannot move file", NIL, errno) - END ; - n := Unix.Read(fdold, SYSTEM.ADR(buf), bufsize) - END ; - errno := Unix.errno(); - r := Unix.Close(fdold); r := Unix.Close(fdnew); - IF n = 0 THEN r := Unix.Unlink(old); res := 0 - ELSE Err("cannot move file", NIL, errno) - END ; - ELSE RETURN (* res is Unix.Rename return code *) - END - END ; - res := 0 - ELSE res := 2 (* old file not found *) - END - END Rename; - - PROCEDURE Register* (f: File); - VAR idx, errno: INTEGER; f1: File; file: ARRAY 104 OF CHAR; - BEGIN - IF (f.state = create) & (f.registerName # "") THEN f.state := close (* shortcut renaming *) END ; - Close(f); - IF f.registerName # "" THEN - Rename(f.workName, f.registerName, errno); - IF errno # 0 THEN COPY(f.registerName, file); HALT(99) END ; - f.workName := f.registerName; f.registerName := ""; f.tempFile := FALSE - END - END Register; - - PROCEDURE ChangeDirectory*(path: ARRAY OF CHAR; VAR res: INTEGER); - BEGIN - res := SHORT(Unix.Chdir(path)); - getcwd(Kernel.CWD) - END ChangeDirectory; - - PROCEDURE FlipBytes(VAR src, dest: ARRAY OF SYSTEM.BYTE); - VAR i, j: LONGINT; - BEGIN - IF ~Kernel.littleEndian THEN i := LEN(src); j := 0; - WHILE i > 0 DO DEC(i); dest[j] := src[i]; INC(j) END - ELSE SYSTEM.MOVE(SYSTEM.ADR(src), SYSTEM.ADR(dest), LEN(src)) - END - END FlipBytes; - - PROCEDURE ReadBool* (VAR R: Rider; VAR x: BOOLEAN); - BEGIN Read(R, SYSTEM.VAL(CHAR, x)) - END ReadBool; - - PROCEDURE ReadInt* (VAR R: Rider; VAR x: INTEGER); - VAR b: ARRAY 2 OF CHAR; - BEGIN ReadBytes(R, b, 2); - x := ORD(b[0]) + ORD(b[1])*256 - END ReadInt; - - PROCEDURE ReadLInt* (VAR R: Rider; VAR x: LONGINT); - VAR b: ARRAY 4 OF CHAR; - BEGIN ReadBytes(R, b, 4); - x := ORD(b[0]) + ORD(b[1])*100H + ORD(b[2])*10000H + ORD(b[3])*1000000H - END ReadLInt; - - PROCEDURE ReadSet* (VAR R: Rider; VAR x: SET); - VAR b: ARRAY 4 OF CHAR; - BEGIN ReadBytes(R, b, 4); - x := SYSTEM.VAL(SET, ORD(b[0]) + ORD(b[1])*100H + ORD(b[2])*10000H + ORD(b[3])*1000000H) - END ReadSet; - - PROCEDURE ReadReal* (VAR R: Rider; VAR x: REAL); - VAR b: ARRAY 4 OF CHAR; - BEGIN ReadBytes(R, b, 4); FlipBytes(b, x) - END ReadReal; - - PROCEDURE ReadLReal* (VAR R: Rider; VAR x: LONGREAL); - VAR b: ARRAY 8 OF CHAR; - BEGIN ReadBytes(R, b, 8); FlipBytes(b, x) - END ReadLReal; - - PROCEDURE ReadString* (VAR R: Rider; VAR x: ARRAY OF CHAR); - VAR i: INTEGER; ch: CHAR; - BEGIN i := 0; - REPEAT Read(R, ch); x[i] := ch; INC(i) UNTIL ch = 0X - END ReadString; - - (* need to read line; -- noch *) - PROCEDURE ReadLine* (VAR R: Rider; VAR x: ARRAY OF CHAR); - VAR i: INTEGER; ch: CHAR; b : BOOLEAN; - BEGIN i := 0; - b := FALSE; - REPEAT - Read(R, ch); - IF ((ch = 0X) OR (ch = 0AX) OR (ch = 0DX)) THEN - b := TRUE - ELSE - x[i] := ch; - INC(i); - END; - UNTIL b - END ReadLine; - - PROCEDURE ReadNum* (VAR R: Rider; VAR x: LONGINT); - VAR s: SHORTINT; ch: CHAR; n: LONGINT; - BEGIN s := 0; n := 0; Read(R, ch); - WHILE ORD(ch) >= 128 DO INC(n, ASH(ORD(ch) - 128, s) ); INC(s, 7); Read(R, ch) END; - INC(n, ASH(ORD(ch) MOD 64 - ORD(ch) DIV 64 * 64, s) ); - x := n - END ReadNum; - - PROCEDURE WriteBool* (VAR R: Rider; x: BOOLEAN); - BEGIN Write(R, SYSTEM.VAL(CHAR, x)) - END WriteBool; - - PROCEDURE WriteInt* (VAR R: Rider; x: INTEGER); - VAR b: ARRAY 2 OF CHAR; - BEGIN b[0] := CHR(x); b[1] := CHR(x DIV 256); - WriteBytes(R, b, 2); - END WriteInt; - - PROCEDURE WriteLInt* (VAR R: Rider; x: LONGINT); - VAR b: ARRAY 4 OF CHAR; - BEGIN - b[0] := CHR(x); b[1] := CHR(x DIV 100H); b[2] := CHR(x DIV 10000H); b[3] := CHR(x DIV 1000000H); - WriteBytes(R, b, 4); - END WriteLInt; - - PROCEDURE WriteSet* (VAR R: Rider; x: SET); - VAR b: ARRAY 4 OF CHAR; i: LONGINT; - BEGIN i := SYSTEM.VAL(LONGINT, x); - 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; - - PROCEDURE WriteReal* (VAR R: Rider; x: REAL); - VAR b: ARRAY 4 OF CHAR; - BEGIN FlipBytes(x, b); WriteBytes(R, b, 4) - END WriteReal; - - PROCEDURE WriteLReal* (VAR R: Rider; x: LONGREAL); - VAR b: ARRAY 8 OF CHAR; - BEGIN FlipBytes(x, b); WriteBytes(R, b, 8) - END WriteLReal; - - PROCEDURE WriteString* (VAR R: Rider; x: ARRAY [1] OF CHAR); - VAR i: INTEGER; - BEGIN i := 0; - WHILE x[i] # 0X DO INC(i) END ; - WriteBytes(R, x, i+1) - END WriteString; - - PROCEDURE WriteNum* (VAR R: Rider; x: LONGINT); - BEGIN - WHILE (x < - 64) OR (x > 63) DO Write(R, CHR(x MOD 128 + 128)); x := x DIV 128 END; - Write(R, CHR(x MOD 128)) - END WriteNum; - - PROCEDURE GetName*(f: File; VAR name: ARRAY OF CHAR); - BEGIN - COPY (f.workName, name); - END GetName; - - PROCEDURE Finalize(o: SYSTEM.PTR); - VAR f: File; res: LONGINT; - BEGIN - f := SYSTEM.VAL(File, o); - IF f.fd >= 0 THEN - fileTab[f.fd] := 0; res := Unix.Close(f.fd); f.fd := -1; DEC(Kernel.nofiles); - IF f.tempFile THEN res := Unix.Unlink(f.workName) END - END - END Finalize; - - PROCEDURE Init; - VAR i: LONGINT; - BEGIN - i := 0; WHILE i < fileTabSize DO fileTab[i] := 0; INC(i) END ; - tempno := -1; Kernel.nofiles := 0 - END Init; - -BEGIN Init -END Files. diff --git a/src/system/linux/gcc/powerpc/Files0.Mod b/src/system/linux/gcc/powerpc/Files0.Mod deleted file mode 100644 index 4f021ede..00000000 --- a/src/system/linux/gcc/powerpc/Files0.Mod +++ /dev/null @@ -1,635 +0,0 @@ -MODULE Files0; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files *) - -(* this module is not for use by developers and inteded to bootstrap voc *) -(* for general use import Files module *) - - IMPORT SYSTEM, Unix, Kernel := Kernel0, Args, Console; - - (* standard data type I/O - - little endian, - Sint:1, Int:2, Lint:4 - ORD({0}) = 1, - false = 0, true =1 - IEEE real format, - null terminated strings, - compact numbers according to M.Odersky *) - - - CONST - nofbufs = 4; - bufsize = 4096; - fileTabSize = 64; - noDesc = -1; - notDone = -1; - - (* file states *) - open = 0; create = 1; close = 2; - - - TYPE - FileName = ARRAY 101 OF CHAR; - File* = POINTER TO Handle; - Buffer = POINTER TO BufDesc; - - Handle = RECORD - workName, registerName: FileName; - tempFile: BOOLEAN; - dev, ino, mtime: LONGINT; - fd-, len, pos: LONGINT; - bufs: ARRAY nofbufs OF Buffer; - swapper, state: INTEGER - END ; - - BufDesc = RECORD - f: File; - chg: BOOLEAN; - org, size: LONGINT; - data: ARRAY bufsize OF SYSTEM.BYTE - END ; - - Rider* = RECORD - res*: LONGINT; - eof*: BOOLEAN; - buf: Buffer; - org, offset: LONGINT - END ; - - Time = POINTER TO TimeDesc; - TimeDesc = RECORD - sec*, min*, hour*, mday*, mon*, year*, wday*, isdst*, zone*, gmtoff*: LONGINT; -(* sec*, min*, hour*, mday*, mon*, year*, wday*, isdst*, zone*, gmtoff*: INTEGER;*) - END ; - - VAR - fileTab: ARRAY fileTabSize OF LONGINT (*=File*); - tempno: INTEGER; - -(* for localtime *) - PROCEDURE -includetime() - '#include "time.h"'; - - PROCEDURE -localtime(VAR clock: LONGINT): Time - "(Files0_Time) localtime(clock)"; - - PROCEDURE -getcwd(VAR cwd: Unix.Name) - "getcwd(cwd, cwd__len)"; - - PROCEDURE -IdxTrap "__HALT(-1)"; - - PROCEDURE^ Finalize(o: SYSTEM.PTR); - - PROCEDURE Err(s: ARRAY OF CHAR; f: File; errno: LONGINT); - BEGIN - Console.Ln; Console.String("-- "); Console.String(s); Console.String(": "); - IF f # NIL THEN - IF f.registerName # "" THEN Console.String(f.registerName) ELSE Console.String(f.workName) END - END ; - IF errno # 0 THEN Console.String(" errno = "); Console.Int(errno, 1) END ; - Console.Ln; - HALT(99) - END Err; - - PROCEDURE MakeFileName(dir, name: ARRAY OF CHAR; VAR dest: ARRAY OF CHAR); - VAR i, j: INTEGER; - BEGIN i := 0; j := 0; - WHILE dir[i] # 0X DO dest[i] := dir[i]; INC(i) END ; - IF dest[i-1] # "/" THEN dest[i] := "/"; INC(i) END ; - WHILE name[j] # 0X DO dest[i] := name[j]; INC(i); INC(j) END ; - dest[i] := 0X - END MakeFileName; - - PROCEDURE GetTempName(finalName: ARRAY OF CHAR; VAR name: ARRAY OF CHAR); - VAR n, i, j: LONGINT; - BEGIN - INC(tempno); n := tempno; i := 0; - IF finalName[0] # "/" THEN (* relative pathname *) - WHILE Kernel.CWD[i] # 0X DO name[i] := Kernel.CWD[i]; INC(i) END; - IF Kernel.CWD[i-1] # "/" THEN name[i] := "/"; INC(i) END - END; - j := 0; - WHILE finalName[j] # 0X DO name[i] := finalName[j]; INC(i); INC(j) END; - DEC(i); - WHILE name[i] # "/" DO DEC(i) END; - name[i+1] := "."; name[i+2] := "t"; name[i+3] := "m"; name[i+4] := "p"; name[i+5] := "."; INC(i, 6); - WHILE n > 0 DO name[i] := CHR(n MOD 10 + ORD("0")); n := n DIV 10; INC(i) END; - name[i] := "."; INC(i); n := SHORT(Unix.Getpid()); - WHILE n > 0 DO name[i] := CHR(n MOD 10 + ORD("0")); n := n DIV 10; INC(i) END; - name[i] := 0X - END GetTempName; - - PROCEDURE Create(f: File); - VAR stat: Unix.Status; done: BOOLEAN; - errno: LONGINT; err: ARRAY 32 OF CHAR; - BEGIN - IF f.fd = noDesc THEN - IF f.state = create THEN GetTempName(f.registerName, f.workName); f.tempFile := TRUE - ELSIF f.state = close THEN - f.workName := f.registerName; f.registerName := ""; f.tempFile := FALSE - END ; - errno := Unix.Unlink(f.workName); (*unlink first to avoid stale NFS handles and to avoid reuse of inodes*) - f.fd := Unix.Open(f.workName, Unix.rdwr + Unix.creat + Unix.trunc, {2, 4,5, 7,8}); - done := f.fd >= 0; errno := Unix.errno(); - IF (~done & ((errno = Unix.ENFILE) OR (errno = Unix.EMFILE))) OR (done & (f.fd >= fileTabSize)) THEN - IF done & (f.fd >= fileTabSize) THEN errno := Unix.Close(f.fd) END ; - Kernel.GC(TRUE); - f.fd := Unix.Open(f.workName, Unix.rdwr + Unix.creat + Unix.trunc, {2, 4,5, 7,8}); - done := f.fd >= 0 - END ; - IF done THEN - IF f.fd >= fileTabSize THEN errno := Unix.Close(f.fd); Err("too many files open", f, 0) - ELSE fileTab[f.fd] := SYSTEM.VAL(LONGINT, f); INC(Kernel.nofiles); Kernel.RegisterObject(f, Finalize); - f.state := open; f.pos := 0; errno := Unix.Fstat(f.fd, stat); - f.dev := stat.dev; f.ino := stat.ino; f.mtime := stat.mtime - END - ELSE errno := Unix.errno(); - IF errno = Unix.ENOENT THEN err := "no such directory" - ELSIF (errno = Unix.ENFILE) OR (errno = Unix.EMFILE) THEN err := "too many files open" - ELSE err := "file not created" - END ; - Err(err, f, errno) - END - END - END Create; - - PROCEDURE Flush(buf: Buffer); - VAR res: LONGINT; f: File; stat: Unix.Status; - BEGIN - IF buf.chg THEN f := buf.f; Create(f); - IF buf.org # f.pos THEN res := Unix.Lseek(f.fd, buf.org, 0) END ; - res := Unix.Write(f.fd, SYSTEM.ADR(buf.data), buf.size); - IF res < 0 THEN Err("error in writing file", f, Unix.errno()) END ; - f.pos := buf.org + buf.size; - buf.chg := FALSE; - res := Unix.Fstat(f.fd, stat); - f.mtime := stat.mtime - END - END Flush; - - PROCEDURE Close* (f: File); - VAR i, res: LONGINT; - BEGIN - IF (f.state # create) OR (f.registerName # "") THEN - Create(f); i := 0; - WHILE (i < nofbufs) & (f.bufs[i] # NIL) DO Flush(f.bufs[i]); INC(i) END ; - res := Unix.Fsync(f.fd); - IF res < 0 THEN Err("error in writing file", f, Unix.errno()) END - END - END Close; - - PROCEDURE Length* (f: File): LONGINT; - BEGIN RETURN f.len - END Length; - - PROCEDURE New* (name: ARRAY OF CHAR): File; - VAR f: File; - BEGIN - NEW(f); f.workName := ""; COPY(name, f.registerName); - f.fd := noDesc; f.state := create; f.len := 0; f.pos := 0; f.swapper := -1; (*all f.buf[i] = NIL*) - RETURN f - END New; - - PROCEDURE ScanPath(VAR pos: INTEGER; VAR dir: ARRAY OF CHAR); (* supports ~, ~user and blanks inside path *) - VAR i: INTEGER; ch: CHAR; home: ARRAY 256 OF CHAR; - BEGIN - i := 0; ch := Kernel.OBERON[pos]; - WHILE (ch = " ") OR (ch = ":") DO INC(pos); ch := Kernel.OBERON[pos] END ; - IF ch = "~" THEN - INC(pos); ch := Kernel.OBERON[pos]; - home := ""; Args.GetEnv("HOME", home); - WHILE home[i] # 0X DO dir[i] := home[i]; INC(i) END ; - IF (ch # "/") & (ch # 0X) & (ch # ":") & (ch # " ") THEN - WHILE (i > 0) & (dir[i-1] # "/") DO DEC(i) END - END - END ; - WHILE (ch # 0X) & (ch # ":") DO dir[i] := ch; INC(i); INC(pos); ch := Kernel.OBERON[pos] END ; - WHILE (i > 0) & (dir[i-1] = " ") DO DEC(i) END ; - dir[i] := 0X - END ScanPath; - - PROCEDURE HasDir(VAR name: ARRAY OF CHAR): BOOLEAN; - VAR i: INTEGER; ch: CHAR; - BEGIN i := 0; ch := name[0]; - WHILE (ch # 0X) & (ch # "/") DO INC(i); ch := name[i] END ; - RETURN ch = "/" - END HasDir; - - PROCEDURE CacheEntry(dev, ino: LONGINT; mtime: LONGINT): File; - VAR f: File; i: INTEGER; stat: Unix.Status; res: LONGINT; - BEGIN i := 0; - WHILE i < fileTabSize DO - f := SYSTEM.VAL(File, fileTab[i]); - IF (f # NIL) & (ino = f.ino) & (dev = f.dev) THEN - IF mtime # f.mtime THEN i := 0; - WHILE i < nofbufs DO - IF f.bufs[i] # NIL THEN f.bufs[i].org := -1; f.bufs[i] := NIL END ; - INC(i) - END ; - f.swapper := -1; f.mtime := mtime; - res := Unix.Fstat(f.fd, stat); f.len := stat.size - END ; - RETURN f - END ; - INC(i) - END ; - RETURN NIL - END CacheEntry; - - PROCEDURE Old* (name: ARRAY OF CHAR): File; - VAR f: File; fd, res, errno: LONGINT; pos: INTEGER; done: BOOLEAN; - dir, path: ARRAY 256 OF CHAR; - stat: Unix.Status; - BEGIN - IF name # "" THEN - IF HasDir(name) THEN dir := ""; COPY(name, path) - ELSE pos := 0; ScanPath(pos, dir); MakeFileName(dir, name, path); ScanPath(pos, dir) - END ; - LOOP - fd := Unix.Open(path, Unix.rdwr, {}); done := fd >= 0; errno := Unix.errno(); - IF (~done & ((errno = Unix.ENFILE) OR (errno = Unix.EMFILE))) OR (done & (fd >= fileTabSize)) THEN - IF done & (fd >= fileTabSize) THEN res := Unix.Close(fd) END ; - Kernel.GC(TRUE); - fd := Unix.Open(path, Unix.rdwr, {}); - done := fd >= 0; errno := Unix.errno(); - IF ~done & ((errno = Unix.ENFILE) OR (errno = Unix.EMFILE)) THEN Err("too many files open", f, errno) END - END ; - IF ~done & ((errno = Unix.EACCES) OR (errno = Unix.EROFS) OR (errno = Unix.EAGAIN)) THEN - (* errno EAGAIN observed on Solaris 2.4 *) - fd := Unix.Open(path, Unix.rdonly, {}); done := fd >= 0; errno := Unix.errno() - END ; -IF (~done) & (errno # Unix.ENOENT) THEN - Console.String("warning Files0.Old "); Console.String(name); - Console.String(" errno = "); Console.Int(errno, 0); Console.Ln; -END ; - IF done THEN - res := Unix.Fstat(fd, stat); - f := CacheEntry(stat.dev, stat.ino, stat.mtime); - IF f # NIL THEN res := Unix.Close(fd); RETURN f - ELSIF fd >= fileTabSize THEN res := Unix.Close(fd); Err("too many files open", f, 0) - ELSE NEW(f); fileTab[fd] := SYSTEM.VAL(LONGINT, f); INC(Kernel.nofiles); Kernel.RegisterObject(f, Finalize); - f.fd := fd; f.state := open; f.len := stat.size; f.pos := 0; f.swapper := -1; (*all f.buf[i] = NIL*) - COPY(name, f.workName); f.registerName := ""; f.tempFile := FALSE; - f.dev := stat.dev; f.ino := stat.ino; f.mtime := stat.mtime; - RETURN f - END - ELSIF dir = "" THEN RETURN NIL - ELSE MakeFileName(dir, name, path); ScanPath(pos, dir) - END - END - ELSE RETURN NIL - END - END Old; - - PROCEDURE Purge* (f: File); - VAR i: INTEGER; stat: Unix.Status; res: LONGINT; - BEGIN i := 0; - WHILE i < nofbufs DO - IF f.bufs[i] # NIL THEN f.bufs[i].org := -1; f.bufs[i] := NIL END ; - INC(i) - END ; - IF f.fd # noDesc THEN res := Unix.Ftruncate(f.fd, 0); res := Unix.Lseek(f.fd, 0, 0) END ; - f.pos := 0; f.len := 0; f.swapper := -1; - res := Unix.Fstat(f.fd, stat); f.mtime := stat.mtime - END Purge; - - PROCEDURE GetDate* (f: File; VAR t, d: LONGINT); - VAR stat: Unix.Status; clock, res: LONGINT; time: Time; - BEGIN - Create(f); res := Unix.Fstat(f.fd, stat); - time := localtime(stat.mtime); - t := time.sec + ASH(time.min, 6) + ASH(time.hour, 12); - d := time.mday + ASH(time.mon+1, 5) + ASH(time.year MOD 100, 9) - END GetDate; - - PROCEDURE Pos* (VAR r: Rider): LONGINT; - BEGIN RETURN r.org + r.offset - END Pos; - - PROCEDURE Set* (VAR r: Rider; f: File; pos: LONGINT); - VAR org, offset, i, n, res: LONGINT; buf: Buffer; - BEGIN - IF f # NIL THEN - IF pos > f.len THEN pos := f.len ELSIF pos < 0 THEN pos := 0 END ; - offset := pos MOD bufsize; org := pos - offset; i := 0; - WHILE (i < nofbufs) & (f.bufs[i] # NIL) & (org # f.bufs[i].org) DO INC(i) END ; - IF i < nofbufs THEN - IF f.bufs[i] = NIL THEN NEW(buf); buf.chg := FALSE; buf.org := -1; buf.f := f; f.bufs[i] := buf - ELSE buf := f.bufs[i] - END - ELSE - f.swapper := (f.swapper + 1) MOD nofbufs; - buf := f.bufs[f.swapper]; - Flush(buf) - END ; - IF buf.org # org THEN - IF org = f.len THEN buf.size := 0 - ELSE Create(f); - IF f.pos # org THEN res := Unix.Lseek(f.fd, org, 0) END ; - n := Unix.ReadBlk(f.fd, buf.data); - IF n < 0 THEN Err("read from file not done", f, Unix.errno()) END ; - f.pos := org + n; - buf.size := n - END ; - buf.org := org; buf.chg := FALSE - END - ELSE buf := NIL; org := 0; offset := 0 - END ; - r.buf := buf; r.org := org; r.offset := offset; r.eof := FALSE; r.res := 0 - END Set; - - PROCEDURE Read* (VAR r: Rider; VAR x: SYSTEM.BYTE); - VAR offset: LONGINT; buf: Buffer; - BEGIN - buf := r.buf; offset := r.offset; - IF r.org # buf.org THEN Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset END ; - IF (offset < buf.size) THEN - x := buf.data[offset]; r.offset := offset + 1 - ELSIF r.org + offset < buf.f.len THEN - Set(r, r.buf.f, r.org + offset); - x := r.buf.data[0]; r.offset := 1 - ELSE - x := 0X; r.eof := TRUE - END - END Read; - - PROCEDURE ReadBytes* (VAR r: Rider; VAR x: ARRAY OF SYSTEM.BYTE; n: LONGINT); - VAR xpos, min, restInBuf, offset: LONGINT; buf: Buffer; - BEGIN - IF n > LEN(x) THEN IdxTrap END ; - xpos := 0; buf := r.buf; offset := r.offset; - WHILE n > 0 DO - IF (r.org # buf.org) OR (offset >= bufsize) THEN - Set(r, buf.f, r.org + offset); - buf := r.buf; offset := r.offset - END ; - restInBuf := buf.size - offset; - IF restInBuf = 0 THEN r.res := n; r.eof := TRUE; RETURN - ELSIF n > restInBuf THEN min := restInBuf ELSE min := n END ; - SYSTEM.MOVE(SYSTEM.ADR(buf.data) + offset, SYSTEM.ADR(x) + xpos, min); - INC(offset, min); r.offset := offset; INC(xpos, min); DEC(n, min) - END ; - r.res := 0; r.eof := FALSE - END ReadBytes; - - PROCEDURE ReadByte* (VAR r : Rider; VAR x : ARRAY OF SYSTEM.BYTE); - BEGIN - ReadBytes(r, x, 1); - END ReadByte; - - PROCEDURE Base* (VAR r: Rider): File; - BEGIN RETURN r.buf.f - END Base; - - PROCEDURE Write* (VAR r: Rider; x: SYSTEM.BYTE); - VAR buf: Buffer; offset: LONGINT; - BEGIN - buf := r.buf; offset := r.offset; - IF (r.org # buf.org) OR (offset >= bufsize) THEN - Set(r, buf.f, r.org + offset); - buf := r.buf; offset := r.offset - END ; - buf.data[offset] := x; - buf.chg := TRUE; - IF offset = buf.size THEN - INC(buf.size); INC(buf.f.len) - END ; - r.offset := offset + 1; r.res := 0 - END Write; - - PROCEDURE WriteBytes* (VAR r: Rider; VAR x: ARRAY OF SYSTEM.BYTE; n: LONGINT); - VAR xpos, min, restInBuf, offset: LONGINT; buf: Buffer; - BEGIN - IF n > LEN(x) THEN IdxTrap END ; - xpos := 0; buf := r.buf; offset := r.offset; - WHILE n > 0 DO - IF (r.org # buf.org) OR (offset >= bufsize) THEN - Set(r, buf.f, r.org + offset); - buf := r.buf; offset := r.offset - END ; - restInBuf := bufsize - offset; - IF n > restInBuf THEN min := restInBuf ELSE min := n END ; - SYSTEM.MOVE(SYSTEM.ADR(x) + xpos, SYSTEM.ADR(buf.data) + offset, min); - INC(offset, min); r.offset := offset; - IF offset > buf.size THEN INC(buf.f.len, offset - buf.size); buf.size := offset END ; - INC(xpos, min); DEC(n, min); buf.chg := TRUE - END ; - r.res := 0 - END WriteBytes; - -(* another solution would be one that is similar to ReadBytes, WriteBytes. -No code duplication, more symmetric, only two ifs for -Read and Write in buffer, buf.size replaced by bufsize in Write ops, buf.size and len -must be made consistent with offset (if offset > buf.size) in a lazy way. - -PROCEDURE Write* (VAR r: Rider; x: SYSTEM.BYTE); - VAR buf: Buffer; offset: LONGINT; -BEGIN - buf := r.buf; offset := r.offset; - IF (offset >= bufsize) OR (r.org # buf.org) THEN - Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset; - END ; - buf.data[offset] := x; r.offset := offset + 1; buf.chg := TRUE -END Write; - -PROCEDURE WriteBytes ... - -PROCEDURE Read* (VAR r: Rider; VAR x: SYSTEM.BYTE); - VAR offset: LONGINT; buf: Buffer; -BEGIN - buf := r.buf; offset := r.offset; - IF (offset >= buf.size) OR (r.org # buf.org) THEN - IF r.org + offset >= buf.f.len THEN x := 0X; r.eof := TRUE; RETURN - ELSE Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset - END - END ; - x := buf.data[offset]; r.offset := offset + 1 -END Read; - -but this would also affect Set, Length, and Flush. -Especially Length would become fairly complex. -*) - - PROCEDURE Delete* (name: ARRAY OF CHAR; VAR res: INTEGER); - BEGIN - res := SHORT(Unix.Unlink(name)); - res := SHORT(Unix.errno()) - END Delete; - - PROCEDURE Rename* (old, new: ARRAY OF CHAR; VAR res: INTEGER); - VAR fdold, fdnew, n, errno, r: LONGINT; - ostat, nstat: Unix.Status; - buf: ARRAY 4096 OF CHAR; - BEGIN - r := Unix.Stat(old, ostat); - IF r >= 0 THEN - r := Unix.Stat(new, nstat); - IF (r >= 0) & ((ostat.dev # nstat.dev) OR (ostat.ino # nstat.ino)) THEN - Delete(new, res); (* work around stale nfs handles *) - END ; - r := Unix.Rename(old, new); - IF r < 0 THEN res := SHORT(Unix.errno()); - IF res = Unix.EXDEV THEN (* cross device link, move the file *) - fdold := Unix.Open(old, Unix.rdonly, {}); - IF fdold < 0 THEN res := 2; RETURN END ; - fdnew := Unix.Open(new, Unix.rdwr + Unix.creat + Unix.trunc, {2, 4,5, 7,8}); - IF fdnew < 0 THEN r := Unix.Close(fdold); res := 3; RETURN END ; - n := Unix.Read(fdold, SYSTEM.ADR(buf), bufsize); - WHILE n > 0 DO - r := Unix.Write(fdnew, SYSTEM.ADR(buf), n); - IF r < 0 THEN errno := Unix.errno(); r := Unix.Close(fdold); r := Unix.Close(fdnew); - Err("cannot move file", NIL, errno) - END ; - n := Unix.Read(fdold, SYSTEM.ADR(buf), bufsize) - END ; - errno := Unix.errno(); - r := Unix.Close(fdold); r := Unix.Close(fdnew); - IF n = 0 THEN r := Unix.Unlink(old); res := 0 - ELSE Err("cannot move file", NIL, errno) - END ; - ELSE RETURN (* res is Unix.Rename return code *) - END - END ; - res := 0 - ELSE res := 2 (* old file not found *) - END - END Rename; - - PROCEDURE Register* (f: File); - VAR idx, errno: INTEGER; f1: File; file: ARRAY 104 OF CHAR; - BEGIN - IF (f.state = create) & (f.registerName # "") THEN f.state := close (* shortcut renaming *) END ; - Close(f); - IF f.registerName # "" THEN - Rename(f.workName, f.registerName, errno); - IF errno # 0 THEN COPY(f.registerName, file); HALT(99) END ; - f.workName := f.registerName; f.registerName := ""; f.tempFile := FALSE - END - END Register; - - PROCEDURE ChangeDirectory*(path: ARRAY OF CHAR; VAR res: INTEGER); - BEGIN - res := SHORT(Unix.Chdir(path)); - getcwd(Kernel.CWD) - END ChangeDirectory; - - PROCEDURE FlipBytes(VAR src, dest: ARRAY OF SYSTEM.BYTE); - VAR i, j: LONGINT; - BEGIN - IF ~Kernel.littleEndian THEN i := LEN(src); j := 0; - WHILE i > 0 DO DEC(i); dest[j] := src[i]; INC(j) END - ELSE SYSTEM.MOVE(SYSTEM.ADR(src), SYSTEM.ADR(dest), LEN(src)) - END - END FlipBytes; - - PROCEDURE ReadBool* (VAR R: Rider; VAR x: BOOLEAN); - BEGIN Read(R, SYSTEM.VAL(CHAR, x)) - END ReadBool; - - PROCEDURE ReadInt* (VAR R: Rider; VAR x: INTEGER); - VAR b: ARRAY 2 OF CHAR; - BEGIN ReadBytes(R, b, 2); - x := ORD(b[0]) + ORD(b[1])*256 - END ReadInt; - - PROCEDURE ReadLInt* (VAR R: Rider; VAR x: LONGINT); - VAR b: ARRAY 4 OF CHAR; - BEGIN ReadBytes(R, b, 4); - x := ORD(b[0]) + ORD(b[1])*100H + ORD(b[2])*10000H + ORD(b[3])*1000000H - END ReadLInt; - - PROCEDURE ReadSet* (VAR R: Rider; VAR x: SET); - VAR b: ARRAY 4 OF CHAR; - BEGIN ReadBytes(R, b, 4); - x := SYSTEM.VAL(SET, ORD(b[0]) + ORD(b[1])*100H + ORD(b[2])*10000H + ORD(b[3])*1000000H) - END ReadSet; - - PROCEDURE ReadReal* (VAR R: Rider; VAR x: REAL); - VAR b: ARRAY 4 OF CHAR; - BEGIN ReadBytes(R, b, 4); FlipBytes(b, x) - END ReadReal; - - PROCEDURE ReadLReal* (VAR R: Rider; VAR x: LONGREAL); - VAR b: ARRAY 8 OF CHAR; - BEGIN ReadBytes(R, b, 8); FlipBytes(b, x) - END ReadLReal; - - PROCEDURE ReadString* (VAR R: Rider; VAR x: ARRAY OF CHAR); - VAR i: INTEGER; ch: CHAR; - BEGIN i := 0; - REPEAT Read(R, ch); x[i] := ch; INC(i) UNTIL ch = 0X - END ReadString; - - PROCEDURE ReadNum* (VAR R: Rider; VAR x: LONGINT); - VAR s: SHORTINT; ch: CHAR; n: LONGINT; - BEGIN s := 0; n := 0; Read(R, ch); - WHILE ORD(ch) >= 128 DO INC(n, ASH(ORD(ch) - 128, s) ); INC(s, 7); Read(R, ch) END; - INC(n, ASH(ORD(ch) MOD 64 - ORD(ch) DIV 64 * 64, s) ); - x := n - END ReadNum; - - PROCEDURE WriteBool* (VAR R: Rider; x: BOOLEAN); - BEGIN Write(R, SYSTEM.VAL(CHAR, x)) - END WriteBool; - - PROCEDURE WriteInt* (VAR R: Rider; x: INTEGER); - VAR b: ARRAY 2 OF CHAR; - BEGIN b[0] := CHR(x); b[1] := CHR(x DIV 256); - WriteBytes(R, b, 2); - END WriteInt; - - PROCEDURE WriteLInt* (VAR R: Rider; x: LONGINT); - VAR b: ARRAY 4 OF CHAR; - BEGIN - b[0] := CHR(x); b[1] := CHR(x DIV 100H); b[2] := CHR(x DIV 10000H); b[3] := CHR(x DIV 1000000H); - WriteBytes(R, b, 4); - END WriteLInt; - - PROCEDURE WriteSet* (VAR R: Rider; x: SET); - VAR b: ARRAY 4 OF CHAR; i: LONGINT; - BEGIN i := SYSTEM.VAL(LONGINT, x); - 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; - - PROCEDURE WriteReal* (VAR R: Rider; x: REAL); - VAR b: ARRAY 4 OF CHAR; - BEGIN FlipBytes(x, b); WriteBytes(R, b, 4) - END WriteReal; - - PROCEDURE WriteLReal* (VAR R: Rider; x: LONGREAL); - VAR b: ARRAY 8 OF CHAR; - BEGIN FlipBytes(x, b); WriteBytes(R, b, 8) - END WriteLReal; - - PROCEDURE WriteString* (VAR R: Rider; x: ARRAY [1] OF CHAR); - VAR i: INTEGER; - BEGIN i := 0; - WHILE x[i] # 0X DO INC(i) END ; - WriteBytes(R, x, i+1) - END WriteString; - - PROCEDURE WriteNum* (VAR R: Rider; x: LONGINT); - BEGIN - WHILE (x < - 64) OR (x > 63) DO Write(R, CHR(x MOD 128 + 128)); x := x DIV 128 END; - Write(R, CHR(x MOD 128)) - END WriteNum; - - PROCEDURE Finalize(o: SYSTEM.PTR); - VAR f: File; res: LONGINT; - BEGIN - f := SYSTEM.VAL(File, o); - IF f.fd >= 0 THEN - fileTab[f.fd] := 0; res := Unix.Close(f.fd); f.fd := -1; DEC(Kernel.nofiles); - IF f.tempFile THEN res := Unix.Unlink(f.workName) END - END - END Finalize; - - PROCEDURE Init; - VAR i: LONGINT; - BEGIN - i := 0; WHILE i < fileTabSize DO fileTab[i] := 0; INC(i) END ; - tempno := -1; Kernel.nofiles := 0 - END Init; - -BEGIN Init -END Files0. diff --git a/src/system/linux/gcc/powerpc/SYSTEM.c0 b/src/system/linux/gcc/powerpc/SYSTEM.c0 deleted file mode 100644 index 580449aa..00000000 --- a/src/system/linux/gcc/powerpc/SYSTEM.c0 +++ /dev/null @@ -1,205 +0,0 @@ -/* -* The body prefix file of the Ofront runtime system, Version 1.0 -* -* Copyright (c) Software Templ, 1994, 1995 -* -* Module SYSTEM is subject to change any time without prior notification. -* Software Templ disclaims all warranties with regard to module SYSTEM, -* in particular shall Software Templ not be liable for any damage resulting -* from inappropriate use or modification of module SYSTEM. -* -* Version 1.1 jt, 24.11.95 fixes for correct pointer arithmetic on Cray computers -* jt 31.1.2007 ANSI prototypes for malloc and exit in order to avoid cc warnings -* -*/ - -#include "SYSTEM.h" -#ifdef __STDC__ -#include "stdarg.h" -#else -#include "varargs.h" -#endif - -extern void *malloc(long size); -extern void exit(int status); - -void (*SYSTEM_Halt)(); -LONGINT SYSTEM_halt; /* x in HALT(x) */ -LONGINT SYSTEM_assert; /* x in ASSERT(cond, x) */ -LONGINT SYSTEM_argc; -LONGINT SYSTEM_argv; -LONGINT SYSTEM_lock; -BOOLEAN SYSTEM_interrupted; -static LONGINT SYSTEM_mainfrm; /* adr of main proc stack frame, used for stack collection */ - -#define Lock SYSTEM_lock++ -#define Unlock SYSTEM_lock--; if (SYSTEM_interrupted && (SYSTEM_lock == 0)) __HALT(-9) - - -static void SYSTEM_InitHeap(); -void *SYSTEM__init(); - -void SYSTEM_INIT(argc, argvadr) - int argc; long argvadr; -{ - SYSTEM_mainfrm = argvadr; - SYSTEM_argc = argc; - SYSTEM_argv = *(long*)argvadr; - SYSTEM_InitHeap(); - SYSTEM_halt = -128; - SYSTEM__init(); -} - -void SYSTEM_FINI() -{ - SYSTEM_FINALL(); -} - -long SYSTEM_XCHK(i, ub) long i, ub; {return __X(i, ub);} -long SYSTEM_RCHK(i, ub) long i, ub; {return __R(i, ub);} -long SYSTEM_ASH(i, n) long i, n; {return __ASH(i, n);} -long SYSTEM_ABS(i) long i; {return __ABS(i);} -double SYSTEM_ABSD(i) double i; {return __ABS(i);} - -void SYSTEM_INHERIT(t, t0) - long *t, *t0; -{ - t -= __TPROC0OFF; - t0 -= __TPROC0OFF; - while (*t0 != __EOM) {*t = *t0; t--; t0--;} -} - -void SYSTEM_ENUMP(adr, n, P) - long *adr; - long n; - void (*P)(); -{ - while (n > 0) {P(*adr); adr++; n--;} -} - -void SYSTEM_ENUMR(adr, typ, size, n, P) - char *adr; - long *typ, size, n; - void (*P)(); -{ - long *t, off; - typ++; - while (n > 0) { - t = typ; - off = *t; - while (off >= 0) {P(*(long*)(adr+off)); t++; off = *t;} - adr += size; n--; - } -} - -long SYSTEM_DIV(x, y) - unsigned long x, y; -{ if ((long) x >= 0) return (x / y); - else return -((y - 1 - x) / y); -} - -long SYSTEM_MOD(x, y) - unsigned long x, y; -{ unsigned long m; - if ((long) x >= 0) return (x % y); - else { m = (-x) % y; - if (m != 0) return (y - m); else return 0; - } -} - -long SYSTEM_ENTIER(x) - double x; -{ - long y; - if (x >= 0) - return (long)x; - else { - y = (long)x; - if (y <= x) return y; else return y - 1; - } -} - -void SYSTEM_HALT(n) - int n; -{ - SYSTEM_halt = n; - if (SYSTEM_Halt!=0) SYSTEM_Halt(n); - exit(n); -} - -#ifdef __STDC__ -SYSTEM_PTR SYSTEM_NEWARR(long *typ, long elemsz, int elemalgn, int nofdim, int nofdyn, ...) -#else -SYSTEM_PTR SYSTEM_NEWARR(typ, elemsz, elemalgn, nofdim, nofdyn, va_alist) - long *typ, elemsz; - int elemalgn, nofdim, nofdyn; - va_dcl -#endif -{ - long nofelems, size, dataoff, n, nptr, *x, *p, nofptrs, i, *ptab, off; - va_list ap; -#ifdef __STDC__ - va_start(ap, nofdyn); -#else - va_start(ap); -#endif - nofelems = 1; - while (nofdim > 0) { - nofelems = nofelems * va_arg(ap, long); nofdim--; - if (nofelems <= 0) __HALT(-20); - } - va_end(ap); - dataoff = nofdyn * sizeof(long); - if (elemalgn > sizeof(long)) { - n = dataoff % elemalgn; - if (n != 0) dataoff += elemalgn - n; - } - size = dataoff + nofelems * elemsz; - Lock; - if (typ == NIL) { - /* element typ does not contain pointers */ - x = SYSTEM_NEWBLK(size); - } - else if (typ == POINTER__typ) { - /* element type is a pointer */ - x = SYSTEM_NEWBLK(size + nofelems * sizeof(long)); - p = (long*)x[-1]; - p[-nofelems] = *p; /* build new type desc in situ: 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ - p -= nofelems - 1; n = 1; /* n =1 for skipping the size field */ - while (n <= nofelems) {*p = n*sizeof(long); p++; n++;} - *p = - (nofelems + 1) * sizeof(long); /* sentinel */ - x[-1] -= nofelems * sizeof(long); - } - else { - /* element type is a record that contains pointers */ - ptab = typ + 1; nofptrs = 0; - while (ptab[nofptrs] >= 0) {nofptrs++;} /* number of pointers per element */ - nptr = nofelems * nofptrs; /* total number of pointers */ - x = SYSTEM_NEWBLK(size + nptr * sizeof(long)); - p = (long*)x[- 1]; - p[-nptr] = *p; /* build new type desc in situ; 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ - p -= nptr - 1; n = 0; off = dataoff; - while (n < nofelems) {i = 0; - while (i < nofptrs) {*p = off + ptab[i]; p++; i++;} - off += elemsz; n++; - } - *p = - (nptr + 1) * sizeof(long); /* sentinel */ - x[-1] -= nptr * sizeof(long); - } - if (nofdyn != 0) { - /* setup len vector for index checks */ -#ifdef __STDC__ - va_start(ap, nofdyn); -#else - va_start(ap); -#endif - p = x; - while (nofdyn > 0) {*p = va_arg(ap, long); p++, nofdyn--;} - va_end(ap); - } - Unlock; - return x; -} - -/* ----------- end of SYSTEM.co ------------- */ - diff --git a/src/system/linux/gcc/powerpc/SYSTEM.h b/src/system/linux/gcc/powerpc/SYSTEM.h deleted file mode 100644 index ea9ae5d6..00000000 --- a/src/system/linux/gcc/powerpc/SYSTEM.h +++ /dev/null @@ -1,220 +0,0 @@ -#ifndef SYSTEM__h -#define SYSTEM__h - -/* - -the Ofront runtime system interface and macros library -copyright (c) Josef Templ, 1995, 1996 - -gcc for Linux version (same as SPARC/Solaris2) -uses double # as concatenation operator - -*/ - -#include -#include /* for type sizes -- noch */ - -//extern void *memcpy(void *dest, const void *src, long n); -extern void *memcpy(void *dest, const void *src, size_t n); -extern void *malloc(long size); -extern void exit(int status); - -#define export -#define import extern - -/* constants */ -#define __MAXEXT 16 -#define NIL 0L -#define POINTER__typ (long*)1L /* not NIL and not a valid type */ - -/* basic types */ -typedef char BOOLEAN; -typedef unsigned char CHAR; -typedef signed char SHORTINT; -typedef short int INTEGER; -typedef long LONGINT; -typedef float REAL; -typedef double LONGREAL; -typedef unsigned long SET; -typedef void *SYSTEM_PTR; -typedef unsigned char SYSTEM_BYTE; -typedef int8_t SYSTEM_INT8; -typedef int16_t SYSTEM_INT16; -typedef int32_t SYSTEM_INT32; -typedef int64_t SYSTEM_INT64; - -/* runtime system routines */ -extern long SYSTEM_DIV(); -extern long SYSTEM_MOD(); -extern long SYSTEM_ENTIER(); -extern long SYSTEM_ASH(); -extern long SYSTEM_ABS(); -extern long SYSTEM_XCHK(); -extern long SYSTEM_RCHK(); -extern double SYSTEM_ABSD(); -extern SYSTEM_PTR SYSTEM_NEWREC(); -extern SYSTEM_PTR SYSTEM_NEWBLK(); -#ifdef __STDC__ -extern SYSTEM_PTR SYSTEM_NEWARR(long*, long, int, int, int, ...); -#else -extern SYSTEM_PTR SYSTEM_NEWARR(); -#endif -extern SYSTEM_PTR SYSTEM_REGMOD(); -extern void SYSTEM_INCREF(); -extern void SYSTEM_REGCMD(); -extern void SYSTEM_REGTYP(); -extern void SYSTEM_REGFIN(); -extern void SYSTEM_FINALL(); -extern void SYSTEM_INIT(); -extern void SYSTEM_FINI(); -extern void SYSTEM_HALT(); -extern void SYSTEM_INHERIT(); -extern void SYSTEM_ENUMP(); -extern void SYSTEM_ENUMR(); - -/* module registry */ -#define __DEFMOD static void *m; if(m!=0)return m -#define __REGMOD(name, enum) if(m==0)m=SYSTEM_REGMOD((CHAR*)name,enum); else return m -#define __ENDMOD return m -#define __INIT(argc, argv) static void *m; SYSTEM_INIT(argc, (long)&argv); -#define __REGMAIN(name, enum) m=SYSTEM_REGMOD(name,enum) -#define __FINI SYSTEM_FINI(); return 0 -#define __IMPORT(name) SYSTEM_INCREF(name##__init()) -#define __REGCMD(name, cmd) SYSTEM_REGCMD(m, name, cmd) - -/* SYSTEM ops */ -#define __SYSNEW(p, len) p=SYSTEM_NEWBLK((long)(len)) -#define __VAL(t, x) (*(t*)&(x)) -#define __GET(a, x, t) x= *(t*)(a) -#define __PUT(a, x, t) *(t*)(a)=x -#define __LSHL(x, n, t) ((t)((unsigned)(x)<<(n))) -#define __LSHR(x, n, t) ((t)((unsigned)(x)>>(n))) -#define __LSH(x, n, t) ((n)>=0? __LSHL(x, n, t): __LSHR(x, -(n), t)) -#define __ROTL(x, n, t) ((t)((unsigned)(x)<<(n)|(unsigned)(x)>>(8*sizeof(t)-(n)))) -#define __ROTR(x, n, t) ((t)((unsigned)(x)>>(n)|(unsigned)(x)<<(8*sizeof(t)-(n)))) -#define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) -#define __BIT(x, n) (*(unsigned long*)(x)>>(n)&1) -#define __MOVE(s, d, n) memcpy((char*)(d),(char*)(s),n) - -/* std procs and operator mappings */ -#define __SHORT(x, y) ((int)((unsigned long)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) -#define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) -#define __CHR(x) ((CHAR)__R(x, 256)) -#define __CHRF(x) ((CHAR)__RF(x, 256)) -#define __DIV(x, y) ((x)>=0?(x)/(y):-(((y)-1-(x))/(y))) -#define __DIVF(x, y) SYSTEM_DIV((long)(x),(long)(y)) -#define __MOD(x, y) ((x)>=0?(x)%(y):__MODF(x,y)) -#define __MODF(x, y) SYSTEM_MOD((long)(x),(long)(y)) -#define __NEW(p, t) p=SYSTEM_NEWREC((long)t##__typ) -#define __NEWARR SYSTEM_NEWARR -#define __HALT(x) SYSTEM_HALT(x) -#define __ASSERT(cond, x) if (!(cond)) {SYSTEM_assert = x; SYSTEM_HALT(-1);} -#define __ENTIER(x) SYSTEM_ENTIER(x) -#define __ABS(x) (((x)<0)?-(x):(x)) -#define __ABSF(x) SYSTEM_ABS((long)(x)) -#define __ABSFD(x) SYSTEM_ABSD((double)(x)) -#define __CAP(ch) ((CHAR)((ch)&0x5f)) -#define __ODD(x) ((x)&1) -#define __IN(x, s) (((s)>>(x))&1) -#define __SETOF(x) ((SET)1<<(x)) -#define __SETRNG(l, h) ((~(SET)0<<(l))&~(SET)0>>(8*sizeof(SET)-1-(h))) -#define __MASK(x, m) ((x)&~(m)) -#define __COPY(s, d, n) {char*_a=(void*)s,*_b=(void*)d;long _i=0,_t=n-1;while(_i<_t&&((_b[_i]=_a[_i])!=0)){_i++;};_b[_i]=0;} -static int __STRCMP(x, y) - CHAR *x, *y; -{long i = 0; CHAR ch1, ch2; - do {ch1 = x[i]; ch2 = y[i]; i++; - if (!ch1) return -(int)ch2; - } while (ch1==ch2); - return (int)ch1 - (int)ch2; -} -#define __ASH(x, n) ((n)>=0?__ASHL(x,n):__ASHR(x,-(n))) -#define __ASHL(x, n) ((long)(x)<<(n)) -#define __ASHR(x, n) ((long)(x)>>(n)) -#define __ASHF(x, n) SYSTEM_ASH((long)(x), (long)(n)) -#define __DUP(x, l, t) x=(void*)memcpy(alloca(l*sizeof(t)),x,l*sizeof(t)) -#define __DUPARR(v, t) v=(void*)memcpy(v##__copy,v,sizeof(t)) -#define __DEL(x) /* DUP with alloca frees storage automatically */ -#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(long)typ##__typ) -#define __TYPEOF(p) (*(((long**)(p))-1)) -#define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) - -/* runtime checks */ -#define __X(i, ub) (((unsigned)(long)(i)<(unsigned long)(ub))?i:(__HALT(-2),0)) -#define __XF(i, ub) SYSTEM_XCHK((long)(i), (long)(ub)) -#define __RETCHK __retchk: __HALT(-3) -#define __CASECHK __HALT(-4) -#define __GUARDP(p, typ, level) ((typ*)(__ISP(p,typ,level)?p:(__HALT(-5),p))) -#define __GUARDR(r, typ, level) (*((typ*)(__IS(r##__typ,typ,level)?r:(__HALT(-5),r)))) -#define __GUARDA(p, typ, level) ((struct typ*)(__IS(__TYPEOF(p),typ,level)?p:(__HALT(-5),p))) -#define __GUARDEQR(p, dyntyp, typ) if(dyntyp!=typ##__typ) __HALT(-6);*(p) -#define __GUARDEQP(p, typ) if(__TYPEOF(p)!=typ##__typ)__HALT(-6);*(p) -#define __WITHCHK __HALT(-7) -#define __R(i, ub) (((unsigned)(long)(i)<(unsigned long)(ub))?i:(__HALT(-8),0)) -#define __RF(i, ub) SYSTEM_RCHK((long)(i),(long)(ub)) - -/* record type descriptors */ -#define __TDESC(t, m, n) \ - static struct t##__desc {\ - long tproc[m]; \ - long tag, next, level, module; \ - char name[24]; \ - long *base[__MAXEXT]; \ - char *rsrvd; \ - long blksz, ptr[n+1]; \ - } t##__desc - -#define __BASEOFF (__MAXEXT+1) -#define __TPROC0OFF (__BASEOFF+24/sizeof(long)+5) -#define __EOM 1 -#define __TDFLDS(name, size) {__EOM}, 1, 0, 0, 0, name, {0}, 0, size -#define __ENUMP(adr, n, P) SYSTEM_ENUMP(adr, (long)(n), P) -#define __ENUMR(adr, typ, size, n, P) SYSTEM_ENUMR(adr, typ, (long)(size), (long)(n), P) - -#define __INITYP(t, t0, level) \ - t##__typ= &t##__desc.blksz; \ - memcpy(t##__desc.base, t0##__typ - __BASEOFF, level*sizeof(long)); \ - t##__desc.base[level]=t##__typ; \ - t##__desc.module=(long)m; \ - if(t##__desc.blksz!=sizeof(struct t)) __HALT(-15); \ - t##__desc.blksz=(t##__desc.blksz+5*sizeof(long)-1)/(4*sizeof(long))*(4*sizeof(long)); \ - SYSTEM_REGTYP(m, (long)&t##__desc.next); \ - SYSTEM_INHERIT(t##__typ, t0##__typ) - -/* Oberon-2 type bound procedures support */ -#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(long)proc -#define __SEND(typ, num, funtyp, parlist) ((funtyp)(*(typ-(__TPROC0OFF+num))))parlist - -/* runtime system variables */ -extern LONGINT SYSTEM_argc; -extern LONGINT SYSTEM_argv; -extern void (*SYSTEM_Halt)(); -extern LONGINT SYSTEM_halt; -extern LONGINT SYSTEM_assert; -extern SYSTEM_PTR SYSTEM_modules; -extern LONGINT SYSTEM_heapsize; -extern LONGINT SYSTEM_allocated; -extern LONGINT SYSTEM_lock; -extern SHORTINT SYSTEM_gclock; -extern BOOLEAN SYSTEM_interrupted; - -/* ANSI prototypes; not used so far -static int __STRCMP(CHAR *x, CHAR *y); -void SYSTEM_INIT(int argc, long argvadr); -void SYSTEM_FINI(void); -long SYSTEM_XCHK(long i, long ub); -long SYSTEM_RCHK(long i, long ub); -long SYSTEM_ASH(long i, long n); -long SYSTEM_ABS(long i); -double SYSTEM_ABSD(double i); -void SYSTEM_INHERIT(long *t, long *t0); -void SYSTEM_ENUMP(long *adr, long n, void (*P)(void*)); -void SYSTEM_ENUMR(char *adr, long *typ, long size, long n, void (*P)(void*)); -long SYSTEM_DIV(unsigned long x, unsigned long y); -long SYSTEM_MOD(unsigned long x, unsigned long y); -long SYSTEM_ENTIER(double x); -void SYSTEM_HALT(int n); -*/ - -#endif - diff --git a/src/system/linux/gcc/powerpc/Unix.Mod b/src/system/linux/gcc/powerpc/Unix.Mod deleted file mode 100644 index 99c35a64..00000000 --- a/src/system/linux/gcc/powerpc/Unix.Mod +++ /dev/null @@ -1,465 +0,0 @@ -MODULE Unix; (* Josef Templ, 5.3.90 Linux system calls *) -(* system procedure added by noch *) -(* Module Unix provides a system call interface to Linux. - Naming conventions: - Procedure and Type-names always start with a capital letter. - error numbers as defined in Unix - other constants start with lower case letters *) - -IMPORT SYSTEM; - -CONST - -(* various important constants *) - - stdin* = 0; stdout* =1; stderr* = 2; - - LOCKEX* = 2; LOCKUN* = 8; (* /usr/include/file.h *) - AFINET* = 2; (* /usr/include/sys/socket.h *) - PFINET* = AFINET; (* /usr/include/linux/socket.h *) - SOCKSTREAM* = 1; (* /usr/include/linux/socket.h *) - FIONREAD* = 541BH; (* in /usr/include/asm/termios.h *) - SETFL* = 4; (* set file descriptor flags; in asm/fcntl.h *) - TCP* = 0; - -(* flag sets, cf. /usr/include/asm/fcntl.h *) - rdonly* = {}; wronly* = {0}; rdwr* = {1}; creat* = {6}; excl* = {7}; trunc* = {9}; append* = {10}; ndelay = {11}; - -(* error numbers *) - - EPERM* = 1; (* Not owner *) - ENOENT* = 2; (* No such file or directory *) - ESRCH* = 3; (* No such process *) - EINTR* = 4; (* Interrupted system call *) - EIO* = 5; (* I/O error *) - ENXIO* = 6; (* No such device or address *) - E2BIG* = 7; (* Arg list too long *) - ENOEXEC* = 8; (* Exec format error *) - EBADF* = 9; (* Bad file number *) - ECHILD* = 10; (* No children *) - EAGAIN* = 11; (* No more processes *) - ENOMEM* = 12; (* Not enough core *) - EACCES* = 13; (* Permission denied *) - EFAULT* = 14; (* Bad address *) - ENOTBLK* = 15; (* Block device required *) - EBUSY* = 16; (* Mount device busy *) - EEXIST* = 17; (* File exists *) - EXDEV* = 18; (* Cross-device link *) - ENODEV* = 19; (* No such device *) - ENOTDIR* = 20; (* Not a directory*) - EISDIR* = 21; (* Is a directory *) - EINVAL* = 22; (* Invalid argument *) - ENFILE* = 23; (* File table overflow *) - EMFILE* = 24; (* Too many open files *) - ENOTTY* = 25; (* Not a typewriter *) - ETXTBSY* = 26; (* Text file busy *) - EFBIG* = 27; (* File too large *) - ENOSPC* = 28; (* No space left on device *) - ESPIPE* = 29; (* Illegal seek *) - EROFS* = 30; (* Read-only file system *) - EMLINK* = 31; (* Too many links *) - EPIPE* = 32; (* Broken pipe *) - EDOM* = 33; (* Argument too large *) - ERANGE* = 34; (* Result too large *) - EDEADLK* = 35; (* Resource deadlock would occur *) - ENAMETOOLONG* = 36; (* File name too long *) - ENOLCK* = 37; (* No record locks available *) - ENOSYS* = 38; (* Function not implemented *) - ENOTEMPTY* = 39; (* Directory not empty *) - ELOOP* = 40; (* Too many symbolic links encountered *) - EWOULDBLOCK* = EAGAIN; (* Operation would block *) - ENOMSG* = 42; (* No message of desired type *) - EIDRM* = 43; (* Identifier removed *) - ECHRNG* = 44; (* Channel number out of range *) - EL2NSYNC* = 45; (* Level 2 not synchronized *) - EL3HLT* = 46; (* Level 3 halted *) - EL3RST* = 47; (* Level 3 reset *) - ELNRNG* = 48; (* Link number out of range *) - EUNATCH* = 49; (* Protocol driver not attached *) - ENOCSI* = 50; (* No CSI structure available *) - EL2HLT* = 51; (* Level 2 halted *) - EBADE* = 52; (* Invalid exchange *) - EBADR* = 53; (* Invalid request descriptor *) - EXFULL* = 54; (* Exchange full *) - ENOANO* = 55; (* No anode *) - EBADRQC* = 56; (* Invalid request code *) - EBADSLT* = 57; (* Invalid slot *) - EDEADLOCK* = 58; (* File locking deadlock error *) - EBFONT* = 59; (* Bad font file format *) - ENOSTR* = 60; (* Device not a stream *) - ENODATA* = 61; (* No data available *) - ETIME* = 62; (* Timer expired *) - ENOSR* = 63; (* Out of streams resources *) - ENONET* = 64; (* Machine is not on the network *) - ENOPKG* = 65; (* Package not installed *) - EREMOTE* = 66; (* Object is remote *) - ENOLINK* = 67; (* Link has been severed *) - EADV* = 68; (* Advertise error *) - ESRMNT* = 69; (* Srmount error *) - ECOMM* = 70; (* Communication error on send *) - EPROTO* = 71; (* Protocol error *) - EMULTIHOP* = 72; (* Multihop attempted *) - EDOTDOT* = 73; (* RFS specific error *) - EBADMSG* = 74; (* Not a data message *) - EOVERFLOW* = 75; (* Value too large for defined data type *) - ENOTUNIQ* = 76; (* Name not unique on network *) - EBADFD* = 77; (* File descriptor in bad state *) - EREMCHG* = 78; (* Remote address changed *) - ELIBACC* = 79; (* Can not access a needed shared library *) - ELIBBAD* = 80; (* Accessing a corrupted shared library *) - ELIBSCN* = 81; (* .lib section in a.out corrupted *) - ELIBMAX* = 82; (* Attempting to link in too many shared libraries *) - ELIBEXEC* = 83; (* Cannot exec a shared library directly *) - EILSEQ* = 84; (* Illegal byte sequence *) - ERESTART* = 85; (* Interrupted system call should be restarted *) - ESTRPIPE* = 86; (* Streams pipe error *) - EUSERS* = 87; (* Too many users *) - ENOTSOCK* = 88; (* Socket operation on non-socket *) - EDESTADDRREQ* = 89; (* Destination address required *) - EMSGSIZE* = 90; (* Message too long *) - EPROTOTYPE* = 91; (* Protocol wrong type for socket *) - ENOPROTOOPT* = 92; (* Protocol not available *) - EPROTONOSUPPORT* = 93; (* Protocol not supported *) - ESOCKTNOSUPPORT* = 94; (* Socket type not supported *) - EOPNOTSUPP* = 95; (* Operation not supported on transport endpoint *) - EPFNOSUPPORT* = 96; (* Protocol family not supported *) - EAFNOSUPPORT* = 97; (* Address family not supported by protocol *) - EADDRINUSE* = 98; (* Address already in use *) - EADDRNOTAVAIL* = 99; (* Cannot assign requested address *) - ENETDOWN* = 100; (* Network is down *) - ENETUNREACH* = 101; (* Network is unreachable *) - ENETRESET* = 102; (* Network dropped connection because of reset *) - ECONNABORTED* = 103; (* Software caused connection abort *) - ECONNRESET* = 104; (* Connection reset by peer *) - ENOBUFS* = 105; (* No buffer space available *) - EISCONN* = 106; (* Transport endpoint is already connected *) - ENOTCONN* = 107; (* Transport endpoint is not connected *) - ESHUTDOWN* = 108; (* Cannot send after transport endpoint shutdown *) - ETOOMANYREFS* = 109; (* Too many references: cannot splice *) - ETIMEDOUT* = 110; (* Connection timed out *) - ECONNREFUSED* = 111; (* Connection refused *) - EHOSTDOWN* = 112; (* Host is down *) - EHOSTUNREACH* = 113; (* No route to host *) - EALREADY* = 114; (* Operation already in progress *) - EINPROGRESS* = 115; (* Operation now in progress *) - ESTALE* = 116; (* Stale NFS file handle *) - EUCLEAN* = 117; (* Structure needs cleaning *) - ENOTNAM* = 118; (* Not a XENIX named type file *) - ENAVAIL* = 119; (* No XENIX semaphores available *) - EISNAM* = 120; (* Is a named type file *) - EREMOTEIO* = 121; (* Remote I/O error *) - EDQUOT* = 122; (* Quota exceeded *) - - -TYPE - JmpBuf* = RECORD - bx*, si*, di*, bp*, sp*, pc*: LONGINT; - maskWasSaved*: LONGINT; - savedMask*: ARRAY 32 OF LONGINT; - END ; - - Status* = RECORD (* struct stat *) - dev*, devX*: LONGINT; (* 64 bit in Linux 2.2 *) - pad1: INTEGER; - ino*, mode*, nlink*, uid*, gid*: LONGINT; - rdev*, rdevX*: LONGINT; (* 64 bit in Linux 2.2 *) - pad2: INTEGER; - size*, blksize*, blocks*, atime*, unused1*, mtime*, unused2*, ctime*, - unused3*, unused4*, unused5*: LONGINT; - END ; - - Timeval* = RECORD - sec*, usec*: LONGINT - END ; - - Timezone* = RECORD - minuteswest*, dsttime*: LONGINT - END ; - - Itimerval* = RECORD - interval*, value*: Timeval - END ; - - FdSet* = ARRAY 8 OF SET; - - SigCtxPtr* = POINTER TO SigContext; - SigContext* = RECORD - END ; - - SignalHandler* = PROCEDURE (sig, code: LONGINT; scp: SigCtxPtr); - - Dirent* = RECORD - ino, off: LONGINT; - reclen: INTEGER; - name: ARRAY 256 OF CHAR; - END ; - - Rusage* = RECORD - utime*, stime*: Timeval; - maxrss*, ixrss*, idrss*, isrss*, - minflt*, majflt*, nswap*, inblock*, - oublock*, msgsnd*, msgrcv*, nsignals*, - nvcsw*, nivcsw*: LONGINT - END ; - - Iovec* = RECORD - base*, len*: LONGINT - END ; - - SocketPair* = ARRAY 2 OF LONGINT; - - Pollfd* = RECORD - fd*: LONGINT; - events*, revents*: INTEGER - END ; - - Sockaddr* = RECORD - family*: INTEGER; - port*: INTEGER; - internetAddr*: LONGINT; - pad*: ARRAY 8 OF CHAR; - END ; - - HostEntry* = POINTER [1] TO Hostent; - Hostent* = RECORD - name*, aliases*: LONGINT; - addrtype*, length*: LONGINT; - addrlist*: LONGINT; (*POINTER TO POINTER TO LONGINT, network byte order*) - END; - - Name* = ARRAY OF CHAR; - - PROCEDURE -includeStat() - "#include "; - - PROCEDURE -includeErrno() - "#include "; - - (* for read(), write() and sleep() *) - PROCEDURE -includeUnistd() - "#include "; - - (* for system() *) -(* commented, doesn't compile on 32bit GNU/Linux platforms - PROCEDURE -includeStdlib() - "#include "; -*) - (* for nanosleep() *) - PROCEDURE -includeTime() - "#include "; - - (* for select() *) - PROCEDURE -includeSelect() - "#include "; - - PROCEDURE -err(): LONGINT - "errno"; - - PROCEDURE errno*(): LONGINT; - BEGIN - RETURN err() - END errno; - - PROCEDURE -Exit*(n: LONGINT) - "exit(n)"; - - PROCEDURE -Fork*(): LONGINT - "fork()"; - - PROCEDURE -Wait*(VAR status: LONGINT): LONGINT - "wait(status)"; - - PROCEDURE -Select*(width: LONGINT; VAR readfds, writefds, exceptfds: FdSet; VAR timeout: Timeval): LONGINT - "select(width, readfds, writefds, exceptfds, timeout)"; - - PROCEDURE -Gettimeofday* (VAR tv: Timeval; VAR tz: Timezone) : LONGINT - "gettimeofday(tv, tz)"; - - PROCEDURE -Read* (fd, buf, nbyte: LONGINT): LONGINT - "read(fd, buf, nbyte)"; - - PROCEDURE -ReadBlk* (fd: LONGINT; VAR buf: ARRAY OF SYSTEM.BYTE): LONGINT - "read(fd, buf, buf__len)"; - - PROCEDURE -Write* (fd, buf, nbyte: LONGINT): LONGINT - "write(fd, buf, nbyte)"; - - PROCEDURE -WriteBlk* (fd: LONGINT; VAR buf: ARRAY OF SYSTEM.BYTE): LONGINT - "write(fd, buf, buf__len)"; - - PROCEDURE -Dup*(fd: LONGINT): LONGINT - "dup(fd)"; - - PROCEDURE -Dup2*(fd1, fd2: LONGINT): LONGINT - "dup(fd1, fd2)"; - - PROCEDURE -Pipe*(fds : LONGINT): LONGINT - "pipe(fds)"; - - PROCEDURE -Getpid*(): LONGINT - "getpid()"; - - PROCEDURE -Getuid*(): LONGINT - "getuid()"; - - PROCEDURE -Geteuid*(): LONGINT - "geteuid()"; - - PROCEDURE -Getgid*(): LONGINT - "getgid()"; - - PROCEDURE -Getegid*(): LONGINT - "getegid()"; - - PROCEDURE -Unlink*(name: Name): LONGINT - "unlink(name)"; - - PROCEDURE -Open*(name: Name; flag, mode: SET): LONGINT - "open(name, flag, mode)"; - - PROCEDURE -Close*(fd: LONGINT): LONGINT - "close(fd)"; - - PROCEDURE -stat(name: Name; VAR statbuf: Status): LONGINT - "stat((const char*)name, (struct stat*)statbuf)"; - - PROCEDURE Stat*(name: Name; VAR statbuf: Status): LONGINT; - VAR res: LONGINT; - BEGIN - res := stat(name, statbuf); - (* make the first 4 bytes as unique as possible (used in module Files for caching!) *) - INC(statbuf.dev, statbuf.devX); - INC(statbuf.rdev, statbuf.rdevX); - RETURN res; - END Stat; - - PROCEDURE -fstat(fd: LONGINT; VAR statbuf: Status): LONGINT - "fstat(fd, (struct stat*)statbuf)"; - - PROCEDURE Fstat*(fd: LONGINT; VAR statbuf: Status): LONGINT; - VAR res: LONGINT; - BEGIN - res := fstat(fd, statbuf); - (* make the first 4 bytes as unique as possible (used in module Files for caching!) *) - INC(statbuf.dev, statbuf.devX); - INC(statbuf.rdev, statbuf.rdevX); - RETURN res; - END Fstat; - - PROCEDURE -Fchmod*(fd, mode: LONGINT): LONGINT - "fchmod(fd, mode)"; - - PROCEDURE -Chmod*(path: Name; mode: LONGINT): LONGINT - "chmod(path, mode)"; - - PROCEDURE -Lseek*(fd, offset, origin: LONGINT): LONGINT - "lseek(fd, offset, origin)"; - - PROCEDURE -Fsync*(fd: LONGINT): LONGINT - "fsync(fd)"; - - PROCEDURE -Fcntl*(fd, cmd, arg: LONGINT ): LONGINT - "fcntl(fd, cmd, arg)"; - - PROCEDURE -Flock*(fd, operation: LONGINT): LONGINT - "flock(fd, operation)"; - - PROCEDURE -Ftruncate*(fd, length: LONGINT): LONGINT - "ftruncate(fd, length)"; - - PROCEDURE -Readblk*(fd: LONGINT; VAR buf: ARRAY OF SYSTEM.BYTE; len: LONGINT): LONGINT - "read(fd, buf, len)"; - - PROCEDURE -Rename*(old, new: Name): LONGINT - "rename(old, new)"; - - PROCEDURE -Chdir*(path: Name): LONGINT - "chdir(path)"; - - PROCEDURE -Ioctl*(fd, request, arg: LONGINT): LONGINT - "ioctl(fd, request, arg)"; - - PROCEDURE -Kill*(pid, sig: LONGINT): LONGINT - "kill(pid, sig)"; - - PROCEDURE -Sigsetmask*(mask: LONGINT): LONGINT - "sigsetmask(mask)"; - - PROCEDURE -Sleep*(ms : LONGINT): LONGINT - "sleep(ms)"; - - PROCEDURE -Nanosleep*(VAR req : Timeval; VAR rem : Timeval): LONGINT - "nanosleep(req, rem)"; - - (* TCP/IP networking *) - - PROCEDURE -Gethostbyname*(name: Name): HostEntry - "(Unix_HostEntry)gethostbyname(name)"; - - PROCEDURE -Gethostname*(VAR name: Name): LONGINT - "gethostname(name, name__len)"; - - PROCEDURE -Socket*(af, type, protocol: LONGINT): LONGINT - "socket(af, type, protocol)"; - - PROCEDURE -Connect*(socket: LONGINT; name: Sockaddr; namelen: LONGINT): LONGINT - "connect(socket, &(name), namelen)"; - - PROCEDURE -Getsockname*(socket: LONGINT; VAR name: Sockaddr; VAR namelen: LONGINT): LONGINT - "getsockname(socket, name, namelen)"; - - PROCEDURE -Bind*(socket: LONGINT; name: Sockaddr; namelen: LONGINT): LONGINT - "bind(socket, &(name), namelen)"; - - PROCEDURE -Listen*(socket, backlog: LONGINT): LONGINT - "listen(socket, backlog)"; - - PROCEDURE -Accept*(socket: LONGINT; VAR addr: Sockaddr; VAR addrlen: LONGINT): LONGINT - "accept(socket, addr, addrlen)"; - - PROCEDURE -Recv*(socket, bufadr, buflen, flags: LONGINT): LONGINT - "recv(socket, bufadr, buflen, flags)"; - - PROCEDURE -Send*(socket, bufadr, buflen, flags: LONGINT): LONGINT - "send(socket, bufadr, buflen, flags)"; - - PROCEDURE -sys(str: ARRAY OF CHAR): INTEGER (* need this to call external tools like gcc or gas; noch *) - "system(str)"; - - PROCEDURE system*(cmd : ARRAY OF CHAR); - VAR r : INTEGER; - BEGIN - r := sys(cmd); - END system; - - PROCEDURE System*(cmd : ARRAY OF CHAR): INTEGER; - VAR r : INTEGER; - BEGIN - r := sys(cmd); - RETURN r - END System; - - PROCEDURE -SizeofUnixStat(): INTEGER - "sizeof(Unix_Status)"; - - PROCEDURE -SizeofStat(): INTEGER - "sizeof(struct stat)"; - - PROCEDURE -Error(msg: ARRAY OF CHAR; len: INTEGER) - "write(1/*stdout*/, msg, len); char ch = 0xa; write(1, &ch, 1)"; - - PROCEDURE StatCheck; - VAR x, y: LONGINT; - BEGIN - x := SizeofUnixStat(); - y := SizeofStat(); - IF x # y THEN - Error("Unix.StatCheck: inconsistent usage of struct stat", 49); - Exit(1); - END - END StatCheck; - -BEGIN - - StatCheck(); -END Unix. diff --git a/src/system/linux/gcc/x86/Args.Mod b/src/system/linux/gcc/x86/Args.Mod deleted file mode 100644 index c6b7b56e..00000000 --- a/src/system/linux/gcc/x86/Args.Mod +++ /dev/null @@ -1,65 +0,0 @@ -MODULE Args; (* jt, 8.12.94 *) - - (* command line argument handling for voc (jet backend) *) - - - IMPORT SYSTEM; - - TYPE - ArgPtr = POINTER TO ARRAY 1024 OF CHAR; - ArgVec = POINTER TO ARRAY 1024 OF ArgPtr; - - VAR argc-, argv-: LONGINT; - (*PROCEDURE -includestdlib() "#include ";*) - PROCEDURE -externgetenv() "extern char *getenv(const char *name);"; (* took this from stdlib.h*) - PROCEDURE -Argc(): INTEGER "SYSTEM_argc"; - PROCEDURE -Argv(): LONGINT "(long)SYSTEM_argv"; - PROCEDURE -getenv(var: ARRAY OF CHAR): ArgPtr - "(Args_ArgPtr)getenv(var)"; - - PROCEDURE Get*(n: INTEGER; VAR val: ARRAY OF CHAR); - VAR av: ArgVec; - BEGIN - IF n < argc THEN av := SYSTEM.VAL(ArgVec, argv); COPY(av[n]^, val) END - END Get; - - PROCEDURE GetInt*(n: INTEGER; VAR val: LONGINT); - VAR s: ARRAY 64 OF CHAR; k, d, i: LONGINT; - BEGIN - s := ""; Get(n, s); i := 0; - IF s[0] = "-" THEN i := 1 END ; - k := 0; d := ORD(s[i]) - ORD("0"); - WHILE (d >= 0 ) & (d <= 9) DO k := k*10 + d; INC(i); d := ORD(s[i]) - ORD("0") END ; - IF s[0] = "-" THEN d := -d; DEC(i) END ; - IF i > 0 THEN val := k END - END GetInt; - - PROCEDURE Pos*(s: ARRAY OF CHAR): INTEGER; - VAR i: INTEGER; arg: ARRAY 256 OF CHAR; - BEGIN - i := 0; Get(i, arg); - WHILE (i < argc) & (s # arg) DO INC(i); Get(i, arg) END ; - RETURN i - END Pos; - - PROCEDURE GetEnv*(var: ARRAY OF CHAR; VAR val: ARRAY OF CHAR); - VAR p: ArgPtr; - BEGIN - p := getenv(var); - IF p # NIL THEN COPY(p^, val) END - END GetEnv; - - PROCEDURE getEnv*(var: ARRAY OF CHAR; VAR val: ARRAY OF CHAR): BOOLEAN; - VAR p: ArgPtr; - BEGIN - p := getenv(var); - IF p # NIL THEN - COPY(p^, val); - RETURN TRUE - ELSE - RETURN FALSE - END - END getEnv; - -BEGIN argc := Argc(); argv := Argv() -END Args. diff --git a/src/system/linux/gcc/x86/Files.Mod b/src/system/linux/gcc/x86/Files.Mod deleted file mode 100644 index 6307407d..00000000 --- a/src/system/linux/gcc/x86/Files.Mod +++ /dev/null @@ -1,663 +0,0 @@ -MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files *) -(* modified version of Files, which opens only the file provided and does not scan any path in any environment variable, also ReadLine procedure added; -- noch *) - IMPORT SYSTEM, Unix, Kernel, Args, Console; - - (* standard data type I/O - - little endian, - Sint:1, Int:2, Lint:4 - ORD({0}) = 1, - false = 0, true =1 - IEEE real format, - null terminated strings, - compact numbers according to M.Odersky *) - - - CONST - nofbufs = 4; - bufsize = 4096; - fileTabSize = 64; - noDesc = -1; - notDone = -1; - - (* file states *) - open = 0; create = 1; close = 2; - - - TYPE - FileName = ARRAY 101 OF CHAR; - File* = POINTER TO Handle; - Buffer = POINTER TO BufDesc; - - Handle = RECORD - workName, registerName: FileName; - tempFile: BOOLEAN; - dev, ino, mtime: LONGINT; - fd-, len, pos: LONGINT; - bufs: ARRAY nofbufs OF Buffer; - swapper, state: INTEGER - END ; - - BufDesc = RECORD - f: File; - chg: BOOLEAN; - org, size: LONGINT; - data: ARRAY bufsize OF SYSTEM.BYTE - END ; - - Rider* = RECORD - res*: LONGINT; - eof*: BOOLEAN; - buf: Buffer; - org, offset: LONGINT - END ; - - Time = POINTER TO TimeDesc; - TimeDesc = RECORD - sec*, min*, hour*, mday*, mon*, year*, wday*, isdst*, zone*, gmtoff*: LONGINT; -(* sec*, min*, hour*, mday*, mon*, year*, wday*, isdst*, zone*, gmtoff*: INTEGER;*) - END ; - - VAR - fileTab: ARRAY fileTabSize OF LONGINT (*=File*); - tempno: INTEGER; - -(* for localtime *) - PROCEDURE -includetime() - '#include "time.h"'; - - PROCEDURE -localtime(VAR clock: LONGINT): Time - "(Files_Time) localtime(clock)"; - - PROCEDURE -getcwd(VAR cwd: Unix.Name) - "getcwd(cwd, cwd__len)"; - - PROCEDURE -IdxTrap "__HALT(-1)"; - - PROCEDURE^ Finalize(o: SYSTEM.PTR); - - PROCEDURE Err(s: ARRAY OF CHAR; f: File; errno: LONGINT); - BEGIN - Console.Ln; Console.String("-- "); Console.String(s); Console.String(": "); - IF f # NIL THEN - IF f.registerName # "" THEN Console.String(f.registerName) ELSE Console.String(f.workName) END - END ; - IF errno # 0 THEN Console.String(" errno = "); Console.Int(errno, 1) END ; - Console.Ln; - HALT(99) - END Err; - - PROCEDURE MakeFileName(dir, name: ARRAY OF CHAR; VAR dest: ARRAY OF CHAR); - VAR i, j: INTEGER; - BEGIN i := 0; j := 0; - WHILE dir[i] # 0X DO dest[i] := dir[i]; INC(i) END ; - IF dest[i-1] # "/" THEN dest[i] := "/"; INC(i) END ; - WHILE name[j] # 0X DO dest[i] := name[j]; INC(i); INC(j) END ; - dest[i] := 0X - END MakeFileName; - - PROCEDURE GetTempName(finalName: ARRAY OF CHAR; VAR name: ARRAY OF CHAR); - VAR n, i, j: LONGINT; - BEGIN - INC(tempno); n := tempno; i := 0; - IF finalName[0] # "/" THEN (* relative pathname *) - WHILE Kernel.CWD[i] # 0X DO name[i] := Kernel.CWD[i]; INC(i) END; - IF Kernel.CWD[i-1] # "/" THEN name[i] := "/"; INC(i) END - END; - j := 0; - WHILE finalName[j] # 0X DO name[i] := finalName[j]; INC(i); INC(j) END; - DEC(i); - WHILE name[i] # "/" DO DEC(i) END; - name[i+1] := "."; name[i+2] := "t"; name[i+3] := "m"; name[i+4] := "p"; name[i+5] := "."; INC(i, 6); - WHILE n > 0 DO name[i] := CHR(n MOD 10 + ORD("0")); n := n DIV 10; INC(i) END; - name[i] := "."; INC(i); n := SHORT(Unix.Getpid()); - WHILE n > 0 DO name[i] := CHR(n MOD 10 + ORD("0")); n := n DIV 10; INC(i) END; - name[i] := 0X - END GetTempName; - - PROCEDURE Create(f: File); - VAR stat: Unix.Status; done: BOOLEAN; - errno: LONGINT; err: ARRAY 32 OF CHAR; - BEGIN - IF f.fd = noDesc THEN - IF f.state = create THEN GetTempName(f.registerName, f.workName); f.tempFile := TRUE - ELSIF f.state = close THEN - f.workName := f.registerName; f.registerName := ""; f.tempFile := FALSE - END ; - errno := Unix.Unlink(f.workName); (*unlink first to avoid stale NFS handles and to avoid reuse of inodes*) - f.fd := Unix.Open(f.workName, Unix.rdwr + Unix.creat + Unix.trunc, {2, 4,5, 7,8}); - done := f.fd >= 0; errno := Unix.errno(); - IF (~done & ((errno = Unix.ENFILE) OR (errno = Unix.EMFILE))) OR (done & (f.fd >= fileTabSize)) THEN - IF done & (f.fd >= fileTabSize) THEN errno := Unix.Close(f.fd) END ; - Kernel.GC(TRUE); - f.fd := Unix.Open(f.workName, Unix.rdwr + Unix.creat + Unix.trunc, {2, 4,5, 7,8}); - done := f.fd >= 0 - END ; - IF done THEN - IF f.fd >= fileTabSize THEN errno := Unix.Close(f.fd); Err("too many files open", f, 0) - ELSE fileTab[f.fd] := SYSTEM.VAL(LONGINT, f); INC(Kernel.nofiles); Kernel.RegisterObject(f, Finalize); - f.state := open; f.pos := 0; errno := Unix.Fstat(f.fd, stat); - f.dev := stat.dev; f.ino := stat.ino; f.mtime := stat.mtime - END - ELSE errno := Unix.errno(); - IF errno = Unix.ENOENT THEN err := "no such directory" - ELSIF (errno = Unix.ENFILE) OR (errno = Unix.EMFILE) THEN err := "too many files open" - ELSE err := "file not created" - END ; - Err(err, f, errno) - END - END - END Create; - - PROCEDURE Flush(buf: Buffer); - VAR res: LONGINT; f: File; stat: Unix.Status; - BEGIN - IF buf.chg THEN f := buf.f; Create(f); - IF buf.org # f.pos THEN res := Unix.Lseek(f.fd, buf.org, 0) END ; - res := Unix.Write(f.fd, SYSTEM.ADR(buf.data), buf.size); - IF res < 0 THEN Err("error in writing file", f, Unix.errno()) END ; - f.pos := buf.org + buf.size; - buf.chg := FALSE; - res := Unix.Fstat(f.fd, stat); - f.mtime := stat.mtime - END - END Flush; - - PROCEDURE Close* (f: File); - VAR i, res: LONGINT; - BEGIN - IF (f.state # create) OR (f.registerName # "") THEN - Create(f); i := 0; - WHILE (i < nofbufs) & (f.bufs[i] # NIL) DO Flush(f.bufs[i]); INC(i) END ; - res := Unix.Fsync(f.fd); - IF res < 0 THEN Err("error in writing file", f, Unix.errno()) END - END - END Close; - - PROCEDURE Length* (f: File): LONGINT; - BEGIN RETURN f.len - END Length; - - PROCEDURE New* (name: ARRAY OF CHAR): File; - VAR f: File; - BEGIN - NEW(f); f.workName := ""; COPY(name, f.registerName); - f.fd := noDesc; f.state := create; f.len := 0; f.pos := 0; f.swapper := -1; (*all f.buf[i] = NIL*) - RETURN f - END New; -(* - PROCEDURE ScanPath(VAR pos: INTEGER; VAR dir: ARRAY OF CHAR); (* supports ~, ~user and blanks inside path *) - VAR i: INTEGER; ch: CHAR; home: ARRAY 256 OF CHAR; - BEGIN - i := 0; ch := Kernel.OBERON[pos]; - WHILE (ch = " ") OR (ch = ":") DO INC(pos); ch := Kernel.OBERON[pos] END ; - IF ch = "~" THEN - INC(pos); ch := Kernel.OBERON[pos]; - home := ""; Args.GetEnv("HOME", home); - WHILE home[i] # 0X DO dir[i] := home[i]; INC(i) END ; - IF (ch # "/") & (ch # 0X) & (ch # ":") & (ch # " ") THEN - WHILE (i > 0) & (dir[i-1] # "/") DO DEC(i) END - END - END ; - WHILE (ch # 0X) & (ch # ":") DO dir[i] := ch; INC(i); INC(pos); ch := Kernel.OBERON[pos] END ; - WHILE (i > 0) & (dir[i-1] = " ") DO DEC(i) END ; - dir[i] := 0X - END ScanPath; -*) - PROCEDURE HasDir(VAR name: ARRAY OF CHAR): BOOLEAN; - VAR i: INTEGER; ch: CHAR; - BEGIN i := 0; ch := name[0]; - WHILE (ch # 0X) & (ch # "/") DO INC(i); ch := name[i] END ; - RETURN ch = "/" - END HasDir; - - PROCEDURE CacheEntry(dev, ino: LONGINT; mtime: LONGINT): File; - VAR f: File; i: INTEGER; stat: Unix.Status; res: LONGINT; - BEGIN i := 0; - WHILE i < fileTabSize DO - f := SYSTEM.VAL(File, fileTab[i]); - IF (f # NIL) & (ino = f.ino) & (dev = f.dev) THEN - IF mtime # f.mtime THEN i := 0; - WHILE i < nofbufs DO - IF f.bufs[i] # NIL THEN f.bufs[i].org := -1; f.bufs[i] := NIL END ; - INC(i) - END ; - f.swapper := -1; f.mtime := mtime; - res := Unix.Fstat(f.fd, stat); f.len := stat.size - END ; - RETURN f - END ; - INC(i) - END ; - RETURN NIL - END CacheEntry; - - PROCEDURE Old* (name: ARRAY OF CHAR): File; - VAR f: File; fd, res, errno: LONGINT; pos: INTEGER; done: BOOLEAN; - dir, path: ARRAY 256 OF CHAR; - stat: Unix.Status; - BEGIN - IF name # "" THEN - IF HasDir(name) THEN dir := ""; COPY(name, path) - ELSE - pos := 0; - COPY(name, path); (* -- noch *) - (*ScanPath(pos, dir);*) (*MakeFileName(dir, name, path);*) (*ScanPath(pos, dir)*) - END ; - LOOP - fd := Unix.Open(path, Unix.rdwr, {}); done := fd >= 0; errno := Unix.errno(); - IF (~done & ((errno = Unix.ENFILE) OR (errno = Unix.EMFILE))) OR (done & (fd >= fileTabSize)) THEN - IF done & (fd >= fileTabSize) THEN res := Unix.Close(fd) END ; - Kernel.GC(TRUE); - fd := Unix.Open(path, Unix.rdwr, {}); - done := fd >= 0; errno := Unix.errno(); - IF ~done & ((errno = Unix.ENFILE) OR (errno = Unix.EMFILE)) THEN Err("too many files open", f, errno) END - END ; - IF ~done & ((errno = Unix.EACCES) OR (errno = Unix.EROFS) OR (errno = Unix.EAGAIN)) THEN - (* errno EAGAIN observed on Solaris 2.4 *) - fd := Unix.Open(path, Unix.rdonly, {}); done := fd >= 0; errno := Unix.errno() - END ; -IF (~done) & (errno # Unix.ENOENT) THEN - Console.String("warning Files.Old "); Console.String(name); - Console.String(" errno = "); Console.Int(errno, 0); Console.Ln; -END ; - IF done THEN - res := Unix.Fstat(fd, stat); - f := CacheEntry(stat.dev, stat.ino, stat.mtime); - IF f # NIL THEN res := Unix.Close(fd); RETURN f - ELSIF fd >= fileTabSize THEN res := Unix.Close(fd); Err("too many files open", f, 0) - ELSE NEW(f); fileTab[fd] := SYSTEM.VAL(LONGINT, f); INC(Kernel.nofiles); Kernel.RegisterObject(f, Finalize); - f.fd := fd; f.state := open; f.len := stat.size; f.pos := 0; f.swapper := -1; (*all f.buf[i] = NIL*) - COPY(name, f.workName); f.registerName := ""; f.tempFile := FALSE; - f.dev := stat.dev; f.ino := stat.ino; f.mtime := stat.mtime; - RETURN f - END - ELSIF dir = "" THEN RETURN NIL - ELSE (*MakeFileName(dir, name, path);*) (*ScanPath(pos, dir)*) - RETURN NIL - END - END - ELSE RETURN NIL - END - END Old; - - PROCEDURE Purge* (f: File); - VAR i: INTEGER; stat: Unix.Status; res: LONGINT; - BEGIN i := 0; - WHILE i < nofbufs DO - IF f.bufs[i] # NIL THEN f.bufs[i].org := -1; f.bufs[i] := NIL END ; - INC(i) - END ; - IF f.fd # noDesc THEN res := Unix.Ftruncate(f.fd, 0); res := Unix.Lseek(f.fd, 0, 0) END ; - f.pos := 0; f.len := 0; f.swapper := -1; - res := Unix.Fstat(f.fd, stat); f.mtime := stat.mtime - END Purge; - - PROCEDURE GetDate* (f: File; VAR t, d: LONGINT); - VAR stat: Unix.Status; clock, res: LONGINT; time: Time; - BEGIN - Create(f); res := Unix.Fstat(f.fd, stat); - time := localtime(stat.mtime); - t := time.sec + ASH(time.min, 6) + ASH(time.hour, 12); - d := time.mday + ASH(time.mon+1, 5) + ASH(time.year MOD 100, 9) - END GetDate; - - PROCEDURE Pos* (VAR r: Rider): LONGINT; - BEGIN RETURN r.org + r.offset - END Pos; - - PROCEDURE Set* (VAR r: Rider; f: File; pos: LONGINT); - VAR org, offset, i, n, res: LONGINT; buf: Buffer; - BEGIN - IF f # NIL THEN - IF pos > f.len THEN pos := f.len ELSIF pos < 0 THEN pos := 0 END ; - offset := pos MOD bufsize; org := pos - offset; i := 0; - WHILE (i < nofbufs) & (f.bufs[i] # NIL) & (org # f.bufs[i].org) DO INC(i) END ; - IF i < nofbufs THEN - IF f.bufs[i] = NIL THEN NEW(buf); buf.chg := FALSE; buf.org := -1; buf.f := f; f.bufs[i] := buf - ELSE buf := f.bufs[i] - END - ELSE - f.swapper := (f.swapper + 1) MOD nofbufs; - buf := f.bufs[f.swapper]; - Flush(buf) - END ; - IF buf.org # org THEN - IF org = f.len THEN buf.size := 0 - ELSE Create(f); - IF f.pos # org THEN res := Unix.Lseek(f.fd, org, 0) END ; - n := Unix.ReadBlk(f.fd, buf.data); - IF n < 0 THEN Err("read from file not done", f, Unix.errno()) END ; - f.pos := org + n; - buf.size := n - END ; - buf.org := org; buf.chg := FALSE - END - ELSE buf := NIL; org := 0; offset := 0 - END ; - r.buf := buf; r.org := org; r.offset := offset; r.eof := FALSE; r.res := 0 - END Set; - - PROCEDURE Read* (VAR r: Rider; VAR x: SYSTEM.BYTE); - VAR offset: LONGINT; buf: Buffer; - BEGIN - buf := r.buf; offset := r.offset; - IF r.org # buf.org THEN Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset END ; - IF (offset < buf.size) THEN - x := buf.data[offset]; r.offset := offset + 1 - ELSIF r.org + offset < buf.f.len THEN - Set(r, r.buf.f, r.org + offset); - x := r.buf.data[0]; r.offset := 1 - ELSE - x := 0X; r.eof := TRUE - END - END Read; - - PROCEDURE ReadBytes* (VAR r: Rider; VAR x: ARRAY OF SYSTEM.BYTE; n: LONGINT); - VAR xpos, min, restInBuf, offset: LONGINT; buf: Buffer; - BEGIN - IF n > LEN(x) THEN IdxTrap END ; - xpos := 0; buf := r.buf; offset := r.offset; - WHILE n > 0 DO - IF (r.org # buf.org) OR (offset >= bufsize) THEN - Set(r, buf.f, r.org + offset); - buf := r.buf; offset := r.offset - END ; - restInBuf := buf.size - offset; - IF restInBuf = 0 THEN r.res := n; r.eof := TRUE; RETURN - ELSIF n > restInBuf THEN min := restInBuf ELSE min := n END ; - SYSTEM.MOVE(SYSTEM.ADR(buf.data) + offset, SYSTEM.ADR(x) + xpos, min); - INC(offset, min); r.offset := offset; INC(xpos, min); DEC(n, min) - END ; - r.res := 0; r.eof := FALSE - END ReadBytes; - - PROCEDURE ReadByte* (VAR r : Rider; VAR x : ARRAY OF SYSTEM.BYTE); - BEGIN - ReadBytes(r, x, 1); - END ReadByte; - - PROCEDURE Base* (VAR r: Rider): File; - BEGIN RETURN r.buf.f - END Base; - - PROCEDURE Write* (VAR r: Rider; x: SYSTEM.BYTE); - VAR buf: Buffer; offset: LONGINT; - BEGIN - buf := r.buf; offset := r.offset; - IF (r.org # buf.org) OR (offset >= bufsize) THEN - Set(r, buf.f, r.org + offset); - buf := r.buf; offset := r.offset - END ; - buf.data[offset] := x; - buf.chg := TRUE; - IF offset = buf.size THEN - INC(buf.size); INC(buf.f.len) - END ; - r.offset := offset + 1; r.res := 0 - END Write; - - PROCEDURE WriteByte* (VAR r : Rider; x : SYSTEM.BYTE); (* added for compatibility with PO 2013, -- noch *) - BEGIN - Write(r, x); - END WriteByte; - - PROCEDURE WriteBytes* (VAR r: Rider; VAR x: ARRAY OF SYSTEM.BYTE; n: LONGINT); - VAR xpos, min, restInBuf, offset: LONGINT; buf: Buffer; - BEGIN - IF n > LEN(x) THEN IdxTrap END ; - xpos := 0; buf := r.buf; offset := r.offset; - WHILE n > 0 DO - IF (r.org # buf.org) OR (offset >= bufsize) THEN - Set(r, buf.f, r.org + offset); - buf := r.buf; offset := r.offset - END ; - restInBuf := bufsize - offset; - IF n > restInBuf THEN min := restInBuf ELSE min := n END ; - SYSTEM.MOVE(SYSTEM.ADR(x) + xpos, SYSTEM.ADR(buf.data) + offset, min); - INC(offset, min); r.offset := offset; - IF offset > buf.size THEN INC(buf.f.len, offset - buf.size); buf.size := offset END ; - INC(xpos, min); DEC(n, min); buf.chg := TRUE - END ; - r.res := 0 - END WriteBytes; - -(* another solution would be one that is similar to ReadBytes, WriteBytes. -No code duplication, more symmetric, only two ifs for -Read and Write in buffer, buf.size replaced by bufsize in Write ops, buf.size and len -must be made consistent with offset (if offset > buf.size) in a lazy way. - -PROCEDURE Write* (VAR r: Rider; x: SYSTEM.BYTE); - VAR buf: Buffer; offset: LONGINT; -BEGIN - buf := r.buf; offset := r.offset; - IF (offset >= bufsize) OR (r.org # buf.org) THEN - Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset; - END ; - buf.data[offset] := x; r.offset := offset + 1; buf.chg := TRUE -END Write; - - -PROCEDURE WriteBytes ... - -PROCEDURE Read* (VAR r: Rider; VAR x: SYSTEM.BYTE); - VAR offset: LONGINT; buf: Buffer; -BEGIN - buf := r.buf; offset := r.offset; - IF (offset >= buf.size) OR (r.org # buf.org) THEN - IF r.org + offset >= buf.f.len THEN x := 0X; r.eof := TRUE; RETURN - ELSE Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset - END - END ; - x := buf.data[offset]; r.offset := offset + 1 -END Read; - -but this would also affect Set, Length, and Flush. -Especially Length would become fairly complex. -*) - - PROCEDURE Delete* (name: ARRAY OF CHAR; VAR res: INTEGER); - BEGIN - res := SHORT(Unix.Unlink(name)); - res := SHORT(Unix.errno()) - END Delete; - - PROCEDURE Rename* (old, new: ARRAY OF CHAR; VAR res: INTEGER); - VAR fdold, fdnew, n, errno, r: LONGINT; - ostat, nstat: Unix.Status; - buf: ARRAY 4096 OF CHAR; - BEGIN - r := Unix.Stat(old, ostat); - IF r >= 0 THEN - r := Unix.Stat(new, nstat); - IF (r >= 0) & ((ostat.dev # nstat.dev) OR (ostat.ino # nstat.ino)) THEN - Delete(new, res); (* work around stale nfs handles *) - END ; - r := Unix.Rename(old, new); - IF r < 0 THEN res := SHORT(Unix.errno()); - IF res = Unix.EXDEV THEN (* cross device link, move the file *) - fdold := Unix.Open(old, Unix.rdonly, {}); - IF fdold < 0 THEN res := 2; RETURN END ; - fdnew := Unix.Open(new, Unix.rdwr + Unix.creat + Unix.trunc, {2, 4,5, 7,8}); - IF fdnew < 0 THEN r := Unix.Close(fdold); res := 3; RETURN END ; - n := Unix.Read(fdold, SYSTEM.ADR(buf), bufsize); - WHILE n > 0 DO - r := Unix.Write(fdnew, SYSTEM.ADR(buf), n); - IF r < 0 THEN errno := Unix.errno(); r := Unix.Close(fdold); r := Unix.Close(fdnew); - Err("cannot move file", NIL, errno) - END ; - n := Unix.Read(fdold, SYSTEM.ADR(buf), bufsize) - END ; - errno := Unix.errno(); - r := Unix.Close(fdold); r := Unix.Close(fdnew); - IF n = 0 THEN r := Unix.Unlink(old); res := 0 - ELSE Err("cannot move file", NIL, errno) - END ; - ELSE RETURN (* res is Unix.Rename return code *) - END - END ; - res := 0 - ELSE res := 2 (* old file not found *) - END - END Rename; - - PROCEDURE Register* (f: File); - VAR idx, errno: INTEGER; f1: File; file: ARRAY 104 OF CHAR; - BEGIN - IF (f.state = create) & (f.registerName # "") THEN f.state := close (* shortcut renaming *) END ; - Close(f); - IF f.registerName # "" THEN - Rename(f.workName, f.registerName, errno); - IF errno # 0 THEN COPY(f.registerName, file); HALT(99) END ; - f.workName := f.registerName; f.registerName := ""; f.tempFile := FALSE - END - END Register; - - PROCEDURE ChangeDirectory*(path: ARRAY OF CHAR; VAR res: INTEGER); - BEGIN - res := SHORT(Unix.Chdir(path)); - getcwd(Kernel.CWD) - END ChangeDirectory; - - PROCEDURE FlipBytes(VAR src, dest: ARRAY OF SYSTEM.BYTE); - VAR i, j: LONGINT; - BEGIN - IF ~Kernel.littleEndian THEN i := LEN(src); j := 0; - WHILE i > 0 DO DEC(i); dest[j] := src[i]; INC(j) END - ELSE SYSTEM.MOVE(SYSTEM.ADR(src), SYSTEM.ADR(dest), LEN(src)) - END - END FlipBytes; - - PROCEDURE ReadBool* (VAR R: Rider; VAR x: BOOLEAN); - BEGIN Read(R, SYSTEM.VAL(CHAR, x)) - END ReadBool; - - PROCEDURE ReadInt* (VAR R: Rider; VAR x: INTEGER); - VAR b: ARRAY 2 OF CHAR; - BEGIN ReadBytes(R, b, 2); - x := ORD(b[0]) + ORD(b[1])*256 - END ReadInt; - - PROCEDURE ReadLInt* (VAR R: Rider; VAR x: LONGINT); - VAR b: ARRAY 4 OF CHAR; - BEGIN ReadBytes(R, b, 4); - x := ORD(b[0]) + ORD(b[1])*100H + ORD(b[2])*10000H + ORD(b[3])*1000000H - END ReadLInt; - - PROCEDURE ReadSet* (VAR R: Rider; VAR x: SET); - VAR b: ARRAY 4 OF CHAR; - BEGIN ReadBytes(R, b, 4); - x := SYSTEM.VAL(SET, ORD(b[0]) + ORD(b[1])*100H + ORD(b[2])*10000H + ORD(b[3])*1000000H) - END ReadSet; - - PROCEDURE ReadReal* (VAR R: Rider; VAR x: REAL); - VAR b: ARRAY 4 OF CHAR; - BEGIN ReadBytes(R, b, 4); FlipBytes(b, x) - END ReadReal; - - PROCEDURE ReadLReal* (VAR R: Rider; VAR x: LONGREAL); - VAR b: ARRAY 8 OF CHAR; - BEGIN ReadBytes(R, b, 8); FlipBytes(b, x) - END ReadLReal; - - PROCEDURE ReadString* (VAR R: Rider; VAR x: ARRAY OF CHAR); - VAR i: INTEGER; ch: CHAR; - BEGIN i := 0; - REPEAT Read(R, ch); x[i] := ch; INC(i) UNTIL ch = 0X - END ReadString; - - (* need to read line; -- noch *) - PROCEDURE ReadLine* (VAR R: Rider; VAR x: ARRAY OF CHAR); - VAR i: INTEGER; ch: CHAR; b : BOOLEAN; - BEGIN i := 0; - b := FALSE; - REPEAT - Read(R, ch); - IF ((ch = 0X) OR (ch = 0AX) OR (ch = 0DX)) THEN - b := TRUE - ELSE - x[i] := ch; - INC(i); - END; - UNTIL b - END ReadLine; - - PROCEDURE ReadNum* (VAR R: Rider; VAR x: LONGINT); - VAR s: SHORTINT; ch: CHAR; n: LONGINT; - BEGIN s := 0; n := 0; Read(R, ch); - WHILE ORD(ch) >= 128 DO INC(n, ASH(ORD(ch) - 128, s) ); INC(s, 7); Read(R, ch) END; - INC(n, ASH(ORD(ch) MOD 64 - ORD(ch) DIV 64 * 64, s) ); - x := n - END ReadNum; - - PROCEDURE WriteBool* (VAR R: Rider; x: BOOLEAN); - BEGIN Write(R, SYSTEM.VAL(CHAR, x)) - END WriteBool; - - PROCEDURE WriteInt* (VAR R: Rider; x: INTEGER); - VAR b: ARRAY 2 OF CHAR; - BEGIN b[0] := CHR(x); b[1] := CHR(x DIV 256); - WriteBytes(R, b, 2); - END WriteInt; - - PROCEDURE WriteLInt* (VAR R: Rider; x: LONGINT); - VAR b: ARRAY 4 OF CHAR; - BEGIN - b[0] := CHR(x); b[1] := CHR(x DIV 100H); b[2] := CHR(x DIV 10000H); b[3] := CHR(x DIV 1000000H); - WriteBytes(R, b, 4); - END WriteLInt; - - PROCEDURE WriteSet* (VAR R: Rider; x: SET); - VAR b: ARRAY 4 OF CHAR; i: LONGINT; - BEGIN i := SYSTEM.VAL(LONGINT, x); - 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; - - PROCEDURE WriteReal* (VAR R: Rider; x: REAL); - VAR b: ARRAY 4 OF CHAR; - BEGIN FlipBytes(x, b); WriteBytes(R, b, 4) - END WriteReal; - - PROCEDURE WriteLReal* (VAR R: Rider; x: LONGREAL); - VAR b: ARRAY 8 OF CHAR; - BEGIN FlipBytes(x, b); WriteBytes(R, b, 8) - END WriteLReal; - - PROCEDURE WriteString* (VAR R: Rider; x: ARRAY [1] OF CHAR); - VAR i: INTEGER; - BEGIN i := 0; - WHILE x[i] # 0X DO INC(i) END ; - WriteBytes(R, x, i+1) - END WriteString; - - PROCEDURE WriteNum* (VAR R: Rider; x: LONGINT); - BEGIN - WHILE (x < - 64) OR (x > 63) DO Write(R, CHR(x MOD 128 + 128)); x := x DIV 128 END; - Write(R, CHR(x MOD 128)) - END WriteNum; - - PROCEDURE GetName*(f: File; VAR name: ARRAY OF CHAR); - BEGIN - COPY (f.workName, name); - END GetName; - - PROCEDURE Finalize(o: SYSTEM.PTR); - VAR f: File; res: LONGINT; - BEGIN - f := SYSTEM.VAL(File, o); - IF f.fd >= 0 THEN - fileTab[f.fd] := 0; res := Unix.Close(f.fd); f.fd := -1; DEC(Kernel.nofiles); - IF f.tempFile THEN res := Unix.Unlink(f.workName) END - END - END Finalize; - - PROCEDURE Init; - VAR i: LONGINT; - BEGIN - i := 0; WHILE i < fileTabSize DO fileTab[i] := 0; INC(i) END ; - tempno := -1; Kernel.nofiles := 0 - END Init; - -BEGIN Init -END Files. diff --git a/src/system/linux/gcc/x86/Files0.Mod b/src/system/linux/gcc/x86/Files0.Mod deleted file mode 100644 index 4f021ede..00000000 --- a/src/system/linux/gcc/x86/Files0.Mod +++ /dev/null @@ -1,635 +0,0 @@ -MODULE Files0; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files *) - -(* this module is not for use by developers and inteded to bootstrap voc *) -(* for general use import Files module *) - - IMPORT SYSTEM, Unix, Kernel := Kernel0, Args, Console; - - (* standard data type I/O - - little endian, - Sint:1, Int:2, Lint:4 - ORD({0}) = 1, - false = 0, true =1 - IEEE real format, - null terminated strings, - compact numbers according to M.Odersky *) - - - CONST - nofbufs = 4; - bufsize = 4096; - fileTabSize = 64; - noDesc = -1; - notDone = -1; - - (* file states *) - open = 0; create = 1; close = 2; - - - TYPE - FileName = ARRAY 101 OF CHAR; - File* = POINTER TO Handle; - Buffer = POINTER TO BufDesc; - - Handle = RECORD - workName, registerName: FileName; - tempFile: BOOLEAN; - dev, ino, mtime: LONGINT; - fd-, len, pos: LONGINT; - bufs: ARRAY nofbufs OF Buffer; - swapper, state: INTEGER - END ; - - BufDesc = RECORD - f: File; - chg: BOOLEAN; - org, size: LONGINT; - data: ARRAY bufsize OF SYSTEM.BYTE - END ; - - Rider* = RECORD - res*: LONGINT; - eof*: BOOLEAN; - buf: Buffer; - org, offset: LONGINT - END ; - - Time = POINTER TO TimeDesc; - TimeDesc = RECORD - sec*, min*, hour*, mday*, mon*, year*, wday*, isdst*, zone*, gmtoff*: LONGINT; -(* sec*, min*, hour*, mday*, mon*, year*, wday*, isdst*, zone*, gmtoff*: INTEGER;*) - END ; - - VAR - fileTab: ARRAY fileTabSize OF LONGINT (*=File*); - tempno: INTEGER; - -(* for localtime *) - PROCEDURE -includetime() - '#include "time.h"'; - - PROCEDURE -localtime(VAR clock: LONGINT): Time - "(Files0_Time) localtime(clock)"; - - PROCEDURE -getcwd(VAR cwd: Unix.Name) - "getcwd(cwd, cwd__len)"; - - PROCEDURE -IdxTrap "__HALT(-1)"; - - PROCEDURE^ Finalize(o: SYSTEM.PTR); - - PROCEDURE Err(s: ARRAY OF CHAR; f: File; errno: LONGINT); - BEGIN - Console.Ln; Console.String("-- "); Console.String(s); Console.String(": "); - IF f # NIL THEN - IF f.registerName # "" THEN Console.String(f.registerName) ELSE Console.String(f.workName) END - END ; - IF errno # 0 THEN Console.String(" errno = "); Console.Int(errno, 1) END ; - Console.Ln; - HALT(99) - END Err; - - PROCEDURE MakeFileName(dir, name: ARRAY OF CHAR; VAR dest: ARRAY OF CHAR); - VAR i, j: INTEGER; - BEGIN i := 0; j := 0; - WHILE dir[i] # 0X DO dest[i] := dir[i]; INC(i) END ; - IF dest[i-1] # "/" THEN dest[i] := "/"; INC(i) END ; - WHILE name[j] # 0X DO dest[i] := name[j]; INC(i); INC(j) END ; - dest[i] := 0X - END MakeFileName; - - PROCEDURE GetTempName(finalName: ARRAY OF CHAR; VAR name: ARRAY OF CHAR); - VAR n, i, j: LONGINT; - BEGIN - INC(tempno); n := tempno; i := 0; - IF finalName[0] # "/" THEN (* relative pathname *) - WHILE Kernel.CWD[i] # 0X DO name[i] := Kernel.CWD[i]; INC(i) END; - IF Kernel.CWD[i-1] # "/" THEN name[i] := "/"; INC(i) END - END; - j := 0; - WHILE finalName[j] # 0X DO name[i] := finalName[j]; INC(i); INC(j) END; - DEC(i); - WHILE name[i] # "/" DO DEC(i) END; - name[i+1] := "."; name[i+2] := "t"; name[i+3] := "m"; name[i+4] := "p"; name[i+5] := "."; INC(i, 6); - WHILE n > 0 DO name[i] := CHR(n MOD 10 + ORD("0")); n := n DIV 10; INC(i) END; - name[i] := "."; INC(i); n := SHORT(Unix.Getpid()); - WHILE n > 0 DO name[i] := CHR(n MOD 10 + ORD("0")); n := n DIV 10; INC(i) END; - name[i] := 0X - END GetTempName; - - PROCEDURE Create(f: File); - VAR stat: Unix.Status; done: BOOLEAN; - errno: LONGINT; err: ARRAY 32 OF CHAR; - BEGIN - IF f.fd = noDesc THEN - IF f.state = create THEN GetTempName(f.registerName, f.workName); f.tempFile := TRUE - ELSIF f.state = close THEN - f.workName := f.registerName; f.registerName := ""; f.tempFile := FALSE - END ; - errno := Unix.Unlink(f.workName); (*unlink first to avoid stale NFS handles and to avoid reuse of inodes*) - f.fd := Unix.Open(f.workName, Unix.rdwr + Unix.creat + Unix.trunc, {2, 4,5, 7,8}); - done := f.fd >= 0; errno := Unix.errno(); - IF (~done & ((errno = Unix.ENFILE) OR (errno = Unix.EMFILE))) OR (done & (f.fd >= fileTabSize)) THEN - IF done & (f.fd >= fileTabSize) THEN errno := Unix.Close(f.fd) END ; - Kernel.GC(TRUE); - f.fd := Unix.Open(f.workName, Unix.rdwr + Unix.creat + Unix.trunc, {2, 4,5, 7,8}); - done := f.fd >= 0 - END ; - IF done THEN - IF f.fd >= fileTabSize THEN errno := Unix.Close(f.fd); Err("too many files open", f, 0) - ELSE fileTab[f.fd] := SYSTEM.VAL(LONGINT, f); INC(Kernel.nofiles); Kernel.RegisterObject(f, Finalize); - f.state := open; f.pos := 0; errno := Unix.Fstat(f.fd, stat); - f.dev := stat.dev; f.ino := stat.ino; f.mtime := stat.mtime - END - ELSE errno := Unix.errno(); - IF errno = Unix.ENOENT THEN err := "no such directory" - ELSIF (errno = Unix.ENFILE) OR (errno = Unix.EMFILE) THEN err := "too many files open" - ELSE err := "file not created" - END ; - Err(err, f, errno) - END - END - END Create; - - PROCEDURE Flush(buf: Buffer); - VAR res: LONGINT; f: File; stat: Unix.Status; - BEGIN - IF buf.chg THEN f := buf.f; Create(f); - IF buf.org # f.pos THEN res := Unix.Lseek(f.fd, buf.org, 0) END ; - res := Unix.Write(f.fd, SYSTEM.ADR(buf.data), buf.size); - IF res < 0 THEN Err("error in writing file", f, Unix.errno()) END ; - f.pos := buf.org + buf.size; - buf.chg := FALSE; - res := Unix.Fstat(f.fd, stat); - f.mtime := stat.mtime - END - END Flush; - - PROCEDURE Close* (f: File); - VAR i, res: LONGINT; - BEGIN - IF (f.state # create) OR (f.registerName # "") THEN - Create(f); i := 0; - WHILE (i < nofbufs) & (f.bufs[i] # NIL) DO Flush(f.bufs[i]); INC(i) END ; - res := Unix.Fsync(f.fd); - IF res < 0 THEN Err("error in writing file", f, Unix.errno()) END - END - END Close; - - PROCEDURE Length* (f: File): LONGINT; - BEGIN RETURN f.len - END Length; - - PROCEDURE New* (name: ARRAY OF CHAR): File; - VAR f: File; - BEGIN - NEW(f); f.workName := ""; COPY(name, f.registerName); - f.fd := noDesc; f.state := create; f.len := 0; f.pos := 0; f.swapper := -1; (*all f.buf[i] = NIL*) - RETURN f - END New; - - PROCEDURE ScanPath(VAR pos: INTEGER; VAR dir: ARRAY OF CHAR); (* supports ~, ~user and blanks inside path *) - VAR i: INTEGER; ch: CHAR; home: ARRAY 256 OF CHAR; - BEGIN - i := 0; ch := Kernel.OBERON[pos]; - WHILE (ch = " ") OR (ch = ":") DO INC(pos); ch := Kernel.OBERON[pos] END ; - IF ch = "~" THEN - INC(pos); ch := Kernel.OBERON[pos]; - home := ""; Args.GetEnv("HOME", home); - WHILE home[i] # 0X DO dir[i] := home[i]; INC(i) END ; - IF (ch # "/") & (ch # 0X) & (ch # ":") & (ch # " ") THEN - WHILE (i > 0) & (dir[i-1] # "/") DO DEC(i) END - END - END ; - WHILE (ch # 0X) & (ch # ":") DO dir[i] := ch; INC(i); INC(pos); ch := Kernel.OBERON[pos] END ; - WHILE (i > 0) & (dir[i-1] = " ") DO DEC(i) END ; - dir[i] := 0X - END ScanPath; - - PROCEDURE HasDir(VAR name: ARRAY OF CHAR): BOOLEAN; - VAR i: INTEGER; ch: CHAR; - BEGIN i := 0; ch := name[0]; - WHILE (ch # 0X) & (ch # "/") DO INC(i); ch := name[i] END ; - RETURN ch = "/" - END HasDir; - - PROCEDURE CacheEntry(dev, ino: LONGINT; mtime: LONGINT): File; - VAR f: File; i: INTEGER; stat: Unix.Status; res: LONGINT; - BEGIN i := 0; - WHILE i < fileTabSize DO - f := SYSTEM.VAL(File, fileTab[i]); - IF (f # NIL) & (ino = f.ino) & (dev = f.dev) THEN - IF mtime # f.mtime THEN i := 0; - WHILE i < nofbufs DO - IF f.bufs[i] # NIL THEN f.bufs[i].org := -1; f.bufs[i] := NIL END ; - INC(i) - END ; - f.swapper := -1; f.mtime := mtime; - res := Unix.Fstat(f.fd, stat); f.len := stat.size - END ; - RETURN f - END ; - INC(i) - END ; - RETURN NIL - END CacheEntry; - - PROCEDURE Old* (name: ARRAY OF CHAR): File; - VAR f: File; fd, res, errno: LONGINT; pos: INTEGER; done: BOOLEAN; - dir, path: ARRAY 256 OF CHAR; - stat: Unix.Status; - BEGIN - IF name # "" THEN - IF HasDir(name) THEN dir := ""; COPY(name, path) - ELSE pos := 0; ScanPath(pos, dir); MakeFileName(dir, name, path); ScanPath(pos, dir) - END ; - LOOP - fd := Unix.Open(path, Unix.rdwr, {}); done := fd >= 0; errno := Unix.errno(); - IF (~done & ((errno = Unix.ENFILE) OR (errno = Unix.EMFILE))) OR (done & (fd >= fileTabSize)) THEN - IF done & (fd >= fileTabSize) THEN res := Unix.Close(fd) END ; - Kernel.GC(TRUE); - fd := Unix.Open(path, Unix.rdwr, {}); - done := fd >= 0; errno := Unix.errno(); - IF ~done & ((errno = Unix.ENFILE) OR (errno = Unix.EMFILE)) THEN Err("too many files open", f, errno) END - END ; - IF ~done & ((errno = Unix.EACCES) OR (errno = Unix.EROFS) OR (errno = Unix.EAGAIN)) THEN - (* errno EAGAIN observed on Solaris 2.4 *) - fd := Unix.Open(path, Unix.rdonly, {}); done := fd >= 0; errno := Unix.errno() - END ; -IF (~done) & (errno # Unix.ENOENT) THEN - Console.String("warning Files0.Old "); Console.String(name); - Console.String(" errno = "); Console.Int(errno, 0); Console.Ln; -END ; - IF done THEN - res := Unix.Fstat(fd, stat); - f := CacheEntry(stat.dev, stat.ino, stat.mtime); - IF f # NIL THEN res := Unix.Close(fd); RETURN f - ELSIF fd >= fileTabSize THEN res := Unix.Close(fd); Err("too many files open", f, 0) - ELSE NEW(f); fileTab[fd] := SYSTEM.VAL(LONGINT, f); INC(Kernel.nofiles); Kernel.RegisterObject(f, Finalize); - f.fd := fd; f.state := open; f.len := stat.size; f.pos := 0; f.swapper := -1; (*all f.buf[i] = NIL*) - COPY(name, f.workName); f.registerName := ""; f.tempFile := FALSE; - f.dev := stat.dev; f.ino := stat.ino; f.mtime := stat.mtime; - RETURN f - END - ELSIF dir = "" THEN RETURN NIL - ELSE MakeFileName(dir, name, path); ScanPath(pos, dir) - END - END - ELSE RETURN NIL - END - END Old; - - PROCEDURE Purge* (f: File); - VAR i: INTEGER; stat: Unix.Status; res: LONGINT; - BEGIN i := 0; - WHILE i < nofbufs DO - IF f.bufs[i] # NIL THEN f.bufs[i].org := -1; f.bufs[i] := NIL END ; - INC(i) - END ; - IF f.fd # noDesc THEN res := Unix.Ftruncate(f.fd, 0); res := Unix.Lseek(f.fd, 0, 0) END ; - f.pos := 0; f.len := 0; f.swapper := -1; - res := Unix.Fstat(f.fd, stat); f.mtime := stat.mtime - END Purge; - - PROCEDURE GetDate* (f: File; VAR t, d: LONGINT); - VAR stat: Unix.Status; clock, res: LONGINT; time: Time; - BEGIN - Create(f); res := Unix.Fstat(f.fd, stat); - time := localtime(stat.mtime); - t := time.sec + ASH(time.min, 6) + ASH(time.hour, 12); - d := time.mday + ASH(time.mon+1, 5) + ASH(time.year MOD 100, 9) - END GetDate; - - PROCEDURE Pos* (VAR r: Rider): LONGINT; - BEGIN RETURN r.org + r.offset - END Pos; - - PROCEDURE Set* (VAR r: Rider; f: File; pos: LONGINT); - VAR org, offset, i, n, res: LONGINT; buf: Buffer; - BEGIN - IF f # NIL THEN - IF pos > f.len THEN pos := f.len ELSIF pos < 0 THEN pos := 0 END ; - offset := pos MOD bufsize; org := pos - offset; i := 0; - WHILE (i < nofbufs) & (f.bufs[i] # NIL) & (org # f.bufs[i].org) DO INC(i) END ; - IF i < nofbufs THEN - IF f.bufs[i] = NIL THEN NEW(buf); buf.chg := FALSE; buf.org := -1; buf.f := f; f.bufs[i] := buf - ELSE buf := f.bufs[i] - END - ELSE - f.swapper := (f.swapper + 1) MOD nofbufs; - buf := f.bufs[f.swapper]; - Flush(buf) - END ; - IF buf.org # org THEN - IF org = f.len THEN buf.size := 0 - ELSE Create(f); - IF f.pos # org THEN res := Unix.Lseek(f.fd, org, 0) END ; - n := Unix.ReadBlk(f.fd, buf.data); - IF n < 0 THEN Err("read from file not done", f, Unix.errno()) END ; - f.pos := org + n; - buf.size := n - END ; - buf.org := org; buf.chg := FALSE - END - ELSE buf := NIL; org := 0; offset := 0 - END ; - r.buf := buf; r.org := org; r.offset := offset; r.eof := FALSE; r.res := 0 - END Set; - - PROCEDURE Read* (VAR r: Rider; VAR x: SYSTEM.BYTE); - VAR offset: LONGINT; buf: Buffer; - BEGIN - buf := r.buf; offset := r.offset; - IF r.org # buf.org THEN Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset END ; - IF (offset < buf.size) THEN - x := buf.data[offset]; r.offset := offset + 1 - ELSIF r.org + offset < buf.f.len THEN - Set(r, r.buf.f, r.org + offset); - x := r.buf.data[0]; r.offset := 1 - ELSE - x := 0X; r.eof := TRUE - END - END Read; - - PROCEDURE ReadBytes* (VAR r: Rider; VAR x: ARRAY OF SYSTEM.BYTE; n: LONGINT); - VAR xpos, min, restInBuf, offset: LONGINT; buf: Buffer; - BEGIN - IF n > LEN(x) THEN IdxTrap END ; - xpos := 0; buf := r.buf; offset := r.offset; - WHILE n > 0 DO - IF (r.org # buf.org) OR (offset >= bufsize) THEN - Set(r, buf.f, r.org + offset); - buf := r.buf; offset := r.offset - END ; - restInBuf := buf.size - offset; - IF restInBuf = 0 THEN r.res := n; r.eof := TRUE; RETURN - ELSIF n > restInBuf THEN min := restInBuf ELSE min := n END ; - SYSTEM.MOVE(SYSTEM.ADR(buf.data) + offset, SYSTEM.ADR(x) + xpos, min); - INC(offset, min); r.offset := offset; INC(xpos, min); DEC(n, min) - END ; - r.res := 0; r.eof := FALSE - END ReadBytes; - - PROCEDURE ReadByte* (VAR r : Rider; VAR x : ARRAY OF SYSTEM.BYTE); - BEGIN - ReadBytes(r, x, 1); - END ReadByte; - - PROCEDURE Base* (VAR r: Rider): File; - BEGIN RETURN r.buf.f - END Base; - - PROCEDURE Write* (VAR r: Rider; x: SYSTEM.BYTE); - VAR buf: Buffer; offset: LONGINT; - BEGIN - buf := r.buf; offset := r.offset; - IF (r.org # buf.org) OR (offset >= bufsize) THEN - Set(r, buf.f, r.org + offset); - buf := r.buf; offset := r.offset - END ; - buf.data[offset] := x; - buf.chg := TRUE; - IF offset = buf.size THEN - INC(buf.size); INC(buf.f.len) - END ; - r.offset := offset + 1; r.res := 0 - END Write; - - PROCEDURE WriteBytes* (VAR r: Rider; VAR x: ARRAY OF SYSTEM.BYTE; n: LONGINT); - VAR xpos, min, restInBuf, offset: LONGINT; buf: Buffer; - BEGIN - IF n > LEN(x) THEN IdxTrap END ; - xpos := 0; buf := r.buf; offset := r.offset; - WHILE n > 0 DO - IF (r.org # buf.org) OR (offset >= bufsize) THEN - Set(r, buf.f, r.org + offset); - buf := r.buf; offset := r.offset - END ; - restInBuf := bufsize - offset; - IF n > restInBuf THEN min := restInBuf ELSE min := n END ; - SYSTEM.MOVE(SYSTEM.ADR(x) + xpos, SYSTEM.ADR(buf.data) + offset, min); - INC(offset, min); r.offset := offset; - IF offset > buf.size THEN INC(buf.f.len, offset - buf.size); buf.size := offset END ; - INC(xpos, min); DEC(n, min); buf.chg := TRUE - END ; - r.res := 0 - END WriteBytes; - -(* another solution would be one that is similar to ReadBytes, WriteBytes. -No code duplication, more symmetric, only two ifs for -Read and Write in buffer, buf.size replaced by bufsize in Write ops, buf.size and len -must be made consistent with offset (if offset > buf.size) in a lazy way. - -PROCEDURE Write* (VAR r: Rider; x: SYSTEM.BYTE); - VAR buf: Buffer; offset: LONGINT; -BEGIN - buf := r.buf; offset := r.offset; - IF (offset >= bufsize) OR (r.org # buf.org) THEN - Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset; - END ; - buf.data[offset] := x; r.offset := offset + 1; buf.chg := TRUE -END Write; - -PROCEDURE WriteBytes ... - -PROCEDURE Read* (VAR r: Rider; VAR x: SYSTEM.BYTE); - VAR offset: LONGINT; buf: Buffer; -BEGIN - buf := r.buf; offset := r.offset; - IF (offset >= buf.size) OR (r.org # buf.org) THEN - IF r.org + offset >= buf.f.len THEN x := 0X; r.eof := TRUE; RETURN - ELSE Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset - END - END ; - x := buf.data[offset]; r.offset := offset + 1 -END Read; - -but this would also affect Set, Length, and Flush. -Especially Length would become fairly complex. -*) - - PROCEDURE Delete* (name: ARRAY OF CHAR; VAR res: INTEGER); - BEGIN - res := SHORT(Unix.Unlink(name)); - res := SHORT(Unix.errno()) - END Delete; - - PROCEDURE Rename* (old, new: ARRAY OF CHAR; VAR res: INTEGER); - VAR fdold, fdnew, n, errno, r: LONGINT; - ostat, nstat: Unix.Status; - buf: ARRAY 4096 OF CHAR; - BEGIN - r := Unix.Stat(old, ostat); - IF r >= 0 THEN - r := Unix.Stat(new, nstat); - IF (r >= 0) & ((ostat.dev # nstat.dev) OR (ostat.ino # nstat.ino)) THEN - Delete(new, res); (* work around stale nfs handles *) - END ; - r := Unix.Rename(old, new); - IF r < 0 THEN res := SHORT(Unix.errno()); - IF res = Unix.EXDEV THEN (* cross device link, move the file *) - fdold := Unix.Open(old, Unix.rdonly, {}); - IF fdold < 0 THEN res := 2; RETURN END ; - fdnew := Unix.Open(new, Unix.rdwr + Unix.creat + Unix.trunc, {2, 4,5, 7,8}); - IF fdnew < 0 THEN r := Unix.Close(fdold); res := 3; RETURN END ; - n := Unix.Read(fdold, SYSTEM.ADR(buf), bufsize); - WHILE n > 0 DO - r := Unix.Write(fdnew, SYSTEM.ADR(buf), n); - IF r < 0 THEN errno := Unix.errno(); r := Unix.Close(fdold); r := Unix.Close(fdnew); - Err("cannot move file", NIL, errno) - END ; - n := Unix.Read(fdold, SYSTEM.ADR(buf), bufsize) - END ; - errno := Unix.errno(); - r := Unix.Close(fdold); r := Unix.Close(fdnew); - IF n = 0 THEN r := Unix.Unlink(old); res := 0 - ELSE Err("cannot move file", NIL, errno) - END ; - ELSE RETURN (* res is Unix.Rename return code *) - END - END ; - res := 0 - ELSE res := 2 (* old file not found *) - END - END Rename; - - PROCEDURE Register* (f: File); - VAR idx, errno: INTEGER; f1: File; file: ARRAY 104 OF CHAR; - BEGIN - IF (f.state = create) & (f.registerName # "") THEN f.state := close (* shortcut renaming *) END ; - Close(f); - IF f.registerName # "" THEN - Rename(f.workName, f.registerName, errno); - IF errno # 0 THEN COPY(f.registerName, file); HALT(99) END ; - f.workName := f.registerName; f.registerName := ""; f.tempFile := FALSE - END - END Register; - - PROCEDURE ChangeDirectory*(path: ARRAY OF CHAR; VAR res: INTEGER); - BEGIN - res := SHORT(Unix.Chdir(path)); - getcwd(Kernel.CWD) - END ChangeDirectory; - - PROCEDURE FlipBytes(VAR src, dest: ARRAY OF SYSTEM.BYTE); - VAR i, j: LONGINT; - BEGIN - IF ~Kernel.littleEndian THEN i := LEN(src); j := 0; - WHILE i > 0 DO DEC(i); dest[j] := src[i]; INC(j) END - ELSE SYSTEM.MOVE(SYSTEM.ADR(src), SYSTEM.ADR(dest), LEN(src)) - END - END FlipBytes; - - PROCEDURE ReadBool* (VAR R: Rider; VAR x: BOOLEAN); - BEGIN Read(R, SYSTEM.VAL(CHAR, x)) - END ReadBool; - - PROCEDURE ReadInt* (VAR R: Rider; VAR x: INTEGER); - VAR b: ARRAY 2 OF CHAR; - BEGIN ReadBytes(R, b, 2); - x := ORD(b[0]) + ORD(b[1])*256 - END ReadInt; - - PROCEDURE ReadLInt* (VAR R: Rider; VAR x: LONGINT); - VAR b: ARRAY 4 OF CHAR; - BEGIN ReadBytes(R, b, 4); - x := ORD(b[0]) + ORD(b[1])*100H + ORD(b[2])*10000H + ORD(b[3])*1000000H - END ReadLInt; - - PROCEDURE ReadSet* (VAR R: Rider; VAR x: SET); - VAR b: ARRAY 4 OF CHAR; - BEGIN ReadBytes(R, b, 4); - x := SYSTEM.VAL(SET, ORD(b[0]) + ORD(b[1])*100H + ORD(b[2])*10000H + ORD(b[3])*1000000H) - END ReadSet; - - PROCEDURE ReadReal* (VAR R: Rider; VAR x: REAL); - VAR b: ARRAY 4 OF CHAR; - BEGIN ReadBytes(R, b, 4); FlipBytes(b, x) - END ReadReal; - - PROCEDURE ReadLReal* (VAR R: Rider; VAR x: LONGREAL); - VAR b: ARRAY 8 OF CHAR; - BEGIN ReadBytes(R, b, 8); FlipBytes(b, x) - END ReadLReal; - - PROCEDURE ReadString* (VAR R: Rider; VAR x: ARRAY OF CHAR); - VAR i: INTEGER; ch: CHAR; - BEGIN i := 0; - REPEAT Read(R, ch); x[i] := ch; INC(i) UNTIL ch = 0X - END ReadString; - - PROCEDURE ReadNum* (VAR R: Rider; VAR x: LONGINT); - VAR s: SHORTINT; ch: CHAR; n: LONGINT; - BEGIN s := 0; n := 0; Read(R, ch); - WHILE ORD(ch) >= 128 DO INC(n, ASH(ORD(ch) - 128, s) ); INC(s, 7); Read(R, ch) END; - INC(n, ASH(ORD(ch) MOD 64 - ORD(ch) DIV 64 * 64, s) ); - x := n - END ReadNum; - - PROCEDURE WriteBool* (VAR R: Rider; x: BOOLEAN); - BEGIN Write(R, SYSTEM.VAL(CHAR, x)) - END WriteBool; - - PROCEDURE WriteInt* (VAR R: Rider; x: INTEGER); - VAR b: ARRAY 2 OF CHAR; - BEGIN b[0] := CHR(x); b[1] := CHR(x DIV 256); - WriteBytes(R, b, 2); - END WriteInt; - - PROCEDURE WriteLInt* (VAR R: Rider; x: LONGINT); - VAR b: ARRAY 4 OF CHAR; - BEGIN - b[0] := CHR(x); b[1] := CHR(x DIV 100H); b[2] := CHR(x DIV 10000H); b[3] := CHR(x DIV 1000000H); - WriteBytes(R, b, 4); - END WriteLInt; - - PROCEDURE WriteSet* (VAR R: Rider; x: SET); - VAR b: ARRAY 4 OF CHAR; i: LONGINT; - BEGIN i := SYSTEM.VAL(LONGINT, x); - 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; - - PROCEDURE WriteReal* (VAR R: Rider; x: REAL); - VAR b: ARRAY 4 OF CHAR; - BEGIN FlipBytes(x, b); WriteBytes(R, b, 4) - END WriteReal; - - PROCEDURE WriteLReal* (VAR R: Rider; x: LONGREAL); - VAR b: ARRAY 8 OF CHAR; - BEGIN FlipBytes(x, b); WriteBytes(R, b, 8) - END WriteLReal; - - PROCEDURE WriteString* (VAR R: Rider; x: ARRAY [1] OF CHAR); - VAR i: INTEGER; - BEGIN i := 0; - WHILE x[i] # 0X DO INC(i) END ; - WriteBytes(R, x, i+1) - END WriteString; - - PROCEDURE WriteNum* (VAR R: Rider; x: LONGINT); - BEGIN - WHILE (x < - 64) OR (x > 63) DO Write(R, CHR(x MOD 128 + 128)); x := x DIV 128 END; - Write(R, CHR(x MOD 128)) - END WriteNum; - - PROCEDURE Finalize(o: SYSTEM.PTR); - VAR f: File; res: LONGINT; - BEGIN - f := SYSTEM.VAL(File, o); - IF f.fd >= 0 THEN - fileTab[f.fd] := 0; res := Unix.Close(f.fd); f.fd := -1; DEC(Kernel.nofiles); - IF f.tempFile THEN res := Unix.Unlink(f.workName) END - END - END Finalize; - - PROCEDURE Init; - VAR i: LONGINT; - BEGIN - i := 0; WHILE i < fileTabSize DO fileTab[i] := 0; INC(i) END ; - tempno := -1; Kernel.nofiles := 0 - END Init; - -BEGIN Init -END Files0. diff --git a/src/system/linux/gcc/x86/SYSTEM.c0 b/src/system/linux/gcc/x86/SYSTEM.c0 deleted file mode 100644 index 580449aa..00000000 --- a/src/system/linux/gcc/x86/SYSTEM.c0 +++ /dev/null @@ -1,205 +0,0 @@ -/* -* The body prefix file of the Ofront runtime system, Version 1.0 -* -* Copyright (c) Software Templ, 1994, 1995 -* -* Module SYSTEM is subject to change any time without prior notification. -* Software Templ disclaims all warranties with regard to module SYSTEM, -* in particular shall Software Templ not be liable for any damage resulting -* from inappropriate use or modification of module SYSTEM. -* -* Version 1.1 jt, 24.11.95 fixes for correct pointer arithmetic on Cray computers -* jt 31.1.2007 ANSI prototypes for malloc and exit in order to avoid cc warnings -* -*/ - -#include "SYSTEM.h" -#ifdef __STDC__ -#include "stdarg.h" -#else -#include "varargs.h" -#endif - -extern void *malloc(long size); -extern void exit(int status); - -void (*SYSTEM_Halt)(); -LONGINT SYSTEM_halt; /* x in HALT(x) */ -LONGINT SYSTEM_assert; /* x in ASSERT(cond, x) */ -LONGINT SYSTEM_argc; -LONGINT SYSTEM_argv; -LONGINT SYSTEM_lock; -BOOLEAN SYSTEM_interrupted; -static LONGINT SYSTEM_mainfrm; /* adr of main proc stack frame, used for stack collection */ - -#define Lock SYSTEM_lock++ -#define Unlock SYSTEM_lock--; if (SYSTEM_interrupted && (SYSTEM_lock == 0)) __HALT(-9) - - -static void SYSTEM_InitHeap(); -void *SYSTEM__init(); - -void SYSTEM_INIT(argc, argvadr) - int argc; long argvadr; -{ - SYSTEM_mainfrm = argvadr; - SYSTEM_argc = argc; - SYSTEM_argv = *(long*)argvadr; - SYSTEM_InitHeap(); - SYSTEM_halt = -128; - SYSTEM__init(); -} - -void SYSTEM_FINI() -{ - SYSTEM_FINALL(); -} - -long SYSTEM_XCHK(i, ub) long i, ub; {return __X(i, ub);} -long SYSTEM_RCHK(i, ub) long i, ub; {return __R(i, ub);} -long SYSTEM_ASH(i, n) long i, n; {return __ASH(i, n);} -long SYSTEM_ABS(i) long i; {return __ABS(i);} -double SYSTEM_ABSD(i) double i; {return __ABS(i);} - -void SYSTEM_INHERIT(t, t0) - long *t, *t0; -{ - t -= __TPROC0OFF; - t0 -= __TPROC0OFF; - while (*t0 != __EOM) {*t = *t0; t--; t0--;} -} - -void SYSTEM_ENUMP(adr, n, P) - long *adr; - long n; - void (*P)(); -{ - while (n > 0) {P(*adr); adr++; n--;} -} - -void SYSTEM_ENUMR(adr, typ, size, n, P) - char *adr; - long *typ, size, n; - void (*P)(); -{ - long *t, off; - typ++; - while (n > 0) { - t = typ; - off = *t; - while (off >= 0) {P(*(long*)(adr+off)); t++; off = *t;} - adr += size; n--; - } -} - -long SYSTEM_DIV(x, y) - unsigned long x, y; -{ if ((long) x >= 0) return (x / y); - else return -((y - 1 - x) / y); -} - -long SYSTEM_MOD(x, y) - unsigned long x, y; -{ unsigned long m; - if ((long) x >= 0) return (x % y); - else { m = (-x) % y; - if (m != 0) return (y - m); else return 0; - } -} - -long SYSTEM_ENTIER(x) - double x; -{ - long y; - if (x >= 0) - return (long)x; - else { - y = (long)x; - if (y <= x) return y; else return y - 1; - } -} - -void SYSTEM_HALT(n) - int n; -{ - SYSTEM_halt = n; - if (SYSTEM_Halt!=0) SYSTEM_Halt(n); - exit(n); -} - -#ifdef __STDC__ -SYSTEM_PTR SYSTEM_NEWARR(long *typ, long elemsz, int elemalgn, int nofdim, int nofdyn, ...) -#else -SYSTEM_PTR SYSTEM_NEWARR(typ, elemsz, elemalgn, nofdim, nofdyn, va_alist) - long *typ, elemsz; - int elemalgn, nofdim, nofdyn; - va_dcl -#endif -{ - long nofelems, size, dataoff, n, nptr, *x, *p, nofptrs, i, *ptab, off; - va_list ap; -#ifdef __STDC__ - va_start(ap, nofdyn); -#else - va_start(ap); -#endif - nofelems = 1; - while (nofdim > 0) { - nofelems = nofelems * va_arg(ap, long); nofdim--; - if (nofelems <= 0) __HALT(-20); - } - va_end(ap); - dataoff = nofdyn * sizeof(long); - if (elemalgn > sizeof(long)) { - n = dataoff % elemalgn; - if (n != 0) dataoff += elemalgn - n; - } - size = dataoff + nofelems * elemsz; - Lock; - if (typ == NIL) { - /* element typ does not contain pointers */ - x = SYSTEM_NEWBLK(size); - } - else if (typ == POINTER__typ) { - /* element type is a pointer */ - x = SYSTEM_NEWBLK(size + nofelems * sizeof(long)); - p = (long*)x[-1]; - p[-nofelems] = *p; /* build new type desc in situ: 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ - p -= nofelems - 1; n = 1; /* n =1 for skipping the size field */ - while (n <= nofelems) {*p = n*sizeof(long); p++; n++;} - *p = - (nofelems + 1) * sizeof(long); /* sentinel */ - x[-1] -= nofelems * sizeof(long); - } - else { - /* element type is a record that contains pointers */ - ptab = typ + 1; nofptrs = 0; - while (ptab[nofptrs] >= 0) {nofptrs++;} /* number of pointers per element */ - nptr = nofelems * nofptrs; /* total number of pointers */ - x = SYSTEM_NEWBLK(size + nptr * sizeof(long)); - p = (long*)x[- 1]; - p[-nptr] = *p; /* build new type desc in situ; 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ - p -= nptr - 1; n = 0; off = dataoff; - while (n < nofelems) {i = 0; - while (i < nofptrs) {*p = off + ptab[i]; p++; i++;} - off += elemsz; n++; - } - *p = - (nptr + 1) * sizeof(long); /* sentinel */ - x[-1] -= nptr * sizeof(long); - } - if (nofdyn != 0) { - /* setup len vector for index checks */ -#ifdef __STDC__ - va_start(ap, nofdyn); -#else - va_start(ap); -#endif - p = x; - while (nofdyn > 0) {*p = va_arg(ap, long); p++, nofdyn--;} - va_end(ap); - } - Unlock; - return x; -} - -/* ----------- end of SYSTEM.co ------------- */ - diff --git a/src/system/linux/gcc/x86/SYSTEM.h b/src/system/linux/gcc/x86/SYSTEM.h deleted file mode 100644 index ea9ae5d6..00000000 --- a/src/system/linux/gcc/x86/SYSTEM.h +++ /dev/null @@ -1,220 +0,0 @@ -#ifndef SYSTEM__h -#define SYSTEM__h - -/* - -the Ofront runtime system interface and macros library -copyright (c) Josef Templ, 1995, 1996 - -gcc for Linux version (same as SPARC/Solaris2) -uses double # as concatenation operator - -*/ - -#include -#include /* for type sizes -- noch */ - -//extern void *memcpy(void *dest, const void *src, long n); -extern void *memcpy(void *dest, const void *src, size_t n); -extern void *malloc(long size); -extern void exit(int status); - -#define export -#define import extern - -/* constants */ -#define __MAXEXT 16 -#define NIL 0L -#define POINTER__typ (long*)1L /* not NIL and not a valid type */ - -/* basic types */ -typedef char BOOLEAN; -typedef unsigned char CHAR; -typedef signed char SHORTINT; -typedef short int INTEGER; -typedef long LONGINT; -typedef float REAL; -typedef double LONGREAL; -typedef unsigned long SET; -typedef void *SYSTEM_PTR; -typedef unsigned char SYSTEM_BYTE; -typedef int8_t SYSTEM_INT8; -typedef int16_t SYSTEM_INT16; -typedef int32_t SYSTEM_INT32; -typedef int64_t SYSTEM_INT64; - -/* runtime system routines */ -extern long SYSTEM_DIV(); -extern long SYSTEM_MOD(); -extern long SYSTEM_ENTIER(); -extern long SYSTEM_ASH(); -extern long SYSTEM_ABS(); -extern long SYSTEM_XCHK(); -extern long SYSTEM_RCHK(); -extern double SYSTEM_ABSD(); -extern SYSTEM_PTR SYSTEM_NEWREC(); -extern SYSTEM_PTR SYSTEM_NEWBLK(); -#ifdef __STDC__ -extern SYSTEM_PTR SYSTEM_NEWARR(long*, long, int, int, int, ...); -#else -extern SYSTEM_PTR SYSTEM_NEWARR(); -#endif -extern SYSTEM_PTR SYSTEM_REGMOD(); -extern void SYSTEM_INCREF(); -extern void SYSTEM_REGCMD(); -extern void SYSTEM_REGTYP(); -extern void SYSTEM_REGFIN(); -extern void SYSTEM_FINALL(); -extern void SYSTEM_INIT(); -extern void SYSTEM_FINI(); -extern void SYSTEM_HALT(); -extern void SYSTEM_INHERIT(); -extern void SYSTEM_ENUMP(); -extern void SYSTEM_ENUMR(); - -/* module registry */ -#define __DEFMOD static void *m; if(m!=0)return m -#define __REGMOD(name, enum) if(m==0)m=SYSTEM_REGMOD((CHAR*)name,enum); else return m -#define __ENDMOD return m -#define __INIT(argc, argv) static void *m; SYSTEM_INIT(argc, (long)&argv); -#define __REGMAIN(name, enum) m=SYSTEM_REGMOD(name,enum) -#define __FINI SYSTEM_FINI(); return 0 -#define __IMPORT(name) SYSTEM_INCREF(name##__init()) -#define __REGCMD(name, cmd) SYSTEM_REGCMD(m, name, cmd) - -/* SYSTEM ops */ -#define __SYSNEW(p, len) p=SYSTEM_NEWBLK((long)(len)) -#define __VAL(t, x) (*(t*)&(x)) -#define __GET(a, x, t) x= *(t*)(a) -#define __PUT(a, x, t) *(t*)(a)=x -#define __LSHL(x, n, t) ((t)((unsigned)(x)<<(n))) -#define __LSHR(x, n, t) ((t)((unsigned)(x)>>(n))) -#define __LSH(x, n, t) ((n)>=0? __LSHL(x, n, t): __LSHR(x, -(n), t)) -#define __ROTL(x, n, t) ((t)((unsigned)(x)<<(n)|(unsigned)(x)>>(8*sizeof(t)-(n)))) -#define __ROTR(x, n, t) ((t)((unsigned)(x)>>(n)|(unsigned)(x)<<(8*sizeof(t)-(n)))) -#define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) -#define __BIT(x, n) (*(unsigned long*)(x)>>(n)&1) -#define __MOVE(s, d, n) memcpy((char*)(d),(char*)(s),n) - -/* std procs and operator mappings */ -#define __SHORT(x, y) ((int)((unsigned long)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) -#define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) -#define __CHR(x) ((CHAR)__R(x, 256)) -#define __CHRF(x) ((CHAR)__RF(x, 256)) -#define __DIV(x, y) ((x)>=0?(x)/(y):-(((y)-1-(x))/(y))) -#define __DIVF(x, y) SYSTEM_DIV((long)(x),(long)(y)) -#define __MOD(x, y) ((x)>=0?(x)%(y):__MODF(x,y)) -#define __MODF(x, y) SYSTEM_MOD((long)(x),(long)(y)) -#define __NEW(p, t) p=SYSTEM_NEWREC((long)t##__typ) -#define __NEWARR SYSTEM_NEWARR -#define __HALT(x) SYSTEM_HALT(x) -#define __ASSERT(cond, x) if (!(cond)) {SYSTEM_assert = x; SYSTEM_HALT(-1);} -#define __ENTIER(x) SYSTEM_ENTIER(x) -#define __ABS(x) (((x)<0)?-(x):(x)) -#define __ABSF(x) SYSTEM_ABS((long)(x)) -#define __ABSFD(x) SYSTEM_ABSD((double)(x)) -#define __CAP(ch) ((CHAR)((ch)&0x5f)) -#define __ODD(x) ((x)&1) -#define __IN(x, s) (((s)>>(x))&1) -#define __SETOF(x) ((SET)1<<(x)) -#define __SETRNG(l, h) ((~(SET)0<<(l))&~(SET)0>>(8*sizeof(SET)-1-(h))) -#define __MASK(x, m) ((x)&~(m)) -#define __COPY(s, d, n) {char*_a=(void*)s,*_b=(void*)d;long _i=0,_t=n-1;while(_i<_t&&((_b[_i]=_a[_i])!=0)){_i++;};_b[_i]=0;} -static int __STRCMP(x, y) - CHAR *x, *y; -{long i = 0; CHAR ch1, ch2; - do {ch1 = x[i]; ch2 = y[i]; i++; - if (!ch1) return -(int)ch2; - } while (ch1==ch2); - return (int)ch1 - (int)ch2; -} -#define __ASH(x, n) ((n)>=0?__ASHL(x,n):__ASHR(x,-(n))) -#define __ASHL(x, n) ((long)(x)<<(n)) -#define __ASHR(x, n) ((long)(x)>>(n)) -#define __ASHF(x, n) SYSTEM_ASH((long)(x), (long)(n)) -#define __DUP(x, l, t) x=(void*)memcpy(alloca(l*sizeof(t)),x,l*sizeof(t)) -#define __DUPARR(v, t) v=(void*)memcpy(v##__copy,v,sizeof(t)) -#define __DEL(x) /* DUP with alloca frees storage automatically */ -#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(long)typ##__typ) -#define __TYPEOF(p) (*(((long**)(p))-1)) -#define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) - -/* runtime checks */ -#define __X(i, ub) (((unsigned)(long)(i)<(unsigned long)(ub))?i:(__HALT(-2),0)) -#define __XF(i, ub) SYSTEM_XCHK((long)(i), (long)(ub)) -#define __RETCHK __retchk: __HALT(-3) -#define __CASECHK __HALT(-4) -#define __GUARDP(p, typ, level) ((typ*)(__ISP(p,typ,level)?p:(__HALT(-5),p))) -#define __GUARDR(r, typ, level) (*((typ*)(__IS(r##__typ,typ,level)?r:(__HALT(-5),r)))) -#define __GUARDA(p, typ, level) ((struct typ*)(__IS(__TYPEOF(p),typ,level)?p:(__HALT(-5),p))) -#define __GUARDEQR(p, dyntyp, typ) if(dyntyp!=typ##__typ) __HALT(-6);*(p) -#define __GUARDEQP(p, typ) if(__TYPEOF(p)!=typ##__typ)__HALT(-6);*(p) -#define __WITHCHK __HALT(-7) -#define __R(i, ub) (((unsigned)(long)(i)<(unsigned long)(ub))?i:(__HALT(-8),0)) -#define __RF(i, ub) SYSTEM_RCHK((long)(i),(long)(ub)) - -/* record type descriptors */ -#define __TDESC(t, m, n) \ - static struct t##__desc {\ - long tproc[m]; \ - long tag, next, level, module; \ - char name[24]; \ - long *base[__MAXEXT]; \ - char *rsrvd; \ - long blksz, ptr[n+1]; \ - } t##__desc - -#define __BASEOFF (__MAXEXT+1) -#define __TPROC0OFF (__BASEOFF+24/sizeof(long)+5) -#define __EOM 1 -#define __TDFLDS(name, size) {__EOM}, 1, 0, 0, 0, name, {0}, 0, size -#define __ENUMP(adr, n, P) SYSTEM_ENUMP(adr, (long)(n), P) -#define __ENUMR(adr, typ, size, n, P) SYSTEM_ENUMR(adr, typ, (long)(size), (long)(n), P) - -#define __INITYP(t, t0, level) \ - t##__typ= &t##__desc.blksz; \ - memcpy(t##__desc.base, t0##__typ - __BASEOFF, level*sizeof(long)); \ - t##__desc.base[level]=t##__typ; \ - t##__desc.module=(long)m; \ - if(t##__desc.blksz!=sizeof(struct t)) __HALT(-15); \ - t##__desc.blksz=(t##__desc.blksz+5*sizeof(long)-1)/(4*sizeof(long))*(4*sizeof(long)); \ - SYSTEM_REGTYP(m, (long)&t##__desc.next); \ - SYSTEM_INHERIT(t##__typ, t0##__typ) - -/* Oberon-2 type bound procedures support */ -#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(long)proc -#define __SEND(typ, num, funtyp, parlist) ((funtyp)(*(typ-(__TPROC0OFF+num))))parlist - -/* runtime system variables */ -extern LONGINT SYSTEM_argc; -extern LONGINT SYSTEM_argv; -extern void (*SYSTEM_Halt)(); -extern LONGINT SYSTEM_halt; -extern LONGINT SYSTEM_assert; -extern SYSTEM_PTR SYSTEM_modules; -extern LONGINT SYSTEM_heapsize; -extern LONGINT SYSTEM_allocated; -extern LONGINT SYSTEM_lock; -extern SHORTINT SYSTEM_gclock; -extern BOOLEAN SYSTEM_interrupted; - -/* ANSI prototypes; not used so far -static int __STRCMP(CHAR *x, CHAR *y); -void SYSTEM_INIT(int argc, long argvadr); -void SYSTEM_FINI(void); -long SYSTEM_XCHK(long i, long ub); -long SYSTEM_RCHK(long i, long ub); -long SYSTEM_ASH(long i, long n); -long SYSTEM_ABS(long i); -double SYSTEM_ABSD(double i); -void SYSTEM_INHERIT(long *t, long *t0); -void SYSTEM_ENUMP(long *adr, long n, void (*P)(void*)); -void SYSTEM_ENUMR(char *adr, long *typ, long size, long n, void (*P)(void*)); -long SYSTEM_DIV(unsigned long x, unsigned long y); -long SYSTEM_MOD(unsigned long x, unsigned long y); -long SYSTEM_ENTIER(double x); -void SYSTEM_HALT(int n); -*/ - -#endif - diff --git a/src/system/linux/gcc/x86/Unix.Mod b/src/system/linux/gcc/x86/Unix.Mod deleted file mode 100644 index a77bccae..00000000 --- a/src/system/linux/gcc/x86/Unix.Mod +++ /dev/null @@ -1,465 +0,0 @@ -MODULE Unix; (* Josef Templ, 5.3.90 Linux system calls *) -(* system procedure added by noch *) -(* Module Unix provides a system call interface to Linux. - Naming conventions: - Procedure and Type-names always start with a capital letter. - error numbers as defined in Unix - other constants start with lower case letters *) - -IMPORT SYSTEM; - -CONST - -(* various important constants *) - - stdin* = 0; stdout* =1; stderr* = 2; - - LOCKEX* = 2; LOCKUN* = 8; (* /usr/include/file.h *) - AFINET* = 2; (* /usr/include/sys/socket.h *) - PFINET* = AFINET; (* /usr/include/linux/socket.h *) - SOCKSTREAM* = 1; (* /usr/include/linux/socket.h *) - FIONREAD* = 541BH; (* in /usr/include/asm/termios.h *) - SETFL* = 4; (* set file descriptor flags; in asm/fcntl.h *) - TCP* = 0; - -(* flag sets, cf. /usr/include/asm/fcntl.h *) - rdonly* = {}; wronly* = {0}; rdwr* = {1}; creat* = {6}; excl* = {7}; trunc* = {9}; append* = {10}; ndelay = {11}; - -(* error numbers *) - - EPERM* = 1; (* Not owner *) - ENOENT* = 2; (* No such file or directory *) - ESRCH* = 3; (* No such process *) - EINTR* = 4; (* Interrupted system call *) - EIO* = 5; (* I/O error *) - ENXIO* = 6; (* No such device or address *) - E2BIG* = 7; (* Arg list too long *) - ENOEXEC* = 8; (* Exec format error *) - EBADF* = 9; (* Bad file number *) - ECHILD* = 10; (* No children *) - EAGAIN* = 11; (* No more processes *) - ENOMEM* = 12; (* Not enough core *) - EACCES* = 13; (* Permission denied *) - EFAULT* = 14; (* Bad address *) - ENOTBLK* = 15; (* Block device required *) - EBUSY* = 16; (* Mount device busy *) - EEXIST* = 17; (* File exists *) - EXDEV* = 18; (* Cross-device link *) - ENODEV* = 19; (* No such device *) - ENOTDIR* = 20; (* Not a directory*) - EISDIR* = 21; (* Is a directory *) - EINVAL* = 22; (* Invalid argument *) - ENFILE* = 23; (* File table overflow *) - EMFILE* = 24; (* Too many open files *) - ENOTTY* = 25; (* Not a typewriter *) - ETXTBSY* = 26; (* Text file busy *) - EFBIG* = 27; (* File too large *) - ENOSPC* = 28; (* No space left on device *) - ESPIPE* = 29; (* Illegal seek *) - EROFS* = 30; (* Read-only file system *) - EMLINK* = 31; (* Too many links *) - EPIPE* = 32; (* Broken pipe *) - EDOM* = 33; (* Argument too large *) - ERANGE* = 34; (* Result too large *) - EDEADLK* = 35; (* Resource deadlock would occur *) - ENAMETOOLONG* = 36; (* File name too long *) - ENOLCK* = 37; (* No record locks available *) - ENOSYS* = 38; (* Function not implemented *) - ENOTEMPTY* = 39; (* Directory not empty *) - ELOOP* = 40; (* Too many symbolic links encountered *) - EWOULDBLOCK* = EAGAIN; (* Operation would block *) - ENOMSG* = 42; (* No message of desired type *) - EIDRM* = 43; (* Identifier removed *) - ECHRNG* = 44; (* Channel number out of range *) - EL2NSYNC* = 45; (* Level 2 not synchronized *) - EL3HLT* = 46; (* Level 3 halted *) - EL3RST* = 47; (* Level 3 reset *) - ELNRNG* = 48; (* Link number out of range *) - EUNATCH* = 49; (* Protocol driver not attached *) - ENOCSI* = 50; (* No CSI structure available *) - EL2HLT* = 51; (* Level 2 halted *) - EBADE* = 52; (* Invalid exchange *) - EBADR* = 53; (* Invalid request descriptor *) - EXFULL* = 54; (* Exchange full *) - ENOANO* = 55; (* No anode *) - EBADRQC* = 56; (* Invalid request code *) - EBADSLT* = 57; (* Invalid slot *) - EDEADLOCK* = 58; (* File locking deadlock error *) - EBFONT* = 59; (* Bad font file format *) - ENOSTR* = 60; (* Device not a stream *) - ENODATA* = 61; (* No data available *) - ETIME* = 62; (* Timer expired *) - ENOSR* = 63; (* Out of streams resources *) - ENONET* = 64; (* Machine is not on the network *) - ENOPKG* = 65; (* Package not installed *) - EREMOTE* = 66; (* Object is remote *) - ENOLINK* = 67; (* Link has been severed *) - EADV* = 68; (* Advertise error *) - ESRMNT* = 69; (* Srmount error *) - ECOMM* = 70; (* Communication error on send *) - EPROTO* = 71; (* Protocol error *) - EMULTIHOP* = 72; (* Multihop attempted *) - EDOTDOT* = 73; (* RFS specific error *) - EBADMSG* = 74; (* Not a data message *) - EOVERFLOW* = 75; (* Value too large for defined data type *) - ENOTUNIQ* = 76; (* Name not unique on network *) - EBADFD* = 77; (* File descriptor in bad state *) - EREMCHG* = 78; (* Remote address changed *) - ELIBACC* = 79; (* Can not access a needed shared library *) - ELIBBAD* = 80; (* Accessing a corrupted shared library *) - ELIBSCN* = 81; (* .lib section in a.out corrupted *) - ELIBMAX* = 82; (* Attempting to link in too many shared libraries *) - ELIBEXEC* = 83; (* Cannot exec a shared library directly *) - EILSEQ* = 84; (* Illegal byte sequence *) - ERESTART* = 85; (* Interrupted system call should be restarted *) - ESTRPIPE* = 86; (* Streams pipe error *) - EUSERS* = 87; (* Too many users *) - ENOTSOCK* = 88; (* Socket operation on non-socket *) - EDESTADDRREQ* = 89; (* Destination address required *) - EMSGSIZE* = 90; (* Message too long *) - EPROTOTYPE* = 91; (* Protocol wrong type for socket *) - ENOPROTOOPT* = 92; (* Protocol not available *) - EPROTONOSUPPORT* = 93; (* Protocol not supported *) - ESOCKTNOSUPPORT* = 94; (* Socket type not supported *) - EOPNOTSUPP* = 95; (* Operation not supported on transport endpoint *) - EPFNOSUPPORT* = 96; (* Protocol family not supported *) - EAFNOSUPPORT* = 97; (* Address family not supported by protocol *) - EADDRINUSE* = 98; (* Address already in use *) - EADDRNOTAVAIL* = 99; (* Cannot assign requested address *) - ENETDOWN* = 100; (* Network is down *) - ENETUNREACH* = 101; (* Network is unreachable *) - ENETRESET* = 102; (* Network dropped connection because of reset *) - ECONNABORTED* = 103; (* Software caused connection abort *) - ECONNRESET* = 104; (* Connection reset by peer *) - ENOBUFS* = 105; (* No buffer space available *) - EISCONN* = 106; (* Transport endpoint is already connected *) - ENOTCONN* = 107; (* Transport endpoint is not connected *) - ESHUTDOWN* = 108; (* Cannot send after transport endpoint shutdown *) - ETOOMANYREFS* = 109; (* Too many references: cannot splice *) - ETIMEDOUT* = 110; (* Connection timed out *) - ECONNREFUSED* = 111; (* Connection refused *) - EHOSTDOWN* = 112; (* Host is down *) - EHOSTUNREACH* = 113; (* No route to host *) - EALREADY* = 114; (* Operation already in progress *) - EINPROGRESS* = 115; (* Operation now in progress *) - ESTALE* = 116; (* Stale NFS file handle *) - EUCLEAN* = 117; (* Structure needs cleaning *) - ENOTNAM* = 118; (* Not a XENIX named type file *) - ENAVAIL* = 119; (* No XENIX semaphores available *) - EISNAM* = 120; (* Is a named type file *) - EREMOTEIO* = 121; (* Remote I/O error *) - EDQUOT* = 122; (* Quota exceeded *) - - -TYPE - JmpBuf* = RECORD - bx*, si*, di*, bp*, sp*, pc*: LONGINT; - maskWasSaved*: LONGINT; - savedMask*: ARRAY 32 OF LONGINT; - END ; - - Status* = RECORD (* struct stat *) - dev*, devX*: LONGINT; (* 64 bit in Linux 2.2 *) - pad1: INTEGER; - ino*, mode*, nlink*, uid*, gid*: LONGINT; - rdev*, rdevX*: LONGINT; (* 64 bit in Linux 2.2 *) - pad2: INTEGER; - size*, blksize*, blocks*, atime*, unused1*, mtime*, unused2*, ctime*, - unused3*, unused4*, unused5*: LONGINT; - END ; - - Timeval* = RECORD - sec*, usec*: LONGINT - END ; - - Timezone* = RECORD - minuteswest*, dsttime*: LONGINT - END ; - - Itimerval* = RECORD - interval*, value*: Timeval - END ; - - FdSet* = ARRAY 8 OF SET; - - SigCtxPtr* = POINTER TO SigContext; - SigContext* = RECORD - END ; - - SignalHandler* = PROCEDURE (sig, code: LONGINT; scp: SigCtxPtr); - - Dirent* = RECORD - ino, off: LONGINT; - reclen: INTEGER; - name: ARRAY 256 OF CHAR; - END ; - - Rusage* = RECORD - utime*, stime*: Timeval; - maxrss*, ixrss*, idrss*, isrss*, - minflt*, majflt*, nswap*, inblock*, - oublock*, msgsnd*, msgrcv*, nsignals*, - nvcsw*, nivcsw*: LONGINT - END ; - - Iovec* = RECORD - base*, len*: LONGINT - END ; - - SocketPair* = ARRAY 2 OF LONGINT; - - Pollfd* = RECORD - fd*: LONGINT; - events*, revents*: INTEGER - END ; - - Sockaddr* = RECORD - family*: INTEGER; - port*: INTEGER; - internetAddr*: LONGINT; - pad*: ARRAY 8 OF CHAR; - END ; - - HostEntry* = POINTER [1] TO Hostent; - Hostent* = RECORD - name*, aliases*: LONGINT; - addrtype*, length*: LONGINT; - addrlist*: LONGINT; (*POINTER TO POINTER TO LONGINT, network byte order*) - END; - - Name* = ARRAY OF CHAR; - - PROCEDURE -includeStat() - "#include "; - - PROCEDURE -includeErrno() - "#include "; - - (* for read(), write() and sleep() *) - PROCEDURE -includeUnistd() - "#include "; - - (* for system() *) -(* commented, doesn't compile on 32bit GNU/Linux platforms - PROCEDURE -includeStdlib() - "#include "; -*) - (* for nanosleep() *) - PROCEDURE -includeTime() - "#include "; - - (* for select() *) - PROCEDURE -includeSelect() - "#include "; - - PROCEDURE -err(): LONGINT - "errno"; - - PROCEDURE errno*(): LONGINT; - BEGIN - RETURN err() - END errno; - - PROCEDURE -Exit*(n: LONGINT) - "exit(n)"; - - PROCEDURE -Fork*(): LONGINT - "fork()"; - - PROCEDURE -Wait*(VAR status: LONGINT): LONGINT - "wait(status)"; - - PROCEDURE -Select*(width: LONGINT; VAR readfds, writefds, exceptfds: FdSet; VAR timeout: Timeval): LONGINT - "select(width, readfds, writefds, exceptfds, timeout)"; - - PROCEDURE -Gettimeofday* (VAR tv: Timeval; VAR tz: Timezone) : LONGINT - "gettimeofday(tv, tz)"; - - PROCEDURE -Read* (fd, buf, nbyte: LONGINT): LONGINT - "read(fd, buf, nbyte)"; - - PROCEDURE -ReadBlk* (fd: LONGINT; VAR buf: ARRAY OF SYSTEM.BYTE): LONGINT - "read(fd, buf, buf__len)"; - - PROCEDURE -Write* (fd, buf, nbyte: LONGINT): LONGINT - "write(fd, buf, nbyte)"; - - PROCEDURE -WriteBlk* (fd: LONGINT; VAR buf: ARRAY OF SYSTEM.BYTE): LONGINT - "write(fd, buf, buf__len)"; - - PROCEDURE -Dup*(fd: LONGINT): LONGINT - "dup(fd)"; - - PROCEDURE -Dup2*(fd1, fd2: LONGINT): LONGINT - "dup(fd1, fd2)"; - - PROCEDURE -Pipe*(fds : LONGINT): LONGINT - "pipe(fds)"; - - PROCEDURE -Getpid*(): LONGINT - "getpid()"; - - PROCEDURE -Getuid*(): LONGINT - "getuid()"; - - PROCEDURE -Geteuid*(): LONGINT - "geteuid()"; - - PROCEDURE -Getgid*(): LONGINT - "getgid()"; - - PROCEDURE -Getegid*(): LONGINT - "getegid()"; - - PROCEDURE -Unlink*(name: Name): LONGINT - "unlink(name)"; - - PROCEDURE -Open*(name: Name; flag, mode: SET): LONGINT - "open(name, flag, mode)"; - - PROCEDURE -Close*(fd: LONGINT): LONGINT - "close(fd)"; - - PROCEDURE -stat(name: Name; VAR statbuf: Status): LONGINT - "stat((const char*)name, (struct stat*)statbuf)"; - - PROCEDURE Stat*(name: Name; VAR statbuf: Status): LONGINT; - VAR res: LONGINT; - BEGIN - res := stat(name, statbuf); - (* make the first 4 bytes as unique as possible (used in module Files for caching!) *) - INC(statbuf.dev, statbuf.devX); - INC(statbuf.rdev, statbuf.rdevX); - RETURN res; - END Stat; - - PROCEDURE -fstat(fd: LONGINT; VAR statbuf: Status): LONGINT - "fstat(fd, (struct stat*)statbuf)"; - - PROCEDURE Fstat*(fd: LONGINT; VAR statbuf: Status): LONGINT; - VAR res: LONGINT; - BEGIN - res := fstat(fd, statbuf); - (* make the first 4 bytes as unique as possible (used in module Files for caching!) *) - INC(statbuf.dev, statbuf.devX); - INC(statbuf.rdev, statbuf.rdevX); - RETURN res; - END Fstat; - - PROCEDURE -Fchmod*(fd, mode: LONGINT): LONGINT - "fchmod(fd, mode)"; - - PROCEDURE -Chmod*(path: Name; mode: LONGINT): LONGINT - "chmod(path, mode)"; - - PROCEDURE -Lseek*(fd, offset, origin: LONGINT): LONGINT - "lseek(fd, offset, origin)"; - - PROCEDURE -Fsync*(fd: LONGINT): LONGINT - "fsync(fd)"; - - PROCEDURE -Fcntl*(fd, cmd, arg: LONGINT ): LONGINT - "fcntl(fd, cmd, arg)"; - - PROCEDURE -Flock*(fd, operation: LONGINT): LONGINT - "flock(fd, operation)"; - - PROCEDURE -Ftruncate*(fd, length: LONGINT): LONGINT - "ftruncate(fd, length)"; - - PROCEDURE -Readblk*(fd: LONGINT; VAR buf: ARRAY OF SYSTEM.BYTE; len: LONGINT): LONGINT - "read(fd, buf, len)"; - - PROCEDURE -Rename*(old, new: Name): LONGINT - "rename(old, new)"; - - PROCEDURE -Chdir*(path: Name): LONGINT - "chdir(path)"; - - PROCEDURE -Ioctl*(fd, request, arg: LONGINT): LONGINT - "ioctl(fd, request, arg)"; - - PROCEDURE -Kill*(pid, sig: LONGINT): LONGINT - "kill(pid, sig)"; - - PROCEDURE -Sigsetmask*(mask: LONGINT): LONGINT - "sigsetmask(mask)"; - - PROCEDURE -Sleep*(ms : LONGINT): LONGINT - "sleep(ms)"; - - PROCEDURE -Nanosleep*(VAR req : Timeval; VAR rem : Timeval): LONGINT - "nanosleep(req, rem)"; - - (* TCP/IP networking *) - - PROCEDURE -Gethostbyname*(name: Name): HostEntry - "(Unix_HostEntry)gethostbyname(name)"; - - PROCEDURE -Gethostname*(VAR name: Name): LONGINT - "gethostname(name, name__len)"; - - PROCEDURE -Socket*(af, type, protocol: LONGINT): LONGINT - "socket(af, type, protocol)"; - - PROCEDURE -Connect*(socket: LONGINT; name: Sockaddr; namelen: LONGINT): LONGINT - "connect(socket, &(name), namelen)"; - - PROCEDURE -Getsockname*(socket: LONGINT; VAR name: Sockaddr; VAR namelen: LONGINT): LONGINT - "getsockname(socket, name, namelen)"; - - PROCEDURE -Bind*(socket: LONGINT; name: Sockaddr; namelen: LONGINT): LONGINT - "bind(socket, &(name), namelen)"; - - PROCEDURE -Listen*(socket, backlog: LONGINT): LONGINT - "listen(socket, backlog)"; - - PROCEDURE -Accept*(socket: LONGINT; VAR addr: Sockaddr; VAR addrlen: LONGINT): LONGINT - "accept(socket, addr, addrlen)"; - - PROCEDURE -Recv*(socket, bufadr, buflen, flags: LONGINT): LONGINT - "recv(socket, bufadr, buflen, flags)"; - - PROCEDURE -Send*(socket, bufadr, buflen, flags: LONGINT): LONGINT - "send(socket, bufadr, buflen, flags)"; - - PROCEDURE -sys(str: ARRAY OF CHAR): INTEGER (* need this to call external tools like gcc or gas; noch *) - "system(str)"; - - PROCEDURE system*(cmd : ARRAY OF CHAR); - VAR r : INTEGER; - BEGIN - r := sys(cmd); - END system; - - PROCEDURE System*(cmd : ARRAY OF CHAR): INTEGER; - VAR r : INTEGER; - BEGIN - r := sys(cmd); - RETURN r - END System; - - PROCEDURE -SizeofUnixStat(): INTEGER - "sizeof(Unix_Status)"; - - PROCEDURE -SizeofStat(): INTEGER - "sizeof(struct stat)"; - - PROCEDURE -Error(msg: ARRAY OF CHAR; len: INTEGER) - "write(1/*stdout*/, msg, len); char ch = 0xa; write(1, &ch, 1)"; - - PROCEDURE StatCheck; - VAR x, y: LONGINT; - BEGIN - x := SizeofUnixStat(); - y := SizeofStat(); - IF x # y THEN - Error("Unix.StatCheck: inconsistent usage of struct stat", 49); - Exit(1); - END - END StatCheck; - -BEGIN - - StatCheck(); -END Unix. diff --git a/src/system/linux/gcc/x86_64/Args.Mod b/src/system/linux/gcc/x86_64/Args.Mod deleted file mode 100644 index 2c0d25b5..00000000 --- a/src/system/linux/gcc/x86_64/Args.Mod +++ /dev/null @@ -1,65 +0,0 @@ -MODULE Args; (* jt, 8.12.94 *) - - (* command line argument handling for voc (jet backend) *) - - - IMPORT SYSTEM; - - TYPE - ArgPtr = POINTER TO ARRAY 1024 OF CHAR; - ArgVec = POINTER TO ARRAY 1024 OF ArgPtr; - - VAR argc-: INTEGER; argv-: LONGINT; - (*PROCEDURE -includestdlib() "#include ";*) - PROCEDURE -externgetenv() "extern char *getenv(const char *name);"; (* took this from stdlib.h*) - PROCEDURE -Argc(): INTEGER "SYSTEM_argc"; - PROCEDURE -Argv(): LONGINT "(long)SYSTEM_argv"; - PROCEDURE -getenv(var: ARRAY OF CHAR): ArgPtr - "(Args_ArgPtr)getenv(var)"; - - PROCEDURE Get*(n: INTEGER; VAR val: ARRAY OF CHAR); - VAR av: ArgVec; - BEGIN - IF n < argc THEN av := SYSTEM.VAL(ArgVec, argv); COPY(av[n]^, val) END - END Get; - - PROCEDURE GetInt*(n: INTEGER; VAR val: LONGINT); - VAR s: ARRAY 64 OF CHAR; k, d, i: LONGINT; - BEGIN - s := ""; Get(n, s); i := 0; - IF s[0] = "-" THEN i := 1 END ; - k := 0; d := ORD(s[i]) - ORD("0"); - WHILE (d >= 0 ) & (d <= 9) DO k := k*10 + d; INC(i); d := ORD(s[i]) - ORD("0") END ; - IF s[0] = "-" THEN d := -d; DEC(i) END ; - IF i > 0 THEN val := k END - END GetInt; - - PROCEDURE Pos*(s: ARRAY OF CHAR): INTEGER; - VAR i: INTEGER; arg: ARRAY 256 OF CHAR; - BEGIN - i := 0; Get(i, arg); - WHILE (i < argc) & (s # arg) DO INC(i); Get(i, arg) END ; - RETURN i - END Pos; - - PROCEDURE GetEnv*(var: ARRAY OF CHAR; VAR val: ARRAY OF CHAR); - VAR p: ArgPtr; - BEGIN - p := getenv(var); - IF p # NIL THEN COPY(p^, val) END - END GetEnv; - - PROCEDURE getEnv*(var: ARRAY OF CHAR; VAR val: ARRAY OF CHAR): BOOLEAN; - VAR p: ArgPtr; - BEGIN - p := getenv(var); - IF p # NIL THEN - COPY(p^, val); - RETURN TRUE - ELSE - RETURN FALSE - END - END getEnv; - -BEGIN argc := Argc(); argv := Argv() -END Args. diff --git a/src/system/linux/gcc/x86_64/Files.Mod b/src/system/linux/gcc/x86_64/Files.Mod deleted file mode 100644 index c8f42ca5..00000000 --- a/src/system/linux/gcc/x86_64/Files.Mod +++ /dev/null @@ -1,664 +0,0 @@ -MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files *) -(* modified version of Files, which opens only the file provided and does not scan any path in any environment variable, also ReadLine procedure added; -- noch *) - IMPORT SYSTEM, Unix, Kernel, Args, Console; - - (* standard data type I/O - - little endian, - Sint:1, Int:2, Lint:4 - ORD({0}) = 1, - false = 0, true =1 - IEEE real format, - null terminated strings, - compact numbers according to M.Odersky *) - - - CONST - nofbufs = 4; - bufsize = 4096; - fileTabSize = 64; - noDesc = -1; - notDone = -1; - - (* file states *) - open = 0; create = 1; close = 2; - - - TYPE - FileName = ARRAY 101 OF CHAR; - File* = POINTER TO Handle; - Buffer = POINTER TO BufDesc; - - Handle = RECORD - workName, registerName: FileName; - tempFile: BOOLEAN; - dev, ino, mtime: LONGINT; - fd-: INTEGER; - len, pos: LONGINT; - bufs: ARRAY nofbufs OF Buffer; - swapper, state: INTEGER - END ; - - BufDesc = RECORD - f: File; - chg: BOOLEAN; - org, size: LONGINT; - data: ARRAY bufsize OF SYSTEM.BYTE - END ; - - Rider* = RECORD - res*: LONGINT; - eof*: BOOLEAN; - buf: Buffer; - org, offset: LONGINT - END ; - - Time = POINTER TO TimeDesc; - TimeDesc = RECORD - sec*, min*, hour*, mday*, mon*, year*, wday*, isdst*, zone*, gmtoff*: LONGINT; -(* sec*, min*, hour*, mday*, mon*, year*, wday*, isdst*, zone*, gmtoff*: INTEGER;*) - END ; - - VAR - fileTab: ARRAY fileTabSize OF LONGINT (*=File*); - tempno: INTEGER; - -(* for localtime *) - PROCEDURE -includetime() - '#include "time.h"'; - - PROCEDURE -localtime(VAR clock: LONGINT): Time - "(Files_Time) localtime(clock)"; - - PROCEDURE -getcwd(VAR cwd: Unix.Name) - "getcwd(cwd, cwd__len)"; - - PROCEDURE -IdxTrap "__HALT(-1)"; - - PROCEDURE^ Finalize(o: SYSTEM.PTR); - - PROCEDURE Err(s: ARRAY OF CHAR; f: File; errno: LONGINT); - BEGIN - Console.Ln; Console.String("-- "); Console.String(s); Console.String(": "); - IF f # NIL THEN - IF f.registerName # "" THEN Console.String(f.registerName) ELSE Console.String(f.workName) END - END ; - IF errno # 0 THEN Console.String(" errno = "); Console.Int(errno, 1) END ; - Console.Ln; - HALT(99) - END Err; - - PROCEDURE MakeFileName(dir, name: ARRAY OF CHAR; VAR dest: ARRAY OF CHAR); - VAR i, j: INTEGER; - BEGIN i := 0; j := 0; - WHILE dir[i] # 0X DO dest[i] := dir[i]; INC(i) END ; - IF dest[i-1] # "/" THEN dest[i] := "/"; INC(i) END ; - WHILE name[j] # 0X DO dest[i] := name[j]; INC(i); INC(j) END ; - dest[i] := 0X - END MakeFileName; - - PROCEDURE GetTempName(finalName: ARRAY OF CHAR; VAR name: ARRAY OF CHAR); - VAR n, i, j: LONGINT; - BEGIN - INC(tempno); n := tempno; i := 0; - IF finalName[0] # "/" THEN (* relative pathname *) - WHILE Kernel.CWD[i] # 0X DO name[i] := Kernel.CWD[i]; INC(i) END; - IF Kernel.CWD[i-1] # "/" THEN name[i] := "/"; INC(i) END - END; - j := 0; - WHILE finalName[j] # 0X DO name[i] := finalName[j]; INC(i); INC(j) END; - DEC(i); - WHILE name[i] # "/" DO DEC(i) END; - name[i+1] := "."; name[i+2] := "t"; name[i+3] := "m"; name[i+4] := "p"; name[i+5] := "."; INC(i, 6); - WHILE n > 0 DO name[i] := CHR(n MOD 10 + ORD("0")); n := n DIV 10; INC(i) END; - name[i] := "."; INC(i); n := SHORT(Unix.Getpid()); - WHILE n > 0 DO name[i] := CHR(n MOD 10 + ORD("0")); n := n DIV 10; INC(i) END; - name[i] := 0X - END GetTempName; - - PROCEDURE Create(f: File); - VAR stat: Unix.Status; done: BOOLEAN; - errno: LONGINT; err: ARRAY 32 OF CHAR; - BEGIN - IF f.fd = noDesc THEN - IF f.state = create THEN GetTempName(f.registerName, f.workName); f.tempFile := TRUE - ELSIF f.state = close THEN - f.workName := f.registerName; f.registerName := ""; f.tempFile := FALSE - END ; - errno := Unix.Unlink(f.workName); (*unlink first to avoid stale NFS handles and to avoid reuse of inodes*) - f.fd := Unix.Open(f.workName, SHORT(SYSTEM.VAL(LONGINT, Unix.rdwr + Unix.creat + Unix.trunc)), SHORT(SYSTEM.VAL(LONGINT, {2, 4,5, 7,8}))); - done := f.fd >= 0; errno := Unix.errno(); - IF (~done & ((errno = Unix.ENFILE) OR (errno = Unix.EMFILE))) OR (done & (f.fd >= fileTabSize)) THEN - IF done & (f.fd >= fileTabSize) THEN errno := Unix.Close(f.fd) END ; - Kernel.GC(TRUE); - f.fd := Unix.Open(f.workName, SHORT(SYSTEM.VAL(LONGINT, Unix.rdwr + Unix.creat + Unix.trunc)), SHORT(SYSTEM.VAL(LONGINT, {2, 4,5, 7,8}))); - done := f.fd >= 0 - END ; - IF done THEN - IF f.fd >= fileTabSize THEN errno := Unix.Close(f.fd); Err("too many files open", f, 0) - ELSE fileTab[f.fd] := SYSTEM.VAL(LONGINT, f); INC(Kernel.nofiles); Kernel.RegisterObject(f, Finalize); - f.state := open; f.pos := 0; errno := Unix.Fstat(f.fd, stat); - f.dev := stat.dev; f.ino := stat.ino; f.mtime := stat.mtime - END - ELSE errno := Unix.errno(); - IF errno = Unix.ENOENT THEN err := "no such directory" - ELSIF (errno = Unix.ENFILE) OR (errno = Unix.EMFILE) THEN err := "too many files open" - ELSE err := "file not created" - END ; - Err(err, f, errno) - END - END - END Create; - - PROCEDURE Flush(buf: Buffer); - VAR res: LONGINT; f: File; stat: Unix.Status; - BEGIN - IF buf.chg THEN f := buf.f; Create(f); - IF buf.org # f.pos THEN res := Unix.Lseek(f.fd, buf.org, 0) END ; - res := Unix.Write(f.fd, SYSTEM.ADR(buf.data), buf.size); - IF res < 0 THEN Err("error in writing file", f, Unix.errno()) END ; - f.pos := buf.org + buf.size; - buf.chg := FALSE; - res := Unix.Fstat(f.fd, stat); - f.mtime := stat.mtime - END - END Flush; - - PROCEDURE Close* (f: File); - VAR i, res: LONGINT; - BEGIN - IF (f.state # create) OR (f.registerName # "") THEN - Create(f); i := 0; - WHILE (i < nofbufs) & (f.bufs[i] # NIL) DO Flush(f.bufs[i]); INC(i) END ; - res := Unix.Fsync(f.fd); - IF res < 0 THEN Err("error in writing file", f, Unix.errno()) END - END - END Close; - - PROCEDURE Length* (f: File): LONGINT; - BEGIN RETURN f.len - END Length; - - PROCEDURE New* (name: ARRAY OF CHAR): File; - VAR f: File; - BEGIN - NEW(f); f.workName := ""; COPY(name, f.registerName); - f.fd := noDesc; f.state := create; f.len := 0; f.pos := 0; f.swapper := -1; (*all f.buf[i] = NIL*) - RETURN f - END New; -(* - PROCEDURE ScanPath(VAR pos: INTEGER; VAR dir: ARRAY OF CHAR); (* supports ~, ~user and blanks inside path *) - VAR i: INTEGER; ch: CHAR; home: ARRAY 256 OF CHAR; - BEGIN - i := 0; ch := Kernel.OBERON[pos]; - WHILE (ch = " ") OR (ch = ":") DO INC(pos); ch := Kernel.OBERON[pos] END ; - IF ch = "~" THEN - INC(pos); ch := Kernel.OBERON[pos]; - home := ""; Args.GetEnv("HOME", home); - WHILE home[i] # 0X DO dir[i] := home[i]; INC(i) END ; - IF (ch # "/") & (ch # 0X) & (ch # ":") & (ch # " ") THEN - WHILE (i > 0) & (dir[i-1] # "/") DO DEC(i) END - END - END ; - WHILE (ch # 0X) & (ch # ":") DO dir[i] := ch; INC(i); INC(pos); ch := Kernel.OBERON[pos] END ; - WHILE (i > 0) & (dir[i-1] = " ") DO DEC(i) END ; - dir[i] := 0X - END ScanPath; -*) - PROCEDURE HasDir(VAR name: ARRAY OF CHAR): BOOLEAN; - VAR i: INTEGER; ch: CHAR; - BEGIN i := 0; ch := name[0]; - WHILE (ch # 0X) & (ch # "/") DO INC(i); ch := name[i] END ; - RETURN ch = "/" - END HasDir; - - PROCEDURE CacheEntry(dev, ino: LONGINT; mtime: LONGINT): File; - VAR f: File; i: INTEGER; stat: Unix.Status; res: LONGINT; - BEGIN i := 0; - WHILE i < fileTabSize DO - f := SYSTEM.VAL(File, fileTab[i]); - IF (f # NIL) & (ino = f.ino) & (dev = f.dev) THEN - IF mtime # f.mtime THEN i := 0; - WHILE i < nofbufs DO - IF f.bufs[i] # NIL THEN f.bufs[i].org := -1; f.bufs[i] := NIL END ; - INC(i) - END ; - f.swapper := -1; f.mtime := mtime; - res := Unix.Fstat(f.fd, stat); f.len := stat.size - END ; - RETURN f - END ; - INC(i) - END ; - RETURN NIL - END CacheEntry; - - PROCEDURE Old* (name: ARRAY OF CHAR): File; - VAR f: File; fd: INTEGER; res, errno: LONGINT; pos: INTEGER; done: BOOLEAN; - dir, path: ARRAY 256 OF CHAR; - stat: Unix.Status; - BEGIN - IF name # "" THEN - IF HasDir(name) THEN dir := ""; COPY(name, path) - ELSE - pos := 0; - COPY(name, path); (* -- noch *) - (*ScanPath(pos, dir);*) (*MakeFileName(dir, name, path);*) (*ScanPath(pos, dir)*) - END ; - LOOP - fd := Unix.Open(path, SHORT(SYSTEM.VAL(LONGINT, Unix.rdwr)), SHORT(SYSTEM.VAL(LONGINT, {}))); done := fd >= 0; errno := Unix.errno(); - IF (~done & ((errno = Unix.ENFILE) OR (errno = Unix.EMFILE))) OR (done & (fd >= fileTabSize)) THEN - IF done & (fd >= fileTabSize) THEN res := Unix.Close(fd) END ; - Kernel.GC(TRUE); - fd := Unix.Open(path, SHORT(SYSTEM.VAL(LONGINT, Unix.rdwr)), SHORT(SYSTEM.VAL(LONGINT, {}))); - done := fd >= 0; errno := Unix.errno(); - IF ~done & ((errno = Unix.ENFILE) OR (errno = Unix.EMFILE)) THEN Err("too many files open", f, errno) END - END ; - IF ~done & ((errno = Unix.EACCES) OR (errno = Unix.EROFS) OR (errno = Unix.EAGAIN)) THEN - (* errno EAGAIN observed on Solaris 2.4 *) - fd := Unix.Open(path, SHORT(SYSTEM.VAL(LONGINT, Unix.rdonly)), SHORT(SYSTEM.VAL(LONGINT, {}))); done := fd >= 0; errno := Unix.errno() - END ; -IF (~done) & (errno # Unix.ENOENT) THEN - Console.String("warning Files.Old "); Console.String(name); - Console.String(" errno = "); Console.Int(errno, 0); Console.Ln; -END ; - IF done THEN - res := Unix.Fstat(fd, stat); - f := CacheEntry(stat.dev, stat.ino, stat.mtime); - IF f # NIL THEN res := Unix.Close(fd); RETURN f - ELSIF fd >= fileTabSize THEN res := Unix.Close(fd); Err("too many files open", f, 0) - ELSE NEW(f); fileTab[fd] := SYSTEM.VAL(LONGINT, f); INC(Kernel.nofiles); Kernel.RegisterObject(f, Finalize); - f.fd := fd; f.state := open; f.len := stat.size; f.pos := 0; f.swapper := -1; (*all f.buf[i] = NIL*) - COPY(name, f.workName); f.registerName := ""; f.tempFile := FALSE; - f.dev := stat.dev; f.ino := stat.ino; f.mtime := stat.mtime; - RETURN f - END - ELSIF dir = "" THEN RETURN NIL - ELSE (*MakeFileName(dir, name, path);*) (*ScanPath(pos, dir)*) - RETURN NIL - END - END - ELSE RETURN NIL - END - END Old; - - PROCEDURE Purge* (f: File); - VAR i: INTEGER; stat: Unix.Status; res: LONGINT; - BEGIN i := 0; - WHILE i < nofbufs DO - IF f.bufs[i] # NIL THEN f.bufs[i].org := -1; f.bufs[i] := NIL END ; - INC(i) - END ; - IF f.fd # noDesc THEN res := Unix.Ftruncate(f.fd, 0); res := Unix.Lseek(f.fd, 0, 0) END ; - f.pos := 0; f.len := 0; f.swapper := -1; - res := Unix.Fstat(f.fd, stat); f.mtime := stat.mtime - END Purge; - - PROCEDURE GetDate* (f: File; VAR t, d: LONGINT); - VAR stat: Unix.Status; clock, res: LONGINT; time: Time; - BEGIN - Create(f); res := Unix.Fstat(f.fd, stat); - time := localtime(stat.mtime); - t := time.sec + ASH(time.min, 6) + ASH(time.hour, 12); - d := time.mday + ASH(time.mon+1, 5) + ASH(time.year MOD 100, 9) - END GetDate; - - PROCEDURE Pos* (VAR r: Rider): LONGINT; - BEGIN RETURN r.org + r.offset - END Pos; - - PROCEDURE Set* (VAR r: Rider; f: File; pos: LONGINT); - VAR org, offset, i, n, res: LONGINT; buf: Buffer; - BEGIN - IF f # NIL THEN - IF pos > f.len THEN pos := f.len ELSIF pos < 0 THEN pos := 0 END ; - offset := pos MOD bufsize; org := pos - offset; i := 0; - WHILE (i < nofbufs) & (f.bufs[i] # NIL) & (org # f.bufs[i].org) DO INC(i) END ; - IF i < nofbufs THEN - IF f.bufs[i] = NIL THEN NEW(buf); buf.chg := FALSE; buf.org := -1; buf.f := f; f.bufs[i] := buf - ELSE buf := f.bufs[i] - END - ELSE - f.swapper := (f.swapper + 1) MOD nofbufs; - buf := f.bufs[f.swapper]; - Flush(buf) - END ; - IF buf.org # org THEN - IF org = f.len THEN buf.size := 0 - ELSE Create(f); - IF f.pos # org THEN res := Unix.Lseek(f.fd, org, 0) END ; - n := Unix.ReadBlk(f.fd, buf.data); - IF n < 0 THEN Err("read from file not done", f, Unix.errno()) END ; - f.pos := org + n; - buf.size := n - END ; - buf.org := org; buf.chg := FALSE - END - ELSE buf := NIL; org := 0; offset := 0 - END ; - r.buf := buf; r.org := org; r.offset := offset; r.eof := FALSE; r.res := 0 - END Set; - - PROCEDURE Read* (VAR r: Rider; VAR x: SYSTEM.BYTE); - VAR offset: LONGINT; buf: Buffer; - BEGIN - buf := r.buf; offset := r.offset; - IF r.org # buf.org THEN Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset END ; - IF (offset < buf.size) THEN - x := buf.data[offset]; r.offset := offset + 1 - ELSIF r.org + offset < buf.f.len THEN - Set(r, r.buf.f, r.org + offset); - x := r.buf.data[0]; r.offset := 1 - ELSE - x := 0X; r.eof := TRUE - END - END Read; - - PROCEDURE ReadBytes* (VAR r: Rider; VAR x: ARRAY OF SYSTEM.BYTE; n: LONGINT); - VAR xpos, min, restInBuf, offset: LONGINT; buf: Buffer; - BEGIN - IF n > LEN(x) THEN IdxTrap END ; - xpos := 0; buf := r.buf; offset := r.offset; - WHILE n > 0 DO - IF (r.org # buf.org) OR (offset >= bufsize) THEN - Set(r, buf.f, r.org + offset); - buf := r.buf; offset := r.offset - END ; - restInBuf := buf.size - offset; - IF restInBuf = 0 THEN r.res := n; r.eof := TRUE; RETURN - ELSIF n > restInBuf THEN min := restInBuf ELSE min := n END ; - SYSTEM.MOVE(SYSTEM.ADR(buf.data) + offset, SYSTEM.ADR(x) + xpos, min); - INC(offset, min); r.offset := offset; INC(xpos, min); DEC(n, min) - END ; - r.res := 0; r.eof := FALSE - END ReadBytes; - - PROCEDURE ReadByte* (VAR r : Rider; VAR x : ARRAY OF SYSTEM.BYTE); - BEGIN - ReadBytes(r, x, 1); - END ReadByte; - - PROCEDURE Base* (VAR r: Rider): File; - BEGIN RETURN r.buf.f - END Base; - - PROCEDURE Write* (VAR r: Rider; x: SYSTEM.BYTE); - VAR buf: Buffer; offset: LONGINT; - BEGIN - buf := r.buf; offset := r.offset; - IF (r.org # buf.org) OR (offset >= bufsize) THEN - Set(r, buf.f, r.org + offset); - buf := r.buf; offset := r.offset - END ; - buf.data[offset] := x; - buf.chg := TRUE; - IF offset = buf.size THEN - INC(buf.size); INC(buf.f.len) - END ; - r.offset := offset + 1; r.res := 0 - END Write; - - PROCEDURE WriteByte* (VAR r : Rider; x : SYSTEM.BYTE); (* added for compatibility with PO 2013, -- noch *) - BEGIN - Write(r, x); - END WriteByte; - - PROCEDURE WriteBytes* (VAR r: Rider; VAR x: ARRAY OF SYSTEM.BYTE; n: LONGINT); - VAR xpos, min, restInBuf, offset: LONGINT; buf: Buffer; - BEGIN - IF n > LEN(x) THEN IdxTrap END ; - xpos := 0; buf := r.buf; offset := r.offset; - WHILE n > 0 DO - IF (r.org # buf.org) OR (offset >= bufsize) THEN - Set(r, buf.f, r.org + offset); - buf := r.buf; offset := r.offset - END ; - restInBuf := bufsize - offset; - IF n > restInBuf THEN min := restInBuf ELSE min := n END ; - SYSTEM.MOVE(SYSTEM.ADR(x) + xpos, SYSTEM.ADR(buf.data) + offset, min); - INC(offset, min); r.offset := offset; - IF offset > buf.size THEN INC(buf.f.len, offset - buf.size); buf.size := offset END ; - INC(xpos, min); DEC(n, min); buf.chg := TRUE - END ; - r.res := 0 - END WriteBytes; - -(* another solution would be one that is similar to ReadBytes, WriteBytes. -No code duplication, more symmetric, only two ifs for -Read and Write in buffer, buf.size replaced by bufsize in Write ops, buf.size and len -must be made consistent with offset (if offset > buf.size) in a lazy way. - -PROCEDURE Write* (VAR r: Rider; x: SYSTEM.BYTE); - VAR buf: Buffer; offset: LONGINT; -BEGIN - buf := r.buf; offset := r.offset; - IF (offset >= bufsize) OR (r.org # buf.org) THEN - Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset; - END ; - buf.data[offset] := x; r.offset := offset + 1; buf.chg := TRUE -END Write; - - -PROCEDURE WriteBytes ... - -PROCEDURE Read* (VAR r: Rider; VAR x: SYSTEM.BYTE); - VAR offset: LONGINT; buf: Buffer; -BEGIN - buf := r.buf; offset := r.offset; - IF (offset >= buf.size) OR (r.org # buf.org) THEN - IF r.org + offset >= buf.f.len THEN x := 0X; r.eof := TRUE; RETURN - ELSE Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset - END - END ; - x := buf.data[offset]; r.offset := offset + 1 -END Read; - -but this would also affect Set, Length, and Flush. -Especially Length would become fairly complex. -*) - - PROCEDURE Delete* (name: ARRAY OF CHAR; VAR res: INTEGER); - BEGIN - res := SHORT(Unix.Unlink(name)); - res := SHORT(Unix.errno()) - END Delete; - - PROCEDURE Rename* (old, new: ARRAY OF CHAR; VAR res: INTEGER); - VAR fdold, fdnew: INTEGER; n, errno, r: LONGINT; - ostat, nstat: Unix.Status; - buf: ARRAY 4096 OF CHAR; - BEGIN - r := Unix.Stat(old, ostat); - IF r >= 0 THEN - r := Unix.Stat(new, nstat); - IF (r >= 0) & ((ostat.dev # nstat.dev) OR (ostat.ino # nstat.ino)) THEN - Delete(new, res); (* work around stale nfs handles *) - END ; - r := Unix.Rename(old, new); - IF r < 0 THEN res := SHORT(Unix.errno()); - IF res = Unix.EXDEV THEN (* cross device link, move the file *) - fdold := Unix.Open(old, SHORT(SYSTEM.VAL(LONGINT, Unix.rdonly)), SHORT(SYSTEM.VAL(LONGINT, {}))); - IF fdold < 0 THEN res := 2; RETURN END ; - fdnew := Unix.Open(new, SHORT(SYSTEM.VAL(LONGINT, Unix.rdwr + Unix.creat + Unix.trunc)), SHORT(SYSTEM.VAL(LONGINT, {2, 4,5, 7,8}))); - IF fdnew < 0 THEN r := Unix.Close(fdold); res := 3; RETURN END ; - n := Unix.Read(fdold, SYSTEM.ADR(buf), bufsize); - WHILE n > 0 DO - r := Unix.Write(fdnew, SYSTEM.ADR(buf), n); - IF r < 0 THEN errno := Unix.errno(); r := Unix.Close(fdold); r := Unix.Close(fdnew); - Err("cannot move file", NIL, errno) - END ; - n := Unix.Read(fdold, SYSTEM.ADR(buf), bufsize) - END ; - errno := Unix.errno(); - r := Unix.Close(fdold); r := Unix.Close(fdnew); - IF n = 0 THEN r := Unix.Unlink(old); res := 0 - ELSE Err("cannot move file", NIL, errno) - END ; - ELSE RETURN (* res is Unix.Rename return code *) - END - END ; - res := 0 - ELSE res := 2 (* old file not found *) - END - END Rename; - - PROCEDURE Register* (f: File); - VAR idx, errno: INTEGER; f1: File; file: ARRAY 104 OF CHAR; - BEGIN - IF (f.state = create) & (f.registerName # "") THEN f.state := close (* shortcut renaming *) END ; - Close(f); - IF f.registerName # "" THEN - Rename(f.workName, f.registerName, errno); - IF errno # 0 THEN COPY(f.registerName, file); HALT(99) END ; - f.workName := f.registerName; f.registerName := ""; f.tempFile := FALSE - END - END Register; - - PROCEDURE ChangeDirectory*(path: ARRAY OF CHAR; VAR res: INTEGER); - BEGIN - res := SHORT(Unix.Chdir(path)); - getcwd(Kernel.CWD) - END ChangeDirectory; - - PROCEDURE FlipBytes(VAR src, dest: ARRAY OF SYSTEM.BYTE); - VAR i, j: LONGINT; - BEGIN - IF ~Kernel.littleEndian THEN i := LEN(src); j := 0; - WHILE i > 0 DO DEC(i); dest[j] := src[i]; INC(j) END - ELSE SYSTEM.MOVE(SYSTEM.ADR(src), SYSTEM.ADR(dest), LEN(src)) - END - END FlipBytes; - - PROCEDURE ReadBool* (VAR R: Rider; VAR x: BOOLEAN); - BEGIN Read(R, SYSTEM.VAL(CHAR, x)) - END ReadBool; - - PROCEDURE ReadInt* (VAR R: Rider; VAR x: INTEGER); - VAR b: ARRAY 2 OF CHAR; - BEGIN ReadBytes(R, b, 2); - x := ORD(b[0]) + ORD(b[1])*256 - END ReadInt; - - PROCEDURE ReadLInt* (VAR R: Rider; VAR x: LONGINT); - VAR b: ARRAY 4 OF CHAR; - BEGIN ReadBytes(R, b, 4); - x := ORD(b[0]) + ORD(b[1])*100H + ORD(b[2])*10000H + ORD(b[3])*1000000H - END ReadLInt; - - PROCEDURE ReadSet* (VAR R: Rider; VAR x: SET); - VAR b: ARRAY 4 OF CHAR; - BEGIN ReadBytes(R, b, 4); - x := SYSTEM.VAL(SET, ORD(b[0]) + ORD(b[1])*100H + ORD(b[2])*10000H + ORD(b[3])*1000000H) - END ReadSet; - - PROCEDURE ReadReal* (VAR R: Rider; VAR x: REAL); - VAR b: ARRAY 4 OF CHAR; - BEGIN ReadBytes(R, b, 4); FlipBytes(b, x) - END ReadReal; - - PROCEDURE ReadLReal* (VAR R: Rider; VAR x: LONGREAL); - VAR b: ARRAY 8 OF CHAR; - BEGIN ReadBytes(R, b, 8); FlipBytes(b, x) - END ReadLReal; - - PROCEDURE ReadString* (VAR R: Rider; VAR x: ARRAY OF CHAR); - VAR i: INTEGER; ch: CHAR; - BEGIN i := 0; - REPEAT Read(R, ch); x[i] := ch; INC(i) UNTIL ch = 0X - END ReadString; - - (* need to read line; -- noch *) - PROCEDURE ReadLine* (VAR R: Rider; VAR x: ARRAY OF CHAR); - VAR i: INTEGER; ch: CHAR; b : BOOLEAN; - BEGIN i := 0; - b := FALSE; - REPEAT - Read(R, ch); - IF ((ch = 0X) OR (ch = 0AX) OR (ch = 0DX)) THEN - b := TRUE - ELSE - x[i] := ch; - INC(i); - END; - UNTIL b - END ReadLine; - - PROCEDURE ReadNum* (VAR R: Rider; VAR x: LONGINT); - VAR s: SHORTINT; ch: CHAR; n: LONGINT; - BEGIN s := 0; n := 0; Read(R, ch); - WHILE ORD(ch) >= 128 DO INC(n, ASH(ORD(ch) - 128, s) ); INC(s, 7); Read(R, ch) END; - INC(n, ASH(ORD(ch) MOD 64 - ORD(ch) DIV 64 * 64, s) ); - x := n - END ReadNum; - - PROCEDURE WriteBool* (VAR R: Rider; x: BOOLEAN); - BEGIN Write(R, SYSTEM.VAL(CHAR, x)) - END WriteBool; - - PROCEDURE WriteInt* (VAR R: Rider; x: INTEGER); - VAR b: ARRAY 2 OF CHAR; - BEGIN b[0] := CHR(x); b[1] := CHR(x DIV 256); - WriteBytes(R, b, 2); - END WriteInt; - - PROCEDURE WriteLInt* (VAR R: Rider; x: LONGINT); - VAR b: ARRAY 4 OF CHAR; - BEGIN - b[0] := CHR(x); b[1] := CHR(x DIV 100H); b[2] := CHR(x DIV 10000H); b[3] := CHR(x DIV 1000000H); - WriteBytes(R, b, 4); - END WriteLInt; - - PROCEDURE WriteSet* (VAR R: Rider; x: SET); - VAR b: ARRAY 4 OF CHAR; i: LONGINT; - BEGIN i := SYSTEM.VAL(LONGINT, x); - 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; - - PROCEDURE WriteReal* (VAR R: Rider; x: REAL); - VAR b: ARRAY 4 OF CHAR; - BEGIN FlipBytes(x, b); WriteBytes(R, b, 4) - END WriteReal; - - PROCEDURE WriteLReal* (VAR R: Rider; x: LONGREAL); - VAR b: ARRAY 8 OF CHAR; - BEGIN FlipBytes(x, b); WriteBytes(R, b, 8) - END WriteLReal; - - PROCEDURE WriteString* (VAR R: Rider; x: ARRAY [1] OF CHAR); - VAR i: INTEGER; - BEGIN i := 0; - WHILE x[i] # 0X DO INC(i) END ; - WriteBytes(R, x, i+1) - END WriteString; - - PROCEDURE WriteNum* (VAR R: Rider; x: LONGINT); - BEGIN - WHILE (x < - 64) OR (x > 63) DO Write(R, CHR(x MOD 128 + 128)); x := x DIV 128 END; - Write(R, CHR(x MOD 128)) - END WriteNum; - - PROCEDURE GetName*(f: File; VAR name: ARRAY OF CHAR); - BEGIN - COPY (f.workName, name); - END GetName; - - PROCEDURE Finalize(o: SYSTEM.PTR); - VAR f: File; res: LONGINT; - BEGIN - f := SYSTEM.VAL(File, o); - IF f.fd >= 0 THEN - fileTab[f.fd] := 0; res := Unix.Close(f.fd); f.fd := -1; DEC(Kernel.nofiles); - IF f.tempFile THEN res := Unix.Unlink(f.workName) END - END - END Finalize; - - PROCEDURE Init; - VAR i: LONGINT; - BEGIN - i := 0; WHILE i < fileTabSize DO fileTab[i] := 0; INC(i) END ; - tempno := -1; Kernel.nofiles := 0 - END Init; - -BEGIN Init -END Files. diff --git a/src/system/linux/gcc/x86_64/Files0.Mod b/src/system/linux/gcc/x86_64/Files0.Mod deleted file mode 100644 index 1d9cd953..00000000 --- a/src/system/linux/gcc/x86_64/Files0.Mod +++ /dev/null @@ -1,636 +0,0 @@ -MODULE Files0; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files *) - -(* this module is not for use by developers and inteded to bootstrap voc *) -(* for general use import Files module *) - - IMPORT SYSTEM, Unix, Kernel := Kernel0, Args, Console; - - (* standard data type I/O - - little endian, - Sint:1, Int:2, Lint:4 - ORD({0}) = 1, - false = 0, true =1 - IEEE real format, - null terminated strings, - compact numbers according to M.Odersky *) - - - CONST - nofbufs = 4; - bufsize = 4096; - fileTabSize = 64; - noDesc = -1; - notDone = -1; - - (* file states *) - open = 0; create = 1; close = 2; - - - TYPE - FileName = ARRAY 101 OF CHAR; - File* = POINTER TO Handle; - Buffer = POINTER TO BufDesc; - - Handle = RECORD - workName, registerName: FileName; - tempFile: BOOLEAN; - dev, ino, mtime: LONGINT; - fd-: INTEGER; - len, pos: LONGINT; - bufs: ARRAY nofbufs OF Buffer; - swapper, state: INTEGER - END ; - - BufDesc = RECORD - f: File; - chg: BOOLEAN; - org, size: LONGINT; - data: ARRAY bufsize OF SYSTEM.BYTE - END ; - - Rider* = RECORD - res*: LONGINT; - eof*: BOOLEAN; - buf: Buffer; - org, offset: LONGINT - END ; - - Time = POINTER TO TimeDesc; - TimeDesc = RECORD - sec*, min*, hour*, mday*, mon*, year*, wday*, isdst*, zone*, gmtoff*: LONGINT; -(* sec*, min*, hour*, mday*, mon*, year*, wday*, isdst*, zone*, gmtoff*: INTEGER;*) - END ; - - VAR - fileTab: ARRAY fileTabSize OF LONGINT (*=File*); - tempno: INTEGER; - -(* for localtime *) - PROCEDURE -includetime() - '#include "time.h"'; - - PROCEDURE -localtime(VAR clock: LONGINT): Time - "(Files0_Time) localtime(clock)"; - - PROCEDURE -getcwd(VAR cwd: Unix.Name) - "getcwd(cwd, cwd__len)"; - - PROCEDURE -IdxTrap "__HALT(-1)"; - - PROCEDURE^ Finalize(o: SYSTEM.PTR); - - PROCEDURE Err(s: ARRAY OF CHAR; f: File; errno: LONGINT); - BEGIN - Console.Ln; Console.String("-- "); Console.String(s); Console.String(": "); - IF f # NIL THEN - IF f.registerName # "" THEN Console.String(f.registerName) ELSE Console.String(f.workName) END - END ; - IF errno # 0 THEN Console.String(" errno = "); Console.Int(errno, 1) END ; - Console.Ln; - HALT(99) - END Err; - - PROCEDURE MakeFileName(dir, name: ARRAY OF CHAR; VAR dest: ARRAY OF CHAR); - VAR i, j: INTEGER; - BEGIN i := 0; j := 0; - WHILE dir[i] # 0X DO dest[i] := dir[i]; INC(i) END ; - IF dest[i-1] # "/" THEN dest[i] := "/"; INC(i) END ; - WHILE name[j] # 0X DO dest[i] := name[j]; INC(i); INC(j) END ; - dest[i] := 0X - END MakeFileName; - - PROCEDURE GetTempName(finalName: ARRAY OF CHAR; VAR name: ARRAY OF CHAR); - VAR n, i, j: LONGINT; - BEGIN - INC(tempno); n := tempno; i := 0; - IF finalName[0] # "/" THEN (* relative pathname *) - WHILE Kernel.CWD[i] # 0X DO name[i] := Kernel.CWD[i]; INC(i) END; - IF Kernel.CWD[i-1] # "/" THEN name[i] := "/"; INC(i) END - END; - j := 0; - WHILE finalName[j] # 0X DO name[i] := finalName[j]; INC(i); INC(j) END; - DEC(i); - WHILE name[i] # "/" DO DEC(i) END; - name[i+1] := "."; name[i+2] := "t"; name[i+3] := "m"; name[i+4] := "p"; name[i+5] := "."; INC(i, 6); - WHILE n > 0 DO name[i] := CHR(n MOD 10 + ORD("0")); n := n DIV 10; INC(i) END; - name[i] := "."; INC(i); n := SHORT(Unix.Getpid()); - WHILE n > 0 DO name[i] := CHR(n MOD 10 + ORD("0")); n := n DIV 10; INC(i) END; - name[i] := 0X - END GetTempName; - - PROCEDURE Create(f: File); - VAR stat: Unix.Status; done: BOOLEAN; - errno: LONGINT; err: ARRAY 32 OF CHAR; - BEGIN - IF f.fd = noDesc THEN - IF f.state = create THEN GetTempName(f.registerName, f.workName); f.tempFile := TRUE - ELSIF f.state = close THEN - f.workName := f.registerName; f.registerName := ""; f.tempFile := FALSE - END ; - errno := Unix.Unlink(f.workName); (*unlink first to avoid stale NFS handles and to avoid reuse of inodes*) -f.fd := Unix.Open(f.workName, SHORT(SYSTEM.VAL(LONGINT, (Unix.rdwr + Unix.creat + Unix.trunc))), SHORT(SYSTEM.VAL(LONGINT, ({2, 4,5, 7,8})))); - done := f.fd >= 0; errno := Unix.errno(); - IF (~done & ((errno = Unix.ENFILE) OR (errno = Unix.EMFILE))) OR (done & (f.fd >= fileTabSize)) THEN - IF done & (f.fd >= fileTabSize) THEN errno := Unix.Close(f.fd) END ; - Kernel.GC(TRUE); - f.fd := Unix.Open(f.workName, SHORT(SYSTEM.VAL(LONGINT, (Unix.rdwr + Unix.creat + Unix.trunc))), SHORT(SYSTEM.VAL(LONGINT, {2, 4,5, 7,8}))); - done := f.fd >= 0 - END ; - IF done THEN - IF f.fd >= fileTabSize THEN errno := Unix.Close(f.fd); Err("too many files open", f, 0) - ELSE fileTab[f.fd] := SYSTEM.VAL(LONGINT, f); INC(Kernel.nofiles); Kernel.RegisterObject(f, Finalize); - f.state := open; f.pos := 0; errno := Unix.Fstat(f.fd, stat); - f.dev := stat.dev; f.ino := stat.ino; f.mtime := stat.mtime - END - ELSE errno := Unix.errno(); - IF errno = Unix.ENOENT THEN err := "no such directory" - ELSIF (errno = Unix.ENFILE) OR (errno = Unix.EMFILE) THEN err := "too many files open" - ELSE err := "file not created" - END ; - Err(err, f, errno) - END - END - END Create; - - PROCEDURE Flush(buf: Buffer); - VAR res: LONGINT; f: File; stat: Unix.Status; - BEGIN - IF buf.chg THEN f := buf.f; Create(f); - IF buf.org # f.pos THEN res := Unix.Lseek(f.fd, buf.org, 0) END ; - res := Unix.Write(f.fd, SYSTEM.ADR(buf.data), buf.size); - IF res < 0 THEN Err("error in writing file", f, Unix.errno()) END ; - f.pos := buf.org + buf.size; - buf.chg := FALSE; - res := Unix.Fstat(f.fd, stat); - f.mtime := stat.mtime - END - END Flush; - - PROCEDURE Close* (f: File); - VAR i, res: LONGINT; - BEGIN - IF (f.state # create) OR (f.registerName # "") THEN - Create(f); i := 0; - WHILE (i < nofbufs) & (f.bufs[i] # NIL) DO Flush(f.bufs[i]); INC(i) END ; - res := Unix.Fsync(f.fd); - IF res < 0 THEN Err("error in writing file", f, Unix.errno()) END - END - END Close; - - PROCEDURE Length* (f: File): LONGINT; - BEGIN RETURN f.len - END Length; - - PROCEDURE New* (name: ARRAY OF CHAR): File; - VAR f: File; - BEGIN - NEW(f); f.workName := ""; COPY(name, f.registerName); - f.fd := noDesc; f.state := create; f.len := 0; f.pos := 0; f.swapper := -1; (*all f.buf[i] = NIL*) - RETURN f - END New; - - PROCEDURE ScanPath(VAR pos: INTEGER; VAR dir: ARRAY OF CHAR); (* supports ~, ~user and blanks inside path *) - VAR i: INTEGER; ch: CHAR; home: ARRAY 256 OF CHAR; - BEGIN - i := 0; ch := Kernel.OBERON[pos]; - WHILE (ch = " ") OR (ch = ":") DO INC(pos); ch := Kernel.OBERON[pos] END ; - IF ch = "~" THEN - INC(pos); ch := Kernel.OBERON[pos]; - home := ""; Args.GetEnv("HOME", home); - WHILE home[i] # 0X DO dir[i] := home[i]; INC(i) END ; - IF (ch # "/") & (ch # 0X) & (ch # ":") & (ch # " ") THEN - WHILE (i > 0) & (dir[i-1] # "/") DO DEC(i) END - END - END ; - WHILE (ch # 0X) & (ch # ":") DO dir[i] := ch; INC(i); INC(pos); ch := Kernel.OBERON[pos] END ; - WHILE (i > 0) & (dir[i-1] = " ") DO DEC(i) END ; - dir[i] := 0X - END ScanPath; - - PROCEDURE HasDir(VAR name: ARRAY OF CHAR): BOOLEAN; - VAR i: INTEGER; ch: CHAR; - BEGIN i := 0; ch := name[0]; - WHILE (ch # 0X) & (ch # "/") DO INC(i); ch := name[i] END ; - RETURN ch = "/" - END HasDir; - - PROCEDURE CacheEntry(dev, ino: LONGINT; mtime: LONGINT): File; - VAR f: File; i: INTEGER; stat: Unix.Status; res: LONGINT; - BEGIN i := 0; - WHILE i < fileTabSize DO - f := SYSTEM.VAL(File, fileTab[i]); - IF (f # NIL) & (ino = f.ino) & (dev = f.dev) THEN - IF mtime # f.mtime THEN i := 0; - WHILE i < nofbufs DO - IF f.bufs[i] # NIL THEN f.bufs[i].org := -1; f.bufs[i] := NIL END ; - INC(i) - END ; - f.swapper := -1; f.mtime := mtime; - res := Unix.Fstat(f.fd, stat); f.len := stat.size - END ; - RETURN f - END ; - INC(i) - END ; - RETURN NIL - END CacheEntry; - - PROCEDURE Old* (name: ARRAY OF CHAR): File; - VAR f: File; fd: INTEGER; res, errno: LONGINT; pos: INTEGER; done: BOOLEAN; - dir, path: ARRAY 256 OF CHAR; - stat: Unix.Status; - BEGIN - IF name # "" THEN - IF HasDir(name) THEN dir := ""; COPY(name, path) - ELSE pos := 0; ScanPath(pos, dir); MakeFileName(dir, name, path); ScanPath(pos, dir) - END ; - LOOP - fd := Unix.Open(path, SHORT(SYSTEM.VAL(LONGINT, Unix.rdwr)), SHORT(SYSTEM.VAL(LONGINT, {}))); done := fd >= 0; errno := Unix.errno(); - IF (~done & ((errno = Unix.ENFILE) OR (errno = Unix.EMFILE))) OR (done & (fd >= fileTabSize)) THEN - IF done & (fd >= fileTabSize) THEN res := Unix.Close(fd) END ; - Kernel.GC(TRUE); - fd := Unix.Open(path, SHORT(SYSTEM.VAL(LONGINT, Unix.rdwr)), SHORT(SYSTEM.VAL(LONGINT, {}))); - done := fd >= 0; errno := Unix.errno(); - IF ~done & ((errno = Unix.ENFILE) OR (errno = Unix.EMFILE)) THEN Err("too many files open", f, errno) END - END ; - IF ~done & ((errno = Unix.EACCES) OR (errno = Unix.EROFS) OR (errno = Unix.EAGAIN)) THEN - (* errno EAGAIN observed on Solaris 2.4 *) - fd := Unix.Open(path, SHORT(SYSTEM.VAL(LONGINT, Unix.rdonly)), SHORT(SYSTEM.VAL(LONGINT, {}))); done := fd >= 0; errno := Unix.errno() - END ; -IF (~done) & (errno # Unix.ENOENT) THEN - Console.String("warning Files0.Old "); Console.String(name); - Console.String(" errno = "); Console.Int(errno, 0); Console.Ln; -END ; - IF done THEN - res := Unix.Fstat(fd, stat); - f := CacheEntry(stat.dev, stat.ino, stat.mtime); - IF f # NIL THEN res := Unix.Close(fd); RETURN f - ELSIF fd >= fileTabSize THEN res := Unix.Close(fd); Err("too many files open", f, 0) - ELSE NEW(f); fileTab[fd] := SYSTEM.VAL(LONGINT, f); INC(Kernel.nofiles); Kernel.RegisterObject(f, Finalize); - f.fd := fd; f.state := open; f.len := stat.size; f.pos := 0; f.swapper := -1; (*all f.buf[i] = NIL*) - COPY(name, f.workName); f.registerName := ""; f.tempFile := FALSE; - f.dev := stat.dev; f.ino := stat.ino; f.mtime := stat.mtime; - RETURN f - END - ELSIF dir = "" THEN RETURN NIL - ELSE MakeFileName(dir, name, path); ScanPath(pos, dir) - END - END - ELSE RETURN NIL - END - END Old; - - PROCEDURE Purge* (f: File); - VAR i: INTEGER; stat: Unix.Status; res: LONGINT; - BEGIN i := 0; - WHILE i < nofbufs DO - IF f.bufs[i] # NIL THEN f.bufs[i].org := -1; f.bufs[i] := NIL END ; - INC(i) - END ; - IF f.fd # noDesc THEN res := Unix.Ftruncate(f.fd, 0); res := Unix.Lseek(f.fd, 0, 0) END ; - f.pos := 0; f.len := 0; f.swapper := -1; - res := Unix.Fstat(f.fd, stat); f.mtime := stat.mtime - END Purge; - - PROCEDURE GetDate* (f: File; VAR t, d: LONGINT); - VAR stat: Unix.Status; clock, res: LONGINT; time: Time; - BEGIN - Create(f); res := Unix.Fstat(f.fd, stat); - time := localtime(stat.mtime); - t := time.sec + ASH(time.min, 6) + ASH(time.hour, 12); - d := time.mday + ASH(time.mon+1, 5) + ASH(time.year MOD 100, 9) - END GetDate; - - PROCEDURE Pos* (VAR r: Rider): LONGINT; - BEGIN RETURN r.org + r.offset - END Pos; - - PROCEDURE Set* (VAR r: Rider; f: File; pos: LONGINT); - VAR org, offset, i, n, res: LONGINT; buf: Buffer; - BEGIN - IF f # NIL THEN - IF pos > f.len THEN pos := f.len ELSIF pos < 0 THEN pos := 0 END ; - offset := pos MOD bufsize; org := pos - offset; i := 0; - WHILE (i < nofbufs) & (f.bufs[i] # NIL) & (org # f.bufs[i].org) DO INC(i) END ; - IF i < nofbufs THEN - IF f.bufs[i] = NIL THEN NEW(buf); buf.chg := FALSE; buf.org := -1; buf.f := f; f.bufs[i] := buf - ELSE buf := f.bufs[i] - END - ELSE - f.swapper := (f.swapper + 1) MOD nofbufs; - buf := f.bufs[f.swapper]; - Flush(buf) - END ; - IF buf.org # org THEN - IF org = f.len THEN buf.size := 0 - ELSE Create(f); - IF f.pos # org THEN res := Unix.Lseek(f.fd, org, 0) END ; - n := Unix.ReadBlk(f.fd, buf.data); - IF n < 0 THEN Err("read from file not done", f, Unix.errno()) END ; - f.pos := org + n; - buf.size := n - END ; - buf.org := org; buf.chg := FALSE - END - ELSE buf := NIL; org := 0; offset := 0 - END ; - r.buf := buf; r.org := org; r.offset := offset; r.eof := FALSE; r.res := 0 - END Set; - - PROCEDURE Read* (VAR r: Rider; VAR x: SYSTEM.BYTE); - VAR offset: LONGINT; buf: Buffer; - BEGIN - buf := r.buf; offset := r.offset; - IF r.org # buf.org THEN Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset END ; - IF (offset < buf.size) THEN - x := buf.data[offset]; r.offset := offset + 1 - ELSIF r.org + offset < buf.f.len THEN - Set(r, r.buf.f, r.org + offset); - x := r.buf.data[0]; r.offset := 1 - ELSE - x := 0X; r.eof := TRUE - END - END Read; - - PROCEDURE ReadBytes* (VAR r: Rider; VAR x: ARRAY OF SYSTEM.BYTE; n: LONGINT); - VAR xpos, min, restInBuf, offset: LONGINT; buf: Buffer; - BEGIN - IF n > LEN(x) THEN IdxTrap END ; - xpos := 0; buf := r.buf; offset := r.offset; - WHILE n > 0 DO - IF (r.org # buf.org) OR (offset >= bufsize) THEN - Set(r, buf.f, r.org + offset); - buf := r.buf; offset := r.offset - END ; - restInBuf := buf.size - offset; - IF restInBuf = 0 THEN r.res := n; r.eof := TRUE; RETURN - ELSIF n > restInBuf THEN min := restInBuf ELSE min := n END ; - SYSTEM.MOVE(SYSTEM.ADR(buf.data) + offset, SYSTEM.ADR(x) + xpos, min); - INC(offset, min); r.offset := offset; INC(xpos, min); DEC(n, min) - END ; - r.res := 0; r.eof := FALSE - END ReadBytes; - - PROCEDURE ReadByte* (VAR r : Rider; VAR x : ARRAY OF SYSTEM.BYTE); - BEGIN - ReadBytes(r, x, 1); - END ReadByte; - - PROCEDURE Base* (VAR r: Rider): File; - BEGIN RETURN r.buf.f - END Base; - - PROCEDURE Write* (VAR r: Rider; x: SYSTEM.BYTE); - VAR buf: Buffer; offset: LONGINT; - BEGIN - buf := r.buf; offset := r.offset; - IF (r.org # buf.org) OR (offset >= bufsize) THEN - Set(r, buf.f, r.org + offset); - buf := r.buf; offset := r.offset - END ; - buf.data[offset] := x; - buf.chg := TRUE; - IF offset = buf.size THEN - INC(buf.size); INC(buf.f.len) - END ; - r.offset := offset + 1; r.res := 0 - END Write; - - PROCEDURE WriteBytes* (VAR r: Rider; VAR x: ARRAY OF SYSTEM.BYTE; n: LONGINT); - VAR xpos, min, restInBuf, offset: LONGINT; buf: Buffer; - BEGIN - IF n > LEN(x) THEN IdxTrap END ; - xpos := 0; buf := r.buf; offset := r.offset; - WHILE n > 0 DO - IF (r.org # buf.org) OR (offset >= bufsize) THEN - Set(r, buf.f, r.org + offset); - buf := r.buf; offset := r.offset - END ; - restInBuf := bufsize - offset; - IF n > restInBuf THEN min := restInBuf ELSE min := n END ; - SYSTEM.MOVE(SYSTEM.ADR(x) + xpos, SYSTEM.ADR(buf.data) + offset, min); - INC(offset, min); r.offset := offset; - IF offset > buf.size THEN INC(buf.f.len, offset - buf.size); buf.size := offset END ; - INC(xpos, min); DEC(n, min); buf.chg := TRUE - END ; - r.res := 0 - END WriteBytes; - -(* another solution would be one that is similar to ReadBytes, WriteBytes. -No code duplication, more symmetric, only two ifs for -Read and Write in buffer, buf.size replaced by bufsize in Write ops, buf.size and len -must be made consistent with offset (if offset > buf.size) in a lazy way. - -PROCEDURE Write* (VAR r: Rider; x: SYSTEM.BYTE); - VAR buf: Buffer; offset: LONGINT; -BEGIN - buf := r.buf; offset := r.offset; - IF (offset >= bufsize) OR (r.org # buf.org) THEN - Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset; - END ; - buf.data[offset] := x; r.offset := offset + 1; buf.chg := TRUE -END Write; - -PROCEDURE WriteBytes ... - -PROCEDURE Read* (VAR r: Rider; VAR x: SYSTEM.BYTE); - VAR offset: LONGINT; buf: Buffer; -BEGIN - buf := r.buf; offset := r.offset; - IF (offset >= buf.size) OR (r.org # buf.org) THEN - IF r.org + offset >= buf.f.len THEN x := 0X; r.eof := TRUE; RETURN - ELSE Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset - END - END ; - x := buf.data[offset]; r.offset := offset + 1 -END Read; - -but this would also affect Set, Length, and Flush. -Especially Length would become fairly complex. -*) - - PROCEDURE Delete* (name: ARRAY OF CHAR; VAR res: INTEGER); - BEGIN - res := SHORT(Unix.Unlink(name)); - res := SHORT(Unix.errno()) - END Delete; - - PROCEDURE Rename* (old, new: ARRAY OF CHAR; VAR res: INTEGER); - VAR fdold, fdnew: INTEGER; n, errno, r: LONGINT; - ostat, nstat: Unix.Status; - buf: ARRAY 4096 OF CHAR; - BEGIN - r := Unix.Stat(old, ostat); - IF r >= 0 THEN - r := Unix.Stat(new, nstat); - IF (r >= 0) & ((ostat.dev # nstat.dev) OR (ostat.ino # nstat.ino)) THEN - Delete(new, res); (* work around stale nfs handles *) - END ; - r := Unix.Rename(old, new); - IF r < 0 THEN res := SHORT(Unix.errno()); - IF res = Unix.EXDEV THEN (* cross device link, move the file *) - fdold := Unix.Open(old, SHORT(SYSTEM.VAL(LONGINT, Unix.rdonly)), SHORT(SYSTEM.VAL(LONGINT, {}))); - IF fdold < 0 THEN res := 2; RETURN END ; - fdnew := Unix.Open(new, SHORT(SYSTEM.VAL(LONGINT, Unix.rdwr + Unix.creat + Unix.trunc)), SHORT(SYSTEM.VAL(LONGINT, {2, 4,5, 7,8}))); - IF fdnew < 0 THEN r := Unix.Close(fdold); res := 3; RETURN END ; - n := Unix.Read(fdold, SYSTEM.ADR(buf), bufsize); - WHILE n > 0 DO - r := Unix.Write(fdnew, SYSTEM.ADR(buf), n); - IF r < 0 THEN errno := Unix.errno(); r := Unix.Close(fdold); r := Unix.Close(fdnew); - Err("cannot move file", NIL, errno) - END ; - n := Unix.Read(fdold, SYSTEM.ADR(buf), bufsize) - END ; - errno := Unix.errno(); - r := Unix.Close(fdold); r := Unix.Close(fdnew); - IF n = 0 THEN r := Unix.Unlink(old); res := 0 - ELSE Err("cannot move file", NIL, errno) - END ; - ELSE RETURN (* res is Unix.Rename return code *) - END - END ; - res := 0 - ELSE res := 2 (* old file not found *) - END - END Rename; - - PROCEDURE Register* (f: File); - VAR idx, errno: INTEGER; f1: File; file: ARRAY 104 OF CHAR; - BEGIN - IF (f.state = create) & (f.registerName # "") THEN f.state := close (* shortcut renaming *) END ; - Close(f); - IF f.registerName # "" THEN - Rename(f.workName, f.registerName, errno); - IF errno # 0 THEN COPY(f.registerName, file); HALT(99) END ; - f.workName := f.registerName; f.registerName := ""; f.tempFile := FALSE - END - END Register; - - PROCEDURE ChangeDirectory*(path: ARRAY OF CHAR; VAR res: INTEGER); - BEGIN - res := SHORT(Unix.Chdir(path)); - getcwd(Kernel.CWD) - END ChangeDirectory; - - PROCEDURE FlipBytes(VAR src, dest: ARRAY OF SYSTEM.BYTE); - VAR i, j: LONGINT; - BEGIN - IF ~Kernel.littleEndian THEN i := LEN(src); j := 0; - WHILE i > 0 DO DEC(i); dest[j] := src[i]; INC(j) END - ELSE SYSTEM.MOVE(SYSTEM.ADR(src), SYSTEM.ADR(dest), LEN(src)) - END - END FlipBytes; - - PROCEDURE ReadBool* (VAR R: Rider; VAR x: BOOLEAN); - BEGIN Read(R, SYSTEM.VAL(CHAR, x)) - END ReadBool; - - PROCEDURE ReadInt* (VAR R: Rider; VAR x: INTEGER); - VAR b: ARRAY 2 OF CHAR; - BEGIN ReadBytes(R, b, 2); - x := ORD(b[0]) + ORD(b[1])*256 - END ReadInt; - - PROCEDURE ReadLInt* (VAR R: Rider; VAR x: LONGINT); - VAR b: ARRAY 4 OF CHAR; - BEGIN ReadBytes(R, b, 4); - x := ORD(b[0]) + ORD(b[1])*100H + ORD(b[2])*10000H + ORD(b[3])*1000000H - END ReadLInt; - - PROCEDURE ReadSet* (VAR R: Rider; VAR x: SET); - VAR b: ARRAY 4 OF CHAR; - BEGIN ReadBytes(R, b, 4); - x := SYSTEM.VAL(SET, ORD(b[0]) + ORD(b[1])*100H + ORD(b[2])*10000H + ORD(b[3])*1000000H) - END ReadSet; - - PROCEDURE ReadReal* (VAR R: Rider; VAR x: REAL); - VAR b: ARRAY 4 OF CHAR; - BEGIN ReadBytes(R, b, 4); FlipBytes(b, x) - END ReadReal; - - PROCEDURE ReadLReal* (VAR R: Rider; VAR x: LONGREAL); - VAR b: ARRAY 8 OF CHAR; - BEGIN ReadBytes(R, b, 8); FlipBytes(b, x) - END ReadLReal; - - PROCEDURE ReadString* (VAR R: Rider; VAR x: ARRAY OF CHAR); - VAR i: INTEGER; ch: CHAR; - BEGIN i := 0; - REPEAT Read(R, ch); x[i] := ch; INC(i) UNTIL ch = 0X - END ReadString; - - PROCEDURE ReadNum* (VAR R: Rider; VAR x: LONGINT); - VAR s: SHORTINT; ch: CHAR; n: LONGINT; - BEGIN s := 0; n := 0; Read(R, ch); - WHILE ORD(ch) >= 128 DO INC(n, ASH(ORD(ch) - 128, s) ); INC(s, 7); Read(R, ch) END; - INC(n, ASH(ORD(ch) MOD 64 - ORD(ch) DIV 64 * 64, s) ); - x := n - END ReadNum; - - PROCEDURE WriteBool* (VAR R: Rider; x: BOOLEAN); - BEGIN Write(R, SYSTEM.VAL(CHAR, x)) - END WriteBool; - - PROCEDURE WriteInt* (VAR R: Rider; x: INTEGER); - VAR b: ARRAY 2 OF CHAR; - BEGIN b[0] := CHR(x); b[1] := CHR(x DIV 256); - WriteBytes(R, b, 2); - END WriteInt; - - PROCEDURE WriteLInt* (VAR R: Rider; x: LONGINT); - VAR b: ARRAY 4 OF CHAR; - BEGIN - b[0] := CHR(x); b[1] := CHR(x DIV 100H); b[2] := CHR(x DIV 10000H); b[3] := CHR(x DIV 1000000H); - WriteBytes(R, b, 4); - END WriteLInt; - - PROCEDURE WriteSet* (VAR R: Rider; x: SET); - VAR b: ARRAY 4 OF CHAR; i: LONGINT; - BEGIN i := SYSTEM.VAL(LONGINT, x); - 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; - - PROCEDURE WriteReal* (VAR R: Rider; x: REAL); - VAR b: ARRAY 4 OF CHAR; - BEGIN FlipBytes(x, b); WriteBytes(R, b, 4) - END WriteReal; - - PROCEDURE WriteLReal* (VAR R: Rider; x: LONGREAL); - VAR b: ARRAY 8 OF CHAR; - BEGIN FlipBytes(x, b); WriteBytes(R, b, 8) - END WriteLReal; - - PROCEDURE WriteString* (VAR R: Rider; x: ARRAY [1] OF CHAR); - VAR i: INTEGER; - BEGIN i := 0; - WHILE x[i] # 0X DO INC(i) END ; - WriteBytes(R, x, i+1) - END WriteString; - - PROCEDURE WriteNum* (VAR R: Rider; x: LONGINT); - BEGIN - WHILE (x < - 64) OR (x > 63) DO Write(R, CHR(x MOD 128 + 128)); x := x DIV 128 END; - Write(R, CHR(x MOD 128)) - END WriteNum; - - PROCEDURE Finalize(o: SYSTEM.PTR); - VAR f: File; res: LONGINT; - BEGIN - f := SYSTEM.VAL(File, o); - IF f.fd >= 0 THEN - fileTab[f.fd] := 0; res := Unix.Close(f.fd); f.fd := -1; DEC(Kernel.nofiles); - IF f.tempFile THEN res := Unix.Unlink(f.workName) END - END - END Finalize; - - PROCEDURE Init; - VAR i: LONGINT; - BEGIN - i := 0; WHILE i < fileTabSize DO fileTab[i] := 0; INC(i) END ; - tempno := -1; Kernel.nofiles := 0 - END Init; - -BEGIN Init -END Files0. diff --git a/src/system/linux/gcc/x86_64/SYSTEM.c0 b/src/system/linux/gcc/x86_64/SYSTEM.c0 deleted file mode 100644 index 3d875068..00000000 --- a/src/system/linux/gcc/x86_64/SYSTEM.c0 +++ /dev/null @@ -1,205 +0,0 @@ -/* -* The body prefix file of the voc(jet backend) runtime system, Version 1.0 -* -* Copyright (c) Software Templ, 1994, 1995 -* -* Module SYSTEM is subject to change any time without prior notification. -* Software Templ disclaims all warranties with regard to module SYSTEM, -* in particular shall Software Templ not be liable for any damage resulting -* from inappropriate use or modification of module SYSTEM. -* -* Version 1.1 jt, 24.11.95 fixes for correct pointer arithmetic on Cray computers -* jt 31.1.2007 ANSI prototypes for malloc and exit in order to avoid cc warnings -* -*/ - -#include "SYSTEM.h" -#ifdef __STDC__ -#include "stdarg.h" -#else -#include "varargs.h" -#endif - -extern void *malloc(unsigned long size); -extern void exit(int status); - -void (*SYSTEM_Halt)(); -LONGINT SYSTEM_halt; /* x in HALT(x) */ -LONGINT SYSTEM_assert; /* x in ASSERT(cond, x) */ -LONGINT SYSTEM_argc; -LONGINT SYSTEM_argv; -LONGINT SYSTEM_lock; -BOOLEAN SYSTEM_interrupted; -static LONGINT SYSTEM_mainfrm; /* adr of main proc stack frame, used for stack collection */ - -#define Lock SYSTEM_lock++ -#define Unlock SYSTEM_lock--; if (SYSTEM_interrupted && (SYSTEM_lock == 0)) __HALT(-9) - - -static void SYSTEM_InitHeap(); -void *SYSTEM__init(); - -void SYSTEM_INIT(argc, argvadr) - int argc; long argvadr; -{ - SYSTEM_mainfrm = argvadr; - SYSTEM_argc = argc; - SYSTEM_argv = *(long*)argvadr; - SYSTEM_InitHeap(); - SYSTEM_halt = -128; - SYSTEM__init(); -} - -void SYSTEM_FINI() -{ - SYSTEM_FINALL(); -} - -long SYSTEM_XCHK(i, ub) long i, ub; {return __X(i, ub);} -long SYSTEM_RCHK(i, ub) long i, ub; {return __R(i, ub);} -long SYSTEM_ASH(i, n) long i, n; {return __ASH(i, n);} -long SYSTEM_ABS(i) long i; {return __ABS(i);} -double SYSTEM_ABSD(i) double i; {return __ABS(i);} - -void SYSTEM_INHERIT(t, t0) - long *t, *t0; -{ - t -= __TPROC0OFF; - t0 -= __TPROC0OFF; - while (*t0 != __EOM) {*t = *t0; t--; t0--;} -} - -void SYSTEM_ENUMP(adr, n, P) - long *adr; - long n; - void (*P)(); -{ - while (n > 0) {P(*adr); adr++; n--;} -} - -void SYSTEM_ENUMR(adr, typ, size, n, P) - char *adr; - long *typ, size, n; - void (*P)(); -{ - long *t, off; - typ++; - while (n > 0) { - t = typ; - off = *t; - while (off >= 0) {P(*(long*)(adr+off)); t++; off = *t;} - adr += size; n--; - } -} - -long SYSTEM_DIV(x, y) - unsigned long x, y; -{ if ((long) x >= 0) return (x / y); - else return -((y - 1 - x) / y); -} - -long SYSTEM_MOD(x, y) - unsigned long x, y; -{ unsigned long m; - if ((long) x >= 0) return (x % y); - else { m = (-x) % y; - if (m != 0) return (y - m); else return 0; - } -} - -long SYSTEM_ENTIER(x) - double x; -{ - long y; - if (x >= 0) - return (long)x; - else { - y = (long)x; - if (y <= x) return y; else return y - 1; - } -} - -void SYSTEM_HALT(n) - int n; -{ - SYSTEM_halt = n; - if (SYSTEM_Halt!=0) SYSTEM_Halt(n); - exit(n); -} - -#ifdef __STDC__ -SYSTEM_PTR SYSTEM_NEWARR(long *typ, long elemsz, int elemalgn, int nofdim, int nofdyn, ...) -#else -SYSTEM_PTR SYSTEM_NEWARR(typ, elemsz, elemalgn, nofdim, nofdyn, va_alist) - long *typ, elemsz; - int elemalgn, nofdim, nofdyn; - va_dcl -#endif -{ - long nofelems, size, dataoff, n, nptr, *x, *p, nofptrs, i, *ptab, off; - va_list ap; -#ifdef __STDC__ - va_start(ap, nofdyn); -#else - va_start(ap); -#endif - nofelems = 1; - while (nofdim > 0) { - nofelems = nofelems * va_arg(ap, long); nofdim--; - if (nofelems <= 0) __HALT(-20); - } - va_end(ap); - dataoff = nofdyn * sizeof(long); - if (elemalgn > sizeof(long)) { - n = dataoff % elemalgn; - if (n != 0) dataoff += elemalgn - n; - } - size = dataoff + nofelems * elemsz; - Lock; - if (typ == NIL) { - /* element typ does not contain pointers */ - x = SYSTEM_NEWBLK(size); - } - else if (typ == POINTER__typ) { - /* element type is a pointer */ - x = SYSTEM_NEWBLK(size + nofelems * sizeof(long)); - p = (long*)x[-1]; - p[-nofelems] = *p; /* build new type desc in situ: 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ - p -= nofelems - 1; n = 1; /* n =1 for skipping the size field */ - while (n <= nofelems) {*p = n*sizeof(long); p++; n++;} - *p = - (nofelems + 1) * sizeof(long); /* sentinel */ - x[-1] -= nofelems * sizeof(long); - } - else { - /* element type is a record that contains pointers */ - ptab = typ + 1; nofptrs = 0; - while (ptab[nofptrs] >= 0) {nofptrs++;} /* number of pointers per element */ - nptr = nofelems * nofptrs; /* total number of pointers */ - x = SYSTEM_NEWBLK(size + nptr * sizeof(long)); - p = (long*)x[- 1]; - p[-nptr] = *p; /* build new type desc in situ; 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ - p -= nptr - 1; n = 0; off = dataoff; - while (n < nofelems) {i = 0; - while (i < nofptrs) {*p = off + ptab[i]; p++; i++;} - off += elemsz; n++; - } - *p = - (nptr + 1) * sizeof(long); /* sentinel */ - x[-1] -= nptr * sizeof(long); - } - if (nofdyn != 0) { - /* setup len vector for index checks */ -#ifdef __STDC__ - va_start(ap, nofdyn); -#else - va_start(ap); -#endif - p = x; - while (nofdyn > 0) {*p = va_arg(ap, long); p++, nofdyn--;} - va_end(ap); - } - Unlock; - return x; -} - -/* ----------- end of SYSTEM.co ------------- */ - diff --git a/src/system/linux/gcc/x86_64/SYSTEM.h b/src/system/linux/gcc/x86_64/SYSTEM.h deleted file mode 100644 index 2c8e71d0..00000000 --- a/src/system/linux/gcc/x86_64/SYSTEM.h +++ /dev/null @@ -1,238 +0,0 @@ -#ifndef SYSTEM__h -#define SYSTEM__h - -/* - -voc (jet backend) runtime system interface and macros library -copyright (c) Josef Templ, 1995, 1996 - -gcc for Linux version (same as SPARC/Solaris2) -uses double # as concatenation operator - -*/ - -#include -#include /* for type sizes -- noch */ - -extern void *memcpy(void *dest, const void *src, unsigned long n); -extern void *malloc(unsigned long size); -extern void exit(int status); - -#define export -#define import extern - -/* constants */ -#define __MAXEXT 16 -#define NIL 0L -#define POINTER__typ (long*)1L /* not NIL and not a valid type */ - -/* basic types */ -//typedef char BOOLEAN; -#define BOOLEAN char -//typedef unsigned char CHAR; -#define CHAR unsigned char -//exactly two bytes -#define LONGCHAR unsigned short int -//typedef signed char SHORTINT; -#define SHORTINT signed char -//for x86 GNU/Linux -//typedef short int INTEGER; -//for x86_64 GNU/Linux -//typedef int INTEGER; -#define INTEGER int -//typedef long LONGINT; -#define LONGINT long -//typedef float REAL; -#define REAL float -//typedef double LONGREAL; -#define LONGREAL double -//typedef unsigned long SET; -#define SET unsigned long -typedef void *SYSTEM_PTR; -//#define *SYSTEM_PTR void -//typedef unsigned char SYSTEM_BYTE; -#define SYSTEM_BYTE unsigned char -typedef int8_t SYSTEM_INT8; -typedef int16_t SYSTEM_INT16; -typedef int32_t SYSTEM_INT32; -typedef int64_t SYSTEM_INT64; - -/* runtime system routines */ -extern long SYSTEM_DIV(); -extern long SYSTEM_MOD(); -extern long SYSTEM_ENTIER(); -extern long SYSTEM_ASH(); -extern long SYSTEM_ABS(); -extern long SYSTEM_XCHK(); -extern long SYSTEM_RCHK(); -extern double SYSTEM_ABSD(); -extern SYSTEM_PTR SYSTEM_NEWREC(); -extern SYSTEM_PTR SYSTEM_NEWBLK(); -#ifdef __STDC__ -extern SYSTEM_PTR SYSTEM_NEWARR(long*, long, int, int, int, ...); -#else -extern SYSTEM_PTR SYSTEM_NEWARR(); -#endif -extern SYSTEM_PTR SYSTEM_REGMOD(); -extern void SYSTEM_INCREF(); -extern void SYSTEM_REGCMD(); -extern void SYSTEM_REGTYP(); -extern void SYSTEM_REGFIN(); -extern void SYSTEM_FINALL(); -extern void SYSTEM_INIT(); -extern void SYSTEM_FINI(); -extern void SYSTEM_HALT(); -extern void SYSTEM_INHERIT(); -extern void SYSTEM_ENUMP(); -extern void SYSTEM_ENUMR(); - -/* module registry */ -#define __DEFMOD static void *m; if(m!=0)return m -#define __REGMOD(name, enum) if(m==0)m=SYSTEM_REGMOD((CHAR*)name,enum); else return m -#define __ENDMOD return m -#define __INIT(argc, argv) static void *m; SYSTEM_INIT(argc, (long)&argv); -#define __REGMAIN(name, enum) m=SYSTEM_REGMOD(name,enum) -#define __FINI SYSTEM_FINI(); return 0 -#define __IMPORT(name) SYSTEM_INCREF(name##__init()) -#define __REGCMD(name, cmd) SYSTEM_REGCMD(m, name, cmd) - -/* SYSTEM ops */ -#define __SYSNEW(p, len) p=SYSTEM_NEWBLK((long)(len)) -#define __VAL(t, x) (*(t*)&(x)) -#define __GET(a, x, t) x= *(t*)(a) -#define __PUT(a, x, t) *(t*)(a)=x -#define __LSHL(x, n, t) ((t)((unsigned t)(x)<<(n))) -#define __LSHR(x, n, t) ((t)((unsigned t)(x)>>(n))) -#define __LSH(x, n, t) ((n)>=0? __LSHL(x, n, t): __LSHR(x, -(n), t)) -#define __ROTL(x, n, t) ((t)((unsigned t)(x)<<(n)|(unsigned t)(x)>>(8*sizeof(t)-(n)))) -#define __ROTR(x, n, t) ((t)((unsigned t)(x)>>(n)|(unsigned t)(x)<<(8*sizeof(t)-(n)))) -#define __LSHR(x, n, t) ((t)((unsigned t)(x)>>(n))) -#define __LSH(x, n, t) ((n)>=0? __LSHL(x, n, t): __LSHR(x, -(n), t)) -#define __ROTL(x, n, t) ((t)((unsigned t)(x)<<(n)|(unsigned t)(x)>>(8*sizeof(t)-(n)))) -#define __ROTR(x, n, t) ((t)((unsigned t)(x)>>(n)|(unsigned t)(x)<<(8*sizeof(t)-(n)))) -#define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) -#define __BIT(x, n) (*(unsigned long*)(x)>>(n)&1) -#define __MOVE(s, d, n) memcpy((char*)(d),(char*)(s),n) - -/* std procs and operator mappings */ -#define __SHORT(x, y) ((int)((unsigned long)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) -#define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) -#define __CHR(x) ((CHAR)__R(x, 256)) -#define __CHRF(x) ((CHAR)__RF(x, 256)) -#define __DIV(x, y) ((x)>=0?(x)/(y):-(((y)-1-(x))/(y))) -#define __DIVF(x, y) SYSTEM_DIV((long)(x),(long)(y)) -#define __MOD(x, y) ((x)>=0?(x)%(y):__MODF(x,y)) -#define __MODF(x, y) SYSTEM_MOD((long)(x),(long)(y)) -#define __NEW(p, t) p=SYSTEM_NEWREC((long)t##__typ) -#define __NEWARR SYSTEM_NEWARR -#define __HALT(x) SYSTEM_HALT(x) -#define __ASSERT(cond, x) if (!(cond)) {SYSTEM_assert = x; SYSTEM_HALT(-1);} -#define __ENTIER(x) SYSTEM_ENTIER(x) -#define __ABS(x) (((x)<0)?-(x):(x)) -#define __ABSF(x) SYSTEM_ABS((long)(x)) -#define __ABSFD(x) SYSTEM_ABSD((double)(x)) -#define __CAP(ch) ((CHAR)((ch)&0x5f)) -#define __ODD(x) ((x)&1) -#define __IN(x, s) (((s)>>(x))&1) -#define __SETOF(x) ((SET)1<<(x)) -#define __SETRNG(l, h) ((~(SET)0<<(l))&~(SET)0>>(8*sizeof(SET)-1-(h))) -#define __MASK(x, m) ((x)&~(m)) -#define __COPY(s, d, n) {char*_a=(void*)s,*_b=(void*)d;long _i=0,_t=n-1;while(_i<_t&&((_b[_i]=_a[_i])!=0)){_i++;};_b[_i]=0;} -static int __STRCMP(x, y) - CHAR *x, *y; -{long i = 0; CHAR ch1, ch2; - do {ch1 = x[i]; ch2 = y[i]; i++; - if (!ch1) return -(int)ch2; - } while (ch1==ch2); - return (int)ch1 - (int)ch2; -} -#define __ASH(x, n) ((n)>=0?__ASHL(x,n):__ASHR(x,-(n))) -#define __ASHL(x, n) ((long)(x)<<(n)) -#define __ASHR(x, n) ((long)(x)>>(n)) -#define __ASHF(x, n) SYSTEM_ASH((long)(x), (long)(n)) -#define __DUP(x, l, t) x=(void*)memcpy(alloca(l*sizeof(t)),x,l*sizeof(t)) -#define __DUPARR(v, t) v=(void*)memcpy(v##__copy,v,sizeof(t)) -#define __DEL(x) /* DUP with alloca frees storage automatically */ -#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(long)typ##__typ) -#define __TYPEOF(p) (*(((long**)(p))-1)) -#define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) - -/* runtime checks */ -#define __X(i, ub) (((unsigned)(long)(i)<(unsigned long)(ub))?i:(__HALT(-2),0)) -#define __XF(i, ub) SYSTEM_XCHK((long)(i), (long)(ub)) -#define __RETCHK __retchk: __HALT(-3) -#define __CASECHK __HALT(-4) -#define __GUARDP(p, typ, level) ((typ*)(__ISP(p,typ,level)?p:(__HALT(-5),p))) -#define __GUARDR(r, typ, level) (*((typ*)(__IS(r##__typ,typ,level)?r:(__HALT(-5),r)))) -#define __GUARDA(p, typ, level) ((struct typ*)(__IS(__TYPEOF(p),typ,level)?p:(__HALT(-5),p))) -#define __GUARDEQR(p, dyntyp, typ) if(dyntyp!=typ##__typ) __HALT(-6);*(p) -#define __GUARDEQP(p, typ) if(__TYPEOF(p)!=typ##__typ)__HALT(-6);*(p) -#define __WITHCHK __HALT(-7) -#define __R(i, ub) (((unsigned)(long)(i)<(unsigned long)(ub))?i:(__HALT(-8),0)) -#define __RF(i, ub) SYSTEM_RCHK((long)(i),(long)(ub)) - -/* record type descriptors */ -#define __TDESC(t, m, n) \ - static struct t##__desc {\ - long tproc[m]; \ - long tag, next, level, module; \ - char name[24]; \ - long *base[__MAXEXT]; \ - char *rsrvd; \ - long blksz, ptr[n+1]; \ - } t##__desc - -#define __BASEOFF (__MAXEXT+1) -#define __TPROC0OFF (__BASEOFF+24/sizeof(long)+5) -#define __EOM 1 -#define __TDFLDS(name, size) {__EOM}, 1, 0, 0, 0, name, {0}, 0, size -#define __ENUMP(adr, n, P) SYSTEM_ENUMP(adr, (long)(n), P) -#define __ENUMR(adr, typ, size, n, P) SYSTEM_ENUMR(adr, typ, (long)(size), (long)(n), P) - -#define __INITYP(t, t0, level) \ - t##__typ= &t##__desc.blksz; \ - memcpy(t##__desc.base, t0##__typ - __BASEOFF, level*sizeof(long)); \ - t##__desc.base[level]=t##__typ; \ - t##__desc.module=(long)m; \ - if(t##__desc.blksz!=sizeof(struct t)) __HALT(-15); \ - t##__desc.blksz=(t##__desc.blksz+5*sizeof(long)-1)/(4*sizeof(long))*(4*sizeof(long)); \ - SYSTEM_REGTYP(m, (long)&t##__desc.next); \ - SYSTEM_INHERIT(t##__typ, t0##__typ) - -/* Oberon-2 type bound procedures support */ -#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(long)proc -#define __SEND(typ, num, funtyp, parlist) ((funtyp)(*(typ-(__TPROC0OFF+num))))parlist - -/* runtime system variables */ -extern LONGINT SYSTEM_argc; -extern LONGINT SYSTEM_argv; -extern void (*SYSTEM_Halt)(); -extern LONGINT SYSTEM_halt; -extern LONGINT SYSTEM_assert; -extern SYSTEM_PTR SYSTEM_modules; -extern LONGINT SYSTEM_heapsize; -extern LONGINT SYSTEM_allocated; -extern LONGINT SYSTEM_lock; -extern SHORTINT SYSTEM_gclock; -extern BOOLEAN SYSTEM_interrupted; - -/* ANSI prototypes; not used so far -static int __STRCMP(CHAR *x, CHAR *y); -void SYSTEM_INIT(int argc, long argvadr); -void SYSTEM_FINI(void); -long SYSTEM_XCHK(long i, long ub); -long SYSTEM_RCHK(long i, long ub); -long SYSTEM_ASH(long i, long n); -long SYSTEM_ABS(long i); -double SYSTEM_ABSD(double i); -void SYSTEM_INHERIT(long *t, long *t0); -void SYSTEM_ENUMP(long *adr, long n, void (*P)(void*)); -void SYSTEM_ENUMR(char *adr, long *typ, long size, long n, void (*P)(void*)); -long SYSTEM_DIV(unsigned long x, unsigned long y); -long SYSTEM_MOD(unsigned long x, unsigned long y); -long SYSTEM_ENTIER(double x); -void SYSTEM_HALT(int n); -*/ - -#endif - diff --git a/src/system/openbsd/gcc/Console.Mod b/src/system/openbsd/gcc/Console.Mod deleted file mode 100644 index e523ef7b..00000000 --- a/src/system/openbsd/gcc/Console.Mod +++ /dev/null @@ -1,86 +0,0 @@ -MODULE Console; (* J. Templ, 29-June-96 *) - - (* output to Unix standard output device based Write system call *) - - IMPORT SYSTEM; - - VAR line: ARRAY 128 OF CHAR; - pos: INTEGER; - - PROCEDURE -Write(adr, n: LONGINT) - "write(1/*stdout*/, adr, n)"; - - PROCEDURE -read(VAR ch: CHAR): LONGINT - "read(0/*stdin*/, ch, 1)"; - - PROCEDURE Flush*(); - BEGIN - Write(SYSTEM.ADR(line), pos); pos := 0; - END Flush; - - PROCEDURE Char*(ch: CHAR); - BEGIN - IF pos = LEN(line) THEN Flush() END ; - line[pos] := ch; INC(pos); - IF ch = 0AX THEN Flush() END - END Char; - - PROCEDURE String*(s: ARRAY OF CHAR); - VAR i: INTEGER; - BEGIN i := 0; - WHILE s[i] # 0X DO Char(s[i]); INC(i) END - END String; - - PROCEDURE Int*(i, n: LONGINT); - VAR s: ARRAY 32 OF CHAR; i1, k: LONGINT; - BEGIN - IF i = SYSTEM.LSH(LONG(LONG(1)), SIZE(LONGINT)*8 - 1) THEN - IF SIZE(LONGINT) = 8 THEN s := "8085774586302733229"; k := 19 - ELSE s := "8463847412"; k := 10 - END - ELSE - i1 := ABS(i); - s[0] := CHR(i1 MOD 10 + ORD("0")); i1 := i1 DIV 10; k := 1; - WHILE i1 > 0 DO s[k] := CHR(i1 MOD 10 + ORD("0")); i1 := i1 DIV 10; INC(k) END - END ; - IF i < 0 THEN s[k] := "-"; INC(k) END ; - WHILE n > k DO Char(" "); DEC(n) END ; - WHILE k > 0 DO DEC(k); Char(s[k]) END - END Int; - - PROCEDURE Ln*; - BEGIN Char(0AX); (* Unix end-of-line *) - END Ln; - - PROCEDURE Bool*(b: BOOLEAN); - BEGIN IF b THEN String("TRUE") ELSE String("FALSE") END - END Bool; - - PROCEDURE Hex*(i: LONGINT); - VAR k, n: LONGINT; - BEGIN - k := -28; - WHILE k <= 0 DO - n := ASH(i, k) MOD 16; - IF n <= 9 THEN Char(CHR(ORD("0") + n)) ELSE Char(CHR(ORD("A") - 10 + n)) END ; - INC(k, 4) - END - END Hex; - - PROCEDURE Read*(VAR ch: CHAR); - VAR n: LONGINT; - BEGIN Flush(); - n := read(ch); - IF n # 1 THEN ch := 0X END - END Read; - - PROCEDURE ReadLine*(VAR line: ARRAY OF CHAR); - VAR i: LONGINT; ch: CHAR; - BEGIN Flush(); - i := 0; Read(ch); - WHILE (i < LEN(line) - 1) & (ch # 0AX) & (ch # 0X) DO line[i] := ch; INC(i); Read(ch) END ; - line[i] := 0X - END ReadLine; - -BEGIN pos := 0; -END Console. diff --git a/src/system/openbsd/gcc/Kernel.Mod b/src/system/openbsd/gcc/Kernel.Mod deleted file mode 100644 index 73cc80f3..00000000 --- a/src/system/openbsd/gcc/Kernel.Mod +++ /dev/null @@ -1,206 +0,0 @@ -MODULE Kernel; -(* - J. Templ, 16.4.95 - communication with C-runtime and storage management -*) - - IMPORT SYSTEM, Unix, Args; - - TYPE -(* from time.h on OpenBSD; added yday; changed gmtoff, zone order; - sec to isdst changed to INTEGER; -- antranigv - struct tm { - int tm_sec; - int tm_min; - int tm_hour; - int tm_mday; - int tm_mon; - int tm_year; - int tm_wday; - int tm_yday; - int tm_isdst; - long tm_gmtoff; - char *tm_zone; -}; *) - - RealTime = POINTER TO TimeDesc; - TimeDesc = RECORD - sec, min, hour, mday, mon, year, wday, yday, isdst : INTEGER; - gmtoff, zone : LONGINT -(* sec, min, hour, mday, mon, year, wday, isdst, zone, gmtoff: INTEGER*) - END ; - - KeyCmd* = PROCEDURE; - - ObjFinalizer* = PROCEDURE(obj: SYSTEM.PTR); - - - VAR - (* trap handling *) - trapEnv*: Unix.JmpBuf; (* saved stack environment for trap handling *) - - (* oberon heap management *) - nofiles*: LONGINT; - - (* input event handling *) - readSet*, readySet*: Unix.FdSet; - - FKey*: ARRAY 16 OF KeyCmd; - - littleEndian*: BOOLEAN; - - TimeUnit*: LONGINT; (* 1 sec *) - - LIB*, CWD*: ARRAY 256 OF CHAR; - OBERON*: ARRAY 1024 OF CHAR; - - - timeStart: LONGINT; (* milliseconds *) - - PROCEDURE -includesetjmp() - '#include "setjmp.h"'; -(* for localtime *) - PROCEDURE -includetime() - '#include "time.h"'; - - PROCEDURE -Lock*() - "SYSTEM_lock++"; - - PROCEDURE -Unlock*() - "SYSTEM_lock--; if (SYSTEM_interrupted && SYSTEM_lock == 0) __HALT(-9)"; - - PROCEDURE -Exit*(n: LONGINT) - "exit(n)"; - - PROCEDURE -sigsetjmp*(VAR env: Unix.JmpBuf; savemask: LONGINT): LONGINT - "__sigsetjmp(env, savemask)"; - - PROCEDURE -siglongjmp*(VAR env:Unix.JmpBuf; val: LONGINT) - "siglongjmp(env, val)"; - - PROCEDURE -heapsize*(): LONGINT - "SYSTEM_heapsize"; - - PROCEDURE -allocated*(): LONGINT - "SYSTEM_allocated"; - - PROCEDURE -localtime(VAR clock: LONGINT): RealTime - "(Kernel_RealTime)localtime(clock)"; - - PROCEDURE -malloc*(size: LONGINT): LONGINT - "(LONGINT)malloc(size)"; - - PROCEDURE -free*(adr: LONGINT) - "(void)free(adr)"; - - PROCEDURE -getcwd(VAR cwd: Unix.Name) - "getcwd(cwd, cwd__len)"; - - - PROCEDURE GetClock* (VAR t, d: LONGINT); - VAR tv: Unix.Timeval; tz: Unix.Timezone; time: RealTime; - l : INTEGER; - BEGIN - l := Unix.Gettimeofday(tv, tz); - time := localtime(tv.sec); - t := time.sec + ASH(time.min, 6) + ASH(time.hour, 12); - d := time.mday + ASH(time.mon+1, 5) + ASH(time.year MOD 100, 9); - END GetClock; - - PROCEDURE SetClock* (t, d: LONGINT); - VAR err: ARRAY 25 OF CHAR; - BEGIN err := "not yet implemented"; HALT(99) - END SetClock; - - PROCEDURE Time*(): LONGINT; - VAR timeval: Unix.Timeval; timezone: Unix.Timezone; - l : LONGINT; - BEGIN - l := Unix.Gettimeofday(timeval, timezone); - RETURN (timeval.usec DIV 1000 + timeval.sec * 1000 - timeStart) MOD 7FFFFFFFH - END Time; - -(* - PROCEDURE UserTime*(): LONGINT; - VAR rusage: Unix.Rusage; - BEGIN - Unix.Getrusage(0, S.ADR(rusage)); - RETURN rusage.utime.sec*1000 + rusage.utime.usec DIV 1000 - (* + rusage.stime.sec*1000 + rusage.stime.usec DIV 1000*) - END UserTime; -*) - - PROCEDURE Select*(delay: LONGINT); - VAR rs, ws, xs: Unix.FdSet; n: LONGINT; tv: Unix.Timeval; - BEGIN - rs := readSet; - FOR n := 0 TO 7 DO ws[n] := {}; xs[n] := {}; readySet[n] := {} END; - IF delay < 0 THEN delay := 0 END ; - tv.sec := delay DIV 1000; tv.usec := delay MOD 1000 * 1000; - n := Unix.Select(256, rs, ws, xs, tv); - IF n >= 0 THEN readySet := rs END - END Select; - - PROCEDURE -GC*(markStack: BOOLEAN) - "SYSTEM_GC(markStack)"; - - PROCEDURE -RegisterObject*(obj: SYSTEM.PTR; finalize: ObjFinalizer) - "SYSTEM_REGFIN(obj, finalize)"; - - PROCEDURE -SetHalt*(p: PROCEDURE(n: LONGINT)) - "SYSTEM_Halt = p"; - - PROCEDURE InstallTermHandler*(p: PROCEDURE); - (* not yet supported; no Modules.Free *) - END InstallTermHandler; - - PROCEDURE LargestAvailable*(): LONGINT; - BEGIN - (* dummy proc for System 3 compatibility - no meaningful value except may be the remaining swap space can be returned - in the context of an extensible heap *) - RETURN MAX(LONGINT) - END LargestAvailable; - - PROCEDURE Halt(n: LONGINT); - VAR res: LONGINT; - BEGIN res := Unix.Kill(Unix.Getpid(), 4); - END Halt; - - PROCEDURE EndianTest; - VAR i: LONGINT; dmy: INTEGER; - BEGIN - dmy := 1; i := SYSTEM.ADR(dmy); - SYSTEM.GET(i, littleEndian); (* indirection via i avoids warning on SUN cc -O *) - END EndianTest; - - PROCEDURE -SizeofUnixJmpBuf(): INTEGER - "sizeof(Unix_JmpBuf)"; - - PROCEDURE -SizeofSigJmpBuf(): INTEGER - "sizeof(sigjmp_buf)"; - - PROCEDURE -Error(msg: ARRAY OF CHAR; len: INTEGER) - "write(1/*stdout*/, msg, len); char ch = 0xa; write(1, &ch, 1)"; - - PROCEDURE JmpBufCheck; (* check for inconsistent usage of sigjmp_buf *) - VAR x, y: LONGINT; - BEGIN - x := SizeofUnixJmpBuf(); - y := SizeofSigJmpBuf(); - IF x < y THEN - Error("Kernel.JmpBufCheck: inconsistent usage of sigjmp_buf", 52); - Exit(1); - END - END JmpBufCheck; - -BEGIN - EndianTest(); - SetHalt(Halt); - CWD := ""; OBERON := "."; LIB := ""; - getcwd(CWD); - Args.GetEnv("OBERON", OBERON); - Args.GetEnv("OBERON_LIB", LIB); - TimeUnit := 1000; timeStart := 0; timeStart := Time(); - JmpBufCheck() -END Kernel. diff --git a/src/system/openbsd/gcc/Kernel0.Mod b/src/system/openbsd/gcc/Kernel0.Mod deleted file mode 100644 index dd44b415..00000000 --- a/src/system/openbsd/gcc/Kernel0.Mod +++ /dev/null @@ -1,217 +0,0 @@ -MODULE Kernel0; -(* - J. Templ, 16.4.95 - communication with C-runtime and storage management -*) -(* version for bootstrapping voc *) - - IMPORT SYSTEM, Unix, Args, Strings, version; - - TYPE -(* from time.h on OpenBSD; added yday; changed gmtoff, zone order; - sec to isdst changed to INTEGER; -- antranigv - struct tm { - int tm_sec; - int tm_min; - int tm_hour; - int tm_mday; - int tm_mon; - int tm_year; - int tm_wday; - int tm_yday; - int tm_isdst; - long tm_gmtoff; - char *tm_zone; -}; *) - - RealTime = POINTER TO TimeDesc; - TimeDesc = RECORD - sec, min, hour, mday, mon, year, wday, yday, isdst : INTEGER; - gmtoff, zone : LONGINT -(* sec, min, hour, mday, mon, year, wday, isdst, zone, gmtoff: INTEGER*) - END ; - - KeyCmd* = PROCEDURE; - - ObjFinalizer* = PROCEDURE(obj: SYSTEM.PTR); - - - VAR - (* trap handling *) - trapEnv*: Unix.JmpBuf; (* saved stack environment for trap handling *) - - (* oberon heap management *) - nofiles*: LONGINT; - - (* input event handling *) - readSet*, readySet*: Unix.FdSet; - - FKey*: ARRAY 16 OF KeyCmd; - - littleEndian*: BOOLEAN; - - TimeUnit*: LONGINT; (* 1 sec *) - - LIB*, CWD*: ARRAY 256 OF CHAR; - OBERON*: ARRAY 1024 OF CHAR; - MODULES-: ARRAY 1024 OF CHAR; - - prefix*, fullprefix* : ARRAY 256 OF CHAR; - timeStart: LONGINT; (* milliseconds *) - - - PROCEDURE -includesetjmp() - '#include "setjmp.h"'; -(* for localtime *) - PROCEDURE -includetime() - '#include "time.h"'; - - PROCEDURE -Lock*() - "SYSTEM_lock++"; - - PROCEDURE -Unlock*() - "SYSTEM_lock--; if (SYSTEM_interrupted && SYSTEM_lock == 0) __HALT(-9)"; - - PROCEDURE -Exit*(n: LONGINT) - "exit(n)"; - - PROCEDURE -sigsetjmp*(VAR env: Unix.JmpBuf; savemask: LONGINT): LONGINT - "__sigsetjmp(env, savemask)"; - - PROCEDURE -siglongjmp*(VAR env:Unix.JmpBuf; val: LONGINT) - "siglongjmp(env, val)"; - - PROCEDURE -heapsize*(): LONGINT - "SYSTEM_heapsize"; - - PROCEDURE -allocated*(): LONGINT - "SYSTEM_allocated"; - - PROCEDURE -localtime(VAR clock: LONGINT): RealTime - "(Kernel0_RealTime)localtime(clock)"; - - PROCEDURE -malloc*(size: LONGINT): LONGINT - "(LONGINT)malloc(size)"; - - PROCEDURE -free*(adr: LONGINT) - "(void)free(adr)"; - - PROCEDURE -getcwd(VAR cwd: Unix.Name) - "getcwd(cwd, cwd__len)"; - - - PROCEDURE GetClock* (VAR t, d: LONGINT); - VAR tv: Unix.Timeval; tz: Unix.Timezone; time: RealTime; - l : INTEGER; - BEGIN - l := Unix.Gettimeofday(tv, tz); - time := localtime(tv.sec); - t := time.sec + ASH(time.min, 6) + ASH(time.hour, 12); - d := time.mday + ASH(time.mon+1, 5) + ASH(time.year MOD 100, 9); - END GetClock; - - PROCEDURE SetClock* (t, d: LONGINT); - VAR err: ARRAY 25 OF CHAR; - BEGIN err := "not yet implemented"; HALT(99) - END SetClock; - - PROCEDURE Time*(): LONGINT; - VAR timeval: Unix.Timeval; timezone: Unix.Timezone; - l : LONGINT; - BEGIN - l := Unix.Gettimeofday(timeval, timezone); - RETURN (timeval.usec DIV 1000 + timeval.sec * 1000 - timeStart) MOD 7FFFFFFFH - END Time; - -(* - PROCEDURE UserTime*(): LONGINT; - VAR rusage: Unix.Rusage; - BEGIN - Unix.Getrusage(0, S.ADR(rusage)); - RETURN rusage.utime.sec*1000 + rusage.utime.usec DIV 1000 - (* + rusage.stime.sec*1000 + rusage.stime.usec DIV 1000*) - END UserTime; -*) - - PROCEDURE Select*(delay: LONGINT); - VAR rs, ws, xs: Unix.FdSet; n: LONGINT; tv: Unix.Timeval; - BEGIN - rs := readSet; - FOR n := 0 TO 7 DO ws[n] := {}; xs[n] := {}; readySet[n] := {} END; - IF delay < 0 THEN delay := 0 END ; - tv.sec := delay DIV 1000; tv.usec := delay MOD 1000 * 1000; - n := Unix.Select(256, rs, ws, xs, tv); - IF n >= 0 THEN readySet := rs END - END Select; - - PROCEDURE -GC*(markStack: BOOLEAN) - "SYSTEM_GC(markStack)"; - - PROCEDURE -RegisterObject*(obj: SYSTEM.PTR; finalize: ObjFinalizer) - "SYSTEM_REGFIN(obj, finalize)"; - - PROCEDURE -SetHalt*(p: PROCEDURE(n: LONGINT)) - "SYSTEM_Halt = p"; - - PROCEDURE InstallTermHandler*(p: PROCEDURE); - (* not yet supported; no Modules.Free *) - END InstallTermHandler; - - PROCEDURE LargestAvailable*(): LONGINT; - BEGIN - (* dummy proc for System 3 compatibility - no meaningful value except may be the remaining swap space can be returned - in the context of an extensible heap *) - RETURN MAX(LONGINT) - END LargestAvailable; - - PROCEDURE Halt(n: LONGINT); - VAR res: LONGINT; - BEGIN res := Unix.Kill(Unix.Getpid(), 4); - END Halt; - - PROCEDURE EndianTest; - VAR i: LONGINT; dmy: INTEGER; - BEGIN - dmy := 1; i := SYSTEM.ADR(dmy); - SYSTEM.GET(i, littleEndian); (* indirection via i avoids warning on SUN cc -O *) - END EndianTest; - - PROCEDURE -SizeofUnixJmpBuf(): INTEGER - "sizeof(Unix_JmpBuf)"; - - PROCEDURE -SizeofSigJmpBuf(): INTEGER - "sizeof(sigjmp_buf)"; - - PROCEDURE -Error(msg: ARRAY OF CHAR; len: INTEGER) - "write(1/*stdout*/, msg, len); char ch = 0xa; write(1, &ch, 1)"; - - PROCEDURE JmpBufCheck; (* check for inconsistent usage of sigjmp_buf *) - VAR x, y: LONGINT; - BEGIN - x := SizeofUnixJmpBuf(); - y := SizeofSigJmpBuf(); - IF x < y THEN - Error("Kernel.JmpBufCheck: inconsistent usage of sigjmp_buf", 52); - Exit(1); - END - END JmpBufCheck; - -BEGIN - EndianTest(); - SetHalt(Halt); - CWD := ""; OBERON := "."; LIB := ""; - MODULES := ""; (* additional modules path which can be specified on commandline and will be added to the OBERON variable; noch *) - getcwd(CWD); - Args.GetEnv ("MODULES", MODULES); - Args.GetEnv("OBERON", OBERON); - (* always have current directory in module search path, noch *) - Strings.Append(":.:", OBERON); - Strings.Append(MODULES, OBERON); - Strings.Append(":", OBERON); - Strings.Append(version.prefix, OBERON); - Strings.Append("/lib/voc/sym:", OBERON); - Args.GetEnv("OBERON_LIB", LIB); - TimeUnit := 1000; timeStart := 0; timeStart := Time(); - JmpBufCheck() -END Kernel0. diff --git a/src/system/openbsd/gcc/SYSTEM.Mod b/src/system/openbsd/gcc/SYSTEM.Mod deleted file mode 100644 index 6fc08dcf..00000000 --- a/src/system/openbsd/gcc/SYSTEM.Mod +++ /dev/null @@ -1,520 +0,0 @@ -(* -* voc (jet backend) runtime system, Version 1.1 -* -* Copyright (c) Software Templ, 1994, 1995, 1996 -* -* Module SYSTEM is subject to change any time without prior notification. -* Software Templ disclaims all warranties with regard to module SYSTEM, -* in particular shall Software Templ not be liable for any damage resulting -* from inappropriate use or modification of module SYSTEM. -*) - -MODULE SYSTEM; (* J. Templ, 31.5.95 *) - - IMPORT SYSTEM; (*must not import other modules*) - - CONST - ModNameLen = 20; - CmdNameLen = 24; - SZL = SIZE(LONGINT); - Unit = 4*SZL; (* smallest possible heap block *) - nofLists = 9; (* number of free_lists *) - heapSize0 = 8000*Unit; (* startup heap size *) - - (* all blocks look the same: - free blocks describe themselves: size = Unit - tag = &tag++ - ->blksize - sentinel = -SZL - next - *) - - (* heap chunks *) - nextChnkOff = 0; (* next heap chunk, sorted ascendingly! *) - endOff = SZL; (* end of heap chunk *) - blkOff = 3*SZL; (* first block in a chunk *) - - (* heap blocks *) - tagOff = 0; (* block starts with tag *) - sizeOff = SZL; (* block size in free block relative to block start *) - sntlOff = 2*SZL; (* pointer offset table sentinel in free block relative to block start *) - nextOff = 3*SZL; (* next pointer in free block relative to block start *) - NoPtrSntl = LONG(LONG(-SZL)); - - - TYPE - ModuleName = ARRAY ModNameLen OF CHAR; - CmdName = ARRAY CmdNameLen OF CHAR; - - Module = POINTER TO ModuleDesc; - Cmd = POINTER TO CmdDesc; - EnumProc = PROCEDURE(P: PROCEDURE(p: SYSTEM.PTR)); - ModuleDesc = RECORD - next: Module; - name: ModuleName; - refcnt: LONGINT; - cmds: Cmd; - types: LONGINT; - enumPtrs: EnumProc; - reserved1, reserved2: LONGINT - END ; - - Command = PROCEDURE; - - CmdDesc = RECORD - next: Cmd; - name: CmdName; - cmd: Command - END ; - - Finalizer = PROCEDURE(obj: SYSTEM.PTR); - - FinNode = POINTER TO FinDesc; - FinDesc = RECORD - next: FinNode; - obj: LONGINT; (* weak pointer *) - marked: BOOLEAN; - finalize: Finalizer; - END ; - - VAR - (* the list of loaded (=initialization started) modules *) - modules*: SYSTEM.PTR; - - freeList: ARRAY nofLists + 1 OF LONGINT; (* dummy, 16, 32, 48, 64, 80, 96, 112, 128, sentinel *) - bigBlocks, allocated*: LONGINT; - firstTry: BOOLEAN; - - (* extensible heap *) - heap, (* the sorted list of heap chunks *) - heapend, (* max possible pointer value (used for stack collection) *) - heapsize*: LONGINT; (* the sum of all heap chunk sizes *) - - (* finalization candidates *) - fin: FinNode; - - (* garbage collector locking *) - gclock*: SHORTINT; - - - PROCEDURE -malloc(size: LONGINT): LONGINT "(LONGINT)malloc(size)"; - PROCEDURE -Lock() "Lock"; - PROCEDURE -Unlock() "Unlock"; - PROCEDURE -Mainfrm(): LONGINT "SYSTEM_mainfrm"; -(* - PROCEDURE TAS*(VAR flag:BOOLEAN): BOOLEAN; (* added for compatibility with ulmSYSTEM module; noch *) - VAR oldflag : BOOLEAN; - BEGIN - oldflag := flag; - flag := TRUE; - RETURN oldflag; - END TAS; -*) - PROCEDURE REGMOD*(VAR name: ModuleName; enumPtrs: EnumProc): SYSTEM.PTR; - VAR m: Module; - BEGIN - IF name = "SYSTEM" THEN (* cannot use NEW *) - SYSTEM.NEW(m, SIZE(ModuleDesc)); m.cmds := NIL - ELSE NEW(m) - END ; - COPY(name, m.name); m.refcnt := 0; m.enumPtrs := enumPtrs; m.next := SYSTEM.VAL(Module, modules); - modules := m; - RETURN m - END REGMOD; - - PROCEDURE REGCMD*(m: Module; VAR name: CmdName; cmd: Command); - VAR c: Cmd; - BEGIN NEW(c); - COPY(name, c.name); c.cmd := cmd; c.next := m.cmds; m.cmds := c - END REGCMD; - - PROCEDURE REGTYP*(m: Module; typ: LONGINT); - BEGIN SYSTEM.PUT(typ, m.types); m.types := typ - END REGTYP; - - PROCEDURE INCREF*(m: Module); - BEGIN INC(m.refcnt) - END INCREF; - - PROCEDURE NewChunk(blksz: LONGINT): LONGINT; - VAR chnk: LONGINT; - BEGIN - chnk := malloc(blksz + blkOff); - IF chnk # 0 THEN - SYSTEM.PUT(chnk + endOff, chnk + (blkOff + blksz)); - SYSTEM.PUT(chnk + blkOff, chnk + (blkOff + sizeOff)); - SYSTEM.PUT(chnk + (blkOff + sizeOff), blksz); - SYSTEM.PUT(chnk + (blkOff + sntlOff), NoPtrSntl); - SYSTEM.PUT(chnk + (blkOff + nextOff), bigBlocks); - bigBlocks := chnk + blkOff; - INC(heapsize, blksz) - END ; - RETURN chnk - END NewChunk; - - PROCEDURE ExtendHeap(blksz: LONGINT); - VAR size, chnk, j, next: LONGINT; - BEGIN - IF blksz > 10000*Unit THEN size := blksz - ELSE size := 10000*Unit (* additional heuristics *) - END ; - chnk := NewChunk(size); - IF chnk # 0 THEN - (*sorted insertion*) - IF chnk < heap THEN - SYSTEM.PUT(chnk, heap); heap := chnk - ELSE - j := heap; SYSTEM.GET(j, next); - WHILE (next # 0) & (chnk > next) DO j := next; SYSTEM.GET(j, next) END ; - SYSTEM.PUT(chnk, next); SYSTEM.PUT(j, chnk) - END ; - IF next = 0 THEN SYSTEM.GET(chnk + endOff, heapend) END - END - END ExtendHeap; - - PROCEDURE ^GC*(markStack: BOOLEAN); - - PROCEDURE NEWREC*(tag: LONGINT): SYSTEM.PTR; - VAR i, i0, di, blksz, restsize, t, adr, end, next, prev: LONGINT; new: SYSTEM.PTR; - BEGIN - Lock(); - SYSTEM.GET(tag, blksz); - ASSERT(blksz MOD Unit = 0); - i0 := blksz DIV Unit; i := i0; - IF i < nofLists THEN adr := freeList[i]; - WHILE adr = 0 DO INC(i); adr := freeList[i] END - END ; - IF i < nofLists THEN (* unlink *) - SYSTEM.GET(adr + nextOff, next); - freeList[i] := next; - IF i # i0 THEN (* split *) - di := i - i0; restsize := di * Unit; end := adr + restsize; - SYSTEM.PUT(end + sizeOff, blksz); - SYSTEM.PUT(end + sntlOff, NoPtrSntl); - SYSTEM.PUT(end, end + sizeOff); - SYSTEM.PUT(adr + sizeOff, restsize); - SYSTEM.PUT(adr + nextOff, freeList[di]); - freeList[di] := adr; - INC(adr, restsize) - END - ELSE - adr := bigBlocks; prev := 0; - LOOP - IF adr = 0 THEN - IF firstTry THEN - GC(TRUE); INC(blksz, Unit); - IF (heapsize - allocated - blksz) * 4 < heapsize THEN - (* heap is still almost full; expand to avoid thrashing *) - ExtendHeap((allocated + blksz) DIV (3*Unit) * (4*Unit) - heapsize) - END ; - firstTry := FALSE; new := NEWREC(tag); firstTry := TRUE; - IF new = NIL THEN - (* depending on the fragmentation, the heap may not have been extended by - the anti-thrashing heuristics above *) - ExtendHeap((allocated + blksz) DIV (3*Unit) * (4*Unit) - heapsize); - new := NEWREC(tag); (* will find a free block if heap has been expanded properly *) - END ; - Unlock(); RETURN new - ELSE - Unlock(); RETURN NIL - END - END ; - SYSTEM.GET(adr+sizeOff, t); - IF t >= blksz THEN EXIT END ; - prev := adr; SYSTEM.GET(adr + nextOff, adr) - END ; - restsize := t - blksz; end := adr + restsize; - SYSTEM.PUT(end + sizeOff, blksz); - SYSTEM.PUT(end + sntlOff, NoPtrSntl); - SYSTEM.PUT(end, end + sizeOff); - IF restsize > nofLists * Unit THEN (*resize*) - SYSTEM.PUT(adr + sizeOff, restsize) - ELSE (*unlink*) - SYSTEM.GET(adr + nextOff, next); - IF prev = 0 THEN bigBlocks := next - ELSE SYSTEM.PUT(prev + nextOff, next); - END ; - IF restsize > 0 THEN (*move*) - di := restsize DIV Unit; - SYSTEM.PUT(adr + sizeOff, restsize); - SYSTEM.PUT(adr + nextOff, freeList[di]); - freeList[di] := adr - END - END ; - INC(adr, restsize) - END ; - i := adr + 4*SZL; end := adr + blksz; - WHILE i < end DO (*deliberately unrolled*) - SYSTEM.PUT(i, LONG(LONG(0))); - SYSTEM.PUT(i + SZL, LONG(LONG(0))); - SYSTEM.PUT(i + 2*SZL, LONG(LONG(0))); - SYSTEM.PUT(i + 3*SZL, LONG(LONG(0))); - INC(i, 4*SZL) - END ; - SYSTEM.PUT(adr + nextOff, LONG(LONG(0))); - SYSTEM.PUT(adr, tag); - SYSTEM.PUT(adr + sizeOff, LONG(LONG(0))); - SYSTEM.PUT(adr + sntlOff, LONG(LONG(0))); - INC(allocated, blksz); - Unlock(); - RETURN SYSTEM.VAL(SYSTEM.PTR, adr + SZL) - END NEWREC; - - PROCEDURE NEWBLK*(size: LONGINT): SYSTEM.PTR; - VAR blksz, tag: LONGINT; new: SYSTEM.PTR; - BEGIN - Lock(); - blksz := (size + (4*SZL + Unit - 1)) DIV Unit * Unit; (*size + tag + meta + blksz + sntnl + UnitAlignment*) - new := NEWREC(SYSTEM.ADR(blksz)); - tag := SYSTEM.VAL(LONGINT, new) + blksz - 3*SZL; - SYSTEM.PUT(tag - SZL, LONG(LONG(0))); (*reserved for meta info*) - SYSTEM.PUT(tag, blksz); - SYSTEM.PUT(tag + SZL, NoPtrSntl); - SYSTEM.PUT(SYSTEM.VAL(LONGINT, new) - SZL, tag); - Unlock(); - RETURN new - END NEWBLK; - - PROCEDURE Mark(q: LONGINT); - VAR p, tag, fld, n, offset, tagbits: LONGINT; - BEGIN - IF q # 0 THEN SYSTEM.GET(q - SZL, tagbits); - IF ~ODD(tagbits) THEN - SYSTEM.PUT(q - SZL, tagbits + 1); - p := 0; tag := tagbits + SZL; - LOOP - SYSTEM.GET(tag, offset); - IF offset < 0 THEN - SYSTEM.PUT(q - SZL, tag + offset + 1); - IF p = 0 THEN EXIT END ; - n := q; q := p; - SYSTEM.GET(q - SZL, tag); DEC(tag, 1); - SYSTEM.GET(tag, offset); fld := q + offset; - SYSTEM.GET(fld, p); SYSTEM.PUT(fld, n) - ELSE - fld := q + offset; - SYSTEM.GET(fld, n); - IF n # 0 THEN - SYSTEM.GET(n - SZL, tagbits); - IF ~ODD(tagbits) THEN - SYSTEM.PUT(n - SZL, tagbits + 1); - SYSTEM.PUT(q - SZL, tag + 1); - SYSTEM.PUT(fld, p); p := q; q := n; - tag := tagbits - END - END - END ; - INC(tag, SZL) - END - END - END - END Mark; - - PROCEDURE MarkP(p: SYSTEM.PTR); (* for compatibility with EnumPtrs in ANSI mode *) - BEGIN - Mark(SYSTEM.VAL(LONGINT, p)) - END MarkP; - - PROCEDURE Scan; - VAR chnk, adr, end, start, tag, i, size, freesize: LONGINT; - BEGIN bigBlocks := 0; i := 1; - WHILE i < nofLists DO freeList[i] := 0; INC(i) END ; - freesize := 0; allocated := 0; chnk := heap; - WHILE chnk # 0 DO - adr := chnk + blkOff; SYSTEM.GET(chnk + endOff, end); - WHILE adr < end DO - SYSTEM.GET(adr, tag); - IF ODD(tag) THEN (*marked*) - IF freesize > 0 THEN - start := adr - freesize; - SYSTEM.PUT(start, start+SZL); - SYSTEM.PUT(start+sizeOff, freesize); - SYSTEM.PUT(start+sntlOff, NoPtrSntl); - i := freesize DIV Unit; freesize := 0; - IF i < nofLists THEN SYSTEM.PUT(start + nextOff, freeList[i]); freeList[i] := start - ELSE SYSTEM.PUT(start + nextOff, bigBlocks); bigBlocks := start - END - END ; - DEC(tag, 1); - SYSTEM.PUT(adr, tag); - SYSTEM.GET(tag, size); - INC(allocated, size); - INC(adr, size) - ELSE (*unmarked*) - SYSTEM.GET(tag, size); - INC(freesize, size); - INC(adr, size) - END - END ; - IF freesize > 0 THEN (*collect last block*) - start := adr - freesize; - SYSTEM.PUT(start, start+SZL); - SYSTEM.PUT(start+sizeOff, freesize); - SYSTEM.PUT(start+sntlOff, NoPtrSntl); - i := freesize DIV Unit; freesize := 0; - IF i < nofLists THEN SYSTEM.PUT(start + nextOff, freeList[i]); freeList[i] := start - ELSE SYSTEM.PUT(start + nextOff, bigBlocks); bigBlocks := start - END - END ; - SYSTEM.GET(chnk, chnk) - END - END Scan; - - PROCEDURE Sift (l, r: LONGINT; VAR a: ARRAY OF LONGINT); - VAR i, j, x: LONGINT; - BEGIN j := l; x := a[j]; - LOOP i := j; j := 2*j + 1; - IF (j < r) & (a[j] < a[j+1]) THEN INC(j) END; - IF (j > r) OR (a[j] <= x) THEN EXIT END; - a[i] := a[j] - END; - a[i] := x - END Sift; - - PROCEDURE HeapSort (n: LONGINT; VAR a: ARRAY OF LONGINT); - VAR l, r, x: LONGINT; - BEGIN l := n DIV 2; r := n - 1; - WHILE l > 0 DO DEC(l); Sift(l, r, a) END; - WHILE r > 0 DO x := a[0]; a[0] := a[r]; a[r] := x; DEC(r); Sift(l, r, a) END - END HeapSort; - - PROCEDURE MarkCandidates(n: LONGINT; VAR cand: ARRAY OF LONGINT); - VAR chnk, adr, tag, next, lim, lim1, i, ptr, size: LONGINT; - BEGIN - chnk := heap; i := 0; lim := cand[n-1]; - WHILE (chnk # 0 ) & (chnk < lim) DO - adr := chnk + blkOff; - SYSTEM.GET(chnk + endOff, lim1); - IF lim < lim1 THEN lim1 := lim END ; - WHILE adr < lim1 DO - SYSTEM.GET(adr, tag); - IF ODD(tag) THEN (*already marked*) - SYSTEM.GET(tag-1, size); INC(adr, size) - ELSE - SYSTEM.GET(tag, size); - ptr := adr + SZL; - WHILE cand[i] < ptr DO INC(i) END ; - IF i = n THEN RETURN END ; - next := adr + size; - IF cand[i] < next THEN Mark(ptr) END ; - adr := next - END - END ; - SYSTEM.GET(chnk, chnk) - END - END MarkCandidates; - - PROCEDURE CheckFin; - VAR n: FinNode; tag: LONGINT; - BEGIN n := fin; - WHILE n # NIL DO - SYSTEM.GET(n.obj - SZL, tag); - IF ~ODD(tag) THEN n.marked := FALSE; Mark(n.obj) - ELSE n.marked := TRUE - END ; - n := n.next - END - END CheckFin; - - PROCEDURE Finalize; - VAR n, prev: FinNode; - BEGIN n := fin; prev := NIL; - WHILE n # NIL DO - IF ~n.marked THEN - IF n = fin THEN fin := fin.next ELSE prev.next := n.next END ; - n.finalize(SYSTEM.VAL(SYSTEM.PTR, n.obj)); - (* new nodes may have been pushed in n.finalize, therefore: *) - IF prev = NIL THEN n := fin ELSE n := n.next END - ELSE prev := n; n := n.next - END - END - END Finalize; - - PROCEDURE FINALL*; - VAR n: FinNode; - BEGIN - WHILE fin # NIL DO - n := fin; fin := fin.next; - n.finalize(SYSTEM.VAL(SYSTEM.PTR, n.obj)) - END - END FINALL; - - PROCEDURE MarkStack(n: LONGINT; VAR cand: ARRAY OF LONGINT); - VAR - frame: SYSTEM.PTR; - inc, nofcand: LONGINT; - sp, p, stack0, ptr: LONGINT; - align: RECORD ch: CHAR; p: SYSTEM.PTR END ; - BEGIN - IF n > 0 THEN MarkStack(n-1, cand); (* flush register windows by means of recursive calls *) - IF n > 100 THEN RETURN END (* prevent tail recursion optimization *) - END ; - IF n = 0 THEN - nofcand := 0; sp := SYSTEM.ADR(frame); - stack0 := Mainfrm(); - (* check for minimum alignment of pointers *) - inc := SYSTEM.ADR(align.p) - SYSTEM.ADR(align); - IF sp > stack0 THEN inc := -inc END ; - WHILE sp # stack0 DO - SYSTEM.GET(sp, p); - IF (p > heap) & (p < heapend) THEN - IF nofcand = LEN(cand) THEN HeapSort(nofcand, cand); MarkCandidates(nofcand, cand); nofcand := 0 END ; - cand[nofcand] := p; INC(nofcand) - END ; - INC(sp, inc) - END ; - IF nofcand > 0 THEN HeapSort(nofcand, cand); MarkCandidates(nofcand, cand) END - END - END MarkStack; - - PROCEDURE GC*(markStack: BOOLEAN); - VAR - m: Module; - i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23: LONGINT; - cand: ARRAY 10000 OF LONGINT; - BEGIN - IF (gclock = 0) OR (gclock = 1) & ~markStack THEN - Lock(); - m := SYSTEM.VAL(Module, modules); - WHILE m # NIL DO - IF m.enumPtrs # NIL THEN m.enumPtrs(MarkP) END ; - m := m^.next - END ; - IF markStack THEN - (* generate register pressure to force callee saved registers to memory; - may be simplified by inlining OS calls or processor specific instructions - *) - i0 := -100; i1 := -101; i2 := -102; i3 := -103; i4 := -104; i5 := -105; i6 := -106; i7 := -107; - i8 := 1; i9 := 2; i10 := 3; i11 := 4; i12 := 5; i13 := 6; i14 := 7; i15 := 8; - i16 := 9; i17 := 10; i18 := 11; i19 := 12; i20 := 13; i21 := 14; i22 := 15; i23 := 16; - LOOP INC(i0, 1); INC(i1, 2); INC(i2, 3); INC(i3, 4); INC(i4, 5); INC(i5, 6); INC(i6, 7); INC(i7, 8); - INC(i8, 9); INC(i9, 10); INC(i10, 11); INC(i11, 12); INC(i12, 13); INC(i13, 14); INC(i14, 15); INC(i15, 16); - INC(i16, 17); INC(i17, 18); INC(i18, 19); INC(i19, 20); INC(i20, 21); INC(i21, 22); INC(i22, 23); INC(i23, 24); - IF (i0 = -99) & (i15 = 24) THEN MarkStack(32, cand); EXIT END - END ; - IF i0 + i1 + i2 + i3 + i4 + i5 + i6 + i7 + i8 + i9 + i10 + i11 + i12 + i13 + i14 + i15 - + i16 + i17 + i18 + i19 + i20 + i21 + i22 + i23 > 10000 THEN RETURN (* use all variables *) - END ; - END; - CheckFin; - Scan; - Finalize; - Unlock() - END - END GC; - - PROCEDURE REGFIN*(obj: SYSTEM.PTR; finalize: Finalizer); - VAR f: FinNode; - BEGIN NEW(f); - f.obj := SYSTEM.VAL(LONGINT, obj); f.finalize := finalize; f.marked := TRUE; f.next := fin; fin := f - END REGFIN; - - PROCEDURE InitHeap; (* initialized before body to enable NEW, SYSTEM.NEW *) - BEGIN - heap := NewChunk(heapSize0); - SYSTEM.GET(heap + endOff, heapend); - SYSTEM.PUT(heap, LONG(LONG(0))); - allocated := 0; firstTry := TRUE; freeList[nofLists] := 1; gclock := 0 - END InitHeap; - -END SYSTEM. diff --git a/src/system/openbsd/gcc/x86_64/Args.Mod b/src/system/openbsd/gcc/x86_64/Args.Mod deleted file mode 100644 index 2c0d25b5..00000000 --- a/src/system/openbsd/gcc/x86_64/Args.Mod +++ /dev/null @@ -1,65 +0,0 @@ -MODULE Args; (* jt, 8.12.94 *) - - (* command line argument handling for voc (jet backend) *) - - - IMPORT SYSTEM; - - TYPE - ArgPtr = POINTER TO ARRAY 1024 OF CHAR; - ArgVec = POINTER TO ARRAY 1024 OF ArgPtr; - - VAR argc-: INTEGER; argv-: LONGINT; - (*PROCEDURE -includestdlib() "#include ";*) - PROCEDURE -externgetenv() "extern char *getenv(const char *name);"; (* took this from stdlib.h*) - PROCEDURE -Argc(): INTEGER "SYSTEM_argc"; - PROCEDURE -Argv(): LONGINT "(long)SYSTEM_argv"; - PROCEDURE -getenv(var: ARRAY OF CHAR): ArgPtr - "(Args_ArgPtr)getenv(var)"; - - PROCEDURE Get*(n: INTEGER; VAR val: ARRAY OF CHAR); - VAR av: ArgVec; - BEGIN - IF n < argc THEN av := SYSTEM.VAL(ArgVec, argv); COPY(av[n]^, val) END - END Get; - - PROCEDURE GetInt*(n: INTEGER; VAR val: LONGINT); - VAR s: ARRAY 64 OF CHAR; k, d, i: LONGINT; - BEGIN - s := ""; Get(n, s); i := 0; - IF s[0] = "-" THEN i := 1 END ; - k := 0; d := ORD(s[i]) - ORD("0"); - WHILE (d >= 0 ) & (d <= 9) DO k := k*10 + d; INC(i); d := ORD(s[i]) - ORD("0") END ; - IF s[0] = "-" THEN d := -d; DEC(i) END ; - IF i > 0 THEN val := k END - END GetInt; - - PROCEDURE Pos*(s: ARRAY OF CHAR): INTEGER; - VAR i: INTEGER; arg: ARRAY 256 OF CHAR; - BEGIN - i := 0; Get(i, arg); - WHILE (i < argc) & (s # arg) DO INC(i); Get(i, arg) END ; - RETURN i - END Pos; - - PROCEDURE GetEnv*(var: ARRAY OF CHAR; VAR val: ARRAY OF CHAR); - VAR p: ArgPtr; - BEGIN - p := getenv(var); - IF p # NIL THEN COPY(p^, val) END - END GetEnv; - - PROCEDURE getEnv*(var: ARRAY OF CHAR; VAR val: ARRAY OF CHAR): BOOLEAN; - VAR p: ArgPtr; - BEGIN - p := getenv(var); - IF p # NIL THEN - COPY(p^, val); - RETURN TRUE - ELSE - RETURN FALSE - END - END getEnv; - -BEGIN argc := Argc(); argv := Argv() -END Args. diff --git a/src/system/openbsd/gcc/x86_64/Files.Mod b/src/system/openbsd/gcc/x86_64/Files.Mod deleted file mode 100644 index 344cb213..00000000 --- a/src/system/openbsd/gcc/x86_64/Files.Mod +++ /dev/null @@ -1,681 +0,0 @@ -MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files *) -(* modified version of Files, which opens only the file provided and does not scan any path in any environment variable, also ReadLine procedure added; -- noch *) - IMPORT SYSTEM, Unix, Kernel, Args, Console; - - (* standard data type I/O - - little endian, - Sint:1, Int:2, Lint:4 - ORD({0}) = 1, - false = 0, true =1 - IEEE real format, - null terminated strings, - compact numbers according to M.Odersky *) - - - CONST - nofbufs = 4; - bufsize = 4096; - fileTabSize = 64; - noDesc = -1; - notDone = -1; - - (* file states *) - open = 0; create = 1; close = 2; - - - TYPE - FileName = ARRAY 101 OF CHAR; - File* = POINTER TO Handle; - Buffer = POINTER TO BufDesc; - - Handle = RECORD - workName, registerName: FileName; - tempFile: BOOLEAN; - dev, ino, mtime: LONGINT; - fd-: INTEGER; - len, pos: LONGINT; - bufs: ARRAY nofbufs OF Buffer; - swapper, state: INTEGER - END ; - - BufDesc = RECORD - f: File; - chg: BOOLEAN; - org, size: LONGINT; - data: ARRAY bufsize OF SYSTEM.BYTE - END ; - - Rider* = RECORD - res*: LONGINT; - eof*: BOOLEAN; - buf: Buffer; - org, offset: LONGINT - END ; - -(* from time.h on OpenBSD; added yday; changed gmtoff, zone order; - sec to isdst changed to INTEGER; -- antranigv - struct tm { - int tm_sec; - int tm_min; - int tm_hour; - int tm_mday; - int tm_mon; - int tm_year; - int tm_wday; - int tm_yday; - int tm_isdst; - long tm_gmtoff; - char *tm_zone; -}; *) - - Time = POINTER TO TimeDesc; - TimeDesc = RECORD - sec, min, hour, mday, mon, year, wday, yday, isdst : INTEGER; - gmtoff, zone : LONGINT -(* sec, min, hour, mday, mon, year, wday, isdst, zone, gmtoff: INTEGER*) - END ; - - VAR - fileTab: ARRAY fileTabSize OF LONGINT (*=File*); - tempno: INTEGER; - -(* for localtime *) - PROCEDURE -includetime() - '#include "time.h"'; - - PROCEDURE -localtime(VAR clock: LONGINT): Time - "(Files_Time) localtime(clock)"; - - PROCEDURE -getcwd(VAR cwd: Unix.Name) - "getcwd(cwd, cwd__len)"; - - PROCEDURE -IdxTrap "__HALT(-1)"; - - PROCEDURE^ Finalize(o: SYSTEM.PTR); - - PROCEDURE Err(s: ARRAY OF CHAR; f: File; errno: LONGINT); - BEGIN - Console.Ln; Console.String("-- "); Console.String(s); Console.String(": "); - IF f # NIL THEN - IF f.registerName # "" THEN Console.String(f.registerName) ELSE Console.String(f.workName) END - END ; - IF errno # 0 THEN Console.String(" errno = "); Console.Int(errno, 1) END ; - Console.Ln; - HALT(99) - END Err; - - PROCEDURE MakeFileName(dir, name: ARRAY OF CHAR; VAR dest: ARRAY OF CHAR); - VAR i, j: INTEGER; - BEGIN i := 0; j := 0; - WHILE dir[i] # 0X DO dest[i] := dir[i]; INC(i) END ; - IF dest[i-1] # "/" THEN dest[i] := "/"; INC(i) END ; - WHILE name[j] # 0X DO dest[i] := name[j]; INC(i); INC(j) END ; - dest[i] := 0X - END MakeFileName; - - PROCEDURE GetTempName(finalName: ARRAY OF CHAR; VAR name: ARRAY OF CHAR); - VAR n, i, j: LONGINT; - BEGIN - INC(tempno); n := tempno; i := 0; - IF finalName[0] # "/" THEN (* relative pathname *) - WHILE Kernel.CWD[i] # 0X DO name[i] := Kernel.CWD[i]; INC(i) END; - IF Kernel.CWD[i-1] # "/" THEN name[i] := "/"; INC(i) END - END; - j := 0; - WHILE finalName[j] # 0X DO name[i] := finalName[j]; INC(i); INC(j) END; - DEC(i); - WHILE name[i] # "/" DO DEC(i) END; - name[i+1] := "."; name[i+2] := "t"; name[i+3] := "m"; name[i+4] := "p"; name[i+5] := "."; INC(i, 6); - WHILE n > 0 DO name[i] := CHR(n MOD 10 + ORD("0")); n := n DIV 10; INC(i) END; - name[i] := "."; INC(i); n := SHORT(Unix.Getpid()); - WHILE n > 0 DO name[i] := CHR(n MOD 10 + ORD("0")); n := n DIV 10; INC(i) END; - name[i] := 0X - END GetTempName; - - PROCEDURE Create(f: File); - VAR stat: Unix.Status; done: BOOLEAN; - errno: LONGINT; err: ARRAY 32 OF CHAR; - BEGIN - IF f.fd = noDesc THEN - IF f.state = create THEN GetTempName(f.registerName, f.workName); f.tempFile := TRUE - ELSIF f.state = close THEN - f.workName := f.registerName; f.registerName := ""; f.tempFile := FALSE - END ; - errno := Unix.Unlink(f.workName); (*unlink first to avoid stale NFS handles and to avoid reuse of inodes*) - f.fd := Unix.Open(f.workName, SHORT(SYSTEM.VAL(LONGINT, Unix.rdwr + Unix.creat + Unix.trunc)), SHORT(SYSTEM.VAL(LONGINT, {2, 4,5, 7,8}))); - done := f.fd >= 0; errno := Unix.errno(); - IF (~done & ((errno = Unix.ENFILE) OR (errno = Unix.EMFILE))) OR (done & (f.fd >= fileTabSize)) THEN - IF done & (f.fd >= fileTabSize) THEN errno := Unix.Close(f.fd) END ; - Kernel.GC(TRUE); - f.fd := Unix.Open(f.workName, SHORT(SYSTEM.VAL(LONGINT, Unix.rdwr + Unix.creat + Unix.trunc)), SHORT(SYSTEM.VAL(LONGINT, {2, 4,5, 7,8}))); - done := f.fd >= 0 - END ; - IF done THEN - IF f.fd >= fileTabSize THEN errno := Unix.Close(f.fd); Err("too many files open", f, 0) - ELSE fileTab[f.fd] := SYSTEM.VAL(LONGINT, f); INC(Kernel.nofiles); Kernel.RegisterObject(f, Finalize); - f.state := open; f.pos := 0; errno := Unix.Fstat(f.fd, stat); - f.dev := stat.dev; f.ino := stat.ino; f.mtime := stat.mtime - END - ELSE errno := Unix.errno(); - IF errno = Unix.ENOENT THEN err := "no such directory" - ELSIF (errno = Unix.ENFILE) OR (errno = Unix.EMFILE) THEN err := "too many files open" - ELSE err := "file not created" - END ; - Err(err, f, errno) - END - END - END Create; - - PROCEDURE Flush(buf: Buffer); - VAR res: LONGINT; f: File; stat: Unix.Status; - BEGIN - IF buf.chg THEN f := buf.f; Create(f); - IF buf.org # f.pos THEN res := Unix.Lseek(f.fd, buf.org, 0) END ; - res := Unix.Write(f.fd, SYSTEM.ADR(buf.data), buf.size); - IF res < 0 THEN Err("error in writing file", f, Unix.errno()) END ; - f.pos := buf.org + buf.size; - buf.chg := FALSE; - res := Unix.Fstat(f.fd, stat); - f.mtime := stat.mtime - END - END Flush; - - PROCEDURE Close* (f: File); - VAR i, res: LONGINT; - BEGIN - IF (f.state # create) OR (f.registerName # "") THEN - Create(f); i := 0; - WHILE (i < nofbufs) & (f.bufs[i] # NIL) DO Flush(f.bufs[i]); INC(i) END ; - res := Unix.Fsync(f.fd); - IF res < 0 THEN Err("error in writing file", f, Unix.errno()) END - END - END Close; - - PROCEDURE Length* (f: File): LONGINT; - BEGIN RETURN f.len - END Length; - - PROCEDURE New* (name: ARRAY OF CHAR): File; - VAR f: File; - BEGIN - NEW(f); f.workName := ""; COPY(name, f.registerName); - f.fd := noDesc; f.state := create; f.len := 0; f.pos := 0; f.swapper := -1; (*all f.buf[i] = NIL*) - RETURN f - END New; -(* - PROCEDURE ScanPath(VAR pos: INTEGER; VAR dir: ARRAY OF CHAR); (* supports ~, ~user and blanks inside path *) - VAR i: INTEGER; ch: CHAR; home: ARRAY 256 OF CHAR; - BEGIN - i := 0; ch := Kernel.OBERON[pos]; - WHILE (ch = " ") OR (ch = ":") DO INC(pos); ch := Kernel.OBERON[pos] END ; - IF ch = "~" THEN - INC(pos); ch := Kernel.OBERON[pos]; - home := ""; Args.GetEnv("HOME", home); - WHILE home[i] # 0X DO dir[i] := home[i]; INC(i) END ; - IF (ch # "/") & (ch # 0X) & (ch # ":") & (ch # " ") THEN - WHILE (i > 0) & (dir[i-1] # "/") DO DEC(i) END - END - END ; - WHILE (ch # 0X) & (ch # ":") DO dir[i] := ch; INC(i); INC(pos); ch := Kernel.OBERON[pos] END ; - WHILE (i > 0) & (dir[i-1] = " ") DO DEC(i) END ; - dir[i] := 0X - END ScanPath; -*) - PROCEDURE HasDir(VAR name: ARRAY OF CHAR): BOOLEAN; - VAR i: INTEGER; ch: CHAR; - BEGIN i := 0; ch := name[0]; - WHILE (ch # 0X) & (ch # "/") DO INC(i); ch := name[i] END ; - RETURN ch = "/" - END HasDir; - - PROCEDURE CacheEntry(dev, ino: LONGINT; mtime: LONGINT): File; - VAR f: File; i: INTEGER; stat: Unix.Status; res: LONGINT; - BEGIN i := 0; - WHILE i < fileTabSize DO - f := SYSTEM.VAL(File, fileTab[i]); - IF (f # NIL) & (ino = f.ino) & (dev = f.dev) THEN - IF mtime # f.mtime THEN i := 0; - WHILE i < nofbufs DO - IF f.bufs[i] # NIL THEN f.bufs[i].org := -1; f.bufs[i] := NIL END ; - INC(i) - END ; - f.swapper := -1; f.mtime := mtime; - res := Unix.Fstat(f.fd, stat); f.len := stat.size - END ; - RETURN f - END ; - INC(i) - END ; - RETURN NIL - END CacheEntry; - - PROCEDURE Old* (name: ARRAY OF CHAR): File; - VAR f: File; fd: INTEGER; res, errno: LONGINT; pos: INTEGER; done: BOOLEAN; - dir, path: ARRAY 256 OF CHAR; - stat: Unix.Status; - BEGIN - IF name # "" THEN - IF HasDir(name) THEN dir := ""; COPY(name, path) - ELSE - pos := 0; - COPY(name, path); (* -- noch *) - (*ScanPath(pos, dir);*) (*MakeFileName(dir, name, path);*) (*ScanPath(pos, dir)*) - END ; - LOOP - fd := Unix.Open(path, SHORT(SYSTEM.VAL(LONGINT, Unix.rdwr)), SHORT(SYSTEM.VAL(LONGINT, {}))); done := fd >= 0; errno := Unix.errno(); - IF (~done & ((errno = Unix.ENFILE) OR (errno = Unix.EMFILE))) OR (done & (fd >= fileTabSize)) THEN - IF done & (fd >= fileTabSize) THEN res := Unix.Close(fd) END ; - Kernel.GC(TRUE); - fd := Unix.Open(path, SHORT(SYSTEM.VAL(LONGINT, Unix.rdwr)), SHORT(SYSTEM.VAL(LONGINT, {}))); - done := fd >= 0; errno := Unix.errno(); - IF ~done & ((errno = Unix.ENFILE) OR (errno = Unix.EMFILE)) THEN Err("too many files open", f, errno) END - END ; - IF ~done & ((errno = Unix.EACCES) OR (errno = Unix.EROFS) OR (errno = Unix.EAGAIN)) THEN - (* errno EAGAIN observed on Solaris 2.4 *) - fd := Unix.Open(path, SHORT(SYSTEM.VAL(LONGINT, Unix.rdonly)), SHORT(SYSTEM.VAL(LONGINT, {}))); done := fd >= 0; errno := Unix.errno() - END ; -IF (~done) & (errno # Unix.ENOENT) THEN - Console.String("warning Files.Old "); Console.String(name); - Console.String(" errno = "); Console.Int(errno, 0); Console.Ln; -END ; - IF done THEN - res := Unix.Fstat(fd, stat); - f := CacheEntry(stat.dev, stat.ino, stat.mtime); - IF f # NIL THEN res := Unix.Close(fd); RETURN f - ELSIF fd >= fileTabSize THEN res := Unix.Close(fd); Err("too many files open", f, 0) - ELSE NEW(f); fileTab[fd] := SYSTEM.VAL(LONGINT, f); INC(Kernel.nofiles); Kernel.RegisterObject(f, Finalize); - f.fd := fd; f.state := open; f.len := stat.size; f.pos := 0; f.swapper := -1; (*all f.buf[i] = NIL*) - COPY(name, f.workName); f.registerName := ""; f.tempFile := FALSE; - f.dev := stat.dev; f.ino := stat.ino; f.mtime := stat.mtime; - RETURN f - END - ELSIF dir = "" THEN RETURN NIL - ELSE (*MakeFileName(dir, name, path);*) (*ScanPath(pos, dir)*) - RETURN NIL - END - END - ELSE RETURN NIL - END - END Old; - - PROCEDURE Purge* (f: File); - VAR i: INTEGER; stat: Unix.Status; res: LONGINT; - BEGIN i := 0; - WHILE i < nofbufs DO - IF f.bufs[i] # NIL THEN f.bufs[i].org := -1; f.bufs[i] := NIL END ; - INC(i) - END ; - IF f.fd # noDesc THEN res := Unix.Ftruncate(f.fd, 0); res := Unix.Lseek(f.fd, 0, 0) END ; - f.pos := 0; f.len := 0; f.swapper := -1; - res := Unix.Fstat(f.fd, stat); f.mtime := stat.mtime - END Purge; - - PROCEDURE GetDate* (f: File; VAR t, d: LONGINT); - VAR stat: Unix.Status; clock, res: LONGINT; time: Time; - BEGIN - Create(f); res := Unix.Fstat(f.fd, stat); - time := localtime(stat.mtime); - t := time.sec + ASH(time.min, 6) + ASH(time.hour, 12); - d := time.mday + ASH(time.mon+1, 5) + ASH(time.year MOD 100, 9) - END GetDate; - - PROCEDURE Pos* (VAR r: Rider): LONGINT; - BEGIN RETURN r.org + r.offset - END Pos; - - PROCEDURE Set* (VAR r: Rider; f: File; pos: LONGINT); - VAR org, offset, i, n, res: LONGINT; buf: Buffer; - BEGIN - IF f # NIL THEN - IF pos > f.len THEN pos := f.len ELSIF pos < 0 THEN pos := 0 END ; - offset := pos MOD bufsize; org := pos - offset; i := 0; - WHILE (i < nofbufs) & (f.bufs[i] # NIL) & (org # f.bufs[i].org) DO INC(i) END ; - IF i < nofbufs THEN - IF f.bufs[i] = NIL THEN NEW(buf); buf.chg := FALSE; buf.org := -1; buf.f := f; f.bufs[i] := buf - ELSE buf := f.bufs[i] - END - ELSE - f.swapper := (f.swapper + 1) MOD nofbufs; - buf := f.bufs[f.swapper]; - Flush(buf) - END ; - IF buf.org # org THEN - IF org = f.len THEN buf.size := 0 - ELSE Create(f); - IF f.pos # org THEN res := Unix.Lseek(f.fd, org, 0) END ; - n := Unix.ReadBlk(f.fd, buf.data); - IF n < 0 THEN Err("read from file not done", f, Unix.errno()) END ; - f.pos := org + n; - buf.size := n - END ; - buf.org := org; buf.chg := FALSE - END - ELSE buf := NIL; org := 0; offset := 0 - END ; - r.buf := buf; r.org := org; r.offset := offset; r.eof := FALSE; r.res := 0 - END Set; - - PROCEDURE Read* (VAR r: Rider; VAR x: SYSTEM.BYTE); - VAR offset: LONGINT; buf: Buffer; - BEGIN - buf := r.buf; offset := r.offset; - IF r.org # buf.org THEN Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset END ; - IF (offset < buf.size) THEN - x := buf.data[offset]; r.offset := offset + 1 - ELSIF r.org + offset < buf.f.len THEN - Set(r, r.buf.f, r.org + offset); - x := r.buf.data[0]; r.offset := 1 - ELSE - x := 0X; r.eof := TRUE - END - END Read; - - PROCEDURE ReadBytes* (VAR r: Rider; VAR x: ARRAY OF SYSTEM.BYTE; n: LONGINT); - VAR xpos, min, restInBuf, offset: LONGINT; buf: Buffer; - BEGIN - IF n > LEN(x) THEN IdxTrap END ; - xpos := 0; buf := r.buf; offset := r.offset; - WHILE n > 0 DO - IF (r.org # buf.org) OR (offset >= bufsize) THEN - Set(r, buf.f, r.org + offset); - buf := r.buf; offset := r.offset - END ; - restInBuf := buf.size - offset; - IF restInBuf = 0 THEN r.res := n; r.eof := TRUE; RETURN - ELSIF n > restInBuf THEN min := restInBuf ELSE min := n END ; - SYSTEM.MOVE(SYSTEM.ADR(buf.data) + offset, SYSTEM.ADR(x) + xpos, min); - INC(offset, min); r.offset := offset; INC(xpos, min); DEC(n, min) - END ; - r.res := 0; r.eof := FALSE - END ReadBytes; - - PROCEDURE ReadByte* (VAR r : Rider; VAR x : ARRAY OF SYSTEM.BYTE); - BEGIN - ReadBytes(r, x, 1); - END ReadByte; - - PROCEDURE Base* (VAR r: Rider): File; - BEGIN RETURN r.buf.f - END Base; - - PROCEDURE Write* (VAR r: Rider; x: SYSTEM.BYTE); - VAR buf: Buffer; offset: LONGINT; - BEGIN - buf := r.buf; offset := r.offset; - IF (r.org # buf.org) OR (offset >= bufsize) THEN - Set(r, buf.f, r.org + offset); - buf := r.buf; offset := r.offset - END ; - buf.data[offset] := x; - buf.chg := TRUE; - IF offset = buf.size THEN - INC(buf.size); INC(buf.f.len) - END ; - r.offset := offset + 1; r.res := 0 - END Write; - - PROCEDURE WriteByte* (VAR r : Rider; x : SYSTEM.BYTE); (* added for compatibility with PO 2013, -- noch *) - BEGIN - Write(r, x); - END WriteByte; - - PROCEDURE WriteBytes* (VAR r: Rider; VAR x: ARRAY OF SYSTEM.BYTE; n: LONGINT); - VAR xpos, min, restInBuf, offset: LONGINT; buf: Buffer; - BEGIN - IF n > LEN(x) THEN IdxTrap END ; - xpos := 0; buf := r.buf; offset := r.offset; - WHILE n > 0 DO - IF (r.org # buf.org) OR (offset >= bufsize) THEN - Set(r, buf.f, r.org + offset); - buf := r.buf; offset := r.offset - END ; - restInBuf := bufsize - offset; - IF n > restInBuf THEN min := restInBuf ELSE min := n END ; - SYSTEM.MOVE(SYSTEM.ADR(x) + xpos, SYSTEM.ADR(buf.data) + offset, min); - INC(offset, min); r.offset := offset; - IF offset > buf.size THEN INC(buf.f.len, offset - buf.size); buf.size := offset END ; - INC(xpos, min); DEC(n, min); buf.chg := TRUE - END ; - r.res := 0 - END WriteBytes; - -(* another solution would be one that is similar to ReadBytes, WriteBytes. -No code duplication, more symmetric, only two ifs for -Read and Write in buffer, buf.size replaced by bufsize in Write ops, buf.size and len -must be made consistent with offset (if offset > buf.size) in a lazy way. - -PROCEDURE Write* (VAR r: Rider; x: SYSTEM.BYTE); - VAR buf: Buffer; offset: LONGINT; -BEGIN - buf := r.buf; offset := r.offset; - IF (offset >= bufsize) OR (r.org # buf.org) THEN - Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset; - END ; - buf.data[offset] := x; r.offset := offset + 1; buf.chg := TRUE -END Write; - - -PROCEDURE WriteBytes ... - -PROCEDURE Read* (VAR r: Rider; VAR x: SYSTEM.BYTE); - VAR offset: LONGINT; buf: Buffer; -BEGIN - buf := r.buf; offset := r.offset; - IF (offset >= buf.size) OR (r.org # buf.org) THEN - IF r.org + offset >= buf.f.len THEN x := 0X; r.eof := TRUE; RETURN - ELSE Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset - END - END ; - x := buf.data[offset]; r.offset := offset + 1 -END Read; - -but this would also affect Set, Length, and Flush. -Especially Length would become fairly complex. -*) - - PROCEDURE Delete* (name: ARRAY OF CHAR; VAR res: INTEGER); - BEGIN - res := SHORT(Unix.Unlink(name)); - res := SHORT(Unix.errno()) - END Delete; - - PROCEDURE Rename* (old, new: ARRAY OF CHAR; VAR res: INTEGER); - VAR fdold, fdnew: INTEGER; n, errno, r: LONGINT; - ostat, nstat: Unix.Status; - buf: ARRAY 4096 OF CHAR; - BEGIN - r := Unix.Stat(old, ostat); - IF r >= 0 THEN - r := Unix.Stat(new, nstat); - IF (r >= 0) & ((ostat.dev # nstat.dev) OR (ostat.ino # nstat.ino)) THEN - Delete(new, res); (* work around stale nfs handles *) - END ; - r := Unix.Rename(old, new); - IF r < 0 THEN res := SHORT(Unix.errno()); - IF res = Unix.EXDEV THEN (* cross device link, move the file *) - fdold := Unix.Open(old, SHORT(SYSTEM.VAL(LONGINT, Unix.rdonly)), SHORT(SYSTEM.VAL(LONGINT, {}))); - IF fdold < 0 THEN res := 2; RETURN END ; - fdnew := Unix.Open(new, SHORT(SYSTEM.VAL(LONGINT, Unix.rdwr + Unix.creat + Unix.trunc)), SHORT(SYSTEM.VAL(LONGINT, {2, 4,5, 7,8}))); - IF fdnew < 0 THEN r := Unix.Close(fdold); res := 3; RETURN END ; - n := Unix.Read(fdold, SYSTEM.ADR(buf), bufsize); - WHILE n > 0 DO - r := Unix.Write(fdnew, SYSTEM.ADR(buf), n); - IF r < 0 THEN errno := Unix.errno(); r := Unix.Close(fdold); r := Unix.Close(fdnew); - Err("cannot move file", NIL, errno) - END ; - n := Unix.Read(fdold, SYSTEM.ADR(buf), bufsize) - END ; - errno := Unix.errno(); - r := Unix.Close(fdold); r := Unix.Close(fdnew); - IF n = 0 THEN r := Unix.Unlink(old); res := 0 - ELSE Err("cannot move file", NIL, errno) - END ; - ELSE RETURN (* res is Unix.Rename return code *) - END - END ; - res := 0 - ELSE res := 2 (* old file not found *) - END - END Rename; - - PROCEDURE Register* (f: File); - VAR idx, errno: INTEGER; f1: File; file: ARRAY 104 OF CHAR; - BEGIN - IF (f.state = create) & (f.registerName # "") THEN f.state := close (* shortcut renaming *) END ; - Close(f); - IF f.registerName # "" THEN - Rename(f.workName, f.registerName, errno); - IF errno # 0 THEN COPY(f.registerName, file); HALT(99) END ; - f.workName := f.registerName; f.registerName := ""; f.tempFile := FALSE - END - END Register; - - PROCEDURE ChangeDirectory*(path: ARRAY OF CHAR; VAR res: INTEGER); - BEGIN - res := SHORT(Unix.Chdir(path)); - getcwd(Kernel.CWD) - END ChangeDirectory; - - PROCEDURE FlipBytes(VAR src, dest: ARRAY OF SYSTEM.BYTE); - VAR i, j: LONGINT; - BEGIN - IF ~Kernel.littleEndian THEN i := LEN(src); j := 0; - WHILE i > 0 DO DEC(i); dest[j] := src[i]; INC(j) END - ELSE SYSTEM.MOVE(SYSTEM.ADR(src), SYSTEM.ADR(dest), LEN(src)) - END - END FlipBytes; - - PROCEDURE ReadBool* (VAR R: Rider; VAR x: BOOLEAN); - BEGIN Read(R, SYSTEM.VAL(CHAR, x)) - END ReadBool; - - PROCEDURE ReadInt* (VAR R: Rider; VAR x: INTEGER); - VAR b: ARRAY 2 OF CHAR; - BEGIN ReadBytes(R, b, 2); - x := ORD(b[0]) + ORD(b[1])*256 - END ReadInt; - - PROCEDURE ReadLInt* (VAR R: Rider; VAR x: LONGINT); - VAR b: ARRAY 4 OF CHAR; - BEGIN ReadBytes(R, b, 4); - x := ORD(b[0]) + ORD(b[1])*100H + ORD(b[2])*10000H + ORD(b[3])*1000000H - END ReadLInt; - - PROCEDURE ReadSet* (VAR R: Rider; VAR x: SET); - VAR b: ARRAY 4 OF CHAR; - BEGIN ReadBytes(R, b, 4); - x := SYSTEM.VAL(SET, ORD(b[0]) + ORD(b[1])*100H + ORD(b[2])*10000H + ORD(b[3])*1000000H) - END ReadSet; - - PROCEDURE ReadReal* (VAR R: Rider; VAR x: REAL); - VAR b: ARRAY 4 OF CHAR; - BEGIN ReadBytes(R, b, 4); FlipBytes(b, x) - END ReadReal; - - PROCEDURE ReadLReal* (VAR R: Rider; VAR x: LONGREAL); - VAR b: ARRAY 8 OF CHAR; - BEGIN ReadBytes(R, b, 8); FlipBytes(b, x) - END ReadLReal; - - PROCEDURE ReadString* (VAR R: Rider; VAR x: ARRAY OF CHAR); - VAR i: INTEGER; ch: CHAR; - BEGIN i := 0; - REPEAT Read(R, ch); x[i] := ch; INC(i) UNTIL ch = 0X - END ReadString; - - (* need to read line; -- noch *) - PROCEDURE ReadLine* (VAR R: Rider; VAR x: ARRAY OF CHAR); - VAR i: INTEGER; ch: CHAR; b : BOOLEAN; - BEGIN i := 0; - b := FALSE; - REPEAT - Read(R, ch); - IF ((ch = 0X) OR (ch = 0AX) OR (ch = 0DX)) THEN - b := TRUE - ELSE - x[i] := ch; - INC(i); - END; - UNTIL b - END ReadLine; - - PROCEDURE ReadNum* (VAR R: Rider; VAR x: LONGINT); - VAR s: SHORTINT; ch: CHAR; n: LONGINT; - BEGIN s := 0; n := 0; Read(R, ch); - WHILE ORD(ch) >= 128 DO INC(n, ASH(ORD(ch) - 128, s) ); INC(s, 7); Read(R, ch) END; - INC(n, ASH(ORD(ch) MOD 64 - ORD(ch) DIV 64 * 64, s) ); - x := n - END ReadNum; - - PROCEDURE WriteBool* (VAR R: Rider; x: BOOLEAN); - BEGIN Write(R, SYSTEM.VAL(CHAR, x)) - END WriteBool; - - PROCEDURE WriteInt* (VAR R: Rider; x: INTEGER); - VAR b: ARRAY 2 OF CHAR; - BEGIN b[0] := CHR(x); b[1] := CHR(x DIV 256); - WriteBytes(R, b, 2); - END WriteInt; - - PROCEDURE WriteLInt* (VAR R: Rider; x: LONGINT); - VAR b: ARRAY 4 OF CHAR; - BEGIN - b[0] := CHR(x); b[1] := CHR(x DIV 100H); b[2] := CHR(x DIV 10000H); b[3] := CHR(x DIV 1000000H); - WriteBytes(R, b, 4); - END WriteLInt; - - PROCEDURE WriteSet* (VAR R: Rider; x: SET); - VAR b: ARRAY 4 OF CHAR; i: LONGINT; - BEGIN i := SYSTEM.VAL(LONGINT, x); - 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; - - PROCEDURE WriteReal* (VAR R: Rider; x: REAL); - VAR b: ARRAY 4 OF CHAR; - BEGIN FlipBytes(x, b); WriteBytes(R, b, 4) - END WriteReal; - - PROCEDURE WriteLReal* (VAR R: Rider; x: LONGREAL); - VAR b: ARRAY 8 OF CHAR; - BEGIN FlipBytes(x, b); WriteBytes(R, b, 8) - END WriteLReal; - - PROCEDURE WriteString* (VAR R: Rider; x: ARRAY [1] OF CHAR); - VAR i: INTEGER; - BEGIN i := 0; - WHILE x[i] # 0X DO INC(i) END ; - WriteBytes(R, x, i+1) - END WriteString; - - PROCEDURE WriteNum* (VAR R: Rider; x: LONGINT); - BEGIN - WHILE (x < - 64) OR (x > 63) DO Write(R, CHR(x MOD 128 + 128)); x := x DIV 128 END; - Write(R, CHR(x MOD 128)) - END WriteNum; - - PROCEDURE GetName*(f: File; VAR name: ARRAY OF CHAR); - BEGIN - COPY (f.workName, name); - END GetName; - - PROCEDURE Finalize(o: SYSTEM.PTR); - VAR f: File; res: LONGINT; - BEGIN - f := SYSTEM.VAL(File, o); - IF f.fd >= 0 THEN - fileTab[f.fd] := 0; res := Unix.Close(f.fd); f.fd := -1; DEC(Kernel.nofiles); - IF f.tempFile THEN res := Unix.Unlink(f.workName) END - END - END Finalize; - - PROCEDURE Init; - VAR i: LONGINT; - BEGIN - i := 0; WHILE i < fileTabSize DO fileTab[i] := 0; INC(i) END ; - tempno := -1; Kernel.nofiles := 0 - END Init; - -BEGIN Init -END Files. diff --git a/src/system/openbsd/gcc/x86_64/Files0.Mod b/src/system/openbsd/gcc/x86_64/Files0.Mod deleted file mode 100644 index 4d2661fd..00000000 --- a/src/system/openbsd/gcc/x86_64/Files0.Mod +++ /dev/null @@ -1,653 +0,0 @@ -MODULE Files0; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files *) - -(* this module is not for use by developers and inteded to bootstrap voc *) -(* for general use import Files module *) - - IMPORT SYSTEM, Unix, Kernel := Kernel0, Args, Console; - - (* standard data type I/O - - little endian, - Sint:1, Int:2, Lint:4 - ORD({0}) = 1, - false = 0, true =1 - IEEE real format, - null terminated strings, - compact numbers according to M.Odersky *) - - - CONST - nofbufs = 4; - bufsize = 4096; - fileTabSize = 64; - noDesc = -1; - notDone = -1; - - (* file states *) - open = 0; create = 1; close = 2; - - - TYPE - FileName = ARRAY 101 OF CHAR; - File* = POINTER TO Handle; - Buffer = POINTER TO BufDesc; - - Handle = RECORD - workName, registerName: FileName; - tempFile: BOOLEAN; - dev, ino, mtime: LONGINT; - fd-: INTEGER; - len, pos: LONGINT; - bufs: ARRAY nofbufs OF Buffer; - swapper, state: INTEGER - END ; - - BufDesc = RECORD - f: File; - chg: BOOLEAN; - org, size: LONGINT; - data: ARRAY bufsize OF SYSTEM.BYTE - END ; - - Rider* = RECORD - res*: LONGINT; - eof*: BOOLEAN; - buf: Buffer; - org, offset: LONGINT - END ; - -(* from time.h on OpenBSD; added yday; changed gmtoff, zone order; - sec to isdst changed to INTEGER; -- antranigv - struct tm { - int tm_sec; - int tm_min; - int tm_hour; - int tm_mday; - int tm_mon; - int tm_year; - int tm_wday; - int tm_yday; - int tm_isdst; - long tm_gmtoff; - char *tm_zone; -}; *) - - Time = POINTER TO TimeDesc; - TimeDesc = RECORD - sec, min, hour, mday, mon, year, wday, yday, isdst : INTEGER; - gmtoff, zone : LONGINT -(* sec, min, hour, mday, mon, year, wday, isdst, zone, gmtoff: INTEGER*) - END ; - - VAR - fileTab: ARRAY fileTabSize OF LONGINT (*=File*); - tempno: INTEGER; - -(* for localtime *) - PROCEDURE -includetime() - '#include "time.h"'; - - PROCEDURE -localtime(VAR clock: LONGINT): Time - "(Files0_Time) localtime(clock)"; - - PROCEDURE -getcwd(VAR cwd: Unix.Name) - "getcwd(cwd, cwd__len)"; - - PROCEDURE -IdxTrap "__HALT(-1)"; - - PROCEDURE^ Finalize(o: SYSTEM.PTR); - - PROCEDURE Err(s: ARRAY OF CHAR; f: File; errno: LONGINT); - BEGIN - Console.Ln; Console.String("-- "); Console.String(s); Console.String(": "); - IF f # NIL THEN - IF f.registerName # "" THEN Console.String(f.registerName) ELSE Console.String(f.workName) END - END ; - IF errno # 0 THEN Console.String(" errno = "); Console.Int(errno, 1) END ; - Console.Ln; - HALT(99) - END Err; - - PROCEDURE MakeFileName(dir, name: ARRAY OF CHAR; VAR dest: ARRAY OF CHAR); - VAR i, j: INTEGER; - BEGIN i := 0; j := 0; - WHILE dir[i] # 0X DO dest[i] := dir[i]; INC(i) END ; - IF dest[i-1] # "/" THEN dest[i] := "/"; INC(i) END ; - WHILE name[j] # 0X DO dest[i] := name[j]; INC(i); INC(j) END ; - dest[i] := 0X - END MakeFileName; - - PROCEDURE GetTempName(finalName: ARRAY OF CHAR; VAR name: ARRAY OF CHAR); - VAR n, i, j: LONGINT; - BEGIN - INC(tempno); n := tempno; i := 0; - IF finalName[0] # "/" THEN (* relative pathname *) - WHILE Kernel.CWD[i] # 0X DO name[i] := Kernel.CWD[i]; INC(i) END; - IF Kernel.CWD[i-1] # "/" THEN name[i] := "/"; INC(i) END - END; - j := 0; - WHILE finalName[j] # 0X DO name[i] := finalName[j]; INC(i); INC(j) END; - DEC(i); - WHILE name[i] # "/" DO DEC(i) END; - name[i+1] := "."; name[i+2] := "t"; name[i+3] := "m"; name[i+4] := "p"; name[i+5] := "."; INC(i, 6); - WHILE n > 0 DO name[i] := CHR(n MOD 10 + ORD("0")); n := n DIV 10; INC(i) END; - name[i] := "."; INC(i); n := SHORT(Unix.Getpid()); - WHILE n > 0 DO name[i] := CHR(n MOD 10 + ORD("0")); n := n DIV 10; INC(i) END; - name[i] := 0X - END GetTempName; - - PROCEDURE Create(f: File); - VAR stat: Unix.Status; done: BOOLEAN; - errno: LONGINT; err: ARRAY 32 OF CHAR; - BEGIN - IF f.fd = noDesc THEN - IF f.state = create THEN GetTempName(f.registerName, f.workName); f.tempFile := TRUE - ELSIF f.state = close THEN - f.workName := f.registerName; f.registerName := ""; f.tempFile := FALSE - END ; - errno := Unix.Unlink(f.workName); (*unlink first to avoid stale NFS handles and to avoid reuse of inodes*) -f.fd := Unix.Open(f.workName, SHORT(SYSTEM.VAL(LONGINT, (Unix.rdwr + Unix.creat + Unix.trunc))), SHORT(SYSTEM.VAL(LONGINT, ({2, 4,5, 7,8})))); - done := f.fd >= 0; errno := Unix.errno(); - IF (~done & ((errno = Unix.ENFILE) OR (errno = Unix.EMFILE))) OR (done & (f.fd >= fileTabSize)) THEN - IF done & (f.fd >= fileTabSize) THEN errno := Unix.Close(f.fd) END ; - Kernel.GC(TRUE); - f.fd := Unix.Open(f.workName, SHORT(SYSTEM.VAL(LONGINT, (Unix.rdwr + Unix.creat + Unix.trunc))), SHORT(SYSTEM.VAL(LONGINT, {2, 4,5, 7,8}))); - done := f.fd >= 0 - END ; - IF done THEN - IF f.fd >= fileTabSize THEN errno := Unix.Close(f.fd); Err("too many files open", f, 0) - ELSE fileTab[f.fd] := SYSTEM.VAL(LONGINT, f); INC(Kernel.nofiles); Kernel.RegisterObject(f, Finalize); - f.state := open; f.pos := 0; errno := Unix.Fstat(f.fd, stat); - f.dev := stat.dev; f.ino := stat.ino; f.mtime := stat.mtime - END - ELSE errno := Unix.errno(); - IF errno = Unix.ENOENT THEN err := "no such directory" - ELSIF (errno = Unix.ENFILE) OR (errno = Unix.EMFILE) THEN err := "too many files open" - ELSE err := "file not created" - END ; - Err(err, f, errno) - END - END - END Create; - - PROCEDURE Flush(buf: Buffer); - VAR res: LONGINT; f: File; stat: Unix.Status; - BEGIN - IF buf.chg THEN f := buf.f; Create(f); - IF buf.org # f.pos THEN res := Unix.Lseek(f.fd, buf.org, 0) END ; - res := Unix.Write(f.fd, SYSTEM.ADR(buf.data), buf.size); - IF res < 0 THEN Err("error in writing file", f, Unix.errno()) END ; - f.pos := buf.org + buf.size; - buf.chg := FALSE; - res := Unix.Fstat(f.fd, stat); - f.mtime := stat.mtime - END - END Flush; - - PROCEDURE Close* (f: File); - VAR i, res: LONGINT; - BEGIN - IF (f.state # create) OR (f.registerName # "") THEN - Create(f); i := 0; - WHILE (i < nofbufs) & (f.bufs[i] # NIL) DO Flush(f.bufs[i]); INC(i) END ; - res := Unix.Fsync(f.fd); - IF res < 0 THEN Err("error in writing file", f, Unix.errno()) END - END - END Close; - - PROCEDURE Length* (f: File): LONGINT; - BEGIN RETURN f.len - END Length; - - PROCEDURE New* (name: ARRAY OF CHAR): File; - VAR f: File; - BEGIN - NEW(f); f.workName := ""; COPY(name, f.registerName); - f.fd := noDesc; f.state := create; f.len := 0; f.pos := 0; f.swapper := -1; (*all f.buf[i] = NIL*) - RETURN f - END New; - - PROCEDURE ScanPath(VAR pos: INTEGER; VAR dir: ARRAY OF CHAR); (* supports ~, ~user and blanks inside path *) - VAR i: INTEGER; ch: CHAR; home: ARRAY 256 OF CHAR; - BEGIN - i := 0; ch := Kernel.OBERON[pos]; - WHILE (ch = " ") OR (ch = ":") DO INC(pos); ch := Kernel.OBERON[pos] END ; - IF ch = "~" THEN - INC(pos); ch := Kernel.OBERON[pos]; - home := ""; Args.GetEnv("HOME", home); - WHILE home[i] # 0X DO dir[i] := home[i]; INC(i) END ; - IF (ch # "/") & (ch # 0X) & (ch # ":") & (ch # " ") THEN - WHILE (i > 0) & (dir[i-1] # "/") DO DEC(i) END - END - END ; - WHILE (ch # 0X) & (ch # ":") DO dir[i] := ch; INC(i); INC(pos); ch := Kernel.OBERON[pos] END ; - WHILE (i > 0) & (dir[i-1] = " ") DO DEC(i) END ; - dir[i] := 0X - END ScanPath; - - PROCEDURE HasDir(VAR name: ARRAY OF CHAR): BOOLEAN; - VAR i: INTEGER; ch: CHAR; - BEGIN i := 0; ch := name[0]; - WHILE (ch # 0X) & (ch # "/") DO INC(i); ch := name[i] END ; - RETURN ch = "/" - END HasDir; - - PROCEDURE CacheEntry(dev, ino: LONGINT; mtime: LONGINT): File; - VAR f: File; i: INTEGER; stat: Unix.Status; res: LONGINT; - BEGIN i := 0; - WHILE i < fileTabSize DO - f := SYSTEM.VAL(File, fileTab[i]); - IF (f # NIL) & (ino = f.ino) & (dev = f.dev) THEN - IF mtime # f.mtime THEN i := 0; - WHILE i < nofbufs DO - IF f.bufs[i] # NIL THEN f.bufs[i].org := -1; f.bufs[i] := NIL END ; - INC(i) - END ; - f.swapper := -1; f.mtime := mtime; - res := Unix.Fstat(f.fd, stat); f.len := stat.size - END ; - RETURN f - END ; - INC(i) - END ; - RETURN NIL - END CacheEntry; - - PROCEDURE Old* (name: ARRAY OF CHAR): File; - VAR f: File; fd: INTEGER; res, errno: LONGINT; pos: INTEGER; done: BOOLEAN; - dir, path: ARRAY 256 OF CHAR; - stat: Unix.Status; - BEGIN - IF name # "" THEN - IF HasDir(name) THEN dir := ""; COPY(name, path) - ELSE pos := 0; ScanPath(pos, dir); MakeFileName(dir, name, path); ScanPath(pos, dir) - END ; - LOOP - fd := Unix.Open(path, SHORT(SYSTEM.VAL(LONGINT, Unix.rdwr)), SHORT(SYSTEM.VAL(LONGINT, {}))); done := fd >= 0; errno := Unix.errno(); - IF (~done & ((errno = Unix.ENFILE) OR (errno = Unix.EMFILE))) OR (done & (fd >= fileTabSize)) THEN - IF done & (fd >= fileTabSize) THEN res := Unix.Close(fd) END ; - Kernel.GC(TRUE); - fd := Unix.Open(path, SHORT(SYSTEM.VAL(LONGINT, Unix.rdwr)), SHORT(SYSTEM.VAL(LONGINT, {}))); - done := fd >= 0; errno := Unix.errno(); - IF ~done & ((errno = Unix.ENFILE) OR (errno = Unix.EMFILE)) THEN Err("too many files open", f, errno) END - END ; - IF ~done & ((errno = Unix.EACCES) OR (errno = Unix.EROFS) OR (errno = Unix.EAGAIN)) THEN - (* errno EAGAIN observed on Solaris 2.4 *) - fd := Unix.Open(path, SHORT(SYSTEM.VAL(LONGINT, Unix.rdonly)), SHORT(SYSTEM.VAL(LONGINT, {}))); done := fd >= 0; errno := Unix.errno() - END ; -IF (~done) & (errno # Unix.ENOENT) THEN - Console.String("warning Files0.Old "); Console.String(name); - Console.String(" errno = "); Console.Int(errno, 0); Console.Ln; -END ; - IF done THEN - res := Unix.Fstat(fd, stat); - f := CacheEntry(stat.dev, stat.ino, stat.mtime); - IF f # NIL THEN res := Unix.Close(fd); RETURN f - ELSIF fd >= fileTabSize THEN res := Unix.Close(fd); Err("too many files open", f, 0) - ELSE NEW(f); fileTab[fd] := SYSTEM.VAL(LONGINT, f); INC(Kernel.nofiles); Kernel.RegisterObject(f, Finalize); - f.fd := fd; f.state := open; f.len := stat.size; f.pos := 0; f.swapper := -1; (*all f.buf[i] = NIL*) - COPY(name, f.workName); f.registerName := ""; f.tempFile := FALSE; - f.dev := stat.dev; f.ino := stat.ino; f.mtime := stat.mtime; - RETURN f - END - ELSIF dir = "" THEN RETURN NIL - ELSE MakeFileName(dir, name, path); ScanPath(pos, dir) - END - END - ELSE RETURN NIL - END - END Old; - - PROCEDURE Purge* (f: File); - VAR i: INTEGER; stat: Unix.Status; res: LONGINT; - BEGIN i := 0; - WHILE i < nofbufs DO - IF f.bufs[i] # NIL THEN f.bufs[i].org := -1; f.bufs[i] := NIL END ; - INC(i) - END ; - IF f.fd # noDesc THEN res := Unix.Ftruncate(f.fd, 0); res := Unix.Lseek(f.fd, 0, 0) END ; - f.pos := 0; f.len := 0; f.swapper := -1; - res := Unix.Fstat(f.fd, stat); f.mtime := stat.mtime - END Purge; - - PROCEDURE GetDate* (f: File; VAR t, d: LONGINT); - VAR stat: Unix.Status; clock, res: LONGINT; time: Time; - BEGIN - Create(f); res := Unix.Fstat(f.fd, stat); - time := localtime(stat.mtime); - t := time.sec + ASH(time.min, 6) + ASH(time.hour, 12); - d := time.mday + ASH(time.mon+1, 5) + ASH(time.year MOD 100, 9) - END GetDate; - - PROCEDURE Pos* (VAR r: Rider): LONGINT; - BEGIN RETURN r.org + r.offset - END Pos; - - PROCEDURE Set* (VAR r: Rider; f: File; pos: LONGINT); - VAR org, offset, i, n, res: LONGINT; buf: Buffer; - BEGIN - IF f # NIL THEN - IF pos > f.len THEN pos := f.len ELSIF pos < 0 THEN pos := 0 END ; - offset := pos MOD bufsize; org := pos - offset; i := 0; - WHILE (i < nofbufs) & (f.bufs[i] # NIL) & (org # f.bufs[i].org) DO INC(i) END ; - IF i < nofbufs THEN - IF f.bufs[i] = NIL THEN NEW(buf); buf.chg := FALSE; buf.org := -1; buf.f := f; f.bufs[i] := buf - ELSE buf := f.bufs[i] - END - ELSE - f.swapper := (f.swapper + 1) MOD nofbufs; - buf := f.bufs[f.swapper]; - Flush(buf) - END ; - IF buf.org # org THEN - IF org = f.len THEN buf.size := 0 - ELSE Create(f); - IF f.pos # org THEN res := Unix.Lseek(f.fd, org, 0) END ; - n := Unix.ReadBlk(f.fd, buf.data); - IF n < 0 THEN Err("read from file not done", f, Unix.errno()) END ; - f.pos := org + n; - buf.size := n - END ; - buf.org := org; buf.chg := FALSE - END - ELSE buf := NIL; org := 0; offset := 0 - END ; - r.buf := buf; r.org := org; r.offset := offset; r.eof := FALSE; r.res := 0 - END Set; - - PROCEDURE Read* (VAR r: Rider; VAR x: SYSTEM.BYTE); - VAR offset: LONGINT; buf: Buffer; - BEGIN - buf := r.buf; offset := r.offset; - IF r.org # buf.org THEN Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset END ; - IF (offset < buf.size) THEN - x := buf.data[offset]; r.offset := offset + 1 - ELSIF r.org + offset < buf.f.len THEN - Set(r, r.buf.f, r.org + offset); - x := r.buf.data[0]; r.offset := 1 - ELSE - x := 0X; r.eof := TRUE - END - END Read; - - PROCEDURE ReadBytes* (VAR r: Rider; VAR x: ARRAY OF SYSTEM.BYTE; n: LONGINT); - VAR xpos, min, restInBuf, offset: LONGINT; buf: Buffer; - BEGIN - IF n > LEN(x) THEN IdxTrap END ; - xpos := 0; buf := r.buf; offset := r.offset; - WHILE n > 0 DO - IF (r.org # buf.org) OR (offset >= bufsize) THEN - Set(r, buf.f, r.org + offset); - buf := r.buf; offset := r.offset - END ; - restInBuf := buf.size - offset; - IF restInBuf = 0 THEN r.res := n; r.eof := TRUE; RETURN - ELSIF n > restInBuf THEN min := restInBuf ELSE min := n END ; - SYSTEM.MOVE(SYSTEM.ADR(buf.data) + offset, SYSTEM.ADR(x) + xpos, min); - INC(offset, min); r.offset := offset; INC(xpos, min); DEC(n, min) - END ; - r.res := 0; r.eof := FALSE - END ReadBytes; - - PROCEDURE ReadByte* (VAR r : Rider; VAR x : ARRAY OF SYSTEM.BYTE); - BEGIN - ReadBytes(r, x, 1); - END ReadByte; - - PROCEDURE Base* (VAR r: Rider): File; - BEGIN RETURN r.buf.f - END Base; - - PROCEDURE Write* (VAR r: Rider; x: SYSTEM.BYTE); - VAR buf: Buffer; offset: LONGINT; - BEGIN - buf := r.buf; offset := r.offset; - IF (r.org # buf.org) OR (offset >= bufsize) THEN - Set(r, buf.f, r.org + offset); - buf := r.buf; offset := r.offset - END ; - buf.data[offset] := x; - buf.chg := TRUE; - IF offset = buf.size THEN - INC(buf.size); INC(buf.f.len) - END ; - r.offset := offset + 1; r.res := 0 - END Write; - - PROCEDURE WriteBytes* (VAR r: Rider; VAR x: ARRAY OF SYSTEM.BYTE; n: LONGINT); - VAR xpos, min, restInBuf, offset: LONGINT; buf: Buffer; - BEGIN - IF n > LEN(x) THEN IdxTrap END ; - xpos := 0; buf := r.buf; offset := r.offset; - WHILE n > 0 DO - IF (r.org # buf.org) OR (offset >= bufsize) THEN - Set(r, buf.f, r.org + offset); - buf := r.buf; offset := r.offset - END ; - restInBuf := bufsize - offset; - IF n > restInBuf THEN min := restInBuf ELSE min := n END ; - SYSTEM.MOVE(SYSTEM.ADR(x) + xpos, SYSTEM.ADR(buf.data) + offset, min); - INC(offset, min); r.offset := offset; - IF offset > buf.size THEN INC(buf.f.len, offset - buf.size); buf.size := offset END ; - INC(xpos, min); DEC(n, min); buf.chg := TRUE - END ; - r.res := 0 - END WriteBytes; - -(* another solution would be one that is similar to ReadBytes, WriteBytes. -No code duplication, more symmetric, only two ifs for -Read and Write in buffer, buf.size replaced by bufsize in Write ops, buf.size and len -must be made consistent with offset (if offset > buf.size) in a lazy way. - -PROCEDURE Write* (VAR r: Rider; x: SYSTEM.BYTE); - VAR buf: Buffer; offset: LONGINT; -BEGIN - buf := r.buf; offset := r.offset; - IF (offset >= bufsize) OR (r.org # buf.org) THEN - Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset; - END ; - buf.data[offset] := x; r.offset := offset + 1; buf.chg := TRUE -END Write; - -PROCEDURE WriteBytes ... - -PROCEDURE Read* (VAR r: Rider; VAR x: SYSTEM.BYTE); - VAR offset: LONGINT; buf: Buffer; -BEGIN - buf := r.buf; offset := r.offset; - IF (offset >= buf.size) OR (r.org # buf.org) THEN - IF r.org + offset >= buf.f.len THEN x := 0X; r.eof := TRUE; RETURN - ELSE Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset - END - END ; - x := buf.data[offset]; r.offset := offset + 1 -END Read; - -but this would also affect Set, Length, and Flush. -Especially Length would become fairly complex. -*) - - PROCEDURE Delete* (name: ARRAY OF CHAR; VAR res: INTEGER); - BEGIN - res := SHORT(Unix.Unlink(name)); - res := SHORT(Unix.errno()) - END Delete; - - PROCEDURE Rename* (old, new: ARRAY OF CHAR; VAR res: INTEGER); - VAR fdold, fdnew: INTEGER; n, errno, r: LONGINT; - ostat, nstat: Unix.Status; - buf: ARRAY 4096 OF CHAR; - BEGIN - r := Unix.Stat(old, ostat); - IF r >= 0 THEN - r := Unix.Stat(new, nstat); - IF (r >= 0) & ((ostat.dev # nstat.dev) OR (ostat.ino # nstat.ino)) THEN - Delete(new, res); (* work around stale nfs handles *) - END ; - r := Unix.Rename(old, new); - IF r < 0 THEN res := SHORT(Unix.errno()); - IF res = Unix.EXDEV THEN (* cross device link, move the file *) - fdold := Unix.Open(old, SHORT(SYSTEM.VAL(LONGINT, Unix.rdonly)), SHORT(SYSTEM.VAL(LONGINT, {}))); - IF fdold < 0 THEN res := 2; RETURN END ; - fdnew := Unix.Open(new, SHORT(SYSTEM.VAL(LONGINT, Unix.rdwr + Unix.creat + Unix.trunc)), SHORT(SYSTEM.VAL(LONGINT, {2, 4,5, 7,8}))); - IF fdnew < 0 THEN r := Unix.Close(fdold); res := 3; RETURN END ; - n := Unix.Read(fdold, SYSTEM.ADR(buf), bufsize); - WHILE n > 0 DO - r := Unix.Write(fdnew, SYSTEM.ADR(buf), n); - IF r < 0 THEN errno := Unix.errno(); r := Unix.Close(fdold); r := Unix.Close(fdnew); - Err("cannot move file", NIL, errno) - END ; - n := Unix.Read(fdold, SYSTEM.ADR(buf), bufsize) - END ; - errno := Unix.errno(); - r := Unix.Close(fdold); r := Unix.Close(fdnew); - IF n = 0 THEN r := Unix.Unlink(old); res := 0 - ELSE Err("cannot move file", NIL, errno) - END ; - ELSE RETURN (* res is Unix.Rename return code *) - END - END ; - res := 0 - ELSE res := 2 (* old file not found *) - END - END Rename; - - PROCEDURE Register* (f: File); - VAR idx, errno: INTEGER; f1: File; file: ARRAY 104 OF CHAR; - BEGIN - IF (f.state = create) & (f.registerName # "") THEN f.state := close (* shortcut renaming *) END ; - Close(f); - IF f.registerName # "" THEN - Rename(f.workName, f.registerName, errno); - IF errno # 0 THEN COPY(f.registerName, file); HALT(99) END ; - f.workName := f.registerName; f.registerName := ""; f.tempFile := FALSE - END - END Register; - - PROCEDURE ChangeDirectory*(path: ARRAY OF CHAR; VAR res: INTEGER); - BEGIN - res := SHORT(Unix.Chdir(path)); - getcwd(Kernel.CWD) - END ChangeDirectory; - - PROCEDURE FlipBytes(VAR src, dest: ARRAY OF SYSTEM.BYTE); - VAR i, j: LONGINT; - BEGIN - IF ~Kernel.littleEndian THEN i := LEN(src); j := 0; - WHILE i > 0 DO DEC(i); dest[j] := src[i]; INC(j) END - ELSE SYSTEM.MOVE(SYSTEM.ADR(src), SYSTEM.ADR(dest), LEN(src)) - END - END FlipBytes; - - PROCEDURE ReadBool* (VAR R: Rider; VAR x: BOOLEAN); - BEGIN Read(R, SYSTEM.VAL(CHAR, x)) - END ReadBool; - - PROCEDURE ReadInt* (VAR R: Rider; VAR x: INTEGER); - VAR b: ARRAY 2 OF CHAR; - BEGIN ReadBytes(R, b, 2); - x := ORD(b[0]) + ORD(b[1])*256 - END ReadInt; - - PROCEDURE ReadLInt* (VAR R: Rider; VAR x: LONGINT); - VAR b: ARRAY 4 OF CHAR; - BEGIN ReadBytes(R, b, 4); - x := ORD(b[0]) + ORD(b[1])*100H + ORD(b[2])*10000H + ORD(b[3])*1000000H - END ReadLInt; - - PROCEDURE ReadSet* (VAR R: Rider; VAR x: SET); - VAR b: ARRAY 4 OF CHAR; - BEGIN ReadBytes(R, b, 4); - x := SYSTEM.VAL(SET, ORD(b[0]) + ORD(b[1])*100H + ORD(b[2])*10000H + ORD(b[3])*1000000H) - END ReadSet; - - PROCEDURE ReadReal* (VAR R: Rider; VAR x: REAL); - VAR b: ARRAY 4 OF CHAR; - BEGIN ReadBytes(R, b, 4); FlipBytes(b, x) - END ReadReal; - - PROCEDURE ReadLReal* (VAR R: Rider; VAR x: LONGREAL); - VAR b: ARRAY 8 OF CHAR; - BEGIN ReadBytes(R, b, 8); FlipBytes(b, x) - END ReadLReal; - - PROCEDURE ReadString* (VAR R: Rider; VAR x: ARRAY OF CHAR); - VAR i: INTEGER; ch: CHAR; - BEGIN i := 0; - REPEAT Read(R, ch); x[i] := ch; INC(i) UNTIL ch = 0X - END ReadString; - - PROCEDURE ReadNum* (VAR R: Rider; VAR x: LONGINT); - VAR s: SHORTINT; ch: CHAR; n: LONGINT; - BEGIN s := 0; n := 0; Read(R, ch); - WHILE ORD(ch) >= 128 DO INC(n, ASH(ORD(ch) - 128, s) ); INC(s, 7); Read(R, ch) END; - INC(n, ASH(ORD(ch) MOD 64 - ORD(ch) DIV 64 * 64, s) ); - x := n - END ReadNum; - - PROCEDURE WriteBool* (VAR R: Rider; x: BOOLEAN); - BEGIN Write(R, SYSTEM.VAL(CHAR, x)) - END WriteBool; - - PROCEDURE WriteInt* (VAR R: Rider; x: INTEGER); - VAR b: ARRAY 2 OF CHAR; - BEGIN b[0] := CHR(x); b[1] := CHR(x DIV 256); - WriteBytes(R, b, 2); - END WriteInt; - - PROCEDURE WriteLInt* (VAR R: Rider; x: LONGINT); - VAR b: ARRAY 4 OF CHAR; - BEGIN - b[0] := CHR(x); b[1] := CHR(x DIV 100H); b[2] := CHR(x DIV 10000H); b[3] := CHR(x DIV 1000000H); - WriteBytes(R, b, 4); - END WriteLInt; - - PROCEDURE WriteSet* (VAR R: Rider; x: SET); - VAR b: ARRAY 4 OF CHAR; i: LONGINT; - BEGIN i := SYSTEM.VAL(LONGINT, x); - 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; - - PROCEDURE WriteReal* (VAR R: Rider; x: REAL); - VAR b: ARRAY 4 OF CHAR; - BEGIN FlipBytes(x, b); WriteBytes(R, b, 4) - END WriteReal; - - PROCEDURE WriteLReal* (VAR R: Rider; x: LONGREAL); - VAR b: ARRAY 8 OF CHAR; - BEGIN FlipBytes(x, b); WriteBytes(R, b, 8) - END WriteLReal; - - PROCEDURE WriteString* (VAR R: Rider; x: ARRAY [1] OF CHAR); - VAR i: INTEGER; - BEGIN i := 0; - WHILE x[i] # 0X DO INC(i) END ; - WriteBytes(R, x, i+1) - END WriteString; - - PROCEDURE WriteNum* (VAR R: Rider; x: LONGINT); - BEGIN - WHILE (x < - 64) OR (x > 63) DO Write(R, CHR(x MOD 128 + 128)); x := x DIV 128 END; - Write(R, CHR(x MOD 128)) - END WriteNum; - - PROCEDURE Finalize(o: SYSTEM.PTR); - VAR f: File; res: LONGINT; - BEGIN - f := SYSTEM.VAL(File, o); - IF f.fd >= 0 THEN - fileTab[f.fd] := 0; res := Unix.Close(f.fd); f.fd := -1; DEC(Kernel.nofiles); - IF f.tempFile THEN res := Unix.Unlink(f.workName) END - END - END Finalize; - - PROCEDURE Init; - VAR i: LONGINT; - BEGIN - i := 0; WHILE i < fileTabSize DO fileTab[i] := 0; INC(i) END ; - tempno := -1; Kernel.nofiles := 0 - END Init; - -BEGIN Init -END Files0. diff --git a/src/system/openbsd/gcc/x86_64/SYSTEM.c0 b/src/system/openbsd/gcc/x86_64/SYSTEM.c0 deleted file mode 100644 index 3d875068..00000000 --- a/src/system/openbsd/gcc/x86_64/SYSTEM.c0 +++ /dev/null @@ -1,205 +0,0 @@ -/* -* The body prefix file of the voc(jet backend) runtime system, Version 1.0 -* -* Copyright (c) Software Templ, 1994, 1995 -* -* Module SYSTEM is subject to change any time without prior notification. -* Software Templ disclaims all warranties with regard to module SYSTEM, -* in particular shall Software Templ not be liable for any damage resulting -* from inappropriate use or modification of module SYSTEM. -* -* Version 1.1 jt, 24.11.95 fixes for correct pointer arithmetic on Cray computers -* jt 31.1.2007 ANSI prototypes for malloc and exit in order to avoid cc warnings -* -*/ - -#include "SYSTEM.h" -#ifdef __STDC__ -#include "stdarg.h" -#else -#include "varargs.h" -#endif - -extern void *malloc(unsigned long size); -extern void exit(int status); - -void (*SYSTEM_Halt)(); -LONGINT SYSTEM_halt; /* x in HALT(x) */ -LONGINT SYSTEM_assert; /* x in ASSERT(cond, x) */ -LONGINT SYSTEM_argc; -LONGINT SYSTEM_argv; -LONGINT SYSTEM_lock; -BOOLEAN SYSTEM_interrupted; -static LONGINT SYSTEM_mainfrm; /* adr of main proc stack frame, used for stack collection */ - -#define Lock SYSTEM_lock++ -#define Unlock SYSTEM_lock--; if (SYSTEM_interrupted && (SYSTEM_lock == 0)) __HALT(-9) - - -static void SYSTEM_InitHeap(); -void *SYSTEM__init(); - -void SYSTEM_INIT(argc, argvadr) - int argc; long argvadr; -{ - SYSTEM_mainfrm = argvadr; - SYSTEM_argc = argc; - SYSTEM_argv = *(long*)argvadr; - SYSTEM_InitHeap(); - SYSTEM_halt = -128; - SYSTEM__init(); -} - -void SYSTEM_FINI() -{ - SYSTEM_FINALL(); -} - -long SYSTEM_XCHK(i, ub) long i, ub; {return __X(i, ub);} -long SYSTEM_RCHK(i, ub) long i, ub; {return __R(i, ub);} -long SYSTEM_ASH(i, n) long i, n; {return __ASH(i, n);} -long SYSTEM_ABS(i) long i; {return __ABS(i);} -double SYSTEM_ABSD(i) double i; {return __ABS(i);} - -void SYSTEM_INHERIT(t, t0) - long *t, *t0; -{ - t -= __TPROC0OFF; - t0 -= __TPROC0OFF; - while (*t0 != __EOM) {*t = *t0; t--; t0--;} -} - -void SYSTEM_ENUMP(adr, n, P) - long *adr; - long n; - void (*P)(); -{ - while (n > 0) {P(*adr); adr++; n--;} -} - -void SYSTEM_ENUMR(adr, typ, size, n, P) - char *adr; - long *typ, size, n; - void (*P)(); -{ - long *t, off; - typ++; - while (n > 0) { - t = typ; - off = *t; - while (off >= 0) {P(*(long*)(adr+off)); t++; off = *t;} - adr += size; n--; - } -} - -long SYSTEM_DIV(x, y) - unsigned long x, y; -{ if ((long) x >= 0) return (x / y); - else return -((y - 1 - x) / y); -} - -long SYSTEM_MOD(x, y) - unsigned long x, y; -{ unsigned long m; - if ((long) x >= 0) return (x % y); - else { m = (-x) % y; - if (m != 0) return (y - m); else return 0; - } -} - -long SYSTEM_ENTIER(x) - double x; -{ - long y; - if (x >= 0) - return (long)x; - else { - y = (long)x; - if (y <= x) return y; else return y - 1; - } -} - -void SYSTEM_HALT(n) - int n; -{ - SYSTEM_halt = n; - if (SYSTEM_Halt!=0) SYSTEM_Halt(n); - exit(n); -} - -#ifdef __STDC__ -SYSTEM_PTR SYSTEM_NEWARR(long *typ, long elemsz, int elemalgn, int nofdim, int nofdyn, ...) -#else -SYSTEM_PTR SYSTEM_NEWARR(typ, elemsz, elemalgn, nofdim, nofdyn, va_alist) - long *typ, elemsz; - int elemalgn, nofdim, nofdyn; - va_dcl -#endif -{ - long nofelems, size, dataoff, n, nptr, *x, *p, nofptrs, i, *ptab, off; - va_list ap; -#ifdef __STDC__ - va_start(ap, nofdyn); -#else - va_start(ap); -#endif - nofelems = 1; - while (nofdim > 0) { - nofelems = nofelems * va_arg(ap, long); nofdim--; - if (nofelems <= 0) __HALT(-20); - } - va_end(ap); - dataoff = nofdyn * sizeof(long); - if (elemalgn > sizeof(long)) { - n = dataoff % elemalgn; - if (n != 0) dataoff += elemalgn - n; - } - size = dataoff + nofelems * elemsz; - Lock; - if (typ == NIL) { - /* element typ does not contain pointers */ - x = SYSTEM_NEWBLK(size); - } - else if (typ == POINTER__typ) { - /* element type is a pointer */ - x = SYSTEM_NEWBLK(size + nofelems * sizeof(long)); - p = (long*)x[-1]; - p[-nofelems] = *p; /* build new type desc in situ: 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ - p -= nofelems - 1; n = 1; /* n =1 for skipping the size field */ - while (n <= nofelems) {*p = n*sizeof(long); p++; n++;} - *p = - (nofelems + 1) * sizeof(long); /* sentinel */ - x[-1] -= nofelems * sizeof(long); - } - else { - /* element type is a record that contains pointers */ - ptab = typ + 1; nofptrs = 0; - while (ptab[nofptrs] >= 0) {nofptrs++;} /* number of pointers per element */ - nptr = nofelems * nofptrs; /* total number of pointers */ - x = SYSTEM_NEWBLK(size + nptr * sizeof(long)); - p = (long*)x[- 1]; - p[-nptr] = *p; /* build new type desc in situ; 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ - p -= nptr - 1; n = 0; off = dataoff; - while (n < nofelems) {i = 0; - while (i < nofptrs) {*p = off + ptab[i]; p++; i++;} - off += elemsz; n++; - } - *p = - (nptr + 1) * sizeof(long); /* sentinel */ - x[-1] -= nptr * sizeof(long); - } - if (nofdyn != 0) { - /* setup len vector for index checks */ -#ifdef __STDC__ - va_start(ap, nofdyn); -#else - va_start(ap); -#endif - p = x; - while (nofdyn > 0) {*p = va_arg(ap, long); p++, nofdyn--;} - va_end(ap); - } - Unlock; - return x; -} - -/* ----------- end of SYSTEM.co ------------- */ - diff --git a/src/system/openbsd/gcc/x86_64/SYSTEM.h b/src/system/openbsd/gcc/x86_64/SYSTEM.h deleted file mode 100644 index becece08..00000000 --- a/src/system/openbsd/gcc/x86_64/SYSTEM.h +++ /dev/null @@ -1,239 +0,0 @@ -#ifndef SYSTEM__h -#define SYSTEM__h - -/* - -voc (jet backend) runtime system interface and macros library -copyright (c) Josef Templ, 1995, 1996 - -gcc for Linux version (same as SPARC/Solaris2) -uses double # as concatenation operator - -*/ - -//#include -#include /* for type sizes -- noch */ -#include /* for malloc -- antranigv */ - -extern void *memcpy(void *dest, const void *src, unsigned long n); -extern void *malloc(unsigned long size); -extern void exit(int status); - -#define export -#define import extern - -/* constants */ -#define __MAXEXT 16 -#define NIL 0L -#define POINTER__typ (long*)1L /* not NIL and not a valid type */ - -/* basic types */ -//typedef char BOOLEAN; -#define BOOLEAN char -//typedef unsigned char CHAR; -#define CHAR unsigned char -//exactly two bytes -#define LONGCHAR unsigned short int -//typedef signed char SHORTINT; -#define SHORTINT signed char -//for x86 GNU/Linux -//typedef short int INTEGER; -//for x86_64 GNU/Linux -//typedef int INTEGER; -#define INTEGER int -//typedef long LONGINT; -#define LONGINT long -//typedef float REAL; -#define REAL float -//typedef double LONGREAL; -#define LONGREAL double -//typedef unsigned long SET; -#define SET unsigned long -typedef void *SYSTEM_PTR; -//#define *SYSTEM_PTR void -//typedef unsigned char SYSTEM_BYTE; -#define SYSTEM_BYTE unsigned char -typedef int8_t SYSTEM_INT8; -typedef int16_t SYSTEM_INT16; -typedef int32_t SYSTEM_INT32; -typedef int64_t SYSTEM_INT64; - -/* runtime system routines */ -extern long SYSTEM_DIV(); -extern long SYSTEM_MOD(); -extern long SYSTEM_ENTIER(); -extern long SYSTEM_ASH(); -extern long SYSTEM_ABS(); -extern long SYSTEM_XCHK(); -extern long SYSTEM_RCHK(); -extern double SYSTEM_ABSD(); -extern SYSTEM_PTR SYSTEM_NEWREC(); -extern SYSTEM_PTR SYSTEM_NEWBLK(); -#ifdef __STDC__ -extern SYSTEM_PTR SYSTEM_NEWARR(long*, long, int, int, int, ...); -#else -extern SYSTEM_PTR SYSTEM_NEWARR(); -#endif -extern SYSTEM_PTR SYSTEM_REGMOD(); -extern void SYSTEM_INCREF(); -extern void SYSTEM_REGCMD(); -extern void SYSTEM_REGTYP(); -extern void SYSTEM_REGFIN(); -extern void SYSTEM_FINALL(); -extern void SYSTEM_INIT(); -extern void SYSTEM_FINI(); -extern void SYSTEM_HALT(); -extern void SYSTEM_INHERIT(); -extern void SYSTEM_ENUMP(); -extern void SYSTEM_ENUMR(); - -/* module registry */ -#define __DEFMOD static void *m; if(m!=0)return m -#define __REGMOD(name, enum) if(m==0)m=SYSTEM_REGMOD((CHAR*)name,enum); else return m -#define __ENDMOD return m -#define __INIT(argc, argv) static void *m; SYSTEM_INIT(argc, (long)&argv); -#define __REGMAIN(name, enum) m=SYSTEM_REGMOD(name,enum) -#define __FINI SYSTEM_FINI(); return 0 -#define __IMPORT(name) SYSTEM_INCREF(name##__init()) -#define __REGCMD(name, cmd) SYSTEM_REGCMD(m, name, cmd) - -/* SYSTEM ops */ -#define __SYSNEW(p, len) p=SYSTEM_NEWBLK((long)(len)) -#define __VAL(t, x) (*(t*)&(x)) -#define __GET(a, x, t) x= *(t*)(a) -#define __PUT(a, x, t) *(t*)(a)=x -#define __LSHL(x, n, t) ((t)((unsigned t)(x)<<(n))) -#define __LSHR(x, n, t) ((t)((unsigned t)(x)>>(n))) -#define __LSH(x, n, t) ((n)>=0? __LSHL(x, n, t): __LSHR(x, -(n), t)) -#define __ROTL(x, n, t) ((t)((unsigned t)(x)<<(n)|(unsigned t)(x)>>(8*sizeof(t)-(n)))) -#define __ROTR(x, n, t) ((t)((unsigned t)(x)>>(n)|(unsigned t)(x)<<(8*sizeof(t)-(n)))) -#define __LSHR(x, n, t) ((t)((unsigned t)(x)>>(n))) -#define __LSH(x, n, t) ((n)>=0? __LSHL(x, n, t): __LSHR(x, -(n), t)) -#define __ROTL(x, n, t) ((t)((unsigned t)(x)<<(n)|(unsigned t)(x)>>(8*sizeof(t)-(n)))) -#define __ROTR(x, n, t) ((t)((unsigned t)(x)>>(n)|(unsigned t)(x)<<(8*sizeof(t)-(n)))) -#define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) -#define __BIT(x, n) (*(unsigned long*)(x)>>(n)&1) -#define __MOVE(s, d, n) memcpy((char*)(d),(char*)(s),n) - -/* std procs and operator mappings */ -#define __SHORT(x, y) ((int)((unsigned long)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) -#define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) -#define __CHR(x) ((CHAR)__R(x, 256)) -#define __CHRF(x) ((CHAR)__RF(x, 256)) -#define __DIV(x, y) ((x)>=0?(x)/(y):-(((y)-1-(x))/(y))) -#define __DIVF(x, y) SYSTEM_DIV((long)(x),(long)(y)) -#define __MOD(x, y) ((x)>=0?(x)%(y):__MODF(x,y)) -#define __MODF(x, y) SYSTEM_MOD((long)(x),(long)(y)) -#define __NEW(p, t) p=SYSTEM_NEWREC((long)t##__typ) -#define __NEWARR SYSTEM_NEWARR -#define __HALT(x) SYSTEM_HALT(x) -#define __ASSERT(cond, x) if (!(cond)) {SYSTEM_assert = x; SYSTEM_HALT(-1);} -#define __ENTIER(x) SYSTEM_ENTIER(x) -#define __ABS(x) (((x)<0)?-(x):(x)) -#define __ABSF(x) SYSTEM_ABS((long)(x)) -#define __ABSFD(x) SYSTEM_ABSD((double)(x)) -#define __CAP(ch) ((CHAR)((ch)&0x5f)) -#define __ODD(x) ((x)&1) -#define __IN(x, s) (((s)>>(x))&1) -#define __SETOF(x) ((SET)1<<(x)) -#define __SETRNG(l, h) ((~(SET)0<<(l))&~(SET)0>>(8*sizeof(SET)-1-(h))) -#define __MASK(x, m) ((x)&~(m)) -#define __COPY(s, d, n) {char*_a=(void*)s,*_b=(void*)d;long _i=0,_t=n-1;while(_i<_t&&((_b[_i]=_a[_i])!=0)){_i++;};_b[_i]=0;} -static int __STRCMP(x, y) - CHAR *x, *y; -{long i = 0; CHAR ch1, ch2; - do {ch1 = x[i]; ch2 = y[i]; i++; - if (!ch1) return -(int)ch2; - } while (ch1==ch2); - return (int)ch1 - (int)ch2; -} -#define __ASH(x, n) ((n)>=0?__ASHL(x,n):__ASHR(x,-(n))) -#define __ASHL(x, n) ((long)(x)<<(n)) -#define __ASHR(x, n) ((long)(x)>>(n)) -#define __ASHF(x, n) SYSTEM_ASH((long)(x), (long)(n)) -#define __DUP(x, l, t) x=(void*)memcpy(alloca(l*sizeof(t)),x,l*sizeof(t)) -#define __DUPARR(v, t) v=(void*)memcpy(v##__copy,v,sizeof(t)) -#define __DEL(x) /* DUP with alloca frees storage automatically */ -#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(long)typ##__typ) -#define __TYPEOF(p) (*(((long**)(p))-1)) -#define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) - -/* runtime checks */ -#define __X(i, ub) (((unsigned)(long)(i)<(unsigned long)(ub))?i:(__HALT(-2),0)) -#define __XF(i, ub) SYSTEM_XCHK((long)(i), (long)(ub)) -#define __RETCHK __retchk: __HALT(-3) -#define __CASECHK __HALT(-4) -#define __GUARDP(p, typ, level) ((typ*)(__ISP(p,typ,level)?p:(__HALT(-5),p))) -#define __GUARDR(r, typ, level) (*((typ*)(__IS(r##__typ,typ,level)?r:(__HALT(-5),r)))) -#define __GUARDA(p, typ, level) ((struct typ*)(__IS(__TYPEOF(p),typ,level)?p:(__HALT(-5),p))) -#define __GUARDEQR(p, dyntyp, typ) if(dyntyp!=typ##__typ) __HALT(-6);*(p) -#define __GUARDEQP(p, typ) if(__TYPEOF(p)!=typ##__typ)__HALT(-6);*(p) -#define __WITHCHK __HALT(-7) -#define __R(i, ub) (((unsigned)(long)(i)<(unsigned long)(ub))?i:(__HALT(-8),0)) -#define __RF(i, ub) SYSTEM_RCHK((long)(i),(long)(ub)) - -/* record type descriptors */ -#define __TDESC(t, m, n) \ - static struct t##__desc {\ - long tproc[m]; \ - long tag, next, level, module; \ - char name[24]; \ - long *base[__MAXEXT]; \ - char *rsrvd; \ - long blksz, ptr[n+1]; \ - } t##__desc - -#define __BASEOFF (__MAXEXT+1) -#define __TPROC0OFF (__BASEOFF+24/sizeof(long)+5) -#define __EOM 1 -#define __TDFLDS(name, size) {__EOM}, 1, 0, 0, 0, name, {0}, 0, size -#define __ENUMP(adr, n, P) SYSTEM_ENUMP(adr, (long)(n), P) -#define __ENUMR(adr, typ, size, n, P) SYSTEM_ENUMR(adr, typ, (long)(size), (long)(n), P) - -#define __INITYP(t, t0, level) \ - t##__typ= &t##__desc.blksz; \ - memcpy(t##__desc.base, t0##__typ - __BASEOFF, level*sizeof(long)); \ - t##__desc.base[level]=t##__typ; \ - t##__desc.module=(long)m; \ - if(t##__desc.blksz!=sizeof(struct t)) __HALT(-15); \ - t##__desc.blksz=(t##__desc.blksz+5*sizeof(long)-1)/(4*sizeof(long))*(4*sizeof(long)); \ - SYSTEM_REGTYP(m, (long)&t##__desc.next); \ - SYSTEM_INHERIT(t##__typ, t0##__typ) - -/* Oberon-2 type bound procedures support */ -#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(long)proc -#define __SEND(typ, num, funtyp, parlist) ((funtyp)(*(typ-(__TPROC0OFF+num))))parlist - -/* runtime system variables */ -extern LONGINT SYSTEM_argc; -extern LONGINT SYSTEM_argv; -extern void (*SYSTEM_Halt)(); -extern LONGINT SYSTEM_halt; -extern LONGINT SYSTEM_assert; -extern SYSTEM_PTR SYSTEM_modules; -extern LONGINT SYSTEM_heapsize; -extern LONGINT SYSTEM_allocated; -extern LONGINT SYSTEM_lock; -extern SHORTINT SYSTEM_gclock; -extern BOOLEAN SYSTEM_interrupted; - -/* ANSI prototypes; not used so far -static int __STRCMP(CHAR *x, CHAR *y); -void SYSTEM_INIT(int argc, long argvadr); -void SYSTEM_FINI(void); -long SYSTEM_XCHK(long i, long ub); -long SYSTEM_RCHK(long i, long ub); -long SYSTEM_ASH(long i, long n); -long SYSTEM_ABS(long i); -double SYSTEM_ABSD(double i); -void SYSTEM_INHERIT(long *t, long *t0); -void SYSTEM_ENUMP(long *adr, long n, void (*P)(void*)); -void SYSTEM_ENUMR(char *adr, long *typ, long size, long n, void (*P)(void*)); -long SYSTEM_DIV(unsigned long x, unsigned long y); -long SYSTEM_MOD(unsigned long x, unsigned long y); -long SYSTEM_ENTIER(double x); -void SYSTEM_HALT(int n); -*/ - -#endif - diff --git a/src/system/openbsd/gcc/x86_64/Unix.Mod b/src/system/openbsd/gcc/x86_64/Unix.Mod deleted file mode 100644 index 1e1e7ecb..00000000 --- a/src/system/openbsd/gcc/x86_64/Unix.Mod +++ /dev/null @@ -1,595 +0,0 @@ -MODULE Unix; (* Josef Templ, 5.3.90 Linux system calls *) -(* ported to gnu x86_64 and added system(), sleep() functions, noch *) -(* Module Unix provides a system call interface to Linux. - Naming conventions: - Procedure and Type-names always start with a capital letter. - error numbers as defined in Unix - other constants start with lower case letters *) - -IMPORT SYSTEM(*, Console*); - -CONST - -(* various important constants *) - - stdin* = 0; stdout* =1; stderr* = 2; - - LOCKEX* = 2; LOCKUN* = 8; (* /usr/include/file.h *) - AFINET* = 2; (* /usr/include/sys/socket.h *) - PFINET* = AFINET; (* /usr/include/linux/socket.h *) - SOCKSTREAM* = 1; (* /usr/include/linux/socket.h *) - FIONREAD* = 541BH; (* in /usr/include/asm/termios.h *) - SETFL* = 4; (* set file descriptor flags; in asm/fcntl.h *) - TCP* = 0; - -(* flag sets, cf. /usr/include/asm/fcntl.h *) - rdonly* = {}; wronly* = {0}; rdwr* = {1}; creat* = {6}; excl* = {7}; trunc* = {9}; append* = {10}; ndelay = {11}; - -(* error numbers *) - - EPERM* = 1; (* Not owner *) - ENOENT* = 2; (* No such file or directory *) - ESRCH* = 3; (* No such process *) - EINTR* = 4; (* Interrupted system call *) - EIO* = 5; (* I/O error *) - ENXIO* = 6; (* No such device or address *) - E2BIG* = 7; (* Arg list too long *) - ENOEXEC* = 8; (* Exec format error *) - EBADF* = 9; (* Bad file number *) - ECHILD* = 10; (* No children *) - EAGAIN* = 11; (* No more processes *) - ENOMEM* = 12; (* Not enough core *) - EACCES* = 13; (* Permission denied *) - EFAULT* = 14; (* Bad address *) - ENOTBLK* = 15; (* Block device required *) - EBUSY* = 16; (* Mount device busy *) - EEXIST* = 17; (* File exists *) - EXDEV* = 18; (* Cross-device link *) - ENODEV* = 19; (* No such device *) - ENOTDIR* = 20; (* Not a directory*) - EISDIR* = 21; (* Is a directory *) - EINVAL* = 22; (* Invalid argument *) - ENFILE* = 23; (* File table overflow *) - EMFILE* = 24; (* Too many open files *) - ENOTTY* = 25; (* Not a typewriter *) - ETXTBSY* = 26; (* Text file busy *) - EFBIG* = 27; (* File too large *) - ENOSPC* = 28; (* No space left on device *) - ESPIPE* = 29; (* Illegal seek *) - EROFS* = 30; (* Read-only file system *) - EMLINK* = 31; (* Too many links *) - EPIPE* = 32; (* Broken pipe *) - EDOM* = 33; (* Argument too large *) - ERANGE* = 34; (* Result too large *) - EDEADLK* = 35; (* Resource deadlock would occur *) - ENAMETOOLONG* = 36; (* File name too long *) - ENOLCK* = 37; (* No record locks available *) - ENOSYS* = 38; (* Function not implemented *) - ENOTEMPTY* = 39; (* Directory not empty *) - ELOOP* = 40; (* Too many symbolic links encountered *) - EWOULDBLOCK* = EAGAIN; (* Operation would block *) - ENOMSG* = 42; (* No message of desired type *) - EIDRM* = 43; (* Identifier removed *) - ECHRNG* = 44; (* Channel number out of range *) - EL2NSYNC* = 45; (* Level 2 not synchronized *) - EL3HLT* = 46; (* Level 3 halted *) - EL3RST* = 47; (* Level 3 reset *) - ELNRNG* = 48; (* Link number out of range *) - EUNATCH* = 49; (* Protocol driver not attached *) - ENOCSI* = 50; (* No CSI structure available *) - EL2HLT* = 51; (* Level 2 halted *) - EBADE* = 52; (* Invalid exchange *) - EBADR* = 53; (* Invalid request descriptor *) - EXFULL* = 54; (* Exchange full *) - ENOANO* = 55; (* No anode *) - EBADRQC* = 56; (* Invalid request code *) - EBADSLT* = 57; (* Invalid slot *) - EDEADLOCK* = 58; (* File locking deadlock error *) - EBFONT* = 59; (* Bad font file format *) - ENOSTR* = 60; (* Device not a stream *) - ENODATA* = 61; (* No data available *) - ETIME* = 62; (* Timer expired *) - ENOSR* = 63; (* Out of streams resources *) - ENONET* = 64; (* Machine is not on the network *) - ENOPKG* = 65; (* Package not installed *) - EREMOTE* = 66; (* Object is remote *) - ENOLINK* = 67; (* Link has been severed *) - EADV* = 68; (* Advertise error *) - ESRMNT* = 69; (* Srmount error *) - ECOMM* = 70; (* Communication error on send *) - EPROTO* = 71; (* Protocol error *) - EMULTIHOP* = 72; (* Multihop attempted *) - EDOTDOT* = 73; (* RFS specific error *) - EBADMSG* = 74; (* Not a data message *) - EOVERFLOW* = 75; (* Value too large for defined data type *) - ENOTUNIQ* = 76; (* Name not unique on network *) - EBADFD* = 77; (* File descriptor in bad state *) - EREMCHG* = 78; (* Remote address changed *) - ELIBACC* = 79; (* Can not access a needed shared library *) - ELIBBAD* = 80; (* Accessing a corrupted shared library *) - ELIBSCN* = 81; (* .lib section in a.out corrupted *) - ELIBMAX* = 82; (* Attempting to link in too many shared libraries *) - ELIBEXEC* = 83; (* Cannot exec a shared library directly *) - EILSEQ* = 84; (* Illegal byte sequence *) - ERESTART* = 85; (* Interrupted system call should be restarted *) - ESTRPIPE* = 86; (* Streams pipe error *) - EUSERS* = 87; (* Too many users *) - ENOTSOCK* = 88; (* Socket operation on non-socket *) - EDESTADDRREQ* = 89; (* Destination address required *) - EMSGSIZE* = 90; (* Message too long *) - EPROTOTYPE* = 91; (* Protocol wrong type for socket *) - ENOPROTOOPT* = 92; (* Protocol not available *) - EPROTONOSUPPORT* = 93; (* Protocol not supported *) - ESOCKTNOSUPPORT* = 94; (* Socket type not supported *) - EOPNOTSUPP* = 95; (* Operation not supported on transport endpoint *) - EPFNOSUPPORT* = 96; (* Protocol family not supported *) - EAFNOSUPPORT* = 97; (* Address family not supported by protocol *) - EADDRINUSE* = 98; (* Address already in use *) - EADDRNOTAVAIL* = 99; (* Cannot assign requested address *) - ENETDOWN* = 100; (* Network is down *) - ENETUNREACH* = 101; (* Network is unreachable *) - ENETRESET* = 102; (* Network dropped connection because of reset *) - ECONNABORTED* = 103; (* Software caused connection abort *) - ECONNRESET* = 104; (* Connection reset by peer *) - ENOBUFS* = 105; (* No buffer space available *) - EISCONN* = 106; (* Transport endpoint is already connected *) - ENOTCONN* = 107; (* Transport endpoint is not connected *) - ESHUTDOWN* = 108; (* Cannot send after transport endpoint shutdown *) - ETOOMANYREFS* = 109; (* Too many references: cannot splice *) - ETIMEDOUT* = 110; (* Connection timed out *) - ECONNREFUSED* = 111; (* Connection refused *) - EHOSTDOWN* = 112; (* Host is down *) - EHOSTUNREACH* = 113; (* No route to host *) - EALREADY* = 114; (* Operation already in progress *) - EINPROGRESS* = 115; (* Operation now in progress *) - ESTALE* = 116; (* Stale NFS file handle *) - EUCLEAN* = 117; (* Structure needs cleaning *) - ENOTNAM* = 118; (* Not a XENIX named type file *) - ENAVAIL* = 119; (* No XENIX semaphores available *) - EISNAM* = 120; (* Is a named type file *) - EREMOTEIO* = 121; (* Remote I/O error *) - EDQUOT* = 122; (* Quota exceeded *) - -CONST sigsetarrlength = 1024 / 8 * SIZE(LONGINT); - - -TYPE - (* cpp /usr/include/setjmp.h - struct __jmp_buf_tag - { - __jmp_buf __jmpbuf; - int __mask_was_saved; - __sigset_t __saved_mask; - }; - - typedef struct __jmp_buf_tag jmp_buf[1]; - - __sigset_t is 128 byte long in glibc on arm, x86, x86_64 - __jmp_buf is 24 bytes long in glibc on x86 - 256 bytes long in glibc on armv6 - 64 bytes long in glibc on x86_64 - - *) - (* on openbsd - typedef long sigjmp_buf[11 + 1]; - typedef long jmp_buf[11]; - it seems we need sigjmp_buf - *) - JmpBuf* = RECORD - jmpbuf: ARRAY 12 OF LONGINT; (* 8 * 8 = 64 *) - END ; - - Status* = RECORD (* struct stat *) - mode* : INTEGER; (* mode_t *) - dev* : INTEGER; (* dev_t 4 *) - ino* : LONGINT; (* ino_t 8 *) - nlink* : INTEGER; (* nlink_t *) - uid*, gid*: INTEGER; (* uid_t, gid_t *) - rdev* : INTEGER; (* dev_t *) - atime* : LONGINT; - atimences* : LONGINT; - mtime* : LONGINT; - mtimensec* : LONGINT; - ctime* : LONGINT; - ctimensec* : LONGINT; - size* : LONGINT; (* off_t *) - blocks* : LONGINT; (* int64_t *) - blksize* : INTEGER; (* u_int32_t *) - flags, gen*: INTEGER; (* u_int32_t *) - birthtim: ARRAY 2 OF LONGINT; - END ; - -(* from /usr/include/bits/time.h - -struct timeval - { - __time_t tv_sec; /* Seconds. */ //__time_t 8 - __suseconds_t tv_usec; /* Microseconds. */ __suseconds_t 8 - }; - - -*) -(* from sys/time.h on OpenBSD *) - Timeval* = RECORD - sec*, usec*: LONGINT - END ; - - -(* -from man gettimeofday - - struct timezone { - int tz_minuteswest; /* minutes west of Greenwich */ int 4 - int tz_dsttime; /* type of DST correction */ int 4 - }; -*) - - - Timezone* = RECORD - (*minuteswest*, dsttime*: LONGINT*) - minuteswest*, dsttime*: INTEGER - END ; - - Itimerval* = RECORD - interval*, value*: Timeval - END ; - - FdSet* = ARRAY 16 OF SET; - - SigCtxPtr* = POINTER TO SigContext; - SigContext* = RECORD - END ; - - SignalHandler* = PROCEDURE (sig, code: LONGINT; scp: SigCtxPtr); - -(* From sys/dirent.h on OpenBSD 5.6 *) - Dirent* = RECORD - ino, off: LONGINT; - reclen: ARRAY 2 OF CHAR; - type, namlen : CHAR; - padding : ARRAY 4 OF CHAR; - name : ARRAY 256 OF CHAR; - END ; - -(* from sys/resource.h on OpenBSD *) - Rusage* = RECORD - utime*, stime*: Timeval; - maxrss*, ixrss*, idrss*, isrss*, - minflt*, majflt*, nswap*, inblock*, - oublock*, msgsnd*, msgrcv*, nsignals*, - nvcsw*, nivcsw*: LONGINT - END ; - -(* from sys/uio.h on OpenBSD 5.6 -- antranigv*) - Iovec* = RECORD - base*, len*: LONGINT - END ; - -(* TOBEDONE *) - SocketPair* = ARRAY 2 OF LONGINT; - -(* from sys/poll.h on OpenBSD 5.6 -- antranigv *) - Pollfd* = RECORD - fd*: INTEGER; - events*, revents*: ARRAY 2 OF CHAR; - END ; - -(* different from linux, written new for OpenBSD from sys/socket.h -- antranigv *) - Sockaddr* = RECORD - (*family0*, family1*: SHORTINT; - pad0, pad1: SHORTINT; - pad2 : INTEGER; - (*port*: INTEGER; - internetAddr*: LONGINT;*) - pad*: ARRAY 14 OF CHAR;*) - len* : CHAR; - family* : CHAR; - data* : ARRAY 14 OF CHAR; - END ; - - (* identical to linux. OpenBSD 5.6 -- antranigv *) - HostEntry* = POINTER [1] TO Hostent; - Hostent* = RECORD - name*, aliases*: LONGINT; - addrtype*, length*: INTEGER; - addrlist*: LONGINT; (*POINTER TO POINTER TO LONGINT, network byte order*) - END; - - Name* = ARRAY OF CHAR; - - PROCEDURE -includeStat() - "#include "; - (* for jmp_buf *) - PROCEDURE -includeSetjmp() - "#include "; - - (* for dirent *) - PROCEDURE -includeDirent() - "#include "; - - (* for rusage *) - PROCEDURE -includeResource() - "#include "; - - (* for iovec *) - PROCEDURE -includeIovec() - "#include "; - - PROCEDURE -includeErrno() - "#include "; - - (* for read(), write() and sleep(), and fd_set *) - PROCEDURE -includeUnistd() - "#include "; - - (* for system() *) - PROCEDURE -includeStdlib() - "#include "; - - (* for nanosleep() *) - PROCEDURE -includeTime() - "#include "; - - (* for select() *) - PROCEDURE -includeSelect() - "#include "; - - PROCEDURE -err(): INTEGER - "errno"; - - PROCEDURE errno*(): INTEGER; - BEGIN - RETURN err() - END errno; - - PROCEDURE -Exit*(n: INTEGER) - "exit(n)"; - - PROCEDURE -Fork*(): INTEGER - "fork()"; - - PROCEDURE -Wait*(VAR status: INTEGER): INTEGER - "wait(status)"; - - PROCEDURE -Select*(width: INTEGER; VAR readfds, writefds, exceptfds: FdSet; VAR timeout: Timeval): INTEGER - "select(width, readfds, writefds, exceptfds, timeout)"; - - PROCEDURE -Gettimeofday* (VAR tv: Timeval; VAR tz: Timezone) : INTEGER - "gettimeofday(tv, tz)"; - - PROCEDURE -Read* (fd: INTEGER; buf, nbyte: LONGINT): LONGINT - "read(fd, buf, nbyte)"; - - PROCEDURE -ReadBlk* (fd: INTEGER; VAR buf: ARRAY OF SYSTEM.BYTE): LONGINT - "read(fd, buf, buf__len)"; - - PROCEDURE -Write* (fd: INTEGER; buf, nbyte: LONGINT): LONGINT - "write(fd, buf, nbyte)"; - - PROCEDURE -WriteBlk* (fd: INTEGER; VAR buf: ARRAY OF SYSTEM.BYTE): LONGINT - "write(fd, buf, buf__len)"; - - PROCEDURE -Dup*(fd: INTEGER): INTEGER - "dup(fd)"; - - PROCEDURE -Dup2*(fd1, fd2: INTEGER): INTEGER - "dup(fd1, fd2)"; - - PROCEDURE -Pipe*(fds : LONGINT): INTEGER - "pipe(fds)"; - - PROCEDURE -Getpid*(): INTEGER - "getpid()"; - - PROCEDURE -Getuid*(): INTEGER - "getuid()"; - - PROCEDURE -Geteuid*(): INTEGER - "geteuid()"; - - PROCEDURE -Getgid*(): INTEGER - "getgid()"; - - PROCEDURE -Getegid*(): INTEGER - "getegid()"; - - PROCEDURE -Unlink*(name: Name): INTEGER - "unlink(name)"; - - PROCEDURE -Open*(name: Name; flag: INTEGER; mode: LONGINT): INTEGER - "open(name, flag, mode)"; - - PROCEDURE -Close*(fd: INTEGER): INTEGER - "close(fd)"; - - PROCEDURE -stat(name: Name; VAR statbuf: Status): INTEGER - "stat((const char*)name, (struct stat*)statbuf)"; - - PROCEDURE Stat*(name: Name; VAR statbuf: Status): INTEGER; - VAR res: INTEGER; - BEGIN - res := stat(name, statbuf); - (* make the first 4 bytes as unique as possible (used in module Files for caching!) *) - (* don't understand this - INC(statbuf.dev, statbuf.devX); - INC(statbuf.rdev, statbuf.rdevX); *) - RETURN res; - END Stat; - - PROCEDURE -fstat(fd: INTEGER; VAR statbuf: Status): INTEGER - "fstat(fd, (struct stat*)statbuf)"; - - PROCEDURE Fstat*(fd: INTEGER; VAR statbuf: Status): INTEGER; - VAR res: INTEGER; - BEGIN - res := fstat(fd, statbuf); - (* make the first 4 bytes as unique as possible (used in module Files for caching!) *) - (*INC(statbuf.dev, statbuf.devX); - INC(statbuf.rdev, statbuf.rdevX); *) - RETURN res; - END Fstat; - - PROCEDURE -Fchmod*(fd, mode: INTEGER): INTEGER - "fchmod(fd, mode)"; - - PROCEDURE -Chmod*(path: Name; mode: INTEGER): INTEGER - "chmod(path, mode)"; - - PROCEDURE -Lseek*(fd: INTEGER; offset: LONGINT; origin: INTEGER): LONGINT - "lseek(fd, offset, origin)"; - - PROCEDURE -Fsync*(fd: INTEGER): INTEGER - "fsync(fd)"; - - PROCEDURE -Fcntl*(fd: INTEGER; cmd: INTEGER; arg: LONGINT ): INTEGER - "fcntl(fd, cmd, arg)"; - - PROCEDURE -Flock*(fd, operation: INTEGER): INTEGER - "flock(fd, operation)"; - - PROCEDURE -Ftruncate*(fd: INTEGER; length: LONGINT): INTEGER - "ftruncate(fd, length)"; - - PROCEDURE -Readblk*(fd: INTEGER; VAR buf: ARRAY OF SYSTEM.BYTE; len: LONGINT): LONGINT - "read(fd, buf, len)"; - - PROCEDURE -Rename*(old, new: Name): INTEGER - "rename(old, new)"; - - PROCEDURE -Chdir*(path: Name): INTEGER - "chdir(path)"; - - PROCEDURE -Ioctl*(fd: INTEGER; request, arg: LONGINT): INTEGER - "ioctl(fd, request, arg)"; - - PROCEDURE -Kill*(pid, sig: INTEGER): INTEGER - "kill(pid, sig)"; - - PROCEDURE -Sigsetmask*(mask: INTEGER): INTEGER - "sigsetmask(mask)"; - - PROCEDURE -Sleep*(ms : INTEGER): INTEGER - "(INTEGER)sleep(ms)"; - - PROCEDURE -Nanosleep*(VAR req : Timeval; VAR rem : Timeval): INTEGER - "(INTEGER)nanosleep(req, rem)"; - - (* TCP/IP networking *) - - PROCEDURE -Gethostbyname*(name: Name): HostEntry - "(Unix_HostEntry)gethostbyname(name)"; - - PROCEDURE -Gethostname*(VAR name: Name): INTEGER - "gethostname(name, name__len)"; - - PROCEDURE -Socket*(af, type, protocol: INTEGER): INTEGER - "socket(af, type, protocol)"; - - PROCEDURE -Connect*(socket: INTEGER; name: Sockaddr; namelen: INTEGER): INTEGER - "connect(socket, &(name), namelen)"; - - PROCEDURE -Getsockname*(socket: INTEGER; VAR name: Sockaddr; VAR namelen: INTEGER): INTEGER - "getsockname(socket, name, namelen)"; - - PROCEDURE -Bind*(socket: INTEGER; name: Sockaddr; namelen: INTEGER): INTEGER - "bind(socket, &(name), namelen)"; - - PROCEDURE -Listen*(socket, backlog: INTEGER): INTEGER - "listen(socket, backlog)"; - - PROCEDURE -Accept*(socket: INTEGER; VAR addr: Sockaddr; VAR addrlen: INTEGER): LONGINT - "accept(socket, addr, addrlen)"; - - PROCEDURE -Recv*(socket: INTEGER; bufadr, buflen: LONGINT; flags: INTEGER): LONGINT - "recv(socket, bufadr, buflen, flags)"; - - PROCEDURE -Send*(socket: INTEGER; bufadr, buflen: LONGINT; flags: INTEGER): LONGINT - "send(socket, bufadr, buflen, flags)"; - - PROCEDURE -sys(str: ARRAY OF CHAR): INTEGER (* need this to call external tools like gcc or gas; noch *) - "system(str)"; - - PROCEDURE system*(cmd : ARRAY OF CHAR); - VAR r : INTEGER; - BEGIN - r := sys(cmd); - END system; - - PROCEDURE System*(cmd : ARRAY OF CHAR): INTEGER; - VAR r : INTEGER; - BEGIN - r := sys(cmd); - RETURN r - END System; - - PROCEDURE -SizeofUnixStat(): INTEGER - "sizeof(Unix_Status)"; - - PROCEDURE -SizeofStat(): INTEGER - "sizeof(struct stat)"; - - PROCEDURE -SizeofJmpBuf(): INTEGER - "sizeof(jmp_buf)"; - - PROCEDURE -SizeofSigJmpBuf(): INTEGER - "sizeof(sigjmp_buf)"; - - PROCEDURE -SizeofTimeval(): INTEGER - "sizeof(struct timeval)"; - - PROCEDURE -SizeofTimezone(): INTEGER - "sizeof(struct timezone)"; - - PROCEDURE -SizeofRusage(): INTEGER - "sizeof(struct rusage)"; - - PROCEDURE -SizeofFdSet(): INTEGER - "sizeof(fd_set)"; - - PROCEDURE -SizeofDirent(): INTEGER - "sizeof(struct dirent)"; - - PROCEDURE -SizeofIovec(): INTEGER - "sizeof(struct iovec)"; - - PROCEDURE -Error(msg: ARRAY OF CHAR; len: INTEGER) - "write(1/*stdout*/, msg, len); char ch = 0xa; write(1, &ch, 1)"; - - PROCEDURE StatCheck; - VAR x, y: LONGINT; - BEGIN - x := SizeofUnixStat(); - y := SizeofStat(); - IF x # y THEN - Error("Unix.StatCheck: inconsistent usage of struct stat", 49); - Exit(1); - END - END StatCheck; -(* - PROCEDURE Check; - BEGIN - Console.String("struct stat size: "); Console.Int(SizeofStat(), 0); Console.Ln; - Console.String("Unix.Stat size: "); Console.Int(SIZE(Status), 0); Console.Ln; - Console.String("Unix.JmpBuf size: "); Console.Int(SIZE(JmpBuf), 0); Console.Ln; - Console.String("sigjmp_buf size: "); Console.Int(SizeofSigJmpBuf(), 0); Console.Ln; - Console.String("Unix.Timeval size: "); Console.Int(SIZE(Timeval), 0); Console.Ln; - Console.String("struct timeval size: "); Console.Int(SizeofTimeval(), 0); Console.Ln; - Console.String("Unix.Timezone size: "); Console.Int(SIZE(Timezone), 0); Console.Ln; - Console.String("struct timezone size: "); Console.Int(SizeofTimezone(), 0); Console.Ln; - Console.String("Unix.Rusage size: "); Console.Int(SIZE(Rusage), 0); Console.Ln; - Console.String("struct rusage size: "); Console.Int(SizeofRusage(), 0); Console.Ln; - Console.String("Unix.FdSet size: "); Console.Int(SIZE(FdSet), 0); Console.Ln; - Console.String("fdset size: "); Console.Int(SizeofFdSet(), 0); Console.Ln; - Console.String("Unix.Dirent size: "); Console.Int(SIZE(Dirent), 0); Console.Ln; - Console.String("struct dirent size: "); Console.Int(SizeofDirent(), 0); Console.Ln; - Console.String("Unix.Iovec size: "); Console.Int(SIZE(Iovec), 0); Console.Ln; - Console.String("struct iovec size: "); Console.Int(SizeofIovec(), 0); Console.Ln; - END Check; -*) -BEGIN - - (*Check;*) - StatCheck(); - -END Unix. - From f48876d5db3029011968e470af6081d0573d537d Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 16 Jun 2016 12:30:52 +0100 Subject: [PATCH 062/580] Remove unneeded Files and Kernel variants. --- src/system/Files.Mod | 664 ------------------------------------------ src/system/Kernel.Mod | 188 ------------ 2 files changed, 852 deletions(-) delete mode 100644 src/system/Files.Mod delete mode 100644 src/system/Kernel.Mod diff --git a/src/system/Files.Mod b/src/system/Files.Mod deleted file mode 100644 index c8f42ca5..00000000 --- a/src/system/Files.Mod +++ /dev/null @@ -1,664 +0,0 @@ -MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files *) -(* modified version of Files, which opens only the file provided and does not scan any path in any environment variable, also ReadLine procedure added; -- noch *) - IMPORT SYSTEM, Unix, Kernel, Args, Console; - - (* standard data type I/O - - little endian, - Sint:1, Int:2, Lint:4 - ORD({0}) = 1, - false = 0, true =1 - IEEE real format, - null terminated strings, - compact numbers according to M.Odersky *) - - - CONST - nofbufs = 4; - bufsize = 4096; - fileTabSize = 64; - noDesc = -1; - notDone = -1; - - (* file states *) - open = 0; create = 1; close = 2; - - - TYPE - FileName = ARRAY 101 OF CHAR; - File* = POINTER TO Handle; - Buffer = POINTER TO BufDesc; - - Handle = RECORD - workName, registerName: FileName; - tempFile: BOOLEAN; - dev, ino, mtime: LONGINT; - fd-: INTEGER; - len, pos: LONGINT; - bufs: ARRAY nofbufs OF Buffer; - swapper, state: INTEGER - END ; - - BufDesc = RECORD - f: File; - chg: BOOLEAN; - org, size: LONGINT; - data: ARRAY bufsize OF SYSTEM.BYTE - END ; - - Rider* = RECORD - res*: LONGINT; - eof*: BOOLEAN; - buf: Buffer; - org, offset: LONGINT - END ; - - Time = POINTER TO TimeDesc; - TimeDesc = RECORD - sec*, min*, hour*, mday*, mon*, year*, wday*, isdst*, zone*, gmtoff*: LONGINT; -(* sec*, min*, hour*, mday*, mon*, year*, wday*, isdst*, zone*, gmtoff*: INTEGER;*) - END ; - - VAR - fileTab: ARRAY fileTabSize OF LONGINT (*=File*); - tempno: INTEGER; - -(* for localtime *) - PROCEDURE -includetime() - '#include "time.h"'; - - PROCEDURE -localtime(VAR clock: LONGINT): Time - "(Files_Time) localtime(clock)"; - - PROCEDURE -getcwd(VAR cwd: Unix.Name) - "getcwd(cwd, cwd__len)"; - - PROCEDURE -IdxTrap "__HALT(-1)"; - - PROCEDURE^ Finalize(o: SYSTEM.PTR); - - PROCEDURE Err(s: ARRAY OF CHAR; f: File; errno: LONGINT); - BEGIN - Console.Ln; Console.String("-- "); Console.String(s); Console.String(": "); - IF f # NIL THEN - IF f.registerName # "" THEN Console.String(f.registerName) ELSE Console.String(f.workName) END - END ; - IF errno # 0 THEN Console.String(" errno = "); Console.Int(errno, 1) END ; - Console.Ln; - HALT(99) - END Err; - - PROCEDURE MakeFileName(dir, name: ARRAY OF CHAR; VAR dest: ARRAY OF CHAR); - VAR i, j: INTEGER; - BEGIN i := 0; j := 0; - WHILE dir[i] # 0X DO dest[i] := dir[i]; INC(i) END ; - IF dest[i-1] # "/" THEN dest[i] := "/"; INC(i) END ; - WHILE name[j] # 0X DO dest[i] := name[j]; INC(i); INC(j) END ; - dest[i] := 0X - END MakeFileName; - - PROCEDURE GetTempName(finalName: ARRAY OF CHAR; VAR name: ARRAY OF CHAR); - VAR n, i, j: LONGINT; - BEGIN - INC(tempno); n := tempno; i := 0; - IF finalName[0] # "/" THEN (* relative pathname *) - WHILE Kernel.CWD[i] # 0X DO name[i] := Kernel.CWD[i]; INC(i) END; - IF Kernel.CWD[i-1] # "/" THEN name[i] := "/"; INC(i) END - END; - j := 0; - WHILE finalName[j] # 0X DO name[i] := finalName[j]; INC(i); INC(j) END; - DEC(i); - WHILE name[i] # "/" DO DEC(i) END; - name[i+1] := "."; name[i+2] := "t"; name[i+3] := "m"; name[i+4] := "p"; name[i+5] := "."; INC(i, 6); - WHILE n > 0 DO name[i] := CHR(n MOD 10 + ORD("0")); n := n DIV 10; INC(i) END; - name[i] := "."; INC(i); n := SHORT(Unix.Getpid()); - WHILE n > 0 DO name[i] := CHR(n MOD 10 + ORD("0")); n := n DIV 10; INC(i) END; - name[i] := 0X - END GetTempName; - - PROCEDURE Create(f: File); - VAR stat: Unix.Status; done: BOOLEAN; - errno: LONGINT; err: ARRAY 32 OF CHAR; - BEGIN - IF f.fd = noDesc THEN - IF f.state = create THEN GetTempName(f.registerName, f.workName); f.tempFile := TRUE - ELSIF f.state = close THEN - f.workName := f.registerName; f.registerName := ""; f.tempFile := FALSE - END ; - errno := Unix.Unlink(f.workName); (*unlink first to avoid stale NFS handles and to avoid reuse of inodes*) - f.fd := Unix.Open(f.workName, SHORT(SYSTEM.VAL(LONGINT, Unix.rdwr + Unix.creat + Unix.trunc)), SHORT(SYSTEM.VAL(LONGINT, {2, 4,5, 7,8}))); - done := f.fd >= 0; errno := Unix.errno(); - IF (~done & ((errno = Unix.ENFILE) OR (errno = Unix.EMFILE))) OR (done & (f.fd >= fileTabSize)) THEN - IF done & (f.fd >= fileTabSize) THEN errno := Unix.Close(f.fd) END ; - Kernel.GC(TRUE); - f.fd := Unix.Open(f.workName, SHORT(SYSTEM.VAL(LONGINT, Unix.rdwr + Unix.creat + Unix.trunc)), SHORT(SYSTEM.VAL(LONGINT, {2, 4,5, 7,8}))); - done := f.fd >= 0 - END ; - IF done THEN - IF f.fd >= fileTabSize THEN errno := Unix.Close(f.fd); Err("too many files open", f, 0) - ELSE fileTab[f.fd] := SYSTEM.VAL(LONGINT, f); INC(Kernel.nofiles); Kernel.RegisterObject(f, Finalize); - f.state := open; f.pos := 0; errno := Unix.Fstat(f.fd, stat); - f.dev := stat.dev; f.ino := stat.ino; f.mtime := stat.mtime - END - ELSE errno := Unix.errno(); - IF errno = Unix.ENOENT THEN err := "no such directory" - ELSIF (errno = Unix.ENFILE) OR (errno = Unix.EMFILE) THEN err := "too many files open" - ELSE err := "file not created" - END ; - Err(err, f, errno) - END - END - END Create; - - PROCEDURE Flush(buf: Buffer); - VAR res: LONGINT; f: File; stat: Unix.Status; - BEGIN - IF buf.chg THEN f := buf.f; Create(f); - IF buf.org # f.pos THEN res := Unix.Lseek(f.fd, buf.org, 0) END ; - res := Unix.Write(f.fd, SYSTEM.ADR(buf.data), buf.size); - IF res < 0 THEN Err("error in writing file", f, Unix.errno()) END ; - f.pos := buf.org + buf.size; - buf.chg := FALSE; - res := Unix.Fstat(f.fd, stat); - f.mtime := stat.mtime - END - END Flush; - - PROCEDURE Close* (f: File); - VAR i, res: LONGINT; - BEGIN - IF (f.state # create) OR (f.registerName # "") THEN - Create(f); i := 0; - WHILE (i < nofbufs) & (f.bufs[i] # NIL) DO Flush(f.bufs[i]); INC(i) END ; - res := Unix.Fsync(f.fd); - IF res < 0 THEN Err("error in writing file", f, Unix.errno()) END - END - END Close; - - PROCEDURE Length* (f: File): LONGINT; - BEGIN RETURN f.len - END Length; - - PROCEDURE New* (name: ARRAY OF CHAR): File; - VAR f: File; - BEGIN - NEW(f); f.workName := ""; COPY(name, f.registerName); - f.fd := noDesc; f.state := create; f.len := 0; f.pos := 0; f.swapper := -1; (*all f.buf[i] = NIL*) - RETURN f - END New; -(* - PROCEDURE ScanPath(VAR pos: INTEGER; VAR dir: ARRAY OF CHAR); (* supports ~, ~user and blanks inside path *) - VAR i: INTEGER; ch: CHAR; home: ARRAY 256 OF CHAR; - BEGIN - i := 0; ch := Kernel.OBERON[pos]; - WHILE (ch = " ") OR (ch = ":") DO INC(pos); ch := Kernel.OBERON[pos] END ; - IF ch = "~" THEN - INC(pos); ch := Kernel.OBERON[pos]; - home := ""; Args.GetEnv("HOME", home); - WHILE home[i] # 0X DO dir[i] := home[i]; INC(i) END ; - IF (ch # "/") & (ch # 0X) & (ch # ":") & (ch # " ") THEN - WHILE (i > 0) & (dir[i-1] # "/") DO DEC(i) END - END - END ; - WHILE (ch # 0X) & (ch # ":") DO dir[i] := ch; INC(i); INC(pos); ch := Kernel.OBERON[pos] END ; - WHILE (i > 0) & (dir[i-1] = " ") DO DEC(i) END ; - dir[i] := 0X - END ScanPath; -*) - PROCEDURE HasDir(VAR name: ARRAY OF CHAR): BOOLEAN; - VAR i: INTEGER; ch: CHAR; - BEGIN i := 0; ch := name[0]; - WHILE (ch # 0X) & (ch # "/") DO INC(i); ch := name[i] END ; - RETURN ch = "/" - END HasDir; - - PROCEDURE CacheEntry(dev, ino: LONGINT; mtime: LONGINT): File; - VAR f: File; i: INTEGER; stat: Unix.Status; res: LONGINT; - BEGIN i := 0; - WHILE i < fileTabSize DO - f := SYSTEM.VAL(File, fileTab[i]); - IF (f # NIL) & (ino = f.ino) & (dev = f.dev) THEN - IF mtime # f.mtime THEN i := 0; - WHILE i < nofbufs DO - IF f.bufs[i] # NIL THEN f.bufs[i].org := -1; f.bufs[i] := NIL END ; - INC(i) - END ; - f.swapper := -1; f.mtime := mtime; - res := Unix.Fstat(f.fd, stat); f.len := stat.size - END ; - RETURN f - END ; - INC(i) - END ; - RETURN NIL - END CacheEntry; - - PROCEDURE Old* (name: ARRAY OF CHAR): File; - VAR f: File; fd: INTEGER; res, errno: LONGINT; pos: INTEGER; done: BOOLEAN; - dir, path: ARRAY 256 OF CHAR; - stat: Unix.Status; - BEGIN - IF name # "" THEN - IF HasDir(name) THEN dir := ""; COPY(name, path) - ELSE - pos := 0; - COPY(name, path); (* -- noch *) - (*ScanPath(pos, dir);*) (*MakeFileName(dir, name, path);*) (*ScanPath(pos, dir)*) - END ; - LOOP - fd := Unix.Open(path, SHORT(SYSTEM.VAL(LONGINT, Unix.rdwr)), SHORT(SYSTEM.VAL(LONGINT, {}))); done := fd >= 0; errno := Unix.errno(); - IF (~done & ((errno = Unix.ENFILE) OR (errno = Unix.EMFILE))) OR (done & (fd >= fileTabSize)) THEN - IF done & (fd >= fileTabSize) THEN res := Unix.Close(fd) END ; - Kernel.GC(TRUE); - fd := Unix.Open(path, SHORT(SYSTEM.VAL(LONGINT, Unix.rdwr)), SHORT(SYSTEM.VAL(LONGINT, {}))); - done := fd >= 0; errno := Unix.errno(); - IF ~done & ((errno = Unix.ENFILE) OR (errno = Unix.EMFILE)) THEN Err("too many files open", f, errno) END - END ; - IF ~done & ((errno = Unix.EACCES) OR (errno = Unix.EROFS) OR (errno = Unix.EAGAIN)) THEN - (* errno EAGAIN observed on Solaris 2.4 *) - fd := Unix.Open(path, SHORT(SYSTEM.VAL(LONGINT, Unix.rdonly)), SHORT(SYSTEM.VAL(LONGINT, {}))); done := fd >= 0; errno := Unix.errno() - END ; -IF (~done) & (errno # Unix.ENOENT) THEN - Console.String("warning Files.Old "); Console.String(name); - Console.String(" errno = "); Console.Int(errno, 0); Console.Ln; -END ; - IF done THEN - res := Unix.Fstat(fd, stat); - f := CacheEntry(stat.dev, stat.ino, stat.mtime); - IF f # NIL THEN res := Unix.Close(fd); RETURN f - ELSIF fd >= fileTabSize THEN res := Unix.Close(fd); Err("too many files open", f, 0) - ELSE NEW(f); fileTab[fd] := SYSTEM.VAL(LONGINT, f); INC(Kernel.nofiles); Kernel.RegisterObject(f, Finalize); - f.fd := fd; f.state := open; f.len := stat.size; f.pos := 0; f.swapper := -1; (*all f.buf[i] = NIL*) - COPY(name, f.workName); f.registerName := ""; f.tempFile := FALSE; - f.dev := stat.dev; f.ino := stat.ino; f.mtime := stat.mtime; - RETURN f - END - ELSIF dir = "" THEN RETURN NIL - ELSE (*MakeFileName(dir, name, path);*) (*ScanPath(pos, dir)*) - RETURN NIL - END - END - ELSE RETURN NIL - END - END Old; - - PROCEDURE Purge* (f: File); - VAR i: INTEGER; stat: Unix.Status; res: LONGINT; - BEGIN i := 0; - WHILE i < nofbufs DO - IF f.bufs[i] # NIL THEN f.bufs[i].org := -1; f.bufs[i] := NIL END ; - INC(i) - END ; - IF f.fd # noDesc THEN res := Unix.Ftruncate(f.fd, 0); res := Unix.Lseek(f.fd, 0, 0) END ; - f.pos := 0; f.len := 0; f.swapper := -1; - res := Unix.Fstat(f.fd, stat); f.mtime := stat.mtime - END Purge; - - PROCEDURE GetDate* (f: File; VAR t, d: LONGINT); - VAR stat: Unix.Status; clock, res: LONGINT; time: Time; - BEGIN - Create(f); res := Unix.Fstat(f.fd, stat); - time := localtime(stat.mtime); - t := time.sec + ASH(time.min, 6) + ASH(time.hour, 12); - d := time.mday + ASH(time.mon+1, 5) + ASH(time.year MOD 100, 9) - END GetDate; - - PROCEDURE Pos* (VAR r: Rider): LONGINT; - BEGIN RETURN r.org + r.offset - END Pos; - - PROCEDURE Set* (VAR r: Rider; f: File; pos: LONGINT); - VAR org, offset, i, n, res: LONGINT; buf: Buffer; - BEGIN - IF f # NIL THEN - IF pos > f.len THEN pos := f.len ELSIF pos < 0 THEN pos := 0 END ; - offset := pos MOD bufsize; org := pos - offset; i := 0; - WHILE (i < nofbufs) & (f.bufs[i] # NIL) & (org # f.bufs[i].org) DO INC(i) END ; - IF i < nofbufs THEN - IF f.bufs[i] = NIL THEN NEW(buf); buf.chg := FALSE; buf.org := -1; buf.f := f; f.bufs[i] := buf - ELSE buf := f.bufs[i] - END - ELSE - f.swapper := (f.swapper + 1) MOD nofbufs; - buf := f.bufs[f.swapper]; - Flush(buf) - END ; - IF buf.org # org THEN - IF org = f.len THEN buf.size := 0 - ELSE Create(f); - IF f.pos # org THEN res := Unix.Lseek(f.fd, org, 0) END ; - n := Unix.ReadBlk(f.fd, buf.data); - IF n < 0 THEN Err("read from file not done", f, Unix.errno()) END ; - f.pos := org + n; - buf.size := n - END ; - buf.org := org; buf.chg := FALSE - END - ELSE buf := NIL; org := 0; offset := 0 - END ; - r.buf := buf; r.org := org; r.offset := offset; r.eof := FALSE; r.res := 0 - END Set; - - PROCEDURE Read* (VAR r: Rider; VAR x: SYSTEM.BYTE); - VAR offset: LONGINT; buf: Buffer; - BEGIN - buf := r.buf; offset := r.offset; - IF r.org # buf.org THEN Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset END ; - IF (offset < buf.size) THEN - x := buf.data[offset]; r.offset := offset + 1 - ELSIF r.org + offset < buf.f.len THEN - Set(r, r.buf.f, r.org + offset); - x := r.buf.data[0]; r.offset := 1 - ELSE - x := 0X; r.eof := TRUE - END - END Read; - - PROCEDURE ReadBytes* (VAR r: Rider; VAR x: ARRAY OF SYSTEM.BYTE; n: LONGINT); - VAR xpos, min, restInBuf, offset: LONGINT; buf: Buffer; - BEGIN - IF n > LEN(x) THEN IdxTrap END ; - xpos := 0; buf := r.buf; offset := r.offset; - WHILE n > 0 DO - IF (r.org # buf.org) OR (offset >= bufsize) THEN - Set(r, buf.f, r.org + offset); - buf := r.buf; offset := r.offset - END ; - restInBuf := buf.size - offset; - IF restInBuf = 0 THEN r.res := n; r.eof := TRUE; RETURN - ELSIF n > restInBuf THEN min := restInBuf ELSE min := n END ; - SYSTEM.MOVE(SYSTEM.ADR(buf.data) + offset, SYSTEM.ADR(x) + xpos, min); - INC(offset, min); r.offset := offset; INC(xpos, min); DEC(n, min) - END ; - r.res := 0; r.eof := FALSE - END ReadBytes; - - PROCEDURE ReadByte* (VAR r : Rider; VAR x : ARRAY OF SYSTEM.BYTE); - BEGIN - ReadBytes(r, x, 1); - END ReadByte; - - PROCEDURE Base* (VAR r: Rider): File; - BEGIN RETURN r.buf.f - END Base; - - PROCEDURE Write* (VAR r: Rider; x: SYSTEM.BYTE); - VAR buf: Buffer; offset: LONGINT; - BEGIN - buf := r.buf; offset := r.offset; - IF (r.org # buf.org) OR (offset >= bufsize) THEN - Set(r, buf.f, r.org + offset); - buf := r.buf; offset := r.offset - END ; - buf.data[offset] := x; - buf.chg := TRUE; - IF offset = buf.size THEN - INC(buf.size); INC(buf.f.len) - END ; - r.offset := offset + 1; r.res := 0 - END Write; - - PROCEDURE WriteByte* (VAR r : Rider; x : SYSTEM.BYTE); (* added for compatibility with PO 2013, -- noch *) - BEGIN - Write(r, x); - END WriteByte; - - PROCEDURE WriteBytes* (VAR r: Rider; VAR x: ARRAY OF SYSTEM.BYTE; n: LONGINT); - VAR xpos, min, restInBuf, offset: LONGINT; buf: Buffer; - BEGIN - IF n > LEN(x) THEN IdxTrap END ; - xpos := 0; buf := r.buf; offset := r.offset; - WHILE n > 0 DO - IF (r.org # buf.org) OR (offset >= bufsize) THEN - Set(r, buf.f, r.org + offset); - buf := r.buf; offset := r.offset - END ; - restInBuf := bufsize - offset; - IF n > restInBuf THEN min := restInBuf ELSE min := n END ; - SYSTEM.MOVE(SYSTEM.ADR(x) + xpos, SYSTEM.ADR(buf.data) + offset, min); - INC(offset, min); r.offset := offset; - IF offset > buf.size THEN INC(buf.f.len, offset - buf.size); buf.size := offset END ; - INC(xpos, min); DEC(n, min); buf.chg := TRUE - END ; - r.res := 0 - END WriteBytes; - -(* another solution would be one that is similar to ReadBytes, WriteBytes. -No code duplication, more symmetric, only two ifs for -Read and Write in buffer, buf.size replaced by bufsize in Write ops, buf.size and len -must be made consistent with offset (if offset > buf.size) in a lazy way. - -PROCEDURE Write* (VAR r: Rider; x: SYSTEM.BYTE); - VAR buf: Buffer; offset: LONGINT; -BEGIN - buf := r.buf; offset := r.offset; - IF (offset >= bufsize) OR (r.org # buf.org) THEN - Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset; - END ; - buf.data[offset] := x; r.offset := offset + 1; buf.chg := TRUE -END Write; - - -PROCEDURE WriteBytes ... - -PROCEDURE Read* (VAR r: Rider; VAR x: SYSTEM.BYTE); - VAR offset: LONGINT; buf: Buffer; -BEGIN - buf := r.buf; offset := r.offset; - IF (offset >= buf.size) OR (r.org # buf.org) THEN - IF r.org + offset >= buf.f.len THEN x := 0X; r.eof := TRUE; RETURN - ELSE Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset - END - END ; - x := buf.data[offset]; r.offset := offset + 1 -END Read; - -but this would also affect Set, Length, and Flush. -Especially Length would become fairly complex. -*) - - PROCEDURE Delete* (name: ARRAY OF CHAR; VAR res: INTEGER); - BEGIN - res := SHORT(Unix.Unlink(name)); - res := SHORT(Unix.errno()) - END Delete; - - PROCEDURE Rename* (old, new: ARRAY OF CHAR; VAR res: INTEGER); - VAR fdold, fdnew: INTEGER; n, errno, r: LONGINT; - ostat, nstat: Unix.Status; - buf: ARRAY 4096 OF CHAR; - BEGIN - r := Unix.Stat(old, ostat); - IF r >= 0 THEN - r := Unix.Stat(new, nstat); - IF (r >= 0) & ((ostat.dev # nstat.dev) OR (ostat.ino # nstat.ino)) THEN - Delete(new, res); (* work around stale nfs handles *) - END ; - r := Unix.Rename(old, new); - IF r < 0 THEN res := SHORT(Unix.errno()); - IF res = Unix.EXDEV THEN (* cross device link, move the file *) - fdold := Unix.Open(old, SHORT(SYSTEM.VAL(LONGINT, Unix.rdonly)), SHORT(SYSTEM.VAL(LONGINT, {}))); - IF fdold < 0 THEN res := 2; RETURN END ; - fdnew := Unix.Open(new, SHORT(SYSTEM.VAL(LONGINT, Unix.rdwr + Unix.creat + Unix.trunc)), SHORT(SYSTEM.VAL(LONGINT, {2, 4,5, 7,8}))); - IF fdnew < 0 THEN r := Unix.Close(fdold); res := 3; RETURN END ; - n := Unix.Read(fdold, SYSTEM.ADR(buf), bufsize); - WHILE n > 0 DO - r := Unix.Write(fdnew, SYSTEM.ADR(buf), n); - IF r < 0 THEN errno := Unix.errno(); r := Unix.Close(fdold); r := Unix.Close(fdnew); - Err("cannot move file", NIL, errno) - END ; - n := Unix.Read(fdold, SYSTEM.ADR(buf), bufsize) - END ; - errno := Unix.errno(); - r := Unix.Close(fdold); r := Unix.Close(fdnew); - IF n = 0 THEN r := Unix.Unlink(old); res := 0 - ELSE Err("cannot move file", NIL, errno) - END ; - ELSE RETURN (* res is Unix.Rename return code *) - END - END ; - res := 0 - ELSE res := 2 (* old file not found *) - END - END Rename; - - PROCEDURE Register* (f: File); - VAR idx, errno: INTEGER; f1: File; file: ARRAY 104 OF CHAR; - BEGIN - IF (f.state = create) & (f.registerName # "") THEN f.state := close (* shortcut renaming *) END ; - Close(f); - IF f.registerName # "" THEN - Rename(f.workName, f.registerName, errno); - IF errno # 0 THEN COPY(f.registerName, file); HALT(99) END ; - f.workName := f.registerName; f.registerName := ""; f.tempFile := FALSE - END - END Register; - - PROCEDURE ChangeDirectory*(path: ARRAY OF CHAR; VAR res: INTEGER); - BEGIN - res := SHORT(Unix.Chdir(path)); - getcwd(Kernel.CWD) - END ChangeDirectory; - - PROCEDURE FlipBytes(VAR src, dest: ARRAY OF SYSTEM.BYTE); - VAR i, j: LONGINT; - BEGIN - IF ~Kernel.littleEndian THEN i := LEN(src); j := 0; - WHILE i > 0 DO DEC(i); dest[j] := src[i]; INC(j) END - ELSE SYSTEM.MOVE(SYSTEM.ADR(src), SYSTEM.ADR(dest), LEN(src)) - END - END FlipBytes; - - PROCEDURE ReadBool* (VAR R: Rider; VAR x: BOOLEAN); - BEGIN Read(R, SYSTEM.VAL(CHAR, x)) - END ReadBool; - - PROCEDURE ReadInt* (VAR R: Rider; VAR x: INTEGER); - VAR b: ARRAY 2 OF CHAR; - BEGIN ReadBytes(R, b, 2); - x := ORD(b[0]) + ORD(b[1])*256 - END ReadInt; - - PROCEDURE ReadLInt* (VAR R: Rider; VAR x: LONGINT); - VAR b: ARRAY 4 OF CHAR; - BEGIN ReadBytes(R, b, 4); - x := ORD(b[0]) + ORD(b[1])*100H + ORD(b[2])*10000H + ORD(b[3])*1000000H - END ReadLInt; - - PROCEDURE ReadSet* (VAR R: Rider; VAR x: SET); - VAR b: ARRAY 4 OF CHAR; - BEGIN ReadBytes(R, b, 4); - x := SYSTEM.VAL(SET, ORD(b[0]) + ORD(b[1])*100H + ORD(b[2])*10000H + ORD(b[3])*1000000H) - END ReadSet; - - PROCEDURE ReadReal* (VAR R: Rider; VAR x: REAL); - VAR b: ARRAY 4 OF CHAR; - BEGIN ReadBytes(R, b, 4); FlipBytes(b, x) - END ReadReal; - - PROCEDURE ReadLReal* (VAR R: Rider; VAR x: LONGREAL); - VAR b: ARRAY 8 OF CHAR; - BEGIN ReadBytes(R, b, 8); FlipBytes(b, x) - END ReadLReal; - - PROCEDURE ReadString* (VAR R: Rider; VAR x: ARRAY OF CHAR); - VAR i: INTEGER; ch: CHAR; - BEGIN i := 0; - REPEAT Read(R, ch); x[i] := ch; INC(i) UNTIL ch = 0X - END ReadString; - - (* need to read line; -- noch *) - PROCEDURE ReadLine* (VAR R: Rider; VAR x: ARRAY OF CHAR); - VAR i: INTEGER; ch: CHAR; b : BOOLEAN; - BEGIN i := 0; - b := FALSE; - REPEAT - Read(R, ch); - IF ((ch = 0X) OR (ch = 0AX) OR (ch = 0DX)) THEN - b := TRUE - ELSE - x[i] := ch; - INC(i); - END; - UNTIL b - END ReadLine; - - PROCEDURE ReadNum* (VAR R: Rider; VAR x: LONGINT); - VAR s: SHORTINT; ch: CHAR; n: LONGINT; - BEGIN s := 0; n := 0; Read(R, ch); - WHILE ORD(ch) >= 128 DO INC(n, ASH(ORD(ch) - 128, s) ); INC(s, 7); Read(R, ch) END; - INC(n, ASH(ORD(ch) MOD 64 - ORD(ch) DIV 64 * 64, s) ); - x := n - END ReadNum; - - PROCEDURE WriteBool* (VAR R: Rider; x: BOOLEAN); - BEGIN Write(R, SYSTEM.VAL(CHAR, x)) - END WriteBool; - - PROCEDURE WriteInt* (VAR R: Rider; x: INTEGER); - VAR b: ARRAY 2 OF CHAR; - BEGIN b[0] := CHR(x); b[1] := CHR(x DIV 256); - WriteBytes(R, b, 2); - END WriteInt; - - PROCEDURE WriteLInt* (VAR R: Rider; x: LONGINT); - VAR b: ARRAY 4 OF CHAR; - BEGIN - b[0] := CHR(x); b[1] := CHR(x DIV 100H); b[2] := CHR(x DIV 10000H); b[3] := CHR(x DIV 1000000H); - WriteBytes(R, b, 4); - END WriteLInt; - - PROCEDURE WriteSet* (VAR R: Rider; x: SET); - VAR b: ARRAY 4 OF CHAR; i: LONGINT; - BEGIN i := SYSTEM.VAL(LONGINT, x); - 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; - - PROCEDURE WriteReal* (VAR R: Rider; x: REAL); - VAR b: ARRAY 4 OF CHAR; - BEGIN FlipBytes(x, b); WriteBytes(R, b, 4) - END WriteReal; - - PROCEDURE WriteLReal* (VAR R: Rider; x: LONGREAL); - VAR b: ARRAY 8 OF CHAR; - BEGIN FlipBytes(x, b); WriteBytes(R, b, 8) - END WriteLReal; - - PROCEDURE WriteString* (VAR R: Rider; x: ARRAY [1] OF CHAR); - VAR i: INTEGER; - BEGIN i := 0; - WHILE x[i] # 0X DO INC(i) END ; - WriteBytes(R, x, i+1) - END WriteString; - - PROCEDURE WriteNum* (VAR R: Rider; x: LONGINT); - BEGIN - WHILE (x < - 64) OR (x > 63) DO Write(R, CHR(x MOD 128 + 128)); x := x DIV 128 END; - Write(R, CHR(x MOD 128)) - END WriteNum; - - PROCEDURE GetName*(f: File; VAR name: ARRAY OF CHAR); - BEGIN - COPY (f.workName, name); - END GetName; - - PROCEDURE Finalize(o: SYSTEM.PTR); - VAR f: File; res: LONGINT; - BEGIN - f := SYSTEM.VAL(File, o); - IF f.fd >= 0 THEN - fileTab[f.fd] := 0; res := Unix.Close(f.fd); f.fd := -1; DEC(Kernel.nofiles); - IF f.tempFile THEN res := Unix.Unlink(f.workName) END - END - END Finalize; - - PROCEDURE Init; - VAR i: LONGINT; - BEGIN - i := 0; WHILE i < fileTabSize DO fileTab[i] := 0; INC(i) END ; - tempno := -1; Kernel.nofiles := 0 - END Init; - -BEGIN Init -END Files. diff --git a/src/system/Kernel.Mod b/src/system/Kernel.Mod deleted file mode 100644 index 4fa025ab..00000000 --- a/src/system/Kernel.Mod +++ /dev/null @@ -1,188 +0,0 @@ -MODULE Kernel; -(* - J. Templ, 16.4.95 - communication with C-runtime and storage management -*) - - IMPORT SYSTEM, Unix, Args; - - TYPE - RealTime = POINTER TO TimeDesc; - TimeDesc = RECORD - sec, min, hour, mday, mon, year, wday, isdst, zone, gmtoff: LONGINT - END ; - - KeyCmd* = PROCEDURE; - - ObjFinalizer* = PROCEDURE(obj: SYSTEM.PTR); - - - VAR - (* trap handling *) - trapEnv*: Unix.JmpBuf; (* saved stack environment for trap handling *) - - (* oberon heap management *) - nofiles*: LONGINT; - - (* input event handling *) - readSet*, readySet*: Unix.FdSet; - - FKey*: ARRAY 16 OF KeyCmd; - - littleEndian*: BOOLEAN; - - TimeUnit*: LONGINT; (* 1 sec *) - - LIB*, CWD*: ARRAY 256 OF CHAR; - OBERON*: ARRAY 1024 OF CHAR; - - - timeStart: LONGINT; (* milliseconds *) - - PROCEDURE -includesetjmp() - '#include "setjmp.h"'; -(* for localtime *) - PROCEDURE -includetime() - '#include "time.h"'; - - PROCEDURE -Lock*() - "SYSTEM_lock++"; - - PROCEDURE -Unlock*() - "SYSTEM_lock--; if (SYSTEM_interrupted && SYSTEM_lock == 0) __HALT(-9)"; - - PROCEDURE -Exit*(n: LONGINT) - "exit(n)"; - - PROCEDURE -sigsetjmp*(VAR env: Unix.JmpBuf; savemask: LONGINT): LONGINT - "__sigsetjmp(env, savemask)"; - - PROCEDURE -siglongjmp*(VAR env:Unix.JmpBuf; val: LONGINT) - "siglongjmp(env, val)"; - - PROCEDURE -heapsize*(): LONGINT - "SYSTEM_heapsize"; - - PROCEDURE -allocated*(): LONGINT - "SYSTEM_allocated"; - - PROCEDURE -localtime(VAR clock: LONGINT): RealTime - "(Kernel_RealTime)localtime(clock)"; - - PROCEDURE -malloc*(size: LONGINT): LONGINT - "(LONGINT)malloc(size)"; - - PROCEDURE -free*(adr: LONGINT) - "(void)free(adr)"; - - PROCEDURE -getcwd(VAR cwd: Unix.Name) - "getcwd(cwd, cwd__len)"; - - - PROCEDURE GetClock* (VAR t, d: LONGINT); - VAR tv: Unix.Timeval; tz: Unix.Timezone; time: RealTime; - l : LONGINT; - BEGIN - l := Unix.Gettimeofday(tv, tz); - time := localtime(tv.sec); - t := time.sec + ASH(time.min, 6) + ASH(time.hour, 12); - d := time.mday + ASH(time.mon+1, 5) + ASH(time.year MOD 100, 9); - END GetClock; - - PROCEDURE SetClock* (t, d: LONGINT); - VAR err: ARRAY 25 OF CHAR; - BEGIN err := "not yet implemented"; HALT(99) - END SetClock; - - PROCEDURE Time*(): LONGINT; - VAR timeval: Unix.Timeval; timezone: Unix.Timezone; - l : LONGINT; - BEGIN - l := Unix.Gettimeofday(timeval, timezone); - RETURN (timeval.usec DIV 1000 + timeval.sec * 1000 - timeStart) MOD 7FFFFFFFH - END Time; - -(* - PROCEDURE UserTime*(): LONGINT; - VAR rusage: Unix.Rusage; - BEGIN - Unix.Getrusage(0, S.ADR(rusage)); - RETURN rusage.utime.sec*1000 + rusage.utime.usec DIV 1000 - (* + rusage.stime.sec*1000 + rusage.stime.usec DIV 1000*) - END UserTime; -*) - - PROCEDURE Select*(delay: LONGINT); - VAR rs, ws, xs: Unix.FdSet; n: LONGINT; tv: Unix.Timeval; - BEGIN - rs := readSet; - FOR n := 0 TO 7 DO ws[n] := {}; xs[n] := {}; readySet[n] := {} END; - IF delay < 0 THEN delay := 0 END ; - tv.sec := delay DIV 1000; tv.usec := delay MOD 1000 * 1000; - n := Unix.Select(256, rs, ws, xs, tv); - IF n >= 0 THEN readySet := rs END - END Select; - - PROCEDURE -GC*(markStack: BOOLEAN) - "SYSTEM_GC(markStack)"; - - PROCEDURE -RegisterObject*(obj: SYSTEM.PTR; finalize: ObjFinalizer) - "SYSTEM_REGFIN(obj, finalize)"; - - PROCEDURE -SetHalt*(p: PROCEDURE(n: LONGINT)) - "SYSTEM_Halt = p"; - - PROCEDURE InstallTermHandler*(p: PROCEDURE); - (* not yet supported; no Modules.Free *) - END InstallTermHandler; - - PROCEDURE LargestAvailable*(): LONGINT; - BEGIN - (* dummy proc for System 3 compatibility - no meaningful value except may be the remaining swap space can be returned - in the context of an extensible heap *) - RETURN MAX(LONGINT) - END LargestAvailable; - - PROCEDURE Halt(n: LONGINT); - VAR res: LONGINT; - BEGIN res := Unix.Kill(Unix.Getpid(), 4); - END Halt; - - PROCEDURE EndianTest; - VAR i: LONGINT; dmy: INTEGER; - BEGIN - dmy := 1; i := SYSTEM.ADR(dmy); - SYSTEM.GET(i, littleEndian); (* indirection via i avoids warning on SUN cc -O *) - END EndianTest; - - PROCEDURE -SizeofUnixJmpBuf(): INTEGER - "sizeof(Unix_JmpBuf)"; - - PROCEDURE -SizeofSigJmpBuf(): INTEGER - "sizeof(sigjmp_buf)"; - - PROCEDURE -Error(msg: ARRAY OF CHAR; len: INTEGER) - "write(1/*stdout*/, msg, len); char ch = 0xa; write(1, &ch, 1)"; - - PROCEDURE JmpBufCheck; (* check for inconsistent usage of sigjmp_buf *) - VAR x, y: LONGINT; - BEGIN - x := SizeofUnixJmpBuf(); - y := SizeofSigJmpBuf(); - IF x < y THEN - Error("Kernel.JmpBufCheck: inconsistent usage of sigjmp_buf", 52); - Exit(1); - END - END JmpBufCheck; - -BEGIN - EndianTest(); - SetHalt(Halt); - CWD := ""; OBERON := "."; LIB := ""; - getcwd(CWD); - Args.GetEnv("OBERON", OBERON); - Args.GetEnv("OBERON_LIB", LIB); - TimeUnit := 1000; timeStart := 0; timeStart := Time(); - JmpBufCheck() -END Kernel. From c374e343afd8e99735e4d86f85fc006291ddfb84 Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 16 Jun 2016 12:36:03 +0100 Subject: [PATCH 063/580] Rename system files to v2 conventions. --- src/system/{Files0.Mod => Files.Mod} | 0 src/system/{SYSTEM.Mod => Heap.Mod} | 0 src/system/{Unix.Mod => Platformunix.Mod} | 0 src/system/{SYSTEM.c0 => SYSTEM.c} | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename src/system/{Files0.Mod => Files.Mod} (100%) rename src/system/{SYSTEM.Mod => Heap.Mod} (100%) rename src/system/{Unix.Mod => Platformunix.Mod} (100%) rename src/system/{SYSTEM.c0 => SYSTEM.c} (100%) diff --git a/src/system/Files0.Mod b/src/system/Files.Mod similarity index 100% rename from src/system/Files0.Mod rename to src/system/Files.Mod diff --git a/src/system/SYSTEM.Mod b/src/system/Heap.Mod similarity index 100% rename from src/system/SYSTEM.Mod rename to src/system/Heap.Mod diff --git a/src/system/Unix.Mod b/src/system/Platformunix.Mod similarity index 100% rename from src/system/Unix.Mod rename to src/system/Platformunix.Mod diff --git a/src/system/SYSTEM.c0 b/src/system/SYSTEM.c similarity index 100% rename from src/system/SYSTEM.c0 rename to src/system/SYSTEM.c From 6a1b2f4967f5b845bf7c4545e79b61308108d9fd Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 16 Jun 2016 12:42:49 +0100 Subject: [PATCH 064/580] Consolidate ooc library files. --- .../ooc/linux/clang/armv6j_hardfp/oocC.Mod | 72 ------------------- src/lib/ooc/linux/clang/powerpc/oocC.Mod | 72 ------------------- src/lib/ooc/linux/clang/x86/oocC.Mod | 72 ------------------- src/lib/ooc/linux/clang/x86_64/oocC.Mod | 71 ------------------ src/lib/ooc/linux/gcc/armv6j/oocC.Mod | 72 ------------------- src/lib/ooc/linux/gcc/armv6j_hardfp/oocC.Mod | 72 ------------------- src/lib/ooc/linux/gcc/powerpc/oocC.Mod | 72 ------------------- src/lib/ooc/linux/gcc/x86/oocC.Mod | 72 ------------------- src/lib/ooc/linux/gcc/x86_64/oocC.Mod | 71 ------------------ .../clang/armv6j/oocC.Mod => oocCILP32.Mod} | 0 .../clang/x86_64/oocC.Mod => oocCLLP64.Mod} | 0 .../clang/x86_64/oocC.Mod => oocCLP64.Mod} | 0 src/lib/ooc/openbsd/gcc/x86_64/oocC.Mod | 71 ------------------ 13 files changed, 717 deletions(-) delete mode 100644 src/lib/ooc/linux/clang/armv6j_hardfp/oocC.Mod delete mode 100644 src/lib/ooc/linux/clang/powerpc/oocC.Mod delete mode 100644 src/lib/ooc/linux/clang/x86/oocC.Mod delete mode 100644 src/lib/ooc/linux/clang/x86_64/oocC.Mod delete mode 100644 src/lib/ooc/linux/gcc/armv6j/oocC.Mod delete mode 100644 src/lib/ooc/linux/gcc/armv6j_hardfp/oocC.Mod delete mode 100644 src/lib/ooc/linux/gcc/powerpc/oocC.Mod delete mode 100644 src/lib/ooc/linux/gcc/x86/oocC.Mod delete mode 100644 src/lib/ooc/linux/gcc/x86_64/oocC.Mod rename src/lib/ooc/{linux/clang/armv6j/oocC.Mod => oocCILP32.Mod} (100%) rename src/lib/ooc/{darwin/clang/x86_64/oocC.Mod => oocCLLP64.Mod} (100%) rename src/lib/ooc/{freebsd/clang/x86_64/oocC.Mod => oocCLP64.Mod} (100%) delete mode 100644 src/lib/ooc/openbsd/gcc/x86_64/oocC.Mod diff --git a/src/lib/ooc/linux/clang/armv6j_hardfp/oocC.Mod b/src/lib/ooc/linux/clang/armv6j_hardfp/oocC.Mod deleted file mode 100644 index 2e7751ff..00000000 --- a/src/lib/ooc/linux/clang/armv6j_hardfp/oocC.Mod +++ /dev/null @@ -1,72 +0,0 @@ -(* $Id: C.Mod,v 1.9 1999/10/03 11:46:01 ooc-devel Exp $ *) -MODULE oocC; -(* Basic data types for interfacing to C code. - Copyright (C) 1997-1998 Michael van Acken - - This module is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public License - as published by the Free Software Foundation; either version 2 of - the License, or (at your option) any later version. - - This module is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with OOC. If not, write to the Free Software Foundation, - 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*) - -IMPORT - SYSTEM; - -(* -These types are intended to be equivalent to their C counterparts. -They may vary depending on your system, but as long as you stick to a 32 Bit -Unix they should be fairly safe. -*) - -TYPE - char* = CHAR; - signedchar* = SHORTINT; (* signed char *) - shortint* = INTEGER; (* short int *) - int* = LONGINT; - set* = SET; (* unsigned int, used as set *) - longint* = LONGINT; (* long int *) - (*longset* = SYSTEM.SET64; *) (* unsigned long, used as set *) - longset* = SET; - address* = LONGINT; - float* = REAL; - double* = LONGREAL; - - enum1* = int; - enum2* = int; - enum4* = int; - - (* if your C compiler uses short enumerations, you'll have to replace the - declarations above with - enum1* = SHORTINT; - enum2* = INTEGER; - enum4* = LONGINT; - *) - - FILE* = address; (* this is acually a replacement for `FILE*', i.e., for a pointer type *) - sizet* = longint; - uidt* = int; - gidt* = int; - - -TYPE (* some commonly used C array types *) - charPtr1d* = POINTER TO ARRAY OF char; - charPtr2d* = POINTER TO ARRAY OF charPtr1d; - intPtr1d* = POINTER TO ARRAY OF int; - -TYPE (* C string type, assignment compatible with character arrays and - string constants *) - string* = POINTER TO ARRAY OF char; - -TYPE - Proc* = PROCEDURE; - -END oocC. diff --git a/src/lib/ooc/linux/clang/powerpc/oocC.Mod b/src/lib/ooc/linux/clang/powerpc/oocC.Mod deleted file mode 100644 index 2e7751ff..00000000 --- a/src/lib/ooc/linux/clang/powerpc/oocC.Mod +++ /dev/null @@ -1,72 +0,0 @@ -(* $Id: C.Mod,v 1.9 1999/10/03 11:46:01 ooc-devel Exp $ *) -MODULE oocC; -(* Basic data types for interfacing to C code. - Copyright (C) 1997-1998 Michael van Acken - - This module is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public License - as published by the Free Software Foundation; either version 2 of - the License, or (at your option) any later version. - - This module is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with OOC. If not, write to the Free Software Foundation, - 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*) - -IMPORT - SYSTEM; - -(* -These types are intended to be equivalent to their C counterparts. -They may vary depending on your system, but as long as you stick to a 32 Bit -Unix they should be fairly safe. -*) - -TYPE - char* = CHAR; - signedchar* = SHORTINT; (* signed char *) - shortint* = INTEGER; (* short int *) - int* = LONGINT; - set* = SET; (* unsigned int, used as set *) - longint* = LONGINT; (* long int *) - (*longset* = SYSTEM.SET64; *) (* unsigned long, used as set *) - longset* = SET; - address* = LONGINT; - float* = REAL; - double* = LONGREAL; - - enum1* = int; - enum2* = int; - enum4* = int; - - (* if your C compiler uses short enumerations, you'll have to replace the - declarations above with - enum1* = SHORTINT; - enum2* = INTEGER; - enum4* = LONGINT; - *) - - FILE* = address; (* this is acually a replacement for `FILE*', i.e., for a pointer type *) - sizet* = longint; - uidt* = int; - gidt* = int; - - -TYPE (* some commonly used C array types *) - charPtr1d* = POINTER TO ARRAY OF char; - charPtr2d* = POINTER TO ARRAY OF charPtr1d; - intPtr1d* = POINTER TO ARRAY OF int; - -TYPE (* C string type, assignment compatible with character arrays and - string constants *) - string* = POINTER TO ARRAY OF char; - -TYPE - Proc* = PROCEDURE; - -END oocC. diff --git a/src/lib/ooc/linux/clang/x86/oocC.Mod b/src/lib/ooc/linux/clang/x86/oocC.Mod deleted file mode 100644 index 2e7751ff..00000000 --- a/src/lib/ooc/linux/clang/x86/oocC.Mod +++ /dev/null @@ -1,72 +0,0 @@ -(* $Id: C.Mod,v 1.9 1999/10/03 11:46:01 ooc-devel Exp $ *) -MODULE oocC; -(* Basic data types for interfacing to C code. - Copyright (C) 1997-1998 Michael van Acken - - This module is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public License - as published by the Free Software Foundation; either version 2 of - the License, or (at your option) any later version. - - This module is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with OOC. If not, write to the Free Software Foundation, - 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*) - -IMPORT - SYSTEM; - -(* -These types are intended to be equivalent to their C counterparts. -They may vary depending on your system, but as long as you stick to a 32 Bit -Unix they should be fairly safe. -*) - -TYPE - char* = CHAR; - signedchar* = SHORTINT; (* signed char *) - shortint* = INTEGER; (* short int *) - int* = LONGINT; - set* = SET; (* unsigned int, used as set *) - longint* = LONGINT; (* long int *) - (*longset* = SYSTEM.SET64; *) (* unsigned long, used as set *) - longset* = SET; - address* = LONGINT; - float* = REAL; - double* = LONGREAL; - - enum1* = int; - enum2* = int; - enum4* = int; - - (* if your C compiler uses short enumerations, you'll have to replace the - declarations above with - enum1* = SHORTINT; - enum2* = INTEGER; - enum4* = LONGINT; - *) - - FILE* = address; (* this is acually a replacement for `FILE*', i.e., for a pointer type *) - sizet* = longint; - uidt* = int; - gidt* = int; - - -TYPE (* some commonly used C array types *) - charPtr1d* = POINTER TO ARRAY OF char; - charPtr2d* = POINTER TO ARRAY OF charPtr1d; - intPtr1d* = POINTER TO ARRAY OF int; - -TYPE (* C string type, assignment compatible with character arrays and - string constants *) - string* = POINTER TO ARRAY OF char; - -TYPE - Proc* = PROCEDURE; - -END oocC. diff --git a/src/lib/ooc/linux/clang/x86_64/oocC.Mod b/src/lib/ooc/linux/clang/x86_64/oocC.Mod deleted file mode 100644 index 14638e75..00000000 --- a/src/lib/ooc/linux/clang/x86_64/oocC.Mod +++ /dev/null @@ -1,71 +0,0 @@ -(* $Id: C.Mod,v 1.9 1999/10/03 11:46:01 ooc-devel Exp $ *) -MODULE oocC; -(* Basic data types for interfacing to C code. - Copyright (C) 1997-1998 Michael van Acken - - This module is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public License - as published by the Free Software Foundation; either version 2 of - the License, or (at your option) any later version. - - This module is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with OOC. If not, write to the Free Software Foundation, - 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*) - -IMPORT - SYSTEM; - -(* -These types are intended to be equivalent to their C counterparts. -They may vary depending on your system, but as long as you stick to a 32 Bit -Unix they should be fairly safe. -*) - -TYPE - char* = CHAR; - signedchar* = SHORTINT; (* signed char *) - shortint* = RECORD a,b : SYSTEM.BYTE END; (* 2 bytes on x64_64 *) (* short int *) - int* = INTEGER; - set* = INTEGER;(*SET;*) (* unsigned int, used as set *) - longint* = LONGINT; (* long int *) - longset* = SET; (*SYSTEM.SET64; *) (* unsigned long, used as set *) - address* = LONGINT; (*SYSTEM.ADDRESS;*) - float* = REAL; - double* = LONGREAL; - - enum1* = int; - enum2* = int; - enum4* = int; - - (* if your C compiler uses short enumerations, you'll have to replace the - declarations above with - enum1* = SHORTINT; - enum2* = INTEGER; - enum4* = LONGINT; - *) - - FILE* = address; (* this is acually a replacement for `FILE*', i.e., for a pointer type *) - sizet* = longint; - uidt* = int; - gidt* = int; - - -TYPE (* some commonly used C array types *) - charPtr1d* = POINTER TO ARRAY OF char; - charPtr2d* = POINTER TO ARRAY OF charPtr1d; - intPtr1d* = POINTER TO ARRAY OF int; - -TYPE (* C string type, assignment compatible with character arrays and - string constants *) - string* = POINTER (*[CSTRING]*) TO ARRAY OF char; - -TYPE - Proc* = PROCEDURE; - -END oocC. diff --git a/src/lib/ooc/linux/gcc/armv6j/oocC.Mod b/src/lib/ooc/linux/gcc/armv6j/oocC.Mod deleted file mode 100644 index 2e7751ff..00000000 --- a/src/lib/ooc/linux/gcc/armv6j/oocC.Mod +++ /dev/null @@ -1,72 +0,0 @@ -(* $Id: C.Mod,v 1.9 1999/10/03 11:46:01 ooc-devel Exp $ *) -MODULE oocC; -(* Basic data types for interfacing to C code. - Copyright (C) 1997-1998 Michael van Acken - - This module is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public License - as published by the Free Software Foundation; either version 2 of - the License, or (at your option) any later version. - - This module is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with OOC. If not, write to the Free Software Foundation, - 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*) - -IMPORT - SYSTEM; - -(* -These types are intended to be equivalent to their C counterparts. -They may vary depending on your system, but as long as you stick to a 32 Bit -Unix they should be fairly safe. -*) - -TYPE - char* = CHAR; - signedchar* = SHORTINT; (* signed char *) - shortint* = INTEGER; (* short int *) - int* = LONGINT; - set* = SET; (* unsigned int, used as set *) - longint* = LONGINT; (* long int *) - (*longset* = SYSTEM.SET64; *) (* unsigned long, used as set *) - longset* = SET; - address* = LONGINT; - float* = REAL; - double* = LONGREAL; - - enum1* = int; - enum2* = int; - enum4* = int; - - (* if your C compiler uses short enumerations, you'll have to replace the - declarations above with - enum1* = SHORTINT; - enum2* = INTEGER; - enum4* = LONGINT; - *) - - FILE* = address; (* this is acually a replacement for `FILE*', i.e., for a pointer type *) - sizet* = longint; - uidt* = int; - gidt* = int; - - -TYPE (* some commonly used C array types *) - charPtr1d* = POINTER TO ARRAY OF char; - charPtr2d* = POINTER TO ARRAY OF charPtr1d; - intPtr1d* = POINTER TO ARRAY OF int; - -TYPE (* C string type, assignment compatible with character arrays and - string constants *) - string* = POINTER TO ARRAY OF char; - -TYPE - Proc* = PROCEDURE; - -END oocC. diff --git a/src/lib/ooc/linux/gcc/armv6j_hardfp/oocC.Mod b/src/lib/ooc/linux/gcc/armv6j_hardfp/oocC.Mod deleted file mode 100644 index 2e7751ff..00000000 --- a/src/lib/ooc/linux/gcc/armv6j_hardfp/oocC.Mod +++ /dev/null @@ -1,72 +0,0 @@ -(* $Id: C.Mod,v 1.9 1999/10/03 11:46:01 ooc-devel Exp $ *) -MODULE oocC; -(* Basic data types for interfacing to C code. - Copyright (C) 1997-1998 Michael van Acken - - This module is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public License - as published by the Free Software Foundation; either version 2 of - the License, or (at your option) any later version. - - This module is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with OOC. If not, write to the Free Software Foundation, - 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*) - -IMPORT - SYSTEM; - -(* -These types are intended to be equivalent to their C counterparts. -They may vary depending on your system, but as long as you stick to a 32 Bit -Unix they should be fairly safe. -*) - -TYPE - char* = CHAR; - signedchar* = SHORTINT; (* signed char *) - shortint* = INTEGER; (* short int *) - int* = LONGINT; - set* = SET; (* unsigned int, used as set *) - longint* = LONGINT; (* long int *) - (*longset* = SYSTEM.SET64; *) (* unsigned long, used as set *) - longset* = SET; - address* = LONGINT; - float* = REAL; - double* = LONGREAL; - - enum1* = int; - enum2* = int; - enum4* = int; - - (* if your C compiler uses short enumerations, you'll have to replace the - declarations above with - enum1* = SHORTINT; - enum2* = INTEGER; - enum4* = LONGINT; - *) - - FILE* = address; (* this is acually a replacement for `FILE*', i.e., for a pointer type *) - sizet* = longint; - uidt* = int; - gidt* = int; - - -TYPE (* some commonly used C array types *) - charPtr1d* = POINTER TO ARRAY OF char; - charPtr2d* = POINTER TO ARRAY OF charPtr1d; - intPtr1d* = POINTER TO ARRAY OF int; - -TYPE (* C string type, assignment compatible with character arrays and - string constants *) - string* = POINTER TO ARRAY OF char; - -TYPE - Proc* = PROCEDURE; - -END oocC. diff --git a/src/lib/ooc/linux/gcc/powerpc/oocC.Mod b/src/lib/ooc/linux/gcc/powerpc/oocC.Mod deleted file mode 100644 index 2e7751ff..00000000 --- a/src/lib/ooc/linux/gcc/powerpc/oocC.Mod +++ /dev/null @@ -1,72 +0,0 @@ -(* $Id: C.Mod,v 1.9 1999/10/03 11:46:01 ooc-devel Exp $ *) -MODULE oocC; -(* Basic data types for interfacing to C code. - Copyright (C) 1997-1998 Michael van Acken - - This module is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public License - as published by the Free Software Foundation; either version 2 of - the License, or (at your option) any later version. - - This module is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with OOC. If not, write to the Free Software Foundation, - 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*) - -IMPORT - SYSTEM; - -(* -These types are intended to be equivalent to their C counterparts. -They may vary depending on your system, but as long as you stick to a 32 Bit -Unix they should be fairly safe. -*) - -TYPE - char* = CHAR; - signedchar* = SHORTINT; (* signed char *) - shortint* = INTEGER; (* short int *) - int* = LONGINT; - set* = SET; (* unsigned int, used as set *) - longint* = LONGINT; (* long int *) - (*longset* = SYSTEM.SET64; *) (* unsigned long, used as set *) - longset* = SET; - address* = LONGINT; - float* = REAL; - double* = LONGREAL; - - enum1* = int; - enum2* = int; - enum4* = int; - - (* if your C compiler uses short enumerations, you'll have to replace the - declarations above with - enum1* = SHORTINT; - enum2* = INTEGER; - enum4* = LONGINT; - *) - - FILE* = address; (* this is acually a replacement for `FILE*', i.e., for a pointer type *) - sizet* = longint; - uidt* = int; - gidt* = int; - - -TYPE (* some commonly used C array types *) - charPtr1d* = POINTER TO ARRAY OF char; - charPtr2d* = POINTER TO ARRAY OF charPtr1d; - intPtr1d* = POINTER TO ARRAY OF int; - -TYPE (* C string type, assignment compatible with character arrays and - string constants *) - string* = POINTER TO ARRAY OF char; - -TYPE - Proc* = PROCEDURE; - -END oocC. diff --git a/src/lib/ooc/linux/gcc/x86/oocC.Mod b/src/lib/ooc/linux/gcc/x86/oocC.Mod deleted file mode 100644 index 2e7751ff..00000000 --- a/src/lib/ooc/linux/gcc/x86/oocC.Mod +++ /dev/null @@ -1,72 +0,0 @@ -(* $Id: C.Mod,v 1.9 1999/10/03 11:46:01 ooc-devel Exp $ *) -MODULE oocC; -(* Basic data types for interfacing to C code. - Copyright (C) 1997-1998 Michael van Acken - - This module is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public License - as published by the Free Software Foundation; either version 2 of - the License, or (at your option) any later version. - - This module is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with OOC. If not, write to the Free Software Foundation, - 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*) - -IMPORT - SYSTEM; - -(* -These types are intended to be equivalent to their C counterparts. -They may vary depending on your system, but as long as you stick to a 32 Bit -Unix they should be fairly safe. -*) - -TYPE - char* = CHAR; - signedchar* = SHORTINT; (* signed char *) - shortint* = INTEGER; (* short int *) - int* = LONGINT; - set* = SET; (* unsigned int, used as set *) - longint* = LONGINT; (* long int *) - (*longset* = SYSTEM.SET64; *) (* unsigned long, used as set *) - longset* = SET; - address* = LONGINT; - float* = REAL; - double* = LONGREAL; - - enum1* = int; - enum2* = int; - enum4* = int; - - (* if your C compiler uses short enumerations, you'll have to replace the - declarations above with - enum1* = SHORTINT; - enum2* = INTEGER; - enum4* = LONGINT; - *) - - FILE* = address; (* this is acually a replacement for `FILE*', i.e., for a pointer type *) - sizet* = longint; - uidt* = int; - gidt* = int; - - -TYPE (* some commonly used C array types *) - charPtr1d* = POINTER TO ARRAY OF char; - charPtr2d* = POINTER TO ARRAY OF charPtr1d; - intPtr1d* = POINTER TO ARRAY OF int; - -TYPE (* C string type, assignment compatible with character arrays and - string constants *) - string* = POINTER TO ARRAY OF char; - -TYPE - Proc* = PROCEDURE; - -END oocC. diff --git a/src/lib/ooc/linux/gcc/x86_64/oocC.Mod b/src/lib/ooc/linux/gcc/x86_64/oocC.Mod deleted file mode 100644 index 14638e75..00000000 --- a/src/lib/ooc/linux/gcc/x86_64/oocC.Mod +++ /dev/null @@ -1,71 +0,0 @@ -(* $Id: C.Mod,v 1.9 1999/10/03 11:46:01 ooc-devel Exp $ *) -MODULE oocC; -(* Basic data types for interfacing to C code. - Copyright (C) 1997-1998 Michael van Acken - - This module is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public License - as published by the Free Software Foundation; either version 2 of - the License, or (at your option) any later version. - - This module is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with OOC. If not, write to the Free Software Foundation, - 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*) - -IMPORT - SYSTEM; - -(* -These types are intended to be equivalent to their C counterparts. -They may vary depending on your system, but as long as you stick to a 32 Bit -Unix they should be fairly safe. -*) - -TYPE - char* = CHAR; - signedchar* = SHORTINT; (* signed char *) - shortint* = RECORD a,b : SYSTEM.BYTE END; (* 2 bytes on x64_64 *) (* short int *) - int* = INTEGER; - set* = INTEGER;(*SET;*) (* unsigned int, used as set *) - longint* = LONGINT; (* long int *) - longset* = SET; (*SYSTEM.SET64; *) (* unsigned long, used as set *) - address* = LONGINT; (*SYSTEM.ADDRESS;*) - float* = REAL; - double* = LONGREAL; - - enum1* = int; - enum2* = int; - enum4* = int; - - (* if your C compiler uses short enumerations, you'll have to replace the - declarations above with - enum1* = SHORTINT; - enum2* = INTEGER; - enum4* = LONGINT; - *) - - FILE* = address; (* this is acually a replacement for `FILE*', i.e., for a pointer type *) - sizet* = longint; - uidt* = int; - gidt* = int; - - -TYPE (* some commonly used C array types *) - charPtr1d* = POINTER TO ARRAY OF char; - charPtr2d* = POINTER TO ARRAY OF charPtr1d; - intPtr1d* = POINTER TO ARRAY OF int; - -TYPE (* C string type, assignment compatible with character arrays and - string constants *) - string* = POINTER (*[CSTRING]*) TO ARRAY OF char; - -TYPE - Proc* = PROCEDURE; - -END oocC. diff --git a/src/lib/ooc/linux/clang/armv6j/oocC.Mod b/src/lib/ooc/oocCILP32.Mod similarity index 100% rename from src/lib/ooc/linux/clang/armv6j/oocC.Mod rename to src/lib/ooc/oocCILP32.Mod diff --git a/src/lib/ooc/darwin/clang/x86_64/oocC.Mod b/src/lib/ooc/oocCLLP64.Mod similarity index 100% rename from src/lib/ooc/darwin/clang/x86_64/oocC.Mod rename to src/lib/ooc/oocCLLP64.Mod diff --git a/src/lib/ooc/freebsd/clang/x86_64/oocC.Mod b/src/lib/ooc/oocCLP64.Mod similarity index 100% rename from src/lib/ooc/freebsd/clang/x86_64/oocC.Mod rename to src/lib/ooc/oocCLP64.Mod diff --git a/src/lib/ooc/openbsd/gcc/x86_64/oocC.Mod b/src/lib/ooc/openbsd/gcc/x86_64/oocC.Mod deleted file mode 100644 index 14638e75..00000000 --- a/src/lib/ooc/openbsd/gcc/x86_64/oocC.Mod +++ /dev/null @@ -1,71 +0,0 @@ -(* $Id: C.Mod,v 1.9 1999/10/03 11:46:01 ooc-devel Exp $ *) -MODULE oocC; -(* Basic data types for interfacing to C code. - Copyright (C) 1997-1998 Michael van Acken - - This module is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public License - as published by the Free Software Foundation; either version 2 of - the License, or (at your option) any later version. - - This module is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with OOC. If not, write to the Free Software Foundation, - 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*) - -IMPORT - SYSTEM; - -(* -These types are intended to be equivalent to their C counterparts. -They may vary depending on your system, but as long as you stick to a 32 Bit -Unix they should be fairly safe. -*) - -TYPE - char* = CHAR; - signedchar* = SHORTINT; (* signed char *) - shortint* = RECORD a,b : SYSTEM.BYTE END; (* 2 bytes on x64_64 *) (* short int *) - int* = INTEGER; - set* = INTEGER;(*SET;*) (* unsigned int, used as set *) - longint* = LONGINT; (* long int *) - longset* = SET; (*SYSTEM.SET64; *) (* unsigned long, used as set *) - address* = LONGINT; (*SYSTEM.ADDRESS;*) - float* = REAL; - double* = LONGREAL; - - enum1* = int; - enum2* = int; - enum4* = int; - - (* if your C compiler uses short enumerations, you'll have to replace the - declarations above with - enum1* = SHORTINT; - enum2* = INTEGER; - enum4* = LONGINT; - *) - - FILE* = address; (* this is acually a replacement for `FILE*', i.e., for a pointer type *) - sizet* = longint; - uidt* = int; - gidt* = int; - - -TYPE (* some commonly used C array types *) - charPtr1d* = POINTER TO ARRAY OF char; - charPtr2d* = POINTER TO ARRAY OF charPtr1d; - intPtr1d* = POINTER TO ARRAY OF int; - -TYPE (* C string type, assignment compatible with character arrays and - string constants *) - string* = POINTER (*[CSTRING]*) TO ARRAY OF char; - -TYPE - Proc* = PROCEDURE; - -END oocC. From 9021308e47151def4834a4b86fdbd954a9b6656b Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 16 Jun 2016 12:46:51 +0100 Subject: [PATCH 065/580] Consolidate ooc2 library files. --- src/lib/ooc2/freebsd/clang/oocwrapperlibc.Mod | 34 ------------------- src/lib/ooc2/linux/clang/oocwrapperlibc.Mod | 34 ------------------- src/lib/ooc2/linux/gcc/oocwrapperlibc.Mod | 34 ------------------- .../{darwin/clang => }/oocwrapperlibc.Mod | 0 src/lib/ooc2/openbsd/gcc/oocwrapperlibc.Mod | 34 ------------------- 5 files changed, 136 deletions(-) delete mode 100644 src/lib/ooc2/freebsd/clang/oocwrapperlibc.Mod delete mode 100644 src/lib/ooc2/linux/clang/oocwrapperlibc.Mod delete mode 100644 src/lib/ooc2/linux/gcc/oocwrapperlibc.Mod rename src/lib/ooc2/{darwin/clang => }/oocwrapperlibc.Mod (100%) delete mode 100644 src/lib/ooc2/openbsd/gcc/oocwrapperlibc.Mod diff --git a/src/lib/ooc2/freebsd/clang/oocwrapperlibc.Mod b/src/lib/ooc2/freebsd/clang/oocwrapperlibc.Mod deleted file mode 100644 index 0d0cf9b6..00000000 --- a/src/lib/ooc2/freebsd/clang/oocwrapperlibc.Mod +++ /dev/null @@ -1,34 +0,0 @@ -MODULE oocwrapperlibc; -IMPORT SYSTEM; -PROCEDURE -includeStdio() - "#include "; - -PROCEDURE -sys(str: ARRAY OF CHAR): INTEGER - "system(str)"; - -PROCEDURE system*(cmd : ARRAY OF CHAR); -VAR r : INTEGER; -BEGIN -r := sys(cmd); -END system; -(* -PROCEDURE strtod* (string: C.address; - VAR tailptr: C.charPtr1d): C.double; -PROCEDURE strtof* (string: C.address; - VAR tailptr: C.charPtr1d): C.float; -PROCEDURE sscanf* (s: C.address; template: ARRAY OF CHAR; ...) : C.int; -*) - -PROCEDURE -sprntf(s, t0, t1, t2: ARRAY OF CHAR): INTEGER - "sprintf(s, t0, t1, t2)"; - -PROCEDURE sprintf* (VAR s: ARRAY OF CHAR; template0: ARRAY OF CHAR; template1: ARRAY OF CHAR; template2: ARRAY OF CHAR); -VAR r : INTEGER; -BEGIN - r := sprntf (s, template0, template1, template2); -END sprintf; - -BEGIN - - -END oocwrapperlibc. diff --git a/src/lib/ooc2/linux/clang/oocwrapperlibc.Mod b/src/lib/ooc2/linux/clang/oocwrapperlibc.Mod deleted file mode 100644 index 0d0cf9b6..00000000 --- a/src/lib/ooc2/linux/clang/oocwrapperlibc.Mod +++ /dev/null @@ -1,34 +0,0 @@ -MODULE oocwrapperlibc; -IMPORT SYSTEM; -PROCEDURE -includeStdio() - "#include "; - -PROCEDURE -sys(str: ARRAY OF CHAR): INTEGER - "system(str)"; - -PROCEDURE system*(cmd : ARRAY OF CHAR); -VAR r : INTEGER; -BEGIN -r := sys(cmd); -END system; -(* -PROCEDURE strtod* (string: C.address; - VAR tailptr: C.charPtr1d): C.double; -PROCEDURE strtof* (string: C.address; - VAR tailptr: C.charPtr1d): C.float; -PROCEDURE sscanf* (s: C.address; template: ARRAY OF CHAR; ...) : C.int; -*) - -PROCEDURE -sprntf(s, t0, t1, t2: ARRAY OF CHAR): INTEGER - "sprintf(s, t0, t1, t2)"; - -PROCEDURE sprintf* (VAR s: ARRAY OF CHAR; template0: ARRAY OF CHAR; template1: ARRAY OF CHAR; template2: ARRAY OF CHAR); -VAR r : INTEGER; -BEGIN - r := sprntf (s, template0, template1, template2); -END sprintf; - -BEGIN - - -END oocwrapperlibc. diff --git a/src/lib/ooc2/linux/gcc/oocwrapperlibc.Mod b/src/lib/ooc2/linux/gcc/oocwrapperlibc.Mod deleted file mode 100644 index 0d0cf9b6..00000000 --- a/src/lib/ooc2/linux/gcc/oocwrapperlibc.Mod +++ /dev/null @@ -1,34 +0,0 @@ -MODULE oocwrapperlibc; -IMPORT SYSTEM; -PROCEDURE -includeStdio() - "#include "; - -PROCEDURE -sys(str: ARRAY OF CHAR): INTEGER - "system(str)"; - -PROCEDURE system*(cmd : ARRAY OF CHAR); -VAR r : INTEGER; -BEGIN -r := sys(cmd); -END system; -(* -PROCEDURE strtod* (string: C.address; - VAR tailptr: C.charPtr1d): C.double; -PROCEDURE strtof* (string: C.address; - VAR tailptr: C.charPtr1d): C.float; -PROCEDURE sscanf* (s: C.address; template: ARRAY OF CHAR; ...) : C.int; -*) - -PROCEDURE -sprntf(s, t0, t1, t2: ARRAY OF CHAR): INTEGER - "sprintf(s, t0, t1, t2)"; - -PROCEDURE sprintf* (VAR s: ARRAY OF CHAR; template0: ARRAY OF CHAR; template1: ARRAY OF CHAR; template2: ARRAY OF CHAR); -VAR r : INTEGER; -BEGIN - r := sprntf (s, template0, template1, template2); -END sprintf; - -BEGIN - - -END oocwrapperlibc. diff --git a/src/lib/ooc2/darwin/clang/oocwrapperlibc.Mod b/src/lib/ooc2/oocwrapperlibc.Mod similarity index 100% rename from src/lib/ooc2/darwin/clang/oocwrapperlibc.Mod rename to src/lib/ooc2/oocwrapperlibc.Mod diff --git a/src/lib/ooc2/openbsd/gcc/oocwrapperlibc.Mod b/src/lib/ooc2/openbsd/gcc/oocwrapperlibc.Mod deleted file mode 100644 index 0d0cf9b6..00000000 --- a/src/lib/ooc2/openbsd/gcc/oocwrapperlibc.Mod +++ /dev/null @@ -1,34 +0,0 @@ -MODULE oocwrapperlibc; -IMPORT SYSTEM; -PROCEDURE -includeStdio() - "#include "; - -PROCEDURE -sys(str: ARRAY OF CHAR): INTEGER - "system(str)"; - -PROCEDURE system*(cmd : ARRAY OF CHAR); -VAR r : INTEGER; -BEGIN -r := sys(cmd); -END system; -(* -PROCEDURE strtod* (string: C.address; - VAR tailptr: C.charPtr1d): C.double; -PROCEDURE strtof* (string: C.address; - VAR tailptr: C.charPtr1d): C.float; -PROCEDURE sscanf* (s: C.address; template: ARRAY OF CHAR; ...) : C.int; -*) - -PROCEDURE -sprntf(s, t0, t1, t2: ARRAY OF CHAR): INTEGER - "sprintf(s, t0, t1, t2)"; - -PROCEDURE sprintf* (VAR s: ARRAY OF CHAR; template0: ARRAY OF CHAR; template1: ARRAY OF CHAR; template2: ARRAY OF CHAR); -VAR r : INTEGER; -BEGIN - r := sprntf (s, template0, template1, template2); -END sprintf; - -BEGIN - - -END oocwrapperlibc. From e4309559f30abe6714d3f7e91b653f1a7614ca04 Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 16 Jun 2016 12:49:53 +0100 Subject: [PATCH 066/580] Consolidate s3 library files. --- src/lib/s3/{armv6j_hardfp => }/ethReals.Mod | 0 src/lib/s3/powerpc/ethReals.Mod | 305 -------------------- src/lib/s3/x86/ethReals.Mod | 305 -------------------- src/lib/s3/x86_64/ethReals.Mod | 305 -------------------- 4 files changed, 915 deletions(-) rename src/lib/s3/{armv6j_hardfp => }/ethReals.Mod (100%) delete mode 100644 src/lib/s3/powerpc/ethReals.Mod delete mode 100644 src/lib/s3/x86/ethReals.Mod delete mode 100644 src/lib/s3/x86_64/ethReals.Mod diff --git a/src/lib/s3/armv6j_hardfp/ethReals.Mod b/src/lib/s3/ethReals.Mod similarity index 100% rename from src/lib/s3/armv6j_hardfp/ethReals.Mod rename to src/lib/s3/ethReals.Mod diff --git a/src/lib/s3/powerpc/ethReals.Mod b/src/lib/s3/powerpc/ethReals.Mod deleted file mode 100644 index e11e160e..00000000 --- a/src/lib/s3/powerpc/ethReals.Mod +++ /dev/null @@ -1,305 +0,0 @@ -(* ETH Oberon, Copyright 2001 ETH Zuerich Institut fuer Computersysteme, ETH Zentrum, CH-8092 Zuerich. -Refer to the "General ETH Oberon System Source License" contract available at: http://www.oberon.ethz.ch/ *) - -MODULE ethReals; (** portable *) - -(** Implementation of the non-portable components of IEEE REAL and -LONGREAL manipulation. The routines here are required to do conversion -of reals to strings and back. -Implemented by Bernd Moesli, Seminar for Applied Mathematics, -Swiss Federal Institute of Technology Z…rich. -*) - -IMPORT SYSTEM; - -(* Bernd Moesli - Seminar for Applied Mathematics - Swiss Federal Institute of Technology Zurich - Copyright 1993 - - Support module for IEEE floating-point numbers - - Please change constant definitions of H, L depending on byte ordering - Use bm.TestReals.Do for testing the implementation. - - Expo, ExpoL return the shifted binary exponent (0 <= e < 256 (2048 resp.)) - SetExpo, SetExpoL set the shifted binary exponent - Real, RealL convert hexadecimals to reals - Int, IntL convert reals to hexadecimals - Ten returns 10^e (e <= 308, 308 < e delivers NaN) - - 1993.4.22 IEEE format only, 32-bits LONGINTs only - 30.8.1993 mh: changed RealX to avoid compiler warnings; - 7.11.1995 jt: dynamic endianess test - 22.01.97 pjm: NaN stuff (using quiet NaNs only to avoid traps) - 05.01.98 prk: NaN with INF support -*) - -VAR - DefaultFCR*: SET; - tene: ARRAY 23 OF LONGREAL; (* e = 0..22: exact values of 10^e *) - ten: ARRAY 27 OF LONGREAL; - eq, gr: ARRAY 20 OF SET; - H, L: INTEGER; - -(** Returns the shifted binary exponent (0 <= e < 256). *) -PROCEDURE Expo* (x: REAL): LONGINT; -BEGIN - RETURN ASH(SYSTEM.VAL(LONGINT, x), -23) MOD 256 -END Expo; - -(** Returns the shifted binary exponent (0 <= e < 2048). *) -PROCEDURE ExpoL* (x: LONGREAL): LONGINT; - VAR i: LONGINT; -BEGIN - SYSTEM.GET(SYSTEM.ADR(x) + H, i); RETURN ASH(i, -20) MOD 2048 -END ExpoL; - -(** Sets the shifted binary exponent. *) -PROCEDURE SetExpo* (e: LONGINT; VAR x: REAL); - VAR i: LONGINT; -BEGIN - SYSTEM.GET(SYSTEM.ADR(x), i); - i:= ASH(ASH(ASH(i, -31), 8) + e MOD 256, 23) + i MOD ASH(1, 23); - SYSTEM.PUT(SYSTEM.ADR(x), i) -END SetExpo; - -(** Sets the shifted binary exponent. *) -PROCEDURE SetExpoL* (e: LONGINT; VAR x: LONGREAL); - VAR i: LONGINT; -BEGIN - SYSTEM.GET(SYSTEM.ADR(x) + H, i); - i:= ASH(ASH(ASH(i, -31), 11) + e MOD 2048, 20) + i MOD ASH(1, 20); - SYSTEM.PUT(SYSTEM.ADR(x) + H, i) -END SetExpoL; - -(** Convert hexadecimal to REAL. *) -PROCEDURE Real* (h: LONGINT): REAL; - VAR x: REAL; -BEGIN SYSTEM.PUT(SYSTEM.ADR(x), h); RETURN x -END Real; - -(** Convert hexadecimal to LONGREAL. h and l are the high and low parts.*) -PROCEDURE RealL* (h, l: LONGINT): LONGREAL; - VAR x: LONGREAL; -BEGIN SYSTEM.PUT(SYSTEM.ADR(x) + H, h); SYSTEM.PUT(SYSTEM.ADR(x) + L, l); RETURN x -END RealL; - -(** Convert REAL to hexadecimal. *) -PROCEDURE Int* (x: REAL): LONGINT; - VAR i: LONGINT; -BEGIN SYSTEM.PUT(SYSTEM.ADR(i), x); RETURN i -END Int; - -(** Convert LONGREAL to hexadecimal. h and l are the high and low parts. *) -PROCEDURE IntL* (x: LONGREAL; VAR h, l: LONGINT); -BEGIN SYSTEM.GET(SYSTEM.ADR(x) + H, h); SYSTEM.GET(SYSTEM.ADR(x) + L, l) -END IntL; - -(** Returns 10^e (e <= 308, 308 < e delivers IEEE-code +INF). *) -PROCEDURE Ten* (e: LONGINT): LONGREAL; - VAR E: LONGINT; r: LONGREAL; -BEGIN - IF e < -307 THEN RETURN 0 ELSIF 308 < e THEN RETURN RealL(2146435072, 0) END; - INC(e, 307); r:= ten[e DIV 23] * tene[e MOD 23]; - IF e MOD 32 IN eq[e DIV 32] THEN RETURN r - ELSE - E:= ExpoL(r); SetExpoL(1023+52, r); - IF e MOD 32 IN gr[e DIV 32] THEN r:= r-1 ELSE r:= r+1 END; - SetExpoL(E, r); RETURN r - END -END Ten; - -(** Returns the NaN code (0 <= c < 8399608) or -1 if not NaN/Infinite. *) -PROCEDURE NaNCode* (x: REAL): LONGINT; -BEGIN - IF ASH(SYSTEM.VAL(LONGINT, x), -23) MOD 256 = 255 THEN (* Infinite or NaN *) - RETURN SYSTEM.VAL(LONGINT, x) MOD 800000H (* lowest 23 bits *) - ELSE - RETURN -1 - END -END NaNCode; - -(** Returns the NaN code (0 <= h < 1048576, MIN(LONGINT) <= l <= MAX(LONGINT)) or (-1,-1) if not NaN/Infinite. *) -PROCEDURE NaNCodeL* (x: LONGREAL; VAR h, l: LONGINT); -BEGIN - SYSTEM.GET(SYSTEM.ADR(x) + H, h); SYSTEM.GET(SYSTEM.ADR(x) + L, l); - IF ASH(h, -20) MOD 2048 = 2047 THEN (* Infinite or NaN *) - h := h MOD 100000H (* lowest 20 bits *) - ELSE - h := -1; l := -1 - END -END NaNCodeL; - -(** Returns TRUE iff x is NaN/Infinite. *) -PROCEDURE IsNaN* (x: REAL): BOOLEAN; -BEGIN - RETURN ASH(SYSTEM.VAL(LONGINT, x), -23) MOD 256 = 255 -END IsNaN; - -(** Returns TRUE iff x is NaN/Infinite. *) -PROCEDURE IsNaNL* (x: LONGREAL): BOOLEAN; -VAR h: LONGINT; -BEGIN - SYSTEM.GET(SYSTEM.ADR(x) + H, h); - RETURN ASH(h, -20) MOD 2048 = 2047 -END IsNaNL; - -(** Returns NaN with specified code (0 <= l < 8399608). *) -PROCEDURE NaN* (l: LONGINT): REAL; -VAR x: REAL; -BEGIN - SYSTEM.PUT(SYSTEM.ADR(x), (l MOD 800000H) + 7F800000H); - RETURN x -END NaN; - -(** Returns NaN with specified code (0 <= h < 1048576, MIN(LONGINT) <= l <= MAX(LONGINT)). *) -PROCEDURE NaNL* (h, l: LONGINT): LONGREAL; -VAR x: LONGREAL; -BEGIN - h := (h MOD 100000H) + 7FF00000H; - SYSTEM.PUT(SYSTEM.ADR(x) + H, h); - SYSTEM.PUT(SYSTEM.ADR(x) + L, l); - RETURN x -END NaNL; -(* -PROCEDURE fcr(): SET; -CODE {SYSTEM.i386, SYSTEM.FPU} - PUSH 0 - FSTCW [ESP] - FWAIT - POP EAX -END fcr; -*) (* commented out -- noch *) -(** Return state of the floating-point control register. *) -(*PROCEDURE FCR*(): SET; -BEGIN - IF Kernel.copro THEN - RETURN fcr() - ELSE - RETURN DefaultFCR - END -END FCR; -*) -(*PROCEDURE setfcr(s: SET); -CODE {SYSTEM.i386, SYSTEM.FPU} - FLDCW s[EBP] -END setfcr; -*) -(** Set state of floating-point control register. Traps reset this to the default & ENTIER resets the rounding mode. *) -(*PROCEDURE SetFCR*(s: SET); -BEGIN - IF Kernel.copro THEN setfcr(s) END -END SetFCR; -*) -PROCEDURE RealX (h, l: LONGINT; adr: LONGINT); -BEGIN SYSTEM.PUT(adr + H, h); SYSTEM.PUT(adr + L, l); -END RealX; - -PROCEDURE InitHL; - VAR (*i: LONGINT; dmy: INTEGER;*) littleEndian: BOOLEAN; -BEGIN - (*DefaultFCR := (FCR() - {0,2,3,10,11}) + {0..5,8,9}; - SetFCR(DefaultFCR); - - dmy := 1; i := SYSTEM.ADR(dmy); - SYSTEM.GET(i, littleEndian); (* indirection via i avoids warning on SUN cc -O *)*) - littleEndian := FALSE; (* endianness will be set for each architecture -- noch *) - IF littleEndian THEN H := 4; L := 0 ELSE H := 0; L := 4 END -END InitHL; - -BEGIN InitHL; - RealX(03FF00000H, 0, SYSTEM.ADR(tene[0])); - RealX(040240000H, 0, SYSTEM.ADR(tene[1])); (* 1 *) - RealX(040590000H, 0, SYSTEM.ADR(tene[2])); (* 2 *) - RealX(0408F4000H, 0, SYSTEM.ADR(tene[3])); (* 3 *) - RealX(040C38800H, 0, SYSTEM.ADR(tene[4])); (* 4 *) - RealX(040F86A00H, 0, SYSTEM.ADR(tene[5])); (* 5 *) - RealX(0412E8480H, 0, SYSTEM.ADR(tene[6])); (* 6 *) - RealX(0416312D0H, 0, SYSTEM.ADR(tene[7])); (* 7 *) - RealX(04197D784H, 0, SYSTEM.ADR(tene[8])); (* 8 *) - RealX(041CDCD65H, 0, SYSTEM.ADR(tene[9])); (* 9 *) - RealX(04202A05FH, 020000000H, SYSTEM.ADR(tene[10])); (* 10 *) - RealX(042374876H, 0E8000000H, SYSTEM.ADR(tene[11])); (* 11 *) - RealX(0426D1A94H, 0A2000000H, SYSTEM.ADR(tene[12])); (* 12 *) - RealX(042A2309CH, 0E5400000H, SYSTEM.ADR(tene[13])); (* 13 *) - RealX(042D6BCC4H, 01E900000H, SYSTEM.ADR(tene[14])); (* 14 *) - RealX(0430C6BF5H, 026340000H, SYSTEM.ADR(tene[15])); (* 15 *) - RealX(04341C379H, 037E08000H, SYSTEM.ADR(tene[16])); (* 16 *) - RealX(043763457H, 085D8A000H, SYSTEM.ADR(tene[17])); (* 17 *) - RealX(043ABC16DH, 0674EC800H, SYSTEM.ADR(tene[18])); (* 18 *) - RealX(043E158E4H, 060913D00H, SYSTEM.ADR(tene[19])); (* 19 *) - RealX(04415AF1DH, 078B58C40H, SYSTEM.ADR(tene[20])); (* 20 *) - RealX(0444B1AE4H, 0D6E2EF50H, SYSTEM.ADR(tene[21])); (* 21 *) - RealX(04480F0CFH, 064DD592H, SYSTEM.ADR(tene[22])); (* 22 *) - - RealX(031FA18H, 02C40C60DH, SYSTEM.ADR(ten[0])); (* -307 *) - RealX(04F7CAD2H, 03DE82D7BH, SYSTEM.ADR(ten[1])); (* -284 *) - RealX(09BF7D22H, 08322BAF5H, SYSTEM.ADR(ten[2])); (* -261 *) - RealX(0E84D669H, 05B193BF8H, SYSTEM.ADR(ten[3])); (* -238 *) - RealX(0134B9408H, 0EEFEA839H, SYSTEM.ADR(ten[4])); (* -215 *) - RealX(018123FF0H, 06EEA847AH, SYSTEM.ADR(ten[5])); (* -192 *) - RealX(01CD82742H, 091C6065BH, SYSTEM.ADR(ten[6])); (* -169 *) - RealX(0219FF779H, 0FD329CB9H, SYSTEM.ADR(ten[7])); (* -146 *) - RealX(02665275EH, 0D8D8F36CH, SYSTEM.ADR(ten[8])); (* -123 *) - RealX(02B2BFF2EH, 0E48E0530H, SYSTEM.ADR(ten[9])); (* -100 *) - RealX(02FF286D8H, 0EC190DCH, SYSTEM.ADR(ten[10])); (* -77 *) - RealX(034B8851AH, 0B548EA4H, SYSTEM.ADR(ten[11])); (* -54 *) - RealX(0398039D6H, 065896880H, SYSTEM.ADR(ten[12])); (* -31 *) - RealX(03E45798EH, 0E2308C3AH, SYSTEM.ADR(ten[13])); (* -8 *) - RealX(0430C6BF5H, 026340000H, SYSTEM.ADR(ten[14])); (* 15 *) - RealX(047D2CED3H, 02A16A1B1H, SYSTEM.ADR(ten[15])); (* 38 *) - RealX(04C98E45EH, 01DF3B015H, SYSTEM.ADR(ten[16])); (* 61 *) - RealX(0516078E1H, 011C3556DH, SYSTEM.ADR(ten[17])); (* 84 *) - RealX(05625CCFEH, 03D35D80EH, SYSTEM.ADR(ten[18])); (* 107 *) - RealX(05AECDA62H, 055B2D9EH, SYSTEM.ADR(ten[19])); (* 130 *) - RealX(05FB317E5H, 0EF3AB327H, SYSTEM.ADR(ten[20])); (* 153 *) - RealX(064794514H, 05230B378H, SYSTEM.ADR(ten[21])); (* 176 *) - RealX(06940B8E0H, 0ACAC4EAFH, SYSTEM.ADR(ten[22])); (* 199 *) - RealX(06E0621B1H, 0C28AC20CH, SYSTEM.ADR(ten[23])); (* 222 *) - RealX(072CD4A7BH, 0EBFA31ABH, SYSTEM.ADR(ten[24])); (* 245 *) - RealX(077936214H, 09CBD3226H, SYSTEM.ADR(ten[25])); (* 268 *) - RealX(07C59A742H, 0461887F6H, SYSTEM.ADR(ten[26])); (* 291 *) - - eq[0]:= {0, 3, 4, 5, 9, 16, 23, 25, 26, 28, 31}; - eq[1]:= {2, 5, 6, 8, 9, 10, 11, 12, 13, 14, 15, 17, 18, 19, 20, 21, 23, 24, 25, 27, 28, 29, 30, 31}; - eq[2]:= {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28}; - eq[3]:= {0, 1, 2, 3, 5, 6, 7, 8, 9, 11, 14, 15, 16, 17, 18, 19, 20, 22, 27, 28, 29, 30, 31}; - eq[4]:= {0, 6, 7, 10, 11, 12, 13, 14, 15, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31}; - eq[5]:= {0, 1, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31}; - eq[6]:= {0, 1, 4, 5, 7, 8, 10, 14, 15, 16, 18, 20, 21, 23, 24, 25, 26, 28, 29, 30, 31}; - eq[7]:= {0, 1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 18, 19, 23, 24, 26, 28, 29, 30, 31}; - eq[8]:= {0, 1, 2, 3, 4, 5, 6, 8, 9, 10, 11, 14, 16, 17, 18, 19, 20, 21, 24, 25, 26, 29}; - eq[9]:= {1, 2, 4, 6, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31}; - eq[10]:= {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30}; - eq[11]:= {0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 13, 14, 15, 16, 19, 20, 21, 22, 23, 27, 28, 29, 30}; - eq[12]:= {0, 1, 2, 3, 4, 5, 7, 8, 9, 10, 12, 14, 15, 16, 17, 18, 19, 20, 21, 23, 26, 27, 29, 30, 31}; - eq[13]:= {0, 1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 13, 14, 15, 16, 17, 18, 20, 21, 23, 24, 27, 28, 29, 30, 31}; - eq[14]:= {0, 1, 2, 3, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31}; - eq[15]:= {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 28}; - eq[16]:= {1, 2, 4, 11, 13, 16, 17, 18, 19, 22, 24, 25, 26, 27, 28, 29, 30, 31}; - eq[17]:= {1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 14, 15, 18, 19, 20, 21, 23, 25, 26, 27, 28, 29, 31}; - eq[18]:= {0, 2, 4, 5, 6, 8, 9, 11, 12, 13, 14, 16, 17, 19, 20, 22, 23, 24, 26, 27, 28, 29}; - eq[19]:= {2, 3, 4, 5, 6, 7}; - - gr[0]:= {24, 27, 29, 30}; - gr[1]:= {0, 1, 3, 4, 7}; - gr[2]:= {29, 30, 31}; - gr[3]:= {4, 10, 12, 13, 21, 23, 24, 25, 26}; - gr[4]:= {1, 2, 3, 4, 5, 8, 9, 16, 17}; - gr[5]:= {2, 3, 4, 18}; - gr[6]:= {2, 3, 6, 9, 11, 12, 13, 17, 19, 22, 27}; - gr[7]:= {2}; - gr[8]:= {7, 12, 13, 15, 22, 23, 27, 28, 30, 31}; - gr[9]:= {0, 3, 5, 7, 8}; - gr[10]:= {}; - gr[11]:= {}; - gr[12]:= {11, 13, 22, 24, 25, 28}; - gr[13]:= {22, 25, 26}; - gr[14]:= {4, 5}; - gr[15]:= {10, 14, 27, 29, 30, 31}; - gr[16]:= {0, 3, 5, 6, 7, 8, 9, 10, 12, 14, 15, 20, 21, 23}; - gr[17]:= {0, 10, 12, 13, 16, 17, 22, 24, 30}; - gr[18]:= {}; - gr[19]:= {} -END ethReals. diff --git a/src/lib/s3/x86/ethReals.Mod b/src/lib/s3/x86/ethReals.Mod deleted file mode 100644 index a7189089..00000000 --- a/src/lib/s3/x86/ethReals.Mod +++ /dev/null @@ -1,305 +0,0 @@ -(* ETH Oberon, Copyright 2001 ETH Zuerich Institut fuer Computersysteme, ETH Zentrum, CH-8092 Zuerich. -Refer to the "General ETH Oberon System Source License" contract available at: http://www.oberon.ethz.ch/ *) - -MODULE ethReals; (** portable *) - -(** Implementation of the non-portable components of IEEE REAL and -LONGREAL manipulation. The routines here are required to do conversion -of reals to strings and back. -Implemented by Bernd Moesli, Seminar for Applied Mathematics, -Swiss Federal Institute of Technology Z…rich. -*) - -IMPORT SYSTEM; - -(* Bernd Moesli - Seminar for Applied Mathematics - Swiss Federal Institute of Technology Zurich - Copyright 1993 - - Support module for IEEE floating-point numbers - - Please change constant definitions of H, L depending on byte ordering - Use bm.TestReals.Do for testing the implementation. - - Expo, ExpoL return the shifted binary exponent (0 <= e < 256 (2048 resp.)) - SetExpo, SetExpoL set the shifted binary exponent - Real, RealL convert hexadecimals to reals - Int, IntL convert reals to hexadecimals - Ten returns 10^e (e <= 308, 308 < e delivers NaN) - - 1993.4.22 IEEE format only, 32-bits LONGINTs only - 30.8.1993 mh: changed RealX to avoid compiler warnings; - 7.11.1995 jt: dynamic endianess test - 22.01.97 pjm: NaN stuff (using quiet NaNs only to avoid traps) - 05.01.98 prk: NaN with INF support -*) - -VAR - DefaultFCR*: SET; - tene: ARRAY 23 OF LONGREAL; (* e = 0..22: exact values of 10^e *) - ten: ARRAY 27 OF LONGREAL; - eq, gr: ARRAY 20 OF SET; - H, L: INTEGER; - -(** Returns the shifted binary exponent (0 <= e < 256). *) -PROCEDURE Expo* (x: REAL): LONGINT; -BEGIN - RETURN ASH(SYSTEM.VAL(LONGINT, x), -23) MOD 256 -END Expo; - -(** Returns the shifted binary exponent (0 <= e < 2048). *) -PROCEDURE ExpoL* (x: LONGREAL): LONGINT; - VAR i: LONGINT; -BEGIN - SYSTEM.GET(SYSTEM.ADR(x) + H, i); RETURN ASH(i, -20) MOD 2048 -END ExpoL; - -(** Sets the shifted binary exponent. *) -PROCEDURE SetExpo* (e: LONGINT; VAR x: REAL); - VAR i: LONGINT; -BEGIN - SYSTEM.GET(SYSTEM.ADR(x), i); - i:= ASH(ASH(ASH(i, -31), 8) + e MOD 256, 23) + i MOD ASH(1, 23); - SYSTEM.PUT(SYSTEM.ADR(x), i) -END SetExpo; - -(** Sets the shifted binary exponent. *) -PROCEDURE SetExpoL* (e: LONGINT; VAR x: LONGREAL); - VAR i: LONGINT; -BEGIN - SYSTEM.GET(SYSTEM.ADR(x) + H, i); - i:= ASH(ASH(ASH(i, -31), 11) + e MOD 2048, 20) + i MOD ASH(1, 20); - SYSTEM.PUT(SYSTEM.ADR(x) + H, i) -END SetExpoL; - -(** Convert hexadecimal to REAL. *) -PROCEDURE Real* (h: LONGINT): REAL; - VAR x: REAL; -BEGIN SYSTEM.PUT(SYSTEM.ADR(x), h); RETURN x -END Real; - -(** Convert hexadecimal to LONGREAL. h and l are the high and low parts.*) -PROCEDURE RealL* (h, l: LONGINT): LONGREAL; - VAR x: LONGREAL; -BEGIN SYSTEM.PUT(SYSTEM.ADR(x) + H, h); SYSTEM.PUT(SYSTEM.ADR(x) + L, l); RETURN x -END RealL; - -(** Convert REAL to hexadecimal. *) -PROCEDURE Int* (x: REAL): LONGINT; - VAR i: LONGINT; -BEGIN SYSTEM.PUT(SYSTEM.ADR(i), x); RETURN i -END Int; - -(** Convert LONGREAL to hexadecimal. h and l are the high and low parts. *) -PROCEDURE IntL* (x: LONGREAL; VAR h, l: LONGINT); -BEGIN SYSTEM.GET(SYSTEM.ADR(x) + H, h); SYSTEM.GET(SYSTEM.ADR(x) + L, l) -END IntL; - -(** Returns 10^e (e <= 308, 308 < e delivers IEEE-code +INF). *) -PROCEDURE Ten* (e: LONGINT): LONGREAL; - VAR E: LONGINT; r: LONGREAL; -BEGIN - IF e < -307 THEN RETURN 0 ELSIF 308 < e THEN RETURN RealL(2146435072, 0) END; - INC(e, 307); r:= ten[e DIV 23] * tene[e MOD 23]; - IF e MOD 32 IN eq[e DIV 32] THEN RETURN r - ELSE - E:= ExpoL(r); SetExpoL(1023+52, r); - IF e MOD 32 IN gr[e DIV 32] THEN r:= r-1 ELSE r:= r+1 END; - SetExpoL(E, r); RETURN r - END -END Ten; - -(** Returns the NaN code (0 <= c < 8399608) or -1 if not NaN/Infinite. *) -PROCEDURE NaNCode* (x: REAL): LONGINT; -BEGIN - IF ASH(SYSTEM.VAL(LONGINT, x), -23) MOD 256 = 255 THEN (* Infinite or NaN *) - RETURN SYSTEM.VAL(LONGINT, x) MOD 800000H (* lowest 23 bits *) - ELSE - RETURN -1 - END -END NaNCode; - -(** Returns the NaN code (0 <= h < 1048576, MIN(LONGINT) <= l <= MAX(LONGINT)) or (-1,-1) if not NaN/Infinite. *) -PROCEDURE NaNCodeL* (x: LONGREAL; VAR h, l: LONGINT); -BEGIN - SYSTEM.GET(SYSTEM.ADR(x) + H, h); SYSTEM.GET(SYSTEM.ADR(x) + L, l); - IF ASH(h, -20) MOD 2048 = 2047 THEN (* Infinite or NaN *) - h := h MOD 100000H (* lowest 20 bits *) - ELSE - h := -1; l := -1 - END -END NaNCodeL; - -(** Returns TRUE iff x is NaN/Infinite. *) -PROCEDURE IsNaN* (x: REAL): BOOLEAN; -BEGIN - RETURN ASH(SYSTEM.VAL(LONGINT, x), -23) MOD 256 = 255 -END IsNaN; - -(** Returns TRUE iff x is NaN/Infinite. *) -PROCEDURE IsNaNL* (x: LONGREAL): BOOLEAN; -VAR h: LONGINT; -BEGIN - SYSTEM.GET(SYSTEM.ADR(x) + H, h); - RETURN ASH(h, -20) MOD 2048 = 2047 -END IsNaNL; - -(** Returns NaN with specified code (0 <= l < 8399608). *) -PROCEDURE NaN* (l: LONGINT): REAL; -VAR x: REAL; -BEGIN - SYSTEM.PUT(SYSTEM.ADR(x), (l MOD 800000H) + 7F800000H); - RETURN x -END NaN; - -(** Returns NaN with specified code (0 <= h < 1048576, MIN(LONGINT) <= l <= MAX(LONGINT)). *) -PROCEDURE NaNL* (h, l: LONGINT): LONGREAL; -VAR x: LONGREAL; -BEGIN - h := (h MOD 100000H) + 7FF00000H; - SYSTEM.PUT(SYSTEM.ADR(x) + H, h); - SYSTEM.PUT(SYSTEM.ADR(x) + L, l); - RETURN x -END NaNL; -(* -PROCEDURE fcr(): SET; -CODE {SYSTEM.i386, SYSTEM.FPU} - PUSH 0 - FSTCW [ESP] - FWAIT - POP EAX -END fcr; -*) (* commented out -- noch *) -(** Return state of the floating-point control register. *) -(*PROCEDURE FCR*(): SET; -BEGIN - IF Kernel.copro THEN - RETURN fcr() - ELSE - RETURN DefaultFCR - END -END FCR; -*) -(*PROCEDURE setfcr(s: SET); -CODE {SYSTEM.i386, SYSTEM.FPU} - FLDCW s[EBP] -END setfcr; -*) -(** Set state of floating-point control register. Traps reset this to the default & ENTIER resets the rounding mode. *) -(*PROCEDURE SetFCR*(s: SET); -BEGIN - IF Kernel.copro THEN setfcr(s) END -END SetFCR; -*) -PROCEDURE RealX (h, l: LONGINT; adr: LONGINT); -BEGIN SYSTEM.PUT(adr + H, h); SYSTEM.PUT(adr + L, l); -END RealX; - -PROCEDURE InitHL; - VAR (*i: LONGINT; dmy: INTEGER;*) littleEndian: BOOLEAN; -BEGIN - (*DefaultFCR := (FCR() - {0,2,3,10,11}) + {0..5,8,9}; - SetFCR(DefaultFCR); - - dmy := 1; i := SYSTEM.ADR(dmy); - SYSTEM.GET(i, littleEndian); (* indirection via i avoids warning on SUN cc -O *)*) - littleEndian := TRUE; (* endianness will be set for each architecture -- noch *) - IF littleEndian THEN H := 4; L := 0 ELSE H := 0; L := 4 END -END InitHL; - -BEGIN InitHL; - RealX(03FF00000H, 0, SYSTEM.ADR(tene[0])); - RealX(040240000H, 0, SYSTEM.ADR(tene[1])); (* 1 *) - RealX(040590000H, 0, SYSTEM.ADR(tene[2])); (* 2 *) - RealX(0408F4000H, 0, SYSTEM.ADR(tene[3])); (* 3 *) - RealX(040C38800H, 0, SYSTEM.ADR(tene[4])); (* 4 *) - RealX(040F86A00H, 0, SYSTEM.ADR(tene[5])); (* 5 *) - RealX(0412E8480H, 0, SYSTEM.ADR(tene[6])); (* 6 *) - RealX(0416312D0H, 0, SYSTEM.ADR(tene[7])); (* 7 *) - RealX(04197D784H, 0, SYSTEM.ADR(tene[8])); (* 8 *) - RealX(041CDCD65H, 0, SYSTEM.ADR(tene[9])); (* 9 *) - RealX(04202A05FH, 020000000H, SYSTEM.ADR(tene[10])); (* 10 *) - RealX(042374876H, 0E8000000H, SYSTEM.ADR(tene[11])); (* 11 *) - RealX(0426D1A94H, 0A2000000H, SYSTEM.ADR(tene[12])); (* 12 *) - RealX(042A2309CH, 0E5400000H, SYSTEM.ADR(tene[13])); (* 13 *) - RealX(042D6BCC4H, 01E900000H, SYSTEM.ADR(tene[14])); (* 14 *) - RealX(0430C6BF5H, 026340000H, SYSTEM.ADR(tene[15])); (* 15 *) - RealX(04341C379H, 037E08000H, SYSTEM.ADR(tene[16])); (* 16 *) - RealX(043763457H, 085D8A000H, SYSTEM.ADR(tene[17])); (* 17 *) - RealX(043ABC16DH, 0674EC800H, SYSTEM.ADR(tene[18])); (* 18 *) - RealX(043E158E4H, 060913D00H, SYSTEM.ADR(tene[19])); (* 19 *) - RealX(04415AF1DH, 078B58C40H, SYSTEM.ADR(tene[20])); (* 20 *) - RealX(0444B1AE4H, 0D6E2EF50H, SYSTEM.ADR(tene[21])); (* 21 *) - RealX(04480F0CFH, 064DD592H, SYSTEM.ADR(tene[22])); (* 22 *) - - RealX(031FA18H, 02C40C60DH, SYSTEM.ADR(ten[0])); (* -307 *) - RealX(04F7CAD2H, 03DE82D7BH, SYSTEM.ADR(ten[1])); (* -284 *) - RealX(09BF7D22H, 08322BAF5H, SYSTEM.ADR(ten[2])); (* -261 *) - RealX(0E84D669H, 05B193BF8H, SYSTEM.ADR(ten[3])); (* -238 *) - RealX(0134B9408H, 0EEFEA839H, SYSTEM.ADR(ten[4])); (* -215 *) - RealX(018123FF0H, 06EEA847AH, SYSTEM.ADR(ten[5])); (* -192 *) - RealX(01CD82742H, 091C6065BH, SYSTEM.ADR(ten[6])); (* -169 *) - RealX(0219FF779H, 0FD329CB9H, SYSTEM.ADR(ten[7])); (* -146 *) - RealX(02665275EH, 0D8D8F36CH, SYSTEM.ADR(ten[8])); (* -123 *) - RealX(02B2BFF2EH, 0E48E0530H, SYSTEM.ADR(ten[9])); (* -100 *) - RealX(02FF286D8H, 0EC190DCH, SYSTEM.ADR(ten[10])); (* -77 *) - RealX(034B8851AH, 0B548EA4H, SYSTEM.ADR(ten[11])); (* -54 *) - RealX(0398039D6H, 065896880H, SYSTEM.ADR(ten[12])); (* -31 *) - RealX(03E45798EH, 0E2308C3AH, SYSTEM.ADR(ten[13])); (* -8 *) - RealX(0430C6BF5H, 026340000H, SYSTEM.ADR(ten[14])); (* 15 *) - RealX(047D2CED3H, 02A16A1B1H, SYSTEM.ADR(ten[15])); (* 38 *) - RealX(04C98E45EH, 01DF3B015H, SYSTEM.ADR(ten[16])); (* 61 *) - RealX(0516078E1H, 011C3556DH, SYSTEM.ADR(ten[17])); (* 84 *) - RealX(05625CCFEH, 03D35D80EH, SYSTEM.ADR(ten[18])); (* 107 *) - RealX(05AECDA62H, 055B2D9EH, SYSTEM.ADR(ten[19])); (* 130 *) - RealX(05FB317E5H, 0EF3AB327H, SYSTEM.ADR(ten[20])); (* 153 *) - RealX(064794514H, 05230B378H, SYSTEM.ADR(ten[21])); (* 176 *) - RealX(06940B8E0H, 0ACAC4EAFH, SYSTEM.ADR(ten[22])); (* 199 *) - RealX(06E0621B1H, 0C28AC20CH, SYSTEM.ADR(ten[23])); (* 222 *) - RealX(072CD4A7BH, 0EBFA31ABH, SYSTEM.ADR(ten[24])); (* 245 *) - RealX(077936214H, 09CBD3226H, SYSTEM.ADR(ten[25])); (* 268 *) - RealX(07C59A742H, 0461887F6H, SYSTEM.ADR(ten[26])); (* 291 *) - - eq[0]:= {0, 3, 4, 5, 9, 16, 23, 25, 26, 28, 31}; - eq[1]:= {2, 5, 6, 8, 9, 10, 11, 12, 13, 14, 15, 17, 18, 19, 20, 21, 23, 24, 25, 27, 28, 29, 30, 31}; - eq[2]:= {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28}; - eq[3]:= {0, 1, 2, 3, 5, 6, 7, 8, 9, 11, 14, 15, 16, 17, 18, 19, 20, 22, 27, 28, 29, 30, 31}; - eq[4]:= {0, 6, 7, 10, 11, 12, 13, 14, 15, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31}; - eq[5]:= {0, 1, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31}; - eq[6]:= {0, 1, 4, 5, 7, 8, 10, 14, 15, 16, 18, 20, 21, 23, 24, 25, 26, 28, 29, 30, 31}; - eq[7]:= {0, 1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 18, 19, 23, 24, 26, 28, 29, 30, 31}; - eq[8]:= {0, 1, 2, 3, 4, 5, 6, 8, 9, 10, 11, 14, 16, 17, 18, 19, 20, 21, 24, 25, 26, 29}; - eq[9]:= {1, 2, 4, 6, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31}; - eq[10]:= {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30}; - eq[11]:= {0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 13, 14, 15, 16, 19, 20, 21, 22, 23, 27, 28, 29, 30}; - eq[12]:= {0, 1, 2, 3, 4, 5, 7, 8, 9, 10, 12, 14, 15, 16, 17, 18, 19, 20, 21, 23, 26, 27, 29, 30, 31}; - eq[13]:= {0, 1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 13, 14, 15, 16, 17, 18, 20, 21, 23, 24, 27, 28, 29, 30, 31}; - eq[14]:= {0, 1, 2, 3, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31}; - eq[15]:= {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 28}; - eq[16]:= {1, 2, 4, 11, 13, 16, 17, 18, 19, 22, 24, 25, 26, 27, 28, 29, 30, 31}; - eq[17]:= {1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 14, 15, 18, 19, 20, 21, 23, 25, 26, 27, 28, 29, 31}; - eq[18]:= {0, 2, 4, 5, 6, 8, 9, 11, 12, 13, 14, 16, 17, 19, 20, 22, 23, 24, 26, 27, 28, 29}; - eq[19]:= {2, 3, 4, 5, 6, 7}; - - gr[0]:= {24, 27, 29, 30}; - gr[1]:= {0, 1, 3, 4, 7}; - gr[2]:= {29, 30, 31}; - gr[3]:= {4, 10, 12, 13, 21, 23, 24, 25, 26}; - gr[4]:= {1, 2, 3, 4, 5, 8, 9, 16, 17}; - gr[5]:= {2, 3, 4, 18}; - gr[6]:= {2, 3, 6, 9, 11, 12, 13, 17, 19, 22, 27}; - gr[7]:= {2}; - gr[8]:= {7, 12, 13, 15, 22, 23, 27, 28, 30, 31}; - gr[9]:= {0, 3, 5, 7, 8}; - gr[10]:= {}; - gr[11]:= {}; - gr[12]:= {11, 13, 22, 24, 25, 28}; - gr[13]:= {22, 25, 26}; - gr[14]:= {4, 5}; - gr[15]:= {10, 14, 27, 29, 30, 31}; - gr[16]:= {0, 3, 5, 6, 7, 8, 9, 10, 12, 14, 15, 20, 21, 23}; - gr[17]:= {0, 10, 12, 13, 16, 17, 22, 24, 30}; - gr[18]:= {}; - gr[19]:= {} -END ethReals. diff --git a/src/lib/s3/x86_64/ethReals.Mod b/src/lib/s3/x86_64/ethReals.Mod deleted file mode 100644 index a7189089..00000000 --- a/src/lib/s3/x86_64/ethReals.Mod +++ /dev/null @@ -1,305 +0,0 @@ -(* ETH Oberon, Copyright 2001 ETH Zuerich Institut fuer Computersysteme, ETH Zentrum, CH-8092 Zuerich. -Refer to the "General ETH Oberon System Source License" contract available at: http://www.oberon.ethz.ch/ *) - -MODULE ethReals; (** portable *) - -(** Implementation of the non-portable components of IEEE REAL and -LONGREAL manipulation. The routines here are required to do conversion -of reals to strings and back. -Implemented by Bernd Moesli, Seminar for Applied Mathematics, -Swiss Federal Institute of Technology Z…rich. -*) - -IMPORT SYSTEM; - -(* Bernd Moesli - Seminar for Applied Mathematics - Swiss Federal Institute of Technology Zurich - Copyright 1993 - - Support module for IEEE floating-point numbers - - Please change constant definitions of H, L depending on byte ordering - Use bm.TestReals.Do for testing the implementation. - - Expo, ExpoL return the shifted binary exponent (0 <= e < 256 (2048 resp.)) - SetExpo, SetExpoL set the shifted binary exponent - Real, RealL convert hexadecimals to reals - Int, IntL convert reals to hexadecimals - Ten returns 10^e (e <= 308, 308 < e delivers NaN) - - 1993.4.22 IEEE format only, 32-bits LONGINTs only - 30.8.1993 mh: changed RealX to avoid compiler warnings; - 7.11.1995 jt: dynamic endianess test - 22.01.97 pjm: NaN stuff (using quiet NaNs only to avoid traps) - 05.01.98 prk: NaN with INF support -*) - -VAR - DefaultFCR*: SET; - tene: ARRAY 23 OF LONGREAL; (* e = 0..22: exact values of 10^e *) - ten: ARRAY 27 OF LONGREAL; - eq, gr: ARRAY 20 OF SET; - H, L: INTEGER; - -(** Returns the shifted binary exponent (0 <= e < 256). *) -PROCEDURE Expo* (x: REAL): LONGINT; -BEGIN - RETURN ASH(SYSTEM.VAL(LONGINT, x), -23) MOD 256 -END Expo; - -(** Returns the shifted binary exponent (0 <= e < 2048). *) -PROCEDURE ExpoL* (x: LONGREAL): LONGINT; - VAR i: LONGINT; -BEGIN - SYSTEM.GET(SYSTEM.ADR(x) + H, i); RETURN ASH(i, -20) MOD 2048 -END ExpoL; - -(** Sets the shifted binary exponent. *) -PROCEDURE SetExpo* (e: LONGINT; VAR x: REAL); - VAR i: LONGINT; -BEGIN - SYSTEM.GET(SYSTEM.ADR(x), i); - i:= ASH(ASH(ASH(i, -31), 8) + e MOD 256, 23) + i MOD ASH(1, 23); - SYSTEM.PUT(SYSTEM.ADR(x), i) -END SetExpo; - -(** Sets the shifted binary exponent. *) -PROCEDURE SetExpoL* (e: LONGINT; VAR x: LONGREAL); - VAR i: LONGINT; -BEGIN - SYSTEM.GET(SYSTEM.ADR(x) + H, i); - i:= ASH(ASH(ASH(i, -31), 11) + e MOD 2048, 20) + i MOD ASH(1, 20); - SYSTEM.PUT(SYSTEM.ADR(x) + H, i) -END SetExpoL; - -(** Convert hexadecimal to REAL. *) -PROCEDURE Real* (h: LONGINT): REAL; - VAR x: REAL; -BEGIN SYSTEM.PUT(SYSTEM.ADR(x), h); RETURN x -END Real; - -(** Convert hexadecimal to LONGREAL. h and l are the high and low parts.*) -PROCEDURE RealL* (h, l: LONGINT): LONGREAL; - VAR x: LONGREAL; -BEGIN SYSTEM.PUT(SYSTEM.ADR(x) + H, h); SYSTEM.PUT(SYSTEM.ADR(x) + L, l); RETURN x -END RealL; - -(** Convert REAL to hexadecimal. *) -PROCEDURE Int* (x: REAL): LONGINT; - VAR i: LONGINT; -BEGIN SYSTEM.PUT(SYSTEM.ADR(i), x); RETURN i -END Int; - -(** Convert LONGREAL to hexadecimal. h and l are the high and low parts. *) -PROCEDURE IntL* (x: LONGREAL; VAR h, l: LONGINT); -BEGIN SYSTEM.GET(SYSTEM.ADR(x) + H, h); SYSTEM.GET(SYSTEM.ADR(x) + L, l) -END IntL; - -(** Returns 10^e (e <= 308, 308 < e delivers IEEE-code +INF). *) -PROCEDURE Ten* (e: LONGINT): LONGREAL; - VAR E: LONGINT; r: LONGREAL; -BEGIN - IF e < -307 THEN RETURN 0 ELSIF 308 < e THEN RETURN RealL(2146435072, 0) END; - INC(e, 307); r:= ten[e DIV 23] * tene[e MOD 23]; - IF e MOD 32 IN eq[e DIV 32] THEN RETURN r - ELSE - E:= ExpoL(r); SetExpoL(1023+52, r); - IF e MOD 32 IN gr[e DIV 32] THEN r:= r-1 ELSE r:= r+1 END; - SetExpoL(E, r); RETURN r - END -END Ten; - -(** Returns the NaN code (0 <= c < 8399608) or -1 if not NaN/Infinite. *) -PROCEDURE NaNCode* (x: REAL): LONGINT; -BEGIN - IF ASH(SYSTEM.VAL(LONGINT, x), -23) MOD 256 = 255 THEN (* Infinite or NaN *) - RETURN SYSTEM.VAL(LONGINT, x) MOD 800000H (* lowest 23 bits *) - ELSE - RETURN -1 - END -END NaNCode; - -(** Returns the NaN code (0 <= h < 1048576, MIN(LONGINT) <= l <= MAX(LONGINT)) or (-1,-1) if not NaN/Infinite. *) -PROCEDURE NaNCodeL* (x: LONGREAL; VAR h, l: LONGINT); -BEGIN - SYSTEM.GET(SYSTEM.ADR(x) + H, h); SYSTEM.GET(SYSTEM.ADR(x) + L, l); - IF ASH(h, -20) MOD 2048 = 2047 THEN (* Infinite or NaN *) - h := h MOD 100000H (* lowest 20 bits *) - ELSE - h := -1; l := -1 - END -END NaNCodeL; - -(** Returns TRUE iff x is NaN/Infinite. *) -PROCEDURE IsNaN* (x: REAL): BOOLEAN; -BEGIN - RETURN ASH(SYSTEM.VAL(LONGINT, x), -23) MOD 256 = 255 -END IsNaN; - -(** Returns TRUE iff x is NaN/Infinite. *) -PROCEDURE IsNaNL* (x: LONGREAL): BOOLEAN; -VAR h: LONGINT; -BEGIN - SYSTEM.GET(SYSTEM.ADR(x) + H, h); - RETURN ASH(h, -20) MOD 2048 = 2047 -END IsNaNL; - -(** Returns NaN with specified code (0 <= l < 8399608). *) -PROCEDURE NaN* (l: LONGINT): REAL; -VAR x: REAL; -BEGIN - SYSTEM.PUT(SYSTEM.ADR(x), (l MOD 800000H) + 7F800000H); - RETURN x -END NaN; - -(** Returns NaN with specified code (0 <= h < 1048576, MIN(LONGINT) <= l <= MAX(LONGINT)). *) -PROCEDURE NaNL* (h, l: LONGINT): LONGREAL; -VAR x: LONGREAL; -BEGIN - h := (h MOD 100000H) + 7FF00000H; - SYSTEM.PUT(SYSTEM.ADR(x) + H, h); - SYSTEM.PUT(SYSTEM.ADR(x) + L, l); - RETURN x -END NaNL; -(* -PROCEDURE fcr(): SET; -CODE {SYSTEM.i386, SYSTEM.FPU} - PUSH 0 - FSTCW [ESP] - FWAIT - POP EAX -END fcr; -*) (* commented out -- noch *) -(** Return state of the floating-point control register. *) -(*PROCEDURE FCR*(): SET; -BEGIN - IF Kernel.copro THEN - RETURN fcr() - ELSE - RETURN DefaultFCR - END -END FCR; -*) -(*PROCEDURE setfcr(s: SET); -CODE {SYSTEM.i386, SYSTEM.FPU} - FLDCW s[EBP] -END setfcr; -*) -(** Set state of floating-point control register. Traps reset this to the default & ENTIER resets the rounding mode. *) -(*PROCEDURE SetFCR*(s: SET); -BEGIN - IF Kernel.copro THEN setfcr(s) END -END SetFCR; -*) -PROCEDURE RealX (h, l: LONGINT; adr: LONGINT); -BEGIN SYSTEM.PUT(adr + H, h); SYSTEM.PUT(adr + L, l); -END RealX; - -PROCEDURE InitHL; - VAR (*i: LONGINT; dmy: INTEGER;*) littleEndian: BOOLEAN; -BEGIN - (*DefaultFCR := (FCR() - {0,2,3,10,11}) + {0..5,8,9}; - SetFCR(DefaultFCR); - - dmy := 1; i := SYSTEM.ADR(dmy); - SYSTEM.GET(i, littleEndian); (* indirection via i avoids warning on SUN cc -O *)*) - littleEndian := TRUE; (* endianness will be set for each architecture -- noch *) - IF littleEndian THEN H := 4; L := 0 ELSE H := 0; L := 4 END -END InitHL; - -BEGIN InitHL; - RealX(03FF00000H, 0, SYSTEM.ADR(tene[0])); - RealX(040240000H, 0, SYSTEM.ADR(tene[1])); (* 1 *) - RealX(040590000H, 0, SYSTEM.ADR(tene[2])); (* 2 *) - RealX(0408F4000H, 0, SYSTEM.ADR(tene[3])); (* 3 *) - RealX(040C38800H, 0, SYSTEM.ADR(tene[4])); (* 4 *) - RealX(040F86A00H, 0, SYSTEM.ADR(tene[5])); (* 5 *) - RealX(0412E8480H, 0, SYSTEM.ADR(tene[6])); (* 6 *) - RealX(0416312D0H, 0, SYSTEM.ADR(tene[7])); (* 7 *) - RealX(04197D784H, 0, SYSTEM.ADR(tene[8])); (* 8 *) - RealX(041CDCD65H, 0, SYSTEM.ADR(tene[9])); (* 9 *) - RealX(04202A05FH, 020000000H, SYSTEM.ADR(tene[10])); (* 10 *) - RealX(042374876H, 0E8000000H, SYSTEM.ADR(tene[11])); (* 11 *) - RealX(0426D1A94H, 0A2000000H, SYSTEM.ADR(tene[12])); (* 12 *) - RealX(042A2309CH, 0E5400000H, SYSTEM.ADR(tene[13])); (* 13 *) - RealX(042D6BCC4H, 01E900000H, SYSTEM.ADR(tene[14])); (* 14 *) - RealX(0430C6BF5H, 026340000H, SYSTEM.ADR(tene[15])); (* 15 *) - RealX(04341C379H, 037E08000H, SYSTEM.ADR(tene[16])); (* 16 *) - RealX(043763457H, 085D8A000H, SYSTEM.ADR(tene[17])); (* 17 *) - RealX(043ABC16DH, 0674EC800H, SYSTEM.ADR(tene[18])); (* 18 *) - RealX(043E158E4H, 060913D00H, SYSTEM.ADR(tene[19])); (* 19 *) - RealX(04415AF1DH, 078B58C40H, SYSTEM.ADR(tene[20])); (* 20 *) - RealX(0444B1AE4H, 0D6E2EF50H, SYSTEM.ADR(tene[21])); (* 21 *) - RealX(04480F0CFH, 064DD592H, SYSTEM.ADR(tene[22])); (* 22 *) - - RealX(031FA18H, 02C40C60DH, SYSTEM.ADR(ten[0])); (* -307 *) - RealX(04F7CAD2H, 03DE82D7BH, SYSTEM.ADR(ten[1])); (* -284 *) - RealX(09BF7D22H, 08322BAF5H, SYSTEM.ADR(ten[2])); (* -261 *) - RealX(0E84D669H, 05B193BF8H, SYSTEM.ADR(ten[3])); (* -238 *) - RealX(0134B9408H, 0EEFEA839H, SYSTEM.ADR(ten[4])); (* -215 *) - RealX(018123FF0H, 06EEA847AH, SYSTEM.ADR(ten[5])); (* -192 *) - RealX(01CD82742H, 091C6065BH, SYSTEM.ADR(ten[6])); (* -169 *) - RealX(0219FF779H, 0FD329CB9H, SYSTEM.ADR(ten[7])); (* -146 *) - RealX(02665275EH, 0D8D8F36CH, SYSTEM.ADR(ten[8])); (* -123 *) - RealX(02B2BFF2EH, 0E48E0530H, SYSTEM.ADR(ten[9])); (* -100 *) - RealX(02FF286D8H, 0EC190DCH, SYSTEM.ADR(ten[10])); (* -77 *) - RealX(034B8851AH, 0B548EA4H, SYSTEM.ADR(ten[11])); (* -54 *) - RealX(0398039D6H, 065896880H, SYSTEM.ADR(ten[12])); (* -31 *) - RealX(03E45798EH, 0E2308C3AH, SYSTEM.ADR(ten[13])); (* -8 *) - RealX(0430C6BF5H, 026340000H, SYSTEM.ADR(ten[14])); (* 15 *) - RealX(047D2CED3H, 02A16A1B1H, SYSTEM.ADR(ten[15])); (* 38 *) - RealX(04C98E45EH, 01DF3B015H, SYSTEM.ADR(ten[16])); (* 61 *) - RealX(0516078E1H, 011C3556DH, SYSTEM.ADR(ten[17])); (* 84 *) - RealX(05625CCFEH, 03D35D80EH, SYSTEM.ADR(ten[18])); (* 107 *) - RealX(05AECDA62H, 055B2D9EH, SYSTEM.ADR(ten[19])); (* 130 *) - RealX(05FB317E5H, 0EF3AB327H, SYSTEM.ADR(ten[20])); (* 153 *) - RealX(064794514H, 05230B378H, SYSTEM.ADR(ten[21])); (* 176 *) - RealX(06940B8E0H, 0ACAC4EAFH, SYSTEM.ADR(ten[22])); (* 199 *) - RealX(06E0621B1H, 0C28AC20CH, SYSTEM.ADR(ten[23])); (* 222 *) - RealX(072CD4A7BH, 0EBFA31ABH, SYSTEM.ADR(ten[24])); (* 245 *) - RealX(077936214H, 09CBD3226H, SYSTEM.ADR(ten[25])); (* 268 *) - RealX(07C59A742H, 0461887F6H, SYSTEM.ADR(ten[26])); (* 291 *) - - eq[0]:= {0, 3, 4, 5, 9, 16, 23, 25, 26, 28, 31}; - eq[1]:= {2, 5, 6, 8, 9, 10, 11, 12, 13, 14, 15, 17, 18, 19, 20, 21, 23, 24, 25, 27, 28, 29, 30, 31}; - eq[2]:= {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28}; - eq[3]:= {0, 1, 2, 3, 5, 6, 7, 8, 9, 11, 14, 15, 16, 17, 18, 19, 20, 22, 27, 28, 29, 30, 31}; - eq[4]:= {0, 6, 7, 10, 11, 12, 13, 14, 15, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31}; - eq[5]:= {0, 1, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31}; - eq[6]:= {0, 1, 4, 5, 7, 8, 10, 14, 15, 16, 18, 20, 21, 23, 24, 25, 26, 28, 29, 30, 31}; - eq[7]:= {0, 1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 18, 19, 23, 24, 26, 28, 29, 30, 31}; - eq[8]:= {0, 1, 2, 3, 4, 5, 6, 8, 9, 10, 11, 14, 16, 17, 18, 19, 20, 21, 24, 25, 26, 29}; - eq[9]:= {1, 2, 4, 6, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31}; - eq[10]:= {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30}; - eq[11]:= {0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 13, 14, 15, 16, 19, 20, 21, 22, 23, 27, 28, 29, 30}; - eq[12]:= {0, 1, 2, 3, 4, 5, 7, 8, 9, 10, 12, 14, 15, 16, 17, 18, 19, 20, 21, 23, 26, 27, 29, 30, 31}; - eq[13]:= {0, 1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 13, 14, 15, 16, 17, 18, 20, 21, 23, 24, 27, 28, 29, 30, 31}; - eq[14]:= {0, 1, 2, 3, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31}; - eq[15]:= {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 28}; - eq[16]:= {1, 2, 4, 11, 13, 16, 17, 18, 19, 22, 24, 25, 26, 27, 28, 29, 30, 31}; - eq[17]:= {1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 14, 15, 18, 19, 20, 21, 23, 25, 26, 27, 28, 29, 31}; - eq[18]:= {0, 2, 4, 5, 6, 8, 9, 11, 12, 13, 14, 16, 17, 19, 20, 22, 23, 24, 26, 27, 28, 29}; - eq[19]:= {2, 3, 4, 5, 6, 7}; - - gr[0]:= {24, 27, 29, 30}; - gr[1]:= {0, 1, 3, 4, 7}; - gr[2]:= {29, 30, 31}; - gr[3]:= {4, 10, 12, 13, 21, 23, 24, 25, 26}; - gr[4]:= {1, 2, 3, 4, 5, 8, 9, 16, 17}; - gr[5]:= {2, 3, 4, 18}; - gr[6]:= {2, 3, 6, 9, 11, 12, 13, 17, 19, 22, 27}; - gr[7]:= {2}; - gr[8]:= {7, 12, 13, 15, 22, 23, 27, 28, 30, 31}; - gr[9]:= {0, 3, 5, 7, 8}; - gr[10]:= {}; - gr[11]:= {}; - gr[12]:= {11, 13, 22, 24, 25, 28}; - gr[13]:= {22, 25, 26}; - gr[14]:= {4, 5}; - gr[15]:= {10, 14, 27, 29, 30, 31}; - gr[16]:= {0, 3, 5, 6, 7, 8, 9, 10, 12, 14, 15, 20, 21, 23}; - gr[17]:= {0, 10, 12, 13, 16, 17, 22, 24, 30}; - gr[18]:= {}; - gr[19]:= {} -END ethReals. From d6d9666713d4130877ec647c27f832f39bbfadc3 Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 16 Jun 2016 12:55:13 +0100 Subject: [PATCH 067/580] Consolidate ulm library files. --- src/lib/ulm/armv6j_hardfp/ulmSYSTEM.Mod | 137 ----- .../ulm/armv6j_hardfp/ulmSysConversions.Mod | 574 ------------------ src/lib/ulm/armv6j_hardfp/ulmSysStat.Mod | 201 ------ src/lib/ulm/armv6j_hardfp/ulmTypes.Mod | 133 ---- src/lib/ulm/powerpc/ulmSYSTEM.Mod | 137 ----- src/lib/ulm/powerpc/ulmSysConversions.Mod | 574 ------------------ src/lib/ulm/powerpc/ulmSysStat.Mod | 201 ------ src/lib/ulm/powerpc/ulmSysTypes.Mod | 70 --- src/lib/ulm/powerpc/ulmTypes.Mod | 133 ---- src/lib/ulm/{x86_64 => }/ulmSYSTEM.Mod | 0 .../ulm/{x86_64 => }/ulmSysConversions.Mod | 0 src/lib/ulm/{x86_64 => }/ulmSysStat.Mod | 0 .../ulm/{armv6j_hardfp => }/ulmSysTypes.Mod | 0 src/lib/ulm/{x86_64 => }/ulmTypes.Mod | 0 src/lib/ulm/x86/ulmSYSTEM.Mod | 137 ----- src/lib/ulm/x86/ulmSysConversions.Mod | 574 ------------------ src/lib/ulm/x86/ulmSysStat.Mod | 201 ------ src/lib/ulm/x86/ulmSysTypes.Mod | 70 --- src/lib/ulm/x86/ulmTypes.Mod | 133 ---- src/lib/ulm/x86_64/ulmSysTypes.Mod | 70 --- 20 files changed, 3345 deletions(-) delete mode 100644 src/lib/ulm/armv6j_hardfp/ulmSYSTEM.Mod delete mode 100644 src/lib/ulm/armv6j_hardfp/ulmSysConversions.Mod delete mode 100644 src/lib/ulm/armv6j_hardfp/ulmSysStat.Mod delete mode 100644 src/lib/ulm/armv6j_hardfp/ulmTypes.Mod delete mode 100644 src/lib/ulm/powerpc/ulmSYSTEM.Mod delete mode 100644 src/lib/ulm/powerpc/ulmSysConversions.Mod delete mode 100644 src/lib/ulm/powerpc/ulmSysStat.Mod delete mode 100644 src/lib/ulm/powerpc/ulmSysTypes.Mod delete mode 100644 src/lib/ulm/powerpc/ulmTypes.Mod rename src/lib/ulm/{x86_64 => }/ulmSYSTEM.Mod (100%) rename src/lib/ulm/{x86_64 => }/ulmSysConversions.Mod (100%) rename src/lib/ulm/{x86_64 => }/ulmSysStat.Mod (100%) rename src/lib/ulm/{armv6j_hardfp => }/ulmSysTypes.Mod (100%) rename src/lib/ulm/{x86_64 => }/ulmTypes.Mod (100%) delete mode 100644 src/lib/ulm/x86/ulmSYSTEM.Mod delete mode 100644 src/lib/ulm/x86/ulmSysConversions.Mod delete mode 100644 src/lib/ulm/x86/ulmSysStat.Mod delete mode 100644 src/lib/ulm/x86/ulmSysTypes.Mod delete mode 100644 src/lib/ulm/x86/ulmTypes.Mod delete mode 100644 src/lib/ulm/x86_64/ulmSysTypes.Mod diff --git a/src/lib/ulm/armv6j_hardfp/ulmSYSTEM.Mod b/src/lib/ulm/armv6j_hardfp/ulmSYSTEM.Mod deleted file mode 100644 index 814c0607..00000000 --- a/src/lib/ulm/armv6j_hardfp/ulmSYSTEM.Mod +++ /dev/null @@ -1,137 +0,0 @@ -MODULE ulmSYSTEM; -IMPORT SYSTEM, Unix, Sys := ulmSys; - -TYPE pchar = POINTER TO ARRAY 1 OF CHAR; - pstring = POINTER TO ARRAY 1024 OF CHAR; - pstatus = POINTER TO Unix.Status; - - TYPE bytearray* = ARRAY SIZE(LONGINT) OF SYSTEM.BYTE; (* need this because voc does not convert implicitly LONGINT to ARRAY OF BYTE; -- noch *) - pbytearray* = POINTER TO bytearray; - TYPE longrealarray* = ARRAY SIZE(LONGREAL) OF SYSTEM.BYTE; (* need this because voc does not convert implicitly LONGINT to ARRAY OF BYTE; -- noch *) - plongrealarray* = POINTER TO bytearray; - - PROCEDURE LongToByteArr* ( l : LONGINT; VAR bar : bytearray); (* noch *) - VAR b : SYSTEM.BYTE; - p : pbytearray; - i : LONGINT; - BEGIN - p := SYSTEM.VAL(pbytearray, SYSTEM.ADR(l)); - FOR i := 0 TO SIZE(LONGINT) -1 DO - b := p^[i]; bar[i] := b; - END - END LongToByteArr; - - PROCEDURE LRealToByteArr* ( l : LONGREAL; VAR lar : longrealarray); (* noch *) - VAR b : SYSTEM.BYTE; - p : plongrealarray; - i : LONGINT; - BEGIN - p := SYSTEM.VAL(plongrealarray, SYSTEM.ADR(l)); - FOR i := 0 TO SIZE(LONGREAL) -1 DO - b := p^[i]; lar[i] := b; - END - END LRealToByteArr; - - -(* - PROCEDURE -Write(adr, n: LONGINT): LONGINT - "write(1/*stdout*/, adr, n)"; - - PROCEDURE -read(VAR ch: CHAR): LONGINT - "read(0/*stdin*/, ch, 1)"; -*) - - PROCEDURE TAS*(VAR flag:BOOLEAN): BOOLEAN; (* added for compatibility with ulmSYSTEM module; noch *) - VAR oldflag : BOOLEAN; - BEGIN - oldflag := flag; - flag := TRUE; - RETURN oldflag; - END TAS; - - PROCEDURE UNIXCALL*(syscall: LONGINT; VAR d0, d1: LONGINT; (* in ulm version both LONGINT and INTEGER are 4 byte size *) - arg1, arg2, arg3: LONGINT) : BOOLEAN; - VAR - n : LONGINT; - ch : CHAR; - pch : pchar; - pstr : pstring; - pst : pstatus; - BEGIN - - IF syscall = Sys.read THEN - d0 := Unix.Read(arg1, arg2, arg3); - IF d0 >= 0 THEN RETURN TRUE ELSE RETURN FALSE END - (*NEW(pch); - pch := SYSTEM.VAL(pchar, arg2); - ch := pch^[0]; - n := read(ch); - IF n # 1 THEN - ch := 0X; - RETURN FALSE - ELSE - pch^[0] := ch; - RETURN TRUE - END; - *) - ELSIF syscall = Sys.write THEN - d0 := Unix.Write(arg1, arg2, arg3); - IF d0 >= 0 THEN RETURN TRUE ELSE RETURN FALSE END - (*NEW(pch); - pch := SYSTEM.VAL(pchar, arg2); - n := Write(SYSTEM.VAL(LONGINT, pch), 1); - IF n # 1 THEN RETURN FALSE ELSE RETURN TRUE END - *) - ELSIF syscall = Sys.open THEN - pstr := SYSTEM.VAL(pstring, arg1); - d0 := Unix.Open(pstr^, SYSTEM.VAL(SET, arg3), SYSTEM.VAL(SET, arg2)); - IF d0 >= 0 THEN RETURN TRUE ELSE RETURN FALSE END - ELSIF syscall = Sys.close THEN - d0 := Unix.Close(arg1); - IF d0 = 0 THEN RETURN TRUE ELSE RETURN FALSE END - ELSIF syscall = Sys.lseek THEN - d0 := Unix.Lseek(arg1, arg2, arg3); - IF d0 >= 0 THEN RETURN TRUE ELSE RETURN FALSE END - ELSIF syscall = Sys.ioctl THEN - d0 := Unix.Ioctl(arg1, arg2, arg3); - RETURN d0 >= 0; - ELSIF syscall = Sys.fcntl THEN - d0 := Unix.Fcntl (arg1, arg2, arg3); - RETURN d0 >= 0; - ELSIF syscall = Sys.dup THEN - d0 := Unix.Dup(arg1); - RETURN d0 > 0; - ELSIF syscall = Sys.pipe THEN - d0 := Unix.Pipe(arg1); - RETURN d0 >= 0; - ELSIF syscall = Sys.newstat THEN - pst := SYSTEM.VAL(pstatus, arg2); - pstr := SYSTEM.VAL(pstring, arg1); - d0 := Unix.Stat(pstr^, pst^); - RETURN d0 >= 0 - ELSIF syscall = Sys.newfstat THEN - pst := SYSTEM.VAL(pstatus, arg2); - d0 := Unix.Fstat(arg1, pst^); - RETURN d0 >= 0; - END - - END UNIXCALL; - - - PROCEDURE UNIXFORK(VAR pid: LONGINT) : BOOLEAN; - BEGIN - - END UNIXFORK; - - PROCEDURE UNIXSIGNAL(signo: INTEGER; p: PROCEDURE; - VAR old: PROCEDURE; VAR error: INTEGER) : BOOLEAN; - BEGIN - - END UNIXSIGNAL; - - PROCEDURE WMOVE*(from, to, n : LONGINT); - VAR l : LONGINT; - BEGIN - SYSTEM.MOVE(from, to, n); - END WMOVE; -END ulmSYSTEM. diff --git a/src/lib/ulm/armv6j_hardfp/ulmSysConversions.Mod b/src/lib/ulm/armv6j_hardfp/ulmSysConversions.Mod deleted file mode 100644 index f8ea3fbb..00000000 --- a/src/lib/ulm/armv6j_hardfp/ulmSysConversions.Mod +++ /dev/null @@ -1,574 +0,0 @@ -(* Ulm's Oberon Library - Copyright (C) 1989-1994 by University of Ulm, SAI, D-89069 Ulm, Germany - ---------------------------------------------------------------------------- - Ulm's Oberon Library is free software; you can redistribute it - and/or modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either version - 2 of the License, or (at your option) any later version. - - Ulm's Oberon Library is distributed in the hope that it will be - useful, but WITHOUT ANY WARRANTY; without even the implied warranty - of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - ---------------------------------------------------------------------------- - E-mail contact: oberon@mathematik.uni-ulm.de - ---------------------------------------------------------------------------- - $Id: SysConversi.om,v 1.2 1997/07/30 09:38:16 borchert Exp $ - ---------------------------------------------------------------------------- - $Log: SysConversi.om,v $ - Revision 1.2 1997/07/30 09:38:16 borchert - bug in ReadConv fixed: cv.flags was used but not set for - counts > 1 - - Revision 1.1 1994/02/23 07:58:28 borchert - Initial revision - - ---------------------------------------------------------------------------- - AFB 8/90 - adapted to linux cae 02/01 - ---------------------------------------------------------------------------- -*) - -MODULE ulmSysConversions; - - (* convert Oberon records to/from C structures *) - - IMPORT Events := ulmEvents, Objects := ulmObjects, Priorities := ulmPriorities, Streams := ulmStreams, Strings := ulmStrings, - SYS := SYSTEM, SysTypes := ulmSysTypes, Texts := ulmTexts; - - TYPE - Address* = SysTypes.Address; - Size* = Address; - - (* format: - - Format = Conversion { "/" Conversion } . - Conversion = [ Factors ] ConvChars [ Comment ] . - Factors = Array | Factor | Array Factor | Factor Array . - Array = Integer ":" . - Factor = Integer "*" . - ConvChars = OberonType CType | Skip CType | OberonType Skip . - OberonType = "a" | "b" | "c" | "s" | "i" | "l" | "S" . - CType = "a" | "c" | "s" | "i" | "l" . - Integer = Digit { Digit } . - Digit = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" . - Skip = "-" . - Comment = "=" { AnyChar } . - AnyChar = (* all characters except "/" *) . - - Oberon data types: - - a: Address - b: SYS.BYTE - B: BOOLEAN - c: CHAR - s: SHORTINT - i: INTEGER - l: LONGINT - S: SET - - C data types: - - a: char * - c: /* signed */ char - C: unsigned char - s: short int - S: unsigned short int - i: int - I: unsigned int - u: unsigned int - l: long int - L: unsigned long int - - example: - - conversion from - - Rec = - RECORD - a, b: INTEGER; - c: CHAR; - s: SET; - f: ARRAY 3 OF INTEGER; - END; - - to - - struct rec { - short a, b; - char c; - int xx; /* to be skipped on conversion */ - int s; - int f[3]; - }; - - or vice versa: - - "2*is=a,b/cc=c/-i=xx/Si=s/3:ii=f" - - The comments allow to give the field names. - *) - - CONST - (* conversion flags *) - unsigned = 0; (* suppress sign extension *) - boolean = 1; (* convert anything # 0 to 1 *) - TYPE - Flags = SET; - Event* = POINTER TO EventRec; - EventRec* = - RECORD - (Events.EventRec) - format*: Events.Message; - END; - ConvStream = POINTER TO ConvStreamRec; - ConvStreamRec = - RECORD - fmt: Texts.Text; - char: CHAR; - eof: BOOLEAN; - (* 1: Oberon type - 2: C type - *) - type1, type2: CHAR; length: INTEGER; left: INTEGER; - offset1, offset2: Address; - size1, size2: Address; elementsleft: INTEGER; flags: Flags; - END; - - Format* = POINTER TO FormatRec; - FormatRec* = - RECORD - (Objects.ObjectRec) - offset1, offset2: Address; - size1, size2: Address; - flags: Flags; - next: Format; - END; - VAR - badformat*: Events.EventType; - - PROCEDURE Error(cv: ConvStream; msg: ARRAY OF CHAR); - VAR - event: Event; - BEGIN - NEW(event); - event.type := badformat; - event.message := "SysConversions: "; - Strings.Concatenate(event.message, msg); - Strings.Read(event.format, cv.fmt); - Events.Raise(event); - cv.eof := TRUE; - cv.char := 0X; - cv.left := 0; - cv.elementsleft := 0; - END Error; - - PROCEDURE SizeError(msg, format: ARRAY OF CHAR); - VAR - event: Event; - BEGIN - NEW(event); - event.type := badformat; - event.message := "SysConversions: "; - Strings.Concatenate(event.message, msg); - COPY(format, event.format); - Events.Raise(event); - END SizeError; - - PROCEDURE NextCh(cv: ConvStream); - BEGIN - cv.eof := cv.eof OR ~Streams.ReadByte(cv.fmt, cv.char) OR (cv.char = 0X); - IF cv.eof THEN - cv.char := 0X; - END; - END NextCh; - - PROCEDURE IsDigit(ch: CHAR) : BOOLEAN; - BEGIN - RETURN (ch >= "0") & (ch <= "9") - END IsDigit; - - PROCEDURE ReadInt(cv: ConvStream; VAR i: INTEGER); - BEGIN - i := 0; - REPEAT - i := 10 * i + ORD(cv.char) - ORD("0"); - NextCh(cv); - UNTIL ~IsDigit(cv.char); - END ReadInt; - - PROCEDURE Open(VAR cv: ConvStream; format: ARRAY OF CHAR); - BEGIN - NEW(cv); - Texts.Open(SYS.VAL(Streams.Stream, cv.fmt)); - Strings.Write(cv.fmt, format); - cv.left := 0; cv.elementsleft := 0; - cv.offset1 := 0; cv.offset2 := 0; - cv.eof := FALSE; - NextCh(cv); - END Open; - - PROCEDURE Close(VAR cv: ConvStream); - BEGIN - IF ~Streams.Close(cv.fmt) THEN END; - END Close; - - PROCEDURE ScanConv(cv: ConvStream; - VAR type1, type2: CHAR; - VAR length: INTEGER) : BOOLEAN; - VAR - i: INTEGER; - factor: INTEGER; - BEGIN - IF cv.left > 0 THEN - type1 := cv.type1; - type2 := cv.type2; - length := cv.length; - DEC(cv.left); - RETURN TRUE - END; - IF cv.char = "/" THEN - NextCh(cv); - END; - IF cv.eof THEN - RETURN FALSE - END; - factor := 0; length := 0; - WHILE IsDigit(cv.char) DO - ReadInt(cv, i); - IF i <= 0 THEN - Error(cv, "integer must be positive"); RETURN FALSE - END; - IF cv.char = ":" THEN - IF length # 0 THEN - Error(cv, "multiple length specification"); RETURN FALSE - END; - length := i; - NextCh(cv); - ELSIF cv.char = "*" THEN - IF factor # 0 THEN - Error(cv, "multiple factor specification"); RETURN FALSE - END; - factor := i; cv.left := factor - 1; - NextCh(cv); - ELSE - Error(cv, "factor or length expected"); RETURN FALSE - END; - END; - type1 := cv.char; NextCh(cv); - type2 := cv.char; NextCh(cv); - IF cv.left > 0 THEN - cv.type1 := type1; cv.type2 := type2; cv.length := length; - END; - IF cv.char = "=" THEN (* comment *) - REPEAT - NextCh(cv); - UNTIL cv.eof OR (cv.char = "/"); - END; - RETURN TRUE - END ScanConv; - - PROCEDURE Align(VAR offset: Address; boundary: Address); - BEGIN - IF SYS.VAL (INTEGER, offset) MOD SYS.VAL (INTEGER, boundary) # 0 THEN - offset := SYS.VAL (INTEGER, offset) + (SYS.VAL (INTEGER, boundary) - SYS.VAL (INTEGER, offset) MOD SYS.VAL (INTEGER, boundary)); - END; - END Align; - - PROCEDURE ReadConv(cv: ConvStream; - VAR offset1, offset2: Address; - VAR size1, size2: Address; - VAR flags: Flags) : BOOLEAN; - VAR - type1, type2: CHAR; - length: INTEGER; - align: BOOLEAN; - boundary: INTEGER; - BEGIN - IF cv.elementsleft > 0 THEN - DEC(cv.elementsleft); - - (* Oberon type *) - IF size1 > SIZE(SYS.BYTE) THEN - Align(cv.offset1, SIZE(INTEGER)); - END; - offset1 := cv.offset1; cv.offset1 := SYS.VAL (INTEGER, cv.offset1) + size1; - size1 := cv.size1; size2 := cv.size2; flags := cv.flags; - IF (size1 > 0) & (cv.elementsleft = 0) THEN - Align(cv.offset1, SIZE(INTEGER)); - END; - - (* C type *) - IF size2 > 1 THEN - Align(cv.offset2, 2); - END; - offset2 := cv.offset2; cv.offset2 := SYS.VAL (INTEGER, cv.offset2) + SYS.VAL (INTEGER, size2); - - RETURN TRUE - END; - IF ScanConv(cv, type1, type2, length) THEN - flags := {}; - (* Oberon type *) - CASE type1 OF - | "a": size1 := SIZE(Address); INCL(flags, unsigned); - | "b": size1 := SIZE(SYS.BYTE); INCL(flags, unsigned); - | "B": size1 := SIZE(BOOLEAN); INCL(flags, boolean); - | "c": size1 := SIZE(CHAR); INCL(flags, unsigned); - | "s": size1 := SIZE(SHORTINT); - | "i": size1 := SIZE(INTEGER); - | "l": size1 := SIZE(LONGINT); - | "S": size1 := SIZE(SET); INCL(flags, unsigned); - | "-": size1 := 0; - ELSE Error(cv, "bad Oberon type specifier"); RETURN FALSE - END; - IF size1 > 0 THEN - IF length > 0 THEN - Align(cv.offset1, SIZE(INTEGER)); - ELSIF size1 > SIZE(SYS.BYTE) THEN - Align(cv.offset1, SIZE(INTEGER)); - END; - END; - offset1 := cv.offset1; cv.offset1 := SYS.VAL (INTEGER, cv.offset1) + size1; - - (* C type *) - CASE type2 OF - | "a": size2 := 4; INCL(flags, unsigned); (* char* *) - | "c": size2 := 1; (* /* signed */ char *) - | "C": size2 := 1; INCL(flags, unsigned); (* unsigned char *) - | "s": size2 := 2; (* short int *) - | "S": size2 := 2; INCL(flags, unsigned); (* unsigned short int *) - | "i": size2 := 4; (* int *) - | "I": size2 := 4; INCL(flags, unsigned); (* unsigned int *) - | "u": size2 := 4; INCL(flags, unsigned); (* unsigned int *) - | "l": size2 := 4; (* long int *) - | "L": size2 := 4; INCL(flags, unsigned); (* long int *) - | "-": size2 := 0; - ELSE Error(cv, "bad C type specifier"); RETURN FALSE - END; - IF size2 > 1 THEN - Align(cv.offset2, size2); - END; - offset2 := cv.offset2; cv.offset2 := SYS.VAL (INTEGER, cv.offset2) + SYS.VAL (INTEGER, size2); - - cv.size1 := size1; cv.size2 := size2; - IF length > 0 THEN - cv.elementsleft := length - 1; - cv.flags := flags; - END; - RETURN TRUE - ELSE - RETURN FALSE - END; - END ReadConv; - - PROCEDURE Convert(from, to: Address; ssize, dsize: Address; flags: Flags); - TYPE - Bytes = ARRAY 8 OF CHAR; - Pointer = POINTER TO Bytes; - VAR - dest, source: Pointer; - dindex, sindex: INTEGER; - nonzero: BOOLEAN; - fill : CHAR; - BEGIN - IF ssize > 0 THEN - dest := SYS.VAL(Pointer, to); - source := SYS.VAL(Pointer, from); - dindex := 0; sindex := 0; - IF boolean IN flags THEN - nonzero := FALSE; - WHILE ssize > 0 DO - nonzero := nonzero OR (source[sindex] # 0X); - INC(sindex); ssize := SYS.VAL (INTEGER, ssize) - 1; - END; - IF dsize > 0 THEN - IF nonzero THEN - dest[dindex] := 1X; - ELSE - dest[dindex] := 0X; - END; - dsize := dsize - 1; INC (dindex); - END; - WHILE dsize > 0 DO - dest[dindex] := 0X; - dsize := SYS.VAL (INTEGER, dsize) - 1; INC(dindex); - END; - ELSE - WHILE (dsize > 0) & (ssize > 0) DO - dest[dindex] := source[sindex]; - ssize := SYS.VAL (INTEGER, ssize) - 1; - dsize := dsize - 1; - INC(dindex); INC(sindex); - END; - IF dsize > 0 THEN - (* sindex has been incremented at least once because - * ssize and dsize were greater than 0, i.e. sindex-1 - * is a valid inex. *) - fill := 0X; - IF ~(unsigned IN flags) & (source[sindex-1] >= 080X) THEN - fill := 0FFX; - END; - END; - WHILE dsize > 0 DO - dest[dindex] := fill; - dsize := SYS.VAL (INTEGER, dsize) - 1; INC(dindex); - END; - END; - END; - END Convert; - - PROCEDURE ByAddrToC*(from, to: Address; format: ARRAY OF CHAR); - VAR - cv: ConvStream; - offset1, offset2, size1, size2: Address; - flags: Flags; - BEGIN - Open(cv, format); - WHILE ReadConv(cv, offset1, offset2, size1, size2, flags) DO - Convert(from + offset1, to + offset2, size1, size2, flags); - END; - Close(cv); - END ByAddrToC; - - PROCEDURE ByAddrFromC*(from, to: Address; format: ARRAY OF CHAR); - VAR - cv: ConvStream; - offset1, offset2, size1, size2: Address; - flags: Flags; - BEGIN - Open(cv, format); - WHILE ReadConv(cv, offset1, offset2, size1, size2, flags) DO - Convert(from + offset2, to + offset1, size2, size1, flags); - END; - Close(cv); - END ByAddrFromC; - - PROCEDURE CSize*(format: ARRAY OF CHAR) : Size; - (* returns the size of the C-structure described by `format' *) - VAR - cv: ConvStream; - offset1, offset2, size1, size2: Address; - size: Address; - flags: Flags; - BEGIN - Open(cv, format); - WHILE ReadConv(cv, offset1, offset2, size1, size2, flags) DO END; - Close(cv); - size := offset2 + size2; - Align(size, 2); - RETURN size - END CSize; - - PROCEDURE OberonSize*(format: ARRAY OF CHAR) : Size; - (* returns the size of the Oberon-structure described by `format' *) - VAR - cv: ConvStream; - offset1, offset2, size1, size2: Address; - size: Address; - flags: Flags; - BEGIN - Open(cv, format); - WHILE ReadConv(cv, offset1, offset2, size1, size2, flags) DO END; - Close(cv); - size := offset1 + size1; - Align(size, SIZE(INTEGER)); - RETURN size - END OberonSize; - - PROCEDURE ToC*(VAR from, to: ARRAY OF SYS.BYTE; format: ARRAY OF CHAR); - BEGIN - IF OberonSize(format) > LEN(from) THEN - SizeError("Oberon record is too small", format); RETURN - END; - IF CSize(format) > LEN(to) THEN - SizeError("C structure is too small", format); RETURN - END; - ByAddrToC(SYS.ADR(from), SYS.ADR(to), format); - END ToC; - - PROCEDURE FromC*(VAR from, to: ARRAY OF SYS.BYTE; format: ARRAY OF CHAR); - BEGIN - IF OberonSize(format) > LEN(to) THEN - SizeError("Oberon record is too small", format); RETURN - END; - IF CSize(format) > LEN(from) THEN - SizeError("C structure is too small", format); RETURN - END; - ByAddrFromC(SYS.ADR(from), SYS.ADR(to), format); - END FromC; - - PROCEDURE Compile*(VAR fmt: Format; format: ARRAY OF CHAR); - (* translate format into an internal representation - which is later referenced by fmt; - ByFmtToC and ByFmtFromC are faster than ToC and FromC - *) - VAR - cv: ConvStream; - offset1, offset2, size1, size2: Address; - flags: Flags; - element: Format; - head, tail: Format; - BEGIN - Open(cv, format); - head := NIL; tail := NIL; - WHILE ReadConv(cv, offset1, offset2, size1, size2, flags) DO - NEW(element); - element.offset1 := offset1; - element.offset2 := offset2; - element.size1 := size1; - element.size2 := size2; - element.flags := flags; - element.next := NIL; - IF tail # NIL THEN - tail.next := element; - ELSE - head := element; - END; - tail := element; - END; - fmt := head; - Close(cv); - END Compile; - - PROCEDURE ByFmtAndAddrToC*(from, to: Address; format: Format); - VAR - offset1, offset2, size1, size2: Address; - flags: Flags; - BEGIN - WHILE format # NIL DO - Convert(from + format.offset1, to + format.offset2, - format.size1, format.size2, format.flags); - format := format.next; - END; - END ByFmtAndAddrToC; - - PROCEDURE ByFmtAndAddrFromC*(from, to: Address; format: Format); - VAR - offset1, offset2, size1, size2: Address; - flags: Flags; - BEGIN - WHILE format # NIL DO - Convert(from + format.offset2, to + format.offset1, - format.size2, format.size1, format.flags); - format := format.next; - END; - END ByFmtAndAddrFromC; - - PROCEDURE ByFmtToC*(VAR from, to: ARRAY OF SYS.BYTE; format: Format); - BEGIN - ByFmtAndAddrToC(SYS.ADR(from), SYS.ADR(to), format); - END ByFmtToC; - - PROCEDURE ByFmtFromC*(VAR from, to: ARRAY OF SYS.BYTE; format: Format); - BEGIN - ByFmtAndAddrFromC(SYS.ADR(from), SYS.ADR(to), format); - END ByFmtFromC; - -BEGIN - Events.Define(badformat); - Events.SetPriority(badformat, Priorities.liberrors); -END ulmSysConversions. diff --git a/src/lib/ulm/armv6j_hardfp/ulmSysStat.Mod b/src/lib/ulm/armv6j_hardfp/ulmSysStat.Mod deleted file mode 100644 index c7f00f04..00000000 --- a/src/lib/ulm/armv6j_hardfp/ulmSysStat.Mod +++ /dev/null @@ -1,201 +0,0 @@ -(* Ulm's Oberon Library - Copyright (C) 1989-1994 by University of Ulm, SAI, D-89069 Ulm, Germany - ---------------------------------------------------------------------------- - Ulm's Oberon Library is free software; you can redistribute it - and/or modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either version - 2 of the License, or (at your option) any later version. - - Ulm's Oberon Library is distributed in the hope that it will be - useful, but WITHOUT ANY WARRANTY; without even the implied warranty - of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - ---------------------------------------------------------------------------- - E-mail contact: oberon@mathematik.uni-ulm.de - ---------------------------------------------------------------------------- - $Id: SysStat.om,v 1.3 2000/11/12 13:02:09 borchert Exp $ - ---------------------------------------------------------------------------- - $Log: SysStat.om,v $ - Revision 1.3 2000/11/12 13:02:09 borchert - door file type added - - Revision 1.2 2000/11/12 12:48:07 borchert - - conversion adapted to Solaris 2.x - - Lstat added - - Revision 1.1 1994/02/23 08:00:48 borchert - Initial revision - - ---------------------------------------------------------------------------- - AFB 9/89 - ---------------------------------------------------------------------------- -*) - -MODULE ulmSysStat; - - (* examine inode: stat(2) and fstat(2) *) - - IMPORT RelatedEvents := ulmRelatedEvents, Sys := ulmSys, SYS := SYSTEM, uSYS := ulmSYSTEM, SysConversions := ulmSysConversions, SysErrors := ulmSysErrors, - SysTypes := ulmSysTypes; - - CONST - (* file mode: - bit 0 = 1<<0 bit 31 = 1<<31 - - user group other - 3 1 1111 11 - 1 ... 6 5432 109 876 543 210 - +--------+------+-----+-----+-----+-----+ - | unused | type | sst | rwx | rwx | rwx | - +--------+------+-----+-----+-----+-----+ - *) - - type* = {12..15}; - prot* = {0..8}; - - (* file types; example: (stat.mode * type = dir) *) - reg* = {15}; (* regular *) - dir* = {14}; (* directory *) - chr* = {13}; (* character special *) - fifo* = {12}; (* fifo *) - blk* = {13..14}; (* block special *) - symlink* = {13, 15}; (* symbolic link *) - socket* = {14, 15}; (* socket *) - - (* special *) - setuid* = 11; (* set user id on execution *) - setgid* = 10; (* set group id on execution *) - savetext* = 9; (* save swapped text even after use *) - - (* protection *) - uread* = 8; (* read permission owner *) - uwrite* = 7; (* write permission owner *) - uexec* = 6; (* execute/search permission owner *) - gread* = 5; (* read permission group *) - gwrite* = 4; (* write permission group *) - gexec* = 3; (* execute/search permission group *) - oread* = 2; (* read permission other *) - owrite* = 1; (* write permission other *) - oexec* = 0; (* execute/search permission other *) - - (* example for "r-xr-x---": (read + exec) * (owner + group) *) - owner* = {uread, uwrite, uexec}; - group* = {gread, gwrite, gexec}; - other* = {oread, owrite, oexec}; - read* = {uread, gread, oread}; - write* = {uwrite, gwrite, owrite}; - exec* = {uexec, gexec, oexec}; - rwx* = prot; - - TYPE - StatRec* = (* result of stat(2) and fstat(2) *) - RECORD - device*: SysTypes.Device; (* ID of device containing - a directory entry for this file *) - inode*: SysTypes.Inode; (* inode number *) - mode*: SET; (* file mode; see mknod(2) *) - nlinks*: LONGINT; (* number of links *) - uid*: LONGINT; (* user id of the file's owner *) - gid*: LONGINT; (* group id of the file's group *) - rdev*: SysTypes.Device; (* ID of device - this entry is defined only for - character special or block - special files - *) - size*: SysTypes.Offset; (* file size in bytes *) - blksize*: LONGINT; (* preferred blocksize *) - blocks*: LONGINT; (* # of blocks allocated *) - atime*: SysTypes.Time; (* time of last access *) - mtime*: SysTypes.Time; (* time of last data modification *) - ctime*: SysTypes.Time; (* time of last file status change *) - END; - -(* Linux kernel struct stat (2.2.17) - struct stat { - unsigned short st_dev; - unsigned short __pad1; - unsigned long st_ino; - unsigned short st_mode; - unsigned short st_nlink; - unsigned short st_uid; - unsigned short st_gid; - unsigned short st_rdev; - unsigned short __pad2; - unsigned long st_size; - unsigned long st_blksize; - unsigned long st_blocks; - unsigned long st_atime; - unsigned long __unused1; - unsigned long st_mtime; - unsigned long __unused2; - unsigned long st_ctime; - unsigned long __unused3; - unsigned long __unused4; - unsigned long __unused5; - }; -*) - - CONST - statbufsize = 88(*64*); (* see *) (* sizeof struct stat gives us 144 on x86_64 and 88 on x86 *) - TYPE - UnixStatRec = ARRAY statbufsize OF SYS.BYTE; - CONST - statbufconv = - (*"is=dev/-s=pad1/ll=ino/Ss=mode/4*is=nlink+uid+gid+rdev/-s=pad2/ll=size/2*ll=blksize,blocks/il=atime/-l/il=mtime/-l/il=ctime/3*-l";*) - (*"ls=dev/-s=pad1/lL=ino/Ss=mode/4*is=nlink+uid+gid+rdev/-s=pad2/lL=size/2*lL=blksize,blocks/lL=atime/-l/lL=mtime/-l/lL=ctime/3*-l";*) - "ll=dev/-l=devx/-s=pad1/ll=ino/Sl=mode/ll=nlink/ll=uid/ll=gid/ll=rdev/-l=rdevx/-s=pad2/ll=size/2*ll=blksize,blocks/lL=atime/-l/lL=mtime/-l/lL=ctime/3*-l"; - VAR - statbuffmt: SysConversions.Format; - - PROCEDURE Stat*(path: ARRAY OF CHAR; VAR buf: StatRec; - errors: RelatedEvents.Object) : BOOLEAN; - VAR - d0, d1, d2: LONGINT; - origbuf: UnixStatRec; - BEGIN - IF uSYS.UNIXCALL(Sys.newstat, d0, d1, SYS.ADR(path), SYS.ADR(origbuf), d2) THEN - SysConversions.ByFmtFromC(origbuf, buf, statbuffmt); - RETURN TRUE - ELSE - SysErrors.Raise(errors, d0, Sys.newstat, path); - RETURN FALSE - END; - END Stat; -(* - PROCEDURE Lstat*(path: ARRAY OF CHAR; VAR buf: StatRec; - errors: RelatedEvents.Object) : BOOLEAN; - VAR - d0, d1: INTEGER; - origbuf: UnixStatRec; - BEGIN - IF SYS.UNIXCALL(Sys.newlstat, d0, d1, SYS.ADR(path), SYS.ADR(origbuf)) THEN - SysConversions.ByFmtFromC(origbuf, buf, statbuffmt); - RETURN TRUE - ELSE - SysErrors.Raise(errors, d0, Sys.newlstat, path); - RETURN FALSE - END; - END Lstat; -*) - PROCEDURE Fstat*(fd: SysTypes.File; VAR buf: StatRec; - errors: RelatedEvents.Object) : BOOLEAN; - VAR - d0, d1, d2: LONGINT; - origbuf: UnixStatRec; - BEGIN - IF uSYS.UNIXCALL(Sys.newfstat, d0, d1, fd, SYS.ADR(origbuf), d2) THEN - SysConversions.ByFmtFromC(origbuf, buf, statbuffmt); - RETURN TRUE - ELSE - SysErrors.Raise(errors, d0, Sys.newfstat, ""); - RETURN FALSE - END; - END Fstat; - -BEGIN - SysConversions.Compile(statbuffmt, statbufconv); -END ulmSysStat. diff --git a/src/lib/ulm/armv6j_hardfp/ulmTypes.Mod b/src/lib/ulm/armv6j_hardfp/ulmTypes.Mod deleted file mode 100644 index fe2d6eca..00000000 --- a/src/lib/ulm/armv6j_hardfp/ulmTypes.Mod +++ /dev/null @@ -1,133 +0,0 @@ -(* Ulm's Oberon Library - Copyright (C) 1989-2000 by University of Ulm, SAI, D-89069 Ulm, Germany - ---------------------------------------------------------------------------- - Ulm's Oberon Library is free software; you can redistribute it - and/or modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either version - 2 of the License, or (at your option) any later version. - - Ulm's Oberon Library is distributed in the hope that it will be - useful, but WITHOUT ANY WARRANTY; without even the implied warranty - of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - ---------------------------------------------------------------------------- - E-mail contact: oberon@mathematik.uni-ulm.de - ---------------------------------------------------------------------------- - $Id: Types.om,v 1.5 2000/12/13 10:03:00 borchert Exp $ - ---------------------------------------------------------------------------- - $Log: Types.om,v $ - Revision 1.5 2000/12/13 10:03:00 borchert - SetInt type used in msb constant - - Revision 1.4 2000/12/13 09:51:57 borchert - constants and types for the relationship of INTEGER and SET added - - Revision 1.3 1998/09/25 15:23:09 borchert - Real32..Real128 added - - Revision 1.2 1994/07/01 11:08:04 borchert - IntAddress, Int8/16/32, ToInt8/16/32 and bit/little endian stuff added - - Revision 1.1 1994/02/22 20:12:14 borchert - Initial revision - - ---------------------------------------------------------------------------- - AFB 9/93 - ---------------------------------------------------------------------------- -*) - -MODULE ulmTypes; - - (* compiler-dependent type definitions; - this version works for Ulm's Oberon Compilers on - following architectures: m68k and sparc - *) - - IMPORT SYS := SYSTEM; - - TYPE - Address* = LONGINT (*SYS.ADDRESS*); - (* ulm compiler can accept - VAR p : SYSTEM.ADDRESS; // SYSTEM.PTR in ETH and V4 versions - ... - p := SYSTEM.ADR(something); - and this is how it is used in ulm oberon system library, - while SYSTEM.ADR returns LONGINT in ETH and V4 versions. - Thus I leave it as LONGINT for now, before coming up with better solution -- noch *) - UntracedAddress* = POINTER[1] TO UntracedAddressDesc; (*SYS.UNTRACEDADDRESS;*) - UntracedAddressDesc* = RECORD[1] END; - Count* = LONGINT; - Size* = Count; - Byte* = SYS.BYTE; - IntAddress* = LONGINT; - Int8* = SHORTINT; - Int16* = INTEGER; - Int32* = LONGINT; - Real32* = REAL; - Real64* = LONGREAL; - - CONST - bigEndian* = 0; (* SPARC, M68K etc *) - littleEndian* = 1; (* Intel 80x86, VAX etc *) - byteorder* = littleEndian; (* machine-dependent constant *) - TYPE - ByteOrder* = SHORTINT; (* bigEndian or littleEndian *) - - (* following constants and type definitions try to make - conversions from INTEGER to SET and vice versa more portable - to allow for bit operations on INTEGER values - *) - TYPE - SetInt* = LONGINT; (* INTEGER type that corresponds to SET *) - VAR msb* : SET; - msbIsMax*, msbIs0*: SHORTINT; - msbindex*, lsbindex*, nofbits*: LONGINT; - - PROCEDURE ToInt8*(int: LONGINT) : Int8; - BEGIN - RETURN SHORT(SHORT(int)) - END ToInt8; - - PROCEDURE ToInt16*(int: LONGINT) : Int16; - BEGIN - RETURN SYS.VAL(Int16, int) - END ToInt16; - - PROCEDURE ToInt32*(int: LONGINT) : Int32; - BEGIN - RETURN int - END ToInt32; - - PROCEDURE ToReal32*(real: LONGREAL) : Real32; - BEGIN - RETURN SHORT(real) - END ToReal32; - - PROCEDURE ToReal64*(real: LONGREAL) : Real64; - BEGIN - RETURN real - END ToReal64; - -BEGIN - msb := SYS.VAL(SET, MIN(SetInt)); - (* most significant bit, converted to a SET *) - (* we expect msbIsMax XOR msbIs0 to be 1; - this is checked for by an assertion - *) - msbIsMax := SYS.VAL(SHORTINT, (msb = {MAX(SET)})); - (* is 1, if msb equals {MAX(SET)} *) - msbIs0 := SYS.VAL(SHORTINT, (msb = {0})); - (* is 0, if msb equals {0} *) - msbindex := msbIsMax * MAX(SET); - (* set element that corresponds to the most-significant-bit *) - lsbindex := MAX(SET) - msbindex; - (* set element that corresponds to the lowest-significant-bit *) - nofbits := MAX(SET) + 1; - (* number of elements in SETs *) - - ASSERT((msbIs0 = 1) & (msbIsMax = 0) OR (msbIs0 = 0) & (msbIsMax = 1)); -END ulmTypes. diff --git a/src/lib/ulm/powerpc/ulmSYSTEM.Mod b/src/lib/ulm/powerpc/ulmSYSTEM.Mod deleted file mode 100644 index 814c0607..00000000 --- a/src/lib/ulm/powerpc/ulmSYSTEM.Mod +++ /dev/null @@ -1,137 +0,0 @@ -MODULE ulmSYSTEM; -IMPORT SYSTEM, Unix, Sys := ulmSys; - -TYPE pchar = POINTER TO ARRAY 1 OF CHAR; - pstring = POINTER TO ARRAY 1024 OF CHAR; - pstatus = POINTER TO Unix.Status; - - TYPE bytearray* = ARRAY SIZE(LONGINT) OF SYSTEM.BYTE; (* need this because voc does not convert implicitly LONGINT to ARRAY OF BYTE; -- noch *) - pbytearray* = POINTER TO bytearray; - TYPE longrealarray* = ARRAY SIZE(LONGREAL) OF SYSTEM.BYTE; (* need this because voc does not convert implicitly LONGINT to ARRAY OF BYTE; -- noch *) - plongrealarray* = POINTER TO bytearray; - - PROCEDURE LongToByteArr* ( l : LONGINT; VAR bar : bytearray); (* noch *) - VAR b : SYSTEM.BYTE; - p : pbytearray; - i : LONGINT; - BEGIN - p := SYSTEM.VAL(pbytearray, SYSTEM.ADR(l)); - FOR i := 0 TO SIZE(LONGINT) -1 DO - b := p^[i]; bar[i] := b; - END - END LongToByteArr; - - PROCEDURE LRealToByteArr* ( l : LONGREAL; VAR lar : longrealarray); (* noch *) - VAR b : SYSTEM.BYTE; - p : plongrealarray; - i : LONGINT; - BEGIN - p := SYSTEM.VAL(plongrealarray, SYSTEM.ADR(l)); - FOR i := 0 TO SIZE(LONGREAL) -1 DO - b := p^[i]; lar[i] := b; - END - END LRealToByteArr; - - -(* - PROCEDURE -Write(adr, n: LONGINT): LONGINT - "write(1/*stdout*/, adr, n)"; - - PROCEDURE -read(VAR ch: CHAR): LONGINT - "read(0/*stdin*/, ch, 1)"; -*) - - PROCEDURE TAS*(VAR flag:BOOLEAN): BOOLEAN; (* added for compatibility with ulmSYSTEM module; noch *) - VAR oldflag : BOOLEAN; - BEGIN - oldflag := flag; - flag := TRUE; - RETURN oldflag; - END TAS; - - PROCEDURE UNIXCALL*(syscall: LONGINT; VAR d0, d1: LONGINT; (* in ulm version both LONGINT and INTEGER are 4 byte size *) - arg1, arg2, arg3: LONGINT) : BOOLEAN; - VAR - n : LONGINT; - ch : CHAR; - pch : pchar; - pstr : pstring; - pst : pstatus; - BEGIN - - IF syscall = Sys.read THEN - d0 := Unix.Read(arg1, arg2, arg3); - IF d0 >= 0 THEN RETURN TRUE ELSE RETURN FALSE END - (*NEW(pch); - pch := SYSTEM.VAL(pchar, arg2); - ch := pch^[0]; - n := read(ch); - IF n # 1 THEN - ch := 0X; - RETURN FALSE - ELSE - pch^[0] := ch; - RETURN TRUE - END; - *) - ELSIF syscall = Sys.write THEN - d0 := Unix.Write(arg1, arg2, arg3); - IF d0 >= 0 THEN RETURN TRUE ELSE RETURN FALSE END - (*NEW(pch); - pch := SYSTEM.VAL(pchar, arg2); - n := Write(SYSTEM.VAL(LONGINT, pch), 1); - IF n # 1 THEN RETURN FALSE ELSE RETURN TRUE END - *) - ELSIF syscall = Sys.open THEN - pstr := SYSTEM.VAL(pstring, arg1); - d0 := Unix.Open(pstr^, SYSTEM.VAL(SET, arg3), SYSTEM.VAL(SET, arg2)); - IF d0 >= 0 THEN RETURN TRUE ELSE RETURN FALSE END - ELSIF syscall = Sys.close THEN - d0 := Unix.Close(arg1); - IF d0 = 0 THEN RETURN TRUE ELSE RETURN FALSE END - ELSIF syscall = Sys.lseek THEN - d0 := Unix.Lseek(arg1, arg2, arg3); - IF d0 >= 0 THEN RETURN TRUE ELSE RETURN FALSE END - ELSIF syscall = Sys.ioctl THEN - d0 := Unix.Ioctl(arg1, arg2, arg3); - RETURN d0 >= 0; - ELSIF syscall = Sys.fcntl THEN - d0 := Unix.Fcntl (arg1, arg2, arg3); - RETURN d0 >= 0; - ELSIF syscall = Sys.dup THEN - d0 := Unix.Dup(arg1); - RETURN d0 > 0; - ELSIF syscall = Sys.pipe THEN - d0 := Unix.Pipe(arg1); - RETURN d0 >= 0; - ELSIF syscall = Sys.newstat THEN - pst := SYSTEM.VAL(pstatus, arg2); - pstr := SYSTEM.VAL(pstring, arg1); - d0 := Unix.Stat(pstr^, pst^); - RETURN d0 >= 0 - ELSIF syscall = Sys.newfstat THEN - pst := SYSTEM.VAL(pstatus, arg2); - d0 := Unix.Fstat(arg1, pst^); - RETURN d0 >= 0; - END - - END UNIXCALL; - - - PROCEDURE UNIXFORK(VAR pid: LONGINT) : BOOLEAN; - BEGIN - - END UNIXFORK; - - PROCEDURE UNIXSIGNAL(signo: INTEGER; p: PROCEDURE; - VAR old: PROCEDURE; VAR error: INTEGER) : BOOLEAN; - BEGIN - - END UNIXSIGNAL; - - PROCEDURE WMOVE*(from, to, n : LONGINT); - VAR l : LONGINT; - BEGIN - SYSTEM.MOVE(from, to, n); - END WMOVE; -END ulmSYSTEM. diff --git a/src/lib/ulm/powerpc/ulmSysConversions.Mod b/src/lib/ulm/powerpc/ulmSysConversions.Mod deleted file mode 100644 index f8ea3fbb..00000000 --- a/src/lib/ulm/powerpc/ulmSysConversions.Mod +++ /dev/null @@ -1,574 +0,0 @@ -(* Ulm's Oberon Library - Copyright (C) 1989-1994 by University of Ulm, SAI, D-89069 Ulm, Germany - ---------------------------------------------------------------------------- - Ulm's Oberon Library is free software; you can redistribute it - and/or modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either version - 2 of the License, or (at your option) any later version. - - Ulm's Oberon Library is distributed in the hope that it will be - useful, but WITHOUT ANY WARRANTY; without even the implied warranty - of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - ---------------------------------------------------------------------------- - E-mail contact: oberon@mathematik.uni-ulm.de - ---------------------------------------------------------------------------- - $Id: SysConversi.om,v 1.2 1997/07/30 09:38:16 borchert Exp $ - ---------------------------------------------------------------------------- - $Log: SysConversi.om,v $ - Revision 1.2 1997/07/30 09:38:16 borchert - bug in ReadConv fixed: cv.flags was used but not set for - counts > 1 - - Revision 1.1 1994/02/23 07:58:28 borchert - Initial revision - - ---------------------------------------------------------------------------- - AFB 8/90 - adapted to linux cae 02/01 - ---------------------------------------------------------------------------- -*) - -MODULE ulmSysConversions; - - (* convert Oberon records to/from C structures *) - - IMPORT Events := ulmEvents, Objects := ulmObjects, Priorities := ulmPriorities, Streams := ulmStreams, Strings := ulmStrings, - SYS := SYSTEM, SysTypes := ulmSysTypes, Texts := ulmTexts; - - TYPE - Address* = SysTypes.Address; - Size* = Address; - - (* format: - - Format = Conversion { "/" Conversion } . - Conversion = [ Factors ] ConvChars [ Comment ] . - Factors = Array | Factor | Array Factor | Factor Array . - Array = Integer ":" . - Factor = Integer "*" . - ConvChars = OberonType CType | Skip CType | OberonType Skip . - OberonType = "a" | "b" | "c" | "s" | "i" | "l" | "S" . - CType = "a" | "c" | "s" | "i" | "l" . - Integer = Digit { Digit } . - Digit = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" . - Skip = "-" . - Comment = "=" { AnyChar } . - AnyChar = (* all characters except "/" *) . - - Oberon data types: - - a: Address - b: SYS.BYTE - B: BOOLEAN - c: CHAR - s: SHORTINT - i: INTEGER - l: LONGINT - S: SET - - C data types: - - a: char * - c: /* signed */ char - C: unsigned char - s: short int - S: unsigned short int - i: int - I: unsigned int - u: unsigned int - l: long int - L: unsigned long int - - example: - - conversion from - - Rec = - RECORD - a, b: INTEGER; - c: CHAR; - s: SET; - f: ARRAY 3 OF INTEGER; - END; - - to - - struct rec { - short a, b; - char c; - int xx; /* to be skipped on conversion */ - int s; - int f[3]; - }; - - or vice versa: - - "2*is=a,b/cc=c/-i=xx/Si=s/3:ii=f" - - The comments allow to give the field names. - *) - - CONST - (* conversion flags *) - unsigned = 0; (* suppress sign extension *) - boolean = 1; (* convert anything # 0 to 1 *) - TYPE - Flags = SET; - Event* = POINTER TO EventRec; - EventRec* = - RECORD - (Events.EventRec) - format*: Events.Message; - END; - ConvStream = POINTER TO ConvStreamRec; - ConvStreamRec = - RECORD - fmt: Texts.Text; - char: CHAR; - eof: BOOLEAN; - (* 1: Oberon type - 2: C type - *) - type1, type2: CHAR; length: INTEGER; left: INTEGER; - offset1, offset2: Address; - size1, size2: Address; elementsleft: INTEGER; flags: Flags; - END; - - Format* = POINTER TO FormatRec; - FormatRec* = - RECORD - (Objects.ObjectRec) - offset1, offset2: Address; - size1, size2: Address; - flags: Flags; - next: Format; - END; - VAR - badformat*: Events.EventType; - - PROCEDURE Error(cv: ConvStream; msg: ARRAY OF CHAR); - VAR - event: Event; - BEGIN - NEW(event); - event.type := badformat; - event.message := "SysConversions: "; - Strings.Concatenate(event.message, msg); - Strings.Read(event.format, cv.fmt); - Events.Raise(event); - cv.eof := TRUE; - cv.char := 0X; - cv.left := 0; - cv.elementsleft := 0; - END Error; - - PROCEDURE SizeError(msg, format: ARRAY OF CHAR); - VAR - event: Event; - BEGIN - NEW(event); - event.type := badformat; - event.message := "SysConversions: "; - Strings.Concatenate(event.message, msg); - COPY(format, event.format); - Events.Raise(event); - END SizeError; - - PROCEDURE NextCh(cv: ConvStream); - BEGIN - cv.eof := cv.eof OR ~Streams.ReadByte(cv.fmt, cv.char) OR (cv.char = 0X); - IF cv.eof THEN - cv.char := 0X; - END; - END NextCh; - - PROCEDURE IsDigit(ch: CHAR) : BOOLEAN; - BEGIN - RETURN (ch >= "0") & (ch <= "9") - END IsDigit; - - PROCEDURE ReadInt(cv: ConvStream; VAR i: INTEGER); - BEGIN - i := 0; - REPEAT - i := 10 * i + ORD(cv.char) - ORD("0"); - NextCh(cv); - UNTIL ~IsDigit(cv.char); - END ReadInt; - - PROCEDURE Open(VAR cv: ConvStream; format: ARRAY OF CHAR); - BEGIN - NEW(cv); - Texts.Open(SYS.VAL(Streams.Stream, cv.fmt)); - Strings.Write(cv.fmt, format); - cv.left := 0; cv.elementsleft := 0; - cv.offset1 := 0; cv.offset2 := 0; - cv.eof := FALSE; - NextCh(cv); - END Open; - - PROCEDURE Close(VAR cv: ConvStream); - BEGIN - IF ~Streams.Close(cv.fmt) THEN END; - END Close; - - PROCEDURE ScanConv(cv: ConvStream; - VAR type1, type2: CHAR; - VAR length: INTEGER) : BOOLEAN; - VAR - i: INTEGER; - factor: INTEGER; - BEGIN - IF cv.left > 0 THEN - type1 := cv.type1; - type2 := cv.type2; - length := cv.length; - DEC(cv.left); - RETURN TRUE - END; - IF cv.char = "/" THEN - NextCh(cv); - END; - IF cv.eof THEN - RETURN FALSE - END; - factor := 0; length := 0; - WHILE IsDigit(cv.char) DO - ReadInt(cv, i); - IF i <= 0 THEN - Error(cv, "integer must be positive"); RETURN FALSE - END; - IF cv.char = ":" THEN - IF length # 0 THEN - Error(cv, "multiple length specification"); RETURN FALSE - END; - length := i; - NextCh(cv); - ELSIF cv.char = "*" THEN - IF factor # 0 THEN - Error(cv, "multiple factor specification"); RETURN FALSE - END; - factor := i; cv.left := factor - 1; - NextCh(cv); - ELSE - Error(cv, "factor or length expected"); RETURN FALSE - END; - END; - type1 := cv.char; NextCh(cv); - type2 := cv.char; NextCh(cv); - IF cv.left > 0 THEN - cv.type1 := type1; cv.type2 := type2; cv.length := length; - END; - IF cv.char = "=" THEN (* comment *) - REPEAT - NextCh(cv); - UNTIL cv.eof OR (cv.char = "/"); - END; - RETURN TRUE - END ScanConv; - - PROCEDURE Align(VAR offset: Address; boundary: Address); - BEGIN - IF SYS.VAL (INTEGER, offset) MOD SYS.VAL (INTEGER, boundary) # 0 THEN - offset := SYS.VAL (INTEGER, offset) + (SYS.VAL (INTEGER, boundary) - SYS.VAL (INTEGER, offset) MOD SYS.VAL (INTEGER, boundary)); - END; - END Align; - - PROCEDURE ReadConv(cv: ConvStream; - VAR offset1, offset2: Address; - VAR size1, size2: Address; - VAR flags: Flags) : BOOLEAN; - VAR - type1, type2: CHAR; - length: INTEGER; - align: BOOLEAN; - boundary: INTEGER; - BEGIN - IF cv.elementsleft > 0 THEN - DEC(cv.elementsleft); - - (* Oberon type *) - IF size1 > SIZE(SYS.BYTE) THEN - Align(cv.offset1, SIZE(INTEGER)); - END; - offset1 := cv.offset1; cv.offset1 := SYS.VAL (INTEGER, cv.offset1) + size1; - size1 := cv.size1; size2 := cv.size2; flags := cv.flags; - IF (size1 > 0) & (cv.elementsleft = 0) THEN - Align(cv.offset1, SIZE(INTEGER)); - END; - - (* C type *) - IF size2 > 1 THEN - Align(cv.offset2, 2); - END; - offset2 := cv.offset2; cv.offset2 := SYS.VAL (INTEGER, cv.offset2) + SYS.VAL (INTEGER, size2); - - RETURN TRUE - END; - IF ScanConv(cv, type1, type2, length) THEN - flags := {}; - (* Oberon type *) - CASE type1 OF - | "a": size1 := SIZE(Address); INCL(flags, unsigned); - | "b": size1 := SIZE(SYS.BYTE); INCL(flags, unsigned); - | "B": size1 := SIZE(BOOLEAN); INCL(flags, boolean); - | "c": size1 := SIZE(CHAR); INCL(flags, unsigned); - | "s": size1 := SIZE(SHORTINT); - | "i": size1 := SIZE(INTEGER); - | "l": size1 := SIZE(LONGINT); - | "S": size1 := SIZE(SET); INCL(flags, unsigned); - | "-": size1 := 0; - ELSE Error(cv, "bad Oberon type specifier"); RETURN FALSE - END; - IF size1 > 0 THEN - IF length > 0 THEN - Align(cv.offset1, SIZE(INTEGER)); - ELSIF size1 > SIZE(SYS.BYTE) THEN - Align(cv.offset1, SIZE(INTEGER)); - END; - END; - offset1 := cv.offset1; cv.offset1 := SYS.VAL (INTEGER, cv.offset1) + size1; - - (* C type *) - CASE type2 OF - | "a": size2 := 4; INCL(flags, unsigned); (* char* *) - | "c": size2 := 1; (* /* signed */ char *) - | "C": size2 := 1; INCL(flags, unsigned); (* unsigned char *) - | "s": size2 := 2; (* short int *) - | "S": size2 := 2; INCL(flags, unsigned); (* unsigned short int *) - | "i": size2 := 4; (* int *) - | "I": size2 := 4; INCL(flags, unsigned); (* unsigned int *) - | "u": size2 := 4; INCL(flags, unsigned); (* unsigned int *) - | "l": size2 := 4; (* long int *) - | "L": size2 := 4; INCL(flags, unsigned); (* long int *) - | "-": size2 := 0; - ELSE Error(cv, "bad C type specifier"); RETURN FALSE - END; - IF size2 > 1 THEN - Align(cv.offset2, size2); - END; - offset2 := cv.offset2; cv.offset2 := SYS.VAL (INTEGER, cv.offset2) + SYS.VAL (INTEGER, size2); - - cv.size1 := size1; cv.size2 := size2; - IF length > 0 THEN - cv.elementsleft := length - 1; - cv.flags := flags; - END; - RETURN TRUE - ELSE - RETURN FALSE - END; - END ReadConv; - - PROCEDURE Convert(from, to: Address; ssize, dsize: Address; flags: Flags); - TYPE - Bytes = ARRAY 8 OF CHAR; - Pointer = POINTER TO Bytes; - VAR - dest, source: Pointer; - dindex, sindex: INTEGER; - nonzero: BOOLEAN; - fill : CHAR; - BEGIN - IF ssize > 0 THEN - dest := SYS.VAL(Pointer, to); - source := SYS.VAL(Pointer, from); - dindex := 0; sindex := 0; - IF boolean IN flags THEN - nonzero := FALSE; - WHILE ssize > 0 DO - nonzero := nonzero OR (source[sindex] # 0X); - INC(sindex); ssize := SYS.VAL (INTEGER, ssize) - 1; - END; - IF dsize > 0 THEN - IF nonzero THEN - dest[dindex] := 1X; - ELSE - dest[dindex] := 0X; - END; - dsize := dsize - 1; INC (dindex); - END; - WHILE dsize > 0 DO - dest[dindex] := 0X; - dsize := SYS.VAL (INTEGER, dsize) - 1; INC(dindex); - END; - ELSE - WHILE (dsize > 0) & (ssize > 0) DO - dest[dindex] := source[sindex]; - ssize := SYS.VAL (INTEGER, ssize) - 1; - dsize := dsize - 1; - INC(dindex); INC(sindex); - END; - IF dsize > 0 THEN - (* sindex has been incremented at least once because - * ssize and dsize were greater than 0, i.e. sindex-1 - * is a valid inex. *) - fill := 0X; - IF ~(unsigned IN flags) & (source[sindex-1] >= 080X) THEN - fill := 0FFX; - END; - END; - WHILE dsize > 0 DO - dest[dindex] := fill; - dsize := SYS.VAL (INTEGER, dsize) - 1; INC(dindex); - END; - END; - END; - END Convert; - - PROCEDURE ByAddrToC*(from, to: Address; format: ARRAY OF CHAR); - VAR - cv: ConvStream; - offset1, offset2, size1, size2: Address; - flags: Flags; - BEGIN - Open(cv, format); - WHILE ReadConv(cv, offset1, offset2, size1, size2, flags) DO - Convert(from + offset1, to + offset2, size1, size2, flags); - END; - Close(cv); - END ByAddrToC; - - PROCEDURE ByAddrFromC*(from, to: Address; format: ARRAY OF CHAR); - VAR - cv: ConvStream; - offset1, offset2, size1, size2: Address; - flags: Flags; - BEGIN - Open(cv, format); - WHILE ReadConv(cv, offset1, offset2, size1, size2, flags) DO - Convert(from + offset2, to + offset1, size2, size1, flags); - END; - Close(cv); - END ByAddrFromC; - - PROCEDURE CSize*(format: ARRAY OF CHAR) : Size; - (* returns the size of the C-structure described by `format' *) - VAR - cv: ConvStream; - offset1, offset2, size1, size2: Address; - size: Address; - flags: Flags; - BEGIN - Open(cv, format); - WHILE ReadConv(cv, offset1, offset2, size1, size2, flags) DO END; - Close(cv); - size := offset2 + size2; - Align(size, 2); - RETURN size - END CSize; - - PROCEDURE OberonSize*(format: ARRAY OF CHAR) : Size; - (* returns the size of the Oberon-structure described by `format' *) - VAR - cv: ConvStream; - offset1, offset2, size1, size2: Address; - size: Address; - flags: Flags; - BEGIN - Open(cv, format); - WHILE ReadConv(cv, offset1, offset2, size1, size2, flags) DO END; - Close(cv); - size := offset1 + size1; - Align(size, SIZE(INTEGER)); - RETURN size - END OberonSize; - - PROCEDURE ToC*(VAR from, to: ARRAY OF SYS.BYTE; format: ARRAY OF CHAR); - BEGIN - IF OberonSize(format) > LEN(from) THEN - SizeError("Oberon record is too small", format); RETURN - END; - IF CSize(format) > LEN(to) THEN - SizeError("C structure is too small", format); RETURN - END; - ByAddrToC(SYS.ADR(from), SYS.ADR(to), format); - END ToC; - - PROCEDURE FromC*(VAR from, to: ARRAY OF SYS.BYTE; format: ARRAY OF CHAR); - BEGIN - IF OberonSize(format) > LEN(to) THEN - SizeError("Oberon record is too small", format); RETURN - END; - IF CSize(format) > LEN(from) THEN - SizeError("C structure is too small", format); RETURN - END; - ByAddrFromC(SYS.ADR(from), SYS.ADR(to), format); - END FromC; - - PROCEDURE Compile*(VAR fmt: Format; format: ARRAY OF CHAR); - (* translate format into an internal representation - which is later referenced by fmt; - ByFmtToC and ByFmtFromC are faster than ToC and FromC - *) - VAR - cv: ConvStream; - offset1, offset2, size1, size2: Address; - flags: Flags; - element: Format; - head, tail: Format; - BEGIN - Open(cv, format); - head := NIL; tail := NIL; - WHILE ReadConv(cv, offset1, offset2, size1, size2, flags) DO - NEW(element); - element.offset1 := offset1; - element.offset2 := offset2; - element.size1 := size1; - element.size2 := size2; - element.flags := flags; - element.next := NIL; - IF tail # NIL THEN - tail.next := element; - ELSE - head := element; - END; - tail := element; - END; - fmt := head; - Close(cv); - END Compile; - - PROCEDURE ByFmtAndAddrToC*(from, to: Address; format: Format); - VAR - offset1, offset2, size1, size2: Address; - flags: Flags; - BEGIN - WHILE format # NIL DO - Convert(from + format.offset1, to + format.offset2, - format.size1, format.size2, format.flags); - format := format.next; - END; - END ByFmtAndAddrToC; - - PROCEDURE ByFmtAndAddrFromC*(from, to: Address; format: Format); - VAR - offset1, offset2, size1, size2: Address; - flags: Flags; - BEGIN - WHILE format # NIL DO - Convert(from + format.offset2, to + format.offset1, - format.size2, format.size1, format.flags); - format := format.next; - END; - END ByFmtAndAddrFromC; - - PROCEDURE ByFmtToC*(VAR from, to: ARRAY OF SYS.BYTE; format: Format); - BEGIN - ByFmtAndAddrToC(SYS.ADR(from), SYS.ADR(to), format); - END ByFmtToC; - - PROCEDURE ByFmtFromC*(VAR from, to: ARRAY OF SYS.BYTE; format: Format); - BEGIN - ByFmtAndAddrFromC(SYS.ADR(from), SYS.ADR(to), format); - END ByFmtFromC; - -BEGIN - Events.Define(badformat); - Events.SetPriority(badformat, Priorities.liberrors); -END ulmSysConversions. diff --git a/src/lib/ulm/powerpc/ulmSysStat.Mod b/src/lib/ulm/powerpc/ulmSysStat.Mod deleted file mode 100644 index c7f00f04..00000000 --- a/src/lib/ulm/powerpc/ulmSysStat.Mod +++ /dev/null @@ -1,201 +0,0 @@ -(* Ulm's Oberon Library - Copyright (C) 1989-1994 by University of Ulm, SAI, D-89069 Ulm, Germany - ---------------------------------------------------------------------------- - Ulm's Oberon Library is free software; you can redistribute it - and/or modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either version - 2 of the License, or (at your option) any later version. - - Ulm's Oberon Library is distributed in the hope that it will be - useful, but WITHOUT ANY WARRANTY; without even the implied warranty - of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - ---------------------------------------------------------------------------- - E-mail contact: oberon@mathematik.uni-ulm.de - ---------------------------------------------------------------------------- - $Id: SysStat.om,v 1.3 2000/11/12 13:02:09 borchert Exp $ - ---------------------------------------------------------------------------- - $Log: SysStat.om,v $ - Revision 1.3 2000/11/12 13:02:09 borchert - door file type added - - Revision 1.2 2000/11/12 12:48:07 borchert - - conversion adapted to Solaris 2.x - - Lstat added - - Revision 1.1 1994/02/23 08:00:48 borchert - Initial revision - - ---------------------------------------------------------------------------- - AFB 9/89 - ---------------------------------------------------------------------------- -*) - -MODULE ulmSysStat; - - (* examine inode: stat(2) and fstat(2) *) - - IMPORT RelatedEvents := ulmRelatedEvents, Sys := ulmSys, SYS := SYSTEM, uSYS := ulmSYSTEM, SysConversions := ulmSysConversions, SysErrors := ulmSysErrors, - SysTypes := ulmSysTypes; - - CONST - (* file mode: - bit 0 = 1<<0 bit 31 = 1<<31 - - user group other - 3 1 1111 11 - 1 ... 6 5432 109 876 543 210 - +--------+------+-----+-----+-----+-----+ - | unused | type | sst | rwx | rwx | rwx | - +--------+------+-----+-----+-----+-----+ - *) - - type* = {12..15}; - prot* = {0..8}; - - (* file types; example: (stat.mode * type = dir) *) - reg* = {15}; (* regular *) - dir* = {14}; (* directory *) - chr* = {13}; (* character special *) - fifo* = {12}; (* fifo *) - blk* = {13..14}; (* block special *) - symlink* = {13, 15}; (* symbolic link *) - socket* = {14, 15}; (* socket *) - - (* special *) - setuid* = 11; (* set user id on execution *) - setgid* = 10; (* set group id on execution *) - savetext* = 9; (* save swapped text even after use *) - - (* protection *) - uread* = 8; (* read permission owner *) - uwrite* = 7; (* write permission owner *) - uexec* = 6; (* execute/search permission owner *) - gread* = 5; (* read permission group *) - gwrite* = 4; (* write permission group *) - gexec* = 3; (* execute/search permission group *) - oread* = 2; (* read permission other *) - owrite* = 1; (* write permission other *) - oexec* = 0; (* execute/search permission other *) - - (* example for "r-xr-x---": (read + exec) * (owner + group) *) - owner* = {uread, uwrite, uexec}; - group* = {gread, gwrite, gexec}; - other* = {oread, owrite, oexec}; - read* = {uread, gread, oread}; - write* = {uwrite, gwrite, owrite}; - exec* = {uexec, gexec, oexec}; - rwx* = prot; - - TYPE - StatRec* = (* result of stat(2) and fstat(2) *) - RECORD - device*: SysTypes.Device; (* ID of device containing - a directory entry for this file *) - inode*: SysTypes.Inode; (* inode number *) - mode*: SET; (* file mode; see mknod(2) *) - nlinks*: LONGINT; (* number of links *) - uid*: LONGINT; (* user id of the file's owner *) - gid*: LONGINT; (* group id of the file's group *) - rdev*: SysTypes.Device; (* ID of device - this entry is defined only for - character special or block - special files - *) - size*: SysTypes.Offset; (* file size in bytes *) - blksize*: LONGINT; (* preferred blocksize *) - blocks*: LONGINT; (* # of blocks allocated *) - atime*: SysTypes.Time; (* time of last access *) - mtime*: SysTypes.Time; (* time of last data modification *) - ctime*: SysTypes.Time; (* time of last file status change *) - END; - -(* Linux kernel struct stat (2.2.17) - struct stat { - unsigned short st_dev; - unsigned short __pad1; - unsigned long st_ino; - unsigned short st_mode; - unsigned short st_nlink; - unsigned short st_uid; - unsigned short st_gid; - unsigned short st_rdev; - unsigned short __pad2; - unsigned long st_size; - unsigned long st_blksize; - unsigned long st_blocks; - unsigned long st_atime; - unsigned long __unused1; - unsigned long st_mtime; - unsigned long __unused2; - unsigned long st_ctime; - unsigned long __unused3; - unsigned long __unused4; - unsigned long __unused5; - }; -*) - - CONST - statbufsize = 88(*64*); (* see *) (* sizeof struct stat gives us 144 on x86_64 and 88 on x86 *) - TYPE - UnixStatRec = ARRAY statbufsize OF SYS.BYTE; - CONST - statbufconv = - (*"is=dev/-s=pad1/ll=ino/Ss=mode/4*is=nlink+uid+gid+rdev/-s=pad2/ll=size/2*ll=blksize,blocks/il=atime/-l/il=mtime/-l/il=ctime/3*-l";*) - (*"ls=dev/-s=pad1/lL=ino/Ss=mode/4*is=nlink+uid+gid+rdev/-s=pad2/lL=size/2*lL=blksize,blocks/lL=atime/-l/lL=mtime/-l/lL=ctime/3*-l";*) - "ll=dev/-l=devx/-s=pad1/ll=ino/Sl=mode/ll=nlink/ll=uid/ll=gid/ll=rdev/-l=rdevx/-s=pad2/ll=size/2*ll=blksize,blocks/lL=atime/-l/lL=mtime/-l/lL=ctime/3*-l"; - VAR - statbuffmt: SysConversions.Format; - - PROCEDURE Stat*(path: ARRAY OF CHAR; VAR buf: StatRec; - errors: RelatedEvents.Object) : BOOLEAN; - VAR - d0, d1, d2: LONGINT; - origbuf: UnixStatRec; - BEGIN - IF uSYS.UNIXCALL(Sys.newstat, d0, d1, SYS.ADR(path), SYS.ADR(origbuf), d2) THEN - SysConversions.ByFmtFromC(origbuf, buf, statbuffmt); - RETURN TRUE - ELSE - SysErrors.Raise(errors, d0, Sys.newstat, path); - RETURN FALSE - END; - END Stat; -(* - PROCEDURE Lstat*(path: ARRAY OF CHAR; VAR buf: StatRec; - errors: RelatedEvents.Object) : BOOLEAN; - VAR - d0, d1: INTEGER; - origbuf: UnixStatRec; - BEGIN - IF SYS.UNIXCALL(Sys.newlstat, d0, d1, SYS.ADR(path), SYS.ADR(origbuf)) THEN - SysConversions.ByFmtFromC(origbuf, buf, statbuffmt); - RETURN TRUE - ELSE - SysErrors.Raise(errors, d0, Sys.newlstat, path); - RETURN FALSE - END; - END Lstat; -*) - PROCEDURE Fstat*(fd: SysTypes.File; VAR buf: StatRec; - errors: RelatedEvents.Object) : BOOLEAN; - VAR - d0, d1, d2: LONGINT; - origbuf: UnixStatRec; - BEGIN - IF uSYS.UNIXCALL(Sys.newfstat, d0, d1, fd, SYS.ADR(origbuf), d2) THEN - SysConversions.ByFmtFromC(origbuf, buf, statbuffmt); - RETURN TRUE - ELSE - SysErrors.Raise(errors, d0, Sys.newfstat, ""); - RETURN FALSE - END; - END Fstat; - -BEGIN - SysConversions.Compile(statbuffmt, statbufconv); -END ulmSysStat. diff --git a/src/lib/ulm/powerpc/ulmSysTypes.Mod b/src/lib/ulm/powerpc/ulmSysTypes.Mod deleted file mode 100644 index 174140e7..00000000 --- a/src/lib/ulm/powerpc/ulmSysTypes.Mod +++ /dev/null @@ -1,70 +0,0 @@ -(* Ulm's Oberon Library - Copyright (C) 1989-1994 by University of Ulm, SAI, D-89069 Ulm, Germany - ---------------------------------------------------------------------------- - Ulm's Oberon Library is free software; you can redistribute it - and/or modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either version - 2 of the License, or (at your option) any later version. - - Ulm's Oberon Library is distributed in the hope that it will be - useful, but WITHOUT ANY WARRANTY; without even the implied warranty - of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - ---------------------------------------------------------------------------- - E-mail contact: oberon@mathematik.uni-ulm.de - ---------------------------------------------------------------------------- - $Id: SysTypes.om,v 1.1 1994/02/23 08:01:38 borchert Exp $ - ---------------------------------------------------------------------------- - $Log: SysTypes.om,v $ - Revision 1.1 1994/02/23 08:01:38 borchert - Initial revision - - ---------------------------------------------------------------------------- - AFB 9/89 - ---------------------------------------------------------------------------- -*) - -MODULE ulmSysTypes; - - IMPORT Types := ulmTypes; - - TYPE - Address* = Types.Address; - UntracedAddress* = Types.UntracedAddress; - Count* = Types.Count; - Size* = Types.Size; - Byte* = Types.Byte; - - File* = (*INTEGER*)LONGINT; (* in ulm's system both INTEGER and LONGINT are 4 bytes long *) - Offset* = LONGINT; - Device* = LONGINT; - Inode* = LONGINT; - Time* = LONGINT; - - Word* = INTEGER; (* must have the size of C's int-type *) - - (* Note: linux supports wait4 but not waitid, i.e. these - * constants aren't needed. *) - (* - CONST - (* possible values of the idtype parameter (4 bytes), - see - *) - idPid = 0; (* a process identifier *) - idPpid = 1; (* a parent process identifier *) - idPgid = 2; (* a process group (job control group) identifier *) - idSid = 3; (* a session identifier *) - idCid = 4; (* a scheduling class identifier *) - idUid = 5; (* a user identifier *) - idGid = 6; (* a group identifier *) - idAll = 7; (* all processes *) - idLwpid = 8; (* an LWP identifier *) - TYPE - IdType = INTEGER; (* idPid .. idLwpid *) - *) - -END ulmSysTypes. diff --git a/src/lib/ulm/powerpc/ulmTypes.Mod b/src/lib/ulm/powerpc/ulmTypes.Mod deleted file mode 100644 index 0d2db20e..00000000 --- a/src/lib/ulm/powerpc/ulmTypes.Mod +++ /dev/null @@ -1,133 +0,0 @@ -(* Ulm's Oberon Library - Copyright (C) 1989-2000 by University of Ulm, SAI, D-89069 Ulm, Germany - ---------------------------------------------------------------------------- - Ulm's Oberon Library is free software; you can redistribute it - and/or modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either version - 2 of the License, or (at your option) any later version. - - Ulm's Oberon Library is distributed in the hope that it will be - useful, but WITHOUT ANY WARRANTY; without even the implied warranty - of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - ---------------------------------------------------------------------------- - E-mail contact: oberon@mathematik.uni-ulm.de - ---------------------------------------------------------------------------- - $Id: Types.om,v 1.5 2000/12/13 10:03:00 borchert Exp $ - ---------------------------------------------------------------------------- - $Log: Types.om,v $ - Revision 1.5 2000/12/13 10:03:00 borchert - SetInt type used in msb constant - - Revision 1.4 2000/12/13 09:51:57 borchert - constants and types for the relationship of INTEGER and SET added - - Revision 1.3 1998/09/25 15:23:09 borchert - Real32..Real128 added - - Revision 1.2 1994/07/01 11:08:04 borchert - IntAddress, Int8/16/32, ToInt8/16/32 and bit/little endian stuff added - - Revision 1.1 1994/02/22 20:12:14 borchert - Initial revision - - ---------------------------------------------------------------------------- - AFB 9/93 - ---------------------------------------------------------------------------- -*) - -MODULE ulmTypes; - - (* compiler-dependent type definitions; - this version works for Ulm's Oberon Compilers on - following architectures: m68k and sparc - *) - - IMPORT SYS := SYSTEM; - - TYPE - Address* = LONGINT (*SYS.ADDRESS*); - (* ulm compiler can accept - VAR p : SYSTEM.ADDRESS; // SYSTEM.PTR in ETH and V4 versions - ... - p := SYSTEM.ADR(something); - and this is how it is used in ulm oberon system library, - while SYSTEM.ADR returns LONGINT in ETH and V4 versions. - Thus I leave it as LONGINT for now, before coming up with better solution -- noch *) - UntracedAddress* = POINTER[1] TO UntracedAddressDesc; (*SYS.UNTRACEDADDRESS;*) - UntracedAddressDesc* = RECORD[1] END; - Count* = LONGINT; - Size* = Count; - Byte* = SYS.BYTE; - IntAddress* = LONGINT; - Int8* = SHORTINT; - Int16* = INTEGER; - Int32* = LONGINT; - Real32* = REAL; - Real64* = LONGREAL; - - CONST - bigEndian* = 0; (* SPARC, M68K etc *) - littleEndian* = 1; (* Intel 80x86, VAX etc *) - byteorder* = bigEndian; (* machine-dependent constant *) - TYPE - ByteOrder* = SHORTINT; (* bigEndian or littleEndian *) - - (* following constants and type definitions try to make - conversions from INTEGER to SET and vice versa more portable - to allow for bit operations on INTEGER values - *) - TYPE - SetInt* = LONGINT; (* INTEGER type that corresponds to SET *) - VAR msb* : SET; - msbIsMax*, msbIs0*: SHORTINT; - msbindex*, lsbindex*, nofbits*: LONGINT; - - PROCEDURE ToInt8*(int: LONGINT) : Int8; - BEGIN - RETURN SHORT(SHORT(int)) - END ToInt8; - - PROCEDURE ToInt16*(int: LONGINT) : Int16; - BEGIN - RETURN SYS.VAL(Int16, int) - END ToInt16; - - PROCEDURE ToInt32*(int: LONGINT) : Int32; - BEGIN - RETURN int - END ToInt32; - - PROCEDURE ToReal32*(real: LONGREAL) : Real32; - BEGIN - RETURN SHORT(real) - END ToReal32; - - PROCEDURE ToReal64*(real: LONGREAL) : Real64; - BEGIN - RETURN real - END ToReal64; - -BEGIN - msb := SYS.VAL(SET, MIN(SetInt)); - (* most significant bit, converted to a SET *) - (* we expect msbIsMax XOR msbIs0 to be 1; - this is checked for by an assertion - *) - msbIsMax := SYS.VAL(SHORTINT, (msb = {MAX(SET)})); - (* is 1, if msb equals {MAX(SET)} *) - msbIs0 := SYS.VAL(SHORTINT, (msb = {0})); - (* is 0, if msb equals {0} *) - msbindex := msbIsMax * MAX(SET); - (* set element that corresponds to the most-significant-bit *) - lsbindex := MAX(SET) - msbindex; - (* set element that corresponds to the lowest-significant-bit *) - nofbits := MAX(SET) + 1; - (* number of elements in SETs *) - - ASSERT((msbIs0 = 1) & (msbIsMax = 0) OR (msbIs0 = 0) & (msbIsMax = 1)); -END ulmTypes. diff --git a/src/lib/ulm/x86_64/ulmSYSTEM.Mod b/src/lib/ulm/ulmSYSTEM.Mod similarity index 100% rename from src/lib/ulm/x86_64/ulmSYSTEM.Mod rename to src/lib/ulm/ulmSYSTEM.Mod diff --git a/src/lib/ulm/x86_64/ulmSysConversions.Mod b/src/lib/ulm/ulmSysConversions.Mod similarity index 100% rename from src/lib/ulm/x86_64/ulmSysConversions.Mod rename to src/lib/ulm/ulmSysConversions.Mod diff --git a/src/lib/ulm/x86_64/ulmSysStat.Mod b/src/lib/ulm/ulmSysStat.Mod similarity index 100% rename from src/lib/ulm/x86_64/ulmSysStat.Mod rename to src/lib/ulm/ulmSysStat.Mod diff --git a/src/lib/ulm/armv6j_hardfp/ulmSysTypes.Mod b/src/lib/ulm/ulmSysTypes.Mod similarity index 100% rename from src/lib/ulm/armv6j_hardfp/ulmSysTypes.Mod rename to src/lib/ulm/ulmSysTypes.Mod diff --git a/src/lib/ulm/x86_64/ulmTypes.Mod b/src/lib/ulm/ulmTypes.Mod similarity index 100% rename from src/lib/ulm/x86_64/ulmTypes.Mod rename to src/lib/ulm/ulmTypes.Mod diff --git a/src/lib/ulm/x86/ulmSYSTEM.Mod b/src/lib/ulm/x86/ulmSYSTEM.Mod deleted file mode 100644 index 814c0607..00000000 --- a/src/lib/ulm/x86/ulmSYSTEM.Mod +++ /dev/null @@ -1,137 +0,0 @@ -MODULE ulmSYSTEM; -IMPORT SYSTEM, Unix, Sys := ulmSys; - -TYPE pchar = POINTER TO ARRAY 1 OF CHAR; - pstring = POINTER TO ARRAY 1024 OF CHAR; - pstatus = POINTER TO Unix.Status; - - TYPE bytearray* = ARRAY SIZE(LONGINT) OF SYSTEM.BYTE; (* need this because voc does not convert implicitly LONGINT to ARRAY OF BYTE; -- noch *) - pbytearray* = POINTER TO bytearray; - TYPE longrealarray* = ARRAY SIZE(LONGREAL) OF SYSTEM.BYTE; (* need this because voc does not convert implicitly LONGINT to ARRAY OF BYTE; -- noch *) - plongrealarray* = POINTER TO bytearray; - - PROCEDURE LongToByteArr* ( l : LONGINT; VAR bar : bytearray); (* noch *) - VAR b : SYSTEM.BYTE; - p : pbytearray; - i : LONGINT; - BEGIN - p := SYSTEM.VAL(pbytearray, SYSTEM.ADR(l)); - FOR i := 0 TO SIZE(LONGINT) -1 DO - b := p^[i]; bar[i] := b; - END - END LongToByteArr; - - PROCEDURE LRealToByteArr* ( l : LONGREAL; VAR lar : longrealarray); (* noch *) - VAR b : SYSTEM.BYTE; - p : plongrealarray; - i : LONGINT; - BEGIN - p := SYSTEM.VAL(plongrealarray, SYSTEM.ADR(l)); - FOR i := 0 TO SIZE(LONGREAL) -1 DO - b := p^[i]; lar[i] := b; - END - END LRealToByteArr; - - -(* - PROCEDURE -Write(adr, n: LONGINT): LONGINT - "write(1/*stdout*/, adr, n)"; - - PROCEDURE -read(VAR ch: CHAR): LONGINT - "read(0/*stdin*/, ch, 1)"; -*) - - PROCEDURE TAS*(VAR flag:BOOLEAN): BOOLEAN; (* added for compatibility with ulmSYSTEM module; noch *) - VAR oldflag : BOOLEAN; - BEGIN - oldflag := flag; - flag := TRUE; - RETURN oldflag; - END TAS; - - PROCEDURE UNIXCALL*(syscall: LONGINT; VAR d0, d1: LONGINT; (* in ulm version both LONGINT and INTEGER are 4 byte size *) - arg1, arg2, arg3: LONGINT) : BOOLEAN; - VAR - n : LONGINT; - ch : CHAR; - pch : pchar; - pstr : pstring; - pst : pstatus; - BEGIN - - IF syscall = Sys.read THEN - d0 := Unix.Read(arg1, arg2, arg3); - IF d0 >= 0 THEN RETURN TRUE ELSE RETURN FALSE END - (*NEW(pch); - pch := SYSTEM.VAL(pchar, arg2); - ch := pch^[0]; - n := read(ch); - IF n # 1 THEN - ch := 0X; - RETURN FALSE - ELSE - pch^[0] := ch; - RETURN TRUE - END; - *) - ELSIF syscall = Sys.write THEN - d0 := Unix.Write(arg1, arg2, arg3); - IF d0 >= 0 THEN RETURN TRUE ELSE RETURN FALSE END - (*NEW(pch); - pch := SYSTEM.VAL(pchar, arg2); - n := Write(SYSTEM.VAL(LONGINT, pch), 1); - IF n # 1 THEN RETURN FALSE ELSE RETURN TRUE END - *) - ELSIF syscall = Sys.open THEN - pstr := SYSTEM.VAL(pstring, arg1); - d0 := Unix.Open(pstr^, SYSTEM.VAL(SET, arg3), SYSTEM.VAL(SET, arg2)); - IF d0 >= 0 THEN RETURN TRUE ELSE RETURN FALSE END - ELSIF syscall = Sys.close THEN - d0 := Unix.Close(arg1); - IF d0 = 0 THEN RETURN TRUE ELSE RETURN FALSE END - ELSIF syscall = Sys.lseek THEN - d0 := Unix.Lseek(arg1, arg2, arg3); - IF d0 >= 0 THEN RETURN TRUE ELSE RETURN FALSE END - ELSIF syscall = Sys.ioctl THEN - d0 := Unix.Ioctl(arg1, arg2, arg3); - RETURN d0 >= 0; - ELSIF syscall = Sys.fcntl THEN - d0 := Unix.Fcntl (arg1, arg2, arg3); - RETURN d0 >= 0; - ELSIF syscall = Sys.dup THEN - d0 := Unix.Dup(arg1); - RETURN d0 > 0; - ELSIF syscall = Sys.pipe THEN - d0 := Unix.Pipe(arg1); - RETURN d0 >= 0; - ELSIF syscall = Sys.newstat THEN - pst := SYSTEM.VAL(pstatus, arg2); - pstr := SYSTEM.VAL(pstring, arg1); - d0 := Unix.Stat(pstr^, pst^); - RETURN d0 >= 0 - ELSIF syscall = Sys.newfstat THEN - pst := SYSTEM.VAL(pstatus, arg2); - d0 := Unix.Fstat(arg1, pst^); - RETURN d0 >= 0; - END - - END UNIXCALL; - - - PROCEDURE UNIXFORK(VAR pid: LONGINT) : BOOLEAN; - BEGIN - - END UNIXFORK; - - PROCEDURE UNIXSIGNAL(signo: INTEGER; p: PROCEDURE; - VAR old: PROCEDURE; VAR error: INTEGER) : BOOLEAN; - BEGIN - - END UNIXSIGNAL; - - PROCEDURE WMOVE*(from, to, n : LONGINT); - VAR l : LONGINT; - BEGIN - SYSTEM.MOVE(from, to, n); - END WMOVE; -END ulmSYSTEM. diff --git a/src/lib/ulm/x86/ulmSysConversions.Mod b/src/lib/ulm/x86/ulmSysConversions.Mod deleted file mode 100644 index f8ea3fbb..00000000 --- a/src/lib/ulm/x86/ulmSysConversions.Mod +++ /dev/null @@ -1,574 +0,0 @@ -(* Ulm's Oberon Library - Copyright (C) 1989-1994 by University of Ulm, SAI, D-89069 Ulm, Germany - ---------------------------------------------------------------------------- - Ulm's Oberon Library is free software; you can redistribute it - and/or modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either version - 2 of the License, or (at your option) any later version. - - Ulm's Oberon Library is distributed in the hope that it will be - useful, but WITHOUT ANY WARRANTY; without even the implied warranty - of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - ---------------------------------------------------------------------------- - E-mail contact: oberon@mathematik.uni-ulm.de - ---------------------------------------------------------------------------- - $Id: SysConversi.om,v 1.2 1997/07/30 09:38:16 borchert Exp $ - ---------------------------------------------------------------------------- - $Log: SysConversi.om,v $ - Revision 1.2 1997/07/30 09:38:16 borchert - bug in ReadConv fixed: cv.flags was used but not set for - counts > 1 - - Revision 1.1 1994/02/23 07:58:28 borchert - Initial revision - - ---------------------------------------------------------------------------- - AFB 8/90 - adapted to linux cae 02/01 - ---------------------------------------------------------------------------- -*) - -MODULE ulmSysConversions; - - (* convert Oberon records to/from C structures *) - - IMPORT Events := ulmEvents, Objects := ulmObjects, Priorities := ulmPriorities, Streams := ulmStreams, Strings := ulmStrings, - SYS := SYSTEM, SysTypes := ulmSysTypes, Texts := ulmTexts; - - TYPE - Address* = SysTypes.Address; - Size* = Address; - - (* format: - - Format = Conversion { "/" Conversion } . - Conversion = [ Factors ] ConvChars [ Comment ] . - Factors = Array | Factor | Array Factor | Factor Array . - Array = Integer ":" . - Factor = Integer "*" . - ConvChars = OberonType CType | Skip CType | OberonType Skip . - OberonType = "a" | "b" | "c" | "s" | "i" | "l" | "S" . - CType = "a" | "c" | "s" | "i" | "l" . - Integer = Digit { Digit } . - Digit = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" . - Skip = "-" . - Comment = "=" { AnyChar } . - AnyChar = (* all characters except "/" *) . - - Oberon data types: - - a: Address - b: SYS.BYTE - B: BOOLEAN - c: CHAR - s: SHORTINT - i: INTEGER - l: LONGINT - S: SET - - C data types: - - a: char * - c: /* signed */ char - C: unsigned char - s: short int - S: unsigned short int - i: int - I: unsigned int - u: unsigned int - l: long int - L: unsigned long int - - example: - - conversion from - - Rec = - RECORD - a, b: INTEGER; - c: CHAR; - s: SET; - f: ARRAY 3 OF INTEGER; - END; - - to - - struct rec { - short a, b; - char c; - int xx; /* to be skipped on conversion */ - int s; - int f[3]; - }; - - or vice versa: - - "2*is=a,b/cc=c/-i=xx/Si=s/3:ii=f" - - The comments allow to give the field names. - *) - - CONST - (* conversion flags *) - unsigned = 0; (* suppress sign extension *) - boolean = 1; (* convert anything # 0 to 1 *) - TYPE - Flags = SET; - Event* = POINTER TO EventRec; - EventRec* = - RECORD - (Events.EventRec) - format*: Events.Message; - END; - ConvStream = POINTER TO ConvStreamRec; - ConvStreamRec = - RECORD - fmt: Texts.Text; - char: CHAR; - eof: BOOLEAN; - (* 1: Oberon type - 2: C type - *) - type1, type2: CHAR; length: INTEGER; left: INTEGER; - offset1, offset2: Address; - size1, size2: Address; elementsleft: INTEGER; flags: Flags; - END; - - Format* = POINTER TO FormatRec; - FormatRec* = - RECORD - (Objects.ObjectRec) - offset1, offset2: Address; - size1, size2: Address; - flags: Flags; - next: Format; - END; - VAR - badformat*: Events.EventType; - - PROCEDURE Error(cv: ConvStream; msg: ARRAY OF CHAR); - VAR - event: Event; - BEGIN - NEW(event); - event.type := badformat; - event.message := "SysConversions: "; - Strings.Concatenate(event.message, msg); - Strings.Read(event.format, cv.fmt); - Events.Raise(event); - cv.eof := TRUE; - cv.char := 0X; - cv.left := 0; - cv.elementsleft := 0; - END Error; - - PROCEDURE SizeError(msg, format: ARRAY OF CHAR); - VAR - event: Event; - BEGIN - NEW(event); - event.type := badformat; - event.message := "SysConversions: "; - Strings.Concatenate(event.message, msg); - COPY(format, event.format); - Events.Raise(event); - END SizeError; - - PROCEDURE NextCh(cv: ConvStream); - BEGIN - cv.eof := cv.eof OR ~Streams.ReadByte(cv.fmt, cv.char) OR (cv.char = 0X); - IF cv.eof THEN - cv.char := 0X; - END; - END NextCh; - - PROCEDURE IsDigit(ch: CHAR) : BOOLEAN; - BEGIN - RETURN (ch >= "0") & (ch <= "9") - END IsDigit; - - PROCEDURE ReadInt(cv: ConvStream; VAR i: INTEGER); - BEGIN - i := 0; - REPEAT - i := 10 * i + ORD(cv.char) - ORD("0"); - NextCh(cv); - UNTIL ~IsDigit(cv.char); - END ReadInt; - - PROCEDURE Open(VAR cv: ConvStream; format: ARRAY OF CHAR); - BEGIN - NEW(cv); - Texts.Open(SYS.VAL(Streams.Stream, cv.fmt)); - Strings.Write(cv.fmt, format); - cv.left := 0; cv.elementsleft := 0; - cv.offset1 := 0; cv.offset2 := 0; - cv.eof := FALSE; - NextCh(cv); - END Open; - - PROCEDURE Close(VAR cv: ConvStream); - BEGIN - IF ~Streams.Close(cv.fmt) THEN END; - END Close; - - PROCEDURE ScanConv(cv: ConvStream; - VAR type1, type2: CHAR; - VAR length: INTEGER) : BOOLEAN; - VAR - i: INTEGER; - factor: INTEGER; - BEGIN - IF cv.left > 0 THEN - type1 := cv.type1; - type2 := cv.type2; - length := cv.length; - DEC(cv.left); - RETURN TRUE - END; - IF cv.char = "/" THEN - NextCh(cv); - END; - IF cv.eof THEN - RETURN FALSE - END; - factor := 0; length := 0; - WHILE IsDigit(cv.char) DO - ReadInt(cv, i); - IF i <= 0 THEN - Error(cv, "integer must be positive"); RETURN FALSE - END; - IF cv.char = ":" THEN - IF length # 0 THEN - Error(cv, "multiple length specification"); RETURN FALSE - END; - length := i; - NextCh(cv); - ELSIF cv.char = "*" THEN - IF factor # 0 THEN - Error(cv, "multiple factor specification"); RETURN FALSE - END; - factor := i; cv.left := factor - 1; - NextCh(cv); - ELSE - Error(cv, "factor or length expected"); RETURN FALSE - END; - END; - type1 := cv.char; NextCh(cv); - type2 := cv.char; NextCh(cv); - IF cv.left > 0 THEN - cv.type1 := type1; cv.type2 := type2; cv.length := length; - END; - IF cv.char = "=" THEN (* comment *) - REPEAT - NextCh(cv); - UNTIL cv.eof OR (cv.char = "/"); - END; - RETURN TRUE - END ScanConv; - - PROCEDURE Align(VAR offset: Address; boundary: Address); - BEGIN - IF SYS.VAL (INTEGER, offset) MOD SYS.VAL (INTEGER, boundary) # 0 THEN - offset := SYS.VAL (INTEGER, offset) + (SYS.VAL (INTEGER, boundary) - SYS.VAL (INTEGER, offset) MOD SYS.VAL (INTEGER, boundary)); - END; - END Align; - - PROCEDURE ReadConv(cv: ConvStream; - VAR offset1, offset2: Address; - VAR size1, size2: Address; - VAR flags: Flags) : BOOLEAN; - VAR - type1, type2: CHAR; - length: INTEGER; - align: BOOLEAN; - boundary: INTEGER; - BEGIN - IF cv.elementsleft > 0 THEN - DEC(cv.elementsleft); - - (* Oberon type *) - IF size1 > SIZE(SYS.BYTE) THEN - Align(cv.offset1, SIZE(INTEGER)); - END; - offset1 := cv.offset1; cv.offset1 := SYS.VAL (INTEGER, cv.offset1) + size1; - size1 := cv.size1; size2 := cv.size2; flags := cv.flags; - IF (size1 > 0) & (cv.elementsleft = 0) THEN - Align(cv.offset1, SIZE(INTEGER)); - END; - - (* C type *) - IF size2 > 1 THEN - Align(cv.offset2, 2); - END; - offset2 := cv.offset2; cv.offset2 := SYS.VAL (INTEGER, cv.offset2) + SYS.VAL (INTEGER, size2); - - RETURN TRUE - END; - IF ScanConv(cv, type1, type2, length) THEN - flags := {}; - (* Oberon type *) - CASE type1 OF - | "a": size1 := SIZE(Address); INCL(flags, unsigned); - | "b": size1 := SIZE(SYS.BYTE); INCL(flags, unsigned); - | "B": size1 := SIZE(BOOLEAN); INCL(flags, boolean); - | "c": size1 := SIZE(CHAR); INCL(flags, unsigned); - | "s": size1 := SIZE(SHORTINT); - | "i": size1 := SIZE(INTEGER); - | "l": size1 := SIZE(LONGINT); - | "S": size1 := SIZE(SET); INCL(flags, unsigned); - | "-": size1 := 0; - ELSE Error(cv, "bad Oberon type specifier"); RETURN FALSE - END; - IF size1 > 0 THEN - IF length > 0 THEN - Align(cv.offset1, SIZE(INTEGER)); - ELSIF size1 > SIZE(SYS.BYTE) THEN - Align(cv.offset1, SIZE(INTEGER)); - END; - END; - offset1 := cv.offset1; cv.offset1 := SYS.VAL (INTEGER, cv.offset1) + size1; - - (* C type *) - CASE type2 OF - | "a": size2 := 4; INCL(flags, unsigned); (* char* *) - | "c": size2 := 1; (* /* signed */ char *) - | "C": size2 := 1; INCL(flags, unsigned); (* unsigned char *) - | "s": size2 := 2; (* short int *) - | "S": size2 := 2; INCL(flags, unsigned); (* unsigned short int *) - | "i": size2 := 4; (* int *) - | "I": size2 := 4; INCL(flags, unsigned); (* unsigned int *) - | "u": size2 := 4; INCL(flags, unsigned); (* unsigned int *) - | "l": size2 := 4; (* long int *) - | "L": size2 := 4; INCL(flags, unsigned); (* long int *) - | "-": size2 := 0; - ELSE Error(cv, "bad C type specifier"); RETURN FALSE - END; - IF size2 > 1 THEN - Align(cv.offset2, size2); - END; - offset2 := cv.offset2; cv.offset2 := SYS.VAL (INTEGER, cv.offset2) + SYS.VAL (INTEGER, size2); - - cv.size1 := size1; cv.size2 := size2; - IF length > 0 THEN - cv.elementsleft := length - 1; - cv.flags := flags; - END; - RETURN TRUE - ELSE - RETURN FALSE - END; - END ReadConv; - - PROCEDURE Convert(from, to: Address; ssize, dsize: Address; flags: Flags); - TYPE - Bytes = ARRAY 8 OF CHAR; - Pointer = POINTER TO Bytes; - VAR - dest, source: Pointer; - dindex, sindex: INTEGER; - nonzero: BOOLEAN; - fill : CHAR; - BEGIN - IF ssize > 0 THEN - dest := SYS.VAL(Pointer, to); - source := SYS.VAL(Pointer, from); - dindex := 0; sindex := 0; - IF boolean IN flags THEN - nonzero := FALSE; - WHILE ssize > 0 DO - nonzero := nonzero OR (source[sindex] # 0X); - INC(sindex); ssize := SYS.VAL (INTEGER, ssize) - 1; - END; - IF dsize > 0 THEN - IF nonzero THEN - dest[dindex] := 1X; - ELSE - dest[dindex] := 0X; - END; - dsize := dsize - 1; INC (dindex); - END; - WHILE dsize > 0 DO - dest[dindex] := 0X; - dsize := SYS.VAL (INTEGER, dsize) - 1; INC(dindex); - END; - ELSE - WHILE (dsize > 0) & (ssize > 0) DO - dest[dindex] := source[sindex]; - ssize := SYS.VAL (INTEGER, ssize) - 1; - dsize := dsize - 1; - INC(dindex); INC(sindex); - END; - IF dsize > 0 THEN - (* sindex has been incremented at least once because - * ssize and dsize were greater than 0, i.e. sindex-1 - * is a valid inex. *) - fill := 0X; - IF ~(unsigned IN flags) & (source[sindex-1] >= 080X) THEN - fill := 0FFX; - END; - END; - WHILE dsize > 0 DO - dest[dindex] := fill; - dsize := SYS.VAL (INTEGER, dsize) - 1; INC(dindex); - END; - END; - END; - END Convert; - - PROCEDURE ByAddrToC*(from, to: Address; format: ARRAY OF CHAR); - VAR - cv: ConvStream; - offset1, offset2, size1, size2: Address; - flags: Flags; - BEGIN - Open(cv, format); - WHILE ReadConv(cv, offset1, offset2, size1, size2, flags) DO - Convert(from + offset1, to + offset2, size1, size2, flags); - END; - Close(cv); - END ByAddrToC; - - PROCEDURE ByAddrFromC*(from, to: Address; format: ARRAY OF CHAR); - VAR - cv: ConvStream; - offset1, offset2, size1, size2: Address; - flags: Flags; - BEGIN - Open(cv, format); - WHILE ReadConv(cv, offset1, offset2, size1, size2, flags) DO - Convert(from + offset2, to + offset1, size2, size1, flags); - END; - Close(cv); - END ByAddrFromC; - - PROCEDURE CSize*(format: ARRAY OF CHAR) : Size; - (* returns the size of the C-structure described by `format' *) - VAR - cv: ConvStream; - offset1, offset2, size1, size2: Address; - size: Address; - flags: Flags; - BEGIN - Open(cv, format); - WHILE ReadConv(cv, offset1, offset2, size1, size2, flags) DO END; - Close(cv); - size := offset2 + size2; - Align(size, 2); - RETURN size - END CSize; - - PROCEDURE OberonSize*(format: ARRAY OF CHAR) : Size; - (* returns the size of the Oberon-structure described by `format' *) - VAR - cv: ConvStream; - offset1, offset2, size1, size2: Address; - size: Address; - flags: Flags; - BEGIN - Open(cv, format); - WHILE ReadConv(cv, offset1, offset2, size1, size2, flags) DO END; - Close(cv); - size := offset1 + size1; - Align(size, SIZE(INTEGER)); - RETURN size - END OberonSize; - - PROCEDURE ToC*(VAR from, to: ARRAY OF SYS.BYTE; format: ARRAY OF CHAR); - BEGIN - IF OberonSize(format) > LEN(from) THEN - SizeError("Oberon record is too small", format); RETURN - END; - IF CSize(format) > LEN(to) THEN - SizeError("C structure is too small", format); RETURN - END; - ByAddrToC(SYS.ADR(from), SYS.ADR(to), format); - END ToC; - - PROCEDURE FromC*(VAR from, to: ARRAY OF SYS.BYTE; format: ARRAY OF CHAR); - BEGIN - IF OberonSize(format) > LEN(to) THEN - SizeError("Oberon record is too small", format); RETURN - END; - IF CSize(format) > LEN(from) THEN - SizeError("C structure is too small", format); RETURN - END; - ByAddrFromC(SYS.ADR(from), SYS.ADR(to), format); - END FromC; - - PROCEDURE Compile*(VAR fmt: Format; format: ARRAY OF CHAR); - (* translate format into an internal representation - which is later referenced by fmt; - ByFmtToC and ByFmtFromC are faster than ToC and FromC - *) - VAR - cv: ConvStream; - offset1, offset2, size1, size2: Address; - flags: Flags; - element: Format; - head, tail: Format; - BEGIN - Open(cv, format); - head := NIL; tail := NIL; - WHILE ReadConv(cv, offset1, offset2, size1, size2, flags) DO - NEW(element); - element.offset1 := offset1; - element.offset2 := offset2; - element.size1 := size1; - element.size2 := size2; - element.flags := flags; - element.next := NIL; - IF tail # NIL THEN - tail.next := element; - ELSE - head := element; - END; - tail := element; - END; - fmt := head; - Close(cv); - END Compile; - - PROCEDURE ByFmtAndAddrToC*(from, to: Address; format: Format); - VAR - offset1, offset2, size1, size2: Address; - flags: Flags; - BEGIN - WHILE format # NIL DO - Convert(from + format.offset1, to + format.offset2, - format.size1, format.size2, format.flags); - format := format.next; - END; - END ByFmtAndAddrToC; - - PROCEDURE ByFmtAndAddrFromC*(from, to: Address; format: Format); - VAR - offset1, offset2, size1, size2: Address; - flags: Flags; - BEGIN - WHILE format # NIL DO - Convert(from + format.offset2, to + format.offset1, - format.size2, format.size1, format.flags); - format := format.next; - END; - END ByFmtAndAddrFromC; - - PROCEDURE ByFmtToC*(VAR from, to: ARRAY OF SYS.BYTE; format: Format); - BEGIN - ByFmtAndAddrToC(SYS.ADR(from), SYS.ADR(to), format); - END ByFmtToC; - - PROCEDURE ByFmtFromC*(VAR from, to: ARRAY OF SYS.BYTE; format: Format); - BEGIN - ByFmtAndAddrFromC(SYS.ADR(from), SYS.ADR(to), format); - END ByFmtFromC; - -BEGIN - Events.Define(badformat); - Events.SetPriority(badformat, Priorities.liberrors); -END ulmSysConversions. diff --git a/src/lib/ulm/x86/ulmSysStat.Mod b/src/lib/ulm/x86/ulmSysStat.Mod deleted file mode 100644 index c7f00f04..00000000 --- a/src/lib/ulm/x86/ulmSysStat.Mod +++ /dev/null @@ -1,201 +0,0 @@ -(* Ulm's Oberon Library - Copyright (C) 1989-1994 by University of Ulm, SAI, D-89069 Ulm, Germany - ---------------------------------------------------------------------------- - Ulm's Oberon Library is free software; you can redistribute it - and/or modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either version - 2 of the License, or (at your option) any later version. - - Ulm's Oberon Library is distributed in the hope that it will be - useful, but WITHOUT ANY WARRANTY; without even the implied warranty - of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - ---------------------------------------------------------------------------- - E-mail contact: oberon@mathematik.uni-ulm.de - ---------------------------------------------------------------------------- - $Id: SysStat.om,v 1.3 2000/11/12 13:02:09 borchert Exp $ - ---------------------------------------------------------------------------- - $Log: SysStat.om,v $ - Revision 1.3 2000/11/12 13:02:09 borchert - door file type added - - Revision 1.2 2000/11/12 12:48:07 borchert - - conversion adapted to Solaris 2.x - - Lstat added - - Revision 1.1 1994/02/23 08:00:48 borchert - Initial revision - - ---------------------------------------------------------------------------- - AFB 9/89 - ---------------------------------------------------------------------------- -*) - -MODULE ulmSysStat; - - (* examine inode: stat(2) and fstat(2) *) - - IMPORT RelatedEvents := ulmRelatedEvents, Sys := ulmSys, SYS := SYSTEM, uSYS := ulmSYSTEM, SysConversions := ulmSysConversions, SysErrors := ulmSysErrors, - SysTypes := ulmSysTypes; - - CONST - (* file mode: - bit 0 = 1<<0 bit 31 = 1<<31 - - user group other - 3 1 1111 11 - 1 ... 6 5432 109 876 543 210 - +--------+------+-----+-----+-----+-----+ - | unused | type | sst | rwx | rwx | rwx | - +--------+------+-----+-----+-----+-----+ - *) - - type* = {12..15}; - prot* = {0..8}; - - (* file types; example: (stat.mode * type = dir) *) - reg* = {15}; (* regular *) - dir* = {14}; (* directory *) - chr* = {13}; (* character special *) - fifo* = {12}; (* fifo *) - blk* = {13..14}; (* block special *) - symlink* = {13, 15}; (* symbolic link *) - socket* = {14, 15}; (* socket *) - - (* special *) - setuid* = 11; (* set user id on execution *) - setgid* = 10; (* set group id on execution *) - savetext* = 9; (* save swapped text even after use *) - - (* protection *) - uread* = 8; (* read permission owner *) - uwrite* = 7; (* write permission owner *) - uexec* = 6; (* execute/search permission owner *) - gread* = 5; (* read permission group *) - gwrite* = 4; (* write permission group *) - gexec* = 3; (* execute/search permission group *) - oread* = 2; (* read permission other *) - owrite* = 1; (* write permission other *) - oexec* = 0; (* execute/search permission other *) - - (* example for "r-xr-x---": (read + exec) * (owner + group) *) - owner* = {uread, uwrite, uexec}; - group* = {gread, gwrite, gexec}; - other* = {oread, owrite, oexec}; - read* = {uread, gread, oread}; - write* = {uwrite, gwrite, owrite}; - exec* = {uexec, gexec, oexec}; - rwx* = prot; - - TYPE - StatRec* = (* result of stat(2) and fstat(2) *) - RECORD - device*: SysTypes.Device; (* ID of device containing - a directory entry for this file *) - inode*: SysTypes.Inode; (* inode number *) - mode*: SET; (* file mode; see mknod(2) *) - nlinks*: LONGINT; (* number of links *) - uid*: LONGINT; (* user id of the file's owner *) - gid*: LONGINT; (* group id of the file's group *) - rdev*: SysTypes.Device; (* ID of device - this entry is defined only for - character special or block - special files - *) - size*: SysTypes.Offset; (* file size in bytes *) - blksize*: LONGINT; (* preferred blocksize *) - blocks*: LONGINT; (* # of blocks allocated *) - atime*: SysTypes.Time; (* time of last access *) - mtime*: SysTypes.Time; (* time of last data modification *) - ctime*: SysTypes.Time; (* time of last file status change *) - END; - -(* Linux kernel struct stat (2.2.17) - struct stat { - unsigned short st_dev; - unsigned short __pad1; - unsigned long st_ino; - unsigned short st_mode; - unsigned short st_nlink; - unsigned short st_uid; - unsigned short st_gid; - unsigned short st_rdev; - unsigned short __pad2; - unsigned long st_size; - unsigned long st_blksize; - unsigned long st_blocks; - unsigned long st_atime; - unsigned long __unused1; - unsigned long st_mtime; - unsigned long __unused2; - unsigned long st_ctime; - unsigned long __unused3; - unsigned long __unused4; - unsigned long __unused5; - }; -*) - - CONST - statbufsize = 88(*64*); (* see *) (* sizeof struct stat gives us 144 on x86_64 and 88 on x86 *) - TYPE - UnixStatRec = ARRAY statbufsize OF SYS.BYTE; - CONST - statbufconv = - (*"is=dev/-s=pad1/ll=ino/Ss=mode/4*is=nlink+uid+gid+rdev/-s=pad2/ll=size/2*ll=blksize,blocks/il=atime/-l/il=mtime/-l/il=ctime/3*-l";*) - (*"ls=dev/-s=pad1/lL=ino/Ss=mode/4*is=nlink+uid+gid+rdev/-s=pad2/lL=size/2*lL=blksize,blocks/lL=atime/-l/lL=mtime/-l/lL=ctime/3*-l";*) - "ll=dev/-l=devx/-s=pad1/ll=ino/Sl=mode/ll=nlink/ll=uid/ll=gid/ll=rdev/-l=rdevx/-s=pad2/ll=size/2*ll=blksize,blocks/lL=atime/-l/lL=mtime/-l/lL=ctime/3*-l"; - VAR - statbuffmt: SysConversions.Format; - - PROCEDURE Stat*(path: ARRAY OF CHAR; VAR buf: StatRec; - errors: RelatedEvents.Object) : BOOLEAN; - VAR - d0, d1, d2: LONGINT; - origbuf: UnixStatRec; - BEGIN - IF uSYS.UNIXCALL(Sys.newstat, d0, d1, SYS.ADR(path), SYS.ADR(origbuf), d2) THEN - SysConversions.ByFmtFromC(origbuf, buf, statbuffmt); - RETURN TRUE - ELSE - SysErrors.Raise(errors, d0, Sys.newstat, path); - RETURN FALSE - END; - END Stat; -(* - PROCEDURE Lstat*(path: ARRAY OF CHAR; VAR buf: StatRec; - errors: RelatedEvents.Object) : BOOLEAN; - VAR - d0, d1: INTEGER; - origbuf: UnixStatRec; - BEGIN - IF SYS.UNIXCALL(Sys.newlstat, d0, d1, SYS.ADR(path), SYS.ADR(origbuf)) THEN - SysConversions.ByFmtFromC(origbuf, buf, statbuffmt); - RETURN TRUE - ELSE - SysErrors.Raise(errors, d0, Sys.newlstat, path); - RETURN FALSE - END; - END Lstat; -*) - PROCEDURE Fstat*(fd: SysTypes.File; VAR buf: StatRec; - errors: RelatedEvents.Object) : BOOLEAN; - VAR - d0, d1, d2: LONGINT; - origbuf: UnixStatRec; - BEGIN - IF uSYS.UNIXCALL(Sys.newfstat, d0, d1, fd, SYS.ADR(origbuf), d2) THEN - SysConversions.ByFmtFromC(origbuf, buf, statbuffmt); - RETURN TRUE - ELSE - SysErrors.Raise(errors, d0, Sys.newfstat, ""); - RETURN FALSE - END; - END Fstat; - -BEGIN - SysConversions.Compile(statbuffmt, statbufconv); -END ulmSysStat. diff --git a/src/lib/ulm/x86/ulmSysTypes.Mod b/src/lib/ulm/x86/ulmSysTypes.Mod deleted file mode 100644 index 174140e7..00000000 --- a/src/lib/ulm/x86/ulmSysTypes.Mod +++ /dev/null @@ -1,70 +0,0 @@ -(* Ulm's Oberon Library - Copyright (C) 1989-1994 by University of Ulm, SAI, D-89069 Ulm, Germany - ---------------------------------------------------------------------------- - Ulm's Oberon Library is free software; you can redistribute it - and/or modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either version - 2 of the License, or (at your option) any later version. - - Ulm's Oberon Library is distributed in the hope that it will be - useful, but WITHOUT ANY WARRANTY; without even the implied warranty - of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - ---------------------------------------------------------------------------- - E-mail contact: oberon@mathematik.uni-ulm.de - ---------------------------------------------------------------------------- - $Id: SysTypes.om,v 1.1 1994/02/23 08:01:38 borchert Exp $ - ---------------------------------------------------------------------------- - $Log: SysTypes.om,v $ - Revision 1.1 1994/02/23 08:01:38 borchert - Initial revision - - ---------------------------------------------------------------------------- - AFB 9/89 - ---------------------------------------------------------------------------- -*) - -MODULE ulmSysTypes; - - IMPORT Types := ulmTypes; - - TYPE - Address* = Types.Address; - UntracedAddress* = Types.UntracedAddress; - Count* = Types.Count; - Size* = Types.Size; - Byte* = Types.Byte; - - File* = (*INTEGER*)LONGINT; (* in ulm's system both INTEGER and LONGINT are 4 bytes long *) - Offset* = LONGINT; - Device* = LONGINT; - Inode* = LONGINT; - Time* = LONGINT; - - Word* = INTEGER; (* must have the size of C's int-type *) - - (* Note: linux supports wait4 but not waitid, i.e. these - * constants aren't needed. *) - (* - CONST - (* possible values of the idtype parameter (4 bytes), - see - *) - idPid = 0; (* a process identifier *) - idPpid = 1; (* a parent process identifier *) - idPgid = 2; (* a process group (job control group) identifier *) - idSid = 3; (* a session identifier *) - idCid = 4; (* a scheduling class identifier *) - idUid = 5; (* a user identifier *) - idGid = 6; (* a group identifier *) - idAll = 7; (* all processes *) - idLwpid = 8; (* an LWP identifier *) - TYPE - IdType = INTEGER; (* idPid .. idLwpid *) - *) - -END ulmSysTypes. diff --git a/src/lib/ulm/x86/ulmTypes.Mod b/src/lib/ulm/x86/ulmTypes.Mod deleted file mode 100644 index a9aa73d0..00000000 --- a/src/lib/ulm/x86/ulmTypes.Mod +++ /dev/null @@ -1,133 +0,0 @@ -(* Ulm's Oberon Library - Copyright (C) 1989-2000 by University of Ulm, SAI, D-89069 Ulm, Germany - ---------------------------------------------------------------------------- - Ulm's Oberon Library is free software; you can redistribute it - and/or modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either version - 2 of the License, or (at your option) any later version. - - Ulm's Oberon Library is distributed in the hope that it will be - useful, but WITHOUT ANY WARRANTY; without even the implied warranty - of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - ---------------------------------------------------------------------------- - E-mail contact: oberon@mathematik.uni-ulm.de - ---------------------------------------------------------------------------- - $Id: Types.om,v 1.5 2000/12/13 10:03:00 borchert Exp $ - ---------------------------------------------------------------------------- - $Log: Types.om,v $ - Revision 1.5 2000/12/13 10:03:00 borchert - SetInt type used in msb constant - - Revision 1.4 2000/12/13 09:51:57 borchert - constants and types for the relationship of INTEGER and SET added - - Revision 1.3 1998/09/25 15:23:09 borchert - Real32..Real128 added - - Revision 1.2 1994/07/01 11:08:04 borchert - IntAddress, Int8/16/32, ToInt8/16/32 and bit/little endian stuff added - - Revision 1.1 1994/02/22 20:12:14 borchert - Initial revision - - ---------------------------------------------------------------------------- - AFB 9/93 - ---------------------------------------------------------------------------- -*) - -MODULE ulmTypes; - - (* compiler-dependent type definitions; - this version works for Ulm's Oberon Compilers on - following architectures: m68k and sparc - *) - - IMPORT SYS := SYSTEM; - - TYPE - Address* = LONGINT (*SYS.ADDRESS*); - (* ulm compiler can accept - VAR p : SYSTEM.ADDRESS; // SYSTEM.PTR in ETH and V4 versions - ... - p := SYSTEM.ADR(something); - and this is how it is used in ulm oberon system library, - while SYSTEM.ADR returns LONGINT in ETH and V4 versions. - Thus I leave it as LONGINT for now, before coming up with better solution -- noch *) - UntracedAddress* = POINTER[1] TO UntracedAddressDesc; (*SYS.UNTRACEDADDRESS;*) - UntracedAddressDesc* = RECORD[1] END; - Count* = LONGINT; - Size* = Count; - Byte* = SYS.BYTE; - IntAddress* = LONGINT; - Int8* = SHORTINT; - Int16* = INTEGER; - Int32* = LONGINT; - Real32* = REAL; - Real64* = LONGREAL; - - CONST - bigEndian* = 0; (* SPARC, M68K etc *) - littleEndian* = 1; (* Intel 80x86, VAX etc *) - byteorder* = littleEndian; (* machine-dependent constant *) - TYPE - ByteOrder* = SHORTINT; (* bigEndian or littleEndian *) - - (* following constants and type definitions try to make - conversions from INTEGER to SET and vice versa more portable - to allow for bit operations on INTEGER values - *) - TYPE - SetInt* = LONGINT; (* INTEGER type that corresponds to SET *) - VAR msb* : SET; - msbIsMax*, msbIs0*: SHORTINT; - msbindex*, lsbindex*, nofbits*: LONGINT; - - PROCEDURE ToInt8*(int: LONGINT) : Int8; - BEGIN - RETURN SHORT(SHORT(int)) - END ToInt8; - - PROCEDURE ToInt16*(int: LONGINT) : Int16; - BEGIN - RETURN SYS.VAL(Int16, int) - END ToInt16; - - PROCEDURE ToInt32*(int: LONGINT) : Int32; - BEGIN - RETURN int - END ToInt32; - - PROCEDURE ToReal32*(real: LONGREAL) : Real32; - BEGIN - RETURN SHORT(real) - END ToReal32; - - PROCEDURE ToReal64*(real: LONGREAL) : Real64; - BEGIN - RETURN real - END ToReal64; - -BEGIN - msb := SYS.VAL(SET, MIN(SetInt)); - (* most significant bit, converted to a SET *) - (* we expect msbIsMax XOR msbIs0 to be 1; - this is checked for by an assertion - *) - msbIsMax := SYS.VAL(SHORTINT, (msb = {MAX(SET)})); - (* is 1, if msb equals {MAX(SET)} *) - msbIs0 := SYS.VAL(SHORTINT, (msb = {0})); - (* is 0, if msb equals {0} *) - msbindex := msbIsMax * MAX(SET); - (* set element that corresponds to the most-significant-bit *) - lsbindex := MAX(SET) - msbindex; - (* set element that corresponds to the lowest-significant-bit *) - nofbits := MAX(SET) + 1; - (* number of elements in SETs *) - - ASSERT((msbIs0 = 1) & (msbIsMax = 0) OR (msbIs0 = 0) & (msbIsMax = 1)); -END ulmTypes. diff --git a/src/lib/ulm/x86_64/ulmSysTypes.Mod b/src/lib/ulm/x86_64/ulmSysTypes.Mod deleted file mode 100644 index 174140e7..00000000 --- a/src/lib/ulm/x86_64/ulmSysTypes.Mod +++ /dev/null @@ -1,70 +0,0 @@ -(* Ulm's Oberon Library - Copyright (C) 1989-1994 by University of Ulm, SAI, D-89069 Ulm, Germany - ---------------------------------------------------------------------------- - Ulm's Oberon Library is free software; you can redistribute it - and/or modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either version - 2 of the License, or (at your option) any later version. - - Ulm's Oberon Library is distributed in the hope that it will be - useful, but WITHOUT ANY WARRANTY; without even the implied warranty - of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - ---------------------------------------------------------------------------- - E-mail contact: oberon@mathematik.uni-ulm.de - ---------------------------------------------------------------------------- - $Id: SysTypes.om,v 1.1 1994/02/23 08:01:38 borchert Exp $ - ---------------------------------------------------------------------------- - $Log: SysTypes.om,v $ - Revision 1.1 1994/02/23 08:01:38 borchert - Initial revision - - ---------------------------------------------------------------------------- - AFB 9/89 - ---------------------------------------------------------------------------- -*) - -MODULE ulmSysTypes; - - IMPORT Types := ulmTypes; - - TYPE - Address* = Types.Address; - UntracedAddress* = Types.UntracedAddress; - Count* = Types.Count; - Size* = Types.Size; - Byte* = Types.Byte; - - File* = (*INTEGER*)LONGINT; (* in ulm's system both INTEGER and LONGINT are 4 bytes long *) - Offset* = LONGINT; - Device* = LONGINT; - Inode* = LONGINT; - Time* = LONGINT; - - Word* = INTEGER; (* must have the size of C's int-type *) - - (* Note: linux supports wait4 but not waitid, i.e. these - * constants aren't needed. *) - (* - CONST - (* possible values of the idtype parameter (4 bytes), - see - *) - idPid = 0; (* a process identifier *) - idPpid = 1; (* a parent process identifier *) - idPgid = 2; (* a process group (job control group) identifier *) - idSid = 3; (* a session identifier *) - idCid = 4; (* a scheduling class identifier *) - idUid = 5; (* a user identifier *) - idGid = 6; (* a group identifier *) - idAll = 7; (* all processes *) - idLwpid = 8; (* an LWP identifier *) - TYPE - IdType = INTEGER; (* idPid .. idLwpid *) - *) - -END ulmSysTypes. From 126f75883650d0aaf3859437df49cad255ec21fb Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 16 Jun 2016 12:58:46 +0100 Subject: [PATCH 068/580] Consoldate v4 library files part 1 --- src/lib/v4/{x86_64 => }/Reals.Mod | 0 src/lib/v4/Sets.Mod | 137 ----- src/lib/v4/Texts.Mod | 863 ----------------------------- src/lib/v4/armv6j_hardfp/Reals.Mod | 109 ---- src/lib/v4/powerpc/Reals.Mod | 112 ---- src/lib/v4/x86/Reals.Mod | 109 ---- 6 files changed, 1330 deletions(-) rename src/lib/v4/{x86_64 => }/Reals.Mod (100%) delete mode 100644 src/lib/v4/Sets.Mod delete mode 100644 src/lib/v4/Texts.Mod delete mode 100644 src/lib/v4/armv6j_hardfp/Reals.Mod delete mode 100644 src/lib/v4/powerpc/Reals.Mod delete mode 100644 src/lib/v4/x86/Reals.Mod diff --git a/src/lib/v4/x86_64/Reals.Mod b/src/lib/v4/Reals.Mod similarity index 100% rename from src/lib/v4/x86_64/Reals.Mod rename to src/lib/v4/Reals.Mod diff --git a/src/lib/v4/Sets.Mod b/src/lib/v4/Sets.Mod deleted file mode 100644 index 3b46f090..00000000 --- a/src/lib/v4/Sets.Mod +++ /dev/null @@ -1,137 +0,0 @@ -MODULE Sets; - -IMPORT Texts; - -CONST (*size* = 32;*) - size* = MAX(SET) + 1; - -PROCEDURE Clear*(VAR s: ARRAY OF SET); - VAR i: INTEGER; -BEGIN - i := 0; WHILE i < LEN(s) DO s[i] := {}; INC(i) END -END Clear; - - -PROCEDURE Fill*(VAR s: ARRAY OF SET); - VAR i: INTEGER; -BEGIN - i := 0; WHILE i < LEN(s) DO s[i] := {0 .. size-1}; INC(i) END -END Fill; - - -PROCEDURE Incl*(VAR s: ARRAY OF SET; x: INTEGER); -BEGIN INCL(s[x DIV size], x MOD size) -END Incl; - - -PROCEDURE Excl*(VAR s: ARRAY OF SET; x: INTEGER); -BEGIN EXCL(s[x DIV size], x MOD size) -END Excl; - - -PROCEDURE In*(VAR s: ARRAY OF SET; x: INTEGER): BOOLEAN; -BEGIN RETURN x MOD size IN s[x DIV size] -END In; - - -PROCEDURE Includes*(VAR s1, s2: ARRAY OF SET): BOOLEAN; - VAR i: INTEGER; -BEGIN - i := 0; - WHILE i < LEN(s1) DO - IF s1[i] + s2[i] # s1[i] THEN RETURN FALSE END ; - INC(i) - END ; - RETURN TRUE; -END Includes; - - -PROCEDURE Elements*(VAR s: ARRAY OF SET; VAR lastElem: INTEGER): INTEGER; - VAR i, n, max: INTEGER; -BEGIN - i := 0; n := 0; max := SHORT(LEN(s)) * size; - WHILE i < max DO - IF (i MOD size) IN s[i DIV size] THEN INC(n); lastElem := i END ; - INC(i) - END ; - RETURN n -END Elements; - - -PROCEDURE Empty*(VAR s: ARRAY OF SET): BOOLEAN; - VAR i: INTEGER; -BEGIN - i := 0; - WHILE i < LEN(s) DO - IF s[i] # {} THEN RETURN FALSE END ; - INC(i) - END ; - RETURN TRUE -END Empty; - - -PROCEDURE Equal*(VAR s1, s2: ARRAY OF SET): BOOLEAN; - VAR i: INTEGER; -BEGIN - i := 0; - WHILE i < LEN(s1) DO - IF s1[i] # s2[i] THEN RETURN FALSE END ; - INC(i) - END ; - RETURN TRUE -END Equal; - - -PROCEDURE Different*(VAR s1, s2: ARRAY OF SET): BOOLEAN; - VAR i: INTEGER; -BEGIN - i := 0; - WHILE i < LEN(s1) DO - IF s1[i] * s2[i] # {} THEN RETURN FALSE END ; - INC(i) - END ; - RETURN TRUE -END Different; - - -PROCEDURE Unite*(VAR s1, s2: ARRAY OF SET); - VAR i: INTEGER; s: SET; -BEGIN - i := 0; WHILE i < LEN(s1) DO s := s1[i] + s2[i]; s1[i] := s; INC(i) END -END Unite; - - -PROCEDURE Differ*(VAR s1, s2: ARRAY OF SET); - VAR i: INTEGER; s: SET; -BEGIN - i := 0; WHILE i < LEN(s1) DO s := s1[i] - s2[i]; s1[i] := s; INC(i) END -END Differ; - - -PROCEDURE Intersect*(VAR s1, s2, s3: ARRAY OF SET); - VAR i: INTEGER; s: SET; -BEGIN - i := 0; WHILE i < LEN(s1) DO s := s1[i] * s2[i]; s3[i] := s; INC(i) END -END Intersect; - - -PROCEDURE Print*(VAR f: Texts.Writer; s: ARRAY OF SET; w, indent: INTEGER); - VAR col, i, max: INTEGER; -BEGIN - i := 0; col := indent; max := SHORT(LEN(s)) * size; - Texts.Write(f, "{"); - WHILE i < max DO - IF In(s, i) THEN - IF col + 4 > w THEN - Texts.WriteLn(f); - col := 0; WHILE col < indent DO Texts.Write(f, " "); INC(col) END - END ; - Texts.WriteInt(f, i, 3); Texts.Write(f, ","); - INC(col, 4) - END ; - INC(i) - END ; - Texts.Write(f, "}") -END Print; - -END Sets. diff --git a/src/lib/v4/Texts.Mod b/src/lib/v4/Texts.Mod deleted file mode 100644 index f2c3cf14..00000000 --- a/src/lib/v4/Texts.Mod +++ /dev/null @@ -1,863 +0,0 @@ -MODULE Texts; (** CAS/HM 23.9.93 -- interface based on Texts by JG/NW 6.12.91**) (* << RC, MB, JT *) - IMPORT - Files, Modules, Reals; - - (*--- insert field e: Elem into Texts.Scanner and change Texts.Scan to set it in case of class=6 *) - - - CONST - Displaywhite = 15; - ElemChar* = 1CX; - TAB = 9X; CR = 0DX; maxD = 9; - (**FileMsg.id**) - load* = 0; store* = 1; - (**Notifier op**) - replace* = 0; insert* = 1; delete* = 2; - (**Scanner.class**) - Inval* = 0; Name* = 1; String* = 2; Int* = 3; Real* = 4; LongReal* = 5; Char* = 6; - - textTag = 0F0X; DocBlockId = 0F7X; version = 01X; - - TYPE - FontsFont = POINTER TO FontDesc; - FontDesc = RECORD - name: ARRAY 32 OF CHAR; - END ; - - Run = POINTER TO RunDesc; - RunDesc = RECORD - prev, next: Run; - len: LONGINT; - fnt: FontsFont; - col, voff: SHORTINT; - ascii: BOOLEAN (* << *) - END; - - Piece = POINTER TO PieceDesc; - PieceDesc = RECORD (RunDesc) - file: Files.File; - org: LONGINT - END; - - Elem* = POINTER TO ElemDesc; - Buffer* = POINTER TO BufDesc; - Text* = POINTER TO TextDesc; - - ElemMsg* = RECORD END; - Handler* = PROCEDURE (e: Elem; VAR msg: ElemMsg); - - ElemDesc* = RECORD (RunDesc) - W*, H*: LONGINT; - handle*: Handler; - base: Text - END; - - FileMsg* = RECORD (ElemMsg) - id*: INTEGER; - pos*: LONGINT; - r*: Files.Rider - END; - - CopyMsg* = RECORD (ElemMsg) - e*: Elem - END; - - IdentifyMsg* = RECORD (ElemMsg) - mod*, proc*: ARRAY 32 OF CHAR - END; - - - BufDesc* = RECORD - len*: LONGINT; - head: Run - END; - - TextDesc* = RECORD - len*: LONGINT; - head, cache: Run; - corg: LONGINT - END; - - Reader* = RECORD - eot*: BOOLEAN; - fnt*: FontsFont; - col*, voff*: SHORTINT; - elem*: Elem; - rider: Files.Rider; - run: Run; - org, off: LONGINT - END; - - Scanner* = RECORD (Reader) - nextCh*: CHAR; - line*, class*: INTEGER; - i*: LONGINT; - x*: REAL; - y*: LONGREAL; - c*: CHAR; - len*: SHORTINT; - s*: ARRAY 64 OF CHAR (* << *) - END; - - Writer* = RECORD - buf*: Buffer; - fnt*: FontsFont; - col*, voff*: SHORTINT; - rider: Files.Rider; - file: Files.File - END; - - Alien = POINTER TO RECORD (ElemDesc) - file: Files.File; - org, span: LONGINT; - mod, proc: ARRAY 32 OF CHAR - END; - - VAR - new*: Elem; - del: Buffer; - FontsDefault: FontsFont; - - - PROCEDURE FontsThis(VAR name: ARRAY OF CHAR): FontsFont; - VAR F: FontsFont; - BEGIN - NEW(F); COPY(name, F.name); RETURN F - END FontsThis; - - (* run primitives *) - - PROCEDURE Find (T: Text; VAR pos: LONGINT; VAR u: Run; VAR org, off: LONGINT); - VAR v: Run; m: LONGINT; - BEGIN - IF pos >= T.len THEN pos := T.len; u := T.head; org := T.len; off := 0; T.cache := T.head; T.corg := 0 - ELSE v := T.cache.next; m := pos - T.corg; - IF pos >= T.corg THEN - WHILE m >= v.len DO DEC(m, v.len); v := v.next END - ELSE - WHILE m < 0 DO v := v.prev; INC(m, v.len) END; - END; - u := v; org := pos - m; off := m; T.cache := v.prev; T.corg := org - END - END Find; - - PROCEDURE Split (off: LONGINT; VAR u, un: Run); - VAR p, U: Piece; - BEGIN - IF off = 0 THEN un := u; u := un.prev - ELSIF off >= u.len THEN un := u.next - ELSE NEW(p); un := p; U := u(Piece); - p^ := U^; INC(p.org, off); DEC(p.len, off); DEC(U.len, p.len); - p.ascii := u.ascii; p.prev := U; p.next := U.next; p.next.prev := p; U.next := p (* << *) - END - END Split; - - PROCEDURE Merge (T: Text; u: Run; VAR v: Run); - VAR p, q: Piece; - BEGIN - IF (u IS Piece) & (v IS Piece) & (u.fnt.name = v.fnt.name) & (u.col = v.col) & (u.voff = v.voff) - & (u(Piece).ascii = v(Piece).ascii) THEN (* << *) - p := u(Piece); q := v(Piece); - IF (p.file = q.file) & (p.org + p.len = q.org) THEN - IF T.cache = u THEN INC(T.corg, q.len) - ELSIF T.cache = v THEN T.cache := T.head; T.corg := 0 - END; - INC(p.len, q.len); v := v.next - END - END - END Merge; - - PROCEDURE Splice (un, v, w: Run; base: Text); (* (u, un) -> (u, v, w, un) *) - VAR u: Run; - BEGIN - IF v # w.next THEN u := un.prev; - u.next := v; v.prev := u; un.prev := w; w.next := un; - REPEAT - IF v IS Elem THEN v(Elem).base := base END; - v := v.next - UNTIL v = un - END - END Splice; - - PROCEDURE ClonePiece (p: Piece): Piece; - VAR q: Piece; - BEGIN NEW(q); q^ := p^; RETURN q - END ClonePiece; - - PROCEDURE CloneElem (e: Elem): Elem; - VAR msg: CopyMsg; - BEGIN msg.e := NIL; e.handle(e, msg); RETURN msg.e - END CloneElem; - - - (** Elements **) - - PROCEDURE CopyElem* (SE, DE: Elem); - BEGIN DE.len := SE.len; DE.fnt := SE.fnt; DE.col := SE.col; DE.voff := SE.voff; - DE.W := SE.W; DE.H := SE.H; DE.handle := SE.handle - END CopyElem; - - PROCEDURE ElemBase* (E: Elem): Text; - BEGIN RETURN E.base - END ElemBase; - - PROCEDURE ElemPos* (E: Elem): LONGINT; - VAR u: Run; pos: LONGINT; - BEGIN u := E.base.head.next; pos := 0; - WHILE u # E DO pos := pos + u.len; u := u.next END; - RETURN pos - END ElemPos; - - - PROCEDURE HandleAlien (E: Elem; VAR msg: ElemMsg); - VAR e: Alien; r: Files.Rider; i: LONGINT; ch: CHAR; - BEGIN - WITH E: Alien DO - IF msg IS CopyMsg THEN - WITH msg: CopyMsg DO NEW(e); CopyElem(E, e); - e.file := E.file; e.org := E.org; e.span := E.span; e.mod := E.mod; e.proc := E.proc; - msg.e := e - END - ELSIF msg IS IdentifyMsg THEN - WITH msg: IdentifyMsg DO - COPY(E.mod, msg.mod); COPY(E.proc, msg.proc); msg.mod[31] := 1X (*alien*) - END - ELSIF msg IS FileMsg THEN - WITH msg: FileMsg DO - IF msg.id = store THEN Files.Set(r, E.file, E.org); i := E.span; - WHILE i > 0 DO Files.Read(r, ch); Files.Write(msg.r, ch); DEC(i) END - END - END - END - END - END HandleAlien; - - - (** Buffers **) - - PROCEDURE OpenBuf* (B: Buffer); - VAR u: Run; - BEGIN NEW(u); u.next := u; u.prev := u; B.head := u; B.len := 0 - END OpenBuf; - - PROCEDURE Copy* (SB, DB: Buffer); - VAR u, v, vn: Run; - BEGIN u := SB.head.next; v := DB.head.prev; - WHILE u # SB.head DO - IF u IS Piece THEN vn := ClonePiece(u(Piece)) ELSE vn := CloneElem(u(Elem)) END; - v.next := vn; vn.prev := v; v := vn; u := u.next - END; - v.next := DB.head; DB.head.prev := v; - INC(DB.len, SB.len) - END Copy; - - PROCEDURE Recall* (VAR B: Buffer); - BEGIN B := del; del := NIL - END Recall; - - - (** Texts **) - - PROCEDURE Save* (T: Text; beg, end: LONGINT; B: Buffer); - VAR u, v, w, wn: Run; uo, ud, vo, vd: LONGINT; - BEGIN Find(T, beg, u, uo, ud); Find(T, end, v, vo, vd); - w := B.head.prev; - WHILE u # v DO - IF u IS Piece THEN wn := ClonePiece(u(Piece)); DEC(wn.len, ud); INC(wn(Piece).org, ud) - ELSE wn := CloneElem(u(Elem)) - END; - w.next := wn; wn.prev := w; w := wn; u := u.next; ud := 0 - END; - IF vd > 0 THEN (*v IS Piece*) wn := ClonePiece(v(Piece)); wn.len := vd - ud; INC(wn(Piece).org, ud); - w.next := wn; wn.prev := w; w := wn - END; - w.next := B.head; B.head.prev := w; - INC(B.len, end - beg) - END Save; - - PROCEDURE Insert* (T: Text; pos: LONGINT; B: Buffer); - VAR u, un, v: Run; p, q: Piece; uo, ud, len: LONGINT; - BEGIN Find(T, pos, u, uo, ud); Split(ud, u, un); - len := B.len; v := B.head.next; - Merge(T, u, v); Splice(un, v, B.head.prev, T); - INC(T.len, len); B.head.next := B.head; B.head.prev := B.head; B.len := 0; - END Insert; - - PROCEDURE Append* (T: Text; B: Buffer); - VAR v: Run; pos, len: LONGINT; - BEGIN pos := T.len; len := B.len; v := B.head.next; - Merge(T, T.head.prev, v); Splice(T.head, v, B.head.prev, T); - INC(T.len, len); B.head.next := B.head; B.head.prev := B.head; B.len := 0; - END Append; - - PROCEDURE Delete* (T: Text; beg, end: LONGINT); - VAR c, u, un, v, vn: Run; co, uo, ud, vo, vd: LONGINT; - BEGIN - Find(T, beg, u, uo, ud); Split(ud, u, un); c := T.cache; co := T.corg; - Find(T, end, v, vo, vd); Split(vd, v, vn); T.cache := c; T.corg := co; - NEW(del); OpenBuf(del); del.len := end - beg; - Splice(del.head, un, v, NIL); - Merge(T, u, vn); u.next := vn; vn.prev := u; - DEC(T.len, end - beg); - END Delete; - - PROCEDURE ChangeLooks* (T: Text; beg, end: LONGINT; sel: SET; fnt: FontsFont; col, voff: SHORTINT); - VAR c, u, un, v, vn: Run; co, uo, ud, vo, vd: LONGINT; - BEGIN Find(T, beg, u, uo, ud); Split(ud, u, un); c := T.cache; co := T.corg; - Find(T, end, v, vo, vd); Split(vd, v, vn); T.cache := c; T.corg := co; - WHILE un # vn DO - IF (0 IN sel) & (fnt # NIL) THEN un.fnt := fnt END; - IF 1 IN sel THEN un.col := col END; - IF 2 IN sel THEN un.voff := voff END; - Merge(T, u, un); - IF u.next = un THEN u := un; un := un.next ELSE u.next := un; un.prev := u END - END; - Merge(T, u, un); u.next := un; un.prev := u; - END ChangeLooks; - - - (** Readers **) - - PROCEDURE OpenReader* (VAR R: Reader; T: Text; pos: LONGINT); - VAR u: Run; - BEGIN - IF pos >= T.len THEN pos := T.len END; - Find(T, pos, u, R.org, R.off); R.run := u; R.eot := FALSE; - IF u IS Piece THEN - Files.Set(R.rider, u(Piece).file, u(Piece).org + R.off) - END - END OpenReader; - - PROCEDURE Read* (VAR R: Reader; VAR ch: CHAR); - VAR u: Run; pos: LONGINT; nextch: CHAR; - BEGIN u := R.run; R.fnt := u.fnt; R.col := u.col; R.voff := u.voff; INC(R.off); - IF u IS Piece THEN Files.Read(R.rider, ch); R.elem := NIL; - IF (ch = 0AX) & u(Piece).ascii THEN ch := CR (* << LF to CR *) - ELSIF (ch = CR) & u(Piece).ascii THEN (* << CR LF to CR *) - pos := Files.Pos(R.rider); Files.Read(R.rider, nextch); - IF nextch = 0AX THEN INC(R.off) ELSE Files.Set(R.rider, u(Piece).file, pos) END - END - ELSIF u IS Elem THEN ch := ElemChar; R.elem := u(Elem) - ELSE ch := 0X; R.elem := NIL; R.eot := TRUE - END; - IF R.off = u.len THEN INC(R.org, u.len); u := u.next; - IF u IS Piece THEN - WITH u: Piece DO Files.Set(R.rider, u.file, u.org) END - END; - R.run := u; R.off := 0 - END - END Read; - - PROCEDURE ReadElem* (VAR R: Reader); - VAR u, un: Run; - BEGIN u := R.run; - WHILE u IS Piece DO INC(R.org, u.len); u := u.next END; - IF u IS Elem THEN un := u.next; R.run := un; INC(R.org); R.off := 0; - R.fnt := u.fnt; R.col := u.col; R.voff := u.voff; R.elem := u(Elem); - IF un IS Piece THEN - WITH un: Piece DO Files.Set(R.rider, un.file, un.org) END - END - ELSE R.eot := TRUE; R.elem := NIL - END - END ReadElem; - - PROCEDURE ReadPrevElem* (VAR R: Reader); - VAR u: Run; - BEGIN u := R.run.prev; - WHILE u IS Piece DO DEC(R.org, u.len); u := u.prev END; - IF u IS Elem THEN R.run := u; DEC(R.org); R.off := 0; - R.fnt := u.fnt; R.col := u.col; R.voff := u.voff; R.elem := u(Elem) - ELSE R.eot := TRUE; R.elem := NIL - END - END ReadPrevElem; - - PROCEDURE Pos* (VAR R: Reader): LONGINT; - BEGIN RETURN R.org + R.off - END Pos; - - - (** Scanners --------------- NW --------------- **) - - PROCEDURE OpenScanner* (VAR S: Scanner; T: Text; pos: LONGINT); - BEGIN OpenReader(S, T, pos); S.line := 0; S.nextCh := " " - END OpenScanner; - - (*IEEE floating point formats: - x = 2^(e-127) * 1.m bit 0: sign, bits 1- 8: e, bits 9-31: m - x = 2^(e-1023) * 1.m bit 0: sign, bits 1-11: e, bits 12-63: m *) - - PROCEDURE Scan* (VAR S: Scanner); - CONST maxD = 32; - VAR ch, term: CHAR; - neg, negE, hex: BOOLEAN; - i, j, h: SHORTINT; - e: INTEGER; k: LONGINT; - x, f: REAL; y, g: LONGREAL; - d: ARRAY maxD OF CHAR; - - PROCEDURE ReadScaleFactor; - BEGIN Read(S, ch); - IF ch = "-" THEN negE := TRUE; Read(S, ch) - ELSE negE := FALSE; - IF ch = "+" THEN Read(S, ch) END - END; - WHILE ("0" <= ch) & (ch <= "9") DO - e := e*10 + ORD(ch) - 30H; Read(S, ch) - END - END ReadScaleFactor; - - BEGIN ch := S.nextCh; i := 0; - LOOP - IF ch = CR THEN INC(S.line) - ELSIF (ch # " ") & (ch # TAB) THEN EXIT - END ; - Read(S, ch) - END; - IF ("A" <= CAP(ch)) & (CAP(ch) <= "Z") OR (ch = "/") OR (ch = ".") THEN (*name*) (* << *) - REPEAT S.s[i] := ch; INC(i); Read(S, ch) - UNTIL (CAP(ch) > "Z") & (ch # "_") (* << *) - OR ("A" > CAP(ch)) & (ch > "9") - OR ("0" > ch) & (ch # ".") & (ch # "/") (* << *) - OR (i = 63); (* << *) - S.s[i] := 0X; S.len := i; S.class := 1 - ELSIF ch = 22X THEN (*literal string*) - Read(S, ch); - WHILE (ch # 22X) & (ch >= " ") & (i # 63) DO (* << *) - S.s[i] := ch; INC(i); Read(S, ch) - END; - S.s[i] := 0X; S.len := i+1; Read(S, ch); S.class := 2 - ELSE - IF ch = "-" THEN neg := TRUE; Read(S, ch) ELSE neg := FALSE END ; - IF ("0" <= ch) & (ch <= "9") THEN (*number*) - hex := FALSE; j := 0; - LOOP d[i] := ch; INC(i); Read(S, ch); - IF ch < "0" THEN EXIT END; - IF "9" < ch THEN - IF ("A" <= ch) & (ch <= "F") THEN hex := TRUE; ch := CHR(ORD(ch)-7) - ELSIF ("a" <= ch) & (ch <= "f") THEN hex := TRUE; ch := CHR(ORD(ch)-27H) - ELSE EXIT - END - END - END; - IF ch = "H" THEN (*hex number*) - Read(S, ch); S.class := 3; - IF i-j > 8 THEN j := i-8 END ; - k := ORD(d[j]) - 30H; INC(j); - IF (i-j = 7) & (k >= 8) THEN DEC(k, 16) END ; - WHILE j < i DO k := k*10H + (ORD(d[j]) - 30H); INC(j) END ; - IF neg THEN S.i := -k ELSE S.i := k END - ELSIF ch = "." THEN (*read real*) - Read(S, ch); h := i; - WHILE ("0" <= ch) & (ch <= "9") DO d[i] := ch; INC(i); Read(S, ch) END ; - IF ch = "D" THEN - e := 0; y := 0; g := 1; - REPEAT y := y*10 + (ORD(d[j]) - 30H); INC(j) UNTIL j = h; - WHILE j < i DO g := g/10; y := (ORD(d[j]) - 30H)*g + y; INC(j) END ; - ReadScaleFactor; - IF negE THEN - IF e <= 308 THEN y := y / Reals.TenL(e) ELSE y := 0 END - ELSIF e > 0 THEN - IF e <= 308 THEN y := Reals.TenL(e) * y ELSE HALT(40) END - END ; - IF neg THEN y := -y END ; - S.class := 5; S.y := y - ELSE e := 0; x := 0; f := 1; - REPEAT x := x*10 + (ORD(d[j]) - 30H); INC(j) UNTIL j = h; - WHILE j < i DO f := f/10; x := (ORD(d[j])-30H)*f + x; INC(j) END; - IF ch = "E" THEN ReadScaleFactor END ; - IF negE THEN - IF e <= 38 THEN x := x / Reals.Ten(e) ELSE x := 0 END - ELSIF e > 0 THEN - IF e <= 38 THEN x := Reals.Ten(e) * x ELSE HALT(40) END - END ; - IF neg THEN x := -x END ; - S.class := 4; S.x := x - END ; - IF hex THEN S.class := 0 END - ELSE (*decimal integer*) - S.class := 3; k := 0; - REPEAT k := k*10 + (ORD(d[j]) - 30H); INC(j) UNTIL j = i; - IF neg THEN S.i := -k ELSE S.i := k END; - IF hex THEN S.class := 0 ELSE S.class := 3 END - END - ELSE S.class := 6; - IF neg THEN S.c := "-" ELSE S.c := ch; Read(S, ch) END - END - END; - S.nextCh := ch - END Scan; - - - (** Writers **) - - PROCEDURE OpenWriter* (VAR W: Writer); - BEGIN NEW(W.buf); OpenBuf(W.buf); - W.fnt := FontsDefault; W.col := Displaywhite; W.voff := 0; - W.file := Files.New(""); Files.Set(W.rider, W.file, 0) - END OpenWriter; - - PROCEDURE SetFont* (VAR W: Writer; fnt: FontsFont); - BEGIN W.fnt := fnt - END SetFont; - - PROCEDURE SetColor* (VAR W: Writer; col: SHORTINT); - BEGIN W.col := col - END SetColor; - - PROCEDURE SetOffset* (VAR W: Writer; voff: SHORTINT); - BEGIN W.voff := voff - END SetOffset; - - - PROCEDURE Write* (VAR W: Writer; ch: CHAR); - VAR u, un: Run; p: Piece; - BEGIN Files.Write(W.rider, ch); INC(W.buf.len); un := W.buf.head; u := un.prev; - IF (u IS Piece) & (u(Piece).file = W.file) & (u.fnt.name = W.fnt.name) & (u.col = W.col) & (u.voff = W.voff) - & ~u(Piece).ascii THEN (* << *) - INC(u.len) - ELSE NEW(p); u.next := p; p.prev := u; p.next := un; un.prev := p; - p.len := 1; p.fnt := W.fnt; p.col := W.col; p.voff := W.voff; - p.file := W.file; p.org := Files.Length(W.file) - 1; p.ascii := FALSE (* << *) - END - END Write; - - PROCEDURE WriteElem* (VAR W: Writer; e: Elem); - VAR u, un: Run; - BEGIN - IF e.base # NIL THEN HALT(99) END; - INC(W.buf.len); e.len := 1; e.fnt := W.fnt; e.col := W.col; e.voff := W.voff; - un := W.buf.head; u := un.prev; u.next := e; e.prev := u; e.next := un; un.prev := e - END WriteElem; - - PROCEDURE WriteLn* (VAR W: Writer); - BEGIN Write(W, CR) - END WriteLn; - - PROCEDURE WriteString* (VAR W: Writer; s: ARRAY OF CHAR); - VAR i: INTEGER; - BEGIN i := 0; - WHILE s[i] >= " " DO Write(W, s[i]); INC(i) END - END WriteString; - - PROCEDURE WriteInt* (VAR W: Writer; x, n: LONGINT); - VAR i: INTEGER; x0: LONGINT; - a: ARRAY 11 OF CHAR; - BEGIN i := 0; - IF x < 0 THEN - IF x = MIN(LONGINT) THEN WriteString(W, " -2147483648"); RETURN - ELSE DEC(n); x0 := -x - END - ELSE x0 := x - END; - REPEAT - a[i] := CHR(x0 MOD 10 + 30H); x0 := x0 DIV 10; INC(i) - UNTIL x0 = 0; - WHILE n > i DO Write(W, " "); DEC(n) END; - IF x < 0 THEN Write(W, "-") END; - REPEAT DEC(i); Write(W, a[i]) UNTIL i = 0 - END WriteInt; - - PROCEDURE WriteHex* (VAR W: Writer; x: LONGINT); - VAR i: INTEGER; y: LONGINT; - a: ARRAY 10 OF CHAR; - BEGIN i := 0; Write(W, " "); - REPEAT y := x MOD 10H; - IF y < 10 THEN a[i] := CHR(y + 30H) ELSE a[i] := CHR(y + 37H) END; - x := x DIV 10H; INC(i) - UNTIL i = 8; - REPEAT DEC(i); Write(W, a[i]) UNTIL i = 0 - END WriteHex; - - PROCEDURE WriteReal* (VAR W: Writer; x: REAL; n: INTEGER); - VAR e: INTEGER; x0: REAL; - d: ARRAY maxD OF CHAR; - BEGIN e := Reals.Expo(x); - IF e = 0 THEN - WriteString(W, " 0"); - REPEAT Write(W, " "); DEC(n) UNTIL n <= 3 - ELSIF e = 255 THEN - WriteString(W, " NaN"); - WHILE n > 4 DO Write(W, " "); DEC(n) END - ELSE - IF n <= 9 THEN n := 3 ELSE DEC(n, 6) END; - REPEAT Write(W, " "); DEC(n) UNTIL n <= 8; - (*there are 2 < n <= 8 digits to be written*) - IF x < 0.0 THEN Write(W, "-"); x := -x ELSE Write(W, " ") END; - e := (e - 127) * 77 DIV 256; - IF e >= 0 THEN x := x / Reals.Ten(e) ELSE x := Reals.Ten(-e) * x END; - IF x >= 10.0 THEN x := 0.1*x; INC(e) END; - x0 := Reals.Ten(n-1); x := x0*x + 0.5; - IF x >= 10.0*x0 THEN x := x*0.1; INC(e) END; - Reals.Convert(x, n, d); - DEC(n); Write(W, d[n]); Write(W, "."); - REPEAT DEC(n); Write(W, d[n]) UNTIL n = 0; - Write(W, "E"); - IF e < 0 THEN Write(W, "-"); e := -e ELSE Write(W, "+") END; - Write(W, CHR(e DIV 10 + 30H)); Write(W, CHR(e MOD 10 + 30H)) - END - END WriteReal; - - PROCEDURE WriteRealFix* (VAR W: Writer; x: REAL; n, k: INTEGER); - VAR e, i: INTEGER; sign: CHAR; x0: REAL; - d: ARRAY maxD OF CHAR; - - PROCEDURE seq(ch: CHAR; n: INTEGER); - BEGIN WHILE n > 0 DO Write(W, ch); DEC(n) END - END seq; - - PROCEDURE dig(n: INTEGER); - BEGIN - WHILE n > 0 DO - DEC(i); Write(W, d[i]); DEC(n) - END - END dig; - - BEGIN e := Reals.Expo(x); - IF k < 0 THEN k := 0 END; - IF e = 0 THEN seq(" ", n-k-2); Write(W, "0"); seq(" ", k+1) - ELSIF e = 255 THEN WriteString(W, " NaN"); seq(" ", n-4) - ELSE e := (e - 127) * 77 DIV 256; - IF x < 0 THEN sign := "-"; x := -x ELSE sign := " " END; - IF e >= 0 THEN (*x >= 1.0, 77/256 = log 2*) x := x/Reals.Ten(e) - ELSE (*x < 1.0*) x := Reals.Ten(-e) * x - END; - IF x >= 10.0 THEN x := 0.1*x; INC(e) END; - (* 1 <= x < 10 *) - IF k+e >= maxD-1 THEN k := maxD-1-e - ELSIF k+e < 0 THEN k := -e; x := 0.0 - END; - x0 := Reals.Ten(k+e); x := x0*x + 0.5; - IF x >= 10.0*x0 THEN INC(e) END; - (*e = no. of digits before decimal point*) - INC(e); i := k+e; Reals.Convert(x, i, d); - IF e > 0 THEN - seq(" ", n-e-k-2); Write(W, sign); dig(e); - Write(W, "."); dig(k) - ELSE seq(" ", n-k-3); - Write(W, sign); Write(W, "0"); Write(W, "."); - seq("0", -e); dig(k+e) - END - END - END WriteRealFix; - - PROCEDURE WriteRealHex* (VAR W: Writer; x: REAL); - VAR i: INTEGER; - d: ARRAY 8 OF CHAR; - BEGIN Reals.ConvertH(x, d); i := 0; - REPEAT Write(W, d[i]); INC(i) UNTIL i = 8 - END WriteRealHex; - - PROCEDURE WriteLongReal* (VAR W: Writer; x: LONGREAL; n: INTEGER); - CONST maxD = 16; - VAR e: INTEGER; x0: LONGREAL; - d: ARRAY maxD OF CHAR; - BEGIN e := Reals.ExpoL(x); - IF e = 0 THEN - WriteString(W, " 0"); - REPEAT Write(W, " "); DEC(n) UNTIL n <= 3 - ELSIF e = 2047 THEN - WriteString(W, " NaN"); - WHILE n > 4 DO Write(W, " "); DEC(n) END - ELSE - IF n <= 10 THEN n := 3 ELSE DEC(n, 7) END; - REPEAT Write(W, " "); DEC(n) UNTIL n <= maxD; - (*there are 2 <= n <= maxD digits to be written*) - IF x < 0 THEN Write(W, "-"); x := -x ELSE Write(W, " ") END; - e := SHORT(LONG(e - 1023) * 77 DIV 256); - IF e >= 0 THEN x := x / Reals.TenL(e) ELSE x := Reals.TenL(-e) * x END ; - IF x >= 10.0D0 THEN x := 0.1D0 * x; INC(e) END ; - x0 := Reals.TenL(n-1); x := x0*x + 0.5D0; - IF x >= 10.0D0*x0 THEN x := 0.1D0 * x; INC(e) END ; - Reals.ConvertL(x, n, d); - DEC(n); Write(W, d[n]); Write(W, "."); - REPEAT DEC(n); Write(W, d[n]) UNTIL n = 0; - Write(W, "D"); - IF e < 0 THEN Write(W, "-"); e := -e ELSE Write(W, "+") END; - Write(W, CHR(e DIV 100 + 30H)); e := e MOD 100; - Write(W, CHR(e DIV 10 + 30H)); - Write(W, CHR(e MOD 10 + 30H)) - END - END WriteLongReal; - - PROCEDURE WriteLongRealHex* (VAR W: Writer; x: LONGREAL); - VAR i: INTEGER; - d: ARRAY 16 OF CHAR; - BEGIN Reals.ConvertHL(x, d); i := 0; - REPEAT Write(W, d[i]); INC(i) UNTIL i = 16 - END WriteLongRealHex; - - PROCEDURE WriteDate* (VAR W: Writer; t, d: LONGINT); - - PROCEDURE WritePair(ch: CHAR; x: LONGINT); - BEGIN Write(W, ch); - Write(W, CHR(x DIV 10 + 30H)); Write(W, CHR(x MOD 10 + 30H)) - END WritePair; - - BEGIN - WritePair(" ", d MOD 32); WritePair(".", d DIV 32 MOD 16); WritePair(".", d DIV 512 MOD 128); - WritePair(" ", t DIV 4096 MOD 32); WritePair(":", t DIV 64 MOD 64); WritePair(":", t MOD 64) - END WriteDate; - - - (** Text Filing **) - - PROCEDURE Load0 (VAR r: Files.Rider; T: Text); - VAR u, un: Run; p: Piece; e: Elem; - org, pos, hlen, plen: LONGINT; ecnt, fno, fcnt, col, voff: SHORTINT; - f: Files.File; - msg: FileMsg; - mods, procs: ARRAY 64, 32 OF CHAR; - name: ARRAY 32 OF CHAR; - fnts: ARRAY 32 OF FontsFont; - - PROCEDURE LoadElem (VAR r: Files.Rider; pos, span: LONGINT; VAR e: Elem); - VAR M: Modules.Module; Cmd: Modules.Command; a: Alien; - org, ew, eh: LONGINT; eno: SHORTINT; - BEGIN new := NIL; - Files.ReadLInt(r, ew); Files.ReadLInt(r, eh); Files.Read(r, eno); - IF eno > ecnt THEN ecnt := eno; Files.ReadString(r, mods[eno]); Files.ReadString(r, procs[eno]) END; - org := Files.Pos(r); M := Modules.ThisMod(mods[eno]); - IF M # NIL THEN Cmd := Modules.ThisCommand(M, procs[eno]); - IF Cmd # NIL THEN Cmd END - END; - e := new; - IF e # NIL THEN e.W := ew; e.H := eh; e.base := T; - msg.pos := pos; e.handle(e, msg); - IF Files.Pos(r) # org + span THEN e := NIL END - END; - IF e = NIL THEN Files.Set(r, f, org + span); - NEW(a); a.W := ew; a.H := eh; a.handle := HandleAlien; a.base := T; - a.file := f; a.org := org; a.span := span; - COPY(mods[eno], a.mod); COPY(procs[eno], a.proc); - e := a - END - END LoadElem; - - BEGIN pos := Files.Pos(r); f := Files.Base(r); - NEW(u); u.len := MAX(LONGINT); (*u.fnt := FontsDefault;*)u.fnt := NIL; u.col := Displaywhite; - T.head := u; ecnt := 0; fcnt := 0; - msg.id := load; msg.r := r; - Files.ReadLInt(msg.r, hlen); (*!!!org := pos + hlen;*) org := pos -2 + hlen; pos := org; Files.Read(msg.r, fno); - WHILE fno # 0 DO - IF fno > fcnt THEN fcnt := fno; Files.ReadString(msg.r, name); fnts[fno] := FontsThis(name) END; - Files.Read(msg.r, col); Files.Read(msg.r, voff); Files.ReadLInt(msg.r, plen); - IF plen > 0 THEN NEW(p); p.file := f; p.org := pos; p.ascii := FALSE; un := p; un.len := plen - ELSE LoadElem(msg.r, pos - org, -plen, e); un := e; un.len := 1 - END; - (*un.fnt := fnts[fno];*) un.col := col; un.voff := voff; - INC(pos, un.len); u.next := un; un.prev := u; u := un; Files.Read(msg.r, fno) - END; - u.next := T.head; T.head.prev := u; T.cache := T.head; T.corg := 0; - Files.ReadLInt(msg.r, T.len); Files.Set(r, f, Files.Pos(msg.r) + T.len) - END Load0; - - PROCEDURE Load* (VAR r: Files.Rider; T: Text); - CONST oldTag = -4095; - VAR tag: INTEGER; - BEGIN - (* for compatibility inner text tags are checked and skipped; remove this in a later version *) - Files.ReadInt(r, tag); IF tag # oldTag THEN Files.Set(r, Files.Base(r), Files.Pos(r)-2) END; - Load0(r, T) - END Load; - - PROCEDURE Open* (T: Text; name: ARRAY OF CHAR); - VAR f: Files.File; r: Files.Rider; u: Run; p: Piece; tag, version: CHAR; hlen: LONGINT; - BEGIN f := Files.Old(name); - IF f = NIL THEN f := Files.New("") END; - Files.Set(r, f, 0); Files.Read(r, tag); Files.Read(r, version); - IF (tag = textTag) OR (tag = 01X) & (version = textTag) THEN Load0(r, T) - ELSE (*ascii*) - NEW(u); u.len := MAX(LONGINT); u.fnt := NIL; u.col := Displaywhite; - NEW(p); - IF (tag = DocBlockId) & (version = 07X) THEN (* extract ascii text from System 3 text document *) - Files.Set(r, f, 28); Files.ReadLInt(r, hlen); - Files.Set(r, f, 22 + hlen); Files.ReadLInt(r, T.len); p.org := 26 + hlen - ELSE - T.len := Files.Length(f); p.org := 0 - END ; - IF T.len > 0 THEN p.len := T.len; p.fnt := FontsDefault; - p.col := Displaywhite; p.voff := 0; p.file := f; p.ascii := TRUE; - u.next := p; u.prev := p; p.next := u; p.prev := u - ELSE u.next := u; u.prev := u - END; - T.head := u; T.cache := T.head; T.corg := 0 - END - END Open; - - PROCEDURE Store* (VAR r: Files.Rider; T: Text); - VAR r1: Files.Rider; u, un: Run; e: Elem; org, pos, delta, hlen, rlen: LONGINT; ecnt, fno, fcnt: SHORTINT; ch: CHAR; (* << *) - msg: FileMsg; iden: IdentifyMsg; - mods, procs: ARRAY 64, 32 OF CHAR; - fnts: ARRAY 32 OF FontsFont; - block: ARRAY 1024 OF CHAR; - - PROCEDURE StoreElem (VAR r: Files.Rider; pos: LONGINT; e: Elem); - VAR r1: Files.Rider; org, span: LONGINT; eno: SHORTINT; - BEGIN COPY(iden.mod, mods[ecnt]); COPY(iden.proc, procs[ecnt]); eno := 1; - WHILE (mods[eno] # iden.mod) OR (procs[eno] # iden.proc) DO INC(eno) END; - Files.Set(r1, Files.Base(r), Files.Pos(r)); - Files.WriteLInt(r, 0); Files.WriteLInt(r, 0); Files.WriteLInt(r, 0); (*fixup slot*) - Files.Write(r, eno); - IF eno = ecnt THEN INC(ecnt); Files.WriteString(r, iden.mod); Files.WriteString(r, iden.proc) END; - msg.pos := pos; org := Files.Pos(r); e.handle(e, msg); span := Files.Pos(r) - org; - Files.WriteLInt(r1, -span); Files.WriteLInt(r1, e.W); Files.WriteLInt(r1, e.H) (*fixup*) - END StoreElem; - - BEGIN - org := Files.Pos(r); msg.id := store; msg.r := r; Files.WriteLInt(msg.r, 0); (*fixup slot*) - u := T.head.next; pos := 0; delta := 0; fcnt := 1; ecnt := 1; - WHILE u # T.head DO - IF u IS Elem THEN iden.mod[0] := 0X; u(Elem).handle(u(Elem), iden) ELSE iden.mod[0] := 1X END; - IF iden.mod[0] # 0X THEN - fnts[fcnt] := u.fnt; fno := 1; - WHILE fnts[fno].name # u.fnt.name DO INC(fno) END; - Files.Write(msg.r, fno); - IF fno = fcnt THEN INC(fcnt); Files.WriteString(msg.r, u.fnt.name) END; - Files.Write(msg.r, u.col); Files.Write(msg.r, u.voff) - END; - IF u IS Piece THEN rlen := u.len; un := u.next; - WHILE (un IS Piece) & (un.fnt = u.fnt) & (un.col = u.col) & (un.voff = u.voff) DO - INC(rlen, un.len); un := un.next - END; - Files.WriteLInt(msg.r, rlen); INC(pos, rlen); u := un - ELSIF iden.mod[0] # 0X THEN StoreElem(msg.r, pos, u(Elem)); INC(pos); u := u.next - ELSE INC(delta); u := u.next - END - END; - Files.Write(msg.r, 0); Files.WriteLInt(msg.r, T.len - delta); - (*!!!hlen := Files.Pos(msg.r) - org;*) hlen := Files.Pos(msg.r) - org + 2; - Files.Set(r1, Files.Base(msg.r), org); Files.WriteLInt(r1, hlen); (*fixup*) - u := T.head.next; - WHILE u # T.head DO - IF u IS Piece THEN - WITH u: Piece DO - IF u.ascii THEN Files.Set(r1, u.file, u.org); delta := u.len; (* << LF to CR *) - WHILE delta > 0 DO Files.Read(r1, ch); DEC(delta); - IF ch = 0AX THEN Files.Write(msg.r, CR) ELSE Files.Write(msg.r, ch) END - END - ELSE Files.Set(r1, u.file, u.org); delta := u.len; - WHILE delta > LEN(block) DO Files.ReadBytes(r1, block, LEN(block)); - Files.WriteBytes(msg.r, block, LEN(block)); DEC(delta, LEN(block)) - END; - Files.ReadBytes(r1, block, delta); Files.WriteBytes(msg.r, block, delta) - END - END - ELSE iden.mod[0] := 0X; u(Elem).handle(u(Elem), iden); - IF iden.mod[0] # 0X THEN Files.Write(msg.r, ElemChar) END - END; - u := u.next - END; - r := msg.r; - END Store; - - PROCEDURE Close* (T: Text; name: ARRAY OF CHAR); - VAR f: Files.File; r: Files.Rider; i, res: INTEGER; bak: ARRAY 64 OF CHAR; - BEGIN - f := Files.New(name); Files.Set(r, f, 0); Files.Write(r, textTag); Files.Write(r, version); Store(r, T); - i := 0; WHILE name[i] # 0X DO INC(i) END; - COPY(name, bak); bak[i] := "."; bak[i+1] := "B"; bak[i+2] := "a"; bak[i+3] := "k"; bak[i+4] := 0X; - Files.Rename(name, bak, res); Files.Register(f) - END Close; - -BEGIN del := NIL; NEW(FontsDefault); FontsDefault.name := "Syntax10.Scn.Fnt" -END Texts. diff --git a/src/lib/v4/armv6j_hardfp/Reals.Mod b/src/lib/v4/armv6j_hardfp/Reals.Mod deleted file mode 100644 index 087767c1..00000000 --- a/src/lib/v4/armv6j_hardfp/Reals.Mod +++ /dev/null @@ -1,109 +0,0 @@ -MODULE Reals; - (* JT, 5.2.90 / RC 9.12.91 conversion between reals and strings for HP-700, MB 9.12.91, JT for Ofront, 16.3. 95*) - - IMPORT S := SYSTEM; - - - PROCEDURE -ecvt (x: LONGREAL; ndigit, decpt, sign: LONGINT): LONGINT - "(LONGINT)ecvt (x, ndigit, decpt, sign)"; - - PROCEDURE Ten*(e: INTEGER): REAL; - VAR r, power: LONGREAL; - BEGIN r := 1.0; - power := 10.0; - WHILE e > 0 DO - IF ODD(e) THEN r := r * power END ; - power := power * power; e := e DIV 2 - END ; - RETURN SHORT(r) - END Ten; - - PROCEDURE TenL*(e: INTEGER): LONGREAL; - VAR r, power: LONGREAL; - BEGIN r := 1.0; - power := 10.0; - LOOP - IF ODD(e) THEN r := r * power END ; - e := e DIV 2; - IF e <= 0 THEN RETURN r END ; - power := power * power - END - END TenL; - - PROCEDURE Expo*(x: REAL): INTEGER; - BEGIN - RETURN SHORT(ASH(S.VAL(LONGINT, x), -23) MOD 256) - END Expo; - - PROCEDURE ExpoL*(x: LONGREAL): INTEGER; - VAR h: LONGINT; - BEGIN - S.GET(S.ADR(x)+4, h); - RETURN SHORT(ASH(h, -20) MOD 2048) - END ExpoL; - - PROCEDURE SetExpo*(e: INTEGER; VAR x: REAL); - CONST expo = {1..8}; - BEGIN - x := S.VAL(REAL, S.VAL(SET, x) - expo + S.VAL(SET, ASH(LONG(e), 23))) - END SetExpo; - - PROCEDURE SetExpoL*(e: INTEGER; VAR x: LONGREAL); - CONST expo = {1..11}; - VAR h: SET; - BEGIN - S.GET(S.ADR(x)+4, h); - h := h - expo + S.VAL(SET, ASH(LONG(e), 20)); - S.PUT(S.ADR(x)+4, h) - END SetExpoL; - - PROCEDURE Convert*(x: REAL; n: INTEGER; VAR d: ARRAY OF CHAR); - VAR i, k: LONGINT; - BEGIN - i := ENTIER(x); k := 0; - WHILE k < n DO - d[k] := CHR(i MOD 10 + 48); i := i DIV 10; INC(k) - END - END Convert; -(* - PROCEDURE ConvertL*(x: LONGREAL; n: INTEGER; VAR d: ARRAY OF CHAR); - VAR i, k: LONGINT; - BEGIN - i := ENTIER(x); k := 0; - WHILE k < n DO - d[k] := CHR(i MOD 10 + 48); i := i DIV 10; INC(k) - END - END ConvertL; - *) - PROCEDURE ConvertL*(x: LONGREAL; n: INTEGER; VAR d: ARRAY OF CHAR); - VAR decpt, sign, i: LONGINT; buf: LONGINT; - BEGIN - (*x := x - 0.5; already rounded in ecvt*) - buf := ecvt(x, n+2, S.ADR(decpt), S.ADR(sign)); - i := 0; - WHILE i < decpt DO S.GET(buf + i, d[n - i -1]); INC(i) END ; (* showdef was crashing here on oocLowLReal.sym because of ecvt *) - i := n - i - 1; - WHILE i >= 0 DO d[i] := "0"; DEC(i) END ; - END ConvertL; - - PROCEDURE Unpack(VAR b, d: ARRAY OF S.BYTE); - VAR i, k: SHORTINT; len: LONGINT; - BEGIN i := 0; len := LEN(b); - WHILE i < len DO - k := SHORT(ORD(S.VAL(CHAR, b[i])) DIV 16); - IF k > 9 THEN d[i*2] := k + 55 ELSE d[i*2] := k + 48 END ; - k := SHORT(ORD(S.VAL(CHAR, b[i])) MOD 16); - IF k > 9 THEN d[i*2+1] := k + 55 ELSE d[i*2+1] := k + 48 END ; - INC(i) - END - END Unpack; - - PROCEDURE ConvertH* (y: REAL; VAR d: ARRAY OF CHAR); - BEGIN Unpack(y, d) - END ConvertH; - - PROCEDURE ConvertHL* (x: LONGREAL; VAR d: ARRAY OF CHAR); - BEGIN Unpack(x, d) - END ConvertHL; - -END Reals. diff --git a/src/lib/v4/powerpc/Reals.Mod b/src/lib/v4/powerpc/Reals.Mod deleted file mode 100644 index 037cba38..00000000 --- a/src/lib/v4/powerpc/Reals.Mod +++ /dev/null @@ -1,112 +0,0 @@ -MODULE Reals; - (* JT, 5.2.90 / RC 9.12.91 conversion between reals and strings for HP-700, MB 9.12.91, JT for Ofront, 16.3. 95*) - - IMPORT S := SYSTEM; - - - PROCEDURE -ecvt (x: LONGREAL; ndigit, decpt, sign: LONGINT): LONGINT - "(LONGINT)ecvt (x, ndigit, decpt, sign)"; - - PROCEDURE Ten*(e: INTEGER): REAL; - VAR r, power: LONGREAL; - BEGIN r := 1.0; - power := 10.0; - WHILE e > 0 DO - IF ODD(e) THEN r := r * power END ; - power := power * power; e := e DIV 2 - END ; - RETURN SHORT(r) - END Ten; - - PROCEDURE TenL*(e: INTEGER): LONGREAL; - VAR r, power: LONGREAL; - BEGIN r := 1.0; - power := 10.0; - LOOP - IF ODD(e) THEN r := r * power END ; - e := e DIV 2; - IF e <= 0 THEN RETURN r END ; - power := power * power - END - END TenL; - - PROCEDURE Expo*(x: REAL): INTEGER; - BEGIN - RETURN SHORT(ASH(S.VAL(LONGINT, x), -23) MOD 256) - END Expo; - - PROCEDURE ExpoL*(x: LONGREAL): INTEGER; - VAR h: LONGINT; - BEGIN - (*S.GET(S.ADR(x)+4, h);*) (* commented out, powerpc is big endian *) - S.GET(S.ADR(x), h); - RETURN SHORT(ASH(h, -20) MOD 2048) - END ExpoL; - - PROCEDURE SetExpo*(e: INTEGER; VAR x: REAL); - CONST expo = {1..8}; - BEGIN - x := S.VAL(REAL, S.VAL(SET, x) - expo + S.VAL(SET, ASH(LONG(e), 23))) - END SetExpo; - - PROCEDURE SetExpoL*(e: INTEGER; VAR x: LONGREAL); - CONST expo = {1..11}; - VAR h: SET; - BEGIN - (*S.GET(S.ADR(x)+4, h);*) (* big endian *) - S.GET(S.ADR(x), h); - h := h - expo + S.VAL(SET, ASH(LONG(e), 20)); - (*S.PUT(S.ADR(x)+4, h)*) - S.PUT(S.ADR(x), h) - END SetExpoL; - - PROCEDURE Convert*(x: REAL; n: INTEGER; VAR d: ARRAY OF CHAR); - VAR i, k: LONGINT; - BEGIN - i := ENTIER(x); k := 0; - WHILE k < n DO - d[k] := CHR(i MOD 10 + 48); i := i DIV 10; INC(k) - END - END Convert; -(* - PROCEDURE ConvertL*(x: LONGREAL; n: INTEGER; VAR d: ARRAY OF CHAR); - VAR i, k: LONGINT; - BEGIN - i := ENTIER(x); k := 0; - WHILE k < n DO - d[k] := CHR(i MOD 10 + 48); i := i DIV 10; INC(k) - END - END ConvertL; - *) - PROCEDURE ConvertL*(x: LONGREAL; n: INTEGER; VAR d: ARRAY OF CHAR); - VAR decpt, sign, i: LONGINT; buf: LONGINT; - BEGIN - (*x := x - 0.5; already rounded in ecvt*) - buf := ecvt(x, n+2, S.ADR(decpt), S.ADR(sign)); - i := 0; - WHILE i < decpt DO S.GET(buf + i, d[n - i -1]); INC(i) END ; (* showdef was crashing here on oocLowLReal.sym because of ecvt *) - i := n - i - 1; - WHILE i >= 0 DO d[i] := "0"; DEC(i) END ; - END ConvertL; - - PROCEDURE Unpack(VAR b, d: ARRAY OF S.BYTE); - VAR i, k: SHORTINT; len: LONGINT; - BEGIN i := 0; len := LEN(b); - WHILE i < len DO - k := SHORT(ORD(S.VAL(CHAR, b[i])) DIV 16); - IF k > 9 THEN d[i*2] := k + 55 ELSE d[i*2] := k + 48 END ; - k := SHORT(ORD(S.VAL(CHAR, b[i])) MOD 16); - IF k > 9 THEN d[i*2+1] := k + 55 ELSE d[i*2+1] := k + 48 END ; - INC(i) - END - END Unpack; - - PROCEDURE ConvertH* (y: REAL; VAR d: ARRAY OF CHAR); - BEGIN Unpack(y, d) - END ConvertH; - - PROCEDURE ConvertHL* (x: LONGREAL; VAR d: ARRAY OF CHAR); - BEGIN Unpack(x, d) - END ConvertHL; - -END Reals. diff --git a/src/lib/v4/x86/Reals.Mod b/src/lib/v4/x86/Reals.Mod deleted file mode 100644 index 087767c1..00000000 --- a/src/lib/v4/x86/Reals.Mod +++ /dev/null @@ -1,109 +0,0 @@ -MODULE Reals; - (* JT, 5.2.90 / RC 9.12.91 conversion between reals and strings for HP-700, MB 9.12.91, JT for Ofront, 16.3. 95*) - - IMPORT S := SYSTEM; - - - PROCEDURE -ecvt (x: LONGREAL; ndigit, decpt, sign: LONGINT): LONGINT - "(LONGINT)ecvt (x, ndigit, decpt, sign)"; - - PROCEDURE Ten*(e: INTEGER): REAL; - VAR r, power: LONGREAL; - BEGIN r := 1.0; - power := 10.0; - WHILE e > 0 DO - IF ODD(e) THEN r := r * power END ; - power := power * power; e := e DIV 2 - END ; - RETURN SHORT(r) - END Ten; - - PROCEDURE TenL*(e: INTEGER): LONGREAL; - VAR r, power: LONGREAL; - BEGIN r := 1.0; - power := 10.0; - LOOP - IF ODD(e) THEN r := r * power END ; - e := e DIV 2; - IF e <= 0 THEN RETURN r END ; - power := power * power - END - END TenL; - - PROCEDURE Expo*(x: REAL): INTEGER; - BEGIN - RETURN SHORT(ASH(S.VAL(LONGINT, x), -23) MOD 256) - END Expo; - - PROCEDURE ExpoL*(x: LONGREAL): INTEGER; - VAR h: LONGINT; - BEGIN - S.GET(S.ADR(x)+4, h); - RETURN SHORT(ASH(h, -20) MOD 2048) - END ExpoL; - - PROCEDURE SetExpo*(e: INTEGER; VAR x: REAL); - CONST expo = {1..8}; - BEGIN - x := S.VAL(REAL, S.VAL(SET, x) - expo + S.VAL(SET, ASH(LONG(e), 23))) - END SetExpo; - - PROCEDURE SetExpoL*(e: INTEGER; VAR x: LONGREAL); - CONST expo = {1..11}; - VAR h: SET; - BEGIN - S.GET(S.ADR(x)+4, h); - h := h - expo + S.VAL(SET, ASH(LONG(e), 20)); - S.PUT(S.ADR(x)+4, h) - END SetExpoL; - - PROCEDURE Convert*(x: REAL; n: INTEGER; VAR d: ARRAY OF CHAR); - VAR i, k: LONGINT; - BEGIN - i := ENTIER(x); k := 0; - WHILE k < n DO - d[k] := CHR(i MOD 10 + 48); i := i DIV 10; INC(k) - END - END Convert; -(* - PROCEDURE ConvertL*(x: LONGREAL; n: INTEGER; VAR d: ARRAY OF CHAR); - VAR i, k: LONGINT; - BEGIN - i := ENTIER(x); k := 0; - WHILE k < n DO - d[k] := CHR(i MOD 10 + 48); i := i DIV 10; INC(k) - END - END ConvertL; - *) - PROCEDURE ConvertL*(x: LONGREAL; n: INTEGER; VAR d: ARRAY OF CHAR); - VAR decpt, sign, i: LONGINT; buf: LONGINT; - BEGIN - (*x := x - 0.5; already rounded in ecvt*) - buf := ecvt(x, n+2, S.ADR(decpt), S.ADR(sign)); - i := 0; - WHILE i < decpt DO S.GET(buf + i, d[n - i -1]); INC(i) END ; (* showdef was crashing here on oocLowLReal.sym because of ecvt *) - i := n - i - 1; - WHILE i >= 0 DO d[i] := "0"; DEC(i) END ; - END ConvertL; - - PROCEDURE Unpack(VAR b, d: ARRAY OF S.BYTE); - VAR i, k: SHORTINT; len: LONGINT; - BEGIN i := 0; len := LEN(b); - WHILE i < len DO - k := SHORT(ORD(S.VAL(CHAR, b[i])) DIV 16); - IF k > 9 THEN d[i*2] := k + 55 ELSE d[i*2] := k + 48 END ; - k := SHORT(ORD(S.VAL(CHAR, b[i])) MOD 16); - IF k > 9 THEN d[i*2+1] := k + 55 ELSE d[i*2+1] := k + 48 END ; - INC(i) - END - END Unpack; - - PROCEDURE ConvertH* (y: REAL; VAR d: ARRAY OF CHAR); - BEGIN Unpack(y, d) - END ConvertH; - - PROCEDURE ConvertHL* (x: LONGREAL; VAR d: ARRAY OF CHAR); - BEGIN Unpack(x, d) - END ConvertHL; - -END Reals. From 6c6791edf9195ac7205d3bea0620eeaf3f649397 Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 16 Jun 2016 12:59:23 +0100 Subject: [PATCH 069/580] Consoldate v4 library files part 2. --- src/lib/v4/{Sets0.Mod => Sets.Mod} | 0 src/lib/v4/{Texts0.Mod => Texts.Mod} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename src/lib/v4/{Sets0.Mod => Sets.Mod} (100%) rename src/lib/v4/{Texts0.Mod => Texts.Mod} (100%) diff --git a/src/lib/v4/Sets0.Mod b/src/lib/v4/Sets.Mod similarity index 100% rename from src/lib/v4/Sets0.Mod rename to src/lib/v4/Sets.Mod diff --git a/src/lib/v4/Texts0.Mod b/src/lib/v4/Texts.Mod similarity index 100% rename from src/lib/v4/Texts0.Mod rename to src/lib/v4/Texts.Mod From 49e9fd3533b6ba4a7ac72e7fa669dcc56951f52c Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 16 Jun 2016 13:00:46 +0100 Subject: [PATCH 070/580] Move Oberon.Mod to system. --- src/{lib/v4_compat => system}/Oberon.Mod | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/{lib/v4_compat => system}/Oberon.Mod (100%) diff --git a/src/lib/v4_compat/Oberon.Mod b/src/system/Oberon.Mod similarity index 100% rename from src/lib/v4_compat/Oberon.Mod rename to src/system/Oberon.Mod From b7536a8446b456a3a0c3fe542af70bc3fb8c990c Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 16 Jun 2016 13:07:17 +0100 Subject: [PATCH 071/580] Move Args.Mod out of system as it's not part of the compiler build. --- src/{system => lib/v4}/Args.Mod | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/{system => lib/v4}/Args.Mod (100%) diff --git a/src/system/Args.Mod b/src/lib/v4/Args.Mod similarity index 100% rename from src/system/Args.Mod rename to src/lib/v4/Args.Mod From 1304822769de56f91e346d3e6cb1826973ba8400 Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 16 Jun 2016 13:56:12 +0100 Subject: [PATCH 072/580] Rename lib to library. --- src/{lib => library}/misc/Listen.Mod | 0 src/{lib => library}/misc/MersenneTwister.Mod | 0 src/{lib => library}/misc/MultiArrayRiders.Mod | 0 src/{lib => library}/misc/MultiArrays.Mod | 0 src/{lib => library}/misc/crt.Mod | 0 src/{lib => library}/misc/vt100.Mod | 0 src/{lib => library}/ooc/oocAscii.Mod | 0 src/{lib => library}/ooc/oocBinaryRider.Mod | 0 src/{lib => library}/ooc/oocCILP32.Mod | 0 src/{lib => library}/ooc/oocCLLP64.Mod | 0 src/{lib => library}/ooc/oocCLP64.Mod | 0 src/{lib => library}/ooc/oocChannel.Mod | 0 src/{lib => library}/ooc/oocCharClass.Mod | 0 src/{lib => library}/ooc/oocComplexMath.Mod | 0 src/{lib => library}/ooc/oocConvTypes.Mod | 0 src/{lib => library}/ooc/oocFilenames.Mod | 0 src/{lib => library}/ooc/oocIntConv.Mod | 0 src/{lib => library}/ooc/oocIntStr.Mod | 0 src/{lib => library}/ooc/oocJulianDay.Mod | 0 src/{lib => library}/ooc/oocLComplexMath.Mod | 0 src/{lib => library}/ooc/oocLRealConv.Mod | 0 src/{lib => library}/ooc/oocLRealMath.Mod | 0 src/{lib => library}/ooc/oocLRealStr.Mod | 0 src/{lib => library}/ooc/oocLongInts.Mod | 0 src/{lib => library}/ooc/oocLowLReal.Mod | 0 src/{lib => library}/ooc/oocLowReal.Mod | 0 src/{lib => library}/ooc/oocMsg.Mod | 0 src/{lib => library}/ooc/oocOakMath.Mod | 0 src/{lib => library}/ooc/oocOakStrings.Mod | 0 src/{lib => library}/ooc/oocRandomNumbers.Mod | 0 src/{lib => library}/ooc/oocRealConv.Mod | 0 src/{lib => library}/ooc/oocRealMath.Mod | 0 src/{lib => library}/ooc/oocRealStr.Mod | 0 src/{lib => library}/ooc/oocRts.Mod | 0 src/{lib => library}/ooc/oocStrings.Mod | 0 src/{lib => library}/ooc/oocStrings2.Mod | 0 src/{lib => library}/ooc/oocSysClock.Mod | 0 src/{lib => library}/ooc/oocTextRider.Mod | 0 src/{lib => library}/ooc/oocTime.Mod | 0 src/{lib => library}/ooc2/ooc2Ascii.Mod | 0 src/{lib => library}/ooc2/ooc2CharClass.Mod | 0 src/{lib => library}/ooc2/ooc2ConvTypes.Mod | 0 src/{lib => library}/ooc2/ooc2IntConv.Mod | 0 src/{lib => library}/ooc2/ooc2IntStr.Mod | 0 src/{lib => library}/ooc2/ooc2LRealConv.Mod | 0 src/{lib => library}/ooc2/ooc2Real0.Mod | 0 src/{lib => library}/ooc2/ooc2Strings.Mod | 0 src/{lib => library}/ooc2/oocwrapperlibc.Mod | 0 src/{lib => library}/oocX11/oocX11.Mod | 0 src/{lib => library}/oocX11/oocXYplane.Mod | 0 src/{lib => library}/oocX11/oocXutil.Mod | 0 src/{lib => library}/pow/powStrings.Mod | 0 src/{lib => library}/s3/ethBTrees.Mod | 0 src/{lib => library}/s3/ethDates.Mod | 0 src/{lib => library}/s3/ethGZReaders.Mod | 0 src/{lib => library}/s3/ethGZWriters.Mod | 0 src/{lib => library}/s3/ethMD5.Mod | 0 src/{lib => library}/s3/ethRandomNumbers.Mod | 0 src/{lib => library}/s3/ethReals.Mod | 0 src/{lib => library}/s3/ethSets.Mod | 0 src/{lib => library}/s3/ethStrings.Mod | 0 src/{lib => library}/s3/ethUnicode.Mod | 0 src/{lib => library}/s3/ethZip.Mod | 0 src/{lib => library}/s3/ethZlib.Mod | 0 src/{lib => library}/s3/ethZlibBuffers.Mod | 0 src/{lib => library}/s3/ethZlibDeflate.Mod | 0 src/{lib => library}/s3/ethZlibInflate.Mod | 0 src/{lib => library}/s3/ethZlibReaders.Mod | 0 src/{lib => library}/s3/ethZlibWriters.Mod | 0 src/{lib => library}/ulm/ulmASCII.Mod | 0 src/{lib => library}/ulm/ulmAssertions.Mod | 0 src/{lib => library}/ulm/ulmAsymmetricCiphers.Mod | 0 src/{lib => library}/ulm/ulmBlockCiphers.Mod | 0 src/{lib => library}/ulm/ulmCipherOps.Mod | 0 src/{lib => library}/ulm/ulmCiphers.Mod | 0 src/{lib => library}/ulm/ulmClocks.Mod | 0 src/{lib => library}/ulm/ulmConclusions.Mod | 0 src/{lib => library}/ulm/ulmConditions.Mod | 0 src/{lib => library}/ulm/ulmConstStrings.Mod | 0 src/{lib => library}/ulm/ulmDisciplines.Mod | 0 src/{lib => library}/ulm/ulmErrors.Mod | 0 src/{lib => library}/ulm/ulmEvents.Mod | 0 src/{lib => library}/ulm/ulmForwarders.Mod | 0 src/{lib => library}/ulm/ulmIEEE.Mod | 0 src/{lib => library}/ulm/ulmIO.Mod | 0 src/{lib => library}/ulm/ulmIndirectDisciplines.Mod | 0 src/{lib => library}/ulm/ulmIntOperations.Mod | 0 src/{lib => library}/ulm/ulmLoader.Mod | 0 src/{lib => library}/ulm/ulmMC68881.Mod | 0 src/{lib => library}/ulm/ulmNetIO.Mod | 0 src/{lib => library}/ulm/ulmObjects.Mod | 0 src/{lib => library}/ulm/ulmOperations.Mod | 0 src/{lib => library}/ulm/ulmPersistentDisciplines.Mod | 0 src/{lib => library}/ulm/ulmPersistentObjects.Mod | 0 src/{lib => library}/ulm/ulmPlotters.Mod | 0 src/{lib => library}/ulm/ulmPrint.Mod | 0 src/{lib => library}/ulm/ulmPriorities.Mod | 0 src/{lib => library}/ulm/ulmProcess.Mod | 0 src/{lib => library}/ulm/ulmRandomGenerators.Mod | 0 src/{lib => library}/ulm/ulmReals.Mod | 0 src/{lib => library}/ulm/ulmRelatedEvents.Mod | 0 src/{lib => library}/ulm/ulmResources.Mod | 0 src/{lib => library}/ulm/ulmSYSTEM.Mod | 0 src/{lib => library}/ulm/ulmScales.Mod | 0 src/{lib => library}/ulm/ulmServices.Mod | 0 src/{lib => library}/ulm/ulmSets.Mod | 0 src/{lib => library}/ulm/ulmStreamConditions.Mod | 0 src/{lib => library}/ulm/ulmStreamDisciplines.Mod | 0 src/{lib => library}/ulm/ulmStreams.Mod | 0 src/{lib => library}/ulm/ulmStrings.Mod | 0 src/{lib => library}/ulm/ulmSys.Mod | 0 src/{lib => library}/ulm/ulmSysConversions.Mod | 0 src/{lib => library}/ulm/ulmSysErrors.Mod | 0 src/{lib => library}/ulm/ulmSysIO.Mod | 0 src/{lib => library}/ulm/ulmSysStat.Mod | 0 src/{lib => library}/ulm/ulmSysTypes.Mod | 0 src/{lib => library}/ulm/ulmTCrypt.Mod | 0 src/{lib => library}/ulm/ulmTexts.Mod | 0 src/{lib => library}/ulm/ulmTimeConditions.Mod | 0 src/{lib => library}/ulm/ulmTimers.Mod | 0 src/{lib => library}/ulm/ulmTimes.Mod | 0 src/{lib => library}/ulm/ulmTypes.Mod | 0 src/{lib => library}/ulm/ulmWrite.Mod | 0 src/{lib => library}/v4/Args.Mod | 0 src/{lib => library}/v4/Modules.Mod | 0 src/{lib => library}/v4/Printer.Mod | 0 src/{lib => library}/v4/Reals.Mod | 0 src/{lib => library}/v4/Sets.Mod | 0 src/{lib => library}/v4/Strings.Mod | 0 src/{lib => library}/v4/Texts.Mod | 0 130 files changed, 0 insertions(+), 0 deletions(-) rename src/{lib => library}/misc/Listen.Mod (100%) rename src/{lib => library}/misc/MersenneTwister.Mod (100%) rename src/{lib => library}/misc/MultiArrayRiders.Mod (100%) rename src/{lib => library}/misc/MultiArrays.Mod (100%) rename src/{lib => library}/misc/crt.Mod (100%) rename src/{lib => library}/misc/vt100.Mod (100%) rename src/{lib => library}/ooc/oocAscii.Mod (100%) rename src/{lib => library}/ooc/oocBinaryRider.Mod (100%) rename src/{lib => library}/ooc/oocCILP32.Mod (100%) rename src/{lib => library}/ooc/oocCLLP64.Mod (100%) rename src/{lib => library}/ooc/oocCLP64.Mod (100%) rename src/{lib => library}/ooc/oocChannel.Mod (100%) rename src/{lib => library}/ooc/oocCharClass.Mod (100%) rename src/{lib => library}/ooc/oocComplexMath.Mod (100%) rename src/{lib => library}/ooc/oocConvTypes.Mod (100%) rename src/{lib => library}/ooc/oocFilenames.Mod (100%) rename src/{lib => library}/ooc/oocIntConv.Mod (100%) rename src/{lib => library}/ooc/oocIntStr.Mod (100%) rename src/{lib => library}/ooc/oocJulianDay.Mod (100%) rename src/{lib => library}/ooc/oocLComplexMath.Mod (100%) rename src/{lib => library}/ooc/oocLRealConv.Mod (100%) rename src/{lib => library}/ooc/oocLRealMath.Mod (100%) rename src/{lib => library}/ooc/oocLRealStr.Mod (100%) rename src/{lib => library}/ooc/oocLongInts.Mod (100%) rename src/{lib => library}/ooc/oocLowLReal.Mod (100%) rename src/{lib => library}/ooc/oocLowReal.Mod (100%) rename src/{lib => library}/ooc/oocMsg.Mod (100%) rename src/{lib => library}/ooc/oocOakMath.Mod (100%) rename src/{lib => library}/ooc/oocOakStrings.Mod (100%) rename src/{lib => library}/ooc/oocRandomNumbers.Mod (100%) rename src/{lib => library}/ooc/oocRealConv.Mod (100%) rename src/{lib => library}/ooc/oocRealMath.Mod (100%) rename src/{lib => library}/ooc/oocRealStr.Mod (100%) rename src/{lib => library}/ooc/oocRts.Mod (100%) rename src/{lib => library}/ooc/oocStrings.Mod (100%) rename src/{lib => library}/ooc/oocStrings2.Mod (100%) rename src/{lib => library}/ooc/oocSysClock.Mod (100%) rename src/{lib => library}/ooc/oocTextRider.Mod (100%) rename src/{lib => library}/ooc/oocTime.Mod (100%) rename src/{lib => library}/ooc2/ooc2Ascii.Mod (100%) rename src/{lib => library}/ooc2/ooc2CharClass.Mod (100%) rename src/{lib => library}/ooc2/ooc2ConvTypes.Mod (100%) rename src/{lib => library}/ooc2/ooc2IntConv.Mod (100%) rename src/{lib => library}/ooc2/ooc2IntStr.Mod (100%) rename src/{lib => library}/ooc2/ooc2LRealConv.Mod (100%) rename src/{lib => library}/ooc2/ooc2Real0.Mod (100%) rename src/{lib => library}/ooc2/ooc2Strings.Mod (100%) rename src/{lib => library}/ooc2/oocwrapperlibc.Mod (100%) rename src/{lib => library}/oocX11/oocX11.Mod (100%) rename src/{lib => library}/oocX11/oocXYplane.Mod (100%) rename src/{lib => library}/oocX11/oocXutil.Mod (100%) rename src/{lib => library}/pow/powStrings.Mod (100%) rename src/{lib => library}/s3/ethBTrees.Mod (100%) rename src/{lib => library}/s3/ethDates.Mod (100%) rename src/{lib => library}/s3/ethGZReaders.Mod (100%) rename src/{lib => library}/s3/ethGZWriters.Mod (100%) rename src/{lib => library}/s3/ethMD5.Mod (100%) rename src/{lib => library}/s3/ethRandomNumbers.Mod (100%) rename src/{lib => library}/s3/ethReals.Mod (100%) rename src/{lib => library}/s3/ethSets.Mod (100%) rename src/{lib => library}/s3/ethStrings.Mod (100%) rename src/{lib => library}/s3/ethUnicode.Mod (100%) rename src/{lib => library}/s3/ethZip.Mod (100%) rename src/{lib => library}/s3/ethZlib.Mod (100%) rename src/{lib => library}/s3/ethZlibBuffers.Mod (100%) rename src/{lib => library}/s3/ethZlibDeflate.Mod (100%) rename src/{lib => library}/s3/ethZlibInflate.Mod (100%) rename src/{lib => library}/s3/ethZlibReaders.Mod (100%) rename src/{lib => library}/s3/ethZlibWriters.Mod (100%) rename src/{lib => library}/ulm/ulmASCII.Mod (100%) rename src/{lib => library}/ulm/ulmAssertions.Mod (100%) rename src/{lib => library}/ulm/ulmAsymmetricCiphers.Mod (100%) rename src/{lib => library}/ulm/ulmBlockCiphers.Mod (100%) rename src/{lib => library}/ulm/ulmCipherOps.Mod (100%) rename src/{lib => library}/ulm/ulmCiphers.Mod (100%) rename src/{lib => library}/ulm/ulmClocks.Mod (100%) rename src/{lib => library}/ulm/ulmConclusions.Mod (100%) rename src/{lib => library}/ulm/ulmConditions.Mod (100%) rename src/{lib => library}/ulm/ulmConstStrings.Mod (100%) rename src/{lib => library}/ulm/ulmDisciplines.Mod (100%) rename src/{lib => library}/ulm/ulmErrors.Mod (100%) rename src/{lib => library}/ulm/ulmEvents.Mod (100%) rename src/{lib => library}/ulm/ulmForwarders.Mod (100%) rename src/{lib => library}/ulm/ulmIEEE.Mod (100%) rename src/{lib => library}/ulm/ulmIO.Mod (100%) rename src/{lib => library}/ulm/ulmIndirectDisciplines.Mod (100%) rename src/{lib => library}/ulm/ulmIntOperations.Mod (100%) rename src/{lib => library}/ulm/ulmLoader.Mod (100%) rename src/{lib => library}/ulm/ulmMC68881.Mod (100%) rename src/{lib => library}/ulm/ulmNetIO.Mod (100%) rename src/{lib => library}/ulm/ulmObjects.Mod (100%) rename src/{lib => library}/ulm/ulmOperations.Mod (100%) rename src/{lib => library}/ulm/ulmPersistentDisciplines.Mod (100%) rename src/{lib => library}/ulm/ulmPersistentObjects.Mod (100%) rename src/{lib => library}/ulm/ulmPlotters.Mod (100%) rename src/{lib => library}/ulm/ulmPrint.Mod (100%) rename src/{lib => library}/ulm/ulmPriorities.Mod (100%) rename src/{lib => library}/ulm/ulmProcess.Mod (100%) rename src/{lib => library}/ulm/ulmRandomGenerators.Mod (100%) rename src/{lib => library}/ulm/ulmReals.Mod (100%) rename src/{lib => library}/ulm/ulmRelatedEvents.Mod (100%) rename src/{lib => library}/ulm/ulmResources.Mod (100%) rename src/{lib => library}/ulm/ulmSYSTEM.Mod (100%) rename src/{lib => library}/ulm/ulmScales.Mod (100%) rename src/{lib => library}/ulm/ulmServices.Mod (100%) rename src/{lib => library}/ulm/ulmSets.Mod (100%) rename src/{lib => library}/ulm/ulmStreamConditions.Mod (100%) rename src/{lib => library}/ulm/ulmStreamDisciplines.Mod (100%) rename src/{lib => library}/ulm/ulmStreams.Mod (100%) rename src/{lib => library}/ulm/ulmStrings.Mod (100%) rename src/{lib => library}/ulm/ulmSys.Mod (100%) rename src/{lib => library}/ulm/ulmSysConversions.Mod (100%) rename src/{lib => library}/ulm/ulmSysErrors.Mod (100%) rename src/{lib => library}/ulm/ulmSysIO.Mod (100%) rename src/{lib => library}/ulm/ulmSysStat.Mod (100%) rename src/{lib => library}/ulm/ulmSysTypes.Mod (100%) rename src/{lib => library}/ulm/ulmTCrypt.Mod (100%) rename src/{lib => library}/ulm/ulmTexts.Mod (100%) rename src/{lib => library}/ulm/ulmTimeConditions.Mod (100%) rename src/{lib => library}/ulm/ulmTimers.Mod (100%) rename src/{lib => library}/ulm/ulmTimes.Mod (100%) rename src/{lib => library}/ulm/ulmTypes.Mod (100%) rename src/{lib => library}/ulm/ulmWrite.Mod (100%) rename src/{lib => library}/v4/Args.Mod (100%) rename src/{lib => library}/v4/Modules.Mod (100%) rename src/{lib => library}/v4/Printer.Mod (100%) rename src/{lib => library}/v4/Reals.Mod (100%) rename src/{lib => library}/v4/Sets.Mod (100%) rename src/{lib => library}/v4/Strings.Mod (100%) rename src/{lib => library}/v4/Texts.Mod (100%) diff --git a/src/lib/misc/Listen.Mod b/src/library/misc/Listen.Mod similarity index 100% rename from src/lib/misc/Listen.Mod rename to src/library/misc/Listen.Mod diff --git a/src/lib/misc/MersenneTwister.Mod b/src/library/misc/MersenneTwister.Mod similarity index 100% rename from src/lib/misc/MersenneTwister.Mod rename to src/library/misc/MersenneTwister.Mod diff --git a/src/lib/misc/MultiArrayRiders.Mod b/src/library/misc/MultiArrayRiders.Mod similarity index 100% rename from src/lib/misc/MultiArrayRiders.Mod rename to src/library/misc/MultiArrayRiders.Mod diff --git a/src/lib/misc/MultiArrays.Mod b/src/library/misc/MultiArrays.Mod similarity index 100% rename from src/lib/misc/MultiArrays.Mod rename to src/library/misc/MultiArrays.Mod diff --git a/src/lib/misc/crt.Mod b/src/library/misc/crt.Mod similarity index 100% rename from src/lib/misc/crt.Mod rename to src/library/misc/crt.Mod diff --git a/src/lib/misc/vt100.Mod b/src/library/misc/vt100.Mod similarity index 100% rename from src/lib/misc/vt100.Mod rename to src/library/misc/vt100.Mod diff --git a/src/lib/ooc/oocAscii.Mod b/src/library/ooc/oocAscii.Mod similarity index 100% rename from src/lib/ooc/oocAscii.Mod rename to src/library/ooc/oocAscii.Mod diff --git a/src/lib/ooc/oocBinaryRider.Mod b/src/library/ooc/oocBinaryRider.Mod similarity index 100% rename from src/lib/ooc/oocBinaryRider.Mod rename to src/library/ooc/oocBinaryRider.Mod diff --git a/src/lib/ooc/oocCILP32.Mod b/src/library/ooc/oocCILP32.Mod similarity index 100% rename from src/lib/ooc/oocCILP32.Mod rename to src/library/ooc/oocCILP32.Mod diff --git a/src/lib/ooc/oocCLLP64.Mod b/src/library/ooc/oocCLLP64.Mod similarity index 100% rename from src/lib/ooc/oocCLLP64.Mod rename to src/library/ooc/oocCLLP64.Mod diff --git a/src/lib/ooc/oocCLP64.Mod b/src/library/ooc/oocCLP64.Mod similarity index 100% rename from src/lib/ooc/oocCLP64.Mod rename to src/library/ooc/oocCLP64.Mod diff --git a/src/lib/ooc/oocChannel.Mod b/src/library/ooc/oocChannel.Mod similarity index 100% rename from src/lib/ooc/oocChannel.Mod rename to src/library/ooc/oocChannel.Mod diff --git a/src/lib/ooc/oocCharClass.Mod b/src/library/ooc/oocCharClass.Mod similarity index 100% rename from src/lib/ooc/oocCharClass.Mod rename to src/library/ooc/oocCharClass.Mod diff --git a/src/lib/ooc/oocComplexMath.Mod b/src/library/ooc/oocComplexMath.Mod similarity index 100% rename from src/lib/ooc/oocComplexMath.Mod rename to src/library/ooc/oocComplexMath.Mod diff --git a/src/lib/ooc/oocConvTypes.Mod b/src/library/ooc/oocConvTypes.Mod similarity index 100% rename from src/lib/ooc/oocConvTypes.Mod rename to src/library/ooc/oocConvTypes.Mod diff --git a/src/lib/ooc/oocFilenames.Mod b/src/library/ooc/oocFilenames.Mod similarity index 100% rename from src/lib/ooc/oocFilenames.Mod rename to src/library/ooc/oocFilenames.Mod diff --git a/src/lib/ooc/oocIntConv.Mod b/src/library/ooc/oocIntConv.Mod similarity index 100% rename from src/lib/ooc/oocIntConv.Mod rename to src/library/ooc/oocIntConv.Mod diff --git a/src/lib/ooc/oocIntStr.Mod b/src/library/ooc/oocIntStr.Mod similarity index 100% rename from src/lib/ooc/oocIntStr.Mod rename to src/library/ooc/oocIntStr.Mod diff --git a/src/lib/ooc/oocJulianDay.Mod b/src/library/ooc/oocJulianDay.Mod similarity index 100% rename from src/lib/ooc/oocJulianDay.Mod rename to src/library/ooc/oocJulianDay.Mod diff --git a/src/lib/ooc/oocLComplexMath.Mod b/src/library/ooc/oocLComplexMath.Mod similarity index 100% rename from src/lib/ooc/oocLComplexMath.Mod rename to src/library/ooc/oocLComplexMath.Mod diff --git a/src/lib/ooc/oocLRealConv.Mod b/src/library/ooc/oocLRealConv.Mod similarity index 100% rename from src/lib/ooc/oocLRealConv.Mod rename to src/library/ooc/oocLRealConv.Mod diff --git a/src/lib/ooc/oocLRealMath.Mod b/src/library/ooc/oocLRealMath.Mod similarity index 100% rename from src/lib/ooc/oocLRealMath.Mod rename to src/library/ooc/oocLRealMath.Mod diff --git a/src/lib/ooc/oocLRealStr.Mod b/src/library/ooc/oocLRealStr.Mod similarity index 100% rename from src/lib/ooc/oocLRealStr.Mod rename to src/library/ooc/oocLRealStr.Mod diff --git a/src/lib/ooc/oocLongInts.Mod b/src/library/ooc/oocLongInts.Mod similarity index 100% rename from src/lib/ooc/oocLongInts.Mod rename to src/library/ooc/oocLongInts.Mod diff --git a/src/lib/ooc/oocLowLReal.Mod b/src/library/ooc/oocLowLReal.Mod similarity index 100% rename from src/lib/ooc/oocLowLReal.Mod rename to src/library/ooc/oocLowLReal.Mod diff --git a/src/lib/ooc/oocLowReal.Mod b/src/library/ooc/oocLowReal.Mod similarity index 100% rename from src/lib/ooc/oocLowReal.Mod rename to src/library/ooc/oocLowReal.Mod diff --git a/src/lib/ooc/oocMsg.Mod b/src/library/ooc/oocMsg.Mod similarity index 100% rename from src/lib/ooc/oocMsg.Mod rename to src/library/ooc/oocMsg.Mod diff --git a/src/lib/ooc/oocOakMath.Mod b/src/library/ooc/oocOakMath.Mod similarity index 100% rename from src/lib/ooc/oocOakMath.Mod rename to src/library/ooc/oocOakMath.Mod diff --git a/src/lib/ooc/oocOakStrings.Mod b/src/library/ooc/oocOakStrings.Mod similarity index 100% rename from src/lib/ooc/oocOakStrings.Mod rename to src/library/ooc/oocOakStrings.Mod diff --git a/src/lib/ooc/oocRandomNumbers.Mod b/src/library/ooc/oocRandomNumbers.Mod similarity index 100% rename from src/lib/ooc/oocRandomNumbers.Mod rename to src/library/ooc/oocRandomNumbers.Mod diff --git a/src/lib/ooc/oocRealConv.Mod b/src/library/ooc/oocRealConv.Mod similarity index 100% rename from src/lib/ooc/oocRealConv.Mod rename to src/library/ooc/oocRealConv.Mod diff --git a/src/lib/ooc/oocRealMath.Mod b/src/library/ooc/oocRealMath.Mod similarity index 100% rename from src/lib/ooc/oocRealMath.Mod rename to src/library/ooc/oocRealMath.Mod diff --git a/src/lib/ooc/oocRealStr.Mod b/src/library/ooc/oocRealStr.Mod similarity index 100% rename from src/lib/ooc/oocRealStr.Mod rename to src/library/ooc/oocRealStr.Mod diff --git a/src/lib/ooc/oocRts.Mod b/src/library/ooc/oocRts.Mod similarity index 100% rename from src/lib/ooc/oocRts.Mod rename to src/library/ooc/oocRts.Mod diff --git a/src/lib/ooc/oocStrings.Mod b/src/library/ooc/oocStrings.Mod similarity index 100% rename from src/lib/ooc/oocStrings.Mod rename to src/library/ooc/oocStrings.Mod diff --git a/src/lib/ooc/oocStrings2.Mod b/src/library/ooc/oocStrings2.Mod similarity index 100% rename from src/lib/ooc/oocStrings2.Mod rename to src/library/ooc/oocStrings2.Mod diff --git a/src/lib/ooc/oocSysClock.Mod b/src/library/ooc/oocSysClock.Mod similarity index 100% rename from src/lib/ooc/oocSysClock.Mod rename to src/library/ooc/oocSysClock.Mod diff --git a/src/lib/ooc/oocTextRider.Mod b/src/library/ooc/oocTextRider.Mod similarity index 100% rename from src/lib/ooc/oocTextRider.Mod rename to src/library/ooc/oocTextRider.Mod diff --git a/src/lib/ooc/oocTime.Mod b/src/library/ooc/oocTime.Mod similarity index 100% rename from src/lib/ooc/oocTime.Mod rename to src/library/ooc/oocTime.Mod diff --git a/src/lib/ooc2/ooc2Ascii.Mod b/src/library/ooc2/ooc2Ascii.Mod similarity index 100% rename from src/lib/ooc2/ooc2Ascii.Mod rename to src/library/ooc2/ooc2Ascii.Mod diff --git a/src/lib/ooc2/ooc2CharClass.Mod b/src/library/ooc2/ooc2CharClass.Mod similarity index 100% rename from src/lib/ooc2/ooc2CharClass.Mod rename to src/library/ooc2/ooc2CharClass.Mod diff --git a/src/lib/ooc2/ooc2ConvTypes.Mod b/src/library/ooc2/ooc2ConvTypes.Mod similarity index 100% rename from src/lib/ooc2/ooc2ConvTypes.Mod rename to src/library/ooc2/ooc2ConvTypes.Mod diff --git a/src/lib/ooc2/ooc2IntConv.Mod b/src/library/ooc2/ooc2IntConv.Mod similarity index 100% rename from src/lib/ooc2/ooc2IntConv.Mod rename to src/library/ooc2/ooc2IntConv.Mod diff --git a/src/lib/ooc2/ooc2IntStr.Mod b/src/library/ooc2/ooc2IntStr.Mod similarity index 100% rename from src/lib/ooc2/ooc2IntStr.Mod rename to src/library/ooc2/ooc2IntStr.Mod diff --git a/src/lib/ooc2/ooc2LRealConv.Mod b/src/library/ooc2/ooc2LRealConv.Mod similarity index 100% rename from src/lib/ooc2/ooc2LRealConv.Mod rename to src/library/ooc2/ooc2LRealConv.Mod diff --git a/src/lib/ooc2/ooc2Real0.Mod b/src/library/ooc2/ooc2Real0.Mod similarity index 100% rename from src/lib/ooc2/ooc2Real0.Mod rename to src/library/ooc2/ooc2Real0.Mod diff --git a/src/lib/ooc2/ooc2Strings.Mod b/src/library/ooc2/ooc2Strings.Mod similarity index 100% rename from src/lib/ooc2/ooc2Strings.Mod rename to src/library/ooc2/ooc2Strings.Mod diff --git a/src/lib/ooc2/oocwrapperlibc.Mod b/src/library/ooc2/oocwrapperlibc.Mod similarity index 100% rename from src/lib/ooc2/oocwrapperlibc.Mod rename to src/library/ooc2/oocwrapperlibc.Mod diff --git a/src/lib/oocX11/oocX11.Mod b/src/library/oocX11/oocX11.Mod similarity index 100% rename from src/lib/oocX11/oocX11.Mod rename to src/library/oocX11/oocX11.Mod diff --git a/src/lib/oocX11/oocXYplane.Mod b/src/library/oocX11/oocXYplane.Mod similarity index 100% rename from src/lib/oocX11/oocXYplane.Mod rename to src/library/oocX11/oocXYplane.Mod diff --git a/src/lib/oocX11/oocXutil.Mod b/src/library/oocX11/oocXutil.Mod similarity index 100% rename from src/lib/oocX11/oocXutil.Mod rename to src/library/oocX11/oocXutil.Mod diff --git a/src/lib/pow/powStrings.Mod b/src/library/pow/powStrings.Mod similarity index 100% rename from src/lib/pow/powStrings.Mod rename to src/library/pow/powStrings.Mod diff --git a/src/lib/s3/ethBTrees.Mod b/src/library/s3/ethBTrees.Mod similarity index 100% rename from src/lib/s3/ethBTrees.Mod rename to src/library/s3/ethBTrees.Mod diff --git a/src/lib/s3/ethDates.Mod b/src/library/s3/ethDates.Mod similarity index 100% rename from src/lib/s3/ethDates.Mod rename to src/library/s3/ethDates.Mod diff --git a/src/lib/s3/ethGZReaders.Mod b/src/library/s3/ethGZReaders.Mod similarity index 100% rename from src/lib/s3/ethGZReaders.Mod rename to src/library/s3/ethGZReaders.Mod diff --git a/src/lib/s3/ethGZWriters.Mod b/src/library/s3/ethGZWriters.Mod similarity index 100% rename from src/lib/s3/ethGZWriters.Mod rename to src/library/s3/ethGZWriters.Mod diff --git a/src/lib/s3/ethMD5.Mod b/src/library/s3/ethMD5.Mod similarity index 100% rename from src/lib/s3/ethMD5.Mod rename to src/library/s3/ethMD5.Mod diff --git a/src/lib/s3/ethRandomNumbers.Mod b/src/library/s3/ethRandomNumbers.Mod similarity index 100% rename from src/lib/s3/ethRandomNumbers.Mod rename to src/library/s3/ethRandomNumbers.Mod diff --git a/src/lib/s3/ethReals.Mod b/src/library/s3/ethReals.Mod similarity index 100% rename from src/lib/s3/ethReals.Mod rename to src/library/s3/ethReals.Mod diff --git a/src/lib/s3/ethSets.Mod b/src/library/s3/ethSets.Mod similarity index 100% rename from src/lib/s3/ethSets.Mod rename to src/library/s3/ethSets.Mod diff --git a/src/lib/s3/ethStrings.Mod b/src/library/s3/ethStrings.Mod similarity index 100% rename from src/lib/s3/ethStrings.Mod rename to src/library/s3/ethStrings.Mod diff --git a/src/lib/s3/ethUnicode.Mod b/src/library/s3/ethUnicode.Mod similarity index 100% rename from src/lib/s3/ethUnicode.Mod rename to src/library/s3/ethUnicode.Mod diff --git a/src/lib/s3/ethZip.Mod b/src/library/s3/ethZip.Mod similarity index 100% rename from src/lib/s3/ethZip.Mod rename to src/library/s3/ethZip.Mod diff --git a/src/lib/s3/ethZlib.Mod b/src/library/s3/ethZlib.Mod similarity index 100% rename from src/lib/s3/ethZlib.Mod rename to src/library/s3/ethZlib.Mod diff --git a/src/lib/s3/ethZlibBuffers.Mod b/src/library/s3/ethZlibBuffers.Mod similarity index 100% rename from src/lib/s3/ethZlibBuffers.Mod rename to src/library/s3/ethZlibBuffers.Mod diff --git a/src/lib/s3/ethZlibDeflate.Mod b/src/library/s3/ethZlibDeflate.Mod similarity index 100% rename from src/lib/s3/ethZlibDeflate.Mod rename to src/library/s3/ethZlibDeflate.Mod diff --git a/src/lib/s3/ethZlibInflate.Mod b/src/library/s3/ethZlibInflate.Mod similarity index 100% rename from src/lib/s3/ethZlibInflate.Mod rename to src/library/s3/ethZlibInflate.Mod diff --git a/src/lib/s3/ethZlibReaders.Mod b/src/library/s3/ethZlibReaders.Mod similarity index 100% rename from src/lib/s3/ethZlibReaders.Mod rename to src/library/s3/ethZlibReaders.Mod diff --git a/src/lib/s3/ethZlibWriters.Mod b/src/library/s3/ethZlibWriters.Mod similarity index 100% rename from src/lib/s3/ethZlibWriters.Mod rename to src/library/s3/ethZlibWriters.Mod diff --git a/src/lib/ulm/ulmASCII.Mod b/src/library/ulm/ulmASCII.Mod similarity index 100% rename from src/lib/ulm/ulmASCII.Mod rename to src/library/ulm/ulmASCII.Mod diff --git a/src/lib/ulm/ulmAssertions.Mod b/src/library/ulm/ulmAssertions.Mod similarity index 100% rename from src/lib/ulm/ulmAssertions.Mod rename to src/library/ulm/ulmAssertions.Mod diff --git a/src/lib/ulm/ulmAsymmetricCiphers.Mod b/src/library/ulm/ulmAsymmetricCiphers.Mod similarity index 100% rename from src/lib/ulm/ulmAsymmetricCiphers.Mod rename to src/library/ulm/ulmAsymmetricCiphers.Mod diff --git a/src/lib/ulm/ulmBlockCiphers.Mod b/src/library/ulm/ulmBlockCiphers.Mod similarity index 100% rename from src/lib/ulm/ulmBlockCiphers.Mod rename to src/library/ulm/ulmBlockCiphers.Mod diff --git a/src/lib/ulm/ulmCipherOps.Mod b/src/library/ulm/ulmCipherOps.Mod similarity index 100% rename from src/lib/ulm/ulmCipherOps.Mod rename to src/library/ulm/ulmCipherOps.Mod diff --git a/src/lib/ulm/ulmCiphers.Mod b/src/library/ulm/ulmCiphers.Mod similarity index 100% rename from src/lib/ulm/ulmCiphers.Mod rename to src/library/ulm/ulmCiphers.Mod diff --git a/src/lib/ulm/ulmClocks.Mod b/src/library/ulm/ulmClocks.Mod similarity index 100% rename from src/lib/ulm/ulmClocks.Mod rename to src/library/ulm/ulmClocks.Mod diff --git a/src/lib/ulm/ulmConclusions.Mod b/src/library/ulm/ulmConclusions.Mod similarity index 100% rename from src/lib/ulm/ulmConclusions.Mod rename to src/library/ulm/ulmConclusions.Mod diff --git a/src/lib/ulm/ulmConditions.Mod b/src/library/ulm/ulmConditions.Mod similarity index 100% rename from src/lib/ulm/ulmConditions.Mod rename to src/library/ulm/ulmConditions.Mod diff --git a/src/lib/ulm/ulmConstStrings.Mod b/src/library/ulm/ulmConstStrings.Mod similarity index 100% rename from src/lib/ulm/ulmConstStrings.Mod rename to src/library/ulm/ulmConstStrings.Mod diff --git a/src/lib/ulm/ulmDisciplines.Mod b/src/library/ulm/ulmDisciplines.Mod similarity index 100% rename from src/lib/ulm/ulmDisciplines.Mod rename to src/library/ulm/ulmDisciplines.Mod diff --git a/src/lib/ulm/ulmErrors.Mod b/src/library/ulm/ulmErrors.Mod similarity index 100% rename from src/lib/ulm/ulmErrors.Mod rename to src/library/ulm/ulmErrors.Mod diff --git a/src/lib/ulm/ulmEvents.Mod b/src/library/ulm/ulmEvents.Mod similarity index 100% rename from src/lib/ulm/ulmEvents.Mod rename to src/library/ulm/ulmEvents.Mod diff --git a/src/lib/ulm/ulmForwarders.Mod b/src/library/ulm/ulmForwarders.Mod similarity index 100% rename from src/lib/ulm/ulmForwarders.Mod rename to src/library/ulm/ulmForwarders.Mod diff --git a/src/lib/ulm/ulmIEEE.Mod b/src/library/ulm/ulmIEEE.Mod similarity index 100% rename from src/lib/ulm/ulmIEEE.Mod rename to src/library/ulm/ulmIEEE.Mod diff --git a/src/lib/ulm/ulmIO.Mod b/src/library/ulm/ulmIO.Mod similarity index 100% rename from src/lib/ulm/ulmIO.Mod rename to src/library/ulm/ulmIO.Mod diff --git a/src/lib/ulm/ulmIndirectDisciplines.Mod b/src/library/ulm/ulmIndirectDisciplines.Mod similarity index 100% rename from src/lib/ulm/ulmIndirectDisciplines.Mod rename to src/library/ulm/ulmIndirectDisciplines.Mod diff --git a/src/lib/ulm/ulmIntOperations.Mod b/src/library/ulm/ulmIntOperations.Mod similarity index 100% rename from src/lib/ulm/ulmIntOperations.Mod rename to src/library/ulm/ulmIntOperations.Mod diff --git a/src/lib/ulm/ulmLoader.Mod b/src/library/ulm/ulmLoader.Mod similarity index 100% rename from src/lib/ulm/ulmLoader.Mod rename to src/library/ulm/ulmLoader.Mod diff --git a/src/lib/ulm/ulmMC68881.Mod b/src/library/ulm/ulmMC68881.Mod similarity index 100% rename from src/lib/ulm/ulmMC68881.Mod rename to src/library/ulm/ulmMC68881.Mod diff --git a/src/lib/ulm/ulmNetIO.Mod b/src/library/ulm/ulmNetIO.Mod similarity index 100% rename from src/lib/ulm/ulmNetIO.Mod rename to src/library/ulm/ulmNetIO.Mod diff --git a/src/lib/ulm/ulmObjects.Mod b/src/library/ulm/ulmObjects.Mod similarity index 100% rename from src/lib/ulm/ulmObjects.Mod rename to src/library/ulm/ulmObjects.Mod diff --git a/src/lib/ulm/ulmOperations.Mod b/src/library/ulm/ulmOperations.Mod similarity index 100% rename from src/lib/ulm/ulmOperations.Mod rename to src/library/ulm/ulmOperations.Mod diff --git a/src/lib/ulm/ulmPersistentDisciplines.Mod b/src/library/ulm/ulmPersistentDisciplines.Mod similarity index 100% rename from src/lib/ulm/ulmPersistentDisciplines.Mod rename to src/library/ulm/ulmPersistentDisciplines.Mod diff --git a/src/lib/ulm/ulmPersistentObjects.Mod b/src/library/ulm/ulmPersistentObjects.Mod similarity index 100% rename from src/lib/ulm/ulmPersistentObjects.Mod rename to src/library/ulm/ulmPersistentObjects.Mod diff --git a/src/lib/ulm/ulmPlotters.Mod b/src/library/ulm/ulmPlotters.Mod similarity index 100% rename from src/lib/ulm/ulmPlotters.Mod rename to src/library/ulm/ulmPlotters.Mod diff --git a/src/lib/ulm/ulmPrint.Mod b/src/library/ulm/ulmPrint.Mod similarity index 100% rename from src/lib/ulm/ulmPrint.Mod rename to src/library/ulm/ulmPrint.Mod diff --git a/src/lib/ulm/ulmPriorities.Mod b/src/library/ulm/ulmPriorities.Mod similarity index 100% rename from src/lib/ulm/ulmPriorities.Mod rename to src/library/ulm/ulmPriorities.Mod diff --git a/src/lib/ulm/ulmProcess.Mod b/src/library/ulm/ulmProcess.Mod similarity index 100% rename from src/lib/ulm/ulmProcess.Mod rename to src/library/ulm/ulmProcess.Mod diff --git a/src/lib/ulm/ulmRandomGenerators.Mod b/src/library/ulm/ulmRandomGenerators.Mod similarity index 100% rename from src/lib/ulm/ulmRandomGenerators.Mod rename to src/library/ulm/ulmRandomGenerators.Mod diff --git a/src/lib/ulm/ulmReals.Mod b/src/library/ulm/ulmReals.Mod similarity index 100% rename from src/lib/ulm/ulmReals.Mod rename to src/library/ulm/ulmReals.Mod diff --git a/src/lib/ulm/ulmRelatedEvents.Mod b/src/library/ulm/ulmRelatedEvents.Mod similarity index 100% rename from src/lib/ulm/ulmRelatedEvents.Mod rename to src/library/ulm/ulmRelatedEvents.Mod diff --git a/src/lib/ulm/ulmResources.Mod b/src/library/ulm/ulmResources.Mod similarity index 100% rename from src/lib/ulm/ulmResources.Mod rename to src/library/ulm/ulmResources.Mod diff --git a/src/lib/ulm/ulmSYSTEM.Mod b/src/library/ulm/ulmSYSTEM.Mod similarity index 100% rename from src/lib/ulm/ulmSYSTEM.Mod rename to src/library/ulm/ulmSYSTEM.Mod diff --git a/src/lib/ulm/ulmScales.Mod b/src/library/ulm/ulmScales.Mod similarity index 100% rename from src/lib/ulm/ulmScales.Mod rename to src/library/ulm/ulmScales.Mod diff --git a/src/lib/ulm/ulmServices.Mod b/src/library/ulm/ulmServices.Mod similarity index 100% rename from src/lib/ulm/ulmServices.Mod rename to src/library/ulm/ulmServices.Mod diff --git a/src/lib/ulm/ulmSets.Mod b/src/library/ulm/ulmSets.Mod similarity index 100% rename from src/lib/ulm/ulmSets.Mod rename to src/library/ulm/ulmSets.Mod diff --git a/src/lib/ulm/ulmStreamConditions.Mod b/src/library/ulm/ulmStreamConditions.Mod similarity index 100% rename from src/lib/ulm/ulmStreamConditions.Mod rename to src/library/ulm/ulmStreamConditions.Mod diff --git a/src/lib/ulm/ulmStreamDisciplines.Mod b/src/library/ulm/ulmStreamDisciplines.Mod similarity index 100% rename from src/lib/ulm/ulmStreamDisciplines.Mod rename to src/library/ulm/ulmStreamDisciplines.Mod diff --git a/src/lib/ulm/ulmStreams.Mod b/src/library/ulm/ulmStreams.Mod similarity index 100% rename from src/lib/ulm/ulmStreams.Mod rename to src/library/ulm/ulmStreams.Mod diff --git a/src/lib/ulm/ulmStrings.Mod b/src/library/ulm/ulmStrings.Mod similarity index 100% rename from src/lib/ulm/ulmStrings.Mod rename to src/library/ulm/ulmStrings.Mod diff --git a/src/lib/ulm/ulmSys.Mod b/src/library/ulm/ulmSys.Mod similarity index 100% rename from src/lib/ulm/ulmSys.Mod rename to src/library/ulm/ulmSys.Mod diff --git a/src/lib/ulm/ulmSysConversions.Mod b/src/library/ulm/ulmSysConversions.Mod similarity index 100% rename from src/lib/ulm/ulmSysConversions.Mod rename to src/library/ulm/ulmSysConversions.Mod diff --git a/src/lib/ulm/ulmSysErrors.Mod b/src/library/ulm/ulmSysErrors.Mod similarity index 100% rename from src/lib/ulm/ulmSysErrors.Mod rename to src/library/ulm/ulmSysErrors.Mod diff --git a/src/lib/ulm/ulmSysIO.Mod b/src/library/ulm/ulmSysIO.Mod similarity index 100% rename from src/lib/ulm/ulmSysIO.Mod rename to src/library/ulm/ulmSysIO.Mod diff --git a/src/lib/ulm/ulmSysStat.Mod b/src/library/ulm/ulmSysStat.Mod similarity index 100% rename from src/lib/ulm/ulmSysStat.Mod rename to src/library/ulm/ulmSysStat.Mod diff --git a/src/lib/ulm/ulmSysTypes.Mod b/src/library/ulm/ulmSysTypes.Mod similarity index 100% rename from src/lib/ulm/ulmSysTypes.Mod rename to src/library/ulm/ulmSysTypes.Mod diff --git a/src/lib/ulm/ulmTCrypt.Mod b/src/library/ulm/ulmTCrypt.Mod similarity index 100% rename from src/lib/ulm/ulmTCrypt.Mod rename to src/library/ulm/ulmTCrypt.Mod diff --git a/src/lib/ulm/ulmTexts.Mod b/src/library/ulm/ulmTexts.Mod similarity index 100% rename from src/lib/ulm/ulmTexts.Mod rename to src/library/ulm/ulmTexts.Mod diff --git a/src/lib/ulm/ulmTimeConditions.Mod b/src/library/ulm/ulmTimeConditions.Mod similarity index 100% rename from src/lib/ulm/ulmTimeConditions.Mod rename to src/library/ulm/ulmTimeConditions.Mod diff --git a/src/lib/ulm/ulmTimers.Mod b/src/library/ulm/ulmTimers.Mod similarity index 100% rename from src/lib/ulm/ulmTimers.Mod rename to src/library/ulm/ulmTimers.Mod diff --git a/src/lib/ulm/ulmTimes.Mod b/src/library/ulm/ulmTimes.Mod similarity index 100% rename from src/lib/ulm/ulmTimes.Mod rename to src/library/ulm/ulmTimes.Mod diff --git a/src/lib/ulm/ulmTypes.Mod b/src/library/ulm/ulmTypes.Mod similarity index 100% rename from src/lib/ulm/ulmTypes.Mod rename to src/library/ulm/ulmTypes.Mod diff --git a/src/lib/ulm/ulmWrite.Mod b/src/library/ulm/ulmWrite.Mod similarity index 100% rename from src/lib/ulm/ulmWrite.Mod rename to src/library/ulm/ulmWrite.Mod diff --git a/src/lib/v4/Args.Mod b/src/library/v4/Args.Mod similarity index 100% rename from src/lib/v4/Args.Mod rename to src/library/v4/Args.Mod diff --git a/src/lib/v4/Modules.Mod b/src/library/v4/Modules.Mod similarity index 100% rename from src/lib/v4/Modules.Mod rename to src/library/v4/Modules.Mod diff --git a/src/lib/v4/Printer.Mod b/src/library/v4/Printer.Mod similarity index 100% rename from src/lib/v4/Printer.Mod rename to src/library/v4/Printer.Mod diff --git a/src/lib/v4/Reals.Mod b/src/library/v4/Reals.Mod similarity index 100% rename from src/lib/v4/Reals.Mod rename to src/library/v4/Reals.Mod diff --git a/src/lib/v4/Sets.Mod b/src/library/v4/Sets.Mod similarity index 100% rename from src/lib/v4/Sets.Mod rename to src/library/v4/Sets.Mod diff --git a/src/lib/v4/Strings.Mod b/src/library/v4/Strings.Mod similarity index 100% rename from src/lib/v4/Strings.Mod rename to src/library/v4/Strings.Mod diff --git a/src/lib/v4/Texts.Mod b/src/library/v4/Texts.Mod similarity index 100% rename from src/lib/v4/Texts.Mod rename to src/library/v4/Texts.Mod From efefcf0fb4134396ddbe29b8fa7b5ee4e3c4b330 Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 16 Jun 2016 13:56:34 +0100 Subject: [PATCH 073/580] Add confidence tests. --- src/test/confidence/arrayassignment/aa.mod | 26 + src/test/confidence/arrayassignment/expected | 10 + src/test/confidence/arrayassignment/result | 10 + src/test/confidence/arrayassignment/test.sh | 4 + src/test/confidence/hello/expected | 1 + src/test/confidence/hello/hello.mod | 6 + src/test/confidence/hello/result | 1 + src/test/confidence/hello/test.sh | 4 + src/test/confidence/lola/LSB.Mod | 52 ++ src/test/confidence/lola/LSB.h | 79 +++ src/test/confidence/lola/LSC.Mod | 536 +++++++++++++++++++ src/test/confidence/lola/LSC.h | 16 + src/test/confidence/lola/LSS.Mod | 165 ++++++ src/test/confidence/lola/LSS.h | 25 + src/test/confidence/lola/LSV.Mod | 238 ++++++++ src/test/confidence/lola/LSV.h | 16 + src/test/confidence/lola/RISC5.Lola | 214 ++++++++ src/test/confidence/lola/expected | 113 ++++ src/test/confidence/lola/lola.Mod | 12 + src/test/confidence/lola/result | 113 ++++ src/test/confidence/lola/test.sh | 4 + src/test/confidence/signal/expected | 1 + src/test/confidence/signal/result | 1 + src/test/confidence/signal/signal.mod | 51 ++ src/test/confidence/signal/test.sh | 7 + src/test/confidence/testenv.sh | 10 + src/test/confidence/testresult.sh | 5 + 27 files changed, 1720 insertions(+) create mode 100644 src/test/confidence/arrayassignment/aa.mod create mode 100644 src/test/confidence/arrayassignment/expected create mode 100644 src/test/confidence/arrayassignment/result create mode 100755 src/test/confidence/arrayassignment/test.sh create mode 100644 src/test/confidence/hello/expected create mode 100644 src/test/confidence/hello/hello.mod create mode 100644 src/test/confidence/hello/result create mode 100755 src/test/confidence/hello/test.sh create mode 100755 src/test/confidence/lola/LSB.Mod create mode 100644 src/test/confidence/lola/LSB.h create mode 100755 src/test/confidence/lola/LSC.Mod create mode 100644 src/test/confidence/lola/LSC.h create mode 100755 src/test/confidence/lola/LSS.Mod create mode 100644 src/test/confidence/lola/LSS.h create mode 100755 src/test/confidence/lola/LSV.Mod create mode 100644 src/test/confidence/lola/LSV.h create mode 100755 src/test/confidence/lola/RISC5.Lola create mode 100644 src/test/confidence/lola/expected create mode 100755 src/test/confidence/lola/lola.Mod create mode 100644 src/test/confidence/lola/result create mode 100755 src/test/confidence/lola/test.sh create mode 100644 src/test/confidence/signal/expected create mode 100644 src/test/confidence/signal/result create mode 100644 src/test/confidence/signal/signal.mod create mode 100755 src/test/confidence/signal/test.sh create mode 100755 src/test/confidence/testenv.sh create mode 100755 src/test/confidence/testresult.sh diff --git a/src/test/confidence/arrayassignment/aa.mod b/src/test/confidence/arrayassignment/aa.mod new file mode 100644 index 00000000..145824e8 --- /dev/null +++ b/src/test/confidence/arrayassignment/aa.mod @@ -0,0 +1,26 @@ +MODULE aa; +IMPORT Console; + +CONST teststring = "1st 10 ch 2nd 10 ch 3rd 10 ch"; + +VAR + a30: ARRAY 30 OF CHAR; + + a10: ARRAY 10 OF CHAR; + a20: ARRAY 20 OF CHAR; + + buf: ARRAY 64 OF CHAR; + + +BEGIN + a30 := teststring; Console.String("a30: "); Console.String(a30); Console.Ln; + COPY(a30, a20); Console.String("a20: "); Console.String(a20); Console.Ln; + Console.Ln; + COPY(a30, a10); Console.String("a10: "); Console.String(a10); Console.Ln; + Console.String("a20: "); Console.String(a20); Console.Ln; + Console.Ln; + a10 := a30; Console.String("a10: "); Console.String(a10); Console.Ln; + Console.String("a20: "); Console.String(a20); Console.Ln; + Console.Ln; + Console.String("Array assignment test complete."); Console.Ln; +END aa. diff --git a/src/test/confidence/arrayassignment/expected b/src/test/confidence/arrayassignment/expected new file mode 100644 index 00000000..7ca85cf2 --- /dev/null +++ b/src/test/confidence/arrayassignment/expected @@ -0,0 +1,10 @@ +a30: 1st 10 ch 2nd 10 ch 3rd 10 ch +a20: 1st 10 ch 2nd 10 ch + +a10: 1st 10 ch +a20: 1st 10 ch 2nd 10 ch + +a10: 1st 10 ch +a20: 1st 10 ch 2nd 10 ch + +Array assignment test complete. diff --git a/src/test/confidence/arrayassignment/result b/src/test/confidence/arrayassignment/result new file mode 100644 index 00000000..7ca85cf2 --- /dev/null +++ b/src/test/confidence/arrayassignment/result @@ -0,0 +1,10 @@ +a30: 1st 10 ch 2nd 10 ch 3rd 10 ch +a20: 1st 10 ch 2nd 10 ch + +a10: 1st 10 ch +a20: 1st 10 ch 2nd 10 ch + +a10: 1st 10 ch +a20: 1st 10 ch 2nd 10 ch + +Array assignment test complete. diff --git a/src/test/confidence/arrayassignment/test.sh b/src/test/confidence/arrayassignment/test.sh new file mode 100755 index 00000000..b4cb1ee8 --- /dev/null +++ b/src/test/confidence/arrayassignment/test.sh @@ -0,0 +1,4 @@ +. ../testenv.sh +voc aa.mod -m +./aa >result +. ../testresult.sh diff --git a/src/test/confidence/hello/expected b/src/test/confidence/hello/expected new file mode 100644 index 00000000..18832d35 --- /dev/null +++ b/src/test/confidence/hello/expected @@ -0,0 +1 @@ +Hello. diff --git a/src/test/confidence/hello/hello.mod b/src/test/confidence/hello/hello.mod new file mode 100644 index 00000000..c87380ff --- /dev/null +++ b/src/test/confidence/hello/hello.mod @@ -0,0 +1,6 @@ +MODULE hello; +IMPORT Console; + +BEGIN + Console.String("Hello."); Console.Ln; +END hello. diff --git a/src/test/confidence/hello/result b/src/test/confidence/hello/result new file mode 100644 index 00000000..18832d35 --- /dev/null +++ b/src/test/confidence/hello/result @@ -0,0 +1 @@ +Hello. diff --git a/src/test/confidence/hello/test.sh b/src/test/confidence/hello/test.sh new file mode 100755 index 00000000..b3098d72 --- /dev/null +++ b/src/test/confidence/hello/test.sh @@ -0,0 +1,4 @@ +. ../testenv.sh +voc hello.mod -m +./hello >result +. ../testresult.sh diff --git a/src/test/confidence/lola/LSB.Mod b/src/test/confidence/lola/LSB.Mod new file mode 100755 index 00000000..7bebf6d4 --- /dev/null +++ b/src/test/confidence/lola/LSB.Mod @@ -0,0 +1,52 @@ +MODULE LSB; (*Lola System Compiler Base LSBX, 26.9.2015*) + IMPORT Texts, Oberon; + + CONST + bit* = 0; array* = 1; unit* = 2; (*type forms*) + + (*tags in output*) const* = 1; typ* = 2; var* = 3; lit* = 4; sel* = 7; range* = 8; cons* = 9; + repl* = 10; not* = 11; and* = 12; mul* = 13; div* = 14; or* = 15; xor* = 16; add* = 17; sub* = 18; + eql* = 20; neq* = 21; lss* = 22; geq* = 23; leq* = 24; gtr* = 25; + then* = 30; else* = 31; ts* = 32; next* = 33; + + TYPE + Item* = POINTER TO ItemDesc; + Object* = POINTER TO ObjDesc; + Type* = POINTER TO TypeDesc; + ArrayType* = POINTER TO ArrayTypeDesc; + UnitType* = POINTER TO UnitTypeDesc; + + ItemDesc* = RECORD + tag*: INTEGER; + type*: Type; + val*, size*: LONGINT; + a*, b*: Item + END ; + + ObjDesc* = RECORD (ItemDesc) + next*: Object; + name*: ARRAY 32 OF CHAR; + marked*: BOOLEAN + END ; + + TypeDesc* = RECORD len*, size*: LONGINT; typobj*: Object END ; + ArrayTypeDesc* = RECORD (TypeDesc) eltyp*: Type END ; + UnitTypeDesc* = RECORD (TypeDesc) firstobj*: Object END ; + + VAR root*, top*: Object; + bitType*, integer*, string*: Type; + byteType*, wordType*: ArrayType; + modname*: ARRAY 32 OF CHAR; + + PROCEDURE Register*(name: ARRAY OF CHAR; list: Object); + BEGIN (*modname := name*) COPY(name, modname); top := list + END Register; + +BEGIN NEW(bitType); bitType.len := 0; bitType.size := 1; NEW(integer); NEW(string); + NEW(byteType); byteType.len := 8; byteType.size := 8; byteType.eltyp := bitType; + NEW(wordType); wordType.len := 32; wordType.size := 32; wordType.eltyp := bitType; + NEW(root); root.tag := typ; root.name := "WORD"; root.type := wordType; root.next := NIL; + NEW(top); top.tag := typ; top.name := "BYTE"; top.type := byteType; top.next := root; root := top; + NEW(top); top.tag := typ; top.name := "BIT"; top.type := bitType; top.next := root; root := top +END LSB. + diff --git a/src/test/confidence/lola/LSB.h b/src/test/confidence/lola/LSB.h new file mode 100644 index 00000000..86a5f7ce --- /dev/null +++ b/src/test/confidence/lola/LSB.h @@ -0,0 +1,79 @@ +/* voc 1.2 [2016/06/16] for gcc LP64 on cygwin xtpka */ + +#ifndef LSB__h +#define LSB__h + +#define LARGE +#include "SYSTEM.h" + +typedef + struct LSB_ArrayTypeDesc *LSB_ArrayType; + +typedef + struct LSB_ObjDesc *LSB_Object; + +typedef + struct LSB_TypeDesc { + LONGINT len, size; + LSB_Object typobj; + } LSB_TypeDesc; + +typedef + LSB_TypeDesc *LSB_Type; + +typedef + struct LSB_ArrayTypeDesc { /* LSB_TypeDesc */ + LONGINT len, size; + LSB_Object typobj; + LSB_Type eltyp; + } LSB_ArrayTypeDesc; + +typedef + struct LSB_ItemDesc *LSB_Item; + +typedef + struct LSB_ItemDesc { + INTEGER tag; + LSB_Type type; + LONGINT val, size; + LSB_Item a, b; + } LSB_ItemDesc; + +typedef + struct LSB_ObjDesc { /* LSB_ItemDesc */ + INTEGER tag; + LSB_Type type; + LONGINT val, size; + LSB_Item a, b; + LSB_Object next; + CHAR name[32]; + BOOLEAN marked; + } LSB_ObjDesc; + +typedef + struct LSB_UnitTypeDesc *LSB_UnitType; + +typedef + struct LSB_UnitTypeDesc { /* LSB_TypeDesc */ + LONGINT len, size; + LSB_Object typobj; + LSB_Object firstobj; + } LSB_UnitTypeDesc; + + +import LSB_Object LSB_root, LSB_top; +import LSB_Type LSB_bitType, LSB_integer, LSB_string; +import LSB_ArrayType LSB_byteType, LSB_wordType; +import CHAR LSB_modname[32]; + +import LONGINT *LSB_ItemDesc__typ; +import LONGINT *LSB_ObjDesc__typ; +import LONGINT *LSB_TypeDesc__typ; +import LONGINT *LSB_ArrayTypeDesc__typ; +import LONGINT *LSB_UnitTypeDesc__typ; + +import void LSB_Register (CHAR *name, LONGINT name__len, LSB_Object list); +import void *LSB__init(void); + + +#endif diff --git a/src/test/confidence/lola/LSC.Mod b/src/test/confidence/lola/LSC.Mod new file mode 100755 index 00000000..4488d47f --- /dev/null +++ b/src/test/confidence/lola/LSC.Mod @@ -0,0 +1,536 @@ +MODULE LSC; (*Lola System Compiler, NW 8.1.95 / 26.9.2015 for RISC (LSCX)*) + IMPORT Texts, Oberon, LSB, LSS; + + VAR sym: INTEGER; + err: BOOLEAN; (*used at end of Unit*) + top, bot, undef: LSB.Object; + factor: PROCEDURE (VAR x: LSB.Item); (*to avoid forward references*) + expression: PROCEDURE (VAR x: LSB.Item); + Unit: PROCEDURE (VAR locals: LSB.Object); + W: Texts.Writer; + + PROCEDURE Err(n: INTEGER); + BEGIN LSS.Mark("type error"); Texts.WriteInt(W, n, 4); + Texts.WriteLn(W); Texts.Append(Oberon.Log, W.buf) + END Err; + + PROCEDURE Log(m: LONGINT): LONGINT; + VAR n: LONGINT; + BEGIN n := 1; + WHILE m > 1 DO m := m DIV 2; INC(n) END ; + RETURN n + END Log; + + PROCEDURE New(tag: INTEGER; a, b: LSB.Item): LSB.Item; + VAR z: LSB.Item; + BEGIN NEW(z); z.tag := tag; z.a := a; z.b := b; z.val := b.val; RETURN z + END New; + + PROCEDURE NewObj(class: INTEGER): LSB.Object; (*insert at end, before BIT*) + VAR new, x: LSB.Object; + BEGIN x := top; + WHILE (x.next # bot) & (x.next.name # LSS.id) DO x := x.next END ; + IF x.next = bot THEN + NEW(new); new.name := LSS.id; new.tag := class; new.next := bot; x.next := new + ELSE LSS.Mark("mult def"); new := x + END ; + RETURN new + END NewObj; + + PROCEDURE ThisObj(id: LSS.Ident): LSB.Object; (*find object with name = identifier last read*) + VAR x: LSB.Object; + BEGIN x := top.next; + WHILE (x # NIL) & (x.name # id) DO x := x.next END ; + IF x = NIL THEN LSS.Mark("undef"); x := undef END ; + RETURN x + END ThisObj; + + PROCEDURE CheckTypes(x, y, z: LSB.Item); (*z.type = result type*) + VAR xtyp, ytyp: LSB.Type; + BEGIN xtyp := x.type; ytyp := y.type; z.type := xtyp; z.size := x.size; z.val := x.val; + IF xtyp = LSB.bitType THEN z.type := xtyp; + IF ytyp = LSB.integer THEN (* b + 0 *) + IF y.val >= 2 THEN Err(20); LSS.Mark("only 0 or 1") END + ELSIF ytyp = LSB.string THEN (* b + {...} *) Err(21) + ELSIF ytyp # LSB.bitType THEN Err(22) + END + ELSIF xtyp IS LSB.ArrayType THEN + IF xtyp(LSB.ArrayType).eltyp = LSB.bitType THEN + IF (ytyp IS LSB.ArrayType) & (xtyp(LSB.ArrayType).eltyp = LSB.bitType) THEN + IF xtyp.size # ytyp.size THEN Err(33) END (* x + y *) + ELSIF ytyp = LSB.integer THEN (* w + 5 *) + IF xtyp.size < Log(y.val) THEN Err(30) END + ELSIF ytyp = LSB.string THEN (*x + {...} *) + IF xtyp.size # y.size THEN Err(31) END + ELSIF ytyp # LSB.bitType THEN Err(34) + END + ELSIF (ytyp IS LSB.ArrayType) & (xtyp(LSB.ArrayType).eltyp = ytyp(LSB.ArrayType).eltyp) THEN + IF (xtyp.size # ytyp.size) THEN Err(40) END + ELSE Err(41) + END + ELSIF xtyp = LSB.string THEN + IF ytyp = LSB.bitType THEN (* {...} + b *) Err(12) + ELSIF (ytyp IS LSB.ArrayType) & (ytyp(LSB.ArrayType).eltyp = LSB.bitType) THEN (* {...} + w *) + IF x.size # ytyp.size THEN Err(13) END + ELSIF ytyp = LSB.integer THEN (* {...} + 5*) + IF x.size < Log(y.val) THEN Err(10) END + ELSIF ytyp = LSB.string THEN (* {...} + {...} *) + IF x.size # y.size THEN Err(11) END ; + ELSE Err(14) + END + ELSIF xtyp = LSB.integer THEN + IF (ytyp IS LSB.ArrayType) & (ytyp(LSB.ArrayType).eltyp = LSB.bitType) THEN (* 5 + w *) + IF Log(x.val) > ytyp.size THEN Err(3); LSS.Mark("const too large") END + ELSIF ytyp = LSB.bitType THEN (* 5 + b *) + IF x.val >= 2 THEN Err(2) END + ELSIF ytyp = LSB.integer THEN (* 5 + 5 *) + ELSIF ytyp = LSB.string THEN (* 5 + {...} *) + IF Log(x.val) > y.size THEN Err(12) END + ELSE Err(4) + END + END + END CheckTypes; + + PROCEDURE selector(VAR x: LSB.Item); + VAR y, z: LSB.Item; obj: LSB.Object; + eltyp: LSB.Type; len, kind: LONGINT; + BEGIN + WHILE (sym = LSS.lbrak) OR (sym = LSS.period) DO + IF sym = LSS.lbrak THEN + eltyp := x.type(LSB.ArrayType).eltyp; LSS.Get(sym); expression(y); + IF sym = LSS.colon THEN (*range*) + LSS.Get(sym); expression(z); + IF (y.tag = LSB.lit) & (z.tag = LSB.lit) THEN + len := y.val - z.val + 1; y := New(LSB.range, y, z); x := New(LSB.sel, x, y); x.type := LSB.string; x.size := len + END + ELSE kind := x.val; x := New(LSB.sel, x, y); x.type := eltyp; x.val := kind + END ; + IF sym = LSS.rbrak THEN LSS.Get(sym) ELSE LSS.Mark("rbrak ?") END + ELSE (*sym = LSS.period*) LSS.Get(sym); factor(y); + IF (y.tag = LSB.lit) & (y.val >= x.type.len) THEN LSS.Mark("too large") END ; + eltyp := x.type(LSB.ArrayType).eltyp; kind := x.val; x := New(LSB.sel, x, y); x.type := eltyp; x.val := kind + END + END + END selector; + + PROCEDURE elem(VAR x: LSB.Item; VAR len: LONGINT); + VAR y, z: LSB.Item; m, n: LONGINT; + BEGIN expression(x); + IF (x.type = LSB.integer) OR (x.type = LSB.string) THEN m := x.size ELSE m := x.type.size END ; + IF sym = LSS.repl THEN + LSS.Get(sym); + IF sym = LSS.integer THEN + NEW(y); y.tag := LSB.lit; n := LSS.val; y.val := n; y.type := LSB.integer; LSS.Get(sym); + x := New(LSB.repl, x, y) + END + ELSE n := 1 + END ; + len := m*n + END elem; + + PROCEDURE constructor(VAR x: LSB.Item); + VAR y: LSB.Item; n, len: LONGINT; + BEGIN elem(x, len); + WHILE sym = LSS.comma DO + LSS.Get(sym); elem(y, n); INC(len, n); x := New(LSB.cons, x, y); x.val := len + END ; + x.size := len; x.type := LSB.string; + IF sym = LSS.rbrace THEN LSS.Get(sym) ELSE LSS.Mark("rbrace ?") END + END constructor; + + PROCEDURE factor0(VAR x: LSB.Item); + VAR obj: LSB.Object; y, z: LSB.Item; + n, len: LONGINT; t: LSB.ArrayType; + BEGIN + IF sym = LSS.ident THEN + x := ThisObj(LSS.id); LSS.Get(sym); + IF x.tag = LSB.var THEN selector(x) + ELSIF x.tag = LSB.const THEN n := x.b.val; NEW(x); x.tag := LSB.lit; x.val := n; x.type := LSB.integer + ELSE LSS.Mark("bad factor") + END + ELSIF sym = LSS.lparen THEN + LSS.Get(sym); expression(x); + IF sym = LSS.rparen THEN LSS.Get(sym) ELSE LSS.Mark("rparen ?") END + ELSIF sym = LSS.integer THEN + NEW(x); x.tag := LSB.lit; x.val := LSS.val; x.type := LSB.integer; LSS.Get(sym); + IF sym = LSS.apo THEN LSS.Get(sym); + IF sym = LSS.integer THEN + len := LSS.val; LSS.Get(sym); + IF len < Log(x.val) THEN LSS.Mark("value too large") END + ELSE LSS.Mark("integer ?"); len := 0 + END ; + x.size := len + ELSE len := 0 + END ; + x.size := len + ELSIF sym = LSS.not THEN + LSS.Get(sym); factor(x); y := New(LSB.not, NIL, x); y.type := x.type; y.size := x.size; x := y + ELSIF sym = LSS.lbrace THEN LSS.Get(sym); constructor(x) + ELSE LSS.Mark("bad factor") + END + END factor0; + + PROCEDURE term(VAR x: LSB.Item); + VAR y, z: LSB.Item; op: INTEGER; + BEGIN factor(x); + WHILE (sym >= LSS.times) & (sym <= LSS.and) DO + IF sym = LSS.and THEN op := LSB.and + ELSIF sym = LSS.times THEN op := LSB.mul + ELSIF sym = LSS.div THEN op := LSB.div + END ; + LSS.Get(sym); factor(y); z := New(op, x, y); CheckTypes(x, y, z); x := z + END + END term; + + PROCEDURE SimpleExpression(VAR x: LSB.Item); + VAR y, z: LSB.Item; op: INTEGER; + BEGIN + IF sym = LSS.minus THEN LSS.Get(sym); term(y); + IF y.tag = LSB.lit THEN x := y; x.val := -y.val + ELSE x := New(LSB.sub, NIL, y); x.type := y.type; x.size := y.size + END + ELSIF sym = LSS.plus THEN LSS.Get(sym); term(x); + ELSE term(x) + END ; + WHILE (sym >= LSS.plus) & (sym <= LSS.xor) DO + IF sym = LSS.or THEN op := LSB.or + ELSIF sym = LSS.xor THEN op := LSB.xor + ELSIF sym = LSS.plus THEN op := LSB.add + ELSIF sym = LSS.minus THEN op := LSB.sub + END ; + LSS.Get(sym); term(y); z := New(op, x, y); CheckTypes(x, y, z); x := z + END + END SimpleExpression; + + PROCEDURE UncondExpression(VAR x: LSB.Item); + VAR y, z: LSB.Item; rel: INTEGER; + BEGIN SimpleExpression(x); + IF (sym >= LSS.eql) & (sym <= LSS.geq) THEN + IF sym = LSS.eql THEN rel := LSB.eql + ELSIF sym = LSS.neq THEN rel := LSB.neq + ELSIF sym = LSS.lss THEN rel := LSB.lss + ELSIF sym = LSS.geq THEN rel := LSB.geq + ELSIF sym = LSS.leq THEN rel := LSB.leq + ELSE rel := LSB.gtr + END ; + LSS.Get(sym); SimpleExpression(y); z := New(rel, x, y); CheckTypes(x, y, z); z.type := LSB.bitType; x := z + END + END UncondExpression; + + PROCEDURE expression0(VAR x: LSB.Item); + VAR y, z, w: LSB.Item; + BEGIN UncondExpression(x); + IF sym = LSS.then THEN + IF x.type # LSB.bitType THEN LSS.Mark("Boolean?") END ; + LSS.Get(sym); expression(y); + IF sym = LSS.colon THEN + LSS.Get(sym); expression(z); w := New(LSB.else, y, z); CheckTypes(y, z, w); + x := New(LSB.then, x, w); x.type := w.type; x.size := w.size + ELSE LSS.Mark("colon ?") + END + END + END expression0; + + PROCEDURE CheckAssign(x, y: LSB.Item); + VAR xtyp, ytyp: LSB.Type; + BEGIN xtyp := x.type; ytyp := y.type; + IF xtyp # ytyp THEN + IF xtyp = LSB.bitType THEN + IF (ytyp # LSB.integer) OR (y.val >= 2) THEN Err(70); END + ELSIF xtyp IS LSB.ArrayType THEN + IF xtyp(LSB.ArrayType).eltyp = LSB.bitType THEN + IF (ytyp IS LSB.ArrayType) & (xtyp(LSB.ArrayType).eltyp = LSB.bitType) THEN (*w := w*) + IF xtyp.size # ytyp.size THEN Err(71) END (* x + y *) + ELSIF ytyp = LSB.integer THEN (* w := 5 *) + IF xtyp.size < Log(y.val) THEN Err(72) END + ELSIF ytyp = LSB.string THEN (* w := {...} *) + IF xtyp.size # y.size THEN Err(73) END + ELSE Err(74) + END + ELSE Err(74) + END + END + END + END CheckAssign; + + PROCEDURE Param(fpar: LSB.Object; VAR apar: LSB.Item); + VAR y, z: LSB.Item; + BEGIN expression(y); apar := New(LSB.next, NIL, y); CheckAssign(fpar, y); + IF fpar.val IN {3, 4} THEN (*OUT or INOUT parameter*) + IF ~(y.tag IN {3, 7}) THEN (*actual param is expression?*) LSS.Mark("bad actual param") + ELSIF y.b = NIL THEN y.b := undef + END + END + END Param; + + PROCEDURE Statement; + VAR w, x, y, z, apar, npar: LSB.Item; + unit: LSB.UnitType; fpar: LSB.Object; + BEGIN + IF sym < LSS.ident THEN LSS.Mark("bad factor"); + REPEAT LSS.Get(sym) UNTIL sym >= LSS.ident + END ; + IF sym = LSS.ident THEN + x := ThisObj(LSS.id); z := x; LSS.Get(sym); selector(z); + IF sym = LSS.becomes THEN LSS.Get(sym); + IF x.val >= 5 THEN LSS.Mark("assignment to read-only") END ; + IF (x.b # NIL) & ~(x.type IS LSB.ArrayType) THEN LSS.Mark("mult assign") END ; + expression(y); CheckAssign(z, y); x.b := y; (*tricky*) + IF z # x THEN x.a := z.b; x.val := 1 (*overwriting clk field x.a *) END + ELSIF sym = LSS.lparen THEN LSS.Get(sym); (*unit instantiation*) + IF x.type IS LSB.UnitType THEN + unit := x.type(LSB.UnitType); fpar := unit.firstobj; + IF sym # LSS.rparen THEN + Param(fpar, apar); x.b := apar; fpar := fpar.next; + WHILE sym # LSS.rparen DO + IF sym = LSS.comma THEN LSS.Get(sym) END ; + Param(fpar, npar); + IF fpar.tag >= 3 THEN fpar := fpar.next; apar.a := npar; apar := npar + ELSE LSS.Mark("too many params") + END + END ; + IF fpar.val >= 3 THEN LSS.Mark("too few params") END + END ; + IF sym = LSS.rparen THEN LSS.Get(sym) ELSE LSS.Mark("rparen ?") END + ELSE LSS.Mark("not a module") + END + ELSE LSS.Mark("bad statement") + END + ELSIF sym = LSS.ts THEN (*tri-state*) LSS.Get(sym); + IF sym = LSS.lparen THEN LSS.Get(sym) ELSE LSS.Mark("( missing") END ; + IF sym = LSS.ident THEN + x := ThisObj(LSS.id); x.b := undef; (*INOUT parameter*) + IF x.val # 5 THEN LSS.Mark("not INOUT") END ; + LSS.Get(sym); + IF sym = LSS.comma THEN LSS.Get(sym) END ; + IF sym = LSS.ident THEN y := ThisObj(LSS.id); CheckAssign(x, y); y.b := undef END ; (*output from gate*) + LSS.Get(sym); + IF sym = LSS.comma THEN LSS.Get(sym) END ; + expression(z); + IF (z.tag = LSB.lit) & (z.val <= 1) THEN z.type := LSB.bitType END ; + CheckAssign(x, z); LSS.Get(sym); + IF sym = LSS.comma THEN LSS.Get(sym) END ; + expression(w); (*control*) + IF w.type # LSB.bitType THEN CheckAssign(x, w) END ; + w := New(LSB.next, z, w); x.b := New(LSB.ts, y, w); + IF sym = LSS.rparen THEN LSS.Get(sym) ELSE LSS.Mark(") missing") END + END + END + END Statement; + + PROCEDURE StatSequence; + BEGIN Statement; + WHILE sym <= LSS.semicolon DO + IF sym < LSS.semicolon THEN LSS.Mark("semicolon missing?") END ; + WHILE sym = LSS.semicolon DO LSS.Get(sym) END ; + Statement + END ; + IF sym = LSS.end THEN LSS.Get(sym) ELSE LSS.Mark("END ?") END + END StatSequence; + + (*---------------------------------------------------*) + + (* for variables and registers,, obj.val has the meaning + 0 register + 1 register with imlicit clock "clk" + 2 variable + 3 output parameter + 4 output parameter with register + 5 inout parameter + 6 input parameter *) + + PROCEDURE ConstDeclaration; + VAR obj: LSB.Object; + BEGIN + IF sym = LSS.ident THEN + obj := NewObj(LSB.const); LSS.Get(sym); + IF (sym = LSS.becomes) OR (sym = LSS.eql) THEN LSS.Get(sym) ELSE LSS.Mark(":= ?") END ; + expression(obj.b); obj.type := LSB.integer; + IF sym = LSS.semicolon THEN LSS.Get(sym) ELSE LSS.Mark("semicolon ?") END + ELSE LSS.Mark("ident ?") + END + END ConstDeclaration; + + PROCEDURE Type0(VAR type: LSB.Type); + VAR obj: LSB.Object; len, size: LONGINT; + eltyp: LSB.Type; arrtyp: LSB.ArrayType; + BEGIN len := 1; + IF sym = LSS.lbrak THEN (*array*) LSS.Get(sym); + IF sym = LSS.integer THEN len := LSS.val; LSS.Get(sym) + ELSIF sym = LSS.ident THEN obj := ThisObj(LSS.id); len := obj.val + END ; + IF sym = LSS.rbrak THEN LSS.Get(sym) ELSE LSS.Mark("rbrak ?") END ; + Type0(eltyp); NEW(arrtyp); size := eltyp.size * len; + arrtyp.eltyp := eltyp; type := arrtyp; type.len := len; type.size := size + ELSIF sym = LSS.ident THEN + obj := ThisObj(LSS.id); LSS.Get(sym); + IF obj # NIL THEN + IF obj.tag = LSB.typ THEN type := obj.type ELSE LSS.Mark("not a type"); type := LSB.bitType END + ELSE LSS.Mark("type ?") + END + ELSE type := LSB.bitType; LSS.Mark("ident or [") + END + END Type0; + + PROCEDURE TypeDeclaration; + VAR obj: LSB.Object; utyp: LSB.UnitType; + BEGIN + IF sym = LSS.ident THEN + obj := NewObj(LSB.typ); LSS.Get(sym); + IF (sym = LSS.becomes) OR (sym = LSS.eql) THEN LSS.Get(sym) ELSE LSS.Mark(":= ?") END ; + IF sym = LSS.module THEN + LSS.Get(sym); NEW(utyp); Unit(utyp.firstobj); obj.type := utyp; obj.type.typobj := obj + ELSE Type0(obj.type) + END ; + IF sym = LSS.semicolon THEN LSS.Get(sym) ELSE LSS.Mark("semicolon ?") END + ELSE LSS.Mark("ident ?") + END + END TypeDeclaration; + + PROCEDURE VarList(kind: INTEGER; clk: LSB.Item); + VAR first, new, obj: LSB.Object; type: LSB.Type; + BEGIN obj := NIL; + WHILE sym = LSS.ident DO + new := NewObj(LSB.var); new.name := LSS.id; new.val := kind; first := new; LSS.Get(sym); + IF sym = LSS.comma THEN LSS.Get(sym) ELSIF sym = LSS.ident THEN LSS.Mark("comma missing") END ; + WHILE sym = LSS.ident DO + new := NewObj(LSB.var); new.name := LSS.id; new.val := kind; LSS.Get(sym); + IF sym = LSS.comma THEN LSS.Get(sym) ELSIF sym = LSS.ident THEN LSS.Mark("comma missing") END + END ; + IF sym = LSS.colon THEN + LSS.Get(sym); Type0(type); obj := first; + WHILE obj # bot DO obj.type := type; obj.a := clk; obj := obj.next END + ELSE LSS.Mark("colon ?") + END ; + IF sym = LSS.semicolon THEN LSS.Get(sym) + ELSIF sym # LSS.rparen THEN LSS.Mark("semicolon or rparen missing") + END + END + END VarList; + + PROCEDURE ParamList; + VAR kind: INTEGER; + BEGIN + IF sym = LSS.in THEN LSS.Get(sym); kind := 6 + ELSIF sym = LSS.out THEN LSS.Get(sym); + IF sym = LSS.reg THEN LSS.Get(sym); kind := 4 ELSE kind := 3 END + ELSIF sym = LSS.inout THEN LSS.Get(sym); kind := 5 + END ; + VarList(kind, NIL) + END ParamList; + + PROCEDURE Traverse(x: LSB.Item); + BEGIN + IF x # NIL THEN + IF x IS LSB.Object THEN + IF (x.tag = LSB.var) & (x.val >= 2) THEN (*not reg*) + IF x(LSB.Object).marked THEN (*loop*) + Texts.WriteString(W, x(LSB.Object).name); Texts.Write(W, " "); err := TRUE + ELSIF x.b # NIL THEN x(LSB.Object).marked := TRUE; Traverse(x.b) + END ; + x(LSB.Object).marked := FALSE + END + ELSE Traverse(x.a); Traverse(x.b) + END + END + END Traverse; + + PROCEDURE Unit0(VAR locals: LSB.Object); + VAR obj, oldtop: LSB.Object; kind: INTEGER; clock: LSB.Item; + BEGIN oldtop := top.next; top.next := LSB.root; (*top is dummy*) + IF sym = LSS.lparen THEN LSS.Get(sym) ELSE LSS.Mark("lparen ?") END ; + WHILE (sym = LSS.in) OR (sym = LSS.out) OR (sym = LSS.inout) DO ParamList END ; + IF sym = LSS.rparen THEN LSS.Get(sym) ELSE LSS.Mark("rparen ?") END ; + IF sym = LSS.xor (*arrow*) THEN LSS.Get(sym); locals := top.next + ELSE + IF sym = LSS.semicolon THEN LSS.Get(sym) ELSE LSS.Mark("semicolon ?") END ; + IF sym = LSS.const THEN LSS.Get(sym); + WHILE sym = LSS.ident DO ConstDeclaration END + END ; + IF sym = LSS.type THEN LSS.Get(sym); + WHILE sym = LSS.ident DO TypeDeclaration END + END ; + WHILE (sym = LSS.var) OR (sym = LSS.reg) DO + IF sym = LSS.var THEN LSS.Get(sym); + WHILE sym = LSS.ident DO VarList(2, NIL) END + ELSE (*reg*) kind := 0; LSS.Get(sym); + IF sym = LSS.lparen THEN (*clock*) + LSS.Get(sym); expression(clock); + IF clock.type # LSB.bitType THEN LSS.Mark("clock must be bitType") END ; + IF (clock IS LSB.Object) & (clock(LSB.Object).name = "clk") THEN kind := 1; clock := NIL END ; + IF sym = LSS.rparen THEN LSS.Get(sym) ELSE LSS.Mark("rparen ?") END + ELSE LSS.Mark("lparen expected"); clock := undef + END ; + WHILE sym = LSS.ident DO VarList(kind, clock) END + END + END ; + locals := top.next; + IF sym = LSS.begin THEN LSS.Get(sym); StatSequence END ; + obj := locals; err := FALSE; (*find unassigned variables*) + WHILE obj # LSB.root DO + IF (obj.tag = LSB.var) & (obj.val < 5) THEN + IF (obj.b = NIL) & (obj.val < 4) THEN Texts.WriteString(W, obj.name); Texts.Write(W, " "); err := TRUE + ELSIF obj.b = undef THEN obj.b := NIL + END + END ; + obj := obj.next + END ; + IF err THEN Texts.WriteString(W, " unassigned"); Texts.WriteLn(W) + ELSE obj := locals; err := FALSE; (*find combinatorial loops*) + WHILE obj # LSB.root DO + IF obj.tag = LSB.var THEN obj.marked := TRUE; Traverse(obj.b); obj.marked := FALSE END ; + obj := obj.next + END ; + IF err THEN Texts.WriteString(W, "in loop"); Texts.WriteLn(W) END + END + END ; + IF err THEN Texts.Append(Oberon.Log, W.buf) END ; + top.next := oldtop + END Unit0; + + PROCEDURE Module(T: Texts.Text; pos: LONGINT); + VAR root: LSB.Object; modname: ARRAY 32 OF CHAR; + BEGIN Texts.WriteString(W, "compiling Lola: "); + bot := LSB.root; top.next := bot; LSS.Init(T, pos); LSS.Get(sym); + IF sym = LSS.module THEN + LSS.Get(sym); + IF sym = LSS.ident THEN + modname := LSS.id; Texts.WriteString(W, LSS.id); LSS.Get(sym); + Texts.WriteLn(W); Texts.Append(Oberon.Log, W.buf); + ELSE LSS.Mark("ident ?") + END ; + Unit(root); + IF sym = LSS.ident THEN LSS.Get(sym); + IF LSS.id # modname THEN LSS.Mark("no match") END + END ; + IF sym # LSS.period THEN LSS.Mark("period ?") END ; + IF ~LSS.error THEN LSB.Register(modname, root) + ELSE Texts.WriteString(W, "compilation failed"); Texts.WriteLn(W); LSB.Register("", LSB.root) + END + ELSE LSS.Mark("module ?") + END ; + Texts.Append(Oberon.Log, W.buf) + END Module; + + PROCEDURE Compile*; + VAR beg, end, time: LONGINT; + S: Texts.Scanner; T: Texts.Text; + BEGIN Texts.OpenScanner(S, Oberon.Par.text, Oberon.Par.pos); Texts.Scan(S); + IF S.class = Texts.Char THEN + IF S.c = "*" THEN + ELSIF S.c = "@" THEN + Oberon.GetSelection(T, beg, end, time); + IF time >= 0 THEN Module(T, beg) END + END + ELSIF S.class = Texts.Name THEN + NEW(T); Texts.Open(T, S.s); Module(T, 0) + END ; + Oberon.Par.pos := Texts.Pos(S); + Texts.Append(Oberon.Log, W.buf) + END Compile; + +BEGIN Texts.OpenWriter(W); + Texts.WriteString(W, "Lola compiler; NW 6.7.2015"); Texts.WriteLn(W); + NEW(top); bot := LSB.root; NEW(undef); undef.tag := 2; undef.type := LSB.bitType; + Unit := Unit0; factor := factor0; expression := expression0; +END LSC. diff --git a/src/test/confidence/lola/LSC.h b/src/test/confidence/lola/LSC.h new file mode 100644 index 00000000..5eabfedd --- /dev/null +++ b/src/test/confidence/lola/LSC.h @@ -0,0 +1,16 @@ +/* voc 1.2 [2016/06/16] for gcc LP64 on cygwin xtpka */ + +#ifndef LSC__h +#define LSC__h + +#define LARGE +#include "SYSTEM.h" + + + + +import void LSC_Compile (void); +import void *LSC__init(void); + + +#endif diff --git a/src/test/confidence/lola/LSS.Mod b/src/test/confidence/lola/LSS.Mod new file mode 100755 index 00000000..a7e4cc46 --- /dev/null +++ b/src/test/confidence/lola/LSS.Mod @@ -0,0 +1,165 @@ +MODULE LSS; (* NW 16.10.93 / 1.9.2015*) + IMPORT Texts, Oberon; + + CONST IdLen* = 32; NofKeys = 11; + (*symbols*) null = 0; + arrow* = 1; times* = 2; div* = 3; and* = 4; plus* = 5; minus* = 6; or* = 7; xor* = 8; not* = 9; + eql* = 10; neq* = 11; lss* = 12; leq* = 13; gtr* = 14; geq* = 15; + at* = 16; apo* = 17; period* = 18; comma* = 19; colon* = 20; rparen* = 21; rbrak* = 22; rbrace* = 23; + then* = 24; lparen* = 26; lbrak* = 27; lbrace* = 28; repl* = 29; becomes* = 30; + ident* = 31; integer* = 32; ts* = 33; semicolon* = 40; end* = 41; + const* = 51; type* = 52; reg* = 53; var* = 54; out* = 55; inout* = 56; in* = 57; + begin* = 58; module* = 59; eof = 60; + + TYPE Ident* = ARRAY IdLen OF CHAR; + + VAR val*: LONGINT; + id*: Ident; + error*: BOOLEAN; + + ch: CHAR; + errpos: LONGINT; + R: Texts.Reader; + W: Texts.Writer; + key: ARRAY NofKeys OF Ident; + symno: ARRAY NofKeys OF INTEGER; + + PROCEDURE Mark*(msg: ARRAY OF CHAR); + VAR p: LONGINT; + BEGIN p := Texts.Pos(R); + IF p > errpos+2 THEN + Texts.WriteString(W, " pos "); Texts.WriteInt(W, p, 1); + Texts.WriteString(W, " err: "); Texts.WriteString(W, msg); + Texts.WriteLn(W); Texts.Append(Oberon.Log, W.buf) + END ; + errpos := p; error := TRUE + END Mark; + + PROCEDURE identifier(VAR sym: INTEGER); + VAR i: INTEGER; + BEGIN i := 0; + REPEAT + IF i < IdLen THEN id[i] := ch; INC(i) END ; + Texts.Read(R, ch) + UNTIL (ch < "0") OR (ch > "9") & (ch < "A") OR (ch > "Z") & (ch < "a") OR (ch > "z"); + IF ch = "'" THEN + IF i < IdLen THEN id[i] := ch; INC(i) END ; + Texts.Read(R, ch) + END ; + IF i = IdLen THEN Mark("ident too long"); id[IdLen-1] := 0X + ELSE id[i] := 0X + END ; + i := 0; + WHILE (i < NofKeys) & (id # key[i]) DO INC(i) END ; + IF i < NofKeys THEN sym := symno[i] ELSE sym := ident END + END identifier; + + PROCEDURE Number(VAR sym: INTEGER); + VAR i, k, h, n, d: LONGINT; + hex: BOOLEAN; + dig: ARRAY 16 OF LONGINT; + BEGIN sym := integer; i := 0; k := 0; n := 0; hex := FALSE; + REPEAT + IF n < 16 THEN d := ORD(ch)-30H; + IF d >= 10 THEN hex := TRUE ; d := d - 7 END ; + dig[n] := d; INC(n) + ELSE Mark("too many digits"); n := 0 + END ; + Texts.Read(R, ch) + UNTIL (ch < "0") OR (ch > "9") & (ch < "A") OR (ch > "F"); + IF ch = "H" THEN (*hex*) + REPEAT h := dig[i]; k := k*10H + h; INC(i) (*no overflow check*) + UNTIL i = n; + Texts.Read(R, ch) + ELSE + IF hex THEN Mark("illegal hex digit") END ; + REPEAT k := k*10 + dig[i]; INC(i) UNTIL i = n + END ; + val := k + END Number; + + PROCEDURE comment; + BEGIN Texts.Read(R, ch); + REPEAT + WHILE ~R.eot & (ch # "*") DO + IF ch = "(" THEN Texts.Read(R, ch); + IF ch = "*" THEN comment END + ELSE Texts.Read(R, ch) + END + END ; + WHILE ch = "*" DO Texts.Read(R, ch) END + UNTIL (ch = ")") OR R.eot; + IF ~R.eot THEN Texts.Read(R, ch) ELSE Mark("comment not terminated") END + END comment; + + PROCEDURE Get*(VAR sym: INTEGER); + BEGIN + REPEAT + WHILE ~R.eot & (ch <= " ") DO Texts.Read(R, ch) END; + IF R.eot THEN sym := eof + ELSIF ch < "A" THEN + IF ch < "0" THEN + IF ch = "!" THEN Texts.Read(R, ch); sym := repl + ELSIF ch = "#" THEN Texts.Read(R, ch); sym := neq + ELSIF ch = "$" THEN Texts.Read(R, ch); sym := null + ELSIF ch = "&" THEN Texts.Read(R, ch); sym := and + ELSIF ch = "'" THEN Texts.Read(R, ch); sym := apo + ELSIF ch = "(" THEN Texts.Read(R, ch); + IF ch = "*" THEN sym := null; comment ELSE sym := lparen END + ELSIF ch = ")" THEN Texts.Read(R, ch); sym := rparen + ELSIF ch = "*" THEN Texts.Read(R, ch); sym := times + ELSIF ch = "+" THEN Texts.Read(R, ch); sym := plus + ELSIF ch = "," THEN Texts.Read(R, ch); sym := comma + ELSIF ch = "-" THEN Texts.Read(R, ch); + IF ch = ">" THEN Texts.Read(R, ch); sym := then ELSE sym := minus END + ELSIF ch = "." THEN Texts.Read(R, ch); sym := period + ELSIF ch = "/" THEN Texts.Read(R, ch); sym := div + ELSE sym := null + END + ELSIF ch <= "9" THEN Number(sym) + ELSIF ch = ":" THEN Texts.Read(R, ch); + IF ch = "=" THEN Texts.Read(R, ch); sym := becomes ELSE sym := colon END + ELSIF ch = ";" THEN Texts.Read(R, ch); sym := semicolon + ELSIF ch = "<" THEN Texts.Read(R, ch); + IF ch = "=" THEN Texts.Read(R, ch); sym := leq ELSE sym := lss END + ELSIF ch = "=" THEN Texts.Read(R, ch); sym := eql + ELSIF ch = ">" THEN Texts.Read(R, ch); + IF ch = "=" THEN Texts.Read(R, ch); sym := geq ELSE sym := gtr END + ELSIF ch = "?" THEN Texts.Read(R, ch); sym := then + ELSIF ch = "@" THEN Texts.Read(R, ch); sym := at + ELSE sym := null + END + ELSIF ch <= "Z" THEN identifier(sym) + ELSIF ch < "a" THEN + IF ch = "[" THEN Texts.Read(R, ch); sym := lbrak + ELSIF ch = "]" THEN Texts.Read(R, ch); sym := rbrak + ELSIF ch = "^" THEN Texts.Read(R, ch); sym := xor + ELSE sym := null + END + ELSIF ch <= "z" THEN identifier(sym) + ELSIF ch <= "{" THEN Texts.Read(R, ch); sym := lbrace + ELSIF ch <= "|" THEN Texts.Read(R, ch); sym := or + ELSIF ch <= "}" THEN Texts.Read(R, ch); sym := rbrace + ELSIF ch <= "~" THEN Texts.Read(R, ch); sym := not + ELSE sym := null + END + UNTIL sym # null + END Get; + + PROCEDURE Init*(T: Texts.Text; pos: LONGINT); + BEGIN error := FALSE; errpos := pos; Texts.OpenReader(R, T, pos); Texts.Read(R, ch) + END Init; + +BEGIN Texts.OpenWriter(W); + key[ 0] := "BEGIN"; symno[0] := begin; + key[ 1] := "CONST"; symno[1] := const; + key[ 2] := "END"; symno[2] := end; + key[3] := "IN"; symno[3] := in; + key[4] := "INOUT"; symno[4] := inout; + key[5] := "MODULE"; symno[5] := module; + key[6] := "OUT"; symno[6] := out; + key[7] := "REG"; symno[7] := reg; + key[8] := "TYPE"; symno[8] := type; + key[9] := "VAR"; symno[9] := var; + key[10] := "TS"; symno[10] := ts +END LSS. diff --git a/src/test/confidence/lola/LSS.h b/src/test/confidence/lola/LSS.h new file mode 100644 index 00000000..a4e95780 --- /dev/null +++ b/src/test/confidence/lola/LSS.h @@ -0,0 +1,25 @@ +/* voc 1.2 [2016/06/16] for gcc LP64 on cygwin xtpka */ + +#ifndef LSS__h +#define LSS__h + +#define LARGE +#include "SYSTEM.h" +#include "Texts.h" + +typedef + CHAR LSS_Ident[32]; + + +import LONGINT LSS_val; +import LSS_Ident LSS_id; +import BOOLEAN LSS_error; + + +import void LSS_Get (INTEGER *sym); +import void LSS_Init (Texts_Text T, LONGINT pos); +import void LSS_Mark (CHAR *msg, LONGINT msg__len); +import void *LSS__init(void); + + +#endif diff --git a/src/test/confidence/lola/LSV.Mod b/src/test/confidence/lola/LSV.Mod new file mode 100755 index 00000000..35d45295 --- /dev/null +++ b/src/test/confidence/lola/LSV.Mod @@ -0,0 +1,238 @@ +MODULE LSV; (*Lola System: display Verilog; generate txt-File; NW 31.8.2015*) + IMPORT Files, Texts, Oberon, LSB; + + VAR W: Texts.Writer; + nofgen: INTEGER; + Constructor: PROCEDURE (VAR x: LSB.Item); (*to avoid forward reference*) + F: Files.File; R: Files.Rider; + C: ARRAY 64, 6 OF CHAR; + + PROCEDURE Write(ch: CHAR); + BEGIN Files.Write(R, ch) + END Write; + + PROCEDURE WriteLn; + BEGIN Files.Write(R, 0DX); Files.Write(R, 0AX) + END WriteLn; + + PROCEDURE WriteInt(x: LONGINT); (* x >= 0 *) + VAR i: INTEGER; d: ARRAY 14 OF LONGINT; + BEGIN i := 0; + IF x < 0 THEN Files.Write(R, "-"); x := -x END ; + REPEAT d[i] := x MOD 10; x := x DIV 10; INC(i) UNTIL x = 0; + REPEAT DEC(i); Files.Write(R, CHR(d[i] + 30H)) UNTIL i = 0 + END WriteInt; + + PROCEDURE WriteHex(x: LONGINT); (*x >= 0*) + VAR i: INTEGER; d: ARRAY 8 OF LONGINT; + BEGIN i := 0; + REPEAT d[i] := x MOD 10H; x := x DIV 10H; INC(i) UNTIL (x = 0) OR (i = 8); + REPEAT DEC(i); + IF d[i] >= 10 THEN Files.Write(R, CHR(d[i] + 37H)) ELSE Files.Write(R, CHR(d[i] + 30H)) END + UNTIL i = 0 + END WriteHex; + + PROCEDURE WriteString(s: ARRAY OF CHAR); + VAR i: INTEGER; + BEGIN i := 0; + WHILE s[i] # 0X DO Files.Write(R, s[i]); INC(i) END + END WriteString; + + (* ------------------------------- *) + + PROCEDURE Type(typ: LSB.Type); + VAR obj: LSB.Object; + BEGIN + IF typ IS LSB.ArrayType THEN + IF typ(LSB.ArrayType).eltyp # LSB.bitType THEN + Write("["); WriteInt(typ.len - 1); WriteString(":0]"); Type(typ(LSB.ArrayType).eltyp) + END + ELSIF typ IS LSB.UnitType THEN (* obj := typ(LSB.UnitType).firstobj; *) + END + END Type; + + PROCEDURE BitArrLen(typ: LSB.Type); + VAR eltyp: LSB.Type; + BEGIN + IF typ IS LSB.ArrayType THEN + eltyp := typ(LSB.ArrayType).eltyp; + WHILE eltyp IS LSB.ArrayType DO typ := eltyp; eltyp := typ(LSB.ArrayType).eltyp END ; + IF eltyp = LSB.bitType THEN + Write("["); WriteInt(typ.len - 1);WriteString(":0] ") + END + END + END BitArrLen; + + PROCEDURE Expression(x: LSB.Item); + VAR z: LSB.Item; + BEGIN + IF x # NIL THEN + IF x IS LSB.Object THEN WriteString(x(LSB.Object).name) + ELSIF x.tag = LSB.cons THEN + Write("{"); Constructor(x); Write("}") + ELSE + IF x.tag = LSB.repl THEN + Write("{"); WriteInt(x.b.val); Write("{"); Expression(x.a); + Write("}"); Write("}") + ELSE + IF (x.tag >= LSB.and) & (x.tag <= LSB.gtr) THEN Write("(") END ; + Expression(x.a); + IF x.tag = LSB.sel THEN Write("["); Expression(x.b); Write("]") + ELSIF x.tag = LSB.lit THEN + IF x.size # 0 THEN WriteInt(x.size); Write("'"); Write("h"); WriteHex(x.val) + ELSE WriteInt(x.val) + END + ELSE WriteString(C[x.tag]); Expression(x.b) + END ; + IF (x.tag >= LSB.and) & (x.tag <= LSB.gtr) THEN Write(")") END + END + END + END + END Expression; + + PROCEDURE Elem(VAR x: LSB.Item); + BEGIN + IF x.tag = LSB.repl THEN + Write("{"); WriteInt(x.b.val); Write("{"); Expression(x.a); WriteString("}}") + ELSE Expression(x) + END + END Elem; + + PROCEDURE Constructor0(VAR x: LSB.Item); + BEGIN + IF x.tag = LSB.cons THEN Constructor(x.a); WriteString(", "); Elem(x.b) ELSE Elem(x) END + END Constructor0; + + PROCEDURE Declaration(obj: LSB.Object); + VAR apar: LSB.Item; typ: LSB.Type; + BEGIN typ := obj.type; + IF obj.type IS LSB.UnitType THEN WriteString("unit ") ELSE Type(obj.type) END ; + IF obj.tag = LSB.var THEN + IF obj.type IS LSB.UnitType THEN + apar := obj.a; WriteLn; Write("["); + WHILE apar # NIL DO Expression(apar.b); apar := apar.a END ; + Write("]") + END + ELSIF obj.tag = LSB.const THEN WriteString(" = "); WriteInt(obj.val) + END + END Declaration; + + PROCEDURE ObjList0(obj: LSB.Object); (*declarations*) + VAR obj1: LSB.Object; param: BOOLEAN; + BEGIN param := TRUE; + WHILE obj # LSB.root DO + IF (obj.tag = LSB.var) & ~(obj.type IS LSB.UnitType) THEN + IF obj.val <= 1 THEN WriteString("reg ") + ELSIF obj.val = 2 THEN WriteString("wire ") + ELSIF obj.val = 3 THEN WriteString("output ") + ELSIF obj.val = 4 THEN WriteString("output reg ") + ELSIF obj.val = 5 THEN WriteString("inout ") + ELSIF obj.val = 6 THEN WriteString("input ") + ELSE WriteString("??? ") + END ; + BitArrLen(obj.type); WriteString(obj.name); + obj1 := obj.next; + WHILE (obj1 # LSB.top) & (obj1.type = obj.type) & (obj1.val = obj.val) DO + WriteString(", "); obj := obj1; WriteString(obj.name); obj1 := obj.next + END ; + IF param & (obj.val >= 3) & (obj1.val < 3) THEN (*end param list*) param := FALSE; Write(")") + END ; + IF (obj.type # LSB.bitType) & (obj.type(LSB.ArrayType).eltyp # LSB.bitType) THEN Type(obj.type) END ; + IF param THEN Write(",") ELSE Write(";") END ; + WriteLn + ELSIF obj.tag = LSB.const THEN + END ; + obj := obj.next + END + END ObjList0; + + PROCEDURE ActParam(VAR x: LSB.Item; fpar: LSB.Object); + BEGIN Write("."); WriteString(fpar.name); Write("("); Expression(x); Write(")") + END ActParam; + + PROCEDURE ObjList1(obj: LSB.Object); (*assignments to variables*) + VAR apar, x: LSB.Item; fpar: LSB.Object; size: LONGINT; + BEGIN + WHILE obj # LSB.root DO + IF (obj.tag = LSB.var) OR (obj.tag = LSB.const) THEN + IF obj.type IS LSB.UnitType THEN + WriteString(obj.type.typobj.name); Write(" "); WriteString(obj.name); + apar := obj.b; fpar := obj.type(LSB.UnitType).firstobj; + Write("("); ActParam(apar.b, fpar); apar := apar.a; fpar := fpar.next; (*actual param list*) + WHILE apar # NIL DO WriteString(", "); ActParam(apar.b, fpar); apar := apar.a; fpar := fpar.next END ; + Write(")"); Write(";"); WriteLn + ELSIF (obj.b # NIL) & (obj.val = 5) THEN (*tri-state*) + size := obj.type.size; x := obj.b; + IF x.tag = LSB.ts THEN + IF obj.type = LSB.bitType THEN + WriteString("IOBUF block"); INC(nofgen); WriteInt(nofgen); WriteString(" (.IO("); WriteString(obj.name); + WriteString("), .O("); WriteString(x.a(LSB.Object).name); WriteString("), .I("); x := x.b; + IF x.a.type = LSB.bitType THEN Expression(x.a) ELSE WriteString(x.a(LSB.Object).name) END ; + WriteString("), .T("); + IF x.b.type = LSB.bitType THEN Expression(x.b) ELSE WriteString(x.b(LSB.Object).name) END ; + WriteString("));") + ELSE (*array type*) + IF nofgen = 0 THEN WriteString("genvar i;"); WriteLn END ; + INC(nofgen); WriteString("generate"); WriteLn; + WriteString("for (i = 0; i < "); WriteInt(size); WriteString("; i = i+1) begin : bufblock"); WriteInt(nofgen); WriteLn; + WriteString("IOBUF block (.IO("); WriteString(obj.name); + WriteString("[i]), .O("); WriteString(x.a(LSB.Object).name); WriteString("[i]), .I("); x := x.b; + WriteString(x.a(LSB.Object).name); WriteString("[i]), .T("); + IF x.b.type = LSB.bitType THEN Expression(x.b) ELSE WriteString(x.b(LSB.Object).name); WriteString("[i]") END ; + WriteString("));"); WriteLn; WriteString("end"); WriteLn; WriteString("endgenerate") + END ; + WriteLn + END + ELSIF (obj.b # NIL) & (obj.val >= 2) THEN + WriteString("assign "); WriteString(obj.name); + IF (obj.a # NIL) THEN Write("["); Expression(obj.a); Write("]") END ; + WriteString(" = "); Expression(obj.b); Write(";"); WriteLn + END + ELSIF obj.tag = LSB.typ THEN (*instantiation; actual parameters*) + END ; + obj := obj.next + END + END ObjList1; + + PROCEDURE ObjList2(obj: LSB.Object); (*assignments to registers*) + VAR apar: LSB.Item; kind: LONGINT; clk: LSB.Item; + BEGIN + WHILE obj # LSB.root DO + IF (obj.tag = LSB.var) & ~(obj.type IS LSB.UnitType) & (obj.val < 2) THEN + WriteString("always @ (posedge "); kind := obj.val; + IF kind = 0 THEN Expression(obj.a) + ELSE (*kind = 1*) WriteString("clk") + END ; + WriteString(") begin "); + REPEAT WriteString(obj.name); + IF (kind = 1) & (obj.a # NIL) THEN Write("["); Expression(obj.a); Write("]") END ; + WriteString(" <= "); Expression(obj.b); Write(";"); WriteLn; obj := obj.next + UNTIL (obj = LSB.top) OR (obj.val # kind); + WriteString("end"); WriteLn + ELSE obj := obj.next + END + END + END ObjList2; + + PROCEDURE List*; + VAR S: Texts.Scanner; + BEGIN Texts.OpenScanner(S, Oberon.Par.text, Oberon.Par.pos); Texts.Scan(S); + IF (S.class = Texts.Name) OR (S.class = Texts.String) THEN + Texts.WriteString(W, LSB.modname); Texts.WriteString(W, " translating to "); Texts.WriteString(W, S.s); + F := Files.New(S.s); Files.Set(R, F, 0); + WriteString("`timescale 1ns / 1 ps"); WriteLn; nofgen := 0; + WriteString("module "); WriteString(LSB.modname); WriteString("( // translated from Lola"); WriteLn; + ObjList0(LSB.top); ObjList1(LSB.top); ObjList2(LSB.top); + WriteString("endmodule"); WriteLn; + Files.Register(F); Texts.WriteString(W, " done"); Texts.WriteLn(W); Texts.Append(Oberon.Log, W.buf) + END + END List; + +BEGIN Texts.OpenWriter(W); Constructor := Constructor0; + C[LSB.const] := "CONST"; C[LSB.typ] := "TYPE"; C[LSB.var] := "VAR"; + C[LSB.lit] := "LIT"; C[LSB.sel] := "SEL"; C[LSB.range] := ":"; C[LSB.cons] := ","; + C[LSB.or] := " | "; C[LSB.xor] := " ^ "; C[LSB.and] := " & "; C[LSB.not] := "~"; + C[LSB.add] := " + "; C[LSB.sub] := " - "; C[LSB.mul] := " * "; C[LSB.div] := " / "; + C[LSB.eql] := " == "; C[LSB.neq] := " != "; C[LSB.lss] := " < "; C[LSB.geq] := " >= "; C[LSB.leq] := " <= "; C[LSB.gtr] := " > "; + C[LSB.then] := " ? "; C[LSB.else] := " : "; C[LSB.ts] := "TS"; C[LSB.next] := "--" +END LSV. diff --git a/src/test/confidence/lola/LSV.h b/src/test/confidence/lola/LSV.h new file mode 100644 index 00000000..f5a8b2e6 --- /dev/null +++ b/src/test/confidence/lola/LSV.h @@ -0,0 +1,16 @@ +/* voc 1.2 [2016/06/16] for gcc LP64 on cygwin xtpka */ + +#ifndef LSV__h +#define LSV__h + +#define LARGE +#include "SYSTEM.h" + + + + +import void LSV_List (void); +import void *LSV__init(void); + + +#endif diff --git a/src/test/confidence/lola/RISC5.Lola b/src/test/confidence/lola/RISC5.Lola new file mode 100755 index 00000000..3a2980a0 --- /dev/null +++ b/src/test/confidence/lola/RISC5.Lola @@ -0,0 +1,214 @@ +MODULE RISC5 (IN clk, rst, stallX: BIT; (*NW 26.10.2015*) + IN inbus, codebus: WORD; + OUT adr: [24] BIT; + rd, wr, ben: BIT; + outbus: WORD); + + CONST StartAdr = 3FF800H'22; + + TYPE PROM := MODULE (IN clk: BIT; + IN adr: [9] BIT; + OUT data: WORD) ^; + + Multiplier := MODULE (IN clk, run, u: BIT; + OUT stall: BIT; + IN x, y: WORD; + OUT z: [64] BIT) ^; + + Divider := MODULE (IN clk, run, u: BIT; + OUT stall: BIT; + IN x, y: WORD; + OUT quot, rem: WORD) ^; + + FPAdder := MODULE (IN clk, run, u, v: BIT; OUT stall: BIT; + IN x, y: WORD; OUT z: WORD) ^; + + FPMultiplier := MODULE (IN clk, run: BIT; OUT stall: BIT; + IN x, y: WORD; OUT z: WORD) ^; + + FPDivider := MODULE (IN clk, run: BIT; OUT stall: BIT; + IN x, y: WORD; OUT z: WORD) ^; + + REG (clk) PC: [22] BIT; (*program counter*) + IR: WORD; (*instruction register*) + N, Z, C, OV: BIT; (*condition flags*) + stall1, PMsel: BIT; + R: [16] WORD; (*data registers*) + H: WORD; (*auxiliary register*) + + VAR PM: PROM; (*mem for boot loader*) + mulUnit: Multiplier; + divUnit: Divider; + faddUnit: FPAdder; + fmulUnit: FPMultiplier; + fdivUnit: FPDivider; + + pcmux, nxpc: [22] BIT; + cond, S: BIT; + sa, sb, sc: BIT; + + ins, pmout: WORD; + p, q, u, v, w: BIT; (*instruction fields*) + op, ira, ira0, irb, irc: [4] BIT; + cc: [3] BIT; + imm: [16] BIT; + off: [20] BIT; + offL: [24] BIT; + + regwr, stall, stallL, stallM, stallD, stallFA, stallFM, stallFD: BIT; + sc1, sc0: [2] BIT; (*shift counts*) + + a0, a1, a2, a3: BIT; + inbusL, outbusB0, outbusB1, outbusB2, outbusB3: BYTE; + inbusH: [24] BIT; + + A, B, C0, C1, aluRes, regmux: WORD; + s1, s2, s3, t1, t2, t3: WORD; (*shifting*) + quotient, remainder: WORD; + product: [64] BIT; + fsum, fprod, fquot: WORD; + + Add, Sub, Mul, Div: BIT; + Fadd, Fsub, Fmul, Fdiv: BIT; + Ldr, Str, Br: BIT; + +BEGIN PM(clk, pcmux[8:0], pmout); + mulUnit (clk, Mul, ~u, stallM, B, C1, product); + divUnit (clk, Div, ~u, stallD, B, C1, quotient, remainder); + faddUnit (clk, Fadd|Fsub, u, v, stallFA, B, {Fsub^C0.31, C0[30:0]}, fsum); + fmulUnit (clk, Fmul, stallFM, B, C0, fprod); + fdivUnit (clk, Fdiv, stallFD, B, C0, fquot); + + ins := PMsel -> pmout : IR; (*current instruction*) + p := ins.31; (*instruction fields*) + q := ins.30; + u := ins.29; + v := ins.28; + w := ins.16; + cc:= ins[26:24]; + ira := ins[27:24]; + irb := ins[23:20]; + op := ins[19:16]; + irc := ins[3:0]; + imm := ins[15:0]; (*reg instr*) + off := ins[19:0]; (*mem instr*) + offL := ins[23:0]; (*branch instr*) + + Add := ~p & (op = 8); + Sub := ~p & (op = 9); + Mul := ~p & (op = 10); + Div := ~p & (op = 11); + Fadd := ~p & (op = 12); + Fsub := ~p & (op = 13); + Fmul := ~p & (op = 14); + Fdiv := ~p & (op = 15); + Ldr := p & ~q & ~u; + Str := p & ~q & u; + Br := p & q; + + (*ALU*) + A := R[ira0]; (*main data path*) + B := R[irb]; + C0 := R[irc]; + C1 := q -> {v!16, imm} : C0 ; + ira0 := Br -> 15'4 : ira; + adr := stallL -> B[23:0] + {0'4, off} : {pcmux, 0'2}; + rd := Ldr & ~stallX & ~stall1; + wr := Str & ~stallX & ~stall1; + ben := p & ~q & v & ~stallX & ~stall1; (*byte enable*) + + sc0 := C1[1:0]; + sc1 := C1[3:2]; + + (*right shifter*) + s1 := (sc0 = 3) -> {(w -> B[2:0] : {B.31 ! 3}), B[31:3]} : + (sc0 = 2) -> {(w -> B[1:0] : {B.31 ! 2}), B[31:2]} : + (sc0 = 1) -> {(w -> B.0 : B.31), B[31:1]} : B; + s2 := (sc1 = 3) -> {(w -> s1[11:0] : {B.31 ! 12}), s1[31:12]} : + (sc1 = 2) -> {(w -> s1[7:0] : {B.31 ! 8}), s1[31:8]} : + (sc1 = 1) -> {(w -> s1[3:0] : {B.31 ! 4}), s1[31:4]} : s1; + s3 := C1.4 -> {(w -> s2[15:0] : {s2.31 ! 16}), s2[31:16]} : s2; + + (*left shifter*) + t1 := (sc0 = 3) -> {B[28:0], 0'3} : + (sc0 = 2) -> {B[29:0], 0'2} : + (sc0 = 1) -> {B[30:0], 0'1} : B; + t2 := (sc1 = 3) -> {t1[19:0], 0'12} : + (sc1 = 2) -> {t1[23:0], 0'8} : + (sc1 = 1) -> {t1[27:0], 0'4} : t1; + t3 := C1.4 -> {t2[15:0], 0'16} : t2; + + aluRes := + ~op.3 -> + (~op.2 -> + (~op.1 -> + (~op.0 -> (*Mov*) + (q -> + (~u -> {v!16 , imm} : {imm, 0'16}) : + (~u -> C0 : (~v -> H : {N, Z, C, OV, 0'20, 58H'8}))) : + t3 ): (*Lsl*) + s3) : (*Asr, Ror*) + (~op.1 -> + (~op.0 -> B & C1 : B & ~C1) : (*And, Ann*) + (~op.0 -> B | C1 : B ^ C1)) ): (*Ior, Xor*) + (~op.2 -> + (~op.1 -> + (~op.0 -> B + C + (u&C) : B - C1 - (u&C)) : (*Add, Sub*) + (~op.0 -> product[31:0] : quotient)) : (*Mul, Div*) + (~op.1 -> + fsum : (*Fad, Fsb*) + (~op.0 -> fprod : fquot))) ; (*Fml, Fdv*) + + regwr := ~p & ~stall | (Ldr & ~stallX & ~stall1) | (Br & cond & v & ~stallX); + a0 := ~adr.1 & ~adr.0; + a1 := ~adr.1 & adr.0; + a2 := adr.1 & ~adr.0; + a3 := adr.1 & adr.0; + inbusL := (~ben | a0) -> inbus[7:0] : a1 -> inbus[15:8] : a2 -> inbus[23:16] : inbus[31:24]; + inbusH := ~ben -> inbus[31:8] : 0'24; + regmux := Ldr -> {inbusH, inbusL} : (Br & v) -> {0'8, nxpc, 0'2} : aluRes ; + + outbusB0 := A[7:0]; + outbusB1 := ben & a1 -> A[7:0] : A[15:8]; + outbusB2 := ben & a2 -> A[7:0] : A[23:16]; + outbusB3 := ben & a3 -> A[7:0] : A[31:24]; + outbus := {outbusB3, outbusB2, outbusB1, outbusB0}; + + (*control unit*) + S := N ^ OV; + nxpc := PC + 1; + cond := ins.27 ^ ( + (cc = 0) & N | (*MI, PL*) + (cc = 1) & Z | (*EQ, NE*) + (cc = 2) & C | (*CS, CC*) + (cc = 3) & OV | (*VS, VC*) + (cc = 4) & (C|Z) | (*LS, HI*) + (cc = 5) & S | (*LT, GE*) + (cc = 6) & (S|Z) | (*LE, GT*) + (cc = 7)); + pcmux := ~rst -> 3FF800H'22 : + stall -> PC : + (Br & cond & u) -> offL[21:0] + nxpc : + (Br & cond & ~u) -> C0[23:2] : nxpc; + + sa := aluRes.31; + sb := B.31; + sc := C1.31; + + stall := stallL | stallM | stallD | stallFA | stallFM | stallFD | stallX; + stallL := (Ldr | Str) & ~stall1; + + (*assignments to registers*) + PC := pcmux; + PMsel := ~rst | (pcmux[21:12] = 03FFH'10); + IR := stall -> IR : codebus; + stall1 := stallX -> stall1 : stallL; + R[ira0] := regwr -> regmux : A; + N := regwr -> regmux.31 : N; + Z := regwr -> (regmux = 0) : Z; + C := Add -> (sb&sc) | (~sa&~sb&sc) | (~sa&sb&~sc&sa) : + Sub -> (~sb&sc) | (sa&~sb&~sc) | (sa&sb&sc) : C; + OV := Add -> (sa&~sb&~sc) | (~sa&sb&sc) : + Sub -> (sa&~sb&sc) | (~sa&sb&~sc) : OV; + H := Mul -> product[63:32] : Div -> remainder : H +END RISC5. diff --git a/src/test/confidence/lola/expected b/src/test/confidence/lola/expected new file mode 100644 index 00000000..4a6b1bb8 --- /dev/null +++ b/src/test/confidence/lola/expected @@ -0,0 +1,113 @@ +`timescale 1ns / 1 ps +module RISC5( // translated from Lola +input clk, rst, stallX, +input [31:0] inbus, codebus, +output [23:0] adr, +output rd, wr, ben, +output [31:0] outbus); +reg [21:0] PC; +reg [31:0] IR; +reg N, Z, C, OV, stall1, PMsel; +reg [31:0] R[15:0]; +reg [31:0] H; +wire [21:0] pcmux, nxpc; +wire cond, S, sa, sb, sc; +wire [31:0] ins, pmout; +wire p, q, u, v, w; +wire [3:0] op, ira, ira0, irb, irc; +wire [2:0] cc; +wire [15:0] imm; +wire [19:0] off; +wire [23:0] offL; +wire regwr, stall, stallL, stallM, stallD, stallFA, stallFM, stallFD; +wire [1:0] sc1, sc0; +wire a0, a1, a2, a3; +wire [7:0] inbusL, outbusB0, outbusB1, outbusB2, outbusB3; +wire [23:0] inbusH; +wire [31:0] A, B, C0, C1, aluRes, regmux, s1, s2, s3, t1, t2, t3, quotient, remainder; +wire [63:0] product; +wire [31:0] fsum, fprod, fquot; +wire Add, Sub, Mul, Div, Fadd, Fsub, Fmul, Fdiv, Ldr, Str, Br; +assign adr = stallL ? (B[23:0] + {4'h0, off}) : {pcmux, 2'h0}; +assign rd = ((Ldr & ~stallX) & ~stall1); +assign wr = ((Str & ~stallX) & ~stall1); +assign ben = ((((p & ~q) & v) & ~stallX) & ~stall1); +assign outbus = {outbusB3, outbusB2, outbusB1, outbusB0}; +PROM PM(.clk(clk), .adr(pcmux[8:0]), .data(pmout)); +Multiplier mulUnit(.clk(clk), .run(Mul), .u(~u), .stall(stallM), .x(B), .y(C1), .z(product)); +Divider divUnit(.clk(clk), .run(Div), .u(~u), .stall(stallD), .x(B), .y(C1), .quot(quotient), .rem(remainder)); +FPAdder faddUnit(.clk(clk), .run((Fadd | Fsub)), .u(u), .v(v), .stall(stallFA), .x(B), .y({(Fsub ^ C0[31]), C0[30:0]}), .z(fsum)); +FPMultiplier fmulUnit(.clk(clk), .run(Fmul), .stall(stallFM), .x(B), .y(C0), .z(fprod)); +FPDivider fdivUnit(.clk(clk), .run(Fdiv), .stall(stallFD), .x(B), .y(C0), .z(fquot)); +assign pcmux = ~rst ? 22'h3FF800 : stall ? PC : ((Br & cond) & u) ? (offL[21:0] + nxpc) : ((Br & cond) & ~u) ? C0[23:2] : nxpc; +assign nxpc = (PC + 1); +assign cond = (ins[27] ^ (((((((((cc == 0) & N) | ((cc == 1) & Z)) | ((cc == 2) & C)) | ((cc == 3) & OV)) | ((cc == 4) & (C | Z))) | ((cc == 5) & S)) | ((cc == 6) & (S | Z))) | (cc == 7))); +assign S = (N ^ OV); +assign sa = aluRes[31]; +assign sb = B[31]; +assign sc = C1[31]; +assign ins = PMsel ? pmout : IR; +assign p = ins[31]; +assign q = ins[30]; +assign u = ins[29]; +assign v = ins[28]; +assign w = ins[16]; +assign op = ins[19:16]; +assign ira = ins[27:24]; +assign ira0 = Br ? 4'hF : ira; +assign irb = ins[23:20]; +assign irc = ins[3:0]; +assign cc = ins[26:24]; +assign imm = ins[15:0]; +assign off = ins[19:0]; +assign offL = ins[23:0]; +assign regwr = (((~p & ~stall) | ((Ldr & ~stallX) & ~stall1)) | (((Br & cond) & v) & ~stallX)); +assign stall = ((((((stallL | stallM) | stallD) | stallFA) | stallFM) | stallFD) | stallX); +assign stallL = ((Ldr | Str) & ~stall1); +assign sc1 = C1[3:2]; +assign sc0 = C1[1:0]; +assign a0 = (~adr[1] & ~adr[0]); +assign a1 = (~adr[1] & adr[0]); +assign a2 = (adr[1] & ~adr[0]); +assign a3 = (adr[1] & adr[0]); +assign inbusL = (~ben | a0) ? inbus[7:0] : a1 ? inbus[15:8] : a2 ? inbus[23:16] : inbus[31:24]; +assign outbusB0 = A[7:0]; +assign outbusB1 = (ben & a1) ? A[7:0] : A[15:8]; +assign outbusB2 = (ben & a2) ? A[7:0] : A[23:16]; +assign outbusB3 = (ben & a3) ? A[7:0] : A[31:24]; +assign inbusH = ~ben ? inbus[31:8] : 24'h0; +assign A = R[ira0]; +assign B = R[irb]; +assign C0 = R[irc]; +assign C1 = q ? {{16{v}}, imm} : C0; +assign aluRes = ~op[3] ? ~op[2] ? ~op[1] ? ~op[0] ? q ? ~u ? {{16{v}}, imm} : {imm, 16'h0} : ~u ? C0 : ~v ? H : {N, Z, C, OV, 20'h0, 8'h58} : t3 : s3 : ~op[1] ? ~op[0] ? (B & C1) : (B & ~C1) : ~op[0] ? (B | C1) : (B ^ C1) : ~op[2] ? ~op[1] ? ~op[0] ? ((B + C) + (u & C)) : ((B - C1) - (u & C)) : ~op[0] ? product[31:0] : quotient : ~op[1] ? fsum : ~op[0] ? fprod : fquot; +assign regmux = Ldr ? {inbusH, inbusL} : (Br & v) ? {8'h0, nxpc, 2'h0} : aluRes; +assign s1 = (sc0 == 3) ? {w ? B[2:0] : {3{B[31]}}, B[31:3]} : (sc0 == 2) ? {w ? B[1:0] : {2{B[31]}}, B[31:2]} : (sc0 == 1) ? {w ? B[0] : B[31], B[31:1]} : B; +assign s2 = (sc1 == 3) ? {w ? s1[11:0] : {12{B[31]}}, s1[31:12]} : (sc1 == 2) ? {w ? s1[7:0] : {8{B[31]}}, s1[31:8]} : (sc1 == 1) ? {w ? s1[3:0] : {4{B[31]}}, s1[31:4]} : s1; +assign s3 = C1[4] ? {w ? s2[15:0] : {16{s2[31]}}, s2[31:16]} : s2; +assign t1 = (sc0 == 3) ? {B[28:0], 3'h0} : (sc0 == 2) ? {B[29:0], 2'h0} : (sc0 == 1) ? {B[30:0], 1'h0} : B; +assign t2 = (sc1 == 3) ? {t1[19:0], 12'h0} : (sc1 == 2) ? {t1[23:0], 8'h0} : (sc1 == 1) ? {t1[27:0], 4'h0} : t1; +assign t3 = C1[4] ? {t2[15:0], 16'h0} : t2; +assign Add = (~p & (op == 8)); +assign Sub = (~p & (op == 9)); +assign Mul = (~p & (op == 10)); +assign Div = (~p & (op == 11)); +assign Fadd = (~p & (op == 12)); +assign Fsub = (~p & (op == 13)); +assign Fmul = (~p & (op == 14)); +assign Fdiv = (~p & (op == 15)); +assign Ldr = ((p & ~q) & ~u); +assign Str = ((p & ~q) & u); +assign Br = (p & q); +always @ (posedge clk) begin PC <= pcmux; +IR <= stall ? IR : codebus; +N <= regwr ? regmux[31] : N; +Z <= regwr ? (regmux == 0) : Z; +C <= Add ? (((sb & sc) | ((~sa & ~sb) & sc)) | (((~sa & sb) & ~sc) & sa)) : Sub ? (((~sb & sc) | ((sa & ~sb) & ~sc)) | ((sa & sb) & sc)) : C; +OV <= Add ? (((sa & ~sb) & ~sc) | ((~sa & sb) & sc)) : Sub ? (((sa & ~sb) & sc) | ((~sa & sb) & ~sc)) : OV; +stall1 <= stallX ? stall1 : stallL; +PMsel <= (~rst | (pcmux[21:12] == 10'h3FF)); +R[ira0] <= regwr ? regmux : A; +H <= Mul ? product[63:32] : Div ? remainder : H; +end +endmodule diff --git a/src/test/confidence/lola/lola.Mod b/src/test/confidence/lola/lola.Mod new file mode 100755 index 00000000..b330e008 --- /dev/null +++ b/src/test/confidence/lola/lola.Mod @@ -0,0 +1,12 @@ +MODULE Lola; (* Command line runner for Lola to verilog compilation *) + IMPORT LSB, LSC, LSV, Platform, Console; +BEGIN + IF Platform.ArgCount < 3 THEN + Console.String("Lola - compile lola source to verilog source."); Console.Ln; Console.Ln; + Console.String("usage:"); Console.Ln; Console.Ln; + Console.String(" lola lola-source-file verilog-source-file"); Console.Ln; Console.Ln; + ELSE + LSC.Compile; + IF LSB.modname # "" THEN LSV.List END + END +END Lola. diff --git a/src/test/confidence/lola/result b/src/test/confidence/lola/result new file mode 100644 index 00000000..4a6b1bb8 --- /dev/null +++ b/src/test/confidence/lola/result @@ -0,0 +1,113 @@ +`timescale 1ns / 1 ps +module RISC5( // translated from Lola +input clk, rst, stallX, +input [31:0] inbus, codebus, +output [23:0] adr, +output rd, wr, ben, +output [31:0] outbus); +reg [21:0] PC; +reg [31:0] IR; +reg N, Z, C, OV, stall1, PMsel; +reg [31:0] R[15:0]; +reg [31:0] H; +wire [21:0] pcmux, nxpc; +wire cond, S, sa, sb, sc; +wire [31:0] ins, pmout; +wire p, q, u, v, w; +wire [3:0] op, ira, ira0, irb, irc; +wire [2:0] cc; +wire [15:0] imm; +wire [19:0] off; +wire [23:0] offL; +wire regwr, stall, stallL, stallM, stallD, stallFA, stallFM, stallFD; +wire [1:0] sc1, sc0; +wire a0, a1, a2, a3; +wire [7:0] inbusL, outbusB0, outbusB1, outbusB2, outbusB3; +wire [23:0] inbusH; +wire [31:0] A, B, C0, C1, aluRes, regmux, s1, s2, s3, t1, t2, t3, quotient, remainder; +wire [63:0] product; +wire [31:0] fsum, fprod, fquot; +wire Add, Sub, Mul, Div, Fadd, Fsub, Fmul, Fdiv, Ldr, Str, Br; +assign adr = stallL ? (B[23:0] + {4'h0, off}) : {pcmux, 2'h0}; +assign rd = ((Ldr & ~stallX) & ~stall1); +assign wr = ((Str & ~stallX) & ~stall1); +assign ben = ((((p & ~q) & v) & ~stallX) & ~stall1); +assign outbus = {outbusB3, outbusB2, outbusB1, outbusB0}; +PROM PM(.clk(clk), .adr(pcmux[8:0]), .data(pmout)); +Multiplier mulUnit(.clk(clk), .run(Mul), .u(~u), .stall(stallM), .x(B), .y(C1), .z(product)); +Divider divUnit(.clk(clk), .run(Div), .u(~u), .stall(stallD), .x(B), .y(C1), .quot(quotient), .rem(remainder)); +FPAdder faddUnit(.clk(clk), .run((Fadd | Fsub)), .u(u), .v(v), .stall(stallFA), .x(B), .y({(Fsub ^ C0[31]), C0[30:0]}), .z(fsum)); +FPMultiplier fmulUnit(.clk(clk), .run(Fmul), .stall(stallFM), .x(B), .y(C0), .z(fprod)); +FPDivider fdivUnit(.clk(clk), .run(Fdiv), .stall(stallFD), .x(B), .y(C0), .z(fquot)); +assign pcmux = ~rst ? 22'h3FF800 : stall ? PC : ((Br & cond) & u) ? (offL[21:0] + nxpc) : ((Br & cond) & ~u) ? C0[23:2] : nxpc; +assign nxpc = (PC + 1); +assign cond = (ins[27] ^ (((((((((cc == 0) & N) | ((cc == 1) & Z)) | ((cc == 2) & C)) | ((cc == 3) & OV)) | ((cc == 4) & (C | Z))) | ((cc == 5) & S)) | ((cc == 6) & (S | Z))) | (cc == 7))); +assign S = (N ^ OV); +assign sa = aluRes[31]; +assign sb = B[31]; +assign sc = C1[31]; +assign ins = PMsel ? pmout : IR; +assign p = ins[31]; +assign q = ins[30]; +assign u = ins[29]; +assign v = ins[28]; +assign w = ins[16]; +assign op = ins[19:16]; +assign ira = ins[27:24]; +assign ira0 = Br ? 4'hF : ira; +assign irb = ins[23:20]; +assign irc = ins[3:0]; +assign cc = ins[26:24]; +assign imm = ins[15:0]; +assign off = ins[19:0]; +assign offL = ins[23:0]; +assign regwr = (((~p & ~stall) | ((Ldr & ~stallX) & ~stall1)) | (((Br & cond) & v) & ~stallX)); +assign stall = ((((((stallL | stallM) | stallD) | stallFA) | stallFM) | stallFD) | stallX); +assign stallL = ((Ldr | Str) & ~stall1); +assign sc1 = C1[3:2]; +assign sc0 = C1[1:0]; +assign a0 = (~adr[1] & ~adr[0]); +assign a1 = (~adr[1] & adr[0]); +assign a2 = (adr[1] & ~adr[0]); +assign a3 = (adr[1] & adr[0]); +assign inbusL = (~ben | a0) ? inbus[7:0] : a1 ? inbus[15:8] : a2 ? inbus[23:16] : inbus[31:24]; +assign outbusB0 = A[7:0]; +assign outbusB1 = (ben & a1) ? A[7:0] : A[15:8]; +assign outbusB2 = (ben & a2) ? A[7:0] : A[23:16]; +assign outbusB3 = (ben & a3) ? A[7:0] : A[31:24]; +assign inbusH = ~ben ? inbus[31:8] : 24'h0; +assign A = R[ira0]; +assign B = R[irb]; +assign C0 = R[irc]; +assign C1 = q ? {{16{v}}, imm} : C0; +assign aluRes = ~op[3] ? ~op[2] ? ~op[1] ? ~op[0] ? q ? ~u ? {{16{v}}, imm} : {imm, 16'h0} : ~u ? C0 : ~v ? H : {N, Z, C, OV, 20'h0, 8'h58} : t3 : s3 : ~op[1] ? ~op[0] ? (B & C1) : (B & ~C1) : ~op[0] ? (B | C1) : (B ^ C1) : ~op[2] ? ~op[1] ? ~op[0] ? ((B + C) + (u & C)) : ((B - C1) - (u & C)) : ~op[0] ? product[31:0] : quotient : ~op[1] ? fsum : ~op[0] ? fprod : fquot; +assign regmux = Ldr ? {inbusH, inbusL} : (Br & v) ? {8'h0, nxpc, 2'h0} : aluRes; +assign s1 = (sc0 == 3) ? {w ? B[2:0] : {3{B[31]}}, B[31:3]} : (sc0 == 2) ? {w ? B[1:0] : {2{B[31]}}, B[31:2]} : (sc0 == 1) ? {w ? B[0] : B[31], B[31:1]} : B; +assign s2 = (sc1 == 3) ? {w ? s1[11:0] : {12{B[31]}}, s1[31:12]} : (sc1 == 2) ? {w ? s1[7:0] : {8{B[31]}}, s1[31:8]} : (sc1 == 1) ? {w ? s1[3:0] : {4{B[31]}}, s1[31:4]} : s1; +assign s3 = C1[4] ? {w ? s2[15:0] : {16{s2[31]}}, s2[31:16]} : s2; +assign t1 = (sc0 == 3) ? {B[28:0], 3'h0} : (sc0 == 2) ? {B[29:0], 2'h0} : (sc0 == 1) ? {B[30:0], 1'h0} : B; +assign t2 = (sc1 == 3) ? {t1[19:0], 12'h0} : (sc1 == 2) ? {t1[23:0], 8'h0} : (sc1 == 1) ? {t1[27:0], 4'h0} : t1; +assign t3 = C1[4] ? {t2[15:0], 16'h0} : t2; +assign Add = (~p & (op == 8)); +assign Sub = (~p & (op == 9)); +assign Mul = (~p & (op == 10)); +assign Div = (~p & (op == 11)); +assign Fadd = (~p & (op == 12)); +assign Fsub = (~p & (op == 13)); +assign Fmul = (~p & (op == 14)); +assign Fdiv = (~p & (op == 15)); +assign Ldr = ((p & ~q) & ~u); +assign Str = ((p & ~q) & u); +assign Br = (p & q); +always @ (posedge clk) begin PC <= pcmux; +IR <= stall ? IR : codebus; +N <= regwr ? regmux[31] : N; +Z <= regwr ? (regmux == 0) : Z; +C <= Add ? (((sb & sc) | ((~sa & ~sb) & sc)) | (((~sa & sb) & ~sc) & sa)) : Sub ? (((~sb & sc) | ((sa & ~sb) & ~sc)) | ((sa & sb) & sc)) : C; +OV <= Add ? (((sa & ~sb) & ~sc) | ((~sa & sb) & sc)) : Sub ? (((sa & ~sb) & sc) | ((~sa & sb) & ~sc)) : OV; +stall1 <= stallX ? stall1 : stallL; +PMsel <= (~rst | (pcmux[21:12] == 10'h3FF)); +R[ira0] <= regwr ? regmux : A; +H <= Mul ? product[63:32] : Div ? remainder : H; +end +endmodule diff --git a/src/test/confidence/lola/test.sh b/src/test/confidence/lola/test.sh new file mode 100755 index 00000000..c8d4a27a --- /dev/null +++ b/src/test/confidence/lola/test.sh @@ -0,0 +1,4 @@ +. ../testenv.sh +voc LSS.Mod LSB.Mod LSC.Mod LSV.Mod lola.Mod -m +./Lola RISC5.Lola result +. ../testresult.sh diff --git a/src/test/confidence/signal/expected b/src/test/confidence/signal/expected new file mode 100644 index 00000000..b9d387bd --- /dev/null +++ b/src/test/confidence/signal/expected @@ -0,0 +1 @@ +Signal 2 diff --git a/src/test/confidence/signal/result b/src/test/confidence/signal/result new file mode 100644 index 00000000..b9d387bd --- /dev/null +++ b/src/test/confidence/signal/result @@ -0,0 +1 @@ +Signal 2 diff --git a/src/test/confidence/signal/signal.mod b/src/test/confidence/signal/signal.mod new file mode 100644 index 00000000..c7b58a48 --- /dev/null +++ b/src/test/confidence/signal/signal.mod @@ -0,0 +1,51 @@ +(* Test that interrupt and quit are handled correctly. *) +MODULE SignalTest; +IMPORT Console, Platform, Files; + +VAR result: Files.File; rider: Files.Rider; + +PROCEDURE ws(s: ARRAY OF CHAR); +VAR i: INTEGER; +BEGIN i := 0; + WHILE (i < LEN(s)) & (s[i] # 0X) DO Files.Write(rider, s[i]); INC(i) END +END ws; + +PROCEDURE wl; +BEGIN Files.Write(rider, 0AX) END wl; + +PROCEDURE wi(i: LONGINT); +VAR s: ARRAY 30 OF CHAR; j: INTEGER; +BEGIN + j := 0; + IF i<0 THEN s[0] := '-'; INC(j) END; + s[j] := CHR(i MOD 10 + 48); INC(j); i := i DIV 10; + WHILE i > 0 DO s[j] := CHR(i MOD 10 + 48); INC(j); i := i DIV 10 END; + WHILE j > 0 DO DEC(j); Files.Write(rider, s[j]) END +END wi; + + +PROCEDURE handle(signal: INTEGER); +BEGIN + Console.Ln; Console.String("Signal: "); Console.Int(signal,1); Console.Ln; + ws("Signal "); wi(signal); wl; + (*Platform.Delay(1000)*) +END handle; + +PROCEDURE Take5(i: INTEGER); +BEGIN + WHILE i > 0 DO + Console.Int(i,2); Console.Flush(); Platform.Delay(1000); DEC(i) + END; + Console.Ln; +END Take5; + +BEGIN + result := Files.New("result"); + Files.Set(rider, result, 0); + IF Platform.ArgCount > 1 THEN + Platform.SetInterruptHandler(handle); + Platform.SetQuitHandler(handle) + END; + Take5(4); + Files.Register(result); +END SignalTest. \ No newline at end of file diff --git a/src/test/confidence/signal/test.sh b/src/test/confidence/signal/test.sh new file mode 100755 index 00000000..ab1d584c --- /dev/null +++ b/src/test/confidence/signal/test.sh @@ -0,0 +1,7 @@ +. ../testenv.sh +voc signal.mod -m +./SignalTest x & +sleep 1 +kill -2 $! +wait +. ../testresult.sh diff --git a/src/test/confidence/testenv.sh b/src/test/confidence/testenv.sh new file mode 100755 index 00000000..6c8cfb93 --- /dev/null +++ b/src/test/confidence/testenv.sh @@ -0,0 +1,10 @@ +## '.' this file from individual test.sh files. +#set -e +if which cygpath >/dev/null +then export PATH="$(cygpath "$1")/bin":$PATH +else export PATH="$1/bin":$PATH +fi +# Set ibrary paths for darwin and termux(android) +export DYLD_LIBRARY_PATH=$1/lib:$DYLD_LIBRARY_PATH +export LD_LIBRARY_PATH=$1/lib:$LD_LIBRARY_PATH +rm -f *.o *.obj *.exe *.sym *.c *.h result diff --git a/src/test/confidence/testresult.sh b/src/test/confidence/testresult.sh new file mode 100755 index 00000000..171fd1b1 --- /dev/null +++ b/src/test/confidence/testresult.sh @@ -0,0 +1,5 @@ +# '.' this from indiviual test.sh files +if diff -b expected result +then printf "PASSED: $PWD\n\n" +else printf "FAILED: $PWD\n\n"; exit 1 +fi From efb7b6b0305be35521de51954ade53f779daf923 Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 16 Jun 2016 13:58:01 +0100 Subject: [PATCH 074/580] Update compiler source to V2. --- src/compiler/OPB.Mod | 129 ++--- src/compiler/OPC.Mod | 115 +++-- src/compiler/OPM.cmdln.Mod | 985 +++++++++++++++---------------------- src/compiler/OPP.Mod | 44 +- src/compiler/OPS.Mod | 18 +- src/compiler/OPT.Mod | 457 ++++++++--------- src/compiler/OPV.Mod | 135 ++--- src/compiler/Vishap.Mod | 177 +++---- src/compiler/extTools.Mod | 140 +++--- 9 files changed, 1023 insertions(+), 1177 deletions(-) diff --git a/src/compiler/OPB.Mod b/src/compiler/OPB.Mod index 6e4430d0..8b7468c1 100644 --- a/src/compiler/OPB.Mod +++ b/src/compiler/OPB.Mod @@ -12,13 +12,13 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) conv = 20; abs = 21; cap = 22; odd = 23; not = 33; (*SYSTEM*) adr = 24; cc = 25; bit = 26; lsh = 27; rot = 28; val = 29; - + (* object modes *) Var = 1; VarPar = 2; Con = 3; Fld = 4; Typ = 5; LProc = 6; XProc = 7; SProc = 8; CProc = 9; IProc = 10; Mod = 11; Head = 12; TProc = 13; (* Structure forms *) - Undef = 0; Byte = 1; Bool = 2; Char = 3; + Undef = 0; Byte = 1; Bool = 2; Char = 3; SInt = 4; Int = 5; LInt = 6; Real = 7; LReal = 8; Set = 9; String = 10; NilTyp = 11; NoTyp = 12; Pointer = 13; ProcTyp = 14; @@ -29,8 +29,8 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) Comp = 19; *) (*Real = 7; LReal = 8; Set = 9; String = 10; NilTyp = 11; NoTyp = 12; - Pointer = 13; ProcTyp = 14; - Int8 = 15; Int16 = 16; Int32 = 17; Int64 = 18; + Pointer = 13; ProcTyp = 14; + Int8 = 15; Int16 = 16; Int32 = 17; Int64 = 18; Comp = (*15*)19;*) intSet = {SInt..LInt(*, Int8..Int64*)}; realSet = {Real, LReal}; @@ -51,7 +51,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) entierfn = 5; oddfn = 6; minfn = 7; maxfn = 8; chrfn = 9; shortfn = 10; longfn = 11; sizefn = 12; incfn = 13; decfn = 14; inclfn = 15; exclfn = 16; lenfn = 17; copyfn = 18; ashfn = 19; assertfn = 32; - + (*SYSTEM function number*) adrfn = 20; ccfn = 21; lshfn = 22; rotfn = 23; getfn = 24; putfn = 25; getrfn = 26; putrfn = 27; @@ -69,11 +69,11 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) typSize*: PROCEDURE(typ: OPT.Struct); exp: INTEGER; (*side effect of log*) maxExp: LONGINT; (* max n in ASH(1, n) on this machine *) - + PROCEDURE err(n: INTEGER); BEGIN OPM.err(n) END err; - + PROCEDURE NewLeaf*(obj: OPT.Object): OPT.Node; VAR node: OPT.Node; BEGIN @@ -94,31 +94,31 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) node^.obj := obj; node^.typ := obj^.typ; RETURN node END NewLeaf; - + PROCEDURE Construct*(class: SHORTINT; VAR x: OPT.Node; y: OPT.Node); VAR node: OPT.Node; BEGIN node := OPT.NewNode(class); node^.typ := OPT.notyp; node^.left := x; node^.right := y; x := node END Construct; - + PROCEDURE Link*(VAR x, last: OPT.Node; y: OPT.Node); BEGIN IF x = NIL THEN x := y ELSE last^.link := y END ; WHILE y^.link # NIL DO y := y^.link END ; last := y END Link; - + PROCEDURE BoolToInt(b: BOOLEAN): LONGINT; BEGIN IF b THEN RETURN 1 ELSE RETURN 0 END END BoolToInt; - + PROCEDURE IntToBool(i: LONGINT): BOOLEAN; BEGIN IF i = 0 THEN RETURN FALSE ELSE RETURN TRUE END END IntToBool; - + PROCEDURE NewBoolConst*(boolval: BOOLEAN): OPT.Node; VAR x: OPT.Node; BEGIN @@ -181,7 +181,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) x := OPT.NewNode(Nconst); x^.conval := OPT.NewConst(); x^.conval^.intval := intval; SetIntType(x); RETURN x END NewIntConst; - + PROCEDURE NewRealConst*(realval: LONGREAL; typ: OPT.Struct): OPT.Node; VAR x: OPT.Node; BEGIN @@ -198,7 +198,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) x^.conval^.ext := OPT.NewExt(); x^.conval^.ext^ := str; RETURN x END NewString; - + PROCEDURE CharToString(n: OPT.Node); VAR ch: CHAR; BEGIN @@ -248,7 +248,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) END ; BindNodes(Nindex, typ, x, y); x^.readonly := x^.left^.readonly END Index; - + PROCEDURE Field*(VAR x: OPT.Node; y: OPT.Object); BEGIN (*x^.typ^.comp = Record*) IF x^.class >= Nconst THEN err(77) END ; @@ -258,7 +258,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) ELSE err(83); x^.typ := OPT.undftyp END END Field; - + PROCEDURE TypTest*(VAR x: OPT.Node; obj: OPT.Object; guard: BOOLEAN); PROCEDURE GTT(t0, t1: OPT.Struct); @@ -297,7 +297,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) END ; IF guard THEN x^.typ := obj^.typ ELSE x^.typ := OPT.booltyp END END TypTest; - + PROCEDURE In*(VAR x: OPT.Node; y: OPT.Node); VAR f: INTEGER; k: LONGINT; BEGIN f := x^.typ^.form; @@ -337,10 +337,10 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) END ; x^.intval := OPM.ConstNotAlloc END CheckRealType; - + PROCEDURE MOp*(op: SHORTINT; VAR x: OPT.Node); VAR f: INTEGER; typ: OPT.Struct; z: OPT.Node; - + PROCEDURE NewOp(op: SHORTINT; typ: OPT.Struct; z: OPT.Node): OPT.Node; VAR node: OPT.Node; BEGIN @@ -409,9 +409,9 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) END ; z^.typ := OPT.booltyp | adr: (*SYSTEM.ADR*) - IF (z^.class = Nconst) & (f = Char) & (z^.conval^.intval >= 20H) THEN - CharToString(z); f := String - END ; + IF (z^.class = Nconst) & (f = Char) & (z^.conval^.intval >= 20H) THEN + CharToString(z); f := String + END; IF (z^.class < Nconst) OR (f = String) THEN z := NewOp(op, typ, z) ELSE err(127) END ; @@ -428,7 +428,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) END ; x := z END MOp; - + PROCEDURE CheckPtr(x, y: OPT.Node); VAR g: INTEGER; p, q, t: OPT.Struct; BEGIN g := y^.typ^.form; @@ -641,7 +641,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) | plus: IF f IN intSet THEN temp := (yval^.intval >= 0) & (xval^.intval <= MAX(LONGINT) - yval^.intval); - IF temp OR (yval^.intval < 0) & (xval^.intval >= MIN(LONGINT) - yval^.intval) THEN + IF temp OR (yval^.intval < 0) & (xval^.intval >= MIN(LONGINT) - yval^.intval) THEN INC(xval^.intval, yval^.intval); SetIntType(x) ELSE err(206) END @@ -658,7 +658,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) | minus: IF f IN intSet THEN IF (yval^.intval >= 0) & (xval^.intval >= MIN(LONGINT) + yval^.intval) OR - (yval^.intval < 0) & (xval^.intval <= MAX(LONGINT) + yval^.intval) THEN + (yval^.intval < 0) & (xval^.intval <= MAX(LONGINT) + yval^.intval) THEN DEC(xval^.intval, yval^.intval); SetIntType(x) ELSE err(207) END @@ -920,7 +920,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) PROCEDURE SetRange*(VAR x: OPT.Node; y: OPT.Node); VAR k, l: LONGINT; BEGIN - IF (x^.class = Ntype) OR (x^.class = Nproc) OR (y^.class = Ntype) OR (y^.class = Nproc) THEN err(126) + IF (x^.class = Ntype) OR (x^.class = Nproc) OR (y^.class = Ntype) OR (y^.class = Nproc) THEN err(126) ELSIF (x^.typ^.form IN intSet) & (y^.typ^.form IN intSet) THEN IF x^.class = Nconst THEN k := x^.conval^.intval; @@ -958,7 +958,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) END ; x^.typ := OPT.settyp END SetElem; - + PROCEDURE CheckAssign(x: OPT.Struct; ynode: OPT.Node); (* x := y *) VAR f, g: INTEGER; y, p, q: OPT.Struct; BEGIN @@ -976,24 +976,24 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) CASE f OF Undef, String: (* | Int8: - IF (ynode.typ.size > OPM.Int8Size) THEN + IF (ynode.typ.size > OPM.Int8Size) THEN IF OPM.Verbose THEN OPM.LogWStr("f of int8"); OPM.LogWLn END; - err(113) + err(113) END | Int16: - IF (ynode.typ.size > OPM.Int16Size) THEN + IF (ynode.typ.size > OPM.Int16Size) THEN IF OPM.Verbose THEN OPM.LogWStr("f of int16"); OPM.LogWLn END; - err(113) + err(113) END | Int32: - IF (ynode.typ.size > OPM.Int32Size) THEN + IF (ynode.typ.size > OPM.Int32Size) THEN IF OPM.Verbose THEN OPM.LogWStr("f of int32"); OPM.LogWLn END; - err(113) + err(113) END | Int64: - IF ynode.typ.size > OPM.Int64Size THEN + IF ynode.typ.size > OPM.Int64Size THEN IF OPM.Verbose THEN OPM.LogWStr("f of int64"); OPM.LogWLn END; - err(113) + err(113) END*) | Byte: IF ~(g IN {Byte, Char, SInt}) THEN err(113) END @@ -1034,8 +1034,18 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) IF x^.comp = Array THEN IF (ynode^.class = Nconst) & (g = Char) THEN CharToString(ynode); y := ynode^.typ; g := String END ; IF x = y THEN (* ok *) - ELSIF (g = String) & (x^.BaseTyp = OPT.chartyp) THEN (*check length of string*) - IF ynode^.conval^.intval2 > x^.n THEN err(114) END ; + ELSIF x^.BaseTyp = OPT.chartyp THEN (* Assign to (static) ARRAY OF CHAR *) + IF g = String THEN (*check length of string*) + IF ynode^.conval^.intval2 > x^.n THEN err(114) END + ELSIF (y.comp IN {DynArr, Array}) & (y.BaseTyp = OPT.chartyp) THEN + (* Assignment from ARRAY OF CHAR is good.*) + ELSE err(113) + END + ELSE err(113) + END + ELSIF (x.comp = DynArr) & (x^.BaseTyp = OPT.chartyp) THEN (* Assign to dynamic ARRAY OF CHAR*) + IF (y.comp IN {DynArr, Array}) & (y.BaseTyp = OPT.chartyp) THEN + (* Assignment from ARRAY OF CHAR is good.*) ELSE err(113) END ELSIF x^.comp = Record THEN @@ -1046,7 +1056,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) IF q = NIL THEN err(113) END ELSE err(113) END - ELSE (*DynArr*) err(113) + ELSE err(113) END ELSE (* In case of not estimated f it would crash -- noch *) OPM.LogWStr("unhandled case in OPB.CheckAssign, f = "); OPM.LogWNum(f, 0); OPM.LogWLn; @@ -1055,18 +1065,18 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) Convert(ynode, x) END END CheckAssign; - + PROCEDURE CheckLeaf(x: OPT.Node; dynArrToo: BOOLEAN); BEGIN (* -avoid unnecessary intermediate variables in voc +avoid unnecessary intermediate variables in voc IF (x^.class = Nmop) & (x^.subcl = val) THEN x := x^.left END ; IF x^.class = Nguard THEN x := x^.left END ; (* skip last (and unique) guard *) IF (x^.class = Nvar) & (dynArrToo OR (x^.typ^.comp # DynArr)) THEN x^.obj^.leaf := FALSE END *) END CheckLeaf; - + PROCEDURE StPar0*(VAR par0: OPT.Node; fctno: INTEGER); (* par0: first param of standard proc *) VAR f: INTEGER; typ: OPT.Struct; x: OPT.Node; BEGIN x := par0; f := x^.typ^.form; @@ -1099,7 +1109,7 @@ avoid unnecessary intermediate variables in voc MOp(abs, x) | capfn: (*CAP*) MOp(cap, x) - | ordfn: (*ORD*) + | ordfn: (*ORD*) IF (x^.class = Ntype) OR (x^.class = Nproc) THEN err(126) ELSIF f = Char THEN Convert(x, OPT.inttyp) ELSE err(111) @@ -1151,7 +1161,7 @@ avoid unnecessary intermediate variables in voc END ELSE err(110) END - | chrfn: (*CHR*) + | chrfn: (*CHR*) IF (x^.class = Ntype) OR (x^.class = Nproc) THEN err(126) ELSIF f IN {Undef, SInt..LInt(*, Int8..Int64*)} THEN Convert(x, OPT.chartyp) ELSE err(111); x^.typ := OPT.chartyp @@ -1177,7 +1187,7 @@ avoid unnecessary intermediate variables in voc ELSIF f = Char THEN Convert(x, OPT.linttyp) ELSE err(111) END - | incfn, decfn: (*INC, DEC*) + | incfn, decfn: (*INC, DEC*) IF NotVar(x) THEN err(112) ELSIF ~(f IN intSet) THEN err(111) ELSIF x^.readonly THEN err(76) @@ -1248,14 +1258,14 @@ avoid unnecessary intermediate variables in voc PROCEDURE StPar1*(VAR par0: OPT.Node; x: OPT.Node; fctno: SHORTINT); (* x: second parameter of standard proc *) VAR f, L: INTEGER; typ: OPT.Struct; p, t: OPT.Node; - + PROCEDURE NewOp(class, subcl: SHORTINT; left, right: OPT.Node): OPT.Node; VAR node: OPT.Node; BEGIN node := OPT.NewNode(class); node^.subcl := subcl; node^.left := left; node^.right := right; RETURN node END NewOp; - + BEGIN p := par0; f := x^.typ^.form; CASE fctno OF incfn, decfn: (*INC DEC*) @@ -1465,13 +1475,15 @@ avoid unnecessary intermediate variables in voc END ; par0 := p END StFct; - + PROCEDURE DynArrParCheck(ftyp, atyp: OPT.Struct; fvarpar: BOOLEAN); VAR f: INTEGER; BEGIN (* ftyp^.comp = DynArr *) f := atyp^.comp; ftyp := ftyp^.BaseTyp; atyp := atyp^.BaseTyp; IF fvarpar & (ftyp = OPT.bytetyp) THEN (* ok, but ... *) - IF ~(f IN {Array, DynArr}) OR ~(atyp^.form IN {Byte..SInt(*, Int8..Int64*)}) THEN err(-301) END (* ... warning 301 *) + IF ~(f IN {Array, DynArr}) OR ~(atyp^.form IN {Byte..SInt(*, Int8..Int64*)}) THEN + IF OPM.verbose IN OPM.opt THEN err(-301) END + END ELSIF f IN {Array, DynArr} THEN IF ftyp^.comp = DynArr THEN DynArrParCheck(ftyp, atyp, fvarpar) ELSIF ftyp # atyp THEN @@ -1495,7 +1507,7 @@ avoid unnecessary intermediate variables in voc IF x^.class = Nderef THEN x := x^.left (*undo DeRef*) ELSE (*x^.typ^.comp = Record*) err(71) END END END CheckReceiver; - + PROCEDURE PrepCall*(VAR x: OPT.Node; VAR fpar: OPT.Object); BEGIN IF (x^.obj # NIL) & (x^.obj^.mode IN {LProc, XProc, TProc, CProc}) THEN @@ -1535,7 +1547,7 @@ avoid unnecessary intermediate variables in voc END END END Param; - + PROCEDURE StaticLink*(dlev: SHORTINT); VAR scope: OPT.Object; BEGIN @@ -1566,7 +1578,7 @@ avoid unnecessary intermediate variables in voc x := OPT.NewNode(Nenter); x^.typ := OPT.notyp; x^.obj := proc; x^.left := procdec; x^.right := stat; procdec := x END Enter; - + PROCEDURE Return*(VAR x: OPT.Node; proc: OPT.Object); VAR node: OPT.Node; BEGIN @@ -1581,7 +1593,7 @@ avoid unnecessary intermediate variables in voc END Return; PROCEDURE Assign*(VAR x: OPT.Node; y: OPT.Node); - VAR z: OPT.Node; + VAR z: OPT.Node; subcl: SHORTINT; BEGIN IF x^.class >= Nconst THEN err(56) END ; CheckAssign(x^.typ, y); @@ -1599,9 +1611,16 @@ avoid unnecessary intermediate variables in voc y^.typ := OPT.chartyp; y^.conval^.intval := 0; Index(x, NewIntConst(0)) END ; - BindNodes(Nassign, OPT.notyp, x, y); x^.subcl := assign + IF (x.typ.comp IN {Array, DynArr}) & (x.typ.BaseTyp = OPT.chartyp) + & (y.typ.comp IN {Array, DynArr}) & (y.typ.BaseTyp = OPT.chartyp) THEN + subcl := copyfn + ELSE + subcl := assign + END; + BindNodes(Nassign, OPT.notyp, x, y); + x^.subcl := subcl; END Assign; - + PROCEDURE Inittd*(VAR inittd, last: OPT.Node; typ: OPT.Struct); VAR node: OPT.Node; BEGIN @@ -1610,7 +1629,7 @@ avoid unnecessary intermediate variables in voc IF inittd = NIL THEN inittd := node ELSE last^.link := node END ; last := node END Inittd; - + BEGIN maxExp := log(MAX(LONGINT) DIV 2 + 1); maxExp := exp END OPB. diff --git a/src/compiler/OPC.Mod b/src/compiler/OPC.Mod index 2843f145..718ba572 100644 --- a/src/compiler/OPC.Mod +++ b/src/compiler/OPC.Mod @@ -1,17 +1,17 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) -(* C source code generator version +(* C source code generator version 30.4.2000 jt, synchronized with BlackBox version, in particular various promotion rules changed (long) => (LONGINT), xxxL avoided *) - IMPORT OPT, OPM, version; + IMPORT OPT, OPM, Configuration; CONST demoVersion = FALSE; CONST (* structure forms *) - Byte = 1; Bool = 2; Char = 3; + Byte = 1; Bool = 2; Char = 3; SInt = 4; Int = 5; LInt = 6; Real = 7; LReal = 8; Set = 9; String = 10; NilTyp = 11; NoTyp = 12; Pointer = 13; ProcTyp = 14; @@ -23,7 +23,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) Comp = 19; *) (*Real = 7; LReal = 8; Set = 9; String = 10; NilTyp = 11; NoTyp = 12; - Pointer = 13; ProcTyp = 14; + Pointer = 13; ProcTyp = 14; Int8 = 15; Int16 = 16; Int32 = 17; Int64 = 18; Comp = (*15*)19;*) @@ -184,7 +184,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) OPM.Write(Underscore) ELSIF (obj = OPT.sysptrtyp^.strobj) OR (obj = OPT.bytetyp^.strobj) (*OR (obj = OPT.int8typ^.strobj) OR (obj = OPT.int16typ^.strobj) OR (obj = OPT.int32typ^.strobj) OR (obj = OPT.int64typ^.strobj)*) THEN OPM.WriteString("SYSTEM_") - + END ; OPM.WriteStringVar(obj^.name) END @@ -257,7 +257,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) END DeclareObj; PROCEDURE Andent*(typ: OPT.Struct); (* ident of possibly anonymous record type *) - BEGIN + BEGIN IF (typ^.strobj = NIL) OR (typ^.align >= 10000H) THEN OPM.WriteStringVar(OPM.modName); Str1("__#", typ^.align DIV 10000H) ELSE Ident(typ^.strobj) @@ -265,7 +265,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) END Andent; PROCEDURE Undefined(obj: OPT.Object): BOOLEAN; - BEGIN + BEGIN (* imported anonymous types have obj^.name = ""; used e.g. for repeating inherited fields *) RETURN (obj^.mnolev >= 0) & (obj^.linkadr # 3+OPM.currFile ) & (obj^.linkadr # PredefinedType) OR (obj^.name = "") END Undefined; @@ -302,7 +302,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) OPM.WriteString(Struct); BegBlk; BegStat; Str1("LONGINT len[#]", nofdims); EndStat; BegStat; NEW(obj); NEW(obj.typ); (* aux. object for easy declaration *) - obj.typ.form := Comp; obj.typ.comp := Array; obj.typ.n := 1; obj.typ.BaseTyp := typ; obj.mode := Fld; obj.name := "data"; + obj.typ.form := Comp; obj.typ.comp := Array; obj.typ.n := 1; obj.typ.BaseTyp := typ; obj.mode := Fld; obj.name := "data"; obj.linkadr := UndefinedType; DeclareBase(obj); OPM.Write(Blank); DeclareObj(obj, FALSE); EndStat; EndBlk0 END @@ -365,7 +365,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) IF obj^.mode = TProc THEN BegStat; OPM.WriteString("__INITBP("); - Ident(typ); OPM.WriteString(Comma); Ident(obj); + Ident(typ); OPM.WriteString(Comma); Ident(obj); Str1(", #)", obj^.adr DIV 10000H); EndStat END ; @@ -431,7 +431,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) DeclareTProcs(obj^.left, empty); IF obj^.mode = TProc THEN IF obj^.typ # OPT.notyp THEN DefineType(obj^.typ) END ; - IF OPM.currFile = OPM.HeaderFile THEN + IF OPM.currFile = OPM.HeaderFile THEN IF obj^.vis = external THEN DefineTProcTypes(obj); OPM.WriteString(Extern); empty := FALSE; @@ -518,10 +518,10 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) WHILE field # NIL DO DefineType(field^.typ); field := field^.link END END END ; - IF (obj # NIL) & Undefined(obj) THEN + IF (obj # NIL) & Undefined(obj) THEN OPM.WriteString("typedef"); OPM.WriteLn; OPM.Write(Tab); Indent(1); obj^.linkadr := ProcessingType; - DeclareBase(obj); OPM.Write(Blank); + DeclareBase(obj); OPM.Write(Blank); obj^.typ^.strobj := NIL; (* SG: trick to make DeclareObj declare the type *) DeclareObj(obj, FALSE); obj^.typ^.strobj := obj; (* SG: revert trick *) @@ -536,10 +536,11 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) END DefineType; PROCEDURE Prefixed(x: OPT.ConstExt; y: ARRAY OF CHAR): BOOLEAN; - VAR i: INTEGER; - BEGIN i := 0; + VAR i: INTEGER; r: BOOLEAN; + BEGIN i := 0; WHILE x[i+1] = y[i] DO INC(i) END ; - RETURN y[i] = 0X + r := y[i] = 0X; + RETURN r; END Prefixed; PROCEDURE CProcDefs(obj: OPT.Object; vis: INTEGER); @@ -550,7 +551,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) (* bug: obj.history cannot be used to cover unexported and deleted CProcs; use special flag obj.adr = 1 *) IF (obj^.mode = CProc) & (obj^.vis >= vis) & (obj^.adr = 1) THEN ext := obj.conval.ext; i := 1; - IF (ext[1] # "#") & ~(Prefixed(ext, "extern ") OR Prefixed(ext, Extern)) THEN + IF (ext[1] # "#") & ~(Prefixed(ext, "extern ") OR Prefixed(ext, Extern)) THEN OPM.WriteString("#define "); Ident(obj); DeclareParams(obj^.link, TRUE); OPM.Write(Tab); @@ -591,7 +592,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) VAR nofptrs: LONGINT; o: OPT.Object; BEGIN - BegStat; OPM.WriteString("__TDESC("); + BegStat; OPM.WriteString("__TDESC("); Andent(typ); Str1(", #", typ^.n + 1); Str1(", #) = {__TDFLDS(", NofPtrs(typ)); OPM.Write('"'); @@ -613,7 +614,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) PROCEDURE Align*(VAR adr: LONGINT; base: LONGINT); BEGIN - CASE base OF + CASE base OF | 2: INC(adr, adr MOD 2) | 4: INC(adr, (-adr) MOD 4) | 8: INC(adr, (-adr) MOD 8) @@ -655,9 +656,9 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) adr := off; Align(adr, align); IF (curAlign < align) & (gap - (adr - off) >= align) THEN (* preserve alignment of the enclosing struct! *) DEC(gap, (adr - off) + align); - BegStat; - IF align = OPM.IntSize THEN OPM.WriteString("INTEGER") - ELSIF align = OPM.LIntSize THEN OPM.WriteString("LONGINT") + BegStat; + IF align = OPM.IntSize THEN OPM.WriteString("INTEGER") + ELSIF align = OPM.LIntSize THEN OPM.WriteString("LONGINT") ELSIF align = OPM.LRealSize THEN OPM.WriteString("LONGREAL") END ; Str1(" _prvt#", n); INC(n); EndStat; @@ -751,7 +752,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) ELSE LOOP DeclareBase(obj); - IF showParamNames THEN + IF showParamNames THEN OPM.Write(Blank); DeclareObj(obj, FALSE) ELSE COPY(obj^.name, name); obj^.name := ""; DeclareObj(obj, FALSE); COPY(name, obj^.name) @@ -857,30 +858,26 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) PROCEDURE GenHeaderMsg; VAR i: INTEGER; BEGIN - OPM.WriteString("/*"); OPM.WriteString(HeaderMsg); - OPM.Write(" "); OPM.WriteString(version.versionLong); OPM.Write (" "); (* noch *) - FOR i := 0 TO OPM.MaxSet (*31*) DO (*noch*) + OPM.WriteString("/*"); OPM.WriteString(HeaderMsg); + OPM.Write(" "); OPM.WriteString(Configuration.versionLong); OPM.Write (" "); (* noch *) + FOR i := 0 TO MAX(SET) DO IF i IN OPM.glbopt THEN CASE i OF (* c.f. ScanOptions in OPM *) - | OPM.extsf: OPM.Write("e") - | OPM.newsf: OPM.Write("s") - | OPM.mainprog: OPM.Write("m") - | OPM.inxchk: OPM.Write("x") - | OPM.vcpp: OPM.Write("v") - | OPM.ranchk: OPM.Write("r") - | OPM.typchk: OPM.Write("t") - | OPM.assert: OPM.Write("a") - | OPM.ansi: OPM.Write("k") - | OPM.ptrinit: OPM.Write("p") - | OPM.include0: OPM.Write("i") - | OPM.lineno: OPM.Write("l") - | OPM.useparfile: OPM.Write("P") - | OPM.dontasm: OPM.Write("S") - | OPM.dontlink: OPM.Write("c") - | OPM.mainlinkstat: OPM.Write("M") + | OPM.inxchk: OPM.Write("x") + | OPM.ranchk: OPM.Write("r") + | OPM.typchk: OPM.Write("t") + | OPM.newsf: OPM.Write("s") + | OPM.ptrinit: OPM.Write("p") + | OPM.ansi: OPM.Write("k") + | OPM.assert: OPM.Write("a") + | OPM.extsf: OPM.Write("e") + | OPM.mainprog: OPM.Write("m") + | OPM.dontasm: OPM.Write("S") + | OPM.dontlink: OPM.Write("c") + | OPM.mainlinkstat: OPM.Write("M") | OPM.notcoloroutput: OPM.Write("f") - | OPM.forcenewsym: OPM.Write("F") - | OPM.verbose: OPM.Write("v") + | OPM.forcenewsym: OPM.Write("F") + | OPM.verbose: OPM.Write("v") ELSE (* this else is necessary cause if someone defined a new option in OPM module @@ -888,7 +885,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) if option is passed this will generate __CASECHK and cause Halt, noch *) - OPM.LogWStr ("( more options defined in OPM than checked in OPC.GenHeaderMsg, if you are a compiler developer, add them to OPC.GenHeaderMsg"); OPM.LogWLn; + OPM.LogWStr ("( more options defined in OPM than checked in OPC.GenHeaderMsg, if you are a compiler developer, add them to OPC.GenHeaderMsg"); OPM.LogWLn; END END END; @@ -903,6 +900,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) OPM.WriteString("#ifndef "); OPM.WriteStringVar(OPM.modName); OPM.WriteString(FlagExt); OPM.WriteLn; OPM.WriteString("#define "); OPM.WriteStringVar(OPM.modName); OPM.WriteString(FlagExt); OPM.WriteLn; OPM.WriteLn; + IF OPM.LIntSize = 8 THEN OPM.WriteString("#define LARGE"); OPM.WriteLn END; Include(BasicIncludeFile); IncludeImports(OPT.topScope^.right, 1); OPM.WriteLn END GenHdrIncludes; @@ -911,6 +909,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) BEGIN OPM.currFile := OPM.BodyFile; GenHeaderMsg; + IF OPM.LIntSize = 8 THEN OPM.WriteString("#define LARGE"); OPM.WriteLn END; Include(BasicIncludeFile); IncludeImports(OPT.topScope^.right, 0); OPM.WriteLn; DefAnonRecs(n); @@ -940,8 +939,8 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) IF obj # NIL THEN InitImports(obj^.left); IF (obj^.mode = Mod) & (obj^.mnolev # 0) THEN - BegStat; OPM.WriteString("__IMPORT("); - OPM.WriteStringVar(OPT.GlbMod[-obj^.mnolev].name); + BegStat; OPM.WriteString("__MODULE_IMPORT("); + OPM.WriteStringVar(OPT.GlbMod[-obj^.mnolev].name); OPM.Write(CloseParen); EndStat END ; InitImports(obj^.right) @@ -960,7 +959,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) OPM.WriteString("void EnumPtrs(void (*P)(void*))") ELSE OPM.WriteString("void EnumPtrs(P)"); OPM.WriteLn; - OPM.Write(Tab); OPM.WriteString("void (*P)();"); + OPM.Write(Tab); OPM.WriteString("void (*P)();"); END ; OPM.WriteLn; BegBlk @@ -995,7 +994,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) OPM.WriteLn; OPM.WriteString(Export); IF mainprog THEN IF ansi THEN - OPM.WriteString("main(int argc, char **argv)"); OPM.WriteLn; + OPM.WriteString("int main(int argc, char **argv)"); OPM.WriteLn; ELSE OPM.WriteString("main(argc, argv)"); OPM.WriteLn; OPM.Write(Tab); OPM.WriteString("int argc; char **argv;"); OPM.WriteLn @@ -1008,7 +1007,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) IF mainprog THEN OPM.WriteString("__INIT(argc, argv)") ELSE OPM.WriteString("__DEFMOD") END ; EndStat; IF mainprog & demoVersion THEN BegStat; - OPM.WriteString('/*don`t do it!*/ printf("DEMO VERSION: DO NOT USE THIS PROGRAM FOR ANY COMMERCIAL PURPOSE\n")'); + OPM.WriteString('/*don`t do it!*/ printf("DEMO VERSION: DO NOT USE THIS PROGRAM FOR ANY COMMERCIAL PURPOSE\n")'); EndStat END ; InitImports(OPT.topScope^.right); @@ -1050,6 +1049,15 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) IF proc^.vis # external THEN OPM.WriteString(Static) END ; ProcHeader(proc, TRUE); BegBlk; + + (* If there will be a result, provide a result variable. *) + IF proc^.typ # OPT.notyp THEN + BegStat; + Ident(proc^.typ^.strobj); + OPM.WriteString(" _o_result;"); + OPM.WriteLn; + END; + scope := proc^.scope; IdentList(scope^.scope, 0); IF ~scope^.leaf THEN (* declare intermediate procedure scope record variable*) @@ -1080,7 +1088,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) var := proc^.link; WHILE var # NIL DO (* copy value array parameters *) IF (var^.typ^.comp IN {Array, DynArr}) & (var^.mode = Var) & (var^.typ^.sysflag = 0) THEN - BegStat; + BegStat; IF var^.typ^.comp = Array THEN OPM.WriteString(DupArrFunc); Ident(var); OPM.WriteString(Comma); @@ -1263,7 +1271,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) END; OPM.WriteString(Colon); END Case; - + PROCEDURE SetInclude* (exclude: BOOLEAN); BEGIN IF exclude THEN OPM.WriteString(" &= ~"); ELSE OPM.WriteString(" |= "); END; @@ -1286,7 +1294,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) IF dim # 0 THEN OPM.WriteInt(dim) END ELSE (* array *) WHILE dim > 0 DO array := array^.BaseTyp; DEC(dim) END ; - OPM.WriteInt(array^.n); OPM.PromoteIntConstToLInt() + OPM.WriteString("((LONGINT)("); OPM.WriteInt(array^.n); OPM.WriteString("))"); END END Len; @@ -1313,7 +1321,6 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) OPM.WriteInt(con^.intval) (* | Int8, Int16, Int32, Int64: OPM.WriteInt(con^.intval)*) - | Real: OPM.WriteReal(con^.realval, "f") | LReal: @@ -1397,7 +1404,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) Enter("volatile"); Enter("while"); -(* what about common predefined names from cpp as e.g. +(* what about common predefined names from cpp as e.g. Operating System: ibm, gcos, os, tss and unix Hardware: interdata, pdp11, u370, u3b, u3b2, u3b5, u3b15, u3b20d, diff --git a/src/compiler/OPM.cmdln.Mod b/src/compiler/OPM.cmdln.Mod index 313e5a70..6a02cc91 100644 --- a/src/compiler/OPM.cmdln.Mod +++ b/src/compiler/OPM.cmdln.Mod @@ -1,152 +1,138 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) -(* constants needed for C code generation +(* constants needed for C code generation 31.1.2007 jt synchronized with BlackBox version, in particular PromoteIntConstToLInt added *) - IMPORT SYSTEM, Texts := Texts0, Files := Files0, Args, Console, errors, version, vt100; + IMPORT SYSTEM, Texts, Files, Platform, Console, errors, Configuration, vt100, Strings; CONST OptionChar* = "-"; (* compiler options; don't change the encoding *) - inxchk* = 0; (* index check on *) - vcpp* = 1; (* VC++ support on; former ovflchk; neither used nor documented *) - ranchk* = 2; (* range check on *) - typchk* = 3; (* type check on *) - newsf* = 4; (* generation of new symbol file allowed *) - ptrinit* = 5; (* pointer initialization *) - ansi* = 6; (* ANSI or K&R style prototypes *) - assert* = 7; (* assert evaluation *) - include0* = 8; (* include M.h0 in header file and M.c0 in body file if such files exist *) - extsf* = 9; (* extension of old symbol file allowed *) - mainprog* = 10; (* translate module body into C main function *) - lineno* = 11; (* emit line numbers rather than text positions in error messages *) - useparfile* = 12; (* use .par file *) - dontasm* = 13; (* don't call external assembler/C compiler *) - dontlink* = 14; (* don't link *) - mainlinkstat* = 15; (* generate code for main module and then link object file statically *) + inxchk* = 0; (* index check on *) + ranchk* = 2; (* range check on *) + typchk* = 3; (* type check on *) + newsf* = 4; (* generation of new symbol file allowed *) + ptrinit* = 5; (* pointer initialization *) + ansi* = 6; (* ANSI or K&R style prototypes *) + assert* = 7; (* assert evaluation *) + extsf* = 9; (* extension of old symbol file allowed *) + mainprog* = 10; (* translate module body into C main function *) + dontasm* = 13; (* don't call external assembler/C compiler *) + dontlink* = 14; (* don't link *) + mainlinkstat* = 15; (* generate code for main module and then link object file statically *) notcoloroutput* = 16; (* turn off color output *) - forcenewsym* = 17; (* force new symbol file *) - verbose* = 18; (* verbose *) - defopt* = {inxchk, typchk, ptrinit, ansi, assert}; (* default options *) + forcenewsym* = 17; (* force new symbol file *) + verbose* = 18; (* verbose *) + defopt* = {inxchk, typchk, ptrinit, ansi, assert}; (* default options *) - nilval* = 0; -(* - MinRealPat = 0FF7FFFFFH; (* most negative, 32-bit pattern, -3.40282346E38 *) - MinLRealPatL = 0FFFFFFFFH; (* most negative, lower 32-bit pattern *) - MinLRealPatH = 0FFEFFFFFH; (* most negative, higher 32-bit pattern *) - MaxRealPat = 7F7FFFFFH; (*3.40282346E38*) - MaxLRealPatL = -1; - MaxLRealPatH = 7FEFFFFFH; -*) + nilval* = 0; - MaxRExp* = 38; MaxLExp* = 308; MaxHDig* = 8; + MaxRExp* = 38; + MaxLExp* = 308; + MaxHDig* = 8; - MinHaltNr* = 0; - MaxHaltNr* = 255; - MaxSysFlag* = 1; + MinHaltNr* = 0; + MaxHaltNr* = 255; + MaxSysFlag* = 1; - MaxCC* = -1; (* SYSTEM.CC, GETREG, PUTREG; not implementable in C backend *) - MinRegNr* = 0; - MaxRegNr* = -1; + MaxCC* = -1; (* SYSTEM.CC, GETREG, PUTREG; not implementable in C backend *) + MinRegNr* = 0; + MaxRegNr* = -1; - LANotAlloc* = -1; (* XProc link adr initialization *) - ConstNotAlloc* = -1; (* for allocation of string and real constants *) - TDAdrUndef* = -1; (* no type desc allocated *) + LANotAlloc* = -1; (* XProc link adr initialization *) + ConstNotAlloc* = -1; (* for allocation of string and real constants *) + TDAdrUndef* = -1; (* no type desc allocated *) - MaxCases* = 128; - MaxCaseRange* = 512; + MaxCases* = 128; + MaxCaseRange* = 512; - MaxStruct* = 255; + MaxStruct* = 255; (* maximal number of pointer fields in a record: *) - MaxPtr* = MAX(LONGINT); + MaxPtr* = MAX(LONGINT); (* maximal number of global pointers per module: *) - MaxGPtr* = MAX(LONGINT); + MaxGPtr* = MAX(LONGINT); (* maximal number of hidden fields in an exported record: *) - MaxHdFld* = 2048; - - HdPtrName* = "@ptr"; - HdProcName* = "@proc"; - HdTProcName* = "@tproc"; + MaxHdFld* = 2048; - ExpHdPtrFld* = TRUE; - ExpHdProcFld* = FALSE; - ExpHdTProc* = FALSE; + HdPtrName* = "@ptr"; + HdProcName* = "@proc"; + HdTProcName* = "@tproc"; - NEWusingAdr* = FALSE; + ExpHdPtrFld* = TRUE; + ExpHdProcFld* = FALSE; + ExpHdTProc* = FALSE; - Eot* = 0X; + NEWusingAdr* = FALSE; - SFext = ".sym"; (* symbol file extension *) - BFext = ".c"; (* body file extension *) - HFext = ".h"; (* header file extension *) - SFtag = 0F7X; (* symbol file tag *) + Eot* = 0X; - HeaderFile* = 0; - BodyFile* = 1; - HeaderInclude* = 2; + HeaderFile* = 0; + BodyFile* = 1; + HeaderInclude* = 2; + + SFext = ".sym"; (* symbol file extension *) + BFext = ".c"; (* body file extension *) + HFext = ".h"; (* header file extension *) + SFtag = 0F7X; (* symbol file tag *) TYPE FileName = ARRAY 32 OF CHAR; VAR SourceFileName : ARRAY 256 OF CHAR; + + Alignment*: INTEGER; + ByteSize*, CharSize*, BoolSize*, SIntSize*, IntSize*, LIntSize*, SetSize*, RealSize*, LRealSize*, PointerSize*, ProcSize*, RecSize*, - (*Int8Size*, Int16Size*, Int32Size*, Int64Size*,*) (* these are constants actually, we need it to pass to GetProperty function; -- noch *) CharAlign*, BoolAlign*, SIntAlign*, IntAlign*, - (*Int8Align*, Int16Align*, Int32Align*, Int64Align*,*) (* need this for SYSTEM types; -- noch *) LIntAlign*, SetAlign*, RealAlign*, LRealAlign*, PointerAlign*, ProcAlign*, RecAlign*, - ByteOrder*, BitOrder*, MaxSet*: INTEGER; + MaxSet*: INTEGER; + MinSInt*, MinInt*, MinLInt*, MaxSInt*, MaxInt*, MaxLInt*, MaxIndex*: LONGINT; - (*MinInt8*, MaxInt8*, MinInt16*, MaxInt16*, MinInt32*, MaxInt32* : LONGINT; - MinInt64*, MaxInt64* : SYSTEM.INT64;*) + MinReal*, MaxReal*, MinLReal*, MaxLReal*: LONGREAL; - noerr*: BOOLEAN; + noerr*: BOOLEAN; curpos*, errpos*: LONGINT; (* character and error position in source file *) - breakpc*: LONGINT; (* set by OPV.Init *) - currFile*: INTEGER; (* current output file *) - level*: INTEGER; (* procedure nesting level *) - pc*, entno*: INTEGER; (* entry number *) - modName*: ARRAY 32 OF CHAR; - objname*: ARRAY 64 OF CHAR; + breakpc*: LONGINT; (* set by OPV.Init *) + currFile*: INTEGER; (* current output file *) + level*: INTEGER; (* procedure nesting level *) + pc*, entno*: INTEGER; (* entry number *) + modName*: ARRAY 32 OF CHAR; + objname*: ARRAY 64 OF CHAR; + opt*, glbopt*: SET; - opt*, glbopt*: SET; + ErrorLineStartPos, ErrorLineLimitPos, ErrorLineNumber: LONGINT; (* Limit = start of next line *) - lasterrpos: LONGINT; - inR: Texts.Reader; - Log: Texts.Text; - W: Texts.Writer; + lasterrpos: LONGINT; + inR: Texts.Reader; + Log: Texts.Text; + W: Texts.Writer; oldSF, newSF: Files.Rider; - R: ARRAY 3 OF Files.Rider; + R: ARRAY 3 OF Files.Rider; + oldSFile, newSFile, HFile, BFile, HIFile: Files.File; S: INTEGER; - stop, useLineNo, useParFile, dontAsm-, dontLink-, mainProg-, mainLinkStat-, notColorOutput-, forceNewSym-, Verbose-: BOOLEAN; + + dontAsm-, dontLink-, mainProg-, mainLinkStat-, notColorOutput-, forceNewSym-, Verbose-: BOOLEAN; + + OBERON: ARRAY 1024 OF CHAR; + MODULES: ARRAY 1024 OF CHAR; (* ------------------------- Log Output ------------------------- *) - PROCEDURE LogW*(ch: CHAR); - BEGIN Console.Char(ch) - END LogW; - - PROCEDURE LogWStr*(s: ARRAY OF CHAR); - BEGIN Console.String(s) - END LogWStr; - - PROCEDURE LogWNum*(i, len: LONGINT); - BEGIN Console.Int(i, len) - END LogWNum; - - PROCEDURE LogWLn*; - BEGIN Console.Ln - END LogWLn; + PROCEDURE LogW*(ch: CHAR); BEGIN Console.Char(ch) END LogW; + PROCEDURE LogWStr*(s: ARRAY OF CHAR); BEGIN Console.String(s) END LogWStr; + PROCEDURE LogWNum*(i, len: LONGINT); BEGIN Console.Int(i, len) END LogWNum; + PROCEDURE LogWLn*; BEGIN Console.Ln END LogWLn; (* ------------------------- parameter handling -------------------------*) @@ -161,143 +147,168 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) | "s": opt := opt / {newsf} | "m": opt := opt / {mainprog} | "x": opt := opt / {inxchk} - | "v": opt := opt / {vcpp}; | "r": opt := opt / {ranchk} | "t": opt := opt / {typchk} | "a": opt := opt / {assert} - | "k": opt := opt / {ansi} + | "k": opt := opt / {ansi} (* undocumented *) | "p": opt := opt / {ptrinit} - | "i": opt := opt / {include0} - | "l": opt := opt / {lineno} - | "P": opt := opt / {useparfile} | "S": opt := opt / {dontasm} | "c": opt := opt / {dontlink} | "M": opt := opt / {mainlinkstat} | "f": opt := opt / {notcoloroutput} | "F": opt := opt / {forcenewsym} | "V": opt := opt / {verbose} - ELSE LogWStr(" warning: option "); LogW(OptionChar); LogW(s[i]); LogWStr(" ignored"); LogWLn - END ; + | "B": IF s[i+1] # 0X THEN INC(i); IntSize := ORD(s[i]) - ORD('0') END; + IF s[i+1] # 0X THEN INC(i); PointerSize := ORD(s[i]) - ORD('0') END; + IF s[i+1] # 0X THEN INC(i); Alignment := ORD(s[i]) - ORD('0') END; + ASSERT((IntSize = 2) OR (IntSize = 4)); + ASSERT((PointerSize = 4) OR (PointerSize = 8)); + ASSERT((Alignment = 4) OR (Alignment = 8)) + ELSE + LogWStr(" warning: option "); + LogW(OptionChar); + LogW(s[i]); + LogWStr(" ignored"); + LogWLn + END; INC(i) END; END ScanOptions; + PROCEDURE ^GetProperties; - PROCEDURE OpenPar*; (* prepare for a sequence of translations *) + + (* Undocumented options used by the build system: + + The following two parameter overrides the integer size, pointer size and alignment + settings compiled into the binary. They are used when bootstrapping to generate + the C source for a compiler with different sizes to the current compiler. + + -Bnnn Where each n is a single digit specifying the integer size, pointer size + and alignment in bytes. + + An alignment of n means that types smaller than n align to their + own size, types larger than n align to n bytes. + + LONGINT size will be set to twice the integer size. + *) + + PROCEDURE OpenPar*(): BOOLEAN; (* prepare for a sequence of translations *) VAR s: ARRAY 256 OF CHAR; BEGIN - IF Args.argc = 1 THEN stop := TRUE; - Console.Ln; - Console.String("voc - Vishap Oberon-2 compiler "); - Console.String(version.version); Console.String (" "); - Console.String(version.date); Console.String (" for "); Console.String(version.arch); - Console.Ln; - Console.String("based on Ofront by Software Templ OEG"); Console.Ln; - Console.String("continued by Norayr Chilingarian and others"); Console.Ln; - Console.Ln; - Console.String(' command = "voc" options {file options}.'); Console.Ln; - Console.String(' options = ["-" {option} ].'); Console.Ln; - Console.String(' option = "m" | "M" | "s" | "e" | "i" | "l" | "k" | "r" | "x" | "a" | "p" | "t" | "P" | "S" | "c" | "f" | "F" | "V" .'); Console.Ln; - Console.Ln; - Console.String(" m - generate code for main module"); Console.Ln; - Console.String(" M - generate code for main module and link object statically"); Console.Ln; - Console.String(" s - generate new symbol file"); Console.Ln; - Console.String(" e - allow extending the module interface"); Console.Ln; - Console.String(" i - include header and body prefix files (c0)"); Console.Ln; - Console.String(" l - use line numbers"); Console.Ln; - Console.String(" r - check value ranges"); Console.Ln; - Console.String(" x - turn off array indices check"); Console.Ln; - Console.String(" a - don't check ASSERTs at runtime, use this option in tested production code"); Console.Ln; - Console.String(" p - turn off automatic pointer initialization"); Console.Ln; - Console.String(" t - don't check type guards (use in rare cases such as low-level modules where every cycle counts)"); Console.Ln; - Console.String(" P - use .par file"); Console.Ln; - Console.String(" S - don't call external assembler/compiler, only generate the asm/C code"); Console.Ln; - Console.String(" c - don't call linker"); Console.Ln; - Console.String(" f - don't use color output"); Console.Ln; - Console.String(" F - force writing new symbol file"); Console.Ln; - Console.String(" V - verbose output"); Console.Ln; - Console.Ln; + IF Platform.ArgCount = 1 THEN + LogWLn; + LogWStr("Vishap Oberon-2 compiler v"); LogWStr(Configuration.versionLong); LogW("."); LogWLn; + LogWStr("Based on Ofront by Software Templ OEG, continued by Norayr Chilingarian and others."); LogWLn; + LogWLn; + LogWStr('Usage:'); LogWLn; LogWLn; + LogWStr(' '); LogWStr(Configuration.name); LogWStr(' options {files {options}}.'); LogWLn; LogWLn; + LogWStr('Where options = ["-" {option} ].'); LogWLn; + LogWLn; + LogWStr(" m - generate code for main module"); LogWLn; + LogWStr(" M - generate code for main module and link object statically"); LogWLn; + LogWStr(" s - generate new symbol file"); LogWLn; + LogWStr(" e - allow extending the module interface"); LogWLn; + LogWStr(" r - check value ranges"); LogWLn; + LogWStr(" x - turn off array indices check"); LogWLn; + LogWStr(" a - don't check ASSERTs at runtime, use this option in tested production code"); LogWLn; + LogWStr(" p - turn off automatic pointer initialization"); LogWLn; + LogWStr(" t - don't check type guards (use in rare cases such as low-level modules where every cycle counts)"); LogWLn; + LogWStr(" S - don't call external assembler/compiler, only generate C code"); LogWLn; + LogWStr(" c - don't call linker"); LogWLn; + LogWStr(" f - don't use color output"); LogWLn; + LogWStr(" F - force writing new symbol file in current directory"); LogWLn; + LogWStr(" V - verbose output"); LogWLn; + LogWLn; + LogWStr('Initial options specify defaults for all files.'); LogWLn; + LogWStr('Options following a filename are specific to that file.'); LogWLn; + LogWStr('Repeating an option toggles its value.'); LogWLn; + RETURN FALSE ELSE - glbopt := defopt; S := 1; s := ""; - Args.Get(1, s); stop := FALSE; - WHILE s[0] = OptionChar DO ScanOptions(s, glbopt); INC(S); s := ""; Args.Get(S, s) END; - IF lineno IN opt THEN (* this brought here from InitOptions which turned out to be unnecessary *) - useLineNo := TRUE; curpos := 256; errpos := curpos; - lasterrpos := curpos - 10 - ELSE - useLineNo := FALSE; - END; - IF useparfile IN glbopt THEN useParFile := TRUE ELSE useParFile := FALSE END; (* this check must be made before calling getproperties, noch *) - IF dontasm IN glbopt THEN dontAsm := TRUE ELSE dontAsm := FALSE END; - IF dontlink IN glbopt THEN dontLink := TRUE ELSE dontLink := FALSE END; - IF mainprog IN glbopt THEN mainProg := TRUE ELSE mainProg := FALSE END; - IF mainlinkstat IN glbopt THEN INCL(glbopt, mainprog); mainLinkStat := TRUE ELSE mainLinkStat := FALSE END; - IF notcoloroutput IN glbopt THEN notColorOutput := TRUE ELSE notColorOutput := FALSE END; - IF forcenewsym IN glbopt THEN forceNewSym := TRUE ELSE forceNewSym := FALSE END; - IF verbose IN glbopt THEN Verbose := TRUE ELSE Verbose := FALSE END; - GetProperties; (* GetProperties moved here in order to call it after ScanOptions because we have an option whether to use par file or not, noch *) + S:=1; s:=""; Platform.GetArg(S, s); + glbopt := defopt; + + WHILE s[0] = OptionChar DO + ScanOptions(s, glbopt); + INC(S); s:=""; Platform.GetArg(S, s) + END; + + RETURN TRUE END; END OpenPar; + PROCEDURE InitOptions*; (* get the options for one translation *) VAR s: ARRAY 256 OF CHAR; BEGIN - opt := glbopt; s := ""; Args.Get(S, s); - WHILE s[0] = OptionChar DO ScanOptions(s, opt); INC(S); s := ""; Args.Get(S, s) END ; - IF lineno IN opt THEN useLineNo := TRUE; curpos := 256; errpos := curpos; lasterrpos := curpos - 10 - ELSE useLineNo := FALSE; + opt := glbopt; + s:=""; Platform.GetArg(S, s); + WHILE s[0] = OptionChar DO + ScanOptions(s, opt); + INC(S); s:=""; Platform.GetArg(S, s) END; - IF useparfile IN opt THEN useParFile := TRUE ELSE useParFile := FALSE END; (* this check must be made before calling getproperties, noch *) - IF dontasm IN opt THEN dontAsm := TRUE ELSE dontAsm := FALSE END; - IF dontlink IN opt THEN dontLink := TRUE ELSE dontLink := FALSE END; - IF mainprog IN opt THEN mainProg := TRUE ELSE mainProg := FALSE END; - IF mainlinkstat IN opt THEN INCL(glbopt, mainprog); mainLinkStat := TRUE ELSE mainLinkStat := FALSE END; - IF forcenewsym IN glbopt THEN forceNewSym := TRUE ELSE forceNewSym := FALSE END; - IF verbose IN glbopt THEN Verbose := TRUE ELSE Verbose := FALSE END; + dontAsm := dontasm IN opt; + dontLink := dontlink IN opt; + mainProg := mainprog IN opt; + mainLinkStat := mainlinkstat IN opt; + notColorOutput := notcoloroutput IN opt; + forceNewSym := forcenewsym IN opt; + Verbose := verbose IN opt; + + IF mainLinkStat THEN INCL(glbopt, mainprog) END; (* sic *) + + GetProperties; END InitOptions; + PROCEDURE Init*(VAR done: BOOLEAN; VAR mname : ARRAY OF CHAR); (* get the source for one translation *) - VAR T: Texts.Text; beg, end, time: LONGINT; - s: ARRAY 256 OF CHAR; + VAR + T: Texts.Text; + beg, end, time: LONGINT; + s: ARRAY 256 OF CHAR; BEGIN - done := FALSE; curpos := 0; - IF stop OR (S >= Args.argc) THEN RETURN END ; - s := ""; Args.Get(S, s); + done := FALSE; + curpos := 0; + IF S >= Platform.ArgCount THEN RETURN END ; + + s:=""; Platform.GetArg(S, s); + NEW(T); Texts.Open(T, s); - LogWStr(s); + LogWStr(s); LogWStr(" "); COPY(s, mname); COPY(s, SourceFileName); (* to keep it also in this module -- noch *) - IF T.len = 0 THEN LogWStr(" not found"); LogWLn + + IF T.len = 0 THEN + LogWStr(s); LogWStr(" not found."); LogWLn ELSE Texts.OpenReader(inR, T, 0); - LogWStr(" translating"); done := TRUE - END ; + END; + INC(S); level := 0; noerr := TRUE; errpos := curpos; lasterrpos := curpos -10; + ErrorLineStartPos := 0; ErrorLineLimitPos := 0; ErrorLineNumber := 0; END Init; + + (* ------------------------- read source text -------------------------*) - + PROCEDURE Get*(VAR ch: CHAR); (* read next character from source text, 0X if eof *) BEGIN Texts.Read(inR, ch); - IF useLineNo THEN - IF ch = 0DX THEN curpos := (curpos DIV 256 + 1) * 256 - ELSIF curpos MOD 256 # 255 THEN INC(curpos) - (* at 255 means: >= 255 *) - END - ELSIF ch = 0DX THEN + IF ch = 0DX THEN curpos := Texts.Pos(inR); (* supports CR LF mapping *) ELSE INC(curpos) END ; IF (ch < 09X) & ~inR.eot THEN ch := " " END END Get; - + + PROCEDURE MakeFileName(VAR name, FName: ARRAY OF CHAR; ext: ARRAY OF CHAR); VAR i, j: INTEGER; ch: CHAR; BEGIN i := 0; @@ -310,15 +321,18 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) UNTIL ch = 0X END MakeFileName; + PROCEDURE LogErrMsg(n: INTEGER); - VAR S: Texts.Scanner; T: Texts.Text; ch: CHAR; i: INTEGER; + VAR + S: Texts.Scanner; T: Texts.Text; + ch: CHAR; i: INTEGER; buf: ARRAY 1024 OF CHAR; BEGIN - IF n >= 0 THEN + IF n >= 0 THEN IF ~notColorOutput THEN vt100.SetAttr(vt100.Red) END; LogWStr(" err "); IF ~notColorOutput THEN vt100.SetAttr(vt100.ResetAll) END; - ELSE + ELSE IF ~notColorOutput THEN vt100.SetAttr(vt100.Magenta) END; LogWStr(" warning "); n := -n; IF ~notColorOutput THEN vt100.SetAttr(vt100.ResetAll) END; @@ -336,243 +350,129 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) LogWStr(errors.errors[n]); END LogErrMsg; - PROCEDURE ShowLine(pos: LONGINT); - VAR - f : Files.File; - r : Files.Rider; - newpos, localpos, delta : LONGINT; - line : ARRAY 1023 OF CHAR; - i : INTEGER; - ch : CHAR; + + PROCEDURE FindLine(f: Files.File; VAR r: Files.Rider; pos: LONGINT); + (* Updates ErrorLineStartPos, ErrorLineLimitPos, ErrorLineNumber to + describe the line containing pos. + Exits with the rider set to the start of the line conaining pos. *) + VAR + ch, cheol: CHAR; BEGIN - localpos := pos; - f := Files.Old(SourceFileName); + IF pos < ErrorLineStartPos THEN (* Desired position is before saved position, start again at the begnning of file *) + ErrorLineStartPos := 0; ErrorLineLimitPos := 0; ErrorLineNumber := 0 + END; + IF pos < ErrorLineLimitPos THEN (* Current saved line positions contain pos *) + Files.Set(r, f, ErrorLineStartPos); + RETURN + END; - (* - Console.Ln; Console.String("-- source file is "); Console.String(SourceFileName); Console.Ln; - Console.String("-- pos is "); Console.Int(pos, 0); Console.Ln; - *) - (* make sure previous character is character *) - REPEAT - DEC(localpos); IF localpos < 0 THEN localpos := 0 END; - Files.Set(r, f, localpos); - Files.Read(r, ch); - UNTIL (localpos < 1) OR(ORD(ch) >= 32) OR (ORD(ch)=9); - newpos := localpos; - (* - Console.String("-- newpos, last character before error "); Console.Int(newpos, 0); Console.Ln; - *) - (* finding last line end *) - REPEAT - DEC(localpos); IF localpos < 0 THEN newpos := 0 END; - Files.Set(r, f, localpos); - Files.Read(r, ch); -(* - Console.String("-- prev num "); Console.Int(localpos, 0);Console.String(" "); Console.Char(ch); Console.Ln; -*) - UNTIL (localpos < 1) OR ((ORD(ch) < 32) & (ORD(ch) # 9)); -(* - Console.String("-- previous line at pos "); Console.Int(localpos, 0); Console.Ln; -*) - delta := newpos - localpos - 1; - IF delta < 1 THEN delta := 1 END; - (* - Console.String("-- delta "); Console.Int(delta, 0); Console.Ln; -*) - (* skip enter *) - REPEAT - INC(localpos); - Files.Set(r, f, localpos); - Files.Read(r, ch); - UNTIL (ORD(ch) >= 32) OR (ORD(ch) = 9); - i := 0; - REPEAT - Files.Set(r, f, localpos); - Files.Read(r, ch); - IF ORD(ch) = 9 THEN ch := " " END; - line[i] := ch; -(* - Console.String("-- localpos "); Console.Int(localpos, 0); Console.Ln; - Console.String(" -- ch "); Console.Char(ch); Console.Ln; -*) - INC(localpos); - INC(i); - UNTIL r.eof OR (i >= 1022) OR ((ORD(ch) < 32) & (ORD(ch) # 9)); - line[i] := 0X; - IF (line[i-1] = 0AX) OR (line[i-1] = 0DX) THEN line[i-1] := 0X END; - (*Console.String(" -- length of line "); Console.Int(i, 0); Console.Ln;*) - Console.Ln; Console.Ln; Console.String(" "); Console.String(line); - Console.Ln; + Files.Set(r, f, ErrorLineLimitPos); + Files.Read(r, ch); + WHILE (ErrorLineLimitPos < pos) & ~r.eof DO + ErrorLineStartPos := ErrorLineLimitPos; + INC(ErrorLineNumber); + WHILE (ch # 0X) & (ch # 0DX) & (ch # 0AX) DO + Files.Read(r, ch); INC(ErrorLineLimitPos) + END; + cheol := ch; Files.Read(r, ch); INC(ErrorLineLimitPos); + IF (cheol = 0DX) & (ch = 0AX) THEN + INC(ErrorLineLimitPos); Files.Read(r, ch) + END + END; + Files.Set(r, f, ErrorLineStartPos); + END FindLine; - i := 0; - Console.String(" "); - REPEAT - Console.Char(" "); - INC(i); - UNTIL i >= delta; - IF ~notColorOutput THEN vt100.SetAttr(vt100.Green) END; - Console.Char("^"); (*Console.Ln;*) + + PROCEDURE ShowLine(pos: LONGINT); + VAR + f: Files.File; + r: Files.Rider; + line: ARRAY 1023 OF CHAR; + i: INTEGER; + ch: CHAR; + BEGIN + f := Files.Old(SourceFileName); + FindLine(f, r, pos); + + i := 0; Files.Read(r, ch); + WHILE (ch # 0X) & (ch # 0DX) & (ch # 0AX) & (i < LEN(line)-1) DO + line[i] := ch; INC(i); Files.Read(r, ch) + END; + line[i] := 0X; + + LogWLn; LogWLn; + LogWNum(ErrorLineNumber, 4); LogWStr(": "); LogWStr(line); LogWLn; + LogWStr(" "); + + IF pos >= ErrorLineLimitPos THEN pos := ErrorLineLimitPos-1 END; + i := SHORT(pos - ErrorLineStartPos); + WHILE i > 0 DO LogW(" "); DEC(i) END; + + IF ~notColorOutput THEN vt100.SetAttr(vt100.Green) END; + LogW("^"); IF ~notColorOutput THEN vt100.SetAttr(vt100.ResetAll) END; - Files.Close(f); + Files.Close(f); END ShowLine; - PROCEDURE ShowLineErr(linenum, posnum : LONGINT); - VAR - f : Files.File; - r : Files.Rider; - line : ARRAY 1023 OF CHAR; - i,j : LONGINT; - ch : CHAR; - BEGIN - - f := Files.Old(SourceFileName); - Files.Set(r, f, 0); - - (* skip non character symbols in the beginning *) - REPEAT - Files.Read(r, ch); - UNTIL ORD(ch) > 31; - - i := 0; j := 0; - REPEAT - IF (ORD(ch) > 31) OR (ORD(ch) = 9) THEN - IF ORD(ch)=9 THEN ch := " " END; - line[i] := ch; INC(i); line[i+1] := 0X; - Files.Read(r, ch); - ELSE - IF (ch = 0AX) OR (ch = 0DX) THEN - Files.Read(r, ch); - IF (ch = 0AX) OR (ch = 0DX) THEN - Files.Read(r, ch); - ELSE - INC(j); i := 0 - END - END - END; - (* - Console.Ln; Console.String("-- line["); Console.Int(i-1, 0); Console.String("] = "); Console.Char(ch); Console.Ln; -*) - (* - Console.String("-- i "); Console.Int(i, 0); Console.Ln; - - Console.String("--j "); Console.Int(j, 0); Console.Ln; - - Console.Char(ch); Console.Ln; -*) - UNTIL (j >= linenum) OR (i >= 1022) OR r.eof; - - Console.Ln; Console.String(" "); Console.String(line); Console.Ln; - - i := 0; - WHILE i < posnum-1 DO - Console.Char(" "); - INC(i); - END; - - Console.String(" "); (* compensate shift from Mark() ; -- noch *) - IF ~notColorOutput THEN vt100.SetAttr(vt100.Green) END; - Console.Char("^"); Console.Ln; - IF ~notColorOutput THEN vt100.SetAttr(vt100.ResetAll) END; - - Files.Close(f); - - END ShowLineErr; PROCEDURE Mark*(n: INTEGER; pos: LONGINT); - VAR - linenumber, posnumber : LONGINT; BEGIN IF pos = -1 THEN pos := 0 END; - - linenumber := pos DIV 256; - posnumber := pos MOD 256; -(* - Console.Ln; Console.String("-- linenumber "); Console.Int(linenumber, 0); Console.Ln; - Console.String("-- posnumber "); Console.Int(posnumber, 0); Console.Ln; -*) - IF useLineNo THEN - IF n >= 0 THEN - noerr := FALSE; -(* - Console.String("n = "); Console.Int(n, 0); Console.Ln; -*) - IF (pos < lasterrpos) OR (lasterrpos + 9 < pos) THEN lasterrpos := pos; LogWLn; LogWStr(" "); - IF n < 249 THEN ShowLineErr(linenumber, posnumber); LogWStr(" line "); LogWNum(linenumber, 1); - LogWStr(" pos "); LogWNum(posnumber, 1); LogErrMsg(n) - ELSIF n = 255 THEN ShowLineErr(linenumber, posnumber); LogWStr(" line "); LogWNum(linenumber, 1); - LogWStr(" pos "); LogWNum(posnumber, 1); LogWStr(" pc "); LogWNum(breakpc, 1) - ELSIF n = 254 THEN LogWStr("pc not found") - ELSE LogWStr(objname); - IF n = 253 THEN LogWStr(" is new, compile with option e") - ELSIF n = 252 THEN LogWStr(" is redefined, compile with option s") - ELSIF n = 251 THEN LogWStr(" is redefined (private part only), compile with option s") - ELSIF n = 250 THEN LogWStr(" is no longer visible, compile with option s") - ELSIF n = 249 THEN LogWStr(" is not consistently imported, recompile imports") - END + IF n >= 0 THEN + noerr := FALSE; + IF (pos < lasterrpos) OR (lasterrpos + 9 < pos) THEN lasterrpos := pos; ShowLine(pos); LogWLn; LogWStr(" "); + IF n < 249 THEN LogWStr(" pos"); LogWNum(pos, 6); LogErrMsg(n) + ELSIF n = 255 THEN LogWStr("pos"); LogWNum(pos, 6); LogWStr(" pc "); LogWNum(breakpc, 1) + ELSIF n = 254 THEN LogWStr("pc not found") + ELSE LogWStr(objname); + IF n = 253 THEN LogWStr(" is new, compile with option e") + ELSIF n = 252 THEN LogWStr(" is redefined, compile with option s") + ELSIF n = 251 THEN LogWStr(" is redefined (private part only), compile with option s") + ELSIF n = 250 THEN LogWStr(" is no longer visible, compile with option s") + ELSIF n = 249 THEN LogWStr(" is not consistently imported, recompile imports") END END - ELSE - ShowLineErr(linenumber, posnumber); - IF pos >= 0 THEN LogWLn; - LogWStr(" line "); LogWNum(pos DIV 256, 1); LogWStr(" pos "); LogWNum(pos MOD 256, 1) - END ; - LogErrMsg(n); - IF pos < 0 THEN LogWLn END END ELSE - IF n >= 0 THEN - noerr := FALSE; - IF (pos < lasterrpos) OR (lasterrpos + 9 < pos) THEN lasterrpos := pos; ShowLine(pos); LogWLn; LogWStr(" "); - IF n < 249 THEN LogWStr(" pos"); LogWNum(pos, 6); LogErrMsg(n) - ELSIF n = 255 THEN LogWStr("pos"); LogWNum(pos, 6); LogWStr(" pc "); LogWNum(breakpc, 1) - ELSIF n = 254 THEN LogWStr("pc not found") - ELSE LogWStr(objname); - IF n = 253 THEN LogWStr(" is new, compile with option e") - ELSIF n = 252 THEN LogWStr(" is redefined, compile with option s") - ELSIF n = 251 THEN LogWStr(" is redefined (private part only), compile with option s") - ELSIF n = 250 THEN LogWStr(" is no longer visible, compile with option s") - ELSIF n = 249 THEN LogWStr(" is not consistently imported, recompile imports") - END - END - END - ELSE - IF pos >= 0 THEN ShowLine(pos); LogWLn; LogWStr(" pos"); LogWNum(pos, 6) END ; - LogErrMsg(n); - IF pos < 0 THEN LogWLn END - END + IF pos >= 0 THEN ShowLine(pos); LogWLn; LogWStr(" pos"); LogWNum(pos, 6) END ; + LogErrMsg(n); + IF pos < 0 THEN LogWLn END END END Mark; + PROCEDURE err*(n: INTEGER); - BEGIN - IF useLineNo & (errpos MOD 256 = 255) THEN (* line underflow from OPS.Get *) - Mark(n, errpos + 1) - ELSE - Mark(n, errpos) - END + BEGIN Mark(n, errpos) END err; + PROCEDURE FPrint*(VAR fp: LONGINT; val: LONGINT); BEGIN fp := SYSTEM.ROT(SYSTEM.VAL(LONGINT, SYSTEM.VAL(SET, fp) / SYSTEM.VAL(SET, val)), 1) END FPrint; + PROCEDURE FPrintSet*(VAR fp: LONGINT; set: SET); BEGIN FPrint(fp, SYSTEM.VAL(LONGINT, set)) END FPrintSet; + PROCEDURE FPrintReal*(VAR fp: LONGINT; real: REAL); BEGIN FPrint(fp, SYSTEM.VAL(LONGINT, real)) END FPrintReal; + PROCEDURE FPrintLReal*(VAR fp: LONGINT; lr: LONGREAL); - VAR l, h: LONGINT; + VAR l, h: LONGINT; BEGIN SYSTEM.GET(SYSTEM.ADR(lr), l); SYSTEM.GET(SYSTEM.ADR(lr)+4, h); FPrint(fp, l); FPrint(fp, h) END FPrintLReal; + + + (* ------------------------- initialization ------------------------- *) PROCEDURE GetProperty(VAR S: Texts.Scanner; name: ARRAY OF CHAR; VAR size, align: INTEGER); @@ -585,12 +485,12 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) END GetProperty; - PROCEDURE minus(i: LONGINT): LONGINT; BEGIN - RETURN -i; + RETURN -i; END minus; + PROCEDURE power0(i, j : LONGINT) : LONGINT; (* we would like to calculate exact Min Max values in GetProperties, not hardcode em, noch *) VAR k : LONGINT; p : LONGINT; @@ -604,241 +504,125 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) RETURN p; END power0; + PROCEDURE VerboseListSizes; BEGIN - Console.String("Type Size Alignement"); Console.Ln; - Console.String("CHAR "); Console.Int(CharSize, 0); Console.Int(CharAlign, 5); Console.Ln; - Console.String("BOOLEAN "); Console.Int(BoolSize, 0); Console.Int(BoolAlign, 5); Console.Ln; - Console.String("SHORTINT "); Console.Int(SIntSize, 0); Console.Int(SIntAlign, 5); Console.Ln; - Console.String("INTEGER "); Console.Int(IntSize, 0); Console.Int(IntAlign, 5); Console.Ln; - Console.String("LONGINT "); Console.Int(LIntSize, 0); Console.Int(LIntAlign, 5); Console.Ln; - Console.String("SET "); Console.Int(SetSize, 0); Console.Int(SetAlign, 5); Console.Ln; - Console.String("REAL "); Console.Int(RealSize, 0); Console.Int(RealAlign, 5); Console.Ln; - Console.String("LONGREAL "); Console.Int(LRealSize, 0); Console.Int(LRealAlign, 5); Console.Ln; - Console.String("PTR "); Console.Int(PointerSize, 0); Console.Int(PointerAlign, 5); Console.Ln; - Console.String("PROC "); Console.Int(ProcSize, 0); Console.Int(ProcAlign, 5); Console.Ln; - Console.String("RECORD "); Console.Int(RecSize, 0); Console.Int(RecAlign, 5); Console.Ln; - Console.String("ENDIAN "); Console.Int(ByteOrder, 0); Console.Int(BitOrder, 5); Console.Ln; - (* - Console.String("SYSTEM.INT8 "); Console.Int(Int8Size, 0); Console.Int(Int8Align, 5); Console.Ln; - Console.String("SYSTEM.INT16 "); Console.Int(Int16Size, 0); Console.Int(Int16Align, 5); Console.Ln; - Console.String("SYSTEM.INT32 "); Console.Int(Int32Size, 0); Console.Int(Int32Align, 5); Console.Ln; - Console.String("SYSTEM.INT64 "); Console.Int(Int64Size, 0); Console.Int(Int64Align, 5); Console.Ln; - *) - Console.Ln; - Console.String("Min shortint "); Console.Int(MinSInt, 0); Console.Ln; - Console.String("Max shortint "); Console.Int(MaxSInt, 0); Console.Ln; - Console.String("Min integer "); Console.Int(MinInt, 0); Console.Ln; - Console.String("Max integer "); Console.Int(MaxInt, 0); Console.Ln; - Console.String("Min longint "); Console.Int(MinLInt, 0); Console.Ln; - (* - Console.String("Max longint "); Console.Int(MaxLInt, 0); Console.Ln; - Console.String("Min int8 "); Console.Int(MinInt8, 0); Console.Ln; - Console.String("Max int8 "); Console.Int(MaxInt8, 0); Console.Ln; - Console.String("Min int16 "); Console.Int(MinInt16, 0); Console.Ln; - Console.String("Max int16 "); Console.Int(MaxInt16, 0); Console.Ln; - Console.String("Min int32 "); Console.Int(MinInt32, 0); Console.Ln; - Console.String("Max int32 "); Console.Int(MaxInt32, 0); Console.Ln; - *) - + LogWLn; + LogWStr("Type Size Alignement"); LogWLn; + LogWStr("CHAR "); LogWNum(CharSize, 4); LogWNum(CharAlign, 5); LogWLn; + LogWStr("BOOLEAN "); LogWNum(BoolSize, 4); LogWNum(BoolAlign, 5); LogWLn; + LogWStr("SHORTINT "); LogWNum(SIntSize, 4); LogWNum(SIntAlign, 5); LogWLn; + LogWStr("INTEGER "); LogWNum(IntSize, 4); LogWNum(IntAlign, 5); LogWLn; + LogWStr("LONGINT "); LogWNum(LIntSize, 4); LogWNum(LIntAlign, 5); LogWLn; + LogWStr("SET "); LogWNum(SetSize, 4); LogWNum(SetAlign, 5); LogWLn; + LogWStr("REAL "); LogWNum(RealSize, 4); LogWNum(RealAlign, 5); LogWLn; + LogWStr("LONGREAL "); LogWNum(LRealSize, 4); LogWNum(LRealAlign, 5); LogWLn; + LogWStr("PTR "); LogWNum(PointerSize, 4); LogWNum(PointerAlign, 5); LogWLn; + LogWStr("PROC "); LogWNum(ProcSize, 4); LogWNum(ProcAlign, 5); LogWLn; + LogWStr("RECORD "); LogWNum(RecSize, 4); LogWNum(RecAlign, 5); LogWLn; + (*LogWStr("ENDIAN "); LogWNum(ByteOrder, 4); LogWNum(BitOrder, 5); LogWLn;*) + LogWLn; + LogWStr("Min shortint "); LogWNum(MinSInt, 4); LogWLn; + LogWStr("Max shortint "); LogWNum(MaxSInt, 4); LogWLn; + LogWStr("Min integer "); LogWNum(MinInt, 4); LogWLn; + LogWStr("Max integer "); LogWNum(MaxInt, 4); LogWLn; + LogWStr("Min longint "); LogWNum(MinLInt, 4); LogWLn; END VerboseListSizes; + + PROCEDURE Min(a,b: INTEGER): INTEGER; + BEGIN IF a= version.gnuarmv6j) & (version.defaultTarget <= version.gnuarmv7ahardfp) THEN - Console.String (" GNU "); - Console.String (version.arch); Console.String (" target"); Console.Ln; - ByteSize := 1; CharSize := 1; BoolSize := 1; SIntSize := 1; IntSize := 2; LIntSize := 4; - SetSize := 4; RealSize := 4; LRealSize := 8; ProcSize := 4; PointerSize := 4; RecSize := 1; - CharAlign := 1; BoolAlign := 1; SIntAlign := 1; IntAlign := 2; LIntAlign := 4; - (*Int8Align := 1; Int16Align := 2; Int32Align := 4; Int64Align := 4;*) - SetAlign := 4; RealAlign := 4; LRealAlign := 8; ProcAlign := 4; PointerAlign := 4; RecAlign := 1; + (* Fixed and Configuration.Mod based sizes have been initialised in + the module startup code, and maybe overridden by the -Bnnn bootstrap + parameter *) - (* not necessary, we will calculate values later - MinSInt := -80H; MinInt := -8000H; MinLInt := 80000000H; (*-2147483648*) - MaxSInt := 7FH; MaxInt := 7FFFH; MaxLInt := 7FFFFFFFH; (*2147483647*) - MaxSet := SetSize * 8 -1; (* noch *) - *) - ELSIF (version.defaultTarget = version.gnupowerpc) THEN - Console.String (" GNU "); - Console.String (version.arch); Console.String (" target"); Console.Ln; - ByteSize := 1; CharSize := 1; BoolSize := 1; SIntSize := 1; IntSize := 2; LIntSize := 4; - SetSize := 4; RealSize := 4; LRealSize := 8; ProcSize := 4; PointerSize := 4; RecSize := 1; - CharAlign := 1; BoolAlign := 1; SIntAlign := 1; IntAlign := 2; LIntAlign := 4; + (* Derived sizes *) + ProcSize := PointerSize; + LIntSize := IntSize * 2; + SetSize := LIntSize; - (*Int8Align := 1; Int16Align := 2; Int32Align := 4; Int64Align := 4;*) - SetAlign := 4; RealAlign := 4; LRealAlign := 8; ProcAlign := 4; PointerAlign := 4; RecAlign := 1; + (* Calculate all type alignments *) + CharAlign := Min(Alignment, CharSize); + BoolAlign := Min(Alignment, BoolSize); + SIntAlign := Min(Alignment, SIntSize); + RecAlign := Min(Alignment, RecSize); + RealAlign := Min(Alignment, RealSize); + LRealAlign := Min(Alignment, LRealSize); + PointerAlign := Min(Alignment, PointerSize); + ProcAlign := Min(Alignment, ProcSize); + IntAlign := Min(Alignment, IntSize); + LIntAlign := Min(Alignment, LIntSize); + SetAlign := Min(Alignment, SetSize); - - ELSIF version.defaultTarget = version.gnux86 THEN - Console.String("GNU "); Console.String(version.arch); Console.String(" target"); Console.Ln; - ByteSize := 1; CharSize := 1; BoolSize := 1; SIntSize := 1; IntSize := 2; LIntSize := 4; - SetSize := 4; RealSize := 4; LRealSize := 8; ProcSize := 4; PointerSize := 4; RecSize := 1; - CharAlign := 1; BoolAlign := 1; SIntAlign := 1; IntAlign := 2; LIntAlign := 4; - - (*Int8Align := 1; Int16Align := 2; Int32Align := 4; Int64Align := 4;*) - SetAlign := 4; RealAlign := 4; LRealAlign := 4; ProcAlign := 4; PointerAlign := 4; RecAlign := 1; - - ELSE (* this should suite any gnu x86 system *) - Console.String (" generic target, like GNU x86 system"); Console.Ln; - ByteSize := 1; CharSize := 1; BoolSize := 1; SIntSize := 1; IntSize := 2; LIntSize := 4; - SetSize := 4; RealSize := 4; LRealSize := 8; ProcSize := 4; PointerSize := 4; RecSize := 1; - CharAlign := 1; BoolAlign := 1; SIntAlign := 1; IntAlign := 2; LIntAlign := 4; - - (*Int8Align := 1; Int16Align := 2; Int32Align := 4; Int64Align := 4;*) - SetAlign := 4; RealAlign := 4; LRealAlign := 4; ProcAlign := 4; PointerAlign := 4; RecAlign := 1; -(* LRealAlign should be checked and confirmed *) - (* not necessary, will be calculated later - MinSInt := -80H; MinInt := -8000H; MinLInt := 80000000H; (*-2147483648*) - MaxSInt := 7FH; MaxInt := 7FFFH; MaxLInt := 7FFFFFFFH; (*2147483647*) - MaxSet := SetSize * 8 - 1; - *) - - END; (* if defaultTarget *) - END; (* if ~useParFile *) - (* read voc.par *) - - IF useParFile THEN (* noch *) - IF Verbose THEN Console.String ("loading type sizes from voc.par"); Console.Ln; END; - NEW(T); Texts.Open(T, "voc.par"); - IF T.len # 0 THEN - Texts.OpenScanner(S, T, 0); Texts.Scan(S); - GetProperty(S, "CHAR", CharSize, CharAlign); - GetProperty(S, "BOOLEAN", BoolSize, BoolAlign); - GetProperty(S, "SHORTINT", SIntSize, SIntAlign); - GetProperty(S, "INTEGER", IntSize, IntAlign); - GetProperty(S, "LONGINT", LIntSize, LIntAlign); - GetProperty(S, "SET", SetSize, SetAlign); - GetProperty(S, "REAL", RealSize, RealAlign); - GetProperty(S, "LONGREAL", LRealSize, LRealAlign); - GetProperty(S, "PTR", PointerSize, PointerAlign); - GetProperty(S, "PROC", ProcSize, ProcAlign); - GetProperty(S, "RECORD", RecSize, RecAlign); - (* Size = 0: natural size aligned to next power of 2 up to RecAlign; e.g. i960 - Size = 1; size and alignment follows from field types but at least RecAlign; e.g, SPARC, MIPS, PowerPC - *) - GetProperty(S, "ENDIAN", ByteOrder, BitOrder); (*currently not used*) - - (* - GetProperty(S, "SYSTEM.INT8", Int8Size, Int8Align); - GetProperty(S, "SYSTEM.INT16", Int16Size, Int16Align); - GetProperty(S, "SYSTEM.INT32", Int32Size, Int32Align); - GetProperty(S, "SYSTEM.INT64", Int64Size, Int64Align);*) - (* add here Max and Min sizes, noch *) - ByteSize := CharSize; - - ELSE Mark(-156, -1) - END ; - ELSE - IF Verbose THEN - Console.String ("not using voc.par file"); Console.Ln - END - END; (* if useParFile , noch *) - - (*Int8Size := 1; Int16Size := 2; Int32Size := 4; Int64Size := 8;*) - -(* commenting this by replacing with faster way; -- noch * - MinSInt := power0(-2, (SIntSize*8-1)); (* -2^(SIntSize*8-1)*) - (*MaxSInt := -(MinSint + 1);; may be optimized?*) - MaxSInt := minus(MinSInt + 1); - MinInt := power0(-2, (IntSize*8-1)); - MaxInt := minus(MinInt + 1); - - MinLInt := power0(-2, (LIntSize*8-1)); - MaxLInt := minus(MinLInt +1); -*) (* and I'd like to calculate it, not hardcode constants *) - base := -2; - (* we can do - MinLInt := ASH(-2, LIntSize*8-2); - but some compilers may treat -2 as SHORTINT, not LONGINT; -- noch *) + base := -2; MinSInt := ASH(base, SIntSize*8-2); MaxSInt := minus(MinSInt + 1); MinInt := ASH(base, IntSize*8-2); MaxInt := minus(MinInt + 1); - + MinLInt := ASH(base, LIntSize*8-2); MaxLInt := minus(MinLInt +1); - (* - MinInt8 := -80H; MinInt16 := -8000H; MinInt32 := 80000000H; (*-2147483648*) - MaxInt8 := 7FH; MaxInt16 := 7FFFH; MaxInt32 := 7FFFFFFFH; (*2147483647*) - - MinInt64 := ASH(base, Int64Size*8-2); - MaxInt64 := minus(ASH(base, Int64Size*8-2) + 1); -*) + IF RealSize = 4 THEN MaxReal := 3.40282346D38 ELSIF RealSize = 8 THEN MaxReal := 1.7976931348623157D307 * 9.999999 (*should be 1.7976931348623157D308 *) END ; + IF LRealSize = 4 THEN MaxLReal := 3.40282346D38 ELSIF LRealSize = 8 THEN MaxLReal := 1.7976931348623157D307 * 9.999999 (*should be 1.7976931348623157D308 *) END ; + MinReal := -MaxReal; MinLReal := -MaxLReal; - (* commented this out, *) - (*IF IntSize = 4 THEN MinInt := MinLInt; MaxInt := MaxLInt END ;*) - (*IF IntSize = 4 THEN MinLInt := MinInt; MaxLInt := MaxInt END ;*) + MaxSet := SetSize * 8 - 1; MaxIndex := MaxLInt; (* shouldn't it be like max(int)? so that for loop will be safe, noch *) - IF Verbose THEN - VerboseListSizes - END; - + IF Verbose THEN VerboseListSizes END; END GetProperties; + + + (* ------------------------- Read Symbol File ------------------------- *) PROCEDURE SymRCh*(VAR ch: CHAR); BEGIN Files.Read(oldSF, ch) END SymRCh; - + PROCEDURE SymRInt*(): LONGINT; VAR k: LONGINT; BEGIN Files.ReadNum(oldSF, k); RETURN k END SymRInt; - + PROCEDURE SymRSet*(VAR s: SET); BEGIN Files.ReadNum(oldSF, SYSTEM.VAL(LONGINT, s)) END SymRSet; - + PROCEDURE SymRReal*(VAR r: REAL); BEGIN Files.ReadReal(oldSF, r) END SymRReal; - + PROCEDURE SymRLReal*(VAR lr: LONGREAL); BEGIN Files.ReadLReal(oldSF, lr) END SymRLReal; - + PROCEDURE CloseOldSym*; END CloseOldSym; PROCEDURE OldSym*(VAR modName: ARRAY OF CHAR; VAR done: BOOLEAN); VAR ch: CHAR; fileName: FileName; - BEGIN MakeFileName(modName, fileName, SFext); + BEGIN + MakeFileName(modName, fileName, SFext); oldSFile := Files.Old(fileName); done := oldSFile # NIL; IF done THEN Files.Set(oldSF, oldSFile, 0); Files.Read(oldSF, ch); @@ -847,13 +631,16 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) END END END OldSym; - + PROCEDURE eofSF*(): BOOLEAN; BEGIN RETURN oldSF.eof END eofSF; - + + + + (* ------------------------- Write Symbol File ------------------------- *) - + PROCEDURE SymWCh*(ch: CHAR); BEGIN Files.Write(newSF, ch) END SymWCh; @@ -869,16 +656,16 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) PROCEDURE SymWReal*(r: REAL); BEGIN Files.WriteReal(newSF, r) END SymWReal; - + PROCEDURE SymWLReal*(lr: LONGREAL); BEGIN Files.WriteLReal(newSF, lr) END SymWLReal; - + PROCEDURE RegisterNewSym*; BEGIN IF (modName # "SYSTEM") OR (mainprog IN opt) THEN Files.Register(newSFile) END END RegisterNewSym; - + PROCEDURE DeleteNewSym*; END DeleteNewSym; @@ -891,6 +678,9 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) END END NewSym; + + + (* ------------------------- Write Header & Body Files ------------------------- *) PROCEDURE Write*(ch: CHAR); @@ -922,11 +712,16 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) s[2] := 0X; WriteString(s) END WriteHex; - + PROCEDURE WriteInt* (i: LONGINT); VAR s: ARRAY 20 OF CHAR; i1, k: LONGINT; BEGIN - IF i = MinLInt THEN Write("("); WriteInt(i+1); WriteString("-1)") (* requires special bootstrap for 64 bit *) + IF (i = MinInt) OR (i = MinLInt) THEN + (* abs(minint) is one more than maxint, causing problems representing the value as a minus sign + followed by absoute value. Therefore represent as -maxint - 1. For INTEGER this avoids a + compiler warning 'this decimal constant is unsigned only in ISO C90', for LONGINT it is the + only way to represent MinLInt. *) + Write("("); WriteInt(i+1); WriteString("-1)") ELSE i1 := ABS(i); s[0] := CHR(i1 MOD 10 + ORD("0")); i1 := i1 DIV 10; k := 1; WHILE i1 > 0 DO s[k] := CHR(i1 MOD 10 + ORD("0")); i1 := i1 DIV 10; INC(k) END ; @@ -939,7 +734,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) VAR W: Texts.Writer; T: Texts.Text; R: Texts.Reader; s: ARRAY 32 OF CHAR; ch: CHAR; i: INTEGER; BEGIN (*should be improved *) - IF (r < MaxLInt) & (r > MinLInt) & (r = ENTIER(r)) THEN + IF (r < MaxLInt) & (r > MinLInt) & (r = ENTIER(r)) THEN IF suffx = "f" THEN WriteString("(REAL)") ELSE WriteString("(LONGREAL)") END ; WriteInt(ENTIER(r)) ELSE @@ -951,7 +746,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) (* s[i] := suffx; s[i+1] := 0X; suffix does not work in K&R *) s[i] := 0X; - i := 0; ch := s[0]; + i := 0; ch := s[0]; WHILE (ch # "D") & (ch # 0X) DO INC(i); ch := s[i] END ; IF ch = "D" THEN s[i] := "e" END ; WriteString(s) @@ -986,16 +781,12 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) MakeFileName(moduleName, FName, HFext); HIFile := Files.New(FName); IF HIFile # NIL THEN Files.Set(R[HeaderInclude], HIFile, 0) ELSE err(153) END ; - IF include0 IN opt THEN - MakeFileName(moduleName, FName, ".h0"); Append(R[HeaderInclude], Files.Old(FName)); - MakeFileName(moduleName, FName, ".c0"); Append(R[BodyFile], Files.Old(FName)) - END END OpenFiles; PROCEDURE CloseFiles*; VAR FName: ARRAY 32 OF CHAR; res: INTEGER; BEGIN - IF noerr THEN LogWStr(" "); LogWNum(Files.Pos(R[BodyFile]), 0) END ; + IF noerr THEN LogWStr(" "); LogWNum(Files.Pos(R[BodyFile]), 0); LogWStr(" chars.") END; IF noerr THEN IF modName = "SYSTEM" THEN IF ~(mainprog IN opt) THEN Files.Register(BFile) END @@ -1011,18 +802,30 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) HFile := NIL; BFile := NIL; HIFile := NIL; newSFile := NIL; oldSFile := NIL; Files.Set(R[0], NIL, 0); Files.Set(R[1], NIL, 0); Files.Set(R[2], NIL, 0); Files.Set(newSF, NIL, 0); Files.Set(oldSF, NIL, 0) END CloseFiles; - - PROCEDURE PromoteIntConstToLInt*(); - BEGIN - (* ANSI C does not need explicit promotion. - K&R C implicitly promotes integer constants to type int in parameter lists. - if the formal parameter, however, is of type long, appending "L" is required in ordere to promote - the parameter explicitly to type long (if LONGINT corresponds to long, which we do not really know). - It works for all known K&R versions of voc and K&R is dying out anyway. - A cleaner solution would be to cast with type (LONGINT), but this requires a bit more changes. - *) - IF ~(ansi IN opt) THEN Write("L") END - END PromoteIntConstToLInt; -BEGIN Texts.OpenWriter(W) + +BEGIN + + Texts.OpenWriter(W); + + MODULES := ""; Platform.GetEnv("MODULES", MODULES); + + OBERON := "."; Platform.GetEnv("OBERON", OBERON); + Strings.Append(";.;", OBERON); + Strings.Append(MODULES, OBERON); + Strings.Append(";", OBERON); + Strings.Append(Configuration.installdir, OBERON); + Strings.Append("/sym;", OBERON); + + Files.SetSearchPath(OBERON); + + (* Fixed type sizes *) + CharSize := 1; BoolSize := 1; SIntSize := 1; RecSize := 1; ByteSize := 1; + RealSize := 4; LRealSize := 8; + + (* type sizes with configuration based defaults *) + PointerSize := Configuration.addressSize; + Alignment := Configuration.alignment; + IntSize := Configuration.intsize; + END OPM. diff --git a/src/compiler/OPP.Mod b/src/compiler/OPP.Mod index 7971ab96..a9f30a0c 100644 --- a/src/compiler/OPP.Mod +++ b/src/compiler/OPP.Mod @@ -2,7 +2,7 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) IMPORT OPB, OPT, OPS, OPM; - + CONST (* numtyp values *) char = 1; integer = 2; real = 3; longreal = 4; @@ -27,7 +27,7 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) SProc = 8; CProc = 9; IProc = 10; Mod = 11; Head = 12; TProc = 13; (* Structure forms *) - Undef = 0; Byte = 1; Bool = 2; Char = 3; + Undef = 0; Byte = 1; Bool = 2; Char = 3; SInt = 4; Int = 5; LInt = 6; Real = 7; LReal = 8; Set = 9; String = 10; NilTyp = 11; NoTyp = 12; Pointer = 13; ProcTyp = 14; @@ -42,7 +42,7 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) Comp = (*15*)19;*) intSet = {SInt..LInt(*, Int8..Int64*)}; - + (* composite structure forms *) Basic = 1; Array = 2; DynArr = 3; Record = 4; @@ -58,7 +58,7 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) (* node subclasses *) super = 1; - + (* module visibility of objects *) internal = 0; external = 1; externalR = 2; @@ -70,7 +70,7 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) RECORD low, high: LONGINT END ; - + VAR sym, level: SHORTINT; LoopLevel: INTEGER; @@ -116,7 +116,7 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) PROCEDURE ConstExpression(VAR x: OPT.Node); BEGIN Expression(x); IF x^.class # Nconst THEN - err(50); x := OPB.NewIntConst(1) + err(50); x := OPB.NewIntConst(1) END END ConstExpression; @@ -129,7 +129,7 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) ELSE vis := internal END END CheckMark; - + PROCEDURE CheckSysFlag(VAR sysflag: INTEGER; default: INTEGER); VAR x: OPT.Node; sf: LONGINT; BEGIN @@ -256,7 +256,7 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) END END END PointerType; - + PROCEDURE FormalParameters(VAR firstPar: OPT.Object; VAR resTyp: OPT.Struct); VAR mode: SHORTINT; par, first, last, res: OPT.Object; typ: OPT.Struct; @@ -338,7 +338,7 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) OPS.Get(sym) END END TypeDecl; - + PROCEDURE Type(VAR typ, banned: OPT.Struct); BEGIN TypeDecl(typ, banned); IF (typ^.form = Pointer) & (typ^.BaseTyp = OPT.undftyp) & (typ^.strobj = NIL) THEN err(0) END @@ -443,7 +443,7 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) END ; IF (level > 0) & ((m = newfn) OR (m = sysnewfn)) THEN OPT.topScope^.link^.leaf := FALSE END END StandProcCall; - + PROCEDURE Element(VAR x: OPT.Node); VAR y: OPT.Node; BEGIN Expression(x); @@ -469,7 +469,7 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) END ; CheckSym(rbrace) END Sets; - + PROCEDURE Factor(VAR x: OPT.Node); VAR fpar, id: OPT.Object; apar: OPT.Node; BEGIN @@ -573,7 +573,7 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) CheckSym(rparen); IF rec = NIL THEN rec := OPT.NewStr(Comp, Record); rec^.BaseTyp := NIL END END Receiver; - + PROCEDURE Extends(x, b: OPT.Struct): BOOLEAN; BEGIN IF (b^.form = Pointer) & (x^.form = Pointer) THEN b := b^.BaseTyp; x := x^.BaseTyp END ; @@ -595,7 +595,11 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) ext := OPT.NewExt(); proc^.conval^.ext := ext; n := 0; IF sym = string THEN WHILE OPS.str[n] # 0X DO ext[n+1] := OPS.str[n]; INC(n) END ; - ext^[0] := CHR(n); OPS.Get(sym) + ext^[0] := CHR(n); OPS.Get(sym); + (* + Console.String("Code procedure, length "); Console.Int(n,1); Console.Ln; + Console.String(' "'); Console.String(ext^); Console.String('"'); Console.Ln; + *) ELSE LOOP IF sym = number THEN c := OPS.intval; INC(n); @@ -666,7 +670,7 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) ELSE IF fwd # NIL THEN err(1); fwd := NIL END ; OPT.OpenScope(0, NIL); OPT.topScope^.right := recTyp^.link; OPT.Insert(name, proc); - recTyp^.link := OPT.topScope^.right; OPT.CloseScope; + recTyp^.link := OPT.topScope^.right; OPT.CloseScope; END ; INC(level); OPT.OpenScope(level, proc); OPT.Insert(objName, proc^.link); proc^.link^.mode := objMode; proc^.link^.typ := objTyp; @@ -685,7 +689,7 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) ELSE err(ident) END END TProcDecl; - + BEGIN proc := NIL; forward := FALSE; x := NIL; mode := LProc; IF (sym # ident) & (sym # lparen) THEN IF sym = times THEN (* mode set later in OPB.CheckAssign *) @@ -766,7 +770,7 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) PROCEDURE CasePart(VAR x: OPT.Node); VAR n: INTEGER; low, high: LONGINT; e: BOOLEAN; - tab: CaseTable; cases, lab, y, lastcase: OPT.Node; + tab: CaseTable; cases, lab, y, lastcase: OPT.Node; BEGIN Expression(x); pos := OPM.errpos; IF (x^.class = Ntype) OR (x^.class = Nproc) THEN err(126) @@ -786,8 +790,8 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) ELSE low := 1; high := 0 END ; e := sym = else; - IF e THEN OPS.Get(sym); StatSeq(y) - ELSE + IF e THEN OPS.Get(sym); StatSeq(y) + ELSE y := NIL; OPM.Mark(-307, OPM.curpos); (* notice about no else symbol; -- noch *) END ; @@ -796,7 +800,7 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) cases^.conval^.intval := low; cases^.conval^.intval2 := high; IF e THEN cases^.conval^.setval := {1} ELSE cases^.conval^.setval := {} END END CasePart; - + PROCEDURE SetPos(x: OPT.Node); BEGIN x^.conval := OPT.NewConst(); x^.conval^.intval := pos @@ -1048,7 +1052,7 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) OPS.Init; LoopLevel := 0; level := 0; OPS.Get(sym); IF sym = module THEN OPS.Get(sym) ELSE err(16) END ; IF sym = ident THEN - OPM.LogW(" "); OPM.LogWStr(OPS.name); + OPM.LogWStr("compiling "); OPM.LogWStr(OPS.name); OPM.LogW("."); OPT.Init(OPS.name, opt); OPS.Get(sym); CheckSym(semicolon); IF sym = import THEN OPS.Get(sym); LOOP diff --git a/src/compiler/OPS.Mod b/src/compiler/OPS.Mod index c251c2be..53d7e2e7 100644 --- a/src/compiler/OPS.Mod +++ b/src/compiler/OPS.Mod @@ -1,11 +1,11 @@ MODULE OPS; (* NW, RC 6.3.89 / 18.10.92 *) (* object model 3.6.92 *) IMPORT OPM; - + CONST MaxStrLen* = 256; MaxIdLen = 256; - + TYPE Name* = ARRAY MaxIdLen OF CHAR; String* = ARRAY MaxStrLen OF CHAR; @@ -13,12 +13,12 @@ MODULE OPS; (* NW, RC 6.3.89 / 18.10.92 *) (* object model 3.6.92 *) (* name, str, numtyp, intval, realval, lrlval are implicit results of Get *) VAR - name*: Name; - str*: String; - numtyp*: INTEGER; (* 1 = char, 2 = integer, 3 = real, 4 = longreal *) - intval*: LONGINT; (* integer value or string length *) + name*: Name; + str*: String; + numtyp*: INTEGER; (* 1 = char, 2 = integer, 3 = real, 4 = longreal *) + intval*: LONGINT; (* integer value or string length *) realval*: REAL; - lrlval*: LONGREAL; + lrlval*: LONGREAL; (*symbols: | 0 1 2 3 4 @@ -62,7 +62,7 @@ MODULE OPS; (* NW, RC 6.3.89 / 18.10.92 *) (* object model 3.6.92 *) PROCEDURE err(n: INTEGER); BEGIN OPM.err(n) END err; - + PROCEDURE Str(VAR sym: SHORTINT); VAR i: INTEGER; och: CHAR; BEGIN i := 0; och := ch; @@ -110,7 +110,7 @@ MODULE OPS; (* NW, RC 6.3.89 / 18.10.92 *) (* object model 3.6.92 *) ELSE err(2); RETURN 0 END END Ord; - + BEGIN (* ("0" <= ch) & (ch <= "9") *) i := 0; m := 0; n := 0; d := 0; LOOP (* read mantissa *) diff --git a/src/compiler/OPT.Mod b/src/compiler/OPT.Mod index 34a57061..5912149b 100644 --- a/src/compiler/OPT.Mod +++ b/src/compiler/OPT.Mod @@ -4,148 +4,154 @@ MODULE OPT; (* NW, RC 6.3.89 / 23.1.92 *) (* object model 24.2.94 *) 2002-08-20 jt: NewStr: txtpos remains 0 for structs read from symbol file *) -IMPORT -OPS, OPM; +IMPORT OPS, OPM; CONST -MaxConstLen* = OPS.MaxStrLen; + MaxConstLen* = OPS.MaxStrLen; TYPE -Const* = POINTER TO ConstDesc; -Object* = POINTER TO ObjDesc; -Struct* = POINTER TO StrDesc; -Node* = POINTER TO NodeDesc; -ConstExt* = POINTER TO OPS.String; + Const* = POINTER TO ConstDesc; + Object* = POINTER TO ObjDesc; + Struct* = POINTER TO StrDesc; + Node* = POINTER TO NodeDesc; + ConstExt* = POINTER TO OPS.String; -ConstDesc* = RECORD -ext*: ConstExt; (* string or code for code proc *) -intval*: LONGINT; (* constant value or adr, proc par size, text position or least case label *) -intval2*: LONGINT; (* string length, proc var size or larger case label *) -setval*: SET; (* constant value, procedure body present or "ELSE" present in case *) -realval*: LONGREAL (* real or longreal constant value *) -END ; + ConstDesc* = RECORD + ext*: ConstExt; (* string or code for code proc *) + intval*: LONGINT; (* constant value or adr, proc par size, text position or least case label *) + intval2*: LONGINT; (* string length, proc var size or larger case label *) + setval*: SET; (* constant value, procedure body present or "ELSE" present in case *) + realval*: LONGREAL (* real or longreal constant value *) + END ; -ObjDesc* = RECORD -left*, right*, link*, scope*: Object; -name*: OPS.Name; -leaf*: BOOLEAN; -mode*, mnolev*: SHORTINT; (* mnolev < 0 -> mno = -mnolev *) -vis*: SHORTINT; (* internal, external, externalR *) -history*: SHORTINT; (* relevant if name # "" *) -used*, fpdone*: BOOLEAN; -fprint*: LONGINT; -typ*: Struct; -conval*: Const; -adr*, linkadr*: LONGINT; -x*: INTEGER (* linkadr and x can be freely used by the backend *) -END ; + ObjDesc* = RECORD + left*, right*: Object; + link*, scope*: Object; + name*: OPS.Name; + leaf*: BOOLEAN; + mode*, mnolev*: SHORTINT; (* mnolev < 0 -> mno = -mnolev *) + vis*: SHORTINT; (* internal, external, externalR *) + history*: SHORTINT; (* relevant if name # "" *) + used*, fpdone*: BOOLEAN; + fprint*: LONGINT; + typ*: Struct; + conval*: Const; + adr*, linkadr*: LONGINT; + x*: INTEGER (* linkadr and x can be freely used by the backend *) + END ; -StrDesc* = RECORD -form*, comp*, mno*, extlev*: SHORTINT; -ref*, sysflag*: INTEGER; -n*, size*, align*, txtpos*: LONGINT; (* align is alignment for records and len offset for dynarrs *) -allocated*, pbused*, pvused*, fpdone, idfpdone: BOOLEAN; -idfp, pbfp*, pvfp*:LONGINT; -BaseTyp*: Struct; -link*, strobj*: Object -END ; + StrDesc* = RECORD + form*, comp*: SHORTINT; + mno*, extlev*: SHORTINT; + ref*, sysflag*: INTEGER; + n*, size*: LONGINT; + align*, txtpos*: LONGINT; (* align is alignment for records and len offset for dynarrs *) + allocated*: BOOLEAN; + pbused*, pvused*: BOOLEAN; + fpdone, idfpdone: BOOLEAN; + idfp, pbfp*, pvfp*: LONGINT; + BaseTyp*: Struct; + link*, strobj*: Object + END ; -NodeDesc* = RECORD -left*, right*, link*: Node; -class*, subcl*: SHORTINT; -readonly*: BOOLEAN; -typ*: Struct; -obj*: Object; -conval*: Const -END ; + NodeDesc* = RECORD + left*, right*, link*: Node; + class*, subcl*: SHORTINT; + readonly*: BOOLEAN; + typ*: Struct; + obj*: Object; + conval*: Const + END ; CONST -maxImps = 64; (* must be <= MAX(SHORTINT) *) -maxStruct = OPM.MaxStruct; (* must be < MAX(INTEGER) DIV 2 *) -FirstRef = (*20*)16; (* comp + 1 *) + maxImps = 64; (* must be <= MAX(SHORTINT) *) + maxStruct = OPM.MaxStruct; (* must be < MAX(INTEGER) DIV 2 *) + FirstRef = (*20*)16; (* comp + 1 *) VAR -typSize*: PROCEDURE(typ: Struct); -topScope*: Object; -undftyp*, bytetyp*, booltyp*, chartyp*, sinttyp*, inttyp*, linttyp*, -realtyp*, lrltyp*, settyp*, stringtyp*, niltyp*, notyp*, sysptrtyp*(*, -int8typ*, int16typ*, int32typ*, int64typ* *): Struct; -nofGmod*: SHORTINT; (*nof imports*) -GlbMod*: ARRAY maxImps OF Object; (* ^.right = first object, ^.name = module import name (not alias) *) -SelfName*: OPS.Name; (* name of module being compiled *) -SYSimported*: BOOLEAN; + typSize*: PROCEDURE(typ: Struct); + topScope*: Object; + undftyp*, bytetyp*, booltyp*, chartyp*, sinttyp*, inttyp*, linttyp*, + realtyp*, lrltyp*, settyp*, stringtyp*, niltyp*, notyp*, sysptrtyp*(*, + int8typ*, int16typ*, int32typ*, int64typ* *): Struct; + nofGmod*: SHORTINT; (*nof imports*) + GlbMod*: ARRAY maxImps OF Object; (* ^.right = first object, ^.name = module import name (not alias) *) + SelfName*: OPS.Name; (* name of module being compiled *) + SYSimported*: BOOLEAN; CONST -(* object modes *) -Var = 1; VarPar = 2; Con = 3; Fld = 4; Typ = 5; LProc = 6; XProc = 7; -SProc = 8; CProc = 9; IProc = 10; Mod = 11; Head = 12; TProc = 13; + (* object modes *) + Var = 1; VarPar = 2; Con = 3; Fld = 4; Typ = 5; LProc = 6; XProc = 7; + SProc = 8; CProc = 9; IProc = 10; Mod = 11; Head = 12; TProc = 13; -(* structure forms *) -Undef = 0; Byte = 1; Bool = 2; Char = 3; -SInt = 4; Int = 5; LInt = 6; -Real = 7; LReal = 8; Set = 9; String = 10; NilTyp = 11; NoTyp = 12; -Pointer = 13; ProcTyp = 14; -Comp = 15; + (* structure forms *) + Undef = 0; Byte = 1; Bool = 2; Char = 3; + SInt = 4; Int = 5; LInt = 6; + Real = 7; LReal = 8; Set = 9; String = 10; NilTyp = 11; NoTyp = 12; + Pointer = 13; ProcTyp = 14; + Comp = 15; -(*Int8 = 7; Int16 = 8; Int32 = 9; Int64 = 10; -Real = 11; LReal = 12; Set = 13; String = 14; NilTyp = 15; NoTyp = 16; -Pointer = 17; ProcTyp = 18; -Comp = 19;*) -(*Real = 7; LReal = 8; Set = 9; String = 10; NilTyp = 11; NoTyp = 12; -Pointer = 13; ProcTyp = 14; -Int8 = 15; Int16 = 16; Int32 = 17; Int64 = 18; -Comp = 19;*) + (*Int8 = 7; Int16 = 8; Int32 = 9; Int64 = 10; + Real = 11; LReal = 12; Set = 13; String = 14; NilTyp = 15; NoTyp = 16; + Pointer = 17; ProcTyp = 18; + Comp = 19;*) + (*Real = 7; LReal = 8; Set = 9; String = 10; NilTyp = 11; NoTyp = 12; + Pointer = 13; ProcTyp = 14; + Int8 = 15; Int16 = 16; Int32 = 17; Int64 = 18; + Comp = 19;*) -(* composite structure forms *) -Basic = 1; Array = 2; DynArr = 3; Record = 4; + (* composite structure forms *) + Basic = 1; Array = 2; DynArr = 3; Record = 4; -(*function number*) -assign = 0; -haltfn = 0; newfn = 1; absfn = 2; capfn = 3; ordfn = 4; -entierfn = 5; oddfn = 6; minfn = 7; maxfn = 8; chrfn = 9; -shortfn = 10; longfn = 11; sizefn = 12; incfn = 13; decfn = 14; -inclfn = 15; exclfn = 16; lenfn = 17; copyfn = 18; ashfn = 19; assertfn = 32; + (*function number*) + assign = 0; + haltfn = 0; newfn = 1; absfn = 2; capfn = 3; ordfn = 4; + entierfn = 5; oddfn = 6; minfn = 7; maxfn = 8; chrfn = 9; + shortfn = 10; longfn = 11; sizefn = 12; incfn = 13; decfn = 14; + inclfn = 15; exclfn = 16; lenfn = 17; copyfn = 18; ashfn = 19; assertfn = 32; -(*SYSTEM function number*) -adrfn = 20; ccfn = 21; lshfn = 22; rotfn = 23; -getfn = 24; putfn = 25; getrfn = 26; putrfn = 27; -bitfn = 28; valfn = 29; sysnewfn = 30; movefn = 31; + (*SYSTEM function number*) + adrfn = 20; ccfn = 21; lshfn = 22; rotfn = 23; + getfn = 24; putfn = 25; getrfn = 26; putrfn = 27; + bitfn = 28; valfn = 29; sysnewfn = 30; movefn = 31; -(* module visibility of objects *) -internal = 0; external = 1; externalR = 2; + (* module visibility of objects *) + internal = 0; external = 1; externalR = 2; -(* history of imported objects *) -inserted = 0; same = 1; pbmodified = 2; pvmodified = 3; removed = 4; inconsistent = 5; + (* history of imported objects *) + inserted = 0; same = 1; pbmodified = 2; pvmodified = 3; removed = 4; inconsistent = 5; -(* symbol file items *) -Smname = 16; Send = 18; Stype = 19; Salias = 20; Svar = 21; Srvar = 22; -Svalpar = 23; Svarpar = 24; Sfld = 25; Srfld = 26; Shdptr = 27; Shdpro = 28; Stpro = 29; Shdtpro = 30; -Sxpro = 31; Sipro = 32; Scpro = 33; Sstruct = 34; Ssys = 35; Sptr = 36; Sarr = 37; Sdarr = 38; Srec = 39; Spro = 40; + (* symbol file items *) + Smname = 16; Send = 18; Stype = 19; Salias = 20; Svar = 21; Srvar = 22; + Svalpar = 23; Svarpar = 24; Sfld = 25; Srfld = 26; Shdptr = 27; Shdpro = 28; Stpro = 29; Shdtpro = 30; + Sxpro = 31; Sipro = 32; Scpro = 33; Sstruct = 34; Ssys = 35; Sptr = 36; Sarr = 37; Sdarr = 38; Srec = 39; Spro = 40; TYPE -ImpCtxt = RECORD -nextTag, reffp: LONGINT; -nofr, minr, nofm: INTEGER; -self: BOOLEAN; -ref: ARRAY maxStruct OF Struct; -old: ARRAY maxStruct OF Object; -pvfp: ARRAY maxStruct OF LONGINT; (* set only if old # NIL *) -glbmno: ARRAY maxImps OF SHORTINT (* index is local mno *) -END ; + ImpCtxt = RECORD + nextTag, reffp: LONGINT; + nofr, minr, nofm: INTEGER; + self: BOOLEAN; + ref: ARRAY maxStruct OF Struct; + old: ARRAY maxStruct OF Object; + pvfp: ARRAY maxStruct OF LONGINT; (* set only if old # NIL *) + glbmno: ARRAY maxImps OF SHORTINT (* index is local mno *) + END ; -ExpCtxt = RECORD -reffp: LONGINT; -ref: INTEGER; -nofm: SHORTINT; -locmno: ARRAY maxImps OF SHORTINT (* index is global mno *) -END ; + ExpCtxt = RECORD + reffp: LONGINT; + ref: INTEGER; + nofm: SHORTINT; + locmno: ARRAY maxImps OF SHORTINT (* index is global mno *) + END ; VAR -universe, syslink: Object; -impCtxt: ImpCtxt; -expCtxt: ExpCtxt; -nofhdfld: LONGINT; -newsf, findpc, extsf, sfpresent, symExtended, symNew: BOOLEAN; + universe, syslink: Object; + impCtxt: ImpCtxt; + expCtxt: ExpCtxt; + nofhdfld: LONGINT; + newsf, findpc: BOOLEAN; + extsf, sfpresent: BOOLEAN; + symExtended, symNew: BOOLEAN; PROCEDURE err(n: INTEGER); BEGIN OPM.err(n) @@ -244,7 +250,7 @@ END Find; PROCEDURE FindField*(VAR name: OPS.Name; typ: Struct; VAR res: Object); VAR obj: Object; -BEGIN +BEGIN WHILE typ # NIL DO obj := typ^.link; WHILE obj # NIL DO IF name < obj^.name THEN obj := obj^.left @@ -288,17 +294,16 @@ PROCEDURE ^IdFPrint*(typ: Struct); PROCEDURE DebugStruct(btyp: Struct); BEGIN - - OPM.LogWLn; - IF btyp = NIL THEN OPM.LogWStr("btyp is nil"); OPM.LogWLn END; - OPM.LogWStr("btyp^.strobji^.name = "); OPM.LogWStr(btyp^.strobj^.name); OPM.LogWLn; - OPM.LogWStr("btyp^.form = "); OPM.LogWNum(btyp^.form, 0); OPM.LogWLn; - OPM.LogWStr("btyp^.comp = "); OPM.LogWNum(btyp^.comp, 0); OPM.LogWLn; - OPM.LogWStr("btyp^.mno = "); OPM.LogWNum(btyp^.mno, 0); OPM.LogWLn; - OPM.LogWStr("btyp^.extlev = "); OPM.LogWNum(btyp^.extlev, 0); OPM.LogWLn; - OPM.LogWStr("btyp^.size = "); OPM.LogWNum(btyp^.size, 0); OPM.LogWLn; - OPM.LogWStr("btyp^.align = "); OPM.LogWNum(btyp^.align, 0); OPM.LogWLn; - OPM.LogWStr("btyp^.txtpos = "); OPM.LogWNum(btyp^.txtpos, 0); OPM.LogWLn; + OPM.LogWLn; + IF btyp = NIL THEN OPM.LogWStr("btyp is nil"); OPM.LogWLn END; + OPM.LogWStr("btyp^.strobji^.name = "); OPM.LogWStr(btyp^.strobj^.name); OPM.LogWLn; + OPM.LogWStr("btyp^.form = "); OPM.LogWNum(btyp^.form, 0); OPM.LogWLn; + OPM.LogWStr("btyp^.comp = "); OPM.LogWNum(btyp^.comp, 0); OPM.LogWLn; + OPM.LogWStr("btyp^.mno = "); OPM.LogWNum(btyp^.mno, 0); OPM.LogWLn; + OPM.LogWStr("btyp^.extlev = "); OPM.LogWNum(btyp^.extlev, 0); OPM.LogWLn; + OPM.LogWStr("btyp^.size = "); OPM.LogWNum(btyp^.size, 0); OPM.LogWLn; + OPM.LogWStr("btyp^.align = "); OPM.LogWNum(btyp^.align, 0); OPM.LogWLn; + OPM.LogWStr("btyp^.txtpos = "); OPM.LogWNum(btyp^.txtpos, 0); OPM.LogWLn; END DebugStruct; PROCEDURE FPrintSign(VAR fp: LONGINT; result: Struct; par: Object); @@ -306,8 +311,8 @@ PROCEDURE FPrintSign(VAR fp: LONGINT; result: Struct; par: Object); BEGIN IdFPrint(result); OPM.FPrint(fp, result^.idfp); WHILE (par # NIL) (*& (par^.typ # NIL)*) DO (* !!! *) - OPM.FPrint(fp, par^.mode); - IdFPrint(par^.typ); + OPM.FPrint(fp, par^.mode); + IdFPrint(par^.typ); OPM.FPrint(fp, par^.typ^.idfp); (* par^.name and par^.adr not considered *) par := par^.link @@ -326,7 +331,7 @@ BEGIN END ; IF (f = Pointer) OR (c = Record) & (btyp # NIL) OR (c = DynArr) THEN IdFPrint(btyp); OPM.FPrint(idfp, btyp^.idfp) - ELSIF c = Array THEN + ELSIF c = Array THEN IdFPrint(btyp); OPM.FPrint(idfp, btyp^.idfp); OPM.FPrint(idfp, typ^.n) ELSIF f = ProcTyp THEN FPrintSign(idfp, btyp, typ^.link) END ; @@ -366,7 +371,7 @@ WHILE (fld # NIL) & (fld^.mode = Fld) DO IF (fld^.vis # internal) & visible THEN OPM.FPrint(pbfp, fld^.vis); FPrintName(pbfp, fld^.name); OPM.FPrint(pbfp, fld^.adr); FPrintStr(fld^.typ); OPM.FPrint(pbfp, fld^.typ^.pbfp); OPM.FPrint(pvfp, fld^.typ^.pvfp) - ELSE + ELSE FPrintHdFld(fld^.typ, fld, fld^.adr + adr) END ; fld := fld^.link @@ -453,26 +458,26 @@ BEGIN END END FPrintObj; -PROCEDURE FPrintErr*(obj: Object; errno: INTEGER); +PROCEDURE FPrintErr*(obj: Object; errcode: INTEGER); VAR i, j: INTEGER; ch: CHAR; BEGIN -IF obj^.mnolev # 0 THEN -COPY(GlbMod[-obj^.mnolev]^.name, OPM.objname); i := 0; -WHILE OPM.objname[i] # 0X DO INC(i) END ; -OPM.objname[i] := "."; j := 0; INC(i); -REPEAT ch := obj^.name[j]; OPM.objname[i] := ch; INC(j); INC(i) UNTIL ch = 0X; -ELSE -COPY(obj^.name, OPM.objname) -END ; -IF errno = 249 THEN -IF OPM.noerr THEN err(errno) END -ELSIF errno = 253 THEN (* extension *) -IF ~symNew & ~symExtended & ~extsf THEN err(errno) END ; -symExtended := TRUE -ELSE -IF ~symNew & ~newsf THEN err(errno) END ; -symNew := TRUE -END + IF obj^.mnolev # 0 THEN + COPY(GlbMod[-obj^.mnolev]^.name, OPM.objname); i := 0; + WHILE OPM.objname[i] # 0X DO INC(i) END ; + OPM.objname[i] := "."; j := 0; INC(i); + REPEAT ch := obj^.name[j]; OPM.objname[i] := ch; INC(j); INC(i) UNTIL ch = 0X; + ELSE + COPY(obj^.name, OPM.objname) + END ; + IF errcode = 249 THEN + IF OPM.noerr THEN err(errcode) END + ELSIF errcode = 253 THEN (* extension *) + IF ~symNew & ~symExtended & ~extsf THEN err(errcode) END ; + symExtended := TRUE + ELSE + IF ~symNew & ~newsf THEN err(errcode) END ; + symNew := TRUE + END END FPrintErr; (*-------------------------- Import --------------------------*) @@ -625,20 +630,20 @@ VAR mno: SHORTINT; ref: INTEGER; tag: LONGINT; name: OPS.Name; t: Struct; obj, last, fld, old, dummy: Object; BEGIN tag := OPM.SymRInt(); - IF tag # Sstruct THEN + IF tag # Sstruct THEN typ := impCtxt.ref[-tag] ELSE ref := impCtxt.nofr; INC(impCtxt.nofr); IF ref < impCtxt.minr THEN impCtxt.minr := ref END ; InMod(mno); InName(name); obj := NewObj(); IF name = "" THEN - IF impCtxt.self THEN - old := NIL (* do not insert type desc anchor here, but in OPL *) - ELSE - obj^.name := "@"; InsertImport(obj, GlbMod[mno].right, old(*=NIL*)); obj^.name := "" + IF impCtxt.self THEN + old := NIL (* do not insert type desc anchor here, but in OPL *) + ELSE + obj^.name := "@"; InsertImport(obj, GlbMod[mno].right, old(*=NIL*)); obj^.name := "" END ; typ := NewStr(Undef, Basic) - ELSE + ELSE obj^.name := name; InsertImport(obj, GlbMod[mno].right, old); IF old # NIL THEN (* recalculate fprints to compare with old fprints *) FPrintObj(old); impCtxt.pvfp[ref] := old^.typ^.pvfp; @@ -648,11 +653,11 @@ BEGIN typ := old^.typ; typ^.link := NIL; typ^.sysflag := 0; typ^.fpdone := FALSE; typ^.idfpdone := FALSE END - ELSE - typ := NewStr(Undef, Basic) + ELSE + typ := NewStr(Undef, Basic) END END ; - impCtxt.ref[ref] := typ; impCtxt.old[ref] := old; + impCtxt.ref[ref] := typ; impCtxt.old[ref] := old; typ^.ref := ref + maxStruct; (* ref >= maxStruct: not exported yet, ref used for err 155 *) typ^.mno := mno; typ^.allocated := TRUE; @@ -662,27 +667,27 @@ BEGIN IF tag = Ssys THEN typ^.sysflag := SHORT(OPM.SymRInt()); tag := OPM.SymRInt() END ; CASE tag OF | Sptr: - typ^.form := Pointer; typ^.size := OPM.PointerSize; - typ^.n := 0; InStruct(typ^.BaseTyp) + typ^.form := Pointer; typ^.size := OPM.PointerSize; + typ^.n := 0; InStruct(typ^.BaseTyp) | Sarr: - typ^.form := Comp; typ^.comp := Array; - InStruct(typ^.BaseTyp); typ^.n := OPM.SymRInt(); + typ^.form := Comp; typ^.comp := Array; + InStruct(typ^.BaseTyp); typ^.n := OPM.SymRInt(); typSize(typ) (* no bounds address !! *) | Sdarr: typ^.form := Comp; typ^.comp := DynArr; InStruct(typ^.BaseTyp); - IF typ^.BaseTyp^.comp = DynArr THEN - typ^.n := typ^.BaseTyp^.n + 1 - ELSE - typ^.n := 0 + IF typ^.BaseTyp^.comp = DynArr THEN + typ^.n := typ^.BaseTyp^.n + 1 + ELSE + typ^.n := 0 END ; typSize(typ) | Srec: - typ^.form := Comp; typ^.comp := Record; - InStruct(typ^.BaseTyp); + typ^.form := Comp; typ^.comp := Record; + InStruct(typ^.BaseTyp); IF typ^.BaseTyp = notyp THEN typ^.BaseTyp := NIL END; typ.extlev := 0; t := typ.BaseTyp; (* do not take extlev from base type due to possible cycles! *) - WHILE (t # NIL) (*& (t^.BaseTyp # t)*)(*(t^.(*BaseTyp^.*)form # 0)*) DO INC(typ^.extlev); t := t.BaseTyp END; (* !!! *) + WHILE (t # NIL) (*& (t^.BaseTyp # t)*)(*(t^.(*BaseTyp^.*)form # 0)*) DO INC(typ^.extlev); t := t.BaseTyp END; (* !!! *) typ^.size := OPM.SymRInt(); typ^.align := OPM.SymRInt(); typ^.n := OPM.SymRInt(); impCtxt.nextTag := OPM.SymRInt(); last := NIL; @@ -692,16 +697,16 @@ BEGIN last := fld; InsertImport(fld, typ^.link, dummy); impCtxt.nextTag := OPM.SymRInt() END ; - WHILE impCtxt.nextTag # Send DO - fld := InTProc(mno); + WHILE impCtxt.nextTag # Send DO + fld := InTProc(mno); InsertImport(fld, typ^.link, dummy); impCtxt.nextTag := OPM.SymRInt() END | Spro: - typ^.form := ProcTyp; typ^.size := OPM.ProcSize; - InSign(mno, typ^.BaseTyp, typ^.link) - ELSE - OPM.LogWStr("unhandled case at OPT.InStruct, tag = "); OPM.LogWNum(tag, 0); OPM.LogWLn; + typ^.form := ProcTyp; typ^.size := OPM.ProcSize; + InSign(mno, typ^.BaseTyp, typ^.link) + ELSE + OPM.LogWStr("unhandled case at OPT.InStruct, tag = "); OPM.LogWNum(tag, 0); OPM.LogWLn; END ; IF ref = impCtxt.minr THEN WHILE (ref < impCtxt.nofr) (*OR ((ref >= Int8) & (ref <= Int64))*) DO @@ -709,40 +714,40 @@ END ; obj := t^.strobj; (* obj^.typ^.strobj = obj, else obj^.fprint differs (alias) *) IF obj^.name # "" THEN FPrintObj(obj) END ; old := impCtxt.old[ref]; - IF old # NIL THEN - t^.strobj := old; (* restore strobj *) + IF old # NIL THEN + t^.strobj := old; (* restore strobj *) IF impCtxt.self THEN IF old^.mnolev < 0 THEN - IF old^.history # inconsistent THEN - IF old^.fprint # obj^.fprint THEN - old^.history := pbmodified - ELSIF impCtxt.pvfp[ref] # t^.pvfp THEN - old^.history := pvmodified - END - (* ELSE remain inconsistent *) - END - ELSIF old^.fprint # obj^.fprint THEN - old^.history := pbmodified - ELSIF impCtxt.pvfp[ref] # t^.pvfp THEN - old^.history := pvmodified - ELSIF old^.vis = internal THEN - old^.history := same (* may be changed to "removed" in InObj *) - ELSE - old^.history := inserted (* may be changed to "same" in InObj *) + IF old^.history # inconsistent THEN + IF old^.fprint # obj^.fprint THEN + old^.history := pbmodified + ELSIF impCtxt.pvfp[ref] # t^.pvfp THEN + old^.history := pvmodified + END + (* ELSE remain inconsistent *) + END + ELSIF old^.fprint # obj^.fprint THEN + old^.history := pbmodified + ELSIF impCtxt.pvfp[ref] # t^.pvfp THEN + old^.history := pvmodified + ELSIF old^.vis = internal THEN + old^.history := same (* may be changed to "removed" in InObj *) + ELSE + old^.history := inserted (* may be changed to "same" in InObj *) END ELSE (* check private part, delay error message until really used *) - IF impCtxt.pvfp[ref] # t^.pvfp THEN - old^.history := inconsistent - END ; - IF old^.fprint # obj^.fprint THEN - FPrintErr(old, 249) - END + IF impCtxt.pvfp[ref] # t^.pvfp THEN + old^.history := inconsistent + END ; + IF old^.fprint # obj^.fprint THEN + FPrintErr(old, 249) + END END - ELSIF impCtxt.self THEN - obj^.history := removed - ELSE - obj^.history := same + ELSIF impCtxt.self THEN + obj^.history := removed + ELSE + obj^.history := same END ; INC(ref) END ; @@ -774,12 +779,12 @@ END InStruct; ext := NewExt(); obj^.conval^.ext := ext; s := SHORT(OPM.SymRInt()); ext^[0] := CHR(s); i := 1; WHILE i <= s DO OPM.SymRCh(ext^[i]); INC(i) END - ELSE - OPM.LogWStr("unhandled case at OPT.InObj, tag = "); OPM.LogWNum(tag, 0); OPM.LogWLn; + ELSE + OPM.LogWStr("unhandled case at OPT.InObj, tag = "); OPM.LogWNum(tag, 0); OPM.LogWLn; END ELSIF tag = Salias THEN obj^.mode := Typ; InStruct(obj^.typ) - ELSE + ELSE obj^.mode := Var; IF tag = Srvar THEN obj^.vis := externalR END ; InStruct(obj^.typ) @@ -852,7 +857,7 @@ END InStruct; BEGIN i := 0; REPEAT ch := name[i]; OPM.SymWCh(ch); INC(i) UNTIL ch = 0X END OutName; - + PROCEDURE OutMod(mno: INTEGER); BEGIN IF expCtxt.locmno[mno] < 0 THEN (* new mod *) @@ -950,7 +955,7 @@ END InStruct; | pvmodified: FPrintErr(strobj, 251) | inconsistent: FPrintErr(strobj, 249) ELSE (* checked in OutObj or correct indirect export *) - (* OPM.LogWStr("unhandled case at OPT.OutStr, strobj^.history = "); OPM.LogWNum(strobj^.history, 0); OPM.LogWLn;*) + (* OPM.LogWStr("unhandled case at OPT.OutStr, strobj^.history = "); OPM.LogWNum(strobj^.history, 0); OPM.LogWLn;*) END ELSE OPM.SymWCh(0X) (* anonymous => never inconsistent, pvfp influences the client fp *) END ; @@ -974,10 +979,10 @@ END InStruct; nofhdfld := 0; OutFlds(typ^.link, 0, TRUE); IF nofhdfld > OPM.MaxHdFld THEN OPM.Mark(223, typ^.txtpos) END ; OutTProcs(typ, typ^.link); OPM.SymWInt(Send) - ELSE - OPM.LogWStr("unhandled case at OPT.OutStr, typ^.comp = "); OPM.LogWNum(typ^.comp, 0); OPM.LogWLn; + ELSE + OPM.LogWStr("unhandled case at OPT.OutStr, typ^.comp = "); OPM.LogWNum(typ^.comp, 0); OPM.LogWLn; END - ELSE OPM.LogWStr("unhandled case at OPT.OutStr, typ^.form = "); OPM.LogWNum(typ^.form, 0); OPM.LogWLn; + ELSE OPM.LogWStr("unhandled case at OPT.OutStr, typ^.form = "); OPM.LogWNum(typ^.form, 0); OPM.LogWLn; END END END OutStr; @@ -1017,8 +1022,8 @@ END InStruct; | same: (* ok *) | pbmodified: FPrintErr(obj, 252) | pvmodified: FPrintErr(obj, 251) - ELSE - OPM.LogWStr("unhandled case at OPT.OutObj, obj^.history = "); OPM.LogWNum(obj^.history, 0); OPM.LogWLn; + ELSE + OPM.LogWStr("unhandled case at OPT.OutObj, obj^.history = "); OPM.LogWNum(obj^.history, 0); OPM.LogWLn; END ; CASE obj^.mode OF | Con: @@ -1043,8 +1048,8 @@ END InStruct; j := ORD(ext^[0]); i := 1; OPM.SymWInt(j); WHILE i <= j DO OPM.SymWCh(ext^[i]); INC(i) END ; OutName(obj^.name) - ELSE - OPM.LogWStr("unhandled case at OPT.OutObj, obj.mode = "); OPM.LogWNum(obj.mode, 0); OPM.LogWLn; + ELSE + OPM.LogWStr("unhandled case at OPT.OutObj, obj.mode = "); OPM.LogWNum(obj.mode, 0); OPM.LogWLn; END END END ; @@ -1066,17 +1071,17 @@ END InStruct; i := 1; WHILE i < maxImps DO expCtxt.locmno[i] := -1; INC(i) END ; OutObj(topScope^.right); ext := sfpresent & symExtended; new := ~sfpresent OR symNew; - IF OPM.forceNewSym THEN - new := TRUE - END; (* for bootstrapping -- noch *) + IF OPM.forceNewSym THEN + new := TRUE + END; (* for bootstrapping -- noch *) IF OPM.noerr & sfpresent & (impCtxt.reffp # expCtxt.reffp) THEN new := TRUE; IF ~extsf THEN err(155) END END ; newsf := FALSE; symNew := FALSE; (* because of call to FPrintErr from OPL *) - IF ~OPM.noerr OR findpc THEN - OPM.DeleteNewSym - END + IF ~OPM.noerr OR findpc THEN + OPM.DeleteNewSym + END (* OPM.RegisterNewSym is called in OP2 after writing the object file *) END END @@ -1202,7 +1207,7 @@ Objects: Mod | scope Module Head | txtpos owner firstvar Scope anchor TProc | index sizes firstpar scope leaf Bound procedure, index = 10000H*mthno+entry, entry adr set in back-end - + Structures: form comp | n BaseTyp link mno txtpos sysflag @@ -1238,7 +1243,7 @@ stat = NIL|Ninittd|Nenter|Nassign|Ncall|Nifelse|Ncase|Nwhile|Nrepeat| Nloop|Nexit|Nreturn|Nwith|Ntrap. - class subcl obj left right link + class subcl obj left right link --------------------------------------------------------- design Nvar var nextexpr @@ -1255,7 +1260,7 @@ design Nvar var nextexpr expr design Nconst const (val = node^.conval) - Nupto expr expr nextexpr + Nupto expr expr nextexpr Nmop not expr nextexpr minus expr nextexpr is tsttype expr nextexpr @@ -1322,8 +1327,8 @@ stat NIL Ncase expr casestat stat Nwhile expr stat stat Nrepeat stat expr stat - Nloop stat stat - Nexit stat + Nloop stat stat + Nexit stat Nreturn proc nextexpr stat (proc = NIL for mod) Nwith ifstat stat stat Ntrap expr stat diff --git a/src/compiler/OPV.Mod b/src/compiler/OPV.Mod index 8e00879f..702055f9 100644 --- a/src/compiler/OPV.Mod +++ b/src/compiler/OPV.Mod @@ -1,4 +1,4 @@ -MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 +MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 26.7.2002 jt bug fix in Len: wrong result if called for fixed Array 31.1.2007 jt synchronized with BlackBox version, in particular: @@ -6,7 +6,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 *) IMPORT OPT, OPC, OPM, OPS; - + CONST (* object modes *) Var = 1; VarPar = 2; Fld = 4; Typ = 5; LProc = 6; XProc = 7; @@ -31,8 +31,8 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 Real = 11; LReal = 12; Set = 13; String = 14; NilTyp = 15; NoTyp = 16; Pointer = 17; ProcTyp = 18; Comp = 19;*) - (*Real = 7; LReal = 8; Set = 9; String = 10; NilTyp = 11; Pointer = 13; ProcTyp = 14; - Int8 = 15; Int16 = 16; Int32 = 17; Int64 = 18; + (*Real = 7; LReal = 8; Set = 9; String = 10; NilTyp = 11; Pointer = 13; ProcTyp = 14; + Int8 = 15; Int16 = 16; Int32 = 17; Int64 = 18; Comp = (*15*)19;*) (* composite structure forms *) @@ -57,38 +57,38 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 super = 1; - UndefinedType = 0; (* named type not yet defined *) + UndefinedType = 0; (* named type not yet defined *) ProcessingType = 1; (* pointer type is being processed *) PredefinedType = 2; (* for all predefined types *) - DefinedInHdr = 3+OPM.HeaderFile; (* named type has been defined in header file *) - DefinedInBdy = 3+OPM.BodyFile; (* named type has been defined in body file *) + DefinedInHdr = 3+OPM.HeaderFile; (* named type has been defined in header file *) + DefinedInBdy = 3+OPM.BodyFile; (* named type has been defined in body file *) - OpenParen = "("; - CloseParen = ")"; - OpenBracket = "["; + OpenParen = "("; + CloseParen = ")"; + OpenBracket = "["; CloseBracket = "]"; - Blank = " "; - Comma = ", "; - Deref = "*"; - EntierFunc = "__ENTIER("; - IsFunc = "__IS("; - IsPFunc = "__ISP("; + Blank = " "; + Comma = ", "; + Deref = "*"; + EntierFunc = "__ENTIER("; + IsFunc = "__IS("; + IsPFunc = "__ISP("; GuardPtrFunc = "__GUARDP("; GuardRecFunc = "__GUARDR("; - TypeFunc = "__TYPEOF("; - SetOfFunc = "__SETOF("; + TypeFunc = "__TYPEOF("; + SetOfFunc = "__SETOF("; SetRangeFunc = "__SETRNG("; - CopyFunc = "__COPY("; - MoveFunc = "__MOVE("; - GetFunc = "__GET("; - PutFunc = "__PUT("; - DynTypExt = "__typ"; - WithChk = "__WITHCHK"; - Break = "break"; - ElseStat = "else "; + CopyFunc = "__COPY("; + MoveFunc = "__MOVE("; + GetFunc = "__GET("; + PutFunc = "__PUT("; + DynTypExt = "__typ"; + WithChk = "__WITHCHK"; + Break = "break"; + ElseStat = "else "; - MinPrec = -1; - MaxPrec = 12; + MinPrec = -1; + MaxPrec = 12; ProcTypeVar = 11; (* precedence number when a call is made with a proc type variable *) internal = 0; @@ -145,7 +145,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 IF (typ^.strobj = NIL) & (typ^.align MOD 10000H = 0) THEN INC(recno); INC(base, recno * 10000H) END ; typ^.size := offset; typ^.align := base; (* encode the trailing gap into the symbol table to allow dense packing of extended records *) - typ^.sysflag := typ^.sysflag MOD 100H + SHORT((offset - off0)*100H) + typ^.sysflag := typ^.sysflag MOD 100H + SHORT((offset - off0)*100H) ELSIF c = Array THEN TypSize(typ^.BaseTyp); typ^.size := typ^.n * typ^.BaseTyp^.size; @@ -160,7 +160,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 btyp := typ^.BaseTyp; TypSize(btyp); IF btyp^.comp = DynArr THEN typ^.size := btyp^.size + 4 (* describes dim not size *) ELSE typ^.size := 8 - END ; + END END END END TypSize; @@ -173,7 +173,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 mainprog := OPM.mainprog IN OPM.opt; ansi := OPM.ansi IN OPM.opt END Init; - + PROCEDURE ^Traverse (obj, outerScope: OPT.Object; exported: BOOLEAN); PROCEDURE GetTProcNum(obj: OPT.Object); @@ -284,6 +284,8 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 RETURN 9 | is, abs, cap, odd, cc: RETURN 10 + ELSE + OPM.LogWStr("unhandled case in OPV.Precedence Nmop, subclass = "); OPM.LogWNum(subclass, 0); OPM.LogWLn; END | Ndop: CASE subclass OF @@ -307,8 +309,8 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 RETURN 0 | len, in, ash, msk, bit, lsh, rot: RETURN 10 - ELSE - OPM.LogWStr("unhandled case in OPV.Precedence, subclass = "); OPM.LogWNum(subclass, 0); OPM.LogWLn; + ELSE + OPM.LogWStr("unhandled case in OPV.Precedence Ndop, subclass = "); OPM.LogWNum(subclass, 0); OPM.LogWLn; END; | Nupto: RETURN 10 @@ -355,7 +357,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 IF from < LInt THEN OPM.WriteString("(LONGINT)") END ; Entier(n, 9) (*ELSIF form = Int64 THEN - IF (from >= SInt) & (from <= LInt) OR (from >= Int8) & (from < Int64) THEN OPM.WriteString("(SYSTEM_INT64)") END; + IF (from >= SInt) & (from <= LInt) OR (from >= Int8) & (from < Int64) THEN OPM.WriteString("(SYSTEM_INT64)") END; Entier(n, 9);*) ELSIF form = Int THEN IF from < Int THEN OPM.WriteString("(int)"); expr(n, 9) @@ -474,7 +476,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 | Nguard: typ := n^.typ; obj := n^.left^.obj; IF OPM.typchk IN OPM.opt THEN - IF typ^.comp = Record THEN OPM.WriteString(GuardRecFunc); + IF typ^.comp = Record THEN OPM.WriteString(GuardRecFunc); IF obj^.mnolev # OPM.level THEN (*intermediate level var-par record*) OPM.WriteStringVar(obj^.scope^.name); OPM.WriteString("__curr->"); OPC.Ident(obj) ELSE (*local var-par record*) @@ -497,7 +499,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 | Neguard: IF OPM.typchk IN OPM.opt THEN IF n^.left^.class = Nvarpar THEN OPM.WriteString("__GUARDEQR("); - OPC.CompleteIdent(n^.left^.obj); OPM.WriteString(Comma); TypeOf(n^.left); + OPC.CompleteIdent(n^.left^.obj); OPM.WriteString(Comma); TypeOf(n^.left); ELSE OPM.WriteString("__GUARDEQP("); expr(n^.left^.left, MinPrec) END ; (* __GUARDEQx includes deref *) OPM.WriteString(Comma); OPC.Ident(n^.left^.typ^.strobj); OPM.Write(")") @@ -543,14 +545,16 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 ELSIF ansi THEN (* casting of params should be simplified eventually *) IF (mode = VarPar) & (typ # n^.typ) & (prec = MinPrec) THEN OPM.WriteString("(void*)") END - END ; - IF (mode = VarPar) & (n^.class = Nmop) & (n^.subcl = val) THEN expr(n^.left, prec) (* avoid cast in lvalue *) - ELSE expr(n, prec) - END ; - IF (form = LInt) & (n^.class = Nconst) - & (n^.conval^.intval <= OPM.MaxInt) & (n^.conval^.intval >= OPM.MinInt) THEN - OPM.PromoteIntConstToLInt() - ELSIF (comp = Record) & (mode = VarPar) THEN + END; + IF (mode = VarPar) & (n^.class = Nmop) & (n^.subcl = val) THEN + expr(n^.left, prec) (* avoid cast in lvalue *) + ELSIF (form = LInt) & (n^.class = Nconst) + & (n^.conval^.intval <= OPM.MaxInt) & (n^.conval^.intval >= OPM.MinInt) THEN + OPM.WriteString("((LONGINT)("); expr(n, prec); OPM.WriteString("))"); + ELSE + expr(n, prec) + END; + IF (comp = Record) & (mode = VarPar) THEN OPM.WriteString(", "); TypeOf(n) ELSIF comp = DynArr THEN IF n^.class = Nconst THEN (* ap is string constant *) @@ -566,7 +570,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 WHILE aptyp^.comp = DynArr DO Len(n, dim); OPM.WriteString(" * "); INC(dim); aptyp := aptyp^.BaseTyp END ; - OPM.WriteInt(aptyp^.size); OPM.PromoteIntConstToLInt() + OPM.WriteString("((LONGINT)("); OPM.WriteInt(aptyp^.size); OPM.WriteString("))"); END END END ; @@ -613,7 +617,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 | minus: IF form = Set THEN OPM.Write("~") ELSE OPM.Write("-"); END ; expr(l, exprPrec) - | is: + | is: typ := n^.obj^.typ; IF l^.typ^.comp = Record THEN OPM.WriteString(IsFunc); OPC.TypeOf(l^.obj) ELSE OPM.WriteString(IsPFunc); expr(l, MinPrec); typ := typ^.BaseTyp @@ -638,7 +642,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 | odd: OPM.WriteString("__ODD("); expr(l, MinPrec); OPM.Write(CloseParen) | adr: (*SYSTEM*) - OPM.WriteString("(LONGINT)"); + OPM.WriteString("(LONGINT)(uintptr_t)"); IF l^.class = Nvarpar THEN OPC.CompleteIdent(l^.obj) ELSE IF (l^.typ^.form # String) & ~(l^.typ^.comp IN {Array, DynArr}) THEN OPM.Write("&") END ; @@ -648,9 +652,17 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 IF (n^.typ^.form IN {LInt, Pointer, Set, ProcTyp}) & (l^.typ^.form IN {LInt, Pointer, Set, ProcTyp}) & (n^.typ^.size = l^.typ^.size) OR ~(l^.class IN {Nvar, Nvarpar, Nfield, Nindex}) THEN OPM.Write(OpenParen); OPC.Ident(n^.typ^.strobj); OPM.Write(CloseParen); + IF (n^.typ^.form IN {Pointer, ProcTyp}) OR (l^.typ^.form IN {Pointer, ProcTyp}) THEN + OPM.WriteString("(uintptr_t)") + END; expr(l, exprPrec) ELSE - OPM.WriteString("__VAL("); OPC.Ident(n^.typ^.strobj); OPM.WriteString(Comma); + IF (n^.typ^.form IN {Pointer, ProcTyp}) OR (l^.typ^.form IN {Pointer, ProcTyp}) THEN + OPM.WriteString("__VALP("); + ELSE + OPM.WriteString("__VAL("); + END; + OPC.Ident(n^.typ^.strobj); OPM.WriteString(Comma); expr(l, MinPrec); OPM.Write(CloseParen) END ELSE OPM.err(200) @@ -760,7 +772,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 | Ncall: IF (l^.obj # NIL) & (l^.obj^.mode = TProc) THEN IF l^.subcl = super THEN proc := SuperProc(n) - ELSE OPM.WriteString("__"); proc := OPC.BaseTProc(l^.obj) + ELSE OPM.WriteString("__"); proc := OPC.BaseTProc(l^.obj) END ; OPC.Ident(proc); n^.obj := proc^.link @@ -784,7 +796,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 if := n^.left; (* name := ""; *) WHILE if # NIL DO OPM.WriteString("if "); expr(if^.left, MaxPrec); (* if *) - OPM.Write(Blank); OPC.BegBlk; + OPM.Write(Blank); OPC.BegBlk; IF (n^.class = Nwith) & (if^.left^.left # NIL) THEN (* watch out for const expr *) obj := if^.left^.left^.obj; typ := obj^.typ; adr := obj^.adr; IF typ^.comp = Record THEN @@ -869,18 +881,18 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 ELSIF base^.form = Pointer THEN OPM.WriteString("POINTER__typ") ELSE OPM.WriteString("NIL") END ; - OPM.WriteString(", "); OPM.WriteInt(base^.size); OPM.PromoteIntConstToLInt(); (* element size *) + OPM.WriteString(", "); OPM.WriteString("((LONGINT)("); OPM.WriteInt(base^.size); OPM.WriteString("))"); OPM.WriteString(", "); OPM.WriteInt(OPC.Base(base)); (* element alignment *) - OPM.WriteString(", "); OPM.WriteInt(nofdim); (* total number of dimensions = number of additional parameters *) + OPM.WriteString(", "); OPM.WriteInt(nofdim); (* total number of dimensions = number of additional parameters *) OPM.WriteString(", "); OPM.WriteInt(nofdyn); (* number of dynamic dimensions *) WHILE typ # base DO OPM.WriteString(", "); IF typ^.comp = DynArr THEN - IF x^.class = Nconst THEN expr(x, MinPrec); OPM.PromoteIntConstToLInt() + IF x^.class = Nconst THEN OPM.WriteString("(LONGINT)("); expr(x, MinPrec); OPM.WriteString(")") ELSE OPM.WriteString("(LONGINT)"); expr(x, 10) END ; x := x^.link - ELSE OPM.WriteInt(typ^.n); OPM.PromoteIntConstToLInt() + ELSE OPM.WriteString("(LONGINT)"); OPM.WriteInt(typ^.n) END ; typ := typ^.BaseTyp END ; @@ -1027,14 +1039,19 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 IF OPM.level = 0 THEN IF mainprog THEN OPM.WriteString("__FINI") ELSE OPM.WriteString("__ENDMOD") END ELSE - OPC.ExitProc(outerProc, FALSE, FALSE); - OPM.WriteString("return"); - IF n^.left # NIL THEN OPM.Write(Blank); + IF n^.left # NIL THEN + (* Make local copy of result before ExitProc deletes dynamic vars *) + OPM.WriteString("_o_result = "); IF (n^.left^.typ^.form = Pointer) & (n^.obj^.typ # n^.left^.typ) THEN OPM.WriteString("(void*)"); expr(n^.left, 10) ELSE expr(n^.left, MinPrec) - END + END; + OPM.WriteString(";"); OPM.WriteLn; OPC.BegStat; + OPC.ExitProc(outerProc, FALSE, FALSE); + OPM.WriteString("return _o_result"); + ELSE + OPM.WriteString("return"); END END | Nwith: @@ -1050,7 +1067,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 when compiling Texts0.Mod on raspberry pi it generates __CASECHK and cause Halt, noch *) - OPM.LogWStr("unhandled case in OPV.expr, n^.class = "); OPM.LogWNum(n^.class, 0); OPM.LogWLn; + OPM.LogWStr("unhandled case in OPV.expr, n^.class = "); OPM.LogWNum(n^.class, 0); OPM.LogWLn; END ; IF ~(n^.class IN {Nenter, Ninittd, Nifelse, Nwith, Ncase, Nwhile, Nloop}) THEN OPC.EndStat END ; n := n^.link diff --git a/src/compiler/Vishap.Mod b/src/compiler/Vishap.Mod index a375af43..63cc4260 100644 --- a/src/compiler/Vishap.Mod +++ b/src/compiler/Vishap.Mod @@ -1,37 +1,14 @@ -MODULE voc; (* J. Templ 3.2.95 *) +MODULE Vishap; (* J. Templ 3.2.95 *) IMPORT - SYSTEM, Unix, Kernel := Kernel0, + SYSTEM, Heap, Platform, Configuration, OPP, OPB, OPT, OPV, OPC, OPM, extTools, Strings, vt100; -VAR mname : ARRAY 256 OF CHAR; (* noch *) + VAR mname : ARRAY 256 OF CHAR; (* noch *) - PROCEDURE -signal(sig: LONGINT; func: Unix.SignalHandler) - "signal(sig, func)"; - - PROCEDURE -fin() - "SYSTEM_FINALL()"; - - PROCEDURE -halt(): LONGINT - "SYSTEM_halt"; - -(* - PROCEDURE -gclock() - "SYSTEM_gclock = 1"; -*) - - PROCEDURE Trap(sig, code: LONGINT; scp: Unix.SigCtxPtr); - BEGIN fin(); - IF sig = 3 THEN Unix.Exit(0) - ELSE - IF (sig = 4) & (halt() = -15) THEN OPM.LogWStr(" --- voc: internal error"); OPM.LogWLn END ; - Unix.Exit(2) - END - END Trap; - PROCEDURE Module*(VAR done: BOOLEAN); VAR ext, new: BOOLEAN; p: OPT.Node; BEGIN @@ -45,83 +22,111 @@ VAR mname : ARRAY 256 OF CHAR; (* noch *) OPC.Init; OPV.Module(p); IF OPM.noerr THEN - (*IF (OPM.mainprog IN OPM.opt) & (OPM.modName # "SYSTEM") THEN*) IF (OPM.mainProg OR OPM.mainLinkStat) & (OPM.modName # "SYSTEM") THEN - OPM.DeleteNewSym; - IF ~OPM.notColorOutput THEN vt100.SetAttr(vt100.Green) END; - OPM.LogWStr(" main program"); - IF ~OPM.notColorOutput THEN vt100.SetAttr(vt100.ResetAll) END; + OPM.DeleteNewSym; + IF ~OPM.notColorOutput THEN vt100.SetAttr(vt100.Green) END; + OPM.LogWStr(" Main program."); + IF ~OPM.notColorOutput THEN vt100.SetAttr(vt100.ResetAll) END; ELSE - IF new THEN - IF ~OPM.notColorOutput THEN vt100.SetAttr(vt100.Green) END; - OPM.LogWStr(" new symbol file"); - IF ~OPM.notColorOutput THEN vt100.SetAttr(vt100.ResetAll) END; - OPM.RegisterNewSym - ELSIF ext THEN OPM.LogWStr(" extended symbol file"); OPM.RegisterNewSym + IF new THEN + IF ~OPM.notColorOutput THEN vt100.SetAttr(vt100.Green) END; + OPM.LogWStr(" New symbol file."); + IF ~OPM.notColorOutput THEN vt100.SetAttr(vt100.ResetAll) END; + OPM.RegisterNewSym + ELSIF ext THEN + OPM.LogWStr(" Extended symbol file."); + OPM.RegisterNewSym END END; - - - ELSE OPM.DeleteNewSym + ELSE + OPM.DeleteNewSym END END - END ; + END; OPM.CloseFiles; OPT.Close; - OPM.LogWLn; done := OPM.noerr; - - - + OPM.LogWLn; + done := OPM.noerr; END Module; + + PROCEDURE PropagateElementaryTypeSizes; + BEGIN + OPT.bytetyp.size := OPM.ByteSize; + OPT.sysptrtyp.size := OPM.PointerSize; + OPT.chartyp.size := OPM.CharSize; + OPT.settyp.size := OPM.SetSize; + OPT.realtyp.size := OPM.RealSize; + OPT.inttyp.size := OPM.IntSize; + OPT.linttyp.size := OPM.LIntSize; + OPT.lrltyp.size := OPM.LRealSize; + OPT.sinttyp.size := OPM.SIntSize; + OPT.booltyp.size := OPM.BoolSize; + END PropagateElementaryTypeSizes; + + PROCEDURE Translate*; - VAR done: BOOLEAN; - VAR modulesobj: ARRAY 2048 OF CHAR; (* here we hold all modules name given on the command line, to add corresponding .o files to the external compiler options *) + VAR + done: BOOLEAN; + modulesobj: ARRAY 2048 OF CHAR; (* here we hold all modules name given on the command line, to add corresponding .o files to the external compiler options *) BEGIN modulesobj := ""; - OPM.OpenPar; (* gclock(); slightly faste rtranslation but may lead to opening "too many files" *) - OPT.bytetyp.size := OPM.ByteSize; - (*OPT.int8typ.size := 1; - OPT.int16typ.size := 2; - OPT.int32typ.size := 4; - OPT.int64typ.size := 8;*) - OPT.sysptrtyp.size := OPM.PointerSize; - OPT.chartyp.size := OPM.CharSize; - OPT.settyp.size := OPM.SetSize; - OPT.realtyp.size := OPM.RealSize; - OPT.inttyp.size := OPM.IntSize; - OPT.linttyp.size := OPM.LIntSize; - OPT.lrltyp.size := OPM.LRealSize; - OPT.sinttyp.size := OPM.SIntSize; - OPT.booltyp.size := OPM.BoolSize; - LOOP - OPM.Init(done, mname); - IF ~done THEN EXIT END ; - OPM.InitOptions; - Kernel.GC(FALSE); - Module(done); - IF ~done THEN Unix.Exit(1) END; + IF OPM.OpenPar() THEN + (* gclock(); slightly faster translation but may lead to opening "too many files" *) - (* noch *) - IF done THEN - IF ~OPM.dontAsm THEN - extTools.Assemble(OPM.modName); - IF ~(OPM.mainProg OR OPM.mainLinkStat) THEN Strings.Append(" ",modulesobj); Strings.Append(OPM.modName, modulesobj); Strings.Append(".o ", modulesobj) END; + LOOP + OPM.Init(done, mname); (* Get next module name from command line *) + IF ~done THEN RETURN END ; - IF ~OPM.dontLink & (OPM.mainProg OR OPM.mainLinkStat) THEN - extTools.LinkMain (OPM.modName, OPM.mainLinkStat, modulesobj); - END; - END; - END + OPM.InitOptions; (* Get options ofr this module *) + PropagateElementaryTypeSizes; + (* Compile source to .c and .h files *) + Heap.GC(FALSE); + Module(done); + IF ~done THEN + OPM.LogWLn; OPM.LogWStr("Module compilation failed."); OPM.LogWLn; + Platform.Exit(1) + END; - - - END (* loop *) + (* 'assemble' (i.e. c compile) .c to object or executable. *) + IF ~OPM.dontAsm THEN + IF OPM.dontLink THEN + (* If not linking, just assemble each module. *) + extTools.Assemble(OPM.modName) + ELSE + IF ~(OPM.mainProg OR OPM.mainLinkStat) THEN + (* Assemble non main rogram and add object name to link list *) + extTools.Assemble(OPM.modName); + Strings.Append(" ", modulesobj); + Strings.Append(OPM.modName, modulesobj); + Strings.Append(Configuration.objext, modulesobj) + ELSE + (* Assemble and link main program *) + extTools.LinkMain (OPM.modName, OPM.mainLinkStat, modulesobj) + END + END + END + END (* loop *) + END END Translate; + PROCEDURE Trap(sig: INTEGER); + BEGIN + Heap.FINALL(); + IF sig = 3 THEN + Platform.Exit(0) + ELSE + IF (sig = 4) & (Platform.HaltCode = -15) THEN + OPM.LogWStr(" --- Vishap Oberon: internal error"); + OPM.LogWLn + END ; + Platform.Exit(2) + END + END Trap; + BEGIN - signal(2, Trap); (* interrupt *) - signal(3, Trap); (* quit *) - signal(4, Trap); (* illegal instruction, HALT *) + Platform.SetInterruptHandler(Trap); + Platform.SetQuitHandler(Trap); + Platform.SetBadInstructionHandler(Trap); OPB.typSize := OPV.TypSize; OPT.typSize := OPV.TypSize; Translate -END voc. +END Vishap. diff --git a/src/compiler/extTools.Mod b/src/compiler/extTools.Mod index 30790878..515c13e4 100644 --- a/src/compiler/extTools.Mod +++ b/src/compiler/extTools.Mod @@ -1,88 +1,74 @@ MODULE extTools; - IMPORT Args, Unix, Strings, Console, version; -(* -INCLUDEPATH = -Isrc/lib/system/gnuc/x86_64 -CCOPT = -fPIC $(INCLUDEPATH) -g -CLOBERONOPTS = -fPIC $(INCLUDEPATH) -L. -L/usr/lib -lOberon -static -g -CC = cc $(CCOPT) -c -*) -CONST compiler="gcc"; -VAR incPath0, incPath1, ccOpt, ccString, CFLAGS, tmp0, tmp1 : ARRAY 1023 OF CHAR; +IMPORT Strings, Console, Configuration, Platform, OPM; -PROCEDURE Assemble*(m : ARRAY OF CHAR); -VAR cmd : ARRAY 1023 OF CHAR; -cc : ARRAY 1023 OF CHAR; -ext : ARRAY 5 OF CHAR; +VAR compilationOptions, CFLAGS: ARRAY 1023 OF CHAR; + + +PROCEDURE execute(title: ARRAY OF CHAR; cmd: ARRAY OF CHAR); + VAR r, status, exitcode: INTEGER; BEGIN -COPY (ccString, cc); -Strings.Append (" -c ", cc); -COPY(cc, cmd); -Strings.Append (" ", cmd); -Strings.Append (ccOpt, cmd); -ext := ".c"; -Strings.Append (ext, m); -Strings.Append(m, cmd); -(*Console.Ln; Console.String (cmd); Console.Ln;*) -Unix.system(cmd); -END Assemble; + IF OPM.Verbose THEN Console.String(title); Console.String(cmd); Console.Ln END; + r := Platform.System(cmd); + status := r MOD 128; + exitcode := r DIV 256; + IF exitcode > 127 THEN exitcode := exitcode - 256 END; (* Handle signed exit code *) + + IF r # 0 THEN + Console.String(title); Console.String(cmd); Console.Ln; + Console.String("-- failed: status "); Console.Int(status,1); + Console.String(", exitcode "); Console.Int(exitcode,1); + Console.String("."); Console.Ln; + IF (status = 0) & (exitcode = 127) THEN + Console.String("Is the C compiler in the current command path?"); Console.Ln + END; + IF status # 0 THEN Platform.Halt(status) ELSE Platform.Halt(exitcode) END + END; +END execute; -PROCEDURE LinkMain*(VAR m : ARRAY OF CHAR; statically : BOOLEAN; additionalopts : ARRAY OF CHAR); -VAR lpath : ARRAY 1023 OF CHAR; -cc : ARRAY 1023 OF CHAR; -ccopt : ARRAY 1023 OF CHAR; -cmd : ARRAY 1023 OF CHAR; -ext : ARRAY 5 OF CHAR; -BEGIN -(* -gcc -g -o hello hello.c -I $RPATH/src/lib/system/gnuc/x86_64 -I. -I$RPATH -lOberon -L. -L$RPATH -static -*) -cmd := ""; -cc := ""; -ext := ".c"; -COPY(ccString, cc); -COPY (cc, cmd); -Strings.Append(" ", cmd); -Strings.Append(m, cmd); -Strings.Append(ext, cmd); -Strings.Append(additionalopts, cmd); -IF statically THEN Strings.Append(" -static ", cmd) END; -Strings.Append(" -o ", cmd); -Strings.Append(m, cmd); -Strings.Append(" ", cmd); +PROCEDURE Assemble*(moduleName: ARRAY OF CHAR); + VAR + cmd: ARRAY 1023 OF CHAR; + BEGIN + cmd := Configuration.compile; + Strings.Append(compilationOptions, cmd); + Strings.Append("-c ", cmd); + Strings.Append(moduleName, cmd); + Strings.Append(".c", cmd); + execute("Assemble: ", cmd); + END Assemble; -Strings.Append (" -lVishapOberon -L. -L", ccOpt); -Strings.Append (version.prefix, ccOpt); -Strings.Append ("/lib ", ccOpt); -Strings.Append(ccOpt, cmd); -Console.Ln; Console.String(cmd); Console.Ln; (* may be it's feasible to add debug mode later *) -Unix.system(cmd); -END LinkMain; +PROCEDURE LinkMain*(VAR moduleName: ARRAY OF CHAR; statically: BOOLEAN; additionalopts: ARRAY OF CHAR); + VAR + cmd: ARRAY 1023 OF CHAR; + BEGIN + cmd := Configuration.compile; + Strings.Append(" ", cmd); + Strings.Append(compilationOptions, cmd); + Strings.Append(moduleName, cmd); + Strings.Append(".c ", cmd); + Strings.Append(additionalopts, cmd); + IF statically THEN + Strings.Append(Configuration.staticLink, cmd) + END; + Strings.Append(Configuration.objflag, cmd); + Strings.Append(moduleName, cmd); + Strings.Append(Configuration.linkflags, cmd); + Strings.Append(Configuration.installdir, cmd); + Strings.Append('/lib"', cmd); + Strings.Append(Configuration.libspec, cmd); + + execute("Assemble and link: ", cmd); + END LinkMain; + BEGIN - -incPath0 := "src/lib/system/linux/"; -Strings.Append (compiler, incPath0); -incPath1 := "lib/voc/obj "; -ccOpt := " -fPIC -g "; - -COPY ("-I ", tmp1); -Strings.Append (version.prefix, tmp1); -Strings.Append("/", tmp1); -Strings.Append(incPath0, tmp1); -Strings.Append("/", tmp1); -Strings.Append(version.arch, tmp1); -Strings.Append(" -I ", tmp1); -Strings.Append(version.prefix, tmp1); -Strings.Append("/", tmp1); -Strings.Append(incPath1, tmp1); -Strings.Append(tmp1, ccOpt); -Args.GetEnv("CFLAGS", CFLAGS); -Strings.Append (CFLAGS, ccOpt); -Strings.Append (" ", ccOpt); -ccString := compiler; -Strings.Append (" ", ccString); - + Strings.Append(' -I "', compilationOptions); + Strings.Append(Configuration.installdir, compilationOptions); + Strings.Append('/include" ', compilationOptions); + Platform.GetEnv("CFLAGS", CFLAGS); + Strings.Append (CFLAGS, compilationOptions); + Strings.Append (" ", compilationOptions); END extTools. From 4245c6e8b314a2e4880061f76c8e47d361fc84e5 Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 16 Jun 2016 14:14:39 +0100 Subject: [PATCH 075/580] Update system source to V2. --- src/system/Console.Mod | 20 +- src/system/Files.Mod | 600 +++++++++++++--------- src/system/Heap.Mod | 337 +++++++----- src/system/Kernel0.Mod | 200 -------- src/system/Oberon.Mod | 76 +-- src/system/Platformunix.Mod | 914 +++++++++++++++++---------------- src/system/Platformwindows.Mod | 611 ++++++++++++++++++++++ src/system/SYSTEM.c | 392 +++++++------- src/system/SYSTEM.h | 473 +++++++++-------- src/system/WindowsWrapper.h | 9 + 10 files changed, 2150 insertions(+), 1482 deletions(-) delete mode 100644 src/system/Kernel0.Mod create mode 100755 src/system/Platformwindows.Mod create mode 100755 src/system/WindowsWrapper.h diff --git a/src/system/Console.Mod b/src/system/Console.Mod index e523ef7b..8e2be161 100644 --- a/src/system/Console.Mod +++ b/src/system/Console.Mod @@ -2,20 +2,16 @@ MODULE Console; (* J. Templ, 29-June-96 *) (* output to Unix standard output device based Write system call *) - IMPORT SYSTEM; + IMPORT SYSTEM, Platform; VAR line: ARRAY 128 OF CHAR; pos: INTEGER; - PROCEDURE -Write(adr, n: LONGINT) - "write(1/*stdout*/, adr, n)"; - - PROCEDURE -read(VAR ch: CHAR): LONGINT - "read(0/*stdin*/, ch, 1)"; - - PROCEDURE Flush*(); + PROCEDURE Flush*; + VAR error: Platform.ErrorCode; BEGIN - Write(SYSTEM.ADR(line), pos); pos := 0; + error := Platform.Write(Platform.StdOut, SYSTEM.ADR(line), pos); + pos := 0; END Flush; PROCEDURE Char*(ch: CHAR); @@ -68,16 +64,16 @@ MODULE Console; (* J. Templ, 29-June-96 *) END Hex; PROCEDURE Read*(VAR ch: CHAR); - VAR n: LONGINT; + VAR n: LONGINT; error: Platform.ErrorCode; BEGIN Flush(); - n := read(ch); + error := Platform.ReadBuf(Platform.StdIn, ch, n); IF n # 1 THEN ch := 0X END END Read; PROCEDURE ReadLine*(VAR line: ARRAY OF CHAR); VAR i: LONGINT; ch: CHAR; BEGIN Flush(); - i := 0; Read(ch); + i := 0; Read(ch); WHILE (i < LEN(line) - 1) & (ch # 0AX) & (ch # 0X) DO line[i] := ch; INC(i); Read(ch) END ; line[i] := 0X END ReadLine; diff --git a/src/system/Files.Mod b/src/system/Files.Mod index 1d9cd953..73a78028 100644 --- a/src/system/Files.Mod +++ b/src/system/Files.Mod @@ -1,11 +1,8 @@ -MODULE Files0; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files *) +MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files *) -(* this module is not for use by developers and inteded to bootstrap voc *) -(* for general use import Files module *) + IMPORT SYSTEM, Platform, Heap, Strings, Configuration, Console; - IMPORT SYSTEM, Unix, Kernel := Kernel0, Args, Console; - - (* standard data type I/O + (* standard data type I/O little endian, Sint:1, Int:2, Lint:4 @@ -19,74 +16,71 @@ MODULE Files0; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files CONST nofbufs = 4; bufsize = 4096; - fileTabSize = 64; + fileTabSize = 256; (* 256 needed for Windows *) noDesc = -1; notDone = -1; (* file states *) - open = 0; create = 1; close = 2; + open = 0; (* OS File has been opened *) + create = 1; (* OS file needs to be created *) + close = 2; (* Register telling Create to use registerName directly: + i.e. since we're closing and all data is still in + buffers bypass writing to temp file and then renaming + and just write directly to fianl register name *) TYPE FileName = ARRAY 101 OF CHAR; - File* = POINTER TO Handle; - Buffer = POINTER TO BufDesc; + File* = POINTER TO Handle; + Buffer = POINTER TO BufDesc; Handle = RECORD workName, registerName: FileName; tempFile: BOOLEAN; - dev, ino, mtime: LONGINT; - fd-: INTEGER; + identity: Platform.FileIdentity; + fd-: Platform.FileHandle; len, pos: LONGINT; bufs: ARRAY nofbufs OF Buffer; swapper, state: INTEGER - END ; + END; BufDesc = RECORD - f: File; - chg: BOOLEAN; - org, size: LONGINT; + f: File; + chg: BOOLEAN; + org: LONGINT; + size: LONGINT; data: ARRAY bufsize OF SYSTEM.BYTE - END ; + END; - Rider* = RECORD + Rider* = RECORD res*: LONGINT; eof*: BOOLEAN; buf: Buffer; org, offset: LONGINT - END ; + END; - Time = POINTER TO TimeDesc; - TimeDesc = RECORD - sec*, min*, hour*, mday*, mon*, year*, wday*, isdst*, zone*, gmtoff*: LONGINT; -(* sec*, min*, hour*, mday*, mon*, year*, wday*, isdst*, zone*, gmtoff*: INTEGER;*) - END ; VAR - fileTab: ARRAY fileTabSize OF LONGINT (*=File*); - tempno: INTEGER; + fileTab: ARRAY fileTabSize OF LONGINT (*=File*); + tempno: INTEGER; + HOME: ARRAY 1024 OF CHAR; + SearchPath: POINTER TO ARRAY OF CHAR; -(* for localtime *) - PROCEDURE -includetime() - '#include "time.h"'; - PROCEDURE -localtime(VAR clock: LONGINT): Time - "(Files0_Time) localtime(clock)"; - PROCEDURE -getcwd(VAR cwd: Unix.Name) - "getcwd(cwd, cwd__len)"; PROCEDURE -IdxTrap "__HALT(-1)"; PROCEDURE^ Finalize(o: SYSTEM.PTR); - PROCEDURE Err(s: ARRAY OF CHAR; f: File; errno: LONGINT); + PROCEDURE Err(s: ARRAY OF CHAR; f: File; errcode: Platform.ErrorCode); BEGIN - Console.Ln; Console.String("-- "); Console.String(s); Console.String(": "); + Console.Ln; Console.String("-- "); Console.String(s); Console.String(": "); IF f # NIL THEN - IF f.registerName # "" THEN Console.String(f.registerName) ELSE Console.String(f.workName) END - END ; - IF errno # 0 THEN Console.String(" errno = "); Console.Int(errno, 1) END ; + IF f.registerName # "" THEN Console.String(f.registerName) ELSE Console.String(f.workName) END; + IF f.fd # 0 THEN Console.String("f.fd = "); Console.Int(f.fd,1) END + END; + IF errcode # 0 THEN Console.String(" errcode = "); Console.Int(errcode, 1) END; Console.Ln; HALT(99) END Err; @@ -94,9 +88,9 @@ MODULE Files0; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files PROCEDURE MakeFileName(dir, name: ARRAY OF CHAR; VAR dest: ARRAY OF CHAR); VAR i, j: INTEGER; BEGIN i := 0; j := 0; - WHILE dir[i] # 0X DO dest[i] := dir[i]; INC(i) END ; - IF dest[i-1] # "/" THEN dest[i] := "/"; INC(i) END ; - WHILE name[j] # 0X DO dest[i] := name[j]; INC(i); INC(j) END ; + WHILE dir[i] # 0X DO dest[i] := dir[i]; INC(i) END; + IF dest[i-1] # "/" THEN dest[i] := "/"; INC(i) END; + WHILE name[j] # 0X DO dest[i] := name[j]; INC(i); INC(j) END; dest[i] := 0X END MakeFileName; @@ -105,8 +99,8 @@ MODULE Files0; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files BEGIN INC(tempno); n := tempno; i := 0; IF finalName[0] # "/" THEN (* relative pathname *) - WHILE Kernel.CWD[i] # 0X DO name[i] := Kernel.CWD[i]; INC(i) END; - IF Kernel.CWD[i-1] # "/" THEN name[i] := "/"; INC(i) END + WHILE Platform.CWD[i] # 0X DO name[i] := Platform.CWD[i]; INC(i) END; + IF Platform.CWD[i-1] # "/" THEN name[i] := "/"; INC(i) END END; j := 0; WHILE finalName[j] # 0X DO name[i] := finalName[j]; INC(i); INC(j) END; @@ -114,73 +108,128 @@ MODULE Files0; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files WHILE name[i] # "/" DO DEC(i) END; name[i+1] := "."; name[i+2] := "t"; name[i+3] := "m"; name[i+4] := "p"; name[i+5] := "."; INC(i, 6); WHILE n > 0 DO name[i] := CHR(n MOD 10 + ORD("0")); n := n DIV 10; INC(i) END; - name[i] := "."; INC(i); n := SHORT(Unix.Getpid()); + name[i] := "."; INC(i); n := Platform.PID; WHILE n > 0 DO name[i] := CHR(n MOD 10 + ORD("0")); n := n DIV 10; INC(i) END; name[i] := 0X END GetTempName; PROCEDURE Create(f: File); - VAR stat: Unix.Status; done: BOOLEAN; - errno: LONGINT; err: ARRAY 32 OF CHAR; + VAR + identity: Platform.FileIdentity; + done: BOOLEAN; + error: Platform.ErrorCode; + err: ARRAY 32 OF CHAR; BEGIN + (* + Console.String("Files.Create fd = "); Console.Int(f.fd,1); + Console.String(", registerName = "); Console.String(f.registerName); + Console.String(", workName = "); Console.String(f.workName); + Console.String(", state = "); Console.Int(f.state,1); + Console.Ln; + *) IF f.fd = noDesc THEN - IF f.state = create THEN GetTempName(f.registerName, f.workName); f.tempFile := TRUE + IF f.state = create THEN + GetTempName(f.registerName, f.workName); f.tempFile := TRUE ELSIF f.state = close THEN f.workName := f.registerName; f.registerName := ""; f.tempFile := FALSE - END ; - errno := Unix.Unlink(f.workName); (*unlink first to avoid stale NFS handles and to avoid reuse of inodes*) -f.fd := Unix.Open(f.workName, SHORT(SYSTEM.VAL(LONGINT, (Unix.rdwr + Unix.creat + Unix.trunc))), SHORT(SYSTEM.VAL(LONGINT, ({2, 4,5, 7,8})))); - done := f.fd >= 0; errno := Unix.errno(); - IF (~done & ((errno = Unix.ENFILE) OR (errno = Unix.EMFILE))) OR (done & (f.fd >= fileTabSize)) THEN - IF done & (f.fd >= fileTabSize) THEN errno := Unix.Close(f.fd) END ; - Kernel.GC(TRUE); - f.fd := Unix.Open(f.workName, SHORT(SYSTEM.VAL(LONGINT, (Unix.rdwr + Unix.creat + Unix.trunc))), SHORT(SYSTEM.VAL(LONGINT, {2, 4,5, 7,8}))); - done := f.fd >= 0 - END ; + END; + error := Platform.Unlink(f.workName); (*unlink first to avoid stale NFS handles and to avoid reuse of inodes*) + + error := Platform.New(f.workName, f.fd); + done := error = 0; + (* In case of too many files, try just once more. *) + IF (~done & Platform.TooManyFiles(error)) OR (done & (f.fd >= fileTabSize)) THEN + IF done & (f.fd >= fileTabSize) THEN error := Platform.Close(f.fd) END; + Heap.GC(TRUE); + error := Platform.New(f.workName, f.fd); + done := f.fd = 0 + END; IF done THEN - IF f.fd >= fileTabSize THEN errno := Unix.Close(f.fd); Err("too many files open", f, 0) - ELSE fileTab[f.fd] := SYSTEM.VAL(LONGINT, f); INC(Kernel.nofiles); Kernel.RegisterObject(f, Finalize); - f.state := open; f.pos := 0; errno := Unix.Fstat(f.fd, stat); - f.dev := stat.dev; f.ino := stat.ino; f.mtime := stat.mtime + IF f.fd >= fileTabSize THEN + (* Console.String("f.fd = "); Console.Int(f.fd,1); Console.Ln; *) + error := Platform.Close(f.fd); Err("too many files open", f, 0) + ELSE + fileTab[f.fd] := SYSTEM.VAL(LONGINT, f); + INC(Heap.FileCount); + Heap.RegisterFinalizer(f, Finalize); + f.state := open; + f.pos := 0; + error := Platform.Identify(f.fd, f.identity); END - ELSE errno := Unix.errno(); - IF errno = Unix.ENOENT THEN err := "no such directory" - ELSIF (errno = Unix.ENFILE) OR (errno = Unix.EMFILE) THEN err := "too many files open" - ELSE err := "file not created" - END ; - Err(err, f, errno) + ELSE + IF Platform.NoSuchDirectory(error) THEN err := "no such directory" + ELSIF Platform.TooManyFiles(error) THEN + (* Console.String("f.fd = "); Console.Int(f.fd,1); Console.Ln; *) + err := "too many files open" + ELSE err := "file not created" + END; + Err(err, f, error) END END END Create; PROCEDURE Flush(buf: Buffer); - VAR res: LONGINT; f: File; stat: Unix.Status; + VAR + error: Platform.ErrorCode; + f: File; + (* identity: Platform.FileIdentity; *) BEGIN + (* + Console.String("Files.Flush buf.f.registername = "); Console.String(buf.f.registerName); + Console.String(", buf.f.fd = "); Console.Int(buf.f.fd,1); + Console.String(", buffer at $"); Console.Hex(SYSTEM.ADR(buf.data)); + Console.String(", size "); Console.Int(buf.size,1); Console.Ln; + *) IF buf.chg THEN f := buf.f; Create(f); - IF buf.org # f.pos THEN res := Unix.Lseek(f.fd, buf.org, 0) END ; - res := Unix.Write(f.fd, SYSTEM.ADR(buf.data), buf.size); - IF res < 0 THEN Err("error in writing file", f, Unix.errno()) END ; + IF buf.org # f.pos THEN + error := Platform.Seek(f.fd, buf.org, Platform.SeekSet); + (* + Console.String("Seeking to "); Console.Int(buf.org,1); + Console.String(", error code "); Console.Int(error,1); Console.Ln; + *) + END; + error := Platform.Write(f.fd, SYSTEM.ADR(buf.data), buf.size); + IF error # 0 THEN Err("error writing file", f, error) END; f.pos := buf.org + buf.size; buf.chg := FALSE; - res := Unix.Fstat(f.fd, stat); - f.mtime := stat.mtime + error := Platform.Identify(f.fd, f.identity); + IF error # 0 THEN Err("error identifying file", f, error) END; + (* + error := Platform.Identify(f.fd, identity); + f.identity.mtime := identity.mtime; + *) END END Flush; PROCEDURE Close* (f: File); - VAR i, res: LONGINT; + VAR + i: LONGINT; + error: Platform.ErrorCode; BEGIN + (* + Console.String("Files.Close f.fd = "); Console.Int(f.fd,1); + Console.String(" f.registername = "); Console.String(f.registerName); + Console.String(", f.workName = "); Console.String(f.workName); Console.Ln; + *) IF (f.state # create) OR (f.registerName # "") THEN Create(f); i := 0; - WHILE (i < nofbufs) & (f.bufs[i] # NIL) DO Flush(f.bufs[i]); INC(i) END ; - res := Unix.Fsync(f.fd); - IF res < 0 THEN Err("error in writing file", f, Unix.errno()) END + WHILE (i < nofbufs) & (f.bufs[i] # NIL) DO Flush(f.bufs[i]); INC(i) END; + error := Platform.Sync(f.fd); + (* + Console.String("Syncing closed file. fd = "); Console.Int(f.fd, 1); + Console.String(" error = "); Console.Int(error,1); Console.Ln; + *) + IF error # 0 THEN Err("error writing file", f, error) END; + (* Windows needs us to actually cose the file so that subsequent rename + will not encounter a sharing error. *) + fileTab[f.fd] := 0; + error := Platform.Close(f.fd); + f.fd := noDesc; f.state := create; DEC(Heap.FileCount); END END Close; PROCEDURE Length* (f: File): LONGINT; - BEGIN RETURN f.len - END Length; + BEGIN RETURN f.len END Length; PROCEDURE New* (name: ARRAY OF CHAR): File; VAR f: File; @@ -190,87 +239,108 @@ f.fd := Unix.Open(f.workName, SHORT(SYSTEM.VAL(LONGINT, (Unix.rdwr + Unix.creat RETURN f END New; - PROCEDURE ScanPath(VAR pos: INTEGER; VAR dir: ARRAY OF CHAR); (* supports ~, ~user and blanks inside path *) - VAR i: INTEGER; ch: CHAR; home: ARRAY 256 OF CHAR; + PROCEDURE ScanPath(VAR pos: INTEGER; VAR dir: ARRAY OF CHAR); + (* Extract next individual directory from searchpath starting at pos, + updating pos and returning dir. + Supports ~, ~user and blanks inside path *) + VAR i: INTEGER; ch: CHAR; BEGIN - i := 0; ch := Kernel.OBERON[pos]; - WHILE (ch = " ") OR (ch = ":") DO INC(pos); ch := Kernel.OBERON[pos] END ; - IF ch = "~" THEN - INC(pos); ch := Kernel.OBERON[pos]; - home := ""; Args.GetEnv("HOME", home); - WHILE home[i] # 0X DO dir[i] := home[i]; INC(i) END ; - IF (ch # "/") & (ch # 0X) & (ch # ":") & (ch # " ") THEN - WHILE (i > 0) & (dir[i-1] # "/") DO DEC(i) END + i := 0; + IF SearchPath = NIL THEN + IF pos = 0 THEN + dir[0] := "."; i := 1; INC(pos) (* Default search path is just the current directory *) END - END ; - WHILE (ch # 0X) & (ch # ":") DO dir[i] := ch; INC(i); INC(pos); ch := Kernel.OBERON[pos] END ; - WHILE (i > 0) & (dir[i-1] = " ") DO DEC(i) END ; + ELSE + ch := SearchPath[pos]; + WHILE (ch = " ") OR (ch = ";") DO INC(pos); ch := SearchPath[pos] END; + IF ch = "~" THEN + INC(pos); ch := SearchPath[pos]; + WHILE HOME[i] # 0X DO dir[i] := HOME[i]; INC(i) END; + IF (ch # "/") & (ch # 0X) & (ch # ";") & (ch # " ") THEN + WHILE (i > 0) & (dir[i-1] # "/") DO DEC(i) END + END + END; + WHILE (ch # 0X) & (ch # ";") DO dir[i] := ch; INC(i); INC(pos); ch := SearchPath[pos] END; + WHILE (i > 0) & (dir[i-1] = " ") DO DEC(i) END + END; dir[i] := 0X END ScanPath; PROCEDURE HasDir(VAR name: ARRAY OF CHAR): BOOLEAN; VAR i: INTEGER; ch: CHAR; BEGIN i := 0; ch := name[0]; - WHILE (ch # 0X) & (ch # "/") DO INC(i); ch := name[i] END ; + WHILE (ch # 0X) & (ch # "/") DO INC(i); ch := name[i] END; RETURN ch = "/" END HasDir; - PROCEDURE CacheEntry(dev, ino: LONGINT; mtime: LONGINT): File; - VAR f: File; i: INTEGER; stat: Unix.Status; res: LONGINT; + PROCEDURE CacheEntry(identity: Platform.FileIdentity): File; + VAR f: File; i: INTEGER; error: Platform.ErrorCode; BEGIN i := 0; WHILE i < fileTabSize DO f := SYSTEM.VAL(File, fileTab[i]); - IF (f # NIL) & (ino = f.ino) & (dev = f.dev) THEN - IF mtime # f.mtime THEN i := 0; + IF (f # NIL) & Platform.SameFile(identity, f.identity) THEN + IF ~Platform.SameFileTime(identity, f.identity) THEN i := 0; WHILE i < nofbufs DO - IF f.bufs[i] # NIL THEN f.bufs[i].org := -1; f.bufs[i] := NIL END ; + IF f.bufs[i] # NIL THEN f.bufs[i].org := -1; f.bufs[i] := NIL END; INC(i) - END ; - f.swapper := -1; f.mtime := mtime; - res := Unix.Fstat(f.fd, stat); f.len := stat.size - END ; + END; + f.swapper := -1; f.identity := identity; + error := Platform.Size(f.fd, f.len); + END; RETURN f - END ; + END; INC(i) - END ; + END; RETURN NIL END CacheEntry; - PROCEDURE Old* (name: ARRAY OF CHAR): File; - VAR f: File; fd: INTEGER; res, errno: LONGINT; pos: INTEGER; done: BOOLEAN; + PROCEDURE Old*(name: ARRAY OF CHAR): File; + VAR + f: File; + fd: Platform.FileHandle; + pos: INTEGER; + done: BOOLEAN; dir, path: ARRAY 256 OF CHAR; - stat: Unix.Status; + error: Platform.ErrorCode; + identity: Platform.FileIdentity; BEGIN + (* Console.String("Files.Old "); Console.String(name); Console.Ln; *) IF name # "" THEN IF HasDir(name) THEN dir := ""; COPY(name, path) ELSE pos := 0; ScanPath(pos, dir); MakeFileName(dir, name, path); ScanPath(pos, dir) - END ; + END; LOOP - fd := Unix.Open(path, SHORT(SYSTEM.VAL(LONGINT, Unix.rdwr)), SHORT(SYSTEM.VAL(LONGINT, {}))); done := fd >= 0; errno := Unix.errno(); - IF (~done & ((errno = Unix.ENFILE) OR (errno = Unix.EMFILE))) OR (done & (fd >= fileTabSize)) THEN - IF done & (fd >= fileTabSize) THEN res := Unix.Close(fd) END ; - Kernel.GC(TRUE); - fd := Unix.Open(path, SHORT(SYSTEM.VAL(LONGINT, Unix.rdwr)), SHORT(SYSTEM.VAL(LONGINT, {}))); - done := fd >= 0; errno := Unix.errno(); - IF ~done & ((errno = Unix.ENFILE) OR (errno = Unix.EMFILE)) THEN Err("too many files open", f, errno) END - END ; - IF ~done & ((errno = Unix.EACCES) OR (errno = Unix.EROFS) OR (errno = Unix.EAGAIN)) THEN - (* errno EAGAIN observed on Solaris 2.4 *) - fd := Unix.Open(path, SHORT(SYSTEM.VAL(LONGINT, Unix.rdonly)), SHORT(SYSTEM.VAL(LONGINT, {}))); done := fd >= 0; errno := Unix.errno() - END ; -IF (~done) & (errno # Unix.ENOENT) THEN - Console.String("warning Files0.Old "); Console.String(name); - Console.String(" errno = "); Console.Int(errno, 0); Console.Ln; -END ; + error := Platform.OldRW(path, fd); done := error = 0; + IF (~done & Platform.TooManyFiles(error)) OR (done & (fd >= fileTabSize)) THEN + IF done & (fd >= fileTabSize) THEN error := Platform.Close(fd) END; + Heap.GC(TRUE); + error := Platform.OldRW(path, fd); done := error = 0; + IF ~done & Platform.TooManyFiles(error) THEN + (* Console.String("fd = "); Console.Int(fd,1); Console.Ln; *) + Err("too many files open", f, error) + END + END; + IF ~done & Platform.Inaccessible(error) THEN + error := Platform.OldRO(path, fd); done := error = 0; + END; + IF (~done) & (~Platform.Absent(error)) THEN + Console.String("Warning: Files.Old "); Console.String(name); + Console.String(" error = "); Console.Int(error, 0); Console.Ln; + END; IF done THEN - res := Unix.Fstat(fd, stat); - f := CacheEntry(stat.dev, stat.ino, stat.mtime); - IF f # NIL THEN res := Unix.Close(fd); RETURN f - ELSIF fd >= fileTabSize THEN res := Unix.Close(fd); Err("too many files open", f, 0) - ELSE NEW(f); fileTab[fd] := SYSTEM.VAL(LONGINT, f); INC(Kernel.nofiles); Kernel.RegisterObject(f, Finalize); - f.fd := fd; f.state := open; f.len := stat.size; f.pos := 0; f.swapper := -1; (*all f.buf[i] = NIL*) + (* Console.String(" fd = "); Console.Int(fd,1); Console.Ln; *) + error := Platform.Identify(fd, identity); + f := CacheEntry(identity); + IF f # NIL THEN error := Platform.Close(fd); RETURN f + ELSIF fd >= fileTabSize THEN + (* Console.String("fd = "); Console.Int(fd,1); Console.Ln; *) + error := Platform.Close(fd); + Err("too many files open", f, 0) + ELSE NEW(f); fileTab[fd] := SYSTEM.VAL(LONGINT, f); INC(Heap.FileCount); Heap.RegisterFinalizer(f, Finalize); + f.fd := fd; f.state := open; f.pos := 0; f.swapper := -1; (*all f.buf[i] = NIL*) + error := Platform.Size(fd, f.len); COPY(name, f.workName); f.registerName := ""; f.tempFile := FALSE; - f.dev := stat.dev; f.ino := stat.ino; f.mtime := stat.mtime; + f.identity := identity; RETURN f END ELSIF dir = "" THEN RETURN NIL @@ -282,24 +352,26 @@ END ; END Old; PROCEDURE Purge* (f: File); - VAR i: INTEGER; stat: Unix.Status; res: LONGINT; + VAR i: INTEGER; identity: Platform.FileIdentity; error: Platform.ErrorCode; BEGIN i := 0; WHILE i < nofbufs DO - IF f.bufs[i] # NIL THEN f.bufs[i].org := -1; f.bufs[i] := NIL END ; + IF f.bufs[i] # NIL THEN f.bufs[i].org := -1; f.bufs[i] := NIL END; INC(i) - END ; - IF f.fd # noDesc THEN res := Unix.Ftruncate(f.fd, 0); res := Unix.Lseek(f.fd, 0, 0) END ; + END; + IF f.fd # noDesc THEN + error := Platform.Truncate(f.fd, 0); + error := Platform.Seek(f.fd, 0, Platform.SeekSet) + END; f.pos := 0; f.len := 0; f.swapper := -1; - res := Unix.Fstat(f.fd, stat); f.mtime := stat.mtime + error := Platform.Identify(f.fd, identity); Platform.SetMTime(f.identity, identity) END Purge; PROCEDURE GetDate* (f: File; VAR t, d: LONGINT); - VAR stat: Unix.Status; clock, res: LONGINT; time: Time; + VAR + identity: Platform.FileIdentity; error: Platform.ErrorCode; BEGIN - Create(f); res := Unix.Fstat(f.fd, stat); - time := localtime(stat.mtime); - t := time.sec + ASH(time.min, 6) + ASH(time.hour, 12); - d := time.mday + ASH(time.mon+1, 5) + ASH(time.year MOD 100, 9) + Create(f); error := Platform.Identify(f.fd, identity); + Platform.MTimeAsClock(identity, t, d) END GetDate; PROCEDURE Pos* (VAR r: Rider): LONGINT; @@ -307,12 +379,19 @@ END ; END Pos; PROCEDURE Set* (VAR r: Rider; f: File; pos: LONGINT); - VAR org, offset, i, n, res: LONGINT; buf: Buffer; + VAR org, offset, i, n: LONGINT; buf: Buffer; error: Platform.ErrorCode; BEGIN IF f # NIL THEN - IF pos > f.len THEN pos := f.len ELSIF pos < 0 THEN pos := 0 END ; + (* + Console.String("Files.Set rider on fd = "); Console.Int(f.fd,1); + Console.String(", registerName = "); Console.String(f.registerName); + Console.String(", workName = "); Console.String(f.workName); + Console.String(", state = "); Console.Int(f.state,1); + Console.Ln; + *) + IF pos > f.len THEN pos := f.len ELSIF pos < 0 THEN pos := 0 END; offset := pos MOD bufsize; org := pos - offset; i := 0; - WHILE (i < nofbufs) & (f.bufs[i] # NIL) & (org # f.bufs[i].org) DO INC(i) END ; + WHILE (i < nofbufs) & (f.bufs[i] # NIL) & (org # f.bufs[i].org) DO INC(i) END; IF i < nofbufs THEN IF f.bufs[i] = NIL THEN NEW(buf); buf.chg := FALSE; buf.org := -1; buf.f := f; f.bufs[i] := buf ELSE buf := f.bufs[i] @@ -321,20 +400,20 @@ END ; f.swapper := (f.swapper + 1) MOD nofbufs; buf := f.bufs[f.swapper]; Flush(buf) - END ; + END; IF buf.org # org THEN IF org = f.len THEN buf.size := 0 ELSE Create(f); - IF f.pos # org THEN res := Unix.Lseek(f.fd, org, 0) END ; - n := Unix.ReadBlk(f.fd, buf.data); - IF n < 0 THEN Err("read from file not done", f, Unix.errno()) END ; + IF f.pos # org THEN error := Platform.Seek(f.fd, org, Platform.SeekSet) END; + error := Platform.ReadBuf(f.fd, buf.data, n); + IF error # 0 THEN Err("read from file not done", f, error) END; f.pos := org + n; buf.size := n - END ; + END; buf.org := org; buf.chg := FALSE END ELSE buf := NIL; org := 0; offset := 0 - END ; + END; r.buf := buf; r.org := org; r.offset := offset; r.eof := FALSE; r.res := 0 END Set; @@ -342,33 +421,33 @@ END ; VAR offset: LONGINT; buf: Buffer; BEGIN buf := r.buf; offset := r.offset; - IF r.org # buf.org THEN Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset END ; + IF r.org # buf.org THEN Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset END; IF (offset < buf.size) THEN x := buf.data[offset]; r.offset := offset + 1 ELSIF r.org + offset < buf.f.len THEN Set(r, r.buf.f, r.org + offset); x := r.buf.data[0]; r.offset := 1 ELSE - x := 0X; r.eof := TRUE + x := 0X; r.eof := TRUE END END Read; PROCEDURE ReadBytes* (VAR r: Rider; VAR x: ARRAY OF SYSTEM.BYTE; n: LONGINT); VAR xpos, min, restInBuf, offset: LONGINT; buf: Buffer; BEGIN - IF n > LEN(x) THEN IdxTrap END ; + IF n > LEN(x) THEN IdxTrap END; xpos := 0; buf := r.buf; offset := r.offset; WHILE n > 0 DO IF (r.org # buf.org) OR (offset >= bufsize) THEN Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset - END ; - restInBuf := buf.size - offset; + END; + restInBuf := buf.size - offset; IF restInBuf = 0 THEN r.res := n; r.eof := TRUE; RETURN - ELSIF n > restInBuf THEN min := restInBuf ELSE min := n END ; + ELSIF n > restInBuf THEN min := restInBuf ELSE min := n END; SYSTEM.MOVE(SYSTEM.ADR(buf.data) + offset, SYSTEM.ADR(x) + xpos, min); INC(offset, min); r.offset := offset; INC(xpos, min); DEC(n, min) - END ; + END; r.res := 0; r.eof := FALSE END ReadBytes; @@ -388,32 +467,32 @@ END ; IF (r.org # buf.org) OR (offset >= bufsize) THEN Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset - END ; + END; buf.data[offset] := x; buf.chg := TRUE; IF offset = buf.size THEN INC(buf.size); INC(buf.f.len) - END ; + END; r.offset := offset + 1; r.res := 0 END Write; PROCEDURE WriteBytes* (VAR r: Rider; VAR x: ARRAY OF SYSTEM.BYTE; n: LONGINT); VAR xpos, min, restInBuf, offset: LONGINT; buf: Buffer; BEGIN - IF n > LEN(x) THEN IdxTrap END ; + IF n > LEN(x) THEN IdxTrap END; xpos := 0; buf := r.buf; offset := r.offset; WHILE n > 0 DO IF (r.org # buf.org) OR (offset >= bufsize) THEN Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset - END ; + END; restInBuf := bufsize - offset; - IF n > restInBuf THEN min := restInBuf ELSE min := n END ; + IF n > restInBuf THEN min := restInBuf ELSE min := n END; SYSTEM.MOVE(SYSTEM.ADR(x) + xpos, SYSTEM.ADR(buf.data) + offset, min); INC(offset, min); r.offset := offset; - IF offset > buf.size THEN INC(buf.f.len, offset - buf.size); buf.size := offset END ; + IF offset > buf.size THEN INC(buf.f.len, offset - buf.size); buf.size := offset END; INC(xpos, min); DEC(n, min); buf.chg := TRUE - END ; + END; r.res := 0 END WriteBytes; @@ -426,9 +505,9 @@ PROCEDURE Write* (VAR r: Rider; x: SYSTEM.BYTE); VAR buf: Buffer; offset: LONGINT; BEGIN buf := r.buf; offset := r.offset; - IF (offset >= bufsize) OR (r.org # buf.org) THEN + IF (offset >= bufsize) OR (r.org # buf.org) THEN Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset; - END ; + END; buf.data[offset] := x; r.offset := offset + 1; buf.chg := TRUE END Write; @@ -442,7 +521,7 @@ BEGIN IF r.org + offset >= buf.f.len THEN x := 0X; r.eof := TRUE; RETURN ELSE Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset END - END ; + END; x := buf.data[offset]; r.offset := offset + 1 END Read; @@ -450,73 +529,91 @@ but this would also affect Set, Length, and Flush. Especially Length would become fairly complex. *) - PROCEDURE Delete* (name: ARRAY OF CHAR; VAR res: INTEGER); - BEGIN - res := SHORT(Unix.Unlink(name)); - res := SHORT(Unix.errno()) - END Delete; + PROCEDURE Delete*(name: ARRAY OF CHAR; VAR res: INTEGER); + BEGIN res := Platform.Unlink(name) END Delete; PROCEDURE Rename* (old, new: ARRAY OF CHAR; VAR res: INTEGER); - VAR fdold, fdnew: INTEGER; n, errno, r: LONGINT; - ostat, nstat: Unix.Status; + VAR + fdold, fdnew: Platform.FileHandle; + n: LONGINT; + error, ignore: Platform.ErrorCode; + oldidentity, newidentity: Platform.FileIdentity; buf: ARRAY 4096 OF CHAR; BEGIN - r := Unix.Stat(old, ostat); - IF r >= 0 THEN - r := Unix.Stat(new, nstat); - IF (r >= 0) & ((ostat.dev # nstat.dev) OR (ostat.ino # nstat.ino)) THEN - Delete(new, res); (* work around stale nfs handles *) - END ; - r := Unix.Rename(old, new); - IF r < 0 THEN res := SHORT(Unix.errno()); - IF res = Unix.EXDEV THEN (* cross device link, move the file *) - fdold := Unix.Open(old, SHORT(SYSTEM.VAL(LONGINT, Unix.rdonly)), SHORT(SYSTEM.VAL(LONGINT, {}))); - IF fdold < 0 THEN res := 2; RETURN END ; - fdnew := Unix.Open(new, SHORT(SYSTEM.VAL(LONGINT, Unix.rdwr + Unix.creat + Unix.trunc)), SHORT(SYSTEM.VAL(LONGINT, {2, 4,5, 7,8}))); - IF fdnew < 0 THEN r := Unix.Close(fdold); res := 3; RETURN END ; - n := Unix.Read(fdold, SYSTEM.ADR(buf), bufsize); - WHILE n > 0 DO - r := Unix.Write(fdnew, SYSTEM.ADR(buf), n); - IF r < 0 THEN errno := Unix.errno(); r := Unix.Close(fdold); r := Unix.Close(fdnew); - Err("cannot move file", NIL, errno) - END ; - n := Unix.Read(fdold, SYSTEM.ADR(buf), bufsize) - END ; - errno := Unix.errno(); - r := Unix.Close(fdold); r := Unix.Close(fdnew); - IF n = 0 THEN r := Unix.Unlink(old); res := 0 - ELSE Err("cannot move file", NIL, errno) - END ; - ELSE RETURN (* res is Unix.Rename return code *) - END - END ; - res := 0 - ELSE res := 2 (* old file not found *) + (* + Console.String("Files.Rename old = "); Console.String(old); + Console.String(", new = "); Console.String(new); Console.Ln; + *) + error := Platform.IdentifyByName(old, oldidentity); + IF error = 0 THEN + error := Platform.IdentifyByName(new, newidentity); + IF (error # 0) & ~Platform.SameFile(oldidentity, newidentity) THEN + Delete(new, error); (* work around stale nfs handles *) + END; + error := Platform.Rename(old, new); + (* Console.String("Platform.Rename error code "); Console.Int(error,1); Console.Ln; *) + IF ~Platform.DifferentFilesystems(error) THEN + res := error; RETURN + ELSE + (* cross device link, move the file *) + error := Platform.OldRO(old, fdold); + IF error # 0 THEN res := 2; RETURN END; + error := Platform.New(new, fdnew); + IF error # 0 THEN error := Platform.Close(fdold); res := 3; RETURN END; + error := Platform.Read(fdold, SYSTEM.ADR(buf), bufsize, n); + WHILE n > 0 DO + error := Platform.Write(fdnew, SYSTEM.ADR(buf), n); + IF error # 0 THEN + ignore := Platform.Close(fdold); + ignore := Platform.Close(fdnew); + Err("cannot move file", NIL, error) + END; + error := Platform.Read(fdold, SYSTEM.ADR(buf), bufsize, n); + END; + ignore := Platform.Close(fdold); + ignore := Platform.Close(fdnew); + IF n = 0 THEN + error := Platform.Unlink(old); res := 0 + ELSE + Err("cannot move file", NIL, error) + END; + END + ELSE + res := 2 (* old file not found *) END END Rename; PROCEDURE Register* (f: File); - VAR idx, errno: INTEGER; f1: File; file: ARRAY 104 OF CHAR; + VAR idx, errcode: INTEGER; f1: File; file: ARRAY 104 OF CHAR; BEGIN - IF (f.state = create) & (f.registerName # "") THEN f.state := close (* shortcut renaming *) END ; + (* + Console.String("Files.Register f.registerName = "); Console.String(f.registerName); + Console.String(", fd = "); Console.Int(f.fd,1); Console.Ln; + *) + IF (f.state = create) & (f.registerName # "") THEN f.state := close (* shortcut renaming *) END; Close(f); IF f.registerName # "" THEN - Rename(f.workName, f.registerName, errno); - IF errno # 0 THEN COPY(f.registerName, file); HALT(99) END ; + Rename(f.workName, f.registerName, errcode); + (* + Console.String("Renamed (for register) f.fd = "); Console.Int(f.fd,1); + Console.String(" from workname "); Console.String(f.workName); + Console.String(" to registerName "); Console.String(f.registerName); + Console.String(" errorcode = "); Console.Int(errcode,1); Console.Ln; + *) + IF errcode # 0 THEN COPY(f.registerName, file); HALT(99) END; f.workName := f.registerName; f.registerName := ""; f.tempFile := FALSE END END Register; PROCEDURE ChangeDirectory*(path: ARRAY OF CHAR; VAR res: INTEGER); BEGIN - res := SHORT(Unix.Chdir(path)); - getcwd(Kernel.CWD) + res := Platform.Chdir(path); END ChangeDirectory; PROCEDURE FlipBytes(VAR src, dest: ARRAY OF SYSTEM.BYTE); VAR i, j: LONGINT; BEGIN - IF ~Kernel.littleEndian THEN i := LEN(src); j := 0; + IF ~Platform.LittleEndian THEN i := LEN(src); j := 0; WHILE i > 0 DO DEC(i); dest[j] := src[i]; INC(j) END ELSE SYSTEM.MOVE(SYSTEM.ADR(src), SYSTEM.ADR(dest), LEN(src)) END @@ -531,35 +628,51 @@ Especially Length would become fairly complex. BEGIN ReadBytes(R, b, 2); x := ORD(b[0]) + ORD(b[1])*256 END ReadInt; - + PROCEDURE ReadLInt* (VAR R: Rider; VAR x: LONGINT); VAR b: ARRAY 4 OF CHAR; BEGIN ReadBytes(R, b, 4); x := ORD(b[0]) + ORD(b[1])*100H + ORD(b[2])*10000H + ORD(b[3])*1000000H END ReadLInt; - + PROCEDURE ReadSet* (VAR R: Rider; VAR x: SET); VAR b: ARRAY 4 OF CHAR; BEGIN ReadBytes(R, b, 4); x := SYSTEM.VAL(SET, ORD(b[0]) + ORD(b[1])*100H + ORD(b[2])*10000H + ORD(b[3])*1000000H) END ReadSet; - + PROCEDURE ReadReal* (VAR R: Rider; VAR x: REAL); VAR b: ARRAY 4 OF CHAR; BEGIN ReadBytes(R, b, 4); FlipBytes(b, x) END ReadReal; - + PROCEDURE ReadLReal* (VAR R: Rider; VAR x: LONGREAL); VAR b: ARRAY 8 OF CHAR; BEGIN ReadBytes(R, b, 8); FlipBytes(b, x) END ReadLReal; - + PROCEDURE ReadString* (VAR R: Rider; VAR x: ARRAY OF CHAR); VAR i: INTEGER; ch: CHAR; BEGIN i := 0; REPEAT Read(R, ch); x[i] := ch; INC(i) UNTIL ch = 0X END ReadString; - + + PROCEDURE ReadLine* (VAR R: Rider; VAR x: ARRAY OF CHAR); + VAR i: INTEGER; ch: CHAR; b : BOOLEAN; + BEGIN + i := 0; + b := FALSE; + REPEAT + Read(R, ch); + IF ((ch = 0X) OR (ch = 0AX) OR (ch = 0DX)) THEN + b := TRUE + ELSE + x[i] := ch; + INC(i); + END; + UNTIL b + END ReadLine; + PROCEDURE ReadNum* (VAR R: Rider; VAR x: LONGINT); VAR s: SHORTINT; ch: CHAR; n: LONGINT; BEGIN s := 0; n := 0; Read(R, ch); @@ -567,70 +680,93 @@ Especially Length would become fairly complex. INC(n, ASH(ORD(ch) MOD 64 - ORD(ch) DIV 64 * 64, s) ); x := n END ReadNum; - + PROCEDURE WriteBool* (VAR R: Rider; x: BOOLEAN); BEGIN Write(R, SYSTEM.VAL(CHAR, x)) END WriteBool; - + PROCEDURE WriteInt* (VAR R: Rider; x: INTEGER); VAR b: ARRAY 2 OF CHAR; BEGIN b[0] := CHR(x); b[1] := CHR(x DIV 256); WriteBytes(R, b, 2); END WriteInt; - + PROCEDURE WriteLInt* (VAR R: Rider; x: LONGINT); VAR b: ARRAY 4 OF CHAR; BEGIN b[0] := CHR(x); b[1] := CHR(x DIV 100H); b[2] := CHR(x DIV 10000H); b[3] := CHR(x DIV 1000000H); WriteBytes(R, b, 4); END WriteLInt; - + PROCEDURE WriteSet* (VAR R: Rider; x: SET); VAR b: ARRAY 4 OF CHAR; i: LONGINT; BEGIN i := SYSTEM.VAL(LONGINT, x); 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; - + PROCEDURE WriteReal* (VAR R: Rider; x: REAL); VAR b: ARRAY 4 OF CHAR; BEGIN FlipBytes(x, b); WriteBytes(R, b, 4) END WriteReal; - + PROCEDURE WriteLReal* (VAR R: Rider; x: LONGREAL); VAR b: ARRAY 8 OF CHAR; BEGIN FlipBytes(x, b); WriteBytes(R, b, 8) END WriteLReal; - + PROCEDURE WriteString* (VAR R: Rider; x: ARRAY [1] OF CHAR); VAR i: INTEGER; BEGIN i := 0; - WHILE x[i] # 0X DO INC(i) END ; + WHILE x[i] # 0X DO INC(i) END; WriteBytes(R, x, i+1) END WriteString; - + PROCEDURE WriteNum* (VAR R: Rider; x: LONGINT); BEGIN WHILE (x < - 64) OR (x > 63) DO Write(R, CHR(x MOD 128 + 128)); x := x DIV 128 END; Write(R, CHR(x MOD 128)) END WriteNum; + PROCEDURE GetName*(f: File; VAR name: ARRAY OF CHAR); + BEGIN + COPY (f.workName, name); + END GetName; + PROCEDURE Finalize(o: SYSTEM.PTR); VAR f: File; res: LONGINT; BEGIN f := SYSTEM.VAL(File, o); + (* + Console.String("Files.Finalize f.fd = "); Console.Int(f.fd,1); + Console.String(", f.registername = "); Console.String(f.registerName); + Console.String(", f.workName = "); Console.String(f.workName); Console.Ln; + *) IF f.fd >= 0 THEN - fileTab[f.fd] := 0; res := Unix.Close(f.fd); f.fd := -1; DEC(Kernel.nofiles); - IF f.tempFile THEN res := Unix.Unlink(f.workName) END + fileTab[f.fd] := 0; res := Platform.Close(f.fd); f.fd := -1; DEC(Heap.FileCount); + IF f.tempFile THEN res := Platform.Unlink(f.workName) END END END Finalize; + PROCEDURE SetSearchPath*(path: ARRAY OF CHAR); + BEGIN + IF Strings.Length(path) # 0 THEN + NEW(SearchPath, Strings.Length(path)+1); + COPY(path, SearchPath^) + ELSE + SearchPath := NIL + END + END SetSearchPath; + PROCEDURE Init; VAR i: LONGINT; BEGIN - i := 0; WHILE i < fileTabSize DO fileTab[i] := 0; INC(i) END ; - tempno := -1; Kernel.nofiles := 0 + i := 0; WHILE i < fileTabSize DO fileTab[i] := 0; INC(i) END; + tempno := -1; + Heap.FileCount := 0; + SearchPath := NIL; + HOME := ""; Platform.GetEnv("HOME", HOME); END Init; BEGIN Init -END Files0. +END Files. diff --git a/src/system/Heap.Mod b/src/system/Heap.Mod index 6fc08dcf..a323c785 100644 --- a/src/system/Heap.Mod +++ b/src/system/Heap.Mod @@ -1,60 +1,52 @@ -(* -* voc (jet backend) runtime system, Version 1.1 -* -* Copyright (c) Software Templ, 1994, 1995, 1996 -* -* Module SYSTEM is subject to change any time without prior notification. -* Software Templ disclaims all warranties with regard to module SYSTEM, -* in particular shall Software Templ not be liable for any damage resulting -* from inappropriate use or modification of module SYSTEM. -*) +MODULE Heap; -MODULE SYSTEM; (* J. Templ, 31.5.95 *) + IMPORT SYSTEM; (* Cannot import anything else as heap initialization must complete + before any other modules are initialized. *) - IMPORT SYSTEM; (*must not import other modules*) - - CONST + CONST ModNameLen = 20; CmdNameLen = 24; - SZL = SIZE(LONGINT); - Unit = 4*SZL; (* smallest possible heap block *) - nofLists = 9; (* number of free_lists *) - heapSize0 = 8000*Unit; (* startup heap size *) + SZL = SIZE(LONGINT); + Unit = 4*SZL; (* smallest possible heap block *) + nofLists = 9; (* number of free_lists *) + heapSize0 = 8000*Unit; (* startup heap size *) (* all blocks look the same: free blocks describe themselves: size = Unit tag = &tag++ - ->blksize + ->block size sentinel = -SZL next *) (* heap chunks *) - nextChnkOff = 0; (* next heap chunk, sorted ascendingly! *) - endOff = SZL; (* end of heap chunk *) - blkOff = 3*SZL; (* first block in a chunk *) + nextChnkOff = LONG(LONG(0)); (* next heap chunk, sorted ascendingly! *) + endOff = LONG(LONG(SZL)); (* end of heap chunk *) + blkOff = LONG(LONG(3*SZL)); (* first block in a chunk *) (* heap blocks *) - tagOff = 0; (* block starts with tag *) - sizeOff = SZL; (* block size in free block relative to block start *) - sntlOff = 2*SZL; (* pointer offset table sentinel in free block relative to block start *) - nextOff = 3*SZL; (* next pointer in free block relative to block start *) + tagOff = LONG(LONG(0)); (* block starts with tag *) + sizeOff = LONG(LONG(SZL)); (* block size in free block relative to block start *) + sntlOff = LONG(LONG(2*SZL)); (* pointer offset table sentinel in free block relative to block start *) + nextOff = LONG(LONG(3*SZL)); (* next pointer in free block relative to block start *) NoPtrSntl = LONG(LONG(-SZL)); - + LongZero = LONG(LONG(0)); TYPE ModuleName = ARRAY ModNameLen OF CHAR; - CmdName = ARRAY CmdNameLen OF CHAR; + CmdName = ARRAY CmdNameLen OF CHAR; Module = POINTER TO ModuleDesc; - Cmd = POINTER TO CmdDesc; - EnumProc = PROCEDURE(P: PROCEDURE(p: SYSTEM.PTR)); + Cmd = POINTER TO CmdDesc; + + EnumProc = PROCEDURE(P: PROCEDURE(p: SYSTEM.PTR)); + ModuleDesc = RECORD - next: Module; - name: ModuleName; - refcnt: LONGINT; - cmds: Cmd; - types: LONGINT; + next: Module; + name: ModuleName; + refcnt: LONGINT; + cmds: Cmd; + types: LONGINT; enumPtrs: EnumProc; reserved1, reserved2: LONGINT END ; @@ -64,16 +56,16 @@ MODULE SYSTEM; (* J. Templ, 31.5.95 *) CmdDesc = RECORD next: Cmd; name: CmdName; - cmd: Command + cmd: Command END ; Finalizer = PROCEDURE(obj: SYSTEM.PTR); - FinNode = POINTER TO FinDesc; - FinDesc = RECORD - next: FinNode; - obj: LONGINT; (* weak pointer *) - marked: BOOLEAN; + FinNode = POINTER TO FinDesc; + FinDesc = RECORD + next: FinNode; + obj: LONGINT; (* weak pointer *) + marked: BOOLEAN; finalize: Finalizer; END ; @@ -81,42 +73,66 @@ MODULE SYSTEM; (* J. Templ, 31.5.95 *) (* the list of loaded (=initialization started) modules *) modules*: SYSTEM.PTR; - freeList: ARRAY nofLists + 1 OF LONGINT; (* dummy, 16, 32, 48, 64, 80, 96, 112, 128, sentinel *) - bigBlocks, allocated*: LONGINT; - firstTry: BOOLEAN; + freeList: ARRAY nofLists + 1 OF LONGINT; (* dummy, 16, 32, 48, 64, 80, 96, 112, 128, sentinel *) + bigBlocks: LONGINT; + allocated*: LONGINT; + firstTry: BOOLEAN; (* extensible heap *) - heap, (* the sorted list of heap chunks *) - heapend, (* max possible pointer value (used for stack collection) *) + heap: LONGINT; (* the sorted list of heap chunks *) + heapend: LONGINT; (* max possible pointer value (used for stack collection) *) heapsize*: LONGINT; (* the sum of all heap chunk sizes *) (* finalization candidates *) fin: FinNode; (* garbage collector locking *) - gclock*: SHORTINT; + lockdepth: INTEGER; + interrupted: BOOLEAN; + + (* File system file count monitor *) + FileCount*: INTEGER; - PROCEDURE -malloc(size: LONGINT): LONGINT "(LONGINT)malloc(size)"; - PROCEDURE -Lock() "Lock"; - PROCEDURE -Unlock() "Unlock"; - PROCEDURE -Mainfrm(): LONGINT "SYSTEM_mainfrm"; -(* - PROCEDURE TAS*(VAR flag:BOOLEAN): BOOLEAN; (* added for compatibility with ulmSYSTEM module; noch *) - VAR oldflag : BOOLEAN; + PROCEDURE Lock*; BEGIN - oldflag := flag; - flag := TRUE; - RETURN oldflag; - END TAS; -*) + INC(lockdepth); + END Lock; + + PROCEDURE -PlatformHalt(code: LONGINT) "Platform_Halt(code)"; + + PROCEDURE Unlock*; + BEGIN + DEC(lockdepth); + IF interrupted & (lockdepth = 0) THEN + PlatformHalt(-9); + END + END Unlock; + + + (* + PROCEDURE TAS*(VAR flag:BOOLEAN): BOOLEAN; (* added for compatibility with ulmSYSTEM module; noch *) + VAR oldflag : BOOLEAN; + BEGIN + oldflag := flag; + flag := TRUE; + RETURN oldflag; + END TAS; + *) + PROCEDURE REGMOD*(VAR name: ModuleName; enumPtrs: EnumProc): SYSTEM.PTR; VAR m: Module; BEGIN - IF name = "SYSTEM" THEN (* cannot use NEW *) - SYSTEM.NEW(m, SIZE(ModuleDesc)); m.cmds := NIL - ELSE NEW(m) - END ; + (* REGMOD is called at the start of module initialisation code before that modules + type descriptors have been set up. 'NEW' depends on the Heap modules type + descriptors being ready for use, therefore, just for the Heap module itself, we + must use SYSTEM.NEW. *) + IF name = "Heap" THEN + SYSTEM.NEW(m, SIZE(ModuleDesc)) + ELSE + NEW(m) + END; + m.types := 0; m.cmds := NIL; COPY(name, m.name); m.refcnt := 0; m.enumPtrs := enumPtrs; m.next := SYSTEM.VAL(Module, modules); modules := m; RETURN m @@ -124,7 +140,16 @@ MODULE SYSTEM; (* J. Templ, 31.5.95 *) PROCEDURE REGCMD*(m: Module; VAR name: CmdName; cmd: Command); VAR c: Cmd; - BEGIN NEW(c); + BEGIN + (* REGCMD is called during module initialisation code before that modules + type descriptors have been set up. 'NEW' depends on the Heap modules type + descriptors being ready for use, therefore, just for the commands registered + by the Heap module itself, we must use SYSTEM.NEW. *) + IF m.name = "Heap" THEN + SYSTEM.NEW(c, SIZE(CmdDesc)) + ELSE + NEW(c) + END; COPY(name, c.name); c.cmd := cmd; c.next := m.cmds; m.cmds := c END REGCMD; @@ -136,13 +161,17 @@ MODULE SYSTEM; (* J. Templ, 31.5.95 *) BEGIN INC(m.refcnt) END INCREF; + + PROCEDURE -ExternPlatformOSAllocate "extern LONGINT Platform_OSAllocate(LONGINT size);"; + PROCEDURE -OSAllocate(size: LONGINT): LONGINT "Platform_OSAllocate(size)"; + PROCEDURE NewChunk(blksz: LONGINT): LONGINT; VAR chnk: LONGINT; BEGIN - chnk := malloc(blksz + blkOff); + chnk := OSAllocate(blksz + blkOff); IF chnk # 0 THEN - SYSTEM.PUT(chnk + endOff, chnk + (blkOff + blksz)); - SYSTEM.PUT(chnk + blkOff, chnk + (blkOff + sizeOff)); + SYSTEM.PUT(chnk + endOff, chnk + (blkOff + blksz)); + SYSTEM.PUT(chnk + blkOff, chnk + (blkOff + sizeOff)); SYSTEM.PUT(chnk + (blkOff + sizeOff), blksz); SYSTEM.PUT(chnk + (blkOff + sntlOff), NoPtrSntl); SYSTEM.PUT(chnk + (blkOff + nextOff), bigBlocks); @@ -152,6 +181,13 @@ MODULE SYSTEM; (* J. Templ, 31.5.95 *) RETURN chnk END NewChunk; + + (* FetchAddress fetches a pointer from memory and returns it as a LONGINT. It works + correctly regardless of the size of an address. Specifically on 32 bit address + architectures with 64 bit LONGINT, it loads 32 bits and extends it to LONGINT + rather than loading 64 bits. *) + PROCEDURE -FetchAddress(pointer: LONGINT): LONGINT "(LONGINT)(uintptr_t)(*((void**)((uintptr_t)pointer)))"; + PROCEDURE ExtendHeap(blksz: LONGINT); VAR size, chnk, j, next: LONGINT; BEGIN @@ -159,39 +195,48 @@ MODULE SYSTEM; (* J. Templ, 31.5.95 *) ELSE size := 10000*Unit (* additional heuristics *) END ; chnk := NewChunk(size); - IF chnk # 0 THEN + IF chnk # 0 THEN (*sorted insertion*) IF chnk < heap THEN SYSTEM.PUT(chnk, heap); heap := chnk ELSE - j := heap; SYSTEM.GET(j, next); - WHILE (next # 0) & (chnk > next) DO j := next; SYSTEM.GET(j, next) END ; + j := heap; next := FetchAddress(j); + WHILE (next # 0) & (chnk > next) DO + j := next; + next := FetchAddress(j) + END; SYSTEM.PUT(chnk, next); SYSTEM.PUT(j, chnk) END ; - IF next = 0 THEN SYSTEM.GET(chnk + endOff, heapend) END + IF next = 0 THEN heapend := FetchAddress(chnk+endOff) END END END ExtendHeap; PROCEDURE ^GC*(markStack: BOOLEAN); PROCEDURE NEWREC*(tag: LONGINT): SYSTEM.PTR; - VAR i, i0, di, blksz, restsize, t, adr, end, next, prev: LONGINT; new: SYSTEM.PTR; + VAR + i, i0, di, blksz, restsize, t, adr, end, next, prev: LONGINT; + new: SYSTEM.PTR; BEGIN Lock(); - SYSTEM.GET(tag, blksz); + blksz := FetchAddress(tag); + + ASSERT((Unit = 16) OR (Unit = 32)); + ASSERT(SIZE(SYSTEM.PTR) <= SIZE(LONGINT)); ASSERT(blksz MOD Unit = 0); + i0 := blksz DIV Unit; i := i0; IF i < nofLists THEN adr := freeList[i]; WHILE adr = 0 DO INC(i); adr := freeList[i] END END ; IF i < nofLists THEN (* unlink *) - SYSTEM.GET(adr + nextOff, next); + next := FetchAddress(adr + nextOff); freeList[i] := next; IF i # i0 THEN (* split *) di := i - i0; restsize := di * Unit; end := adr + restsize; SYSTEM.PUT(end + sizeOff, blksz); SYSTEM.PUT(end + sntlOff, NoPtrSntl); - SYSTEM.PUT(end, end + sizeOff); + SYSTEM.PUT(end, end + sizeOff); SYSTEM.PUT(adr + sizeOff, restsize); SYSTEM.PUT(adr + nextOff, freeList[di]); freeList[di] := adr; @@ -219,18 +264,18 @@ MODULE SYSTEM; (* J. Templ, 31.5.95 *) Unlock(); RETURN NIL END END ; - SYSTEM.GET(adr+sizeOff, t); + t := FetchAddress(adr+sizeOff); IF t >= blksz THEN EXIT END ; - prev := adr; SYSTEM.GET(adr + nextOff, adr) + prev := adr; adr := FetchAddress(adr + nextOff) END ; restsize := t - blksz; end := adr + restsize; SYSTEM.PUT(end + sizeOff, blksz); SYSTEM.PUT(end + sntlOff, NoPtrSntl); - SYSTEM.PUT(end, end + sizeOff); + SYSTEM.PUT(end, end + sizeOff); IF restsize > nofLists * Unit THEN (*resize*) SYSTEM.PUT(adr + sizeOff, restsize) ELSE (*unlink*) - SYSTEM.GET(adr + nextOff, next); + next := FetchAddress(adr + nextOff); IF prev = 0 THEN bigBlocks := next ELSE SYSTEM.PUT(prev + nextOff, next); END ; @@ -245,16 +290,16 @@ MODULE SYSTEM; (* J. Templ, 31.5.95 *) END ; i := adr + 4*SZL; end := adr + blksz; WHILE i < end DO (*deliberately unrolled*) - SYSTEM.PUT(i, LONG(LONG(0))); - SYSTEM.PUT(i + SZL, LONG(LONG(0))); - SYSTEM.PUT(i + 2*SZL, LONG(LONG(0))); - SYSTEM.PUT(i + 3*SZL, LONG(LONG(0))); + SYSTEM.PUT(i, LongZero); + SYSTEM.PUT(i + SZL, LongZero); + SYSTEM.PUT(i + 2*SZL, LongZero); + SYSTEM.PUT(i + 3*SZL, LongZero); INC(i, 4*SZL) END ; - SYSTEM.PUT(adr + nextOff, LONG(LONG(0))); - SYSTEM.PUT(adr, tag); - SYSTEM.PUT(adr + sizeOff, LONG(LONG(0))); - SYSTEM.PUT(adr + sntlOff, LONG(LONG(0))); + SYSTEM.PUT(adr + nextOff, LongZero); + SYSTEM.PUT(adr, tag); + SYSTEM.PUT(adr + sizeOff, LongZero); + SYSTEM.PUT(adr + sntlOff, LongZero); INC(allocated, blksz); Unlock(); RETURN SYSTEM.VAL(SYSTEM.PTR, adr + SZL) @@ -267,9 +312,9 @@ MODULE SYSTEM; (* J. Templ, 31.5.95 *) blksz := (size + (4*SZL + Unit - 1)) DIV Unit * Unit; (*size + tag + meta + blksz + sntnl + UnitAlignment*) new := NEWREC(SYSTEM.ADR(blksz)); tag := SYSTEM.VAL(LONGINT, new) + blksz - 3*SZL; - SYSTEM.PUT(tag - SZL, LONG(LONG(0))); (*reserved for meta info*) - SYSTEM.PUT(tag, blksz); - SYSTEM.PUT(tag + SZL, NoPtrSntl); + SYSTEM.PUT(tag - SZL, LongZero); (*reserved for meta info*) + SYSTEM.PUT(tag, blksz); + SYSTEM.PUT(tag + SZL, NoPtrSntl); SYSTEM.PUT(SYSTEM.VAL(LONGINT, new) - SZL, tag); Unlock(); RETURN new @@ -278,28 +323,31 @@ MODULE SYSTEM; (* J. Templ, 31.5.95 *) PROCEDURE Mark(q: LONGINT); VAR p, tag, fld, n, offset, tagbits: LONGINT; BEGIN - IF q # 0 THEN SYSTEM.GET(q - SZL, tagbits); - IF ~ODD(tagbits) THEN - SYSTEM.PUT(q - SZL, tagbits + 1); - p := 0; tag := tagbits + SZL; + IF q # 0 THEN + tagbits := FetchAddress(q - SZL); (* Load the tag for the record at q *) + IF ~ODD(tagbits) THEN (* If it has not already been marked *) + SYSTEM.PUT(q - SZL, tagbits + 1); (* Mark it *) + p := 0; + tag := tagbits + SZL; (* Tag addresses first offset *) LOOP - SYSTEM.GET(tag, offset); - IF offset < 0 THEN - SYSTEM.PUT(q - SZL, tag + offset + 1); + SYSTEM.GET(tag, offset); (* Get next ptr field offset *) + IF offset < 0 THEN (* If sentinel. (Value is -8*(#fields+1) *) + SYSTEM.PUT(q - SZL, tag + offset + 1); (* Rotate base ptr into tag *) IF p = 0 THEN EXIT END ; n := q; q := p; - SYSTEM.GET(q - SZL, tag); DEC(tag, 1); + tag := FetchAddress(q - SZL); DEC(tag, 1); SYSTEM.GET(tag, offset); fld := q + offset; - SYSTEM.GET(fld, p); SYSTEM.PUT(fld, n) - ELSE - fld := q + offset; - SYSTEM.GET(fld, n); - IF n # 0 THEN - SYSTEM.GET(n - SZL, tagbits); + p := FetchAddress(fld); SYSTEM.PUT(fld, SYSTEM.VAL(SYSTEM.PTR, n)) + ELSE (* offset references a ptr field *) + fld := q + offset; (* Address the pointer *) + n := FetchAddress(fld); (* Load the pointer *) + IF n # 0 THEN (* If pointer is not NIL *) + tagbits := FetchAddress(n - SZL); (* Consider record pointed to by this field *) IF ~ODD(tagbits) THEN SYSTEM.PUT(n - SZL, tagbits + 1); SYSTEM.PUT(q - SZL, tag + 1); - SYSTEM.PUT(fld, p); p := q; q := n; + SYSTEM.PUT(fld, SYSTEM.VAL(SYSTEM.PTR, p)); + p := q; q := n; tag := tagbits END END @@ -321,42 +369,43 @@ MODULE SYSTEM; (* J. Templ, 31.5.95 *) WHILE i < nofLists DO freeList[i] := 0; INC(i) END ; freesize := 0; allocated := 0; chnk := heap; WHILE chnk # 0 DO - adr := chnk + blkOff; SYSTEM.GET(chnk + endOff, end); + adr := chnk + blkOff; + end := FetchAddress(chnk + endOff); WHILE adr < end DO - SYSTEM.GET(adr, tag); + tag := FetchAddress(adr); IF ODD(tag) THEN (*marked*) IF freesize > 0 THEN start := adr - freesize; - SYSTEM.PUT(start, start+SZL); + SYSTEM.PUT(start, start+SZL); SYSTEM.PUT(start+sizeOff, freesize); SYSTEM.PUT(start+sntlOff, NoPtrSntl); i := freesize DIV Unit; freesize := 0; IF i < nofLists THEN SYSTEM.PUT(start + nextOff, freeList[i]); freeList[i] := start - ELSE SYSTEM.PUT(start + nextOff, bigBlocks); bigBlocks := start + ELSE SYSTEM.PUT(start + nextOff, bigBlocks); bigBlocks := start END END ; DEC(tag, 1); SYSTEM.PUT(adr, tag); - SYSTEM.GET(tag, size); + size := FetchAddress(tag); INC(allocated, size); INC(adr, size) ELSE (*unmarked*) - SYSTEM.GET(tag, size); + size := FetchAddress(tag); INC(freesize, size); INC(adr, size) END END ; IF freesize > 0 THEN (*collect last block*) start := adr - freesize; - SYSTEM.PUT(start, start+SZL); + SYSTEM.PUT(start, start+SZL); SYSTEM.PUT(start+sizeOff, freesize); SYSTEM.PUT(start+sntlOff, NoPtrSntl); i := freesize DIV Unit; freesize := 0; IF i < nofLists THEN SYSTEM.PUT(start + nextOff, freeList[i]); freeList[i] := start - ELSE SYSTEM.PUT(start + nextOff, bigBlocks); bigBlocks := start + ELSE SYSTEM.PUT(start + nextOff, bigBlocks); bigBlocks := start END END ; - SYSTEM.GET(chnk, chnk) + chnk := FetchAddress(chnk) END END Scan; @@ -384,14 +433,14 @@ MODULE SYSTEM; (* J. Templ, 31.5.95 *) chnk := heap; i := 0; lim := cand[n-1]; WHILE (chnk # 0 ) & (chnk < lim) DO adr := chnk + blkOff; - SYSTEM.GET(chnk + endOff, lim1); + lim1 := FetchAddress(chnk + endOff); IF lim < lim1 THEN lim1 := lim END ; WHILE adr < lim1 DO - SYSTEM.GET(adr, tag); + tag := FetchAddress(adr); IF ODD(tag) THEN (*already marked*) - SYSTEM.GET(tag-1, size); INC(adr, size) + size := FetchAddress(tag-1); INC(adr, size) ELSE - SYSTEM.GET(tag, size); + size := FetchAddress(tag); ptr := adr + SZL; WHILE cand[i] < ptr DO INC(i) END ; IF i = n THEN RETURN END ; @@ -400,15 +449,16 @@ MODULE SYSTEM; (* J. Templ, 31.5.95 *) adr := next END END ; - SYSTEM.GET(chnk, chnk) + chnk := FetchAddress(chnk) END END MarkCandidates; PROCEDURE CheckFin; VAR n: FinNode; tag: LONGINT; - BEGIN n := fin; + BEGIN + n := fin; WHILE n # NIL DO - SYSTEM.GET(n.obj - SZL, tag); + tag := FetchAddress(n.obj - SZL); IF ~ODD(tag) THEN n.marked := FALSE; Mark(n.obj) ELSE n.marked := TRUE END ; @@ -425,7 +475,8 @@ MODULE SYSTEM; (* J. Templ, 31.5.95 *) n.finalize(SYSTEM.VAL(SYSTEM.PTR, n.obj)); (* new nodes may have been pushed in n.finalize, therefore: *) IF prev = NIL THEN n := fin ELSE n := n.next END - ELSE prev := n; n := n.next + ELSE + prev := n; n := n.next END END END Finalize; @@ -439,6 +490,9 @@ MODULE SYSTEM; (* J. Templ, 31.5.95 *) END END FINALL; + PROCEDURE -ExternMainStackFrame "extern LONGINT Platform_MainStackFrame;"; + PROCEDURE -PlatformMainStackFrame(): LONGINT "Platform_MainStackFrame"; + PROCEDURE MarkStack(n: LONGINT; VAR cand: ARRAY OF LONGINT); VAR frame: SYSTEM.PTR; @@ -449,9 +503,9 @@ MODULE SYSTEM; (* J. Templ, 31.5.95 *) IF n > 0 THEN MarkStack(n-1, cand); (* flush register windows by means of recursive calls *) IF n > 100 THEN RETURN END (* prevent tail recursion optimization *) END ; - IF n = 0 THEN + IF n = 0 THEN nofcand := 0; sp := SYSTEM.ADR(frame); - stack0 := Mainfrm(); + stack0 := PlatformMainStackFrame(); (* check for minimum alignment of pointers *) inc := SYSTEM.ADR(align.p) - SYSTEM.ADR(align); IF sp > stack0 THEN inc := -inc END ; @@ -473,10 +527,10 @@ MODULE SYSTEM; (* J. Templ, 31.5.95 *) i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23: LONGINT; cand: ARRAY 10000 OF LONGINT; BEGIN - IF (gclock = 0) OR (gclock = 1) & ~markStack THEN + IF (lockdepth = 0) OR (lockdepth = 1) & ~markStack THEN Lock(); m := SYSTEM.VAL(Module, modules); - WHILE m # NIL DO + WHILE m # NIL DO IF m.enumPtrs # NIL THEN m.enumPtrs(MarkP) END ; m := m^.next END ; @@ -484,7 +538,7 @@ MODULE SYSTEM; (* J. Templ, 31.5.95 *) (* generate register pressure to force callee saved registers to memory; may be simplified by inlining OS calls or processor specific instructions *) - i0 := -100; i1 := -101; i2 := -102; i3 := -103; i4 := -104; i5 := -105; i6 := -106; i7 := -107; + i0 := -100; i1 := -101; i2 := -102; i3 := -103; i4 := -104; i5 := -105; i6 := -106; i7 := -107; i8 := 1; i9 := 2; i10 := 3; i11 := 4; i12 := 5; i13 := 6; i14 := 7; i15 := 8; i16 := 9; i17 := 10; i18 := 11; i19 := 12; i20 := 13; i21 := 14; i22 := 15; i23 := 16; LOOP INC(i0, 1); INC(i1, 2); INC(i2, 3); INC(i3, 4); INC(i4, 5); INC(i5, 6); INC(i6, 7); INC(i7, 8); @@ -503,18 +557,29 @@ MODULE SYSTEM; (* J. Templ, 31.5.95 *) END END GC; - PROCEDURE REGFIN*(obj: SYSTEM.PTR; finalize: Finalizer); + PROCEDURE RegisterFinalizer*(obj: SYSTEM.PTR; finalize: Finalizer); VAR f: FinNode; BEGIN NEW(f); - f.obj := SYSTEM.VAL(LONGINT, obj); f.finalize := finalize; f.marked := TRUE; f.next := fin; fin := f - END REGFIN; + f.obj := SYSTEM.VAL(LONGINT, obj); f.finalize := finalize; f.marked := TRUE; + f.next := fin; fin := f; + END RegisterFinalizer; - PROCEDURE InitHeap; (* initialized before body to enable NEW, SYSTEM.NEW *) + +PROCEDURE -ExternHeapInit "extern void *Heap__init();"; +PROCEDURE -HeapModuleInit 'Heap__init()'; + + PROCEDURE InitHeap*; + (* InitHeap is called by Platform.init before any module bodies have been + initialised, to enable NEW, SYSTEM.NEW *) BEGIN - heap := NewChunk(heapSize0); - SYSTEM.GET(heap + endOff, heapend); - SYSTEM.PUT(heap, LONG(LONG(0))); - allocated := 0; firstTry := TRUE; freeList[nofLists] := 1; gclock := 0 + heap := NewChunk(heapSize0); + heapend := FetchAddress(heap + endOff); + SYSTEM.PUT(heap, LongZero); + allocated := 0; firstTry := TRUE; freeList[nofLists] := 1; lockdepth := 0; + FileCount := 0; modules := NIL; heapsize := 0; bigBlocks := 0; fin := NIL; + interrupted := FALSE; + + HeapModuleInit; END InitHeap; -END SYSTEM. +END Heap. diff --git a/src/system/Kernel0.Mod b/src/system/Kernel0.Mod deleted file mode 100644 index 6a58650f..00000000 --- a/src/system/Kernel0.Mod +++ /dev/null @@ -1,200 +0,0 @@ -MODULE Kernel0; -(* - J. Templ, 16.4.95 - communication with C-runtime and storage management -*) -(* version for bootstrapping voc *) - - IMPORT SYSTEM, Unix, Args, Strings, version; - - TYPE - RealTime = POINTER TO TimeDesc; - TimeDesc = RECORD - sec, min, hour, mday, mon, year, wday, isdst, zone, gmtoff: LONGINT -(* sec, min, hour, mday, mon, year, wday, isdst, zone, gmtoff: INTEGER*) - END ; - - KeyCmd* = PROCEDURE; - - ObjFinalizer* = PROCEDURE(obj: SYSTEM.PTR); - - - VAR - (* trap handling *) - trapEnv*: Unix.JmpBuf; (* saved stack environment for trap handling *) - - (* oberon heap management *) - nofiles*: LONGINT; - - (* input event handling *) - readSet*, readySet*: Unix.FdSet; - - FKey*: ARRAY 16 OF KeyCmd; - - littleEndian*: BOOLEAN; - - TimeUnit*: LONGINT; (* 1 sec *) - - LIB*, CWD*: ARRAY 256 OF CHAR; - OBERON*: ARRAY 1024 OF CHAR; - MODULES-: ARRAY 1024 OF CHAR; - - prefix*, fullprefix* : ARRAY 256 OF CHAR; - timeStart: LONGINT; (* milliseconds *) - - - PROCEDURE -includesetjmp() - '#include "setjmp.h"'; -(* for localtime *) - PROCEDURE -includetime() - '#include "time.h"'; - - PROCEDURE -Lock*() - "SYSTEM_lock++"; - - PROCEDURE -Unlock*() - "SYSTEM_lock--; if (SYSTEM_interrupted && SYSTEM_lock == 0) __HALT(-9)"; - - PROCEDURE -Exit*(n: LONGINT) - "exit(n)"; - - PROCEDURE -sigsetjmp*(VAR env: Unix.JmpBuf; savemask: LONGINT): LONGINT - "__sigsetjmp(env, savemask)"; - - PROCEDURE -siglongjmp*(VAR env:Unix.JmpBuf; val: LONGINT) - "siglongjmp(env, val)"; - - PROCEDURE -heapsize*(): LONGINT - "SYSTEM_heapsize"; - - PROCEDURE -allocated*(): LONGINT - "SYSTEM_allocated"; - - PROCEDURE -localtime(VAR clock: LONGINT): RealTime - "(Kernel0_RealTime)localtime(clock)"; - - PROCEDURE -malloc*(size: LONGINT): LONGINT - "(LONGINT)malloc(size)"; - - PROCEDURE -free*(adr: LONGINT) - "(void)free(adr)"; - - PROCEDURE -getcwd(VAR cwd: Unix.Name) - "getcwd(cwd, cwd__len)"; - - - PROCEDURE GetClock* (VAR t, d: LONGINT); - VAR tv: Unix.Timeval; tz: Unix.Timezone; time: RealTime; - l : LONGINT; - BEGIN - l := Unix.Gettimeofday(tv, tz); - time := localtime(tv.sec); - t := time.sec + ASH(time.min, 6) + ASH(time.hour, 12); - d := time.mday + ASH(time.mon+1, 5) + ASH(time.year MOD 100, 9); - END GetClock; - - PROCEDURE SetClock* (t, d: LONGINT); - VAR err: ARRAY 25 OF CHAR; - BEGIN err := "not yet implemented"; HALT(99) - END SetClock; - - PROCEDURE Time*(): LONGINT; - VAR timeval: Unix.Timeval; timezone: Unix.Timezone; - l : LONGINT; - BEGIN - l := Unix.Gettimeofday(timeval, timezone); - RETURN (timeval.usec DIV 1000 + timeval.sec * 1000 - timeStart) MOD 7FFFFFFFH - END Time; - -(* - PROCEDURE UserTime*(): LONGINT; - VAR rusage: Unix.Rusage; - BEGIN - Unix.Getrusage(0, S.ADR(rusage)); - RETURN rusage.utime.sec*1000 + rusage.utime.usec DIV 1000 - (* + rusage.stime.sec*1000 + rusage.stime.usec DIV 1000*) - END UserTime; -*) - - PROCEDURE Select*(delay: LONGINT); - VAR rs, ws, xs: Unix.FdSet; n: LONGINT; tv: Unix.Timeval; - BEGIN - rs := readSet; - FOR n := 0 TO 7 DO ws[n] := {}; xs[n] := {}; readySet[n] := {} END; - IF delay < 0 THEN delay := 0 END ; - tv.sec := delay DIV 1000; tv.usec := delay MOD 1000 * 1000; - n := Unix.Select(256, rs, ws, xs, tv); - IF n >= 0 THEN readySet := rs END - END Select; - - PROCEDURE -GC*(markStack: BOOLEAN) - "SYSTEM_GC(markStack)"; - - PROCEDURE -RegisterObject*(obj: SYSTEM.PTR; finalize: ObjFinalizer) - "SYSTEM_REGFIN(obj, finalize)"; - - PROCEDURE -SetHalt*(p: PROCEDURE(n: LONGINT)) - "SYSTEM_Halt = p"; - - PROCEDURE InstallTermHandler*(p: PROCEDURE); - (* not yet supported; no Modules.Free *) - END InstallTermHandler; - - PROCEDURE LargestAvailable*(): LONGINT; - BEGIN - (* dummy proc for System 3 compatibility - no meaningful value except may be the remaining swap space can be returned - in the context of an extensible heap *) - RETURN MAX(LONGINT) - END LargestAvailable; - - PROCEDURE Halt(n: LONGINT); - VAR res: LONGINT; - BEGIN res := Unix.Kill(Unix.Getpid(), 4); - END Halt; - - PROCEDURE EndianTest; - VAR i: LONGINT; dmy: INTEGER; - BEGIN - dmy := 1; i := SYSTEM.ADR(dmy); - SYSTEM.GET(i, littleEndian); (* indirection via i avoids warning on SUN cc -O *) - END EndianTest; - - PROCEDURE -SizeofUnixJmpBuf(): INTEGER - "sizeof(Unix_JmpBuf)"; - - PROCEDURE -SizeofSigJmpBuf(): INTEGER - "sizeof(sigjmp_buf)"; - - PROCEDURE -Error(msg: ARRAY OF CHAR; len: INTEGER) - "write(1/*stdout*/, msg, len); char ch = 0xa; write(1, &ch, 1)"; - - PROCEDURE JmpBufCheck; (* check for inconsistent usage of sigjmp_buf *) - VAR x, y: LONGINT; - BEGIN - x := SizeofUnixJmpBuf(); - y := SizeofSigJmpBuf(); - IF x < y THEN - Error("Kernel.JmpBufCheck: inconsistent usage of sigjmp_buf", 52); - Exit(1); - END - END JmpBufCheck; - -BEGIN - EndianTest(); - SetHalt(Halt); - CWD := ""; OBERON := "."; LIB := ""; - MODULES := ""; (* additional modules path which can be specified on commandline and will be added to the OBERON variable; noch *) - getcwd(CWD); - Args.GetEnv ("MODULES", MODULES); - Args.GetEnv("OBERON", OBERON); - (* always have current directory in module search path, noch *) - Strings.Append(":.:", OBERON); - Strings.Append(MODULES, OBERON); - Strings.Append(":", OBERON); - Strings.Append(version.prefix, OBERON); - Strings.Append("/lib/voc/sym:", OBERON); - Args.GetEnv("OBERON_LIB", LIB); - TimeUnit := 1000; timeStart := 0; timeStart := Time(); - JmpBufCheck() -END Kernel0. diff --git a/src/system/Oberon.Mod b/src/system/Oberon.Mod index 1a0c8c69..d0125cdc 100644 --- a/src/system/Oberon.Mod +++ b/src/system/Oberon.Mod @@ -2,9 +2,9 @@ MODULE Oberon; (* this version should not have dependency on graphics -- noch *) - IMPORT Kernel, Texts, Args, Out := Console; - TYPE + IMPORT Platform, Texts, Args, Console; + TYPE ParList* = POINTER TO ParRec; ParRec* = RECORD @@ -18,23 +18,26 @@ MODULE Oberon; Log*: Texts.Text; Par*: ParList; (*actual parameters*) - W : Texts.Writer; - OptionChar*: CHAR; + R: Texts.Reader; + W: Texts.Writer; + OptionChar*: CHAR; + (*clocks*) PROCEDURE GetClock* (VAR t, d: LONGINT); - BEGIN Kernel.GetClock(t, d) + BEGIN Platform.GetClock(t, d) END GetClock; PROCEDURE Time* (): LONGINT; - BEGIN - RETURN Kernel.Time() + BEGIN + RETURN Platform.Time() END Time; PROCEDURE PopulateParams; - VAR W : Texts.Writer; - i : INTEGER; - str : ARRAY 32 OF CHAR; + VAR + W: Texts.Writer; + i: INTEGER; + str: ARRAY 32 OF CHAR; BEGIN i := 1; (* skip program name *) @@ -52,47 +55,23 @@ MODULE Oberon; Texts.Append (Par^.text, W.buf); END PopulateParams; -(* - PROCEDURE DumpLog*; - VAR R : Texts.Reader; - ch : CHAR; - BEGIN - Texts.OpenReader(R, Log, 0); - REPEAT - Texts.Read(R, ch); - Out.Char(ch); - UNTIL R.eot; - END DumpLog; -*) + PROCEDURE GetSelection*(VAR text: Texts.Text; VAR beg, end, time: LONGINT); + BEGIN text := NIL; beg := 0; end := 0; time := 0; + END GetSelection; -PROCEDURE TextToString(VAR T : Texts.Text; VAR string : ARRAY OF CHAR); - VAR R : Texts.Reader; - ch : CHAR; - i : LONGINT; +(* --- Notifier for echoing all text appended to the log onto the console. --- *) + +PROCEDURE LogNotifier(Log: Texts.Text; op: INTEGER; beg, end: LONGINT); + VAR ch: CHAR; BEGIN - COPY("", string); - Texts.OpenReader(R, T, 0); - i := 0; - WHILE Texts.Pos(R) < T.len DO - Texts.Read(R, ch); - string[i] := ch; - INC(i); - END; - (*string[i] := 0X;*) -END TextToString; - -PROCEDURE DumpLog*; -VAR s : POINTER TO ARRAY OF CHAR; -BEGIN - NEW(s, Log.len + 1); - COPY("", s^); - TextToString(Log, s^); - Out.String(s^); Out.Ln; - - NEW(Log); - Texts.Open(Log, ""); -END DumpLog; + Texts.OpenReader(R, Log, beg); + WHILE ~R.eot & (beg < end) DO + Texts.Read(R, ch); + IF ch = 0DX THEN Console.Ln ELSE Console.Char(ch) END; + INC(beg) + END +END LogNotifier; BEGIN NEW(Par); @@ -103,4 +82,5 @@ BEGIN PopulateParams; NEW(Log); Texts.Open(Log, ""); + Log.notify := LogNotifier; END Oberon. diff --git a/src/system/Platformunix.Mod b/src/system/Platformunix.Mod index dbaae75f..fbb015e8 100644 --- a/src/system/Platformunix.Mod +++ b/src/system/Platformunix.Mod @@ -1,519 +1,551 @@ -MODULE Unix; (* Josef Templ, 5.3.90 Linux system calls *) -(* ported to gnu x86_64 and added system(), sleep() functions, noch *) -(* Module Unix provides a system call interface to Linux. - Naming conventions: - Procedure and Type-names always start with a capital letter. - error numbers as defined in Unix - other constants start with lower case letters *) - +MODULE Platform; IMPORT SYSTEM; CONST - -(* various important constants *) - - stdin* = 0; stdout* =1; stderr* = 2; - - LOCKEX* = 2; LOCKUN* = 8; (* /usr/include/file.h *) - AFINET* = 2; (* /usr/include/sys/socket.h *) - PFINET* = AFINET; (* /usr/include/linux/socket.h *) - SOCKSTREAM* = 1; (* /usr/include/linux/socket.h *) - FIONREAD* = 541BH; (* in /usr/include/asm/termios.h *) - SETFL* = 4; (* set file descriptor flags; in asm/fcntl.h *) - TCP* = 0; - -(* flag sets, cf. /usr/include/asm/fcntl.h *) - rdonly* = {}; wronly* = {0}; rdwr* = {1}; creat* = {6}; excl* = {7}; trunc* = {9}; append* = {10}; ndelay = {11}; - -(* error numbers *) - - EPERM* = 1; (* Not owner *) - ENOENT* = 2; (* No such file or directory *) - ESRCH* = 3; (* No such process *) - EINTR* = 4; (* Interrupted system call *) - EIO* = 5; (* I/O error *) - ENXIO* = 6; (* No such device or address *) - E2BIG* = 7; (* Arg list too long *) - ENOEXEC* = 8; (* Exec format error *) - EBADF* = 9; (* Bad file number *) - ECHILD* = 10; (* No children *) - EAGAIN* = 11; (* No more processes *) - ENOMEM* = 12; (* Not enough core *) - EACCES* = 13; (* Permission denied *) - EFAULT* = 14; (* Bad address *) - ENOTBLK* = 15; (* Block device required *) - EBUSY* = 16; (* Mount device busy *) - EEXIST* = 17; (* File exists *) - EXDEV* = 18; (* Cross-device link *) - ENODEV* = 19; (* No such device *) - ENOTDIR* = 20; (* Not a directory*) - EISDIR* = 21; (* Is a directory *) - EINVAL* = 22; (* Invalid argument *) - ENFILE* = 23; (* File table overflow *) - EMFILE* = 24; (* Too many open files *) - ENOTTY* = 25; (* Not a typewriter *) - ETXTBSY* = 26; (* Text file busy *) - EFBIG* = 27; (* File too large *) - ENOSPC* = 28; (* No space left on device *) - ESPIPE* = 29; (* Illegal seek *) - EROFS* = 30; (* Read-only file system *) - EMLINK* = 31; (* Too many links *) - EPIPE* = 32; (* Broken pipe *) - EDOM* = 33; (* Argument too large *) - ERANGE* = 34; (* Result too large *) - EDEADLK* = 35; (* Resource deadlock would occur *) - ENAMETOOLONG* = 36; (* File name too long *) - ENOLCK* = 37; (* No record locks available *) - ENOSYS* = 38; (* Function not implemented *) - ENOTEMPTY* = 39; (* Directory not empty *) - ELOOP* = 40; (* Too many symbolic links encountered *) - EWOULDBLOCK* = EAGAIN; (* Operation would block *) - ENOMSG* = 42; (* No message of desired type *) - EIDRM* = 43; (* Identifier removed *) - ECHRNG* = 44; (* Channel number out of range *) - EL2NSYNC* = 45; (* Level 2 not synchronized *) - EL3HLT* = 46; (* Level 3 halted *) - EL3RST* = 47; (* Level 3 reset *) - ELNRNG* = 48; (* Link number out of range *) - EUNATCH* = 49; (* Protocol driver not attached *) - ENOCSI* = 50; (* No CSI structure available *) - EL2HLT* = 51; (* Level 2 halted *) - EBADE* = 52; (* Invalid exchange *) - EBADR* = 53; (* Invalid request descriptor *) - EXFULL* = 54; (* Exchange full *) - ENOANO* = 55; (* No anode *) - EBADRQC* = 56; (* Invalid request code *) - EBADSLT* = 57; (* Invalid slot *) - EDEADLOCK* = 58; (* File locking deadlock error *) - EBFONT* = 59; (* Bad font file format *) - ENOSTR* = 60; (* Device not a stream *) - ENODATA* = 61; (* No data available *) - ETIME* = 62; (* Timer expired *) - ENOSR* = 63; (* Out of streams resources *) - ENONET* = 64; (* Machine is not on the network *) - ENOPKG* = 65; (* Package not installed *) - EREMOTE* = 66; (* Object is remote *) - ENOLINK* = 67; (* Link has been severed *) - EADV* = 68; (* Advertise error *) - ESRMNT* = 69; (* Srmount error *) - ECOMM* = 70; (* Communication error on send *) - EPROTO* = 71; (* Protocol error *) - EMULTIHOP* = 72; (* Multihop attempted *) - EDOTDOT* = 73; (* RFS specific error *) - EBADMSG* = 74; (* Not a data message *) - EOVERFLOW* = 75; (* Value too large for defined data type *) - ENOTUNIQ* = 76; (* Name not unique on network *) - EBADFD* = 77; (* File descriptor in bad state *) - EREMCHG* = 78; (* Remote address changed *) - ELIBACC* = 79; (* Can not access a needed shared library *) - ELIBBAD* = 80; (* Accessing a corrupted shared library *) - ELIBSCN* = 81; (* .lib section in a.out corrupted *) - ELIBMAX* = 82; (* Attempting to link in too many shared libraries *) - ELIBEXEC* = 83; (* Cannot exec a shared library directly *) - EILSEQ* = 84; (* Illegal byte sequence *) - ERESTART* = 85; (* Interrupted system call should be restarted *) - ESTRPIPE* = 86; (* Streams pipe error *) - EUSERS* = 87; (* Too many users *) - ENOTSOCK* = 88; (* Socket operation on non-socket *) - EDESTADDRREQ* = 89; (* Destination address required *) - EMSGSIZE* = 90; (* Message too long *) - EPROTOTYPE* = 91; (* Protocol wrong type for socket *) - ENOPROTOOPT* = 92; (* Protocol not available *) - EPROTONOSUPPORT* = 93; (* Protocol not supported *) - ESOCKTNOSUPPORT* = 94; (* Socket type not supported *) - EOPNOTSUPP* = 95; (* Operation not supported on transport endpoint *) - EPFNOSUPPORT* = 96; (* Protocol family not supported *) - EAFNOSUPPORT* = 97; (* Address family not supported by protocol *) - EADDRINUSE* = 98; (* Address already in use *) - EADDRNOTAVAIL* = 99; (* Cannot assign requested address *) - ENETDOWN* = 100; (* Network is down *) - ENETUNREACH* = 101; (* Network is unreachable *) - ENETRESET* = 102; (* Network dropped connection because of reset *) - ECONNABORTED* = 103; (* Software caused connection abort *) - ECONNRESET* = 104; (* Connection reset by peer *) - ENOBUFS* = 105; (* No buffer space available *) - EISCONN* = 106; (* Transport endpoint is already connected *) - ENOTCONN* = 107; (* Transport endpoint is not connected *) - ESHUTDOWN* = 108; (* Cannot send after transport endpoint shutdown *) - ETOOMANYREFS* = 109; (* Too many references: cannot splice *) - ETIMEDOUT* = 110; (* Connection timed out *) - ECONNREFUSED* = 111; (* Connection refused *) - EHOSTDOWN* = 112; (* Host is down *) - EHOSTUNREACH* = 113; (* No route to host *) - EALREADY* = 114; (* Operation already in progress *) - EINPROGRESS* = 115; (* Operation now in progress *) - ESTALE* = 116; (* Stale NFS file handle *) - EUCLEAN* = 117; (* Structure needs cleaning *) - ENOTNAM* = 118; (* Not a XENIX named type file *) - ENAVAIL* = 119; (* No XENIX semaphores available *) - EISNAM* = 120; (* Is a named type file *) - EREMOTEIO* = 121; (* Remote I/O error *) - EDQUOT* = 122; (* Quota exceeded *) - -CONST sigsetarrlength = 1024 / 8 * SIZE(LONGINT); - + StdIn- = 0; + StdOut- = 1; + StdErr- = 2; TYPE - (* cpp /usr/include/setjmp.h - struct __jmp_buf_tag - { - __jmp_buf __jmpbuf; - int __mask_was_saved; - __sigset_t __saved_mask; - }; + HaltProcedure = PROCEDURE(n: LONGINT); + SignalHandler = PROCEDURE(signal: INTEGER); - typedef struct __jmp_buf_tag jmp_buf[1]; + ErrorCode* = INTEGER; + FileHandle* = LONGINT; - __sigset_t is 128 byte long in glibc on arm, x86, x86_64 - __jmp_buf is 24 bytes long in glibc on x86 - 256 bytes long in glibc on armv6 - 64 bytes long in glibc on x86_64 - - *) - JmpBuf* = RECORD - jmpbuf: ARRAY 8 OF LONGINT; (* 8 * 8 = 64 *) - maskWasSaved*: INTEGER; - savedMask*: ARRAY 16 OF LONGINT; (* 16 * 8 = 128 *) - END ; - - Status* = RECORD (* struct stat *) - dev* : LONGINT; (* dev_t 8 *) - ino* : LONGINT; (* ino 8 *) - nlink* : LONGINT; - mode* : INTEGER; - uid*, gid*: INTEGER; - pad0* : INTEGER; - rdev* : LONGINT; - size* : LONGINT; - blksize* : LONGINT; - blocks* : LONGINT; - atime* : LONGINT; - atimences* : LONGINT; - mtime* : LONGINT; - mtimensec* : LONGINT; - ctime* : LONGINT; - ctimensec* : LONGINT; - unused0*, unused1*, unused2*: LONGINT; - END ; - -(* from /usr/include/bits/time.h - -struct timeval - { - __time_t tv_sec; /* Seconds. */ //__time_t 8 - __suseconds_t tv_usec; /* Microseconds. */ __suseconds_t 8 - }; - - -*) - - Timeval* = RECORD - sec*, usec*: LONGINT - END ; - - -(* -from man gettimeofday - - struct timezone { - int tz_minuteswest; /* minutes west of Greenwich */ int 4 - int tz_dsttime; /* type of DST correction */ int 4 - }; -*) - - - Timezone* = RECORD - (*minuteswest*, dsttime*: LONGINT*) - minuteswest*, dsttime*: INTEGER - END ; - - Itimerval* = RECORD - interval*, value*: Timeval - END ; - - FdSet* = ARRAY 8 OF SET; - - SigCtxPtr* = POINTER TO SigContext; - SigContext* = RECORD - END ; - - SignalHandler* = PROCEDURE (sig, code: LONGINT; scp: SigCtxPtr); - - Dirent* = RECORD - ino, off: LONGINT; - reclen: INTEGER; - name: ARRAY 256 OF CHAR; - END ; - - Rusage* = RECORD - utime*, stime*: Timeval; - maxrss*, ixrss*, idrss*, isrss*, - minflt*, majflt*, nswap*, inblock*, - oublock*, msgsnd*, msgrcv*, nsignals*, - nvcsw*, nivcsw*: LONGINT - END ; - - Iovec* = RECORD - base*, len*: LONGINT - END ; - - SocketPair* = ARRAY 2 OF LONGINT; - - Pollfd* = RECORD - fd*: LONGINT; - events*, revents*: INTEGER - END ; - - Sockaddr* = RECORD - family0*, family1*: SHORTINT; - pad0, pad1: SHORTINT; - pad2 : INTEGER; - (*port*: INTEGER; - internetAddr*: LONGINT;*) - pad*: ARRAY 14 OF CHAR; - END ; - - HostEntry* = POINTER [1] TO Hostent; - Hostent* = RECORD - name*, aliases*: LONGINT; - addrtype*, length*: INTEGER; - addrlist*: LONGINT; (*POINTER TO POINTER TO LONGINT, network byte order*) + FileIdentity* = RECORD + volume*: LONGINT; (* dev on Unix filesystems, volume serial number on NTFS *) + index*: LONGINT; (* inode on Unix filesystems, file id on NTFS *) + mtime*: LONGINT; (* File modification time, value is system dependent *) END; - Name* = ARRAY OF CHAR; + EnvPtr = POINTER TO ARRAY 1024 OF CHAR; + ArgPtr = POINTER TO ARRAY 1024 OF CHAR; + ArgVec = POINTER TO ARRAY 1024 OF ArgPtr; + ArgVecPtr = POINTER TO ARRAY 1 OF LONGINT; - PROCEDURE -includeStat() - "#include "; - PROCEDURE -includeErrno() - "#include "; +VAR + LittleEndian-: BOOLEAN; + MainStackFrame-: LONGINT; + HaltCode-: LONGINT; + PID-: INTEGER; (* Note: Must be updated by Fork implementation *) + CWD-: ARRAY 256 OF CHAR; + ArgCount-: INTEGER; - (* for read(), write() and sleep() *) - PROCEDURE -includeUnistd() - "#include "; + ArgVector-: LONGINT; + HaltHandler: HaltProcedure; + TimeStart: LONGINT; - (* for system() *) - PROCEDURE -includeStdlib() - "#include "; + SeekSet-: INTEGER; + SeekCur-: INTEGER; + SeekEnd-: INTEGER; - (* for nanosleep() *) - PROCEDURE -includeTime() - "#include "; + nl-: ARRAY 3 OF CHAR; (* Platform specific newline representation *) - (* for select() *) - PROCEDURE -includeSelect() - "#include "; - PROCEDURE -err(): INTEGER - "errno"; - PROCEDURE errno*(): INTEGER; - BEGIN - RETURN err() - END errno; +(* Unix headers to be included *) - PROCEDURE -Exit*(n: INTEGER) - "exit(n)"; +PROCEDURE -Aincludesystime '#include '; (* for gettimeofday *) +PROCEDURE -Aincludetime '#include '; (* for localtime *) +PROCEDURE -Aincludesystypes '#include '; +PROCEDURE -Aincludeunistd '#include '; +PROCEDURE -Aincludesysstat '#include '; +PROCEDURE -Aincludefcntl '#include '; +PROCEDURE -Aincludeerrno '#include '; +PROCEDURE -Astdlib '#include '; +PROCEDURE -Astdio '#include '; +PROCEDURE -Aerrno '#include '; - PROCEDURE -Fork*(): INTEGER - "fork()"; - PROCEDURE -Wait*(VAR status: INTEGER): INTEGER - "wait(status)"; - PROCEDURE -Select*(width: INTEGER; VAR readfds, writefds, exceptfds: FdSet; VAR timeout: Timeval): INTEGER - "select(width, readfds, writefds, exceptfds, timeout)"; - PROCEDURE -Gettimeofday* (VAR tv: Timeval; VAR tz: Timezone) : INTEGER - "gettimeofday(tv, tz)"; +(* Error code tests *) - PROCEDURE -Read* (fd: INTEGER; buf, nbyte: LONGINT): LONGINT - "read(fd, buf, nbyte)"; +PROCEDURE -EMFILE(): ErrorCode 'EMFILE'; +PROCEDURE -ENFILE(): ErrorCode 'ENFILE'; +PROCEDURE -ENOENT(): ErrorCode 'ENOENT'; +PROCEDURE -EXDEV(): ErrorCode 'EXDEV'; +PROCEDURE -EACCES(): ErrorCode 'EACCES'; +PROCEDURE -EROFS(): ErrorCode 'EROFS'; +PROCEDURE -EAGAIN(): ErrorCode 'EAGAIN'; +PROCEDURE -ETIMEDOUT(): ErrorCode 'ETIMEDOUT'; +PROCEDURE -ECONNREFUSED(): ErrorCode 'ECONNREFUSED'; +PROCEDURE -ECONNABORTED(): ErrorCode 'ECONNABORTED'; +PROCEDURE -ENETUNREACH(): ErrorCode 'ENETUNREACH'; +PROCEDURE -EHOSTUNREACH(): ErrorCode 'EHOSTUNREACH'; - PROCEDURE -ReadBlk* (fd: INTEGER; VAR buf: ARRAY OF SYSTEM.BYTE): LONGINT - "read(fd, buf, buf__len)"; - PROCEDURE -Write* (fd: INTEGER; buf, nbyte: LONGINT): LONGINT - "write(fd, buf, nbyte)"; - PROCEDURE -WriteBlk* (fd: INTEGER; VAR buf: ARRAY OF SYSTEM.BYTE): LONGINT - "write(fd, buf, buf__len)"; - PROCEDURE -Dup*(fd: INTEGER): INTEGER - "dup(fd)"; +PROCEDURE TooManyFiles*(e: ErrorCode): BOOLEAN; +BEGIN RETURN (e = EMFILE()) OR (e = ENFILE()) END TooManyFiles; - PROCEDURE -Dup2*(fd1, fd2: INTEGER): INTEGER - "dup(fd1, fd2)"; +PROCEDURE NoSuchDirectory*(e: ErrorCode): BOOLEAN; +BEGIN RETURN e = ENOENT() END NoSuchDirectory; - PROCEDURE -Pipe*(fds : LONGINT): INTEGER - "pipe(fds)"; +PROCEDURE DifferentFilesystems*(e: ErrorCode): BOOLEAN; +BEGIN RETURN e = EXDEV() END DifferentFilesystems; - PROCEDURE -Getpid*(): INTEGER - "getpid()"; +PROCEDURE Inaccessible*(e: ErrorCode): BOOLEAN; +BEGIN RETURN (e = EACCES()) OR (e = EROFS()) OR (e = EAGAIN()) END Inaccessible; - PROCEDURE -Getuid*(): INTEGER - "getuid()"; +PROCEDURE Absent*(e: ErrorCode): BOOLEAN; +BEGIN RETURN (e = ENOENT()) END Absent; - PROCEDURE -Geteuid*(): INTEGER - "geteuid()"; +PROCEDURE TimedOut*(e: ErrorCode): BOOLEAN; +BEGIN RETURN (e = ETIMEDOUT()) END TimedOut; - PROCEDURE -Getgid*(): INTEGER - "getgid()"; +PROCEDURE ConnectionFailed*(e: ErrorCode): BOOLEAN; +BEGIN RETURN (e = ECONNREFUSED()) OR (e = ECONNABORTED()) + OR (e = ENETUNREACH()) OR (e = EHOSTUNREACH()) END ConnectionFailed; - PROCEDURE -Getegid*(): INTEGER - "getegid()"; - PROCEDURE -Unlink*(name: Name): INTEGER - "unlink(name)"; - PROCEDURE -Open*(name: Name; flag: INTEGER; mode: LONGINT): INTEGER - "open(name, flag, mode)"; - PROCEDURE -Close*(fd: INTEGER): INTEGER - "close(fd)"; +(* OS memory allocaton *) - PROCEDURE -stat(name: Name; VAR statbuf: Status): INTEGER - "stat((const char*)name, (struct stat*)statbuf)"; +PROCEDURE -allocate(size: LONGINT): LONGINT "(LONGINT)(uintptr_t)((void*)malloc((size_t)size))"; +PROCEDURE OSAllocate*(size: LONGINT): LONGINT; BEGIN RETURN allocate(size) END OSAllocate; - PROCEDURE Stat*(name: Name; VAR statbuf: Status): INTEGER; - VAR res: INTEGER; - BEGIN - res := stat(name, statbuf); - (* make the first 4 bytes as unique as possible (used in module Files for caching!) *) - (* don't understand this - INC(statbuf.dev, statbuf.devX); - INC(statbuf.rdev, statbuf.rdevX); *) - RETURN res; - END Stat; +PROCEDURE -free(address: LONGINT) "free((void*)(uintptr_t)address)"; +PROCEDURE OSFree*(address: LONGINT); BEGIN free(address) END OSFree; - PROCEDURE -fstat(fd: INTEGER; VAR statbuf: Status): INTEGER - "fstat(fd, (struct stat*)statbuf)"; - PROCEDURE Fstat*(fd: INTEGER; VAR statbuf: Status): INTEGER; - VAR res: INTEGER; - BEGIN - res := fstat(fd, statbuf); - (* make the first 4 bytes as unique as possible (used in module Files for caching!) *) - (*INC(statbuf.dev, statbuf.devX); - INC(statbuf.rdev, statbuf.rdevX); *) - RETURN res; - END Fstat; - PROCEDURE -Fchmod*(fd, mode: INTEGER): INTEGER - "fchmod(fd, mode)"; - PROCEDURE -Chmod*(path: Name; mode: INTEGER): INTEGER - "chmod(path, mode)"; +(* Program startup *) - PROCEDURE -Lseek*(fd: INTEGER; offset: LONGINT; origin: INTEGER): LONGINT - "lseek(fd, offset, origin)"; +PROCEDURE -ExternInitHeap "extern void Heap_InitHeap();"; +PROCEDURE -HeapInitHeap() "Heap_InitHeap()"; - PROCEDURE -Fsync*(fd: INTEGER): INTEGER - "fsync(fd)"; +PROCEDURE Init*(argc: INTEGER; argvadr: LONGINT); +VAR av: ArgVecPtr; +BEGIN + MainStackFrame := argvadr; + ArgCount := argc; + av := SYSTEM.VAL(ArgVecPtr, argvadr); + ArgVector := av[0]; + HaltCode := -128; - PROCEDURE -Fcntl*(fd: INTEGER; cmd: INTEGER; arg: LONGINT ): INTEGER - "fcntl(fd, cmd, arg)"; + (* This function (Platform.Init) is called at program startup BEFORE any + modules have been initalised. In turn we must initialise the heap + before module startup (xxx__init) code is run. *) + HeapInitHeap(); +END Init; - PROCEDURE -Flock*(fd, operation: INTEGER): INTEGER - "flock(fd, operation)"; - PROCEDURE -Ftruncate*(fd: INTEGER; length: LONGINT): INTEGER - "ftruncate(fd, length)"; - PROCEDURE -Readblk*(fd: INTEGER; VAR buf: ARRAY OF SYSTEM.BYTE; len: LONGINT): LONGINT - "read(fd, buf, len)"; - PROCEDURE -Rename*(old, new: Name): INTEGER - "rename(old, new)"; +(* Program arguments and environment access *) - PROCEDURE -Chdir*(path: Name): INTEGER - "chdir(path)"; +PROCEDURE -getenv(var: ARRAY OF CHAR): EnvPtr "(Platform_EnvPtr)getenv((char*)var)"; - PROCEDURE -Ioctl*(fd: INTEGER; request, arg: LONGINT): INTEGER - "ioctl(fd, request, arg)"; +PROCEDURE getEnv*(var: ARRAY OF CHAR; VAR val: ARRAY OF CHAR): BOOLEAN; + VAR p: EnvPtr; +BEGIN + p := getenv(var); + IF p # NIL THEN COPY(p^, val) END; + RETURN p # NIL; +END getEnv; - PROCEDURE -Kill*(pid, sig: INTEGER): INTEGER - "kill(pid, sig)"; +PROCEDURE GetEnv*(var: ARRAY OF CHAR; VAR val: ARRAY OF CHAR); +BEGIN + IF ~ getEnv(var, val) THEN val[0] := 0X END; +END GetEnv; - PROCEDURE -Sigsetmask*(mask: INTEGER): INTEGER - "sigsetmask(mask)"; +PROCEDURE GetArg*(n: INTEGER; VAR val: ARRAY OF CHAR); + VAR av: ArgVec; +BEGIN + IF n < ArgCount THEN + av := SYSTEM.VAL(ArgVec,ArgVector); + COPY(av[n]^, val) + END +END GetArg; - PROCEDURE -Sleep*(ms : INTEGER): INTEGER - "(INTEGER)sleep(ms)"; +PROCEDURE GetIntArg*(n: INTEGER; VAR val: LONGINT); + VAR s: ARRAY 64 OF CHAR; k, d, i: LONGINT; +BEGIN + s := ""; GetArg(n, s); i := 0; + IF s[0] = "-" THEN i := 1 END ; + k := 0; d := ORD(s[i]) - ORD("0"); + WHILE (d >= 0 ) & (d <= 9) DO k := k*10 + d; INC(i); d := ORD(s[i]) - ORD("0") END ; + IF s[0] = "-" THEN k := -k; DEC(i) END ; + IF i > 0 THEN val := k END +END GetIntArg; - PROCEDURE -Nanosleep*(VAR req : Timeval; VAR rem : Timeval): INTEGER - "(INTEGER)nanosleep(req, rem)"; +PROCEDURE ArgPos*(s: ARRAY OF CHAR): INTEGER; + VAR i: INTEGER; arg: ARRAY 256 OF CHAR; +BEGIN + i := 0; GetArg(i, arg); + WHILE (i < ArgCount) & (s # arg) DO INC(i); GetArg(i, arg) END ; + RETURN i +END ArgPos; - (* TCP/IP networking *) - PROCEDURE -Gethostbyname*(name: Name): HostEntry - "(Unix_HostEntry)gethostbyname(name)"; - PROCEDURE -Gethostname*(VAR name: Name): INTEGER - "gethostname(name, name__len)"; - PROCEDURE -Socket*(af, type, protocol: INTEGER): INTEGER - "socket(af, type, protocol)"; - PROCEDURE -Connect*(socket: INTEGER; name: Sockaddr; namelen: INTEGER): INTEGER - "connect(socket, &(name), namelen)"; +(* Signals and traps *) - PROCEDURE -Getsockname*(socket: INTEGER; VAR name: Sockaddr; VAR namelen: INTEGER): INTEGER - "getsockname(socket, name, namelen)"; +PROCEDURE -sethandler(s: INTEGER; h: SignalHandler) "SystemSetHandler(s, (uintptr_t)h)"; - PROCEDURE -Bind*(socket: INTEGER; name: Sockaddr; namelen: INTEGER): INTEGER - "bind(socket, &(name), namelen)"; +PROCEDURE SetInterruptHandler*(handler: SignalHandler); +BEGIN sethandler(2, handler); END SetInterruptHandler; - PROCEDURE -Listen*(socket, backlog: INTEGER): INTEGER - "listen(socket, backlog)"; +PROCEDURE SetQuitHandler*(handler: SignalHandler); +BEGIN sethandler(3, handler); END SetQuitHandler; - PROCEDURE -Accept*(socket: INTEGER; VAR addr: Sockaddr; VAR addrlen: INTEGER): LONGINT - "accept(socket, addr, addrlen)"; +PROCEDURE SetBadInstructionHandler*(handler: SignalHandler); +BEGIN sethandler(4, handler); END SetBadInstructionHandler; - PROCEDURE -Recv*(socket: INTEGER; bufadr, buflen: LONGINT; flags: INTEGER): LONGINT - "recv(socket, bufadr, buflen, flags)"; - PROCEDURE -Send*(socket: INTEGER; bufadr, buflen: LONGINT; flags: INTEGER): LONGINT - "send(socket, bufadr, buflen, flags)"; - PROCEDURE -sys(str: ARRAY OF CHAR): INTEGER (* need this to call external tools like gcc or gas; noch *) - "system(str)"; - PROCEDURE system*(cmd : ARRAY OF CHAR); - VAR r : INTEGER; - BEGIN - r := sys(cmd); - END system; +(* Time of day *) - PROCEDURE System*(cmd : ARRAY OF CHAR): INTEGER; - VAR r : INTEGER; - BEGIN - r := sys(cmd); - RETURN r - END System; +PROCEDURE -gettimeval "struct timeval tv; gettimeofday(&tv,0)"; +PROCEDURE -tvsec(): LONGINT "tv.tv_sec"; +PROCEDURE -tvusec(): LONGINT "tv.tv_usec"; +PROCEDURE -sectotm(s: LONGINT) "struct tm *time = localtime((time_t*)&s)"; +PROCEDURE -tmsec(): LONGINT "(LONGINT)time->tm_sec"; +PROCEDURE -tmmin(): LONGINT "(LONGINT)time->tm_min"; +PROCEDURE -tmhour(): LONGINT "(LONGINT)time->tm_hour"; +PROCEDURE -tmmday(): LONGINT "(LONGINT)time->tm_mday"; +PROCEDURE -tmmon(): LONGINT "(LONGINT)time->tm_mon"; +PROCEDURE -tmyear(): LONGINT "(LONGINT)time->tm_year"; - PROCEDURE -SizeofUnixStat(): INTEGER - "sizeof(Unix_Status)"; +PROCEDURE YMDHMStoClock(ye,mo,da,ho,mi,se: LONGINT; VAR t, d: LONGINT); +BEGIN + d := ASH(ye MOD 100, 9) + ASH(mo+1, 5) + da; + t := ASH(ho, 12) + ASH(mi, 6) + se; +END YMDHMStoClock; - PROCEDURE -SizeofStat(): INTEGER - "sizeof(struct stat)"; +PROCEDURE GetClock*(VAR t, d: LONGINT); +BEGIN + gettimeval; sectotm(tvsec()); + YMDHMStoClock(tmyear(), tmmon(), tmmday(), tmhour(), tmmin(), tmsec(), t, d); +END GetClock; - PROCEDURE -Error(msg: ARRAY OF CHAR; len: INTEGER) - "write(1/*stdout*/, msg, len); char ch = 0xa; write(1, &ch, 1)"; +PROCEDURE GetTimeOfDay*(VAR sec, usec: LONGINT); +BEGIN + gettimeval; sec := tvsec(); usec := tvusec(); +END GetTimeOfDay; - PROCEDURE StatCheck; - VAR x, y: LONGINT; - BEGIN - x := SizeofUnixStat(); - y := SizeofStat(); - IF x # y THEN - Error("Unix.StatCheck: inconsistent usage of struct stat", 49); - Exit(1); - END - END StatCheck; +PROCEDURE Time*(): LONGINT; +VAR ms: LONGINT; +BEGIN + gettimeval; + ms := (tvusec() DIV 1000) + (tvsec() * 1000); + RETURN (ms - TimeStart) MOD 7FFFFFFFH; +END Time; + + +PROCEDURE -nanosleep(s: LONGINT; ns: LONGINT) "struct timespec req, rem; req.tv_sec = s; req.tv_nsec = ns; nanosleep(&req, &rem)"; + +PROCEDURE Delay*(ms: LONGINT); +VAR s, ns: LONGINT; +BEGIN + s := ms DIV 1000; + ns := (ms MOD 1000) * 1000000; + nanosleep(s, ns); +END Delay; + + + + +(* System call *) + +PROCEDURE -system(str: ARRAY OF CHAR): INTEGER "system((char*)str)"; +PROCEDURE -err(): INTEGER "errno"; + + +PROCEDURE System*(cmd : ARRAY OF CHAR): INTEGER; +BEGIN RETURN system(cmd); END System; + +PROCEDURE Error*(): ErrorCode; BEGIN RETURN err() END Error; + + + + +(* File system *) + +(* Note: Consider also using flags O_SYNC and O_DIRECT as we do buffering *) +PROCEDURE -openrw (n: ARRAY OF CHAR): INTEGER "open((char*)n, O_RDWR)"; +PROCEDURE -openro (n: ARRAY OF CHAR): INTEGER "open((char*)n, O_RDONLY)"; +PROCEDURE -opennew(n: ARRAY OF CHAR): INTEGER "open((char*)n, O_CREAT | O_TRUNC | O_RDWR, 0664)"; + +(* File APIs *) + +PROCEDURE OldRO*(VAR n: ARRAY OF CHAR; VAR h: FileHandle): ErrorCode; +VAR fd: INTEGER; +BEGIN + fd := openro(n); + IF (fd < 0) THEN RETURN err() ELSE h := fd; RETURN 0 END; +END OldRO; + +PROCEDURE OldRW*(VAR n: ARRAY OF CHAR; VAR h: FileHandle): ErrorCode; +VAR fd: INTEGER; +BEGIN + fd := openrw(n); + IF (fd < 0) THEN RETURN err() ELSE h := fd; RETURN 0 END; +END OldRW; + +PROCEDURE New*(VAR n: ARRAY OF CHAR; VAR h: FileHandle): ErrorCode; +VAR fd: INTEGER; +BEGIN + fd := opennew(n); + IF (fd < 0) THEN RETURN err() ELSE h := fd; RETURN 0 END; +END New; + + + +PROCEDURE -closefile (fd: LONGINT): INTEGER "close(fd)"; + +PROCEDURE Close*(h: FileHandle): ErrorCode; +BEGIN + IF closefile(h) < 0 THEN RETURN err() ELSE RETURN 0 END +END Close; + + + +PROCEDURE -fstat(fd: LONGINT): INTEGER "fstat(fd, &s)"; +PROCEDURE -stat(n: ARRAY OF CHAR): INTEGER "stat((char*)n, &s)"; +PROCEDURE -structstats "struct stat s"; +PROCEDURE -statdev(): LONGINT "(LONGINT)s.st_dev"; +PROCEDURE -statino(): LONGINT "(LONGINT)s.st_ino"; +PROCEDURE -statmtime(): LONGINT "(LONGINT)s.st_mtime"; +PROCEDURE -statsize(): LONGINT "(LONGINT)s.st_size"; + +PROCEDURE Identify*(h: FileHandle; VAR identity: FileIdentity): ErrorCode; +BEGIN + structstats; + IF fstat(h) < 0 THEN RETURN err() END; + identity.volume := statdev(); + identity.index := statino(); + identity.mtime := statmtime(); + RETURN 0 +END Identify; + +PROCEDURE IdentifyByName*(n: ARRAY OF CHAR; VAR identity: FileIdentity): ErrorCode; +BEGIN + structstats; + IF stat(n) < 0 THEN RETURN err() END; + identity.volume := statdev(); + identity.index := statino(); + identity.mtime := statmtime(); + RETURN 0 +END IdentifyByName; + + +PROCEDURE SameFile*(i1, i2: FileIdentity): BOOLEAN; +BEGIN RETURN (i1.index = i2.index) & (i1.volume = i2.volume) +END SameFile; + +PROCEDURE SameFileTime*(i1, i2: FileIdentity): BOOLEAN; +BEGIN RETURN i1.mtime = i2.mtime +END SameFileTime; + +PROCEDURE SetMTime*(VAR target: FileIdentity; source: FileIdentity); +BEGIN target.mtime := source.mtime; +END SetMTime; + +PROCEDURE MTimeAsClock*(i: FileIdentity; VAR t, d: LONGINT); +BEGIN + sectotm(i.mtime); + YMDHMStoClock(tmyear(), tmmon(), tmmday(), tmhour(), tmmin(), tmsec(), t, d); +END MTimeAsClock; + + +PROCEDURE Size*(h: FileHandle; VAR l: LONGINT): ErrorCode; +BEGIN + structstats; + IF fstat(h) < 0 THEN RETURN err() END; + l := statsize(); + RETURN 0; +END Size; + + + +PROCEDURE -readfile (fd: LONGINT; p: LONGINT; l: LONGINT): LONGINT +"read(fd, (void*)(uintptr_t)(p), l)"; + +PROCEDURE Read*(h: FileHandle; p: LONGINT; l: LONGINT; VAR n: LONGINT): ErrorCode; +BEGIN + n := readfile(h, p, l); + IF n < 0 THEN n := 0; RETURN err() ELSE RETURN 0 END +END Read; + +PROCEDURE ReadBuf*(h: FileHandle; VAR b: ARRAY OF SYSTEM.BYTE; VAR n: LONGINT): ErrorCode; +BEGIN + n := readfile(h, SYSTEM.ADR(b), LEN(b)); + IF n < 0 THEN n := 0; RETURN err() ELSE RETURN 0 END +END ReadBuf; + + + +PROCEDURE -writefile(fd: LONGINT; p: LONGINT; l: LONGINT): LONGINT +"write(fd, (void*)(uintptr_t)(p), l)"; + +PROCEDURE Write*(h: FileHandle; p: LONGINT; l: LONGINT): ErrorCode; + VAR written: LONGINT; +BEGIN + written := writefile(h, p, l); + IF written < 0 THEN RETURN err() ELSE RETURN 0 END +END Write; + + + +PROCEDURE -fsync(fd: LONGINT): INTEGER "fsync(fd)"; + +PROCEDURE Sync*(h: FileHandle): ErrorCode; +BEGIN + IF fsync(h) < 0 THEN RETURN err() ELSE RETURN 0 END +END Sync; + + + +PROCEDURE -lseek(fd: LONGINT; o: LONGINT; w: INTEGER): INTEGER "lseek(fd, o, w)"; +PROCEDURE -seekset(): INTEGER "SEEK_SET"; +PROCEDURE -seekcur(): INTEGER "SEEK_CUR"; +PROCEDURE -seekend(): INTEGER "SEEK_END"; + +PROCEDURE Seek*(h: FileHandle; offset: LONGINT; whence: INTEGER): ErrorCode; +BEGIN + IF lseek(h, offset, whence) < 0 THEN RETURN err() ELSE RETURN 0 END +END Seek; + + + +PROCEDURE -ftruncate(fd: LONGINT; l: LONGINT): INTEGER "ftruncate(fd, l)"; + +PROCEDURE Truncate*(h: FileHandle; l: LONGINT): ErrorCode; +BEGIN + IF (ftruncate(h, l) < 0) THEN RETURN err() ELSE RETURN 0 END; +END Truncate; + + + +PROCEDURE -unlink(n: ARRAY OF CHAR): INTEGER "unlink((char*)n)"; + +PROCEDURE Unlink*(VAR n: ARRAY OF CHAR): ErrorCode; +BEGIN + IF unlink(n) < 0 THEN RETURN err() ELSE RETURN 0 END +END Unlink; + + + +PROCEDURE -chdir(n: ARRAY OF CHAR): INTEGER "chdir((char*)n)"; +PROCEDURE -getcwd(VAR cwd: ARRAY OF CHAR) "getcwd((char*)cwd, cwd__len)"; + +PROCEDURE Chdir*(VAR n: ARRAY OF CHAR): ErrorCode; + VAR r: INTEGER; +BEGIN + r := chdir(n); getcwd(CWD); + IF r < 0 THEN RETURN err() ELSE RETURN 0 END +END Chdir; + + + +PROCEDURE -rename(o,n: ARRAY OF CHAR): INTEGER "rename((char*)o, (char*)n)"; + +PROCEDURE Rename*(VAR o,n: ARRAY OF CHAR): ErrorCode; +BEGIN + IF rename(o,n) < 0 THEN RETURN err() ELSE RETURN 0 END +END Rename; + + + + +(* Process termination *) + +PROCEDURE -exit(code: INTEGER) "exit(code)"; +PROCEDURE Exit*(code: INTEGER); +BEGIN exit(code) END Exit; + +PROCEDURE -errstring(s: ARRAY OF CHAR) 'write(1, s, s__len-1)'; +PROCEDURE -errc (c: CHAR) 'write(1, &c, 1)'; +PROCEDURE errch(c: CHAR); BEGIN errc(c) END errch; +PROCEDURE errln; BEGIN errch(0DX); errch(0AX) END errln; + +PROCEDURE errposint(l: LONGINT); +BEGIN IF l>10 THEN errposint(l DIV 10) END; errch(CHR(ORD('0') + (l MOD 10))) END errposint; + +PROCEDURE errint(l: LONGINT); +BEGIN IF l<0 THEN errch('-'); l := -l END; errposint(l) END errint; + +PROCEDURE DisplayHaltCode(code: LONGINT); +BEGIN + CASE code OF + | -1: errstring("Assertion failure.") + | -2: errstring("Index out of range.") + | -3: errstring("Reached end of function without reaching RETURN.") + | -4: errstring("CASE statement: no matching label and no ELSE.") + | -5: errstring("Type guard failed.") + | -6: errstring("Implicit type guard in record assignment failed.") + | -7: errstring("Invalid case in WITH statement.") + | -8: errstring("Value out of range.") + | -9: errstring("Heap interrupted while locked, but lockdepth = 0 at unlock.") + |-10: errstring("NIL access."); + |-11: errstring("Alignment error."); + |-12: errstring("Divide by zero."); + |-13: errstring("Arithmetic overflow/underflow."); + |-14: errstring("Invalid function argument."); + |-15: errstring("Internal error, e.g. Type descriptor size mismatch.") + |-20: errstring("Too many, or negative number of, elements in dynamic array.") + ELSE + END +END DisplayHaltCode; + +PROCEDURE Halt*(code: LONGINT); +VAR e: ErrorCode; +BEGIN + HaltCode := code; + IF HaltHandler # NIL THEN HaltHandler(code) END; + errstring("Terminated by Halt("); errint(code); errstring("). "); + IF code < 0 THEN DisplayHaltCode(code) END; + errln; + exit(SYSTEM.VAL(INTEGER,code)); +END Halt; + +PROCEDURE AssertFail*(code: LONGINT); +VAR e: ErrorCode; +BEGIN + errstring("Assertion failure."); + IF code # 0 THEN errstring(" ASSERT code "); errint(code); errstring("."); END; + errln; + exit(SYSTEM.VAL(INTEGER,code)); +END AssertFail; + +PROCEDURE SetHalt*(p: HaltProcedure); +BEGIN HaltHandler := p; END SetHalt; + + + + + +PROCEDURE TestLittleEndian; + VAR i: INTEGER; + BEGIN i := 1; SYSTEM.GET(SYSTEM.ADR(i), LittleEndian); END TestLittleEndian; + + +PROCEDURE -getpid(): INTEGER "(INTEGER)getpid()"; BEGIN + TestLittleEndian; - StatCheck(); + HaltCode := -128; + HaltHandler := NIL; + TimeStart := Time(); + CWD := ""; getcwd(CWD); + PID := getpid(); + + SeekSet := seekset(); + SeekCur := seekcur(); + SeekEnd := seekend(); + + nl[0] := 0AX; (* LF *) + nl[1] := 0X; +END Platform. -END Unix. diff --git a/src/system/Platformwindows.Mod b/src/system/Platformwindows.Mod new file mode 100755 index 00000000..c9b67b7c --- /dev/null +++ b/src/system/Platformwindows.Mod @@ -0,0 +1,611 @@ +MODULE Platform; +IMPORT SYSTEM; + +(* TODO: + Use Unicode APIs with manual UTF8 conversion and prepend '\\?\' to + file paths in order to get 32768 character path length limit (as + opposed to 256 bytes. *) + + +TYPE + HaltProcedure = PROCEDURE(n: LONGINT); + SignalHandler = PROCEDURE(signal: INTEGER); + + ErrorCode* = INTEGER; + FileHandle* = LONGINT; + + FileIdentity* = RECORD + volume: LONGINT; (* dev on Unix filesystems, volume serial number on NTFS *) + indexhigh: LONGINT; (* inode on Unix filesystems, file id on NTFS *) + indexlow: LONGINT; + mtimehigh: LONGINT; (* File modification time, value is system dependent *) + mtimelow: LONGINT; (* File modification time, value is system dependent *) + END; + + EnvPtr = POINTER TO ARRAY 1024 OF CHAR; + ArgPtr = POINTER TO ARRAY 1024 OF CHAR; + ArgVec = POINTER TO ARRAY 1024 OF ArgPtr; + ArgVecPtr = POINTER TO ARRAY 1 OF LONGINT; + + +VAR + LittleEndian-: BOOLEAN; + MainStackFrame-: LONGINT; + HaltCode-: LONGINT; + PID-: INTEGER; (* Note: Must be updated by Fork implementation *) + CWD-: ARRAY 4096 OF CHAR; + ArgCount-: INTEGER; + + ArgVector-: LONGINT; + HaltHandler: HaltProcedure; + TimeStart: LONGINT; + + SeekSet-: INTEGER; + SeekCur-: INTEGER; + SeekEnd-: INTEGER; + + StdIn-: FileHandle; + StdOut-: FileHandle; + StdErr-: FileHandle; + + InterruptHandler: SignalHandler; + + nl-: ARRAY 3 OF CHAR; (* Platform specific newline representation *) + + + +PROCEDURE -AincludeWindowsWrapper '#include "WindowsWrapper.h"'; + + +(* Error code tests *) + +PROCEDURE -ERRORTOOMANYOPENFILES(): ErrorCode 'ERROR_TOO_MANY_OPEN_FILES'; +PROCEDURE -ERRORPATHNOTFOUND(): ErrorCode 'ERROR_PATH_NOT_FOUND'; +PROCEDURE -ERRORFILENOTFOUND(): ErrorCode 'ERROR_FILE_NOT_FOUND'; +PROCEDURE -ERRORNOTSAMEDEVICE(): ErrorCode 'ERROR_NOT_SAME_DEVICE'; +PROCEDURE -ERRORACCESSDENIED(): ErrorCode 'ERROR_ACCESS_DENIED'; +PROCEDURE -ERRORWRITEPROTECT(): ErrorCode 'ERROR_WRITE_PROTECT'; +PROCEDURE -ERRORSHARINGVIOLATION(): ErrorCode 'ERROR_SHARING_VIOLATION'; +PROCEDURE -ERRORNOTREADY(): ErrorCode 'ERROR_NOT_READY'; +PROCEDURE -ETIMEDOUT(): ErrorCode 'WSAETIMEDOUT'; +PROCEDURE -ECONNREFUSED(): ErrorCode 'WSAECONNREFUSED'; +PROCEDURE -ECONNABORTED(): ErrorCode 'WSAECONNABORTED'; +PROCEDURE -ENETUNREACH(): ErrorCode 'WSAENETUNREACH'; +PROCEDURE -EHOSTUNREACH(): ErrorCode 'WSAEHOSTUNREACH'; + + + +PROCEDURE TooManyFiles*(e: ErrorCode): BOOLEAN; +BEGIN RETURN e = ERRORTOOMANYOPENFILES() END TooManyFiles; + +PROCEDURE NoSuchDirectory*(e: ErrorCode): BOOLEAN; +BEGIN RETURN e = ERRORPATHNOTFOUND() END NoSuchDirectory; + +PROCEDURE DifferentFilesystems*(e: ErrorCode): BOOLEAN; +BEGIN RETURN e = ERRORNOTSAMEDEVICE() END DifferentFilesystems; + +PROCEDURE Inaccessible*(e: ErrorCode): BOOLEAN; +BEGIN + RETURN (e = ERRORACCESSDENIED()) OR (e = ERRORWRITEPROTECT()) + OR (e = ERRORNOTREADY()) OR (e = ERRORSHARINGVIOLATION()); +END Inaccessible; + +PROCEDURE Absent*(e: ErrorCode): BOOLEAN; +BEGIN RETURN (e = ERRORFILENOTFOUND()) OR (e = ERRORPATHNOTFOUND()) END Absent; + +PROCEDURE TimedOut*(e: ErrorCode): BOOLEAN; +BEGIN RETURN (e = ETIMEDOUT()) END TimedOut; + +PROCEDURE ConnectionFailed*(e: ErrorCode): BOOLEAN; +BEGIN RETURN (e = ECONNREFUSED()) OR (e = ECONNABORTED()) + OR (e = ENETUNREACH()) OR (e = EHOSTUNREACH()) END ConnectionFailed; + + + +(* OS memory allocaton *) + +PROCEDURE -allocate(size: LONGINT): LONGINT "(LONGINT)(uintptr_t)((void*)HeapAlloc(GetProcessHeap(), 0, (size_t)size))"; +PROCEDURE OSAllocate*(size: LONGINT): LONGINT; BEGIN RETURN allocate(size) END OSAllocate; + +PROCEDURE -free(address: LONGINT) "HeapFree(GetProcessHeap(), 0, (void*)(uintptr_t)address)"; +PROCEDURE OSFree*(address: LONGINT); BEGIN free(address) END OSFree; + + + + +(* Program startup *) + +PROCEDURE -ExternInitHeap "extern void Heap_InitHeap();"; +PROCEDURE -HeapInitHeap() "Heap_InitHeap()"; + +PROCEDURE Init*(argc: INTEGER; argvadr: LONGINT); +VAR av: ArgVecPtr; +BEGIN + MainStackFrame := argvadr; + ArgCount := argc; + av := SYSTEM.VAL(ArgVecPtr, argvadr); + ArgVector := av[0]; + HaltCode := -128; + + (* This function (Platform.Init) is called at program startup BEFORE any + modules have been initalised. In turn we must initialise the heap + before module startup (xxx__init) code is run. *) + HeapInitHeap(); +END Init; + + + + +(* Program arguments and environmet access *) + +PROCEDURE -getenv(name: ARRAY OF CHAR; VAR buf: ARRAY OF CHAR): INTEGER +"(INTEGER)GetEnvironmentVariable((char*)name, (char*)buf, buf__len)"; + +PROCEDURE getEnv*(var: ARRAY OF CHAR; VAR val: ARRAY OF CHAR): BOOLEAN; + VAR + buf: ARRAY 4096 OF CHAR; + res: INTEGER; +BEGIN + res := getenv(var, buf); + IF (res > 0) & (res < LEN(buf)) THEN + COPY(buf, val); + RETURN TRUE; + ELSE + RETURN FALSE; + END; +END getEnv; + +PROCEDURE GetEnv*(var: ARRAY OF CHAR; VAR val: ARRAY OF CHAR); +BEGIN + IF ~getEnv(var, val) THEN val[0] := 0X END; +END GetEnv; + +PROCEDURE GetArg*(n: INTEGER; VAR val: ARRAY OF CHAR); + VAR av: ArgVec; +BEGIN + IF n < ArgCount THEN + av := SYSTEM.VAL(ArgVec,ArgVector); + COPY(av[n]^, val) + END +END GetArg; + +PROCEDURE GetIntArg*(n: INTEGER; VAR val: LONGINT); + VAR s: ARRAY 64 OF CHAR; k, d, i: LONGINT; +BEGIN + s := ""; GetArg(n, s); i := 0; + IF s[0] = "-" THEN i := 1 END ; + k := 0; d := ORD(s[i]) - ORD("0"); + WHILE (d >= 0 ) & (d <= 9) DO k := k*10 + d; INC(i); d := ORD(s[i]) - ORD("0") END ; + IF s[0] = "-" THEN k := -k; DEC(i) END ; + IF i > 0 THEN val := k END +END GetIntArg; + +PROCEDURE ArgPos*(s: ARRAY OF CHAR): INTEGER; + VAR i: INTEGER; arg: ARRAY 256 OF CHAR; +BEGIN + i := 0; GetArg(i, arg); + WHILE (i < ArgCount) & (s # arg) DO INC(i); GetArg(i, arg) END ; + RETURN i +END ArgPos; + + + + + +(* Signals and traps *) + +(* PROCEDURE -signal(sig: LONGINT; func: SignalHandler) "signal(sig, func)"; *) + +(* TODO *) + +(* Ctrl/c handling *) + +PROCEDURE -SetInterruptHandler*(h: SignalHandler) "SystemSetInterruptHandler((uintptr_t)h)"; +PROCEDURE -SetQuitHandler* (h: SignalHandler) "SystemSetQuitHandler((uintptr_t)h)"; + +PROCEDURE SetBadInstructionHandler*(handler: SignalHandler); +BEGIN (* TODO *) END SetBadInstructionHandler; + + + + +(* Time of day *) + +PROCEDURE -getLocalTime "SYSTEMTIME st; GetLocalTime(&st)"; +PROCEDURE -stmsec(): INTEGER "(INTEGER)st.wMilliseconds"; +PROCEDURE -stsec(): INTEGER "(INTEGER)st.wSecond"; +PROCEDURE -stmin(): INTEGER "(INTEGER)st.wMinute"; +PROCEDURE -sthour(): INTEGER "(INTEGER)st.wHour"; +PROCEDURE -stmday(): INTEGER "(INTEGER)st.wDay"; +PROCEDURE -stmon(): INTEGER "(INTEGER)st.wMonth"; +PROCEDURE -styear(): INTEGER "(INTEGER)st.wYear"; + +PROCEDURE YMDHMStoClock(ye,mo,da,ho,mi,se: INTEGER; VAR t, d: LONGINT); +BEGIN + d := ASH(ye MOD 100, 9) + ASH(mo+1, 5) + da; + t := ASH(ho, 12) + ASH(mi, 6) + se; +END YMDHMStoClock; + +PROCEDURE GetClock*(VAR t, d: LONGINT); +BEGIN + getLocalTime; + YMDHMStoClock(styear(), stmon(), stmday(), sthour(), stmin(), stsec(), t, d); +END GetClock; + +PROCEDURE GetTimeOfDay*(VAR sec, usec: LONGINT); +BEGIN + getLocalTime; sec := stsec(); usec := LONG(stmsec()) * 1000; +END GetTimeOfDay; + +PROCEDURE -GetTickCount(): LONGINT "(LONGINT)(uint32_t)GetTickCount()"; + +PROCEDURE Time*(): LONGINT; +VAR ms: LONGINT; +BEGIN + ms := GetTickCount(); + RETURN (ms - TimeStart) MOD 7FFFFFFFH; +END Time; + + +PROCEDURE -sleep(ms: LONGINT) "Sleep((DWORD)ms)"; + +PROCEDURE Delay*(ms: LONGINT); +BEGIN + WHILE ms > 30000 DO sleep(30000); ms := ms-30000 END; + IF ms > 0 THEN sleep(ms) END; +END Delay; + + + + +(* System call *) + +PROCEDURE -startupInfo "STARTUPINFO si = {0}; si.cb = sizeof(si);"; +PROCEDURE -processInfo "PROCESS_INFORMATION pi = {0};"; +PROCEDURE -createProcess(str: ARRAY OF CHAR): INTEGER "(INTEGER)CreateProcess(0, (char*)str, 0,0,0,0,0,0,&si,&pi)"; +PROCEDURE -waitForProcess(): INTEGER "(INTEGER)WaitForSingleObject(pi.hProcess, INFINITE)"; +PROCEDURE -getExitCodeProcess(VAR exitcode: INTEGER) "GetExitCodeProcess(pi.hProcess, (DWORD*)exitcode);"; +PROCEDURE -cleanupProcess "CloseHandle(pi.hProcess); CloseHandle(pi.hThread);"; +PROCEDURE -err(): INTEGER "(INTEGER)GetLastError()"; + +PROCEDURE System*(cmd : ARRAY OF CHAR): INTEGER; +VAR + result: INTEGER; +BEGIN + result := 127; + startupInfo; processInfo; + IF createProcess(cmd) # 0 THEN + IF waitForProcess() = 0 THEN getExitCodeProcess(result) END; + cleanupProcess; + END; + RETURN result * 256; +END System; + +PROCEDURE Error*(): ErrorCode; BEGIN RETURN err() END Error; + + +(* File system *) + +PROCEDURE -invalidHandleValue(): LONGINT "((LONGINT)(uintptr_t)INVALID_HANDLE_VALUE)"; + +PROCEDURE -openrw (n: ARRAY OF CHAR): LONGINT +"(LONGINT)(uintptr_t)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0)"; + +PROCEDURE -openro (n: ARRAY OF CHAR): LONGINT +"(LONGINT)(uintptr_t)CreateFile((char*)n, GENERIC_READ , FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0)"; + +PROCEDURE -opennew(n: ARRAY OF CHAR): LONGINT +"(LONGINT)(uintptr_t)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0)"; + + + + +(* File APIs *) + +PROCEDURE OldRO*(VAR n: ARRAY OF CHAR; VAR h: FileHandle): ErrorCode; +VAR fd: LONGINT; +BEGIN + fd := openro(n); + IF (fd = invalidHandleValue()) THEN RETURN err() ELSE h := fd; RETURN 0 END; +END OldRO; + +PROCEDURE OldRW*(VAR n: ARRAY OF CHAR; VAR h: FileHandle): ErrorCode; +VAR fd: LONGINT; +BEGIN + fd := openrw(n); + IF (fd = invalidHandleValue()) THEN RETURN err() ELSE h := fd; RETURN 0 END; +END OldRW; + +PROCEDURE New*(VAR n: ARRAY OF CHAR; VAR h: FileHandle): ErrorCode; +VAR fd: LONGINT; +BEGIN + fd := opennew(n); + IF (fd = invalidHandleValue()) THEN RETURN err() ELSE h := fd; RETURN 0 END; +END New; + + + +PROCEDURE -closeHandle(h: FileHandle): INTEGER "(INTEGER)CloseHandle((HANDLE)(uintptr_t)h)"; + +PROCEDURE Close*(h: FileHandle): ErrorCode; +BEGIN + IF closeHandle(h) = 0 THEN RETURN err() ELSE RETURN 0 END +END Close; + + + +PROCEDURE -byHandleFileInformation "BY_HANDLE_FILE_INFORMATION bhfi"; +PROCEDURE -getFileInformationByHandle(h: FileHandle): INTEGER "(INTEGER)GetFileInformationByHandle((HANDLE)(uintptr_t)h, &bhfi)"; +PROCEDURE -bhfiMtimeHigh(): LONGINT "(LONGINT)bhfi.ftLastWriteTime.dwHighDateTime"; +PROCEDURE -bhfiMtimeLow(): LONGINT "(LONGINT)bhfi.ftLastWriteTime.dwLowDateTime"; +PROCEDURE -bhfiVsn(): LONGINT "(LONGINT)bhfi.dwVolumeSerialNumber"; +PROCEDURE -bhfiIndexHigh(): LONGINT "(LONGINT)bhfi.nFileIndexHigh"; +PROCEDURE -bhfiIndexLow(): LONGINT "(LONGINT)bhfi.nFileIndexLow"; + + +PROCEDURE Identify*(h: FileHandle; VAR identity: FileIdentity): ErrorCode; +BEGIN + byHandleFileInformation; + IF getFileInformationByHandle(h) = 0 THEN RETURN err() END; + identity.volume := bhfiVsn(); + identity.indexhigh := bhfiIndexHigh(); + identity.indexlow := bhfiIndexLow(); + identity.mtimehigh := bhfiMtimeHigh(); + identity.mtimelow := bhfiMtimeLow(); + RETURN 0 +END Identify; + +PROCEDURE IdentifyByName*(n: ARRAY OF CHAR; VAR identity: FileIdentity): ErrorCode; +VAR + h: FileHandle; + e,i: ErrorCode; +BEGIN + e := OldRO(n, h); + IF e # 0 THEN RETURN e END; + e := Identify(h, identity); + i := Close(h); + RETURN e; +END IdentifyByName; + + +PROCEDURE SameFile*(i1, i2: FileIdentity): BOOLEAN; +BEGIN RETURN (i1.indexhigh = i2.indexhigh) & (i1.indexlow = i2.indexlow) & (i1.volume = i2.volume) +END SameFile; + +PROCEDURE SameFileTime*(i1, i2: FileIdentity): BOOLEAN; +BEGIN RETURN (i1.mtimehigh = i2.mtimehigh) & (i1.mtimelow = i2.mtimelow) +END SameFileTime; + +PROCEDURE SetMTime*(VAR target: FileIdentity; source: FileIdentity); +BEGIN target.mtimehigh := source.mtimehigh; target.mtimelow := source.mtimelow; +END SetMTime; + +PROCEDURE -identityToFileTime(i: FileIdentity) +"FILETIME ft; ft.dwHighDateTime = i.mtimehigh; ft.dwLowDateTime = i.mtimelow"; + +PROCEDURE -fileTimeToSysTime +"SYSTEMTIME st; FileTimeToSystemTime(&ft, &st)"; + +PROCEDURE MTimeAsClock*(i: FileIdentity; VAR t, d: LONGINT); +BEGIN + identityToFileTime(i); fileTimeToSysTime; + YMDHMStoClock(styear(), stmon(), stmday(), sthour(), stmin(), stsec(), t, d); +END MTimeAsClock; + +PROCEDURE -largeInteger "LARGE_INTEGER li"; +PROCEDURE -liLongint(): LONGINT "(LONGINT)li.QuadPart"; +PROCEDURE -getFileSize(h: FileHandle): INTEGER "(INTEGER)GetFileSizeEx((HANDLE)(uintptr_t)h, &li)"; + +PROCEDURE Size*(h: FileHandle; VAR l: LONGINT): ErrorCode; +BEGIN + largeInteger; + IF getFileSize(h) = 0 THEN RETURN err() END; + l := liLongint(); + RETURN 0; +END Size; + + +PROCEDURE -readfile (fd: LONGINT; p: LONGINT; l: LONGINT; VAR n: LONGINT): INTEGER +"(INTEGER)ReadFile ((HANDLE)(uintptr_t)fd, (void*)(uintptr_t)(p), (DWORD)l, (DWORD*)n, 0)"; + +PROCEDURE Read*(h: FileHandle; p: LONGINT; l: LONGINT; VAR n: LONGINT): ErrorCode; +VAR result: INTEGER; +BEGIN + n := 0; (* Clear n because readfile takes a LONGINT but only updates the bottom 32 bits *) + result := readfile(h, p, l, n); + IF result = 0 THEN n := 0; RETURN err() ELSE RETURN 0 END +END Read; + +PROCEDURE ReadBuf*(h: FileHandle; VAR b: ARRAY OF SYSTEM.BYTE; VAR n: LONGINT): ErrorCode; +VAR result: INTEGER; +BEGIN + n := 0; (* Clear n because readfile takes a LONGINT but only updates the bottom 32 bits *) + result := readfile(h, SYSTEM.ADR(b), LEN(b), n); + IF result = 0 THEN n := 0; RETURN err() ELSE RETURN 0 END +END ReadBuf; + + + +PROCEDURE -writefile(fd: LONGINT; p: LONGINT; l: LONGINT): INTEGER +"(INTEGER)WriteFile((HANDLE)(uintptr_t)fd, (void*)(uintptr_t)(p), (DWORD)l, 0,0)"; + +PROCEDURE Write*(h: FileHandle; p: LONGINT; l: LONGINT): ErrorCode; +BEGIN + IF writefile(h, p, l) = 0 THEN RETURN err() ELSE RETURN 0 END +END Write; + + + +PROCEDURE -flushFileBuffers(h: FileHandle): INTEGER "(INTEGER)FlushFileBuffers((HANDLE)(uintptr_t)h)"; + +PROCEDURE Sync*(h: FileHandle): ErrorCode; +BEGIN + IF flushFileBuffers(h) = 0 THEN RETURN err() ELSE RETURN 0 END +END Sync; + + + +PROCEDURE -setFilePointerEx(h: FileHandle; o: LONGINT; r: INTEGER; VAR rc: INTEGER) +"li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((HANDLE)(uintptr_t)h, li, 0, (DWORD)r)"; + +PROCEDURE -seekset(): INTEGER "FILE_BEGIN"; +PROCEDURE -seekcur(): INTEGER "FILE_CURRENT"; +PROCEDURE -seekend(): INTEGER "FILE_END"; + +PROCEDURE Seek*(h: FileHandle; o: LONGINT; r: INTEGER): ErrorCode; +VAR rc: INTEGER; +BEGIN + largeInteger; + setFilePointerEx(h, o, r, rc); + IF rc = 0 THEN RETURN err() ELSE RETURN 0 END +END Seek; + + + +PROCEDURE -setEndOfFile(h: FileHandle): INTEGER "(INTEGER)SetEndOfFile((HANDLE)(uintptr_t)h)"; +PROCEDURE -getFilePos(h: FileHandle; VAR r: LONGINT; VAR rc: INTEGER) +"LARGE_INTEGER liz = {0}; *rc = (INTEGER)SetFilePointerEx((HANDLE)(uintptr_t)h, liz, &li, FILE_CURRENT); *r = (LONGINT)li.QuadPart"; + +PROCEDURE Truncate*(h: FileHandle; limit: LONGINT): ErrorCode; +VAR rc: INTEGER; oldpos: LONGINT; +BEGIN + largeInteger; + getFilePos(h, oldpos, rc); + IF rc = 0 THEN RETURN err() END; + setFilePointerEx(h, limit, seekset(), rc); + IF rc = 0 THEN RETURN err() END; + IF setEndOfFile(h) = 0 THEN RETURN err() END; + setFilePointerEx(h, oldpos, seekset(), rc); (* Restore original file position *) + IF rc = 0 THEN RETURN err() END; + RETURN 0; +END Truncate; + + + +PROCEDURE -deleteFile(n: ARRAY OF CHAR): INTEGER "(INTEGER)DeleteFile((char*)n)"; + +PROCEDURE Unlink*(VAR n: ARRAY OF CHAR): ErrorCode; +BEGIN + IF deleteFile(n) = 0 THEN RETURN err() ELSE RETURN 0 END +END Unlink; + + +PROCEDURE -setCurrentDirectory(n: ARRAY OF CHAR): INTEGER "(INTEGER)SetCurrentDirectory((char*)n)"; +PROCEDURE -getCurrentDirectory(VAR n: ARRAY OF CHAR) "GetCurrentDirectory(n__len, (char*)n)"; + +PROCEDURE Chdir*(VAR n: ARRAY OF CHAR): ErrorCode; + VAR r: INTEGER; +BEGIN + r := setCurrentDirectory(n); + IF r = 0 THEN RETURN err() END; + getCurrentDirectory(CWD); + RETURN 0; +END Chdir; + + + +PROCEDURE -moveFile(o,n: ARRAY OF CHAR): INTEGER +"(INTEGER)MoveFileEx((char*)o, (char*)n, MOVEFILE_REPLACE_EXISTING)"; + +PROCEDURE Rename*(VAR o,n: ARRAY OF CHAR): ErrorCode; +BEGIN + IF moveFile(o,n) = 0 THEN RETURN err() ELSE RETURN 0 END +END Rename; + + + + +(* Process termination *) + +PROCEDURE -exit(code: INTEGER) "ExitProcess((UINT)code)"; +PROCEDURE Exit*(code: INTEGER); +BEGIN exit(code) END Exit; + + +PROCEDURE -errstring(s: ARRAY OF CHAR) 'WriteFile((HANDLE)(uintptr_t)Platform_StdOut, s, s__len-1, 0,0)'; +PROCEDURE -errc (c: CHAR) 'WriteFile((HANDLE)(uintptr_t)Platform_StdOut, &c, 1, 0,0)'; +PROCEDURE errch(c: CHAR); BEGIN errc(c) END errch; +PROCEDURE errln; BEGIN errch(0DX); errch(0AX) END errln; + +PROCEDURE errposint(l: LONGINT); +BEGIN IF l>10 THEN errposint(l DIV 10) END; errch(CHR(ORD('0') + (l MOD 10))) END errposint; + +PROCEDURE errint(l: LONGINT); +BEGIN IF l<0 THEN errch('-'); l := -l END; errposint(l) END errint; + +PROCEDURE DisplayHaltCode(code: LONGINT); +BEGIN + CASE code OF + | -1: errstring("Rider ReadBuf/WriteBuf transfer size longer than buffer.") + | -2: errstring("Index out of range.") + | -3: errstring("Reached end of function without reaching RETURN.") + | -4: errstring("CASE statement: no matching label and no ELSE.") + | -5: errstring("Type guard failed.") + | -6: errstring("Type equality failed.") + | -7: errstring("WITH statement type guard failed.") + | -8: errstring("SHORT: Value too large for shorter type.") + | -9: errstring("Heap interrupted while locked, but lockdepth = 0 at unlock.") + |-15: errstring("Type descriptor size mismatch.") + |-20: errstring("Too many, or negative number of, elements in dynamic array.") + ELSE + END +END DisplayHaltCode; + +PROCEDURE Halt*(code: LONGINT); +VAR e: ErrorCode; +BEGIN + HaltCode := code; + IF HaltHandler # NIL THEN HaltHandler(code) END; + errstring("Terminated by Halt("); errint(code); errstring("). "); + IF code < 0 THEN DisplayHaltCode(code) END; + errln; + exit(SYSTEM.VAL(INTEGER,code)); +END Halt; + +PROCEDURE AssertFail*(code: LONGINT); +VAR e: ErrorCode; +BEGIN + errstring("Assertion failure."); + IF code # 0 THEN errstring(" ASSERT code "); errint(code); errstring("."); END; + errln; + exit(SYSTEM.VAL(INTEGER,code)); +END AssertFail; + +PROCEDURE SetHalt*(p: HaltProcedure); +BEGIN HaltHandler := p; END SetHalt; + + + + +PROCEDURE TestLittleEndian; + VAR i: INTEGER; + BEGIN i := 1; SYSTEM.GET(SYSTEM.ADR(i), LittleEndian); END TestLittleEndian; + + +PROCEDURE -getstdinhandle(): FileHandle "(uintptr_t)GetStdHandle(STD_INPUT_HANDLE)"; +PROCEDURE -getstdouthandle(): FileHandle "(uintptr_t)GetStdHandle(STD_OUTPUT_HANDLE)"; +PROCEDURE -getstderrhandle(): FileHandle "(uintptr_t)GetStdHandle(STD_ERROR_HANDLE)"; +PROCEDURE -getpid(): INTEGER "(INTEGER)GetCurrentProcessId()"; + +BEGIN + TestLittleEndian; + + HaltCode := -128; + HaltHandler := NIL; + TimeStart := Time(); + CWD := ""; getCurrentDirectory(CWD); + PID := getpid(); + + SeekSet := seekset(); + SeekCur := seekcur(); + SeekEnd := seekend(); + + StdIn := getstdinhandle(); + StdOut := getstdouthandle(); + StdErr := getstderrhandle(); + + nl[0] := 0DX; (* CR *) + nl[1] := 0AX; (* LF *) + nl[2] := 0X; +END Platform. + diff --git a/src/system/SYSTEM.c b/src/system/SYSTEM.c index 3d875068..0fcc5ee2 100644 --- a/src/system/SYSTEM.c +++ b/src/system/SYSTEM.c @@ -1,205 +1,207 @@ -/* -* The body prefix file of the voc(jet backend) runtime system, Version 1.0 +/* +* The body prefix file of the voc(jet backend) runtime system, Version 1.0 * -* Copyright (c) Software Templ, 1994, 1995 +* Copyright (c) Software Templ, 1994, 1995 * -* Module SYSTEM is subject to change any time without prior notification. -* Software Templ disclaims all warranties with regard to module SYSTEM, -* in particular shall Software Templ not be liable for any damage resulting -* from inappropriate use or modification of module SYSTEM. +* Module SYSTEM is subject to change any time without prior notification. +* Software Templ disclaims all warranties with regard to module SYSTEM, +* in particular shall Software Templ not be liable for any damage resulting +* from inappropriate use or modification of module SYSTEM. * -* Version 1.1 jt, 24.11.95 fixes for correct pointer arithmetic on Cray computers -* jt 31.1.2007 ANSI prototypes for malloc and exit in order to avoid cc warnings +* Version 1.1 jt, 24.11.95 fixes for correct pointer arithmetic on Cray computers +* jt 31.1.2007 ANSI prototypes for malloc and exit in order to avoid cc warnings * */ #include "SYSTEM.h" -#ifdef __STDC__ #include "stdarg.h" +#include + + +LONGINT SYSTEM_XCHK(LONGINT i, LONGINT ub) {return __X(i, ub);} +LONGINT SYSTEM_RCHK(LONGINT i, LONGINT ub) {return __R(i, ub);} +LONGINT SYSTEM_ASH (LONGINT i, LONGINT n) {return __ASH(i, n);} +LONGINT SYSTEM_ABS (LONGINT i) {return __ABS(i);} +double SYSTEM_ABSD(double i) {return __ABS(i);} + +void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0) +{ + t -= __TPROC0OFF; + t0 -= __TPROC0OFF; + while (*t0 != __EOM) {*t = *t0; t--; t0--;} +} + + +void SYSTEM_ENUMP(void *adr, LONGINT n, void (*P)()) +{ + while (n > 0) { + P((LONGINT)(uintptr_t)(*((void**)(adr)))); + adr = ((void**)adr) + 1; + n--; + } +} + +void SYSTEM_ENUMR(void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()) +{ + LONGINT *t, off; + typ++; + while (n > 0) { + t = typ; + off = *t; + while (off >= 0) {P(*(LONGINT*)((char*)adr+off)); t++; off = *t;} + adr = ((char*)adr) + size; + n--; + } +} + +LONGINT SYSTEM_DIV(unsigned LONGINT x, unsigned LONGINT y) +{ if ((LONGINT) x >= 0) return (x / y); + else return -((y - 1 - x) / y); +} + +LONGINT SYSTEM_MOD(unsigned LONGINT x, unsigned LONGINT y) +{ unsigned LONGINT m; + if ((LONGINT) x >= 0) return (x % y); + else { m = (-x) % y; + if (m != 0) return (y - m); else return 0; + } +} + +LONGINT SYSTEM_ENTIER(double x) +{ + LONGINT y; + if (x >= 0) + return (LONGINT)x; + else { + y = (LONGINT)x; + if (y <= x) return y; else return y - 1; + } +} + +extern void Heap_Lock(); +extern void Heap_Unlock(); + +SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, int nofdyn, ...) +{ + LONGINT nofelems, size, dataoff, n, nptr, *x, *p, nofptrs, i, *ptab, off; + va_list ap; + va_start(ap, nofdyn); + nofelems = 1; + while (nofdim > 0) { + nofelems = nofelems * va_arg(ap, LONGINT); nofdim--; + if (nofelems <= 0) __HALT(-20); + } + va_end(ap); + dataoff = nofdyn * sizeof(LONGINT); + if (elemalgn > sizeof(LONGINT)) { + n = dataoff % elemalgn; + if (n != 0) dataoff += elemalgn - n; + } + size = dataoff + nofelems * elemsz; + Heap_Lock(); + if (typ == NIL) { + /* element typ does not contain pointers */ + x = Heap_NEWBLK(size); + } + else if (typ == (LONGINT*)POINTER__typ) { + /* element type is a pointer */ + x = Heap_NEWBLK(size + nofelems * sizeof(LONGINT)); + p = (LONGINT*)(uintptr_t)x[-1]; + p[-nofelems] = *p; /* build new type desc in situ: 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ + p -= nofelems - 1; n = 1; /* n =1 for skipping the size field */ + while (n <= nofelems) {*p = n*sizeof(LONGINT); p++; n++;} + *p = - (nofelems + 1) * sizeof(LONGINT); /* sentinel */ + x[-1] -= nofelems * sizeof(LONGINT); + } + else { + /* element type is a record that contains pointers */ + ptab = typ + 1; nofptrs = 0; + while (ptab[nofptrs] >= 0) {nofptrs++;} /* number of pointers per element */ + nptr = nofelems * nofptrs; /* total number of pointers */ + x = Heap_NEWBLK(size + nptr * sizeof(LONGINT)); + p = (LONGINT*)(uintptr_t)x[- 1]; + p[-nptr] = *p; /* build new type desc in situ; 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ + p -= nptr - 1; n = 0; off = dataoff; + while (n < nofelems) {i = 0; + while (i < nofptrs) {*p = off + ptab[i]; p++; i++;} + off += elemsz; n++; + } + *p = - (nptr + 1) * sizeof(LONGINT); /* sentinel */ + x[-1] -= nptr * sizeof(LONGINT); + } + if (nofdyn != 0) { + /* setup len vector for index checks */ + va_start(ap, nofdyn); + p = x; + while (nofdyn > 0) {*p = va_arg(ap, LONGINT); p++, nofdyn--;} + va_end(ap); + } + Heap_Unlock(); + return x; +} + + + + +typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler + +#ifndef _WIN32 + + SystemSignalHandler handler[3] = {0}; + + // Provide signal handling for Unix based systems + void signalHandler(int s) { + if (s >= 2 && s <= 4) handler[s-2](s); + // (Ignore other signals) + } + + void SystemSetHandler(int s, uintptr_t h) { + if (s >= 2 && s <= 4) { + int needtosetsystemhandler = handler[s-2] == 0; + handler[s-2] = (SystemSignalHandler)h; + if (needtosetsystemhandler) {signal(s, signalHandler);} + } + } + #else -#include "varargs.h" + + // Provides Windows callback handlers for signal-like scenarios + #include "WindowsWrapper.h" + + SystemSignalHandler SystemInterruptHandler = 0; + SystemSignalHandler SystemQuitHandler = 0; + BOOL ConsoleCtrlHandlerSet = FALSE; + + BOOL WINAPI SystemConsoleCtrlHandler(DWORD ctrlType) { + if ((ctrlType == CTRL_C_EVENT) || (ctrlType == CTRL_BREAK_EVENT)) { + if (SystemInterruptHandler) { + SystemInterruptHandler(2); // SIGINT + return TRUE; + } + } else { // Close, logoff or shutdown + if (SystemQuitHandler) { + SystemQuitHandler(3); // SIGQUIT + return TRUE; + } + } + return FALSE; + } + + void EnsureConsoleCtrlHandler() { + if (!ConsoleCtrlHandlerSet) { + SetConsoleCtrlHandler(SystemConsoleCtrlHandler, TRUE); + ConsoleCtrlHandlerSet = TRUE; + } + } + + void SystemSetInterruptHandler(uintptr_t h) { + EnsureConsoleCtrlHandler(); + SystemInterruptHandler = (SystemSignalHandler)h; + } + + void SystemSetQuitHandler(uintptr_t h) { + EnsureConsoleCtrlHandler(); + SystemQuitHandler = (SystemSignalHandler)h; + } + #endif - -extern void *malloc(unsigned long size); -extern void exit(int status); - -void (*SYSTEM_Halt)(); -LONGINT SYSTEM_halt; /* x in HALT(x) */ -LONGINT SYSTEM_assert; /* x in ASSERT(cond, x) */ -LONGINT SYSTEM_argc; -LONGINT SYSTEM_argv; -LONGINT SYSTEM_lock; -BOOLEAN SYSTEM_interrupted; -static LONGINT SYSTEM_mainfrm; /* adr of main proc stack frame, used for stack collection */ - -#define Lock SYSTEM_lock++ -#define Unlock SYSTEM_lock--; if (SYSTEM_interrupted && (SYSTEM_lock == 0)) __HALT(-9) - - -static void SYSTEM_InitHeap(); -void *SYSTEM__init(); - -void SYSTEM_INIT(argc, argvadr) - int argc; long argvadr; -{ - SYSTEM_mainfrm = argvadr; - SYSTEM_argc = argc; - SYSTEM_argv = *(long*)argvadr; - SYSTEM_InitHeap(); - SYSTEM_halt = -128; - SYSTEM__init(); -} - -void SYSTEM_FINI() -{ - SYSTEM_FINALL(); -} - -long SYSTEM_XCHK(i, ub) long i, ub; {return __X(i, ub);} -long SYSTEM_RCHK(i, ub) long i, ub; {return __R(i, ub);} -long SYSTEM_ASH(i, n) long i, n; {return __ASH(i, n);} -long SYSTEM_ABS(i) long i; {return __ABS(i);} -double SYSTEM_ABSD(i) double i; {return __ABS(i);} - -void SYSTEM_INHERIT(t, t0) - long *t, *t0; -{ - t -= __TPROC0OFF; - t0 -= __TPROC0OFF; - while (*t0 != __EOM) {*t = *t0; t--; t0--;} -} - -void SYSTEM_ENUMP(adr, n, P) - long *adr; - long n; - void (*P)(); -{ - while (n > 0) {P(*adr); adr++; n--;} -} - -void SYSTEM_ENUMR(adr, typ, size, n, P) - char *adr; - long *typ, size, n; - void (*P)(); -{ - long *t, off; - typ++; - while (n > 0) { - t = typ; - off = *t; - while (off >= 0) {P(*(long*)(adr+off)); t++; off = *t;} - adr += size; n--; - } -} - -long SYSTEM_DIV(x, y) - unsigned long x, y; -{ if ((long) x >= 0) return (x / y); - else return -((y - 1 - x) / y); -} - -long SYSTEM_MOD(x, y) - unsigned long x, y; -{ unsigned long m; - if ((long) x >= 0) return (x % y); - else { m = (-x) % y; - if (m != 0) return (y - m); else return 0; - } -} - -long SYSTEM_ENTIER(x) - double x; -{ - long y; - if (x >= 0) - return (long)x; - else { - y = (long)x; - if (y <= x) return y; else return y - 1; - } -} - -void SYSTEM_HALT(n) - int n; -{ - SYSTEM_halt = n; - if (SYSTEM_Halt!=0) SYSTEM_Halt(n); - exit(n); -} - -#ifdef __STDC__ -SYSTEM_PTR SYSTEM_NEWARR(long *typ, long elemsz, int elemalgn, int nofdim, int nofdyn, ...) -#else -SYSTEM_PTR SYSTEM_NEWARR(typ, elemsz, elemalgn, nofdim, nofdyn, va_alist) - long *typ, elemsz; - int elemalgn, nofdim, nofdyn; - va_dcl -#endif -{ - long nofelems, size, dataoff, n, nptr, *x, *p, nofptrs, i, *ptab, off; - va_list ap; -#ifdef __STDC__ - va_start(ap, nofdyn); -#else - va_start(ap); -#endif - nofelems = 1; - while (nofdim > 0) { - nofelems = nofelems * va_arg(ap, long); nofdim--; - if (nofelems <= 0) __HALT(-20); - } - va_end(ap); - dataoff = nofdyn * sizeof(long); - if (elemalgn > sizeof(long)) { - n = dataoff % elemalgn; - if (n != 0) dataoff += elemalgn - n; - } - size = dataoff + nofelems * elemsz; - Lock; - if (typ == NIL) { - /* element typ does not contain pointers */ - x = SYSTEM_NEWBLK(size); - } - else if (typ == POINTER__typ) { - /* element type is a pointer */ - x = SYSTEM_NEWBLK(size + nofelems * sizeof(long)); - p = (long*)x[-1]; - p[-nofelems] = *p; /* build new type desc in situ: 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ - p -= nofelems - 1; n = 1; /* n =1 for skipping the size field */ - while (n <= nofelems) {*p = n*sizeof(long); p++; n++;} - *p = - (nofelems + 1) * sizeof(long); /* sentinel */ - x[-1] -= nofelems * sizeof(long); - } - else { - /* element type is a record that contains pointers */ - ptab = typ + 1; nofptrs = 0; - while (ptab[nofptrs] >= 0) {nofptrs++;} /* number of pointers per element */ - nptr = nofelems * nofptrs; /* total number of pointers */ - x = SYSTEM_NEWBLK(size + nptr * sizeof(long)); - p = (long*)x[- 1]; - p[-nptr] = *p; /* build new type desc in situ; 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ - p -= nptr - 1; n = 0; off = dataoff; - while (n < nofelems) {i = 0; - while (i < nofptrs) {*p = off + ptab[i]; p++; i++;} - off += elemsz; n++; - } - *p = - (nptr + 1) * sizeof(long); /* sentinel */ - x[-1] -= nptr * sizeof(long); - } - if (nofdyn != 0) { - /* setup len vector for index checks */ -#ifdef __STDC__ - va_start(ap, nofdyn); -#else - va_start(ap); -#endif - p = x; - while (nofdyn > 0) {*p = va_arg(ap, long); p++, nofdyn--;} - va_end(ap); - } - Unlock; - return x; -} - -/* ----------- end of SYSTEM.co ------------- */ - diff --git a/src/system/SYSTEM.h b/src/system/SYSTEM.h index 2c8e71d0..f9e2f930 100644 --- a/src/system/SYSTEM.h +++ b/src/system/SYSTEM.h @@ -1,238 +1,275 @@ #ifndef SYSTEM__h #define SYSTEM__h -/* +#ifndef _WIN32 -voc (jet backend) runtime system interface and macros library -copyright (c) Josef Templ, 1995, 1996 + // Building for a Unix/Linux based system + #include // For memcpy ... + #include // For uintptr_t ... -gcc for Linux version (same as SPARC/Solaris2) -uses double # as concatenation operator - -*/ - -#include -#include /* for type sizes -- noch */ - -extern void *memcpy(void *dest, const void *src, unsigned long n); -extern void *malloc(unsigned long size); -extern void exit(int status); - -#define export -#define import extern - -/* constants */ -#define __MAXEXT 16 -#define NIL 0L -#define POINTER__typ (long*)1L /* not NIL and not a valid type */ - -/* basic types */ -//typedef char BOOLEAN; -#define BOOLEAN char -//typedef unsigned char CHAR; -#define CHAR unsigned char -//exactly two bytes -#define LONGCHAR unsigned short int -//typedef signed char SHORTINT; -#define SHORTINT signed char -//for x86 GNU/Linux -//typedef short int INTEGER; -//for x86_64 GNU/Linux -//typedef int INTEGER; -#define INTEGER int -//typedef long LONGINT; -#define LONGINT long -//typedef float REAL; -#define REAL float -//typedef double LONGREAL; -#define LONGREAL double -//typedef unsigned long SET; -#define SET unsigned long -typedef void *SYSTEM_PTR; -//#define *SYSTEM_PTR void -//typedef unsigned char SYSTEM_BYTE; -#define SYSTEM_BYTE unsigned char -typedef int8_t SYSTEM_INT8; -typedef int16_t SYSTEM_INT16; -typedef int32_t SYSTEM_INT32; -typedef int64_t SYSTEM_INT64; - -/* runtime system routines */ -extern long SYSTEM_DIV(); -extern long SYSTEM_MOD(); -extern long SYSTEM_ENTIER(); -extern long SYSTEM_ASH(); -extern long SYSTEM_ABS(); -extern long SYSTEM_XCHK(); -extern long SYSTEM_RCHK(); -extern double SYSTEM_ABSD(); -extern SYSTEM_PTR SYSTEM_NEWREC(); -extern SYSTEM_PTR SYSTEM_NEWBLK(); -#ifdef __STDC__ -extern SYSTEM_PTR SYSTEM_NEWARR(long*, long, int, int, int, ...); #else -extern SYSTEM_PTR SYSTEM_NEWARR(); -#endif -extern SYSTEM_PTR SYSTEM_REGMOD(); -extern void SYSTEM_INCREF(); -extern void SYSTEM_REGCMD(); -extern void SYSTEM_REGTYP(); -extern void SYSTEM_REGFIN(); -extern void SYSTEM_FINALL(); -extern void SYSTEM_INIT(); -extern void SYSTEM_FINI(); -extern void SYSTEM_HALT(); -extern void SYSTEM_INHERIT(); -extern void SYSTEM_ENUMP(); -extern void SYSTEM_ENUMR(); -/* module registry */ -#define __DEFMOD static void *m; if(m!=0)return m -#define __REGMOD(name, enum) if(m==0)m=SYSTEM_REGMOD((CHAR*)name,enum); else return m -#define __ENDMOD return m -#define __INIT(argc, argv) static void *m; SYSTEM_INIT(argc, (long)&argv); -#define __REGMAIN(name, enum) m=SYSTEM_REGMOD(name,enum) -#define __FINI SYSTEM_FINI(); return 0 -#define __IMPORT(name) SYSTEM_INCREF(name##__init()) -#define __REGCMD(name, cmd) SYSTEM_REGCMD(m, name, cmd) + // Building for Windows platform with either mingw under cygwin, or the MS C compiler + #ifdef _WIN64 + typedef unsigned long long size_t; + typedef unsigned long long uintptr_t; + #else + typedef unsigned int size_t; + typedef unsigned int uintptr_t; + #endif /* _WIN64 */ + + typedef unsigned int uint32_t; + void * __cdecl memcpy(void * dest, const void * source, size_t size); + +#endif + + +// The compiler uses 'import' and 'export' which translate to 'extern' and +// nothing respectively. + +#define import extern +#define export + + + +// Known constants + +#define NIL ((void*)0) +#define __MAXEXT 16 +#define POINTER__typ ((LONGINT*)(1)) // not NIL and not a valid type + + +// Oberon types + +#define BOOLEAN char +#define SYSTEM_BYTE unsigned char +#define CHAR unsigned char +#define SHORTINT signed char +#define REAL float +#define LONGREAL double +#define SYSTEM_PTR void* + +// For 32 bit builds, the size of LONGINT depends on a make option: + +#if (__SIZEOF_POINTER__ == 8) || defined(LARGE) || defined(_WIN64) + #define INTEGER int // INTEGER is 32 bit. + #define LONGINT long long // LONGINT is 64 bit. (long long is always 64 bits, while long can be 32 bits e.g. under MSC/MingW) +#else + #define INTEGER short int // INTEGER is 16 bit. + #define LONGINT long // LONGINT is 32 bit. +#endif + +#define SET unsigned LONGINT + + +// OS Memory allocation interfaces are in PlatformXXX.Mod + +extern LONGINT Platform_OSAllocate (LONGINT size); +extern void Platform_OSFree (LONGINT addr); + + +// Run time system routines in SYSTEM.c + +extern LONGINT SYSTEM_XCHK (LONGINT i, LONGINT ub); +extern LONGINT SYSTEM_RCHK (LONGINT i, LONGINT ub); +extern LONGINT SYSTEM_ASH (LONGINT i, LONGINT n); +extern LONGINT SYSTEM_ABS (LONGINT i); +extern double SYSTEM_ABSD (double i); +extern void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0); +extern void SYSTEM_ENUMP (void *adr, LONGINT n, void (*P)()); +extern void SYSTEM_ENUMR (void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()); +extern LONGINT SYSTEM_DIV (unsigned LONGINT x, unsigned LONGINT y); +extern LONGINT SYSTEM_MOD (unsigned LONGINT x, unsigned LONGINT y); +extern LONGINT SYSTEM_ENTIER (double x); + + +// Signal handling in SYSTEM.c + +#ifndef _WIN32 + extern void SystemSetHandler(int s, uintptr_t h); +#else + extern void SystemSetInterruptHandler(uintptr_t h); + extern void SystemSetQuitHandler (uintptr_t h); +#endif + + + +// String comparison + +static int __str_cmp(CHAR *x, CHAR *y){ + LONGINT i = 0; + CHAR ch1, ch2; + do {ch1 = x[i]; ch2 = y[i]; i++; + if (!ch1) return -(int)ch2; + } while (ch1==ch2); + return (int)ch1 - (int)ch2; +} +#define __STRCMP(a,b) __str_cmp((CHAR*)(a), (CHAR*)(b)) + + + +// Inline string, record and array copy + +#define __COPY(s, d, n) {char*_a=(void*)s,*_b=(void*)d; LONGINT _i=0,_t=n-1; \ + while(_i<_t&&((_b[_i]=_a[_i])!=0)){_i++;};_b[_i]=0;} +#define __DUP(x, l, t) x=(void*)memcpy((void*)(uintptr_t)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) +#define __DUPARR(v, t) v=(void*)memcpy(v##__copy,v,sizeof(t)) +#define __DEL(x) Platform_OSFree((LONGINT)(uintptr_t)x) + + + /* SYSTEM ops */ -#define __SYSNEW(p, len) p=SYSTEM_NEWBLK((long)(len)) -#define __VAL(t, x) (*(t*)&(x)) -#define __GET(a, x, t) x= *(t*)(a) -#define __PUT(a, x, t) *(t*)(a)=x -#define __LSHL(x, n, t) ((t)((unsigned t)(x)<<(n))) -#define __LSHR(x, n, t) ((t)((unsigned t)(x)>>(n))) -#define __LSH(x, n, t) ((n)>=0? __LSHL(x, n, t): __LSHR(x, -(n), t)) -#define __ROTL(x, n, t) ((t)((unsigned t)(x)<<(n)|(unsigned t)(x)>>(8*sizeof(t)-(n)))) -#define __ROTR(x, n, t) ((t)((unsigned t)(x)>>(n)|(unsigned t)(x)<<(8*sizeof(t)-(n)))) -#define __LSHR(x, n, t) ((t)((unsigned t)(x)>>(n))) -#define __LSH(x, n, t) ((n)>=0? __LSHL(x, n, t): __LSHR(x, -(n), t)) -#define __ROTL(x, n, t) ((t)((unsigned t)(x)<<(n)|(unsigned t)(x)>>(8*sizeof(t)-(n)))) -#define __ROTR(x, n, t) ((t)((unsigned t)(x)>>(n)|(unsigned t)(x)<<(8*sizeof(t)-(n)))) -#define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) -#define __BIT(x, n) (*(unsigned long*)(x)>>(n)&1) -#define __MOVE(s, d, n) memcpy((char*)(d),(char*)(s),n) -/* std procs and operator mappings */ -#define __SHORT(x, y) ((int)((unsigned long)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) -#define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) -#define __CHR(x) ((CHAR)__R(x, 256)) -#define __CHRF(x) ((CHAR)__RF(x, 256)) -#define __DIV(x, y) ((x)>=0?(x)/(y):-(((y)-1-(x))/(y))) -#define __DIVF(x, y) SYSTEM_DIV((long)(x),(long)(y)) -#define __MOD(x, y) ((x)>=0?(x)%(y):__MODF(x,y)) -#define __MODF(x, y) SYSTEM_MOD((long)(x),(long)(y)) -#define __NEW(p, t) p=SYSTEM_NEWREC((long)t##__typ) -#define __NEWARR SYSTEM_NEWARR -#define __HALT(x) SYSTEM_HALT(x) -#define __ASSERT(cond, x) if (!(cond)) {SYSTEM_assert = x; SYSTEM_HALT(-1);} -#define __ENTIER(x) SYSTEM_ENTIER(x) -#define __ABS(x) (((x)<0)?-(x):(x)) -#define __ABSF(x) SYSTEM_ABS((long)(x)) -#define __ABSFD(x) SYSTEM_ABSD((double)(x)) -#define __CAP(ch) ((CHAR)((ch)&0x5f)) -#define __ODD(x) ((x)&1) -#define __IN(x, s) (((s)>>(x))&1) -#define __SETOF(x) ((SET)1<<(x)) -#define __SETRNG(l, h) ((~(SET)0<<(l))&~(SET)0>>(8*sizeof(SET)-1-(h))) -#define __MASK(x, m) ((x)&~(m)) -#define __COPY(s, d, n) {char*_a=(void*)s,*_b=(void*)d;long _i=0,_t=n-1;while(_i<_t&&((_b[_i]=_a[_i])!=0)){_i++;};_b[_i]=0;} -static int __STRCMP(x, y) - CHAR *x, *y; -{long i = 0; CHAR ch1, ch2; - do {ch1 = x[i]; ch2 = y[i]; i++; - if (!ch1) return -(int)ch2; - } while (ch1==ch2); - return (int)ch1 - (int)ch2; -} -#define __ASH(x, n) ((n)>=0?__ASHL(x,n):__ASHR(x,-(n))) -#define __ASHL(x, n) ((long)(x)<<(n)) -#define __ASHR(x, n) ((long)(x)>>(n)) -#define __ASHF(x, n) SYSTEM_ASH((long)(x), (long)(n)) -#define __DUP(x, l, t) x=(void*)memcpy(alloca(l*sizeof(t)),x,l*sizeof(t)) -#define __DUPARR(v, t) v=(void*)memcpy(v##__copy,v,sizeof(t)) -#define __DEL(x) /* DUP with alloca frees storage automatically */ -#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(long)typ##__typ) -#define __TYPEOF(p) (*(((long**)(p))-1)) -#define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) +#define __VAL(t, x) ((t)(x)) +#define __VALP(t, x) ((t)(uintptr_t)(x)) -/* runtime checks */ -#define __X(i, ub) (((unsigned)(long)(i)<(unsigned long)(ub))?i:(__HALT(-2),0)) -#define __XF(i, ub) SYSTEM_XCHK((long)(i), (long)(ub)) -#define __RETCHK __retchk: __HALT(-3) -#define __CASECHK __HALT(-4) -#define __GUARDP(p, typ, level) ((typ*)(__ISP(p,typ,level)?p:(__HALT(-5),p))) -#define __GUARDR(r, typ, level) (*((typ*)(__IS(r##__typ,typ,level)?r:(__HALT(-5),r)))) -#define __GUARDA(p, typ, level) ((struct typ*)(__IS(__TYPEOF(p),typ,level)?p:(__HALT(-5),p))) -#define __GUARDEQR(p, dyntyp, typ) if(dyntyp!=typ##__typ) __HALT(-6);*(p) -#define __GUARDEQP(p, typ) if(__TYPEOF(p)!=typ##__typ)__HALT(-6);*(p) -#define __WITHCHK __HALT(-7) -#define __R(i, ub) (((unsigned)(long)(i)<(unsigned long)(ub))?i:(__HALT(-8),0)) -#define __RF(i, ub) SYSTEM_RCHK((long)(i),(long)(ub)) +#define __GET(a, x, t) x= *(t*)(uintptr_t)(a) +#define __PUT(a, x, t) *(t*)(uintptr_t)(a)=x +#define __LSHL(x, n, t) ((t)((unsigned t)(x)<<(n))) +#define __LSHR(x, n, t) ((t)((unsigned t)(x)>>(n))) +#define __LSH(x, n, t) ((n)>=0? __LSHL(x, n, t): __LSHR(x, -(n), t)) +#define __ROTL(x, n, t) ((t)((unsigned t)(x)<<(n)|(unsigned t)(x)>>(8*sizeof(t)-(n)))) +#define __ROTR(x, n, t) ((t)((unsigned t)(x)>>(n)|(unsigned t)(x)<<(8*sizeof(t)-(n)))) +#define __LSHR(x, n, t) ((t)((unsigned t)(x)>>(n))) +#define __LSH(x, n, t) ((n)>=0? __LSHL(x, n, t): __LSHR(x, -(n), t)) +#define __ROTL(x, n, t) ((t)((unsigned t)(x)<<(n)|(unsigned t)(x)>>(8*sizeof(t)-(n)))) +#define __ROTR(x, n, t) ((t)((unsigned t)(x)>>(n)|(unsigned t)(x)<<(8*sizeof(t)-(n)))) +#define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) +#define __BIT(x, n) (*(unsigned LONGINT*)(x)>>(n)&1) +#define __MOVE(s, d, n) memcpy((char*)(uintptr_t)(d),(char*)(uintptr_t)(s),n) +#define __ASHL(x, n) ((LONGINT)(x)<<(n)) +#define __ASHR(x, n) ((LONGINT)(x)>>(n)) +#define __ASH(x, n) ((n)>=0?__ASHL(x,n):__ASHR(x,-(n))) +#define __ASHF(x, n) SYSTEM_ASH((LONGINT)(x), (LONGINT)(n)) +#define __SHORT(x, y) ((int)((unsigned LONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) +#define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) +#define __CHR(x) ((CHAR)__R(x, 256)) +#define __CHRF(x) ((CHAR)__RF(x, 256)) +#define __DIV(x, y) ((x)>=0?(x)/(y):-(((y)-1-(x))/(y))) +#define __DIVF(x, y) SYSTEM_DIV((LONGINT)(x),(LONGINT)(y)) +#define __MOD(x, y) ((x)>=0?(x)%(y):__MODF(x,y)) +#define __MODF(x, y) SYSTEM_MOD((LONGINT)(x),(LONGINT)(y)) +#define __ENTIER(x) SYSTEM_ENTIER(x) +#define __ABS(x) (((x)<0)?-(x):(x)) +#define __ABSF(x) SYSTEM_ABS((LONGINT)(x)) +#define __ABSFD(x) SYSTEM_ABSD((double)(x)) +#define __CAP(ch) ((CHAR)((ch)&0x5f)) +#define __ODD(x) ((x)&1) +#define __IN(x, s) (((s)>>(x))&1) +#define __SETOF(x) ((SET)1<<(x)) +#define __SETRNG(l, h) ((~(SET)0<<(l))&~(SET)0>>(8*sizeof(SET)-1-(h))) +#define __MASK(x, m) ((x)&~(m)) -/* record type descriptors */ -#define __TDESC(t, m, n) \ - static struct t##__desc {\ - long tproc[m]; \ - long tag, next, level, module; \ - char name[24]; \ - long *base[__MAXEXT]; \ - char *rsrvd; \ - long blksz, ptr[n+1]; \ - } t##__desc -#define __BASEOFF (__MAXEXT+1) -#define __TPROC0OFF (__BASEOFF+24/sizeof(long)+5) -#define __EOM 1 -#define __TDFLDS(name, size) {__EOM}, 1, 0, 0, 0, name, {0}, 0, size -#define __ENUMP(adr, n, P) SYSTEM_ENUMP(adr, (long)(n), P) -#define __ENUMR(adr, typ, size, n, P) SYSTEM_ENUMR(adr, typ, (long)(size), (long)(n), P) + +// Runtime checks + +#define __X(i, ub) (((unsigned LONGINT)(i)<(unsigned LONGINT)(ub))?i:(__HALT(-2),0)) +#define __XF(i, ub) SYSTEM_XCHK((LONGINT)(i), (LONGINT)(ub)) +#define __R(i, ub) (((unsigned LONGINT)(i)<(unsigned LONGINT)(ub))?i:(__HALT(-8),0)) +#define __RF(i, ub) SYSTEM_RCHK((LONGINT)(i),(LONGINT)(ub)) +#define __RETCHK __retchk: __HALT(-3); return 0; +#define __CASECHK __HALT(-4) +#define __WITHCHK __HALT(-7) + +#define __GUARDP(p, typ, level) ((typ*)(__ISP(p,typ,level)?p:(__HALT(-5),p))) +#define __GUARDR(r, typ, level) (*((typ*)(__IS(r##__typ,typ,level)?r:(__HALT(-5),r)))) +#define __GUARDA(p, typ, level) ((struct typ*)(__IS(__TYPEOF(p),typ,level)?p:(__HALT(-5),p))) +#define __GUARDEQR(p, dyntyp, typ) if(dyntyp!=typ##__typ) __HALT(-6);*(p) +#define __GUARDEQP(p, typ) if(__TYPEOF(p)!=typ##__typ)__HALT(-6);*(p) + + + +// Module entry/registration/exit + +extern void Heap_REGCMD(); +extern SYSTEM_PTR Heap_REGMOD(); +extern void Heap_REGTYP(); +extern void Heap_INCREF(); + +#define __DEFMOD static void *m; if (m!=0) {return m;} +#define __REGCMD(name, cmd) Heap_REGCMD(m, (CHAR*)name, cmd) +#define __REGMOD(name, enum) if (m==0) {m = Heap_REGMOD((CHAR*)name,enum);} +#define __ENDMOD return m +#define __MODULE_IMPORT(name) Heap_INCREF(name##__init()) + + + +// Main module initialisation, registration and finalisation + +extern void Platform_Init(INTEGER argc, LONGINT argv); +extern void *Platform_MainModule; +extern void Heap_FINALL(); + +#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (LONGINT)(uintptr_t)&argv); +#define __REGMAIN(name, enum) m = Heap_REGMOD((CHAR*)name,enum) +#define __FINI Heap_FINALL(); return 0 + + +// Assertions and Halts + +extern void Platform_Halt(LONGINT x); +extern void Platform_AssertFail(LONGINT x); + +#define __HALT(x) Platform_Halt(x) +#define __ASSERT(cond, x) if (!(cond)) Platform_AssertFail((LONGINT)(x)) + + +// Memory allocation + +extern SYSTEM_PTR Heap_NEWBLK (LONGINT size); +extern SYSTEM_PTR Heap_NEWREC (LONGINT tag); +extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); + +#define __SYSNEW(p, len) p = Heap_NEWBLK((LONGINT)(len)) +#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(uintptr_t)t##__typ) +#define __NEWARR SYSTEM_NEWARR + + + +/* Type handling */ + +#define __TDESC(t, m, n) \ + static struct t##__desc { \ + LONGINT tproc[m]; /* Proc for each ptr field */ \ + LONGINT tag; \ + LONGINT next; /* Module table type list points here */ \ + LONGINT level; \ + LONGINT module; \ + char name[24]; \ + LONGINT basep[__MAXEXT]; /* List of bases this extends */ \ + LONGINT reserved; \ + LONGINT blksz; /* xxx_typ points here */ \ + LONGINT ptr[n+1]; /* Offsets of ptrs up to -ve sentinel */ \ + } t##__desc + +#define __BASEOFF (__MAXEXT+1) // blksz as index to base. +#define __TPROC0OFF (__BASEOFF+24/sizeof(LONGINT)+5) // blksz as index to tproc IFF m=1. +#define __EOM 1 +#define __TDFLDS(name, size) {__EOM}, 1, 0, 0, 0, name, {0}, 0, size +#define __ENUMP(adr, n, P) SYSTEM_ENUMP(adr, (LONGINT)(n), P) +#define __ENUMR(adr, typ, size, n, P) SYSTEM_ENUMR(adr, typ, (LONGINT)(size), (LONGINT)(n), P) #define __INITYP(t, t0, level) \ - t##__typ= &t##__desc.blksz; \ - memcpy(t##__desc.base, t0##__typ - __BASEOFF, level*sizeof(long)); \ - t##__desc.base[level]=t##__typ; \ - t##__desc.module=(long)m; \ - if(t##__desc.blksz!=sizeof(struct t)) __HALT(-15); \ - t##__desc.blksz=(t##__desc.blksz+5*sizeof(long)-1)/(4*sizeof(long))*(4*sizeof(long)); \ - SYSTEM_REGTYP(m, (long)&t##__desc.next); \ - SYSTEM_INHERIT(t##__typ, t0##__typ) + t##__typ = (LONGINT*)&t##__desc.blksz; \ + memcpy(t##__desc.basep, t0##__typ - __BASEOFF, level*sizeof(LONGINT)); \ + t##__desc.basep[level] = (LONGINT)(uintptr_t)t##__typ; \ + t##__desc.module = (LONGINT)(uintptr_t)m; \ + if(t##__desc.blksz!=sizeof(struct t)) __HALT(-15); \ + t##__desc.blksz = (t##__desc.blksz+5*sizeof(LONGINT)-1)/(4*sizeof(LONGINT))*(4*sizeof(LONGINT)); \ + Heap_REGTYP(m, (LONGINT)(uintptr_t)&t##__desc.next); \ + SYSTEM_INHERIT(t##__typ, t0##__typ) + +#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(uintptr_t)typ##__typ) +#define __TYPEOF(p) ((LONGINT*)(uintptr_t)(*(((LONGINT*)(p))-1))) +#define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) + +// Oberon-2 type bound procedures support +#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(uintptr_t)proc +#define __SEND(typ, num, funtyp, parlist) ((funtyp)((uintptr_t)*(typ-(__TPROC0OFF+num))))parlist -/* Oberon-2 type bound procedures support */ -#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(long)proc -#define __SEND(typ, num, funtyp, parlist) ((funtyp)(*(typ-(__TPROC0OFF+num))))parlist -/* runtime system variables */ -extern LONGINT SYSTEM_argc; -extern LONGINT SYSTEM_argv; -extern void (*SYSTEM_Halt)(); -extern LONGINT SYSTEM_halt; -extern LONGINT SYSTEM_assert; -extern SYSTEM_PTR SYSTEM_modules; -extern LONGINT SYSTEM_heapsize; -extern LONGINT SYSTEM_allocated; -extern LONGINT SYSTEM_lock; -extern SHORTINT SYSTEM_gclock; -extern BOOLEAN SYSTEM_interrupted; -/* ANSI prototypes; not used so far -static int __STRCMP(CHAR *x, CHAR *y); -void SYSTEM_INIT(int argc, long argvadr); -void SYSTEM_FINI(void); -long SYSTEM_XCHK(long i, long ub); -long SYSTEM_RCHK(long i, long ub); -long SYSTEM_ASH(long i, long n); -long SYSTEM_ABS(long i); -double SYSTEM_ABSD(double i); -void SYSTEM_INHERIT(long *t, long *t0); -void SYSTEM_ENUMP(long *adr, long n, void (*P)(void*)); -void SYSTEM_ENUMR(char *adr, long *typ, long size, long n, void (*P)(void*)); -long SYSTEM_DIV(unsigned long x, unsigned long y); -long SYSTEM_MOD(unsigned long x, unsigned long y); -long SYSTEM_ENTIER(double x); -void SYSTEM_HALT(int n); -*/ #endif - diff --git a/src/system/WindowsWrapper.h b/src/system/WindowsWrapper.h new file mode 100755 index 00000000..cdb8714c --- /dev/null +++ b/src/system/WindowsWrapper.h @@ -0,0 +1,9 @@ +// WindowsWrapper.h +// +// Includes Windows.h while avoiding conflicts with Oberon types. + +#undef BOOLEAN +#undef CHAR +#include +#define BOOLEAN char +#define CHAR unsigned char From 7bdc53145e4a65704e6cc39c76d23b14752993a2 Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 16 Jun 2016 14:56:42 +0100 Subject: [PATCH 076/580] Update library source to V2. --- src/library/misc/MultiArrayRiders.Mod | 2 +- src/library/misc/MultiArrays.Mod | 2 +- src/library/misc/crt.Mod | 19 +- src/library/ooc/oocCILP32.Mod | 48 +- src/library/ooc/oocCLLP64.Mod | 47 +- src/library/ooc/oocCLP64.Mod | 47 +- src/library/ooc/oocIntConv.Mod | 1 + src/library/ooc/oocLRealConv.Mod | 2 + src/library/ooc/oocRealConv.Mod | 2 + src/library/ooc/oocRts.Mod | 95 +- src/library/ooc/oocSysClock.Mod | 101 +- src/library/ooc/oocwrapperlibc.Mod | 23 + src/library/ooc2/ooc2IntConv.Mod | 3 +- src/library/oocX11/oocX11.Mod | 249 ++-- src/library/oocX11/oocXYplane.Mod | 60 +- src/library/oocX11/oocXutil.Mod | 2 +- src/library/pow/powStrings.Mod | 1278 ++++++++-------- src/library/s3/ethBTrees.Mod | 1 + src/library/s3/ethRandomNumbers.Mod | 2 +- src/library/s3/ethReals.Mod | 223 +-- src/library/s3/ethStrings.Mod | 2 +- src/library/s3/ethZip.Mod | 1 + src/library/s3/ethZlibDeflate.Mod | 1 + src/library/s3/ethZlibInflate.Mod | 3 + src/library/ulm/ulmConstStrings.Mod | 1 + src/library/ulm/ulmEvents.Mod | 1 + src/library/ulm/ulmPersistentObjects.Mod | 1 + src/library/ulm/ulmPrint.Mod | 1224 ++++++++-------- src/library/ulm/ulmResources.Mod | 225 +-- src/library/ulm/ulmSYSTEM.Mod | 52 +- src/library/ulm/ulmScales.Mod | 1 + src/library/ulm/ulmStreamConditions.Mod | 1 + src/library/ulm/ulmStreams.Mod | 1 + src/library/ulm/ulmSysConversions.Mod | 22 +- src/library/ulm/ulmSysIO.Mod | 306 ++-- src/library/ulm/ulmSysStat.Mod | 256 ++-- src/library/ulm/ulmTCrypt.Mod | 1692 +++++++++++----------- src/library/ulm/ulmTexts.Mod | 1 + src/library/ulm/ulmTimes.Mod | 38 +- src/library/ulm/ulmTypes.Mod | 52 +- src/library/v4/Args.Mod | 64 +- src/library/v4/Modules.Mod | 6 +- src/library/v4/Printer.Mod | 7 +- src/library/v4/Reals.Mod | 216 +-- src/library/v4/Sets.Mod | 30 +- src/library/v4/Texts.Mod | 79 +- 46 files changed, 3141 insertions(+), 3349 deletions(-) create mode 100755 src/library/ooc/oocwrapperlibc.Mod diff --git a/src/library/misc/MultiArrayRiders.Mod b/src/library/misc/MultiArrayRiders.Mod index 852dcde0..1d67850b 100644 --- a/src/library/misc/MultiArrayRiders.Mod +++ b/src/library/misc/MultiArrayRiders.Mod @@ -20,7 +20,7 @@ email Patrick.Hunziker@unibas.ch MODULE MultiArrayRiders; (** Patrick Hunziker, Basel, **) (** Implements an array rider access mechanism for multidimensional arrays of arbitrary dimensions defined in MultiArrays*) -IMPORT MultiArrays, Out:= Console, Input := Kernel; +IMPORT MultiArrays, Out := Console, Input := Platform; CONST (** behaviour of array rider at end of array line; not yet completely implemented. The seemingly more exotic variants are especially useful in image processing *) diff --git a/src/library/misc/MultiArrays.Mod b/src/library/misc/MultiArrays.Mod index 7bf04447..a2e61b2c 100644 --- a/src/library/misc/MultiArrays.Mod +++ b/src/library/misc/MultiArrays.Mod @@ -40,7 +40,7 @@ Patrick Hunziker,Basel. email Patrick.Hunziker@unibas.ch *) (** Version 0.9, 19.1.2001 *) -IMPORT Out:= Console, Input:= Kernel; (* Import only needed for Demo purposes *) +IMPORT Out := Console, Input := Platform; (* Import only needed for Demo purposes *) TYPE SIntPtr* = POINTER TO ARRAY OF SHORTINT; diff --git a/src/library/misc/crt.Mod b/src/library/misc/crt.Mod index 3fd63b47..ab6e36b9 100644 --- a/src/library/misc/crt.Mod +++ b/src/library/misc/crt.Mod @@ -1,6 +1,6 @@ MODULE crt; -IMPORT vt100, Unix, Console, +IMPORT vt100, Platform, Console, Strings; (* strings to remove later ? *) CONST @@ -28,11 +28,6 @@ CONST (* Add-in for blinking *) Blink* = 128; -TYPE - PFdSet = POINTER TO Unix.FdSet; - -VAR tmpstr : ARRAY 23 OF CHAR; - PROCEDURE EraseDisplay*; BEGIN vt100.ED(2); @@ -58,16 +53,8 @@ VAR tmpstr : ARRAY 23 OF CHAR; vt100.DECTCEMh; END cursoron; - PROCEDURE Delay*( ms : INTEGER); - VAR i : LONGINT; - tv : Unix.Timeval; - pfd : PFdSet; - BEGIN - tv.sec := 0; - tv.usec := ms * 1000; - pfd := NIL; - i := Unix.Select(0, pfd^, pfd^, pfd^, tv); - END Delay; + PROCEDURE Delay*(ms: INTEGER); + BEGIN Platform.Delay(ms) END Delay; PROCEDURE GotoXY* (x, y: INTEGER); BEGIN diff --git a/src/library/ooc/oocCILP32.Mod b/src/library/ooc/oocCILP32.Mod index 2e7751ff..e868b9f6 100644 --- a/src/library/ooc/oocCILP32.Mod +++ b/src/library/ooc/oocCILP32.Mod @@ -1,5 +1,8 @@ (* $Id: C.Mod,v 1.9 1999/10/03 11:46:01 ooc-devel Exp $ *) MODULE oocC; + +(* ILP32 model *) + (* Basic data types for interfacing to C code. Copyright (C) 1997-1998 Michael van Acken @@ -18,8 +21,7 @@ MODULE oocC; 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *) -IMPORT - SYSTEM; +IMPORT SYSTEM; (* These types are intended to be equivalent to their C counterparts. @@ -28,39 +30,33 @@ Unix they should be fairly safe. *) TYPE - char* = CHAR; - signedchar* = SHORTINT; (* signed char *) - shortint* = INTEGER; (* short int *) - int* = LONGINT; - set* = SET; (* unsigned int, used as set *) - longint* = LONGINT; (* long int *) - (*longset* = SYSTEM.SET64; *) (* unsigned long, used as set *) - longset* = SET; - address* = LONGINT; - float* = REAL; - double* = LONGREAL; + char* = CHAR; (* 8 bits *) + signedchar* = SHORTINT; (* 8 bits *) + shortint* = RECORD a,b: SYSTEM.BYTE END; (* 16 bits *) + int* = LONGINT; (* 32 bits *) + set* = LONGINT; (* 32 bits *) + longint* = LONGINT; (* 32 bits on ILP32 (64 bits is 'long long') *) +(*longset* = SET; n/a *) (* 64 bit SET *) + address* = LONGINT; (* 32 bits *) + float* = REAL; (* 32 bits *) + double* = LONGREAL; (* 64 bits *) enum1* = int; - enum2* = int; - enum4* = int; - - (* if your C compiler uses short enumerations, you'll have to replace the - declarations above with - enum1* = SHORTINT; - enum2* = INTEGER; - enum4* = LONGINT; + (* + enum2* = int; + enum4* = int; *) - FILE* = address; (* this is acually a replacement for `FILE*', i.e., for a pointer type *) - sizet* = longint; - uidt* = int; - gidt* = int; + FILE* = address; (* this is acually a replacement for `FILE*', i.e., for a pointer type *) + sizet* = longint; (* 32 bits in i686 *) + uidt* = int; + gidt* = int; TYPE (* some commonly used C array types *) charPtr1d* = POINTER TO ARRAY OF char; charPtr2d* = POINTER TO ARRAY OF charPtr1d; - intPtr1d* = POINTER TO ARRAY OF int; + intPtr1d* = POINTER TO ARRAY OF int; TYPE (* C string type, assignment compatible with character arrays and string constants *) diff --git a/src/library/ooc/oocCLLP64.Mod b/src/library/ooc/oocCLLP64.Mod index 14638e75..a7eadc0b 100644 --- a/src/library/ooc/oocCLLP64.Mod +++ b/src/library/ooc/oocCLLP64.Mod @@ -1,5 +1,8 @@ (* $Id: C.Mod,v 1.9 1999/10/03 11:46:01 ooc-devel Exp $ *) MODULE oocC; + +(* LP64 model *) + (* Basic data types for interfacing to C code. Copyright (C) 1997-1998 Michael van Acken @@ -18,8 +21,7 @@ MODULE oocC; 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *) -IMPORT - SYSTEM; +IMPORT SYSTEM; (* These types are intended to be equivalent to their C counterparts. @@ -28,42 +30,37 @@ Unix they should be fairly safe. *) TYPE - char* = CHAR; - signedchar* = SHORTINT; (* signed char *) - shortint* = RECORD a,b : SYSTEM.BYTE END; (* 2 bytes on x64_64 *) (* short int *) - int* = INTEGER; - set* = INTEGER;(*SET;*) (* unsigned int, used as set *) - longint* = LONGINT; (* long int *) - longset* = SET; (*SYSTEM.SET64; *) (* unsigned long, used as set *) - address* = LONGINT; (*SYSTEM.ADDRESS;*) - float* = REAL; - double* = LONGREAL; + char* = CHAR; (* 8 bits *) + signedchar* = SHORTINT; (* 8 bits *) + shortint* = RECORD a,b: SYSTEM.BYTE END; (* 16 bits *) + int* = INTEGER; (* 32 bits *) + set* = INTEGER; (* 32 bits *) + longint* = INTEGER; (* 32 bits *) + longset* = SET; (* 64 bits *) + address* = LONGINT; (* 64 bits *) + float* = REAL; (* 32 bits *) + double* = LONGREAL; (* 64 bits *) enum1* = int; - enum2* = int; - enum4* = int; - - (* if your C compiler uses short enumerations, you'll have to replace the - declarations above with - enum1* = SHORTINT; - enum2* = INTEGER; - enum4* = LONGINT; + (* + enum2* = int; + enum4* = int; *) - FILE* = address; (* this is acually a replacement for `FILE*', i.e., for a pointer type *) + FILE* = address; (* this is acually a replacement for `FILE*', i.e., for a pointer type *) sizet* = longint; - uidt* = int; - gidt* = int; + uidt* = int; + gidt* = int; TYPE (* some commonly used C array types *) charPtr1d* = POINTER TO ARRAY OF char; charPtr2d* = POINTER TO ARRAY OF charPtr1d; - intPtr1d* = POINTER TO ARRAY OF int; + intPtr1d* = POINTER TO ARRAY OF int; TYPE (* C string type, assignment compatible with character arrays and string constants *) - string* = POINTER (*[CSTRING]*) TO ARRAY OF char; + string* = POINTER TO ARRAY OF char; TYPE Proc* = PROCEDURE; diff --git a/src/library/ooc/oocCLP64.Mod b/src/library/ooc/oocCLP64.Mod index 14638e75..dcc76584 100644 --- a/src/library/ooc/oocCLP64.Mod +++ b/src/library/ooc/oocCLP64.Mod @@ -1,5 +1,8 @@ (* $Id: C.Mod,v 1.9 1999/10/03 11:46:01 ooc-devel Exp $ *) MODULE oocC; + +(* LP64 model *) + (* Basic data types for interfacing to C code. Copyright (C) 1997-1998 Michael van Acken @@ -18,8 +21,7 @@ MODULE oocC; 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *) -IMPORT - SYSTEM; +IMPORT SYSTEM; (* These types are intended to be equivalent to their C counterparts. @@ -28,42 +30,37 @@ Unix they should be fairly safe. *) TYPE - char* = CHAR; - signedchar* = SHORTINT; (* signed char *) - shortint* = RECORD a,b : SYSTEM.BYTE END; (* 2 bytes on x64_64 *) (* short int *) - int* = INTEGER; - set* = INTEGER;(*SET;*) (* unsigned int, used as set *) - longint* = LONGINT; (* long int *) - longset* = SET; (*SYSTEM.SET64; *) (* unsigned long, used as set *) - address* = LONGINT; (*SYSTEM.ADDRESS;*) - float* = REAL; - double* = LONGREAL; + char* = CHAR; (* 8 bits *) + signedchar* = SHORTINT; (* 8 bits *) + shortint* = RECORD a,b: SYSTEM.BYTE END; (* 16 bits *) + int* = INTEGER; (* 32 bits *) + set* = INTEGER; (* 32 bits *) + longint* = LONGINT; (* 64 bits *) + longset* = SET; (* 64 bits *) + address* = LONGINT; (* 64 bits *) + float* = REAL; (* 32 bits *) + double* = LONGREAL; (* 64 bits *) enum1* = int; - enum2* = int; - enum4* = int; - - (* if your C compiler uses short enumerations, you'll have to replace the - declarations above with - enum1* = SHORTINT; - enum2* = INTEGER; - enum4* = LONGINT; + (* + enum2* = int; + enum4* = int; *) - FILE* = address; (* this is acually a replacement for `FILE*', i.e., for a pointer type *) + FILE* = address; (* this is acually a replacement for `FILE*', i.e., for a pointer type *) sizet* = longint; - uidt* = int; - gidt* = int; + uidt* = int; + gidt* = int; TYPE (* some commonly used C array types *) charPtr1d* = POINTER TO ARRAY OF char; charPtr2d* = POINTER TO ARRAY OF charPtr1d; - intPtr1d* = POINTER TO ARRAY OF int; + intPtr1d* = POINTER TO ARRAY OF int; TYPE (* C string type, assignment compatible with character arrays and string constants *) - string* = POINTER (*[CSTRING]*) TO ARRAY OF char; + string* = POINTER TO ARRAY OF char; TYPE Proc* = PROCEDURE; diff --git a/src/library/ooc/oocIntConv.Mod b/src/library/ooc/oocIntConv.Mod index 1f6532ab..73185830 100644 --- a/src/library/ooc/oocIntConv.Mod +++ b/src/library/ooc/oocIntConv.Mod @@ -162,6 +162,7 @@ BEGIN ELSE RETURN strWrongFormat; END; + ELSE (* Ignore unrecognised class *) END; prev:=class; INC(index) END; diff --git a/src/library/ooc/oocLRealConv.Mod b/src/library/ooc/oocLRealConv.Mod index a596e6de..7aa13f23 100644 --- a/src/library/ooc/oocLRealConv.Mod +++ b/src/library/ooc/oocLRealConv.Mod @@ -231,6 +231,7 @@ BEGIN IF decExp THEN DEC(nexp) END; END | Conv.invalid, Conv.terminator: EXIT + ELSE (* Ignore unrecognised class *) END; prev:=class; INC(index) END; @@ -285,6 +286,7 @@ BEGIN IF decExp THEN DEC(nexp) END; END | Conv.invalid, Conv.terminator: EXIT + ELSE (* Ignore unrecognised class *) END; prev:=class; INC(index) END; diff --git a/src/library/ooc/oocRealConv.Mod b/src/library/ooc/oocRealConv.Mod index 9eaca9ed..b8742bf2 100644 --- a/src/library/ooc/oocRealConv.Mod +++ b/src/library/ooc/oocRealConv.Mod @@ -182,6 +182,7 @@ BEGIN IF decExp THEN DEC(nexp) END; END | Conv.invalid, Conv.terminator: EXIT + ELSE (* Ignore unrecognised class *) END; prev:=class; INC(index) END; @@ -254,6 +255,7 @@ BEGIN IF decExp THEN DEC(nexp) END; END | Conv.invalid, Conv.terminator: EXIT + ELSE (* Ignore unrecognised class *) END; prev:=class; INC(index) END; diff --git a/src/library/ooc/oocRts.Mod b/src/library/ooc/oocRts.Mod index 87461561..86274ce9 100644 --- a/src/library/ooc/oocRts.Mod +++ b/src/library/ooc/oocRts.Mod @@ -1,78 +1,67 @@ MODULE oocRts; (* module is written from scratch by noch to wrap around Unix.Mod and Args.Mod and provide compatibility for some ooc libraries *) -IMPORT Args, Unix, Files, Strings := oocStrings(*, Console*); +IMPORT Args, Platform, Files, Strings := oocStrings(*, Console*); CONST pathSeperator* = "/"; -VAR i : INTEGER; -b : BOOLEAN; -str0 : ARRAY 128 OF CHAR; +VAR + i: INTEGER; + b: BOOLEAN; + str0: ARRAY 128 OF CHAR; PROCEDURE System* (command : ARRAY OF CHAR) : INTEGER; (* Executes `command' as a shell command. Result is the value returned by the libc `system' function. *) -BEGIN -RETURN Unix.System(command) - -END System; +BEGIN RETURN Platform.System(command) END System; PROCEDURE GetEnv* (VAR var: ARRAY OF CHAR; name: ARRAY OF CHAR): BOOLEAN; (* If an environment variable `name' exists, copy its value into `var' and return TRUE. Otherwise return FALSE. *) -BEGIN -RETURN Args.getEnv(name, var); -END GetEnv; +BEGIN RETURN Platform.getEnv(name, var) END GetEnv; PROCEDURE GetUserHome* (VAR home: ARRAY OF CHAR; user: ARRAY OF CHAR); (* Get the user's home directory path (stored in /etc/passwd) or the current user's home directory if user="". *) VAR -f : Files.File; -r : Files.Rider; -str, str1 : ARRAY 1024 OF CHAR; -found, found1 : BOOLEAN; -p, p1, p2 : INTEGER; + f : Files.File; + r : Files.Rider; + str, str1 : ARRAY 1024 OF CHAR; + found, found1 : BOOLEAN; + p, p1, p2 : INTEGER; BEGIN -f := Files.Old("/etc/passwd"); -Files.Set(r, f, 0); - -REPEAT - Files.ReadLine(r, str); - -(* Console.String(str); Console.Ln;*) - - Strings.Extract(str, 0, SHORT(LEN(user)-1), str1); -(* Console.String(str1); Console.Ln;*) - - IF Strings.Equal(user, str1) THEN found := TRUE END; - - UNTIL found OR r.eof; - - IF found THEN - found1 := FALSE; - Strings.FindNext(":", str, SHORT(LEN(user)), found1, p); p2 := p + 1; - Strings.FindNext(":", str, p2, found1, p); p2 := p + 1; - Strings.FindNext(":", str, p2, found1, p); p2 := p + 1; - Strings.FindNext(":", str, p2, found1, p); p2 := p + 1; - Strings.FindNext(":", str, p2, found1, p1); - Strings.Extract(str,p+1,p1-p-1, home); - (*Console.String(home); Console.Ln;*) - ELSE - (* current user's home *) - found1 := GetEnv(home, "HOME"); - (*Console.String("not found"); Console.Ln; Console.String (home); Console.Ln;*) - END + f := Files.Old("/etc/passwd"); + Files.Set(r, f, 0); + REPEAT + Files.ReadLine(r, str); + (* Console.String(str); Console.Ln;*) + Strings.Extract(str, 0, SHORT(LEN(user)-1), str1); + (* Console.String(str1); Console.Ln;*) + found := Strings.Equal(user, str1) + UNTIL found OR r.eof; + IF found THEN + found1 := FALSE; + Strings.FindNext(":", str, SHORT(LEN(user)), found1, p); p2 := p + 1; + Strings.FindNext(":", str, p2, found1, p); p2 := p + 1; + Strings.FindNext(":", str, p2, found1, p); p2 := p + 1; + Strings.FindNext(":", str, p2, found1, p); p2 := p + 1; + Strings.FindNext(":", str, p2, found1, p1); + Strings.Extract(str,p+1,p1-p-1, home); + (*Console.String(home); Console.Ln;*) + ELSE + (* current user's home *) + found1 := GetEnv(home, "HOME"); + (*Console.String("not found"); Console.Ln; Console.String (home); Console.Ln;*) + END END GetUserHome; BEGIN -(* test *) -(* -i := System("ls"); -b := GetEnv(str0, "HOME"); -IF b THEN Console.String(str0); Console.Ln END; - -GetUserHome(str0, "noch"); -*) + (* test *) + (* + i := System("ls"); + b := GetEnv(str0, "HOME"); + IF b THEN Console.String(str0); Console.Ln END; + GetUserHome(str0, "noch"); + *) END oocRts. diff --git a/src/library/ooc/oocSysClock.Mod b/src/library/ooc/oocSysClock.Mod index da43fea4..ee9b7157 100644 --- a/src/library/ooc/oocSysClock.Mod +++ b/src/library/ooc/oocSysClock.Mod @@ -1,110 +1,15 @@ MODULE oocSysClock; -IMPORT Unix; +IMPORT SYSTEM, Platform; -CONST - maxSecondParts* = 999; (* Most systems have just millisecond accuracy *) - - zoneMin* = -780; (* time zone minimum minutes *) - zoneMax* = 720; (* time zone maximum minutes *) - - localTime* = MIN(INTEGER); (* time zone is inactive & time is local *) - unknownZone* = localTime+1; (* time zone is unknown *) - - (* daylight savings mode values *) - unknown* = -1; (* current daylight savings status is unknown *) - inactive* = 0; (* daylight savings adjustments are not in effect *) - active* = 1; (* daylight savings adjustments are being used *) - -TYPE - (* The DateTime type is a system-independent time format whose fields - are defined as follows: - - year > 0 - month = 1 .. 12 - day = 1 .. 31 - hour = 0 .. 23 - minute = 0 .. 59 - second = 0 .. 59 - fractions = 0 .. maxSecondParts - zone = -780 .. 720 - *) - DateTime* = - RECORD - year*: INTEGER; - month*: SHORTINT; - day*: SHORTINT; - hour*: SHORTINT; - minute*: SHORTINT; - second*: SHORTINT; - summerTimeFlag*: SHORTINT; (* daylight savings mode (see above) *) - fractions*: INTEGER; (* parts of a second in milliseconds *) - zone*: INTEGER; (* Time zone differential factor which - is the number of minutes to add to - local time to obtain UTC or is set - to localTime when time zones are - inactive. *) - END; - - -PROCEDURE CanGetClock*(): BOOLEAN; -(* Returns TRUE if a system clock can be read; FALSE otherwise. *) -VAR timeval: Unix.Timeval; timezone: Unix.Timezone; -l : LONGINT; -BEGIN - l := Unix.Gettimeofday(timeval, timezone); - IF l = 0 THEN RETURN TRUE ELSE RETURN FALSE END -END CanGetClock; -(* -PROCEDURE CanSetClock*(): BOOLEAN; -(* Returns TRUE if a system clock can be set; FALSE otherwise. *) -*) -(* -PROCEDURE IsValidDateTime* (d: DateTime): BOOLEAN; -(* Returns TRUE if the value of `d' represents a valid date and time; - FALSE otherwise. *) -*) - - - (* -PROCEDURE SetClock* (userData: DateTime); -(* If possible, sets the system clock to the values of `userData'. *) -*) -(* -PROCEDURE MakeLocalTime * (VAR c: DateTime); -(* Fill in the daylight savings mode and time zone for calendar date `c'. - The fields `zone' and `summerTimeFlag' given in `c' are ignored, assuming - that the rest of the record describes a local time. - Note 1: On most Unix systems the time zone information is only available for - dates falling within approx. 1 Jan 1902 to 31 Dec 2037. Outside this range - the field `zone' will be set to the unspecified `localTime' value (see - above), and `summerTimeFlag' will be set to `unknown'. - Note 2: The time zone information might not be fully accurate for past (and - future) years that apply different DST rules than the current year. - Usually the current set of rules is used for _all_ years between 1902 and - 2037. - Note 3: With DST there is one hour in the year that happens twice: the - hour after which the clock is turned back for a full hour. It is undefined - which time zone will be selected for dates refering to this hour, i.e. - whether DST or normal time zone will be chosen. *) -*) +PROCEDURE CanGetClock*(): BOOLEAN; BEGIN RETURN TRUE END CanGetClock; PROCEDURE GetTimeOfDay* (VAR sec, usec: LONGINT): LONGINT; (* PRIVAT. Don't use this. Take Time.GetTime instead. Equivalent to the C function `gettimeofday'. The return value is `0' on success and `-1' on failure; in the latter case `sec' and `usec' are set to zero. *) - VAR timeval: Unix.Timeval; timezone: Unix.Timezone; - l : LONGINT; BEGIN - l := Unix.Gettimeofday (timeval, timezone); - IF l = 0 THEN - sec := timeval.sec; - usec := timeval.usec; - ELSE - sec := 0; - usec := 0; - END; - RETURN l; + Platform.GetTimeOfDay(sec, usec); RETURN 0; END GetTimeOfDay; END oocSysClock. diff --git a/src/library/ooc/oocwrapperlibc.Mod b/src/library/ooc/oocwrapperlibc.Mod new file mode 100755 index 00000000..c5a0377e --- /dev/null +++ b/src/library/ooc/oocwrapperlibc.Mod @@ -0,0 +1,23 @@ +MODULE oocwrapperlibc; +IMPORT SYSTEM, Platform; + + +PROCEDURE -includeStdio() "#include "; + +PROCEDURE system*(cmd : ARRAY OF CHAR); +VAR r: INTEGER; +BEGIN + r := Platform.System(cmd) +END system; + + +PROCEDURE -sprntf(s, t0, t1, t2: ARRAY OF CHAR): INTEGER + "sprintf((char*)s, (char*)t0, (char*)t1, (char*)t2)"; + +PROCEDURE sprintf*(VAR s: ARRAY OF CHAR; template0: ARRAY OF CHAR; template1: ARRAY OF CHAR; template2: ARRAY OF CHAR); +VAR r : INTEGER; +BEGIN + r := sprntf(s, template0, template1, template2); +END sprintf; + +END oocwrapperlibc. diff --git a/src/library/ooc2/ooc2IntConv.Mod b/src/library/ooc2/ooc2IntConv.Mod index 3b9c0d1b..298835d6 100644 --- a/src/library/ooc2/ooc2IntConv.Mod +++ b/src/library/ooc2/ooc2IntConv.Mod @@ -124,7 +124,7 @@ VAR positive: BOOLEAN; prev, class: Conv.ScanClass; -PROCEDURE LessOrEqual (VAR high: ARRAY OF CHAR; start, end: INTEGER): BOOLEAN; + PROCEDURE LessOrEqual (VAR high: ARRAY OF CHAR; start, end: INTEGER): BOOLEAN; VAR i: INTEGER; BEGIN (* pre: index-start = maxDigits *) @@ -176,6 +176,7 @@ BEGIN ELSE RETURN strWrongFormat; END; + ELSE (* Ignore unrecognised class *) END; prev:=class; INC(index) END; diff --git a/src/library/oocX11/oocX11.Mod b/src/library/oocX11/oocX11.Mod index fa4e860b..b0e793ac 100644 --- a/src/library/oocX11/oocX11.Mod +++ b/src/library/oocX11/oocX11.Mod @@ -1,5 +1,5 @@ MODULE oocX11;(* [INTERFACE "C"; - LINK LIB "X11" ADDOPTION LibX11Prefix, LibX11Suffix END];*) + LINK LIB "X11" ADDOPTION LibX11Prefix, LibX11Suffix END];*) IMPORT C := oocC, SYSTEM; @@ -8,6 +8,7 @@ CONST XPROTOCOL* = 11; (* current protocol version *) XPROTOCOLREVISION* = 0; (* current minor version *) + TYPE ulongmask* = C.longset; (*uintmask* = C.set;*) @@ -46,11 +47,11 @@ TYPE CONST None* = 0; (* universal null resource or null atom *) ParentRelative* = 1; (* background pixmap in CreateWindow - and ChangeWindowAttributes *) + and ChangeWindowAttributes *) CopyFromParent* = 0; (* border pixmap in CreateWindow - and ChangeWindowAttributes - special VisualID and special window - class passed to CreateWindow *) + and ChangeWindowAttributes + special VisualID and special window + class passed to CreateWindow *) PointerWindow* = 0; (* destination window in SendEvent *) InputFocus* = 1; (* destination window in SendEvent *) PointerRoot* = 1; (* focus window in SetInputFocus *) @@ -67,96 +68,96 @@ CONST (* Input Event Masks. Used as event-mask window attribute and as arguments to Grab requests. Not to be confused with event names. *) CONST - NoEventMask* = {}; - KeyPressMask* = {0}; - KeyReleaseMask* = {1}; - ButtonPressMask* = {2}; - ButtonReleaseMask* = {3}; - EnterWindowMask* = {4}; - LeaveWindowMask* = {5}; - PointerMotionMask* = {6}; - PointerMotionHintMask* = {7}; - Button1MotionMask* = {8}; - Button2MotionMask* = {9}; - Button3MotionMask* = {10}; - Button4MotionMask* = {11}; - Button5MotionMask* = {12}; - ButtonMotionMask* = {13}; - KeymapStateMask* = {14}; - ExposureMask* = {15}; - VisibilityChangeMask* = {16}; - StructureNotifyMask* = {17}; - ResizeRedirectMask* = {18}; - SubstructureNotifyMask* = {19}; + NoEventMask* = {}; + KeyPressMask* = {0}; + KeyReleaseMask* = {1}; + ButtonPressMask* = {2}; + ButtonReleaseMask* = {3}; + EnterWindowMask* = {4}; + LeaveWindowMask* = {5}; + PointerMotionMask* = {6}; + PointerMotionHintMask* = {7}; + Button1MotionMask* = {8}; + Button2MotionMask* = {9}; + Button3MotionMask* = {10}; + Button4MotionMask* = {11}; + Button5MotionMask* = {12}; + ButtonMotionMask* = {13}; + KeymapStateMask* = {14}; + ExposureMask* = {15}; + VisibilityChangeMask* = {16}; + StructureNotifyMask* = {17}; + ResizeRedirectMask* = {18}; + SubstructureNotifyMask* = {19}; SubstructureRedirectMask* = {20}; - FocusChangeMask* = {21}; - PropertyChangeMask* = {22}; - ColormapChangeMask* = {23}; - OwnerGrabButtonMask* = {24}; + FocusChangeMask* = {21}; + PropertyChangeMask* = {22}; + ColormapChangeMask* = {23}; + OwnerGrabButtonMask* = {24}; (* Event names. Used in "type" field in XEvent structures. Not to be confused with event masks above. They start from 2 because 0 and 1 are reserved in the protocol for errors and replies. *) CONST - KeyPress* = 2; - KeyRelease* = 3; - ButtonPress* = 4; - ButtonRelease* = 5; - MotionNotify* = 6; - EnterNotify* = 7; - LeaveNotify* = 8; - FocusIn* = 9; - FocusOut* = 10; - KeymapNotify* = 11; - Expose* = 12; - GraphicsExpose* = 13; - NoExpose* = 14; + KeyPress* = 2; + KeyRelease* = 3; + ButtonPress* = 4; + ButtonRelease* = 5; + MotionNotify* = 6; + EnterNotify* = 7; + LeaveNotify* = 8; + FocusIn* = 9; + FocusOut* = 10; + KeymapNotify* = 11; + Expose* = 12; + GraphicsExpose* = 13; + NoExpose* = 14; VisibilityNotify* = 15; - CreateNotify* = 16; - DestroyNotify* = 17; - UnmapNotify* = 18; - MapNotify* = 19; - MapRequest* = 20; - ReparentNotify* = 21; - ConfigureNotify* = 22; + CreateNotify* = 16; + DestroyNotify* = 17; + UnmapNotify* = 18; + MapNotify* = 19; + MapRequest* = 20; + ReparentNotify* = 21; + ConfigureNotify* = 22; ConfigureRequest* = 23; - GravityNotify* = 24; - ResizeRequest* = 25; - CirculateNotify* = 26; + GravityNotify* = 24; + ResizeRequest* = 25; + CirculateNotify* = 26; CirculateRequest* = 27; - PropertyNotify* = 28; - SelectionClear* = 29; + PropertyNotify* = 28; + SelectionClear* = 29; SelectionRequest* = 30; - SelectionNotify* = 31; - ColormapNotify* = 32; - ClientMessage* = 33; - MappingNotify* = 34; - LASTEvent* = 35; (* must be bigger than any event # *) + SelectionNotify* = 31; + ColormapNotify* = 32; + ClientMessage* = 33; + MappingNotify* = 34; + LASTEvent* = 35; (* must be bigger than any event # *) (* Key masks. Used as modifiers to GrabButton and GrabKey, results of QueryPointer, state in various key-, mouse-, and button-related events. *) CONST - ShiftMask* = {0}; - LockMask* = {1}; + ShiftMask* = {0}; + LockMask* = {1}; ControlMask* = {2}; - Mod1Mask* = {3}; - Mod2Mask* = {4}; - Mod3Mask* = {5}; - Mod4Mask* = {6}; - Mod5Mask* = {7}; + Mod1Mask* = {3}; + Mod2Mask* = {4}; + Mod3Mask* = {5}; + Mod4Mask* = {6}; + Mod5Mask* = {7}; (* modifier names. Used to build a SetModifierMapping request or to read a GetModifierMapping request. These correspond to the masks defined above. *) CONST - ShiftMapIndex* = 0; - LockMapIndex* = 1; + ShiftMapIndex* = 0; + LockMapIndex* = 1; ControlMapIndex* = 2; - Mod1MapIndex* = 3; - Mod2MapIndex* = 4; - Mod3MapIndex* = 5; - Mod4MapIndex* = 6; - Mod5MapIndex* = 7; + Mod1MapIndex* = 3; + Mod2MapIndex* = 4; + Mod3MapIndex* = 5; + Mod4MapIndex* = 6; + Mod5MapIndex* = 7; (* button masks. Used in same manner as Key masks above. Not to be confused with button names below. *) @@ -270,14 +271,14 @@ CONST BadMatch* = 8; (* parameter mismatch *) BadDrawable* = 9; (* parameter not a Pixmap or Window *) BadAccess* = 10; (* depending on context: - - key/button already grabbed - - attempt to free an illegal - cmap entry - - attempt to store into a read-only - color map entry. - - attempt to modify the access control - list from other than the local host. - *) + - key/button already grabbed + - attempt to free an illegal + cmap entry + - attempt to store into a read-only + color map entry. + - attempt to modify the access control + list from other than the local host. + *) BadAlloc* = 11; (* insufficient resources *) BadColor* = 12; (* no such colormap *) BadGC* = 13; (* parameter not a GC *) @@ -630,9 +631,9 @@ CONST $XFree86: xc/lib/X11/Xlib.h,v 3.2 1994/09/17 13:44:15 dawes Exp $ *) (* - * Xlib.h - Header definition and support file for the C subroutine - * interface library (Xlib) to the X Window System Protocol (V11). - * Structures and symbols starting with "" are private to the library. + * Xlib.h - Header definition and support file for the C subroutine + * interface library (Xlib) to the X Window System Protocol (V11). + * Structures and symbols starting with "" are private to the library. *) CONST @@ -706,10 +707,10 @@ TYPE linewidth*: C.int; (* line width *) linestyle*: C.int; (* LineSolid, LineOnOffDash, LineDoubleDash *) capstyle*: C.int; (* CapNotLast, CapButt, - CapRound, CapProjecting *) + CapRound, CapProjecting *) joinstyle*: C.int; (* JoinMiter, JoinRound, JoinBevel *) fillstyle*: C.int; (* FillSolid, FillTiled, - FillStippled, FillOpaeueStippled *) + FillStippled, FillOpaeueStippled *) fillrule*: C.int; (* EvenOddRule, WindingRule *) arcmode*: C.int; (* ArcChord, ArcPieSlice *) tile*: Pixmap; (* tile pixmap for tiling operations *) @@ -1118,9 +1119,9 @@ TYPE xroot*, yroot*: C.int; (* coordinates relative to root *) mode*: C.int; (* NotifyNormal, NotifyGrab, NotifyUngrab *) detail*: C.int; (* - * NotifyAncestor, NotifyVirtual, NotifyInferior, - * NotifyNonlinear,NotifyNonlinearVirtual - *) + * NotifyAncestor, NotifyVirtual, NotifyInferior, + * NotifyNonlinear,NotifyNonlinearVirtual + *) samescreen*: Bool; (* same screen flag *) focus*: Bool; (* boolean focus *) state*: uintmask; (* key or button mask *) @@ -1137,10 +1138,10 @@ TYPE window*: Window; (* window of event *) mode*: C.int; (* NotifyNormal, NotifyGrab, NotifyUngrab *) detail*: C.int; (* - * NotifyAncestor, NotifyVirtual, NotifyInferior, - * NotifyNonlinear,NotifyNonlinearVirtual, NotifyPointer, - * NotifyPointerRoot, NotifyDetailNone - *) + * NotifyAncestor, NotifyVirtual, NotifyInferior, + * NotifyNonlinear,NotifyNonlinearVirtual, NotifyPointer, + * NotifyPointerRoot, NotifyDetailNone + *) END; XFocusInEvent* = XFocusChangeEvent; XFocusOutEvent* = XFocusChangeEvent; @@ -1431,7 +1432,7 @@ TYPE display*: DisplayPtr; (* Display the event was read from *) window*: Window; (* unused *) request*: C.int; (* one of MappingModifier, MappingKeyboard, - MappingPointer *) + MappingPointer *) firstkeycode*: C.int; (* first keycode *) count*: C.int; (* defines range of change w. firstkeycode*) END; @@ -1950,6 +1951,13 @@ TYPE XErrorHandler* = PROCEDURE (display: DisplayPtr; errorevent: XErrorEventPtr): C.int; XIOErrorHandler* = PROCEDURE (display: DisplayPtr); XConnectionWatchProc* = PROCEDURE (dpy: DisplayPtr; clientdate: XPointer; fd: C.int; opening: Bool; watchdata: XPointerPtr1d); + + +PROCEDURE -aincludexlib "#include "; +PROCEDURE -aincludexutil "#include "; +PROCEDURE -aincludexresource "#include "; + + (* PROCEDURE XLoadQueryFont* ( display: DisplayPtr; @@ -1987,7 +1995,7 @@ PROCEDURE -XCreateImage* ( height: C.int; bitmapPad: C.int; bytesPerLine: C.int): XImagePtr - "(long)XCreateImage(display, visual, depth, format, offset, data, width, height, bitmapPad, bytesPerLine)"; + "(oocX11_XImagePtr)XCreateImage((struct _XDisplay*)display, (Visual*)visual, depth, format, offset, (char*)data, width, height, bitmapPad, bytesPerLine)"; (* PROCEDURE XInitImage* ( image: XImagePtr): Status; @@ -2017,8 +2025,7 @@ PROCEDURE XGetSubImage* ( * X function declarations. *) *) -PROCEDURE -XOpenDisplay* (name: ARRAY OF C.char): DisplayPtr - "(long)XOpenDisplay(name)"; +PROCEDURE -XOpenDisplay* (name: ARRAY OF C.char): DisplayPtr "(oocX11_DisplayPtr)XOpenDisplay((char*)name)"; PROCEDURE OpenDisplay* (name: ARRAY OF C.char): DisplayPtr; BEGIN @@ -2101,7 +2108,7 @@ PROCEDURE -XCreateGC* ( d: Drawable; valueMask: ulongmask; VAR values: XGCValues): GC - "(long)XCreateGC(display, d, valueMask, values)"; + "(oocX11_GC)XCreateGC((struct _XDisplay*)display, d, valueMask, (XGCValues *)values)"; (* PROCEDURE XGContextFromGC* ( gc: GC): GContext; @@ -2140,7 +2147,7 @@ PROCEDURE -XCreateSimpleWindow* ( borderWidth: C.int; border: C.longint; background: C.longint): Window - "(long)XCreateSimpleWindow(display, parent, x, y, width, height, borderWidth, border, background)"; + "(long)XCreateSimpleWindow((struct _XDisplay*)display, parent, x, y, width, height, borderWidth, border, background)"; (* PROCEDURE XGetSelectionOwner* ( display: DisplayPtr; @@ -2240,7 +2247,7 @@ PROCEDURE XEHeadOfExtensionList* ( PROCEDURE -XRootWindow* ( display: DisplayPtr; screen: C.int): Window - "(long)XRootWindow(display, screen)"; + "(long)XRootWindow((struct _XDisplay*)display, screen)"; (* PROCEDURE XDefaultRootWindow* ( display: DisplayPtr): Window; @@ -2250,7 +2257,7 @@ PROCEDURE XRootWindowOfScreen* ( PROCEDURE -XDefaultVisual* ( display: DisplayPtr; screen: C.int): VisualPtr - "(long)XDefaultVisual(display, screen)"; + "(oocX11_VisualPtr)XDefaultVisual((struct _XDisplay*)display, screen)"; (* PROCEDURE XDefaultVisualOfScreen* ( screen: ScreenPtr): VisualPtr; @@ -2263,12 +2270,12 @@ PROCEDURE XDefaultGCOfScreen* ( PROCEDURE -XBlackPixel* ( display: DisplayPtr; screen: C.int): C.longint - "(long)XBlackPixel(display, screen)"; + "(long)XBlackPixel((struct _XDisplay*)display, screen)"; PROCEDURE -XWhitePixel* ( display: DisplayPtr; screen: C.int): C.longint - "(long)XWhitePixel(display, screen)"; + "(long)XWhitePixel((struct _XDisplay*)display, screen)"; (* PROCEDURE XAllPlanes* (): C.longint; PROCEDURE XBlackPixelOfScreen* ( @@ -2296,7 +2303,7 @@ PROCEDURE XScreenOfDisplay* ( *) PROCEDURE -XDefaultScreenOfDisplay* ( display: DisplayPtr): ScreenPtr - "(long)XDefaultScreen(display)"; + "(long)XDefaultScreen((struct _XDisplay*)display)"; (* PROCEDURE XEventMaskOfScreen* ( screen: ScreenPtr): C.longint; @@ -2523,7 +2530,7 @@ PROCEDURE XClearWindow* ( PROCEDURE -XCloseDisplay* ( display: DisplayPtr) - "XCloseDisplay(display)"; + "XCloseDisplay((struct _XDisplay*)display)"; (* @@ -2577,7 +2584,7 @@ PROCEDURE XDefaultDepthOfScreen* ( *) PROCEDURE -XDefaultScreen* ( display: DisplayPtr): C.int - "(int)XDefaultScreen(display)"; + "(int)XDefaultScreen((struct _XDisplay*)display)"; (* PROCEDURE XDefineCursor* ( display: DisplayPtr; @@ -2591,11 +2598,11 @@ PROCEDURE XDeleteProperty* ( PROCEDURE -XDestroyWindow* ( display: DisplayPtr; w: Window) - "XDestroyWindow(display, w)"; + "XDestroyWindow((struct _XDisplay*)display, w)"; PROCEDURE -XDestroyImage* (image : XImagePtr) - "XDestroyImage(image)"; + "XDestroyImage((struct _XDisplay*)image)"; (* PROCEDURE XDestroySubwindows* ( @@ -2614,7 +2621,7 @@ PROCEDURE XDisplayCells* ( PROCEDURE -XDisplayHeight* ( display: DisplayPtr; screen: C.int): C.int - "(int)XDisplayHeight(display, screen)"; + "(int)XDisplayHeight((struct _XDisplay*)display, screen)"; (* PROCEDURE XDisplayHeightMM* ( display: DisplayPtr; @@ -2630,7 +2637,7 @@ PROCEDURE XDisplayPlanes* ( PROCEDURE -XDisplayWidth* ( display: DisplayPtr; screennumber: C.int): C.int - "(int)XDisplayWidth(display, screen)"; + "(int)XDisplayWidth((struct _XDisplay*)display, screen)"; (* PROCEDURE XDisplayWidthMM* ( display: DisplayPtr; @@ -2690,7 +2697,7 @@ PROCEDURE -XDrawPoint* ( gc: GC; x: C.int; y: C.int) - "XDrawPoint(display, d, gc, x, y)"; + "XDrawPoint((struct _XDisplay*)display, d, (struct _XGC*)gc, x, y)"; (* PROCEDURE XDrawPoints* ( display: DisplayPtr; @@ -2758,7 +2765,7 @@ PROCEDURE XEnableAccessControl* ( PROCEDURE -XEventsQueued* ( display: DisplayPtr; mode: C.int): C.int - "(int)XEventsQueued(display, mode)"; + "(int)XEventsQueued((struct _XDisplay*)display, mode)"; (* PROCEDURE XFetchName* ( display: DisplayPtr; @@ -2797,7 +2804,7 @@ PROCEDURE -XFillRectangle* ( y: C.int; width: C.int; height: C.int) - "XFillRectangle(display, d, gc, x, y, width, height)"; + "XFillRectangle((struct _XDisplay*)display, d, (struct _XGC*)gc, x, y, width, height)"; (* PROCEDURE XFillRectangles* ( display: DisplayPtr; @@ -2808,7 +2815,7 @@ PROCEDURE XFillRectangles* ( *) PROCEDURE -XFlush* ( display: DisplayPtr) - "XFlush(display)"; + "XFlush((struct _XDisplay*)display)"; (* PROCEDURE XForceScreenSaver* ( display: DisplayPtr; @@ -3016,13 +3023,13 @@ PROCEDURE XMapSubwindows* ( PROCEDURE -XMapWindow* ( display: DisplayPtr; w: Window) - "XMapWindow(display, w)"; + "XMapWindow((struct _XDisplay*)display, w)"; PROCEDURE -XMaskEvent* ( display: DisplayPtr; mask: ulongmask; VAR event: XEvent) - "XMaskEvent(display, mask, event)"; + "XMaskEvent((struct _XDisplay*)display, mask, (union _XEvent*)event)"; (* PROCEDURE XMaxCmapsOfScreen* ( @@ -3045,7 +3052,7 @@ PROCEDURE XMoveWindow* ( PROCEDURE -XNextEvent* ( display: DisplayPtr; VAR event: XEvent) - "XNextEvent(display, event)"; + "XNextEvent((struct _XDisplay*)display, (union _XEvent*)event)"; (* PROCEDURE XNoOp* ( display: DisplayPtr); @@ -3091,7 +3098,7 @@ PROCEDURE -XPutImage* ( dstY: C.int; width: C.int; height: C.int) - "XPutImage(display, d, gc, image, srcX, srcY, dstX, dstY, width, height)"; + "XPutImage((struct _XDisplay*)display, d, (struct _XGC*)gc, (struct _XImage*)image, srcX, srcY, dstX, dstY, width, height)"; (* PROCEDURE XQLength* ( display: DisplayPtr): C.int; @@ -3254,7 +3261,7 @@ PROCEDURE -XSelectInput* ( display: DisplayPtr; window: Window; eventMask: ulongmask) - "XSelectInput(display, window, eventMask)"; + "XSelectInput((struct _XDisplay*)display, window, (long)eventMask)"; (* PROCEDURE XSendEvent* ( display: DisplayPtr; @@ -3441,7 +3448,7 @@ PROCEDURE -XStoreName* ( display: DisplayPtr; window: Window; name: ARRAY OF C.char) - "XStoreName(display, window, name)"; + "XStoreName((struct _XDisplay*)display, window, (char*)name)"; (* PROCEDURE XStoreNamedColor* ( display: DisplayPtr; diff --git a/src/library/oocX11/oocXYplane.Mod b/src/library/oocX11/oocXYplane.Mod index d0a68210..4da2383f 100644 --- a/src/library/oocX11/oocXYplane.Mod +++ b/src/library/oocX11/oocXYplane.Mod @@ -32,8 +32,14 @@ VAR initialized: BOOLEAN; (* first call to Open sets this to TRUE *) image: X11.XImagePtr; map: POINTER TO ARRAY OF ARRAY OF SET; + +PROCEDURE -aincludexlib "#include "; +PROCEDURE -aincludexutil "#include "; +PROCEDURE -aincludexresource "#include "; + + PROCEDURE Error (msg: ARRAY OF CHAR); BEGIN Out.String ("Error: "); @@ -70,6 +76,7 @@ PROCEDURE Dot* (x, y, mode: INTEGER); X11.XDrawPoint (display, window, fg, x, H-1-y) | erase: X11.XDrawPoint (display, window, bg, x, H-1-y) + ELSE END; X11.XFlush (display); END @@ -135,44 +142,43 @@ PROCEDURE Key* (): CHAR; PROCEDURE Open*; (* Initializes the drawing plane. *) VAR - screen: C.int; - parent: X11.Window; - bgColor, fgColor: C.longint; + screen: C.int; + parent: X11.Window; + bgColor: C.longint; + fgColor: C.longint; gcValue: X11.XGCValues; - event: X11.XEvent; - x, y: INTEGER; - tmpstr : string; - (*tmpint : INTEGER;*) - scrn : C.int; - vis : X11.VisualPtr; + event: X11.XEvent; + x, y: INTEGER; + tmpstr: string; + scrn : C.int; + vis : X11.VisualPtr; BEGIN - IF ~initialized THEN initialized := TRUE; tmpstr[0] := 0X; (*display := X11.XOpenDisplay (NIL);*) - display := X11.XOpenDisplay (tmpstr); + display := X11.XOpenDisplay(tmpstr); (*display := X11.OpenDisplay (NIL);*) IF (display = NIL) THEN - Error ("Couldn't open display") + Error("Couldn't open display") ELSE - screen := X11.XDefaultScreen (display); + screen := X11.XDefaultScreen(display); X := 0; Y := 0; W := SHORT (X11.XDisplayWidth (display, screen)); - H := SHORT (X11.XDisplayHeight (display, screen)); + H := SHORT (X11.XDisplayHeight(display, screen)); (* adjust ratio W:H to 3:4 [for no paritcular reason] *) IF (W > 3*H DIV 4) THEN W := 3*H DIV 4 END; - parent := X11.XRootWindow (display, screen); - fgColor := X11.XBlackPixel (display, screen); - bgColor := X11.XWhitePixel (display, screen); - window := X11.XCreateSimpleWindow (display, parent, 0, 0, + parent := X11.XRootWindow(display, screen); + fgColor := X11.XBlackPixel(display, screen); + bgColor := X11.XWhitePixel(display, screen); + window := X11.XCreateSimpleWindow(display, parent, 0, 0, W, H, 0, 0, bgColor); - X11.XStoreName (display, window, "XYplane"); - X11.XSelectInput (display, window, X11.KeyPressMask+X11.ExposureMask); - X11.XMapWindow (display, window); + X11.XStoreName(display, window, "XYplane"); + X11.XSelectInput(display, window, X11.KeyPressMask+X11.ExposureMask); + X11.XMapWindow(display, window); X11.XFlush (display); (*tmpint := W + ((*sizeSet*)32-1); tmpint := tmpint DIV 32(*sizeSet*);*) @@ -184,16 +190,16 @@ PROCEDURE Open*; END END; - scrn := X11.XDefaultScreen (display); - vis := X11.XDefaultVisual (display, scrn); - image := X11.XCreateImage (display, + scrn := X11.XDefaultScreen(display); + vis := X11.XDefaultVisual(display, scrn); + image := X11.XCreateImage (display, (*X11.XDefaultVisual (display, X11.XDefaultScreen (display)),*) vis, (*1, X11.XYBitmap, 0, SYSTEM.ADR (map^), W, H, sizeSet, 0);*) - 1, X11.ZPixmap, 0, SYSTEM.ADR (map^), W, H, (*sizeSet*)32, 0); + 1, X11.ZPixmap, 0, SYSTEM.VAL(C.address,SYSTEM.ADR(map^)), W, H, (*sizeSet*)32, 0); (* wait until the window manager gives its ok to draw things *) - X11.XMaskEvent (display, X11.ExposureMask, event); + X11.XMaskEvent(display, X11.ExposureMask, event); (* create graphic context to draw resp. erase a point *) gcValue. foreground := fgColor; @@ -208,7 +214,7 @@ PROCEDURE Open*; END END Open; - PROCEDURE Close*; +PROCEDURE Close*; BEGIN (* X11.XDestroyImage(image); diff --git a/src/library/oocX11/oocXutil.Mod b/src/library/oocX11/oocXutil.Mod index cee7a253..b047cffc 100644 --- a/src/library/oocX11/oocXutil.Mod +++ b/src/library/oocX11/oocXutil.Mod @@ -359,7 +359,7 @@ PROCEDURE -XLookupString* ( VAR keysymReturn: X.KeySym; (*VAR statusInOut(*[NILCOMPAT]*): XComposeStatus): C.int*) VAR statusInOut(*[NILCOMPAT]*): C.longint): C.int - "(int)XLookupString(eventStruct, bufferReturn, bytesBuffer, keysymReturn, statusInOut)"; + "(int)XLookupString((XKeyEvent*)eventStruct, bufferReturn, bytesBuffer, (KeySym*)keysymReturn, (XComposeStatus*)statusInOut)"; (* PROCEDURE XMatchVisualInfo* ( display: X.DisplayPtr; diff --git a/src/library/pow/powStrings.Mod b/src/library/pow/powStrings.Mod index 5d93fbf3..d3d6d4f8 100644 --- a/src/library/pow/powStrings.Mod +++ b/src/library/pow/powStrings.Mod @@ -1,639 +1,639 @@ -(*----------------------------------------------------------------------------*) -(* Copyright (c) 1997 by the POW! team *) -(* e-Mail: pow@fim.uni-linz.ac.at *) -(*----------------------------------------------------------------------------*) -(* 08-20-1997 rel. 32/1.0 LEI *) -(* 19-11-1998 rel. 32/1.1 LEI bug in RemoveTrailingSpaces fixed *) -(**--------------------------------------------------------------------------- - This module provides functions for string processing. This includes combining - strings, copying parts of a string, the conversion of a string to a number or - vice-versa etc. - - All functions of this module start to count the character positions with one - i.e. the first character of a string is at position one. - - All procedures applying to characters instead of strings have a - trailing "Char" in their names. - - All procedures should be save. If character arrays are being used which are - to short for a result, the result will be truncated accordingly. - All functions tolerate errors in character position. However, strings - must always be terminated by a character with the code zero in order - to be processed correctly, otherwise runtime errors may occur. - ----------------------------------------------------------------------------*) - -MODULE powStrings; - -CONST - ISSHORTINT*=1; - ISINTEGER*=2; - ISLONGINT*=3; - ISOUTOFRANGE*=4; - STRINGEMPTY*=5; - STRINGILLEGAL*=6; - -TYPE - StringT*=ARRAY OF CHAR; - String*=POINTER TO StringT; - -PROCEDURE Length*(VAR t:StringT):LONGINT; -(** Returns the length of a zero terminated string in characters. *) -VAR - i,maxlen:LONGINT; -BEGIN - maxlen:=LEN(t); - i:=0; - WHILE (i in the string . - If does not occur in zero is returned. If occurs several times the - position of the first occurrence is returned. *) -VAR - maxl:LONGINT; -BEGIN - IF start<1 THEN start:=0 ELSE DEC(start) END; - maxl:=Length(t); - WHILE (start. - If pattern does not occur in zero is returned. If the pattern occurs several - times the position of the first occurrence is returned. *) -VAR - i,j,maxl,patLen:LONGINT; -BEGIN - IF start<1 THEN start:=0 ELSE DEC(start) END; - maxl:=Length(t); - patLen:=Length(pattern); - i:=start; - j:=0; - WHILE (j is copied to the string . The former contents - of are overwritten and therefore lost. - - The copied section in starts at the position and is characters long. - - If is not large enough to hold the copied string then only the - part that fits into is copied. *) -VAR - i,j,l1,l2:LONGINT; -BEGIN - IF pos<1 THEN - dest[0]:=0X; - RETURN; - END; - l1:=Length(source)-pos+1; - IF l1<1 THEN - dest[0]:=0X; - RETURN; - END; - l2:=LEN(dest)-1; - IF l2 is appended to the string . *) -VAR - i,j,lSrc,lDest:LONGINT; -BEGIN - i:=Length(dest); - j:=0; - lDest:=LEN(dest)-1; - lSrc:=LEN(src); - WHILE (i is appended to the string . *) -VAR - l:LONGINT; -BEGIN - l:=Length(dest); - IF LEN(dest)>=l+2 THEN - dest[l]:=ch; - dest[l+1]:=0X; - END; -END AppendChar; - -PROCEDURE UpCaseChar*(x:CHAR):CHAR; -(** For all lower case letters the corresponding capital letter is returned. This also - applies to international characters such as ä, á, à, â... All other characters are - returned unchanged. The difference between this function and the Oberon-2 function - CAP(x:CHAR): CHAR is that the return value for characters other than lower case - letters of the latter function depends on the individual compiler implementation. *) -BEGIN - CASE x OF - "a".."z":x:=CHR(ORD(x)+ORD("A")-ORD("a")); - | "ö": x:="Ö"; - | "ä": x:="Ä"; - | "ü": x:="Ü"; - | "á": x:="Á"; - | "é": x:="É"; - | "í": x:="Í"; - | "ó": x:="Ó"; - | "ú": x:="Ú"; - | "à": x:="À"; - | "è": x:="È"; - | "ì": x:="Ì"; - | "ò": x:="Ò"; - | "ù": x:="Ù"; - | "â": x:="Â"; - | "ê": x:="Ê"; - | "î": x:="Î"; - | "ô": x:="Ô"; - | "û": x:="Û"; - ELSE - END; - RETURN x; -END UpCaseChar; - -PROCEDURE UpCase*(VAR t:StringT); -(** All lower case letters in are converted to upper case. This also - applies to international characters such as ä, á, à, â... All other characters are - returned unchanged. *) -VAR - i,l:LONGINT; -BEGIN - i:=0; - l:=LEN(t); - WHILE (i characters of the string are deleted. *) -VAR - i,l:LONGINT; -BEGIN - l:=Length(t); - IF (n<1) OR (pos<1) OR (pos>l) THEN RETURN END; - IF n>l-pos+1 THEN n:=l-pos+1 END; - FOR i:=pos-1 TO l-n DO t[i]:=t[i+n]; END; -END Delete; - -PROCEDURE ReverseStringT(VAR t:StringT; n:LONGINT); -VAR - a,b:LONGINT; - x:CHAR; -BEGIN - a:=0; - b:=n-1; - WHILE (a are removed. *) -VAR - i:LONGINT; -BEGIN - i:=Length(t)-1; - WHILE (i>=0) & (t[i]=" ") DO DEC(i) END; - t[i+1]:=0X; -END RemoveTrailingSpaces; - -PROCEDURE RemoveLeadingSpaces*(VAR t:StringT); -(** All blanks at the beginning of are removed. *) -VAR - i,ml:LONGINT; -BEGIN - i:=0; - ml:=LEN(t)-1; - WHILE (i0 THEN Delete(t,1,i) END; -END RemoveLeadingSpaces; - -PROCEDURE Val*(t:StringT):LONGINT; -(** The string is converted to a number and returned as result of the function. - - If the character sequence in does not represent a number and thus the - conversion to a number fails the smallest negative number (MIN(LONGINT)) is returned. - Blanks at the beginning and the end of are ignored. - The number must not contain blanks. *) -CONST - threshDec=MAX(LONGINT) DIV 10; - threshHex=MAX(LONGINT) DIV 16; -VAR - inx,l,v,res:LONGINT; - hex,exit,neg:BOOLEAN; - ch:CHAR; -BEGIN - RemoveTrailingSpaces(t); - RemoveLeadingSpaces(t); - l:=Length(t); - IF l<1 THEN RETURN MIN(LONGINT) END; - hex:=CAP(t[l-1])="H"; - IF hex THEN - DEC(l); - t[l]:=0X; - IF l<1 THEN RETURN MIN(LONGINT) END; - END; - inx:=0; - neg:=FALSE; - res:=0; - IF t[0]="+" THEN INC(inx) - ELSIF t[0]="-" THEN INC(inx); neg:=TRUE; END; - IF t[l-1]="+" THEN DEC(l) - ELSIF t[l-1]="-" THEN DEC(l); neg:=TRUE; END; - exit:=FALSE; - IF hex THEN - IF neg THEN - WHILE (inx="0") & (ch<="9") THEN - v:=ORD(ch)-48; - ELSIF (ch>="A") & (ch<="F") THEN - v:=ORD(ch)-65+10; - ELSE - v:=-1; - END; - IF (v<0) OR (v>15) OR (res<-threshHex) THEN - exit:=TRUE - ELSE - res:=res*16-v; - INC(inx); - END; - END; - ELSE - WHILE (inx="0") & (ch<="9") THEN - v:=ORD(ch)-48; - ELSIF (ch>="A") & (ch<="F") THEN - v:=ORD(ch)-65+10; - ELSE - v:=-1; - END; - IF (v<0) OR (v>15) OR (res>threshHex) THEN - exit:=TRUE - ELSE - res:=res*16+v; - INC(inx); - END; - END; - END; - ELSE - IF neg THEN - WHILE (inx9) OR (res<-threshDec) OR ((res=-threshDec) & (v>8)) THEN - exit:=TRUE - ELSE - res:=res*10-v; - INC(inx); - END; - END; - ELSE - WHILE (inx9) OR (res>threshDec) OR ((res=threshDec) & (v>7)) THEN - exit:=TRUE - ELSE - res:=res*10+v; - INC(inx); - END; - END; - END; - END; - IF exit THEN - RETURN MIN(LONGINT) - ELSE - RETURN res; - END; -END Val; - -PROCEDURE ValResult*(t:StringT):INTEGER; -(** This function can be used to discover whether the string can be converted - to a number, and which kind of integer is at least necessary for storing it. - - The IS??? constants defined for the return value have a numerical order defined - relative to each other: - - ISSHORTINT < ISINTEGER < ISLONGINT < ISOUTOFRANGE < (STRINGEMPTY, STRINGILLEGAL) - - This definition makes it easier to find out if e.g. a number is small enough to - be stored in a INTEGER variable. - - IF Strings.ValResult(txt)<=Strings.ISINTEGER THEN ... - END; - - instead of - - IF (Strings.ValResult(txt)=Strings.ISSHORTINT) OR - (Strings.ValResult(txt)=Strings.ISINTEGER) THEN ... *) -CONST - threshDec=MAX(LONGINT) DIV 10; - threshHex=MAX(LONGINT) DIV 16; - mThreshHex=MIN(LONGINT) DIV 16; -VAR - inx,l,v,res:LONGINT; - h:INTEGER; - hex,exit,neg:BOOLEAN; - ch:CHAR; -BEGIN - RemoveTrailingSpaces(t); - RemoveLeadingSpaces(t); - l:=Length(t); - IF l<1 THEN RETURN STRINGEMPTY END; - hex:=CAP(t[l-1])="H"; - IF hex THEN - DEC(l); - t[l]:=0X; - IF l<1 THEN RETURN STRINGEMPTY END; - END; - inx:=0; - neg:=FALSE; - res:=0; - IF t[0]="+" THEN INC(inx) - ELSIF t[0]="-" THEN INC(inx); neg:=TRUE; END; - IF t[l-1]="+" THEN DEC(l) - ELSIF t[l-1]="-" THEN DEC(l); neg:=TRUE; END; - exit:=FALSE; - IF hex THEN - IF neg THEN - WHILE (inx="0") & (ch<="9") THEN - v:=ORD(ch)-48; - ELSIF (ch>="A") & (ch<="F") THEN - v:=ORD(ch)-65+10; - ELSE - v:=-1; - END; - IF (v<0) OR (v>15) OR (res0)) THEN - exit:=TRUE - ELSE - res:=res*16-v; - INC(inx); - END; - END; - ELSE - WHILE (inx="0") & (ch<="9") THEN - v:=ORD(ch)-48; - ELSIF (ch>="A") & (ch<="F") THEN - v:=ORD(ch)-65+10; - ELSE - v:=-1; - END; - IF (v<0) OR (v>15) OR (res>threshHex) THEN - exit:=TRUE - ELSE - res:=res*16+v; - INC(inx); - END; - END; - END; - ELSE - IF neg THEN - WHILE (inx9) OR (res<-threshDec) OR ((res=-threshDec) & (v>8)) THEN - exit:=TRUE - ELSE - res:=res*10-v; - INC(inx); - END; - END; - ELSE - WHILE (inx9) OR (res>threshDec) OR ((res=threshDec) & (v>7)) THEN - exit:=TRUE - ELSE - res:=res*10+v; - INC(inx); - END; - END; - END; - END; - IF exit THEN - IF (v<0) OR (hex & (v>15)) OR (~hex & (v>9)) THEN RETURN STRINGILLEGAL ELSE RETURN ISOUTOFRANGE END; - ELSE - h:=ISLONGINT; - IF (res>=MIN(INTEGER)) & (res<=MAX(INTEGER)) THEN DEC(h) END; - IF (res>=MIN(SHORTINT)) & (res<=MAX(SHORTINT)) THEN DEC(h) END; - RETURN h; - END; -END ValResult; - -PROCEDURE Str*(x:LONGINT; VAR t:StringT); -(** The number is converted to a string and the result is stored in . - If is not large enough to hold all characters of the number, - is filled with "$" characters. *) -VAR - i:LONGINT; - maxlen:LONGINT; - neg:BOOLEAN; -BEGIN - maxlen:=LEN(t)-1; - IF maxlen<1 THEN - t[0]:=0X; - RETURN; - END; - IF x=0 THEN - t[0]:="0"; - t[1]:=0X; - ELSE - i:=0; - neg:=x<0; - IF neg THEN - IF x=MIN(LONGINT) THEN - COPY("-2147483648",t); - IF Length(t)#11 THEN - FOR i:=0 TO maxlen-1 DO t[i]:="$" END; - t[maxlen]:=0X; - END; - RETURN; - ELSE - x:=-x; - END; - END; - WHILE (x#0) & (i=maxlen)) THEN - FOR i:=0 TO maxlen-1 DO t[i]:="$" END; - t[maxlen]:=0X; - ELSE - IF neg THEN - t[i]:="-"; - INC(i); - END; - t[i]:=0X; - ReverseStringT(t,i); - END; - END; -END Str; - -PROCEDURE HexStr*(x:LONGINT; VAR t:StringT); -(** The number is converted to a string of hexadecimal format and the result is stored - in . At the end of the string an "h" is appended to indicate the hexadecimal - representation of the number. - - If is not large enough to hold all characters of the number, is filled with "$" - characters. Example: 0 becomes "0h", 15 becomes "Fh", 16 becomes "10h". *) -VAR - i:LONGINT; - digit:LONGINT; - maxlen:LONGINT; - neg:BOOLEAN; -BEGIN - maxlen:=LEN(t)-1; - IF maxlen<2 THEN - IF maxlen=1 THEN t[0]:="$"; t[1]:=0X ELSE t[0]:=0X END; - RETURN; - END; - IF x=0 THEN - t[0]:="0"; - t[1]:="h"; - t[2]:=0X; - ELSE - t[0]:="h"; - i:=1; - neg:=x<0; - IF neg THEN - IF x=MIN(LONGINT) THEN - COPY("-80000000h",t); - IF Length(t)#10 THEN - FOR i:=0 TO maxlen-1 DO t[i]:="$" END; - t[maxlen]:=0X; - END; - RETURN; - ELSE - x:=-x; - END; - END; - WHILE (x#0) & (i=maxlen)) THEN - FOR i:=0 TO maxlen-1 DO t[i]:="$" END; - t[maxlen]:=0X; - ELSE - IF neg THEN - t[i]:="-"; - INC(i); - END; - t[i]:=0X; - ReverseStringT(t,i); - END; - END; -END HexStr; - -PROCEDURE InsertChar*(x:CHAR; VAR t:StringT; pos:LONGINT); -(** The character is inserted into the string at the position if - provides space for it. *) -VAR - i,l:LONGINT; -BEGIN - l:=Length(t); - IF l+1l+1 THEN pos:=l+1 END; - FOR i:=l TO pos-1 BY -1 DO t[i+1]:=t[i]; END; - t[pos-1]:=x; - END; -END InsertChar; - -PROCEDURE Insert*(VAR source:StringT; VAR dest:StringT; pos:LONGINT); -(** The string is inserted into the string at the position . - If the maximum length of is insufficient to store the result only - the part of fitting in is inserted. *) -VAR - i,l,dif:LONGINT; -BEGIN - dif:=Length(source); - l:=Length(dest); - IF l+dif+1>LEN(dest) THEN dif:=LEN(dest)-l-1 END; - IF pos<1 THEN pos:=1 ELSIF pos>l+1 THEN pos:=l+1 END; - FOR i:=l TO pos-1 BY -1 DO dest[i+dif]:=dest[i]; END; - FOR i:=pos-1 TO pos-2+dif DO dest[i]:=source[i+1-pos] END; -END Insert; - -PROCEDURE LeftAlign*(VAR t:StringT; n:LONGINT); -(** The length of is increased to characters by appending blanks. If has - already the appropriate length or is longer remains unchanged. *) -VAR - l,i:LONGINT; - maxlen:LONGINT; -BEGIN - maxlen:=LEN(t); - IF n+1>maxlen THEN n:=maxlen-1; END; - l:=Length(t); - IF l<=n-1 THEN - FOR i:=l TO n-1 DO t[i]:=" " END; - t[n]:=0X; - END; -END LeftAlign; - -PROCEDURE RightAlign*(VAR t:StringT; n:LONGINT); -(** The length of is increased to characters by inserting blanks at the - beginning. If has already the appropriate length or is longer remains unchanged. *) -VAR - l,i:LONGINT; - maxlen:LONGINT; -BEGIN - maxlen:=LEN(t); - IF n+1>maxlen THEN n:=maxlen-1; END; - l:=Length(t); - IF l in the string . + If does not occur in zero is returned. If occurs several times the + position of the first occurrence is returned. *) +VAR + maxl:LONGINT; +BEGIN + IF start<1 THEN start:=0 ELSE DEC(start) END; + maxl:=Length(t); + WHILE (start. + If pattern does not occur in zero is returned. If the pattern occurs several + times the position of the first occurrence is returned. *) +VAR + i,j,maxl,patLen:LONGINT; +BEGIN + IF start<1 THEN start:=0 ELSE DEC(start) END; + maxl:=Length(t); + patLen:=Length(pattern); + i:=start; + j:=0; + WHILE (j is copied to the string . The former contents + of are overwritten and therefore lost. + + The copied section in starts at the position and is characters long. + + If is not large enough to hold the copied string then only the + part that fits into is copied. *) +VAR + i,j,l1,l2:LONGINT; +BEGIN + IF pos<1 THEN + dest[0]:=0X; + RETURN; + END; + l1:=Length(source)-pos+1; + IF l1<1 THEN + dest[0]:=0X; + RETURN; + END; + l2:=LEN(dest)-1; + IF l2 is appended to the string . *) +VAR + i,j,lSrc,lDest:LONGINT; +BEGIN + i:=Length(dest); + j:=0; + lDest:=LEN(dest)-1; + lSrc:=LEN(src); + WHILE (i is appended to the string . *) +VAR + l:LONGINT; +BEGIN + l:=Length(dest); + IF LEN(dest)>=l+2 THEN + dest[l]:=ch; + dest[l+1]:=0X; + END; +END AppendChar; + +PROCEDURE UpCaseChar*(x:CHAR):CHAR; +(** For all lower case letters the corresponding capital letter is returned. This also + applies to international characters such as ä, á, à, â... All other characters are + returned unchanged. The difference between this function and the Oberon-2 function + CAP(x:CHAR): CHAR is that the return value for characters other than lower case + letters of the latter function depends on the individual compiler implementation. *) +BEGIN + CASE x OF + "a".."z":x:=CHR(ORD(x)+ORD("A")-ORD("a")); + | "ö": x:="Ö"; + | "ä": x:="Ä"; + | "ü": x:="Ü"; + | "á": x:="Á"; + | "é": x:="É"; + | "í": x:="Í"; + | "ó": x:="Ó"; + | "ú": x:="Ú"; + | "à": x:="À"; + | "è": x:="È"; + | "ì": x:="Ì"; + | "ò": x:="Ò"; + | "ù": x:="Ù"; + | "â": x:="Â"; + | "ê": x:="Ê"; + | "î": x:="Î"; + | "ô": x:="Ô"; + | "û": x:="Û"; + ELSE + END; + RETURN x; +END UpCaseChar; + +PROCEDURE UpCase*(VAR t:StringT); +(** All lower case letters in are converted to upper case. This also + applies to international characters such as ä, á, à, â... All other characters are + returned unchanged. *) +VAR + i,l:LONGINT; +BEGIN + i:=0; + l:=LEN(t); + WHILE (i characters of the string are deleted. *) +VAR + i,l:LONGINT; +BEGIN + l:=Length(t); + IF (n<1) OR (pos<1) OR (pos>l) THEN RETURN END; + IF n>l-pos+1 THEN n:=l-pos+1 END; + FOR i:=pos-1 TO l-n DO t[i]:=t[i+n]; END; +END Delete; + +PROCEDURE ReverseStringT(VAR t:StringT; n:LONGINT); +VAR + a,b:LONGINT; + x:CHAR; +BEGIN + a:=0; + b:=n-1; + WHILE (a are removed. *) +VAR + i:LONGINT; +BEGIN + i:=Length(t)-1; + WHILE (i>=0) & (t[i]=" ") DO DEC(i) END; + t[i+1]:=0X; +END RemoveTrailingSpaces; + +PROCEDURE RemoveLeadingSpaces*(VAR t:StringT); +(** All blanks at the beginning of are removed. *) +VAR + i,ml:LONGINT; +BEGIN + i:=0; + ml:=LEN(t)-1; + WHILE (i0 THEN Delete(t,1,i) END; +END RemoveLeadingSpaces; + +PROCEDURE Val*(t:StringT):LONGINT; +(** The string is converted to a number and returned as result of the function. + + If the character sequence in does not represent a number and thus the + conversion to a number fails the smallest negative number (MIN(LONGINT)) is returned. + Blanks at the beginning and the end of are ignored. + The number must not contain blanks. *) +CONST + threshDec=MAX(LONGINT) DIV 10; + threshHex=MAX(LONGINT) DIV 16; +VAR + inx,l,v,res:LONGINT; + hex,exit,neg:BOOLEAN; + ch:CHAR; +BEGIN + RemoveTrailingSpaces(t); + RemoveLeadingSpaces(t); + l:=Length(t); + IF l<1 THEN RETURN MIN(LONGINT) END; + hex:=CAP(t[l-1])="H"; + IF hex THEN + DEC(l); + t[l]:=0X; + IF l<1 THEN RETURN MIN(LONGINT) END; + END; + inx:=0; + neg:=FALSE; + res:=0; + IF t[0]="+" THEN INC(inx) + ELSIF t[0]="-" THEN INC(inx); neg:=TRUE; END; + IF t[l-1]="+" THEN DEC(l) + ELSIF t[l-1]="-" THEN DEC(l); neg:=TRUE; END; + exit:=FALSE; + IF hex THEN + IF neg THEN + WHILE (inx="0") & (ch<="9") THEN + v:=ORD(ch)-48; + ELSIF (ch>="A") & (ch<="F") THEN + v:=ORD(ch)-65+10; + ELSE + v:=-1; + END; + IF (v<0) OR (v>15) OR (res<-threshHex) THEN + exit:=TRUE + ELSE + res:=res*16-v; + INC(inx); + END; + END; + ELSE + WHILE (inx="0") & (ch<="9") THEN + v:=ORD(ch)-48; + ELSIF (ch>="A") & (ch<="F") THEN + v:=ORD(ch)-65+10; + ELSE + v:=-1; + END; + IF (v<0) OR (v>15) OR (res>threshHex) THEN + exit:=TRUE + ELSE + res:=res*16+v; + INC(inx); + END; + END; + END; + ELSE + IF neg THEN + WHILE (inx9) OR (res<-threshDec) OR ((res=-threshDec) & (v>8)) THEN + exit:=TRUE + ELSE + res:=res*10-v; + INC(inx); + END; + END; + ELSE + WHILE (inx9) OR (res>threshDec) OR ((res=threshDec) & (v>7)) THEN + exit:=TRUE + ELSE + res:=res*10+v; + INC(inx); + END; + END; + END; + END; + IF exit THEN + RETURN MIN(LONGINT) + ELSE + RETURN res; + END; +END Val; + +PROCEDURE ValResult*(t:StringT):INTEGER; +(** This function can be used to discover whether the string can be converted + to a number, and which kind of integer is at least necessary for storing it. + + The IS??? constants defined for the return value have a numerical order defined + relative to each other: + + ISSHORTINT < ISINTEGER < ISLONGINT < ISOUTOFRANGE < (STRINGEMPTY, STRINGILLEGAL) + + This definition makes it easier to find out if e.g. a number is small enough to + be stored in a INTEGER variable. + + IF Strings.ValResult(txt)<=Strings.ISINTEGER THEN ... + END; + + instead of + + IF (Strings.ValResult(txt)=Strings.ISSHORTINT) OR + (Strings.ValResult(txt)=Strings.ISINTEGER) THEN ... *) +CONST + threshDec=MAX(LONGINT) DIV 10; + threshHex=MAX(LONGINT) DIV 16; + mThreshHex=MIN(LONGINT) DIV 16; +VAR + inx,l,v,res:LONGINT; + h:INTEGER; + hex,exit,neg:BOOLEAN; + ch:CHAR; +BEGIN + RemoveTrailingSpaces(t); + RemoveLeadingSpaces(t); + l:=Length(t); + IF l<1 THEN RETURN STRINGEMPTY END; + hex:=CAP(t[l-1])="H"; + IF hex THEN + DEC(l); + t[l]:=0X; + IF l<1 THEN RETURN STRINGEMPTY END; + END; + inx:=0; + neg:=FALSE; + res:=0; + IF t[0]="+" THEN INC(inx) + ELSIF t[0]="-" THEN INC(inx); neg:=TRUE; END; + IF t[l-1]="+" THEN DEC(l) + ELSIF t[l-1]="-" THEN DEC(l); neg:=TRUE; END; + exit:=FALSE; + IF hex THEN + IF neg THEN + WHILE (inx="0") & (ch<="9") THEN + v:=ORD(ch)-48; + ELSIF (ch>="A") & (ch<="F") THEN + v:=ORD(ch)-65+10; + ELSE + v:=-1; + END; + IF (v<0) OR (v>15) OR (res0)) THEN + exit:=TRUE + ELSE + res:=res*16-v; + INC(inx); + END; + END; + ELSE + WHILE (inx="0") & (ch<="9") THEN + v:=ORD(ch)-48; + ELSIF (ch>="A") & (ch<="F") THEN + v:=ORD(ch)-65+10; + ELSE + v:=-1; + END; + IF (v<0) OR (v>15) OR (res>threshHex) THEN + exit:=TRUE + ELSE + res:=res*16+v; + INC(inx); + END; + END; + END; + ELSE + IF neg THEN + WHILE (inx9) OR (res<-threshDec) OR ((res=-threshDec) & (v>8)) THEN + exit:=TRUE + ELSE + res:=res*10-v; + INC(inx); + END; + END; + ELSE + WHILE (inx9) OR (res>threshDec) OR ((res=threshDec) & (v>7)) THEN + exit:=TRUE + ELSE + res:=res*10+v; + INC(inx); + END; + END; + END; + END; + IF exit THEN + IF (v<0) OR (hex & (v>15)) OR (~hex & (v>9)) THEN RETURN STRINGILLEGAL ELSE RETURN ISOUTOFRANGE END; + ELSE + h:=ISLONGINT; + IF (res>=MIN(INTEGER)) & (res<=MAX(INTEGER)) THEN DEC(h) END; + IF (res>=MIN(SHORTINT)) & (res<=MAX(SHORTINT)) THEN DEC(h) END; + RETURN h; + END; +END ValResult; + +PROCEDURE Str*(x:LONGINT; VAR t:StringT); +(** The number is converted to a string and the result is stored in . + If is not large enough to hold all characters of the number, + is filled with "$" characters. *) +VAR + i:LONGINT; + maxlen:LONGINT; + neg:BOOLEAN; +BEGIN + maxlen:=LEN(t)-1; + IF maxlen<1 THEN + t[0]:=0X; + RETURN; + END; + IF x=0 THEN + t[0]:="0"; + t[1]:=0X; + ELSE + i:=0; + neg:=x<0; + IF neg THEN + IF x=MIN(LONGINT) THEN + COPY("-2147483648",t); + IF Length(t)#11 THEN + FOR i:=0 TO maxlen-1 DO t[i]:="$" END; + t[maxlen]:=0X; + END; + RETURN; + ELSE + x:=-x; + END; + END; + WHILE (x#0) & (i=maxlen)) THEN + FOR i:=0 TO maxlen-1 DO t[i]:="$" END; + t[maxlen]:=0X; + ELSE + IF neg THEN + t[i]:="-"; + INC(i); + END; + t[i]:=0X; + ReverseStringT(t,i); + END; + END; +END Str; + +PROCEDURE HexStr*(x:LONGINT; VAR t:StringT); +(** The number is converted to a string of hexadecimal format and the result is stored + in . At the end of the string an "h" is appended to indicate the hexadecimal + representation of the number. + + If is not large enough to hold all characters of the number, is filled with "$" + characters. Example: 0 becomes "0h", 15 becomes "Fh", 16 becomes "10h". *) +VAR + i:LONGINT; + digit:LONGINT; + maxlen:LONGINT; + neg:BOOLEAN; +BEGIN + maxlen:=LEN(t)-1; + IF maxlen<2 THEN + IF maxlen=1 THEN t[0]:="$"; t[1]:=0X ELSE t[0]:=0X END; + RETURN; + END; + IF x=0 THEN + t[0]:="0"; + t[1]:="h"; + t[2]:=0X; + ELSE + t[0]:="h"; + i:=1; + neg:=x<0; + IF neg THEN + IF x=MIN(LONGINT) THEN + COPY("-80000000h",t); + IF Length(t)#10 THEN + FOR i:=0 TO maxlen-1 DO t[i]:="$" END; + t[maxlen]:=0X; + END; + RETURN; + ELSE + x:=-x; + END; + END; + WHILE (x#0) & (i=maxlen)) THEN + FOR i:=0 TO maxlen-1 DO t[i]:="$" END; + t[maxlen]:=0X; + ELSE + IF neg THEN + t[i]:="-"; + INC(i); + END; + t[i]:=0X; + ReverseStringT(t,i); + END; + END; +END HexStr; + +PROCEDURE InsertChar*(x:CHAR; VAR t:StringT; pos:LONGINT); +(** The character is inserted into the string at the position if + provides space for it. *) +VAR + i,l:LONGINT; +BEGIN + l:=Length(t); + IF l+1l+1 THEN pos:=l+1 END; + FOR i:=l TO pos-1 BY -1 DO t[i+1]:=t[i]; END; + t[pos-1]:=x; + END; +END InsertChar; + +PROCEDURE Insert*(VAR source:StringT; VAR dest:StringT; pos:LONGINT); +(** The string is inserted into the string at the position . + If the maximum length of is insufficient to store the result only + the part of fitting in is inserted. *) +VAR + i,l,dif:LONGINT; +BEGIN + dif:=Length(source); + l:=Length(dest); + IF l+dif+1>LEN(dest) THEN dif:=LEN(dest)-l-1 END; + IF pos<1 THEN pos:=1 ELSIF pos>l+1 THEN pos:=l+1 END; + FOR i:=l TO pos-1 BY -1 DO dest[i+dif]:=dest[i]; END; + FOR i:=pos-1 TO pos-2+dif DO dest[i]:=source[i+1-pos] END; +END Insert; + +PROCEDURE LeftAlign*(VAR t:StringT; n:LONGINT); +(** The length of is increased to characters by appending blanks. If has + already the appropriate length or is longer remains unchanged. *) +VAR + l,i:LONGINT; + maxlen:LONGINT; +BEGIN + maxlen:=LEN(t); + IF n+1>maxlen THEN n:=maxlen-1; END; + l:=Length(t); + IF l<=n-1 THEN + FOR i:=l TO n-1 DO t[i]:=" " END; + t[n]:=0X; + END; +END LeftAlign; + +PROCEDURE RightAlign*(VAR t:StringT; n:LONGINT); +(** The length of is increased to characters by inserting blanks at the + beginning. If has already the appropriate length or is longer remains unchanged. *) +VAR + l,i:LONGINT; + maxlen:LONGINT; +BEGIN + maxlen:=LEN(t); + IF n+1>maxlen THEN n:=maxlen-1; END; + l:=Length(t); + IF l s.block.nlit + s.block.ndist THEN SetMsg(s.res, "invalid bit length repeat"); @@ -1125,6 +1127,7 @@ MODULE ethZlibInflate; (** eos **) | InfBad: (* error in stream *) stream.res.code := DataError; EXIT + ELSE END END END diff --git a/src/library/ulm/ulmConstStrings.Mod b/src/library/ulm/ulmConstStrings.Mod index 3b4de5ba..ae62e3b7 100644 --- a/src/library/ulm/ulmConstStrings.Mod +++ b/src/library/ulm/ulmConstStrings.Mod @@ -520,6 +520,7 @@ MODULE ulmConstStrings; | Streams.fromStart: realpos := cnt; | Streams.fromPos: realpos := s.pos + cnt; | Streams.fromEnd: realpos := s.string.length + cnt; + ELSE END; IF (realpos < 0) OR (realpos > s.string.length) THEN RETURN FALSE diff --git a/src/library/ulm/ulmEvents.Mod b/src/library/ulm/ulmEvents.Mod index 605dced8..6016f8b0 100644 --- a/src/library/ulm/ulmEvents.Mod +++ b/src/library/ulm/ulmEvents.Mod @@ -375,6 +375,7 @@ MODULE ulmEvents; ptr := ptr.next; END; psys.currentPriority := oldPriority; + ELSE (* Explicitly ignore unhandled even type reactions *) END; END CallHandlers; diff --git a/src/library/ulm/ulmPersistentObjects.Mod b/src/library/ulm/ulmPersistentObjects.Mod index 5e23487a..3f82e089 100644 --- a/src/library/ulm/ulmPersistentObjects.Mod +++ b/src/library/ulm/ulmPersistentObjects.Mod @@ -647,6 +647,7 @@ MODULE ulmPersistentObjects; ELSE form := incrF; END; + ELSE END; IF mode DIV 4 MOD 2 > 0 THEN INC(form, sizeF); diff --git a/src/library/ulm/ulmPrint.Mod b/src/library/ulm/ulmPrint.Mod index 35f46457..756a3813 100644 --- a/src/library/ulm/ulmPrint.Mod +++ b/src/library/ulm/ulmPrint.Mod @@ -57,13 +57,13 @@ MODULE ulmPrint; ErrorCode* = SHORTINT; ErrorEvent* = POINTER TO ErrorEventRec; ErrorEventRec* = - RECORD - (Events.EventRec) - errorcode*: ErrorCode; - format*: FormatString; - errpos*: LONGINT; - nargs*: INTEGER; - END; + RECORD + (Events.EventRec) + errorcode*: ErrorCode; + format*: FormatString; + errpos*: LONGINT; + nargs*: INTEGER; + END; VAR error*: Events.EventType; errormsg*: ARRAY errors OF Events.Message; @@ -77,679 +77,683 @@ MODULE ulmPrint; errormsg[tooFewArgs] := "too few arguments given"; errormsg[badFormat] := "syntax error in format string"; errormsg[badArgumentSize] := - "size of argument doesn't conform to the corresponding format element"; + "size of argument doesn't conform to the corresponding format element"; END InitErrorHandling; PROCEDURE Out(out: Streams.Stream; VAR fmt: ARRAY OF CHAR; nargs: INTEGER; - VAR p1,p2,p3,p4,p5,p6,p7,p8,p9: ARRAY OF SYS.BYTE; - errors: RelatedEvents.Object); + VAR p1,p2,p3,p4,p5,p6,p7,p8,p9: ARRAY OF SYS.BYTE; + errors: RelatedEvents.Object); CONST - maxargs = 9; (* maximal number of arguments *) - maxargsize = SIZE(LONGREAL); (* maximal arg size (except strings) *) - fmtcmd = "%"; - escape = "\"; + maxargs = 9; (* maximal number of arguments *) + maxargsize = SIZE(LONGREAL); (* maximal arg size (except strings) *) + fmtcmd = "%"; + escape = "\"; VAR - arglen: ARRAY maxargs OF LONGINT; - nextarg: INTEGER; - fmtindex: LONGINT; - fmtchar: CHAR; - hexcharval: LONGINT; + arglen: ARRAY maxargs OF LONGINT; + nextarg: INTEGER; + fmtindex: LONGINT; + fmtchar: CHAR; + hexcharval: LONGINT; PROCEDURE Error(errorcode: ErrorCode); - VAR - event: ErrorEvent; + VAR + event: ErrorEvent; BEGIN - NEW(event); - event.type := error; - event.message := errormsg[errorcode]; - event.errorcode := errorcode; - COPY(fmt, event.format); - event.errpos := fmtindex; - event.nargs := nargs; - RelatedEvents.Raise(errors, event); + NEW(event); + event.type := error; + event.message := errormsg[errorcode]; + event.errorcode := errorcode; + COPY(fmt, event.format); + event.errpos := fmtindex; + event.nargs := nargs; + RelatedEvents.Raise(errors, event); END Error; PROCEDURE Next() : BOOLEAN; BEGIN - IF fmtindex < LEN(fmt) THEN - fmtchar := fmt[fmtindex]; INC(fmtindex); - IF fmtchar = 0X THEN - fmtindex := LEN(fmt); - RETURN FALSE - ELSE - RETURN TRUE - END; - ELSE - RETURN FALSE - END; + IF fmtindex < LEN(fmt) THEN + fmtchar := fmt[fmtindex]; INC(fmtindex); + IF fmtchar = 0X THEN + fmtindex := LEN(fmt); + RETURN FALSE + ELSE + RETURN TRUE + END; + ELSE + RETURN FALSE + END; END Next; PROCEDURE Unget; BEGIN - IF (fmtindex > 0) & (fmtindex < LEN(fmt)) THEN - DEC(fmtindex); fmtchar := fmt[fmtindex]; - ELSE - fmtchar := 0X; - END; + IF (fmtindex > 0) & (fmtindex < LEN(fmt)) THEN + DEC(fmtindex); fmtchar := fmt[fmtindex]; + ELSE + fmtchar := 0X; + END; END Unget; PROCEDURE Write(byte: SYS.BYTE); BEGIN - IF Streams.WriteByte(out, byte) THEN - INC(out.count); - END; + IF Streams.WriteByte(out, byte) THEN + INC(out.count); + END; END Write; PROCEDURE WriteLn; - VAR - lineterm: StreamDisciplines.LineTerminator; - i: INTEGER; + VAR + lineterm: StreamDisciplines.LineTerminator; + i: INTEGER; BEGIN - StreamDisciplines.GetLineTerm(out, lineterm); - Write(lineterm[0]); - i := 1; - WHILE (i < LEN(lineterm)) & (lineterm[i] # 0X) DO - Write(lineterm[i]); INC(i); - END; + StreamDisciplines.GetLineTerm(out, lineterm); + Write(lineterm[0]); + i := 1; + WHILE (i < LEN(lineterm)) & (lineterm[i] # 0X) DO + Write(lineterm[i]); INC(i); + END; END WriteLn; PROCEDURE Int(VAR int: LONGINT; base: INTEGER) : BOOLEAN; - PROCEDURE ValidDigit(ch: CHAR) : BOOLEAN; - BEGIN - RETURN (ch >= "0") & (ch <= "9") OR - (base = 16) & (CAP(ch) >= "A") & (CAP(ch) <= "F") - END ValidDigit; + PROCEDURE ValidDigit(ch: CHAR) : BOOLEAN; + BEGIN + RETURN (ch >= "0") & (ch <= "9") OR + (base = 16) & (CAP(ch) >= "A") & (CAP(ch) <= "F") + END ValidDigit; BEGIN - int := 0; - REPEAT - int := int * base; - IF (fmtchar >= "0") & (fmtchar <= "9") THEN - INC(int, LONG(ORD(fmtchar) - ORD("0"))); - ELSIF (base = 16) & - (CAP(fmtchar) >= "A") & (CAP(fmtchar) <= "F") THEN - INC(int, LONG(10 + ORD(CAP(fmtchar)) - ORD("A"))); - ELSE - RETURN FALSE - END; - UNTIL ~Next() OR ~ValidDigit(fmtchar); - RETURN TRUE + int := 0; + REPEAT + int := int * base; + IF (fmtchar >= "0") & (fmtchar <= "9") THEN + INC(int, LONG(ORD(fmtchar) - ORD("0"))); + ELSIF (base = 16) & + (CAP(fmtchar) >= "A") & (CAP(fmtchar) <= "F") THEN + INC(int, LONG(10 + ORD(CAP(fmtchar)) - ORD("A"))); + ELSE + RETURN FALSE + END; + UNTIL ~Next() OR ~ValidDigit(fmtchar); + RETURN TRUE END Int; PROCEDURE SetSize; - VAR - index: INTEGER; + VAR + index: INTEGER; BEGIN - index := 0; - WHILE index < nargs DO - CASE index OF - | 0: arglen[index] := LEN(p1); - | 1: arglen[index] := LEN(p2); - | 2: arglen[index] := LEN(p3); - | 3: arglen[index] := LEN(p4); - | 4: arglen[index] := LEN(p5); - | 5: arglen[index] := LEN(p6); - | 6: arglen[index] := LEN(p7); - | 7: arglen[index] := LEN(p8); - | 8: arglen[index] := LEN(p9); - END; - INC(index); - END; + index := 0; + WHILE index < nargs DO + CASE index OF + | 0: arglen[index] := LEN(p1); + | 1: arglen[index] := LEN(p2); + | 2: arglen[index] := LEN(p3); + | 3: arglen[index] := LEN(p4); + | 4: arglen[index] := LEN(p5); + | 5: arglen[index] := LEN(p6); + | 6: arglen[index] := LEN(p7); + | 7: arglen[index] := LEN(p8); + | 8: arglen[index] := LEN(p9); + ELSE + END; + INC(index); + END; END SetSize; PROCEDURE Access(par: INTEGER; at: LONGINT) : SYS.BYTE; BEGIN - CASE par OF - | 0: RETURN p1[at] - | 1: RETURN p2[at] - | 2: RETURN p3[at] - | 3: RETURN p4[at] - | 4: RETURN p5[at] - | 5: RETURN p6[at] - | 6: RETURN p7[at] - | 7: RETURN p8[at] - | 8: RETURN p9[at] - END; + CASE par OF + | 0: RETURN p1[at] + | 1: RETURN p2[at] + | 2: RETURN p3[at] + | 3: RETURN p4[at] + | 4: RETURN p5[at] + | 5: RETURN p6[at] + | 6: RETURN p7[at] + | 7: RETURN p8[at] + | 8: RETURN p9[at] + ELSE + END; END Access; PROCEDURE Convert(from: INTEGER; VAR to: ARRAY OF SYS.BYTE); - VAR i: INTEGER; + VAR i: INTEGER; BEGIN - i := 0; - WHILE i < arglen[from] DO - to[i] := Access(from, i); INC(i); - END; + i := 0; + WHILE i < arglen[from] DO + to[i] := Access(from, i); INC(i); + END; END Convert; PROCEDURE GetInt(index: INTEGER; VAR long: LONGINT) : BOOLEAN; - (* access index-th parameter (counted from 0); - fails if arglen[index] > SIZE(LONGINT) - *) - VAR - short: SHORTINT; - (*int16: SYS.INT16;*) - int: INTEGER; - + (* access index-th parameter (counted from 0); + fails if arglen[index] > SIZE(LONGINT) + *) + VAR + short: SHORTINT; + (*int16: SYS.INT16;*) + int: INTEGER; + BEGIN - IF arglen[index] = SIZE(SHORTINT) THEN - Convert(index, short); long := short; - (*ELSIF arglen[index] = SIZE(SYS.INT16) THEN - Convert(index, int16); long := int16;*) - ELSIF arglen[index] = SIZE(INTEGER) THEN - Convert(index, int); long := int; - ELSIF arglen[index] = SIZE(LONGINT) THEN - Convert(index, long); - ELSE - Error(badArgumentSize); - RETURN FALSE - END; - RETURN TRUE + IF arglen[index] = SIZE(SHORTINT) THEN + Convert(index, short); long := short; + (*ELSIF arglen[index] = SIZE(SYS.INT16) THEN + Convert(index, int16); long := int16;*) + ELSIF arglen[index] = SIZE(INTEGER) THEN + Convert(index, int); long := int; + ELSIF arglen[index] = SIZE(LONGINT) THEN + Convert(index, long); + ELSE + Error(badArgumentSize); + RETURN FALSE + END; + RETURN TRUE END GetInt; PROCEDURE Format() : BOOLEAN; - VAR - fillch: CHAR; (* filling character *) - insert: BOOLEAN; (* insert between sign and 1st digit *) - sign: BOOLEAN; (* sign even positive values *) - leftaligned: BOOLEAN; (* output left aligned *) - width, scale: LONGINT; + VAR + fillch: CHAR; (* filling character *) + insert: BOOLEAN; (* insert between sign and 1st digit *) + sign: BOOLEAN; (* sign even positive values *) + leftaligned: BOOLEAN; (* output left aligned *) + width, scale: LONGINT; - PROCEDURE NextArg(VAR index: INTEGER) : BOOLEAN; - BEGIN - IF nextarg < nargs THEN - index := nextarg; INC(nextarg); RETURN TRUE - ELSE - RETURN FALSE - END; - END NextArg; + PROCEDURE NextArg(VAR index: INTEGER) : BOOLEAN; + BEGIN + IF nextarg < nargs THEN + index := nextarg; INC(nextarg); RETURN TRUE + ELSE + RETURN FALSE + END; + END NextArg; - PROCEDURE Flags() : BOOLEAN; - BEGIN - fillch := " "; insert := FALSE; sign := FALSE; - leftaligned := FALSE; - REPEAT - CASE fmtchar OF - | "+": sign := TRUE; - | "0": fillch := "0"; insert := TRUE; - | "-": leftaligned := TRUE; - | "^": insert := TRUE; - | "\": IF ~Next() THEN RETURN FALSE END; fillch := fmtchar; - ELSE - RETURN TRUE - END; - UNTIL ~Next(); - Error(badFormat); - RETURN FALSE (* unexpected end *) - END Flags; + PROCEDURE Flags() : BOOLEAN; + BEGIN + fillch := " "; insert := FALSE; sign := FALSE; + leftaligned := FALSE; + REPEAT + CASE fmtchar OF + | "+": sign := TRUE; + | "0": fillch := "0"; insert := TRUE; + | "-": leftaligned := TRUE; + | "^": insert := TRUE; + | "\": IF ~Next() THEN RETURN FALSE END; fillch := fmtchar; + ELSE + RETURN TRUE + END; + UNTIL ~Next(); + Error(badFormat); + RETURN FALSE (* unexpected end *) + END Flags; - PROCEDURE FetchInt(VAR int: LONGINT) : BOOLEAN; - VAR - index: INTEGER; - BEGIN - RETURN (fmtchar = "*") & Next() & - NextArg(index) & GetInt(index, int) OR - Int(int, 10) & (int >= 0) - END FetchInt; + PROCEDURE FetchInt(VAR int: LONGINT) : BOOLEAN; + VAR + index: INTEGER; + BEGIN + RETURN (fmtchar = "*") & Next() & + NextArg(index) & GetInt(index, int) OR + Int(int, 10) & (int >= 0) + END FetchInt; - PROCEDURE Width() : BOOLEAN; - BEGIN - IF (fmtchar >= "0") & (fmtchar <= "9") OR (fmtchar = "*") THEN - IF FetchInt(width) THEN - RETURN TRUE - END; - Error(badFormat); RETURN FALSE - ELSE - width := 0; - RETURN TRUE - END; - END Width; + PROCEDURE Width() : BOOLEAN; + BEGIN + IF (fmtchar >= "0") & (fmtchar <= "9") OR (fmtchar = "*") THEN + IF FetchInt(width) THEN + RETURN TRUE + END; + Error(badFormat); RETURN FALSE + ELSE + width := 0; + RETURN TRUE + END; + END Width; - PROCEDURE Scale() : BOOLEAN; - BEGIN - IF fmtchar = "." THEN - IF Next() & FetchInt(scale) THEN - RETURN TRUE - ELSE - Error(badFormat); RETURN FALSE - END; - ELSE - scale := -1; RETURN TRUE - END; - END Scale; + PROCEDURE Scale() : BOOLEAN; + BEGIN + IF fmtchar = "." THEN + IF Next() & FetchInt(scale) THEN + RETURN TRUE + ELSE + Error(badFormat); RETURN FALSE + END; + ELSE + scale := -1; RETURN TRUE + END; + END Scale; - PROCEDURE Conversion() : BOOLEAN; + PROCEDURE Conversion() : BOOLEAN; - PROCEDURE Fill(cnt: LONGINT); - (* cnt: space used by normal output *) - VAR i: LONGINT; - BEGIN - IF cnt < width THEN - i := width - cnt; - WHILE i > 0 DO - Write(fillch); - DEC(i); - END; - END; - END Fill; + PROCEDURE Fill(cnt: LONGINT); + (* cnt: space used by normal output *) + VAR i: LONGINT; + BEGIN + IF cnt < width THEN + i := width - cnt; + WHILE i > 0 DO + Write(fillch); + DEC(i); + END; + END; + END Fill; - PROCEDURE FillLeft(cnt: LONGINT); - BEGIN - IF ~leftaligned THEN - Fill(cnt); - END; - END FillLeft; + PROCEDURE FillLeft(cnt: LONGINT); + BEGIN + IF ~leftaligned THEN + Fill(cnt); + END; + END FillLeft; - PROCEDURE FillRight(cnt: LONGINT); - BEGIN - IF leftaligned THEN - Fill(cnt); - END; - END FillRight; + PROCEDURE FillRight(cnt: LONGINT); + BEGIN + IF leftaligned THEN + Fill(cnt); + END; + END FillRight; - PROCEDURE WriteBool(true, false: ARRAY OF CHAR) : BOOLEAN; - VAR index: INTEGER; val: LONGINT; + PROCEDURE WriteBool(true, false: ARRAY OF CHAR) : BOOLEAN; + VAR index: INTEGER; val: LONGINT; - PROCEDURE WriteString(VAR s: ARRAY OF CHAR); - VAR i, len: INTEGER; - BEGIN - len := 0; - WHILE (len < LEN(s)) & (s[len] # 0X) DO - INC(len); - END; - FillLeft(len); - i := 0; - WHILE i < len DO - Write(s[i]); INC(i); - END; - FillRight(len); - END WriteString; + PROCEDURE WriteString(VAR s: ARRAY OF CHAR); + VAR i, len: INTEGER; + BEGIN + len := 0; + WHILE (len < LEN(s)) & (s[len] # 0X) DO + INC(len); + END; + FillLeft(len); + i := 0; + WHILE i < len DO + Write(s[i]); INC(i); + END; + FillRight(len); + END WriteString; - BEGIN - IF NextArg(index) & GetInt(index, val) THEN - IF val = 0 THEN - WriteString(false); RETURN TRUE - ELSIF val = 1 THEN - WriteString(true); RETURN TRUE - END; - END; - RETURN FALSE - END WriteBool; + BEGIN + IF NextArg(index) & GetInt(index, val) THEN + IF val = 0 THEN + WriteString(false); RETURN TRUE + ELSIF val = 1 THEN + WriteString(true); RETURN TRUE + END; + END; + RETURN FALSE + END WriteBool; - PROCEDURE WriteChar() : BOOLEAN; - VAR - val: LONGINT; - index: INTEGER; - BEGIN - IF NextArg(index) & GetInt(index, val) & - (val >= 0) & (val <= ORD(MAX(CHAR))) THEN - FillLeft(1); - Write(CHR(val)); - FillRight(1); - RETURN TRUE - END; - RETURN FALSE - END WriteChar; + PROCEDURE WriteChar() : BOOLEAN; + VAR + val: LONGINT; + index: INTEGER; + BEGIN + IF NextArg(index) & GetInt(index, val) & + (val >= 0) & (val <= ORD(MAX(CHAR))) THEN + FillLeft(1); + Write(CHR(val)); + FillRight(1); + RETURN TRUE + END; + RETURN FALSE + END WriteChar; - PROCEDURE WriteInt(base: INTEGER) : BOOLEAN; - VAR - index: INTEGER; - val: LONGINT; - neg: BOOLEAN; (* set by Convert *) - buf: ARRAY 12 OF CHAR; (* filled by Convert *) - i: INTEGER; - len: INTEGER; (* space needed for val *) - signcnt: INTEGER; (* =1 if sign printed; else 0 *) - signch: CHAR; + PROCEDURE WriteInt(base: INTEGER) : BOOLEAN; + VAR + index: INTEGER; + val: LONGINT; + neg: BOOLEAN; (* set by Convert *) + buf: ARRAY 12 OF CHAR; (* filled by Convert *) + i: INTEGER; + len: INTEGER; (* space needed for val *) + signcnt: INTEGER; (* =1 if sign printed; else 0 *) + signch: CHAR; - PROCEDURE Convert; - VAR - index: INTEGER; - digit: LONGINT; - BEGIN - neg := val < 0; - index := 0; - REPEAT - digit := val MOD base; - val := val DIV base; - IF neg & (digit > 0) THEN - digit := base - digit; - INC(val); - END; - IF digit < 10 THEN - buf[index] := CHR(ORD("0") + digit); - ELSE - buf[index] := CHR(ORD("A") + digit - 10); - END; - INC(index); - UNTIL val = 0; - len := index; - END Convert; + PROCEDURE Convert; + VAR + index: INTEGER; + digit: LONGINT; + BEGIN + neg := val < 0; + index := 0; + REPEAT + digit := val MOD base; + val := val DIV base; + IF neg & (digit > 0) THEN + digit := base - digit; + INC(val); + END; + IF digit < 10 THEN + buf[index] := CHR(ORD("0") + digit); + ELSE + buf[index] := CHR(ORD("A") + digit - 10); + END; + INC(index); + UNTIL val = 0; + len := index; + END Convert; - BEGIN (* WriteInt *) - IF NextArg(index) & GetInt(index, val) THEN - Convert; - IF sign OR neg THEN - signcnt := 1; - IF neg THEN - signch := "-"; - ELSE - signch := "+"; - END; - ELSE - signcnt := 0; - END; - IF insert & (signcnt = 1) THEN - Write(signch); - END; - FillLeft(len+signcnt); - IF ~insert & (signcnt = 1) THEN - Write(signch); - END; - i := len; - WHILE i > 0 DO - DEC(i); Write(buf[i]); - END; - FillRight(len+signcnt); - RETURN TRUE - END; - RETURN FALSE - END WriteInt; + BEGIN (* WriteInt *) + IF NextArg(index) & GetInt(index, val) THEN + Convert; + IF sign OR neg THEN + signcnt := 1; + IF neg THEN + signch := "-"; + ELSE + signch := "+"; + END; + ELSE + signcnt := 0; + END; + IF insert & (signcnt = 1) THEN + Write(signch); + END; + FillLeft(len+signcnt); + IF ~insert & (signcnt = 1) THEN + Write(signch); + END; + i := len; + WHILE i > 0 DO + DEC(i); Write(buf[i]); + END; + FillRight(len+signcnt); + RETURN TRUE + END; + RETURN FALSE + END WriteInt; - PROCEDURE WriteReal(format: CHAR) : BOOLEAN; - (* format either "f", "e", or "g" *) - CONST - defaultscale = 6; - VAR - index: INTEGER; - lr: LONGREAL; - r: REAL; - shortint: SHORTINT; int: INTEGER; longint: LONGINT; - (*int16: SYS.INT16;*) - long: BOOLEAN; - exponent: INTEGER; - mantissa: LONGREAL; - digits: ARRAY Reals.maxlongdignum OF CHAR; - neg: BOOLEAN; - ndigits: INTEGER; - decpt: INTEGER; + PROCEDURE WriteReal(format: CHAR) : BOOLEAN; + (* format either "f", "e", or "g" *) + CONST + defaultscale = 6; + VAR + index: INTEGER; + lr: LONGREAL; + r: REAL; + shortint: SHORTINT; int: INTEGER; longint: LONGINT; + (*int16: SYS.INT16;*) + long: BOOLEAN; + exponent: INTEGER; + mantissa: LONGREAL; + digits: ARRAY Reals.maxlongdignum OF CHAR; + neg: BOOLEAN; + ndigits: INTEGER; + decpt: INTEGER; - PROCEDURE Print(decpt: INTEGER; withexp: BOOLEAN; exp: INTEGER); - (* decpt: position of decimal point - = 0: just before the digits - > 0: after decpt digits - < 0: ABS(decpt) zeroes before digits needed - *) - VAR - needed: INTEGER; (* space needed *) - index: INTEGER; - count: LONGINT; + PROCEDURE Print(decpt: INTEGER; withexp: BOOLEAN; exp: INTEGER); + (* decpt: position of decimal point + = 0: just before the digits + > 0: after decpt digits + < 0: ABS(decpt) zeroes before digits needed + *) + VAR + needed: INTEGER; (* space needed *) + index: INTEGER; + count: LONGINT; - PROCEDURE WriteExp(exp: INTEGER); - CONST - base = 10; - VAR - power: INTEGER; - digit: INTEGER; - BEGIN - IF long THEN - Write("D"); - ELSE - Write("E"); - END; - IF exp < 0 THEN - Write("-"); exp := - exp; - ELSE - Write("+"); - END; - IF long THEN - power := 1000; - ELSE - power := 100; - END; - WHILE power > 0 DO - digit := (exp DIV power) MOD base; - Write(CHR(digit+ORD("0"))); - power := power DIV base; - END; - END WriteExp; + PROCEDURE WriteExp(exp: INTEGER); + CONST + base = 10; + VAR + power: INTEGER; + digit: INTEGER; + BEGIN + IF long THEN + Write("D"); + ELSE + Write("E"); + END; + IF exp < 0 THEN + Write("-"); exp := - exp; + ELSE + Write("+"); + END; + IF long THEN + power := 1000; + ELSE + power := 100; + END; + WHILE power > 0 DO + digit := (exp DIV power) MOD base; + Write(CHR(digit+ORD("0"))); + power := power DIV base; + END; + END WriteExp; - BEGIN (* Print *) - (* leading digits *) - IF decpt > 0 THEN - needed := decpt; - ELSE - needed := 1; - END; - IF neg OR sign THEN - INC(needed); - END; - IF withexp OR (scale # 0) THEN - INC(needed); (* decimal point *) - END; - IF withexp THEN - INC(needed, 2); (* E[+-] *) - IF long THEN - INC(needed, 4); - ELSE - INC(needed, 3); - END; - END; - INC(needed, SHORT(scale)); + BEGIN (* Print *) + (* leading digits *) + IF decpt > 0 THEN + needed := decpt; + ELSE + needed := 1; + END; + IF neg OR sign THEN + INC(needed); + END; + IF withexp OR (scale # 0) THEN + INC(needed); (* decimal point *) + END; + IF withexp THEN + INC(needed, 2); (* E[+-] *) + IF long THEN + INC(needed, 4); + ELSE + INC(needed, 3); + END; + END; + INC(needed, SHORT(scale)); - FillLeft(needed); - IF neg THEN - Write("-"); - ELSIF sign THEN - Write("+"); - END; - IF decpt <= 0 THEN - Write("0"); - ELSE - index := 0; - WHILE index < decpt DO - IF index < ndigits THEN - Write(digits[index]); - ELSE - Write("0"); - END; - INC(index); - END; - END; - IF withexp OR (scale > 0) THEN - Write("."); - END; - IF scale > 0 THEN - count := scale; - index := decpt; - WHILE (index < 0) & (count > 0) DO - Write("0"); INC(index); DEC(count); - END; - WHILE (index < ndigits) & (count > 0) DO - Write(digits[index]); INC(index); DEC(count); - END; - WHILE count > 0 DO - Write("0"); DEC(count); - END; - END; - IF withexp THEN - WriteExp(exp); - END; - FillRight(needed); - END Print; + FillLeft(needed); + IF neg THEN + Write("-"); + ELSIF sign THEN + Write("+"); + END; + IF decpt <= 0 THEN + Write("0"); + ELSE + index := 0; + WHILE index < decpt DO + IF index < ndigits THEN + Write(digits[index]); + ELSE + Write("0"); + END; + INC(index); + END; + END; + IF withexp OR (scale > 0) THEN + Write("."); + END; + IF scale > 0 THEN + count := scale; + index := decpt; + WHILE (index < 0) & (count > 0) DO + Write("0"); INC(index); DEC(count); + END; + WHILE (index < ndigits) & (count > 0) DO + Write(digits[index]); INC(index); DEC(count); + END; + WHILE count > 0 DO + Write("0"); DEC(count); + END; + END; + IF withexp THEN + WriteExp(exp); + END; + FillRight(needed); + END Print; - BEGIN (* WriteReal *) - IF NextArg(index) THEN - IF arglen[index] = SIZE(LONGREAL) THEN - long := TRUE; - Convert(index, lr); - ELSIF arglen[index] = SIZE(REAL) THEN - long := FALSE; - Convert(index, r); - lr := r; - ELSIF arglen[index] = SIZE(LONGINT) THEN - long := FALSE; - Convert(index, longint); - lr := longint; - ELSIF arglen[index] = SIZE(INTEGER) THEN - long := FALSE; - Convert(index, int); - lr := int; - (*ELSIF arglen[index] = SIZE(SYS.INT16) THEN - long := FALSE; - Convert(index, int16); - lr := int16;*) - ELSIF arglen[index] = SIZE(SHORTINT) THEN - long := FALSE; - Convert(index, shortint); - lr := shortint; - ELSE - Error(badArgumentSize); RETURN FALSE - END; - IF scale = -1 THEN - scale := defaultscale; - END; - (* check for NaNs and other invalid numbers *) - IF ~IEEE.Valid(lr) THEN - IF IEEE.NotANumber(lr) THEN - Write("N"); Write("a"); Write("N"); - RETURN TRUE - ELSE - IF lr < 0 THEN - Write("-"); - ELSE - Write("+"); - END; - Write("i"); Write("n"); Write("f"); - END; - RETURN TRUE - END; - (* real value in `lr' *) - Reals.ExpAndMan(lr, long, 10, exponent, mantissa); - CASE format OF - | "e": ndigits := SHORT(scale)+1; - | "f": ndigits := SHORT(scale)+exponent+1; - IF ndigits <= 0 THEN - ndigits := 1; - END; - | "g": ndigits := SHORT(scale); - END; - Reals.Digits(mantissa, 10, digits, neg, - (* force = *) format # "g", ndigits); - decpt := 1; - CASE format OF - | "e": Print(decpt, (* withexp = *) TRUE, exponent); - | "f": INC(decpt, exponent); - Print(decpt, (* withexp = *) FALSE, 0); - | "g": IF (exponent < -4) OR (exponent > scale) THEN - scale := ndigits-1; - Print(decpt, (* withexp = *) TRUE, exponent); - ELSE - INC(decpt, exponent); - scale := ndigits-1; - DEC(scale, LONG(exponent)); - IF scale < 0 THEN - scale := 0; - END; - Print(decpt, (* withexp = *) FALSE, 0); - END; - END; - RETURN TRUE - ELSE - RETURN FALSE - END; - END WriteReal; + BEGIN (* WriteReal *) + IF NextArg(index) THEN + IF arglen[index] = SIZE(LONGREAL) THEN + long := TRUE; + Convert(index, lr); + ELSIF arglen[index] = SIZE(REAL) THEN + long := FALSE; + Convert(index, r); + lr := r; + ELSIF arglen[index] = SIZE(LONGINT) THEN + long := FALSE; + Convert(index, longint); + lr := longint; + ELSIF arglen[index] = SIZE(INTEGER) THEN + long := FALSE; + Convert(index, int); + lr := int; + (*ELSIF arglen[index] = SIZE(SYS.INT16) THEN + long := FALSE; + Convert(index, int16); + lr := int16;*) + ELSIF arglen[index] = SIZE(SHORTINT) THEN + long := FALSE; + Convert(index, shortint); + lr := shortint; + ELSE + Error(badArgumentSize); RETURN FALSE + END; + IF scale = -1 THEN + scale := defaultscale; + END; + (* check for NaNs and other invalid numbers *) + IF ~IEEE.Valid(lr) THEN + IF IEEE.NotANumber(lr) THEN + Write("N"); Write("a"); Write("N"); + RETURN TRUE + ELSE + IF lr < 0 THEN + Write("-"); + ELSE + Write("+"); + END; + Write("i"); Write("n"); Write("f"); + END; + RETURN TRUE + END; + (* real value in `lr' *) + Reals.ExpAndMan(lr, long, 10, exponent, mantissa); + CASE format OF + | "e": ndigits := SHORT(scale)+1; + | "f": ndigits := SHORT(scale)+exponent+1; + IF ndigits <= 0 THEN + ndigits := 1; + END; + | "g": ndigits := SHORT(scale); + ELSE + END; + Reals.Digits(mantissa, 10, digits, neg, + (* force = *) format # "g", ndigits); + decpt := 1; + CASE format OF + | "e": Print(decpt, (* withexp = *) TRUE, exponent); + | "f": INC(decpt, exponent); + Print(decpt, (* withexp = *) FALSE, 0); + | "g": IF (exponent < -4) OR (exponent > scale) THEN + scale := ndigits-1; + Print(decpt, (* withexp = *) TRUE, exponent); + ELSE + INC(decpt, exponent); + scale := ndigits-1; + DEC(scale, LONG(exponent)); + IF scale < 0 THEN + scale := 0; + END; + Print(decpt, (* withexp = *) FALSE, 0); + END; + ELSE + END; + RETURN TRUE + ELSE + RETURN FALSE + END; + END WriteReal; - PROCEDURE WriteString() : BOOLEAN; - VAR - index: INTEGER; - i: LONGINT; - byte: SYS.BYTE; - len: LONGINT; - BEGIN - IF NextArg(index) THEN - len := 0; - WHILE (len < arglen[index]) & - ((scale = -1) OR (len < scale)) & - ((*CHR*)SYS.VAL(CHAR, (Access(index, len))) # 0X) DO - INC(len); - END; - FillLeft(len); - i := 0; - WHILE i < len DO - byte := Access(index, i); - Write(byte); - INC(i); - END; - FillRight(len); - RETURN TRUE - END; - RETURN FALSE - END WriteString; + PROCEDURE WriteString() : BOOLEAN; + VAR + index: INTEGER; + i: LONGINT; + byte: SYS.BYTE; + len: LONGINT; + BEGIN + IF NextArg(index) THEN + len := 0; + WHILE (len < arglen[index]) & + ((scale = -1) OR (len < scale)) & + ((*CHR*)SYS.VAL(CHAR, (Access(index, len))) # 0X) DO + INC(len); + END; + FillLeft(len); + i := 0; + WHILE i < len DO + byte := Access(index, i); + Write(byte); + INC(i); + END; + FillRight(len); + RETURN TRUE + END; + RETURN FALSE + END WriteString; - BEGIN (* Conversion *) - CASE fmtchar OF - | "b": RETURN WriteBool("TRUE", "FALSE") - | "c": RETURN WriteChar() - | "d": RETURN WriteInt(10) - | "e", - "f", - "g": RETURN WriteReal(fmtchar) - | "j": RETURN WriteBool("ja", "nein") - | "o": RETURN WriteInt(8) - | "s": RETURN WriteString() - | "x": RETURN WriteInt(16) - | "y": RETURN WriteBool("yes", "no") - ELSE - Error(badFormat); RETURN FALSE - END; - END Conversion; + BEGIN (* Conversion *) + CASE fmtchar OF + | "b": RETURN WriteBool("TRUE", "FALSE") + | "c": RETURN WriteChar() + | "d": RETURN WriteInt(10) + | "e", + "f", + "g": RETURN WriteReal(fmtchar) + | "j": RETURN WriteBool("ja", "nein") + | "o": RETURN WriteInt(8) + | "s": RETURN WriteString() + | "x": RETURN WriteInt(16) + | "y": RETURN WriteBool("yes", "no") + ELSE + Error(badFormat); RETURN FALSE + END; + END Conversion; BEGIN - IF ~Next() THEN RETURN FALSE END; - IF fmtchar = fmtcmd THEN Write(fmtcmd); RETURN TRUE END; - RETURN Flags() & Width() & Scale() & Conversion() + IF ~Next() THEN RETURN FALSE END; + IF fmtchar = fmtcmd THEN Write(fmtcmd); RETURN TRUE END; + RETURN Flags() & Width() & Scale() & Conversion() END Format; - + BEGIN out.count := 0; out.error := FALSE; SetSize; nextarg := 0; fmtindex := 0; WHILE Next() DO - IF fmtchar = fmtcmd THEN - IF ~Format() THEN - RETURN - END; - ELSIF (fmtchar = "\") & Next() THEN - CASE fmtchar OF - | "0".."9", "A".."F": - IF ~Int(hexcharval, 16) THEN - (* Error(s, BadFormat); *) RETURN - END; - Unget; - Write(CHR(hexcharval)); - | "b": Write(08X); (* back space *) - | "e": Write(1BX); (* escape *) - | "f": Write(0CX); (* form feed *) - | "n": WriteLn; - | "q": Write("'"); - | "Q": Write(22X); (* double quote: " *) - | "r": Write(0DX); (* carriage return *) - | "t": Write(09X); (* horizontal tab *) - | "&": Write(07X); (* bell *) - ELSE - Write(fmtchar); - END; - ELSE - Write(fmtchar); - END; + IF fmtchar = fmtcmd THEN + IF ~Format() THEN + RETURN + END; + ELSIF (fmtchar = "\") & Next() THEN + CASE fmtchar OF + | "0".."9", "A".."F": + IF ~Int(hexcharval, 16) THEN + (* Error(s, BadFormat); *) RETURN + END; + Unget; + Write(CHR(hexcharval)); + | "b": Write(08X); (* back space *) + | "e": Write(1BX); (* escape *) + | "f": Write(0CX); (* form feed *) + | "n": WriteLn; + | "q": Write("'"); + | "Q": Write(22X); (* double quote: " *) + | "r": Write(0DX); (* carriage return *) + | "t": Write(09X); (* horizontal tab *) + | "&": Write(07X); (* bell *) + ELSE + Write(fmtchar); + END; + ELSE + Write(fmtchar); + END; END; IF nextarg < nargs THEN - Error(tooManyArgs); + Error(tooManyArgs); ELSIF nextarg > nargs THEN - Error(tooFewArgs); + Error(tooFewArgs); END; END Out; @@ -804,14 +808,14 @@ MODULE ulmPrint; END F7; PROCEDURE F8*(fmt: ARRAY OF CHAR; - p1, p2, p3, p4, p5, p6, p7, p8: ARRAY OF SYS.BYTE); + p1, p2, p3, p4, p5, p6, p7, p8: ARRAY OF SYS.BYTE); VAR x: INTEGER; BEGIN Out(Streams.stdout, fmt, 8, p1,p2,p3,p4,p5,p6,p7,p8, x, NIL); END F8; PROCEDURE F9*(fmt: ARRAY OF CHAR; - p1, p2, p3, p4, p5, p6, p7, p8, p9: ARRAY OF SYS.BYTE); + p1, p2, p3, p4, p5, p6, p7, p8, p9: ARRAY OF SYS.BYTE); BEGIN Out(Streams.stdout, fmt, 9, p1,p2,p3,p4,p5,p6,p7,p8,p9, NIL); END F9; @@ -842,49 +846,49 @@ MODULE ulmPrint; END S3; PROCEDURE S4*(out: Streams.Stream; fmt: ARRAY OF CHAR; - p1, p2, p3, p4: ARRAY OF SYS.BYTE); + p1, p2, p3, p4: ARRAY OF SYS.BYTE); VAR x: INTEGER; BEGIN Out(out, fmt, 4, p1,p2,p3,p4, x,x,x,x,x, NIL); END S4; PROCEDURE S5*(out: Streams.Stream; fmt: ARRAY OF CHAR; - p1, p2, p3, p4, p5: ARRAY OF SYS.BYTE); + p1, p2, p3, p4, p5: ARRAY OF SYS.BYTE); VAR x: INTEGER; BEGIN Out(out, fmt, 5, p1,p2,p3,p4,p5, x,x,x,x, NIL); END S5; PROCEDURE S6*(out: Streams.Stream; fmt: ARRAY OF CHAR; - p1, p2, p3, p4, p5, p6: ARRAY OF SYS.BYTE); + p1, p2, p3, p4, p5, p6: ARRAY OF SYS.BYTE); VAR x: INTEGER; BEGIN Out(out, fmt, 6, p1,p2,p3,p4,p5,p6, x,x,x, NIL); END S6; PROCEDURE S7*(out: Streams.Stream; fmt: ARRAY OF CHAR; - p1, p2, p3, p4, p5, p6, p7: ARRAY OF SYS.BYTE); + p1, p2, p3, p4, p5, p6, p7: ARRAY OF SYS.BYTE); VAR x: INTEGER; BEGIN Out(out, fmt, 7, p1,p2,p3,p4,p5,p6,p7, x,x, NIL); END S7; PROCEDURE S8*(out: Streams.Stream; fmt: ARRAY OF CHAR; - p1, p2, p3, p4, p5, p6, p7, p8: ARRAY OF SYS.BYTE); + p1, p2, p3, p4, p5, p6, p7, p8: ARRAY OF SYS.BYTE); VAR x: INTEGER; BEGIN Out(out, fmt, 8, p1,p2,p3,p4,p5,p6,p7,p8, x, NIL); END S8; PROCEDURE S9*(out: Streams.Stream; fmt: ARRAY OF CHAR; - p1, p2, p3, p4, p5, p6, p7, p8, p9: ARRAY OF SYS.BYTE); + p1, p2, p3, p4, p5, p6, p7, p8, p9: ARRAY OF SYS.BYTE); BEGIN Out(out, fmt, 9, p1,p2,p3,p4,p5,p6,p7,p8,p9, NIL); END S9; PROCEDURE SE*(out: Streams.Stream; fmt: ARRAY OF CHAR; - errors: RelatedEvents.Object); + errors: RelatedEvents.Object); VAR x: INTEGER; BEGIN Out(out, fmt, 0, x,x,x,x,x,x,x,x,x, NIL); @@ -905,7 +909,7 @@ MODULE ulmPrint; END SE2; PROCEDURE SE3*(out: Streams.Stream; fmt: ARRAY OF CHAR; - p1, p2, p3: ARRAY OF SYS.BYTE; + p1, p2, p3: ARRAY OF SYS.BYTE; errors: RelatedEvents.Object); VAR x: INTEGER; BEGIN @@ -913,7 +917,7 @@ MODULE ulmPrint; END SE3; PROCEDURE SE4*(out: Streams.Stream; fmt: ARRAY OF CHAR; - p1, p2, p3, p4: ARRAY OF SYS.BYTE; + p1, p2, p3, p4: ARRAY OF SYS.BYTE; errors: RelatedEvents.Object); VAR x: INTEGER; BEGIN @@ -921,7 +925,7 @@ MODULE ulmPrint; END SE4; PROCEDURE SE5*(out: Streams.Stream; fmt: ARRAY OF CHAR; - p1, p2, p3, p4, p5: ARRAY OF SYS.BYTE; + p1, p2, p3, p4, p5: ARRAY OF SYS.BYTE; errors: RelatedEvents.Object); VAR x: INTEGER; BEGIN @@ -929,7 +933,7 @@ MODULE ulmPrint; END SE5; PROCEDURE SE6*(out: Streams.Stream; fmt: ARRAY OF CHAR; - p1, p2, p3, p4, p5, p6: ARRAY OF SYS.BYTE; + p1, p2, p3, p4, p5, p6: ARRAY OF SYS.BYTE; errors: RelatedEvents.Object); VAR x: INTEGER; BEGIN @@ -937,7 +941,7 @@ MODULE ulmPrint; END SE6; PROCEDURE SE7*(out: Streams.Stream; fmt: ARRAY OF CHAR; - p1, p2, p3, p4, p5, p6, p7: ARRAY OF SYS.BYTE; + p1, p2, p3, p4, p5, p6, p7: ARRAY OF SYS.BYTE; errors: RelatedEvents.Object); VAR x: INTEGER; BEGIN @@ -945,7 +949,7 @@ MODULE ulmPrint; END SE7; PROCEDURE SE8*(out: Streams.Stream; fmt: ARRAY OF CHAR; - p1, p2, p3, p4, p5, p6, p7, p8: ARRAY OF SYS.BYTE; + p1, p2, p3, p4, p5, p6, p7, p8: ARRAY OF SYS.BYTE; errors: RelatedEvents.Object); VAR x: INTEGER; BEGIN @@ -953,7 +957,7 @@ MODULE ulmPrint; END SE8; PROCEDURE SE9*(out: Streams.Stream; fmt: ARRAY OF CHAR; - p1, p2, p3, p4, p5, p6, p7, p8, p9: ARRAY OF SYS.BYTE; + p1, p2, p3, p4, p5, p6, p7, p8, p9: ARRAY OF SYS.BYTE; errors: RelatedEvents.Object); BEGIN Out(out, fmt, 9, p1,p2,p3,p4,p5,p6,p7,p8,p9, errors); diff --git a/src/library/ulm/ulmResources.Mod b/src/library/ulm/ulmResources.Mod index 08b9ae20..9ff929bd 100644 --- a/src/library/ulm/ulmResources.Mod +++ b/src/library/ulm/ulmResources.Mod @@ -64,43 +64,43 @@ MODULE ulmResources; TYPE StateChange* = SHORTINT; (* terminated..communicationResumed *) State = SHORTINT; (* alive, unreferenced, or alive *) - (* whether objects are stopped or not is maintained separately *) + (* whether objects are stopped or not is maintained separately *) Event* = POINTER TO EventRec; (* notification of state changes *) EventRec* = - RECORD - (Events.EventRec) - change*: StateChange; (* new state *) - resource*: Resource; - END; + RECORD + (Events.EventRec) + change*: StateChange; (* new state *) + resource*: Resource; + END; TYPE Key* = POINTER TO KeyRec; KeyRec* = - RECORD - (Objects.ObjectRec) - valid: BOOLEAN; - resource: Resource; - END; + RECORD + (Objects.ObjectRec) + valid: BOOLEAN; + resource: Resource; + END; TYPE List = POINTER TO ListRec; ListRec = - RECORD - resource: Resource; - next: List; - END; + RECORD + resource: Resource; + next: List; + END; Discipline = POINTER TO DisciplineRec; DisciplineRec = - RECORD - (Disciplines.DisciplineRec) - state: State; (* alive, unreferenced, or terminated *) - stopped: BOOLEAN; (* may be TRUE, if alive or unreferenced *) - refcnt: LONGINT; (* # of Attach - # of Detach *) - eventType: Events.EventType; (* may be NIL *) - dependants: List; (* list of resources which depends on us *) - dependsOn: Resource; (* we depend on this resource *) - key: Key; (* attach key for dependsOn *) - END; + RECORD + (Disciplines.DisciplineRec) + state: State; (* alive, unreferenced, or terminated *) + stopped: BOOLEAN; (* may be TRUE, if alive or unreferenced *) + refcnt: LONGINT; (* # of Attach - # of Detach *) + eventType: Events.EventType; (* may be NIL *) + dependants: List; (* list of resources which depends on us *) + dependsOn: Resource; (* we depend on this resource *) + key: Key; (* attach key for dependsOn *) + END; VAR discID: Disciplines.Identifier; @@ -120,27 +120,27 @@ MODULE ulmResources; noch *) IF ~Disciplines.Seek(resource, discID, SYSTEM.VAL(Disciplines.Discipline, disc)) THEN (* noch *) - NEW(disc); disc.id := discID; - disc.state := alive; disc.refcnt := 0; - disc.eventType := NIL; - disc.dependants := NIL; disc.dependsOn := NIL; - Disciplines.Add(resource, disc); + NEW(disc); disc.id := discID; + disc.state := alive; disc.refcnt := 0; + disc.eventType := NIL; + disc.dependants := NIL; disc.dependsOn := NIL; + Disciplines.Add(resource, disc); END; END GetDisc; PROCEDURE GenEvent(resource: Resource; change: StateChange); VAR - disc: Discipline; - event: Event; + disc: Discipline; + event: Event; BEGIN GetDisc(resource, disc); IF disc.eventType # NIL THEN - NEW(event); - event.type := disc.eventType; - event.message := "Resources: state change notification"; - event.change := change; - event.resource := resource; - Events.Raise(event); + NEW(event); + event.type := disc.eventType; + event.message := "Resources: state change notification"; + event.change := change; + event.resource := resource; + Events.Raise(event); END; END GenEvent; @@ -149,24 +149,24 @@ MODULE ulmResources; PROCEDURE Unlink(dependant, resource: Resource); (* undo DependsOn operation *) VAR - dependantDisc, resourceDisc: Discipline; - prev, member: List; + dependantDisc, resourceDisc: Discipline; + prev, member: List; BEGIN GetDisc(resource, resourceDisc); IF resourceDisc.state = terminated THEN - (* no necessity for clean up *) - RETURN + (* no necessity for clean up *) + RETURN END; GetDisc(dependant, dependantDisc); prev := NIL; member := resourceDisc.dependants; WHILE member.resource # dependant DO - prev := member; member := member.next; + prev := member; member := member.next; END; IF prev = NIL THEN - resourceDisc.dependants := member.next; + resourceDisc.dependants := member.next; ELSE - prev.next := member.next; + prev.next := member.next; END; (* Detach reference from dependant to resource *) @@ -176,28 +176,29 @@ MODULE ulmResources; PROCEDURE InternalNotify(resource: Resource; change: StateChange); VAR - disc: Discipline; - event: Event; - dependant: List; + disc: Discipline; + event: Event; + dependant: List; BEGIN GetDisc(resource, disc); CASE change OF | communicationResumed: disc.stopped := FALSE; | communicationStopped: disc.stopped := TRUE; | terminated: disc.stopped := FALSE; disc.state := terminated; + ELSE (* Explicitly ignore unhandled values of change *) END; GenEvent(resource, change); (* notify all dependants *) dependant := disc.dependants; WHILE dependant # NIL DO - InternalNotify(dependant.resource, change); - dependant := dependant.next; + InternalNotify(dependant.resource, change); + dependant := dependant.next; END; (* remove dependency relation in case of termination, if present *) IF (change = terminated) & (disc.dependsOn # NIL) THEN - Unlink(resource, disc.dependsOn); + Unlink(resource, disc.dependsOn); END; END InternalNotify; @@ -205,16 +206,16 @@ MODULE ulmResources; PROCEDURE TakeInterest*(resource: Resource; VAR eventType: Events.EventType); (* return resource specific event type for state notifications; - eventType is guaranteed to be # NIL even if - the given resource is already terminated + eventType is guaranteed to be # NIL even if + the given resource is already terminated *) VAR - disc: Discipline; + disc: Discipline; BEGIN GetDisc(resource, disc); IF disc.eventType = NIL THEN - Events.Define(disc.eventType); - Events.Ignore(disc.eventType); + Events.Define(disc.eventType); + Events.Ignore(disc.eventType); END; eventType := disc.eventType; END TakeInterest; @@ -222,93 +223,93 @@ MODULE ulmResources; PROCEDURE Attach*(resource: Resource; VAR key: Key); (* mark the resource as being used until Detach gets called *) VAR - disc: Discipline; + disc: Discipline; BEGIN GetDisc(resource, disc); IF disc.state IN {terminated, unreferenced} THEN - key := NIL; + key := NIL; ELSE - INC(disc.refcnt); NEW(key); key.valid := TRUE; - key.resource := resource; + INC(disc.refcnt); NEW(key); key.valid := TRUE; + key.resource := resource; END; END Attach; PROCEDURE Detach*(resource: Resource; key: Key); (* mark the resource as unused; the returned key of Attach must - be given -- this allows to check for proper balances - of Attach/Detach calls; - the last Detach operation causes a state change to unreferenced + be given -- this allows to check for proper balances + of Attach/Detach calls; + the last Detach operation causes a state change to unreferenced *) VAR - disc: Discipline; + disc: Discipline; BEGIN IF (key # NIL) & key.valid & (key.resource = resource) THEN - GetDisc(resource, disc); - IF disc.state # terminated THEN - key.valid := FALSE; DEC(disc.refcnt); - IF disc.refcnt = 0 THEN - GenEvent(resource, unreferenced); - disc.state := unreferenced; - IF disc.dependsOn # NIL THEN - Unlink(resource, disc.dependsOn); - END; - END; - END; + GetDisc(resource, disc); + IF disc.state # terminated THEN + key.valid := FALSE; DEC(disc.refcnt); + IF disc.refcnt = 0 THEN + GenEvent(resource, unreferenced); + disc.state := unreferenced; + IF disc.dependsOn # NIL THEN + Unlink(resource, disc.dependsOn); + END; + END; + END; END; END Detach; PROCEDURE Notify*(resource: Resource; change: StateChange); (* notify all interested parties about the new state; - only valid state changes are accepted: - - Notify doesn't accept any changes after termination - - unreferenced is generated conditionally by Detach only - - communicationResumed is valid after communicationStopped only - valid notifications are propagated to all dependants (see below); + only valid state changes are accepted: + - Notify doesn't accept any changes after termination + - unreferenced is generated conditionally by Detach only + - communicationResumed is valid after communicationStopped only + valid notifications are propagated to all dependants (see below); *) VAR - disc: Discipline; - event: Event; - dependant: List; + disc: Discipline; + event: Event; + dependant: List; BEGIN IF change # unreferenced THEN - GetDisc(resource, disc); - IF (disc.state # terminated) & (disc.state # change) & - ((change # communicationResumed) OR disc.stopped) THEN - InternalNotify(resource, change); - END; + GetDisc(resource, disc); + IF (disc.state # terminated) & (disc.state # change) & + ((change # communicationResumed) OR disc.stopped) THEN + InternalNotify(resource, change); + END; END; END Notify; PROCEDURE DependsOn*(dependant, resource: Resource); (* states that `dependant' depends entirely on `resource' -- - this is usually the case if operations on `dependant' - are delegated to `resource'; - only one call of DependsOn may be given per `dependant' while - several DependsOn for one resource are valid; - DependsOn calls implicitly Attach for resource and - detaches if the dependant becomes unreferenced; - all other state changes propagate from `resource' to - `dependant' + this is usually the case if operations on `dependant' + are delegated to `resource'; + only one call of DependsOn may be given per `dependant' while + several DependsOn for one resource are valid; + DependsOn calls implicitly Attach for resource and + detaches if the dependant becomes unreferenced; + all other state changes propagate from `resource' to + `dependant' *) VAR - dependantDisc, resourceDisc: Discipline; - member: List; + dependantDisc, resourceDisc: Discipline; + member: List; BEGIN GetDisc(resource, resourceDisc); IF resourceDisc.state <= unreferenced THEN - (* do not create a relationship to dead or unreferenced objects - but propagate a termination immediately to dependant - *) - IF resourceDisc.state = terminated THEN - Notify(dependant, resourceDisc.state); - END; - RETURN + (* do not create a relationship to dead or unreferenced objects + but propagate a termination immediately to dependant + *) + IF resourceDisc.state = terminated THEN + Notify(dependant, resourceDisc.state); + END; + RETURN END; GetDisc(dependant, dependantDisc); IF dependantDisc.dependsOn # NIL THEN - (* don't accept changes *) - RETURN + (* don't accept changes *) + RETURN END; dependantDisc.dependsOn := resource; @@ -320,10 +321,10 @@ MODULE ulmResources; PROCEDURE Alive*(resource: Resource) : BOOLEAN; (* returns TRUE if the resource is not yet terminated - and ready for communication (i.e. not communicationStopped) + and ready for communication (i.e. not communicationStopped) *) VAR - disc: Discipline; + disc: Discipline; BEGIN GetDisc(resource, disc); RETURN ~disc.stopped & (disc.state IN {alive, unreferenced}) @@ -331,10 +332,10 @@ MODULE ulmResources; PROCEDURE Stopped*(resource: Resource) : BOOLEAN; (* returns TRUE if the object is currently not responsive - and not yet terminated + and not yet terminated *) VAR - disc: Discipline; + disc: Discipline; BEGIN GetDisc(resource, disc); RETURN disc.stopped @@ -343,7 +344,7 @@ MODULE ulmResources; PROCEDURE Terminated*(resource: Resource) : BOOLEAN; (* returns TRUE if the resource is terminated *) VAR - disc: Discipline; + disc: Discipline; BEGIN GetDisc(resource, disc); RETURN disc.state = terminated diff --git a/src/library/ulm/ulmSYSTEM.Mod b/src/library/ulm/ulmSYSTEM.Mod index fa6c66a6..838548f0 100644 --- a/src/library/ulm/ulmSYSTEM.Mod +++ b/src/library/ulm/ulmSYSTEM.Mod @@ -1,9 +1,9 @@ MODULE ulmSYSTEM; -IMPORT SYSTEM, Unix, Sys := ulmSys; +IMPORT SYSTEM, Platform, Sys := ulmSys; TYPE pchar = POINTER TO ARRAY 1 OF CHAR; pstring = POINTER TO ARRAY 1024 OF CHAR; - pstatus = POINTER TO Unix.Status; + (* pstatus = POINTER TO Platform.Status; *) TYPE bytearray* = ARRAY SIZE(LONGINT) OF SYSTEM.BYTE; (* need this because voc does not convert implicitly LONGINT to ARRAY OF BYTE; -- noch *) pbytearray* = POINTER TO bytearray; @@ -52,16 +52,16 @@ TYPE pchar = POINTER TO ARRAY 1 OF CHAR; PROCEDURE UNIXCALL*(syscall: LONGINT; VAR d0, d1: LONGINT; (* in ulm version both LONGINT and INTEGER are 4 byte size *) arg1, arg2, arg3: LONGINT) : BOOLEAN; VAR - n : LONGINT; - ch : CHAR; - pch : pchar; - pstr : pstring; - pst : pstatus; + n: LONGINT; + ch: CHAR; + pch: pchar; + pstr: pstring; + h: Platform.FileHandle; + (* pst : pstatus; *) BEGIN IF syscall = Sys.read THEN - d0 := Unix.Read(SHORT(arg1), arg2, arg3); - IF d0 >= 0 THEN RETURN TRUE ELSE RETURN FALSE END + RETURN Platform.Read(arg1, arg2, arg3, n) = 0; (*NEW(pch); pch := SYSTEM.VAL(pchar, arg2); ch := pch^[0]; @@ -75,44 +75,48 @@ TYPE pchar = POINTER TO ARRAY 1 OF CHAR; END; *) ELSIF syscall = Sys.write THEN - d0 := Unix.Write(SHORT(arg1), arg2, arg3); - IF d0 >= 0 THEN RETURN TRUE ELSE RETURN FALSE END + RETURN Platform.Write(arg1, arg2, arg3) = 0; (*NEW(pch); pch := SYSTEM.VAL(pchar, arg2); n := Write(SYSTEM.VAL(LONGINT, pch), 1); IF n # 1 THEN RETURN FALSE ELSE RETURN TRUE END *) ELSIF syscall = Sys.open THEN - pstr := SYSTEM.VAL(pstring, arg1); - d0 := Unix.Open(pstr^, SHORT(arg3), arg2); - IF d0 >= 0 THEN RETURN TRUE ELSE RETURN FALSE END + pstr := SYSTEM.VAL(pstring, arg1); + IF SYSTEM.VAL(SET, arg3) * {0,1} # {} THEN + RETURN Platform.OldRW(pstr^, d0) = 0 + ELSE + RETURN Platform.OldRO(pstr^, d0) = 0 + END ELSIF syscall = Sys.close THEN - d0 := Unix.Close(SHORT(arg1)); - IF d0 = 0 THEN RETURN TRUE ELSE RETURN FALSE END + RETURN Platform.Close(arg1) = 0 ELSIF syscall = Sys.lseek THEN - d0 := Unix.Lseek(SHORT(arg1), arg2, SHORT(arg3)); - IF d0 >= 0 THEN RETURN TRUE ELSE RETURN FALSE END + RETURN Platform.Seek(arg1, arg2, SYSTEM.VAL(INTEGER, arg3)) = 0 + (* ELSIF syscall = Sys.ioctl THEN - d0 := Unix.Ioctl(SHORT(arg1), SHORT(arg2), arg3); + d0 := Platform.Ioctl(arg1, arg2, arg3); RETURN d0 >= 0; ELSIF syscall = Sys.fcntl THEN - d0 := Unix.Fcntl (SHORT(arg1), SHORT(arg2), arg3); + d0 := Platform.Fcntl (arg1, arg2, arg3); RETURN d0 >= 0; ELSIF syscall = Sys.dup THEN - d0 := Unix.Dup(SHORT(arg1)); + d0 := Platform.Dup(arg1); RETURN d0 > 0; ELSIF syscall = Sys.pipe THEN - d0 := Unix.Pipe(arg1); + d0 := Platform.Pipe(arg1); RETURN d0 >= 0; ELSIF syscall = Sys.newstat THEN pst := SYSTEM.VAL(pstatus, arg2); pstr := SYSTEM.VAL(pstring, arg1); - d0 := Unix.Stat(pstr^, pst^); + d0 := Platform.Stat(pstr^, pst^); RETURN d0 >= 0 ELSIF syscall = Sys.newfstat THEN pst := SYSTEM.VAL(pstatus, arg2); - d0 := Unix.Fstat(SHORT(arg1), pst^); + d0 := Platform.Fstat(arg1, pst^); RETURN d0 >= 0; + *) + ELSE + HALT(99); END END UNIXCALL; diff --git a/src/library/ulm/ulmScales.Mod b/src/library/ulm/ulmScales.Mod index 8b60d48a..5de1188b 100644 --- a/src/library/ulm/ulmScales.Mod +++ b/src/library/ulm/ulmScales.Mod @@ -403,6 +403,7 @@ MODULE ulmScales; (* abs - abs or rel - rel *) restype := relative; END; + ELSE END; ASSERT(ok); (* invalid operation *) END; END; diff --git a/src/library/ulm/ulmStreamConditions.Mod b/src/library/ulm/ulmStreamConditions.Mod index 794b3cb1..9e7f5712 100644 --- a/src/library/ulm/ulmStreamConditions.Mod +++ b/src/library/ulm/ulmStreamConditions.Mod @@ -115,6 +115,7 @@ MODULE ulmStreamConditions; | write: IF Streams.OutputWillBeBuffered(condition.stream) THEN RETURN TRUE END; + ELSE END; msg.operation := condition.operation; msg.errors := errors; diff --git a/src/library/ulm/ulmStreams.Mod b/src/library/ulm/ulmStreams.Mod index 8e54ed95..149b1220 100644 --- a/src/library/ulm/ulmStreams.Mod +++ b/src/library/ulm/ulmStreams.Mod @@ -632,6 +632,7 @@ MODULE ulmStreams; | linebuf: nbuf := 1; | onebuf: nbuf := 1; | bufpool: nbuf := s.bufpool.maxbuf; + ELSE (* Explicitly ignore unhandled values of s.bufmode *) END; END GetBufferPoolSize; diff --git a/src/library/ulm/ulmSysConversions.Mod b/src/library/ulm/ulmSysConversions.Mod index e1047a58..4da16095 100644 --- a/src/library/ulm/ulmSysConversions.Mod +++ b/src/library/ulm/ulmSysConversions.Mod @@ -336,17 +336,17 @@ MODULE ulmSysConversions; (* C type *) CASE type2 OF - | "a": size2 := 8; INCL(flags, unsigned); (* char* *) - | "c": size2 := 1; (* /* signed */ char *) - | "C": size2 := 1; INCL(flags, unsigned); (* unsigned char *) - | "s": size2 := 2; (* short int *) - | "S": size2 := 2; INCL(flags, unsigned); (* unsigned short int *) - | "i": size2 := 4; (* int *) - | "I": size2 := 4; INCL(flags, unsigned); (* unsigned int *) - | "u": size2 := 4; INCL(flags, unsigned); (* unsigned int *) - | "l": size2 := 8; (* long int *) - | "L": size2 := 8; INCL(flags, unsigned); (* long int *) - | "-": size2 := 0; + | "a": size2 := SIZE(Address); INCL(flags, unsigned); (* char* *) + | "c": size2 := 1; (* /* signed */ char *) + | "C": size2 := 1; INCL(flags, unsigned); (* unsigned char *) + | "s": size2 := 2; (* short int *) + | "S": size2 := 2; INCL(flags, unsigned); (* unsigned short int *) + | "i": size2 := 4; (* int *) + | "I": size2 := 4; INCL(flags, unsigned); (* unsigned int *) + | "u": size2 := 4; INCL(flags, unsigned); (* unsigned int *) + | "l": size2 := 8; (* long int *) + | "L": size2 := 8; INCL(flags, unsigned); (* long int *) + | "-": size2 := 0; ELSE Error(cv, "bad C type specifier"); RETURN FALSE END; IF size2 > 1 THEN diff --git a/src/library/ulm/ulmSysIO.Mod b/src/library/ulm/ulmSysIO.Mod index 33959006..a961f64d 100644 --- a/src/library/ulm/ulmSysIO.Mod +++ b/src/library/ulm/ulmSysIO.Mod @@ -59,14 +59,14 @@ MODULE ulmSysIO; closeonexec* = { 0 }; (* Fcntl requests *) - dupfd* = 0; (* duplicate file descriptor *) - getfd* = 1; (* get file desc flags (close-on-exec) *) - setfd* = 2; (* set file desc flags (close-on-exec) *) - getfl* = 3; (* get file flags *) - setfl* = 4; (* set file flags (ndelay, append) *) - getlk* = 5; (* get file lock *) - setlk* = 6; (* set file lock *) - setlkw* = 7; (* set file lock and wait *) + dupfd* = 0; (* duplicate file descriptor *) + getfd* = 1; (* get file desc flags (close-on-exec) *) + setfd* = 2; (* set file desc flags (close-on-exec) *) + getfl* = 3; (* get file flags *) + setfl* = 4; (* set file flags (ndelay, append) *) + getlk* = 5; (* get file lock *) + setlk* = 6; (* set file lock *) + setlkw* = 7; (* set file lock and wait *) setown* = 8; (* set owner (async IO) *) getown* = 9; (* get owner (async IO) *) setsig* = 10; (* set SIGIO replacement *) @@ -80,263 +80,267 @@ MODULE ulmSysIO; Whence* = LONGINT; PROCEDURE OpenCreat*(VAR fd: File; - filename: ARRAY OF CHAR; options: SET; - protection: Protection; - errors: RelatedEvents.Object; - retry: BOOLEAN; VAR interrupted: BOOLEAN) : BOOLEAN; + filename: ARRAY OF CHAR; options: SET; + protection: Protection; + errors: RelatedEvents.Object; + retry: BOOLEAN; VAR interrupted: BOOLEAN) : BOOLEAN; (* the filename must be 0X-terminated *) VAR - d0, d1: (*INTEGER*)LONGINT; + d0, d1: (*INTEGER*)LONGINT; BEGIN interrupted := FALSE; LOOP - IF ulmSYSTEM.UNIXCALL(Sys.open, d0, d1, - SYS.ADR(filename), SYS.VAL(LONGINT, options), protection) THEN - fd := d0; - RETURN TRUE - ELSE - IF d0 = SysErrors.intr THEN - interrupted := TRUE; - END; - IF (d0 # SysErrors.intr) OR ~retry THEN - SysErrors.Raise(errors, d0, Sys.open, filename); - RETURN FALSE - END; - END; + IF ulmSYSTEM.UNIXCALL(Sys.open, d0, d1, + SYS.ADR(filename), SYS.VAL(LONGINT, options), protection) THEN + fd := d0; + RETURN TRUE + ELSE + IF d0 = SysErrors.intr THEN + interrupted := TRUE; + END; + IF (d0 # SysErrors.intr) OR ~retry THEN + SysErrors.Raise(errors, d0, Sys.open, filename); + RETURN FALSE + END; + END; END; END OpenCreat; PROCEDURE Open*(VAR fd: File; - filename: ARRAY OF CHAR; options: SET; - errors: RelatedEvents.Object; - retry: BOOLEAN; VAR interrupted: BOOLEAN) : BOOLEAN; + filename: ARRAY OF CHAR; options: SET; + errors: RelatedEvents.Object; + retry: BOOLEAN; VAR interrupted: BOOLEAN) : BOOLEAN; (* the filename must be 0X-terminated *) BEGIN RETURN OpenCreat(fd, filename, options, 0, errors, retry, interrupted) END Open; PROCEDURE Close*(fd: File; - errors: RelatedEvents.Object; - retry: BOOLEAN; VAR interrupted: BOOLEAN) : BOOLEAN; + errors: RelatedEvents.Object; + retry: BOOLEAN; VAR interrupted: BOOLEAN) : BOOLEAN; VAR - d0, d1: LONGINT; - a0, a1 : LONGINT; (* just to match UNIXCALL interface *) + d0, d1: LONGINT; + a0, a1 : LONGINT; (* just to match UNIXCALL interface *) BEGIN interrupted := FALSE; + a0 := 0; a1 := 0; (* Initialised to disable compiler warning. *) LOOP - IF ulmSYSTEM.UNIXCALL(Sys.close, d0, d1, fd, a0, a1) THEN - (*IF ulmSYSTEM.UNIXCALL(Sys.close, d0, d1, fd) THEN*) - RETURN TRUE - ELSE - IF d0 = SysErrors.intr THEN - interrupted := TRUE; - END; - IF (d0 # SysErrors.intr) OR ~retry THEN - SysErrors.Raise(errors, d0, Sys.close, ""); - RETURN FALSE - END; - END; + IF ulmSYSTEM.UNIXCALL(Sys.close, d0, d1, fd, a0, a1) THEN + (*IF ulmSYSTEM.UNIXCALL(Sys.close, d0, d1, fd) THEN*) + RETURN TRUE + ELSE + IF d0 = SysErrors.intr THEN + interrupted := TRUE; + END; + IF (d0 # SysErrors.intr) OR ~retry THEN + SysErrors.Raise(errors, d0, Sys.close, ""); + RETURN FALSE + END; + END; END; END Close; PROCEDURE Read*(fd: File; buf: Address; cnt: Count; - errors: RelatedEvents.Object; - retry: BOOLEAN; VAR interrupted: BOOLEAN) : Count; + errors: RelatedEvents.Object; + retry: BOOLEAN; VAR interrupted: BOOLEAN) : Count; (* return value of 0: EOF - -1: I/O error - >0: number of bytes read + -1: I/O error + >0: number of bytes read *) VAR - d0, d1: LONGINT; + d0, d1: LONGINT; BEGIN interrupted := FALSE; LOOP - IF ulmSYSTEM.UNIXCALL(Sys.read, d0, d1, fd, buf, cnt) THEN - RETURN d0 - ELSE - IF d0 = SysErrors.intr THEN - interrupted := TRUE; - END; - IF (d0 # SysErrors.intr) OR ~retry THEN - SysErrors.Raise(errors, d0, Sys.read, ""); - RETURN -1 - END; - END; + IF ulmSYSTEM.UNIXCALL(Sys.read, d0, d1, fd, buf, cnt) THEN + RETURN d0 + ELSE + IF d0 = SysErrors.intr THEN + interrupted := TRUE; + END; + IF (d0 # SysErrors.intr) OR ~retry THEN + SysErrors.Raise(errors, d0, Sys.read, ""); + RETURN -1 + END; + END; END; END Read; PROCEDURE Write*(fd: File; buf: Address; cnt: Count; - errors: RelatedEvents.Object; - retry: BOOLEAN; VAR interrupted: BOOLEAN) : Count; + errors: RelatedEvents.Object; + retry: BOOLEAN; VAR interrupted: BOOLEAN) : Count; (* return value of -1: I/O error - >=0: number of bytes written + >=0: number of bytes written *) VAR - d0, d1: LONGINT; + d0, d1: LONGINT; BEGIN interrupted := FALSE; LOOP - IF ulmSYSTEM.UNIXCALL(Sys.write, d0, d1, fd, buf, cnt) THEN - RETURN d0 - ELSE - IF d0 = SysErrors.intr THEN - interrupted := TRUE; - END; - IF (d0 # SysErrors.intr) OR ~retry THEN - SysErrors.Raise(errors, d0, Sys.write, ""); - RETURN -1 - END; - END; + IF ulmSYSTEM.UNIXCALL(Sys.write, d0, d1, fd, buf, cnt) THEN + RETURN d0 + ELSE + IF d0 = SysErrors.intr THEN + interrupted := TRUE; + END; + IF (d0 # SysErrors.intr) OR ~retry THEN + SysErrors.Raise(errors, d0, Sys.write, ""); + RETURN -1 + END; + END; END; END Write; PROCEDURE Seek*(fd: File; offset: Count; whence: Whence; - errors: RelatedEvents.Object) : BOOLEAN; + errors: RelatedEvents.Object) : BOOLEAN; VAR - d0, d1: LONGINT; + d0, d1: LONGINT; BEGIN IF ulmSYSTEM.UNIXCALL(Sys.lseek, d0, d1, fd, offset, whence) THEN - RETURN TRUE + RETURN TRUE ELSE - SysErrors.Raise(errors, d0, Sys.lseek, ""); - RETURN FALSE + SysErrors.Raise(errors, d0, Sys.lseek, ""); + RETURN FALSE END; END Seek; PROCEDURE Tell*(fd: File; VAR offset: Count; - errors: RelatedEvents.Object) : BOOLEAN; + errors: RelatedEvents.Object) : BOOLEAN; VAR - d0, d1: LONGINT; + d0, d1: LONGINT; BEGIN IF ulmSYSTEM.UNIXCALL(Sys.lseek, d0, d1, fd, 0, fromPos) THEN - offset := d0; - RETURN TRUE + offset := d0; + RETURN TRUE ELSE - SysErrors.Raise(errors, d0, Sys.lseek, ""); - RETURN FALSE + SysErrors.Raise(errors, d0, Sys.lseek, ""); + RETURN FALSE END; END Tell; PROCEDURE Isatty*(fd: File) : BOOLEAN; CONST - sizeofStructTermIO = 18; - tcgeta = 00005405H; + sizeofStructTermIO = 18; + tcgeta = 00005405H; VAR - d0, d1: LONGINT; - buf: ARRAY 32 OF SYS.BYTE; (* Should be more than sufficient *) + d0, d1: LONGINT; + buf: ARRAY 32 OF SYS.BYTE; (* Should be more than sufficient *) BEGIN (* following system call fails for non-tty's *) RETURN ulmSYSTEM.UNIXCALL(Sys.ioctl, d0, d1, fd, tcgeta, SYS.ADR(buf)) END Isatty; PROCEDURE Fcntl*(fd: File; request: INTEGER; VAR arg: LONGINT; - errors: RelatedEvents.Object; - retry: BOOLEAN; VAR interrupted: BOOLEAN) : BOOLEAN; + errors: RelatedEvents.Object; + retry: BOOLEAN; VAR interrupted: BOOLEAN) : BOOLEAN; VAR - d0, d1: LONGINT; + d0, d1: LONGINT; BEGIN interrupted := FALSE; LOOP - IF ulmSYSTEM.UNIXCALL(Sys.fcntl, d0, d1, fd, request, arg) THEN - arg := d0; - RETURN TRUE - ELSE - IF d0 = SysErrors.intr THEN - interrupted := TRUE; - END; - IF (d0 # SysErrors.intr) OR ~retry THEN - SysErrors.Raise(errors, d0, Sys.fcntl, ""); - RETURN FALSE - END; - END; + IF ulmSYSTEM.UNIXCALL(Sys.fcntl, d0, d1, fd, request, arg) THEN + arg := d0; + RETURN TRUE + ELSE + IF d0 = SysErrors.intr THEN + interrupted := TRUE; + END; + IF (d0 # SysErrors.intr) OR ~retry THEN + SysErrors.Raise(errors, d0, Sys.fcntl, ""); + RETURN FALSE + END; + END; END; END Fcntl; PROCEDURE FcntlSet*(fd: File; request: INTEGER; flags: SET; - errors: RelatedEvents.Object; - retry: BOOLEAN; VAR interrupted: BOOLEAN) : BOOLEAN; + errors: RelatedEvents.Object; + retry: BOOLEAN; VAR interrupted: BOOLEAN) : BOOLEAN; VAR - d0, d1: LONGINT; + d0, d1: LONGINT; BEGIN interrupted := FALSE; LOOP - IF ulmSYSTEM.UNIXCALL(Sys.fcntl, d0, d1, fd, request, SYS.VAL(LONGINT, flags)) THEN - RETURN TRUE - ELSE - IF d0 = SysErrors.intr THEN - interrupted := TRUE; - END; - IF (d0 # SysErrors.intr) OR ~retry THEN - SysErrors.Raise(errors, d0, Sys.fcntl, ""); - RETURN FALSE - END; - END; + IF ulmSYSTEM.UNIXCALL(Sys.fcntl, d0, d1, fd, request, SYS.VAL(LONGINT, flags)) THEN + RETURN TRUE + ELSE + IF d0 = SysErrors.intr THEN + interrupted := TRUE; + END; + IF (d0 # SysErrors.intr) OR ~retry THEN + SysErrors.Raise(errors, d0, Sys.fcntl, ""); + RETURN FALSE + END; + END; END; END FcntlSet; PROCEDURE FcntlGet*(fd: File; request: INTEGER; VAR flags: SET; - errors: RelatedEvents.Object) : BOOLEAN; + errors: RelatedEvents.Object) : BOOLEAN; VAR - d0, d1: LONGINT; + d0, d1: LONGINT; BEGIN IF ulmSYSTEM.UNIXCALL(Sys.fcntl, d0, d1, fd, request, 0) THEN - ulmSYSTEM.WMOVE(SYS.ADR(d0), SYS.ADR(flags), 1); - RETURN TRUE + ulmSYSTEM.WMOVE(SYS.ADR(d0), SYS.ADR(flags), 1); + RETURN TRUE ELSE - SysErrors.Raise(errors, d0, Sys.fcntl, ""); - RETURN FALSE + SysErrors.Raise(errors, d0, Sys.fcntl, ""); + RETURN FALSE END; END FcntlGet; PROCEDURE Dup*(fd: File; VAR newfd: File; - errors: RelatedEvents.Object) : BOOLEAN; + errors: RelatedEvents.Object) : BOOLEAN; VAR - d0, d1: LONGINT; - a0, a1: LONGINT; + d0, d1: LONGINT; + a0, a1: LONGINT; BEGIN + a0 := 0; a1 := 0; (* Initialised to disable compiler warning. *) IF ulmSYSTEM.UNIXCALL(Sys.dup, d0, d1, fd, a0, a1) THEN - newfd := d0; - RETURN TRUE + newfd := d0; + RETURN TRUE ELSE - SysErrors.Raise(errors, d0, Sys.dup, ""); - RETURN FALSE + SysErrors.Raise(errors, d0, Sys.dup, ""); + RETURN FALSE END; END Dup; PROCEDURE Dup2*(fd, newfd: File; errors: RelatedEvents.Object) : BOOLEAN; VAR - d0, d1: LONGINT; - a0, a1: LONGINT; - fd2: File; - interrupted: BOOLEAN; + d0, d1: LONGINT; + a0, a1: LONGINT; + fd2: File; + interrupted: BOOLEAN; BEGIN + a0 := 0; a1 := 0; (* Initialised to disable compiler warning. *) fd2 := newfd; (* handmade close to avoid unnecessary events *) IF ~ulmSYSTEM.UNIXCALL(Sys.close, d0, d1, newfd, a0, a1) THEN END; IF Fcntl(fd, dupfd, fd2, errors, TRUE, interrupted) THEN - IF fd2 = newfd THEN - RETURN TRUE - ELSE - RETURN Close(fd2, errors, TRUE, interrupted) & FALSE - END; + IF fd2 = newfd THEN + RETURN TRUE + ELSE + RETURN Close(fd2, errors, TRUE, interrupted) & FALSE + END; ELSE - RETURN FALSE + RETURN FALSE END; END Dup2; PROCEDURE Pipe*(VAR readfd, writefd: File; - errors: RelatedEvents.Object) : BOOLEAN; + errors: RelatedEvents.Object) : BOOLEAN; VAR - d0, d1: LONGINT; - a0, a1: LONGINT; - fds : ARRAY 2 OF (*File*)INTEGER; (* it needs int pipefd[2], and int is 4 bytes long on x86_64 -- noch *) + d0, d1: LONGINT; + a0, a1: LONGINT; + fds : ARRAY 2 OF (*File*)INTEGER; (* it needs int pipefd[2], and int is 4 bytes long on x86_64 -- noch *) BEGIN + a0 := 0; a1 := 0; (* Initialised to disable compiler warning. *) IF ulmSYSTEM.UNIXCALL(Sys.pipe, d0, d1, SYS.ADR (fds), a0, a1) THEN - readfd := fds[0]; writefd := fds[1]; - RETURN TRUE + readfd := fds[0]; writefd := fds[1]; + RETURN TRUE ELSE - SysErrors.Raise(errors, d0, Sys.pipe, ""); - RETURN FALSE + SysErrors.Raise(errors, d0, Sys.pipe, ""); + RETURN FALSE END; END Pipe; diff --git a/src/library/ulm/ulmSysStat.Mod b/src/library/ulm/ulmSysStat.Mod index 54d1fc41..f9aaa507 100644 --- a/src/library/ulm/ulmSysStat.Mod +++ b/src/library/ulm/ulmSysStat.Mod @@ -45,42 +45,42 @@ MODULE ulmSysStat; CONST (* file mode: bit 0 = 1<<0 bit 31 = 1<<31 - + user group other 3 1 1111 11 1 ... 6 5432 109 876 543 210 - +--------+------+-----+-----+-----+-----+ - | unused | type | sst | rwx | rwx | rwx | - +--------+------+-----+-----+-----+-----+ + +--------+------+-----+-----+-----+-----+ + | unused | type | sst | rwx | rwx | rwx | + +--------+------+-----+-----+-----+-----+ *) type* = {12..15}; prot* = {0..8}; (* file types; example: (stat.mode * type = dir) *) - reg* = {15}; (* regular *) - dir* = {14}; (* directory *) - chr* = {13}; (* character special *) - fifo* = {12}; (* fifo *) - blk* = {13..14}; (* block special *) - symlink* = {13, 15}; (* symbolic link *) - socket* = {14, 15}; (* socket *) + reg* = {15}; (* regular *) + dir* = {14}; (* directory *) + chr* = {13}; (* character special *) + fifo* = {12}; (* fifo *) + blk* = {13..14}; (* block special *) + symlink* = {13, 15}; (* symbolic link *) + socket* = {14, 15}; (* socket *) (* special *) - setuid* = 11; (* set user id on execution *) - setgid* = 10; (* set group id on execution *) - savetext* = 9; (* save swapped text even after use *) + setuid* = 11; (* set user id on execution *) + setgid* = 10; (* set group id on execution *) + savetext* = 9; (* save swapped text even after use *) (* protection *) - uread* = 8; (* read permission owner *) - uwrite* = 7; (* write permission owner *) - uexec* = 6; (* execute/search permission owner *) - gread* = 5; (* read permission group *) - gwrite* = 4; (* write permission group *) - gexec* = 3; (* execute/search permission group *) - oread* = 2; (* read permission other *) - owrite* = 1; (* write permission other *) - oexec* = 0; (* execute/search permission other *) + uread* = 8; (* read permission owner *) + uwrite* = 7; (* write permission owner *) + uexec* = 6; (* execute/search permission owner *) + gread* = 5; (* read permission group *) + gwrite* = 4; (* write permission group *) + gexec* = 3; (* execute/search permission group *) + oread* = 2; (* read permission other *) + owrite* = 1; (* write permission other *) + oexec* = 0; (* execute/search permission other *) (* example for "r-xr-x---": (read + exec) * (owner + group) *) owner* = {uread, uwrite, uexec}; @@ -92,136 +92,98 @@ MODULE ulmSysStat; rwx* = prot; TYPE - StatRec* = (* result of stat(2) and fstat(2) *) - RECORD - device*: SysTypes.Device; (* ID of device containing - a directory entry for this file *) - inode*: SysTypes.Inode; (* inode number *) - nlinks*: LONGINT(*INTEGER*); (* number of links *) - mode*: SET; (* file mode; see mknod(2) *) - uid*: INTEGER; (* user id of the file's owner *) - gid*: INTEGER; (* group id of the file's group *) - rdev*: SysTypes.Device; (* ID of device - this entry is defined only for - character special or block - special files - *) - size*: SysTypes.Offset; (* file size in bytes *) - blksize*: LONGINT; (* preferred blocksize *) - blocks*: LONGINT; (* # of blocks allocated *) - atime*: SysTypes.Time; (* time of last access *) - mtime*: SysTypes.Time; (* time of last data modification *) - ctime*: SysTypes.Time; (* time of last file status change *) - END; + StatRec* = RECORD (* result of stat(2) and fstat(2) *) + device*: SysTypes.Device; (* ID of device containing a directory entry + for this file *) + inode*: SysTypes.Inode; (* inode number *) + mode*: SET; (* file mode; see mknod(2) *) + nlinks*: LONGINT; (* number of links *) + uid*: LONGINT; (* user id of the file's owner *) + gid*: LONGINT; (* group id of the file's group *) + rdev*: SysTypes.Device; (* ID of device. this entry is defined only for + character special or block special files *) + size*: SysTypes.Offset; (* file size in bytes *) + + (* Blocks and blksize are not available on all platforms. + blksize*: LONGINT; (* preferred blocksize *) + blocks*: LONGINT; (* # of blocks allocated *) + *) + + atime*: SysTypes.Time; (* time of last access *) + mtime*: SysTypes.Time; (* time of last data modification *) + ctime*: SysTypes.Time; (* time of last file status change *) + END; -(* StatRec* = (* result of stat(2) and fstat(2) *) - RECORD - device*: SysTypes.Device; (* ID of device containing - a directory entry for this file *) - inode*: SysTypes.Inode; (* inode number *) - nlinks*: LONGINT; (* number of links *) - mode*: INTEGER(*SET*); (* file mode; see mknod(2) *) - uid*: INTEGER; (* user id of the file's owner *) - gid*: INTEGER; (* group id of the file's group *) - pad0: INTEGER; - rdev*: SysTypes.Device; (* ID of device - this entry is defined only for - character special or block - special files - *) - size*: SysTypes.Offset; (* file size in bytes *) - blksize*: LONGINT; (* preferred blocksize *) - blocks*: LONGINT; (* # of blocks allocated *) - atime*: SysTypes.Time; (* time of last access *) - atimences* : LONGINT; - mtime*: SysTypes.Time; (* time of last data modification *) - mtimensec* : LONGINT; - ctime*: SysTypes.Time; (* time of last file status change *) - ctimensec* : LONGINT; - unused0*, unused1*, unused2*: LONGINT; - END; -*) -(* Linux kernel struct stat (2.2.17) - struct stat { - unsigned short st_dev; - unsigned short __pad1; - unsigned long st_ino; - unsigned short st_mode; - unsigned short st_nlink; - unsigned short st_uid; - unsigned short st_gid; - unsigned short st_rdev; - unsigned short __pad2; - unsigned long st_size; - unsigned long st_blksize; - unsigned long st_blocks; - unsigned long st_atime; - unsigned long __unused1; - unsigned long st_mtime; - unsigned long __unused2; - unsigned long st_ctime; - unsigned long __unused3; - unsigned long __unused4; - unsigned long __unused5; - }; -*) - CONST - statbufsize = 144(*64*); (* see *) (* sizeof struct stat gives us 144 on x86_64 and 88 or x86; -- noch *) - TYPE - UnixStatRec = ARRAY statbufsize OF SYS.BYTE; - CONST - statbufconv = - (*"is=dev/-s=pad1/ll=ino/Ss=mode/4*is=nlink+uid+gid+rdev/-s=pad2/ll=size/2*ll=blksize,blocks/il=atime/-l/il=mtime/-l/il=ctime/3*-l";*) - "lL=dev/lL=ino/lL=nlink/Su=mode/2*iu=uid+gid/-i=pad0/lL=rdev/ll=size/2*ll=blksize,blocks/lL=atime/-l/lL=mtime/-l/lL=ctime/3*-l"; (* noch *) - VAR - statbuffmt: SysConversions.Format; + PROCEDURE -Aincludesysstat '#include '; + PROCEDURE -Aerrno '#include '; - PROCEDURE Stat*(path: ARRAY OF CHAR; VAR buf: StatRec; - errors: RelatedEvents.Object) : BOOLEAN; - VAR - d0, d1, d2: LONGINT; - origbuf: UnixStatRec; + PROCEDURE -structstats "struct stat s"; + PROCEDURE -statdev(): LONGINT "(LONGINT)s.st_dev"; + PROCEDURE -statino(): LONGINT "(LONGINT)s.st_ino"; + PROCEDURE -statmode(): LONGINT "(LONGINT)s.st_mode"; + PROCEDURE -statnlink(): LONGINT "(LONGINT)s.st_nlink"; + PROCEDURE -statuid(): LONGINT "(LONGINT)s.st_uid"; + PROCEDURE -statgid(): LONGINT "(LONGINT)s.st_gid"; + PROCEDURE -statrdev(): LONGINT "(LONGINT)s.st_rdev"; + PROCEDURE -statsize(): LONGINT "(LONGINT)s.st_size"; + PROCEDURE -statatime(): LONGINT "(LONGINT)s.st_atime"; + PROCEDURE -statmtime(): LONGINT "(LONGINT)s.st_mtime"; + PROCEDURE -statctime(): LONGINT "(LONGINT)s.st_ctime"; + + (* Blocks and blksize are not available on all platforms. + PROCEDURE -statblksize(): LONGINT "(LONGINT)s.st_blksize"; + PROCEDURE -statblocks(): LONGINT "(LONGINT)s.st_blocks"; + *) + + PROCEDURE -fstat(fd: LONGINT): INTEGER "fstat(fd, &s)"; + PROCEDURE -stat (n: ARRAY OF CHAR): INTEGER "stat((char*)n, &s)"; + + PROCEDURE -err(): INTEGER "errno"; + + PROCEDURE Stat*(path: ARRAY OF CHAR; VAR buf: StatRec; errors: RelatedEvents.Object): BOOLEAN; BEGIN - IF uSYS.UNIXCALL(Sys.newstat, d0, d1, SYS.ADR(path), SYS.ADR(origbuf), d2) THEN - SysConversions.ByFmtFromC(origbuf, buf, statbuffmt); - RETURN TRUE - ELSE - SysErrors.Raise(errors, d0, Sys.newstat, path); - RETURN FALSE - END; + structstats; + IF stat(path) < 0 THEN SysErrors.Raise(errors, err(), Sys.newstat, path); RETURN FALSE END; + buf.device := SYS.VAL(SysTypes.Device, statdev()); + buf.inode := SYS.VAL(SysTypes.Inode, statino()); + buf.mode := SYS.VAL(SET, statmode()); + buf.nlinks := statnlink(); + buf.uid := statuid(); + buf.gid := statgid(); + buf.rdev := SYS.VAL(SysTypes.Device, statrdev()); + buf.size := SYS.VAL(SysTypes.Offset, statsize()); + (* Blocks and blksize are not available on all platforms. + buf.blksize := statblksize(); + buf.blocks := statblocks(); + *) + buf.atime := SYS.VAL(SysTypes.Time, statatime()); + buf.mtime := SYS.VAL(SysTypes.Time, statmtime()); + buf.ctime := SYS.VAL(SysTypes.Time, statctime()); + RETURN TRUE; END Stat; -(* commented temporarily, it is used only in FTPUnixDirLister module *) (* - PROCEDURE Lstat*(path: ARRAY OF CHAR; VAR buf: StatRec; - errors: RelatedEvents.Object) : BOOLEAN; - VAR - d0, d1: INTEGER; - origbuf: UnixStatRec; + + PROCEDURE Fstat*(fd: SysTypes.File; VAR buf: StatRec; errors: RelatedEvents.Object): BOOLEAN; BEGIN - IF SYS.UNIXCALL(Sys.newlstat, d0, d1, SYS.ADR(path), SYS.ADR(origbuf)) THEN - SysConversions.ByFmtFromC(origbuf, buf, statbuffmt); - RETURN TRUE - ELSE - SysErrors.Raise(errors, d0, Sys.newlstat, path); - RETURN FALSE - END; - END Lstat; -*) - PROCEDURE Fstat*(fd: SysTypes.File; VAR buf: StatRec; - errors: RelatedEvents.Object) : BOOLEAN; - VAR - d0, d1, d2: LONGINT; - origbuf: UnixStatRec; - BEGIN - IF uSYS.UNIXCALL(Sys.newfstat, d0, d1, fd, SYS.ADR(origbuf), d2) THEN - SysConversions.ByFmtFromC(origbuf, buf, statbuffmt); - RETURN TRUE - ELSE - SysErrors.Raise(errors, d0, Sys.newfstat, ""); - RETURN FALSE - END; + structstats; + IF fstat(SYS.VAL(LONGINT, fd)) < 0 THEN SysErrors.Raise(errors, err(), Sys.newfstat, ""); RETURN FALSE END; + buf.device := SYS.VAL(SysTypes.Device, statdev()); + buf.inode := SYS.VAL(SysTypes.Inode, statino()); + buf.mode := SYS.VAL(SET, statmode()); + buf.nlinks := statnlink(); + buf.uid := statuid(); + buf.gid := statgid(); + buf.rdev := SYS.VAL(SysTypes.Device, statrdev()); + buf.size := SYS.VAL(SysTypes.Offset, statsize()); + (* Blocks and blksize are not available on all platforms. + buf.blksize := statblksize(); + buf.blocks := statblocks(); + *) + buf.atime := SYS.VAL(SysTypes.Time, statatime()); + buf.mtime := SYS.VAL(SysTypes.Time, statmtime()); + buf.ctime := SYS.VAL(SysTypes.Time, statctime()); + RETURN TRUE; END Fstat; -BEGIN - SysConversions.Compile(statbuffmt, statbufconv); + END ulmSysStat. diff --git a/src/library/ulm/ulmTCrypt.Mod b/src/library/ulm/ulmTCrypt.Mod index e1909085..4003eaf0 100644 --- a/src/library/ulm/ulmTCrypt.Mod +++ b/src/library/ulm/ulmTCrypt.Mod @@ -38,11 +38,11 @@ MODULE ulmTCrypt; (* Michael Szczuka *) M = 16; (* size of an element of CC(M) [ring of Circular Convolution] *) MaxVar = 8; (* number of variables of a polynomial *) MaxNrExp = 4; (* maxiumum number of different exponts used during - initialisaton *) + initialisaton *) Dim = 2; (* dimension of the linear recursion *) Rounds = 16; (* length of the linear recursion in rounds *) LastRounds = 4; (* use the last LastRounds polynomial vectors as - the composed function eta *) + the composed function eta *) reg = 1; sing = 2; random = 3; LIST = TRUE; NOLIST = FALSE; MaxTerms = 1000; @@ -62,9 +62,9 @@ MODULE ulmTCrypt; (* Michael Szczuka *) (* a polynomial with coefficients out of CC(M) *) Polynom = POINTER TO PolynomRec; PolynomRec = RECORD - koeff : CCMElement; - exp : Exponent; - next : Polynom; + koeff : CCMElement; + exp : Exponent; + next : Polynom; END; TYPE @@ -77,51 +77,51 @@ MODULE ulmTCrypt; (* Michael Szczuka *) ChainCCM = ARRAY Rounds OF VektorCCM; ChainPolynom = ARRAY Rounds OF VektorPolynom; (* to increase the performance of the algorithm there shouldn't be too - many different exponents to start with *) + many different exponents to start with *) ListExp = ARRAY MaxNrExp OF Exponent; TYPE (* this type is the input of the TCrypt method *) TCryptInput = POINTER TO TCryptInputRec; TCryptInputRec = RECORD - arg : ARRAY MaxVar OF CCMElement; + arg : ARRAY MaxVar OF CCMElement; END; TYPE (* result type after encryption with the public key *) TCryptTmp = POINTER TO TCryptTmpRec; TCryptTmpRec = RECORD - numerator : ChainCCM; - denominator : ListCCM; + numerator : ChainCCM; + denominator : ListCCM; END; TYPE (* result type of the algorithm *) TCryptRes = POINTER TO TCryptResRec; TCryptResRec = RECORD - arg : ARRAY LastRounds OF VektorCCM; + arg : ARRAY LastRounds OF VektorCCM; END; TYPE (* this type represents the public function f resp. phi *) Phi = POINTER TO PhiRec; PhiRec = RECORD - num : ChainPolynom; - denom : ListPolynom; + num : ChainPolynom; + denom : ListPolynom; END; TYPE (* the private/secret function g resp. psi consisting of an inital matrix - and a permutation *) + and a permutation *) Psi = POINTER TO PsiRec; PsiRec = RECORD - (* although the inital matrix consists only of elements out of CC(M) - this generalization is useful since all other matrces consist of - polynomials *) - initialmatrix : MatCCM; - (* correcting factors *) - korrNum : ChainCCM; - korrDenom : ListCCM; + (* although the inital matrix consists only of elements out of CC(M) + this generalization is useful since all other matrces consist of + polynomials *) + initialmatrix : MatCCM; + (* correcting factors *) + korrNum : ChainCCM; + korrDenom : ListCCM; END; (* the public function h resp. eta being the composition of f/phi @@ -129,49 +129,49 @@ MODULE ulmTCrypt; (* Michael Szczuka *) TYPE Eta = POINTER TO EtaRec; EtaRec = RECORD - p : ARRAY LastRounds OF VektorPolynom; + p : ARRAY LastRounds OF VektorPolynom; END; TYPE (* the declaration of a basic type which PublicCipher and PrivateCipher - are descendents from seems a good idea ... at least to me :) *) + are descendents from seems a good idea ... at least to me :) *) Cipher* = POINTER TO CipherRec; CipherRec* = RECORD (AsymmetricCiphers.CipherRec) END; (* the specific format of a public key for Trautner's technique *) PublicCipher = POINTER TO PublicCipherRec; PublicCipherRec = RECORD - (CipherRec) - phi : Phi; - eta : Eta; + (CipherRec) + phi : Phi; + eta : Eta; END; (* the specific format of a key for Trautner's technique *) PrivateCipher = POINTER TO PrivateCipherRec; PrivateCipherRec = RECORD - (CipherRec) - phi : Phi; - psi : Psi; - eta : Eta; + (CipherRec) + phi : Phi; + psi : Psi; + eta : Eta; END; TYPE ErrorEvent = POINTER TO ErrorEventRec; ErrorEventRec = RECORD - (Events.EventRec) - errorcode : SHORTINT; + (Events.EventRec) + errorcode : SHORTINT; END; VAR pubType, privType, cipherType : Services.Type; pubIf, privIf, cipherIf : PersistentObjects.Interface; NullCCM, EinsCCM : CCMElement; (* the zero and unit of CC(M) *) - NullExp : Exponent; (* consists of zero exponents *) + NullExp : Exponent; (* consists of zero exponents *) NullExpList : ListExp; (* a pseudo list for CreatePolynom *) GlobalExpList : ListExp; (* contains the exponents which should be used - when calling CreatePolynom *) + when calling CreatePolynom *) NullPolynom : Polynom; (* the zero polynomial *) PolFeld : ARRAY MaxTerms OF Polynom; (* used for sorting purposes *) PreEvalArg : ARRAY M OF TCryptInput; (* precomputed values to speed - up evaluation of a polynomial *) + up evaluation of a polynomial *) k : SHORTINT; (* simple counter during initialisation *) error : Events.EventType; errormsg : ARRAY errorcodes OF Events.Message; @@ -189,7 +189,7 @@ MODULE ulmTCrypt; (* Michael Szczuka *) PROCEDURE Error(s: Streams.Stream; errorcode: SHORTINT); VAR - event: ErrorEvent; + event: ErrorEvent; BEGIN NEW(event); event.message := errormsg[errorcode]; @@ -202,33 +202,33 @@ MODULE ulmTCrypt; (* Michael Szczuka *) PROCEDURE RegulaerCCM (x: CCMElement) : BOOLEAN; (* tests x for regularity [a regular CCMElement contains an odd number of - set bits]; returns TRUE when x is regular, FALSE otherwise *) + set bits]; returns TRUE when x is regular, FALSE otherwise *) VAR - res, i : SHORTINT; + res, i : SHORTINT; BEGIN i := 0; res := 0; - REPEAT (* counting the set bits *) - IF i IN x THEN - INC(res); - END; - INC(i); + REPEAT (* counting the set bits *) + IF i IN x THEN + INC(res); + END; + INC(i); UNTIL i>=M; RETURN ((res MOD 2) = 1); END RegulaerCCM; PROCEDURE EqualCCM (x, y: CCMElement) : BOOLEAN; (* compares x and y for equality; if x and y are equal TRUE is returned, - FALSE otherwise *) + FALSE otherwise *) VAR - i : SHORTINT; + i : SHORTINT; BEGIN i := 0; WHILE i < M DO - IF ((i IN x) & (~(i IN y))) OR ((~(i IN x)) & (i IN y)) THEN - RETURN FALSE; - END; - INC(i); + IF ((i IN x) & (~(i IN y))) OR ((~(i IN x)) & (i IN y)) THEN + RETURN FALSE; + END; + INC(i); END; RETURN TRUE; END EqualCCM; @@ -236,121 +236,122 @@ MODULE ulmTCrypt; (* Michael Szczuka *) PROCEDURE AddCCM (x, y: CCMElement; VAR z: CCMElement); (* add x and y in CC(M) *) VAR - i : SHORTINT; + i : SHORTINT; BEGIN z := NullCCM; i := 0; REPEAT - IF ((i IN x) & (~(i IN y))) OR ((~(i IN x)) & (i IN y)) THEN - z := z + {i}; - END; - INC(i); + IF ((i IN x) & (~(i IN y))) OR ((~(i IN x)) & (i IN y)) THEN + z := z + {i}; + END; + INC(i); UNTIL i>=M; END AddCCM; PROCEDURE MulCCM (x, y: CCMElement; VAR z: CCMElement); (* multiply x and y in CC(M) *) VAR - i, j, diff : SHORTINT; - tmp : INTEGER; + i, j, diff : SHORTINT; + tmp : INTEGER; BEGIN z := NullCCM; i := 0; REPEAT - j := 0; - tmp := 0; - REPEAT - diff := i-j; - IF diff >= 0 THEN - IF (j IN x) & (diff IN y) THEN - INC(tmp); - END; - ELSE - IF (j IN x) & ((M+diff) IN y) THEN - INC(tmp); - END; - END; - INC(j); - UNTIL j>=M; - IF (tmp MOD 2) = 1 THEN - z := z + {i}; - END; - INC(i); + j := 0; + tmp := 0; + REPEAT + diff := i-j; + IF diff >= 0 THEN + IF (j IN x) & (diff IN y) THEN + INC(tmp); + END; + ELSE + IF (j IN x) & ((M+diff) IN y) THEN + INC(tmp); + END; + END; + INC(j); + UNTIL j>=M; + IF (tmp MOD 2) = 1 THEN + z := z + {i}; + END; + INC(i); UNTIL i>=M; END MulCCM; PROCEDURE PowerCCM (x: CCMElement; exp: INTEGER; VAR z: CCMElement); (* raises x to the power exp in CC(M) *) VAR - tmp : CCMElement; + tmp : CCMElement; BEGIN (* some special cases first *) IF exp >= M THEN - IF ~RegulaerCCM(x) THEN - (* x is singular -> result is zero *) - z := NullCCM; - RETURN; - END; - (* x is regular -> compute the modulus of exp mod M and use this - instead of exp *) - exp := exp MOD M; + IF ~RegulaerCCM(x) THEN + (* x is singular -> result is zero *) + z := NullCCM; + RETURN; + END; + (* x is regular -> compute the modulus of exp mod M and use this + instead of exp *) + exp := exp MOD M; END; IF exp = 0 THEN - z := EinsCCM; - RETURN; + z := EinsCCM; + RETURN; END; IF exp = 1 THEN - z := x; - RETURN; + z := x; + RETURN; END; (* default case; use a "square and multiply" technique *) tmp := x; z := EinsCCM; REPEAT - IF exp MOD 2 = 1 THEN - MulCCM(z, tmp, z); - END; - exp := exp DIV 2; - MulCCM(tmp, tmp, tmp); + IF exp MOD 2 = 1 THEN + MulCCM(z, tmp, z); + END; + exp := exp DIV 2; + MulCCM(tmp, tmp, tmp); UNTIL exp < 1; END PowerCCM; PROCEDURE CreateCCM (VAR x: CCMElement; mode: SHORTINT); (* creates a random element out of CC(M) depending on mode which - can be reg, sing or random; - the result is in any case different from the zero *) + can be reg, sing or random; + the result is in any case different from the zero *) VAR - i, SetBits: SHORTINT; + i, SetBits: SHORTINT; BEGIN x := NullCCM; REPEAT - i := 0; - SetBits := 0; - REPEAT - IF Random.Flip() THEN - (* set bit *) - x := x + {i}; - INC(SetBits); - END; - INC(i); - UNTIL i >= (M-1); + i := 0; + SetBits := 0; + REPEAT + IF Random.Flip() THEN + (* set bit *) + x := x + {i}; + INC(SetBits); + END; + INC(i); + UNTIL i >= (M-1); UNTIL SetBits > 0; (* at least one bit must be set so that the result - differs from zero *) + differs from zero *) CASE mode OF - random: - IF Random.Flip() THEN - x := x + {M-1}; - END; - | sing: (* singular element - even # of bits *) - IF (SetBits MOD 2) = 1 THEN - x := x + {M-1}; - END; - | reg: (* regular element - odd # of bits *) - IF ((SetBits + 1) MOD 2) = 1 THEN - x := x + {M-1}; - END; + random: + IF Random.Flip() THEN + x := x + {M-1}; + END; + | sing: (* singular element - even # of bits *) + IF (SetBits MOD 2) = 1 THEN + x := x + {M-1}; + END; + | reg: (* regular element - odd # of bits *) + IF ((SetBits + 1) MOD 2) = 1 THEN + x := x + {M-1}; + END; + ELSE END; END CreateCCM; @@ -359,64 +360,64 @@ MODULE ulmTCrypt; (* Michael Szczuka *) PROCEDURE LengthPolynom(p: Polynom) : INTEGER; (* returns the number of terms which make up the polynomial p *) VAR - i : INTEGER; + i : INTEGER; BEGIN i := 0; WHILE p # NIL DO - INC(i); - p := p.next; + INC(i); + p := p.next; END; RETURN i; END LengthPolynom; PROCEDURE RegulaerPolynom (p: Polynom) : BOOLEAN; (* tests the regularity of a polynomial [a polynomial is regular - iff the # of regular coefficients is odd] *) + iff the # of regular coefficients is odd] *) VAR - regkoeffs : SHORTINT; + regkoeffs : SHORTINT; BEGIN regkoeffs := 0; WHILE p # NIL DO - IF RegulaerCCM(p.koeff) THEN - (* count # of reg. coefficients *) - INC(regkoeffs); - END; - p := p.next; + IF RegulaerCCM(p.koeff) THEN + (* count # of reg. coefficients *) + INC(regkoeffs); + END; + p := p.next; END; RETURN (regkoeffs MOD 2) = 1; END RegulaerPolynom; PROCEDURE CmpExp (exp1, exp2: Exponent) : SHORTINT; (* compares two exponent vectors and returns 0 on equality, a - positive value if exp1>exp2 and a negative value if exp1exp2 and a negative value if exp1 e2 THEN - cmp := 1; diff := TRUE; - END; - END; - INC(i); + e1 := exp1[i]; e2 := exp2[i]; + INC(sum1, e1); INC(sum2, e2); + IF ~diff THEN + IF e1 < e2 THEN + cmp := -1; diff := TRUE; + ELSIF e1 > e2 THEN + cmp := 1; diff := TRUE; + END; + END; + INC(i); UNTIL i >= MaxVar; IF sum1 < sum2 THEN - RETURN -2; + RETURN -2; END; IF sum1 > sum2 THEN - RETURN 2; + RETURN 2; END; RETURN cmp @@ -425,69 +426,69 @@ MODULE ulmTCrypt; (* Michael Szczuka *) PROCEDURE ArrangePolynom (VAR p: Polynom); (* arrange a polynomial according to the order given by CmpExp *) VAR - r : Polynom; - cnt : INTEGER; + r : Polynom; + cnt : INTEGER; PROCEDURE SortPolynom(left, right: INTEGER); - (* sort the global field PolFeld with the quicksort algorithm *) - VAR - mid : INTEGER; + (* sort the global field PolFeld with the quicksort algorithm *) + VAR + mid : INTEGER; - PROCEDURE Partition(l, r: INTEGER) : INTEGER; - VAR - koeff : CCMElement; - exp : Exponent; - cmp : Exponent; - i, j : INTEGER; - BEGIN - cmp := PolFeld[(l+r) DIV 2].exp; - i := l-1; - j := r+1; - LOOP - REPEAT - DEC(j); - UNTIL CmpExp(PolFeld[j].exp, cmp) >= 0; - REPEAT - INC(i); - UNTIL CmpExp(PolFeld[i].exp, cmp) <= 0; - IF i < j THEN - koeff := PolFeld[i].koeff; - exp := PolFeld[i].exp; - PolFeld[i].koeff := PolFeld[j].koeff; - PolFeld[i].exp := PolFeld[j].exp; - PolFeld[j].koeff := koeff; - PolFeld[j].exp := exp; - ELSE - RETURN j; - END; - END; - END Partition; + PROCEDURE Partition(l, r: INTEGER) : INTEGER; + VAR + koeff : CCMElement; + exp : Exponent; + cmp : Exponent; + i, j : INTEGER; + BEGIN + cmp := PolFeld[(l+r) DIV 2].exp; + i := l-1; + j := r+1; + LOOP + REPEAT + DEC(j); + UNTIL CmpExp(PolFeld[j].exp, cmp) >= 0; + REPEAT + INC(i); + UNTIL CmpExp(PolFeld[i].exp, cmp) <= 0; + IF i < j THEN + koeff := PolFeld[i].koeff; + exp := PolFeld[i].exp; + PolFeld[i].koeff := PolFeld[j].koeff; + PolFeld[i].exp := PolFeld[j].exp; + PolFeld[j].koeff := koeff; + PolFeld[j].exp := exp; + ELSE + RETURN j; + END; + END; + END Partition; BEGIN - IF left < right THEN - mid := Partition(left, right); - SortPolynom(left, mid); - SortPolynom(mid+1, right); - END; + IF left < right THEN + mid := Partition(left, right); + SortPolynom(left, mid); + SortPolynom(mid+1, right); + END; END SortPolynom; BEGIN (* ArrangePolynom *) IF p = NIL THEN - RETURN; + RETURN; END; r := p; cnt := 0; WHILE (p # NIL) & (cnt < MaxTerms) DO - PolFeld[cnt] := p; - INC(cnt); - p := p.next; + PolFeld[cnt] := p; + INC(cnt); + p := p.next; END; (* polynomial contains too many terms; this shouldn't happen if all - parameters are set to reasonable values and MaxTerms is high - enough *) + parameters are set to reasonable values and MaxTerms is high + enough *) ASSERT(cnt 1 THEN - SortPolynom(0, cnt-1); + SortPolynom(0, cnt-1); END; p := r; END ArrangePolynom; @@ -495,97 +496,97 @@ MODULE ulmTCrypt; (* Michael Szczuka *) PROCEDURE CopyPolynom (s: Polynom; VAR t: Polynom); (* copy the source polynomial s to a new target t *) VAR - troot : Polynom; + troot : Polynom; BEGIN IF s = NIL THEN - t := NIL; - RETURN; + t := NIL; + RETURN; END; NEW(t); - troot := t; (* save the root of t *) + troot := t; (* save the root of t *) WHILE s # NIL DO - troot.koeff := s.koeff; - troot.exp := s.exp; - s := s.next; - IF s # NIL THEN - NEW(troot.next); - troot := troot.next; - ELSE - troot.next := NIL; - END; + troot.koeff := s.koeff; + troot.exp := s.exp; + s := s.next; + IF s # NIL THEN + NEW(troot.next); + troot := troot.next; + ELSE + troot.next := NIL; + END; END; END CopyPolynom; PROCEDURE AddPolynom (p, q: Polynom; VAR r: Polynom); (* add two polynomial; the polynomials must be sorted by the exponents as - is the result *) + is the result *) VAR - term1, term2 : Polynom; - last : Polynom; (* the last term of the result *) - tmp : Polynom; - cmpres : SHORTINT; + term1, term2 : Polynom; + last : Polynom; (* the last term of the result *) + tmp : Polynom; + cmpres : SHORTINT; BEGIN IF (p = NIL) & (q = NIL) THEN - r := NIL; - RETURN; + r := NIL; + RETURN; END; NEW(r); - term1 := p; (* term1 runs through all terms of p *) - term2 := q; (* same with term2 for q *) - tmp := r; (* save the root of r *) + term1 := p; (* term1 runs through all terms of p *) + term2 := q; (* same with term2 for q *) + tmp := r; (* save the root of r *) last := tmp; REPEAT - IF (term1 = NIL) OR (term2 = NIL) THEN - IF term2 = NIL THEN - (* no further terms in q *) - WHILE term1 # NIL DO - (* copy the remaining terms of p *) - tmp.koeff := term1.koeff; - tmp.exp := term1.exp; - term1 := term1.next; - IF ~EqualCCM(tmp.koeff, NullCCM) THEN - last := tmp; - NEW(tmp.next); - tmp := tmp.next; - END; - END; - ELSE (* no further terms in p *) - WHILE term2 # NIL DO - tmp.koeff := term2.koeff; - tmp.exp := term2.exp; - term2 := term2.next; - IF ~EqualCCM(tmp.koeff, NullCCM) THEN - last := tmp; - NEW(tmp.next); - tmp := tmp.next; - END; - END; - END; - ELSE (* both p and q still have a term *) - cmpres := CmpExp(term1.exp, term2.exp); - IF cmpres = 0 THEN (* add when exponents are equal *) - AddCCM(term1.koeff, term2.koeff, tmp.koeff); - tmp.exp := term1.exp; - term1 := term1.next; - term2 := term2.next; - ELSE - IF cmpres < 0 THEN (* exp2 > exp1 *) - tmp.koeff := term2.koeff; - tmp.exp := term2.exp; - term2 := term2.next; - ELSE (* exp1 > exp2 *) - tmp.koeff := term1.koeff; - tmp.exp := term1.exp; - term1 := term1.next; - END; - END; - (* zero coefficients = zero terms shouldn't occur in the result *) - IF ~EqualCCM(tmp.koeff, NullCCM) THEN - NEW(tmp.next); - last := tmp; - tmp := tmp.next; - END; - END; + IF (term1 = NIL) OR (term2 = NIL) THEN + IF term2 = NIL THEN + (* no further terms in q *) + WHILE term1 # NIL DO + (* copy the remaining terms of p *) + tmp.koeff := term1.koeff; + tmp.exp := term1.exp; + term1 := term1.next; + IF ~EqualCCM(tmp.koeff, NullCCM) THEN + last := tmp; + NEW(tmp.next); + tmp := tmp.next; + END; + END; + ELSE (* no further terms in p *) + WHILE term2 # NIL DO + tmp.koeff := term2.koeff; + tmp.exp := term2.exp; + term2 := term2.next; + IF ~EqualCCM(tmp.koeff, NullCCM) THEN + last := tmp; + NEW(tmp.next); + tmp := tmp.next; + END; + END; + END; + ELSE (* both p and q still have a term *) + cmpres := CmpExp(term1.exp, term2.exp); + IF cmpres = 0 THEN (* add when exponents are equal *) + AddCCM(term1.koeff, term2.koeff, tmp.koeff); + tmp.exp := term1.exp; + term1 := term1.next; + term2 := term2.next; + ELSE + IF cmpres < 0 THEN (* exp2 > exp1 *) + tmp.koeff := term2.koeff; + tmp.exp := term2.exp; + term2 := term2.next; + ELSE (* exp1 > exp2 *) + tmp.koeff := term1.koeff; + tmp.exp := term1.exp; + term1 := term1.next; + END; + END; + (* zero coefficients = zero terms shouldn't occur in the result *) + IF ~EqualCCM(tmp.koeff, NullCCM) THEN + NEW(tmp.next); + last := tmp; + tmp := tmp.next; + END; + END; UNTIL (term1 = NIL) & (term2 = NIL); (* forget last created term *) @@ -595,41 +596,41 @@ MODULE ulmTCrypt; (* Michael Szczuka *) PROCEDURE MulTerm (p, term: Polynom; VAR r: Polynom); (* multiply a polynomial with a single term; is used by MulPolynom *) VAR - tmp : Polynom; - last : Polynom; + tmp : Polynom; + last : Polynom; (* add two exponent vetors; addition is modulo M *) PROCEDURE AddExp (exp1, exp2 : Exponent; VAR res: Exponent); - VAR - i : SHORTINT; + VAR + i : SHORTINT; BEGIN - i := 0; - WHILE i 0 DO - IF (exp MOD 2) = 1 THEN - MulPolynom(res, tmp, res); - END; - MulPolynom(tmp, tmp, tmp); - exp := exp DIV 2; + IF (exp MOD 2) = 1 THEN + MulPolynom(res, tmp, res); + END; + MulPolynom(tmp, tmp, tmp); + exp := exp DIV 2; END; END InvertPolynom; PROCEDURE EvalPolynom (p: Polynom; VAR res: CCMElement); (* evaluate p; a precomputed list of all the powers of the argument can - be found in the global variable PreEvalArg *) + be found in the global variable PreEvalArg *) VAR - i : SHORTINT; - pow, prod : CCMElement; + i : SHORTINT; + pow, prod : CCMElement; BEGIN res := NullCCM; IF p = NIL THEN - RETURN; + RETURN; END; WHILE p # NIL DO - prod := PreEvalArg[p.exp[0]].arg[0]; - i := 1; - REPEAT - pow := PreEvalArg[p.exp[i]].arg[i]; - MulCCM(prod, pow, prod); - INC(i); - UNTIL i >= MaxVar; - MulCCM(prod, p.koeff, prod); - AddCCM(res, prod, res); - p := p.next; + prod := PreEvalArg[p.exp[0]].arg[0]; + i := 1; + REPEAT + pow := PreEvalArg[p.exp[i]].arg[i]; + MulCCM(prod, pow, prod); + INC(i); + UNTIL i >= MaxVar; + MulCCM(prod, p.koeff, prod); + AddCCM(res, prod, res); + p := p.next; END; END EvalPolynom; PROCEDURE CreateExp (VAR exp: Exponent); (* creates a random vector of exponents *) VAR - i : SHORTINT; + i : SHORTINT; BEGIN i := 0; WHILE i 0 DO - IF (kk MOD 2) = 1 THEN - MulCCM(tmp, PreEvalArg[ii].arg[i], tmp); - END; - INC(ii,ii); - kk := kk DIV 2; - END; - PreEvalArg[k].arg[i] := tmp; - INC(k); - END; - INC(i); + k := 2; + tmp := arg.arg[i]; + WHILE k < M DO + MulCCM(tmp, tmp, tmp); + PreEvalArg[k].arg[i] := tmp; + INC(k,k); + END; + k := 3; + WHILE k < M DO + kk := k; + ii := 1; + tmp := EinsCCM; + WHILE kk > 0 DO + IF (kk MOD 2) = 1 THEN + MulCCM(tmp, PreEvalArg[ii].arg[i], tmp); + END; + INC(ii,ii); + kk := kk DIV 2; + END; + PreEvalArg[k].arg[i] := tmp; + INC(k); + END; + INC(i); END; END PreComputeArgs; PROCEDURE EvaluatePhi (arg: TCryptInput; data: Phi) : TCryptTmp; (* evaluate the public function phi (represented by data) with - argument arg *) + argument arg *) VAR - res : TCryptTmp; - r, d : SHORTINT; + res : TCryptTmp; + r, d : SHORTINT; BEGIN NEW(res); PreComputeArgs(arg); r := 0; WHILE r < Rounds DO - d := 0; - WHILE d < Dim DO - EvalPolynom(data.num[r][d], res.numerator[r][d]); - INC(d); - END; - EvalPolynom(data.denom[r], res.denominator[r]); - INC(r); + d := 0; + WHILE d < Dim DO + EvalPolynom(data.num[r][d], res.numerator[r][d]); + INC(d); + END; + EvalPolynom(data.denom[r], res.denominator[r]); + INC(r); END; RETURN res; END EvaluatePhi; @@ -1125,12 +1127,12 @@ MODULE ulmTCrypt; (* Michael Szczuka *) PROCEDURE EvaluatePsi (arg: TCryptTmp; data: Psi) : TCryptRes; (* evalute the private function psi *) VAR - res : TCryptRes; - mat, prev : MatCCM; - num, denom, inv : CCMElement; - vek : VektorCCM; - A : ChainCCM; - r, d : SHORTINT; + res : TCryptRes; + mat, prev : MatCCM; + num, denom, inv : CCMElement; + vek : VektorCCM; + A : ChainCCM; + r, d : SHORTINT; BEGIN (* first correct the input with the correlating inverts *) MulCCM(arg.denominator[0], data.korrDenom[0], denom); @@ -1143,28 +1145,28 @@ MODULE ulmTCrypt; (* Michael Szczuka *) prev := data.initialmatrix; r := 1; WHILE r < Rounds DO - (* the matrix for the current round of the recursion must be computed - each round *) - BuildMatrix(mat, prev, A[r-1]); - prev := mat; - MulCCM(arg.denominator[r], data.korrDenom[r], denom); - PowerCCM(denom, M-1, inv); - MulCCM(arg.numerator[r][0], data.korrNum[r][0], num); - MulCCM(num, inv, vek[0]); - MulCCM(arg.numerator[r][1], data.korrNum[r][1], num); - MulCCM(num, inv, vek[1]); - MulMatrix(mat, vek, A[r]); - INC(r); + (* the matrix for the current round of the recursion must be computed + each round *) + BuildMatrix(mat, prev, A[r-1]); + prev := mat; + MulCCM(arg.denominator[r], data.korrDenom[r], denom); + PowerCCM(denom, M-1, inv); + MulCCM(arg.numerator[r][0], data.korrNum[r][0], num); + MulCCM(num, inv, vek[0]); + MulCCM(arg.numerator[r][1], data.korrNum[r][1], num); + MulCCM(num, inv, vek[1]); + MulMatrix(mat, vek, A[r]); + INC(r); END; NEW(res); r := 0; WHILE r < LastRounds DO - d := 0; - WHILE d < Dim DO - res.arg[r][d] := A[Rounds-LastRounds+r][d]; - INC(d); - END; - INC(r); + d := 0; + WHILE d < Dim DO + res.arg[r][d] := A[Rounds-LastRounds+r][d]; + INC(d); + END; + INC(r); END; RETURN res; END EvaluatePsi; @@ -1172,19 +1174,19 @@ MODULE ulmTCrypt; (* Michael Szczuka *) PROCEDURE EvaluateEta (arg: TCryptInput; data: Eta) : TCryptRes; (* evaluate the public function eta (composition of phi and psi) *) VAR - l, d : SHORTINT; - res : TCryptRes; + l, d : SHORTINT; + res : TCryptRes; BEGIN NEW(res); PreComputeArgs(arg); l := 0; WHILE l < LastRounds DO - d := 0; - WHILE d < Dim DO - EvalPolynom(data.p[l][d], res.arg[l][d]); - INC(d); - END; - INC(l); + d := 0; + WHILE d < Dim DO + EvalPolynom(data.p[l][d], res.arg[l][d]); + INC(d); + END; + INC(l); END; RETURN res; END EvaluateEta; @@ -1192,191 +1194,191 @@ MODULE ulmTCrypt; (* Michael Szczuka *) PROCEDURE Eof (s: Streams.Stream) : BOOLEAN; (* returns TRUE if no bytes are left to read from stream s *) VAR - b : SYS.BYTE; + b : SYS.BYTE; BEGIN RETURN ~Streams.ReadByte(s, b) OR ~Streams.Back(s); END Eof; PROCEDURE Encrypt (msg: Streams.Stream; key: Ciphers.Cipher; - length: INTEGER; s: Streams.Stream) : BOOLEAN; + length: INTEGER; s: Streams.Stream) : BOOLEAN; (* interface procedure for Ciphers.Encrypt *) VAR - i, j : SHORTINT; - ccmarg : TCryptInput; - ccmres : TCryptTmp; - wholeStream : BOOLEAN; + i, j : SHORTINT; + ccmarg : TCryptInput; + ccmres : TCryptTmp; + wholeStream : BOOLEAN; BEGIN (* check if the whole stream msg shall be encrypted or only a certain - amount of bytes *) + amount of bytes *) IF length <= 0 THEN - wholeStream := TRUE; + wholeStream := TRUE; ELSE - wholeStream := FALSE + wholeStream := FALSE END; NEW(ccmarg); WHILE ~Eof(msg) & (wholeStream OR (length > 0)) DO - i := 0; - WHILE i < MaxVar DO - IF ~NetIO.ReadSet(msg, ccmarg.arg[i]) THEN - Error(msg, readSetFailed); - RETURN FALSE; - END; - IF ~RegulaerCCM(ccmarg.arg[i]) THEN - Error(msg, notRegular); - RETURN FALSE; - END; - INC(i); - END; - IF key IS PublicCipher THEN - ccmres := EvaluatePhi(ccmarg, key(PublicCipher).phi); - ELSE - ccmres := EvaluatePhi(ccmarg, key(PrivateCipher).phi); - END; - i := 0; - WHILE i < Rounds DO - j := 0; - WHILE j < Dim DO - IF ~NetIO.WriteSet(s, ccmres.numerator[i][j]) THEN - Error(s, writeSetFailed); - RETURN FALSE; - END; - INC(j); - END; - IF ~NetIO.WriteSet(s, ccmres.denominator[i]) THEN - Error(s, writeSetFailed); - RETURN FALSE; - END; - INC(i); - END; - DEC(length, MaxVar*(M DIV 8)); + i := 0; + WHILE i < MaxVar DO + IF ~NetIO.ReadSet(msg, ccmarg.arg[i]) THEN + Error(msg, readSetFailed); + RETURN FALSE; + END; + IF ~RegulaerCCM(ccmarg.arg[i]) THEN + Error(msg, notRegular); + RETURN FALSE; + END; + INC(i); + END; + IF key IS PublicCipher THEN + ccmres := EvaluatePhi(ccmarg, key(PublicCipher).phi); + ELSE + ccmres := EvaluatePhi(ccmarg, key(PrivateCipher).phi); + END; + i := 0; + WHILE i < Rounds DO + j := 0; + WHILE j < Dim DO + IF ~NetIO.WriteSet(s, ccmres.numerator[i][j]) THEN + Error(s, writeSetFailed); + RETURN FALSE; + END; + INC(j); + END; + IF ~NetIO.WriteSet(s, ccmres.denominator[i]) THEN + Error(s, writeSetFailed); + RETURN FALSE; + END; + INC(i); + END; + DEC(length, MaxVar*(M DIV 8)); END; RETURN TRUE; END Encrypt; PROCEDURE Decrypt (msg: Streams.Stream; key: Ciphers.Cipher; - length: INTEGER; s: Streams.Stream) : BOOLEAN; + length: INTEGER; s: Streams.Stream) : BOOLEAN; (* interface procedure for Ciphers.Decrypt *) VAR - i, j : SHORTINT; - inNum, inDenom, out : ARRAY (M DIV 8) OF SYS.BYTE; - ccmarg : TCryptTmp; - ccmres : TCryptRes; - wholeStream : BOOLEAN; + i, j : SHORTINT; + inNum, inDenom, out : ARRAY (M DIV 8) OF SYS.BYTE; + ccmarg : TCryptTmp; + ccmres : TCryptRes; + wholeStream : BOOLEAN; BEGIN IF length < 0 THEN - wholeStream := TRUE; + wholeStream := TRUE; ELSE - wholeStream := FALSE; + wholeStream := FALSE; END; WITH key:PrivateCipher DO - NEW(ccmarg); - WHILE ~Eof(msg) & (wholeStream OR (length > 0)) DO - i := 0; - WHILE i < Rounds DO - j := 0; - WHILE j < Dim DO - IF ~NetIO.ReadSet(msg, ccmarg.numerator[i][j]) THEN - Error(msg, readSetFailed); - RETURN FALSE; - END; - INC(j); - END; - IF ~NetIO.ReadSet(msg, ccmarg.denominator[i]) THEN - Error(msg, readSetFailed); - RETURN FALSE; - END; - INC(i); - END; - ccmres := EvaluatePsi(ccmarg, key.psi); - i := 0; - WHILE i < LastRounds DO - j := 0; - WHILE j < Dim DO - IF ~NetIO.WriteSet(s, ccmres.arg[i][j]) THEN - Error(s, writeSetFailed); - RETURN FALSE; - END; - INC(j); - END; - INC(i); - END; - DEC (length, Rounds*Dim*(M DIV 8)); - END; + NEW(ccmarg); + WHILE ~Eof(msg) & (wholeStream OR (length > 0)) DO + i := 0; + WHILE i < Rounds DO + j := 0; + WHILE j < Dim DO + IF ~NetIO.ReadSet(msg, ccmarg.numerator[i][j]) THEN + Error(msg, readSetFailed); + RETURN FALSE; + END; + INC(j); + END; + IF ~NetIO.ReadSet(msg, ccmarg.denominator[i]) THEN + Error(msg, readSetFailed); + RETURN FALSE; + END; + INC(i); + END; + ccmres := EvaluatePsi(ccmarg, key.psi); + i := 0; + WHILE i < LastRounds DO + j := 0; + WHILE j < Dim DO + IF ~NetIO.WriteSet(s, ccmres.arg[i][j]) THEN + Error(s, writeSetFailed); + RETURN FALSE; + END; + INC(j); + END; + INC(i); + END; + DEC (length, Rounds*Dim*(M DIV 8)); + END; END; RETURN TRUE; END Decrypt; PROCEDURE ComposedEncrypt (msg: Streams.Stream; key: Ciphers.Cipher; - length: INTEGER; s: Streams.Stream) : BOOLEAN; + length: INTEGER; s: Streams.Stream) : BOOLEAN; (* interface procedure for AsymmetricCiphers.ComposedEncrypt *) VAR - i, j : SHORTINT; - ccmarg : TCryptInput; - ccmres : TCryptRes; - in, out : ARRAY (M DIV 8) OF SYS.BYTE; - wholeStream : BOOLEAN; + i, j : SHORTINT; + ccmarg : TCryptInput; + ccmres : TCryptRes; + in, out : ARRAY (M DIV 8) OF SYS.BYTE; + wholeStream : BOOLEAN; BEGIN IF length < 0 THEN - wholeStream := TRUE; + wholeStream := TRUE; ELSE - wholeStream := FALSE; + wholeStream := FALSE; END; NEW(ccmarg); WHILE ~Eof(msg) & (wholeStream OR (length > 0)) DO - i := 0; - WHILE i < MaxVar DO - IF ~NetIO.ReadSet(msg, ccmarg.arg[i]) THEN - Error(msg, readSetFailed); - RETURN FALSE; - END; - INC(i); - END; - IF key IS PublicCipher THEN - ccmres := EvaluateEta(ccmarg, key(PublicCipher).eta); - ELSE - ccmres := EvaluateEta(ccmarg, key(PrivateCipher).eta); - END; - i := 0; - WHILE i < LastRounds DO - j := 0; - WHILE j < Dim DO - IF ~NetIO.WriteSet(s, ccmres.arg[i][j]) THEN - Error(s, writeSetFailed); - RETURN FALSE; - END; - INC(j); - END; - INC(i); - END; - DEC (length, MaxVar*(M DIV 8)); + i := 0; + WHILE i < MaxVar DO + IF ~NetIO.ReadSet(msg, ccmarg.arg[i]) THEN + Error(msg, readSetFailed); + RETURN FALSE; + END; + INC(i); + END; + IF key IS PublicCipher THEN + ccmres := EvaluateEta(ccmarg, key(PublicCipher).eta); + ELSE + ccmres := EvaluateEta(ccmarg, key(PrivateCipher).eta); + END; + i := 0; + WHILE i < LastRounds DO + j := 0; + WHILE j < Dim DO + IF ~NetIO.WriteSet(s, ccmres.arg[i][j]) THEN + Error(s, writeSetFailed); + RETURN FALSE; + END; + INC(j); + END; + INC(i); + END; + DEC (length, MaxVar*(M DIV 8)); END; RETURN TRUE; END ComposedEncrypt; PROCEDURE RandomStream (s: Streams.Stream); (* writes some random elements of CC(M) to the stream s which can then - be used as an input for Trautner's TCRYPT *) + be used as an input for Trautner's TCRYPT *) VAR - ccm : CCMElement; - bytes : ARRAY M DIV 8 OF SYS.BYTE; - i : INTEGER; + ccm : CCMElement; + bytes : ARRAY M DIV 8 OF SYS.BYTE; + i : INTEGER; BEGIN i := 0; WHILE i < MaxVar DO - CreateCCM(ccm, reg); - IF ~NetIO.WriteSet(s, ccm) THEN - Error(s, writeSetFailed); - END; - INC(i); + CreateCCM(ccm, reg); + IF ~NetIO.WriteSet(s, ccm) THEN + Error(s, writeSetFailed); + END; + INC(i); END; END RandomStream; PROCEDURE PublicCipherCreate (VAR obj: PersistentObjects.Object); (* constructor for a public cipher *) VAR - pub : PublicCipher; - if : AsymmetricCiphers.Interface; - caps : AsymmetricCiphers.CapabilitySet; + pub : PublicCipher; + if : AsymmetricCiphers.Interface; + caps : AsymmetricCiphers.CapabilitySet; BEGIN NEW(pub); NEW(pub.phi); NEW(pub.eta); PersistentObjects.Init(pub, pubType); @@ -1389,25 +1391,25 @@ MODULE ulmTCrypt; (* Michael Szczuka *) END PublicCipherCreate; PROCEDURE Split (VAR public: AsymmetricCiphers.Cipher; - key: AsymmetricCiphers.Cipher); + key: AsymmetricCiphers.Cipher); (* interface procedure for asymmetric interface *) VAR - pub: PublicCipher; + pub: PublicCipher; BEGIN WITH key:PrivateCipher DO - PublicCipherCreate(SYS.VAL(PersistentObjects.Object, pub)); - pub.phi := key.phi; - pub.eta := key.eta; - public := pub; + PublicCipherCreate(SYS.VAL(PersistentObjects.Object, pub)); + pub.phi := key.phi; + pub.eta := key.eta; + public := pub; END; END Split; PROCEDURE CipherCreate (VAR obj: PersistentObjects.Object); (* constructor for a private cipher *) VAR - key : PrivateCipher; - if : AsymmetricCiphers.Interface; - caps : AsymmetricCiphers.CapabilitySet; + key : PrivateCipher; + if : AsymmetricCiphers.Interface; + caps : AsymmetricCiphers.CapabilitySet; BEGIN NEW(key); NEW(key.phi); NEW(key.psi); NEW(key.eta); PersistentObjects.Init(key, privType); @@ -1422,10 +1424,10 @@ MODULE ulmTCrypt; (* Michael Szczuka *) PROCEDURE Create* (VAR key: Ciphers.Cipher); (* creates a cipher for the use with Trautner's TCRYPT algorithm *) VAR - tmpKey : PrivateCipher; - phi : Phi; - psi : Psi; - eta : Eta; + tmpKey : PrivateCipher; + phi : Phi; + psi : Psi; + eta : Eta; BEGIN CipherCreate(SYS.VAL(PersistentObjects.Object, tmpKey)); CreateMaps(tmpKey.phi, tmpKey.psi, tmpKey.eta); @@ -1435,28 +1437,28 @@ MODULE ulmTCrypt; (* Michael Szczuka *) PROCEDURE WritePolynom (s: Streams.Stream; p: Polynom) : BOOLEAN; (* writes the polynomial p onto the stream s *) CONST - index = M DIV 8; + index = M DIV 8; VAR - nrOfTerms, i : INTEGER; - bytes : ARRAY index OF SYS.BYTE; + nrOfTerms, i : INTEGER; + bytes : ARRAY index OF SYS.BYTE; BEGIN nrOfTerms := LengthPolynom(p); IF ~NetIO.WriteInteger(s, nrOfTerms) THEN - RETURN FALSE; + RETURN FALSE; END; WHILE nrOfTerms > 0 DO - IF ~NetIO.WriteSet(s, p.koeff) THEN - RETURN FALSE; - END; - i := 0; - WHILE i < MaxVar DO - IF ~NetIO.WriteShortInt(s, p.exp[i]) THEN - RETURN FALSE; - END; - INC(i); - END; - p := p.next; - DEC(nrOfTerms); + IF ~NetIO.WriteSet(s, p.koeff) THEN + RETURN FALSE; + END; + i := 0; + WHILE i < MaxVar DO + IF ~NetIO.WriteShortInt(s, p.exp[i]) THEN + RETURN FALSE; + END; + INC(i); + END; + p := p.next; + DEC(nrOfTerms); END; RETURN TRUE; END WritePolynom; @@ -1464,33 +1466,33 @@ MODULE ulmTCrypt; (* Michael Szczuka *) PROCEDURE ReadPolynom (s: Streams.Stream; VAR p: Polynom) : BOOLEAN; (* reads a polynomial from stream s *) CONST - index = M DIV 8; + index = M DIV 8; VAR - nrOfTerms, i : INTEGER; - pol : Polynom; - bytes : ARRAY index OF SYS.BYTE; + nrOfTerms, i : INTEGER; + pol : Polynom; + bytes : ARRAY index OF SYS.BYTE; BEGIN IF ~NetIO.ReadInteger(s, nrOfTerms) THEN - RETURN FALSE; + RETURN FALSE; END; NEW(p); pol := p; WHILE nrOfTerms > 0 DO - IF ~NetIO.ReadSet(s, pol.koeff) THEN - RETURN FALSE; - END; - i := 0; - WHILE i < MaxVar DO - IF ~NetIO.ReadShortInt(s, pol.exp[i]) THEN - RETURN FALSE; - END; - INC(i); - END; - DEC(nrOfTerms); - IF nrOfTerms > 0 THEN - NEW(pol.next); - pol := pol.next; - END + IF ~NetIO.ReadSet(s, pol.koeff) THEN + RETURN FALSE; + END; + i := 0; + WHILE i < MaxVar DO + IF ~NetIO.ReadShortInt(s, pol.exp[i]) THEN + RETURN FALSE; + END; + INC(i); + END; + DEC(nrOfTerms); + IF nrOfTerms > 0 THEN + NEW(pol.next); + pol := pol.next; + END END; RETURN TRUE; END ReadPolynom; @@ -1498,21 +1500,21 @@ MODULE ulmTCrypt; (* Michael Szczuka *) PROCEDURE PhiWrite (s: Streams.Stream; data: Phi) : BOOLEAN; (* writes the data structure for the public function phi onto a stream *) VAR - r, d, k : INTEGER; + r, d, k : INTEGER; BEGIN r := 0; WHILE r < Rounds DO - d := 0; - WHILE d < Dim DO - IF ~WritePolynom(s, data.num[r][d]) THEN - RETURN FALSE; - END; - INC(d); - END; - IF ~WritePolynom(s, data.denom[r]) THEN - RETURN FALSE; - END; - INC(r); + d := 0; + WHILE d < Dim DO + IF ~WritePolynom(s, data.num[r][d]) THEN + RETURN FALSE; + END; + INC(d); + END; + IF ~WritePolynom(s, data.denom[r]) THEN + RETURN FALSE; + END; + INC(r); END; RETURN TRUE; END PhiWrite; @@ -1520,22 +1522,22 @@ MODULE ulmTCrypt; (* Michael Szczuka *) PROCEDURE PhiRead (s: Streams.Stream; VAR data: Phi) : BOOLEAN; (* reads the data structure for the public function phi from a stream *) VAR - r, d, k : INTEGER; + r, d, k : INTEGER; BEGIN NEW(data); r := 0; WHILE r < Rounds DO - d := 0; - WHILE d < Dim DO - IF ~ReadPolynom(s, data.num[r][d]) THEN - RETURN FALSE; - END; - INC(d); - END; - IF ~ReadPolynom(s, data.denom[r]) THEN - RETURN FALSE; - END; - INC(r); + d := 0; + WHILE d < Dim DO + IF ~ReadPolynom(s, data.num[r][d]) THEN + RETURN FALSE; + END; + INC(d); + END; + IF ~ReadPolynom(s, data.denom[r]) THEN + RETURN FALSE; + END; + INC(r); END; RETURN TRUE; END PhiRead; @@ -1543,35 +1545,35 @@ MODULE ulmTCrypt; (* Michael Szczuka *) PROCEDURE PsiWrite (s: Streams.Stream; data: Psi) : BOOLEAN; (* writes the data structure for the private function psi onto a stream *) CONST - index = M DIV 8; + index = M DIV 8; VAR - dx, dy, r, d : INTEGER; - bytes : ARRAY index OF SYS.BYTE; + dx, dy, r, d : INTEGER; + bytes : ARRAY index OF SYS.BYTE; BEGIN dy := 0; WHILE dy < Dim DO - dx := 0; - WHILE dx < Dim DO - IF ~NetIO.WriteSet(s, data.initialmatrix[dy][dx]) THEN - RETURN FALSE; - END; - INC(dx); - END; - INC(dy); + dx := 0; + WHILE dx < Dim DO + IF ~NetIO.WriteSet(s, data.initialmatrix[dy][dx]) THEN + RETURN FALSE; + END; + INC(dx); + END; + INC(dy); END; r := 0; WHILE r < Rounds DO - d := 0; - WHILE d < Dim DO - IF ~NetIO.WriteSet(s, data.korrNum[r][d]) THEN - RETURN FALSE; - END; - INC(d); - END; - IF ~NetIO.WriteSet(s, data.korrDenom[r]) THEN - RETURN FALSE; - END; - INC(r); + d := 0; + WHILE d < Dim DO + IF ~NetIO.WriteSet(s, data.korrNum[r][d]) THEN + RETURN FALSE; + END; + INC(d); + END; + IF ~NetIO.WriteSet(s, data.korrDenom[r]) THEN + RETURN FALSE; + END; + INC(r); END; RETURN TRUE; END PsiWrite; @@ -1579,35 +1581,35 @@ MODULE ulmTCrypt; (* Michael Szczuka *) PROCEDURE PsiRead (s: Streams.Stream; VAR data: Psi) : BOOLEAN; (* reads the data structure for the private function psi from a stream *) CONST - index = M DIV 8; + index = M DIV 8; VAR - dy, dx, r, d : INTEGER; - bytes : ARRAY index OF SYS.BYTE; + dy, dx, r, d : INTEGER; + bytes : ARRAY index OF SYS.BYTE; BEGIN dy := 0; WHILE dy < Dim DO - dx := 0; - WHILE dx < Dim DO - IF ~NetIO.ReadSet(s, data.initialmatrix[dy][dx]) THEN - RETURN FALSE; - END; - INC(dx); - END; - INC(dy); + dx := 0; + WHILE dx < Dim DO + IF ~NetIO.ReadSet(s, data.initialmatrix[dy][dx]) THEN + RETURN FALSE; + END; + INC(dx); + END; + INC(dy); END; r := 0; WHILE r < Rounds DO - d := 0; - WHILE d < Dim DO - IF ~NetIO.ReadSet(s, data.korrNum[r][d]) THEN - RETURN FALSE; - END; - INC(d); - END; - IF ~NetIO.ReadSet(s, data.korrDenom[r]) THEN - RETURN FALSE; - END; - INC(r); + d := 0; + WHILE d < Dim DO + IF ~NetIO.ReadSet(s, data.korrNum[r][d]) THEN + RETURN FALSE; + END; + INC(d); + END; + IF ~NetIO.ReadSet(s, data.korrDenom[r]) THEN + RETURN FALSE; + END; + INC(r); END; RETURN TRUE; END PsiRead; @@ -1615,18 +1617,18 @@ MODULE ulmTCrypt; (* Michael Szczuka *) PROCEDURE EtaWrite (s: Streams.Stream; data: Eta) : BOOLEAN; (* writes the data structure for the public function eta onto a stream *) VAR - l, d : INTEGER; + l, d : INTEGER; BEGIN l := 0; WHILE l < LastRounds DO - d := 0; - WHILE d < Dim DO - IF ~WritePolynom(s, data.p[l][d]) THEN - RETURN FALSE; - END; - INC(d); - END; - INC(l); + d := 0; + WHILE d < Dim DO + IF ~WritePolynom(s, data.p[l][d]) THEN + RETURN FALSE; + END; + INC(d); + END; + INC(l); END; RETURN TRUE; END EtaWrite; @@ -1634,19 +1636,19 @@ MODULE ulmTCrypt; (* Michael Szczuka *) PROCEDURE EtaRead (s: Streams.Stream; VAR data: Eta) : BOOLEAN; (* reads the data structure for the public function eta from a stream *) VAR - l, d : INTEGER; + l, d : INTEGER; BEGIN NEW(data); l := 0; WHILE l < LastRounds DO - d := 0; - WHILE d < Dim DO - IF ~ReadPolynom(s, data.p[l][d]) THEN - RETURN FALSE; - END; - INC(d); - END; - INC(l); + d := 0; + WHILE d < Dim DO + IF ~ReadPolynom(s, data.p[l][d]) THEN + RETURN FALSE; + END; + INC(d); + END; + INC(l); END; RETURN TRUE; END EtaRead; @@ -1656,7 +1658,7 @@ MODULE ulmTCrypt; (* Michael Szczuka *) (* interface procedure for PersistentObjects *) BEGIN WITH obj:PublicCipher DO - RETURN PhiWrite(s, obj.phi) & EtaWrite(s, obj.eta); + RETURN PhiWrite(s, obj.phi) & EtaWrite(s, obj.eta); END; END PubWrite; @@ -1665,9 +1667,9 @@ MODULE ulmTCrypt; (* Michael Szczuka *) (* interface procedure for PersistentObjects *) BEGIN WITH obj:PrivateCipher DO - RETURN PhiWrite(s, obj.phi) & - PsiWrite(s, obj.psi) & - EtaWrite(s, obj.eta); + RETURN PhiWrite(s, obj.phi) & + PsiWrite(s, obj.psi) & + EtaWrite(s, obj.eta); END; END CipherWrite; @@ -1676,23 +1678,23 @@ MODULE ulmTCrypt; (* Michael Szczuka *) (* interface procedure for PersistentObjects *) BEGIN WITH obj:PublicCipher DO - IF ~PhiRead(s, obj.phi) OR ~EtaRead(s, obj.eta) THEN - RETURN FALSE; - END; + IF ~PhiRead(s, obj.phi) OR ~EtaRead(s, obj.eta) THEN + RETURN FALSE; + END; END; RETURN TRUE; END PubRead; PROCEDURE CipherRead (s: Streams.Stream; - obj: PersistentObjects.Object) : BOOLEAN; + obj: PersistentObjects.Object) : BOOLEAN; (* interface procedure for PersistentObjects *) BEGIN WITH obj:PrivateCipher DO - IF ~PhiRead(s, obj.phi) OR - ~PsiRead(s, obj.psi) OR - ~EtaRead(s, obj.eta) THEN - RETURN FALSE; - END; + IF ~PhiRead(s, obj.phi) OR + ~PsiRead(s, obj.psi) OR + ~EtaRead(s, obj.eta) THEN + RETURN FALSE; + END; END; RETURN TRUE; END CipherRead; @@ -1724,15 +1726,15 @@ BEGIN (* init of the zero polynomial *) NEW(NullPolynom); - NullPolynom.koeff := NullCCM; (* Koeffizient = Null *) - NullPolynom.exp := NullExp; (* alle Exponenten = Null *) - NullPolynom.next := NIL; (* nur ein Term *) + NullPolynom.koeff := NullCCM; (* Koeffizient = Null *) + NullPolynom.exp := NullExp; (* alle Exponenten = Null *) + NullPolynom.next := NIL; (* nur ein Term *) k := 0; WHILE k < M DO NEW(PreEvalArg[k]); IF k < MaxVar THEN - PreEvalArg[0].arg[k] := EinsCCM; + PreEvalArg[0].arg[k] := EinsCCM; END; INC(k); END; @@ -1740,7 +1742,7 @@ BEGIN (* no interface needed for cipherType since it serves only as a common type for public and private ciphers *) PersistentObjects.RegisterType(cipherType, "TCrypt.Cipher", - "AsymmetricCiphers.Cipher", NIL); + "AsymmetricCiphers.Cipher", NIL); NEW(pubIf); pubIf.create := PublicCipherCreate; @@ -1748,7 +1750,7 @@ BEGIN pubIf.read := PubRead; pubIf.createAndRead := NIL; PersistentObjects.RegisterType(pubType, "TCrypt.PublicCipher", - "TCrypt.Cipher", pubIf); + "TCrypt.Cipher", pubIf); NEW(privIf); privIf.create := CipherCreate; @@ -1756,7 +1758,7 @@ BEGIN privIf.read := CipherRead; privIf.createAndRead := NIL; PersistentObjects.RegisterType(privType, "TCrypt.PrivateCipher", - "TCrypt.Cipher", privIf); + "TCrypt.Cipher", privIf); InitErrorHandling; END ulmTCrypt. diff --git a/src/library/ulm/ulmTexts.Mod b/src/library/ulm/ulmTexts.Mod index a4214fcd..76590258 100644 --- a/src/library/ulm/ulmTexts.Mod +++ b/src/library/ulm/ulmTexts.Mod @@ -229,6 +229,7 @@ MODULE ulmTexts; | Streams.fromStart: pos := count; | Streams.fromPos: pos := count + s.pos; | Streams.fromEnd: pos := count + s.len; + ELSE END; IF (pos >= 0) & (pos <= s.len) THEN s.pos := pos; diff --git a/src/library/ulm/ulmTimes.Mod b/src/library/ulm/ulmTimes.Mod index 00f0cd0c..e7dc122f 100644 --- a/src/library/ulm/ulmTimes.Mod +++ b/src/library/ulm/ulmTimes.Mod @@ -200,6 +200,7 @@ MODULE ulmTimes; | epochUnit: value := measure.timeval.epoch; | secondUnit: value := measure.timeval.second; | usecUnit: value := measure.timeval.usec; + ELSE END; END; END; END InternalGetValue; @@ -212,6 +213,7 @@ MODULE ulmTimes; | epochUnit: measure.timeval.epoch := value; | secondUnit: measure.timeval.second := value; | usecUnit: measure.timeval.usec := value; + ELSE END; Normalize(measure.timeval); END; END; @@ -274,6 +276,7 @@ MODULE ulmTimes; CASE op OF | Scales.add: Add(op1.timeval, op2.timeval, result.timeval); | Scales.sub: Sub(op1.timeval, op2.timeval, result.timeval); + ELSE END; END; END; END; @@ -283,25 +286,28 @@ MODULE ulmTimes; PROCEDURE ReturnVal(val1, val2: Scales.Value) : INTEGER; BEGIN - IF val1 < val2 THEN - RETURN -1 - ELSIF val1 > val2 THEN - RETURN 1 - ELSE - RETURN 0 - END; + IF val1 < val2 THEN + RETURN -1 + ELSIF val1 > val2 THEN + RETURN 1 + ELSE + RETURN 0 + END; END ReturnVal; BEGIN - WITH op1: ReferenceTime DO WITH op2: ReferenceTime DO - IF op1.timeval.epoch # op2.timeval.epoch THEN - RETURN ReturnVal(op1.timeval.epoch, op2.timeval.epoch) - ELSIF op1.timeval.second # op2.timeval.second THEN - RETURN ReturnVal(op1.timeval.second, op2.timeval.second) - ELSE - RETURN ReturnVal(op1.timeval.usec, op2.timeval.usec) - END; - END; END; + WITH op1: ReferenceTime DO + WITH op2: ReferenceTime DO + IF op1.timeval.epoch # op2.timeval.epoch THEN + RETURN ReturnVal(op1.timeval.epoch, op2.timeval.epoch) + ELSIF op1.timeval.second # op2.timeval.second THEN + RETURN ReturnVal(op1.timeval.second, op2.timeval.second) + ELSE + RETURN ReturnVal(op1.timeval.usec, op2.timeval.usec) + END; + END; + END; + RETURN 0; END Compare; (* ========= initialization procedures ========================== *) diff --git a/src/library/ulm/ulmTypes.Mod b/src/library/ulm/ulmTypes.Mod index d46a2c63..c9d6f4fe 100644 --- a/src/library/ulm/ulmTypes.Mod +++ b/src/library/ulm/ulmTypes.Mod @@ -50,34 +50,32 @@ MODULE ulmTypes; IMPORT SYS := SYSTEM; TYPE - Address* = (*SYS.PTR*) LONGINT (*SYS.ADDRESS*); + Address* = LONGINT (*SYS.ADDRESS*); (* ulm compiler can accept VAR p : SYSTEM.ADDRESS; // SYSTEM.PTR in ETH and V4 versions - ... - p := SYSTEM.ADR(something); - and this is how it is used in ulm oberon system library, - while SYSTEM.ADR returns LONGINT in ETH and V4 versions. - Thus I leave it as LONGINT for now, before coming up with better solution -- noch *) - UntracedAddress* = POINTER[1] TO UntracedAddressDesc; (*SYS.UNTRACEDADDRESS;*) + ... + p := SYSTEM.ADR(something); + and this is how it is used in ulm oberon system library, + while SYSTEM.ADR returns LONGINT in ETH and V4 versions. + Thus I leave it as LONGINT for now, before coming up with better solution -- noch *) + + UntracedAddress* = POINTER[1] TO UntracedAddressDesc; (*SYS.UNTRACEDADDRESS;*) UntracedAddressDesc* = RECORD[1] END; - - intarr64 = ARRAY 8 OF SYS.BYTE; (* to emulate int16 on x86_64; -- noch *) - intarr16 = ARRAY 2 OF SYS.BYTE; - - Count* = LONGINT; - Size* = Count; - Byte* = SYS.BYTE; + + Count* = LONGINT; + Size* = Count; + Byte* = SYS.BYTE; IntAddress* = LONGINT; - Int8* = SHORTINT; - Int16* = intarr16(*INTEGER*); (* we don't have 16 bit integer in x86_64 version of voc *) - Int32* = INTEGER; - Real32* = REAL; - Real64* = LONGREAL; + Int8* = SHORTINT; + Int16* = INTEGER; (* No real 16 bit integer type *) + Int32* = INTEGER; + Real32* = REAL; + Real64* = LONGREAL; CONST - bigEndian* = 0; (* SPARC, M68K etc *) + bigEndian* = 0; (* SPARC, M68K etc *) littleEndian* = 1; (* Intel 80x86, VAX etc *) - byteorder* = littleEndian; (* machine-dependent constant *) + byteorder* = littleEndian; (* machine-dependent constant *) TYPE ByteOrder* = SHORTINT; (* bigEndian or littleEndian *) @@ -93,21 +91,17 @@ MODULE ulmTypes; PROCEDURE ToInt8*(int: LONGINT) : Int8; BEGIN - RETURN SHORT(SHORT(int)) + RETURN SYS.VAL(SHORTINT, int) END ToInt8; - PROCEDURE ToInt16*(int: LONGINT; VAR int16: Int16)(* : Int16*); - VAR longintarr : intarr64; + PROCEDURE ToInt16*(int: LONGINT) : Int16; BEGIN - (*RETURN SYS.VAL(Int16, int)*) - longintarr := SYS.VAL(intarr64, int); - int16[0] := longintarr[0]; - int16[1] := longintarr[1]; (* this will work for little endian -- noch *) + RETURN SYS.VAL(Int16, int) END ToInt16; PROCEDURE ToInt32*(int: LONGINT) : Int32; BEGIN - RETURN SHORT(int) + RETURN SYS.VAL(INTEGER, int) END ToInt32; PROCEDURE ToReal32*(real: LONGREAL) : Real32; diff --git a/src/library/v4/Args.Mod b/src/library/v4/Args.Mod index 2c0d25b5..0d4ff925 100644 --- a/src/library/v4/Args.Mod +++ b/src/library/v4/Args.Mod @@ -3,63 +3,29 @@ MODULE Args; (* jt, 8.12.94 *) (* command line argument handling for voc (jet backend) *) - IMPORT SYSTEM; - + IMPORT Platform; + TYPE ArgPtr = POINTER TO ARRAY 1024 OF CHAR; ArgVec = POINTER TO ARRAY 1024 OF ArgPtr; - VAR argc-: INTEGER; argv-: LONGINT; - (*PROCEDURE -includestdlib() "#include ";*) - PROCEDURE -externgetenv() "extern char *getenv(const char *name);"; (* took this from stdlib.h*) - PROCEDURE -Argc(): INTEGER "SYSTEM_argc"; - PROCEDURE -Argv(): LONGINT "(long)SYSTEM_argv"; - PROCEDURE -getenv(var: ARRAY OF CHAR): ArgPtr - "(Args_ArgPtr)getenv(var)"; + VAR + argc-: LONGINT; + argv-: LONGINT; - PROCEDURE Get*(n: INTEGER; VAR val: ARRAY OF CHAR); - VAR av: ArgVec; - BEGIN - IF n < argc THEN av := SYSTEM.VAL(ArgVec, argv); COPY(av[n]^, val) END - END Get; - PROCEDURE GetInt*(n: INTEGER; VAR val: LONGINT); - VAR s: ARRAY 64 OF CHAR; k, d, i: LONGINT; - BEGIN - s := ""; Get(n, s); i := 0; - IF s[0] = "-" THEN i := 1 END ; - k := 0; d := ORD(s[i]) - ORD("0"); - WHILE (d >= 0 ) & (d <= 9) DO k := k*10 + d; INC(i); d := ORD(s[i]) - ORD("0") END ; - IF s[0] = "-" THEN d := -d; DEC(i) END ; - IF i > 0 THEN val := k END - END GetInt; +PROCEDURE Get* (n: INTEGER; VAR val: ARRAY OF CHAR); BEGIN Platform.GetArg(n, val) END Get; +PROCEDURE GetInt*(n: INTEGER; VAR val: LONGINT); BEGIN Platform.GetIntArg(n, val) END GetInt; +PROCEDURE Pos* (s: ARRAY OF CHAR): INTEGER; BEGIN RETURN Platform.ArgPos(s) END Pos; - PROCEDURE Pos*(s: ARRAY OF CHAR): INTEGER; - VAR i: INTEGER; arg: ARRAY 256 OF CHAR; - BEGIN - i := 0; Get(i, arg); - WHILE (i < argc) & (s # arg) DO INC(i); Get(i, arg) END ; - RETURN i - END Pos; +PROCEDURE GetEnv*(var: ARRAY OF CHAR; VAR val: ARRAY OF CHAR); +BEGIN Platform.GetEnv(var, val) END GetEnv; - PROCEDURE GetEnv*(var: ARRAY OF CHAR; VAR val: ARRAY OF CHAR); - VAR p: ArgPtr; - BEGIN - p := getenv(var); - IF p # NIL THEN COPY(p^, val) END - END GetEnv; +PROCEDURE getEnv*(var: ARRAY OF CHAR; VAR val: ARRAY OF CHAR): BOOLEAN; +BEGIN RETURN Platform.getEnv(var, val) END getEnv; - PROCEDURE getEnv*(var: ARRAY OF CHAR; VAR val: ARRAY OF CHAR): BOOLEAN; - VAR p: ArgPtr; - BEGIN - p := getenv(var); - IF p # NIL THEN - COPY(p^, val); - RETURN TRUE - ELSE - RETURN FALSE - END - END getEnv; -BEGIN argc := Argc(); argv := Argv() +BEGIN + argc := Platform.ArgCount; + argv := Platform.ArgVector; END Args. diff --git a/src/library/v4/Modules.Mod b/src/library/v4/Modules.Mod index e73fefac..46c933f5 100644 --- a/src/library/v4/Modules.Mod +++ b/src/library/v4/Modules.Mod @@ -3,7 +3,7 @@ MODULE Modules; (* jt 6.1.96 *) (* access to list of modules and commands, based on ETH Oberon *) - IMPORT SYSTEM, Console; + IMPORT SYSTEM, Console, Heap; CONST ModNameLen* = 20; @@ -37,10 +37,10 @@ MODULE Modules; (* jt 6.1.96 *) PROCEDURE -modules*(): Module - "(Modules_Module)SYSTEM_modules"; + "(Modules_Module)Heap_modules"; PROCEDURE -setmodules*(m: Module) - "SYSTEM_modules = m"; + "Heap_modules = m"; PROCEDURE Append(VAR a: ARRAY OF CHAR; b: ARRAY OF CHAR); diff --git a/src/library/v4/Printer.Mod b/src/library/v4/Printer.Mod index 551db4bc..39b06c0c 100644 --- a/src/library/v4/Printer.Mod +++ b/src/library/v4/Printer.Mod @@ -1,6 +1,6 @@ MODULE Printer; (*UNIX version: JT 11.5.90, RC 2.7.93, JS 29.4.94, JT 14.4.95 *) - IMPORT SYSTEM, Files, Unix, Kernel; + IMPORT SYSTEM, Files, Platform; CONST N = 20; @@ -608,9 +608,6 @@ END; REPEAT ch := s2[j]; s1[i] := ch; INC(i); INC(j) UNTIL ch = 0X END Append; - PROCEDURE -system(cmd: ARRAY OF CHAR) - "system(cmd)"; - PROCEDURE Close*; CONST bufSize = 4*1024; VAR @@ -645,7 +642,7 @@ END; cmd := "lp -c -s "; IF PrinterName # "Pluto" THEN Append(cmd, "-d "); Append(cmd, PrinterName) END ; Append(cmd, " "); Append(cmd, printFileName); - system(cmd); + i := Platform.System(cmd); Files.Delete(printFileName, res); END; Files.Set(bodyR, NIL, 0); diff --git a/src/library/v4/Reals.Mod b/src/library/v4/Reals.Mod index e47d14ae..1c5bfb37 100644 --- a/src/library/v4/Reals.Mod +++ b/src/library/v4/Reals.Mod @@ -2,12 +2,9 @@ MODULE Reals; (* JT, 5.2.90 / RC 9.12.91 conversion between reals and strings for HP-700, MB 9.12.91, JT for Ofront, 16.3. 95*) IMPORT S := SYSTEM; -(* getting rid of ecvt -- noch - PROCEDURE -ecvt (x: LONGREAL; ndigit, decpt, sign: LONGINT): LONGINT - "(LONGINT)ecvt (x, ndigit, decpt, sign)"; -*) + PROCEDURE Ten*(e: INTEGER): REAL; - VAR r, power: LONGREAL; + VAR r, power: LONGREAL; BEGIN r := 1.0; power := 10.0; WHILE e > 0 DO @@ -17,6 +14,7 @@ MODULE Reals; RETURN SHORT(r) END Ten; + PROCEDURE TenL*(e: INTEGER): LONGREAL; VAR r, power: LONGREAL; BEGIN r := 1.0; @@ -29,166 +27,90 @@ MODULE Reals; END END TenL; + PROCEDURE Expo*(x: REAL): INTEGER; BEGIN - RETURN SHORT(ASH(S.VAL(LONGINT, x), -23) MOD 256) + RETURN SHORT(ASH(S.VAL(INTEGER, x), -23) MOD 256) END Expo; + PROCEDURE ExpoL*(x: LONGREAL): INTEGER; - VAR h: LONGINT; + VAR i: INTEGER; l: LONGINT; BEGIN - S.GET(S.ADR(x)+4, h); - RETURN SHORT(ASH(h, -20) MOD 2048) + IF SIZE(INTEGER) = 4 THEN + S.GET(S.ADR(x)+4, i); (* Fetch top 32 bits *) + RETURN SHORT(ASH(i, -20) MOD 2048) + ELSIF SIZE(LONGINT) = 4 THEN + S.GET(S.ADR(x)+4, l); (* Fetch top 32 bits *) + RETURN SHORT(ASH(l, -20) MOD 2048) + ELSE HALT(98) + END END ExpoL; - PROCEDURE SetExpo*(e: INTEGER; VAR x: REAL); - CONST expo = {1..8}; - BEGIN - x := S.VAL(REAL, S.VAL(SET, x) - expo + S.VAL(SET, ASH(LONG(e), 23))) - END SetExpo; - - PROCEDURE SetExpoL*(e: INTEGER; VAR x: LONGREAL); - CONST expo = {1..11}; - VAR h: SET; - BEGIN - S.GET(S.ADR(x)+4, h); - h := h - expo + S.VAL(SET, ASH(LONG(e), 20)); - S.PUT(S.ADR(x)+4, h) - END SetExpoL; - - PROCEDURE Reverse0 (VAR str : ARRAY OF CHAR; start, end : INTEGER); - (* Reverses order of characters in the interval [start..end]. *) - VAR - h : CHAR; - BEGIN - WHILE start < end DO - h := str[start]; str[start] := str[end]; str[end] := h; - INC(start); DEC(end) - END - END Reverse0; - (* these functions ⇅ necessary to get rid of ecvt -- noch *) - PROCEDURE IntToStr*(int: LONGINT; VAR str: ARRAY OF CHAR); - (* Converts the value of `int' to string form and copies the possibly truncated - result to `str'. *) - VAR - b : ARRAY 21 OF CHAR; - s, e: INTEGER; - maxLength : SHORTINT; (* maximum number of digits representing a LONGINT value *) - BEGIN - IF SIZE(LONGINT) = 4 THEN maxLength := 11 END; - IF SIZE(LONGINT) = 8 THEN maxLength := 20 END; - (* build representation in string 'b' *) - IF int = MIN(LONGINT) THEN (* smallest LONGINT, -int is an overflow *) - IF SIZE(LONGINT) = 4 THEN - b := "-2147483648"; - e := 11 - ELSE (* SIZE(LONGINT) = 8 *) - b := "-9223372036854775808"; - e := 20 - END - ELSE - IF int < 0 THEN (* negative sign *) - b[0] := "-"; int := -int; s := 1 - ELSE (* no sign *) - s := 0 - END; - e := s; (* 's' holds starting position of string *) - REPEAT - b[e] := CHR(int MOD 10+ORD("0")); - int := int DIV 10; - INC(e) - UNTIL int = 0; - b[e] := 0X; - Reverse0(b, s, e-1); - END; - COPY(b, str) (* truncate output if necessary *) - END IntToStr; - PROCEDURE Convert*(x: REAL; n: INTEGER; VAR d: ARRAY OF CHAR); - VAR i, k: LONGINT; - BEGIN IF x < 0 THEN x := -x END; - i := ENTIER(x); k := 0; + (* Convert LONGREAL: Write positive integer value of x into array d. + The value is stored backwards, i.e. least significant digit + first. n digits are written, with trailing zeros fill. + On entry x has been scaled to the number of digits required. *) + PROCEDURE ConvertL*(x: LONGREAL; n: INTEGER; VAR d: ARRAY OF CHAR); + VAR i, j, k: LONGINT; + BEGIN + IF x < 0 THEN x := -x END; + k := 0; + + IF (SIZE(LONGINT) < 8) & (n > 9) THEN + (* There are more decimal digits than can be held in a single LONGINT *) + i := ENTIER(x / 1000000000.0D0); (* The 10th and higher digits *) + j := ENTIER(x - (i * 1000000000.0D0)); (* The low 9 digits *) + (* First generate the low 9 digits. *) + IF j < 0 THEN j := 0 END; + WHILE k < 9 DO + d[k] := CHR(j MOD 10 + 48); j := j DIV 10; INC(k) + END; + (* Fall through to generate the upper digits *) + ELSE + (* We can generate all the digits in one go. *) + i := ENTIER(x); + END; + WHILE k < n DO d[k] := CHR(i MOD 10 + 48); i := i DIV 10; INC(k) END + END ConvertL; + + + PROCEDURE Convert*(x: REAL; n: INTEGER; VAR d: ARRAY OF CHAR); + BEGIN ConvertL(x, n, d) END Convert; -(* experimental, -- noch - PROCEDURE Convert0*(x: REAL; n: INTEGER; VAR d: ARRAY OF CHAR); - VAR i, j, k: LONGINT; - str : ARRAY 32 OF CHAR; - BEGIN - (* IF x = MIN(LONGREAL) THEN x := MAX(LONGREAL) END;*) - IF x < 0 THEN x := -x END; - i := ENTIER(x); - IF i < 0 THEN i := -i END; - IntToStr(i, str); - IF n >= LEN(d) THEN n := SHORT(LEN(d)) - 1 END; - d[n] := 0X; - j := n - 1 ; - IF j < 0 THEN j := 0 END; - k := 0; - REPEAT - d[j] := str[k]; - DEC(j); - INC(k); - UNTIL (str[k] = 0X) OR (j < 0); - WHILE j >= 0 DO d[j] := "0"; DEC(j) END ; - END Convert0; -*) - (* this seem to work -- noch *) - PROCEDURE ConvertL*(x: LONGREAL; n: INTEGER; VAR d: ARRAY OF CHAR); - VAR i, j, k: LONGINT; - str : ARRAY 32 OF CHAR; + PROCEDURE ToHex(i: INTEGER): CHAR; BEGIN - (* IF x = MIN(LONGREAL) THEN x := MAX(LONGREAL) END;*) - IF x < 0 THEN x := -x END; - i := ENTIER(x); - IF i < 0 THEN i := -i END; - IntToStr(i, str); - IF n >= LEN(d) THEN n := SHORT(LEN(d)) - 1 END; - d[n] := 0X; - j := n - 1 ; - IF j < 0 THEN j := 0 END; - k := 0; - REPEAT - d[j] := str[k]; - DEC(j); - INC(k); - UNTIL (str[k] = 0X) OR (j < 0); + IF i < 10 THEN RETURN CHR(i+48) + ELSE RETURN CHR(i+55) END + END ToHex; - WHILE j >= 0 DO d[j] := "0"; DEC(j) END ; - END ConvertL; -(* getting rid of ecvt -- noch - PROCEDURE ConvertL*(x: LONGREAL; n: INTEGER; VAR d: ARRAY OF CHAR); - VAR decpt, sign: INTEGER; i: LONGINT; buf: LONGINT; - BEGIN - (*x := x - 0.5; already rounded in ecvt*) - buf := ecvt(x, n+2, S.ADR(decpt), S.ADR(sign)); - i := 0; - WHILE i < decpt DO S.GET(buf + i, d[n - i -1]); INC(i) END ; (* showdef was crashing here on oocLowLReal.sym because of ecvt *) - i := n - i - 1; - WHILE i >= 0 DO d[i] := "0"; DEC(i) END ; - END ConvertL; -*) - PROCEDURE Unpack(VAR b, d: ARRAY OF S.BYTE); - VAR i, k: SHORTINT; len: LONGINT; - BEGIN i := 0; len := LEN(b); - WHILE i < len DO - k := SHORT(ORD(S.VAL(CHAR, b[i])) DIV 16); - IF k > 9 THEN d[i*2] := k + 55 ELSE d[i*2] := k + 48 END ; - k := SHORT(ORD(S.VAL(CHAR, b[i])) MOD 16); - IF k > 9 THEN d[i*2+1] := k + 55 ELSE d[i*2+1] := k + 48 END ; - INC(i) + (* Convert Hex *) + PROCEDURE ConvertH*(y: REAL; VAR d: ARRAY OF CHAR); + TYPE pc4 = POINTER TO ARRAY 4 OF CHAR; + VAR p: pc4; i: INTEGER; + BEGIN + p := S.VAL(pc4, S.ADR(y)); i := 0; + WHILE i<4 DO + d[i*2] := ToHex(ORD(p[i]) DIV 16); + d[i*2+1] := ToHex(ORD(p[i]) MOD 16) END - END Unpack; - - PROCEDURE ConvertH* (y: REAL; VAR d: ARRAY OF CHAR); - BEGIN Unpack(y, d) END ConvertH; - PROCEDURE ConvertHL* (x: LONGREAL; VAR d: ARRAY OF CHAR); - BEGIN Unpack(x, d) + (* Convert Hex Long *) + PROCEDURE ConvertHL*(y: LONGREAL; VAR d: ARRAY OF CHAR); + TYPE pc8 = POINTER TO ARRAY 8 OF CHAR; + VAR p: pc8; i: INTEGER; + BEGIN + p := S.VAL(pc8, S.ADR(y)); i := 0; + WHILE i<8 DO + d[i*2] := ToHex(ORD(p[i]) DIV 16); + d[i*2+1] := ToHex(ORD(p[i]) MOD 16) + END END ConvertHL; - + END Reals. diff --git a/src/library/v4/Sets.Mod b/src/library/v4/Sets.Mod index f5251990..3b46f090 100644 --- a/src/library/v4/Sets.Mod +++ b/src/library/v4/Sets.Mod @@ -1,6 +1,6 @@ -MODULE Sets0; +MODULE Sets; -IMPORT Out := Console; +IMPORT Texts; CONST (*size* = 32;*) size* = MAX(SET) + 1; @@ -114,7 +114,7 @@ BEGIN i := 0; WHILE i < LEN(s1) DO s := s1[i] * s2[i]; s3[i] := s; INC(i) END END Intersect; -(* + PROCEDURE Print*(VAR f: Texts.Writer; s: ARRAY OF SET; w, indent: INTEGER); VAR col, i, max: INTEGER; BEGIN @@ -133,27 +133,5 @@ BEGIN END ; Texts.Write(f, "}") END Print; -*) -PROCEDURE Write*(s: ARRAY OF SET; w, indent: INTEGER); - VAR col, i, max: INTEGER; -BEGIN - i := 0; col := indent; max := SHORT(LEN(s)) * size; - Out.Char("{"); - WHILE i < max DO - IF In(s, i) THEN - IF col + 4 > w THEN - Out.Ln; - col := 0; WHILE col < indent DO Out.Char(" "); INC(col) END - END ; - Out.Int(i, 3); Out.Char(","); - INC(col, 4) - END ; - INC(i) - END ; - Out.Char("}") -END Write; - - - -END Sets0. +END Sets. diff --git a/src/library/v4/Texts.Mod b/src/library/v4/Texts.Mod index 4d8a3cb3..26b13c81 100644 --- a/src/library/v4/Texts.Mod +++ b/src/library/v4/Texts.Mod @@ -1,9 +1,9 @@ -MODULE Texts0; (** CAS/HM 23.9.93 -- interface based on Texts by JG/NW 6.12.91**) (* << RC, MB, JT *) +MODULE Texts; (** CAS/HM 23.9.93 -- interface based on Texts by JG/NW 6.12.91**) (* << RC, MB, JT *) IMPORT - Files := Files0, Modules, Reals; + Files, Modules, Reals; (*--- insert field e: Elem into Texts.Scanner and change Texts.Scan to set it in case of class=6 *) - (* this module is for bootstrapping voc, use Texts instead *) + CONST Displaywhite = 15; @@ -12,7 +12,7 @@ MODULE Texts0; (** CAS/HM 23.9.93 -- interface based on Texts by JG/NW 6.12.91* (**FileMsg.id**) load* = 0; store* = 1; (**Notifier op**) - replace* = 0; insert* = 1; delete* = 2; + replace* = 0; insert* = 1; delete* = 2; unmark* = 3; (**Scanner.class**) Inval* = 0; Name* = 1; String* = 2; Int* = 3; Real* = 4; LongReal* = 5; Char* = 6; @@ -20,7 +20,7 @@ MODULE Texts0; (** CAS/HM 23.9.93 -- interface based on Texts by JG/NW 6.12.91* TYPE FontsFont = POINTER TO FontDesc; - FontDesc = RECORD + FontDesc = RECORD name: ARRAY 32 OF CHAR; END ; @@ -72,8 +72,10 @@ MODULE Texts0; (** CAS/HM 23.9.93 -- interface based on Texts by JG/NW 6.12.91* head: Run END; + Notifier* = PROCEDURE (T: Text; op: INTEGER; beg, end: LONGINT); TextDesc* = RECORD len*: LONGINT; + notify*: Notifier; head, cache: Run; corg: LONGINT END; @@ -112,7 +114,7 @@ MODULE Texts0; (** CAS/HM 23.9.93 -- interface based on Texts by JG/NW 6.12.91* org, span: LONGINT; mod, proc: ARRAY 32 OF CHAR END; - + VAR new*: Elem; del: Buffer; @@ -200,7 +202,7 @@ MODULE Texts0; (** CAS/HM 23.9.93 -- interface based on Texts by JG/NW 6.12.91* PROCEDURE ElemBase* (E: Elem): Text; BEGIN RETURN E.base END ElemBase; - + PROCEDURE ElemPos* (E: Elem): LONGINT; VAR u: Run; pos: LONGINT; BEGIN u := E.base.head.next; pos := 0; @@ -281,6 +283,7 @@ MODULE Texts0; (** CAS/HM 23.9.93 -- interface based on Texts by JG/NW 6.12.91* len := B.len; v := B.head.next; Merge(T, u, v); Splice(un, v, B.head.prev, T); INC(T.len, len); B.head.next := B.head; B.head.prev := B.head; B.len := 0; + IF T.notify # NIL THEN T.notify(T, insert, pos, pos+len) END END Insert; PROCEDURE Append* (T: Text; B: Buffer); @@ -288,6 +291,7 @@ MODULE Texts0; (** CAS/HM 23.9.93 -- interface based on Texts by JG/NW 6.12.91* BEGIN pos := T.len; len := B.len; v := B.head.next; Merge(T, T.head.prev, v); Splice(T.head, v, B.head.prev, T); INC(T.len, len); B.head.next := B.head; B.head.prev := B.head; B.len := 0; + IF T.notify # NIL THEN T.notify(T, insert, pos, pos+len) END END Append; PROCEDURE Delete* (T: Text; beg, end: LONGINT); @@ -299,6 +303,7 @@ MODULE Texts0; (** CAS/HM 23.9.93 -- interface based on Texts by JG/NW 6.12.91* Splice(del.head, un, v, NIL); Merge(T, u, vn); u.next := vn; vn.prev := u; DEC(T.len, end - beg); + IF T.notify # NIL THEN T.notify(T, delete, beg, end) END END Delete; PROCEDURE ChangeLooks* (T: Text; beg, end: LONGINT; sel: SET; fnt: FontsFont; col, voff: SHORTINT); @@ -313,6 +318,7 @@ MODULE Texts0; (** CAS/HM 23.9.93 -- interface based on Texts by JG/NW 6.12.91* IF u.next = un THEN u := un; un := un.next ELSE u.next := un; un.prev := u END END; Merge(T, u, un); u.next := un; un.prev := u; + IF T.notify # NIL THEN T.notify(T, replace, beg, end) END END ChangeLooks; @@ -327,23 +333,7 @@ MODULE Texts0; (** CAS/HM 23.9.93 -- interface based on Texts by JG/NW 6.12.91* Files.Set(R.rider, u(Piece).file, u(Piece).org + R.off) END END OpenReader; -(* - PROCEDURE Read* (VAR R: Reader; VAR ch: CHAR); - VAR u: Run; - BEGIN u := R.run; R.fnt := u.fnt; R.col := u.col; R.voff := u.voff; INC(R.off); - IF u IS Piece THEN Files.Read(R.rider, ch); R.elem := NIL; - IF (ch = 0AX) & u(Piece).ascii THEN ch := CR END (* << LF to CR *) - ELSIF u IS Elem THEN ch := ElemChar; R.elem := u(Elem) - ELSE ch := 0X; R.elem := NIL; R.eot := TRUE - END; - IF R.off = u.len THEN INC(R.org, u.len); u := u.next; - IF u IS Piece THEN - WITH u: Piece DO Files.Set(R.rider, u.file, u.org) END - END; - R.run := u; R.off := 0 - END - END Read; -*) + PROCEDURE Read* (VAR R: Reader; VAR ch: CHAR); VAR u: Run; pos: LONGINT; nextch: CHAR; BEGIN u := R.run; R.fnt := u.fnt; R.col := u.col; R.voff := u.voff; INC(R.off); @@ -351,8 +341,8 @@ MODULE Texts0; (** CAS/HM 23.9.93 -- interface based on Texts by JG/NW 6.12.91* IF (ch = 0AX) & u(Piece).ascii THEN ch := CR (* << LF to CR *) ELSIF (ch = CR) & u(Piece).ascii THEN (* << CR LF to CR *) pos := Files.Pos(R.rider); Files.Read(R.rider, nextch); - IF nextch = 0AX THEN INC(R.off) ELSE Files.Set(R.rider, u(Piece).file, pos) END - END + IF nextch = 0AX THEN INC(R.off) ELSE Files.Set(R.rider, u(Piece).file, pos) END + END ELSIF u IS Elem THEN ch := ElemChar; R.elem := u(Elem) ELSE ch := 0X; R.elem := NIL; R.eot := TRUE END; @@ -364,7 +354,6 @@ MODULE Texts0; (** CAS/HM 23.9.93 -- interface based on Texts by JG/NW 6.12.91* END END Read; - PROCEDURE ReadElem* (VAR R: Reader); VAR u, un: Run; BEGIN u := R.run; @@ -462,7 +451,7 @@ MODULE Texts0; (** CAS/HM 23.9.93 -- interface based on Texts by JG/NW 6.12.91* k := ORD(d[j]) - 30H; INC(j); IF (i-j = 7) & (k >= 8) THEN DEC(k, 16) END ; WHILE j < i DO k := k*10H + (ORD(d[j]) - 30H); INC(j) END ; - IF neg THEN S.i := -k ELSE S.i := k END + IF neg THEN S.i := -k ELSE S.i := k END ELSIF ch = "." THEN (*read real*) Read(S, ch); h := i; WHILE ("0" <= ch) & (ch <= "9") DO d[i] := ch; INC(i); Read(S, ch) END ; @@ -474,7 +463,7 @@ MODULE Texts0; (** CAS/HM 23.9.93 -- interface based on Texts by JG/NW 6.12.91* IF negE THEN IF e <= 308 THEN y := y / Reals.TenL(e) ELSE y := 0 END ELSIF e > 0 THEN - IF e <= 308 THEN y := Reals.TenL(e) * y ELSE HALT(40) END + IF e <= 308 THEN y := Reals.TenL(e) * y ELSE HALT(40) END END ; IF neg THEN y := -y END ; S.class := 5; S.y := y @@ -557,11 +546,18 @@ MODULE Texts0; (** CAS/HM 23.9.93 -- interface based on Texts by JG/NW 6.12.91* END WriteString; PROCEDURE WriteInt* (VAR W: Writer; x, n: LONGINT); - VAR i: INTEGER; x0: LONGINT; - a: ARRAY 11 OF CHAR; + VAR + i: INTEGER; x0: LONGINT; + a: ARRAY 22 OF CHAR; BEGIN i := 0; IF x < 0 THEN - IF x = MIN(LONGINT) THEN WriteString(W, " -2147483648"); RETURN + IF x = MIN(LONGINT) THEN + IF SIZE(LONGINT) = 4 THEN + WriteString(W, " -2147483648") + ELSE + WriteString(W, " -9223372036854775808") + END; + RETURN ELSE DEC(n); x0 := -x END ELSE x0 := x @@ -576,7 +572,7 @@ MODULE Texts0; (** CAS/HM 23.9.93 -- interface based on Texts by JG/NW 6.12.91* PROCEDURE WriteHex* (VAR W: Writer; x: LONGINT); VAR i: INTEGER; y: LONGINT; - a: ARRAY 10 OF CHAR; + a: ARRAY 20 OF CHAR; BEGIN i := 0; Write(W, " "); REPEAT y := x MOD 10H; IF y < 10 THEN a[i] := CHR(y + 30H) ELSE a[i] := CHR(y + 37H) END; @@ -680,14 +676,22 @@ MODULE Texts0; (** CAS/HM 23.9.93 -- interface based on Texts by JG/NW 6.12.91* REPEAT Write(W, " "); DEC(n) UNTIL n <= maxD; (*there are 2 <= n <= maxD digits to be written*) IF x < 0 THEN Write(W, "-"); x := -x ELSE Write(W, " ") END; + + (* Scale e to be an exponent of 10 rather than 2 *) e := SHORT(LONG(e - 1023) * 77 DIV 256); IF e >= 0 THEN x := x / Reals.TenL(e) ELSE x := Reals.TenL(-e) * x END ; - IF x >= 10.0D0 THEN x := 0.1D0 * x; INC(e) END ; + IF x >= 10.0D0 THEN x := 0.1D0 * x; INC(e) END; + + (* Scale x to the number of digits requested *) x0 := Reals.TenL(n-1); x := x0*x + 0.5D0; IF x >= 10.0D0*x0 THEN x := 0.1D0 * x; INC(e) END ; + + (* Generate the mantissa digits of x *) Reals.ConvertL(x, n, d); + DEC(n); Write(W, d[n]); Write(W, "."); REPEAT DEC(n); Write(W, d[n]) UNTIL n = 0; + Write(W, "D"); IF e < 0 THEN Write(W, "-"); e := -e ELSE Write(W, "+") END; Write(W, CHR(e DIV 100 + 30H)); e := e MOD 100; @@ -767,7 +771,7 @@ MODULE Texts0; (** CAS/HM 23.9.93 -- interface based on Texts by JG/NW 6.12.91* u.next := T.head; T.head.prev := u; T.cache := T.head; T.corg := 0; Files.ReadLInt(msg.r, T.len); Files.Set(r, f, Files.Pos(msg.r) + T.len) END Load0; - + PROCEDURE Load* (VAR r: Files.Rider; T: Text); CONST oldTag = -4095; VAR tag: INTEGER; @@ -865,8 +869,9 @@ MODULE Texts0; (** CAS/HM 23.9.93 -- interface based on Texts by JG/NW 6.12.91* u := u.next END; r := msg.r; + IF T.notify # NIL THEN T.notify(T, unmark, 0, 0) END END Store; - + PROCEDURE Close* (T: Text; name: ARRAY OF CHAR); VAR f: Files.File; r: Files.Rider; i, res: INTEGER; bak: ARRAY 64 OF CHAR; BEGIN @@ -877,4 +882,4 @@ MODULE Texts0; (** CAS/HM 23.9.93 -- interface based on Texts by JG/NW 6.12.91* END Close; BEGIN del := NIL; NEW(FontsDefault); FontsDefault.name := "Syntax10.Scn.Fnt" -END Texts0. +END Texts. From f9dc858d29cad22f932035e0b2c1e82a686032c9 Mon Sep 17 00:00:00 2001 From: David C W Brown Date: Thu, 16 Jun 2016 15:36:31 +0100 Subject: [PATCH 077/580] Remove binary files incorrectly checked in. --- src/test/confidence/lola/LSB.h | 79 ---------------------------------- src/test/confidence/lola/LSC.h | 16 ------- src/test/confidence/lola/LSS.h | 25 ----------- src/test/confidence/lola/LSV.h | 16 ------- 4 files changed, 136 deletions(-) delete mode 100644 src/test/confidence/lola/LSB.h delete mode 100644 src/test/confidence/lola/LSC.h delete mode 100644 src/test/confidence/lola/LSS.h delete mode 100644 src/test/confidence/lola/LSV.h diff --git a/src/test/confidence/lola/LSB.h b/src/test/confidence/lola/LSB.h deleted file mode 100644 index 86a5f7ce..00000000 --- a/src/test/confidence/lola/LSB.h +++ /dev/null @@ -1,79 +0,0 @@ -/* voc 1.2 [2016/06/16] for gcc LP64 on cygwin xtpka */ - -#ifndef LSB__h -#define LSB__h - -#define LARGE -#include "SYSTEM.h" - -typedef - struct LSB_ArrayTypeDesc *LSB_ArrayType; - -typedef - struct LSB_ObjDesc *LSB_Object; - -typedef - struct LSB_TypeDesc { - LONGINT len, size; - LSB_Object typobj; - } LSB_TypeDesc; - -typedef - LSB_TypeDesc *LSB_Type; - -typedef - struct LSB_ArrayTypeDesc { /* LSB_TypeDesc */ - LONGINT len, size; - LSB_Object typobj; - LSB_Type eltyp; - } LSB_ArrayTypeDesc; - -typedef - struct LSB_ItemDesc *LSB_Item; - -typedef - struct LSB_ItemDesc { - INTEGER tag; - LSB_Type type; - LONGINT val, size; - LSB_Item a, b; - } LSB_ItemDesc; - -typedef - struct LSB_ObjDesc { /* LSB_ItemDesc */ - INTEGER tag; - LSB_Type type; - LONGINT val, size; - LSB_Item a, b; - LSB_Object next; - CHAR name[32]; - BOOLEAN marked; - } LSB_ObjDesc; - -typedef - struct LSB_UnitTypeDesc *LSB_UnitType; - -typedef - struct LSB_UnitTypeDesc { /* LSB_TypeDesc */ - LONGINT len, size; - LSB_Object typobj; - LSB_Object firstobj; - } LSB_UnitTypeDesc; - - -import LSB_Object LSB_root, LSB_top; -import LSB_Type LSB_bitType, LSB_integer, LSB_string; -import LSB_ArrayType LSB_byteType, LSB_wordType; -import CHAR LSB_modname[32]; - -import LONGINT *LSB_ItemDesc__typ; -import LONGINT *LSB_ObjDesc__typ; -import LONGINT *LSB_TypeDesc__typ; -import LONGINT *LSB_ArrayTypeDesc__typ; -import LONGINT *LSB_UnitTypeDesc__typ; - -import void LSB_Register (CHAR *name, LONGINT name__len, LSB_Object list); -import void *LSB__init(void); - - -#endif diff --git a/src/test/confidence/lola/LSC.h b/src/test/confidence/lola/LSC.h deleted file mode 100644 index 5eabfedd..00000000 --- a/src/test/confidence/lola/LSC.h +++ /dev/null @@ -1,16 +0,0 @@ -/* voc 1.2 [2016/06/16] for gcc LP64 on cygwin xtpka */ - -#ifndef LSC__h -#define LSC__h - -#define LARGE -#include "SYSTEM.h" - - - - -import void LSC_Compile (void); -import void *LSC__init(void); - - -#endif diff --git a/src/test/confidence/lola/LSS.h b/src/test/confidence/lola/LSS.h deleted file mode 100644 index a4e95780..00000000 --- a/src/test/confidence/lola/LSS.h +++ /dev/null @@ -1,25 +0,0 @@ -/* voc 1.2 [2016/06/16] for gcc LP64 on cygwin xtpka */ - -#ifndef LSS__h -#define LSS__h - -#define LARGE -#include "SYSTEM.h" -#include "Texts.h" - -typedef - CHAR LSS_Ident[32]; - - -import LONGINT LSS_val; -import LSS_Ident LSS_id; -import BOOLEAN LSS_error; - - -import void LSS_Get (INTEGER *sym); -import void LSS_Init (Texts_Text T, LONGINT pos); -import void LSS_Mark (CHAR *msg, LONGINT msg__len); -import void *LSS__init(void); - - -#endif diff --git a/src/test/confidence/lola/LSV.h b/src/test/confidence/lola/LSV.h deleted file mode 100644 index f5a8b2e6..00000000 --- a/src/test/confidence/lola/LSV.h +++ /dev/null @@ -1,16 +0,0 @@ -/* voc 1.2 [2016/06/16] for gcc LP64 on cygwin xtpka */ - -#ifndef LSV__h -#define LSV__h - -#define LARGE -#include "SYSTEM.h" - - - - -import void LSV_List (void); -import void *LSV__init(void); - - -#endif From c64a75bd7858bc2047ac23713b2c6cc3face510d Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 16 Jun 2016 15:54:40 +0100 Subject: [PATCH 078/580] Add .git configuration files to enlistment root. --- .gitattributes | 34 ++++++++++++++++++++++++++++++++++ .gitconfig | 10 ++++++++++ .gitignore | 24 ++++++++++++++++++++++++ 3 files changed, 68 insertions(+) create mode 100755 .gitattributes create mode 100755 .gitconfig create mode 100755 .gitignore diff --git a/.gitattributes b/.gitattributes new file mode 100755 index 00000000..2746b870 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,34 @@ +# Cygwin git and github for windows differ in their eol convention: Github for +# windows uses crlf, but cygwin git uses LF. +# Since we want the same enlistment to work both ways, we need to specify and stick +# with end of line convention for all files. +# Therefore we choose LF for all files except windows command scripts. + +* text=auto + +*.md text eol=lf +*.c text eol=lf +*.h text eol=lf +*.Mod text eol=lf +*.mod text eol=lf +*.make text eol=lf +*makefile text eol=lf +*.sh text eol=lf +.git* text eol=lf + +*.cmd text eol=crlf + + +# Symbol files are binaries +*.sym binary + +# Other binaries (these are not normally checked in.) +*.o binary +*.obj binary +*stackdump binary +*exe binary + +# Provide type information to improve block annotation in git diff output. +*.Mod diff=pascal +*.c diff=cpp +*.h diff=cpp diff --git a/.gitconfig b/.gitconfig new file mode 100755 index 00000000..e97fe66d --- /dev/null +++ b/.gitconfig @@ -0,0 +1,10 @@ +[core] + repositoryformatversion = 0 + filemode = true + bare = false + logallrefupdates = true + ignorecase = true + autocrlf = true +# safecrlf = false +[push] + default = simple diff --git a/.gitignore b/.gitignore new file mode 100755 index 00000000..3f69b59d --- /dev/null +++ b/.gitignore @@ -0,0 +1,24 @@ +/*.sublime-* +/Configuration.Mod +/Configuration.Make +/build/* +/*.exe +/*.obj +/*.o +/*.lib +/*.map +/olang +/src/test/**/*.exe +/src/test/**/*.c +/src/test/**/*.h +/src/test/**/*.o +/src/test/**/*.obj +/src/test/**/*.sym +/src/test/**/*.stackdump +/src/test/confidence/**/result +/.DS_store +**/.DS_store +**/*.dSYM +**/.tmp.* +/*.pdb +/*.ilk \ No newline at end of file From a9b273e30ad97ac8c4841e45bbac09a8e1d72061 Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 16 Jun 2016 16:14:30 +0100 Subject: [PATCH 079/580] Fix line endings. --- src/test/confidence/lola/LSB.Mod | 104 +- src/test/confidence/lola/LSC.Mod | 1072 ++++++------- src/test/confidence/lola/LSS.Mod | 330 ++-- src/test/confidence/lola/LSV.Mod | 476 +++--- src/test/confidence/lola/RISC5.Lola | 428 ++--- src/test/confidence/lola/expected | 226 +-- src/test/confidence/lola/lola.Mod | 24 +- src/test/confidence/lola/result | 226 +-- src/voc07R/CompatTexts.Mod | 1170 +++++++------- src/voc07R/Fonts.Mod | 292 ++-- src/voc07R/ORB.Mod | 894 +++++------ src/voc07R/ORG.Mod | 2268 +++++++++++++-------------- src/voc07R/ORP.Mod | 1994 +++++++++++------------ src/voc07R/ORS.Mod | 650 ++++---- src/voc07R/ORTool.Mod | 502 +++--- 15 files changed, 5328 insertions(+), 5328 deletions(-) diff --git a/src/test/confidence/lola/LSB.Mod b/src/test/confidence/lola/LSB.Mod index 7bebf6d4..2b97d65a 100755 --- a/src/test/confidence/lola/LSB.Mod +++ b/src/test/confidence/lola/LSB.Mod @@ -1,52 +1,52 @@ -MODULE LSB; (*Lola System Compiler Base LSBX, 26.9.2015*) - IMPORT Texts, Oberon; - - CONST - bit* = 0; array* = 1; unit* = 2; (*type forms*) - - (*tags in output*) const* = 1; typ* = 2; var* = 3; lit* = 4; sel* = 7; range* = 8; cons* = 9; - repl* = 10; not* = 11; and* = 12; mul* = 13; div* = 14; or* = 15; xor* = 16; add* = 17; sub* = 18; - eql* = 20; neq* = 21; lss* = 22; geq* = 23; leq* = 24; gtr* = 25; - then* = 30; else* = 31; ts* = 32; next* = 33; - - TYPE - Item* = POINTER TO ItemDesc; - Object* = POINTER TO ObjDesc; - Type* = POINTER TO TypeDesc; - ArrayType* = POINTER TO ArrayTypeDesc; - UnitType* = POINTER TO UnitTypeDesc; - - ItemDesc* = RECORD - tag*: INTEGER; - type*: Type; - val*, size*: LONGINT; - a*, b*: Item - END ; - - ObjDesc* = RECORD (ItemDesc) - next*: Object; - name*: ARRAY 32 OF CHAR; - marked*: BOOLEAN - END ; - - TypeDesc* = RECORD len*, size*: LONGINT; typobj*: Object END ; - ArrayTypeDesc* = RECORD (TypeDesc) eltyp*: Type END ; - UnitTypeDesc* = RECORD (TypeDesc) firstobj*: Object END ; - - VAR root*, top*: Object; - bitType*, integer*, string*: Type; - byteType*, wordType*: ArrayType; - modname*: ARRAY 32 OF CHAR; - - PROCEDURE Register*(name: ARRAY OF CHAR; list: Object); - BEGIN (*modname := name*) COPY(name, modname); top := list - END Register; - -BEGIN NEW(bitType); bitType.len := 0; bitType.size := 1; NEW(integer); NEW(string); - NEW(byteType); byteType.len := 8; byteType.size := 8; byteType.eltyp := bitType; - NEW(wordType); wordType.len := 32; wordType.size := 32; wordType.eltyp := bitType; - NEW(root); root.tag := typ; root.name := "WORD"; root.type := wordType; root.next := NIL; - NEW(top); top.tag := typ; top.name := "BYTE"; top.type := byteType; top.next := root; root := top; - NEW(top); top.tag := typ; top.name := "BIT"; top.type := bitType; top.next := root; root := top -END LSB. - +MODULE LSB; (*Lola System Compiler Base LSBX, 26.9.2015*) + IMPORT Texts, Oberon; + + CONST + bit* = 0; array* = 1; unit* = 2; (*type forms*) + + (*tags in output*) const* = 1; typ* = 2; var* = 3; lit* = 4; sel* = 7; range* = 8; cons* = 9; + repl* = 10; not* = 11; and* = 12; mul* = 13; div* = 14; or* = 15; xor* = 16; add* = 17; sub* = 18; + eql* = 20; neq* = 21; lss* = 22; geq* = 23; leq* = 24; gtr* = 25; + then* = 30; else* = 31; ts* = 32; next* = 33; + + TYPE + Item* = POINTER TO ItemDesc; + Object* = POINTER TO ObjDesc; + Type* = POINTER TO TypeDesc; + ArrayType* = POINTER TO ArrayTypeDesc; + UnitType* = POINTER TO UnitTypeDesc; + + ItemDesc* = RECORD + tag*: INTEGER; + type*: Type; + val*, size*: LONGINT; + a*, b*: Item + END ; + + ObjDesc* = RECORD (ItemDesc) + next*: Object; + name*: ARRAY 32 OF CHAR; + marked*: BOOLEAN + END ; + + TypeDesc* = RECORD len*, size*: LONGINT; typobj*: Object END ; + ArrayTypeDesc* = RECORD (TypeDesc) eltyp*: Type END ; + UnitTypeDesc* = RECORD (TypeDesc) firstobj*: Object END ; + + VAR root*, top*: Object; + bitType*, integer*, string*: Type; + byteType*, wordType*: ArrayType; + modname*: ARRAY 32 OF CHAR; + + PROCEDURE Register*(name: ARRAY OF CHAR; list: Object); + BEGIN (*modname := name*) COPY(name, modname); top := list + END Register; + +BEGIN NEW(bitType); bitType.len := 0; bitType.size := 1; NEW(integer); NEW(string); + NEW(byteType); byteType.len := 8; byteType.size := 8; byteType.eltyp := bitType; + NEW(wordType); wordType.len := 32; wordType.size := 32; wordType.eltyp := bitType; + NEW(root); root.tag := typ; root.name := "WORD"; root.type := wordType; root.next := NIL; + NEW(top); top.tag := typ; top.name := "BYTE"; top.type := byteType; top.next := root; root := top; + NEW(top); top.tag := typ; top.name := "BIT"; top.type := bitType; top.next := root; root := top +END LSB. + diff --git a/src/test/confidence/lola/LSC.Mod b/src/test/confidence/lola/LSC.Mod index 4488d47f..7efad856 100755 --- a/src/test/confidence/lola/LSC.Mod +++ b/src/test/confidence/lola/LSC.Mod @@ -1,536 +1,536 @@ -MODULE LSC; (*Lola System Compiler, NW 8.1.95 / 26.9.2015 for RISC (LSCX)*) - IMPORT Texts, Oberon, LSB, LSS; - - VAR sym: INTEGER; - err: BOOLEAN; (*used at end of Unit*) - top, bot, undef: LSB.Object; - factor: PROCEDURE (VAR x: LSB.Item); (*to avoid forward references*) - expression: PROCEDURE (VAR x: LSB.Item); - Unit: PROCEDURE (VAR locals: LSB.Object); - W: Texts.Writer; - - PROCEDURE Err(n: INTEGER); - BEGIN LSS.Mark("type error"); Texts.WriteInt(W, n, 4); - Texts.WriteLn(W); Texts.Append(Oberon.Log, W.buf) - END Err; - - PROCEDURE Log(m: LONGINT): LONGINT; - VAR n: LONGINT; - BEGIN n := 1; - WHILE m > 1 DO m := m DIV 2; INC(n) END ; - RETURN n - END Log; - - PROCEDURE New(tag: INTEGER; a, b: LSB.Item): LSB.Item; - VAR z: LSB.Item; - BEGIN NEW(z); z.tag := tag; z.a := a; z.b := b; z.val := b.val; RETURN z - END New; - - PROCEDURE NewObj(class: INTEGER): LSB.Object; (*insert at end, before BIT*) - VAR new, x: LSB.Object; - BEGIN x := top; - WHILE (x.next # bot) & (x.next.name # LSS.id) DO x := x.next END ; - IF x.next = bot THEN - NEW(new); new.name := LSS.id; new.tag := class; new.next := bot; x.next := new - ELSE LSS.Mark("mult def"); new := x - END ; - RETURN new - END NewObj; - - PROCEDURE ThisObj(id: LSS.Ident): LSB.Object; (*find object with name = identifier last read*) - VAR x: LSB.Object; - BEGIN x := top.next; - WHILE (x # NIL) & (x.name # id) DO x := x.next END ; - IF x = NIL THEN LSS.Mark("undef"); x := undef END ; - RETURN x - END ThisObj; - - PROCEDURE CheckTypes(x, y, z: LSB.Item); (*z.type = result type*) - VAR xtyp, ytyp: LSB.Type; - BEGIN xtyp := x.type; ytyp := y.type; z.type := xtyp; z.size := x.size; z.val := x.val; - IF xtyp = LSB.bitType THEN z.type := xtyp; - IF ytyp = LSB.integer THEN (* b + 0 *) - IF y.val >= 2 THEN Err(20); LSS.Mark("only 0 or 1") END - ELSIF ytyp = LSB.string THEN (* b + {...} *) Err(21) - ELSIF ytyp # LSB.bitType THEN Err(22) - END - ELSIF xtyp IS LSB.ArrayType THEN - IF xtyp(LSB.ArrayType).eltyp = LSB.bitType THEN - IF (ytyp IS LSB.ArrayType) & (xtyp(LSB.ArrayType).eltyp = LSB.bitType) THEN - IF xtyp.size # ytyp.size THEN Err(33) END (* x + y *) - ELSIF ytyp = LSB.integer THEN (* w + 5 *) - IF xtyp.size < Log(y.val) THEN Err(30) END - ELSIF ytyp = LSB.string THEN (*x + {...} *) - IF xtyp.size # y.size THEN Err(31) END - ELSIF ytyp # LSB.bitType THEN Err(34) - END - ELSIF (ytyp IS LSB.ArrayType) & (xtyp(LSB.ArrayType).eltyp = ytyp(LSB.ArrayType).eltyp) THEN - IF (xtyp.size # ytyp.size) THEN Err(40) END - ELSE Err(41) - END - ELSIF xtyp = LSB.string THEN - IF ytyp = LSB.bitType THEN (* {...} + b *) Err(12) - ELSIF (ytyp IS LSB.ArrayType) & (ytyp(LSB.ArrayType).eltyp = LSB.bitType) THEN (* {...} + w *) - IF x.size # ytyp.size THEN Err(13) END - ELSIF ytyp = LSB.integer THEN (* {...} + 5*) - IF x.size < Log(y.val) THEN Err(10) END - ELSIF ytyp = LSB.string THEN (* {...} + {...} *) - IF x.size # y.size THEN Err(11) END ; - ELSE Err(14) - END - ELSIF xtyp = LSB.integer THEN - IF (ytyp IS LSB.ArrayType) & (ytyp(LSB.ArrayType).eltyp = LSB.bitType) THEN (* 5 + w *) - IF Log(x.val) > ytyp.size THEN Err(3); LSS.Mark("const too large") END - ELSIF ytyp = LSB.bitType THEN (* 5 + b *) - IF x.val >= 2 THEN Err(2) END - ELSIF ytyp = LSB.integer THEN (* 5 + 5 *) - ELSIF ytyp = LSB.string THEN (* 5 + {...} *) - IF Log(x.val) > y.size THEN Err(12) END - ELSE Err(4) - END - END - END CheckTypes; - - PROCEDURE selector(VAR x: LSB.Item); - VAR y, z: LSB.Item; obj: LSB.Object; - eltyp: LSB.Type; len, kind: LONGINT; - BEGIN - WHILE (sym = LSS.lbrak) OR (sym = LSS.period) DO - IF sym = LSS.lbrak THEN - eltyp := x.type(LSB.ArrayType).eltyp; LSS.Get(sym); expression(y); - IF sym = LSS.colon THEN (*range*) - LSS.Get(sym); expression(z); - IF (y.tag = LSB.lit) & (z.tag = LSB.lit) THEN - len := y.val - z.val + 1; y := New(LSB.range, y, z); x := New(LSB.sel, x, y); x.type := LSB.string; x.size := len - END - ELSE kind := x.val; x := New(LSB.sel, x, y); x.type := eltyp; x.val := kind - END ; - IF sym = LSS.rbrak THEN LSS.Get(sym) ELSE LSS.Mark("rbrak ?") END - ELSE (*sym = LSS.period*) LSS.Get(sym); factor(y); - IF (y.tag = LSB.lit) & (y.val >= x.type.len) THEN LSS.Mark("too large") END ; - eltyp := x.type(LSB.ArrayType).eltyp; kind := x.val; x := New(LSB.sel, x, y); x.type := eltyp; x.val := kind - END - END - END selector; - - PROCEDURE elem(VAR x: LSB.Item; VAR len: LONGINT); - VAR y, z: LSB.Item; m, n: LONGINT; - BEGIN expression(x); - IF (x.type = LSB.integer) OR (x.type = LSB.string) THEN m := x.size ELSE m := x.type.size END ; - IF sym = LSS.repl THEN - LSS.Get(sym); - IF sym = LSS.integer THEN - NEW(y); y.tag := LSB.lit; n := LSS.val; y.val := n; y.type := LSB.integer; LSS.Get(sym); - x := New(LSB.repl, x, y) - END - ELSE n := 1 - END ; - len := m*n - END elem; - - PROCEDURE constructor(VAR x: LSB.Item); - VAR y: LSB.Item; n, len: LONGINT; - BEGIN elem(x, len); - WHILE sym = LSS.comma DO - LSS.Get(sym); elem(y, n); INC(len, n); x := New(LSB.cons, x, y); x.val := len - END ; - x.size := len; x.type := LSB.string; - IF sym = LSS.rbrace THEN LSS.Get(sym) ELSE LSS.Mark("rbrace ?") END - END constructor; - - PROCEDURE factor0(VAR x: LSB.Item); - VAR obj: LSB.Object; y, z: LSB.Item; - n, len: LONGINT; t: LSB.ArrayType; - BEGIN - IF sym = LSS.ident THEN - x := ThisObj(LSS.id); LSS.Get(sym); - IF x.tag = LSB.var THEN selector(x) - ELSIF x.tag = LSB.const THEN n := x.b.val; NEW(x); x.tag := LSB.lit; x.val := n; x.type := LSB.integer - ELSE LSS.Mark("bad factor") - END - ELSIF sym = LSS.lparen THEN - LSS.Get(sym); expression(x); - IF sym = LSS.rparen THEN LSS.Get(sym) ELSE LSS.Mark("rparen ?") END - ELSIF sym = LSS.integer THEN - NEW(x); x.tag := LSB.lit; x.val := LSS.val; x.type := LSB.integer; LSS.Get(sym); - IF sym = LSS.apo THEN LSS.Get(sym); - IF sym = LSS.integer THEN - len := LSS.val; LSS.Get(sym); - IF len < Log(x.val) THEN LSS.Mark("value too large") END - ELSE LSS.Mark("integer ?"); len := 0 - END ; - x.size := len - ELSE len := 0 - END ; - x.size := len - ELSIF sym = LSS.not THEN - LSS.Get(sym); factor(x); y := New(LSB.not, NIL, x); y.type := x.type; y.size := x.size; x := y - ELSIF sym = LSS.lbrace THEN LSS.Get(sym); constructor(x) - ELSE LSS.Mark("bad factor") - END - END factor0; - - PROCEDURE term(VAR x: LSB.Item); - VAR y, z: LSB.Item; op: INTEGER; - BEGIN factor(x); - WHILE (sym >= LSS.times) & (sym <= LSS.and) DO - IF sym = LSS.and THEN op := LSB.and - ELSIF sym = LSS.times THEN op := LSB.mul - ELSIF sym = LSS.div THEN op := LSB.div - END ; - LSS.Get(sym); factor(y); z := New(op, x, y); CheckTypes(x, y, z); x := z - END - END term; - - PROCEDURE SimpleExpression(VAR x: LSB.Item); - VAR y, z: LSB.Item; op: INTEGER; - BEGIN - IF sym = LSS.minus THEN LSS.Get(sym); term(y); - IF y.tag = LSB.lit THEN x := y; x.val := -y.val - ELSE x := New(LSB.sub, NIL, y); x.type := y.type; x.size := y.size - END - ELSIF sym = LSS.plus THEN LSS.Get(sym); term(x); - ELSE term(x) - END ; - WHILE (sym >= LSS.plus) & (sym <= LSS.xor) DO - IF sym = LSS.or THEN op := LSB.or - ELSIF sym = LSS.xor THEN op := LSB.xor - ELSIF sym = LSS.plus THEN op := LSB.add - ELSIF sym = LSS.minus THEN op := LSB.sub - END ; - LSS.Get(sym); term(y); z := New(op, x, y); CheckTypes(x, y, z); x := z - END - END SimpleExpression; - - PROCEDURE UncondExpression(VAR x: LSB.Item); - VAR y, z: LSB.Item; rel: INTEGER; - BEGIN SimpleExpression(x); - IF (sym >= LSS.eql) & (sym <= LSS.geq) THEN - IF sym = LSS.eql THEN rel := LSB.eql - ELSIF sym = LSS.neq THEN rel := LSB.neq - ELSIF sym = LSS.lss THEN rel := LSB.lss - ELSIF sym = LSS.geq THEN rel := LSB.geq - ELSIF sym = LSS.leq THEN rel := LSB.leq - ELSE rel := LSB.gtr - END ; - LSS.Get(sym); SimpleExpression(y); z := New(rel, x, y); CheckTypes(x, y, z); z.type := LSB.bitType; x := z - END - END UncondExpression; - - PROCEDURE expression0(VAR x: LSB.Item); - VAR y, z, w: LSB.Item; - BEGIN UncondExpression(x); - IF sym = LSS.then THEN - IF x.type # LSB.bitType THEN LSS.Mark("Boolean?") END ; - LSS.Get(sym); expression(y); - IF sym = LSS.colon THEN - LSS.Get(sym); expression(z); w := New(LSB.else, y, z); CheckTypes(y, z, w); - x := New(LSB.then, x, w); x.type := w.type; x.size := w.size - ELSE LSS.Mark("colon ?") - END - END - END expression0; - - PROCEDURE CheckAssign(x, y: LSB.Item); - VAR xtyp, ytyp: LSB.Type; - BEGIN xtyp := x.type; ytyp := y.type; - IF xtyp # ytyp THEN - IF xtyp = LSB.bitType THEN - IF (ytyp # LSB.integer) OR (y.val >= 2) THEN Err(70); END - ELSIF xtyp IS LSB.ArrayType THEN - IF xtyp(LSB.ArrayType).eltyp = LSB.bitType THEN - IF (ytyp IS LSB.ArrayType) & (xtyp(LSB.ArrayType).eltyp = LSB.bitType) THEN (*w := w*) - IF xtyp.size # ytyp.size THEN Err(71) END (* x + y *) - ELSIF ytyp = LSB.integer THEN (* w := 5 *) - IF xtyp.size < Log(y.val) THEN Err(72) END - ELSIF ytyp = LSB.string THEN (* w := {...} *) - IF xtyp.size # y.size THEN Err(73) END - ELSE Err(74) - END - ELSE Err(74) - END - END - END - END CheckAssign; - - PROCEDURE Param(fpar: LSB.Object; VAR apar: LSB.Item); - VAR y, z: LSB.Item; - BEGIN expression(y); apar := New(LSB.next, NIL, y); CheckAssign(fpar, y); - IF fpar.val IN {3, 4} THEN (*OUT or INOUT parameter*) - IF ~(y.tag IN {3, 7}) THEN (*actual param is expression?*) LSS.Mark("bad actual param") - ELSIF y.b = NIL THEN y.b := undef - END - END - END Param; - - PROCEDURE Statement; - VAR w, x, y, z, apar, npar: LSB.Item; - unit: LSB.UnitType; fpar: LSB.Object; - BEGIN - IF sym < LSS.ident THEN LSS.Mark("bad factor"); - REPEAT LSS.Get(sym) UNTIL sym >= LSS.ident - END ; - IF sym = LSS.ident THEN - x := ThisObj(LSS.id); z := x; LSS.Get(sym); selector(z); - IF sym = LSS.becomes THEN LSS.Get(sym); - IF x.val >= 5 THEN LSS.Mark("assignment to read-only") END ; - IF (x.b # NIL) & ~(x.type IS LSB.ArrayType) THEN LSS.Mark("mult assign") END ; - expression(y); CheckAssign(z, y); x.b := y; (*tricky*) - IF z # x THEN x.a := z.b; x.val := 1 (*overwriting clk field x.a *) END - ELSIF sym = LSS.lparen THEN LSS.Get(sym); (*unit instantiation*) - IF x.type IS LSB.UnitType THEN - unit := x.type(LSB.UnitType); fpar := unit.firstobj; - IF sym # LSS.rparen THEN - Param(fpar, apar); x.b := apar; fpar := fpar.next; - WHILE sym # LSS.rparen DO - IF sym = LSS.comma THEN LSS.Get(sym) END ; - Param(fpar, npar); - IF fpar.tag >= 3 THEN fpar := fpar.next; apar.a := npar; apar := npar - ELSE LSS.Mark("too many params") - END - END ; - IF fpar.val >= 3 THEN LSS.Mark("too few params") END - END ; - IF sym = LSS.rparen THEN LSS.Get(sym) ELSE LSS.Mark("rparen ?") END - ELSE LSS.Mark("not a module") - END - ELSE LSS.Mark("bad statement") - END - ELSIF sym = LSS.ts THEN (*tri-state*) LSS.Get(sym); - IF sym = LSS.lparen THEN LSS.Get(sym) ELSE LSS.Mark("( missing") END ; - IF sym = LSS.ident THEN - x := ThisObj(LSS.id); x.b := undef; (*INOUT parameter*) - IF x.val # 5 THEN LSS.Mark("not INOUT") END ; - LSS.Get(sym); - IF sym = LSS.comma THEN LSS.Get(sym) END ; - IF sym = LSS.ident THEN y := ThisObj(LSS.id); CheckAssign(x, y); y.b := undef END ; (*output from gate*) - LSS.Get(sym); - IF sym = LSS.comma THEN LSS.Get(sym) END ; - expression(z); - IF (z.tag = LSB.lit) & (z.val <= 1) THEN z.type := LSB.bitType END ; - CheckAssign(x, z); LSS.Get(sym); - IF sym = LSS.comma THEN LSS.Get(sym) END ; - expression(w); (*control*) - IF w.type # LSB.bitType THEN CheckAssign(x, w) END ; - w := New(LSB.next, z, w); x.b := New(LSB.ts, y, w); - IF sym = LSS.rparen THEN LSS.Get(sym) ELSE LSS.Mark(") missing") END - END - END - END Statement; - - PROCEDURE StatSequence; - BEGIN Statement; - WHILE sym <= LSS.semicolon DO - IF sym < LSS.semicolon THEN LSS.Mark("semicolon missing?") END ; - WHILE sym = LSS.semicolon DO LSS.Get(sym) END ; - Statement - END ; - IF sym = LSS.end THEN LSS.Get(sym) ELSE LSS.Mark("END ?") END - END StatSequence; - - (*---------------------------------------------------*) - - (* for variables and registers,, obj.val has the meaning - 0 register - 1 register with imlicit clock "clk" - 2 variable - 3 output parameter - 4 output parameter with register - 5 inout parameter - 6 input parameter *) - - PROCEDURE ConstDeclaration; - VAR obj: LSB.Object; - BEGIN - IF sym = LSS.ident THEN - obj := NewObj(LSB.const); LSS.Get(sym); - IF (sym = LSS.becomes) OR (sym = LSS.eql) THEN LSS.Get(sym) ELSE LSS.Mark(":= ?") END ; - expression(obj.b); obj.type := LSB.integer; - IF sym = LSS.semicolon THEN LSS.Get(sym) ELSE LSS.Mark("semicolon ?") END - ELSE LSS.Mark("ident ?") - END - END ConstDeclaration; - - PROCEDURE Type0(VAR type: LSB.Type); - VAR obj: LSB.Object; len, size: LONGINT; - eltyp: LSB.Type; arrtyp: LSB.ArrayType; - BEGIN len := 1; - IF sym = LSS.lbrak THEN (*array*) LSS.Get(sym); - IF sym = LSS.integer THEN len := LSS.val; LSS.Get(sym) - ELSIF sym = LSS.ident THEN obj := ThisObj(LSS.id); len := obj.val - END ; - IF sym = LSS.rbrak THEN LSS.Get(sym) ELSE LSS.Mark("rbrak ?") END ; - Type0(eltyp); NEW(arrtyp); size := eltyp.size * len; - arrtyp.eltyp := eltyp; type := arrtyp; type.len := len; type.size := size - ELSIF sym = LSS.ident THEN - obj := ThisObj(LSS.id); LSS.Get(sym); - IF obj # NIL THEN - IF obj.tag = LSB.typ THEN type := obj.type ELSE LSS.Mark("not a type"); type := LSB.bitType END - ELSE LSS.Mark("type ?") - END - ELSE type := LSB.bitType; LSS.Mark("ident or [") - END - END Type0; - - PROCEDURE TypeDeclaration; - VAR obj: LSB.Object; utyp: LSB.UnitType; - BEGIN - IF sym = LSS.ident THEN - obj := NewObj(LSB.typ); LSS.Get(sym); - IF (sym = LSS.becomes) OR (sym = LSS.eql) THEN LSS.Get(sym) ELSE LSS.Mark(":= ?") END ; - IF sym = LSS.module THEN - LSS.Get(sym); NEW(utyp); Unit(utyp.firstobj); obj.type := utyp; obj.type.typobj := obj - ELSE Type0(obj.type) - END ; - IF sym = LSS.semicolon THEN LSS.Get(sym) ELSE LSS.Mark("semicolon ?") END - ELSE LSS.Mark("ident ?") - END - END TypeDeclaration; - - PROCEDURE VarList(kind: INTEGER; clk: LSB.Item); - VAR first, new, obj: LSB.Object; type: LSB.Type; - BEGIN obj := NIL; - WHILE sym = LSS.ident DO - new := NewObj(LSB.var); new.name := LSS.id; new.val := kind; first := new; LSS.Get(sym); - IF sym = LSS.comma THEN LSS.Get(sym) ELSIF sym = LSS.ident THEN LSS.Mark("comma missing") END ; - WHILE sym = LSS.ident DO - new := NewObj(LSB.var); new.name := LSS.id; new.val := kind; LSS.Get(sym); - IF sym = LSS.comma THEN LSS.Get(sym) ELSIF sym = LSS.ident THEN LSS.Mark("comma missing") END - END ; - IF sym = LSS.colon THEN - LSS.Get(sym); Type0(type); obj := first; - WHILE obj # bot DO obj.type := type; obj.a := clk; obj := obj.next END - ELSE LSS.Mark("colon ?") - END ; - IF sym = LSS.semicolon THEN LSS.Get(sym) - ELSIF sym # LSS.rparen THEN LSS.Mark("semicolon or rparen missing") - END - END - END VarList; - - PROCEDURE ParamList; - VAR kind: INTEGER; - BEGIN - IF sym = LSS.in THEN LSS.Get(sym); kind := 6 - ELSIF sym = LSS.out THEN LSS.Get(sym); - IF sym = LSS.reg THEN LSS.Get(sym); kind := 4 ELSE kind := 3 END - ELSIF sym = LSS.inout THEN LSS.Get(sym); kind := 5 - END ; - VarList(kind, NIL) - END ParamList; - - PROCEDURE Traverse(x: LSB.Item); - BEGIN - IF x # NIL THEN - IF x IS LSB.Object THEN - IF (x.tag = LSB.var) & (x.val >= 2) THEN (*not reg*) - IF x(LSB.Object).marked THEN (*loop*) - Texts.WriteString(W, x(LSB.Object).name); Texts.Write(W, " "); err := TRUE - ELSIF x.b # NIL THEN x(LSB.Object).marked := TRUE; Traverse(x.b) - END ; - x(LSB.Object).marked := FALSE - END - ELSE Traverse(x.a); Traverse(x.b) - END - END - END Traverse; - - PROCEDURE Unit0(VAR locals: LSB.Object); - VAR obj, oldtop: LSB.Object; kind: INTEGER; clock: LSB.Item; - BEGIN oldtop := top.next; top.next := LSB.root; (*top is dummy*) - IF sym = LSS.lparen THEN LSS.Get(sym) ELSE LSS.Mark("lparen ?") END ; - WHILE (sym = LSS.in) OR (sym = LSS.out) OR (sym = LSS.inout) DO ParamList END ; - IF sym = LSS.rparen THEN LSS.Get(sym) ELSE LSS.Mark("rparen ?") END ; - IF sym = LSS.xor (*arrow*) THEN LSS.Get(sym); locals := top.next - ELSE - IF sym = LSS.semicolon THEN LSS.Get(sym) ELSE LSS.Mark("semicolon ?") END ; - IF sym = LSS.const THEN LSS.Get(sym); - WHILE sym = LSS.ident DO ConstDeclaration END - END ; - IF sym = LSS.type THEN LSS.Get(sym); - WHILE sym = LSS.ident DO TypeDeclaration END - END ; - WHILE (sym = LSS.var) OR (sym = LSS.reg) DO - IF sym = LSS.var THEN LSS.Get(sym); - WHILE sym = LSS.ident DO VarList(2, NIL) END - ELSE (*reg*) kind := 0; LSS.Get(sym); - IF sym = LSS.lparen THEN (*clock*) - LSS.Get(sym); expression(clock); - IF clock.type # LSB.bitType THEN LSS.Mark("clock must be bitType") END ; - IF (clock IS LSB.Object) & (clock(LSB.Object).name = "clk") THEN kind := 1; clock := NIL END ; - IF sym = LSS.rparen THEN LSS.Get(sym) ELSE LSS.Mark("rparen ?") END - ELSE LSS.Mark("lparen expected"); clock := undef - END ; - WHILE sym = LSS.ident DO VarList(kind, clock) END - END - END ; - locals := top.next; - IF sym = LSS.begin THEN LSS.Get(sym); StatSequence END ; - obj := locals; err := FALSE; (*find unassigned variables*) - WHILE obj # LSB.root DO - IF (obj.tag = LSB.var) & (obj.val < 5) THEN - IF (obj.b = NIL) & (obj.val < 4) THEN Texts.WriteString(W, obj.name); Texts.Write(W, " "); err := TRUE - ELSIF obj.b = undef THEN obj.b := NIL - END - END ; - obj := obj.next - END ; - IF err THEN Texts.WriteString(W, " unassigned"); Texts.WriteLn(W) - ELSE obj := locals; err := FALSE; (*find combinatorial loops*) - WHILE obj # LSB.root DO - IF obj.tag = LSB.var THEN obj.marked := TRUE; Traverse(obj.b); obj.marked := FALSE END ; - obj := obj.next - END ; - IF err THEN Texts.WriteString(W, "in loop"); Texts.WriteLn(W) END - END - END ; - IF err THEN Texts.Append(Oberon.Log, W.buf) END ; - top.next := oldtop - END Unit0; - - PROCEDURE Module(T: Texts.Text; pos: LONGINT); - VAR root: LSB.Object; modname: ARRAY 32 OF CHAR; - BEGIN Texts.WriteString(W, "compiling Lola: "); - bot := LSB.root; top.next := bot; LSS.Init(T, pos); LSS.Get(sym); - IF sym = LSS.module THEN - LSS.Get(sym); - IF sym = LSS.ident THEN - modname := LSS.id; Texts.WriteString(W, LSS.id); LSS.Get(sym); - Texts.WriteLn(W); Texts.Append(Oberon.Log, W.buf); - ELSE LSS.Mark("ident ?") - END ; - Unit(root); - IF sym = LSS.ident THEN LSS.Get(sym); - IF LSS.id # modname THEN LSS.Mark("no match") END - END ; - IF sym # LSS.period THEN LSS.Mark("period ?") END ; - IF ~LSS.error THEN LSB.Register(modname, root) - ELSE Texts.WriteString(W, "compilation failed"); Texts.WriteLn(W); LSB.Register("", LSB.root) - END - ELSE LSS.Mark("module ?") - END ; - Texts.Append(Oberon.Log, W.buf) - END Module; - - PROCEDURE Compile*; - VAR beg, end, time: LONGINT; - S: Texts.Scanner; T: Texts.Text; - BEGIN Texts.OpenScanner(S, Oberon.Par.text, Oberon.Par.pos); Texts.Scan(S); - IF S.class = Texts.Char THEN - IF S.c = "*" THEN - ELSIF S.c = "@" THEN - Oberon.GetSelection(T, beg, end, time); - IF time >= 0 THEN Module(T, beg) END - END - ELSIF S.class = Texts.Name THEN - NEW(T); Texts.Open(T, S.s); Module(T, 0) - END ; - Oberon.Par.pos := Texts.Pos(S); - Texts.Append(Oberon.Log, W.buf) - END Compile; - -BEGIN Texts.OpenWriter(W); - Texts.WriteString(W, "Lola compiler; NW 6.7.2015"); Texts.WriteLn(W); - NEW(top); bot := LSB.root; NEW(undef); undef.tag := 2; undef.type := LSB.bitType; - Unit := Unit0; factor := factor0; expression := expression0; -END LSC. +MODULE LSC; (*Lola System Compiler, NW 8.1.95 / 26.9.2015 for RISC (LSCX)*) + IMPORT Texts, Oberon, LSB, LSS; + + VAR sym: INTEGER; + err: BOOLEAN; (*used at end of Unit*) + top, bot, undef: LSB.Object; + factor: PROCEDURE (VAR x: LSB.Item); (*to avoid forward references*) + expression: PROCEDURE (VAR x: LSB.Item); + Unit: PROCEDURE (VAR locals: LSB.Object); + W: Texts.Writer; + + PROCEDURE Err(n: INTEGER); + BEGIN LSS.Mark("type error"); Texts.WriteInt(W, n, 4); + Texts.WriteLn(W); Texts.Append(Oberon.Log, W.buf) + END Err; + + PROCEDURE Log(m: LONGINT): LONGINT; + VAR n: LONGINT; + BEGIN n := 1; + WHILE m > 1 DO m := m DIV 2; INC(n) END ; + RETURN n + END Log; + + PROCEDURE New(tag: INTEGER; a, b: LSB.Item): LSB.Item; + VAR z: LSB.Item; + BEGIN NEW(z); z.tag := tag; z.a := a; z.b := b; z.val := b.val; RETURN z + END New; + + PROCEDURE NewObj(class: INTEGER): LSB.Object; (*insert at end, before BIT*) + VAR new, x: LSB.Object; + BEGIN x := top; + WHILE (x.next # bot) & (x.next.name # LSS.id) DO x := x.next END ; + IF x.next = bot THEN + NEW(new); new.name := LSS.id; new.tag := class; new.next := bot; x.next := new + ELSE LSS.Mark("mult def"); new := x + END ; + RETURN new + END NewObj; + + PROCEDURE ThisObj(id: LSS.Ident): LSB.Object; (*find object with name = identifier last read*) + VAR x: LSB.Object; + BEGIN x := top.next; + WHILE (x # NIL) & (x.name # id) DO x := x.next END ; + IF x = NIL THEN LSS.Mark("undef"); x := undef END ; + RETURN x + END ThisObj; + + PROCEDURE CheckTypes(x, y, z: LSB.Item); (*z.type = result type*) + VAR xtyp, ytyp: LSB.Type; + BEGIN xtyp := x.type; ytyp := y.type; z.type := xtyp; z.size := x.size; z.val := x.val; + IF xtyp = LSB.bitType THEN z.type := xtyp; + IF ytyp = LSB.integer THEN (* b + 0 *) + IF y.val >= 2 THEN Err(20); LSS.Mark("only 0 or 1") END + ELSIF ytyp = LSB.string THEN (* b + {...} *) Err(21) + ELSIF ytyp # LSB.bitType THEN Err(22) + END + ELSIF xtyp IS LSB.ArrayType THEN + IF xtyp(LSB.ArrayType).eltyp = LSB.bitType THEN + IF (ytyp IS LSB.ArrayType) & (xtyp(LSB.ArrayType).eltyp = LSB.bitType) THEN + IF xtyp.size # ytyp.size THEN Err(33) END (* x + y *) + ELSIF ytyp = LSB.integer THEN (* w + 5 *) + IF xtyp.size < Log(y.val) THEN Err(30) END + ELSIF ytyp = LSB.string THEN (*x + {...} *) + IF xtyp.size # y.size THEN Err(31) END + ELSIF ytyp # LSB.bitType THEN Err(34) + END + ELSIF (ytyp IS LSB.ArrayType) & (xtyp(LSB.ArrayType).eltyp = ytyp(LSB.ArrayType).eltyp) THEN + IF (xtyp.size # ytyp.size) THEN Err(40) END + ELSE Err(41) + END + ELSIF xtyp = LSB.string THEN + IF ytyp = LSB.bitType THEN (* {...} + b *) Err(12) + ELSIF (ytyp IS LSB.ArrayType) & (ytyp(LSB.ArrayType).eltyp = LSB.bitType) THEN (* {...} + w *) + IF x.size # ytyp.size THEN Err(13) END + ELSIF ytyp = LSB.integer THEN (* {...} + 5*) + IF x.size < Log(y.val) THEN Err(10) END + ELSIF ytyp = LSB.string THEN (* {...} + {...} *) + IF x.size # y.size THEN Err(11) END ; + ELSE Err(14) + END + ELSIF xtyp = LSB.integer THEN + IF (ytyp IS LSB.ArrayType) & (ytyp(LSB.ArrayType).eltyp = LSB.bitType) THEN (* 5 + w *) + IF Log(x.val) > ytyp.size THEN Err(3); LSS.Mark("const too large") END + ELSIF ytyp = LSB.bitType THEN (* 5 + b *) + IF x.val >= 2 THEN Err(2) END + ELSIF ytyp = LSB.integer THEN (* 5 + 5 *) + ELSIF ytyp = LSB.string THEN (* 5 + {...} *) + IF Log(x.val) > y.size THEN Err(12) END + ELSE Err(4) + END + END + END CheckTypes; + + PROCEDURE selector(VAR x: LSB.Item); + VAR y, z: LSB.Item; obj: LSB.Object; + eltyp: LSB.Type; len, kind: LONGINT; + BEGIN + WHILE (sym = LSS.lbrak) OR (sym = LSS.period) DO + IF sym = LSS.lbrak THEN + eltyp := x.type(LSB.ArrayType).eltyp; LSS.Get(sym); expression(y); + IF sym = LSS.colon THEN (*range*) + LSS.Get(sym); expression(z); + IF (y.tag = LSB.lit) & (z.tag = LSB.lit) THEN + len := y.val - z.val + 1; y := New(LSB.range, y, z); x := New(LSB.sel, x, y); x.type := LSB.string; x.size := len + END + ELSE kind := x.val; x := New(LSB.sel, x, y); x.type := eltyp; x.val := kind + END ; + IF sym = LSS.rbrak THEN LSS.Get(sym) ELSE LSS.Mark("rbrak ?") END + ELSE (*sym = LSS.period*) LSS.Get(sym); factor(y); + IF (y.tag = LSB.lit) & (y.val >= x.type.len) THEN LSS.Mark("too large") END ; + eltyp := x.type(LSB.ArrayType).eltyp; kind := x.val; x := New(LSB.sel, x, y); x.type := eltyp; x.val := kind + END + END + END selector; + + PROCEDURE elem(VAR x: LSB.Item; VAR len: LONGINT); + VAR y, z: LSB.Item; m, n: LONGINT; + BEGIN expression(x); + IF (x.type = LSB.integer) OR (x.type = LSB.string) THEN m := x.size ELSE m := x.type.size END ; + IF sym = LSS.repl THEN + LSS.Get(sym); + IF sym = LSS.integer THEN + NEW(y); y.tag := LSB.lit; n := LSS.val; y.val := n; y.type := LSB.integer; LSS.Get(sym); + x := New(LSB.repl, x, y) + END + ELSE n := 1 + END ; + len := m*n + END elem; + + PROCEDURE constructor(VAR x: LSB.Item); + VAR y: LSB.Item; n, len: LONGINT; + BEGIN elem(x, len); + WHILE sym = LSS.comma DO + LSS.Get(sym); elem(y, n); INC(len, n); x := New(LSB.cons, x, y); x.val := len + END ; + x.size := len; x.type := LSB.string; + IF sym = LSS.rbrace THEN LSS.Get(sym) ELSE LSS.Mark("rbrace ?") END + END constructor; + + PROCEDURE factor0(VAR x: LSB.Item); + VAR obj: LSB.Object; y, z: LSB.Item; + n, len: LONGINT; t: LSB.ArrayType; + BEGIN + IF sym = LSS.ident THEN + x := ThisObj(LSS.id); LSS.Get(sym); + IF x.tag = LSB.var THEN selector(x) + ELSIF x.tag = LSB.const THEN n := x.b.val; NEW(x); x.tag := LSB.lit; x.val := n; x.type := LSB.integer + ELSE LSS.Mark("bad factor") + END + ELSIF sym = LSS.lparen THEN + LSS.Get(sym); expression(x); + IF sym = LSS.rparen THEN LSS.Get(sym) ELSE LSS.Mark("rparen ?") END + ELSIF sym = LSS.integer THEN + NEW(x); x.tag := LSB.lit; x.val := LSS.val; x.type := LSB.integer; LSS.Get(sym); + IF sym = LSS.apo THEN LSS.Get(sym); + IF sym = LSS.integer THEN + len := LSS.val; LSS.Get(sym); + IF len < Log(x.val) THEN LSS.Mark("value too large") END + ELSE LSS.Mark("integer ?"); len := 0 + END ; + x.size := len + ELSE len := 0 + END ; + x.size := len + ELSIF sym = LSS.not THEN + LSS.Get(sym); factor(x); y := New(LSB.not, NIL, x); y.type := x.type; y.size := x.size; x := y + ELSIF sym = LSS.lbrace THEN LSS.Get(sym); constructor(x) + ELSE LSS.Mark("bad factor") + END + END factor0; + + PROCEDURE term(VAR x: LSB.Item); + VAR y, z: LSB.Item; op: INTEGER; + BEGIN factor(x); + WHILE (sym >= LSS.times) & (sym <= LSS.and) DO + IF sym = LSS.and THEN op := LSB.and + ELSIF sym = LSS.times THEN op := LSB.mul + ELSIF sym = LSS.div THEN op := LSB.div + END ; + LSS.Get(sym); factor(y); z := New(op, x, y); CheckTypes(x, y, z); x := z + END + END term; + + PROCEDURE SimpleExpression(VAR x: LSB.Item); + VAR y, z: LSB.Item; op: INTEGER; + BEGIN + IF sym = LSS.minus THEN LSS.Get(sym); term(y); + IF y.tag = LSB.lit THEN x := y; x.val := -y.val + ELSE x := New(LSB.sub, NIL, y); x.type := y.type; x.size := y.size + END + ELSIF sym = LSS.plus THEN LSS.Get(sym); term(x); + ELSE term(x) + END ; + WHILE (sym >= LSS.plus) & (sym <= LSS.xor) DO + IF sym = LSS.or THEN op := LSB.or + ELSIF sym = LSS.xor THEN op := LSB.xor + ELSIF sym = LSS.plus THEN op := LSB.add + ELSIF sym = LSS.minus THEN op := LSB.sub + END ; + LSS.Get(sym); term(y); z := New(op, x, y); CheckTypes(x, y, z); x := z + END + END SimpleExpression; + + PROCEDURE UncondExpression(VAR x: LSB.Item); + VAR y, z: LSB.Item; rel: INTEGER; + BEGIN SimpleExpression(x); + IF (sym >= LSS.eql) & (sym <= LSS.geq) THEN + IF sym = LSS.eql THEN rel := LSB.eql + ELSIF sym = LSS.neq THEN rel := LSB.neq + ELSIF sym = LSS.lss THEN rel := LSB.lss + ELSIF sym = LSS.geq THEN rel := LSB.geq + ELSIF sym = LSS.leq THEN rel := LSB.leq + ELSE rel := LSB.gtr + END ; + LSS.Get(sym); SimpleExpression(y); z := New(rel, x, y); CheckTypes(x, y, z); z.type := LSB.bitType; x := z + END + END UncondExpression; + + PROCEDURE expression0(VAR x: LSB.Item); + VAR y, z, w: LSB.Item; + BEGIN UncondExpression(x); + IF sym = LSS.then THEN + IF x.type # LSB.bitType THEN LSS.Mark("Boolean?") END ; + LSS.Get(sym); expression(y); + IF sym = LSS.colon THEN + LSS.Get(sym); expression(z); w := New(LSB.else, y, z); CheckTypes(y, z, w); + x := New(LSB.then, x, w); x.type := w.type; x.size := w.size + ELSE LSS.Mark("colon ?") + END + END + END expression0; + + PROCEDURE CheckAssign(x, y: LSB.Item); + VAR xtyp, ytyp: LSB.Type; + BEGIN xtyp := x.type; ytyp := y.type; + IF xtyp # ytyp THEN + IF xtyp = LSB.bitType THEN + IF (ytyp # LSB.integer) OR (y.val >= 2) THEN Err(70); END + ELSIF xtyp IS LSB.ArrayType THEN + IF xtyp(LSB.ArrayType).eltyp = LSB.bitType THEN + IF (ytyp IS LSB.ArrayType) & (xtyp(LSB.ArrayType).eltyp = LSB.bitType) THEN (*w := w*) + IF xtyp.size # ytyp.size THEN Err(71) END (* x + y *) + ELSIF ytyp = LSB.integer THEN (* w := 5 *) + IF xtyp.size < Log(y.val) THEN Err(72) END + ELSIF ytyp = LSB.string THEN (* w := {...} *) + IF xtyp.size # y.size THEN Err(73) END + ELSE Err(74) + END + ELSE Err(74) + END + END + END + END CheckAssign; + + PROCEDURE Param(fpar: LSB.Object; VAR apar: LSB.Item); + VAR y, z: LSB.Item; + BEGIN expression(y); apar := New(LSB.next, NIL, y); CheckAssign(fpar, y); + IF fpar.val IN {3, 4} THEN (*OUT or INOUT parameter*) + IF ~(y.tag IN {3, 7}) THEN (*actual param is expression?*) LSS.Mark("bad actual param") + ELSIF y.b = NIL THEN y.b := undef + END + END + END Param; + + PROCEDURE Statement; + VAR w, x, y, z, apar, npar: LSB.Item; + unit: LSB.UnitType; fpar: LSB.Object; + BEGIN + IF sym < LSS.ident THEN LSS.Mark("bad factor"); + REPEAT LSS.Get(sym) UNTIL sym >= LSS.ident + END ; + IF sym = LSS.ident THEN + x := ThisObj(LSS.id); z := x; LSS.Get(sym); selector(z); + IF sym = LSS.becomes THEN LSS.Get(sym); + IF x.val >= 5 THEN LSS.Mark("assignment to read-only") END ; + IF (x.b # NIL) & ~(x.type IS LSB.ArrayType) THEN LSS.Mark("mult assign") END ; + expression(y); CheckAssign(z, y); x.b := y; (*tricky*) + IF z # x THEN x.a := z.b; x.val := 1 (*overwriting clk field x.a *) END + ELSIF sym = LSS.lparen THEN LSS.Get(sym); (*unit instantiation*) + IF x.type IS LSB.UnitType THEN + unit := x.type(LSB.UnitType); fpar := unit.firstobj; + IF sym # LSS.rparen THEN + Param(fpar, apar); x.b := apar; fpar := fpar.next; + WHILE sym # LSS.rparen DO + IF sym = LSS.comma THEN LSS.Get(sym) END ; + Param(fpar, npar); + IF fpar.tag >= 3 THEN fpar := fpar.next; apar.a := npar; apar := npar + ELSE LSS.Mark("too many params") + END + END ; + IF fpar.val >= 3 THEN LSS.Mark("too few params") END + END ; + IF sym = LSS.rparen THEN LSS.Get(sym) ELSE LSS.Mark("rparen ?") END + ELSE LSS.Mark("not a module") + END + ELSE LSS.Mark("bad statement") + END + ELSIF sym = LSS.ts THEN (*tri-state*) LSS.Get(sym); + IF sym = LSS.lparen THEN LSS.Get(sym) ELSE LSS.Mark("( missing") END ; + IF sym = LSS.ident THEN + x := ThisObj(LSS.id); x.b := undef; (*INOUT parameter*) + IF x.val # 5 THEN LSS.Mark("not INOUT") END ; + LSS.Get(sym); + IF sym = LSS.comma THEN LSS.Get(sym) END ; + IF sym = LSS.ident THEN y := ThisObj(LSS.id); CheckAssign(x, y); y.b := undef END ; (*output from gate*) + LSS.Get(sym); + IF sym = LSS.comma THEN LSS.Get(sym) END ; + expression(z); + IF (z.tag = LSB.lit) & (z.val <= 1) THEN z.type := LSB.bitType END ; + CheckAssign(x, z); LSS.Get(sym); + IF sym = LSS.comma THEN LSS.Get(sym) END ; + expression(w); (*control*) + IF w.type # LSB.bitType THEN CheckAssign(x, w) END ; + w := New(LSB.next, z, w); x.b := New(LSB.ts, y, w); + IF sym = LSS.rparen THEN LSS.Get(sym) ELSE LSS.Mark(") missing") END + END + END + END Statement; + + PROCEDURE StatSequence; + BEGIN Statement; + WHILE sym <= LSS.semicolon DO + IF sym < LSS.semicolon THEN LSS.Mark("semicolon missing?") END ; + WHILE sym = LSS.semicolon DO LSS.Get(sym) END ; + Statement + END ; + IF sym = LSS.end THEN LSS.Get(sym) ELSE LSS.Mark("END ?") END + END StatSequence; + + (*---------------------------------------------------*) + + (* for variables and registers,, obj.val has the meaning + 0 register + 1 register with imlicit clock "clk" + 2 variable + 3 output parameter + 4 output parameter with register + 5 inout parameter + 6 input parameter *) + + PROCEDURE ConstDeclaration; + VAR obj: LSB.Object; + BEGIN + IF sym = LSS.ident THEN + obj := NewObj(LSB.const); LSS.Get(sym); + IF (sym = LSS.becomes) OR (sym = LSS.eql) THEN LSS.Get(sym) ELSE LSS.Mark(":= ?") END ; + expression(obj.b); obj.type := LSB.integer; + IF sym = LSS.semicolon THEN LSS.Get(sym) ELSE LSS.Mark("semicolon ?") END + ELSE LSS.Mark("ident ?") + END + END ConstDeclaration; + + PROCEDURE Type0(VAR type: LSB.Type); + VAR obj: LSB.Object; len, size: LONGINT; + eltyp: LSB.Type; arrtyp: LSB.ArrayType; + BEGIN len := 1; + IF sym = LSS.lbrak THEN (*array*) LSS.Get(sym); + IF sym = LSS.integer THEN len := LSS.val; LSS.Get(sym) + ELSIF sym = LSS.ident THEN obj := ThisObj(LSS.id); len := obj.val + END ; + IF sym = LSS.rbrak THEN LSS.Get(sym) ELSE LSS.Mark("rbrak ?") END ; + Type0(eltyp); NEW(arrtyp); size := eltyp.size * len; + arrtyp.eltyp := eltyp; type := arrtyp; type.len := len; type.size := size + ELSIF sym = LSS.ident THEN + obj := ThisObj(LSS.id); LSS.Get(sym); + IF obj # NIL THEN + IF obj.tag = LSB.typ THEN type := obj.type ELSE LSS.Mark("not a type"); type := LSB.bitType END + ELSE LSS.Mark("type ?") + END + ELSE type := LSB.bitType; LSS.Mark("ident or [") + END + END Type0; + + PROCEDURE TypeDeclaration; + VAR obj: LSB.Object; utyp: LSB.UnitType; + BEGIN + IF sym = LSS.ident THEN + obj := NewObj(LSB.typ); LSS.Get(sym); + IF (sym = LSS.becomes) OR (sym = LSS.eql) THEN LSS.Get(sym) ELSE LSS.Mark(":= ?") END ; + IF sym = LSS.module THEN + LSS.Get(sym); NEW(utyp); Unit(utyp.firstobj); obj.type := utyp; obj.type.typobj := obj + ELSE Type0(obj.type) + END ; + IF sym = LSS.semicolon THEN LSS.Get(sym) ELSE LSS.Mark("semicolon ?") END + ELSE LSS.Mark("ident ?") + END + END TypeDeclaration; + + PROCEDURE VarList(kind: INTEGER; clk: LSB.Item); + VAR first, new, obj: LSB.Object; type: LSB.Type; + BEGIN obj := NIL; + WHILE sym = LSS.ident DO + new := NewObj(LSB.var); new.name := LSS.id; new.val := kind; first := new; LSS.Get(sym); + IF sym = LSS.comma THEN LSS.Get(sym) ELSIF sym = LSS.ident THEN LSS.Mark("comma missing") END ; + WHILE sym = LSS.ident DO + new := NewObj(LSB.var); new.name := LSS.id; new.val := kind; LSS.Get(sym); + IF sym = LSS.comma THEN LSS.Get(sym) ELSIF sym = LSS.ident THEN LSS.Mark("comma missing") END + END ; + IF sym = LSS.colon THEN + LSS.Get(sym); Type0(type); obj := first; + WHILE obj # bot DO obj.type := type; obj.a := clk; obj := obj.next END + ELSE LSS.Mark("colon ?") + END ; + IF sym = LSS.semicolon THEN LSS.Get(sym) + ELSIF sym # LSS.rparen THEN LSS.Mark("semicolon or rparen missing") + END + END + END VarList; + + PROCEDURE ParamList; + VAR kind: INTEGER; + BEGIN + IF sym = LSS.in THEN LSS.Get(sym); kind := 6 + ELSIF sym = LSS.out THEN LSS.Get(sym); + IF sym = LSS.reg THEN LSS.Get(sym); kind := 4 ELSE kind := 3 END + ELSIF sym = LSS.inout THEN LSS.Get(sym); kind := 5 + END ; + VarList(kind, NIL) + END ParamList; + + PROCEDURE Traverse(x: LSB.Item); + BEGIN + IF x # NIL THEN + IF x IS LSB.Object THEN + IF (x.tag = LSB.var) & (x.val >= 2) THEN (*not reg*) + IF x(LSB.Object).marked THEN (*loop*) + Texts.WriteString(W, x(LSB.Object).name); Texts.Write(W, " "); err := TRUE + ELSIF x.b # NIL THEN x(LSB.Object).marked := TRUE; Traverse(x.b) + END ; + x(LSB.Object).marked := FALSE + END + ELSE Traverse(x.a); Traverse(x.b) + END + END + END Traverse; + + PROCEDURE Unit0(VAR locals: LSB.Object); + VAR obj, oldtop: LSB.Object; kind: INTEGER; clock: LSB.Item; + BEGIN oldtop := top.next; top.next := LSB.root; (*top is dummy*) + IF sym = LSS.lparen THEN LSS.Get(sym) ELSE LSS.Mark("lparen ?") END ; + WHILE (sym = LSS.in) OR (sym = LSS.out) OR (sym = LSS.inout) DO ParamList END ; + IF sym = LSS.rparen THEN LSS.Get(sym) ELSE LSS.Mark("rparen ?") END ; + IF sym = LSS.xor (*arrow*) THEN LSS.Get(sym); locals := top.next + ELSE + IF sym = LSS.semicolon THEN LSS.Get(sym) ELSE LSS.Mark("semicolon ?") END ; + IF sym = LSS.const THEN LSS.Get(sym); + WHILE sym = LSS.ident DO ConstDeclaration END + END ; + IF sym = LSS.type THEN LSS.Get(sym); + WHILE sym = LSS.ident DO TypeDeclaration END + END ; + WHILE (sym = LSS.var) OR (sym = LSS.reg) DO + IF sym = LSS.var THEN LSS.Get(sym); + WHILE sym = LSS.ident DO VarList(2, NIL) END + ELSE (*reg*) kind := 0; LSS.Get(sym); + IF sym = LSS.lparen THEN (*clock*) + LSS.Get(sym); expression(clock); + IF clock.type # LSB.bitType THEN LSS.Mark("clock must be bitType") END ; + IF (clock IS LSB.Object) & (clock(LSB.Object).name = "clk") THEN kind := 1; clock := NIL END ; + IF sym = LSS.rparen THEN LSS.Get(sym) ELSE LSS.Mark("rparen ?") END + ELSE LSS.Mark("lparen expected"); clock := undef + END ; + WHILE sym = LSS.ident DO VarList(kind, clock) END + END + END ; + locals := top.next; + IF sym = LSS.begin THEN LSS.Get(sym); StatSequence END ; + obj := locals; err := FALSE; (*find unassigned variables*) + WHILE obj # LSB.root DO + IF (obj.tag = LSB.var) & (obj.val < 5) THEN + IF (obj.b = NIL) & (obj.val < 4) THEN Texts.WriteString(W, obj.name); Texts.Write(W, " "); err := TRUE + ELSIF obj.b = undef THEN obj.b := NIL + END + END ; + obj := obj.next + END ; + IF err THEN Texts.WriteString(W, " unassigned"); Texts.WriteLn(W) + ELSE obj := locals; err := FALSE; (*find combinatorial loops*) + WHILE obj # LSB.root DO + IF obj.tag = LSB.var THEN obj.marked := TRUE; Traverse(obj.b); obj.marked := FALSE END ; + obj := obj.next + END ; + IF err THEN Texts.WriteString(W, "in loop"); Texts.WriteLn(W) END + END + END ; + IF err THEN Texts.Append(Oberon.Log, W.buf) END ; + top.next := oldtop + END Unit0; + + PROCEDURE Module(T: Texts.Text; pos: LONGINT); + VAR root: LSB.Object; modname: ARRAY 32 OF CHAR; + BEGIN Texts.WriteString(W, "compiling Lola: "); + bot := LSB.root; top.next := bot; LSS.Init(T, pos); LSS.Get(sym); + IF sym = LSS.module THEN + LSS.Get(sym); + IF sym = LSS.ident THEN + modname := LSS.id; Texts.WriteString(W, LSS.id); LSS.Get(sym); + Texts.WriteLn(W); Texts.Append(Oberon.Log, W.buf); + ELSE LSS.Mark("ident ?") + END ; + Unit(root); + IF sym = LSS.ident THEN LSS.Get(sym); + IF LSS.id # modname THEN LSS.Mark("no match") END + END ; + IF sym # LSS.period THEN LSS.Mark("period ?") END ; + IF ~LSS.error THEN LSB.Register(modname, root) + ELSE Texts.WriteString(W, "compilation failed"); Texts.WriteLn(W); LSB.Register("", LSB.root) + END + ELSE LSS.Mark("module ?") + END ; + Texts.Append(Oberon.Log, W.buf) + END Module; + + PROCEDURE Compile*; + VAR beg, end, time: LONGINT; + S: Texts.Scanner; T: Texts.Text; + BEGIN Texts.OpenScanner(S, Oberon.Par.text, Oberon.Par.pos); Texts.Scan(S); + IF S.class = Texts.Char THEN + IF S.c = "*" THEN + ELSIF S.c = "@" THEN + Oberon.GetSelection(T, beg, end, time); + IF time >= 0 THEN Module(T, beg) END + END + ELSIF S.class = Texts.Name THEN + NEW(T); Texts.Open(T, S.s); Module(T, 0) + END ; + Oberon.Par.pos := Texts.Pos(S); + Texts.Append(Oberon.Log, W.buf) + END Compile; + +BEGIN Texts.OpenWriter(W); + Texts.WriteString(W, "Lola compiler; NW 6.7.2015"); Texts.WriteLn(W); + NEW(top); bot := LSB.root; NEW(undef); undef.tag := 2; undef.type := LSB.bitType; + Unit := Unit0; factor := factor0; expression := expression0; +END LSC. diff --git a/src/test/confidence/lola/LSS.Mod b/src/test/confidence/lola/LSS.Mod index a7e4cc46..809c4e8b 100755 --- a/src/test/confidence/lola/LSS.Mod +++ b/src/test/confidence/lola/LSS.Mod @@ -1,165 +1,165 @@ -MODULE LSS; (* NW 16.10.93 / 1.9.2015*) - IMPORT Texts, Oberon; - - CONST IdLen* = 32; NofKeys = 11; - (*symbols*) null = 0; - arrow* = 1; times* = 2; div* = 3; and* = 4; plus* = 5; minus* = 6; or* = 7; xor* = 8; not* = 9; - eql* = 10; neq* = 11; lss* = 12; leq* = 13; gtr* = 14; geq* = 15; - at* = 16; apo* = 17; period* = 18; comma* = 19; colon* = 20; rparen* = 21; rbrak* = 22; rbrace* = 23; - then* = 24; lparen* = 26; lbrak* = 27; lbrace* = 28; repl* = 29; becomes* = 30; - ident* = 31; integer* = 32; ts* = 33; semicolon* = 40; end* = 41; - const* = 51; type* = 52; reg* = 53; var* = 54; out* = 55; inout* = 56; in* = 57; - begin* = 58; module* = 59; eof = 60; - - TYPE Ident* = ARRAY IdLen OF CHAR; - - VAR val*: LONGINT; - id*: Ident; - error*: BOOLEAN; - - ch: CHAR; - errpos: LONGINT; - R: Texts.Reader; - W: Texts.Writer; - key: ARRAY NofKeys OF Ident; - symno: ARRAY NofKeys OF INTEGER; - - PROCEDURE Mark*(msg: ARRAY OF CHAR); - VAR p: LONGINT; - BEGIN p := Texts.Pos(R); - IF p > errpos+2 THEN - Texts.WriteString(W, " pos "); Texts.WriteInt(W, p, 1); - Texts.WriteString(W, " err: "); Texts.WriteString(W, msg); - Texts.WriteLn(W); Texts.Append(Oberon.Log, W.buf) - END ; - errpos := p; error := TRUE - END Mark; - - PROCEDURE identifier(VAR sym: INTEGER); - VAR i: INTEGER; - BEGIN i := 0; - REPEAT - IF i < IdLen THEN id[i] := ch; INC(i) END ; - Texts.Read(R, ch) - UNTIL (ch < "0") OR (ch > "9") & (ch < "A") OR (ch > "Z") & (ch < "a") OR (ch > "z"); - IF ch = "'" THEN - IF i < IdLen THEN id[i] := ch; INC(i) END ; - Texts.Read(R, ch) - END ; - IF i = IdLen THEN Mark("ident too long"); id[IdLen-1] := 0X - ELSE id[i] := 0X - END ; - i := 0; - WHILE (i < NofKeys) & (id # key[i]) DO INC(i) END ; - IF i < NofKeys THEN sym := symno[i] ELSE sym := ident END - END identifier; - - PROCEDURE Number(VAR sym: INTEGER); - VAR i, k, h, n, d: LONGINT; - hex: BOOLEAN; - dig: ARRAY 16 OF LONGINT; - BEGIN sym := integer; i := 0; k := 0; n := 0; hex := FALSE; - REPEAT - IF n < 16 THEN d := ORD(ch)-30H; - IF d >= 10 THEN hex := TRUE ; d := d - 7 END ; - dig[n] := d; INC(n) - ELSE Mark("too many digits"); n := 0 - END ; - Texts.Read(R, ch) - UNTIL (ch < "0") OR (ch > "9") & (ch < "A") OR (ch > "F"); - IF ch = "H" THEN (*hex*) - REPEAT h := dig[i]; k := k*10H + h; INC(i) (*no overflow check*) - UNTIL i = n; - Texts.Read(R, ch) - ELSE - IF hex THEN Mark("illegal hex digit") END ; - REPEAT k := k*10 + dig[i]; INC(i) UNTIL i = n - END ; - val := k - END Number; - - PROCEDURE comment; - BEGIN Texts.Read(R, ch); - REPEAT - WHILE ~R.eot & (ch # "*") DO - IF ch = "(" THEN Texts.Read(R, ch); - IF ch = "*" THEN comment END - ELSE Texts.Read(R, ch) - END - END ; - WHILE ch = "*" DO Texts.Read(R, ch) END - UNTIL (ch = ")") OR R.eot; - IF ~R.eot THEN Texts.Read(R, ch) ELSE Mark("comment not terminated") END - END comment; - - PROCEDURE Get*(VAR sym: INTEGER); - BEGIN - REPEAT - WHILE ~R.eot & (ch <= " ") DO Texts.Read(R, ch) END; - IF R.eot THEN sym := eof - ELSIF ch < "A" THEN - IF ch < "0" THEN - IF ch = "!" THEN Texts.Read(R, ch); sym := repl - ELSIF ch = "#" THEN Texts.Read(R, ch); sym := neq - ELSIF ch = "$" THEN Texts.Read(R, ch); sym := null - ELSIF ch = "&" THEN Texts.Read(R, ch); sym := and - ELSIF ch = "'" THEN Texts.Read(R, ch); sym := apo - ELSIF ch = "(" THEN Texts.Read(R, ch); - IF ch = "*" THEN sym := null; comment ELSE sym := lparen END - ELSIF ch = ")" THEN Texts.Read(R, ch); sym := rparen - ELSIF ch = "*" THEN Texts.Read(R, ch); sym := times - ELSIF ch = "+" THEN Texts.Read(R, ch); sym := plus - ELSIF ch = "," THEN Texts.Read(R, ch); sym := comma - ELSIF ch = "-" THEN Texts.Read(R, ch); - IF ch = ">" THEN Texts.Read(R, ch); sym := then ELSE sym := minus END - ELSIF ch = "." THEN Texts.Read(R, ch); sym := period - ELSIF ch = "/" THEN Texts.Read(R, ch); sym := div - ELSE sym := null - END - ELSIF ch <= "9" THEN Number(sym) - ELSIF ch = ":" THEN Texts.Read(R, ch); - IF ch = "=" THEN Texts.Read(R, ch); sym := becomes ELSE sym := colon END - ELSIF ch = ";" THEN Texts.Read(R, ch); sym := semicolon - ELSIF ch = "<" THEN Texts.Read(R, ch); - IF ch = "=" THEN Texts.Read(R, ch); sym := leq ELSE sym := lss END - ELSIF ch = "=" THEN Texts.Read(R, ch); sym := eql - ELSIF ch = ">" THEN Texts.Read(R, ch); - IF ch = "=" THEN Texts.Read(R, ch); sym := geq ELSE sym := gtr END - ELSIF ch = "?" THEN Texts.Read(R, ch); sym := then - ELSIF ch = "@" THEN Texts.Read(R, ch); sym := at - ELSE sym := null - END - ELSIF ch <= "Z" THEN identifier(sym) - ELSIF ch < "a" THEN - IF ch = "[" THEN Texts.Read(R, ch); sym := lbrak - ELSIF ch = "]" THEN Texts.Read(R, ch); sym := rbrak - ELSIF ch = "^" THEN Texts.Read(R, ch); sym := xor - ELSE sym := null - END - ELSIF ch <= "z" THEN identifier(sym) - ELSIF ch <= "{" THEN Texts.Read(R, ch); sym := lbrace - ELSIF ch <= "|" THEN Texts.Read(R, ch); sym := or - ELSIF ch <= "}" THEN Texts.Read(R, ch); sym := rbrace - ELSIF ch <= "~" THEN Texts.Read(R, ch); sym := not - ELSE sym := null - END - UNTIL sym # null - END Get; - - PROCEDURE Init*(T: Texts.Text; pos: LONGINT); - BEGIN error := FALSE; errpos := pos; Texts.OpenReader(R, T, pos); Texts.Read(R, ch) - END Init; - -BEGIN Texts.OpenWriter(W); - key[ 0] := "BEGIN"; symno[0] := begin; - key[ 1] := "CONST"; symno[1] := const; - key[ 2] := "END"; symno[2] := end; - key[3] := "IN"; symno[3] := in; - key[4] := "INOUT"; symno[4] := inout; - key[5] := "MODULE"; symno[5] := module; - key[6] := "OUT"; symno[6] := out; - key[7] := "REG"; symno[7] := reg; - key[8] := "TYPE"; symno[8] := type; - key[9] := "VAR"; symno[9] := var; - key[10] := "TS"; symno[10] := ts -END LSS. +MODULE LSS; (* NW 16.10.93 / 1.9.2015*) + IMPORT Texts, Oberon; + + CONST IdLen* = 32; NofKeys = 11; + (*symbols*) null = 0; + arrow* = 1; times* = 2; div* = 3; and* = 4; plus* = 5; minus* = 6; or* = 7; xor* = 8; not* = 9; + eql* = 10; neq* = 11; lss* = 12; leq* = 13; gtr* = 14; geq* = 15; + at* = 16; apo* = 17; period* = 18; comma* = 19; colon* = 20; rparen* = 21; rbrak* = 22; rbrace* = 23; + then* = 24; lparen* = 26; lbrak* = 27; lbrace* = 28; repl* = 29; becomes* = 30; + ident* = 31; integer* = 32; ts* = 33; semicolon* = 40; end* = 41; + const* = 51; type* = 52; reg* = 53; var* = 54; out* = 55; inout* = 56; in* = 57; + begin* = 58; module* = 59; eof = 60; + + TYPE Ident* = ARRAY IdLen OF CHAR; + + VAR val*: LONGINT; + id*: Ident; + error*: BOOLEAN; + + ch: CHAR; + errpos: LONGINT; + R: Texts.Reader; + W: Texts.Writer; + key: ARRAY NofKeys OF Ident; + symno: ARRAY NofKeys OF INTEGER; + + PROCEDURE Mark*(msg: ARRAY OF CHAR); + VAR p: LONGINT; + BEGIN p := Texts.Pos(R); + IF p > errpos+2 THEN + Texts.WriteString(W, " pos "); Texts.WriteInt(W, p, 1); + Texts.WriteString(W, " err: "); Texts.WriteString(W, msg); + Texts.WriteLn(W); Texts.Append(Oberon.Log, W.buf) + END ; + errpos := p; error := TRUE + END Mark; + + PROCEDURE identifier(VAR sym: INTEGER); + VAR i: INTEGER; + BEGIN i := 0; + REPEAT + IF i < IdLen THEN id[i] := ch; INC(i) END ; + Texts.Read(R, ch) + UNTIL (ch < "0") OR (ch > "9") & (ch < "A") OR (ch > "Z") & (ch < "a") OR (ch > "z"); + IF ch = "'" THEN + IF i < IdLen THEN id[i] := ch; INC(i) END ; + Texts.Read(R, ch) + END ; + IF i = IdLen THEN Mark("ident too long"); id[IdLen-1] := 0X + ELSE id[i] := 0X + END ; + i := 0; + WHILE (i < NofKeys) & (id # key[i]) DO INC(i) END ; + IF i < NofKeys THEN sym := symno[i] ELSE sym := ident END + END identifier; + + PROCEDURE Number(VAR sym: INTEGER); + VAR i, k, h, n, d: LONGINT; + hex: BOOLEAN; + dig: ARRAY 16 OF LONGINT; + BEGIN sym := integer; i := 0; k := 0; n := 0; hex := FALSE; + REPEAT + IF n < 16 THEN d := ORD(ch)-30H; + IF d >= 10 THEN hex := TRUE ; d := d - 7 END ; + dig[n] := d; INC(n) + ELSE Mark("too many digits"); n := 0 + END ; + Texts.Read(R, ch) + UNTIL (ch < "0") OR (ch > "9") & (ch < "A") OR (ch > "F"); + IF ch = "H" THEN (*hex*) + REPEAT h := dig[i]; k := k*10H + h; INC(i) (*no overflow check*) + UNTIL i = n; + Texts.Read(R, ch) + ELSE + IF hex THEN Mark("illegal hex digit") END ; + REPEAT k := k*10 + dig[i]; INC(i) UNTIL i = n + END ; + val := k + END Number; + + PROCEDURE comment; + BEGIN Texts.Read(R, ch); + REPEAT + WHILE ~R.eot & (ch # "*") DO + IF ch = "(" THEN Texts.Read(R, ch); + IF ch = "*" THEN comment END + ELSE Texts.Read(R, ch) + END + END ; + WHILE ch = "*" DO Texts.Read(R, ch) END + UNTIL (ch = ")") OR R.eot; + IF ~R.eot THEN Texts.Read(R, ch) ELSE Mark("comment not terminated") END + END comment; + + PROCEDURE Get*(VAR sym: INTEGER); + BEGIN + REPEAT + WHILE ~R.eot & (ch <= " ") DO Texts.Read(R, ch) END; + IF R.eot THEN sym := eof + ELSIF ch < "A" THEN + IF ch < "0" THEN + IF ch = "!" THEN Texts.Read(R, ch); sym := repl + ELSIF ch = "#" THEN Texts.Read(R, ch); sym := neq + ELSIF ch = "$" THEN Texts.Read(R, ch); sym := null + ELSIF ch = "&" THEN Texts.Read(R, ch); sym := and + ELSIF ch = "'" THEN Texts.Read(R, ch); sym := apo + ELSIF ch = "(" THEN Texts.Read(R, ch); + IF ch = "*" THEN sym := null; comment ELSE sym := lparen END + ELSIF ch = ")" THEN Texts.Read(R, ch); sym := rparen + ELSIF ch = "*" THEN Texts.Read(R, ch); sym := times + ELSIF ch = "+" THEN Texts.Read(R, ch); sym := plus + ELSIF ch = "," THEN Texts.Read(R, ch); sym := comma + ELSIF ch = "-" THEN Texts.Read(R, ch); + IF ch = ">" THEN Texts.Read(R, ch); sym := then ELSE sym := minus END + ELSIF ch = "." THEN Texts.Read(R, ch); sym := period + ELSIF ch = "/" THEN Texts.Read(R, ch); sym := div + ELSE sym := null + END + ELSIF ch <= "9" THEN Number(sym) + ELSIF ch = ":" THEN Texts.Read(R, ch); + IF ch = "=" THEN Texts.Read(R, ch); sym := becomes ELSE sym := colon END + ELSIF ch = ";" THEN Texts.Read(R, ch); sym := semicolon + ELSIF ch = "<" THEN Texts.Read(R, ch); + IF ch = "=" THEN Texts.Read(R, ch); sym := leq ELSE sym := lss END + ELSIF ch = "=" THEN Texts.Read(R, ch); sym := eql + ELSIF ch = ">" THEN Texts.Read(R, ch); + IF ch = "=" THEN Texts.Read(R, ch); sym := geq ELSE sym := gtr END + ELSIF ch = "?" THEN Texts.Read(R, ch); sym := then + ELSIF ch = "@" THEN Texts.Read(R, ch); sym := at + ELSE sym := null + END + ELSIF ch <= "Z" THEN identifier(sym) + ELSIF ch < "a" THEN + IF ch = "[" THEN Texts.Read(R, ch); sym := lbrak + ELSIF ch = "]" THEN Texts.Read(R, ch); sym := rbrak + ELSIF ch = "^" THEN Texts.Read(R, ch); sym := xor + ELSE sym := null + END + ELSIF ch <= "z" THEN identifier(sym) + ELSIF ch <= "{" THEN Texts.Read(R, ch); sym := lbrace + ELSIF ch <= "|" THEN Texts.Read(R, ch); sym := or + ELSIF ch <= "}" THEN Texts.Read(R, ch); sym := rbrace + ELSIF ch <= "~" THEN Texts.Read(R, ch); sym := not + ELSE sym := null + END + UNTIL sym # null + END Get; + + PROCEDURE Init*(T: Texts.Text; pos: LONGINT); + BEGIN error := FALSE; errpos := pos; Texts.OpenReader(R, T, pos); Texts.Read(R, ch) + END Init; + +BEGIN Texts.OpenWriter(W); + key[ 0] := "BEGIN"; symno[0] := begin; + key[ 1] := "CONST"; symno[1] := const; + key[ 2] := "END"; symno[2] := end; + key[3] := "IN"; symno[3] := in; + key[4] := "INOUT"; symno[4] := inout; + key[5] := "MODULE"; symno[5] := module; + key[6] := "OUT"; symno[6] := out; + key[7] := "REG"; symno[7] := reg; + key[8] := "TYPE"; symno[8] := type; + key[9] := "VAR"; symno[9] := var; + key[10] := "TS"; symno[10] := ts +END LSS. diff --git a/src/test/confidence/lola/LSV.Mod b/src/test/confidence/lola/LSV.Mod index 35d45295..6c87497f 100755 --- a/src/test/confidence/lola/LSV.Mod +++ b/src/test/confidence/lola/LSV.Mod @@ -1,238 +1,238 @@ -MODULE LSV; (*Lola System: display Verilog; generate txt-File; NW 31.8.2015*) - IMPORT Files, Texts, Oberon, LSB; - - VAR W: Texts.Writer; - nofgen: INTEGER; - Constructor: PROCEDURE (VAR x: LSB.Item); (*to avoid forward reference*) - F: Files.File; R: Files.Rider; - C: ARRAY 64, 6 OF CHAR; - - PROCEDURE Write(ch: CHAR); - BEGIN Files.Write(R, ch) - END Write; - - PROCEDURE WriteLn; - BEGIN Files.Write(R, 0DX); Files.Write(R, 0AX) - END WriteLn; - - PROCEDURE WriteInt(x: LONGINT); (* x >= 0 *) - VAR i: INTEGER; d: ARRAY 14 OF LONGINT; - BEGIN i := 0; - IF x < 0 THEN Files.Write(R, "-"); x := -x END ; - REPEAT d[i] := x MOD 10; x := x DIV 10; INC(i) UNTIL x = 0; - REPEAT DEC(i); Files.Write(R, CHR(d[i] + 30H)) UNTIL i = 0 - END WriteInt; - - PROCEDURE WriteHex(x: LONGINT); (*x >= 0*) - VAR i: INTEGER; d: ARRAY 8 OF LONGINT; - BEGIN i := 0; - REPEAT d[i] := x MOD 10H; x := x DIV 10H; INC(i) UNTIL (x = 0) OR (i = 8); - REPEAT DEC(i); - IF d[i] >= 10 THEN Files.Write(R, CHR(d[i] + 37H)) ELSE Files.Write(R, CHR(d[i] + 30H)) END - UNTIL i = 0 - END WriteHex; - - PROCEDURE WriteString(s: ARRAY OF CHAR); - VAR i: INTEGER; - BEGIN i := 0; - WHILE s[i] # 0X DO Files.Write(R, s[i]); INC(i) END - END WriteString; - - (* ------------------------------- *) - - PROCEDURE Type(typ: LSB.Type); - VAR obj: LSB.Object; - BEGIN - IF typ IS LSB.ArrayType THEN - IF typ(LSB.ArrayType).eltyp # LSB.bitType THEN - Write("["); WriteInt(typ.len - 1); WriteString(":0]"); Type(typ(LSB.ArrayType).eltyp) - END - ELSIF typ IS LSB.UnitType THEN (* obj := typ(LSB.UnitType).firstobj; *) - END - END Type; - - PROCEDURE BitArrLen(typ: LSB.Type); - VAR eltyp: LSB.Type; - BEGIN - IF typ IS LSB.ArrayType THEN - eltyp := typ(LSB.ArrayType).eltyp; - WHILE eltyp IS LSB.ArrayType DO typ := eltyp; eltyp := typ(LSB.ArrayType).eltyp END ; - IF eltyp = LSB.bitType THEN - Write("["); WriteInt(typ.len - 1);WriteString(":0] ") - END - END - END BitArrLen; - - PROCEDURE Expression(x: LSB.Item); - VAR z: LSB.Item; - BEGIN - IF x # NIL THEN - IF x IS LSB.Object THEN WriteString(x(LSB.Object).name) - ELSIF x.tag = LSB.cons THEN - Write("{"); Constructor(x); Write("}") - ELSE - IF x.tag = LSB.repl THEN - Write("{"); WriteInt(x.b.val); Write("{"); Expression(x.a); - Write("}"); Write("}") - ELSE - IF (x.tag >= LSB.and) & (x.tag <= LSB.gtr) THEN Write("(") END ; - Expression(x.a); - IF x.tag = LSB.sel THEN Write("["); Expression(x.b); Write("]") - ELSIF x.tag = LSB.lit THEN - IF x.size # 0 THEN WriteInt(x.size); Write("'"); Write("h"); WriteHex(x.val) - ELSE WriteInt(x.val) - END - ELSE WriteString(C[x.tag]); Expression(x.b) - END ; - IF (x.tag >= LSB.and) & (x.tag <= LSB.gtr) THEN Write(")") END - END - END - END - END Expression; - - PROCEDURE Elem(VAR x: LSB.Item); - BEGIN - IF x.tag = LSB.repl THEN - Write("{"); WriteInt(x.b.val); Write("{"); Expression(x.a); WriteString("}}") - ELSE Expression(x) - END - END Elem; - - PROCEDURE Constructor0(VAR x: LSB.Item); - BEGIN - IF x.tag = LSB.cons THEN Constructor(x.a); WriteString(", "); Elem(x.b) ELSE Elem(x) END - END Constructor0; - - PROCEDURE Declaration(obj: LSB.Object); - VAR apar: LSB.Item; typ: LSB.Type; - BEGIN typ := obj.type; - IF obj.type IS LSB.UnitType THEN WriteString("unit ") ELSE Type(obj.type) END ; - IF obj.tag = LSB.var THEN - IF obj.type IS LSB.UnitType THEN - apar := obj.a; WriteLn; Write("["); - WHILE apar # NIL DO Expression(apar.b); apar := apar.a END ; - Write("]") - END - ELSIF obj.tag = LSB.const THEN WriteString(" = "); WriteInt(obj.val) - END - END Declaration; - - PROCEDURE ObjList0(obj: LSB.Object); (*declarations*) - VAR obj1: LSB.Object; param: BOOLEAN; - BEGIN param := TRUE; - WHILE obj # LSB.root DO - IF (obj.tag = LSB.var) & ~(obj.type IS LSB.UnitType) THEN - IF obj.val <= 1 THEN WriteString("reg ") - ELSIF obj.val = 2 THEN WriteString("wire ") - ELSIF obj.val = 3 THEN WriteString("output ") - ELSIF obj.val = 4 THEN WriteString("output reg ") - ELSIF obj.val = 5 THEN WriteString("inout ") - ELSIF obj.val = 6 THEN WriteString("input ") - ELSE WriteString("??? ") - END ; - BitArrLen(obj.type); WriteString(obj.name); - obj1 := obj.next; - WHILE (obj1 # LSB.top) & (obj1.type = obj.type) & (obj1.val = obj.val) DO - WriteString(", "); obj := obj1; WriteString(obj.name); obj1 := obj.next - END ; - IF param & (obj.val >= 3) & (obj1.val < 3) THEN (*end param list*) param := FALSE; Write(")") - END ; - IF (obj.type # LSB.bitType) & (obj.type(LSB.ArrayType).eltyp # LSB.bitType) THEN Type(obj.type) END ; - IF param THEN Write(",") ELSE Write(";") END ; - WriteLn - ELSIF obj.tag = LSB.const THEN - END ; - obj := obj.next - END - END ObjList0; - - PROCEDURE ActParam(VAR x: LSB.Item; fpar: LSB.Object); - BEGIN Write("."); WriteString(fpar.name); Write("("); Expression(x); Write(")") - END ActParam; - - PROCEDURE ObjList1(obj: LSB.Object); (*assignments to variables*) - VAR apar, x: LSB.Item; fpar: LSB.Object; size: LONGINT; - BEGIN - WHILE obj # LSB.root DO - IF (obj.tag = LSB.var) OR (obj.tag = LSB.const) THEN - IF obj.type IS LSB.UnitType THEN - WriteString(obj.type.typobj.name); Write(" "); WriteString(obj.name); - apar := obj.b; fpar := obj.type(LSB.UnitType).firstobj; - Write("("); ActParam(apar.b, fpar); apar := apar.a; fpar := fpar.next; (*actual param list*) - WHILE apar # NIL DO WriteString(", "); ActParam(apar.b, fpar); apar := apar.a; fpar := fpar.next END ; - Write(")"); Write(";"); WriteLn - ELSIF (obj.b # NIL) & (obj.val = 5) THEN (*tri-state*) - size := obj.type.size; x := obj.b; - IF x.tag = LSB.ts THEN - IF obj.type = LSB.bitType THEN - WriteString("IOBUF block"); INC(nofgen); WriteInt(nofgen); WriteString(" (.IO("); WriteString(obj.name); - WriteString("), .O("); WriteString(x.a(LSB.Object).name); WriteString("), .I("); x := x.b; - IF x.a.type = LSB.bitType THEN Expression(x.a) ELSE WriteString(x.a(LSB.Object).name) END ; - WriteString("), .T("); - IF x.b.type = LSB.bitType THEN Expression(x.b) ELSE WriteString(x.b(LSB.Object).name) END ; - WriteString("));") - ELSE (*array type*) - IF nofgen = 0 THEN WriteString("genvar i;"); WriteLn END ; - INC(nofgen); WriteString("generate"); WriteLn; - WriteString("for (i = 0; i < "); WriteInt(size); WriteString("; i = i+1) begin : bufblock"); WriteInt(nofgen); WriteLn; - WriteString("IOBUF block (.IO("); WriteString(obj.name); - WriteString("[i]), .O("); WriteString(x.a(LSB.Object).name); WriteString("[i]), .I("); x := x.b; - WriteString(x.a(LSB.Object).name); WriteString("[i]), .T("); - IF x.b.type = LSB.bitType THEN Expression(x.b) ELSE WriteString(x.b(LSB.Object).name); WriteString("[i]") END ; - WriteString("));"); WriteLn; WriteString("end"); WriteLn; WriteString("endgenerate") - END ; - WriteLn - END - ELSIF (obj.b # NIL) & (obj.val >= 2) THEN - WriteString("assign "); WriteString(obj.name); - IF (obj.a # NIL) THEN Write("["); Expression(obj.a); Write("]") END ; - WriteString(" = "); Expression(obj.b); Write(";"); WriteLn - END - ELSIF obj.tag = LSB.typ THEN (*instantiation; actual parameters*) - END ; - obj := obj.next - END - END ObjList1; - - PROCEDURE ObjList2(obj: LSB.Object); (*assignments to registers*) - VAR apar: LSB.Item; kind: LONGINT; clk: LSB.Item; - BEGIN - WHILE obj # LSB.root DO - IF (obj.tag = LSB.var) & ~(obj.type IS LSB.UnitType) & (obj.val < 2) THEN - WriteString("always @ (posedge "); kind := obj.val; - IF kind = 0 THEN Expression(obj.a) - ELSE (*kind = 1*) WriteString("clk") - END ; - WriteString(") begin "); - REPEAT WriteString(obj.name); - IF (kind = 1) & (obj.a # NIL) THEN Write("["); Expression(obj.a); Write("]") END ; - WriteString(" <= "); Expression(obj.b); Write(";"); WriteLn; obj := obj.next - UNTIL (obj = LSB.top) OR (obj.val # kind); - WriteString("end"); WriteLn - ELSE obj := obj.next - END - END - END ObjList2; - - PROCEDURE List*; - VAR S: Texts.Scanner; - BEGIN Texts.OpenScanner(S, Oberon.Par.text, Oberon.Par.pos); Texts.Scan(S); - IF (S.class = Texts.Name) OR (S.class = Texts.String) THEN - Texts.WriteString(W, LSB.modname); Texts.WriteString(W, " translating to "); Texts.WriteString(W, S.s); - F := Files.New(S.s); Files.Set(R, F, 0); - WriteString("`timescale 1ns / 1 ps"); WriteLn; nofgen := 0; - WriteString("module "); WriteString(LSB.modname); WriteString("( // translated from Lola"); WriteLn; - ObjList0(LSB.top); ObjList1(LSB.top); ObjList2(LSB.top); - WriteString("endmodule"); WriteLn; - Files.Register(F); Texts.WriteString(W, " done"); Texts.WriteLn(W); Texts.Append(Oberon.Log, W.buf) - END - END List; - -BEGIN Texts.OpenWriter(W); Constructor := Constructor0; - C[LSB.const] := "CONST"; C[LSB.typ] := "TYPE"; C[LSB.var] := "VAR"; - C[LSB.lit] := "LIT"; C[LSB.sel] := "SEL"; C[LSB.range] := ":"; C[LSB.cons] := ","; - C[LSB.or] := " | "; C[LSB.xor] := " ^ "; C[LSB.and] := " & "; C[LSB.not] := "~"; - C[LSB.add] := " + "; C[LSB.sub] := " - "; C[LSB.mul] := " * "; C[LSB.div] := " / "; - C[LSB.eql] := " == "; C[LSB.neq] := " != "; C[LSB.lss] := " < "; C[LSB.geq] := " >= "; C[LSB.leq] := " <= "; C[LSB.gtr] := " > "; - C[LSB.then] := " ? "; C[LSB.else] := " : "; C[LSB.ts] := "TS"; C[LSB.next] := "--" -END LSV. +MODULE LSV; (*Lola System: display Verilog; generate txt-File; NW 31.8.2015*) + IMPORT Files, Texts, Oberon, LSB; + + VAR W: Texts.Writer; + nofgen: INTEGER; + Constructor: PROCEDURE (VAR x: LSB.Item); (*to avoid forward reference*) + F: Files.File; R: Files.Rider; + C: ARRAY 64, 6 OF CHAR; + + PROCEDURE Write(ch: CHAR); + BEGIN Files.Write(R, ch) + END Write; + + PROCEDURE WriteLn; + BEGIN Files.Write(R, 0DX); Files.Write(R, 0AX) + END WriteLn; + + PROCEDURE WriteInt(x: LONGINT); (* x >= 0 *) + VAR i: INTEGER; d: ARRAY 14 OF LONGINT; + BEGIN i := 0; + IF x < 0 THEN Files.Write(R, "-"); x := -x END ; + REPEAT d[i] := x MOD 10; x := x DIV 10; INC(i) UNTIL x = 0; + REPEAT DEC(i); Files.Write(R, CHR(d[i] + 30H)) UNTIL i = 0 + END WriteInt; + + PROCEDURE WriteHex(x: LONGINT); (*x >= 0*) + VAR i: INTEGER; d: ARRAY 8 OF LONGINT; + BEGIN i := 0; + REPEAT d[i] := x MOD 10H; x := x DIV 10H; INC(i) UNTIL (x = 0) OR (i = 8); + REPEAT DEC(i); + IF d[i] >= 10 THEN Files.Write(R, CHR(d[i] + 37H)) ELSE Files.Write(R, CHR(d[i] + 30H)) END + UNTIL i = 0 + END WriteHex; + + PROCEDURE WriteString(s: ARRAY OF CHAR); + VAR i: INTEGER; + BEGIN i := 0; + WHILE s[i] # 0X DO Files.Write(R, s[i]); INC(i) END + END WriteString; + + (* ------------------------------- *) + + PROCEDURE Type(typ: LSB.Type); + VAR obj: LSB.Object; + BEGIN + IF typ IS LSB.ArrayType THEN + IF typ(LSB.ArrayType).eltyp # LSB.bitType THEN + Write("["); WriteInt(typ.len - 1); WriteString(":0]"); Type(typ(LSB.ArrayType).eltyp) + END + ELSIF typ IS LSB.UnitType THEN (* obj := typ(LSB.UnitType).firstobj; *) + END + END Type; + + PROCEDURE BitArrLen(typ: LSB.Type); + VAR eltyp: LSB.Type; + BEGIN + IF typ IS LSB.ArrayType THEN + eltyp := typ(LSB.ArrayType).eltyp; + WHILE eltyp IS LSB.ArrayType DO typ := eltyp; eltyp := typ(LSB.ArrayType).eltyp END ; + IF eltyp = LSB.bitType THEN + Write("["); WriteInt(typ.len - 1);WriteString(":0] ") + END + END + END BitArrLen; + + PROCEDURE Expression(x: LSB.Item); + VAR z: LSB.Item; + BEGIN + IF x # NIL THEN + IF x IS LSB.Object THEN WriteString(x(LSB.Object).name) + ELSIF x.tag = LSB.cons THEN + Write("{"); Constructor(x); Write("}") + ELSE + IF x.tag = LSB.repl THEN + Write("{"); WriteInt(x.b.val); Write("{"); Expression(x.a); + Write("}"); Write("}") + ELSE + IF (x.tag >= LSB.and) & (x.tag <= LSB.gtr) THEN Write("(") END ; + Expression(x.a); + IF x.tag = LSB.sel THEN Write("["); Expression(x.b); Write("]") + ELSIF x.tag = LSB.lit THEN + IF x.size # 0 THEN WriteInt(x.size); Write("'"); Write("h"); WriteHex(x.val) + ELSE WriteInt(x.val) + END + ELSE WriteString(C[x.tag]); Expression(x.b) + END ; + IF (x.tag >= LSB.and) & (x.tag <= LSB.gtr) THEN Write(")") END + END + END + END + END Expression; + + PROCEDURE Elem(VAR x: LSB.Item); + BEGIN + IF x.tag = LSB.repl THEN + Write("{"); WriteInt(x.b.val); Write("{"); Expression(x.a); WriteString("}}") + ELSE Expression(x) + END + END Elem; + + PROCEDURE Constructor0(VAR x: LSB.Item); + BEGIN + IF x.tag = LSB.cons THEN Constructor(x.a); WriteString(", "); Elem(x.b) ELSE Elem(x) END + END Constructor0; + + PROCEDURE Declaration(obj: LSB.Object); + VAR apar: LSB.Item; typ: LSB.Type; + BEGIN typ := obj.type; + IF obj.type IS LSB.UnitType THEN WriteString("unit ") ELSE Type(obj.type) END ; + IF obj.tag = LSB.var THEN + IF obj.type IS LSB.UnitType THEN + apar := obj.a; WriteLn; Write("["); + WHILE apar # NIL DO Expression(apar.b); apar := apar.a END ; + Write("]") + END + ELSIF obj.tag = LSB.const THEN WriteString(" = "); WriteInt(obj.val) + END + END Declaration; + + PROCEDURE ObjList0(obj: LSB.Object); (*declarations*) + VAR obj1: LSB.Object; param: BOOLEAN; + BEGIN param := TRUE; + WHILE obj # LSB.root DO + IF (obj.tag = LSB.var) & ~(obj.type IS LSB.UnitType) THEN + IF obj.val <= 1 THEN WriteString("reg ") + ELSIF obj.val = 2 THEN WriteString("wire ") + ELSIF obj.val = 3 THEN WriteString("output ") + ELSIF obj.val = 4 THEN WriteString("output reg ") + ELSIF obj.val = 5 THEN WriteString("inout ") + ELSIF obj.val = 6 THEN WriteString("input ") + ELSE WriteString("??? ") + END ; + BitArrLen(obj.type); WriteString(obj.name); + obj1 := obj.next; + WHILE (obj1 # LSB.top) & (obj1.type = obj.type) & (obj1.val = obj.val) DO + WriteString(", "); obj := obj1; WriteString(obj.name); obj1 := obj.next + END ; + IF param & (obj.val >= 3) & (obj1.val < 3) THEN (*end param list*) param := FALSE; Write(")") + END ; + IF (obj.type # LSB.bitType) & (obj.type(LSB.ArrayType).eltyp # LSB.bitType) THEN Type(obj.type) END ; + IF param THEN Write(",") ELSE Write(";") END ; + WriteLn + ELSIF obj.tag = LSB.const THEN + END ; + obj := obj.next + END + END ObjList0; + + PROCEDURE ActParam(VAR x: LSB.Item; fpar: LSB.Object); + BEGIN Write("."); WriteString(fpar.name); Write("("); Expression(x); Write(")") + END ActParam; + + PROCEDURE ObjList1(obj: LSB.Object); (*assignments to variables*) + VAR apar, x: LSB.Item; fpar: LSB.Object; size: LONGINT; + BEGIN + WHILE obj # LSB.root DO + IF (obj.tag = LSB.var) OR (obj.tag = LSB.const) THEN + IF obj.type IS LSB.UnitType THEN + WriteString(obj.type.typobj.name); Write(" "); WriteString(obj.name); + apar := obj.b; fpar := obj.type(LSB.UnitType).firstobj; + Write("("); ActParam(apar.b, fpar); apar := apar.a; fpar := fpar.next; (*actual param list*) + WHILE apar # NIL DO WriteString(", "); ActParam(apar.b, fpar); apar := apar.a; fpar := fpar.next END ; + Write(")"); Write(";"); WriteLn + ELSIF (obj.b # NIL) & (obj.val = 5) THEN (*tri-state*) + size := obj.type.size; x := obj.b; + IF x.tag = LSB.ts THEN + IF obj.type = LSB.bitType THEN + WriteString("IOBUF block"); INC(nofgen); WriteInt(nofgen); WriteString(" (.IO("); WriteString(obj.name); + WriteString("), .O("); WriteString(x.a(LSB.Object).name); WriteString("), .I("); x := x.b; + IF x.a.type = LSB.bitType THEN Expression(x.a) ELSE WriteString(x.a(LSB.Object).name) END ; + WriteString("), .T("); + IF x.b.type = LSB.bitType THEN Expression(x.b) ELSE WriteString(x.b(LSB.Object).name) END ; + WriteString("));") + ELSE (*array type*) + IF nofgen = 0 THEN WriteString("genvar i;"); WriteLn END ; + INC(nofgen); WriteString("generate"); WriteLn; + WriteString("for (i = 0; i < "); WriteInt(size); WriteString("; i = i+1) begin : bufblock"); WriteInt(nofgen); WriteLn; + WriteString("IOBUF block (.IO("); WriteString(obj.name); + WriteString("[i]), .O("); WriteString(x.a(LSB.Object).name); WriteString("[i]), .I("); x := x.b; + WriteString(x.a(LSB.Object).name); WriteString("[i]), .T("); + IF x.b.type = LSB.bitType THEN Expression(x.b) ELSE WriteString(x.b(LSB.Object).name); WriteString("[i]") END ; + WriteString("));"); WriteLn; WriteString("end"); WriteLn; WriteString("endgenerate") + END ; + WriteLn + END + ELSIF (obj.b # NIL) & (obj.val >= 2) THEN + WriteString("assign "); WriteString(obj.name); + IF (obj.a # NIL) THEN Write("["); Expression(obj.a); Write("]") END ; + WriteString(" = "); Expression(obj.b); Write(";"); WriteLn + END + ELSIF obj.tag = LSB.typ THEN (*instantiation; actual parameters*) + END ; + obj := obj.next + END + END ObjList1; + + PROCEDURE ObjList2(obj: LSB.Object); (*assignments to registers*) + VAR apar: LSB.Item; kind: LONGINT; clk: LSB.Item; + BEGIN + WHILE obj # LSB.root DO + IF (obj.tag = LSB.var) & ~(obj.type IS LSB.UnitType) & (obj.val < 2) THEN + WriteString("always @ (posedge "); kind := obj.val; + IF kind = 0 THEN Expression(obj.a) + ELSE (*kind = 1*) WriteString("clk") + END ; + WriteString(") begin "); + REPEAT WriteString(obj.name); + IF (kind = 1) & (obj.a # NIL) THEN Write("["); Expression(obj.a); Write("]") END ; + WriteString(" <= "); Expression(obj.b); Write(";"); WriteLn; obj := obj.next + UNTIL (obj = LSB.top) OR (obj.val # kind); + WriteString("end"); WriteLn + ELSE obj := obj.next + END + END + END ObjList2; + + PROCEDURE List*; + VAR S: Texts.Scanner; + BEGIN Texts.OpenScanner(S, Oberon.Par.text, Oberon.Par.pos); Texts.Scan(S); + IF (S.class = Texts.Name) OR (S.class = Texts.String) THEN + Texts.WriteString(W, LSB.modname); Texts.WriteString(W, " translating to "); Texts.WriteString(W, S.s); + F := Files.New(S.s); Files.Set(R, F, 0); + WriteString("`timescale 1ns / 1 ps"); WriteLn; nofgen := 0; + WriteString("module "); WriteString(LSB.modname); WriteString("( // translated from Lola"); WriteLn; + ObjList0(LSB.top); ObjList1(LSB.top); ObjList2(LSB.top); + WriteString("endmodule"); WriteLn; + Files.Register(F); Texts.WriteString(W, " done"); Texts.WriteLn(W); Texts.Append(Oberon.Log, W.buf) + END + END List; + +BEGIN Texts.OpenWriter(W); Constructor := Constructor0; + C[LSB.const] := "CONST"; C[LSB.typ] := "TYPE"; C[LSB.var] := "VAR"; + C[LSB.lit] := "LIT"; C[LSB.sel] := "SEL"; C[LSB.range] := ":"; C[LSB.cons] := ","; + C[LSB.or] := " | "; C[LSB.xor] := " ^ "; C[LSB.and] := " & "; C[LSB.not] := "~"; + C[LSB.add] := " + "; C[LSB.sub] := " - "; C[LSB.mul] := " * "; C[LSB.div] := " / "; + C[LSB.eql] := " == "; C[LSB.neq] := " != "; C[LSB.lss] := " < "; C[LSB.geq] := " >= "; C[LSB.leq] := " <= "; C[LSB.gtr] := " > "; + C[LSB.then] := " ? "; C[LSB.else] := " : "; C[LSB.ts] := "TS"; C[LSB.next] := "--" +END LSV. diff --git a/src/test/confidence/lola/RISC5.Lola b/src/test/confidence/lola/RISC5.Lola index 3a2980a0..24af46fb 100755 --- a/src/test/confidence/lola/RISC5.Lola +++ b/src/test/confidence/lola/RISC5.Lola @@ -1,214 +1,214 @@ -MODULE RISC5 (IN clk, rst, stallX: BIT; (*NW 26.10.2015*) - IN inbus, codebus: WORD; - OUT adr: [24] BIT; - rd, wr, ben: BIT; - outbus: WORD); - - CONST StartAdr = 3FF800H'22; - - TYPE PROM := MODULE (IN clk: BIT; - IN adr: [9] BIT; - OUT data: WORD) ^; - - Multiplier := MODULE (IN clk, run, u: BIT; - OUT stall: BIT; - IN x, y: WORD; - OUT z: [64] BIT) ^; - - Divider := MODULE (IN clk, run, u: BIT; - OUT stall: BIT; - IN x, y: WORD; - OUT quot, rem: WORD) ^; - - FPAdder := MODULE (IN clk, run, u, v: BIT; OUT stall: BIT; - IN x, y: WORD; OUT z: WORD) ^; - - FPMultiplier := MODULE (IN clk, run: BIT; OUT stall: BIT; - IN x, y: WORD; OUT z: WORD) ^; - - FPDivider := MODULE (IN clk, run: BIT; OUT stall: BIT; - IN x, y: WORD; OUT z: WORD) ^; - - REG (clk) PC: [22] BIT; (*program counter*) - IR: WORD; (*instruction register*) - N, Z, C, OV: BIT; (*condition flags*) - stall1, PMsel: BIT; - R: [16] WORD; (*data registers*) - H: WORD; (*auxiliary register*) - - VAR PM: PROM; (*mem for boot loader*) - mulUnit: Multiplier; - divUnit: Divider; - faddUnit: FPAdder; - fmulUnit: FPMultiplier; - fdivUnit: FPDivider; - - pcmux, nxpc: [22] BIT; - cond, S: BIT; - sa, sb, sc: BIT; - - ins, pmout: WORD; - p, q, u, v, w: BIT; (*instruction fields*) - op, ira, ira0, irb, irc: [4] BIT; - cc: [3] BIT; - imm: [16] BIT; - off: [20] BIT; - offL: [24] BIT; - - regwr, stall, stallL, stallM, stallD, stallFA, stallFM, stallFD: BIT; - sc1, sc0: [2] BIT; (*shift counts*) - - a0, a1, a2, a3: BIT; - inbusL, outbusB0, outbusB1, outbusB2, outbusB3: BYTE; - inbusH: [24] BIT; - - A, B, C0, C1, aluRes, regmux: WORD; - s1, s2, s3, t1, t2, t3: WORD; (*shifting*) - quotient, remainder: WORD; - product: [64] BIT; - fsum, fprod, fquot: WORD; - - Add, Sub, Mul, Div: BIT; - Fadd, Fsub, Fmul, Fdiv: BIT; - Ldr, Str, Br: BIT; - -BEGIN PM(clk, pcmux[8:0], pmout); - mulUnit (clk, Mul, ~u, stallM, B, C1, product); - divUnit (clk, Div, ~u, stallD, B, C1, quotient, remainder); - faddUnit (clk, Fadd|Fsub, u, v, stallFA, B, {Fsub^C0.31, C0[30:0]}, fsum); - fmulUnit (clk, Fmul, stallFM, B, C0, fprod); - fdivUnit (clk, Fdiv, stallFD, B, C0, fquot); - - ins := PMsel -> pmout : IR; (*current instruction*) - p := ins.31; (*instruction fields*) - q := ins.30; - u := ins.29; - v := ins.28; - w := ins.16; - cc:= ins[26:24]; - ira := ins[27:24]; - irb := ins[23:20]; - op := ins[19:16]; - irc := ins[3:0]; - imm := ins[15:0]; (*reg instr*) - off := ins[19:0]; (*mem instr*) - offL := ins[23:0]; (*branch instr*) - - Add := ~p & (op = 8); - Sub := ~p & (op = 9); - Mul := ~p & (op = 10); - Div := ~p & (op = 11); - Fadd := ~p & (op = 12); - Fsub := ~p & (op = 13); - Fmul := ~p & (op = 14); - Fdiv := ~p & (op = 15); - Ldr := p & ~q & ~u; - Str := p & ~q & u; - Br := p & q; - - (*ALU*) - A := R[ira0]; (*main data path*) - B := R[irb]; - C0 := R[irc]; - C1 := q -> {v!16, imm} : C0 ; - ira0 := Br -> 15'4 : ira; - adr := stallL -> B[23:0] + {0'4, off} : {pcmux, 0'2}; - rd := Ldr & ~stallX & ~stall1; - wr := Str & ~stallX & ~stall1; - ben := p & ~q & v & ~stallX & ~stall1; (*byte enable*) - - sc0 := C1[1:0]; - sc1 := C1[3:2]; - - (*right shifter*) - s1 := (sc0 = 3) -> {(w -> B[2:0] : {B.31 ! 3}), B[31:3]} : - (sc0 = 2) -> {(w -> B[1:0] : {B.31 ! 2}), B[31:2]} : - (sc0 = 1) -> {(w -> B.0 : B.31), B[31:1]} : B; - s2 := (sc1 = 3) -> {(w -> s1[11:0] : {B.31 ! 12}), s1[31:12]} : - (sc1 = 2) -> {(w -> s1[7:0] : {B.31 ! 8}), s1[31:8]} : - (sc1 = 1) -> {(w -> s1[3:0] : {B.31 ! 4}), s1[31:4]} : s1; - s3 := C1.4 -> {(w -> s2[15:0] : {s2.31 ! 16}), s2[31:16]} : s2; - - (*left shifter*) - t1 := (sc0 = 3) -> {B[28:0], 0'3} : - (sc0 = 2) -> {B[29:0], 0'2} : - (sc0 = 1) -> {B[30:0], 0'1} : B; - t2 := (sc1 = 3) -> {t1[19:0], 0'12} : - (sc1 = 2) -> {t1[23:0], 0'8} : - (sc1 = 1) -> {t1[27:0], 0'4} : t1; - t3 := C1.4 -> {t2[15:0], 0'16} : t2; - - aluRes := - ~op.3 -> - (~op.2 -> - (~op.1 -> - (~op.0 -> (*Mov*) - (q -> - (~u -> {v!16 , imm} : {imm, 0'16}) : - (~u -> C0 : (~v -> H : {N, Z, C, OV, 0'20, 58H'8}))) : - t3 ): (*Lsl*) - s3) : (*Asr, Ror*) - (~op.1 -> - (~op.0 -> B & C1 : B & ~C1) : (*And, Ann*) - (~op.0 -> B | C1 : B ^ C1)) ): (*Ior, Xor*) - (~op.2 -> - (~op.1 -> - (~op.0 -> B + C + (u&C) : B - C1 - (u&C)) : (*Add, Sub*) - (~op.0 -> product[31:0] : quotient)) : (*Mul, Div*) - (~op.1 -> - fsum : (*Fad, Fsb*) - (~op.0 -> fprod : fquot))) ; (*Fml, Fdv*) - - regwr := ~p & ~stall | (Ldr & ~stallX & ~stall1) | (Br & cond & v & ~stallX); - a0 := ~adr.1 & ~adr.0; - a1 := ~adr.1 & adr.0; - a2 := adr.1 & ~adr.0; - a3 := adr.1 & adr.0; - inbusL := (~ben | a0) -> inbus[7:0] : a1 -> inbus[15:8] : a2 -> inbus[23:16] : inbus[31:24]; - inbusH := ~ben -> inbus[31:8] : 0'24; - regmux := Ldr -> {inbusH, inbusL} : (Br & v) -> {0'8, nxpc, 0'2} : aluRes ; - - outbusB0 := A[7:0]; - outbusB1 := ben & a1 -> A[7:0] : A[15:8]; - outbusB2 := ben & a2 -> A[7:0] : A[23:16]; - outbusB3 := ben & a3 -> A[7:0] : A[31:24]; - outbus := {outbusB3, outbusB2, outbusB1, outbusB0}; - - (*control unit*) - S := N ^ OV; - nxpc := PC + 1; - cond := ins.27 ^ ( - (cc = 0) & N | (*MI, PL*) - (cc = 1) & Z | (*EQ, NE*) - (cc = 2) & C | (*CS, CC*) - (cc = 3) & OV | (*VS, VC*) - (cc = 4) & (C|Z) | (*LS, HI*) - (cc = 5) & S | (*LT, GE*) - (cc = 6) & (S|Z) | (*LE, GT*) - (cc = 7)); - pcmux := ~rst -> 3FF800H'22 : - stall -> PC : - (Br & cond & u) -> offL[21:0] + nxpc : - (Br & cond & ~u) -> C0[23:2] : nxpc; - - sa := aluRes.31; - sb := B.31; - sc := C1.31; - - stall := stallL | stallM | stallD | stallFA | stallFM | stallFD | stallX; - stallL := (Ldr | Str) & ~stall1; - - (*assignments to registers*) - PC := pcmux; - PMsel := ~rst | (pcmux[21:12] = 03FFH'10); - IR := stall -> IR : codebus; - stall1 := stallX -> stall1 : stallL; - R[ira0] := regwr -> regmux : A; - N := regwr -> regmux.31 : N; - Z := regwr -> (regmux = 0) : Z; - C := Add -> (sb&sc) | (~sa&~sb&sc) | (~sa&sb&~sc&sa) : - Sub -> (~sb&sc) | (sa&~sb&~sc) | (sa&sb&sc) : C; - OV := Add -> (sa&~sb&~sc) | (~sa&sb&sc) : - Sub -> (sa&~sb&sc) | (~sa&sb&~sc) : OV; - H := Mul -> product[63:32] : Div -> remainder : H -END RISC5. +MODULE RISC5 (IN clk, rst, stallX: BIT; (*NW 26.10.2015*) + IN inbus, codebus: WORD; + OUT adr: [24] BIT; + rd, wr, ben: BIT; + outbus: WORD); + + CONST StartAdr = 3FF800H'22; + + TYPE PROM := MODULE (IN clk: BIT; + IN adr: [9] BIT; + OUT data: WORD) ^; + + Multiplier := MODULE (IN clk, run, u: BIT; + OUT stall: BIT; + IN x, y: WORD; + OUT z: [64] BIT) ^; + + Divider := MODULE (IN clk, run, u: BIT; + OUT stall: BIT; + IN x, y: WORD; + OUT quot, rem: WORD) ^; + + FPAdder := MODULE (IN clk, run, u, v: BIT; OUT stall: BIT; + IN x, y: WORD; OUT z: WORD) ^; + + FPMultiplier := MODULE (IN clk, run: BIT; OUT stall: BIT; + IN x, y: WORD; OUT z: WORD) ^; + + FPDivider := MODULE (IN clk, run: BIT; OUT stall: BIT; + IN x, y: WORD; OUT z: WORD) ^; + + REG (clk) PC: [22] BIT; (*program counter*) + IR: WORD; (*instruction register*) + N, Z, C, OV: BIT; (*condition flags*) + stall1, PMsel: BIT; + R: [16] WORD; (*data registers*) + H: WORD; (*auxiliary register*) + + VAR PM: PROM; (*mem for boot loader*) + mulUnit: Multiplier; + divUnit: Divider; + faddUnit: FPAdder; + fmulUnit: FPMultiplier; + fdivUnit: FPDivider; + + pcmux, nxpc: [22] BIT; + cond, S: BIT; + sa, sb, sc: BIT; + + ins, pmout: WORD; + p, q, u, v, w: BIT; (*instruction fields*) + op, ira, ira0, irb, irc: [4] BIT; + cc: [3] BIT; + imm: [16] BIT; + off: [20] BIT; + offL: [24] BIT; + + regwr, stall, stallL, stallM, stallD, stallFA, stallFM, stallFD: BIT; + sc1, sc0: [2] BIT; (*shift counts*) + + a0, a1, a2, a3: BIT; + inbusL, outbusB0, outbusB1, outbusB2, outbusB3: BYTE; + inbusH: [24] BIT; + + A, B, C0, C1, aluRes, regmux: WORD; + s1, s2, s3, t1, t2, t3: WORD; (*shifting*) + quotient, remainder: WORD; + product: [64] BIT; + fsum, fprod, fquot: WORD; + + Add, Sub, Mul, Div: BIT; + Fadd, Fsub, Fmul, Fdiv: BIT; + Ldr, Str, Br: BIT; + +BEGIN PM(clk, pcmux[8:0], pmout); + mulUnit (clk, Mul, ~u, stallM, B, C1, product); + divUnit (clk, Div, ~u, stallD, B, C1, quotient, remainder); + faddUnit (clk, Fadd|Fsub, u, v, stallFA, B, {Fsub^C0.31, C0[30:0]}, fsum); + fmulUnit (clk, Fmul, stallFM, B, C0, fprod); + fdivUnit (clk, Fdiv, stallFD, B, C0, fquot); + + ins := PMsel -> pmout : IR; (*current instruction*) + p := ins.31; (*instruction fields*) + q := ins.30; + u := ins.29; + v := ins.28; + w := ins.16; + cc:= ins[26:24]; + ira := ins[27:24]; + irb := ins[23:20]; + op := ins[19:16]; + irc := ins[3:0]; + imm := ins[15:0]; (*reg instr*) + off := ins[19:0]; (*mem instr*) + offL := ins[23:0]; (*branch instr*) + + Add := ~p & (op = 8); + Sub := ~p & (op = 9); + Mul := ~p & (op = 10); + Div := ~p & (op = 11); + Fadd := ~p & (op = 12); + Fsub := ~p & (op = 13); + Fmul := ~p & (op = 14); + Fdiv := ~p & (op = 15); + Ldr := p & ~q & ~u; + Str := p & ~q & u; + Br := p & q; + + (*ALU*) + A := R[ira0]; (*main data path*) + B := R[irb]; + C0 := R[irc]; + C1 := q -> {v!16, imm} : C0 ; + ira0 := Br -> 15'4 : ira; + adr := stallL -> B[23:0] + {0'4, off} : {pcmux, 0'2}; + rd := Ldr & ~stallX & ~stall1; + wr := Str & ~stallX & ~stall1; + ben := p & ~q & v & ~stallX & ~stall1; (*byte enable*) + + sc0 := C1[1:0]; + sc1 := C1[3:2]; + + (*right shifter*) + s1 := (sc0 = 3) -> {(w -> B[2:0] : {B.31 ! 3}), B[31:3]} : + (sc0 = 2) -> {(w -> B[1:0] : {B.31 ! 2}), B[31:2]} : + (sc0 = 1) -> {(w -> B.0 : B.31), B[31:1]} : B; + s2 := (sc1 = 3) -> {(w -> s1[11:0] : {B.31 ! 12}), s1[31:12]} : + (sc1 = 2) -> {(w -> s1[7:0] : {B.31 ! 8}), s1[31:8]} : + (sc1 = 1) -> {(w -> s1[3:0] : {B.31 ! 4}), s1[31:4]} : s1; + s3 := C1.4 -> {(w -> s2[15:0] : {s2.31 ! 16}), s2[31:16]} : s2; + + (*left shifter*) + t1 := (sc0 = 3) -> {B[28:0], 0'3} : + (sc0 = 2) -> {B[29:0], 0'2} : + (sc0 = 1) -> {B[30:0], 0'1} : B; + t2 := (sc1 = 3) -> {t1[19:0], 0'12} : + (sc1 = 2) -> {t1[23:0], 0'8} : + (sc1 = 1) -> {t1[27:0], 0'4} : t1; + t3 := C1.4 -> {t2[15:0], 0'16} : t2; + + aluRes := + ~op.3 -> + (~op.2 -> + (~op.1 -> + (~op.0 -> (*Mov*) + (q -> + (~u -> {v!16 , imm} : {imm, 0'16}) : + (~u -> C0 : (~v -> H : {N, Z, C, OV, 0'20, 58H'8}))) : + t3 ): (*Lsl*) + s3) : (*Asr, Ror*) + (~op.1 -> + (~op.0 -> B & C1 : B & ~C1) : (*And, Ann*) + (~op.0 -> B | C1 : B ^ C1)) ): (*Ior, Xor*) + (~op.2 -> + (~op.1 -> + (~op.0 -> B + C + (u&C) : B - C1 - (u&C)) : (*Add, Sub*) + (~op.0 -> product[31:0] : quotient)) : (*Mul, Div*) + (~op.1 -> + fsum : (*Fad, Fsb*) + (~op.0 -> fprod : fquot))) ; (*Fml, Fdv*) + + regwr := ~p & ~stall | (Ldr & ~stallX & ~stall1) | (Br & cond & v & ~stallX); + a0 := ~adr.1 & ~adr.0; + a1 := ~adr.1 & adr.0; + a2 := adr.1 & ~adr.0; + a3 := adr.1 & adr.0; + inbusL := (~ben | a0) -> inbus[7:0] : a1 -> inbus[15:8] : a2 -> inbus[23:16] : inbus[31:24]; + inbusH := ~ben -> inbus[31:8] : 0'24; + regmux := Ldr -> {inbusH, inbusL} : (Br & v) -> {0'8, nxpc, 0'2} : aluRes ; + + outbusB0 := A[7:0]; + outbusB1 := ben & a1 -> A[7:0] : A[15:8]; + outbusB2 := ben & a2 -> A[7:0] : A[23:16]; + outbusB3 := ben & a3 -> A[7:0] : A[31:24]; + outbus := {outbusB3, outbusB2, outbusB1, outbusB0}; + + (*control unit*) + S := N ^ OV; + nxpc := PC + 1; + cond := ins.27 ^ ( + (cc = 0) & N | (*MI, PL*) + (cc = 1) & Z | (*EQ, NE*) + (cc = 2) & C | (*CS, CC*) + (cc = 3) & OV | (*VS, VC*) + (cc = 4) & (C|Z) | (*LS, HI*) + (cc = 5) & S | (*LT, GE*) + (cc = 6) & (S|Z) | (*LE, GT*) + (cc = 7)); + pcmux := ~rst -> 3FF800H'22 : + stall -> PC : + (Br & cond & u) -> offL[21:0] + nxpc : + (Br & cond & ~u) -> C0[23:2] : nxpc; + + sa := aluRes.31; + sb := B.31; + sc := C1.31; + + stall := stallL | stallM | stallD | stallFA | stallFM | stallFD | stallX; + stallL := (Ldr | Str) & ~stall1; + + (*assignments to registers*) + PC := pcmux; + PMsel := ~rst | (pcmux[21:12] = 03FFH'10); + IR := stall -> IR : codebus; + stall1 := stallX -> stall1 : stallL; + R[ira0] := regwr -> regmux : A; + N := regwr -> regmux.31 : N; + Z := regwr -> (regmux = 0) : Z; + C := Add -> (sb&sc) | (~sa&~sb&sc) | (~sa&sb&~sc&sa) : + Sub -> (~sb&sc) | (sa&~sb&~sc) | (sa&sb&sc) : C; + OV := Add -> (sa&~sb&~sc) | (~sa&sb&sc) : + Sub -> (sa&~sb&sc) | (~sa&sb&~sc) : OV; + H := Mul -> product[63:32] : Div -> remainder : H +END RISC5. diff --git a/src/test/confidence/lola/expected b/src/test/confidence/lola/expected index 4a6b1bb8..12f87669 100644 --- a/src/test/confidence/lola/expected +++ b/src/test/confidence/lola/expected @@ -1,113 +1,113 @@ -`timescale 1ns / 1 ps -module RISC5( // translated from Lola -input clk, rst, stallX, -input [31:0] inbus, codebus, -output [23:0] adr, -output rd, wr, ben, -output [31:0] outbus); -reg [21:0] PC; -reg [31:0] IR; -reg N, Z, C, OV, stall1, PMsel; -reg [31:0] R[15:0]; -reg [31:0] H; -wire [21:0] pcmux, nxpc; -wire cond, S, sa, sb, sc; -wire [31:0] ins, pmout; -wire p, q, u, v, w; -wire [3:0] op, ira, ira0, irb, irc; -wire [2:0] cc; -wire [15:0] imm; -wire [19:0] off; -wire [23:0] offL; -wire regwr, stall, stallL, stallM, stallD, stallFA, stallFM, stallFD; -wire [1:0] sc1, sc0; -wire a0, a1, a2, a3; -wire [7:0] inbusL, outbusB0, outbusB1, outbusB2, outbusB3; -wire [23:0] inbusH; -wire [31:0] A, B, C0, C1, aluRes, regmux, s1, s2, s3, t1, t2, t3, quotient, remainder; -wire [63:0] product; -wire [31:0] fsum, fprod, fquot; -wire Add, Sub, Mul, Div, Fadd, Fsub, Fmul, Fdiv, Ldr, Str, Br; -assign adr = stallL ? (B[23:0] + {4'h0, off}) : {pcmux, 2'h0}; -assign rd = ((Ldr & ~stallX) & ~stall1); -assign wr = ((Str & ~stallX) & ~stall1); -assign ben = ((((p & ~q) & v) & ~stallX) & ~stall1); -assign outbus = {outbusB3, outbusB2, outbusB1, outbusB0}; -PROM PM(.clk(clk), .adr(pcmux[8:0]), .data(pmout)); -Multiplier mulUnit(.clk(clk), .run(Mul), .u(~u), .stall(stallM), .x(B), .y(C1), .z(product)); -Divider divUnit(.clk(clk), .run(Div), .u(~u), .stall(stallD), .x(B), .y(C1), .quot(quotient), .rem(remainder)); -FPAdder faddUnit(.clk(clk), .run((Fadd | Fsub)), .u(u), .v(v), .stall(stallFA), .x(B), .y({(Fsub ^ C0[31]), C0[30:0]}), .z(fsum)); -FPMultiplier fmulUnit(.clk(clk), .run(Fmul), .stall(stallFM), .x(B), .y(C0), .z(fprod)); -FPDivider fdivUnit(.clk(clk), .run(Fdiv), .stall(stallFD), .x(B), .y(C0), .z(fquot)); -assign pcmux = ~rst ? 22'h3FF800 : stall ? PC : ((Br & cond) & u) ? (offL[21:0] + nxpc) : ((Br & cond) & ~u) ? C0[23:2] : nxpc; -assign nxpc = (PC + 1); -assign cond = (ins[27] ^ (((((((((cc == 0) & N) | ((cc == 1) & Z)) | ((cc == 2) & C)) | ((cc == 3) & OV)) | ((cc == 4) & (C | Z))) | ((cc == 5) & S)) | ((cc == 6) & (S | Z))) | (cc == 7))); -assign S = (N ^ OV); -assign sa = aluRes[31]; -assign sb = B[31]; -assign sc = C1[31]; -assign ins = PMsel ? pmout : IR; -assign p = ins[31]; -assign q = ins[30]; -assign u = ins[29]; -assign v = ins[28]; -assign w = ins[16]; -assign op = ins[19:16]; -assign ira = ins[27:24]; -assign ira0 = Br ? 4'hF : ira; -assign irb = ins[23:20]; -assign irc = ins[3:0]; -assign cc = ins[26:24]; -assign imm = ins[15:0]; -assign off = ins[19:0]; -assign offL = ins[23:0]; -assign regwr = (((~p & ~stall) | ((Ldr & ~stallX) & ~stall1)) | (((Br & cond) & v) & ~stallX)); -assign stall = ((((((stallL | stallM) | stallD) | stallFA) | stallFM) | stallFD) | stallX); -assign stallL = ((Ldr | Str) & ~stall1); -assign sc1 = C1[3:2]; -assign sc0 = C1[1:0]; -assign a0 = (~adr[1] & ~adr[0]); -assign a1 = (~adr[1] & adr[0]); -assign a2 = (adr[1] & ~adr[0]); -assign a3 = (adr[1] & adr[0]); -assign inbusL = (~ben | a0) ? inbus[7:0] : a1 ? inbus[15:8] : a2 ? inbus[23:16] : inbus[31:24]; -assign outbusB0 = A[7:0]; -assign outbusB1 = (ben & a1) ? A[7:0] : A[15:8]; -assign outbusB2 = (ben & a2) ? A[7:0] : A[23:16]; -assign outbusB3 = (ben & a3) ? A[7:0] : A[31:24]; -assign inbusH = ~ben ? inbus[31:8] : 24'h0; -assign A = R[ira0]; -assign B = R[irb]; -assign C0 = R[irc]; -assign C1 = q ? {{16{v}}, imm} : C0; -assign aluRes = ~op[3] ? ~op[2] ? ~op[1] ? ~op[0] ? q ? ~u ? {{16{v}}, imm} : {imm, 16'h0} : ~u ? C0 : ~v ? H : {N, Z, C, OV, 20'h0, 8'h58} : t3 : s3 : ~op[1] ? ~op[0] ? (B & C1) : (B & ~C1) : ~op[0] ? (B | C1) : (B ^ C1) : ~op[2] ? ~op[1] ? ~op[0] ? ((B + C) + (u & C)) : ((B - C1) - (u & C)) : ~op[0] ? product[31:0] : quotient : ~op[1] ? fsum : ~op[0] ? fprod : fquot; -assign regmux = Ldr ? {inbusH, inbusL} : (Br & v) ? {8'h0, nxpc, 2'h0} : aluRes; -assign s1 = (sc0 == 3) ? {w ? B[2:0] : {3{B[31]}}, B[31:3]} : (sc0 == 2) ? {w ? B[1:0] : {2{B[31]}}, B[31:2]} : (sc0 == 1) ? {w ? B[0] : B[31], B[31:1]} : B; -assign s2 = (sc1 == 3) ? {w ? s1[11:0] : {12{B[31]}}, s1[31:12]} : (sc1 == 2) ? {w ? s1[7:0] : {8{B[31]}}, s1[31:8]} : (sc1 == 1) ? {w ? s1[3:0] : {4{B[31]}}, s1[31:4]} : s1; -assign s3 = C1[4] ? {w ? s2[15:0] : {16{s2[31]}}, s2[31:16]} : s2; -assign t1 = (sc0 == 3) ? {B[28:0], 3'h0} : (sc0 == 2) ? {B[29:0], 2'h0} : (sc0 == 1) ? {B[30:0], 1'h0} : B; -assign t2 = (sc1 == 3) ? {t1[19:0], 12'h0} : (sc1 == 2) ? {t1[23:0], 8'h0} : (sc1 == 1) ? {t1[27:0], 4'h0} : t1; -assign t3 = C1[4] ? {t2[15:0], 16'h0} : t2; -assign Add = (~p & (op == 8)); -assign Sub = (~p & (op == 9)); -assign Mul = (~p & (op == 10)); -assign Div = (~p & (op == 11)); -assign Fadd = (~p & (op == 12)); -assign Fsub = (~p & (op == 13)); -assign Fmul = (~p & (op == 14)); -assign Fdiv = (~p & (op == 15)); -assign Ldr = ((p & ~q) & ~u); -assign Str = ((p & ~q) & u); -assign Br = (p & q); -always @ (posedge clk) begin PC <= pcmux; -IR <= stall ? IR : codebus; -N <= regwr ? regmux[31] : N; -Z <= regwr ? (regmux == 0) : Z; -C <= Add ? (((sb & sc) | ((~sa & ~sb) & sc)) | (((~sa & sb) & ~sc) & sa)) : Sub ? (((~sb & sc) | ((sa & ~sb) & ~sc)) | ((sa & sb) & sc)) : C; -OV <= Add ? (((sa & ~sb) & ~sc) | ((~sa & sb) & sc)) : Sub ? (((sa & ~sb) & sc) | ((~sa & sb) & ~sc)) : OV; -stall1 <= stallX ? stall1 : stallL; -PMsel <= (~rst | (pcmux[21:12] == 10'h3FF)); -R[ira0] <= regwr ? regmux : A; -H <= Mul ? product[63:32] : Div ? remainder : H; -end -endmodule +`timescale 1ns / 1 ps +module RISC5( // translated from Lola +input clk, rst, stallX, +input [31:0] inbus, codebus, +output [23:0] adr, +output rd, wr, ben, +output [31:0] outbus); +reg [21:0] PC; +reg [31:0] IR; +reg N, Z, C, OV, stall1, PMsel; +reg [31:0] R[15:0]; +reg [31:0] H; +wire [21:0] pcmux, nxpc; +wire cond, S, sa, sb, sc; +wire [31:0] ins, pmout; +wire p, q, u, v, w; +wire [3:0] op, ira, ira0, irb, irc; +wire [2:0] cc; +wire [15:0] imm; +wire [19:0] off; +wire [23:0] offL; +wire regwr, stall, stallL, stallM, stallD, stallFA, stallFM, stallFD; +wire [1:0] sc1, sc0; +wire a0, a1, a2, a3; +wire [7:0] inbusL, outbusB0, outbusB1, outbusB2, outbusB3; +wire [23:0] inbusH; +wire [31:0] A, B, C0, C1, aluRes, regmux, s1, s2, s3, t1, t2, t3, quotient, remainder; +wire [63:0] product; +wire [31:0] fsum, fprod, fquot; +wire Add, Sub, Mul, Div, Fadd, Fsub, Fmul, Fdiv, Ldr, Str, Br; +assign adr = stallL ? (B[23:0] + {4'h0, off}) : {pcmux, 2'h0}; +assign rd = ((Ldr & ~stallX) & ~stall1); +assign wr = ((Str & ~stallX) & ~stall1); +assign ben = ((((p & ~q) & v) & ~stallX) & ~stall1); +assign outbus = {outbusB3, outbusB2, outbusB1, outbusB0}; +PROM PM(.clk(clk), .adr(pcmux[8:0]), .data(pmout)); +Multiplier mulUnit(.clk(clk), .run(Mul), .u(~u), .stall(stallM), .x(B), .y(C1), .z(product)); +Divider divUnit(.clk(clk), .run(Div), .u(~u), .stall(stallD), .x(B), .y(C1), .quot(quotient), .rem(remainder)); +FPAdder faddUnit(.clk(clk), .run((Fadd | Fsub)), .u(u), .v(v), .stall(stallFA), .x(B), .y({(Fsub ^ C0[31]), C0[30:0]}), .z(fsum)); +FPMultiplier fmulUnit(.clk(clk), .run(Fmul), .stall(stallFM), .x(B), .y(C0), .z(fprod)); +FPDivider fdivUnit(.clk(clk), .run(Fdiv), .stall(stallFD), .x(B), .y(C0), .z(fquot)); +assign pcmux = ~rst ? 22'h3FF800 : stall ? PC : ((Br & cond) & u) ? (offL[21:0] + nxpc) : ((Br & cond) & ~u) ? C0[23:2] : nxpc; +assign nxpc = (PC + 1); +assign cond = (ins[27] ^ (((((((((cc == 0) & N) | ((cc == 1) & Z)) | ((cc == 2) & C)) | ((cc == 3) & OV)) | ((cc == 4) & (C | Z))) | ((cc == 5) & S)) | ((cc == 6) & (S | Z))) | (cc == 7))); +assign S = (N ^ OV); +assign sa = aluRes[31]; +assign sb = B[31]; +assign sc = C1[31]; +assign ins = PMsel ? pmout : IR; +assign p = ins[31]; +assign q = ins[30]; +assign u = ins[29]; +assign v = ins[28]; +assign w = ins[16]; +assign op = ins[19:16]; +assign ira = ins[27:24]; +assign ira0 = Br ? 4'hF : ira; +assign irb = ins[23:20]; +assign irc = ins[3:0]; +assign cc = ins[26:24]; +assign imm = ins[15:0]; +assign off = ins[19:0]; +assign offL = ins[23:0]; +assign regwr = (((~p & ~stall) | ((Ldr & ~stallX) & ~stall1)) | (((Br & cond) & v) & ~stallX)); +assign stall = ((((((stallL | stallM) | stallD) | stallFA) | stallFM) | stallFD) | stallX); +assign stallL = ((Ldr | Str) & ~stall1); +assign sc1 = C1[3:2]; +assign sc0 = C1[1:0]; +assign a0 = (~adr[1] & ~adr[0]); +assign a1 = (~adr[1] & adr[0]); +assign a2 = (adr[1] & ~adr[0]); +assign a3 = (adr[1] & adr[0]); +assign inbusL = (~ben | a0) ? inbus[7:0] : a1 ? inbus[15:8] : a2 ? inbus[23:16] : inbus[31:24]; +assign outbusB0 = A[7:0]; +assign outbusB1 = (ben & a1) ? A[7:0] : A[15:8]; +assign outbusB2 = (ben & a2) ? A[7:0] : A[23:16]; +assign outbusB3 = (ben & a3) ? A[7:0] : A[31:24]; +assign inbusH = ~ben ? inbus[31:8] : 24'h0; +assign A = R[ira0]; +assign B = R[irb]; +assign C0 = R[irc]; +assign C1 = q ? {{16{v}}, imm} : C0; +assign aluRes = ~op[3] ? ~op[2] ? ~op[1] ? ~op[0] ? q ? ~u ? {{16{v}}, imm} : {imm, 16'h0} : ~u ? C0 : ~v ? H : {N, Z, C, OV, 20'h0, 8'h58} : t3 : s3 : ~op[1] ? ~op[0] ? (B & C1) : (B & ~C1) : ~op[0] ? (B | C1) : (B ^ C1) : ~op[2] ? ~op[1] ? ~op[0] ? ((B + C) + (u & C)) : ((B - C1) - (u & C)) : ~op[0] ? product[31:0] : quotient : ~op[1] ? fsum : ~op[0] ? fprod : fquot; +assign regmux = Ldr ? {inbusH, inbusL} : (Br & v) ? {8'h0, nxpc, 2'h0} : aluRes; +assign s1 = (sc0 == 3) ? {w ? B[2:0] : {3{B[31]}}, B[31:3]} : (sc0 == 2) ? {w ? B[1:0] : {2{B[31]}}, B[31:2]} : (sc0 == 1) ? {w ? B[0] : B[31], B[31:1]} : B; +assign s2 = (sc1 == 3) ? {w ? s1[11:0] : {12{B[31]}}, s1[31:12]} : (sc1 == 2) ? {w ? s1[7:0] : {8{B[31]}}, s1[31:8]} : (sc1 == 1) ? {w ? s1[3:0] : {4{B[31]}}, s1[31:4]} : s1; +assign s3 = C1[4] ? {w ? s2[15:0] : {16{s2[31]}}, s2[31:16]} : s2; +assign t1 = (sc0 == 3) ? {B[28:0], 3'h0} : (sc0 == 2) ? {B[29:0], 2'h0} : (sc0 == 1) ? {B[30:0], 1'h0} : B; +assign t2 = (sc1 == 3) ? {t1[19:0], 12'h0} : (sc1 == 2) ? {t1[23:0], 8'h0} : (sc1 == 1) ? {t1[27:0], 4'h0} : t1; +assign t3 = C1[4] ? {t2[15:0], 16'h0} : t2; +assign Add = (~p & (op == 8)); +assign Sub = (~p & (op == 9)); +assign Mul = (~p & (op == 10)); +assign Div = (~p & (op == 11)); +assign Fadd = (~p & (op == 12)); +assign Fsub = (~p & (op == 13)); +assign Fmul = (~p & (op == 14)); +assign Fdiv = (~p & (op == 15)); +assign Ldr = ((p & ~q) & ~u); +assign Str = ((p & ~q) & u); +assign Br = (p & q); +always @ (posedge clk) begin PC <= pcmux; +IR <= stall ? IR : codebus; +N <= regwr ? regmux[31] : N; +Z <= regwr ? (regmux == 0) : Z; +C <= Add ? (((sb & sc) | ((~sa & ~sb) & sc)) | (((~sa & sb) & ~sc) & sa)) : Sub ? (((~sb & sc) | ((sa & ~sb) & ~sc)) | ((sa & sb) & sc)) : C; +OV <= Add ? (((sa & ~sb) & ~sc) | ((~sa & sb) & sc)) : Sub ? (((sa & ~sb) & sc) | ((~sa & sb) & ~sc)) : OV; +stall1 <= stallX ? stall1 : stallL; +PMsel <= (~rst | (pcmux[21:12] == 10'h3FF)); +R[ira0] <= regwr ? regmux : A; +H <= Mul ? product[63:32] : Div ? remainder : H; +end +endmodule diff --git a/src/test/confidence/lola/lola.Mod b/src/test/confidence/lola/lola.Mod index b330e008..eccebbfd 100755 --- a/src/test/confidence/lola/lola.Mod +++ b/src/test/confidence/lola/lola.Mod @@ -1,12 +1,12 @@ -MODULE Lola; (* Command line runner for Lola to verilog compilation *) - IMPORT LSB, LSC, LSV, Platform, Console; -BEGIN - IF Platform.ArgCount < 3 THEN - Console.String("Lola - compile lola source to verilog source."); Console.Ln; Console.Ln; - Console.String("usage:"); Console.Ln; Console.Ln; - Console.String(" lola lola-source-file verilog-source-file"); Console.Ln; Console.Ln; - ELSE - LSC.Compile; - IF LSB.modname # "" THEN LSV.List END - END -END Lola. +MODULE Lola; (* Command line runner for Lola to verilog compilation *) + IMPORT LSB, LSC, LSV, Platform, Console; +BEGIN + IF Platform.ArgCount < 3 THEN + Console.String("Lola - compile lola source to verilog source."); Console.Ln; Console.Ln; + Console.String("usage:"); Console.Ln; Console.Ln; + Console.String(" lola lola-source-file verilog-source-file"); Console.Ln; Console.Ln; + ELSE + LSC.Compile; + IF LSB.modname # "" THEN LSV.List END + END +END Lola. diff --git a/src/test/confidence/lola/result b/src/test/confidence/lola/result index 4a6b1bb8..12f87669 100644 --- a/src/test/confidence/lola/result +++ b/src/test/confidence/lola/result @@ -1,113 +1,113 @@ -`timescale 1ns / 1 ps -module RISC5( // translated from Lola -input clk, rst, stallX, -input [31:0] inbus, codebus, -output [23:0] adr, -output rd, wr, ben, -output [31:0] outbus); -reg [21:0] PC; -reg [31:0] IR; -reg N, Z, C, OV, stall1, PMsel; -reg [31:0] R[15:0]; -reg [31:0] H; -wire [21:0] pcmux, nxpc; -wire cond, S, sa, sb, sc; -wire [31:0] ins, pmout; -wire p, q, u, v, w; -wire [3:0] op, ira, ira0, irb, irc; -wire [2:0] cc; -wire [15:0] imm; -wire [19:0] off; -wire [23:0] offL; -wire regwr, stall, stallL, stallM, stallD, stallFA, stallFM, stallFD; -wire [1:0] sc1, sc0; -wire a0, a1, a2, a3; -wire [7:0] inbusL, outbusB0, outbusB1, outbusB2, outbusB3; -wire [23:0] inbusH; -wire [31:0] A, B, C0, C1, aluRes, regmux, s1, s2, s3, t1, t2, t3, quotient, remainder; -wire [63:0] product; -wire [31:0] fsum, fprod, fquot; -wire Add, Sub, Mul, Div, Fadd, Fsub, Fmul, Fdiv, Ldr, Str, Br; -assign adr = stallL ? (B[23:0] + {4'h0, off}) : {pcmux, 2'h0}; -assign rd = ((Ldr & ~stallX) & ~stall1); -assign wr = ((Str & ~stallX) & ~stall1); -assign ben = ((((p & ~q) & v) & ~stallX) & ~stall1); -assign outbus = {outbusB3, outbusB2, outbusB1, outbusB0}; -PROM PM(.clk(clk), .adr(pcmux[8:0]), .data(pmout)); -Multiplier mulUnit(.clk(clk), .run(Mul), .u(~u), .stall(stallM), .x(B), .y(C1), .z(product)); -Divider divUnit(.clk(clk), .run(Div), .u(~u), .stall(stallD), .x(B), .y(C1), .quot(quotient), .rem(remainder)); -FPAdder faddUnit(.clk(clk), .run((Fadd | Fsub)), .u(u), .v(v), .stall(stallFA), .x(B), .y({(Fsub ^ C0[31]), C0[30:0]}), .z(fsum)); -FPMultiplier fmulUnit(.clk(clk), .run(Fmul), .stall(stallFM), .x(B), .y(C0), .z(fprod)); -FPDivider fdivUnit(.clk(clk), .run(Fdiv), .stall(stallFD), .x(B), .y(C0), .z(fquot)); -assign pcmux = ~rst ? 22'h3FF800 : stall ? PC : ((Br & cond) & u) ? (offL[21:0] + nxpc) : ((Br & cond) & ~u) ? C0[23:2] : nxpc; -assign nxpc = (PC + 1); -assign cond = (ins[27] ^ (((((((((cc == 0) & N) | ((cc == 1) & Z)) | ((cc == 2) & C)) | ((cc == 3) & OV)) | ((cc == 4) & (C | Z))) | ((cc == 5) & S)) | ((cc == 6) & (S | Z))) | (cc == 7))); -assign S = (N ^ OV); -assign sa = aluRes[31]; -assign sb = B[31]; -assign sc = C1[31]; -assign ins = PMsel ? pmout : IR; -assign p = ins[31]; -assign q = ins[30]; -assign u = ins[29]; -assign v = ins[28]; -assign w = ins[16]; -assign op = ins[19:16]; -assign ira = ins[27:24]; -assign ira0 = Br ? 4'hF : ira; -assign irb = ins[23:20]; -assign irc = ins[3:0]; -assign cc = ins[26:24]; -assign imm = ins[15:0]; -assign off = ins[19:0]; -assign offL = ins[23:0]; -assign regwr = (((~p & ~stall) | ((Ldr & ~stallX) & ~stall1)) | (((Br & cond) & v) & ~stallX)); -assign stall = ((((((stallL | stallM) | stallD) | stallFA) | stallFM) | stallFD) | stallX); -assign stallL = ((Ldr | Str) & ~stall1); -assign sc1 = C1[3:2]; -assign sc0 = C1[1:0]; -assign a0 = (~adr[1] & ~adr[0]); -assign a1 = (~adr[1] & adr[0]); -assign a2 = (adr[1] & ~adr[0]); -assign a3 = (adr[1] & adr[0]); -assign inbusL = (~ben | a0) ? inbus[7:0] : a1 ? inbus[15:8] : a2 ? inbus[23:16] : inbus[31:24]; -assign outbusB0 = A[7:0]; -assign outbusB1 = (ben & a1) ? A[7:0] : A[15:8]; -assign outbusB2 = (ben & a2) ? A[7:0] : A[23:16]; -assign outbusB3 = (ben & a3) ? A[7:0] : A[31:24]; -assign inbusH = ~ben ? inbus[31:8] : 24'h0; -assign A = R[ira0]; -assign B = R[irb]; -assign C0 = R[irc]; -assign C1 = q ? {{16{v}}, imm} : C0; -assign aluRes = ~op[3] ? ~op[2] ? ~op[1] ? ~op[0] ? q ? ~u ? {{16{v}}, imm} : {imm, 16'h0} : ~u ? C0 : ~v ? H : {N, Z, C, OV, 20'h0, 8'h58} : t3 : s3 : ~op[1] ? ~op[0] ? (B & C1) : (B & ~C1) : ~op[0] ? (B | C1) : (B ^ C1) : ~op[2] ? ~op[1] ? ~op[0] ? ((B + C) + (u & C)) : ((B - C1) - (u & C)) : ~op[0] ? product[31:0] : quotient : ~op[1] ? fsum : ~op[0] ? fprod : fquot; -assign regmux = Ldr ? {inbusH, inbusL} : (Br & v) ? {8'h0, nxpc, 2'h0} : aluRes; -assign s1 = (sc0 == 3) ? {w ? B[2:0] : {3{B[31]}}, B[31:3]} : (sc0 == 2) ? {w ? B[1:0] : {2{B[31]}}, B[31:2]} : (sc0 == 1) ? {w ? B[0] : B[31], B[31:1]} : B; -assign s2 = (sc1 == 3) ? {w ? s1[11:0] : {12{B[31]}}, s1[31:12]} : (sc1 == 2) ? {w ? s1[7:0] : {8{B[31]}}, s1[31:8]} : (sc1 == 1) ? {w ? s1[3:0] : {4{B[31]}}, s1[31:4]} : s1; -assign s3 = C1[4] ? {w ? s2[15:0] : {16{s2[31]}}, s2[31:16]} : s2; -assign t1 = (sc0 == 3) ? {B[28:0], 3'h0} : (sc0 == 2) ? {B[29:0], 2'h0} : (sc0 == 1) ? {B[30:0], 1'h0} : B; -assign t2 = (sc1 == 3) ? {t1[19:0], 12'h0} : (sc1 == 2) ? {t1[23:0], 8'h0} : (sc1 == 1) ? {t1[27:0], 4'h0} : t1; -assign t3 = C1[4] ? {t2[15:0], 16'h0} : t2; -assign Add = (~p & (op == 8)); -assign Sub = (~p & (op == 9)); -assign Mul = (~p & (op == 10)); -assign Div = (~p & (op == 11)); -assign Fadd = (~p & (op == 12)); -assign Fsub = (~p & (op == 13)); -assign Fmul = (~p & (op == 14)); -assign Fdiv = (~p & (op == 15)); -assign Ldr = ((p & ~q) & ~u); -assign Str = ((p & ~q) & u); -assign Br = (p & q); -always @ (posedge clk) begin PC <= pcmux; -IR <= stall ? IR : codebus; -N <= regwr ? regmux[31] : N; -Z <= regwr ? (regmux == 0) : Z; -C <= Add ? (((sb & sc) | ((~sa & ~sb) & sc)) | (((~sa & sb) & ~sc) & sa)) : Sub ? (((~sb & sc) | ((sa & ~sb) & ~sc)) | ((sa & sb) & sc)) : C; -OV <= Add ? (((sa & ~sb) & ~sc) | ((~sa & sb) & sc)) : Sub ? (((sa & ~sb) & sc) | ((~sa & sb) & ~sc)) : OV; -stall1 <= stallX ? stall1 : stallL; -PMsel <= (~rst | (pcmux[21:12] == 10'h3FF)); -R[ira0] <= regwr ? regmux : A; -H <= Mul ? product[63:32] : Div ? remainder : H; -end -endmodule +`timescale 1ns / 1 ps +module RISC5( // translated from Lola +input clk, rst, stallX, +input [31:0] inbus, codebus, +output [23:0] adr, +output rd, wr, ben, +output [31:0] outbus); +reg [21:0] PC; +reg [31:0] IR; +reg N, Z, C, OV, stall1, PMsel; +reg [31:0] R[15:0]; +reg [31:0] H; +wire [21:0] pcmux, nxpc; +wire cond, S, sa, sb, sc; +wire [31:0] ins, pmout; +wire p, q, u, v, w; +wire [3:0] op, ira, ira0, irb, irc; +wire [2:0] cc; +wire [15:0] imm; +wire [19:0] off; +wire [23:0] offL; +wire regwr, stall, stallL, stallM, stallD, stallFA, stallFM, stallFD; +wire [1:0] sc1, sc0; +wire a0, a1, a2, a3; +wire [7:0] inbusL, outbusB0, outbusB1, outbusB2, outbusB3; +wire [23:0] inbusH; +wire [31:0] A, B, C0, C1, aluRes, regmux, s1, s2, s3, t1, t2, t3, quotient, remainder; +wire [63:0] product; +wire [31:0] fsum, fprod, fquot; +wire Add, Sub, Mul, Div, Fadd, Fsub, Fmul, Fdiv, Ldr, Str, Br; +assign adr = stallL ? (B[23:0] + {4'h0, off}) : {pcmux, 2'h0}; +assign rd = ((Ldr & ~stallX) & ~stall1); +assign wr = ((Str & ~stallX) & ~stall1); +assign ben = ((((p & ~q) & v) & ~stallX) & ~stall1); +assign outbus = {outbusB3, outbusB2, outbusB1, outbusB0}; +PROM PM(.clk(clk), .adr(pcmux[8:0]), .data(pmout)); +Multiplier mulUnit(.clk(clk), .run(Mul), .u(~u), .stall(stallM), .x(B), .y(C1), .z(product)); +Divider divUnit(.clk(clk), .run(Div), .u(~u), .stall(stallD), .x(B), .y(C1), .quot(quotient), .rem(remainder)); +FPAdder faddUnit(.clk(clk), .run((Fadd | Fsub)), .u(u), .v(v), .stall(stallFA), .x(B), .y({(Fsub ^ C0[31]), C0[30:0]}), .z(fsum)); +FPMultiplier fmulUnit(.clk(clk), .run(Fmul), .stall(stallFM), .x(B), .y(C0), .z(fprod)); +FPDivider fdivUnit(.clk(clk), .run(Fdiv), .stall(stallFD), .x(B), .y(C0), .z(fquot)); +assign pcmux = ~rst ? 22'h3FF800 : stall ? PC : ((Br & cond) & u) ? (offL[21:0] + nxpc) : ((Br & cond) & ~u) ? C0[23:2] : nxpc; +assign nxpc = (PC + 1); +assign cond = (ins[27] ^ (((((((((cc == 0) & N) | ((cc == 1) & Z)) | ((cc == 2) & C)) | ((cc == 3) & OV)) | ((cc == 4) & (C | Z))) | ((cc == 5) & S)) | ((cc == 6) & (S | Z))) | (cc == 7))); +assign S = (N ^ OV); +assign sa = aluRes[31]; +assign sb = B[31]; +assign sc = C1[31]; +assign ins = PMsel ? pmout : IR; +assign p = ins[31]; +assign q = ins[30]; +assign u = ins[29]; +assign v = ins[28]; +assign w = ins[16]; +assign op = ins[19:16]; +assign ira = ins[27:24]; +assign ira0 = Br ? 4'hF : ira; +assign irb = ins[23:20]; +assign irc = ins[3:0]; +assign cc = ins[26:24]; +assign imm = ins[15:0]; +assign off = ins[19:0]; +assign offL = ins[23:0]; +assign regwr = (((~p & ~stall) | ((Ldr & ~stallX) & ~stall1)) | (((Br & cond) & v) & ~stallX)); +assign stall = ((((((stallL | stallM) | stallD) | stallFA) | stallFM) | stallFD) | stallX); +assign stallL = ((Ldr | Str) & ~stall1); +assign sc1 = C1[3:2]; +assign sc0 = C1[1:0]; +assign a0 = (~adr[1] & ~adr[0]); +assign a1 = (~adr[1] & adr[0]); +assign a2 = (adr[1] & ~adr[0]); +assign a3 = (adr[1] & adr[0]); +assign inbusL = (~ben | a0) ? inbus[7:0] : a1 ? inbus[15:8] : a2 ? inbus[23:16] : inbus[31:24]; +assign outbusB0 = A[7:0]; +assign outbusB1 = (ben & a1) ? A[7:0] : A[15:8]; +assign outbusB2 = (ben & a2) ? A[7:0] : A[23:16]; +assign outbusB3 = (ben & a3) ? A[7:0] : A[31:24]; +assign inbusH = ~ben ? inbus[31:8] : 24'h0; +assign A = R[ira0]; +assign B = R[irb]; +assign C0 = R[irc]; +assign C1 = q ? {{16{v}}, imm} : C0; +assign aluRes = ~op[3] ? ~op[2] ? ~op[1] ? ~op[0] ? q ? ~u ? {{16{v}}, imm} : {imm, 16'h0} : ~u ? C0 : ~v ? H : {N, Z, C, OV, 20'h0, 8'h58} : t3 : s3 : ~op[1] ? ~op[0] ? (B & C1) : (B & ~C1) : ~op[0] ? (B | C1) : (B ^ C1) : ~op[2] ? ~op[1] ? ~op[0] ? ((B + C) + (u & C)) : ((B - C1) - (u & C)) : ~op[0] ? product[31:0] : quotient : ~op[1] ? fsum : ~op[0] ? fprod : fquot; +assign regmux = Ldr ? {inbusH, inbusL} : (Br & v) ? {8'h0, nxpc, 2'h0} : aluRes; +assign s1 = (sc0 == 3) ? {w ? B[2:0] : {3{B[31]}}, B[31:3]} : (sc0 == 2) ? {w ? B[1:0] : {2{B[31]}}, B[31:2]} : (sc0 == 1) ? {w ? B[0] : B[31], B[31:1]} : B; +assign s2 = (sc1 == 3) ? {w ? s1[11:0] : {12{B[31]}}, s1[31:12]} : (sc1 == 2) ? {w ? s1[7:0] : {8{B[31]}}, s1[31:8]} : (sc1 == 1) ? {w ? s1[3:0] : {4{B[31]}}, s1[31:4]} : s1; +assign s3 = C1[4] ? {w ? s2[15:0] : {16{s2[31]}}, s2[31:16]} : s2; +assign t1 = (sc0 == 3) ? {B[28:0], 3'h0} : (sc0 == 2) ? {B[29:0], 2'h0} : (sc0 == 1) ? {B[30:0], 1'h0} : B; +assign t2 = (sc1 == 3) ? {t1[19:0], 12'h0} : (sc1 == 2) ? {t1[23:0], 8'h0} : (sc1 == 1) ? {t1[27:0], 4'h0} : t1; +assign t3 = C1[4] ? {t2[15:0], 16'h0} : t2; +assign Add = (~p & (op == 8)); +assign Sub = (~p & (op == 9)); +assign Mul = (~p & (op == 10)); +assign Div = (~p & (op == 11)); +assign Fadd = (~p & (op == 12)); +assign Fsub = (~p & (op == 13)); +assign Fmul = (~p & (op == 14)); +assign Fdiv = (~p & (op == 15)); +assign Ldr = ((p & ~q) & ~u); +assign Str = ((p & ~q) & u); +assign Br = (p & q); +always @ (posedge clk) begin PC <= pcmux; +IR <= stall ? IR : codebus; +N <= regwr ? regmux[31] : N; +Z <= regwr ? (regmux == 0) : Z; +C <= Add ? (((sb & sc) | ((~sa & ~sb) & sc)) | (((~sa & sb) & ~sc) & sa)) : Sub ? (((~sb & sc) | ((sa & ~sb) & ~sc)) | ((sa & sb) & sc)) : C; +OV <= Add ? (((sa & ~sb) & ~sc) | ((~sa & sb) & sc)) : Sub ? (((sa & ~sb) & sc) | ((~sa & sb) & ~sc)) : OV; +stall1 <= stallX ? stall1 : stallL; +PMsel <= (~rst | (pcmux[21:12] == 10'h3FF)); +R[ira0] <= regwr ? regmux : A; +H <= Mul ? product[63:32] : Div ? remainder : H; +end +endmodule diff --git a/src/voc07R/CompatTexts.Mod b/src/voc07R/CompatTexts.Mod index 62b9073a..8e8b45ac 100644 --- a/src/voc07R/CompatTexts.Mod +++ b/src/voc07R/CompatTexts.Mod @@ -1,585 +1,585 @@ -MODULE CompatTexts; (*JG 21.11.90 / NW 11.7.90 / 24.12.95 / 22.11.10 / 26.3.2014*) - IMPORT Files := CompatFiles, Fonts; - - TYPE INTEGER = LONGINT; (* voc adaptation by noch *) - BYTE = CHAR; - - CONST (*scanner symbol classes*) - Inval* = 0; (*invalid symbol*) - Name* = 1; (*name s (length len)*) - String* = 2; (*literal string s (length len)*) - Int* = 3; (*integer i (decimal or hexadecimal)*) - Real* = 4; (*real number x*) - Char* = 6; (*special character c*) - - (* TextBlock = TextTag "1" offset run {run} "0" len {AsciiCode}. - run = fnt [name] col voff len. *) - - TAB = 9X; CR = 0DX; maxD = 9; - TextTag = 0F1X; - replace* = 0; insert* = 1; delete* = 2; unmark* = 3; (*op-codes*) - - TYPE Piece = POINTER TO PieceDesc; - PieceDesc = RECORD - f: Files.File; - off, len: LONGINT; - fnt: Fonts.Font; - col, voff: INTEGER; - prev, next: Piece - END; - - Text* = POINTER TO TextDesc; - Notifier* = PROCEDURE (T: Text; op: INTEGER; beg, end: LONGINT); - TextDesc* = RECORD - len*: LONGINT; - changed*: BOOLEAN; - notify*: Notifier; - trailer: Piece; - pce: Piece; (*cache*) - org: LONGINT; (*cache*) - END; - - Reader* = RECORD - eot*: BOOLEAN; - fnt*: Fonts.Font; - col*, voff*: INTEGER; - ref: Piece; - org: LONGINT; - off: LONGINT; - rider: Files.Rider - END; - - Scanner* = RECORD (Reader) - nextCh*: CHAR; - line*, class*: INTEGER; - i*: LONGINT; - x*: REAL; - y*: LONGREAL; - c*: CHAR; - len*: INTEGER; - s*: ARRAY 32 OF CHAR - END; - - Buffer* = POINTER TO BufDesc; - BufDesc* = RECORD - len*: LONGINT; - header, last: Piece - END; - - Writer* = RECORD - buf*: Buffer; - fnt*: Fonts.Font; - col*, voff*: INTEGER; - rider: Files.Rider - END; - - VAR TrailerFile: Files.File; - - (* voc adaptation by noch *) - PROCEDURE FLOOR(x : REAL): INTEGER; - BEGIN - RETURN ENTIER(x) - END FLOOR; - - PROCEDURE LSL (x, n : INTEGER): INTEGER; - BEGIN - RETURN ASH(x, n); - END LSL; - - PROCEDURE ASR (x, n : INTEGER): INTEGER; - BEGIN - RETURN ASH(x, n); - END ASR; - - - (* -------------------- Filing ------------------------*) - - PROCEDURE Trailer(): Piece; - VAR Q: Piece; - BEGIN NEW(Q); - Q.f := TrailerFile; Q.off := -1; Q.len := 1; Q.fnt := NIL; Q.col := 0; Q.voff := 0; RETURN Q - END Trailer; - - PROCEDURE Load* (VAR R: Files.Rider; T: Text); - VAR Q, q, p: Piece; - off: LONGINT; - N, fno: INTEGER; bt: BYTE; - f: Files.File; - FName: ARRAY 32 OF CHAR; - Dict: ARRAY 32 OF Fonts.Font; - BEGIN f := Files.Base(R); N := 1; Q := Trailer(); p := Q; - Files.ReadInt(R, off); Files.ReadByte(R, bt); - (*fno := bt;*) - fno := ORD(bt); (* voc adaptation by noch *) - WHILE fno # 0 DO - IF fno = N THEN - Files.ReadString(R, FName); - Dict[N] := Fonts.This(FName); INC(N) - END; - NEW(q); q.fnt := Dict[fno]; - Files.ReadByte(R, bt); - (*q.col := bt;*) - q.col := ORD(bt); (* voc adaptation by noch *) - Files.ReadByte(R, bt); - (*q.voff := ASR(LSL(bt, -24), 24);*) - q.voff := ASR(LSL(ORD(bt), -24), 24); (* voc adaptation by noch *) - Files.ReadInt(R, q.len); - Files.ReadByte(R, bt); - (*fno := bt;*) - fno := ORD(bt); (* voc adaptation by noch *) - q.f := f; q.off := off; off := off + q.len; - p.next := q; q.prev := p; p := q - END; - p.next := Q; Q.prev := p; - T.trailer := Q; Files.ReadInt(R, T.len); (*Files.Set(R, f, Files.Pos(R) + T.len)*) - END Load; - - PROCEDURE Open* (T: Text; name: ARRAY OF CHAR); - VAR f: Files.File; R: Files.Rider; Q, q: Piece; - tag: CHAR; len: LONGINT; - BEGIN f := Files.Old(name); - IF f # NIL THEN - Files.Set(R, f, 0); Files.Read(R, tag); - IF tag = TextTag THEN Load(R, T) - ELSE (*Ascii file*) - len := Files.Length(f); Q := Trailer(); - NEW(q); q.fnt := Fonts.Default; q.col := 1; q.voff := 0; q.f := f; q.off := 0; q.len := len; - Q.next := q; q.prev := Q; q.next := Q; Q.prev := q; T.trailer := Q; T.len := len - END - ELSE (*create new text*) - Q := Trailer(); Q.next := Q; Q.prev := Q; T.trailer := Q; T.len := 0 - END ; - T.changed := FALSE; T.org := -1; T.pce := T.trailer (*init cache*) - END Open; - - PROCEDURE Store* (VAR W: Files.Rider; T: Text); - VAR p, q: Piece; - R: Files.Rider; - off, rlen, pos: LONGINT; - N, n: INTEGER; - ch: CHAR; - Dict: ARRAY 32, 32 OF CHAR; - BEGIN pos := Files.Pos(W); Files.WriteInt(W, 0); (*place holder*) - N := 1; p := T.trailer.next; - WHILE p # T.trailer DO - rlen := p.len; q := p.next; - WHILE (q # T.trailer) & (q.fnt = p.fnt) & (q.col = p.col) & (q.voff = p.voff) DO - rlen := rlen + q.len; q := q.next - END; - (*Dict[N] := p.fnt.name;*) - IF p.fnt # NIL THEN COPY(p.fnt.name, Dict[N]) END; (* voc adaptation by noch *) - n := 1; - IF p.fnt # NIL THEN (* voc adaptation by noch *) - WHILE Dict[n] # p.fnt.name DO INC(n) END; - END; - (*Files.WriteByte(W, n);*) - Files.WriteByte(W, SHORT(SHORT(n))); (* voc adaptation by noch *) - IF p.fnt # NIL THEN (* voc adaptation by noch *) - IF n = N THEN Files.WriteString(W, p.fnt.name); INC(N) END; - END; - (*Files.WriteByte(W, p.col);*) - Files.WriteByte(W, SHORT(SHORT(p.col))); (* voc adaptation by noch *) - (*Files.WriteByte(W, p.voff);*) - Files.WriteByte(W, SHORT(SHORT(p.voff))); (* voc adaptation by noch *) - Files.WriteInt(W, rlen); - p := q - END; - Files.WriteByte(W, 0); Files.WriteInt(W, T.len); - off := Files.Pos(W); p := T.trailer.next; - WHILE p # T.trailer DO - rlen := p.len; Files.Set(R, p.f, p.off); - WHILE rlen > 0 DO Files.Read(R, ch); Files.Write(W, ch); DEC(rlen) END ; - p := p.next - END ; - Files.Set(W, Files.Base(W), pos); Files.WriteInt(W, off); (*fixup*) - T.changed := FALSE; - IF T.notify # NIL THEN T.notify(T, unmark, 0, 0) END - END Store; - - PROCEDURE Close*(T: Text; name: ARRAY OF CHAR); - VAR f: Files.File; w: Files.Rider; - BEGIN f := Files.New(name); Files.Set(w, f, 0); - Files.Write(w, TextTag); Store(w, T); Files.Register(f) - END Close; - - (* -------------------- Editing ----------------------- *) - - PROCEDURE OpenBuf* (B: Buffer); - BEGIN NEW(B.header); (*null piece*) - B.last := B.header; B.len := 0 - END OpenBuf; - - PROCEDURE FindPiece (T: Text; pos: LONGINT; VAR org: LONGINT; VAR pce: Piece); - VAR p: Piece; porg: LONGINT; - BEGIN p := T.pce; porg := T.org; - IF pos >= porg THEN - WHILE pos >= porg + p.len DO INC(porg, p.len); p := p.next END - ELSE p := p.prev; DEC(porg, p.len); - WHILE pos < porg DO p := p.prev; DEC(porg, p.len) END - END ; - T.pce := p; T.org := porg; (*update cache*) - pce := p; org := porg - END FindPiece; - - PROCEDURE SplitPiece (p: Piece; off: LONGINT; VAR pr: Piece); - VAR q: Piece; - BEGIN - IF off > 0 THEN NEW(q); - q.fnt := p.fnt; q.col := p.col; q.voff := p.voff; - q.len := p.len - off; - q.f := p.f; q.off := p.off + off; - p.len := off; - q.next := p.next; p.next := q; - q.prev := p; q.next.prev := q; - pr := q - ELSE pr := p - END - END SplitPiece; - - PROCEDURE Save* (T: Text; beg, end: LONGINT; B: Buffer); - VAR p, q, qb, qe: Piece; org: LONGINT; - BEGIN - IF end > T.len THEN end := T.len END; - FindPiece(T, beg, org, p); - NEW(qb); qb^ := p^; - qb.len := qb.len - (beg - org); - qb.off := qb.off + (beg - org); - qe := qb; - WHILE end > org + p.len DO - org := org + p.len; p := p.next; - NEW(q); q^ := p^; qe.next := q; q.prev := qe; qe := q - END; - qe.next := NIL; qe.len := qe.len - (org + p.len - end); - B.last.next := qb; qb.prev := B.last; B.last := qe; - B.len := B.len + (end - beg) - END Save; - - PROCEDURE Copy* (SB, DB: Buffer); - VAR Q, q, p: Piece; - BEGIN p := SB.header; Q := DB.last; - WHILE p # SB.last DO p := p.next; - NEW(q); q^ := p^; Q.next := q; q.prev := Q; Q := q - END; - DB.last := Q; DB.len := DB.len + SB.len - END Copy; - - PROCEDURE Insert* (T: Text; pos: LONGINT; B: Buffer); - VAR pl, pr, p, qb, qe: Piece; org, end: LONGINT; - BEGIN - FindPiece(T, pos, org, p); SplitPiece(p, pos - org, pr); - IF T.org >= org THEN T.org := org - p.prev.len; T.pce := p.prev END ; - pl := pr.prev; qb := B.header.next; - IF (qb # NIL) & (qb.f = pl.f) & (qb.off = pl.off + pl.len) - & (qb.fnt = pl.fnt) & (qb.col = pl.col) & (qb.voff = pl.voff) THEN - pl.len := pl.len + qb.len; qb := qb.next - END; - IF qb # NIL THEN qe := B.last; - qb.prev := pl; pl.next := qb; qe.next := pr; pr.prev := qe - END; - T.len := T.len + B.len; end := pos + B.len; - B.last := B.header; B.last.next := NIL; B.len := 0; - T.changed := TRUE; - (*T.notify(T, insert, pos, end)*) - IF T.notify # NIL THEN - T.notify(T, insert, pos, end) - END(* voc adaptation by noch *) - END Insert; - - PROCEDURE Append* (T: Text; B: Buffer); - BEGIN Insert(T, T.len, B) - END Append; - - PROCEDURE Delete* (T: Text; beg, end: LONGINT; B: Buffer); - VAR pb, pe, pbr, per: Piece; orgb, orge: LONGINT; - BEGIN - IF end > T.len THEN end := T.len END; - FindPiece(T, beg, orgb, pb); SplitPiece(pb, beg - orgb, pbr); - FindPiece(T, end, orge, pe); - SplitPiece(pe, end - orge, per); - IF T.org >= orgb THEN (*adjust cache*) - T.org := orgb - pb.prev.len; T.pce := pb.prev - END; - B.header.next := pbr; B.last := per.prev; - B.last.next := NIL; B.len := end - beg; - per.prev := pbr.prev; pbr.prev.next := per; - T.len := T.len - B.len; - T.changed := TRUE; - IF T.notify # NIL THEN (* noch *) - T.notify(T, delete, beg, end) - END - END Delete; - - PROCEDURE ChangeLooks* (T: Text; beg, end: LONGINT; sel: SET; fnt: Fonts.Font; col, voff: INTEGER); - VAR pb, pe, p: Piece; org: LONGINT; - BEGIN - IF end > T.len THEN end := T.len END; - FindPiece(T, beg, org, p); SplitPiece(p, beg - org, pb); - FindPiece(T, end, org, p); SplitPiece(p, end - org, pe); - p := pb; - REPEAT - IF 0 IN sel THEN p.fnt := fnt END; - IF 1 IN sel THEN p.col := col END; - IF 2 IN sel THEN p.voff := voff END; - p := p.next - UNTIL p = pe; - T.changed := TRUE; - IF T.notify # NIL THEN (* noch *) - T.notify(T, replace, beg, end) - END - END ChangeLooks; - - PROCEDURE Attributes*(T: Text; pos: LONGINT; VAR fnt: Fonts.Font; VAR col, voff: INTEGER); - VAR p: Piece; org: LONGINT; - BEGIN FindPiece(T, pos, org, p); fnt := p.fnt; col := p.col; voff := p.voff - END Attributes; - - (* ------------------ Access: Readers ------------------------- *) - - PROCEDURE OpenReader* (VAR R: Reader; T: Text; pos: LONGINT); - VAR p: Piece; org: LONGINT; - BEGIN FindPiece(T, pos, org, p); - R.ref := p; R.org := org; R.off := pos - org; - Files.Set(R.rider, p.f, p.off + R.off); R.eot := FALSE - END OpenReader; - - PROCEDURE Read* (VAR R: Reader; VAR ch: CHAR); - BEGIN Files.Read(R.rider, ch); - R.fnt := R.ref.fnt; R.col := R.ref.col; R.voff := R.ref.voff; - INC(R.off); - IF R.off = R.ref.len THEN - IF R.ref.f = TrailerFile THEN R.eot := TRUE END; - R.org := R.org + R.off; R.off := 0; - R.ref := R.ref.next; R.org := R.org + R.off; R.off := 0; - Files.Set(R.rider, R.ref.f, R.ref.off) - END - END Read; - - PROCEDURE Pos* (VAR R: Reader): LONGINT; - BEGIN RETURN R.org + R.off - END Pos; - - (* ------------------ Access: Scanners (NW) ------------------------- *) - - PROCEDURE OpenScanner* (VAR S: Scanner; T: Text; pos: LONGINT); - BEGIN OpenReader(S, T, pos); S.line := 0; S.nextCh := " " - END OpenScanner; - - (*floating point formats: - x = 1.m * 2^(e-127) bit 0: sign, bits 1- 8: e, bits 9-31: m - x = 1.m * 2^(e-1023) bit 0: sign, bits 1-11: e, bits 12-63: m *) - - PROCEDURE Ten(n: INTEGER): REAL; - VAR t, p: REAL; - BEGIN t := 1.0; p := 10.0; (*compute 10^n *) - WHILE n > 0 DO - IF ODD(n) THEN t := p * t END ; - p := p*p; n := n DIV 2 - END ; - RETURN t - END Ten; - - PROCEDURE Scan* (VAR S: Scanner); - CONST maxExp = 38; maxM = 16777216; (*2^24*) - VAR ch, term: CHAR; - neg, negE, hex: BOOLEAN; - i, j, h, d, e, n, s: INTEGER; - k: LONGINT; - x: REAL; - BEGIN ch := S.nextCh; i := 0; - WHILE (ch = " ") OR (ch = TAB) OR (ch = CR) DO - IF ch = CR THEN INC(S.line) END ; - Read(S, ch) - END ; - IF ("A" <= ch) & (ch <= "Z") OR ("a" <= ch) & (ch <= "z") THEN (*name*) - REPEAT S.s[i] := ch; INC(i); Read(S, ch) - UNTIL ((ch < "0") & (ch # ".") OR ("9" < ch) & (ch < "A") OR ("Z" < ch) & (ch < "a") OR ("z" < ch)) OR (i = 31); - S.s[i] := 0X; S.len := i; S.class := Name - ELSIF ch = 22X THEN (*string*) - Read(S, ch); - WHILE (ch # 22X) & (ch >= " ") & (i # 31) DO S.s[i] := ch; INC(i); Read(S, ch) END; - S.s[i] := 0X; S.len := i+1; Read(S, ch); S.class := String - ELSE hex := FALSE; - IF ch = "-" THEN neg := TRUE; Read(S, ch) ELSE neg := FALSE END ; - IF ("0" <= ch) & (ch <= "9") THEN (*number*) - n := ORD(ch) - 30H; h := n; Read(S, ch); - WHILE ("0" <= ch) & (ch <= "9") OR ("A" <= ch) & (ch <= "F") DO - IF ch <= "9" THEN d := ORD(ch) - 30H ELSE d := ORD(ch) - 37H; hex := TRUE END ; - n := 10*n + d; h := 10H*h + d; Read(S, ch) - END ; - IF ch = "H" THEN (*hex integer*) Read(S, ch); S.i := h; S.class := Int (*neg?*) - ELSIF ch = "." THEN (*real number*) - Read(S, ch); x := 0.0; e := 0; j := 0; - WHILE ("0" <= ch) & (ch <= "9") DO (*fraction*) - h := 10*n + (ORD(ch) - 30H); - IF h < maxM THEN n := h; INC(j) END ; - Read(S, ch) - END ; - IF ch = "E" THEN (*scale factor*) - s := 0; Read(S, ch); - IF ch = "-" THEN negE := TRUE; Read(S, ch) - ELSE negE := FALSE; - IF ch = "+" THEN Read(S, ch) END - END ; - WHILE ("0" <= ch) & (ch <= "9") DO - s := s*10 + ORD(ch) - 30H; Read(S, ch) - END ; - IF negE THEN DEC(e, s) ELSE INC(e, s) END ; - END ; - (*x := FLT(n);*) - x := n; (* voc adaptation by noch *) - DEC(e, j); - IF e < 0 THEN - IF e >= -maxExp THEN x := x / Ten(-e) ELSE x := 0.0 END - ELSIF e > 0 THEN - IF e <= maxExp THEN x := Ten(e) * x ELSE x := 0.0 END - END ; - IF neg THEN S.x := -x ELSE S.x := x END ; - IF hex THEN S.class := 0 ELSE S.class := Real END - ELSE (*decimal integer*) - IF neg THEN S.i := -n ELSE S.i := n END; - IF hex THEN S.class := Inval ELSE S.class := Int END - END - ELSE (*spectal character*) S.class := Char; - IF neg THEN S.c := "-" ELSE S.c := ch; Read(S, ch) END - END - END ; - S.nextCh := ch - END Scan; - - (* --------------- Access: Writers (NW) ------------------ *) - - PROCEDURE OpenWriter* (VAR W: Writer); - BEGIN NEW(W.buf); - OpenBuf(W.buf); W.fnt := Fonts.Default; W.col := 15; W.voff := 0; - Files.Set(W.rider, Files.New(""), 0) - END OpenWriter; - - PROCEDURE SetFont* (VAR W: Writer; fnt: Fonts.Font); - BEGIN W.fnt := fnt - END SetFont; - - PROCEDURE SetColor* (VAR W: Writer; col: INTEGER); - BEGIN W.col := col - END SetColor; - - PROCEDURE SetOffset* (VAR W: Writer; voff: INTEGER); - BEGIN W.voff := voff - END SetOffset; - - PROCEDURE Write* (VAR W: Writer; ch: CHAR); - VAR p: Piece; - BEGIN - IF (W.buf.last.fnt # W.fnt) OR (W.buf.last.col # W.col) OR (W.buf.last.voff # W.voff) THEN - NEW(p); p.f := Files.Base(W.rider); p.off := Files.Pos(W.rider); p.len := 0; - p.fnt := W.fnt; p.col := W.col; p.voff:= W.voff; - p.next := NIL; W.buf.last.next := p; - p.prev := W.buf.last; W.buf.last := p - END; - Files.Write(W.rider, ch); - INC(W.buf.last.len); INC(W.buf.len) - END Write; - - PROCEDURE WriteLn* (VAR W: Writer); - BEGIN Write(W, CR) - END WriteLn; - - PROCEDURE WriteString* (VAR W: Writer; s: ARRAY OF CHAR); - VAR i: INTEGER; - BEGIN i := 0; - WHILE s[i] >= " " DO Write(W, s[i]); INC(i) END - END WriteString; - - PROCEDURE WriteInt* (VAR W: Writer; x, n: LONGINT); - VAR i: INTEGER; x0: LONGINT; - a: ARRAY 10 OF CHAR; - BEGIN - (*IF ROR(x, 31) = 1 THEN WriteString(W, " -2147483648") - ELSE*) i := 0; (* voc adaptation by noch *) - IF x < 0 THEN DEC(n); x0 := -x ELSE x0 := x END; - REPEAT - a[i] := CHR(x0 MOD 10 + 30H); x0 := x0 DIV 10; INC(i) - UNTIL x0 = 0; - WHILE n > i DO Write(W, " "); DEC(n) END; - IF x < 0 THEN Write(W, "-") END; - REPEAT DEC(i); Write(W, a[i]) UNTIL i = 0 - (*END*) - END WriteInt; - - PROCEDURE WriteHex* (VAR W: Writer; x: LONGINT); - VAR i: INTEGER; y: LONGINT; - a: ARRAY 10 OF CHAR; - BEGIN i := 0; Write(W, " "); - REPEAT y := x MOD 10H; - IF y < 10 THEN a[i] := CHR(y + 30H) ELSE a[i] := CHR(y + 37H) END; - x := x DIV 10H; INC(i) - UNTIL i = 8; - REPEAT DEC(i); Write(W, a[i]) UNTIL i = 0 - END WriteHex; -(* commented out because it's not necessary to compile OR compiler; -- noch - PROCEDURE WriteReal* (VAR W: Writer; x: REAL; n: INTEGER); - VAR e, i, m: INTEGER; x0: REAL; neg: BOOLEAN; - d: ARRAY 16 OF CHAR; - BEGIN - IF x = 0.0 THEN - WriteString(W, " 0.0"); i := 5; - WHILE i < n DO Write(W, " "); INC(i) END - ELSE - IF x < 0.0 THEN x := -x; neg := TRUE ELSE neg := FALSE END ; - x0 := x; UNPK(x0, e); - IF e = 255 THEN WriteString(W, " NaN") - ELSE - REPEAT Write(W, " "); DEC(n) UNTIL n <= 14; - IF neg THEN Write(W, "-") ELSE Write(W, " ") END ; - e := e * 77 DIV 256 - 6; - IF e >= 0 THEN x := x / Ten(e) ELSE x := x * Ten(-e) END ; - IF x >= 10.0E6 THEN x := 0.1*x; INC(e) END ; - m := FLOOR(x + 0.5); i := 0; - IF x >= 10.0E6 THEN x := 0.1*x; INC(e) END ; - REPEAT d[i] := CHR(m MOD 10 + 30H); m := m DIV 10; INC(i) UNTIL m = 0; - DEC(i); Write(W, d[i]); Write(W, "."); - IF i < n-6 THEN n := 0 ELSE n := 13-n END ; - WHILE i > n DO DEC(i); Write(W, d[i]) END ; - Write(W, "E"); INC(e, 6); - IF e < 0 THEN Write(W, "-"); e := -e ELSE Write(W, "+") END ; - Write(W, CHR(e DIV 10 + 30H)); Write(W, CHR(e MOD 10 + 30H)) - END - END - END WriteReal; - *) - PROCEDURE WriteRealFix* (VAR W: Writer; x: REAL; n, k: INTEGER); - VAR i, m: INTEGER; neg: BOOLEAN; - d: ARRAY 12 OF CHAR; - BEGIN - IF x = 0.0 THEN WriteString(W, " 0") - ELSE - IF x < 0.0 THEN x := -x; neg := TRUE ELSE neg := FALSE END ; - IF k > 7 THEN k := 7 END ; - x := Ten(k) * x; m := FLOOR(x + 0.5); - i := 0; - REPEAT d[i] := CHR(m MOD 10 + 30H); m := m DIV 10; INC(i) UNTIL m = 0; - REPEAT Write(W, " "); DEC(n) UNTIL n <= i+3; - IF neg THEN Write(W, "-"); DEC(n) ELSE Write(W, " ") END ; - WHILE i > k DO DEC(i); Write(W, d[i]) END ; - Write(W, "."); - WHILE k > i DO DEC(k); Write(W, "0") END ; - WHILE i > 0 DO DEC(i); Write(W, d[i]) END - END - END WriteRealFix; - - PROCEDURE WritePair(VAR W: Writer; ch: CHAR; x: LONGINT); - BEGIN Write(W, ch); - Write(W, CHR(x DIV 10 + 30H)); Write(W, CHR(x MOD 10 + 30H)) - END WritePair; - - PROCEDURE WriteClock* (VAR W: Writer; d: LONGINT); - BEGIN - WritePair(W, " ", d DIV 20000H MOD 20H); (*day*) - WritePair(W, ".", d DIV 400000H MOD 10H); (*month*) - WritePair(W, ".", d DIV 4000000H MOD 40H); (*year*) - WritePair(W, " ", d DIV 1000H MOD 20H); (*hour*) - WritePair(W, ":", d DIV 40H MOD 40H); (*min*) - WritePair(W, ":", d MOD 40H) (*sec*) - END WriteClock; - -BEGIN TrailerFile := Files.New("") -END CompatTexts. +MODULE CompatTexts; (*JG 21.11.90 / NW 11.7.90 / 24.12.95 / 22.11.10 / 26.3.2014*) + IMPORT Files := CompatFiles, Fonts; + + TYPE INTEGER = LONGINT; (* voc adaptation by noch *) + BYTE = CHAR; + + CONST (*scanner symbol classes*) + Inval* = 0; (*invalid symbol*) + Name* = 1; (*name s (length len)*) + String* = 2; (*literal string s (length len)*) + Int* = 3; (*integer i (decimal or hexadecimal)*) + Real* = 4; (*real number x*) + Char* = 6; (*special character c*) + + (* TextBlock = TextTag "1" offset run {run} "0" len {AsciiCode}. + run = fnt [name] col voff len. *) + + TAB = 9X; CR = 0DX; maxD = 9; + TextTag = 0F1X; + replace* = 0; insert* = 1; delete* = 2; unmark* = 3; (*op-codes*) + + TYPE Piece = POINTER TO PieceDesc; + PieceDesc = RECORD + f: Files.File; + off, len: LONGINT; + fnt: Fonts.Font; + col, voff: INTEGER; + prev, next: Piece + END; + + Text* = POINTER TO TextDesc; + Notifier* = PROCEDURE (T: Text; op: INTEGER; beg, end: LONGINT); + TextDesc* = RECORD + len*: LONGINT; + changed*: BOOLEAN; + notify*: Notifier; + trailer: Piece; + pce: Piece; (*cache*) + org: LONGINT; (*cache*) + END; + + Reader* = RECORD + eot*: BOOLEAN; + fnt*: Fonts.Font; + col*, voff*: INTEGER; + ref: Piece; + org: LONGINT; + off: LONGINT; + rider: Files.Rider + END; + + Scanner* = RECORD (Reader) + nextCh*: CHAR; + line*, class*: INTEGER; + i*: LONGINT; + x*: REAL; + y*: LONGREAL; + c*: CHAR; + len*: INTEGER; + s*: ARRAY 32 OF CHAR + END; + + Buffer* = POINTER TO BufDesc; + BufDesc* = RECORD + len*: LONGINT; + header, last: Piece + END; + + Writer* = RECORD + buf*: Buffer; + fnt*: Fonts.Font; + col*, voff*: INTEGER; + rider: Files.Rider + END; + + VAR TrailerFile: Files.File; + + (* voc adaptation by noch *) + PROCEDURE FLOOR(x : REAL): INTEGER; + BEGIN + RETURN ENTIER(x) + END FLOOR; + + PROCEDURE LSL (x, n : INTEGER): INTEGER; + BEGIN + RETURN ASH(x, n); + END LSL; + + PROCEDURE ASR (x, n : INTEGER): INTEGER; + BEGIN + RETURN ASH(x, n); + END ASR; + + + (* -------------------- Filing ------------------------*) + + PROCEDURE Trailer(): Piece; + VAR Q: Piece; + BEGIN NEW(Q); + Q.f := TrailerFile; Q.off := -1; Q.len := 1; Q.fnt := NIL; Q.col := 0; Q.voff := 0; RETURN Q + END Trailer; + + PROCEDURE Load* (VAR R: Files.Rider; T: Text); + VAR Q, q, p: Piece; + off: LONGINT; + N, fno: INTEGER; bt: BYTE; + f: Files.File; + FName: ARRAY 32 OF CHAR; + Dict: ARRAY 32 OF Fonts.Font; + BEGIN f := Files.Base(R); N := 1; Q := Trailer(); p := Q; + Files.ReadInt(R, off); Files.ReadByte(R, bt); + (*fno := bt;*) + fno := ORD(bt); (* voc adaptation by noch *) + WHILE fno # 0 DO + IF fno = N THEN + Files.ReadString(R, FName); + Dict[N] := Fonts.This(FName); INC(N) + END; + NEW(q); q.fnt := Dict[fno]; + Files.ReadByte(R, bt); + (*q.col := bt;*) + q.col := ORD(bt); (* voc adaptation by noch *) + Files.ReadByte(R, bt); + (*q.voff := ASR(LSL(bt, -24), 24);*) + q.voff := ASR(LSL(ORD(bt), -24), 24); (* voc adaptation by noch *) + Files.ReadInt(R, q.len); + Files.ReadByte(R, bt); + (*fno := bt;*) + fno := ORD(bt); (* voc adaptation by noch *) + q.f := f; q.off := off; off := off + q.len; + p.next := q; q.prev := p; p := q + END; + p.next := Q; Q.prev := p; + T.trailer := Q; Files.ReadInt(R, T.len); (*Files.Set(R, f, Files.Pos(R) + T.len)*) + END Load; + + PROCEDURE Open* (T: Text; name: ARRAY OF CHAR); + VAR f: Files.File; R: Files.Rider; Q, q: Piece; + tag: CHAR; len: LONGINT; + BEGIN f := Files.Old(name); + IF f # NIL THEN + Files.Set(R, f, 0); Files.Read(R, tag); + IF tag = TextTag THEN Load(R, T) + ELSE (*Ascii file*) + len := Files.Length(f); Q := Trailer(); + NEW(q); q.fnt := Fonts.Default; q.col := 1; q.voff := 0; q.f := f; q.off := 0; q.len := len; + Q.next := q; q.prev := Q; q.next := Q; Q.prev := q; T.trailer := Q; T.len := len + END + ELSE (*create new text*) + Q := Trailer(); Q.next := Q; Q.prev := Q; T.trailer := Q; T.len := 0 + END ; + T.changed := FALSE; T.org := -1; T.pce := T.trailer (*init cache*) + END Open; + + PROCEDURE Store* (VAR W: Files.Rider; T: Text); + VAR p, q: Piece; + R: Files.Rider; + off, rlen, pos: LONGINT; + N, n: INTEGER; + ch: CHAR; + Dict: ARRAY 32, 32 OF CHAR; + BEGIN pos := Files.Pos(W); Files.WriteInt(W, 0); (*place holder*) + N := 1; p := T.trailer.next; + WHILE p # T.trailer DO + rlen := p.len; q := p.next; + WHILE (q # T.trailer) & (q.fnt = p.fnt) & (q.col = p.col) & (q.voff = p.voff) DO + rlen := rlen + q.len; q := q.next + END; + (*Dict[N] := p.fnt.name;*) + IF p.fnt # NIL THEN COPY(p.fnt.name, Dict[N]) END; (* voc adaptation by noch *) + n := 1; + IF p.fnt # NIL THEN (* voc adaptation by noch *) + WHILE Dict[n] # p.fnt.name DO INC(n) END; + END; + (*Files.WriteByte(W, n);*) + Files.WriteByte(W, SHORT(SHORT(n))); (* voc adaptation by noch *) + IF p.fnt # NIL THEN (* voc adaptation by noch *) + IF n = N THEN Files.WriteString(W, p.fnt.name); INC(N) END; + END; + (*Files.WriteByte(W, p.col);*) + Files.WriteByte(W, SHORT(SHORT(p.col))); (* voc adaptation by noch *) + (*Files.WriteByte(W, p.voff);*) + Files.WriteByte(W, SHORT(SHORT(p.voff))); (* voc adaptation by noch *) + Files.WriteInt(W, rlen); + p := q + END; + Files.WriteByte(W, 0); Files.WriteInt(W, T.len); + off := Files.Pos(W); p := T.trailer.next; + WHILE p # T.trailer DO + rlen := p.len; Files.Set(R, p.f, p.off); + WHILE rlen > 0 DO Files.Read(R, ch); Files.Write(W, ch); DEC(rlen) END ; + p := p.next + END ; + Files.Set(W, Files.Base(W), pos); Files.WriteInt(W, off); (*fixup*) + T.changed := FALSE; + IF T.notify # NIL THEN T.notify(T, unmark, 0, 0) END + END Store; + + PROCEDURE Close*(T: Text; name: ARRAY OF CHAR); + VAR f: Files.File; w: Files.Rider; + BEGIN f := Files.New(name); Files.Set(w, f, 0); + Files.Write(w, TextTag); Store(w, T); Files.Register(f) + END Close; + + (* -------------------- Editing ----------------------- *) + + PROCEDURE OpenBuf* (B: Buffer); + BEGIN NEW(B.header); (*null piece*) + B.last := B.header; B.len := 0 + END OpenBuf; + + PROCEDURE FindPiece (T: Text; pos: LONGINT; VAR org: LONGINT; VAR pce: Piece); + VAR p: Piece; porg: LONGINT; + BEGIN p := T.pce; porg := T.org; + IF pos >= porg THEN + WHILE pos >= porg + p.len DO INC(porg, p.len); p := p.next END + ELSE p := p.prev; DEC(porg, p.len); + WHILE pos < porg DO p := p.prev; DEC(porg, p.len) END + END ; + T.pce := p; T.org := porg; (*update cache*) + pce := p; org := porg + END FindPiece; + + PROCEDURE SplitPiece (p: Piece; off: LONGINT; VAR pr: Piece); + VAR q: Piece; + BEGIN + IF off > 0 THEN NEW(q); + q.fnt := p.fnt; q.col := p.col; q.voff := p.voff; + q.len := p.len - off; + q.f := p.f; q.off := p.off + off; + p.len := off; + q.next := p.next; p.next := q; + q.prev := p; q.next.prev := q; + pr := q + ELSE pr := p + END + END SplitPiece; + + PROCEDURE Save* (T: Text; beg, end: LONGINT; B: Buffer); + VAR p, q, qb, qe: Piece; org: LONGINT; + BEGIN + IF end > T.len THEN end := T.len END; + FindPiece(T, beg, org, p); + NEW(qb); qb^ := p^; + qb.len := qb.len - (beg - org); + qb.off := qb.off + (beg - org); + qe := qb; + WHILE end > org + p.len DO + org := org + p.len; p := p.next; + NEW(q); q^ := p^; qe.next := q; q.prev := qe; qe := q + END; + qe.next := NIL; qe.len := qe.len - (org + p.len - end); + B.last.next := qb; qb.prev := B.last; B.last := qe; + B.len := B.len + (end - beg) + END Save; + + PROCEDURE Copy* (SB, DB: Buffer); + VAR Q, q, p: Piece; + BEGIN p := SB.header; Q := DB.last; + WHILE p # SB.last DO p := p.next; + NEW(q); q^ := p^; Q.next := q; q.prev := Q; Q := q + END; + DB.last := Q; DB.len := DB.len + SB.len + END Copy; + + PROCEDURE Insert* (T: Text; pos: LONGINT; B: Buffer); + VAR pl, pr, p, qb, qe: Piece; org, end: LONGINT; + BEGIN + FindPiece(T, pos, org, p); SplitPiece(p, pos - org, pr); + IF T.org >= org THEN T.org := org - p.prev.len; T.pce := p.prev END ; + pl := pr.prev; qb := B.header.next; + IF (qb # NIL) & (qb.f = pl.f) & (qb.off = pl.off + pl.len) + & (qb.fnt = pl.fnt) & (qb.col = pl.col) & (qb.voff = pl.voff) THEN + pl.len := pl.len + qb.len; qb := qb.next + END; + IF qb # NIL THEN qe := B.last; + qb.prev := pl; pl.next := qb; qe.next := pr; pr.prev := qe + END; + T.len := T.len + B.len; end := pos + B.len; + B.last := B.header; B.last.next := NIL; B.len := 0; + T.changed := TRUE; + (*T.notify(T, insert, pos, end)*) + IF T.notify # NIL THEN + T.notify(T, insert, pos, end) + END(* voc adaptation by noch *) + END Insert; + + PROCEDURE Append* (T: Text; B: Buffer); + BEGIN Insert(T, T.len, B) + END Append; + + PROCEDURE Delete* (T: Text; beg, end: LONGINT; B: Buffer); + VAR pb, pe, pbr, per: Piece; orgb, orge: LONGINT; + BEGIN + IF end > T.len THEN end := T.len END; + FindPiece(T, beg, orgb, pb); SplitPiece(pb, beg - orgb, pbr); + FindPiece(T, end, orge, pe); + SplitPiece(pe, end - orge, per); + IF T.org >= orgb THEN (*adjust cache*) + T.org := orgb - pb.prev.len; T.pce := pb.prev + END; + B.header.next := pbr; B.last := per.prev; + B.last.next := NIL; B.len := end - beg; + per.prev := pbr.prev; pbr.prev.next := per; + T.len := T.len - B.len; + T.changed := TRUE; + IF T.notify # NIL THEN (* noch *) + T.notify(T, delete, beg, end) + END + END Delete; + + PROCEDURE ChangeLooks* (T: Text; beg, end: LONGINT; sel: SET; fnt: Fonts.Font; col, voff: INTEGER); + VAR pb, pe, p: Piece; org: LONGINT; + BEGIN + IF end > T.len THEN end := T.len END; + FindPiece(T, beg, org, p); SplitPiece(p, beg - org, pb); + FindPiece(T, end, org, p); SplitPiece(p, end - org, pe); + p := pb; + REPEAT + IF 0 IN sel THEN p.fnt := fnt END; + IF 1 IN sel THEN p.col := col END; + IF 2 IN sel THEN p.voff := voff END; + p := p.next + UNTIL p = pe; + T.changed := TRUE; + IF T.notify # NIL THEN (* noch *) + T.notify(T, replace, beg, end) + END + END ChangeLooks; + + PROCEDURE Attributes*(T: Text; pos: LONGINT; VAR fnt: Fonts.Font; VAR col, voff: INTEGER); + VAR p: Piece; org: LONGINT; + BEGIN FindPiece(T, pos, org, p); fnt := p.fnt; col := p.col; voff := p.voff + END Attributes; + + (* ------------------ Access: Readers ------------------------- *) + + PROCEDURE OpenReader* (VAR R: Reader; T: Text; pos: LONGINT); + VAR p: Piece; org: LONGINT; + BEGIN FindPiece(T, pos, org, p); + R.ref := p; R.org := org; R.off := pos - org; + Files.Set(R.rider, p.f, p.off + R.off); R.eot := FALSE + END OpenReader; + + PROCEDURE Read* (VAR R: Reader; VAR ch: CHAR); + BEGIN Files.Read(R.rider, ch); + R.fnt := R.ref.fnt; R.col := R.ref.col; R.voff := R.ref.voff; + INC(R.off); + IF R.off = R.ref.len THEN + IF R.ref.f = TrailerFile THEN R.eot := TRUE END; + R.org := R.org + R.off; R.off := 0; + R.ref := R.ref.next; R.org := R.org + R.off; R.off := 0; + Files.Set(R.rider, R.ref.f, R.ref.off) + END + END Read; + + PROCEDURE Pos* (VAR R: Reader): LONGINT; + BEGIN RETURN R.org + R.off + END Pos; + + (* ------------------ Access: Scanners (NW) ------------------------- *) + + PROCEDURE OpenScanner* (VAR S: Scanner; T: Text; pos: LONGINT); + BEGIN OpenReader(S, T, pos); S.line := 0; S.nextCh := " " + END OpenScanner; + + (*floating point formats: + x = 1.m * 2^(e-127) bit 0: sign, bits 1- 8: e, bits 9-31: m + x = 1.m * 2^(e-1023) bit 0: sign, bits 1-11: e, bits 12-63: m *) + + PROCEDURE Ten(n: INTEGER): REAL; + VAR t, p: REAL; + BEGIN t := 1.0; p := 10.0; (*compute 10^n *) + WHILE n > 0 DO + IF ODD(n) THEN t := p * t END ; + p := p*p; n := n DIV 2 + END ; + RETURN t + END Ten; + + PROCEDURE Scan* (VAR S: Scanner); + CONST maxExp = 38; maxM = 16777216; (*2^24*) + VAR ch, term: CHAR; + neg, negE, hex: BOOLEAN; + i, j, h, d, e, n, s: INTEGER; + k: LONGINT; + x: REAL; + BEGIN ch := S.nextCh; i := 0; + WHILE (ch = " ") OR (ch = TAB) OR (ch = CR) DO + IF ch = CR THEN INC(S.line) END ; + Read(S, ch) + END ; + IF ("A" <= ch) & (ch <= "Z") OR ("a" <= ch) & (ch <= "z") THEN (*name*) + REPEAT S.s[i] := ch; INC(i); Read(S, ch) + UNTIL ((ch < "0") & (ch # ".") OR ("9" < ch) & (ch < "A") OR ("Z" < ch) & (ch < "a") OR ("z" < ch)) OR (i = 31); + S.s[i] := 0X; S.len := i; S.class := Name + ELSIF ch = 22X THEN (*string*) + Read(S, ch); + WHILE (ch # 22X) & (ch >= " ") & (i # 31) DO S.s[i] := ch; INC(i); Read(S, ch) END; + S.s[i] := 0X; S.len := i+1; Read(S, ch); S.class := String + ELSE hex := FALSE; + IF ch = "-" THEN neg := TRUE; Read(S, ch) ELSE neg := FALSE END ; + IF ("0" <= ch) & (ch <= "9") THEN (*number*) + n := ORD(ch) - 30H; h := n; Read(S, ch); + WHILE ("0" <= ch) & (ch <= "9") OR ("A" <= ch) & (ch <= "F") DO + IF ch <= "9" THEN d := ORD(ch) - 30H ELSE d := ORD(ch) - 37H; hex := TRUE END ; + n := 10*n + d; h := 10H*h + d; Read(S, ch) + END ; + IF ch = "H" THEN (*hex integer*) Read(S, ch); S.i := h; S.class := Int (*neg?*) + ELSIF ch = "." THEN (*real number*) + Read(S, ch); x := 0.0; e := 0; j := 0; + WHILE ("0" <= ch) & (ch <= "9") DO (*fraction*) + h := 10*n + (ORD(ch) - 30H); + IF h < maxM THEN n := h; INC(j) END ; + Read(S, ch) + END ; + IF ch = "E" THEN (*scale factor*) + s := 0; Read(S, ch); + IF ch = "-" THEN negE := TRUE; Read(S, ch) + ELSE negE := FALSE; + IF ch = "+" THEN Read(S, ch) END + END ; + WHILE ("0" <= ch) & (ch <= "9") DO + s := s*10 + ORD(ch) - 30H; Read(S, ch) + END ; + IF negE THEN DEC(e, s) ELSE INC(e, s) END ; + END ; + (*x := FLT(n);*) + x := n; (* voc adaptation by noch *) + DEC(e, j); + IF e < 0 THEN + IF e >= -maxExp THEN x := x / Ten(-e) ELSE x := 0.0 END + ELSIF e > 0 THEN + IF e <= maxExp THEN x := Ten(e) * x ELSE x := 0.0 END + END ; + IF neg THEN S.x := -x ELSE S.x := x END ; + IF hex THEN S.class := 0 ELSE S.class := Real END + ELSE (*decimal integer*) + IF neg THEN S.i := -n ELSE S.i := n END; + IF hex THEN S.class := Inval ELSE S.class := Int END + END + ELSE (*spectal character*) S.class := Char; + IF neg THEN S.c := "-" ELSE S.c := ch; Read(S, ch) END + END + END ; + S.nextCh := ch + END Scan; + + (* --------------- Access: Writers (NW) ------------------ *) + + PROCEDURE OpenWriter* (VAR W: Writer); + BEGIN NEW(W.buf); + OpenBuf(W.buf); W.fnt := Fonts.Default; W.col := 15; W.voff := 0; + Files.Set(W.rider, Files.New(""), 0) + END OpenWriter; + + PROCEDURE SetFont* (VAR W: Writer; fnt: Fonts.Font); + BEGIN W.fnt := fnt + END SetFont; + + PROCEDURE SetColor* (VAR W: Writer; col: INTEGER); + BEGIN W.col := col + END SetColor; + + PROCEDURE SetOffset* (VAR W: Writer; voff: INTEGER); + BEGIN W.voff := voff + END SetOffset; + + PROCEDURE Write* (VAR W: Writer; ch: CHAR); + VAR p: Piece; + BEGIN + IF (W.buf.last.fnt # W.fnt) OR (W.buf.last.col # W.col) OR (W.buf.last.voff # W.voff) THEN + NEW(p); p.f := Files.Base(W.rider); p.off := Files.Pos(W.rider); p.len := 0; + p.fnt := W.fnt; p.col := W.col; p.voff:= W.voff; + p.next := NIL; W.buf.last.next := p; + p.prev := W.buf.last; W.buf.last := p + END; + Files.Write(W.rider, ch); + INC(W.buf.last.len); INC(W.buf.len) + END Write; + + PROCEDURE WriteLn* (VAR W: Writer); + BEGIN Write(W, CR) + END WriteLn; + + PROCEDURE WriteString* (VAR W: Writer; s: ARRAY OF CHAR); + VAR i: INTEGER; + BEGIN i := 0; + WHILE s[i] >= " " DO Write(W, s[i]); INC(i) END + END WriteString; + + PROCEDURE WriteInt* (VAR W: Writer; x, n: LONGINT); + VAR i: INTEGER; x0: LONGINT; + a: ARRAY 10 OF CHAR; + BEGIN + (*IF ROR(x, 31) = 1 THEN WriteString(W, " -2147483648") + ELSE*) i := 0; (* voc adaptation by noch *) + IF x < 0 THEN DEC(n); x0 := -x ELSE x0 := x END; + REPEAT + a[i] := CHR(x0 MOD 10 + 30H); x0 := x0 DIV 10; INC(i) + UNTIL x0 = 0; + WHILE n > i DO Write(W, " "); DEC(n) END; + IF x < 0 THEN Write(W, "-") END; + REPEAT DEC(i); Write(W, a[i]) UNTIL i = 0 + (*END*) + END WriteInt; + + PROCEDURE WriteHex* (VAR W: Writer; x: LONGINT); + VAR i: INTEGER; y: LONGINT; + a: ARRAY 10 OF CHAR; + BEGIN i := 0; Write(W, " "); + REPEAT y := x MOD 10H; + IF y < 10 THEN a[i] := CHR(y + 30H) ELSE a[i] := CHR(y + 37H) END; + x := x DIV 10H; INC(i) + UNTIL i = 8; + REPEAT DEC(i); Write(W, a[i]) UNTIL i = 0 + END WriteHex; +(* commented out because it's not necessary to compile OR compiler; -- noch + PROCEDURE WriteReal* (VAR W: Writer; x: REAL; n: INTEGER); + VAR e, i, m: INTEGER; x0: REAL; neg: BOOLEAN; + d: ARRAY 16 OF CHAR; + BEGIN + IF x = 0.0 THEN + WriteString(W, " 0.0"); i := 5; + WHILE i < n DO Write(W, " "); INC(i) END + ELSE + IF x < 0.0 THEN x := -x; neg := TRUE ELSE neg := FALSE END ; + x0 := x; UNPK(x0, e); + IF e = 255 THEN WriteString(W, " NaN") + ELSE + REPEAT Write(W, " "); DEC(n) UNTIL n <= 14; + IF neg THEN Write(W, "-") ELSE Write(W, " ") END ; + e := e * 77 DIV 256 - 6; + IF e >= 0 THEN x := x / Ten(e) ELSE x := x * Ten(-e) END ; + IF x >= 10.0E6 THEN x := 0.1*x; INC(e) END ; + m := FLOOR(x + 0.5); i := 0; + IF x >= 10.0E6 THEN x := 0.1*x; INC(e) END ; + REPEAT d[i] := CHR(m MOD 10 + 30H); m := m DIV 10; INC(i) UNTIL m = 0; + DEC(i); Write(W, d[i]); Write(W, "."); + IF i < n-6 THEN n := 0 ELSE n := 13-n END ; + WHILE i > n DO DEC(i); Write(W, d[i]) END ; + Write(W, "E"); INC(e, 6); + IF e < 0 THEN Write(W, "-"); e := -e ELSE Write(W, "+") END ; + Write(W, CHR(e DIV 10 + 30H)); Write(W, CHR(e MOD 10 + 30H)) + END + END + END WriteReal; + *) + PROCEDURE WriteRealFix* (VAR W: Writer; x: REAL; n, k: INTEGER); + VAR i, m: INTEGER; neg: BOOLEAN; + d: ARRAY 12 OF CHAR; + BEGIN + IF x = 0.0 THEN WriteString(W, " 0") + ELSE + IF x < 0.0 THEN x := -x; neg := TRUE ELSE neg := FALSE END ; + IF k > 7 THEN k := 7 END ; + x := Ten(k) * x; m := FLOOR(x + 0.5); + i := 0; + REPEAT d[i] := CHR(m MOD 10 + 30H); m := m DIV 10; INC(i) UNTIL m = 0; + REPEAT Write(W, " "); DEC(n) UNTIL n <= i+3; + IF neg THEN Write(W, "-"); DEC(n) ELSE Write(W, " ") END ; + WHILE i > k DO DEC(i); Write(W, d[i]) END ; + Write(W, "."); + WHILE k > i DO DEC(k); Write(W, "0") END ; + WHILE i > 0 DO DEC(i); Write(W, d[i]) END + END + END WriteRealFix; + + PROCEDURE WritePair(VAR W: Writer; ch: CHAR; x: LONGINT); + BEGIN Write(W, ch); + Write(W, CHR(x DIV 10 + 30H)); Write(W, CHR(x MOD 10 + 30H)) + END WritePair; + + PROCEDURE WriteClock* (VAR W: Writer; d: LONGINT); + BEGIN + WritePair(W, " ", d DIV 20000H MOD 20H); (*day*) + WritePair(W, ".", d DIV 400000H MOD 10H); (*month*) + WritePair(W, ".", d DIV 4000000H MOD 40H); (*year*) + WritePair(W, " ", d DIV 1000H MOD 20H); (*hour*) + WritePair(W, ":", d DIV 40H MOD 40H); (*min*) + WritePair(W, ":", d MOD 40H) (*sec*) + END WriteClock; + +BEGIN TrailerFile := Files.New("") +END CompatTexts. diff --git a/src/voc07R/Fonts.Mod b/src/voc07R/Fonts.Mod index 1798cfb6..15dabaf1 100644 --- a/src/voc07R/Fonts.Mod +++ b/src/voc07R/Fonts.Mod @@ -1,146 +1,146 @@ -MODULE Fonts; (*JG 18.11.90; PDR 8.6.12; NW 25.3.2013*) - IMPORT SYSTEM, Files := CompatFiles; - - TYPE INTEGER = LONGINT; (* voc adaptation by noch *) - BYTE = CHAR; - - CONST FontFileId = 0DBH; - - TYPE Font* = POINTER TO FontDesc; - FontDesc* = RECORD - name*: ARRAY 32 OF CHAR; - height*, minX*, maxX*, minY*, maxY*: INTEGER; - next*: Font; - T: ARRAY 128 OF INTEGER; - raster: ARRAY 2360 OF BYTE - END ; - - LargeFontDesc = RECORD (FontDesc) ext: ARRAY 2560 OF BYTE END ; - LargeFont = POINTER TO LargeFontDesc; - - (* raster sizes: Syntax8 1367, Syntax10 1628, Syntax12 1688, Syntax14 1843, Syntax14b 1983, - Syntax16 2271, Syntax20 3034, Syntac24 4274, Syntax24b 4302 *) - -VAR Default*, root*: Font; - -PROCEDURE GetPat*(fnt: Font; ch: CHAR; VAR dx, x, y, w, h, patadr: INTEGER); - VAR pa: INTEGER; dxb, xb, yb, wb, hb: BYTE; -BEGIN pa := fnt.T[ORD(ch) MOD 80H]; patadr := pa; - SYSTEM.GET(pa-3, dxb); SYSTEM.GET(pa-2, xb); SYSTEM.GET(pa-1, yb); SYSTEM.GET(pa, wb); SYSTEM.GET(pa+1, hb); - (*dx := dxb;*) - dx := ORD(dxb); (* voc adaptation by noch *) - (*x := xb;*) - x := ORD(xb); (* voc adaptation by noch *) - (*y := yb;*) - y := ORD(yb); (* voc adaptation by noch *) - (*w := wb;*) - w := ORD(wb); (* voc adaptation by noch *) - (*h := hb;*) - h := ORD(hb); (* voc adaptation by noch *) - (*IF yb < 128 THEN y := yb ELSE y := yb - 256 END*) - IF ORD(yb) < 128 THEN y := ORD(yb) ELSE y := ORD(yb) - 256 END (* voc adaptation by noch *) -END GetPat; - -PROCEDURE This*(name: ARRAY OF CHAR): Font; - - TYPE RunRec = RECORD beg, end: BYTE END ; - BoxRec = RECORD dx, x, y, w, h: BYTE END ; - - VAR F: Font; LF: LargeFont; - f: Files.File; R: Files.Rider; - NofRuns, NofBoxes: BYTE; - NofBytes: INTEGER; - height, minX, maxX, minY, maxY: BYTE; - i, j, k, m, n: INTEGER; - a, a0: INTEGER; - b, beg, end: BYTE; - run: ARRAY 16 OF RunRec; - box: ARRAY 512 OF BoxRec; - - PROCEDURE RdInt16(VAR R: Files.Rider; VAR b0: BYTE); - VAR b1: BYTE; - BEGIN Files.ReadByte(R, b0); Files.ReadByte(R, b1) - END RdInt16; - -BEGIN F := root; - WHILE (F # NIL) & (name # F.name) DO F := F.next END; - IF F = NIL THEN - f := Files.Old(name); - IF f # NIL THEN - Files.Set(R, f, 0); Files.ReadByte(R, b); - (*IF b = FontFileId THEN*) - IF ORD(b) = FontFileId THEN (* voc adaptation by noch *) - Files.ReadByte(R, b); (*abstraction*) - Files.ReadByte(R, b); (*family*) - Files.ReadByte(R, b); (*variant*) - NEW(F); - (*F.name := name;*) - COPY(name, F.name); (* voc adaptation by noch *) - RdInt16(R, height); RdInt16(R, minX); RdInt16(R, maxX); RdInt16(R, minY); RdInt16(R, maxY); RdInt16(R, NofRuns); - (*NofBoxes := 0;*) (* voc adaptation by noch *) - NofBoxes := 0X; - k := 0; - (*WHILE k # NofRuns DO*) - WHILE k # ORD(NofRuns) DO (* voc adaptation by noch *) - RdInt16(R, beg); - run[k].beg := beg; RdInt16(R, end); - run[k].end := end; - (*NofBoxes := NofBoxes + end - beg;*) - NofBoxes := CHR(ORD(NofBoxes) + ORD(end) - ORD(beg)); (* voc adaptation by noch *) - INC(k) - END; - NofBytes := 5; j := 0; - (*WHILE j # NofBoxes DO*) - WHILE j # ORD(NofBoxes) DO (* voc adaptation by noch *) - RdInt16(R, box[j].dx); RdInt16(R, box[j].x); RdInt16(R, box[j].y); - RdInt16(R, box[j].w); RdInt16(R, box[j].h); - (*NofBytes := NofBytes + 5 + (box[j].w + 7) DIV 8 * box[j].h;*) - NofBytes := (NofBytes + 5 + (ORD(box[j].w) + 7) DIV 8 * ORD(box[j].h)); (* voc adaptation by noch *) - INC(j) - END; - IF NofBytes < 2300 THEN NEW(F) ELSE NEW(LF); F := LF END ; - (*F.name := name;*) - COPY(name, F.name); (* voc adaptation by noch *) - (*F.height := height; F.minX := minX; F.maxX := maxX; F.maxY := maxY;*) - F.height := ORD(height); F.minX := ORD(minX); F.maxX := ORD(maxX); F.maxY := ORD(maxY); (* voc adaptation by noch *) - (*IF minY >= 80H THEN F.minY := minY - 100H ELSE F.minY := minY END ;*) - IF ORD(minY) >= 80H THEN F.minY := ORD(minY) - 100H ELSE F.minY := ORD(minY) END ; (* voc adaptation by noch *) - a0 := SYSTEM.ADR(F.raster); - SYSTEM.PUT(a0, 0X); SYSTEM.PUT(a0+1, 0X); SYSTEM.PUT(a0+2, 0X); SYSTEM.PUT(a0+3, 0X); SYSTEM.PUT(a0+4, 0X); - (*null pattern for characters not in a run*) - INC(a0, 2); a := a0+3; j := 0; k := 0; m := 0; - (*WHILE k < NofRuns DO*) - WHILE k < ORD(NofRuns) DO - (*WHILE (m < run[k].beg) & (m < 128) DO F.T[m] := a0; INC(m) END;*) - WHILE (m < ORD(run[k].beg)) & (m < 128) DO F.T[m] := a0; INC(m) END; (* voc adaptation by noch *) - (*WHILE (m < run[k].end) & (m < 128) DO*) (* voc adaptation by noch *) - WHILE (m < ORD(run[k].end)) & (m < 128) DO - F.T[m] := a+3; - SYSTEM.PUT(a, box[j].dx); SYSTEM.PUT(a+1, box[j].x); SYSTEM.PUT(a+2, box[j].y); - SYSTEM.PUT(a+3, box[j].w); SYSTEM.PUT(a+4, box[j].h); INC(a, 5); - (*n := (box[j].w + 7) DIV 8 * box[j].h;*) - n := (ORD(box[j].w) + 7) DIV 8 * ORD(box[j].h); (* voc adaptation by noch *) - WHILE n # 0 DO DEC(n); Files.ReadByte(R, b); SYSTEM.PUT(a, b); INC(a) END ; - INC(j); INC(m) - END; - INC(k) - END; - WHILE m < 128 DO F.T[m] := a0; INC(m) END ; - F.next := root; root := F - ELSE (*bad file id*) F := Default - END - ELSE (*font file not available*) F := Default - END - END; - RETURN F -END This; - -PROCEDURE Free*; (*remove all but first two from font list*) - VAR f: Font; -BEGIN f := root.next; - IF f # NIL THEN f := f.next END ; - f.next := NIL -END Free; - -BEGIN root := NIL; Default := This("Oberon10.Scn.Fnt") -END Fonts. +MODULE Fonts; (*JG 18.11.90; PDR 8.6.12; NW 25.3.2013*) + IMPORT SYSTEM, Files := CompatFiles; + + TYPE INTEGER = LONGINT; (* voc adaptation by noch *) + BYTE = CHAR; + + CONST FontFileId = 0DBH; + + TYPE Font* = POINTER TO FontDesc; + FontDesc* = RECORD + name*: ARRAY 32 OF CHAR; + height*, minX*, maxX*, minY*, maxY*: INTEGER; + next*: Font; + T: ARRAY 128 OF INTEGER; + raster: ARRAY 2360 OF BYTE + END ; + + LargeFontDesc = RECORD (FontDesc) ext: ARRAY 2560 OF BYTE END ; + LargeFont = POINTER TO LargeFontDesc; + + (* raster sizes: Syntax8 1367, Syntax10 1628, Syntax12 1688, Syntax14 1843, Syntax14b 1983, + Syntax16 2271, Syntax20 3034, Syntac24 4274, Syntax24b 4302 *) + +VAR Default*, root*: Font; + +PROCEDURE GetPat*(fnt: Font; ch: CHAR; VAR dx, x, y, w, h, patadr: INTEGER); + VAR pa: INTEGER; dxb, xb, yb, wb, hb: BYTE; +BEGIN pa := fnt.T[ORD(ch) MOD 80H]; patadr := pa; + SYSTEM.GET(pa-3, dxb); SYSTEM.GET(pa-2, xb); SYSTEM.GET(pa-1, yb); SYSTEM.GET(pa, wb); SYSTEM.GET(pa+1, hb); + (*dx := dxb;*) + dx := ORD(dxb); (* voc adaptation by noch *) + (*x := xb;*) + x := ORD(xb); (* voc adaptation by noch *) + (*y := yb;*) + y := ORD(yb); (* voc adaptation by noch *) + (*w := wb;*) + w := ORD(wb); (* voc adaptation by noch *) + (*h := hb;*) + h := ORD(hb); (* voc adaptation by noch *) + (*IF yb < 128 THEN y := yb ELSE y := yb - 256 END*) + IF ORD(yb) < 128 THEN y := ORD(yb) ELSE y := ORD(yb) - 256 END (* voc adaptation by noch *) +END GetPat; + +PROCEDURE This*(name: ARRAY OF CHAR): Font; + + TYPE RunRec = RECORD beg, end: BYTE END ; + BoxRec = RECORD dx, x, y, w, h: BYTE END ; + + VAR F: Font; LF: LargeFont; + f: Files.File; R: Files.Rider; + NofRuns, NofBoxes: BYTE; + NofBytes: INTEGER; + height, minX, maxX, minY, maxY: BYTE; + i, j, k, m, n: INTEGER; + a, a0: INTEGER; + b, beg, end: BYTE; + run: ARRAY 16 OF RunRec; + box: ARRAY 512 OF BoxRec; + + PROCEDURE RdInt16(VAR R: Files.Rider; VAR b0: BYTE); + VAR b1: BYTE; + BEGIN Files.ReadByte(R, b0); Files.ReadByte(R, b1) + END RdInt16; + +BEGIN F := root; + WHILE (F # NIL) & (name # F.name) DO F := F.next END; + IF F = NIL THEN + f := Files.Old(name); + IF f # NIL THEN + Files.Set(R, f, 0); Files.ReadByte(R, b); + (*IF b = FontFileId THEN*) + IF ORD(b) = FontFileId THEN (* voc adaptation by noch *) + Files.ReadByte(R, b); (*abstraction*) + Files.ReadByte(R, b); (*family*) + Files.ReadByte(R, b); (*variant*) + NEW(F); + (*F.name := name;*) + COPY(name, F.name); (* voc adaptation by noch *) + RdInt16(R, height); RdInt16(R, minX); RdInt16(R, maxX); RdInt16(R, minY); RdInt16(R, maxY); RdInt16(R, NofRuns); + (*NofBoxes := 0;*) (* voc adaptation by noch *) + NofBoxes := 0X; + k := 0; + (*WHILE k # NofRuns DO*) + WHILE k # ORD(NofRuns) DO (* voc adaptation by noch *) + RdInt16(R, beg); + run[k].beg := beg; RdInt16(R, end); + run[k].end := end; + (*NofBoxes := NofBoxes + end - beg;*) + NofBoxes := CHR(ORD(NofBoxes) + ORD(end) - ORD(beg)); (* voc adaptation by noch *) + INC(k) + END; + NofBytes := 5; j := 0; + (*WHILE j # NofBoxes DO*) + WHILE j # ORD(NofBoxes) DO (* voc adaptation by noch *) + RdInt16(R, box[j].dx); RdInt16(R, box[j].x); RdInt16(R, box[j].y); + RdInt16(R, box[j].w); RdInt16(R, box[j].h); + (*NofBytes := NofBytes + 5 + (box[j].w + 7) DIV 8 * box[j].h;*) + NofBytes := (NofBytes + 5 + (ORD(box[j].w) + 7) DIV 8 * ORD(box[j].h)); (* voc adaptation by noch *) + INC(j) + END; + IF NofBytes < 2300 THEN NEW(F) ELSE NEW(LF); F := LF END ; + (*F.name := name;*) + COPY(name, F.name); (* voc adaptation by noch *) + (*F.height := height; F.minX := minX; F.maxX := maxX; F.maxY := maxY;*) + F.height := ORD(height); F.minX := ORD(minX); F.maxX := ORD(maxX); F.maxY := ORD(maxY); (* voc adaptation by noch *) + (*IF minY >= 80H THEN F.minY := minY - 100H ELSE F.minY := minY END ;*) + IF ORD(minY) >= 80H THEN F.minY := ORD(minY) - 100H ELSE F.minY := ORD(minY) END ; (* voc adaptation by noch *) + a0 := SYSTEM.ADR(F.raster); + SYSTEM.PUT(a0, 0X); SYSTEM.PUT(a0+1, 0X); SYSTEM.PUT(a0+2, 0X); SYSTEM.PUT(a0+3, 0X); SYSTEM.PUT(a0+4, 0X); + (*null pattern for characters not in a run*) + INC(a0, 2); a := a0+3; j := 0; k := 0; m := 0; + (*WHILE k < NofRuns DO*) + WHILE k < ORD(NofRuns) DO + (*WHILE (m < run[k].beg) & (m < 128) DO F.T[m] := a0; INC(m) END;*) + WHILE (m < ORD(run[k].beg)) & (m < 128) DO F.T[m] := a0; INC(m) END; (* voc adaptation by noch *) + (*WHILE (m < run[k].end) & (m < 128) DO*) (* voc adaptation by noch *) + WHILE (m < ORD(run[k].end)) & (m < 128) DO + F.T[m] := a+3; + SYSTEM.PUT(a, box[j].dx); SYSTEM.PUT(a+1, box[j].x); SYSTEM.PUT(a+2, box[j].y); + SYSTEM.PUT(a+3, box[j].w); SYSTEM.PUT(a+4, box[j].h); INC(a, 5); + (*n := (box[j].w + 7) DIV 8 * box[j].h;*) + n := (ORD(box[j].w) + 7) DIV 8 * ORD(box[j].h); (* voc adaptation by noch *) + WHILE n # 0 DO DEC(n); Files.ReadByte(R, b); SYSTEM.PUT(a, b); INC(a) END ; + INC(j); INC(m) + END; + INC(k) + END; + WHILE m < 128 DO F.T[m] := a0; INC(m) END ; + F.next := root; root := F + ELSE (*bad file id*) F := Default + END + ELSE (*font file not available*) F := Default + END + END; + RETURN F +END This; + +PROCEDURE Free*; (*remove all but first two from font list*) + VAR f: Font; +BEGIN f := root.next; + IF f # NIL THEN f := f.next END ; + f.next := NIL +END Free; + +BEGIN root := NIL; Default := This("Oberon10.Scn.Fnt") +END Fonts. diff --git a/src/voc07R/ORB.Mod b/src/voc07R/ORB.Mod index 61d23f4f..3427bb2e 100644 --- a/src/voc07R/ORB.Mod +++ b/src/voc07R/ORB.Mod @@ -1,447 +1,447 @@ -MODULE ORB; (*NW 25.6.2014 in Oberon-07*) - IMPORT Files := CompatFiles (* voc adaptation by noch *) - , ORS; - (*Definition of data types Object and Type, which together form the data structure - called "symbol table". Contains procedures for creation of Objects, and for search: - NewObj, this, thisimport, thisfield (and OpenScope, CloseScope). - Handling of import and export, i.e. reading and writing of "symbol files" is done by procedures - Import and Export. This module contains the list of standard identifiers, with which - the symbol table (universe), and that of the pseudo-module SYSTEM are initialized. *) - - TYPE INTEGER = LONGINT; (* voc adaptation by noch *) - BYTE = CHAR; - - CONST versionkey* = 1; maxTypTab = 64; - (* class values*) Head* = 0; - Const* = 1; Var* = 2; Par* = 3; Fld* = 4; Typ* = 5; - SProc* = 6; SFunc* = 7; Mod* = 8; - - (* form values*) - Byte* = 1; Bool* = 2; Char* = 3; Int* = 4; Real* = 5; Set* = 6; - Pointer* = 7; NilTyp* = 8; NoTyp* = 9; Proc* = 10; - String* = 11; Array* = 12; Record* = 13; - - TYPE Object* = POINTER TO ObjDesc; - Module* = POINTER TO ModDesc; - Type* = POINTER TO TypeDesc; - - ObjDesc*= RECORD - class*, lev*, exno*: INTEGER; - expo*, rdo*: BOOLEAN; (*exported / read-only*) - next*, dsc*: Object; - type*: Type; - name*: ORS.Ident; - val*: LONGINT - END ; - - ModDesc* = RECORD (ObjDesc) orgname*: ORS.Ident END ; - - TypeDesc* = RECORD - form*, ref*, mno*: INTEGER; (*ref is only used for import/export*) - nofpar*: INTEGER; (*for procedures, extension level for records*) - len*: LONGINT; (*for arrays, len < 0 => open array; for records: adr of descriptor*) - dsc*, typobj*: Object; - base*: Type; (*for arrays, records, pointers*) - size*: LONGINT; (*in bytes; always multiple of 4, except for Byte, Bool and Char*) - END ; - - (* Object classes and the meaning of "val": - class val - ---------- - Var address - Par address - Const value - Fld offset - Typ type descriptor (TD) address - SProc inline code number - SFunc inline code number - Mod key - - Type forms and the meaning of "dsc" and "base": - form dsc base - ------------------------ - Pointer - type of dereferenced object - Proc params result type - Array - type of elements - Record fields extension *) - - VAR topScope*, universe, system*: Object; - byteType*, boolType*, charType*: Type; - intType*, realType*, setType*, nilType*, noType*, strType*: Type; - nofmod, Ref: INTEGER; - typtab: ARRAY maxTypTab OF Type; - - PROCEDURE NewObj*(VAR obj: Object; id: ORS.Ident; class: INTEGER); (*insert new Object with name id*) - VAR new, x: Object; - BEGIN x := topScope; - WHILE (x.next # NIL) & (x.next.name # id) DO x := x.next END ; - IF x.next = NIL THEN - NEW(new); new.name := id; new.class := class; new.next := NIL; new.rdo := FALSE; new.dsc := NIL; - x.next := new; obj := new - ELSE obj := x.next; ORS.Mark("mult def") - END - END NewObj; - - PROCEDURE thisObj*(): Object; - VAR s, x: Object; - BEGIN s := topScope; - REPEAT x := s.next; - WHILE (x # NIL) & (x.name # ORS.id) DO x := x.next END ; - s := s.dsc - UNTIL (x # NIL) OR (s = NIL); - RETURN x - END thisObj; - - PROCEDURE thisimport*(mod: Object): Object; - VAR obj: Object; - BEGIN - IF mod.rdo THEN - IF mod.name[0] # 0X THEN - obj := mod.dsc; - WHILE (obj # NIL) & (obj.name # ORS.id) DO obj := obj.next END - ELSE obj := NIL - END - ELSE obj := NIL - END ; - RETURN obj - END thisimport; - - PROCEDURE thisfield*(rec: Type): Object; - VAR fld: Object; - BEGIN fld := rec.dsc; - WHILE (fld # NIL) & (fld.name # ORS.id) DO fld := fld.next END ; - RETURN fld - END thisfield; - - PROCEDURE OpenScope*; - VAR s: Object; - BEGIN NEW(s); s.class := Head; s.dsc := topScope; s.next := NIL; topScope := s - END OpenScope; - - PROCEDURE CloseScope*; - BEGIN topScope := topScope.dsc - END CloseScope; - - (*------------------------------- Import ---------------------------------*) - - PROCEDURE MakeFileName*(VAR FName: ORS.Ident; name, ext: ARRAY OF CHAR); - VAR i, j: INTEGER; - BEGIN i := 0; j := 0; (*assume name suffix less than 4 characters*) - WHILE (i < ORS.IdLen-5) & (name[i] > 0X) DO FName[i] := name[i]; INC(i) END ; - REPEAT FName[i]:= ext[j]; INC(i); INC(j) UNTIL ext[j] = 0X; - FName[i] := 0X - END MakeFileName; - - PROCEDURE ThisModule(name, orgname: ORS.Ident; non: BOOLEAN; key: LONGINT): Object; - VAR mod: Module; obj, obj1: Object; - BEGIN obj1 := topScope; obj := obj1.next; (*search for module*) - WHILE (obj # NIL) & (obj.name # name) DO obj1 := obj; obj := obj1.next END ; - IF obj = NIL THEN (*insert new module*) - NEW(mod); mod.class := Mod; mod.rdo := FALSE; - mod.name := name; mod.orgname := orgname; mod.val := key; - mod.lev := nofmod; INC(nofmod); mod.type := noType; mod.dsc := NIL; mod.next := NIL; - obj1.next := mod; obj := mod - ELSE (*module already present*) - IF non THEN ORS.Mark("invalid import order") END - END ; - RETURN obj - END ThisModule; - - PROCEDURE Read(VAR R: Files.Rider; VAR x: INTEGER); - VAR b: BYTE; - BEGIN Files.ReadByte(R, b); - (*IF b < 80H THEN x := b ELSE x := b - 100H END*) - IF b < 80X THEN x := ORD(b) ELSE x := ORD(b) - 100H END (* voc adaptation by noch *) - END Read; - - PROCEDURE InType(VAR R: Files.Rider; thismod: Object; VAR T: Type); - VAR key: LONGINT; - ref, class, mno, form, np, readonly: INTEGER; - new, fld, par, obj, mod, impmod: Object; - t: Type; - name, modname: ORS.Ident; - BEGIN Read(R, ref); - IF ref < 0 THEN T := typtab[-ref] (*already read*) - ELSE NEW(t); T := t; typtab[ref] := t; t.mno := thismod.lev; - Read(R, form); t.form := form; - IF form = Pointer THEN InType(R, thismod, t.base); t.size := 4 - ELSIF form = Array THEN - InType(R, thismod, t.base); Files.ReadNum(R, t.len); Files.ReadNum(R, t.size) - ELSIF form = Record THEN - InType(R, thismod, t.base); - IF t.base.form = NoTyp THEN t.base := NIL; obj := NIL ELSE obj := t.base.dsc END ; - Files.ReadNum(R, t.len); (*TD adr/exno*) - Files.ReadNum(R, t.nofpar); (*ext level*) - Files.ReadNum(R, t.size); - Read(R, class); - WHILE class # 0 DO (*fields*) - NEW(fld); fld.class := class; Files.ReadString(R, fld.name); - IF fld.name[0] # 0X THEN fld.expo := TRUE; InType(R, thismod, fld.type) ELSE fld.expo := FALSE; fld.type := nilType END ; - Files.ReadNum(R, fld.val); fld.next := obj; obj := fld; Read(R, class) - END ; - t.dsc := obj - ELSIF form = Proc THEN - InType(R, thismod, t.base); - obj := NIL; np := 0; Read(R, class); - WHILE class # 0 DO (*parameters*) - NEW(par); par.class := class; Read(R, readonly); par.rdo := readonly = 1; - InType(R, thismod, par.type); par.next := obj; obj := par; INC(np); Read(R, class) - END ; - t.dsc := obj; t.nofpar := np; t.size := 4 - END ; - Files.ReadString(R, modname); - IF modname[0] # 0X THEN (*re-import*) - Files.ReadInt(R, key); Files.ReadString(R, name); - mod := ThisModule(modname, modname, FALSE, key); - obj := mod.dsc; (*search type*) - WHILE (obj # NIL) & (obj.name # name) DO obj := obj.next END ; - IF obj # NIL THEN T := obj.type (*type object found in object list of mod*) - ELSE (*insert new type object in object list of mod*) - NEW(obj); obj.name := name; obj.class := Typ; obj.next := mod.dsc; mod.dsc := obj; obj.type := t; - t.mno := mod.lev; t.typobj := obj; T := t - END ; - typtab[ref] := T - END - END - END InType; - - PROCEDURE Import*(VAR modid, modid1: ORS.Ident); - VAR key: LONGINT; class, k: INTEGER; - obj: Object; t: Type; - thismod: Object; - modname, fname: ORS.Ident; - F: Files.File; R: Files.Rider; - BEGIN - IF modid1 = "SYSTEM" THEN - thismod := ThisModule(modid, modid1, TRUE, key); DEC(nofmod); - thismod.lev := 0; thismod.dsc := system; thismod.rdo := TRUE - ELSE MakeFileName(fname, modid1, ".smb"); F := Files.Old(fname); - IF F # NIL THEN - Files.Set(R, F, 0); Files.ReadInt(R, key); Files.ReadInt(R, key); Files.ReadString(R, modname); - thismod := ThisModule(modid, modid1, TRUE, key); thismod.rdo := TRUE; - Read(R, class); (*version key*) - IF class # versionkey THEN ORS.Mark("wrong version") END ; - Read(R, class); - WHILE class # 0 DO - NEW(obj); obj.class := class; Files.ReadString(R, obj.name); - InType(R, thismod, obj.type); obj.lev := -thismod.lev; - IF class = Typ THEN - t := obj.type; t.typobj := obj; Read(R, k); (*fixup bases of previously declared pointer types*) - WHILE k # 0 DO typtab[k].base := t; Read(R, k) END - ELSE - IF class = Const THEN - IF obj.type.form = Real THEN Files.ReadInt(R, obj.val) ELSE Files.ReadNum(R, obj.val) END - ELSIF class = Var THEN Files.ReadNum(R, obj.val); obj.rdo := TRUE - END - END ; - obj.next := thismod.dsc; thismod.dsc := obj; Read(R, class) - END ; - ELSE ORS.Mark("import not available") - END - END - END Import; - - (*-------------------------------- Export ---------------------------------*) - - PROCEDURE Write(VAR R: Files.Rider; x: INTEGER); - BEGIN - (*Files.WriteByte(R, x)*) - Files.WriteByte(R, SHORT(SHORT(x))) (* voc adaptation by noch *) - END Write; - - PROCEDURE OutType(VAR R: Files.Rider; t: Type); - VAR obj, mod, fld: Object; - - PROCEDURE OutPar(VAR R: Files.Rider; par: Object; n: INTEGER); - VAR cl: INTEGER; - BEGIN - IF n > 0 THEN - OutPar(R, par.next, n-1); cl := par.class; - Write(R, cl); - IF par.rdo THEN Write(R, 1) ELSE Write(R, 0) END ; - OutType(R, par.type) - END - END OutPar; - - PROCEDURE FindHiddenPointers(VAR R: Files.Rider; typ: Type; offset: LONGINT); - VAR fld: Object; i, n: LONGINT; - BEGIN - IF (typ.form = Pointer) OR (typ.form = NilTyp) THEN Write(R, Fld); Write(R, 0); Files.WriteNum(R, offset) - ELSIF typ.form = Record THEN fld := typ.dsc; - WHILE fld # NIL DO FindHiddenPointers(R, fld.type, fld.val + offset); fld := fld.next END - ELSIF typ.form = Array THEN i := 0; n := typ.len; - WHILE i < n DO FindHiddenPointers(R, typ.base, typ.base.size * i + offset); INC(i) END - END - END FindHiddenPointers; - - BEGIN - IF t.ref > 0 THEN (*type was already output*) Write(R, -t.ref) - ELSE obj := t.typobj; - IF obj # NIL THEN Write(R, Ref); t.ref := Ref; INC(Ref) ELSE (*anonymous*) Write(R, 0) END ; - Write(R, t.form); - IF t.form = Pointer THEN OutType(R, t.base) - ELSIF t.form = Array THEN OutType(R, t.base); Files.WriteNum(R, t.len); Files.WriteNum(R, t.size) - ELSIF t.form = Record THEN - IF t.base # NIL THEN OutType(R, t.base) ELSE OutType(R, noType) END ; - IF obj # NIL THEN Files.WriteNum(R, obj.exno) ELSE Write(R, 0) END ; - Files.WriteNum(R, t.nofpar); Files.WriteNum(R, t.size); - fld := t.dsc; - WHILE fld # NIL DO (*fields*) - IF fld.expo THEN - Write(R, Fld); Files.WriteString(R, fld.name); OutType(R, fld.type); Files.WriteNum(R, fld.val) - ELSE FindHiddenPointers(R, fld.type, fld.val) (*offset*) - END ; - fld := fld.next - END ; - Write(R, 0) - ELSIF t.form = Proc THEN OutType(R, t.base); OutPar(R, t.dsc, t.nofpar); Write(R, 0) - END ; - IF (t.mno > 0) & (obj # NIL) THEN (*re-export, output name*) - mod := topScope.next; - WHILE (mod # NIL) & (mod.lev # t.mno) DO mod := mod.next END ; - IF mod # NIL THEN Files.WriteString(R, mod.name); Files.WriteInt(R, mod.val); Files.WriteString(R, obj.name) - ELSE ORS.Mark("re-export not found"); Write(R, 0) - END - ELSE Write(R, 0) - END - END - END OutType; - - PROCEDURE Export*(VAR modid: ORS.Ident; VAR newSF: BOOLEAN; VAR key: LONGINT); - VAR x, sum, oldkey: LONGINT; - obj, obj0: Object; - filename: ORS.Ident; - F, F1: Files.File; R, R1: Files.Rider; - BEGIN Ref := Record + 1; MakeFileName(filename, modid, ".smb"); - F := Files.New(filename); Files.Set(R, F, 0); - Files.WriteInt(R, 0); (*placeholder*) - Files.WriteInt(R, 0); (*placeholder for key to be inserted at the end*) - Files.WriteString(R, modid); Write(R, versionkey); - obj := topScope.next; - WHILE obj # NIL DO - IF obj.expo THEN - Write(R, obj.class); Files.WriteString(R, obj.name); - OutType(R, obj.type); - IF obj.class = Typ THEN - IF obj.type.form = Record THEN - obj0 := topScope.next; (*check whether this is base of previously declared pointer types*) - WHILE obj0 # obj DO - IF (obj0.type.form = Pointer) & (obj0.type.base = obj.type) & (obj0.type.ref > 0) THEN Write(R, obj0.type.ref) END ; - obj0 := obj0.next - END - END ; - Write(R, 0) - ELSIF obj.class = Const THEN - IF obj.type.form = Proc THEN Files.WriteNum(R, obj.exno) - ELSIF obj.type.form = Real THEN Files.WriteInt(R, obj.val) - ELSE Files.WriteNum(R, obj.val) - END - ELSIF obj.class = Var THEN - Files.WriteNum(R, obj.exno); - IF obj.type.form = String THEN - Files.WriteNum(R, obj.val DIV 10000H); obj.val := obj.val MOD 10000H - END - END - END ; - obj := obj.next - END ; - REPEAT Write(R, 0) UNTIL Files.Length(F) MOD 4 = 0; - FOR Ref := Record+1 TO maxTypTab-1 DO typtab[Ref] := NIL END ; - Files.Set(R, F, 0); sum := 0; Files.ReadInt(R, x); (* compute key (checksum) *) - WHILE ~R.eof DO sum := sum + x; Files.ReadInt(R, x) END ; - F1 := Files.Old(filename); (*sum is new key*) - IF F1 # NIL THEN Files.Set(R1, F1, 4); Files.ReadInt(R1, oldkey) ELSE oldkey := sum+1 END ; - IF sum # oldkey THEN - IF newSF OR (F1 = NIL) THEN - key := sum; newSF := TRUE; Files.Set(R, F, 4); Files.WriteInt(R, sum); Files.Register(F) (*insert checksum*) - ELSE ORS.Mark("new symbol file inhibited") - END - ELSE newSF := FALSE; key := sum - END - END Export; - - PROCEDURE Init*; - BEGIN topScope := universe; nofmod := 1 - END Init; - - PROCEDURE type(ref, form: INTEGER; size: LONGINT): Type; - VAR tp: Type; - BEGIN NEW(tp); tp.form := form; tp.size := size; tp.ref := ref; tp.base := NIL; - typtab[ref] := tp; RETURN tp - END type; - - PROCEDURE enter(name: ARRAY OF CHAR; cl: INTEGER; type: Type; n: LONGINT); - VAR obj: Object; - BEGIN - NEW(obj); - (*obj.name := name; *) - COPY(name, obj.name); (* voc adaptation by noch *) - obj.class := cl; - obj.type := type; - obj.val := n; - obj.dsc := NIL; - IF cl = Typ THEN type.typobj := obj END ; - obj.next := system; system := obj - END enter; - -BEGIN - byteType := type(Byte, Int, 1); - boolType := type(Bool, Bool, 1); - charType := type(Char, Char,1); - intType := type(Int, Int, 4); - realType := type(Real, Real, 4); - setType := type(Set, Set,4); - nilType := type(NilTyp, NilTyp, 4); - noType := type(NoTyp, NoTyp, 4); - strType := type(String, String, 8); - - (*initialize universe with data types and in-line procedures; - LONGINT is synonym to INTEGER, LONGREAL to REAL. - LED, ADC, SBC; LDPSR, LDREG, REG, COND are not in language definition*) - system := NIL; (*n = procno*10 + nofpar*) - enter("UML", SFunc, intType, 132); (*functions*) - enter("SBC", SFunc, intType, 122); - enter("ADC", SFunc, intType, 112); - enter("ROR", SFunc, intType, 92); - enter("ASR", SFunc, intType, 82); - enter("LSL", SFunc, intType, 72); - enter("LEN", SFunc, intType, 61); - enter("CHR", SFunc, charType, 51); - enter("ORD", SFunc, intType, 41); - enter("FLT", SFunc, realType, 31); - enter("FLOOR", SFunc, intType, 21); - enter("ODD", SFunc, boolType, 11); - enter("ABS", SFunc, intType, 1); - enter("LED", SProc, noType, 81); (*procedures*) - enter("UNPK", SProc, noType, 72); - enter("PACK", SProc, noType, 62); - enter("NEW", SProc, noType, 51); - enter("ASSERT", SProc, noType, 41); - enter("EXCL", SProc, noType, 32); - enter("INCL", SProc, noType, 22); - enter("DEC", SProc, noType, 11); - enter("INC", SProc, noType, 1); - enter("SET", Typ, setType, 0); (*types*) - enter("BOOLEAN", Typ, boolType, 0); - enter("BYTE", Typ, byteType, 0); - enter("CHAR", Typ, charType, 0); - enter("LONGREAL", Typ, realType, 0); - enter("REAL", Typ, realType, 0); - enter("LONGINT", Typ, intType, 0); - enter("INTEGER", Typ, intType, 0); - topScope := NIL; OpenScope; topScope.next := system; universe := topScope; - - system := NIL; (* initialize "unsafe" pseudo-module SYSTEM*) - enter("H", SFunc, intType, 201); (*functions*) - enter("COND", SFunc, boolType, 191); - enter("SIZE", SFunc, intType, 181); - enter("ADR", SFunc, intType, 171); - enter("VAL", SFunc, intType, 162); - enter("REG", SFunc, intType, 151); - enter("BIT", SFunc, boolType, 142); - enter("LDREG", SProc, noType, 142); (*procedures*) - enter("LDPSR", SProc, noType, 131); - enter("COPY", SProc, noType, 123); - enter("PUT", SProc, noType, 112); - enter("GET", SProc, noType, 102); -END ORB. +MODULE ORB; (*NW 25.6.2014 in Oberon-07*) + IMPORT Files := CompatFiles (* voc adaptation by noch *) + , ORS; + (*Definition of data types Object and Type, which together form the data structure + called "symbol table". Contains procedures for creation of Objects, and for search: + NewObj, this, thisimport, thisfield (and OpenScope, CloseScope). + Handling of import and export, i.e. reading and writing of "symbol files" is done by procedures + Import and Export. This module contains the list of standard identifiers, with which + the symbol table (universe), and that of the pseudo-module SYSTEM are initialized. *) + + TYPE INTEGER = LONGINT; (* voc adaptation by noch *) + BYTE = CHAR; + + CONST versionkey* = 1; maxTypTab = 64; + (* class values*) Head* = 0; + Const* = 1; Var* = 2; Par* = 3; Fld* = 4; Typ* = 5; + SProc* = 6; SFunc* = 7; Mod* = 8; + + (* form values*) + Byte* = 1; Bool* = 2; Char* = 3; Int* = 4; Real* = 5; Set* = 6; + Pointer* = 7; NilTyp* = 8; NoTyp* = 9; Proc* = 10; + String* = 11; Array* = 12; Record* = 13; + + TYPE Object* = POINTER TO ObjDesc; + Module* = POINTER TO ModDesc; + Type* = POINTER TO TypeDesc; + + ObjDesc*= RECORD + class*, lev*, exno*: INTEGER; + expo*, rdo*: BOOLEAN; (*exported / read-only*) + next*, dsc*: Object; + type*: Type; + name*: ORS.Ident; + val*: LONGINT + END ; + + ModDesc* = RECORD (ObjDesc) orgname*: ORS.Ident END ; + + TypeDesc* = RECORD + form*, ref*, mno*: INTEGER; (*ref is only used for import/export*) + nofpar*: INTEGER; (*for procedures, extension level for records*) + len*: LONGINT; (*for arrays, len < 0 => open array; for records: adr of descriptor*) + dsc*, typobj*: Object; + base*: Type; (*for arrays, records, pointers*) + size*: LONGINT; (*in bytes; always multiple of 4, except for Byte, Bool and Char*) + END ; + + (* Object classes and the meaning of "val": + class val + ---------- + Var address + Par address + Const value + Fld offset + Typ type descriptor (TD) address + SProc inline code number + SFunc inline code number + Mod key + + Type forms and the meaning of "dsc" and "base": + form dsc base + ------------------------ + Pointer - type of dereferenced object + Proc params result type + Array - type of elements + Record fields extension *) + + VAR topScope*, universe, system*: Object; + byteType*, boolType*, charType*: Type; + intType*, realType*, setType*, nilType*, noType*, strType*: Type; + nofmod, Ref: INTEGER; + typtab: ARRAY maxTypTab OF Type; + + PROCEDURE NewObj*(VAR obj: Object; id: ORS.Ident; class: INTEGER); (*insert new Object with name id*) + VAR new, x: Object; + BEGIN x := topScope; + WHILE (x.next # NIL) & (x.next.name # id) DO x := x.next END ; + IF x.next = NIL THEN + NEW(new); new.name := id; new.class := class; new.next := NIL; new.rdo := FALSE; new.dsc := NIL; + x.next := new; obj := new + ELSE obj := x.next; ORS.Mark("mult def") + END + END NewObj; + + PROCEDURE thisObj*(): Object; + VAR s, x: Object; + BEGIN s := topScope; + REPEAT x := s.next; + WHILE (x # NIL) & (x.name # ORS.id) DO x := x.next END ; + s := s.dsc + UNTIL (x # NIL) OR (s = NIL); + RETURN x + END thisObj; + + PROCEDURE thisimport*(mod: Object): Object; + VAR obj: Object; + BEGIN + IF mod.rdo THEN + IF mod.name[0] # 0X THEN + obj := mod.dsc; + WHILE (obj # NIL) & (obj.name # ORS.id) DO obj := obj.next END + ELSE obj := NIL + END + ELSE obj := NIL + END ; + RETURN obj + END thisimport; + + PROCEDURE thisfield*(rec: Type): Object; + VAR fld: Object; + BEGIN fld := rec.dsc; + WHILE (fld # NIL) & (fld.name # ORS.id) DO fld := fld.next END ; + RETURN fld + END thisfield; + + PROCEDURE OpenScope*; + VAR s: Object; + BEGIN NEW(s); s.class := Head; s.dsc := topScope; s.next := NIL; topScope := s + END OpenScope; + + PROCEDURE CloseScope*; + BEGIN topScope := topScope.dsc + END CloseScope; + + (*------------------------------- Import ---------------------------------*) + + PROCEDURE MakeFileName*(VAR FName: ORS.Ident; name, ext: ARRAY OF CHAR); + VAR i, j: INTEGER; + BEGIN i := 0; j := 0; (*assume name suffix less than 4 characters*) + WHILE (i < ORS.IdLen-5) & (name[i] > 0X) DO FName[i] := name[i]; INC(i) END ; + REPEAT FName[i]:= ext[j]; INC(i); INC(j) UNTIL ext[j] = 0X; + FName[i] := 0X + END MakeFileName; + + PROCEDURE ThisModule(name, orgname: ORS.Ident; non: BOOLEAN; key: LONGINT): Object; + VAR mod: Module; obj, obj1: Object; + BEGIN obj1 := topScope; obj := obj1.next; (*search for module*) + WHILE (obj # NIL) & (obj.name # name) DO obj1 := obj; obj := obj1.next END ; + IF obj = NIL THEN (*insert new module*) + NEW(mod); mod.class := Mod; mod.rdo := FALSE; + mod.name := name; mod.orgname := orgname; mod.val := key; + mod.lev := nofmod; INC(nofmod); mod.type := noType; mod.dsc := NIL; mod.next := NIL; + obj1.next := mod; obj := mod + ELSE (*module already present*) + IF non THEN ORS.Mark("invalid import order") END + END ; + RETURN obj + END ThisModule; + + PROCEDURE Read(VAR R: Files.Rider; VAR x: INTEGER); + VAR b: BYTE; + BEGIN Files.ReadByte(R, b); + (*IF b < 80H THEN x := b ELSE x := b - 100H END*) + IF b < 80X THEN x := ORD(b) ELSE x := ORD(b) - 100H END (* voc adaptation by noch *) + END Read; + + PROCEDURE InType(VAR R: Files.Rider; thismod: Object; VAR T: Type); + VAR key: LONGINT; + ref, class, mno, form, np, readonly: INTEGER; + new, fld, par, obj, mod, impmod: Object; + t: Type; + name, modname: ORS.Ident; + BEGIN Read(R, ref); + IF ref < 0 THEN T := typtab[-ref] (*already read*) + ELSE NEW(t); T := t; typtab[ref] := t; t.mno := thismod.lev; + Read(R, form); t.form := form; + IF form = Pointer THEN InType(R, thismod, t.base); t.size := 4 + ELSIF form = Array THEN + InType(R, thismod, t.base); Files.ReadNum(R, t.len); Files.ReadNum(R, t.size) + ELSIF form = Record THEN + InType(R, thismod, t.base); + IF t.base.form = NoTyp THEN t.base := NIL; obj := NIL ELSE obj := t.base.dsc END ; + Files.ReadNum(R, t.len); (*TD adr/exno*) + Files.ReadNum(R, t.nofpar); (*ext level*) + Files.ReadNum(R, t.size); + Read(R, class); + WHILE class # 0 DO (*fields*) + NEW(fld); fld.class := class; Files.ReadString(R, fld.name); + IF fld.name[0] # 0X THEN fld.expo := TRUE; InType(R, thismod, fld.type) ELSE fld.expo := FALSE; fld.type := nilType END ; + Files.ReadNum(R, fld.val); fld.next := obj; obj := fld; Read(R, class) + END ; + t.dsc := obj + ELSIF form = Proc THEN + InType(R, thismod, t.base); + obj := NIL; np := 0; Read(R, class); + WHILE class # 0 DO (*parameters*) + NEW(par); par.class := class; Read(R, readonly); par.rdo := readonly = 1; + InType(R, thismod, par.type); par.next := obj; obj := par; INC(np); Read(R, class) + END ; + t.dsc := obj; t.nofpar := np; t.size := 4 + END ; + Files.ReadString(R, modname); + IF modname[0] # 0X THEN (*re-import*) + Files.ReadInt(R, key); Files.ReadString(R, name); + mod := ThisModule(modname, modname, FALSE, key); + obj := mod.dsc; (*search type*) + WHILE (obj # NIL) & (obj.name # name) DO obj := obj.next END ; + IF obj # NIL THEN T := obj.type (*type object found in object list of mod*) + ELSE (*insert new type object in object list of mod*) + NEW(obj); obj.name := name; obj.class := Typ; obj.next := mod.dsc; mod.dsc := obj; obj.type := t; + t.mno := mod.lev; t.typobj := obj; T := t + END ; + typtab[ref] := T + END + END + END InType; + + PROCEDURE Import*(VAR modid, modid1: ORS.Ident); + VAR key: LONGINT; class, k: INTEGER; + obj: Object; t: Type; + thismod: Object; + modname, fname: ORS.Ident; + F: Files.File; R: Files.Rider; + BEGIN + IF modid1 = "SYSTEM" THEN + thismod := ThisModule(modid, modid1, TRUE, key); DEC(nofmod); + thismod.lev := 0; thismod.dsc := system; thismod.rdo := TRUE + ELSE MakeFileName(fname, modid1, ".smb"); F := Files.Old(fname); + IF F # NIL THEN + Files.Set(R, F, 0); Files.ReadInt(R, key); Files.ReadInt(R, key); Files.ReadString(R, modname); + thismod := ThisModule(modid, modid1, TRUE, key); thismod.rdo := TRUE; + Read(R, class); (*version key*) + IF class # versionkey THEN ORS.Mark("wrong version") END ; + Read(R, class); + WHILE class # 0 DO + NEW(obj); obj.class := class; Files.ReadString(R, obj.name); + InType(R, thismod, obj.type); obj.lev := -thismod.lev; + IF class = Typ THEN + t := obj.type; t.typobj := obj; Read(R, k); (*fixup bases of previously declared pointer types*) + WHILE k # 0 DO typtab[k].base := t; Read(R, k) END + ELSE + IF class = Const THEN + IF obj.type.form = Real THEN Files.ReadInt(R, obj.val) ELSE Files.ReadNum(R, obj.val) END + ELSIF class = Var THEN Files.ReadNum(R, obj.val); obj.rdo := TRUE + END + END ; + obj.next := thismod.dsc; thismod.dsc := obj; Read(R, class) + END ; + ELSE ORS.Mark("import not available") + END + END + END Import; + + (*-------------------------------- Export ---------------------------------*) + + PROCEDURE Write(VAR R: Files.Rider; x: INTEGER); + BEGIN + (*Files.WriteByte(R, x)*) + Files.WriteByte(R, SHORT(SHORT(x))) (* voc adaptation by noch *) + END Write; + + PROCEDURE OutType(VAR R: Files.Rider; t: Type); + VAR obj, mod, fld: Object; + + PROCEDURE OutPar(VAR R: Files.Rider; par: Object; n: INTEGER); + VAR cl: INTEGER; + BEGIN + IF n > 0 THEN + OutPar(R, par.next, n-1); cl := par.class; + Write(R, cl); + IF par.rdo THEN Write(R, 1) ELSE Write(R, 0) END ; + OutType(R, par.type) + END + END OutPar; + + PROCEDURE FindHiddenPointers(VAR R: Files.Rider; typ: Type; offset: LONGINT); + VAR fld: Object; i, n: LONGINT; + BEGIN + IF (typ.form = Pointer) OR (typ.form = NilTyp) THEN Write(R, Fld); Write(R, 0); Files.WriteNum(R, offset) + ELSIF typ.form = Record THEN fld := typ.dsc; + WHILE fld # NIL DO FindHiddenPointers(R, fld.type, fld.val + offset); fld := fld.next END + ELSIF typ.form = Array THEN i := 0; n := typ.len; + WHILE i < n DO FindHiddenPointers(R, typ.base, typ.base.size * i + offset); INC(i) END + END + END FindHiddenPointers; + + BEGIN + IF t.ref > 0 THEN (*type was already output*) Write(R, -t.ref) + ELSE obj := t.typobj; + IF obj # NIL THEN Write(R, Ref); t.ref := Ref; INC(Ref) ELSE (*anonymous*) Write(R, 0) END ; + Write(R, t.form); + IF t.form = Pointer THEN OutType(R, t.base) + ELSIF t.form = Array THEN OutType(R, t.base); Files.WriteNum(R, t.len); Files.WriteNum(R, t.size) + ELSIF t.form = Record THEN + IF t.base # NIL THEN OutType(R, t.base) ELSE OutType(R, noType) END ; + IF obj # NIL THEN Files.WriteNum(R, obj.exno) ELSE Write(R, 0) END ; + Files.WriteNum(R, t.nofpar); Files.WriteNum(R, t.size); + fld := t.dsc; + WHILE fld # NIL DO (*fields*) + IF fld.expo THEN + Write(R, Fld); Files.WriteString(R, fld.name); OutType(R, fld.type); Files.WriteNum(R, fld.val) + ELSE FindHiddenPointers(R, fld.type, fld.val) (*offset*) + END ; + fld := fld.next + END ; + Write(R, 0) + ELSIF t.form = Proc THEN OutType(R, t.base); OutPar(R, t.dsc, t.nofpar); Write(R, 0) + END ; + IF (t.mno > 0) & (obj # NIL) THEN (*re-export, output name*) + mod := topScope.next; + WHILE (mod # NIL) & (mod.lev # t.mno) DO mod := mod.next END ; + IF mod # NIL THEN Files.WriteString(R, mod.name); Files.WriteInt(R, mod.val); Files.WriteString(R, obj.name) + ELSE ORS.Mark("re-export not found"); Write(R, 0) + END + ELSE Write(R, 0) + END + END + END OutType; + + PROCEDURE Export*(VAR modid: ORS.Ident; VAR newSF: BOOLEAN; VAR key: LONGINT); + VAR x, sum, oldkey: LONGINT; + obj, obj0: Object; + filename: ORS.Ident; + F, F1: Files.File; R, R1: Files.Rider; + BEGIN Ref := Record + 1; MakeFileName(filename, modid, ".smb"); + F := Files.New(filename); Files.Set(R, F, 0); + Files.WriteInt(R, 0); (*placeholder*) + Files.WriteInt(R, 0); (*placeholder for key to be inserted at the end*) + Files.WriteString(R, modid); Write(R, versionkey); + obj := topScope.next; + WHILE obj # NIL DO + IF obj.expo THEN + Write(R, obj.class); Files.WriteString(R, obj.name); + OutType(R, obj.type); + IF obj.class = Typ THEN + IF obj.type.form = Record THEN + obj0 := topScope.next; (*check whether this is base of previously declared pointer types*) + WHILE obj0 # obj DO + IF (obj0.type.form = Pointer) & (obj0.type.base = obj.type) & (obj0.type.ref > 0) THEN Write(R, obj0.type.ref) END ; + obj0 := obj0.next + END + END ; + Write(R, 0) + ELSIF obj.class = Const THEN + IF obj.type.form = Proc THEN Files.WriteNum(R, obj.exno) + ELSIF obj.type.form = Real THEN Files.WriteInt(R, obj.val) + ELSE Files.WriteNum(R, obj.val) + END + ELSIF obj.class = Var THEN + Files.WriteNum(R, obj.exno); + IF obj.type.form = String THEN + Files.WriteNum(R, obj.val DIV 10000H); obj.val := obj.val MOD 10000H + END + END + END ; + obj := obj.next + END ; + REPEAT Write(R, 0) UNTIL Files.Length(F) MOD 4 = 0; + FOR Ref := Record+1 TO maxTypTab-1 DO typtab[Ref] := NIL END ; + Files.Set(R, F, 0); sum := 0; Files.ReadInt(R, x); (* compute key (checksum) *) + WHILE ~R.eof DO sum := sum + x; Files.ReadInt(R, x) END ; + F1 := Files.Old(filename); (*sum is new key*) + IF F1 # NIL THEN Files.Set(R1, F1, 4); Files.ReadInt(R1, oldkey) ELSE oldkey := sum+1 END ; + IF sum # oldkey THEN + IF newSF OR (F1 = NIL) THEN + key := sum; newSF := TRUE; Files.Set(R, F, 4); Files.WriteInt(R, sum); Files.Register(F) (*insert checksum*) + ELSE ORS.Mark("new symbol file inhibited") + END + ELSE newSF := FALSE; key := sum + END + END Export; + + PROCEDURE Init*; + BEGIN topScope := universe; nofmod := 1 + END Init; + + PROCEDURE type(ref, form: INTEGER; size: LONGINT): Type; + VAR tp: Type; + BEGIN NEW(tp); tp.form := form; tp.size := size; tp.ref := ref; tp.base := NIL; + typtab[ref] := tp; RETURN tp + END type; + + PROCEDURE enter(name: ARRAY OF CHAR; cl: INTEGER; type: Type; n: LONGINT); + VAR obj: Object; + BEGIN + NEW(obj); + (*obj.name := name; *) + COPY(name, obj.name); (* voc adaptation by noch *) + obj.class := cl; + obj.type := type; + obj.val := n; + obj.dsc := NIL; + IF cl = Typ THEN type.typobj := obj END ; + obj.next := system; system := obj + END enter; + +BEGIN + byteType := type(Byte, Int, 1); + boolType := type(Bool, Bool, 1); + charType := type(Char, Char,1); + intType := type(Int, Int, 4); + realType := type(Real, Real, 4); + setType := type(Set, Set,4); + nilType := type(NilTyp, NilTyp, 4); + noType := type(NoTyp, NoTyp, 4); + strType := type(String, String, 8); + + (*initialize universe with data types and in-line procedures; + LONGINT is synonym to INTEGER, LONGREAL to REAL. + LED, ADC, SBC; LDPSR, LDREG, REG, COND are not in language definition*) + system := NIL; (*n = procno*10 + nofpar*) + enter("UML", SFunc, intType, 132); (*functions*) + enter("SBC", SFunc, intType, 122); + enter("ADC", SFunc, intType, 112); + enter("ROR", SFunc, intType, 92); + enter("ASR", SFunc, intType, 82); + enter("LSL", SFunc, intType, 72); + enter("LEN", SFunc, intType, 61); + enter("CHR", SFunc, charType, 51); + enter("ORD", SFunc, intType, 41); + enter("FLT", SFunc, realType, 31); + enter("FLOOR", SFunc, intType, 21); + enter("ODD", SFunc, boolType, 11); + enter("ABS", SFunc, intType, 1); + enter("LED", SProc, noType, 81); (*procedures*) + enter("UNPK", SProc, noType, 72); + enter("PACK", SProc, noType, 62); + enter("NEW", SProc, noType, 51); + enter("ASSERT", SProc, noType, 41); + enter("EXCL", SProc, noType, 32); + enter("INCL", SProc, noType, 22); + enter("DEC", SProc, noType, 11); + enter("INC", SProc, noType, 1); + enter("SET", Typ, setType, 0); (*types*) + enter("BOOLEAN", Typ, boolType, 0); + enter("BYTE", Typ, byteType, 0); + enter("CHAR", Typ, charType, 0); + enter("LONGREAL", Typ, realType, 0); + enter("REAL", Typ, realType, 0); + enter("LONGINT", Typ, intType, 0); + enter("INTEGER", Typ, intType, 0); + topScope := NIL; OpenScope; topScope.next := system; universe := topScope; + + system := NIL; (* initialize "unsafe" pseudo-module SYSTEM*) + enter("H", SFunc, intType, 201); (*functions*) + enter("COND", SFunc, boolType, 191); + enter("SIZE", SFunc, intType, 181); + enter("ADR", SFunc, intType, 171); + enter("VAL", SFunc, intType, 162); + enter("REG", SFunc, intType, 151); + enter("BIT", SFunc, boolType, 142); + enter("LDREG", SProc, noType, 142); (*procedures*) + enter("LDPSR", SProc, noType, 131); + enter("COPY", SProc, noType, 123); + enter("PUT", SProc, noType, 112); + enter("GET", SProc, noType, 102); +END ORB. diff --git a/src/voc07R/ORG.Mod b/src/voc07R/ORG.Mod index 9495337c..fef42932 100644 --- a/src/voc07R/ORG.Mod +++ b/src/voc07R/ORG.Mod @@ -1,1134 +1,1134 @@ -MODULE ORG; (* NW 24.6.2014 code generator in Oberon-07 for RISC*) - IMPORT SYSTEM, Files := CompatFiles, ORS, ORB; - (*Code generator for Oberon compiler for RISC processor. - Procedural interface to Parser OSAP; result in array "code". - Procedure Close writes code-files*) - - (* voc adaptation by noch *) - TYPE INTEGER = LONGINT; - BYTE = CHAR; - - CONST WordSize* = 4; - StkOrg0 = -64; VarOrg0 = 0; (*for RISC-0 only*) - MT = 12; SB = 13; SP = 14; LNK = 15; (*dedicated registers*) - maxCode = 8000; maxStrx = 2400; maxTD = 120; C24 = 1000000H; - Reg = 10; RegI = 11; Cond = 12; (*internal item modes*) - - (*frequently used opcodes*) U = 2000H; V = 1000H; - Mov = 0; Lsl = 1; Asr = 2; Ror= 3; And = 4; Ann = 5; Ior = 6; Xor = 7; - Add = 8; Sub = 9; Cmp = 9; Mul = 10; Div = 11; - Fad = 12; Fsb = 13; Fml = 14; Fdv = 15; - Ldr = 8; Str = 10; - BR = 0; BLR = 1; BC = 2; BL = 3; - MI = 0; PL = 8; EQ = 1; NE = 9; LT = 5; GE = 13; LE = 6; GT = 14; - - TYPE Item* = RECORD - mode*: INTEGER; - type*: ORB.Type; - a*, b*, r: LONGINT; - rdo*: BOOLEAN (*read only*) - END ; - - (* Item forms and meaning of fields: - mode r a b - -------------------------------- - Const - value (proc adr) (immediate value) - Var base off - (direct adr) - Par - off0 off1 (indirect adr) - Reg regno - RegI regno off - - Cond cond Fchain Tchain *) - - VAR pc*, varsize: LONGINT; (*program counter, data index*) - tdx, strx: LONGINT; - entry: LONGINT; (*main entry point*) - RH: LONGINT; (*available registers R[0] ... R[H-1]*) - curSB: LONGINT; (*current static base in SB*) - frame: LONGINT; (*frame offset changed in SaveRegs and RestoreRegs*) - fixorgP, fixorgD, fixorgT: LONGINT; (*origins of lists of locations to be fixed up by loader*) - check: BOOLEAN; (*emit run-time checks*) - version: INTEGER; (* 0 = RISC-0, 1 = RISC-5 *) - - relmap: ARRAY 6 OF INTEGER; (*condition codes for relations*) - code: ARRAY maxCode OF LONGINT; - data: ARRAY maxTD OF LONGINT; (*type descriptors*) - str: ARRAY maxStrx OF CHAR; - - (* voc adaptation by noch *) - PROCEDURE LSL (x, n : INTEGER): INTEGER; - - BEGIN - - RETURN ASH(x, n); - END LSL; - - - (*instruction assemblers according to formats*) - - PROCEDURE Put0(op, a, b, c: LONGINT); - BEGIN (*emit format-0 instruction*) - code[pc] := ((a*10H + b) * 10H + op) * 10000H + c; INC(pc) - END Put0; - - PROCEDURE Put1(op, a, b, im: LONGINT); - BEGIN (*emit format-1 instruction, -10000H <= im < 10000H*) - IF im < 0 THEN INC(op, V) END ; - code[pc] := (((a+40H) * 10H + b) * 10H + op) * 10000H + (im MOD 10000H); INC(pc) - END Put1; - - PROCEDURE Put1a(op, a, b, im: LONGINT); - BEGIN (*same as Pu1, but with range test -10000H <= im < 10000H*) - IF (im >= -10000H) & (im <= 0FFFFH) THEN Put1(op, a, b, im) - ELSE Put1(Mov+U, RH, 0, im DIV 10000H); - IF im MOD 10000H # 0 THEN Put1(Ior, RH, RH, im MOD 10000H) END ; - Put0(op, a, b, RH) - END - END Put1a; - - PROCEDURE Put2(op, a, b, off: LONGINT); - BEGIN (*emit load/store instruction*) - code[pc] := ((op * 10H + a) * 10H + b) * 100000H + (off MOD 100000H); INC(pc) - END Put2; - - PROCEDURE Put3(op, cond, off: LONGINT); - BEGIN (*emit branch instruction*) - code[pc] := ((op+12) * 10H + cond) * 1000000H + (off MOD 1000000H); INC(pc) - END Put3; - - PROCEDURE incR; - BEGIN - IF RH < MT-1 THEN INC(RH) ELSE ORS.Mark("register stack overflow") END - END incR; - - PROCEDURE CheckRegs*; - BEGIN - IF RH # 0 THEN ORS.Mark("Reg Stack"); RH := 0 END ; - IF pc >= maxCode - 40 THEN ORS.Mark("Program too long") END - END CheckRegs; - - PROCEDURE SetCC(VAR x: Item; n: LONGINT); - BEGIN x.mode := Cond; x.a := 0; x.b := 0; x.r := n - END SetCC; - - PROCEDURE Trap(cond, num: LONGINT); - BEGIN num := ORS.Pos()*100H + num*10H + MT; Put3(BLR, cond, num) - END Trap; - - (*handling of forward reference, fixups of branch addresses and constant tables*) - - PROCEDURE negated(cond: LONGINT): LONGINT; - BEGIN - IF cond < 8 THEN cond := cond+8 ELSE cond := cond-8 END ; - RETURN cond - END negated; - - PROCEDURE invalSB; - BEGIN curSB := 1 - END invalSB; - - PROCEDURE fix(at, with: LONGINT); - BEGIN code[at] := code[at] DIV C24 * C24 + (with MOD C24) - END fix; - - PROCEDURE FixLink*(L: LONGINT); - VAR L1: LONGINT; - BEGIN invalSB; - WHILE L # 0 DO L1 := code[L] MOD 40000H; fix(L, pc-L-1); L := L1 END - END FixLink; - - PROCEDURE FixLinkWith(L0, dst: LONGINT); - VAR L1: LONGINT; - BEGIN - WHILE L0 # 0 DO - L1 := code[L0] MOD C24; - code[L0] := code[L0] DIV C24 * C24 + ((dst - L0 - 1) MOD C24); L0 := L1 - END - END FixLinkWith; - - PROCEDURE merged(L0, L1: LONGINT): LONGINT; - VAR L2, L3: LONGINT; - BEGIN - IF L0 # 0 THEN L3 := L0; - REPEAT L2 := L3; L3 := code[L2] MOD 40000H UNTIL L3 = 0; - code[L2] := code[L2] + L1; L1 := L0 - END ; - RETURN L1 - END merged; - - (* loading of operands and addresses into registers *) - - PROCEDURE GetSB(base: LONGINT); - BEGIN - IF (version # 0) & ((base # curSB) OR (base # 0)) THEN - Put2(Ldr, SB, -base, pc-fixorgD); fixorgD := pc-1; curSB := base - END - END GetSB; - - PROCEDURE NilCheck; - BEGIN IF check THEN Trap(EQ, 4) END - END NilCheck; - - PROCEDURE load(VAR x: Item); - VAR op: LONGINT; - BEGIN - IF x.type.size = 1 THEN op := Ldr+1 ELSE op := Ldr END ; - IF x.mode # Reg THEN - IF x.mode = ORB.Const THEN - IF x.type.form = ORB.Proc THEN - IF x.r > 0 THEN ORS.Mark("not allowed") - ELSIF x.r = 0 THEN Put3(BL, 7, 0); Put1a(Sub, RH, LNK, pc*4 - x.a) - ELSE GetSB(x.r); Put1(Add, RH, SB, x.a + 100H) (*mark as progbase-relative*) - END - ELSIF (x.a <= 0FFFFH) & (x.a >= -10000H) THEN Put1(Mov, RH, 0, x.a) - ELSE Put1(Mov+U, RH, 0, x.a DIV 10000H MOD 10000H); - IF x.a MOD 10000H # 0 THEN Put1(Ior, RH, RH, x.a MOD 10000H) END - END ; - x.r := RH; incR - ELSIF x.mode = ORB.Var THEN - IF x.r > 0 THEN (*local*) Put2(op, RH, SP, x.a + frame) - ELSE GetSB(x.r); Put2(op, RH, SB, x.a) - END ; - x.r := RH; incR - ELSIF x.mode = ORB.Par THEN Put2(Ldr, RH, SP, x.a + frame); Put2(op, RH, RH, x.b); x.r := RH; incR - ELSIF x.mode = RegI THEN Put2(op, x.r, x.r, x.a) - ELSIF x.mode = Cond THEN - Put3(BC, negated(x.r), 2); - FixLink(x.b); Put1(Mov, RH, 0, 1); Put3(BC, 7, 1); - FixLink(x.a); Put1(Mov, RH, 0, 0); x.r := RH; incR - END ; - x.mode := Reg - END - END load; - - PROCEDURE loadAdr(VAR x: Item); - BEGIN - IF x.mode = ORB.Var THEN - IF x.r > 0 THEN (*local*) Put1a(Add, RH, SP, x.a + frame) - ELSE GetSB(x.r); Put1a(Add, RH, SB, x.a) - END ; - x.r := RH; incR - ELSIF x.mode = ORB.Par THEN Put2(Ldr, RH, SP, x.a + frame); - IF x.b # 0 THEN Put1a(Add, RH, RH, x.b) END ; - x.r := RH; incR - ELSIF x.mode = RegI THEN - IF x.a # 0 THEN Put1a(Add, x.r, x.r, x.a) END - ELSE ORS.Mark("address error") - END ; - x.mode := Reg - END loadAdr; - - PROCEDURE loadCond(VAR x: Item); - BEGIN - IF x.type.form = ORB.Bool THEN - IF x.mode = ORB.Const THEN x.r := 15 - x.a*8 - ELSE load(x); - IF code[pc-1] DIV 40000000H # -2 THEN Put1(Cmp, x.r, x.r, 0) END ; - x.r := NE; DEC(RH) - END ; - x.mode := Cond; x.a := 0; x.b := 0 - ELSE ORS.Mark("not Boolean?") - END - END loadCond; - - PROCEDURE loadTypTagAdr(T: ORB.Type); - VAR x: Item; - BEGIN x.mode := ORB.Var; x.a := T.len; x.r := -T.mno; loadAdr(x) - END loadTypTagAdr; - - PROCEDURE loadStringAdr(VAR x: Item); - BEGIN GetSB(0); Put1a(Add, RH, SB, varsize+x.a); x.mode := Reg; x.r := RH; incR - END loadStringAdr; - - (* Items: Conversion from constants or from Objects on the Heap to Items on the Stack*) - - PROCEDURE MakeConstItem*(VAR x: Item; typ: ORB.Type; val: LONGINT); - BEGIN x.mode := ORB.Const; x.type := typ; x.a := val - END MakeConstItem; - - PROCEDURE MakeRealItem*(VAR x: Item; val: REAL); - BEGIN x.mode := ORB.Const; x.type := ORB.realType; x.a := SYSTEM.VAL(LONGINT, val) - END MakeRealItem; - - PROCEDURE MakeStringItem*(VAR x: Item; len: LONGINT); (*copies string from ORS-buffer to ORG-string array*) - VAR i: LONGINT; - BEGIN x.mode := ORB.Const; x.type := ORB.strType; x.a := strx; x.b := len; i := 0; - IF strx + len + 4 < maxStrx THEN - WHILE len > 0 DO str[strx] := ORS.str[i]; INC(strx); INC(i); DEC(len) END ; - WHILE strx MOD 4 # 0 DO str[strx] := 0X; INC(strx) END - ELSE ORS.Mark("too many strings") - END - END MakeStringItem; - - PROCEDURE MakeItem*(VAR x: Item; y: ORB.Object; curlev: LONGINT); - BEGIN x.mode := y.class; x.type := y.type; x.a := y.val; x.rdo := y.rdo; - IF y.class = ORB.Par THEN x.b := 0 - ELSIF y.class = ORB.Typ THEN x.a := y.type.len; x.r := -y.lev - ELSIF (y.class = ORB.Const) & (y.type.form = ORB.String) THEN x.b := y.lev (*len*) - ELSE x.r := y.lev - END ; - IF (y.lev > 0) & (y.lev # curlev) & (y.class # ORB.Const) THEN ORS.Mark("level error, not accessible") END - END MakeItem; - - (* Code generation for Selectors, Variables, Constants *) - - PROCEDURE Field*(VAR x: Item; y: ORB.Object); (* x := x.y *) - BEGIN; - IF x.mode = ORB.Var THEN - IF x.r >= 0 THEN x.a := x.a + y.val - ELSE loadAdr(x); x.mode := RegI; x.a := y.val - END - ELSIF x.mode = RegI THEN x.a := x.a + y.val - ELSIF x.mode = ORB.Par THEN x.b := x.b + y.val - END - END Field; - - PROCEDURE Index*(VAR x, y: Item); (* x := x[y] *) - VAR s, lim: LONGINT; - BEGIN s := x.type.base.size; lim := x.type.len; - IF (y.mode = ORB.Const) & (lim >= 0) THEN - IF (y.a < 0) OR (y.a >= lim) THEN ORS.Mark("bad index") END ; - IF x.mode IN {ORB.Var, RegI} THEN x.a := y.a * s + x.a - ELSIF x.mode = ORB.Par THEN x.b := y.a * s + x.b - END - ELSE load(y); - IF check THEN (*check array bounds*) - IF lim >= 0 THEN Put1a(Cmp, RH, y.r, lim) - ELSE (*open array*) - IF x.mode IN {ORB.Var, ORB.Par} THEN Put2(Ldr, RH, SP, x.a+4+frame); Put0(Cmp, RH, y.r, RH) - ELSE ORS.Mark("error in Index") - END - END ; - Trap(10, 1) (*BCC*) - END ; - IF s = 4 THEN Put1(Lsl, y.r, y.r, 2) ELSIF s > 1 THEN Put1a(Mul, y.r, y.r, s) END ; - IF x.mode = ORB.Var THEN - IF x.r > 0 THEN Put0(Add, y.r, SP, y.r); INC(x.a, frame) - ELSE GetSB(x.r); - IF x.r = 0 THEN Put0(Add, y.r, SB, y.r) - ELSE Put1a(Add, RH, SB, x.a); Put0(Add, y.r, RH, y.r); x.a := 0 - END - END ; - x.r := y.r; x.mode := RegI - ELSIF x.mode = ORB.Par THEN - Put2(Ldr, RH, SP, x.a + frame); - Put0(Add, y.r, RH, y.r); x.mode := RegI; x.r := y.r; x.a := x.b - ELSIF x.mode = RegI THEN Put0(Add, x.r, x.r, y.r); DEC(RH) - END - END - END Index; - - PROCEDURE DeRef*(VAR x: Item); - BEGIN - IF x.mode = ORB.Var THEN - IF x.r > 0 THEN (*local*) Put2(Ldr, RH, SP, x.a + frame) ELSE GetSB(x.r); Put2(Ldr, RH, SB, x.a) END ; - NilCheck; x.r := RH; incR - ELSIF x.mode = ORB.Par THEN - Put2(Ldr, RH, SP, x.a + frame); Put2(Ldr, RH, RH, x.b); NilCheck; x.r := RH; incR - ELSIF x.mode = RegI THEN Put2(Ldr, x.r, x.r, x.a); NilCheck - ELSIF x.mode # Reg THEN ORS.Mark("bad mode in DeRef") - END ; - x.mode := RegI; x.a := 0; x.b := 0 - END DeRef; - - PROCEDURE Q(T: ORB.Type; VAR dcw: LONGINT); - BEGIN (*one entry of type descriptor extension table*) - IF T.base # NIL THEN - Q(T.base, dcw); data[dcw] := (T.mno*1000H + T.len) * 1000H + dcw - fixorgT; - fixorgT := dcw; INC(dcw) - END - END Q; - - PROCEDURE FindPtrFlds(typ: ORB.Type; off: LONGINT; VAR dcw: LONGINT); - VAR fld: ORB.Object; i, s: LONGINT; - BEGIN - IF (typ.form = ORB.Pointer) OR (typ.form = ORB.NilTyp) THEN data[dcw] := off; INC(dcw) - ELSIF typ.form = ORB.Record THEN - fld := typ.dsc; - WHILE fld # NIL DO FindPtrFlds(fld.type, fld.val + off, dcw); fld := fld.next END - ELSIF typ.form = ORB.Array THEN - s := typ.base.size; - FOR i := 0 TO typ.len-1 DO FindPtrFlds(typ.base, i*s + off, dcw) END - END - END FindPtrFlds; - - PROCEDURE BuildTD*(T: ORB.Type; VAR dc: LONGINT); - VAR dcw, k, s: LONGINT; (*dcw = word address*) - BEGIN dcw := dc DIV 4; s := T.size; (*convert size for heap allocation*) - IF s <= 24 THEN s := 32 ELSIF s <= 56 THEN s := 64 ELSIF s <= 120 THEN s := 128 - ELSE s := (s+263) DIV 256 * 256 - END ; - T.len := dc; data[dcw] := s; INC(dcw); - k := T.nofpar; (*extension level!*) - IF k > 3 THEN ORS.Mark("ext level too large") - ELSE Q(T, dcw); - WHILE k < 3 DO data[dcw] := -1; INC(dcw); INC(k) END - END ; - FindPtrFlds(T, 0, dcw); data[dcw] := -1; INC(dcw); tdx := dcw; dc := dcw*4; - IF tdx >= maxTD THEN ORS.Mark("too many record types"); tdx := 0 END - END BuildTD; - - PROCEDURE TypeTest*(VAR x: Item; T: ORB.Type; varpar, isguard: BOOLEAN); - VAR pc0: LONGINT; - BEGIN (*fetch tag into RH*) - IF varpar THEN Put2(Ldr, RH, SP, x.a+4+frame) - ELSE load(x); - pc0 := pc; Put3(BC, EQ, 0); (*NIL belongs to every pointer type*) - Put2(Ldr, RH, x.r, -8) - END ; - Put2(Ldr, RH, RH, T.nofpar*4); incR; - loadTypTagAdr(T); (*tag of T*) - Put0(Cmp, RH-1, RH-1, RH-2); DEC(RH, 2); - IF ~varpar THEN fix(pc0, pc - pc0 - 1) END ; - IF isguard THEN - IF check THEN Trap(NE, 2) END - ELSE SetCC(x, EQ); - IF ~varpar THEN DEC(RH) END - END - END TypeTest; - - (* Code generation for Boolean operators *) - - PROCEDURE Not*(VAR x: Item); (* x := ~x *) - VAR t: LONGINT; - BEGIN - IF x.mode # Cond THEN loadCond(x) END ; - x.r := negated(x.r); t := x.a; x.a := x.b; x.b := t - END Not; - - PROCEDURE And1*(VAR x: Item); (* x := x & *) - BEGIN - IF x.mode # Cond THEN loadCond(x) END ; - Put3(BC, negated(x.r), x.a); x.a := pc-1; FixLink(x.b); x.b := 0 - END And1; - - PROCEDURE And2*(VAR x, y: Item); - BEGIN - IF y.mode # Cond THEN loadCond(y) END ; - x.a := merged(y.a, x.a); x.b := y.b; x.r := y.r - END And2; - - PROCEDURE Or1*(VAR x: Item); (* x := x OR *) - BEGIN - IF x.mode # Cond THEN loadCond(x) END ; - Put3(BC, x.r, x.b); x.b := pc-1; FixLink(x.a); x.a := 0 - END Or1; - - PROCEDURE Or2*(VAR x, y: Item); - BEGIN - IF y.mode # Cond THEN loadCond(y) END ; - x.a := y.a; x.b := merged(y.b, x.b); x.r := y.r - END Or2; - - (* Code generation for arithmetic operators *) - - PROCEDURE Neg*(VAR x: Item); (* x := -x *) - BEGIN - IF x.type.form = ORB.Int THEN - IF x.mode = ORB.Const THEN x.a := -x.a - ELSE load(x); Put1(Mov, RH, 0, 0); Put0(Sub, x.r, RH, x.r) - END - ELSIF x.type.form = ORB.Real THEN - IF x.mode = ORB.Const THEN x.a := x.a + 7FFFFFFFH + 1 - ELSE load(x); Put1(Mov, RH, 0, 0); Put0(Fsb, x.r, RH, x.r) - END - ELSE (*form = Set*) - IF x.mode = ORB.Const THEN x.a := -x.a-1 - ELSE load(x); Put1(Xor, x.r, x.r, -1) - END - END - END Neg; - - PROCEDURE AddOp*(op: LONGINT; VAR x, y: Item); (* x := x +- y *) - BEGIN - IF op = ORS.plus THEN - IF (x.mode = ORB.Const) & (y.mode = ORB.Const) THEN x.a := x.a + y.a - ELSIF y.mode = ORB.Const THEN load(x); - IF y.a # 0 THEN Put1a(Add, x.r, x.r, y.a) END - ELSE load(x); load(y); Put0(Add, RH-2, x.r, y.r); DEC(RH); x.r := RH-1 - END - ELSE (*op = ORS.minus*) - IF (x.mode = ORB.Const) & (y.mode = ORB.Const) THEN x.a := x.a - y.a - ELSIF y.mode = ORB.Const THEN load(x); - IF y.a # 0 THEN Put1a(Sub, x.r, x.r, y.a) END - ELSE load(x); load(y); Put0(Sub, RH-2, x.r, y.r); DEC(RH); x.r := RH-1 - END - END - END AddOp; - - PROCEDURE log2(m: LONGINT; VAR e: LONGINT): LONGINT; - BEGIN e := 0; - WHILE ~ODD(m) DO m := m DIV 2; INC(e) END ; - RETURN m - END log2; - - PROCEDURE MulOp*(VAR x, y: Item); (* x := x * y *) - VAR e: LONGINT; - BEGIN - IF (x.mode = ORB.Const) & (y.mode = ORB.Const) THEN x.a := x.a * y.a - ELSIF (y.mode = ORB.Const) & (y.a >= 2) & (log2(y.a, e) = 1) THEN load(x); Put1(Lsl, x.r, x.r, e) - ELSIF y.mode = ORB.Const THEN load(x); Put1a(Mul, x.r, x.r, y.a) - ELSIF (x.mode = ORB.Const) & (x.a >= 2) & (log2(x.a, e) = 1) THEN load(y); Put1(Lsl, y.r, y.r, e); x.mode := Reg; x.r := y.r - ELSIF x.mode = ORB.Const THEN load(y); Put1a(Mul, y.r, y.r, x.a); x.mode := Reg; x.r := y.r - ELSE load(x); load(y); Put0(Mul, RH-2, x.r, y.r); DEC(RH); x.r := RH-1 - END - END MulOp; - - PROCEDURE DivOp*(op: LONGINT; VAR x, y: Item); (* x := x op y *) - VAR e: LONGINT; - BEGIN - IF op = ORS.div THEN - IF (x.mode = ORB.Const) & (y.mode = ORB.Const) THEN - IF y.a > 0 THEN x.a := x.a DIV y.a ELSE ORS.Mark("bad divisor") END - ELSIF (y.mode = ORB.Const) & (y.a >= 2) & (log2(y.a, e) = 1) THEN load(x); Put1(Asr, x.r, x.r, e) - ELSIF y.mode = ORB.Const THEN - IF y.a > 0 THEN load(x); Put1a(Div, x.r, x.r, y.a) ELSE ORS.Mark("bad divisor") END - ELSE load(y); - IF check THEN Trap(LE, 6) END ; - load(x); Put0(Div, RH-2, x.r, y.r); DEC(RH); x.r := RH-1 - END - ELSE (*op = ORS.mod*) - IF (x.mode = ORB.Const) & (y.mode = ORB.Const) THEN - IF y.a > 0 THEN x.a := x.a MOD y.a ELSE ORS.Mark("bad modulus") END - ELSIF (y.mode = ORB.Const) & (y.a >= 2) & (log2(y.a, e) = 1) THEN load(x); - IF e <= 16 THEN Put1(And, x.r, x.r, y.a-1) ELSE Put1(Lsl, x.r, x.r, 32-e); Put1(Ror, x.r, x.r, 32-e) END - ELSIF y.mode = ORB.Const THEN - IF y.a > 0 THEN load(x); Put1a(Div, x.r, x.r, y.a); Put0(Mov+U, x.r, 0, 0) ELSE ORS.Mark("bad modulus") END - ELSE load(y); - IF check THEN Trap(LE, 6) END ; - load(x); Put0(Div, RH-2, x.r, y.r); Put0(Mov+U, RH-2, 0, 0); DEC(RH); x.r := RH-1 - END - END - END DivOp; - - (* Code generation for REAL operators *) - - PROCEDURE RealOp*(op: INTEGER; VAR x, y: Item); (* x := x op y *) - BEGIN load(x); load(y); - IF op = ORS.plus THEN Put0(Fad, RH-2, x.r, y.r) - ELSIF op = ORS.minus THEN Put0(Fsb, RH-2, x.r, y.r) - ELSIF op = ORS.times THEN Put0(Fml, RH-2, x.r, y.r) - ELSIF op = ORS.rdiv THEN Put0(Fdv, RH-2, x.r, y.r) - END ; - DEC(RH); x.r := RH-1 - END RealOp; - - (* Code generation for set operators *) - - PROCEDURE Singleton*(VAR x: Item); (* x := {x} *) - BEGIN - IF x.mode = ORB.Const THEN - x.a := LSL(1, x.a) - ELSE load(x); Put1(Mov, RH, 0, 1); Put0(Lsl, x.r, RH, x.r) - END - END Singleton; - - PROCEDURE Set*(VAR x, y: Item); (* x := {x .. y} *) - BEGIN - IF (x.mode = ORB.Const) & ( y.mode = ORB.Const) THEN - IF x.a <= y.a THEN x.a := LSL(2, y.a) - LSL(1, x.a) ELSE x.a := 0 END - ELSE - IF (x.mode = ORB.Const) & (x.a < 16) THEN x.a := LSL(-1, x.a) - ELSE load(x); Put1(Mov, RH, 0, -1); Put0(Lsl, x.r, RH, x.r) - END ; - IF (y.mode = ORB.Const) & (y.a < 16) THEN Put1(Mov, RH, 0, LSL(-2, y.a)); y.mode := Reg; y.r := RH; incR - ELSE load(y); Put1(Mov, RH, 0, -2); Put0(Lsl, y.r, RH, y.r) - END ; - IF x.mode = ORB.Const THEN - IF x.a # 0 THEN Put1(Xor, y.r, y.r, -1); Put1a(And, RH-1, y.r, x.a) END ; - x.mode := Reg; x.r := RH-1 - ELSE DEC(RH); Put0(Ann, RH-1, x.r, y.r) - END - END - END Set; - - PROCEDURE In*(VAR x, y: Item); (* x := x IN y *) - BEGIN load(y); - IF x.mode = ORB.Const THEN Put1(Ror, y.r, y.r, (x.a + 1) MOD 20H); DEC(RH) - ELSE load(x); Put1(Add, x.r, x.r, 1); Put0(Ror, y.r, y.r, x.r); DEC(RH, 2) - END ; - SetCC(x, MI) - END In; - - PROCEDURE SetOp*(op: LONGINT; VAR x, y: Item); (* x := x op y *) - VAR xset, yset: SET; (*x.type.form = Set*) - BEGIN - IF (x.mode = ORB.Const) & (y.mode = ORB.Const) THEN - xset := SYSTEM.VAL(SET, x.a); yset := SYSTEM.VAL(SET, y.a); - IF op = ORS.plus THEN xset := xset + yset - ELSIF op = ORS.minus THEN xset := xset - yset - ELSIF op = ORS.times THEN xset := xset * yset - ELSIF op = ORS.rdiv THEN xset := xset / yset - END ; - x.a := SYSTEM.VAL(LONGINT, xset) - ELSIF y.mode = ORB.Const THEN - load(x); - IF op = ORS.plus THEN Put1a(Ior, x.r, x.r, y.a) - ELSIF op = ORS.minus THEN Put1a(Ann, x.r, x.r, y.a) - ELSIF op = ORS.times THEN Put1a(And, x.r, x.r, y.a) - ELSIF op = ORS.rdiv THEN Put1a(Xor, x.r, x.r, y.a) - END ; - ELSE load(x); load(y); - IF op = ORS.plus THEN Put0(Ior, RH-2, x.r, y.r) - ELSIF op = ORS.minus THEN Put0(Ann, RH-2, x.r, y.r) - ELSIF op = ORS.times THEN Put0(And, RH-2, x.r, y.r) - ELSIF op = ORS.rdiv THEN Put0(Xor, RH-2, x.r, y.r) - END ; - DEC(RH); x.r := RH-1 - END - END SetOp; - - (* Code generation for relations *) - - PROCEDURE IntRelation*(op: INTEGER; VAR x, y: Item); (* x := x < y *) - BEGIN - IF (y.mode = ORB.Const) & (y.type.form # ORB.Proc) THEN - load(x); - IF (y.a # 0) OR ~(op IN {ORS.eql, ORS.neq}) OR (code[pc-1] DIV 40000000H # -2) THEN Put1a(Cmp, x.r, x.r, y.a) END ; - DEC(RH) - ELSE load(x); load(y); Put0(Cmp, x.r, x.r, y.r); DEC(RH, 2) - END ; - SetCC(x, relmap[op - ORS.eql]) - END IntRelation; - - PROCEDURE SetRelation*(op: INTEGER; VAR x, y: Item); (* x := x < y *) - BEGIN load(x); - IF (op = ORS.eql) OR (op = ORS.neq) THEN - IF y.mode = ORB.Const THEN Put1a(Cmp, x.r, x.r, y.a); DEC(RH) - ELSE load(y); Put0(Cmp, x.r, x.r, y.r); DEC(RH, 2) - END ; - SetCC(x, relmap[op - ORS.eql]) - ELSE ORS.Mark("illegal relation") - END - END SetRelation; - - PROCEDURE RealRelation*(op: INTEGER; VAR x, y: Item); (* x := x < y *) - BEGIN load(x); - IF (y.mode = ORB.Const) & (y.a = 0) THEN DEC(RH) - ELSE load(y); Put0(Fsb, x.r, x.r, y.r); DEC(RH, 2) - END ; - SetCC(x, relmap[op - ORS.eql]) - END RealRelation; - - PROCEDURE StringRelation*(op: INTEGER; VAR x, y: Item); (* x := x < y *) - (*x, y are char arrays or strings*) - BEGIN - IF x.type.form = ORB.String THEN loadStringAdr(x) ELSE loadAdr(x) END ; - IF y.type.form = ORB.String THEN loadStringAdr(y) ELSE loadAdr(y) END ; - Put2(Ldr+1, RH, x.r, 0); Put1(Add, x.r, x.r, 1); - Put2(Ldr+1, RH+1, y.r, 0); Put1(Add, y.r, y.r, 1); - Put0(Cmp, RH+2, RH, RH+1); Put3(BC, NE, 2); - Put1(Cmp, RH+2, RH, 0); Put3(BC, NE, -8); - DEC(RH, 2); SetCC(x, relmap[op - ORS.eql]) - END StringRelation; - - (* Code generation of Assignments *) - - PROCEDURE StrToChar*(VAR x: Item); - BEGIN x.type := ORB.charType; DEC(strx, 4); x.a := ORD(str[x.a]) - END StrToChar; - - PROCEDURE Store*(VAR x, y: Item); (* x := y *) - VAR op: LONGINT; - BEGIN load(y); - IF x.type.size = 1 THEN op := Str+1 ELSE op := Str END ; - IF x.mode = ORB.Var THEN - IF x.r > 0 THEN (*local*) Put2(op, y.r, SP, x.a + frame) - ELSE GetSB(x.r); Put2(op, y.r, SB, x.a) - END - ELSIF x.mode = ORB.Par THEN Put2(Ldr, RH, SP, x.a + frame); Put2(op, y.r, RH, x.b); - ELSIF x.mode = RegI THEN Put2(op, y.r, x.r, x.a); DEC(RH); - ELSE ORS.Mark("bad mode in Store") - END ; - DEC(RH) - END Store; - - PROCEDURE StoreStruct*(VAR x, y: Item); (* x := y, frame = 0 *) - VAR s, pc0: LONGINT; - BEGIN loadAdr(x); loadAdr(y); - IF (x.type.form = ORB.Array) & (x.type.len > 0) THEN - IF y.type.len >= 0 THEN - IF x.type.len >= y.type.len THEN Put1a(Mov, RH, 0, (y.type.size+3) DIV 4) - ELSE ORS.Mark("source array too long") - END - ELSE (*y is open array*) - Put2(Ldr, RH, SP, y.a+4); s := y.type.base.size; (*element size*) - pc0 := pc; Put3(BC, EQ, 0); - IF s = 1 THEN Put1(Add, RH, RH, 3); Put1(Asr, RH, RH, 2) - ELSIF s # 4 THEN Put1a(Mul, RH, RH, s DIV 4) - END ; - IF check THEN - Put1a(Mov, RH+1, 0, (x.type.size+3) DIV 4); Put0(Cmp, RH+1, RH, RH+1); Trap(GT, 3) - END ; - fix(pc0, pc + 5 - pc0) - END - ELSIF x.type.form = ORB.Record THEN Put1a(Mov, RH, 0, x.type.size DIV 4) - ELSE ORS.Mark("inadmissible assignment") - END ; - Put2(Ldr, RH+1, y.r, 0); Put1(Add, y.r, y.r, 4); - Put2(Str, RH+1, x.r, 0); Put1(Add, x.r, x.r, 4); - Put1(Sub, RH, RH, 1); Put3(BC, NE, -6); DEC(RH, 2) - END StoreStruct; - - PROCEDURE CopyString*(VAR x, y: Item); (*from x to y*) - VAR len: LONGINT; - BEGIN loadAdr(y); len := y.type.len; - IF len >= 0 THEN - IF x.b > len THEN ORS.Mark("string too long") END - ELSIF check THEN Put2(Ldr, RH, y.r, 4); (*array length check*) - Put1(Cmp, RH, RH, x.b); Trap(NE, 3) - END ; - loadStringAdr(x); - Put2(Ldr, RH, x.r, 0); Put1(Add, x.r, x.r, 4); - Put2(Str, RH, y.r, 0); Put1(Add, y.r, y.r, 4); - Put1(Asr, RH, RH, 24); Put3(BC, NE, -6); DEC(RH, 2) - END CopyString; - - (* Code generation for parameters *) - - PROCEDURE VarParam*(VAR x: Item; ftype: ORB.Type); - VAR xmd: INTEGER; - BEGIN xmd := x.mode; loadAdr(x); - IF (ftype.form = ORB.Array) & (ftype.len < 0) THEN (*open array*) - IF x.type.len >= 0 THEN Put1a(Mov, RH, 0, x.type.len) ELSE Put2(Ldr, RH, SP, x.a+4+frame) END ; - incR - ELSIF ftype.form = ORB.Record THEN - IF xmd = ORB.Par THEN Put2(Ldr, RH, SP, x.a+4+frame); incR ELSE loadTypTagAdr(x.type) END - END - END VarParam; - - PROCEDURE ValueParam*(VAR x: Item); - BEGIN load(x) - END ValueParam; - - PROCEDURE OpenArrayParam*(VAR x: Item); - BEGIN loadAdr(x); - IF x.type.len >= 0 THEN Put1a(Mov, RH, 0, x.type.len) ELSE Put2(Ldr, RH, SP, x.a+4+frame) END ; - incR - END OpenArrayParam; - - PROCEDURE StringParam*(VAR x: Item); - BEGIN loadStringAdr(x); Put1(Mov, RH, 0, x.b); incR (*len*) - END StringParam; - - (*For Statements*) - - PROCEDURE For0*(VAR x, y: Item); - BEGIN load(y) - END For0; - - PROCEDURE For1*(VAR x, y, z, w: Item; VAR L: LONGINT); - BEGIN - IF z.mode = ORB.Const THEN Put1a(Cmp, RH, y.r, z.a) - ELSE load(z); Put0(Cmp, RH-1, y.r, z.r); DEC(RH) - END ; - L := pc; - IF w.a > 0 THEN Put3(BC, GT, 0) - ELSIF w.a < 0 THEN Put3(BC, LT, 0) - ELSE ORS.Mark("zero increment"); Put3(BC, MI, 0) - END ; - Store(x, y) - END For1; - - PROCEDURE For2*(VAR x, y, w: Item); - BEGIN load(x); DEC(RH); Put1a(Add, x.r, x.r, w.a) - END For2; - - (* Branches, procedure calls, procedure prolog and epilog *) - - PROCEDURE Here*(): LONGINT; - BEGIN invalSB; RETURN pc - END Here; - - PROCEDURE FJump*(VAR L: LONGINT); - BEGIN Put3(BC, 7, L); L := pc-1 - END FJump; - - PROCEDURE CFJump*(VAR x: Item); - BEGIN - IF x.mode # Cond THEN loadCond(x) END ; - Put3(BC, negated(x.r), x.a); FixLink(x.b); x.a := pc-1 - END CFJump; - - PROCEDURE BJump*(L: LONGINT); - BEGIN Put3(BC, 7, L-pc-1) - END BJump; - - PROCEDURE CBJump*(VAR x: Item; L: LONGINT); - BEGIN - IF x.mode # Cond THEN loadCond(x) END ; - Put3(BC, negated(x.r), L-pc-1); FixLink(x.b); FixLinkWith(x.a, L) - END CBJump; - - PROCEDURE Fixup*(VAR x: Item); - BEGIN FixLink(x.a) - END Fixup; - - PROCEDURE SaveRegs(r: LONGINT); (* R[0 .. r-1]*) - VAR r0: LONGINT; - BEGIN (*r > 0*) r0 := 0; - Put1(Sub, SP, SP, r*4); INC(frame, 4*r); - REPEAT Put2(Str, r0, SP, (r-r0-1)*4); INC(r0) UNTIL r0 = r - END SaveRegs; - - PROCEDURE RestoreRegs(r: LONGINT); (*R[0 .. r-1]*) - VAR r0: LONGINT; - BEGIN (*r > 0*) r0 := r; - REPEAT DEC(r0); Put2(Ldr, r0, SP, (r-r0-1)*4) UNTIL r0 = 0; - Put1(Add, SP, SP, r*4); DEC(frame, 4*r) - END RestoreRegs; - - PROCEDURE PrepCall*(VAR x: Item; VAR r: LONGINT); - BEGIN (*x.type.form = ORB.Proc*) - IF x.mode > ORB.Par THEN load(x) END ; - r := RH; - IF RH > 0 THEN SaveRegs(RH); RH := 0 END - END PrepCall; - - PROCEDURE Call*(VAR x: Item; r: LONGINT); - BEGIN (*x.type.form = ORB.Proc*) - IF x.mode = ORB.Const THEN - IF x.r >= 0 THEN Put3(BL, 7, (x.a DIV 4)-pc-1) - ELSE (*imported*) - IF pc - fixorgP < 1000H THEN - Put3(BL, 7, ((-x.r) * 100H + x.a) * 1000H + pc-fixorgP); fixorgP := pc-1 - ELSE ORS.Mark("fixup impossible") - END - END - ELSE - IF x.mode <= ORB.Par THEN load(x); DEC(RH) - ELSE Put2(Ldr, RH, SP, 0); Put1(Add, SP, SP, 4); DEC(r); DEC(frame, 4) - END ; - IF check THEN Trap(EQ, 5) END ; - Put3(BLR, 7, RH) - END ; - IF x.type.base.form = ORB.NoTyp THEN (*procedure*) RH := 0 - ELSE (*function*) - IF r > 0 THEN Put0(Mov, r, 0, 0); RestoreRegs(r) END ; - x.mode := Reg; x.r := r; RH := r+1 - END ; - invalSB - END Call; - - PROCEDURE Enter*(parblksize, locblksize: LONGINT; int: BOOLEAN); - VAR a, r: LONGINT; - BEGIN invalSB; frame := 0; - IF ~int THEN (*procedure prolog*) - a := 4; r := 0; - Put1(Sub, SP, SP, locblksize); Put2(Str, LNK, SP, 0); - WHILE a < parblksize DO Put2(Str, r, SP, a); INC(r); INC(a, 4) END - ELSE (*interrupt procedure*) - Put1(Sub, SP, SP, 12); Put2(Str, 0, SP, 0); Put2(Str, 1, SP, 4); Put2(Str, SB, SP, 8) - (*R0, R1, SB saved os stack*) - END - END Enter; - - PROCEDURE Return*(form: INTEGER; VAR x: Item; size: LONGINT; int: BOOLEAN); - BEGIN - IF form # ORB.NoTyp THEN load(x) END ; - IF ~int THEN (*procedure epilog*) - Put2(Ldr, LNK, SP, 0); Put1(Add, SP, SP, size); Put3(BR, 7, LNK) - ELSE (*interrupt return, restore SB, R1, R0*) - Put2(Ldr, SB, SP, 8); Put2(Ldr, 1, SP, 4); Put2(Ldr, 0, SP, 0); Put1(Add, SP, SP, 12); Put3(BR, 7, 10H) - END ; - RH := 0 - END Return; - - (* In-line code procedures*) - - PROCEDURE Increment*(upordown: LONGINT; VAR x, y: Item); - VAR op, zr, v: LONGINT; - BEGIN (*frame = 0*) - IF upordown = 0 THEN op := Add ELSE op := Sub END ; - IF x.type = ORB.byteType THEN v := 1 ELSE v := 0 END ; - IF y.type.form = ORB.NoTyp THEN y.mode := ORB.Const; y.a := 1 END ; - IF (x.mode = ORB.Var) & (x.r > 0) THEN - zr := RH; Put2(Ldr+v, zr, SP, x.a); incR; - IF y.mode = ORB.Const THEN Put1a(op, zr, zr, y.a) ELSE load(y); Put0(op, zr, zr, y.r); DEC(RH) END ; - Put2(Str+v, zr, SP, x.a); DEC(RH) - ELSE loadAdr(x); zr := RH; Put2(Ldr+v, RH, x.r, 0); incR; - IF y.mode = ORB.Const THEN Put1a(op, zr, zr, y.a) ELSE load(y); Put0(op, zr, zr, y.r); DEC(RH) END ; - Put2(Str+v, zr, x.r, 0); DEC(RH, 2) - END - END Increment; - - PROCEDURE Include*(inorex: LONGINT; VAR x, y: Item); - VAR op, zr: LONGINT; - BEGIN loadAdr(x); zr := RH; Put2(Ldr, RH, x.r, 0); incR; - IF inorex = 0 THEN op := Ior ELSE op := Ann END ; - IF y.mode = ORB.Const THEN Put1a(op, zr, zr, LSL(1, y.a)) - ELSE load(y); Put1(Mov, RH, 0, 1); Put0(Lsl, y.r, RH, y.r); Put0(op, zr, zr, y.r); DEC(RH) - END ; - Put2(Str, zr, x.r, 0); DEC(RH, 2) - END Include; - - PROCEDURE Assert*(VAR x: Item); - VAR cond: LONGINT; - BEGIN - IF x.mode # Cond THEN loadCond(x) END ; - IF x.a = 0 THEN cond := negated(x.r) - ELSE Put3(BC, x.r, x.b); FixLink(x.a); x.b := pc-1; cond := 7 - END ; - Trap(cond, 7); FixLink(x.b) - END Assert; - - PROCEDURE New*(VAR x: Item); - BEGIN loadAdr(x); loadTypTagAdr(x.type.base); Put3(BLR, 7, MT); RH := 0; invalSB - END New; - - PROCEDURE Pack*(VAR x, y: Item); - VAR z: Item; - BEGIN z := x; load(x); load(y); - Put1(Lsl, y.r, y.r, 23); Put0(Add, x.r, x.r, y.r); DEC(RH); Store(z, x) - END Pack; - - PROCEDURE Unpk*(VAR x, y: Item); - VAR z, e0: Item; - BEGIN z := x; load(x); e0.mode := Reg; e0.r := RH; e0.type := ORB.intType; - Put1(Asr, RH, x.r, 23); Put1(Sub, RH, RH, 127); Store(y, e0); incR; - Put1(Lsl, RH, RH, 23); Put0(Sub, x.r, x.r, RH); Store(z, x) - END Unpk; - - PROCEDURE Led*(VAR x: Item); - BEGIN load(x); Put1(Mov, RH, 0, -60); Put2(Str, x.r, RH, 0); DEC(RH) - END Led; - - PROCEDURE Get*(VAR x, y: Item); - BEGIN load(x); x.type := y.type; x.mode := RegI; x.a := 0; Store(y, x) - END Get; - - PROCEDURE Put*(VAR x, y: Item); - BEGIN load(x); x.type := y.type; x.mode := RegI; x.a := 0; Store(x, y) - END Put; - - PROCEDURE Copy*(VAR x, y, z: Item); - BEGIN load(x); load(y); - IF z.mode = ORB.Const THEN - IF z.a > 0 THEN load(z) ELSE ORS.Mark("bad count") END - ELSE load(z); - IF check THEN Trap(LT, 3) END ; - Put3(BC, EQ, 6) - END ; - Put2(Ldr, RH, x.r, 0); Put1(Add, x.r, x.r, 4); - Put2(Str, RH, y.r, 0); Put1(Add, y.r, y.r, 4); - Put1(Sub, z.r, z.r, 1); Put3(BC, NE, -6); DEC(RH, 3) - END Copy; - - PROCEDURE LDPSR*(VAR x: Item); - BEGIN (*x.mode = Const*) Put3(0, 15, x.a + 20H) - END LDPSR; - - PROCEDURE LDREG*(VAR x, y: Item); - BEGIN - IF y.mode = ORB.Const THEN Put1a(Mov, x.a, 0, y.a) - ELSE load(y); Put0(Mov, x.a, 0, y.r); DEC(RH) - END - END LDREG; - - (*In-line code functions*) - - PROCEDURE Abs*(VAR x: Item); - BEGIN - IF x.mode = ORB.Const THEN x.a := ABS(x.a) - ELSE load(x); - IF x.type.form = ORB.Real THEN Put1(Lsl, x.r, x.r, 1); Put1(Ror, x.r, x.r, 1) - ELSE Put1(Cmp, x.r, x.r, 0); Put3(BC, GE, 2); Put1(Mov, RH, 0, 0); Put0(Sub, x.r, RH, x.r) - END - END - END Abs; - - PROCEDURE Odd*(VAR x: Item); - BEGIN load(x); Put1(And, x.r, x.r, 1); SetCC(x, NE); DEC(RH) - END Odd; - - PROCEDURE Floor*(VAR x: Item); - BEGIN load(x); Put1(Mov+U, RH, 0, 4B00H); Put0(Fad+V, x.r, x.r, RH) - END Floor; - - PROCEDURE Float*(VAR x: Item); - BEGIN load(x); Put1(Mov+U, RH, 0, 4B00H); Put0(Fad+U, x.r, x.r, RH) - END Float; - - PROCEDURE Ord*(VAR x: Item); - BEGIN - IF x.mode IN {ORB.Var, ORB.Par, RegI} THEN load(x) END - END Ord; - - PROCEDURE Len*(VAR x: Item); - BEGIN - IF x.type.len >= 0 THEN x.mode := ORB.Const; x.a := x.type.len - ELSE (*open array*) Put2(Ldr, RH, SP, x.a + 4 + frame); x.mode := Reg; x.r := RH; incR - END - END Len; - - PROCEDURE Shift*(fct: LONGINT; VAR x, y: Item); - VAR op: LONGINT; - BEGIN load(x); - IF fct = 0 THEN op := Lsl ELSIF fct = 1 THEN op := Asr ELSE op := Ror END ; - IF y.mode = ORB.Const THEN Put1(op, x.r, x.r, y.a MOD 20H) - ELSE load(y); Put0(op, RH-2, x.r, y.r); DEC(RH); x.r := RH-1 - END - END Shift; - - PROCEDURE ADC*(VAR x, y: Item); - BEGIN load(x); load(y); Put0(Add+2000H, x.r, x.r, y.r); DEC(RH) - END ADC; - - PROCEDURE SBC*(VAR x, y: Item); - BEGIN load(x); load(y); Put0(Sub+2000H, x.r, x.r, y.r); DEC(RH) - END SBC; - - PROCEDURE UML*(VAR x, y: Item); - BEGIN load(x); load(y); Put0(Mul+2000H, x.r, x.r, y.r); DEC(RH) - END UML; - - PROCEDURE Bit*(VAR x, y: Item); - BEGIN load(x); Put2(Ldr, x.r, x.r, 0); - IF y.mode = ORB.Const THEN Put1(Ror, x.r, x.r, y.a+1); DEC(RH) - ELSE load(y); Put1(Add, y.r, y.r, 1); Put0(Ror, x.r, x.r, y.r); DEC(RH, 2) - END ; - SetCC(x, MI) - END Bit; - - PROCEDURE Register*(VAR x: Item); - BEGIN (*x.mode = Const*) - Put0(Mov, RH, 0, x.a MOD 10H); x.mode := Reg; x.r := RH; incR - END Register; - - PROCEDURE H*(VAR x: Item); - BEGIN (*x.mode = Const*) - Put0(Mov + U + x.a MOD 2 * V, RH, 0, 0); x.mode := Reg; x.r := RH; incR - END H; - - PROCEDURE Adr*(VAR x: Item); - BEGIN - IF x.mode IN {ORB.Var, ORB.Par, RegI} THEN loadAdr(x) - ELSIF (x.mode = ORB.Const) & (x.type.form = ORB.Proc) THEN load(x) - ELSIF (x.mode = ORB.Const) & (x.type.form = ORB.String) THEN loadStringAdr(x) - ELSE ORS.Mark("not addressable") - END - END Adr; - - PROCEDURE Condition*(VAR x: Item); - BEGIN (*x.mode = Const*) SetCC(x, x.a) - END Condition; - - PROCEDURE Open*(v: INTEGER); - BEGIN pc := 0; tdx := 0; strx := 0; RH := 0; fixorgP := 0; fixorgD := 0; fixorgT := 0; check := v # 0; version := v; - IF v = 0 THEN pc := 8 END - END Open; - - PROCEDURE SetDataSize*(dc: LONGINT); - BEGIN varsize := dc - END SetDataSize; - - PROCEDURE Header*; - BEGIN entry := pc*4; - IF version = 0 THEN code[0] := 0E7000000H-1 + pc; Put1a(Mov, SB, 0, VarOrg0); Put1a(Mov, SP, 0, StkOrg0) (*RISC-0*) - ELSE Put1(Sub, SP, SP, 4); Put2(Str, LNK, SP, 0); invalSB - END - END Header; - - PROCEDURE NofPtrs(typ: ORB.Type): LONGINT; - VAR fld: ORB.Object; n: LONGINT; - BEGIN - IF (typ.form = ORB.Pointer) OR (typ.form = ORB.NilTyp) THEN n := 1 - ELSIF typ.form = ORB.Record THEN - fld := typ.dsc; n := 0; - WHILE fld # NIL DO n := NofPtrs(fld.type) + n; fld := fld.next END - ELSIF typ.form = ORB.Array THEN n := NofPtrs(typ.base) * typ.len - ELSE n := 0 - END ; - RETURN n - END NofPtrs; - - PROCEDURE FindPtrs(VAR R: Files.Rider; typ: ORB.Type; adr: LONGINT); - VAR fld: ORB.Object; i, s: LONGINT; - BEGIN - IF (typ.form = ORB.Pointer) OR (typ.form = ORB.NilTyp) THEN Files.WriteInt(R, adr) - ELSIF typ.form = ORB.Record THEN - fld := typ.dsc; - WHILE fld # NIL DO FindPtrs(R, fld.type, fld.val + adr); fld := fld.next END - ELSIF typ.form = ORB.Array THEN - s := typ.base.size; - FOR i := 0 TO typ.len-1 DO FindPtrs(R, typ.base, i*s + adr) END - END - END FindPtrs; - - PROCEDURE Close*(VAR modid: ORS.Ident; key, nofent: LONGINT); - VAR obj: ORB.Object; - i, comsize, nofimps, nofptrs, size: LONGINT; - name: ORS.Ident; - F: Files.File; R: Files.Rider; - BEGIN (*exit code*) - IF version = 0 THEN Put1(Mov, 0, 0, 0); Put3(BR, 7, 0) (*RISC-0*) - ELSE Put2(Ldr, LNK, SP, 0); Put1(Add, SP, SP, 4); Put3(BR, 7, LNK) - END ; - obj := ORB.topScope.next; nofimps := 0; comsize := 4; nofptrs := 0; - WHILE obj # NIL DO - IF (obj.class = ORB.Mod) & (obj.dsc # ORB.system) THEN INC(nofimps) (*count imports*) - ELSIF (obj.exno # 0) & (obj.class = ORB.Const) & (obj.type.form = ORB.Proc) - & (obj.type.nofpar = 0) & (obj.type.base = ORB.noType) THEN i := 0; (*count commands*) - WHILE obj.name[i] # 0X DO INC(i) END ; - i := (i+4) DIV 4 * 4; INC(comsize, i+4) - ELSIF obj.class = ORB.Var THEN INC(nofptrs, NofPtrs(obj.type)) (*count pointers*) - END ; - obj := obj.next - END ; - size := varsize + strx + comsize + (pc + nofimps + nofent + nofptrs + 1)*4; (*varsize includes type descriptors*) - - ORB.MakeFileName(name, modid, ".rsc"); (*write code file*) - F := Files.New(name); Files.Set(R, F, 0); Files.WriteString(R, modid); Files.WriteInt(R, key); - (*Files.WriteByte(R, version);*) (* who writes like that? -- noch *) - Files.WriteByte(R, SHORT(SHORT(version))); (* voc adaptation by noch *) - Files.WriteInt(R, size); - obj := ORB.topScope.next; - WHILE (obj # NIL) & (obj.class = ORB.Mod) DO (*imports*) - IF obj.dsc # ORB.system THEN Files.WriteString(R, obj(ORB.Module).orgname); Files.WriteInt(R, obj.val) END ; - obj := obj.next - END ; - Files.Write(R, 0X); - Files.WriteInt(R, tdx*4); - i := 0; - WHILE i < tdx DO Files.WriteInt(R, data[i]); INC(i) END ; (*type descriptors*) - Files.WriteInt(R, varsize - tdx*4); (*data*) - Files.WriteInt(R, strx); - FOR i := 0 TO strx-1 DO Files.Write(R, str[i]) END ; (*strings*) - Files.WriteInt(R, pc); (*code len*) - FOR i := 0 TO pc-1 DO Files.WriteInt(R, code[i]) END ; (*program*) - obj := ORB.topScope.next; - WHILE obj # NIL DO (*commands*) - IF (obj.exno # 0) & (obj.class = ORB.Const) & (obj.type.form = ORB.Proc) & - (obj.type.nofpar = 0) & (obj.type.base = ORB.noType) THEN - Files.WriteString(R, obj.name); Files.WriteInt(R, obj.val) - END ; - obj := obj.next - END ; - Files.Write(R, 0X); - Files.WriteInt(R, nofent); Files.WriteInt(R, entry); - obj := ORB.topScope.next; - WHILE obj # NIL DO (*entries*) - IF obj.exno # 0 THEN - IF (obj.class = ORB.Const) & (obj.type.form = ORB.Proc) OR (obj.class = ORB.Var) THEN - Files.WriteInt(R, obj.val) - ELSIF obj.class = ORB.Typ THEN - IF obj.type.form = ORB.Record THEN Files.WriteInt(R, obj.type.len MOD 10000H) - ELSIF (obj.type.form = ORB.Pointer) & ((obj.type.base.typobj = NIL) OR (obj.type.base.typobj.exno = 0)) THEN - Files.WriteInt(R, obj.type.base.len MOD 10000H) - END - END - END ; - obj := obj.next - END ; - obj := ORB.topScope.next; - WHILE obj # NIL DO (*pointer variables*) - IF obj.class = ORB.Var THEN FindPtrs(R, obj.type, obj.val) END ; - obj := obj.next - END ; - Files.WriteInt(R, -1); - Files.WriteInt(R, fixorgP); Files.WriteInt(R, fixorgD); Files.WriteInt(R, fixorgT); Files.WriteInt(R, entry); - Files.Write(R, "O"); Files.Register(F) - END Close; - -BEGIN - relmap[0] := 1; relmap[1] := 9; relmap[2] := 5; relmap[3] := 6; relmap[4] := 14; relmap[5] := 13 -END ORG. +MODULE ORG; (* NW 24.6.2014 code generator in Oberon-07 for RISC*) + IMPORT SYSTEM, Files := CompatFiles, ORS, ORB; + (*Code generator for Oberon compiler for RISC processor. + Procedural interface to Parser OSAP; result in array "code". + Procedure Close writes code-files*) + + (* voc adaptation by noch *) + TYPE INTEGER = LONGINT; + BYTE = CHAR; + + CONST WordSize* = 4; + StkOrg0 = -64; VarOrg0 = 0; (*for RISC-0 only*) + MT = 12; SB = 13; SP = 14; LNK = 15; (*dedicated registers*) + maxCode = 8000; maxStrx = 2400; maxTD = 120; C24 = 1000000H; + Reg = 10; RegI = 11; Cond = 12; (*internal item modes*) + + (*frequently used opcodes*) U = 2000H; V = 1000H; + Mov = 0; Lsl = 1; Asr = 2; Ror= 3; And = 4; Ann = 5; Ior = 6; Xor = 7; + Add = 8; Sub = 9; Cmp = 9; Mul = 10; Div = 11; + Fad = 12; Fsb = 13; Fml = 14; Fdv = 15; + Ldr = 8; Str = 10; + BR = 0; BLR = 1; BC = 2; BL = 3; + MI = 0; PL = 8; EQ = 1; NE = 9; LT = 5; GE = 13; LE = 6; GT = 14; + + TYPE Item* = RECORD + mode*: INTEGER; + type*: ORB.Type; + a*, b*, r: LONGINT; + rdo*: BOOLEAN (*read only*) + END ; + + (* Item forms and meaning of fields: + mode r a b + -------------------------------- + Const - value (proc adr) (immediate value) + Var base off - (direct adr) + Par - off0 off1 (indirect adr) + Reg regno + RegI regno off - + Cond cond Fchain Tchain *) + + VAR pc*, varsize: LONGINT; (*program counter, data index*) + tdx, strx: LONGINT; + entry: LONGINT; (*main entry point*) + RH: LONGINT; (*available registers R[0] ... R[H-1]*) + curSB: LONGINT; (*current static base in SB*) + frame: LONGINT; (*frame offset changed in SaveRegs and RestoreRegs*) + fixorgP, fixorgD, fixorgT: LONGINT; (*origins of lists of locations to be fixed up by loader*) + check: BOOLEAN; (*emit run-time checks*) + version: INTEGER; (* 0 = RISC-0, 1 = RISC-5 *) + + relmap: ARRAY 6 OF INTEGER; (*condition codes for relations*) + code: ARRAY maxCode OF LONGINT; + data: ARRAY maxTD OF LONGINT; (*type descriptors*) + str: ARRAY maxStrx OF CHAR; + + (* voc adaptation by noch *) + PROCEDURE LSL (x, n : INTEGER): INTEGER; + + BEGIN + + RETURN ASH(x, n); + END LSL; + + + (*instruction assemblers according to formats*) + + PROCEDURE Put0(op, a, b, c: LONGINT); + BEGIN (*emit format-0 instruction*) + code[pc] := ((a*10H + b) * 10H + op) * 10000H + c; INC(pc) + END Put0; + + PROCEDURE Put1(op, a, b, im: LONGINT); + BEGIN (*emit format-1 instruction, -10000H <= im < 10000H*) + IF im < 0 THEN INC(op, V) END ; + code[pc] := (((a+40H) * 10H + b) * 10H + op) * 10000H + (im MOD 10000H); INC(pc) + END Put1; + + PROCEDURE Put1a(op, a, b, im: LONGINT); + BEGIN (*same as Pu1, but with range test -10000H <= im < 10000H*) + IF (im >= -10000H) & (im <= 0FFFFH) THEN Put1(op, a, b, im) + ELSE Put1(Mov+U, RH, 0, im DIV 10000H); + IF im MOD 10000H # 0 THEN Put1(Ior, RH, RH, im MOD 10000H) END ; + Put0(op, a, b, RH) + END + END Put1a; + + PROCEDURE Put2(op, a, b, off: LONGINT); + BEGIN (*emit load/store instruction*) + code[pc] := ((op * 10H + a) * 10H + b) * 100000H + (off MOD 100000H); INC(pc) + END Put2; + + PROCEDURE Put3(op, cond, off: LONGINT); + BEGIN (*emit branch instruction*) + code[pc] := ((op+12) * 10H + cond) * 1000000H + (off MOD 1000000H); INC(pc) + END Put3; + + PROCEDURE incR; + BEGIN + IF RH < MT-1 THEN INC(RH) ELSE ORS.Mark("register stack overflow") END + END incR; + + PROCEDURE CheckRegs*; + BEGIN + IF RH # 0 THEN ORS.Mark("Reg Stack"); RH := 0 END ; + IF pc >= maxCode - 40 THEN ORS.Mark("Program too long") END + END CheckRegs; + + PROCEDURE SetCC(VAR x: Item; n: LONGINT); + BEGIN x.mode := Cond; x.a := 0; x.b := 0; x.r := n + END SetCC; + + PROCEDURE Trap(cond, num: LONGINT); + BEGIN num := ORS.Pos()*100H + num*10H + MT; Put3(BLR, cond, num) + END Trap; + + (*handling of forward reference, fixups of branch addresses and constant tables*) + + PROCEDURE negated(cond: LONGINT): LONGINT; + BEGIN + IF cond < 8 THEN cond := cond+8 ELSE cond := cond-8 END ; + RETURN cond + END negated; + + PROCEDURE invalSB; + BEGIN curSB := 1 + END invalSB; + + PROCEDURE fix(at, with: LONGINT); + BEGIN code[at] := code[at] DIV C24 * C24 + (with MOD C24) + END fix; + + PROCEDURE FixLink*(L: LONGINT); + VAR L1: LONGINT; + BEGIN invalSB; + WHILE L # 0 DO L1 := code[L] MOD 40000H; fix(L, pc-L-1); L := L1 END + END FixLink; + + PROCEDURE FixLinkWith(L0, dst: LONGINT); + VAR L1: LONGINT; + BEGIN + WHILE L0 # 0 DO + L1 := code[L0] MOD C24; + code[L0] := code[L0] DIV C24 * C24 + ((dst - L0 - 1) MOD C24); L0 := L1 + END + END FixLinkWith; + + PROCEDURE merged(L0, L1: LONGINT): LONGINT; + VAR L2, L3: LONGINT; + BEGIN + IF L0 # 0 THEN L3 := L0; + REPEAT L2 := L3; L3 := code[L2] MOD 40000H UNTIL L3 = 0; + code[L2] := code[L2] + L1; L1 := L0 + END ; + RETURN L1 + END merged; + + (* loading of operands and addresses into registers *) + + PROCEDURE GetSB(base: LONGINT); + BEGIN + IF (version # 0) & ((base # curSB) OR (base # 0)) THEN + Put2(Ldr, SB, -base, pc-fixorgD); fixorgD := pc-1; curSB := base + END + END GetSB; + + PROCEDURE NilCheck; + BEGIN IF check THEN Trap(EQ, 4) END + END NilCheck; + + PROCEDURE load(VAR x: Item); + VAR op: LONGINT; + BEGIN + IF x.type.size = 1 THEN op := Ldr+1 ELSE op := Ldr END ; + IF x.mode # Reg THEN + IF x.mode = ORB.Const THEN + IF x.type.form = ORB.Proc THEN + IF x.r > 0 THEN ORS.Mark("not allowed") + ELSIF x.r = 0 THEN Put3(BL, 7, 0); Put1a(Sub, RH, LNK, pc*4 - x.a) + ELSE GetSB(x.r); Put1(Add, RH, SB, x.a + 100H) (*mark as progbase-relative*) + END + ELSIF (x.a <= 0FFFFH) & (x.a >= -10000H) THEN Put1(Mov, RH, 0, x.a) + ELSE Put1(Mov+U, RH, 0, x.a DIV 10000H MOD 10000H); + IF x.a MOD 10000H # 0 THEN Put1(Ior, RH, RH, x.a MOD 10000H) END + END ; + x.r := RH; incR + ELSIF x.mode = ORB.Var THEN + IF x.r > 0 THEN (*local*) Put2(op, RH, SP, x.a + frame) + ELSE GetSB(x.r); Put2(op, RH, SB, x.a) + END ; + x.r := RH; incR + ELSIF x.mode = ORB.Par THEN Put2(Ldr, RH, SP, x.a + frame); Put2(op, RH, RH, x.b); x.r := RH; incR + ELSIF x.mode = RegI THEN Put2(op, x.r, x.r, x.a) + ELSIF x.mode = Cond THEN + Put3(BC, negated(x.r), 2); + FixLink(x.b); Put1(Mov, RH, 0, 1); Put3(BC, 7, 1); + FixLink(x.a); Put1(Mov, RH, 0, 0); x.r := RH; incR + END ; + x.mode := Reg + END + END load; + + PROCEDURE loadAdr(VAR x: Item); + BEGIN + IF x.mode = ORB.Var THEN + IF x.r > 0 THEN (*local*) Put1a(Add, RH, SP, x.a + frame) + ELSE GetSB(x.r); Put1a(Add, RH, SB, x.a) + END ; + x.r := RH; incR + ELSIF x.mode = ORB.Par THEN Put2(Ldr, RH, SP, x.a + frame); + IF x.b # 0 THEN Put1a(Add, RH, RH, x.b) END ; + x.r := RH; incR + ELSIF x.mode = RegI THEN + IF x.a # 0 THEN Put1a(Add, x.r, x.r, x.a) END + ELSE ORS.Mark("address error") + END ; + x.mode := Reg + END loadAdr; + + PROCEDURE loadCond(VAR x: Item); + BEGIN + IF x.type.form = ORB.Bool THEN + IF x.mode = ORB.Const THEN x.r := 15 - x.a*8 + ELSE load(x); + IF code[pc-1] DIV 40000000H # -2 THEN Put1(Cmp, x.r, x.r, 0) END ; + x.r := NE; DEC(RH) + END ; + x.mode := Cond; x.a := 0; x.b := 0 + ELSE ORS.Mark("not Boolean?") + END + END loadCond; + + PROCEDURE loadTypTagAdr(T: ORB.Type); + VAR x: Item; + BEGIN x.mode := ORB.Var; x.a := T.len; x.r := -T.mno; loadAdr(x) + END loadTypTagAdr; + + PROCEDURE loadStringAdr(VAR x: Item); + BEGIN GetSB(0); Put1a(Add, RH, SB, varsize+x.a); x.mode := Reg; x.r := RH; incR + END loadStringAdr; + + (* Items: Conversion from constants or from Objects on the Heap to Items on the Stack*) + + PROCEDURE MakeConstItem*(VAR x: Item; typ: ORB.Type; val: LONGINT); + BEGIN x.mode := ORB.Const; x.type := typ; x.a := val + END MakeConstItem; + + PROCEDURE MakeRealItem*(VAR x: Item; val: REAL); + BEGIN x.mode := ORB.Const; x.type := ORB.realType; x.a := SYSTEM.VAL(LONGINT, val) + END MakeRealItem; + + PROCEDURE MakeStringItem*(VAR x: Item; len: LONGINT); (*copies string from ORS-buffer to ORG-string array*) + VAR i: LONGINT; + BEGIN x.mode := ORB.Const; x.type := ORB.strType; x.a := strx; x.b := len; i := 0; + IF strx + len + 4 < maxStrx THEN + WHILE len > 0 DO str[strx] := ORS.str[i]; INC(strx); INC(i); DEC(len) END ; + WHILE strx MOD 4 # 0 DO str[strx] := 0X; INC(strx) END + ELSE ORS.Mark("too many strings") + END + END MakeStringItem; + + PROCEDURE MakeItem*(VAR x: Item; y: ORB.Object; curlev: LONGINT); + BEGIN x.mode := y.class; x.type := y.type; x.a := y.val; x.rdo := y.rdo; + IF y.class = ORB.Par THEN x.b := 0 + ELSIF y.class = ORB.Typ THEN x.a := y.type.len; x.r := -y.lev + ELSIF (y.class = ORB.Const) & (y.type.form = ORB.String) THEN x.b := y.lev (*len*) + ELSE x.r := y.lev + END ; + IF (y.lev > 0) & (y.lev # curlev) & (y.class # ORB.Const) THEN ORS.Mark("level error, not accessible") END + END MakeItem; + + (* Code generation for Selectors, Variables, Constants *) + + PROCEDURE Field*(VAR x: Item; y: ORB.Object); (* x := x.y *) + BEGIN; + IF x.mode = ORB.Var THEN + IF x.r >= 0 THEN x.a := x.a + y.val + ELSE loadAdr(x); x.mode := RegI; x.a := y.val + END + ELSIF x.mode = RegI THEN x.a := x.a + y.val + ELSIF x.mode = ORB.Par THEN x.b := x.b + y.val + END + END Field; + + PROCEDURE Index*(VAR x, y: Item); (* x := x[y] *) + VAR s, lim: LONGINT; + BEGIN s := x.type.base.size; lim := x.type.len; + IF (y.mode = ORB.Const) & (lim >= 0) THEN + IF (y.a < 0) OR (y.a >= lim) THEN ORS.Mark("bad index") END ; + IF x.mode IN {ORB.Var, RegI} THEN x.a := y.a * s + x.a + ELSIF x.mode = ORB.Par THEN x.b := y.a * s + x.b + END + ELSE load(y); + IF check THEN (*check array bounds*) + IF lim >= 0 THEN Put1a(Cmp, RH, y.r, lim) + ELSE (*open array*) + IF x.mode IN {ORB.Var, ORB.Par} THEN Put2(Ldr, RH, SP, x.a+4+frame); Put0(Cmp, RH, y.r, RH) + ELSE ORS.Mark("error in Index") + END + END ; + Trap(10, 1) (*BCC*) + END ; + IF s = 4 THEN Put1(Lsl, y.r, y.r, 2) ELSIF s > 1 THEN Put1a(Mul, y.r, y.r, s) END ; + IF x.mode = ORB.Var THEN + IF x.r > 0 THEN Put0(Add, y.r, SP, y.r); INC(x.a, frame) + ELSE GetSB(x.r); + IF x.r = 0 THEN Put0(Add, y.r, SB, y.r) + ELSE Put1a(Add, RH, SB, x.a); Put0(Add, y.r, RH, y.r); x.a := 0 + END + END ; + x.r := y.r; x.mode := RegI + ELSIF x.mode = ORB.Par THEN + Put2(Ldr, RH, SP, x.a + frame); + Put0(Add, y.r, RH, y.r); x.mode := RegI; x.r := y.r; x.a := x.b + ELSIF x.mode = RegI THEN Put0(Add, x.r, x.r, y.r); DEC(RH) + END + END + END Index; + + PROCEDURE DeRef*(VAR x: Item); + BEGIN + IF x.mode = ORB.Var THEN + IF x.r > 0 THEN (*local*) Put2(Ldr, RH, SP, x.a + frame) ELSE GetSB(x.r); Put2(Ldr, RH, SB, x.a) END ; + NilCheck; x.r := RH; incR + ELSIF x.mode = ORB.Par THEN + Put2(Ldr, RH, SP, x.a + frame); Put2(Ldr, RH, RH, x.b); NilCheck; x.r := RH; incR + ELSIF x.mode = RegI THEN Put2(Ldr, x.r, x.r, x.a); NilCheck + ELSIF x.mode # Reg THEN ORS.Mark("bad mode in DeRef") + END ; + x.mode := RegI; x.a := 0; x.b := 0 + END DeRef; + + PROCEDURE Q(T: ORB.Type; VAR dcw: LONGINT); + BEGIN (*one entry of type descriptor extension table*) + IF T.base # NIL THEN + Q(T.base, dcw); data[dcw] := (T.mno*1000H + T.len) * 1000H + dcw - fixorgT; + fixorgT := dcw; INC(dcw) + END + END Q; + + PROCEDURE FindPtrFlds(typ: ORB.Type; off: LONGINT; VAR dcw: LONGINT); + VAR fld: ORB.Object; i, s: LONGINT; + BEGIN + IF (typ.form = ORB.Pointer) OR (typ.form = ORB.NilTyp) THEN data[dcw] := off; INC(dcw) + ELSIF typ.form = ORB.Record THEN + fld := typ.dsc; + WHILE fld # NIL DO FindPtrFlds(fld.type, fld.val + off, dcw); fld := fld.next END + ELSIF typ.form = ORB.Array THEN + s := typ.base.size; + FOR i := 0 TO typ.len-1 DO FindPtrFlds(typ.base, i*s + off, dcw) END + END + END FindPtrFlds; + + PROCEDURE BuildTD*(T: ORB.Type; VAR dc: LONGINT); + VAR dcw, k, s: LONGINT; (*dcw = word address*) + BEGIN dcw := dc DIV 4; s := T.size; (*convert size for heap allocation*) + IF s <= 24 THEN s := 32 ELSIF s <= 56 THEN s := 64 ELSIF s <= 120 THEN s := 128 + ELSE s := (s+263) DIV 256 * 256 + END ; + T.len := dc; data[dcw] := s; INC(dcw); + k := T.nofpar; (*extension level!*) + IF k > 3 THEN ORS.Mark("ext level too large") + ELSE Q(T, dcw); + WHILE k < 3 DO data[dcw] := -1; INC(dcw); INC(k) END + END ; + FindPtrFlds(T, 0, dcw); data[dcw] := -1; INC(dcw); tdx := dcw; dc := dcw*4; + IF tdx >= maxTD THEN ORS.Mark("too many record types"); tdx := 0 END + END BuildTD; + + PROCEDURE TypeTest*(VAR x: Item; T: ORB.Type; varpar, isguard: BOOLEAN); + VAR pc0: LONGINT; + BEGIN (*fetch tag into RH*) + IF varpar THEN Put2(Ldr, RH, SP, x.a+4+frame) + ELSE load(x); + pc0 := pc; Put3(BC, EQ, 0); (*NIL belongs to every pointer type*) + Put2(Ldr, RH, x.r, -8) + END ; + Put2(Ldr, RH, RH, T.nofpar*4); incR; + loadTypTagAdr(T); (*tag of T*) + Put0(Cmp, RH-1, RH-1, RH-2); DEC(RH, 2); + IF ~varpar THEN fix(pc0, pc - pc0 - 1) END ; + IF isguard THEN + IF check THEN Trap(NE, 2) END + ELSE SetCC(x, EQ); + IF ~varpar THEN DEC(RH) END + END + END TypeTest; + + (* Code generation for Boolean operators *) + + PROCEDURE Not*(VAR x: Item); (* x := ~x *) + VAR t: LONGINT; + BEGIN + IF x.mode # Cond THEN loadCond(x) END ; + x.r := negated(x.r); t := x.a; x.a := x.b; x.b := t + END Not; + + PROCEDURE And1*(VAR x: Item); (* x := x & *) + BEGIN + IF x.mode # Cond THEN loadCond(x) END ; + Put3(BC, negated(x.r), x.a); x.a := pc-1; FixLink(x.b); x.b := 0 + END And1; + + PROCEDURE And2*(VAR x, y: Item); + BEGIN + IF y.mode # Cond THEN loadCond(y) END ; + x.a := merged(y.a, x.a); x.b := y.b; x.r := y.r + END And2; + + PROCEDURE Or1*(VAR x: Item); (* x := x OR *) + BEGIN + IF x.mode # Cond THEN loadCond(x) END ; + Put3(BC, x.r, x.b); x.b := pc-1; FixLink(x.a); x.a := 0 + END Or1; + + PROCEDURE Or2*(VAR x, y: Item); + BEGIN + IF y.mode # Cond THEN loadCond(y) END ; + x.a := y.a; x.b := merged(y.b, x.b); x.r := y.r + END Or2; + + (* Code generation for arithmetic operators *) + + PROCEDURE Neg*(VAR x: Item); (* x := -x *) + BEGIN + IF x.type.form = ORB.Int THEN + IF x.mode = ORB.Const THEN x.a := -x.a + ELSE load(x); Put1(Mov, RH, 0, 0); Put0(Sub, x.r, RH, x.r) + END + ELSIF x.type.form = ORB.Real THEN + IF x.mode = ORB.Const THEN x.a := x.a + 7FFFFFFFH + 1 + ELSE load(x); Put1(Mov, RH, 0, 0); Put0(Fsb, x.r, RH, x.r) + END + ELSE (*form = Set*) + IF x.mode = ORB.Const THEN x.a := -x.a-1 + ELSE load(x); Put1(Xor, x.r, x.r, -1) + END + END + END Neg; + + PROCEDURE AddOp*(op: LONGINT; VAR x, y: Item); (* x := x +- y *) + BEGIN + IF op = ORS.plus THEN + IF (x.mode = ORB.Const) & (y.mode = ORB.Const) THEN x.a := x.a + y.a + ELSIF y.mode = ORB.Const THEN load(x); + IF y.a # 0 THEN Put1a(Add, x.r, x.r, y.a) END + ELSE load(x); load(y); Put0(Add, RH-2, x.r, y.r); DEC(RH); x.r := RH-1 + END + ELSE (*op = ORS.minus*) + IF (x.mode = ORB.Const) & (y.mode = ORB.Const) THEN x.a := x.a - y.a + ELSIF y.mode = ORB.Const THEN load(x); + IF y.a # 0 THEN Put1a(Sub, x.r, x.r, y.a) END + ELSE load(x); load(y); Put0(Sub, RH-2, x.r, y.r); DEC(RH); x.r := RH-1 + END + END + END AddOp; + + PROCEDURE log2(m: LONGINT; VAR e: LONGINT): LONGINT; + BEGIN e := 0; + WHILE ~ODD(m) DO m := m DIV 2; INC(e) END ; + RETURN m + END log2; + + PROCEDURE MulOp*(VAR x, y: Item); (* x := x * y *) + VAR e: LONGINT; + BEGIN + IF (x.mode = ORB.Const) & (y.mode = ORB.Const) THEN x.a := x.a * y.a + ELSIF (y.mode = ORB.Const) & (y.a >= 2) & (log2(y.a, e) = 1) THEN load(x); Put1(Lsl, x.r, x.r, e) + ELSIF y.mode = ORB.Const THEN load(x); Put1a(Mul, x.r, x.r, y.a) + ELSIF (x.mode = ORB.Const) & (x.a >= 2) & (log2(x.a, e) = 1) THEN load(y); Put1(Lsl, y.r, y.r, e); x.mode := Reg; x.r := y.r + ELSIF x.mode = ORB.Const THEN load(y); Put1a(Mul, y.r, y.r, x.a); x.mode := Reg; x.r := y.r + ELSE load(x); load(y); Put0(Mul, RH-2, x.r, y.r); DEC(RH); x.r := RH-1 + END + END MulOp; + + PROCEDURE DivOp*(op: LONGINT; VAR x, y: Item); (* x := x op y *) + VAR e: LONGINT; + BEGIN + IF op = ORS.div THEN + IF (x.mode = ORB.Const) & (y.mode = ORB.Const) THEN + IF y.a > 0 THEN x.a := x.a DIV y.a ELSE ORS.Mark("bad divisor") END + ELSIF (y.mode = ORB.Const) & (y.a >= 2) & (log2(y.a, e) = 1) THEN load(x); Put1(Asr, x.r, x.r, e) + ELSIF y.mode = ORB.Const THEN + IF y.a > 0 THEN load(x); Put1a(Div, x.r, x.r, y.a) ELSE ORS.Mark("bad divisor") END + ELSE load(y); + IF check THEN Trap(LE, 6) END ; + load(x); Put0(Div, RH-2, x.r, y.r); DEC(RH); x.r := RH-1 + END + ELSE (*op = ORS.mod*) + IF (x.mode = ORB.Const) & (y.mode = ORB.Const) THEN + IF y.a > 0 THEN x.a := x.a MOD y.a ELSE ORS.Mark("bad modulus") END + ELSIF (y.mode = ORB.Const) & (y.a >= 2) & (log2(y.a, e) = 1) THEN load(x); + IF e <= 16 THEN Put1(And, x.r, x.r, y.a-1) ELSE Put1(Lsl, x.r, x.r, 32-e); Put1(Ror, x.r, x.r, 32-e) END + ELSIF y.mode = ORB.Const THEN + IF y.a > 0 THEN load(x); Put1a(Div, x.r, x.r, y.a); Put0(Mov+U, x.r, 0, 0) ELSE ORS.Mark("bad modulus") END + ELSE load(y); + IF check THEN Trap(LE, 6) END ; + load(x); Put0(Div, RH-2, x.r, y.r); Put0(Mov+U, RH-2, 0, 0); DEC(RH); x.r := RH-1 + END + END + END DivOp; + + (* Code generation for REAL operators *) + + PROCEDURE RealOp*(op: INTEGER; VAR x, y: Item); (* x := x op y *) + BEGIN load(x); load(y); + IF op = ORS.plus THEN Put0(Fad, RH-2, x.r, y.r) + ELSIF op = ORS.minus THEN Put0(Fsb, RH-2, x.r, y.r) + ELSIF op = ORS.times THEN Put0(Fml, RH-2, x.r, y.r) + ELSIF op = ORS.rdiv THEN Put0(Fdv, RH-2, x.r, y.r) + END ; + DEC(RH); x.r := RH-1 + END RealOp; + + (* Code generation for set operators *) + + PROCEDURE Singleton*(VAR x: Item); (* x := {x} *) + BEGIN + IF x.mode = ORB.Const THEN + x.a := LSL(1, x.a) + ELSE load(x); Put1(Mov, RH, 0, 1); Put0(Lsl, x.r, RH, x.r) + END + END Singleton; + + PROCEDURE Set*(VAR x, y: Item); (* x := {x .. y} *) + BEGIN + IF (x.mode = ORB.Const) & ( y.mode = ORB.Const) THEN + IF x.a <= y.a THEN x.a := LSL(2, y.a) - LSL(1, x.a) ELSE x.a := 0 END + ELSE + IF (x.mode = ORB.Const) & (x.a < 16) THEN x.a := LSL(-1, x.a) + ELSE load(x); Put1(Mov, RH, 0, -1); Put0(Lsl, x.r, RH, x.r) + END ; + IF (y.mode = ORB.Const) & (y.a < 16) THEN Put1(Mov, RH, 0, LSL(-2, y.a)); y.mode := Reg; y.r := RH; incR + ELSE load(y); Put1(Mov, RH, 0, -2); Put0(Lsl, y.r, RH, y.r) + END ; + IF x.mode = ORB.Const THEN + IF x.a # 0 THEN Put1(Xor, y.r, y.r, -1); Put1a(And, RH-1, y.r, x.a) END ; + x.mode := Reg; x.r := RH-1 + ELSE DEC(RH); Put0(Ann, RH-1, x.r, y.r) + END + END + END Set; + + PROCEDURE In*(VAR x, y: Item); (* x := x IN y *) + BEGIN load(y); + IF x.mode = ORB.Const THEN Put1(Ror, y.r, y.r, (x.a + 1) MOD 20H); DEC(RH) + ELSE load(x); Put1(Add, x.r, x.r, 1); Put0(Ror, y.r, y.r, x.r); DEC(RH, 2) + END ; + SetCC(x, MI) + END In; + + PROCEDURE SetOp*(op: LONGINT; VAR x, y: Item); (* x := x op y *) + VAR xset, yset: SET; (*x.type.form = Set*) + BEGIN + IF (x.mode = ORB.Const) & (y.mode = ORB.Const) THEN + xset := SYSTEM.VAL(SET, x.a); yset := SYSTEM.VAL(SET, y.a); + IF op = ORS.plus THEN xset := xset + yset + ELSIF op = ORS.minus THEN xset := xset - yset + ELSIF op = ORS.times THEN xset := xset * yset + ELSIF op = ORS.rdiv THEN xset := xset / yset + END ; + x.a := SYSTEM.VAL(LONGINT, xset) + ELSIF y.mode = ORB.Const THEN + load(x); + IF op = ORS.plus THEN Put1a(Ior, x.r, x.r, y.a) + ELSIF op = ORS.minus THEN Put1a(Ann, x.r, x.r, y.a) + ELSIF op = ORS.times THEN Put1a(And, x.r, x.r, y.a) + ELSIF op = ORS.rdiv THEN Put1a(Xor, x.r, x.r, y.a) + END ; + ELSE load(x); load(y); + IF op = ORS.plus THEN Put0(Ior, RH-2, x.r, y.r) + ELSIF op = ORS.minus THEN Put0(Ann, RH-2, x.r, y.r) + ELSIF op = ORS.times THEN Put0(And, RH-2, x.r, y.r) + ELSIF op = ORS.rdiv THEN Put0(Xor, RH-2, x.r, y.r) + END ; + DEC(RH); x.r := RH-1 + END + END SetOp; + + (* Code generation for relations *) + + PROCEDURE IntRelation*(op: INTEGER; VAR x, y: Item); (* x := x < y *) + BEGIN + IF (y.mode = ORB.Const) & (y.type.form # ORB.Proc) THEN + load(x); + IF (y.a # 0) OR ~(op IN {ORS.eql, ORS.neq}) OR (code[pc-1] DIV 40000000H # -2) THEN Put1a(Cmp, x.r, x.r, y.a) END ; + DEC(RH) + ELSE load(x); load(y); Put0(Cmp, x.r, x.r, y.r); DEC(RH, 2) + END ; + SetCC(x, relmap[op - ORS.eql]) + END IntRelation; + + PROCEDURE SetRelation*(op: INTEGER; VAR x, y: Item); (* x := x < y *) + BEGIN load(x); + IF (op = ORS.eql) OR (op = ORS.neq) THEN + IF y.mode = ORB.Const THEN Put1a(Cmp, x.r, x.r, y.a); DEC(RH) + ELSE load(y); Put0(Cmp, x.r, x.r, y.r); DEC(RH, 2) + END ; + SetCC(x, relmap[op - ORS.eql]) + ELSE ORS.Mark("illegal relation") + END + END SetRelation; + + PROCEDURE RealRelation*(op: INTEGER; VAR x, y: Item); (* x := x < y *) + BEGIN load(x); + IF (y.mode = ORB.Const) & (y.a = 0) THEN DEC(RH) + ELSE load(y); Put0(Fsb, x.r, x.r, y.r); DEC(RH, 2) + END ; + SetCC(x, relmap[op - ORS.eql]) + END RealRelation; + + PROCEDURE StringRelation*(op: INTEGER; VAR x, y: Item); (* x := x < y *) + (*x, y are char arrays or strings*) + BEGIN + IF x.type.form = ORB.String THEN loadStringAdr(x) ELSE loadAdr(x) END ; + IF y.type.form = ORB.String THEN loadStringAdr(y) ELSE loadAdr(y) END ; + Put2(Ldr+1, RH, x.r, 0); Put1(Add, x.r, x.r, 1); + Put2(Ldr+1, RH+1, y.r, 0); Put1(Add, y.r, y.r, 1); + Put0(Cmp, RH+2, RH, RH+1); Put3(BC, NE, 2); + Put1(Cmp, RH+2, RH, 0); Put3(BC, NE, -8); + DEC(RH, 2); SetCC(x, relmap[op - ORS.eql]) + END StringRelation; + + (* Code generation of Assignments *) + + PROCEDURE StrToChar*(VAR x: Item); + BEGIN x.type := ORB.charType; DEC(strx, 4); x.a := ORD(str[x.a]) + END StrToChar; + + PROCEDURE Store*(VAR x, y: Item); (* x := y *) + VAR op: LONGINT; + BEGIN load(y); + IF x.type.size = 1 THEN op := Str+1 ELSE op := Str END ; + IF x.mode = ORB.Var THEN + IF x.r > 0 THEN (*local*) Put2(op, y.r, SP, x.a + frame) + ELSE GetSB(x.r); Put2(op, y.r, SB, x.a) + END + ELSIF x.mode = ORB.Par THEN Put2(Ldr, RH, SP, x.a + frame); Put2(op, y.r, RH, x.b); + ELSIF x.mode = RegI THEN Put2(op, y.r, x.r, x.a); DEC(RH); + ELSE ORS.Mark("bad mode in Store") + END ; + DEC(RH) + END Store; + + PROCEDURE StoreStruct*(VAR x, y: Item); (* x := y, frame = 0 *) + VAR s, pc0: LONGINT; + BEGIN loadAdr(x); loadAdr(y); + IF (x.type.form = ORB.Array) & (x.type.len > 0) THEN + IF y.type.len >= 0 THEN + IF x.type.len >= y.type.len THEN Put1a(Mov, RH, 0, (y.type.size+3) DIV 4) + ELSE ORS.Mark("source array too long") + END + ELSE (*y is open array*) + Put2(Ldr, RH, SP, y.a+4); s := y.type.base.size; (*element size*) + pc0 := pc; Put3(BC, EQ, 0); + IF s = 1 THEN Put1(Add, RH, RH, 3); Put1(Asr, RH, RH, 2) + ELSIF s # 4 THEN Put1a(Mul, RH, RH, s DIV 4) + END ; + IF check THEN + Put1a(Mov, RH+1, 0, (x.type.size+3) DIV 4); Put0(Cmp, RH+1, RH, RH+1); Trap(GT, 3) + END ; + fix(pc0, pc + 5 - pc0) + END + ELSIF x.type.form = ORB.Record THEN Put1a(Mov, RH, 0, x.type.size DIV 4) + ELSE ORS.Mark("inadmissible assignment") + END ; + Put2(Ldr, RH+1, y.r, 0); Put1(Add, y.r, y.r, 4); + Put2(Str, RH+1, x.r, 0); Put1(Add, x.r, x.r, 4); + Put1(Sub, RH, RH, 1); Put3(BC, NE, -6); DEC(RH, 2) + END StoreStruct; + + PROCEDURE CopyString*(VAR x, y: Item); (*from x to y*) + VAR len: LONGINT; + BEGIN loadAdr(y); len := y.type.len; + IF len >= 0 THEN + IF x.b > len THEN ORS.Mark("string too long") END + ELSIF check THEN Put2(Ldr, RH, y.r, 4); (*array length check*) + Put1(Cmp, RH, RH, x.b); Trap(NE, 3) + END ; + loadStringAdr(x); + Put2(Ldr, RH, x.r, 0); Put1(Add, x.r, x.r, 4); + Put2(Str, RH, y.r, 0); Put1(Add, y.r, y.r, 4); + Put1(Asr, RH, RH, 24); Put3(BC, NE, -6); DEC(RH, 2) + END CopyString; + + (* Code generation for parameters *) + + PROCEDURE VarParam*(VAR x: Item; ftype: ORB.Type); + VAR xmd: INTEGER; + BEGIN xmd := x.mode; loadAdr(x); + IF (ftype.form = ORB.Array) & (ftype.len < 0) THEN (*open array*) + IF x.type.len >= 0 THEN Put1a(Mov, RH, 0, x.type.len) ELSE Put2(Ldr, RH, SP, x.a+4+frame) END ; + incR + ELSIF ftype.form = ORB.Record THEN + IF xmd = ORB.Par THEN Put2(Ldr, RH, SP, x.a+4+frame); incR ELSE loadTypTagAdr(x.type) END + END + END VarParam; + + PROCEDURE ValueParam*(VAR x: Item); + BEGIN load(x) + END ValueParam; + + PROCEDURE OpenArrayParam*(VAR x: Item); + BEGIN loadAdr(x); + IF x.type.len >= 0 THEN Put1a(Mov, RH, 0, x.type.len) ELSE Put2(Ldr, RH, SP, x.a+4+frame) END ; + incR + END OpenArrayParam; + + PROCEDURE StringParam*(VAR x: Item); + BEGIN loadStringAdr(x); Put1(Mov, RH, 0, x.b); incR (*len*) + END StringParam; + + (*For Statements*) + + PROCEDURE For0*(VAR x, y: Item); + BEGIN load(y) + END For0; + + PROCEDURE For1*(VAR x, y, z, w: Item; VAR L: LONGINT); + BEGIN + IF z.mode = ORB.Const THEN Put1a(Cmp, RH, y.r, z.a) + ELSE load(z); Put0(Cmp, RH-1, y.r, z.r); DEC(RH) + END ; + L := pc; + IF w.a > 0 THEN Put3(BC, GT, 0) + ELSIF w.a < 0 THEN Put3(BC, LT, 0) + ELSE ORS.Mark("zero increment"); Put3(BC, MI, 0) + END ; + Store(x, y) + END For1; + + PROCEDURE For2*(VAR x, y, w: Item); + BEGIN load(x); DEC(RH); Put1a(Add, x.r, x.r, w.a) + END For2; + + (* Branches, procedure calls, procedure prolog and epilog *) + + PROCEDURE Here*(): LONGINT; + BEGIN invalSB; RETURN pc + END Here; + + PROCEDURE FJump*(VAR L: LONGINT); + BEGIN Put3(BC, 7, L); L := pc-1 + END FJump; + + PROCEDURE CFJump*(VAR x: Item); + BEGIN + IF x.mode # Cond THEN loadCond(x) END ; + Put3(BC, negated(x.r), x.a); FixLink(x.b); x.a := pc-1 + END CFJump; + + PROCEDURE BJump*(L: LONGINT); + BEGIN Put3(BC, 7, L-pc-1) + END BJump; + + PROCEDURE CBJump*(VAR x: Item; L: LONGINT); + BEGIN + IF x.mode # Cond THEN loadCond(x) END ; + Put3(BC, negated(x.r), L-pc-1); FixLink(x.b); FixLinkWith(x.a, L) + END CBJump; + + PROCEDURE Fixup*(VAR x: Item); + BEGIN FixLink(x.a) + END Fixup; + + PROCEDURE SaveRegs(r: LONGINT); (* R[0 .. r-1]*) + VAR r0: LONGINT; + BEGIN (*r > 0*) r0 := 0; + Put1(Sub, SP, SP, r*4); INC(frame, 4*r); + REPEAT Put2(Str, r0, SP, (r-r0-1)*4); INC(r0) UNTIL r0 = r + END SaveRegs; + + PROCEDURE RestoreRegs(r: LONGINT); (*R[0 .. r-1]*) + VAR r0: LONGINT; + BEGIN (*r > 0*) r0 := r; + REPEAT DEC(r0); Put2(Ldr, r0, SP, (r-r0-1)*4) UNTIL r0 = 0; + Put1(Add, SP, SP, r*4); DEC(frame, 4*r) + END RestoreRegs; + + PROCEDURE PrepCall*(VAR x: Item; VAR r: LONGINT); + BEGIN (*x.type.form = ORB.Proc*) + IF x.mode > ORB.Par THEN load(x) END ; + r := RH; + IF RH > 0 THEN SaveRegs(RH); RH := 0 END + END PrepCall; + + PROCEDURE Call*(VAR x: Item; r: LONGINT); + BEGIN (*x.type.form = ORB.Proc*) + IF x.mode = ORB.Const THEN + IF x.r >= 0 THEN Put3(BL, 7, (x.a DIV 4)-pc-1) + ELSE (*imported*) + IF pc - fixorgP < 1000H THEN + Put3(BL, 7, ((-x.r) * 100H + x.a) * 1000H + pc-fixorgP); fixorgP := pc-1 + ELSE ORS.Mark("fixup impossible") + END + END + ELSE + IF x.mode <= ORB.Par THEN load(x); DEC(RH) + ELSE Put2(Ldr, RH, SP, 0); Put1(Add, SP, SP, 4); DEC(r); DEC(frame, 4) + END ; + IF check THEN Trap(EQ, 5) END ; + Put3(BLR, 7, RH) + END ; + IF x.type.base.form = ORB.NoTyp THEN (*procedure*) RH := 0 + ELSE (*function*) + IF r > 0 THEN Put0(Mov, r, 0, 0); RestoreRegs(r) END ; + x.mode := Reg; x.r := r; RH := r+1 + END ; + invalSB + END Call; + + PROCEDURE Enter*(parblksize, locblksize: LONGINT; int: BOOLEAN); + VAR a, r: LONGINT; + BEGIN invalSB; frame := 0; + IF ~int THEN (*procedure prolog*) + a := 4; r := 0; + Put1(Sub, SP, SP, locblksize); Put2(Str, LNK, SP, 0); + WHILE a < parblksize DO Put2(Str, r, SP, a); INC(r); INC(a, 4) END + ELSE (*interrupt procedure*) + Put1(Sub, SP, SP, 12); Put2(Str, 0, SP, 0); Put2(Str, 1, SP, 4); Put2(Str, SB, SP, 8) + (*R0, R1, SB saved os stack*) + END + END Enter; + + PROCEDURE Return*(form: INTEGER; VAR x: Item; size: LONGINT; int: BOOLEAN); + BEGIN + IF form # ORB.NoTyp THEN load(x) END ; + IF ~int THEN (*procedure epilog*) + Put2(Ldr, LNK, SP, 0); Put1(Add, SP, SP, size); Put3(BR, 7, LNK) + ELSE (*interrupt return, restore SB, R1, R0*) + Put2(Ldr, SB, SP, 8); Put2(Ldr, 1, SP, 4); Put2(Ldr, 0, SP, 0); Put1(Add, SP, SP, 12); Put3(BR, 7, 10H) + END ; + RH := 0 + END Return; + + (* In-line code procedures*) + + PROCEDURE Increment*(upordown: LONGINT; VAR x, y: Item); + VAR op, zr, v: LONGINT; + BEGIN (*frame = 0*) + IF upordown = 0 THEN op := Add ELSE op := Sub END ; + IF x.type = ORB.byteType THEN v := 1 ELSE v := 0 END ; + IF y.type.form = ORB.NoTyp THEN y.mode := ORB.Const; y.a := 1 END ; + IF (x.mode = ORB.Var) & (x.r > 0) THEN + zr := RH; Put2(Ldr+v, zr, SP, x.a); incR; + IF y.mode = ORB.Const THEN Put1a(op, zr, zr, y.a) ELSE load(y); Put0(op, zr, zr, y.r); DEC(RH) END ; + Put2(Str+v, zr, SP, x.a); DEC(RH) + ELSE loadAdr(x); zr := RH; Put2(Ldr+v, RH, x.r, 0); incR; + IF y.mode = ORB.Const THEN Put1a(op, zr, zr, y.a) ELSE load(y); Put0(op, zr, zr, y.r); DEC(RH) END ; + Put2(Str+v, zr, x.r, 0); DEC(RH, 2) + END + END Increment; + + PROCEDURE Include*(inorex: LONGINT; VAR x, y: Item); + VAR op, zr: LONGINT; + BEGIN loadAdr(x); zr := RH; Put2(Ldr, RH, x.r, 0); incR; + IF inorex = 0 THEN op := Ior ELSE op := Ann END ; + IF y.mode = ORB.Const THEN Put1a(op, zr, zr, LSL(1, y.a)) + ELSE load(y); Put1(Mov, RH, 0, 1); Put0(Lsl, y.r, RH, y.r); Put0(op, zr, zr, y.r); DEC(RH) + END ; + Put2(Str, zr, x.r, 0); DEC(RH, 2) + END Include; + + PROCEDURE Assert*(VAR x: Item); + VAR cond: LONGINT; + BEGIN + IF x.mode # Cond THEN loadCond(x) END ; + IF x.a = 0 THEN cond := negated(x.r) + ELSE Put3(BC, x.r, x.b); FixLink(x.a); x.b := pc-1; cond := 7 + END ; + Trap(cond, 7); FixLink(x.b) + END Assert; + + PROCEDURE New*(VAR x: Item); + BEGIN loadAdr(x); loadTypTagAdr(x.type.base); Put3(BLR, 7, MT); RH := 0; invalSB + END New; + + PROCEDURE Pack*(VAR x, y: Item); + VAR z: Item; + BEGIN z := x; load(x); load(y); + Put1(Lsl, y.r, y.r, 23); Put0(Add, x.r, x.r, y.r); DEC(RH); Store(z, x) + END Pack; + + PROCEDURE Unpk*(VAR x, y: Item); + VAR z, e0: Item; + BEGIN z := x; load(x); e0.mode := Reg; e0.r := RH; e0.type := ORB.intType; + Put1(Asr, RH, x.r, 23); Put1(Sub, RH, RH, 127); Store(y, e0); incR; + Put1(Lsl, RH, RH, 23); Put0(Sub, x.r, x.r, RH); Store(z, x) + END Unpk; + + PROCEDURE Led*(VAR x: Item); + BEGIN load(x); Put1(Mov, RH, 0, -60); Put2(Str, x.r, RH, 0); DEC(RH) + END Led; + + PROCEDURE Get*(VAR x, y: Item); + BEGIN load(x); x.type := y.type; x.mode := RegI; x.a := 0; Store(y, x) + END Get; + + PROCEDURE Put*(VAR x, y: Item); + BEGIN load(x); x.type := y.type; x.mode := RegI; x.a := 0; Store(x, y) + END Put; + + PROCEDURE Copy*(VAR x, y, z: Item); + BEGIN load(x); load(y); + IF z.mode = ORB.Const THEN + IF z.a > 0 THEN load(z) ELSE ORS.Mark("bad count") END + ELSE load(z); + IF check THEN Trap(LT, 3) END ; + Put3(BC, EQ, 6) + END ; + Put2(Ldr, RH, x.r, 0); Put1(Add, x.r, x.r, 4); + Put2(Str, RH, y.r, 0); Put1(Add, y.r, y.r, 4); + Put1(Sub, z.r, z.r, 1); Put3(BC, NE, -6); DEC(RH, 3) + END Copy; + + PROCEDURE LDPSR*(VAR x: Item); + BEGIN (*x.mode = Const*) Put3(0, 15, x.a + 20H) + END LDPSR; + + PROCEDURE LDREG*(VAR x, y: Item); + BEGIN + IF y.mode = ORB.Const THEN Put1a(Mov, x.a, 0, y.a) + ELSE load(y); Put0(Mov, x.a, 0, y.r); DEC(RH) + END + END LDREG; + + (*In-line code functions*) + + PROCEDURE Abs*(VAR x: Item); + BEGIN + IF x.mode = ORB.Const THEN x.a := ABS(x.a) + ELSE load(x); + IF x.type.form = ORB.Real THEN Put1(Lsl, x.r, x.r, 1); Put1(Ror, x.r, x.r, 1) + ELSE Put1(Cmp, x.r, x.r, 0); Put3(BC, GE, 2); Put1(Mov, RH, 0, 0); Put0(Sub, x.r, RH, x.r) + END + END + END Abs; + + PROCEDURE Odd*(VAR x: Item); + BEGIN load(x); Put1(And, x.r, x.r, 1); SetCC(x, NE); DEC(RH) + END Odd; + + PROCEDURE Floor*(VAR x: Item); + BEGIN load(x); Put1(Mov+U, RH, 0, 4B00H); Put0(Fad+V, x.r, x.r, RH) + END Floor; + + PROCEDURE Float*(VAR x: Item); + BEGIN load(x); Put1(Mov+U, RH, 0, 4B00H); Put0(Fad+U, x.r, x.r, RH) + END Float; + + PROCEDURE Ord*(VAR x: Item); + BEGIN + IF x.mode IN {ORB.Var, ORB.Par, RegI} THEN load(x) END + END Ord; + + PROCEDURE Len*(VAR x: Item); + BEGIN + IF x.type.len >= 0 THEN x.mode := ORB.Const; x.a := x.type.len + ELSE (*open array*) Put2(Ldr, RH, SP, x.a + 4 + frame); x.mode := Reg; x.r := RH; incR + END + END Len; + + PROCEDURE Shift*(fct: LONGINT; VAR x, y: Item); + VAR op: LONGINT; + BEGIN load(x); + IF fct = 0 THEN op := Lsl ELSIF fct = 1 THEN op := Asr ELSE op := Ror END ; + IF y.mode = ORB.Const THEN Put1(op, x.r, x.r, y.a MOD 20H) + ELSE load(y); Put0(op, RH-2, x.r, y.r); DEC(RH); x.r := RH-1 + END + END Shift; + + PROCEDURE ADC*(VAR x, y: Item); + BEGIN load(x); load(y); Put0(Add+2000H, x.r, x.r, y.r); DEC(RH) + END ADC; + + PROCEDURE SBC*(VAR x, y: Item); + BEGIN load(x); load(y); Put0(Sub+2000H, x.r, x.r, y.r); DEC(RH) + END SBC; + + PROCEDURE UML*(VAR x, y: Item); + BEGIN load(x); load(y); Put0(Mul+2000H, x.r, x.r, y.r); DEC(RH) + END UML; + + PROCEDURE Bit*(VAR x, y: Item); + BEGIN load(x); Put2(Ldr, x.r, x.r, 0); + IF y.mode = ORB.Const THEN Put1(Ror, x.r, x.r, y.a+1); DEC(RH) + ELSE load(y); Put1(Add, y.r, y.r, 1); Put0(Ror, x.r, x.r, y.r); DEC(RH, 2) + END ; + SetCC(x, MI) + END Bit; + + PROCEDURE Register*(VAR x: Item); + BEGIN (*x.mode = Const*) + Put0(Mov, RH, 0, x.a MOD 10H); x.mode := Reg; x.r := RH; incR + END Register; + + PROCEDURE H*(VAR x: Item); + BEGIN (*x.mode = Const*) + Put0(Mov + U + x.a MOD 2 * V, RH, 0, 0); x.mode := Reg; x.r := RH; incR + END H; + + PROCEDURE Adr*(VAR x: Item); + BEGIN + IF x.mode IN {ORB.Var, ORB.Par, RegI} THEN loadAdr(x) + ELSIF (x.mode = ORB.Const) & (x.type.form = ORB.Proc) THEN load(x) + ELSIF (x.mode = ORB.Const) & (x.type.form = ORB.String) THEN loadStringAdr(x) + ELSE ORS.Mark("not addressable") + END + END Adr; + + PROCEDURE Condition*(VAR x: Item); + BEGIN (*x.mode = Const*) SetCC(x, x.a) + END Condition; + + PROCEDURE Open*(v: INTEGER); + BEGIN pc := 0; tdx := 0; strx := 0; RH := 0; fixorgP := 0; fixorgD := 0; fixorgT := 0; check := v # 0; version := v; + IF v = 0 THEN pc := 8 END + END Open; + + PROCEDURE SetDataSize*(dc: LONGINT); + BEGIN varsize := dc + END SetDataSize; + + PROCEDURE Header*; + BEGIN entry := pc*4; + IF version = 0 THEN code[0] := 0E7000000H-1 + pc; Put1a(Mov, SB, 0, VarOrg0); Put1a(Mov, SP, 0, StkOrg0) (*RISC-0*) + ELSE Put1(Sub, SP, SP, 4); Put2(Str, LNK, SP, 0); invalSB + END + END Header; + + PROCEDURE NofPtrs(typ: ORB.Type): LONGINT; + VAR fld: ORB.Object; n: LONGINT; + BEGIN + IF (typ.form = ORB.Pointer) OR (typ.form = ORB.NilTyp) THEN n := 1 + ELSIF typ.form = ORB.Record THEN + fld := typ.dsc; n := 0; + WHILE fld # NIL DO n := NofPtrs(fld.type) + n; fld := fld.next END + ELSIF typ.form = ORB.Array THEN n := NofPtrs(typ.base) * typ.len + ELSE n := 0 + END ; + RETURN n + END NofPtrs; + + PROCEDURE FindPtrs(VAR R: Files.Rider; typ: ORB.Type; adr: LONGINT); + VAR fld: ORB.Object; i, s: LONGINT; + BEGIN + IF (typ.form = ORB.Pointer) OR (typ.form = ORB.NilTyp) THEN Files.WriteInt(R, adr) + ELSIF typ.form = ORB.Record THEN + fld := typ.dsc; + WHILE fld # NIL DO FindPtrs(R, fld.type, fld.val + adr); fld := fld.next END + ELSIF typ.form = ORB.Array THEN + s := typ.base.size; + FOR i := 0 TO typ.len-1 DO FindPtrs(R, typ.base, i*s + adr) END + END + END FindPtrs; + + PROCEDURE Close*(VAR modid: ORS.Ident; key, nofent: LONGINT); + VAR obj: ORB.Object; + i, comsize, nofimps, nofptrs, size: LONGINT; + name: ORS.Ident; + F: Files.File; R: Files.Rider; + BEGIN (*exit code*) + IF version = 0 THEN Put1(Mov, 0, 0, 0); Put3(BR, 7, 0) (*RISC-0*) + ELSE Put2(Ldr, LNK, SP, 0); Put1(Add, SP, SP, 4); Put3(BR, 7, LNK) + END ; + obj := ORB.topScope.next; nofimps := 0; comsize := 4; nofptrs := 0; + WHILE obj # NIL DO + IF (obj.class = ORB.Mod) & (obj.dsc # ORB.system) THEN INC(nofimps) (*count imports*) + ELSIF (obj.exno # 0) & (obj.class = ORB.Const) & (obj.type.form = ORB.Proc) + & (obj.type.nofpar = 0) & (obj.type.base = ORB.noType) THEN i := 0; (*count commands*) + WHILE obj.name[i] # 0X DO INC(i) END ; + i := (i+4) DIV 4 * 4; INC(comsize, i+4) + ELSIF obj.class = ORB.Var THEN INC(nofptrs, NofPtrs(obj.type)) (*count pointers*) + END ; + obj := obj.next + END ; + size := varsize + strx + comsize + (pc + nofimps + nofent + nofptrs + 1)*4; (*varsize includes type descriptors*) + + ORB.MakeFileName(name, modid, ".rsc"); (*write code file*) + F := Files.New(name); Files.Set(R, F, 0); Files.WriteString(R, modid); Files.WriteInt(R, key); + (*Files.WriteByte(R, version);*) (* who writes like that? -- noch *) + Files.WriteByte(R, SHORT(SHORT(version))); (* voc adaptation by noch *) + Files.WriteInt(R, size); + obj := ORB.topScope.next; + WHILE (obj # NIL) & (obj.class = ORB.Mod) DO (*imports*) + IF obj.dsc # ORB.system THEN Files.WriteString(R, obj(ORB.Module).orgname); Files.WriteInt(R, obj.val) END ; + obj := obj.next + END ; + Files.Write(R, 0X); + Files.WriteInt(R, tdx*4); + i := 0; + WHILE i < tdx DO Files.WriteInt(R, data[i]); INC(i) END ; (*type descriptors*) + Files.WriteInt(R, varsize - tdx*4); (*data*) + Files.WriteInt(R, strx); + FOR i := 0 TO strx-1 DO Files.Write(R, str[i]) END ; (*strings*) + Files.WriteInt(R, pc); (*code len*) + FOR i := 0 TO pc-1 DO Files.WriteInt(R, code[i]) END ; (*program*) + obj := ORB.topScope.next; + WHILE obj # NIL DO (*commands*) + IF (obj.exno # 0) & (obj.class = ORB.Const) & (obj.type.form = ORB.Proc) & + (obj.type.nofpar = 0) & (obj.type.base = ORB.noType) THEN + Files.WriteString(R, obj.name); Files.WriteInt(R, obj.val) + END ; + obj := obj.next + END ; + Files.Write(R, 0X); + Files.WriteInt(R, nofent); Files.WriteInt(R, entry); + obj := ORB.topScope.next; + WHILE obj # NIL DO (*entries*) + IF obj.exno # 0 THEN + IF (obj.class = ORB.Const) & (obj.type.form = ORB.Proc) OR (obj.class = ORB.Var) THEN + Files.WriteInt(R, obj.val) + ELSIF obj.class = ORB.Typ THEN + IF obj.type.form = ORB.Record THEN Files.WriteInt(R, obj.type.len MOD 10000H) + ELSIF (obj.type.form = ORB.Pointer) & ((obj.type.base.typobj = NIL) OR (obj.type.base.typobj.exno = 0)) THEN + Files.WriteInt(R, obj.type.base.len MOD 10000H) + END + END + END ; + obj := obj.next + END ; + obj := ORB.topScope.next; + WHILE obj # NIL DO (*pointer variables*) + IF obj.class = ORB.Var THEN FindPtrs(R, obj.type, obj.val) END ; + obj := obj.next + END ; + Files.WriteInt(R, -1); + Files.WriteInt(R, fixorgP); Files.WriteInt(R, fixorgD); Files.WriteInt(R, fixorgT); Files.WriteInt(R, entry); + Files.Write(R, "O"); Files.Register(F) + END Close; + +BEGIN + relmap[0] := 1; relmap[1] := 9; relmap[2] := 5; relmap[3] := 6; relmap[4] := 14; relmap[5] := 13 +END ORG. diff --git a/src/voc07R/ORP.Mod b/src/voc07R/ORP.Mod index 7c59e50f..99e6ee83 100644 --- a/src/voc07R/ORP.Mod +++ b/src/voc07R/ORP.Mod @@ -1,997 +1,997 @@ -MODULE ORP; (*N. Wirth 1.7.97 / 7.6.2014 Oberon compiler for RISC in Oberon-07*) - IMPORT Texts := CompatTexts, Oberon, ORS, ORB, ORG; - (*Author: Niklaus Wirth, 2014. - Parser of Oberon-RISC compiler. Uses Scanner ORS to obtain symbols (tokens), - ORB for definition of data structures and for handling import and export, and - ORG to produce binary code. ORP performs type checking and data allocation. - Parser is target-independent, except for part of the handling of allocations.*) - - TYPE INTEGER = LONGINT; (* voc adaptation by noch *) - - TYPE PtrBase = POINTER TO PtrBaseDesc; - PtrBaseDesc = RECORD (*list of names of pointer base types*) - name: ORS.Ident; type: ORB.Type; next: PtrBase - END ; - - VAR sym: INTEGER; (*last symbol read*) - dc: LONGINT; (*data counter*) - level, exno, version: INTEGER; - newSF: BOOLEAN; (*option flag*) - expression: PROCEDURE (VAR x: ORG.Item); (*to avoid forward reference*) - Type: PROCEDURE (VAR type: ORB.Type); - FormalType: PROCEDURE (VAR typ: ORB.Type; dim: INTEGER); - modid: ORS.Ident; - pbsList: PtrBase; (*list of names of pointer base types*) - dummy: ORB.Object; - W: Texts.Writer; - - PROCEDURE Check(s: INTEGER; msg: ARRAY OF CHAR); - BEGIN - IF sym = s THEN ORS.Get(sym) ELSE ORS.Mark(msg) END - END Check; - - PROCEDURE qualident(VAR obj: ORB.Object); - BEGIN obj := ORB.thisObj(); ORS.Get(sym); - IF obj = NIL THEN ORS.Mark("undef"); obj := dummy END ; - IF (sym = ORS.period) & (obj.class = ORB.Mod) THEN - ORS.Get(sym); - IF sym = ORS.ident THEN obj := ORB.thisimport(obj); ORS.Get(sym); - IF obj = NIL THEN ORS.Mark("undef"); obj := dummy END - ELSE ORS.Mark("identifier expected"); obj := dummy - END - END - END qualident; - - PROCEDURE CheckBool(VAR x: ORG.Item); - BEGIN - IF x.type.form # ORB.Bool THEN ORS.Mark("not Boolean"); x.type := ORB.boolType END - END CheckBool; - - PROCEDURE CheckInt(VAR x: ORG.Item); - BEGIN - IF x.type.form # ORB.Int THEN ORS.Mark("not Integer"); x.type := ORB.intType END - END CheckInt; - - PROCEDURE CheckReal(VAR x: ORG.Item); - BEGIN - IF x.type.form # ORB.Real THEN ORS.Mark("not Real"); x.type := ORB.realType END - END CheckReal; - - PROCEDURE CheckSet(VAR x: ORG.Item); - BEGIN - IF x.type.form # ORB.Set THEN ORS.Mark("not Set"); x.type := ORB.setType END - END CheckSet; - - PROCEDURE CheckSetVal(VAR x: ORG.Item); - BEGIN - IF x.type.form # ORB.Int THEN ORS.Mark("not Int"); x.type := ORB.setType - ELSIF x.mode = ORB.Const THEN - IF (x.a < 0) OR (x.a >= 32) THEN ORS.Mark("invalid set") END - END - END CheckSetVal; - - PROCEDURE CheckConst(VAR x: ORG.Item); - BEGIN - IF x.mode # ORB.Const THEN ORS.Mark("not a constant"); x.mode := ORB.Const END - END CheckConst; - - PROCEDURE CheckReadOnly(VAR x: ORG.Item); - BEGIN - IF x.rdo THEN ORS.Mark("read-only") END - END CheckReadOnly; - - PROCEDURE CheckExport(VAR expo: BOOLEAN); - BEGIN - IF sym = ORS.times THEN - expo := TRUE; ORS.Get(sym); - IF level # 0 THEN ORS.Mark("remove asterisk") END - ELSE expo := FALSE - END - END CheckExport; - - PROCEDURE IsExtension(t0, t1: ORB.Type): BOOLEAN; - BEGIN (*t1 is an extension of t0*) - RETURN (t0 = t1) OR (t1 # NIL) & IsExtension(t0, t1.base) - END IsExtension; - - (* expressions *) - - PROCEDURE TypeTest(VAR x: ORG.Item; T: ORB.Type; guard: BOOLEAN); - VAR xt: ORB.Type; - BEGIN xt := x.type; - WHILE (xt # T) & (xt # NIL) DO xt := xt.base END ; - IF xt # T THEN xt := x.type; - IF (xt.form = ORB.Pointer) & (T.form = ORB.Pointer) THEN - IF IsExtension(xt.base, T.base) THEN ORG.TypeTest(x, T.base, FALSE, guard); x.type := T - ELSE ORS.Mark("not an extension") - END - ELSIF (xt.form = ORB.Record) & (T.form = ORB.Record) & (x.mode = ORB.Par) THEN - IF IsExtension(xt, T) THEN ORG.TypeTest(x, T, TRUE, guard); x.type := T - ELSE ORS.Mark("not an extension") - END - ELSE ORS.Mark("incompatible types") - END - ELSIF ~guard THEN ORG.MakeConstItem(x, ORB.boolType, 1) - END ; - IF ~guard THEN x.type := ORB.boolType END - END TypeTest; - - PROCEDURE selector(VAR x: ORG.Item); - VAR y: ORG.Item; obj: ORB.Object; - BEGIN - WHILE (sym = ORS.lbrak) OR (sym = ORS.period) OR (sym = ORS.arrow) - OR (sym = ORS.lparen) & (x.type.form IN {ORB.Record, ORB.Pointer}) DO - IF sym = ORS.lbrak THEN - REPEAT ORS.Get(sym); expression(y); - IF x.type.form = ORB.Array THEN - CheckInt(y); ORG.Index(x, y); x.type := x.type.base - ELSE ORS.Mark("not an array") - END - UNTIL sym # ORS.comma; - Check(ORS.rbrak, "no ]") - ELSIF sym = ORS.period THEN ORS.Get(sym); - IF sym = ORS.ident THEN - IF x.type.form = ORB.Pointer THEN ORG.DeRef(x); x.type := x.type.base END ; - IF x.type.form = ORB.Record THEN - obj := ORB.thisfield(x.type); ORS.Get(sym); - IF obj # NIL THEN ORG.Field(x, obj); x.type := obj.type - ELSE ORS.Mark("undef") - END - ELSE ORS.Mark("not a record") - END - ELSE ORS.Mark("ident?") - END - ELSIF sym = ORS.arrow THEN - ORS.Get(sym); - IF x.type.form = ORB.Pointer THEN ORG.DeRef(x); x.type := x.type.base - ELSE ORS.Mark("not a pointer") - END - ELSIF (sym = ORS.lparen) & (x.type.form IN {ORB.Record, ORB.Pointer}) THEN (*type guard*) - ORS.Get(sym); - IF sym = ORS.ident THEN - qualident(obj); - IF obj.class = ORB.Typ THEN TypeTest(x, obj.type, TRUE) - ELSE ORS.Mark("guard type expected") - END - ELSE ORS.Mark("not an identifier") - END ; - Check(ORS.rparen, " ) missing") - END - END - END selector; - - PROCEDURE CompTypes(t0, t1: ORB.Type; varpar: BOOLEAN): BOOLEAN; - - PROCEDURE EqualSignatures(t0, t1: ORB.Type): BOOLEAN; - VAR p0, p1: ORB.Object; com: BOOLEAN; - BEGIN com := TRUE; - IF (t0.base = t1.base) & (t0.nofpar = t1.nofpar) THEN - p0 := t0.dsc; p1 := t1.dsc; - WHILE p0 # NIL DO - IF (p0.class = p1.class) & CompTypes(p0.type, p1.type, TRUE) & - (*(ORD(p0.rdo) = ORD(p1.rdo))*) - (p0.rdo = p1.rdo) (* voc adaptation by noch *) - THEN - IF p0.type.form >= ORB.Array THEN com := CompTypes(p0.type, p1.type, (p0.class = ORB.Par)) END ; - p0 := p0.next; p1 := p1.next - ELSE p0 := NIL; com := FALSE - END - END - ELSE com := FALSE - END ; - RETURN com - END EqualSignatures; - - BEGIN (*Compatible Types*) - RETURN (t0 = t1) - OR (t0.form = ORB.Array) & (t1.form = ORB.Array) & CompTypes(t0.base, t1.base, varpar) - OR (t0.form = ORB.Pointer) & (t1.form = ORB.Pointer) & IsExtension(t0.base, t1.base) - OR (t0.form = ORB.Record) & (t1.form = ORB.Record) & IsExtension(t0, t1) - OR (t0.form = ORB.Proc) & (t1.form = ORB.Proc) & EqualSignatures(t0, t1) - OR (t0.form IN {ORB.Pointer, ORB.Proc}) & (t1.form = ORB.NilTyp) - OR (t0.form = ORB.NilTyp) & (t1.form IN {ORB.Pointer, ORB.Proc}) - OR ~varpar & (t0.form = ORB.Int) & (t1.form = ORB.Int) - END CompTypes; - - PROCEDURE Parameter(par: ORB.Object); - VAR x: ORG.Item; varpar: BOOLEAN; - BEGIN expression(x); - IF par # NIL THEN - varpar := par.class = ORB.Par; - IF CompTypes(par.type, x.type, varpar) THEN - IF ~varpar THEN ORG.ValueParam(x) - ELSE (*par.class = Par*) - IF ~par.rdo THEN CheckReadOnly(x) END ; - ORG.VarParam(x, par.type) - END - ELSIF ~varpar & (par.type.form = ORB.Int) & (x.type.form = ORB.Int) THEN - ORG.ValueParam(x) - ELSIF (x.type.form = ORB.String) & (x.b = 2) & (par.class = ORB.Var) & (par.type.form = ORB.Char) THEN - ORG.StrToChar(x); ORG.ValueParam(x) - ELSIF (x.type.form = ORB.Array) & (par.type.form = ORB.Array) & - (x.type.base.form = par.type.base.form) & (par.type.len < 0) THEN - ORG.OpenArrayParam(x); - ELSIF (x.type.form = ORB.String) & varpar & par.rdo & (par.type.form = ORB.Array) & - (par.type.base.form = ORB.Char) & (par.type.len < 0) THEN ORG.StringParam(x) - ELSIF (par.type.form = ORB.Array) & (par.type.base.form = ORB.Int) & (par.type.size = x.type.size) THEN - ORG.VarParam(x, par.type) - ELSE ORS.Mark("incompatible parameters") - END - END - END Parameter; - - PROCEDURE ParamList(VAR x: ORG.Item); - VAR n: INTEGER; par: ORB.Object; - BEGIN par := x.type.dsc; n := 0; - IF sym # ORS.rparen THEN - Parameter(par); n := 1; - WHILE sym <= ORS.comma DO - Check(sym, "comma?"); - IF par # NIL THEN par := par.next END ; - INC(n); Parameter(par) - END ; - Check(ORS.rparen, ") missing") - ELSE ORS.Get(sym); - END ; - IF n < x.type.nofpar THEN ORS.Mark("too few params") - ELSIF n > x.type.nofpar THEN ORS.Mark("too many params") - END - END ParamList; - - PROCEDURE StandFunc(VAR x: ORG.Item; fct: LONGINT; restyp: ORB.Type); - VAR y: ORG.Item; n, npar: LONGINT; - BEGIN Check(ORS.lparen, "no ("); - npar := fct MOD 10; fct := fct DIV 10; expression(x); n := 1; - WHILE sym = ORS.comma DO ORS.Get(sym); expression(y); INC(n) END ; - Check(ORS.rparen, "no )"); - IF n = npar THEN - IF fct = 0 THEN (*ABS*) - IF x.type.form IN {ORB.Int, ORB.Real} THEN ORG.Abs(x); restyp := x.type ELSE ORS.Mark("bad type") END - ELSIF fct = 1 THEN (*ODD*) CheckInt(x); ORG.Odd(x) - ELSIF fct = 2 THEN (*FLOOR*) CheckReal(x); ORG.Floor(x) - ELSIF fct = 3 THEN (*FLT*) CheckInt(x); ORG.Float(x) - ELSIF fct = 4 THEN (*ORD*) - IF x.type.form <= ORB.Proc THEN ORG.Ord(x) - ELSIF (x.type.form = ORB.String) & (x.b = 2) THEN ORG.StrToChar(x) - ELSE ORS.Mark("bad type") - END - ELSIF fct = 5 THEN (*CHR*) CheckInt(x); ORG.Ord(x) - ELSIF fct = 6 THEN (*LEN*) - IF x.type.form = ORB.Array THEN ORG.Len(x) ELSE ORS.Mark("not an array") END - ELSIF fct IN {7, 8, 9} THEN (*LSL, ASR, ROR*) CheckInt(y); - IF x.type.form IN {ORB.Int, ORB.Set} THEN ORG.Shift(fct-7, x, y); restyp := x.type ELSE ORS.Mark("bad type") END - ELSIF fct = 11 THEN (*ADC*) ORG.ADC(x, y) - ELSIF fct = 12 THEN (*SBC*) ORG.SBC(x, y) - ELSIF fct = 13 THEN (*UML*) ORG.UML(x, y) - ELSIF fct = 14 THEN (*BIT*) CheckInt(x); CheckInt(y); ORG.Bit(x, y) - ELSIF fct = 15 THEN (*REG*) CheckConst(x); CheckInt(x); ORG.Register(x) - ELSIF fct = 16 THEN (*VAL*) - IF (x.mode= ORB.Typ) & (x.type.size <= y.type.size) THEN restyp := x.type; x := y - ELSE ORS.Mark("casting not allowed") - END - ELSIF fct = 17 THEN (*ADR*) ORG.Adr(x) - ELSIF fct = 18 THEN (*SIZE*) - IF x.mode = ORB.Typ THEN ORG.MakeConstItem(x, ORB.intType, x.type.size) - ELSE ORS.Mark("must be a type") - END - ELSIF fct = 19 THEN (*COND*) CheckConst(x); CheckInt(x); ORG.Condition(x) - ELSIF fct = 20 THEN (*H*) CheckConst(x); CheckInt(x); ORG.H(x) - END ; - x.type := restyp - ELSE ORS.Mark("wrong nof params") - END - END StandFunc; - - PROCEDURE element(VAR x: ORG.Item); - VAR y: ORG.Item; - BEGIN expression(x); CheckSetVal(x); - IF sym = ORS.upto THEN ORS.Get(sym); expression(y); CheckSetVal(y); ORG.Set(x, y) - ELSE ORG.Singleton(x) - END ; - x.type := ORB.setType - END element; - - PROCEDURE set(VAR x: ORG.Item); - VAR y: ORG.Item; - BEGIN - IF sym >= ORS.if THEN - IF sym # ORS.rbrace THEN ORS.Mark(" } missing") END ; - ORG.MakeConstItem(x, ORB.setType, 0) (*empty set*) - ELSE element(x); - WHILE (sym < ORS.rparen) OR (sym > ORS.rbrace) DO - IF sym = ORS.comma THEN ORS.Get(sym) - ELSIF sym # ORS.rbrace THEN ORS.Mark("missing comma") - END ; - element(y); ORG.SetOp(ORS.plus, x, y) - END - END - END set; - - PROCEDURE factor(VAR x: ORG.Item); - VAR obj: ORB.Object; rx: LONGINT; - BEGIN (*sync*) - IF (sym < ORS.char) OR (sym > ORS.ident) THEN ORS.Mark("expression expected"); - REPEAT ORS.Get(sym) UNTIL (sym >= ORS.char) & (sym <= ORS.ident) - END ; - IF sym = ORS.ident THEN - qualident(obj); - IF obj.class = ORB.SFunc THEN StandFunc(x, obj.val, obj.type) - ELSE ORG.MakeItem(x, obj, level); selector(x); - IF sym = ORS.lparen THEN - ORS.Get(sym); - IF (x.type.form = ORB.Proc) & (x.type.base.form # ORB.NoTyp) THEN - ORG.PrepCall(x, rx); ParamList(x); ORG.Call(x, rx); x.type := x.type.base - ELSE ORS.Mark("not a function"); ParamList(x) - END - END - END - ELSIF sym = ORS.int THEN ORG.MakeConstItem(x, ORB.intType, ORS.ival); ORS.Get(sym) - ELSIF sym = ORS.real THEN ORG.MakeRealItem(x, ORS.rval); ORS.Get(sym) - ELSIF sym = ORS.char THEN ORG.MakeConstItem(x, ORB.charType, ORS.ival); ORS.Get(sym) - ELSIF sym = ORS.nil THEN ORS.Get(sym); ORG.MakeConstItem(x, ORB.nilType, 0) - ELSIF sym = ORS.string THEN ORG.MakeStringItem(x, ORS.slen); ORS.Get(sym) - ELSIF sym = ORS.lparen THEN ORS.Get(sym); expression(x); Check(ORS.rparen, "no )") - ELSIF sym = ORS.lbrace THEN ORS.Get(sym); set(x); Check(ORS.rbrace, "no }") - ELSIF sym = ORS.not THEN ORS.Get(sym); factor(x); CheckBool(x); ORG.Not(x) - ELSIF sym = ORS.false THEN ORS.Get(sym); ORG.MakeConstItem(x, ORB.boolType, 0) - ELSIF sym = ORS.true THEN ORS.Get(sym); ORG.MakeConstItem(x, ORB.boolType, 1) - ELSE ORS.Mark("not a factor"); ORG.MakeItem(x, NIL, level) - END - END factor; - - PROCEDURE term(VAR x: ORG.Item); - VAR y: ORG.Item; op, f: INTEGER; - BEGIN factor(x); f := x.type.form; - WHILE (sym >= ORS.times) & (sym <= ORS.and) DO - op := sym; ORS.Get(sym); - IF op = ORS.times THEN - IF f = ORB.Int THEN factor(y); CheckInt(y); ORG.MulOp(x, y) - ELSIF f = ORB.Real THEN factor(y); CheckReal(y); ORG.RealOp(op, x, y) - ELSIF f = ORB.Set THEN factor(y); CheckSet(y); ORG.SetOp(op, x, y) - ELSE ORS.Mark("bad type") - END - ELSIF (op = ORS.div) OR (op = ORS.mod) THEN - CheckInt(x); factor(y); CheckInt(y); ORG.DivOp(op, x, y) - ELSIF op = ORS.rdiv THEN - IF f = ORB.Real THEN factor(y); CheckReal(y); ORG.RealOp(op, x, y) - ELSIF f = ORB.Set THEN factor(y); CheckSet(y); ORG.SetOp(op, x, y) - ELSE ORS.Mark("bad type") - END - ELSE (*op = and*) CheckBool(x); ORG.And1(x); factor(y); CheckBool(y); ORG.And2(x, y) - END - END - END term; - - PROCEDURE SimpleExpression(VAR x: ORG.Item); - VAR y: ORG.Item; op: INTEGER; - BEGIN - IF sym = ORS.minus THEN ORS.Get(sym); term(x); - IF x.type.form IN {ORB.Int, ORB.Real, ORB.Set} THEN ORG.Neg(x) ELSE CheckInt(x) END - ELSIF sym = ORS.plus THEN ORS.Get(sym); term(x); - ELSE term(x) - END ; - WHILE (sym >= ORS.plus) & (sym <= ORS.or) DO - op := sym; ORS.Get(sym); - IF op = ORS.or THEN ORG.Or1(x); CheckBool(x); term(y); CheckBool(y); ORG.Or2(x, y) - ELSIF x.type.form = ORB.Int THEN term(y); CheckInt(y); ORG.AddOp(op, x, y) - ELSIF x.type.form = ORB.Real THEN term(y); CheckReal(y); ORG.RealOp(op, x, y) - ELSE CheckSet(x); term(y); CheckSet(y); ORG.SetOp(op, x, y) - END - END - END SimpleExpression; - - PROCEDURE expression0(VAR x: ORG.Item); - VAR y: ORG.Item; obj: ORB.Object; rel, xf, yf: INTEGER; - BEGIN SimpleExpression(x); - IF (sym >= ORS.eql) & (sym <= ORS.geq) THEN - rel := sym; ORS.Get(sym); SimpleExpression(y); xf := x.type.form; yf := y.type.form; - IF CompTypes(x.type, y.type, FALSE) OR - (xf = ORB.Pointer) & (yf = ORB.Pointer) & IsExtension(y.type.base, x.type.base) THEN - IF (xf IN {ORB.Char, ORB.Int}) THEN ORG.IntRelation(rel, x, y) - ELSIF xf = ORB.Real THEN ORG.RealRelation(rel, x, y) - ELSIF xf = ORB.Set THEN ORG.SetRelation(rel, x, y) - ELSIF (xf IN {ORB.Pointer, ORB.Proc, ORB.NilTyp}) THEN - IF rel <= ORS.neq THEN ORG.IntRelation(rel, x, y) ELSE ORS.Mark("only = or #") END - ELSIF (xf = ORB.Array) & (x.type.base.form = ORB.Char) OR (xf = ORB.String) THEN - ORG.StringRelation(rel, x, y) - ELSE ORS.Mark("illegal comparison") - END - ELSIF (xf = ORB.Array) & (x.type.base.form = ORB.Char) & - ((yf = ORB.String) OR (yf = ORB.Array) & (y.type.base.form = ORB.Char)) - OR (yf = ORB.Array) & (y.type.base.form = ORB.Char) & (xf = ORB.String) THEN - ORG.StringRelation(rel, x, y) - ELSIF (xf = ORB.Char) & (yf = ORB.String) & (y.b = 2) THEN - ORG.StrToChar(y); ORG.IntRelation(rel, x, y) - ELSIF (yf = ORB.Char) & (xf = ORB.String) & (x.b = 2) THEN - ORG.StrToChar(x); ORG.IntRelation(rel, x, y) - ELSE ORS.Mark("illegal comparison") - END ; - x.type := ORB.boolType - ELSIF sym = ORS.in THEN - ORS.Get(sym); SimpleExpression(y); - IF (x.type.form = ORB.Int) & (y.type.form = ORB.Set) THEN ORG.In(x, y) - ELSE ORS.Mark("illegal operands of IN") - END ; - x.type := ORB.boolType - ELSIF sym = ORS.is THEN - ORS.Get(sym); qualident(obj); TypeTest(x, obj.type, FALSE) ; - x.type := ORB.boolType - END - END expression0; - - (* statements *) - - PROCEDURE StandProc(pno: LONGINT); - VAR nap, npar: LONGINT; (*nof actual/formal parameters*) - x, y, z: ORG.Item; - BEGIN Check(ORS.lparen, "no ("); - npar := pno MOD 10; pno := pno DIV 10; expression(x); nap := 1; - IF sym = ORS.comma THEN - ORS.Get(sym); expression(y); nap := 2; z.type := ORB.noType; - WHILE sym = ORS.comma DO ORS.Get(sym); expression(z); INC(nap) END - ELSE y.type := ORB.noType - END ; - Check(ORS.rparen, "no )"); - IF (npar = nap) OR (pno IN {0, 1}) THEN - IF pno IN {0, 1} THEN (*INC, DEC*) - CheckInt(x); CheckReadOnly(x); - IF y.type # ORB.noType THEN CheckInt(y) END ; - ORG.Increment(pno, x, y) - ELSIF pno IN {2, 3} THEN (*INCL, EXCL*) - CheckSet(x); CheckReadOnly(x); CheckInt(y); ORG.Include(pno-2, x, y) - ELSIF pno = 4 THEN CheckBool(x); ORG.Assert(x) - ELSIF pno = 5 THEN(*NEW*) CheckReadOnly(x); - IF (x.type.form = ORB.Pointer) & (x.type.base.form = ORB.Record) THEN ORG.New(x) - ELSE ORS.Mark("not a pointer to record") - END - ELSIF pno = 6 THEN CheckReal(x); CheckInt(y); CheckReadOnly(x); ORG.Pack(x, y) - ELSIF pno = 7 THEN CheckReal(x); CheckInt(y); CheckReadOnly(x); ORG.Unpk(x, y) - ELSIF pno = 8 THEN - IF x.type.form <= ORB.Set THEN ORG.Led(x) ELSE ORS.Mark("bad type") END - ELSIF pno = 10 THEN CheckInt(x); ORG.Get(x, y) - ELSIF pno = 11 THEN CheckInt(x); ORG.Put(x, y) - ELSIF pno = 12 THEN CheckInt(x); CheckInt(y); CheckInt(z); ORG.Copy(x, y, z) - ELSIF pno = 13 THEN CheckConst(x); CheckInt(x); ORG.LDPSR(x) - ELSIF pno = 14 THEN CheckInt(x); ORG.LDREG(x, y) - END - ELSE ORS.Mark("wrong nof parameters") - END - END StandProc; - - PROCEDURE StatSequence; - VAR obj: ORB.Object; - orgtype: ORB.Type; (*original type of case var*) - x, y, z, w: ORG.Item; - L0, L1, rx: LONGINT; - - PROCEDURE TypeCase(obj: ORB.Object; VAR x: ORG.Item); - VAR typobj: ORB.Object; - BEGIN - IF sym = ORS.ident THEN - qualident(typobj); ORG.MakeItem(x, obj, level); - IF typobj.class # ORB.Typ THEN ORS.Mark("not a type") END ; - TypeTest(x, typobj.type, FALSE); obj.type := typobj.type; - ORG.CFJump(x); Check(ORS.colon, ": expected"); StatSequence - ELSE ORG.CFJump(x); ORS.Mark("type id expected") - END - END TypeCase; - - PROCEDURE SkipCase; - BEGIN - WHILE sym # ORS.colon DO ORS.Get(sym) END ; - ORS.Get(sym); StatSequence - END SkipCase; - - BEGIN (* StatSequence *) - REPEAT (*sync*) obj := NIL; - IF ~((sym = ORS.ident) OR (sym >= ORS.if) & (sym <= ORS.for) OR (sym >= ORS.semicolon)) THEN - ORS.Mark("statement expected"); - REPEAT ORS.Get(sym) UNTIL (sym = ORS.ident) OR (sym >= ORS.if) - END ; - IF sym = ORS.ident THEN - qualident(obj); ORG.MakeItem(x, obj, level); - IF x.mode = ORB.SProc THEN StandProc(obj.val) - ELSE selector(x); - IF sym = ORS.becomes THEN (*assignment*) - ORS.Get(sym); CheckReadOnly(x); expression(y); - IF CompTypes(x.type, y.type, FALSE) OR (x.type.form = ORB.Int) & (y.type.form = ORB.Int) THEN - IF (x.type.form <= ORB.Pointer) OR (x.type.form = ORB.Proc) THEN ORG.Store(x, y) - ELSIF y.type.size # 0 THEN ORG.StoreStruct(x, y) - END - ELSIF (x.type.form = ORB.Char) & (y.type.form = ORB.String) & (y.b = 2) THEN - ORG.StrToChar(y); ORG.Store(x, y) - ELSIF (x.type.form = ORB.Array) & (x.type.base.form = ORB.Char) & - (y.type.form = ORB.String) THEN ORG.CopyString(y, x) - ELSE ORS.Mark("illegal assignment") - END - ELSIF sym = ORS.eql THEN ORS.Mark("should be :="); ORS.Get(sym); expression(y) - ELSIF sym = ORS.lparen THEN (*procedure call*) - ORS.Get(sym); - IF (x.type.form = ORB.Proc) & (x.type.base.form = ORB.NoTyp) THEN - ORG.PrepCall(x, rx); ParamList(x); ORG.Call(x, rx) - ELSE ORS.Mark("not a procedure"); ParamList(x) - END - ELSIF x.type.form = ORB.Proc THEN (*procedure call without parameters*) - IF x.type.nofpar > 0 THEN ORS.Mark("missing parameters") END ; - IF x.type.base.form = ORB.NoTyp THEN ORG.PrepCall(x, rx); ORG.Call(x, rx) ELSE ORS.Mark("not a procedure") END - ELSIF x.mode = ORB.Typ THEN ORS.Mark("illegal assignment") - ELSE ORS.Mark("not a procedure") - END - END - ELSIF sym = ORS.if THEN - ORS.Get(sym); expression(x); CheckBool(x); ORG.CFJump(x); - Check(ORS.then, "no THEN"); - StatSequence; L0 := 0; - WHILE sym = ORS.elsif DO - ORS.Get(sym); ORG.FJump(L0); ORG.Fixup(x); expression(x); CheckBool(x); - ORG.CFJump(x); Check(ORS.then, "no THEN"); StatSequence - END ; - IF sym = ORS.else THEN ORS.Get(sym); ORG.FJump(L0); ORG.Fixup(x); StatSequence - ELSE ORG.Fixup(x) - END ; - ORG.FixLink(L0); Check(ORS.end, "no END") - ELSIF sym = ORS.while THEN - ORS.Get(sym); L0 := ORG.Here(); expression(x); CheckBool(x); ORG.CFJump(x); - Check(ORS.do, "no DO"); StatSequence; ORG.BJump(L0); - WHILE sym = ORS.elsif DO - ORS.Get(sym); ORG.Fixup(x); expression(x); CheckBool(x); ORG.CFJump(x); - Check(ORS.do, "no DO"); StatSequence; ORG.BJump(L0) - END ; - ORG.Fixup(x); Check(ORS.end, "no END") - ELSIF sym = ORS.repeat THEN - ORS.Get(sym); L0 := ORG.Here(); StatSequence; - IF sym = ORS.until THEN - ORS.Get(sym); expression(x); CheckBool(x); ORG.CBJump(x, L0) - ELSE ORS.Mark("missing UNTIL") - END - ELSIF sym = ORS.for THEN - ORS.Get(sym); - IF sym = ORS.ident THEN - qualident(obj); ORG.MakeItem(x, obj, level); CheckInt(x); CheckReadOnly(x); - IF sym = ORS.becomes THEN - ORS.Get(sym); expression(y); CheckInt(y); ORG.For0(x, y); L0 := ORG.Here(); - Check(ORS.to, "no TO"); expression(z); CheckInt(z); obj.rdo := TRUE; - IF sym = ORS.by THEN ORS.Get(sym); expression(w); CheckConst(w); CheckInt(w) - ELSE ORG.MakeConstItem(w, ORB.intType, 1) - END ; - Check(ORS.do, "no DO"); ORG.For1(x, y, z, w, L1); - StatSequence; Check(ORS.end, "no END"); - ORG.For2(x, y, w); ORG.BJump(L0); ORG.FixLink(L1); obj.rdo := FALSE - ELSE ORS.Mark(":= expected") - END - ELSE ORS.Mark("identifier expected") - END - ELSIF sym = ORS.case THEN - ORS.Get(sym); - IF sym = ORS.ident THEN - qualident(obj); orgtype := obj.type; - IF (orgtype.form = ORB.Pointer) OR (orgtype.form = ORB.Record) & (obj.class = ORB.Par) THEN - Check(ORS.of, "OF expected"); TypeCase(obj, x); L0 := 0; - WHILE sym = ORS.bar DO - ORS.Get(sym); ORG.FJump(L0); ORG.Fixup(x); obj.type := orgtype; TypeCase(obj, x) - END ; - ORG.Fixup(x); ORG.FixLink(L0); obj.type := orgtype - ELSE ORS.Mark("numeric case not implemented"); - Check(ORS.of, "OF expected"); SkipCase; - WHILE sym = ORS.bar DO SkipCase END - END - ELSE ORS.Mark("ident expected") - END ; - Check(ORS.end, "no END") - END ; - ORG.CheckRegs; - IF sym = ORS.semicolon THEN ORS.Get(sym) - ELSIF sym < ORS.semicolon THEN ORS.Mark("missing semicolon?") - END - UNTIL sym > ORS.semicolon - END StatSequence; - - (* Types and declarations *) - - PROCEDURE IdentList(class: INTEGER; VAR first: ORB.Object); - VAR obj: ORB.Object; - BEGIN - IF sym = ORS.ident THEN - ORB.NewObj(first, ORS.id, class); ORS.Get(sym); CheckExport(first.expo); - WHILE sym = ORS.comma DO - ORS.Get(sym); - IF sym = ORS.ident THEN ORB.NewObj(obj, ORS.id, class); ORS.Get(sym); CheckExport(obj.expo) - ELSE ORS.Mark("ident?") - END - END; - IF sym = ORS.colon THEN ORS.Get(sym) ELSE ORS.Mark(":?") END - ELSE first := NIL - END - END IdentList; - - PROCEDURE ArrayType(VAR type: ORB.Type); - VAR x: ORG.Item; typ: ORB.Type; len: LONGINT; - BEGIN NEW(typ); typ.form := ORB.NoTyp; - IF sym = ORS.of THEN (*dynamic array*) len := -1 - ELSE expression(x); - IF (x.mode = ORB.Const) & (x.type.form = ORB.Int) & (x.a >= 0) THEN len := x.a - ELSE len := 0; ORS.Mark("not a valid length") - END - END ; - IF sym = ORS.of THEN ORS.Get(sym); Type(typ.base); - IF (typ.base.form = ORB.Array) & (typ.base.len < 0) THEN ORS.Mark("dyn array not allowed") END - ELSIF sym = ORS.comma THEN ORS.Get(sym); ArrayType(typ.base) - ELSE ORS.Mark("missing OF"); typ.base := ORB.intType - END ; - IF len >= 0 THEN typ.size := (len * typ.base.size + 3) DIV 4 * 4 ELSE typ.size := 2*ORG.WordSize (*array desc*) END ; - typ.form := ORB.Array; typ.len := len; type := typ - END ArrayType; - - PROCEDURE RecordType(VAR type: ORB.Type); - VAR obj, obj0, new, bot, base: ORB.Object; - typ, tp: ORB.Type; - offset, off, n: LONGINT; - BEGIN NEW(typ); typ.form := ORB.NoTyp; typ.base := NIL; typ.mno := -level; typ.nofpar := 0; offset := 0; bot := NIL; - IF sym = ORS.lparen THEN - ORS.Get(sym); (*record extension*) - IF level # 0 THEN ORS.Mark("extension of local types not implemented") END ; - IF sym = ORS.ident THEN - qualident(base); - IF base.class = ORB.Typ THEN - IF base.type.form = ORB.Record THEN typ.base := base.type - ELSE typ.base := ORB.intType; ORS.Mark("invalid extension") - END ; - typ.nofpar := typ.base.nofpar + 1; (*"nofpar" here abused for extension level*) - bot := typ.base.dsc; offset := typ.base.size - ELSE ORS.Mark("type expected") - END - ELSE ORS.Mark("ident expected") - END ; - Check(ORS.rparen, "no )") - END ; - WHILE sym = ORS.ident DO (*fields*) - n := 0; obj := bot; - WHILE sym = ORS.ident DO - obj0 := obj; - WHILE (obj0 # NIL) & (obj0.name # ORS.id) DO obj0 := obj0.next END ; - IF obj0 # NIL THEN ORS.Mark("mult def") END ; - NEW(new); ORS.CopyId(new.name); new.class := ORB.Fld; new.next := obj; obj := new; INC(n); - ORS.Get(sym); CheckExport(new.expo); - IF (sym # ORS.comma) & (sym # ORS.colon) THEN ORS.Mark("comma expected") - ELSIF sym = ORS.comma THEN ORS.Get(sym) - END - END ; - Check(ORS.colon, "colon expected"); Type(tp); - IF (tp.form = ORB.Array) & (tp.len < 0) THEN ORS.Mark("dyn array not allowed") END ; - IF tp.size > 1 THEN offset := (offset+3) DIV 4 * 4 END ; - offset := offset + n * tp.size; off := offset; obj0 := obj; - WHILE obj0 # bot DO obj0.type := tp; obj0.lev := 0; off := off - tp.size; obj0.val := off; obj0 := obj0.next END ; - bot := obj; - IF sym = ORS.semicolon THEN ORS.Get(sym) ELSIF sym # ORS.end THEN ORS.Mark(" ; or END") END - END ; - typ.form := ORB.Record; typ.dsc := bot; typ.size := (offset + 3) DIV 4 * 4; type := typ - END RecordType; - - PROCEDURE FPSection(VAR adr: LONGINT; VAR nofpar: INTEGER); - VAR obj, first: ORB.Object; tp: ORB.Type; - parsize: LONGINT; cl: INTEGER; rdo: BOOLEAN; - BEGIN - IF sym = ORS.var THEN ORS.Get(sym); cl := ORB.Par ELSE cl := ORB.Var END ; - IdentList(cl, first); FormalType(tp, 0); rdo := FALSE; - IF (cl = ORB.Var) & (tp.form >= ORB.Array) THEN cl := ORB.Par; rdo := TRUE END ; - IF (tp.form = ORB.Array) & (tp.len < 0) OR (tp.form = ORB.Record) THEN - parsize := 2*ORG.WordSize (*open array or record, needs second word for length or type tag*) - ELSE parsize := ORG.WordSize - END ; - obj := first; - WHILE obj # NIL DO - INC(nofpar); obj.class := cl; obj.type := tp; obj.rdo := rdo; obj.lev := level; obj.val := adr; - adr := adr + parsize; obj := obj.next - END ; - IF adr >= 52 THEN ORS.Mark("too many parameters") END - END FPSection; - - PROCEDURE ProcedureType(ptype: ORB.Type; VAR parblksize: LONGINT); - VAR obj: ORB.Object; size: LONGINT; nofpar: INTEGER; - BEGIN ptype.base := ORB.noType; size := parblksize; nofpar := 0; ptype.dsc := NIL; - IF sym = ORS.lparen THEN - ORS.Get(sym); - IF sym = ORS.rparen THEN ORS.Get(sym) - ELSE FPSection(size, nofpar); - WHILE sym = ORS.semicolon DO ORS.Get(sym); FPSection(size, nofpar) END ; - Check(ORS.rparen, "no )") - END ; - ptype.nofpar := nofpar; parblksize := size; - IF sym = ORS.colon THEN (*function*) - ORS.Get(sym); - IF sym = ORS.ident THEN qualident(obj); - IF (obj.class = ORB.Typ) & (obj.type.form IN {ORB.Byte .. ORB.Pointer, ORB.Proc}) THEN ptype.base := obj.type - ELSE ORS.Mark("illegal function type") - END - ELSE ORS.Mark("type identifier expected") - END - END - END - END ProcedureType; - - PROCEDURE FormalType0(VAR typ: ORB.Type; dim: INTEGER); - VAR obj: ORB.Object; dmy: LONGINT; - BEGIN - IF sym = ORS.ident THEN - qualident(obj); - IF obj.class = ORB.Typ THEN typ := obj.type ELSE ORS.Mark("not a type"); typ := ORB.intType END - ELSIF sym = ORS.array THEN - ORS.Get(sym); Check(ORS.of, "OF ?"); - IF dim >= 1 THEN ORS.Mark("multi-dimensional open arrays not implemented") END ; - NEW(typ); typ.form := ORB.Array; typ.len := -1; typ.size := 2*ORG.WordSize; - FormalType(typ.base, dim+1) - ELSIF sym = ORS.procedure THEN - ORS.Get(sym); ORB.OpenScope; - NEW(typ); typ.form := ORB.Proc; typ.size := ORG.WordSize; dmy := 0; ProcedureType(typ, dmy); - typ.dsc := ORB.topScope.next; ORB.CloseScope - ELSE ORS.Mark("identifier expected"); typ := ORB.noType - END - END FormalType0; - - PROCEDURE CheckRecLevel(lev: INTEGER); - BEGIN - IF lev # 0 THEN ORS.Mark("ptr base must be global") END - END CheckRecLevel; - - PROCEDURE Type0(VAR type: ORB.Type); - VAR dmy: LONGINT; obj: ORB.Object; ptbase: PtrBase; - BEGIN type := ORB.intType; (*sync*) - IF (sym # ORS.ident) & (sym < ORS.array) THEN ORS.Mark("not a type"); - REPEAT ORS.Get(sym) UNTIL (sym = ORS.ident) OR (sym >= ORS.array) - END ; - IF sym = ORS.ident THEN - qualident(obj); - IF obj.class = ORB.Typ THEN - IF (obj.type # NIL) & (obj.type.form # ORB.NoTyp) THEN type := obj.type END - ELSE ORS.Mark("not a type or undefined") - END - ELSIF sym = ORS.array THEN ORS.Get(sym); ArrayType(type) - ELSIF sym = ORS.record THEN - ORS.Get(sym); RecordType(type); Check(ORS.end, "no END") - ELSIF sym = ORS.pointer THEN - ORS.Get(sym); Check(ORS.to, "no TO"); - NEW(type); type.form := ORB.Pointer; type.size := ORG.WordSize; type.base := ORB.intType; - IF sym = ORS.ident THEN - obj := ORB.thisObj(); ORS.Get(sym); - IF obj # NIL THEN - IF (obj.class = ORB.Typ) & (obj.type.form IN {ORB.Record, ORB.NoTyp}) THEN - CheckRecLevel(obj.lev); type.base := obj.type - ELSE ORS.Mark("no valid base type") - END - ELSE CheckRecLevel(level); (*enter into list of forward references to be fixed in Declarations*) - NEW(ptbase); ORS.CopyId(ptbase.name); ptbase.type := type; ptbase.next := pbsList; pbsList := ptbase - END - ELSE Type(type.base); - IF type.base.form # ORB.Record THEN ORS.Mark("must point to record") END ; - CheckRecLevel(level) - END - ELSIF sym = ORS.procedure THEN - ORS.Get(sym); ORB.OpenScope; - NEW(type); type.form := ORB.Proc; type.size := ORG.WordSize; dmy := 0; - ProcedureType(type, dmy); type.dsc := ORB.topScope.next; ORB.CloseScope - ELSE ORS.Mark("illegal type") - END - END Type0; - - PROCEDURE Declarations(VAR varsize: LONGINT); - VAR obj, first: ORB.Object; - x: ORG.Item; tp: ORB.Type; ptbase: PtrBase; - expo: BOOLEAN; id: ORS.Ident; - BEGIN (*sync*) pbsList := NIL; - IF (sym < ORS.const) & (sym # ORS.end) THEN ORS.Mark("declaration?"); - REPEAT ORS.Get(sym) UNTIL (sym >= ORS.const) OR (sym = ORS.end) - END ; - IF sym = ORS.const THEN - ORS.Get(sym); - WHILE sym = ORS.ident DO - ORS.CopyId(id); ORS.Get(sym); CheckExport(expo); - IF sym = ORS.eql THEN ORS.Get(sym) ELSE ORS.Mark("= ?") END; - expression(x); - IF (x.type.form = ORB.String) & (x.b = 2) THEN ORG.StrToChar(x) END ; - ORB.NewObj(obj, id, ORB.Const); obj.expo := expo; - IF x.mode = ORB.Const THEN obj.val := x.a; obj.lev := x.b; obj.type := x.type - ELSE ORS.Mark("expression not constant"); obj.type := ORB.intType - END; - Check(ORS.semicolon, "; missing") - END - END ; - IF sym = ORS.type THEN - ORS.Get(sym); - WHILE sym = ORS.ident DO - ORS.CopyId(id); ORS.Get(sym); CheckExport(expo); - IF sym = ORS.eql THEN ORS.Get(sym) ELSE ORS.Mark("=?") END ; - Type(tp); - ORB.NewObj(obj, id, ORB.Typ); obj.type := tp; obj.expo := expo; obj.lev := level; tp.typobj := obj; - IF expo & (obj.type.form = ORB.Record) THEN obj.exno := exno; INC(exno) ELSE obj.exno := 0 END ; - IF tp.form = ORB.Record THEN - ptbase := pbsList; (*check whether this is base of a pointer type; search and fixup*) - WHILE ptbase # NIL DO - IF obj.name = ptbase.name THEN ptbase.type.base := obj.type END ; - ptbase := ptbase.next - END ; - IF level = 0 THEN ORG.BuildTD(tp, dc) END (*type descriptor; len used as its address*) - END ; - Check(ORS.semicolon, "; missing") - END - END ; - IF sym = ORS.var THEN - ORS.Get(sym); - WHILE sym = ORS.ident DO - IdentList(ORB.Var, first); Type(tp); - obj := first; - WHILE obj # NIL DO - obj.type := tp; obj.lev := level; - IF tp.size > 1 THEN varsize := (varsize + 3) DIV 4 * 4 (*align*) END ; - obj.val := varsize; varsize := varsize + obj.type.size; - IF obj.expo THEN obj.exno := exno; INC(exno) END ; - obj := obj.next - END ; - Check(ORS.semicolon, "; missing") - END - END ; - varsize := (varsize + 3) DIV 4 * 4; - ptbase := pbsList; - WHILE ptbase # NIL DO - IF ptbase.type.base.form = ORB.Int THEN ORS.Mark("undefined pointer base of") END ; - ptbase := ptbase.next - END ; - IF (sym >= ORS.const) & (sym <= ORS.var) THEN ORS.Mark("declaration in bad order") END - END Declarations; - - PROCEDURE ProcedureDecl; - VAR proc: ORB.Object; - type: ORB.Type; - procid: ORS.Ident; - x: ORG.Item; - locblksize, parblksize, L: LONGINT; - int: BOOLEAN; - BEGIN (* ProcedureDecl *) int := FALSE; ORS.Get(sym); - IF sym = ORS.times THEN ORS.Get(sym); int := TRUE END ; - IF sym = ORS.ident THEN - ORS.CopyId(procid); ORS.Get(sym); - ORB.NewObj(proc, ORS.id, ORB.Const); parblksize := 4; - NEW(type); type.form := ORB.Proc; type.size := ORG.WordSize; proc.type := type; - CheckExport(proc.expo); - IF proc.expo THEN proc.exno := exno; INC(exno) END ; - ORB.OpenScope; INC(level); proc.val := -1; type.base := ORB.noType; - ProcedureType(type, parblksize); (*formal parameter list*) - Check(ORS.semicolon, "no ;"); locblksize := parblksize; - Declarations(locblksize); - proc.val := ORG.Here() * 4; proc.type.dsc := ORB.topScope.next; - IF sym = ORS.procedure THEN - L := 0; ORG.FJump(L); - REPEAT ProcedureDecl; Check(ORS.semicolon, "no ;") UNTIL sym # ORS.procedure; - ORG.FixLink(L); proc.val := ORG.Here() * 4; proc.type.dsc := ORB.topScope.next - END ; - ORG.Enter(parblksize, locblksize, int); - IF sym = ORS.begin THEN ORS.Get(sym); StatSequence END ; - IF sym = ORS.return THEN - ORS.Get(sym); expression(x); - IF type.base = ORB.noType THEN ORS.Mark("this is not a function") - ELSIF ~CompTypes(type.base, x.type, FALSE) THEN ORS.Mark("wrong result type") - END - ELSIF type.base.form # ORB.NoTyp THEN - ORS.Mark("function without result"); type.base := ORB.noType - END ; - ORG.Return(type.base.form, x, locblksize, int); - ORB.CloseScope; DEC(level); Check(ORS.end, "no END"); - IF sym = ORS.ident THEN - IF ORS.id # procid THEN ORS.Mark("no match") END ; - ORS.Get(sym) - ELSE ORS.Mark("no proc id") - END - END ; - int := FALSE - END ProcedureDecl; - - PROCEDURE Module; - VAR key: LONGINT; - obj: ORB.Object; - impid, impid1: ORS.Ident; - BEGIN Texts.WriteString(W, " compiling "); ORS.Get(sym); - IF sym = ORS.module THEN - ORS.Get(sym); - IF sym = ORS.times THEN version := 0; Texts.Write(W, "*"); ORS.Get(sym) ELSE version := 1 END ; - ORB.Init; ORB.OpenScope; - IF sym = ORS.ident THEN - ORS.CopyId(modid); ORS.Get(sym); - Texts.WriteString(W, modid); Texts.Append(Oberon.Log, W.buf); - Oberon.DumpLog; (* voc adaptation; -- noch *) - ELSE ORS.Mark("identifier expected") - END ; - Check(ORS.semicolon, "no ;"); level := 0; dc := 0; exno := 1; key := 0; - IF sym = ORS.import THEN - ORS.Get(sym); - WHILE sym = ORS.ident DO - ORS.CopyId(impid); ORS.Get(sym); - IF sym = ORS.becomes THEN - ORS.Get(sym); - IF sym = ORS.ident THEN ORS.CopyId(impid1); ORS.Get(sym) - ELSE ORS.Mark("id expected") - END - ELSE impid1 := impid - END ; - ORB.Import(impid, impid1); - IF sym = ORS.comma THEN ORS.Get(sym) - ELSIF sym = ORS.ident THEN ORS.Mark("comma missing") - END - END ; - Check(ORS.semicolon, "no ;") - END ; - obj := ORB.topScope.next; - ORG.Open(version); Declarations(dc); ORG.SetDataSize((dc + 3) DIV 4 * 4); - WHILE sym = ORS.procedure DO ProcedureDecl; Check(ORS.semicolon, "no ;") END ; - ORG.Header; - IF sym = ORS.begin THEN ORS.Get(sym); StatSequence END ; - Check(ORS.end, "no END"); - IF sym = ORS.ident THEN - IF ORS.id # modid THEN ORS.Mark("no match") END ; - ORS.Get(sym) - ELSE ORS.Mark("identifier missing") - END ; - IF sym # ORS.period THEN ORS.Mark("period missing") END ; - IF (ORS.errcnt = 0) & (version # 0) THEN - ORB.Export(modid, newSF, key); - IF newSF THEN Texts.WriteString(W, " new symbol file") END - END ; - IF ORS.errcnt = 0 THEN - ORG.Close(modid, key, exno); - Texts.WriteInt(W, ORG.pc, 6); Texts.WriteInt(W, dc, 6); Texts.WriteHex(W, key) - ELSE Texts.WriteLn(W); Texts.WriteString(W, "compilation FAILED") - END ; - Texts.WriteLn(W); Texts.Append(Oberon.Log, W.buf); - Oberon.DumpLog; (* voc adaptation; -- noch *) - ORB.CloseScope; pbsList := NIL - ELSE ORS.Mark("must start with MODULE") - END - END Module; - - PROCEDURE Option(VAR S: Texts.Scanner); - BEGIN newSF := FALSE; - IF S.nextCh = "/" THEN - Texts.Scan(S); Texts.Scan(S); - IF (S.class = Texts.Name) & (S.s[0] = "s") THEN newSF := TRUE END - END - END Option; - - PROCEDURE Compile*; - VAR beg, end, time: LONGINT; - T: Texts.Text; - S: Texts.Scanner; - BEGIN Texts.OpenScanner(S, Oberon.Par.text, Oberon.Par.pos); Texts.Scan(S); - IF S.class = Texts.Char THEN - IF S.c = "@" THEN - Option(S); Oberon.GetSelection(T, beg, end, time); - IF time >= 0 THEN ORS.Init(T, beg); Module END - ELSIF S.c = "^" THEN - Option(S); Oberon.GetSelection(T, beg, end, time); - IF time >= 0 THEN - Texts.OpenScanner(S, T, beg); Texts.Scan(S); - IF S.class = Texts.Name THEN - Texts.WriteString(W, S.s); NEW(T); Texts.Open(T, S.s); - IF T.len > 0 THEN ORS.Init(T, 0); Module END - END - END - END - ELSE - WHILE S.class = Texts.Name DO - NEW(T); Texts.Open(T, S.s); - IF T.len > 0 THEN Option(S); ORS.Init(T, 0); Module - ELSE Texts.WriteString(W, S.s); Texts.WriteString(W, " not found"); - Texts.WriteLn(W); Texts.Append(Oberon.Log, W.buf); - Oberon.DumpLog; (* voc adaptation; -- noch *) - END ; - IF (T.len # 0) & (ORS.errcnt = 0) THEN Texts.Scan(S) ELSE S.class := 0 END - END - END ; - Oberon.Collect(0) - END Compile; - -BEGIN Texts.OpenWriter(W); Texts.WriteString(W, "OR Compiler 7.6.2014"); - Texts.WriteLn(W); Texts.Append(Oberon.Log, W.buf); - Oberon.DumpLog; (* voc adaptation; -- noch *) - NEW(dummy); dummy.class := ORB.Var; dummy.type := ORB.intType; - expression := expression0; Type := Type0; FormalType := FormalType0; - - Compile (* voc adaptation; -- noch *) -END ORP. +MODULE ORP; (*N. Wirth 1.7.97 / 7.6.2014 Oberon compiler for RISC in Oberon-07*) + IMPORT Texts := CompatTexts, Oberon, ORS, ORB, ORG; + (*Author: Niklaus Wirth, 2014. + Parser of Oberon-RISC compiler. Uses Scanner ORS to obtain symbols (tokens), + ORB for definition of data structures and for handling import and export, and + ORG to produce binary code. ORP performs type checking and data allocation. + Parser is target-independent, except for part of the handling of allocations.*) + + TYPE INTEGER = LONGINT; (* voc adaptation by noch *) + + TYPE PtrBase = POINTER TO PtrBaseDesc; + PtrBaseDesc = RECORD (*list of names of pointer base types*) + name: ORS.Ident; type: ORB.Type; next: PtrBase + END ; + + VAR sym: INTEGER; (*last symbol read*) + dc: LONGINT; (*data counter*) + level, exno, version: INTEGER; + newSF: BOOLEAN; (*option flag*) + expression: PROCEDURE (VAR x: ORG.Item); (*to avoid forward reference*) + Type: PROCEDURE (VAR type: ORB.Type); + FormalType: PROCEDURE (VAR typ: ORB.Type; dim: INTEGER); + modid: ORS.Ident; + pbsList: PtrBase; (*list of names of pointer base types*) + dummy: ORB.Object; + W: Texts.Writer; + + PROCEDURE Check(s: INTEGER; msg: ARRAY OF CHAR); + BEGIN + IF sym = s THEN ORS.Get(sym) ELSE ORS.Mark(msg) END + END Check; + + PROCEDURE qualident(VAR obj: ORB.Object); + BEGIN obj := ORB.thisObj(); ORS.Get(sym); + IF obj = NIL THEN ORS.Mark("undef"); obj := dummy END ; + IF (sym = ORS.period) & (obj.class = ORB.Mod) THEN + ORS.Get(sym); + IF sym = ORS.ident THEN obj := ORB.thisimport(obj); ORS.Get(sym); + IF obj = NIL THEN ORS.Mark("undef"); obj := dummy END + ELSE ORS.Mark("identifier expected"); obj := dummy + END + END + END qualident; + + PROCEDURE CheckBool(VAR x: ORG.Item); + BEGIN + IF x.type.form # ORB.Bool THEN ORS.Mark("not Boolean"); x.type := ORB.boolType END + END CheckBool; + + PROCEDURE CheckInt(VAR x: ORG.Item); + BEGIN + IF x.type.form # ORB.Int THEN ORS.Mark("not Integer"); x.type := ORB.intType END + END CheckInt; + + PROCEDURE CheckReal(VAR x: ORG.Item); + BEGIN + IF x.type.form # ORB.Real THEN ORS.Mark("not Real"); x.type := ORB.realType END + END CheckReal; + + PROCEDURE CheckSet(VAR x: ORG.Item); + BEGIN + IF x.type.form # ORB.Set THEN ORS.Mark("not Set"); x.type := ORB.setType END + END CheckSet; + + PROCEDURE CheckSetVal(VAR x: ORG.Item); + BEGIN + IF x.type.form # ORB.Int THEN ORS.Mark("not Int"); x.type := ORB.setType + ELSIF x.mode = ORB.Const THEN + IF (x.a < 0) OR (x.a >= 32) THEN ORS.Mark("invalid set") END + END + END CheckSetVal; + + PROCEDURE CheckConst(VAR x: ORG.Item); + BEGIN + IF x.mode # ORB.Const THEN ORS.Mark("not a constant"); x.mode := ORB.Const END + END CheckConst; + + PROCEDURE CheckReadOnly(VAR x: ORG.Item); + BEGIN + IF x.rdo THEN ORS.Mark("read-only") END + END CheckReadOnly; + + PROCEDURE CheckExport(VAR expo: BOOLEAN); + BEGIN + IF sym = ORS.times THEN + expo := TRUE; ORS.Get(sym); + IF level # 0 THEN ORS.Mark("remove asterisk") END + ELSE expo := FALSE + END + END CheckExport; + + PROCEDURE IsExtension(t0, t1: ORB.Type): BOOLEAN; + BEGIN (*t1 is an extension of t0*) + RETURN (t0 = t1) OR (t1 # NIL) & IsExtension(t0, t1.base) + END IsExtension; + + (* expressions *) + + PROCEDURE TypeTest(VAR x: ORG.Item; T: ORB.Type; guard: BOOLEAN); + VAR xt: ORB.Type; + BEGIN xt := x.type; + WHILE (xt # T) & (xt # NIL) DO xt := xt.base END ; + IF xt # T THEN xt := x.type; + IF (xt.form = ORB.Pointer) & (T.form = ORB.Pointer) THEN + IF IsExtension(xt.base, T.base) THEN ORG.TypeTest(x, T.base, FALSE, guard); x.type := T + ELSE ORS.Mark("not an extension") + END + ELSIF (xt.form = ORB.Record) & (T.form = ORB.Record) & (x.mode = ORB.Par) THEN + IF IsExtension(xt, T) THEN ORG.TypeTest(x, T, TRUE, guard); x.type := T + ELSE ORS.Mark("not an extension") + END + ELSE ORS.Mark("incompatible types") + END + ELSIF ~guard THEN ORG.MakeConstItem(x, ORB.boolType, 1) + END ; + IF ~guard THEN x.type := ORB.boolType END + END TypeTest; + + PROCEDURE selector(VAR x: ORG.Item); + VAR y: ORG.Item; obj: ORB.Object; + BEGIN + WHILE (sym = ORS.lbrak) OR (sym = ORS.period) OR (sym = ORS.arrow) + OR (sym = ORS.lparen) & (x.type.form IN {ORB.Record, ORB.Pointer}) DO + IF sym = ORS.lbrak THEN + REPEAT ORS.Get(sym); expression(y); + IF x.type.form = ORB.Array THEN + CheckInt(y); ORG.Index(x, y); x.type := x.type.base + ELSE ORS.Mark("not an array") + END + UNTIL sym # ORS.comma; + Check(ORS.rbrak, "no ]") + ELSIF sym = ORS.period THEN ORS.Get(sym); + IF sym = ORS.ident THEN + IF x.type.form = ORB.Pointer THEN ORG.DeRef(x); x.type := x.type.base END ; + IF x.type.form = ORB.Record THEN + obj := ORB.thisfield(x.type); ORS.Get(sym); + IF obj # NIL THEN ORG.Field(x, obj); x.type := obj.type + ELSE ORS.Mark("undef") + END + ELSE ORS.Mark("not a record") + END + ELSE ORS.Mark("ident?") + END + ELSIF sym = ORS.arrow THEN + ORS.Get(sym); + IF x.type.form = ORB.Pointer THEN ORG.DeRef(x); x.type := x.type.base + ELSE ORS.Mark("not a pointer") + END + ELSIF (sym = ORS.lparen) & (x.type.form IN {ORB.Record, ORB.Pointer}) THEN (*type guard*) + ORS.Get(sym); + IF sym = ORS.ident THEN + qualident(obj); + IF obj.class = ORB.Typ THEN TypeTest(x, obj.type, TRUE) + ELSE ORS.Mark("guard type expected") + END + ELSE ORS.Mark("not an identifier") + END ; + Check(ORS.rparen, " ) missing") + END + END + END selector; + + PROCEDURE CompTypes(t0, t1: ORB.Type; varpar: BOOLEAN): BOOLEAN; + + PROCEDURE EqualSignatures(t0, t1: ORB.Type): BOOLEAN; + VAR p0, p1: ORB.Object; com: BOOLEAN; + BEGIN com := TRUE; + IF (t0.base = t1.base) & (t0.nofpar = t1.nofpar) THEN + p0 := t0.dsc; p1 := t1.dsc; + WHILE p0 # NIL DO + IF (p0.class = p1.class) & CompTypes(p0.type, p1.type, TRUE) & + (*(ORD(p0.rdo) = ORD(p1.rdo))*) + (p0.rdo = p1.rdo) (* voc adaptation by noch *) + THEN + IF p0.type.form >= ORB.Array THEN com := CompTypes(p0.type, p1.type, (p0.class = ORB.Par)) END ; + p0 := p0.next; p1 := p1.next + ELSE p0 := NIL; com := FALSE + END + END + ELSE com := FALSE + END ; + RETURN com + END EqualSignatures; + + BEGIN (*Compatible Types*) + RETURN (t0 = t1) + OR (t0.form = ORB.Array) & (t1.form = ORB.Array) & CompTypes(t0.base, t1.base, varpar) + OR (t0.form = ORB.Pointer) & (t1.form = ORB.Pointer) & IsExtension(t0.base, t1.base) + OR (t0.form = ORB.Record) & (t1.form = ORB.Record) & IsExtension(t0, t1) + OR (t0.form = ORB.Proc) & (t1.form = ORB.Proc) & EqualSignatures(t0, t1) + OR (t0.form IN {ORB.Pointer, ORB.Proc}) & (t1.form = ORB.NilTyp) + OR (t0.form = ORB.NilTyp) & (t1.form IN {ORB.Pointer, ORB.Proc}) + OR ~varpar & (t0.form = ORB.Int) & (t1.form = ORB.Int) + END CompTypes; + + PROCEDURE Parameter(par: ORB.Object); + VAR x: ORG.Item; varpar: BOOLEAN; + BEGIN expression(x); + IF par # NIL THEN + varpar := par.class = ORB.Par; + IF CompTypes(par.type, x.type, varpar) THEN + IF ~varpar THEN ORG.ValueParam(x) + ELSE (*par.class = Par*) + IF ~par.rdo THEN CheckReadOnly(x) END ; + ORG.VarParam(x, par.type) + END + ELSIF ~varpar & (par.type.form = ORB.Int) & (x.type.form = ORB.Int) THEN + ORG.ValueParam(x) + ELSIF (x.type.form = ORB.String) & (x.b = 2) & (par.class = ORB.Var) & (par.type.form = ORB.Char) THEN + ORG.StrToChar(x); ORG.ValueParam(x) + ELSIF (x.type.form = ORB.Array) & (par.type.form = ORB.Array) & + (x.type.base.form = par.type.base.form) & (par.type.len < 0) THEN + ORG.OpenArrayParam(x); + ELSIF (x.type.form = ORB.String) & varpar & par.rdo & (par.type.form = ORB.Array) & + (par.type.base.form = ORB.Char) & (par.type.len < 0) THEN ORG.StringParam(x) + ELSIF (par.type.form = ORB.Array) & (par.type.base.form = ORB.Int) & (par.type.size = x.type.size) THEN + ORG.VarParam(x, par.type) + ELSE ORS.Mark("incompatible parameters") + END + END + END Parameter; + + PROCEDURE ParamList(VAR x: ORG.Item); + VAR n: INTEGER; par: ORB.Object; + BEGIN par := x.type.dsc; n := 0; + IF sym # ORS.rparen THEN + Parameter(par); n := 1; + WHILE sym <= ORS.comma DO + Check(sym, "comma?"); + IF par # NIL THEN par := par.next END ; + INC(n); Parameter(par) + END ; + Check(ORS.rparen, ") missing") + ELSE ORS.Get(sym); + END ; + IF n < x.type.nofpar THEN ORS.Mark("too few params") + ELSIF n > x.type.nofpar THEN ORS.Mark("too many params") + END + END ParamList; + + PROCEDURE StandFunc(VAR x: ORG.Item; fct: LONGINT; restyp: ORB.Type); + VAR y: ORG.Item; n, npar: LONGINT; + BEGIN Check(ORS.lparen, "no ("); + npar := fct MOD 10; fct := fct DIV 10; expression(x); n := 1; + WHILE sym = ORS.comma DO ORS.Get(sym); expression(y); INC(n) END ; + Check(ORS.rparen, "no )"); + IF n = npar THEN + IF fct = 0 THEN (*ABS*) + IF x.type.form IN {ORB.Int, ORB.Real} THEN ORG.Abs(x); restyp := x.type ELSE ORS.Mark("bad type") END + ELSIF fct = 1 THEN (*ODD*) CheckInt(x); ORG.Odd(x) + ELSIF fct = 2 THEN (*FLOOR*) CheckReal(x); ORG.Floor(x) + ELSIF fct = 3 THEN (*FLT*) CheckInt(x); ORG.Float(x) + ELSIF fct = 4 THEN (*ORD*) + IF x.type.form <= ORB.Proc THEN ORG.Ord(x) + ELSIF (x.type.form = ORB.String) & (x.b = 2) THEN ORG.StrToChar(x) + ELSE ORS.Mark("bad type") + END + ELSIF fct = 5 THEN (*CHR*) CheckInt(x); ORG.Ord(x) + ELSIF fct = 6 THEN (*LEN*) + IF x.type.form = ORB.Array THEN ORG.Len(x) ELSE ORS.Mark("not an array") END + ELSIF fct IN {7, 8, 9} THEN (*LSL, ASR, ROR*) CheckInt(y); + IF x.type.form IN {ORB.Int, ORB.Set} THEN ORG.Shift(fct-7, x, y); restyp := x.type ELSE ORS.Mark("bad type") END + ELSIF fct = 11 THEN (*ADC*) ORG.ADC(x, y) + ELSIF fct = 12 THEN (*SBC*) ORG.SBC(x, y) + ELSIF fct = 13 THEN (*UML*) ORG.UML(x, y) + ELSIF fct = 14 THEN (*BIT*) CheckInt(x); CheckInt(y); ORG.Bit(x, y) + ELSIF fct = 15 THEN (*REG*) CheckConst(x); CheckInt(x); ORG.Register(x) + ELSIF fct = 16 THEN (*VAL*) + IF (x.mode= ORB.Typ) & (x.type.size <= y.type.size) THEN restyp := x.type; x := y + ELSE ORS.Mark("casting not allowed") + END + ELSIF fct = 17 THEN (*ADR*) ORG.Adr(x) + ELSIF fct = 18 THEN (*SIZE*) + IF x.mode = ORB.Typ THEN ORG.MakeConstItem(x, ORB.intType, x.type.size) + ELSE ORS.Mark("must be a type") + END + ELSIF fct = 19 THEN (*COND*) CheckConst(x); CheckInt(x); ORG.Condition(x) + ELSIF fct = 20 THEN (*H*) CheckConst(x); CheckInt(x); ORG.H(x) + END ; + x.type := restyp + ELSE ORS.Mark("wrong nof params") + END + END StandFunc; + + PROCEDURE element(VAR x: ORG.Item); + VAR y: ORG.Item; + BEGIN expression(x); CheckSetVal(x); + IF sym = ORS.upto THEN ORS.Get(sym); expression(y); CheckSetVal(y); ORG.Set(x, y) + ELSE ORG.Singleton(x) + END ; + x.type := ORB.setType + END element; + + PROCEDURE set(VAR x: ORG.Item); + VAR y: ORG.Item; + BEGIN + IF sym >= ORS.if THEN + IF sym # ORS.rbrace THEN ORS.Mark(" } missing") END ; + ORG.MakeConstItem(x, ORB.setType, 0) (*empty set*) + ELSE element(x); + WHILE (sym < ORS.rparen) OR (sym > ORS.rbrace) DO + IF sym = ORS.comma THEN ORS.Get(sym) + ELSIF sym # ORS.rbrace THEN ORS.Mark("missing comma") + END ; + element(y); ORG.SetOp(ORS.plus, x, y) + END + END + END set; + + PROCEDURE factor(VAR x: ORG.Item); + VAR obj: ORB.Object; rx: LONGINT; + BEGIN (*sync*) + IF (sym < ORS.char) OR (sym > ORS.ident) THEN ORS.Mark("expression expected"); + REPEAT ORS.Get(sym) UNTIL (sym >= ORS.char) & (sym <= ORS.ident) + END ; + IF sym = ORS.ident THEN + qualident(obj); + IF obj.class = ORB.SFunc THEN StandFunc(x, obj.val, obj.type) + ELSE ORG.MakeItem(x, obj, level); selector(x); + IF sym = ORS.lparen THEN + ORS.Get(sym); + IF (x.type.form = ORB.Proc) & (x.type.base.form # ORB.NoTyp) THEN + ORG.PrepCall(x, rx); ParamList(x); ORG.Call(x, rx); x.type := x.type.base + ELSE ORS.Mark("not a function"); ParamList(x) + END + END + END + ELSIF sym = ORS.int THEN ORG.MakeConstItem(x, ORB.intType, ORS.ival); ORS.Get(sym) + ELSIF sym = ORS.real THEN ORG.MakeRealItem(x, ORS.rval); ORS.Get(sym) + ELSIF sym = ORS.char THEN ORG.MakeConstItem(x, ORB.charType, ORS.ival); ORS.Get(sym) + ELSIF sym = ORS.nil THEN ORS.Get(sym); ORG.MakeConstItem(x, ORB.nilType, 0) + ELSIF sym = ORS.string THEN ORG.MakeStringItem(x, ORS.slen); ORS.Get(sym) + ELSIF sym = ORS.lparen THEN ORS.Get(sym); expression(x); Check(ORS.rparen, "no )") + ELSIF sym = ORS.lbrace THEN ORS.Get(sym); set(x); Check(ORS.rbrace, "no }") + ELSIF sym = ORS.not THEN ORS.Get(sym); factor(x); CheckBool(x); ORG.Not(x) + ELSIF sym = ORS.false THEN ORS.Get(sym); ORG.MakeConstItem(x, ORB.boolType, 0) + ELSIF sym = ORS.true THEN ORS.Get(sym); ORG.MakeConstItem(x, ORB.boolType, 1) + ELSE ORS.Mark("not a factor"); ORG.MakeItem(x, NIL, level) + END + END factor; + + PROCEDURE term(VAR x: ORG.Item); + VAR y: ORG.Item; op, f: INTEGER; + BEGIN factor(x); f := x.type.form; + WHILE (sym >= ORS.times) & (sym <= ORS.and) DO + op := sym; ORS.Get(sym); + IF op = ORS.times THEN + IF f = ORB.Int THEN factor(y); CheckInt(y); ORG.MulOp(x, y) + ELSIF f = ORB.Real THEN factor(y); CheckReal(y); ORG.RealOp(op, x, y) + ELSIF f = ORB.Set THEN factor(y); CheckSet(y); ORG.SetOp(op, x, y) + ELSE ORS.Mark("bad type") + END + ELSIF (op = ORS.div) OR (op = ORS.mod) THEN + CheckInt(x); factor(y); CheckInt(y); ORG.DivOp(op, x, y) + ELSIF op = ORS.rdiv THEN + IF f = ORB.Real THEN factor(y); CheckReal(y); ORG.RealOp(op, x, y) + ELSIF f = ORB.Set THEN factor(y); CheckSet(y); ORG.SetOp(op, x, y) + ELSE ORS.Mark("bad type") + END + ELSE (*op = and*) CheckBool(x); ORG.And1(x); factor(y); CheckBool(y); ORG.And2(x, y) + END + END + END term; + + PROCEDURE SimpleExpression(VAR x: ORG.Item); + VAR y: ORG.Item; op: INTEGER; + BEGIN + IF sym = ORS.minus THEN ORS.Get(sym); term(x); + IF x.type.form IN {ORB.Int, ORB.Real, ORB.Set} THEN ORG.Neg(x) ELSE CheckInt(x) END + ELSIF sym = ORS.plus THEN ORS.Get(sym); term(x); + ELSE term(x) + END ; + WHILE (sym >= ORS.plus) & (sym <= ORS.or) DO + op := sym; ORS.Get(sym); + IF op = ORS.or THEN ORG.Or1(x); CheckBool(x); term(y); CheckBool(y); ORG.Or2(x, y) + ELSIF x.type.form = ORB.Int THEN term(y); CheckInt(y); ORG.AddOp(op, x, y) + ELSIF x.type.form = ORB.Real THEN term(y); CheckReal(y); ORG.RealOp(op, x, y) + ELSE CheckSet(x); term(y); CheckSet(y); ORG.SetOp(op, x, y) + END + END + END SimpleExpression; + + PROCEDURE expression0(VAR x: ORG.Item); + VAR y: ORG.Item; obj: ORB.Object; rel, xf, yf: INTEGER; + BEGIN SimpleExpression(x); + IF (sym >= ORS.eql) & (sym <= ORS.geq) THEN + rel := sym; ORS.Get(sym); SimpleExpression(y); xf := x.type.form; yf := y.type.form; + IF CompTypes(x.type, y.type, FALSE) OR + (xf = ORB.Pointer) & (yf = ORB.Pointer) & IsExtension(y.type.base, x.type.base) THEN + IF (xf IN {ORB.Char, ORB.Int}) THEN ORG.IntRelation(rel, x, y) + ELSIF xf = ORB.Real THEN ORG.RealRelation(rel, x, y) + ELSIF xf = ORB.Set THEN ORG.SetRelation(rel, x, y) + ELSIF (xf IN {ORB.Pointer, ORB.Proc, ORB.NilTyp}) THEN + IF rel <= ORS.neq THEN ORG.IntRelation(rel, x, y) ELSE ORS.Mark("only = or #") END + ELSIF (xf = ORB.Array) & (x.type.base.form = ORB.Char) OR (xf = ORB.String) THEN + ORG.StringRelation(rel, x, y) + ELSE ORS.Mark("illegal comparison") + END + ELSIF (xf = ORB.Array) & (x.type.base.form = ORB.Char) & + ((yf = ORB.String) OR (yf = ORB.Array) & (y.type.base.form = ORB.Char)) + OR (yf = ORB.Array) & (y.type.base.form = ORB.Char) & (xf = ORB.String) THEN + ORG.StringRelation(rel, x, y) + ELSIF (xf = ORB.Char) & (yf = ORB.String) & (y.b = 2) THEN + ORG.StrToChar(y); ORG.IntRelation(rel, x, y) + ELSIF (yf = ORB.Char) & (xf = ORB.String) & (x.b = 2) THEN + ORG.StrToChar(x); ORG.IntRelation(rel, x, y) + ELSE ORS.Mark("illegal comparison") + END ; + x.type := ORB.boolType + ELSIF sym = ORS.in THEN + ORS.Get(sym); SimpleExpression(y); + IF (x.type.form = ORB.Int) & (y.type.form = ORB.Set) THEN ORG.In(x, y) + ELSE ORS.Mark("illegal operands of IN") + END ; + x.type := ORB.boolType + ELSIF sym = ORS.is THEN + ORS.Get(sym); qualident(obj); TypeTest(x, obj.type, FALSE) ; + x.type := ORB.boolType + END + END expression0; + + (* statements *) + + PROCEDURE StandProc(pno: LONGINT); + VAR nap, npar: LONGINT; (*nof actual/formal parameters*) + x, y, z: ORG.Item; + BEGIN Check(ORS.lparen, "no ("); + npar := pno MOD 10; pno := pno DIV 10; expression(x); nap := 1; + IF sym = ORS.comma THEN + ORS.Get(sym); expression(y); nap := 2; z.type := ORB.noType; + WHILE sym = ORS.comma DO ORS.Get(sym); expression(z); INC(nap) END + ELSE y.type := ORB.noType + END ; + Check(ORS.rparen, "no )"); + IF (npar = nap) OR (pno IN {0, 1}) THEN + IF pno IN {0, 1} THEN (*INC, DEC*) + CheckInt(x); CheckReadOnly(x); + IF y.type # ORB.noType THEN CheckInt(y) END ; + ORG.Increment(pno, x, y) + ELSIF pno IN {2, 3} THEN (*INCL, EXCL*) + CheckSet(x); CheckReadOnly(x); CheckInt(y); ORG.Include(pno-2, x, y) + ELSIF pno = 4 THEN CheckBool(x); ORG.Assert(x) + ELSIF pno = 5 THEN(*NEW*) CheckReadOnly(x); + IF (x.type.form = ORB.Pointer) & (x.type.base.form = ORB.Record) THEN ORG.New(x) + ELSE ORS.Mark("not a pointer to record") + END + ELSIF pno = 6 THEN CheckReal(x); CheckInt(y); CheckReadOnly(x); ORG.Pack(x, y) + ELSIF pno = 7 THEN CheckReal(x); CheckInt(y); CheckReadOnly(x); ORG.Unpk(x, y) + ELSIF pno = 8 THEN + IF x.type.form <= ORB.Set THEN ORG.Led(x) ELSE ORS.Mark("bad type") END + ELSIF pno = 10 THEN CheckInt(x); ORG.Get(x, y) + ELSIF pno = 11 THEN CheckInt(x); ORG.Put(x, y) + ELSIF pno = 12 THEN CheckInt(x); CheckInt(y); CheckInt(z); ORG.Copy(x, y, z) + ELSIF pno = 13 THEN CheckConst(x); CheckInt(x); ORG.LDPSR(x) + ELSIF pno = 14 THEN CheckInt(x); ORG.LDREG(x, y) + END + ELSE ORS.Mark("wrong nof parameters") + END + END StandProc; + + PROCEDURE StatSequence; + VAR obj: ORB.Object; + orgtype: ORB.Type; (*original type of case var*) + x, y, z, w: ORG.Item; + L0, L1, rx: LONGINT; + + PROCEDURE TypeCase(obj: ORB.Object; VAR x: ORG.Item); + VAR typobj: ORB.Object; + BEGIN + IF sym = ORS.ident THEN + qualident(typobj); ORG.MakeItem(x, obj, level); + IF typobj.class # ORB.Typ THEN ORS.Mark("not a type") END ; + TypeTest(x, typobj.type, FALSE); obj.type := typobj.type; + ORG.CFJump(x); Check(ORS.colon, ": expected"); StatSequence + ELSE ORG.CFJump(x); ORS.Mark("type id expected") + END + END TypeCase; + + PROCEDURE SkipCase; + BEGIN + WHILE sym # ORS.colon DO ORS.Get(sym) END ; + ORS.Get(sym); StatSequence + END SkipCase; + + BEGIN (* StatSequence *) + REPEAT (*sync*) obj := NIL; + IF ~((sym = ORS.ident) OR (sym >= ORS.if) & (sym <= ORS.for) OR (sym >= ORS.semicolon)) THEN + ORS.Mark("statement expected"); + REPEAT ORS.Get(sym) UNTIL (sym = ORS.ident) OR (sym >= ORS.if) + END ; + IF sym = ORS.ident THEN + qualident(obj); ORG.MakeItem(x, obj, level); + IF x.mode = ORB.SProc THEN StandProc(obj.val) + ELSE selector(x); + IF sym = ORS.becomes THEN (*assignment*) + ORS.Get(sym); CheckReadOnly(x); expression(y); + IF CompTypes(x.type, y.type, FALSE) OR (x.type.form = ORB.Int) & (y.type.form = ORB.Int) THEN + IF (x.type.form <= ORB.Pointer) OR (x.type.form = ORB.Proc) THEN ORG.Store(x, y) + ELSIF y.type.size # 0 THEN ORG.StoreStruct(x, y) + END + ELSIF (x.type.form = ORB.Char) & (y.type.form = ORB.String) & (y.b = 2) THEN + ORG.StrToChar(y); ORG.Store(x, y) + ELSIF (x.type.form = ORB.Array) & (x.type.base.form = ORB.Char) & + (y.type.form = ORB.String) THEN ORG.CopyString(y, x) + ELSE ORS.Mark("illegal assignment") + END + ELSIF sym = ORS.eql THEN ORS.Mark("should be :="); ORS.Get(sym); expression(y) + ELSIF sym = ORS.lparen THEN (*procedure call*) + ORS.Get(sym); + IF (x.type.form = ORB.Proc) & (x.type.base.form = ORB.NoTyp) THEN + ORG.PrepCall(x, rx); ParamList(x); ORG.Call(x, rx) + ELSE ORS.Mark("not a procedure"); ParamList(x) + END + ELSIF x.type.form = ORB.Proc THEN (*procedure call without parameters*) + IF x.type.nofpar > 0 THEN ORS.Mark("missing parameters") END ; + IF x.type.base.form = ORB.NoTyp THEN ORG.PrepCall(x, rx); ORG.Call(x, rx) ELSE ORS.Mark("not a procedure") END + ELSIF x.mode = ORB.Typ THEN ORS.Mark("illegal assignment") + ELSE ORS.Mark("not a procedure") + END + END + ELSIF sym = ORS.if THEN + ORS.Get(sym); expression(x); CheckBool(x); ORG.CFJump(x); + Check(ORS.then, "no THEN"); + StatSequence; L0 := 0; + WHILE sym = ORS.elsif DO + ORS.Get(sym); ORG.FJump(L0); ORG.Fixup(x); expression(x); CheckBool(x); + ORG.CFJump(x); Check(ORS.then, "no THEN"); StatSequence + END ; + IF sym = ORS.else THEN ORS.Get(sym); ORG.FJump(L0); ORG.Fixup(x); StatSequence + ELSE ORG.Fixup(x) + END ; + ORG.FixLink(L0); Check(ORS.end, "no END") + ELSIF sym = ORS.while THEN + ORS.Get(sym); L0 := ORG.Here(); expression(x); CheckBool(x); ORG.CFJump(x); + Check(ORS.do, "no DO"); StatSequence; ORG.BJump(L0); + WHILE sym = ORS.elsif DO + ORS.Get(sym); ORG.Fixup(x); expression(x); CheckBool(x); ORG.CFJump(x); + Check(ORS.do, "no DO"); StatSequence; ORG.BJump(L0) + END ; + ORG.Fixup(x); Check(ORS.end, "no END") + ELSIF sym = ORS.repeat THEN + ORS.Get(sym); L0 := ORG.Here(); StatSequence; + IF sym = ORS.until THEN + ORS.Get(sym); expression(x); CheckBool(x); ORG.CBJump(x, L0) + ELSE ORS.Mark("missing UNTIL") + END + ELSIF sym = ORS.for THEN + ORS.Get(sym); + IF sym = ORS.ident THEN + qualident(obj); ORG.MakeItem(x, obj, level); CheckInt(x); CheckReadOnly(x); + IF sym = ORS.becomes THEN + ORS.Get(sym); expression(y); CheckInt(y); ORG.For0(x, y); L0 := ORG.Here(); + Check(ORS.to, "no TO"); expression(z); CheckInt(z); obj.rdo := TRUE; + IF sym = ORS.by THEN ORS.Get(sym); expression(w); CheckConst(w); CheckInt(w) + ELSE ORG.MakeConstItem(w, ORB.intType, 1) + END ; + Check(ORS.do, "no DO"); ORG.For1(x, y, z, w, L1); + StatSequence; Check(ORS.end, "no END"); + ORG.For2(x, y, w); ORG.BJump(L0); ORG.FixLink(L1); obj.rdo := FALSE + ELSE ORS.Mark(":= expected") + END + ELSE ORS.Mark("identifier expected") + END + ELSIF sym = ORS.case THEN + ORS.Get(sym); + IF sym = ORS.ident THEN + qualident(obj); orgtype := obj.type; + IF (orgtype.form = ORB.Pointer) OR (orgtype.form = ORB.Record) & (obj.class = ORB.Par) THEN + Check(ORS.of, "OF expected"); TypeCase(obj, x); L0 := 0; + WHILE sym = ORS.bar DO + ORS.Get(sym); ORG.FJump(L0); ORG.Fixup(x); obj.type := orgtype; TypeCase(obj, x) + END ; + ORG.Fixup(x); ORG.FixLink(L0); obj.type := orgtype + ELSE ORS.Mark("numeric case not implemented"); + Check(ORS.of, "OF expected"); SkipCase; + WHILE sym = ORS.bar DO SkipCase END + END + ELSE ORS.Mark("ident expected") + END ; + Check(ORS.end, "no END") + END ; + ORG.CheckRegs; + IF sym = ORS.semicolon THEN ORS.Get(sym) + ELSIF sym < ORS.semicolon THEN ORS.Mark("missing semicolon?") + END + UNTIL sym > ORS.semicolon + END StatSequence; + + (* Types and declarations *) + + PROCEDURE IdentList(class: INTEGER; VAR first: ORB.Object); + VAR obj: ORB.Object; + BEGIN + IF sym = ORS.ident THEN + ORB.NewObj(first, ORS.id, class); ORS.Get(sym); CheckExport(first.expo); + WHILE sym = ORS.comma DO + ORS.Get(sym); + IF sym = ORS.ident THEN ORB.NewObj(obj, ORS.id, class); ORS.Get(sym); CheckExport(obj.expo) + ELSE ORS.Mark("ident?") + END + END; + IF sym = ORS.colon THEN ORS.Get(sym) ELSE ORS.Mark(":?") END + ELSE first := NIL + END + END IdentList; + + PROCEDURE ArrayType(VAR type: ORB.Type); + VAR x: ORG.Item; typ: ORB.Type; len: LONGINT; + BEGIN NEW(typ); typ.form := ORB.NoTyp; + IF sym = ORS.of THEN (*dynamic array*) len := -1 + ELSE expression(x); + IF (x.mode = ORB.Const) & (x.type.form = ORB.Int) & (x.a >= 0) THEN len := x.a + ELSE len := 0; ORS.Mark("not a valid length") + END + END ; + IF sym = ORS.of THEN ORS.Get(sym); Type(typ.base); + IF (typ.base.form = ORB.Array) & (typ.base.len < 0) THEN ORS.Mark("dyn array not allowed") END + ELSIF sym = ORS.comma THEN ORS.Get(sym); ArrayType(typ.base) + ELSE ORS.Mark("missing OF"); typ.base := ORB.intType + END ; + IF len >= 0 THEN typ.size := (len * typ.base.size + 3) DIV 4 * 4 ELSE typ.size := 2*ORG.WordSize (*array desc*) END ; + typ.form := ORB.Array; typ.len := len; type := typ + END ArrayType; + + PROCEDURE RecordType(VAR type: ORB.Type); + VAR obj, obj0, new, bot, base: ORB.Object; + typ, tp: ORB.Type; + offset, off, n: LONGINT; + BEGIN NEW(typ); typ.form := ORB.NoTyp; typ.base := NIL; typ.mno := -level; typ.nofpar := 0; offset := 0; bot := NIL; + IF sym = ORS.lparen THEN + ORS.Get(sym); (*record extension*) + IF level # 0 THEN ORS.Mark("extension of local types not implemented") END ; + IF sym = ORS.ident THEN + qualident(base); + IF base.class = ORB.Typ THEN + IF base.type.form = ORB.Record THEN typ.base := base.type + ELSE typ.base := ORB.intType; ORS.Mark("invalid extension") + END ; + typ.nofpar := typ.base.nofpar + 1; (*"nofpar" here abused for extension level*) + bot := typ.base.dsc; offset := typ.base.size + ELSE ORS.Mark("type expected") + END + ELSE ORS.Mark("ident expected") + END ; + Check(ORS.rparen, "no )") + END ; + WHILE sym = ORS.ident DO (*fields*) + n := 0; obj := bot; + WHILE sym = ORS.ident DO + obj0 := obj; + WHILE (obj0 # NIL) & (obj0.name # ORS.id) DO obj0 := obj0.next END ; + IF obj0 # NIL THEN ORS.Mark("mult def") END ; + NEW(new); ORS.CopyId(new.name); new.class := ORB.Fld; new.next := obj; obj := new; INC(n); + ORS.Get(sym); CheckExport(new.expo); + IF (sym # ORS.comma) & (sym # ORS.colon) THEN ORS.Mark("comma expected") + ELSIF sym = ORS.comma THEN ORS.Get(sym) + END + END ; + Check(ORS.colon, "colon expected"); Type(tp); + IF (tp.form = ORB.Array) & (tp.len < 0) THEN ORS.Mark("dyn array not allowed") END ; + IF tp.size > 1 THEN offset := (offset+3) DIV 4 * 4 END ; + offset := offset + n * tp.size; off := offset; obj0 := obj; + WHILE obj0 # bot DO obj0.type := tp; obj0.lev := 0; off := off - tp.size; obj0.val := off; obj0 := obj0.next END ; + bot := obj; + IF sym = ORS.semicolon THEN ORS.Get(sym) ELSIF sym # ORS.end THEN ORS.Mark(" ; or END") END + END ; + typ.form := ORB.Record; typ.dsc := bot; typ.size := (offset + 3) DIV 4 * 4; type := typ + END RecordType; + + PROCEDURE FPSection(VAR adr: LONGINT; VAR nofpar: INTEGER); + VAR obj, first: ORB.Object; tp: ORB.Type; + parsize: LONGINT; cl: INTEGER; rdo: BOOLEAN; + BEGIN + IF sym = ORS.var THEN ORS.Get(sym); cl := ORB.Par ELSE cl := ORB.Var END ; + IdentList(cl, first); FormalType(tp, 0); rdo := FALSE; + IF (cl = ORB.Var) & (tp.form >= ORB.Array) THEN cl := ORB.Par; rdo := TRUE END ; + IF (tp.form = ORB.Array) & (tp.len < 0) OR (tp.form = ORB.Record) THEN + parsize := 2*ORG.WordSize (*open array or record, needs second word for length or type tag*) + ELSE parsize := ORG.WordSize + END ; + obj := first; + WHILE obj # NIL DO + INC(nofpar); obj.class := cl; obj.type := tp; obj.rdo := rdo; obj.lev := level; obj.val := adr; + adr := adr + parsize; obj := obj.next + END ; + IF adr >= 52 THEN ORS.Mark("too many parameters") END + END FPSection; + + PROCEDURE ProcedureType(ptype: ORB.Type; VAR parblksize: LONGINT); + VAR obj: ORB.Object; size: LONGINT; nofpar: INTEGER; + BEGIN ptype.base := ORB.noType; size := parblksize; nofpar := 0; ptype.dsc := NIL; + IF sym = ORS.lparen THEN + ORS.Get(sym); + IF sym = ORS.rparen THEN ORS.Get(sym) + ELSE FPSection(size, nofpar); + WHILE sym = ORS.semicolon DO ORS.Get(sym); FPSection(size, nofpar) END ; + Check(ORS.rparen, "no )") + END ; + ptype.nofpar := nofpar; parblksize := size; + IF sym = ORS.colon THEN (*function*) + ORS.Get(sym); + IF sym = ORS.ident THEN qualident(obj); + IF (obj.class = ORB.Typ) & (obj.type.form IN {ORB.Byte .. ORB.Pointer, ORB.Proc}) THEN ptype.base := obj.type + ELSE ORS.Mark("illegal function type") + END + ELSE ORS.Mark("type identifier expected") + END + END + END + END ProcedureType; + + PROCEDURE FormalType0(VAR typ: ORB.Type; dim: INTEGER); + VAR obj: ORB.Object; dmy: LONGINT; + BEGIN + IF sym = ORS.ident THEN + qualident(obj); + IF obj.class = ORB.Typ THEN typ := obj.type ELSE ORS.Mark("not a type"); typ := ORB.intType END + ELSIF sym = ORS.array THEN + ORS.Get(sym); Check(ORS.of, "OF ?"); + IF dim >= 1 THEN ORS.Mark("multi-dimensional open arrays not implemented") END ; + NEW(typ); typ.form := ORB.Array; typ.len := -1; typ.size := 2*ORG.WordSize; + FormalType(typ.base, dim+1) + ELSIF sym = ORS.procedure THEN + ORS.Get(sym); ORB.OpenScope; + NEW(typ); typ.form := ORB.Proc; typ.size := ORG.WordSize; dmy := 0; ProcedureType(typ, dmy); + typ.dsc := ORB.topScope.next; ORB.CloseScope + ELSE ORS.Mark("identifier expected"); typ := ORB.noType + END + END FormalType0; + + PROCEDURE CheckRecLevel(lev: INTEGER); + BEGIN + IF lev # 0 THEN ORS.Mark("ptr base must be global") END + END CheckRecLevel; + + PROCEDURE Type0(VAR type: ORB.Type); + VAR dmy: LONGINT; obj: ORB.Object; ptbase: PtrBase; + BEGIN type := ORB.intType; (*sync*) + IF (sym # ORS.ident) & (sym < ORS.array) THEN ORS.Mark("not a type"); + REPEAT ORS.Get(sym) UNTIL (sym = ORS.ident) OR (sym >= ORS.array) + END ; + IF sym = ORS.ident THEN + qualident(obj); + IF obj.class = ORB.Typ THEN + IF (obj.type # NIL) & (obj.type.form # ORB.NoTyp) THEN type := obj.type END + ELSE ORS.Mark("not a type or undefined") + END + ELSIF sym = ORS.array THEN ORS.Get(sym); ArrayType(type) + ELSIF sym = ORS.record THEN + ORS.Get(sym); RecordType(type); Check(ORS.end, "no END") + ELSIF sym = ORS.pointer THEN + ORS.Get(sym); Check(ORS.to, "no TO"); + NEW(type); type.form := ORB.Pointer; type.size := ORG.WordSize; type.base := ORB.intType; + IF sym = ORS.ident THEN + obj := ORB.thisObj(); ORS.Get(sym); + IF obj # NIL THEN + IF (obj.class = ORB.Typ) & (obj.type.form IN {ORB.Record, ORB.NoTyp}) THEN + CheckRecLevel(obj.lev); type.base := obj.type + ELSE ORS.Mark("no valid base type") + END + ELSE CheckRecLevel(level); (*enter into list of forward references to be fixed in Declarations*) + NEW(ptbase); ORS.CopyId(ptbase.name); ptbase.type := type; ptbase.next := pbsList; pbsList := ptbase + END + ELSE Type(type.base); + IF type.base.form # ORB.Record THEN ORS.Mark("must point to record") END ; + CheckRecLevel(level) + END + ELSIF sym = ORS.procedure THEN + ORS.Get(sym); ORB.OpenScope; + NEW(type); type.form := ORB.Proc; type.size := ORG.WordSize; dmy := 0; + ProcedureType(type, dmy); type.dsc := ORB.topScope.next; ORB.CloseScope + ELSE ORS.Mark("illegal type") + END + END Type0; + + PROCEDURE Declarations(VAR varsize: LONGINT); + VAR obj, first: ORB.Object; + x: ORG.Item; tp: ORB.Type; ptbase: PtrBase; + expo: BOOLEAN; id: ORS.Ident; + BEGIN (*sync*) pbsList := NIL; + IF (sym < ORS.const) & (sym # ORS.end) THEN ORS.Mark("declaration?"); + REPEAT ORS.Get(sym) UNTIL (sym >= ORS.const) OR (sym = ORS.end) + END ; + IF sym = ORS.const THEN + ORS.Get(sym); + WHILE sym = ORS.ident DO + ORS.CopyId(id); ORS.Get(sym); CheckExport(expo); + IF sym = ORS.eql THEN ORS.Get(sym) ELSE ORS.Mark("= ?") END; + expression(x); + IF (x.type.form = ORB.String) & (x.b = 2) THEN ORG.StrToChar(x) END ; + ORB.NewObj(obj, id, ORB.Const); obj.expo := expo; + IF x.mode = ORB.Const THEN obj.val := x.a; obj.lev := x.b; obj.type := x.type + ELSE ORS.Mark("expression not constant"); obj.type := ORB.intType + END; + Check(ORS.semicolon, "; missing") + END + END ; + IF sym = ORS.type THEN + ORS.Get(sym); + WHILE sym = ORS.ident DO + ORS.CopyId(id); ORS.Get(sym); CheckExport(expo); + IF sym = ORS.eql THEN ORS.Get(sym) ELSE ORS.Mark("=?") END ; + Type(tp); + ORB.NewObj(obj, id, ORB.Typ); obj.type := tp; obj.expo := expo; obj.lev := level; tp.typobj := obj; + IF expo & (obj.type.form = ORB.Record) THEN obj.exno := exno; INC(exno) ELSE obj.exno := 0 END ; + IF tp.form = ORB.Record THEN + ptbase := pbsList; (*check whether this is base of a pointer type; search and fixup*) + WHILE ptbase # NIL DO + IF obj.name = ptbase.name THEN ptbase.type.base := obj.type END ; + ptbase := ptbase.next + END ; + IF level = 0 THEN ORG.BuildTD(tp, dc) END (*type descriptor; len used as its address*) + END ; + Check(ORS.semicolon, "; missing") + END + END ; + IF sym = ORS.var THEN + ORS.Get(sym); + WHILE sym = ORS.ident DO + IdentList(ORB.Var, first); Type(tp); + obj := first; + WHILE obj # NIL DO + obj.type := tp; obj.lev := level; + IF tp.size > 1 THEN varsize := (varsize + 3) DIV 4 * 4 (*align*) END ; + obj.val := varsize; varsize := varsize + obj.type.size; + IF obj.expo THEN obj.exno := exno; INC(exno) END ; + obj := obj.next + END ; + Check(ORS.semicolon, "; missing") + END + END ; + varsize := (varsize + 3) DIV 4 * 4; + ptbase := pbsList; + WHILE ptbase # NIL DO + IF ptbase.type.base.form = ORB.Int THEN ORS.Mark("undefined pointer base of") END ; + ptbase := ptbase.next + END ; + IF (sym >= ORS.const) & (sym <= ORS.var) THEN ORS.Mark("declaration in bad order") END + END Declarations; + + PROCEDURE ProcedureDecl; + VAR proc: ORB.Object; + type: ORB.Type; + procid: ORS.Ident; + x: ORG.Item; + locblksize, parblksize, L: LONGINT; + int: BOOLEAN; + BEGIN (* ProcedureDecl *) int := FALSE; ORS.Get(sym); + IF sym = ORS.times THEN ORS.Get(sym); int := TRUE END ; + IF sym = ORS.ident THEN + ORS.CopyId(procid); ORS.Get(sym); + ORB.NewObj(proc, ORS.id, ORB.Const); parblksize := 4; + NEW(type); type.form := ORB.Proc; type.size := ORG.WordSize; proc.type := type; + CheckExport(proc.expo); + IF proc.expo THEN proc.exno := exno; INC(exno) END ; + ORB.OpenScope; INC(level); proc.val := -1; type.base := ORB.noType; + ProcedureType(type, parblksize); (*formal parameter list*) + Check(ORS.semicolon, "no ;"); locblksize := parblksize; + Declarations(locblksize); + proc.val := ORG.Here() * 4; proc.type.dsc := ORB.topScope.next; + IF sym = ORS.procedure THEN + L := 0; ORG.FJump(L); + REPEAT ProcedureDecl; Check(ORS.semicolon, "no ;") UNTIL sym # ORS.procedure; + ORG.FixLink(L); proc.val := ORG.Here() * 4; proc.type.dsc := ORB.topScope.next + END ; + ORG.Enter(parblksize, locblksize, int); + IF sym = ORS.begin THEN ORS.Get(sym); StatSequence END ; + IF sym = ORS.return THEN + ORS.Get(sym); expression(x); + IF type.base = ORB.noType THEN ORS.Mark("this is not a function") + ELSIF ~CompTypes(type.base, x.type, FALSE) THEN ORS.Mark("wrong result type") + END + ELSIF type.base.form # ORB.NoTyp THEN + ORS.Mark("function without result"); type.base := ORB.noType + END ; + ORG.Return(type.base.form, x, locblksize, int); + ORB.CloseScope; DEC(level); Check(ORS.end, "no END"); + IF sym = ORS.ident THEN + IF ORS.id # procid THEN ORS.Mark("no match") END ; + ORS.Get(sym) + ELSE ORS.Mark("no proc id") + END + END ; + int := FALSE + END ProcedureDecl; + + PROCEDURE Module; + VAR key: LONGINT; + obj: ORB.Object; + impid, impid1: ORS.Ident; + BEGIN Texts.WriteString(W, " compiling "); ORS.Get(sym); + IF sym = ORS.module THEN + ORS.Get(sym); + IF sym = ORS.times THEN version := 0; Texts.Write(W, "*"); ORS.Get(sym) ELSE version := 1 END ; + ORB.Init; ORB.OpenScope; + IF sym = ORS.ident THEN + ORS.CopyId(modid); ORS.Get(sym); + Texts.WriteString(W, modid); Texts.Append(Oberon.Log, W.buf); + Oberon.DumpLog; (* voc adaptation; -- noch *) + ELSE ORS.Mark("identifier expected") + END ; + Check(ORS.semicolon, "no ;"); level := 0; dc := 0; exno := 1; key := 0; + IF sym = ORS.import THEN + ORS.Get(sym); + WHILE sym = ORS.ident DO + ORS.CopyId(impid); ORS.Get(sym); + IF sym = ORS.becomes THEN + ORS.Get(sym); + IF sym = ORS.ident THEN ORS.CopyId(impid1); ORS.Get(sym) + ELSE ORS.Mark("id expected") + END + ELSE impid1 := impid + END ; + ORB.Import(impid, impid1); + IF sym = ORS.comma THEN ORS.Get(sym) + ELSIF sym = ORS.ident THEN ORS.Mark("comma missing") + END + END ; + Check(ORS.semicolon, "no ;") + END ; + obj := ORB.topScope.next; + ORG.Open(version); Declarations(dc); ORG.SetDataSize((dc + 3) DIV 4 * 4); + WHILE sym = ORS.procedure DO ProcedureDecl; Check(ORS.semicolon, "no ;") END ; + ORG.Header; + IF sym = ORS.begin THEN ORS.Get(sym); StatSequence END ; + Check(ORS.end, "no END"); + IF sym = ORS.ident THEN + IF ORS.id # modid THEN ORS.Mark("no match") END ; + ORS.Get(sym) + ELSE ORS.Mark("identifier missing") + END ; + IF sym # ORS.period THEN ORS.Mark("period missing") END ; + IF (ORS.errcnt = 0) & (version # 0) THEN + ORB.Export(modid, newSF, key); + IF newSF THEN Texts.WriteString(W, " new symbol file") END + END ; + IF ORS.errcnt = 0 THEN + ORG.Close(modid, key, exno); + Texts.WriteInt(W, ORG.pc, 6); Texts.WriteInt(W, dc, 6); Texts.WriteHex(W, key) + ELSE Texts.WriteLn(W); Texts.WriteString(W, "compilation FAILED") + END ; + Texts.WriteLn(W); Texts.Append(Oberon.Log, W.buf); + Oberon.DumpLog; (* voc adaptation; -- noch *) + ORB.CloseScope; pbsList := NIL + ELSE ORS.Mark("must start with MODULE") + END + END Module; + + PROCEDURE Option(VAR S: Texts.Scanner); + BEGIN newSF := FALSE; + IF S.nextCh = "/" THEN + Texts.Scan(S); Texts.Scan(S); + IF (S.class = Texts.Name) & (S.s[0] = "s") THEN newSF := TRUE END + END + END Option; + + PROCEDURE Compile*; + VAR beg, end, time: LONGINT; + T: Texts.Text; + S: Texts.Scanner; + BEGIN Texts.OpenScanner(S, Oberon.Par.text, Oberon.Par.pos); Texts.Scan(S); + IF S.class = Texts.Char THEN + IF S.c = "@" THEN + Option(S); Oberon.GetSelection(T, beg, end, time); + IF time >= 0 THEN ORS.Init(T, beg); Module END + ELSIF S.c = "^" THEN + Option(S); Oberon.GetSelection(T, beg, end, time); + IF time >= 0 THEN + Texts.OpenScanner(S, T, beg); Texts.Scan(S); + IF S.class = Texts.Name THEN + Texts.WriteString(W, S.s); NEW(T); Texts.Open(T, S.s); + IF T.len > 0 THEN ORS.Init(T, 0); Module END + END + END + END + ELSE + WHILE S.class = Texts.Name DO + NEW(T); Texts.Open(T, S.s); + IF T.len > 0 THEN Option(S); ORS.Init(T, 0); Module + ELSE Texts.WriteString(W, S.s); Texts.WriteString(W, " not found"); + Texts.WriteLn(W); Texts.Append(Oberon.Log, W.buf); + Oberon.DumpLog; (* voc adaptation; -- noch *) + END ; + IF (T.len # 0) & (ORS.errcnt = 0) THEN Texts.Scan(S) ELSE S.class := 0 END + END + END ; + Oberon.Collect(0) + END Compile; + +BEGIN Texts.OpenWriter(W); Texts.WriteString(W, "OR Compiler 7.6.2014"); + Texts.WriteLn(W); Texts.Append(Oberon.Log, W.buf); + Oberon.DumpLog; (* voc adaptation; -- noch *) + NEW(dummy); dummy.class := ORB.Var; dummy.type := ORB.intType; + expression := expression0; Type := Type0; FormalType := FormalType0; + + Compile (* voc adaptation; -- noch *) +END ORP. diff --git a/src/voc07R/ORS.Mod b/src/voc07R/ORS.Mod index e17db698..1d005e38 100644 --- a/src/voc07R/ORS.Mod +++ b/src/voc07R/ORS.Mod @@ -1,325 +1,325 @@ -MODULE ORS; (* NW 19.9.93 / 1.4.2014 Scanner in Oberon-07*) - IMPORT SYSTEM, Texts := CompatTexts, Oberon; (* CompatTexts is voc adaptation by noch *) - - TYPE INTEGER = LONGINT; (* voc adaptation by noch *) - -(* Oberon Scanner does lexical analysis. Input is Oberon-Text, output is - sequence of symbols, i.e identifiers, numbers, strings, and special symbols. - Recognises all Oberon keywords and skips comments. The keywords are - recorded in a table. - Get(sym) delivers next symbol from input text with Reader R. - Mark(msg) records error and delivers error message with Writer W. - If Get delivers ident, then the identifier (a string) is in variable id, if int or char - in ival, if real in rval, and if string in str (and slen) *) - - CONST IdLen* = 32; - NKW = 34; (*nof keywords*) - maxExp = 38; stringBufSize = 256; - - (*lexical symbols*) - null = 0; times* = 1; rdiv* = 2; div* = 3; mod* = 4; - and* = 5; plus* = 6; minus* = 7; or* = 8; eql* = 9; - neq* = 10; lss* = 11; leq* = 12; gtr* = 13; geq* = 14; - in* = 15; is* = 16; arrow* = 17; period* = 18; - char* = 20; int* = 21; real* = 22; false* = 23; true* = 24; - nil* = 25; string* = 26; not* = 27; lparen* = 28; lbrak* = 29; - lbrace* = 30; ident* = 31; - if* = 32; while* = 34; repeat* = 35; case* = 36; for* = 37; - comma* = 40; colon* = 41; becomes* = 42; upto* = 43; rparen* = 44; - rbrak* = 45; rbrace* = 46; then* = 47; of* = 48; do* = 49; - to* = 50; by* = 51; semicolon* = 52; end* = 53; bar* = 54; - else* = 55; elsif* = 56; until* = 57; return* = 58; - array* = 60; record* = 61; pointer* = 62; const* = 63; type* = 64; - var* = 65; procedure* = 66; begin* = 67; import* = 68; module* = 69; - - TYPE Ident* = ARRAY IdLen OF CHAR; - - VAR ival*, slen*: LONGINT; (*results of Get*) - rval*: REAL; - id*: Ident; (*for identifiers*) - str*: ARRAY stringBufSize OF CHAR; - errcnt*: INTEGER; - - ch: CHAR; (*last character read*) - errpos: LONGINT; - R: Texts.Reader; - W: Texts.Writer; - k: INTEGER; - KWX: ARRAY 10 OF INTEGER; - keyTab: ARRAY NKW OF - RECORD sym: INTEGER; id: ARRAY 12 OF CHAR END; - - PROCEDURE CopyId*(VAR ident: Ident); - BEGIN ident := id - END CopyId; - - PROCEDURE Pos*(): LONGINT; - BEGIN RETURN Texts.Pos(R) - 1 - END Pos; - - PROCEDURE Mark*(msg: ARRAY OF CHAR); - VAR p: LONGINT; - BEGIN p := Pos(); - IF (p > errpos) & (errcnt < 25) THEN - Texts.WriteLn(W); Texts.WriteString(W, " pos "); Texts.WriteInt(W, p, 1); Texts.Write(W, " "); - Texts.WriteString(W, msg); Texts.Append(Oberon.Log, W.buf); - Oberon.DumpLog; (* voc adaptation by noch *) - END ; - INC(errcnt); errpos := p + 4 - END Mark; - - PROCEDURE Identifier(VAR sym: INTEGER); - VAR i, k: INTEGER; - BEGIN i := 0; - REPEAT - IF i < IdLen-1 THEN id[i] := ch; INC(i) END ; - Texts.Read(R, ch) - UNTIL (ch < "0") OR (ch > "9") & (ch < "A") OR (ch > "Z") & (ch < "a") OR (ch > "z"); - id[i] := 0X; - IF i < 10 THEN k := KWX[i-1]; (*search for keyword*) - WHILE (id # keyTab[k].id) & (k < KWX[i]) DO INC(k) END ; - IF k < KWX[i] THEN sym := keyTab[k].sym ELSE sym := ident END - ELSE sym := ident - END - END Identifier; - - PROCEDURE String; - VAR i: INTEGER; - BEGIN i := 0; Texts.Read(R, ch); - WHILE ~R.eot & (ch # 22X) DO - IF ch >= " " THEN - IF i < stringBufSize-1 THEN str[i] := ch; INC(i) ELSE Mark("string too long") END ; - END ; - Texts.Read(R, ch) - END ; - str[i] := 0X; INC(i); Texts.Read(R, ch); slen := i - END String; - - PROCEDURE HexString; - VAR i, m, n: INTEGER; - BEGIN i := 0; Texts.Read(R, ch); - WHILE ~R.eot & (ch # "$") DO - WHILE (ch = " ") OR (ch = 9X) OR (ch = 0DX) DO Texts.Read(R, ch) END ; (*skip*) - IF ("0" <= ch) & (ch <= "9") THEN m := ORD(ch) - 30H - ELSIF ("A" <= ch) & (ch <= "F") THEN m := ORD(ch) - 37H - ELSE m := 0; Mark("hexdig expected") - END ; - Texts.Read(R, ch); - IF ("0" <= ch) & (ch <= "9") THEN n := ORD(ch) - 30H - ELSIF ("A" <= ch) & (ch <= "F") THEN n := ORD(ch) - 37H - ELSE n := 0; Mark("hexdig expected") - END ; - IF i < stringBufSize THEN str[i] := CHR(m*10H + n); INC(i) ELSE Mark("string too long") END ; - Texts.Read(R, ch) - END ; - Texts.Read(R, ch); slen := i (*no 0X appended!*) - END HexString; - - PROCEDURE Ten(e: LONGINT): REAL; - VAR x, t: REAL; - BEGIN x := 1.0; t := 10.0; - WHILE e > 0 DO - IF ODD(e) THEN x := t * x END ; - t := t * t; e := e DIV 2 - END ; - RETURN x - END Ten; - - PROCEDURE Number(VAR sym: INTEGER); - CONST max = 2147483647 (*2^31 - 1*); - VAR i, k, e, n, s, h: LONGINT; x: REAL; - d: ARRAY 16 OF INTEGER; - negE: BOOLEAN; - BEGIN ival := 0; i := 0; n := 0; k := 0; - REPEAT - IF n < 16 THEN d[n] := ORD(ch)-30H; INC(n) ELSE Mark("too many digits"); n := 0 END ; - Texts.Read(R, ch) - UNTIL (ch < "0") OR (ch > "9") & (ch < "A") OR (ch > "F"); - IF (ch = "H") OR (ch = "R") OR (ch = "X") THEN (*hex*) - REPEAT h := d[i]; - IF h >= 10 THEN h := h-7 END ; - k := k*10H + h; INC(i) (*no overflow check*) - UNTIL i = n; - IF ch = "X" THEN sym := char; - IF k < 100H THEN ival := k ELSE Mark("illegal value"); ival := 0 END - ELSIF ch = "R" THEN sym := real; rval := SYSTEM.VAL(REAL, k) - ELSE sym := int; ival := k - END ; - Texts.Read(R, ch) - ELSIF ch = "." THEN - Texts.Read(R, ch); - IF ch = "." THEN (*double dot*) ch := 7FX; (*decimal integer*) - REPEAT - IF d[i] < 10 THEN - IF k <= (max-d[i]) DIV 10 THEN k := k *10 + d[i] ELSE Mark("too large"); k := 0 END - ELSE Mark("bad integer") - END ; - INC(i) - UNTIL i = n; - sym := int; ival := k - ELSE (*real number*) x := 0.0; e := 0; - REPEAT (*integer part*) - (*x := x * 10.0 + FLT(d[i]); *) - x := x * 10.0 + (d[i]); (* voc adaptation by noch *) - INC(i) - UNTIL i = n; - WHILE (ch >= "0") & (ch <= "9") DO (*fraction*) - (*x := x * 10.0 + FLT(ORD(ch) - 30H);*) - x := x * 10.0 + (ORD(ch) - 30H); (* voc adaptation by noch *) - DEC(e); - Texts.Read(R, ch) - END ; - IF (ch = "E") OR (ch = "D") THEN (*scale factor*) - Texts.Read(R, ch); s := 0; - IF ch = "-" THEN negE := TRUE; Texts.Read(R, ch) - ELSE negE := FALSE; - IF ch = "+" THEN Texts.Read(R, ch) END - END ; - IF (ch >= "0") & (ch <= "9") THEN - REPEAT s := s*10 + ORD(ch)-30H; Texts.Read(R, ch) - UNTIL (ch < "0") OR (ch >"9"); - IF negE THEN e := e-s ELSE e := e+s END - ELSE Mark("digit?") - END - END ; - IF e < 0 THEN - IF e >= -maxExp THEN x := x / Ten(-e) ELSE x := 0.0 END - ELSIF e > 0 THEN - IF e <= maxExp THEN x := Ten(e) * x ELSE x := 0.0; Mark("too large") END - END ; - sym := real; rval := x - END - ELSE (*decimal integer*) - REPEAT - IF d[i] < 10 THEN - IF k <= (max-d[i]) DIV 10 THEN k := k*10 + d[i] ELSE Mark("too large"); k := 0 END - ELSE Mark("bad integer") - END ; - INC(i) - UNTIL i = n; - sym := int; ival := k - END - END Number; - - PROCEDURE comment; - BEGIN Texts.Read(R, ch); - REPEAT - WHILE ~R.eot & (ch # "*") DO - IF ch = "(" THEN Texts.Read(R, ch); - IF ch = "*" THEN comment END - ELSE Texts.Read(R, ch) - END - END ; - WHILE ch = "*" DO Texts.Read(R, ch) END - UNTIL (ch = ")") OR R.eot; - IF ~R.eot THEN Texts.Read(R, ch) ELSE Mark("unterminated comment") END - END comment; - - PROCEDURE Get*(VAR sym: INTEGER); - BEGIN - REPEAT - WHILE ~R.eot & (ch <= " ") DO Texts.Read(R, ch) END; - IF ch < "A" THEN - IF ch < "0" THEN - IF ch = 22X THEN String; sym := string - ELSIF ch = "#" THEN Texts.Read(R, ch); sym := neq - ELSIF ch = "$" THEN HexString; sym := string - ELSIF ch = "&" THEN Texts.Read(R, ch); sym := and - ELSIF ch = "(" THEN Texts.Read(R, ch); - IF ch = "*" THEN sym := null; comment ELSE sym := lparen END - ELSIF ch = ")" THEN Texts.Read(R, ch); sym := rparen - ELSIF ch = "*" THEN Texts.Read(R, ch); sym := times - ELSIF ch = "+" THEN Texts.Read(R, ch); sym := plus - ELSIF ch = "," THEN Texts.Read(R, ch); sym := comma - ELSIF ch = "-" THEN Texts.Read(R, ch); sym := minus - ELSIF ch = "." THEN Texts.Read(R, ch); - IF ch = "." THEN Texts.Read(R, ch); sym := upto ELSE sym := period END - ELSIF ch = "/" THEN Texts.Read(R, ch); sym := rdiv - ELSE Texts.Read(R, ch); (* ! % ' *) sym := null - END - ELSIF ch < ":" THEN Number(sym) - ELSIF ch = ":" THEN Texts.Read(R, ch); - IF ch = "=" THEN Texts.Read(R, ch); sym := becomes ELSE sym := colon END - ELSIF ch = ";" THEN Texts.Read(R, ch); sym := semicolon - ELSIF ch = "<" THEN Texts.Read(R, ch); - IF ch = "=" THEN Texts.Read(R, ch); sym := leq ELSE sym := lss END - ELSIF ch = "=" THEN Texts.Read(R, ch); sym := eql - ELSIF ch = ">" THEN Texts.Read(R, ch); - IF ch = "=" THEN Texts.Read(R, ch); sym := geq ELSE sym := gtr END - ELSE (* ? @ *) Texts.Read(R, ch); sym := null - END - ELSIF ch < "[" THEN Identifier(sym) - ELSIF ch < "a" THEN - IF ch = "[" THEN sym := lbrak - ELSIF ch = "]" THEN sym := rbrak - ELSIF ch = "^" THEN sym := arrow - ELSE (* _ ` *) sym := null - END ; - Texts.Read(R, ch) - ELSIF ch < "{" THEN Identifier(sym) ELSE - IF ch = "{" THEN sym := lbrace - ELSIF ch = "}" THEN sym := rbrace - ELSIF ch = "|" THEN sym := bar - ELSIF ch = "~" THEN sym := not - ELSIF ch = 7FX THEN sym := upto - ELSE sym := null - END ; - Texts.Read(R, ch) - END - UNTIL sym # null - END Get; - - PROCEDURE Init*(T: Texts.Text; pos: LONGINT); - BEGIN errpos := pos; errcnt := 0; Texts.OpenReader(R, T, pos); Texts.Read(R, ch) - END Init; - - PROCEDURE EnterKW(sym: INTEGER; name: ARRAY OF CHAR); - BEGIN - (*keyTab[k].id := name; *) - COPY(name, keyTab[k].id); (* voc adaptation by noch *) - keyTab[k].sym := sym; - INC(k) - END EnterKW; - -BEGIN Texts.OpenWriter(W); k := 0; KWX[0] := 0; KWX[1] := 0; - EnterKW(if, "IF"); - EnterKW(do, "DO"); - EnterKW(of, "OF"); - EnterKW(or, "OR"); - EnterKW(to, "TO"); - EnterKW(in, "IN"); - EnterKW(is, "IS"); - EnterKW(by, "BY"); - KWX[2] := k; - EnterKW(end, "END"); - EnterKW(nil, "NIL"); - EnterKW(var, "VAR"); - EnterKW(div, "DIV"); - EnterKW(mod, "MOD"); - EnterKW(for, "FOR"); - KWX[3] := k; - EnterKW(else, "ELSE"); - EnterKW(then, "THEN"); - EnterKW(true, "TRUE"); - EnterKW(type, "TYPE"); - EnterKW(case, "CASE"); - KWX[4] := k; - EnterKW(elsif, "ELSIF"); - EnterKW(false, "FALSE"); - EnterKW(array, "ARRAY"); - EnterKW(begin, "BEGIN"); - EnterKW(const, "CONST"); - EnterKW(until, "UNTIL"); - EnterKW(while, "WHILE"); - KWX[5] := k; - EnterKW(record, "RECORD"); - EnterKW(repeat, "REPEAT"); - EnterKW(return, "RETURN"); - EnterKW(import, "IMPORT"); - EnterKW(module, "MODULE"); - KWX[6] := k; - EnterKW(pointer, "POINTER"); - KWX[7] := k; KWX[8] := k; - EnterKW(procedure, "PROCEDURE"); - KWX[9] := k -END ORS. +MODULE ORS; (* NW 19.9.93 / 1.4.2014 Scanner in Oberon-07*) + IMPORT SYSTEM, Texts := CompatTexts, Oberon; (* CompatTexts is voc adaptation by noch *) + + TYPE INTEGER = LONGINT; (* voc adaptation by noch *) + +(* Oberon Scanner does lexical analysis. Input is Oberon-Text, output is + sequence of symbols, i.e identifiers, numbers, strings, and special symbols. + Recognises all Oberon keywords and skips comments. The keywords are + recorded in a table. + Get(sym) delivers next symbol from input text with Reader R. + Mark(msg) records error and delivers error message with Writer W. + If Get delivers ident, then the identifier (a string) is in variable id, if int or char + in ival, if real in rval, and if string in str (and slen) *) + + CONST IdLen* = 32; + NKW = 34; (*nof keywords*) + maxExp = 38; stringBufSize = 256; + + (*lexical symbols*) + null = 0; times* = 1; rdiv* = 2; div* = 3; mod* = 4; + and* = 5; plus* = 6; minus* = 7; or* = 8; eql* = 9; + neq* = 10; lss* = 11; leq* = 12; gtr* = 13; geq* = 14; + in* = 15; is* = 16; arrow* = 17; period* = 18; + char* = 20; int* = 21; real* = 22; false* = 23; true* = 24; + nil* = 25; string* = 26; not* = 27; lparen* = 28; lbrak* = 29; + lbrace* = 30; ident* = 31; + if* = 32; while* = 34; repeat* = 35; case* = 36; for* = 37; + comma* = 40; colon* = 41; becomes* = 42; upto* = 43; rparen* = 44; + rbrak* = 45; rbrace* = 46; then* = 47; of* = 48; do* = 49; + to* = 50; by* = 51; semicolon* = 52; end* = 53; bar* = 54; + else* = 55; elsif* = 56; until* = 57; return* = 58; + array* = 60; record* = 61; pointer* = 62; const* = 63; type* = 64; + var* = 65; procedure* = 66; begin* = 67; import* = 68; module* = 69; + + TYPE Ident* = ARRAY IdLen OF CHAR; + + VAR ival*, slen*: LONGINT; (*results of Get*) + rval*: REAL; + id*: Ident; (*for identifiers*) + str*: ARRAY stringBufSize OF CHAR; + errcnt*: INTEGER; + + ch: CHAR; (*last character read*) + errpos: LONGINT; + R: Texts.Reader; + W: Texts.Writer; + k: INTEGER; + KWX: ARRAY 10 OF INTEGER; + keyTab: ARRAY NKW OF + RECORD sym: INTEGER; id: ARRAY 12 OF CHAR END; + + PROCEDURE CopyId*(VAR ident: Ident); + BEGIN ident := id + END CopyId; + + PROCEDURE Pos*(): LONGINT; + BEGIN RETURN Texts.Pos(R) - 1 + END Pos; + + PROCEDURE Mark*(msg: ARRAY OF CHAR); + VAR p: LONGINT; + BEGIN p := Pos(); + IF (p > errpos) & (errcnt < 25) THEN + Texts.WriteLn(W); Texts.WriteString(W, " pos "); Texts.WriteInt(W, p, 1); Texts.Write(W, " "); + Texts.WriteString(W, msg); Texts.Append(Oberon.Log, W.buf); + Oberon.DumpLog; (* voc adaptation by noch *) + END ; + INC(errcnt); errpos := p + 4 + END Mark; + + PROCEDURE Identifier(VAR sym: INTEGER); + VAR i, k: INTEGER; + BEGIN i := 0; + REPEAT + IF i < IdLen-1 THEN id[i] := ch; INC(i) END ; + Texts.Read(R, ch) + UNTIL (ch < "0") OR (ch > "9") & (ch < "A") OR (ch > "Z") & (ch < "a") OR (ch > "z"); + id[i] := 0X; + IF i < 10 THEN k := KWX[i-1]; (*search for keyword*) + WHILE (id # keyTab[k].id) & (k < KWX[i]) DO INC(k) END ; + IF k < KWX[i] THEN sym := keyTab[k].sym ELSE sym := ident END + ELSE sym := ident + END + END Identifier; + + PROCEDURE String; + VAR i: INTEGER; + BEGIN i := 0; Texts.Read(R, ch); + WHILE ~R.eot & (ch # 22X) DO + IF ch >= " " THEN + IF i < stringBufSize-1 THEN str[i] := ch; INC(i) ELSE Mark("string too long") END ; + END ; + Texts.Read(R, ch) + END ; + str[i] := 0X; INC(i); Texts.Read(R, ch); slen := i + END String; + + PROCEDURE HexString; + VAR i, m, n: INTEGER; + BEGIN i := 0; Texts.Read(R, ch); + WHILE ~R.eot & (ch # "$") DO + WHILE (ch = " ") OR (ch = 9X) OR (ch = 0DX) DO Texts.Read(R, ch) END ; (*skip*) + IF ("0" <= ch) & (ch <= "9") THEN m := ORD(ch) - 30H + ELSIF ("A" <= ch) & (ch <= "F") THEN m := ORD(ch) - 37H + ELSE m := 0; Mark("hexdig expected") + END ; + Texts.Read(R, ch); + IF ("0" <= ch) & (ch <= "9") THEN n := ORD(ch) - 30H + ELSIF ("A" <= ch) & (ch <= "F") THEN n := ORD(ch) - 37H + ELSE n := 0; Mark("hexdig expected") + END ; + IF i < stringBufSize THEN str[i] := CHR(m*10H + n); INC(i) ELSE Mark("string too long") END ; + Texts.Read(R, ch) + END ; + Texts.Read(R, ch); slen := i (*no 0X appended!*) + END HexString; + + PROCEDURE Ten(e: LONGINT): REAL; + VAR x, t: REAL; + BEGIN x := 1.0; t := 10.0; + WHILE e > 0 DO + IF ODD(e) THEN x := t * x END ; + t := t * t; e := e DIV 2 + END ; + RETURN x + END Ten; + + PROCEDURE Number(VAR sym: INTEGER); + CONST max = 2147483647 (*2^31 - 1*); + VAR i, k, e, n, s, h: LONGINT; x: REAL; + d: ARRAY 16 OF INTEGER; + negE: BOOLEAN; + BEGIN ival := 0; i := 0; n := 0; k := 0; + REPEAT + IF n < 16 THEN d[n] := ORD(ch)-30H; INC(n) ELSE Mark("too many digits"); n := 0 END ; + Texts.Read(R, ch) + UNTIL (ch < "0") OR (ch > "9") & (ch < "A") OR (ch > "F"); + IF (ch = "H") OR (ch = "R") OR (ch = "X") THEN (*hex*) + REPEAT h := d[i]; + IF h >= 10 THEN h := h-7 END ; + k := k*10H + h; INC(i) (*no overflow check*) + UNTIL i = n; + IF ch = "X" THEN sym := char; + IF k < 100H THEN ival := k ELSE Mark("illegal value"); ival := 0 END + ELSIF ch = "R" THEN sym := real; rval := SYSTEM.VAL(REAL, k) + ELSE sym := int; ival := k + END ; + Texts.Read(R, ch) + ELSIF ch = "." THEN + Texts.Read(R, ch); + IF ch = "." THEN (*double dot*) ch := 7FX; (*decimal integer*) + REPEAT + IF d[i] < 10 THEN + IF k <= (max-d[i]) DIV 10 THEN k := k *10 + d[i] ELSE Mark("too large"); k := 0 END + ELSE Mark("bad integer") + END ; + INC(i) + UNTIL i = n; + sym := int; ival := k + ELSE (*real number*) x := 0.0; e := 0; + REPEAT (*integer part*) + (*x := x * 10.0 + FLT(d[i]); *) + x := x * 10.0 + (d[i]); (* voc adaptation by noch *) + INC(i) + UNTIL i = n; + WHILE (ch >= "0") & (ch <= "9") DO (*fraction*) + (*x := x * 10.0 + FLT(ORD(ch) - 30H);*) + x := x * 10.0 + (ORD(ch) - 30H); (* voc adaptation by noch *) + DEC(e); + Texts.Read(R, ch) + END ; + IF (ch = "E") OR (ch = "D") THEN (*scale factor*) + Texts.Read(R, ch); s := 0; + IF ch = "-" THEN negE := TRUE; Texts.Read(R, ch) + ELSE negE := FALSE; + IF ch = "+" THEN Texts.Read(R, ch) END + END ; + IF (ch >= "0") & (ch <= "9") THEN + REPEAT s := s*10 + ORD(ch)-30H; Texts.Read(R, ch) + UNTIL (ch < "0") OR (ch >"9"); + IF negE THEN e := e-s ELSE e := e+s END + ELSE Mark("digit?") + END + END ; + IF e < 0 THEN + IF e >= -maxExp THEN x := x / Ten(-e) ELSE x := 0.0 END + ELSIF e > 0 THEN + IF e <= maxExp THEN x := Ten(e) * x ELSE x := 0.0; Mark("too large") END + END ; + sym := real; rval := x + END + ELSE (*decimal integer*) + REPEAT + IF d[i] < 10 THEN + IF k <= (max-d[i]) DIV 10 THEN k := k*10 + d[i] ELSE Mark("too large"); k := 0 END + ELSE Mark("bad integer") + END ; + INC(i) + UNTIL i = n; + sym := int; ival := k + END + END Number; + + PROCEDURE comment; + BEGIN Texts.Read(R, ch); + REPEAT + WHILE ~R.eot & (ch # "*") DO + IF ch = "(" THEN Texts.Read(R, ch); + IF ch = "*" THEN comment END + ELSE Texts.Read(R, ch) + END + END ; + WHILE ch = "*" DO Texts.Read(R, ch) END + UNTIL (ch = ")") OR R.eot; + IF ~R.eot THEN Texts.Read(R, ch) ELSE Mark("unterminated comment") END + END comment; + + PROCEDURE Get*(VAR sym: INTEGER); + BEGIN + REPEAT + WHILE ~R.eot & (ch <= " ") DO Texts.Read(R, ch) END; + IF ch < "A" THEN + IF ch < "0" THEN + IF ch = 22X THEN String; sym := string + ELSIF ch = "#" THEN Texts.Read(R, ch); sym := neq + ELSIF ch = "$" THEN HexString; sym := string + ELSIF ch = "&" THEN Texts.Read(R, ch); sym := and + ELSIF ch = "(" THEN Texts.Read(R, ch); + IF ch = "*" THEN sym := null; comment ELSE sym := lparen END + ELSIF ch = ")" THEN Texts.Read(R, ch); sym := rparen + ELSIF ch = "*" THEN Texts.Read(R, ch); sym := times + ELSIF ch = "+" THEN Texts.Read(R, ch); sym := plus + ELSIF ch = "," THEN Texts.Read(R, ch); sym := comma + ELSIF ch = "-" THEN Texts.Read(R, ch); sym := minus + ELSIF ch = "." THEN Texts.Read(R, ch); + IF ch = "." THEN Texts.Read(R, ch); sym := upto ELSE sym := period END + ELSIF ch = "/" THEN Texts.Read(R, ch); sym := rdiv + ELSE Texts.Read(R, ch); (* ! % ' *) sym := null + END + ELSIF ch < ":" THEN Number(sym) + ELSIF ch = ":" THEN Texts.Read(R, ch); + IF ch = "=" THEN Texts.Read(R, ch); sym := becomes ELSE sym := colon END + ELSIF ch = ";" THEN Texts.Read(R, ch); sym := semicolon + ELSIF ch = "<" THEN Texts.Read(R, ch); + IF ch = "=" THEN Texts.Read(R, ch); sym := leq ELSE sym := lss END + ELSIF ch = "=" THEN Texts.Read(R, ch); sym := eql + ELSIF ch = ">" THEN Texts.Read(R, ch); + IF ch = "=" THEN Texts.Read(R, ch); sym := geq ELSE sym := gtr END + ELSE (* ? @ *) Texts.Read(R, ch); sym := null + END + ELSIF ch < "[" THEN Identifier(sym) + ELSIF ch < "a" THEN + IF ch = "[" THEN sym := lbrak + ELSIF ch = "]" THEN sym := rbrak + ELSIF ch = "^" THEN sym := arrow + ELSE (* _ ` *) sym := null + END ; + Texts.Read(R, ch) + ELSIF ch < "{" THEN Identifier(sym) ELSE + IF ch = "{" THEN sym := lbrace + ELSIF ch = "}" THEN sym := rbrace + ELSIF ch = "|" THEN sym := bar + ELSIF ch = "~" THEN sym := not + ELSIF ch = 7FX THEN sym := upto + ELSE sym := null + END ; + Texts.Read(R, ch) + END + UNTIL sym # null + END Get; + + PROCEDURE Init*(T: Texts.Text; pos: LONGINT); + BEGIN errpos := pos; errcnt := 0; Texts.OpenReader(R, T, pos); Texts.Read(R, ch) + END Init; + + PROCEDURE EnterKW(sym: INTEGER; name: ARRAY OF CHAR); + BEGIN + (*keyTab[k].id := name; *) + COPY(name, keyTab[k].id); (* voc adaptation by noch *) + keyTab[k].sym := sym; + INC(k) + END EnterKW; + +BEGIN Texts.OpenWriter(W); k := 0; KWX[0] := 0; KWX[1] := 0; + EnterKW(if, "IF"); + EnterKW(do, "DO"); + EnterKW(of, "OF"); + EnterKW(or, "OR"); + EnterKW(to, "TO"); + EnterKW(in, "IN"); + EnterKW(is, "IS"); + EnterKW(by, "BY"); + KWX[2] := k; + EnterKW(end, "END"); + EnterKW(nil, "NIL"); + EnterKW(var, "VAR"); + EnterKW(div, "DIV"); + EnterKW(mod, "MOD"); + EnterKW(for, "FOR"); + KWX[3] := k; + EnterKW(else, "ELSE"); + EnterKW(then, "THEN"); + EnterKW(true, "TRUE"); + EnterKW(type, "TYPE"); + EnterKW(case, "CASE"); + KWX[4] := k; + EnterKW(elsif, "ELSIF"); + EnterKW(false, "FALSE"); + EnterKW(array, "ARRAY"); + EnterKW(begin, "BEGIN"); + EnterKW(const, "CONST"); + EnterKW(until, "UNTIL"); + EnterKW(while, "WHILE"); + KWX[5] := k; + EnterKW(record, "RECORD"); + EnterKW(repeat, "REPEAT"); + EnterKW(return, "RETURN"); + EnterKW(import, "IMPORT"); + EnterKW(module, "MODULE"); + KWX[6] := k; + EnterKW(pointer, "POINTER"); + KWX[7] := k; KWX[8] := k; + EnterKW(procedure, "PROCEDURE"); + KWX[9] := k +END ORS. diff --git a/src/voc07R/ORTool.Mod b/src/voc07R/ORTool.Mod index 3c3f9411..e0a08d42 100644 --- a/src/voc07R/ORTool.Mod +++ b/src/voc07R/ORTool.Mod @@ -1,251 +1,251 @@ -MODULE ORTool; (*NW 18.2.2013*) - IMPORT SYSTEM, Files, Texts, Oberon, ORB; - VAR W: Texts.Writer; - Form: INTEGER; (*result of ReadType*) - mnemo0, mnemo1: ARRAY 16, 4 OF CHAR; (*mnemonics*) - - PROCEDURE Read(VAR R: Files.Rider; VAR n: INTEGER); - VAR b: BYTE; - BEGIN Files.ReadByte(R, b); - IF b < 80H THEN n := b ELSE n := b - 100H END - END Read; - - PROCEDURE ReadType(VAR R: Files.Rider); - VAR key, len, lev, size, off: INTEGER; - ref, mno, class, form, readonly: INTEGER; - name, modname: ARRAY 32 OF CHAR; - BEGIN Read(R, ref); Texts.Write(W, " "); Texts.Write(W, "["); - IF ref < 0 THEN Texts.Write(W, "^"); Texts.WriteInt(W, -ref, 1) - ELSE Texts.WriteInt(W, ref, 1); - Read(R, form); Texts.WriteString(W, " form = "); Texts.WriteInt(W, form, 1); - IF form = ORB.Pointer THEN ReadType(R) - ELSIF form = ORB.Array THEN - ReadType(R); Files.ReadNum(R, len); Files.ReadNum(R, size); - Texts.WriteString(W, " len = "); Texts.WriteInt(W, len, 1); - Texts.WriteString(W, " size = "); Texts.WriteInt(W, size, 1) - ELSIF form = ORB.Record THEN - ReadType(R); (*base type*) - Files.ReadNum(R, off); Texts.WriteString(W, " exno = "); Texts.WriteInt(W, off, 1); - Files.ReadNum(R, off); Texts.WriteString(W, " extlev = "); Texts.WriteInt(W, off, 1); - Files.ReadNum(R, size); Texts.WriteString(W, " size = "); Texts.WriteInt(W, size, 1); - Texts.Write(W, " "); Texts.Write(W, "{"); Read(R, class); - WHILE class # 0 DO (*fields*) - Files.ReadString(R, name); - IF name[0] # 0X THEN Texts.Write(W, " "); Texts.WriteString(W, name); ReadType(R) - ELSE Texts.WriteString(W, " --") - END ; - Files.ReadNum(R, off); Texts.WriteInt(W, off, 4); Read(R, class) - END ; - Texts.Write(W, "}") - ELSIF form = ORB.Proc THEN - ReadType(R); Texts.Write(W, "("); Read(R, class); - WHILE class # 0 DO - Texts.WriteString(W, " class = "); Texts.WriteInt(W, class, 1); Read(R, readonly); - IF readonly = 1 THEN Texts.Write(W, "#") END ; - ReadType(R); Read(R, class) - END ; - Texts.Write(W, ")") - END ; - Files.ReadString(R, modname); - IF modname[0] # 0X THEN - Files.ReadInt(R, key); Files.ReadString(R, name); - Texts.Write(W, " "); Texts.WriteString(W, modname); Texts.Write(W, "."); Texts.WriteString(W, name); - Texts.WriteHex(W, key) - END - END ; - Form := form; Texts.Write(W, "]") - END ReadType; - - PROCEDURE DecSym*; (*decode symbol file*) - VAR class, typno, k: INTEGER; - name: ARRAY 32 OF CHAR; - F: Files.File; R: Files.Rider; - S: Texts.Scanner; - BEGIN Texts.OpenScanner(S, Oberon.Par.text, Oberon.Par.pos); Texts.Scan(S); - IF S.class = Texts.Name THEN - Texts.WriteString(W, "OR-decode "); Texts.WriteString(W, S.s); - Texts.WriteLn(W); Texts.Append(Oberon.Log, W.buf); - F := Files.Old(S.s); - IF F # NIL THEN - Files.Set(R, F, 0); Files.ReadInt(R, k); Files.ReadInt(R, k); - Files.ReadString(R, name); Texts.WriteString(W, name); Texts.WriteHex(W, k); - Read(R, class); Texts.WriteInt(W, class, 3); (*sym file version*) - IF class = ORB.versionkey THEN - Texts.WriteLn(W); Read(R, class); - WHILE class # 0 DO - Texts.WriteInt(W, class, 4); Files.ReadString(R, name); Texts.Write(W, " "); Texts.WriteString(W, name); - ReadType(R); - IF class = ORB.Typ THEN - Texts.Write(W, "("); Read(R, class); - WHILE class # 0 DO (*pointer base fixup*) - Texts.WriteString(W, " ->"); Texts.WriteInt(W, class, 4); Read(R, class) - END ; - Texts.Write(W, ")") - ELSIF (class = ORB.Const) OR (class = ORB.Var) THEN - Files.ReadNum(R, k); Texts.WriteInt(W, k, 5); (*Reals, Strings!*) - END ; - Texts.WriteLn(W); Texts.Append(Oberon.Log, W.buf); - Read(R, class) - END - ELSE Texts.WriteString(W, " bad symfile version") - END - ELSE Texts.WriteString(W, " not found") - END ; - Texts.WriteLn(W); Texts.Append(Oberon.Log, W.buf) - END - END DecSym; - -(* ---------------------------------------------------*) - - PROCEDURE WriteReg(r: LONGINT); - BEGIN Texts.Write(W, " "); - IF r < 12 THEN Texts.WriteString(W, " R"); Texts.WriteInt(W, r MOD 10H, 1) - ELSIF r = 12 THEN Texts.WriteString(W, "MT") - ELSIF r = 13 THEN Texts.WriteString(W, "SB") - ELSIF r = 14 THEN Texts.WriteString(W, "SP") - ELSE Texts.WriteString(W, "LNK") - END - END WriteReg; - - PROCEDURE opcode(w: LONGINT); - VAR k, op, u, a, b, c: LONGINT; - BEGIN - k := w DIV 40000000H MOD 4; - a := w DIV 1000000H MOD 10H; - b := w DIV 100000H MOD 10H; - op := w DIV 10000H MOD 10H; - u := w DIV 20000000H MOD 2; - IF k = 0 THEN - Texts.WriteString(W, mnemo0[op]); - IF u = 1 THEN Texts.Write(W, "'") END ; - WriteReg(a); WriteReg(b); WriteReg(w MOD 10H) - ELSIF k = 1 THEN - Texts.WriteString(W, mnemo0[op]); - IF u = 1 THEN Texts.Write(W, "'") END ; - WriteReg(a); WriteReg(b); w := w MOD 10000H; - IF w >= 8000H THEN w := w - 10000H END ; - Texts.WriteInt(W, w, 7) - ELSIF k = 2 THEN (*LDR/STR*) - IF u = 1 THEN Texts.WriteString(W, "STR ") ELSE Texts.WriteString(W, "LDR") END ; - WriteReg(a); WriteReg(b); w := w MOD 100000H; - IF w >= 80000H THEN w := w - 100000H END ; - Texts.WriteInt(W, w, 8) - ELSIF k = 3 THEN (*Branch instr*) - Texts.Write(W, "B"); - IF ODD(w DIV 10000000H) THEN Texts.Write(W, "L") END ; - Texts.WriteString(W, mnemo1[a]); - IF u = 0 THEN WriteReg(w MOD 10H) ELSE - w := w MOD 100000H; - IF w >= 80000H THEN w := w - 100000H END ; - Texts.WriteInt(W, w, 8) - END - END - END opcode; - - PROCEDURE Sync(VAR R: Files.Rider); - VAR ch: CHAR; - BEGIN Files.Read(R, ch); Texts.WriteString(W, "Sync "); Texts.Write(W, ch); Texts.WriteLn(W) - END Sync; - - PROCEDURE Write(VAR R: Files.Rider; x: INTEGER); - BEGIN Files.WriteByte(R, x) (* -128 <= x < 128 *) - END Write; - - PROCEDURE DecObj*; (*decode object file*) - VAR class, i, n, key, size, fix, adr, data, len: INTEGER; - ch: CHAR; - name: ARRAY 32 OF CHAR; - F: Files.File; R: Files.Rider; - S: Texts.Scanner; - BEGIN Texts.OpenScanner(S, Oberon.Par.text, Oberon.Par.pos); Texts.Scan(S); - IF S.class = Texts.Name THEN - Texts.WriteString(W, "decode "); Texts.WriteString(W, S.s); F := Files.Old(S.s); - IF F # NIL THEN - Files.Set(R, F, 0); Files.ReadString(R, name); Texts.WriteLn(W); Texts.WriteString(W, name); - Files.ReadInt(R, key); Texts.WriteHex(W, key); Read(R, class); Texts.WriteInt(W, class, 4); (*version*) - Files.ReadInt(R, size); Texts.WriteInt(W, size, 6); Texts.WriteLn(W); - Texts.WriteString(W, "imports:"); Texts.WriteLn(W); Files.ReadString(R, name); - WHILE name[0] # 0X DO - Texts.Write(W, 9X); Texts.WriteString(W, name); - Files.ReadInt(R, key); Texts.WriteHex(W, key); Texts.WriteLn(W); - Files.ReadString(R, name) - END ; - (* Sync(R); *) - Texts.WriteString(W, "type descriptors"); Texts.WriteLn(W); - Files.ReadInt(R, n); n := n DIV 4; i := 0; - WHILE i < n DO Files.ReadInt(R, data); Texts.WriteHex(W, data); INC(i) END ; - Texts.WriteLn(W); - Texts.WriteString(W, "data"); Files.ReadInt(R, data); Texts.WriteInt(W, data, 6); Texts.WriteLn(W); - Texts.WriteString(W, "strings"); Texts.WriteLn(W); - Files.ReadInt(R, n); i := 0; - WHILE i < n DO Files.Read(R, ch); Texts.Write(W, ch); INC(i) END ; - Texts.WriteLn(W); - Texts.WriteString(W, "code"); Texts.WriteLn(W); - Files.ReadInt(R, n); i := 0; - WHILE i < n DO - Files.ReadInt(R, data); Texts.WriteInt(W, i, 4); Texts.Write(W, 9X); Texts.WriteHex(W, data); - Texts.Write(W, 9X); opcode(data); Texts.WriteLn(W); INC(i) - END ; - (* Sync(R); *) - Texts.WriteString(W, "commands:"); Texts.WriteLn(W); - Files.ReadString(R, name); - WHILE name[0] # 0X DO - Texts.Write(W, 9X); Texts.WriteString(W, name); - Files.ReadInt(R, adr); Texts.WriteInt(W, adr, 5); Texts.WriteLn(W); - Files.ReadString(R, name) - END ; - (* Sync(R); *) - Texts.WriteString(W, "entries"); Texts.WriteLn(W); - Files.ReadInt(R, n); i := 0; - WHILE i < n DO - Files.ReadInt(R, adr); Texts.WriteInt(W, adr, 6); INC(i) - END ; - Texts.WriteLn(W); - (* Sync(R); *) - Texts.WriteString(W, "pointer refs"); Texts.WriteLn(W); Files.ReadInt(R, adr); - WHILE adr # -1 DO Texts.WriteInt(W, adr, 6); Files.ReadInt(R, adr) END ; - Texts.WriteLn(W); - (* Sync(R); *) - Files.ReadInt(R, data); Texts.WriteString(W, "fixP = "); Texts.WriteInt(W, data, 8); Texts.WriteLn(W); - Files.ReadInt(R, data); Texts.WriteString(W, "fixD = "); Texts.WriteInt(W, data, 8); Texts.WriteLn(W); - Files.ReadInt(R, data); Texts.WriteString(W, "fixT = "); Texts.WriteInt(W, data, 8); Texts.WriteLn(W); - Files.ReadInt(R, data); Texts.WriteString(W, "entry = "); Texts.WriteInt(W, data, 8); Texts.WriteLn(W); - Files.Read(R, ch); - IF ch # "O" THEN Texts.WriteString(W, "format eror"); Texts.WriteLn(W) END - (* Sync(R); *) - ELSE Texts.WriteString(W, " not found"); Texts.WriteLn(W) - END ; - Texts.Append(Oberon.Log, W.buf) - END - END DecObj; - -BEGIN Texts.OpenWriter(W); Texts.WriteString(W, "ORTool 18.2.2013"); - Texts.WriteLn(W); Texts.Append(Oberon.Log, W.buf); - mnemo0[0] := "MOV"; - mnemo0[1] := "LSL"; - mnemo0[2] := "ASR"; - mnemo0[3] := "ROR"; - mnemo0[4] := "AND"; - mnemo0[5] := "ANN"; - mnemo0[6] := "IOR"; - mnemo0[7] := "XOR"; - mnemo0[8] := "ADD"; - mnemo0[9] := "SUB"; - mnemo0[10] := "MUL"; - mnemo0[11] := "DIV"; - mnemo0[12] := "FAD"; - mnemo0[13] := "FSB"; - mnemo0[14] := "FML"; - mnemo0[15] := "FDV"; - mnemo1[0] := "MI "; - mnemo1[8] := "PL"; - mnemo1[1] := "EQ "; - mnemo1[9] := "NE "; - mnemo1[2] := "LS "; - mnemo1[10] := "HI "; - mnemo1[5] := "LT "; - mnemo1[13] := "GE "; - mnemo1[6] := "LE "; - mnemo1[14] := "GT "; - mnemo1[15] := "NO "; -END ORTool. +MODULE ORTool; (*NW 18.2.2013*) + IMPORT SYSTEM, Files, Texts, Oberon, ORB; + VAR W: Texts.Writer; + Form: INTEGER; (*result of ReadType*) + mnemo0, mnemo1: ARRAY 16, 4 OF CHAR; (*mnemonics*) + + PROCEDURE Read(VAR R: Files.Rider; VAR n: INTEGER); + VAR b: BYTE; + BEGIN Files.ReadByte(R, b); + IF b < 80H THEN n := b ELSE n := b - 100H END + END Read; + + PROCEDURE ReadType(VAR R: Files.Rider); + VAR key, len, lev, size, off: INTEGER; + ref, mno, class, form, readonly: INTEGER; + name, modname: ARRAY 32 OF CHAR; + BEGIN Read(R, ref); Texts.Write(W, " "); Texts.Write(W, "["); + IF ref < 0 THEN Texts.Write(W, "^"); Texts.WriteInt(W, -ref, 1) + ELSE Texts.WriteInt(W, ref, 1); + Read(R, form); Texts.WriteString(W, " form = "); Texts.WriteInt(W, form, 1); + IF form = ORB.Pointer THEN ReadType(R) + ELSIF form = ORB.Array THEN + ReadType(R); Files.ReadNum(R, len); Files.ReadNum(R, size); + Texts.WriteString(W, " len = "); Texts.WriteInt(W, len, 1); + Texts.WriteString(W, " size = "); Texts.WriteInt(W, size, 1) + ELSIF form = ORB.Record THEN + ReadType(R); (*base type*) + Files.ReadNum(R, off); Texts.WriteString(W, " exno = "); Texts.WriteInt(W, off, 1); + Files.ReadNum(R, off); Texts.WriteString(W, " extlev = "); Texts.WriteInt(W, off, 1); + Files.ReadNum(R, size); Texts.WriteString(W, " size = "); Texts.WriteInt(W, size, 1); + Texts.Write(W, " "); Texts.Write(W, "{"); Read(R, class); + WHILE class # 0 DO (*fields*) + Files.ReadString(R, name); + IF name[0] # 0X THEN Texts.Write(W, " "); Texts.WriteString(W, name); ReadType(R) + ELSE Texts.WriteString(W, " --") + END ; + Files.ReadNum(R, off); Texts.WriteInt(W, off, 4); Read(R, class) + END ; + Texts.Write(W, "}") + ELSIF form = ORB.Proc THEN + ReadType(R); Texts.Write(W, "("); Read(R, class); + WHILE class # 0 DO + Texts.WriteString(W, " class = "); Texts.WriteInt(W, class, 1); Read(R, readonly); + IF readonly = 1 THEN Texts.Write(W, "#") END ; + ReadType(R); Read(R, class) + END ; + Texts.Write(W, ")") + END ; + Files.ReadString(R, modname); + IF modname[0] # 0X THEN + Files.ReadInt(R, key); Files.ReadString(R, name); + Texts.Write(W, " "); Texts.WriteString(W, modname); Texts.Write(W, "."); Texts.WriteString(W, name); + Texts.WriteHex(W, key) + END + END ; + Form := form; Texts.Write(W, "]") + END ReadType; + + PROCEDURE DecSym*; (*decode symbol file*) + VAR class, typno, k: INTEGER; + name: ARRAY 32 OF CHAR; + F: Files.File; R: Files.Rider; + S: Texts.Scanner; + BEGIN Texts.OpenScanner(S, Oberon.Par.text, Oberon.Par.pos); Texts.Scan(S); + IF S.class = Texts.Name THEN + Texts.WriteString(W, "OR-decode "); Texts.WriteString(W, S.s); + Texts.WriteLn(W); Texts.Append(Oberon.Log, W.buf); + F := Files.Old(S.s); + IF F # NIL THEN + Files.Set(R, F, 0); Files.ReadInt(R, k); Files.ReadInt(R, k); + Files.ReadString(R, name); Texts.WriteString(W, name); Texts.WriteHex(W, k); + Read(R, class); Texts.WriteInt(W, class, 3); (*sym file version*) + IF class = ORB.versionkey THEN + Texts.WriteLn(W); Read(R, class); + WHILE class # 0 DO + Texts.WriteInt(W, class, 4); Files.ReadString(R, name); Texts.Write(W, " "); Texts.WriteString(W, name); + ReadType(R); + IF class = ORB.Typ THEN + Texts.Write(W, "("); Read(R, class); + WHILE class # 0 DO (*pointer base fixup*) + Texts.WriteString(W, " ->"); Texts.WriteInt(W, class, 4); Read(R, class) + END ; + Texts.Write(W, ")") + ELSIF (class = ORB.Const) OR (class = ORB.Var) THEN + Files.ReadNum(R, k); Texts.WriteInt(W, k, 5); (*Reals, Strings!*) + END ; + Texts.WriteLn(W); Texts.Append(Oberon.Log, W.buf); + Read(R, class) + END + ELSE Texts.WriteString(W, " bad symfile version") + END + ELSE Texts.WriteString(W, " not found") + END ; + Texts.WriteLn(W); Texts.Append(Oberon.Log, W.buf) + END + END DecSym; + +(* ---------------------------------------------------*) + + PROCEDURE WriteReg(r: LONGINT); + BEGIN Texts.Write(W, " "); + IF r < 12 THEN Texts.WriteString(W, " R"); Texts.WriteInt(W, r MOD 10H, 1) + ELSIF r = 12 THEN Texts.WriteString(W, "MT") + ELSIF r = 13 THEN Texts.WriteString(W, "SB") + ELSIF r = 14 THEN Texts.WriteString(W, "SP") + ELSE Texts.WriteString(W, "LNK") + END + END WriteReg; + + PROCEDURE opcode(w: LONGINT); + VAR k, op, u, a, b, c: LONGINT; + BEGIN + k := w DIV 40000000H MOD 4; + a := w DIV 1000000H MOD 10H; + b := w DIV 100000H MOD 10H; + op := w DIV 10000H MOD 10H; + u := w DIV 20000000H MOD 2; + IF k = 0 THEN + Texts.WriteString(W, mnemo0[op]); + IF u = 1 THEN Texts.Write(W, "'") END ; + WriteReg(a); WriteReg(b); WriteReg(w MOD 10H) + ELSIF k = 1 THEN + Texts.WriteString(W, mnemo0[op]); + IF u = 1 THEN Texts.Write(W, "'") END ; + WriteReg(a); WriteReg(b); w := w MOD 10000H; + IF w >= 8000H THEN w := w - 10000H END ; + Texts.WriteInt(W, w, 7) + ELSIF k = 2 THEN (*LDR/STR*) + IF u = 1 THEN Texts.WriteString(W, "STR ") ELSE Texts.WriteString(W, "LDR") END ; + WriteReg(a); WriteReg(b); w := w MOD 100000H; + IF w >= 80000H THEN w := w - 100000H END ; + Texts.WriteInt(W, w, 8) + ELSIF k = 3 THEN (*Branch instr*) + Texts.Write(W, "B"); + IF ODD(w DIV 10000000H) THEN Texts.Write(W, "L") END ; + Texts.WriteString(W, mnemo1[a]); + IF u = 0 THEN WriteReg(w MOD 10H) ELSE + w := w MOD 100000H; + IF w >= 80000H THEN w := w - 100000H END ; + Texts.WriteInt(W, w, 8) + END + END + END opcode; + + PROCEDURE Sync(VAR R: Files.Rider); + VAR ch: CHAR; + BEGIN Files.Read(R, ch); Texts.WriteString(W, "Sync "); Texts.Write(W, ch); Texts.WriteLn(W) + END Sync; + + PROCEDURE Write(VAR R: Files.Rider; x: INTEGER); + BEGIN Files.WriteByte(R, x) (* -128 <= x < 128 *) + END Write; + + PROCEDURE DecObj*; (*decode object file*) + VAR class, i, n, key, size, fix, adr, data, len: INTEGER; + ch: CHAR; + name: ARRAY 32 OF CHAR; + F: Files.File; R: Files.Rider; + S: Texts.Scanner; + BEGIN Texts.OpenScanner(S, Oberon.Par.text, Oberon.Par.pos); Texts.Scan(S); + IF S.class = Texts.Name THEN + Texts.WriteString(W, "decode "); Texts.WriteString(W, S.s); F := Files.Old(S.s); + IF F # NIL THEN + Files.Set(R, F, 0); Files.ReadString(R, name); Texts.WriteLn(W); Texts.WriteString(W, name); + Files.ReadInt(R, key); Texts.WriteHex(W, key); Read(R, class); Texts.WriteInt(W, class, 4); (*version*) + Files.ReadInt(R, size); Texts.WriteInt(W, size, 6); Texts.WriteLn(W); + Texts.WriteString(W, "imports:"); Texts.WriteLn(W); Files.ReadString(R, name); + WHILE name[0] # 0X DO + Texts.Write(W, 9X); Texts.WriteString(W, name); + Files.ReadInt(R, key); Texts.WriteHex(W, key); Texts.WriteLn(W); + Files.ReadString(R, name) + END ; + (* Sync(R); *) + Texts.WriteString(W, "type descriptors"); Texts.WriteLn(W); + Files.ReadInt(R, n); n := n DIV 4; i := 0; + WHILE i < n DO Files.ReadInt(R, data); Texts.WriteHex(W, data); INC(i) END ; + Texts.WriteLn(W); + Texts.WriteString(W, "data"); Files.ReadInt(R, data); Texts.WriteInt(W, data, 6); Texts.WriteLn(W); + Texts.WriteString(W, "strings"); Texts.WriteLn(W); + Files.ReadInt(R, n); i := 0; + WHILE i < n DO Files.Read(R, ch); Texts.Write(W, ch); INC(i) END ; + Texts.WriteLn(W); + Texts.WriteString(W, "code"); Texts.WriteLn(W); + Files.ReadInt(R, n); i := 0; + WHILE i < n DO + Files.ReadInt(R, data); Texts.WriteInt(W, i, 4); Texts.Write(W, 9X); Texts.WriteHex(W, data); + Texts.Write(W, 9X); opcode(data); Texts.WriteLn(W); INC(i) + END ; + (* Sync(R); *) + Texts.WriteString(W, "commands:"); Texts.WriteLn(W); + Files.ReadString(R, name); + WHILE name[0] # 0X DO + Texts.Write(W, 9X); Texts.WriteString(W, name); + Files.ReadInt(R, adr); Texts.WriteInt(W, adr, 5); Texts.WriteLn(W); + Files.ReadString(R, name) + END ; + (* Sync(R); *) + Texts.WriteString(W, "entries"); Texts.WriteLn(W); + Files.ReadInt(R, n); i := 0; + WHILE i < n DO + Files.ReadInt(R, adr); Texts.WriteInt(W, adr, 6); INC(i) + END ; + Texts.WriteLn(W); + (* Sync(R); *) + Texts.WriteString(W, "pointer refs"); Texts.WriteLn(W); Files.ReadInt(R, adr); + WHILE adr # -1 DO Texts.WriteInt(W, adr, 6); Files.ReadInt(R, adr) END ; + Texts.WriteLn(W); + (* Sync(R); *) + Files.ReadInt(R, data); Texts.WriteString(W, "fixP = "); Texts.WriteInt(W, data, 8); Texts.WriteLn(W); + Files.ReadInt(R, data); Texts.WriteString(W, "fixD = "); Texts.WriteInt(W, data, 8); Texts.WriteLn(W); + Files.ReadInt(R, data); Texts.WriteString(W, "fixT = "); Texts.WriteInt(W, data, 8); Texts.WriteLn(W); + Files.ReadInt(R, data); Texts.WriteString(W, "entry = "); Texts.WriteInt(W, data, 8); Texts.WriteLn(W); + Files.Read(R, ch); + IF ch # "O" THEN Texts.WriteString(W, "format eror"); Texts.WriteLn(W) END + (* Sync(R); *) + ELSE Texts.WriteString(W, " not found"); Texts.WriteLn(W) + END ; + Texts.Append(Oberon.Log, W.buf) + END + END DecObj; + +BEGIN Texts.OpenWriter(W); Texts.WriteString(W, "ORTool 18.2.2013"); + Texts.WriteLn(W); Texts.Append(Oberon.Log, W.buf); + mnemo0[0] := "MOV"; + mnemo0[1] := "LSL"; + mnemo0[2] := "ASR"; + mnemo0[3] := "ROR"; + mnemo0[4] := "AND"; + mnemo0[5] := "ANN"; + mnemo0[6] := "IOR"; + mnemo0[7] := "XOR"; + mnemo0[8] := "ADD"; + mnemo0[9] := "SUB"; + mnemo0[10] := "MUL"; + mnemo0[11] := "DIV"; + mnemo0[12] := "FAD"; + mnemo0[13] := "FSB"; + mnemo0[14] := "FML"; + mnemo0[15] := "FDV"; + mnemo1[0] := "MI "; + mnemo1[8] := "PL"; + mnemo1[1] := "EQ "; + mnemo1[9] := "NE "; + mnemo1[2] := "LS "; + mnemo1[10] := "HI "; + mnemo1[5] := "LT "; + mnemo1[13] := "GE "; + mnemo1[6] := "LE "; + mnemo1[14] := "GT "; + mnemo1[15] := "NO "; +END ORTool. From ce855c93c8086e18d1be2c768f11c259c9291b95 Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 16 Jun 2016 16:25:36 +0100 Subject: [PATCH 080/580] Update test files to v2. --- src/test/files/testFiles.Mod | 3 +- src/test/server/s.Mod | 162 ++++++++++++++----------------- src/test/server/sockets.Mod | 181 ++++++++++++++++++----------------- src/test/server/types.Mod | 47 ++++----- src/test/vt100/crt.Mod | 16 +--- src/test/x11/0/test.Mod | 44 +++++---- 6 files changed, 212 insertions(+), 241 deletions(-) diff --git a/src/test/files/testFiles.Mod b/src/test/files/testFiles.Mod index f6361b89..236a1247 100644 --- a/src/test/files/testFiles.Mod +++ b/src/test/files/testFiles.Mod @@ -20,8 +20,9 @@ IF F # NIL THEN Texts.Read (R, ch); WHILE ~R.eot DO - Texts.Read (R, ch); Console.Char(ch); + IF ch = 0DX THEN Console.Char(0AX) END; + Texts.Read (R, ch); END; ELSE diff --git a/src/test/server/s.Mod b/src/test/server/s.Mod index 0c559600..be04d59e 100644 --- a/src/test/server/s.Mod +++ b/src/test/server/s.Mod @@ -1,106 +1,90 @@ MODULE s; -IMPORT sockets, types, Out := Console, Unix, S := SYSTEM; +IMPORT sockets, types, Out := Console, SYSTEM, Platform, Strings; -TYPE Int32 = types.Int32; - Int16 = types.Int16; - String = types.String; -PROCEDURE DoSmth(sock : Int32); -VAR str, aff : String; - n, s : LONGINT; +PROCEDURE DoSmth(sock: Platform.FileHandle); +VAR + str, aff: ARRAY 256 OF CHAR; + n: LONGINT; BEGIN - s := SIZE(String); - aff := "Affirmative, Dave"; - n := Unix.Read(sock, S.ADR(str), s); - - IF n < 0 THEN - Out.String("error reading from socket"); Out.Ln; - END; - Out.String("received message is "); Out.String(str); Out.Ln; - s := 17; - n := Unix.Write(sock, S.ADR(aff), s); - IF n < 2 THEN + aff := "Affirmative, Dave"; +(* IF Platform.Read(sock, SYSTEM.ADR(str), 256, n) # 0 THEN *) + IF Platform.ReadBuf(sock, str, n) # 0 THEN + Out.String("error reading from socket"); Out.Ln; + ELSE + str[n] := 0X; (* Make sure that received message is zero terminated *) + Out.String("received message is "); Out.String(str); Out.Ln; + + IF Platform.Write(sock, SYSTEM.ADR(aff), Strings.Length(aff)) # 0 THEN Out.String("error writing to socket"); Out.Ln - END; - + END; + END; END DoSmth; -PROCEDURE ZeroByteArr(VAR a : ARRAY OF S.BYTE); -VAR i : LONGINT; -BEGIN - FOR i := 0 TO LEN(a)-1 DO - a[i] := 0 - END; -END ZeroByteArr; + + +PROCEDURE -includeunistd "#include "; +PROCEDURE -fork(): LONGINT "(LONGINT)fork()"; + PROCEDURE serve; -VAR sockfd, newsockfd, portno, clilen, pid: sockets.Int32; - ServAddr, CliAddr: sockets.SockAddrIn; - Null : Int32; - Port, maxQueue, res : Int32; - afinet, port, port0: Int16; +CONST + Port = 2055; + MaxQueue = 5; +VAR + sockfd: LONGINT; + newsockfd: LONGINT; + ServAddr: sockets.SockAddrIn; + pid: LONGINT; + res: Platform.ErrorCode; + sockaddrlen: LONGINT; BEGIN - Port := 2055; - maxQueue := 5; - Null := 0; - sockfd := sockets.Socket(S.VAL(Int32, sockets.AfInet), S.VAL(Int32, sockets.SockStream), Null); - IF sockfd < 0 THEN - Out.String("error opening socket") - ELSE - Out.String("socket created.") - END; - Out.Ln; - - types.IntegerToInt16(sockets.AfInet, afinet); - types.IntegerToInt16(Port, port); - types.htons(port, port0); (* only necessary on little endian computers *) - ServAddr.SinFamily := afinet; - ServAddr.SinPort := port0; - ZeroByteArr(ServAddr.SinZero); - (*Out.String("listening on port ");Out.Int(S.VAL(INTEGER, ServAddr.SinPort), 0); Out.Ln;*) - ServAddr.SinAddr.SAddr := 0(*sockets.InAddrAny*); - - res := sockets.Bind(sockfd, S.VAL(sockets.SockAddr, ServAddr), (SIZE(sockets.SockAddr))); - IF res < 0 THEN - Out.String("error on binding") - ELSE - Out.String("binding completed.") - END; - Out.Ln; + sockfd := sockets.Socket(sockets.AfInet, sockets.SockStream, 0); + IF sockfd < 0 THEN + Out.String("error opening socket") + ELSE + Out.String("socket created.") + END; + Out.Ln; + + sockets.SetSockAddrIn(sockets.AfInet, Port, 0, ServAddr); + IF sockets.Bind(sockfd, SYSTEM.VAL(sockets.SockAddr, ServAddr), SIZE(sockets.SockAddr)) < 0 THEN + Out.String("error on binding") + ELSE + Out.String("binding completed.") + END; + Out.Ln; - res := sockets.Listen(sockfd, maxQueue); - - IF res # 0 THEN - Out.String("listen() failed"); - ELSE - Out.String("listen okay"); - END; - Out.Ln; - clilen := SIZE(sockets.SockAddrIn); - LOOP - newsockfd := sockets.Accept(sockfd, S.VAL(sockets.SockAddr, ServAddr), clilen); - IF newsockfd < 0 THEN - Out.String("error on accept") - ELSE - Out.String("accept okay") - END; - Out.Ln; - - pid := Unix.Fork(); - IF pid < 0 THEN - Out.String("error on fork") - ELSIF pid = 0 THEN - Out.String("forked okay"); Out.Ln; - res := Unix.Close(sockfd); - DoSmth(newsockfd); - EXIT - ELSE - res := Unix.Close(newsockfd); - END; - END; + IF sockets.Listen(sockfd, MaxQueue) # 0 THEN + Out.String("listen() failed"); + ELSE + Out.String("listen okay"); + END; + Out.Ln; + LOOP + sockaddrlen := SIZE(sockets.SockAddrIn); + newsockfd := sockets.Accept(sockfd, SYSTEM.VAL(sockets.SockAddr, ServAddr), sockaddrlen); + IF newsockfd < 0 THEN + Out.String("error on accept") + ELSE + Out.String("accept okay") + END; + Out.Ln; + pid := fork(); + IF pid < 0 THEN + Out.String("error on fork") + ELSIF pid = 0 THEN + Out.String("forked okay"); Out.Ln; + res := Platform.Close(sockfd); + DoSmth(newsockfd); + EXIT + ELSE + res := Platform.Close(newsockfd) + END + END END serve; diff --git a/src/test/server/sockets.Mod b/src/test/server/sockets.Mod index 4cba806e..58ff3c24 100644 --- a/src/test/server/sockets.Mod +++ b/src/test/server/sockets.Mod @@ -1,119 +1,126 @@ MODULE sockets; -IMPORT types, SYS := SYSTEM; -TYPE - Int16* = types.Int16; (* INTEGER on 32 bit platform *) - Int32* = types.Int32; - Int64* = types.Int64; +IMPORT SYSTEM, oocC; CONST - SockStream* = 1; - SockDgram* = 2; - SockRaw* = 3; - SockRdm* = 4; - SockSeqpacket* = 5; - SockDccp* = 6; - SockPacket* = 10; - - AfUnscec* = 0; (* Unspecified. *) - AfLocal* = 1; (* Local to host (pipes and file-domain). *) - AfUnix* = 1; (* POSIX name for PF_LOCAL. *) - AfFile* = 1; (* Another non-standard name for PF_LOCAL. *) - AfInet* = 2; (* IP protocol family. *) - AfAx25* = 3; (* Amateur Radio AX.25. *) - AfIpx* = 4; (* Novell Internet Protocol. *) - AfAppletalk* = 5; (* Appletalk DDP. *) - AfNetrom* = 6; (* Amateur radio NetROM. *) - AfBridge* = 7; (* Multiprotocol bridge. *) - AfAtmpvc* = 8; (* ATM PVCs. *) - AfX25* = 9; (* Reserved for X.25 project. *) - AfInet6* = 10; (* IP version 6. *) - AfRose* = 11; (* Amateur Radio X.25 PLP. *) - AfDecnet* = 12; (* Reserved for DECnet project. *) - AfNetbeui*= 13; (* Reserved for 802.2LLC project. *) - AfSecurity*=14; (* Security callback pseudo AF. *) - AfKey* = 15; (* PF_KEY key management API. *) - AfNetlink*= 16; - AfRoute* = 16; (* Alias to emulate 4.4BSD. *) - AfPacket = 17; (* Packet family. *) - AfAsh = 18; (* Ash. *) - AfEconet* = 19; (* Acorn Econet. *) - AfAtmsvc* = 20; (* ATM SVCs. *) - AfRds* = 21; (* RDS sockets. *) - AfSna = 22; (* Linux SNA Project *) - AfIrda* = 23; (* IRDA sockets. *) - AfPppox = 24; (* PPPoX sockets. *) - AfWanpipe*= 25; (* Wanpipe API sockets. *) - AfLlc* = 26; (* Linux LLC. *) - AfCan* = 29; (* Controller Area Network. *) - AfTipc* = 30; (* TIPC sockets. *) - AfBluetooth* = 31; (* Bluetooth sockets. *) - AfIucv* = 32; (* IUCV sockets. *) - AfRxrpc* = 33; (* RxRPC sockets. *) - AfIsdn* = 34; (* mISDN sockets. *) - AfPhonet* = 35; (* Phonet sockets. *) - AfIeee802154* = 36; (* IEEE 802.15.4 sockets. *) - AfCaif* = 37; (* CAIF sockets. *) - AfAlg* = 38; (* Algorithm sockets. *) - AfNfc* = 39; (* NFC sockets. *) - AfVsock* = 40; (* vSockets. *) - AfMax* = 41; (* For now.. *) - - InAddrAny* = 0; + SockStream* = 1; + SockDgram* = 2; + SockRaw* = 3; + SockRdm* = 4; + SockSeqpacket* = 5; + SockDccp* = 6; + SockPacket* = 10; + + AfUnscec* = 0; (* Unspecified. *) + AfLocal* = 1; (* Local to host (pipes and file-domain). *) + AfUnix* = 1; (* POSIX name for PF_LOCAL. *) + AfFile* = 1; (* Another non-standard name for PF_LOCAL. *) + AfInet* = 2; (* IP protocol family. *) + AfAx25* = 3; (* Amateur Radio AX.25. *) + AfIpx* = 4; (* Novell Internet Protocol. *) + AfAppletalk* = 5; (* Appletalk DDP. *) + AfNetrom* = 6; (* Amateur radio NetROM. *) + AfBridge* = 7; (* Multiprotocol bridge. *) + AfAtmpvc* = 8; (* ATM PVCs. *) + AfX25* = 9; (* Reserved for X.25 project. *) + AfInet6* = 10; (* IP version 6. *) + AfRose* = 11; (* Amateur Radio X.25 PLP. *) + AfDecnet* = 12; (* Reserved for DECnet project. *) + AfNetbeui* = 13; (* Reserved for 802.2LLC project. *) + AfSecurity* = 14; (* Security callback pseudo AF. *) + AfKey* = 15; (* PF_KEY key management API. *) + AfNetlink* = 16; + AfRoute* = 16; (* Alias to emulate 4.4BSD. *) + AfPacket = 17; (* Packet family. *) + AfAsh = 18; (* Ash. *) + AfEconet* = 19; (* Acorn Econet. *) + AfAtmsvc* = 20; (* ATM SVCs. *) + AfRds* = 21; (* RDS sockets. *) + AfSna = 22; (* Linux SNA Project *) + AfIrda* = 23; (* IRDA sockets. *) + AfPppox = 24; (* PPPoX sockets. *) + AfWanpipe* = 25; (* Wanpipe API sockets. *) + AfLlc* = 26; (* Linux LLC. *) + AfCan* = 29; (* Controller Area Network. *) + AfTipc* = 30; (* TIPC sockets. *) + AfBluetooth* = 31; (* Bluetooth sockets. *) + AfIucv* = 32; (* IUCV sockets. *) + AfRxrpc* = 33; (* RxRPC sockets. *) + AfIsdn* = 34; (* mISDN sockets. *) + AfPhonet* = 35; (* Phonet sockets. *) + AfIeee802154* = 36; (* IEEE 802.15.4 sockets. *) + AfCaif* = 37; (* CAIF sockets. *) + AfAlg* = 38; (* Algorithm sockets. *) + AfNfc* = 39; (* NFC sockets. *) + AfVsock* = 40; (* vSockets. *) + AfMax* = 41; (* For now.. *) + + InAddrAny* = 0; TYPE - (* /usr/include/netinet/in.h *) InAddr* = RECORD - SAddr* : Int32; + SAddr*: oocC.int; END; SockAddrIn* = RECORD - SinFamily* : Int16; - SinPort* : Int16; - SinAddr* : InAddr; - SinZero* : ARRAY 8 OF CHAR; + SinFamily*: oocC.shortint; + SinPort*: oocC.shortint; + SinAddr*: InAddr; + SinZero*: ARRAY 8 OF CHAR; END; (* /usr/include/sys/socket.h *) SockAddr* = RECORD - SaFamily* : Int16; - SaData* : ARRAY 14 OF CHAR + SaFamily*: oocC.shortint; + SaData*: ARRAY 14 OF CHAR END; - PROCEDURE -socket(domain, type, protocol: Int32): Int32 - "(int)socket(domain, type, protocol)"; + PROCEDURE -includesocket "#include "; - PROCEDURE Socket*(domain, type, protocol: Int32): Int32; + PROCEDURE -SetCShort(i: INTEGER; VAR si: oocC.shortint) + "*(short*)si = i"; + + PROCEDURE -SetCShortSwapped(i: INTEGER; VAR si: oocC.shortint) + "*(short*)si = ((i >> 8) & 0x00ff) | ((i << 8) & 0xff00)"; + + PROCEDURE SetSockAddrIn*(family, port, inaddr: INTEGER; VAR sai: SockAddrIn); + VAR i: INTEGER; BEGIN - RETURN socket(domain, type, protocol) + SetCShort(family, sai.SinFamily); + SetCShortSwapped(port, sai.SinPort); + sai.SinAddr.SAddr := inaddr; + i := 0; WHILE i < 8 DO sai.SinZero[i] := 0X; INC(i) END + END SetSockAddrIn; + + PROCEDURE -socket(domain, type, protocol: LONGINT): INTEGER + "(INTEGER)socket((int)domain, (int)type, (int)protocol)"; + + PROCEDURE Socket*(domain, type, protocol: LONGINT): INTEGER; + BEGIN RETURN socket(domain, type, protocol) END Socket; - PROCEDURE -bind(sockfd: Int32; VAR addr: SockAddr; addrlen: Int32): Int32 - "(int)bind(sockfd, addr, addrlen)"; + PROCEDURE -bind(sockfd: LONGINT; VAR addr: SockAddr; addrlen: LONGINT): INTEGER + "(INTEGER)bind((int)sockfd, (const struct sockaddr*)addr, (int)addrlen)"; - PROCEDURE Bind*(sockfd: Int32; VAR addr: SockAddr; addrlen: Int32): Int32; - BEGIN - RETURN bind(sockfd, addr, addrlen) + PROCEDURE Bind*(sockfd: LONGINT; VAR addr: SockAddr; addrlen: LONGINT): INTEGER; + BEGIN RETURN bind(sockfd, addr, addrlen) END Bind; - PROCEDURE -listen(sockfd, backlog: Int32): Int32 - "(int)listen(sockfd, backlog)"; + PROCEDURE -listen(sockfd, backlog: LONGINT): INTEGER + "(INTEGER)listen((int)sockfd, (int)backlog)"; - PROCEDURE Listen*(sockfd, backlog: Int32): Int32; - BEGIN - RETURN listen(sockfd, backlog) + PROCEDURE Listen*(sockfd, backlog: LONGINT): INTEGER; + BEGIN RETURN listen(sockfd, backlog) END Listen; - PROCEDURE -accept(sockfd: Int32; VAR addr: SockAddr; VAR addrlen: Int32): Int32 - "(int)accept(sockfd, addr, addrlen)"; + PROCEDURE -accept(sockfd: LONGINT; VAR addr: SockAddr; VAR addrlen: LONGINT; VAR result: INTEGER) + "int _o_al = (int)addrlen; *result = (INTEGER)accept((int)sockfd, (struct sockaddr*)addr, &_o_al); *addrlen = _o_al"; - PROCEDURE Accept*(sockfd: Int32; VAR addr: SockAddr; VAR addrlen: Int32): Int32; - BEGIN - RETURN accept(sockfd, addr, addrlen) + PROCEDURE Accept*(sockfd: LONGINT; VAR addr: SockAddr; VAR addrlen: LONGINT): INTEGER; + VAR result: INTEGER; + BEGIN accept(sockfd, addr, addrlen, result); RETURN result END Accept; -BEGIN - END sockets. diff --git a/src/test/server/types.Mod b/src/test/server/types.Mod index 633e6b26..ca6b5d02 100644 --- a/src/test/server/types.Mod +++ b/src/test/server/types.Mod @@ -1,38 +1,25 @@ MODULE types; -IMPORT SYS := SYSTEM; +IMPORT SYSTEM; TYPE - intarr64 = ARRAY 8 OF SYS.BYTE; (* to emulate int16 on x86_64; -- noch *) - intarr32 = ARRAY 4 OF SYS.BYTE; - intarr16 = ARRAY 2 OF SYS.BYTE; - Int16* = intarr16; (* INTEGER on 32 bit platform *) - Int32* = INTEGER; - Int64* = LONGINT; - String* = ARRAY 256 OF CHAR; + (* Int32* = ARRAY 4 OF SYSTEM.BYTE; *) + Int16* = ARRAY 2 OF SYSTEM.BYTE; - PROCEDURE LongintToInt16*(int: LONGINT; VAR int16: Int16); - VAR longintarr : intarr64; - BEGIN - (*RETURN SYS.VAL(Int16, int)*) - longintarr := SYS.VAL(intarr64, int); - int16[0] := longintarr[0]; - int16[1] := longintarr[1]; (* this will work for little endian -- noch *) - END LongintToInt16; + PROCEDURE IntegerToInt16*(int: INTEGER; VAR int16: Int16); + TYPE PInt16 = POINTER TO Int16; + VAR p: PInt16; + BEGIN + (* Note: We take the least significant 16 bits of int, which + is correct on supported (i.e. little-endian) architectures. *) + p := SYSTEM.VAL(PInt16, SYSTEM.ADR(int)); + int16 := p^; + END IntegerToInt16; - PROCEDURE IntegerToInt16*(int: INTEGER; VAR int16: Int16); - VAR intarr : intarr32; - BEGIN - int16 := SYS.VAL(Int16, int) - (*intarr := SYS.VAL(intarr32, int); - int16[0] := intarr[0]; - int16[1] := intarr[1];*) (* this will work for little endian -- noch *) - END IntegerToInt16; - - PROCEDURE htons*(in: Int16; VAR out : Int16); - BEGIN - out[0] := in[1]; - out[1] := in[0]; - END htons; + PROCEDURE htons*(in: Int16; VAR out : Int16); + BEGIN + out[0] := in[1]; + out[1] := in[0]; + END htons; END types. diff --git a/src/test/vt100/crt.Mod b/src/test/vt100/crt.Mod index 3fd63b47..c5f3662f 100644 --- a/src/test/vt100/crt.Mod +++ b/src/test/vt100/crt.Mod @@ -1,6 +1,6 @@ MODULE crt; -IMPORT vt100, Unix, Console, +IMPORT vt100, Platform, Console, Strings; (* strings to remove later ? *) CONST @@ -28,8 +28,6 @@ CONST (* Add-in for blinking *) Blink* = 128; -TYPE - PFdSet = POINTER TO Unix.FdSet; VAR tmpstr : ARRAY 23 OF CHAR; @@ -58,16 +56,8 @@ VAR tmpstr : ARRAY 23 OF CHAR; vt100.DECTCEMh; END cursoron; - PROCEDURE Delay*( ms : INTEGER); - VAR i : LONGINT; - tv : Unix.Timeval; - pfd : PFdSet; - BEGIN - tv.sec := 0; - tv.usec := ms * 1000; - pfd := NIL; - i := Unix.Select(0, pfd^, pfd^, pfd^, tv); - END Delay; + PROCEDURE Delay*(ms: INTEGER); + BEGIN Platform.Delay(ms) END Delay; PROCEDURE GotoXY* (x, y: INTEGER); BEGIN diff --git a/src/test/x11/0/test.Mod b/src/test/x11/0/test.Mod index 8ba92261..b15133d1 100644 --- a/src/test/x11/0/test.Mod +++ b/src/test/x11/0/test.Mod @@ -1,29 +1,31 @@ MODULE test; IMPORT p := oocXYplane, Out := Console; -VAR ch : CHAR; -i : INTEGER; + +VAR + ch : CHAR; + i : INTEGER; + BEGIN + p.Open; -p.Open; + (*p.Clear;*) + FOR i := 1 TO 555 DO + p.Dot(i,300 ,p.draw) + END; + + (* + FOR i := 100 TO 500 DO + p.Dot(i,300 ,p.erase) + END; + *) + + IF p.IsDot (5, 300) THEN Out.String("Yes") ELSE Out.String("No") END; Out.Ln; + IF p.IsDot (5, 500) THEN Out.String("Yes") ELSE Out.String("No") END; Out.Ln; -(*p.Clear;*) -FOR i := 1 TO 555 DO -p.Dot(i,300 ,p.draw) -END; -(* -FOR i := 100 TO 500 DO -p.Dot(i,300 ,p.erase) -END; -*) - -IF p.IsDot (5, 300) THEN Out.String("Yes") ELSE Out.String("No") END; Out.Ln; -IF p.IsDot (5, 500) THEN Out.String("Yes") ELSE Out.String("No") END; Out.Ln; - -REPEAT - ch := p.Key(); -UNTIL ch # 0X; - -p.Close; + REPEAT + ch := p.Key(); + UNTIL ch # 0X; + p.Close; END test. From 8b0bd9c6759969a34ea65b801642ad4743ec0c0d Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 16 Jun 2016 16:31:59 +0100 Subject: [PATCH 081/580] Update tools to v2. --- src/tools/HeapDump/HeapDump.Mod | 139 ++++++ src/tools/browser/BrowserCmd.Mod | 20 +- src/tools/make/configure.c | 447 ++++++++++++++++++ src/tools/make/vishap.make | 372 +++++++++++++++ src/tools/testcoordinator/IP.Mod | 283 +++++++++++ src/tools/testcoordinator/TestClient.Mod | 219 +++++++++ src/tools/testcoordinator/TestCoordinator.Mod | 270 +++++++++++ src/tools/vocparam/vocparam.c | 78 --- 8 files changed, 1742 insertions(+), 86 deletions(-) create mode 100755 src/tools/HeapDump/HeapDump.Mod create mode 100644 src/tools/make/configure.c create mode 100644 src/tools/make/vishap.make create mode 100644 src/tools/testcoordinator/IP.Mod create mode 100644 src/tools/testcoordinator/TestClient.Mod create mode 100644 src/tools/testcoordinator/TestCoordinator.Mod delete mode 100644 src/tools/vocparam/vocparam.c diff --git a/src/tools/HeapDump/HeapDump.Mod b/src/tools/HeapDump/HeapDump.Mod new file mode 100755 index 00000000..83adadb0 --- /dev/null +++ b/src/tools/HeapDump/HeapDump.Mod @@ -0,0 +1,139 @@ +MODULE HeapDump; + +IMPORT SYSTEM, Heap, Console; + + PROCEDURE -wc(c: CHAR); BEGIN Console.Char(c) END wc; + PROCEDURE -ws(s: ARRAY OF CHAR); BEGIN Console.String(s) END ws; + PROCEDURE -wi(i: LONGINT); BEGIN Console.Int(i, 1) END wi; + PROCEDURE -wl; BEGIN Console.Ln(); Console_Flush() END wl; + + PROCEDURE th(h: LONGINT); + VAR i, d: INTEGER; s: ARRAY 20 OF CHAR; + BEGIN + IF h = 0 THEN ws("0H"); RETURN END; + i := 0; + WHILE (h # 0) DO + d := SHORT(h MOD 16); h := SYSTEM.LSH(h, -4); + IF d < 10 THEN s[i] := CHR(d + ORD("0")) ELSE s[i] := CHR(d - 10 + ORD("a")) END; + INC(i) + END; + WHILE i > 0 DO DEC(i); wc(s[i]) END; + wc("H"); + END th; + + PROCEDURE DumpType(type: LONGINT); + TYPE + typename = POINTER TO ARRAY 24 OF CHAR; + pointers = POINTER TO ARRAY 10000 OF LONGINT; + VAR + tag, next, level, blksz, m: LONGINT; + module: Module; + name: typename; + ptr: pointers; + i: INTEGER; + BEGIN + SYSTEM.GET(type - SZL, tag); + SYSTEM.GET(type, next); + SYSTEM.GET(type + SZL, level); + SYSTEM.GET(type + 2*SZL, m); module := SYSTEM.VAL(Module, m); + name := SYSTEM.VAL(typename, type + 3*SZL); + SYSTEM.GET(type + 20*SZL + 24, blksz); + ptr := SYSTEM.VAL(pointers, type + 21*SZL + 24); + ws("tag "); th(tag); + ws(", level "); wi(level,1); + ws(", blksz "); th(blksz); + ws(", name "); ws(module.name); wc("."); ws(name^); + ws(", pointers: "); + i := 0; WHILE ptr[i] >= 0 DO wi(ptr[i],1); wc(" "); INC(i) END; + wi(ptr[i],1); + END DumpType; + + PROCEDURE DumpTypes(types: LONGINT); + BEGIN + WHILE types # 0 DO + ws(" TYPE at: "); th(types); ws(": "); DumpType(types); wl; + SYSTEM.GET(types, types); + END + END DumpTypes; + + PROCEDURE DumpModules; + VAR m: Module; t: LONGINT; + BEGIN + m := SYSTEM.VAL(Module, modules); + WHILE m # NIL DO + ws(" Module "); ws(m.name); ws(", refcnt "); wi(m.refcnt,1); wl; + DumpTypes(m.types); + m := m.next; + END + END DumpModules; + + + PROCEDURE DumpChunks; + VAR + chunk, nextchunk, chunkend: LONGINT; + block, blocktag, blocksize, blocksizeviatag, blocksentinel, blocknext: LONGINT; + type: LONGINT; + reserved, ptr: LONGINT; + BEGIN + chunk := heap; + WHILE chunk # 0 DO + SYSTEM.GET(chunk + nextChnkOff, nextchunk); + SYSTEM.GET(chunk + endOff, chunkend); + ws(" Chunk at "); th(chunk); + ws(", chunk end "); th(chunkend); + ws(", next chunk "); th(nextchunk); + wl; + block := chunk + blkOff; + WHILE block < chunkend DO + SYSTEM.GET(block+tagOff, blocktag); + SYSTEM.GET(block+sizeOff, blocksize); + SYSTEM.GET(block+sntlOff, blocksentinel); + SYSTEM.GET(block+nextOff, blocknext); + ws(" Block at "); th(block); + + ws(", tag "); th(blocktag); + IF (ODD(blocktag)) THEN ws(" (marked)"); DEC(blocktag) END; + SYSTEM.GET(blocktag, blocksizeviatag); + SYSTEM.GET(blocktag - SZL, reserved); + SYSTEM.GET(blocktag + SZL, ptr); + + (*ws(", size "); th(blocksize); *) + ws(", size via tag "); th(blocksizeviatag); + (*ws(", sentinel "); th(blocksentinel); *) + (*ws(", next block "); th(blocknext); *) + + ws(", .reserved "); th(reserved); + ws(", .ptr[0] "); th(ptr); + + (* The following test attempts to distinguish between blocks + allocated by NEW (whose tag points to a full type descriptor) + and those allocated by SYSTEM.NEW (whose tag points only to a + size and a dummy ptr list sentinel). + It is a safe test in that only full type descriptors have a + non-empty ptr list, but it means we will fail to report the + type of RECORDs that contain no pointers. + *) + IF ptr >= 0 THEN + type := blocktag - (20*SZL + 24); + ws(", type at "); th(type); wl; + ws(" TYPE: "); DumpType(type); + END; + + wl; + + INC(block, blocksizeviatag); + END; + chunk := nextchunk + END + END DumpChunks; + + + PROCEDURE Dump*; + BEGIN + Heap.Lock; + ws("Module and type dump."); wl; DumpModules; wl; wl; + ws("Heap chunk and block dump."); wl; DumpChunks; wl; + Heap.Unlock; + END Dump; + +END HeapDump. diff --git a/src/tools/browser/BrowserCmd.Mod b/src/tools/browser/BrowserCmd.Mod index 323181c5..55b6c192 100644 --- a/src/tools/browser/BrowserCmd.Mod +++ b/src/tools/browser/BrowserCmd.Mod @@ -1,8 +1,8 @@ MODULE BrowserCmd; (* RC 29.10.93 *) (* object model 4.12.93, command line version jt 4.4.95 *) - IMPORT - OPM, OPS, OPT, OPV, - Texts := Texts0, Console, Args; + IMPORT + OPM, OPS, OPT, OPV, Texts, Console, Platform; + CONST OptionChar = "-"; @@ -100,6 +100,7 @@ MODULE BrowserCmd; (* RC 29.10.93 *) (* object model 4.12.93, command line ver Ws(obj^.conval^.ext^) | NilTyp: Ws("NIL") + ELSE (* Ignore other forms *) END ; Wch(";"); Wln | Typ: @@ -128,6 +129,7 @@ MODULE BrowserCmd; (* RC 29.10.93 *) (* object model 4.12.93, command line ver Wch('"'); END ; Wch(";"); Wln + ELSE (* Ignore other modes *) END END ; Objects(obj^.right, mode) @@ -201,7 +203,9 @@ MODULE BrowserCmd; (* RC 29.10.93 *) (* object model 4.12.93, command line ver Ws("(* size: "); Wi(typ^.size); Ws(" align: "); Wi(typ^.align); Ws(" nofm: "); Wi(typ^.n); Ws(" *)") END + ELSE (* Ignore other comps *) END + ELSE (* Ignore other froms *) END END Wstruct; @@ -277,13 +281,13 @@ MODULE BrowserCmd; (* RC 29.10.93 *) (* object model 4.12.93, command line ver VAR T, dummyT: Texts.Text; S, vname, name: OPS.Name; R: Texts.Reader; ch: CHAR; s: ARRAY 1024 OF CHAR; i: INTEGER; BEGIN - option := 0X; Args.Get(1, S); - IF Args.argc > 2 THEN - IF S[0] = OptionChar THEN option := S[1]; Args.Get(2, S) - ELSE Args.Get(2, vname); option := vname[1] + option := 0X; Platform.GetArg(1, S); + IF Platform.ArgCount > 2 THEN + IF S[0] = OptionChar THEN option := S[1]; Platform.GetArg(2, S) + ELSE Platform.GetArg(2, vname); option := vname[1] END END ; - IF Args.argc >= 2 THEN + IF Platform.ArgCount >= 2 THEN Ident(S, name); NEW(T); Texts.Open(T, ""); OPT.Init(name, {}); OPT.SelfName := "AvoidErr154"; WModule(name, T); OPT.Close; diff --git a/src/tools/make/configure.c b/src/tools/make/configure.c new file mode 100644 index 00000000..7eb7123b --- /dev/null +++ b/src/tools/make/configure.c @@ -0,0 +1,447 @@ +// Test platform supportability and establish build configuration: +// +// Writes the configuration parameters to these two files: +// +// Configuration.Mod - settings to compile into the compiler binary +// Configuration.make - makefile variable settings for this configuration +// +// Derived from vocparam.c originally by J. Templ 23.6.95 + + +#define O_VER 1.2 // Version number to be reported by compiler. +#define O_NAME voc // Compiler name used for binary, install dir and references in text. + +// #define LARGE // Define this to get 32 bit INTEGER and 64 bit longints even on 32 bit platforms. + + +#include "SYSTEM.h" + +#ifdef _WIN32 + #define strncasecmp _strnicmp +#else + #include + #include + #include + #include + #include +#endif + +#include +#include +#include +#include + + +void fail(char *msg) {fprintf(stderr, "Error: %s\n", msg); exit(1);} +void assert(int truth, char *complaint) {if (!truth) fail(complaint);} + + + + +char builddate[256]; +char installdir[256]; +char versionstring[256]; +char osrelease[1024]; +char cwd[1024]; +char ldconfig[1024]; // Command(s) to update OS shared library config +char libspec[1024]; + +#define macrotostringhelper(s) #s +#define macrotostring(s) macrotostringhelper(s) +char *version = macrotostring(O_VER); +char *objext = ".o"; +char *objflag = " -o "; +char *linkflags = " -L\""; +char *oname = NULL; // From O_NAME env var if present, or O_NAME macro otherwise. + + +char *dataModel = NULL; +char *compiler = NULL; +char *cc = NULL; +char *os = NULL; +char *platform = NULL; +char *binext = NULL; +char *staticlink = NULL; // Static compilation option - none on darwin / windows. +int alignment = 0; +int addressSize = 0; +int intsize = 0; +int bsd = 0; +int termux = 0; + + + +void ParseOsRelease(FILE *fd) { + while (fgets(osrelease, sizeof(osrelease), fd) != NULL) { + if (strncasecmp(osrelease, "id=", 3) == 0) { + int i=3; + while (osrelease[i] == '"') {i++;} + int j=i; + while (osrelease[j] > '"') {j++;} + if (j>i) { + osrelease[j] = 0; + os = osrelease + i; + } + break; + } + } + fclose(fd); +} + + +void determineLinuxVariant() { + FILE *fd = NULL; + os = "linux"; + + if ((fd = fopen("/etc/os-release", "r"))) {ParseOsRelease(fd); return;} + // Hack for centos without /etc/os-release + if ((fd = fopen("/etc/centos-release", "r"))) {os = "centos"; fclose(fd); return;} + // Hack to detect running in termux in android + if ((fd = fopen("/data/data/com.termux/files/usr/bin/bash", "r"))) {os = "termux"; staticlink = ""; termux = 1; fclose(fd); return;} +} + + +void determineOS() { + #ifdef _WIN32 + os = "windows"; platform = "windows"; binext = ".exe"; staticlink = ""; + #else + os = "unknown"; platform = "unix"; binext = ""; staticlink = "-static"; + + struct utsname sys; + if (uname(&sys)<0) fail("Couldn't get sys name - uname() failed."); + + if (strncasecmp(sys.sysname, "cygwin", 6) == 0) {os = "cygwin"; binext = ".exe";} + else if (strncasecmp(sys.sysname, "linux", 5) == 0) {determineLinuxVariant();} + else if (strncasecmp(sys.sysname, "freebsd", 5) == 0) {os = "freebsd"; bsd = 1;} + else if (strncasecmp(sys.sysname, "openbsd", 5) == 0) {os = "openbsd"; bsd = 1;} + else if (strncasecmp(sys.sysname, "darwin", 5) == 0) {os = "darwin"; staticlink = "";} + else { + fprintf(stderr, "\n\n** Unrecognised utsname.sysname '%s' returned by uname().\n", sys.sysname); + fprintf(stderr, "** Please add a test for this OS in src/buildtools/configure.c\n"); + fprintf(stderr, "** in function determineOS() near line %d.\n\n", __LINE__-3); + fail("Unrecognised OS architecture name (sysname) returned by uname."); + } + #endif +} + + +void determineCCompiler() { + snprintf(libspec, sizeof(libspec), " -l %s", oname); + #if defined(__MINGW32__) + compiler = "mingw"; + if (sizeof (void*) == 4) { + cc = "i686-w64-mingw32-gcc -g"; + } else { + cc = "x86_64-w64-mingw32-gcc -g"; + } + #elif defined(__clang__) + compiler = "clang"; + cc = "clang -fPIC -g"; + #elif defined(__GNUC__) + compiler = "gcc"; + if (strncasecmp(os, "cygwin", 6) == 0) { + // Avoid cygwin specific warning that -fPIC is ignored. + cc = "gcc -g"; + } else { + cc = "gcc -fPIC -g"; + } + #elif defined(_MSC_VER) + compiler = "MSC"; + cc = "cl /nologo"; + objext = ".obj"; + objflag = " -Fe"; + linkflags = " -link -libpath:\""; + snprintf(libspec, sizeof(libspec), " lib%s.lib", oname); + #else + fail("Unrecognised C compiler."); + #endif +} + + + +void determineInstallDirectory() { + char *env = getenv("INSTALLDIR"); + if (env) { + strncpy(installdir, env, sizeof(installdir)); + } else { + #if defined(_MSC_VER) || defined(__MINGW32__) + if (sizeof (void*) == 8) { + snprintf(installdir, sizeof(installdir), "%s\\%s", getenv("ProgramFiles"), oname); + } else { + snprintf(installdir, sizeof(installdir), "%s\\%s", getenv("ProgramFiles(x86)"), oname); + } + #if defined(__MINGW32__) + int i; for(i=0; installdir[i]; i++) if (installdir[i] == '\\') installdir[i] = '/'; + #endif + #else + if (bsd) { + snprintf(installdir, sizeof(installdir), "/usr/local/share/%s", oname); + } else if (termux) { + snprintf(installdir, sizeof(installdir), "/data/data/com.termux/files/opt/%s", oname); + } else { + snprintf(installdir, sizeof(installdir), "/opt/%s", oname); + } + #endif + } +} + + + + +void determineLdconfig() { // Generate appropriate ldconfig command for this OS + if (bsd) { + snprintf(ldconfig, sizeof(ldconfig), "ldconfig -m \"%s/lib\"", installdir); + } else { + snprintf( + ldconfig, sizeof(ldconfig), + "if echo \"%s/lib\" >/etc/ld.so.conf.d/lib%s.conf; then ldconfig; fi", + installdir, oname + ); + } +} + + + + +void determineBuildDate() { + time_t t = time(0); + strftime(builddate, sizeof(builddate), "%Y/%m/%d", localtime(&t)); +} + + + +struct {char ch; CHAR x;} c; +struct {char ch; BOOLEAN x;} b; +struct {char ch; SHORTINT x;} si; +struct {char ch; INTEGER x;} i; +struct {char ch; LONGINT x;} li; +struct {char ch; SET x;} s; +struct {char ch; REAL x;} r; +struct {char ch; LONGREAL x;} lr; +struct {char ch; void* x;} p; +struct {char ch; void (*x)();} f; +struct {char ch; int x;} in; +struct {char ch; long x;} lo; +struct {char ch; long long x;} ll; +struct {char ch; char x[1];} a1; +struct {char ch; char x[2];} a2; +struct {char ch; char x[4];} a4; +struct {char ch; char x[8];} a8; + +struct s1 {char ch;}; struct {char ch; struct s1 x;} s1; +struct s2 {char ch[2];}; struct {char ch; struct s2 x;} s2; +struct s4 {char ch[4];}; struct {char ch; struct s4 x;} s4; +struct s8 {char ch[8];}; struct {char ch; struct s8 x;} s8; + +struct {char ch;} rec0; +struct {char x[65];} rec2; + + + + +// Pass any parameter to configure and it will report sizes and alignments +// instead of generating configuration files. + +void ReportSizesAndAlignments() { + printf("Type Size Align\n"); + printf("CHAR %4zd %4td\n", sizeof(CHAR), (char*)&c.x - (char*)&c); + printf("BOOLEAN %4zd %4td\n", sizeof(BOOLEAN), (char*)&b.x - (char*)&b); + printf("SHORTINT %4zd %4td\n", sizeof(SHORTINT), (char*)&si.x - (char*)&si); + printf("INTEGER %4zd %4td\n", sizeof(INTEGER), (char*)&i.x - (char*)&i); + printf("LONGINT %4zd %4td\n", sizeof(LONGINT), (char*)&li.x - (char*)&li); + printf("SET %4zd %4td\n", sizeof(SET), (char*)&s.x - (char*)&s); + printf("REAL %4zd %4td\n", sizeof(REAL), (char*)&r.x - (char*)&r); + printf("LONGREAL %4zd %4td\n", sizeof(LONGREAL), (char*)&lr.x - (char*)&lr); + printf("void* %4zd %4td\n", sizeof(void*), (char*)&p.x - (char*)&p); + printf("int %4zd %4td\n", sizeof(int), (char*)&in.x - (char*)&in); + printf("long %4zd %4td\n", sizeof(long), (char*)&lo.x - (char*)&lo); + printf("long long %4zd %4td\n", sizeof(long long), (char*)&ll.x - (char*)&ll); + printf("char[1] %4zd %4td\n", sizeof(a1.x), (char*)&a1.x - (char*)&a1); + printf("char[2] %4zd %4td\n", sizeof(a2.x), (char*)&a2.x - (char*)&a2); + printf("char[4] %4zd %4td\n", sizeof(a4.x), (char*)&a4.x - (char*)&a4); + printf("char[8] %4zd %4td\n", sizeof(a8.x), (char*)&a8.x - (char*)&a8); + printf("struct s1 %4zd %4td\n", sizeof(struct s1), (char*)&s1.x - (char*)&s1); + printf("struct s2 %4zd %4td\n", sizeof(struct s2), (char*)&s2.x - (char*)&s2); + printf("struct s4 %4zd %4td\n", sizeof(struct s4), (char*)&s4.x - (char*)&s4); + printf("struct s8 %4zd %4td\n", sizeof(struct s8), (char*)&s8.x - (char*)&s8); +} + + + +#define MIN(a,b) (((a)<(b)) ? (a) : (b)) + +void determineCDataModel() { + addressSize = sizeof(void*); + alignment = (char*)&lr.x - (char*)&lr; // Base alignment measure on largest type. + + if (addressSize == 4 && sizeof(int) == 4) dataModel = "ILP32"; // Unix/Linux and modern Win32 + else if (addressSize == 8 && sizeof(long) == 4) dataModel = "LLP64"; // Windows/mingw 64 bit + else if (addressSize == 8 && sizeof(long) == 8) dataModel = "LP64"; // Unix/Linux 64 bit + else fail("Unsupported combination of address size and int/long size."); + + // Check for supported address sie and alignment + + if (addressSize == 4) { + assert(alignment == 4 || alignment == 8, "Aligment neither 4 nor 8 when address size is 4."); + } else { + assert(addressSize == 8, "Address size neither 4 nor 8."); + assert(alignment == 8, "Alignemnt not 8 when address size is 8."); + } + + // Define 'LARGE' to get 32 bit INTEGER and 64 bit LONGINT even on 32 bit systems. + // Note that plenty of the library source files do not expect this. + + #ifdef LARGE + intsize = 4; + #else + intsize = (addressSize == 4) ? 2 : 4; + #endif +} + + + + +void testSystemDotH() { + /* test the __ASHR macro */ + assert(__ASHR(-1, 1) == -1, "ASH(-1, -1) # -1."); + assert(__ASHR(-2, 1) == -1, "ASH(-2, -1) # -1."); + assert(__ASHR(0, 1) == 0, "ASH(0, 1) # 0."); + assert(__ASHR(1, 1) == 0, "ASH(1, 1) # 0."); + assert(__ASHR(2, 1) == 1, "ASH(2, 1) # 1."); + + /* test the __SETRNG macro */ + long x = 0; + long y = sizeof(SET)*8 - 1; + assert(__SETRNG(x, y) == -1, "SETRNG(0, MAX(SET)) != -1."); + + /* test string comparison for extended ascii */ + {char a[10], b[10]; + a[0] = (CHAR)128; a[1] = 0; + b[0] = 0; + assert(__STRCMP(a, b) >= 0, "__STRCMP(a, b) with extended ascii charcters; should be unsigned."); + } + + // Check the sizes of the Oberon basic types as defined in SYSTEM.h. + // By design all but INTEGER and LONGINT are fixed across all supported platfroms. + + assert(sizeof(CHAR) == 1, "Size of CHAR not 1."); + assert(sizeof(BOOLEAN) == 1, "Size of BOOLEAN not 1."); + assert(sizeof(SHORTINT) == 1, "Size of SHORTINT not 1."); + assert(sizeof(INTEGER) == 2 + || sizeof(INTEGER) == 4, "Size of INTEGER neither 2 nor 4 bytes."); + assert(sizeof(LONGINT) == 4 + || sizeof(LONGINT) == 8, "Size of LONGINT neither 4 nor 8 bytes."); + assert(sizeof(SET) == sizeof(LONGINT), "Size of SET differs from size of LONGINT."); + assert(sizeof(REAL) == 4, "Size of REAL not 4 bytes."); + assert(sizeof(LONGREAL) == 8, "Size of LONGREAL not 8 bytes."); + assert(sizeof(f.x) == sizeof(p.x), "Size of function pointer differs from size of data pointer."); + + assert((alignment == 4) || (alignment == 8), "Alignment of LONGINT neither 4 nor 8 bytes."); + + assert(((char*)&c.x - (char*)&c) == 1, "Alignment of CHAR not 1."); + assert(((char*)&b.x - (char*)&b) == 1, "Alignment of BOOLEAN not 1."); + assert(((char*)&si.x - (char*)&si) == 1, "Alignment of SHORTINT not 1."); + //assert(((char*)&i.x - (char*)&i) == 4, "Alignment of INTEGER not 4 bytes."); + assert(((char*)&r.x - (char*)&r) == 4, "Alignment of REAL not 4 bytes."); + assert(((char*)&lr.x - (char*)&lr) >= 4, "Alignment of LONGREAL less than 4 bytes."); + assert(((char*)&s.x - (char*)&s) == MIN(alignment, sizeof(SET)), "Alignment of SET differs from alignmnet of LONGINT."); + assert(((char*)&p.x - (char*)&p) == addressSize, "Alignment of data pointer differs from address size."); + assert(((char*)&f.x - (char*)&f) == addressSize, "Alignment of data pointer differs from address size."); + + assert(sizeof(rec0) == 1, "CHAR wrapped in record aligns differently to CHAR alone."); + assert(sizeof(rec2) == 65, "CHAR array wrapped in record aligns differently to CHAR array alone."); + + assert(sizeof(LONGINT) >= sizeof(p.x), "LONGINT should have at least the same size as data pointers."); + assert(sizeof(LONGINT) >= sizeof(f.x), "LONGINT should have at least the same size as function pointers."); + + if (((sizeof(rec2)==65) == (sizeof(rec0)==1)) && ((sizeof(rec2)-64) != sizeof(rec0))) + printf("error: unsupported record layout sizeof(rec0) = %lu sizeof(rec2) = %lu\n", (long)sizeof(rec0), (long)sizeof(rec2)); + + x = 1; + assert(*(char*)&x == 1, "C compiler does not store multibyte numeric values in little-endian order."); +} + + + + +void writeMakeParameters() { + FILE *fd = fopen("Configuration.Make", "w"); + if (fd == NULL) fail("Couldn't create Configuration.make."); + fprintf(fd, "OLANGDIR=%s\n", cwd); + fprintf(fd, "COMPILER=%s\n", compiler); + fprintf(fd, "OS=%s\n", os); + fprintf(fd, "VERSION=%s\n", version); + fprintf(fd, "ONAME=%s\n", oname); + fprintf(fd, "DATAMODEL=%s\n", dataModel); + fprintf(fd, "INTSIZE=%d\n", intsize); + fprintf(fd, "ADRSIZE=%d\n", addressSize); + fprintf(fd, "ALIGNMENT=%d\n", alignment); + fprintf(fd, "INSTALLDIR=%s\n", installdir); + fprintf(fd, "PLATFORM=%s\n", platform); + fprintf(fd, "BINEXT=%s\n", binext); + fprintf(fd, "COMPILE=%s\n", cc); + fprintf(fd, "STATICLINK=%s\n", staticlink); + fprintf(fd, "LDCONFIG=%s\n", ldconfig); + fclose(fd); +} + + + + +void writeConfigurationMod() { + FILE *fd = fopen("Configuration.Mod", "w"); + if (fd == NULL) fail("Couldn't create Configuration.Mod."); + + fprintf(fd, "MODULE Configuration;\n"); + fprintf(fd, "CONST\n"); + fprintf(fd, " name* = '%s';\n", oname); + fprintf(fd, " versionLong* = '%s';\n", versionstring); + fprintf(fd, " intsize* = %d;\n", intsize); + fprintf(fd, " addressSize* = %d;\n", addressSize); + fprintf(fd, " alignment* = %d;\n", alignment); + fprintf(fd, " objext* = '%s';\n", objext); + fprintf(fd, " objflag* = '%s';\n", objflag); + fprintf(fd, " linkflags* = '%s';\n", linkflags); + fprintf(fd, " libspec* = '%s';\n", libspec); + fprintf(fd, " compile* = '%s';\n", cc); + fprintf(fd, " dataModel* = '%s';\n", dataModel); + fprintf(fd, " installdir* = '%s';\n", installdir); + fprintf(fd, " staticLink* = '%s';\n", staticlink); + fprintf(fd, "END Configuration.\n"); + + fclose(fd); +} + + + + +int main(int argc, char *argv[]) +{ + oname = getenv("ONAME"); if (!oname) oname = macrotostring(O_NAME); + + if (argc>1) { + ReportSizesAndAlignments(); + exit(0); + } + + getcwd(cwd, sizeof(cwd)); + int i; for (i=0; cwd[i]; i++) if (cwd[i]=='\\') cwd[i]='/'; + + determineOS(); + determineCCompiler(); + determineCDataModel(); + determineBuildDate(); + determineInstallDirectory(); + determineLdconfig(); + + testSystemDotH(); + + snprintf(versionstring, sizeof(versionstring), + "%s [%s] for %s %s on %s", + version, builddate, compiler, dataModel, os); + + writeConfigurationMod(); + writeMakeParameters(); + + printf("Configuration: %s\n", versionstring); + return 0; +} diff --git a/src/tools/make/vishap.make b/src/tools/make/vishap.make new file mode 100644 index 00000000..d7fdbe23 --- /dev/null +++ b/src/tools/make/vishap.make @@ -0,0 +1,372 @@ +# DO NOT RUN THIS MAKEFILE DIRECTLY. +# +# Always use the makefile in the root of the enlistment. This makefile +# depends on up to date configuration files generated by the root makefile. + + + + +# Gnu make has the make initial directory in CURDIR, BSD make has it in .CURDIR. +ROOTDIR = $(CURDIR)$(.CURDIR) + +include ./Configuration.Make + +FLAVOUR = $(OS).$(DATAMODEL).$(COMPILER) +BUILDDIR = build/$(FLAVOUR) +VISHAP = $(ONAME)$(BINEXT) + + + + +# Default make target - explain usage +usage: + @echo "" + @echo Do not run this makefile directly, always run the makefile in + @echo the root of the enlistment. + + + + +clean: + rm -rf $(BUILDDIR) + rm -f $(VISHAP) + + + + +# Assemble: Generate the Vishap Oberon compiler binary by compiling the C sources in the build directory + +assemble: + @printf "\nmake assemble - compiling Oberon compiler c source:\n" + @printf " VERSION: %s\n" "$(VERSION)" + @printf " Target characeristics:\n" + @printf " PLATFORM: %s\n" "$(PLATFORM)" + @printf " OS: %s\n" "$(OS)" + @printf " BUILDDIR: %s\n" "$(BUILDDIR)" + @printf " INSTALLDIR: %s\n" "$(INSTALLDIR)" + @printf " Oberon characteristics:\n" + @printf " INTSIZE: %s\n" "$(INTSIZE)" + @printf " ADRSIZE: %s\n" "$(ADRSIZE)" + @printf " ALIGNMENT: %s\n" "$(ALIGNMENT)" + @printf " C compiler:\n" + @printf " COMPILER: %s\n" "$(COMPILER)" + @printf " COMPILE: %s\n" "$(COMPILE)" + @printf " DATAMODEL: %s\n" "$(DATAMODEL)" + + cd $(BUILDDIR) && $(COMPILE) -c SYSTEM.c Configuration.c Platform.c Heap.c + cd $(BUILDDIR) && $(COMPILE) -c Console.c Strings.c Modules.c Files.c + cd $(BUILDDIR) && $(COMPILE) -c Reals.c Texts.c vt100.c errors.c + cd $(BUILDDIR) && $(COMPILE) -c OPM.c extTools.c OPS.c OPT.c + cd $(BUILDDIR) && $(COMPILE) -c OPC.c OPV.c OPB.c OPP.c + + cd $(BUILDDIR) && $(COMPILE) $(STATICLINK) Vishap.c -o $(ROOTDIR)/$(VISHAP) \ + SYSTEM.o Configuration.o Platform.o Heap.o Console.o Strings.o Modules.o Files.o \ + Reals.o Texts.o vt100.o errors.o OPM.o extTools.o OPS.o OPT.o \ + OPC.o OPV.o OPB.o OPP.o + @printf "$(VISHAP) created.\n" + + + + +compilerfromsavedsource: + @echo Populating clean build directory from bootstrap C sources. + @mkdir -p $(BUILDDIR) + @cp bootstrap/$(PLATFORM)-$(ADRSIZE)$(ALIGNMENT)/* $(BUILDDIR) + @make -f src/tools/make/vishap.make -s assemble + + + + +translate: +# Make sure we have an oberon compiler binary: if we built one earlier we'll use it, +# otherwise use one of the pre-prepared sets of C sources in the bootstrap directory. + + if [ ! -e $(VISHAP) ]; then make -f src/tools/make/vishap.make -s compilerfromsavedsource; fi + + @printf "\nmake translate - translating compiler source from Oberon to C:\n" + @printf " PLATFORM: %s\n" $(PLATFORM) + @printf " INTSIZE: %s\n" $(INTSIZE) + @printf " ADRSIZE: %s\n" $(ADRSIZE) + @printf " ALIGNMENT: %s\n" $(ALIGNMENT) + @mkdir -p $(BUILDDIR) + + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -B$(INTSIZE)$(ADRSIZE)$(ALIGNMENT) ../../Configuration.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -B$(INTSIZE)$(ADRSIZE)$(ALIGNMENT) ../../src/system/Platform$(PLATFORM).Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfFapx -B$(INTSIZE)$(ADRSIZE)$(ALIGNMENT) ../../src/system/Heap.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -B$(INTSIZE)$(ADRSIZE)$(ALIGNMENT) ../../src/system/Console.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -B$(INTSIZE)$(ADRSIZE)$(ALIGNMENT) ../../src/library/v4/Strings.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -B$(INTSIZE)$(ADRSIZE)$(ALIGNMENT) ../../src/library/v4/Modules.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfFx -B$(INTSIZE)$(ADRSIZE)$(ALIGNMENT) ../../src/system/Files.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -B$(INTSIZE)$(ADRSIZE)$(ALIGNMENT) ../../src/library/v4/Reals.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -B$(INTSIZE)$(ADRSIZE)$(ALIGNMENT) ../../src/library/v4/Texts.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -B$(INTSIZE)$(ADRSIZE)$(ALIGNMENT) ../../src/library/misc/vt100.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -B$(INTSIZE)$(ADRSIZE)$(ALIGNMENT) ../../src/compiler/errors.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -B$(INTSIZE)$(ADRSIZE)$(ALIGNMENT) ../../src/compiler/OPM.cmdln.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -B$(INTSIZE)$(ADRSIZE)$(ALIGNMENT) ../../src/compiler/extTools.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfFx -B$(INTSIZE)$(ADRSIZE)$(ALIGNMENT) ../../src/compiler/OPS.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -B$(INTSIZE)$(ADRSIZE)$(ALIGNMENT) ../../src/compiler/OPT.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -B$(INTSIZE)$(ADRSIZE)$(ALIGNMENT) ../../src/compiler/OPC.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -B$(INTSIZE)$(ADRSIZE)$(ALIGNMENT) ../../src/compiler/OPV.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -B$(INTSIZE)$(ADRSIZE)$(ALIGNMENT) ../../src/compiler/OPB.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -B$(INTSIZE)$(ADRSIZE)$(ALIGNMENT) ../../src/compiler/OPP.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ssfm -B$(INTSIZE)$(ADRSIZE)$(ALIGNMENT) ../../src/compiler/Vishap.Mod + + cp src/system/*.[ch] $(BUILDDIR) + + @printf "$(BUILDDIR) filled with compiler C source.\n" + + + + +browsercmd: + @printf "\nMaking symbol browser\n" + @cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -fSm ../../src/tools/browser/BrowserCmd.Mod + @cd $(BUILDDIR); $(COMPILE) BrowserCmd.c -o showdef \ + Platform.o Texts.o OPT.o Heap.o Console.o SYSTEM.o OPM.o OPS.o OPV.o \ + Files.o Reals.o Modules.o vt100.o errors.o Configuration.o Strings.o \ + OPC.o + + + + +FORCE: + +testcoordinator: FORCE + @rm -f testcoordinator.exe testclient.exe + @make -f src/tools/make/vishap.make -s testtools + + +testtools: + @printf "\nMaking test coordinator\n" + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SfFs ../../src/tools/testcoordinator/IP.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Sfsm ../../src/tools/testcoordinator/TestCoordinator.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Sfsm ../../src/tools/testcoordinator/TestClient.Mod + cd $(BUILDDIR); $(COMPILE) -c IP.c + cd $(BUILDDIR); $(COMPILE) TestCoordinator.c -o $(ROOTDIR)/testcoordinator \ + Platform.o SYSTEM.o Heap.o Console.o Strings.o IP.o + cd $(BUILDDIR); $(COMPILE) TestClient.c -o $(ROOTDIR)/testclient \ + Platform.o SYSTEM.o Heap.o Console.o Strings.o IP.o + + + + +# install: Use only after a successful full build. Installs the compiler +# and libraries in /opt/$(ONAME). +# May require root access. +install: + @printf "\nInstalling into \"$(INSTALLDIR)\"\n" + @rm -rf "$(INSTALLDIR)" + @mkdir -p "$(INSTALLDIR)/bin" "$(INSTALLDIR)/include" "$(INSTALLDIR)/sym" "$(INSTALLDIR)/lib" + @cp $(BUILDDIR)/*.h "$(INSTALLDIR)/include/" + @cp $(BUILDDIR)/*.sym "$(INSTALLDIR)/sym/" + @cp $(VISHAP) "$(INSTALLDIR)/bin/$(VISHAP)" + @-cp $(BUILDDIR)/showdef$(BINEXT) "$(INSTALLDIR)/bin" + @cp $(BUILDDIR)/lib$(ONAME).* "$(INSTALLDIR)/lib/" + @if which ldconfig >/dev/null 2>&1; then $(LDCONFIG); fi + @printf "\nNow add $(INSTALLDIR)/bin to your path, for example with the command:\n" + @printf "export PATH=\"$(INSTALLDIR)/bin:\$$PATH\"\n" + @printf "\n" + + + + +uninstall: + @printf "\nUninstalling from \"$(INSTALLDIR)\"\n" + rm -rf "$(INSTALLDIR)" + rm -f /etc/ld.so.conf/lib$(ONAME) + if which ldconfig >/dev/null 2>&1; then ldconfig; fi + + + + +v4: + @printf "\nMaking v4 library\n" + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/v4/Args.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/v4/Printer.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/v4/Sets.Mod + +ooc2: + @printf "\nMaking ooc2 library\n" + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc2/ooc2Strings.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc2/ooc2Ascii.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc2/ooc2CharClass.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc2/ooc2ConvTypes.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc2/ooc2IntConv.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc2/ooc2IntStr.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc2/ooc2Real0.Mod + +ooc: + @printf "\nMaking ooc library\n" + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocLowReal.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocLowLReal.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocRealMath.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocOakMath.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocLRealMath.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocLongInts.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocComplexMath.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocLComplexMath.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocAscii.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocCharClass.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocStrings.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocConvTypes.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocLRealConv.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocLRealStr.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocRealConv.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocRealStr.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocIntConv.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocIntStr.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocMsg.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocSysClock.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocTime.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocChannel.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocStrings2.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocRts.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocFilenames.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocTextRider.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocBinaryRider.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocJulianDay.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocFilenames.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocwrapperlibc.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocC$(DATAMODEL).Mod + +oocX11: + @printf "\nMaking oocX11 library\n" + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/oocX11/oocX11.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/oocX11/oocXutil.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/oocX11/oocXYplane.Mod + +ulm: + @printf "\nMaking ulm library\n" + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmObjects.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmPriorities.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmDisciplines.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmServices.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmSys.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmSYSTEM.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmEvents.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmProcess.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmResources.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmForwarders.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmRelatedEvents.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmTypes.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmStreams.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmStrings.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmSysTypes.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmTexts.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmSysConversions.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmErrors.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmSysErrors.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmSysStat.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmASCII.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmSets.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmIO.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmAssertions.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmIndirectDisciplines.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmStreamDisciplines.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmIEEE.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmMC68881.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmReals.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmPrint.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmWrite.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmConstStrings.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmPlotters.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmSysIO.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmLoader.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmNetIO.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmPersistentObjects.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmPersistentDisciplines.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmOperations.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmScales.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmTimes.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmClocks.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmTimers.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmConditions.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmStreamConditions.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmTimeConditions.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmCiphers.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmCipherOps.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmBlockCiphers.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmAsymmetricCiphers.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmConclusions.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmRandomGenerators.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmTCrypt.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmIntOperations.Mod + +pow32: + @printf "\nMaking pow library\n" + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/pow/powStrings.Mod + +misc: + @printf "\nMaking misc library\n" + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/system/Oberon.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/misc/crt.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/misc/Listen.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/misc/MersenneTwister.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/misc/MultiArrays.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/misc/MultiArrayRiders.Mod + +s3: + @printf "\nMaking s3 library\n" + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/s3/ethBTrees.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/s3/ethMD5.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/s3/ethSets.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/s3/ethZlib.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/s3/ethZlibBuffers.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/s3/ethZlibInflate.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/s3/ethZlibDeflate.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/s3/ethZlibReaders.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/s3/ethZlibWriters.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/s3/ethZip.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/s3/ethRandomNumbers.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/s3/ethGZReaders.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/s3/ethGZWriters.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/s3/ethUnicode.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/s3/ethDates.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/s3/ethReals.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/s3/ethStrings.Mod + +librarybinary: + @printf "\nMaking lib$(ONAME)\n" + +# Remove objects that should not be part of the library + rm -f $(BUILDDIR)/vishap.o + +# Note: remining compiler files are retained in the library allowing the building +# of utilities like BrowserCmd.Mod (aka showdef). + +# Make static library + ar rcs "$(BUILDDIR)/lib$(ONAME).a" $(BUILDDIR)/*.o + +# Make shared library + @cd $(BUILDDIR) && $(COMPILE) -shared -o lib$(ONAME).so *.o + + + + +library: v4 ooc2 ooc ulm pow32 misc s3 librarybinary + + + + +confidence: + @printf "\n\n--- Confidence tests ---\n\n" + cd src/test/confidence/hello; ./test.sh "$(INSTALLDIR)" + if [ "$(PLATFORM)" != "windows" ] ; then cd src/test/confidence/signal; ./test.sh "$(INSTALLDIR)"; fi + cd src/test/confidence/lola; ./test.sh "$(INSTALLDIR)" + cd src/test/confidence/arrayassignment; ./test.sh "$(INSTALLDIR)" + @printf "\n\n--- Confidence tests passed ---\n\n" + + + +# auto: A full build started from a central machine running TestCoordinator. +auto: + @make -f src/tools/make/vishap.make -s clean + @make -f src/tools/make/vishap.make -s translate + @make -f src/tools/make/vishap.make -s assemble + @make -f src/tools/make/vishap.make -s testtools + while cmd=$$(./testclient -w "$(FLAVOUR)"); do $$cmd 2>&1 | ./testclient -s "$(FLAVOUR)"; done + + + + + diff --git a/src/tools/testcoordinator/IP.Mod b/src/tools/testcoordinator/IP.Mod new file mode 100644 index 00000000..cec11d98 --- /dev/null +++ b/src/tools/testcoordinator/IP.Mod @@ -0,0 +1,283 @@ +MODULE IP; + +IMPORT SYSTEM, Platform, Console; + +CONST + FDcount- = 1024; (* Number of FDs in FD set *) + +TYPE + SocketAddress* = RECORD + length-: LONGINT; + buf: ARRAY 28 OF SYSTEM.BYTE; (* Sufficient for IPv4 and IPv6. *) + END; + FDset* = ARRAY 128 OF SYSTEM.BYTE; (* Exposes C fd_set *) + + InAddr = POINTER TO InAddrDesc; + InAddrDesc = RECORD + addr: ARRAY 128 OF SYSTEM.BYTE; + next: InAddr + END; + +VAR + v4-: LONGINT; (* AF_INET *) + v6-: LONGINT; (* AF_INET6 *) + Stream-: LONGINT; (* SOCK_STREAM *) + Datagram-: LONGINT; (* SOCK_DGRAM *) + + + (* Testing *) + + addr: InAddr; + err: Platform.ErrorCode; + + + PROCEDURE -AAincludetypes "#include "; + PROCEDURE -AAincludetime "#include "; + PROCEDURE -AAincludesocket "#include "; + PROCEDURE -AAincludeselect "#include "; + PROCEDURE -AAincludenetdb "#include "; + + + PROCEDURE -AICANONNAME (): LONGINT "AI_CANONNAME"; + PROCEDURE -AIPASSIVE (): LONGINT "AI_PASSIVE "; + PROCEDURE -AFUNSPEC (): LONGINT "AF_UNSPEC"; + PROCEDURE -AFINET (): LONGINT "AF_INET"; + PROCEDURE -AFINET6 (): LONGINT "AF_INET6"; + PROCEDURE -SOCKSTREAM (): LONGINT "SOCK_STREAM"; + PROCEDURE -SOCKDGRAM (): LONGINT "SOCK_DGRAM"; + PROCEDURE -NINUMERICHOST(): LONGINT "NI_NUMERICHOST"; + PROCEDURE -NINUMERICSERV(): LONGINT "NI_NUMERICSERV"; + PROCEDURE -EAISYSTEM (): LONGINT "EAI_SYSTEM"; + PROCEDURE -EAIFAIL (): LONGINT "EAI_FAIL"; + + +(* Console output convenience APIs *) + + PROCEDURE cs (s: ARRAY OF CHAR); BEGIN Console.String(s) END cs; + PROCEDURE csl(s: ARRAY OF CHAR); BEGIN Console.String(s); Console.Ln END csl; + PROCEDURE ci (i,w: LONGINT); BEGIN Console.Int(i,w) END ci; + PROCEDURE ch (i: LONGINT); BEGIN Console.Hex(i) END ch; + PROCEDURE cc (c: CHAR); BEGIN Console.Char(c) END cc; + PROCEDURE cl (); BEGIN Console.Ln END cl; + PROCEDURE hex(i: INTEGER): CHAR; + BEGIN IF i < 10 THEN RETURN CHR(i+48) ELSE RETURN CHR(i+55) END END hex; + PROCEDURE cb (b: SYSTEM.BYTE); + VAR v: INTEGER; + BEGIN + v := SYSTEM.VAL(INTEGER, b); cc(hex(v DIV 16)); cc(hex(v MOD 16)); + END cb; + + + PROCEDURE -getnameinfo(sa, salen, flags: LONGINT; VAR host, serv: ARRAY OF CHAR): INTEGER + "(INTEGER)getnameinfo((const struct sockaddr*)sa, salen, host, host__len, serv, serv__len, flags)"; + + PROCEDURE WriteSocketAddress*(s: SocketAddress); + VAR host, service: ARRAY 4096 OF CHAR; IPv6: BOOLEAN; + BEGIN + IPv6 := s.length > 20; (* IPv4 len = 16, IPv6 len = 28 *) + IF getnameinfo(SYSTEM.ADR(s.buf), s.length, NINUMERICHOST(), host, service) >= 0 THEN + IF IPv6 THEN cc('[') END; cs(host); IF IPv6 THEN cs("]:") ELSE cc(':') END; + cs(service) + END + END WriteSocketAddress; + + PROCEDURE SameAddress*(s1, s2: SocketAddress): BOOLEAN; + (* True if same IP address, independent of port number *) + VAR host1, host2, service: ARRAY 4096 OF CHAR; i: INTEGER; result: BOOLEAN; + BEGIN + result := getnameinfo(SYSTEM.ADR(s1.buf), s1.length, NINUMERICHOST(), host1, service) >= 0; + IF result THEN result := getnameinfo(SYSTEM.ADR(s2.buf), s2.length, NINUMERICHOST(), host2, service) >= 0 END; + cs("host1: '"); cs(host1); cs("', host2: '"); cs(host2); csl("'."); + IF result THEN + i := 0; + WHILE (host1[i] # 0X) & (host2[i] # 0X) & (host1[i] = host2[i]) DO INC(i) END; + result := host1[i] = host2[i] + END; + RETURN result; + END SameAddress; + + PROCEDURE -aiFlags (p: LONGINT): LONGINT "(LONGINT)((struct addrinfo*)p)->ai_flags"; + PROCEDURE -aiFamily (p: LONGINT): LONGINT "(LONGINT)((struct addrinfo*)p)->ai_family"; + PROCEDURE -aiSocketType(p: LONGINT): LONGINT "(LONGINT)((struct addrinfo*)p)->ai_socktype"; + PROCEDURE -aiProtocol (p: LONGINT): LONGINT "(LONGINT)((struct addrinfo*)p)->ai_protocol"; + PROCEDURE -aiAddrLen (p: LONGINT): LONGINT "(LONGINT)((struct addrinfo*)p)->ai_addrlen"; + PROCEDURE -aiSockAddr (p: LONGINT): LONGINT "(LONGINT)((struct addrinfo*)p)->ai_addr"; + PROCEDURE -aiCanonName (p: LONGINT): LONGINT "(LONGINT)((struct addrinfo*)p)->ai_canonname"; + PROCEDURE -aiNext (p: LONGINT): LONGINT "(LONGINT)((struct addrinfo*)p)->ai_next"; + + + PROCEDURE -caddrinfo(family, socktype, protocol, flags: LONGINT) "struct addrinfo ai={flags,family,socktype,protocol,0}"; + PROCEDURE -caddrinfoptr "struct addrinfo *pai"; + PROCEDURE -getaddrinfo(host, service: LONGINT): INTEGER + "(INTEGER)getaddrinfo((char*)host, (char*)service, &ai, &pai)"; + PROCEDURE -pai(): LONGINT "(LONGINT)pai"; + PROCEDURE -freeaddrinfo(addrinfo: LONGINT) "freeaddrinfo((struct addrinfo*)addrinfo)"; + + + (* To get a local receiving address, past host as an empty string. *) + PROCEDURE Lookup*(host, service: ARRAY OF CHAR; family, socktype: LONGINT; VAR addr: SocketAddress): Platform.ErrorCode; + VAR addrinfo, hostptr, flags: LONGINT; result: Platform.ErrorCode; + BEGIN + IF host[0] = 0X THEN + hostptr := 0; flags := AIPASSIVE(); + ELSE + hostptr := SYSTEM.ADR(host); flags := 0; + END; + caddrinfo(family, socktype, 0, flags); + caddrinfoptr; + result := getaddrinfo(hostptr, SYSTEM.ADR(service)); + IF result = EAISYSTEM() THEN RETURN Platform.Error() END; + (* Return getaddrinfo specific reslts as negative numbers to avoid clash with OS error codes. *) + IF result # 0 THEN RETURN -ABS(result) END; + + addrinfo := pai(); addr.length := aiAddrLen(addrinfo); + IF (addrinfo = 0) OR (addr.length <= 0) THEN RETURN SHORT(-ABS(EAIFAIL())) END; + + ASSERT(addr.length <= LEN(addr.buf)); + SYSTEM.MOVE(aiSockAddr(addrinfo), SYSTEM.ADR(addr.buf), addr.length); + + freeaddrinfo(addrinfo); + + RETURN result; + END Lookup; + + + + + PROCEDURE -socket(domain, type, protocol: LONGINT): LONGINT + "(LONGINT)socket((int)domain, (int)type, (int)protocol)"; + + PROCEDURE Socket*(domain, type: LONGINT; VAR fd: LONGINT): Platform.ErrorCode; + BEGIN + fd := socket(domain, type, 0); (* No supported domain needs a non-zero protocol *) + IF fd < 0 THEN RETURN Platform.Error() END; + RETURN 0; + END Socket; + + + + + PROCEDURE -bind(sockfd: LONGINT; addr, addrlen: LONGINT): INTEGER + "(INTEGER)bind((int)sockfd, (const struct sockaddr*)addr, (socklen_t)addrlen)"; + + PROCEDURE Bind*(sockfd: LONGINT; address: SocketAddress): Platform.ErrorCode; + BEGIN + IF bind(sockfd, SYSTEM.ADR(address.buf), address.length) < 0 THEN RETURN Platform.Error() END; + RETURN 0; + END Bind; + + + + + PROCEDURE -listen(sockfd, backlog: LONGINT): INTEGER + "(INTEGER)listen((int)sockfd, (int)backlog)"; + + PROCEDURE Listen*(sockfd, backlog: LONGINT): INTEGER; + BEGIN RETURN listen(sockfd, backlog) + END Listen; + + + + + PROCEDURE -accept(sockfd: LONGINT; addr, addrlen: LONGINT): LONGINT + "(LONGINT)accept((int)sockfd, (struct sockaddr*)addr, (socklen_t*)addrlen)"; + + PROCEDURE Accept*(sockfd: LONGINT; VAR address: SocketAddress; VAR newfd: LONGINT): Platform.ErrorCode; + BEGIN + address.length := LEN(address.buf); + newfd := accept(sockfd, SYSTEM.ADR(address.buf), SYSTEM.ADR(address.length)); + IF newfd < 0 THEN RETURN Platform.Error() END; + RETURN 0 + END Accept; + + + + + PROCEDURE -connect(sockfd, addr, length: LONGINT): INTEGER + "(INTEGER)connect((int)sockfd, (struct sockaddr*)addr, (socklen_t)length)"; + + PROCEDURE Connect*(sockfd: LONGINT; addr: SocketAddress): Platform.ErrorCode; + BEGIN + IF connect(sockfd, SYSTEM.ADR(addr.buf), addr.length) < 0 THEN RETURN Platform.Error() END; + RETURN 0; + END Connect; + + + + + PROCEDURE -recvfrom(sockfd, buf, buflen, flags, saddr: LONGINT; socklen: LONGINT): INTEGER + "(INTEGER)recvfrom((int)sockfd, (void*)buf, (size_t)buflen, (int)flags, (struct sockaddr*)saddr, (socklen_t*)socklen)"; + + PROCEDURE ReceiveFrom*( + sockfd: LONGINT; + VAR buf: ARRAY OF SYSTEM.BYTE; VAR length: LONGINT; + flags: LONGINT; + VAR sockaddr: SocketAddress + ): Platform.ErrorCode; + BEGIN + sockaddr.length := LEN(sockaddr.buf); + length := recvfrom( + sockfd, + SYSTEM.ADR(buf), LEN(buf), + flags, + SYSTEM.ADR(sockaddr.buf), SYSTEM.ADR(sockaddr.length) + ); + IF length < 0 THEN RETURN Platform.Error() END; + RETURN 0; + END ReceiveFrom; + + + + PROCEDURE -sendto(sockfd, buf, len, flags, addr, addrlen: LONGINT): LONGINT + "(LONGINT)sendto((int)sockfd, (void*)buf, (size_t)len, (int)flags, (struct sockaddr*)addr, (socklen_t)addrlen)"; + + PROCEDURE SendTo*(sockfd: LONGINT; VAR buf: ARRAY OF SYSTEM.BYTE; buflen, flags: LONGINT; addr: SocketAddress): Platform.ErrorCode; + BEGIN + IF sendto(sockfd, SYSTEM.ADR(buf), buflen, flags, SYSTEM.ADR(addr.buf), addr.length) < 0 THEN + RETURN Platform.Error() + ELSE + RETURN 0 + END + END SendTo; + + + + + PROCEDURE -FDZERO(VAR fds: FDset) "FD_ZERO((fd_set*)fds)"; + PROCEDURE ZeroFDs*(VAR fds: FDset); BEGIN FDZERO(fds) END ZeroFDs; + + PROCEDURE -FDCLR(i: LONGINT; VAR fds: FDset) "FD_CLR((int)i, (fd_set*)fds)"; + PROCEDURE ClearFD*(i: LONGINT; VAR fds: FDset); BEGIN FDCLR(i, fds) END ClearFD; + + PROCEDURE -FDSET(i: LONGINT; VAR fds: FDset) "FD_SET((int)i, (fd_set*)fds)"; + PROCEDURE SetFD*(i: LONGINT; VAR fds: FDset); BEGIN FDSET(i, fds) END SetFD; + + PROCEDURE -FDISSET(i: LONGINT; VAR fds: FDset): INTEGER "(INTEGER)FD_ISSET((int)i, (fd_set*)fds)"; + PROCEDURE FDisSet*(i: LONGINT; VAR fds: FDset): BOOLEAN; + BEGIN RETURN FDISSET(i, fds) # 0 END FDisSet; + + PROCEDURE -SizeofFdSet(): LONGINT "(LONGINT)sizeof(fd_set)"; + + + PROCEDURE -timeval(ms: LONGINT) "struct timeval tv = {ms/1000, (ms%1000)*1000}"; + PROCEDURE -select(socketLimit: LONGINT; VAR read, write, except: FDset): LONGINT + "select((int)socketLimit, (fd_set*)read, (fd_set*)write, (fd_set*)except, &tv)"; + + PROCEDURE Select*(socketLimit: LONGINT; VAR read, write, except: FDset; ms: LONGINT; VAR readycount: LONGINT): Platform.ErrorCode; + BEGIN + timeval(ms); + readycount := select(socketLimit, read, write, except); + IF readycount < 0 THEN readycount := 0; RETURN Platform.Error() END; + RETURN 0 + END Select; + + + + +BEGIN + ASSERT(SIZE(FDset) >= SizeofFdSet()); + v4 := AFINET(); + v6 := AFINET6(); + Stream := SOCKSTREAM(); + Datagram := SOCKDGRAM(); +END IP. diff --git a/src/tools/testcoordinator/TestClient.Mod b/src/tools/testcoordinator/TestClient.Mod new file mode 100644 index 00000000..efbc2597 --- /dev/null +++ b/src/tools/testcoordinator/TestClient.Mod @@ -0,0 +1,219 @@ +MODULE TestClient; + +IMPORT IP, Platform, Console, Strings, SYSTEM; + +CONST + ServerName = "gan.brownsmeet.com"; + ServerPort = "2055"; + +TYPE + LineBuffer = RECORD + text: ARRAY 4096 OF CHAR; + length: INTEGER; + CR: BOOLEAN + END; + +VAR + Socket: Platform.FileHandle; + Server: IP.SocketAddress; + Param: ARRAY 1024 OF CHAR; + Buffer: LineBuffer; + +(* Console output convenience APIs *) + +PROCEDURE cs(s: ARRAY OF CHAR); +(* Oberon07 compatible variant of Console.String (LEN(s) safe). *) +VAR i: LONGINT; +BEGIN + i := 0; WHILE (i10 THEN eu(l DIV 10) END; ec(CHR(ORD('0') + (l MOD 10))) END eu; +PROCEDURE ei(l: LONGINT); + BEGIN IF l<0 THEN ec('-'); l := -l END; eu(l) END ei; + + + +PROCEDURE ConnectSocket; +VAR err: Platform.ErrorCode; +BEGIN + err := IP.Connect(Socket, Server); + WHILE Platform.ConnectionFailed(err) OR Platform.TimedOut(err) DO + es("Waiting for coordinator, error code: "); ei(err); esl("."); + Platform.Delay(30000); + err := IP.Connect(Socket, Server); + END; + ErrorCheck(err, "Couldn't connect to server: "); +END ConnectSocket; + + +PROCEDURE LogStdIn; +VAR i, n: LONGINT; inbuf: ARRAY 8192 OF CHAR; +BEGIN + ConnectSocket; + ErrorCheck(Platform.ReadBuf(Platform.StdIn, inbuf, n), "Failure reading standard input: "); + InitBuffer; + WHILE n > 0 DO + i := 0; + WHILE i < n DO LogCharacter(inbuf[i]); INC(i) END; + ErrorCheck(Platform.ReadBuf(Platform.StdIn, inbuf, n), "Failure reading standard input: "); + END; + FlushLog; +END LogStdIn; + + +PROCEDURE SendString(s: ARRAY OF CHAR); +BEGIN + ErrorCheck(Platform.Write(Socket, SYSTEM.ADR(s), Strings.Length(s)), + "Failed to write string to socket: "); +END SendString; + + +PROCEDURE SendStrings(s1, s2: ARRAY OF CHAR); +VAR buf: ARRAY 4096 OF CHAR; +BEGIN COPY(s1, buf); Strings.Append(s2, buf); SendString(buf) +END SendStrings; + + +PROCEDURE Continue; +BEGIN ConnectSocket; SendStrings("-continue ", Param) +END Continue; + + +PROCEDURE Wait; +VAR buf: ARRAY 64 OF CHAR; n: LONGINT; err: Platform.ErrorCode; waiting: BOOLEAN; +BEGIN + waiting := TRUE; + WHILE waiting DO + ConnectSocket; SendStrings("-wait ", Param); + ErrorCheck(Platform.ReadBuf(Socket, buf, n), "Failed to read command from test coordinator: "); + waiting := n <= 0 (* n=0 => coordinator was terminated *) + END; + IF n < LEN(buf) THEN buf[n] := 0X END; + es("Received command: '"); es(buf); esl("'."); + csl(buf); + IF buf = "exit" THEN Platform.Exit(1) END +END Wait; + + +PROCEDURE Help; +BEGIN + cl; + csl("TestClient - test log client"); cl; + csl("usage:"); cl; + csl(" command | TestClient -s id - Send command output identified by id."); + csl(" TestClient -w id - wait until TestClient -c runs somewhere."); + csl(" TestClient -c - continue all pending TestClient -w commands."); + Platform.Exit(0); +END Help; + + +PROCEDURE ParseParameters; +VAR option: ARRAY 1024 OF CHAR; +BEGIN + IF Platform.ArgCount > 1 THEN Platform.GetArg(1, option) END; + IF Platform.ArgCount = 3 THEN Platform.GetArg(2, Param) END; + + IF (Platform.ArgCount = 3) & (option = "-w") THEN Wait + ELSIF (Platform.ArgCount = 3) & (option = "-c") THEN Continue + ELSIF (Platform.ArgCount = 3) & (option = "-s") THEN LogStdIn + ELSE Help + END +END ParseParameters; + + + + +BEGIN + ErrorCheck(IP.Socket(IP.v4, IP.Stream, Socket), "Couldn't create sender socket: "); + ErrorCheck(IP.Lookup(ServerName, ServerPort, IP.v4, IP.Stream, Server), + "Couldn't lookup server socket address: "); + ParseParameters; + ErrorCheck(Platform.Close(Socket), "Couldn't close socket: ") +END TestClient. + diff --git a/src/tools/testcoordinator/TestCoordinator.Mod b/src/tools/testcoordinator/TestCoordinator.Mod new file mode 100644 index 00000000..b7983472 --- /dev/null +++ b/src/tools/testcoordinator/TestCoordinator.Mod @@ -0,0 +1,270 @@ +MODULE TestCoordinator; + +(* +Listens for client test machines, telling them when to start tests and recording +status and log data that they send. +Also listens to command machine that says when to start a new set of tests. +*) + +IMPORT IP, Platform, SYSTEM, Console, Strings; + +CONST + ListenPort = "2055"; + CoIdle = 0; + CoConnected = 1; + CoUnderway = 2; + CoWaiting = 3; + +TYPE + Connection = POINTER TO ConnectionState; + ConnectionState = RECORD + fd: LONGINT; (* Socket descriptor *) + state: INTEGER; (* CoIdle / CoConnected / CoWaiting *) + file: Platform.FileHandle; + text: ARRAY 4096 OF CHAR; + length: INTEGER; + CR: BOOLEAN; + END; + +VAR + MaxSocket: LONGINT; + Listener: LONGINT; + Connections: ARRAY IP.FDcount OF Connection; + + +(* Console output convenience APIs *) + +PROCEDURE cs (s: ARRAY OF CHAR); +(* Oberon07 compatible variant of Console.String (LEN(s) safe). *) +VAR i: LONGINT; +BEGIN + i := 0; WHILE (i END; *) + IF co.CR OR (c = 0AX) THEN FlushLine(co) END; + CASE c OF + 0DX: co.CR := TRUE + | 0AX: + ELSE co.text[co.length] := c; INC(co.length) + END +END lc; + +PROCEDURE ls(co: Connection; s: ARRAY OF CHAR); +VAR i: LONGINT; +BEGIN i := 0; WHILE (i < LEN(s)) & (s[i] # 0X) DO lc(co, s[i]); INC(i) END +END ls; + + + + +PROCEDURE AcceptConnection; +VAR + Them: IP.SocketAddress; + fd: LONGINT; +BEGIN + ErrorCheck(IP.Accept(Listener, Them, fd), "Accept failed: "); + IF fd > MaxSocket THEN MaxSocket := fd END; + InitConnection(fd); + (* TODO: Set fd as non-blocking: O_NONBLOCK and fcntl(). *) +END AcceptConnection; + + +PROCEDURE Continue(co: Connection; param: ARRAY OF CHAR); +VAR msg: ARRAY 10 OF CHAR; err: Platform.ErrorCode; +BEGIN + cs("Starting fd "); ci(co.fd,1); cl; + msg := "Go."; + ErrorCheck(Platform.Write(co.fd, SYSTEM.ADR(param), Strings.Length(param)), "Couldn't send continue message: "); + ErrorCheck(Platform.Close(co.fd), "Couldn't close waiting socket: "); + co.fd := 0; + co.state := CoIdle; +END Continue; + + +PROCEDURE ParseWord(buf: ARRAY OF CHAR; VAR i: INTEGER; VAR word: ARRAY OF CHAR); +VAR j: INTEGER; +BEGIN +END ParseWord; + + +PROCEDURE Command(co: Connection; buf: ARRAY OF CHAR); +VAR cmd, param: ARRAY 1024 OF CHAR; i,j: INTEGER; +BEGIN + i := 0; + (* The command is everything up to the first space *) + WHILE (i 32) DO + cmd[j] := buf[i]; INC(i); INC(j) + END; + IF j < LEN(cmd) THEN cmd[j] := 0X END; + + (* The parameter is everything else (except leading spaces). *) + WHILE (i 0 THEN FlushLine(co) END; + IF co.file # 0 THEN + ErrorCheck(Platform.Close(co.file), "Failed to close connection log file: "); + END; + co.state := CoIdle; + co.file := 0; + END +END ConnectionClosed; + + +PROCEDURE Cycle; +VAR + Us: IP.SocketAddress; + err: Platform.ErrorCode; + n: LONGINT; + rbuf: ARRAY 4100 OF CHAR; + i: LONGINT; + waitcount: LONGINT; + readFDs: IP.FDset; + noFDs: IP.FDset; + co: Connection; +BEGIN + IP.ZeroFDs(noFDs); + + ErrorCheck(IP.Socket(IP.v4, IP.Stream, Listener), "Couldn't create listener socket: "); + ErrorCheck(IP.Lookup("", ListenPort, IP.v4, IP.Stream, Us), "Couldn't lookup our own socket address: "); + ErrorCheck(IP.Bind (Listener, Us), "Bind failed: "); + ErrorCheck(IP.Listen(Listener, 10), "Listen failed: "); + + csl("Test coordinator listening for test clients."); + + MaxSocket := Listener; + LOOP + (* Prepare select parameters *) + IP.ZeroFDs(readFDs); + IP.SetFD(Listener, readFDs); + i := 0; WHILE i <= MaxSocket DO + co := Connections[i]; + IF (co # NIL) & (co.state >= CoConnected) THEN IP.SetFD(i, readFDs) END; + INC(i) END; + + (* Wait for some fd to need servicing, or 60 seconds. *) + ErrorCheck(IP.Select(MaxSocket+1, readFDs, noFDs, noFDs, 60000, waitcount), "Wait for next service activity failed: "); + IF waitcount > 0 THEN + i := 0; + WHILE i <= MaxSocket DO + IF IP.FDisSet(i, readFDs) THEN + IF i = Listener THEN + AcceptConnection; + ELSE + ErrorCheck(Platform.ReadBuf(i, rbuf, n), "ReadBuf failed: "); + IF n = 0 THEN + ConnectionClosed(Connections[i]); (* Client has closed the connection in an orderly manner. *) + ELSE + DataReceived(Connections[i], rbuf, n) + END + END + END; + INC(i) + END + END + END; + err := Platform.Close(Listener) +END Cycle; + +BEGIN + Cycle; +END TestCoordinator. + diff --git a/src/tools/vocparam/vocparam.c b/src/tools/vocparam/vocparam.c deleted file mode 100644 index 4fb325fd..00000000 --- a/src/tools/vocparam/vocparam.c +++ /dev/null @@ -1,78 +0,0 @@ -/* J. Templ 23.6.95 -this program tests and outputs important characteristics of -the C compiler and SYSTEM.h file used to compile it. -The output of this program is accepted by voc as file voc.par. -% cc vocparam.c; a.out > voc.par -*/ - - -#include "SYSTEM.h" -#include "stdio.h" - -struct {CHAR ch; CHAR x;} c; -struct {CHAR ch; BOOLEAN x;} b; -struct {CHAR ch; SHORTINT x;} si; -struct {CHAR ch; INTEGER x;} i; -struct {CHAR ch; LONGINT x;} li; -struct {CHAR ch; SYSTEM_INT8 x;} i8; -struct {CHAR ch; SYSTEM_INT16 x;} i16; -struct {CHAR ch; SYSTEM_INT32 x;} i32; -struct {CHAR ch; SYSTEM_INT64 x;} i64; -struct {CHAR ch; SET x;} s; -struct {CHAR ch; REAL x;} r; -struct {CHAR ch; LONGREAL x;} lr; -struct {CHAR ch; void *x;} p; -struct {CHAR ch; void (*x)();} f; -struct {CHAR ch;} rec0; -struct {CHAR ch; LONGREAL x;} rec1; -struct {char x[65];} rec2; - -int main() -{ - long x, y; - /* get size and alignment of standard types */ - printf("CHAR %lu %lu\n", sizeof(CHAR), (char*)&c.x - (char*)&c); - printf("BOOLEAN %lu %lu\n", sizeof(BOOLEAN), (char*)&b.x - (char*)&b); - printf("SHORTINT %lu %lu\n", sizeof(SHORTINT), (char*)&si.x - (char*)&si); - printf("INTEGER %lu %lu\n", sizeof(INTEGER), (char*)&i.x - (char*)&i); - printf("LONGINT %lu %lu\n", sizeof(LONGINT), (char*)&li.x - (char*)&li); - printf("SET %lu %lu\n", sizeof(SET), (char*)&s.x - (char*)&s); - printf("REAL %lu %lu\n", sizeof(REAL), (char*)&r.x - (char*)&r); - printf("LONGREAL %lu %lu\n", sizeof(LONGREAL), (char*)&lr.x - (char*)&lr); - printf("PTR %lu %lu\n", sizeof p.x, (char*)&p.x - (char*)&p); - printf("PROC %lu %lu\n", sizeof f.x, (char*)&f.x - (char*)&f); - printf("RECORD %d %lu\n", (sizeof rec2 == 65) == (sizeof rec0 == 1), sizeof rec2 - 64); - x = 1; - printf("ENDIAN %hhd %d\n", *(char*)&x, 0); - printf("SYSTEM.INT8 %lu %lu\n", sizeof(SYSTEM_INT8), (char*)&i8.x - (char*)&i8); - printf("SYSTEM.INT16 %lu %lu\n", sizeof(SYSTEM_INT16), (char*)&i16.x - (char*)&i16); - printf("SYSTEM.INT32 %lu %lu\n", sizeof(SYSTEM_INT32), (char*)&i32.x - (char*)&i32); - printf("SYSTEM.INT64 %lu %lu\n", sizeof(SYSTEM_INT64), (char*)&i64.x - (char*)&i64); - - - if (sizeof(CHAR)!=1) printf("error: CHAR should have size 1\n"); - if (sizeof(BOOLEAN)!=1) printf("error: BOOLEAN should have size 1\n"); - if (sizeof(SHORTINT)!=1) printf("error: SHORTINT should have size 1\n"); - if (sizeof(long)!=sizeof p.x) printf("error: LONGINT should have the same size as pointers\n"); - if (sizeof(long)!=sizeof f.x) printf("error: LONGINT should have the same size as function pointers\n"); - if (((sizeof rec2 == 65) == (sizeof rec0 == 1)) && ((sizeof rec2 - 64) != sizeof rec0)) - printf("error: unsupported record layout sizeof rec0 = %lu sizeof rec2 = %lu\n", sizeof rec0, sizeof rec2); - - /* test the __ASHR macro */ - if (__ASHR(-1, 1) != -1) printf("error: ASH(-1, -1) # -1\n"); - if (__ASHR(-2, 1) != -1) printf("error: ASH(-2, -1) # -1\n"); - if (__ASHR(0, 1) != 0) printf("error: ASH(0, 1) # 0\n"); - if (__ASHR(1, 1) != 0) printf("error: ASH(1, 1) # 0\n"); - if (__ASHR(2, 1) != 1) printf("error: ASH(2, 1) # 1\n"); - - /* test the __SETRNG macro */ - x = 0; y = sizeof(SET)*8 - 1; - if (__SETRNG(x, y) != -1) printf("error: SETRNG(0, MAX(SET)) != -1\n"); - - /* test string comparison for extended ascii */ - {char a[10], b[10]; - a[0] = (CHAR)128; a[1] = 0; - b[0] = 0; - if (__STRCMP(a, b) < 0) printf("error: __STRCMP(a, b) with extended ascii charcters; should be unsigned\n"); - } -} From be80ad7ae369519da92c12320bf3ee5eb30ad9eb Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 16 Jun 2016 16:43:10 +0100 Subject: [PATCH 082/580] Remove unneeded tests result files. --- src/test/confidence/arrayassignment/result | 10 -- src/test/confidence/hello/result | 1 - src/test/confidence/lola/result | 113 --------------------- src/test/confidence/signal/result | 1 - 4 files changed, 125 deletions(-) delete mode 100644 src/test/confidence/arrayassignment/result delete mode 100644 src/test/confidence/hello/result delete mode 100644 src/test/confidence/lola/result delete mode 100644 src/test/confidence/signal/result diff --git a/src/test/confidence/arrayassignment/result b/src/test/confidence/arrayassignment/result deleted file mode 100644 index 7ca85cf2..00000000 --- a/src/test/confidence/arrayassignment/result +++ /dev/null @@ -1,10 +0,0 @@ -a30: 1st 10 ch 2nd 10 ch 3rd 10 ch -a20: 1st 10 ch 2nd 10 ch - -a10: 1st 10 ch -a20: 1st 10 ch 2nd 10 ch - -a10: 1st 10 ch -a20: 1st 10 ch 2nd 10 ch - -Array assignment test complete. diff --git a/src/test/confidence/hello/result b/src/test/confidence/hello/result deleted file mode 100644 index 18832d35..00000000 --- a/src/test/confidence/hello/result +++ /dev/null @@ -1 +0,0 @@ -Hello. diff --git a/src/test/confidence/lola/result b/src/test/confidence/lola/result deleted file mode 100644 index 12f87669..00000000 --- a/src/test/confidence/lola/result +++ /dev/null @@ -1,113 +0,0 @@ -`timescale 1ns / 1 ps -module RISC5( // translated from Lola -input clk, rst, stallX, -input [31:0] inbus, codebus, -output [23:0] adr, -output rd, wr, ben, -output [31:0] outbus); -reg [21:0] PC; -reg [31:0] IR; -reg N, Z, C, OV, stall1, PMsel; -reg [31:0] R[15:0]; -reg [31:0] H; -wire [21:0] pcmux, nxpc; -wire cond, S, sa, sb, sc; -wire [31:0] ins, pmout; -wire p, q, u, v, w; -wire [3:0] op, ira, ira0, irb, irc; -wire [2:0] cc; -wire [15:0] imm; -wire [19:0] off; -wire [23:0] offL; -wire regwr, stall, stallL, stallM, stallD, stallFA, stallFM, stallFD; -wire [1:0] sc1, sc0; -wire a0, a1, a2, a3; -wire [7:0] inbusL, outbusB0, outbusB1, outbusB2, outbusB3; -wire [23:0] inbusH; -wire [31:0] A, B, C0, C1, aluRes, regmux, s1, s2, s3, t1, t2, t3, quotient, remainder; -wire [63:0] product; -wire [31:0] fsum, fprod, fquot; -wire Add, Sub, Mul, Div, Fadd, Fsub, Fmul, Fdiv, Ldr, Str, Br; -assign adr = stallL ? (B[23:0] + {4'h0, off}) : {pcmux, 2'h0}; -assign rd = ((Ldr & ~stallX) & ~stall1); -assign wr = ((Str & ~stallX) & ~stall1); -assign ben = ((((p & ~q) & v) & ~stallX) & ~stall1); -assign outbus = {outbusB3, outbusB2, outbusB1, outbusB0}; -PROM PM(.clk(clk), .adr(pcmux[8:0]), .data(pmout)); -Multiplier mulUnit(.clk(clk), .run(Mul), .u(~u), .stall(stallM), .x(B), .y(C1), .z(product)); -Divider divUnit(.clk(clk), .run(Div), .u(~u), .stall(stallD), .x(B), .y(C1), .quot(quotient), .rem(remainder)); -FPAdder faddUnit(.clk(clk), .run((Fadd | Fsub)), .u(u), .v(v), .stall(stallFA), .x(B), .y({(Fsub ^ C0[31]), C0[30:0]}), .z(fsum)); -FPMultiplier fmulUnit(.clk(clk), .run(Fmul), .stall(stallFM), .x(B), .y(C0), .z(fprod)); -FPDivider fdivUnit(.clk(clk), .run(Fdiv), .stall(stallFD), .x(B), .y(C0), .z(fquot)); -assign pcmux = ~rst ? 22'h3FF800 : stall ? PC : ((Br & cond) & u) ? (offL[21:0] + nxpc) : ((Br & cond) & ~u) ? C0[23:2] : nxpc; -assign nxpc = (PC + 1); -assign cond = (ins[27] ^ (((((((((cc == 0) & N) | ((cc == 1) & Z)) | ((cc == 2) & C)) | ((cc == 3) & OV)) | ((cc == 4) & (C | Z))) | ((cc == 5) & S)) | ((cc == 6) & (S | Z))) | (cc == 7))); -assign S = (N ^ OV); -assign sa = aluRes[31]; -assign sb = B[31]; -assign sc = C1[31]; -assign ins = PMsel ? pmout : IR; -assign p = ins[31]; -assign q = ins[30]; -assign u = ins[29]; -assign v = ins[28]; -assign w = ins[16]; -assign op = ins[19:16]; -assign ira = ins[27:24]; -assign ira0 = Br ? 4'hF : ira; -assign irb = ins[23:20]; -assign irc = ins[3:0]; -assign cc = ins[26:24]; -assign imm = ins[15:0]; -assign off = ins[19:0]; -assign offL = ins[23:0]; -assign regwr = (((~p & ~stall) | ((Ldr & ~stallX) & ~stall1)) | (((Br & cond) & v) & ~stallX)); -assign stall = ((((((stallL | stallM) | stallD) | stallFA) | stallFM) | stallFD) | stallX); -assign stallL = ((Ldr | Str) & ~stall1); -assign sc1 = C1[3:2]; -assign sc0 = C1[1:0]; -assign a0 = (~adr[1] & ~adr[0]); -assign a1 = (~adr[1] & adr[0]); -assign a2 = (adr[1] & ~adr[0]); -assign a3 = (adr[1] & adr[0]); -assign inbusL = (~ben | a0) ? inbus[7:0] : a1 ? inbus[15:8] : a2 ? inbus[23:16] : inbus[31:24]; -assign outbusB0 = A[7:0]; -assign outbusB1 = (ben & a1) ? A[7:0] : A[15:8]; -assign outbusB2 = (ben & a2) ? A[7:0] : A[23:16]; -assign outbusB3 = (ben & a3) ? A[7:0] : A[31:24]; -assign inbusH = ~ben ? inbus[31:8] : 24'h0; -assign A = R[ira0]; -assign B = R[irb]; -assign C0 = R[irc]; -assign C1 = q ? {{16{v}}, imm} : C0; -assign aluRes = ~op[3] ? ~op[2] ? ~op[1] ? ~op[0] ? q ? ~u ? {{16{v}}, imm} : {imm, 16'h0} : ~u ? C0 : ~v ? H : {N, Z, C, OV, 20'h0, 8'h58} : t3 : s3 : ~op[1] ? ~op[0] ? (B & C1) : (B & ~C1) : ~op[0] ? (B | C1) : (B ^ C1) : ~op[2] ? ~op[1] ? ~op[0] ? ((B + C) + (u & C)) : ((B - C1) - (u & C)) : ~op[0] ? product[31:0] : quotient : ~op[1] ? fsum : ~op[0] ? fprod : fquot; -assign regmux = Ldr ? {inbusH, inbusL} : (Br & v) ? {8'h0, nxpc, 2'h0} : aluRes; -assign s1 = (sc0 == 3) ? {w ? B[2:0] : {3{B[31]}}, B[31:3]} : (sc0 == 2) ? {w ? B[1:0] : {2{B[31]}}, B[31:2]} : (sc0 == 1) ? {w ? B[0] : B[31], B[31:1]} : B; -assign s2 = (sc1 == 3) ? {w ? s1[11:0] : {12{B[31]}}, s1[31:12]} : (sc1 == 2) ? {w ? s1[7:0] : {8{B[31]}}, s1[31:8]} : (sc1 == 1) ? {w ? s1[3:0] : {4{B[31]}}, s1[31:4]} : s1; -assign s3 = C1[4] ? {w ? s2[15:0] : {16{s2[31]}}, s2[31:16]} : s2; -assign t1 = (sc0 == 3) ? {B[28:0], 3'h0} : (sc0 == 2) ? {B[29:0], 2'h0} : (sc0 == 1) ? {B[30:0], 1'h0} : B; -assign t2 = (sc1 == 3) ? {t1[19:0], 12'h0} : (sc1 == 2) ? {t1[23:0], 8'h0} : (sc1 == 1) ? {t1[27:0], 4'h0} : t1; -assign t3 = C1[4] ? {t2[15:0], 16'h0} : t2; -assign Add = (~p & (op == 8)); -assign Sub = (~p & (op == 9)); -assign Mul = (~p & (op == 10)); -assign Div = (~p & (op == 11)); -assign Fadd = (~p & (op == 12)); -assign Fsub = (~p & (op == 13)); -assign Fmul = (~p & (op == 14)); -assign Fdiv = (~p & (op == 15)); -assign Ldr = ((p & ~q) & ~u); -assign Str = ((p & ~q) & u); -assign Br = (p & q); -always @ (posedge clk) begin PC <= pcmux; -IR <= stall ? IR : codebus; -N <= regwr ? regmux[31] : N; -Z <= regwr ? (regmux == 0) : Z; -C <= Add ? (((sb & sc) | ((~sa & ~sb) & sc)) | (((~sa & sb) & ~sc) & sa)) : Sub ? (((~sb & sc) | ((sa & ~sb) & ~sc)) | ((sa & sb) & sc)) : C; -OV <= Add ? (((sa & ~sb) & ~sc) | ((~sa & sb) & sc)) : Sub ? (((sa & ~sb) & sc) | ((~sa & sb) & ~sc)) : OV; -stall1 <= stallX ? stall1 : stallL; -PMsel <= (~rst | (pcmux[21:12] == 10'h3FF)); -R[ira0] <= regwr ? regmux : A; -H <= Mul ? product[63:32] : Div ? remainder : H; -end -endmodule diff --git a/src/test/confidence/signal/result b/src/test/confidence/signal/result deleted file mode 100644 index b9d387bd..00000000 --- a/src/test/confidence/signal/result +++ /dev/null @@ -1 +0,0 @@ -Signal 2 From 43c5f44c10b74cca9b048e8c9873acfdc707a6ce Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 16 Jun 2016 16:51:11 +0100 Subject: [PATCH 083/580] Add bootstrap and master make files. --- bootstrap/unix-44/Configuration.c | 16 + bootstrap/unix-44/Configuration.h | 14 + bootstrap/unix-44/Console.c | 150 ++ bootstrap/unix-44/Console.h | 23 + bootstrap/unix-44/Files.c | 1078 ++++++++++ bootstrap/unix-44/Files.h | 70 + bootstrap/unix-44/Heap.c | 752 +++++++ bootstrap/unix-44/Heap.h | 54 + bootstrap/unix-44/Modules.c | 171 ++ bootstrap/unix-44/Modules.h | 54 + bootstrap/unix-44/OPB.c | 2677 ++++++++++++++++++++++++ bootstrap/unix-44/OPB.h | 49 + bootstrap/unix-44/OPC.c | 2108 +++++++++++++++++++ bootstrap/unix-44/OPC.h | 49 + bootstrap/unix-44/OPM.c | 1091 ++++++++++ bootstrap/unix-44/OPM.h | 63 + bootstrap/unix-44/OPP.c | 1873 +++++++++++++++++ bootstrap/unix-44/OPP.h | 16 + bootstrap/unix-44/OPS.c | 623 ++++++ bootstrap/unix-44/OPS.h | 28 + bootstrap/unix-44/OPT.c | 1858 +++++++++++++++++ bootstrap/unix-44/OPT.h | 105 + bootstrap/unix-44/OPV.c | 1688 ++++++++++++++++ bootstrap/unix-44/OPV.h | 19 + bootstrap/unix-44/Platform.c | 792 ++++++++ bootstrap/unix-44/Platform.h | 82 + bootstrap/unix-44/Reals.c | 155 ++ bootstrap/unix-44/Reals.h | 22 + bootstrap/unix-44/SYSTEM.c | 207 ++ bootstrap/unix-44/SYSTEM.h | 275 +++ bootstrap/unix-44/Strings.c | 243 +++ bootstrap/unix-44/Strings.h | 23 + bootstrap/unix-44/Texts.c | 1838 +++++++++++++++++ bootstrap/unix-44/Texts.h | 172 ++ bootstrap/unix-44/Vishap.c | 168 ++ bootstrap/unix-44/WindowsWrapper.h | 9 + bootstrap/unix-44/errors.c | 198 ++ bootstrap/unix-44/errors.h | 18 + bootstrap/unix-44/extTools.c | 112 ++ bootstrap/unix-44/extTools.h | 16 + bootstrap/unix-44/vt100.c | 258 +++ bootstrap/unix-44/vt100.h | 37 + bootstrap/unix-48/Configuration.c | 16 + bootstrap/unix-48/Configuration.h | 14 + bootstrap/unix-48/Console.c | 150 ++ bootstrap/unix-48/Console.h | 23 + bootstrap/unix-48/Files.c | 1078 ++++++++++ bootstrap/unix-48/Files.h | 70 + bootstrap/unix-48/Heap.c | 752 +++++++ bootstrap/unix-48/Heap.h | 54 + bootstrap/unix-48/Modules.c | 171 ++ bootstrap/unix-48/Modules.h | 54 + bootstrap/unix-48/OPB.c | 2677 ++++++++++++++++++++++++ bootstrap/unix-48/OPB.h | 49 + bootstrap/unix-48/OPC.c | 2108 +++++++++++++++++++ bootstrap/unix-48/OPC.h | 49 + bootstrap/unix-48/OPM.c | 1091 ++++++++++ bootstrap/unix-48/OPM.h | 63 + bootstrap/unix-48/OPP.c | 1873 +++++++++++++++++ bootstrap/unix-48/OPP.h | 16 + bootstrap/unix-48/OPS.c | 623 ++++++ bootstrap/unix-48/OPS.h | 28 + bootstrap/unix-48/OPT.c | 1858 +++++++++++++++++ bootstrap/unix-48/OPT.h | 105 + bootstrap/unix-48/OPV.c | 1688 ++++++++++++++++ bootstrap/unix-48/OPV.h | 19 + bootstrap/unix-48/Platform.c | 792 ++++++++ bootstrap/unix-48/Platform.h | 82 + bootstrap/unix-48/Reals.c | 155 ++ bootstrap/unix-48/Reals.h | 22 + bootstrap/unix-48/SYSTEM.c | 207 ++ bootstrap/unix-48/SYSTEM.h | 275 +++ bootstrap/unix-48/Strings.c | 243 +++ bootstrap/unix-48/Strings.h | 23 + bootstrap/unix-48/Texts.c | 1838 +++++++++++++++++ bootstrap/unix-48/Texts.h | 173 ++ bootstrap/unix-48/Vishap.c | 168 ++ bootstrap/unix-48/WindowsWrapper.h | 9 + bootstrap/unix-48/errors.c | 198 ++ bootstrap/unix-48/errors.h | 18 + bootstrap/unix-48/extTools.c | 112 ++ bootstrap/unix-48/extTools.h | 16 + bootstrap/unix-48/vt100.c | 258 +++ bootstrap/unix-48/vt100.h | 37 + bootstrap/unix-88/Configuration.c | 17 + bootstrap/unix-88/Configuration.h | 15 + bootstrap/unix-88/Console.c | 151 ++ bootstrap/unix-88/Console.h | 24 + bootstrap/unix-88/Files.c | 1079 ++++++++++ bootstrap/unix-88/Files.h | 71 + bootstrap/unix-88/Heap.c | 753 +++++++ bootstrap/unix-88/Heap.h | 55 + bootstrap/unix-88/Modules.c | 172 ++ bootstrap/unix-88/Modules.h | 55 + bootstrap/unix-88/OPB.c | 2678 +++++++++++++++++++++++++ bootstrap/unix-88/OPB.h | 50 + bootstrap/unix-88/OPC.c | 2109 +++++++++++++++++++ bootstrap/unix-88/OPC.h | 50 + bootstrap/unix-88/OPM.c | 1092 ++++++++++ bootstrap/unix-88/OPM.h | 64 + bootstrap/unix-88/OPP.c | 1874 +++++++++++++++++ bootstrap/unix-88/OPP.h | 17 + bootstrap/unix-88/OPS.c | 624 ++++++ bootstrap/unix-88/OPS.h | 29 + bootstrap/unix-88/OPT.c | 1859 +++++++++++++++++ bootstrap/unix-88/OPT.h | 106 + bootstrap/unix-88/OPV.c | 1689 ++++++++++++++++ bootstrap/unix-88/OPV.h | 20 + bootstrap/unix-88/Platform.c | 793 ++++++++ bootstrap/unix-88/Platform.h | 83 + bootstrap/unix-88/Reals.c | 143 ++ bootstrap/unix-88/Reals.h | 23 + bootstrap/unix-88/SYSTEM.c | 207 ++ bootstrap/unix-88/SYSTEM.h | 275 +++ bootstrap/unix-88/Strings.c | 244 +++ bootstrap/unix-88/Strings.h | 24 + bootstrap/unix-88/Texts.c | 1839 +++++++++++++++++ bootstrap/unix-88/Texts.h | 173 ++ bootstrap/unix-88/Vishap.c | 169 ++ bootstrap/unix-88/WindowsWrapper.h | 9 + bootstrap/unix-88/errors.c | 199 ++ bootstrap/unix-88/errors.h | 19 + bootstrap/unix-88/extTools.c | 113 ++ bootstrap/unix-88/extTools.h | 17 + bootstrap/unix-88/vt100.c | 259 +++ bootstrap/unix-88/vt100.h | 38 + bootstrap/windows-48/Configuration.c | 16 + bootstrap/windows-48/Configuration.h | 14 + bootstrap/windows-48/Console.c | 150 ++ bootstrap/windows-48/Console.h | 23 + bootstrap/windows-48/Files.c | 1078 ++++++++++ bootstrap/windows-48/Files.h | 70 + bootstrap/windows-48/Heap.c | 752 +++++++ bootstrap/windows-48/Heap.h | 54 + bootstrap/windows-48/Modules.c | 171 ++ bootstrap/windows-48/Modules.h | 54 + bootstrap/windows-48/OPB.c | 2677 ++++++++++++++++++++++++ bootstrap/windows-48/OPB.h | 49 + bootstrap/windows-48/OPC.c | 2108 +++++++++++++++++++ bootstrap/windows-48/OPC.h | 49 + bootstrap/windows-48/OPM.c | 1091 ++++++++++ bootstrap/windows-48/OPM.h | 63 + bootstrap/windows-48/OPP.c | 1873 +++++++++++++++++ bootstrap/windows-48/OPP.h | 16 + bootstrap/windows-48/OPS.c | 623 ++++++ bootstrap/windows-48/OPS.h | 28 + bootstrap/windows-48/OPT.c | 1858 +++++++++++++++++ bootstrap/windows-48/OPT.h | 105 + bootstrap/windows-48/OPV.c | 1688 ++++++++++++++++ bootstrap/windows-48/OPV.h | 19 + bootstrap/windows-48/Platform.c | 818 ++++++++ bootstrap/windows-48/Platform.h | 84 + bootstrap/windows-48/Reals.c | 155 ++ bootstrap/windows-48/Reals.h | 22 + bootstrap/windows-48/SYSTEM.c | 207 ++ bootstrap/windows-48/SYSTEM.h | 275 +++ bootstrap/windows-48/Strings.c | 243 +++ bootstrap/windows-48/Strings.h | 23 + bootstrap/windows-48/Texts.c | 1838 +++++++++++++++++ bootstrap/windows-48/Texts.h | 173 ++ bootstrap/windows-48/Vishap.c | 168 ++ bootstrap/windows-48/WindowsWrapper.h | 9 + bootstrap/windows-48/errors.c | 198 ++ bootstrap/windows-48/errors.h | 18 + bootstrap/windows-48/extTools.c | 112 ++ bootstrap/windows-48/extTools.h | 16 + bootstrap/windows-48/vt100.c | 258 +++ bootstrap/windows-48/vt100.h | 37 + bootstrap/windows-88/Configuration.c | 17 + bootstrap/windows-88/Configuration.h | 15 + bootstrap/windows-88/Console.c | 151 ++ bootstrap/windows-88/Console.h | 24 + bootstrap/windows-88/Files.c | 1079 ++++++++++ bootstrap/windows-88/Files.h | 71 + bootstrap/windows-88/Heap.c | 753 +++++++ bootstrap/windows-88/Heap.h | 55 + bootstrap/windows-88/Modules.c | 172 ++ bootstrap/windows-88/Modules.h | 55 + bootstrap/windows-88/OPB.c | 2678 +++++++++++++++++++++++++ bootstrap/windows-88/OPB.h | 50 + bootstrap/windows-88/OPC.c | 2109 +++++++++++++++++++ bootstrap/windows-88/OPC.h | 50 + bootstrap/windows-88/OPM.c | 1092 ++++++++++ bootstrap/windows-88/OPM.h | 64 + bootstrap/windows-88/OPP.c | 1874 +++++++++++++++++ bootstrap/windows-88/OPP.h | 17 + bootstrap/windows-88/OPS.c | 624 ++++++ bootstrap/windows-88/OPS.h | 29 + bootstrap/windows-88/OPT.c | 1859 +++++++++++++++++ bootstrap/windows-88/OPT.h | 106 + bootstrap/windows-88/OPV.c | 1689 ++++++++++++++++ bootstrap/windows-88/OPV.h | 20 + bootstrap/windows-88/Platform.c | 819 ++++++++ bootstrap/windows-88/Platform.h | 85 + bootstrap/windows-88/Reals.c | 143 ++ bootstrap/windows-88/Reals.h | 23 + bootstrap/windows-88/SYSTEM.c | 207 ++ bootstrap/windows-88/SYSTEM.h | 275 +++ bootstrap/windows-88/Strings.c | 244 +++ bootstrap/windows-88/Strings.h | 24 + bootstrap/windows-88/Texts.c | 1839 +++++++++++++++++ bootstrap/windows-88/Texts.h | 173 ++ bootstrap/windows-88/Vishap.c | 169 ++ bootstrap/windows-88/WindowsWrapper.h | 9 + bootstrap/windows-88/errors.c | 199 ++ bootstrap/windows-88/errors.h | 19 + bootstrap/windows-88/extTools.c | 113 ++ bootstrap/windows-88/extTools.h | 17 + bootstrap/windows-88/vt100.c | 259 +++ bootstrap/windows-88/vt100.h | 38 + make.cmd | 429 ++++ makefile | 247 +++ 212 files changed, 97056 insertions(+) create mode 100644 bootstrap/unix-44/Configuration.c create mode 100644 bootstrap/unix-44/Configuration.h create mode 100644 bootstrap/unix-44/Console.c create mode 100644 bootstrap/unix-44/Console.h create mode 100644 bootstrap/unix-44/Files.c create mode 100644 bootstrap/unix-44/Files.h create mode 100644 bootstrap/unix-44/Heap.c create mode 100644 bootstrap/unix-44/Heap.h create mode 100644 bootstrap/unix-44/Modules.c create mode 100644 bootstrap/unix-44/Modules.h create mode 100644 bootstrap/unix-44/OPB.c create mode 100644 bootstrap/unix-44/OPB.h create mode 100644 bootstrap/unix-44/OPC.c create mode 100644 bootstrap/unix-44/OPC.h create mode 100644 bootstrap/unix-44/OPM.c create mode 100644 bootstrap/unix-44/OPM.h create mode 100644 bootstrap/unix-44/OPP.c create mode 100644 bootstrap/unix-44/OPP.h create mode 100644 bootstrap/unix-44/OPS.c create mode 100644 bootstrap/unix-44/OPS.h create mode 100644 bootstrap/unix-44/OPT.c create mode 100644 bootstrap/unix-44/OPT.h create mode 100644 bootstrap/unix-44/OPV.c create mode 100644 bootstrap/unix-44/OPV.h create mode 100644 bootstrap/unix-44/Platform.c create mode 100644 bootstrap/unix-44/Platform.h create mode 100644 bootstrap/unix-44/Reals.c create mode 100644 bootstrap/unix-44/Reals.h create mode 100644 bootstrap/unix-44/SYSTEM.c create mode 100644 bootstrap/unix-44/SYSTEM.h create mode 100644 bootstrap/unix-44/Strings.c create mode 100644 bootstrap/unix-44/Strings.h create mode 100644 bootstrap/unix-44/Texts.c create mode 100644 bootstrap/unix-44/Texts.h create mode 100644 bootstrap/unix-44/Vishap.c create mode 100644 bootstrap/unix-44/WindowsWrapper.h create mode 100644 bootstrap/unix-44/errors.c create mode 100644 bootstrap/unix-44/errors.h create mode 100644 bootstrap/unix-44/extTools.c create mode 100644 bootstrap/unix-44/extTools.h create mode 100644 bootstrap/unix-44/vt100.c create mode 100644 bootstrap/unix-44/vt100.h create mode 100644 bootstrap/unix-48/Configuration.c create mode 100644 bootstrap/unix-48/Configuration.h create mode 100644 bootstrap/unix-48/Console.c create mode 100644 bootstrap/unix-48/Console.h create mode 100644 bootstrap/unix-48/Files.c create mode 100644 bootstrap/unix-48/Files.h create mode 100644 bootstrap/unix-48/Heap.c create mode 100644 bootstrap/unix-48/Heap.h create mode 100644 bootstrap/unix-48/Modules.c create mode 100644 bootstrap/unix-48/Modules.h create mode 100644 bootstrap/unix-48/OPB.c create mode 100644 bootstrap/unix-48/OPB.h create mode 100644 bootstrap/unix-48/OPC.c create mode 100644 bootstrap/unix-48/OPC.h create mode 100644 bootstrap/unix-48/OPM.c create mode 100644 bootstrap/unix-48/OPM.h create mode 100644 bootstrap/unix-48/OPP.c create mode 100644 bootstrap/unix-48/OPP.h create mode 100644 bootstrap/unix-48/OPS.c create mode 100644 bootstrap/unix-48/OPS.h create mode 100644 bootstrap/unix-48/OPT.c create mode 100644 bootstrap/unix-48/OPT.h create mode 100644 bootstrap/unix-48/OPV.c create mode 100644 bootstrap/unix-48/OPV.h create mode 100644 bootstrap/unix-48/Platform.c create mode 100644 bootstrap/unix-48/Platform.h create mode 100644 bootstrap/unix-48/Reals.c create mode 100644 bootstrap/unix-48/Reals.h create mode 100644 bootstrap/unix-48/SYSTEM.c create mode 100644 bootstrap/unix-48/SYSTEM.h create mode 100644 bootstrap/unix-48/Strings.c create mode 100644 bootstrap/unix-48/Strings.h create mode 100644 bootstrap/unix-48/Texts.c create mode 100644 bootstrap/unix-48/Texts.h create mode 100644 bootstrap/unix-48/Vishap.c create mode 100644 bootstrap/unix-48/WindowsWrapper.h create mode 100644 bootstrap/unix-48/errors.c create mode 100644 bootstrap/unix-48/errors.h create mode 100644 bootstrap/unix-48/extTools.c create mode 100644 bootstrap/unix-48/extTools.h create mode 100644 bootstrap/unix-48/vt100.c create mode 100644 bootstrap/unix-48/vt100.h create mode 100644 bootstrap/unix-88/Configuration.c create mode 100644 bootstrap/unix-88/Configuration.h create mode 100644 bootstrap/unix-88/Console.c create mode 100644 bootstrap/unix-88/Console.h create mode 100644 bootstrap/unix-88/Files.c create mode 100644 bootstrap/unix-88/Files.h create mode 100644 bootstrap/unix-88/Heap.c create mode 100644 bootstrap/unix-88/Heap.h create mode 100644 bootstrap/unix-88/Modules.c create mode 100644 bootstrap/unix-88/Modules.h create mode 100644 bootstrap/unix-88/OPB.c create mode 100644 bootstrap/unix-88/OPB.h create mode 100644 bootstrap/unix-88/OPC.c create mode 100644 bootstrap/unix-88/OPC.h create mode 100644 bootstrap/unix-88/OPM.c create mode 100644 bootstrap/unix-88/OPM.h create mode 100644 bootstrap/unix-88/OPP.c create mode 100644 bootstrap/unix-88/OPP.h create mode 100644 bootstrap/unix-88/OPS.c create mode 100644 bootstrap/unix-88/OPS.h create mode 100644 bootstrap/unix-88/OPT.c create mode 100644 bootstrap/unix-88/OPT.h create mode 100644 bootstrap/unix-88/OPV.c create mode 100644 bootstrap/unix-88/OPV.h create mode 100644 bootstrap/unix-88/Platform.c create mode 100644 bootstrap/unix-88/Platform.h create mode 100644 bootstrap/unix-88/Reals.c create mode 100644 bootstrap/unix-88/Reals.h create mode 100644 bootstrap/unix-88/SYSTEM.c create mode 100644 bootstrap/unix-88/SYSTEM.h create mode 100644 bootstrap/unix-88/Strings.c create mode 100644 bootstrap/unix-88/Strings.h create mode 100644 bootstrap/unix-88/Texts.c create mode 100644 bootstrap/unix-88/Texts.h create mode 100644 bootstrap/unix-88/Vishap.c create mode 100644 bootstrap/unix-88/WindowsWrapper.h create mode 100644 bootstrap/unix-88/errors.c create mode 100644 bootstrap/unix-88/errors.h create mode 100644 bootstrap/unix-88/extTools.c create mode 100644 bootstrap/unix-88/extTools.h create mode 100644 bootstrap/unix-88/vt100.c create mode 100644 bootstrap/unix-88/vt100.h create mode 100644 bootstrap/windows-48/Configuration.c create mode 100644 bootstrap/windows-48/Configuration.h create mode 100644 bootstrap/windows-48/Console.c create mode 100644 bootstrap/windows-48/Console.h create mode 100644 bootstrap/windows-48/Files.c create mode 100644 bootstrap/windows-48/Files.h create mode 100644 bootstrap/windows-48/Heap.c create mode 100644 bootstrap/windows-48/Heap.h create mode 100644 bootstrap/windows-48/Modules.c create mode 100644 bootstrap/windows-48/Modules.h create mode 100644 bootstrap/windows-48/OPB.c create mode 100644 bootstrap/windows-48/OPB.h create mode 100644 bootstrap/windows-48/OPC.c create mode 100644 bootstrap/windows-48/OPC.h create mode 100644 bootstrap/windows-48/OPM.c create mode 100644 bootstrap/windows-48/OPM.h create mode 100644 bootstrap/windows-48/OPP.c create mode 100644 bootstrap/windows-48/OPP.h create mode 100644 bootstrap/windows-48/OPS.c create mode 100644 bootstrap/windows-48/OPS.h create mode 100644 bootstrap/windows-48/OPT.c create mode 100644 bootstrap/windows-48/OPT.h create mode 100644 bootstrap/windows-48/OPV.c create mode 100644 bootstrap/windows-48/OPV.h create mode 100644 bootstrap/windows-48/Platform.c create mode 100644 bootstrap/windows-48/Platform.h create mode 100644 bootstrap/windows-48/Reals.c create mode 100644 bootstrap/windows-48/Reals.h create mode 100644 bootstrap/windows-48/SYSTEM.c create mode 100644 bootstrap/windows-48/SYSTEM.h create mode 100644 bootstrap/windows-48/Strings.c create mode 100644 bootstrap/windows-48/Strings.h create mode 100644 bootstrap/windows-48/Texts.c create mode 100644 bootstrap/windows-48/Texts.h create mode 100644 bootstrap/windows-48/Vishap.c create mode 100644 bootstrap/windows-48/WindowsWrapper.h create mode 100644 bootstrap/windows-48/errors.c create mode 100644 bootstrap/windows-48/errors.h create mode 100644 bootstrap/windows-48/extTools.c create mode 100644 bootstrap/windows-48/extTools.h create mode 100644 bootstrap/windows-48/vt100.c create mode 100644 bootstrap/windows-48/vt100.h create mode 100644 bootstrap/windows-88/Configuration.c create mode 100644 bootstrap/windows-88/Configuration.h create mode 100644 bootstrap/windows-88/Console.c create mode 100644 bootstrap/windows-88/Console.h create mode 100644 bootstrap/windows-88/Files.c create mode 100644 bootstrap/windows-88/Files.h create mode 100644 bootstrap/windows-88/Heap.c create mode 100644 bootstrap/windows-88/Heap.h create mode 100644 bootstrap/windows-88/Modules.c create mode 100644 bootstrap/windows-88/Modules.h create mode 100644 bootstrap/windows-88/OPB.c create mode 100644 bootstrap/windows-88/OPB.h create mode 100644 bootstrap/windows-88/OPC.c create mode 100644 bootstrap/windows-88/OPC.h create mode 100644 bootstrap/windows-88/OPM.c create mode 100644 bootstrap/windows-88/OPM.h create mode 100644 bootstrap/windows-88/OPP.c create mode 100644 bootstrap/windows-88/OPP.h create mode 100644 bootstrap/windows-88/OPS.c create mode 100644 bootstrap/windows-88/OPS.h create mode 100644 bootstrap/windows-88/OPT.c create mode 100644 bootstrap/windows-88/OPT.h create mode 100644 bootstrap/windows-88/OPV.c create mode 100644 bootstrap/windows-88/OPV.h create mode 100644 bootstrap/windows-88/Platform.c create mode 100644 bootstrap/windows-88/Platform.h create mode 100644 bootstrap/windows-88/Reals.c create mode 100644 bootstrap/windows-88/Reals.h create mode 100644 bootstrap/windows-88/SYSTEM.c create mode 100644 bootstrap/windows-88/SYSTEM.h create mode 100644 bootstrap/windows-88/Strings.c create mode 100644 bootstrap/windows-88/Strings.h create mode 100644 bootstrap/windows-88/Texts.c create mode 100644 bootstrap/windows-88/Texts.h create mode 100644 bootstrap/windows-88/Vishap.c create mode 100644 bootstrap/windows-88/WindowsWrapper.h create mode 100644 bootstrap/windows-88/errors.c create mode 100644 bootstrap/windows-88/errors.h create mode 100644 bootstrap/windows-88/extTools.c create mode 100644 bootstrap/windows-88/extTools.h create mode 100644 bootstrap/windows-88/vt100.c create mode 100644 bootstrap/windows-88/vt100.h create mode 100644 make.cmd create mode 100644 makefile diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c new file mode 100644 index 00000000..a1992033 --- /dev/null +++ b/bootstrap/unix-44/Configuration.c @@ -0,0 +1,16 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +#include "SYSTEM.h" + + + + + + + +export void *Configuration__init(void) +{ + __DEFMOD; + __REGMOD("Configuration", 0); +/* BEGIN */ + __ENDMOD; +} diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h new file mode 100644 index 00000000..e7aed50a --- /dev/null +++ b/bootstrap/unix-44/Configuration.h @@ -0,0 +1,14 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ + +#ifndef Configuration__h +#define Configuration__h + +#include "SYSTEM.h" + + + + +import void *Configuration__init(void); + + +#endif diff --git a/bootstrap/unix-44/Console.c b/bootstrap/unix-44/Console.c new file mode 100644 index 00000000..7f8fd8c0 --- /dev/null +++ b/bootstrap/unix-44/Console.c @@ -0,0 +1,150 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +#include "SYSTEM.h" +#include "Platform.h" + + +static CHAR Console_line[128]; +static INTEGER Console_pos; + + +export void Console_Bool (BOOLEAN b); +export void Console_Char (CHAR ch); +export void Console_Flush (void); +export void Console_Hex (LONGINT i); +export void Console_Int (LONGINT i, LONGINT n); +export void Console_Ln (void); +export void Console_Read (CHAR *ch); +export void Console_ReadLine (CHAR *line, LONGINT line__len); +export void Console_String (CHAR *s, LONGINT s__len); + + +void Console_Flush (void) +{ + INTEGER error; + error = Platform_Write(((LONGINT)(1)), (LONGINT)(uintptr_t)Console_line, Console_pos); + Console_pos = 0; +} + +void Console_Char (CHAR ch) +{ + if (Console_pos == 128) { + Console_Flush(); + } + Console_line[__X(Console_pos, ((LONGINT)(128)))] = ch; + Console_pos += 1; + if (ch == 0x0a) { + Console_Flush(); + } +} + +void Console_String (CHAR *s, LONGINT s__len) +{ + INTEGER i; + __DUP(s, s__len, CHAR); + i = 0; + while (s[__X(i, s__len)] != 0x00) { + Console_Char(s[__X(i, s__len)]); + i += 1; + } + __DEL(s); +} + +void Console_Int (LONGINT i, LONGINT n) +{ + CHAR s[32]; + LONGINT i1, k; + if (i == __LSHL(1, 31, LONGINT)) { + __MOVE("8463847412", s, 11); + k = 10; + } else { + i1 = __ABS(i); + s[0] = (CHAR)(__MOD(i1, 10) + 48); + i1 = __DIV(i1, 10); + k = 1; + while (i1 > 0) { + s[__X(k, ((LONGINT)(32)))] = (CHAR)(__MOD(i1, 10) + 48); + i1 = __DIV(i1, 10); + k += 1; + } + } + if (i < 0) { + s[__X(k, ((LONGINT)(32)))] = '-'; + k += 1; + } + while (n > k) { + Console_Char(' '); + n -= 1; + } + while (k > 0) { + k -= 1; + Console_Char(s[__X(k, ((LONGINT)(32)))]); + } +} + +void Console_Ln (void) +{ + Console_Char(0x0a); +} + +void Console_Bool (BOOLEAN b) +{ + if (b) { + Console_String((CHAR*)"TRUE", (LONGINT)5); + } else { + Console_String((CHAR*)"FALSE", (LONGINT)6); + } +} + +void Console_Hex (LONGINT i) +{ + LONGINT k, n; + k = -28; + while (k <= 0) { + n = __MASK(__ASH(i, k), -16); + if (n <= 9) { + Console_Char((CHAR)(48 + n)); + } else { + Console_Char((CHAR)(55 + n)); + } + k += 4; + } +} + +void Console_Read (CHAR *ch) +{ + LONGINT n; + INTEGER error; + Console_Flush(); + error = Platform_ReadBuf(((LONGINT)(0)), (void*)&*ch, ((LONGINT)(1)), &n); + if (n != 1) { + *ch = 0x00; + } +} + +void Console_ReadLine (CHAR *line, LONGINT line__len) +{ + LONGINT i; + CHAR ch; + Console_Flush(); + i = 0; + Console_Read(&ch); + while ((((i < line__len - 1 && ch != 0x0a)) && ch != 0x00)) { + line[__X(i, line__len)] = ch; + i += 1; + Console_Read(&ch); + } + line[__X(i, line__len)] = 0x00; +} + + +export void *Console__init(void) +{ + __DEFMOD; + __MODULE_IMPORT(Platform); + __REGMOD("Console", 0); + __REGCMD("Flush", Console_Flush); + __REGCMD("Ln", Console_Ln); +/* BEGIN */ + Console_pos = 0; + __ENDMOD; +} diff --git a/bootstrap/unix-44/Console.h b/bootstrap/unix-44/Console.h new file mode 100644 index 00000000..316e7e46 --- /dev/null +++ b/bootstrap/unix-44/Console.h @@ -0,0 +1,23 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ + +#ifndef Console__h +#define Console__h + +#include "SYSTEM.h" + + + + +import void Console_Bool (BOOLEAN b); +import void Console_Char (CHAR ch); +import void Console_Flush (void); +import void Console_Hex (LONGINT i); +import void Console_Int (LONGINT i, LONGINT n); +import void Console_Ln (void); +import void Console_Read (CHAR *ch); +import void Console_ReadLine (CHAR *line, LONGINT line__len); +import void Console_String (CHAR *s, LONGINT s__len); +import void *Console__init(void); + + +#endif diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c new file mode 100644 index 00000000..f3b9b280 --- /dev/null +++ b/bootstrap/unix-44/Files.c @@ -0,0 +1,1078 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin tspkaSfF */ +#include "SYSTEM.h" +#include "Configuration.h" +#include "Console.h" +#include "Heap.h" +#include "Platform.h" +#include "Strings.h" + +typedef + struct Files_Handle *Files_File; + +typedef + struct Files_BufDesc { + Files_File f; + BOOLEAN chg; + LONGINT org, size; + SYSTEM_BYTE data[4096]; + } Files_BufDesc; + +typedef + Files_BufDesc *Files_Buffer; + +typedef + CHAR Files_FileName[101]; + +typedef + struct Files_Handle { + Files_FileName workName, registerName; + BOOLEAN tempFile; + Platform_FileIdentity identity; + LONGINT fd, len, pos; + Files_Buffer bufs[4]; + INTEGER swapper, state; + } Files_Handle; + +typedef + struct Files_Rider { + LONGINT res; + BOOLEAN eof; + Files_Buffer buf; + LONGINT org, offset; + } Files_Rider; + + +static LONGINT Files_fileTab[256]; +static INTEGER Files_tempno; +static CHAR Files_HOME[1024]; +static struct { + LONGINT len[1]; + CHAR data[1]; +} *Files_SearchPath; + +export LONGINT *Files_Handle__typ; +export LONGINT *Files_BufDesc__typ; +export LONGINT *Files_Rider__typ; + +export Files_File Files_Base (Files_Rider *r, LONGINT *r__typ); +static Files_File Files_CacheEntry (Platform_FileIdentity identity); +export void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INTEGER *res); +export void Files_Close (Files_File f); +static void Files_Create (Files_File f); +export void Files_Delete (CHAR *name, LONGINT name__len, INTEGER *res); +static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INTEGER errcode); +static void Files_Finalize (SYSTEM_PTR o); +static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *dest, LONGINT dest__len); +static void Files_Flush (Files_Buffer buf); +export void Files_GetDate (Files_File f, LONGINT *t, LONGINT *d); +export void Files_GetName (Files_File f, CHAR *name, LONGINT name__len); +static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *name, LONGINT name__len); +static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len); +static void Files_Init (void); +export LONGINT Files_Length (Files_File f); +static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT name__len, CHAR *dest, LONGINT dest__len); +export Files_File Files_New (CHAR *name, LONGINT name__len); +export Files_File Files_Old (CHAR *name, LONGINT name__len); +export LONGINT Files_Pos (Files_Rider *r, LONGINT *r__typ); +export void Files_Purge (Files_File f); +export void Files_Read (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x); +export void Files_ReadBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN *x); +export void Files_ReadByte (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len); +export void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, LONGINT n); +export void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, INTEGER *x); +export void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, LONGINT *x); +export void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x); +export void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); +export void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, LONGINT *x); +export void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x); +export void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x); +export void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); +export void Files_Register (Files_File f); +export void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INTEGER *res); +static void Files_ScanPath (INTEGER *pos, CHAR *dir, LONGINT dir__len); +export void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, LONGINT pos); +export void Files_SetSearchPath (CHAR *path, LONGINT path__len); +export void Files_Write (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE x); +export void Files_WriteBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN x); +export void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, LONGINT n); +export void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, INTEGER x); +export void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, LONGINT x); +export void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x); +export void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, LONGINT x); +export void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x); +export void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x); +export void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); + +#define Files_IdxTrap() __HALT(-1) + +static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INTEGER errcode) +{ + __DUP(s, s__len, CHAR); + Console_Ln(); + Console_String((CHAR*)"-- ", (LONGINT)4); + Console_String(s, s__len); + Console_String((CHAR*)": ", (LONGINT)3); + if (f != NIL) { + if (f->registerName[0] != 0x00) { + Console_String(f->registerName, ((LONGINT)(101))); + } else { + Console_String(f->workName, ((LONGINT)(101))); + } + if (f->fd != 0) { + Console_String((CHAR*)"f.fd = ", (LONGINT)8); + Console_Int(f->fd, ((LONGINT)(1))); + } + } + if (errcode != 0) { + Console_String((CHAR*)" errcode = ", (LONGINT)12); + Console_Int(errcode, ((LONGINT)(1))); + } + Console_Ln(); + __HALT(99); + __DEL(s); +} + +static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT name__len, CHAR *dest, LONGINT dest__len) +{ + INTEGER i, j; + __DUP(dir, dir__len, CHAR); + __DUP(name, name__len, CHAR); + i = 0; + j = 0; + while (dir[i] != 0x00) { + dest[i] = dir[i]; + i += 1; + } + if (dest[i - 1] != '/') { + dest[i] = '/'; + i += 1; + } + while (name[j] != 0x00) { + dest[i] = name[j]; + i += 1; + j += 1; + } + dest[i] = 0x00; + __DEL(dir); + __DEL(name); +} + +static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *name, LONGINT name__len) +{ + LONGINT n, i, j; + __DUP(finalName, finalName__len, CHAR); + Files_tempno += 1; + n = Files_tempno; + i = 0; + if (finalName[0] != '/') { + while (Platform_CWD[i] != 0x00) { + name[i] = Platform_CWD[i]; + i += 1; + } + if (Platform_CWD[i - 1] != '/') { + name[i] = '/'; + i += 1; + } + } + j = 0; + while (finalName[j] != 0x00) { + name[i] = finalName[j]; + i += 1; + j += 1; + } + i -= 1; + while (name[i] != '/') { + i -= 1; + } + name[i + 1] = '.'; + name[i + 2] = 't'; + name[i + 3] = 'm'; + name[i + 4] = 'p'; + name[i + 5] = '.'; + i += 6; + while (n > 0) { + name[i] = (CHAR)(__MOD(n, 10) + 48); + n = __DIV(n, 10); + i += 1; + } + name[i] = '.'; + i += 1; + n = Platform_PID; + while (n > 0) { + name[i] = (CHAR)(__MOD(n, 10) + 48); + n = __DIV(n, 10); + i += 1; + } + name[i] = 0x00; + __DEL(finalName); +} + +static void Files_Create (Files_File f) +{ + Platform_FileIdentity identity; + BOOLEAN done; + INTEGER error; + CHAR err[32]; + if (f->fd == -1) { + if (f->state == 1) { + Files_GetTempName(f->registerName, ((LONGINT)(101)), (void*)f->workName, ((LONGINT)(101))); + f->tempFile = 1; + } else if (f->state == 2) { + __COPY(f->registerName, f->workName, ((LONGINT)(101))); + f->registerName[0] = 0x00; + f->tempFile = 0; + } + error = Platform_Unlink((void*)f->workName, ((LONGINT)(101))); + error = Platform_New((void*)f->workName, ((LONGINT)(101)), &f->fd); + done = error == 0; + if ((!done && Platform_TooManyFiles(error)) || (done && f->fd >= 256)) { + if ((done && f->fd >= 256)) { + error = Platform_Close(f->fd); + } + Heap_GC(1); + error = Platform_New((void*)f->workName, ((LONGINT)(101)), &f->fd); + done = f->fd == 0; + } + if (done) { + if (f->fd >= 256) { + error = Platform_Close(f->fd); + Files_Err((CHAR*)"too many files open", (LONGINT)20, f, 0); + } else { + Files_fileTab[f->fd] = (LONGINT)(uintptr_t)f; + Heap_FileCount += 1; + Heap_RegisterFinalizer((void*)f, Files_Finalize); + f->state = 0; + f->pos = 0; + error = Platform_Identify(f->fd, &f->identity, Platform_FileIdentity__typ); + } + } else { + if (Platform_NoSuchDirectory(error)) { + __MOVE("no such directory", err, 18); + } else if (Platform_TooManyFiles(error)) { + __MOVE("too many files open", err, 20); + } else { + __MOVE("file not created", err, 17); + } + Files_Err(err, ((LONGINT)(32)), f, error); + } + } +} + +static void Files_Flush (Files_Buffer buf) +{ + INTEGER error; + Files_File f = NIL; + if (buf->chg) { + f = buf->f; + Files_Create(f); + if (buf->org != f->pos) { + error = Platform_Seek(f->fd, buf->org, Platform_SeekSet); + } + error = Platform_Write(f->fd, (LONGINT)(uintptr_t)buf->data, buf->size); + if (error != 0) { + Files_Err((CHAR*)"error writing file", (LONGINT)19, f, error); + } + f->pos = buf->org + buf->size; + buf->chg = 0; + error = Platform_Identify(f->fd, &f->identity, Platform_FileIdentity__typ); + if (error != 0) { + Files_Err((CHAR*)"error identifying file", (LONGINT)23, f, error); + } + } +} + +void Files_Close (Files_File f) +{ + LONGINT i; + INTEGER error; + if (f->state != 1 || f->registerName[0] != 0x00) { + Files_Create(f); + i = 0; + while ((i < 4 && f->bufs[i] != NIL)) { + Files_Flush(f->bufs[i]); + i += 1; + } + error = Platform_Sync(f->fd); + if (error != 0) { + Files_Err((CHAR*)"error writing file", (LONGINT)19, f, error); + } + Files_fileTab[f->fd] = 0; + error = Platform_Close(f->fd); + f->fd = -1; + f->state = 1; + Heap_FileCount -= 1; + } +} + +LONGINT Files_Length (Files_File f) +{ + LONGINT _o_result; + _o_result = f->len; + return _o_result; +} + +Files_File Files_New (CHAR *name, LONGINT name__len) +{ + Files_File _o_result; + Files_File f = NIL; + __DUP(name, name__len, CHAR); + __NEW(f, Files_Handle); + f->workName[0] = 0x00; + __COPY(name, f->registerName, ((LONGINT)(101))); + f->fd = -1; + f->state = 1; + f->len = 0; + f->pos = 0; + f->swapper = -1; + _o_result = f; + __DEL(name); + return _o_result; +} + +static void Files_ScanPath (INTEGER *pos, CHAR *dir, LONGINT dir__len) +{ + INTEGER i; + CHAR ch; + i = 0; + if (Files_SearchPath == NIL) { + if (*pos == 0) { + dir[0] = '.'; + i = 1; + *pos += 1; + } + } else { + ch = (Files_SearchPath->data)[*pos]; + while (ch == ' ' || ch == ';') { + *pos += 1; + ch = (Files_SearchPath->data)[*pos]; + } + if (ch == '~') { + *pos += 1; + ch = (Files_SearchPath->data)[*pos]; + while (Files_HOME[i] != 0x00) { + dir[i] = Files_HOME[i]; + i += 1; + } + if ((((((ch != '/' && ch != 0x00)) && ch != ';')) && ch != ' ')) { + while ((i > 0 && dir[i - 1] != '/')) { + i -= 1; + } + } + } + while ((ch != 0x00 && ch != ';')) { + dir[i] = ch; + i += 1; + *pos += 1; + ch = (Files_SearchPath->data)[*pos]; + } + while ((i > 0 && dir[i - 1] == ' ')) { + i -= 1; + } + } + dir[i] = 0x00; +} + +static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len) +{ + BOOLEAN _o_result; + INTEGER i; + CHAR ch; + i = 0; + ch = name[0]; + while ((ch != 0x00 && ch != '/')) { + i += 1; + ch = name[i]; + } + _o_result = ch == '/'; + return _o_result; +} + +static Files_File Files_CacheEntry (Platform_FileIdentity identity) +{ + Files_File _o_result; + Files_File f = NIL; + INTEGER i, error; + i = 0; + while (i < 256) { + f = (Files_File)(uintptr_t)Files_fileTab[i]; + if ((f != NIL && Platform_SameFile(identity, f->identity))) { + if (!Platform_SameFileTime(identity, f->identity)) { + i = 0; + while (i < 4) { + if (f->bufs[i] != NIL) { + f->bufs[i]->org = -1; + f->bufs[i] = NIL; + } + i += 1; + } + f->swapper = -1; + f->identity = identity; + error = Platform_Size(f->fd, &f->len); + } + _o_result = f; + return _o_result; + } + i += 1; + } + _o_result = NIL; + return _o_result; +} + +Files_File Files_Old (CHAR *name, LONGINT name__len) +{ + Files_File _o_result; + Files_File f = NIL; + LONGINT fd; + INTEGER pos; + BOOLEAN done; + CHAR dir[256], path[256]; + INTEGER error; + Platform_FileIdentity identity; + __DUP(name, name__len, CHAR); + if (name[0] != 0x00) { + if (Files_HasDir((void*)name, name__len)) { + dir[0] = 0x00; + __COPY(name, path, ((LONGINT)(256))); + } else { + pos = 0; + Files_ScanPath(&pos, (void*)dir, ((LONGINT)(256))); + Files_MakeFileName(dir, ((LONGINT)(256)), name, name__len, (void*)path, ((LONGINT)(256))); + Files_ScanPath(&pos, (void*)dir, ((LONGINT)(256))); + } + for (;;) { + error = Platform_OldRW((void*)path, ((LONGINT)(256)), &fd); + done = error == 0; + if ((!done && Platform_TooManyFiles(error)) || (done && fd >= 256)) { + if ((done && fd >= 256)) { + error = Platform_Close(fd); + } + Heap_GC(1); + error = Platform_OldRW((void*)path, ((LONGINT)(256)), &fd); + done = error == 0; + if ((!done && Platform_TooManyFiles(error))) { + Files_Err((CHAR*)"too many files open", (LONGINT)20, f, error); + } + } + if ((!done && Platform_Inaccessible(error))) { + error = Platform_OldRO((void*)path, ((LONGINT)(256)), &fd); + done = error == 0; + } + if ((!done && !Platform_Absent(error))) { + Console_String((CHAR*)"Warning: Files.Old ", (LONGINT)20); + Console_String(name, name__len); + Console_String((CHAR*)" error = ", (LONGINT)10); + Console_Int(error, ((LONGINT)(0))); + Console_Ln(); + } + if (done) { + error = Platform_Identify(fd, &identity, Platform_FileIdentity__typ); + f = Files_CacheEntry(identity); + if (f != NIL) { + error = Platform_Close(fd); + _o_result = f; + __DEL(name); + return _o_result; + } else if (fd >= 256) { + error = Platform_Close(fd); + Files_Err((CHAR*)"too many files open", (LONGINT)20, f, 0); + } else { + __NEW(f, Files_Handle); + Files_fileTab[fd] = (LONGINT)(uintptr_t)f; + Heap_FileCount += 1; + Heap_RegisterFinalizer((void*)f, Files_Finalize); + f->fd = fd; + f->state = 0; + f->pos = 0; + f->swapper = -1; + error = Platform_Size(fd, &f->len); + __COPY(name, f->workName, ((LONGINT)(101))); + f->registerName[0] = 0x00; + f->tempFile = 0; + f->identity = identity; + _o_result = f; + __DEL(name); + return _o_result; + } + } else if (dir[0] == 0x00) { + _o_result = NIL; + __DEL(name); + return _o_result; + } else { + Files_MakeFileName(dir, ((LONGINT)(256)), name, name__len, (void*)path, ((LONGINT)(256))); + Files_ScanPath(&pos, (void*)dir, ((LONGINT)(256))); + } + } + } else { + _o_result = NIL; + __DEL(name); + return _o_result; + } + __RETCHK; +} + +void Files_Purge (Files_File f) +{ + INTEGER i; + Platform_FileIdentity identity; + INTEGER error; + i = 0; + while (i < 4) { + if (f->bufs[i] != NIL) { + f->bufs[i]->org = -1; + f->bufs[i] = NIL; + } + i += 1; + } + if (f->fd != -1) { + error = Platform_Truncate(f->fd, ((LONGINT)(0))); + error = Platform_Seek(f->fd, ((LONGINT)(0)), Platform_SeekSet); + } + f->pos = 0; + f->len = 0; + f->swapper = -1; + error = Platform_Identify(f->fd, &identity, Platform_FileIdentity__typ); + Platform_SetMTime(&f->identity, Platform_FileIdentity__typ, identity); +} + +void Files_GetDate (Files_File f, LONGINT *t, LONGINT *d) +{ + Platform_FileIdentity identity; + INTEGER error; + Files_Create(f); + error = Platform_Identify(f->fd, &identity, Platform_FileIdentity__typ); + Platform_MTimeAsClock(identity, &*t, &*d); +} + +LONGINT Files_Pos (Files_Rider *r, LONGINT *r__typ) +{ + LONGINT _o_result; + _o_result = (*r).org + (*r).offset; + return _o_result; +} + +void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, LONGINT pos) +{ + LONGINT org, offset, i, n; + Files_Buffer buf = NIL; + INTEGER error; + if (f != NIL) { + if (pos > f->len) { + pos = f->len; + } else if (pos < 0) { + pos = 0; + } + offset = __MASK(pos, -4096); + org = pos - offset; + i = 0; + while ((((i < 4 && f->bufs[i] != NIL)) && org != f->bufs[i]->org)) { + i += 1; + } + if (i < 4) { + if (f->bufs[i] == NIL) { + __NEW(buf, Files_BufDesc); + buf->chg = 0; + buf->org = -1; + buf->f = f; + f->bufs[i] = buf; + } else { + buf = f->bufs[i]; + } + } else { + f->swapper = __MASK(f->swapper + 1, -4); + buf = f->bufs[f->swapper]; + Files_Flush(buf); + } + if (buf->org != org) { + if (org == f->len) { + buf->size = 0; + } else { + Files_Create(f); + if (f->pos != org) { + error = Platform_Seek(f->fd, org, Platform_SeekSet); + } + error = Platform_ReadBuf(f->fd, (void*)buf->data, ((LONGINT)(4096)), &n); + if (error != 0) { + Files_Err((CHAR*)"read from file not done", (LONGINT)24, f, error); + } + f->pos = org + n; + buf->size = n; + } + buf->org = org; + buf->chg = 0; + } + } else { + buf = NIL; + org = 0; + offset = 0; + } + (*r).buf = buf; + (*r).org = org; + (*r).offset = offset; + (*r).eof = 0; + (*r).res = 0; +} + +void Files_Read (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x) +{ + LONGINT offset; + Files_Buffer buf = NIL; + buf = (*r).buf; + offset = (*r).offset; + if ((*r).org != buf->org) { + Files_Set(&*r, r__typ, buf->f, (*r).org + offset); + buf = (*r).buf; + offset = (*r).offset; + } + if (offset < buf->size) { + *x = buf->data[offset]; + (*r).offset = offset + 1; + } else if ((*r).org + offset < buf->f->len) { + Files_Set(&*r, r__typ, (*r).buf->f, (*r).org + offset); + *x = (*r).buf->data[0]; + (*r).offset = 1; + } else { + *x = 0x00; + (*r).eof = 1; + } +} + +void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, LONGINT n) +{ + LONGINT xpos, min, restInBuf, offset; + Files_Buffer buf = NIL; + if (n > x__len) { + Files_IdxTrap(); + } + xpos = 0; + buf = (*r).buf; + offset = (*r).offset; + while (n > 0) { + if ((*r).org != buf->org || offset >= 4096) { + Files_Set(&*r, r__typ, buf->f, (*r).org + offset); + buf = (*r).buf; + offset = (*r).offset; + } + restInBuf = buf->size - offset; + if (restInBuf == 0) { + (*r).res = n; + (*r).eof = 1; + return; + } else if (n > restInBuf) { + min = restInBuf; + } else { + min = n; + } + __MOVE((LONGINT)(uintptr_t)buf->data + offset, (LONGINT)(uintptr_t)x + xpos, min); + offset += min; + (*r).offset = offset; + xpos += min; + n -= min; + } + (*r).res = 0; + (*r).eof = 0; +} + +void Files_ReadByte (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len) +{ + Files_ReadBytes(&*r, r__typ, (void*)x, x__len * ((LONGINT)(1)), ((LONGINT)(1))); +} + +Files_File Files_Base (Files_Rider *r, LONGINT *r__typ) +{ + Files_File _o_result; + _o_result = (*r).buf->f; + return _o_result; +} + +void Files_Write (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE x) +{ + Files_Buffer buf = NIL; + LONGINT offset; + buf = (*r).buf; + offset = (*r).offset; + if ((*r).org != buf->org || offset >= 4096) { + Files_Set(&*r, r__typ, buf->f, (*r).org + offset); + buf = (*r).buf; + offset = (*r).offset; + } + buf->data[offset] = x; + buf->chg = 1; + if (offset == buf->size) { + buf->size += 1; + buf->f->len += 1; + } + (*r).offset = offset + 1; + (*r).res = 0; +} + +void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, LONGINT n) +{ + LONGINT xpos, min, restInBuf, offset; + Files_Buffer buf = NIL; + if (n > x__len) { + Files_IdxTrap(); + } + xpos = 0; + buf = (*r).buf; + offset = (*r).offset; + while (n > 0) { + if ((*r).org != buf->org || offset >= 4096) { + Files_Set(&*r, r__typ, buf->f, (*r).org + offset); + buf = (*r).buf; + offset = (*r).offset; + } + restInBuf = 4096 - offset; + if (n > restInBuf) { + min = restInBuf; + } else { + min = n; + } + __MOVE((LONGINT)(uintptr_t)x + xpos, (LONGINT)(uintptr_t)buf->data + offset, min); + offset += min; + (*r).offset = offset; + if (offset > buf->size) { + buf->f->len += offset - buf->size; + buf->size = offset; + } + xpos += min; + n -= min; + buf->chg = 1; + } + (*r).res = 0; +} + +void Files_Delete (CHAR *name, LONGINT name__len, INTEGER *res) +{ + __DUP(name, name__len, CHAR); + *res = Platform_Unlink((void*)name, name__len); + __DEL(name); +} + +void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INTEGER *res) +{ + LONGINT fdold, fdnew, n; + INTEGER error, ignore; + Platform_FileIdentity oldidentity, newidentity; + CHAR buf[4096]; + __DUP(old, old__len, CHAR); + __DUP(new, new__len, CHAR); + error = Platform_IdentifyByName(old, old__len, &oldidentity, Platform_FileIdentity__typ); + if (error == 0) { + error = Platform_IdentifyByName(new, new__len, &newidentity, Platform_FileIdentity__typ); + if ((error != 0 && !Platform_SameFile(oldidentity, newidentity))) { + Files_Delete(new, new__len, &error); + } + error = Platform_Rename((void*)old, old__len, (void*)new, new__len); + if (!Platform_DifferentFilesystems(error)) { + *res = error; + return; + } else { + error = Platform_OldRO((void*)old, old__len, &fdold); + if (error != 0) { + *res = 2; + return; + } + error = Platform_New((void*)new, new__len, &fdnew); + if (error != 0) { + error = Platform_Close(fdold); + *res = 3; + return; + } + error = Platform_Read(fdold, (LONGINT)(uintptr_t)buf, ((LONGINT)(4096)), &n); + while (n > 0) { + error = Platform_Write(fdnew, (LONGINT)(uintptr_t)buf, n); + if (error != 0) { + ignore = Platform_Close(fdold); + ignore = Platform_Close(fdnew); + Files_Err((CHAR*)"cannot move file", (LONGINT)17, NIL, error); + } + error = Platform_Read(fdold, (LONGINT)(uintptr_t)buf, ((LONGINT)(4096)), &n); + } + ignore = Platform_Close(fdold); + ignore = Platform_Close(fdnew); + if (n == 0) { + error = Platform_Unlink((void*)old, old__len); + *res = 0; + } else { + Files_Err((CHAR*)"cannot move file", (LONGINT)17, NIL, error); + } + } + } else { + *res = 2; + } + __DEL(old); + __DEL(new); +} + +void Files_Register (Files_File f) +{ + INTEGER idx, errcode; + Files_File f1 = NIL; + CHAR file[104]; + if ((f->state == 1 && f->registerName[0] != 0x00)) { + f->state = 2; + } + Files_Close(f); + if (f->registerName[0] != 0x00) { + Files_Rename(f->workName, ((LONGINT)(101)), f->registerName, ((LONGINT)(101)), &errcode); + if (errcode != 0) { + __COPY(f->registerName, file, ((LONGINT)(104))); + __HALT(99); + } + __COPY(f->registerName, f->workName, ((LONGINT)(101))); + f->registerName[0] = 0x00; + f->tempFile = 0; + } +} + +void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INTEGER *res) +{ + __DUP(path, path__len, CHAR); + *res = Platform_Chdir((void*)path, path__len); + __DEL(path); +} + +static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *dest, LONGINT dest__len) +{ + LONGINT i, j; + if (!Platform_LittleEndian) { + i = src__len; + j = 0; + while (i > 0) { + i -= 1; + dest[j] = src[i]; + j += 1; + } + } else { + __MOVE((LONGINT)(uintptr_t)src, (LONGINT)(uintptr_t)dest, src__len); + } +} + +void Files_ReadBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN *x) +{ + Files_Read(&*R, R__typ, (CHAR*)(void*)&*x); +} + +void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, INTEGER *x) +{ + CHAR b[2]; + Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(2)), ((LONGINT)(2))); + *x = (int)b[0] + __ASHL((int)b[1], 8); +} + +void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, LONGINT *x) +{ + CHAR b[4]; + Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); + *x = ((LONGINT)((int)b[0] + __ASHL((int)b[1], 8)) + __ASHL((LONGINT)b[2], 16)) + __ASHL((LONGINT)b[3], 24); +} + +void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x) +{ + CHAR b[4]; + Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); + *x = (SET)(((LONGINT)((int)b[0] + __ASHL((int)b[1], 8)) + __ASHL((LONGINT)b[2], 16)) + __ASHL((LONGINT)b[3], 24)); +} + +void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x) +{ + CHAR b[4]; + Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); + Files_FlipBytes((void*)b, ((LONGINT)(4)), (void*)&*x, ((LONGINT)(4))); +} + +void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x) +{ + CHAR b[8]; + Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(8)), ((LONGINT)(8))); + Files_FlipBytes((void*)b, ((LONGINT)(8)), (void*)&*x, ((LONGINT)(8))); +} + +void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) +{ + INTEGER i; + CHAR ch; + i = 0; + do { + Files_Read(&*R, R__typ, (void*)&ch); + x[i] = ch; + i += 1; + } while (!(ch == 0x00)); +} + +void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) +{ + INTEGER i; + CHAR ch; + BOOLEAN b; + i = 0; + b = 0; + do { + Files_Read(&*R, R__typ, (void*)&ch); + if ((ch == 0x00 || ch == 0x0a) || ch == 0x0d) { + b = 1; + } else { + x[i] = ch; + i += 1; + } + } while (!b); +} + +void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, LONGINT *x) +{ + SHORTINT s; + CHAR ch; + LONGINT n; + s = 0; + n = 0; + Files_Read(&*R, R__typ, (void*)&ch); + while ((int)ch >= 128) { + n += __ASH((LONGINT)((int)ch - 128), s); + s += 7; + Files_Read(&*R, R__typ, (void*)&ch); + } + n += __ASH((LONGINT)(__MASK((int)ch, -64) - __ASHL(__ASHR((int)ch, 6), 6)), s); + *x = n; +} + +void Files_WriteBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN x) +{ + Files_Write(&*R, R__typ, __VAL(CHAR, x)); +} + +void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, INTEGER x) +{ + CHAR b[2]; + b[0] = (CHAR)x; + b[1] = (CHAR)__ASHR(x, 8); + Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(2)), ((LONGINT)(2))); +} + +void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, LONGINT x) +{ + CHAR b[4]; + b[0] = (CHAR)x; + b[1] = (CHAR)__ASHR(x, 8); + b[2] = (CHAR)__ASHR(x, 16); + b[3] = (CHAR)__ASHR(x, 24); + Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); +} + +void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x) +{ + CHAR b[4]; + LONGINT i; + i = (LONGINT)x; + b[0] = (CHAR)i; + b[1] = (CHAR)__ASHR(i, 8); + b[2] = (CHAR)__ASHR(i, 16); + b[3] = (CHAR)__ASHR(i, 24); + Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); +} + +void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x) +{ + CHAR b[4]; + Files_FlipBytes((void*)&x, ((LONGINT)(4)), (void*)b, ((LONGINT)(4))); + Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); +} + +void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x) +{ + CHAR b[8]; + Files_FlipBytes((void*)&x, ((LONGINT)(8)), (void*)b, ((LONGINT)(8))); + Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(8)), ((LONGINT)(8))); +} + +void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) +{ + INTEGER i; + i = 0; + while (x[i] != 0x00) { + i += 1; + } + Files_WriteBytes(&*R, R__typ, (void*)x, x__len * ((LONGINT)(1)), i + 1); +} + +void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, LONGINT x) +{ + while (x < -64 || x > 63) { + Files_Write(&*R, R__typ, (CHAR)(__MASK(x, -128) + 128)); + x = __ASHR(x, 7); + } + Files_Write(&*R, R__typ, (CHAR)__MASK(x, -128)); +} + +void Files_GetName (Files_File f, CHAR *name, LONGINT name__len) +{ + __COPY(f->workName, name, name__len); +} + +static void Files_Finalize (SYSTEM_PTR o) +{ + Files_File f = NIL; + LONGINT res; + f = (Files_File)(uintptr_t)o; + if (f->fd >= 0) { + Files_fileTab[f->fd] = 0; + res = Platform_Close(f->fd); + f->fd = -1; + Heap_FileCount -= 1; + if (f->tempFile) { + res = Platform_Unlink((void*)f->workName, ((LONGINT)(101))); + } + } +} + +void Files_SetSearchPath (CHAR *path, LONGINT path__len) +{ + __DUP(path, path__len, CHAR); + if (Strings_Length(path, path__len) != 0) { + Files_SearchPath = __NEWARR(NIL, ((LONGINT)(1)), 1, 1, 1, (LONGINT)(Strings_Length(path, path__len) + 1)); + __COPY(path, Files_SearchPath->data, Files_SearchPath->len[0]); + } else { + Files_SearchPath = NIL; + } + __DEL(path); +} + +static void Files_Init (void) +{ + LONGINT i; + i = 0; + while (i < 256) { + Files_fileTab[i] = 0; + i += 1; + } + Files_tempno = -1; + Heap_FileCount = 0; + Files_SearchPath = NIL; + Files_HOME[0] = 0x00; + Platform_GetEnv((CHAR*)"HOME", (LONGINT)5, (void*)Files_HOME, ((LONGINT)(1024))); +} + +static void EnumPtrs(void (*P)(void*)) +{ + P(Files_SearchPath); +} + +__TDESC(Files_Handle, 1, 4) = {__TDFLDS("Handle", 248), {228, 232, 236, 240, -20}}; +__TDESC(Files_BufDesc, 1, 1) = {__TDFLDS("BufDesc", 4112), {0, -8}}; +__TDESC(Files_Rider, 1, 1) = {__TDFLDS("Rider", 20), {8, -8}}; + +export void *Files__init(void) +{ + __DEFMOD; + __MODULE_IMPORT(Configuration); + __MODULE_IMPORT(Console); + __MODULE_IMPORT(Heap); + __MODULE_IMPORT(Platform); + __MODULE_IMPORT(Strings); + __REGMOD("Files", EnumPtrs); + __INITYP(Files_Handle, Files_Handle, 0); + __INITYP(Files_BufDesc, Files_BufDesc, 0); + __INITYP(Files_Rider, Files_Rider, 0); +/* BEGIN */ + Files_Init(); + __ENDMOD; +} diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h new file mode 100644 index 00000000..002d2dc5 --- /dev/null +++ b/bootstrap/unix-44/Files.h @@ -0,0 +1,70 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin tspkaSfF */ + +#ifndef Files__h +#define Files__h + +#include "SYSTEM.h" + +typedef + struct Files_Handle *Files_File; + +typedef + struct Files_Handle { + char _prvt0[216]; + LONGINT fd; + char _prvt1[28]; + } Files_Handle; + +typedef + struct Files_Rider { + LONGINT res; + BOOLEAN eof; + char _prvt0[15]; + } Files_Rider; + + + +import LONGINT *Files_Handle__typ; +import LONGINT *Files_Rider__typ; + +import Files_File Files_Base (Files_Rider *r, LONGINT *r__typ); +import void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INTEGER *res); +import void Files_Close (Files_File f); +import void Files_Delete (CHAR *name, LONGINT name__len, INTEGER *res); +import void Files_GetDate (Files_File f, LONGINT *t, LONGINT *d); +import void Files_GetName (Files_File f, CHAR *name, LONGINT name__len); +import LONGINT Files_Length (Files_File f); +import Files_File Files_New (CHAR *name, LONGINT name__len); +import Files_File Files_Old (CHAR *name, LONGINT name__len); +import LONGINT Files_Pos (Files_Rider *r, LONGINT *r__typ); +import void Files_Purge (Files_File f); +import void Files_Read (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x); +import void Files_ReadBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN *x); +import void Files_ReadByte (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len); +import void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, LONGINT n); +import void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, INTEGER *x); +import void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, LONGINT *x); +import void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x); +import void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); +import void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, LONGINT *x); +import void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x); +import void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x); +import void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); +import void Files_Register (Files_File f); +import void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INTEGER *res); +import void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, LONGINT pos); +import void Files_SetSearchPath (CHAR *path, LONGINT path__len); +import void Files_Write (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE x); +import void Files_WriteBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN x); +import void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, LONGINT n); +import void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, INTEGER x); +import void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, LONGINT x); +import void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x); +import void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, LONGINT x); +import void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x); +import void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x); +import void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); +import void *Files__init(void); + + +#endif diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c new file mode 100644 index 00000000..cbb21626 --- /dev/null +++ b/bootstrap/unix-44/Heap.c @@ -0,0 +1,752 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin tskSfF */ +#include "SYSTEM.h" + +struct Heap__1 { + CHAR ch; + SYSTEM_PTR p; +}; + +typedef + struct Heap_CmdDesc *Heap_Cmd; + +typedef + CHAR Heap_CmdName[24]; + +typedef + void (*Heap_Command)(void); + +typedef + struct Heap_CmdDesc { + Heap_Cmd next; + Heap_CmdName name; + Heap_Command cmd; + } Heap_CmdDesc; + +typedef + void (*Heap_EnumProc)(void(*)(SYSTEM_PTR)); + +typedef + struct Heap_FinDesc *Heap_FinNode; + +typedef + void (*Heap_Finalizer)(SYSTEM_PTR); + +typedef + struct Heap_FinDesc { + Heap_FinNode next; + LONGINT obj; + BOOLEAN marked; + Heap_Finalizer finalize; + } Heap_FinDesc; + +typedef + struct Heap_ModuleDesc *Heap_Module; + +typedef + CHAR Heap_ModuleName[20]; + +typedef + struct Heap_ModuleDesc { + Heap_Module next; + Heap_ModuleName name; + LONGINT refcnt; + Heap_Cmd cmds; + LONGINT types; + Heap_EnumProc enumPtrs; + LONGINT reserved1, reserved2; + } Heap_ModuleDesc; + + +export SYSTEM_PTR Heap_modules; +static LONGINT Heap_freeList[10]; +static LONGINT Heap_bigBlocks; +export LONGINT Heap_allocated; +static BOOLEAN Heap_firstTry; +static LONGINT Heap_heap, Heap_heapend; +export LONGINT Heap_heapsize; +static Heap_FinNode Heap_fin; +static INTEGER Heap_lockdepth; +static BOOLEAN Heap_interrupted; +export INTEGER Heap_FileCount; + +export LONGINT *Heap_ModuleDesc__typ; +export LONGINT *Heap_CmdDesc__typ; +export LONGINT *Heap_FinDesc__typ; +export LONGINT *Heap__1__typ; + +static void Heap_CheckFin (void); +static void Heap_ExtendHeap (LONGINT blksz); +export void Heap_FINALL (void); +static void Heap_Finalize (void); +export void Heap_GC (BOOLEAN markStack); +static void Heap_HeapSort (LONGINT n, LONGINT *a, LONGINT a__len); +export void Heap_INCREF (Heap_Module m); +export void Heap_InitHeap (void); +export void Heap_Lock (void); +static void Heap_Mark (LONGINT q); +static void Heap_MarkCandidates (LONGINT n, LONGINT *cand, LONGINT cand__len); +static void Heap_MarkP (SYSTEM_PTR p); +static void Heap_MarkStack (LONGINT n, LONGINT *cand, LONGINT cand__len); +export SYSTEM_PTR Heap_NEWBLK (LONGINT size); +export SYSTEM_PTR Heap_NEWREC (LONGINT tag); +static LONGINT Heap_NewChunk (LONGINT blksz); +export void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); +export SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); +export void Heap_REGTYP (Heap_Module m, LONGINT typ); +export void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); +static void Heap_Scan (void); +static void Heap_Sift (LONGINT l, LONGINT r, LONGINT *a, LONGINT a__len); +export void Heap_Unlock (void); + +extern void *Heap__init(); +extern LONGINT Platform_MainStackFrame; +extern LONGINT Platform_OSAllocate(LONGINT size); +#define Heap_FetchAddress(pointer) (LONGINT)(uintptr_t)(*((void**)((uintptr_t)pointer))) +#define Heap_HeapModuleInit() Heap__init() +#define Heap_OSAllocate(size) Platform_OSAllocate(size) +#define Heap_PlatformHalt(code) Platform_Halt(code) +#define Heap_PlatformMainStackFrame() Platform_MainStackFrame + +void Heap_Lock (void) +{ + Heap_lockdepth += 1; +} + +void Heap_Unlock (void) +{ + Heap_lockdepth -= 1; + if ((Heap_interrupted && Heap_lockdepth == 0)) { + Heap_PlatformHalt(((LONGINT)(-9))); + } +} + +SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) +{ + SYSTEM_PTR _o_result; + Heap_Module m; + if (__STRCMP(name, "Heap") == 0) { + __SYSNEW(m, 48); + } else { + __NEW(m, Heap_ModuleDesc); + } + m->types = 0; + m->cmds = NIL; + __COPY(name, m->name, ((LONGINT)(20))); + m->refcnt = 0; + m->enumPtrs = enumPtrs; + m->next = (Heap_Module)(uintptr_t)Heap_modules; + Heap_modules = (SYSTEM_PTR)m; + _o_result = (void*)m; + return _o_result; +} + +void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) +{ + Heap_Cmd c; + if (__STRCMP(m->name, "Heap") == 0) { + __SYSNEW(c, 32); + } else { + __NEW(c, Heap_CmdDesc); + } + __COPY(name, c->name, ((LONGINT)(24))); + c->cmd = cmd; + c->next = m->cmds; + m->cmds = c; +} + +void Heap_REGTYP (Heap_Module m, LONGINT typ) +{ + __PUT(typ, m->types, LONGINT); + m->types = typ; +} + +void Heap_INCREF (Heap_Module m) +{ + m->refcnt += 1; +} + +static LONGINT Heap_NewChunk (LONGINT blksz) +{ + LONGINT _o_result; + LONGINT chnk; + chnk = Heap_OSAllocate(blksz + 12); + if (chnk != 0) { + __PUT(chnk + 4, chnk + (12 + blksz), LONGINT); + __PUT(chnk + 12, chnk + 16, LONGINT); + __PUT(chnk + 16, blksz, LONGINT); + __PUT(chnk + 20, -4, LONGINT); + __PUT(chnk + 24, Heap_bigBlocks, LONGINT); + Heap_bigBlocks = chnk + 12; + Heap_heapsize += blksz; + } + _o_result = chnk; + return _o_result; +} + +static void Heap_ExtendHeap (LONGINT blksz) +{ + LONGINT size, chnk, j, next; + if (blksz > 160000) { + size = blksz; + } else { + size = 160000; + } + chnk = Heap_NewChunk(size); + if (chnk != 0) { + if (chnk < Heap_heap) { + __PUT(chnk, Heap_heap, LONGINT); + Heap_heap = chnk; + } else { + j = Heap_heap; + next = Heap_FetchAddress(j); + while ((next != 0 && chnk > next)) { + j = next; + next = Heap_FetchAddress(j); + } + __PUT(chnk, next, LONGINT); + __PUT(j, chnk, LONGINT); + } + if (next == 0) { + Heap_heapend = Heap_FetchAddress(chnk + 4); + } + } +} + +SYSTEM_PTR Heap_NEWREC (LONGINT tag) +{ + SYSTEM_PTR _o_result; + LONGINT i, i0, di, blksz, restsize, t, adr, end, next, prev; + SYSTEM_PTR new; + Heap_Lock(); + blksz = Heap_FetchAddress(tag); + i0 = __ASHR(blksz, 4); + i = i0; + if (i < 9) { + adr = Heap_freeList[i]; + while (adr == 0) { + i += 1; + adr = Heap_freeList[i]; + } + } + if (i < 9) { + next = Heap_FetchAddress(adr + 12); + Heap_freeList[i] = next; + if (i != i0) { + di = i - i0; + restsize = __ASHL(di, 4); + end = adr + restsize; + __PUT(end + 4, blksz, LONGINT); + __PUT(end + 8, -4, LONGINT); + __PUT(end, end + 4, LONGINT); + __PUT(adr + 4, restsize, LONGINT); + __PUT(adr + 12, Heap_freeList[di], LONGINT); + Heap_freeList[di] = adr; + adr += restsize; + } + } else { + adr = Heap_bigBlocks; + prev = 0; + for (;;) { + if (adr == 0) { + if (Heap_firstTry) { + Heap_GC(1); + blksz += 16; + if (__ASHL((Heap_heapsize - Heap_allocated) - blksz, 2) < Heap_heapsize) { + Heap_ExtendHeap(__ASHL(__DIV(Heap_allocated + blksz, 48), 6) - Heap_heapsize); + } + Heap_firstTry = 0; + new = Heap_NEWREC(tag); + Heap_firstTry = 1; + if (new == NIL) { + Heap_ExtendHeap(__ASHL(__DIV(Heap_allocated + blksz, 48), 6) - Heap_heapsize); + new = Heap_NEWREC(tag); + } + Heap_Unlock(); + _o_result = new; + return _o_result; + } else { + Heap_Unlock(); + _o_result = NIL; + return _o_result; + } + } + t = Heap_FetchAddress(adr + 4); + if (t >= blksz) { + break; + } + prev = adr; + adr = Heap_FetchAddress(adr + 12); + } + restsize = t - blksz; + end = adr + restsize; + __PUT(end + 4, blksz, LONGINT); + __PUT(end + 8, -4, LONGINT); + __PUT(end, end + 4, LONGINT); + if (restsize > 144) { + __PUT(adr + 4, restsize, LONGINT); + } else { + next = Heap_FetchAddress(adr + 12); + if (prev == 0) { + Heap_bigBlocks = next; + } else { + __PUT(prev + 12, next, LONGINT); + } + if (restsize > 0) { + di = __ASHR(restsize, 4); + __PUT(adr + 4, restsize, LONGINT); + __PUT(adr + 12, Heap_freeList[di], LONGINT); + Heap_freeList[di] = adr; + } + } + adr += restsize; + } + i = adr + 16; + end = adr + blksz; + while (i < end) { + __PUT(i, 0, LONGINT); + __PUT(i + 4, 0, LONGINT); + __PUT(i + 8, 0, LONGINT); + __PUT(i + 12, 0, LONGINT); + i += 16; + } + __PUT(adr + 12, 0, LONGINT); + __PUT(adr, tag, LONGINT); + __PUT(adr + 4, 0, LONGINT); + __PUT(adr + 8, 0, LONGINT); + Heap_allocated += blksz; + Heap_Unlock(); + _o_result = (SYSTEM_PTR)(uintptr_t)(adr + 4); + return _o_result; +} + +SYSTEM_PTR Heap_NEWBLK (LONGINT size) +{ + SYSTEM_PTR _o_result; + LONGINT blksz, tag; + SYSTEM_PTR new; + Heap_Lock(); + blksz = __ASHL(__ASHR(size + 31, 4), 4); + new = Heap_NEWREC((LONGINT)(uintptr_t)&blksz); + tag = ((LONGINT)(uintptr_t)new + blksz) - 12; + __PUT(tag - 4, 0, LONGINT); + __PUT(tag, blksz, LONGINT); + __PUT(tag + 4, -4, LONGINT); + __PUT((LONGINT)(uintptr_t)new - 4, tag, LONGINT); + Heap_Unlock(); + _o_result = new; + return _o_result; +} + +static void Heap_Mark (LONGINT q) +{ + LONGINT p, tag, fld, n, offset, tagbits; + if (q != 0) { + tagbits = Heap_FetchAddress(q - 4); + if (!__ODD(tagbits)) { + __PUT(q - 4, tagbits + 1, LONGINT); + p = 0; + tag = tagbits + 4; + for (;;) { + __GET(tag, offset, LONGINT); + if (offset < 0) { + __PUT(q - 4, (tag + offset) + 1, LONGINT); + if (p == 0) { + break; + } + n = q; + q = p; + tag = Heap_FetchAddress(q - 4); + tag -= 1; + __GET(tag, offset, LONGINT); + fld = q + offset; + p = Heap_FetchAddress(fld); + __PUT(fld, (SYSTEM_PTR)(uintptr_t)n, SYSTEM_PTR); + } else { + fld = q + offset; + n = Heap_FetchAddress(fld); + if (n != 0) { + tagbits = Heap_FetchAddress(n - 4); + if (!__ODD(tagbits)) { + __PUT(n - 4, tagbits + 1, LONGINT); + __PUT(q - 4, tag + 1, LONGINT); + __PUT(fld, (SYSTEM_PTR)(uintptr_t)p, SYSTEM_PTR); + p = q; + q = n; + tag = tagbits; + } + } + } + tag += 4; + } + } + } +} + +static void Heap_MarkP (SYSTEM_PTR p) +{ + Heap_Mark((LONGINT)(uintptr_t)p); +} + +static void Heap_Scan (void) +{ + LONGINT chnk, adr, end, start, tag, i, size, freesize; + Heap_bigBlocks = 0; + i = 1; + while (i < 9) { + Heap_freeList[i] = 0; + i += 1; + } + freesize = 0; + Heap_allocated = 0; + chnk = Heap_heap; + while (chnk != 0) { + adr = chnk + 12; + end = Heap_FetchAddress(chnk + 4); + while (adr < end) { + tag = Heap_FetchAddress(adr); + if (__ODD(tag)) { + if (freesize > 0) { + start = adr - freesize; + __PUT(start, start + 4, LONGINT); + __PUT(start + 4, freesize, LONGINT); + __PUT(start + 8, -4, LONGINT); + i = __ASHR(freesize, 4); + freesize = 0; + if (i < 9) { + __PUT(start + 12, Heap_freeList[i], LONGINT); + Heap_freeList[i] = start; + } else { + __PUT(start + 12, Heap_bigBlocks, LONGINT); + Heap_bigBlocks = start; + } + } + tag -= 1; + __PUT(adr, tag, LONGINT); + size = Heap_FetchAddress(tag); + Heap_allocated += size; + adr += size; + } else { + size = Heap_FetchAddress(tag); + freesize += size; + adr += size; + } + } + if (freesize > 0) { + start = adr - freesize; + __PUT(start, start + 4, LONGINT); + __PUT(start + 4, freesize, LONGINT); + __PUT(start + 8, -4, LONGINT); + i = __ASHR(freesize, 4); + freesize = 0; + if (i < 9) { + __PUT(start + 12, Heap_freeList[i], LONGINT); + Heap_freeList[i] = start; + } else { + __PUT(start + 12, Heap_bigBlocks, LONGINT); + Heap_bigBlocks = start; + } + } + chnk = Heap_FetchAddress(chnk); + } +} + +static void Heap_Sift (LONGINT l, LONGINT r, LONGINT *a, LONGINT a__len) +{ + LONGINT i, j, x; + j = l; + x = a[j]; + for (;;) { + i = j; + j = __ASHL(j, 1) + 1; + if ((j < r && a[j] < a[j + 1])) { + j += 1; + } + if (j > r || a[j] <= x) { + break; + } + a[i] = a[j]; + } + a[i] = x; +} + +static void Heap_HeapSort (LONGINT n, LONGINT *a, LONGINT a__len) +{ + LONGINT l, r, x; + l = __ASHR(n, 1); + r = n - 1; + while (l > 0) { + l -= 1; + Heap_Sift(l, r, (void*)a, a__len); + } + while (r > 0) { + x = a[0]; + a[0] = a[r]; + a[r] = x; + r -= 1; + Heap_Sift(l, r, (void*)a, a__len); + } +} + +static void Heap_MarkCandidates (LONGINT n, LONGINT *cand, LONGINT cand__len) +{ + LONGINT chnk, adr, tag, next, lim, lim1, i, ptr, size; + chnk = Heap_heap; + i = 0; + lim = cand[n - 1]; + while ((chnk != 0 && chnk < lim)) { + adr = chnk + 12; + lim1 = Heap_FetchAddress(chnk + 4); + if (lim < lim1) { + lim1 = lim; + } + while (adr < lim1) { + tag = Heap_FetchAddress(adr); + if (__ODD(tag)) { + size = Heap_FetchAddress(tag - 1); + adr += size; + } else { + size = Heap_FetchAddress(tag); + ptr = adr + 4; + while (cand[i] < ptr) { + i += 1; + } + if (i == n) { + return; + } + next = adr + size; + if (cand[i] < next) { + Heap_Mark(ptr); + } + adr = next; + } + } + chnk = Heap_FetchAddress(chnk); + } +} + +static void Heap_CheckFin (void) +{ + Heap_FinNode n; + LONGINT tag; + n = Heap_fin; + while (n != NIL) { + tag = Heap_FetchAddress(n->obj - 4); + if (!__ODD(tag)) { + n->marked = 0; + Heap_Mark(n->obj); + } else { + n->marked = 1; + } + n = n->next; + } +} + +static void Heap_Finalize (void) +{ + Heap_FinNode n, prev; + n = Heap_fin; + prev = NIL; + while (n != NIL) { + if (!n->marked) { + if (n == Heap_fin) { + Heap_fin = Heap_fin->next; + } else { + prev->next = n->next; + } + (*n->finalize)((SYSTEM_PTR)(uintptr_t)n->obj); + if (prev == NIL) { + n = Heap_fin; + } else { + n = n->next; + } + } else { + prev = n; + n = n->next; + } + } +} + +void Heap_FINALL (void) +{ + Heap_FinNode n; + while (Heap_fin != NIL) { + n = Heap_fin; + Heap_fin = Heap_fin->next; + (*n->finalize)((SYSTEM_PTR)(uintptr_t)n->obj); + } +} + +static void Heap_MarkStack (LONGINT n, LONGINT *cand, LONGINT cand__len) +{ + SYSTEM_PTR frame; + LONGINT inc, nofcand, sp, p, stack0, ptr; + struct Heap__1 align; + if (n > 0) { + Heap_MarkStack(n - 1, cand, cand__len); + if (n > 100) { + return; + } + } + if (n == 0) { + nofcand = 0; + sp = (LONGINT)(uintptr_t)&frame; + stack0 = Heap_PlatformMainStackFrame(); + inc = (LONGINT)(uintptr_t)&align.p - (LONGINT)(uintptr_t)&align; + if (sp > stack0) { + inc = -inc; + } + while (sp != stack0) { + __GET(sp, p, LONGINT); + if ((p > Heap_heap && p < Heap_heapend)) { + if (nofcand == cand__len) { + Heap_HeapSort(nofcand, (void*)cand, cand__len); + Heap_MarkCandidates(nofcand, (void*)cand, cand__len); + nofcand = 0; + } + cand[nofcand] = p; + nofcand += 1; + } + sp += inc; + } + if (nofcand > 0) { + Heap_HeapSort(nofcand, (void*)cand, cand__len); + Heap_MarkCandidates(nofcand, (void*)cand, cand__len); + } + } +} + +void Heap_GC (BOOLEAN markStack) +{ + Heap_Module m; + LONGINT i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; + LONGINT cand[10000]; + if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { + Heap_Lock(); + m = (Heap_Module)(uintptr_t)Heap_modules; + while (m != NIL) { + if (m->enumPtrs != NIL) { + (*m->enumPtrs)(Heap_MarkP); + } + m = m->next; + } + if (markStack) { + i0 = -100; + i1 = -101; + i2 = -102; + i3 = -103; + i4 = -104; + i5 = -105; + i6 = -106; + i7 = -107; + i8 = 1; + i9 = 2; + i10 = 3; + i11 = 4; + i12 = 5; + i13 = 6; + i14 = 7; + i15 = 8; + i16 = 9; + i17 = 10; + i18 = 11; + i19 = 12; + i20 = 13; + i21 = 14; + i22 = 15; + i23 = 16; + for (;;) { + i0 += 1; + i1 += 2; + i2 += 3; + i3 += 4; + i4 += 5; + i5 += 6; + i6 += 7; + i7 += 8; + i8 += 9; + i9 += 10; + i10 += 11; + i11 += 12; + i12 += 13; + i13 += 14; + i14 += 15; + i15 += 16; + i16 += 17; + i17 += 18; + i18 += 19; + i19 += 20; + i20 += 21; + i21 += 22; + i22 += 23; + i23 += 24; + if ((i0 == -99 && i15 == 24)) { + Heap_MarkStack(((LONGINT)(32)), (void*)cand, ((LONGINT)(10000))); + break; + } + } + if (((((((((((((((((((((((i0 + i1) + i2) + i3) + i4) + i5) + i6) + i7) + i8) + i9) + i10) + i11) + i12) + i13) + i14) + i15) + i16) + i17) + i18) + i19) + i20) + i21) + i22) + i23 > 10000) { + return; + } + } + Heap_CheckFin(); + Heap_Scan(); + Heap_Finalize(); + Heap_Unlock(); + } +} + +void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) +{ + Heap_FinNode f; + __NEW(f, Heap_FinDesc); + f->obj = (LONGINT)(uintptr_t)obj; + f->finalize = finalize; + f->marked = 1; + f->next = Heap_fin; + Heap_fin = f; +} + +void Heap_InitHeap (void) +{ + Heap_heap = Heap_NewChunk(128000); + Heap_heapend = Heap_FetchAddress(Heap_heap + 4); + __PUT(Heap_heap, 0, LONGINT); + Heap_allocated = 0; + Heap_firstTry = 1; + Heap_freeList[9] = 1; + Heap_lockdepth = 0; + Heap_FileCount = 0; + Heap_modules = NIL; + Heap_heapsize = 0; + Heap_bigBlocks = 0; + Heap_fin = NIL; + Heap_interrupted = 0; + Heap_HeapModuleInit(); +} + +static void EnumPtrs(void (*P)(void*)) +{ + P(Heap_modules); + P(Heap_fin); +} + +__TDESC(Heap_ModuleDesc, 1, 2) = {__TDFLDS("ModuleDesc", 48), {0, 28, -12}}; +__TDESC(Heap_CmdDesc, 1, 1) = {__TDFLDS("CmdDesc", 32), {0, -8}}; +__TDESC(Heap_FinDesc, 1, 1) = {__TDFLDS("FinDesc", 16), {0, -8}}; +__TDESC(Heap__1, 1, 1) = {__TDFLDS("", 8), {4, -8}}; + +export void *Heap__init(void) +{ + __DEFMOD; + __REGMOD("Heap", EnumPtrs); + __REGCMD("FINALL", Heap_FINALL); + __REGCMD("InitHeap", Heap_InitHeap); + __REGCMD("Lock", Heap_Lock); + __REGCMD("Unlock", Heap_Unlock); + __INITYP(Heap_ModuleDesc, Heap_ModuleDesc, 0); + __INITYP(Heap_CmdDesc, Heap_CmdDesc, 0); + __INITYP(Heap_FinDesc, Heap_FinDesc, 0); + __INITYP(Heap__1, Heap__1, 0); +/* BEGIN */ + __ENDMOD; +} diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h new file mode 100644 index 00000000..d270a455 --- /dev/null +++ b/bootstrap/unix-44/Heap.h @@ -0,0 +1,54 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin tskSfF */ + +#ifndef Heap__h +#define Heap__h + +#include "SYSTEM.h" + +typedef + CHAR Heap_CmdName[24]; + +typedef + void (*Heap_Command)(void); + +typedef + void (*Heap_EnumProc)(void(*)(SYSTEM_PTR)); + +typedef + void (*Heap_Finalizer)(SYSTEM_PTR); + +typedef + struct Heap_ModuleDesc *Heap_Module; + +typedef + struct Heap_ModuleDesc { + LONGINT _prvt0; + char _prvt1[44]; + } Heap_ModuleDesc; + +typedef + CHAR Heap_ModuleName[20]; + + +import SYSTEM_PTR Heap_modules; +import LONGINT Heap_allocated, Heap_heapsize; +import INTEGER Heap_FileCount; + +import LONGINT *Heap_ModuleDesc__typ; + +import void Heap_FINALL (void); +import void Heap_GC (BOOLEAN markStack); +import void Heap_INCREF (Heap_Module m); +import void Heap_InitHeap (void); +import void Heap_Lock (void); +import SYSTEM_PTR Heap_NEWBLK (LONGINT size); +import SYSTEM_PTR Heap_NEWREC (LONGINT tag); +import void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); +import SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); +import void Heap_REGTYP (Heap_Module m, LONGINT typ); +import void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); +import void Heap_Unlock (void); +import void *Heap__init(void); + + +#endif diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c new file mode 100644 index 00000000..6c0f5e0b --- /dev/null +++ b/bootstrap/unix-44/Modules.c @@ -0,0 +1,171 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +#include "SYSTEM.h" +#include "Console.h" +#include "Heap.h" + +typedef + struct Modules_CmdDesc *Modules_Cmd; + +typedef + void (*Modules_Command)(void); + +typedef + struct Modules_CmdDesc { + Modules_Cmd next; + CHAR name[24]; + Modules_Command cmd; + } Modules_CmdDesc; + +typedef + struct Modules_ModuleDesc *Modules_Module; + +typedef + CHAR Modules_ModuleName[20]; + +typedef + struct Modules_ModuleDesc { + Modules_Module next; + Modules_ModuleName name; + LONGINT refcnt; + Modules_Cmd cmds; + LONGINT types; + void (*enumPtrs)(void(*)(LONGINT)); + LONGINT reserved1, reserved2; + } Modules_ModuleDesc; + + +export INTEGER Modules_res; +export CHAR Modules_resMsg[256]; +export Modules_ModuleName Modules_imported, Modules_importing; + +export LONGINT *Modules_ModuleDesc__typ; +export LONGINT *Modules_CmdDesc__typ; + +static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len); +export void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all); +export Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len); +export Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len); + +#define Modules_modules() (Modules_Module)Heap_modules +#define Modules_setmodules(m) Heap_modules = m + +static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len) +{ + INTEGER i, j; + __DUP(b, b__len, CHAR); + i = 0; + while (a[__X(i, a__len)] != 0x00) { + i += 1; + } + j = 0; + while (b[__X(j, b__len)] != 0x00) { + a[__X(i, a__len)] = b[__X(j, b__len)]; + i += 1; + j += 1; + } + a[__X(i, a__len)] = 0x00; + __DEL(b); +} + +Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len) +{ + Modules_Module _o_result; + Modules_Module m = NIL; + CHAR bodyname[64]; + Modules_Command body; + __DUP(name, name__len, CHAR); + m = Modules_modules(); + while ((m != NIL && __STRCMP(m->name, name) != 0)) { + m = m->next; + } + if (m != NIL) { + Modules_res = 0; + Modules_resMsg[0] = 0x00; + } else { + Modules_res = 1; + __COPY(name, Modules_importing, ((LONGINT)(20))); + __MOVE(" module \"", Modules_resMsg, 10); + Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), name, name__len); + Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), (CHAR*)"\" not found", (LONGINT)12); + } + _o_result = m; + __DEL(name); + return _o_result; +} + +Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len) +{ + Modules_Command _o_result; + Modules_Cmd c = NIL; + __DUP(name, name__len, CHAR); + c = mod->cmds; + while ((c != NIL && __STRCMP(c->name, name) != 0)) { + c = c->next; + } + if (c != NIL) { + Modules_res = 0; + Modules_resMsg[0] = 0x00; + _o_result = c->cmd; + __DEL(name); + return _o_result; + } else { + Modules_res = 2; + __MOVE(" command \"", Modules_resMsg, 11); + __COPY(name, Modules_importing, ((LONGINT)(20))); + Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), mod->name, ((LONGINT)(20))); + Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), (CHAR*)".", (LONGINT)2); + Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), name, name__len); + Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), (CHAR*)"\" not found", (LONGINT)12); + _o_result = NIL; + __DEL(name); + return _o_result; + } + __RETCHK; +} + +void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all) +{ + Modules_Module m = NIL, p = NIL; + __DUP(name, name__len, CHAR); + m = Modules_modules(); + if (all) { + Modules_res = 1; + __MOVE("unloading \"all\" not yet supported", Modules_resMsg, 34); + } else { + while ((m != NIL && __STRCMP(m->name, name) != 0)) { + p = m; + m = m->next; + } + if ((m != NIL && m->refcnt == 0)) { + if (m == Modules_modules()) { + Modules_setmodules(m->next); + } else { + p->next = m->next; + } + Modules_res = 0; + } else { + Modules_res = 1; + if (m == NIL) { + __MOVE("module not found", Modules_resMsg, 17); + } else { + __MOVE("clients of this module exist", Modules_resMsg, 29); + } + } + } + __DEL(name); +} + +__TDESC(Modules_ModuleDesc, 1, 2) = {__TDFLDS("ModuleDesc", 48), {0, 28, -12}}; +__TDESC(Modules_CmdDesc, 1, 1) = {__TDFLDS("CmdDesc", 32), {0, -8}}; + +export void *Modules__init(void) +{ + __DEFMOD; + __MODULE_IMPORT(Console); + __MODULE_IMPORT(Heap); + __REGMOD("Modules", 0); + __INITYP(Modules_ModuleDesc, Modules_ModuleDesc, 0); + __INITYP(Modules_CmdDesc, Modules_CmdDesc, 0); +/* BEGIN */ + __ENDMOD; +} diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h new file mode 100644 index 00000000..5968d1aa --- /dev/null +++ b/bootstrap/unix-44/Modules.h @@ -0,0 +1,54 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ + +#ifndef Modules__h +#define Modules__h + +#include "SYSTEM.h" + +typedef + struct Modules_CmdDesc *Modules_Cmd; + +typedef + void (*Modules_Command)(void); + +typedef + struct Modules_CmdDesc { + Modules_Cmd next; + CHAR name[24]; + Modules_Command cmd; + } Modules_CmdDesc; + +typedef + struct Modules_ModuleDesc *Modules_Module; + +typedef + CHAR Modules_ModuleName[20]; + +typedef + struct Modules_ModuleDesc { + Modules_Module next; + Modules_ModuleName name; + LONGINT refcnt; + Modules_Cmd cmds; + LONGINT types; + void (*enumPtrs)(void(*)(LONGINT)); + char _prvt0[8]; + } Modules_ModuleDesc; + + +import INTEGER Modules_res; +import CHAR Modules_resMsg[256]; +import Modules_ModuleName Modules_imported, Modules_importing; + +import LONGINT *Modules_ModuleDesc__typ; +import LONGINT *Modules_CmdDesc__typ; + +import void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all); +import Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len); +import Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len); +import void *Modules__init(void); + +#define Modules_modules() (Modules_Module)Heap_modules +#define Modules_setmodules(m) Heap_modules = m + +#endif diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c new file mode 100644 index 00000000..0c22a7a7 --- /dev/null +++ b/bootstrap/unix-44/OPB.c @@ -0,0 +1,2677 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +#include "SYSTEM.h" +#include "OPM.h" +#include "OPS.h" +#include "OPT.h" + + +export void (*OPB_typSize)(OPT_Struct); +static INTEGER OPB_exp; +static LONGINT OPB_maxExp; + + +export void OPB_Assign (OPT_Node *x, OPT_Node y); +static void OPB_BindNodes (SHORTINT class, OPT_Struct typ, OPT_Node *x, OPT_Node y); +static LONGINT OPB_BoolToInt (BOOLEAN b); +export void OPB_Call (OPT_Node *x, OPT_Node apar, OPT_Object fp); +static void OPB_CharToString (OPT_Node n); +static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode); +static void OPB_CheckLeaf (OPT_Node x, BOOLEAN dynArrToo); +export void OPB_CheckParameters (OPT_Object fp, OPT_Object ap, BOOLEAN checkNames); +static void OPB_CheckProc (OPT_Struct x, OPT_Object y); +static void OPB_CheckPtr (OPT_Node x, OPT_Node y); +static void OPB_CheckRealType (INTEGER f, INTEGER nr, OPT_Const x); +static void OPB_CheckReceiver (OPT_Node *x, OPT_Object fp); +static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y); +export void OPB_Construct (SHORTINT class, OPT_Node *x, OPT_Node y); +static void OPB_Convert (OPT_Node *x, OPT_Struct typ); +export void OPB_DeRef (OPT_Node *x); +static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpar); +export OPT_Node OPB_EmptySet (void); +export void OPB_Enter (OPT_Node *procdec, OPT_Node stat, OPT_Object proc); +export void OPB_Field (OPT_Node *x, OPT_Object y); +export void OPB_In (OPT_Node *x, OPT_Node y); +export void OPB_Index (OPT_Node *x, OPT_Node y); +export void OPB_Inittd (OPT_Node *inittd, OPT_Node *last, OPT_Struct typ); +static BOOLEAN OPB_IntToBool (LONGINT i); +export void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y); +export void OPB_MOp (SHORTINT op, OPT_Node *x); +export OPT_Node OPB_NewBoolConst (BOOLEAN boolval); +export OPT_Node OPB_NewIntConst (LONGINT intval); +export OPT_Node OPB_NewLeaf (OPT_Object obj); +export OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ); +export OPT_Node OPB_NewString (OPS_String str, LONGINT len); +export OPT_Node OPB_Nil (void); +static BOOLEAN OPB_NotVar (OPT_Node x); +export void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y); +export void OPB_OptIf (OPT_Node *x); +export void OPB_Param (OPT_Node ap, OPT_Object fp); +export void OPB_PrepCall (OPT_Node *x, OPT_Object *fpar); +export void OPB_Return (OPT_Node *x, OPT_Object proc); +export void OPB_SetElem (OPT_Node *x); +static void OPB_SetIntType (OPT_Node node); +export void OPB_SetRange (OPT_Node *x, OPT_Node y); +export void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno); +export void OPB_StPar0 (OPT_Node *par0, INTEGER fctno); +export void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno); +export void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n); +export void OPB_StaticLink (SHORTINT dlev); +export void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard); +static void OPB_err (INTEGER n); +static LONGINT OPB_log (LONGINT x); + + +static void OPB_err (INTEGER n) +{ + OPM_err(n); +} + +OPT_Node OPB_NewLeaf (OPT_Object obj) +{ + OPT_Node _o_result; + OPT_Node node = NIL; + switch (obj->mode) { + case 1: + node = OPT_NewNode(0); + node->readonly = (obj->vis == 2 && obj->mnolev < 0); + break; + case 2: + node = OPT_NewNode(1); + break; + case 3: + node = OPT_NewNode(7); + node->conval = OPT_NewConst(); + __GUARDEQP(node->conval, OPT_ConstDesc) = *obj->conval; + break; + case 5: + node = OPT_NewNode(8); + break; + case 6: case 7: case 8: case 9: case 10: + node = OPT_NewNode(9); + break; + default: + OPB_err(127); + node = OPT_NewNode(0); + break; + } + node->obj = obj; + node->typ = obj->typ; + _o_result = node; + return _o_result; +} + +void OPB_Construct (SHORTINT class, OPT_Node *x, OPT_Node y) +{ + OPT_Node node = NIL; + node = OPT_NewNode(class); + node->typ = OPT_notyp; + node->left = *x; + node->right = y; + *x = node; +} + +void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y) +{ + if (*x == NIL) { + *x = y; + } else { + (*last)->link = y; + } + while (y->link != NIL) { + y = y->link; + } + *last = y; +} + +static LONGINT OPB_BoolToInt (BOOLEAN b) +{ + LONGINT _o_result; + if (b) { + _o_result = 1; + return _o_result; + } else { + _o_result = 0; + return _o_result; + } + __RETCHK; +} + +static BOOLEAN OPB_IntToBool (LONGINT i) +{ + BOOLEAN _o_result; + if (i == 0) { + _o_result = 0; + return _o_result; + } else { + _o_result = 1; + return _o_result; + } + __RETCHK; +} + +OPT_Node OPB_NewBoolConst (BOOLEAN boolval) +{ + OPT_Node _o_result; + OPT_Node x = NIL; + x = OPT_NewNode(7); + x->typ = OPT_booltyp; + x->conval = OPT_NewConst(); + x->conval->intval = OPB_BoolToInt(boolval); + _o_result = x; + return _o_result; +} + +void OPB_OptIf (OPT_Node *x) +{ + OPT_Node if_ = NIL, pred = NIL; + if_ = (*x)->left; + while (if_->left->class == 7) { + if (OPB_IntToBool(if_->left->conval->intval)) { + *x = if_->right; + return; + } else if (if_->link == NIL) { + *x = (*x)->right; + return; + } else { + if_ = if_->link; + (*x)->left = if_; + } + } + pred = if_; + if_ = if_->link; + while (if_ != NIL) { + if (if_->left->class == 7) { + if (OPB_IntToBool(if_->left->conval->intval)) { + pred->link = NIL; + (*x)->right = if_->right; + return; + } else { + if_ = if_->link; + pred->link = if_; + } + } else { + pred = if_; + if_ = if_->link; + } + } +} + +OPT_Node OPB_Nil (void) +{ + OPT_Node _o_result; + OPT_Node x = NIL; + x = OPT_NewNode(7); + x->typ = OPT_niltyp; + x->conval = OPT_NewConst(); + x->conval->intval = 0; + _o_result = x; + return _o_result; +} + +OPT_Node OPB_EmptySet (void) +{ + OPT_Node _o_result; + OPT_Node x = NIL; + x = OPT_NewNode(7); + x->typ = OPT_settyp; + x->conval = OPT_NewConst(); + x->conval->setval = 0x0; + _o_result = x; + return _o_result; +} + +static void OPB_SetIntType (OPT_Node node) +{ + LONGINT v; + v = node->conval->intval; + if ((OPM_MinSInt <= (LONGINT)v && (LONGINT)v <= OPM_MaxSInt)) { + node->typ = OPT_sinttyp; + } else if ((OPM_MinInt <= (LONGINT)v && (LONGINT)v <= OPM_MaxInt)) { + node->typ = OPT_inttyp; + } else if ((OPM_MinLInt <= v && v <= OPM_MaxLInt)) { + node->typ = OPT_linttyp; + } else { + OPB_err(203); + node->typ = OPT_sinttyp; + node->conval->intval = 1; + } +} + +OPT_Node OPB_NewIntConst (LONGINT intval) +{ + OPT_Node _o_result; + OPT_Node x = NIL; + x = OPT_NewNode(7); + x->conval = OPT_NewConst(); + x->conval->intval = intval; + OPB_SetIntType(x); + _o_result = x; + return _o_result; +} + +OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ) +{ + OPT_Node _o_result; + OPT_Node x = NIL; + x = OPT_NewNode(7); + x->conval = OPT_NewConst(); + x->conval->realval = realval; + x->typ = typ; + x->conval->intval = -1; + _o_result = x; + return _o_result; +} + +OPT_Node OPB_NewString (OPS_String str, LONGINT len) +{ + OPT_Node _o_result; + OPT_Node x = NIL; + x = OPT_NewNode(7); + x->conval = OPT_NewConst(); + x->typ = OPT_stringtyp; + x->conval->intval = -1; + x->conval->intval2 = len; + x->conval->ext = OPT_NewExt(); + __COPY(str, *x->conval->ext, ((LONGINT)(256))); + _o_result = x; + return _o_result; +} + +static void OPB_CharToString (OPT_Node n) +{ + CHAR ch; + n->typ = OPT_stringtyp; + ch = (CHAR)n->conval->intval; + n->conval->ext = OPT_NewExt(); + if (ch == 0x00) { + n->conval->intval2 = 1; + } else { + n->conval->intval2 = 2; + (*n->conval->ext)[1] = 0x00; + } + (*n->conval->ext)[0] = ch; + n->conval->intval = -1; + n->obj = NIL; +} + +static void OPB_BindNodes (SHORTINT class, OPT_Struct typ, OPT_Node *x, OPT_Node y) +{ + OPT_Node node = NIL; + node = OPT_NewNode(class); + node->typ = typ; + node->left = *x; + node->right = y; + *x = node; +} + +static BOOLEAN OPB_NotVar (OPT_Node x) +{ + BOOLEAN _o_result; + _o_result = (x->class >= 7 && ((x->class != 11 || x->subcl != 29) || x->left->class >= 7)); + return _o_result; +} + +void OPB_DeRef (OPT_Node *x) +{ + OPT_Object strobj = NIL, bstrobj = NIL; + OPT_Struct typ = NIL, btyp = NIL; + typ = (*x)->typ; + if ((*x)->class >= 7) { + OPB_err(78); + } else if (typ->form == 13) { + if (typ == OPT_sysptrtyp) { + OPB_err(57); + } + btyp = typ->BaseTyp; + strobj = typ->strobj; + bstrobj = btyp->strobj; + if ((((((strobj != NIL && strobj->name[0] != 0x00)) && bstrobj != NIL)) && bstrobj->name[0] != 0x00)) { + btyp->pbused = 1; + } + OPB_BindNodes(3, btyp, &*x, NIL); + } else { + OPB_err(84); + } +} + +void OPB_Index (OPT_Node *x, OPT_Node y) +{ + INTEGER f; + OPT_Struct typ = NIL; + f = y->typ->form; + if ((*x)->class >= 7) { + OPB_err(79); + } else if (!__IN(f, 0x70) || __IN(y->class, 0x0300)) { + OPB_err(80); + y->typ = OPT_inttyp; + } + if ((*x)->typ->comp == 2) { + typ = (*x)->typ->BaseTyp; + if ((y->class == 7 && (y->conval->intval < 0 || y->conval->intval >= (*x)->typ->n))) { + OPB_err(81); + } + } else if ((*x)->typ->comp == 3) { + typ = (*x)->typ->BaseTyp; + if ((y->class == 7 && y->conval->intval < 0)) { + OPB_err(81); + } + } else { + OPB_err(82); + typ = OPT_undftyp; + } + OPB_BindNodes(4, typ, &*x, y); + (*x)->readonly = (*x)->left->readonly; +} + +void OPB_Field (OPT_Node *x, OPT_Object y) +{ + if ((*x)->class >= 7) { + OPB_err(77); + } + if ((y != NIL && __IN(y->mode, 0x2010))) { + OPB_BindNodes(2, y->typ, &*x, NIL); + (*x)->obj = y; + (*x)->readonly = (*x)->left->readonly || (y->vis == 2 && y->mnolev < 0); + } else { + OPB_err(83); + (*x)->typ = OPT_undftyp; + } +} + +static struct TypTest__57 { + OPT_Node *x; + OPT_Object *obj; + BOOLEAN *guard; + struct TypTest__57 *lnk; +} *TypTest__57_s; + +static void GTT__58 (OPT_Struct t0, OPT_Struct t1); + +static void GTT__58 (OPT_Struct t0, OPT_Struct t1) +{ + OPT_Node node = NIL; + OPT_Struct t = NIL; + t = t0; + while ((((t != NIL && t != t1)) && t != OPT_undftyp)) { + t = t->BaseTyp; + } + if (t != t1) { + while ((((t1 != NIL && t1 != t0)) && t1 != OPT_undftyp)) { + t1 = t1->BaseTyp; + } + if (t1 == t0 || t0->form == 0) { + if (*TypTest__57_s->guard) { + OPB_BindNodes(5, NIL, &*TypTest__57_s->x, NIL); + (*TypTest__57_s->x)->readonly = (*TypTest__57_s->x)->left->readonly; + } else { + node = OPT_NewNode(11); + node->subcl = 16; + node->left = *TypTest__57_s->x; + node->obj = *TypTest__57_s->obj; + *TypTest__57_s->x = node; + } + } else { + OPB_err(85); + } + } else if (t0 != t1) { + OPB_err(85); + } else if (!*TypTest__57_s->guard) { + if ((*TypTest__57_s->x)->class == 5) { + node = OPT_NewNode(11); + node->subcl = 16; + node->left = *TypTest__57_s->x; + node->obj = *TypTest__57_s->obj; + *TypTest__57_s->x = node; + } else { + *TypTest__57_s->x = OPB_NewBoolConst(1); + } + } +} + +void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) +{ + struct TypTest__57 _s; + _s.x = x; + _s.obj = &obj; + _s.guard = &guard; + _s.lnk = TypTest__57_s; + TypTest__57_s = &_s; + if (OPB_NotVar(*x)) { + OPB_err(112); + } else if ((*x)->typ->form == 13) { + if (((*x)->typ->BaseTyp->comp != 4 && (*x)->typ != OPT_sysptrtyp)) { + OPB_err(85); + } else if (obj->typ->form == 13) { + GTT__58((*x)->typ->BaseTyp, obj->typ->BaseTyp); + } else { + OPB_err(86); + } + } else if (((((*x)->typ->comp == 4 && (*x)->class == 1)) && obj->typ->comp == 4)) { + GTT__58((*x)->typ, obj->typ); + } else { + OPB_err(87); + } + if (guard) { + (*x)->typ = obj->typ; + } else { + (*x)->typ = OPT_booltyp; + } + TypTest__57_s = _s.lnk; +} + +void OPB_In (OPT_Node *x, OPT_Node y) +{ + INTEGER f; + LONGINT k; + f = (*x)->typ->form; + if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { + OPB_err(126); + } else if ((__IN(f, 0x70) && y->typ->form == 9)) { + if ((*x)->class == 7) { + k = (*x)->conval->intval; + if (k < 0 || k > (LONGINT)OPM_MaxSet) { + OPB_err(202); + } else if (y->class == 7) { + (*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval)); + (*x)->obj = NIL; + } else { + OPB_BindNodes(12, OPT_booltyp, &*x, y); + (*x)->subcl = 15; + } + } else { + OPB_BindNodes(12, OPT_booltyp, &*x, y); + (*x)->subcl = 15; + } + } else { + OPB_err(92); + } + (*x)->typ = OPT_booltyp; +} + +static LONGINT OPB_log (LONGINT x) +{ + LONGINT _o_result; + OPB_exp = 0; + if (x > 0) { + while (!__ODD(x)) { + x = __ASHR(x, 1); + OPB_exp += 1; + } + } + _o_result = x; + return _o_result; +} + +static void OPB_CheckRealType (INTEGER f, INTEGER nr, OPT_Const x) +{ + LONGREAL min, max, r; + if (f == 7) { + min = OPM_MinReal; + max = OPM_MaxReal; + } else { + min = OPM_MinLReal; + max = OPM_MaxLReal; + } + r = __ABS(x->realval); + if (r > max || r < min) { + OPB_err(nr); + x->realval = (LONGREAL)1; + } else if (f == 7) { + x->realval = x->realval; + } + x->intval = -1; +} + +static struct MOp__28 { + struct MOp__28 *lnk; +} *MOp__28_s; + +static OPT_Node NewOp__29 (SHORTINT op, OPT_Struct typ, OPT_Node z); + +static OPT_Node NewOp__29 (SHORTINT op, OPT_Struct typ, OPT_Node z) +{ + OPT_Node _o_result; + OPT_Node node = NIL; + node = OPT_NewNode(11); + node->subcl = op; + node->typ = typ; + node->left = z; + _o_result = node; + return _o_result; +} + +void OPB_MOp (SHORTINT op, OPT_Node *x) +{ + INTEGER f; + OPT_Struct typ = NIL; + OPT_Node z = NIL; + struct MOp__28 _s; + _s.lnk = MOp__28_s; + MOp__28_s = &_s; + z = *x; + if (z->class == 8 || z->class == 9) { + OPB_err(126); + } else { + typ = z->typ; + f = typ->form; + switch (op) { + case 33: + if (f == 2) { + if (z->class == 7) { + z->conval->intval = OPB_BoolToInt(!OPB_IntToBool(z->conval->intval)); + z->obj = NIL; + } else { + z = NewOp__29(op, typ, z); + } + } else { + OPB_err(98); + } + break; + case 6: + if (!__IN(f, 0x01f0)) { + OPB_err(96); + } + break; + case 7: + if (__IN(f, 0x03f0)) { + if (z->class == 7) { + if (__IN(f, 0x70)) { + if (z->conval->intval == (-2147483647-1)) { + OPB_err(203); + } else { + z->conval->intval = -z->conval->intval; + OPB_SetIntType(z); + } + } else if (__IN(f, 0x0180)) { + z->conval->realval = -z->conval->realval; + } else { + z->conval->setval = ~z->conval->setval; + } + z->obj = NIL; + } else { + z = NewOp__29(op, typ, z); + } + } else { + OPB_err(97); + } + break; + case 21: + if (__IN(f, 0x01f0)) { + if (z->class == 7) { + if (__IN(f, 0x70)) { + if (z->conval->intval == (-2147483647-1)) { + OPB_err(203); + } else { + z->conval->intval = __ABS(z->conval->intval); + OPB_SetIntType(z); + } + } else { + z->conval->realval = __ABS(z->conval->realval); + } + z->obj = NIL; + } else { + z = NewOp__29(op, typ, z); + } + } else { + OPB_err(111); + } + break; + case 22: + if (f == 3) { + if (z->class == 7) { + z->conval->intval = (int)__CAP((CHAR)z->conval->intval); + z->obj = NIL; + } else { + z = NewOp__29(op, typ, z); + } + } else { + OPB_err(111); + z->typ = OPT_chartyp; + } + break; + case 23: + if (__IN(f, 0x70)) { + if (z->class == 7) { + z->conval->intval = OPB_BoolToInt(__ODD(z->conval->intval)); + z->obj = NIL; + } else { + z = NewOp__29(op, typ, z); + } + } else { + OPB_err(111); + } + z->typ = OPT_booltyp; + break; + case 24: + if ((((z->class == 7 && f == 3)) && z->conval->intval >= 32)) { + OPB_CharToString(z); + f = 10; + } + if (z->class < 7 || f == 10) { + z = NewOp__29(op, typ, z); + } else { + OPB_err(127); + } + z->typ = OPT_linttyp; + break; + case 25: + if ((__IN(f, 0x70) && z->class == 7)) { + if ((0 <= z->conval->intval && z->conval->intval <= -1)) { + z = NewOp__29(op, typ, z); + } else { + OPB_err(219); + } + } else { + OPB_err(69); + } + z->typ = OPT_booltyp; + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPB.MOp, op = ", (LONGINT)33); + OPM_LogWNum(op, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + } + *x = z; + MOp__28_s = _s.lnk; +} + +static void OPB_CheckPtr (OPT_Node x, OPT_Node y) +{ + INTEGER g; + OPT_Struct p = NIL, q = NIL, t = NIL; + g = y->typ->form; + if (g == 13) { + p = x->typ->BaseTyp; + q = y->typ->BaseTyp; + if ((p->comp == 4 && q->comp == 4)) { + if (p->extlev < q->extlev) { + t = p; + p = q; + q = t; + } + while ((((p != q && p != NIL)) && p != OPT_undftyp)) { + p = p->BaseTyp; + } + if (p == NIL) { + OPB_err(100); + } + } else { + OPB_err(100); + } + } else if (g != 11) { + OPB_err(100); + } +} + +void OPB_CheckParameters (OPT_Object fp, OPT_Object ap, BOOLEAN checkNames) +{ + OPT_Struct ft = NIL, at = NIL; + while (fp != NIL) { + if (ap != NIL) { + ft = fp->typ; + at = ap->typ; + while ((ft->comp == 3 && at->comp == 3)) { + ft = ft->BaseTyp; + at = at->BaseTyp; + } + if (ft != at) { + if ((ft->form == 14 && at->form == 14)) { + if (ft->BaseTyp == at->BaseTyp) { + OPB_CheckParameters(ft->link, at->link, 0); + } else { + OPB_err(117); + } + } else { + OPB_err(115); + } + } + if (fp->mode != ap->mode || (checkNames && __STRCMP(fp->name, ap->name) != 0)) { + OPB_err(115); + } + ap = ap->link; + } else { + OPB_err(116); + } + fp = fp->link; + } + if (ap != NIL) { + OPB_err(116); + } +} + +static void OPB_CheckProc (OPT_Struct x, OPT_Object y) +{ + if (__IN(y->mode, 0x04c0)) { + if (y->mode == 6) { + if (y->mnolev == 0) { + y->mode = 7; + } else { + OPB_err(73); + } + } + if (x->BaseTyp == y->typ) { + OPB_CheckParameters(x->link, y->link, 0); + } else { + OPB_err(117); + } + } else { + OPB_err(113); + } +} + +static struct ConstOp__13 { + OPT_Node *x; + INTEGER *f; + OPT_Const *xval, *yval; + struct ConstOp__13 *lnk; +} *ConstOp__13_s; + +static INTEGER ConstCmp__14 (void); + +static INTEGER ConstCmp__14 (void) +{ + INTEGER _o_result; + INTEGER res; + switch (*ConstOp__13_s->f) { + case 0: + res = 9; + break; + case 1: case 3: case 4: case 5: case 6: + if ((*ConstOp__13_s->xval)->intval < (*ConstOp__13_s->yval)->intval) { + res = 11; + } else if ((*ConstOp__13_s->xval)->intval > (*ConstOp__13_s->yval)->intval) { + res = 13; + } else { + res = 9; + } + break; + case 7: case 8: + if ((*ConstOp__13_s->xval)->realval < (*ConstOp__13_s->yval)->realval) { + res = 11; + } else if ((*ConstOp__13_s->xval)->realval > (*ConstOp__13_s->yval)->realval) { + res = 13; + } else { + res = 9; + } + break; + case 2: + if ((*ConstOp__13_s->xval)->intval != (*ConstOp__13_s->yval)->intval) { + res = 10; + } else { + res = 9; + } + break; + case 9: + if ((*ConstOp__13_s->xval)->setval != (*ConstOp__13_s->yval)->setval) { + res = 10; + } else { + res = 9; + } + break; + case 10: + if (__STRCMP(*(*ConstOp__13_s->xval)->ext, *(*ConstOp__13_s->yval)->ext) < 0) { + res = 11; + } else if (__STRCMP(*(*ConstOp__13_s->xval)->ext, *(*ConstOp__13_s->yval)->ext) > 0) { + res = 13; + } else { + res = 9; + } + break; + case 11: case 13: case 14: + if ((*ConstOp__13_s->xval)->intval != (*ConstOp__13_s->yval)->intval) { + res = 10; + } else { + res = 9; + } + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPB.ConstCmp, f = ", (LONGINT)37); + OPM_LogWNum(*ConstOp__13_s->f, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + (*ConstOp__13_s->x)->typ = OPT_booltyp; + _o_result = res; + return _o_result; +} + +static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) +{ + INTEGER f, g; + OPT_Const xval = NIL, yval = NIL; + LONGINT xv, yv; + BOOLEAN temp; + struct ConstOp__13 _s; + _s.x = &x; + _s.f = &f; + _s.xval = &xval; + _s.yval = &yval; + _s.lnk = ConstOp__13_s; + ConstOp__13_s = &_s; + f = x->typ->form; + g = y->typ->form; + xval = x->conval; + yval = y->conval; + if (f != g) { + switch (f) { + case 3: + if (g == 10) { + OPB_CharToString(x); + } else { + OPB_err(100); + y->typ = x->typ; + __GUARDEQP(yval, OPT_ConstDesc) = *xval; + } + break; + case 4: + if (__IN(g, 0x70)) { + x->typ = y->typ; + } else if (g == 7) { + x->typ = OPT_realtyp; + xval->realval = xval->intval; + } else if (g == 8) { + x->typ = OPT_lrltyp; + xval->realval = xval->intval; + } else { + OPB_err(100); + y->typ = x->typ; + __GUARDEQP(yval, OPT_ConstDesc) = *xval; + } + break; + case 5: + if (g == 4) { + y->typ = OPT_inttyp; + } else if (__IN(g, 0x70)) { + x->typ = y->typ; + } else if (g == 7) { + x->typ = OPT_realtyp; + xval->realval = xval->intval; + } else if (g == 8) { + x->typ = OPT_lrltyp; + xval->realval = xval->intval; + } else { + OPB_err(100); + y->typ = x->typ; + __GUARDEQP(yval, OPT_ConstDesc) = *xval; + } + break; + case 6: + if (__IN(g, 0x70)) { + y->typ = OPT_linttyp; + } else if (g == 7) { + x->typ = OPT_realtyp; + xval->realval = xval->intval; + } else if (g == 8) { + x->typ = OPT_lrltyp; + xval->realval = xval->intval; + } else { + OPB_err(100); + y->typ = x->typ; + __GUARDEQP(yval, OPT_ConstDesc) = *xval; + } + break; + case 7: + if (__IN(g, 0x70)) { + y->typ = x->typ; + yval->realval = yval->intval; + } else if (g == 8) { + x->typ = OPT_lrltyp; + } else { + OPB_err(100); + y->typ = x->typ; + __GUARDEQP(yval, OPT_ConstDesc) = *xval; + } + break; + case 8: + if (__IN(g, 0x70)) { + y->typ = x->typ; + yval->realval = yval->intval; + } else if (g == 7) { + y->typ = OPT_lrltyp; + } else { + OPB_err(100); + y->typ = x->typ; + __GUARDEQP(yval, OPT_ConstDesc) = *xval; + } + break; + case 10: + if (g == 3) { + OPB_CharToString(y); + g = 10; + } else { + OPB_err(100); + y->typ = x->typ; + __GUARDEQP(yval, OPT_ConstDesc) = *xval; + } + break; + case 11: + if (!__IN(g, 0x6000)) { + OPB_err(100); + } + break; + case 13: + OPB_CheckPtr(x, y); + break; + case 14: + if (g != 11) { + OPB_err(100); + } + break; + default: + OPB_err(100); + y->typ = x->typ; + __GUARDEQP(yval, OPT_ConstDesc) = *xval; + break; + } + f = x->typ->form; + } + switch (op) { + case 1: + if (__IN(f, 0x70)) { + xv = xval->intval; + yv = yval->intval; + if (((((xv == 0 || yv == 0) || (((xv > 0 && yv > 0)) && yv <= __DIV(2147483647, xv))) || (((xv > 0 && yv < 0)) && yv >= __DIV((-2147483647-1), xv))) || (((xv < 0 && yv > 0)) && xv >= __DIV((-2147483647-1), yv))) || (((((((xv < 0 && yv < 0)) && xv != (-2147483647-1))) && yv != (-2147483647-1))) && -xv <= __DIV(2147483647, -yv))) { + xval->intval = xv * yv; + OPB_SetIntType(x); + } else { + OPB_err(204); + } + } else if (__IN(f, 0x0180)) { + temp = __ABS(yval->realval) <= (LONGREAL)1; + if (temp || __ABS(xval->realval) <= 1.79769296342094e+308 / (LONGREAL)__ABS(yval->realval)) { + xval->realval = xval->realval * yval->realval; + OPB_CheckRealType(f, 204, xval); + } else { + OPB_err(204); + } + } else if (f == 9) { + xval->setval = (xval->setval & yval->setval); + } else if (f != 0) { + OPB_err(101); + } + break; + case 2: + if (__IN(f, 0x70)) { + if (yval->intval != 0) { + xval->realval = xval->intval / (REAL)yval->intval; + OPB_CheckRealType(7, 205, xval); + } else { + OPB_err(205); + xval->realval = (LONGREAL)1; + } + x->typ = OPT_realtyp; + } else if (__IN(f, 0x0180)) { + temp = __ABS(yval->realval) >= (LONGREAL)1; + if (temp || __ABS(xval->realval) <= 1.79769296342094e+308 * __ABS(yval->realval)) { + xval->realval = xval->realval / yval->realval; + OPB_CheckRealType(f, 205, xval); + } else { + OPB_err(205); + } + } else if (f == 9) { + xval->setval = xval->setval ^ yval->setval; + } else if (f != 0) { + OPB_err(102); + } + break; + case 3: + if (__IN(f, 0x70)) { + if (yval->intval != 0) { + xval->intval = __DIV(xval->intval, yval->intval); + OPB_SetIntType(x); + } else { + OPB_err(205); + } + } else if (f != 0) { + OPB_err(103); + } + break; + case 4: + if (__IN(f, 0x70)) { + if (yval->intval != 0) { + xval->intval = __MOD(xval->intval, yval->intval); + OPB_SetIntType(x); + } else { + OPB_err(205); + } + } else if (f != 0) { + OPB_err(104); + } + break; + case 5: + if (f == 2) { + xval->intval = OPB_BoolToInt((OPB_IntToBool(xval->intval) && OPB_IntToBool(yval->intval))); + } else { + OPB_err(94); + } + break; + case 6: + if (__IN(f, 0x70)) { + temp = (yval->intval >= 0 && xval->intval <= 2147483647 - yval->intval); + if (temp || (yval->intval < 0 && xval->intval >= (-2147483647-1) - yval->intval)) { + xval->intval += yval->intval; + OPB_SetIntType(x); + } else { + OPB_err(206); + } + } else if (__IN(f, 0x0180)) { + temp = (yval->realval >= (LONGREAL)0 && xval->realval <= 1.79769296342094e+308 - yval->realval); + if (temp || (yval->realval < (LONGREAL)0 && xval->realval >= -1.79769296342094e+308 - yval->realval)) { + xval->realval = xval->realval + yval->realval; + OPB_CheckRealType(f, 206, xval); + } else { + OPB_err(206); + } + } else if (f == 9) { + xval->setval = xval->setval | yval->setval; + } else if (f != 0) { + OPB_err(105); + } + break; + case 7: + if (__IN(f, 0x70)) { + if ((yval->intval >= 0 && xval->intval >= (-2147483647-1) + yval->intval) || (yval->intval < 0 && xval->intval <= 2147483647 + yval->intval)) { + xval->intval -= yval->intval; + OPB_SetIntType(x); + } else { + OPB_err(207); + } + } else if (__IN(f, 0x0180)) { + temp = (yval->realval >= (LONGREAL)0 && xval->realval >= -1.79769296342094e+308 + yval->realval); + if (temp || (yval->realval < (LONGREAL)0 && xval->realval <= 1.79769296342094e+308 + yval->realval)) { + xval->realval = xval->realval - yval->realval; + OPB_CheckRealType(f, 207, xval); + } else { + OPB_err(207); + } + } else if (f == 9) { + xval->setval = (xval->setval & ~yval->setval); + } else if (f != 0) { + OPB_err(106); + } + break; + case 8: + if (f == 2) { + xval->intval = OPB_BoolToInt(OPB_IntToBool(xval->intval) || OPB_IntToBool(yval->intval)); + } else { + OPB_err(95); + } + break; + case 9: + xval->intval = OPB_BoolToInt(ConstCmp__14() == 9); + break; + case 10: + xval->intval = OPB_BoolToInt(ConstCmp__14() != 9); + break; + case 11: + if (__IN(f, 0x2a04)) { + OPB_err(108); + } else { + xval->intval = OPB_BoolToInt(ConstCmp__14() == 11); + } + break; + case 12: + if (__IN(f, 0x2a04)) { + OPB_err(108); + } else { + xval->intval = OPB_BoolToInt(ConstCmp__14() != 13); + } + break; + case 13: + if (__IN(f, 0x2a04)) { + OPB_err(108); + } else { + xval->intval = OPB_BoolToInt(ConstCmp__14() == 13); + } + break; + case 14: + if (__IN(f, 0x2a04)) { + OPB_err(108); + } else { + xval->intval = OPB_BoolToInt(ConstCmp__14() != 11); + } + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPB.ConstOp, op = ", (LONGINT)37); + OPM_LogWNum(op, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + ConstOp__13_s = _s.lnk; +} + +static void OPB_Convert (OPT_Node *x, OPT_Struct typ) +{ + OPT_Node node = NIL; + INTEGER f, g; + LONGINT k; + LONGREAL r; + f = (*x)->typ->form; + g = typ->form; + if ((*x)->class == 7) { + if (__IN(f, 0x70)) { + if (__IN(g, 0x70)) { + if (f > g) { + OPB_SetIntType(*x); + if ((int)(*x)->typ->form > g) { + OPB_err(203); + (*x)->conval->intval = 1; + } + } + } else if (__IN(g, 0x0180)) { + (*x)->conval->realval = (*x)->conval->intval; + (*x)->conval->intval = -1; + } else { + k = (*x)->conval->intval; + if (0 > k || k > 255) { + OPB_err(220); + } + } + } else if (__IN(f, 0x0180)) { + if (__IN(g, 0x0180)) { + OPB_CheckRealType(g, 203, (*x)->conval); + } else { + r = (*x)->conval->realval; + if (r < -2.14748364800000e+009 || r > 2.14748364700000e+009) { + OPB_err(203); + r = (LONGREAL)1; + } + (*x)->conval->intval = __ENTIER(r); + OPB_SetIntType(*x); + } + } + (*x)->obj = NIL; + } else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((int)(*x)->left->typ->form < f || f > g))) { + if ((*x)->left->typ == typ) { + *x = (*x)->left; + } + } else { + node = OPT_NewNode(11); + node->subcl = 20; + node->left = *x; + *x = node; + } + (*x)->typ = typ; +} + +static struct Op__38 { + INTEGER *f, *g; + struct Op__38 *lnk; +} *Op__38_s; + +static void NewOp__39 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y); +static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y); + +static void NewOp__39 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y) +{ + OPT_Node node = NIL; + node = OPT_NewNode(12); + node->subcl = op; + node->typ = typ; + node->left = *x; + node->right = y; + *x = node; +} + +static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) +{ + BOOLEAN _o_result; + BOOLEAN ok, xCharArr, yCharArr; + xCharArr = (__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp->form == 3) || *Op__38_s->f == 10; + yCharArr = (__IN((*y)->typ->comp, 0x0c) && (*y)->typ->BaseTyp->form == 3) || *Op__38_s->g == 10; + if ((((xCharArr && *Op__38_s->g == 3)) && (*y)->class == 7)) { + OPB_CharToString(*y); + *Op__38_s->g = 10; + yCharArr = 1; + } + if ((((yCharArr && *Op__38_s->f == 3)) && (*x)->class == 7)) { + OPB_CharToString(*x); + *Op__38_s->f = 10; + xCharArr = 1; + } + ok = (xCharArr && yCharArr); + if (ok) { + if ((*Op__38_s->f == 10 && (*x)->conval->intval2 == 1)) { + (*x)->typ = OPT_chartyp; + (*x)->conval->intval = 0; + OPB_Index(&*y, OPB_NewIntConst(((LONGINT)(0)))); + } else if ((*Op__38_s->g == 10 && (*y)->conval->intval2 == 1)) { + (*y)->typ = OPT_chartyp; + (*y)->conval->intval = 0; + OPB_Index(&*x, OPB_NewIntConst(((LONGINT)(0)))); + } + } + _o_result = ok; + return _o_result; +} + +void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) +{ + INTEGER f, g; + OPT_Node t = NIL, z = NIL; + OPT_Struct typ = NIL; + BOOLEAN do_; + LONGINT val; + struct Op__38 _s; + _s.f = &f; + _s.g = &g; + _s.lnk = Op__38_s; + Op__38_s = &_s; + z = *x; + if (((z->class == 8 || z->class == 9) || y->class == 8) || y->class == 9) { + OPB_err(126); + } else if ((z->class == 7 && y->class == 7)) { + OPB_ConstOp(op, z, y); + z->obj = NIL; + } else { + if (z->typ != y->typ) { + g = y->typ->form; + switch (z->typ->form) { + case 3: + if (z->class == 7) { + OPB_CharToString(z); + } else { + OPB_err(100); + } + break; + case 4: + if (__IN(g, 0x01f0)) { + OPB_Convert(&z, y->typ); + } else { + OPB_err(100); + } + break; + case 5: + if (g == 4) { + OPB_Convert(&y, z->typ); + } else if (__IN(g, 0x01f0)) { + OPB_Convert(&z, y->typ); + } else { + OPB_err(100); + } + break; + case 6: + if (__IN(g, 0x70)) { + OPB_Convert(&y, z->typ); + } else if (__IN(g, 0x0180)) { + OPB_Convert(&z, y->typ); + } else { + OPB_err(100); + } + break; + case 7: + if (__IN(g, 0x70)) { + OPB_Convert(&y, z->typ); + } else if (__IN(g, 0x0180)) { + OPB_Convert(&z, y->typ); + } else { + OPB_err(100); + } + break; + case 8: + if (__IN(g, 0x01f0)) { + OPB_Convert(&y, z->typ); + } else if (__IN(g, 0x0180)) { + OPB_Convert(&y, z->typ); + } else { + OPB_err(100); + } + break; + case 11: + if (!__IN(g, 0x6000)) { + OPB_err(100); + } + break; + case 13: + OPB_CheckPtr(z, y); + break; + case 14: + if (g != 11) { + OPB_err(100); + } + break; + case 10: + break; + case 15: + if (z->typ->comp == 4) { + OPB_err(100); + } + break; + default: + OPB_err(100); + break; + } + } + typ = z->typ; + f = typ->form; + g = y->typ->form; + switch (op) { + case 1: + do_ = 1; + if (__IN(f, 0x70)) { + if (z->class == 7) { + val = z->conval->intval; + if (val == 1) { + do_ = 0; + z = y; + } else if (val == 0) { + do_ = 0; + } else if (OPB_log(val) == 1) { + t = y; + y = z; + z = t; + op = 17; + y->typ = OPT_sinttyp; + y->conval->intval = OPB_exp; + y->obj = NIL; + } + } else if (y->class == 7) { + val = y->conval->intval; + if (val == 1) { + do_ = 0; + } else if (val == 0) { + do_ = 0; + z = y; + } else if (OPB_log(val) == 1) { + op = 17; + y->typ = OPT_sinttyp; + y->conval->intval = OPB_exp; + y->obj = NIL; + } + } + } else if (!__IN(f, 0x0381)) { + OPB_err(105); + typ = OPT_undftyp; + } + if (do_) { + NewOp__39(op, typ, &z, y); + } + break; + case 2: + if (__IN(f, 0x70)) { + if ((y->class == 7 && y->conval->intval == 0)) { + OPB_err(205); + } + OPB_Convert(&z, OPT_realtyp); + OPB_Convert(&y, OPT_realtyp); + typ = OPT_realtyp; + } else if (__IN(f, 0x0180)) { + if ((y->class == 7 && y->conval->realval == (LONGREAL)0)) { + OPB_err(205); + } + } else if ((f != 9 && f != 0)) { + OPB_err(102); + typ = OPT_undftyp; + } + NewOp__39(op, typ, &z, y); + break; + case 3: + do_ = 1; + if (__IN(f, 0x70)) { + if (y->class == 7) { + val = y->conval->intval; + if (val == 0) { + OPB_err(205); + } else if (val == 1) { + do_ = 0; + } else if (OPB_log(val) == 1) { + op = 17; + y->typ = OPT_sinttyp; + y->conval->intval = -OPB_exp; + y->obj = NIL; + } + } + } else if (f != 0) { + OPB_err(103); + typ = OPT_undftyp; + } + if (do_) { + NewOp__39(op, typ, &z, y); + } + break; + case 4: + if (__IN(f, 0x70)) { + if (y->class == 7) { + if (y->conval->intval == 0) { + OPB_err(205); + } else if (OPB_log(y->conval->intval) == 1) { + op = 18; + y->conval->intval = __ASH(-1, OPB_exp); + y->obj = NIL; + } + } + } else if (f != 0) { + OPB_err(104); + typ = OPT_undftyp; + } + NewOp__39(op, typ, &z, y); + break; + case 5: + if (f == 2) { + if (z->class == 7) { + if (OPB_IntToBool(z->conval->intval)) { + z = y; + } + } else if ((y->class == 7 && OPB_IntToBool(y->conval->intval))) { + } else { + NewOp__39(op, typ, &z, y); + } + } else if (f != 0) { + OPB_err(94); + z->typ = OPT_undftyp; + } + break; + case 6: + if (!__IN(f, 0x03f1)) { + OPB_err(105); + typ = OPT_undftyp; + } + do_ = 1; + if (__IN(f, 0x70)) { + if ((z->class == 7 && z->conval->intval == 0)) { + do_ = 0; + z = y; + } + if ((y->class == 7 && y->conval->intval == 0)) { + do_ = 0; + } + } + if (do_) { + NewOp__39(op, typ, &z, y); + } + break; + case 7: + if (!__IN(f, 0x03f1)) { + OPB_err(106); + typ = OPT_undftyp; + } + if ((!__IN(f, 0x70) || y->class != 7) || y->conval->intval != 0) { + NewOp__39(op, typ, &z, y); + } + break; + case 8: + if (f == 2) { + if (z->class == 7) { + if (!OPB_IntToBool(z->conval->intval)) { + z = y; + } + } else if ((y->class == 7 && !OPB_IntToBool(y->conval->intval))) { + } else { + NewOp__39(op, typ, &z, y); + } + } else if (f != 0) { + OPB_err(95); + z->typ = OPT_undftyp; + } + break; + case 9: case 10: + if (__IN(f, 0x6bff) || strings__41(&z, &y)) { + typ = OPT_booltyp; + } else { + OPB_err(107); + typ = OPT_undftyp; + } + NewOp__39(op, typ, &z, y); + break; + case 11: case 12: case 13: case 14: + if (__IN(f, 0x01f9) || strings__41(&z, &y)) { + typ = OPT_booltyp; + } else { + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"ELSE in Op()", (LONGINT)13); + OPM_LogWLn(); + OPB_err(108); + typ = OPT_undftyp; + } + NewOp__39(op, typ, &z, y); + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPB.Op, op = ", (LONGINT)32); + OPM_LogWNum(op, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + } + *x = z; + Op__38_s = _s.lnk; +} + +void OPB_SetRange (OPT_Node *x, OPT_Node y) +{ + LONGINT k, l; + if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { + OPB_err(126); + } else if ((__IN((*x)->typ->form, 0x70) && __IN(y->typ->form, 0x70))) { + if ((*x)->class == 7) { + k = (*x)->conval->intval; + if (0 > k || k > (LONGINT)OPM_MaxSet) { + OPB_err(202); + } + } + if (y->class == 7) { + l = y->conval->intval; + if (0 > l || l > (LONGINT)OPM_MaxSet) { + OPB_err(202); + } + } + if (((*x)->class == 7 && y->class == 7)) { + if (k <= l) { + (*x)->conval->setval = __SETRNG(k, l); + } else { + OPB_err(201); + (*x)->conval->setval = __SETRNG(l, k); + } + (*x)->obj = NIL; + } else { + OPB_BindNodes(10, OPT_settyp, &*x, y); + } + } else { + OPB_err(93); + } + (*x)->typ = OPT_settyp; +} + +void OPB_SetElem (OPT_Node *x) +{ + LONGINT k; + if ((*x)->class == 8 || (*x)->class == 9) { + OPB_err(126); + } else if (!__IN((*x)->typ->form, 0x70)) { + OPB_err(93); + } else if ((*x)->class == 7) { + k = (*x)->conval->intval; + if ((0 <= k && k <= (LONGINT)OPM_MaxSet)) { + (*x)->conval->setval = __SETOF(k); + } else { + OPB_err(202); + } + (*x)->obj = NIL; + } else { + OPB_Convert(&*x, OPT_settyp); + } + (*x)->typ = OPT_settyp; +} + +static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) +{ + INTEGER f, g; + OPT_Struct y = NIL, p = NIL, q = NIL; + if (OPM_Verbose) { + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"PROCEDURE CheckAssign", (LONGINT)22); + OPM_LogWLn(); + } + y = ynode->typ; + f = x->form; + g = y->form; + if (OPM_Verbose) { + OPM_LogWStr((CHAR*)"y.form = ", (LONGINT)10); + OPM_LogWNum(y->form, ((LONGINT)(0))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"f = ", (LONGINT)5); + OPM_LogWNum(f, ((LONGINT)(0))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"g = ", (LONGINT)5); + OPM_LogWNum(g, ((LONGINT)(0))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"ynode.typ.syze = ", (LONGINT)18); + OPM_LogWNum(ynode->typ->size, ((LONGINT)(0))); + OPM_LogWLn(); + } + if (ynode->class == 8 || (ynode->class == 9 && f != 14)) { + OPB_err(126); + } + switch (f) { + case 0: case 10: + break; + case 1: + if (!__IN(g, 0x1a)) { + OPB_err(113); + } + break; + case 2: case 3: case 4: case 9: + if (g != f) { + OPB_err(113); + } + break; + case 5: + if (!__IN(g, 0x30)) { + OPB_err(113); + } + break; + case 6: + if (OPM_LIntSize == 4) { + if (!__IN(g, 0x70)) { + OPB_err(113); + } + } else { + if (!__IN(g, 0x70)) { + OPB_err(113); + } + } + break; + case 7: + if (!__IN(g, 0xf0)) { + OPB_err(113); + } + break; + case 8: + if (!__IN(g, 0x01f0)) { + OPB_err(113); + } + break; + case 13: + if ((x == y || g == 11) || (x == OPT_sysptrtyp && g == 13)) { + } else if (g == 13) { + p = x->BaseTyp; + q = y->BaseTyp; + if ((p->comp == 4 && q->comp == 4)) { + while ((((q != p && q != NIL)) && q != OPT_undftyp)) { + q = q->BaseTyp; + } + if (q == NIL) { + OPB_err(113); + } + } else { + OPB_err(113); + } + } else { + OPB_err(113); + } + break; + case 14: + if (ynode->class == 9) { + OPB_CheckProc(x, ynode->obj); + } else if (x == y || g == 11) { + } else { + OPB_err(113); + } + break; + case 12: case 11: + OPB_err(113); + break; + case 15: + x->pvused = 1; + if (x->comp == 2) { + if ((ynode->class == 7 && g == 3)) { + OPB_CharToString(ynode); + y = ynode->typ; + g = 10; + } + if (x == y) { + } else if (x->BaseTyp == OPT_chartyp) { + if (g == 10) { + if (ynode->conval->intval2 > x->n) { + OPB_err(114); + } + } else if ((__IN(y->comp, 0x0c) && y->BaseTyp == OPT_chartyp)) { + } else { + OPB_err(113); + } + } else { + OPB_err(113); + } + } else if ((x->comp == 3 && x->BaseTyp == OPT_chartyp)) { + if ((__IN(y->comp, 0x0c) && y->BaseTyp == OPT_chartyp)) { + } else { + OPB_err(113); + } + } else if (x->comp == 4) { + if (x == y) { + } else if (y->comp == 4) { + q = y->BaseTyp; + while ((((q != NIL && q != x)) && q != OPT_undftyp)) { + q = q->BaseTyp; + } + if (q == NIL) { + OPB_err(113); + } + } else { + OPB_err(113); + } + } else { + OPB_err(113); + } + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPB.CheckAssign, f = ", (LONGINT)40); + OPM_LogWNum(f, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + if ((((((ynode->class == 7 && g < f)) && __IN(g, 0xf0))) && __IN(f, 0x01e0))) { + OPB_Convert(&ynode, x); + } +} + +static void OPB_CheckLeaf (OPT_Node x, BOOLEAN dynArrToo) +{ +} + +void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) +{ + INTEGER f; + OPT_Struct typ = NIL; + OPT_Node x = NIL; + x = *par0; + f = x->typ->form; + switch (fctno) { + case 0: + if ((__IN(f, 0x70) && x->class == 7)) { + if ((0 <= x->conval->intval && x->conval->intval <= 255)) { + OPB_BindNodes(28, OPT_notyp, &x, x); + } else { + OPB_err(218); + } + } else { + OPB_err(69); + } + x->typ = OPT_notyp; + break; + case 1: + typ = OPT_notyp; + if (OPB_NotVar(x)) { + OPB_err(112); + } else if (f == 13) { + if (x->readonly) { + OPB_err(76); + } + f = x->typ->BaseTyp->comp; + if (__IN(f, 0x1c)) { + if (f == 3) { + typ = x->typ->BaseTyp; + } + OPB_BindNodes(19, OPT_notyp, &x, NIL); + x->subcl = 1; + } else { + OPB_err(111); + } + } else { + OPB_err(111); + } + x->typ = typ; + break; + case 2: + OPB_MOp(21, &x); + break; + case 3: + OPB_MOp(22, &x); + break; + case 4: + if (x->class == 8 || x->class == 9) { + OPB_err(126); + } else if (f == 3) { + OPB_Convert(&x, OPT_inttyp); + } else { + OPB_err(111); + } + x->typ = OPT_inttyp; + break; + case 5: + if (x->class == 8 || x->class == 9) { + OPB_err(126); + } else if (__IN(f, 0x0180)) { + OPB_Convert(&x, OPT_linttyp); + } else { + OPB_err(111); + } + x->typ = OPT_linttyp; + break; + case 6: + OPB_MOp(23, &x); + break; + case 7: + if (x->class == 8) { + switch (f) { + case 2: + x = OPB_NewBoolConst(0); + break; + case 3: + x = OPB_NewIntConst(((LONGINT)(0))); + x->typ = OPT_chartyp; + break; + case 4: + x = OPB_NewIntConst(OPM_MinSInt); + break; + case 5: + x = OPB_NewIntConst(OPM_MinInt); + break; + case 6: + x = OPB_NewIntConst(OPM_MinLInt); + break; + case 9: + x = OPB_NewIntConst(((LONGINT)(0))); + x->typ = OPT_inttyp; + break; + case 7: + x = OPB_NewRealConst(OPM_MinReal, OPT_realtyp); + break; + case 8: + x = OPB_NewRealConst(OPM_MinLReal, OPT_lrltyp); + break; + default: + OPB_err(111); + break; + } + } else { + OPB_err(110); + } + break; + case 8: + if (x->class == 8) { + switch (f) { + case 2: + x = OPB_NewBoolConst(1); + break; + case 3: + x = OPB_NewIntConst(((LONGINT)(255))); + x->typ = OPT_chartyp; + break; + case 4: + x = OPB_NewIntConst(OPM_MaxSInt); + break; + case 5: + x = OPB_NewIntConst(OPM_MaxInt); + break; + case 6: + x = OPB_NewIntConst(OPM_MaxLInt); + break; + case 9: + x = OPB_NewIntConst(OPM_MaxSet); + x->typ = OPT_inttyp; + break; + case 7: + x = OPB_NewRealConst(OPM_MaxReal, OPT_realtyp); + break; + case 8: + x = OPB_NewRealConst(OPM_MaxLReal, OPT_lrltyp); + break; + default: + OPB_err(111); + break; + } + } else { + OPB_err(110); + } + break; + case 9: + if (x->class == 8 || x->class == 9) { + OPB_err(126); + } else if (__IN(f, 0x71)) { + OPB_Convert(&x, OPT_chartyp); + } else { + OPB_err(111); + x->typ = OPT_chartyp; + } + break; + case 10: + if (x->class == 8 || x->class == 9) { + OPB_err(126); + } else if (f == 5) { + OPB_Convert(&x, OPT_sinttyp); + } else if (f == 6) { + OPB_Convert(&x, OPT_inttyp); + } else if (f == 8) { + OPB_Convert(&x, OPT_realtyp); + } else { + OPB_err(111); + } + break; + case 11: + if (x->class == 8 || x->class == 9) { + OPB_err(126); + } else if (f == 4) { + OPB_Convert(&x, OPT_inttyp); + } else if (f == 5) { + OPB_Convert(&x, OPT_linttyp); + } else if (f == 7) { + OPB_Convert(&x, OPT_lrltyp); + } else if (f == 3) { + OPB_Convert(&x, OPT_linttyp); + } else { + OPB_err(111); + } + break; + case 13: case 14: + if (OPB_NotVar(x)) { + OPB_err(112); + } else if (!__IN(f, 0x70)) { + OPB_err(111); + } else if (x->readonly) { + OPB_err(76); + } + break; + case 15: case 16: + if (OPB_NotVar(x)) { + OPB_err(112); + } else if (x->typ != OPT_settyp) { + OPB_err(111); + x->typ = OPT_settyp; + } else if (x->readonly) { + OPB_err(76); + } + break; + case 17: + if (!__IN(x->typ->comp, 0x0c)) { + OPB_err(131); + } + break; + case 18: + if ((x->class == 7 && f == 3)) { + OPB_CharToString(x); + f = 10; + } + if (x->class == 8 || x->class == 9) { + OPB_err(126); + } else if (((!__IN(x->typ->comp, 0x0c) || x->typ->BaseTyp->form != 3) && f != 10)) { + OPB_err(111); + } + break; + case 19: + if (x->class == 8 || x->class == 9) { + OPB_err(126); + } else if (__IN(f, 0x70)) { + if (f != 6) { + OPB_Convert(&x, OPT_linttyp); + } + } else { + OPB_err(111); + x->typ = OPT_linttyp; + } + break; + case 20: + OPB_CheckLeaf(x, 0); + OPB_MOp(24, &x); + break; + case 12: + if (x->class != 8) { + OPB_err(110); + x = OPB_NewIntConst(((LONGINT)(1))); + } else if (__IN(f, 0x63fe) || __IN(x->typ->comp, 0x14)) { + (*OPB_typSize)(x->typ); + x->typ->pvused = 1; + x = OPB_NewIntConst(x->typ->size); + } else { + OPB_err(111); + x = OPB_NewIntConst(((LONGINT)(1))); + } + break; + case 21: + OPB_MOp(25, &x); + break; + case 22: case 23: + if (x->class == 8 || x->class == 9) { + OPB_err(126); + } else if (!__IN(f, 0x027a)) { + OPB_err(111); + } + break; + case 24: case 25: case 28: case 31: + if (x->class == 8 || x->class == 9) { + OPB_err(126); + } else if ((x->class == 7 && __IN(f, 0x30))) { + OPB_Convert(&x, OPT_linttyp); + } else if (!__IN(f, 0x2040)) { + OPB_err(111); + x->typ = OPT_linttyp; + } + break; + case 26: case 27: + if ((__IN(f, 0x70) && x->class == 7)) { + if (x->conval->intval < 0 || x->conval->intval > -1) { + OPB_err(220); + } + } else { + OPB_err(69); + } + break; + case 29: + if (x->class != 8) { + OPB_err(110); + } else if (__IN(f, 0x1401) || x->typ->comp == 3) { + OPB_err(111); + } + break; + case 30: + if (OPB_NotVar(x)) { + OPB_err(112); + } else if (f == 13) { + } else { + OPB_err(111); + } + break; + case 32: + if (x->class == 8 || x->class == 9) { + OPB_err(126); + x = OPB_NewBoolConst(0); + } else if (f != 2) { + OPB_err(120); + x = OPB_NewBoolConst(0); + } else { + OPB_MOp(33, &x); + } + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPB.StPar0, fctno = ", (LONGINT)39); + OPM_LogWNum(fctno, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + *par0 = x; +} + +static struct StPar1__52 { + struct StPar1__52 *lnk; +} *StPar1__52_s; + +static OPT_Node NewOp__53 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right); + +static OPT_Node NewOp__53 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right) +{ + OPT_Node _o_result; + OPT_Node node = NIL; + node = OPT_NewNode(class); + node->subcl = subcl; + node->left = left; + node->right = right; + _o_result = node; + return _o_result; +} + +void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) +{ + INTEGER f, L; + OPT_Struct typ = NIL; + OPT_Node p = NIL, t = NIL; + struct StPar1__52 _s; + _s.lnk = StPar1__52_s; + StPar1__52_s = &_s; + p = *par0; + f = x->typ->form; + switch (fctno) { + case 13: case 14: + if (x->class == 8 || x->class == 9) { + OPB_err(126); + p->typ = OPT_notyp; + } else { + if (x->typ != p->typ) { + if ((x->class == 7 && __IN(f, 0x70))) { + OPB_Convert(&x, p->typ); + } else { + OPB_err(111); + } + } + p = NewOp__53(19, fctno, p, x); + p->typ = OPT_notyp; + } + break; + case 15: case 16: + if (x->class == 8 || x->class == 9) { + OPB_err(126); + } else if (__IN(f, 0x70)) { + if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > (LONGINT)OPM_MaxSet))) { + OPB_err(202); + } + p = NewOp__53(19, fctno, p, x); + } else { + OPB_err(111); + } + p->typ = OPT_notyp; + break; + case 17: + if (!__IN(f, 0x70) || x->class != 7) { + OPB_err(69); + } else if (f == 4) { + L = (int)x->conval->intval; + typ = p->typ; + while ((L > 0 && __IN(typ->comp, 0x0c))) { + typ = typ->BaseTyp; + L -= 1; + } + if (L != 0 || !__IN(typ->comp, 0x0c)) { + OPB_err(132); + } else { + x->obj = NIL; + if (typ->comp == 3) { + while (p->class == 4) { + p = p->left; + x->conval->intval += 1; + } + p = NewOp__53(12, 19, p, x); + p->typ = OPT_linttyp; + } else { + p = x; + p->conval->intval = typ->n; + OPB_SetIntType(p); + } + } + } else { + OPB_err(132); + } + break; + case 18: + if (OPB_NotVar(x)) { + OPB_err(112); + } else if ((__IN(x->typ->comp, 0x0c) && x->typ->BaseTyp->form == 3)) { + if (x->readonly) { + OPB_err(76); + } + t = x; + x = p; + p = t; + p = NewOp__53(19, 18, p, x); + } else { + OPB_err(111); + } + p->typ = OPT_notyp; + break; + case 19: + if (x->class == 8 || x->class == 9) { + OPB_err(126); + } else if (__IN(f, 0x70)) { + if ((p->class == 7 && x->class == 7)) { + if (-OPB_maxExp > x->conval->intval || x->conval->intval > OPB_maxExp) { + OPB_err(208); + p->conval->intval = 1; + } else if (x->conval->intval >= 0) { + if (__ABS(p->conval->intval) <= __DIV(2147483647, __ASH(1, x->conval->intval))) { + p->conval->intval = p->conval->intval * __ASH(1, x->conval->intval); + } else { + OPB_err(208); + p->conval->intval = 1; + } + } else { + p->conval->intval = __ASH(p->conval->intval, x->conval->intval); + } + p->obj = NIL; + } else { + p = NewOp__53(12, 17, p, x); + p->typ = OPT_linttyp; + } + } else { + OPB_err(111); + } + break; + case 1: + if (x->class == 8 || x->class == 9) { + OPB_err(126); + } else if (p->typ->comp == 3) { + if (__IN(f, 0x70)) { + if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > OPM_MaxIndex))) { + OPB_err(63); + } + } else { + OPB_err(111); + } + p->right = x; + p->typ = p->typ->BaseTyp; + } else { + OPB_err(64); + } + break; + case 22: case 23: + if (x->class == 8 || x->class == 9) { + OPB_err(126); + } else if (!__IN(f, 0x70)) { + OPB_err(111); + } else { + if (fctno == 22) { + p = NewOp__53(12, 27, p, x); + } else { + p = NewOp__53(12, 28, p, x); + } + p->typ = p->left->typ; + } + break; + case 24: case 25: case 26: case 27: + if (x->class == 8 || x->class == 9) { + OPB_err(126); + } else if (__IN(f, 0x63ff)) { + if (fctno == 24 || fctno == 26) { + if (OPB_NotVar(x)) { + OPB_err(112); + } + t = x; + x = p; + p = t; + } + p = NewOp__53(19, fctno, p, x); + } else { + OPB_err(111); + } + p->typ = OPT_notyp; + break; + case 28: + if (x->class == 8 || x->class == 9) { + OPB_err(126); + } else if (__IN(f, 0x70)) { + p = NewOp__53(12, 26, p, x); + } else { + OPB_err(111); + } + p->typ = OPT_booltyp; + break; + case 29: + if (((x->class == 8 || x->class == 9) || __IN(f, 0x1401)) || x->typ->comp == 3) { + OPB_err(126); + } + t = OPT_NewNode(11); + t->subcl = 29; + t->left = x; + x = t; + x->typ = p->typ; + p = x; + break; + case 30: + if (x->class == 8 || x->class == 9) { + OPB_err(126); + } else if (__IN(f, 0x70)) { + p = NewOp__53(19, 30, p, x); + } else { + OPB_err(111); + } + p->typ = OPT_notyp; + break; + case 31: + if (x->class == 8 || x->class == 9) { + OPB_err(126); + } else if ((x->class == 7 && __IN(f, 0x30))) { + OPB_Convert(&x, OPT_linttyp); + } else if (!__IN(f, 0x2040)) { + OPB_err(111); + x->typ = OPT_linttyp; + } + p->link = x; + break; + case 32: + if ((__IN(f, 0x70) && x->class == 7)) { + if ((0 <= x->conval->intval && x->conval->intval <= 255)) { + OPB_BindNodes(28, OPT_notyp, &x, x); + x->conval = OPT_NewConst(); + x->conval->intval = OPM_errpos; + OPB_Construct(15, &p, x); + p->conval = OPT_NewConst(); + p->conval->intval = OPM_errpos; + OPB_Construct(20, &p, NIL); + OPB_OptIf(&p); + if (p == NIL) { + } else if (p->class == 28) { + OPB_err(99); + } else { + p->subcl = 32; + } + } else { + OPB_err(218); + } + } else { + OPB_err(69); + } + break; + default: + OPB_err(64); + break; + } + *par0 = p; + StPar1__52_s = _s.lnk; +} + +void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n) +{ + OPT_Node node = NIL; + INTEGER f; + OPT_Node p = NIL; + p = *par0; + f = x->typ->form; + if (fctno == 1) { + if (x->class == 8 || x->class == 9) { + OPB_err(126); + } else if (p->typ->comp != 3) { + OPB_err(64); + } else if (__IN(f, 0x70)) { + if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > OPM_MaxIndex))) { + OPB_err(63); + } + node = p->right; + while (node->link != NIL) { + node = node->link; + } + node->link = x; + p->typ = p->typ->BaseTyp; + } else { + OPB_err(111); + } + } else if ((fctno == 31 && n == 2)) { + if (x->class == 8 || x->class == 9) { + OPB_err(126); + } else if (__IN(f, 0x70)) { + node = OPT_NewNode(19); + node->subcl = 31; + node->right = p; + node->left = p->link; + p->link = x; + p = node; + } else { + OPB_err(111); + } + p->typ = OPT_notyp; + } else { + OPB_err(64); + } + *par0 = p; +} + +void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno) +{ + INTEGER dim; + OPT_Node x = NIL, p = NIL; + p = *par0; + if (fctno <= 19) { + if ((fctno == 1 && p->typ != OPT_notyp)) { + if (p->typ->comp == 3) { + OPB_err(65); + } + p->typ = OPT_notyp; + } else if (fctno <= 12) { + if (parno < 1) { + OPB_err(65); + } + } else { + if (((fctno == 13 || fctno == 14) && parno == 1)) { + OPB_BindNodes(19, OPT_notyp, &p, OPB_NewIntConst(((LONGINT)(1)))); + p->subcl = fctno; + p->right->typ = p->left->typ; + } else if ((fctno == 17 && parno == 1)) { + if (p->typ->comp == 3) { + dim = 0; + while (p->class == 4) { + p = p->left; + dim += 1; + } + OPB_BindNodes(12, OPT_linttyp, &p, OPB_NewIntConst(dim)); + p->subcl = 19; + } else { + p = OPB_NewIntConst(p->typ->n); + } + } else if (parno < 2) { + OPB_err(65); + } + } + } else if (fctno == 32) { + if (parno == 1) { + x = NIL; + OPB_BindNodes(28, OPT_notyp, &x, OPB_NewIntConst(((LONGINT)(0)))); + x->conval = OPT_NewConst(); + x->conval->intval = OPM_errpos; + OPB_Construct(15, &p, x); + p->conval = OPT_NewConst(); + p->conval->intval = OPM_errpos; + OPB_Construct(20, &p, NIL); + OPB_OptIf(&p); + if (p == NIL) { + } else if (p->class == 28) { + OPB_err(99); + } else { + p->subcl = 32; + } + } else if (parno < 1) { + OPB_err(65); + } + } else { + if ((parno < 1 || (fctno > 21 && parno < 2)) || (fctno == 31 && parno < 3)) { + OPB_err(65); + } + } + *par0 = p; +} + +static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpar) +{ + INTEGER f; + f = atyp->comp; + ftyp = ftyp->BaseTyp; + atyp = atyp->BaseTyp; + if ((fvarpar && ftyp == OPT_bytetyp)) { + if (!__IN(f, 0x0c) || !__IN(atyp->form, 0x1e)) { + if (__IN(18, OPM_opt)) { + OPB_err(-301); + } + } + } else if (__IN(f, 0x0c)) { + if (ftyp->comp == 3) { + OPB_DynArrParCheck(ftyp, atyp, fvarpar); + } else if (ftyp != atyp) { + if ((((!fvarpar && ftyp->form == 13)) && atyp->form == 13)) { + ftyp = ftyp->BaseTyp; + atyp = atyp->BaseTyp; + if ((ftyp->comp == 4 && atyp->comp == 4)) { + while ((((ftyp != atyp && atyp != NIL)) && atyp != OPT_undftyp)) { + atyp = atyp->BaseTyp; + } + if (atyp == NIL) { + OPB_err(113); + } + } else { + OPB_err(66); + } + } else { + OPB_err(66); + } + } + } else { + OPB_err(67); + } +} + +static void OPB_CheckReceiver (OPT_Node *x, OPT_Object fp) +{ + if (fp->typ->form == 13) { + if ((*x)->class == 3) { + *x = (*x)->left; + } else { + OPB_err(71); + } + } +} + +void OPB_PrepCall (OPT_Node *x, OPT_Object *fpar) +{ + if (((*x)->obj != NIL && __IN((*x)->obj->mode, 0x22c0))) { + *fpar = (*x)->obj->link; + if ((*x)->obj->mode == 13) { + OPB_CheckReceiver(&(*x)->left, *fpar); + *fpar = (*fpar)->link; + } + } else if (((((*x)->class != 8 && (*x)->typ != NIL)) && (*x)->typ->form == 14)) { + *fpar = (*x)->typ->link; + } else { + OPB_err(121); + *fpar = NIL; + (*x)->typ = OPT_undftyp; + } +} + +void OPB_Param (OPT_Node ap, OPT_Object fp) +{ + OPT_Struct q = NIL; + if (fp->typ->form != 0) { + if (fp->mode == 2) { + if (OPB_NotVar(ap)) { + OPB_err(122); + } else { + OPB_CheckLeaf(ap, 0); + } + if (ap->readonly) { + OPB_err(76); + } + if (fp->typ->comp == 3) { + OPB_DynArrParCheck(fp->typ, ap->typ, 1); + } else if ((fp->typ->comp == 4 && ap->typ->comp == 4)) { + q = ap->typ; + while ((((q != fp->typ && q != NIL)) && q != OPT_undftyp)) { + q = q->BaseTyp; + } + if (q == NIL) { + OPB_err(111); + } + } else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 13)) { + } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && __IN(ap->typ->form, 0x18))))) { + OPB_err(123); + } else if ((fp->typ->form == 13 && ap->class == 5)) { + OPB_err(123); + } + } else if (fp->typ->comp == 3) { + if ((ap->class == 7 && ap->typ->form == 3)) { + OPB_CharToString(ap); + } + if ((ap->typ->form == 10 && fp->typ->BaseTyp->form == 3)) { + } else if (ap->class >= 7) { + OPB_err(59); + } else { + OPB_DynArrParCheck(fp->typ, ap->typ, 0); + } + } else { + OPB_CheckAssign(fp->typ, ap); + } + } +} + +void OPB_StaticLink (SHORTINT dlev) +{ + OPT_Object scope = NIL; + scope = OPT_topScope; + while (dlev > 0) { + dlev -= 1; + scope->link->conval->setval |= __SETOF(3); + scope = scope->left; + } +} + +void OPB_Call (OPT_Node *x, OPT_Node apar, OPT_Object fp) +{ + OPT_Struct typ = NIL; + OPT_Node p = NIL; + SHORTINT lev; + if ((*x)->class == 9) { + typ = (*x)->typ; + lev = (*x)->obj->mnolev; + if (lev > 0) { + OPB_StaticLink(OPT_topScope->mnolev - lev); + } + if ((*x)->obj->mode == 10) { + OPB_err(121); + } + } else if (((*x)->class == 2 && (*x)->obj->mode == 13)) { + typ = (*x)->typ; + (*x)->class = 9; + p = (*x)->left; + (*x)->left = NIL; + p->link = apar; + apar = p; + fp = (*x)->obj->link; + } else { + typ = (*x)->typ->BaseTyp; + } + OPB_BindNodes(13, typ, &*x, apar); + (*x)->obj = fp; +} + +void OPB_Enter (OPT_Node *procdec, OPT_Node stat, OPT_Object proc) +{ + OPT_Node x = NIL; + x = OPT_NewNode(18); + x->typ = OPT_notyp; + x->obj = proc; + x->left = *procdec; + x->right = stat; + *procdec = x; +} + +void OPB_Return (OPT_Node *x, OPT_Object proc) +{ + OPT_Node node = NIL; + if (proc == NIL) { + if (*x != NIL) { + OPB_err(124); + } + } else { + if (*x != NIL) { + OPB_CheckAssign(proc->typ, *x); + } else if (proc->typ != OPT_notyp) { + OPB_err(124); + } + } + node = OPT_NewNode(26); + node->typ = OPT_notyp; + node->obj = proc; + node->left = *x; + *x = node; +} + +void OPB_Assign (OPT_Node *x, OPT_Node y) +{ + OPT_Node z = NIL; + SHORTINT subcl; + if ((*x)->class >= 7) { + OPB_err(56); + } + OPB_CheckAssign((*x)->typ, y); + if ((*x)->readonly) { + OPB_err(76); + } + if ((*x)->typ->comp == 4) { + if ((*x)->class == 5) { + z = (*x)->left; + } else { + z = *x; + } + if ((z->class == 3 && z->left->class == 5)) { + z->left = z->left->left; + } + if (((*x)->typ->strobj != NIL && (z->class == 3 || z->class == 1))) { + OPB_BindNodes(6, (*x)->typ, &z, NIL); + *x = z; + } + } else if (((((((*x)->typ->comp == 2 && (*x)->typ->BaseTyp == OPT_chartyp)) && y->typ->form == 10)) && y->conval->intval2 == 1)) { + y->typ = OPT_chartyp; + y->conval->intval = 0; + OPB_Index(&*x, OPB_NewIntConst(((LONGINT)(0)))); + } + if ((((((__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp == OPT_chartyp)) && __IN(y->typ->comp, 0x0c))) && y->typ->BaseTyp == OPT_chartyp)) { + subcl = 18; + } else { + subcl = 0; + } + OPB_BindNodes(19, OPT_notyp, &*x, y); + (*x)->subcl = subcl; +} + +void OPB_Inittd (OPT_Node *inittd, OPT_Node *last, OPT_Struct typ) +{ + OPT_Node node = NIL; + node = OPT_NewNode(14); + node->typ = typ; + node->conval = OPT_NewConst(); + node->conval->intval = typ->txtpos; + if (*inittd == NIL) { + *inittd = node; + } else { + (*last)->link = node; + } + *last = node; +} + + +export void *OPB__init(void) +{ + __DEFMOD; + __MODULE_IMPORT(OPM); + __MODULE_IMPORT(OPS); + __MODULE_IMPORT(OPT); + __REGMOD("OPB", 0); +/* BEGIN */ + OPB_maxExp = OPB_log(1073741824); + OPB_maxExp = OPB_exp; + __ENDMOD; +} diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h new file mode 100644 index 00000000..8cd47ee6 --- /dev/null +++ b/bootstrap/unix-44/OPB.h @@ -0,0 +1,49 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ + +#ifndef OPB__h +#define OPB__h + +#include "SYSTEM.h" +#include "OPS.h" +#include "OPT.h" + + +import void (*OPB_typSize)(OPT_Struct); + + +import void OPB_Assign (OPT_Node *x, OPT_Node y); +import void OPB_Call (OPT_Node *x, OPT_Node apar, OPT_Object fp); +import void OPB_CheckParameters (OPT_Object fp, OPT_Object ap, BOOLEAN checkNames); +import void OPB_Construct (SHORTINT class, OPT_Node *x, OPT_Node y); +import void OPB_DeRef (OPT_Node *x); +import OPT_Node OPB_EmptySet (void); +import void OPB_Enter (OPT_Node *procdec, OPT_Node stat, OPT_Object proc); +import void OPB_Field (OPT_Node *x, OPT_Object y); +import void OPB_In (OPT_Node *x, OPT_Node y); +import void OPB_Index (OPT_Node *x, OPT_Node y); +import void OPB_Inittd (OPT_Node *inittd, OPT_Node *last, OPT_Struct typ); +import void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y); +import void OPB_MOp (SHORTINT op, OPT_Node *x); +import OPT_Node OPB_NewBoolConst (BOOLEAN boolval); +import OPT_Node OPB_NewIntConst (LONGINT intval); +import OPT_Node OPB_NewLeaf (OPT_Object obj); +import OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ); +import OPT_Node OPB_NewString (OPS_String str, LONGINT len); +import OPT_Node OPB_Nil (void); +import void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y); +import void OPB_OptIf (OPT_Node *x); +import void OPB_Param (OPT_Node ap, OPT_Object fp); +import void OPB_PrepCall (OPT_Node *x, OPT_Object *fpar); +import void OPB_Return (OPT_Node *x, OPT_Object proc); +import void OPB_SetElem (OPT_Node *x); +import void OPB_SetRange (OPT_Node *x, OPT_Node y); +import void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno); +import void OPB_StPar0 (OPT_Node *par0, INTEGER fctno); +import void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno); +import void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n); +import void OPB_StaticLink (SHORTINT dlev); +import void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard); +import void *OPB__init(void); + + +#endif diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c new file mode 100644 index 00000000..32a1496f --- /dev/null +++ b/bootstrap/unix-44/OPC.c @@ -0,0 +1,2108 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +#include "SYSTEM.h" +#include "Configuration.h" +#include "OPM.h" +#include "OPT.h" + + +static INTEGER OPC_indentLevel; +static BOOLEAN OPC_ptrinit, OPC_mainprog, OPC_ansi; +static SHORTINT OPC_hashtab[105]; +static CHAR OPC_keytab[36][9]; +static BOOLEAN OPC_GlbPtrs; +static CHAR OPC_BodyNameExt[13]; + + +export void OPC_Align (LONGINT *adr, LONGINT base); +export void OPC_Andent (OPT_Struct typ); +static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames); +export LONGINT OPC_Base (OPT_Struct typ); +export OPT_Object OPC_BaseTProc (OPT_Object obj); +export void OPC_BegBlk (void); +export void OPC_BegStat (void); +static void OPC_CProcDefs (OPT_Object obj, INTEGER vis); +export void OPC_Case (LONGINT caseVal, INTEGER form); +export void OPC_Cmp (INTEGER rel); +export void OPC_CompleteIdent (OPT_Object obj); +export void OPC_Constant (OPT_Const con, INTEGER form); +static void OPC_DeclareBase (OPT_Object dcl); +static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef); +static void OPC_DeclareParams (OPT_Object par, BOOLEAN macro); +static void OPC_DeclareTProcs (OPT_Object obj, BOOLEAN *empty); +static void OPC_DefAnonRecs (OPT_Node n); +export void OPC_DefineInter (OPT_Object proc); +static void OPC_DefineTProcMacros (OPT_Object obj, BOOLEAN *empty); +static void OPC_DefineTProcTypes (OPT_Object obj); +static void OPC_DefineType (OPT_Struct str); +export void OPC_EndBlk (void); +export void OPC_EndBlk0 (void); +export void OPC_EndStat (void); +export void OPC_EnterBody (void); +export void OPC_EnterProc (OPT_Object proc); +export void OPC_ExitBody (void); +export void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet); +static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, LONGINT *off, LONGINT *n, LONGINT *curAlign); +static void OPC_FillGap (LONGINT gap, LONGINT off, LONGINT align, LONGINT *n, LONGINT *curAlign); +export void OPC_GenBdy (OPT_Node n); +static void OPC_GenDynTypes (OPT_Node n, INTEGER vis); +export void OPC_GenEnumPtrs (OPT_Object var); +export void OPC_GenHdr (OPT_Node n); +export void OPC_GenHdrIncludes (void); +static void OPC_GenHeaderMsg (void); +export void OPC_Halt (LONGINT n); +export void OPC_Ident (OPT_Object obj); +static void OPC_IdentList (OPT_Object obj, INTEGER vis); +static void OPC_Include (CHAR *name, LONGINT name__len); +static void OPC_IncludeImports (OPT_Object obj, INTEGER vis); +export void OPC_Increment (BOOLEAN decrement); +export void OPC_Indent (INTEGER count); +export void OPC_Init (void); +static void OPC_InitImports (OPT_Object obj); +static void OPC_InitKeywords (void); +export void OPC_InitTDesc (OPT_Struct typ); +static void OPC_InitTProcs (OPT_Object typ, OPT_Object obj); +export void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim); +static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName); +static INTEGER OPC_Length (CHAR *s, LONGINT s__len); +export LONGINT OPC_NofPtrs (OPT_Struct typ); +static INTEGER OPC_PerfectHash (CHAR *s, LONGINT s__len); +static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len); +static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define); +static void OPC_ProcPredefs (OPT_Object obj, SHORTINT vis); +static void OPC_PutBase (OPT_Struct typ); +static void OPC_PutPtrOffsets (OPT_Struct typ, LONGINT adr, LONGINT *cnt); +static void OPC_RegCmds (OPT_Object obj); +export void OPC_SetInclude (BOOLEAN exclude); +static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause); +static void OPC_Str1 (CHAR *s, LONGINT s__len, LONGINT x); +export void OPC_TDescDecl (OPT_Struct typ); +export void OPC_TypeDefs (OPT_Object obj, INTEGER vis); +export void OPC_TypeOf (OPT_Object ap); +static BOOLEAN OPC_Undefined (OPT_Object obj); + + +void OPC_Init (void) +{ + OPC_indentLevel = 0; + OPC_ptrinit = __IN(5, OPM_opt); + OPC_mainprog = OPM_mainProg || OPM_mainLinkStat; + OPC_ansi = __IN(6, OPM_opt); + if (OPC_ansi) { + __MOVE("__init(void)", OPC_BodyNameExt, 13); + } else { + __MOVE("__init()", OPC_BodyNameExt, 9); + } +} + +void OPC_Indent (INTEGER count) +{ + OPC_indentLevel += count; +} + +void OPC_BegStat (void) +{ + INTEGER i; + i = OPC_indentLevel; + while (i > 0) { + OPM_Write(0x09); + i -= 1; + } +} + +void OPC_EndStat (void) +{ + OPM_Write(';'); + OPM_WriteLn(); +} + +void OPC_BegBlk (void) +{ + OPM_Write('{'); + OPM_WriteLn(); + OPC_indentLevel += 1; +} + +void OPC_EndBlk (void) +{ + OPC_indentLevel -= 1; + OPC_BegStat(); + OPM_Write('}'); + OPM_WriteLn(); +} + +void OPC_EndBlk0 (void) +{ + OPC_indentLevel -= 1; + OPC_BegStat(); + OPM_Write('}'); +} + +static void OPC_Str1 (CHAR *s, LONGINT s__len, LONGINT x) +{ + CHAR ch; + INTEGER i; + __DUP(s, s__len, CHAR); + ch = s[0]; + i = 0; + while (ch != 0x00) { + if (ch == '#') { + OPM_WriteInt(x); + } else { + OPM_Write(ch); + } + i += 1; + ch = s[__X(i, s__len)]; + } + __DEL(s); +} + +static INTEGER OPC_Length (CHAR *s, LONGINT s__len) +{ + INTEGER _o_result; + INTEGER i; + i = 0; + while (s[__X(i, s__len)] != 0x00) { + i += 1; + } + _o_result = i; + return _o_result; +} + +static INTEGER OPC_PerfectHash (CHAR *s, LONGINT s__len) +{ + INTEGER _o_result; + INTEGER i, h; + i = 0; + h = 0; + while ((s[__X(i, s__len)] != 0x00 && i < 5)) { + h = 3 * h + (int)s[__X(i, s__len)]; + i += 1; + } + _o_result = (int)__MOD(h, 105); + return _o_result; +} + +void OPC_Ident (OPT_Object obj) +{ + INTEGER mode, level, h; + mode = obj->mode; + level = obj->mnolev; + if ((__IN(mode, 0x62) && level > 0) || __IN(mode, 0x14)) { + OPM_WriteStringVar((void*)obj->name, ((LONGINT)(256))); + h = OPC_PerfectHash((void*)obj->name, ((LONGINT)(256))); + if (OPC_hashtab[__X(h, ((LONGINT)(105)))] >= 0) { + if (__STRCMP(OPC_keytab[__X(OPC_hashtab[__X(h, ((LONGINT)(105)))], ((LONGINT)(36)))], obj->name) == 0) { + OPM_Write('_'); + } + } + } else { + if (mode != 5 || obj->linkadr != 2) { + if (mode == 13) { + OPC_Ident(obj->link->typ->strobj); + } else if (level < 0) { + OPM_WriteStringVar((void*)OPT_GlbMod[__X(-level, ((LONGINT)(64)))]->name, ((LONGINT)(256))); + if (OPM_currFile == 0) { + OPT_GlbMod[__X(-level, ((LONGINT)(64)))]->vis = 1; + } + } else { + OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); + } + OPM_Write('_'); + } else if (obj == OPT_sysptrtyp->strobj || obj == OPT_bytetyp->strobj) { + OPM_WriteString((CHAR*)"SYSTEM_", (LONGINT)8); + } + OPM_WriteStringVar((void*)obj->name, ((LONGINT)(256))); + } +} + +static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause) +{ + INTEGER pointers; + *openClause = 0; + if (((typ->strobj == NIL || typ->strobj->name[0] == 0x00) && typ->comp != 4)) { + if (__IN(typ->comp, 0x0c)) { + OPC_Stars(typ->BaseTyp, &*openClause); + *openClause = typ->comp == 2; + } else if (typ->form == 14) { + OPM_Write('('); + OPM_Write('*'); + } else { + pointers = 0; + while (((typ->strobj == NIL || typ->strobj->name[0] == 0x00) && typ->form == 13)) { + pointers += 1; + typ = typ->BaseTyp; + } + if (pointers > 0) { + if (typ->comp != 3) { + OPC_Stars(typ, &*openClause); + } + if (*openClause) { + OPM_Write('('); + *openClause = 0; + } + while (pointers > 0) { + OPM_Write('*'); + pointers -= 1; + } + } + } + } +} + +static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef) +{ + OPT_Struct typ = NIL; + BOOLEAN varPar, openClause; + INTEGER form, comp; + typ = dcl->typ; + varPar = ((dcl->mode == 2 && typ->comp != 2) || typ->comp == 3) || scopeDef; + OPC_Stars(typ, &openClause); + if (varPar) { + if (openClause) { + OPM_Write('('); + } + OPM_Write('*'); + } + if (dcl->name[0] != 0x00) { + OPC_Ident(dcl); + } + if ((varPar && openClause)) { + OPM_Write(')'); + } + openClause = 0; + for (;;) { + form = typ->form; + comp = typ->comp; + if (((typ->strobj != NIL && typ->strobj->name[0] != 0x00) || form == 12) || comp == 4) { + break; + } else if ((form == 13 && typ->BaseTyp->comp != 3)) { + openClause = 1; + } else if (form == 14 || __IN(comp, 0x0c)) { + if (openClause) { + OPM_Write(')'); + openClause = 0; + } + if (form == 14) { + if (OPC_ansi) { + OPM_Write(')'); + OPC_AnsiParamList(typ->link, 0); + } else { + OPM_WriteString((CHAR*)")()", (LONGINT)4); + } + break; + } else if (comp == 2) { + OPM_Write('['); + OPM_WriteInt(typ->n); + OPM_Write(']'); + } + } else { + break; + } + typ = typ->BaseTyp; + } +} + +void OPC_Andent (OPT_Struct typ) +{ + if (typ->strobj == NIL || typ->align >= 65536) { + OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); + OPC_Str1((CHAR*)"__#", (LONGINT)4, __ASHR(typ->align, 16)); + } else { + OPC_Ident(typ->strobj); + } +} + +static BOOLEAN OPC_Undefined (OPT_Object obj) +{ + BOOLEAN _o_result; + _o_result = (((obj->mnolev >= 0 && obj->linkadr != (LONGINT)(3 + OPM_currFile))) && obj->linkadr != 2) || obj->name[0] == 0x00; + return _o_result; +} + +static void OPC_DeclareBase (OPT_Object dcl) +{ + OPT_Struct typ = NIL, prev = NIL; + OPT_Object obj = NIL; + INTEGER nofdims; + LONGINT off, n, dummy; + typ = dcl->typ; + prev = typ; + while ((((((((typ->strobj == NIL || typ->comp == 3) || OPC_Undefined(typ->strobj)) && typ->comp != 4)) && typ->form != 12)) && !((typ->form == 13 && typ->BaseTyp->comp == 3)))) { + prev = typ; + typ = typ->BaseTyp; + } + obj = typ->strobj; + if (typ->form == 12) { + OPM_WriteString((CHAR*)"void", (LONGINT)5); + } else if ((obj != NIL && !OPC_Undefined(obj))) { + OPC_Ident(obj); + } else if (typ->comp == 4) { + OPM_WriteString((CHAR*)"struct ", (LONGINT)8); + OPC_Andent(typ); + if ((prev->form != 13 && (obj != NIL || dcl->name[0] == 0x00))) { + if ((typ->BaseTyp != NIL && typ->BaseTyp->strobj->vis != 0)) { + OPM_WriteString((CHAR*)" { /* ", (LONGINT)7); + OPC_Ident(typ->BaseTyp->strobj); + OPM_WriteString((CHAR*)" */", (LONGINT)4); + OPM_WriteLn(); + OPC_Indent(1); + } else { + OPM_Write(' '); + OPC_BegBlk(); + } + OPC_FieldList(typ, 1, &off, &n, &dummy); + OPC_EndBlk0(); + } + } else if ((typ->form == 13 && typ->BaseTyp->comp == 3)) { + typ = typ->BaseTyp->BaseTyp; + nofdims = 1; + while (typ->comp == 3) { + nofdims += 1; + typ = typ->BaseTyp; + } + OPM_WriteString((CHAR*)"struct ", (LONGINT)8); + OPC_BegBlk(); + OPC_BegStat(); + OPC_Str1((CHAR*)"LONGINT len[#]", (LONGINT)15, nofdims); + OPC_EndStat(); + OPC_BegStat(); + __NEW(obj, OPT_ObjDesc); + __NEW(obj->typ, OPT_StrDesc); + obj->typ->form = 15; + obj->typ->comp = 2; + obj->typ->n = 1; + obj->typ->BaseTyp = typ; + obj->mode = 4; + __MOVE("data", obj->name, 5); + obj->linkadr = 0; + OPC_DeclareBase(obj); + OPM_Write(' '); + OPC_DeclareObj(obj, 0); + OPC_EndStat(); + OPC_EndBlk0(); + } +} + +LONGINT OPC_NofPtrs (OPT_Struct typ) +{ + LONGINT _o_result; + OPT_Object fld = NIL; + OPT_Struct btyp = NIL; + LONGINT n; + if ((typ->form == 13 && typ->sysflag == 0)) { + _o_result = 1; + return _o_result; + } else if ((typ->comp == 4 && __MASK(typ->sysflag, -256) == 0)) { + btyp = typ->BaseTyp; + if (btyp != NIL) { + n = OPC_NofPtrs(btyp); + } else { + n = 0; + } + fld = typ->link; + while ((fld != NIL && fld->mode == 4)) { + if (__STRCMP(fld->name, "@ptr") != 0) { + n = n + OPC_NofPtrs(fld->typ); + } else { + n += 1; + } + fld = fld->link; + } + _o_result = n; + return _o_result; + } else if (typ->comp == 2) { + btyp = typ->BaseTyp; + n = typ->n; + while (btyp->comp == 2) { + n = btyp->n * n; + btyp = btyp->BaseTyp; + } + _o_result = OPC_NofPtrs(btyp) * n; + return _o_result; + } else { + _o_result = 0; + return _o_result; + } + __RETCHK; +} + +static void OPC_PutPtrOffsets (OPT_Struct typ, LONGINT adr, LONGINT *cnt) +{ + OPT_Object fld = NIL; + OPT_Struct btyp = NIL; + LONGINT n, i; + if ((typ->form == 13 && typ->sysflag == 0)) { + OPM_WriteInt(adr); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + *cnt += 1; + if (__MASK(*cnt, -16) == 0) { + OPM_WriteLn(); + OPM_Write(0x09); + } + } else if ((typ->comp == 4 && __MASK(typ->sysflag, -256) == 0)) { + btyp = typ->BaseTyp; + if (btyp != NIL) { + OPC_PutPtrOffsets(btyp, adr, &*cnt); + } + fld = typ->link; + while ((fld != NIL && fld->mode == 4)) { + if (__STRCMP(fld->name, "@ptr") != 0) { + OPC_PutPtrOffsets(fld->typ, adr + fld->adr, &*cnt); + } else { + OPM_WriteInt(adr + fld->adr); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + *cnt += 1; + if (__MASK(*cnt, -16) == 0) { + OPM_WriteLn(); + OPM_Write(0x09); + } + } + fld = fld->link; + } + } else if (typ->comp == 2) { + btyp = typ->BaseTyp; + n = typ->n; + while (btyp->comp == 2) { + n = btyp->n * n; + btyp = btyp->BaseTyp; + } + if (OPC_NofPtrs(btyp) > 0) { + i = 0; + while (i < n) { + OPC_PutPtrOffsets(btyp, adr + i * btyp->size, &*cnt); + i += 1; + } + } + } +} + +static void OPC_InitTProcs (OPT_Object typ, OPT_Object obj) +{ + if (obj != NIL) { + OPC_InitTProcs(typ, obj->left); + if (obj->mode == 13) { + OPC_BegStat(); + OPM_WriteString((CHAR*)"__INITBP(", (LONGINT)10); + OPC_Ident(typ); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPC_Ident(obj); + OPC_Str1((CHAR*)", #)", (LONGINT)5, __ASHR(obj->adr, 16)); + OPC_EndStat(); + } + OPC_InitTProcs(typ, obj->right); + } +} + +static void OPC_PutBase (OPT_Struct typ) +{ + if (typ != NIL) { + OPC_PutBase(typ->BaseTyp); + OPC_Ident(typ->strobj); + OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + } +} + +static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName) +{ + OPT_Struct typ = NIL; + INTEGER dim; + if (showParamName) { + OPC_Ident(par); + OPM_WriteString((CHAR*)"__len", (LONGINT)6); + } + dim = 1; + typ = par->typ->BaseTyp; + while (typ->comp == 3) { + if (ansiDefine) { + OPM_WriteString((CHAR*)", LONGINT ", (LONGINT)11); + } else { + OPM_WriteString((CHAR*)", ", (LONGINT)3); + } + if (showParamName) { + OPC_Ident(par); + OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteInt(dim); + } + typ = typ->BaseTyp; + dim += 1; + } +} + +static void OPC_DeclareParams (OPT_Object par, BOOLEAN macro) +{ + OPM_Write('('); + while (par != NIL) { + if (macro) { + OPM_WriteStringVar((void*)par->name, ((LONGINT)(256))); + } else { + if ((par->mode == 1 && par->typ->form == 7)) { + OPM_Write('_'); + } + OPC_Ident(par); + } + if (par->typ->comp == 3) { + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPC_LenList(par, 0, 1); + } else if ((par->mode == 2 && par->typ->comp == 4)) { + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteStringVar((void*)par->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + } + par = par->link; + if (par != NIL) { + OPM_WriteString((CHAR*)", ", (LONGINT)3); + } + } + OPM_Write(')'); +} + +static void OPC_DefineTProcTypes (OPT_Object obj) +{ + OPT_Object par = NIL; + if (obj->typ != OPT_notyp) { + OPC_DefineType(obj->typ); + } + if (OPC_ansi) { + par = obj->link; + while (par != NIL) { + OPC_DefineType(par->typ); + par = par->link; + } + } +} + +static void OPC_DeclareTProcs (OPT_Object obj, BOOLEAN *empty) +{ + if (obj != NIL) { + OPC_DeclareTProcs(obj->left, &*empty); + if (obj->mode == 13) { + if (obj->typ != OPT_notyp) { + OPC_DefineType(obj->typ); + } + if (OPM_currFile == 0) { + if (obj->vis == 1) { + OPC_DefineTProcTypes(obj); + OPM_WriteString((CHAR*)"import ", (LONGINT)8); + *empty = 0; + OPC_ProcHeader(obj, 0); + } + } else { + *empty = 0; + OPC_DefineTProcTypes(obj); + if (obj->vis == 0) { + OPM_WriteString((CHAR*)"static ", (LONGINT)8); + } else { + OPM_WriteString((CHAR*)"export ", (LONGINT)8); + } + OPC_ProcHeader(obj, 0); + } + } + OPC_DeclareTProcs(obj->right, &*empty); + } +} + +OPT_Object OPC_BaseTProc (OPT_Object obj) +{ + OPT_Object _o_result; + OPT_Struct typ = NIL, base = NIL; + LONGINT mno; + typ = obj->link->typ; + if (typ->form == 13) { + typ = typ->BaseTyp; + } + base = typ->BaseTyp; + mno = __ASHR(obj->adr, 16); + while ((base != NIL && mno < base->n)) { + typ = base; + base = typ->BaseTyp; + } + OPT_FindField(obj->name, typ, &obj); + _o_result = obj; + return _o_result; +} + +static void OPC_DefineTProcMacros (OPT_Object obj, BOOLEAN *empty) +{ + if (obj != NIL) { + OPC_DefineTProcMacros(obj->left, &*empty); + if ((((obj->mode == 13 && obj == OPC_BaseTProc(obj))) && (OPM_currFile != 0 || obj->vis == 1))) { + OPM_WriteString((CHAR*)"#define __", (LONGINT)11); + OPC_Ident(obj); + OPC_DeclareParams(obj->link, 1); + OPM_WriteString((CHAR*)" __SEND(", (LONGINT)9); + if (obj->link->typ->form == 13) { + OPM_WriteString((CHAR*)"__TYPEOF(", (LONGINT)10); + OPC_Ident(obj->link); + OPM_Write(')'); + } else { + OPC_Ident(obj->link); + OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + } + OPC_Str1((CHAR*)", #, ", (LONGINT)6, __ASHR(obj->adr, 16)); + if (obj->typ == OPT_notyp) { + OPM_WriteString((CHAR*)"void", (LONGINT)5); + } else { + OPC_Ident(obj->typ->strobj); + } + OPM_WriteString((CHAR*)"(*)", (LONGINT)4); + if (OPC_ansi) { + OPC_AnsiParamList(obj->link, 0); + } else { + OPM_WriteString((CHAR*)"()", (LONGINT)3); + } + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPC_DeclareParams(obj->link, 1); + OPM_Write(')'); + OPM_WriteLn(); + } + OPC_DefineTProcMacros(obj->right, &*empty); + } +} + +static void OPC_DefineType (OPT_Struct str) +{ + OPT_Object obj = NIL, field = NIL, par = NIL; + BOOLEAN empty; + if (OPM_currFile == 1 || str->ref < 255) { + obj = str->strobj; + if (obj == NIL || OPC_Undefined(obj)) { + if (obj != NIL) { + if (obj->linkadr == 1) { + if (str->form != 13) { + OPM_Mark(244, str->txtpos); + obj->linkadr = 2; + } + } else { + obj->linkadr = 1; + } + } + if (str->comp == 4) { + if (str->BaseTyp != NIL) { + OPC_DefineType(str->BaseTyp); + } + field = str->link; + while ((field != NIL && field->mode == 4)) { + if (field->vis != 0 || OPM_currFile == 1) { + OPC_DefineType(field->typ); + } + field = field->link; + } + } else if (str->form == 13) { + if (str->BaseTyp->comp != 4) { + OPC_DefineType(str->BaseTyp); + } + } else if (__IN(str->comp, 0x0c)) { + OPC_DefineType(str->BaseTyp); + } else if (str->form == 14) { + if (str->BaseTyp != OPT_notyp) { + OPC_DefineType(str->BaseTyp); + } + field = str->link; + while (field != NIL) { + OPC_DefineType(field->typ); + field = field->link; + } + } + } + if ((obj != NIL && OPC_Undefined(obj))) { + OPM_WriteString((CHAR*)"typedef", (LONGINT)8); + OPM_WriteLn(); + OPM_Write(0x09); + OPC_Indent(1); + obj->linkadr = 1; + OPC_DeclareBase(obj); + OPM_Write(' '); + obj->typ->strobj = NIL; + OPC_DeclareObj(obj, 0); + obj->typ->strobj = obj; + obj->linkadr = 3 + OPM_currFile; + OPC_EndStat(); + OPC_Indent(-1); + OPM_WriteLn(); + if (obj->typ->comp == 4) { + empty = 1; + OPC_DeclareTProcs(str->link, &empty); + OPC_DefineTProcMacros(str->link, &empty); + if (!empty) { + OPM_WriteLn(); + } + } + } + } +} + +static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len) +{ + BOOLEAN _o_result; + INTEGER i; + BOOLEAN r; + __DUP(y, y__len, CHAR); + i = 0; + while ((*x)[__X(i + 1, ((LONGINT)(256)))] == y[__X(i, y__len)]) { + i += 1; + } + r = y[__X(i, y__len)] == 0x00; + _o_result = r; + __DEL(y); + return _o_result; +} + +static void OPC_CProcDefs (OPT_Object obj, INTEGER vis) +{ + INTEGER i; + OPT_ConstExt ext = NIL; + INTEGER _for__9; + if (obj != NIL) { + OPC_CProcDefs(obj->left, vis); + if ((((obj->mode == 9 && (int)obj->vis >= vis)) && obj->adr == 1)) { + ext = obj->conval->ext; + i = 1; + if (((*ext)[1] != '#' && !(OPC_Prefixed(ext, (CHAR*)"extern ", (LONGINT)8) || OPC_Prefixed(ext, (CHAR*)"import ", (LONGINT)8)))) { + OPM_WriteString((CHAR*)"#define ", (LONGINT)9); + OPC_Ident(obj); + OPC_DeclareParams(obj->link, 1); + OPM_Write(0x09); + } + _for__9 = (int)(*obj->conval->ext)[0]; + i = i; + while (i <= _for__9) { + OPM_Write((*obj->conval->ext)[__X(i, ((LONGINT)(256)))]); + i += 1; + } + OPM_WriteLn(); + } + OPC_CProcDefs(obj->right, vis); + } +} + +void OPC_TypeDefs (OPT_Object obj, INTEGER vis) +{ + if (obj != NIL) { + OPC_TypeDefs(obj->left, vis); + if ((obj->mode == 5 && obj->typ->txtpos > 0)) { + OPC_DefineType(obj->typ); + } + OPC_TypeDefs(obj->right, vis); + } +} + +static void OPC_DefAnonRecs (OPT_Node n) +{ + OPT_Object o = NIL; + OPT_Struct typ = NIL; + while ((n != NIL && n->class == 14)) { + typ = n->typ; + if ((typ->strobj == NIL && (OPM_currFile == 1 || typ->ref < 255))) { + OPC_DefineType(typ); + __NEW(o, OPT_ObjDesc); + o->typ = typ; + o->name[0] = 0x00; + OPC_DeclareBase(o); + OPC_EndStat(); + OPM_WriteLn(); + } + n = n->link; + } +} + +void OPC_TDescDecl (OPT_Struct typ) +{ + LONGINT nofptrs; + OPT_Object o = NIL; + OPC_BegStat(); + OPM_WriteString((CHAR*)"__TDESC(", (LONGINT)9); + OPC_Andent(typ); + OPC_Str1((CHAR*)", #", (LONGINT)4, typ->n + 1); + OPC_Str1((CHAR*)", #) = {__TDFLDS(", (LONGINT)18, OPC_NofPtrs(typ)); + OPM_Write('\"'); + if (typ->strobj != NIL) { + OPM_WriteStringVar((void*)typ->strobj->name, ((LONGINT)(256))); + } + OPC_Str1((CHAR*)"\", #), {", (LONGINT)9, typ->size); + nofptrs = 0; + OPC_PutPtrOffsets(typ, ((LONGINT)(0)), &nofptrs); + OPC_Str1((CHAR*)"#}}", (LONGINT)4, -((nofptrs + 1) * (LONGINT)OPM_LIntSize)); + OPC_EndStat(); +} + +void OPC_InitTDesc (OPT_Struct typ) +{ + OPC_BegStat(); + OPM_WriteString((CHAR*)"__INITYP(", (LONGINT)10); + OPC_Andent(typ); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + if (typ->BaseTyp != NIL) { + OPC_Andent(typ->BaseTyp); + } else { + OPC_Andent(typ); + } + OPC_Str1((CHAR*)", #)", (LONGINT)5, typ->extlev); + OPC_EndStat(); + if (typ->strobj != NIL) { + OPC_InitTProcs(typ->strobj, typ->link); + } +} + +void OPC_Align (LONGINT *adr, LONGINT base) +{ + switch (base) { + case 2: + *adr += __MASK(*adr, -2); + break; + case 4: + *adr += __MASK(-*adr, -4); + break; + case 8: + *adr += __MASK(-*adr, -8); + break; + case 16: + *adr += __MASK(-*adr, -16); + break; + default: + break; + } +} + +LONGINT OPC_Base (OPT_Struct typ) +{ + LONGINT _o_result; + switch (typ->form) { + case 1: + _o_result = 1; + return _o_result; + break; + case 3: + _o_result = OPM_CharAlign; + return _o_result; + break; + case 2: + _o_result = OPM_BoolAlign; + return _o_result; + break; + case 4: + _o_result = OPM_SIntAlign; + return _o_result; + break; + case 5: + _o_result = OPM_IntAlign; + return _o_result; + break; + case 6: + _o_result = OPM_LIntAlign; + return _o_result; + break; + case 7: + _o_result = OPM_RealAlign; + return _o_result; + break; + case 8: + _o_result = OPM_LRealAlign; + return _o_result; + break; + case 9: + _o_result = OPM_SetAlign; + return _o_result; + break; + case 13: + _o_result = OPM_PointerAlign; + return _o_result; + break; + case 14: + _o_result = OPM_ProcAlign; + return _o_result; + break; + case 15: + if (typ->comp == 4) { + _o_result = __MASK(typ->align, -65536); + return _o_result; + } else { + _o_result = OPC_Base(typ->BaseTyp); + return _o_result; + } + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPC.Base, typ^form = ", (LONGINT)40); + OPM_LogWNum(typ->form, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + __RETCHK; +} + +static void OPC_FillGap (LONGINT gap, LONGINT off, LONGINT align, LONGINT *n, LONGINT *curAlign) +{ + LONGINT adr; + adr = off; + OPC_Align(&adr, align); + if ((*curAlign < align && gap - (adr - off) >= align)) { + gap -= (adr - off) + align; + OPC_BegStat(); + if (align == (LONGINT)OPM_IntSize) { + OPM_WriteString((CHAR*)"INTEGER", (LONGINT)8); + } else if (align == (LONGINT)OPM_LIntSize) { + OPM_WriteString((CHAR*)"LONGINT", (LONGINT)8); + } else if (align == (LONGINT)OPM_LRealSize) { + OPM_WriteString((CHAR*)"LONGREAL", (LONGINT)9); + } + OPC_Str1((CHAR*)" _prvt#", (LONGINT)8, *n); + *n += 1; + OPC_EndStat(); + *curAlign = align; + } + if (gap > 0) { + OPC_BegStat(); + OPC_Str1((CHAR*)"char _prvt#", (LONGINT)12, *n); + *n += 1; + OPC_Str1((CHAR*)"[#]", (LONGINT)4, gap); + OPC_EndStat(); + } +} + +static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, LONGINT *off, LONGINT *n, LONGINT *curAlign) +{ + OPT_Object fld = NIL; + OPT_Struct base = NIL; + LONGINT gap, adr, align, fldAlign; + fld = typ->link; + align = __MASK(typ->align, -65536); + if (typ->BaseTyp != NIL) { + OPC_FieldList(typ->BaseTyp, 0, &*off, &*n, &*curAlign); + } else { + *off = 0; + *n = 0; + *curAlign = 1; + } + while ((fld != NIL && fld->mode == 4)) { + if ((OPM_currFile == 0 && fld->vis == 0) || (((OPM_currFile == 1 && fld->vis == 0)) && typ->mno != 0)) { + fld = fld->link; + while ((((fld != NIL && fld->mode == 4)) && fld->vis == 0)) { + fld = fld->link; + } + } else { + adr = *off; + fldAlign = OPC_Base(fld->typ); + OPC_Align(&adr, fldAlign); + gap = fld->adr - adr; + if (fldAlign > *curAlign) { + *curAlign = fldAlign; + } + if (gap > 0) { + OPC_FillGap(gap, *off, align, &*n, &*curAlign); + } + OPC_BegStat(); + OPC_DeclareBase(fld); + OPM_Write(' '); + OPC_DeclareObj(fld, 0); + *off = fld->adr + fld->typ->size; + base = fld->typ; + fld = fld->link; + while ((((((((fld != NIL && fld->mode == 4)) && fld->typ == base)) && fld->adr == *off)) && ((OPM_currFile == 1 || fld->vis != 0) || fld->typ->strobj == NIL))) { + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPC_DeclareObj(fld, 0); + *off = fld->adr + fld->typ->size; + fld = fld->link; + } + OPC_EndStat(); + } + } + if (last) { + adr = typ->size - (LONGINT)__ASHR(typ->sysflag, 8); + if (adr == 0) { + gap = 1; + } else { + gap = adr - *off; + } + if (gap > 0) { + OPC_FillGap(gap, *off, align, &*n, &*curAlign); + } + } +} + +static void OPC_IdentList (OPT_Object obj, INTEGER vis) +{ + OPT_Struct base = NIL; + BOOLEAN first; + INTEGER lastvis; + base = NIL; + first = 1; + while ((obj != NIL && obj->mode != 13)) { + if ((__IN(vis, 0x05) || (vis == 1 && obj->vis != 0)) || (vis == 3 && !obj->leaf)) { + if (obj->typ != base || (int)obj->vis != lastvis) { + if (!first) { + OPC_EndStat(); + } + first = 0; + base = obj->typ; + lastvis = obj->vis; + OPC_BegStat(); + if ((vis == 1 && obj->vis != 0)) { + OPM_WriteString((CHAR*)"import ", (LONGINT)8); + } else if ((obj->mnolev == 0 && vis == 0)) { + if (obj->vis == 0) { + OPM_WriteString((CHAR*)"static ", (LONGINT)8); + } else { + OPM_WriteString((CHAR*)"export ", (LONGINT)8); + } + } + if ((((vis == 2 && obj->mode == 1)) && base->form == 7)) { + OPM_WriteString((CHAR*)"double", (LONGINT)7); + } else { + OPC_DeclareBase(obj); + } + } else { + OPM_Write(','); + } + OPM_Write(' '); + if ((((vis == 2 && obj->mode == 1)) && base->form == 7)) { + OPM_Write('_'); + } + OPC_DeclareObj(obj, vis == 3); + if (obj->typ->comp == 3) { + OPC_EndStat(); + OPC_BegStat(); + base = OPT_linttyp; + OPM_WriteString((CHAR*)"LONGINT ", (LONGINT)9); + OPC_LenList(obj, 0, 1); + } else if ((obj->mode == 2 && obj->typ->comp == 4)) { + OPC_EndStat(); + OPC_BegStat(); + OPM_WriteString((CHAR*)"LONGINT *", (LONGINT)10); + OPC_Ident(obj); + OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + base = NIL; + } else if ((((((OPC_ptrinit && vis == 0)) && obj->mnolev > 0)) && obj->typ->form == 13)) { + OPM_WriteString((CHAR*)" = NIL", (LONGINT)7); + } + } + obj = obj->link; + } + if (!first) { + OPC_EndStat(); + } +} + +static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames) +{ + CHAR name[32]; + OPM_Write('('); + if (obj == NIL || obj->mode == 13) { + OPM_WriteString((CHAR*)"void", (LONGINT)5); + } else { + for (;;) { + OPC_DeclareBase(obj); + if (showParamNames) { + OPM_Write(' '); + OPC_DeclareObj(obj, 0); + } else { + __COPY(obj->name, name, ((LONGINT)(32))); + obj->name[0] = 0x00; + OPC_DeclareObj(obj, 0); + __COPY(name, obj->name, ((LONGINT)(256))); + } + if (obj->typ->comp == 3) { + OPM_WriteString((CHAR*)", LONGINT ", (LONGINT)11); + OPC_LenList(obj, 1, showParamNames); + } else if ((obj->mode == 2 && obj->typ->comp == 4)) { + OPM_WriteString((CHAR*)", LONGINT *", (LONGINT)12); + if (showParamNames) { + OPC_Ident(obj); + OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + } + } + if (obj->link == NIL || obj->link->mode == 13) { + break; + } + OPM_WriteString((CHAR*)", ", (LONGINT)3); + obj = obj->link; + } + } + OPM_Write(')'); +} + +static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define) +{ + if (proc->typ == OPT_notyp) { + OPM_WriteString((CHAR*)"void", (LONGINT)5); + } else { + OPC_Ident(proc->typ->strobj); + } + OPM_Write(' '); + OPC_Ident(proc); + OPM_Write(' '); + if (OPC_ansi) { + OPC_AnsiParamList(proc->link, 1); + if (!define) { + OPM_Write(';'); + } + OPM_WriteLn(); + } else if (define) { + OPC_DeclareParams(proc->link, 0); + OPM_WriteLn(); + OPC_Indent(1); + OPC_IdentList(proc->link, 2); + OPC_Indent(-1); + } else { + OPM_WriteString((CHAR*)"();", (LONGINT)4); + OPM_WriteLn(); + } +} + +static void OPC_ProcPredefs (OPT_Object obj, SHORTINT vis) +{ + if (obj != NIL) { + OPC_ProcPredefs(obj->left, vis); + if ((((__IN(obj->mode, 0xc0) && obj->vis >= vis)) && (obj->history != 4 || obj->mode == 6))) { + if (vis == 1) { + OPM_WriteString((CHAR*)"import ", (LONGINT)8); + } else if (obj->vis == 0) { + OPM_WriteString((CHAR*)"static ", (LONGINT)8); + } else { + OPM_WriteString((CHAR*)"export ", (LONGINT)8); + } + OPC_ProcHeader(obj, 0); + } + OPC_ProcPredefs(obj->right, vis); + } +} + +static void OPC_Include (CHAR *name, LONGINT name__len) +{ + __DUP(name, name__len, CHAR); + OPM_WriteString((CHAR*)"#include ", (LONGINT)10); + OPM_Write('\"'); + OPM_WriteStringVar((void*)name, name__len); + OPM_WriteString((CHAR*)".h", (LONGINT)3); + OPM_Write('\"'); + OPM_WriteLn(); + __DEL(name); +} + +static void OPC_IncludeImports (OPT_Object obj, INTEGER vis) +{ + if (obj != NIL) { + OPC_IncludeImports(obj->left, vis); + if ((((obj->mode == 11 && obj->mnolev != 0)) && (int)OPT_GlbMod[__X(-obj->mnolev, ((LONGINT)(64)))]->vis >= vis)) { + OPC_Include(OPT_GlbMod[__X(-obj->mnolev, ((LONGINT)(64)))]->name, ((LONGINT)(256))); + } + OPC_IncludeImports(obj->right, vis); + } +} + +static void OPC_GenDynTypes (OPT_Node n, INTEGER vis) +{ + OPT_Struct typ = NIL; + while ((n != NIL && n->class == 14)) { + typ = n->typ; + if (vis == 0 || typ->ref < 255) { + OPC_BegStat(); + if (vis == 1) { + OPM_WriteString((CHAR*)"import ", (LONGINT)8); + } else if ((typ->strobj != NIL && typ->strobj->mnolev > 0)) { + OPM_WriteString((CHAR*)"static ", (LONGINT)8); + } else { + OPM_WriteString((CHAR*)"export ", (LONGINT)8); + } + OPM_WriteString((CHAR*)"LONGINT *", (LONGINT)10); + OPC_Andent(typ); + OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPC_EndStat(); + } + n = n->link; + } +} + +void OPC_GenHdr (OPT_Node n) +{ + OPM_currFile = 0; + OPC_DefAnonRecs(n); + OPC_TypeDefs(OPT_topScope->right, 1); + OPM_WriteLn(); + OPC_IdentList(OPT_topScope->scope, 1); + OPM_WriteLn(); + OPC_GenDynTypes(n, 1); + OPM_WriteLn(); + OPC_ProcPredefs(OPT_topScope->right, 1); + OPM_WriteString((CHAR*)"import ", (LONGINT)8); + OPM_WriteString((CHAR*)"void *", (LONGINT)7); + OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); + OPM_WriteString(OPC_BodyNameExt, ((LONGINT)(13))); + OPC_EndStat(); + OPM_WriteLn(); + OPC_CProcDefs(OPT_topScope->right, 1); + OPM_WriteLn(); + OPM_WriteString((CHAR*)"#endif", (LONGINT)7); + OPM_WriteLn(); +} + +static void OPC_GenHeaderMsg (void) +{ + INTEGER i; + OPM_WriteString((CHAR*)"/*", (LONGINT)3); + OPM_WriteString((CHAR*)" voc ", (LONGINT)6); + OPM_Write(' '); + OPM_WriteString((CHAR*)"1.2 [2016/06/15] for gcc LP64 on cygwin", (LONGINT)40); + OPM_Write(' '); + i = 0; + while (i <= 31) { + if (__IN(i, OPM_glbopt)) { + switch (i) { + case 0: + OPM_Write('x'); + break; + case 2: + OPM_Write('r'); + break; + case 3: + OPM_Write('t'); + break; + case 4: + OPM_Write('s'); + break; + case 5: + OPM_Write('p'); + break; + case 6: + OPM_Write('k'); + break; + case 7: + OPM_Write('a'); + break; + case 9: + OPM_Write('e'); + break; + case 10: + OPM_Write('m'); + break; + case 13: + OPM_Write('S'); + break; + case 14: + OPM_Write('c'); + break; + case 15: + OPM_Write('M'); + break; + case 16: + OPM_Write('f'); + break; + case 17: + OPM_Write('F'); + break; + case 18: + OPM_Write('v'); + break; + default: + OPM_LogWStr((CHAR*)"( more options defined in OPM than checked in OPC.GenHeaderMsg, if you are a compiler developer, add them to OPC.GenHeaderMsg", (LONGINT)126); + OPM_LogWLn(); + break; + } + } + i += 1; + } + OPM_WriteString((CHAR*)" */", (LONGINT)4); + OPM_WriteLn(); +} + +void OPC_GenHdrIncludes (void) +{ + OPM_currFile = 2; + OPC_GenHeaderMsg(); + OPM_WriteLn(); + OPM_WriteString((CHAR*)"#ifndef ", (LONGINT)9); + OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); + OPM_WriteString((CHAR*)"__h", (LONGINT)4); + OPM_WriteLn(); + OPM_WriteString((CHAR*)"#define ", (LONGINT)9); + OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); + OPM_WriteString((CHAR*)"__h", (LONGINT)4); + OPM_WriteLn(); + OPM_WriteLn(); + if (OPM_LIntSize == 8) { + OPM_WriteString((CHAR*)"#define LARGE", (LONGINT)14); + OPM_WriteLn(); + } + OPC_Include((CHAR*)"SYSTEM", (LONGINT)7); + OPC_IncludeImports(OPT_topScope->right, 1); + OPM_WriteLn(); +} + +void OPC_GenBdy (OPT_Node n) +{ + OPM_currFile = 1; + OPC_GenHeaderMsg(); + if (OPM_LIntSize == 8) { + OPM_WriteString((CHAR*)"#define LARGE", (LONGINT)14); + OPM_WriteLn(); + } + OPC_Include((CHAR*)"SYSTEM", (LONGINT)7); + OPC_IncludeImports(OPT_topScope->right, 0); + OPM_WriteLn(); + OPC_DefAnonRecs(n); + OPC_TypeDefs(OPT_topScope->right, 0); + OPM_WriteLn(); + OPC_IdentList(OPT_topScope->scope, 0); + OPM_WriteLn(); + OPC_GenDynTypes(n, 0); + OPM_WriteLn(); + OPC_ProcPredefs(OPT_topScope->right, 0); + OPM_WriteLn(); + OPC_CProcDefs(OPT_topScope->right, 0); + OPM_WriteLn(); +} + +static void OPC_RegCmds (OPT_Object obj) +{ + if (obj != NIL) { + OPC_RegCmds(obj->left); + if ((obj->mode == 7 && obj->history != 4)) { + if ((((obj->vis != 0 && obj->link == NIL)) && obj->typ == OPT_notyp)) { + OPC_BegStat(); + OPM_WriteString((CHAR*)"__REGCMD(\"", (LONGINT)11); + OPM_WriteStringVar((void*)obj->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"\", ", (LONGINT)4); + OPC_Ident(obj); + OPM_Write(')'); + OPC_EndStat(); + } + } + OPC_RegCmds(obj->right); + } +} + +static void OPC_InitImports (OPT_Object obj) +{ + if (obj != NIL) { + OPC_InitImports(obj->left); + if ((obj->mode == 11 && obj->mnolev != 0)) { + OPC_BegStat(); + OPM_WriteString((CHAR*)"__MODULE_IMPORT(", (LONGINT)17); + OPM_WriteStringVar((void*)OPT_GlbMod[__X(-obj->mnolev, ((LONGINT)(64)))]->name, ((LONGINT)(256))); + OPM_Write(')'); + OPC_EndStat(); + } + OPC_InitImports(obj->right); + } +} + +void OPC_GenEnumPtrs (OPT_Object var) +{ + OPT_Struct typ = NIL; + LONGINT n; + OPC_GlbPtrs = 0; + while (var != NIL) { + typ = var->typ; + if (OPC_NofPtrs(typ) > 0) { + if (!OPC_GlbPtrs) { + OPC_GlbPtrs = 1; + OPM_WriteString((CHAR*)"static ", (LONGINT)8); + if (OPC_ansi) { + OPM_WriteString((CHAR*)"void EnumPtrs(void (*P)(void*))", (LONGINT)32); + } else { + OPM_WriteString((CHAR*)"void EnumPtrs(P)", (LONGINT)17); + OPM_WriteLn(); + OPM_Write(0x09); + OPM_WriteString((CHAR*)"void (*P)();", (LONGINT)13); + } + OPM_WriteLn(); + OPC_BegBlk(); + } + OPC_BegStat(); + if (typ->form == 13) { + OPM_WriteString((CHAR*)"P(", (LONGINT)3); + OPC_Ident(var); + OPM_Write(')'); + } else if (typ->comp == 4) { + OPM_WriteString((CHAR*)"__ENUMR(&", (LONGINT)10); + OPC_Ident(var); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPC_Andent(typ); + OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPC_Str1((CHAR*)", #", (LONGINT)4, typ->size); + OPM_WriteString((CHAR*)", 1, P)", (LONGINT)8); + } else if (typ->comp == 2) { + n = typ->n; + typ = typ->BaseTyp; + while (typ->comp == 2) { + n = n * typ->n; + typ = typ->BaseTyp; + } + if (typ->form == 13) { + OPM_WriteString((CHAR*)"__ENUMP(", (LONGINT)9); + OPC_Ident(var); + OPC_Str1((CHAR*)", #, P)", (LONGINT)8, n); + } else if (typ->comp == 4) { + OPM_WriteString((CHAR*)"__ENUMR(", (LONGINT)9); + OPC_Ident(var); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPC_Andent(typ); + OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPC_Str1((CHAR*)", #", (LONGINT)4, typ->size); + OPC_Str1((CHAR*)", #, P)", (LONGINT)8, n); + } + } + OPC_EndStat(); + } + var = var->link; + } + if (OPC_GlbPtrs) { + OPC_EndBlk(); + OPM_WriteLn(); + } +} + +void OPC_EnterBody (void) +{ + OPM_WriteLn(); + OPM_WriteString((CHAR*)"export ", (LONGINT)8); + if (OPC_mainprog) { + if (OPC_ansi) { + OPM_WriteString((CHAR*)"int main(int argc, char **argv)", (LONGINT)32); + OPM_WriteLn(); + } else { + OPM_WriteString((CHAR*)"main(argc, argv)", (LONGINT)17); + OPM_WriteLn(); + OPM_Write(0x09); + OPM_WriteString((CHAR*)"int argc; char **argv;", (LONGINT)23); + OPM_WriteLn(); + } + } else { + OPM_WriteString((CHAR*)"void *", (LONGINT)7); + OPM_WriteString(OPM_modName, ((LONGINT)(32))); + OPM_WriteString(OPC_BodyNameExt, ((LONGINT)(13))); + OPM_WriteLn(); + } + OPC_BegBlk(); + OPC_BegStat(); + if (OPC_mainprog) { + OPM_WriteString((CHAR*)"__INIT(argc, argv)", (LONGINT)19); + } else { + OPM_WriteString((CHAR*)"__DEFMOD", (LONGINT)9); + } + OPC_EndStat(); + if ((OPC_mainprog && 0)) { + OPC_BegStat(); + OPM_WriteString((CHAR*)"/*don`t do it!*/ printf(\"DEMO VERSION: DO NOT USE THIS PROGRAM FOR ANY COMMERCIAL PURPOSE\\n\")", (LONGINT)94); + OPC_EndStat(); + } + OPC_InitImports(OPT_topScope->right); + OPC_BegStat(); + if (OPC_mainprog) { + OPM_WriteString((CHAR*)"__REGMAIN(\"", (LONGINT)12); + } else { + OPM_WriteString((CHAR*)"__REGMOD(\"", (LONGINT)11); + } + OPM_WriteString(OPM_modName, ((LONGINT)(32))); + if (OPC_GlbPtrs) { + OPM_WriteString((CHAR*)"\", EnumPtrs)", (LONGINT)13); + } else { + OPM_WriteString((CHAR*)"\", 0)", (LONGINT)6); + } + OPC_EndStat(); + if (__STRCMP(OPM_modName, "SYSTEM") != 0) { + OPC_RegCmds(OPT_topScope); + } +} + +void OPC_ExitBody (void) +{ + OPC_BegStat(); + if (OPC_mainprog) { + OPM_WriteString((CHAR*)"__FINI;", (LONGINT)8); + } else { + OPM_WriteString((CHAR*)"__ENDMOD;", (LONGINT)10); + } + OPM_WriteLn(); + OPC_EndBlk(); +} + +void OPC_DefineInter (OPT_Object proc) +{ + OPT_Object scope = NIL; + scope = proc->scope; + OPM_WriteString((CHAR*)"static ", (LONGINT)8); + OPM_WriteString((CHAR*)"struct ", (LONGINT)8); + OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); + OPM_Write(' '); + OPC_BegBlk(); + OPC_IdentList(proc->link, 3); + OPC_IdentList(scope->scope, 3); + OPC_BegStat(); + OPM_WriteString((CHAR*)"struct ", (LONGINT)8); + OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); + OPM_Write(' '); + OPM_Write('*'); + OPM_WriteString((CHAR*)"lnk", (LONGINT)4); + OPC_EndStat(); + OPC_EndBlk0(); + OPM_Write(' '); + OPM_Write('*'); + OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPC_EndStat(); + OPM_WriteLn(); + OPC_ProcPredefs(scope->right, 0); + OPM_WriteLn(); +} + +void OPC_EnterProc (OPT_Object proc) +{ + OPT_Object var = NIL, scope = NIL; + OPT_Struct typ = NIL; + INTEGER dim; + if (proc->vis != 1) { + OPM_WriteString((CHAR*)"static ", (LONGINT)8); + } + OPC_ProcHeader(proc, 1); + OPC_BegBlk(); + if (proc->typ != OPT_notyp) { + OPC_BegStat(); + OPC_Ident(proc->typ->strobj); + OPM_WriteString((CHAR*)" _o_result;", (LONGINT)12); + OPM_WriteLn(); + } + scope = proc->scope; + OPC_IdentList(scope->scope, 0); + if (!scope->leaf) { + OPC_BegStat(); + OPM_WriteString((CHAR*)"struct ", (LONGINT)8); + OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); + OPM_Write(' '); + OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPC_EndStat(); + } + var = proc->link; + while (var != NIL) { + if ((var->typ->comp == 2 && var->mode == 1)) { + OPC_BegStat(); + if (var->typ->strobj == NIL) { + OPM_Mark(200, var->typ->txtpos); + } else { + OPC_Ident(var->typ->strobj); + } + OPM_Write(' '); + OPC_Ident(var); + OPM_WriteString((CHAR*)"__copy", (LONGINT)7); + OPC_EndStat(); + } + var = var->link; + } + if (!OPC_ansi) { + var = proc->link; + while (var != NIL) { + if ((var->typ->form == 7 && var->mode == 1)) { + OPC_BegStat(); + OPC_Ident(var->typ->strobj); + OPM_Write(' '); + OPC_Ident(var); + OPM_WriteString((CHAR*)" = _", (LONGINT)5); + OPC_Ident(var); + OPC_EndStat(); + } + var = var->link; + } + } + var = proc->link; + while (var != NIL) { + if ((((__IN(var->typ->comp, 0x0c) && var->mode == 1)) && var->typ->sysflag == 0)) { + OPC_BegStat(); + if (var->typ->comp == 2) { + OPM_WriteString((CHAR*)"__DUPARR(", (LONGINT)10); + OPC_Ident(var); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + if (var->typ->strobj == NIL) { + OPM_Mark(200, var->typ->txtpos); + } else { + OPC_Ident(var->typ->strobj); + } + } else { + OPM_WriteString((CHAR*)"__DUP(", (LONGINT)7); + OPC_Ident(var); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPC_Ident(var); + OPM_WriteString((CHAR*)"__len", (LONGINT)6); + typ = var->typ->BaseTyp; + dim = 1; + while (typ->comp == 3) { + OPM_WriteString((CHAR*)" * ", (LONGINT)4); + OPC_Ident(var); + OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteInt(dim); + typ = typ->BaseTyp; + dim += 1; + } + OPM_WriteString((CHAR*)", ", (LONGINT)3); + if (typ->strobj == NIL) { + OPM_Mark(200, typ->txtpos); + } else { + OPC_Ident(typ->strobj); + } + } + OPM_Write(')'); + OPC_EndStat(); + } + var = var->link; + } + if (!scope->leaf) { + var = proc->link; + while (var != NIL) { + if (!var->leaf) { + OPC_BegStat(); + OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_Write('.'); + OPC_Ident(var); + OPM_WriteString((CHAR*)" = ", (LONGINT)4); + if (__IN(var->typ->comp, 0x0c)) { + OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + } else if (var->mode != 2) { + OPM_Write('&'); + } + OPC_Ident(var); + if (var->typ->comp == 3) { + typ = var->typ; + dim = 0; + do { + OPM_WriteString((CHAR*)"; ", (LONGINT)3); + OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_Write('.'); + OPC_Ident(var); + OPM_WriteString((CHAR*)"__len", (LONGINT)6); + if (dim != 0) { + OPM_WriteInt(dim); + } + OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPC_Ident(var); + OPM_WriteString((CHAR*)"__len", (LONGINT)6); + if (dim != 0) { + OPM_WriteInt(dim); + } + typ = typ->BaseTyp; + } while (!(typ->comp != 3)); + } else if ((var->mode == 2 && var->typ->comp == 4)) { + OPM_WriteString((CHAR*)"; ", (LONGINT)3); + OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_Write('.'); + OPC_Ident(var); + OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPC_Ident(var); + OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + } + OPC_EndStat(); + } + var = var->link; + } + var = scope->scope; + while (var != NIL) { + if (!var->leaf) { + OPC_BegStat(); + OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_Write('.'); + OPC_Ident(var); + OPM_WriteString((CHAR*)" = ", (LONGINT)4); + if (var->typ->comp != 2) { + OPM_Write('&'); + } else { + OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + } + OPC_Ident(var); + OPC_EndStat(); + } + var = var->link; + } + OPC_BegStat(); + OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_Write('.'); + OPM_WriteString((CHAR*)"lnk", (LONGINT)4); + OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPC_EndStat(); + OPC_BegStat(); + OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_Write('&'); + OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPC_EndStat(); + } +} + +void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet) +{ + OPT_Object var = NIL; + BOOLEAN indent; + indent = eoBlock; + if ((implicitRet && proc->typ != OPT_notyp)) { + OPM_Write(0x09); + OPM_WriteString((CHAR*)"__RETCHK;", (LONGINT)10); + OPM_WriteLn(); + } else if (!eoBlock || implicitRet) { + if (!proc->scope->leaf) { + if (indent) { + OPC_BegStat(); + } else { + indent = 1; + } + OPM_WriteStringVar((void*)proc->scope->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_Write('.'); + OPM_WriteString((CHAR*)"lnk", (LONGINT)4); + OPC_EndStat(); + } + var = proc->link; + while (var != NIL) { + if ((((var->typ->comp == 3 && var->mode == 1)) && var->typ->sysflag == 0)) { + if (indent) { + OPC_BegStat(); + } else { + indent = 1; + } + OPM_WriteString((CHAR*)"__DEL(", (LONGINT)7); + OPC_Ident(var); + OPM_Write(')'); + OPC_EndStat(); + } + var = var->link; + } + } + if (eoBlock) { + OPC_EndBlk(); + OPM_WriteLn(); + } else if (indent) { + OPC_BegStat(); + } +} + +void OPC_CompleteIdent (OPT_Object obj) +{ + INTEGER comp, level; + level = obj->mnolev; + if (obj->adr == 1) { + if (obj->typ->comp == 4) { + OPC_Ident(obj); + OPM_WriteString((CHAR*)"__", (LONGINT)3); + } else { + OPM_WriteString((CHAR*)"((", (LONGINT)3); + OPC_Ident(obj->typ->strobj); + OPM_Write(')'); + OPC_Ident(obj); + OPM_Write(')'); + } + } else if ((level != OPM_level && level > 0)) { + comp = obj->typ->comp; + if ((obj->mode != 2 && comp != 3)) { + OPM_Write('*'); + } + OPM_WriteStringVar((void*)obj->scope->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"->", (LONGINT)3); + OPC_Ident(obj); + } else { + OPC_Ident(obj); + } +} + +void OPC_TypeOf (OPT_Object ap) +{ + INTEGER i; + __ASSERT(ap->typ->comp == 4, 0); + if (ap->mode == 2) { + if ((int)ap->mnolev != OPM_level) { + OPM_WriteStringVar((void*)ap->scope->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"_s->", (LONGINT)5); + OPC_Ident(ap); + } else { + OPC_Ident(ap); + } + OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + } else if (ap->typ->strobj != NIL) { + OPC_Ident(ap->typ->strobj); + OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + } else { + OPC_Andent(ap->typ); + } +} + +void OPC_Cmp (INTEGER rel) +{ + switch (rel) { + case 9: + OPM_WriteString((CHAR*)" == ", (LONGINT)5); + break; + case 10: + OPM_WriteString((CHAR*)" != ", (LONGINT)5); + break; + case 11: + OPM_WriteString((CHAR*)" < ", (LONGINT)4); + break; + case 12: + OPM_WriteString((CHAR*)" <= ", (LONGINT)5); + break; + case 13: + OPM_WriteString((CHAR*)" > ", (LONGINT)4); + break; + case 14: + OPM_WriteString((CHAR*)" >= ", (LONGINT)5); + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPC.Cmp, rel = ", (LONGINT)34); + OPM_LogWNum(rel, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } +} + +void OPC_Case (LONGINT caseVal, INTEGER form) +{ + CHAR ch; + OPM_WriteString((CHAR*)"case ", (LONGINT)6); + switch (form) { + case 3: + ch = (CHAR)caseVal; + if ((ch >= ' ' && ch <= '~')) { + OPM_Write('\''); + if (((ch == '\\' || ch == '\?') || ch == '\'') || ch == '\"') { + OPM_Write('\\'); + OPM_Write(ch); + } else { + OPM_Write(ch); + } + OPM_Write('\''); + } else { + OPM_WriteString((CHAR*)"0x", (LONGINT)3); + OPM_WriteHex(caseVal); + } + break; + case 4: case 5: case 6: + OPM_WriteInt(caseVal); + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPC.Case, form = ", (LONGINT)36); + OPM_LogWNum(form, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + OPM_WriteString((CHAR*)": ", (LONGINT)3); +} + +void OPC_SetInclude (BOOLEAN exclude) +{ + if (exclude) { + OPM_WriteString((CHAR*)" &= ~", (LONGINT)6); + } else { + OPM_WriteString((CHAR*)" |= ", (LONGINT)5); + } +} + +void OPC_Increment (BOOLEAN decrement) +{ + if (decrement) { + OPM_WriteString((CHAR*)" -= ", (LONGINT)5); + } else { + OPM_WriteString((CHAR*)" += ", (LONGINT)5); + } +} + +void OPC_Halt (LONGINT n) +{ + OPC_Str1((CHAR*)"__HALT(#)", (LONGINT)10, n); +} + +void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim) +{ + if (array->comp == 3) { + OPC_CompleteIdent(obj); + OPM_WriteString((CHAR*)"__len", (LONGINT)6); + if (dim != 0) { + OPM_WriteInt(dim); + } + } else { + while (dim > 0) { + array = array->BaseTyp; + dim -= 1; + } + OPM_WriteString((CHAR*)"((LONGINT)(", (LONGINT)12); + OPM_WriteInt(array->n); + OPM_WriteString((CHAR*)"))", (LONGINT)3); + } +} + +void OPC_Constant (OPT_Const con, INTEGER form) +{ + INTEGER i, len; + CHAR ch; + SET s; + LONGINT hex; + BOOLEAN skipLeading; + switch (form) { + case 1: + OPM_WriteInt(con->intval); + break; + case 2: + OPM_WriteInt(con->intval); + break; + case 3: + ch = (CHAR)con->intval; + if ((ch >= ' ' && ch <= '~')) { + OPM_Write('\''); + if (((ch == '\\' || ch == '\?') || ch == '\'') || ch == '\"') { + OPM_Write('\\'); + } + OPM_Write(ch); + OPM_Write('\''); + } else { + OPM_WriteString((CHAR*)"0x", (LONGINT)3); + OPM_WriteHex(con->intval); + } + break; + case 4: case 5: case 6: + OPM_WriteInt(con->intval); + break; + case 7: + OPM_WriteReal(con->realval, 'f'); + break; + case 8: + OPM_WriteReal(con->realval, 0x00); + break; + case 9: + OPM_WriteString((CHAR*)"0x", (LONGINT)3); + skipLeading = 1; + s = con->setval; + i = 32; + do { + hex = 0; + do { + i -= 1; + hex = __ASHL(hex, 1); + if (__IN(i, s)) { + hex += 1; + } + } while (!(__MASK(i, -8) == 0)); + if (hex != 0 || !skipLeading) { + OPM_WriteHex(hex); + skipLeading = 0; + } + } while (!(i == 0)); + if (skipLeading) { + OPM_Write('0'); + } + break; + case 10: + OPM_Write('\"'); + len = (int)con->intval2 - 1; + i = 0; + while (i < len) { + ch = (*con->ext)[__X(i, ((LONGINT)(256)))]; + if (((ch == '\\' || ch == '\?') || ch == '\'') || ch == '\"') { + OPM_Write('\\'); + } + OPM_Write(ch); + i += 1; + } + OPM_Write('\"'); + break; + case 11: + OPM_WriteString((CHAR*)"NIL", (LONGINT)4); + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPC.Constant, form = ", (LONGINT)40); + OPM_LogWNum(form, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } +} + +static struct InitKeywords__47 { + SHORTINT *n; + struct InitKeywords__47 *lnk; +} *InitKeywords__47_s; + +static void Enter__48 (CHAR *s, LONGINT s__len); + +static void Enter__48 (CHAR *s, LONGINT s__len) +{ + INTEGER h; + __DUP(s, s__len, CHAR); + h = OPC_PerfectHash((void*)s, s__len); + OPC_hashtab[__X(h, ((LONGINT)(105)))] = *InitKeywords__47_s->n; + __COPY(s, OPC_keytab[__X(*InitKeywords__47_s->n, ((LONGINT)(36)))], ((LONGINT)(9))); + *InitKeywords__47_s->n += 1; + __DEL(s); +} + +static void OPC_InitKeywords (void) +{ + SHORTINT n, i; + struct InitKeywords__47 _s; + _s.n = &n; + _s.lnk = InitKeywords__47_s; + InitKeywords__47_s = &_s; + n = 0; + i = 0; + while (i <= 104) { + OPC_hashtab[__X(i, ((LONGINT)(105)))] = -1; + i += 1; + } + Enter__48((CHAR*)"asm", (LONGINT)4); + Enter__48((CHAR*)"auto", (LONGINT)5); + Enter__48((CHAR*)"break", (LONGINT)6); + Enter__48((CHAR*)"case", (LONGINT)5); + Enter__48((CHAR*)"char", (LONGINT)5); + Enter__48((CHAR*)"const", (LONGINT)6); + Enter__48((CHAR*)"continue", (LONGINT)9); + Enter__48((CHAR*)"default", (LONGINT)8); + Enter__48((CHAR*)"do", (LONGINT)3); + Enter__48((CHAR*)"double", (LONGINT)7); + Enter__48((CHAR*)"else", (LONGINT)5); + Enter__48((CHAR*)"enum", (LONGINT)5); + Enter__48((CHAR*)"extern", (LONGINT)7); + Enter__48((CHAR*)"export", (LONGINT)7); + Enter__48((CHAR*)"float", (LONGINT)6); + Enter__48((CHAR*)"for", (LONGINT)4); + Enter__48((CHAR*)"fortran", (LONGINT)8); + Enter__48((CHAR*)"goto", (LONGINT)5); + Enter__48((CHAR*)"if", (LONGINT)3); + Enter__48((CHAR*)"import", (LONGINT)7); + Enter__48((CHAR*)"int", (LONGINT)4); + Enter__48((CHAR*)"long", (LONGINT)5); + Enter__48((CHAR*)"register", (LONGINT)9); + Enter__48((CHAR*)"return", (LONGINT)7); + Enter__48((CHAR*)"short", (LONGINT)6); + Enter__48((CHAR*)"signed", (LONGINT)7); + Enter__48((CHAR*)"sizeof", (LONGINT)7); + Enter__48((CHAR*)"static", (LONGINT)7); + Enter__48((CHAR*)"struct", (LONGINT)7); + Enter__48((CHAR*)"switch", (LONGINT)7); + Enter__48((CHAR*)"typedef", (LONGINT)8); + Enter__48((CHAR*)"union", (LONGINT)6); + Enter__48((CHAR*)"unsigned", (LONGINT)9); + Enter__48((CHAR*)"void", (LONGINT)5); + Enter__48((CHAR*)"volatile", (LONGINT)9); + Enter__48((CHAR*)"while", (LONGINT)6); + InitKeywords__47_s = _s.lnk; +} + + +export void *OPC__init(void) +{ + __DEFMOD; + __MODULE_IMPORT(Configuration); + __MODULE_IMPORT(OPM); + __MODULE_IMPORT(OPT); + __REGMOD("OPC", 0); + __REGCMD("BegBlk", OPC_BegBlk); + __REGCMD("BegStat", OPC_BegStat); + __REGCMD("EndBlk", OPC_EndBlk); + __REGCMD("EndBlk0", OPC_EndBlk0); + __REGCMD("EndStat", OPC_EndStat); + __REGCMD("EnterBody", OPC_EnterBody); + __REGCMD("ExitBody", OPC_ExitBody); + __REGCMD("GenHdrIncludes", OPC_GenHdrIncludes); + __REGCMD("Init", OPC_Init); +/* BEGIN */ + OPC_InitKeywords(); + __ENDMOD; +} diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h new file mode 100644 index 00000000..713ea3b2 --- /dev/null +++ b/bootstrap/unix-44/OPC.h @@ -0,0 +1,49 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ + +#ifndef OPC__h +#define OPC__h + +#include "SYSTEM.h" +#include "OPT.h" + + + + +import void OPC_Align (LONGINT *adr, LONGINT base); +import void OPC_Andent (OPT_Struct typ); +import LONGINT OPC_Base (OPT_Struct typ); +import OPT_Object OPC_BaseTProc (OPT_Object obj); +import void OPC_BegBlk (void); +import void OPC_BegStat (void); +import void OPC_Case (LONGINT caseVal, INTEGER form); +import void OPC_Cmp (INTEGER rel); +import void OPC_CompleteIdent (OPT_Object obj); +import void OPC_Constant (OPT_Const con, INTEGER form); +import void OPC_DefineInter (OPT_Object proc); +import void OPC_EndBlk (void); +import void OPC_EndBlk0 (void); +import void OPC_EndStat (void); +import void OPC_EnterBody (void); +import void OPC_EnterProc (OPT_Object proc); +import void OPC_ExitBody (void); +import void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet); +import void OPC_GenBdy (OPT_Node n); +import void OPC_GenEnumPtrs (OPT_Object var); +import void OPC_GenHdr (OPT_Node n); +import void OPC_GenHdrIncludes (void); +import void OPC_Halt (LONGINT n); +import void OPC_Ident (OPT_Object obj); +import void OPC_Increment (BOOLEAN decrement); +import void OPC_Indent (INTEGER count); +import void OPC_Init (void); +import void OPC_InitTDesc (OPT_Struct typ); +import void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim); +import LONGINT OPC_NofPtrs (OPT_Struct typ); +import void OPC_SetInclude (BOOLEAN exclude); +import void OPC_TDescDecl (OPT_Struct typ); +import void OPC_TypeDefs (OPT_Object obj, INTEGER vis); +import void OPC_TypeOf (OPT_Object ap); +import void *OPC__init(void); + + +#endif diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c new file mode 100644 index 00000000..3d68d2be --- /dev/null +++ b/bootstrap/unix-44/OPM.c @@ -0,0 +1,1091 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +#include "SYSTEM.h" +#include "Configuration.h" +#include "Console.h" +#include "Files.h" +#include "Platform.h" +#include "Strings.h" +#include "Texts.h" +#include "errors.h" +#include "vt100.h" + +typedef + CHAR OPM_FileName[32]; + + +static CHAR OPM_SourceFileName[256]; +export INTEGER OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_CharAlign, OPM_BoolAlign, OPM_SIntAlign, OPM_IntAlign, OPM_LIntAlign, OPM_SetAlign, OPM_RealAlign, OPM_LRealAlign, OPM_PointerAlign, OPM_ProcAlign, OPM_RecAlign, OPM_MaxSet; +export LONGINT OPM_MinSInt, OPM_MinInt, OPM_MinLInt, OPM_MaxSInt, OPM_MaxInt, OPM_MaxLInt, OPM_MaxIndex; +export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; +export BOOLEAN OPM_noerr; +export LONGINT OPM_curpos, OPM_errpos, OPM_breakpc; +export INTEGER OPM_currFile, OPM_level, OPM_pc, OPM_entno; +export CHAR OPM_modName[32]; +export CHAR OPM_objname[64]; +export SET OPM_opt, OPM_glbopt; +static LONGINT OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; +static Texts_Reader OPM_inR; +static Texts_Text OPM_Log; +static Texts_Writer OPM_W; +static Files_Rider OPM_oldSF, OPM_newSF; +static Files_Rider OPM_R[3]; +static Files_File OPM_oldSFile, OPM_newSFile, OPM_HFile, OPM_BFile, OPM_HIFile; +static INTEGER OPM_S; +export BOOLEAN OPM_dontAsm, OPM_dontLink, OPM_mainProg, OPM_mainLinkStat, OPM_notColorOutput, OPM_forceNewSym, OPM_Verbose; +static CHAR OPM_OBERON[1024]; +static CHAR OPM_MODULES[1024]; + + +static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F); +export void OPM_CloseFiles (void); +export void OPM_CloseOldSym (void); +export void OPM_DeleteNewSym (void); +export void OPM_FPrint (LONGINT *fp, LONGINT val); +export void OPM_FPrintLReal (LONGINT *fp, LONGREAL lr); +export void OPM_FPrintReal (LONGINT *fp, REAL real); +export void OPM_FPrintSet (LONGINT *fp, SET set); +static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, LONGINT pos); +export void OPM_Get (CHAR *ch); +static void OPM_GetProperties (void); +static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONGINT name__len, INTEGER *size, INTEGER *align); +export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); +export void OPM_InitOptions (void); +static void OPM_LogErrMsg (INTEGER n); +export void OPM_LogW (CHAR ch); +export void OPM_LogWLn (void); +export void OPM_LogWNum (LONGINT i, LONGINT len); +export void OPM_LogWStr (CHAR *s, LONGINT s__len); +static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len); +export void OPM_Mark (INTEGER n, LONGINT pos); +static INTEGER OPM_Min (INTEGER a, INTEGER b); +export void OPM_NewSym (CHAR *modName, LONGINT modName__len); +export void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); +export void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); +export BOOLEAN OPM_OpenPar (void); +export void OPM_RegisterNewSym (void); +static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt); +static void OPM_ShowLine (LONGINT pos); +export void OPM_SymRCh (CHAR *ch); +export LONGINT OPM_SymRInt (void); +export void OPM_SymRLReal (LONGREAL *lr); +export void OPM_SymRReal (REAL *r); +export void OPM_SymRSet (SET *s); +export void OPM_SymWCh (CHAR ch); +export void OPM_SymWInt (LONGINT i); +export void OPM_SymWLReal (LONGREAL lr); +export void OPM_SymWReal (REAL r); +export void OPM_SymWSet (SET s); +static void OPM_VerboseListSizes (void); +export void OPM_Write (CHAR ch); +export void OPM_WriteHex (LONGINT i); +export void OPM_WriteInt (LONGINT i); +export void OPM_WriteLn (void); +export void OPM_WriteReal (LONGREAL r, CHAR suffx); +export void OPM_WriteString (CHAR *s, LONGINT s__len); +export void OPM_WriteStringVar (CHAR *s, LONGINT s__len); +export BOOLEAN OPM_eofSF (void); +export void OPM_err (INTEGER n); +static LONGINT OPM_minus (LONGINT i); +static LONGINT OPM_power0 (LONGINT i, LONGINT j); + + +void OPM_LogW (CHAR ch) +{ + Console_Char(ch); +} + +void OPM_LogWStr (CHAR *s, LONGINT s__len) +{ + __DUP(s, s__len, CHAR); + Console_String(s, s__len); + __DEL(s); +} + +void OPM_LogWNum (LONGINT i, LONGINT len) +{ + Console_Int(i, len); +} + +void OPM_LogWLn (void) +{ + Console_Ln(); +} + +static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) +{ + INTEGER i; + i = 1; + while (s[__X(i, s__len)] != 0x00) { + switch (s[__X(i, s__len)]) { + case 'e': + *opt = *opt ^ 0x0200; + break; + case 's': + *opt = *opt ^ 0x10; + break; + case 'm': + *opt = *opt ^ 0x0400; + break; + case 'x': + *opt = *opt ^ 0x01; + break; + case 'r': + *opt = *opt ^ 0x04; + break; + case 't': + *opt = *opt ^ 0x08; + break; + case 'a': + *opt = *opt ^ 0x80; + break; + case 'k': + *opt = *opt ^ 0x40; + break; + case 'p': + *opt = *opt ^ 0x20; + break; + case 'S': + *opt = *opt ^ 0x2000; + break; + case 'c': + *opt = *opt ^ 0x4000; + break; + case 'M': + *opt = *opt ^ 0x8000; + break; + case 'f': + *opt = *opt ^ 0x010000; + break; + case 'F': + *opt = *opt ^ 0x020000; + break; + case 'V': + *opt = *opt ^ 0x040000; + break; + case 'B': + if (s[__X(i + 1, s__len)] != 0x00) { + i += 1; + OPM_IntSize = (int)s[__X(i, s__len)] - 48; + } + if (s[__X(i + 1, s__len)] != 0x00) { + i += 1; + OPM_PointerSize = (int)s[__X(i, s__len)] - 48; + } + if (s[__X(i + 1, s__len)] != 0x00) { + i += 1; + OPM_Alignment = (int)s[__X(i, s__len)] - 48; + } + __ASSERT(OPM_IntSize == 2 || OPM_IntSize == 4, 0); + __ASSERT(OPM_PointerSize == 4 || OPM_PointerSize == 8, 0); + __ASSERT(OPM_Alignment == 4 || OPM_Alignment == 8, 0); + break; + default: + OPM_LogWStr((CHAR*)" warning: option ", (LONGINT)19); + OPM_LogW('-'); + OPM_LogW(s[__X(i, s__len)]); + OPM_LogWStr((CHAR*)" ignored", (LONGINT)9); + OPM_LogWLn(); + break; + } + i += 1; + } +} + +BOOLEAN OPM_OpenPar (void) +{ + BOOLEAN _o_result; + CHAR s[256]; + if (Platform_ArgCount == 1) { + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Vishap Oberon-2 compiler v", (LONGINT)27); + OPM_LogWStr((CHAR*)"1.2 [2016/06/15] for gcc LP64 on cygwin", (LONGINT)40); + OPM_LogW('.'); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Based on Ofront by Software Templ OEG, continued by Norayr Chilingarian and others.", (LONGINT)84); + OPM_LogWLn(); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Usage:", (LONGINT)7); + OPM_LogWLn(); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" ", (LONGINT)3); + OPM_LogWStr((CHAR*)"voc", (LONGINT)4); + OPM_LogWStr((CHAR*)" options {files {options}}.", (LONGINT)28); + OPM_LogWLn(); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Where options = [\"-\" {option} ].", (LONGINT)33); + OPM_LogWLn(); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" m - generate code for main module", (LONGINT)36); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" M - generate code for main module and link object statically", (LONGINT)63); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" s - generate new symbol file", (LONGINT)31); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" e - allow extending the module interface", (LONGINT)43); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" r - check value ranges", (LONGINT)25); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" x - turn off array indices check", (LONGINT)35); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" a - don\'t check ASSERTs at runtime, use this option in tested production code", (LONGINT)80); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" p - turn off automatic pointer initialization", (LONGINT)48); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" t - don\'t check type guards (use in rare cases such as low-level modules where every cycle counts)", (LONGINT)101); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" S - don\'t call external assembler/compiler, only generate C code", (LONGINT)67); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" c - don\'t call linker", (LONGINT)24); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" f - don\'t use color output", (LONGINT)29); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" F - force writing new symbol file in current directory", (LONGINT)57); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" V - verbose output", (LONGINT)21); + OPM_LogWLn(); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Initial options specify defaults for all files.", (LONGINT)48); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Options following a filename are specific to that file.", (LONGINT)56); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Repeating an option toggles its value.", (LONGINT)39); + OPM_LogWLn(); + _o_result = 0; + return _o_result; + } else { + OPM_S = 1; + s[0] = 0x00; + Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + OPM_glbopt = 0xe9; + while (s[0] == '-') { + OPM_ScanOptions((void*)s, ((LONGINT)(256)), &OPM_glbopt); + OPM_S += 1; + s[0] = 0x00; + Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + } + _o_result = 1; + return _o_result; + } + __RETCHK; +} + +void OPM_InitOptions (void) +{ + CHAR s[256]; + OPM_opt = OPM_glbopt; + s[0] = 0x00; + Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + while (s[0] == '-') { + OPM_ScanOptions((void*)s, ((LONGINT)(256)), &OPM_opt); + OPM_S += 1; + s[0] = 0x00; + Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + } + OPM_dontAsm = __IN(13, OPM_opt); + OPM_dontLink = __IN(14, OPM_opt); + OPM_mainProg = __IN(10, OPM_opt); + OPM_mainLinkStat = __IN(15, OPM_opt); + OPM_notColorOutput = __IN(16, OPM_opt); + OPM_forceNewSym = __IN(17, OPM_opt); + OPM_Verbose = __IN(18, OPM_opt); + if (OPM_mainLinkStat) { + OPM_glbopt |= __SETOF(10); + } + OPM_GetProperties(); +} + +void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len) +{ + Texts_Text T = NIL; + LONGINT beg, end, time; + CHAR s[256]; + *done = 0; + OPM_curpos = 0; + if (OPM_S >= Platform_ArgCount) { + return; + } + s[0] = 0x00; + Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + __NEW(T, Texts_TextDesc); + Texts_Open(T, s, ((LONGINT)(256))); + OPM_LogWStr(s, ((LONGINT)(256))); + OPM_LogWStr((CHAR*)" ", (LONGINT)3); + __COPY(s, mname, mname__len); + __COPY(s, OPM_SourceFileName, ((LONGINT)(256))); + if (T->len == 0) { + OPM_LogWStr(s, ((LONGINT)(256))); + OPM_LogWStr((CHAR*)" not found.", (LONGINT)12); + OPM_LogWLn(); + } else { + Texts_OpenReader(&OPM_inR, Texts_Reader__typ, T, ((LONGINT)(0))); + *done = 1; + } + OPM_S += 1; + OPM_level = 0; + OPM_noerr = 1; + OPM_errpos = OPM_curpos; + OPM_lasterrpos = OPM_curpos - 10; + OPM_ErrorLineStartPos = 0; + OPM_ErrorLineLimitPos = 0; + OPM_ErrorLineNumber = 0; +} + +void OPM_Get (CHAR *ch) +{ + Texts_Read(&OPM_inR, Texts_Reader__typ, &*ch); + if (*ch == 0x0d) { + OPM_curpos = Texts_Pos(&OPM_inR, Texts_Reader__typ); + } else { + OPM_curpos += 1; + } + if ((*ch < 0x09 && !OPM_inR.eot)) { + *ch = ' '; + } +} + +static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len) +{ + INTEGER i, j; + CHAR ch; + __DUP(ext, ext__len, CHAR); + i = 0; + for (;;) { + ch = name[__X(i, name__len)]; + if (ch == 0x00) { + break; + } + FName[__X(i, FName__len)] = ch; + i += 1; + } + j = 0; + do { + ch = ext[__X(j, ext__len)]; + FName[__X(i, FName__len)] = ch; + i += 1; + j += 1; + } while (!(ch == 0x00)); + __DEL(ext); +} + +static void OPM_LogErrMsg (INTEGER n) +{ + Texts_Scanner S; + Texts_Text T = NIL; + CHAR ch; + INTEGER i; + CHAR buf[1024]; + if (n >= 0) { + if (!OPM_notColorOutput) { + vt100_SetAttr((CHAR*)"31m", (LONGINT)4); + } + OPM_LogWStr((CHAR*)" err ", (LONGINT)7); + if (!OPM_notColorOutput) { + vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + } + } else { + if (!OPM_notColorOutput) { + vt100_SetAttr((CHAR*)"35m", (LONGINT)4); + } + OPM_LogWStr((CHAR*)" warning ", (LONGINT)11); + n = -n; + if (!OPM_notColorOutput) { + vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + } + } + OPM_LogWNum(n, ((LONGINT)(1))); + OPM_LogWStr((CHAR*)" ", (LONGINT)3); + OPM_LogWStr(errors_errors[__X(n, ((LONGINT)(350)))], ((LONGINT)(128))); +} + +static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, LONGINT pos) +{ + CHAR ch, cheol; + if (pos < OPM_ErrorLineStartPos) { + OPM_ErrorLineStartPos = 0; + OPM_ErrorLineLimitPos = 0; + OPM_ErrorLineNumber = 0; + } + if (pos < OPM_ErrorLineLimitPos) { + Files_Set(&*r, r__typ, f, OPM_ErrorLineStartPos); + return; + } + Files_Set(&*r, r__typ, f, OPM_ErrorLineLimitPos); + Files_Read(&*r, r__typ, (void*)&ch); + while ((OPM_ErrorLineLimitPos < pos && !(*r).eof)) { + OPM_ErrorLineStartPos = OPM_ErrorLineLimitPos; + OPM_ErrorLineNumber += 1; + while ((((ch != 0x00 && ch != 0x0d)) && ch != 0x0a)) { + Files_Read(&*r, r__typ, (void*)&ch); + OPM_ErrorLineLimitPos += 1; + } + cheol = ch; + Files_Read(&*r, r__typ, (void*)&ch); + OPM_ErrorLineLimitPos += 1; + if ((cheol == 0x0d && ch == 0x0a)) { + OPM_ErrorLineLimitPos += 1; + Files_Read(&*r, r__typ, (void*)&ch); + } + } + Files_Set(&*r, r__typ, f, OPM_ErrorLineStartPos); +} + +static void OPM_ShowLine (LONGINT pos) +{ + Files_File f = NIL; + Files_Rider r; + CHAR line[1023]; + INTEGER i; + CHAR ch; + f = Files_Old(OPM_SourceFileName, ((LONGINT)(256))); + OPM_FindLine(f, &r, Files_Rider__typ, pos); + i = 0; + Files_Read(&r, Files_Rider__typ, (void*)&ch); + while ((((((ch != 0x00 && ch != 0x0d)) && ch != 0x0a)) && i < 1022)) { + line[__X(i, ((LONGINT)(1023)))] = ch; + i += 1; + Files_Read(&r, Files_Rider__typ, (void*)&ch); + } + line[__X(i, ((LONGINT)(1023)))] = 0x00; + OPM_LogWLn(); + OPM_LogWLn(); + OPM_LogWNum(OPM_ErrorLineNumber, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)": ", (LONGINT)3); + OPM_LogWStr(line, ((LONGINT)(1023))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" ", (LONGINT)7); + if (pos >= OPM_ErrorLineLimitPos) { + pos = OPM_ErrorLineLimitPos - 1; + } + i = (int)(pos - OPM_ErrorLineStartPos); + while (i > 0) { + OPM_LogW(' '); + i -= 1; + } + if (!OPM_notColorOutput) { + vt100_SetAttr((CHAR*)"32m", (LONGINT)4); + } + OPM_LogW('^'); + if (!OPM_notColorOutput) { + vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + } + Files_Close(f); +} + +void OPM_Mark (INTEGER n, LONGINT pos) +{ + if (pos == -1) { + pos = 0; + } + if (n >= 0) { + OPM_noerr = 0; + if (pos < OPM_lasterrpos || OPM_lasterrpos + 9 < pos) { + OPM_lasterrpos = pos; + OPM_ShowLine(pos); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" ", (LONGINT)3); + if (n < 249) { + OPM_LogWStr((CHAR*)" pos", (LONGINT)6); + OPM_LogWNum(pos, ((LONGINT)(6))); + OPM_LogErrMsg(n); + } else if (n == 255) { + OPM_LogWStr((CHAR*)"pos", (LONGINT)4); + OPM_LogWNum(pos, ((LONGINT)(6))); + OPM_LogWStr((CHAR*)" pc ", (LONGINT)6); + OPM_LogWNum(OPM_breakpc, ((LONGINT)(1))); + } else if (n == 254) { + OPM_LogWStr((CHAR*)"pc not found", (LONGINT)13); + } else { + OPM_LogWStr(OPM_objname, ((LONGINT)(64))); + if (n == 253) { + OPM_LogWStr((CHAR*)" is new, compile with option e", (LONGINT)31); + } else if (n == 252) { + OPM_LogWStr((CHAR*)" is redefined, compile with option s", (LONGINT)37); + } else if (n == 251) { + OPM_LogWStr((CHAR*)" is redefined (private part only), compile with option s", (LONGINT)57); + } else if (n == 250) { + OPM_LogWStr((CHAR*)" is no longer visible, compile with option s", (LONGINT)45); + } else if (n == 249) { + OPM_LogWStr((CHAR*)" is not consistently imported, recompile imports", (LONGINT)49); + } + } + } + } else { + if (pos >= 0) { + OPM_ShowLine(pos); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" pos", (LONGINT)6); + OPM_LogWNum(pos, ((LONGINT)(6))); + } + OPM_LogErrMsg(n); + if (pos < 0) { + OPM_LogWLn(); + } + } +} + +void OPM_err (INTEGER n) +{ + OPM_Mark(n, OPM_errpos); +} + +void OPM_FPrint (LONGINT *fp, LONGINT val) +{ + *fp = __ROTL((LONGINT)((SET)*fp ^ (SET)val), 1, LONGINT); +} + +void OPM_FPrintSet (LONGINT *fp, SET set) +{ + OPM_FPrint(&*fp, (LONGINT)set); +} + +void OPM_FPrintReal (LONGINT *fp, REAL real) +{ + OPM_FPrint(&*fp, __VAL(LONGINT, real)); +} + +void OPM_FPrintLReal (LONGINT *fp, LONGREAL lr) +{ + LONGINT l, h; + __GET((LONGINT)(uintptr_t)&lr, l, LONGINT); + __GET((LONGINT)(uintptr_t)&lr + 4, h, LONGINT); + OPM_FPrint(&*fp, l); + OPM_FPrint(&*fp, h); +} + +static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONGINT name__len, INTEGER *size, INTEGER *align) +{ + __DUP(name, name__len, CHAR); + if (((*S).class == 1 && __STRCMP((*S).s, name) == 0)) { + Texts_Scan(&*S, S__typ); + if ((*S).class == 3) { + *size = (int)(*S).i; + Texts_Scan(&*S, S__typ); + } else { + OPM_Mark(-157, ((LONGINT)(-1))); + } + if ((*S).class == 3) { + *align = (int)(*S).i; + Texts_Scan(&*S, S__typ); + } else { + OPM_Mark(-157, ((LONGINT)(-1))); + } + } else { + OPM_Mark(-157, ((LONGINT)(-1))); + } + __DEL(name); +} + +static LONGINT OPM_minus (LONGINT i) +{ + LONGINT _o_result; + _o_result = -i; + return _o_result; +} + +static LONGINT OPM_power0 (LONGINT i, LONGINT j) +{ + LONGINT _o_result; + LONGINT k, p; + k = 1; + p = i; + do { + p = p * i; + k += 1; + } while (!(k == j)); + _o_result = p; + return _o_result; +} + +static void OPM_VerboseListSizes (void) +{ + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Type Size Alignement", (LONGINT)29); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"CHAR ", (LONGINT)14); + OPM_LogWNum(OPM_CharSize, ((LONGINT)(4))); + OPM_LogWNum(OPM_CharAlign, ((LONGINT)(5))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"BOOLEAN ", (LONGINT)14); + OPM_LogWNum(OPM_BoolSize, ((LONGINT)(4))); + OPM_LogWNum(OPM_BoolAlign, ((LONGINT)(5))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"SHORTINT ", (LONGINT)14); + OPM_LogWNum(OPM_SIntSize, ((LONGINT)(4))); + OPM_LogWNum(OPM_SIntAlign, ((LONGINT)(5))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"INTEGER ", (LONGINT)14); + OPM_LogWNum(OPM_IntSize, ((LONGINT)(4))); + OPM_LogWNum(OPM_IntAlign, ((LONGINT)(5))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"LONGINT ", (LONGINT)14); + OPM_LogWNum(OPM_LIntSize, ((LONGINT)(4))); + OPM_LogWNum(OPM_LIntAlign, ((LONGINT)(5))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"SET ", (LONGINT)14); + OPM_LogWNum(OPM_SetSize, ((LONGINT)(4))); + OPM_LogWNum(OPM_SetAlign, ((LONGINT)(5))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"REAL ", (LONGINT)14); + OPM_LogWNum(OPM_RealSize, ((LONGINT)(4))); + OPM_LogWNum(OPM_RealAlign, ((LONGINT)(5))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"LONGREAL ", (LONGINT)14); + OPM_LogWNum(OPM_LRealSize, ((LONGINT)(4))); + OPM_LogWNum(OPM_LRealAlign, ((LONGINT)(5))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"PTR ", (LONGINT)14); + OPM_LogWNum(OPM_PointerSize, ((LONGINT)(4))); + OPM_LogWNum(OPM_PointerAlign, ((LONGINT)(5))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"PROC ", (LONGINT)14); + OPM_LogWNum(OPM_ProcSize, ((LONGINT)(4))); + OPM_LogWNum(OPM_ProcAlign, ((LONGINT)(5))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"RECORD ", (LONGINT)14); + OPM_LogWNum(OPM_RecSize, ((LONGINT)(4))); + OPM_LogWNum(OPM_RecAlign, ((LONGINT)(5))); + OPM_LogWLn(); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Min shortint ", (LONGINT)14); + OPM_LogWNum(OPM_MinSInt, ((LONGINT)(4))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Max shortint ", (LONGINT)14); + OPM_LogWNum(OPM_MaxSInt, ((LONGINT)(4))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Min integer ", (LONGINT)14); + OPM_LogWNum(OPM_MinInt, ((LONGINT)(4))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Max integer ", (LONGINT)14); + OPM_LogWNum(OPM_MaxInt, ((LONGINT)(4))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Min longint ", (LONGINT)14); + OPM_LogWNum(OPM_MinLInt, ((LONGINT)(4))); + OPM_LogWLn(); +} + +static INTEGER OPM_Min (INTEGER a, INTEGER b) +{ + INTEGER _o_result; + if (a < b) { + _o_result = a; + return _o_result; + } else { + _o_result = b; + return _o_result; + } + __RETCHK; +} + +static void OPM_GetProperties (void) +{ + LONGINT base; + OPM_ProcSize = OPM_PointerSize; + OPM_LIntSize = __ASHL(OPM_IntSize, 1); + OPM_SetSize = OPM_LIntSize; + OPM_CharAlign = OPM_Min(OPM_Alignment, OPM_CharSize); + OPM_BoolAlign = OPM_Min(OPM_Alignment, OPM_BoolSize); + OPM_SIntAlign = OPM_Min(OPM_Alignment, OPM_SIntSize); + OPM_RecAlign = OPM_Min(OPM_Alignment, OPM_RecSize); + OPM_RealAlign = OPM_Min(OPM_Alignment, OPM_RealSize); + OPM_LRealAlign = OPM_Min(OPM_Alignment, OPM_LRealSize); + OPM_PointerAlign = OPM_Min(OPM_Alignment, OPM_PointerSize); + OPM_ProcAlign = OPM_Min(OPM_Alignment, OPM_ProcSize); + OPM_IntAlign = OPM_Min(OPM_Alignment, OPM_IntSize); + OPM_LIntAlign = OPM_Min(OPM_Alignment, OPM_LIntSize); + OPM_SetAlign = OPM_Min(OPM_Alignment, OPM_SetSize); + base = -2; + OPM_MinSInt = __ASH(base, __ASHL(OPM_SIntSize, 3) - 2); + OPM_MaxSInt = OPM_minus(OPM_MinSInt + 1); + OPM_MinInt = __ASH(base, __ASHL(OPM_IntSize, 3) - 2); + OPM_MaxInt = OPM_minus(OPM_MinInt + 1); + OPM_MinLInt = __ASH(base, __ASHL(OPM_LIntSize, 3) - 2); + OPM_MaxLInt = OPM_minus(OPM_MinLInt + 1); + if (OPM_RealSize == 4) { + OPM_MaxReal = 3.40282346000000e+038; + } else if (OPM_RealSize == 8) { + OPM_MaxReal = 1.79769296342094e+308; + } + if (OPM_LRealSize == 4) { + OPM_MaxLReal = 3.40282346000000e+038; + } else if (OPM_LRealSize == 8) { + OPM_MaxLReal = 1.79769296342094e+308; + } + OPM_MinReal = -OPM_MaxReal; + OPM_MinLReal = -OPM_MaxLReal; + OPM_MaxSet = __ASHL(OPM_SetSize, 3) - 1; + OPM_MaxIndex = OPM_MaxLInt; + if (OPM_Verbose) { + OPM_VerboseListSizes(); + } +} + +void OPM_SymRCh (CHAR *ch) +{ + Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&*ch); +} + +LONGINT OPM_SymRInt (void) +{ + LONGINT _o_result; + LONGINT k; + Files_ReadNum(&OPM_oldSF, Files_Rider__typ, &k); + _o_result = k; + return _o_result; +} + +void OPM_SymRSet (SET *s) +{ + Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (LONGINT*)&*s); +} + +void OPM_SymRReal (REAL *r) +{ + Files_ReadReal(&OPM_oldSF, Files_Rider__typ, &*r); +} + +void OPM_SymRLReal (LONGREAL *lr) +{ + Files_ReadLReal(&OPM_oldSF, Files_Rider__typ, &*lr); +} + +void OPM_CloseOldSym (void) +{ +} + +void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done) +{ + CHAR ch; + OPM_FileName fileName; + OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, ((LONGINT)(32)), (CHAR*)".sym", (LONGINT)5); + OPM_oldSFile = Files_Old(fileName, ((LONGINT)(32))); + *done = OPM_oldSFile != NIL; + if (*done) { + Files_Set(&OPM_oldSF, Files_Rider__typ, OPM_oldSFile, ((LONGINT)(0))); + Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&ch); + if (ch != 0xf7) { + OPM_err(-306); + OPM_CloseOldSym(); + *done = 0; + } + } +} + +BOOLEAN OPM_eofSF (void) +{ + BOOLEAN _o_result; + _o_result = OPM_oldSF.eof; + return _o_result; +} + +void OPM_SymWCh (CHAR ch) +{ + Files_Write(&OPM_newSF, Files_Rider__typ, ch); +} + +void OPM_SymWInt (LONGINT i) +{ + Files_WriteNum(&OPM_newSF, Files_Rider__typ, i); +} + +void OPM_SymWSet (SET s) +{ + Files_WriteNum(&OPM_newSF, Files_Rider__typ, (LONGINT)s); +} + +void OPM_SymWReal (REAL r) +{ + Files_WriteReal(&OPM_newSF, Files_Rider__typ, r); +} + +void OPM_SymWLReal (LONGREAL lr) +{ + Files_WriteLReal(&OPM_newSF, Files_Rider__typ, lr); +} + +void OPM_RegisterNewSym (void) +{ + if (__STRCMP(OPM_modName, "SYSTEM") != 0 || __IN(10, OPM_opt)) { + Files_Register(OPM_newSFile); + } +} + +void OPM_DeleteNewSym (void) +{ +} + +void OPM_NewSym (CHAR *modName, LONGINT modName__len) +{ + OPM_FileName fileName; + OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, ((LONGINT)(32)), (CHAR*)".sym", (LONGINT)5); + OPM_newSFile = Files_New(fileName, ((LONGINT)(32))); + if (OPM_newSFile != NIL) { + Files_Set(&OPM_newSF, Files_Rider__typ, OPM_newSFile, ((LONGINT)(0))); + Files_Write(&OPM_newSF, Files_Rider__typ, 0xf7); + } else { + OPM_err(153); + } +} + +void OPM_Write (CHAR ch) +{ + Files_Write(&OPM_R[__X(OPM_currFile, ((LONGINT)(3)))], Files_Rider__typ, ch); +} + +void OPM_WriteString (CHAR *s, LONGINT s__len) +{ + INTEGER i; + i = 0; + while (s[__X(i, s__len)] != 0x00) { + i += 1; + } + Files_WriteBytes(&OPM_R[__X(OPM_currFile, ((LONGINT)(3)))], Files_Rider__typ, (void*)s, s__len * ((LONGINT)(1)), i); +} + +void OPM_WriteStringVar (CHAR *s, LONGINT s__len) +{ + INTEGER i; + i = 0; + while (s[__X(i, s__len)] != 0x00) { + i += 1; + } + Files_WriteBytes(&OPM_R[__X(OPM_currFile, ((LONGINT)(3)))], Files_Rider__typ, (void*)s, s__len * ((LONGINT)(1)), i); +} + +void OPM_WriteHex (LONGINT i) +{ + CHAR s[3]; + INTEGER digit; + digit = __ASHR((int)i, 4); + if (digit < 10) { + s[0] = (CHAR)(48 + digit); + } else { + s[0] = (CHAR)(87 + digit); + } + digit = __MASK((int)i, -16); + if (digit < 10) { + s[1] = (CHAR)(48 + digit); + } else { + s[1] = (CHAR)(87 + digit); + } + s[2] = 0x00; + OPM_WriteString(s, ((LONGINT)(3))); +} + +void OPM_WriteInt (LONGINT i) +{ + CHAR s[20]; + LONGINT i1, k; + if (i == OPM_MinInt || i == OPM_MinLInt) { + OPM_Write('('); + OPM_WriteInt(i + 1); + OPM_WriteString((CHAR*)"-1)", (LONGINT)4); + } else { + i1 = __ABS(i); + s[0] = (CHAR)(__MOD(i1, 10) + 48); + i1 = __DIV(i1, 10); + k = 1; + while (i1 > 0) { + s[__X(k, ((LONGINT)(20)))] = (CHAR)(__MOD(i1, 10) + 48); + i1 = __DIV(i1, 10); + k += 1; + } + if (i < 0) { + s[__X(k, ((LONGINT)(20)))] = '-'; + k += 1; + } + while (k > 0) { + k -= 1; + OPM_Write(s[__X(k, ((LONGINT)(20)))]); + } + } +} + +void OPM_WriteReal (LONGREAL r, CHAR suffx) +{ + Texts_Writer W; + Texts_Text T = NIL; + Texts_Reader R; + CHAR s[32]; + CHAR ch; + INTEGER i; + if ((((r < OPM_MaxLInt && r > OPM_MinLInt)) && r == (__ENTIER(r)))) { + if (suffx == 'f') { + OPM_WriteString((CHAR*)"(REAL)", (LONGINT)7); + } else { + OPM_WriteString((CHAR*)"(LONGREAL)", (LONGINT)11); + } + OPM_WriteInt(__ENTIER(r)); + } else { + Texts_OpenWriter(&W, Texts_Writer__typ); + if (suffx == 'f') { + Texts_WriteLongReal(&W, Texts_Writer__typ, r, 16); + } else { + Texts_WriteLongReal(&W, Texts_Writer__typ, r, 23); + } + __NEW(T, Texts_TextDesc); + Texts_Open(T, (CHAR*)"", (LONGINT)1); + Texts_Append(T, W.buf); + Texts_OpenReader(&R, Texts_Reader__typ, T, ((LONGINT)(0))); + i = 0; + Texts_Read(&R, Texts_Reader__typ, &ch); + while (ch != 0x00) { + s[__X(i, ((LONGINT)(32)))] = ch; + i += 1; + Texts_Read(&R, Texts_Reader__typ, &ch); + } + s[__X(i, ((LONGINT)(32)))] = 0x00; + i = 0; + ch = s[0]; + while ((ch != 'D' && ch != 0x00)) { + i += 1; + ch = s[__X(i, ((LONGINT)(32)))]; + } + if (ch == 'D') { + s[__X(i, ((LONGINT)(32)))] = 'e'; + } + OPM_WriteString(s, ((LONGINT)(32))); + } +} + +void OPM_WriteLn (void) +{ + Files_Write(&OPM_R[__X(OPM_currFile, ((LONGINT)(3)))], Files_Rider__typ, 0x0a); +} + +static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F) +{ + Files_Rider R1; + CHAR buffer[4096]; + if (F != NIL) { + Files_Set(&R1, Files_Rider__typ, F, ((LONGINT)(0))); + Files_ReadBytes(&R1, Files_Rider__typ, (void*)buffer, ((LONGINT)(4096)), ((LONGINT)(4096))); + while (4096 - R1.res > 0) { + Files_WriteBytes(&*R, R__typ, (void*)buffer, ((LONGINT)(4096)), 4096 - R1.res); + Files_ReadBytes(&R1, Files_Rider__typ, (void*)buffer, ((LONGINT)(4096)), ((LONGINT)(4096))); + } + } +} + +void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len) +{ + CHAR FName[32]; + __COPY(moduleName, OPM_modName, ((LONGINT)(32))); + OPM_HFile = Files_New((CHAR*)"", (LONGINT)1); + if (OPM_HFile != NIL) { + Files_Set(&OPM_R[0], Files_Rider__typ, OPM_HFile, ((LONGINT)(0))); + } else { + OPM_err(153); + } + OPM_MakeFileName((void*)moduleName, moduleName__len, (void*)FName, ((LONGINT)(32)), (CHAR*)".c", (LONGINT)3); + OPM_BFile = Files_New(FName, ((LONGINT)(32))); + if (OPM_BFile != NIL) { + Files_Set(&OPM_R[1], Files_Rider__typ, OPM_BFile, ((LONGINT)(0))); + } else { + OPM_err(153); + } + OPM_MakeFileName((void*)moduleName, moduleName__len, (void*)FName, ((LONGINT)(32)), (CHAR*)".h", (LONGINT)3); + OPM_HIFile = Files_New(FName, ((LONGINT)(32))); + if (OPM_HIFile != NIL) { + Files_Set(&OPM_R[2], Files_Rider__typ, OPM_HIFile, ((LONGINT)(0))); + } else { + OPM_err(153); + } +} + +void OPM_CloseFiles (void) +{ + CHAR FName[32]; + INTEGER res; + if (OPM_noerr) { + OPM_LogWStr((CHAR*)" ", (LONGINT)3); + OPM_LogWNum(Files_Pos(&OPM_R[1], Files_Rider__typ), ((LONGINT)(0))); + OPM_LogWStr((CHAR*)" chars.", (LONGINT)8); + } + if (OPM_noerr) { + if (__STRCMP(OPM_modName, "SYSTEM") == 0) { + if (!__IN(10, OPM_opt)) { + Files_Register(OPM_BFile); + } + } else if (!__IN(10, OPM_opt)) { + OPM_Append(&OPM_R[2], Files_Rider__typ, OPM_HFile); + Files_Register(OPM_HIFile); + Files_Register(OPM_BFile); + } else { + OPM_MakeFileName((void*)OPM_modName, ((LONGINT)(32)), (void*)FName, ((LONGINT)(32)), (CHAR*)".h", (LONGINT)3); + Files_Delete(FName, ((LONGINT)(32)), &res); + OPM_MakeFileName((void*)OPM_modName, ((LONGINT)(32)), (void*)FName, ((LONGINT)(32)), (CHAR*)".sym", (LONGINT)5); + Files_Delete(FName, ((LONGINT)(32)), &res); + Files_Register(OPM_BFile); + } + } + OPM_HFile = NIL; + OPM_BFile = NIL; + OPM_HIFile = NIL; + OPM_newSFile = NIL; + OPM_oldSFile = NIL; + Files_Set(&OPM_R[0], Files_Rider__typ, NIL, ((LONGINT)(0))); + Files_Set(&OPM_R[1], Files_Rider__typ, NIL, ((LONGINT)(0))); + Files_Set(&OPM_R[2], Files_Rider__typ, NIL, ((LONGINT)(0))); + Files_Set(&OPM_newSF, Files_Rider__typ, NIL, ((LONGINT)(0))); + Files_Set(&OPM_oldSF, Files_Rider__typ, NIL, ((LONGINT)(0))); +} + +static void EnumPtrs(void (*P)(void*)) +{ + __ENUMR(&OPM_inR, Texts_Reader__typ, 48, 1, P); + P(OPM_Log); + __ENUMR(&OPM_W, Texts_Writer__typ, 36, 1, P); + __ENUMR(&OPM_oldSF, Files_Rider__typ, 20, 1, P); + __ENUMR(&OPM_newSF, Files_Rider__typ, 20, 1, P); + __ENUMR(OPM_R, Files_Rider__typ, 20, 3, P); + P(OPM_oldSFile); + P(OPM_newSFile); + P(OPM_HFile); + P(OPM_BFile); + P(OPM_HIFile); +} + + +export void *OPM__init(void) +{ + __DEFMOD; + __MODULE_IMPORT(Configuration); + __MODULE_IMPORT(Console); + __MODULE_IMPORT(Files); + __MODULE_IMPORT(Platform); + __MODULE_IMPORT(Strings); + __MODULE_IMPORT(Texts); + __MODULE_IMPORT(errors); + __MODULE_IMPORT(vt100); + __REGMOD("OPM", EnumPtrs); + __REGCMD("CloseFiles", OPM_CloseFiles); + __REGCMD("CloseOldSym", OPM_CloseOldSym); + __REGCMD("DeleteNewSym", OPM_DeleteNewSym); + __REGCMD("InitOptions", OPM_InitOptions); + __REGCMD("LogWLn", OPM_LogWLn); + __REGCMD("RegisterNewSym", OPM_RegisterNewSym); + __REGCMD("WriteLn", OPM_WriteLn); +/* BEGIN */ + Texts_OpenWriter(&OPM_W, Texts_Writer__typ); + OPM_MODULES[0] = 0x00; + Platform_GetEnv((CHAR*)"MODULES", (LONGINT)8, (void*)OPM_MODULES, ((LONGINT)(1024))); + __MOVE(".", OPM_OBERON, 2); + Platform_GetEnv((CHAR*)"OBERON", (LONGINT)7, (void*)OPM_OBERON, ((LONGINT)(1024))); + Strings_Append((CHAR*)";.;", (LONGINT)4, (void*)OPM_OBERON, ((LONGINT)(1024))); + Strings_Append(OPM_MODULES, ((LONGINT)(1024)), (void*)OPM_OBERON, ((LONGINT)(1024))); + Strings_Append((CHAR*)";", (LONGINT)2, (void*)OPM_OBERON, ((LONGINT)(1024))); + Strings_Append((CHAR*)"/opt/voc", (LONGINT)9, (void*)OPM_OBERON, ((LONGINT)(1024))); + Strings_Append((CHAR*)"/sym;", (LONGINT)6, (void*)OPM_OBERON, ((LONGINT)(1024))); + Files_SetSearchPath(OPM_OBERON, ((LONGINT)(1024))); + OPM_CharSize = 1; + OPM_BoolSize = 1; + OPM_SIntSize = 1; + OPM_RecSize = 1; + OPM_ByteSize = 1; + OPM_RealSize = 4; + OPM_LRealSize = 8; + OPM_PointerSize = 8; + OPM_Alignment = 8; + OPM_IntSize = 4; + __ENDMOD; +} diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h new file mode 100644 index 00000000..68bf3af0 --- /dev/null +++ b/bootstrap/unix-44/OPM.h @@ -0,0 +1,63 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ + +#ifndef OPM__h +#define OPM__h + +#include "SYSTEM.h" + + +import INTEGER OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_CharAlign, OPM_BoolAlign, OPM_SIntAlign, OPM_IntAlign, OPM_LIntAlign, OPM_SetAlign, OPM_RealAlign, OPM_LRealAlign, OPM_PointerAlign, OPM_ProcAlign, OPM_RecAlign, OPM_MaxSet; +import LONGINT OPM_MinSInt, OPM_MinInt, OPM_MinLInt, OPM_MaxSInt, OPM_MaxInt, OPM_MaxLInt, OPM_MaxIndex; +import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; +import BOOLEAN OPM_noerr; +import LONGINT OPM_curpos, OPM_errpos, OPM_breakpc; +import INTEGER OPM_currFile, OPM_level, OPM_pc, OPM_entno; +import CHAR OPM_modName[32]; +import CHAR OPM_objname[64]; +import SET OPM_opt, OPM_glbopt; +import BOOLEAN OPM_dontAsm, OPM_dontLink, OPM_mainProg, OPM_mainLinkStat, OPM_notColorOutput, OPM_forceNewSym, OPM_Verbose; + + +import void OPM_CloseFiles (void); +import void OPM_CloseOldSym (void); +import void OPM_DeleteNewSym (void); +import void OPM_FPrint (LONGINT *fp, LONGINT val); +import void OPM_FPrintLReal (LONGINT *fp, LONGREAL lr); +import void OPM_FPrintReal (LONGINT *fp, REAL real); +import void OPM_FPrintSet (LONGINT *fp, SET set); +import void OPM_Get (CHAR *ch); +import void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); +import void OPM_InitOptions (void); +import void OPM_LogW (CHAR ch); +import void OPM_LogWLn (void); +import void OPM_LogWNum (LONGINT i, LONGINT len); +import void OPM_LogWStr (CHAR *s, LONGINT s__len); +import void OPM_Mark (INTEGER n, LONGINT pos); +import void OPM_NewSym (CHAR *modName, LONGINT modName__len); +import void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); +import void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); +import BOOLEAN OPM_OpenPar (void); +import void OPM_RegisterNewSym (void); +import void OPM_SymRCh (CHAR *ch); +import LONGINT OPM_SymRInt (void); +import void OPM_SymRLReal (LONGREAL *lr); +import void OPM_SymRReal (REAL *r); +import void OPM_SymRSet (SET *s); +import void OPM_SymWCh (CHAR ch); +import void OPM_SymWInt (LONGINT i); +import void OPM_SymWLReal (LONGREAL lr); +import void OPM_SymWReal (REAL r); +import void OPM_SymWSet (SET s); +import void OPM_Write (CHAR ch); +import void OPM_WriteHex (LONGINT i); +import void OPM_WriteInt (LONGINT i); +import void OPM_WriteLn (void); +import void OPM_WriteReal (LONGREAL r, CHAR suffx); +import void OPM_WriteString (CHAR *s, LONGINT s__len); +import void OPM_WriteStringVar (CHAR *s, LONGINT s__len); +import BOOLEAN OPM_eofSF (void); +import void OPM_err (INTEGER n); +import void *OPM__init(void); + + +#endif diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c new file mode 100644 index 00000000..f0530bb4 --- /dev/null +++ b/bootstrap/unix-44/OPP.c @@ -0,0 +1,1873 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +#include "SYSTEM.h" +#include "OPB.h" +#include "OPM.h" +#include "OPS.h" +#include "OPT.h" + +struct OPP__1 { + LONGINT low, high; +}; + +typedef + struct OPP__1 OPP_CaseTable[128]; + + +static SHORTINT OPP_sym, OPP_level; +static INTEGER OPP_LoopLevel; +static OPT_Node OPP_TDinit, OPP_lastTDinit; +static INTEGER OPP_nofFwdPtr; +static OPT_Struct OPP_FwdPtr[64]; + +export LONGINT *OPP__1__typ; + +static void OPP_ActualParameters (OPT_Node *aparlist, OPT_Object fpar); +static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned); +static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq); +static void OPP_CaseLabelList (OPT_Node *lab, INTEGER LabelForm, INTEGER *n, OPP_CaseTable tab); +static void OPP_CheckMark (SHORTINT *vis); +static void OPP_CheckSym (INTEGER s); +static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_); +static void OPP_ConstExpression (OPT_Node *x); +static void OPP_Element (OPT_Node *x); +static void OPP_Expression (OPT_Node *x); +static BOOLEAN OPP_Extends (OPT_Struct x, OPT_Struct b); +static void OPP_Factor (OPT_Node *x); +static void OPP_FormalParameters (OPT_Object *firstPar, OPT_Struct *resTyp); +export void OPP_Module (OPT_Node *prog, SET opt); +static void OPP_PointerType (OPT_Struct *typ); +static void OPP_ProcedureDeclaration (OPT_Node *x); +static void OPP_Receiver (SHORTINT *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec); +static void OPP_RecordType (OPT_Struct *typ, OPT_Struct *banned); +static void OPP_Sets (OPT_Node *x); +static void OPP_SimpleExpression (OPT_Node *x); +static void OPP_StandProcCall (OPT_Node *x); +static void OPP_StatSeq (OPT_Node *stat); +static void OPP_Term (OPT_Node *x); +static void OPP_Type (OPT_Struct *typ, OPT_Struct *banned); +static void OPP_TypeDecl (OPT_Struct *typ, OPT_Struct *banned); +static void OPP_err (INTEGER n); +static void OPP_qualident (OPT_Object *id); +static void OPP_selector (OPT_Node *x); + + +static void OPP_err (INTEGER n) +{ + OPM_err(n); +} + +static void OPP_CheckSym (INTEGER s) +{ + if ((int)OPP_sym == s) { + OPS_Get(&OPP_sym); + } else { + OPM_err(s); + } +} + +static void OPP_qualident (OPT_Object *id) +{ + OPT_Object obj = NIL; + SHORTINT lev; + OPT_Find(&obj); + OPS_Get(&OPP_sym); + if ((((OPP_sym == 18 && obj != NIL)) && obj->mode == 11)) { + OPS_Get(&OPP_sym); + if (OPP_sym == 38) { + OPT_FindImport(obj, &obj); + OPS_Get(&OPP_sym); + } else { + OPP_err(38); + obj = NIL; + } + } + if (obj == NIL) { + OPP_err(0); + obj = OPT_NewObj(); + obj->mode = 1; + obj->typ = OPT_undftyp; + obj->adr = 0; + } else { + lev = obj->mnolev; + if ((__IN(obj->mode, 0x06) && lev != OPP_level)) { + obj->leaf = 0; + if (lev > 0) { + OPB_StaticLink(OPP_level - lev); + } + } + } + *id = obj; +} + +static void OPP_ConstExpression (OPT_Node *x) +{ + OPP_Expression(&*x); + if ((*x)->class != 7) { + OPP_err(50); + *x = OPB_NewIntConst(((LONGINT)(1))); + } +} + +static void OPP_CheckMark (SHORTINT *vis) +{ + OPS_Get(&OPP_sym); + if (OPP_sym == 1 || OPP_sym == 7) { + if (OPP_level > 0) { + OPP_err(47); + } + if (OPP_sym == 1) { + *vis = 1; + } else { + *vis = 2; + } + OPS_Get(&OPP_sym); + } else { + *vis = 0; + } +} + +static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_) +{ + OPT_Node x = NIL; + LONGINT sf; + if (OPP_sym == 31) { + OPS_Get(&OPP_sym); + if (!OPT_SYSimported) { + OPP_err(135); + } + OPP_ConstExpression(&x); + if (__IN(x->typ->form, 0x70)) { + sf = x->conval->intval; + if (sf < 0 || sf > 1) { + OPP_err(220); + sf = 0; + } + } else { + OPP_err(51); + sf = 0; + } + *sysflag = (int)sf; + OPP_CheckSym(23); + } else { + *sysflag = default_; + } +} + +static void OPP_RecordType (OPT_Struct *typ, OPT_Struct *banned) +{ + OPT_Object fld = NIL, first = NIL, last = NIL, base = NIL; + OPT_Struct ftyp = NIL; + INTEGER sysflag; + *typ = OPT_NewStr(15, 4); + (*typ)->BaseTyp = NIL; + OPP_CheckSysFlag(&sysflag, -1); + if (OPP_sym == 30) { + OPS_Get(&OPP_sym); + if (OPP_sym == 38) { + OPP_qualident(&base); + if ((base->mode == 5 && base->typ->comp == 4)) { + if (base->typ == *banned) { + OPP_err(58); + } else { + base->typ->pvused = 1; + (*typ)->BaseTyp = base->typ; + (*typ)->extlev = base->typ->extlev + 1; + (*typ)->sysflag = base->typ->sysflag; + } + } else { + OPP_err(52); + } + } else { + OPP_err(38); + } + OPP_CheckSym(22); + } + if (sysflag >= 0) { + (*typ)->sysflag = sysflag; + } + OPT_OpenScope(0, NIL); + first = NIL; + last = NIL; + for (;;) { + if (OPP_sym == 38) { + for (;;) { + if (OPP_sym == 38) { + if ((*typ)->BaseTyp != NIL) { + OPT_FindField(OPS_name, (*typ)->BaseTyp, &fld); + if (fld != NIL) { + OPP_err(1); + } + } + OPT_Insert(OPS_name, &fld); + OPP_CheckMark(&fld->vis); + fld->mode = 4; + fld->link = NIL; + fld->typ = OPT_undftyp; + if (first == NIL) { + first = fld; + } + if (last == NIL) { + (*typ)->link = fld; + } else { + last->link = fld; + } + last = fld; + } else { + OPP_err(38); + } + if (OPP_sym == 19) { + OPS_Get(&OPP_sym); + } else if (OPP_sym == 38) { + OPP_err(19); + } else { + break; + } + } + OPP_CheckSym(20); + OPP_Type(&ftyp, &*banned); + ftyp->pvused = 1; + if (ftyp->comp == 3) { + ftyp = OPT_undftyp; + OPP_err(88); + } + while (first != NIL) { + first->typ = ftyp; + first = first->link; + } + } + if (OPP_sym == 39) { + OPS_Get(&OPP_sym); + } else if (OPP_sym == 38) { + OPP_err(39); + } else { + break; + } + } + OPT_CloseScope(); +} + +static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) +{ + OPT_Node x = NIL; + LONGINT n; + INTEGER sysflag; + OPP_CheckSysFlag(&sysflag, 0); + if (OPP_sym == 25) { + *typ = OPT_NewStr(15, 3); + (*typ)->mno = 0; + (*typ)->sysflag = sysflag; + OPS_Get(&OPP_sym); + OPP_Type(&(*typ)->BaseTyp, &*banned); + (*typ)->BaseTyp->pvused = 1; + if ((*typ)->BaseTyp->comp == 3) { + (*typ)->n = (*typ)->BaseTyp->n + 1; + } else { + (*typ)->n = 0; + } + } else { + *typ = OPT_NewStr(15, 2); + (*typ)->sysflag = sysflag; + OPP_ConstExpression(&x); + if (__IN(x->typ->form, 0x70)) { + n = x->conval->intval; + if (n <= 0 || n > OPM_MaxIndex) { + OPP_err(63); + n = 1; + } + } else { + OPP_err(51); + n = 1; + } + (*typ)->n = n; + if (OPP_sym == 25) { + OPS_Get(&OPP_sym); + OPP_Type(&(*typ)->BaseTyp, &*banned); + (*typ)->BaseTyp->pvused = 1; + } else if (OPP_sym == 19) { + OPS_Get(&OPP_sym); + if (OPP_sym != 25) { + OPP_ArrayType(&(*typ)->BaseTyp, &*banned); + } + } else { + OPP_err(35); + } + if ((*typ)->BaseTyp->comp == 3) { + (*typ)->BaseTyp = OPT_undftyp; + OPP_err(88); + } + } +} + +static void OPP_PointerType (OPT_Struct *typ) +{ + OPT_Object id = NIL; + *typ = OPT_NewStr(13, 1); + OPP_CheckSysFlag(&(*typ)->sysflag, 0); + OPP_CheckSym(28); + if (OPP_sym == 38) { + OPT_Find(&id); + if (id == NIL) { + if (OPP_nofFwdPtr < 64) { + OPP_FwdPtr[__X(OPP_nofFwdPtr, ((LONGINT)(64)))] = *typ; + OPP_nofFwdPtr += 1; + } else { + OPP_err(224); + } + (*typ)->link = OPT_NewObj(); + __COPY(OPS_name, (*typ)->link->name, ((LONGINT)(256))); + (*typ)->BaseTyp = OPT_undftyp; + OPS_Get(&OPP_sym); + } else { + OPP_qualident(&id); + if (id->mode == 5) { + if (__IN(id->typ->comp, 0x1c)) { + (*typ)->BaseTyp = id->typ; + } else { + (*typ)->BaseTyp = OPT_undftyp; + OPP_err(57); + } + } else { + (*typ)->BaseTyp = OPT_undftyp; + OPP_err(52); + } + } + } else { + OPP_Type(&(*typ)->BaseTyp, &OPT_notyp); + if (!__IN((*typ)->BaseTyp->comp, 0x1c)) { + (*typ)->BaseTyp = OPT_undftyp; + OPP_err(57); + } + } +} + +static void OPP_FormalParameters (OPT_Object *firstPar, OPT_Struct *resTyp) +{ + SHORTINT mode; + OPT_Object par = NIL, first = NIL, last = NIL, res = NIL; + OPT_Struct typ = NIL; + first = NIL; + last = *firstPar; + if (OPP_sym == 38 || OPP_sym == 60) { + for (;;) { + if (OPP_sym == 60) { + OPS_Get(&OPP_sym); + mode = 2; + } else { + mode = 1; + } + for (;;) { + if (OPP_sym == 38) { + OPT_Insert(OPS_name, &par); + OPS_Get(&OPP_sym); + par->mode = mode; + par->link = NIL; + if (first == NIL) { + first = par; + } + if (*firstPar == NIL) { + *firstPar = par; + } else { + last->link = par; + } + last = par; + } else { + OPP_err(38); + } + if (OPP_sym == 19) { + OPS_Get(&OPP_sym); + } else if (OPP_sym == 38) { + OPP_err(19); + } else if (OPP_sym == 60) { + OPP_err(19); + OPS_Get(&OPP_sym); + } else { + break; + } + } + OPP_CheckSym(20); + OPP_Type(&typ, &OPT_notyp); + if (mode == 1) { + typ->pvused = 1; + } + while (first != NIL) { + first->typ = typ; + first = first->link; + } + if (OPP_sym == 39) { + OPS_Get(&OPP_sym); + } else if (OPP_sym == 38) { + OPP_err(39); + } else { + break; + } + } + } + OPP_CheckSym(22); + if (OPP_sym == 20) { + OPS_Get(&OPP_sym); + *resTyp = OPT_undftyp; + if (OPP_sym == 38) { + OPP_qualident(&res); + if (res->mode == 5) { + if (res->typ->form < 15) { + *resTyp = res->typ; + } else { + OPP_err(54); + } + } else { + OPP_err(52); + } + } else { + OPP_err(38); + } + } else { + *resTyp = OPT_notyp; + } +} + +static void OPP_TypeDecl (OPT_Struct *typ, OPT_Struct *banned) +{ + OPT_Object id = NIL; + *typ = OPT_undftyp; + if (OPP_sym < 30) { + OPP_err(12); + do { + OPS_Get(&OPP_sym); + } while (!(OPP_sym >= 30)); + } + if (OPP_sym == 38) { + OPP_qualident(&id); + if (id->mode == 5) { + if (id->typ != *banned) { + *typ = id->typ; + } else { + OPP_err(58); + } + } else { + OPP_err(52); + } + } else if (OPP_sym == 54) { + OPS_Get(&OPP_sym); + OPP_ArrayType(&*typ, &*banned); + } else if (OPP_sym == 55) { + OPS_Get(&OPP_sym); + OPP_RecordType(&*typ, &*banned); + OPB_Inittd(&OPP_TDinit, &OPP_lastTDinit, *typ); + OPP_CheckSym(41); + } else if (OPP_sym == 56) { + OPS_Get(&OPP_sym); + OPP_PointerType(&*typ); + } else if (OPP_sym == 61) { + OPS_Get(&OPP_sym); + *typ = OPT_NewStr(14, 1); + OPP_CheckSysFlag(&(*typ)->sysflag, 0); + if (OPP_sym == 30) { + OPS_Get(&OPP_sym); + OPT_OpenScope(OPP_level, NIL); + OPP_FormalParameters(&(*typ)->link, &(*typ)->BaseTyp); + OPT_CloseScope(); + } else { + (*typ)->BaseTyp = OPT_notyp; + (*typ)->link = NIL; + } + } else { + OPP_err(12); + } + for (;;) { + if (((OPP_sym >= 39 && OPP_sym <= 42) || OPP_sym == 22) || OPP_sym == 64) { + break; + } + OPP_err(15); + if (OPP_sym == 38) { + break; + } + OPS_Get(&OPP_sym); + } +} + +static void OPP_Type (OPT_Struct *typ, OPT_Struct *banned) +{ + OPP_TypeDecl(&*typ, &*banned); + if (((((*typ)->form == 13 && (*typ)->BaseTyp == OPT_undftyp)) && (*typ)->strobj == NIL)) { + OPP_err(0); + } +} + +static void OPP_selector (OPT_Node *x) +{ + OPT_Object obj = NIL, proc = NIL; + OPT_Node y = NIL; + OPT_Struct typ = NIL; + OPS_Name name; + for (;;) { + if (OPP_sym == 31) { + OPS_Get(&OPP_sym); + for (;;) { + if (((*x)->typ != NIL && (*x)->typ->form == 13)) { + OPB_DeRef(&*x); + } + OPP_Expression(&y); + OPB_Index(&*x, y); + if (OPP_sym == 19) { + OPS_Get(&OPP_sym); + } else { + break; + } + } + OPP_CheckSym(23); + } else if (OPP_sym == 18) { + OPS_Get(&OPP_sym); + if (OPP_sym == 38) { + __COPY(OPS_name, name, ((LONGINT)(256))); + OPS_Get(&OPP_sym); + if ((*x)->typ != NIL) { + if ((*x)->typ->form == 13) { + OPB_DeRef(&*x); + } + if ((*x)->typ->comp == 4) { + OPT_FindField(name, (*x)->typ, &obj); + OPB_Field(&*x, obj); + if ((obj != NIL && obj->mode == 13)) { + if (OPP_sym == 17) { + OPS_Get(&OPP_sym); + y = (*x)->left; + if (y->class == 3) { + y = y->left; + } + if (y->obj != NIL) { + proc = OPT_topScope; + while ((proc->link != NIL && proc->link->mode != 13)) { + proc = proc->left; + } + if (proc->link == NIL || proc->link->link != y->obj) { + OPP_err(75); + } + typ = y->obj->typ; + if (typ->form == 13) { + typ = typ->BaseTyp; + } + OPT_FindField((*x)->obj->name, typ->BaseTyp, &proc); + if (proc != NIL) { + (*x)->subcl = 1; + } else { + OPP_err(74); + } + } else { + OPP_err(75); + } + } + if ((obj->typ != OPT_notyp && OPP_sym != 30)) { + OPP_err(30); + } + } + } else { + OPP_err(53); + } + } else { + OPP_err(52); + } + } else { + OPP_err(38); + } + } else if (OPP_sym == 17) { + OPS_Get(&OPP_sym); + OPB_DeRef(&*x); + } else if ((((((OPP_sym == 30 && (*x)->class < 7)) && (*x)->typ->form != 14)) && ((*x)->obj == NIL || (*x)->obj->mode != 13))) { + OPS_Get(&OPP_sym); + if (OPP_sym == 38) { + OPP_qualident(&obj); + if (obj->mode == 5) { + OPB_TypTest(&*x, obj, 1); + } else { + OPP_err(52); + } + } else { + OPP_err(38); + } + OPP_CheckSym(22); + } else { + break; + } + } +} + +static void OPP_ActualParameters (OPT_Node *aparlist, OPT_Object fpar) +{ + OPT_Node apar = NIL, last = NIL; + *aparlist = NIL; + last = NIL; + if (OPP_sym != 22) { + for (;;) { + OPP_Expression(&apar); + if (fpar != NIL) { + OPB_Param(apar, fpar); + OPB_Link(&*aparlist, &last, apar); + fpar = fpar->link; + } else { + OPP_err(64); + } + if (OPP_sym == 19) { + OPS_Get(&OPP_sym); + } else if ((30 <= OPP_sym && OPP_sym <= 38)) { + OPP_err(19); + } else { + break; + } + } + } + if (fpar != NIL) { + OPP_err(65); + } +} + +static void OPP_StandProcCall (OPT_Node *x) +{ + OPT_Node y = NIL; + SHORTINT m; + INTEGER n; + m = (int)(*x)->obj->adr; + n = 0; + if (OPP_sym == 30) { + OPS_Get(&OPP_sym); + if (OPP_sym != 22) { + for (;;) { + if (n == 0) { + OPP_Expression(&*x); + OPB_StPar0(&*x, m); + n = 1; + } else if (n == 1) { + OPP_Expression(&y); + OPB_StPar1(&*x, y, m); + n = 2; + } else { + OPP_Expression(&y); + OPB_StParN(&*x, y, m, n); + n += 1; + } + if (OPP_sym == 19) { + OPS_Get(&OPP_sym); + } else if ((30 <= OPP_sym && OPP_sym <= 38)) { + OPP_err(19); + } else { + break; + } + } + OPP_CheckSym(22); + } else { + OPS_Get(&OPP_sym); + } + OPB_StFct(&*x, m, n); + } else { + OPP_err(30); + } + if ((OPP_level > 0 && (m == 1 || m == 30))) { + OPT_topScope->link->leaf = 0; + } +} + +static void OPP_Element (OPT_Node *x) +{ + OPT_Node y = NIL; + OPP_Expression(&*x); + if (OPP_sym == 21) { + OPS_Get(&OPP_sym); + OPP_Expression(&y); + OPB_SetRange(&*x, y); + } else { + OPB_SetElem(&*x); + } +} + +static void OPP_Sets (OPT_Node *x) +{ + OPT_Node y = NIL; + if (OPP_sym != 24) { + OPP_Element(&*x); + for (;;) { + if (OPP_sym == 19) { + OPS_Get(&OPP_sym); + } else if ((30 <= OPP_sym && OPP_sym <= 38)) { + OPP_err(19); + } else { + break; + } + OPP_Element(&y); + OPB_Op(6, &*x, y); + } + } else { + *x = OPB_EmptySet(); + } + OPP_CheckSym(24); +} + +static void OPP_Factor (OPT_Node *x) +{ + OPT_Object fpar = NIL, id = NIL; + OPT_Node apar = NIL; + if (OPP_sym < 30) { + OPP_err(13); + do { + OPS_Get(&OPP_sym); + } while (!(OPP_sym >= 30)); + } + if (OPP_sym == 38) { + OPP_qualident(&id); + *x = OPB_NewLeaf(id); + OPP_selector(&*x); + if (((*x)->class == 9 && (*x)->obj->mode == 8)) { + OPP_StandProcCall(&*x); + } else if (OPP_sym == 30) { + OPS_Get(&OPP_sym); + OPB_PrepCall(&*x, &fpar); + OPP_ActualParameters(&apar, fpar); + OPB_Call(&*x, apar, fpar); + OPP_CheckSym(22); + if (OPP_level > 0) { + OPT_topScope->link->leaf = 0; + } + } + } else if (OPP_sym == 35) { + switch (OPS_numtyp) { + case 1: + *x = OPB_NewIntConst(OPS_intval); + (*x)->typ = OPT_chartyp; + break; + case 2: + *x = OPB_NewIntConst(OPS_intval); + break; + case 3: + *x = OPB_NewRealConst(OPS_realval, OPT_realtyp); + break; + case 4: + *x = OPB_NewRealConst(OPS_lrlval, OPT_lrltyp); + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPP.Factor, OPS.numtyp = ", (LONGINT)44); + OPM_LogWNum(OPS_numtyp, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + OPS_Get(&OPP_sym); + } else if (OPP_sym == 37) { + *x = OPB_NewString(OPS_str, OPS_intval); + OPS_Get(&OPP_sym); + } else if (OPP_sym == 36) { + *x = OPB_Nil(); + OPS_Get(&OPP_sym); + } else if (OPP_sym == 30) { + OPS_Get(&OPP_sym); + OPP_Expression(&*x); + OPP_CheckSym(22); + } else if (OPP_sym == 31) { + OPS_Get(&OPP_sym); + OPP_err(30); + OPP_Expression(&*x); + OPP_CheckSym(22); + } else if (OPP_sym == 32) { + OPS_Get(&OPP_sym); + OPP_Sets(&*x); + } else if (OPP_sym == 33) { + OPS_Get(&OPP_sym); + OPP_Factor(&*x); + OPB_MOp(33, &*x); + } else { + OPP_err(13); + OPS_Get(&OPP_sym); + *x = NIL; + } + if (*x == NIL) { + *x = OPB_NewIntConst(((LONGINT)(1))); + (*x)->typ = OPT_undftyp; + } +} + +static void OPP_Term (OPT_Node *x) +{ + OPT_Node y = NIL; + SHORTINT mulop; + OPP_Factor(&*x); + while ((1 <= OPP_sym && OPP_sym <= 5)) { + mulop = OPP_sym; + OPS_Get(&OPP_sym); + OPP_Factor(&y); + OPB_Op(mulop, &*x, y); + } +} + +static void OPP_SimpleExpression (OPT_Node *x) +{ + OPT_Node y = NIL; + SHORTINT addop; + if (OPP_sym == 7) { + OPS_Get(&OPP_sym); + OPP_Term(&*x); + OPB_MOp(7, &*x); + } else if (OPP_sym == 6) { + OPS_Get(&OPP_sym); + OPP_Term(&*x); + OPB_MOp(6, &*x); + } else { + OPP_Term(&*x); + } + while ((6 <= OPP_sym && OPP_sym <= 8)) { + addop = OPP_sym; + OPS_Get(&OPP_sym); + OPP_Term(&y); + OPB_Op(addop, &*x, y); + } +} + +static void OPP_Expression (OPT_Node *x) +{ + OPT_Node y = NIL; + OPT_Object obj = NIL; + SHORTINT relation; + OPP_SimpleExpression(&*x); + if ((9 <= OPP_sym && OPP_sym <= 14)) { + relation = OPP_sym; + OPS_Get(&OPP_sym); + OPP_SimpleExpression(&y); + OPB_Op(relation, &*x, y); + } else if (OPP_sym == 15) { + OPS_Get(&OPP_sym); + OPP_SimpleExpression(&y); + OPB_In(&*x, y); + } else if (OPP_sym == 16) { + OPS_Get(&OPP_sym); + if (OPP_sym == 38) { + OPP_qualident(&obj); + if (obj->mode == 5) { + OPB_TypTest(&*x, obj, 0); + } else { + OPP_err(52); + } + } else { + OPP_err(38); + } + } +} + +static void OPP_Receiver (SHORTINT *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec) +{ + OPT_Object obj = NIL; + *typ = OPT_undftyp; + *rec = NIL; + if (OPP_sym == 60) { + OPS_Get(&OPP_sym); + *mode = 2; + } else { + *mode = 1; + } + __COPY(OPS_name, name, ((LONGINT)(256))); + OPP_CheckSym(38); + OPP_CheckSym(20); + if (OPP_sym == 38) { + OPT_Find(&obj); + OPS_Get(&OPP_sym); + if (obj == NIL) { + OPP_err(0); + } else if (obj->mode != 5) { + OPP_err(72); + } else { + *typ = obj->typ; + *rec = *typ; + if ((*rec)->form == 13) { + *rec = (*rec)->BaseTyp; + } + if (!((((*mode == 1 && (*typ)->form == 13)) && (*rec)->comp == 4) || (*mode == 2 && (*typ)->comp == 4))) { + OPP_err(70); + *rec = NIL; + } + if ((*rec != NIL && (*rec)->mno != OPP_level)) { + OPP_err(72); + *rec = NIL; + } + } + } else { + OPP_err(38); + } + OPP_CheckSym(22); + if (*rec == NIL) { + *rec = OPT_NewStr(15, 4); + (*rec)->BaseTyp = NIL; + } +} + +static BOOLEAN OPP_Extends (OPT_Struct x, OPT_Struct b) +{ + BOOLEAN _o_result; + if ((b->form == 13 && x->form == 13)) { + b = b->BaseTyp; + x = x->BaseTyp; + } + if ((b->comp == 4 && x->comp == 4)) { + do { + x = x->BaseTyp; + } while (!(x == NIL || x == b)); + } + _o_result = x == b; + return _o_result; +} + +static struct ProcedureDeclaration__16 { + OPT_Node *x; + OPT_Object *proc, *fwd; + OPS_Name *name; + SHORTINT *mode, *vis; + BOOLEAN *forward; + struct ProcedureDeclaration__16 *lnk; +} *ProcedureDeclaration__16_s; + +static void Body__17 (void); +static void GetCode__19 (void); +static void GetParams__21 (void); +static void TProcDecl__23 (void); + +static void GetCode__19 (void) +{ + OPT_ConstExt ext = NIL; + INTEGER n; + LONGINT c; + ext = OPT_NewExt(); + (*ProcedureDeclaration__16_s->proc)->conval->ext = ext; + n = 0; + if (OPP_sym == 37) { + while (OPS_str[__X(n, ((LONGINT)(256)))] != 0x00) { + (*ext)[__X(n + 1, ((LONGINT)(256)))] = OPS_str[__X(n, ((LONGINT)(256)))]; + n += 1; + } + (*ext)[0] = (CHAR)n; + OPS_Get(&OPP_sym); + } else { + for (;;) { + if (OPP_sym == 35) { + c = OPS_intval; + n += 1; + if ((c < 0 || c > 255) || n == 256) { + OPP_err(64); + c = 1; + n = 1; + } + OPS_Get(&OPP_sym); + (*ext)[__X(n, ((LONGINT)(256)))] = (CHAR)c; + } + if (OPP_sym == 19) { + OPS_Get(&OPP_sym); + } else if (OPP_sym == 35) { + OPP_err(19); + } else { + (*ext)[0] = (CHAR)n; + break; + } + } + } + (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1); +} + +static void GetParams__21 (void) +{ + (*ProcedureDeclaration__16_s->proc)->vis = *ProcedureDeclaration__16_s->vis; + (*ProcedureDeclaration__16_s->proc)->mode = *ProcedureDeclaration__16_s->mode; + (*ProcedureDeclaration__16_s->proc)->typ = OPT_notyp; + (*ProcedureDeclaration__16_s->proc)->conval = OPT_NewConst(); + (*ProcedureDeclaration__16_s->proc)->conval->setval = 0x0; + if (OPP_sym == 30) { + OPS_Get(&OPP_sym); + OPP_FormalParameters(&(*ProcedureDeclaration__16_s->proc)->link, &(*ProcedureDeclaration__16_s->proc)->typ); + } + if (*ProcedureDeclaration__16_s->fwd != NIL) { + OPB_CheckParameters((*ProcedureDeclaration__16_s->proc)->link, (*ProcedureDeclaration__16_s->fwd)->link, 1); + if ((*ProcedureDeclaration__16_s->proc)->typ != (*ProcedureDeclaration__16_s->fwd)->typ) { + OPP_err(117); + } + *ProcedureDeclaration__16_s->proc = *ProcedureDeclaration__16_s->fwd; + OPT_topScope = (*ProcedureDeclaration__16_s->proc)->scope; + if (*ProcedureDeclaration__16_s->mode == 10) { + (*ProcedureDeclaration__16_s->proc)->mode = 10; + } + } +} + +static void Body__17 (void) +{ + OPT_Node procdec = NIL, statseq = NIL; + LONGINT c; + c = OPM_errpos; + (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1); + OPP_CheckSym(39); + OPP_Block(&procdec, &statseq); + OPB_Enter(&procdec, statseq, *ProcedureDeclaration__16_s->proc); + *ProcedureDeclaration__16_s->x = procdec; + (*ProcedureDeclaration__16_s->x)->conval = OPT_NewConst(); + (*ProcedureDeclaration__16_s->x)->conval->intval = c; + if (OPP_sym == 38) { + if (__STRCMP(OPS_name, (*ProcedureDeclaration__16_s->proc)->name) != 0) { + OPP_err(4); + } + OPS_Get(&OPP_sym); + } else { + OPP_err(38); + } +} + +static void TProcDecl__23 (void) +{ + OPT_Object baseProc = NIL; + OPT_Struct objTyp = NIL, recTyp = NIL; + SHORTINT objMode; + OPS_Name objName; + OPS_Get(&OPP_sym); + *ProcedureDeclaration__16_s->mode = 13; + if (OPP_level > 0) { + OPP_err(73); + } + OPP_Receiver(&objMode, objName, &objTyp, &recTyp); + if (OPP_sym == 38) { + __COPY(OPS_name, *ProcedureDeclaration__16_s->name, ((LONGINT)(256))); + OPP_CheckMark(&*ProcedureDeclaration__16_s->vis); + OPT_FindField(*ProcedureDeclaration__16_s->name, recTyp, &*ProcedureDeclaration__16_s->fwd); + OPT_FindField(*ProcedureDeclaration__16_s->name, recTyp->BaseTyp, &baseProc); + if ((baseProc != NIL && baseProc->mode != 13)) { + baseProc = NIL; + } + if (*ProcedureDeclaration__16_s->fwd == baseProc) { + *ProcedureDeclaration__16_s->fwd = NIL; + } + if ((*ProcedureDeclaration__16_s->fwd != NIL && (*ProcedureDeclaration__16_s->fwd)->mnolev != OPP_level)) { + *ProcedureDeclaration__16_s->fwd = NIL; + } + if ((((*ProcedureDeclaration__16_s->fwd != NIL && (*ProcedureDeclaration__16_s->fwd)->mode == 13)) && !__IN(1, (*ProcedureDeclaration__16_s->fwd)->conval->setval))) { + *ProcedureDeclaration__16_s->proc = OPT_NewObj(); + (*ProcedureDeclaration__16_s->proc)->leaf = 1; + if ((*ProcedureDeclaration__16_s->fwd)->vis != *ProcedureDeclaration__16_s->vis) { + OPP_err(118); + } + } else { + if (*ProcedureDeclaration__16_s->fwd != NIL) { + OPP_err(1); + *ProcedureDeclaration__16_s->fwd = NIL; + } + OPT_OpenScope(0, NIL); + OPT_topScope->right = recTyp->link; + OPT_Insert(*ProcedureDeclaration__16_s->name, &*ProcedureDeclaration__16_s->proc); + recTyp->link = OPT_topScope->right; + OPT_CloseScope(); + } + OPP_level += 1; + OPT_OpenScope(OPP_level, *ProcedureDeclaration__16_s->proc); + OPT_Insert(objName, &(*ProcedureDeclaration__16_s->proc)->link); + (*ProcedureDeclaration__16_s->proc)->link->mode = objMode; + (*ProcedureDeclaration__16_s->proc)->link->typ = objTyp; + GetParams__21(); + if (baseProc != NIL) { + if (objMode != baseProc->link->mode || !OPP_Extends(objTyp, baseProc->link->typ)) { + OPP_err(115); + } + OPB_CheckParameters((*ProcedureDeclaration__16_s->proc)->link->link, baseProc->link->link, 0); + if ((*ProcedureDeclaration__16_s->proc)->typ != baseProc->typ) { + OPP_err(117); + } + if ((((((baseProc->vis == 1 && (*ProcedureDeclaration__16_s->proc)->vis == 0)) && recTyp->strobj != NIL)) && recTyp->strobj->vis == 1)) { + OPP_err(109); + } + (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(2); + } + if (!*ProcedureDeclaration__16_s->forward) { + Body__17(); + } + OPP_level -= 1; + OPT_CloseScope(); + } else { + OPP_err(38); + } +} + +static void OPP_ProcedureDeclaration (OPT_Node *x) +{ + OPT_Object proc = NIL, fwd = NIL; + OPS_Name name; + SHORTINT mode, vis; + BOOLEAN forward; + struct ProcedureDeclaration__16 _s; + _s.x = x; + _s.proc = &proc; + _s.fwd = &fwd; + _s.name = (void*)name; + _s.mode = &mode; + _s.vis = &vis; + _s.forward = &forward; + _s.lnk = ProcedureDeclaration__16_s; + ProcedureDeclaration__16_s = &_s; + proc = NIL; + forward = 0; + *x = NIL; + mode = 6; + if ((OPP_sym != 38 && OPP_sym != 30)) { + if (OPP_sym == 1) { + } else if (OPP_sym == 17) { + forward = 1; + } else if (OPP_sym == 6) { + mode = 10; + } else if (OPP_sym == 7) { + mode = 9; + } else { + OPP_err(38); + } + if ((__IN(mode, 0x0600) && !OPT_SYSimported)) { + OPP_err(135); + } + OPS_Get(&OPP_sym); + } + if (OPP_sym == 30) { + TProcDecl__23(); + } else if (OPP_sym == 38) { + OPT_Find(&fwd); + __COPY(OPS_name, name, ((LONGINT)(256))); + OPP_CheckMark(&vis); + if ((vis != 0 && mode == 6)) { + mode = 7; + } + if ((fwd != NIL && (fwd->mnolev != OPP_level || fwd->mode == 8))) { + fwd = NIL; + } + if ((((fwd != NIL && __IN(fwd->mode, 0xc0))) && !__IN(1, fwd->conval->setval))) { + proc = OPT_NewObj(); + proc->leaf = 1; + if (fwd->vis != vis) { + OPP_err(118); + } + } else { + if (fwd != NIL) { + OPP_err(1); + fwd = NIL; + } + OPT_Insert(name, &proc); + } + if ((mode != 6 && OPP_level > 0)) { + OPP_err(73); + } + OPP_level += 1; + OPT_OpenScope(OPP_level, proc); + proc->link = NIL; + GetParams__21(); + if (mode == 9) { + GetCode__19(); + } else if (!forward) { + Body__17(); + } + OPP_level -= 1; + OPT_CloseScope(); + } else { + OPP_err(38); + } + ProcedureDeclaration__16_s = _s.lnk; +} + +static void OPP_CaseLabelList (OPT_Node *lab, INTEGER LabelForm, INTEGER *n, OPP_CaseTable tab) +{ + OPT_Node x = NIL, y = NIL, lastlab = NIL; + INTEGER i, f; + LONGINT xval, yval; + *lab = NIL; + lastlab = NIL; + for (;;) { + OPP_ConstExpression(&x); + f = x->typ->form; + if (__IN(f, 0x78)) { + xval = x->conval->intval; + } else { + OPP_err(61); + xval = 1; + } + if (__IN(f, 0x70)) { + if (LabelForm < f) { + OPP_err(60); + } + } else if (LabelForm != f) { + OPP_err(60); + } + if (OPP_sym == 21) { + OPS_Get(&OPP_sym); + OPP_ConstExpression(&y); + yval = y->conval->intval; + if (((int)y->typ->form != f && !((__IN(f, 0x70) && __IN(y->typ->form, 0x70))))) { + OPP_err(60); + } + if (yval < xval) { + OPP_err(63); + yval = xval; + } + } else { + yval = xval; + } + x->conval->intval2 = yval; + i = *n; + if (i < 128) { + for (;;) { + if (i == 0) { + break; + } + if (tab[__X(i - 1, ((LONGINT)(128)))].low <= yval) { + if (tab[__X(i - 1, ((LONGINT)(128)))].high >= xval) { + OPP_err(62); + } + break; + } + tab[__X(i, ((LONGINT)(128)))] = tab[__X(i - 1, ((LONGINT)(128)))]; + i -= 1; + } + tab[__X(i, ((LONGINT)(128)))].low = xval; + tab[__X(i, ((LONGINT)(128)))].high = yval; + *n += 1; + } else { + OPP_err(213); + } + OPB_Link(&*lab, &lastlab, x); + if (OPP_sym == 19) { + OPS_Get(&OPP_sym); + } else if (OPP_sym == 35 || OPP_sym == 38) { + OPP_err(19); + } else { + break; + } + } +} + +static struct StatSeq__30 { + LONGINT *pos; + struct StatSeq__30 *lnk; +} *StatSeq__30_s; + +static void CasePart__31 (OPT_Node *x); +static void CheckBool__33 (OPT_Node *x); +static void SetPos__35 (OPT_Node x); + +static void CasePart__31 (OPT_Node *x) +{ + INTEGER n; + LONGINT low, high; + BOOLEAN e; + OPP_CaseTable tab; + OPT_Node cases = NIL, lab = NIL, y = NIL, lastcase = NIL; + OPP_Expression(&*x); + *StatSeq__30_s->pos = OPM_errpos; + if ((*x)->class == 8 || (*x)->class == 9) { + OPP_err(126); + } else if (!__IN((*x)->typ->form, 0x78)) { + OPP_err(125); + } + OPP_CheckSym(25); + cases = NIL; + lastcase = NIL; + n = 0; + for (;;) { + if (OPP_sym < 40) { + OPP_CaseLabelList(&lab, (*x)->typ->form, &n, tab); + OPP_CheckSym(20); + OPP_StatSeq(&y); + OPB_Construct(17, &lab, y); + OPB_Link(&cases, &lastcase, lab); + } + if (OPP_sym == 40) { + OPS_Get(&OPP_sym); + } else { + break; + } + } + if (n > 0) { + low = tab[0].low; + high = tab[__X(n - 1, ((LONGINT)(128)))].high; + if (high - low > 512) { + OPP_err(209); + } + } else { + low = 1; + high = 0; + } + e = OPP_sym == 42; + if (e) { + OPS_Get(&OPP_sym); + OPP_StatSeq(&y); + } else { + y = NIL; + OPM_Mark(-307, OPM_curpos); + } + OPB_Construct(16, &cases, y); + OPB_Construct(21, &*x, cases); + cases->conval = OPT_NewConst(); + cases->conval->intval = low; + cases->conval->intval2 = high; + if (e) { + cases->conval->setval = 0x02; + } else { + cases->conval->setval = 0x0; + } +} + +static void SetPos__35 (OPT_Node x) +{ + x->conval = OPT_NewConst(); + x->conval->intval = *StatSeq__30_s->pos; +} + +static void CheckBool__33 (OPT_Node *x) +{ + if ((*x)->class == 8 || (*x)->class == 9) { + OPP_err(126); + *x = OPB_NewBoolConst(0); + } else if ((*x)->typ->form != 2) { + OPP_err(120); + *x = OPB_NewBoolConst(0); + } + *StatSeq__30_s->pos = OPM_errpos; +} + +static void OPP_StatSeq (OPT_Node *stat) +{ + OPT_Object fpar = NIL, id = NIL, t = NIL, obj = NIL; + OPT_Struct idtyp = NIL; + BOOLEAN e; + OPT_Node s = NIL, x = NIL, y = NIL, z = NIL, apar = NIL, last = NIL, lastif = NIL; + LONGINT pos; + OPS_Name name; + struct StatSeq__30 _s; + _s.pos = &pos; + _s.lnk = StatSeq__30_s; + StatSeq__30_s = &_s; + *stat = NIL; + last = NIL; + for (;;) { + x = NIL; + if (OPP_sym < 38) { + OPP_err(14); + do { + OPS_Get(&OPP_sym); + } while (!(OPP_sym >= 38)); + } + if (OPP_sym == 38) { + OPP_qualident(&id); + x = OPB_NewLeaf(id); + OPP_selector(&x); + if (OPP_sym == 34) { + OPS_Get(&OPP_sym); + OPP_Expression(&y); + OPB_Assign(&x, y); + } else if (OPP_sym == 9) { + OPP_err(34); + OPS_Get(&OPP_sym); + OPP_Expression(&y); + OPB_Assign(&x, y); + } else if ((x->class == 9 && x->obj->mode == 8)) { + OPP_StandProcCall(&x); + if ((x != NIL && x->typ != OPT_notyp)) { + OPP_err(55); + } + } else { + OPB_PrepCall(&x, &fpar); + if (OPP_sym == 30) { + OPS_Get(&OPP_sym); + OPP_ActualParameters(&apar, fpar); + OPP_CheckSym(22); + } else { + apar = NIL; + if (fpar != NIL) { + OPP_err(65); + } + } + OPB_Call(&x, apar, fpar); + if (x->typ != OPT_notyp) { + OPP_err(55); + } + if (OPP_level > 0) { + OPT_topScope->link->leaf = 0; + } + } + pos = OPM_errpos; + } else if (OPP_sym == 45) { + OPS_Get(&OPP_sym); + OPP_Expression(&x); + CheckBool__33(&x); + OPP_CheckSym(26); + OPP_StatSeq(&y); + OPB_Construct(15, &x, y); + SetPos__35(x); + lastif = x; + while (OPP_sym == 43) { + OPS_Get(&OPP_sym); + OPP_Expression(&y); + CheckBool__33(&y); + OPP_CheckSym(26); + OPP_StatSeq(&z); + OPB_Construct(15, &y, z); + SetPos__35(y); + OPB_Link(&x, &lastif, y); + } + if (OPP_sym == 42) { + OPS_Get(&OPP_sym); + OPP_StatSeq(&y); + } else { + y = NIL; + } + OPB_Construct(20, &x, y); + OPP_CheckSym(41); + OPB_OptIf(&x); + pos = OPM_errpos; + } else if (OPP_sym == 46) { + OPS_Get(&OPP_sym); + CasePart__31(&x); + OPP_CheckSym(41); + } else if (OPP_sym == 47) { + OPS_Get(&OPP_sym); + OPP_Expression(&x); + CheckBool__33(&x); + OPP_CheckSym(27); + OPP_StatSeq(&y); + OPB_Construct(22, &x, y); + OPP_CheckSym(41); + } else if (OPP_sym == 48) { + OPS_Get(&OPP_sym); + OPP_StatSeq(&x); + if (OPP_sym == 44) { + OPS_Get(&OPP_sym); + OPP_Expression(&y); + CheckBool__33(&y); + } else { + OPP_err(44); + } + OPB_Construct(23, &x, y); + } else if (OPP_sym == 49) { + OPS_Get(&OPP_sym); + if (OPP_sym == 38) { + OPP_qualident(&id); + if (!__IN(id->typ->form, 0x70)) { + OPP_err(68); + } + OPP_CheckSym(34); + OPP_Expression(&y); + pos = OPM_errpos; + x = OPB_NewLeaf(id); + OPB_Assign(&x, y); + SetPos__35(x); + OPP_CheckSym(28); + OPP_Expression(&y); + pos = OPM_errpos; + if (y->class != 7) { + __MOVE("@@", name, 3); + OPT_Insert(name, &t); + __MOVE("@for", t->name, 5); + t->mode = 1; + t->typ = x->left->typ; + obj = OPT_topScope->scope; + if (obj == NIL) { + OPT_topScope->scope = t; + } else { + while (obj->link != NIL) { + obj = obj->link; + } + obj->link = t; + } + z = OPB_NewLeaf(t); + OPB_Assign(&z, y); + SetPos__35(z); + OPB_Link(&*stat, &last, z); + y = OPB_NewLeaf(t); + } else if (y->typ->form < 4 || y->typ->form > x->left->typ->form) { + OPP_err(113); + } + OPB_Link(&*stat, &last, x); + if (OPP_sym == 29) { + OPS_Get(&OPP_sym); + OPP_ConstExpression(&z); + } else { + z = OPB_NewIntConst(((LONGINT)(1))); + } + pos = OPM_errpos; + x = OPB_NewLeaf(id); + if (z->conval->intval > 0) { + OPB_Op(12, &x, y); + } else if (z->conval->intval < 0) { + OPB_Op(14, &x, y); + } else { + OPP_err(63); + OPB_Op(14, &x, y); + } + OPP_CheckSym(27); + OPP_StatSeq(&s); + y = OPB_NewLeaf(id); + OPB_StPar1(&y, z, 13); + SetPos__35(y); + if (s == NIL) { + s = y; + } else { + z = s; + while (z->link != NIL) { + z = z->link; + } + z->link = y; + } + OPP_CheckSym(41); + OPB_Construct(22, &x, s); + } else { + OPP_err(38); + } + } else if (OPP_sym == 50) { + OPS_Get(&OPP_sym); + OPP_LoopLevel += 1; + OPP_StatSeq(&x); + OPP_LoopLevel -= 1; + OPB_Construct(24, &x, NIL); + OPP_CheckSym(41); + pos = OPM_errpos; + } else if (OPP_sym == 51) { + OPS_Get(&OPP_sym); + idtyp = NIL; + x = NIL; + for (;;) { + if (OPP_sym == 38) { + OPP_qualident(&id); + y = OPB_NewLeaf(id); + if ((((id != NIL && id->typ->form == 13)) && (id->mode == 2 || !id->leaf))) { + OPP_err(245); + } + OPP_CheckSym(20); + if (OPP_sym == 38) { + OPP_qualident(&t); + if (t->mode == 5) { + if (id != NIL) { + idtyp = id->typ; + OPB_TypTest(&y, t, 0); + id->typ = t->typ; + } else { + OPP_err(130); + } + } else { + OPP_err(52); + } + } else { + OPP_err(38); + } + } else { + OPP_err(38); + } + pos = OPM_errpos; + OPP_CheckSym(27); + OPP_StatSeq(&s); + OPB_Construct(15, &y, s); + SetPos__35(y); + if (idtyp != NIL) { + id->typ = idtyp; + idtyp = NIL; + } + if (x == NIL) { + x = y; + lastif = x; + } else { + OPB_Link(&x, &lastif, y); + } + if (OPP_sym == 40) { + OPS_Get(&OPP_sym); + } else { + break; + } + } + e = OPP_sym == 42; + if (e) { + OPS_Get(&OPP_sym); + OPP_StatSeq(&s); + } else { + s = NIL; + } + OPB_Construct(27, &x, s); + OPP_CheckSym(41); + if (e) { + x->subcl = 1; + } + } else if (OPP_sym == 52) { + OPS_Get(&OPP_sym); + if (OPP_LoopLevel == 0) { + OPP_err(46); + } + OPB_Construct(25, &x, NIL); + pos = OPM_errpos; + } else if (OPP_sym == 53) { + OPS_Get(&OPP_sym); + if (OPP_sym < 39) { + OPP_Expression(&x); + } + if (OPP_level > 0) { + OPB_Return(&x, OPT_topScope->link); + } else { + OPB_Return(&x, NIL); + } + pos = OPM_errpos; + } + if (x != NIL) { + SetPos__35(x); + OPB_Link(&*stat, &last, x); + } + if (OPP_sym == 39) { + OPS_Get(&OPP_sym); + } else if (OPP_sym <= 38 || (45 <= OPP_sym && OPP_sym <= 53)) { + OPP_err(39); + } else { + break; + } + } + StatSeq__30_s = _s.lnk; +} + +static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) +{ + OPT_Struct typ = NIL; + OPT_Object obj = NIL, first = NIL, last = NIL; + OPT_Node x = NIL, lastdec = NIL; + INTEGER i; + first = NIL; + last = NIL; + OPP_nofFwdPtr = 0; + for (;;) { + if (OPP_sym == 58) { + OPS_Get(&OPP_sym); + while (OPP_sym == 38) { + OPT_Insert(OPS_name, &obj); + OPP_CheckMark(&obj->vis); + obj->typ = OPT_sinttyp; + obj->mode = 1; + if (OPP_sym == 9) { + OPS_Get(&OPP_sym); + OPP_ConstExpression(&x); + } else if (OPP_sym == 34) { + OPP_err(9); + OPS_Get(&OPP_sym); + OPP_ConstExpression(&x); + } else { + OPP_err(9); + x = OPB_NewIntConst(((LONGINT)(1))); + } + obj->mode = 3; + obj->typ = x->typ; + obj->conval = x->conval; + OPP_CheckSym(39); + } + } + if (OPP_sym == 59) { + OPS_Get(&OPP_sym); + while (OPP_sym == 38) { + OPT_Insert(OPS_name, &obj); + obj->mode = 5; + obj->typ = OPT_undftyp; + OPP_CheckMark(&obj->vis); + if (OPP_sym == 9) { + OPS_Get(&OPP_sym); + OPP_TypeDecl(&obj->typ, &obj->typ); + } else if (OPP_sym == 34 || OPP_sym == 20) { + OPP_err(9); + OPS_Get(&OPP_sym); + OPP_TypeDecl(&obj->typ, &obj->typ); + } else { + OPP_err(9); + } + if (obj->typ->strobj == NIL) { + obj->typ->strobj = obj; + } + if (__IN(obj->typ->comp, 0x1c)) { + i = 0; + while (i < OPP_nofFwdPtr) { + typ = OPP_FwdPtr[__X(i, ((LONGINT)(64)))]; + i += 1; + if (__STRCMP(typ->link->name, obj->name) == 0) { + typ->BaseTyp = obj->typ; + typ->link->name[0] = 0x00; + } + } + } + OPP_CheckSym(39); + } + } + if (OPP_sym == 60) { + OPS_Get(&OPP_sym); + while (OPP_sym == 38) { + for (;;) { + if (OPP_sym == 38) { + OPT_Insert(OPS_name, &obj); + OPP_CheckMark(&obj->vis); + obj->mode = 1; + obj->link = NIL; + obj->leaf = obj->vis == 0; + obj->typ = OPT_undftyp; + if (first == NIL) { + first = obj; + } + if (last == NIL) { + OPT_topScope->scope = obj; + } else { + last->link = obj; + } + last = obj; + } else { + OPP_err(38); + } + if (OPP_sym == 19) { + OPS_Get(&OPP_sym); + } else if (OPP_sym == 38) { + OPP_err(19); + } else { + break; + } + } + OPP_CheckSym(20); + OPP_Type(&typ, &OPT_notyp); + typ->pvused = 1; + if (typ->comp == 3) { + typ = OPT_undftyp; + OPP_err(88); + } + while (first != NIL) { + first->typ = typ; + first = first->link; + } + OPP_CheckSym(39); + } + } + if (OPP_sym < 58 || OPP_sym > 60) { + break; + } + } + i = 0; + while (i < OPP_nofFwdPtr) { + if (OPP_FwdPtr[__X(i, ((LONGINT)(64)))]->link->name[0] != 0x00) { + OPP_err(128); + } + OPP_FwdPtr[__X(i, ((LONGINT)(64)))] = NIL; + i += 1; + } + OPT_topScope->adr = OPM_errpos; + *procdec = NIL; + lastdec = NIL; + while (OPP_sym == 61) { + OPS_Get(&OPP_sym); + OPP_ProcedureDeclaration(&x); + if (x != NIL) { + if (lastdec == NIL) { + *procdec = x; + } else { + lastdec->link = x; + } + lastdec = x; + } + OPP_CheckSym(39); + } + if (OPP_sym == 57) { + OPS_Get(&OPP_sym); + OPP_StatSeq(&*statseq); + } else { + *statseq = NIL; + } + if ((OPP_level == 0 && OPP_TDinit != NIL)) { + OPP_lastTDinit->link = *statseq; + *statseq = OPP_TDinit; + } + OPP_CheckSym(41); +} + +void OPP_Module (OPT_Node *prog, SET opt) +{ + OPS_Name impName, aliasName; + OPT_Node procdec = NIL, statseq = NIL; + LONGINT c; + BOOLEAN done; + OPS_Init(); + OPP_LoopLevel = 0; + OPP_level = 0; + OPS_Get(&OPP_sym); + if (OPP_sym == 63) { + OPS_Get(&OPP_sym); + } else { + OPP_err(16); + } + if (OPP_sym == 38) { + OPM_LogWStr((CHAR*)"compiling ", (LONGINT)11); + OPM_LogWStr(OPS_name, ((LONGINT)(256))); + OPM_LogW('.'); + OPT_Init(OPS_name, opt); + OPS_Get(&OPP_sym); + OPP_CheckSym(39); + if (OPP_sym == 62) { + OPS_Get(&OPP_sym); + for (;;) { + if (OPP_sym == 38) { + __COPY(OPS_name, aliasName, ((LONGINT)(256))); + __COPY(aliasName, impName, ((LONGINT)(256))); + OPS_Get(&OPP_sym); + if (OPP_sym == 34) { + OPS_Get(&OPP_sym); + if (OPP_sym == 38) { + __COPY(OPS_name, impName, ((LONGINT)(256))); + OPS_Get(&OPP_sym); + } else { + OPP_err(38); + } + } + OPT_Import(aliasName, impName, &done); + } else { + OPP_err(38); + } + if (OPP_sym == 19) { + OPS_Get(&OPP_sym); + } else if (OPP_sym == 38) { + OPP_err(19); + } else { + break; + } + } + OPP_CheckSym(39); + } + if (OPM_noerr) { + OPP_TDinit = NIL; + OPP_lastTDinit = NIL; + c = OPM_errpos; + OPP_Block(&procdec, &statseq); + OPB_Enter(&procdec, statseq, NIL); + *prog = procdec; + (*prog)->conval = OPT_NewConst(); + (*prog)->conval->intval = c; + if (OPP_sym == 38) { + if (__STRCMP(OPS_name, OPT_SelfName) != 0) { + OPP_err(4); + } + OPS_Get(&OPP_sym); + } else { + OPP_err(38); + } + if (OPP_sym != 18) { + OPP_err(18); + } + } + } else { + OPP_err(38); + } + OPP_TDinit = NIL; + OPP_lastTDinit = NIL; +} + +static void EnumPtrs(void (*P)(void*)) +{ + P(OPP_TDinit); + P(OPP_lastTDinit); + __ENUMP(OPP_FwdPtr, 64, P); +} + +__TDESC(OPP__1, 1, 0) = {__TDFLDS("", 8), {-4}}; + +export void *OPP__init(void) +{ + __DEFMOD; + __MODULE_IMPORT(OPB); + __MODULE_IMPORT(OPM); + __MODULE_IMPORT(OPS); + __MODULE_IMPORT(OPT); + __REGMOD("OPP", EnumPtrs); + __INITYP(OPP__1, OPP__1, 0); +/* BEGIN */ + __ENDMOD; +} diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h new file mode 100644 index 00000000..1e0a1809 --- /dev/null +++ b/bootstrap/unix-44/OPP.h @@ -0,0 +1,16 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ + +#ifndef OPP__h +#define OPP__h + +#include "SYSTEM.h" +#include "OPT.h" + + + + +import void OPP_Module (OPT_Node *prog, SET opt); +import void *OPP__init(void); + + +#endif diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c new file mode 100644 index 00000000..88944148 --- /dev/null +++ b/bootstrap/unix-44/OPS.c @@ -0,0 +1,623 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin tspkaSfF */ +#include "SYSTEM.h" +#include "OPM.h" + +typedef + CHAR OPS_Name[256]; + +typedef + CHAR OPS_String[256]; + + +export OPS_Name OPS_name; +export OPS_String OPS_str; +export INTEGER OPS_numtyp; +export LONGINT OPS_intval; +export REAL OPS_realval; +export LONGREAL OPS_lrlval; +static CHAR OPS_ch; + + +export void OPS_Get (SHORTINT *sym); +static void OPS_Identifier (SHORTINT *sym); +export void OPS_Init (void); +static void OPS_Number (void); +static void OPS_Str (SHORTINT *sym); +static void OPS_err (INTEGER n); + + +static void OPS_err (INTEGER n) +{ + OPM_err(n); +} + +static void OPS_Str (SHORTINT *sym) +{ + INTEGER i; + CHAR och; + i = 0; + och = OPS_ch; + for (;;) { + OPM_Get(&OPS_ch); + if (OPS_ch == och) { + break; + } + if (OPS_ch < ' ') { + OPS_err(3); + break; + } + if (i == 255) { + OPS_err(241); + break; + } + OPS_str[i] = OPS_ch; + i += 1; + } + OPM_Get(&OPS_ch); + OPS_str[i] = 0x00; + OPS_intval = i + 1; + if (OPS_intval == 2) { + *sym = 35; + OPS_numtyp = 1; + OPS_intval = (int)OPS_str[0]; + } else { + *sym = 37; + } +} + +static void OPS_Identifier (SHORTINT *sym) +{ + INTEGER i; + i = 0; + do { + OPS_name[i] = OPS_ch; + i += 1; + OPM_Get(&OPS_ch); + } while (!(((OPS_ch < '0' || ('9' < OPS_ch && __CAP(OPS_ch) < 'A')) || 'Z' < __CAP(OPS_ch)) || i == 256)); + if (i == 256) { + OPS_err(240); + i -= 1; + } + OPS_name[i] = 0x00; + *sym = 38; +} + +static struct Number__6 { + struct Number__6 *lnk; +} *Number__6_s; + +static INTEGER Ord__7 (CHAR ch, BOOLEAN hex); +static LONGREAL Ten__9 (INTEGER e); + +static LONGREAL Ten__9 (INTEGER e) +{ + LONGREAL _o_result; + LONGREAL x, p; + x = (LONGREAL)1; + p = (LONGREAL)10; + while (e > 0) { + if (__ODD(e)) { + x = x * p; + } + e = __ASHR(e, 1); + if (e > 0) { + p = p * p; + } + } + _o_result = x; + return _o_result; +} + +static INTEGER Ord__7 (CHAR ch, BOOLEAN hex) +{ + INTEGER _o_result; + if (ch <= '9') { + _o_result = (int)ch - 48; + return _o_result; + } else if (hex) { + _o_result = ((int)ch - 65) + 10; + return _o_result; + } else { + OPS_err(2); + _o_result = 0; + return _o_result; + } + __RETCHK; +} + +static void OPS_Number (void) +{ + INTEGER i, m, n, d, e; + CHAR dig[24]; + LONGREAL f; + CHAR expCh; + BOOLEAN neg; + struct Number__6 _s; + _s.lnk = Number__6_s; + Number__6_s = &_s; + i = 0; + m = 0; + n = 0; + d = 0; + for (;;) { + if (('0' <= OPS_ch && OPS_ch <= '9') || (((d == 0 && 'A' <= OPS_ch)) && OPS_ch <= 'F')) { + if (m > 0 || OPS_ch != '0') { + if (n < 24) { + dig[n] = OPS_ch; + n += 1; + } + m += 1; + } + OPM_Get(&OPS_ch); + i += 1; + } else if (OPS_ch == '.') { + OPM_Get(&OPS_ch); + if (OPS_ch == '.') { + OPS_ch = 0x7f; + break; + } else if (d == 0) { + d = i; + } else { + OPS_err(2); + } + } else { + break; + } + } + if (d == 0) { + if (n == m) { + OPS_intval = 0; + i = 0; + if (OPS_ch == 'X') { + OPM_Get(&OPS_ch); + OPS_numtyp = 1; + if (n <= 2) { + while (i < n) { + OPS_intval = __ASHL(OPS_intval, 4) + (LONGINT)Ord__7(dig[i], 1); + i += 1; + } + } else { + OPS_err(203); + } + } else if (OPS_ch == 'H') { + OPM_Get(&OPS_ch); + OPS_numtyp = 2; + if (n <= 8) { + if ((n == 8 && dig[0] > '7')) { + OPS_intval = -1; + } + while (i < n) { + OPS_intval = __ASHL(OPS_intval, 4) + (LONGINT)Ord__7(dig[i], 1); + i += 1; + } + } else { + OPS_err(203); + } + } else { + OPS_numtyp = 2; + while (i < n) { + d = Ord__7(dig[i], 0); + i += 1; + if (OPS_intval <= __DIV(2147483647 - (LONGINT)d, 10)) { + OPS_intval = OPS_intval * 10 + (LONGINT)d; + } else { + OPS_err(203); + } + } + } + } else { + OPS_err(203); + } + } else { + f = (LONGREAL)0; + e = 0; + expCh = 'E'; + while (n > 0) { + n -= 1; + f = (Ord__7(dig[n], 0) + f) / (LONGREAL)(LONGREAL)10; + } + if (OPS_ch == 'E' || OPS_ch == 'D') { + expCh = OPS_ch; + OPM_Get(&OPS_ch); + neg = 0; + if (OPS_ch == '-') { + neg = 1; + OPM_Get(&OPS_ch); + } else if (OPS_ch == '+') { + OPM_Get(&OPS_ch); + } + if (('0' <= OPS_ch && OPS_ch <= '9')) { + do { + n = Ord__7(OPS_ch, 0); + OPM_Get(&OPS_ch); + if (e <= __DIV(32767 - n, 10)) { + e = e * 10 + n; + } else { + OPS_err(203); + } + } while (!(OPS_ch < '0' || '9' < OPS_ch)); + if (neg) { + e = -e; + } + } else { + OPS_err(2); + } + } + e -= (i - d) - m; + if (expCh == 'E') { + OPS_numtyp = 3; + if ((-37 < e && e <= 38)) { + if (e < 0) { + OPS_realval = (f / (LONGREAL)Ten__9(-e)); + } else { + OPS_realval = (f * Ten__9(e)); + } + } else { + OPS_err(203); + } + } else { + OPS_numtyp = 4; + if ((-307 < e && e <= 308)) { + if (e < 0) { + OPS_lrlval = f / (LONGREAL)Ten__9(-e); + } else { + OPS_lrlval = f * Ten__9(e); + } + } else { + OPS_err(203); + } + } + } + Number__6_s = _s.lnk; +} + +static struct Get__1 { + struct Get__1 *lnk; +} *Get__1_s; + +static void Comment__2 (void); + +static void Comment__2 (void) +{ + OPM_Get(&OPS_ch); + for (;;) { + for (;;) { + while (OPS_ch == '(') { + OPM_Get(&OPS_ch); + if (OPS_ch == '*') { + Comment__2(); + } + } + if (OPS_ch == '*') { + OPM_Get(&OPS_ch); + break; + } + if (OPS_ch == 0x00) { + break; + } + OPM_Get(&OPS_ch); + } + if (OPS_ch == ')') { + OPM_Get(&OPS_ch); + break; + } + if (OPS_ch == 0x00) { + OPS_err(5); + break; + } + } +} + +void OPS_Get (SHORTINT *sym) +{ + SHORTINT s; + struct Get__1 _s; + _s.lnk = Get__1_s; + Get__1_s = &_s; + OPM_errpos = OPM_curpos - 1; + while (OPS_ch <= ' ') { + if (OPS_ch == 0x00) { + *sym = 64; + return; + } else { + OPM_Get(&OPS_ch); + } + } + switch (OPS_ch) { + case '\"': case '\'': + OPS_Str(&s); + break; + case '#': + s = 10; + OPM_Get(&OPS_ch); + break; + case '&': + s = 5; + OPM_Get(&OPS_ch); + break; + case '(': + OPM_Get(&OPS_ch); + if (OPS_ch == '*') { + Comment__2(); + OPS_Get(&s); + } else { + s = 30; + } + break; + case ')': + s = 22; + OPM_Get(&OPS_ch); + break; + case '*': + s = 1; + OPM_Get(&OPS_ch); + break; + case '+': + s = 6; + OPM_Get(&OPS_ch); + break; + case ',': + s = 19; + OPM_Get(&OPS_ch); + break; + case '-': + s = 7; + OPM_Get(&OPS_ch); + break; + case '.': + OPM_Get(&OPS_ch); + if (OPS_ch == '.') { + OPM_Get(&OPS_ch); + s = 21; + } else { + s = 18; + } + break; + case '/': + s = 2; + OPM_Get(&OPS_ch); + break; + case '0': case '1': case '2': case '3': case '4': + case '5': case '6': case '7': case '8': case '9': + OPS_Number(); + s = 35; + break; + case ':': + OPM_Get(&OPS_ch); + if (OPS_ch == '=') { + OPM_Get(&OPS_ch); + s = 34; + } else { + s = 20; + } + break; + case ';': + s = 39; + OPM_Get(&OPS_ch); + break; + case '<': + OPM_Get(&OPS_ch); + if (OPS_ch == '=') { + OPM_Get(&OPS_ch); + s = 12; + } else { + s = 11; + } + break; + case '=': + s = 9; + OPM_Get(&OPS_ch); + break; + case '>': + OPM_Get(&OPS_ch); + if (OPS_ch == '=') { + OPM_Get(&OPS_ch); + s = 14; + } else { + s = 13; + } + break; + case 'A': + OPS_Identifier(&s); + if (__STRCMP(OPS_name, "ARRAY") == 0) { + s = 54; + } + break; + case 'B': + OPS_Identifier(&s); + if (__STRCMP(OPS_name, "BEGIN") == 0) { + s = 57; + } else if (__STRCMP(OPS_name, "BY") == 0) { + s = 29; + } + break; + case 'C': + OPS_Identifier(&s); + if (__STRCMP(OPS_name, "CASE") == 0) { + s = 46; + } else if (__STRCMP(OPS_name, "CONST") == 0) { + s = 58; + } + break; + case 'D': + OPS_Identifier(&s); + if (__STRCMP(OPS_name, "DO") == 0) { + s = 27; + } else if (__STRCMP(OPS_name, "DIV") == 0) { + s = 3; + } + break; + case 'E': + OPS_Identifier(&s); + if (__STRCMP(OPS_name, "END") == 0) { + s = 41; + } else if (__STRCMP(OPS_name, "ELSE") == 0) { + s = 42; + } else if (__STRCMP(OPS_name, "ELSIF") == 0) { + s = 43; + } else if (__STRCMP(OPS_name, "EXIT") == 0) { + s = 52; + } + break; + case 'F': + OPS_Identifier(&s); + if (__STRCMP(OPS_name, "FOR") == 0) { + s = 49; + } + break; + case 'I': + OPS_Identifier(&s); + if (__STRCMP(OPS_name, "IF") == 0) { + s = 45; + } else if (__STRCMP(OPS_name, "IN") == 0) { + s = 15; + } else if (__STRCMP(OPS_name, "IS") == 0) { + s = 16; + } else if (__STRCMP(OPS_name, "IMPORT") == 0) { + s = 62; + } + break; + case 'L': + OPS_Identifier(&s); + if (__STRCMP(OPS_name, "LOOP") == 0) { + s = 50; + } + break; + case 'M': + OPS_Identifier(&s); + if (__STRCMP(OPS_name, "MOD") == 0) { + s = 4; + } else if (__STRCMP(OPS_name, "MODULE") == 0) { + s = 63; + } + break; + case 'N': + OPS_Identifier(&s); + if (__STRCMP(OPS_name, "NIL") == 0) { + s = 36; + } + break; + case 'O': + OPS_Identifier(&s); + if (__STRCMP(OPS_name, "OR") == 0) { + s = 8; + } else if (__STRCMP(OPS_name, "OF") == 0) { + s = 25; + } + break; + case 'P': + OPS_Identifier(&s); + if (__STRCMP(OPS_name, "PROCEDURE") == 0) { + s = 61; + } else if (__STRCMP(OPS_name, "POINTER") == 0) { + s = 56; + } + break; + case 'R': + OPS_Identifier(&s); + if (__STRCMP(OPS_name, "RECORD") == 0) { + s = 55; + } else if (__STRCMP(OPS_name, "REPEAT") == 0) { + s = 48; + } else if (__STRCMP(OPS_name, "RETURN") == 0) { + s = 53; + } + break; + case 'T': + OPS_Identifier(&s); + if (__STRCMP(OPS_name, "THEN") == 0) { + s = 26; + } else if (__STRCMP(OPS_name, "TO") == 0) { + s = 28; + } else if (__STRCMP(OPS_name, "TYPE") == 0) { + s = 59; + } + break; + case 'U': + OPS_Identifier(&s); + if (__STRCMP(OPS_name, "UNTIL") == 0) { + s = 44; + } + break; + case 'V': + OPS_Identifier(&s); + if (__STRCMP(OPS_name, "VAR") == 0) { + s = 60; + } + break; + case 'W': + OPS_Identifier(&s); + if (__STRCMP(OPS_name, "WHILE") == 0) { + s = 47; + } else if (__STRCMP(OPS_name, "WITH") == 0) { + s = 51; + } + break; + case 'G': case 'H': case 'J': case 'K': case 'Q': + case 'S': case 'X': case 'Y': case 'Z': + OPS_Identifier(&s); + break; + case '[': + s = 31; + OPM_Get(&OPS_ch); + break; + case ']': + s = 23; + OPM_Get(&OPS_ch); + break; + case '^': + s = 17; + OPM_Get(&OPS_ch); + break; + case 'a': case 'b': case 'c': case 'd': case 'e': + case 'f': case 'g': case 'h': case 'i': case 'j': + case 'k': case 'l': case 'm': case 'n': case 'o': + case 'p': case 'q': case 'r': case 's': case 't': + case 'u': case 'v': case 'w': case 'x': case 'y': + case 'z': + OPS_Identifier(&s); + break; + case '{': + s = 32; + OPM_Get(&OPS_ch); + break; + case '|': + s = 40; + OPM_Get(&OPS_ch); + break; + case '}': + s = 24; + OPM_Get(&OPS_ch); + break; + case '~': + s = 33; + OPM_Get(&OPS_ch); + break; + case 0x7f: + s = 21; + OPM_Get(&OPS_ch); + break; + default: + s = 0; + OPM_Get(&OPS_ch); + break; + } + *sym = s; + Get__1_s = _s.lnk; +} + +void OPS_Init (void) +{ + OPS_ch = ' '; +} + + +export void *OPS__init(void) +{ + __DEFMOD; + __MODULE_IMPORT(OPM); + __REGMOD("OPS", 0); + __REGCMD("Init", OPS_Init); +/* BEGIN */ + __ENDMOD; +} diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h new file mode 100644 index 00000000..87a614f4 --- /dev/null +++ b/bootstrap/unix-44/OPS.h @@ -0,0 +1,28 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin tspkaSfF */ + +#ifndef OPS__h +#define OPS__h + +#include "SYSTEM.h" + +typedef + CHAR OPS_Name[256]; + +typedef + CHAR OPS_String[256]; + + +import OPS_Name OPS_name; +import OPS_String OPS_str; +import INTEGER OPS_numtyp; +import LONGINT OPS_intval; +import REAL OPS_realval; +import LONGREAL OPS_lrlval; + + +import void OPS_Get (SHORTINT *sym); +import void OPS_Init (void); +import void *OPS__init(void); + + +#endif diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c new file mode 100644 index 00000000..fc80ce02 --- /dev/null +++ b/bootstrap/unix-44/OPT.c @@ -0,0 +1,1858 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +#include "SYSTEM.h" +#include "OPM.h" +#include "OPS.h" + +typedef + struct OPT_ConstDesc *OPT_Const; + +typedef + OPS_String *OPT_ConstExt; + +typedef + struct OPT_ConstDesc { + OPT_ConstExt ext; + LONGINT intval, intval2; + SET setval; + LONGREAL realval; + } OPT_ConstDesc; + +typedef + struct OPT_ExpCtxt { + LONGINT reffp; + INTEGER ref; + SHORTINT nofm; + SHORTINT locmno[64]; + } OPT_ExpCtxt; + +typedef + struct OPT_StrDesc *OPT_Struct; + +typedef + struct OPT_ObjDesc *OPT_Object; + +typedef + struct OPT_ImpCtxt { + LONGINT nextTag, reffp; + INTEGER nofr, minr, nofm; + BOOLEAN self; + OPT_Struct ref[255]; + OPT_Object old[255]; + LONGINT pvfp[255]; + SHORTINT glbmno[64]; + } OPT_ImpCtxt; + +typedef + struct OPT_NodeDesc *OPT_Node; + +typedef + struct OPT_NodeDesc { + OPT_Node left, right, link; + SHORTINT class, subcl; + BOOLEAN readonly; + OPT_Struct typ; + OPT_Object obj; + OPT_Const conval; + } OPT_NodeDesc; + +typedef + struct OPT_ObjDesc { + OPT_Object left, right, link, scope; + OPS_Name name; + BOOLEAN leaf; + SHORTINT mode, mnolev, vis, history; + BOOLEAN used, fpdone; + LONGINT fprint; + OPT_Struct typ; + OPT_Const conval; + LONGINT adr, linkadr; + INTEGER x; + } OPT_ObjDesc; + +typedef + struct OPT_StrDesc { + SHORTINT form, comp, mno, extlev; + INTEGER ref, sysflag; + LONGINT n, size, align, txtpos; + BOOLEAN allocated, pbused, pvused, fpdone, idfpdone; + LONGINT idfp, pbfp, pvfp; + OPT_Struct BaseTyp; + OPT_Object link, strobj; + } OPT_StrDesc; + + +export void (*OPT_typSize)(OPT_Struct); +export OPT_Object OPT_topScope; +export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +export SHORTINT OPT_nofGmod; +export OPT_Object OPT_GlbMod[64]; +export OPS_Name OPT_SelfName; +export BOOLEAN OPT_SYSimported; +static OPT_Object OPT_universe, OPT_syslink; +static OPT_ImpCtxt OPT_impCtxt; +static OPT_ExpCtxt OPT_expCtxt; +static LONGINT OPT_nofhdfld; +static BOOLEAN OPT_newsf, OPT_findpc, OPT_extsf, OPT_sfpresent, OPT_symExtended, OPT_symNew; + +export LONGINT *OPT_ConstDesc__typ; +export LONGINT *OPT_ObjDesc__typ; +export LONGINT *OPT_StrDesc__typ; +export LONGINT *OPT_NodeDesc__typ; +export LONGINT *OPT_ImpCtxt__typ; +export LONGINT *OPT_ExpCtxt__typ; + +export void OPT_Close (void); +export void OPT_CloseScope (void); +static void OPT_DebugStruct (OPT_Struct btyp); +static void OPT_EnterBoolConst (OPS_Name name, LONGINT value); +static void OPT_EnterProc (OPS_Name name, INTEGER num); +static void OPT_EnterTyp (OPS_Name name, SHORTINT form, INTEGER size, OPT_Struct *res); +export void OPT_Export (BOOLEAN *ext, BOOLEAN *new); +export void OPT_FPrintErr (OPT_Object obj, INTEGER errcode); +static void OPT_FPrintName (LONGINT *fp, CHAR *name, LONGINT name__len); +export void OPT_FPrintObj (OPT_Object obj); +static void OPT_FPrintSign (LONGINT *fp, OPT_Struct result, OPT_Object par); +export void OPT_FPrintStr (OPT_Struct typ); +export void OPT_Find (OPT_Object *res); +export void OPT_FindField (OPS_Name name, OPT_Struct typ, OPT_Object *res); +export void OPT_FindImport (OPT_Object mod, OPT_Object *res); +export void OPT_IdFPrint (OPT_Struct typ); +export void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); +static void OPT_InConstant (LONGINT f, OPT_Const conval); +static OPT_Object OPT_InFld (void); +static void OPT_InMod (SHORTINT *mno); +static void OPT_InName (CHAR *name, LONGINT name__len); +static OPT_Object OPT_InObj (SHORTINT mno); +static void OPT_InSign (SHORTINT mno, OPT_Struct *res, OPT_Object *par); +static void OPT_InStruct (OPT_Struct *typ); +static OPT_Object OPT_InTProc (SHORTINT mno); +export void OPT_Init (OPS_Name name, SET opt); +static void OPT_InitStruct (OPT_Struct *typ, SHORTINT form); +export void OPT_Insert (OPS_Name name, OPT_Object *obj); +export void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); +export OPT_Const OPT_NewConst (void); +export OPT_ConstExt OPT_NewExt (void); +export OPT_Node OPT_NewNode (SHORTINT class); +export OPT_Object OPT_NewObj (void); +export OPT_Struct OPT_NewStr (SHORTINT form, SHORTINT comp); +export void OPT_OpenScope (SHORTINT level, OPT_Object owner); +static void OPT_OutConstant (OPT_Object obj); +static void OPT_OutFlds (OPT_Object fld, LONGINT adr, BOOLEAN visible); +static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, LONGINT adr); +static void OPT_OutMod (INTEGER mno); +static void OPT_OutName (CHAR *name, LONGINT name__len); +static void OPT_OutObj (OPT_Object obj); +static void OPT_OutSign (OPT_Struct result, OPT_Object par); +static void OPT_OutStr (OPT_Struct typ); +static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj); +static void OPT_err (INTEGER n); + + +static void OPT_err (INTEGER n) +{ + OPM_err(n); +} + +OPT_Const OPT_NewConst (void) +{ + OPT_Const _o_result; + OPT_Const const_ = NIL; + __NEW(const_, OPT_ConstDesc); + _o_result = const_; + return _o_result; +} + +OPT_Object OPT_NewObj (void) +{ + OPT_Object _o_result; + OPT_Object obj = NIL; + __NEW(obj, OPT_ObjDesc); + _o_result = obj; + return _o_result; +} + +OPT_Struct OPT_NewStr (SHORTINT form, SHORTINT comp) +{ + OPT_Struct _o_result; + OPT_Struct typ = NIL; + __NEW(typ, OPT_StrDesc); + typ->form = form; + typ->comp = comp; + typ->ref = 255; + if (form != 0) { + typ->txtpos = OPM_errpos; + } + typ->size = -1; + typ->BaseTyp = OPT_undftyp; + _o_result = typ; + return _o_result; +} + +OPT_Node OPT_NewNode (SHORTINT class) +{ + OPT_Node _o_result; + OPT_Node node = NIL; + __NEW(node, OPT_NodeDesc); + node->class = class; + _o_result = node; + return _o_result; +} + +OPT_ConstExt OPT_NewExt (void) +{ + OPT_ConstExt _o_result; + OPT_ConstExt ext = NIL; + ext = __NEWARR(NIL, ((LONGINT)(1)), 1, 1, 0, (LONGINT)256); + _o_result = ext; + return _o_result; +} + +void OPT_OpenScope (SHORTINT level, OPT_Object owner) +{ + OPT_Object head = NIL; + head = OPT_NewObj(); + head->mode = 12; + head->mnolev = level; + head->link = owner; + if (owner != NIL) { + owner->scope = head; + } + head->left = OPT_topScope; + head->right = NIL; + head->scope = NIL; + OPT_topScope = head; +} + +void OPT_CloseScope (void) +{ + OPT_topScope = OPT_topScope->left; +} + +void OPT_Init (OPS_Name name, SET opt) +{ + OPT_topScope = OPT_universe; + OPT_OpenScope(0, NIL); + OPT_SYSimported = 0; + __COPY(name, OPT_SelfName, ((LONGINT)(256))); + __COPY(name, OPT_topScope->name, ((LONGINT)(256))); + OPT_GlbMod[0] = OPT_topScope; + OPT_nofGmod = 1; + OPT_newsf = __IN(4, opt); + OPT_findpc = __IN(8, opt); + OPT_extsf = OPT_newsf || __IN(9, opt); + OPT_sfpresent = 1; +} + +void OPT_Close (void) +{ + INTEGER i; + OPT_CloseScope(); + i = 0; + while (i < 64) { + OPT_GlbMod[__X(i, ((LONGINT)(64)))] = NIL; + i += 1; + } + i = 16; + while (i < 255) { + OPT_impCtxt.ref[__X(i, ((LONGINT)(255)))] = NIL; + OPT_impCtxt.old[__X(i, ((LONGINT)(255)))] = NIL; + i += 1; + } +} + +void OPT_FindImport (OPT_Object mod, OPT_Object *res) +{ + OPT_Object obj = NIL; + obj = mod->scope; + for (;;) { + if (obj == NIL) { + break; + } + if (__STRCMP(OPS_name, obj->name) < 0) { + obj = obj->left; + } else if (__STRCMP(OPS_name, obj->name) > 0) { + obj = obj->right; + } else { + if ((obj->mode == 5 && obj->vis == 0)) { + obj = NIL; + } else { + obj->used = 1; + } + break; + } + } + *res = obj; +} + +void OPT_Find (OPT_Object *res) +{ + OPT_Object obj = NIL, head = NIL; + head = OPT_topScope; + for (;;) { + obj = head->right; + for (;;) { + if (obj == NIL) { + break; + } + if (__STRCMP(OPS_name, obj->name) < 0) { + obj = obj->left; + } else if (__STRCMP(OPS_name, obj->name) > 0) { + obj = obj->right; + } else { + break; + } + } + if (obj != NIL) { + break; + } + head = head->left; + if (head == NIL) { + break; + } + } + *res = obj; +} + +void OPT_FindField (OPS_Name name, OPT_Struct typ, OPT_Object *res) +{ + OPT_Object obj = NIL; + while (typ != NIL) { + obj = typ->link; + while (obj != NIL) { + if (__STRCMP(name, obj->name) < 0) { + obj = obj->left; + } else if (__STRCMP(name, obj->name) > 0) { + obj = obj->right; + } else { + *res = obj; + return; + } + } + typ = typ->BaseTyp; + } + *res = NIL; +} + +void OPT_Insert (OPS_Name name, OPT_Object *obj) +{ + OPT_Object ob0 = NIL, ob1 = NIL; + BOOLEAN left; + SHORTINT mnolev; + ob0 = OPT_topScope; + ob1 = ob0->right; + left = 0; + for (;;) { + if (ob1 != NIL) { + if (__STRCMP(name, ob1->name) < 0) { + ob0 = ob1; + ob1 = ob0->left; + left = 1; + } else if (__STRCMP(name, ob1->name) > 0) { + ob0 = ob1; + ob1 = ob0->right; + left = 0; + } else { + OPT_err(1); + ob0 = ob1; + ob1 = ob0->right; + } + } else { + ob1 = OPT_NewObj(); + ob1->leaf = 1; + if (left) { + ob0->left = ob1; + } else { + ob0->right = ob1; + } + ob1->left = NIL; + ob1->right = NIL; + __COPY(name, ob1->name, ((LONGINT)(256))); + mnolev = OPT_topScope->mnolev; + ob1->mnolev = mnolev; + break; + } + } + *obj = ob1; +} + +static void OPT_FPrintName (LONGINT *fp, CHAR *name, LONGINT name__len) +{ + INTEGER i; + CHAR ch; + i = 0; + do { + ch = name[__X(i, name__len)]; + OPM_FPrint(&*fp, (int)ch); + i += 1; + } while (!(ch == 0x00)); +} + +static void OPT_DebugStruct (OPT_Struct btyp) +{ + OPM_LogWLn(); + if (btyp == NIL) { + OPM_LogWStr((CHAR*)"btyp is nil", (LONGINT)12); + OPM_LogWLn(); + } + OPM_LogWStr((CHAR*)"btyp^.strobji^.name = ", (LONGINT)23); + OPM_LogWStr(btyp->strobj->name, ((LONGINT)(256))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"btyp^.form = ", (LONGINT)14); + OPM_LogWNum(btyp->form, ((LONGINT)(0))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"btyp^.comp = ", (LONGINT)14); + OPM_LogWNum(btyp->comp, ((LONGINT)(0))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"btyp^.mno = ", (LONGINT)13); + OPM_LogWNum(btyp->mno, ((LONGINT)(0))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"btyp^.extlev = ", (LONGINT)16); + OPM_LogWNum(btyp->extlev, ((LONGINT)(0))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"btyp^.size = ", (LONGINT)14); + OPM_LogWNum(btyp->size, ((LONGINT)(0))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"btyp^.align = ", (LONGINT)15); + OPM_LogWNum(btyp->align, ((LONGINT)(0))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"btyp^.txtpos = ", (LONGINT)16); + OPM_LogWNum(btyp->txtpos, ((LONGINT)(0))); + OPM_LogWLn(); +} + +static void OPT_FPrintSign (LONGINT *fp, OPT_Struct result, OPT_Object par) +{ + OPT_IdFPrint(result); + OPM_FPrint(&*fp, result->idfp); + while (par != NIL) { + OPM_FPrint(&*fp, par->mode); + OPT_IdFPrint(par->typ); + OPM_FPrint(&*fp, par->typ->idfp); + par = par->link; + } +} + +void OPT_IdFPrint (OPT_Struct typ) +{ + OPT_Struct btyp = NIL; + OPT_Object strobj = NIL; + LONGINT idfp; + INTEGER f, c; + if (!typ->idfpdone) { + typ->idfpdone = 1; + idfp = 0; + f = typ->form; + c = typ->comp; + OPM_FPrint(&idfp, f); + OPM_FPrint(&idfp, c); + btyp = typ->BaseTyp; + strobj = typ->strobj; + if ((strobj != NIL && strobj->name[0] != 0x00)) { + OPT_FPrintName(&idfp, (void*)OPT_GlbMod[__X(typ->mno, ((LONGINT)(64)))]->name, ((LONGINT)(256))); + OPT_FPrintName(&idfp, (void*)strobj->name, ((LONGINT)(256))); + } + if ((f == 13 || (c == 4 && btyp != NIL)) || c == 3) { + OPT_IdFPrint(btyp); + OPM_FPrint(&idfp, btyp->idfp); + } else if (c == 2) { + OPT_IdFPrint(btyp); + OPM_FPrint(&idfp, btyp->idfp); + OPM_FPrint(&idfp, typ->n); + } else if (f == 14) { + OPT_FPrintSign(&idfp, btyp, typ->link); + } + typ->idfp = idfp; + } +} + +static struct FPrintStr__12 { + LONGINT *pbfp, *pvfp; + struct FPrintStr__12 *lnk; +} *FPrintStr__12_s; + +static void FPrintFlds__13 (OPT_Object fld, LONGINT adr, BOOLEAN visible); +static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr); +static void FPrintTProcs__17 (OPT_Object obj); + +static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr) +{ + LONGINT i, j, n; + OPT_Struct btyp = NIL; + if (typ->comp == 4) { + FPrintFlds__13(typ->link, adr, 0); + } else if (typ->comp == 2) { + btyp = typ->BaseTyp; + n = typ->n; + while (btyp->comp == 2) { + n = btyp->n * n; + btyp = btyp->BaseTyp; + } + if (btyp->form == 13 || btyp->comp == 4) { + j = OPT_nofhdfld; + FPrintHdFld__15(btyp, fld, adr); + if (j != OPT_nofhdfld) { + i = 1; + while ((i < n && OPT_nofhdfld <= 2048)) { + adr += btyp->size; + FPrintHdFld__15(btyp, fld, adr); + i += 1; + } + } + } + } else if (typ->form == 13 || __STRCMP(fld->name, "@ptr") == 0) { + OPM_FPrint(&*FPrintStr__12_s->pvfp, ((LONGINT)(13))); + OPM_FPrint(&*FPrintStr__12_s->pvfp, adr); + OPT_nofhdfld += 1; + } +} + +static void FPrintFlds__13 (OPT_Object fld, LONGINT adr, BOOLEAN visible) +{ + while ((fld != NIL && fld->mode == 4)) { + if ((fld->vis != 0 && visible)) { + OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->vis); + OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)fld->name, ((LONGINT)(256))); + OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->adr); + OPT_FPrintStr(fld->typ); + OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->typ->pbfp); + OPM_FPrint(&*FPrintStr__12_s->pvfp, fld->typ->pvfp); + } else { + FPrintHdFld__15(fld->typ, fld, fld->adr + adr); + } + fld = fld->link; + } +} + +static void FPrintTProcs__17 (OPT_Object obj) +{ + if (obj != NIL) { + FPrintTProcs__17(obj->left); + if (obj->mode == 13) { + if (obj->vis != 0) { + OPM_FPrint(&*FPrintStr__12_s->pbfp, ((LONGINT)(13))); + OPM_FPrint(&*FPrintStr__12_s->pbfp, __ASHR(obj->adr, 16)); + OPT_FPrintSign(&*FPrintStr__12_s->pbfp, obj->typ, obj->link); + OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)obj->name, ((LONGINT)(256))); + } + } + FPrintTProcs__17(obj->right); + } +} + +void OPT_FPrintStr (OPT_Struct typ) +{ + INTEGER f, c; + OPT_Struct btyp = NIL; + OPT_Object strobj = NIL, bstrobj = NIL; + LONGINT pbfp, pvfp; + struct FPrintStr__12 _s; + _s.pbfp = &pbfp; + _s.pvfp = &pvfp; + _s.lnk = FPrintStr__12_s; + FPrintStr__12_s = &_s; + if (!typ->fpdone) { + OPT_IdFPrint(typ); + pbfp = typ->idfp; + if (typ->sysflag != 0) { + OPM_FPrint(&pbfp, typ->sysflag); + } + pvfp = pbfp; + typ->pbfp = pbfp; + typ->pvfp = pvfp; + typ->fpdone = 1; + f = typ->form; + c = typ->comp; + btyp = typ->BaseTyp; + if (f == 13) { + strobj = typ->strobj; + bstrobj = btyp->strobj; + if (((strobj == NIL || strobj->name[0] == 0x00) || bstrobj == NIL) || bstrobj->name[0] == 0x00) { + OPT_FPrintStr(btyp); + OPM_FPrint(&pbfp, btyp->pbfp); + pvfp = pbfp; + } + } else if (f == 14) { + } else if (__IN(c, 0x0c)) { + OPT_FPrintStr(btyp); + OPM_FPrint(&pbfp, btyp->pvfp); + pvfp = pbfp; + } else { + if (btyp != NIL) { + OPT_FPrintStr(btyp); + OPM_FPrint(&pbfp, btyp->pbfp); + OPM_FPrint(&pvfp, btyp->pvfp); + } + OPM_FPrint(&pvfp, typ->size); + OPM_FPrint(&pvfp, typ->align); + OPM_FPrint(&pvfp, typ->n); + OPT_nofhdfld = 0; + FPrintFlds__13(typ->link, ((LONGINT)(0)), 1); + if (OPT_nofhdfld > 2048) { + OPM_Mark(225, typ->txtpos); + } + FPrintTProcs__17(typ->link); + OPM_FPrint(&pvfp, pbfp); + strobj = typ->strobj; + if (strobj == NIL || strobj->name[0] == 0x00) { + pbfp = pvfp; + } + } + typ->pbfp = pbfp; + typ->pvfp = pvfp; + } + FPrintStr__12_s = _s.lnk; +} + +void OPT_FPrintObj (OPT_Object obj) +{ + LONGINT fprint; + INTEGER f, m; + REAL rval; + OPT_ConstExt ext = NIL; + if (!obj->fpdone) { + fprint = 0; + obj->fpdone = 1; + OPM_FPrint(&fprint, obj->mode); + if (obj->mode == 3) { + f = obj->typ->form; + OPM_FPrint(&fprint, f); + switch (f) { + case 2: case 3: case 4: case 5: case 6: + OPM_FPrint(&fprint, obj->conval->intval); + break; + case 9: + OPM_FPrintSet(&fprint, obj->conval->setval); + break; + case 7: + rval = obj->conval->realval; + OPM_FPrintReal(&fprint, rval); + break; + case 8: + OPM_FPrintLReal(&fprint, obj->conval->realval); + break; + case 10: + OPT_FPrintName(&fprint, (void*)*obj->conval->ext, ((LONGINT)(256))); + break; + case 11: + break; + default: + OPT_err(127); + break; + } + } else if (obj->mode == 1) { + OPM_FPrint(&fprint, obj->vis); + OPT_FPrintStr(obj->typ); + OPM_FPrint(&fprint, obj->typ->pbfp); + } else if (__IN(obj->mode, 0x0480)) { + OPT_FPrintSign(&fprint, obj->typ, obj->link); + } else if (obj->mode == 9) { + OPT_FPrintSign(&fprint, obj->typ, obj->link); + ext = obj->conval->ext; + m = (int)(*ext)[0]; + f = 1; + OPM_FPrint(&fprint, m); + while (f <= m) { + OPM_FPrint(&fprint, (int)(*ext)[__X(f, ((LONGINT)(256)))]); + f += 1; + } + } else if (obj->mode == 5) { + OPT_FPrintStr(obj->typ); + OPM_FPrint(&fprint, obj->typ->pbfp); + } + obj->fprint = fprint; + } +} + +void OPT_FPrintErr (OPT_Object obj, INTEGER errcode) +{ + INTEGER i, j; + CHAR ch; + if (obj->mnolev != 0) { + __COPY(OPT_GlbMod[__X(-obj->mnolev, ((LONGINT)(64)))]->name, OPM_objname, ((LONGINT)(64))); + i = 0; + while (OPM_objname[__X(i, ((LONGINT)(64)))] != 0x00) { + i += 1; + } + OPM_objname[__X(i, ((LONGINT)(64)))] = '.'; + j = 0; + i += 1; + do { + ch = obj->name[__X(j, ((LONGINT)(256)))]; + OPM_objname[__X(i, ((LONGINT)(64)))] = ch; + j += 1; + i += 1; + } while (!(ch == 0x00)); + } else { + __COPY(obj->name, OPM_objname, ((LONGINT)(64))); + } + if (errcode == 249) { + if (OPM_noerr) { + OPT_err(errcode); + } + } else if (errcode == 253) { + if ((((!OPT_symNew && !OPT_symExtended)) && !OPT_extsf)) { + OPT_err(errcode); + } + OPT_symExtended = 1; + } else { + if ((!OPT_symNew && !OPT_newsf)) { + OPT_err(errcode); + } + OPT_symNew = 1; + } +} + +void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old) +{ + OPT_Object ob0 = NIL, ob1 = NIL; + BOOLEAN left; + if (*root == NIL) { + *root = obj; + *old = NIL; + } else { + ob0 = *root; + ob1 = ob0->right; + left = 0; + if (__STRCMP(obj->name, ob0->name) < 0) { + ob1 = ob0->left; + left = 1; + } else if (__STRCMP(obj->name, ob0->name) > 0) { + ob1 = ob0->right; + left = 0; + } else { + *old = ob0; + return; + } + for (;;) { + if (ob1 != NIL) { + if (__STRCMP(obj->name, ob1->name) < 0) { + ob0 = ob1; + ob1 = ob1->left; + left = 1; + } else if (__STRCMP(obj->name, ob1->name) > 0) { + ob0 = ob1; + ob1 = ob1->right; + left = 0; + } else { + *old = ob1; + break; + } + } else { + ob1 = obj; + if (left) { + ob0->left = ob1; + } else { + ob0->right = ob1; + } + ob1->left = NIL; + ob1->right = NIL; + *old = NIL; + break; + } + } + } +} + +static void OPT_InName (CHAR *name, LONGINT name__len) +{ + INTEGER i; + CHAR ch; + i = 0; + do { + OPM_SymRCh(&ch); + name[__X(i, name__len)] = ch; + i += 1; + } while (!(ch == 0x00)); +} + +static void OPT_InMod (SHORTINT *mno) +{ + OPT_Object head = NIL; + OPS_Name name; + LONGINT mn; + SHORTINT i; + mn = OPM_SymRInt(); + if (mn == 0) { + *mno = OPT_impCtxt.glbmno[0]; + } else { + if (mn == 16) { + OPT_InName((void*)name, ((LONGINT)(256))); + if ((__STRCMP(name, OPT_SelfName) == 0 && !OPT_impCtxt.self)) { + OPT_err(154); + } + i = 0; + while ((i < OPT_nofGmod && __STRCMP(name, OPT_GlbMod[__X(i, ((LONGINT)(64)))]->name) != 0)) { + i += 1; + } + if (i < OPT_nofGmod) { + *mno = i; + } else { + head = OPT_NewObj(); + head->mode = 12; + __COPY(name, head->name, ((LONGINT)(256))); + *mno = OPT_nofGmod; + head->mnolev = -*mno; + if (OPT_nofGmod < 64) { + OPT_GlbMod[__X(*mno, ((LONGINT)(64)))] = head; + OPT_nofGmod += 1; + } else { + OPT_err(227); + } + } + OPT_impCtxt.glbmno[__X(OPT_impCtxt.nofm, ((LONGINT)(64)))] = *mno; + OPT_impCtxt.nofm += 1; + } else { + *mno = OPT_impCtxt.glbmno[__X(-mn, ((LONGINT)(64)))]; + } + } +} + +static void OPT_InConstant (LONGINT f, OPT_Const conval) +{ + CHAR ch; + INTEGER i; + OPT_ConstExt ext = NIL; + REAL rval; + switch (f) { + case 1: case 3: case 2: + OPM_SymRCh(&ch); + conval->intval = (int)ch; + break; + case 4: case 5: case 6: + conval->intval = OPM_SymRInt(); + break; + case 9: + OPM_SymRSet(&conval->setval); + break; + case 7: + OPM_SymRReal(&rval); + conval->realval = rval; + conval->intval = -1; + break; + case 8: + OPM_SymRLReal(&conval->realval); + conval->intval = -1; + break; + case 10: + ext = OPT_NewExt(); + conval->ext = ext; + i = 0; + do { + OPM_SymRCh(&ch); + (*ext)[__X(i, ((LONGINT)(256)))] = ch; + i += 1; + } while (!(ch == 0x00)); + conval->intval2 = i; + conval->intval = -1; + break; + case 11: + conval->intval = 0; + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPT.InConstant(), f = ", (LONGINT)41); + OPM_LogWNum(f, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } +} + +static void OPT_InSign (SHORTINT mno, OPT_Struct *res, OPT_Object *par) +{ + OPT_Object last = NIL, new = NIL; + LONGINT tag; + OPT_InStruct(&*res); + tag = OPM_SymRInt(); + last = NIL; + while (tag != 18) { + new = OPT_NewObj(); + new->mnolev = -mno; + if (last == NIL) { + *par = new; + } else { + last->link = new; + } + if (tag == 23) { + new->mode = 1; + } else { + new->mode = 2; + } + OPT_InStruct(&new->typ); + new->adr = OPM_SymRInt(); + OPT_InName((void*)new->name, ((LONGINT)(256))); + last = new; + tag = OPM_SymRInt(); + } +} + +static OPT_Object OPT_InFld (void) +{ + OPT_Object _o_result; + LONGINT tag; + OPT_Object obj = NIL; + tag = OPT_impCtxt.nextTag; + obj = OPT_NewObj(); + if (tag <= 26) { + obj->mode = 4; + if (tag == 26) { + obj->vis = 2; + } else { + obj->vis = 1; + } + OPT_InStruct(&obj->typ); + OPT_InName((void*)obj->name, ((LONGINT)(256))); + obj->adr = OPM_SymRInt(); + } else { + obj->mode = 4; + if (tag == 27) { + __MOVE("@ptr", obj->name, 5); + } else { + __MOVE("@proc", obj->name, 6); + } + obj->typ = OPT_undftyp; + obj->vis = 0; + obj->adr = OPM_SymRInt(); + } + _o_result = obj; + return _o_result; +} + +static OPT_Object OPT_InTProc (SHORTINT mno) +{ + OPT_Object _o_result; + LONGINT tag; + OPT_Object obj = NIL; + tag = OPT_impCtxt.nextTag; + obj = OPT_NewObj(); + obj->mnolev = -mno; + if (tag == 29) { + obj->mode = 13; + obj->conval = OPT_NewConst(); + obj->conval->intval = -1; + OPT_InSign(mno, &obj->typ, &obj->link); + obj->vis = 1; + OPT_InName((void*)obj->name, ((LONGINT)(256))); + obj->adr = __ASHL(OPM_SymRInt(), 16); + } else { + obj->mode = 13; + __MOVE("@tproc", obj->name, 7); + obj->link = OPT_NewObj(); + obj->typ = OPT_undftyp; + obj->vis = 0; + obj->adr = __ASHL(OPM_SymRInt(), 16); + } + _o_result = obj; + return _o_result; +} + +static void OPT_InStruct (OPT_Struct *typ) +{ + SHORTINT mno; + INTEGER ref; + LONGINT tag; + OPS_Name name; + OPT_Struct t = NIL; + OPT_Object obj = NIL, last = NIL, fld = NIL, old = NIL, dummy = NIL; + tag = OPM_SymRInt(); + if (tag != 34) { + *typ = OPT_impCtxt.ref[__X(-tag, ((LONGINT)(255)))]; + } else { + ref = OPT_impCtxt.nofr; + OPT_impCtxt.nofr += 1; + if (ref < OPT_impCtxt.minr) { + OPT_impCtxt.minr = ref; + } + OPT_InMod(&mno); + OPT_InName((void*)name, ((LONGINT)(256))); + obj = OPT_NewObj(); + if (name[0] == 0x00) { + if (OPT_impCtxt.self) { + old = NIL; + } else { + __MOVE("@", obj->name, 2); + OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->right, &old); + obj->name[0] = 0x00; + } + *typ = OPT_NewStr(0, 1); + } else { + __COPY(name, obj->name, ((LONGINT)(256))); + OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->right, &old); + if (old != NIL) { + OPT_FPrintObj(old); + OPT_impCtxt.pvfp[__X(ref, ((LONGINT)(255)))] = old->typ->pvfp; + if (OPT_impCtxt.self) { + *typ = OPT_NewStr(0, 1); + } else { + *typ = old->typ; + (*typ)->link = NIL; + (*typ)->sysflag = 0; + (*typ)->fpdone = 0; + (*typ)->idfpdone = 0; + } + } else { + *typ = OPT_NewStr(0, 1); + } + } + OPT_impCtxt.ref[__X(ref, ((LONGINT)(255)))] = *typ; + OPT_impCtxt.old[__X(ref, ((LONGINT)(255)))] = old; + (*typ)->ref = ref + 255; + (*typ)->mno = mno; + (*typ)->allocated = 1; + (*typ)->strobj = obj; + obj->mode = 5; + obj->typ = *typ; + obj->mnolev = -mno; + obj->vis = 0; + tag = OPM_SymRInt(); + if (tag == 35) { + (*typ)->sysflag = (int)OPM_SymRInt(); + tag = OPM_SymRInt(); + } + switch (tag) { + case 36: + (*typ)->form = 13; + (*typ)->size = OPM_PointerSize; + (*typ)->n = 0; + OPT_InStruct(&(*typ)->BaseTyp); + break; + case 37: + (*typ)->form = 15; + (*typ)->comp = 2; + OPT_InStruct(&(*typ)->BaseTyp); + (*typ)->n = OPM_SymRInt(); + (*OPT_typSize)(*typ); + break; + case 38: + (*typ)->form = 15; + (*typ)->comp = 3; + OPT_InStruct(&(*typ)->BaseTyp); + if ((*typ)->BaseTyp->comp == 3) { + (*typ)->n = (*typ)->BaseTyp->n + 1; + } else { + (*typ)->n = 0; + } + (*OPT_typSize)(*typ); + break; + case 39: + (*typ)->form = 15; + (*typ)->comp = 4; + OPT_InStruct(&(*typ)->BaseTyp); + if ((*typ)->BaseTyp == OPT_notyp) { + (*typ)->BaseTyp = NIL; + } + (*typ)->extlev = 0; + t = (*typ)->BaseTyp; + while (t != NIL) { + (*typ)->extlev += 1; + t = t->BaseTyp; + } + (*typ)->size = OPM_SymRInt(); + (*typ)->align = OPM_SymRInt(); + (*typ)->n = OPM_SymRInt(); + OPT_impCtxt.nextTag = OPM_SymRInt(); + last = NIL; + while ((OPT_impCtxt.nextTag >= 25 && OPT_impCtxt.nextTag <= 28)) { + fld = OPT_InFld(); + fld->mnolev = -mno; + if (last != NIL) { + last->link = fld; + } + last = fld; + OPT_InsertImport(fld, &(*typ)->link, &dummy); + OPT_impCtxt.nextTag = OPM_SymRInt(); + } + while (OPT_impCtxt.nextTag != 18) { + fld = OPT_InTProc(mno); + OPT_InsertImport(fld, &(*typ)->link, &dummy); + OPT_impCtxt.nextTag = OPM_SymRInt(); + } + break; + case 40: + (*typ)->form = 14; + (*typ)->size = OPM_ProcSize; + OPT_InSign(mno, &(*typ)->BaseTyp, &(*typ)->link); + break; + default: + OPM_LogWStr((CHAR*)"unhandled case at OPT.InStruct, tag = ", (LONGINT)39); + OPM_LogWNum(tag, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + if (ref == OPT_impCtxt.minr) { + while (ref < OPT_impCtxt.nofr) { + t = OPT_impCtxt.ref[__X(ref, ((LONGINT)(255)))]; + OPT_FPrintStr(t); + obj = t->strobj; + if (obj->name[0] != 0x00) { + OPT_FPrintObj(obj); + } + old = OPT_impCtxt.old[__X(ref, ((LONGINT)(255)))]; + if (old != NIL) { + t->strobj = old; + if (OPT_impCtxt.self) { + if (old->mnolev < 0) { + if (old->history != 5) { + if (old->fprint != obj->fprint) { + old->history = 2; + } else if (OPT_impCtxt.pvfp[__X(ref, ((LONGINT)(255)))] != t->pvfp) { + old->history = 3; + } + } + } else if (old->fprint != obj->fprint) { + old->history = 2; + } else if (OPT_impCtxt.pvfp[__X(ref, ((LONGINT)(255)))] != t->pvfp) { + old->history = 3; + } else if (old->vis == 0) { + old->history = 1; + } else { + old->history = 0; + } + } else { + if (OPT_impCtxt.pvfp[__X(ref, ((LONGINT)(255)))] != t->pvfp) { + old->history = 5; + } + if (old->fprint != obj->fprint) { + OPT_FPrintErr(old, 249); + } + } + } else if (OPT_impCtxt.self) { + obj->history = 4; + } else { + obj->history = 1; + } + ref += 1; + } + OPT_impCtxt.minr = 255; + } + } +} + +static OPT_Object OPT_InObj (SHORTINT mno) +{ + OPT_Object _o_result; + INTEGER i, s; + CHAR ch; + OPT_Object obj = NIL, old = NIL; + OPT_Struct typ = NIL; + LONGINT tag; + OPT_ConstExt ext = NIL; + tag = OPT_impCtxt.nextTag; + if (tag == 19) { + OPT_InStruct(&typ); + obj = typ->strobj; + if (!OPT_impCtxt.self) { + obj->vis = 1; + } + } else { + obj = OPT_NewObj(); + obj->mnolev = -mno; + obj->vis = 1; + if (tag <= 13) { + obj->mode = 3; + obj->typ = OPT_impCtxt.ref[__X(tag, ((LONGINT)(255)))]; + obj->conval = OPT_NewConst(); + OPT_InConstant(tag, obj->conval); + } else if (tag >= 31) { + obj->conval = OPT_NewConst(); + obj->conval->intval = -1; + OPT_InSign(mno, &obj->typ, &obj->link); + switch (tag) { + case 31: + obj->mode = 7; + break; + case 32: + obj->mode = 10; + break; + case 33: + obj->mode = 9; + ext = OPT_NewExt(); + obj->conval->ext = ext; + s = (int)OPM_SymRInt(); + (*ext)[0] = (CHAR)s; + i = 1; + while (i <= s) { + OPM_SymRCh(&(*ext)[__X(i, ((LONGINT)(256)))]); + i += 1; + } + break; + default: + OPM_LogWStr((CHAR*)"unhandled case at OPT.InObj, tag = ", (LONGINT)36); + OPM_LogWNum(tag, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + } else if (tag == 20) { + obj->mode = 5; + OPT_InStruct(&obj->typ); + } else { + obj->mode = 1; + if (tag == 22) { + obj->vis = 2; + } + OPT_InStruct(&obj->typ); + } + OPT_InName((void*)obj->name, ((LONGINT)(256))); + } + OPT_FPrintObj(obj); + if ((obj->mode == 1 && (obj->typ->strobj == NIL || obj->typ->strobj->name[0] == 0x00))) { + OPM_FPrint(&OPT_impCtxt.reffp, obj->typ->ref - 255); + } + if (tag != 19) { + OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->right, &old); + if (OPT_impCtxt.self) { + if (old != NIL) { + if (old->vis == 0) { + old->history = 4; + } else { + OPT_FPrintObj(old); + if (obj->fprint != old->fprint) { + old->history = 2; + } else if (obj->typ->pvfp != old->typ->pvfp) { + old->history = 3; + } else { + old->history = 1; + } + } + } else { + obj->history = 4; + } + } + } else { + if (OPT_impCtxt.self) { + if (obj->vis == 0) { + obj->history = 4; + } else if (obj->history == 0) { + obj->history = 1; + } + } + } + _o_result = obj; + return _o_result; +} + +void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) +{ + OPT_Object obj = NIL; + SHORTINT mno; + OPS_Name aliasName__copy; + __DUPARR(aliasName, OPS_Name); + if (__STRCMP(name, "SYSTEM") == 0) { + OPT_SYSimported = 1; + OPT_Insert(aliasName, &obj); + obj->mode = 11; + obj->mnolev = 0; + obj->scope = OPT_syslink; + obj->typ = OPT_notyp; + } else { + OPT_impCtxt.nofr = 16; + OPT_impCtxt.minr = 255; + OPT_impCtxt.nofm = 0; + OPT_impCtxt.self = __STRCMP(aliasName, "@self") == 0; + OPT_impCtxt.reffp = 0; + OPM_OldSym((void*)name, ((LONGINT)(256)), &*done); + if (*done) { + OPT_InMod(&mno); + OPT_impCtxt.nextTag = OPM_SymRInt(); + while (!OPM_eofSF()) { + obj = OPT_InObj(mno); + OPT_impCtxt.nextTag = OPM_SymRInt(); + } + OPT_Insert(aliasName, &obj); + obj->mode = 11; + obj->scope = OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->right; + OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->link = obj; + obj->mnolev = -mno; + obj->typ = OPT_notyp; + OPM_CloseOldSym(); + } else if (OPT_impCtxt.self) { + OPT_newsf = 1; + OPT_extsf = 1; + OPT_sfpresent = 0; + } else { + OPT_err(152); + } + } +} + +static void OPT_OutName (CHAR *name, LONGINT name__len) +{ + INTEGER i; + CHAR ch; + i = 0; + do { + ch = name[__X(i, name__len)]; + OPM_SymWCh(ch); + i += 1; + } while (!(ch == 0x00)); +} + +static void OPT_OutMod (INTEGER mno) +{ + if (OPT_expCtxt.locmno[__X(mno, ((LONGINT)(64)))] < 0) { + OPM_SymWInt(((LONGINT)(16))); + OPT_expCtxt.locmno[__X(mno, ((LONGINT)(64)))] = OPT_expCtxt.nofm; + OPT_expCtxt.nofm += 1; + OPT_OutName((void*)OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->name, ((LONGINT)(256))); + } else { + OPM_SymWInt(-OPT_expCtxt.locmno[__X(mno, ((LONGINT)(64)))]); + } +} + +static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, LONGINT adr) +{ + LONGINT i, j, n; + OPT_Struct btyp = NIL; + if (typ->comp == 4) { + OPT_OutFlds(typ->link, adr, 0); + } else if (typ->comp == 2) { + btyp = typ->BaseTyp; + n = typ->n; + while (btyp->comp == 2) { + n = btyp->n * n; + btyp = btyp->BaseTyp; + } + if (btyp->form == 13 || btyp->comp == 4) { + j = OPT_nofhdfld; + OPT_OutHdFld(btyp, fld, adr); + if (j != OPT_nofhdfld) { + i = 1; + while ((i < n && OPT_nofhdfld <= 2048)) { + adr += btyp->size; + OPT_OutHdFld(btyp, fld, adr); + i += 1; + } + } + } + } else if (typ->form == 13 || __STRCMP(fld->name, "@ptr") == 0) { + OPM_SymWInt(((LONGINT)(27))); + OPM_SymWInt(adr); + OPT_nofhdfld += 1; + } +} + +static void OPT_OutFlds (OPT_Object fld, LONGINT adr, BOOLEAN visible) +{ + while ((fld != NIL && fld->mode == 4)) { + if ((fld->vis != 0 && visible)) { + if (fld->vis == 2) { + OPM_SymWInt(((LONGINT)(26))); + } else { + OPM_SymWInt(((LONGINT)(25))); + } + OPT_OutStr(fld->typ); + OPT_OutName((void*)fld->name, ((LONGINT)(256))); + OPM_SymWInt(fld->adr); + } else { + OPT_OutHdFld(fld->typ, fld, fld->adr + adr); + } + fld = fld->link; + } +} + +static void OPT_OutSign (OPT_Struct result, OPT_Object par) +{ + OPT_OutStr(result); + while (par != NIL) { + if (par->mode == 1) { + OPM_SymWInt(((LONGINT)(23))); + } else { + OPM_SymWInt(((LONGINT)(24))); + } + OPT_OutStr(par->typ); + OPM_SymWInt(par->adr); + OPT_OutName((void*)par->name, ((LONGINT)(256))); + par = par->link; + } + OPM_SymWInt(((LONGINT)(18))); +} + +static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj) +{ + if (obj != NIL) { + OPT_OutTProcs(typ, obj->left); + if (obj->mode == 13) { + if ((((typ->BaseTyp != NIL && __ASHR(obj->adr, 16) < typ->BaseTyp->n)) && obj->vis == 0)) { + OPM_Mark(109, typ->txtpos); + } + if (obj->vis != 0) { + if (obj->vis != 0) { + OPM_SymWInt(((LONGINT)(29))); + OPT_OutSign(obj->typ, obj->link); + OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPM_SymWInt(__ASHR(obj->adr, 16)); + } else { + OPM_SymWInt(((LONGINT)(30))); + OPM_SymWInt(__ASHR(obj->adr, 16)); + } + } + } + OPT_OutTProcs(typ, obj->right); + } +} + +static void OPT_OutStr (OPT_Struct typ) +{ + OPT_Object strobj = NIL; + if (typ->ref < OPT_expCtxt.ref) { + OPM_SymWInt(-typ->ref); + } else { + OPM_SymWInt(((LONGINT)(34))); + typ->ref = OPT_expCtxt.ref; + OPT_expCtxt.ref += 1; + if (OPT_expCtxt.ref >= 255) { + OPT_err(228); + } + OPT_OutMod(typ->mno); + strobj = typ->strobj; + if ((strobj != NIL && strobj->name[0] != 0x00)) { + OPT_OutName((void*)strobj->name, ((LONGINT)(256))); + switch (strobj->history) { + case 2: + OPT_FPrintErr(strobj, 252); + break; + case 3: + OPT_FPrintErr(strobj, 251); + break; + case 5: + OPT_FPrintErr(strobj, 249); + break; + default: + break; + } + } else { + OPM_SymWCh(0x00); + } + if (typ->sysflag != 0) { + OPM_SymWInt(((LONGINT)(35))); + OPM_SymWInt(typ->sysflag); + } + switch (typ->form) { + case 13: + OPM_SymWInt(((LONGINT)(36))); + OPT_OutStr(typ->BaseTyp); + break; + case 14: + OPM_SymWInt(((LONGINT)(40))); + OPT_OutSign(typ->BaseTyp, typ->link); + break; + case 15: + switch (typ->comp) { + case 2: + OPM_SymWInt(((LONGINT)(37))); + OPT_OutStr(typ->BaseTyp); + OPM_SymWInt(typ->n); + break; + case 3: + OPM_SymWInt(((LONGINT)(38))); + OPT_OutStr(typ->BaseTyp); + break; + case 4: + OPM_SymWInt(((LONGINT)(39))); + if (typ->BaseTyp == NIL) { + OPT_OutStr(OPT_notyp); + } else { + OPT_OutStr(typ->BaseTyp); + } + OPM_SymWInt(typ->size); + OPM_SymWInt(typ->align); + OPM_SymWInt(typ->n); + OPT_nofhdfld = 0; + OPT_OutFlds(typ->link, ((LONGINT)(0)), 1); + if (OPT_nofhdfld > 2048) { + OPM_Mark(223, typ->txtpos); + } + OPT_OutTProcs(typ, typ->link); + OPM_SymWInt(((LONGINT)(18))); + break; + default: + OPM_LogWStr((CHAR*)"unhandled case at OPT.OutStr, typ^.comp = ", (LONGINT)43); + OPM_LogWNum(typ->comp, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + break; + default: + OPM_LogWStr((CHAR*)"unhandled case at OPT.OutStr, typ^.form = ", (LONGINT)43); + OPM_LogWNum(typ->form, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + } +} + +static void OPT_OutConstant (OPT_Object obj) +{ + INTEGER f; + REAL rval; + f = obj->typ->form; + OPM_SymWInt(f); + switch (f) { + case 2: case 3: + OPM_SymWCh((CHAR)obj->conval->intval); + break; + case 4: case 5: case 6: + OPM_SymWInt(obj->conval->intval); + break; + case 9: + OPM_SymWSet(obj->conval->setval); + break; + case 7: + rval = obj->conval->realval; + OPM_SymWReal(rval); + break; + case 8: + OPM_SymWLReal(obj->conval->realval); + break; + case 10: + OPT_OutName((void*)*obj->conval->ext, ((LONGINT)(256))); + break; + case 11: + break; + default: + OPT_err(127); + break; + } +} + +static void OPT_OutObj (OPT_Object obj) +{ + INTEGER i, j; + OPT_ConstExt ext = NIL; + if (obj != NIL) { + OPT_OutObj(obj->left); + if (__IN(obj->mode, 0x06ea)) { + if (obj->history == 4) { + OPT_FPrintErr(obj, 250); + } else if (obj->vis != 0) { + switch (obj->history) { + case 0: + OPT_FPrintErr(obj, 253); + break; + case 1: + break; + case 2: + OPT_FPrintErr(obj, 252); + break; + case 3: + OPT_FPrintErr(obj, 251); + break; + default: + OPM_LogWStr((CHAR*)"unhandled case at OPT.OutObj, obj^.history = ", (LONGINT)46); + OPM_LogWNum(obj->history, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + switch (obj->mode) { + case 3: + OPT_OutConstant(obj); + OPT_OutName((void*)obj->name, ((LONGINT)(256))); + break; + case 5: + if (obj->typ->strobj == obj) { + OPM_SymWInt(((LONGINT)(19))); + OPT_OutStr(obj->typ); + } else { + OPM_SymWInt(((LONGINT)(20))); + OPT_OutStr(obj->typ); + OPT_OutName((void*)obj->name, ((LONGINT)(256))); + } + break; + case 1: + if (obj->vis == 2) { + OPM_SymWInt(((LONGINT)(22))); + } else { + OPM_SymWInt(((LONGINT)(21))); + } + OPT_OutStr(obj->typ); + OPT_OutName((void*)obj->name, ((LONGINT)(256))); + if (obj->typ->strobj == NIL || obj->typ->strobj->name[0] == 0x00) { + OPM_FPrint(&OPT_expCtxt.reffp, obj->typ->ref); + } + break; + case 7: + OPM_SymWInt(((LONGINT)(31))); + OPT_OutSign(obj->typ, obj->link); + OPT_OutName((void*)obj->name, ((LONGINT)(256))); + break; + case 10: + OPM_SymWInt(((LONGINT)(32))); + OPT_OutSign(obj->typ, obj->link); + OPT_OutName((void*)obj->name, ((LONGINT)(256))); + break; + case 9: + OPM_SymWInt(((LONGINT)(33))); + OPT_OutSign(obj->typ, obj->link); + ext = obj->conval->ext; + j = (int)(*ext)[0]; + i = 1; + OPM_SymWInt(j); + while (i <= j) { + OPM_SymWCh((*ext)[__X(i, ((LONGINT)(256)))]); + i += 1; + } + OPT_OutName((void*)obj->name, ((LONGINT)(256))); + break; + default: + OPM_LogWStr((CHAR*)"unhandled case at OPT.OutObj, obj.mode = ", (LONGINT)42); + OPM_LogWNum(obj->mode, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + } + } + OPT_OutObj(obj->right); + } +} + +void OPT_Export (BOOLEAN *ext, BOOLEAN *new) +{ + INTEGER i; + SHORTINT nofmod; + BOOLEAN done; + OPT_symExtended = 0; + OPT_symNew = 0; + nofmod = OPT_nofGmod; + OPT_Import((CHAR*)"@self", OPT_SelfName, &done); + OPT_nofGmod = nofmod; + if (OPM_noerr) { + OPM_NewSym((void*)OPT_SelfName, ((LONGINT)(256))); + if (OPM_noerr) { + OPM_SymWInt(((LONGINT)(16))); + OPT_OutName((void*)OPT_SelfName, ((LONGINT)(256))); + OPT_expCtxt.reffp = 0; + OPT_expCtxt.ref = 16; + OPT_expCtxt.nofm = 1; + OPT_expCtxt.locmno[0] = 0; + i = 1; + while (i < 64) { + OPT_expCtxt.locmno[__X(i, ((LONGINT)(64)))] = -1; + i += 1; + } + OPT_OutObj(OPT_topScope->right); + *ext = (OPT_sfpresent && OPT_symExtended); + *new = !OPT_sfpresent || OPT_symNew; + if (OPM_forceNewSym) { + *new = 1; + } + if ((((OPM_noerr && OPT_sfpresent)) && OPT_impCtxt.reffp != OPT_expCtxt.reffp)) { + *new = 1; + if (!OPT_extsf) { + OPT_err(155); + } + } + OPT_newsf = 0; + OPT_symNew = 0; + if (!OPM_noerr || OPT_findpc) { + OPM_DeleteNewSym(); + } + } + } +} + +static void OPT_InitStruct (OPT_Struct *typ, SHORTINT form) +{ + *typ = OPT_NewStr(form, 1); + (*typ)->ref = form; + (*typ)->size = OPM_ByteSize; + (*typ)->allocated = 1; + (*typ)->strobj = OPT_NewObj(); + (*typ)->pbfp = form; + (*typ)->pvfp = form; + (*typ)->fpdone = 1; + (*typ)->idfp = form; + (*typ)->idfpdone = 1; +} + +static void OPT_EnterBoolConst (OPS_Name name, LONGINT value) +{ + OPT_Object obj = NIL; + OPS_Name name__copy; + __DUPARR(name, OPS_Name); + OPT_Insert(name, &obj); + obj->conval = OPT_NewConst(); + obj->mode = 3; + obj->typ = OPT_booltyp; + obj->conval->intval = value; +} + +static void OPT_EnterTyp (OPS_Name name, SHORTINT form, INTEGER size, OPT_Struct *res) +{ + OPT_Object obj = NIL; + OPT_Struct typ = NIL; + OPS_Name name__copy; + __DUPARR(name, OPS_Name); + OPT_Insert(name, &obj); + typ = OPT_NewStr(form, 1); + obj->mode = 5; + obj->typ = typ; + obj->vis = 1; + typ->strobj = obj; + typ->size = size; + typ->ref = form; + typ->allocated = 1; + typ->pbfp = form; + typ->pvfp = form; + typ->fpdone = 1; + typ->idfp = form; + typ->idfpdone = 1; + *res = typ; +} + +static void OPT_EnterProc (OPS_Name name, INTEGER num) +{ + OPT_Object obj = NIL; + OPS_Name name__copy; + __DUPARR(name, OPS_Name); + OPT_Insert(name, &obj); + obj->mode = 8; + obj->typ = OPT_notyp; + obj->adr = num; +} + +static void EnumPtrs(void (*P)(void*)) +{ + P(OPT_topScope); + P(OPT_undftyp); + P(OPT_bytetyp); + P(OPT_booltyp); + P(OPT_chartyp); + P(OPT_sinttyp); + P(OPT_inttyp); + P(OPT_linttyp); + P(OPT_realtyp); + P(OPT_lrltyp); + P(OPT_settyp); + P(OPT_stringtyp); + P(OPT_niltyp); + P(OPT_notyp); + P(OPT_sysptrtyp); + __ENUMP(OPT_GlbMod, 64, P); + P(OPT_universe); + P(OPT_syslink); + __ENUMR(&OPT_impCtxt, OPT_ImpCtxt__typ, 3140, 1, P); +} + +__TDESC(OPT_ConstDesc, 1, 1) = {__TDFLDS("ConstDesc", 24), {0, -8}}; +__TDESC(OPT_ObjDesc, 1, 6) = {__TDFLDS("ObjDesc", 304), {0, 4, 8, 12, 284, 288, -28}}; +__TDESC(OPT_StrDesc, 1, 3) = {__TDFLDS("StrDesc", 56), {44, 48, 52, -16}}; +__TDESC(OPT_NodeDesc, 1, 6) = {__TDFLDS("NodeDesc", 28), {0, 4, 8, 16, 20, 24, -28}}; +__TDESC(OPT_ImpCtxt, 1, 510) = {__TDFLDS("ImpCtxt", 3140), {16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60, 64, 68, 72, 76, + 80, 84, 88, 92, 96, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, + 144, 148, 152, 156, 160, 164, 168, 172, 176, 180, 184, 188, 192, 196, 200, 204, + 208, 212, 216, 220, 224, 228, 232, 236, 240, 244, 248, 252, 256, 260, 264, 268, + 272, 276, 280, 284, 288, 292, 296, 300, 304, 308, 312, 316, 320, 324, 328, 332, + 336, 340, 344, 348, 352, 356, 360, 364, 368, 372, 376, 380, 384, 388, 392, 396, + 400, 404, 408, 412, 416, 420, 424, 428, 432, 436, 440, 444, 448, 452, 456, 460, + 464, 468, 472, 476, 480, 484, 488, 492, 496, 500, 504, 508, 512, 516, 520, 524, + 528, 532, 536, 540, 544, 548, 552, 556, 560, 564, 568, 572, 576, 580, 584, 588, + 592, 596, 600, 604, 608, 612, 616, 620, 624, 628, 632, 636, 640, 644, 648, 652, + 656, 660, 664, 668, 672, 676, 680, 684, 688, 692, 696, 700, 704, 708, 712, 716, + 720, 724, 728, 732, 736, 740, 744, 748, 752, 756, 760, 764, 768, 772, 776, 780, + 784, 788, 792, 796, 800, 804, 808, 812, 816, 820, 824, 828, 832, 836, 840, 844, + 848, 852, 856, 860, 864, 868, 872, 876, 880, 884, 888, 892, 896, 900, 904, 908, + 912, 916, 920, 924, 928, 932, 936, 940, 944, 948, 952, 956, 960, 964, 968, 972, + 976, 980, 984, 988, 992, 996, 1000, 1004, 1008, 1012, 1016, 1020, 1024, 1028, 1032, 1036, + 1040, 1044, 1048, 1052, 1056, 1060, 1064, 1068, 1072, 1076, 1080, 1084, 1088, 1092, 1096, 1100, + 1104, 1108, 1112, 1116, 1120, 1124, 1128, 1132, 1136, 1140, 1144, 1148, 1152, 1156, 1160, 1164, + 1168, 1172, 1176, 1180, 1184, 1188, 1192, 1196, 1200, 1204, 1208, 1212, 1216, 1220, 1224, 1228, + 1232, 1236, 1240, 1244, 1248, 1252, 1256, 1260, 1264, 1268, 1272, 1276, 1280, 1284, 1288, 1292, + 1296, 1300, 1304, 1308, 1312, 1316, 1320, 1324, 1328, 1332, 1336, 1340, 1344, 1348, 1352, 1356, + 1360, 1364, 1368, 1372, 1376, 1380, 1384, 1388, 1392, 1396, 1400, 1404, 1408, 1412, 1416, 1420, + 1424, 1428, 1432, 1436, 1440, 1444, 1448, 1452, 1456, 1460, 1464, 1468, 1472, 1476, 1480, 1484, + 1488, 1492, 1496, 1500, 1504, 1508, 1512, 1516, 1520, 1524, 1528, 1532, 1536, 1540, 1544, 1548, + 1552, 1556, 1560, 1564, 1568, 1572, 1576, 1580, 1584, 1588, 1592, 1596, 1600, 1604, 1608, 1612, + 1616, 1620, 1624, 1628, 1632, 1636, 1640, 1644, 1648, 1652, 1656, 1660, 1664, 1668, 1672, 1676, + 1680, 1684, 1688, 1692, 1696, 1700, 1704, 1708, 1712, 1716, 1720, 1724, 1728, 1732, 1736, 1740, + 1744, 1748, 1752, 1756, 1760, 1764, 1768, 1772, 1776, 1780, 1784, 1788, 1792, 1796, 1800, 1804, + 1808, 1812, 1816, 1820, 1824, 1828, 1832, 1836, 1840, 1844, 1848, 1852, 1856, 1860, 1864, 1868, + 1872, 1876, 1880, 1884, 1888, 1892, 1896, 1900, 1904, 1908, 1912, 1916, 1920, 1924, 1928, 1932, + 1936, 1940, 1944, 1948, 1952, 1956, 1960, 1964, 1968, 1972, 1976, 1980, 1984, 1988, 1992, 1996, + 2000, 2004, 2008, 2012, 2016, 2020, 2024, 2028, 2032, 2036, 2040, 2044, 2048, 2052, -2044}}; +__TDESC(OPT_ExpCtxt, 1, 0) = {__TDFLDS("ExpCtxt", 72), {-4}}; + +export void *OPT__init(void) +{ + __DEFMOD; + __MODULE_IMPORT(OPM); + __MODULE_IMPORT(OPS); + __REGMOD("OPT", EnumPtrs); + __REGCMD("Close", OPT_Close); + __REGCMD("CloseScope", OPT_CloseScope); + __INITYP(OPT_ConstDesc, OPT_ConstDesc, 0); + __INITYP(OPT_ObjDesc, OPT_ObjDesc, 0); + __INITYP(OPT_StrDesc, OPT_StrDesc, 0); + __INITYP(OPT_NodeDesc, OPT_NodeDesc, 0); + __INITYP(OPT_ImpCtxt, OPT_ImpCtxt, 0); + __INITYP(OPT_ExpCtxt, OPT_ExpCtxt, 0); +/* BEGIN */ + OPT_topScope = NIL; + OPT_OpenScope(0, NIL); + OPM_errpos = 0; + OPT_InitStruct(&OPT_undftyp, 0); + OPT_InitStruct(&OPT_notyp, 12); + OPT_InitStruct(&OPT_stringtyp, 10); + OPT_InitStruct(&OPT_niltyp, 11); + OPT_undftyp->BaseTyp = OPT_undftyp; + OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp); + OPT_EnterTyp((CHAR*)"PTR", 13, OPM_PointerSize, &OPT_sysptrtyp); + OPT_EnterProc((CHAR*)"ADR", 20); + OPT_EnterProc((CHAR*)"CC", 21); + OPT_EnterProc((CHAR*)"LSH", 22); + OPT_EnterProc((CHAR*)"ROT", 23); + OPT_EnterProc((CHAR*)"GET", 24); + OPT_EnterProc((CHAR*)"PUT", 25); + OPT_EnterProc((CHAR*)"GETREG", 26); + OPT_EnterProc((CHAR*)"PUTREG", 27); + OPT_EnterProc((CHAR*)"BIT", 28); + OPT_EnterProc((CHAR*)"VAL", 29); + OPT_EnterProc((CHAR*)"NEW", 30); + OPT_EnterProc((CHAR*)"MOVE", 31); + OPT_syslink = OPT_topScope->right; + OPT_universe = OPT_topScope; + OPT_topScope->right = NIL; + OPT_EnterTyp((CHAR*)"CHAR", 3, OPM_CharSize, &OPT_chartyp); + OPT_EnterTyp((CHAR*)"SET", 9, OPM_SetSize, &OPT_settyp); + OPT_EnterTyp((CHAR*)"REAL", 7, OPM_RealSize, &OPT_realtyp); + OPT_EnterTyp((CHAR*)"INTEGER", 5, OPM_IntSize, &OPT_inttyp); + OPT_EnterTyp((CHAR*)"LONGINT", 6, OPM_LIntSize, &OPT_linttyp); + OPT_EnterTyp((CHAR*)"LONGREAL", 8, OPM_LRealSize, &OPT_lrltyp); + OPT_EnterTyp((CHAR*)"SHORTINT", 4, OPM_SIntSize, &OPT_sinttyp); + OPT_EnterTyp((CHAR*)"BOOLEAN", 2, OPM_BoolSize, &OPT_booltyp); + OPT_EnterBoolConst((CHAR*)"FALSE", ((LONGINT)(0))); + OPT_EnterBoolConst((CHAR*)"TRUE", ((LONGINT)(1))); + OPT_EnterProc((CHAR*)"HALT", 0); + OPT_EnterProc((CHAR*)"NEW", 1); + OPT_EnterProc((CHAR*)"ABS", 2); + OPT_EnterProc((CHAR*)"CAP", 3); + OPT_EnterProc((CHAR*)"ORD", 4); + OPT_EnterProc((CHAR*)"ENTIER", 5); + OPT_EnterProc((CHAR*)"ODD", 6); + OPT_EnterProc((CHAR*)"MIN", 7); + OPT_EnterProc((CHAR*)"MAX", 8); + OPT_EnterProc((CHAR*)"CHR", 9); + OPT_EnterProc((CHAR*)"SHORT", 10); + OPT_EnterProc((CHAR*)"LONG", 11); + OPT_EnterProc((CHAR*)"SIZE", 12); + OPT_EnterProc((CHAR*)"INC", 13); + OPT_EnterProc((CHAR*)"DEC", 14); + OPT_EnterProc((CHAR*)"INCL", 15); + OPT_EnterProc((CHAR*)"EXCL", 16); + OPT_EnterProc((CHAR*)"LEN", 17); + OPT_EnterProc((CHAR*)"COPY", 18); + OPT_EnterProc((CHAR*)"ASH", 19); + OPT_EnterProc((CHAR*)"ASSERT", 32); + OPT_impCtxt.ref[0] = OPT_undftyp; + OPT_impCtxt.ref[1] = OPT_bytetyp; + OPT_impCtxt.ref[2] = OPT_booltyp; + OPT_impCtxt.ref[3] = OPT_chartyp; + OPT_impCtxt.ref[4] = OPT_sinttyp; + OPT_impCtxt.ref[5] = OPT_inttyp; + OPT_impCtxt.ref[6] = OPT_linttyp; + OPT_impCtxt.ref[7] = OPT_realtyp; + OPT_impCtxt.ref[8] = OPT_lrltyp; + OPT_impCtxt.ref[9] = OPT_settyp; + OPT_impCtxt.ref[10] = OPT_stringtyp; + OPT_impCtxt.ref[11] = OPT_niltyp; + OPT_impCtxt.ref[12] = OPT_notyp; + OPT_impCtxt.ref[13] = OPT_sysptrtyp; + __ENDMOD; +} diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h new file mode 100644 index 00000000..1a22d0df --- /dev/null +++ b/bootstrap/unix-44/OPT.h @@ -0,0 +1,105 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ + +#ifndef OPT__h +#define OPT__h + +#include "SYSTEM.h" +#include "OPS.h" + +typedef + struct OPT_ConstDesc *OPT_Const; + +typedef + OPS_String *OPT_ConstExt; + +typedef + struct OPT_ConstDesc { + OPT_ConstExt ext; + LONGINT intval, intval2; + SET setval; + LONGREAL realval; + } OPT_ConstDesc; + +typedef + struct OPT_NodeDesc *OPT_Node; + +typedef + struct OPT_StrDesc *OPT_Struct; + +typedef + struct OPT_ObjDesc *OPT_Object; + +typedef + struct OPT_NodeDesc { + OPT_Node left, right, link; + SHORTINT class, subcl; + BOOLEAN readonly; + OPT_Struct typ; + OPT_Object obj; + OPT_Const conval; + } OPT_NodeDesc; + +typedef + struct OPT_ObjDesc { + OPT_Object left, right, link, scope; + OPS_Name name; + BOOLEAN leaf; + SHORTINT mode, mnolev, vis, history; + BOOLEAN used, fpdone; + LONGINT fprint; + OPT_Struct typ; + OPT_Const conval; + LONGINT adr, linkadr; + INTEGER x; + } OPT_ObjDesc; + +typedef + struct OPT_StrDesc { + SHORTINT form, comp, mno, extlev; + INTEGER ref, sysflag; + LONGINT n, size, align, txtpos; + BOOLEAN allocated, pbused, pvused; + char _prvt0[8]; + LONGINT pbfp, pvfp; + OPT_Struct BaseTyp; + OPT_Object link, strobj; + } OPT_StrDesc; + + +import void (*OPT_typSize)(OPT_Struct); +import OPT_Object OPT_topScope; +import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +import SHORTINT OPT_nofGmod; +import OPT_Object OPT_GlbMod[64]; +import OPS_Name OPT_SelfName; +import BOOLEAN OPT_SYSimported; + +import LONGINT *OPT_ConstDesc__typ; +import LONGINT *OPT_ObjDesc__typ; +import LONGINT *OPT_StrDesc__typ; +import LONGINT *OPT_NodeDesc__typ; + +import void OPT_Close (void); +import void OPT_CloseScope (void); +import void OPT_Export (BOOLEAN *ext, BOOLEAN *new); +import void OPT_FPrintErr (OPT_Object obj, INTEGER errcode); +import void OPT_FPrintObj (OPT_Object obj); +import void OPT_FPrintStr (OPT_Struct typ); +import void OPT_Find (OPT_Object *res); +import void OPT_FindField (OPS_Name name, OPT_Struct typ, OPT_Object *res); +import void OPT_FindImport (OPT_Object mod, OPT_Object *res); +import void OPT_IdFPrint (OPT_Struct typ); +import void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); +import void OPT_Init (OPS_Name name, SET opt); +import void OPT_Insert (OPS_Name name, OPT_Object *obj); +import void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); +import OPT_Const OPT_NewConst (void); +import OPT_ConstExt OPT_NewExt (void); +import OPT_Node OPT_NewNode (SHORTINT class); +import OPT_Object OPT_NewObj (void); +import OPT_Struct OPT_NewStr (SHORTINT form, SHORTINT comp); +import void OPT_OpenScope (SHORTINT level, OPT_Object owner); +import void *OPT__init(void); + + +#endif diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c new file mode 100644 index 00000000..572285dc --- /dev/null +++ b/bootstrap/unix-44/OPV.c @@ -0,0 +1,1688 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +#include "SYSTEM.h" +#include "OPC.h" +#include "OPM.h" +#include "OPS.h" +#include "OPT.h" + +typedef + struct OPV_ExitInfo { + INTEGER level, label; + } OPV_ExitInfo; + + +static BOOLEAN OPV_assert, OPV_inxchk, OPV_mainprog, OPV_ansi; +static INTEGER OPV_stamp; +static LONGINT OPV_recno; +static OPV_ExitInfo OPV_exit; +static INTEGER OPV_nofExitLabels; +static BOOLEAN OPV_naturalAlignment; + +export LONGINT *OPV_ExitInfo__typ; + +static void OPV_ActualPar (OPT_Node n, OPT_Object fp); +export void OPV_AdrAndSize (OPT_Object topScope); +static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc); +static void OPV_Convert (OPT_Node n, INTEGER form, INTEGER prec); +static void OPV_DefineTDescs (OPT_Node n); +static void OPV_Entier (OPT_Node n, INTEGER prec); +static void OPV_GetTProcNum (OPT_Object obj); +static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc); +static BOOLEAN OPV_ImplicitReturn (OPT_Node n); +static void OPV_Index (OPT_Node n, OPT_Node d, INTEGER prec, INTEGER dim); +export void OPV_Init (void); +static void OPV_InitTDescs (OPT_Node n); +static void OPV_Len (OPT_Node n, LONGINT dim); +export void OPV_Module (OPT_Node prog); +static LONGINT OPV_NaturalAlignment (LONGINT size, LONGINT max); +static void OPV_NewArr (OPT_Node d, OPT_Node x); +static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, INTEGER comp); +static BOOLEAN OPV_SideEffects (OPT_Node n); +static void OPV_Stamp (OPS_Name s); +static OPT_Object OPV_SuperProc (OPT_Node n); +static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported); +static void OPV_TraverseRecord (OPT_Struct typ); +export void OPV_TypSize (OPT_Struct typ); +static void OPV_TypeOf (OPT_Node n); +static void OPV_design (OPT_Node n, INTEGER prec); +static void OPV_expr (OPT_Node n, INTEGER prec); +static void OPV_stat (OPT_Node n, OPT_Object outerProc); + + +static LONGINT OPV_NaturalAlignment (LONGINT size, LONGINT max) +{ + LONGINT _o_result; + LONGINT i; + if (size >= max) { + _o_result = max; + return _o_result; + } else { + i = 1; + while (i < size) { + i += i; + } + _o_result = i; + return _o_result; + } + __RETCHK; +} + +void OPV_TypSize (OPT_Struct typ) +{ + INTEGER f, c; + LONGINT offset, size, base, fbase, off0; + OPT_Object fld = NIL; + OPT_Struct btyp = NIL; + if (typ == OPT_undftyp) { + OPM_err(58); + } else if (typ->size == -1) { + f = typ->form; + c = typ->comp; + if (c == 4) { + btyp = typ->BaseTyp; + if (btyp == NIL) { + offset = 0; + base = OPM_RecAlign; + } else { + OPV_TypSize(btyp); + offset = btyp->size - (LONGINT)__ASHR(btyp->sysflag, 8); + base = btyp->align; + } + fld = typ->link; + while ((fld != NIL && fld->mode == 4)) { + btyp = fld->typ; + OPV_TypSize(btyp); + size = btyp->size; + fbase = OPC_Base(btyp); + OPC_Align(&offset, fbase); + fld->adr = offset; + offset += size; + if (fbase > base) { + base = fbase; + } + fld = fld->link; + } + off0 = offset; + if (offset == 0) { + offset = 1; + } + if (OPM_RecSize == 0) { + base = OPV_NaturalAlignment(offset, OPM_RecAlign); + } + OPC_Align(&offset, base); + if ((typ->strobj == NIL && __MASK(typ->align, -65536) == 0)) { + OPV_recno += 1; + base += __ASHL(OPV_recno, 16); + } + typ->size = offset; + typ->align = base; + typ->sysflag = __MASK(typ->sysflag, -256) + (int)__ASHL(offset - off0, 8); + } else if (c == 2) { + OPV_TypSize(typ->BaseTyp); + typ->size = typ->n * typ->BaseTyp->size; + } else if (f == 13) { + typ->size = OPM_PointerSize; + if (typ->BaseTyp == OPT_undftyp) { + OPM_Mark(128, typ->n); + } else { + OPV_TypSize(typ->BaseTyp); + } + } else if (f == 14) { + typ->size = OPM_ProcSize; + } else if (c == 3) { + btyp = typ->BaseTyp; + OPV_TypSize(btyp); + if (btyp->comp == 3) { + typ->size = btyp->size + 4; + } else { + typ->size = 8; + } + } + } +} + +void OPV_Init (void) +{ + OPV_stamp = 0; + OPV_recno = 0; + OPV_nofExitLabels = 0; + OPV_assert = __IN(7, OPM_opt); + OPV_inxchk = __IN(0, OPM_opt); + OPV_mainprog = __IN(10, OPM_opt); + OPV_ansi = __IN(6, OPM_opt); +} + +static void OPV_GetTProcNum (OPT_Object obj) +{ + LONGINT oldPos; + OPT_Struct typ = NIL; + OPT_Object redef = NIL; + oldPos = OPM_errpos; + OPM_errpos = obj->scope->adr; + typ = obj->link->typ; + if (typ->form == 13) { + typ = typ->BaseTyp; + } + OPT_FindField(obj->name, typ->BaseTyp, &redef); + if (redef != NIL) { + obj->adr = __ASHL(__ASHR(redef->adr, 16), 16); + if (!__IN(2, obj->conval->setval)) { + OPM_err(119); + } + } else { + obj->adr += __ASHL(typ->n, 16); + typ->n += 1; + } + OPM_errpos = oldPos; +} + +static void OPV_TraverseRecord (OPT_Struct typ) +{ + if (!typ->allocated) { + if (typ->BaseTyp != NIL) { + OPV_TraverseRecord(typ->BaseTyp); + typ->n = typ->BaseTyp->n; + } + typ->allocated = 1; + OPV_Traverse(typ->link, typ->strobj, 0); + } +} + +static void OPV_Stamp (OPS_Name s) +{ + INTEGER i, j, k; + CHAR n[10]; + OPV_stamp += 1; + i = 0; + j = OPV_stamp; + while (s[__X(i, ((LONGINT)(256)))] != 0x00) { + i += 1; + } + if (i > 25) { + i = 25; + } + s[__X(i, ((LONGINT)(256)))] = '_'; + s[__X(i + 1, ((LONGINT)(256)))] = '_'; + i += 2; + k = 0; + do { + n[__X(k, ((LONGINT)(10)))] = (CHAR)((int)__MOD(j, 10) + 48); + j = __DIV(j, 10); + k += 1; + } while (!(j == 0)); + do { + k -= 1; + s[__X(i, ((LONGINT)(256)))] = n[__X(k, ((LONGINT)(10)))]; + i += 1; + } while (!(k == 0)); + s[__X(i, ((LONGINT)(256)))] = 0x00; +} + +static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported) +{ + INTEGER mode; + OPT_Object scope = NIL; + OPT_Struct typ = NIL; + if (obj != NIL) { + OPV_Traverse(obj->left, outerScope, exported); + if (obj->name[0] == '@') { + obj->name[0] = '_'; + OPV_Stamp(obj->name); + } + obj->linkadr = 0; + mode = obj->mode; + if ((mode == 5 && (obj->vis != 0) == exported)) { + typ = obj->typ; + OPV_TypSize(obj->typ); + if (typ->form == 13) { + typ = typ->BaseTyp; + } + if (typ->comp == 4) { + OPV_TraverseRecord(typ); + } + } else if (mode == 13) { + OPV_GetTProcNum(obj); + } else if (mode == 1) { + OPV_TypSize(obj->typ); + } + if (!exported) { + if ((__IN(mode, 0x60) && obj->mnolev > 0)) { + OPV_Stamp(obj->name); + } + if (__IN(mode, 0x26)) { + obj->scope = outerScope; + } else if (__IN(mode, 0x26c0)) { + if (obj->conval->setval == 0x0) { + OPM_err(129); + } + scope = obj->scope; + scope->leaf = 1; + __COPY(obj->name, scope->name, ((LONGINT)(256))); + OPV_Stamp(scope->name); + if (mode == 9) { + obj->adr = 1; + } + if (scope->mnolev > 1) { + outerScope->leaf = 0; + } + OPV_Traverse(obj->scope->right, obj->scope, 0); + } + } + OPV_Traverse(obj->right, outerScope, exported); + } +} + +void OPV_AdrAndSize (OPT_Object topScope) +{ + OPM_errpos = topScope->adr; + topScope->leaf = 1; + OPV_Traverse(topScope->right, topScope, 1); + OPV_Traverse(topScope->right, topScope, 0); + OPT_chartyp->strobj->linkadr = 2; + OPT_settyp->strobj->linkadr = 2; + OPT_realtyp->strobj->linkadr = 2; + OPT_inttyp->strobj->linkadr = 2; + OPT_linttyp->strobj->linkadr = 2; + OPT_lrltyp->strobj->linkadr = 2; + OPT_sinttyp->strobj->linkadr = 2; + OPT_booltyp->strobj->linkadr = 2; + OPT_bytetyp->strobj->linkadr = 2; + OPT_sysptrtyp->strobj->linkadr = 2; +} + +static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, INTEGER comp) +{ + INTEGER _o_result; + switch (class) { + case 7: case 0: case 2: case 4: case 9: + case 13: + _o_result = 10; + return _o_result; + break; + case 5: + if (__IN(3, OPM_opt)) { + _o_result = 10; + return _o_result; + } else { + _o_result = 9; + return _o_result; + } + break; + case 1: + if (__IN(comp, 0x0c)) { + _o_result = 10; + return _o_result; + } else { + _o_result = 9; + return _o_result; + } + break; + case 3: + _o_result = 9; + return _o_result; + break; + case 11: + switch (subclass) { + case 33: case 7: case 24: case 29: case 20: + _o_result = 9; + return _o_result; + break; + case 16: case 21: case 22: case 23: case 25: + _o_result = 10; + return _o_result; + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence Nmop, subclass = ", (LONGINT)51); + OPM_LogWNum(subclass, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + break; + case 12: + switch (subclass) { + case 1: + if (form == 9) { + _o_result = 4; + return _o_result; + } else { + _o_result = 8; + return _o_result; + } + break; + case 2: + if (form == 9) { + _o_result = 3; + return _o_result; + } else { + _o_result = 8; + return _o_result; + } + break; + case 3: case 4: + _o_result = 10; + return _o_result; + break; + case 6: + if (form == 9) { + _o_result = 2; + return _o_result; + } else { + _o_result = 7; + return _o_result; + } + break; + case 7: + if (form == 9) { + _o_result = 4; + return _o_result; + } else { + _o_result = 7; + return _o_result; + } + break; + case 11: case 12: case 13: case 14: + _o_result = 6; + return _o_result; + break; + case 9: case 10: + _o_result = 5; + return _o_result; + break; + case 5: + _o_result = 1; + return _o_result; + break; + case 8: + _o_result = 0; + return _o_result; + break; + case 19: case 15: case 17: case 18: case 26: + case 27: case 28: + _o_result = 10; + return _o_result; + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence Ndop, subclass = ", (LONGINT)51); + OPM_LogWNum(subclass, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + break; + case 10: + _o_result = 10; + return _o_result; + break; + case 8: case 6: + _o_result = 12; + return _o_result; + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence, class = ", (LONGINT)43); + OPM_LogWNum(class, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + __RETCHK; +} + +static void OPV_Len (OPT_Node n, LONGINT dim) +{ + while ((n->class == 4 && n->typ->comp == 3)) { + dim += 1; + n = n->left; + } + if ((n->class == 3 && n->typ->comp == 3)) { + OPV_design(n->left, 10); + OPM_WriteString((CHAR*)"->len[", (LONGINT)7); + OPM_WriteInt(dim); + OPM_Write(']'); + } else { + OPC_Len(n->obj, n->typ, dim); + } +} + +static BOOLEAN OPV_SideEffects (OPT_Node n) +{ + BOOLEAN _o_result; + if (n != NIL) { + _o_result = (n->class == 13 || OPV_SideEffects(n->left)) || OPV_SideEffects(n->right); + return _o_result; + } else { + _o_result = 0; + return _o_result; + } + __RETCHK; +} + +static void OPV_Entier (OPT_Node n, INTEGER prec) +{ + if (__IN(n->typ->form, 0x0180)) { + OPM_WriteString((CHAR*)"__ENTIER(", (LONGINT)10); + OPV_expr(n, -1); + OPM_Write(')'); + } else { + OPV_expr(n, prec); + } +} + +static void OPV_Convert (OPT_Node n, INTEGER form, INTEGER prec) +{ + INTEGER from; + from = n->typ->form; + if (form == 9) { + OPM_WriteString((CHAR*)"__SETOF(", (LONGINT)9); + OPV_Entier(n, -1); + OPM_Write(')'); + } else if (form == 6) { + if (from < 6) { + OPM_WriteString((CHAR*)"(LONGINT)", (LONGINT)10); + } + OPV_Entier(n, 9); + } else if (form == 5) { + if (from < 5) { + OPM_WriteString((CHAR*)"(int)", (LONGINT)6); + OPV_expr(n, 9); + } else { + if (__IN(2, OPM_opt)) { + OPM_WriteString((CHAR*)"__SHORT", (LONGINT)8); + if (OPV_SideEffects(n)) { + OPM_Write('F'); + } + OPM_Write('('); + OPV_Entier(n, -1); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteInt(OPM_MaxInt + 1); + OPM_Write(')'); + } else { + OPM_WriteString((CHAR*)"(int)", (LONGINT)6); + OPV_Entier(n, 9); + } + } + } else if (form == 4) { + if (__IN(2, OPM_opt)) { + OPM_WriteString((CHAR*)"__SHORT", (LONGINT)8); + if (OPV_SideEffects(n)) { + OPM_Write('F'); + } + OPM_Write('('); + OPV_Entier(n, -1); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteInt(OPM_MaxSInt + 1); + OPM_Write(')'); + } else { + OPM_WriteString((CHAR*)"(int)", (LONGINT)6); + OPV_Entier(n, 9); + } + } else if (form == 3) { + if (__IN(2, OPM_opt)) { + OPM_WriteString((CHAR*)"__CHR", (LONGINT)6); + if (OPV_SideEffects(n)) { + OPM_Write('F'); + } + OPM_Write('('); + OPV_Entier(n, -1); + OPM_Write(')'); + } else { + OPM_WriteString((CHAR*)"(CHAR)", (LONGINT)7); + OPV_Entier(n, 9); + } + } else { + OPV_expr(n, prec); + } +} + +static void OPV_TypeOf (OPT_Node n) +{ + if (n->typ->form == 13) { + OPM_WriteString((CHAR*)"__TYPEOF(", (LONGINT)10); + OPV_expr(n, -1); + OPM_Write(')'); + } else if (__IN(n->class, 0x15)) { + OPC_Andent(n->typ); + OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + } else if (n->class == 3) { + OPM_WriteString((CHAR*)"__TYPEOF(", (LONGINT)10); + OPV_expr(n->left, -1); + OPM_Write(')'); + } else if (n->class == 5) { + OPV_TypeOf(n->left); + } else if ((n->class == 11 && n->subcl == 29)) { + OPC_TypeOf(n->left->obj); + } else { + OPC_TypeOf(n->obj); + } +} + +static void OPV_Index (OPT_Node n, OPT_Node d, INTEGER prec, INTEGER dim) +{ + if (!OPV_inxchk || (n->right->class == 7 && (n->right->conval->intval == 0 || n->left->typ->comp != 3))) { + OPV_expr(n->right, prec); + } else { + if (OPV_SideEffects(n->right)) { + OPM_WriteString((CHAR*)"__XF(", (LONGINT)6); + } else { + OPM_WriteString((CHAR*)"__X(", (LONGINT)5); + } + OPV_expr(n->right, -1); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPV_Len(d, dim); + OPM_Write(')'); + } +} + +static void OPV_design (OPT_Node n, INTEGER prec) +{ + OPT_Object obj = NIL; + OPT_Struct typ = NIL; + INTEGER class, designPrec, comp; + OPT_Node d = NIL, x = NIL; + INTEGER dims, i, _for__26; + comp = n->typ->comp; + obj = n->obj; + class = n->class; + designPrec = OPV_Precedence(class, n->subcl, n->typ->form, comp); + if ((((((class == 0 && obj->mnolev > 0)) && (int)obj->mnolev != OPM_level)) && prec == 10)) { + designPrec = 9; + } + if (prec > designPrec) { + OPM_Write('('); + } + if (prec == 11) { + OPM_Write('*'); + } + switch (class) { + case 9: + OPC_Ident(n->obj); + break; + case 0: + OPC_CompleteIdent(n->obj); + break; + case 1: + if (!__IN(comp, 0x0c)) { + OPM_Write('*'); + } + OPC_CompleteIdent(n->obj); + break; + case 2: + if (n->left->class == 3) { + OPV_design(n->left->left, designPrec); + OPM_WriteString((CHAR*)"->", (LONGINT)3); + } else { + OPV_design(n->left, designPrec); + OPM_Write('.'); + } + OPC_Ident(n->obj); + break; + case 3: + if (n->typ->comp == 3) { + OPV_design(n->left, 10); + OPM_WriteString((CHAR*)"->data", (LONGINT)7); + } else { + OPM_Write('*'); + OPV_design(n->left, designPrec); + } + break; + case 4: + d = n->left; + if (d->typ->comp == 3) { + dims = 0; + while (d->class == 4) { + d = d->left; + dims += 1; + } + if (n->typ->comp == 3) { + OPM_Write('&'); + } + OPV_design(d, designPrec); + OPM_Write('['); + if (n->typ->comp == 3) { + OPM_Write('('); + } + i = dims; + x = n; + while (x != d) { + if (x->left != d) { + OPV_Index(x, d, 7, i); + OPM_WriteString((CHAR*)" + ", (LONGINT)4); + OPV_Len(d, i); + OPM_WriteString((CHAR*)" * (", (LONGINT)5); + i -= 1; + } else { + OPV_Index(x, d, -1, i); + } + x = x->left; + } + _for__26 = dims; + i = 1; + while (i <= _for__26) { + OPM_Write(')'); + i += 1; + } + if (n->typ->comp == 3) { + OPM_Write(')'); + while ((LONGINT)i < __ASHR(d->typ->size - 4, 2)) { + OPM_WriteString((CHAR*)" * ", (LONGINT)4); + OPV_Len(d, i); + i += 1; + } + } + OPM_Write(']'); + } else { + OPV_design(n->left, designPrec); + OPM_Write('['); + OPV_Index(n, n->left, -1, 0); + OPM_Write(']'); + } + break; + case 5: + typ = n->typ; + obj = n->left->obj; + if (__IN(3, OPM_opt)) { + if (typ->comp == 4) { + OPM_WriteString((CHAR*)"__GUARDR(", (LONGINT)10); + if ((int)obj->mnolev != OPM_level) { + OPM_WriteStringVar((void*)obj->scope->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"__curr->", (LONGINT)9); + OPC_Ident(obj); + } else { + OPC_Ident(obj); + } + } else { + if (typ->BaseTyp->strobj == NIL) { + OPM_WriteString((CHAR*)"__GUARDA(", (LONGINT)10); + } else { + OPM_WriteString((CHAR*)"__GUARDP(", (LONGINT)10); + } + OPV_expr(n->left, -1); + typ = typ->BaseTyp; + } + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPC_Andent(typ); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteInt(typ->extlev); + OPM_Write(')'); + } else { + if (typ->comp == 4) { + OPM_WriteString((CHAR*)"*(", (LONGINT)3); + OPC_Ident(typ->strobj); + OPM_WriteString((CHAR*)"*)", (LONGINT)3); + OPC_CompleteIdent(obj); + } else { + OPM_Write('('); + OPC_Ident(typ->strobj); + OPM_Write(')'); + OPV_expr(n->left, designPrec); + } + } + break; + case 6: + if (__IN(3, OPM_opt)) { + if (n->left->class == 1) { + OPM_WriteString((CHAR*)"__GUARDEQR(", (LONGINT)12); + OPC_CompleteIdent(n->left->obj); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPV_TypeOf(n->left); + } else { + OPM_WriteString((CHAR*)"__GUARDEQP(", (LONGINT)12); + OPV_expr(n->left->left, -1); + } + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPC_Ident(n->left->typ->strobj); + OPM_Write(')'); + } else { + OPV_expr(n->left, -1); + } + break; + case 11: + if (n->subcl == 29) { + OPV_design(n->left, prec); + } + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPV.design, class = ", (LONGINT)39); + OPM_LogWNum(class, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + if (prec > designPrec) { + OPM_Write(')'); + } +} + +static void OPV_ActualPar (OPT_Node n, OPT_Object fp) +{ + OPT_Struct typ = NIL, aptyp = NIL; + INTEGER comp, form, mode, prec, dim; + OPM_Write('('); + while (n != NIL) { + typ = fp->typ; + comp = typ->comp; + form = typ->form; + mode = fp->mode; + prec = -1; + if ((((mode == 2 && n->class == 11)) && n->subcl == 29)) { + OPM_Write('('); + OPC_Ident(n->typ->strobj); + OPM_WriteString((CHAR*)"*)", (LONGINT)3); + prec = 10; + } + if (!__IN(n->typ->comp, 0x0c)) { + if (mode == 2) { + if ((OPV_ansi && typ != n->typ)) { + OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + } + OPM_Write('&'); + prec = 9; + } else if (OPV_ansi) { + if ((__IN(comp, 0x0c) && n->class == 7)) { + OPM_WriteString((CHAR*)"(CHAR*)", (LONGINT)8); + } else if ((((form == 13 && typ != n->typ)) && n->typ != OPT_niltyp)) { + OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + } + } else { + if ((__IN(form, 0x0180) && __IN(n->typ->form, 0x70))) { + OPM_WriteString((CHAR*)"(double)", (LONGINT)9); + prec = 9; + } else if ((form == 6 && n->typ->form < 6)) { + OPM_WriteString((CHAR*)"(LONGINT)", (LONGINT)10); + prec = 9; + } + } + } else if (OPV_ansi) { + if ((((mode == 2 && typ != n->typ)) && prec == -1)) { + OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + } + } + if ((((mode == 2 && n->class == 11)) && n->subcl == 29)) { + OPV_expr(n->left, prec); + } else if ((((((form == 6 && n->class == 7)) && n->conval->intval <= OPM_MaxInt)) && n->conval->intval >= OPM_MinInt)) { + OPM_WriteString((CHAR*)"((LONGINT)(", (LONGINT)12); + OPV_expr(n, prec); + OPM_WriteString((CHAR*)"))", (LONGINT)3); + } else { + OPV_expr(n, prec); + } + if ((comp == 4 && mode == 2)) { + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPV_TypeOf(n); + } else if (comp == 3) { + if (n->class == 7) { + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)"(LONGINT)", (LONGINT)10); + OPM_WriteInt(n->conval->intval2); + } else { + aptyp = n->typ; + dim = 0; + while ((typ->comp == 3 && typ->BaseTyp->form != 1)) { + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPV_Len(n, dim); + typ = typ->BaseTyp; + aptyp = aptyp->BaseTyp; + dim += 1; + } + if ((typ->comp == 3 && typ->BaseTyp->form == 1)) { + OPM_WriteString((CHAR*)", ", (LONGINT)3); + while (aptyp->comp == 3) { + OPV_Len(n, dim); + OPM_WriteString((CHAR*)" * ", (LONGINT)4); + dim += 1; + aptyp = aptyp->BaseTyp; + } + OPM_WriteString((CHAR*)"((LONGINT)(", (LONGINT)12); + OPM_WriteInt(aptyp->size); + OPM_WriteString((CHAR*)"))", (LONGINT)3); + } + } + } + n = n->link; + fp = fp->link; + if (n != NIL) { + OPM_WriteString((CHAR*)", ", (LONGINT)3); + } + } + OPM_Write(')'); +} + +static OPT_Object OPV_SuperProc (OPT_Node n) +{ + OPT_Object _o_result; + OPT_Object obj = NIL; + OPT_Struct typ = NIL; + typ = n->right->typ; + if (typ->form == 13) { + typ = typ->BaseTyp; + } + OPT_FindField(n->left->obj->name, typ->BaseTyp, &obj); + _o_result = obj; + return _o_result; +} + +static void OPV_expr (OPT_Node n, INTEGER prec) +{ + INTEGER class, subclass, form, exprPrec; + OPT_Struct typ = NIL; + OPT_Node l = NIL, r = NIL; + OPT_Object proc = NIL; + class = n->class; + subclass = n->subcl; + form = n->typ->form; + l = n->left; + r = n->right; + exprPrec = OPV_Precedence(class, subclass, form, n->typ->comp); + if ((exprPrec <= prec && __IN(class, 0x3ce0))) { + OPM_Write('('); + } + switch (class) { + case 7: + OPC_Constant(n->conval, form); + break; + case 10: + OPM_WriteString((CHAR*)"__SETRNG(", (LONGINT)10); + OPV_expr(l, -1); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPV_expr(r, -1); + OPM_Write(')'); + break; + case 11: + switch (subclass) { + case 33: + OPM_Write('!'); + OPV_expr(l, exprPrec); + break; + case 7: + if (form == 9) { + OPM_Write('~'); + } else { + OPM_Write('-'); + } + OPV_expr(l, exprPrec); + break; + case 16: + typ = n->obj->typ; + if (l->typ->comp == 4) { + OPM_WriteString((CHAR*)"__IS(", (LONGINT)6); + OPC_TypeOf(l->obj); + } else { + OPM_WriteString((CHAR*)"__ISP(", (LONGINT)7); + OPV_expr(l, -1); + typ = typ->BaseTyp; + } + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPC_Andent(typ); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteInt(typ->extlev); + OPM_Write(')'); + break; + case 20: + OPV_Convert(l, form, exprPrec); + break; + case 21: + if (OPV_SideEffects(l)) { + if (l->typ->form < 7) { + if (l->typ->form < 6) { + OPM_WriteString((CHAR*)"(int)", (LONGINT)6); + } + OPM_WriteString((CHAR*)"__ABSF(", (LONGINT)8); + } else { + OPM_WriteString((CHAR*)"__ABSFD(", (LONGINT)9); + } + } else { + OPM_WriteString((CHAR*)"__ABS(", (LONGINT)7); + } + OPV_expr(l, -1); + OPM_Write(')'); + break; + case 22: + OPM_WriteString((CHAR*)"__CAP(", (LONGINT)7); + OPV_expr(l, -1); + OPM_Write(')'); + break; + case 23: + OPM_WriteString((CHAR*)"__ODD(", (LONGINT)7); + OPV_expr(l, -1); + OPM_Write(')'); + break; + case 24: + OPM_WriteString((CHAR*)"(LONGINT)(uintptr_t)", (LONGINT)21); + if (l->class == 1) { + OPC_CompleteIdent(l->obj); + } else { + if ((l->typ->form != 10 && !__IN(l->typ->comp, 0x0c))) { + OPM_Write('&'); + } + OPV_expr(l, exprPrec); + } + break; + case 29: + if ((((__IN(n->typ->form, 0x6240) && __IN(l->typ->form, 0x6240))) && n->typ->size == l->typ->size) || !__IN(l->class, 0x17)) { + OPM_Write('('); + OPC_Ident(n->typ->strobj); + OPM_Write(')'); + if (__IN(n->typ->form, 0x6000) || __IN(l->typ->form, 0x6000)) { + OPM_WriteString((CHAR*)"(uintptr_t)", (LONGINT)12); + } + OPV_expr(l, exprPrec); + } else { + if (__IN(n->typ->form, 0x6000) || __IN(l->typ->form, 0x6000)) { + OPM_WriteString((CHAR*)"__VALP(", (LONGINT)8); + } else { + OPM_WriteString((CHAR*)"__VAL(", (LONGINT)7); + } + OPC_Ident(n->typ->strobj); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPV_expr(l, -1); + OPM_Write(')'); + } + break; + default: + OPM_err(200); + break; + } + break; + case 12: + switch (subclass) { + case 19: + OPV_Len(l, r->conval->intval); + break; + case 15: case 17: case 18: case 26: case 27: + case 28: case 3: case 4: + switch (subclass) { + case 15: + OPM_WriteString((CHAR*)"__IN(", (LONGINT)6); + break; + case 17: + if (r->class == 7) { + if (r->conval->intval >= 0) { + OPM_WriteString((CHAR*)"__ASHL(", (LONGINT)8); + } else { + OPM_WriteString((CHAR*)"__ASHR(", (LONGINT)8); + } + } else if (OPV_SideEffects(r)) { + OPM_WriteString((CHAR*)"__ASHF(", (LONGINT)8); + } else { + OPM_WriteString((CHAR*)"__ASH(", (LONGINT)7); + } + break; + case 18: + OPM_WriteString((CHAR*)"__MASK(", (LONGINT)8); + break; + case 26: + OPM_WriteString((CHAR*)"__BIT(", (LONGINT)7); + break; + case 27: + if (r->class == 7) { + if (r->conval->intval >= 0) { + OPM_WriteString((CHAR*)"__LSHL(", (LONGINT)8); + } else { + OPM_WriteString((CHAR*)"__LSHR(", (LONGINT)8); + } + } else { + OPM_WriteString((CHAR*)"__LSH(", (LONGINT)7); + } + break; + case 28: + if (r->class == 7) { + if (r->conval->intval >= 0) { + OPM_WriteString((CHAR*)"__ROTL(", (LONGINT)8); + } else { + OPM_WriteString((CHAR*)"__ROTR(", (LONGINT)8); + } + } else { + OPM_WriteString((CHAR*)"__ROT(", (LONGINT)7); + } + break; + case 3: + if (OPV_SideEffects(n)) { + if (form < 6) { + OPM_WriteString((CHAR*)"(int)", (LONGINT)6); + } + OPM_WriteString((CHAR*)"__DIVF(", (LONGINT)8); + } else { + OPM_WriteString((CHAR*)"__DIV(", (LONGINT)7); + } + break; + case 4: + if (form < 6) { + OPM_WriteString((CHAR*)"(int)", (LONGINT)6); + } + if (OPV_SideEffects(n)) { + OPM_WriteString((CHAR*)"__MODF(", (LONGINT)8); + } else { + OPM_WriteString((CHAR*)"__MOD(", (LONGINT)7); + } + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, subclass = ", (LONGINT)40); + OPM_LogWNum(subclass, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + OPV_expr(l, -1); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + if ((((__IN(subclass, 0x18020000) && r->class == 7)) && r->conval->intval < 0)) { + OPM_WriteInt(-r->conval->intval); + } else { + OPV_expr(r, -1); + } + if (__IN(subclass, 0x18000000)) { + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPC_Ident(l->typ->strobj); + } + OPM_Write(')'); + break; + case 9: case 10: case 11: case 12: case 13: + case 14: + if (__IN(l->typ->form, 0x8400)) { + OPM_WriteString((CHAR*)"__STRCMP(", (LONGINT)10); + OPV_expr(l, -1); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPV_expr(r, -1); + OPM_Write(')'); + OPC_Cmp(subclass); + OPM_Write('0'); + } else { + OPV_expr(l, exprPrec); + OPC_Cmp(subclass); + typ = l->typ; + if ((((((typ->form == 13 && r->typ->form != 11)) && r->typ != typ)) && r->typ != OPT_sysptrtyp)) { + OPM_WriteString((CHAR*)"(void *) ", (LONGINT)10); + } + OPV_expr(r, exprPrec); + } + break; + default: + if (subclass == 5 || (form == 9 && (subclass == 1 || subclass == 7))) { + OPM_Write('('); + } + OPV_expr(l, exprPrec); + switch (subclass) { + case 1: + if (form == 9) { + OPM_WriteString((CHAR*)" & ", (LONGINT)4); + } else { + OPM_WriteString((CHAR*)" * ", (LONGINT)4); + } + break; + case 2: + if (form == 9) { + OPM_WriteString((CHAR*)" ^ ", (LONGINT)4); + } else { + OPM_WriteString((CHAR*)" / ", (LONGINT)4); + if (r->obj == NIL || __IN(r->obj->typ->form, 0x70)) { + OPM_Write('('); + OPC_Ident(n->typ->strobj); + OPM_Write(')'); + } + } + break; + case 5: + OPM_WriteString((CHAR*)" && ", (LONGINT)5); + break; + case 6: + if (form == 9) { + OPM_WriteString((CHAR*)" | ", (LONGINT)4); + } else { + OPM_WriteString((CHAR*)" + ", (LONGINT)4); + } + break; + case 7: + if (form == 9) { + OPM_WriteString((CHAR*)" & ~", (LONGINT)5); + } else { + OPM_WriteString((CHAR*)" - ", (LONGINT)4); + } + break; + case 8: + OPM_WriteString((CHAR*)" || ", (LONGINT)5); + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, subclass = ", (LONGINT)40); + OPM_LogWNum(subclass, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + OPV_expr(r, exprPrec); + if (subclass == 5 || (form == 9 && (subclass == 1 || subclass == 7))) { + OPM_Write(')'); + } + break; + } + break; + case 13: + if ((l->obj != NIL && l->obj->mode == 13)) { + if (l->subcl == 1) { + proc = OPV_SuperProc(n); + } else { + OPM_WriteString((CHAR*)"__", (LONGINT)3); + proc = OPC_BaseTProc(l->obj); + } + OPC_Ident(proc); + n->obj = proc->link; + } else if (l->class == 9) { + OPV_design(l, 10); + } else { + OPV_design(l, 11); + } + OPV_ActualPar(r, n->obj); + break; + default: + OPV_design(n, prec); + break; + } + if ((exprPrec <= prec && __IN(class, 0x3ca0))) { + OPM_Write(')'); + } +} + +static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) +{ + OPT_Node if_ = NIL; + OPT_Object obj = NIL; + OPT_Struct typ = NIL; + LONGINT adr; + if_ = n->left; + while (if_ != NIL) { + OPM_WriteString((CHAR*)"if ", (LONGINT)4); + OPV_expr(if_->left, 12); + OPM_Write(' '); + OPC_BegBlk(); + if ((n->class == 27 && if_->left->left != NIL)) { + obj = if_->left->left->obj; + typ = obj->typ; + adr = obj->adr; + if (typ->comp == 4) { + OPC_BegStat(); + OPC_Ident(if_->left->obj); + OPM_WriteString((CHAR*)" *", (LONGINT)3); + OPM_WriteString(obj->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"__ = (void*)", (LONGINT)13); + obj->adr = 0; + OPC_CompleteIdent(obj); + OPC_EndStat(); + } + obj->adr = 1; + obj->typ = if_->left->obj->typ; + OPV_stat(if_->right, outerProc); + obj->typ = typ; + obj->adr = adr; + } else { + OPV_stat(if_->right, outerProc); + } + if_ = if_->link; + if ((if_ != NIL || n->right != NIL) || withtrap) { + OPC_EndBlk0(); + OPM_WriteString((CHAR*)" else ", (LONGINT)7); + } else { + OPC_EndBlk(); + } + } + if (withtrap) { + OPM_WriteString((CHAR*)"__WITHCHK", (LONGINT)10); + OPC_EndStat(); + } else if (n->right != NIL) { + OPC_BegBlk(); + OPV_stat(n->right, outerProc); + OPC_EndBlk(); + } +} + +static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc) +{ + OPT_Node switchCase = NIL, label = NIL; + LONGINT low, high; + INTEGER form, i; + OPM_WriteString((CHAR*)"switch ", (LONGINT)8); + OPV_expr(n->left, 12); + OPM_Write(' '); + OPC_BegBlk(); + form = n->left->typ->form; + switchCase = n->right->left; + while (switchCase != NIL) { + label = switchCase->left; + i = 0; + while (label != NIL) { + low = label->conval->intval; + high = label->conval->intval2; + while (low <= high) { + if (i == 0) { + OPC_BegStat(); + } + OPC_Case(low, form); + low += 1; + i += 1; + if (i == 5) { + OPM_WriteLn(); + i = 0; + } + } + label = label->link; + } + if (i > 0) { + OPM_WriteLn(); + } + OPC_Indent(1); + OPV_stat(switchCase->right, outerProc); + OPC_BegStat(); + OPM_WriteString((CHAR*)"break", (LONGINT)6); + OPC_EndStat(); + OPC_Indent(-1); + switchCase = switchCase->link; + } + OPC_BegStat(); + OPM_WriteString((CHAR*)"default: ", (LONGINT)10); + if (n->right->conval->setval != 0x0) { + OPC_Indent(1); + OPM_WriteLn(); + OPV_stat(n->right->right, outerProc); + OPC_BegStat(); + OPM_WriteString((CHAR*)"break", (LONGINT)6); + OPC_Indent(-1); + } else { + OPM_WriteString((CHAR*)"__CASECHK", (LONGINT)10); + } + OPC_EndStat(); + OPC_EndBlk(); +} + +static BOOLEAN OPV_ImplicitReturn (OPT_Node n) +{ + BOOLEAN _o_result; + while ((n != NIL && n->class != 26)) { + n = n->link; + } + _o_result = n == NIL; + return _o_result; +} + +static void OPV_NewArr (OPT_Node d, OPT_Node x) +{ + OPT_Struct typ = NIL, base = NIL; + INTEGER nofdim, nofdyn; + typ = d->typ->BaseTyp; + base = typ; + nofdim = 0; + nofdyn = 0; + while (base->comp == 3) { + nofdim += 1; + nofdyn += 1; + base = base->BaseTyp; + } + OPV_design(d, -1); + OPM_WriteString((CHAR*)" = __NEWARR(", (LONGINT)13); + while (base->comp == 2) { + nofdim += 1; + base = base->BaseTyp; + } + if ((base->comp == 4 && OPC_NofPtrs(base) != 0)) { + OPC_Ident(base->strobj); + OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + } else if (base->form == 13) { + OPM_WriteString((CHAR*)"POINTER__typ", (LONGINT)13); + } else { + OPM_WriteString((CHAR*)"NIL", (LONGINT)4); + } + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)"((LONGINT)(", (LONGINT)12); + OPM_WriteInt(base->size); + OPM_WriteString((CHAR*)"))", (LONGINT)3); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteInt(OPC_Base(base)); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteInt(nofdim); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteInt(nofdyn); + while (typ != base) { + OPM_WriteString((CHAR*)", ", (LONGINT)3); + if (typ->comp == 3) { + if (x->class == 7) { + OPM_WriteString((CHAR*)"(LONGINT)(", (LONGINT)11); + OPV_expr(x, -1); + OPM_WriteString((CHAR*)")", (LONGINT)2); + } else { + OPM_WriteString((CHAR*)"(LONGINT)", (LONGINT)10); + OPV_expr(x, 10); + } + x = x->link; + } else { + OPM_WriteString((CHAR*)"(LONGINT)", (LONGINT)10); + OPM_WriteInt(typ->n); + } + typ = typ->BaseTyp; + } + OPM_Write(')'); +} + +static void OPV_DefineTDescs (OPT_Node n) +{ + while ((n != NIL && n->class == 14)) { + OPC_TDescDecl(n->typ); + n = n->link; + } +} + +static void OPV_InitTDescs (OPT_Node n) +{ + while ((n != NIL && n->class == 14)) { + OPC_InitTDesc(n->typ); + n = n->link; + } +} + +static void OPV_stat (OPT_Node n, OPT_Object outerProc) +{ + OPT_Object proc = NIL; + OPV_ExitInfo saved; + OPT_Node l = NIL, r = NIL; + while ((n != NIL && OPM_noerr)) { + OPM_errpos = n->conval->intval; + if (n->class != 14) { + OPC_BegStat(); + } + switch (n->class) { + case 18: + if (n->obj == NIL) { + OPM_level += 1; + OPV_stat(n->left, outerProc); + OPM_level -= 1; + OPC_GenEnumPtrs(OPT_topScope->scope); + OPV_DefineTDescs(n->right); + OPC_EnterBody(); + OPV_InitTDescs(n->right); + OPM_WriteString((CHAR*)"/* BEGIN */", (LONGINT)12); + OPM_WriteLn(); + OPV_stat(n->right, outerProc); + OPC_ExitBody(); + } else { + proc = n->obj; + OPC_TypeDefs(proc->scope->right, 0); + if (!proc->scope->leaf) { + OPC_DefineInter(proc); + } + OPM_level += 1; + OPV_stat(n->left, proc); + OPM_level -= 1; + OPC_EnterProc(proc); + OPV_stat(n->right, proc); + OPC_ExitProc(proc, 1, OPV_ImplicitReturn(n->right)); + } + break; + case 14: + break; + case 19: + switch (n->subcl) { + case 0: + l = n->left; + r = n->right; + if (l->typ->comp == 2) { + OPM_WriteString((CHAR*)"__MOVE(", (LONGINT)8); + OPV_expr(r, -1); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPV_expr(l, -1); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + if (r->typ == OPT_stringtyp) { + OPM_WriteInt(r->conval->intval2); + } else { + OPM_WriteInt(r->typ->size); + } + OPM_Write(')'); + } else { + if ((((((l->typ->form == 13 && l->obj != NIL)) && l->obj->adr == 1)) && l->obj->mode == 1)) { + l->obj->adr = 0; + OPV_design(l, -1); + l->obj->adr = 1; + if (r->typ->form != 11) { + OPM_WriteString((CHAR*)" = (void*)", (LONGINT)11); + } else { + OPM_WriteString((CHAR*)" = ", (LONGINT)4); + } + } else { + OPV_design(l, -1); + OPM_WriteString((CHAR*)" = ", (LONGINT)4); + } + if (l->typ == r->typ) { + OPV_expr(r, -1); + } else if ((((l->typ->form == 13 && r->typ->form != 11)) && l->typ->strobj != NIL)) { + OPM_Write('('); + OPC_Ident(l->typ->strobj); + OPM_Write(')'); + OPV_expr(r, -1); + } else if (l->typ->comp == 4) { + OPM_WriteString((CHAR*)"*(", (LONGINT)3); + OPC_Andent(l->typ); + OPM_WriteString((CHAR*)"*)&", (LONGINT)4); + OPV_expr(r, 9); + } else { + OPV_expr(r, -1); + } + } + break; + case 1: + if (n->left->typ->BaseTyp->comp == 4) { + OPM_WriteString((CHAR*)"__NEW(", (LONGINT)7); + OPV_design(n->left, -1); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPC_Andent(n->left->typ->BaseTyp); + OPM_WriteString((CHAR*)")", (LONGINT)2); + } else if (__IN(n->left->typ->BaseTyp->comp, 0x0c)) { + OPV_NewArr(n->left, n->right); + } + break; + case 13: case 14: + OPV_expr(n->left, -1); + OPC_Increment(n->subcl == 14); + OPV_expr(n->right, -1); + break; + case 15: case 16: + OPV_expr(n->left, -1); + OPC_SetInclude(n->subcl == 16); + OPM_WriteString((CHAR*)"__SETOF(", (LONGINT)9); + OPV_expr(n->right, -1); + OPM_Write(')'); + break; + case 18: + OPM_WriteString((CHAR*)"__COPY(", (LONGINT)8); + OPV_expr(n->right, -1); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPV_expr(n->left, -1); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPV_Len(n->left, ((LONGINT)(0))); + OPM_Write(')'); + break; + case 31: + OPM_WriteString((CHAR*)"__MOVE(", (LONGINT)8); + OPV_expr(n->right, -1); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPV_expr(n->left, -1); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPV_expr(n->right->link, -1); + OPM_Write(')'); + break; + case 24: + OPM_WriteString((CHAR*)"__GET(", (LONGINT)7); + OPV_expr(n->right, -1); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPV_expr(n->left, -1); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPC_Ident(n->left->typ->strobj); + OPM_Write(')'); + break; + case 25: + OPM_WriteString((CHAR*)"__PUT(", (LONGINT)7); + OPV_expr(n->left, -1); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPV_expr(n->right, -1); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPC_Ident(n->right->typ->strobj); + OPM_Write(')'); + break; + case 26: case 27: + OPM_err(200); + break; + case 30: + OPM_WriteString((CHAR*)"__SYSNEW(", (LONGINT)10); + OPV_design(n->left, -1); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPV_expr(n->right, -1); + OPM_Write(')'); + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, n^.subcl = ", (LONGINT)40); + OPM_LogWNum(n->subcl, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + break; + case 13: + if ((n->left->obj != NIL && n->left->obj->mode == 13)) { + if (n->left->subcl == 1) { + proc = OPV_SuperProc(n); + } else { + OPM_WriteString((CHAR*)"__", (LONGINT)3); + proc = OPC_BaseTProc(n->left->obj); + } + OPC_Ident(proc); + n->obj = proc->link; + } else if (n->left->class == 9) { + OPV_design(n->left, 10); + } else { + OPV_design(n->left, 11); + } + OPV_ActualPar(n->right, n->obj); + break; + case 20: + if (n->subcl != 32) { + OPV_IfStat(n, 0, outerProc); + } else if (OPV_assert) { + OPM_WriteString((CHAR*)"__ASSERT(", (LONGINT)10); + OPV_expr(n->left->left->left, -1); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteInt(n->left->right->right->conval->intval); + OPM_Write(')'); + OPC_EndStat(); + } + break; + case 21: + OPV_exit.level += 1; + OPV_CaseStat(n, outerProc); + OPV_exit.level -= 1; + break; + case 22: + OPV_exit.level += 1; + OPM_WriteString((CHAR*)"while ", (LONGINT)7); + OPV_expr(n->left, 12); + OPM_Write(' '); + OPC_BegBlk(); + OPV_stat(n->right, outerProc); + OPC_EndBlk(); + OPV_exit.level -= 1; + break; + case 23: + OPV_exit.level += 1; + OPM_WriteString((CHAR*)"do ", (LONGINT)4); + OPC_BegBlk(); + OPV_stat(n->left, outerProc); + OPC_EndBlk0(); + OPM_WriteString((CHAR*)" while (!", (LONGINT)10); + OPV_expr(n->right, 9); + OPM_Write(')'); + OPV_exit.level -= 1; + break; + case 24: + saved = OPV_exit; + OPV_exit.level = 0; + OPV_exit.label = -1; + OPM_WriteString((CHAR*)"for (;;) ", (LONGINT)10); + OPC_BegBlk(); + OPV_stat(n->left, outerProc); + OPC_EndBlk(); + if (OPV_exit.label != -1) { + OPC_BegStat(); + OPM_WriteString((CHAR*)"exit__", (LONGINT)7); + OPM_WriteInt(OPV_exit.label); + OPM_Write(':'); + OPC_EndStat(); + } + OPV_exit = saved; + break; + case 25: + if (OPV_exit.level == 0) { + OPM_WriteString((CHAR*)"break", (LONGINT)6); + } else { + if (OPV_exit.label == -1) { + OPV_exit.label = OPV_nofExitLabels; + OPV_nofExitLabels += 1; + } + OPM_WriteString((CHAR*)"goto exit__", (LONGINT)12); + OPM_WriteInt(OPV_exit.label); + } + break; + case 26: + if (OPM_level == 0) { + if (OPV_mainprog) { + OPM_WriteString((CHAR*)"__FINI", (LONGINT)7); + } else { + OPM_WriteString((CHAR*)"__ENDMOD", (LONGINT)9); + } + } else { + if (n->left != NIL) { + OPM_WriteString((CHAR*)"_o_result = ", (LONGINT)13); + if ((n->left->typ->form == 13 && n->obj->typ != n->left->typ)) { + OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + OPV_expr(n->left, 10); + } else { + OPV_expr(n->left, -1); + } + OPM_WriteString((CHAR*)";", (LONGINT)2); + OPM_WriteLn(); + OPC_BegStat(); + OPC_ExitProc(outerProc, 0, 0); + OPM_WriteString((CHAR*)"return _o_result", (LONGINT)17); + } else { + OPM_WriteString((CHAR*)"return", (LONGINT)7); + } + } + break; + case 27: + OPV_IfStat(n, n->subcl == 0, outerProc); + break; + case 28: + OPC_Halt(n->right->conval->intval); + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, n^.class = ", (LONGINT)40); + OPM_LogWNum(n->class, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + if (!__IN(n->class, 0x09744000)) { + OPC_EndStat(); + } + n = n->link; + } +} + +void OPV_Module (OPT_Node prog) +{ + if (!OPV_mainprog) { + OPC_GenHdr(prog->right); + OPC_GenHdrIncludes(); + } + OPC_GenBdy(prog->right); + OPV_stat(prog, NIL); +} + +__TDESC(OPV_ExitInfo, 1, 0) = {__TDFLDS("ExitInfo", 4), {-4}}; + +export void *OPV__init(void) +{ + __DEFMOD; + __MODULE_IMPORT(OPC); + __MODULE_IMPORT(OPM); + __MODULE_IMPORT(OPS); + __MODULE_IMPORT(OPT); + __REGMOD("OPV", 0); + __REGCMD("Init", OPV_Init); + __INITYP(OPV_ExitInfo, OPV_ExitInfo, 0); +/* BEGIN */ + __ENDMOD; +} diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h new file mode 100644 index 00000000..9907a1ef --- /dev/null +++ b/bootstrap/unix-44/OPV.h @@ -0,0 +1,19 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ + +#ifndef OPV__h +#define OPV__h + +#include "SYSTEM.h" +#include "OPT.h" + + + + +import void OPV_AdrAndSize (OPT_Object topScope); +import void OPV_Init (void); +import void OPV_Module (OPT_Node prog); +import void OPV_TypSize (OPT_Struct typ); +import void *OPV__init(void); + + +#endif diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c new file mode 100644 index 00000000..013e6f9c --- /dev/null +++ b/bootstrap/unix-44/Platform.c @@ -0,0 +1,792 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +#include "SYSTEM.h" + +typedef + CHAR (*Platform_ArgPtr)[1024]; + +typedef + Platform_ArgPtr (*Platform_ArgVec)[1024]; + +typedef + LONGINT (*Platform_ArgVecPtr)[1]; + +typedef + CHAR (*Platform_EnvPtr)[1024]; + +typedef + struct Platform_FileIdentity { + LONGINT volume, index, mtime; + } Platform_FileIdentity; + +typedef + void (*Platform_HaltProcedure)(LONGINT); + +typedef + void (*Platform_SignalHandler)(INTEGER); + + +export BOOLEAN Platform_LittleEndian; +export LONGINT Platform_MainStackFrame, Platform_HaltCode; +export INTEGER Platform_PID; +export CHAR Platform_CWD[256]; +export INTEGER Platform_ArgCount; +export LONGINT Platform_ArgVector; +static Platform_HaltProcedure Platform_HaltHandler; +static LONGINT Platform_TimeStart; +export INTEGER Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; +export CHAR Platform_nl[3]; + +export LONGINT *Platform_FileIdentity__typ; + +export BOOLEAN Platform_Absent (INTEGER e); +export INTEGER Platform_ArgPos (CHAR *s, LONGINT s__len); +export void Platform_AssertFail (LONGINT code); +export INTEGER Platform_Chdir (CHAR *n, LONGINT n__len); +export INTEGER Platform_Close (LONGINT h); +export BOOLEAN Platform_ConnectionFailed (INTEGER e); +export void Platform_Delay (LONGINT ms); +export BOOLEAN Platform_DifferentFilesystems (INTEGER e); +static void Platform_DisplayHaltCode (LONGINT code); +export INTEGER Platform_Error (void); +export void Platform_Exit (INTEGER code); +export void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len); +export void Platform_GetClock (LONGINT *t, LONGINT *d); +export void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); +export void Platform_GetIntArg (INTEGER n, LONGINT *val); +export void Platform_GetTimeOfDay (LONGINT *sec, LONGINT *usec); +export void Platform_Halt (LONGINT code); +export INTEGER Platform_Identify (LONGINT h, Platform_FileIdentity *identity, LONGINT *identity__typ); +export INTEGER Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); +export BOOLEAN Platform_Inaccessible (INTEGER e); +export void Platform_Init (INTEGER argc, LONGINT argvadr); +export void Platform_MTimeAsClock (Platform_FileIdentity i, LONGINT *t, LONGINT *d); +export INTEGER Platform_New (CHAR *n, LONGINT n__len, LONGINT *h); +export BOOLEAN Platform_NoSuchDirectory (INTEGER e); +export LONGINT Platform_OSAllocate (LONGINT size); +export void Platform_OSFree (LONGINT address); +export INTEGER Platform_OldRO (CHAR *n, LONGINT n__len, LONGINT *h); +export INTEGER Platform_OldRW (CHAR *n, LONGINT n__len, LONGINT *h); +export INTEGER Platform_Read (LONGINT h, LONGINT p, LONGINT l, LONGINT *n); +export INTEGER Platform_ReadBuf (LONGINT h, SYSTEM_BYTE *b, LONGINT b__len, LONGINT *n); +export INTEGER Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); +export BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); +export BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); +export INTEGER Platform_Seek (LONGINT h, LONGINT offset, INTEGER whence); +export void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); +export void Platform_SetHalt (Platform_HaltProcedure p); +export void Platform_SetInterruptHandler (Platform_SignalHandler handler); +export void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Platform_FileIdentity source); +export void Platform_SetQuitHandler (Platform_SignalHandler handler); +export INTEGER Platform_Size (LONGINT h, LONGINT *l); +export INTEGER Platform_Sync (LONGINT h); +export INTEGER Platform_System (CHAR *cmd, LONGINT cmd__len); +static void Platform_TestLittleEndian (void); +export LONGINT Platform_Time (void); +export BOOLEAN Platform_TimedOut (INTEGER e); +export BOOLEAN Platform_TooManyFiles (INTEGER e); +export INTEGER Platform_Truncate (LONGINT h, LONGINT l); +export INTEGER Platform_Unlink (CHAR *n, LONGINT n__len); +export INTEGER Platform_Write (LONGINT h, LONGINT p, LONGINT l); +static void Platform_YMDHMStoClock (LONGINT ye, LONGINT mo, LONGINT da, LONGINT ho, LONGINT mi, LONGINT se, LONGINT *t, LONGINT *d); +static void Platform_errch (CHAR c); +static void Platform_errint (LONGINT l); +static void Platform_errln (void); +static void Platform_errposint (LONGINT l); +export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#define Platform_EACCES() EACCES +#define Platform_EAGAIN() EAGAIN +#define Platform_ECONNABORTED() ECONNABORTED +#define Platform_ECONNREFUSED() ECONNREFUSED +#define Platform_EHOSTUNREACH() EHOSTUNREACH +#define Platform_EMFILE() EMFILE +#define Platform_ENETUNREACH() ENETUNREACH +#define Platform_ENFILE() ENFILE +#define Platform_ENOENT() ENOENT +#define Platform_EROFS() EROFS +#define Platform_ETIMEDOUT() ETIMEDOUT +#define Platform_EXDEV() EXDEV +extern void Heap_InitHeap(); +#define Platform_HeapInitHeap() Heap_InitHeap() +#define Platform_allocate(size) (LONGINT)(uintptr_t)((void*)malloc((size_t)size)) +#define Platform_chdir(n, n__len) chdir((char*)n) +#define Platform_closefile(fd) close(fd) +#define Platform_err() errno +#define Platform_errc(c) write(1, &c, 1) +#define Platform_errstring(s, s__len) write(1, s, s__len-1) +#define Platform_exit(code) exit(code) +#define Platform_free(address) free((void*)(uintptr_t)address) +#define Platform_fstat(fd) fstat(fd, &s) +#define Platform_fsync(fd) fsync(fd) +#define Platform_ftruncate(fd, l) ftruncate(fd, l) +#define Platform_getcwd(cwd, cwd__len) getcwd((char*)cwd, cwd__len) +#define Platform_getenv(var, var__len) (Platform_EnvPtr)getenv((char*)var) +#define Platform_getpid() (INTEGER)getpid() +#define Platform_gettimeval() struct timeval tv; gettimeofday(&tv,0) +#define Platform_lseek(fd, o, w) lseek(fd, o, w) +#define Platform_nanosleep(s, ns) struct timespec req, rem; req.tv_sec = s; req.tv_nsec = ns; nanosleep(&req, &rem) +#define Platform_opennew(n, n__len) open((char*)n, O_CREAT | O_TRUNC | O_RDWR, 0664) +#define Platform_openro(n, n__len) open((char*)n, O_RDONLY) +#define Platform_openrw(n, n__len) open((char*)n, O_RDWR) +#define Platform_readfile(fd, p, l) read(fd, (void*)(uintptr_t)(p), l) +#define Platform_rename(o, o__len, n, n__len) rename((char*)o, (char*)n) +#define Platform_sectotm(s) struct tm *time = localtime((time_t*)&s) +#define Platform_seekcur() SEEK_CUR +#define Platform_seekend() SEEK_END +#define Platform_seekset() SEEK_SET +#define Platform_sethandler(s, h) SystemSetHandler(s, (uintptr_t)h) +#define Platform_stat(n, n__len) stat((char*)n, &s) +#define Platform_statdev() (LONGINT)s.st_dev +#define Platform_statino() (LONGINT)s.st_ino +#define Platform_statmtime() (LONGINT)s.st_mtime +#define Platform_statsize() (LONGINT)s.st_size +#define Platform_structstats() struct stat s +#define Platform_system(str, str__len) system((char*)str) +#define Platform_tmhour() (LONGINT)time->tm_hour +#define Platform_tmmday() (LONGINT)time->tm_mday +#define Platform_tmmin() (LONGINT)time->tm_min +#define Platform_tmmon() (LONGINT)time->tm_mon +#define Platform_tmsec() (LONGINT)time->tm_sec +#define Platform_tmyear() (LONGINT)time->tm_year +#define Platform_tvsec() tv.tv_sec +#define Platform_tvusec() tv.tv_usec +#define Platform_unlink(n, n__len) unlink((char*)n) +#define Platform_writefile(fd, p, l) write(fd, (void*)(uintptr_t)(p), l) + +BOOLEAN Platform_TooManyFiles (INTEGER e) +{ + BOOLEAN _o_result; + _o_result = e == Platform_EMFILE() || e == Platform_ENFILE(); + return _o_result; +} + +BOOLEAN Platform_NoSuchDirectory (INTEGER e) +{ + BOOLEAN _o_result; + _o_result = e == Platform_ENOENT(); + return _o_result; +} + +BOOLEAN Platform_DifferentFilesystems (INTEGER e) +{ + BOOLEAN _o_result; + _o_result = e == Platform_EXDEV(); + return _o_result; +} + +BOOLEAN Platform_Inaccessible (INTEGER e) +{ + BOOLEAN _o_result; + _o_result = (e == Platform_EACCES() || e == Platform_EROFS()) || e == Platform_EAGAIN(); + return _o_result; +} + +BOOLEAN Platform_Absent (INTEGER e) +{ + BOOLEAN _o_result; + _o_result = e == Platform_ENOENT(); + return _o_result; +} + +BOOLEAN Platform_TimedOut (INTEGER e) +{ + BOOLEAN _o_result; + _o_result = e == Platform_ETIMEDOUT(); + return _o_result; +} + +BOOLEAN Platform_ConnectionFailed (INTEGER e) +{ + BOOLEAN _o_result; + _o_result = ((e == Platform_ECONNREFUSED() || e == Platform_ECONNABORTED()) || e == Platform_ENETUNREACH()) || e == Platform_EHOSTUNREACH(); + return _o_result; +} + +LONGINT Platform_OSAllocate (LONGINT size) +{ + LONGINT _o_result; + _o_result = Platform_allocate(size); + return _o_result; +} + +void Platform_OSFree (LONGINT address) +{ + Platform_free(address); +} + +void Platform_Init (INTEGER argc, LONGINT argvadr) +{ + Platform_ArgVecPtr av = NIL; + Platform_MainStackFrame = argvadr; + Platform_ArgCount = argc; + av = (Platform_ArgVecPtr)(uintptr_t)argvadr; + Platform_ArgVector = (*av)[0]; + Platform_HaltCode = -128; + Platform_HeapInitHeap(); +} + +BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len) +{ + BOOLEAN _o_result; + Platform_EnvPtr p = NIL; + __DUP(var, var__len, CHAR); + p = Platform_getenv(var, var__len); + if (p != NIL) { + __COPY(*p, val, val__len); + } + _o_result = p != NIL; + __DEL(var); + return _o_result; +} + +void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len) +{ + __DUP(var, var__len, CHAR); + if (!Platform_getEnv(var, var__len, (void*)val, val__len)) { + val[0] = 0x00; + } + __DEL(var); +} + +void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len) +{ + Platform_ArgVec av = NIL; + if (n < Platform_ArgCount) { + av = (Platform_ArgVec)(uintptr_t)Platform_ArgVector; + __COPY(*(*av)[__X(n, ((LONGINT)(1024)))], val, val__len); + } +} + +void Platform_GetIntArg (INTEGER n, LONGINT *val) +{ + CHAR s[64]; + LONGINT k, d, i; + s[0] = 0x00; + Platform_GetArg(n, (void*)s, ((LONGINT)(64))); + i = 0; + if (s[0] == '-') { + i = 1; + } + k = 0; + d = (int)s[__X(i, ((LONGINT)(64)))] - 48; + while ((d >= 0 && d <= 9)) { + k = k * 10 + d; + i += 1; + d = (int)s[__X(i, ((LONGINT)(64)))] - 48; + } + if (s[0] == '-') { + k = -k; + i -= 1; + } + if (i > 0) { + *val = k; + } +} + +INTEGER Platform_ArgPos (CHAR *s, LONGINT s__len) +{ + INTEGER _o_result; + INTEGER i; + CHAR arg[256]; + __DUP(s, s__len, CHAR); + i = 0; + Platform_GetArg(i, (void*)arg, ((LONGINT)(256))); + while ((i < Platform_ArgCount && __STRCMP(s, arg) != 0)) { + i += 1; + Platform_GetArg(i, (void*)arg, ((LONGINT)(256))); + } + _o_result = i; + __DEL(s); + return _o_result; +} + +void Platform_SetInterruptHandler (Platform_SignalHandler handler) +{ + Platform_sethandler(2, handler); +} + +void Platform_SetQuitHandler (Platform_SignalHandler handler) +{ + Platform_sethandler(3, handler); +} + +void Platform_SetBadInstructionHandler (Platform_SignalHandler handler) +{ + Platform_sethandler(4, handler); +} + +static void Platform_YMDHMStoClock (LONGINT ye, LONGINT mo, LONGINT da, LONGINT ho, LONGINT mi, LONGINT se, LONGINT *t, LONGINT *d) +{ + *d = (__ASHL(__MOD(ye, 100), 9) + __ASHL(mo + 1, 5)) + da; + *t = (__ASHL(ho, 12) + __ASHL(mi, 6)) + se; +} + +void Platform_GetClock (LONGINT *t, LONGINT *d) +{ + Platform_gettimeval(); + Platform_sectotm(Platform_tvsec()); + Platform_YMDHMStoClock(Platform_tmyear(), Platform_tmmon(), Platform_tmmday(), Platform_tmhour(), Platform_tmmin(), Platform_tmsec(), &*t, &*d); +} + +void Platform_GetTimeOfDay (LONGINT *sec, LONGINT *usec) +{ + Platform_gettimeval(); + *sec = Platform_tvsec(); + *usec = Platform_tvusec(); +} + +LONGINT Platform_Time (void) +{ + LONGINT _o_result; + LONGINT ms; + Platform_gettimeval(); + ms = __DIVF(Platform_tvusec(), 1000) + Platform_tvsec() * 1000; + _o_result = __MOD(ms - Platform_TimeStart, 2147483647); + return _o_result; +} + +void Platform_Delay (LONGINT ms) +{ + LONGINT s, ns; + s = __DIV(ms, 1000); + ns = __MOD(ms, 1000) * 1000000; + Platform_nanosleep(s, ns); +} + +INTEGER Platform_System (CHAR *cmd, LONGINT cmd__len) +{ + INTEGER _o_result; + __DUP(cmd, cmd__len, CHAR); + _o_result = Platform_system(cmd, cmd__len); + __DEL(cmd); + return _o_result; +} + +INTEGER Platform_Error (void) +{ + INTEGER _o_result; + _o_result = Platform_err(); + return _o_result; +} + +INTEGER Platform_OldRO (CHAR *n, LONGINT n__len, LONGINT *h) +{ + INTEGER _o_result; + INTEGER fd; + fd = Platform_openro(n, n__len); + if (fd < 0) { + _o_result = Platform_err(); + return _o_result; + } else { + *h = fd; + _o_result = 0; + return _o_result; + } + __RETCHK; +} + +INTEGER Platform_OldRW (CHAR *n, LONGINT n__len, LONGINT *h) +{ + INTEGER _o_result; + INTEGER fd; + fd = Platform_openrw(n, n__len); + if (fd < 0) { + _o_result = Platform_err(); + return _o_result; + } else { + *h = fd; + _o_result = 0; + return _o_result; + } + __RETCHK; +} + +INTEGER Platform_New (CHAR *n, LONGINT n__len, LONGINT *h) +{ + INTEGER _o_result; + INTEGER fd; + fd = Platform_opennew(n, n__len); + if (fd < 0) { + _o_result = Platform_err(); + return _o_result; + } else { + *h = fd; + _o_result = 0; + return _o_result; + } + __RETCHK; +} + +INTEGER Platform_Close (LONGINT h) +{ + INTEGER _o_result; + if (Platform_closefile(h) < 0) { + _o_result = Platform_err(); + return _o_result; + } else { + _o_result = 0; + return _o_result; + } + __RETCHK; +} + +INTEGER Platform_Identify (LONGINT h, Platform_FileIdentity *identity, LONGINT *identity__typ) +{ + INTEGER _o_result; + Platform_structstats(); + if (Platform_fstat(h) < 0) { + _o_result = Platform_err(); + return _o_result; + } + (*identity).volume = Platform_statdev(); + (*identity).index = Platform_statino(); + (*identity).mtime = Platform_statmtime(); + _o_result = 0; + return _o_result; +} + +INTEGER Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ) +{ + INTEGER _o_result; + __DUP(n, n__len, CHAR); + Platform_structstats(); + if (Platform_stat(n, n__len) < 0) { + _o_result = Platform_err(); + __DEL(n); + return _o_result; + } + (*identity).volume = Platform_statdev(); + (*identity).index = Platform_statino(); + (*identity).mtime = Platform_statmtime(); + _o_result = 0; + __DEL(n); + return _o_result; +} + +BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2) +{ + BOOLEAN _o_result; + _o_result = (i1.index == i2.index && i1.volume == i2.volume); + return _o_result; +} + +BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2) +{ + BOOLEAN _o_result; + _o_result = i1.mtime == i2.mtime; + return _o_result; +} + +void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Platform_FileIdentity source) +{ + (*target).mtime = source.mtime; +} + +void Platform_MTimeAsClock (Platform_FileIdentity i, LONGINT *t, LONGINT *d) +{ + Platform_sectotm(i.mtime); + Platform_YMDHMStoClock(Platform_tmyear(), Platform_tmmon(), Platform_tmmday(), Platform_tmhour(), Platform_tmmin(), Platform_tmsec(), &*t, &*d); +} + +INTEGER Platform_Size (LONGINT h, LONGINT *l) +{ + INTEGER _o_result; + Platform_structstats(); + if (Platform_fstat(h) < 0) { + _o_result = Platform_err(); + return _o_result; + } + *l = Platform_statsize(); + _o_result = 0; + return _o_result; +} + +INTEGER Platform_Read (LONGINT h, LONGINT p, LONGINT l, LONGINT *n) +{ + INTEGER _o_result; + *n = Platform_readfile(h, p, l); + if (*n < 0) { + *n = 0; + _o_result = Platform_err(); + return _o_result; + } else { + _o_result = 0; + return _o_result; + } + __RETCHK; +} + +INTEGER Platform_ReadBuf (LONGINT h, SYSTEM_BYTE *b, LONGINT b__len, LONGINT *n) +{ + INTEGER _o_result; + *n = Platform_readfile(h, (LONGINT)(uintptr_t)b, b__len); + if (*n < 0) { + *n = 0; + _o_result = Platform_err(); + return _o_result; + } else { + _o_result = 0; + return _o_result; + } + __RETCHK; +} + +INTEGER Platform_Write (LONGINT h, LONGINT p, LONGINT l) +{ + INTEGER _o_result; + LONGINT written; + written = Platform_writefile(h, p, l); + if (written < 0) { + _o_result = Platform_err(); + return _o_result; + } else { + _o_result = 0; + return _o_result; + } + __RETCHK; +} + +INTEGER Platform_Sync (LONGINT h) +{ + INTEGER _o_result; + if (Platform_fsync(h) < 0) { + _o_result = Platform_err(); + return _o_result; + } else { + _o_result = 0; + return _o_result; + } + __RETCHK; +} + +INTEGER Platform_Seek (LONGINT h, LONGINT offset, INTEGER whence) +{ + INTEGER _o_result; + if (Platform_lseek(h, offset, whence) < 0) { + _o_result = Platform_err(); + return _o_result; + } else { + _o_result = 0; + return _o_result; + } + __RETCHK; +} + +INTEGER Platform_Truncate (LONGINT h, LONGINT l) +{ + INTEGER _o_result; + if (Platform_ftruncate(h, l) < 0) { + _o_result = Platform_err(); + return _o_result; + } else { + _o_result = 0; + return _o_result; + } + __RETCHK; +} + +INTEGER Platform_Unlink (CHAR *n, LONGINT n__len) +{ + INTEGER _o_result; + if (Platform_unlink(n, n__len) < 0) { + _o_result = Platform_err(); + return _o_result; + } else { + _o_result = 0; + return _o_result; + } + __RETCHK; +} + +INTEGER Platform_Chdir (CHAR *n, LONGINT n__len) +{ + INTEGER _o_result; + INTEGER r; + r = Platform_chdir(n, n__len); + Platform_getcwd((void*)Platform_CWD, ((LONGINT)(256))); + if (r < 0) { + _o_result = Platform_err(); + return _o_result; + } else { + _o_result = 0; + return _o_result; + } + __RETCHK; +} + +INTEGER Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) +{ + INTEGER _o_result; + if (Platform_rename(o, o__len, n, n__len) < 0) { + _o_result = Platform_err(); + return _o_result; + } else { + _o_result = 0; + return _o_result; + } + __RETCHK; +} + +void Platform_Exit (INTEGER code) +{ + Platform_exit(code); +} + +static void Platform_errch (CHAR c) +{ + Platform_errc(c); +} + +static void Platform_errln (void) +{ + Platform_errch(0x0d); + Platform_errch(0x0a); +} + +static void Platform_errposint (LONGINT l) +{ + if (l > 10) { + Platform_errposint(__DIV(l, 10)); + } + Platform_errch((CHAR)(48 + __MOD(l, 10))); +} + +static void Platform_errint (LONGINT l) +{ + if (l < 0) { + Platform_errch('-'); + l = -l; + } + Platform_errposint(l); +} + +static void Platform_DisplayHaltCode (LONGINT code) +{ + switch (code) { + case -1: + Platform_errstring((CHAR*)"Assertion failure.", (LONGINT)19); + break; + case -2: + Platform_errstring((CHAR*)"Index out of range.", (LONGINT)20); + break; + case -3: + Platform_errstring((CHAR*)"Reached end of function without reaching RETURN.", (LONGINT)49); + break; + case -4: + Platform_errstring((CHAR*)"CASE statement: no matching label and no ELSE.", (LONGINT)47); + break; + case -5: + Platform_errstring((CHAR*)"Type guard failed.", (LONGINT)19); + break; + case -6: + Platform_errstring((CHAR*)"Implicit type guard in record assignment failed.", (LONGINT)49); + break; + case -7: + Platform_errstring((CHAR*)"Invalid case in WITH statement.", (LONGINT)32); + break; + case -8: + Platform_errstring((CHAR*)"Value out of range.", (LONGINT)20); + break; + case -9: + Platform_errstring((CHAR*)"Heap interrupted while locked, but lockdepth = 0 at unlock.", (LONGINT)60); + break; + case -10: + Platform_errstring((CHAR*)"NIL access.", (LONGINT)12); + break; + case -11: + Platform_errstring((CHAR*)"Alignment error.", (LONGINT)17); + break; + case -12: + Platform_errstring((CHAR*)"Divide by zero.", (LONGINT)16); + break; + case -13: + Platform_errstring((CHAR*)"Arithmetic overflow/underflow.", (LONGINT)31); + break; + case -14: + Platform_errstring((CHAR*)"Invalid function argument.", (LONGINT)27); + break; + case -15: + Platform_errstring((CHAR*)"Internal error, e.g. Type descriptor size mismatch.", (LONGINT)52); + break; + case -20: + Platform_errstring((CHAR*)"Too many, or negative number of, elements in dynamic array.", (LONGINT)60); + break; + default: + break; + } +} + +void Platform_Halt (LONGINT code) +{ + INTEGER e; + Platform_HaltCode = code; + if (Platform_HaltHandler != NIL) { + (*Platform_HaltHandler)(code); + } + Platform_errstring((CHAR*)"Terminated by Halt(", (LONGINT)20); + Platform_errint(code); + Platform_errstring((CHAR*)"). ", (LONGINT)4); + if (code < 0) { + Platform_DisplayHaltCode(code); + } + Platform_errln(); + Platform_exit(__VAL(INTEGER, code)); +} + +void Platform_AssertFail (LONGINT code) +{ + INTEGER e; + Platform_errstring((CHAR*)"Assertion failure.", (LONGINT)19); + if (code != 0) { + Platform_errstring((CHAR*)" ASSERT code ", (LONGINT)14); + Platform_errint(code); + Platform_errstring((CHAR*)".", (LONGINT)2); + } + Platform_errln(); + Platform_exit(__VAL(INTEGER, code)); +} + +void Platform_SetHalt (Platform_HaltProcedure p) +{ + Platform_HaltHandler = p; +} + +static void Platform_TestLittleEndian (void) +{ + INTEGER i; + i = 1; + __GET((LONGINT)(uintptr_t)&i, Platform_LittleEndian, BOOLEAN); +} + +__TDESC(Platform_FileIdentity, 1, 0) = {__TDFLDS("FileIdentity", 12), {-4}}; + +export void *Platform__init(void) +{ + __DEFMOD; + __REGMOD("Platform", 0); + __INITYP(Platform_FileIdentity, Platform_FileIdentity, 0); +/* BEGIN */ + Platform_TestLittleEndian(); + Platform_HaltCode = -128; + Platform_HaltHandler = NIL; + Platform_TimeStart = Platform_Time(); + Platform_CWD[0] = 0x00; + Platform_getcwd((void*)Platform_CWD, ((LONGINT)(256))); + Platform_PID = Platform_getpid(); + Platform_SeekSet = Platform_seekset(); + Platform_SeekCur = Platform_seekcur(); + Platform_SeekEnd = Platform_seekend(); + Platform_nl[0] = 0x0a; + Platform_nl[1] = 0x00; + __ENDMOD; +} diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h new file mode 100644 index 00000000..8b47d1c9 --- /dev/null +++ b/bootstrap/unix-44/Platform.h @@ -0,0 +1,82 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ + +#ifndef Platform__h +#define Platform__h + +#include "SYSTEM.h" + +typedef + struct Platform_FileIdentity { + LONGINT volume, index, mtime; + } Platform_FileIdentity; + +typedef + void (*Platform_HaltProcedure)(LONGINT); + +typedef + void (*Platform_SignalHandler)(INTEGER); + + +import BOOLEAN Platform_LittleEndian; +import LONGINT Platform_MainStackFrame, Platform_HaltCode; +import INTEGER Platform_PID; +import CHAR Platform_CWD[256]; +import INTEGER Platform_ArgCount; +import LONGINT Platform_ArgVector; +import INTEGER Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; +import CHAR Platform_nl[3]; + +import LONGINT *Platform_FileIdentity__typ; + +import BOOLEAN Platform_Absent (INTEGER e); +import INTEGER Platform_ArgPos (CHAR *s, LONGINT s__len); +import void Platform_AssertFail (LONGINT code); +import INTEGER Platform_Chdir (CHAR *n, LONGINT n__len); +import INTEGER Platform_Close (LONGINT h); +import BOOLEAN Platform_ConnectionFailed (INTEGER e); +import void Platform_Delay (LONGINT ms); +import BOOLEAN Platform_DifferentFilesystems (INTEGER e); +import INTEGER Platform_Error (void); +import void Platform_Exit (INTEGER code); +import void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len); +import void Platform_GetClock (LONGINT *t, LONGINT *d); +import void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); +import void Platform_GetIntArg (INTEGER n, LONGINT *val); +import void Platform_GetTimeOfDay (LONGINT *sec, LONGINT *usec); +import void Platform_Halt (LONGINT code); +import INTEGER Platform_Identify (LONGINT h, Platform_FileIdentity *identity, LONGINT *identity__typ); +import INTEGER Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); +import BOOLEAN Platform_Inaccessible (INTEGER e); +import void Platform_Init (INTEGER argc, LONGINT argvadr); +import void Platform_MTimeAsClock (Platform_FileIdentity i, LONGINT *t, LONGINT *d); +import INTEGER Platform_New (CHAR *n, LONGINT n__len, LONGINT *h); +import BOOLEAN Platform_NoSuchDirectory (INTEGER e); +import LONGINT Platform_OSAllocate (LONGINT size); +import void Platform_OSFree (LONGINT address); +import INTEGER Platform_OldRO (CHAR *n, LONGINT n__len, LONGINT *h); +import INTEGER Platform_OldRW (CHAR *n, LONGINT n__len, LONGINT *h); +import INTEGER Platform_Read (LONGINT h, LONGINT p, LONGINT l, LONGINT *n); +import INTEGER Platform_ReadBuf (LONGINT h, SYSTEM_BYTE *b, LONGINT b__len, LONGINT *n); +import INTEGER Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); +import BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); +import BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); +import INTEGER Platform_Seek (LONGINT h, LONGINT offset, INTEGER whence); +import void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); +import void Platform_SetHalt (Platform_HaltProcedure p); +import void Platform_SetInterruptHandler (Platform_SignalHandler handler); +import void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Platform_FileIdentity source); +import void Platform_SetQuitHandler (Platform_SignalHandler handler); +import INTEGER Platform_Size (LONGINT h, LONGINT *l); +import INTEGER Platform_Sync (LONGINT h); +import INTEGER Platform_System (CHAR *cmd, LONGINT cmd__len); +import LONGINT Platform_Time (void); +import BOOLEAN Platform_TimedOut (INTEGER e); +import BOOLEAN Platform_TooManyFiles (INTEGER e); +import INTEGER Platform_Truncate (LONGINT h, LONGINT l); +import INTEGER Platform_Unlink (CHAR *n, LONGINT n__len); +import INTEGER Platform_Write (LONGINT h, LONGINT p, LONGINT l); +import BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); +import void *Platform__init(void); + + +#endif diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c new file mode 100644 index 00000000..65dad750 --- /dev/null +++ b/bootstrap/unix-44/Reals.c @@ -0,0 +1,155 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +#include "SYSTEM.h" + + + + +export void Reals_Convert (REAL x, INTEGER n, CHAR *d, LONGINT d__len); +export void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len); +export void Reals_ConvertHL (LONGREAL y, CHAR *d, LONGINT d__len); +export void Reals_ConvertL (LONGREAL x, INTEGER n, CHAR *d, LONGINT d__len); +export INTEGER Reals_Expo (REAL x); +export INTEGER Reals_ExpoL (LONGREAL x); +export REAL Reals_Ten (INTEGER e); +export LONGREAL Reals_TenL (INTEGER e); +static CHAR Reals_ToHex (INTEGER i); + + +REAL Reals_Ten (INTEGER e) +{ + REAL _o_result; + LONGREAL r, power; + r = (LONGREAL)1; + power = (LONGREAL)10; + while (e > 0) { + if (__ODD(e)) { + r = r * power; + } + power = power * power; + e = __ASHR(e, 1); + } + _o_result = r; + return _o_result; +} + +LONGREAL Reals_TenL (INTEGER e) +{ + LONGREAL _o_result; + LONGREAL r, power; + r = (LONGREAL)1; + power = (LONGREAL)10; + for (;;) { + if (__ODD(e)) { + r = r * power; + } + e = __ASHR(e, 1); + if (e <= 0) { + _o_result = r; + return _o_result; + } + power = power * power; + } + __RETCHK; +} + +INTEGER Reals_Expo (REAL x) +{ + INTEGER _o_result; + _o_result = (int)__MASK(__ASHR((LONGINT)(__VAL(INTEGER, x)), 23), -256); + return _o_result; +} + +INTEGER Reals_ExpoL (LONGREAL x) +{ + INTEGER _o_result; + INTEGER i; + LONGINT l; + __GET((LONGINT)(uintptr_t)&x + 4, l, LONGINT); + _o_result = (int)__MASK(__ASHR(l, 20), -2048); + return _o_result; +} + +void Reals_ConvertL (LONGREAL x, INTEGER n, CHAR *d, LONGINT d__len) +{ + LONGINT i, j, k; + if (x < (LONGREAL)0) { + x = -x; + } + k = 0; + if (n > 9) { + i = __ENTIER(x / (LONGREAL)(LONGREAL)1000000000); + j = __ENTIER(x - i * (LONGREAL)1000000000); + if (j < 0) { + j = 0; + } + while (k < 9) { + d[__X(k, d__len)] = (CHAR)(__MOD(j, 10) + 48); + j = __DIV(j, 10); + k += 1; + } + } else { + i = __ENTIER(x); + } + while (k < (LONGINT)n) { + d[__X(k, d__len)] = (CHAR)(__MOD(i, 10) + 48); + i = __DIV(i, 10); + k += 1; + } +} + +void Reals_Convert (REAL x, INTEGER n, CHAR *d, LONGINT d__len) +{ + Reals_ConvertL(x, n, (void*)d, d__len); +} + +static CHAR Reals_ToHex (INTEGER i) +{ + CHAR _o_result; + if (i < 10) { + _o_result = (CHAR)(i + 48); + return _o_result; + } else { + _o_result = (CHAR)(i + 55); + return _o_result; + } + __RETCHK; +} + +typedef + CHAR (*pc4__3)[4]; + +void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len) +{ + pc4__3 p = NIL; + INTEGER i; + p = (pc4__3)(uintptr_t)((LONGINT)(uintptr_t)&y); + i = 0; + while (i < 4) { + d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((int)(*p)[__X(i, ((LONGINT)(4)))], 4)); + d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((int)(*p)[__X(i, ((LONGINT)(4)))], -16)); + } +} + +typedef + CHAR (*pc8__5)[8]; + +void Reals_ConvertHL (LONGREAL y, CHAR *d, LONGINT d__len) +{ + pc8__5 p = NIL; + INTEGER i; + p = (pc8__5)(uintptr_t)((LONGINT)(uintptr_t)&y); + i = 0; + while (i < 8) { + d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((int)(*p)[__X(i, ((LONGINT)(8)))], 4)); + d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((int)(*p)[__X(i, ((LONGINT)(8)))], -16)); + } +} + + +export void *Reals__init(void) +{ + __DEFMOD; + __REGMOD("Reals", 0); +/* BEGIN */ + __ENDMOD; +} diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h new file mode 100644 index 00000000..166e977b --- /dev/null +++ b/bootstrap/unix-44/Reals.h @@ -0,0 +1,22 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ + +#ifndef Reals__h +#define Reals__h + +#include "SYSTEM.h" + + + + +import void Reals_Convert (REAL x, INTEGER n, CHAR *d, LONGINT d__len); +import void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len); +import void Reals_ConvertHL (LONGREAL y, CHAR *d, LONGINT d__len); +import void Reals_ConvertL (LONGREAL x, INTEGER n, CHAR *d, LONGINT d__len); +import INTEGER Reals_Expo (REAL x); +import INTEGER Reals_ExpoL (LONGREAL x); +import REAL Reals_Ten (INTEGER e); +import LONGREAL Reals_TenL (INTEGER e); +import void *Reals__init(void); + + +#endif diff --git a/bootstrap/unix-44/SYSTEM.c b/bootstrap/unix-44/SYSTEM.c new file mode 100644 index 00000000..0fcc5ee2 --- /dev/null +++ b/bootstrap/unix-44/SYSTEM.c @@ -0,0 +1,207 @@ +/* +* The body prefix file of the voc(jet backend) runtime system, Version 1.0 +* +* Copyright (c) Software Templ, 1994, 1995 +* +* Module SYSTEM is subject to change any time without prior notification. +* Software Templ disclaims all warranties with regard to module SYSTEM, +* in particular shall Software Templ not be liable for any damage resulting +* from inappropriate use or modification of module SYSTEM. +* +* Version 1.1 jt, 24.11.95 fixes for correct pointer arithmetic on Cray computers +* jt 31.1.2007 ANSI prototypes for malloc and exit in order to avoid cc warnings +* +*/ + +#include "SYSTEM.h" +#include "stdarg.h" +#include + + +LONGINT SYSTEM_XCHK(LONGINT i, LONGINT ub) {return __X(i, ub);} +LONGINT SYSTEM_RCHK(LONGINT i, LONGINT ub) {return __R(i, ub);} +LONGINT SYSTEM_ASH (LONGINT i, LONGINT n) {return __ASH(i, n);} +LONGINT SYSTEM_ABS (LONGINT i) {return __ABS(i);} +double SYSTEM_ABSD(double i) {return __ABS(i);} + +void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0) +{ + t -= __TPROC0OFF; + t0 -= __TPROC0OFF; + while (*t0 != __EOM) {*t = *t0; t--; t0--;} +} + + +void SYSTEM_ENUMP(void *adr, LONGINT n, void (*P)()) +{ + while (n > 0) { + P((LONGINT)(uintptr_t)(*((void**)(adr)))); + adr = ((void**)adr) + 1; + n--; + } +} + +void SYSTEM_ENUMR(void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()) +{ + LONGINT *t, off; + typ++; + while (n > 0) { + t = typ; + off = *t; + while (off >= 0) {P(*(LONGINT*)((char*)adr+off)); t++; off = *t;} + adr = ((char*)adr) + size; + n--; + } +} + +LONGINT SYSTEM_DIV(unsigned LONGINT x, unsigned LONGINT y) +{ if ((LONGINT) x >= 0) return (x / y); + else return -((y - 1 - x) / y); +} + +LONGINT SYSTEM_MOD(unsigned LONGINT x, unsigned LONGINT y) +{ unsigned LONGINT m; + if ((LONGINT) x >= 0) return (x % y); + else { m = (-x) % y; + if (m != 0) return (y - m); else return 0; + } +} + +LONGINT SYSTEM_ENTIER(double x) +{ + LONGINT y; + if (x >= 0) + return (LONGINT)x; + else { + y = (LONGINT)x; + if (y <= x) return y; else return y - 1; + } +} + +extern void Heap_Lock(); +extern void Heap_Unlock(); + +SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, int nofdyn, ...) +{ + LONGINT nofelems, size, dataoff, n, nptr, *x, *p, nofptrs, i, *ptab, off; + va_list ap; + va_start(ap, nofdyn); + nofelems = 1; + while (nofdim > 0) { + nofelems = nofelems * va_arg(ap, LONGINT); nofdim--; + if (nofelems <= 0) __HALT(-20); + } + va_end(ap); + dataoff = nofdyn * sizeof(LONGINT); + if (elemalgn > sizeof(LONGINT)) { + n = dataoff % elemalgn; + if (n != 0) dataoff += elemalgn - n; + } + size = dataoff + nofelems * elemsz; + Heap_Lock(); + if (typ == NIL) { + /* element typ does not contain pointers */ + x = Heap_NEWBLK(size); + } + else if (typ == (LONGINT*)POINTER__typ) { + /* element type is a pointer */ + x = Heap_NEWBLK(size + nofelems * sizeof(LONGINT)); + p = (LONGINT*)(uintptr_t)x[-1]; + p[-nofelems] = *p; /* build new type desc in situ: 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ + p -= nofelems - 1; n = 1; /* n =1 for skipping the size field */ + while (n <= nofelems) {*p = n*sizeof(LONGINT); p++; n++;} + *p = - (nofelems + 1) * sizeof(LONGINT); /* sentinel */ + x[-1] -= nofelems * sizeof(LONGINT); + } + else { + /* element type is a record that contains pointers */ + ptab = typ + 1; nofptrs = 0; + while (ptab[nofptrs] >= 0) {nofptrs++;} /* number of pointers per element */ + nptr = nofelems * nofptrs; /* total number of pointers */ + x = Heap_NEWBLK(size + nptr * sizeof(LONGINT)); + p = (LONGINT*)(uintptr_t)x[- 1]; + p[-nptr] = *p; /* build new type desc in situ; 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ + p -= nptr - 1; n = 0; off = dataoff; + while (n < nofelems) {i = 0; + while (i < nofptrs) {*p = off + ptab[i]; p++; i++;} + off += elemsz; n++; + } + *p = - (nptr + 1) * sizeof(LONGINT); /* sentinel */ + x[-1] -= nptr * sizeof(LONGINT); + } + if (nofdyn != 0) { + /* setup len vector for index checks */ + va_start(ap, nofdyn); + p = x; + while (nofdyn > 0) {*p = va_arg(ap, LONGINT); p++, nofdyn--;} + va_end(ap); + } + Heap_Unlock(); + return x; +} + + + + +typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler + +#ifndef _WIN32 + + SystemSignalHandler handler[3] = {0}; + + // Provide signal handling for Unix based systems + void signalHandler(int s) { + if (s >= 2 && s <= 4) handler[s-2](s); + // (Ignore other signals) + } + + void SystemSetHandler(int s, uintptr_t h) { + if (s >= 2 && s <= 4) { + int needtosetsystemhandler = handler[s-2] == 0; + handler[s-2] = (SystemSignalHandler)h; + if (needtosetsystemhandler) {signal(s, signalHandler);} + } + } + +#else + + // Provides Windows callback handlers for signal-like scenarios + #include "WindowsWrapper.h" + + SystemSignalHandler SystemInterruptHandler = 0; + SystemSignalHandler SystemQuitHandler = 0; + BOOL ConsoleCtrlHandlerSet = FALSE; + + BOOL WINAPI SystemConsoleCtrlHandler(DWORD ctrlType) { + if ((ctrlType == CTRL_C_EVENT) || (ctrlType == CTRL_BREAK_EVENT)) { + if (SystemInterruptHandler) { + SystemInterruptHandler(2); // SIGINT + return TRUE; + } + } else { // Close, logoff or shutdown + if (SystemQuitHandler) { + SystemQuitHandler(3); // SIGQUIT + return TRUE; + } + } + return FALSE; + } + + void EnsureConsoleCtrlHandler() { + if (!ConsoleCtrlHandlerSet) { + SetConsoleCtrlHandler(SystemConsoleCtrlHandler, TRUE); + ConsoleCtrlHandlerSet = TRUE; + } + } + + void SystemSetInterruptHandler(uintptr_t h) { + EnsureConsoleCtrlHandler(); + SystemInterruptHandler = (SystemSignalHandler)h; + } + + void SystemSetQuitHandler(uintptr_t h) { + EnsureConsoleCtrlHandler(); + SystemQuitHandler = (SystemSignalHandler)h; + } + +#endif diff --git a/bootstrap/unix-44/SYSTEM.h b/bootstrap/unix-44/SYSTEM.h new file mode 100644 index 00000000..f9e2f930 --- /dev/null +++ b/bootstrap/unix-44/SYSTEM.h @@ -0,0 +1,275 @@ +#ifndef SYSTEM__h +#define SYSTEM__h + +#ifndef _WIN32 + + // Building for a Unix/Linux based system + #include // For memcpy ... + #include // For uintptr_t ... + +#else + + // Building for Windows platform with either mingw under cygwin, or the MS C compiler + #ifdef _WIN64 + typedef unsigned long long size_t; + typedef unsigned long long uintptr_t; + #else + typedef unsigned int size_t; + typedef unsigned int uintptr_t; + #endif /* _WIN64 */ + + typedef unsigned int uint32_t; + void * __cdecl memcpy(void * dest, const void * source, size_t size); + +#endif + + +// The compiler uses 'import' and 'export' which translate to 'extern' and +// nothing respectively. + +#define import extern +#define export + + + +// Known constants + +#define NIL ((void*)0) +#define __MAXEXT 16 +#define POINTER__typ ((LONGINT*)(1)) // not NIL and not a valid type + + +// Oberon types + +#define BOOLEAN char +#define SYSTEM_BYTE unsigned char +#define CHAR unsigned char +#define SHORTINT signed char +#define REAL float +#define LONGREAL double +#define SYSTEM_PTR void* + +// For 32 bit builds, the size of LONGINT depends on a make option: + +#if (__SIZEOF_POINTER__ == 8) || defined(LARGE) || defined(_WIN64) + #define INTEGER int // INTEGER is 32 bit. + #define LONGINT long long // LONGINT is 64 bit. (long long is always 64 bits, while long can be 32 bits e.g. under MSC/MingW) +#else + #define INTEGER short int // INTEGER is 16 bit. + #define LONGINT long // LONGINT is 32 bit. +#endif + +#define SET unsigned LONGINT + + +// OS Memory allocation interfaces are in PlatformXXX.Mod + +extern LONGINT Platform_OSAllocate (LONGINT size); +extern void Platform_OSFree (LONGINT addr); + + +// Run time system routines in SYSTEM.c + +extern LONGINT SYSTEM_XCHK (LONGINT i, LONGINT ub); +extern LONGINT SYSTEM_RCHK (LONGINT i, LONGINT ub); +extern LONGINT SYSTEM_ASH (LONGINT i, LONGINT n); +extern LONGINT SYSTEM_ABS (LONGINT i); +extern double SYSTEM_ABSD (double i); +extern void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0); +extern void SYSTEM_ENUMP (void *adr, LONGINT n, void (*P)()); +extern void SYSTEM_ENUMR (void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()); +extern LONGINT SYSTEM_DIV (unsigned LONGINT x, unsigned LONGINT y); +extern LONGINT SYSTEM_MOD (unsigned LONGINT x, unsigned LONGINT y); +extern LONGINT SYSTEM_ENTIER (double x); + + +// Signal handling in SYSTEM.c + +#ifndef _WIN32 + extern void SystemSetHandler(int s, uintptr_t h); +#else + extern void SystemSetInterruptHandler(uintptr_t h); + extern void SystemSetQuitHandler (uintptr_t h); +#endif + + + +// String comparison + +static int __str_cmp(CHAR *x, CHAR *y){ + LONGINT i = 0; + CHAR ch1, ch2; + do {ch1 = x[i]; ch2 = y[i]; i++; + if (!ch1) return -(int)ch2; + } while (ch1==ch2); + return (int)ch1 - (int)ch2; +} +#define __STRCMP(a,b) __str_cmp((CHAR*)(a), (CHAR*)(b)) + + + +// Inline string, record and array copy + +#define __COPY(s, d, n) {char*_a=(void*)s,*_b=(void*)d; LONGINT _i=0,_t=n-1; \ + while(_i<_t&&((_b[_i]=_a[_i])!=0)){_i++;};_b[_i]=0;} +#define __DUP(x, l, t) x=(void*)memcpy((void*)(uintptr_t)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) +#define __DUPARR(v, t) v=(void*)memcpy(v##__copy,v,sizeof(t)) +#define __DEL(x) Platform_OSFree((LONGINT)(uintptr_t)x) + + + + +/* SYSTEM ops */ + +#define __VAL(t, x) ((t)(x)) +#define __VALP(t, x) ((t)(uintptr_t)(x)) + +#define __GET(a, x, t) x= *(t*)(uintptr_t)(a) +#define __PUT(a, x, t) *(t*)(uintptr_t)(a)=x +#define __LSHL(x, n, t) ((t)((unsigned t)(x)<<(n))) +#define __LSHR(x, n, t) ((t)((unsigned t)(x)>>(n))) +#define __LSH(x, n, t) ((n)>=0? __LSHL(x, n, t): __LSHR(x, -(n), t)) +#define __ROTL(x, n, t) ((t)((unsigned t)(x)<<(n)|(unsigned t)(x)>>(8*sizeof(t)-(n)))) +#define __ROTR(x, n, t) ((t)((unsigned t)(x)>>(n)|(unsigned t)(x)<<(8*sizeof(t)-(n)))) +#define __LSHR(x, n, t) ((t)((unsigned t)(x)>>(n))) +#define __LSH(x, n, t) ((n)>=0? __LSHL(x, n, t): __LSHR(x, -(n), t)) +#define __ROTL(x, n, t) ((t)((unsigned t)(x)<<(n)|(unsigned t)(x)>>(8*sizeof(t)-(n)))) +#define __ROTR(x, n, t) ((t)((unsigned t)(x)>>(n)|(unsigned t)(x)<<(8*sizeof(t)-(n)))) +#define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) +#define __BIT(x, n) (*(unsigned LONGINT*)(x)>>(n)&1) +#define __MOVE(s, d, n) memcpy((char*)(uintptr_t)(d),(char*)(uintptr_t)(s),n) +#define __ASHL(x, n) ((LONGINT)(x)<<(n)) +#define __ASHR(x, n) ((LONGINT)(x)>>(n)) +#define __ASH(x, n) ((n)>=0?__ASHL(x,n):__ASHR(x,-(n))) +#define __ASHF(x, n) SYSTEM_ASH((LONGINT)(x), (LONGINT)(n)) +#define __SHORT(x, y) ((int)((unsigned LONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) +#define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) +#define __CHR(x) ((CHAR)__R(x, 256)) +#define __CHRF(x) ((CHAR)__RF(x, 256)) +#define __DIV(x, y) ((x)>=0?(x)/(y):-(((y)-1-(x))/(y))) +#define __DIVF(x, y) SYSTEM_DIV((LONGINT)(x),(LONGINT)(y)) +#define __MOD(x, y) ((x)>=0?(x)%(y):__MODF(x,y)) +#define __MODF(x, y) SYSTEM_MOD((LONGINT)(x),(LONGINT)(y)) +#define __ENTIER(x) SYSTEM_ENTIER(x) +#define __ABS(x) (((x)<0)?-(x):(x)) +#define __ABSF(x) SYSTEM_ABS((LONGINT)(x)) +#define __ABSFD(x) SYSTEM_ABSD((double)(x)) +#define __CAP(ch) ((CHAR)((ch)&0x5f)) +#define __ODD(x) ((x)&1) +#define __IN(x, s) (((s)>>(x))&1) +#define __SETOF(x) ((SET)1<<(x)) +#define __SETRNG(l, h) ((~(SET)0<<(l))&~(SET)0>>(8*sizeof(SET)-1-(h))) +#define __MASK(x, m) ((x)&~(m)) + + + +// Runtime checks + +#define __X(i, ub) (((unsigned LONGINT)(i)<(unsigned LONGINT)(ub))?i:(__HALT(-2),0)) +#define __XF(i, ub) SYSTEM_XCHK((LONGINT)(i), (LONGINT)(ub)) +#define __R(i, ub) (((unsigned LONGINT)(i)<(unsigned LONGINT)(ub))?i:(__HALT(-8),0)) +#define __RF(i, ub) SYSTEM_RCHK((LONGINT)(i),(LONGINT)(ub)) +#define __RETCHK __retchk: __HALT(-3); return 0; +#define __CASECHK __HALT(-4) +#define __WITHCHK __HALT(-7) + +#define __GUARDP(p, typ, level) ((typ*)(__ISP(p,typ,level)?p:(__HALT(-5),p))) +#define __GUARDR(r, typ, level) (*((typ*)(__IS(r##__typ,typ,level)?r:(__HALT(-5),r)))) +#define __GUARDA(p, typ, level) ((struct typ*)(__IS(__TYPEOF(p),typ,level)?p:(__HALT(-5),p))) +#define __GUARDEQR(p, dyntyp, typ) if(dyntyp!=typ##__typ) __HALT(-6);*(p) +#define __GUARDEQP(p, typ) if(__TYPEOF(p)!=typ##__typ)__HALT(-6);*(p) + + + +// Module entry/registration/exit + +extern void Heap_REGCMD(); +extern SYSTEM_PTR Heap_REGMOD(); +extern void Heap_REGTYP(); +extern void Heap_INCREF(); + +#define __DEFMOD static void *m; if (m!=0) {return m;} +#define __REGCMD(name, cmd) Heap_REGCMD(m, (CHAR*)name, cmd) +#define __REGMOD(name, enum) if (m==0) {m = Heap_REGMOD((CHAR*)name,enum);} +#define __ENDMOD return m +#define __MODULE_IMPORT(name) Heap_INCREF(name##__init()) + + + +// Main module initialisation, registration and finalisation + +extern void Platform_Init(INTEGER argc, LONGINT argv); +extern void *Platform_MainModule; +extern void Heap_FINALL(); + +#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (LONGINT)(uintptr_t)&argv); +#define __REGMAIN(name, enum) m = Heap_REGMOD((CHAR*)name,enum) +#define __FINI Heap_FINALL(); return 0 + + +// Assertions and Halts + +extern void Platform_Halt(LONGINT x); +extern void Platform_AssertFail(LONGINT x); + +#define __HALT(x) Platform_Halt(x) +#define __ASSERT(cond, x) if (!(cond)) Platform_AssertFail((LONGINT)(x)) + + +// Memory allocation + +extern SYSTEM_PTR Heap_NEWBLK (LONGINT size); +extern SYSTEM_PTR Heap_NEWREC (LONGINT tag); +extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); + +#define __SYSNEW(p, len) p = Heap_NEWBLK((LONGINT)(len)) +#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(uintptr_t)t##__typ) +#define __NEWARR SYSTEM_NEWARR + + + +/* Type handling */ + +#define __TDESC(t, m, n) \ + static struct t##__desc { \ + LONGINT tproc[m]; /* Proc for each ptr field */ \ + LONGINT tag; \ + LONGINT next; /* Module table type list points here */ \ + LONGINT level; \ + LONGINT module; \ + char name[24]; \ + LONGINT basep[__MAXEXT]; /* List of bases this extends */ \ + LONGINT reserved; \ + LONGINT blksz; /* xxx_typ points here */ \ + LONGINT ptr[n+1]; /* Offsets of ptrs up to -ve sentinel */ \ + } t##__desc + +#define __BASEOFF (__MAXEXT+1) // blksz as index to base. +#define __TPROC0OFF (__BASEOFF+24/sizeof(LONGINT)+5) // blksz as index to tproc IFF m=1. +#define __EOM 1 +#define __TDFLDS(name, size) {__EOM}, 1, 0, 0, 0, name, {0}, 0, size +#define __ENUMP(adr, n, P) SYSTEM_ENUMP(adr, (LONGINT)(n), P) +#define __ENUMR(adr, typ, size, n, P) SYSTEM_ENUMR(adr, typ, (LONGINT)(size), (LONGINT)(n), P) + +#define __INITYP(t, t0, level) \ + t##__typ = (LONGINT*)&t##__desc.blksz; \ + memcpy(t##__desc.basep, t0##__typ - __BASEOFF, level*sizeof(LONGINT)); \ + t##__desc.basep[level] = (LONGINT)(uintptr_t)t##__typ; \ + t##__desc.module = (LONGINT)(uintptr_t)m; \ + if(t##__desc.blksz!=sizeof(struct t)) __HALT(-15); \ + t##__desc.blksz = (t##__desc.blksz+5*sizeof(LONGINT)-1)/(4*sizeof(LONGINT))*(4*sizeof(LONGINT)); \ + Heap_REGTYP(m, (LONGINT)(uintptr_t)&t##__desc.next); \ + SYSTEM_INHERIT(t##__typ, t0##__typ) + +#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(uintptr_t)typ##__typ) +#define __TYPEOF(p) ((LONGINT*)(uintptr_t)(*(((LONGINT*)(p))-1))) +#define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) + +// Oberon-2 type bound procedures support +#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(uintptr_t)proc +#define __SEND(typ, num, funtyp, parlist) ((funtyp)((uintptr_t)*(typ-(__TPROC0OFF+num))))parlist + + + + +#endif diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c new file mode 100644 index 00000000..5038ca68 --- /dev/null +++ b/bootstrap/unix-44/Strings.c @@ -0,0 +1,243 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +#include "SYSTEM.h" + + + + +export void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len); +export void Strings_Cap (CHAR *s, LONGINT s__len); +export void Strings_Delete (CHAR *s, LONGINT s__len, INTEGER pos, INTEGER n); +export void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n, CHAR *dest, LONGINT dest__len); +export void Strings_Insert (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, LONGINT dest__len); +export INTEGER Strings_Length (CHAR *s, LONGINT s__len); +export BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len); +export INTEGER Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, INTEGER pos); +export void Strings_Replace (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, LONGINT dest__len); + + +INTEGER Strings_Length (CHAR *s, LONGINT s__len) +{ + INTEGER _o_result; + INTEGER i; + __DUP(s, s__len, CHAR); + i = 0; + while (((LONGINT)i < s__len && s[__X(i, s__len)] != 0x00)) { + i += 1; + } + _o_result = i; + __DEL(s); + return _o_result; +} + +void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len) +{ + INTEGER n1, n2, i; + __DUP(extra, extra__len, CHAR); + n1 = Strings_Length(dest, dest__len); + n2 = Strings_Length(extra, extra__len); + i = 0; + while ((i < n2 && (LONGINT)(i + n1) < dest__len)) { + dest[__X(i + n1, dest__len)] = extra[__X(i, extra__len)]; + i += 1; + } + if ((LONGINT)(i + n1) < dest__len) { + dest[__X(i + n1, dest__len)] = 0x00; + } + __DEL(extra); +} + +void Strings_Insert (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, LONGINT dest__len) +{ + INTEGER n1, n2, i; + __DUP(source, source__len, CHAR); + n1 = Strings_Length(dest, dest__len); + n2 = Strings_Length(source, source__len); + if (pos < 0) { + pos = 0; + } + if (pos > n1) { + Strings_Append(dest, dest__len, (void*)source, source__len); + return; + } + if ((LONGINT)(pos + n2) < dest__len) { + i = n1; + while (i >= pos) { + if ((LONGINT)(i + n2) < dest__len) { + dest[__X(i + n2, dest__len)] = dest[__X(i, dest__len)]; + } + i -= 1; + } + } + i = 0; + while (i < n2) { + dest[__X(pos + i, dest__len)] = source[__X(i, source__len)]; + i += 1; + } + __DEL(source); +} + +void Strings_Delete (CHAR *s, LONGINT s__len, INTEGER pos, INTEGER n) +{ + INTEGER len, i; + len = Strings_Length(s, s__len); + if (pos < 0) { + pos = 0; + } else if (pos >= len) { + return; + } + if (pos + n < len) { + i = pos + n; + while (i < len) { + s[__X(i - n, s__len)] = s[__X(i, s__len)]; + i += 1; + } + if ((LONGINT)(i - n) < s__len) { + s[__X(i - n, s__len)] = 0x00; + } + } else { + s[__X(pos, s__len)] = 0x00; + } +} + +void Strings_Replace (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, LONGINT dest__len) +{ + __DUP(source, source__len, CHAR); + Strings_Delete((void*)dest, dest__len, pos, pos + Strings_Length(source, source__len)); + Strings_Insert(source, source__len, pos, (void*)dest, dest__len); + __DEL(source); +} + +void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n, CHAR *dest, LONGINT dest__len) +{ + INTEGER len, destLen, i; + __DUP(source, source__len, CHAR); + len = Strings_Length(source, source__len); + destLen = (int)dest__len - 1; + if (pos < 0) { + pos = 0; + } + if (pos >= len) { + dest[0] = 0x00; + return; + } + i = 0; + while (((((LONGINT)(pos + i) <= source__len && source[__X(pos + i, source__len)] != 0x00)) && i < n)) { + if (i < destLen) { + dest[__X(i, dest__len)] = source[__X(pos + i, source__len)]; + } + i += 1; + } + dest[__X(i, dest__len)] = 0x00; + __DEL(source); +} + +INTEGER Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, INTEGER pos) +{ + INTEGER _o_result; + INTEGER n1, n2, i, j; + __DUP(pattern, pattern__len, CHAR); + __DUP(s, s__len, CHAR); + n1 = Strings_Length(s, s__len); + n2 = Strings_Length(pattern, pattern__len); + if (n2 == 0) { + _o_result = 0; + __DEL(pattern); + __DEL(s); + return _o_result; + } + i = pos; + while (i <= n1 - n2) { + if (s[__X(i, s__len)] == pattern[0]) { + j = 1; + while ((j < n2 && s[__X(i + j, s__len)] == pattern[__X(j, pattern__len)])) { + j += 1; + } + if (j == n2) { + _o_result = i; + __DEL(pattern); + __DEL(s); + return _o_result; + } + } + i += 1; + } + _o_result = -1; + __DEL(pattern); + __DEL(s); + return _o_result; +} + +void Strings_Cap (CHAR *s, LONGINT s__len) +{ + INTEGER i; + i = 0; + while (s[__X(i, s__len)] != 0x00) { + if (('a' <= s[__X(i, s__len)] && s[__X(i, s__len)] <= 'z')) { + s[__X(i, s__len)] = __CAP(s[__X(i, s__len)]); + } + i += 1; + } +} + +static struct Match__7 { + struct Match__7 *lnk; +} *Match__7_s; + +static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, INTEGER n, INTEGER m); + +static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, INTEGER n, INTEGER m) +{ + BOOLEAN _o_result; + while ((((n >= 0 && m >= 0)) && mask[__X(m, mask__len)] != '*')) { + if (name[__X(n, name__len)] != mask[__X(m, mask__len)]) { + _o_result = 0; + return _o_result; + } + n -= 1; + m -= 1; + } + if (m < 0) { + _o_result = n < 0; + return _o_result; + } + while ((m >= 0 && mask[__X(m, mask__len)] == '*')) { + m -= 1; + } + if (m < 0) { + _o_result = 1; + return _o_result; + } + while (n >= 0) { + if (M__8(name, name__len, mask, mask__len, n, m)) { + _o_result = 1; + return _o_result; + } + n -= 1; + } + _o_result = 0; + return _o_result; +} + +BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len) +{ + BOOLEAN _o_result; + struct Match__7 _s; + __DUP(string, string__len, CHAR); + __DUP(pattern, pattern__len, CHAR); + _s.lnk = Match__7_s; + Match__7_s = &_s; + _o_result = M__8((void*)string, string__len, (void*)pattern, pattern__len, Strings_Length(string, string__len) - 1, Strings_Length(pattern, pattern__len) - 1); + Match__7_s = _s.lnk; + __DEL(string); + __DEL(pattern); + return _o_result; +} + + +export void *Strings__init(void) +{ + __DEFMOD; + __REGMOD("Strings", 0); +/* BEGIN */ + __ENDMOD; +} diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h new file mode 100644 index 00000000..a8d8d207 --- /dev/null +++ b/bootstrap/unix-44/Strings.h @@ -0,0 +1,23 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ + +#ifndef Strings__h +#define Strings__h + +#include "SYSTEM.h" + + + + +import void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len); +import void Strings_Cap (CHAR *s, LONGINT s__len); +import void Strings_Delete (CHAR *s, LONGINT s__len, INTEGER pos, INTEGER n); +import void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n, CHAR *dest, LONGINT dest__len); +import void Strings_Insert (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, LONGINT dest__len); +import INTEGER Strings_Length (CHAR *s, LONGINT s__len); +import BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len); +import INTEGER Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, INTEGER pos); +import void Strings_Replace (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, LONGINT dest__len); +import void *Strings__init(void); + + +#endif diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c new file mode 100644 index 00000000..1e81c3df --- /dev/null +++ b/bootstrap/unix-44/Texts.c @@ -0,0 +1,1838 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +#include "SYSTEM.h" +#include "Files.h" +#include "Modules.h" +#include "Reals.h" + +typedef + struct Texts_RunDesc *Texts_Run; + +typedef + struct Texts_FontDesc *Texts_FontsFont; + +typedef + struct Texts_RunDesc { + Texts_Run prev, next; + LONGINT len; + Texts_FontsFont fnt; + SHORTINT col, voff; + BOOLEAN ascii; + } Texts_RunDesc; + +typedef + struct Texts_ElemDesc *Texts_Elem; + +typedef + struct Texts_ElemMsg { + char _prvt0[1]; + } Texts_ElemMsg; + +typedef + void (*Texts_Handler)(Texts_Elem, Texts_ElemMsg*, LONGINT *); + +typedef + struct Texts_TextDesc *Texts_Text; + +typedef + struct Texts_ElemDesc { + Texts_Run prev, next; + LONGINT len; + Texts_FontsFont fnt; + SHORTINT col, voff; + BOOLEAN ascii; + LONGINT W, H; + Texts_Handler handle; + Texts_Text base; + } Texts_ElemDesc; + +struct Texts__1 { /* Texts_ElemDesc */ + Texts_Run prev, next; + LONGINT len; + Texts_FontsFont fnt; + SHORTINT col, voff; + BOOLEAN ascii; + LONGINT W, H; + Texts_Handler handle; + Texts_Text base; + Files_File file; + LONGINT org, span; + CHAR mod[32], proc[32]; +}; + +typedef + struct Texts__1 *Texts_Alien; + +typedef + struct Texts_BufDesc { + LONGINT len; + Texts_Run head; + } Texts_BufDesc; + +typedef + Texts_BufDesc *Texts_Buffer; + +typedef + struct Texts_CopyMsg { /* Texts_ElemMsg */ + Texts_Elem e; + } Texts_CopyMsg; + +typedef + struct Texts_FileMsg { /* Texts_ElemMsg */ + INTEGER id; + LONGINT pos; + Files_Rider r; + } Texts_FileMsg; + +typedef + struct Texts_FontDesc { + CHAR name[32]; + } Texts_FontDesc; + +typedef + struct Texts_IdentifyMsg { /* Texts_ElemMsg */ + CHAR mod[32], proc[32]; + } Texts_IdentifyMsg; + +typedef + void (*Texts_Notifier)(Texts_Text, INTEGER, LONGINT, LONGINT); + +typedef + struct Texts_PieceDesc *Texts_Piece; + +typedef + struct Texts_PieceDesc { + Texts_Run prev, next; + LONGINT len; + Texts_FontsFont fnt; + SHORTINT col, voff; + BOOLEAN ascii; + Files_File file; + LONGINT org; + } Texts_PieceDesc; + +typedef + struct Texts_Reader { + BOOLEAN eot; + Texts_FontsFont fnt; + SHORTINT col, voff; + Texts_Elem elem; + Files_Rider rider; + Texts_Run run; + LONGINT org, off; + } Texts_Reader; + +typedef + struct Texts_Scanner { /* Texts_Reader */ + BOOLEAN eot; + Texts_FontsFont fnt; + SHORTINT col, voff; + Texts_Elem elem; + Files_Rider rider; + Texts_Run run; + LONGINT org, off; + CHAR nextCh; + INTEGER line, class; + LONGINT i; + REAL x; + LONGREAL y; + CHAR c; + SHORTINT len; + CHAR s[64]; + } Texts_Scanner; + +typedef + struct Texts_TextDesc { + LONGINT len; + Texts_Notifier notify; + Texts_Run head, cache; + LONGINT corg; + } Texts_TextDesc; + +typedef + struct Texts_Writer { + Texts_Buffer buf; + Texts_FontsFont fnt; + SHORTINT col, voff; + Files_Rider rider; + Files_File file; + } Texts_Writer; + + +export Texts_Elem Texts_new; +static Texts_Buffer Texts_del; +static Texts_FontsFont Texts_FontsDefault; + +export LONGINT *Texts_FontDesc__typ; +export LONGINT *Texts_RunDesc__typ; +export LONGINT *Texts_PieceDesc__typ; +export LONGINT *Texts_ElemMsg__typ; +export LONGINT *Texts_ElemDesc__typ; +export LONGINT *Texts_FileMsg__typ; +export LONGINT *Texts_CopyMsg__typ; +export LONGINT *Texts_IdentifyMsg__typ; +export LONGINT *Texts_BufDesc__typ; +export LONGINT *Texts_TextDesc__typ; +export LONGINT *Texts_Reader__typ; +export LONGINT *Texts_Scanner__typ; +export LONGINT *Texts_Writer__typ; +export LONGINT *Texts__1__typ; + +export void Texts_Append (Texts_Text T, Texts_Buffer B); +export void Texts_ChangeLooks (Texts_Text T, LONGINT beg, LONGINT end, SET sel, Texts_FontsFont fnt, SHORTINT col, SHORTINT voff); +static Texts_Elem Texts_CloneElem (Texts_Elem e); +static Texts_Piece Texts_ClonePiece (Texts_Piece p); +export void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len); +export void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); +export void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); +export void Texts_Delete (Texts_Text T, LONGINT beg, LONGINT end); +export Texts_Text Texts_ElemBase (Texts_Elem E); +export LONGINT Texts_ElemPos (Texts_Elem E); +static void Texts_Find (Texts_Text T, LONGINT *pos, Texts_Run *u, LONGINT *org, LONGINT *off); +static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len); +static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, LONGINT *msg__typ); +export void Texts_Insert (Texts_Text T, LONGINT pos, Texts_Buffer B); +export void Texts_Load (Files_Rider *r, LONGINT *r__typ, Texts_Text T); +static void Texts_Load0 (Files_Rider *r, LONGINT *r__typ, Texts_Text T); +static void Texts_Merge (Texts_Text T, Texts_Run u, Texts_Run *v); +export void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len); +export void Texts_OpenBuf (Texts_Buffer B); +export void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, LONGINT pos); +export void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, LONGINT pos); +export void Texts_OpenWriter (Texts_Writer *W, LONGINT *W__typ); +export LONGINT Texts_Pos (Texts_Reader *R, LONGINT *R__typ); +export void Texts_Read (Texts_Reader *R, LONGINT *R__typ, CHAR *ch); +export void Texts_ReadElem (Texts_Reader *R, LONGINT *R__typ); +export void Texts_ReadPrevElem (Texts_Reader *R, LONGINT *R__typ); +export void Texts_Recall (Texts_Buffer *B); +export void Texts_Save (Texts_Text T, LONGINT beg, LONGINT end, Texts_Buffer B); +export void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ); +export void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, SHORTINT col); +export void Texts_SetFont (Texts_Writer *W, LONGINT *W__typ, Texts_FontsFont fnt); +export void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, SHORTINT voff); +static void Texts_Splice (Texts_Run un, Texts_Run v, Texts_Run w, Texts_Text base); +static void Texts_Split (LONGINT off, Texts_Run *u, Texts_Run *un); +export void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T); +export void Texts_Write (Texts_Writer *W, LONGINT *W__typ, CHAR ch); +export void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, LONGINT t, LONGINT d); +export void Texts_WriteElem (Texts_Writer *W, LONGINT *W__typ, Texts_Elem e); +export void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, LONGINT x); +export void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n); +export void Texts_WriteLn (Texts_Writer *W, LONGINT *W__typ); +export void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER n); +export void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x); +export void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n); +export void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n, INTEGER k); +export void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x); +export void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__len); + + +static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len) +{ + Texts_FontsFont _o_result; + Texts_FontsFont F = NIL; + __NEW(F, Texts_FontDesc); + __COPY(name, F->name, ((LONGINT)(32))); + _o_result = F; + return _o_result; +} + +static void Texts_Find (Texts_Text T, LONGINT *pos, Texts_Run *u, LONGINT *org, LONGINT *off) +{ + Texts_Run v = NIL; + LONGINT m; + if (*pos >= T->len) { + *pos = T->len; + *u = T->head; + *org = T->len; + *off = 0; + T->cache = T->head; + T->corg = 0; + } else { + v = T->cache->next; + m = *pos - T->corg; + if (*pos >= T->corg) { + while (m >= v->len) { + m -= v->len; + v = v->next; + } + } else { + while (m < 0) { + v = v->prev; + m += v->len; + } + } + *u = v; + *org = *pos - m; + *off = m; + T->cache = v->prev; + T->corg = *org; + } +} + +static void Texts_Split (LONGINT off, Texts_Run *u, Texts_Run *un) +{ + Texts_Piece p = NIL, U = NIL; + if (off == 0) { + *un = *u; + *u = (*un)->prev; + } else if (off >= (*u)->len) { + *un = (*u)->next; + } else { + __NEW(p, Texts_PieceDesc); + *un = (Texts_Run)p; + U = __GUARDP(*u, Texts_PieceDesc, 1); + __GUARDEQP(p, Texts_PieceDesc) = *U; + p->org += off; + p->len -= off; + U->len -= p->len; + p->ascii = (*u)->ascii; + p->prev = (Texts_Run)U; + p->next = U->next; + p->next->prev = (Texts_Run)p; + U->next = (Texts_Run)p; + } +} + +static void Texts_Merge (Texts_Text T, Texts_Run u, Texts_Run *v) +{ + Texts_Piece p = NIL, q = NIL; + if ((((((((((__ISP(u, Texts_PieceDesc, 1) && __ISP(*v, Texts_PieceDesc, 1))) && __STRCMP(u->fnt->name, (*v)->fnt->name) == 0)) && u->col == (*v)->col)) && u->voff == (*v)->voff)) && __GUARDP(u, Texts_PieceDesc, 1)->ascii == __GUARDP(*v, Texts_PieceDesc, 1)->ascii)) { + p = __GUARDP(u, Texts_PieceDesc, 1); + q = __GUARDP(*v, Texts_PieceDesc, 1); + if ((p->file == q->file && p->org + p->len == q->org)) { + if (T->cache == u) { + T->corg += q->len; + } else if (T->cache == *v) { + T->cache = T->head; + T->corg = 0; + } + p->len += q->len; + *v = (*v)->next; + } + } +} + +static void Texts_Splice (Texts_Run un, Texts_Run v, Texts_Run w, Texts_Text base) +{ + Texts_Run u = NIL; + if (v != w->next) { + u = un->prev; + u->next = v; + v->prev = u; + un->prev = w; + w->next = un; + do { + if (__ISP(v, Texts_ElemDesc, 1)) { + __GUARDP(v, Texts_ElemDesc, 1)->base = base; + } + v = v->next; + } while (!(v == un)); + } +} + +static Texts_Piece Texts_ClonePiece (Texts_Piece p) +{ + Texts_Piece _o_result; + Texts_Piece q = NIL; + __NEW(q, Texts_PieceDesc); + __GUARDEQP(q, Texts_PieceDesc) = *p; + _o_result = q; + return _o_result; +} + +static Texts_Elem Texts_CloneElem (Texts_Elem e) +{ + Texts_Elem _o_result; + Texts_CopyMsg msg; + msg.e = NIL; + (*e->handle)(e, (void*)&msg, Texts_CopyMsg__typ); + _o_result = msg.e; + return _o_result; +} + +void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE) +{ + DE->len = SE->len; + DE->fnt = SE->fnt; + DE->col = SE->col; + DE->voff = SE->voff; + DE->W = SE->W; + DE->H = SE->H; + DE->handle = SE->handle; +} + +Texts_Text Texts_ElemBase (Texts_Elem E) +{ + Texts_Text _o_result; + _o_result = E->base; + return _o_result; +} + +LONGINT Texts_ElemPos (Texts_Elem E) +{ + LONGINT _o_result; + Texts_Run u = NIL; + LONGINT pos; + u = E->base->head->next; + pos = 0; + while (u != (void *) E) { + pos = pos + u->len; + u = u->next; + } + _o_result = pos; + return _o_result; +} + +static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, LONGINT *msg__typ) +{ + Texts_Alien e = NIL; + Files_Rider r; + LONGINT i; + CHAR ch; + if (__ISP(E, Texts__1, 2)) { + if (__IS(msg__typ, Texts_CopyMsg, 1)) { + if (__IS(msg__typ, Texts_CopyMsg, 1)) { + Texts_CopyMsg *msg__ = (void*)msg; + __NEW(e, Texts__1); + Texts_CopyElem((void*)((Texts_Alien)E), (void*)e); + e->file = ((Texts_Alien)E)->file; + e->org = ((Texts_Alien)E)->org; + e->span = ((Texts_Alien)E)->span; + __COPY(((Texts_Alien)E)->mod, e->mod, ((LONGINT)(32))); + __COPY(((Texts_Alien)E)->proc, e->proc, ((LONGINT)(32))); + (*msg__).e = (Texts_Elem)e; + } else __WITHCHK; + } else if (__IS(msg__typ, Texts_IdentifyMsg, 1)) { + if (__IS(msg__typ, Texts_IdentifyMsg, 1)) { + Texts_IdentifyMsg *msg__ = (void*)msg; + __COPY(((Texts_Alien)E)->mod, (*msg__).mod, ((LONGINT)(32))); + __COPY(((Texts_Alien)E)->proc, (*msg__).proc, ((LONGINT)(32))); + (*msg__).mod[31] = 0x01; + } else __WITHCHK; + } else if (__IS(msg__typ, Texts_FileMsg, 1)) { + if (__IS(msg__typ, Texts_FileMsg, 1)) { + Texts_FileMsg *msg__ = (void*)msg; + if ((*msg__).id == 1) { + Files_Set(&r, Files_Rider__typ, ((Texts_Alien)E)->file, ((Texts_Alien)E)->org); + i = ((Texts_Alien)E)->span; + while (i > 0) { + Files_Read(&r, Files_Rider__typ, (void*)&ch); + Files_Write(&(*msg__).r, Files_Rider__typ, ch); + i -= 1; + } + } + } else __WITHCHK; + } + } else __WITHCHK; +} + +void Texts_OpenBuf (Texts_Buffer B) +{ + Texts_Run u = NIL; + __NEW(u, Texts_RunDesc); + u->next = u; + u->prev = u; + B->head = u; + B->len = 0; +} + +void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB) +{ + Texts_Run u = NIL, v = NIL, vn = NIL; + u = SB->head->next; + v = DB->head->prev; + while (u != SB->head) { + if (__ISP(u, Texts_PieceDesc, 1)) { + vn = (Texts_Run)Texts_ClonePiece(__GUARDP(u, Texts_PieceDesc, 1)); + } else { + vn = (Texts_Run)Texts_CloneElem(__GUARDP(u, Texts_ElemDesc, 1)); + } + v->next = vn; + vn->prev = v; + v = vn; + u = u->next; + } + v->next = DB->head; + DB->head->prev = v; + DB->len += SB->len; +} + +void Texts_Recall (Texts_Buffer *B) +{ + *B = Texts_del; + Texts_del = NIL; +} + +void Texts_Save (Texts_Text T, LONGINT beg, LONGINT end, Texts_Buffer B) +{ + Texts_Run u = NIL, v = NIL, w = NIL, wn = NIL; + LONGINT uo, ud, vo, vd; + Texts_Find(T, &beg, &u, &uo, &ud); + Texts_Find(T, &end, &v, &vo, &vd); + w = B->head->prev; + while (u != v) { + if (__ISP(u, Texts_PieceDesc, 1)) { + wn = (Texts_Run)Texts_ClonePiece(__GUARDP(u, Texts_PieceDesc, 1)); + wn->len -= ud; + __GUARDP(wn, Texts_PieceDesc, 1)->org += ud; + } else { + wn = (Texts_Run)Texts_CloneElem(__GUARDP(u, Texts_ElemDesc, 1)); + } + w->next = wn; + wn->prev = w; + w = wn; + u = u->next; + ud = 0; + } + if (vd > 0) { + wn = (Texts_Run)Texts_ClonePiece(__GUARDP(v, Texts_PieceDesc, 1)); + wn->len = vd - ud; + __GUARDP(wn, Texts_PieceDesc, 1)->org += ud; + w->next = wn; + wn->prev = w; + w = wn; + } + w->next = B->head; + B->head->prev = w; + B->len += end - beg; +} + +void Texts_Insert (Texts_Text T, LONGINT pos, Texts_Buffer B) +{ + Texts_Run u = NIL, un = NIL, v = NIL; + Texts_Piece p = NIL, q = NIL; + LONGINT uo, ud, len; + Texts_Find(T, &pos, &u, &uo, &ud); + Texts_Split(ud, &u, &un); + len = B->len; + v = B->head->next; + Texts_Merge(T, u, &v); + Texts_Splice(un, v, B->head->prev, T); + T->len += len; + B->head->next = B->head; + B->head->prev = B->head; + B->len = 0; + if (T->notify != NIL) { + (*T->notify)(T, 1, pos, pos + len); + } +} + +void Texts_Append (Texts_Text T, Texts_Buffer B) +{ + Texts_Run v = NIL; + LONGINT pos, len; + pos = T->len; + len = B->len; + v = B->head->next; + Texts_Merge(T, T->head->prev, &v); + Texts_Splice(T->head, v, B->head->prev, T); + T->len += len; + B->head->next = B->head; + B->head->prev = B->head; + B->len = 0; + if (T->notify != NIL) { + (*T->notify)(T, 1, pos, pos + len); + } +} + +void Texts_Delete (Texts_Text T, LONGINT beg, LONGINT end) +{ + Texts_Run c = NIL, u = NIL, un = NIL, v = NIL, vn = NIL; + LONGINT co, uo, ud, vo, vd; + Texts_Find(T, &beg, &u, &uo, &ud); + Texts_Split(ud, &u, &un); + c = T->cache; + co = T->corg; + Texts_Find(T, &end, &v, &vo, &vd); + Texts_Split(vd, &v, &vn); + T->cache = c; + T->corg = co; + __NEW(Texts_del, Texts_BufDesc); + Texts_OpenBuf(Texts_del); + Texts_del->len = end - beg; + Texts_Splice(Texts_del->head, un, v, NIL); + Texts_Merge(T, u, &vn); + u->next = vn; + vn->prev = u; + T->len -= end - beg; + if (T->notify != NIL) { + (*T->notify)(T, 2, beg, end); + } +} + +void Texts_ChangeLooks (Texts_Text T, LONGINT beg, LONGINT end, SET sel, Texts_FontsFont fnt, SHORTINT col, SHORTINT voff) +{ + Texts_Run c = NIL, u = NIL, un = NIL, v = NIL, vn = NIL; + LONGINT co, uo, ud, vo, vd; + Texts_Find(T, &beg, &u, &uo, &ud); + Texts_Split(ud, &u, &un); + c = T->cache; + co = T->corg; + Texts_Find(T, &end, &v, &vo, &vd); + Texts_Split(vd, &v, &vn); + T->cache = c; + T->corg = co; + while (un != vn) { + if ((__IN(0, sel) && fnt != NIL)) { + un->fnt = fnt; + } + if (__IN(1, sel)) { + un->col = col; + } + if (__IN(2, sel)) { + un->voff = voff; + } + Texts_Merge(T, u, &un); + if (u->next == un) { + u = un; + un = un->next; + } else { + u->next = un; + un->prev = u; + } + } + Texts_Merge(T, u, &un); + u->next = un; + un->prev = u; + if (T->notify != NIL) { + (*T->notify)(T, 0, beg, end); + } +} + +void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, LONGINT pos) +{ + Texts_Run u = NIL; + if (pos >= T->len) { + pos = T->len; + } + Texts_Find(T, &pos, &u, &(*R).org, &(*R).off); + (*R).run = u; + (*R).eot = 0; + if (__ISP(u, Texts_PieceDesc, 1)) { + Files_Set(&(*R).rider, Files_Rider__typ, __GUARDP(u, Texts_PieceDesc, 1)->file, __GUARDP(u, Texts_PieceDesc, 1)->org + (*R).off); + } +} + +void Texts_Read (Texts_Reader *R, LONGINT *R__typ, CHAR *ch) +{ + Texts_Run u = NIL; + LONGINT pos; + CHAR nextch; + u = (*R).run; + (*R).fnt = u->fnt; + (*R).col = u->col; + (*R).voff = u->voff; + (*R).off += 1; + if (__ISP(u, Texts_PieceDesc, 1)) { + Files_Read(&(*R).rider, Files_Rider__typ, (void*)&*ch); + (*R).elem = NIL; + if ((*ch == 0x0a && __GUARDP(u, Texts_PieceDesc, 1)->ascii)) { + *ch = 0x0d; + } else if ((*ch == 0x0d && __GUARDP(u, Texts_PieceDesc, 1)->ascii)) { + pos = Files_Pos(&(*R).rider, Files_Rider__typ); + Files_Read(&(*R).rider, Files_Rider__typ, (void*)&nextch); + if (nextch == 0x0a) { + (*R).off += 1; + } else { + Files_Set(&(*R).rider, Files_Rider__typ, __GUARDP(u, Texts_PieceDesc, 1)->file, pos); + } + } + } else if (__ISP(u, Texts_ElemDesc, 1)) { + *ch = 0x1c; + (*R).elem = __GUARDP(u, Texts_ElemDesc, 1); + } else { + *ch = 0x00; + (*R).elem = NIL; + (*R).eot = 1; + } + if ((*R).off == u->len) { + (*R).org += u->len; + u = u->next; + if (__ISP(u, Texts_PieceDesc, 1)) { + if (__ISP(u, Texts_PieceDesc, 1)) { + Files_Set(&(*R).rider, Files_Rider__typ, ((Texts_Piece)u)->file, ((Texts_Piece)u)->org); + } else __WITHCHK; + } + (*R).run = u; + (*R).off = 0; + } +} + +void Texts_ReadElem (Texts_Reader *R, LONGINT *R__typ) +{ + Texts_Run u = NIL, un = NIL; + u = (*R).run; + while (__ISP(u, Texts_PieceDesc, 1)) { + (*R).org += u->len; + u = u->next; + } + if (__ISP(u, Texts_ElemDesc, 1)) { + un = u->next; + (*R).run = un; + (*R).org += 1; + (*R).off = 0; + (*R).fnt = u->fnt; + (*R).col = u->col; + (*R).voff = u->voff; + (*R).elem = __GUARDP(u, Texts_ElemDesc, 1); + if (__ISP(un, Texts_PieceDesc, 1)) { + if (__ISP(un, Texts_PieceDesc, 1)) { + Files_Set(&(*R).rider, Files_Rider__typ, ((Texts_Piece)un)->file, ((Texts_Piece)un)->org); + } else __WITHCHK; + } + } else { + (*R).eot = 1; + (*R).elem = NIL; + } +} + +void Texts_ReadPrevElem (Texts_Reader *R, LONGINT *R__typ) +{ + Texts_Run u = NIL; + u = (*R).run->prev; + while (__ISP(u, Texts_PieceDesc, 1)) { + (*R).org -= u->len; + u = u->prev; + } + if (__ISP(u, Texts_ElemDesc, 1)) { + (*R).run = u; + (*R).org -= 1; + (*R).off = 0; + (*R).fnt = u->fnt; + (*R).col = u->col; + (*R).voff = u->voff; + (*R).elem = __GUARDP(u, Texts_ElemDesc, 1); + } else { + (*R).eot = 1; + (*R).elem = NIL; + } +} + +LONGINT Texts_Pos (Texts_Reader *R, LONGINT *R__typ) +{ + LONGINT _o_result; + _o_result = (*R).org + (*R).off; + return _o_result; +} + +void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, LONGINT pos) +{ + Texts_OpenReader((void*)&*S, S__typ, T, pos); + (*S).line = 0; + (*S).nextCh = ' '; +} + +static struct Scan__31 { + Texts_Scanner *S; + LONGINT *S__typ; + CHAR *ch; + BOOLEAN *negE; + INTEGER *e; + struct Scan__31 *lnk; +} *Scan__31_s; + +static void ReadScaleFactor__32 (void); + +static void ReadScaleFactor__32 (void) +{ + Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); + if (*Scan__31_s->ch == '-') { + *Scan__31_s->negE = 1; + Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); + } else { + *Scan__31_s->negE = 0; + if (*Scan__31_s->ch == '+') { + Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); + } + } + while (('0' <= *Scan__31_s->ch && *Scan__31_s->ch <= '9')) { + *Scan__31_s->e = (*Scan__31_s->e * 10 + (int)*Scan__31_s->ch) - 48; + Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); + } +} + +void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) +{ + CHAR ch, term; + BOOLEAN neg, negE, hex; + SHORTINT i, j, h; + INTEGER e; + LONGINT k; + REAL x, f; + LONGREAL y, g; + CHAR d[32]; + struct Scan__31 _s; + _s.S = S; _s.S__typ = S__typ; + _s.ch = &ch; + _s.negE = &negE; + _s.e = &e; + _s.lnk = Scan__31_s; + Scan__31_s = &_s; + ch = (*S).nextCh; + i = 0; + for (;;) { + if (ch == 0x0d) { + (*S).line += 1; + } else if ((ch != ' ' && ch != 0x09)) { + break; + } + Texts_Read((void*)&*S, S__typ, &ch); + } + if ((('A' <= __CAP(ch) && __CAP(ch) <= 'Z') || ch == '/') || ch == '.') { + do { + (*S).s[__X(i, ((LONGINT)(64)))] = ch; + i += 1; + Texts_Read((void*)&*S, S__typ, &ch); + } while (!((((__CAP(ch) > 'Z' && ch != '_') || ('A' > __CAP(ch) && ch > '9')) || ((('0' > ch && ch != '.')) && ch != '/')) || i == 63)); + (*S).s[__X(i, ((LONGINT)(64)))] = 0x00; + (*S).len = i; + (*S).class = 1; + } else if (ch == '\"') { + Texts_Read((void*)&*S, S__typ, &ch); + while ((((ch != '\"' && ch >= ' ')) && i != 63)) { + (*S).s[__X(i, ((LONGINT)(64)))] = ch; + i += 1; + Texts_Read((void*)&*S, S__typ, &ch); + } + (*S).s[__X(i, ((LONGINT)(64)))] = 0x00; + (*S).len = i + 1; + Texts_Read((void*)&*S, S__typ, &ch); + (*S).class = 2; + } else { + if (ch == '-') { + neg = 1; + Texts_Read((void*)&*S, S__typ, &ch); + } else { + neg = 0; + } + if (('0' <= ch && ch <= '9')) { + hex = 0; + j = 0; + for (;;) { + d[__X(i, ((LONGINT)(32)))] = ch; + i += 1; + Texts_Read((void*)&*S, S__typ, &ch); + if (ch < '0') { + break; + } + if ('9' < ch) { + if (('A' <= ch && ch <= 'F')) { + hex = 1; + ch = (CHAR)((int)ch - 7); + } else if (('a' <= ch && ch <= 'f')) { + hex = 1; + ch = (CHAR)((int)ch - 39); + } else { + break; + } + } + } + if (ch == 'H') { + Texts_Read((void*)&*S, S__typ, &ch); + (*S).class = 3; + if (i - j > 8) { + j = i - 8; + } + k = (int)d[__X(j, ((LONGINT)(32)))] - 48; + j += 1; + if ((i - j == 7 && k >= 8)) { + k -= 16; + } + while (j < i) { + k = __ASHL(k, 4) + (LONGINT)((int)d[__X(j, ((LONGINT)(32)))] - 48); + j += 1; + } + if (neg) { + (*S).i = -k; + } else { + (*S).i = k; + } + } else if (ch == '.') { + Texts_Read((void*)&*S, S__typ, &ch); + h = i; + while (('0' <= ch && ch <= '9')) { + d[__X(i, ((LONGINT)(32)))] = ch; + i += 1; + Texts_Read((void*)&*S, S__typ, &ch); + } + if (ch == 'D') { + e = 0; + y = (LONGREAL)0; + g = (LONGREAL)1; + do { + y = y * (LONGREAL)10 + ((int)d[__X(j, ((LONGINT)(32)))] - 48); + j += 1; + } while (!(j == h)); + while (j < i) { + g = g / (LONGREAL)(LONGREAL)10; + y = ((int)d[__X(j, ((LONGINT)(32)))] - 48) * g + y; + j += 1; + } + ReadScaleFactor__32(); + if (negE) { + if (e <= 308) { + y = y / (LONGREAL)Reals_TenL(e); + } else { + y = (LONGREAL)0; + } + } else if (e > 0) { + if (e <= 308) { + y = Reals_TenL(e) * y; + } else { + __HALT(40); + } + } + if (neg) { + y = -y; + } + (*S).class = 5; + (*S).y = y; + } else { + e = 0; + x = (REAL)0; + f = (REAL)1; + do { + x = x * (REAL)10 + ((int)d[__X(j, ((LONGINT)(32)))] - 48); + j += 1; + } while (!(j == h)); + while (j < i) { + f = f / (REAL)(REAL)10; + x = ((int)d[__X(j, ((LONGINT)(32)))] - 48) * f + x; + j += 1; + } + if (ch == 'E') { + ReadScaleFactor__32(); + } + if (negE) { + if (e <= 38) { + x = x / (REAL)Reals_Ten(e); + } else { + x = (REAL)0; + } + } else if (e > 0) { + if (e <= 38) { + x = Reals_Ten(e) * x; + } else { + __HALT(40); + } + } + if (neg) { + x = -x; + } + (*S).class = 4; + (*S).x = x; + } + if (hex) { + (*S).class = 0; + } + } else { + (*S).class = 3; + k = 0; + do { + k = k * 10 + (LONGINT)((int)d[__X(j, ((LONGINT)(32)))] - 48); + j += 1; + } while (!(j == i)); + if (neg) { + (*S).i = -k; + } else { + (*S).i = k; + } + if (hex) { + (*S).class = 0; + } else { + (*S).class = 3; + } + } + } else { + (*S).class = 6; + if (neg) { + (*S).c = '-'; + } else { + (*S).c = ch; + Texts_Read((void*)&*S, S__typ, &ch); + } + } + } + (*S).nextCh = ch; + Scan__31_s = _s.lnk; +} + +void Texts_OpenWriter (Texts_Writer *W, LONGINT *W__typ) +{ + __NEW((*W).buf, Texts_BufDesc); + Texts_OpenBuf((*W).buf); + (*W).fnt = Texts_FontsDefault; + (*W).col = 15; + (*W).voff = 0; + (*W).file = Files_New((CHAR*)"", (LONGINT)1); + Files_Set(&(*W).rider, Files_Rider__typ, (*W).file, ((LONGINT)(0))); +} + +void Texts_SetFont (Texts_Writer *W, LONGINT *W__typ, Texts_FontsFont fnt) +{ + (*W).fnt = fnt; +} + +void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, SHORTINT col) +{ + (*W).col = col; +} + +void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, SHORTINT voff) +{ + (*W).voff = voff; +} + +void Texts_Write (Texts_Writer *W, LONGINT *W__typ, CHAR ch) +{ + Texts_Run u = NIL, un = NIL; + Texts_Piece p = NIL; + Files_Write(&(*W).rider, Files_Rider__typ, ch); + (*W).buf->len += 1; + un = (*W).buf->head; + u = un->prev; + if ((((((((((__ISP(u, Texts_PieceDesc, 1) && __GUARDP(u, Texts_PieceDesc, 1)->file == (*W).file)) && __STRCMP(u->fnt->name, (*W).fnt->name) == 0)) && u->col == (*W).col)) && u->voff == (*W).voff)) && !__GUARDP(u, Texts_PieceDesc, 1)->ascii)) { + u->len += 1; + } else { + __NEW(p, Texts_PieceDesc); + u->next = (Texts_Run)p; + p->prev = u; + p->next = un; + un->prev = (Texts_Run)p; + p->len = 1; + p->fnt = (*W).fnt; + p->col = (*W).col; + p->voff = (*W).voff; + p->file = (*W).file; + p->org = Files_Length((*W).file) - 1; + p->ascii = 0; + } +} + +void Texts_WriteElem (Texts_Writer *W, LONGINT *W__typ, Texts_Elem e) +{ + Texts_Run u = NIL, un = NIL; + if (e->base != NIL) { + __HALT(99); + } + (*W).buf->len += 1; + e->len = 1; + e->fnt = (*W).fnt; + e->col = (*W).col; + e->voff = (*W).voff; + un = (*W).buf->head; + u = un->prev; + u->next = (Texts_Run)e; + e->prev = u; + e->next = un; + un->prev = (Texts_Run)e; +} + +void Texts_WriteLn (Texts_Writer *W, LONGINT *W__typ) +{ + Texts_Write(&*W, W__typ, 0x0d); +} + +void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__len) +{ + INTEGER i; + __DUP(s, s__len, CHAR); + i = 0; + while (s[__X(i, s__len)] >= ' ') { + Texts_Write(&*W, W__typ, s[__X(i, s__len)]); + i += 1; + } + __DEL(s); +} + +void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n) +{ + INTEGER i; + LONGINT x0; + CHAR a[22]; + i = 0; + if (x < 0) { + if (x == (-2147483647-1)) { + Texts_WriteString(&*W, W__typ, (CHAR*)" -2147483648", (LONGINT)13); + return; + } else { + n -= 1; + x0 = -x; + } + } else { + x0 = x; + } + do { + a[__X(i, ((LONGINT)(22)))] = (CHAR)(__MOD(x0, 10) + 48); + x0 = __DIV(x0, 10); + i += 1; + } while (!(x0 == 0)); + while (n > (LONGINT)i) { + Texts_Write(&*W, W__typ, ' '); + n -= 1; + } + if (x < 0) { + Texts_Write(&*W, W__typ, '-'); + } + do { + i -= 1; + Texts_Write(&*W, W__typ, a[__X(i, ((LONGINT)(22)))]); + } while (!(i == 0)); +} + +void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, LONGINT x) +{ + INTEGER i; + LONGINT y; + CHAR a[20]; + i = 0; + Texts_Write(&*W, W__typ, ' '); + do { + y = __MASK(x, -16); + if (y < 10) { + a[__X(i, ((LONGINT)(20)))] = (CHAR)(y + 48); + } else { + a[__X(i, ((LONGINT)(20)))] = (CHAR)(y + 55); + } + x = __ASHR(x, 4); + i += 1; + } while (!(i == 8)); + do { + i -= 1; + Texts_Write(&*W, W__typ, a[__X(i, ((LONGINT)(20)))]); + } while (!(i == 0)); +} + +void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n) +{ + INTEGER e; + REAL x0; + CHAR d[9]; + e = Reals_Expo(x); + if (e == 0) { + Texts_WriteString(&*W, W__typ, (CHAR*)" 0", (LONGINT)4); + do { + Texts_Write(&*W, W__typ, ' '); + n -= 1; + } while (!(n <= 3)); + } else if (e == 255) { + Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", (LONGINT)5); + while (n > 4) { + Texts_Write(&*W, W__typ, ' '); + n -= 1; + } + } else { + if (n <= 9) { + n = 3; + } else { + n -= 6; + } + do { + Texts_Write(&*W, W__typ, ' '); + n -= 1; + } while (!(n <= 8)); + if (x < (REAL)0) { + Texts_Write(&*W, W__typ, '-'); + x = -x; + } else { + Texts_Write(&*W, W__typ, ' '); + } + e = __ASHR((e - 127) * 77, 8); + if (e >= 0) { + x = x / (REAL)Reals_Ten(e); + } else { + x = Reals_Ten(-e) * x; + } + if (x >= (REAL)10) { + x = 1.0000000e-001 * x; + e += 1; + } + x0 = Reals_Ten(n - 1); + x = x0 * x + 5.0000000e-001; + if (x >= (REAL)10 * x0) { + x = x * 1.0000000e-001; + e += 1; + } + Reals_Convert(x, n, (void*)d, ((LONGINT)(9))); + n -= 1; + Texts_Write(&*W, W__typ, d[__X(n, ((LONGINT)(9)))]); + Texts_Write(&*W, W__typ, '.'); + do { + n -= 1; + Texts_Write(&*W, W__typ, d[__X(n, ((LONGINT)(9)))]); + } while (!(n == 0)); + Texts_Write(&*W, W__typ, 'E'); + if (e < 0) { + Texts_Write(&*W, W__typ, '-'); + e = -e; + } else { + Texts_Write(&*W, W__typ, '+'); + } + Texts_Write(&*W, W__typ, (CHAR)(__DIV(e, 10) + 48)); + Texts_Write(&*W, W__typ, (CHAR)((int)__MOD(e, 10) + 48)); + } +} + +static struct WriteRealFix__53 { + Texts_Writer *W; + LONGINT *W__typ; + INTEGER *i; + CHAR (*d)[9]; + struct WriteRealFix__53 *lnk; +} *WriteRealFix__53_s; + +static void dig__54 (INTEGER n); +static void seq__56 (CHAR ch, INTEGER n); + +static void seq__56 (CHAR ch, INTEGER n) +{ + while (n > 0) { + Texts_Write(&*WriteRealFix__53_s->W, WriteRealFix__53_s->W__typ, ch); + n -= 1; + } +} + +static void dig__54 (INTEGER n) +{ + while (n > 0) { + *WriteRealFix__53_s->i -= 1; + Texts_Write(&*WriteRealFix__53_s->W, WriteRealFix__53_s->W__typ, (*WriteRealFix__53_s->d)[__X(*WriteRealFix__53_s->i, ((LONGINT)(9)))]); + n -= 1; + } +} + +void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n, INTEGER k) +{ + INTEGER e, i; + CHAR sign; + REAL x0; + CHAR d[9]; + struct WriteRealFix__53 _s; + _s.W = W; _s.W__typ = W__typ; + _s.i = &i; + _s.d = (void*)d; + _s.lnk = WriteRealFix__53_s; + WriteRealFix__53_s = &_s; + e = Reals_Expo(x); + if (k < 0) { + k = 0; + } + if (e == 0) { + seq__56(' ', (n - k) - 2); + Texts_Write(&*W, W__typ, '0'); + seq__56(' ', k + 1); + } else if (e == 255) { + Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", (LONGINT)5); + seq__56(' ', n - 4); + } else { + e = __ASHR((e - 127) * 77, 8); + if (x < (REAL)0) { + sign = '-'; + x = -x; + } else { + sign = ' '; + } + if (e >= 0) { + x = x / (REAL)Reals_Ten(e); + } else { + x = Reals_Ten(-e) * x; + } + if (x >= (REAL)10) { + x = 1.0000000e-001 * x; + e += 1; + } + if (k + e >= 8) { + k = 8 - e; + } else if (k + e < 0) { + k = -e; + x = (REAL)0; + } + x0 = Reals_Ten(k + e); + x = x0 * x + 5.0000000e-001; + if (x >= (REAL)10 * x0) { + e += 1; + } + e += 1; + i = k + e; + Reals_Convert(x, i, (void*)d, ((LONGINT)(9))); + if (e > 0) { + seq__56(' ', ((n - e) - k) - 2); + Texts_Write(&*W, W__typ, sign); + dig__54(e); + Texts_Write(&*W, W__typ, '.'); + dig__54(k); + } else { + seq__56(' ', (n - k) - 3); + Texts_Write(&*W, W__typ, sign); + Texts_Write(&*W, W__typ, '0'); + Texts_Write(&*W, W__typ, '.'); + seq__56('0', -e); + dig__54(k + e); + } + } + WriteRealFix__53_s = _s.lnk; +} + +void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x) +{ + INTEGER i; + CHAR d[8]; + Reals_ConvertH(x, (void*)d, ((LONGINT)(8))); + i = 0; + do { + Texts_Write(&*W, W__typ, d[__X(i, ((LONGINT)(8)))]); + i += 1; + } while (!(i == 8)); +} + +void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER n) +{ + INTEGER e; + LONGREAL x0; + CHAR d[16]; + e = Reals_ExpoL(x); + if (e == 0) { + Texts_WriteString(&*W, W__typ, (CHAR*)" 0", (LONGINT)4); + do { + Texts_Write(&*W, W__typ, ' '); + n -= 1; + } while (!(n <= 3)); + } else if (e == 2047) { + Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", (LONGINT)5); + while (n > 4) { + Texts_Write(&*W, W__typ, ' '); + n -= 1; + } + } else { + if (n <= 10) { + n = 3; + } else { + n -= 7; + } + do { + Texts_Write(&*W, W__typ, ' '); + n -= 1; + } while (!(n <= 16)); + if (x < (LONGREAL)0) { + Texts_Write(&*W, W__typ, '-'); + x = -x; + } else { + Texts_Write(&*W, W__typ, ' '); + } + e = (int)__ASHR((LONGINT)(e - 1023) * 77, 8); + if (e >= 0) { + x = x / (LONGREAL)Reals_TenL(e); + } else { + x = Reals_TenL(-e) * x; + } + if (x >= (LONGREAL)10) { + x = 1.00000000000000e-001 * x; + e += 1; + } + x0 = Reals_TenL(n - 1); + x = x0 * x + 5.00000000000000e-001; + if (x >= (LONGREAL)10 * x0) { + x = 1.00000000000000e-001 * x; + e += 1; + } + Reals_ConvertL(x, n, (void*)d, ((LONGINT)(16))); + n -= 1; + Texts_Write(&*W, W__typ, d[__X(n, ((LONGINT)(16)))]); + Texts_Write(&*W, W__typ, '.'); + do { + n -= 1; + Texts_Write(&*W, W__typ, d[__X(n, ((LONGINT)(16)))]); + } while (!(n == 0)); + Texts_Write(&*W, W__typ, 'D'); + if (e < 0) { + Texts_Write(&*W, W__typ, '-'); + e = -e; + } else { + Texts_Write(&*W, W__typ, '+'); + } + Texts_Write(&*W, W__typ, (CHAR)(__DIV(e, 100) + 48)); + e = (int)__MOD(e, 100); + Texts_Write(&*W, W__typ, (CHAR)(__DIV(e, 10) + 48)); + Texts_Write(&*W, W__typ, (CHAR)((int)__MOD(e, 10) + 48)); + } +} + +void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x) +{ + INTEGER i; + CHAR d[16]; + Reals_ConvertHL(x, (void*)d, ((LONGINT)(16))); + i = 0; + do { + Texts_Write(&*W, W__typ, d[__X(i, ((LONGINT)(16)))]); + i += 1; + } while (!(i == 16)); +} + +static struct WriteDate__43 { + Texts_Writer *W; + LONGINT *W__typ; + struct WriteDate__43 *lnk; +} *WriteDate__43_s; + +static void WritePair__44 (CHAR ch, LONGINT x); + +static void WritePair__44 (CHAR ch, LONGINT x) +{ + Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, ch); + Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)(__DIV(x, 10) + 48)); + Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)(__MOD(x, 10) + 48)); +} + +void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, LONGINT t, LONGINT d) +{ + struct WriteDate__43 _s; + _s.W = W; _s.W__typ = W__typ; + _s.lnk = WriteDate__43_s; + WriteDate__43_s = &_s; + WritePair__44(' ', __MASK(d, -32)); + WritePair__44('.', __MASK(__ASHR(d, 5), -16)); + WritePair__44('.', __MASK(__ASHR(d, 9), -128)); + WritePair__44(' ', __MASK(__ASHR(t, 12), -32)); + WritePair__44(':', __MASK(__ASHR(t, 6), -64)); + WritePair__44(':', __MASK(t, -64)); + WriteDate__43_s = _s.lnk; +} + +static struct Load0__16 { + Texts_Text *T; + SHORTINT *ecnt; + Files_File *f; + Texts_FileMsg *msg; + CHAR (*mods)[64][32], (*procs)[64][32]; + struct Load0__16 *lnk; +} *Load0__16_s; + +static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, LONGINT span, Texts_Elem *e); + +static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, LONGINT span, Texts_Elem *e) +{ + Modules_Module M = NIL; + Modules_Command Cmd; + Texts_Alien a = NIL; + LONGINT org, ew, eh; + SHORTINT eno; + Texts_new = NIL; + Files_ReadLInt(&*r, r__typ, &ew); + Files_ReadLInt(&*r, r__typ, &eh); + Files_Read(&*r, r__typ, (void*)&eno); + if (eno > *Load0__16_s->ecnt) { + *Load0__16_s->ecnt = eno; + Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->mods)[__X(eno, ((LONGINT)(64)))], ((LONGINT)(32))); + Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->procs)[__X(eno, ((LONGINT)(64)))], ((LONGINT)(32))); + } + org = Files_Pos(&*r, r__typ); + M = Modules_ThisMod((*Load0__16_s->mods)[__X(eno, ((LONGINT)(64)))], ((LONGINT)(32))); + if (M != NIL) { + Cmd = Modules_ThisCommand(M, (*Load0__16_s->procs)[__X(eno, ((LONGINT)(64)))], ((LONGINT)(32))); + if (Cmd != NIL) { + (*Cmd)(); + } + } + *e = Texts_new; + if (*e != NIL) { + (*e)->W = ew; + (*e)->H = eh; + (*e)->base = *Load0__16_s->T; + (*Load0__16_s->msg).pos = pos; + (*(*e)->handle)(*e, (void*)&*Load0__16_s->msg, Texts_FileMsg__typ); + if (Files_Pos(&*r, r__typ) != org + span) { + *e = NIL; + } + } + if (*e == NIL) { + Files_Set(&*r, r__typ, *Load0__16_s->f, org + span); + __NEW(a, Texts__1); + a->W = ew; + a->H = eh; + a->handle = Texts_HandleAlien; + a->base = *Load0__16_s->T; + a->file = *Load0__16_s->f; + a->org = org; + a->span = span; + __COPY((*Load0__16_s->mods)[__X(eno, ((LONGINT)(64)))], a->mod, ((LONGINT)(32))); + __COPY((*Load0__16_s->procs)[__X(eno, ((LONGINT)(64)))], a->proc, ((LONGINT)(32))); + *e = (Texts_Elem)a; + } +} + +static void Texts_Load0 (Files_Rider *r, LONGINT *r__typ, Texts_Text T) +{ + Texts_Run u = NIL, un = NIL; + Texts_Piece p = NIL; + Texts_Elem e = NIL; + LONGINT org, pos, hlen, plen; + SHORTINT ecnt, fno, fcnt, col, voff; + Files_File f = NIL; + Texts_FileMsg msg; + CHAR mods[64][32], procs[64][32]; + CHAR name[32]; + Texts_FontsFont fnts[32]; + struct Load0__16 _s; + _s.T = &T; + _s.ecnt = &ecnt; + _s.f = &f; + _s.msg = &msg; + _s.mods = (void*)mods; + _s.procs = (void*)procs; + _s.lnk = Load0__16_s; + Load0__16_s = &_s; + pos = Files_Pos(&*r, r__typ); + f = Files_Base(&*r, r__typ); + __NEW(u, Texts_RunDesc); + u->len = 2147483647; + u->fnt = NIL; + u->col = 15; + T->head = u; + ecnt = 0; + fcnt = 0; + msg.id = 0; + msg.r = *r; + Files_ReadLInt(&msg.r, Files_Rider__typ, &hlen); + org = (pos - 2) + hlen; + pos = org; + Files_Read(&msg.r, Files_Rider__typ, (void*)&fno); + while (fno != 0) { + if (fno > fcnt) { + fcnt = fno; + Files_ReadString(&msg.r, Files_Rider__typ, (void*)name, ((LONGINT)(32))); + fnts[__X(fno, ((LONGINT)(32)))] = Texts_FontsThis((void*)name, ((LONGINT)(32))); + } + Files_Read(&msg.r, Files_Rider__typ, (void*)&col); + Files_Read(&msg.r, Files_Rider__typ, (void*)&voff); + Files_ReadLInt(&msg.r, Files_Rider__typ, &plen); + if (plen > 0) { + __NEW(p, Texts_PieceDesc); + p->file = f; + p->org = pos; + p->ascii = 0; + un = (Texts_Run)p; + un->len = plen; + } else { + LoadElem__17(&msg.r, Files_Rider__typ, pos - org, -plen, &e); + un = (Texts_Run)e; + un->len = 1; + } + un->col = col; + un->voff = voff; + pos += un->len; + u->next = un; + un->prev = u; + u = un; + Files_Read(&msg.r, Files_Rider__typ, (void*)&fno); + } + u->next = T->head; + T->head->prev = u; + T->cache = T->head; + T->corg = 0; + Files_ReadLInt(&msg.r, Files_Rider__typ, &T->len); + Files_Set(&*r, r__typ, f, Files_Pos(&msg.r, Files_Rider__typ) + T->len); + Load0__16_s = _s.lnk; +} + +void Texts_Load (Files_Rider *r, LONGINT *r__typ, Texts_Text T) +{ + INTEGER tag; + Files_ReadInt(&*r, r__typ, &tag); + if (tag != -4095) { + Files_Set(&*r, r__typ, Files_Base(&*r, r__typ), Files_Pos(&*r, r__typ) - 2); + } + Texts_Load0(&*r, r__typ, T); +} + +void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len) +{ + Files_File f = NIL; + Files_Rider r; + Texts_Run u = NIL; + Texts_Piece p = NIL; + CHAR tag, version; + LONGINT hlen; + __DUP(name, name__len, CHAR); + f = Files_Old(name, name__len); + if (f == NIL) { + f = Files_New((CHAR*)"", (LONGINT)1); + } + Files_Set(&r, Files_Rider__typ, f, ((LONGINT)(0))); + Files_Read(&r, Files_Rider__typ, (void*)&tag); + Files_Read(&r, Files_Rider__typ, (void*)&version); + if (tag == 0xf0 || (tag == 0x01 && version == 0xf0)) { + Texts_Load0(&r, Files_Rider__typ, T); + } else { + __NEW(u, Texts_RunDesc); + u->len = 2147483647; + u->fnt = NIL; + u->col = 15; + __NEW(p, Texts_PieceDesc); + if ((tag == 0xf7 && version == 0x07)) { + Files_Set(&r, Files_Rider__typ, f, ((LONGINT)(28))); + Files_ReadLInt(&r, Files_Rider__typ, &hlen); + Files_Set(&r, Files_Rider__typ, f, 22 + hlen); + Files_ReadLInt(&r, Files_Rider__typ, &T->len); + p->org = 26 + hlen; + } else { + T->len = Files_Length(f); + p->org = 0; + } + if (T->len > 0) { + p->len = T->len; + p->fnt = Texts_FontsDefault; + p->col = 15; + p->voff = 0; + p->file = f; + p->ascii = 1; + u->next = (Texts_Run)p; + u->prev = (Texts_Run)p; + p->next = u; + p->prev = u; + } else { + u->next = u; + u->prev = u; + } + T->head = u; + T->cache = T->head; + T->corg = 0; + } + __DEL(name); +} + +static struct Store__39 { + SHORTINT *ecnt; + Texts_FileMsg *msg; + Texts_IdentifyMsg *iden; + CHAR (*mods)[64][32], (*procs)[64][32]; + struct Store__39 *lnk; +} *Store__39_s; + +static void StoreElem__40 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, Texts_Elem e); + +static void StoreElem__40 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, Texts_Elem e) +{ + Files_Rider r1; + LONGINT org, span; + SHORTINT eno; + __COPY((*Store__39_s->iden).mod, (*Store__39_s->mods)[__X(*Store__39_s->ecnt, ((LONGINT)(64)))], ((LONGINT)(32))); + __COPY((*Store__39_s->iden).proc, (*Store__39_s->procs)[__X(*Store__39_s->ecnt, ((LONGINT)(64)))], ((LONGINT)(32))); + eno = 1; + while (__STRCMP((*Store__39_s->mods)[__X(eno, ((LONGINT)(64)))], (*Store__39_s->iden).mod) != 0 || __STRCMP((*Store__39_s->procs)[__X(eno, ((LONGINT)(64)))], (*Store__39_s->iden).proc) != 0) { + eno += 1; + } + Files_Set(&r1, Files_Rider__typ, Files_Base(&*r, r__typ), Files_Pos(&*r, r__typ)); + Files_WriteLInt(&*r, r__typ, ((LONGINT)(0))); + Files_WriteLInt(&*r, r__typ, ((LONGINT)(0))); + Files_WriteLInt(&*r, r__typ, ((LONGINT)(0))); + Files_Write(&*r, r__typ, eno); + if (eno == *Store__39_s->ecnt) { + *Store__39_s->ecnt += 1; + Files_WriteString(&*r, r__typ, (*Store__39_s->iden).mod, ((LONGINT)(32))); + Files_WriteString(&*r, r__typ, (*Store__39_s->iden).proc, ((LONGINT)(32))); + } + (*Store__39_s->msg).pos = pos; + org = Files_Pos(&*r, r__typ); + (*e->handle)(e, (void*)&*Store__39_s->msg, Texts_FileMsg__typ); + span = Files_Pos(&*r, r__typ) - org; + Files_WriteLInt(&r1, Files_Rider__typ, -span); + Files_WriteLInt(&r1, Files_Rider__typ, e->W); + Files_WriteLInt(&r1, Files_Rider__typ, e->H); +} + +void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T) +{ + Files_Rider r1; + Texts_Run u = NIL, un = NIL; + Texts_Elem e = NIL; + LONGINT org, pos, delta, hlen, rlen; + SHORTINT ecnt, fno, fcnt; + CHAR ch; + Texts_FileMsg msg; + Texts_IdentifyMsg iden; + CHAR mods[64][32], procs[64][32]; + Texts_FontsFont fnts[32]; + CHAR block[1024]; + struct Store__39 _s; + _s.ecnt = &ecnt; + _s.msg = &msg; + _s.iden = &iden; + _s.mods = (void*)mods; + _s.procs = (void*)procs; + _s.lnk = Store__39_s; + Store__39_s = &_s; + org = Files_Pos(&*r, r__typ); + msg.id = 1; + msg.r = *r; + Files_WriteLInt(&msg.r, Files_Rider__typ, ((LONGINT)(0))); + u = T->head->next; + pos = 0; + delta = 0; + fcnt = 1; + ecnt = 1; + while (u != T->head) { + if (__ISP(u, Texts_ElemDesc, 1)) { + iden.mod[0] = 0x00; + (*__GUARDP(u, Texts_ElemDesc, 1)->handle)(__GUARDP(u, Texts_ElemDesc, 1), (void*)&iden, Texts_IdentifyMsg__typ); + } else { + iden.mod[0] = 0x01; + } + if (iden.mod[0] != 0x00) { + fnts[__X(fcnt, ((LONGINT)(32)))] = u->fnt; + fno = 1; + while (__STRCMP(fnts[__X(fno, ((LONGINT)(32)))]->name, u->fnt->name) != 0) { + fno += 1; + } + Files_Write(&msg.r, Files_Rider__typ, fno); + if (fno == fcnt) { + fcnt += 1; + Files_WriteString(&msg.r, Files_Rider__typ, u->fnt->name, ((LONGINT)(32))); + } + Files_Write(&msg.r, Files_Rider__typ, u->col); + Files_Write(&msg.r, Files_Rider__typ, u->voff); + } + if (__ISP(u, Texts_PieceDesc, 1)) { + rlen = u->len; + un = u->next; + while ((((((__ISP(un, Texts_PieceDesc, 1) && un->fnt == u->fnt)) && un->col == u->col)) && un->voff == u->voff)) { + rlen += un->len; + un = un->next; + } + Files_WriteLInt(&msg.r, Files_Rider__typ, rlen); + pos += rlen; + u = un; + } else if (iden.mod[0] != 0x00) { + StoreElem__40(&msg.r, Files_Rider__typ, pos, __GUARDP(u, Texts_ElemDesc, 1)); + pos += 1; + u = u->next; + } else { + delta += 1; + u = u->next; + } + } + Files_Write(&msg.r, Files_Rider__typ, 0); + Files_WriteLInt(&msg.r, Files_Rider__typ, T->len - delta); + hlen = (Files_Pos(&msg.r, Files_Rider__typ) - org) + 2; + Files_Set(&r1, Files_Rider__typ, Files_Base(&msg.r, Files_Rider__typ), org); + Files_WriteLInt(&r1, Files_Rider__typ, hlen); + u = T->head->next; + while (u != T->head) { + if (__ISP(u, Texts_PieceDesc, 1)) { + if (__ISP(u, Texts_PieceDesc, 1)) { + if (((Texts_Piece)u)->ascii) { + Files_Set(&r1, Files_Rider__typ, ((Texts_Piece)u)->file, ((Texts_Piece)u)->org); + delta = ((Texts_Piece)u)->len; + while (delta > 0) { + Files_Read(&r1, Files_Rider__typ, (void*)&ch); + delta -= 1; + if (ch == 0x0a) { + Files_Write(&msg.r, Files_Rider__typ, 0x0d); + } else { + Files_Write(&msg.r, Files_Rider__typ, ch); + } + } + } else { + Files_Set(&r1, Files_Rider__typ, ((Texts_Piece)u)->file, ((Texts_Piece)u)->org); + delta = ((Texts_Piece)u)->len; + while (delta > 1024) { + Files_ReadBytes(&r1, Files_Rider__typ, (void*)block, ((LONGINT)(1024)), ((LONGINT)(1024))); + Files_WriteBytes(&msg.r, Files_Rider__typ, (void*)block, ((LONGINT)(1024)), ((LONGINT)(1024))); + delta -= 1024; + } + Files_ReadBytes(&r1, Files_Rider__typ, (void*)block, ((LONGINT)(1024)), delta); + Files_WriteBytes(&msg.r, Files_Rider__typ, (void*)block, ((LONGINT)(1024)), delta); + } + } else __WITHCHK; + } else { + iden.mod[0] = 0x00; + (*__GUARDP(u, Texts_ElemDesc, 1)->handle)(__GUARDP(u, Texts_ElemDesc, 1), (void*)&iden, Texts_IdentifyMsg__typ); + if (iden.mod[0] != 0x00) { + Files_Write(&msg.r, Files_Rider__typ, 0x1c); + } + } + u = u->next; + } + __GUARDEQR(r, r__typ, Files_Rider) = msg.r; + if (T->notify != NIL) { + (*T->notify)(T, 3, ((LONGINT)(0)), ((LONGINT)(0))); + } + Store__39_s = _s.lnk; +} + +void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len) +{ + Files_File f = NIL; + Files_Rider r; + INTEGER i, res; + CHAR bak[64]; + __DUP(name, name__len, CHAR); + f = Files_New(name, name__len); + Files_Set(&r, Files_Rider__typ, f, ((LONGINT)(0))); + Files_Write(&r, Files_Rider__typ, 0xf0); + Files_Write(&r, Files_Rider__typ, 0x01); + Texts_Store(&r, Files_Rider__typ, T); + i = 0; + while (name[__X(i, name__len)] != 0x00) { + i += 1; + } + __COPY(name, bak, ((LONGINT)(64))); + bak[__X(i, ((LONGINT)(64)))] = '.'; + bak[__X(i + 1, ((LONGINT)(64)))] = 'B'; + bak[__X(i + 2, ((LONGINT)(64)))] = 'a'; + bak[__X(i + 3, ((LONGINT)(64)))] = 'k'; + bak[__X(i + 4, ((LONGINT)(64)))] = 0x00; + Files_Rename(name, name__len, bak, ((LONGINT)(64)), &res); + Files_Register(f); + __DEL(name); +} + +static void EnumPtrs(void (*P)(void*)) +{ + P(Texts_new); + P(Texts_del); + P(Texts_FontsDefault); +} + +__TDESC(Texts_FontDesc, 1, 0) = {__TDFLDS("FontDesc", 32), {-4}}; +__TDESC(Texts_RunDesc, 1, 3) = {__TDFLDS("RunDesc", 20), {0, 4, 12, -16}}; +__TDESC(Texts_PieceDesc, 1, 4) = {__TDFLDS("PieceDesc", 28), {0, 4, 12, 20, -20}}; +__TDESC(Texts_ElemMsg, 1, 0) = {__TDFLDS("ElemMsg", 1), {-4}}; +__TDESC(Texts_ElemDesc, 1, 4) = {__TDFLDS("ElemDesc", 36), {0, 4, 12, 32, -20}}; +__TDESC(Texts_FileMsg, 1, 1) = {__TDFLDS("FileMsg", 28), {16, -8}}; +__TDESC(Texts_CopyMsg, 1, 1) = {__TDFLDS("CopyMsg", 4), {0, -8}}; +__TDESC(Texts_IdentifyMsg, 1, 0) = {__TDFLDS("IdentifyMsg", 64), {-4}}; +__TDESC(Texts_BufDesc, 1, 1) = {__TDFLDS("BufDesc", 8), {4, -8}}; +__TDESC(Texts_TextDesc, 1, 2) = {__TDFLDS("TextDesc", 20), {8, 12, -12}}; +__TDESC(Texts_Reader, 1, 4) = {__TDFLDS("Reader", 48), {4, 12, 24, 36, -20}}; +__TDESC(Texts_Scanner, 1, 4) = {__TDFLDS("Scanner", 140), {4, 12, 24, 36, -20}}; +__TDESC(Texts_Writer, 1, 4) = {__TDFLDS("Writer", 36), {0, 4, 20, 32, -20}}; +__TDESC(Texts__1, 1, 5) = {__TDFLDS("", 112), {0, 4, 12, 32, 36, -24}}; + +export void *Texts__init(void) +{ + __DEFMOD; + __MODULE_IMPORT(Files); + __MODULE_IMPORT(Modules); + __MODULE_IMPORT(Reals); + __REGMOD("Texts", EnumPtrs); + __INITYP(Texts_FontDesc, Texts_FontDesc, 0); + __INITYP(Texts_RunDesc, Texts_RunDesc, 0); + __INITYP(Texts_PieceDesc, Texts_RunDesc, 1); + __INITYP(Texts_ElemMsg, Texts_ElemMsg, 0); + __INITYP(Texts_ElemDesc, Texts_RunDesc, 1); + __INITYP(Texts_FileMsg, Texts_ElemMsg, 1); + __INITYP(Texts_CopyMsg, Texts_ElemMsg, 1); + __INITYP(Texts_IdentifyMsg, Texts_ElemMsg, 1); + __INITYP(Texts_BufDesc, Texts_BufDesc, 0); + __INITYP(Texts_TextDesc, Texts_TextDesc, 0); + __INITYP(Texts_Reader, Texts_Reader, 0); + __INITYP(Texts_Scanner, Texts_Reader, 1); + __INITYP(Texts_Writer, Texts_Writer, 0); + __INITYP(Texts__1, Texts_ElemDesc, 2); +/* BEGIN */ + Texts_del = NIL; + __NEW(Texts_FontsDefault, Texts_FontDesc); + __MOVE("Syntax10.Scn.Fnt", Texts_FontsDefault->name, 17); + __ENDMOD; +} diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h new file mode 100644 index 00000000..354c7ce7 --- /dev/null +++ b/bootstrap/unix-44/Texts.h @@ -0,0 +1,172 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ + +#ifndef Texts__h +#define Texts__h + +#include "SYSTEM.h" +#include "Files.h" + +typedef + struct Texts_BufDesc { + LONGINT len; + char _prvt0[4]; + } Texts_BufDesc; + +typedef + Texts_BufDesc *Texts_Buffer; + +typedef + struct Texts_ElemMsg { + char _prvt0[1]; + } Texts_ElemMsg; + +typedef + struct Texts_ElemDesc *Texts_Elem; + +typedef + struct Texts_CopyMsg { /* Texts_ElemMsg */ + Texts_Elem e; + } Texts_CopyMsg; + +typedef + struct Texts_RunDesc { + LONGINT _prvt0; + char _prvt1[15]; + } Texts_RunDesc; + +typedef + void (*Texts_Handler)(Texts_Elem, Texts_ElemMsg*, LONGINT *); + +typedef + struct Texts_ElemDesc { + char _prvt0[20]; + LONGINT W, H; + Texts_Handler handle; + char _prvt1[4]; + } Texts_ElemDesc; + +typedef + struct Texts_FileMsg { /* Texts_ElemMsg */ + INTEGER id; + LONGINT pos; + Files_Rider r; + } Texts_FileMsg; + +typedef + struct Texts_FontDesc { + char _prvt0[32]; + } Texts_FontDesc; + +typedef + Texts_FontDesc *Texts_FontsFont; + +typedef + struct Texts_IdentifyMsg { /* Texts_ElemMsg */ + CHAR mod[32], proc[32]; + } Texts_IdentifyMsg; + +typedef + struct Texts_TextDesc *Texts_Text; + +typedef + void (*Texts_Notifier)(Texts_Text, INTEGER, LONGINT, LONGINT); + +typedef + struct Texts_Reader { + BOOLEAN eot; + Texts_FontsFont fnt; + SHORTINT col, voff; + Texts_Elem elem; + char _prvt0[32]; + } Texts_Reader; + +typedef + struct Texts_Scanner { /* Texts_Reader */ + BOOLEAN eot; + Texts_FontsFont fnt; + SHORTINT col, voff; + Texts_Elem elem; + char _prvt0[32]; + CHAR nextCh; + INTEGER line, class; + LONGINT i; + REAL x; + LONGREAL y; + CHAR c; + SHORTINT len; + CHAR s[64]; + } Texts_Scanner; + +typedef + struct Texts_TextDesc { + LONGINT len; + Texts_Notifier notify; + char _prvt0[12]; + } Texts_TextDesc; + +typedef + struct Texts_Writer { + Texts_Buffer buf; + Texts_FontsFont fnt; + SHORTINT col, voff; + char _prvt0[26]; + } Texts_Writer; + + +import Texts_Elem Texts_new; + +import LONGINT *Texts_FontDesc__typ; +import LONGINT *Texts_RunDesc__typ; +import LONGINT *Texts_ElemMsg__typ; +import LONGINT *Texts_ElemDesc__typ; +import LONGINT *Texts_FileMsg__typ; +import LONGINT *Texts_CopyMsg__typ; +import LONGINT *Texts_IdentifyMsg__typ; +import LONGINT *Texts_BufDesc__typ; +import LONGINT *Texts_TextDesc__typ; +import LONGINT *Texts_Reader__typ; +import LONGINT *Texts_Scanner__typ; +import LONGINT *Texts_Writer__typ; + +import void Texts_Append (Texts_Text T, Texts_Buffer B); +import void Texts_ChangeLooks (Texts_Text T, LONGINT beg, LONGINT end, SET sel, Texts_FontsFont fnt, SHORTINT col, SHORTINT voff); +import void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len); +import void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); +import void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); +import void Texts_Delete (Texts_Text T, LONGINT beg, LONGINT end); +import Texts_Text Texts_ElemBase (Texts_Elem E); +import LONGINT Texts_ElemPos (Texts_Elem E); +import void Texts_Insert (Texts_Text T, LONGINT pos, Texts_Buffer B); +import void Texts_Load (Files_Rider *r, LONGINT *r__typ, Texts_Text T); +import void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len); +import void Texts_OpenBuf (Texts_Buffer B); +import void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, LONGINT pos); +import void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, LONGINT pos); +import void Texts_OpenWriter (Texts_Writer *W, LONGINT *W__typ); +import LONGINT Texts_Pos (Texts_Reader *R, LONGINT *R__typ); +import void Texts_Read (Texts_Reader *R, LONGINT *R__typ, CHAR *ch); +import void Texts_ReadElem (Texts_Reader *R, LONGINT *R__typ); +import void Texts_ReadPrevElem (Texts_Reader *R, LONGINT *R__typ); +import void Texts_Recall (Texts_Buffer *B); +import void Texts_Save (Texts_Text T, LONGINT beg, LONGINT end, Texts_Buffer B); +import void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ); +import void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, SHORTINT col); +import void Texts_SetFont (Texts_Writer *W, LONGINT *W__typ, Texts_FontsFont fnt); +import void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, SHORTINT voff); +import void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T); +import void Texts_Write (Texts_Writer *W, LONGINT *W__typ, CHAR ch); +import void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, LONGINT t, LONGINT d); +import void Texts_WriteElem (Texts_Writer *W, LONGINT *W__typ, Texts_Elem e); +import void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, LONGINT x); +import void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n); +import void Texts_WriteLn (Texts_Writer *W, LONGINT *W__typ); +import void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER n); +import void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x); +import void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n); +import void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n, INTEGER k); +import void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x); +import void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__len); +import void *Texts__init(void); + + +#endif diff --git a/bootstrap/unix-44/Vishap.c b/bootstrap/unix-44/Vishap.c new file mode 100644 index 00000000..2b9c3901 --- /dev/null +++ b/bootstrap/unix-44/Vishap.c @@ -0,0 +1,168 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkamSf */ +#include "SYSTEM.h" +#include "Configuration.h" +#include "Heap.h" +#include "OPB.h" +#include "OPC.h" +#include "OPM.h" +#include "OPP.h" +#include "OPT.h" +#include "OPV.h" +#include "Platform.h" +#include "Strings.h" +#include "extTools.h" +#include "vt100.h" + + +static CHAR Vishap_mname[256]; + + +export void Vishap_Module (BOOLEAN *done); +static void Vishap_PropagateElementaryTypeSizes (void); +export void Vishap_Translate (void); +static void Vishap_Trap (INTEGER sig); + + +void Vishap_Module (BOOLEAN *done) +{ + BOOLEAN ext, new; + OPT_Node p = NIL; + OPP_Module(&p, OPM_opt); + if (OPM_noerr) { + OPV_Init(); + OPV_AdrAndSize(OPT_topScope); + OPT_Export(&ext, &new); + if (OPM_noerr) { + OPM_OpenFiles((void*)OPT_SelfName, ((LONGINT)(256))); + OPC_Init(); + OPV_Module(p); + if (OPM_noerr) { + if (((OPM_mainProg || OPM_mainLinkStat) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { + OPM_DeleteNewSym(); + if (!OPM_notColorOutput) { + vt100_SetAttr((CHAR*)"32m", (LONGINT)4); + } + OPM_LogWStr((CHAR*)" Main program.", (LONGINT)16); + if (!OPM_notColorOutput) { + vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + } + } else { + if (new) { + if (!OPM_notColorOutput) { + vt100_SetAttr((CHAR*)"32m", (LONGINT)4); + } + OPM_LogWStr((CHAR*)" New symbol file.", (LONGINT)19); + if (!OPM_notColorOutput) { + vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + } + OPM_RegisterNewSym(); + } else if (ext) { + OPM_LogWStr((CHAR*)" Extended symbol file.", (LONGINT)24); + OPM_RegisterNewSym(); + } + } + } else { + OPM_DeleteNewSym(); + } + } + } + OPM_CloseFiles(); + OPT_Close(); + OPM_LogWLn(); + *done = OPM_noerr; +} + +static void Vishap_PropagateElementaryTypeSizes (void) +{ + OPT_bytetyp->size = OPM_ByteSize; + OPT_sysptrtyp->size = OPM_PointerSize; + OPT_chartyp->size = OPM_CharSize; + OPT_settyp->size = OPM_SetSize; + OPT_realtyp->size = OPM_RealSize; + OPT_inttyp->size = OPM_IntSize; + OPT_linttyp->size = OPM_LIntSize; + OPT_lrltyp->size = OPM_LRealSize; + OPT_sinttyp->size = OPM_SIntSize; + OPT_booltyp->size = OPM_BoolSize; +} + +void Vishap_Translate (void) +{ + BOOLEAN done; + CHAR modulesobj[2048]; + modulesobj[0] = 0x00; + if (OPM_OpenPar()) { + for (;;) { + OPM_Init(&done, (void*)Vishap_mname, ((LONGINT)(256))); + if (!done) { + return; + } + OPM_InitOptions(); + Vishap_PropagateElementaryTypeSizes(); + Heap_GC(0); + Vishap_Module(&done); + if (!done) { + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Module compilation failed.", (LONGINT)27); + OPM_LogWLn(); + Platform_Exit(1); + } + if (!OPM_dontAsm) { + if (OPM_dontLink) { + extTools_Assemble(OPM_modName, ((LONGINT)(32))); + } else { + if (!(OPM_mainProg || OPM_mainLinkStat)) { + extTools_Assemble(OPM_modName, ((LONGINT)(32))); + Strings_Append((CHAR*)" ", (LONGINT)2, (void*)modulesobj, ((LONGINT)(2048))); + Strings_Append(OPM_modName, ((LONGINT)(32)), (void*)modulesobj, ((LONGINT)(2048))); + Strings_Append((CHAR*)".o", (LONGINT)3, (void*)modulesobj, ((LONGINT)(2048))); + } else { + extTools_LinkMain((void*)OPM_modName, ((LONGINT)(32)), OPM_mainLinkStat, modulesobj, ((LONGINT)(2048))); + } + } + } + } + } +} + +static void Vishap_Trap (INTEGER sig) +{ + Heap_FINALL(); + if (sig == 3) { + Platform_Exit(0); + } else { + if ((sig == 4 && Platform_HaltCode == -15)) { + OPM_LogWStr((CHAR*)" --- Vishap Oberon: internal error", (LONGINT)35); + OPM_LogWLn(); + } + Platform_Exit(2); + } +} + + +export int main(int argc, char **argv) +{ + __INIT(argc, argv); + __MODULE_IMPORT(Configuration); + __MODULE_IMPORT(Heap); + __MODULE_IMPORT(OPB); + __MODULE_IMPORT(OPC); + __MODULE_IMPORT(OPM); + __MODULE_IMPORT(OPP); + __MODULE_IMPORT(OPT); + __MODULE_IMPORT(OPV); + __MODULE_IMPORT(Platform); + __MODULE_IMPORT(Strings); + __MODULE_IMPORT(extTools); + __MODULE_IMPORT(vt100); + __REGMAIN("Vishap", 0); + __REGCMD("Translate", Vishap_Translate); +/* BEGIN */ + Platform_SetInterruptHandler(Vishap_Trap); + Platform_SetQuitHandler(Vishap_Trap); + Platform_SetBadInstructionHandler(Vishap_Trap); + OPB_typSize = OPV_TypSize; + OPT_typSize = OPV_TypSize; + Vishap_Translate(); + __FINI; +} diff --git a/bootstrap/unix-44/WindowsWrapper.h b/bootstrap/unix-44/WindowsWrapper.h new file mode 100644 index 00000000..cdb8714c --- /dev/null +++ b/bootstrap/unix-44/WindowsWrapper.h @@ -0,0 +1,9 @@ +// WindowsWrapper.h +// +// Includes Windows.h while avoiding conflicts with Oberon types. + +#undef BOOLEAN +#undef CHAR +#include +#define BOOLEAN char +#define CHAR unsigned char diff --git a/bootstrap/unix-44/errors.c b/bootstrap/unix-44/errors.c new file mode 100644 index 00000000..25a074a9 --- /dev/null +++ b/bootstrap/unix-44/errors.c @@ -0,0 +1,198 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +#include "SYSTEM.h" + +typedef + CHAR errors_string[128]; + + +export errors_string errors_errors[350]; + + + + + +export void *errors__init(void) +{ + __DEFMOD; + __REGMOD("errors", 0); +/* BEGIN */ + __MOVE("undeclared identifier", errors_errors[0], 22); + __MOVE("multiply defined identifier", errors_errors[1], 28); + __MOVE("illegal character in number", errors_errors[2], 28); + __MOVE("illegal character in string", errors_errors[3], 28); + __MOVE("identifier does not match procedure name", errors_errors[4], 41); + __MOVE("comment not closed", errors_errors[5], 19); + errors_errors[6][0] = 0x00; + errors_errors[7][0] = 0x00; + errors_errors[8][0] = 0x00; + __MOVE("\'=\' expected", errors_errors[9], 13); + errors_errors[10][0] = 0x00; + errors_errors[11][0] = 0x00; + __MOVE("type definition starts with incorrect symbol", errors_errors[12], 45); + __MOVE("factor starts with incorrect symbol", errors_errors[13], 36); + __MOVE("statement starts with incorrect symbol", errors_errors[14], 39); + __MOVE("declaration followed by incorrect symbol", errors_errors[15], 41); + __MOVE("MODULE expected", errors_errors[16], 16); + errors_errors[17][0] = 0x00; + __MOVE("\'.\' missing", errors_errors[18], 12); + __MOVE("\',\' missing", errors_errors[19], 12); + __MOVE("\':\' missing", errors_errors[20], 12); + errors_errors[21][0] = 0x00; + __MOVE("\')\' missing", errors_errors[22], 12); + __MOVE("\']\' missing", errors_errors[23], 12); + __MOVE("\'}\' missing", errors_errors[24], 12); + __MOVE("OF missing", errors_errors[25], 11); + __MOVE("THEN missing", errors_errors[26], 13); + __MOVE("DO missing", errors_errors[27], 11); + __MOVE("TO missing", errors_errors[28], 11); + errors_errors[29][0] = 0x00; + __MOVE("\'(\' missing", errors_errors[30], 12); + errors_errors[31][0] = 0x00; + errors_errors[32][0] = 0x00; + errors_errors[33][0] = 0x00; + __MOVE("\':=\' missing", errors_errors[34], 13); + __MOVE("\',\' or OF expected", errors_errors[35], 19); + errors_errors[36][0] = 0x00; + errors_errors[37][0] = 0x00; + __MOVE("identifier expected", errors_errors[38], 20); + __MOVE("\';\' missing", errors_errors[39], 12); + errors_errors[40][0] = 0x00; + __MOVE("END missing", errors_errors[41], 12); + errors_errors[42][0] = 0x00; + errors_errors[43][0] = 0x00; + __MOVE("UNTIL missing", errors_errors[44], 14); + errors_errors[45][0] = 0x00; + __MOVE("EXIT not within loop statement", errors_errors[46], 31); + __MOVE("illegally marked identifier", errors_errors[47], 28); + errors_errors[48][0] = 0x00; + errors_errors[49][0] = 0x00; + __MOVE("expression should be constant", errors_errors[50], 30); + __MOVE("constant not an integer", errors_errors[51], 24); + __MOVE("identifier does not denote a type", errors_errors[52], 34); + __MOVE("identifier does not denote a record type", errors_errors[53], 41); + __MOVE("result type of procedure is not a basic type", errors_errors[54], 45); + __MOVE("procedure call of a function", errors_errors[55], 29); + __MOVE("assignment to non-variable", errors_errors[56], 27); + __MOVE("pointer not bound to record or array type", errors_errors[57], 42); + __MOVE("recursive type definition", errors_errors[58], 26); + __MOVE("illegal open array parameter", errors_errors[59], 29); + __MOVE("wrong type of case label", errors_errors[60], 25); + __MOVE("inadmissible type of case label", errors_errors[61], 32); + __MOVE("case label defined more than once", errors_errors[62], 34); + __MOVE("illegal value of constant", errors_errors[63], 26); + __MOVE("more actual than formal parameters", errors_errors[64], 35); + __MOVE("fewer actual than formal parameters", errors_errors[65], 36); + __MOVE("element types of actual array and formal open array differ", errors_errors[66], 59); + __MOVE("actual parameter corresponding to open array is not an array", errors_errors[67], 61); + __MOVE("control variable must be integer", errors_errors[68], 33); + __MOVE("parameter must be an integer constant", errors_errors[69], 38); + __MOVE("pointer or VAR record required as formal receiver", errors_errors[70], 50); + __MOVE("pointer expected as actual receiver", errors_errors[71], 36); + __MOVE("procedure must be bound to a record of the same scope", errors_errors[72], 54); + __MOVE("procedure must have level 0", errors_errors[73], 28); + __MOVE("procedure unknown in base type", errors_errors[74], 31); + __MOVE("invalid call of base procedure", errors_errors[75], 31); + __MOVE("this variable (field) is read only", errors_errors[76], 35); + __MOVE("object is not a record", errors_errors[77], 23); + __MOVE("dereferenced object is not a variable", errors_errors[78], 38); + __MOVE("indexed object is not a variable", errors_errors[79], 33); + __MOVE("index expression is not an integer", errors_errors[80], 35); + __MOVE("index out of specified bounds", errors_errors[81], 30); + __MOVE("indexed variable is not an array", errors_errors[82], 33); + __MOVE("undefined record field", errors_errors[83], 23); + __MOVE("dereferenced variable is not a pointer", errors_errors[84], 39); + __MOVE("guard or test type is not an extension of variable type", errors_errors[85], 56); + __MOVE("guard or testtype is not a pointer", errors_errors[86], 35); + __MOVE("guarded or tested variable is neither a pointer nor a VAR-parameter record", errors_errors[87], 75); + __MOVE("open array not allowed as variable, record field or array element", errors_errors[88], 66); + errors_errors[89][0] = 0x00; + errors_errors[90][0] = 0x00; + errors_errors[91][0] = 0x00; + __MOVE("operand of IN not an integer, or not a set", errors_errors[92], 43); + __MOVE("set element type is not an integer", errors_errors[93], 35); + __MOVE("operand of & is not of type BOOLEAN", errors_errors[94], 36); + __MOVE("operand of OR is not of type BOOLEAN", errors_errors[95], 37); + __MOVE("operand not applicable to (unary) +", errors_errors[96], 36); + __MOVE("operand not applicable to (unary) -", errors_errors[97], 36); + __MOVE("operand of ~ is not of type BOOLEAN", errors_errors[98], 36); + __MOVE("ASSERT fault", errors_errors[99], 13); + __MOVE("incompatible operands of dyadic operator", errors_errors[100], 41); + __MOVE("operand type inapplicable to *", errors_errors[101], 31); + __MOVE("operand type inapplicable to /", errors_errors[102], 31); + __MOVE("operand type inapplicable to DIV", errors_errors[103], 33); + __MOVE("operand type inapplicable to MOD", errors_errors[104], 33); + __MOVE("operand type inapplicable to +", errors_errors[105], 31); + __MOVE("operand type inapplicable to -", errors_errors[106], 31); + __MOVE("operand type inapplicable to = or #", errors_errors[107], 36); + __MOVE("operand type inapplicable to relation", errors_errors[108], 38); + __MOVE("overriding method must be exported", errors_errors[109], 35); + __MOVE("operand is not a type", errors_errors[110], 22); + __MOVE("operand inapplicable to (this) function", errors_errors[111], 40); + __MOVE("operand is not a variable", errors_errors[112], 26); + __MOVE("incompatible assignment", errors_errors[113], 24); + __MOVE("string too long to be assigned", errors_errors[114], 31); + __MOVE("parameter doesn\'t match", errors_errors[115], 24); + __MOVE("number of parameters doesn\'t match", errors_errors[116], 35); + __MOVE("result type doesn\'t match", errors_errors[117], 26); + __MOVE("export mark doesn\'t match with forward declaration", errors_errors[118], 51); + __MOVE("redefinition textually precedes procedure bound to base type", errors_errors[119], 61); + __MOVE("type of expression following IF, WHILE, UNTIL or ASSERT is not BOOLEAN", errors_errors[120], 71); + __MOVE("called object is not a procedure (or is an interrupt procedure)", errors_errors[121], 64); + __MOVE("actual VAR-parameter is not a variable", errors_errors[122], 39); + __MOVE("type of actual parameter is not identical with that of formal VAR-parameter", errors_errors[123], 76); + __MOVE("type of result expression differs from that of procedure", errors_errors[124], 57); + __MOVE("type of case expression is neither INTEGER nor CHAR", errors_errors[125], 52); + __MOVE("this expression cannot be a type or a procedure", errors_errors[126], 48); + __MOVE("illegal use of object", errors_errors[127], 22); + __MOVE("unsatisfied forward reference", errors_errors[128], 30); + __MOVE("unsatisfied forward procedure", errors_errors[129], 30); + __MOVE("WITH clause does not specify a variable", errors_errors[130], 40); + __MOVE("LEN not applied to array", errors_errors[131], 25); + __MOVE("dimension in LEN too large or negative", errors_errors[132], 39); + __MOVE("SYSTEM not imported", errors_errors[135], 20); + __MOVE("key inconsistency of imported module", errors_errors[150], 37); + __MOVE("incorrect symbol file", errors_errors[151], 22); + __MOVE("symbol file of imported module not found", errors_errors[152], 41); + __MOVE("object or symbol file not opened (disk full\?)", errors_errors[153], 46); + __MOVE("recursive import not allowed", errors_errors[154], 29); + __MOVE("generation of new symbol file not allowed", errors_errors[155], 42); + __MOVE("parameter file not found", errors_errors[156], 25); + __MOVE("syntax error in parameter file", errors_errors[157], 31); + __MOVE("not yet implemented", errors_errors[200], 20); + __MOVE("lower bound of set range greater than higher bound", errors_errors[201], 51); + __MOVE("set element greater than MAX(SET) or less than 0", errors_errors[202], 49); + __MOVE("number too large", errors_errors[203], 17); + __MOVE("product too large", errors_errors[204], 18); + __MOVE("division by zero", errors_errors[205], 17); + __MOVE("sum too large", errors_errors[206], 14); + __MOVE("difference too large", errors_errors[207], 21); + __MOVE("overflow in arithmetic shift", errors_errors[208], 29); + __MOVE("case range too large", errors_errors[209], 21); + __MOVE("too many cases in case statement", errors_errors[213], 33); + __MOVE("illegal value of parameter (0 <= p < 256)", errors_errors[218], 42); + __MOVE("machine registers cannot be accessed", errors_errors[219], 37); + __MOVE("illegal value of parameter", errors_errors[220], 27); + __MOVE("too many pointers in a record", errors_errors[221], 30); + __MOVE("too many global pointers", errors_errors[222], 25); + __MOVE("too many record types", errors_errors[223], 22); + __MOVE("too many pointer types", errors_errors[224], 23); + __MOVE("address of pointer variable too large (move forward in text)", errors_errors[225], 61); + __MOVE("too many exported procedures", errors_errors[226], 29); + __MOVE("too many imported modules", errors_errors[227], 26); + __MOVE("too many exported structures", errors_errors[228], 29); + __MOVE("too many nested records for import", errors_errors[229], 35); + __MOVE("too many constants (strings) in module", errors_errors[230], 39); + __MOVE("too many link table entries (external procedures)", errors_errors[231], 50); + __MOVE("too many commands in module", errors_errors[232], 28); + __MOVE("record extension hierarchy too high", errors_errors[233], 36); + __MOVE("export of recursive type not allowed", errors_errors[234], 37); + __MOVE("identifier too long", errors_errors[240], 20); + __MOVE("string too long", errors_errors[241], 16); + __MOVE("address overflow", errors_errors[242], 17); + __MOVE("cyclic type definition not allowed", errors_errors[244], 35); + __MOVE("guarded pointer variable may be manipulated by non-local operations; use auxiliary pointer variable", errors_errors[245], 100); + __MOVE("implicit type cast", errors_errors[301], 19); + __MOVE("inappropriate symbol file ignored", errors_errors[306], 34); + __MOVE("no ELSE symbol after CASE statement sequence may lead to trap", errors_errors[307], 62); + __ENDMOD; +} diff --git a/bootstrap/unix-44/errors.h b/bootstrap/unix-44/errors.h new file mode 100644 index 00000000..c4fe8850 --- /dev/null +++ b/bootstrap/unix-44/errors.h @@ -0,0 +1,18 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ + +#ifndef errors__h +#define errors__h + +#include "SYSTEM.h" + +typedef + CHAR errors_string[128]; + + +import errors_string errors_errors[350]; + + +import void *errors__init(void); + + +#endif diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c new file mode 100644 index 00000000..6f1a6654 --- /dev/null +++ b/bootstrap/unix-44/extTools.c @@ -0,0 +1,112 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +#include "SYSTEM.h" +#include "Configuration.h" +#include "Console.h" +#include "OPM.h" +#include "Platform.h" +#include "Strings.h" + + +static CHAR extTools_compilationOptions[1023], extTools_CFLAGS[1023]; + + +export void extTools_Assemble (CHAR *moduleName, LONGINT moduleName__len); +export void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN statically, CHAR *additionalopts, LONGINT additionalopts__len); +static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGINT cmd__len); + + +static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGINT cmd__len) +{ + INTEGER r, status, exitcode; + __DUP(title, title__len, CHAR); + __DUP(cmd, cmd__len, CHAR); + if (OPM_Verbose) { + Console_String(title, title__len); + Console_String(cmd, cmd__len); + Console_Ln(); + } + r = Platform_System(cmd, cmd__len); + status = __MASK(r, -128); + exitcode = __ASHR(r, 8); + if (exitcode > 127) { + exitcode = exitcode - 256; + } + if (r != 0) { + Console_String(title, title__len); + Console_String(cmd, cmd__len); + Console_Ln(); + Console_String((CHAR*)"-- failed: status ", (LONGINT)19); + Console_Int(status, ((LONGINT)(1))); + Console_String((CHAR*)", exitcode ", (LONGINT)12); + Console_Int(exitcode, ((LONGINT)(1))); + Console_String((CHAR*)".", (LONGINT)2); + Console_Ln(); + if ((status == 0 && exitcode == 127)) { + Console_String((CHAR*)"Is the C compiler in the current command path\?", (LONGINT)47); + Console_Ln(); + } + if (status != 0) { + Platform_Halt(status); + } else { + Platform_Halt(exitcode); + } + } + __DEL(title); + __DEL(cmd); +} + +void extTools_Assemble (CHAR *moduleName, LONGINT moduleName__len) +{ + CHAR cmd[1023]; + __DUP(moduleName, moduleName__len, CHAR); + __MOVE("gcc -g", cmd, 7); + Strings_Append(extTools_compilationOptions, ((LONGINT)(1023)), (void*)cmd, ((LONGINT)(1023))); + Strings_Append((CHAR*)"-c ", (LONGINT)4, (void*)cmd, ((LONGINT)(1023))); + Strings_Append(moduleName, moduleName__len, (void*)cmd, ((LONGINT)(1023))); + Strings_Append((CHAR*)".c", (LONGINT)3, (void*)cmd, ((LONGINT)(1023))); + extTools_execute((CHAR*)"Assemble: ", (LONGINT)11, cmd, ((LONGINT)(1023))); + __DEL(moduleName); +} + +void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN statically, CHAR *additionalopts, LONGINT additionalopts__len) +{ + CHAR cmd[1023]; + __DUP(additionalopts, additionalopts__len, CHAR); + __MOVE("gcc -g", cmd, 7); + Strings_Append((CHAR*)" ", (LONGINT)2, (void*)cmd, ((LONGINT)(1023))); + Strings_Append(extTools_compilationOptions, ((LONGINT)(1023)), (void*)cmd, ((LONGINT)(1023))); + Strings_Append(moduleName, moduleName__len, (void*)cmd, ((LONGINT)(1023))); + Strings_Append((CHAR*)".c ", (LONGINT)4, (void*)cmd, ((LONGINT)(1023))); + Strings_Append(additionalopts, additionalopts__len, (void*)cmd, ((LONGINT)(1023))); + if (statically) { + Strings_Append((CHAR*)"-static", (LONGINT)8, (void*)cmd, ((LONGINT)(1023))); + } + Strings_Append((CHAR*)" -o ", (LONGINT)5, (void*)cmd, ((LONGINT)(1023))); + Strings_Append(moduleName, moduleName__len, (void*)cmd, ((LONGINT)(1023))); + Strings_Append((CHAR*)" -L\"", (LONGINT)5, (void*)cmd, ((LONGINT)(1023))); + Strings_Append((CHAR*)"/opt/voc", (LONGINT)9, (void*)cmd, ((LONGINT)(1023))); + Strings_Append((CHAR*)"/lib\"", (LONGINT)6, (void*)cmd, ((LONGINT)(1023))); + Strings_Append((CHAR*)" -l voc", (LONGINT)8, (void*)cmd, ((LONGINT)(1023))); + extTools_execute((CHAR*)"Assemble and link: ", (LONGINT)20, cmd, ((LONGINT)(1023))); + __DEL(additionalopts); +} + + +export void *extTools__init(void) +{ + __DEFMOD; + __MODULE_IMPORT(Configuration); + __MODULE_IMPORT(Console); + __MODULE_IMPORT(OPM); + __MODULE_IMPORT(Platform); + __MODULE_IMPORT(Strings); + __REGMOD("extTools", 0); +/* BEGIN */ + Strings_Append((CHAR*)" -I \"", (LONGINT)6, (void*)extTools_compilationOptions, ((LONGINT)(1023))); + Strings_Append((CHAR*)"/opt/voc", (LONGINT)9, (void*)extTools_compilationOptions, ((LONGINT)(1023))); + Strings_Append((CHAR*)"/include\" ", (LONGINT)11, (void*)extTools_compilationOptions, ((LONGINT)(1023))); + Platform_GetEnv((CHAR*)"CFLAGS", (LONGINT)7, (void*)extTools_CFLAGS, ((LONGINT)(1023))); + Strings_Append(extTools_CFLAGS, ((LONGINT)(1023)), (void*)extTools_compilationOptions, ((LONGINT)(1023))); + Strings_Append((CHAR*)" ", (LONGINT)2, (void*)extTools_compilationOptions, ((LONGINT)(1023))); + __ENDMOD; +} diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h new file mode 100644 index 00000000..95d07ddd --- /dev/null +++ b/bootstrap/unix-44/extTools.h @@ -0,0 +1,16 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ + +#ifndef extTools__h +#define extTools__h + +#include "SYSTEM.h" + + + + +import void extTools_Assemble (CHAR *moduleName, LONGINT moduleName__len); +import void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN statically, CHAR *additionalopts, LONGINT additionalopts__len); +import void *extTools__init(void); + + +#endif diff --git a/bootstrap/unix-44/vt100.c b/bootstrap/unix-44/vt100.c new file mode 100644 index 00000000..649ea068 --- /dev/null +++ b/bootstrap/unix-44/vt100.c @@ -0,0 +1,258 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +#include "SYSTEM.h" +#include "Console.h" +#include "Strings.h" + + +export CHAR vt100_CSI[5]; +static CHAR vt100_tmpstr[32]; + + +export void vt100_CHA (INTEGER n); +export void vt100_CNL (INTEGER n); +export void vt100_CPL (INTEGER n); +export void vt100_CUB (INTEGER n); +export void vt100_CUD (INTEGER n); +export void vt100_CUF (INTEGER n); +export void vt100_CUP (INTEGER n, INTEGER m); +export void vt100_CUU (INTEGER n); +export void vt100_DECTCEMh (void); +export void vt100_DECTCEMl (void); +export void vt100_DSR (INTEGER n); +export void vt100_ED (INTEGER n); +export void vt100_EL (INTEGER n); +static void vt100_EscSeq (INTEGER n, CHAR *letter, LONGINT letter__len); +static void vt100_EscSeq0 (CHAR *letter, LONGINT letter__len); +static void vt100_EscSeq2 (INTEGER n, INTEGER m, CHAR *letter, LONGINT letter__len); +static void vt100_EscSeqSwapped (INTEGER n, CHAR *letter, LONGINT letter__len); +export void vt100_HVP (INTEGER n, INTEGER m); +export void vt100_IntToStr (LONGINT int_, CHAR *str, LONGINT str__len); +export void vt100_RCP (void); +static void vt100_Reverse0 (CHAR *str, LONGINT str__len, INTEGER start, INTEGER end); +export void vt100_SCP (void); +export void vt100_SD (INTEGER n); +export void vt100_SGR (INTEGER n); +export void vt100_SGR2 (INTEGER n, INTEGER m); +export void vt100_SU (INTEGER n); +export void vt100_SetAttr (CHAR *attr, LONGINT attr__len); + + +static void vt100_Reverse0 (CHAR *str, LONGINT str__len, INTEGER start, INTEGER end) +{ + CHAR h; + while (start < end) { + h = str[__X(start, str__len)]; + str[__X(start, str__len)] = str[__X(end, str__len)]; + str[__X(end, str__len)] = h; + start += 1; + end -= 1; + } +} + +void vt100_IntToStr (LONGINT int_, CHAR *str, LONGINT str__len) +{ + CHAR b[21]; + INTEGER s, e; + SHORTINT maxLength; + maxLength = 11; + if (int_ == (-2147483647-1)) { + __MOVE("-2147483648", b, 12); + e = 11; + } else { + if (int_ < 0) { + b[0] = '-'; + int_ = -int_; + s = 1; + } else { + s = 0; + } + e = s; + do { + b[__X(e, ((LONGINT)(21)))] = (CHAR)(__MOD(int_, 10) + 48); + int_ = __DIV(int_, 10); + e += 1; + } while (!(int_ == 0)); + b[__X(e, ((LONGINT)(21)))] = 0x00; + vt100_Reverse0((void*)b, ((LONGINT)(21)), s, e - 1); + } + __COPY(b, str, str__len); +} + +static void vt100_EscSeq0 (CHAR *letter, LONGINT letter__len) +{ + CHAR cmd[9]; + __DUP(letter, letter__len, CHAR); + __COPY(vt100_CSI, cmd, ((LONGINT)(9))); + Strings_Append(letter, letter__len, (void*)cmd, ((LONGINT)(9))); + Console_String(cmd, ((LONGINT)(9))); + __DEL(letter); +} + +static void vt100_EscSeq (INTEGER n, CHAR *letter, LONGINT letter__len) +{ + CHAR nstr[2]; + CHAR cmd[7]; + __DUP(letter, letter__len, CHAR); + vt100_IntToStr(n, (void*)nstr, ((LONGINT)(2))); + __COPY(vt100_CSI, cmd, ((LONGINT)(7))); + Strings_Append(nstr, ((LONGINT)(2)), (void*)cmd, ((LONGINT)(7))); + Strings_Append(letter, letter__len, (void*)cmd, ((LONGINT)(7))); + Console_String(cmd, ((LONGINT)(7))); + __DEL(letter); +} + +static void vt100_EscSeqSwapped (INTEGER n, CHAR *letter, LONGINT letter__len) +{ + CHAR nstr[2]; + CHAR cmd[7]; + __DUP(letter, letter__len, CHAR); + vt100_IntToStr(n, (void*)nstr, ((LONGINT)(2))); + __COPY(vt100_CSI, cmd, ((LONGINT)(7))); + Strings_Append(letter, letter__len, (void*)cmd, ((LONGINT)(7))); + Strings_Append(nstr, ((LONGINT)(2)), (void*)cmd, ((LONGINT)(7))); + Console_String(cmd, ((LONGINT)(7))); + __DEL(letter); +} + +static void vt100_EscSeq2 (INTEGER n, INTEGER m, CHAR *letter, LONGINT letter__len) +{ + CHAR nstr[5], mstr[5]; + CHAR cmd[12]; + __DUP(letter, letter__len, CHAR); + vt100_IntToStr(n, (void*)nstr, ((LONGINT)(5))); + vt100_IntToStr(m, (void*)mstr, ((LONGINT)(5))); + __COPY(vt100_CSI, cmd, ((LONGINT)(12))); + Strings_Append(nstr, ((LONGINT)(5)), (void*)cmd, ((LONGINT)(12))); + Strings_Append((CHAR*)";", (LONGINT)2, (void*)cmd, ((LONGINT)(12))); + Strings_Append(mstr, ((LONGINT)(5)), (void*)cmd, ((LONGINT)(12))); + Strings_Append(letter, letter__len, (void*)cmd, ((LONGINT)(12))); + Console_String(cmd, ((LONGINT)(12))); + __DEL(letter); +} + +void vt100_CUU (INTEGER n) +{ + vt100_EscSeq(n, (CHAR*)"A", (LONGINT)2); +} + +void vt100_CUD (INTEGER n) +{ + vt100_EscSeq(n, (CHAR*)"B", (LONGINT)2); +} + +void vt100_CUF (INTEGER n) +{ + vt100_EscSeq(n, (CHAR*)"C", (LONGINT)2); +} + +void vt100_CUB (INTEGER n) +{ + vt100_EscSeq(n, (CHAR*)"D", (LONGINT)2); +} + +void vt100_CNL (INTEGER n) +{ + vt100_EscSeq(n, (CHAR*)"E", (LONGINT)2); +} + +void vt100_CPL (INTEGER n) +{ + vt100_EscSeq(n, (CHAR*)"F", (LONGINT)2); +} + +void vt100_CHA (INTEGER n) +{ + vt100_EscSeq(n, (CHAR*)"G", (LONGINT)2); +} + +void vt100_CUP (INTEGER n, INTEGER m) +{ + vt100_EscSeq2(n, m, (CHAR*)"H", (LONGINT)2); +} + +void vt100_ED (INTEGER n) +{ + vt100_EscSeq(n, (CHAR*)"J", (LONGINT)2); +} + +void vt100_EL (INTEGER n) +{ + vt100_EscSeq(n, (CHAR*)"K", (LONGINT)2); +} + +void vt100_SU (INTEGER n) +{ + vt100_EscSeq(n, (CHAR*)"S", (LONGINT)2); +} + +void vt100_SD (INTEGER n) +{ + vt100_EscSeq(n, (CHAR*)"T", (LONGINT)2); +} + +void vt100_HVP (INTEGER n, INTEGER m) +{ + vt100_EscSeq2(n, m, (CHAR*)"f", (LONGINT)2); +} + +void vt100_SGR (INTEGER n) +{ + vt100_EscSeq(n, (CHAR*)"m", (LONGINT)2); +} + +void vt100_SGR2 (INTEGER n, INTEGER m) +{ + vt100_EscSeq2(n, m, (CHAR*)"m", (LONGINT)2); +} + +void vt100_DSR (INTEGER n) +{ + vt100_EscSeq(6, (CHAR*)"n", (LONGINT)2); +} + +void vt100_SCP (void) +{ + vt100_EscSeq0((CHAR*)"s", (LONGINT)2); +} + +void vt100_RCP (void) +{ + vt100_EscSeq0((CHAR*)"u", (LONGINT)2); +} + +void vt100_DECTCEMl (void) +{ + vt100_EscSeq0((CHAR*)"\?25l", (LONGINT)5); +} + +void vt100_DECTCEMh (void) +{ + vt100_EscSeq0((CHAR*)"\?25h", (LONGINT)5); +} + +void vt100_SetAttr (CHAR *attr, LONGINT attr__len) +{ + CHAR tmpstr[16]; + __DUP(attr, attr__len, CHAR); + __COPY(vt100_CSI, tmpstr, ((LONGINT)(16))); + Strings_Append(attr, attr__len, (void*)tmpstr, ((LONGINT)(16))); + Console_String(tmpstr, ((LONGINT)(16))); + __DEL(attr); +} + + +export void *vt100__init(void) +{ + __DEFMOD; + __MODULE_IMPORT(Console); + __MODULE_IMPORT(Strings); + __REGMOD("vt100", 0); + __REGCMD("DECTCEMh", vt100_DECTCEMh); + __REGCMD("DECTCEMl", vt100_DECTCEMl); + __REGCMD("RCP", vt100_RCP); + __REGCMD("SCP", vt100_SCP); +/* BEGIN */ + __COPY("", vt100_CSI, ((LONGINT)(5))); + Strings_Append((CHAR*)"[", (LONGINT)2, (void*)vt100_CSI, ((LONGINT)(5))); + __ENDMOD; +} diff --git a/bootstrap/unix-44/vt100.h b/bootstrap/unix-44/vt100.h new file mode 100644 index 00000000..6d210ec9 --- /dev/null +++ b/bootstrap/unix-44/vt100.h @@ -0,0 +1,37 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ + +#ifndef vt100__h +#define vt100__h + +#include "SYSTEM.h" + + +import CHAR vt100_CSI[5]; + + +import void vt100_CHA (INTEGER n); +import void vt100_CNL (INTEGER n); +import void vt100_CPL (INTEGER n); +import void vt100_CUB (INTEGER n); +import void vt100_CUD (INTEGER n); +import void vt100_CUF (INTEGER n); +import void vt100_CUP (INTEGER n, INTEGER m); +import void vt100_CUU (INTEGER n); +import void vt100_DECTCEMh (void); +import void vt100_DECTCEMl (void); +import void vt100_DSR (INTEGER n); +import void vt100_ED (INTEGER n); +import void vt100_EL (INTEGER n); +import void vt100_HVP (INTEGER n, INTEGER m); +import void vt100_IntToStr (LONGINT int_, CHAR *str, LONGINT str__len); +import void vt100_RCP (void); +import void vt100_SCP (void); +import void vt100_SD (INTEGER n); +import void vt100_SGR (INTEGER n); +import void vt100_SGR2 (INTEGER n, INTEGER m); +import void vt100_SU (INTEGER n); +import void vt100_SetAttr (CHAR *attr, LONGINT attr__len); +import void *vt100__init(void); + + +#endif diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c new file mode 100644 index 00000000..a1992033 --- /dev/null +++ b/bootstrap/unix-48/Configuration.c @@ -0,0 +1,16 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +#include "SYSTEM.h" + + + + + + + +export void *Configuration__init(void) +{ + __DEFMOD; + __REGMOD("Configuration", 0); +/* BEGIN */ + __ENDMOD; +} diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h new file mode 100644 index 00000000..e7aed50a --- /dev/null +++ b/bootstrap/unix-48/Configuration.h @@ -0,0 +1,14 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ + +#ifndef Configuration__h +#define Configuration__h + +#include "SYSTEM.h" + + + + +import void *Configuration__init(void); + + +#endif diff --git a/bootstrap/unix-48/Console.c b/bootstrap/unix-48/Console.c new file mode 100644 index 00000000..7f8fd8c0 --- /dev/null +++ b/bootstrap/unix-48/Console.c @@ -0,0 +1,150 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +#include "SYSTEM.h" +#include "Platform.h" + + +static CHAR Console_line[128]; +static INTEGER Console_pos; + + +export void Console_Bool (BOOLEAN b); +export void Console_Char (CHAR ch); +export void Console_Flush (void); +export void Console_Hex (LONGINT i); +export void Console_Int (LONGINT i, LONGINT n); +export void Console_Ln (void); +export void Console_Read (CHAR *ch); +export void Console_ReadLine (CHAR *line, LONGINT line__len); +export void Console_String (CHAR *s, LONGINT s__len); + + +void Console_Flush (void) +{ + INTEGER error; + error = Platform_Write(((LONGINT)(1)), (LONGINT)(uintptr_t)Console_line, Console_pos); + Console_pos = 0; +} + +void Console_Char (CHAR ch) +{ + if (Console_pos == 128) { + Console_Flush(); + } + Console_line[__X(Console_pos, ((LONGINT)(128)))] = ch; + Console_pos += 1; + if (ch == 0x0a) { + Console_Flush(); + } +} + +void Console_String (CHAR *s, LONGINT s__len) +{ + INTEGER i; + __DUP(s, s__len, CHAR); + i = 0; + while (s[__X(i, s__len)] != 0x00) { + Console_Char(s[__X(i, s__len)]); + i += 1; + } + __DEL(s); +} + +void Console_Int (LONGINT i, LONGINT n) +{ + CHAR s[32]; + LONGINT i1, k; + if (i == __LSHL(1, 31, LONGINT)) { + __MOVE("8463847412", s, 11); + k = 10; + } else { + i1 = __ABS(i); + s[0] = (CHAR)(__MOD(i1, 10) + 48); + i1 = __DIV(i1, 10); + k = 1; + while (i1 > 0) { + s[__X(k, ((LONGINT)(32)))] = (CHAR)(__MOD(i1, 10) + 48); + i1 = __DIV(i1, 10); + k += 1; + } + } + if (i < 0) { + s[__X(k, ((LONGINT)(32)))] = '-'; + k += 1; + } + while (n > k) { + Console_Char(' '); + n -= 1; + } + while (k > 0) { + k -= 1; + Console_Char(s[__X(k, ((LONGINT)(32)))]); + } +} + +void Console_Ln (void) +{ + Console_Char(0x0a); +} + +void Console_Bool (BOOLEAN b) +{ + if (b) { + Console_String((CHAR*)"TRUE", (LONGINT)5); + } else { + Console_String((CHAR*)"FALSE", (LONGINT)6); + } +} + +void Console_Hex (LONGINT i) +{ + LONGINT k, n; + k = -28; + while (k <= 0) { + n = __MASK(__ASH(i, k), -16); + if (n <= 9) { + Console_Char((CHAR)(48 + n)); + } else { + Console_Char((CHAR)(55 + n)); + } + k += 4; + } +} + +void Console_Read (CHAR *ch) +{ + LONGINT n; + INTEGER error; + Console_Flush(); + error = Platform_ReadBuf(((LONGINT)(0)), (void*)&*ch, ((LONGINT)(1)), &n); + if (n != 1) { + *ch = 0x00; + } +} + +void Console_ReadLine (CHAR *line, LONGINT line__len) +{ + LONGINT i; + CHAR ch; + Console_Flush(); + i = 0; + Console_Read(&ch); + while ((((i < line__len - 1 && ch != 0x0a)) && ch != 0x00)) { + line[__X(i, line__len)] = ch; + i += 1; + Console_Read(&ch); + } + line[__X(i, line__len)] = 0x00; +} + + +export void *Console__init(void) +{ + __DEFMOD; + __MODULE_IMPORT(Platform); + __REGMOD("Console", 0); + __REGCMD("Flush", Console_Flush); + __REGCMD("Ln", Console_Ln); +/* BEGIN */ + Console_pos = 0; + __ENDMOD; +} diff --git a/bootstrap/unix-48/Console.h b/bootstrap/unix-48/Console.h new file mode 100644 index 00000000..316e7e46 --- /dev/null +++ b/bootstrap/unix-48/Console.h @@ -0,0 +1,23 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ + +#ifndef Console__h +#define Console__h + +#include "SYSTEM.h" + + + + +import void Console_Bool (BOOLEAN b); +import void Console_Char (CHAR ch); +import void Console_Flush (void); +import void Console_Hex (LONGINT i); +import void Console_Int (LONGINT i, LONGINT n); +import void Console_Ln (void); +import void Console_Read (CHAR *ch); +import void Console_ReadLine (CHAR *line, LONGINT line__len); +import void Console_String (CHAR *s, LONGINT s__len); +import void *Console__init(void); + + +#endif diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c new file mode 100644 index 00000000..f3b9b280 --- /dev/null +++ b/bootstrap/unix-48/Files.c @@ -0,0 +1,1078 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin tspkaSfF */ +#include "SYSTEM.h" +#include "Configuration.h" +#include "Console.h" +#include "Heap.h" +#include "Platform.h" +#include "Strings.h" + +typedef + struct Files_Handle *Files_File; + +typedef + struct Files_BufDesc { + Files_File f; + BOOLEAN chg; + LONGINT org, size; + SYSTEM_BYTE data[4096]; + } Files_BufDesc; + +typedef + Files_BufDesc *Files_Buffer; + +typedef + CHAR Files_FileName[101]; + +typedef + struct Files_Handle { + Files_FileName workName, registerName; + BOOLEAN tempFile; + Platform_FileIdentity identity; + LONGINT fd, len, pos; + Files_Buffer bufs[4]; + INTEGER swapper, state; + } Files_Handle; + +typedef + struct Files_Rider { + LONGINT res; + BOOLEAN eof; + Files_Buffer buf; + LONGINT org, offset; + } Files_Rider; + + +static LONGINT Files_fileTab[256]; +static INTEGER Files_tempno; +static CHAR Files_HOME[1024]; +static struct { + LONGINT len[1]; + CHAR data[1]; +} *Files_SearchPath; + +export LONGINT *Files_Handle__typ; +export LONGINT *Files_BufDesc__typ; +export LONGINT *Files_Rider__typ; + +export Files_File Files_Base (Files_Rider *r, LONGINT *r__typ); +static Files_File Files_CacheEntry (Platform_FileIdentity identity); +export void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INTEGER *res); +export void Files_Close (Files_File f); +static void Files_Create (Files_File f); +export void Files_Delete (CHAR *name, LONGINT name__len, INTEGER *res); +static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INTEGER errcode); +static void Files_Finalize (SYSTEM_PTR o); +static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *dest, LONGINT dest__len); +static void Files_Flush (Files_Buffer buf); +export void Files_GetDate (Files_File f, LONGINT *t, LONGINT *d); +export void Files_GetName (Files_File f, CHAR *name, LONGINT name__len); +static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *name, LONGINT name__len); +static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len); +static void Files_Init (void); +export LONGINT Files_Length (Files_File f); +static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT name__len, CHAR *dest, LONGINT dest__len); +export Files_File Files_New (CHAR *name, LONGINT name__len); +export Files_File Files_Old (CHAR *name, LONGINT name__len); +export LONGINT Files_Pos (Files_Rider *r, LONGINT *r__typ); +export void Files_Purge (Files_File f); +export void Files_Read (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x); +export void Files_ReadBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN *x); +export void Files_ReadByte (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len); +export void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, LONGINT n); +export void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, INTEGER *x); +export void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, LONGINT *x); +export void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x); +export void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); +export void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, LONGINT *x); +export void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x); +export void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x); +export void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); +export void Files_Register (Files_File f); +export void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INTEGER *res); +static void Files_ScanPath (INTEGER *pos, CHAR *dir, LONGINT dir__len); +export void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, LONGINT pos); +export void Files_SetSearchPath (CHAR *path, LONGINT path__len); +export void Files_Write (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE x); +export void Files_WriteBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN x); +export void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, LONGINT n); +export void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, INTEGER x); +export void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, LONGINT x); +export void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x); +export void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, LONGINT x); +export void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x); +export void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x); +export void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); + +#define Files_IdxTrap() __HALT(-1) + +static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INTEGER errcode) +{ + __DUP(s, s__len, CHAR); + Console_Ln(); + Console_String((CHAR*)"-- ", (LONGINT)4); + Console_String(s, s__len); + Console_String((CHAR*)": ", (LONGINT)3); + if (f != NIL) { + if (f->registerName[0] != 0x00) { + Console_String(f->registerName, ((LONGINT)(101))); + } else { + Console_String(f->workName, ((LONGINT)(101))); + } + if (f->fd != 0) { + Console_String((CHAR*)"f.fd = ", (LONGINT)8); + Console_Int(f->fd, ((LONGINT)(1))); + } + } + if (errcode != 0) { + Console_String((CHAR*)" errcode = ", (LONGINT)12); + Console_Int(errcode, ((LONGINT)(1))); + } + Console_Ln(); + __HALT(99); + __DEL(s); +} + +static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT name__len, CHAR *dest, LONGINT dest__len) +{ + INTEGER i, j; + __DUP(dir, dir__len, CHAR); + __DUP(name, name__len, CHAR); + i = 0; + j = 0; + while (dir[i] != 0x00) { + dest[i] = dir[i]; + i += 1; + } + if (dest[i - 1] != '/') { + dest[i] = '/'; + i += 1; + } + while (name[j] != 0x00) { + dest[i] = name[j]; + i += 1; + j += 1; + } + dest[i] = 0x00; + __DEL(dir); + __DEL(name); +} + +static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *name, LONGINT name__len) +{ + LONGINT n, i, j; + __DUP(finalName, finalName__len, CHAR); + Files_tempno += 1; + n = Files_tempno; + i = 0; + if (finalName[0] != '/') { + while (Platform_CWD[i] != 0x00) { + name[i] = Platform_CWD[i]; + i += 1; + } + if (Platform_CWD[i - 1] != '/') { + name[i] = '/'; + i += 1; + } + } + j = 0; + while (finalName[j] != 0x00) { + name[i] = finalName[j]; + i += 1; + j += 1; + } + i -= 1; + while (name[i] != '/') { + i -= 1; + } + name[i + 1] = '.'; + name[i + 2] = 't'; + name[i + 3] = 'm'; + name[i + 4] = 'p'; + name[i + 5] = '.'; + i += 6; + while (n > 0) { + name[i] = (CHAR)(__MOD(n, 10) + 48); + n = __DIV(n, 10); + i += 1; + } + name[i] = '.'; + i += 1; + n = Platform_PID; + while (n > 0) { + name[i] = (CHAR)(__MOD(n, 10) + 48); + n = __DIV(n, 10); + i += 1; + } + name[i] = 0x00; + __DEL(finalName); +} + +static void Files_Create (Files_File f) +{ + Platform_FileIdentity identity; + BOOLEAN done; + INTEGER error; + CHAR err[32]; + if (f->fd == -1) { + if (f->state == 1) { + Files_GetTempName(f->registerName, ((LONGINT)(101)), (void*)f->workName, ((LONGINT)(101))); + f->tempFile = 1; + } else if (f->state == 2) { + __COPY(f->registerName, f->workName, ((LONGINT)(101))); + f->registerName[0] = 0x00; + f->tempFile = 0; + } + error = Platform_Unlink((void*)f->workName, ((LONGINT)(101))); + error = Platform_New((void*)f->workName, ((LONGINT)(101)), &f->fd); + done = error == 0; + if ((!done && Platform_TooManyFiles(error)) || (done && f->fd >= 256)) { + if ((done && f->fd >= 256)) { + error = Platform_Close(f->fd); + } + Heap_GC(1); + error = Platform_New((void*)f->workName, ((LONGINT)(101)), &f->fd); + done = f->fd == 0; + } + if (done) { + if (f->fd >= 256) { + error = Platform_Close(f->fd); + Files_Err((CHAR*)"too many files open", (LONGINT)20, f, 0); + } else { + Files_fileTab[f->fd] = (LONGINT)(uintptr_t)f; + Heap_FileCount += 1; + Heap_RegisterFinalizer((void*)f, Files_Finalize); + f->state = 0; + f->pos = 0; + error = Platform_Identify(f->fd, &f->identity, Platform_FileIdentity__typ); + } + } else { + if (Platform_NoSuchDirectory(error)) { + __MOVE("no such directory", err, 18); + } else if (Platform_TooManyFiles(error)) { + __MOVE("too many files open", err, 20); + } else { + __MOVE("file not created", err, 17); + } + Files_Err(err, ((LONGINT)(32)), f, error); + } + } +} + +static void Files_Flush (Files_Buffer buf) +{ + INTEGER error; + Files_File f = NIL; + if (buf->chg) { + f = buf->f; + Files_Create(f); + if (buf->org != f->pos) { + error = Platform_Seek(f->fd, buf->org, Platform_SeekSet); + } + error = Platform_Write(f->fd, (LONGINT)(uintptr_t)buf->data, buf->size); + if (error != 0) { + Files_Err((CHAR*)"error writing file", (LONGINT)19, f, error); + } + f->pos = buf->org + buf->size; + buf->chg = 0; + error = Platform_Identify(f->fd, &f->identity, Platform_FileIdentity__typ); + if (error != 0) { + Files_Err((CHAR*)"error identifying file", (LONGINT)23, f, error); + } + } +} + +void Files_Close (Files_File f) +{ + LONGINT i; + INTEGER error; + if (f->state != 1 || f->registerName[0] != 0x00) { + Files_Create(f); + i = 0; + while ((i < 4 && f->bufs[i] != NIL)) { + Files_Flush(f->bufs[i]); + i += 1; + } + error = Platform_Sync(f->fd); + if (error != 0) { + Files_Err((CHAR*)"error writing file", (LONGINT)19, f, error); + } + Files_fileTab[f->fd] = 0; + error = Platform_Close(f->fd); + f->fd = -1; + f->state = 1; + Heap_FileCount -= 1; + } +} + +LONGINT Files_Length (Files_File f) +{ + LONGINT _o_result; + _o_result = f->len; + return _o_result; +} + +Files_File Files_New (CHAR *name, LONGINT name__len) +{ + Files_File _o_result; + Files_File f = NIL; + __DUP(name, name__len, CHAR); + __NEW(f, Files_Handle); + f->workName[0] = 0x00; + __COPY(name, f->registerName, ((LONGINT)(101))); + f->fd = -1; + f->state = 1; + f->len = 0; + f->pos = 0; + f->swapper = -1; + _o_result = f; + __DEL(name); + return _o_result; +} + +static void Files_ScanPath (INTEGER *pos, CHAR *dir, LONGINT dir__len) +{ + INTEGER i; + CHAR ch; + i = 0; + if (Files_SearchPath == NIL) { + if (*pos == 0) { + dir[0] = '.'; + i = 1; + *pos += 1; + } + } else { + ch = (Files_SearchPath->data)[*pos]; + while (ch == ' ' || ch == ';') { + *pos += 1; + ch = (Files_SearchPath->data)[*pos]; + } + if (ch == '~') { + *pos += 1; + ch = (Files_SearchPath->data)[*pos]; + while (Files_HOME[i] != 0x00) { + dir[i] = Files_HOME[i]; + i += 1; + } + if ((((((ch != '/' && ch != 0x00)) && ch != ';')) && ch != ' ')) { + while ((i > 0 && dir[i - 1] != '/')) { + i -= 1; + } + } + } + while ((ch != 0x00 && ch != ';')) { + dir[i] = ch; + i += 1; + *pos += 1; + ch = (Files_SearchPath->data)[*pos]; + } + while ((i > 0 && dir[i - 1] == ' ')) { + i -= 1; + } + } + dir[i] = 0x00; +} + +static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len) +{ + BOOLEAN _o_result; + INTEGER i; + CHAR ch; + i = 0; + ch = name[0]; + while ((ch != 0x00 && ch != '/')) { + i += 1; + ch = name[i]; + } + _o_result = ch == '/'; + return _o_result; +} + +static Files_File Files_CacheEntry (Platform_FileIdentity identity) +{ + Files_File _o_result; + Files_File f = NIL; + INTEGER i, error; + i = 0; + while (i < 256) { + f = (Files_File)(uintptr_t)Files_fileTab[i]; + if ((f != NIL && Platform_SameFile(identity, f->identity))) { + if (!Platform_SameFileTime(identity, f->identity)) { + i = 0; + while (i < 4) { + if (f->bufs[i] != NIL) { + f->bufs[i]->org = -1; + f->bufs[i] = NIL; + } + i += 1; + } + f->swapper = -1; + f->identity = identity; + error = Platform_Size(f->fd, &f->len); + } + _o_result = f; + return _o_result; + } + i += 1; + } + _o_result = NIL; + return _o_result; +} + +Files_File Files_Old (CHAR *name, LONGINT name__len) +{ + Files_File _o_result; + Files_File f = NIL; + LONGINT fd; + INTEGER pos; + BOOLEAN done; + CHAR dir[256], path[256]; + INTEGER error; + Platform_FileIdentity identity; + __DUP(name, name__len, CHAR); + if (name[0] != 0x00) { + if (Files_HasDir((void*)name, name__len)) { + dir[0] = 0x00; + __COPY(name, path, ((LONGINT)(256))); + } else { + pos = 0; + Files_ScanPath(&pos, (void*)dir, ((LONGINT)(256))); + Files_MakeFileName(dir, ((LONGINT)(256)), name, name__len, (void*)path, ((LONGINT)(256))); + Files_ScanPath(&pos, (void*)dir, ((LONGINT)(256))); + } + for (;;) { + error = Platform_OldRW((void*)path, ((LONGINT)(256)), &fd); + done = error == 0; + if ((!done && Platform_TooManyFiles(error)) || (done && fd >= 256)) { + if ((done && fd >= 256)) { + error = Platform_Close(fd); + } + Heap_GC(1); + error = Platform_OldRW((void*)path, ((LONGINT)(256)), &fd); + done = error == 0; + if ((!done && Platform_TooManyFiles(error))) { + Files_Err((CHAR*)"too many files open", (LONGINT)20, f, error); + } + } + if ((!done && Platform_Inaccessible(error))) { + error = Platform_OldRO((void*)path, ((LONGINT)(256)), &fd); + done = error == 0; + } + if ((!done && !Platform_Absent(error))) { + Console_String((CHAR*)"Warning: Files.Old ", (LONGINT)20); + Console_String(name, name__len); + Console_String((CHAR*)" error = ", (LONGINT)10); + Console_Int(error, ((LONGINT)(0))); + Console_Ln(); + } + if (done) { + error = Platform_Identify(fd, &identity, Platform_FileIdentity__typ); + f = Files_CacheEntry(identity); + if (f != NIL) { + error = Platform_Close(fd); + _o_result = f; + __DEL(name); + return _o_result; + } else if (fd >= 256) { + error = Platform_Close(fd); + Files_Err((CHAR*)"too many files open", (LONGINT)20, f, 0); + } else { + __NEW(f, Files_Handle); + Files_fileTab[fd] = (LONGINT)(uintptr_t)f; + Heap_FileCount += 1; + Heap_RegisterFinalizer((void*)f, Files_Finalize); + f->fd = fd; + f->state = 0; + f->pos = 0; + f->swapper = -1; + error = Platform_Size(fd, &f->len); + __COPY(name, f->workName, ((LONGINT)(101))); + f->registerName[0] = 0x00; + f->tempFile = 0; + f->identity = identity; + _o_result = f; + __DEL(name); + return _o_result; + } + } else if (dir[0] == 0x00) { + _o_result = NIL; + __DEL(name); + return _o_result; + } else { + Files_MakeFileName(dir, ((LONGINT)(256)), name, name__len, (void*)path, ((LONGINT)(256))); + Files_ScanPath(&pos, (void*)dir, ((LONGINT)(256))); + } + } + } else { + _o_result = NIL; + __DEL(name); + return _o_result; + } + __RETCHK; +} + +void Files_Purge (Files_File f) +{ + INTEGER i; + Platform_FileIdentity identity; + INTEGER error; + i = 0; + while (i < 4) { + if (f->bufs[i] != NIL) { + f->bufs[i]->org = -1; + f->bufs[i] = NIL; + } + i += 1; + } + if (f->fd != -1) { + error = Platform_Truncate(f->fd, ((LONGINT)(0))); + error = Platform_Seek(f->fd, ((LONGINT)(0)), Platform_SeekSet); + } + f->pos = 0; + f->len = 0; + f->swapper = -1; + error = Platform_Identify(f->fd, &identity, Platform_FileIdentity__typ); + Platform_SetMTime(&f->identity, Platform_FileIdentity__typ, identity); +} + +void Files_GetDate (Files_File f, LONGINT *t, LONGINT *d) +{ + Platform_FileIdentity identity; + INTEGER error; + Files_Create(f); + error = Platform_Identify(f->fd, &identity, Platform_FileIdentity__typ); + Platform_MTimeAsClock(identity, &*t, &*d); +} + +LONGINT Files_Pos (Files_Rider *r, LONGINT *r__typ) +{ + LONGINT _o_result; + _o_result = (*r).org + (*r).offset; + return _o_result; +} + +void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, LONGINT pos) +{ + LONGINT org, offset, i, n; + Files_Buffer buf = NIL; + INTEGER error; + if (f != NIL) { + if (pos > f->len) { + pos = f->len; + } else if (pos < 0) { + pos = 0; + } + offset = __MASK(pos, -4096); + org = pos - offset; + i = 0; + while ((((i < 4 && f->bufs[i] != NIL)) && org != f->bufs[i]->org)) { + i += 1; + } + if (i < 4) { + if (f->bufs[i] == NIL) { + __NEW(buf, Files_BufDesc); + buf->chg = 0; + buf->org = -1; + buf->f = f; + f->bufs[i] = buf; + } else { + buf = f->bufs[i]; + } + } else { + f->swapper = __MASK(f->swapper + 1, -4); + buf = f->bufs[f->swapper]; + Files_Flush(buf); + } + if (buf->org != org) { + if (org == f->len) { + buf->size = 0; + } else { + Files_Create(f); + if (f->pos != org) { + error = Platform_Seek(f->fd, org, Platform_SeekSet); + } + error = Platform_ReadBuf(f->fd, (void*)buf->data, ((LONGINT)(4096)), &n); + if (error != 0) { + Files_Err((CHAR*)"read from file not done", (LONGINT)24, f, error); + } + f->pos = org + n; + buf->size = n; + } + buf->org = org; + buf->chg = 0; + } + } else { + buf = NIL; + org = 0; + offset = 0; + } + (*r).buf = buf; + (*r).org = org; + (*r).offset = offset; + (*r).eof = 0; + (*r).res = 0; +} + +void Files_Read (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x) +{ + LONGINT offset; + Files_Buffer buf = NIL; + buf = (*r).buf; + offset = (*r).offset; + if ((*r).org != buf->org) { + Files_Set(&*r, r__typ, buf->f, (*r).org + offset); + buf = (*r).buf; + offset = (*r).offset; + } + if (offset < buf->size) { + *x = buf->data[offset]; + (*r).offset = offset + 1; + } else if ((*r).org + offset < buf->f->len) { + Files_Set(&*r, r__typ, (*r).buf->f, (*r).org + offset); + *x = (*r).buf->data[0]; + (*r).offset = 1; + } else { + *x = 0x00; + (*r).eof = 1; + } +} + +void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, LONGINT n) +{ + LONGINT xpos, min, restInBuf, offset; + Files_Buffer buf = NIL; + if (n > x__len) { + Files_IdxTrap(); + } + xpos = 0; + buf = (*r).buf; + offset = (*r).offset; + while (n > 0) { + if ((*r).org != buf->org || offset >= 4096) { + Files_Set(&*r, r__typ, buf->f, (*r).org + offset); + buf = (*r).buf; + offset = (*r).offset; + } + restInBuf = buf->size - offset; + if (restInBuf == 0) { + (*r).res = n; + (*r).eof = 1; + return; + } else if (n > restInBuf) { + min = restInBuf; + } else { + min = n; + } + __MOVE((LONGINT)(uintptr_t)buf->data + offset, (LONGINT)(uintptr_t)x + xpos, min); + offset += min; + (*r).offset = offset; + xpos += min; + n -= min; + } + (*r).res = 0; + (*r).eof = 0; +} + +void Files_ReadByte (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len) +{ + Files_ReadBytes(&*r, r__typ, (void*)x, x__len * ((LONGINT)(1)), ((LONGINT)(1))); +} + +Files_File Files_Base (Files_Rider *r, LONGINT *r__typ) +{ + Files_File _o_result; + _o_result = (*r).buf->f; + return _o_result; +} + +void Files_Write (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE x) +{ + Files_Buffer buf = NIL; + LONGINT offset; + buf = (*r).buf; + offset = (*r).offset; + if ((*r).org != buf->org || offset >= 4096) { + Files_Set(&*r, r__typ, buf->f, (*r).org + offset); + buf = (*r).buf; + offset = (*r).offset; + } + buf->data[offset] = x; + buf->chg = 1; + if (offset == buf->size) { + buf->size += 1; + buf->f->len += 1; + } + (*r).offset = offset + 1; + (*r).res = 0; +} + +void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, LONGINT n) +{ + LONGINT xpos, min, restInBuf, offset; + Files_Buffer buf = NIL; + if (n > x__len) { + Files_IdxTrap(); + } + xpos = 0; + buf = (*r).buf; + offset = (*r).offset; + while (n > 0) { + if ((*r).org != buf->org || offset >= 4096) { + Files_Set(&*r, r__typ, buf->f, (*r).org + offset); + buf = (*r).buf; + offset = (*r).offset; + } + restInBuf = 4096 - offset; + if (n > restInBuf) { + min = restInBuf; + } else { + min = n; + } + __MOVE((LONGINT)(uintptr_t)x + xpos, (LONGINT)(uintptr_t)buf->data + offset, min); + offset += min; + (*r).offset = offset; + if (offset > buf->size) { + buf->f->len += offset - buf->size; + buf->size = offset; + } + xpos += min; + n -= min; + buf->chg = 1; + } + (*r).res = 0; +} + +void Files_Delete (CHAR *name, LONGINT name__len, INTEGER *res) +{ + __DUP(name, name__len, CHAR); + *res = Platform_Unlink((void*)name, name__len); + __DEL(name); +} + +void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INTEGER *res) +{ + LONGINT fdold, fdnew, n; + INTEGER error, ignore; + Platform_FileIdentity oldidentity, newidentity; + CHAR buf[4096]; + __DUP(old, old__len, CHAR); + __DUP(new, new__len, CHAR); + error = Platform_IdentifyByName(old, old__len, &oldidentity, Platform_FileIdentity__typ); + if (error == 0) { + error = Platform_IdentifyByName(new, new__len, &newidentity, Platform_FileIdentity__typ); + if ((error != 0 && !Platform_SameFile(oldidentity, newidentity))) { + Files_Delete(new, new__len, &error); + } + error = Platform_Rename((void*)old, old__len, (void*)new, new__len); + if (!Platform_DifferentFilesystems(error)) { + *res = error; + return; + } else { + error = Platform_OldRO((void*)old, old__len, &fdold); + if (error != 0) { + *res = 2; + return; + } + error = Platform_New((void*)new, new__len, &fdnew); + if (error != 0) { + error = Platform_Close(fdold); + *res = 3; + return; + } + error = Platform_Read(fdold, (LONGINT)(uintptr_t)buf, ((LONGINT)(4096)), &n); + while (n > 0) { + error = Platform_Write(fdnew, (LONGINT)(uintptr_t)buf, n); + if (error != 0) { + ignore = Platform_Close(fdold); + ignore = Platform_Close(fdnew); + Files_Err((CHAR*)"cannot move file", (LONGINT)17, NIL, error); + } + error = Platform_Read(fdold, (LONGINT)(uintptr_t)buf, ((LONGINT)(4096)), &n); + } + ignore = Platform_Close(fdold); + ignore = Platform_Close(fdnew); + if (n == 0) { + error = Platform_Unlink((void*)old, old__len); + *res = 0; + } else { + Files_Err((CHAR*)"cannot move file", (LONGINT)17, NIL, error); + } + } + } else { + *res = 2; + } + __DEL(old); + __DEL(new); +} + +void Files_Register (Files_File f) +{ + INTEGER idx, errcode; + Files_File f1 = NIL; + CHAR file[104]; + if ((f->state == 1 && f->registerName[0] != 0x00)) { + f->state = 2; + } + Files_Close(f); + if (f->registerName[0] != 0x00) { + Files_Rename(f->workName, ((LONGINT)(101)), f->registerName, ((LONGINT)(101)), &errcode); + if (errcode != 0) { + __COPY(f->registerName, file, ((LONGINT)(104))); + __HALT(99); + } + __COPY(f->registerName, f->workName, ((LONGINT)(101))); + f->registerName[0] = 0x00; + f->tempFile = 0; + } +} + +void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INTEGER *res) +{ + __DUP(path, path__len, CHAR); + *res = Platform_Chdir((void*)path, path__len); + __DEL(path); +} + +static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *dest, LONGINT dest__len) +{ + LONGINT i, j; + if (!Platform_LittleEndian) { + i = src__len; + j = 0; + while (i > 0) { + i -= 1; + dest[j] = src[i]; + j += 1; + } + } else { + __MOVE((LONGINT)(uintptr_t)src, (LONGINT)(uintptr_t)dest, src__len); + } +} + +void Files_ReadBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN *x) +{ + Files_Read(&*R, R__typ, (CHAR*)(void*)&*x); +} + +void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, INTEGER *x) +{ + CHAR b[2]; + Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(2)), ((LONGINT)(2))); + *x = (int)b[0] + __ASHL((int)b[1], 8); +} + +void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, LONGINT *x) +{ + CHAR b[4]; + Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); + *x = ((LONGINT)((int)b[0] + __ASHL((int)b[1], 8)) + __ASHL((LONGINT)b[2], 16)) + __ASHL((LONGINT)b[3], 24); +} + +void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x) +{ + CHAR b[4]; + Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); + *x = (SET)(((LONGINT)((int)b[0] + __ASHL((int)b[1], 8)) + __ASHL((LONGINT)b[2], 16)) + __ASHL((LONGINT)b[3], 24)); +} + +void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x) +{ + CHAR b[4]; + Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); + Files_FlipBytes((void*)b, ((LONGINT)(4)), (void*)&*x, ((LONGINT)(4))); +} + +void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x) +{ + CHAR b[8]; + Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(8)), ((LONGINT)(8))); + Files_FlipBytes((void*)b, ((LONGINT)(8)), (void*)&*x, ((LONGINT)(8))); +} + +void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) +{ + INTEGER i; + CHAR ch; + i = 0; + do { + Files_Read(&*R, R__typ, (void*)&ch); + x[i] = ch; + i += 1; + } while (!(ch == 0x00)); +} + +void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) +{ + INTEGER i; + CHAR ch; + BOOLEAN b; + i = 0; + b = 0; + do { + Files_Read(&*R, R__typ, (void*)&ch); + if ((ch == 0x00 || ch == 0x0a) || ch == 0x0d) { + b = 1; + } else { + x[i] = ch; + i += 1; + } + } while (!b); +} + +void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, LONGINT *x) +{ + SHORTINT s; + CHAR ch; + LONGINT n; + s = 0; + n = 0; + Files_Read(&*R, R__typ, (void*)&ch); + while ((int)ch >= 128) { + n += __ASH((LONGINT)((int)ch - 128), s); + s += 7; + Files_Read(&*R, R__typ, (void*)&ch); + } + n += __ASH((LONGINT)(__MASK((int)ch, -64) - __ASHL(__ASHR((int)ch, 6), 6)), s); + *x = n; +} + +void Files_WriteBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN x) +{ + Files_Write(&*R, R__typ, __VAL(CHAR, x)); +} + +void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, INTEGER x) +{ + CHAR b[2]; + b[0] = (CHAR)x; + b[1] = (CHAR)__ASHR(x, 8); + Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(2)), ((LONGINT)(2))); +} + +void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, LONGINT x) +{ + CHAR b[4]; + b[0] = (CHAR)x; + b[1] = (CHAR)__ASHR(x, 8); + b[2] = (CHAR)__ASHR(x, 16); + b[3] = (CHAR)__ASHR(x, 24); + Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); +} + +void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x) +{ + CHAR b[4]; + LONGINT i; + i = (LONGINT)x; + b[0] = (CHAR)i; + b[1] = (CHAR)__ASHR(i, 8); + b[2] = (CHAR)__ASHR(i, 16); + b[3] = (CHAR)__ASHR(i, 24); + Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); +} + +void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x) +{ + CHAR b[4]; + Files_FlipBytes((void*)&x, ((LONGINT)(4)), (void*)b, ((LONGINT)(4))); + Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); +} + +void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x) +{ + CHAR b[8]; + Files_FlipBytes((void*)&x, ((LONGINT)(8)), (void*)b, ((LONGINT)(8))); + Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(8)), ((LONGINT)(8))); +} + +void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) +{ + INTEGER i; + i = 0; + while (x[i] != 0x00) { + i += 1; + } + Files_WriteBytes(&*R, R__typ, (void*)x, x__len * ((LONGINT)(1)), i + 1); +} + +void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, LONGINT x) +{ + while (x < -64 || x > 63) { + Files_Write(&*R, R__typ, (CHAR)(__MASK(x, -128) + 128)); + x = __ASHR(x, 7); + } + Files_Write(&*R, R__typ, (CHAR)__MASK(x, -128)); +} + +void Files_GetName (Files_File f, CHAR *name, LONGINT name__len) +{ + __COPY(f->workName, name, name__len); +} + +static void Files_Finalize (SYSTEM_PTR o) +{ + Files_File f = NIL; + LONGINT res; + f = (Files_File)(uintptr_t)o; + if (f->fd >= 0) { + Files_fileTab[f->fd] = 0; + res = Platform_Close(f->fd); + f->fd = -1; + Heap_FileCount -= 1; + if (f->tempFile) { + res = Platform_Unlink((void*)f->workName, ((LONGINT)(101))); + } + } +} + +void Files_SetSearchPath (CHAR *path, LONGINT path__len) +{ + __DUP(path, path__len, CHAR); + if (Strings_Length(path, path__len) != 0) { + Files_SearchPath = __NEWARR(NIL, ((LONGINT)(1)), 1, 1, 1, (LONGINT)(Strings_Length(path, path__len) + 1)); + __COPY(path, Files_SearchPath->data, Files_SearchPath->len[0]); + } else { + Files_SearchPath = NIL; + } + __DEL(path); +} + +static void Files_Init (void) +{ + LONGINT i; + i = 0; + while (i < 256) { + Files_fileTab[i] = 0; + i += 1; + } + Files_tempno = -1; + Heap_FileCount = 0; + Files_SearchPath = NIL; + Files_HOME[0] = 0x00; + Platform_GetEnv((CHAR*)"HOME", (LONGINT)5, (void*)Files_HOME, ((LONGINT)(1024))); +} + +static void EnumPtrs(void (*P)(void*)) +{ + P(Files_SearchPath); +} + +__TDESC(Files_Handle, 1, 4) = {__TDFLDS("Handle", 248), {228, 232, 236, 240, -20}}; +__TDESC(Files_BufDesc, 1, 1) = {__TDFLDS("BufDesc", 4112), {0, -8}}; +__TDESC(Files_Rider, 1, 1) = {__TDFLDS("Rider", 20), {8, -8}}; + +export void *Files__init(void) +{ + __DEFMOD; + __MODULE_IMPORT(Configuration); + __MODULE_IMPORT(Console); + __MODULE_IMPORT(Heap); + __MODULE_IMPORT(Platform); + __MODULE_IMPORT(Strings); + __REGMOD("Files", EnumPtrs); + __INITYP(Files_Handle, Files_Handle, 0); + __INITYP(Files_BufDesc, Files_BufDesc, 0); + __INITYP(Files_Rider, Files_Rider, 0); +/* BEGIN */ + Files_Init(); + __ENDMOD; +} diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h new file mode 100644 index 00000000..002d2dc5 --- /dev/null +++ b/bootstrap/unix-48/Files.h @@ -0,0 +1,70 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin tspkaSfF */ + +#ifndef Files__h +#define Files__h + +#include "SYSTEM.h" + +typedef + struct Files_Handle *Files_File; + +typedef + struct Files_Handle { + char _prvt0[216]; + LONGINT fd; + char _prvt1[28]; + } Files_Handle; + +typedef + struct Files_Rider { + LONGINT res; + BOOLEAN eof; + char _prvt0[15]; + } Files_Rider; + + + +import LONGINT *Files_Handle__typ; +import LONGINT *Files_Rider__typ; + +import Files_File Files_Base (Files_Rider *r, LONGINT *r__typ); +import void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INTEGER *res); +import void Files_Close (Files_File f); +import void Files_Delete (CHAR *name, LONGINT name__len, INTEGER *res); +import void Files_GetDate (Files_File f, LONGINT *t, LONGINT *d); +import void Files_GetName (Files_File f, CHAR *name, LONGINT name__len); +import LONGINT Files_Length (Files_File f); +import Files_File Files_New (CHAR *name, LONGINT name__len); +import Files_File Files_Old (CHAR *name, LONGINT name__len); +import LONGINT Files_Pos (Files_Rider *r, LONGINT *r__typ); +import void Files_Purge (Files_File f); +import void Files_Read (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x); +import void Files_ReadBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN *x); +import void Files_ReadByte (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len); +import void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, LONGINT n); +import void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, INTEGER *x); +import void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, LONGINT *x); +import void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x); +import void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); +import void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, LONGINT *x); +import void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x); +import void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x); +import void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); +import void Files_Register (Files_File f); +import void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INTEGER *res); +import void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, LONGINT pos); +import void Files_SetSearchPath (CHAR *path, LONGINT path__len); +import void Files_Write (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE x); +import void Files_WriteBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN x); +import void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, LONGINT n); +import void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, INTEGER x); +import void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, LONGINT x); +import void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x); +import void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, LONGINT x); +import void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x); +import void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x); +import void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); +import void *Files__init(void); + + +#endif diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c new file mode 100644 index 00000000..cbb21626 --- /dev/null +++ b/bootstrap/unix-48/Heap.c @@ -0,0 +1,752 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin tskSfF */ +#include "SYSTEM.h" + +struct Heap__1 { + CHAR ch; + SYSTEM_PTR p; +}; + +typedef + struct Heap_CmdDesc *Heap_Cmd; + +typedef + CHAR Heap_CmdName[24]; + +typedef + void (*Heap_Command)(void); + +typedef + struct Heap_CmdDesc { + Heap_Cmd next; + Heap_CmdName name; + Heap_Command cmd; + } Heap_CmdDesc; + +typedef + void (*Heap_EnumProc)(void(*)(SYSTEM_PTR)); + +typedef + struct Heap_FinDesc *Heap_FinNode; + +typedef + void (*Heap_Finalizer)(SYSTEM_PTR); + +typedef + struct Heap_FinDesc { + Heap_FinNode next; + LONGINT obj; + BOOLEAN marked; + Heap_Finalizer finalize; + } Heap_FinDesc; + +typedef + struct Heap_ModuleDesc *Heap_Module; + +typedef + CHAR Heap_ModuleName[20]; + +typedef + struct Heap_ModuleDesc { + Heap_Module next; + Heap_ModuleName name; + LONGINT refcnt; + Heap_Cmd cmds; + LONGINT types; + Heap_EnumProc enumPtrs; + LONGINT reserved1, reserved2; + } Heap_ModuleDesc; + + +export SYSTEM_PTR Heap_modules; +static LONGINT Heap_freeList[10]; +static LONGINT Heap_bigBlocks; +export LONGINT Heap_allocated; +static BOOLEAN Heap_firstTry; +static LONGINT Heap_heap, Heap_heapend; +export LONGINT Heap_heapsize; +static Heap_FinNode Heap_fin; +static INTEGER Heap_lockdepth; +static BOOLEAN Heap_interrupted; +export INTEGER Heap_FileCount; + +export LONGINT *Heap_ModuleDesc__typ; +export LONGINT *Heap_CmdDesc__typ; +export LONGINT *Heap_FinDesc__typ; +export LONGINT *Heap__1__typ; + +static void Heap_CheckFin (void); +static void Heap_ExtendHeap (LONGINT blksz); +export void Heap_FINALL (void); +static void Heap_Finalize (void); +export void Heap_GC (BOOLEAN markStack); +static void Heap_HeapSort (LONGINT n, LONGINT *a, LONGINT a__len); +export void Heap_INCREF (Heap_Module m); +export void Heap_InitHeap (void); +export void Heap_Lock (void); +static void Heap_Mark (LONGINT q); +static void Heap_MarkCandidates (LONGINT n, LONGINT *cand, LONGINT cand__len); +static void Heap_MarkP (SYSTEM_PTR p); +static void Heap_MarkStack (LONGINT n, LONGINT *cand, LONGINT cand__len); +export SYSTEM_PTR Heap_NEWBLK (LONGINT size); +export SYSTEM_PTR Heap_NEWREC (LONGINT tag); +static LONGINT Heap_NewChunk (LONGINT blksz); +export void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); +export SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); +export void Heap_REGTYP (Heap_Module m, LONGINT typ); +export void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); +static void Heap_Scan (void); +static void Heap_Sift (LONGINT l, LONGINT r, LONGINT *a, LONGINT a__len); +export void Heap_Unlock (void); + +extern void *Heap__init(); +extern LONGINT Platform_MainStackFrame; +extern LONGINT Platform_OSAllocate(LONGINT size); +#define Heap_FetchAddress(pointer) (LONGINT)(uintptr_t)(*((void**)((uintptr_t)pointer))) +#define Heap_HeapModuleInit() Heap__init() +#define Heap_OSAllocate(size) Platform_OSAllocate(size) +#define Heap_PlatformHalt(code) Platform_Halt(code) +#define Heap_PlatformMainStackFrame() Platform_MainStackFrame + +void Heap_Lock (void) +{ + Heap_lockdepth += 1; +} + +void Heap_Unlock (void) +{ + Heap_lockdepth -= 1; + if ((Heap_interrupted && Heap_lockdepth == 0)) { + Heap_PlatformHalt(((LONGINT)(-9))); + } +} + +SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) +{ + SYSTEM_PTR _o_result; + Heap_Module m; + if (__STRCMP(name, "Heap") == 0) { + __SYSNEW(m, 48); + } else { + __NEW(m, Heap_ModuleDesc); + } + m->types = 0; + m->cmds = NIL; + __COPY(name, m->name, ((LONGINT)(20))); + m->refcnt = 0; + m->enumPtrs = enumPtrs; + m->next = (Heap_Module)(uintptr_t)Heap_modules; + Heap_modules = (SYSTEM_PTR)m; + _o_result = (void*)m; + return _o_result; +} + +void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) +{ + Heap_Cmd c; + if (__STRCMP(m->name, "Heap") == 0) { + __SYSNEW(c, 32); + } else { + __NEW(c, Heap_CmdDesc); + } + __COPY(name, c->name, ((LONGINT)(24))); + c->cmd = cmd; + c->next = m->cmds; + m->cmds = c; +} + +void Heap_REGTYP (Heap_Module m, LONGINT typ) +{ + __PUT(typ, m->types, LONGINT); + m->types = typ; +} + +void Heap_INCREF (Heap_Module m) +{ + m->refcnt += 1; +} + +static LONGINT Heap_NewChunk (LONGINT blksz) +{ + LONGINT _o_result; + LONGINT chnk; + chnk = Heap_OSAllocate(blksz + 12); + if (chnk != 0) { + __PUT(chnk + 4, chnk + (12 + blksz), LONGINT); + __PUT(chnk + 12, chnk + 16, LONGINT); + __PUT(chnk + 16, blksz, LONGINT); + __PUT(chnk + 20, -4, LONGINT); + __PUT(chnk + 24, Heap_bigBlocks, LONGINT); + Heap_bigBlocks = chnk + 12; + Heap_heapsize += blksz; + } + _o_result = chnk; + return _o_result; +} + +static void Heap_ExtendHeap (LONGINT blksz) +{ + LONGINT size, chnk, j, next; + if (blksz > 160000) { + size = blksz; + } else { + size = 160000; + } + chnk = Heap_NewChunk(size); + if (chnk != 0) { + if (chnk < Heap_heap) { + __PUT(chnk, Heap_heap, LONGINT); + Heap_heap = chnk; + } else { + j = Heap_heap; + next = Heap_FetchAddress(j); + while ((next != 0 && chnk > next)) { + j = next; + next = Heap_FetchAddress(j); + } + __PUT(chnk, next, LONGINT); + __PUT(j, chnk, LONGINT); + } + if (next == 0) { + Heap_heapend = Heap_FetchAddress(chnk + 4); + } + } +} + +SYSTEM_PTR Heap_NEWREC (LONGINT tag) +{ + SYSTEM_PTR _o_result; + LONGINT i, i0, di, blksz, restsize, t, adr, end, next, prev; + SYSTEM_PTR new; + Heap_Lock(); + blksz = Heap_FetchAddress(tag); + i0 = __ASHR(blksz, 4); + i = i0; + if (i < 9) { + adr = Heap_freeList[i]; + while (adr == 0) { + i += 1; + adr = Heap_freeList[i]; + } + } + if (i < 9) { + next = Heap_FetchAddress(adr + 12); + Heap_freeList[i] = next; + if (i != i0) { + di = i - i0; + restsize = __ASHL(di, 4); + end = adr + restsize; + __PUT(end + 4, blksz, LONGINT); + __PUT(end + 8, -4, LONGINT); + __PUT(end, end + 4, LONGINT); + __PUT(adr + 4, restsize, LONGINT); + __PUT(adr + 12, Heap_freeList[di], LONGINT); + Heap_freeList[di] = adr; + adr += restsize; + } + } else { + adr = Heap_bigBlocks; + prev = 0; + for (;;) { + if (adr == 0) { + if (Heap_firstTry) { + Heap_GC(1); + blksz += 16; + if (__ASHL((Heap_heapsize - Heap_allocated) - blksz, 2) < Heap_heapsize) { + Heap_ExtendHeap(__ASHL(__DIV(Heap_allocated + blksz, 48), 6) - Heap_heapsize); + } + Heap_firstTry = 0; + new = Heap_NEWREC(tag); + Heap_firstTry = 1; + if (new == NIL) { + Heap_ExtendHeap(__ASHL(__DIV(Heap_allocated + blksz, 48), 6) - Heap_heapsize); + new = Heap_NEWREC(tag); + } + Heap_Unlock(); + _o_result = new; + return _o_result; + } else { + Heap_Unlock(); + _o_result = NIL; + return _o_result; + } + } + t = Heap_FetchAddress(adr + 4); + if (t >= blksz) { + break; + } + prev = adr; + adr = Heap_FetchAddress(adr + 12); + } + restsize = t - blksz; + end = adr + restsize; + __PUT(end + 4, blksz, LONGINT); + __PUT(end + 8, -4, LONGINT); + __PUT(end, end + 4, LONGINT); + if (restsize > 144) { + __PUT(adr + 4, restsize, LONGINT); + } else { + next = Heap_FetchAddress(adr + 12); + if (prev == 0) { + Heap_bigBlocks = next; + } else { + __PUT(prev + 12, next, LONGINT); + } + if (restsize > 0) { + di = __ASHR(restsize, 4); + __PUT(adr + 4, restsize, LONGINT); + __PUT(adr + 12, Heap_freeList[di], LONGINT); + Heap_freeList[di] = adr; + } + } + adr += restsize; + } + i = adr + 16; + end = adr + blksz; + while (i < end) { + __PUT(i, 0, LONGINT); + __PUT(i + 4, 0, LONGINT); + __PUT(i + 8, 0, LONGINT); + __PUT(i + 12, 0, LONGINT); + i += 16; + } + __PUT(adr + 12, 0, LONGINT); + __PUT(adr, tag, LONGINT); + __PUT(adr + 4, 0, LONGINT); + __PUT(adr + 8, 0, LONGINT); + Heap_allocated += blksz; + Heap_Unlock(); + _o_result = (SYSTEM_PTR)(uintptr_t)(adr + 4); + return _o_result; +} + +SYSTEM_PTR Heap_NEWBLK (LONGINT size) +{ + SYSTEM_PTR _o_result; + LONGINT blksz, tag; + SYSTEM_PTR new; + Heap_Lock(); + blksz = __ASHL(__ASHR(size + 31, 4), 4); + new = Heap_NEWREC((LONGINT)(uintptr_t)&blksz); + tag = ((LONGINT)(uintptr_t)new + blksz) - 12; + __PUT(tag - 4, 0, LONGINT); + __PUT(tag, blksz, LONGINT); + __PUT(tag + 4, -4, LONGINT); + __PUT((LONGINT)(uintptr_t)new - 4, tag, LONGINT); + Heap_Unlock(); + _o_result = new; + return _o_result; +} + +static void Heap_Mark (LONGINT q) +{ + LONGINT p, tag, fld, n, offset, tagbits; + if (q != 0) { + tagbits = Heap_FetchAddress(q - 4); + if (!__ODD(tagbits)) { + __PUT(q - 4, tagbits + 1, LONGINT); + p = 0; + tag = tagbits + 4; + for (;;) { + __GET(tag, offset, LONGINT); + if (offset < 0) { + __PUT(q - 4, (tag + offset) + 1, LONGINT); + if (p == 0) { + break; + } + n = q; + q = p; + tag = Heap_FetchAddress(q - 4); + tag -= 1; + __GET(tag, offset, LONGINT); + fld = q + offset; + p = Heap_FetchAddress(fld); + __PUT(fld, (SYSTEM_PTR)(uintptr_t)n, SYSTEM_PTR); + } else { + fld = q + offset; + n = Heap_FetchAddress(fld); + if (n != 0) { + tagbits = Heap_FetchAddress(n - 4); + if (!__ODD(tagbits)) { + __PUT(n - 4, tagbits + 1, LONGINT); + __PUT(q - 4, tag + 1, LONGINT); + __PUT(fld, (SYSTEM_PTR)(uintptr_t)p, SYSTEM_PTR); + p = q; + q = n; + tag = tagbits; + } + } + } + tag += 4; + } + } + } +} + +static void Heap_MarkP (SYSTEM_PTR p) +{ + Heap_Mark((LONGINT)(uintptr_t)p); +} + +static void Heap_Scan (void) +{ + LONGINT chnk, adr, end, start, tag, i, size, freesize; + Heap_bigBlocks = 0; + i = 1; + while (i < 9) { + Heap_freeList[i] = 0; + i += 1; + } + freesize = 0; + Heap_allocated = 0; + chnk = Heap_heap; + while (chnk != 0) { + adr = chnk + 12; + end = Heap_FetchAddress(chnk + 4); + while (adr < end) { + tag = Heap_FetchAddress(adr); + if (__ODD(tag)) { + if (freesize > 0) { + start = adr - freesize; + __PUT(start, start + 4, LONGINT); + __PUT(start + 4, freesize, LONGINT); + __PUT(start + 8, -4, LONGINT); + i = __ASHR(freesize, 4); + freesize = 0; + if (i < 9) { + __PUT(start + 12, Heap_freeList[i], LONGINT); + Heap_freeList[i] = start; + } else { + __PUT(start + 12, Heap_bigBlocks, LONGINT); + Heap_bigBlocks = start; + } + } + tag -= 1; + __PUT(adr, tag, LONGINT); + size = Heap_FetchAddress(tag); + Heap_allocated += size; + adr += size; + } else { + size = Heap_FetchAddress(tag); + freesize += size; + adr += size; + } + } + if (freesize > 0) { + start = adr - freesize; + __PUT(start, start + 4, LONGINT); + __PUT(start + 4, freesize, LONGINT); + __PUT(start + 8, -4, LONGINT); + i = __ASHR(freesize, 4); + freesize = 0; + if (i < 9) { + __PUT(start + 12, Heap_freeList[i], LONGINT); + Heap_freeList[i] = start; + } else { + __PUT(start + 12, Heap_bigBlocks, LONGINT); + Heap_bigBlocks = start; + } + } + chnk = Heap_FetchAddress(chnk); + } +} + +static void Heap_Sift (LONGINT l, LONGINT r, LONGINT *a, LONGINT a__len) +{ + LONGINT i, j, x; + j = l; + x = a[j]; + for (;;) { + i = j; + j = __ASHL(j, 1) + 1; + if ((j < r && a[j] < a[j + 1])) { + j += 1; + } + if (j > r || a[j] <= x) { + break; + } + a[i] = a[j]; + } + a[i] = x; +} + +static void Heap_HeapSort (LONGINT n, LONGINT *a, LONGINT a__len) +{ + LONGINT l, r, x; + l = __ASHR(n, 1); + r = n - 1; + while (l > 0) { + l -= 1; + Heap_Sift(l, r, (void*)a, a__len); + } + while (r > 0) { + x = a[0]; + a[0] = a[r]; + a[r] = x; + r -= 1; + Heap_Sift(l, r, (void*)a, a__len); + } +} + +static void Heap_MarkCandidates (LONGINT n, LONGINT *cand, LONGINT cand__len) +{ + LONGINT chnk, adr, tag, next, lim, lim1, i, ptr, size; + chnk = Heap_heap; + i = 0; + lim = cand[n - 1]; + while ((chnk != 0 && chnk < lim)) { + adr = chnk + 12; + lim1 = Heap_FetchAddress(chnk + 4); + if (lim < lim1) { + lim1 = lim; + } + while (adr < lim1) { + tag = Heap_FetchAddress(adr); + if (__ODD(tag)) { + size = Heap_FetchAddress(tag - 1); + adr += size; + } else { + size = Heap_FetchAddress(tag); + ptr = adr + 4; + while (cand[i] < ptr) { + i += 1; + } + if (i == n) { + return; + } + next = adr + size; + if (cand[i] < next) { + Heap_Mark(ptr); + } + adr = next; + } + } + chnk = Heap_FetchAddress(chnk); + } +} + +static void Heap_CheckFin (void) +{ + Heap_FinNode n; + LONGINT tag; + n = Heap_fin; + while (n != NIL) { + tag = Heap_FetchAddress(n->obj - 4); + if (!__ODD(tag)) { + n->marked = 0; + Heap_Mark(n->obj); + } else { + n->marked = 1; + } + n = n->next; + } +} + +static void Heap_Finalize (void) +{ + Heap_FinNode n, prev; + n = Heap_fin; + prev = NIL; + while (n != NIL) { + if (!n->marked) { + if (n == Heap_fin) { + Heap_fin = Heap_fin->next; + } else { + prev->next = n->next; + } + (*n->finalize)((SYSTEM_PTR)(uintptr_t)n->obj); + if (prev == NIL) { + n = Heap_fin; + } else { + n = n->next; + } + } else { + prev = n; + n = n->next; + } + } +} + +void Heap_FINALL (void) +{ + Heap_FinNode n; + while (Heap_fin != NIL) { + n = Heap_fin; + Heap_fin = Heap_fin->next; + (*n->finalize)((SYSTEM_PTR)(uintptr_t)n->obj); + } +} + +static void Heap_MarkStack (LONGINT n, LONGINT *cand, LONGINT cand__len) +{ + SYSTEM_PTR frame; + LONGINT inc, nofcand, sp, p, stack0, ptr; + struct Heap__1 align; + if (n > 0) { + Heap_MarkStack(n - 1, cand, cand__len); + if (n > 100) { + return; + } + } + if (n == 0) { + nofcand = 0; + sp = (LONGINT)(uintptr_t)&frame; + stack0 = Heap_PlatformMainStackFrame(); + inc = (LONGINT)(uintptr_t)&align.p - (LONGINT)(uintptr_t)&align; + if (sp > stack0) { + inc = -inc; + } + while (sp != stack0) { + __GET(sp, p, LONGINT); + if ((p > Heap_heap && p < Heap_heapend)) { + if (nofcand == cand__len) { + Heap_HeapSort(nofcand, (void*)cand, cand__len); + Heap_MarkCandidates(nofcand, (void*)cand, cand__len); + nofcand = 0; + } + cand[nofcand] = p; + nofcand += 1; + } + sp += inc; + } + if (nofcand > 0) { + Heap_HeapSort(nofcand, (void*)cand, cand__len); + Heap_MarkCandidates(nofcand, (void*)cand, cand__len); + } + } +} + +void Heap_GC (BOOLEAN markStack) +{ + Heap_Module m; + LONGINT i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; + LONGINT cand[10000]; + if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { + Heap_Lock(); + m = (Heap_Module)(uintptr_t)Heap_modules; + while (m != NIL) { + if (m->enumPtrs != NIL) { + (*m->enumPtrs)(Heap_MarkP); + } + m = m->next; + } + if (markStack) { + i0 = -100; + i1 = -101; + i2 = -102; + i3 = -103; + i4 = -104; + i5 = -105; + i6 = -106; + i7 = -107; + i8 = 1; + i9 = 2; + i10 = 3; + i11 = 4; + i12 = 5; + i13 = 6; + i14 = 7; + i15 = 8; + i16 = 9; + i17 = 10; + i18 = 11; + i19 = 12; + i20 = 13; + i21 = 14; + i22 = 15; + i23 = 16; + for (;;) { + i0 += 1; + i1 += 2; + i2 += 3; + i3 += 4; + i4 += 5; + i5 += 6; + i6 += 7; + i7 += 8; + i8 += 9; + i9 += 10; + i10 += 11; + i11 += 12; + i12 += 13; + i13 += 14; + i14 += 15; + i15 += 16; + i16 += 17; + i17 += 18; + i18 += 19; + i19 += 20; + i20 += 21; + i21 += 22; + i22 += 23; + i23 += 24; + if ((i0 == -99 && i15 == 24)) { + Heap_MarkStack(((LONGINT)(32)), (void*)cand, ((LONGINT)(10000))); + break; + } + } + if (((((((((((((((((((((((i0 + i1) + i2) + i3) + i4) + i5) + i6) + i7) + i8) + i9) + i10) + i11) + i12) + i13) + i14) + i15) + i16) + i17) + i18) + i19) + i20) + i21) + i22) + i23 > 10000) { + return; + } + } + Heap_CheckFin(); + Heap_Scan(); + Heap_Finalize(); + Heap_Unlock(); + } +} + +void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) +{ + Heap_FinNode f; + __NEW(f, Heap_FinDesc); + f->obj = (LONGINT)(uintptr_t)obj; + f->finalize = finalize; + f->marked = 1; + f->next = Heap_fin; + Heap_fin = f; +} + +void Heap_InitHeap (void) +{ + Heap_heap = Heap_NewChunk(128000); + Heap_heapend = Heap_FetchAddress(Heap_heap + 4); + __PUT(Heap_heap, 0, LONGINT); + Heap_allocated = 0; + Heap_firstTry = 1; + Heap_freeList[9] = 1; + Heap_lockdepth = 0; + Heap_FileCount = 0; + Heap_modules = NIL; + Heap_heapsize = 0; + Heap_bigBlocks = 0; + Heap_fin = NIL; + Heap_interrupted = 0; + Heap_HeapModuleInit(); +} + +static void EnumPtrs(void (*P)(void*)) +{ + P(Heap_modules); + P(Heap_fin); +} + +__TDESC(Heap_ModuleDesc, 1, 2) = {__TDFLDS("ModuleDesc", 48), {0, 28, -12}}; +__TDESC(Heap_CmdDesc, 1, 1) = {__TDFLDS("CmdDesc", 32), {0, -8}}; +__TDESC(Heap_FinDesc, 1, 1) = {__TDFLDS("FinDesc", 16), {0, -8}}; +__TDESC(Heap__1, 1, 1) = {__TDFLDS("", 8), {4, -8}}; + +export void *Heap__init(void) +{ + __DEFMOD; + __REGMOD("Heap", EnumPtrs); + __REGCMD("FINALL", Heap_FINALL); + __REGCMD("InitHeap", Heap_InitHeap); + __REGCMD("Lock", Heap_Lock); + __REGCMD("Unlock", Heap_Unlock); + __INITYP(Heap_ModuleDesc, Heap_ModuleDesc, 0); + __INITYP(Heap_CmdDesc, Heap_CmdDesc, 0); + __INITYP(Heap_FinDesc, Heap_FinDesc, 0); + __INITYP(Heap__1, Heap__1, 0); +/* BEGIN */ + __ENDMOD; +} diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h new file mode 100644 index 00000000..d270a455 --- /dev/null +++ b/bootstrap/unix-48/Heap.h @@ -0,0 +1,54 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin tskSfF */ + +#ifndef Heap__h +#define Heap__h + +#include "SYSTEM.h" + +typedef + CHAR Heap_CmdName[24]; + +typedef + void (*Heap_Command)(void); + +typedef + void (*Heap_EnumProc)(void(*)(SYSTEM_PTR)); + +typedef + void (*Heap_Finalizer)(SYSTEM_PTR); + +typedef + struct Heap_ModuleDesc *Heap_Module; + +typedef + struct Heap_ModuleDesc { + LONGINT _prvt0; + char _prvt1[44]; + } Heap_ModuleDesc; + +typedef + CHAR Heap_ModuleName[20]; + + +import SYSTEM_PTR Heap_modules; +import LONGINT Heap_allocated, Heap_heapsize; +import INTEGER Heap_FileCount; + +import LONGINT *Heap_ModuleDesc__typ; + +import void Heap_FINALL (void); +import void Heap_GC (BOOLEAN markStack); +import void Heap_INCREF (Heap_Module m); +import void Heap_InitHeap (void); +import void Heap_Lock (void); +import SYSTEM_PTR Heap_NEWBLK (LONGINT size); +import SYSTEM_PTR Heap_NEWREC (LONGINT tag); +import void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); +import SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); +import void Heap_REGTYP (Heap_Module m, LONGINT typ); +import void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); +import void Heap_Unlock (void); +import void *Heap__init(void); + + +#endif diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c new file mode 100644 index 00000000..6c0f5e0b --- /dev/null +++ b/bootstrap/unix-48/Modules.c @@ -0,0 +1,171 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +#include "SYSTEM.h" +#include "Console.h" +#include "Heap.h" + +typedef + struct Modules_CmdDesc *Modules_Cmd; + +typedef + void (*Modules_Command)(void); + +typedef + struct Modules_CmdDesc { + Modules_Cmd next; + CHAR name[24]; + Modules_Command cmd; + } Modules_CmdDesc; + +typedef + struct Modules_ModuleDesc *Modules_Module; + +typedef + CHAR Modules_ModuleName[20]; + +typedef + struct Modules_ModuleDesc { + Modules_Module next; + Modules_ModuleName name; + LONGINT refcnt; + Modules_Cmd cmds; + LONGINT types; + void (*enumPtrs)(void(*)(LONGINT)); + LONGINT reserved1, reserved2; + } Modules_ModuleDesc; + + +export INTEGER Modules_res; +export CHAR Modules_resMsg[256]; +export Modules_ModuleName Modules_imported, Modules_importing; + +export LONGINT *Modules_ModuleDesc__typ; +export LONGINT *Modules_CmdDesc__typ; + +static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len); +export void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all); +export Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len); +export Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len); + +#define Modules_modules() (Modules_Module)Heap_modules +#define Modules_setmodules(m) Heap_modules = m + +static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len) +{ + INTEGER i, j; + __DUP(b, b__len, CHAR); + i = 0; + while (a[__X(i, a__len)] != 0x00) { + i += 1; + } + j = 0; + while (b[__X(j, b__len)] != 0x00) { + a[__X(i, a__len)] = b[__X(j, b__len)]; + i += 1; + j += 1; + } + a[__X(i, a__len)] = 0x00; + __DEL(b); +} + +Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len) +{ + Modules_Module _o_result; + Modules_Module m = NIL; + CHAR bodyname[64]; + Modules_Command body; + __DUP(name, name__len, CHAR); + m = Modules_modules(); + while ((m != NIL && __STRCMP(m->name, name) != 0)) { + m = m->next; + } + if (m != NIL) { + Modules_res = 0; + Modules_resMsg[0] = 0x00; + } else { + Modules_res = 1; + __COPY(name, Modules_importing, ((LONGINT)(20))); + __MOVE(" module \"", Modules_resMsg, 10); + Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), name, name__len); + Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), (CHAR*)"\" not found", (LONGINT)12); + } + _o_result = m; + __DEL(name); + return _o_result; +} + +Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len) +{ + Modules_Command _o_result; + Modules_Cmd c = NIL; + __DUP(name, name__len, CHAR); + c = mod->cmds; + while ((c != NIL && __STRCMP(c->name, name) != 0)) { + c = c->next; + } + if (c != NIL) { + Modules_res = 0; + Modules_resMsg[0] = 0x00; + _o_result = c->cmd; + __DEL(name); + return _o_result; + } else { + Modules_res = 2; + __MOVE(" command \"", Modules_resMsg, 11); + __COPY(name, Modules_importing, ((LONGINT)(20))); + Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), mod->name, ((LONGINT)(20))); + Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), (CHAR*)".", (LONGINT)2); + Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), name, name__len); + Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), (CHAR*)"\" not found", (LONGINT)12); + _o_result = NIL; + __DEL(name); + return _o_result; + } + __RETCHK; +} + +void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all) +{ + Modules_Module m = NIL, p = NIL; + __DUP(name, name__len, CHAR); + m = Modules_modules(); + if (all) { + Modules_res = 1; + __MOVE("unloading \"all\" not yet supported", Modules_resMsg, 34); + } else { + while ((m != NIL && __STRCMP(m->name, name) != 0)) { + p = m; + m = m->next; + } + if ((m != NIL && m->refcnt == 0)) { + if (m == Modules_modules()) { + Modules_setmodules(m->next); + } else { + p->next = m->next; + } + Modules_res = 0; + } else { + Modules_res = 1; + if (m == NIL) { + __MOVE("module not found", Modules_resMsg, 17); + } else { + __MOVE("clients of this module exist", Modules_resMsg, 29); + } + } + } + __DEL(name); +} + +__TDESC(Modules_ModuleDesc, 1, 2) = {__TDFLDS("ModuleDesc", 48), {0, 28, -12}}; +__TDESC(Modules_CmdDesc, 1, 1) = {__TDFLDS("CmdDesc", 32), {0, -8}}; + +export void *Modules__init(void) +{ + __DEFMOD; + __MODULE_IMPORT(Console); + __MODULE_IMPORT(Heap); + __REGMOD("Modules", 0); + __INITYP(Modules_ModuleDesc, Modules_ModuleDesc, 0); + __INITYP(Modules_CmdDesc, Modules_CmdDesc, 0); +/* BEGIN */ + __ENDMOD; +} diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h new file mode 100644 index 00000000..5968d1aa --- /dev/null +++ b/bootstrap/unix-48/Modules.h @@ -0,0 +1,54 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ + +#ifndef Modules__h +#define Modules__h + +#include "SYSTEM.h" + +typedef + struct Modules_CmdDesc *Modules_Cmd; + +typedef + void (*Modules_Command)(void); + +typedef + struct Modules_CmdDesc { + Modules_Cmd next; + CHAR name[24]; + Modules_Command cmd; + } Modules_CmdDesc; + +typedef + struct Modules_ModuleDesc *Modules_Module; + +typedef + CHAR Modules_ModuleName[20]; + +typedef + struct Modules_ModuleDesc { + Modules_Module next; + Modules_ModuleName name; + LONGINT refcnt; + Modules_Cmd cmds; + LONGINT types; + void (*enumPtrs)(void(*)(LONGINT)); + char _prvt0[8]; + } Modules_ModuleDesc; + + +import INTEGER Modules_res; +import CHAR Modules_resMsg[256]; +import Modules_ModuleName Modules_imported, Modules_importing; + +import LONGINT *Modules_ModuleDesc__typ; +import LONGINT *Modules_CmdDesc__typ; + +import void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all); +import Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len); +import Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len); +import void *Modules__init(void); + +#define Modules_modules() (Modules_Module)Heap_modules +#define Modules_setmodules(m) Heap_modules = m + +#endif diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c new file mode 100644 index 00000000..0c22a7a7 --- /dev/null +++ b/bootstrap/unix-48/OPB.c @@ -0,0 +1,2677 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +#include "SYSTEM.h" +#include "OPM.h" +#include "OPS.h" +#include "OPT.h" + + +export void (*OPB_typSize)(OPT_Struct); +static INTEGER OPB_exp; +static LONGINT OPB_maxExp; + + +export void OPB_Assign (OPT_Node *x, OPT_Node y); +static void OPB_BindNodes (SHORTINT class, OPT_Struct typ, OPT_Node *x, OPT_Node y); +static LONGINT OPB_BoolToInt (BOOLEAN b); +export void OPB_Call (OPT_Node *x, OPT_Node apar, OPT_Object fp); +static void OPB_CharToString (OPT_Node n); +static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode); +static void OPB_CheckLeaf (OPT_Node x, BOOLEAN dynArrToo); +export void OPB_CheckParameters (OPT_Object fp, OPT_Object ap, BOOLEAN checkNames); +static void OPB_CheckProc (OPT_Struct x, OPT_Object y); +static void OPB_CheckPtr (OPT_Node x, OPT_Node y); +static void OPB_CheckRealType (INTEGER f, INTEGER nr, OPT_Const x); +static void OPB_CheckReceiver (OPT_Node *x, OPT_Object fp); +static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y); +export void OPB_Construct (SHORTINT class, OPT_Node *x, OPT_Node y); +static void OPB_Convert (OPT_Node *x, OPT_Struct typ); +export void OPB_DeRef (OPT_Node *x); +static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpar); +export OPT_Node OPB_EmptySet (void); +export void OPB_Enter (OPT_Node *procdec, OPT_Node stat, OPT_Object proc); +export void OPB_Field (OPT_Node *x, OPT_Object y); +export void OPB_In (OPT_Node *x, OPT_Node y); +export void OPB_Index (OPT_Node *x, OPT_Node y); +export void OPB_Inittd (OPT_Node *inittd, OPT_Node *last, OPT_Struct typ); +static BOOLEAN OPB_IntToBool (LONGINT i); +export void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y); +export void OPB_MOp (SHORTINT op, OPT_Node *x); +export OPT_Node OPB_NewBoolConst (BOOLEAN boolval); +export OPT_Node OPB_NewIntConst (LONGINT intval); +export OPT_Node OPB_NewLeaf (OPT_Object obj); +export OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ); +export OPT_Node OPB_NewString (OPS_String str, LONGINT len); +export OPT_Node OPB_Nil (void); +static BOOLEAN OPB_NotVar (OPT_Node x); +export void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y); +export void OPB_OptIf (OPT_Node *x); +export void OPB_Param (OPT_Node ap, OPT_Object fp); +export void OPB_PrepCall (OPT_Node *x, OPT_Object *fpar); +export void OPB_Return (OPT_Node *x, OPT_Object proc); +export void OPB_SetElem (OPT_Node *x); +static void OPB_SetIntType (OPT_Node node); +export void OPB_SetRange (OPT_Node *x, OPT_Node y); +export void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno); +export void OPB_StPar0 (OPT_Node *par0, INTEGER fctno); +export void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno); +export void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n); +export void OPB_StaticLink (SHORTINT dlev); +export void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard); +static void OPB_err (INTEGER n); +static LONGINT OPB_log (LONGINT x); + + +static void OPB_err (INTEGER n) +{ + OPM_err(n); +} + +OPT_Node OPB_NewLeaf (OPT_Object obj) +{ + OPT_Node _o_result; + OPT_Node node = NIL; + switch (obj->mode) { + case 1: + node = OPT_NewNode(0); + node->readonly = (obj->vis == 2 && obj->mnolev < 0); + break; + case 2: + node = OPT_NewNode(1); + break; + case 3: + node = OPT_NewNode(7); + node->conval = OPT_NewConst(); + __GUARDEQP(node->conval, OPT_ConstDesc) = *obj->conval; + break; + case 5: + node = OPT_NewNode(8); + break; + case 6: case 7: case 8: case 9: case 10: + node = OPT_NewNode(9); + break; + default: + OPB_err(127); + node = OPT_NewNode(0); + break; + } + node->obj = obj; + node->typ = obj->typ; + _o_result = node; + return _o_result; +} + +void OPB_Construct (SHORTINT class, OPT_Node *x, OPT_Node y) +{ + OPT_Node node = NIL; + node = OPT_NewNode(class); + node->typ = OPT_notyp; + node->left = *x; + node->right = y; + *x = node; +} + +void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y) +{ + if (*x == NIL) { + *x = y; + } else { + (*last)->link = y; + } + while (y->link != NIL) { + y = y->link; + } + *last = y; +} + +static LONGINT OPB_BoolToInt (BOOLEAN b) +{ + LONGINT _o_result; + if (b) { + _o_result = 1; + return _o_result; + } else { + _o_result = 0; + return _o_result; + } + __RETCHK; +} + +static BOOLEAN OPB_IntToBool (LONGINT i) +{ + BOOLEAN _o_result; + if (i == 0) { + _o_result = 0; + return _o_result; + } else { + _o_result = 1; + return _o_result; + } + __RETCHK; +} + +OPT_Node OPB_NewBoolConst (BOOLEAN boolval) +{ + OPT_Node _o_result; + OPT_Node x = NIL; + x = OPT_NewNode(7); + x->typ = OPT_booltyp; + x->conval = OPT_NewConst(); + x->conval->intval = OPB_BoolToInt(boolval); + _o_result = x; + return _o_result; +} + +void OPB_OptIf (OPT_Node *x) +{ + OPT_Node if_ = NIL, pred = NIL; + if_ = (*x)->left; + while (if_->left->class == 7) { + if (OPB_IntToBool(if_->left->conval->intval)) { + *x = if_->right; + return; + } else if (if_->link == NIL) { + *x = (*x)->right; + return; + } else { + if_ = if_->link; + (*x)->left = if_; + } + } + pred = if_; + if_ = if_->link; + while (if_ != NIL) { + if (if_->left->class == 7) { + if (OPB_IntToBool(if_->left->conval->intval)) { + pred->link = NIL; + (*x)->right = if_->right; + return; + } else { + if_ = if_->link; + pred->link = if_; + } + } else { + pred = if_; + if_ = if_->link; + } + } +} + +OPT_Node OPB_Nil (void) +{ + OPT_Node _o_result; + OPT_Node x = NIL; + x = OPT_NewNode(7); + x->typ = OPT_niltyp; + x->conval = OPT_NewConst(); + x->conval->intval = 0; + _o_result = x; + return _o_result; +} + +OPT_Node OPB_EmptySet (void) +{ + OPT_Node _o_result; + OPT_Node x = NIL; + x = OPT_NewNode(7); + x->typ = OPT_settyp; + x->conval = OPT_NewConst(); + x->conval->setval = 0x0; + _o_result = x; + return _o_result; +} + +static void OPB_SetIntType (OPT_Node node) +{ + LONGINT v; + v = node->conval->intval; + if ((OPM_MinSInt <= (LONGINT)v && (LONGINT)v <= OPM_MaxSInt)) { + node->typ = OPT_sinttyp; + } else if ((OPM_MinInt <= (LONGINT)v && (LONGINT)v <= OPM_MaxInt)) { + node->typ = OPT_inttyp; + } else if ((OPM_MinLInt <= v && v <= OPM_MaxLInt)) { + node->typ = OPT_linttyp; + } else { + OPB_err(203); + node->typ = OPT_sinttyp; + node->conval->intval = 1; + } +} + +OPT_Node OPB_NewIntConst (LONGINT intval) +{ + OPT_Node _o_result; + OPT_Node x = NIL; + x = OPT_NewNode(7); + x->conval = OPT_NewConst(); + x->conval->intval = intval; + OPB_SetIntType(x); + _o_result = x; + return _o_result; +} + +OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ) +{ + OPT_Node _o_result; + OPT_Node x = NIL; + x = OPT_NewNode(7); + x->conval = OPT_NewConst(); + x->conval->realval = realval; + x->typ = typ; + x->conval->intval = -1; + _o_result = x; + return _o_result; +} + +OPT_Node OPB_NewString (OPS_String str, LONGINT len) +{ + OPT_Node _o_result; + OPT_Node x = NIL; + x = OPT_NewNode(7); + x->conval = OPT_NewConst(); + x->typ = OPT_stringtyp; + x->conval->intval = -1; + x->conval->intval2 = len; + x->conval->ext = OPT_NewExt(); + __COPY(str, *x->conval->ext, ((LONGINT)(256))); + _o_result = x; + return _o_result; +} + +static void OPB_CharToString (OPT_Node n) +{ + CHAR ch; + n->typ = OPT_stringtyp; + ch = (CHAR)n->conval->intval; + n->conval->ext = OPT_NewExt(); + if (ch == 0x00) { + n->conval->intval2 = 1; + } else { + n->conval->intval2 = 2; + (*n->conval->ext)[1] = 0x00; + } + (*n->conval->ext)[0] = ch; + n->conval->intval = -1; + n->obj = NIL; +} + +static void OPB_BindNodes (SHORTINT class, OPT_Struct typ, OPT_Node *x, OPT_Node y) +{ + OPT_Node node = NIL; + node = OPT_NewNode(class); + node->typ = typ; + node->left = *x; + node->right = y; + *x = node; +} + +static BOOLEAN OPB_NotVar (OPT_Node x) +{ + BOOLEAN _o_result; + _o_result = (x->class >= 7 && ((x->class != 11 || x->subcl != 29) || x->left->class >= 7)); + return _o_result; +} + +void OPB_DeRef (OPT_Node *x) +{ + OPT_Object strobj = NIL, bstrobj = NIL; + OPT_Struct typ = NIL, btyp = NIL; + typ = (*x)->typ; + if ((*x)->class >= 7) { + OPB_err(78); + } else if (typ->form == 13) { + if (typ == OPT_sysptrtyp) { + OPB_err(57); + } + btyp = typ->BaseTyp; + strobj = typ->strobj; + bstrobj = btyp->strobj; + if ((((((strobj != NIL && strobj->name[0] != 0x00)) && bstrobj != NIL)) && bstrobj->name[0] != 0x00)) { + btyp->pbused = 1; + } + OPB_BindNodes(3, btyp, &*x, NIL); + } else { + OPB_err(84); + } +} + +void OPB_Index (OPT_Node *x, OPT_Node y) +{ + INTEGER f; + OPT_Struct typ = NIL; + f = y->typ->form; + if ((*x)->class >= 7) { + OPB_err(79); + } else if (!__IN(f, 0x70) || __IN(y->class, 0x0300)) { + OPB_err(80); + y->typ = OPT_inttyp; + } + if ((*x)->typ->comp == 2) { + typ = (*x)->typ->BaseTyp; + if ((y->class == 7 && (y->conval->intval < 0 || y->conval->intval >= (*x)->typ->n))) { + OPB_err(81); + } + } else if ((*x)->typ->comp == 3) { + typ = (*x)->typ->BaseTyp; + if ((y->class == 7 && y->conval->intval < 0)) { + OPB_err(81); + } + } else { + OPB_err(82); + typ = OPT_undftyp; + } + OPB_BindNodes(4, typ, &*x, y); + (*x)->readonly = (*x)->left->readonly; +} + +void OPB_Field (OPT_Node *x, OPT_Object y) +{ + if ((*x)->class >= 7) { + OPB_err(77); + } + if ((y != NIL && __IN(y->mode, 0x2010))) { + OPB_BindNodes(2, y->typ, &*x, NIL); + (*x)->obj = y; + (*x)->readonly = (*x)->left->readonly || (y->vis == 2 && y->mnolev < 0); + } else { + OPB_err(83); + (*x)->typ = OPT_undftyp; + } +} + +static struct TypTest__57 { + OPT_Node *x; + OPT_Object *obj; + BOOLEAN *guard; + struct TypTest__57 *lnk; +} *TypTest__57_s; + +static void GTT__58 (OPT_Struct t0, OPT_Struct t1); + +static void GTT__58 (OPT_Struct t0, OPT_Struct t1) +{ + OPT_Node node = NIL; + OPT_Struct t = NIL; + t = t0; + while ((((t != NIL && t != t1)) && t != OPT_undftyp)) { + t = t->BaseTyp; + } + if (t != t1) { + while ((((t1 != NIL && t1 != t0)) && t1 != OPT_undftyp)) { + t1 = t1->BaseTyp; + } + if (t1 == t0 || t0->form == 0) { + if (*TypTest__57_s->guard) { + OPB_BindNodes(5, NIL, &*TypTest__57_s->x, NIL); + (*TypTest__57_s->x)->readonly = (*TypTest__57_s->x)->left->readonly; + } else { + node = OPT_NewNode(11); + node->subcl = 16; + node->left = *TypTest__57_s->x; + node->obj = *TypTest__57_s->obj; + *TypTest__57_s->x = node; + } + } else { + OPB_err(85); + } + } else if (t0 != t1) { + OPB_err(85); + } else if (!*TypTest__57_s->guard) { + if ((*TypTest__57_s->x)->class == 5) { + node = OPT_NewNode(11); + node->subcl = 16; + node->left = *TypTest__57_s->x; + node->obj = *TypTest__57_s->obj; + *TypTest__57_s->x = node; + } else { + *TypTest__57_s->x = OPB_NewBoolConst(1); + } + } +} + +void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) +{ + struct TypTest__57 _s; + _s.x = x; + _s.obj = &obj; + _s.guard = &guard; + _s.lnk = TypTest__57_s; + TypTest__57_s = &_s; + if (OPB_NotVar(*x)) { + OPB_err(112); + } else if ((*x)->typ->form == 13) { + if (((*x)->typ->BaseTyp->comp != 4 && (*x)->typ != OPT_sysptrtyp)) { + OPB_err(85); + } else if (obj->typ->form == 13) { + GTT__58((*x)->typ->BaseTyp, obj->typ->BaseTyp); + } else { + OPB_err(86); + } + } else if (((((*x)->typ->comp == 4 && (*x)->class == 1)) && obj->typ->comp == 4)) { + GTT__58((*x)->typ, obj->typ); + } else { + OPB_err(87); + } + if (guard) { + (*x)->typ = obj->typ; + } else { + (*x)->typ = OPT_booltyp; + } + TypTest__57_s = _s.lnk; +} + +void OPB_In (OPT_Node *x, OPT_Node y) +{ + INTEGER f; + LONGINT k; + f = (*x)->typ->form; + if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { + OPB_err(126); + } else if ((__IN(f, 0x70) && y->typ->form == 9)) { + if ((*x)->class == 7) { + k = (*x)->conval->intval; + if (k < 0 || k > (LONGINT)OPM_MaxSet) { + OPB_err(202); + } else if (y->class == 7) { + (*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval)); + (*x)->obj = NIL; + } else { + OPB_BindNodes(12, OPT_booltyp, &*x, y); + (*x)->subcl = 15; + } + } else { + OPB_BindNodes(12, OPT_booltyp, &*x, y); + (*x)->subcl = 15; + } + } else { + OPB_err(92); + } + (*x)->typ = OPT_booltyp; +} + +static LONGINT OPB_log (LONGINT x) +{ + LONGINT _o_result; + OPB_exp = 0; + if (x > 0) { + while (!__ODD(x)) { + x = __ASHR(x, 1); + OPB_exp += 1; + } + } + _o_result = x; + return _o_result; +} + +static void OPB_CheckRealType (INTEGER f, INTEGER nr, OPT_Const x) +{ + LONGREAL min, max, r; + if (f == 7) { + min = OPM_MinReal; + max = OPM_MaxReal; + } else { + min = OPM_MinLReal; + max = OPM_MaxLReal; + } + r = __ABS(x->realval); + if (r > max || r < min) { + OPB_err(nr); + x->realval = (LONGREAL)1; + } else if (f == 7) { + x->realval = x->realval; + } + x->intval = -1; +} + +static struct MOp__28 { + struct MOp__28 *lnk; +} *MOp__28_s; + +static OPT_Node NewOp__29 (SHORTINT op, OPT_Struct typ, OPT_Node z); + +static OPT_Node NewOp__29 (SHORTINT op, OPT_Struct typ, OPT_Node z) +{ + OPT_Node _o_result; + OPT_Node node = NIL; + node = OPT_NewNode(11); + node->subcl = op; + node->typ = typ; + node->left = z; + _o_result = node; + return _o_result; +} + +void OPB_MOp (SHORTINT op, OPT_Node *x) +{ + INTEGER f; + OPT_Struct typ = NIL; + OPT_Node z = NIL; + struct MOp__28 _s; + _s.lnk = MOp__28_s; + MOp__28_s = &_s; + z = *x; + if (z->class == 8 || z->class == 9) { + OPB_err(126); + } else { + typ = z->typ; + f = typ->form; + switch (op) { + case 33: + if (f == 2) { + if (z->class == 7) { + z->conval->intval = OPB_BoolToInt(!OPB_IntToBool(z->conval->intval)); + z->obj = NIL; + } else { + z = NewOp__29(op, typ, z); + } + } else { + OPB_err(98); + } + break; + case 6: + if (!__IN(f, 0x01f0)) { + OPB_err(96); + } + break; + case 7: + if (__IN(f, 0x03f0)) { + if (z->class == 7) { + if (__IN(f, 0x70)) { + if (z->conval->intval == (-2147483647-1)) { + OPB_err(203); + } else { + z->conval->intval = -z->conval->intval; + OPB_SetIntType(z); + } + } else if (__IN(f, 0x0180)) { + z->conval->realval = -z->conval->realval; + } else { + z->conval->setval = ~z->conval->setval; + } + z->obj = NIL; + } else { + z = NewOp__29(op, typ, z); + } + } else { + OPB_err(97); + } + break; + case 21: + if (__IN(f, 0x01f0)) { + if (z->class == 7) { + if (__IN(f, 0x70)) { + if (z->conval->intval == (-2147483647-1)) { + OPB_err(203); + } else { + z->conval->intval = __ABS(z->conval->intval); + OPB_SetIntType(z); + } + } else { + z->conval->realval = __ABS(z->conval->realval); + } + z->obj = NIL; + } else { + z = NewOp__29(op, typ, z); + } + } else { + OPB_err(111); + } + break; + case 22: + if (f == 3) { + if (z->class == 7) { + z->conval->intval = (int)__CAP((CHAR)z->conval->intval); + z->obj = NIL; + } else { + z = NewOp__29(op, typ, z); + } + } else { + OPB_err(111); + z->typ = OPT_chartyp; + } + break; + case 23: + if (__IN(f, 0x70)) { + if (z->class == 7) { + z->conval->intval = OPB_BoolToInt(__ODD(z->conval->intval)); + z->obj = NIL; + } else { + z = NewOp__29(op, typ, z); + } + } else { + OPB_err(111); + } + z->typ = OPT_booltyp; + break; + case 24: + if ((((z->class == 7 && f == 3)) && z->conval->intval >= 32)) { + OPB_CharToString(z); + f = 10; + } + if (z->class < 7 || f == 10) { + z = NewOp__29(op, typ, z); + } else { + OPB_err(127); + } + z->typ = OPT_linttyp; + break; + case 25: + if ((__IN(f, 0x70) && z->class == 7)) { + if ((0 <= z->conval->intval && z->conval->intval <= -1)) { + z = NewOp__29(op, typ, z); + } else { + OPB_err(219); + } + } else { + OPB_err(69); + } + z->typ = OPT_booltyp; + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPB.MOp, op = ", (LONGINT)33); + OPM_LogWNum(op, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + } + *x = z; + MOp__28_s = _s.lnk; +} + +static void OPB_CheckPtr (OPT_Node x, OPT_Node y) +{ + INTEGER g; + OPT_Struct p = NIL, q = NIL, t = NIL; + g = y->typ->form; + if (g == 13) { + p = x->typ->BaseTyp; + q = y->typ->BaseTyp; + if ((p->comp == 4 && q->comp == 4)) { + if (p->extlev < q->extlev) { + t = p; + p = q; + q = t; + } + while ((((p != q && p != NIL)) && p != OPT_undftyp)) { + p = p->BaseTyp; + } + if (p == NIL) { + OPB_err(100); + } + } else { + OPB_err(100); + } + } else if (g != 11) { + OPB_err(100); + } +} + +void OPB_CheckParameters (OPT_Object fp, OPT_Object ap, BOOLEAN checkNames) +{ + OPT_Struct ft = NIL, at = NIL; + while (fp != NIL) { + if (ap != NIL) { + ft = fp->typ; + at = ap->typ; + while ((ft->comp == 3 && at->comp == 3)) { + ft = ft->BaseTyp; + at = at->BaseTyp; + } + if (ft != at) { + if ((ft->form == 14 && at->form == 14)) { + if (ft->BaseTyp == at->BaseTyp) { + OPB_CheckParameters(ft->link, at->link, 0); + } else { + OPB_err(117); + } + } else { + OPB_err(115); + } + } + if (fp->mode != ap->mode || (checkNames && __STRCMP(fp->name, ap->name) != 0)) { + OPB_err(115); + } + ap = ap->link; + } else { + OPB_err(116); + } + fp = fp->link; + } + if (ap != NIL) { + OPB_err(116); + } +} + +static void OPB_CheckProc (OPT_Struct x, OPT_Object y) +{ + if (__IN(y->mode, 0x04c0)) { + if (y->mode == 6) { + if (y->mnolev == 0) { + y->mode = 7; + } else { + OPB_err(73); + } + } + if (x->BaseTyp == y->typ) { + OPB_CheckParameters(x->link, y->link, 0); + } else { + OPB_err(117); + } + } else { + OPB_err(113); + } +} + +static struct ConstOp__13 { + OPT_Node *x; + INTEGER *f; + OPT_Const *xval, *yval; + struct ConstOp__13 *lnk; +} *ConstOp__13_s; + +static INTEGER ConstCmp__14 (void); + +static INTEGER ConstCmp__14 (void) +{ + INTEGER _o_result; + INTEGER res; + switch (*ConstOp__13_s->f) { + case 0: + res = 9; + break; + case 1: case 3: case 4: case 5: case 6: + if ((*ConstOp__13_s->xval)->intval < (*ConstOp__13_s->yval)->intval) { + res = 11; + } else if ((*ConstOp__13_s->xval)->intval > (*ConstOp__13_s->yval)->intval) { + res = 13; + } else { + res = 9; + } + break; + case 7: case 8: + if ((*ConstOp__13_s->xval)->realval < (*ConstOp__13_s->yval)->realval) { + res = 11; + } else if ((*ConstOp__13_s->xval)->realval > (*ConstOp__13_s->yval)->realval) { + res = 13; + } else { + res = 9; + } + break; + case 2: + if ((*ConstOp__13_s->xval)->intval != (*ConstOp__13_s->yval)->intval) { + res = 10; + } else { + res = 9; + } + break; + case 9: + if ((*ConstOp__13_s->xval)->setval != (*ConstOp__13_s->yval)->setval) { + res = 10; + } else { + res = 9; + } + break; + case 10: + if (__STRCMP(*(*ConstOp__13_s->xval)->ext, *(*ConstOp__13_s->yval)->ext) < 0) { + res = 11; + } else if (__STRCMP(*(*ConstOp__13_s->xval)->ext, *(*ConstOp__13_s->yval)->ext) > 0) { + res = 13; + } else { + res = 9; + } + break; + case 11: case 13: case 14: + if ((*ConstOp__13_s->xval)->intval != (*ConstOp__13_s->yval)->intval) { + res = 10; + } else { + res = 9; + } + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPB.ConstCmp, f = ", (LONGINT)37); + OPM_LogWNum(*ConstOp__13_s->f, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + (*ConstOp__13_s->x)->typ = OPT_booltyp; + _o_result = res; + return _o_result; +} + +static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) +{ + INTEGER f, g; + OPT_Const xval = NIL, yval = NIL; + LONGINT xv, yv; + BOOLEAN temp; + struct ConstOp__13 _s; + _s.x = &x; + _s.f = &f; + _s.xval = &xval; + _s.yval = &yval; + _s.lnk = ConstOp__13_s; + ConstOp__13_s = &_s; + f = x->typ->form; + g = y->typ->form; + xval = x->conval; + yval = y->conval; + if (f != g) { + switch (f) { + case 3: + if (g == 10) { + OPB_CharToString(x); + } else { + OPB_err(100); + y->typ = x->typ; + __GUARDEQP(yval, OPT_ConstDesc) = *xval; + } + break; + case 4: + if (__IN(g, 0x70)) { + x->typ = y->typ; + } else if (g == 7) { + x->typ = OPT_realtyp; + xval->realval = xval->intval; + } else if (g == 8) { + x->typ = OPT_lrltyp; + xval->realval = xval->intval; + } else { + OPB_err(100); + y->typ = x->typ; + __GUARDEQP(yval, OPT_ConstDesc) = *xval; + } + break; + case 5: + if (g == 4) { + y->typ = OPT_inttyp; + } else if (__IN(g, 0x70)) { + x->typ = y->typ; + } else if (g == 7) { + x->typ = OPT_realtyp; + xval->realval = xval->intval; + } else if (g == 8) { + x->typ = OPT_lrltyp; + xval->realval = xval->intval; + } else { + OPB_err(100); + y->typ = x->typ; + __GUARDEQP(yval, OPT_ConstDesc) = *xval; + } + break; + case 6: + if (__IN(g, 0x70)) { + y->typ = OPT_linttyp; + } else if (g == 7) { + x->typ = OPT_realtyp; + xval->realval = xval->intval; + } else if (g == 8) { + x->typ = OPT_lrltyp; + xval->realval = xval->intval; + } else { + OPB_err(100); + y->typ = x->typ; + __GUARDEQP(yval, OPT_ConstDesc) = *xval; + } + break; + case 7: + if (__IN(g, 0x70)) { + y->typ = x->typ; + yval->realval = yval->intval; + } else if (g == 8) { + x->typ = OPT_lrltyp; + } else { + OPB_err(100); + y->typ = x->typ; + __GUARDEQP(yval, OPT_ConstDesc) = *xval; + } + break; + case 8: + if (__IN(g, 0x70)) { + y->typ = x->typ; + yval->realval = yval->intval; + } else if (g == 7) { + y->typ = OPT_lrltyp; + } else { + OPB_err(100); + y->typ = x->typ; + __GUARDEQP(yval, OPT_ConstDesc) = *xval; + } + break; + case 10: + if (g == 3) { + OPB_CharToString(y); + g = 10; + } else { + OPB_err(100); + y->typ = x->typ; + __GUARDEQP(yval, OPT_ConstDesc) = *xval; + } + break; + case 11: + if (!__IN(g, 0x6000)) { + OPB_err(100); + } + break; + case 13: + OPB_CheckPtr(x, y); + break; + case 14: + if (g != 11) { + OPB_err(100); + } + break; + default: + OPB_err(100); + y->typ = x->typ; + __GUARDEQP(yval, OPT_ConstDesc) = *xval; + break; + } + f = x->typ->form; + } + switch (op) { + case 1: + if (__IN(f, 0x70)) { + xv = xval->intval; + yv = yval->intval; + if (((((xv == 0 || yv == 0) || (((xv > 0 && yv > 0)) && yv <= __DIV(2147483647, xv))) || (((xv > 0 && yv < 0)) && yv >= __DIV((-2147483647-1), xv))) || (((xv < 0 && yv > 0)) && xv >= __DIV((-2147483647-1), yv))) || (((((((xv < 0 && yv < 0)) && xv != (-2147483647-1))) && yv != (-2147483647-1))) && -xv <= __DIV(2147483647, -yv))) { + xval->intval = xv * yv; + OPB_SetIntType(x); + } else { + OPB_err(204); + } + } else if (__IN(f, 0x0180)) { + temp = __ABS(yval->realval) <= (LONGREAL)1; + if (temp || __ABS(xval->realval) <= 1.79769296342094e+308 / (LONGREAL)__ABS(yval->realval)) { + xval->realval = xval->realval * yval->realval; + OPB_CheckRealType(f, 204, xval); + } else { + OPB_err(204); + } + } else if (f == 9) { + xval->setval = (xval->setval & yval->setval); + } else if (f != 0) { + OPB_err(101); + } + break; + case 2: + if (__IN(f, 0x70)) { + if (yval->intval != 0) { + xval->realval = xval->intval / (REAL)yval->intval; + OPB_CheckRealType(7, 205, xval); + } else { + OPB_err(205); + xval->realval = (LONGREAL)1; + } + x->typ = OPT_realtyp; + } else if (__IN(f, 0x0180)) { + temp = __ABS(yval->realval) >= (LONGREAL)1; + if (temp || __ABS(xval->realval) <= 1.79769296342094e+308 * __ABS(yval->realval)) { + xval->realval = xval->realval / yval->realval; + OPB_CheckRealType(f, 205, xval); + } else { + OPB_err(205); + } + } else if (f == 9) { + xval->setval = xval->setval ^ yval->setval; + } else if (f != 0) { + OPB_err(102); + } + break; + case 3: + if (__IN(f, 0x70)) { + if (yval->intval != 0) { + xval->intval = __DIV(xval->intval, yval->intval); + OPB_SetIntType(x); + } else { + OPB_err(205); + } + } else if (f != 0) { + OPB_err(103); + } + break; + case 4: + if (__IN(f, 0x70)) { + if (yval->intval != 0) { + xval->intval = __MOD(xval->intval, yval->intval); + OPB_SetIntType(x); + } else { + OPB_err(205); + } + } else if (f != 0) { + OPB_err(104); + } + break; + case 5: + if (f == 2) { + xval->intval = OPB_BoolToInt((OPB_IntToBool(xval->intval) && OPB_IntToBool(yval->intval))); + } else { + OPB_err(94); + } + break; + case 6: + if (__IN(f, 0x70)) { + temp = (yval->intval >= 0 && xval->intval <= 2147483647 - yval->intval); + if (temp || (yval->intval < 0 && xval->intval >= (-2147483647-1) - yval->intval)) { + xval->intval += yval->intval; + OPB_SetIntType(x); + } else { + OPB_err(206); + } + } else if (__IN(f, 0x0180)) { + temp = (yval->realval >= (LONGREAL)0 && xval->realval <= 1.79769296342094e+308 - yval->realval); + if (temp || (yval->realval < (LONGREAL)0 && xval->realval >= -1.79769296342094e+308 - yval->realval)) { + xval->realval = xval->realval + yval->realval; + OPB_CheckRealType(f, 206, xval); + } else { + OPB_err(206); + } + } else if (f == 9) { + xval->setval = xval->setval | yval->setval; + } else if (f != 0) { + OPB_err(105); + } + break; + case 7: + if (__IN(f, 0x70)) { + if ((yval->intval >= 0 && xval->intval >= (-2147483647-1) + yval->intval) || (yval->intval < 0 && xval->intval <= 2147483647 + yval->intval)) { + xval->intval -= yval->intval; + OPB_SetIntType(x); + } else { + OPB_err(207); + } + } else if (__IN(f, 0x0180)) { + temp = (yval->realval >= (LONGREAL)0 && xval->realval >= -1.79769296342094e+308 + yval->realval); + if (temp || (yval->realval < (LONGREAL)0 && xval->realval <= 1.79769296342094e+308 + yval->realval)) { + xval->realval = xval->realval - yval->realval; + OPB_CheckRealType(f, 207, xval); + } else { + OPB_err(207); + } + } else if (f == 9) { + xval->setval = (xval->setval & ~yval->setval); + } else if (f != 0) { + OPB_err(106); + } + break; + case 8: + if (f == 2) { + xval->intval = OPB_BoolToInt(OPB_IntToBool(xval->intval) || OPB_IntToBool(yval->intval)); + } else { + OPB_err(95); + } + break; + case 9: + xval->intval = OPB_BoolToInt(ConstCmp__14() == 9); + break; + case 10: + xval->intval = OPB_BoolToInt(ConstCmp__14() != 9); + break; + case 11: + if (__IN(f, 0x2a04)) { + OPB_err(108); + } else { + xval->intval = OPB_BoolToInt(ConstCmp__14() == 11); + } + break; + case 12: + if (__IN(f, 0x2a04)) { + OPB_err(108); + } else { + xval->intval = OPB_BoolToInt(ConstCmp__14() != 13); + } + break; + case 13: + if (__IN(f, 0x2a04)) { + OPB_err(108); + } else { + xval->intval = OPB_BoolToInt(ConstCmp__14() == 13); + } + break; + case 14: + if (__IN(f, 0x2a04)) { + OPB_err(108); + } else { + xval->intval = OPB_BoolToInt(ConstCmp__14() != 11); + } + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPB.ConstOp, op = ", (LONGINT)37); + OPM_LogWNum(op, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + ConstOp__13_s = _s.lnk; +} + +static void OPB_Convert (OPT_Node *x, OPT_Struct typ) +{ + OPT_Node node = NIL; + INTEGER f, g; + LONGINT k; + LONGREAL r; + f = (*x)->typ->form; + g = typ->form; + if ((*x)->class == 7) { + if (__IN(f, 0x70)) { + if (__IN(g, 0x70)) { + if (f > g) { + OPB_SetIntType(*x); + if ((int)(*x)->typ->form > g) { + OPB_err(203); + (*x)->conval->intval = 1; + } + } + } else if (__IN(g, 0x0180)) { + (*x)->conval->realval = (*x)->conval->intval; + (*x)->conval->intval = -1; + } else { + k = (*x)->conval->intval; + if (0 > k || k > 255) { + OPB_err(220); + } + } + } else if (__IN(f, 0x0180)) { + if (__IN(g, 0x0180)) { + OPB_CheckRealType(g, 203, (*x)->conval); + } else { + r = (*x)->conval->realval; + if (r < -2.14748364800000e+009 || r > 2.14748364700000e+009) { + OPB_err(203); + r = (LONGREAL)1; + } + (*x)->conval->intval = __ENTIER(r); + OPB_SetIntType(*x); + } + } + (*x)->obj = NIL; + } else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((int)(*x)->left->typ->form < f || f > g))) { + if ((*x)->left->typ == typ) { + *x = (*x)->left; + } + } else { + node = OPT_NewNode(11); + node->subcl = 20; + node->left = *x; + *x = node; + } + (*x)->typ = typ; +} + +static struct Op__38 { + INTEGER *f, *g; + struct Op__38 *lnk; +} *Op__38_s; + +static void NewOp__39 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y); +static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y); + +static void NewOp__39 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y) +{ + OPT_Node node = NIL; + node = OPT_NewNode(12); + node->subcl = op; + node->typ = typ; + node->left = *x; + node->right = y; + *x = node; +} + +static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) +{ + BOOLEAN _o_result; + BOOLEAN ok, xCharArr, yCharArr; + xCharArr = (__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp->form == 3) || *Op__38_s->f == 10; + yCharArr = (__IN((*y)->typ->comp, 0x0c) && (*y)->typ->BaseTyp->form == 3) || *Op__38_s->g == 10; + if ((((xCharArr && *Op__38_s->g == 3)) && (*y)->class == 7)) { + OPB_CharToString(*y); + *Op__38_s->g = 10; + yCharArr = 1; + } + if ((((yCharArr && *Op__38_s->f == 3)) && (*x)->class == 7)) { + OPB_CharToString(*x); + *Op__38_s->f = 10; + xCharArr = 1; + } + ok = (xCharArr && yCharArr); + if (ok) { + if ((*Op__38_s->f == 10 && (*x)->conval->intval2 == 1)) { + (*x)->typ = OPT_chartyp; + (*x)->conval->intval = 0; + OPB_Index(&*y, OPB_NewIntConst(((LONGINT)(0)))); + } else if ((*Op__38_s->g == 10 && (*y)->conval->intval2 == 1)) { + (*y)->typ = OPT_chartyp; + (*y)->conval->intval = 0; + OPB_Index(&*x, OPB_NewIntConst(((LONGINT)(0)))); + } + } + _o_result = ok; + return _o_result; +} + +void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) +{ + INTEGER f, g; + OPT_Node t = NIL, z = NIL; + OPT_Struct typ = NIL; + BOOLEAN do_; + LONGINT val; + struct Op__38 _s; + _s.f = &f; + _s.g = &g; + _s.lnk = Op__38_s; + Op__38_s = &_s; + z = *x; + if (((z->class == 8 || z->class == 9) || y->class == 8) || y->class == 9) { + OPB_err(126); + } else if ((z->class == 7 && y->class == 7)) { + OPB_ConstOp(op, z, y); + z->obj = NIL; + } else { + if (z->typ != y->typ) { + g = y->typ->form; + switch (z->typ->form) { + case 3: + if (z->class == 7) { + OPB_CharToString(z); + } else { + OPB_err(100); + } + break; + case 4: + if (__IN(g, 0x01f0)) { + OPB_Convert(&z, y->typ); + } else { + OPB_err(100); + } + break; + case 5: + if (g == 4) { + OPB_Convert(&y, z->typ); + } else if (__IN(g, 0x01f0)) { + OPB_Convert(&z, y->typ); + } else { + OPB_err(100); + } + break; + case 6: + if (__IN(g, 0x70)) { + OPB_Convert(&y, z->typ); + } else if (__IN(g, 0x0180)) { + OPB_Convert(&z, y->typ); + } else { + OPB_err(100); + } + break; + case 7: + if (__IN(g, 0x70)) { + OPB_Convert(&y, z->typ); + } else if (__IN(g, 0x0180)) { + OPB_Convert(&z, y->typ); + } else { + OPB_err(100); + } + break; + case 8: + if (__IN(g, 0x01f0)) { + OPB_Convert(&y, z->typ); + } else if (__IN(g, 0x0180)) { + OPB_Convert(&y, z->typ); + } else { + OPB_err(100); + } + break; + case 11: + if (!__IN(g, 0x6000)) { + OPB_err(100); + } + break; + case 13: + OPB_CheckPtr(z, y); + break; + case 14: + if (g != 11) { + OPB_err(100); + } + break; + case 10: + break; + case 15: + if (z->typ->comp == 4) { + OPB_err(100); + } + break; + default: + OPB_err(100); + break; + } + } + typ = z->typ; + f = typ->form; + g = y->typ->form; + switch (op) { + case 1: + do_ = 1; + if (__IN(f, 0x70)) { + if (z->class == 7) { + val = z->conval->intval; + if (val == 1) { + do_ = 0; + z = y; + } else if (val == 0) { + do_ = 0; + } else if (OPB_log(val) == 1) { + t = y; + y = z; + z = t; + op = 17; + y->typ = OPT_sinttyp; + y->conval->intval = OPB_exp; + y->obj = NIL; + } + } else if (y->class == 7) { + val = y->conval->intval; + if (val == 1) { + do_ = 0; + } else if (val == 0) { + do_ = 0; + z = y; + } else if (OPB_log(val) == 1) { + op = 17; + y->typ = OPT_sinttyp; + y->conval->intval = OPB_exp; + y->obj = NIL; + } + } + } else if (!__IN(f, 0x0381)) { + OPB_err(105); + typ = OPT_undftyp; + } + if (do_) { + NewOp__39(op, typ, &z, y); + } + break; + case 2: + if (__IN(f, 0x70)) { + if ((y->class == 7 && y->conval->intval == 0)) { + OPB_err(205); + } + OPB_Convert(&z, OPT_realtyp); + OPB_Convert(&y, OPT_realtyp); + typ = OPT_realtyp; + } else if (__IN(f, 0x0180)) { + if ((y->class == 7 && y->conval->realval == (LONGREAL)0)) { + OPB_err(205); + } + } else if ((f != 9 && f != 0)) { + OPB_err(102); + typ = OPT_undftyp; + } + NewOp__39(op, typ, &z, y); + break; + case 3: + do_ = 1; + if (__IN(f, 0x70)) { + if (y->class == 7) { + val = y->conval->intval; + if (val == 0) { + OPB_err(205); + } else if (val == 1) { + do_ = 0; + } else if (OPB_log(val) == 1) { + op = 17; + y->typ = OPT_sinttyp; + y->conval->intval = -OPB_exp; + y->obj = NIL; + } + } + } else if (f != 0) { + OPB_err(103); + typ = OPT_undftyp; + } + if (do_) { + NewOp__39(op, typ, &z, y); + } + break; + case 4: + if (__IN(f, 0x70)) { + if (y->class == 7) { + if (y->conval->intval == 0) { + OPB_err(205); + } else if (OPB_log(y->conval->intval) == 1) { + op = 18; + y->conval->intval = __ASH(-1, OPB_exp); + y->obj = NIL; + } + } + } else if (f != 0) { + OPB_err(104); + typ = OPT_undftyp; + } + NewOp__39(op, typ, &z, y); + break; + case 5: + if (f == 2) { + if (z->class == 7) { + if (OPB_IntToBool(z->conval->intval)) { + z = y; + } + } else if ((y->class == 7 && OPB_IntToBool(y->conval->intval))) { + } else { + NewOp__39(op, typ, &z, y); + } + } else if (f != 0) { + OPB_err(94); + z->typ = OPT_undftyp; + } + break; + case 6: + if (!__IN(f, 0x03f1)) { + OPB_err(105); + typ = OPT_undftyp; + } + do_ = 1; + if (__IN(f, 0x70)) { + if ((z->class == 7 && z->conval->intval == 0)) { + do_ = 0; + z = y; + } + if ((y->class == 7 && y->conval->intval == 0)) { + do_ = 0; + } + } + if (do_) { + NewOp__39(op, typ, &z, y); + } + break; + case 7: + if (!__IN(f, 0x03f1)) { + OPB_err(106); + typ = OPT_undftyp; + } + if ((!__IN(f, 0x70) || y->class != 7) || y->conval->intval != 0) { + NewOp__39(op, typ, &z, y); + } + break; + case 8: + if (f == 2) { + if (z->class == 7) { + if (!OPB_IntToBool(z->conval->intval)) { + z = y; + } + } else if ((y->class == 7 && !OPB_IntToBool(y->conval->intval))) { + } else { + NewOp__39(op, typ, &z, y); + } + } else if (f != 0) { + OPB_err(95); + z->typ = OPT_undftyp; + } + break; + case 9: case 10: + if (__IN(f, 0x6bff) || strings__41(&z, &y)) { + typ = OPT_booltyp; + } else { + OPB_err(107); + typ = OPT_undftyp; + } + NewOp__39(op, typ, &z, y); + break; + case 11: case 12: case 13: case 14: + if (__IN(f, 0x01f9) || strings__41(&z, &y)) { + typ = OPT_booltyp; + } else { + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"ELSE in Op()", (LONGINT)13); + OPM_LogWLn(); + OPB_err(108); + typ = OPT_undftyp; + } + NewOp__39(op, typ, &z, y); + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPB.Op, op = ", (LONGINT)32); + OPM_LogWNum(op, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + } + *x = z; + Op__38_s = _s.lnk; +} + +void OPB_SetRange (OPT_Node *x, OPT_Node y) +{ + LONGINT k, l; + if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { + OPB_err(126); + } else if ((__IN((*x)->typ->form, 0x70) && __IN(y->typ->form, 0x70))) { + if ((*x)->class == 7) { + k = (*x)->conval->intval; + if (0 > k || k > (LONGINT)OPM_MaxSet) { + OPB_err(202); + } + } + if (y->class == 7) { + l = y->conval->intval; + if (0 > l || l > (LONGINT)OPM_MaxSet) { + OPB_err(202); + } + } + if (((*x)->class == 7 && y->class == 7)) { + if (k <= l) { + (*x)->conval->setval = __SETRNG(k, l); + } else { + OPB_err(201); + (*x)->conval->setval = __SETRNG(l, k); + } + (*x)->obj = NIL; + } else { + OPB_BindNodes(10, OPT_settyp, &*x, y); + } + } else { + OPB_err(93); + } + (*x)->typ = OPT_settyp; +} + +void OPB_SetElem (OPT_Node *x) +{ + LONGINT k; + if ((*x)->class == 8 || (*x)->class == 9) { + OPB_err(126); + } else if (!__IN((*x)->typ->form, 0x70)) { + OPB_err(93); + } else if ((*x)->class == 7) { + k = (*x)->conval->intval; + if ((0 <= k && k <= (LONGINT)OPM_MaxSet)) { + (*x)->conval->setval = __SETOF(k); + } else { + OPB_err(202); + } + (*x)->obj = NIL; + } else { + OPB_Convert(&*x, OPT_settyp); + } + (*x)->typ = OPT_settyp; +} + +static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) +{ + INTEGER f, g; + OPT_Struct y = NIL, p = NIL, q = NIL; + if (OPM_Verbose) { + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"PROCEDURE CheckAssign", (LONGINT)22); + OPM_LogWLn(); + } + y = ynode->typ; + f = x->form; + g = y->form; + if (OPM_Verbose) { + OPM_LogWStr((CHAR*)"y.form = ", (LONGINT)10); + OPM_LogWNum(y->form, ((LONGINT)(0))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"f = ", (LONGINT)5); + OPM_LogWNum(f, ((LONGINT)(0))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"g = ", (LONGINT)5); + OPM_LogWNum(g, ((LONGINT)(0))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"ynode.typ.syze = ", (LONGINT)18); + OPM_LogWNum(ynode->typ->size, ((LONGINT)(0))); + OPM_LogWLn(); + } + if (ynode->class == 8 || (ynode->class == 9 && f != 14)) { + OPB_err(126); + } + switch (f) { + case 0: case 10: + break; + case 1: + if (!__IN(g, 0x1a)) { + OPB_err(113); + } + break; + case 2: case 3: case 4: case 9: + if (g != f) { + OPB_err(113); + } + break; + case 5: + if (!__IN(g, 0x30)) { + OPB_err(113); + } + break; + case 6: + if (OPM_LIntSize == 4) { + if (!__IN(g, 0x70)) { + OPB_err(113); + } + } else { + if (!__IN(g, 0x70)) { + OPB_err(113); + } + } + break; + case 7: + if (!__IN(g, 0xf0)) { + OPB_err(113); + } + break; + case 8: + if (!__IN(g, 0x01f0)) { + OPB_err(113); + } + break; + case 13: + if ((x == y || g == 11) || (x == OPT_sysptrtyp && g == 13)) { + } else if (g == 13) { + p = x->BaseTyp; + q = y->BaseTyp; + if ((p->comp == 4 && q->comp == 4)) { + while ((((q != p && q != NIL)) && q != OPT_undftyp)) { + q = q->BaseTyp; + } + if (q == NIL) { + OPB_err(113); + } + } else { + OPB_err(113); + } + } else { + OPB_err(113); + } + break; + case 14: + if (ynode->class == 9) { + OPB_CheckProc(x, ynode->obj); + } else if (x == y || g == 11) { + } else { + OPB_err(113); + } + break; + case 12: case 11: + OPB_err(113); + break; + case 15: + x->pvused = 1; + if (x->comp == 2) { + if ((ynode->class == 7 && g == 3)) { + OPB_CharToString(ynode); + y = ynode->typ; + g = 10; + } + if (x == y) { + } else if (x->BaseTyp == OPT_chartyp) { + if (g == 10) { + if (ynode->conval->intval2 > x->n) { + OPB_err(114); + } + } else if ((__IN(y->comp, 0x0c) && y->BaseTyp == OPT_chartyp)) { + } else { + OPB_err(113); + } + } else { + OPB_err(113); + } + } else if ((x->comp == 3 && x->BaseTyp == OPT_chartyp)) { + if ((__IN(y->comp, 0x0c) && y->BaseTyp == OPT_chartyp)) { + } else { + OPB_err(113); + } + } else if (x->comp == 4) { + if (x == y) { + } else if (y->comp == 4) { + q = y->BaseTyp; + while ((((q != NIL && q != x)) && q != OPT_undftyp)) { + q = q->BaseTyp; + } + if (q == NIL) { + OPB_err(113); + } + } else { + OPB_err(113); + } + } else { + OPB_err(113); + } + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPB.CheckAssign, f = ", (LONGINT)40); + OPM_LogWNum(f, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + if ((((((ynode->class == 7 && g < f)) && __IN(g, 0xf0))) && __IN(f, 0x01e0))) { + OPB_Convert(&ynode, x); + } +} + +static void OPB_CheckLeaf (OPT_Node x, BOOLEAN dynArrToo) +{ +} + +void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) +{ + INTEGER f; + OPT_Struct typ = NIL; + OPT_Node x = NIL; + x = *par0; + f = x->typ->form; + switch (fctno) { + case 0: + if ((__IN(f, 0x70) && x->class == 7)) { + if ((0 <= x->conval->intval && x->conval->intval <= 255)) { + OPB_BindNodes(28, OPT_notyp, &x, x); + } else { + OPB_err(218); + } + } else { + OPB_err(69); + } + x->typ = OPT_notyp; + break; + case 1: + typ = OPT_notyp; + if (OPB_NotVar(x)) { + OPB_err(112); + } else if (f == 13) { + if (x->readonly) { + OPB_err(76); + } + f = x->typ->BaseTyp->comp; + if (__IN(f, 0x1c)) { + if (f == 3) { + typ = x->typ->BaseTyp; + } + OPB_BindNodes(19, OPT_notyp, &x, NIL); + x->subcl = 1; + } else { + OPB_err(111); + } + } else { + OPB_err(111); + } + x->typ = typ; + break; + case 2: + OPB_MOp(21, &x); + break; + case 3: + OPB_MOp(22, &x); + break; + case 4: + if (x->class == 8 || x->class == 9) { + OPB_err(126); + } else if (f == 3) { + OPB_Convert(&x, OPT_inttyp); + } else { + OPB_err(111); + } + x->typ = OPT_inttyp; + break; + case 5: + if (x->class == 8 || x->class == 9) { + OPB_err(126); + } else if (__IN(f, 0x0180)) { + OPB_Convert(&x, OPT_linttyp); + } else { + OPB_err(111); + } + x->typ = OPT_linttyp; + break; + case 6: + OPB_MOp(23, &x); + break; + case 7: + if (x->class == 8) { + switch (f) { + case 2: + x = OPB_NewBoolConst(0); + break; + case 3: + x = OPB_NewIntConst(((LONGINT)(0))); + x->typ = OPT_chartyp; + break; + case 4: + x = OPB_NewIntConst(OPM_MinSInt); + break; + case 5: + x = OPB_NewIntConst(OPM_MinInt); + break; + case 6: + x = OPB_NewIntConst(OPM_MinLInt); + break; + case 9: + x = OPB_NewIntConst(((LONGINT)(0))); + x->typ = OPT_inttyp; + break; + case 7: + x = OPB_NewRealConst(OPM_MinReal, OPT_realtyp); + break; + case 8: + x = OPB_NewRealConst(OPM_MinLReal, OPT_lrltyp); + break; + default: + OPB_err(111); + break; + } + } else { + OPB_err(110); + } + break; + case 8: + if (x->class == 8) { + switch (f) { + case 2: + x = OPB_NewBoolConst(1); + break; + case 3: + x = OPB_NewIntConst(((LONGINT)(255))); + x->typ = OPT_chartyp; + break; + case 4: + x = OPB_NewIntConst(OPM_MaxSInt); + break; + case 5: + x = OPB_NewIntConst(OPM_MaxInt); + break; + case 6: + x = OPB_NewIntConst(OPM_MaxLInt); + break; + case 9: + x = OPB_NewIntConst(OPM_MaxSet); + x->typ = OPT_inttyp; + break; + case 7: + x = OPB_NewRealConst(OPM_MaxReal, OPT_realtyp); + break; + case 8: + x = OPB_NewRealConst(OPM_MaxLReal, OPT_lrltyp); + break; + default: + OPB_err(111); + break; + } + } else { + OPB_err(110); + } + break; + case 9: + if (x->class == 8 || x->class == 9) { + OPB_err(126); + } else if (__IN(f, 0x71)) { + OPB_Convert(&x, OPT_chartyp); + } else { + OPB_err(111); + x->typ = OPT_chartyp; + } + break; + case 10: + if (x->class == 8 || x->class == 9) { + OPB_err(126); + } else if (f == 5) { + OPB_Convert(&x, OPT_sinttyp); + } else if (f == 6) { + OPB_Convert(&x, OPT_inttyp); + } else if (f == 8) { + OPB_Convert(&x, OPT_realtyp); + } else { + OPB_err(111); + } + break; + case 11: + if (x->class == 8 || x->class == 9) { + OPB_err(126); + } else if (f == 4) { + OPB_Convert(&x, OPT_inttyp); + } else if (f == 5) { + OPB_Convert(&x, OPT_linttyp); + } else if (f == 7) { + OPB_Convert(&x, OPT_lrltyp); + } else if (f == 3) { + OPB_Convert(&x, OPT_linttyp); + } else { + OPB_err(111); + } + break; + case 13: case 14: + if (OPB_NotVar(x)) { + OPB_err(112); + } else if (!__IN(f, 0x70)) { + OPB_err(111); + } else if (x->readonly) { + OPB_err(76); + } + break; + case 15: case 16: + if (OPB_NotVar(x)) { + OPB_err(112); + } else if (x->typ != OPT_settyp) { + OPB_err(111); + x->typ = OPT_settyp; + } else if (x->readonly) { + OPB_err(76); + } + break; + case 17: + if (!__IN(x->typ->comp, 0x0c)) { + OPB_err(131); + } + break; + case 18: + if ((x->class == 7 && f == 3)) { + OPB_CharToString(x); + f = 10; + } + if (x->class == 8 || x->class == 9) { + OPB_err(126); + } else if (((!__IN(x->typ->comp, 0x0c) || x->typ->BaseTyp->form != 3) && f != 10)) { + OPB_err(111); + } + break; + case 19: + if (x->class == 8 || x->class == 9) { + OPB_err(126); + } else if (__IN(f, 0x70)) { + if (f != 6) { + OPB_Convert(&x, OPT_linttyp); + } + } else { + OPB_err(111); + x->typ = OPT_linttyp; + } + break; + case 20: + OPB_CheckLeaf(x, 0); + OPB_MOp(24, &x); + break; + case 12: + if (x->class != 8) { + OPB_err(110); + x = OPB_NewIntConst(((LONGINT)(1))); + } else if (__IN(f, 0x63fe) || __IN(x->typ->comp, 0x14)) { + (*OPB_typSize)(x->typ); + x->typ->pvused = 1; + x = OPB_NewIntConst(x->typ->size); + } else { + OPB_err(111); + x = OPB_NewIntConst(((LONGINT)(1))); + } + break; + case 21: + OPB_MOp(25, &x); + break; + case 22: case 23: + if (x->class == 8 || x->class == 9) { + OPB_err(126); + } else if (!__IN(f, 0x027a)) { + OPB_err(111); + } + break; + case 24: case 25: case 28: case 31: + if (x->class == 8 || x->class == 9) { + OPB_err(126); + } else if ((x->class == 7 && __IN(f, 0x30))) { + OPB_Convert(&x, OPT_linttyp); + } else if (!__IN(f, 0x2040)) { + OPB_err(111); + x->typ = OPT_linttyp; + } + break; + case 26: case 27: + if ((__IN(f, 0x70) && x->class == 7)) { + if (x->conval->intval < 0 || x->conval->intval > -1) { + OPB_err(220); + } + } else { + OPB_err(69); + } + break; + case 29: + if (x->class != 8) { + OPB_err(110); + } else if (__IN(f, 0x1401) || x->typ->comp == 3) { + OPB_err(111); + } + break; + case 30: + if (OPB_NotVar(x)) { + OPB_err(112); + } else if (f == 13) { + } else { + OPB_err(111); + } + break; + case 32: + if (x->class == 8 || x->class == 9) { + OPB_err(126); + x = OPB_NewBoolConst(0); + } else if (f != 2) { + OPB_err(120); + x = OPB_NewBoolConst(0); + } else { + OPB_MOp(33, &x); + } + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPB.StPar0, fctno = ", (LONGINT)39); + OPM_LogWNum(fctno, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + *par0 = x; +} + +static struct StPar1__52 { + struct StPar1__52 *lnk; +} *StPar1__52_s; + +static OPT_Node NewOp__53 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right); + +static OPT_Node NewOp__53 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right) +{ + OPT_Node _o_result; + OPT_Node node = NIL; + node = OPT_NewNode(class); + node->subcl = subcl; + node->left = left; + node->right = right; + _o_result = node; + return _o_result; +} + +void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) +{ + INTEGER f, L; + OPT_Struct typ = NIL; + OPT_Node p = NIL, t = NIL; + struct StPar1__52 _s; + _s.lnk = StPar1__52_s; + StPar1__52_s = &_s; + p = *par0; + f = x->typ->form; + switch (fctno) { + case 13: case 14: + if (x->class == 8 || x->class == 9) { + OPB_err(126); + p->typ = OPT_notyp; + } else { + if (x->typ != p->typ) { + if ((x->class == 7 && __IN(f, 0x70))) { + OPB_Convert(&x, p->typ); + } else { + OPB_err(111); + } + } + p = NewOp__53(19, fctno, p, x); + p->typ = OPT_notyp; + } + break; + case 15: case 16: + if (x->class == 8 || x->class == 9) { + OPB_err(126); + } else if (__IN(f, 0x70)) { + if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > (LONGINT)OPM_MaxSet))) { + OPB_err(202); + } + p = NewOp__53(19, fctno, p, x); + } else { + OPB_err(111); + } + p->typ = OPT_notyp; + break; + case 17: + if (!__IN(f, 0x70) || x->class != 7) { + OPB_err(69); + } else if (f == 4) { + L = (int)x->conval->intval; + typ = p->typ; + while ((L > 0 && __IN(typ->comp, 0x0c))) { + typ = typ->BaseTyp; + L -= 1; + } + if (L != 0 || !__IN(typ->comp, 0x0c)) { + OPB_err(132); + } else { + x->obj = NIL; + if (typ->comp == 3) { + while (p->class == 4) { + p = p->left; + x->conval->intval += 1; + } + p = NewOp__53(12, 19, p, x); + p->typ = OPT_linttyp; + } else { + p = x; + p->conval->intval = typ->n; + OPB_SetIntType(p); + } + } + } else { + OPB_err(132); + } + break; + case 18: + if (OPB_NotVar(x)) { + OPB_err(112); + } else if ((__IN(x->typ->comp, 0x0c) && x->typ->BaseTyp->form == 3)) { + if (x->readonly) { + OPB_err(76); + } + t = x; + x = p; + p = t; + p = NewOp__53(19, 18, p, x); + } else { + OPB_err(111); + } + p->typ = OPT_notyp; + break; + case 19: + if (x->class == 8 || x->class == 9) { + OPB_err(126); + } else if (__IN(f, 0x70)) { + if ((p->class == 7 && x->class == 7)) { + if (-OPB_maxExp > x->conval->intval || x->conval->intval > OPB_maxExp) { + OPB_err(208); + p->conval->intval = 1; + } else if (x->conval->intval >= 0) { + if (__ABS(p->conval->intval) <= __DIV(2147483647, __ASH(1, x->conval->intval))) { + p->conval->intval = p->conval->intval * __ASH(1, x->conval->intval); + } else { + OPB_err(208); + p->conval->intval = 1; + } + } else { + p->conval->intval = __ASH(p->conval->intval, x->conval->intval); + } + p->obj = NIL; + } else { + p = NewOp__53(12, 17, p, x); + p->typ = OPT_linttyp; + } + } else { + OPB_err(111); + } + break; + case 1: + if (x->class == 8 || x->class == 9) { + OPB_err(126); + } else if (p->typ->comp == 3) { + if (__IN(f, 0x70)) { + if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > OPM_MaxIndex))) { + OPB_err(63); + } + } else { + OPB_err(111); + } + p->right = x; + p->typ = p->typ->BaseTyp; + } else { + OPB_err(64); + } + break; + case 22: case 23: + if (x->class == 8 || x->class == 9) { + OPB_err(126); + } else if (!__IN(f, 0x70)) { + OPB_err(111); + } else { + if (fctno == 22) { + p = NewOp__53(12, 27, p, x); + } else { + p = NewOp__53(12, 28, p, x); + } + p->typ = p->left->typ; + } + break; + case 24: case 25: case 26: case 27: + if (x->class == 8 || x->class == 9) { + OPB_err(126); + } else if (__IN(f, 0x63ff)) { + if (fctno == 24 || fctno == 26) { + if (OPB_NotVar(x)) { + OPB_err(112); + } + t = x; + x = p; + p = t; + } + p = NewOp__53(19, fctno, p, x); + } else { + OPB_err(111); + } + p->typ = OPT_notyp; + break; + case 28: + if (x->class == 8 || x->class == 9) { + OPB_err(126); + } else if (__IN(f, 0x70)) { + p = NewOp__53(12, 26, p, x); + } else { + OPB_err(111); + } + p->typ = OPT_booltyp; + break; + case 29: + if (((x->class == 8 || x->class == 9) || __IN(f, 0x1401)) || x->typ->comp == 3) { + OPB_err(126); + } + t = OPT_NewNode(11); + t->subcl = 29; + t->left = x; + x = t; + x->typ = p->typ; + p = x; + break; + case 30: + if (x->class == 8 || x->class == 9) { + OPB_err(126); + } else if (__IN(f, 0x70)) { + p = NewOp__53(19, 30, p, x); + } else { + OPB_err(111); + } + p->typ = OPT_notyp; + break; + case 31: + if (x->class == 8 || x->class == 9) { + OPB_err(126); + } else if ((x->class == 7 && __IN(f, 0x30))) { + OPB_Convert(&x, OPT_linttyp); + } else if (!__IN(f, 0x2040)) { + OPB_err(111); + x->typ = OPT_linttyp; + } + p->link = x; + break; + case 32: + if ((__IN(f, 0x70) && x->class == 7)) { + if ((0 <= x->conval->intval && x->conval->intval <= 255)) { + OPB_BindNodes(28, OPT_notyp, &x, x); + x->conval = OPT_NewConst(); + x->conval->intval = OPM_errpos; + OPB_Construct(15, &p, x); + p->conval = OPT_NewConst(); + p->conval->intval = OPM_errpos; + OPB_Construct(20, &p, NIL); + OPB_OptIf(&p); + if (p == NIL) { + } else if (p->class == 28) { + OPB_err(99); + } else { + p->subcl = 32; + } + } else { + OPB_err(218); + } + } else { + OPB_err(69); + } + break; + default: + OPB_err(64); + break; + } + *par0 = p; + StPar1__52_s = _s.lnk; +} + +void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n) +{ + OPT_Node node = NIL; + INTEGER f; + OPT_Node p = NIL; + p = *par0; + f = x->typ->form; + if (fctno == 1) { + if (x->class == 8 || x->class == 9) { + OPB_err(126); + } else if (p->typ->comp != 3) { + OPB_err(64); + } else if (__IN(f, 0x70)) { + if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > OPM_MaxIndex))) { + OPB_err(63); + } + node = p->right; + while (node->link != NIL) { + node = node->link; + } + node->link = x; + p->typ = p->typ->BaseTyp; + } else { + OPB_err(111); + } + } else if ((fctno == 31 && n == 2)) { + if (x->class == 8 || x->class == 9) { + OPB_err(126); + } else if (__IN(f, 0x70)) { + node = OPT_NewNode(19); + node->subcl = 31; + node->right = p; + node->left = p->link; + p->link = x; + p = node; + } else { + OPB_err(111); + } + p->typ = OPT_notyp; + } else { + OPB_err(64); + } + *par0 = p; +} + +void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno) +{ + INTEGER dim; + OPT_Node x = NIL, p = NIL; + p = *par0; + if (fctno <= 19) { + if ((fctno == 1 && p->typ != OPT_notyp)) { + if (p->typ->comp == 3) { + OPB_err(65); + } + p->typ = OPT_notyp; + } else if (fctno <= 12) { + if (parno < 1) { + OPB_err(65); + } + } else { + if (((fctno == 13 || fctno == 14) && parno == 1)) { + OPB_BindNodes(19, OPT_notyp, &p, OPB_NewIntConst(((LONGINT)(1)))); + p->subcl = fctno; + p->right->typ = p->left->typ; + } else if ((fctno == 17 && parno == 1)) { + if (p->typ->comp == 3) { + dim = 0; + while (p->class == 4) { + p = p->left; + dim += 1; + } + OPB_BindNodes(12, OPT_linttyp, &p, OPB_NewIntConst(dim)); + p->subcl = 19; + } else { + p = OPB_NewIntConst(p->typ->n); + } + } else if (parno < 2) { + OPB_err(65); + } + } + } else if (fctno == 32) { + if (parno == 1) { + x = NIL; + OPB_BindNodes(28, OPT_notyp, &x, OPB_NewIntConst(((LONGINT)(0)))); + x->conval = OPT_NewConst(); + x->conval->intval = OPM_errpos; + OPB_Construct(15, &p, x); + p->conval = OPT_NewConst(); + p->conval->intval = OPM_errpos; + OPB_Construct(20, &p, NIL); + OPB_OptIf(&p); + if (p == NIL) { + } else if (p->class == 28) { + OPB_err(99); + } else { + p->subcl = 32; + } + } else if (parno < 1) { + OPB_err(65); + } + } else { + if ((parno < 1 || (fctno > 21 && parno < 2)) || (fctno == 31 && parno < 3)) { + OPB_err(65); + } + } + *par0 = p; +} + +static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpar) +{ + INTEGER f; + f = atyp->comp; + ftyp = ftyp->BaseTyp; + atyp = atyp->BaseTyp; + if ((fvarpar && ftyp == OPT_bytetyp)) { + if (!__IN(f, 0x0c) || !__IN(atyp->form, 0x1e)) { + if (__IN(18, OPM_opt)) { + OPB_err(-301); + } + } + } else if (__IN(f, 0x0c)) { + if (ftyp->comp == 3) { + OPB_DynArrParCheck(ftyp, atyp, fvarpar); + } else if (ftyp != atyp) { + if ((((!fvarpar && ftyp->form == 13)) && atyp->form == 13)) { + ftyp = ftyp->BaseTyp; + atyp = atyp->BaseTyp; + if ((ftyp->comp == 4 && atyp->comp == 4)) { + while ((((ftyp != atyp && atyp != NIL)) && atyp != OPT_undftyp)) { + atyp = atyp->BaseTyp; + } + if (atyp == NIL) { + OPB_err(113); + } + } else { + OPB_err(66); + } + } else { + OPB_err(66); + } + } + } else { + OPB_err(67); + } +} + +static void OPB_CheckReceiver (OPT_Node *x, OPT_Object fp) +{ + if (fp->typ->form == 13) { + if ((*x)->class == 3) { + *x = (*x)->left; + } else { + OPB_err(71); + } + } +} + +void OPB_PrepCall (OPT_Node *x, OPT_Object *fpar) +{ + if (((*x)->obj != NIL && __IN((*x)->obj->mode, 0x22c0))) { + *fpar = (*x)->obj->link; + if ((*x)->obj->mode == 13) { + OPB_CheckReceiver(&(*x)->left, *fpar); + *fpar = (*fpar)->link; + } + } else if (((((*x)->class != 8 && (*x)->typ != NIL)) && (*x)->typ->form == 14)) { + *fpar = (*x)->typ->link; + } else { + OPB_err(121); + *fpar = NIL; + (*x)->typ = OPT_undftyp; + } +} + +void OPB_Param (OPT_Node ap, OPT_Object fp) +{ + OPT_Struct q = NIL; + if (fp->typ->form != 0) { + if (fp->mode == 2) { + if (OPB_NotVar(ap)) { + OPB_err(122); + } else { + OPB_CheckLeaf(ap, 0); + } + if (ap->readonly) { + OPB_err(76); + } + if (fp->typ->comp == 3) { + OPB_DynArrParCheck(fp->typ, ap->typ, 1); + } else if ((fp->typ->comp == 4 && ap->typ->comp == 4)) { + q = ap->typ; + while ((((q != fp->typ && q != NIL)) && q != OPT_undftyp)) { + q = q->BaseTyp; + } + if (q == NIL) { + OPB_err(111); + } + } else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 13)) { + } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && __IN(ap->typ->form, 0x18))))) { + OPB_err(123); + } else if ((fp->typ->form == 13 && ap->class == 5)) { + OPB_err(123); + } + } else if (fp->typ->comp == 3) { + if ((ap->class == 7 && ap->typ->form == 3)) { + OPB_CharToString(ap); + } + if ((ap->typ->form == 10 && fp->typ->BaseTyp->form == 3)) { + } else if (ap->class >= 7) { + OPB_err(59); + } else { + OPB_DynArrParCheck(fp->typ, ap->typ, 0); + } + } else { + OPB_CheckAssign(fp->typ, ap); + } + } +} + +void OPB_StaticLink (SHORTINT dlev) +{ + OPT_Object scope = NIL; + scope = OPT_topScope; + while (dlev > 0) { + dlev -= 1; + scope->link->conval->setval |= __SETOF(3); + scope = scope->left; + } +} + +void OPB_Call (OPT_Node *x, OPT_Node apar, OPT_Object fp) +{ + OPT_Struct typ = NIL; + OPT_Node p = NIL; + SHORTINT lev; + if ((*x)->class == 9) { + typ = (*x)->typ; + lev = (*x)->obj->mnolev; + if (lev > 0) { + OPB_StaticLink(OPT_topScope->mnolev - lev); + } + if ((*x)->obj->mode == 10) { + OPB_err(121); + } + } else if (((*x)->class == 2 && (*x)->obj->mode == 13)) { + typ = (*x)->typ; + (*x)->class = 9; + p = (*x)->left; + (*x)->left = NIL; + p->link = apar; + apar = p; + fp = (*x)->obj->link; + } else { + typ = (*x)->typ->BaseTyp; + } + OPB_BindNodes(13, typ, &*x, apar); + (*x)->obj = fp; +} + +void OPB_Enter (OPT_Node *procdec, OPT_Node stat, OPT_Object proc) +{ + OPT_Node x = NIL; + x = OPT_NewNode(18); + x->typ = OPT_notyp; + x->obj = proc; + x->left = *procdec; + x->right = stat; + *procdec = x; +} + +void OPB_Return (OPT_Node *x, OPT_Object proc) +{ + OPT_Node node = NIL; + if (proc == NIL) { + if (*x != NIL) { + OPB_err(124); + } + } else { + if (*x != NIL) { + OPB_CheckAssign(proc->typ, *x); + } else if (proc->typ != OPT_notyp) { + OPB_err(124); + } + } + node = OPT_NewNode(26); + node->typ = OPT_notyp; + node->obj = proc; + node->left = *x; + *x = node; +} + +void OPB_Assign (OPT_Node *x, OPT_Node y) +{ + OPT_Node z = NIL; + SHORTINT subcl; + if ((*x)->class >= 7) { + OPB_err(56); + } + OPB_CheckAssign((*x)->typ, y); + if ((*x)->readonly) { + OPB_err(76); + } + if ((*x)->typ->comp == 4) { + if ((*x)->class == 5) { + z = (*x)->left; + } else { + z = *x; + } + if ((z->class == 3 && z->left->class == 5)) { + z->left = z->left->left; + } + if (((*x)->typ->strobj != NIL && (z->class == 3 || z->class == 1))) { + OPB_BindNodes(6, (*x)->typ, &z, NIL); + *x = z; + } + } else if (((((((*x)->typ->comp == 2 && (*x)->typ->BaseTyp == OPT_chartyp)) && y->typ->form == 10)) && y->conval->intval2 == 1)) { + y->typ = OPT_chartyp; + y->conval->intval = 0; + OPB_Index(&*x, OPB_NewIntConst(((LONGINT)(0)))); + } + if ((((((__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp == OPT_chartyp)) && __IN(y->typ->comp, 0x0c))) && y->typ->BaseTyp == OPT_chartyp)) { + subcl = 18; + } else { + subcl = 0; + } + OPB_BindNodes(19, OPT_notyp, &*x, y); + (*x)->subcl = subcl; +} + +void OPB_Inittd (OPT_Node *inittd, OPT_Node *last, OPT_Struct typ) +{ + OPT_Node node = NIL; + node = OPT_NewNode(14); + node->typ = typ; + node->conval = OPT_NewConst(); + node->conval->intval = typ->txtpos; + if (*inittd == NIL) { + *inittd = node; + } else { + (*last)->link = node; + } + *last = node; +} + + +export void *OPB__init(void) +{ + __DEFMOD; + __MODULE_IMPORT(OPM); + __MODULE_IMPORT(OPS); + __MODULE_IMPORT(OPT); + __REGMOD("OPB", 0); +/* BEGIN */ + OPB_maxExp = OPB_log(1073741824); + OPB_maxExp = OPB_exp; + __ENDMOD; +} diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h new file mode 100644 index 00000000..8cd47ee6 --- /dev/null +++ b/bootstrap/unix-48/OPB.h @@ -0,0 +1,49 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ + +#ifndef OPB__h +#define OPB__h + +#include "SYSTEM.h" +#include "OPS.h" +#include "OPT.h" + + +import void (*OPB_typSize)(OPT_Struct); + + +import void OPB_Assign (OPT_Node *x, OPT_Node y); +import void OPB_Call (OPT_Node *x, OPT_Node apar, OPT_Object fp); +import void OPB_CheckParameters (OPT_Object fp, OPT_Object ap, BOOLEAN checkNames); +import void OPB_Construct (SHORTINT class, OPT_Node *x, OPT_Node y); +import void OPB_DeRef (OPT_Node *x); +import OPT_Node OPB_EmptySet (void); +import void OPB_Enter (OPT_Node *procdec, OPT_Node stat, OPT_Object proc); +import void OPB_Field (OPT_Node *x, OPT_Object y); +import void OPB_In (OPT_Node *x, OPT_Node y); +import void OPB_Index (OPT_Node *x, OPT_Node y); +import void OPB_Inittd (OPT_Node *inittd, OPT_Node *last, OPT_Struct typ); +import void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y); +import void OPB_MOp (SHORTINT op, OPT_Node *x); +import OPT_Node OPB_NewBoolConst (BOOLEAN boolval); +import OPT_Node OPB_NewIntConst (LONGINT intval); +import OPT_Node OPB_NewLeaf (OPT_Object obj); +import OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ); +import OPT_Node OPB_NewString (OPS_String str, LONGINT len); +import OPT_Node OPB_Nil (void); +import void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y); +import void OPB_OptIf (OPT_Node *x); +import void OPB_Param (OPT_Node ap, OPT_Object fp); +import void OPB_PrepCall (OPT_Node *x, OPT_Object *fpar); +import void OPB_Return (OPT_Node *x, OPT_Object proc); +import void OPB_SetElem (OPT_Node *x); +import void OPB_SetRange (OPT_Node *x, OPT_Node y); +import void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno); +import void OPB_StPar0 (OPT_Node *par0, INTEGER fctno); +import void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno); +import void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n); +import void OPB_StaticLink (SHORTINT dlev); +import void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard); +import void *OPB__init(void); + + +#endif diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c new file mode 100644 index 00000000..32a1496f --- /dev/null +++ b/bootstrap/unix-48/OPC.c @@ -0,0 +1,2108 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +#include "SYSTEM.h" +#include "Configuration.h" +#include "OPM.h" +#include "OPT.h" + + +static INTEGER OPC_indentLevel; +static BOOLEAN OPC_ptrinit, OPC_mainprog, OPC_ansi; +static SHORTINT OPC_hashtab[105]; +static CHAR OPC_keytab[36][9]; +static BOOLEAN OPC_GlbPtrs; +static CHAR OPC_BodyNameExt[13]; + + +export void OPC_Align (LONGINT *adr, LONGINT base); +export void OPC_Andent (OPT_Struct typ); +static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames); +export LONGINT OPC_Base (OPT_Struct typ); +export OPT_Object OPC_BaseTProc (OPT_Object obj); +export void OPC_BegBlk (void); +export void OPC_BegStat (void); +static void OPC_CProcDefs (OPT_Object obj, INTEGER vis); +export void OPC_Case (LONGINT caseVal, INTEGER form); +export void OPC_Cmp (INTEGER rel); +export void OPC_CompleteIdent (OPT_Object obj); +export void OPC_Constant (OPT_Const con, INTEGER form); +static void OPC_DeclareBase (OPT_Object dcl); +static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef); +static void OPC_DeclareParams (OPT_Object par, BOOLEAN macro); +static void OPC_DeclareTProcs (OPT_Object obj, BOOLEAN *empty); +static void OPC_DefAnonRecs (OPT_Node n); +export void OPC_DefineInter (OPT_Object proc); +static void OPC_DefineTProcMacros (OPT_Object obj, BOOLEAN *empty); +static void OPC_DefineTProcTypes (OPT_Object obj); +static void OPC_DefineType (OPT_Struct str); +export void OPC_EndBlk (void); +export void OPC_EndBlk0 (void); +export void OPC_EndStat (void); +export void OPC_EnterBody (void); +export void OPC_EnterProc (OPT_Object proc); +export void OPC_ExitBody (void); +export void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet); +static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, LONGINT *off, LONGINT *n, LONGINT *curAlign); +static void OPC_FillGap (LONGINT gap, LONGINT off, LONGINT align, LONGINT *n, LONGINT *curAlign); +export void OPC_GenBdy (OPT_Node n); +static void OPC_GenDynTypes (OPT_Node n, INTEGER vis); +export void OPC_GenEnumPtrs (OPT_Object var); +export void OPC_GenHdr (OPT_Node n); +export void OPC_GenHdrIncludes (void); +static void OPC_GenHeaderMsg (void); +export void OPC_Halt (LONGINT n); +export void OPC_Ident (OPT_Object obj); +static void OPC_IdentList (OPT_Object obj, INTEGER vis); +static void OPC_Include (CHAR *name, LONGINT name__len); +static void OPC_IncludeImports (OPT_Object obj, INTEGER vis); +export void OPC_Increment (BOOLEAN decrement); +export void OPC_Indent (INTEGER count); +export void OPC_Init (void); +static void OPC_InitImports (OPT_Object obj); +static void OPC_InitKeywords (void); +export void OPC_InitTDesc (OPT_Struct typ); +static void OPC_InitTProcs (OPT_Object typ, OPT_Object obj); +export void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim); +static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName); +static INTEGER OPC_Length (CHAR *s, LONGINT s__len); +export LONGINT OPC_NofPtrs (OPT_Struct typ); +static INTEGER OPC_PerfectHash (CHAR *s, LONGINT s__len); +static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len); +static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define); +static void OPC_ProcPredefs (OPT_Object obj, SHORTINT vis); +static void OPC_PutBase (OPT_Struct typ); +static void OPC_PutPtrOffsets (OPT_Struct typ, LONGINT adr, LONGINT *cnt); +static void OPC_RegCmds (OPT_Object obj); +export void OPC_SetInclude (BOOLEAN exclude); +static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause); +static void OPC_Str1 (CHAR *s, LONGINT s__len, LONGINT x); +export void OPC_TDescDecl (OPT_Struct typ); +export void OPC_TypeDefs (OPT_Object obj, INTEGER vis); +export void OPC_TypeOf (OPT_Object ap); +static BOOLEAN OPC_Undefined (OPT_Object obj); + + +void OPC_Init (void) +{ + OPC_indentLevel = 0; + OPC_ptrinit = __IN(5, OPM_opt); + OPC_mainprog = OPM_mainProg || OPM_mainLinkStat; + OPC_ansi = __IN(6, OPM_opt); + if (OPC_ansi) { + __MOVE("__init(void)", OPC_BodyNameExt, 13); + } else { + __MOVE("__init()", OPC_BodyNameExt, 9); + } +} + +void OPC_Indent (INTEGER count) +{ + OPC_indentLevel += count; +} + +void OPC_BegStat (void) +{ + INTEGER i; + i = OPC_indentLevel; + while (i > 0) { + OPM_Write(0x09); + i -= 1; + } +} + +void OPC_EndStat (void) +{ + OPM_Write(';'); + OPM_WriteLn(); +} + +void OPC_BegBlk (void) +{ + OPM_Write('{'); + OPM_WriteLn(); + OPC_indentLevel += 1; +} + +void OPC_EndBlk (void) +{ + OPC_indentLevel -= 1; + OPC_BegStat(); + OPM_Write('}'); + OPM_WriteLn(); +} + +void OPC_EndBlk0 (void) +{ + OPC_indentLevel -= 1; + OPC_BegStat(); + OPM_Write('}'); +} + +static void OPC_Str1 (CHAR *s, LONGINT s__len, LONGINT x) +{ + CHAR ch; + INTEGER i; + __DUP(s, s__len, CHAR); + ch = s[0]; + i = 0; + while (ch != 0x00) { + if (ch == '#') { + OPM_WriteInt(x); + } else { + OPM_Write(ch); + } + i += 1; + ch = s[__X(i, s__len)]; + } + __DEL(s); +} + +static INTEGER OPC_Length (CHAR *s, LONGINT s__len) +{ + INTEGER _o_result; + INTEGER i; + i = 0; + while (s[__X(i, s__len)] != 0x00) { + i += 1; + } + _o_result = i; + return _o_result; +} + +static INTEGER OPC_PerfectHash (CHAR *s, LONGINT s__len) +{ + INTEGER _o_result; + INTEGER i, h; + i = 0; + h = 0; + while ((s[__X(i, s__len)] != 0x00 && i < 5)) { + h = 3 * h + (int)s[__X(i, s__len)]; + i += 1; + } + _o_result = (int)__MOD(h, 105); + return _o_result; +} + +void OPC_Ident (OPT_Object obj) +{ + INTEGER mode, level, h; + mode = obj->mode; + level = obj->mnolev; + if ((__IN(mode, 0x62) && level > 0) || __IN(mode, 0x14)) { + OPM_WriteStringVar((void*)obj->name, ((LONGINT)(256))); + h = OPC_PerfectHash((void*)obj->name, ((LONGINT)(256))); + if (OPC_hashtab[__X(h, ((LONGINT)(105)))] >= 0) { + if (__STRCMP(OPC_keytab[__X(OPC_hashtab[__X(h, ((LONGINT)(105)))], ((LONGINT)(36)))], obj->name) == 0) { + OPM_Write('_'); + } + } + } else { + if (mode != 5 || obj->linkadr != 2) { + if (mode == 13) { + OPC_Ident(obj->link->typ->strobj); + } else if (level < 0) { + OPM_WriteStringVar((void*)OPT_GlbMod[__X(-level, ((LONGINT)(64)))]->name, ((LONGINT)(256))); + if (OPM_currFile == 0) { + OPT_GlbMod[__X(-level, ((LONGINT)(64)))]->vis = 1; + } + } else { + OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); + } + OPM_Write('_'); + } else if (obj == OPT_sysptrtyp->strobj || obj == OPT_bytetyp->strobj) { + OPM_WriteString((CHAR*)"SYSTEM_", (LONGINT)8); + } + OPM_WriteStringVar((void*)obj->name, ((LONGINT)(256))); + } +} + +static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause) +{ + INTEGER pointers; + *openClause = 0; + if (((typ->strobj == NIL || typ->strobj->name[0] == 0x00) && typ->comp != 4)) { + if (__IN(typ->comp, 0x0c)) { + OPC_Stars(typ->BaseTyp, &*openClause); + *openClause = typ->comp == 2; + } else if (typ->form == 14) { + OPM_Write('('); + OPM_Write('*'); + } else { + pointers = 0; + while (((typ->strobj == NIL || typ->strobj->name[0] == 0x00) && typ->form == 13)) { + pointers += 1; + typ = typ->BaseTyp; + } + if (pointers > 0) { + if (typ->comp != 3) { + OPC_Stars(typ, &*openClause); + } + if (*openClause) { + OPM_Write('('); + *openClause = 0; + } + while (pointers > 0) { + OPM_Write('*'); + pointers -= 1; + } + } + } + } +} + +static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef) +{ + OPT_Struct typ = NIL; + BOOLEAN varPar, openClause; + INTEGER form, comp; + typ = dcl->typ; + varPar = ((dcl->mode == 2 && typ->comp != 2) || typ->comp == 3) || scopeDef; + OPC_Stars(typ, &openClause); + if (varPar) { + if (openClause) { + OPM_Write('('); + } + OPM_Write('*'); + } + if (dcl->name[0] != 0x00) { + OPC_Ident(dcl); + } + if ((varPar && openClause)) { + OPM_Write(')'); + } + openClause = 0; + for (;;) { + form = typ->form; + comp = typ->comp; + if (((typ->strobj != NIL && typ->strobj->name[0] != 0x00) || form == 12) || comp == 4) { + break; + } else if ((form == 13 && typ->BaseTyp->comp != 3)) { + openClause = 1; + } else if (form == 14 || __IN(comp, 0x0c)) { + if (openClause) { + OPM_Write(')'); + openClause = 0; + } + if (form == 14) { + if (OPC_ansi) { + OPM_Write(')'); + OPC_AnsiParamList(typ->link, 0); + } else { + OPM_WriteString((CHAR*)")()", (LONGINT)4); + } + break; + } else if (comp == 2) { + OPM_Write('['); + OPM_WriteInt(typ->n); + OPM_Write(']'); + } + } else { + break; + } + typ = typ->BaseTyp; + } +} + +void OPC_Andent (OPT_Struct typ) +{ + if (typ->strobj == NIL || typ->align >= 65536) { + OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); + OPC_Str1((CHAR*)"__#", (LONGINT)4, __ASHR(typ->align, 16)); + } else { + OPC_Ident(typ->strobj); + } +} + +static BOOLEAN OPC_Undefined (OPT_Object obj) +{ + BOOLEAN _o_result; + _o_result = (((obj->mnolev >= 0 && obj->linkadr != (LONGINT)(3 + OPM_currFile))) && obj->linkadr != 2) || obj->name[0] == 0x00; + return _o_result; +} + +static void OPC_DeclareBase (OPT_Object dcl) +{ + OPT_Struct typ = NIL, prev = NIL; + OPT_Object obj = NIL; + INTEGER nofdims; + LONGINT off, n, dummy; + typ = dcl->typ; + prev = typ; + while ((((((((typ->strobj == NIL || typ->comp == 3) || OPC_Undefined(typ->strobj)) && typ->comp != 4)) && typ->form != 12)) && !((typ->form == 13 && typ->BaseTyp->comp == 3)))) { + prev = typ; + typ = typ->BaseTyp; + } + obj = typ->strobj; + if (typ->form == 12) { + OPM_WriteString((CHAR*)"void", (LONGINT)5); + } else if ((obj != NIL && !OPC_Undefined(obj))) { + OPC_Ident(obj); + } else if (typ->comp == 4) { + OPM_WriteString((CHAR*)"struct ", (LONGINT)8); + OPC_Andent(typ); + if ((prev->form != 13 && (obj != NIL || dcl->name[0] == 0x00))) { + if ((typ->BaseTyp != NIL && typ->BaseTyp->strobj->vis != 0)) { + OPM_WriteString((CHAR*)" { /* ", (LONGINT)7); + OPC_Ident(typ->BaseTyp->strobj); + OPM_WriteString((CHAR*)" */", (LONGINT)4); + OPM_WriteLn(); + OPC_Indent(1); + } else { + OPM_Write(' '); + OPC_BegBlk(); + } + OPC_FieldList(typ, 1, &off, &n, &dummy); + OPC_EndBlk0(); + } + } else if ((typ->form == 13 && typ->BaseTyp->comp == 3)) { + typ = typ->BaseTyp->BaseTyp; + nofdims = 1; + while (typ->comp == 3) { + nofdims += 1; + typ = typ->BaseTyp; + } + OPM_WriteString((CHAR*)"struct ", (LONGINT)8); + OPC_BegBlk(); + OPC_BegStat(); + OPC_Str1((CHAR*)"LONGINT len[#]", (LONGINT)15, nofdims); + OPC_EndStat(); + OPC_BegStat(); + __NEW(obj, OPT_ObjDesc); + __NEW(obj->typ, OPT_StrDesc); + obj->typ->form = 15; + obj->typ->comp = 2; + obj->typ->n = 1; + obj->typ->BaseTyp = typ; + obj->mode = 4; + __MOVE("data", obj->name, 5); + obj->linkadr = 0; + OPC_DeclareBase(obj); + OPM_Write(' '); + OPC_DeclareObj(obj, 0); + OPC_EndStat(); + OPC_EndBlk0(); + } +} + +LONGINT OPC_NofPtrs (OPT_Struct typ) +{ + LONGINT _o_result; + OPT_Object fld = NIL; + OPT_Struct btyp = NIL; + LONGINT n; + if ((typ->form == 13 && typ->sysflag == 0)) { + _o_result = 1; + return _o_result; + } else if ((typ->comp == 4 && __MASK(typ->sysflag, -256) == 0)) { + btyp = typ->BaseTyp; + if (btyp != NIL) { + n = OPC_NofPtrs(btyp); + } else { + n = 0; + } + fld = typ->link; + while ((fld != NIL && fld->mode == 4)) { + if (__STRCMP(fld->name, "@ptr") != 0) { + n = n + OPC_NofPtrs(fld->typ); + } else { + n += 1; + } + fld = fld->link; + } + _o_result = n; + return _o_result; + } else if (typ->comp == 2) { + btyp = typ->BaseTyp; + n = typ->n; + while (btyp->comp == 2) { + n = btyp->n * n; + btyp = btyp->BaseTyp; + } + _o_result = OPC_NofPtrs(btyp) * n; + return _o_result; + } else { + _o_result = 0; + return _o_result; + } + __RETCHK; +} + +static void OPC_PutPtrOffsets (OPT_Struct typ, LONGINT adr, LONGINT *cnt) +{ + OPT_Object fld = NIL; + OPT_Struct btyp = NIL; + LONGINT n, i; + if ((typ->form == 13 && typ->sysflag == 0)) { + OPM_WriteInt(adr); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + *cnt += 1; + if (__MASK(*cnt, -16) == 0) { + OPM_WriteLn(); + OPM_Write(0x09); + } + } else if ((typ->comp == 4 && __MASK(typ->sysflag, -256) == 0)) { + btyp = typ->BaseTyp; + if (btyp != NIL) { + OPC_PutPtrOffsets(btyp, adr, &*cnt); + } + fld = typ->link; + while ((fld != NIL && fld->mode == 4)) { + if (__STRCMP(fld->name, "@ptr") != 0) { + OPC_PutPtrOffsets(fld->typ, adr + fld->adr, &*cnt); + } else { + OPM_WriteInt(adr + fld->adr); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + *cnt += 1; + if (__MASK(*cnt, -16) == 0) { + OPM_WriteLn(); + OPM_Write(0x09); + } + } + fld = fld->link; + } + } else if (typ->comp == 2) { + btyp = typ->BaseTyp; + n = typ->n; + while (btyp->comp == 2) { + n = btyp->n * n; + btyp = btyp->BaseTyp; + } + if (OPC_NofPtrs(btyp) > 0) { + i = 0; + while (i < n) { + OPC_PutPtrOffsets(btyp, adr + i * btyp->size, &*cnt); + i += 1; + } + } + } +} + +static void OPC_InitTProcs (OPT_Object typ, OPT_Object obj) +{ + if (obj != NIL) { + OPC_InitTProcs(typ, obj->left); + if (obj->mode == 13) { + OPC_BegStat(); + OPM_WriteString((CHAR*)"__INITBP(", (LONGINT)10); + OPC_Ident(typ); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPC_Ident(obj); + OPC_Str1((CHAR*)", #)", (LONGINT)5, __ASHR(obj->adr, 16)); + OPC_EndStat(); + } + OPC_InitTProcs(typ, obj->right); + } +} + +static void OPC_PutBase (OPT_Struct typ) +{ + if (typ != NIL) { + OPC_PutBase(typ->BaseTyp); + OPC_Ident(typ->strobj); + OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + } +} + +static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName) +{ + OPT_Struct typ = NIL; + INTEGER dim; + if (showParamName) { + OPC_Ident(par); + OPM_WriteString((CHAR*)"__len", (LONGINT)6); + } + dim = 1; + typ = par->typ->BaseTyp; + while (typ->comp == 3) { + if (ansiDefine) { + OPM_WriteString((CHAR*)", LONGINT ", (LONGINT)11); + } else { + OPM_WriteString((CHAR*)", ", (LONGINT)3); + } + if (showParamName) { + OPC_Ident(par); + OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteInt(dim); + } + typ = typ->BaseTyp; + dim += 1; + } +} + +static void OPC_DeclareParams (OPT_Object par, BOOLEAN macro) +{ + OPM_Write('('); + while (par != NIL) { + if (macro) { + OPM_WriteStringVar((void*)par->name, ((LONGINT)(256))); + } else { + if ((par->mode == 1 && par->typ->form == 7)) { + OPM_Write('_'); + } + OPC_Ident(par); + } + if (par->typ->comp == 3) { + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPC_LenList(par, 0, 1); + } else if ((par->mode == 2 && par->typ->comp == 4)) { + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteStringVar((void*)par->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + } + par = par->link; + if (par != NIL) { + OPM_WriteString((CHAR*)", ", (LONGINT)3); + } + } + OPM_Write(')'); +} + +static void OPC_DefineTProcTypes (OPT_Object obj) +{ + OPT_Object par = NIL; + if (obj->typ != OPT_notyp) { + OPC_DefineType(obj->typ); + } + if (OPC_ansi) { + par = obj->link; + while (par != NIL) { + OPC_DefineType(par->typ); + par = par->link; + } + } +} + +static void OPC_DeclareTProcs (OPT_Object obj, BOOLEAN *empty) +{ + if (obj != NIL) { + OPC_DeclareTProcs(obj->left, &*empty); + if (obj->mode == 13) { + if (obj->typ != OPT_notyp) { + OPC_DefineType(obj->typ); + } + if (OPM_currFile == 0) { + if (obj->vis == 1) { + OPC_DefineTProcTypes(obj); + OPM_WriteString((CHAR*)"import ", (LONGINT)8); + *empty = 0; + OPC_ProcHeader(obj, 0); + } + } else { + *empty = 0; + OPC_DefineTProcTypes(obj); + if (obj->vis == 0) { + OPM_WriteString((CHAR*)"static ", (LONGINT)8); + } else { + OPM_WriteString((CHAR*)"export ", (LONGINT)8); + } + OPC_ProcHeader(obj, 0); + } + } + OPC_DeclareTProcs(obj->right, &*empty); + } +} + +OPT_Object OPC_BaseTProc (OPT_Object obj) +{ + OPT_Object _o_result; + OPT_Struct typ = NIL, base = NIL; + LONGINT mno; + typ = obj->link->typ; + if (typ->form == 13) { + typ = typ->BaseTyp; + } + base = typ->BaseTyp; + mno = __ASHR(obj->adr, 16); + while ((base != NIL && mno < base->n)) { + typ = base; + base = typ->BaseTyp; + } + OPT_FindField(obj->name, typ, &obj); + _o_result = obj; + return _o_result; +} + +static void OPC_DefineTProcMacros (OPT_Object obj, BOOLEAN *empty) +{ + if (obj != NIL) { + OPC_DefineTProcMacros(obj->left, &*empty); + if ((((obj->mode == 13 && obj == OPC_BaseTProc(obj))) && (OPM_currFile != 0 || obj->vis == 1))) { + OPM_WriteString((CHAR*)"#define __", (LONGINT)11); + OPC_Ident(obj); + OPC_DeclareParams(obj->link, 1); + OPM_WriteString((CHAR*)" __SEND(", (LONGINT)9); + if (obj->link->typ->form == 13) { + OPM_WriteString((CHAR*)"__TYPEOF(", (LONGINT)10); + OPC_Ident(obj->link); + OPM_Write(')'); + } else { + OPC_Ident(obj->link); + OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + } + OPC_Str1((CHAR*)", #, ", (LONGINT)6, __ASHR(obj->adr, 16)); + if (obj->typ == OPT_notyp) { + OPM_WriteString((CHAR*)"void", (LONGINT)5); + } else { + OPC_Ident(obj->typ->strobj); + } + OPM_WriteString((CHAR*)"(*)", (LONGINT)4); + if (OPC_ansi) { + OPC_AnsiParamList(obj->link, 0); + } else { + OPM_WriteString((CHAR*)"()", (LONGINT)3); + } + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPC_DeclareParams(obj->link, 1); + OPM_Write(')'); + OPM_WriteLn(); + } + OPC_DefineTProcMacros(obj->right, &*empty); + } +} + +static void OPC_DefineType (OPT_Struct str) +{ + OPT_Object obj = NIL, field = NIL, par = NIL; + BOOLEAN empty; + if (OPM_currFile == 1 || str->ref < 255) { + obj = str->strobj; + if (obj == NIL || OPC_Undefined(obj)) { + if (obj != NIL) { + if (obj->linkadr == 1) { + if (str->form != 13) { + OPM_Mark(244, str->txtpos); + obj->linkadr = 2; + } + } else { + obj->linkadr = 1; + } + } + if (str->comp == 4) { + if (str->BaseTyp != NIL) { + OPC_DefineType(str->BaseTyp); + } + field = str->link; + while ((field != NIL && field->mode == 4)) { + if (field->vis != 0 || OPM_currFile == 1) { + OPC_DefineType(field->typ); + } + field = field->link; + } + } else if (str->form == 13) { + if (str->BaseTyp->comp != 4) { + OPC_DefineType(str->BaseTyp); + } + } else if (__IN(str->comp, 0x0c)) { + OPC_DefineType(str->BaseTyp); + } else if (str->form == 14) { + if (str->BaseTyp != OPT_notyp) { + OPC_DefineType(str->BaseTyp); + } + field = str->link; + while (field != NIL) { + OPC_DefineType(field->typ); + field = field->link; + } + } + } + if ((obj != NIL && OPC_Undefined(obj))) { + OPM_WriteString((CHAR*)"typedef", (LONGINT)8); + OPM_WriteLn(); + OPM_Write(0x09); + OPC_Indent(1); + obj->linkadr = 1; + OPC_DeclareBase(obj); + OPM_Write(' '); + obj->typ->strobj = NIL; + OPC_DeclareObj(obj, 0); + obj->typ->strobj = obj; + obj->linkadr = 3 + OPM_currFile; + OPC_EndStat(); + OPC_Indent(-1); + OPM_WriteLn(); + if (obj->typ->comp == 4) { + empty = 1; + OPC_DeclareTProcs(str->link, &empty); + OPC_DefineTProcMacros(str->link, &empty); + if (!empty) { + OPM_WriteLn(); + } + } + } + } +} + +static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len) +{ + BOOLEAN _o_result; + INTEGER i; + BOOLEAN r; + __DUP(y, y__len, CHAR); + i = 0; + while ((*x)[__X(i + 1, ((LONGINT)(256)))] == y[__X(i, y__len)]) { + i += 1; + } + r = y[__X(i, y__len)] == 0x00; + _o_result = r; + __DEL(y); + return _o_result; +} + +static void OPC_CProcDefs (OPT_Object obj, INTEGER vis) +{ + INTEGER i; + OPT_ConstExt ext = NIL; + INTEGER _for__9; + if (obj != NIL) { + OPC_CProcDefs(obj->left, vis); + if ((((obj->mode == 9 && (int)obj->vis >= vis)) && obj->adr == 1)) { + ext = obj->conval->ext; + i = 1; + if (((*ext)[1] != '#' && !(OPC_Prefixed(ext, (CHAR*)"extern ", (LONGINT)8) || OPC_Prefixed(ext, (CHAR*)"import ", (LONGINT)8)))) { + OPM_WriteString((CHAR*)"#define ", (LONGINT)9); + OPC_Ident(obj); + OPC_DeclareParams(obj->link, 1); + OPM_Write(0x09); + } + _for__9 = (int)(*obj->conval->ext)[0]; + i = i; + while (i <= _for__9) { + OPM_Write((*obj->conval->ext)[__X(i, ((LONGINT)(256)))]); + i += 1; + } + OPM_WriteLn(); + } + OPC_CProcDefs(obj->right, vis); + } +} + +void OPC_TypeDefs (OPT_Object obj, INTEGER vis) +{ + if (obj != NIL) { + OPC_TypeDefs(obj->left, vis); + if ((obj->mode == 5 && obj->typ->txtpos > 0)) { + OPC_DefineType(obj->typ); + } + OPC_TypeDefs(obj->right, vis); + } +} + +static void OPC_DefAnonRecs (OPT_Node n) +{ + OPT_Object o = NIL; + OPT_Struct typ = NIL; + while ((n != NIL && n->class == 14)) { + typ = n->typ; + if ((typ->strobj == NIL && (OPM_currFile == 1 || typ->ref < 255))) { + OPC_DefineType(typ); + __NEW(o, OPT_ObjDesc); + o->typ = typ; + o->name[0] = 0x00; + OPC_DeclareBase(o); + OPC_EndStat(); + OPM_WriteLn(); + } + n = n->link; + } +} + +void OPC_TDescDecl (OPT_Struct typ) +{ + LONGINT nofptrs; + OPT_Object o = NIL; + OPC_BegStat(); + OPM_WriteString((CHAR*)"__TDESC(", (LONGINT)9); + OPC_Andent(typ); + OPC_Str1((CHAR*)", #", (LONGINT)4, typ->n + 1); + OPC_Str1((CHAR*)", #) = {__TDFLDS(", (LONGINT)18, OPC_NofPtrs(typ)); + OPM_Write('\"'); + if (typ->strobj != NIL) { + OPM_WriteStringVar((void*)typ->strobj->name, ((LONGINT)(256))); + } + OPC_Str1((CHAR*)"\", #), {", (LONGINT)9, typ->size); + nofptrs = 0; + OPC_PutPtrOffsets(typ, ((LONGINT)(0)), &nofptrs); + OPC_Str1((CHAR*)"#}}", (LONGINT)4, -((nofptrs + 1) * (LONGINT)OPM_LIntSize)); + OPC_EndStat(); +} + +void OPC_InitTDesc (OPT_Struct typ) +{ + OPC_BegStat(); + OPM_WriteString((CHAR*)"__INITYP(", (LONGINT)10); + OPC_Andent(typ); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + if (typ->BaseTyp != NIL) { + OPC_Andent(typ->BaseTyp); + } else { + OPC_Andent(typ); + } + OPC_Str1((CHAR*)", #)", (LONGINT)5, typ->extlev); + OPC_EndStat(); + if (typ->strobj != NIL) { + OPC_InitTProcs(typ->strobj, typ->link); + } +} + +void OPC_Align (LONGINT *adr, LONGINT base) +{ + switch (base) { + case 2: + *adr += __MASK(*adr, -2); + break; + case 4: + *adr += __MASK(-*adr, -4); + break; + case 8: + *adr += __MASK(-*adr, -8); + break; + case 16: + *adr += __MASK(-*adr, -16); + break; + default: + break; + } +} + +LONGINT OPC_Base (OPT_Struct typ) +{ + LONGINT _o_result; + switch (typ->form) { + case 1: + _o_result = 1; + return _o_result; + break; + case 3: + _o_result = OPM_CharAlign; + return _o_result; + break; + case 2: + _o_result = OPM_BoolAlign; + return _o_result; + break; + case 4: + _o_result = OPM_SIntAlign; + return _o_result; + break; + case 5: + _o_result = OPM_IntAlign; + return _o_result; + break; + case 6: + _o_result = OPM_LIntAlign; + return _o_result; + break; + case 7: + _o_result = OPM_RealAlign; + return _o_result; + break; + case 8: + _o_result = OPM_LRealAlign; + return _o_result; + break; + case 9: + _o_result = OPM_SetAlign; + return _o_result; + break; + case 13: + _o_result = OPM_PointerAlign; + return _o_result; + break; + case 14: + _o_result = OPM_ProcAlign; + return _o_result; + break; + case 15: + if (typ->comp == 4) { + _o_result = __MASK(typ->align, -65536); + return _o_result; + } else { + _o_result = OPC_Base(typ->BaseTyp); + return _o_result; + } + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPC.Base, typ^form = ", (LONGINT)40); + OPM_LogWNum(typ->form, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + __RETCHK; +} + +static void OPC_FillGap (LONGINT gap, LONGINT off, LONGINT align, LONGINT *n, LONGINT *curAlign) +{ + LONGINT adr; + adr = off; + OPC_Align(&adr, align); + if ((*curAlign < align && gap - (adr - off) >= align)) { + gap -= (adr - off) + align; + OPC_BegStat(); + if (align == (LONGINT)OPM_IntSize) { + OPM_WriteString((CHAR*)"INTEGER", (LONGINT)8); + } else if (align == (LONGINT)OPM_LIntSize) { + OPM_WriteString((CHAR*)"LONGINT", (LONGINT)8); + } else if (align == (LONGINT)OPM_LRealSize) { + OPM_WriteString((CHAR*)"LONGREAL", (LONGINT)9); + } + OPC_Str1((CHAR*)" _prvt#", (LONGINT)8, *n); + *n += 1; + OPC_EndStat(); + *curAlign = align; + } + if (gap > 0) { + OPC_BegStat(); + OPC_Str1((CHAR*)"char _prvt#", (LONGINT)12, *n); + *n += 1; + OPC_Str1((CHAR*)"[#]", (LONGINT)4, gap); + OPC_EndStat(); + } +} + +static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, LONGINT *off, LONGINT *n, LONGINT *curAlign) +{ + OPT_Object fld = NIL; + OPT_Struct base = NIL; + LONGINT gap, adr, align, fldAlign; + fld = typ->link; + align = __MASK(typ->align, -65536); + if (typ->BaseTyp != NIL) { + OPC_FieldList(typ->BaseTyp, 0, &*off, &*n, &*curAlign); + } else { + *off = 0; + *n = 0; + *curAlign = 1; + } + while ((fld != NIL && fld->mode == 4)) { + if ((OPM_currFile == 0 && fld->vis == 0) || (((OPM_currFile == 1 && fld->vis == 0)) && typ->mno != 0)) { + fld = fld->link; + while ((((fld != NIL && fld->mode == 4)) && fld->vis == 0)) { + fld = fld->link; + } + } else { + adr = *off; + fldAlign = OPC_Base(fld->typ); + OPC_Align(&adr, fldAlign); + gap = fld->adr - adr; + if (fldAlign > *curAlign) { + *curAlign = fldAlign; + } + if (gap > 0) { + OPC_FillGap(gap, *off, align, &*n, &*curAlign); + } + OPC_BegStat(); + OPC_DeclareBase(fld); + OPM_Write(' '); + OPC_DeclareObj(fld, 0); + *off = fld->adr + fld->typ->size; + base = fld->typ; + fld = fld->link; + while ((((((((fld != NIL && fld->mode == 4)) && fld->typ == base)) && fld->adr == *off)) && ((OPM_currFile == 1 || fld->vis != 0) || fld->typ->strobj == NIL))) { + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPC_DeclareObj(fld, 0); + *off = fld->adr + fld->typ->size; + fld = fld->link; + } + OPC_EndStat(); + } + } + if (last) { + adr = typ->size - (LONGINT)__ASHR(typ->sysflag, 8); + if (adr == 0) { + gap = 1; + } else { + gap = adr - *off; + } + if (gap > 0) { + OPC_FillGap(gap, *off, align, &*n, &*curAlign); + } + } +} + +static void OPC_IdentList (OPT_Object obj, INTEGER vis) +{ + OPT_Struct base = NIL; + BOOLEAN first; + INTEGER lastvis; + base = NIL; + first = 1; + while ((obj != NIL && obj->mode != 13)) { + if ((__IN(vis, 0x05) || (vis == 1 && obj->vis != 0)) || (vis == 3 && !obj->leaf)) { + if (obj->typ != base || (int)obj->vis != lastvis) { + if (!first) { + OPC_EndStat(); + } + first = 0; + base = obj->typ; + lastvis = obj->vis; + OPC_BegStat(); + if ((vis == 1 && obj->vis != 0)) { + OPM_WriteString((CHAR*)"import ", (LONGINT)8); + } else if ((obj->mnolev == 0 && vis == 0)) { + if (obj->vis == 0) { + OPM_WriteString((CHAR*)"static ", (LONGINT)8); + } else { + OPM_WriteString((CHAR*)"export ", (LONGINT)8); + } + } + if ((((vis == 2 && obj->mode == 1)) && base->form == 7)) { + OPM_WriteString((CHAR*)"double", (LONGINT)7); + } else { + OPC_DeclareBase(obj); + } + } else { + OPM_Write(','); + } + OPM_Write(' '); + if ((((vis == 2 && obj->mode == 1)) && base->form == 7)) { + OPM_Write('_'); + } + OPC_DeclareObj(obj, vis == 3); + if (obj->typ->comp == 3) { + OPC_EndStat(); + OPC_BegStat(); + base = OPT_linttyp; + OPM_WriteString((CHAR*)"LONGINT ", (LONGINT)9); + OPC_LenList(obj, 0, 1); + } else if ((obj->mode == 2 && obj->typ->comp == 4)) { + OPC_EndStat(); + OPC_BegStat(); + OPM_WriteString((CHAR*)"LONGINT *", (LONGINT)10); + OPC_Ident(obj); + OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + base = NIL; + } else if ((((((OPC_ptrinit && vis == 0)) && obj->mnolev > 0)) && obj->typ->form == 13)) { + OPM_WriteString((CHAR*)" = NIL", (LONGINT)7); + } + } + obj = obj->link; + } + if (!first) { + OPC_EndStat(); + } +} + +static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames) +{ + CHAR name[32]; + OPM_Write('('); + if (obj == NIL || obj->mode == 13) { + OPM_WriteString((CHAR*)"void", (LONGINT)5); + } else { + for (;;) { + OPC_DeclareBase(obj); + if (showParamNames) { + OPM_Write(' '); + OPC_DeclareObj(obj, 0); + } else { + __COPY(obj->name, name, ((LONGINT)(32))); + obj->name[0] = 0x00; + OPC_DeclareObj(obj, 0); + __COPY(name, obj->name, ((LONGINT)(256))); + } + if (obj->typ->comp == 3) { + OPM_WriteString((CHAR*)", LONGINT ", (LONGINT)11); + OPC_LenList(obj, 1, showParamNames); + } else if ((obj->mode == 2 && obj->typ->comp == 4)) { + OPM_WriteString((CHAR*)", LONGINT *", (LONGINT)12); + if (showParamNames) { + OPC_Ident(obj); + OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + } + } + if (obj->link == NIL || obj->link->mode == 13) { + break; + } + OPM_WriteString((CHAR*)", ", (LONGINT)3); + obj = obj->link; + } + } + OPM_Write(')'); +} + +static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define) +{ + if (proc->typ == OPT_notyp) { + OPM_WriteString((CHAR*)"void", (LONGINT)5); + } else { + OPC_Ident(proc->typ->strobj); + } + OPM_Write(' '); + OPC_Ident(proc); + OPM_Write(' '); + if (OPC_ansi) { + OPC_AnsiParamList(proc->link, 1); + if (!define) { + OPM_Write(';'); + } + OPM_WriteLn(); + } else if (define) { + OPC_DeclareParams(proc->link, 0); + OPM_WriteLn(); + OPC_Indent(1); + OPC_IdentList(proc->link, 2); + OPC_Indent(-1); + } else { + OPM_WriteString((CHAR*)"();", (LONGINT)4); + OPM_WriteLn(); + } +} + +static void OPC_ProcPredefs (OPT_Object obj, SHORTINT vis) +{ + if (obj != NIL) { + OPC_ProcPredefs(obj->left, vis); + if ((((__IN(obj->mode, 0xc0) && obj->vis >= vis)) && (obj->history != 4 || obj->mode == 6))) { + if (vis == 1) { + OPM_WriteString((CHAR*)"import ", (LONGINT)8); + } else if (obj->vis == 0) { + OPM_WriteString((CHAR*)"static ", (LONGINT)8); + } else { + OPM_WriteString((CHAR*)"export ", (LONGINT)8); + } + OPC_ProcHeader(obj, 0); + } + OPC_ProcPredefs(obj->right, vis); + } +} + +static void OPC_Include (CHAR *name, LONGINT name__len) +{ + __DUP(name, name__len, CHAR); + OPM_WriteString((CHAR*)"#include ", (LONGINT)10); + OPM_Write('\"'); + OPM_WriteStringVar((void*)name, name__len); + OPM_WriteString((CHAR*)".h", (LONGINT)3); + OPM_Write('\"'); + OPM_WriteLn(); + __DEL(name); +} + +static void OPC_IncludeImports (OPT_Object obj, INTEGER vis) +{ + if (obj != NIL) { + OPC_IncludeImports(obj->left, vis); + if ((((obj->mode == 11 && obj->mnolev != 0)) && (int)OPT_GlbMod[__X(-obj->mnolev, ((LONGINT)(64)))]->vis >= vis)) { + OPC_Include(OPT_GlbMod[__X(-obj->mnolev, ((LONGINT)(64)))]->name, ((LONGINT)(256))); + } + OPC_IncludeImports(obj->right, vis); + } +} + +static void OPC_GenDynTypes (OPT_Node n, INTEGER vis) +{ + OPT_Struct typ = NIL; + while ((n != NIL && n->class == 14)) { + typ = n->typ; + if (vis == 0 || typ->ref < 255) { + OPC_BegStat(); + if (vis == 1) { + OPM_WriteString((CHAR*)"import ", (LONGINT)8); + } else if ((typ->strobj != NIL && typ->strobj->mnolev > 0)) { + OPM_WriteString((CHAR*)"static ", (LONGINT)8); + } else { + OPM_WriteString((CHAR*)"export ", (LONGINT)8); + } + OPM_WriteString((CHAR*)"LONGINT *", (LONGINT)10); + OPC_Andent(typ); + OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPC_EndStat(); + } + n = n->link; + } +} + +void OPC_GenHdr (OPT_Node n) +{ + OPM_currFile = 0; + OPC_DefAnonRecs(n); + OPC_TypeDefs(OPT_topScope->right, 1); + OPM_WriteLn(); + OPC_IdentList(OPT_topScope->scope, 1); + OPM_WriteLn(); + OPC_GenDynTypes(n, 1); + OPM_WriteLn(); + OPC_ProcPredefs(OPT_topScope->right, 1); + OPM_WriteString((CHAR*)"import ", (LONGINT)8); + OPM_WriteString((CHAR*)"void *", (LONGINT)7); + OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); + OPM_WriteString(OPC_BodyNameExt, ((LONGINT)(13))); + OPC_EndStat(); + OPM_WriteLn(); + OPC_CProcDefs(OPT_topScope->right, 1); + OPM_WriteLn(); + OPM_WriteString((CHAR*)"#endif", (LONGINT)7); + OPM_WriteLn(); +} + +static void OPC_GenHeaderMsg (void) +{ + INTEGER i; + OPM_WriteString((CHAR*)"/*", (LONGINT)3); + OPM_WriteString((CHAR*)" voc ", (LONGINT)6); + OPM_Write(' '); + OPM_WriteString((CHAR*)"1.2 [2016/06/15] for gcc LP64 on cygwin", (LONGINT)40); + OPM_Write(' '); + i = 0; + while (i <= 31) { + if (__IN(i, OPM_glbopt)) { + switch (i) { + case 0: + OPM_Write('x'); + break; + case 2: + OPM_Write('r'); + break; + case 3: + OPM_Write('t'); + break; + case 4: + OPM_Write('s'); + break; + case 5: + OPM_Write('p'); + break; + case 6: + OPM_Write('k'); + break; + case 7: + OPM_Write('a'); + break; + case 9: + OPM_Write('e'); + break; + case 10: + OPM_Write('m'); + break; + case 13: + OPM_Write('S'); + break; + case 14: + OPM_Write('c'); + break; + case 15: + OPM_Write('M'); + break; + case 16: + OPM_Write('f'); + break; + case 17: + OPM_Write('F'); + break; + case 18: + OPM_Write('v'); + break; + default: + OPM_LogWStr((CHAR*)"( more options defined in OPM than checked in OPC.GenHeaderMsg, if you are a compiler developer, add them to OPC.GenHeaderMsg", (LONGINT)126); + OPM_LogWLn(); + break; + } + } + i += 1; + } + OPM_WriteString((CHAR*)" */", (LONGINT)4); + OPM_WriteLn(); +} + +void OPC_GenHdrIncludes (void) +{ + OPM_currFile = 2; + OPC_GenHeaderMsg(); + OPM_WriteLn(); + OPM_WriteString((CHAR*)"#ifndef ", (LONGINT)9); + OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); + OPM_WriteString((CHAR*)"__h", (LONGINT)4); + OPM_WriteLn(); + OPM_WriteString((CHAR*)"#define ", (LONGINT)9); + OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); + OPM_WriteString((CHAR*)"__h", (LONGINT)4); + OPM_WriteLn(); + OPM_WriteLn(); + if (OPM_LIntSize == 8) { + OPM_WriteString((CHAR*)"#define LARGE", (LONGINT)14); + OPM_WriteLn(); + } + OPC_Include((CHAR*)"SYSTEM", (LONGINT)7); + OPC_IncludeImports(OPT_topScope->right, 1); + OPM_WriteLn(); +} + +void OPC_GenBdy (OPT_Node n) +{ + OPM_currFile = 1; + OPC_GenHeaderMsg(); + if (OPM_LIntSize == 8) { + OPM_WriteString((CHAR*)"#define LARGE", (LONGINT)14); + OPM_WriteLn(); + } + OPC_Include((CHAR*)"SYSTEM", (LONGINT)7); + OPC_IncludeImports(OPT_topScope->right, 0); + OPM_WriteLn(); + OPC_DefAnonRecs(n); + OPC_TypeDefs(OPT_topScope->right, 0); + OPM_WriteLn(); + OPC_IdentList(OPT_topScope->scope, 0); + OPM_WriteLn(); + OPC_GenDynTypes(n, 0); + OPM_WriteLn(); + OPC_ProcPredefs(OPT_topScope->right, 0); + OPM_WriteLn(); + OPC_CProcDefs(OPT_topScope->right, 0); + OPM_WriteLn(); +} + +static void OPC_RegCmds (OPT_Object obj) +{ + if (obj != NIL) { + OPC_RegCmds(obj->left); + if ((obj->mode == 7 && obj->history != 4)) { + if ((((obj->vis != 0 && obj->link == NIL)) && obj->typ == OPT_notyp)) { + OPC_BegStat(); + OPM_WriteString((CHAR*)"__REGCMD(\"", (LONGINT)11); + OPM_WriteStringVar((void*)obj->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"\", ", (LONGINT)4); + OPC_Ident(obj); + OPM_Write(')'); + OPC_EndStat(); + } + } + OPC_RegCmds(obj->right); + } +} + +static void OPC_InitImports (OPT_Object obj) +{ + if (obj != NIL) { + OPC_InitImports(obj->left); + if ((obj->mode == 11 && obj->mnolev != 0)) { + OPC_BegStat(); + OPM_WriteString((CHAR*)"__MODULE_IMPORT(", (LONGINT)17); + OPM_WriteStringVar((void*)OPT_GlbMod[__X(-obj->mnolev, ((LONGINT)(64)))]->name, ((LONGINT)(256))); + OPM_Write(')'); + OPC_EndStat(); + } + OPC_InitImports(obj->right); + } +} + +void OPC_GenEnumPtrs (OPT_Object var) +{ + OPT_Struct typ = NIL; + LONGINT n; + OPC_GlbPtrs = 0; + while (var != NIL) { + typ = var->typ; + if (OPC_NofPtrs(typ) > 0) { + if (!OPC_GlbPtrs) { + OPC_GlbPtrs = 1; + OPM_WriteString((CHAR*)"static ", (LONGINT)8); + if (OPC_ansi) { + OPM_WriteString((CHAR*)"void EnumPtrs(void (*P)(void*))", (LONGINT)32); + } else { + OPM_WriteString((CHAR*)"void EnumPtrs(P)", (LONGINT)17); + OPM_WriteLn(); + OPM_Write(0x09); + OPM_WriteString((CHAR*)"void (*P)();", (LONGINT)13); + } + OPM_WriteLn(); + OPC_BegBlk(); + } + OPC_BegStat(); + if (typ->form == 13) { + OPM_WriteString((CHAR*)"P(", (LONGINT)3); + OPC_Ident(var); + OPM_Write(')'); + } else if (typ->comp == 4) { + OPM_WriteString((CHAR*)"__ENUMR(&", (LONGINT)10); + OPC_Ident(var); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPC_Andent(typ); + OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPC_Str1((CHAR*)", #", (LONGINT)4, typ->size); + OPM_WriteString((CHAR*)", 1, P)", (LONGINT)8); + } else if (typ->comp == 2) { + n = typ->n; + typ = typ->BaseTyp; + while (typ->comp == 2) { + n = n * typ->n; + typ = typ->BaseTyp; + } + if (typ->form == 13) { + OPM_WriteString((CHAR*)"__ENUMP(", (LONGINT)9); + OPC_Ident(var); + OPC_Str1((CHAR*)", #, P)", (LONGINT)8, n); + } else if (typ->comp == 4) { + OPM_WriteString((CHAR*)"__ENUMR(", (LONGINT)9); + OPC_Ident(var); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPC_Andent(typ); + OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPC_Str1((CHAR*)", #", (LONGINT)4, typ->size); + OPC_Str1((CHAR*)", #, P)", (LONGINT)8, n); + } + } + OPC_EndStat(); + } + var = var->link; + } + if (OPC_GlbPtrs) { + OPC_EndBlk(); + OPM_WriteLn(); + } +} + +void OPC_EnterBody (void) +{ + OPM_WriteLn(); + OPM_WriteString((CHAR*)"export ", (LONGINT)8); + if (OPC_mainprog) { + if (OPC_ansi) { + OPM_WriteString((CHAR*)"int main(int argc, char **argv)", (LONGINT)32); + OPM_WriteLn(); + } else { + OPM_WriteString((CHAR*)"main(argc, argv)", (LONGINT)17); + OPM_WriteLn(); + OPM_Write(0x09); + OPM_WriteString((CHAR*)"int argc; char **argv;", (LONGINT)23); + OPM_WriteLn(); + } + } else { + OPM_WriteString((CHAR*)"void *", (LONGINT)7); + OPM_WriteString(OPM_modName, ((LONGINT)(32))); + OPM_WriteString(OPC_BodyNameExt, ((LONGINT)(13))); + OPM_WriteLn(); + } + OPC_BegBlk(); + OPC_BegStat(); + if (OPC_mainprog) { + OPM_WriteString((CHAR*)"__INIT(argc, argv)", (LONGINT)19); + } else { + OPM_WriteString((CHAR*)"__DEFMOD", (LONGINT)9); + } + OPC_EndStat(); + if ((OPC_mainprog && 0)) { + OPC_BegStat(); + OPM_WriteString((CHAR*)"/*don`t do it!*/ printf(\"DEMO VERSION: DO NOT USE THIS PROGRAM FOR ANY COMMERCIAL PURPOSE\\n\")", (LONGINT)94); + OPC_EndStat(); + } + OPC_InitImports(OPT_topScope->right); + OPC_BegStat(); + if (OPC_mainprog) { + OPM_WriteString((CHAR*)"__REGMAIN(\"", (LONGINT)12); + } else { + OPM_WriteString((CHAR*)"__REGMOD(\"", (LONGINT)11); + } + OPM_WriteString(OPM_modName, ((LONGINT)(32))); + if (OPC_GlbPtrs) { + OPM_WriteString((CHAR*)"\", EnumPtrs)", (LONGINT)13); + } else { + OPM_WriteString((CHAR*)"\", 0)", (LONGINT)6); + } + OPC_EndStat(); + if (__STRCMP(OPM_modName, "SYSTEM") != 0) { + OPC_RegCmds(OPT_topScope); + } +} + +void OPC_ExitBody (void) +{ + OPC_BegStat(); + if (OPC_mainprog) { + OPM_WriteString((CHAR*)"__FINI;", (LONGINT)8); + } else { + OPM_WriteString((CHAR*)"__ENDMOD;", (LONGINT)10); + } + OPM_WriteLn(); + OPC_EndBlk(); +} + +void OPC_DefineInter (OPT_Object proc) +{ + OPT_Object scope = NIL; + scope = proc->scope; + OPM_WriteString((CHAR*)"static ", (LONGINT)8); + OPM_WriteString((CHAR*)"struct ", (LONGINT)8); + OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); + OPM_Write(' '); + OPC_BegBlk(); + OPC_IdentList(proc->link, 3); + OPC_IdentList(scope->scope, 3); + OPC_BegStat(); + OPM_WriteString((CHAR*)"struct ", (LONGINT)8); + OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); + OPM_Write(' '); + OPM_Write('*'); + OPM_WriteString((CHAR*)"lnk", (LONGINT)4); + OPC_EndStat(); + OPC_EndBlk0(); + OPM_Write(' '); + OPM_Write('*'); + OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPC_EndStat(); + OPM_WriteLn(); + OPC_ProcPredefs(scope->right, 0); + OPM_WriteLn(); +} + +void OPC_EnterProc (OPT_Object proc) +{ + OPT_Object var = NIL, scope = NIL; + OPT_Struct typ = NIL; + INTEGER dim; + if (proc->vis != 1) { + OPM_WriteString((CHAR*)"static ", (LONGINT)8); + } + OPC_ProcHeader(proc, 1); + OPC_BegBlk(); + if (proc->typ != OPT_notyp) { + OPC_BegStat(); + OPC_Ident(proc->typ->strobj); + OPM_WriteString((CHAR*)" _o_result;", (LONGINT)12); + OPM_WriteLn(); + } + scope = proc->scope; + OPC_IdentList(scope->scope, 0); + if (!scope->leaf) { + OPC_BegStat(); + OPM_WriteString((CHAR*)"struct ", (LONGINT)8); + OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); + OPM_Write(' '); + OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPC_EndStat(); + } + var = proc->link; + while (var != NIL) { + if ((var->typ->comp == 2 && var->mode == 1)) { + OPC_BegStat(); + if (var->typ->strobj == NIL) { + OPM_Mark(200, var->typ->txtpos); + } else { + OPC_Ident(var->typ->strobj); + } + OPM_Write(' '); + OPC_Ident(var); + OPM_WriteString((CHAR*)"__copy", (LONGINT)7); + OPC_EndStat(); + } + var = var->link; + } + if (!OPC_ansi) { + var = proc->link; + while (var != NIL) { + if ((var->typ->form == 7 && var->mode == 1)) { + OPC_BegStat(); + OPC_Ident(var->typ->strobj); + OPM_Write(' '); + OPC_Ident(var); + OPM_WriteString((CHAR*)" = _", (LONGINT)5); + OPC_Ident(var); + OPC_EndStat(); + } + var = var->link; + } + } + var = proc->link; + while (var != NIL) { + if ((((__IN(var->typ->comp, 0x0c) && var->mode == 1)) && var->typ->sysflag == 0)) { + OPC_BegStat(); + if (var->typ->comp == 2) { + OPM_WriteString((CHAR*)"__DUPARR(", (LONGINT)10); + OPC_Ident(var); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + if (var->typ->strobj == NIL) { + OPM_Mark(200, var->typ->txtpos); + } else { + OPC_Ident(var->typ->strobj); + } + } else { + OPM_WriteString((CHAR*)"__DUP(", (LONGINT)7); + OPC_Ident(var); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPC_Ident(var); + OPM_WriteString((CHAR*)"__len", (LONGINT)6); + typ = var->typ->BaseTyp; + dim = 1; + while (typ->comp == 3) { + OPM_WriteString((CHAR*)" * ", (LONGINT)4); + OPC_Ident(var); + OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteInt(dim); + typ = typ->BaseTyp; + dim += 1; + } + OPM_WriteString((CHAR*)", ", (LONGINT)3); + if (typ->strobj == NIL) { + OPM_Mark(200, typ->txtpos); + } else { + OPC_Ident(typ->strobj); + } + } + OPM_Write(')'); + OPC_EndStat(); + } + var = var->link; + } + if (!scope->leaf) { + var = proc->link; + while (var != NIL) { + if (!var->leaf) { + OPC_BegStat(); + OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_Write('.'); + OPC_Ident(var); + OPM_WriteString((CHAR*)" = ", (LONGINT)4); + if (__IN(var->typ->comp, 0x0c)) { + OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + } else if (var->mode != 2) { + OPM_Write('&'); + } + OPC_Ident(var); + if (var->typ->comp == 3) { + typ = var->typ; + dim = 0; + do { + OPM_WriteString((CHAR*)"; ", (LONGINT)3); + OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_Write('.'); + OPC_Ident(var); + OPM_WriteString((CHAR*)"__len", (LONGINT)6); + if (dim != 0) { + OPM_WriteInt(dim); + } + OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPC_Ident(var); + OPM_WriteString((CHAR*)"__len", (LONGINT)6); + if (dim != 0) { + OPM_WriteInt(dim); + } + typ = typ->BaseTyp; + } while (!(typ->comp != 3)); + } else if ((var->mode == 2 && var->typ->comp == 4)) { + OPM_WriteString((CHAR*)"; ", (LONGINT)3); + OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_Write('.'); + OPC_Ident(var); + OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPC_Ident(var); + OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + } + OPC_EndStat(); + } + var = var->link; + } + var = scope->scope; + while (var != NIL) { + if (!var->leaf) { + OPC_BegStat(); + OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_Write('.'); + OPC_Ident(var); + OPM_WriteString((CHAR*)" = ", (LONGINT)4); + if (var->typ->comp != 2) { + OPM_Write('&'); + } else { + OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + } + OPC_Ident(var); + OPC_EndStat(); + } + var = var->link; + } + OPC_BegStat(); + OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_Write('.'); + OPM_WriteString((CHAR*)"lnk", (LONGINT)4); + OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPC_EndStat(); + OPC_BegStat(); + OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_Write('&'); + OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPC_EndStat(); + } +} + +void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet) +{ + OPT_Object var = NIL; + BOOLEAN indent; + indent = eoBlock; + if ((implicitRet && proc->typ != OPT_notyp)) { + OPM_Write(0x09); + OPM_WriteString((CHAR*)"__RETCHK;", (LONGINT)10); + OPM_WriteLn(); + } else if (!eoBlock || implicitRet) { + if (!proc->scope->leaf) { + if (indent) { + OPC_BegStat(); + } else { + indent = 1; + } + OPM_WriteStringVar((void*)proc->scope->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_Write('.'); + OPM_WriteString((CHAR*)"lnk", (LONGINT)4); + OPC_EndStat(); + } + var = proc->link; + while (var != NIL) { + if ((((var->typ->comp == 3 && var->mode == 1)) && var->typ->sysflag == 0)) { + if (indent) { + OPC_BegStat(); + } else { + indent = 1; + } + OPM_WriteString((CHAR*)"__DEL(", (LONGINT)7); + OPC_Ident(var); + OPM_Write(')'); + OPC_EndStat(); + } + var = var->link; + } + } + if (eoBlock) { + OPC_EndBlk(); + OPM_WriteLn(); + } else if (indent) { + OPC_BegStat(); + } +} + +void OPC_CompleteIdent (OPT_Object obj) +{ + INTEGER comp, level; + level = obj->mnolev; + if (obj->adr == 1) { + if (obj->typ->comp == 4) { + OPC_Ident(obj); + OPM_WriteString((CHAR*)"__", (LONGINT)3); + } else { + OPM_WriteString((CHAR*)"((", (LONGINT)3); + OPC_Ident(obj->typ->strobj); + OPM_Write(')'); + OPC_Ident(obj); + OPM_Write(')'); + } + } else if ((level != OPM_level && level > 0)) { + comp = obj->typ->comp; + if ((obj->mode != 2 && comp != 3)) { + OPM_Write('*'); + } + OPM_WriteStringVar((void*)obj->scope->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"->", (LONGINT)3); + OPC_Ident(obj); + } else { + OPC_Ident(obj); + } +} + +void OPC_TypeOf (OPT_Object ap) +{ + INTEGER i; + __ASSERT(ap->typ->comp == 4, 0); + if (ap->mode == 2) { + if ((int)ap->mnolev != OPM_level) { + OPM_WriteStringVar((void*)ap->scope->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"_s->", (LONGINT)5); + OPC_Ident(ap); + } else { + OPC_Ident(ap); + } + OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + } else if (ap->typ->strobj != NIL) { + OPC_Ident(ap->typ->strobj); + OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + } else { + OPC_Andent(ap->typ); + } +} + +void OPC_Cmp (INTEGER rel) +{ + switch (rel) { + case 9: + OPM_WriteString((CHAR*)" == ", (LONGINT)5); + break; + case 10: + OPM_WriteString((CHAR*)" != ", (LONGINT)5); + break; + case 11: + OPM_WriteString((CHAR*)" < ", (LONGINT)4); + break; + case 12: + OPM_WriteString((CHAR*)" <= ", (LONGINT)5); + break; + case 13: + OPM_WriteString((CHAR*)" > ", (LONGINT)4); + break; + case 14: + OPM_WriteString((CHAR*)" >= ", (LONGINT)5); + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPC.Cmp, rel = ", (LONGINT)34); + OPM_LogWNum(rel, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } +} + +void OPC_Case (LONGINT caseVal, INTEGER form) +{ + CHAR ch; + OPM_WriteString((CHAR*)"case ", (LONGINT)6); + switch (form) { + case 3: + ch = (CHAR)caseVal; + if ((ch >= ' ' && ch <= '~')) { + OPM_Write('\''); + if (((ch == '\\' || ch == '\?') || ch == '\'') || ch == '\"') { + OPM_Write('\\'); + OPM_Write(ch); + } else { + OPM_Write(ch); + } + OPM_Write('\''); + } else { + OPM_WriteString((CHAR*)"0x", (LONGINT)3); + OPM_WriteHex(caseVal); + } + break; + case 4: case 5: case 6: + OPM_WriteInt(caseVal); + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPC.Case, form = ", (LONGINT)36); + OPM_LogWNum(form, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + OPM_WriteString((CHAR*)": ", (LONGINT)3); +} + +void OPC_SetInclude (BOOLEAN exclude) +{ + if (exclude) { + OPM_WriteString((CHAR*)" &= ~", (LONGINT)6); + } else { + OPM_WriteString((CHAR*)" |= ", (LONGINT)5); + } +} + +void OPC_Increment (BOOLEAN decrement) +{ + if (decrement) { + OPM_WriteString((CHAR*)" -= ", (LONGINT)5); + } else { + OPM_WriteString((CHAR*)" += ", (LONGINT)5); + } +} + +void OPC_Halt (LONGINT n) +{ + OPC_Str1((CHAR*)"__HALT(#)", (LONGINT)10, n); +} + +void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim) +{ + if (array->comp == 3) { + OPC_CompleteIdent(obj); + OPM_WriteString((CHAR*)"__len", (LONGINT)6); + if (dim != 0) { + OPM_WriteInt(dim); + } + } else { + while (dim > 0) { + array = array->BaseTyp; + dim -= 1; + } + OPM_WriteString((CHAR*)"((LONGINT)(", (LONGINT)12); + OPM_WriteInt(array->n); + OPM_WriteString((CHAR*)"))", (LONGINT)3); + } +} + +void OPC_Constant (OPT_Const con, INTEGER form) +{ + INTEGER i, len; + CHAR ch; + SET s; + LONGINT hex; + BOOLEAN skipLeading; + switch (form) { + case 1: + OPM_WriteInt(con->intval); + break; + case 2: + OPM_WriteInt(con->intval); + break; + case 3: + ch = (CHAR)con->intval; + if ((ch >= ' ' && ch <= '~')) { + OPM_Write('\''); + if (((ch == '\\' || ch == '\?') || ch == '\'') || ch == '\"') { + OPM_Write('\\'); + } + OPM_Write(ch); + OPM_Write('\''); + } else { + OPM_WriteString((CHAR*)"0x", (LONGINT)3); + OPM_WriteHex(con->intval); + } + break; + case 4: case 5: case 6: + OPM_WriteInt(con->intval); + break; + case 7: + OPM_WriteReal(con->realval, 'f'); + break; + case 8: + OPM_WriteReal(con->realval, 0x00); + break; + case 9: + OPM_WriteString((CHAR*)"0x", (LONGINT)3); + skipLeading = 1; + s = con->setval; + i = 32; + do { + hex = 0; + do { + i -= 1; + hex = __ASHL(hex, 1); + if (__IN(i, s)) { + hex += 1; + } + } while (!(__MASK(i, -8) == 0)); + if (hex != 0 || !skipLeading) { + OPM_WriteHex(hex); + skipLeading = 0; + } + } while (!(i == 0)); + if (skipLeading) { + OPM_Write('0'); + } + break; + case 10: + OPM_Write('\"'); + len = (int)con->intval2 - 1; + i = 0; + while (i < len) { + ch = (*con->ext)[__X(i, ((LONGINT)(256)))]; + if (((ch == '\\' || ch == '\?') || ch == '\'') || ch == '\"') { + OPM_Write('\\'); + } + OPM_Write(ch); + i += 1; + } + OPM_Write('\"'); + break; + case 11: + OPM_WriteString((CHAR*)"NIL", (LONGINT)4); + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPC.Constant, form = ", (LONGINT)40); + OPM_LogWNum(form, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } +} + +static struct InitKeywords__47 { + SHORTINT *n; + struct InitKeywords__47 *lnk; +} *InitKeywords__47_s; + +static void Enter__48 (CHAR *s, LONGINT s__len); + +static void Enter__48 (CHAR *s, LONGINT s__len) +{ + INTEGER h; + __DUP(s, s__len, CHAR); + h = OPC_PerfectHash((void*)s, s__len); + OPC_hashtab[__X(h, ((LONGINT)(105)))] = *InitKeywords__47_s->n; + __COPY(s, OPC_keytab[__X(*InitKeywords__47_s->n, ((LONGINT)(36)))], ((LONGINT)(9))); + *InitKeywords__47_s->n += 1; + __DEL(s); +} + +static void OPC_InitKeywords (void) +{ + SHORTINT n, i; + struct InitKeywords__47 _s; + _s.n = &n; + _s.lnk = InitKeywords__47_s; + InitKeywords__47_s = &_s; + n = 0; + i = 0; + while (i <= 104) { + OPC_hashtab[__X(i, ((LONGINT)(105)))] = -1; + i += 1; + } + Enter__48((CHAR*)"asm", (LONGINT)4); + Enter__48((CHAR*)"auto", (LONGINT)5); + Enter__48((CHAR*)"break", (LONGINT)6); + Enter__48((CHAR*)"case", (LONGINT)5); + Enter__48((CHAR*)"char", (LONGINT)5); + Enter__48((CHAR*)"const", (LONGINT)6); + Enter__48((CHAR*)"continue", (LONGINT)9); + Enter__48((CHAR*)"default", (LONGINT)8); + Enter__48((CHAR*)"do", (LONGINT)3); + Enter__48((CHAR*)"double", (LONGINT)7); + Enter__48((CHAR*)"else", (LONGINT)5); + Enter__48((CHAR*)"enum", (LONGINT)5); + Enter__48((CHAR*)"extern", (LONGINT)7); + Enter__48((CHAR*)"export", (LONGINT)7); + Enter__48((CHAR*)"float", (LONGINT)6); + Enter__48((CHAR*)"for", (LONGINT)4); + Enter__48((CHAR*)"fortran", (LONGINT)8); + Enter__48((CHAR*)"goto", (LONGINT)5); + Enter__48((CHAR*)"if", (LONGINT)3); + Enter__48((CHAR*)"import", (LONGINT)7); + Enter__48((CHAR*)"int", (LONGINT)4); + Enter__48((CHAR*)"long", (LONGINT)5); + Enter__48((CHAR*)"register", (LONGINT)9); + Enter__48((CHAR*)"return", (LONGINT)7); + Enter__48((CHAR*)"short", (LONGINT)6); + Enter__48((CHAR*)"signed", (LONGINT)7); + Enter__48((CHAR*)"sizeof", (LONGINT)7); + Enter__48((CHAR*)"static", (LONGINT)7); + Enter__48((CHAR*)"struct", (LONGINT)7); + Enter__48((CHAR*)"switch", (LONGINT)7); + Enter__48((CHAR*)"typedef", (LONGINT)8); + Enter__48((CHAR*)"union", (LONGINT)6); + Enter__48((CHAR*)"unsigned", (LONGINT)9); + Enter__48((CHAR*)"void", (LONGINT)5); + Enter__48((CHAR*)"volatile", (LONGINT)9); + Enter__48((CHAR*)"while", (LONGINT)6); + InitKeywords__47_s = _s.lnk; +} + + +export void *OPC__init(void) +{ + __DEFMOD; + __MODULE_IMPORT(Configuration); + __MODULE_IMPORT(OPM); + __MODULE_IMPORT(OPT); + __REGMOD("OPC", 0); + __REGCMD("BegBlk", OPC_BegBlk); + __REGCMD("BegStat", OPC_BegStat); + __REGCMD("EndBlk", OPC_EndBlk); + __REGCMD("EndBlk0", OPC_EndBlk0); + __REGCMD("EndStat", OPC_EndStat); + __REGCMD("EnterBody", OPC_EnterBody); + __REGCMD("ExitBody", OPC_ExitBody); + __REGCMD("GenHdrIncludes", OPC_GenHdrIncludes); + __REGCMD("Init", OPC_Init); +/* BEGIN */ + OPC_InitKeywords(); + __ENDMOD; +} diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h new file mode 100644 index 00000000..713ea3b2 --- /dev/null +++ b/bootstrap/unix-48/OPC.h @@ -0,0 +1,49 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ + +#ifndef OPC__h +#define OPC__h + +#include "SYSTEM.h" +#include "OPT.h" + + + + +import void OPC_Align (LONGINT *adr, LONGINT base); +import void OPC_Andent (OPT_Struct typ); +import LONGINT OPC_Base (OPT_Struct typ); +import OPT_Object OPC_BaseTProc (OPT_Object obj); +import void OPC_BegBlk (void); +import void OPC_BegStat (void); +import void OPC_Case (LONGINT caseVal, INTEGER form); +import void OPC_Cmp (INTEGER rel); +import void OPC_CompleteIdent (OPT_Object obj); +import void OPC_Constant (OPT_Const con, INTEGER form); +import void OPC_DefineInter (OPT_Object proc); +import void OPC_EndBlk (void); +import void OPC_EndBlk0 (void); +import void OPC_EndStat (void); +import void OPC_EnterBody (void); +import void OPC_EnterProc (OPT_Object proc); +import void OPC_ExitBody (void); +import void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet); +import void OPC_GenBdy (OPT_Node n); +import void OPC_GenEnumPtrs (OPT_Object var); +import void OPC_GenHdr (OPT_Node n); +import void OPC_GenHdrIncludes (void); +import void OPC_Halt (LONGINT n); +import void OPC_Ident (OPT_Object obj); +import void OPC_Increment (BOOLEAN decrement); +import void OPC_Indent (INTEGER count); +import void OPC_Init (void); +import void OPC_InitTDesc (OPT_Struct typ); +import void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim); +import LONGINT OPC_NofPtrs (OPT_Struct typ); +import void OPC_SetInclude (BOOLEAN exclude); +import void OPC_TDescDecl (OPT_Struct typ); +import void OPC_TypeDefs (OPT_Object obj, INTEGER vis); +import void OPC_TypeOf (OPT_Object ap); +import void *OPC__init(void); + + +#endif diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c new file mode 100644 index 00000000..3d68d2be --- /dev/null +++ b/bootstrap/unix-48/OPM.c @@ -0,0 +1,1091 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +#include "SYSTEM.h" +#include "Configuration.h" +#include "Console.h" +#include "Files.h" +#include "Platform.h" +#include "Strings.h" +#include "Texts.h" +#include "errors.h" +#include "vt100.h" + +typedef + CHAR OPM_FileName[32]; + + +static CHAR OPM_SourceFileName[256]; +export INTEGER OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_CharAlign, OPM_BoolAlign, OPM_SIntAlign, OPM_IntAlign, OPM_LIntAlign, OPM_SetAlign, OPM_RealAlign, OPM_LRealAlign, OPM_PointerAlign, OPM_ProcAlign, OPM_RecAlign, OPM_MaxSet; +export LONGINT OPM_MinSInt, OPM_MinInt, OPM_MinLInt, OPM_MaxSInt, OPM_MaxInt, OPM_MaxLInt, OPM_MaxIndex; +export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; +export BOOLEAN OPM_noerr; +export LONGINT OPM_curpos, OPM_errpos, OPM_breakpc; +export INTEGER OPM_currFile, OPM_level, OPM_pc, OPM_entno; +export CHAR OPM_modName[32]; +export CHAR OPM_objname[64]; +export SET OPM_opt, OPM_glbopt; +static LONGINT OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; +static Texts_Reader OPM_inR; +static Texts_Text OPM_Log; +static Texts_Writer OPM_W; +static Files_Rider OPM_oldSF, OPM_newSF; +static Files_Rider OPM_R[3]; +static Files_File OPM_oldSFile, OPM_newSFile, OPM_HFile, OPM_BFile, OPM_HIFile; +static INTEGER OPM_S; +export BOOLEAN OPM_dontAsm, OPM_dontLink, OPM_mainProg, OPM_mainLinkStat, OPM_notColorOutput, OPM_forceNewSym, OPM_Verbose; +static CHAR OPM_OBERON[1024]; +static CHAR OPM_MODULES[1024]; + + +static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F); +export void OPM_CloseFiles (void); +export void OPM_CloseOldSym (void); +export void OPM_DeleteNewSym (void); +export void OPM_FPrint (LONGINT *fp, LONGINT val); +export void OPM_FPrintLReal (LONGINT *fp, LONGREAL lr); +export void OPM_FPrintReal (LONGINT *fp, REAL real); +export void OPM_FPrintSet (LONGINT *fp, SET set); +static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, LONGINT pos); +export void OPM_Get (CHAR *ch); +static void OPM_GetProperties (void); +static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONGINT name__len, INTEGER *size, INTEGER *align); +export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); +export void OPM_InitOptions (void); +static void OPM_LogErrMsg (INTEGER n); +export void OPM_LogW (CHAR ch); +export void OPM_LogWLn (void); +export void OPM_LogWNum (LONGINT i, LONGINT len); +export void OPM_LogWStr (CHAR *s, LONGINT s__len); +static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len); +export void OPM_Mark (INTEGER n, LONGINT pos); +static INTEGER OPM_Min (INTEGER a, INTEGER b); +export void OPM_NewSym (CHAR *modName, LONGINT modName__len); +export void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); +export void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); +export BOOLEAN OPM_OpenPar (void); +export void OPM_RegisterNewSym (void); +static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt); +static void OPM_ShowLine (LONGINT pos); +export void OPM_SymRCh (CHAR *ch); +export LONGINT OPM_SymRInt (void); +export void OPM_SymRLReal (LONGREAL *lr); +export void OPM_SymRReal (REAL *r); +export void OPM_SymRSet (SET *s); +export void OPM_SymWCh (CHAR ch); +export void OPM_SymWInt (LONGINT i); +export void OPM_SymWLReal (LONGREAL lr); +export void OPM_SymWReal (REAL r); +export void OPM_SymWSet (SET s); +static void OPM_VerboseListSizes (void); +export void OPM_Write (CHAR ch); +export void OPM_WriteHex (LONGINT i); +export void OPM_WriteInt (LONGINT i); +export void OPM_WriteLn (void); +export void OPM_WriteReal (LONGREAL r, CHAR suffx); +export void OPM_WriteString (CHAR *s, LONGINT s__len); +export void OPM_WriteStringVar (CHAR *s, LONGINT s__len); +export BOOLEAN OPM_eofSF (void); +export void OPM_err (INTEGER n); +static LONGINT OPM_minus (LONGINT i); +static LONGINT OPM_power0 (LONGINT i, LONGINT j); + + +void OPM_LogW (CHAR ch) +{ + Console_Char(ch); +} + +void OPM_LogWStr (CHAR *s, LONGINT s__len) +{ + __DUP(s, s__len, CHAR); + Console_String(s, s__len); + __DEL(s); +} + +void OPM_LogWNum (LONGINT i, LONGINT len) +{ + Console_Int(i, len); +} + +void OPM_LogWLn (void) +{ + Console_Ln(); +} + +static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) +{ + INTEGER i; + i = 1; + while (s[__X(i, s__len)] != 0x00) { + switch (s[__X(i, s__len)]) { + case 'e': + *opt = *opt ^ 0x0200; + break; + case 's': + *opt = *opt ^ 0x10; + break; + case 'm': + *opt = *opt ^ 0x0400; + break; + case 'x': + *opt = *opt ^ 0x01; + break; + case 'r': + *opt = *opt ^ 0x04; + break; + case 't': + *opt = *opt ^ 0x08; + break; + case 'a': + *opt = *opt ^ 0x80; + break; + case 'k': + *opt = *opt ^ 0x40; + break; + case 'p': + *opt = *opt ^ 0x20; + break; + case 'S': + *opt = *opt ^ 0x2000; + break; + case 'c': + *opt = *opt ^ 0x4000; + break; + case 'M': + *opt = *opt ^ 0x8000; + break; + case 'f': + *opt = *opt ^ 0x010000; + break; + case 'F': + *opt = *opt ^ 0x020000; + break; + case 'V': + *opt = *opt ^ 0x040000; + break; + case 'B': + if (s[__X(i + 1, s__len)] != 0x00) { + i += 1; + OPM_IntSize = (int)s[__X(i, s__len)] - 48; + } + if (s[__X(i + 1, s__len)] != 0x00) { + i += 1; + OPM_PointerSize = (int)s[__X(i, s__len)] - 48; + } + if (s[__X(i + 1, s__len)] != 0x00) { + i += 1; + OPM_Alignment = (int)s[__X(i, s__len)] - 48; + } + __ASSERT(OPM_IntSize == 2 || OPM_IntSize == 4, 0); + __ASSERT(OPM_PointerSize == 4 || OPM_PointerSize == 8, 0); + __ASSERT(OPM_Alignment == 4 || OPM_Alignment == 8, 0); + break; + default: + OPM_LogWStr((CHAR*)" warning: option ", (LONGINT)19); + OPM_LogW('-'); + OPM_LogW(s[__X(i, s__len)]); + OPM_LogWStr((CHAR*)" ignored", (LONGINT)9); + OPM_LogWLn(); + break; + } + i += 1; + } +} + +BOOLEAN OPM_OpenPar (void) +{ + BOOLEAN _o_result; + CHAR s[256]; + if (Platform_ArgCount == 1) { + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Vishap Oberon-2 compiler v", (LONGINT)27); + OPM_LogWStr((CHAR*)"1.2 [2016/06/15] for gcc LP64 on cygwin", (LONGINT)40); + OPM_LogW('.'); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Based on Ofront by Software Templ OEG, continued by Norayr Chilingarian and others.", (LONGINT)84); + OPM_LogWLn(); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Usage:", (LONGINT)7); + OPM_LogWLn(); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" ", (LONGINT)3); + OPM_LogWStr((CHAR*)"voc", (LONGINT)4); + OPM_LogWStr((CHAR*)" options {files {options}}.", (LONGINT)28); + OPM_LogWLn(); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Where options = [\"-\" {option} ].", (LONGINT)33); + OPM_LogWLn(); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" m - generate code for main module", (LONGINT)36); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" M - generate code for main module and link object statically", (LONGINT)63); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" s - generate new symbol file", (LONGINT)31); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" e - allow extending the module interface", (LONGINT)43); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" r - check value ranges", (LONGINT)25); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" x - turn off array indices check", (LONGINT)35); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" a - don\'t check ASSERTs at runtime, use this option in tested production code", (LONGINT)80); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" p - turn off automatic pointer initialization", (LONGINT)48); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" t - don\'t check type guards (use in rare cases such as low-level modules where every cycle counts)", (LONGINT)101); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" S - don\'t call external assembler/compiler, only generate C code", (LONGINT)67); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" c - don\'t call linker", (LONGINT)24); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" f - don\'t use color output", (LONGINT)29); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" F - force writing new symbol file in current directory", (LONGINT)57); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" V - verbose output", (LONGINT)21); + OPM_LogWLn(); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Initial options specify defaults for all files.", (LONGINT)48); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Options following a filename are specific to that file.", (LONGINT)56); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Repeating an option toggles its value.", (LONGINT)39); + OPM_LogWLn(); + _o_result = 0; + return _o_result; + } else { + OPM_S = 1; + s[0] = 0x00; + Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + OPM_glbopt = 0xe9; + while (s[0] == '-') { + OPM_ScanOptions((void*)s, ((LONGINT)(256)), &OPM_glbopt); + OPM_S += 1; + s[0] = 0x00; + Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + } + _o_result = 1; + return _o_result; + } + __RETCHK; +} + +void OPM_InitOptions (void) +{ + CHAR s[256]; + OPM_opt = OPM_glbopt; + s[0] = 0x00; + Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + while (s[0] == '-') { + OPM_ScanOptions((void*)s, ((LONGINT)(256)), &OPM_opt); + OPM_S += 1; + s[0] = 0x00; + Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + } + OPM_dontAsm = __IN(13, OPM_opt); + OPM_dontLink = __IN(14, OPM_opt); + OPM_mainProg = __IN(10, OPM_opt); + OPM_mainLinkStat = __IN(15, OPM_opt); + OPM_notColorOutput = __IN(16, OPM_opt); + OPM_forceNewSym = __IN(17, OPM_opt); + OPM_Verbose = __IN(18, OPM_opt); + if (OPM_mainLinkStat) { + OPM_glbopt |= __SETOF(10); + } + OPM_GetProperties(); +} + +void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len) +{ + Texts_Text T = NIL; + LONGINT beg, end, time; + CHAR s[256]; + *done = 0; + OPM_curpos = 0; + if (OPM_S >= Platform_ArgCount) { + return; + } + s[0] = 0x00; + Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + __NEW(T, Texts_TextDesc); + Texts_Open(T, s, ((LONGINT)(256))); + OPM_LogWStr(s, ((LONGINT)(256))); + OPM_LogWStr((CHAR*)" ", (LONGINT)3); + __COPY(s, mname, mname__len); + __COPY(s, OPM_SourceFileName, ((LONGINT)(256))); + if (T->len == 0) { + OPM_LogWStr(s, ((LONGINT)(256))); + OPM_LogWStr((CHAR*)" not found.", (LONGINT)12); + OPM_LogWLn(); + } else { + Texts_OpenReader(&OPM_inR, Texts_Reader__typ, T, ((LONGINT)(0))); + *done = 1; + } + OPM_S += 1; + OPM_level = 0; + OPM_noerr = 1; + OPM_errpos = OPM_curpos; + OPM_lasterrpos = OPM_curpos - 10; + OPM_ErrorLineStartPos = 0; + OPM_ErrorLineLimitPos = 0; + OPM_ErrorLineNumber = 0; +} + +void OPM_Get (CHAR *ch) +{ + Texts_Read(&OPM_inR, Texts_Reader__typ, &*ch); + if (*ch == 0x0d) { + OPM_curpos = Texts_Pos(&OPM_inR, Texts_Reader__typ); + } else { + OPM_curpos += 1; + } + if ((*ch < 0x09 && !OPM_inR.eot)) { + *ch = ' '; + } +} + +static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len) +{ + INTEGER i, j; + CHAR ch; + __DUP(ext, ext__len, CHAR); + i = 0; + for (;;) { + ch = name[__X(i, name__len)]; + if (ch == 0x00) { + break; + } + FName[__X(i, FName__len)] = ch; + i += 1; + } + j = 0; + do { + ch = ext[__X(j, ext__len)]; + FName[__X(i, FName__len)] = ch; + i += 1; + j += 1; + } while (!(ch == 0x00)); + __DEL(ext); +} + +static void OPM_LogErrMsg (INTEGER n) +{ + Texts_Scanner S; + Texts_Text T = NIL; + CHAR ch; + INTEGER i; + CHAR buf[1024]; + if (n >= 0) { + if (!OPM_notColorOutput) { + vt100_SetAttr((CHAR*)"31m", (LONGINT)4); + } + OPM_LogWStr((CHAR*)" err ", (LONGINT)7); + if (!OPM_notColorOutput) { + vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + } + } else { + if (!OPM_notColorOutput) { + vt100_SetAttr((CHAR*)"35m", (LONGINT)4); + } + OPM_LogWStr((CHAR*)" warning ", (LONGINT)11); + n = -n; + if (!OPM_notColorOutput) { + vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + } + } + OPM_LogWNum(n, ((LONGINT)(1))); + OPM_LogWStr((CHAR*)" ", (LONGINT)3); + OPM_LogWStr(errors_errors[__X(n, ((LONGINT)(350)))], ((LONGINT)(128))); +} + +static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, LONGINT pos) +{ + CHAR ch, cheol; + if (pos < OPM_ErrorLineStartPos) { + OPM_ErrorLineStartPos = 0; + OPM_ErrorLineLimitPos = 0; + OPM_ErrorLineNumber = 0; + } + if (pos < OPM_ErrorLineLimitPos) { + Files_Set(&*r, r__typ, f, OPM_ErrorLineStartPos); + return; + } + Files_Set(&*r, r__typ, f, OPM_ErrorLineLimitPos); + Files_Read(&*r, r__typ, (void*)&ch); + while ((OPM_ErrorLineLimitPos < pos && !(*r).eof)) { + OPM_ErrorLineStartPos = OPM_ErrorLineLimitPos; + OPM_ErrorLineNumber += 1; + while ((((ch != 0x00 && ch != 0x0d)) && ch != 0x0a)) { + Files_Read(&*r, r__typ, (void*)&ch); + OPM_ErrorLineLimitPos += 1; + } + cheol = ch; + Files_Read(&*r, r__typ, (void*)&ch); + OPM_ErrorLineLimitPos += 1; + if ((cheol == 0x0d && ch == 0x0a)) { + OPM_ErrorLineLimitPos += 1; + Files_Read(&*r, r__typ, (void*)&ch); + } + } + Files_Set(&*r, r__typ, f, OPM_ErrorLineStartPos); +} + +static void OPM_ShowLine (LONGINT pos) +{ + Files_File f = NIL; + Files_Rider r; + CHAR line[1023]; + INTEGER i; + CHAR ch; + f = Files_Old(OPM_SourceFileName, ((LONGINT)(256))); + OPM_FindLine(f, &r, Files_Rider__typ, pos); + i = 0; + Files_Read(&r, Files_Rider__typ, (void*)&ch); + while ((((((ch != 0x00 && ch != 0x0d)) && ch != 0x0a)) && i < 1022)) { + line[__X(i, ((LONGINT)(1023)))] = ch; + i += 1; + Files_Read(&r, Files_Rider__typ, (void*)&ch); + } + line[__X(i, ((LONGINT)(1023)))] = 0x00; + OPM_LogWLn(); + OPM_LogWLn(); + OPM_LogWNum(OPM_ErrorLineNumber, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)": ", (LONGINT)3); + OPM_LogWStr(line, ((LONGINT)(1023))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" ", (LONGINT)7); + if (pos >= OPM_ErrorLineLimitPos) { + pos = OPM_ErrorLineLimitPos - 1; + } + i = (int)(pos - OPM_ErrorLineStartPos); + while (i > 0) { + OPM_LogW(' '); + i -= 1; + } + if (!OPM_notColorOutput) { + vt100_SetAttr((CHAR*)"32m", (LONGINT)4); + } + OPM_LogW('^'); + if (!OPM_notColorOutput) { + vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + } + Files_Close(f); +} + +void OPM_Mark (INTEGER n, LONGINT pos) +{ + if (pos == -1) { + pos = 0; + } + if (n >= 0) { + OPM_noerr = 0; + if (pos < OPM_lasterrpos || OPM_lasterrpos + 9 < pos) { + OPM_lasterrpos = pos; + OPM_ShowLine(pos); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" ", (LONGINT)3); + if (n < 249) { + OPM_LogWStr((CHAR*)" pos", (LONGINT)6); + OPM_LogWNum(pos, ((LONGINT)(6))); + OPM_LogErrMsg(n); + } else if (n == 255) { + OPM_LogWStr((CHAR*)"pos", (LONGINT)4); + OPM_LogWNum(pos, ((LONGINT)(6))); + OPM_LogWStr((CHAR*)" pc ", (LONGINT)6); + OPM_LogWNum(OPM_breakpc, ((LONGINT)(1))); + } else if (n == 254) { + OPM_LogWStr((CHAR*)"pc not found", (LONGINT)13); + } else { + OPM_LogWStr(OPM_objname, ((LONGINT)(64))); + if (n == 253) { + OPM_LogWStr((CHAR*)" is new, compile with option e", (LONGINT)31); + } else if (n == 252) { + OPM_LogWStr((CHAR*)" is redefined, compile with option s", (LONGINT)37); + } else if (n == 251) { + OPM_LogWStr((CHAR*)" is redefined (private part only), compile with option s", (LONGINT)57); + } else if (n == 250) { + OPM_LogWStr((CHAR*)" is no longer visible, compile with option s", (LONGINT)45); + } else if (n == 249) { + OPM_LogWStr((CHAR*)" is not consistently imported, recompile imports", (LONGINT)49); + } + } + } + } else { + if (pos >= 0) { + OPM_ShowLine(pos); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" pos", (LONGINT)6); + OPM_LogWNum(pos, ((LONGINT)(6))); + } + OPM_LogErrMsg(n); + if (pos < 0) { + OPM_LogWLn(); + } + } +} + +void OPM_err (INTEGER n) +{ + OPM_Mark(n, OPM_errpos); +} + +void OPM_FPrint (LONGINT *fp, LONGINT val) +{ + *fp = __ROTL((LONGINT)((SET)*fp ^ (SET)val), 1, LONGINT); +} + +void OPM_FPrintSet (LONGINT *fp, SET set) +{ + OPM_FPrint(&*fp, (LONGINT)set); +} + +void OPM_FPrintReal (LONGINT *fp, REAL real) +{ + OPM_FPrint(&*fp, __VAL(LONGINT, real)); +} + +void OPM_FPrintLReal (LONGINT *fp, LONGREAL lr) +{ + LONGINT l, h; + __GET((LONGINT)(uintptr_t)&lr, l, LONGINT); + __GET((LONGINT)(uintptr_t)&lr + 4, h, LONGINT); + OPM_FPrint(&*fp, l); + OPM_FPrint(&*fp, h); +} + +static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONGINT name__len, INTEGER *size, INTEGER *align) +{ + __DUP(name, name__len, CHAR); + if (((*S).class == 1 && __STRCMP((*S).s, name) == 0)) { + Texts_Scan(&*S, S__typ); + if ((*S).class == 3) { + *size = (int)(*S).i; + Texts_Scan(&*S, S__typ); + } else { + OPM_Mark(-157, ((LONGINT)(-1))); + } + if ((*S).class == 3) { + *align = (int)(*S).i; + Texts_Scan(&*S, S__typ); + } else { + OPM_Mark(-157, ((LONGINT)(-1))); + } + } else { + OPM_Mark(-157, ((LONGINT)(-1))); + } + __DEL(name); +} + +static LONGINT OPM_minus (LONGINT i) +{ + LONGINT _o_result; + _o_result = -i; + return _o_result; +} + +static LONGINT OPM_power0 (LONGINT i, LONGINT j) +{ + LONGINT _o_result; + LONGINT k, p; + k = 1; + p = i; + do { + p = p * i; + k += 1; + } while (!(k == j)); + _o_result = p; + return _o_result; +} + +static void OPM_VerboseListSizes (void) +{ + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Type Size Alignement", (LONGINT)29); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"CHAR ", (LONGINT)14); + OPM_LogWNum(OPM_CharSize, ((LONGINT)(4))); + OPM_LogWNum(OPM_CharAlign, ((LONGINT)(5))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"BOOLEAN ", (LONGINT)14); + OPM_LogWNum(OPM_BoolSize, ((LONGINT)(4))); + OPM_LogWNum(OPM_BoolAlign, ((LONGINT)(5))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"SHORTINT ", (LONGINT)14); + OPM_LogWNum(OPM_SIntSize, ((LONGINT)(4))); + OPM_LogWNum(OPM_SIntAlign, ((LONGINT)(5))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"INTEGER ", (LONGINT)14); + OPM_LogWNum(OPM_IntSize, ((LONGINT)(4))); + OPM_LogWNum(OPM_IntAlign, ((LONGINT)(5))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"LONGINT ", (LONGINT)14); + OPM_LogWNum(OPM_LIntSize, ((LONGINT)(4))); + OPM_LogWNum(OPM_LIntAlign, ((LONGINT)(5))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"SET ", (LONGINT)14); + OPM_LogWNum(OPM_SetSize, ((LONGINT)(4))); + OPM_LogWNum(OPM_SetAlign, ((LONGINT)(5))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"REAL ", (LONGINT)14); + OPM_LogWNum(OPM_RealSize, ((LONGINT)(4))); + OPM_LogWNum(OPM_RealAlign, ((LONGINT)(5))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"LONGREAL ", (LONGINT)14); + OPM_LogWNum(OPM_LRealSize, ((LONGINT)(4))); + OPM_LogWNum(OPM_LRealAlign, ((LONGINT)(5))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"PTR ", (LONGINT)14); + OPM_LogWNum(OPM_PointerSize, ((LONGINT)(4))); + OPM_LogWNum(OPM_PointerAlign, ((LONGINT)(5))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"PROC ", (LONGINT)14); + OPM_LogWNum(OPM_ProcSize, ((LONGINT)(4))); + OPM_LogWNum(OPM_ProcAlign, ((LONGINT)(5))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"RECORD ", (LONGINT)14); + OPM_LogWNum(OPM_RecSize, ((LONGINT)(4))); + OPM_LogWNum(OPM_RecAlign, ((LONGINT)(5))); + OPM_LogWLn(); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Min shortint ", (LONGINT)14); + OPM_LogWNum(OPM_MinSInt, ((LONGINT)(4))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Max shortint ", (LONGINT)14); + OPM_LogWNum(OPM_MaxSInt, ((LONGINT)(4))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Min integer ", (LONGINT)14); + OPM_LogWNum(OPM_MinInt, ((LONGINT)(4))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Max integer ", (LONGINT)14); + OPM_LogWNum(OPM_MaxInt, ((LONGINT)(4))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Min longint ", (LONGINT)14); + OPM_LogWNum(OPM_MinLInt, ((LONGINT)(4))); + OPM_LogWLn(); +} + +static INTEGER OPM_Min (INTEGER a, INTEGER b) +{ + INTEGER _o_result; + if (a < b) { + _o_result = a; + return _o_result; + } else { + _o_result = b; + return _o_result; + } + __RETCHK; +} + +static void OPM_GetProperties (void) +{ + LONGINT base; + OPM_ProcSize = OPM_PointerSize; + OPM_LIntSize = __ASHL(OPM_IntSize, 1); + OPM_SetSize = OPM_LIntSize; + OPM_CharAlign = OPM_Min(OPM_Alignment, OPM_CharSize); + OPM_BoolAlign = OPM_Min(OPM_Alignment, OPM_BoolSize); + OPM_SIntAlign = OPM_Min(OPM_Alignment, OPM_SIntSize); + OPM_RecAlign = OPM_Min(OPM_Alignment, OPM_RecSize); + OPM_RealAlign = OPM_Min(OPM_Alignment, OPM_RealSize); + OPM_LRealAlign = OPM_Min(OPM_Alignment, OPM_LRealSize); + OPM_PointerAlign = OPM_Min(OPM_Alignment, OPM_PointerSize); + OPM_ProcAlign = OPM_Min(OPM_Alignment, OPM_ProcSize); + OPM_IntAlign = OPM_Min(OPM_Alignment, OPM_IntSize); + OPM_LIntAlign = OPM_Min(OPM_Alignment, OPM_LIntSize); + OPM_SetAlign = OPM_Min(OPM_Alignment, OPM_SetSize); + base = -2; + OPM_MinSInt = __ASH(base, __ASHL(OPM_SIntSize, 3) - 2); + OPM_MaxSInt = OPM_minus(OPM_MinSInt + 1); + OPM_MinInt = __ASH(base, __ASHL(OPM_IntSize, 3) - 2); + OPM_MaxInt = OPM_minus(OPM_MinInt + 1); + OPM_MinLInt = __ASH(base, __ASHL(OPM_LIntSize, 3) - 2); + OPM_MaxLInt = OPM_minus(OPM_MinLInt + 1); + if (OPM_RealSize == 4) { + OPM_MaxReal = 3.40282346000000e+038; + } else if (OPM_RealSize == 8) { + OPM_MaxReal = 1.79769296342094e+308; + } + if (OPM_LRealSize == 4) { + OPM_MaxLReal = 3.40282346000000e+038; + } else if (OPM_LRealSize == 8) { + OPM_MaxLReal = 1.79769296342094e+308; + } + OPM_MinReal = -OPM_MaxReal; + OPM_MinLReal = -OPM_MaxLReal; + OPM_MaxSet = __ASHL(OPM_SetSize, 3) - 1; + OPM_MaxIndex = OPM_MaxLInt; + if (OPM_Verbose) { + OPM_VerboseListSizes(); + } +} + +void OPM_SymRCh (CHAR *ch) +{ + Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&*ch); +} + +LONGINT OPM_SymRInt (void) +{ + LONGINT _o_result; + LONGINT k; + Files_ReadNum(&OPM_oldSF, Files_Rider__typ, &k); + _o_result = k; + return _o_result; +} + +void OPM_SymRSet (SET *s) +{ + Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (LONGINT*)&*s); +} + +void OPM_SymRReal (REAL *r) +{ + Files_ReadReal(&OPM_oldSF, Files_Rider__typ, &*r); +} + +void OPM_SymRLReal (LONGREAL *lr) +{ + Files_ReadLReal(&OPM_oldSF, Files_Rider__typ, &*lr); +} + +void OPM_CloseOldSym (void) +{ +} + +void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done) +{ + CHAR ch; + OPM_FileName fileName; + OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, ((LONGINT)(32)), (CHAR*)".sym", (LONGINT)5); + OPM_oldSFile = Files_Old(fileName, ((LONGINT)(32))); + *done = OPM_oldSFile != NIL; + if (*done) { + Files_Set(&OPM_oldSF, Files_Rider__typ, OPM_oldSFile, ((LONGINT)(0))); + Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&ch); + if (ch != 0xf7) { + OPM_err(-306); + OPM_CloseOldSym(); + *done = 0; + } + } +} + +BOOLEAN OPM_eofSF (void) +{ + BOOLEAN _o_result; + _o_result = OPM_oldSF.eof; + return _o_result; +} + +void OPM_SymWCh (CHAR ch) +{ + Files_Write(&OPM_newSF, Files_Rider__typ, ch); +} + +void OPM_SymWInt (LONGINT i) +{ + Files_WriteNum(&OPM_newSF, Files_Rider__typ, i); +} + +void OPM_SymWSet (SET s) +{ + Files_WriteNum(&OPM_newSF, Files_Rider__typ, (LONGINT)s); +} + +void OPM_SymWReal (REAL r) +{ + Files_WriteReal(&OPM_newSF, Files_Rider__typ, r); +} + +void OPM_SymWLReal (LONGREAL lr) +{ + Files_WriteLReal(&OPM_newSF, Files_Rider__typ, lr); +} + +void OPM_RegisterNewSym (void) +{ + if (__STRCMP(OPM_modName, "SYSTEM") != 0 || __IN(10, OPM_opt)) { + Files_Register(OPM_newSFile); + } +} + +void OPM_DeleteNewSym (void) +{ +} + +void OPM_NewSym (CHAR *modName, LONGINT modName__len) +{ + OPM_FileName fileName; + OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, ((LONGINT)(32)), (CHAR*)".sym", (LONGINT)5); + OPM_newSFile = Files_New(fileName, ((LONGINT)(32))); + if (OPM_newSFile != NIL) { + Files_Set(&OPM_newSF, Files_Rider__typ, OPM_newSFile, ((LONGINT)(0))); + Files_Write(&OPM_newSF, Files_Rider__typ, 0xf7); + } else { + OPM_err(153); + } +} + +void OPM_Write (CHAR ch) +{ + Files_Write(&OPM_R[__X(OPM_currFile, ((LONGINT)(3)))], Files_Rider__typ, ch); +} + +void OPM_WriteString (CHAR *s, LONGINT s__len) +{ + INTEGER i; + i = 0; + while (s[__X(i, s__len)] != 0x00) { + i += 1; + } + Files_WriteBytes(&OPM_R[__X(OPM_currFile, ((LONGINT)(3)))], Files_Rider__typ, (void*)s, s__len * ((LONGINT)(1)), i); +} + +void OPM_WriteStringVar (CHAR *s, LONGINT s__len) +{ + INTEGER i; + i = 0; + while (s[__X(i, s__len)] != 0x00) { + i += 1; + } + Files_WriteBytes(&OPM_R[__X(OPM_currFile, ((LONGINT)(3)))], Files_Rider__typ, (void*)s, s__len * ((LONGINT)(1)), i); +} + +void OPM_WriteHex (LONGINT i) +{ + CHAR s[3]; + INTEGER digit; + digit = __ASHR((int)i, 4); + if (digit < 10) { + s[0] = (CHAR)(48 + digit); + } else { + s[0] = (CHAR)(87 + digit); + } + digit = __MASK((int)i, -16); + if (digit < 10) { + s[1] = (CHAR)(48 + digit); + } else { + s[1] = (CHAR)(87 + digit); + } + s[2] = 0x00; + OPM_WriteString(s, ((LONGINT)(3))); +} + +void OPM_WriteInt (LONGINT i) +{ + CHAR s[20]; + LONGINT i1, k; + if (i == OPM_MinInt || i == OPM_MinLInt) { + OPM_Write('('); + OPM_WriteInt(i + 1); + OPM_WriteString((CHAR*)"-1)", (LONGINT)4); + } else { + i1 = __ABS(i); + s[0] = (CHAR)(__MOD(i1, 10) + 48); + i1 = __DIV(i1, 10); + k = 1; + while (i1 > 0) { + s[__X(k, ((LONGINT)(20)))] = (CHAR)(__MOD(i1, 10) + 48); + i1 = __DIV(i1, 10); + k += 1; + } + if (i < 0) { + s[__X(k, ((LONGINT)(20)))] = '-'; + k += 1; + } + while (k > 0) { + k -= 1; + OPM_Write(s[__X(k, ((LONGINT)(20)))]); + } + } +} + +void OPM_WriteReal (LONGREAL r, CHAR suffx) +{ + Texts_Writer W; + Texts_Text T = NIL; + Texts_Reader R; + CHAR s[32]; + CHAR ch; + INTEGER i; + if ((((r < OPM_MaxLInt && r > OPM_MinLInt)) && r == (__ENTIER(r)))) { + if (suffx == 'f') { + OPM_WriteString((CHAR*)"(REAL)", (LONGINT)7); + } else { + OPM_WriteString((CHAR*)"(LONGREAL)", (LONGINT)11); + } + OPM_WriteInt(__ENTIER(r)); + } else { + Texts_OpenWriter(&W, Texts_Writer__typ); + if (suffx == 'f') { + Texts_WriteLongReal(&W, Texts_Writer__typ, r, 16); + } else { + Texts_WriteLongReal(&W, Texts_Writer__typ, r, 23); + } + __NEW(T, Texts_TextDesc); + Texts_Open(T, (CHAR*)"", (LONGINT)1); + Texts_Append(T, W.buf); + Texts_OpenReader(&R, Texts_Reader__typ, T, ((LONGINT)(0))); + i = 0; + Texts_Read(&R, Texts_Reader__typ, &ch); + while (ch != 0x00) { + s[__X(i, ((LONGINT)(32)))] = ch; + i += 1; + Texts_Read(&R, Texts_Reader__typ, &ch); + } + s[__X(i, ((LONGINT)(32)))] = 0x00; + i = 0; + ch = s[0]; + while ((ch != 'D' && ch != 0x00)) { + i += 1; + ch = s[__X(i, ((LONGINT)(32)))]; + } + if (ch == 'D') { + s[__X(i, ((LONGINT)(32)))] = 'e'; + } + OPM_WriteString(s, ((LONGINT)(32))); + } +} + +void OPM_WriteLn (void) +{ + Files_Write(&OPM_R[__X(OPM_currFile, ((LONGINT)(3)))], Files_Rider__typ, 0x0a); +} + +static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F) +{ + Files_Rider R1; + CHAR buffer[4096]; + if (F != NIL) { + Files_Set(&R1, Files_Rider__typ, F, ((LONGINT)(0))); + Files_ReadBytes(&R1, Files_Rider__typ, (void*)buffer, ((LONGINT)(4096)), ((LONGINT)(4096))); + while (4096 - R1.res > 0) { + Files_WriteBytes(&*R, R__typ, (void*)buffer, ((LONGINT)(4096)), 4096 - R1.res); + Files_ReadBytes(&R1, Files_Rider__typ, (void*)buffer, ((LONGINT)(4096)), ((LONGINT)(4096))); + } + } +} + +void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len) +{ + CHAR FName[32]; + __COPY(moduleName, OPM_modName, ((LONGINT)(32))); + OPM_HFile = Files_New((CHAR*)"", (LONGINT)1); + if (OPM_HFile != NIL) { + Files_Set(&OPM_R[0], Files_Rider__typ, OPM_HFile, ((LONGINT)(0))); + } else { + OPM_err(153); + } + OPM_MakeFileName((void*)moduleName, moduleName__len, (void*)FName, ((LONGINT)(32)), (CHAR*)".c", (LONGINT)3); + OPM_BFile = Files_New(FName, ((LONGINT)(32))); + if (OPM_BFile != NIL) { + Files_Set(&OPM_R[1], Files_Rider__typ, OPM_BFile, ((LONGINT)(0))); + } else { + OPM_err(153); + } + OPM_MakeFileName((void*)moduleName, moduleName__len, (void*)FName, ((LONGINT)(32)), (CHAR*)".h", (LONGINT)3); + OPM_HIFile = Files_New(FName, ((LONGINT)(32))); + if (OPM_HIFile != NIL) { + Files_Set(&OPM_R[2], Files_Rider__typ, OPM_HIFile, ((LONGINT)(0))); + } else { + OPM_err(153); + } +} + +void OPM_CloseFiles (void) +{ + CHAR FName[32]; + INTEGER res; + if (OPM_noerr) { + OPM_LogWStr((CHAR*)" ", (LONGINT)3); + OPM_LogWNum(Files_Pos(&OPM_R[1], Files_Rider__typ), ((LONGINT)(0))); + OPM_LogWStr((CHAR*)" chars.", (LONGINT)8); + } + if (OPM_noerr) { + if (__STRCMP(OPM_modName, "SYSTEM") == 0) { + if (!__IN(10, OPM_opt)) { + Files_Register(OPM_BFile); + } + } else if (!__IN(10, OPM_opt)) { + OPM_Append(&OPM_R[2], Files_Rider__typ, OPM_HFile); + Files_Register(OPM_HIFile); + Files_Register(OPM_BFile); + } else { + OPM_MakeFileName((void*)OPM_modName, ((LONGINT)(32)), (void*)FName, ((LONGINT)(32)), (CHAR*)".h", (LONGINT)3); + Files_Delete(FName, ((LONGINT)(32)), &res); + OPM_MakeFileName((void*)OPM_modName, ((LONGINT)(32)), (void*)FName, ((LONGINT)(32)), (CHAR*)".sym", (LONGINT)5); + Files_Delete(FName, ((LONGINT)(32)), &res); + Files_Register(OPM_BFile); + } + } + OPM_HFile = NIL; + OPM_BFile = NIL; + OPM_HIFile = NIL; + OPM_newSFile = NIL; + OPM_oldSFile = NIL; + Files_Set(&OPM_R[0], Files_Rider__typ, NIL, ((LONGINT)(0))); + Files_Set(&OPM_R[1], Files_Rider__typ, NIL, ((LONGINT)(0))); + Files_Set(&OPM_R[2], Files_Rider__typ, NIL, ((LONGINT)(0))); + Files_Set(&OPM_newSF, Files_Rider__typ, NIL, ((LONGINT)(0))); + Files_Set(&OPM_oldSF, Files_Rider__typ, NIL, ((LONGINT)(0))); +} + +static void EnumPtrs(void (*P)(void*)) +{ + __ENUMR(&OPM_inR, Texts_Reader__typ, 48, 1, P); + P(OPM_Log); + __ENUMR(&OPM_W, Texts_Writer__typ, 36, 1, P); + __ENUMR(&OPM_oldSF, Files_Rider__typ, 20, 1, P); + __ENUMR(&OPM_newSF, Files_Rider__typ, 20, 1, P); + __ENUMR(OPM_R, Files_Rider__typ, 20, 3, P); + P(OPM_oldSFile); + P(OPM_newSFile); + P(OPM_HFile); + P(OPM_BFile); + P(OPM_HIFile); +} + + +export void *OPM__init(void) +{ + __DEFMOD; + __MODULE_IMPORT(Configuration); + __MODULE_IMPORT(Console); + __MODULE_IMPORT(Files); + __MODULE_IMPORT(Platform); + __MODULE_IMPORT(Strings); + __MODULE_IMPORT(Texts); + __MODULE_IMPORT(errors); + __MODULE_IMPORT(vt100); + __REGMOD("OPM", EnumPtrs); + __REGCMD("CloseFiles", OPM_CloseFiles); + __REGCMD("CloseOldSym", OPM_CloseOldSym); + __REGCMD("DeleteNewSym", OPM_DeleteNewSym); + __REGCMD("InitOptions", OPM_InitOptions); + __REGCMD("LogWLn", OPM_LogWLn); + __REGCMD("RegisterNewSym", OPM_RegisterNewSym); + __REGCMD("WriteLn", OPM_WriteLn); +/* BEGIN */ + Texts_OpenWriter(&OPM_W, Texts_Writer__typ); + OPM_MODULES[0] = 0x00; + Platform_GetEnv((CHAR*)"MODULES", (LONGINT)8, (void*)OPM_MODULES, ((LONGINT)(1024))); + __MOVE(".", OPM_OBERON, 2); + Platform_GetEnv((CHAR*)"OBERON", (LONGINT)7, (void*)OPM_OBERON, ((LONGINT)(1024))); + Strings_Append((CHAR*)";.;", (LONGINT)4, (void*)OPM_OBERON, ((LONGINT)(1024))); + Strings_Append(OPM_MODULES, ((LONGINT)(1024)), (void*)OPM_OBERON, ((LONGINT)(1024))); + Strings_Append((CHAR*)";", (LONGINT)2, (void*)OPM_OBERON, ((LONGINT)(1024))); + Strings_Append((CHAR*)"/opt/voc", (LONGINT)9, (void*)OPM_OBERON, ((LONGINT)(1024))); + Strings_Append((CHAR*)"/sym;", (LONGINT)6, (void*)OPM_OBERON, ((LONGINT)(1024))); + Files_SetSearchPath(OPM_OBERON, ((LONGINT)(1024))); + OPM_CharSize = 1; + OPM_BoolSize = 1; + OPM_SIntSize = 1; + OPM_RecSize = 1; + OPM_ByteSize = 1; + OPM_RealSize = 4; + OPM_LRealSize = 8; + OPM_PointerSize = 8; + OPM_Alignment = 8; + OPM_IntSize = 4; + __ENDMOD; +} diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h new file mode 100644 index 00000000..68bf3af0 --- /dev/null +++ b/bootstrap/unix-48/OPM.h @@ -0,0 +1,63 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ + +#ifndef OPM__h +#define OPM__h + +#include "SYSTEM.h" + + +import INTEGER OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_CharAlign, OPM_BoolAlign, OPM_SIntAlign, OPM_IntAlign, OPM_LIntAlign, OPM_SetAlign, OPM_RealAlign, OPM_LRealAlign, OPM_PointerAlign, OPM_ProcAlign, OPM_RecAlign, OPM_MaxSet; +import LONGINT OPM_MinSInt, OPM_MinInt, OPM_MinLInt, OPM_MaxSInt, OPM_MaxInt, OPM_MaxLInt, OPM_MaxIndex; +import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; +import BOOLEAN OPM_noerr; +import LONGINT OPM_curpos, OPM_errpos, OPM_breakpc; +import INTEGER OPM_currFile, OPM_level, OPM_pc, OPM_entno; +import CHAR OPM_modName[32]; +import CHAR OPM_objname[64]; +import SET OPM_opt, OPM_glbopt; +import BOOLEAN OPM_dontAsm, OPM_dontLink, OPM_mainProg, OPM_mainLinkStat, OPM_notColorOutput, OPM_forceNewSym, OPM_Verbose; + + +import void OPM_CloseFiles (void); +import void OPM_CloseOldSym (void); +import void OPM_DeleteNewSym (void); +import void OPM_FPrint (LONGINT *fp, LONGINT val); +import void OPM_FPrintLReal (LONGINT *fp, LONGREAL lr); +import void OPM_FPrintReal (LONGINT *fp, REAL real); +import void OPM_FPrintSet (LONGINT *fp, SET set); +import void OPM_Get (CHAR *ch); +import void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); +import void OPM_InitOptions (void); +import void OPM_LogW (CHAR ch); +import void OPM_LogWLn (void); +import void OPM_LogWNum (LONGINT i, LONGINT len); +import void OPM_LogWStr (CHAR *s, LONGINT s__len); +import void OPM_Mark (INTEGER n, LONGINT pos); +import void OPM_NewSym (CHAR *modName, LONGINT modName__len); +import void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); +import void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); +import BOOLEAN OPM_OpenPar (void); +import void OPM_RegisterNewSym (void); +import void OPM_SymRCh (CHAR *ch); +import LONGINT OPM_SymRInt (void); +import void OPM_SymRLReal (LONGREAL *lr); +import void OPM_SymRReal (REAL *r); +import void OPM_SymRSet (SET *s); +import void OPM_SymWCh (CHAR ch); +import void OPM_SymWInt (LONGINT i); +import void OPM_SymWLReal (LONGREAL lr); +import void OPM_SymWReal (REAL r); +import void OPM_SymWSet (SET s); +import void OPM_Write (CHAR ch); +import void OPM_WriteHex (LONGINT i); +import void OPM_WriteInt (LONGINT i); +import void OPM_WriteLn (void); +import void OPM_WriteReal (LONGREAL r, CHAR suffx); +import void OPM_WriteString (CHAR *s, LONGINT s__len); +import void OPM_WriteStringVar (CHAR *s, LONGINT s__len); +import BOOLEAN OPM_eofSF (void); +import void OPM_err (INTEGER n); +import void *OPM__init(void); + + +#endif diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c new file mode 100644 index 00000000..f0530bb4 --- /dev/null +++ b/bootstrap/unix-48/OPP.c @@ -0,0 +1,1873 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +#include "SYSTEM.h" +#include "OPB.h" +#include "OPM.h" +#include "OPS.h" +#include "OPT.h" + +struct OPP__1 { + LONGINT low, high; +}; + +typedef + struct OPP__1 OPP_CaseTable[128]; + + +static SHORTINT OPP_sym, OPP_level; +static INTEGER OPP_LoopLevel; +static OPT_Node OPP_TDinit, OPP_lastTDinit; +static INTEGER OPP_nofFwdPtr; +static OPT_Struct OPP_FwdPtr[64]; + +export LONGINT *OPP__1__typ; + +static void OPP_ActualParameters (OPT_Node *aparlist, OPT_Object fpar); +static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned); +static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq); +static void OPP_CaseLabelList (OPT_Node *lab, INTEGER LabelForm, INTEGER *n, OPP_CaseTable tab); +static void OPP_CheckMark (SHORTINT *vis); +static void OPP_CheckSym (INTEGER s); +static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_); +static void OPP_ConstExpression (OPT_Node *x); +static void OPP_Element (OPT_Node *x); +static void OPP_Expression (OPT_Node *x); +static BOOLEAN OPP_Extends (OPT_Struct x, OPT_Struct b); +static void OPP_Factor (OPT_Node *x); +static void OPP_FormalParameters (OPT_Object *firstPar, OPT_Struct *resTyp); +export void OPP_Module (OPT_Node *prog, SET opt); +static void OPP_PointerType (OPT_Struct *typ); +static void OPP_ProcedureDeclaration (OPT_Node *x); +static void OPP_Receiver (SHORTINT *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec); +static void OPP_RecordType (OPT_Struct *typ, OPT_Struct *banned); +static void OPP_Sets (OPT_Node *x); +static void OPP_SimpleExpression (OPT_Node *x); +static void OPP_StandProcCall (OPT_Node *x); +static void OPP_StatSeq (OPT_Node *stat); +static void OPP_Term (OPT_Node *x); +static void OPP_Type (OPT_Struct *typ, OPT_Struct *banned); +static void OPP_TypeDecl (OPT_Struct *typ, OPT_Struct *banned); +static void OPP_err (INTEGER n); +static void OPP_qualident (OPT_Object *id); +static void OPP_selector (OPT_Node *x); + + +static void OPP_err (INTEGER n) +{ + OPM_err(n); +} + +static void OPP_CheckSym (INTEGER s) +{ + if ((int)OPP_sym == s) { + OPS_Get(&OPP_sym); + } else { + OPM_err(s); + } +} + +static void OPP_qualident (OPT_Object *id) +{ + OPT_Object obj = NIL; + SHORTINT lev; + OPT_Find(&obj); + OPS_Get(&OPP_sym); + if ((((OPP_sym == 18 && obj != NIL)) && obj->mode == 11)) { + OPS_Get(&OPP_sym); + if (OPP_sym == 38) { + OPT_FindImport(obj, &obj); + OPS_Get(&OPP_sym); + } else { + OPP_err(38); + obj = NIL; + } + } + if (obj == NIL) { + OPP_err(0); + obj = OPT_NewObj(); + obj->mode = 1; + obj->typ = OPT_undftyp; + obj->adr = 0; + } else { + lev = obj->mnolev; + if ((__IN(obj->mode, 0x06) && lev != OPP_level)) { + obj->leaf = 0; + if (lev > 0) { + OPB_StaticLink(OPP_level - lev); + } + } + } + *id = obj; +} + +static void OPP_ConstExpression (OPT_Node *x) +{ + OPP_Expression(&*x); + if ((*x)->class != 7) { + OPP_err(50); + *x = OPB_NewIntConst(((LONGINT)(1))); + } +} + +static void OPP_CheckMark (SHORTINT *vis) +{ + OPS_Get(&OPP_sym); + if (OPP_sym == 1 || OPP_sym == 7) { + if (OPP_level > 0) { + OPP_err(47); + } + if (OPP_sym == 1) { + *vis = 1; + } else { + *vis = 2; + } + OPS_Get(&OPP_sym); + } else { + *vis = 0; + } +} + +static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_) +{ + OPT_Node x = NIL; + LONGINT sf; + if (OPP_sym == 31) { + OPS_Get(&OPP_sym); + if (!OPT_SYSimported) { + OPP_err(135); + } + OPP_ConstExpression(&x); + if (__IN(x->typ->form, 0x70)) { + sf = x->conval->intval; + if (sf < 0 || sf > 1) { + OPP_err(220); + sf = 0; + } + } else { + OPP_err(51); + sf = 0; + } + *sysflag = (int)sf; + OPP_CheckSym(23); + } else { + *sysflag = default_; + } +} + +static void OPP_RecordType (OPT_Struct *typ, OPT_Struct *banned) +{ + OPT_Object fld = NIL, first = NIL, last = NIL, base = NIL; + OPT_Struct ftyp = NIL; + INTEGER sysflag; + *typ = OPT_NewStr(15, 4); + (*typ)->BaseTyp = NIL; + OPP_CheckSysFlag(&sysflag, -1); + if (OPP_sym == 30) { + OPS_Get(&OPP_sym); + if (OPP_sym == 38) { + OPP_qualident(&base); + if ((base->mode == 5 && base->typ->comp == 4)) { + if (base->typ == *banned) { + OPP_err(58); + } else { + base->typ->pvused = 1; + (*typ)->BaseTyp = base->typ; + (*typ)->extlev = base->typ->extlev + 1; + (*typ)->sysflag = base->typ->sysflag; + } + } else { + OPP_err(52); + } + } else { + OPP_err(38); + } + OPP_CheckSym(22); + } + if (sysflag >= 0) { + (*typ)->sysflag = sysflag; + } + OPT_OpenScope(0, NIL); + first = NIL; + last = NIL; + for (;;) { + if (OPP_sym == 38) { + for (;;) { + if (OPP_sym == 38) { + if ((*typ)->BaseTyp != NIL) { + OPT_FindField(OPS_name, (*typ)->BaseTyp, &fld); + if (fld != NIL) { + OPP_err(1); + } + } + OPT_Insert(OPS_name, &fld); + OPP_CheckMark(&fld->vis); + fld->mode = 4; + fld->link = NIL; + fld->typ = OPT_undftyp; + if (first == NIL) { + first = fld; + } + if (last == NIL) { + (*typ)->link = fld; + } else { + last->link = fld; + } + last = fld; + } else { + OPP_err(38); + } + if (OPP_sym == 19) { + OPS_Get(&OPP_sym); + } else if (OPP_sym == 38) { + OPP_err(19); + } else { + break; + } + } + OPP_CheckSym(20); + OPP_Type(&ftyp, &*banned); + ftyp->pvused = 1; + if (ftyp->comp == 3) { + ftyp = OPT_undftyp; + OPP_err(88); + } + while (first != NIL) { + first->typ = ftyp; + first = first->link; + } + } + if (OPP_sym == 39) { + OPS_Get(&OPP_sym); + } else if (OPP_sym == 38) { + OPP_err(39); + } else { + break; + } + } + OPT_CloseScope(); +} + +static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) +{ + OPT_Node x = NIL; + LONGINT n; + INTEGER sysflag; + OPP_CheckSysFlag(&sysflag, 0); + if (OPP_sym == 25) { + *typ = OPT_NewStr(15, 3); + (*typ)->mno = 0; + (*typ)->sysflag = sysflag; + OPS_Get(&OPP_sym); + OPP_Type(&(*typ)->BaseTyp, &*banned); + (*typ)->BaseTyp->pvused = 1; + if ((*typ)->BaseTyp->comp == 3) { + (*typ)->n = (*typ)->BaseTyp->n + 1; + } else { + (*typ)->n = 0; + } + } else { + *typ = OPT_NewStr(15, 2); + (*typ)->sysflag = sysflag; + OPP_ConstExpression(&x); + if (__IN(x->typ->form, 0x70)) { + n = x->conval->intval; + if (n <= 0 || n > OPM_MaxIndex) { + OPP_err(63); + n = 1; + } + } else { + OPP_err(51); + n = 1; + } + (*typ)->n = n; + if (OPP_sym == 25) { + OPS_Get(&OPP_sym); + OPP_Type(&(*typ)->BaseTyp, &*banned); + (*typ)->BaseTyp->pvused = 1; + } else if (OPP_sym == 19) { + OPS_Get(&OPP_sym); + if (OPP_sym != 25) { + OPP_ArrayType(&(*typ)->BaseTyp, &*banned); + } + } else { + OPP_err(35); + } + if ((*typ)->BaseTyp->comp == 3) { + (*typ)->BaseTyp = OPT_undftyp; + OPP_err(88); + } + } +} + +static void OPP_PointerType (OPT_Struct *typ) +{ + OPT_Object id = NIL; + *typ = OPT_NewStr(13, 1); + OPP_CheckSysFlag(&(*typ)->sysflag, 0); + OPP_CheckSym(28); + if (OPP_sym == 38) { + OPT_Find(&id); + if (id == NIL) { + if (OPP_nofFwdPtr < 64) { + OPP_FwdPtr[__X(OPP_nofFwdPtr, ((LONGINT)(64)))] = *typ; + OPP_nofFwdPtr += 1; + } else { + OPP_err(224); + } + (*typ)->link = OPT_NewObj(); + __COPY(OPS_name, (*typ)->link->name, ((LONGINT)(256))); + (*typ)->BaseTyp = OPT_undftyp; + OPS_Get(&OPP_sym); + } else { + OPP_qualident(&id); + if (id->mode == 5) { + if (__IN(id->typ->comp, 0x1c)) { + (*typ)->BaseTyp = id->typ; + } else { + (*typ)->BaseTyp = OPT_undftyp; + OPP_err(57); + } + } else { + (*typ)->BaseTyp = OPT_undftyp; + OPP_err(52); + } + } + } else { + OPP_Type(&(*typ)->BaseTyp, &OPT_notyp); + if (!__IN((*typ)->BaseTyp->comp, 0x1c)) { + (*typ)->BaseTyp = OPT_undftyp; + OPP_err(57); + } + } +} + +static void OPP_FormalParameters (OPT_Object *firstPar, OPT_Struct *resTyp) +{ + SHORTINT mode; + OPT_Object par = NIL, first = NIL, last = NIL, res = NIL; + OPT_Struct typ = NIL; + first = NIL; + last = *firstPar; + if (OPP_sym == 38 || OPP_sym == 60) { + for (;;) { + if (OPP_sym == 60) { + OPS_Get(&OPP_sym); + mode = 2; + } else { + mode = 1; + } + for (;;) { + if (OPP_sym == 38) { + OPT_Insert(OPS_name, &par); + OPS_Get(&OPP_sym); + par->mode = mode; + par->link = NIL; + if (first == NIL) { + first = par; + } + if (*firstPar == NIL) { + *firstPar = par; + } else { + last->link = par; + } + last = par; + } else { + OPP_err(38); + } + if (OPP_sym == 19) { + OPS_Get(&OPP_sym); + } else if (OPP_sym == 38) { + OPP_err(19); + } else if (OPP_sym == 60) { + OPP_err(19); + OPS_Get(&OPP_sym); + } else { + break; + } + } + OPP_CheckSym(20); + OPP_Type(&typ, &OPT_notyp); + if (mode == 1) { + typ->pvused = 1; + } + while (first != NIL) { + first->typ = typ; + first = first->link; + } + if (OPP_sym == 39) { + OPS_Get(&OPP_sym); + } else if (OPP_sym == 38) { + OPP_err(39); + } else { + break; + } + } + } + OPP_CheckSym(22); + if (OPP_sym == 20) { + OPS_Get(&OPP_sym); + *resTyp = OPT_undftyp; + if (OPP_sym == 38) { + OPP_qualident(&res); + if (res->mode == 5) { + if (res->typ->form < 15) { + *resTyp = res->typ; + } else { + OPP_err(54); + } + } else { + OPP_err(52); + } + } else { + OPP_err(38); + } + } else { + *resTyp = OPT_notyp; + } +} + +static void OPP_TypeDecl (OPT_Struct *typ, OPT_Struct *banned) +{ + OPT_Object id = NIL; + *typ = OPT_undftyp; + if (OPP_sym < 30) { + OPP_err(12); + do { + OPS_Get(&OPP_sym); + } while (!(OPP_sym >= 30)); + } + if (OPP_sym == 38) { + OPP_qualident(&id); + if (id->mode == 5) { + if (id->typ != *banned) { + *typ = id->typ; + } else { + OPP_err(58); + } + } else { + OPP_err(52); + } + } else if (OPP_sym == 54) { + OPS_Get(&OPP_sym); + OPP_ArrayType(&*typ, &*banned); + } else if (OPP_sym == 55) { + OPS_Get(&OPP_sym); + OPP_RecordType(&*typ, &*banned); + OPB_Inittd(&OPP_TDinit, &OPP_lastTDinit, *typ); + OPP_CheckSym(41); + } else if (OPP_sym == 56) { + OPS_Get(&OPP_sym); + OPP_PointerType(&*typ); + } else if (OPP_sym == 61) { + OPS_Get(&OPP_sym); + *typ = OPT_NewStr(14, 1); + OPP_CheckSysFlag(&(*typ)->sysflag, 0); + if (OPP_sym == 30) { + OPS_Get(&OPP_sym); + OPT_OpenScope(OPP_level, NIL); + OPP_FormalParameters(&(*typ)->link, &(*typ)->BaseTyp); + OPT_CloseScope(); + } else { + (*typ)->BaseTyp = OPT_notyp; + (*typ)->link = NIL; + } + } else { + OPP_err(12); + } + for (;;) { + if (((OPP_sym >= 39 && OPP_sym <= 42) || OPP_sym == 22) || OPP_sym == 64) { + break; + } + OPP_err(15); + if (OPP_sym == 38) { + break; + } + OPS_Get(&OPP_sym); + } +} + +static void OPP_Type (OPT_Struct *typ, OPT_Struct *banned) +{ + OPP_TypeDecl(&*typ, &*banned); + if (((((*typ)->form == 13 && (*typ)->BaseTyp == OPT_undftyp)) && (*typ)->strobj == NIL)) { + OPP_err(0); + } +} + +static void OPP_selector (OPT_Node *x) +{ + OPT_Object obj = NIL, proc = NIL; + OPT_Node y = NIL; + OPT_Struct typ = NIL; + OPS_Name name; + for (;;) { + if (OPP_sym == 31) { + OPS_Get(&OPP_sym); + for (;;) { + if (((*x)->typ != NIL && (*x)->typ->form == 13)) { + OPB_DeRef(&*x); + } + OPP_Expression(&y); + OPB_Index(&*x, y); + if (OPP_sym == 19) { + OPS_Get(&OPP_sym); + } else { + break; + } + } + OPP_CheckSym(23); + } else if (OPP_sym == 18) { + OPS_Get(&OPP_sym); + if (OPP_sym == 38) { + __COPY(OPS_name, name, ((LONGINT)(256))); + OPS_Get(&OPP_sym); + if ((*x)->typ != NIL) { + if ((*x)->typ->form == 13) { + OPB_DeRef(&*x); + } + if ((*x)->typ->comp == 4) { + OPT_FindField(name, (*x)->typ, &obj); + OPB_Field(&*x, obj); + if ((obj != NIL && obj->mode == 13)) { + if (OPP_sym == 17) { + OPS_Get(&OPP_sym); + y = (*x)->left; + if (y->class == 3) { + y = y->left; + } + if (y->obj != NIL) { + proc = OPT_topScope; + while ((proc->link != NIL && proc->link->mode != 13)) { + proc = proc->left; + } + if (proc->link == NIL || proc->link->link != y->obj) { + OPP_err(75); + } + typ = y->obj->typ; + if (typ->form == 13) { + typ = typ->BaseTyp; + } + OPT_FindField((*x)->obj->name, typ->BaseTyp, &proc); + if (proc != NIL) { + (*x)->subcl = 1; + } else { + OPP_err(74); + } + } else { + OPP_err(75); + } + } + if ((obj->typ != OPT_notyp && OPP_sym != 30)) { + OPP_err(30); + } + } + } else { + OPP_err(53); + } + } else { + OPP_err(52); + } + } else { + OPP_err(38); + } + } else if (OPP_sym == 17) { + OPS_Get(&OPP_sym); + OPB_DeRef(&*x); + } else if ((((((OPP_sym == 30 && (*x)->class < 7)) && (*x)->typ->form != 14)) && ((*x)->obj == NIL || (*x)->obj->mode != 13))) { + OPS_Get(&OPP_sym); + if (OPP_sym == 38) { + OPP_qualident(&obj); + if (obj->mode == 5) { + OPB_TypTest(&*x, obj, 1); + } else { + OPP_err(52); + } + } else { + OPP_err(38); + } + OPP_CheckSym(22); + } else { + break; + } + } +} + +static void OPP_ActualParameters (OPT_Node *aparlist, OPT_Object fpar) +{ + OPT_Node apar = NIL, last = NIL; + *aparlist = NIL; + last = NIL; + if (OPP_sym != 22) { + for (;;) { + OPP_Expression(&apar); + if (fpar != NIL) { + OPB_Param(apar, fpar); + OPB_Link(&*aparlist, &last, apar); + fpar = fpar->link; + } else { + OPP_err(64); + } + if (OPP_sym == 19) { + OPS_Get(&OPP_sym); + } else if ((30 <= OPP_sym && OPP_sym <= 38)) { + OPP_err(19); + } else { + break; + } + } + } + if (fpar != NIL) { + OPP_err(65); + } +} + +static void OPP_StandProcCall (OPT_Node *x) +{ + OPT_Node y = NIL; + SHORTINT m; + INTEGER n; + m = (int)(*x)->obj->adr; + n = 0; + if (OPP_sym == 30) { + OPS_Get(&OPP_sym); + if (OPP_sym != 22) { + for (;;) { + if (n == 0) { + OPP_Expression(&*x); + OPB_StPar0(&*x, m); + n = 1; + } else if (n == 1) { + OPP_Expression(&y); + OPB_StPar1(&*x, y, m); + n = 2; + } else { + OPP_Expression(&y); + OPB_StParN(&*x, y, m, n); + n += 1; + } + if (OPP_sym == 19) { + OPS_Get(&OPP_sym); + } else if ((30 <= OPP_sym && OPP_sym <= 38)) { + OPP_err(19); + } else { + break; + } + } + OPP_CheckSym(22); + } else { + OPS_Get(&OPP_sym); + } + OPB_StFct(&*x, m, n); + } else { + OPP_err(30); + } + if ((OPP_level > 0 && (m == 1 || m == 30))) { + OPT_topScope->link->leaf = 0; + } +} + +static void OPP_Element (OPT_Node *x) +{ + OPT_Node y = NIL; + OPP_Expression(&*x); + if (OPP_sym == 21) { + OPS_Get(&OPP_sym); + OPP_Expression(&y); + OPB_SetRange(&*x, y); + } else { + OPB_SetElem(&*x); + } +} + +static void OPP_Sets (OPT_Node *x) +{ + OPT_Node y = NIL; + if (OPP_sym != 24) { + OPP_Element(&*x); + for (;;) { + if (OPP_sym == 19) { + OPS_Get(&OPP_sym); + } else if ((30 <= OPP_sym && OPP_sym <= 38)) { + OPP_err(19); + } else { + break; + } + OPP_Element(&y); + OPB_Op(6, &*x, y); + } + } else { + *x = OPB_EmptySet(); + } + OPP_CheckSym(24); +} + +static void OPP_Factor (OPT_Node *x) +{ + OPT_Object fpar = NIL, id = NIL; + OPT_Node apar = NIL; + if (OPP_sym < 30) { + OPP_err(13); + do { + OPS_Get(&OPP_sym); + } while (!(OPP_sym >= 30)); + } + if (OPP_sym == 38) { + OPP_qualident(&id); + *x = OPB_NewLeaf(id); + OPP_selector(&*x); + if (((*x)->class == 9 && (*x)->obj->mode == 8)) { + OPP_StandProcCall(&*x); + } else if (OPP_sym == 30) { + OPS_Get(&OPP_sym); + OPB_PrepCall(&*x, &fpar); + OPP_ActualParameters(&apar, fpar); + OPB_Call(&*x, apar, fpar); + OPP_CheckSym(22); + if (OPP_level > 0) { + OPT_topScope->link->leaf = 0; + } + } + } else if (OPP_sym == 35) { + switch (OPS_numtyp) { + case 1: + *x = OPB_NewIntConst(OPS_intval); + (*x)->typ = OPT_chartyp; + break; + case 2: + *x = OPB_NewIntConst(OPS_intval); + break; + case 3: + *x = OPB_NewRealConst(OPS_realval, OPT_realtyp); + break; + case 4: + *x = OPB_NewRealConst(OPS_lrlval, OPT_lrltyp); + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPP.Factor, OPS.numtyp = ", (LONGINT)44); + OPM_LogWNum(OPS_numtyp, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + OPS_Get(&OPP_sym); + } else if (OPP_sym == 37) { + *x = OPB_NewString(OPS_str, OPS_intval); + OPS_Get(&OPP_sym); + } else if (OPP_sym == 36) { + *x = OPB_Nil(); + OPS_Get(&OPP_sym); + } else if (OPP_sym == 30) { + OPS_Get(&OPP_sym); + OPP_Expression(&*x); + OPP_CheckSym(22); + } else if (OPP_sym == 31) { + OPS_Get(&OPP_sym); + OPP_err(30); + OPP_Expression(&*x); + OPP_CheckSym(22); + } else if (OPP_sym == 32) { + OPS_Get(&OPP_sym); + OPP_Sets(&*x); + } else if (OPP_sym == 33) { + OPS_Get(&OPP_sym); + OPP_Factor(&*x); + OPB_MOp(33, &*x); + } else { + OPP_err(13); + OPS_Get(&OPP_sym); + *x = NIL; + } + if (*x == NIL) { + *x = OPB_NewIntConst(((LONGINT)(1))); + (*x)->typ = OPT_undftyp; + } +} + +static void OPP_Term (OPT_Node *x) +{ + OPT_Node y = NIL; + SHORTINT mulop; + OPP_Factor(&*x); + while ((1 <= OPP_sym && OPP_sym <= 5)) { + mulop = OPP_sym; + OPS_Get(&OPP_sym); + OPP_Factor(&y); + OPB_Op(mulop, &*x, y); + } +} + +static void OPP_SimpleExpression (OPT_Node *x) +{ + OPT_Node y = NIL; + SHORTINT addop; + if (OPP_sym == 7) { + OPS_Get(&OPP_sym); + OPP_Term(&*x); + OPB_MOp(7, &*x); + } else if (OPP_sym == 6) { + OPS_Get(&OPP_sym); + OPP_Term(&*x); + OPB_MOp(6, &*x); + } else { + OPP_Term(&*x); + } + while ((6 <= OPP_sym && OPP_sym <= 8)) { + addop = OPP_sym; + OPS_Get(&OPP_sym); + OPP_Term(&y); + OPB_Op(addop, &*x, y); + } +} + +static void OPP_Expression (OPT_Node *x) +{ + OPT_Node y = NIL; + OPT_Object obj = NIL; + SHORTINT relation; + OPP_SimpleExpression(&*x); + if ((9 <= OPP_sym && OPP_sym <= 14)) { + relation = OPP_sym; + OPS_Get(&OPP_sym); + OPP_SimpleExpression(&y); + OPB_Op(relation, &*x, y); + } else if (OPP_sym == 15) { + OPS_Get(&OPP_sym); + OPP_SimpleExpression(&y); + OPB_In(&*x, y); + } else if (OPP_sym == 16) { + OPS_Get(&OPP_sym); + if (OPP_sym == 38) { + OPP_qualident(&obj); + if (obj->mode == 5) { + OPB_TypTest(&*x, obj, 0); + } else { + OPP_err(52); + } + } else { + OPP_err(38); + } + } +} + +static void OPP_Receiver (SHORTINT *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec) +{ + OPT_Object obj = NIL; + *typ = OPT_undftyp; + *rec = NIL; + if (OPP_sym == 60) { + OPS_Get(&OPP_sym); + *mode = 2; + } else { + *mode = 1; + } + __COPY(OPS_name, name, ((LONGINT)(256))); + OPP_CheckSym(38); + OPP_CheckSym(20); + if (OPP_sym == 38) { + OPT_Find(&obj); + OPS_Get(&OPP_sym); + if (obj == NIL) { + OPP_err(0); + } else if (obj->mode != 5) { + OPP_err(72); + } else { + *typ = obj->typ; + *rec = *typ; + if ((*rec)->form == 13) { + *rec = (*rec)->BaseTyp; + } + if (!((((*mode == 1 && (*typ)->form == 13)) && (*rec)->comp == 4) || (*mode == 2 && (*typ)->comp == 4))) { + OPP_err(70); + *rec = NIL; + } + if ((*rec != NIL && (*rec)->mno != OPP_level)) { + OPP_err(72); + *rec = NIL; + } + } + } else { + OPP_err(38); + } + OPP_CheckSym(22); + if (*rec == NIL) { + *rec = OPT_NewStr(15, 4); + (*rec)->BaseTyp = NIL; + } +} + +static BOOLEAN OPP_Extends (OPT_Struct x, OPT_Struct b) +{ + BOOLEAN _o_result; + if ((b->form == 13 && x->form == 13)) { + b = b->BaseTyp; + x = x->BaseTyp; + } + if ((b->comp == 4 && x->comp == 4)) { + do { + x = x->BaseTyp; + } while (!(x == NIL || x == b)); + } + _o_result = x == b; + return _o_result; +} + +static struct ProcedureDeclaration__16 { + OPT_Node *x; + OPT_Object *proc, *fwd; + OPS_Name *name; + SHORTINT *mode, *vis; + BOOLEAN *forward; + struct ProcedureDeclaration__16 *lnk; +} *ProcedureDeclaration__16_s; + +static void Body__17 (void); +static void GetCode__19 (void); +static void GetParams__21 (void); +static void TProcDecl__23 (void); + +static void GetCode__19 (void) +{ + OPT_ConstExt ext = NIL; + INTEGER n; + LONGINT c; + ext = OPT_NewExt(); + (*ProcedureDeclaration__16_s->proc)->conval->ext = ext; + n = 0; + if (OPP_sym == 37) { + while (OPS_str[__X(n, ((LONGINT)(256)))] != 0x00) { + (*ext)[__X(n + 1, ((LONGINT)(256)))] = OPS_str[__X(n, ((LONGINT)(256)))]; + n += 1; + } + (*ext)[0] = (CHAR)n; + OPS_Get(&OPP_sym); + } else { + for (;;) { + if (OPP_sym == 35) { + c = OPS_intval; + n += 1; + if ((c < 0 || c > 255) || n == 256) { + OPP_err(64); + c = 1; + n = 1; + } + OPS_Get(&OPP_sym); + (*ext)[__X(n, ((LONGINT)(256)))] = (CHAR)c; + } + if (OPP_sym == 19) { + OPS_Get(&OPP_sym); + } else if (OPP_sym == 35) { + OPP_err(19); + } else { + (*ext)[0] = (CHAR)n; + break; + } + } + } + (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1); +} + +static void GetParams__21 (void) +{ + (*ProcedureDeclaration__16_s->proc)->vis = *ProcedureDeclaration__16_s->vis; + (*ProcedureDeclaration__16_s->proc)->mode = *ProcedureDeclaration__16_s->mode; + (*ProcedureDeclaration__16_s->proc)->typ = OPT_notyp; + (*ProcedureDeclaration__16_s->proc)->conval = OPT_NewConst(); + (*ProcedureDeclaration__16_s->proc)->conval->setval = 0x0; + if (OPP_sym == 30) { + OPS_Get(&OPP_sym); + OPP_FormalParameters(&(*ProcedureDeclaration__16_s->proc)->link, &(*ProcedureDeclaration__16_s->proc)->typ); + } + if (*ProcedureDeclaration__16_s->fwd != NIL) { + OPB_CheckParameters((*ProcedureDeclaration__16_s->proc)->link, (*ProcedureDeclaration__16_s->fwd)->link, 1); + if ((*ProcedureDeclaration__16_s->proc)->typ != (*ProcedureDeclaration__16_s->fwd)->typ) { + OPP_err(117); + } + *ProcedureDeclaration__16_s->proc = *ProcedureDeclaration__16_s->fwd; + OPT_topScope = (*ProcedureDeclaration__16_s->proc)->scope; + if (*ProcedureDeclaration__16_s->mode == 10) { + (*ProcedureDeclaration__16_s->proc)->mode = 10; + } + } +} + +static void Body__17 (void) +{ + OPT_Node procdec = NIL, statseq = NIL; + LONGINT c; + c = OPM_errpos; + (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1); + OPP_CheckSym(39); + OPP_Block(&procdec, &statseq); + OPB_Enter(&procdec, statseq, *ProcedureDeclaration__16_s->proc); + *ProcedureDeclaration__16_s->x = procdec; + (*ProcedureDeclaration__16_s->x)->conval = OPT_NewConst(); + (*ProcedureDeclaration__16_s->x)->conval->intval = c; + if (OPP_sym == 38) { + if (__STRCMP(OPS_name, (*ProcedureDeclaration__16_s->proc)->name) != 0) { + OPP_err(4); + } + OPS_Get(&OPP_sym); + } else { + OPP_err(38); + } +} + +static void TProcDecl__23 (void) +{ + OPT_Object baseProc = NIL; + OPT_Struct objTyp = NIL, recTyp = NIL; + SHORTINT objMode; + OPS_Name objName; + OPS_Get(&OPP_sym); + *ProcedureDeclaration__16_s->mode = 13; + if (OPP_level > 0) { + OPP_err(73); + } + OPP_Receiver(&objMode, objName, &objTyp, &recTyp); + if (OPP_sym == 38) { + __COPY(OPS_name, *ProcedureDeclaration__16_s->name, ((LONGINT)(256))); + OPP_CheckMark(&*ProcedureDeclaration__16_s->vis); + OPT_FindField(*ProcedureDeclaration__16_s->name, recTyp, &*ProcedureDeclaration__16_s->fwd); + OPT_FindField(*ProcedureDeclaration__16_s->name, recTyp->BaseTyp, &baseProc); + if ((baseProc != NIL && baseProc->mode != 13)) { + baseProc = NIL; + } + if (*ProcedureDeclaration__16_s->fwd == baseProc) { + *ProcedureDeclaration__16_s->fwd = NIL; + } + if ((*ProcedureDeclaration__16_s->fwd != NIL && (*ProcedureDeclaration__16_s->fwd)->mnolev != OPP_level)) { + *ProcedureDeclaration__16_s->fwd = NIL; + } + if ((((*ProcedureDeclaration__16_s->fwd != NIL && (*ProcedureDeclaration__16_s->fwd)->mode == 13)) && !__IN(1, (*ProcedureDeclaration__16_s->fwd)->conval->setval))) { + *ProcedureDeclaration__16_s->proc = OPT_NewObj(); + (*ProcedureDeclaration__16_s->proc)->leaf = 1; + if ((*ProcedureDeclaration__16_s->fwd)->vis != *ProcedureDeclaration__16_s->vis) { + OPP_err(118); + } + } else { + if (*ProcedureDeclaration__16_s->fwd != NIL) { + OPP_err(1); + *ProcedureDeclaration__16_s->fwd = NIL; + } + OPT_OpenScope(0, NIL); + OPT_topScope->right = recTyp->link; + OPT_Insert(*ProcedureDeclaration__16_s->name, &*ProcedureDeclaration__16_s->proc); + recTyp->link = OPT_topScope->right; + OPT_CloseScope(); + } + OPP_level += 1; + OPT_OpenScope(OPP_level, *ProcedureDeclaration__16_s->proc); + OPT_Insert(objName, &(*ProcedureDeclaration__16_s->proc)->link); + (*ProcedureDeclaration__16_s->proc)->link->mode = objMode; + (*ProcedureDeclaration__16_s->proc)->link->typ = objTyp; + GetParams__21(); + if (baseProc != NIL) { + if (objMode != baseProc->link->mode || !OPP_Extends(objTyp, baseProc->link->typ)) { + OPP_err(115); + } + OPB_CheckParameters((*ProcedureDeclaration__16_s->proc)->link->link, baseProc->link->link, 0); + if ((*ProcedureDeclaration__16_s->proc)->typ != baseProc->typ) { + OPP_err(117); + } + if ((((((baseProc->vis == 1 && (*ProcedureDeclaration__16_s->proc)->vis == 0)) && recTyp->strobj != NIL)) && recTyp->strobj->vis == 1)) { + OPP_err(109); + } + (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(2); + } + if (!*ProcedureDeclaration__16_s->forward) { + Body__17(); + } + OPP_level -= 1; + OPT_CloseScope(); + } else { + OPP_err(38); + } +} + +static void OPP_ProcedureDeclaration (OPT_Node *x) +{ + OPT_Object proc = NIL, fwd = NIL; + OPS_Name name; + SHORTINT mode, vis; + BOOLEAN forward; + struct ProcedureDeclaration__16 _s; + _s.x = x; + _s.proc = &proc; + _s.fwd = &fwd; + _s.name = (void*)name; + _s.mode = &mode; + _s.vis = &vis; + _s.forward = &forward; + _s.lnk = ProcedureDeclaration__16_s; + ProcedureDeclaration__16_s = &_s; + proc = NIL; + forward = 0; + *x = NIL; + mode = 6; + if ((OPP_sym != 38 && OPP_sym != 30)) { + if (OPP_sym == 1) { + } else if (OPP_sym == 17) { + forward = 1; + } else if (OPP_sym == 6) { + mode = 10; + } else if (OPP_sym == 7) { + mode = 9; + } else { + OPP_err(38); + } + if ((__IN(mode, 0x0600) && !OPT_SYSimported)) { + OPP_err(135); + } + OPS_Get(&OPP_sym); + } + if (OPP_sym == 30) { + TProcDecl__23(); + } else if (OPP_sym == 38) { + OPT_Find(&fwd); + __COPY(OPS_name, name, ((LONGINT)(256))); + OPP_CheckMark(&vis); + if ((vis != 0 && mode == 6)) { + mode = 7; + } + if ((fwd != NIL && (fwd->mnolev != OPP_level || fwd->mode == 8))) { + fwd = NIL; + } + if ((((fwd != NIL && __IN(fwd->mode, 0xc0))) && !__IN(1, fwd->conval->setval))) { + proc = OPT_NewObj(); + proc->leaf = 1; + if (fwd->vis != vis) { + OPP_err(118); + } + } else { + if (fwd != NIL) { + OPP_err(1); + fwd = NIL; + } + OPT_Insert(name, &proc); + } + if ((mode != 6 && OPP_level > 0)) { + OPP_err(73); + } + OPP_level += 1; + OPT_OpenScope(OPP_level, proc); + proc->link = NIL; + GetParams__21(); + if (mode == 9) { + GetCode__19(); + } else if (!forward) { + Body__17(); + } + OPP_level -= 1; + OPT_CloseScope(); + } else { + OPP_err(38); + } + ProcedureDeclaration__16_s = _s.lnk; +} + +static void OPP_CaseLabelList (OPT_Node *lab, INTEGER LabelForm, INTEGER *n, OPP_CaseTable tab) +{ + OPT_Node x = NIL, y = NIL, lastlab = NIL; + INTEGER i, f; + LONGINT xval, yval; + *lab = NIL; + lastlab = NIL; + for (;;) { + OPP_ConstExpression(&x); + f = x->typ->form; + if (__IN(f, 0x78)) { + xval = x->conval->intval; + } else { + OPP_err(61); + xval = 1; + } + if (__IN(f, 0x70)) { + if (LabelForm < f) { + OPP_err(60); + } + } else if (LabelForm != f) { + OPP_err(60); + } + if (OPP_sym == 21) { + OPS_Get(&OPP_sym); + OPP_ConstExpression(&y); + yval = y->conval->intval; + if (((int)y->typ->form != f && !((__IN(f, 0x70) && __IN(y->typ->form, 0x70))))) { + OPP_err(60); + } + if (yval < xval) { + OPP_err(63); + yval = xval; + } + } else { + yval = xval; + } + x->conval->intval2 = yval; + i = *n; + if (i < 128) { + for (;;) { + if (i == 0) { + break; + } + if (tab[__X(i - 1, ((LONGINT)(128)))].low <= yval) { + if (tab[__X(i - 1, ((LONGINT)(128)))].high >= xval) { + OPP_err(62); + } + break; + } + tab[__X(i, ((LONGINT)(128)))] = tab[__X(i - 1, ((LONGINT)(128)))]; + i -= 1; + } + tab[__X(i, ((LONGINT)(128)))].low = xval; + tab[__X(i, ((LONGINT)(128)))].high = yval; + *n += 1; + } else { + OPP_err(213); + } + OPB_Link(&*lab, &lastlab, x); + if (OPP_sym == 19) { + OPS_Get(&OPP_sym); + } else if (OPP_sym == 35 || OPP_sym == 38) { + OPP_err(19); + } else { + break; + } + } +} + +static struct StatSeq__30 { + LONGINT *pos; + struct StatSeq__30 *lnk; +} *StatSeq__30_s; + +static void CasePart__31 (OPT_Node *x); +static void CheckBool__33 (OPT_Node *x); +static void SetPos__35 (OPT_Node x); + +static void CasePart__31 (OPT_Node *x) +{ + INTEGER n; + LONGINT low, high; + BOOLEAN e; + OPP_CaseTable tab; + OPT_Node cases = NIL, lab = NIL, y = NIL, lastcase = NIL; + OPP_Expression(&*x); + *StatSeq__30_s->pos = OPM_errpos; + if ((*x)->class == 8 || (*x)->class == 9) { + OPP_err(126); + } else if (!__IN((*x)->typ->form, 0x78)) { + OPP_err(125); + } + OPP_CheckSym(25); + cases = NIL; + lastcase = NIL; + n = 0; + for (;;) { + if (OPP_sym < 40) { + OPP_CaseLabelList(&lab, (*x)->typ->form, &n, tab); + OPP_CheckSym(20); + OPP_StatSeq(&y); + OPB_Construct(17, &lab, y); + OPB_Link(&cases, &lastcase, lab); + } + if (OPP_sym == 40) { + OPS_Get(&OPP_sym); + } else { + break; + } + } + if (n > 0) { + low = tab[0].low; + high = tab[__X(n - 1, ((LONGINT)(128)))].high; + if (high - low > 512) { + OPP_err(209); + } + } else { + low = 1; + high = 0; + } + e = OPP_sym == 42; + if (e) { + OPS_Get(&OPP_sym); + OPP_StatSeq(&y); + } else { + y = NIL; + OPM_Mark(-307, OPM_curpos); + } + OPB_Construct(16, &cases, y); + OPB_Construct(21, &*x, cases); + cases->conval = OPT_NewConst(); + cases->conval->intval = low; + cases->conval->intval2 = high; + if (e) { + cases->conval->setval = 0x02; + } else { + cases->conval->setval = 0x0; + } +} + +static void SetPos__35 (OPT_Node x) +{ + x->conval = OPT_NewConst(); + x->conval->intval = *StatSeq__30_s->pos; +} + +static void CheckBool__33 (OPT_Node *x) +{ + if ((*x)->class == 8 || (*x)->class == 9) { + OPP_err(126); + *x = OPB_NewBoolConst(0); + } else if ((*x)->typ->form != 2) { + OPP_err(120); + *x = OPB_NewBoolConst(0); + } + *StatSeq__30_s->pos = OPM_errpos; +} + +static void OPP_StatSeq (OPT_Node *stat) +{ + OPT_Object fpar = NIL, id = NIL, t = NIL, obj = NIL; + OPT_Struct idtyp = NIL; + BOOLEAN e; + OPT_Node s = NIL, x = NIL, y = NIL, z = NIL, apar = NIL, last = NIL, lastif = NIL; + LONGINT pos; + OPS_Name name; + struct StatSeq__30 _s; + _s.pos = &pos; + _s.lnk = StatSeq__30_s; + StatSeq__30_s = &_s; + *stat = NIL; + last = NIL; + for (;;) { + x = NIL; + if (OPP_sym < 38) { + OPP_err(14); + do { + OPS_Get(&OPP_sym); + } while (!(OPP_sym >= 38)); + } + if (OPP_sym == 38) { + OPP_qualident(&id); + x = OPB_NewLeaf(id); + OPP_selector(&x); + if (OPP_sym == 34) { + OPS_Get(&OPP_sym); + OPP_Expression(&y); + OPB_Assign(&x, y); + } else if (OPP_sym == 9) { + OPP_err(34); + OPS_Get(&OPP_sym); + OPP_Expression(&y); + OPB_Assign(&x, y); + } else if ((x->class == 9 && x->obj->mode == 8)) { + OPP_StandProcCall(&x); + if ((x != NIL && x->typ != OPT_notyp)) { + OPP_err(55); + } + } else { + OPB_PrepCall(&x, &fpar); + if (OPP_sym == 30) { + OPS_Get(&OPP_sym); + OPP_ActualParameters(&apar, fpar); + OPP_CheckSym(22); + } else { + apar = NIL; + if (fpar != NIL) { + OPP_err(65); + } + } + OPB_Call(&x, apar, fpar); + if (x->typ != OPT_notyp) { + OPP_err(55); + } + if (OPP_level > 0) { + OPT_topScope->link->leaf = 0; + } + } + pos = OPM_errpos; + } else if (OPP_sym == 45) { + OPS_Get(&OPP_sym); + OPP_Expression(&x); + CheckBool__33(&x); + OPP_CheckSym(26); + OPP_StatSeq(&y); + OPB_Construct(15, &x, y); + SetPos__35(x); + lastif = x; + while (OPP_sym == 43) { + OPS_Get(&OPP_sym); + OPP_Expression(&y); + CheckBool__33(&y); + OPP_CheckSym(26); + OPP_StatSeq(&z); + OPB_Construct(15, &y, z); + SetPos__35(y); + OPB_Link(&x, &lastif, y); + } + if (OPP_sym == 42) { + OPS_Get(&OPP_sym); + OPP_StatSeq(&y); + } else { + y = NIL; + } + OPB_Construct(20, &x, y); + OPP_CheckSym(41); + OPB_OptIf(&x); + pos = OPM_errpos; + } else if (OPP_sym == 46) { + OPS_Get(&OPP_sym); + CasePart__31(&x); + OPP_CheckSym(41); + } else if (OPP_sym == 47) { + OPS_Get(&OPP_sym); + OPP_Expression(&x); + CheckBool__33(&x); + OPP_CheckSym(27); + OPP_StatSeq(&y); + OPB_Construct(22, &x, y); + OPP_CheckSym(41); + } else if (OPP_sym == 48) { + OPS_Get(&OPP_sym); + OPP_StatSeq(&x); + if (OPP_sym == 44) { + OPS_Get(&OPP_sym); + OPP_Expression(&y); + CheckBool__33(&y); + } else { + OPP_err(44); + } + OPB_Construct(23, &x, y); + } else if (OPP_sym == 49) { + OPS_Get(&OPP_sym); + if (OPP_sym == 38) { + OPP_qualident(&id); + if (!__IN(id->typ->form, 0x70)) { + OPP_err(68); + } + OPP_CheckSym(34); + OPP_Expression(&y); + pos = OPM_errpos; + x = OPB_NewLeaf(id); + OPB_Assign(&x, y); + SetPos__35(x); + OPP_CheckSym(28); + OPP_Expression(&y); + pos = OPM_errpos; + if (y->class != 7) { + __MOVE("@@", name, 3); + OPT_Insert(name, &t); + __MOVE("@for", t->name, 5); + t->mode = 1; + t->typ = x->left->typ; + obj = OPT_topScope->scope; + if (obj == NIL) { + OPT_topScope->scope = t; + } else { + while (obj->link != NIL) { + obj = obj->link; + } + obj->link = t; + } + z = OPB_NewLeaf(t); + OPB_Assign(&z, y); + SetPos__35(z); + OPB_Link(&*stat, &last, z); + y = OPB_NewLeaf(t); + } else if (y->typ->form < 4 || y->typ->form > x->left->typ->form) { + OPP_err(113); + } + OPB_Link(&*stat, &last, x); + if (OPP_sym == 29) { + OPS_Get(&OPP_sym); + OPP_ConstExpression(&z); + } else { + z = OPB_NewIntConst(((LONGINT)(1))); + } + pos = OPM_errpos; + x = OPB_NewLeaf(id); + if (z->conval->intval > 0) { + OPB_Op(12, &x, y); + } else if (z->conval->intval < 0) { + OPB_Op(14, &x, y); + } else { + OPP_err(63); + OPB_Op(14, &x, y); + } + OPP_CheckSym(27); + OPP_StatSeq(&s); + y = OPB_NewLeaf(id); + OPB_StPar1(&y, z, 13); + SetPos__35(y); + if (s == NIL) { + s = y; + } else { + z = s; + while (z->link != NIL) { + z = z->link; + } + z->link = y; + } + OPP_CheckSym(41); + OPB_Construct(22, &x, s); + } else { + OPP_err(38); + } + } else if (OPP_sym == 50) { + OPS_Get(&OPP_sym); + OPP_LoopLevel += 1; + OPP_StatSeq(&x); + OPP_LoopLevel -= 1; + OPB_Construct(24, &x, NIL); + OPP_CheckSym(41); + pos = OPM_errpos; + } else if (OPP_sym == 51) { + OPS_Get(&OPP_sym); + idtyp = NIL; + x = NIL; + for (;;) { + if (OPP_sym == 38) { + OPP_qualident(&id); + y = OPB_NewLeaf(id); + if ((((id != NIL && id->typ->form == 13)) && (id->mode == 2 || !id->leaf))) { + OPP_err(245); + } + OPP_CheckSym(20); + if (OPP_sym == 38) { + OPP_qualident(&t); + if (t->mode == 5) { + if (id != NIL) { + idtyp = id->typ; + OPB_TypTest(&y, t, 0); + id->typ = t->typ; + } else { + OPP_err(130); + } + } else { + OPP_err(52); + } + } else { + OPP_err(38); + } + } else { + OPP_err(38); + } + pos = OPM_errpos; + OPP_CheckSym(27); + OPP_StatSeq(&s); + OPB_Construct(15, &y, s); + SetPos__35(y); + if (idtyp != NIL) { + id->typ = idtyp; + idtyp = NIL; + } + if (x == NIL) { + x = y; + lastif = x; + } else { + OPB_Link(&x, &lastif, y); + } + if (OPP_sym == 40) { + OPS_Get(&OPP_sym); + } else { + break; + } + } + e = OPP_sym == 42; + if (e) { + OPS_Get(&OPP_sym); + OPP_StatSeq(&s); + } else { + s = NIL; + } + OPB_Construct(27, &x, s); + OPP_CheckSym(41); + if (e) { + x->subcl = 1; + } + } else if (OPP_sym == 52) { + OPS_Get(&OPP_sym); + if (OPP_LoopLevel == 0) { + OPP_err(46); + } + OPB_Construct(25, &x, NIL); + pos = OPM_errpos; + } else if (OPP_sym == 53) { + OPS_Get(&OPP_sym); + if (OPP_sym < 39) { + OPP_Expression(&x); + } + if (OPP_level > 0) { + OPB_Return(&x, OPT_topScope->link); + } else { + OPB_Return(&x, NIL); + } + pos = OPM_errpos; + } + if (x != NIL) { + SetPos__35(x); + OPB_Link(&*stat, &last, x); + } + if (OPP_sym == 39) { + OPS_Get(&OPP_sym); + } else if (OPP_sym <= 38 || (45 <= OPP_sym && OPP_sym <= 53)) { + OPP_err(39); + } else { + break; + } + } + StatSeq__30_s = _s.lnk; +} + +static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) +{ + OPT_Struct typ = NIL; + OPT_Object obj = NIL, first = NIL, last = NIL; + OPT_Node x = NIL, lastdec = NIL; + INTEGER i; + first = NIL; + last = NIL; + OPP_nofFwdPtr = 0; + for (;;) { + if (OPP_sym == 58) { + OPS_Get(&OPP_sym); + while (OPP_sym == 38) { + OPT_Insert(OPS_name, &obj); + OPP_CheckMark(&obj->vis); + obj->typ = OPT_sinttyp; + obj->mode = 1; + if (OPP_sym == 9) { + OPS_Get(&OPP_sym); + OPP_ConstExpression(&x); + } else if (OPP_sym == 34) { + OPP_err(9); + OPS_Get(&OPP_sym); + OPP_ConstExpression(&x); + } else { + OPP_err(9); + x = OPB_NewIntConst(((LONGINT)(1))); + } + obj->mode = 3; + obj->typ = x->typ; + obj->conval = x->conval; + OPP_CheckSym(39); + } + } + if (OPP_sym == 59) { + OPS_Get(&OPP_sym); + while (OPP_sym == 38) { + OPT_Insert(OPS_name, &obj); + obj->mode = 5; + obj->typ = OPT_undftyp; + OPP_CheckMark(&obj->vis); + if (OPP_sym == 9) { + OPS_Get(&OPP_sym); + OPP_TypeDecl(&obj->typ, &obj->typ); + } else if (OPP_sym == 34 || OPP_sym == 20) { + OPP_err(9); + OPS_Get(&OPP_sym); + OPP_TypeDecl(&obj->typ, &obj->typ); + } else { + OPP_err(9); + } + if (obj->typ->strobj == NIL) { + obj->typ->strobj = obj; + } + if (__IN(obj->typ->comp, 0x1c)) { + i = 0; + while (i < OPP_nofFwdPtr) { + typ = OPP_FwdPtr[__X(i, ((LONGINT)(64)))]; + i += 1; + if (__STRCMP(typ->link->name, obj->name) == 0) { + typ->BaseTyp = obj->typ; + typ->link->name[0] = 0x00; + } + } + } + OPP_CheckSym(39); + } + } + if (OPP_sym == 60) { + OPS_Get(&OPP_sym); + while (OPP_sym == 38) { + for (;;) { + if (OPP_sym == 38) { + OPT_Insert(OPS_name, &obj); + OPP_CheckMark(&obj->vis); + obj->mode = 1; + obj->link = NIL; + obj->leaf = obj->vis == 0; + obj->typ = OPT_undftyp; + if (first == NIL) { + first = obj; + } + if (last == NIL) { + OPT_topScope->scope = obj; + } else { + last->link = obj; + } + last = obj; + } else { + OPP_err(38); + } + if (OPP_sym == 19) { + OPS_Get(&OPP_sym); + } else if (OPP_sym == 38) { + OPP_err(19); + } else { + break; + } + } + OPP_CheckSym(20); + OPP_Type(&typ, &OPT_notyp); + typ->pvused = 1; + if (typ->comp == 3) { + typ = OPT_undftyp; + OPP_err(88); + } + while (first != NIL) { + first->typ = typ; + first = first->link; + } + OPP_CheckSym(39); + } + } + if (OPP_sym < 58 || OPP_sym > 60) { + break; + } + } + i = 0; + while (i < OPP_nofFwdPtr) { + if (OPP_FwdPtr[__X(i, ((LONGINT)(64)))]->link->name[0] != 0x00) { + OPP_err(128); + } + OPP_FwdPtr[__X(i, ((LONGINT)(64)))] = NIL; + i += 1; + } + OPT_topScope->adr = OPM_errpos; + *procdec = NIL; + lastdec = NIL; + while (OPP_sym == 61) { + OPS_Get(&OPP_sym); + OPP_ProcedureDeclaration(&x); + if (x != NIL) { + if (lastdec == NIL) { + *procdec = x; + } else { + lastdec->link = x; + } + lastdec = x; + } + OPP_CheckSym(39); + } + if (OPP_sym == 57) { + OPS_Get(&OPP_sym); + OPP_StatSeq(&*statseq); + } else { + *statseq = NIL; + } + if ((OPP_level == 0 && OPP_TDinit != NIL)) { + OPP_lastTDinit->link = *statseq; + *statseq = OPP_TDinit; + } + OPP_CheckSym(41); +} + +void OPP_Module (OPT_Node *prog, SET opt) +{ + OPS_Name impName, aliasName; + OPT_Node procdec = NIL, statseq = NIL; + LONGINT c; + BOOLEAN done; + OPS_Init(); + OPP_LoopLevel = 0; + OPP_level = 0; + OPS_Get(&OPP_sym); + if (OPP_sym == 63) { + OPS_Get(&OPP_sym); + } else { + OPP_err(16); + } + if (OPP_sym == 38) { + OPM_LogWStr((CHAR*)"compiling ", (LONGINT)11); + OPM_LogWStr(OPS_name, ((LONGINT)(256))); + OPM_LogW('.'); + OPT_Init(OPS_name, opt); + OPS_Get(&OPP_sym); + OPP_CheckSym(39); + if (OPP_sym == 62) { + OPS_Get(&OPP_sym); + for (;;) { + if (OPP_sym == 38) { + __COPY(OPS_name, aliasName, ((LONGINT)(256))); + __COPY(aliasName, impName, ((LONGINT)(256))); + OPS_Get(&OPP_sym); + if (OPP_sym == 34) { + OPS_Get(&OPP_sym); + if (OPP_sym == 38) { + __COPY(OPS_name, impName, ((LONGINT)(256))); + OPS_Get(&OPP_sym); + } else { + OPP_err(38); + } + } + OPT_Import(aliasName, impName, &done); + } else { + OPP_err(38); + } + if (OPP_sym == 19) { + OPS_Get(&OPP_sym); + } else if (OPP_sym == 38) { + OPP_err(19); + } else { + break; + } + } + OPP_CheckSym(39); + } + if (OPM_noerr) { + OPP_TDinit = NIL; + OPP_lastTDinit = NIL; + c = OPM_errpos; + OPP_Block(&procdec, &statseq); + OPB_Enter(&procdec, statseq, NIL); + *prog = procdec; + (*prog)->conval = OPT_NewConst(); + (*prog)->conval->intval = c; + if (OPP_sym == 38) { + if (__STRCMP(OPS_name, OPT_SelfName) != 0) { + OPP_err(4); + } + OPS_Get(&OPP_sym); + } else { + OPP_err(38); + } + if (OPP_sym != 18) { + OPP_err(18); + } + } + } else { + OPP_err(38); + } + OPP_TDinit = NIL; + OPP_lastTDinit = NIL; +} + +static void EnumPtrs(void (*P)(void*)) +{ + P(OPP_TDinit); + P(OPP_lastTDinit); + __ENUMP(OPP_FwdPtr, 64, P); +} + +__TDESC(OPP__1, 1, 0) = {__TDFLDS("", 8), {-4}}; + +export void *OPP__init(void) +{ + __DEFMOD; + __MODULE_IMPORT(OPB); + __MODULE_IMPORT(OPM); + __MODULE_IMPORT(OPS); + __MODULE_IMPORT(OPT); + __REGMOD("OPP", EnumPtrs); + __INITYP(OPP__1, OPP__1, 0); +/* BEGIN */ + __ENDMOD; +} diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h new file mode 100644 index 00000000..1e0a1809 --- /dev/null +++ b/bootstrap/unix-48/OPP.h @@ -0,0 +1,16 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ + +#ifndef OPP__h +#define OPP__h + +#include "SYSTEM.h" +#include "OPT.h" + + + + +import void OPP_Module (OPT_Node *prog, SET opt); +import void *OPP__init(void); + + +#endif diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c new file mode 100644 index 00000000..88944148 --- /dev/null +++ b/bootstrap/unix-48/OPS.c @@ -0,0 +1,623 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin tspkaSfF */ +#include "SYSTEM.h" +#include "OPM.h" + +typedef + CHAR OPS_Name[256]; + +typedef + CHAR OPS_String[256]; + + +export OPS_Name OPS_name; +export OPS_String OPS_str; +export INTEGER OPS_numtyp; +export LONGINT OPS_intval; +export REAL OPS_realval; +export LONGREAL OPS_lrlval; +static CHAR OPS_ch; + + +export void OPS_Get (SHORTINT *sym); +static void OPS_Identifier (SHORTINT *sym); +export void OPS_Init (void); +static void OPS_Number (void); +static void OPS_Str (SHORTINT *sym); +static void OPS_err (INTEGER n); + + +static void OPS_err (INTEGER n) +{ + OPM_err(n); +} + +static void OPS_Str (SHORTINT *sym) +{ + INTEGER i; + CHAR och; + i = 0; + och = OPS_ch; + for (;;) { + OPM_Get(&OPS_ch); + if (OPS_ch == och) { + break; + } + if (OPS_ch < ' ') { + OPS_err(3); + break; + } + if (i == 255) { + OPS_err(241); + break; + } + OPS_str[i] = OPS_ch; + i += 1; + } + OPM_Get(&OPS_ch); + OPS_str[i] = 0x00; + OPS_intval = i + 1; + if (OPS_intval == 2) { + *sym = 35; + OPS_numtyp = 1; + OPS_intval = (int)OPS_str[0]; + } else { + *sym = 37; + } +} + +static void OPS_Identifier (SHORTINT *sym) +{ + INTEGER i; + i = 0; + do { + OPS_name[i] = OPS_ch; + i += 1; + OPM_Get(&OPS_ch); + } while (!(((OPS_ch < '0' || ('9' < OPS_ch && __CAP(OPS_ch) < 'A')) || 'Z' < __CAP(OPS_ch)) || i == 256)); + if (i == 256) { + OPS_err(240); + i -= 1; + } + OPS_name[i] = 0x00; + *sym = 38; +} + +static struct Number__6 { + struct Number__6 *lnk; +} *Number__6_s; + +static INTEGER Ord__7 (CHAR ch, BOOLEAN hex); +static LONGREAL Ten__9 (INTEGER e); + +static LONGREAL Ten__9 (INTEGER e) +{ + LONGREAL _o_result; + LONGREAL x, p; + x = (LONGREAL)1; + p = (LONGREAL)10; + while (e > 0) { + if (__ODD(e)) { + x = x * p; + } + e = __ASHR(e, 1); + if (e > 0) { + p = p * p; + } + } + _o_result = x; + return _o_result; +} + +static INTEGER Ord__7 (CHAR ch, BOOLEAN hex) +{ + INTEGER _o_result; + if (ch <= '9') { + _o_result = (int)ch - 48; + return _o_result; + } else if (hex) { + _o_result = ((int)ch - 65) + 10; + return _o_result; + } else { + OPS_err(2); + _o_result = 0; + return _o_result; + } + __RETCHK; +} + +static void OPS_Number (void) +{ + INTEGER i, m, n, d, e; + CHAR dig[24]; + LONGREAL f; + CHAR expCh; + BOOLEAN neg; + struct Number__6 _s; + _s.lnk = Number__6_s; + Number__6_s = &_s; + i = 0; + m = 0; + n = 0; + d = 0; + for (;;) { + if (('0' <= OPS_ch && OPS_ch <= '9') || (((d == 0 && 'A' <= OPS_ch)) && OPS_ch <= 'F')) { + if (m > 0 || OPS_ch != '0') { + if (n < 24) { + dig[n] = OPS_ch; + n += 1; + } + m += 1; + } + OPM_Get(&OPS_ch); + i += 1; + } else if (OPS_ch == '.') { + OPM_Get(&OPS_ch); + if (OPS_ch == '.') { + OPS_ch = 0x7f; + break; + } else if (d == 0) { + d = i; + } else { + OPS_err(2); + } + } else { + break; + } + } + if (d == 0) { + if (n == m) { + OPS_intval = 0; + i = 0; + if (OPS_ch == 'X') { + OPM_Get(&OPS_ch); + OPS_numtyp = 1; + if (n <= 2) { + while (i < n) { + OPS_intval = __ASHL(OPS_intval, 4) + (LONGINT)Ord__7(dig[i], 1); + i += 1; + } + } else { + OPS_err(203); + } + } else if (OPS_ch == 'H') { + OPM_Get(&OPS_ch); + OPS_numtyp = 2; + if (n <= 8) { + if ((n == 8 && dig[0] > '7')) { + OPS_intval = -1; + } + while (i < n) { + OPS_intval = __ASHL(OPS_intval, 4) + (LONGINT)Ord__7(dig[i], 1); + i += 1; + } + } else { + OPS_err(203); + } + } else { + OPS_numtyp = 2; + while (i < n) { + d = Ord__7(dig[i], 0); + i += 1; + if (OPS_intval <= __DIV(2147483647 - (LONGINT)d, 10)) { + OPS_intval = OPS_intval * 10 + (LONGINT)d; + } else { + OPS_err(203); + } + } + } + } else { + OPS_err(203); + } + } else { + f = (LONGREAL)0; + e = 0; + expCh = 'E'; + while (n > 0) { + n -= 1; + f = (Ord__7(dig[n], 0) + f) / (LONGREAL)(LONGREAL)10; + } + if (OPS_ch == 'E' || OPS_ch == 'D') { + expCh = OPS_ch; + OPM_Get(&OPS_ch); + neg = 0; + if (OPS_ch == '-') { + neg = 1; + OPM_Get(&OPS_ch); + } else if (OPS_ch == '+') { + OPM_Get(&OPS_ch); + } + if (('0' <= OPS_ch && OPS_ch <= '9')) { + do { + n = Ord__7(OPS_ch, 0); + OPM_Get(&OPS_ch); + if (e <= __DIV(32767 - n, 10)) { + e = e * 10 + n; + } else { + OPS_err(203); + } + } while (!(OPS_ch < '0' || '9' < OPS_ch)); + if (neg) { + e = -e; + } + } else { + OPS_err(2); + } + } + e -= (i - d) - m; + if (expCh == 'E') { + OPS_numtyp = 3; + if ((-37 < e && e <= 38)) { + if (e < 0) { + OPS_realval = (f / (LONGREAL)Ten__9(-e)); + } else { + OPS_realval = (f * Ten__9(e)); + } + } else { + OPS_err(203); + } + } else { + OPS_numtyp = 4; + if ((-307 < e && e <= 308)) { + if (e < 0) { + OPS_lrlval = f / (LONGREAL)Ten__9(-e); + } else { + OPS_lrlval = f * Ten__9(e); + } + } else { + OPS_err(203); + } + } + } + Number__6_s = _s.lnk; +} + +static struct Get__1 { + struct Get__1 *lnk; +} *Get__1_s; + +static void Comment__2 (void); + +static void Comment__2 (void) +{ + OPM_Get(&OPS_ch); + for (;;) { + for (;;) { + while (OPS_ch == '(') { + OPM_Get(&OPS_ch); + if (OPS_ch == '*') { + Comment__2(); + } + } + if (OPS_ch == '*') { + OPM_Get(&OPS_ch); + break; + } + if (OPS_ch == 0x00) { + break; + } + OPM_Get(&OPS_ch); + } + if (OPS_ch == ')') { + OPM_Get(&OPS_ch); + break; + } + if (OPS_ch == 0x00) { + OPS_err(5); + break; + } + } +} + +void OPS_Get (SHORTINT *sym) +{ + SHORTINT s; + struct Get__1 _s; + _s.lnk = Get__1_s; + Get__1_s = &_s; + OPM_errpos = OPM_curpos - 1; + while (OPS_ch <= ' ') { + if (OPS_ch == 0x00) { + *sym = 64; + return; + } else { + OPM_Get(&OPS_ch); + } + } + switch (OPS_ch) { + case '\"': case '\'': + OPS_Str(&s); + break; + case '#': + s = 10; + OPM_Get(&OPS_ch); + break; + case '&': + s = 5; + OPM_Get(&OPS_ch); + break; + case '(': + OPM_Get(&OPS_ch); + if (OPS_ch == '*') { + Comment__2(); + OPS_Get(&s); + } else { + s = 30; + } + break; + case ')': + s = 22; + OPM_Get(&OPS_ch); + break; + case '*': + s = 1; + OPM_Get(&OPS_ch); + break; + case '+': + s = 6; + OPM_Get(&OPS_ch); + break; + case ',': + s = 19; + OPM_Get(&OPS_ch); + break; + case '-': + s = 7; + OPM_Get(&OPS_ch); + break; + case '.': + OPM_Get(&OPS_ch); + if (OPS_ch == '.') { + OPM_Get(&OPS_ch); + s = 21; + } else { + s = 18; + } + break; + case '/': + s = 2; + OPM_Get(&OPS_ch); + break; + case '0': case '1': case '2': case '3': case '4': + case '5': case '6': case '7': case '8': case '9': + OPS_Number(); + s = 35; + break; + case ':': + OPM_Get(&OPS_ch); + if (OPS_ch == '=') { + OPM_Get(&OPS_ch); + s = 34; + } else { + s = 20; + } + break; + case ';': + s = 39; + OPM_Get(&OPS_ch); + break; + case '<': + OPM_Get(&OPS_ch); + if (OPS_ch == '=') { + OPM_Get(&OPS_ch); + s = 12; + } else { + s = 11; + } + break; + case '=': + s = 9; + OPM_Get(&OPS_ch); + break; + case '>': + OPM_Get(&OPS_ch); + if (OPS_ch == '=') { + OPM_Get(&OPS_ch); + s = 14; + } else { + s = 13; + } + break; + case 'A': + OPS_Identifier(&s); + if (__STRCMP(OPS_name, "ARRAY") == 0) { + s = 54; + } + break; + case 'B': + OPS_Identifier(&s); + if (__STRCMP(OPS_name, "BEGIN") == 0) { + s = 57; + } else if (__STRCMP(OPS_name, "BY") == 0) { + s = 29; + } + break; + case 'C': + OPS_Identifier(&s); + if (__STRCMP(OPS_name, "CASE") == 0) { + s = 46; + } else if (__STRCMP(OPS_name, "CONST") == 0) { + s = 58; + } + break; + case 'D': + OPS_Identifier(&s); + if (__STRCMP(OPS_name, "DO") == 0) { + s = 27; + } else if (__STRCMP(OPS_name, "DIV") == 0) { + s = 3; + } + break; + case 'E': + OPS_Identifier(&s); + if (__STRCMP(OPS_name, "END") == 0) { + s = 41; + } else if (__STRCMP(OPS_name, "ELSE") == 0) { + s = 42; + } else if (__STRCMP(OPS_name, "ELSIF") == 0) { + s = 43; + } else if (__STRCMP(OPS_name, "EXIT") == 0) { + s = 52; + } + break; + case 'F': + OPS_Identifier(&s); + if (__STRCMP(OPS_name, "FOR") == 0) { + s = 49; + } + break; + case 'I': + OPS_Identifier(&s); + if (__STRCMP(OPS_name, "IF") == 0) { + s = 45; + } else if (__STRCMP(OPS_name, "IN") == 0) { + s = 15; + } else if (__STRCMP(OPS_name, "IS") == 0) { + s = 16; + } else if (__STRCMP(OPS_name, "IMPORT") == 0) { + s = 62; + } + break; + case 'L': + OPS_Identifier(&s); + if (__STRCMP(OPS_name, "LOOP") == 0) { + s = 50; + } + break; + case 'M': + OPS_Identifier(&s); + if (__STRCMP(OPS_name, "MOD") == 0) { + s = 4; + } else if (__STRCMP(OPS_name, "MODULE") == 0) { + s = 63; + } + break; + case 'N': + OPS_Identifier(&s); + if (__STRCMP(OPS_name, "NIL") == 0) { + s = 36; + } + break; + case 'O': + OPS_Identifier(&s); + if (__STRCMP(OPS_name, "OR") == 0) { + s = 8; + } else if (__STRCMP(OPS_name, "OF") == 0) { + s = 25; + } + break; + case 'P': + OPS_Identifier(&s); + if (__STRCMP(OPS_name, "PROCEDURE") == 0) { + s = 61; + } else if (__STRCMP(OPS_name, "POINTER") == 0) { + s = 56; + } + break; + case 'R': + OPS_Identifier(&s); + if (__STRCMP(OPS_name, "RECORD") == 0) { + s = 55; + } else if (__STRCMP(OPS_name, "REPEAT") == 0) { + s = 48; + } else if (__STRCMP(OPS_name, "RETURN") == 0) { + s = 53; + } + break; + case 'T': + OPS_Identifier(&s); + if (__STRCMP(OPS_name, "THEN") == 0) { + s = 26; + } else if (__STRCMP(OPS_name, "TO") == 0) { + s = 28; + } else if (__STRCMP(OPS_name, "TYPE") == 0) { + s = 59; + } + break; + case 'U': + OPS_Identifier(&s); + if (__STRCMP(OPS_name, "UNTIL") == 0) { + s = 44; + } + break; + case 'V': + OPS_Identifier(&s); + if (__STRCMP(OPS_name, "VAR") == 0) { + s = 60; + } + break; + case 'W': + OPS_Identifier(&s); + if (__STRCMP(OPS_name, "WHILE") == 0) { + s = 47; + } else if (__STRCMP(OPS_name, "WITH") == 0) { + s = 51; + } + break; + case 'G': case 'H': case 'J': case 'K': case 'Q': + case 'S': case 'X': case 'Y': case 'Z': + OPS_Identifier(&s); + break; + case '[': + s = 31; + OPM_Get(&OPS_ch); + break; + case ']': + s = 23; + OPM_Get(&OPS_ch); + break; + case '^': + s = 17; + OPM_Get(&OPS_ch); + break; + case 'a': case 'b': case 'c': case 'd': case 'e': + case 'f': case 'g': case 'h': case 'i': case 'j': + case 'k': case 'l': case 'm': case 'n': case 'o': + case 'p': case 'q': case 'r': case 's': case 't': + case 'u': case 'v': case 'w': case 'x': case 'y': + case 'z': + OPS_Identifier(&s); + break; + case '{': + s = 32; + OPM_Get(&OPS_ch); + break; + case '|': + s = 40; + OPM_Get(&OPS_ch); + break; + case '}': + s = 24; + OPM_Get(&OPS_ch); + break; + case '~': + s = 33; + OPM_Get(&OPS_ch); + break; + case 0x7f: + s = 21; + OPM_Get(&OPS_ch); + break; + default: + s = 0; + OPM_Get(&OPS_ch); + break; + } + *sym = s; + Get__1_s = _s.lnk; +} + +void OPS_Init (void) +{ + OPS_ch = ' '; +} + + +export void *OPS__init(void) +{ + __DEFMOD; + __MODULE_IMPORT(OPM); + __REGMOD("OPS", 0); + __REGCMD("Init", OPS_Init); +/* BEGIN */ + __ENDMOD; +} diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h new file mode 100644 index 00000000..87a614f4 --- /dev/null +++ b/bootstrap/unix-48/OPS.h @@ -0,0 +1,28 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin tspkaSfF */ + +#ifndef OPS__h +#define OPS__h + +#include "SYSTEM.h" + +typedef + CHAR OPS_Name[256]; + +typedef + CHAR OPS_String[256]; + + +import OPS_Name OPS_name; +import OPS_String OPS_str; +import INTEGER OPS_numtyp; +import LONGINT OPS_intval; +import REAL OPS_realval; +import LONGREAL OPS_lrlval; + + +import void OPS_Get (SHORTINT *sym); +import void OPS_Init (void); +import void *OPS__init(void); + + +#endif diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c new file mode 100644 index 00000000..fc80ce02 --- /dev/null +++ b/bootstrap/unix-48/OPT.c @@ -0,0 +1,1858 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +#include "SYSTEM.h" +#include "OPM.h" +#include "OPS.h" + +typedef + struct OPT_ConstDesc *OPT_Const; + +typedef + OPS_String *OPT_ConstExt; + +typedef + struct OPT_ConstDesc { + OPT_ConstExt ext; + LONGINT intval, intval2; + SET setval; + LONGREAL realval; + } OPT_ConstDesc; + +typedef + struct OPT_ExpCtxt { + LONGINT reffp; + INTEGER ref; + SHORTINT nofm; + SHORTINT locmno[64]; + } OPT_ExpCtxt; + +typedef + struct OPT_StrDesc *OPT_Struct; + +typedef + struct OPT_ObjDesc *OPT_Object; + +typedef + struct OPT_ImpCtxt { + LONGINT nextTag, reffp; + INTEGER nofr, minr, nofm; + BOOLEAN self; + OPT_Struct ref[255]; + OPT_Object old[255]; + LONGINT pvfp[255]; + SHORTINT glbmno[64]; + } OPT_ImpCtxt; + +typedef + struct OPT_NodeDesc *OPT_Node; + +typedef + struct OPT_NodeDesc { + OPT_Node left, right, link; + SHORTINT class, subcl; + BOOLEAN readonly; + OPT_Struct typ; + OPT_Object obj; + OPT_Const conval; + } OPT_NodeDesc; + +typedef + struct OPT_ObjDesc { + OPT_Object left, right, link, scope; + OPS_Name name; + BOOLEAN leaf; + SHORTINT mode, mnolev, vis, history; + BOOLEAN used, fpdone; + LONGINT fprint; + OPT_Struct typ; + OPT_Const conval; + LONGINT adr, linkadr; + INTEGER x; + } OPT_ObjDesc; + +typedef + struct OPT_StrDesc { + SHORTINT form, comp, mno, extlev; + INTEGER ref, sysflag; + LONGINT n, size, align, txtpos; + BOOLEAN allocated, pbused, pvused, fpdone, idfpdone; + LONGINT idfp, pbfp, pvfp; + OPT_Struct BaseTyp; + OPT_Object link, strobj; + } OPT_StrDesc; + + +export void (*OPT_typSize)(OPT_Struct); +export OPT_Object OPT_topScope; +export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +export SHORTINT OPT_nofGmod; +export OPT_Object OPT_GlbMod[64]; +export OPS_Name OPT_SelfName; +export BOOLEAN OPT_SYSimported; +static OPT_Object OPT_universe, OPT_syslink; +static OPT_ImpCtxt OPT_impCtxt; +static OPT_ExpCtxt OPT_expCtxt; +static LONGINT OPT_nofhdfld; +static BOOLEAN OPT_newsf, OPT_findpc, OPT_extsf, OPT_sfpresent, OPT_symExtended, OPT_symNew; + +export LONGINT *OPT_ConstDesc__typ; +export LONGINT *OPT_ObjDesc__typ; +export LONGINT *OPT_StrDesc__typ; +export LONGINT *OPT_NodeDesc__typ; +export LONGINT *OPT_ImpCtxt__typ; +export LONGINT *OPT_ExpCtxt__typ; + +export void OPT_Close (void); +export void OPT_CloseScope (void); +static void OPT_DebugStruct (OPT_Struct btyp); +static void OPT_EnterBoolConst (OPS_Name name, LONGINT value); +static void OPT_EnterProc (OPS_Name name, INTEGER num); +static void OPT_EnterTyp (OPS_Name name, SHORTINT form, INTEGER size, OPT_Struct *res); +export void OPT_Export (BOOLEAN *ext, BOOLEAN *new); +export void OPT_FPrintErr (OPT_Object obj, INTEGER errcode); +static void OPT_FPrintName (LONGINT *fp, CHAR *name, LONGINT name__len); +export void OPT_FPrintObj (OPT_Object obj); +static void OPT_FPrintSign (LONGINT *fp, OPT_Struct result, OPT_Object par); +export void OPT_FPrintStr (OPT_Struct typ); +export void OPT_Find (OPT_Object *res); +export void OPT_FindField (OPS_Name name, OPT_Struct typ, OPT_Object *res); +export void OPT_FindImport (OPT_Object mod, OPT_Object *res); +export void OPT_IdFPrint (OPT_Struct typ); +export void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); +static void OPT_InConstant (LONGINT f, OPT_Const conval); +static OPT_Object OPT_InFld (void); +static void OPT_InMod (SHORTINT *mno); +static void OPT_InName (CHAR *name, LONGINT name__len); +static OPT_Object OPT_InObj (SHORTINT mno); +static void OPT_InSign (SHORTINT mno, OPT_Struct *res, OPT_Object *par); +static void OPT_InStruct (OPT_Struct *typ); +static OPT_Object OPT_InTProc (SHORTINT mno); +export void OPT_Init (OPS_Name name, SET opt); +static void OPT_InitStruct (OPT_Struct *typ, SHORTINT form); +export void OPT_Insert (OPS_Name name, OPT_Object *obj); +export void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); +export OPT_Const OPT_NewConst (void); +export OPT_ConstExt OPT_NewExt (void); +export OPT_Node OPT_NewNode (SHORTINT class); +export OPT_Object OPT_NewObj (void); +export OPT_Struct OPT_NewStr (SHORTINT form, SHORTINT comp); +export void OPT_OpenScope (SHORTINT level, OPT_Object owner); +static void OPT_OutConstant (OPT_Object obj); +static void OPT_OutFlds (OPT_Object fld, LONGINT adr, BOOLEAN visible); +static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, LONGINT adr); +static void OPT_OutMod (INTEGER mno); +static void OPT_OutName (CHAR *name, LONGINT name__len); +static void OPT_OutObj (OPT_Object obj); +static void OPT_OutSign (OPT_Struct result, OPT_Object par); +static void OPT_OutStr (OPT_Struct typ); +static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj); +static void OPT_err (INTEGER n); + + +static void OPT_err (INTEGER n) +{ + OPM_err(n); +} + +OPT_Const OPT_NewConst (void) +{ + OPT_Const _o_result; + OPT_Const const_ = NIL; + __NEW(const_, OPT_ConstDesc); + _o_result = const_; + return _o_result; +} + +OPT_Object OPT_NewObj (void) +{ + OPT_Object _o_result; + OPT_Object obj = NIL; + __NEW(obj, OPT_ObjDesc); + _o_result = obj; + return _o_result; +} + +OPT_Struct OPT_NewStr (SHORTINT form, SHORTINT comp) +{ + OPT_Struct _o_result; + OPT_Struct typ = NIL; + __NEW(typ, OPT_StrDesc); + typ->form = form; + typ->comp = comp; + typ->ref = 255; + if (form != 0) { + typ->txtpos = OPM_errpos; + } + typ->size = -1; + typ->BaseTyp = OPT_undftyp; + _o_result = typ; + return _o_result; +} + +OPT_Node OPT_NewNode (SHORTINT class) +{ + OPT_Node _o_result; + OPT_Node node = NIL; + __NEW(node, OPT_NodeDesc); + node->class = class; + _o_result = node; + return _o_result; +} + +OPT_ConstExt OPT_NewExt (void) +{ + OPT_ConstExt _o_result; + OPT_ConstExt ext = NIL; + ext = __NEWARR(NIL, ((LONGINT)(1)), 1, 1, 0, (LONGINT)256); + _o_result = ext; + return _o_result; +} + +void OPT_OpenScope (SHORTINT level, OPT_Object owner) +{ + OPT_Object head = NIL; + head = OPT_NewObj(); + head->mode = 12; + head->mnolev = level; + head->link = owner; + if (owner != NIL) { + owner->scope = head; + } + head->left = OPT_topScope; + head->right = NIL; + head->scope = NIL; + OPT_topScope = head; +} + +void OPT_CloseScope (void) +{ + OPT_topScope = OPT_topScope->left; +} + +void OPT_Init (OPS_Name name, SET opt) +{ + OPT_topScope = OPT_universe; + OPT_OpenScope(0, NIL); + OPT_SYSimported = 0; + __COPY(name, OPT_SelfName, ((LONGINT)(256))); + __COPY(name, OPT_topScope->name, ((LONGINT)(256))); + OPT_GlbMod[0] = OPT_topScope; + OPT_nofGmod = 1; + OPT_newsf = __IN(4, opt); + OPT_findpc = __IN(8, opt); + OPT_extsf = OPT_newsf || __IN(9, opt); + OPT_sfpresent = 1; +} + +void OPT_Close (void) +{ + INTEGER i; + OPT_CloseScope(); + i = 0; + while (i < 64) { + OPT_GlbMod[__X(i, ((LONGINT)(64)))] = NIL; + i += 1; + } + i = 16; + while (i < 255) { + OPT_impCtxt.ref[__X(i, ((LONGINT)(255)))] = NIL; + OPT_impCtxt.old[__X(i, ((LONGINT)(255)))] = NIL; + i += 1; + } +} + +void OPT_FindImport (OPT_Object mod, OPT_Object *res) +{ + OPT_Object obj = NIL; + obj = mod->scope; + for (;;) { + if (obj == NIL) { + break; + } + if (__STRCMP(OPS_name, obj->name) < 0) { + obj = obj->left; + } else if (__STRCMP(OPS_name, obj->name) > 0) { + obj = obj->right; + } else { + if ((obj->mode == 5 && obj->vis == 0)) { + obj = NIL; + } else { + obj->used = 1; + } + break; + } + } + *res = obj; +} + +void OPT_Find (OPT_Object *res) +{ + OPT_Object obj = NIL, head = NIL; + head = OPT_topScope; + for (;;) { + obj = head->right; + for (;;) { + if (obj == NIL) { + break; + } + if (__STRCMP(OPS_name, obj->name) < 0) { + obj = obj->left; + } else if (__STRCMP(OPS_name, obj->name) > 0) { + obj = obj->right; + } else { + break; + } + } + if (obj != NIL) { + break; + } + head = head->left; + if (head == NIL) { + break; + } + } + *res = obj; +} + +void OPT_FindField (OPS_Name name, OPT_Struct typ, OPT_Object *res) +{ + OPT_Object obj = NIL; + while (typ != NIL) { + obj = typ->link; + while (obj != NIL) { + if (__STRCMP(name, obj->name) < 0) { + obj = obj->left; + } else if (__STRCMP(name, obj->name) > 0) { + obj = obj->right; + } else { + *res = obj; + return; + } + } + typ = typ->BaseTyp; + } + *res = NIL; +} + +void OPT_Insert (OPS_Name name, OPT_Object *obj) +{ + OPT_Object ob0 = NIL, ob1 = NIL; + BOOLEAN left; + SHORTINT mnolev; + ob0 = OPT_topScope; + ob1 = ob0->right; + left = 0; + for (;;) { + if (ob1 != NIL) { + if (__STRCMP(name, ob1->name) < 0) { + ob0 = ob1; + ob1 = ob0->left; + left = 1; + } else if (__STRCMP(name, ob1->name) > 0) { + ob0 = ob1; + ob1 = ob0->right; + left = 0; + } else { + OPT_err(1); + ob0 = ob1; + ob1 = ob0->right; + } + } else { + ob1 = OPT_NewObj(); + ob1->leaf = 1; + if (left) { + ob0->left = ob1; + } else { + ob0->right = ob1; + } + ob1->left = NIL; + ob1->right = NIL; + __COPY(name, ob1->name, ((LONGINT)(256))); + mnolev = OPT_topScope->mnolev; + ob1->mnolev = mnolev; + break; + } + } + *obj = ob1; +} + +static void OPT_FPrintName (LONGINT *fp, CHAR *name, LONGINT name__len) +{ + INTEGER i; + CHAR ch; + i = 0; + do { + ch = name[__X(i, name__len)]; + OPM_FPrint(&*fp, (int)ch); + i += 1; + } while (!(ch == 0x00)); +} + +static void OPT_DebugStruct (OPT_Struct btyp) +{ + OPM_LogWLn(); + if (btyp == NIL) { + OPM_LogWStr((CHAR*)"btyp is nil", (LONGINT)12); + OPM_LogWLn(); + } + OPM_LogWStr((CHAR*)"btyp^.strobji^.name = ", (LONGINT)23); + OPM_LogWStr(btyp->strobj->name, ((LONGINT)(256))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"btyp^.form = ", (LONGINT)14); + OPM_LogWNum(btyp->form, ((LONGINT)(0))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"btyp^.comp = ", (LONGINT)14); + OPM_LogWNum(btyp->comp, ((LONGINT)(0))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"btyp^.mno = ", (LONGINT)13); + OPM_LogWNum(btyp->mno, ((LONGINT)(0))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"btyp^.extlev = ", (LONGINT)16); + OPM_LogWNum(btyp->extlev, ((LONGINT)(0))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"btyp^.size = ", (LONGINT)14); + OPM_LogWNum(btyp->size, ((LONGINT)(0))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"btyp^.align = ", (LONGINT)15); + OPM_LogWNum(btyp->align, ((LONGINT)(0))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"btyp^.txtpos = ", (LONGINT)16); + OPM_LogWNum(btyp->txtpos, ((LONGINT)(0))); + OPM_LogWLn(); +} + +static void OPT_FPrintSign (LONGINT *fp, OPT_Struct result, OPT_Object par) +{ + OPT_IdFPrint(result); + OPM_FPrint(&*fp, result->idfp); + while (par != NIL) { + OPM_FPrint(&*fp, par->mode); + OPT_IdFPrint(par->typ); + OPM_FPrint(&*fp, par->typ->idfp); + par = par->link; + } +} + +void OPT_IdFPrint (OPT_Struct typ) +{ + OPT_Struct btyp = NIL; + OPT_Object strobj = NIL; + LONGINT idfp; + INTEGER f, c; + if (!typ->idfpdone) { + typ->idfpdone = 1; + idfp = 0; + f = typ->form; + c = typ->comp; + OPM_FPrint(&idfp, f); + OPM_FPrint(&idfp, c); + btyp = typ->BaseTyp; + strobj = typ->strobj; + if ((strobj != NIL && strobj->name[0] != 0x00)) { + OPT_FPrintName(&idfp, (void*)OPT_GlbMod[__X(typ->mno, ((LONGINT)(64)))]->name, ((LONGINT)(256))); + OPT_FPrintName(&idfp, (void*)strobj->name, ((LONGINT)(256))); + } + if ((f == 13 || (c == 4 && btyp != NIL)) || c == 3) { + OPT_IdFPrint(btyp); + OPM_FPrint(&idfp, btyp->idfp); + } else if (c == 2) { + OPT_IdFPrint(btyp); + OPM_FPrint(&idfp, btyp->idfp); + OPM_FPrint(&idfp, typ->n); + } else if (f == 14) { + OPT_FPrintSign(&idfp, btyp, typ->link); + } + typ->idfp = idfp; + } +} + +static struct FPrintStr__12 { + LONGINT *pbfp, *pvfp; + struct FPrintStr__12 *lnk; +} *FPrintStr__12_s; + +static void FPrintFlds__13 (OPT_Object fld, LONGINT adr, BOOLEAN visible); +static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr); +static void FPrintTProcs__17 (OPT_Object obj); + +static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr) +{ + LONGINT i, j, n; + OPT_Struct btyp = NIL; + if (typ->comp == 4) { + FPrintFlds__13(typ->link, adr, 0); + } else if (typ->comp == 2) { + btyp = typ->BaseTyp; + n = typ->n; + while (btyp->comp == 2) { + n = btyp->n * n; + btyp = btyp->BaseTyp; + } + if (btyp->form == 13 || btyp->comp == 4) { + j = OPT_nofhdfld; + FPrintHdFld__15(btyp, fld, adr); + if (j != OPT_nofhdfld) { + i = 1; + while ((i < n && OPT_nofhdfld <= 2048)) { + adr += btyp->size; + FPrintHdFld__15(btyp, fld, adr); + i += 1; + } + } + } + } else if (typ->form == 13 || __STRCMP(fld->name, "@ptr") == 0) { + OPM_FPrint(&*FPrintStr__12_s->pvfp, ((LONGINT)(13))); + OPM_FPrint(&*FPrintStr__12_s->pvfp, adr); + OPT_nofhdfld += 1; + } +} + +static void FPrintFlds__13 (OPT_Object fld, LONGINT adr, BOOLEAN visible) +{ + while ((fld != NIL && fld->mode == 4)) { + if ((fld->vis != 0 && visible)) { + OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->vis); + OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)fld->name, ((LONGINT)(256))); + OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->adr); + OPT_FPrintStr(fld->typ); + OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->typ->pbfp); + OPM_FPrint(&*FPrintStr__12_s->pvfp, fld->typ->pvfp); + } else { + FPrintHdFld__15(fld->typ, fld, fld->adr + adr); + } + fld = fld->link; + } +} + +static void FPrintTProcs__17 (OPT_Object obj) +{ + if (obj != NIL) { + FPrintTProcs__17(obj->left); + if (obj->mode == 13) { + if (obj->vis != 0) { + OPM_FPrint(&*FPrintStr__12_s->pbfp, ((LONGINT)(13))); + OPM_FPrint(&*FPrintStr__12_s->pbfp, __ASHR(obj->adr, 16)); + OPT_FPrintSign(&*FPrintStr__12_s->pbfp, obj->typ, obj->link); + OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)obj->name, ((LONGINT)(256))); + } + } + FPrintTProcs__17(obj->right); + } +} + +void OPT_FPrintStr (OPT_Struct typ) +{ + INTEGER f, c; + OPT_Struct btyp = NIL; + OPT_Object strobj = NIL, bstrobj = NIL; + LONGINT pbfp, pvfp; + struct FPrintStr__12 _s; + _s.pbfp = &pbfp; + _s.pvfp = &pvfp; + _s.lnk = FPrintStr__12_s; + FPrintStr__12_s = &_s; + if (!typ->fpdone) { + OPT_IdFPrint(typ); + pbfp = typ->idfp; + if (typ->sysflag != 0) { + OPM_FPrint(&pbfp, typ->sysflag); + } + pvfp = pbfp; + typ->pbfp = pbfp; + typ->pvfp = pvfp; + typ->fpdone = 1; + f = typ->form; + c = typ->comp; + btyp = typ->BaseTyp; + if (f == 13) { + strobj = typ->strobj; + bstrobj = btyp->strobj; + if (((strobj == NIL || strobj->name[0] == 0x00) || bstrobj == NIL) || bstrobj->name[0] == 0x00) { + OPT_FPrintStr(btyp); + OPM_FPrint(&pbfp, btyp->pbfp); + pvfp = pbfp; + } + } else if (f == 14) { + } else if (__IN(c, 0x0c)) { + OPT_FPrintStr(btyp); + OPM_FPrint(&pbfp, btyp->pvfp); + pvfp = pbfp; + } else { + if (btyp != NIL) { + OPT_FPrintStr(btyp); + OPM_FPrint(&pbfp, btyp->pbfp); + OPM_FPrint(&pvfp, btyp->pvfp); + } + OPM_FPrint(&pvfp, typ->size); + OPM_FPrint(&pvfp, typ->align); + OPM_FPrint(&pvfp, typ->n); + OPT_nofhdfld = 0; + FPrintFlds__13(typ->link, ((LONGINT)(0)), 1); + if (OPT_nofhdfld > 2048) { + OPM_Mark(225, typ->txtpos); + } + FPrintTProcs__17(typ->link); + OPM_FPrint(&pvfp, pbfp); + strobj = typ->strobj; + if (strobj == NIL || strobj->name[0] == 0x00) { + pbfp = pvfp; + } + } + typ->pbfp = pbfp; + typ->pvfp = pvfp; + } + FPrintStr__12_s = _s.lnk; +} + +void OPT_FPrintObj (OPT_Object obj) +{ + LONGINT fprint; + INTEGER f, m; + REAL rval; + OPT_ConstExt ext = NIL; + if (!obj->fpdone) { + fprint = 0; + obj->fpdone = 1; + OPM_FPrint(&fprint, obj->mode); + if (obj->mode == 3) { + f = obj->typ->form; + OPM_FPrint(&fprint, f); + switch (f) { + case 2: case 3: case 4: case 5: case 6: + OPM_FPrint(&fprint, obj->conval->intval); + break; + case 9: + OPM_FPrintSet(&fprint, obj->conval->setval); + break; + case 7: + rval = obj->conval->realval; + OPM_FPrintReal(&fprint, rval); + break; + case 8: + OPM_FPrintLReal(&fprint, obj->conval->realval); + break; + case 10: + OPT_FPrintName(&fprint, (void*)*obj->conval->ext, ((LONGINT)(256))); + break; + case 11: + break; + default: + OPT_err(127); + break; + } + } else if (obj->mode == 1) { + OPM_FPrint(&fprint, obj->vis); + OPT_FPrintStr(obj->typ); + OPM_FPrint(&fprint, obj->typ->pbfp); + } else if (__IN(obj->mode, 0x0480)) { + OPT_FPrintSign(&fprint, obj->typ, obj->link); + } else if (obj->mode == 9) { + OPT_FPrintSign(&fprint, obj->typ, obj->link); + ext = obj->conval->ext; + m = (int)(*ext)[0]; + f = 1; + OPM_FPrint(&fprint, m); + while (f <= m) { + OPM_FPrint(&fprint, (int)(*ext)[__X(f, ((LONGINT)(256)))]); + f += 1; + } + } else if (obj->mode == 5) { + OPT_FPrintStr(obj->typ); + OPM_FPrint(&fprint, obj->typ->pbfp); + } + obj->fprint = fprint; + } +} + +void OPT_FPrintErr (OPT_Object obj, INTEGER errcode) +{ + INTEGER i, j; + CHAR ch; + if (obj->mnolev != 0) { + __COPY(OPT_GlbMod[__X(-obj->mnolev, ((LONGINT)(64)))]->name, OPM_objname, ((LONGINT)(64))); + i = 0; + while (OPM_objname[__X(i, ((LONGINT)(64)))] != 0x00) { + i += 1; + } + OPM_objname[__X(i, ((LONGINT)(64)))] = '.'; + j = 0; + i += 1; + do { + ch = obj->name[__X(j, ((LONGINT)(256)))]; + OPM_objname[__X(i, ((LONGINT)(64)))] = ch; + j += 1; + i += 1; + } while (!(ch == 0x00)); + } else { + __COPY(obj->name, OPM_objname, ((LONGINT)(64))); + } + if (errcode == 249) { + if (OPM_noerr) { + OPT_err(errcode); + } + } else if (errcode == 253) { + if ((((!OPT_symNew && !OPT_symExtended)) && !OPT_extsf)) { + OPT_err(errcode); + } + OPT_symExtended = 1; + } else { + if ((!OPT_symNew && !OPT_newsf)) { + OPT_err(errcode); + } + OPT_symNew = 1; + } +} + +void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old) +{ + OPT_Object ob0 = NIL, ob1 = NIL; + BOOLEAN left; + if (*root == NIL) { + *root = obj; + *old = NIL; + } else { + ob0 = *root; + ob1 = ob0->right; + left = 0; + if (__STRCMP(obj->name, ob0->name) < 0) { + ob1 = ob0->left; + left = 1; + } else if (__STRCMP(obj->name, ob0->name) > 0) { + ob1 = ob0->right; + left = 0; + } else { + *old = ob0; + return; + } + for (;;) { + if (ob1 != NIL) { + if (__STRCMP(obj->name, ob1->name) < 0) { + ob0 = ob1; + ob1 = ob1->left; + left = 1; + } else if (__STRCMP(obj->name, ob1->name) > 0) { + ob0 = ob1; + ob1 = ob1->right; + left = 0; + } else { + *old = ob1; + break; + } + } else { + ob1 = obj; + if (left) { + ob0->left = ob1; + } else { + ob0->right = ob1; + } + ob1->left = NIL; + ob1->right = NIL; + *old = NIL; + break; + } + } + } +} + +static void OPT_InName (CHAR *name, LONGINT name__len) +{ + INTEGER i; + CHAR ch; + i = 0; + do { + OPM_SymRCh(&ch); + name[__X(i, name__len)] = ch; + i += 1; + } while (!(ch == 0x00)); +} + +static void OPT_InMod (SHORTINT *mno) +{ + OPT_Object head = NIL; + OPS_Name name; + LONGINT mn; + SHORTINT i; + mn = OPM_SymRInt(); + if (mn == 0) { + *mno = OPT_impCtxt.glbmno[0]; + } else { + if (mn == 16) { + OPT_InName((void*)name, ((LONGINT)(256))); + if ((__STRCMP(name, OPT_SelfName) == 0 && !OPT_impCtxt.self)) { + OPT_err(154); + } + i = 0; + while ((i < OPT_nofGmod && __STRCMP(name, OPT_GlbMod[__X(i, ((LONGINT)(64)))]->name) != 0)) { + i += 1; + } + if (i < OPT_nofGmod) { + *mno = i; + } else { + head = OPT_NewObj(); + head->mode = 12; + __COPY(name, head->name, ((LONGINT)(256))); + *mno = OPT_nofGmod; + head->mnolev = -*mno; + if (OPT_nofGmod < 64) { + OPT_GlbMod[__X(*mno, ((LONGINT)(64)))] = head; + OPT_nofGmod += 1; + } else { + OPT_err(227); + } + } + OPT_impCtxt.glbmno[__X(OPT_impCtxt.nofm, ((LONGINT)(64)))] = *mno; + OPT_impCtxt.nofm += 1; + } else { + *mno = OPT_impCtxt.glbmno[__X(-mn, ((LONGINT)(64)))]; + } + } +} + +static void OPT_InConstant (LONGINT f, OPT_Const conval) +{ + CHAR ch; + INTEGER i; + OPT_ConstExt ext = NIL; + REAL rval; + switch (f) { + case 1: case 3: case 2: + OPM_SymRCh(&ch); + conval->intval = (int)ch; + break; + case 4: case 5: case 6: + conval->intval = OPM_SymRInt(); + break; + case 9: + OPM_SymRSet(&conval->setval); + break; + case 7: + OPM_SymRReal(&rval); + conval->realval = rval; + conval->intval = -1; + break; + case 8: + OPM_SymRLReal(&conval->realval); + conval->intval = -1; + break; + case 10: + ext = OPT_NewExt(); + conval->ext = ext; + i = 0; + do { + OPM_SymRCh(&ch); + (*ext)[__X(i, ((LONGINT)(256)))] = ch; + i += 1; + } while (!(ch == 0x00)); + conval->intval2 = i; + conval->intval = -1; + break; + case 11: + conval->intval = 0; + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPT.InConstant(), f = ", (LONGINT)41); + OPM_LogWNum(f, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } +} + +static void OPT_InSign (SHORTINT mno, OPT_Struct *res, OPT_Object *par) +{ + OPT_Object last = NIL, new = NIL; + LONGINT tag; + OPT_InStruct(&*res); + tag = OPM_SymRInt(); + last = NIL; + while (tag != 18) { + new = OPT_NewObj(); + new->mnolev = -mno; + if (last == NIL) { + *par = new; + } else { + last->link = new; + } + if (tag == 23) { + new->mode = 1; + } else { + new->mode = 2; + } + OPT_InStruct(&new->typ); + new->adr = OPM_SymRInt(); + OPT_InName((void*)new->name, ((LONGINT)(256))); + last = new; + tag = OPM_SymRInt(); + } +} + +static OPT_Object OPT_InFld (void) +{ + OPT_Object _o_result; + LONGINT tag; + OPT_Object obj = NIL; + tag = OPT_impCtxt.nextTag; + obj = OPT_NewObj(); + if (tag <= 26) { + obj->mode = 4; + if (tag == 26) { + obj->vis = 2; + } else { + obj->vis = 1; + } + OPT_InStruct(&obj->typ); + OPT_InName((void*)obj->name, ((LONGINT)(256))); + obj->adr = OPM_SymRInt(); + } else { + obj->mode = 4; + if (tag == 27) { + __MOVE("@ptr", obj->name, 5); + } else { + __MOVE("@proc", obj->name, 6); + } + obj->typ = OPT_undftyp; + obj->vis = 0; + obj->adr = OPM_SymRInt(); + } + _o_result = obj; + return _o_result; +} + +static OPT_Object OPT_InTProc (SHORTINT mno) +{ + OPT_Object _o_result; + LONGINT tag; + OPT_Object obj = NIL; + tag = OPT_impCtxt.nextTag; + obj = OPT_NewObj(); + obj->mnolev = -mno; + if (tag == 29) { + obj->mode = 13; + obj->conval = OPT_NewConst(); + obj->conval->intval = -1; + OPT_InSign(mno, &obj->typ, &obj->link); + obj->vis = 1; + OPT_InName((void*)obj->name, ((LONGINT)(256))); + obj->adr = __ASHL(OPM_SymRInt(), 16); + } else { + obj->mode = 13; + __MOVE("@tproc", obj->name, 7); + obj->link = OPT_NewObj(); + obj->typ = OPT_undftyp; + obj->vis = 0; + obj->adr = __ASHL(OPM_SymRInt(), 16); + } + _o_result = obj; + return _o_result; +} + +static void OPT_InStruct (OPT_Struct *typ) +{ + SHORTINT mno; + INTEGER ref; + LONGINT tag; + OPS_Name name; + OPT_Struct t = NIL; + OPT_Object obj = NIL, last = NIL, fld = NIL, old = NIL, dummy = NIL; + tag = OPM_SymRInt(); + if (tag != 34) { + *typ = OPT_impCtxt.ref[__X(-tag, ((LONGINT)(255)))]; + } else { + ref = OPT_impCtxt.nofr; + OPT_impCtxt.nofr += 1; + if (ref < OPT_impCtxt.minr) { + OPT_impCtxt.minr = ref; + } + OPT_InMod(&mno); + OPT_InName((void*)name, ((LONGINT)(256))); + obj = OPT_NewObj(); + if (name[0] == 0x00) { + if (OPT_impCtxt.self) { + old = NIL; + } else { + __MOVE("@", obj->name, 2); + OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->right, &old); + obj->name[0] = 0x00; + } + *typ = OPT_NewStr(0, 1); + } else { + __COPY(name, obj->name, ((LONGINT)(256))); + OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->right, &old); + if (old != NIL) { + OPT_FPrintObj(old); + OPT_impCtxt.pvfp[__X(ref, ((LONGINT)(255)))] = old->typ->pvfp; + if (OPT_impCtxt.self) { + *typ = OPT_NewStr(0, 1); + } else { + *typ = old->typ; + (*typ)->link = NIL; + (*typ)->sysflag = 0; + (*typ)->fpdone = 0; + (*typ)->idfpdone = 0; + } + } else { + *typ = OPT_NewStr(0, 1); + } + } + OPT_impCtxt.ref[__X(ref, ((LONGINT)(255)))] = *typ; + OPT_impCtxt.old[__X(ref, ((LONGINT)(255)))] = old; + (*typ)->ref = ref + 255; + (*typ)->mno = mno; + (*typ)->allocated = 1; + (*typ)->strobj = obj; + obj->mode = 5; + obj->typ = *typ; + obj->mnolev = -mno; + obj->vis = 0; + tag = OPM_SymRInt(); + if (tag == 35) { + (*typ)->sysflag = (int)OPM_SymRInt(); + tag = OPM_SymRInt(); + } + switch (tag) { + case 36: + (*typ)->form = 13; + (*typ)->size = OPM_PointerSize; + (*typ)->n = 0; + OPT_InStruct(&(*typ)->BaseTyp); + break; + case 37: + (*typ)->form = 15; + (*typ)->comp = 2; + OPT_InStruct(&(*typ)->BaseTyp); + (*typ)->n = OPM_SymRInt(); + (*OPT_typSize)(*typ); + break; + case 38: + (*typ)->form = 15; + (*typ)->comp = 3; + OPT_InStruct(&(*typ)->BaseTyp); + if ((*typ)->BaseTyp->comp == 3) { + (*typ)->n = (*typ)->BaseTyp->n + 1; + } else { + (*typ)->n = 0; + } + (*OPT_typSize)(*typ); + break; + case 39: + (*typ)->form = 15; + (*typ)->comp = 4; + OPT_InStruct(&(*typ)->BaseTyp); + if ((*typ)->BaseTyp == OPT_notyp) { + (*typ)->BaseTyp = NIL; + } + (*typ)->extlev = 0; + t = (*typ)->BaseTyp; + while (t != NIL) { + (*typ)->extlev += 1; + t = t->BaseTyp; + } + (*typ)->size = OPM_SymRInt(); + (*typ)->align = OPM_SymRInt(); + (*typ)->n = OPM_SymRInt(); + OPT_impCtxt.nextTag = OPM_SymRInt(); + last = NIL; + while ((OPT_impCtxt.nextTag >= 25 && OPT_impCtxt.nextTag <= 28)) { + fld = OPT_InFld(); + fld->mnolev = -mno; + if (last != NIL) { + last->link = fld; + } + last = fld; + OPT_InsertImport(fld, &(*typ)->link, &dummy); + OPT_impCtxt.nextTag = OPM_SymRInt(); + } + while (OPT_impCtxt.nextTag != 18) { + fld = OPT_InTProc(mno); + OPT_InsertImport(fld, &(*typ)->link, &dummy); + OPT_impCtxt.nextTag = OPM_SymRInt(); + } + break; + case 40: + (*typ)->form = 14; + (*typ)->size = OPM_ProcSize; + OPT_InSign(mno, &(*typ)->BaseTyp, &(*typ)->link); + break; + default: + OPM_LogWStr((CHAR*)"unhandled case at OPT.InStruct, tag = ", (LONGINT)39); + OPM_LogWNum(tag, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + if (ref == OPT_impCtxt.minr) { + while (ref < OPT_impCtxt.nofr) { + t = OPT_impCtxt.ref[__X(ref, ((LONGINT)(255)))]; + OPT_FPrintStr(t); + obj = t->strobj; + if (obj->name[0] != 0x00) { + OPT_FPrintObj(obj); + } + old = OPT_impCtxt.old[__X(ref, ((LONGINT)(255)))]; + if (old != NIL) { + t->strobj = old; + if (OPT_impCtxt.self) { + if (old->mnolev < 0) { + if (old->history != 5) { + if (old->fprint != obj->fprint) { + old->history = 2; + } else if (OPT_impCtxt.pvfp[__X(ref, ((LONGINT)(255)))] != t->pvfp) { + old->history = 3; + } + } + } else if (old->fprint != obj->fprint) { + old->history = 2; + } else if (OPT_impCtxt.pvfp[__X(ref, ((LONGINT)(255)))] != t->pvfp) { + old->history = 3; + } else if (old->vis == 0) { + old->history = 1; + } else { + old->history = 0; + } + } else { + if (OPT_impCtxt.pvfp[__X(ref, ((LONGINT)(255)))] != t->pvfp) { + old->history = 5; + } + if (old->fprint != obj->fprint) { + OPT_FPrintErr(old, 249); + } + } + } else if (OPT_impCtxt.self) { + obj->history = 4; + } else { + obj->history = 1; + } + ref += 1; + } + OPT_impCtxt.minr = 255; + } + } +} + +static OPT_Object OPT_InObj (SHORTINT mno) +{ + OPT_Object _o_result; + INTEGER i, s; + CHAR ch; + OPT_Object obj = NIL, old = NIL; + OPT_Struct typ = NIL; + LONGINT tag; + OPT_ConstExt ext = NIL; + tag = OPT_impCtxt.nextTag; + if (tag == 19) { + OPT_InStruct(&typ); + obj = typ->strobj; + if (!OPT_impCtxt.self) { + obj->vis = 1; + } + } else { + obj = OPT_NewObj(); + obj->mnolev = -mno; + obj->vis = 1; + if (tag <= 13) { + obj->mode = 3; + obj->typ = OPT_impCtxt.ref[__X(tag, ((LONGINT)(255)))]; + obj->conval = OPT_NewConst(); + OPT_InConstant(tag, obj->conval); + } else if (tag >= 31) { + obj->conval = OPT_NewConst(); + obj->conval->intval = -1; + OPT_InSign(mno, &obj->typ, &obj->link); + switch (tag) { + case 31: + obj->mode = 7; + break; + case 32: + obj->mode = 10; + break; + case 33: + obj->mode = 9; + ext = OPT_NewExt(); + obj->conval->ext = ext; + s = (int)OPM_SymRInt(); + (*ext)[0] = (CHAR)s; + i = 1; + while (i <= s) { + OPM_SymRCh(&(*ext)[__X(i, ((LONGINT)(256)))]); + i += 1; + } + break; + default: + OPM_LogWStr((CHAR*)"unhandled case at OPT.InObj, tag = ", (LONGINT)36); + OPM_LogWNum(tag, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + } else if (tag == 20) { + obj->mode = 5; + OPT_InStruct(&obj->typ); + } else { + obj->mode = 1; + if (tag == 22) { + obj->vis = 2; + } + OPT_InStruct(&obj->typ); + } + OPT_InName((void*)obj->name, ((LONGINT)(256))); + } + OPT_FPrintObj(obj); + if ((obj->mode == 1 && (obj->typ->strobj == NIL || obj->typ->strobj->name[0] == 0x00))) { + OPM_FPrint(&OPT_impCtxt.reffp, obj->typ->ref - 255); + } + if (tag != 19) { + OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->right, &old); + if (OPT_impCtxt.self) { + if (old != NIL) { + if (old->vis == 0) { + old->history = 4; + } else { + OPT_FPrintObj(old); + if (obj->fprint != old->fprint) { + old->history = 2; + } else if (obj->typ->pvfp != old->typ->pvfp) { + old->history = 3; + } else { + old->history = 1; + } + } + } else { + obj->history = 4; + } + } + } else { + if (OPT_impCtxt.self) { + if (obj->vis == 0) { + obj->history = 4; + } else if (obj->history == 0) { + obj->history = 1; + } + } + } + _o_result = obj; + return _o_result; +} + +void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) +{ + OPT_Object obj = NIL; + SHORTINT mno; + OPS_Name aliasName__copy; + __DUPARR(aliasName, OPS_Name); + if (__STRCMP(name, "SYSTEM") == 0) { + OPT_SYSimported = 1; + OPT_Insert(aliasName, &obj); + obj->mode = 11; + obj->mnolev = 0; + obj->scope = OPT_syslink; + obj->typ = OPT_notyp; + } else { + OPT_impCtxt.nofr = 16; + OPT_impCtxt.minr = 255; + OPT_impCtxt.nofm = 0; + OPT_impCtxt.self = __STRCMP(aliasName, "@self") == 0; + OPT_impCtxt.reffp = 0; + OPM_OldSym((void*)name, ((LONGINT)(256)), &*done); + if (*done) { + OPT_InMod(&mno); + OPT_impCtxt.nextTag = OPM_SymRInt(); + while (!OPM_eofSF()) { + obj = OPT_InObj(mno); + OPT_impCtxt.nextTag = OPM_SymRInt(); + } + OPT_Insert(aliasName, &obj); + obj->mode = 11; + obj->scope = OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->right; + OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->link = obj; + obj->mnolev = -mno; + obj->typ = OPT_notyp; + OPM_CloseOldSym(); + } else if (OPT_impCtxt.self) { + OPT_newsf = 1; + OPT_extsf = 1; + OPT_sfpresent = 0; + } else { + OPT_err(152); + } + } +} + +static void OPT_OutName (CHAR *name, LONGINT name__len) +{ + INTEGER i; + CHAR ch; + i = 0; + do { + ch = name[__X(i, name__len)]; + OPM_SymWCh(ch); + i += 1; + } while (!(ch == 0x00)); +} + +static void OPT_OutMod (INTEGER mno) +{ + if (OPT_expCtxt.locmno[__X(mno, ((LONGINT)(64)))] < 0) { + OPM_SymWInt(((LONGINT)(16))); + OPT_expCtxt.locmno[__X(mno, ((LONGINT)(64)))] = OPT_expCtxt.nofm; + OPT_expCtxt.nofm += 1; + OPT_OutName((void*)OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->name, ((LONGINT)(256))); + } else { + OPM_SymWInt(-OPT_expCtxt.locmno[__X(mno, ((LONGINT)(64)))]); + } +} + +static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, LONGINT adr) +{ + LONGINT i, j, n; + OPT_Struct btyp = NIL; + if (typ->comp == 4) { + OPT_OutFlds(typ->link, adr, 0); + } else if (typ->comp == 2) { + btyp = typ->BaseTyp; + n = typ->n; + while (btyp->comp == 2) { + n = btyp->n * n; + btyp = btyp->BaseTyp; + } + if (btyp->form == 13 || btyp->comp == 4) { + j = OPT_nofhdfld; + OPT_OutHdFld(btyp, fld, adr); + if (j != OPT_nofhdfld) { + i = 1; + while ((i < n && OPT_nofhdfld <= 2048)) { + adr += btyp->size; + OPT_OutHdFld(btyp, fld, adr); + i += 1; + } + } + } + } else if (typ->form == 13 || __STRCMP(fld->name, "@ptr") == 0) { + OPM_SymWInt(((LONGINT)(27))); + OPM_SymWInt(adr); + OPT_nofhdfld += 1; + } +} + +static void OPT_OutFlds (OPT_Object fld, LONGINT adr, BOOLEAN visible) +{ + while ((fld != NIL && fld->mode == 4)) { + if ((fld->vis != 0 && visible)) { + if (fld->vis == 2) { + OPM_SymWInt(((LONGINT)(26))); + } else { + OPM_SymWInt(((LONGINT)(25))); + } + OPT_OutStr(fld->typ); + OPT_OutName((void*)fld->name, ((LONGINT)(256))); + OPM_SymWInt(fld->adr); + } else { + OPT_OutHdFld(fld->typ, fld, fld->adr + adr); + } + fld = fld->link; + } +} + +static void OPT_OutSign (OPT_Struct result, OPT_Object par) +{ + OPT_OutStr(result); + while (par != NIL) { + if (par->mode == 1) { + OPM_SymWInt(((LONGINT)(23))); + } else { + OPM_SymWInt(((LONGINT)(24))); + } + OPT_OutStr(par->typ); + OPM_SymWInt(par->adr); + OPT_OutName((void*)par->name, ((LONGINT)(256))); + par = par->link; + } + OPM_SymWInt(((LONGINT)(18))); +} + +static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj) +{ + if (obj != NIL) { + OPT_OutTProcs(typ, obj->left); + if (obj->mode == 13) { + if ((((typ->BaseTyp != NIL && __ASHR(obj->adr, 16) < typ->BaseTyp->n)) && obj->vis == 0)) { + OPM_Mark(109, typ->txtpos); + } + if (obj->vis != 0) { + if (obj->vis != 0) { + OPM_SymWInt(((LONGINT)(29))); + OPT_OutSign(obj->typ, obj->link); + OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPM_SymWInt(__ASHR(obj->adr, 16)); + } else { + OPM_SymWInt(((LONGINT)(30))); + OPM_SymWInt(__ASHR(obj->adr, 16)); + } + } + } + OPT_OutTProcs(typ, obj->right); + } +} + +static void OPT_OutStr (OPT_Struct typ) +{ + OPT_Object strobj = NIL; + if (typ->ref < OPT_expCtxt.ref) { + OPM_SymWInt(-typ->ref); + } else { + OPM_SymWInt(((LONGINT)(34))); + typ->ref = OPT_expCtxt.ref; + OPT_expCtxt.ref += 1; + if (OPT_expCtxt.ref >= 255) { + OPT_err(228); + } + OPT_OutMod(typ->mno); + strobj = typ->strobj; + if ((strobj != NIL && strobj->name[0] != 0x00)) { + OPT_OutName((void*)strobj->name, ((LONGINT)(256))); + switch (strobj->history) { + case 2: + OPT_FPrintErr(strobj, 252); + break; + case 3: + OPT_FPrintErr(strobj, 251); + break; + case 5: + OPT_FPrintErr(strobj, 249); + break; + default: + break; + } + } else { + OPM_SymWCh(0x00); + } + if (typ->sysflag != 0) { + OPM_SymWInt(((LONGINT)(35))); + OPM_SymWInt(typ->sysflag); + } + switch (typ->form) { + case 13: + OPM_SymWInt(((LONGINT)(36))); + OPT_OutStr(typ->BaseTyp); + break; + case 14: + OPM_SymWInt(((LONGINT)(40))); + OPT_OutSign(typ->BaseTyp, typ->link); + break; + case 15: + switch (typ->comp) { + case 2: + OPM_SymWInt(((LONGINT)(37))); + OPT_OutStr(typ->BaseTyp); + OPM_SymWInt(typ->n); + break; + case 3: + OPM_SymWInt(((LONGINT)(38))); + OPT_OutStr(typ->BaseTyp); + break; + case 4: + OPM_SymWInt(((LONGINT)(39))); + if (typ->BaseTyp == NIL) { + OPT_OutStr(OPT_notyp); + } else { + OPT_OutStr(typ->BaseTyp); + } + OPM_SymWInt(typ->size); + OPM_SymWInt(typ->align); + OPM_SymWInt(typ->n); + OPT_nofhdfld = 0; + OPT_OutFlds(typ->link, ((LONGINT)(0)), 1); + if (OPT_nofhdfld > 2048) { + OPM_Mark(223, typ->txtpos); + } + OPT_OutTProcs(typ, typ->link); + OPM_SymWInt(((LONGINT)(18))); + break; + default: + OPM_LogWStr((CHAR*)"unhandled case at OPT.OutStr, typ^.comp = ", (LONGINT)43); + OPM_LogWNum(typ->comp, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + break; + default: + OPM_LogWStr((CHAR*)"unhandled case at OPT.OutStr, typ^.form = ", (LONGINT)43); + OPM_LogWNum(typ->form, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + } +} + +static void OPT_OutConstant (OPT_Object obj) +{ + INTEGER f; + REAL rval; + f = obj->typ->form; + OPM_SymWInt(f); + switch (f) { + case 2: case 3: + OPM_SymWCh((CHAR)obj->conval->intval); + break; + case 4: case 5: case 6: + OPM_SymWInt(obj->conval->intval); + break; + case 9: + OPM_SymWSet(obj->conval->setval); + break; + case 7: + rval = obj->conval->realval; + OPM_SymWReal(rval); + break; + case 8: + OPM_SymWLReal(obj->conval->realval); + break; + case 10: + OPT_OutName((void*)*obj->conval->ext, ((LONGINT)(256))); + break; + case 11: + break; + default: + OPT_err(127); + break; + } +} + +static void OPT_OutObj (OPT_Object obj) +{ + INTEGER i, j; + OPT_ConstExt ext = NIL; + if (obj != NIL) { + OPT_OutObj(obj->left); + if (__IN(obj->mode, 0x06ea)) { + if (obj->history == 4) { + OPT_FPrintErr(obj, 250); + } else if (obj->vis != 0) { + switch (obj->history) { + case 0: + OPT_FPrintErr(obj, 253); + break; + case 1: + break; + case 2: + OPT_FPrintErr(obj, 252); + break; + case 3: + OPT_FPrintErr(obj, 251); + break; + default: + OPM_LogWStr((CHAR*)"unhandled case at OPT.OutObj, obj^.history = ", (LONGINT)46); + OPM_LogWNum(obj->history, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + switch (obj->mode) { + case 3: + OPT_OutConstant(obj); + OPT_OutName((void*)obj->name, ((LONGINT)(256))); + break; + case 5: + if (obj->typ->strobj == obj) { + OPM_SymWInt(((LONGINT)(19))); + OPT_OutStr(obj->typ); + } else { + OPM_SymWInt(((LONGINT)(20))); + OPT_OutStr(obj->typ); + OPT_OutName((void*)obj->name, ((LONGINT)(256))); + } + break; + case 1: + if (obj->vis == 2) { + OPM_SymWInt(((LONGINT)(22))); + } else { + OPM_SymWInt(((LONGINT)(21))); + } + OPT_OutStr(obj->typ); + OPT_OutName((void*)obj->name, ((LONGINT)(256))); + if (obj->typ->strobj == NIL || obj->typ->strobj->name[0] == 0x00) { + OPM_FPrint(&OPT_expCtxt.reffp, obj->typ->ref); + } + break; + case 7: + OPM_SymWInt(((LONGINT)(31))); + OPT_OutSign(obj->typ, obj->link); + OPT_OutName((void*)obj->name, ((LONGINT)(256))); + break; + case 10: + OPM_SymWInt(((LONGINT)(32))); + OPT_OutSign(obj->typ, obj->link); + OPT_OutName((void*)obj->name, ((LONGINT)(256))); + break; + case 9: + OPM_SymWInt(((LONGINT)(33))); + OPT_OutSign(obj->typ, obj->link); + ext = obj->conval->ext; + j = (int)(*ext)[0]; + i = 1; + OPM_SymWInt(j); + while (i <= j) { + OPM_SymWCh((*ext)[__X(i, ((LONGINT)(256)))]); + i += 1; + } + OPT_OutName((void*)obj->name, ((LONGINT)(256))); + break; + default: + OPM_LogWStr((CHAR*)"unhandled case at OPT.OutObj, obj.mode = ", (LONGINT)42); + OPM_LogWNum(obj->mode, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + } + } + OPT_OutObj(obj->right); + } +} + +void OPT_Export (BOOLEAN *ext, BOOLEAN *new) +{ + INTEGER i; + SHORTINT nofmod; + BOOLEAN done; + OPT_symExtended = 0; + OPT_symNew = 0; + nofmod = OPT_nofGmod; + OPT_Import((CHAR*)"@self", OPT_SelfName, &done); + OPT_nofGmod = nofmod; + if (OPM_noerr) { + OPM_NewSym((void*)OPT_SelfName, ((LONGINT)(256))); + if (OPM_noerr) { + OPM_SymWInt(((LONGINT)(16))); + OPT_OutName((void*)OPT_SelfName, ((LONGINT)(256))); + OPT_expCtxt.reffp = 0; + OPT_expCtxt.ref = 16; + OPT_expCtxt.nofm = 1; + OPT_expCtxt.locmno[0] = 0; + i = 1; + while (i < 64) { + OPT_expCtxt.locmno[__X(i, ((LONGINT)(64)))] = -1; + i += 1; + } + OPT_OutObj(OPT_topScope->right); + *ext = (OPT_sfpresent && OPT_symExtended); + *new = !OPT_sfpresent || OPT_symNew; + if (OPM_forceNewSym) { + *new = 1; + } + if ((((OPM_noerr && OPT_sfpresent)) && OPT_impCtxt.reffp != OPT_expCtxt.reffp)) { + *new = 1; + if (!OPT_extsf) { + OPT_err(155); + } + } + OPT_newsf = 0; + OPT_symNew = 0; + if (!OPM_noerr || OPT_findpc) { + OPM_DeleteNewSym(); + } + } + } +} + +static void OPT_InitStruct (OPT_Struct *typ, SHORTINT form) +{ + *typ = OPT_NewStr(form, 1); + (*typ)->ref = form; + (*typ)->size = OPM_ByteSize; + (*typ)->allocated = 1; + (*typ)->strobj = OPT_NewObj(); + (*typ)->pbfp = form; + (*typ)->pvfp = form; + (*typ)->fpdone = 1; + (*typ)->idfp = form; + (*typ)->idfpdone = 1; +} + +static void OPT_EnterBoolConst (OPS_Name name, LONGINT value) +{ + OPT_Object obj = NIL; + OPS_Name name__copy; + __DUPARR(name, OPS_Name); + OPT_Insert(name, &obj); + obj->conval = OPT_NewConst(); + obj->mode = 3; + obj->typ = OPT_booltyp; + obj->conval->intval = value; +} + +static void OPT_EnterTyp (OPS_Name name, SHORTINT form, INTEGER size, OPT_Struct *res) +{ + OPT_Object obj = NIL; + OPT_Struct typ = NIL; + OPS_Name name__copy; + __DUPARR(name, OPS_Name); + OPT_Insert(name, &obj); + typ = OPT_NewStr(form, 1); + obj->mode = 5; + obj->typ = typ; + obj->vis = 1; + typ->strobj = obj; + typ->size = size; + typ->ref = form; + typ->allocated = 1; + typ->pbfp = form; + typ->pvfp = form; + typ->fpdone = 1; + typ->idfp = form; + typ->idfpdone = 1; + *res = typ; +} + +static void OPT_EnterProc (OPS_Name name, INTEGER num) +{ + OPT_Object obj = NIL; + OPS_Name name__copy; + __DUPARR(name, OPS_Name); + OPT_Insert(name, &obj); + obj->mode = 8; + obj->typ = OPT_notyp; + obj->adr = num; +} + +static void EnumPtrs(void (*P)(void*)) +{ + P(OPT_topScope); + P(OPT_undftyp); + P(OPT_bytetyp); + P(OPT_booltyp); + P(OPT_chartyp); + P(OPT_sinttyp); + P(OPT_inttyp); + P(OPT_linttyp); + P(OPT_realtyp); + P(OPT_lrltyp); + P(OPT_settyp); + P(OPT_stringtyp); + P(OPT_niltyp); + P(OPT_notyp); + P(OPT_sysptrtyp); + __ENUMP(OPT_GlbMod, 64, P); + P(OPT_universe); + P(OPT_syslink); + __ENUMR(&OPT_impCtxt, OPT_ImpCtxt__typ, 3140, 1, P); +} + +__TDESC(OPT_ConstDesc, 1, 1) = {__TDFLDS("ConstDesc", 24), {0, -8}}; +__TDESC(OPT_ObjDesc, 1, 6) = {__TDFLDS("ObjDesc", 304), {0, 4, 8, 12, 284, 288, -28}}; +__TDESC(OPT_StrDesc, 1, 3) = {__TDFLDS("StrDesc", 56), {44, 48, 52, -16}}; +__TDESC(OPT_NodeDesc, 1, 6) = {__TDFLDS("NodeDesc", 28), {0, 4, 8, 16, 20, 24, -28}}; +__TDESC(OPT_ImpCtxt, 1, 510) = {__TDFLDS("ImpCtxt", 3140), {16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60, 64, 68, 72, 76, + 80, 84, 88, 92, 96, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, + 144, 148, 152, 156, 160, 164, 168, 172, 176, 180, 184, 188, 192, 196, 200, 204, + 208, 212, 216, 220, 224, 228, 232, 236, 240, 244, 248, 252, 256, 260, 264, 268, + 272, 276, 280, 284, 288, 292, 296, 300, 304, 308, 312, 316, 320, 324, 328, 332, + 336, 340, 344, 348, 352, 356, 360, 364, 368, 372, 376, 380, 384, 388, 392, 396, + 400, 404, 408, 412, 416, 420, 424, 428, 432, 436, 440, 444, 448, 452, 456, 460, + 464, 468, 472, 476, 480, 484, 488, 492, 496, 500, 504, 508, 512, 516, 520, 524, + 528, 532, 536, 540, 544, 548, 552, 556, 560, 564, 568, 572, 576, 580, 584, 588, + 592, 596, 600, 604, 608, 612, 616, 620, 624, 628, 632, 636, 640, 644, 648, 652, + 656, 660, 664, 668, 672, 676, 680, 684, 688, 692, 696, 700, 704, 708, 712, 716, + 720, 724, 728, 732, 736, 740, 744, 748, 752, 756, 760, 764, 768, 772, 776, 780, + 784, 788, 792, 796, 800, 804, 808, 812, 816, 820, 824, 828, 832, 836, 840, 844, + 848, 852, 856, 860, 864, 868, 872, 876, 880, 884, 888, 892, 896, 900, 904, 908, + 912, 916, 920, 924, 928, 932, 936, 940, 944, 948, 952, 956, 960, 964, 968, 972, + 976, 980, 984, 988, 992, 996, 1000, 1004, 1008, 1012, 1016, 1020, 1024, 1028, 1032, 1036, + 1040, 1044, 1048, 1052, 1056, 1060, 1064, 1068, 1072, 1076, 1080, 1084, 1088, 1092, 1096, 1100, + 1104, 1108, 1112, 1116, 1120, 1124, 1128, 1132, 1136, 1140, 1144, 1148, 1152, 1156, 1160, 1164, + 1168, 1172, 1176, 1180, 1184, 1188, 1192, 1196, 1200, 1204, 1208, 1212, 1216, 1220, 1224, 1228, + 1232, 1236, 1240, 1244, 1248, 1252, 1256, 1260, 1264, 1268, 1272, 1276, 1280, 1284, 1288, 1292, + 1296, 1300, 1304, 1308, 1312, 1316, 1320, 1324, 1328, 1332, 1336, 1340, 1344, 1348, 1352, 1356, + 1360, 1364, 1368, 1372, 1376, 1380, 1384, 1388, 1392, 1396, 1400, 1404, 1408, 1412, 1416, 1420, + 1424, 1428, 1432, 1436, 1440, 1444, 1448, 1452, 1456, 1460, 1464, 1468, 1472, 1476, 1480, 1484, + 1488, 1492, 1496, 1500, 1504, 1508, 1512, 1516, 1520, 1524, 1528, 1532, 1536, 1540, 1544, 1548, + 1552, 1556, 1560, 1564, 1568, 1572, 1576, 1580, 1584, 1588, 1592, 1596, 1600, 1604, 1608, 1612, + 1616, 1620, 1624, 1628, 1632, 1636, 1640, 1644, 1648, 1652, 1656, 1660, 1664, 1668, 1672, 1676, + 1680, 1684, 1688, 1692, 1696, 1700, 1704, 1708, 1712, 1716, 1720, 1724, 1728, 1732, 1736, 1740, + 1744, 1748, 1752, 1756, 1760, 1764, 1768, 1772, 1776, 1780, 1784, 1788, 1792, 1796, 1800, 1804, + 1808, 1812, 1816, 1820, 1824, 1828, 1832, 1836, 1840, 1844, 1848, 1852, 1856, 1860, 1864, 1868, + 1872, 1876, 1880, 1884, 1888, 1892, 1896, 1900, 1904, 1908, 1912, 1916, 1920, 1924, 1928, 1932, + 1936, 1940, 1944, 1948, 1952, 1956, 1960, 1964, 1968, 1972, 1976, 1980, 1984, 1988, 1992, 1996, + 2000, 2004, 2008, 2012, 2016, 2020, 2024, 2028, 2032, 2036, 2040, 2044, 2048, 2052, -2044}}; +__TDESC(OPT_ExpCtxt, 1, 0) = {__TDFLDS("ExpCtxt", 72), {-4}}; + +export void *OPT__init(void) +{ + __DEFMOD; + __MODULE_IMPORT(OPM); + __MODULE_IMPORT(OPS); + __REGMOD("OPT", EnumPtrs); + __REGCMD("Close", OPT_Close); + __REGCMD("CloseScope", OPT_CloseScope); + __INITYP(OPT_ConstDesc, OPT_ConstDesc, 0); + __INITYP(OPT_ObjDesc, OPT_ObjDesc, 0); + __INITYP(OPT_StrDesc, OPT_StrDesc, 0); + __INITYP(OPT_NodeDesc, OPT_NodeDesc, 0); + __INITYP(OPT_ImpCtxt, OPT_ImpCtxt, 0); + __INITYP(OPT_ExpCtxt, OPT_ExpCtxt, 0); +/* BEGIN */ + OPT_topScope = NIL; + OPT_OpenScope(0, NIL); + OPM_errpos = 0; + OPT_InitStruct(&OPT_undftyp, 0); + OPT_InitStruct(&OPT_notyp, 12); + OPT_InitStruct(&OPT_stringtyp, 10); + OPT_InitStruct(&OPT_niltyp, 11); + OPT_undftyp->BaseTyp = OPT_undftyp; + OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp); + OPT_EnterTyp((CHAR*)"PTR", 13, OPM_PointerSize, &OPT_sysptrtyp); + OPT_EnterProc((CHAR*)"ADR", 20); + OPT_EnterProc((CHAR*)"CC", 21); + OPT_EnterProc((CHAR*)"LSH", 22); + OPT_EnterProc((CHAR*)"ROT", 23); + OPT_EnterProc((CHAR*)"GET", 24); + OPT_EnterProc((CHAR*)"PUT", 25); + OPT_EnterProc((CHAR*)"GETREG", 26); + OPT_EnterProc((CHAR*)"PUTREG", 27); + OPT_EnterProc((CHAR*)"BIT", 28); + OPT_EnterProc((CHAR*)"VAL", 29); + OPT_EnterProc((CHAR*)"NEW", 30); + OPT_EnterProc((CHAR*)"MOVE", 31); + OPT_syslink = OPT_topScope->right; + OPT_universe = OPT_topScope; + OPT_topScope->right = NIL; + OPT_EnterTyp((CHAR*)"CHAR", 3, OPM_CharSize, &OPT_chartyp); + OPT_EnterTyp((CHAR*)"SET", 9, OPM_SetSize, &OPT_settyp); + OPT_EnterTyp((CHAR*)"REAL", 7, OPM_RealSize, &OPT_realtyp); + OPT_EnterTyp((CHAR*)"INTEGER", 5, OPM_IntSize, &OPT_inttyp); + OPT_EnterTyp((CHAR*)"LONGINT", 6, OPM_LIntSize, &OPT_linttyp); + OPT_EnterTyp((CHAR*)"LONGREAL", 8, OPM_LRealSize, &OPT_lrltyp); + OPT_EnterTyp((CHAR*)"SHORTINT", 4, OPM_SIntSize, &OPT_sinttyp); + OPT_EnterTyp((CHAR*)"BOOLEAN", 2, OPM_BoolSize, &OPT_booltyp); + OPT_EnterBoolConst((CHAR*)"FALSE", ((LONGINT)(0))); + OPT_EnterBoolConst((CHAR*)"TRUE", ((LONGINT)(1))); + OPT_EnterProc((CHAR*)"HALT", 0); + OPT_EnterProc((CHAR*)"NEW", 1); + OPT_EnterProc((CHAR*)"ABS", 2); + OPT_EnterProc((CHAR*)"CAP", 3); + OPT_EnterProc((CHAR*)"ORD", 4); + OPT_EnterProc((CHAR*)"ENTIER", 5); + OPT_EnterProc((CHAR*)"ODD", 6); + OPT_EnterProc((CHAR*)"MIN", 7); + OPT_EnterProc((CHAR*)"MAX", 8); + OPT_EnterProc((CHAR*)"CHR", 9); + OPT_EnterProc((CHAR*)"SHORT", 10); + OPT_EnterProc((CHAR*)"LONG", 11); + OPT_EnterProc((CHAR*)"SIZE", 12); + OPT_EnterProc((CHAR*)"INC", 13); + OPT_EnterProc((CHAR*)"DEC", 14); + OPT_EnterProc((CHAR*)"INCL", 15); + OPT_EnterProc((CHAR*)"EXCL", 16); + OPT_EnterProc((CHAR*)"LEN", 17); + OPT_EnterProc((CHAR*)"COPY", 18); + OPT_EnterProc((CHAR*)"ASH", 19); + OPT_EnterProc((CHAR*)"ASSERT", 32); + OPT_impCtxt.ref[0] = OPT_undftyp; + OPT_impCtxt.ref[1] = OPT_bytetyp; + OPT_impCtxt.ref[2] = OPT_booltyp; + OPT_impCtxt.ref[3] = OPT_chartyp; + OPT_impCtxt.ref[4] = OPT_sinttyp; + OPT_impCtxt.ref[5] = OPT_inttyp; + OPT_impCtxt.ref[6] = OPT_linttyp; + OPT_impCtxt.ref[7] = OPT_realtyp; + OPT_impCtxt.ref[8] = OPT_lrltyp; + OPT_impCtxt.ref[9] = OPT_settyp; + OPT_impCtxt.ref[10] = OPT_stringtyp; + OPT_impCtxt.ref[11] = OPT_niltyp; + OPT_impCtxt.ref[12] = OPT_notyp; + OPT_impCtxt.ref[13] = OPT_sysptrtyp; + __ENDMOD; +} diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h new file mode 100644 index 00000000..1a22d0df --- /dev/null +++ b/bootstrap/unix-48/OPT.h @@ -0,0 +1,105 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ + +#ifndef OPT__h +#define OPT__h + +#include "SYSTEM.h" +#include "OPS.h" + +typedef + struct OPT_ConstDesc *OPT_Const; + +typedef + OPS_String *OPT_ConstExt; + +typedef + struct OPT_ConstDesc { + OPT_ConstExt ext; + LONGINT intval, intval2; + SET setval; + LONGREAL realval; + } OPT_ConstDesc; + +typedef + struct OPT_NodeDesc *OPT_Node; + +typedef + struct OPT_StrDesc *OPT_Struct; + +typedef + struct OPT_ObjDesc *OPT_Object; + +typedef + struct OPT_NodeDesc { + OPT_Node left, right, link; + SHORTINT class, subcl; + BOOLEAN readonly; + OPT_Struct typ; + OPT_Object obj; + OPT_Const conval; + } OPT_NodeDesc; + +typedef + struct OPT_ObjDesc { + OPT_Object left, right, link, scope; + OPS_Name name; + BOOLEAN leaf; + SHORTINT mode, mnolev, vis, history; + BOOLEAN used, fpdone; + LONGINT fprint; + OPT_Struct typ; + OPT_Const conval; + LONGINT adr, linkadr; + INTEGER x; + } OPT_ObjDesc; + +typedef + struct OPT_StrDesc { + SHORTINT form, comp, mno, extlev; + INTEGER ref, sysflag; + LONGINT n, size, align, txtpos; + BOOLEAN allocated, pbused, pvused; + char _prvt0[8]; + LONGINT pbfp, pvfp; + OPT_Struct BaseTyp; + OPT_Object link, strobj; + } OPT_StrDesc; + + +import void (*OPT_typSize)(OPT_Struct); +import OPT_Object OPT_topScope; +import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +import SHORTINT OPT_nofGmod; +import OPT_Object OPT_GlbMod[64]; +import OPS_Name OPT_SelfName; +import BOOLEAN OPT_SYSimported; + +import LONGINT *OPT_ConstDesc__typ; +import LONGINT *OPT_ObjDesc__typ; +import LONGINT *OPT_StrDesc__typ; +import LONGINT *OPT_NodeDesc__typ; + +import void OPT_Close (void); +import void OPT_CloseScope (void); +import void OPT_Export (BOOLEAN *ext, BOOLEAN *new); +import void OPT_FPrintErr (OPT_Object obj, INTEGER errcode); +import void OPT_FPrintObj (OPT_Object obj); +import void OPT_FPrintStr (OPT_Struct typ); +import void OPT_Find (OPT_Object *res); +import void OPT_FindField (OPS_Name name, OPT_Struct typ, OPT_Object *res); +import void OPT_FindImport (OPT_Object mod, OPT_Object *res); +import void OPT_IdFPrint (OPT_Struct typ); +import void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); +import void OPT_Init (OPS_Name name, SET opt); +import void OPT_Insert (OPS_Name name, OPT_Object *obj); +import void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); +import OPT_Const OPT_NewConst (void); +import OPT_ConstExt OPT_NewExt (void); +import OPT_Node OPT_NewNode (SHORTINT class); +import OPT_Object OPT_NewObj (void); +import OPT_Struct OPT_NewStr (SHORTINT form, SHORTINT comp); +import void OPT_OpenScope (SHORTINT level, OPT_Object owner); +import void *OPT__init(void); + + +#endif diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c new file mode 100644 index 00000000..572285dc --- /dev/null +++ b/bootstrap/unix-48/OPV.c @@ -0,0 +1,1688 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +#include "SYSTEM.h" +#include "OPC.h" +#include "OPM.h" +#include "OPS.h" +#include "OPT.h" + +typedef + struct OPV_ExitInfo { + INTEGER level, label; + } OPV_ExitInfo; + + +static BOOLEAN OPV_assert, OPV_inxchk, OPV_mainprog, OPV_ansi; +static INTEGER OPV_stamp; +static LONGINT OPV_recno; +static OPV_ExitInfo OPV_exit; +static INTEGER OPV_nofExitLabels; +static BOOLEAN OPV_naturalAlignment; + +export LONGINT *OPV_ExitInfo__typ; + +static void OPV_ActualPar (OPT_Node n, OPT_Object fp); +export void OPV_AdrAndSize (OPT_Object topScope); +static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc); +static void OPV_Convert (OPT_Node n, INTEGER form, INTEGER prec); +static void OPV_DefineTDescs (OPT_Node n); +static void OPV_Entier (OPT_Node n, INTEGER prec); +static void OPV_GetTProcNum (OPT_Object obj); +static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc); +static BOOLEAN OPV_ImplicitReturn (OPT_Node n); +static void OPV_Index (OPT_Node n, OPT_Node d, INTEGER prec, INTEGER dim); +export void OPV_Init (void); +static void OPV_InitTDescs (OPT_Node n); +static void OPV_Len (OPT_Node n, LONGINT dim); +export void OPV_Module (OPT_Node prog); +static LONGINT OPV_NaturalAlignment (LONGINT size, LONGINT max); +static void OPV_NewArr (OPT_Node d, OPT_Node x); +static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, INTEGER comp); +static BOOLEAN OPV_SideEffects (OPT_Node n); +static void OPV_Stamp (OPS_Name s); +static OPT_Object OPV_SuperProc (OPT_Node n); +static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported); +static void OPV_TraverseRecord (OPT_Struct typ); +export void OPV_TypSize (OPT_Struct typ); +static void OPV_TypeOf (OPT_Node n); +static void OPV_design (OPT_Node n, INTEGER prec); +static void OPV_expr (OPT_Node n, INTEGER prec); +static void OPV_stat (OPT_Node n, OPT_Object outerProc); + + +static LONGINT OPV_NaturalAlignment (LONGINT size, LONGINT max) +{ + LONGINT _o_result; + LONGINT i; + if (size >= max) { + _o_result = max; + return _o_result; + } else { + i = 1; + while (i < size) { + i += i; + } + _o_result = i; + return _o_result; + } + __RETCHK; +} + +void OPV_TypSize (OPT_Struct typ) +{ + INTEGER f, c; + LONGINT offset, size, base, fbase, off0; + OPT_Object fld = NIL; + OPT_Struct btyp = NIL; + if (typ == OPT_undftyp) { + OPM_err(58); + } else if (typ->size == -1) { + f = typ->form; + c = typ->comp; + if (c == 4) { + btyp = typ->BaseTyp; + if (btyp == NIL) { + offset = 0; + base = OPM_RecAlign; + } else { + OPV_TypSize(btyp); + offset = btyp->size - (LONGINT)__ASHR(btyp->sysflag, 8); + base = btyp->align; + } + fld = typ->link; + while ((fld != NIL && fld->mode == 4)) { + btyp = fld->typ; + OPV_TypSize(btyp); + size = btyp->size; + fbase = OPC_Base(btyp); + OPC_Align(&offset, fbase); + fld->adr = offset; + offset += size; + if (fbase > base) { + base = fbase; + } + fld = fld->link; + } + off0 = offset; + if (offset == 0) { + offset = 1; + } + if (OPM_RecSize == 0) { + base = OPV_NaturalAlignment(offset, OPM_RecAlign); + } + OPC_Align(&offset, base); + if ((typ->strobj == NIL && __MASK(typ->align, -65536) == 0)) { + OPV_recno += 1; + base += __ASHL(OPV_recno, 16); + } + typ->size = offset; + typ->align = base; + typ->sysflag = __MASK(typ->sysflag, -256) + (int)__ASHL(offset - off0, 8); + } else if (c == 2) { + OPV_TypSize(typ->BaseTyp); + typ->size = typ->n * typ->BaseTyp->size; + } else if (f == 13) { + typ->size = OPM_PointerSize; + if (typ->BaseTyp == OPT_undftyp) { + OPM_Mark(128, typ->n); + } else { + OPV_TypSize(typ->BaseTyp); + } + } else if (f == 14) { + typ->size = OPM_ProcSize; + } else if (c == 3) { + btyp = typ->BaseTyp; + OPV_TypSize(btyp); + if (btyp->comp == 3) { + typ->size = btyp->size + 4; + } else { + typ->size = 8; + } + } + } +} + +void OPV_Init (void) +{ + OPV_stamp = 0; + OPV_recno = 0; + OPV_nofExitLabels = 0; + OPV_assert = __IN(7, OPM_opt); + OPV_inxchk = __IN(0, OPM_opt); + OPV_mainprog = __IN(10, OPM_opt); + OPV_ansi = __IN(6, OPM_opt); +} + +static void OPV_GetTProcNum (OPT_Object obj) +{ + LONGINT oldPos; + OPT_Struct typ = NIL; + OPT_Object redef = NIL; + oldPos = OPM_errpos; + OPM_errpos = obj->scope->adr; + typ = obj->link->typ; + if (typ->form == 13) { + typ = typ->BaseTyp; + } + OPT_FindField(obj->name, typ->BaseTyp, &redef); + if (redef != NIL) { + obj->adr = __ASHL(__ASHR(redef->adr, 16), 16); + if (!__IN(2, obj->conval->setval)) { + OPM_err(119); + } + } else { + obj->adr += __ASHL(typ->n, 16); + typ->n += 1; + } + OPM_errpos = oldPos; +} + +static void OPV_TraverseRecord (OPT_Struct typ) +{ + if (!typ->allocated) { + if (typ->BaseTyp != NIL) { + OPV_TraverseRecord(typ->BaseTyp); + typ->n = typ->BaseTyp->n; + } + typ->allocated = 1; + OPV_Traverse(typ->link, typ->strobj, 0); + } +} + +static void OPV_Stamp (OPS_Name s) +{ + INTEGER i, j, k; + CHAR n[10]; + OPV_stamp += 1; + i = 0; + j = OPV_stamp; + while (s[__X(i, ((LONGINT)(256)))] != 0x00) { + i += 1; + } + if (i > 25) { + i = 25; + } + s[__X(i, ((LONGINT)(256)))] = '_'; + s[__X(i + 1, ((LONGINT)(256)))] = '_'; + i += 2; + k = 0; + do { + n[__X(k, ((LONGINT)(10)))] = (CHAR)((int)__MOD(j, 10) + 48); + j = __DIV(j, 10); + k += 1; + } while (!(j == 0)); + do { + k -= 1; + s[__X(i, ((LONGINT)(256)))] = n[__X(k, ((LONGINT)(10)))]; + i += 1; + } while (!(k == 0)); + s[__X(i, ((LONGINT)(256)))] = 0x00; +} + +static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported) +{ + INTEGER mode; + OPT_Object scope = NIL; + OPT_Struct typ = NIL; + if (obj != NIL) { + OPV_Traverse(obj->left, outerScope, exported); + if (obj->name[0] == '@') { + obj->name[0] = '_'; + OPV_Stamp(obj->name); + } + obj->linkadr = 0; + mode = obj->mode; + if ((mode == 5 && (obj->vis != 0) == exported)) { + typ = obj->typ; + OPV_TypSize(obj->typ); + if (typ->form == 13) { + typ = typ->BaseTyp; + } + if (typ->comp == 4) { + OPV_TraverseRecord(typ); + } + } else if (mode == 13) { + OPV_GetTProcNum(obj); + } else if (mode == 1) { + OPV_TypSize(obj->typ); + } + if (!exported) { + if ((__IN(mode, 0x60) && obj->mnolev > 0)) { + OPV_Stamp(obj->name); + } + if (__IN(mode, 0x26)) { + obj->scope = outerScope; + } else if (__IN(mode, 0x26c0)) { + if (obj->conval->setval == 0x0) { + OPM_err(129); + } + scope = obj->scope; + scope->leaf = 1; + __COPY(obj->name, scope->name, ((LONGINT)(256))); + OPV_Stamp(scope->name); + if (mode == 9) { + obj->adr = 1; + } + if (scope->mnolev > 1) { + outerScope->leaf = 0; + } + OPV_Traverse(obj->scope->right, obj->scope, 0); + } + } + OPV_Traverse(obj->right, outerScope, exported); + } +} + +void OPV_AdrAndSize (OPT_Object topScope) +{ + OPM_errpos = topScope->adr; + topScope->leaf = 1; + OPV_Traverse(topScope->right, topScope, 1); + OPV_Traverse(topScope->right, topScope, 0); + OPT_chartyp->strobj->linkadr = 2; + OPT_settyp->strobj->linkadr = 2; + OPT_realtyp->strobj->linkadr = 2; + OPT_inttyp->strobj->linkadr = 2; + OPT_linttyp->strobj->linkadr = 2; + OPT_lrltyp->strobj->linkadr = 2; + OPT_sinttyp->strobj->linkadr = 2; + OPT_booltyp->strobj->linkadr = 2; + OPT_bytetyp->strobj->linkadr = 2; + OPT_sysptrtyp->strobj->linkadr = 2; +} + +static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, INTEGER comp) +{ + INTEGER _o_result; + switch (class) { + case 7: case 0: case 2: case 4: case 9: + case 13: + _o_result = 10; + return _o_result; + break; + case 5: + if (__IN(3, OPM_opt)) { + _o_result = 10; + return _o_result; + } else { + _o_result = 9; + return _o_result; + } + break; + case 1: + if (__IN(comp, 0x0c)) { + _o_result = 10; + return _o_result; + } else { + _o_result = 9; + return _o_result; + } + break; + case 3: + _o_result = 9; + return _o_result; + break; + case 11: + switch (subclass) { + case 33: case 7: case 24: case 29: case 20: + _o_result = 9; + return _o_result; + break; + case 16: case 21: case 22: case 23: case 25: + _o_result = 10; + return _o_result; + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence Nmop, subclass = ", (LONGINT)51); + OPM_LogWNum(subclass, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + break; + case 12: + switch (subclass) { + case 1: + if (form == 9) { + _o_result = 4; + return _o_result; + } else { + _o_result = 8; + return _o_result; + } + break; + case 2: + if (form == 9) { + _o_result = 3; + return _o_result; + } else { + _o_result = 8; + return _o_result; + } + break; + case 3: case 4: + _o_result = 10; + return _o_result; + break; + case 6: + if (form == 9) { + _o_result = 2; + return _o_result; + } else { + _o_result = 7; + return _o_result; + } + break; + case 7: + if (form == 9) { + _o_result = 4; + return _o_result; + } else { + _o_result = 7; + return _o_result; + } + break; + case 11: case 12: case 13: case 14: + _o_result = 6; + return _o_result; + break; + case 9: case 10: + _o_result = 5; + return _o_result; + break; + case 5: + _o_result = 1; + return _o_result; + break; + case 8: + _o_result = 0; + return _o_result; + break; + case 19: case 15: case 17: case 18: case 26: + case 27: case 28: + _o_result = 10; + return _o_result; + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence Ndop, subclass = ", (LONGINT)51); + OPM_LogWNum(subclass, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + break; + case 10: + _o_result = 10; + return _o_result; + break; + case 8: case 6: + _o_result = 12; + return _o_result; + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence, class = ", (LONGINT)43); + OPM_LogWNum(class, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + __RETCHK; +} + +static void OPV_Len (OPT_Node n, LONGINT dim) +{ + while ((n->class == 4 && n->typ->comp == 3)) { + dim += 1; + n = n->left; + } + if ((n->class == 3 && n->typ->comp == 3)) { + OPV_design(n->left, 10); + OPM_WriteString((CHAR*)"->len[", (LONGINT)7); + OPM_WriteInt(dim); + OPM_Write(']'); + } else { + OPC_Len(n->obj, n->typ, dim); + } +} + +static BOOLEAN OPV_SideEffects (OPT_Node n) +{ + BOOLEAN _o_result; + if (n != NIL) { + _o_result = (n->class == 13 || OPV_SideEffects(n->left)) || OPV_SideEffects(n->right); + return _o_result; + } else { + _o_result = 0; + return _o_result; + } + __RETCHK; +} + +static void OPV_Entier (OPT_Node n, INTEGER prec) +{ + if (__IN(n->typ->form, 0x0180)) { + OPM_WriteString((CHAR*)"__ENTIER(", (LONGINT)10); + OPV_expr(n, -1); + OPM_Write(')'); + } else { + OPV_expr(n, prec); + } +} + +static void OPV_Convert (OPT_Node n, INTEGER form, INTEGER prec) +{ + INTEGER from; + from = n->typ->form; + if (form == 9) { + OPM_WriteString((CHAR*)"__SETOF(", (LONGINT)9); + OPV_Entier(n, -1); + OPM_Write(')'); + } else if (form == 6) { + if (from < 6) { + OPM_WriteString((CHAR*)"(LONGINT)", (LONGINT)10); + } + OPV_Entier(n, 9); + } else if (form == 5) { + if (from < 5) { + OPM_WriteString((CHAR*)"(int)", (LONGINT)6); + OPV_expr(n, 9); + } else { + if (__IN(2, OPM_opt)) { + OPM_WriteString((CHAR*)"__SHORT", (LONGINT)8); + if (OPV_SideEffects(n)) { + OPM_Write('F'); + } + OPM_Write('('); + OPV_Entier(n, -1); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteInt(OPM_MaxInt + 1); + OPM_Write(')'); + } else { + OPM_WriteString((CHAR*)"(int)", (LONGINT)6); + OPV_Entier(n, 9); + } + } + } else if (form == 4) { + if (__IN(2, OPM_opt)) { + OPM_WriteString((CHAR*)"__SHORT", (LONGINT)8); + if (OPV_SideEffects(n)) { + OPM_Write('F'); + } + OPM_Write('('); + OPV_Entier(n, -1); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteInt(OPM_MaxSInt + 1); + OPM_Write(')'); + } else { + OPM_WriteString((CHAR*)"(int)", (LONGINT)6); + OPV_Entier(n, 9); + } + } else if (form == 3) { + if (__IN(2, OPM_opt)) { + OPM_WriteString((CHAR*)"__CHR", (LONGINT)6); + if (OPV_SideEffects(n)) { + OPM_Write('F'); + } + OPM_Write('('); + OPV_Entier(n, -1); + OPM_Write(')'); + } else { + OPM_WriteString((CHAR*)"(CHAR)", (LONGINT)7); + OPV_Entier(n, 9); + } + } else { + OPV_expr(n, prec); + } +} + +static void OPV_TypeOf (OPT_Node n) +{ + if (n->typ->form == 13) { + OPM_WriteString((CHAR*)"__TYPEOF(", (LONGINT)10); + OPV_expr(n, -1); + OPM_Write(')'); + } else if (__IN(n->class, 0x15)) { + OPC_Andent(n->typ); + OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + } else if (n->class == 3) { + OPM_WriteString((CHAR*)"__TYPEOF(", (LONGINT)10); + OPV_expr(n->left, -1); + OPM_Write(')'); + } else if (n->class == 5) { + OPV_TypeOf(n->left); + } else if ((n->class == 11 && n->subcl == 29)) { + OPC_TypeOf(n->left->obj); + } else { + OPC_TypeOf(n->obj); + } +} + +static void OPV_Index (OPT_Node n, OPT_Node d, INTEGER prec, INTEGER dim) +{ + if (!OPV_inxchk || (n->right->class == 7 && (n->right->conval->intval == 0 || n->left->typ->comp != 3))) { + OPV_expr(n->right, prec); + } else { + if (OPV_SideEffects(n->right)) { + OPM_WriteString((CHAR*)"__XF(", (LONGINT)6); + } else { + OPM_WriteString((CHAR*)"__X(", (LONGINT)5); + } + OPV_expr(n->right, -1); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPV_Len(d, dim); + OPM_Write(')'); + } +} + +static void OPV_design (OPT_Node n, INTEGER prec) +{ + OPT_Object obj = NIL; + OPT_Struct typ = NIL; + INTEGER class, designPrec, comp; + OPT_Node d = NIL, x = NIL; + INTEGER dims, i, _for__26; + comp = n->typ->comp; + obj = n->obj; + class = n->class; + designPrec = OPV_Precedence(class, n->subcl, n->typ->form, comp); + if ((((((class == 0 && obj->mnolev > 0)) && (int)obj->mnolev != OPM_level)) && prec == 10)) { + designPrec = 9; + } + if (prec > designPrec) { + OPM_Write('('); + } + if (prec == 11) { + OPM_Write('*'); + } + switch (class) { + case 9: + OPC_Ident(n->obj); + break; + case 0: + OPC_CompleteIdent(n->obj); + break; + case 1: + if (!__IN(comp, 0x0c)) { + OPM_Write('*'); + } + OPC_CompleteIdent(n->obj); + break; + case 2: + if (n->left->class == 3) { + OPV_design(n->left->left, designPrec); + OPM_WriteString((CHAR*)"->", (LONGINT)3); + } else { + OPV_design(n->left, designPrec); + OPM_Write('.'); + } + OPC_Ident(n->obj); + break; + case 3: + if (n->typ->comp == 3) { + OPV_design(n->left, 10); + OPM_WriteString((CHAR*)"->data", (LONGINT)7); + } else { + OPM_Write('*'); + OPV_design(n->left, designPrec); + } + break; + case 4: + d = n->left; + if (d->typ->comp == 3) { + dims = 0; + while (d->class == 4) { + d = d->left; + dims += 1; + } + if (n->typ->comp == 3) { + OPM_Write('&'); + } + OPV_design(d, designPrec); + OPM_Write('['); + if (n->typ->comp == 3) { + OPM_Write('('); + } + i = dims; + x = n; + while (x != d) { + if (x->left != d) { + OPV_Index(x, d, 7, i); + OPM_WriteString((CHAR*)" + ", (LONGINT)4); + OPV_Len(d, i); + OPM_WriteString((CHAR*)" * (", (LONGINT)5); + i -= 1; + } else { + OPV_Index(x, d, -1, i); + } + x = x->left; + } + _for__26 = dims; + i = 1; + while (i <= _for__26) { + OPM_Write(')'); + i += 1; + } + if (n->typ->comp == 3) { + OPM_Write(')'); + while ((LONGINT)i < __ASHR(d->typ->size - 4, 2)) { + OPM_WriteString((CHAR*)" * ", (LONGINT)4); + OPV_Len(d, i); + i += 1; + } + } + OPM_Write(']'); + } else { + OPV_design(n->left, designPrec); + OPM_Write('['); + OPV_Index(n, n->left, -1, 0); + OPM_Write(']'); + } + break; + case 5: + typ = n->typ; + obj = n->left->obj; + if (__IN(3, OPM_opt)) { + if (typ->comp == 4) { + OPM_WriteString((CHAR*)"__GUARDR(", (LONGINT)10); + if ((int)obj->mnolev != OPM_level) { + OPM_WriteStringVar((void*)obj->scope->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"__curr->", (LONGINT)9); + OPC_Ident(obj); + } else { + OPC_Ident(obj); + } + } else { + if (typ->BaseTyp->strobj == NIL) { + OPM_WriteString((CHAR*)"__GUARDA(", (LONGINT)10); + } else { + OPM_WriteString((CHAR*)"__GUARDP(", (LONGINT)10); + } + OPV_expr(n->left, -1); + typ = typ->BaseTyp; + } + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPC_Andent(typ); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteInt(typ->extlev); + OPM_Write(')'); + } else { + if (typ->comp == 4) { + OPM_WriteString((CHAR*)"*(", (LONGINT)3); + OPC_Ident(typ->strobj); + OPM_WriteString((CHAR*)"*)", (LONGINT)3); + OPC_CompleteIdent(obj); + } else { + OPM_Write('('); + OPC_Ident(typ->strobj); + OPM_Write(')'); + OPV_expr(n->left, designPrec); + } + } + break; + case 6: + if (__IN(3, OPM_opt)) { + if (n->left->class == 1) { + OPM_WriteString((CHAR*)"__GUARDEQR(", (LONGINT)12); + OPC_CompleteIdent(n->left->obj); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPV_TypeOf(n->left); + } else { + OPM_WriteString((CHAR*)"__GUARDEQP(", (LONGINT)12); + OPV_expr(n->left->left, -1); + } + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPC_Ident(n->left->typ->strobj); + OPM_Write(')'); + } else { + OPV_expr(n->left, -1); + } + break; + case 11: + if (n->subcl == 29) { + OPV_design(n->left, prec); + } + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPV.design, class = ", (LONGINT)39); + OPM_LogWNum(class, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + if (prec > designPrec) { + OPM_Write(')'); + } +} + +static void OPV_ActualPar (OPT_Node n, OPT_Object fp) +{ + OPT_Struct typ = NIL, aptyp = NIL; + INTEGER comp, form, mode, prec, dim; + OPM_Write('('); + while (n != NIL) { + typ = fp->typ; + comp = typ->comp; + form = typ->form; + mode = fp->mode; + prec = -1; + if ((((mode == 2 && n->class == 11)) && n->subcl == 29)) { + OPM_Write('('); + OPC_Ident(n->typ->strobj); + OPM_WriteString((CHAR*)"*)", (LONGINT)3); + prec = 10; + } + if (!__IN(n->typ->comp, 0x0c)) { + if (mode == 2) { + if ((OPV_ansi && typ != n->typ)) { + OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + } + OPM_Write('&'); + prec = 9; + } else if (OPV_ansi) { + if ((__IN(comp, 0x0c) && n->class == 7)) { + OPM_WriteString((CHAR*)"(CHAR*)", (LONGINT)8); + } else if ((((form == 13 && typ != n->typ)) && n->typ != OPT_niltyp)) { + OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + } + } else { + if ((__IN(form, 0x0180) && __IN(n->typ->form, 0x70))) { + OPM_WriteString((CHAR*)"(double)", (LONGINT)9); + prec = 9; + } else if ((form == 6 && n->typ->form < 6)) { + OPM_WriteString((CHAR*)"(LONGINT)", (LONGINT)10); + prec = 9; + } + } + } else if (OPV_ansi) { + if ((((mode == 2 && typ != n->typ)) && prec == -1)) { + OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + } + } + if ((((mode == 2 && n->class == 11)) && n->subcl == 29)) { + OPV_expr(n->left, prec); + } else if ((((((form == 6 && n->class == 7)) && n->conval->intval <= OPM_MaxInt)) && n->conval->intval >= OPM_MinInt)) { + OPM_WriteString((CHAR*)"((LONGINT)(", (LONGINT)12); + OPV_expr(n, prec); + OPM_WriteString((CHAR*)"))", (LONGINT)3); + } else { + OPV_expr(n, prec); + } + if ((comp == 4 && mode == 2)) { + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPV_TypeOf(n); + } else if (comp == 3) { + if (n->class == 7) { + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)"(LONGINT)", (LONGINT)10); + OPM_WriteInt(n->conval->intval2); + } else { + aptyp = n->typ; + dim = 0; + while ((typ->comp == 3 && typ->BaseTyp->form != 1)) { + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPV_Len(n, dim); + typ = typ->BaseTyp; + aptyp = aptyp->BaseTyp; + dim += 1; + } + if ((typ->comp == 3 && typ->BaseTyp->form == 1)) { + OPM_WriteString((CHAR*)", ", (LONGINT)3); + while (aptyp->comp == 3) { + OPV_Len(n, dim); + OPM_WriteString((CHAR*)" * ", (LONGINT)4); + dim += 1; + aptyp = aptyp->BaseTyp; + } + OPM_WriteString((CHAR*)"((LONGINT)(", (LONGINT)12); + OPM_WriteInt(aptyp->size); + OPM_WriteString((CHAR*)"))", (LONGINT)3); + } + } + } + n = n->link; + fp = fp->link; + if (n != NIL) { + OPM_WriteString((CHAR*)", ", (LONGINT)3); + } + } + OPM_Write(')'); +} + +static OPT_Object OPV_SuperProc (OPT_Node n) +{ + OPT_Object _o_result; + OPT_Object obj = NIL; + OPT_Struct typ = NIL; + typ = n->right->typ; + if (typ->form == 13) { + typ = typ->BaseTyp; + } + OPT_FindField(n->left->obj->name, typ->BaseTyp, &obj); + _o_result = obj; + return _o_result; +} + +static void OPV_expr (OPT_Node n, INTEGER prec) +{ + INTEGER class, subclass, form, exprPrec; + OPT_Struct typ = NIL; + OPT_Node l = NIL, r = NIL; + OPT_Object proc = NIL; + class = n->class; + subclass = n->subcl; + form = n->typ->form; + l = n->left; + r = n->right; + exprPrec = OPV_Precedence(class, subclass, form, n->typ->comp); + if ((exprPrec <= prec && __IN(class, 0x3ce0))) { + OPM_Write('('); + } + switch (class) { + case 7: + OPC_Constant(n->conval, form); + break; + case 10: + OPM_WriteString((CHAR*)"__SETRNG(", (LONGINT)10); + OPV_expr(l, -1); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPV_expr(r, -1); + OPM_Write(')'); + break; + case 11: + switch (subclass) { + case 33: + OPM_Write('!'); + OPV_expr(l, exprPrec); + break; + case 7: + if (form == 9) { + OPM_Write('~'); + } else { + OPM_Write('-'); + } + OPV_expr(l, exprPrec); + break; + case 16: + typ = n->obj->typ; + if (l->typ->comp == 4) { + OPM_WriteString((CHAR*)"__IS(", (LONGINT)6); + OPC_TypeOf(l->obj); + } else { + OPM_WriteString((CHAR*)"__ISP(", (LONGINT)7); + OPV_expr(l, -1); + typ = typ->BaseTyp; + } + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPC_Andent(typ); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteInt(typ->extlev); + OPM_Write(')'); + break; + case 20: + OPV_Convert(l, form, exprPrec); + break; + case 21: + if (OPV_SideEffects(l)) { + if (l->typ->form < 7) { + if (l->typ->form < 6) { + OPM_WriteString((CHAR*)"(int)", (LONGINT)6); + } + OPM_WriteString((CHAR*)"__ABSF(", (LONGINT)8); + } else { + OPM_WriteString((CHAR*)"__ABSFD(", (LONGINT)9); + } + } else { + OPM_WriteString((CHAR*)"__ABS(", (LONGINT)7); + } + OPV_expr(l, -1); + OPM_Write(')'); + break; + case 22: + OPM_WriteString((CHAR*)"__CAP(", (LONGINT)7); + OPV_expr(l, -1); + OPM_Write(')'); + break; + case 23: + OPM_WriteString((CHAR*)"__ODD(", (LONGINT)7); + OPV_expr(l, -1); + OPM_Write(')'); + break; + case 24: + OPM_WriteString((CHAR*)"(LONGINT)(uintptr_t)", (LONGINT)21); + if (l->class == 1) { + OPC_CompleteIdent(l->obj); + } else { + if ((l->typ->form != 10 && !__IN(l->typ->comp, 0x0c))) { + OPM_Write('&'); + } + OPV_expr(l, exprPrec); + } + break; + case 29: + if ((((__IN(n->typ->form, 0x6240) && __IN(l->typ->form, 0x6240))) && n->typ->size == l->typ->size) || !__IN(l->class, 0x17)) { + OPM_Write('('); + OPC_Ident(n->typ->strobj); + OPM_Write(')'); + if (__IN(n->typ->form, 0x6000) || __IN(l->typ->form, 0x6000)) { + OPM_WriteString((CHAR*)"(uintptr_t)", (LONGINT)12); + } + OPV_expr(l, exprPrec); + } else { + if (__IN(n->typ->form, 0x6000) || __IN(l->typ->form, 0x6000)) { + OPM_WriteString((CHAR*)"__VALP(", (LONGINT)8); + } else { + OPM_WriteString((CHAR*)"__VAL(", (LONGINT)7); + } + OPC_Ident(n->typ->strobj); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPV_expr(l, -1); + OPM_Write(')'); + } + break; + default: + OPM_err(200); + break; + } + break; + case 12: + switch (subclass) { + case 19: + OPV_Len(l, r->conval->intval); + break; + case 15: case 17: case 18: case 26: case 27: + case 28: case 3: case 4: + switch (subclass) { + case 15: + OPM_WriteString((CHAR*)"__IN(", (LONGINT)6); + break; + case 17: + if (r->class == 7) { + if (r->conval->intval >= 0) { + OPM_WriteString((CHAR*)"__ASHL(", (LONGINT)8); + } else { + OPM_WriteString((CHAR*)"__ASHR(", (LONGINT)8); + } + } else if (OPV_SideEffects(r)) { + OPM_WriteString((CHAR*)"__ASHF(", (LONGINT)8); + } else { + OPM_WriteString((CHAR*)"__ASH(", (LONGINT)7); + } + break; + case 18: + OPM_WriteString((CHAR*)"__MASK(", (LONGINT)8); + break; + case 26: + OPM_WriteString((CHAR*)"__BIT(", (LONGINT)7); + break; + case 27: + if (r->class == 7) { + if (r->conval->intval >= 0) { + OPM_WriteString((CHAR*)"__LSHL(", (LONGINT)8); + } else { + OPM_WriteString((CHAR*)"__LSHR(", (LONGINT)8); + } + } else { + OPM_WriteString((CHAR*)"__LSH(", (LONGINT)7); + } + break; + case 28: + if (r->class == 7) { + if (r->conval->intval >= 0) { + OPM_WriteString((CHAR*)"__ROTL(", (LONGINT)8); + } else { + OPM_WriteString((CHAR*)"__ROTR(", (LONGINT)8); + } + } else { + OPM_WriteString((CHAR*)"__ROT(", (LONGINT)7); + } + break; + case 3: + if (OPV_SideEffects(n)) { + if (form < 6) { + OPM_WriteString((CHAR*)"(int)", (LONGINT)6); + } + OPM_WriteString((CHAR*)"__DIVF(", (LONGINT)8); + } else { + OPM_WriteString((CHAR*)"__DIV(", (LONGINT)7); + } + break; + case 4: + if (form < 6) { + OPM_WriteString((CHAR*)"(int)", (LONGINT)6); + } + if (OPV_SideEffects(n)) { + OPM_WriteString((CHAR*)"__MODF(", (LONGINT)8); + } else { + OPM_WriteString((CHAR*)"__MOD(", (LONGINT)7); + } + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, subclass = ", (LONGINT)40); + OPM_LogWNum(subclass, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + OPV_expr(l, -1); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + if ((((__IN(subclass, 0x18020000) && r->class == 7)) && r->conval->intval < 0)) { + OPM_WriteInt(-r->conval->intval); + } else { + OPV_expr(r, -1); + } + if (__IN(subclass, 0x18000000)) { + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPC_Ident(l->typ->strobj); + } + OPM_Write(')'); + break; + case 9: case 10: case 11: case 12: case 13: + case 14: + if (__IN(l->typ->form, 0x8400)) { + OPM_WriteString((CHAR*)"__STRCMP(", (LONGINT)10); + OPV_expr(l, -1); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPV_expr(r, -1); + OPM_Write(')'); + OPC_Cmp(subclass); + OPM_Write('0'); + } else { + OPV_expr(l, exprPrec); + OPC_Cmp(subclass); + typ = l->typ; + if ((((((typ->form == 13 && r->typ->form != 11)) && r->typ != typ)) && r->typ != OPT_sysptrtyp)) { + OPM_WriteString((CHAR*)"(void *) ", (LONGINT)10); + } + OPV_expr(r, exprPrec); + } + break; + default: + if (subclass == 5 || (form == 9 && (subclass == 1 || subclass == 7))) { + OPM_Write('('); + } + OPV_expr(l, exprPrec); + switch (subclass) { + case 1: + if (form == 9) { + OPM_WriteString((CHAR*)" & ", (LONGINT)4); + } else { + OPM_WriteString((CHAR*)" * ", (LONGINT)4); + } + break; + case 2: + if (form == 9) { + OPM_WriteString((CHAR*)" ^ ", (LONGINT)4); + } else { + OPM_WriteString((CHAR*)" / ", (LONGINT)4); + if (r->obj == NIL || __IN(r->obj->typ->form, 0x70)) { + OPM_Write('('); + OPC_Ident(n->typ->strobj); + OPM_Write(')'); + } + } + break; + case 5: + OPM_WriteString((CHAR*)" && ", (LONGINT)5); + break; + case 6: + if (form == 9) { + OPM_WriteString((CHAR*)" | ", (LONGINT)4); + } else { + OPM_WriteString((CHAR*)" + ", (LONGINT)4); + } + break; + case 7: + if (form == 9) { + OPM_WriteString((CHAR*)" & ~", (LONGINT)5); + } else { + OPM_WriteString((CHAR*)" - ", (LONGINT)4); + } + break; + case 8: + OPM_WriteString((CHAR*)" || ", (LONGINT)5); + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, subclass = ", (LONGINT)40); + OPM_LogWNum(subclass, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + OPV_expr(r, exprPrec); + if (subclass == 5 || (form == 9 && (subclass == 1 || subclass == 7))) { + OPM_Write(')'); + } + break; + } + break; + case 13: + if ((l->obj != NIL && l->obj->mode == 13)) { + if (l->subcl == 1) { + proc = OPV_SuperProc(n); + } else { + OPM_WriteString((CHAR*)"__", (LONGINT)3); + proc = OPC_BaseTProc(l->obj); + } + OPC_Ident(proc); + n->obj = proc->link; + } else if (l->class == 9) { + OPV_design(l, 10); + } else { + OPV_design(l, 11); + } + OPV_ActualPar(r, n->obj); + break; + default: + OPV_design(n, prec); + break; + } + if ((exprPrec <= prec && __IN(class, 0x3ca0))) { + OPM_Write(')'); + } +} + +static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) +{ + OPT_Node if_ = NIL; + OPT_Object obj = NIL; + OPT_Struct typ = NIL; + LONGINT adr; + if_ = n->left; + while (if_ != NIL) { + OPM_WriteString((CHAR*)"if ", (LONGINT)4); + OPV_expr(if_->left, 12); + OPM_Write(' '); + OPC_BegBlk(); + if ((n->class == 27 && if_->left->left != NIL)) { + obj = if_->left->left->obj; + typ = obj->typ; + adr = obj->adr; + if (typ->comp == 4) { + OPC_BegStat(); + OPC_Ident(if_->left->obj); + OPM_WriteString((CHAR*)" *", (LONGINT)3); + OPM_WriteString(obj->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"__ = (void*)", (LONGINT)13); + obj->adr = 0; + OPC_CompleteIdent(obj); + OPC_EndStat(); + } + obj->adr = 1; + obj->typ = if_->left->obj->typ; + OPV_stat(if_->right, outerProc); + obj->typ = typ; + obj->adr = adr; + } else { + OPV_stat(if_->right, outerProc); + } + if_ = if_->link; + if ((if_ != NIL || n->right != NIL) || withtrap) { + OPC_EndBlk0(); + OPM_WriteString((CHAR*)" else ", (LONGINT)7); + } else { + OPC_EndBlk(); + } + } + if (withtrap) { + OPM_WriteString((CHAR*)"__WITHCHK", (LONGINT)10); + OPC_EndStat(); + } else if (n->right != NIL) { + OPC_BegBlk(); + OPV_stat(n->right, outerProc); + OPC_EndBlk(); + } +} + +static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc) +{ + OPT_Node switchCase = NIL, label = NIL; + LONGINT low, high; + INTEGER form, i; + OPM_WriteString((CHAR*)"switch ", (LONGINT)8); + OPV_expr(n->left, 12); + OPM_Write(' '); + OPC_BegBlk(); + form = n->left->typ->form; + switchCase = n->right->left; + while (switchCase != NIL) { + label = switchCase->left; + i = 0; + while (label != NIL) { + low = label->conval->intval; + high = label->conval->intval2; + while (low <= high) { + if (i == 0) { + OPC_BegStat(); + } + OPC_Case(low, form); + low += 1; + i += 1; + if (i == 5) { + OPM_WriteLn(); + i = 0; + } + } + label = label->link; + } + if (i > 0) { + OPM_WriteLn(); + } + OPC_Indent(1); + OPV_stat(switchCase->right, outerProc); + OPC_BegStat(); + OPM_WriteString((CHAR*)"break", (LONGINT)6); + OPC_EndStat(); + OPC_Indent(-1); + switchCase = switchCase->link; + } + OPC_BegStat(); + OPM_WriteString((CHAR*)"default: ", (LONGINT)10); + if (n->right->conval->setval != 0x0) { + OPC_Indent(1); + OPM_WriteLn(); + OPV_stat(n->right->right, outerProc); + OPC_BegStat(); + OPM_WriteString((CHAR*)"break", (LONGINT)6); + OPC_Indent(-1); + } else { + OPM_WriteString((CHAR*)"__CASECHK", (LONGINT)10); + } + OPC_EndStat(); + OPC_EndBlk(); +} + +static BOOLEAN OPV_ImplicitReturn (OPT_Node n) +{ + BOOLEAN _o_result; + while ((n != NIL && n->class != 26)) { + n = n->link; + } + _o_result = n == NIL; + return _o_result; +} + +static void OPV_NewArr (OPT_Node d, OPT_Node x) +{ + OPT_Struct typ = NIL, base = NIL; + INTEGER nofdim, nofdyn; + typ = d->typ->BaseTyp; + base = typ; + nofdim = 0; + nofdyn = 0; + while (base->comp == 3) { + nofdim += 1; + nofdyn += 1; + base = base->BaseTyp; + } + OPV_design(d, -1); + OPM_WriteString((CHAR*)" = __NEWARR(", (LONGINT)13); + while (base->comp == 2) { + nofdim += 1; + base = base->BaseTyp; + } + if ((base->comp == 4 && OPC_NofPtrs(base) != 0)) { + OPC_Ident(base->strobj); + OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + } else if (base->form == 13) { + OPM_WriteString((CHAR*)"POINTER__typ", (LONGINT)13); + } else { + OPM_WriteString((CHAR*)"NIL", (LONGINT)4); + } + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)"((LONGINT)(", (LONGINT)12); + OPM_WriteInt(base->size); + OPM_WriteString((CHAR*)"))", (LONGINT)3); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteInt(OPC_Base(base)); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteInt(nofdim); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteInt(nofdyn); + while (typ != base) { + OPM_WriteString((CHAR*)", ", (LONGINT)3); + if (typ->comp == 3) { + if (x->class == 7) { + OPM_WriteString((CHAR*)"(LONGINT)(", (LONGINT)11); + OPV_expr(x, -1); + OPM_WriteString((CHAR*)")", (LONGINT)2); + } else { + OPM_WriteString((CHAR*)"(LONGINT)", (LONGINT)10); + OPV_expr(x, 10); + } + x = x->link; + } else { + OPM_WriteString((CHAR*)"(LONGINT)", (LONGINT)10); + OPM_WriteInt(typ->n); + } + typ = typ->BaseTyp; + } + OPM_Write(')'); +} + +static void OPV_DefineTDescs (OPT_Node n) +{ + while ((n != NIL && n->class == 14)) { + OPC_TDescDecl(n->typ); + n = n->link; + } +} + +static void OPV_InitTDescs (OPT_Node n) +{ + while ((n != NIL && n->class == 14)) { + OPC_InitTDesc(n->typ); + n = n->link; + } +} + +static void OPV_stat (OPT_Node n, OPT_Object outerProc) +{ + OPT_Object proc = NIL; + OPV_ExitInfo saved; + OPT_Node l = NIL, r = NIL; + while ((n != NIL && OPM_noerr)) { + OPM_errpos = n->conval->intval; + if (n->class != 14) { + OPC_BegStat(); + } + switch (n->class) { + case 18: + if (n->obj == NIL) { + OPM_level += 1; + OPV_stat(n->left, outerProc); + OPM_level -= 1; + OPC_GenEnumPtrs(OPT_topScope->scope); + OPV_DefineTDescs(n->right); + OPC_EnterBody(); + OPV_InitTDescs(n->right); + OPM_WriteString((CHAR*)"/* BEGIN */", (LONGINT)12); + OPM_WriteLn(); + OPV_stat(n->right, outerProc); + OPC_ExitBody(); + } else { + proc = n->obj; + OPC_TypeDefs(proc->scope->right, 0); + if (!proc->scope->leaf) { + OPC_DefineInter(proc); + } + OPM_level += 1; + OPV_stat(n->left, proc); + OPM_level -= 1; + OPC_EnterProc(proc); + OPV_stat(n->right, proc); + OPC_ExitProc(proc, 1, OPV_ImplicitReturn(n->right)); + } + break; + case 14: + break; + case 19: + switch (n->subcl) { + case 0: + l = n->left; + r = n->right; + if (l->typ->comp == 2) { + OPM_WriteString((CHAR*)"__MOVE(", (LONGINT)8); + OPV_expr(r, -1); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPV_expr(l, -1); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + if (r->typ == OPT_stringtyp) { + OPM_WriteInt(r->conval->intval2); + } else { + OPM_WriteInt(r->typ->size); + } + OPM_Write(')'); + } else { + if ((((((l->typ->form == 13 && l->obj != NIL)) && l->obj->adr == 1)) && l->obj->mode == 1)) { + l->obj->adr = 0; + OPV_design(l, -1); + l->obj->adr = 1; + if (r->typ->form != 11) { + OPM_WriteString((CHAR*)" = (void*)", (LONGINT)11); + } else { + OPM_WriteString((CHAR*)" = ", (LONGINT)4); + } + } else { + OPV_design(l, -1); + OPM_WriteString((CHAR*)" = ", (LONGINT)4); + } + if (l->typ == r->typ) { + OPV_expr(r, -1); + } else if ((((l->typ->form == 13 && r->typ->form != 11)) && l->typ->strobj != NIL)) { + OPM_Write('('); + OPC_Ident(l->typ->strobj); + OPM_Write(')'); + OPV_expr(r, -1); + } else if (l->typ->comp == 4) { + OPM_WriteString((CHAR*)"*(", (LONGINT)3); + OPC_Andent(l->typ); + OPM_WriteString((CHAR*)"*)&", (LONGINT)4); + OPV_expr(r, 9); + } else { + OPV_expr(r, -1); + } + } + break; + case 1: + if (n->left->typ->BaseTyp->comp == 4) { + OPM_WriteString((CHAR*)"__NEW(", (LONGINT)7); + OPV_design(n->left, -1); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPC_Andent(n->left->typ->BaseTyp); + OPM_WriteString((CHAR*)")", (LONGINT)2); + } else if (__IN(n->left->typ->BaseTyp->comp, 0x0c)) { + OPV_NewArr(n->left, n->right); + } + break; + case 13: case 14: + OPV_expr(n->left, -1); + OPC_Increment(n->subcl == 14); + OPV_expr(n->right, -1); + break; + case 15: case 16: + OPV_expr(n->left, -1); + OPC_SetInclude(n->subcl == 16); + OPM_WriteString((CHAR*)"__SETOF(", (LONGINT)9); + OPV_expr(n->right, -1); + OPM_Write(')'); + break; + case 18: + OPM_WriteString((CHAR*)"__COPY(", (LONGINT)8); + OPV_expr(n->right, -1); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPV_expr(n->left, -1); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPV_Len(n->left, ((LONGINT)(0))); + OPM_Write(')'); + break; + case 31: + OPM_WriteString((CHAR*)"__MOVE(", (LONGINT)8); + OPV_expr(n->right, -1); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPV_expr(n->left, -1); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPV_expr(n->right->link, -1); + OPM_Write(')'); + break; + case 24: + OPM_WriteString((CHAR*)"__GET(", (LONGINT)7); + OPV_expr(n->right, -1); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPV_expr(n->left, -1); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPC_Ident(n->left->typ->strobj); + OPM_Write(')'); + break; + case 25: + OPM_WriteString((CHAR*)"__PUT(", (LONGINT)7); + OPV_expr(n->left, -1); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPV_expr(n->right, -1); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPC_Ident(n->right->typ->strobj); + OPM_Write(')'); + break; + case 26: case 27: + OPM_err(200); + break; + case 30: + OPM_WriteString((CHAR*)"__SYSNEW(", (LONGINT)10); + OPV_design(n->left, -1); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPV_expr(n->right, -1); + OPM_Write(')'); + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, n^.subcl = ", (LONGINT)40); + OPM_LogWNum(n->subcl, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + break; + case 13: + if ((n->left->obj != NIL && n->left->obj->mode == 13)) { + if (n->left->subcl == 1) { + proc = OPV_SuperProc(n); + } else { + OPM_WriteString((CHAR*)"__", (LONGINT)3); + proc = OPC_BaseTProc(n->left->obj); + } + OPC_Ident(proc); + n->obj = proc->link; + } else if (n->left->class == 9) { + OPV_design(n->left, 10); + } else { + OPV_design(n->left, 11); + } + OPV_ActualPar(n->right, n->obj); + break; + case 20: + if (n->subcl != 32) { + OPV_IfStat(n, 0, outerProc); + } else if (OPV_assert) { + OPM_WriteString((CHAR*)"__ASSERT(", (LONGINT)10); + OPV_expr(n->left->left->left, -1); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteInt(n->left->right->right->conval->intval); + OPM_Write(')'); + OPC_EndStat(); + } + break; + case 21: + OPV_exit.level += 1; + OPV_CaseStat(n, outerProc); + OPV_exit.level -= 1; + break; + case 22: + OPV_exit.level += 1; + OPM_WriteString((CHAR*)"while ", (LONGINT)7); + OPV_expr(n->left, 12); + OPM_Write(' '); + OPC_BegBlk(); + OPV_stat(n->right, outerProc); + OPC_EndBlk(); + OPV_exit.level -= 1; + break; + case 23: + OPV_exit.level += 1; + OPM_WriteString((CHAR*)"do ", (LONGINT)4); + OPC_BegBlk(); + OPV_stat(n->left, outerProc); + OPC_EndBlk0(); + OPM_WriteString((CHAR*)" while (!", (LONGINT)10); + OPV_expr(n->right, 9); + OPM_Write(')'); + OPV_exit.level -= 1; + break; + case 24: + saved = OPV_exit; + OPV_exit.level = 0; + OPV_exit.label = -1; + OPM_WriteString((CHAR*)"for (;;) ", (LONGINT)10); + OPC_BegBlk(); + OPV_stat(n->left, outerProc); + OPC_EndBlk(); + if (OPV_exit.label != -1) { + OPC_BegStat(); + OPM_WriteString((CHAR*)"exit__", (LONGINT)7); + OPM_WriteInt(OPV_exit.label); + OPM_Write(':'); + OPC_EndStat(); + } + OPV_exit = saved; + break; + case 25: + if (OPV_exit.level == 0) { + OPM_WriteString((CHAR*)"break", (LONGINT)6); + } else { + if (OPV_exit.label == -1) { + OPV_exit.label = OPV_nofExitLabels; + OPV_nofExitLabels += 1; + } + OPM_WriteString((CHAR*)"goto exit__", (LONGINT)12); + OPM_WriteInt(OPV_exit.label); + } + break; + case 26: + if (OPM_level == 0) { + if (OPV_mainprog) { + OPM_WriteString((CHAR*)"__FINI", (LONGINT)7); + } else { + OPM_WriteString((CHAR*)"__ENDMOD", (LONGINT)9); + } + } else { + if (n->left != NIL) { + OPM_WriteString((CHAR*)"_o_result = ", (LONGINT)13); + if ((n->left->typ->form == 13 && n->obj->typ != n->left->typ)) { + OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + OPV_expr(n->left, 10); + } else { + OPV_expr(n->left, -1); + } + OPM_WriteString((CHAR*)";", (LONGINT)2); + OPM_WriteLn(); + OPC_BegStat(); + OPC_ExitProc(outerProc, 0, 0); + OPM_WriteString((CHAR*)"return _o_result", (LONGINT)17); + } else { + OPM_WriteString((CHAR*)"return", (LONGINT)7); + } + } + break; + case 27: + OPV_IfStat(n, n->subcl == 0, outerProc); + break; + case 28: + OPC_Halt(n->right->conval->intval); + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, n^.class = ", (LONGINT)40); + OPM_LogWNum(n->class, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + if (!__IN(n->class, 0x09744000)) { + OPC_EndStat(); + } + n = n->link; + } +} + +void OPV_Module (OPT_Node prog) +{ + if (!OPV_mainprog) { + OPC_GenHdr(prog->right); + OPC_GenHdrIncludes(); + } + OPC_GenBdy(prog->right); + OPV_stat(prog, NIL); +} + +__TDESC(OPV_ExitInfo, 1, 0) = {__TDFLDS("ExitInfo", 4), {-4}}; + +export void *OPV__init(void) +{ + __DEFMOD; + __MODULE_IMPORT(OPC); + __MODULE_IMPORT(OPM); + __MODULE_IMPORT(OPS); + __MODULE_IMPORT(OPT); + __REGMOD("OPV", 0); + __REGCMD("Init", OPV_Init); + __INITYP(OPV_ExitInfo, OPV_ExitInfo, 0); +/* BEGIN */ + __ENDMOD; +} diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h new file mode 100644 index 00000000..9907a1ef --- /dev/null +++ b/bootstrap/unix-48/OPV.h @@ -0,0 +1,19 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ + +#ifndef OPV__h +#define OPV__h + +#include "SYSTEM.h" +#include "OPT.h" + + + + +import void OPV_AdrAndSize (OPT_Object topScope); +import void OPV_Init (void); +import void OPV_Module (OPT_Node prog); +import void OPV_TypSize (OPT_Struct typ); +import void *OPV__init(void); + + +#endif diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c new file mode 100644 index 00000000..013e6f9c --- /dev/null +++ b/bootstrap/unix-48/Platform.c @@ -0,0 +1,792 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +#include "SYSTEM.h" + +typedef + CHAR (*Platform_ArgPtr)[1024]; + +typedef + Platform_ArgPtr (*Platform_ArgVec)[1024]; + +typedef + LONGINT (*Platform_ArgVecPtr)[1]; + +typedef + CHAR (*Platform_EnvPtr)[1024]; + +typedef + struct Platform_FileIdentity { + LONGINT volume, index, mtime; + } Platform_FileIdentity; + +typedef + void (*Platform_HaltProcedure)(LONGINT); + +typedef + void (*Platform_SignalHandler)(INTEGER); + + +export BOOLEAN Platform_LittleEndian; +export LONGINT Platform_MainStackFrame, Platform_HaltCode; +export INTEGER Platform_PID; +export CHAR Platform_CWD[256]; +export INTEGER Platform_ArgCount; +export LONGINT Platform_ArgVector; +static Platform_HaltProcedure Platform_HaltHandler; +static LONGINT Platform_TimeStart; +export INTEGER Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; +export CHAR Platform_nl[3]; + +export LONGINT *Platform_FileIdentity__typ; + +export BOOLEAN Platform_Absent (INTEGER e); +export INTEGER Platform_ArgPos (CHAR *s, LONGINT s__len); +export void Platform_AssertFail (LONGINT code); +export INTEGER Platform_Chdir (CHAR *n, LONGINT n__len); +export INTEGER Platform_Close (LONGINT h); +export BOOLEAN Platform_ConnectionFailed (INTEGER e); +export void Platform_Delay (LONGINT ms); +export BOOLEAN Platform_DifferentFilesystems (INTEGER e); +static void Platform_DisplayHaltCode (LONGINT code); +export INTEGER Platform_Error (void); +export void Platform_Exit (INTEGER code); +export void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len); +export void Platform_GetClock (LONGINT *t, LONGINT *d); +export void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); +export void Platform_GetIntArg (INTEGER n, LONGINT *val); +export void Platform_GetTimeOfDay (LONGINT *sec, LONGINT *usec); +export void Platform_Halt (LONGINT code); +export INTEGER Platform_Identify (LONGINT h, Platform_FileIdentity *identity, LONGINT *identity__typ); +export INTEGER Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); +export BOOLEAN Platform_Inaccessible (INTEGER e); +export void Platform_Init (INTEGER argc, LONGINT argvadr); +export void Platform_MTimeAsClock (Platform_FileIdentity i, LONGINT *t, LONGINT *d); +export INTEGER Platform_New (CHAR *n, LONGINT n__len, LONGINT *h); +export BOOLEAN Platform_NoSuchDirectory (INTEGER e); +export LONGINT Platform_OSAllocate (LONGINT size); +export void Platform_OSFree (LONGINT address); +export INTEGER Platform_OldRO (CHAR *n, LONGINT n__len, LONGINT *h); +export INTEGER Platform_OldRW (CHAR *n, LONGINT n__len, LONGINT *h); +export INTEGER Platform_Read (LONGINT h, LONGINT p, LONGINT l, LONGINT *n); +export INTEGER Platform_ReadBuf (LONGINT h, SYSTEM_BYTE *b, LONGINT b__len, LONGINT *n); +export INTEGER Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); +export BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); +export BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); +export INTEGER Platform_Seek (LONGINT h, LONGINT offset, INTEGER whence); +export void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); +export void Platform_SetHalt (Platform_HaltProcedure p); +export void Platform_SetInterruptHandler (Platform_SignalHandler handler); +export void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Platform_FileIdentity source); +export void Platform_SetQuitHandler (Platform_SignalHandler handler); +export INTEGER Platform_Size (LONGINT h, LONGINT *l); +export INTEGER Platform_Sync (LONGINT h); +export INTEGER Platform_System (CHAR *cmd, LONGINT cmd__len); +static void Platform_TestLittleEndian (void); +export LONGINT Platform_Time (void); +export BOOLEAN Platform_TimedOut (INTEGER e); +export BOOLEAN Platform_TooManyFiles (INTEGER e); +export INTEGER Platform_Truncate (LONGINT h, LONGINT l); +export INTEGER Platform_Unlink (CHAR *n, LONGINT n__len); +export INTEGER Platform_Write (LONGINT h, LONGINT p, LONGINT l); +static void Platform_YMDHMStoClock (LONGINT ye, LONGINT mo, LONGINT da, LONGINT ho, LONGINT mi, LONGINT se, LONGINT *t, LONGINT *d); +static void Platform_errch (CHAR c); +static void Platform_errint (LONGINT l); +static void Platform_errln (void); +static void Platform_errposint (LONGINT l); +export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#define Platform_EACCES() EACCES +#define Platform_EAGAIN() EAGAIN +#define Platform_ECONNABORTED() ECONNABORTED +#define Platform_ECONNREFUSED() ECONNREFUSED +#define Platform_EHOSTUNREACH() EHOSTUNREACH +#define Platform_EMFILE() EMFILE +#define Platform_ENETUNREACH() ENETUNREACH +#define Platform_ENFILE() ENFILE +#define Platform_ENOENT() ENOENT +#define Platform_EROFS() EROFS +#define Platform_ETIMEDOUT() ETIMEDOUT +#define Platform_EXDEV() EXDEV +extern void Heap_InitHeap(); +#define Platform_HeapInitHeap() Heap_InitHeap() +#define Platform_allocate(size) (LONGINT)(uintptr_t)((void*)malloc((size_t)size)) +#define Platform_chdir(n, n__len) chdir((char*)n) +#define Platform_closefile(fd) close(fd) +#define Platform_err() errno +#define Platform_errc(c) write(1, &c, 1) +#define Platform_errstring(s, s__len) write(1, s, s__len-1) +#define Platform_exit(code) exit(code) +#define Platform_free(address) free((void*)(uintptr_t)address) +#define Platform_fstat(fd) fstat(fd, &s) +#define Platform_fsync(fd) fsync(fd) +#define Platform_ftruncate(fd, l) ftruncate(fd, l) +#define Platform_getcwd(cwd, cwd__len) getcwd((char*)cwd, cwd__len) +#define Platform_getenv(var, var__len) (Platform_EnvPtr)getenv((char*)var) +#define Platform_getpid() (INTEGER)getpid() +#define Platform_gettimeval() struct timeval tv; gettimeofday(&tv,0) +#define Platform_lseek(fd, o, w) lseek(fd, o, w) +#define Platform_nanosleep(s, ns) struct timespec req, rem; req.tv_sec = s; req.tv_nsec = ns; nanosleep(&req, &rem) +#define Platform_opennew(n, n__len) open((char*)n, O_CREAT | O_TRUNC | O_RDWR, 0664) +#define Platform_openro(n, n__len) open((char*)n, O_RDONLY) +#define Platform_openrw(n, n__len) open((char*)n, O_RDWR) +#define Platform_readfile(fd, p, l) read(fd, (void*)(uintptr_t)(p), l) +#define Platform_rename(o, o__len, n, n__len) rename((char*)o, (char*)n) +#define Platform_sectotm(s) struct tm *time = localtime((time_t*)&s) +#define Platform_seekcur() SEEK_CUR +#define Platform_seekend() SEEK_END +#define Platform_seekset() SEEK_SET +#define Platform_sethandler(s, h) SystemSetHandler(s, (uintptr_t)h) +#define Platform_stat(n, n__len) stat((char*)n, &s) +#define Platform_statdev() (LONGINT)s.st_dev +#define Platform_statino() (LONGINT)s.st_ino +#define Platform_statmtime() (LONGINT)s.st_mtime +#define Platform_statsize() (LONGINT)s.st_size +#define Platform_structstats() struct stat s +#define Platform_system(str, str__len) system((char*)str) +#define Platform_tmhour() (LONGINT)time->tm_hour +#define Platform_tmmday() (LONGINT)time->tm_mday +#define Platform_tmmin() (LONGINT)time->tm_min +#define Platform_tmmon() (LONGINT)time->tm_mon +#define Platform_tmsec() (LONGINT)time->tm_sec +#define Platform_tmyear() (LONGINT)time->tm_year +#define Platform_tvsec() tv.tv_sec +#define Platform_tvusec() tv.tv_usec +#define Platform_unlink(n, n__len) unlink((char*)n) +#define Platform_writefile(fd, p, l) write(fd, (void*)(uintptr_t)(p), l) + +BOOLEAN Platform_TooManyFiles (INTEGER e) +{ + BOOLEAN _o_result; + _o_result = e == Platform_EMFILE() || e == Platform_ENFILE(); + return _o_result; +} + +BOOLEAN Platform_NoSuchDirectory (INTEGER e) +{ + BOOLEAN _o_result; + _o_result = e == Platform_ENOENT(); + return _o_result; +} + +BOOLEAN Platform_DifferentFilesystems (INTEGER e) +{ + BOOLEAN _o_result; + _o_result = e == Platform_EXDEV(); + return _o_result; +} + +BOOLEAN Platform_Inaccessible (INTEGER e) +{ + BOOLEAN _o_result; + _o_result = (e == Platform_EACCES() || e == Platform_EROFS()) || e == Platform_EAGAIN(); + return _o_result; +} + +BOOLEAN Platform_Absent (INTEGER e) +{ + BOOLEAN _o_result; + _o_result = e == Platform_ENOENT(); + return _o_result; +} + +BOOLEAN Platform_TimedOut (INTEGER e) +{ + BOOLEAN _o_result; + _o_result = e == Platform_ETIMEDOUT(); + return _o_result; +} + +BOOLEAN Platform_ConnectionFailed (INTEGER e) +{ + BOOLEAN _o_result; + _o_result = ((e == Platform_ECONNREFUSED() || e == Platform_ECONNABORTED()) || e == Platform_ENETUNREACH()) || e == Platform_EHOSTUNREACH(); + return _o_result; +} + +LONGINT Platform_OSAllocate (LONGINT size) +{ + LONGINT _o_result; + _o_result = Platform_allocate(size); + return _o_result; +} + +void Platform_OSFree (LONGINT address) +{ + Platform_free(address); +} + +void Platform_Init (INTEGER argc, LONGINT argvadr) +{ + Platform_ArgVecPtr av = NIL; + Platform_MainStackFrame = argvadr; + Platform_ArgCount = argc; + av = (Platform_ArgVecPtr)(uintptr_t)argvadr; + Platform_ArgVector = (*av)[0]; + Platform_HaltCode = -128; + Platform_HeapInitHeap(); +} + +BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len) +{ + BOOLEAN _o_result; + Platform_EnvPtr p = NIL; + __DUP(var, var__len, CHAR); + p = Platform_getenv(var, var__len); + if (p != NIL) { + __COPY(*p, val, val__len); + } + _o_result = p != NIL; + __DEL(var); + return _o_result; +} + +void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len) +{ + __DUP(var, var__len, CHAR); + if (!Platform_getEnv(var, var__len, (void*)val, val__len)) { + val[0] = 0x00; + } + __DEL(var); +} + +void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len) +{ + Platform_ArgVec av = NIL; + if (n < Platform_ArgCount) { + av = (Platform_ArgVec)(uintptr_t)Platform_ArgVector; + __COPY(*(*av)[__X(n, ((LONGINT)(1024)))], val, val__len); + } +} + +void Platform_GetIntArg (INTEGER n, LONGINT *val) +{ + CHAR s[64]; + LONGINT k, d, i; + s[0] = 0x00; + Platform_GetArg(n, (void*)s, ((LONGINT)(64))); + i = 0; + if (s[0] == '-') { + i = 1; + } + k = 0; + d = (int)s[__X(i, ((LONGINT)(64)))] - 48; + while ((d >= 0 && d <= 9)) { + k = k * 10 + d; + i += 1; + d = (int)s[__X(i, ((LONGINT)(64)))] - 48; + } + if (s[0] == '-') { + k = -k; + i -= 1; + } + if (i > 0) { + *val = k; + } +} + +INTEGER Platform_ArgPos (CHAR *s, LONGINT s__len) +{ + INTEGER _o_result; + INTEGER i; + CHAR arg[256]; + __DUP(s, s__len, CHAR); + i = 0; + Platform_GetArg(i, (void*)arg, ((LONGINT)(256))); + while ((i < Platform_ArgCount && __STRCMP(s, arg) != 0)) { + i += 1; + Platform_GetArg(i, (void*)arg, ((LONGINT)(256))); + } + _o_result = i; + __DEL(s); + return _o_result; +} + +void Platform_SetInterruptHandler (Platform_SignalHandler handler) +{ + Platform_sethandler(2, handler); +} + +void Platform_SetQuitHandler (Platform_SignalHandler handler) +{ + Platform_sethandler(3, handler); +} + +void Platform_SetBadInstructionHandler (Platform_SignalHandler handler) +{ + Platform_sethandler(4, handler); +} + +static void Platform_YMDHMStoClock (LONGINT ye, LONGINT mo, LONGINT da, LONGINT ho, LONGINT mi, LONGINT se, LONGINT *t, LONGINT *d) +{ + *d = (__ASHL(__MOD(ye, 100), 9) + __ASHL(mo + 1, 5)) + da; + *t = (__ASHL(ho, 12) + __ASHL(mi, 6)) + se; +} + +void Platform_GetClock (LONGINT *t, LONGINT *d) +{ + Platform_gettimeval(); + Platform_sectotm(Platform_tvsec()); + Platform_YMDHMStoClock(Platform_tmyear(), Platform_tmmon(), Platform_tmmday(), Platform_tmhour(), Platform_tmmin(), Platform_tmsec(), &*t, &*d); +} + +void Platform_GetTimeOfDay (LONGINT *sec, LONGINT *usec) +{ + Platform_gettimeval(); + *sec = Platform_tvsec(); + *usec = Platform_tvusec(); +} + +LONGINT Platform_Time (void) +{ + LONGINT _o_result; + LONGINT ms; + Platform_gettimeval(); + ms = __DIVF(Platform_tvusec(), 1000) + Platform_tvsec() * 1000; + _o_result = __MOD(ms - Platform_TimeStart, 2147483647); + return _o_result; +} + +void Platform_Delay (LONGINT ms) +{ + LONGINT s, ns; + s = __DIV(ms, 1000); + ns = __MOD(ms, 1000) * 1000000; + Platform_nanosleep(s, ns); +} + +INTEGER Platform_System (CHAR *cmd, LONGINT cmd__len) +{ + INTEGER _o_result; + __DUP(cmd, cmd__len, CHAR); + _o_result = Platform_system(cmd, cmd__len); + __DEL(cmd); + return _o_result; +} + +INTEGER Platform_Error (void) +{ + INTEGER _o_result; + _o_result = Platform_err(); + return _o_result; +} + +INTEGER Platform_OldRO (CHAR *n, LONGINT n__len, LONGINT *h) +{ + INTEGER _o_result; + INTEGER fd; + fd = Platform_openro(n, n__len); + if (fd < 0) { + _o_result = Platform_err(); + return _o_result; + } else { + *h = fd; + _o_result = 0; + return _o_result; + } + __RETCHK; +} + +INTEGER Platform_OldRW (CHAR *n, LONGINT n__len, LONGINT *h) +{ + INTEGER _o_result; + INTEGER fd; + fd = Platform_openrw(n, n__len); + if (fd < 0) { + _o_result = Platform_err(); + return _o_result; + } else { + *h = fd; + _o_result = 0; + return _o_result; + } + __RETCHK; +} + +INTEGER Platform_New (CHAR *n, LONGINT n__len, LONGINT *h) +{ + INTEGER _o_result; + INTEGER fd; + fd = Platform_opennew(n, n__len); + if (fd < 0) { + _o_result = Platform_err(); + return _o_result; + } else { + *h = fd; + _o_result = 0; + return _o_result; + } + __RETCHK; +} + +INTEGER Platform_Close (LONGINT h) +{ + INTEGER _o_result; + if (Platform_closefile(h) < 0) { + _o_result = Platform_err(); + return _o_result; + } else { + _o_result = 0; + return _o_result; + } + __RETCHK; +} + +INTEGER Platform_Identify (LONGINT h, Platform_FileIdentity *identity, LONGINT *identity__typ) +{ + INTEGER _o_result; + Platform_structstats(); + if (Platform_fstat(h) < 0) { + _o_result = Platform_err(); + return _o_result; + } + (*identity).volume = Platform_statdev(); + (*identity).index = Platform_statino(); + (*identity).mtime = Platform_statmtime(); + _o_result = 0; + return _o_result; +} + +INTEGER Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ) +{ + INTEGER _o_result; + __DUP(n, n__len, CHAR); + Platform_structstats(); + if (Platform_stat(n, n__len) < 0) { + _o_result = Platform_err(); + __DEL(n); + return _o_result; + } + (*identity).volume = Platform_statdev(); + (*identity).index = Platform_statino(); + (*identity).mtime = Platform_statmtime(); + _o_result = 0; + __DEL(n); + return _o_result; +} + +BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2) +{ + BOOLEAN _o_result; + _o_result = (i1.index == i2.index && i1.volume == i2.volume); + return _o_result; +} + +BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2) +{ + BOOLEAN _o_result; + _o_result = i1.mtime == i2.mtime; + return _o_result; +} + +void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Platform_FileIdentity source) +{ + (*target).mtime = source.mtime; +} + +void Platform_MTimeAsClock (Platform_FileIdentity i, LONGINT *t, LONGINT *d) +{ + Platform_sectotm(i.mtime); + Platform_YMDHMStoClock(Platform_tmyear(), Platform_tmmon(), Platform_tmmday(), Platform_tmhour(), Platform_tmmin(), Platform_tmsec(), &*t, &*d); +} + +INTEGER Platform_Size (LONGINT h, LONGINT *l) +{ + INTEGER _o_result; + Platform_structstats(); + if (Platform_fstat(h) < 0) { + _o_result = Platform_err(); + return _o_result; + } + *l = Platform_statsize(); + _o_result = 0; + return _o_result; +} + +INTEGER Platform_Read (LONGINT h, LONGINT p, LONGINT l, LONGINT *n) +{ + INTEGER _o_result; + *n = Platform_readfile(h, p, l); + if (*n < 0) { + *n = 0; + _o_result = Platform_err(); + return _o_result; + } else { + _o_result = 0; + return _o_result; + } + __RETCHK; +} + +INTEGER Platform_ReadBuf (LONGINT h, SYSTEM_BYTE *b, LONGINT b__len, LONGINT *n) +{ + INTEGER _o_result; + *n = Platform_readfile(h, (LONGINT)(uintptr_t)b, b__len); + if (*n < 0) { + *n = 0; + _o_result = Platform_err(); + return _o_result; + } else { + _o_result = 0; + return _o_result; + } + __RETCHK; +} + +INTEGER Platform_Write (LONGINT h, LONGINT p, LONGINT l) +{ + INTEGER _o_result; + LONGINT written; + written = Platform_writefile(h, p, l); + if (written < 0) { + _o_result = Platform_err(); + return _o_result; + } else { + _o_result = 0; + return _o_result; + } + __RETCHK; +} + +INTEGER Platform_Sync (LONGINT h) +{ + INTEGER _o_result; + if (Platform_fsync(h) < 0) { + _o_result = Platform_err(); + return _o_result; + } else { + _o_result = 0; + return _o_result; + } + __RETCHK; +} + +INTEGER Platform_Seek (LONGINT h, LONGINT offset, INTEGER whence) +{ + INTEGER _o_result; + if (Platform_lseek(h, offset, whence) < 0) { + _o_result = Platform_err(); + return _o_result; + } else { + _o_result = 0; + return _o_result; + } + __RETCHK; +} + +INTEGER Platform_Truncate (LONGINT h, LONGINT l) +{ + INTEGER _o_result; + if (Platform_ftruncate(h, l) < 0) { + _o_result = Platform_err(); + return _o_result; + } else { + _o_result = 0; + return _o_result; + } + __RETCHK; +} + +INTEGER Platform_Unlink (CHAR *n, LONGINT n__len) +{ + INTEGER _o_result; + if (Platform_unlink(n, n__len) < 0) { + _o_result = Platform_err(); + return _o_result; + } else { + _o_result = 0; + return _o_result; + } + __RETCHK; +} + +INTEGER Platform_Chdir (CHAR *n, LONGINT n__len) +{ + INTEGER _o_result; + INTEGER r; + r = Platform_chdir(n, n__len); + Platform_getcwd((void*)Platform_CWD, ((LONGINT)(256))); + if (r < 0) { + _o_result = Platform_err(); + return _o_result; + } else { + _o_result = 0; + return _o_result; + } + __RETCHK; +} + +INTEGER Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) +{ + INTEGER _o_result; + if (Platform_rename(o, o__len, n, n__len) < 0) { + _o_result = Platform_err(); + return _o_result; + } else { + _o_result = 0; + return _o_result; + } + __RETCHK; +} + +void Platform_Exit (INTEGER code) +{ + Platform_exit(code); +} + +static void Platform_errch (CHAR c) +{ + Platform_errc(c); +} + +static void Platform_errln (void) +{ + Platform_errch(0x0d); + Platform_errch(0x0a); +} + +static void Platform_errposint (LONGINT l) +{ + if (l > 10) { + Platform_errposint(__DIV(l, 10)); + } + Platform_errch((CHAR)(48 + __MOD(l, 10))); +} + +static void Platform_errint (LONGINT l) +{ + if (l < 0) { + Platform_errch('-'); + l = -l; + } + Platform_errposint(l); +} + +static void Platform_DisplayHaltCode (LONGINT code) +{ + switch (code) { + case -1: + Platform_errstring((CHAR*)"Assertion failure.", (LONGINT)19); + break; + case -2: + Platform_errstring((CHAR*)"Index out of range.", (LONGINT)20); + break; + case -3: + Platform_errstring((CHAR*)"Reached end of function without reaching RETURN.", (LONGINT)49); + break; + case -4: + Platform_errstring((CHAR*)"CASE statement: no matching label and no ELSE.", (LONGINT)47); + break; + case -5: + Platform_errstring((CHAR*)"Type guard failed.", (LONGINT)19); + break; + case -6: + Platform_errstring((CHAR*)"Implicit type guard in record assignment failed.", (LONGINT)49); + break; + case -7: + Platform_errstring((CHAR*)"Invalid case in WITH statement.", (LONGINT)32); + break; + case -8: + Platform_errstring((CHAR*)"Value out of range.", (LONGINT)20); + break; + case -9: + Platform_errstring((CHAR*)"Heap interrupted while locked, but lockdepth = 0 at unlock.", (LONGINT)60); + break; + case -10: + Platform_errstring((CHAR*)"NIL access.", (LONGINT)12); + break; + case -11: + Platform_errstring((CHAR*)"Alignment error.", (LONGINT)17); + break; + case -12: + Platform_errstring((CHAR*)"Divide by zero.", (LONGINT)16); + break; + case -13: + Platform_errstring((CHAR*)"Arithmetic overflow/underflow.", (LONGINT)31); + break; + case -14: + Platform_errstring((CHAR*)"Invalid function argument.", (LONGINT)27); + break; + case -15: + Platform_errstring((CHAR*)"Internal error, e.g. Type descriptor size mismatch.", (LONGINT)52); + break; + case -20: + Platform_errstring((CHAR*)"Too many, or negative number of, elements in dynamic array.", (LONGINT)60); + break; + default: + break; + } +} + +void Platform_Halt (LONGINT code) +{ + INTEGER e; + Platform_HaltCode = code; + if (Platform_HaltHandler != NIL) { + (*Platform_HaltHandler)(code); + } + Platform_errstring((CHAR*)"Terminated by Halt(", (LONGINT)20); + Platform_errint(code); + Platform_errstring((CHAR*)"). ", (LONGINT)4); + if (code < 0) { + Platform_DisplayHaltCode(code); + } + Platform_errln(); + Platform_exit(__VAL(INTEGER, code)); +} + +void Platform_AssertFail (LONGINT code) +{ + INTEGER e; + Platform_errstring((CHAR*)"Assertion failure.", (LONGINT)19); + if (code != 0) { + Platform_errstring((CHAR*)" ASSERT code ", (LONGINT)14); + Platform_errint(code); + Platform_errstring((CHAR*)".", (LONGINT)2); + } + Platform_errln(); + Platform_exit(__VAL(INTEGER, code)); +} + +void Platform_SetHalt (Platform_HaltProcedure p) +{ + Platform_HaltHandler = p; +} + +static void Platform_TestLittleEndian (void) +{ + INTEGER i; + i = 1; + __GET((LONGINT)(uintptr_t)&i, Platform_LittleEndian, BOOLEAN); +} + +__TDESC(Platform_FileIdentity, 1, 0) = {__TDFLDS("FileIdentity", 12), {-4}}; + +export void *Platform__init(void) +{ + __DEFMOD; + __REGMOD("Platform", 0); + __INITYP(Platform_FileIdentity, Platform_FileIdentity, 0); +/* BEGIN */ + Platform_TestLittleEndian(); + Platform_HaltCode = -128; + Platform_HaltHandler = NIL; + Platform_TimeStart = Platform_Time(); + Platform_CWD[0] = 0x00; + Platform_getcwd((void*)Platform_CWD, ((LONGINT)(256))); + Platform_PID = Platform_getpid(); + Platform_SeekSet = Platform_seekset(); + Platform_SeekCur = Platform_seekcur(); + Platform_SeekEnd = Platform_seekend(); + Platform_nl[0] = 0x0a; + Platform_nl[1] = 0x00; + __ENDMOD; +} diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h new file mode 100644 index 00000000..8b47d1c9 --- /dev/null +++ b/bootstrap/unix-48/Platform.h @@ -0,0 +1,82 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ + +#ifndef Platform__h +#define Platform__h + +#include "SYSTEM.h" + +typedef + struct Platform_FileIdentity { + LONGINT volume, index, mtime; + } Platform_FileIdentity; + +typedef + void (*Platform_HaltProcedure)(LONGINT); + +typedef + void (*Platform_SignalHandler)(INTEGER); + + +import BOOLEAN Platform_LittleEndian; +import LONGINT Platform_MainStackFrame, Platform_HaltCode; +import INTEGER Platform_PID; +import CHAR Platform_CWD[256]; +import INTEGER Platform_ArgCount; +import LONGINT Platform_ArgVector; +import INTEGER Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; +import CHAR Platform_nl[3]; + +import LONGINT *Platform_FileIdentity__typ; + +import BOOLEAN Platform_Absent (INTEGER e); +import INTEGER Platform_ArgPos (CHAR *s, LONGINT s__len); +import void Platform_AssertFail (LONGINT code); +import INTEGER Platform_Chdir (CHAR *n, LONGINT n__len); +import INTEGER Platform_Close (LONGINT h); +import BOOLEAN Platform_ConnectionFailed (INTEGER e); +import void Platform_Delay (LONGINT ms); +import BOOLEAN Platform_DifferentFilesystems (INTEGER e); +import INTEGER Platform_Error (void); +import void Platform_Exit (INTEGER code); +import void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len); +import void Platform_GetClock (LONGINT *t, LONGINT *d); +import void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); +import void Platform_GetIntArg (INTEGER n, LONGINT *val); +import void Platform_GetTimeOfDay (LONGINT *sec, LONGINT *usec); +import void Platform_Halt (LONGINT code); +import INTEGER Platform_Identify (LONGINT h, Platform_FileIdentity *identity, LONGINT *identity__typ); +import INTEGER Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); +import BOOLEAN Platform_Inaccessible (INTEGER e); +import void Platform_Init (INTEGER argc, LONGINT argvadr); +import void Platform_MTimeAsClock (Platform_FileIdentity i, LONGINT *t, LONGINT *d); +import INTEGER Platform_New (CHAR *n, LONGINT n__len, LONGINT *h); +import BOOLEAN Platform_NoSuchDirectory (INTEGER e); +import LONGINT Platform_OSAllocate (LONGINT size); +import void Platform_OSFree (LONGINT address); +import INTEGER Platform_OldRO (CHAR *n, LONGINT n__len, LONGINT *h); +import INTEGER Platform_OldRW (CHAR *n, LONGINT n__len, LONGINT *h); +import INTEGER Platform_Read (LONGINT h, LONGINT p, LONGINT l, LONGINT *n); +import INTEGER Platform_ReadBuf (LONGINT h, SYSTEM_BYTE *b, LONGINT b__len, LONGINT *n); +import INTEGER Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); +import BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); +import BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); +import INTEGER Platform_Seek (LONGINT h, LONGINT offset, INTEGER whence); +import void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); +import void Platform_SetHalt (Platform_HaltProcedure p); +import void Platform_SetInterruptHandler (Platform_SignalHandler handler); +import void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Platform_FileIdentity source); +import void Platform_SetQuitHandler (Platform_SignalHandler handler); +import INTEGER Platform_Size (LONGINT h, LONGINT *l); +import INTEGER Platform_Sync (LONGINT h); +import INTEGER Platform_System (CHAR *cmd, LONGINT cmd__len); +import LONGINT Platform_Time (void); +import BOOLEAN Platform_TimedOut (INTEGER e); +import BOOLEAN Platform_TooManyFiles (INTEGER e); +import INTEGER Platform_Truncate (LONGINT h, LONGINT l); +import INTEGER Platform_Unlink (CHAR *n, LONGINT n__len); +import INTEGER Platform_Write (LONGINT h, LONGINT p, LONGINT l); +import BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); +import void *Platform__init(void); + + +#endif diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c new file mode 100644 index 00000000..65dad750 --- /dev/null +++ b/bootstrap/unix-48/Reals.c @@ -0,0 +1,155 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +#include "SYSTEM.h" + + + + +export void Reals_Convert (REAL x, INTEGER n, CHAR *d, LONGINT d__len); +export void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len); +export void Reals_ConvertHL (LONGREAL y, CHAR *d, LONGINT d__len); +export void Reals_ConvertL (LONGREAL x, INTEGER n, CHAR *d, LONGINT d__len); +export INTEGER Reals_Expo (REAL x); +export INTEGER Reals_ExpoL (LONGREAL x); +export REAL Reals_Ten (INTEGER e); +export LONGREAL Reals_TenL (INTEGER e); +static CHAR Reals_ToHex (INTEGER i); + + +REAL Reals_Ten (INTEGER e) +{ + REAL _o_result; + LONGREAL r, power; + r = (LONGREAL)1; + power = (LONGREAL)10; + while (e > 0) { + if (__ODD(e)) { + r = r * power; + } + power = power * power; + e = __ASHR(e, 1); + } + _o_result = r; + return _o_result; +} + +LONGREAL Reals_TenL (INTEGER e) +{ + LONGREAL _o_result; + LONGREAL r, power; + r = (LONGREAL)1; + power = (LONGREAL)10; + for (;;) { + if (__ODD(e)) { + r = r * power; + } + e = __ASHR(e, 1); + if (e <= 0) { + _o_result = r; + return _o_result; + } + power = power * power; + } + __RETCHK; +} + +INTEGER Reals_Expo (REAL x) +{ + INTEGER _o_result; + _o_result = (int)__MASK(__ASHR((LONGINT)(__VAL(INTEGER, x)), 23), -256); + return _o_result; +} + +INTEGER Reals_ExpoL (LONGREAL x) +{ + INTEGER _o_result; + INTEGER i; + LONGINT l; + __GET((LONGINT)(uintptr_t)&x + 4, l, LONGINT); + _o_result = (int)__MASK(__ASHR(l, 20), -2048); + return _o_result; +} + +void Reals_ConvertL (LONGREAL x, INTEGER n, CHAR *d, LONGINT d__len) +{ + LONGINT i, j, k; + if (x < (LONGREAL)0) { + x = -x; + } + k = 0; + if (n > 9) { + i = __ENTIER(x / (LONGREAL)(LONGREAL)1000000000); + j = __ENTIER(x - i * (LONGREAL)1000000000); + if (j < 0) { + j = 0; + } + while (k < 9) { + d[__X(k, d__len)] = (CHAR)(__MOD(j, 10) + 48); + j = __DIV(j, 10); + k += 1; + } + } else { + i = __ENTIER(x); + } + while (k < (LONGINT)n) { + d[__X(k, d__len)] = (CHAR)(__MOD(i, 10) + 48); + i = __DIV(i, 10); + k += 1; + } +} + +void Reals_Convert (REAL x, INTEGER n, CHAR *d, LONGINT d__len) +{ + Reals_ConvertL(x, n, (void*)d, d__len); +} + +static CHAR Reals_ToHex (INTEGER i) +{ + CHAR _o_result; + if (i < 10) { + _o_result = (CHAR)(i + 48); + return _o_result; + } else { + _o_result = (CHAR)(i + 55); + return _o_result; + } + __RETCHK; +} + +typedef + CHAR (*pc4__3)[4]; + +void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len) +{ + pc4__3 p = NIL; + INTEGER i; + p = (pc4__3)(uintptr_t)((LONGINT)(uintptr_t)&y); + i = 0; + while (i < 4) { + d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((int)(*p)[__X(i, ((LONGINT)(4)))], 4)); + d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((int)(*p)[__X(i, ((LONGINT)(4)))], -16)); + } +} + +typedef + CHAR (*pc8__5)[8]; + +void Reals_ConvertHL (LONGREAL y, CHAR *d, LONGINT d__len) +{ + pc8__5 p = NIL; + INTEGER i; + p = (pc8__5)(uintptr_t)((LONGINT)(uintptr_t)&y); + i = 0; + while (i < 8) { + d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((int)(*p)[__X(i, ((LONGINT)(8)))], 4)); + d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((int)(*p)[__X(i, ((LONGINT)(8)))], -16)); + } +} + + +export void *Reals__init(void) +{ + __DEFMOD; + __REGMOD("Reals", 0); +/* BEGIN */ + __ENDMOD; +} diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h new file mode 100644 index 00000000..166e977b --- /dev/null +++ b/bootstrap/unix-48/Reals.h @@ -0,0 +1,22 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ + +#ifndef Reals__h +#define Reals__h + +#include "SYSTEM.h" + + + + +import void Reals_Convert (REAL x, INTEGER n, CHAR *d, LONGINT d__len); +import void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len); +import void Reals_ConvertHL (LONGREAL y, CHAR *d, LONGINT d__len); +import void Reals_ConvertL (LONGREAL x, INTEGER n, CHAR *d, LONGINT d__len); +import INTEGER Reals_Expo (REAL x); +import INTEGER Reals_ExpoL (LONGREAL x); +import REAL Reals_Ten (INTEGER e); +import LONGREAL Reals_TenL (INTEGER e); +import void *Reals__init(void); + + +#endif diff --git a/bootstrap/unix-48/SYSTEM.c b/bootstrap/unix-48/SYSTEM.c new file mode 100644 index 00000000..0fcc5ee2 --- /dev/null +++ b/bootstrap/unix-48/SYSTEM.c @@ -0,0 +1,207 @@ +/* +* The body prefix file of the voc(jet backend) runtime system, Version 1.0 +* +* Copyright (c) Software Templ, 1994, 1995 +* +* Module SYSTEM is subject to change any time without prior notification. +* Software Templ disclaims all warranties with regard to module SYSTEM, +* in particular shall Software Templ not be liable for any damage resulting +* from inappropriate use or modification of module SYSTEM. +* +* Version 1.1 jt, 24.11.95 fixes for correct pointer arithmetic on Cray computers +* jt 31.1.2007 ANSI prototypes for malloc and exit in order to avoid cc warnings +* +*/ + +#include "SYSTEM.h" +#include "stdarg.h" +#include + + +LONGINT SYSTEM_XCHK(LONGINT i, LONGINT ub) {return __X(i, ub);} +LONGINT SYSTEM_RCHK(LONGINT i, LONGINT ub) {return __R(i, ub);} +LONGINT SYSTEM_ASH (LONGINT i, LONGINT n) {return __ASH(i, n);} +LONGINT SYSTEM_ABS (LONGINT i) {return __ABS(i);} +double SYSTEM_ABSD(double i) {return __ABS(i);} + +void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0) +{ + t -= __TPROC0OFF; + t0 -= __TPROC0OFF; + while (*t0 != __EOM) {*t = *t0; t--; t0--;} +} + + +void SYSTEM_ENUMP(void *adr, LONGINT n, void (*P)()) +{ + while (n > 0) { + P((LONGINT)(uintptr_t)(*((void**)(adr)))); + adr = ((void**)adr) + 1; + n--; + } +} + +void SYSTEM_ENUMR(void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()) +{ + LONGINT *t, off; + typ++; + while (n > 0) { + t = typ; + off = *t; + while (off >= 0) {P(*(LONGINT*)((char*)adr+off)); t++; off = *t;} + adr = ((char*)adr) + size; + n--; + } +} + +LONGINT SYSTEM_DIV(unsigned LONGINT x, unsigned LONGINT y) +{ if ((LONGINT) x >= 0) return (x / y); + else return -((y - 1 - x) / y); +} + +LONGINT SYSTEM_MOD(unsigned LONGINT x, unsigned LONGINT y) +{ unsigned LONGINT m; + if ((LONGINT) x >= 0) return (x % y); + else { m = (-x) % y; + if (m != 0) return (y - m); else return 0; + } +} + +LONGINT SYSTEM_ENTIER(double x) +{ + LONGINT y; + if (x >= 0) + return (LONGINT)x; + else { + y = (LONGINT)x; + if (y <= x) return y; else return y - 1; + } +} + +extern void Heap_Lock(); +extern void Heap_Unlock(); + +SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, int nofdyn, ...) +{ + LONGINT nofelems, size, dataoff, n, nptr, *x, *p, nofptrs, i, *ptab, off; + va_list ap; + va_start(ap, nofdyn); + nofelems = 1; + while (nofdim > 0) { + nofelems = nofelems * va_arg(ap, LONGINT); nofdim--; + if (nofelems <= 0) __HALT(-20); + } + va_end(ap); + dataoff = nofdyn * sizeof(LONGINT); + if (elemalgn > sizeof(LONGINT)) { + n = dataoff % elemalgn; + if (n != 0) dataoff += elemalgn - n; + } + size = dataoff + nofelems * elemsz; + Heap_Lock(); + if (typ == NIL) { + /* element typ does not contain pointers */ + x = Heap_NEWBLK(size); + } + else if (typ == (LONGINT*)POINTER__typ) { + /* element type is a pointer */ + x = Heap_NEWBLK(size + nofelems * sizeof(LONGINT)); + p = (LONGINT*)(uintptr_t)x[-1]; + p[-nofelems] = *p; /* build new type desc in situ: 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ + p -= nofelems - 1; n = 1; /* n =1 for skipping the size field */ + while (n <= nofelems) {*p = n*sizeof(LONGINT); p++; n++;} + *p = - (nofelems + 1) * sizeof(LONGINT); /* sentinel */ + x[-1] -= nofelems * sizeof(LONGINT); + } + else { + /* element type is a record that contains pointers */ + ptab = typ + 1; nofptrs = 0; + while (ptab[nofptrs] >= 0) {nofptrs++;} /* number of pointers per element */ + nptr = nofelems * nofptrs; /* total number of pointers */ + x = Heap_NEWBLK(size + nptr * sizeof(LONGINT)); + p = (LONGINT*)(uintptr_t)x[- 1]; + p[-nptr] = *p; /* build new type desc in situ; 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ + p -= nptr - 1; n = 0; off = dataoff; + while (n < nofelems) {i = 0; + while (i < nofptrs) {*p = off + ptab[i]; p++; i++;} + off += elemsz; n++; + } + *p = - (nptr + 1) * sizeof(LONGINT); /* sentinel */ + x[-1] -= nptr * sizeof(LONGINT); + } + if (nofdyn != 0) { + /* setup len vector for index checks */ + va_start(ap, nofdyn); + p = x; + while (nofdyn > 0) {*p = va_arg(ap, LONGINT); p++, nofdyn--;} + va_end(ap); + } + Heap_Unlock(); + return x; +} + + + + +typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler + +#ifndef _WIN32 + + SystemSignalHandler handler[3] = {0}; + + // Provide signal handling for Unix based systems + void signalHandler(int s) { + if (s >= 2 && s <= 4) handler[s-2](s); + // (Ignore other signals) + } + + void SystemSetHandler(int s, uintptr_t h) { + if (s >= 2 && s <= 4) { + int needtosetsystemhandler = handler[s-2] == 0; + handler[s-2] = (SystemSignalHandler)h; + if (needtosetsystemhandler) {signal(s, signalHandler);} + } + } + +#else + + // Provides Windows callback handlers for signal-like scenarios + #include "WindowsWrapper.h" + + SystemSignalHandler SystemInterruptHandler = 0; + SystemSignalHandler SystemQuitHandler = 0; + BOOL ConsoleCtrlHandlerSet = FALSE; + + BOOL WINAPI SystemConsoleCtrlHandler(DWORD ctrlType) { + if ((ctrlType == CTRL_C_EVENT) || (ctrlType == CTRL_BREAK_EVENT)) { + if (SystemInterruptHandler) { + SystemInterruptHandler(2); // SIGINT + return TRUE; + } + } else { // Close, logoff or shutdown + if (SystemQuitHandler) { + SystemQuitHandler(3); // SIGQUIT + return TRUE; + } + } + return FALSE; + } + + void EnsureConsoleCtrlHandler() { + if (!ConsoleCtrlHandlerSet) { + SetConsoleCtrlHandler(SystemConsoleCtrlHandler, TRUE); + ConsoleCtrlHandlerSet = TRUE; + } + } + + void SystemSetInterruptHandler(uintptr_t h) { + EnsureConsoleCtrlHandler(); + SystemInterruptHandler = (SystemSignalHandler)h; + } + + void SystemSetQuitHandler(uintptr_t h) { + EnsureConsoleCtrlHandler(); + SystemQuitHandler = (SystemSignalHandler)h; + } + +#endif diff --git a/bootstrap/unix-48/SYSTEM.h b/bootstrap/unix-48/SYSTEM.h new file mode 100644 index 00000000..f9e2f930 --- /dev/null +++ b/bootstrap/unix-48/SYSTEM.h @@ -0,0 +1,275 @@ +#ifndef SYSTEM__h +#define SYSTEM__h + +#ifndef _WIN32 + + // Building for a Unix/Linux based system + #include // For memcpy ... + #include // For uintptr_t ... + +#else + + // Building for Windows platform with either mingw under cygwin, or the MS C compiler + #ifdef _WIN64 + typedef unsigned long long size_t; + typedef unsigned long long uintptr_t; + #else + typedef unsigned int size_t; + typedef unsigned int uintptr_t; + #endif /* _WIN64 */ + + typedef unsigned int uint32_t; + void * __cdecl memcpy(void * dest, const void * source, size_t size); + +#endif + + +// The compiler uses 'import' and 'export' which translate to 'extern' and +// nothing respectively. + +#define import extern +#define export + + + +// Known constants + +#define NIL ((void*)0) +#define __MAXEXT 16 +#define POINTER__typ ((LONGINT*)(1)) // not NIL and not a valid type + + +// Oberon types + +#define BOOLEAN char +#define SYSTEM_BYTE unsigned char +#define CHAR unsigned char +#define SHORTINT signed char +#define REAL float +#define LONGREAL double +#define SYSTEM_PTR void* + +// For 32 bit builds, the size of LONGINT depends on a make option: + +#if (__SIZEOF_POINTER__ == 8) || defined(LARGE) || defined(_WIN64) + #define INTEGER int // INTEGER is 32 bit. + #define LONGINT long long // LONGINT is 64 bit. (long long is always 64 bits, while long can be 32 bits e.g. under MSC/MingW) +#else + #define INTEGER short int // INTEGER is 16 bit. + #define LONGINT long // LONGINT is 32 bit. +#endif + +#define SET unsigned LONGINT + + +// OS Memory allocation interfaces are in PlatformXXX.Mod + +extern LONGINT Platform_OSAllocate (LONGINT size); +extern void Platform_OSFree (LONGINT addr); + + +// Run time system routines in SYSTEM.c + +extern LONGINT SYSTEM_XCHK (LONGINT i, LONGINT ub); +extern LONGINT SYSTEM_RCHK (LONGINT i, LONGINT ub); +extern LONGINT SYSTEM_ASH (LONGINT i, LONGINT n); +extern LONGINT SYSTEM_ABS (LONGINT i); +extern double SYSTEM_ABSD (double i); +extern void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0); +extern void SYSTEM_ENUMP (void *adr, LONGINT n, void (*P)()); +extern void SYSTEM_ENUMR (void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()); +extern LONGINT SYSTEM_DIV (unsigned LONGINT x, unsigned LONGINT y); +extern LONGINT SYSTEM_MOD (unsigned LONGINT x, unsigned LONGINT y); +extern LONGINT SYSTEM_ENTIER (double x); + + +// Signal handling in SYSTEM.c + +#ifndef _WIN32 + extern void SystemSetHandler(int s, uintptr_t h); +#else + extern void SystemSetInterruptHandler(uintptr_t h); + extern void SystemSetQuitHandler (uintptr_t h); +#endif + + + +// String comparison + +static int __str_cmp(CHAR *x, CHAR *y){ + LONGINT i = 0; + CHAR ch1, ch2; + do {ch1 = x[i]; ch2 = y[i]; i++; + if (!ch1) return -(int)ch2; + } while (ch1==ch2); + return (int)ch1 - (int)ch2; +} +#define __STRCMP(a,b) __str_cmp((CHAR*)(a), (CHAR*)(b)) + + + +// Inline string, record and array copy + +#define __COPY(s, d, n) {char*_a=(void*)s,*_b=(void*)d; LONGINT _i=0,_t=n-1; \ + while(_i<_t&&((_b[_i]=_a[_i])!=0)){_i++;};_b[_i]=0;} +#define __DUP(x, l, t) x=(void*)memcpy((void*)(uintptr_t)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) +#define __DUPARR(v, t) v=(void*)memcpy(v##__copy,v,sizeof(t)) +#define __DEL(x) Platform_OSFree((LONGINT)(uintptr_t)x) + + + + +/* SYSTEM ops */ + +#define __VAL(t, x) ((t)(x)) +#define __VALP(t, x) ((t)(uintptr_t)(x)) + +#define __GET(a, x, t) x= *(t*)(uintptr_t)(a) +#define __PUT(a, x, t) *(t*)(uintptr_t)(a)=x +#define __LSHL(x, n, t) ((t)((unsigned t)(x)<<(n))) +#define __LSHR(x, n, t) ((t)((unsigned t)(x)>>(n))) +#define __LSH(x, n, t) ((n)>=0? __LSHL(x, n, t): __LSHR(x, -(n), t)) +#define __ROTL(x, n, t) ((t)((unsigned t)(x)<<(n)|(unsigned t)(x)>>(8*sizeof(t)-(n)))) +#define __ROTR(x, n, t) ((t)((unsigned t)(x)>>(n)|(unsigned t)(x)<<(8*sizeof(t)-(n)))) +#define __LSHR(x, n, t) ((t)((unsigned t)(x)>>(n))) +#define __LSH(x, n, t) ((n)>=0? __LSHL(x, n, t): __LSHR(x, -(n), t)) +#define __ROTL(x, n, t) ((t)((unsigned t)(x)<<(n)|(unsigned t)(x)>>(8*sizeof(t)-(n)))) +#define __ROTR(x, n, t) ((t)((unsigned t)(x)>>(n)|(unsigned t)(x)<<(8*sizeof(t)-(n)))) +#define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) +#define __BIT(x, n) (*(unsigned LONGINT*)(x)>>(n)&1) +#define __MOVE(s, d, n) memcpy((char*)(uintptr_t)(d),(char*)(uintptr_t)(s),n) +#define __ASHL(x, n) ((LONGINT)(x)<<(n)) +#define __ASHR(x, n) ((LONGINT)(x)>>(n)) +#define __ASH(x, n) ((n)>=0?__ASHL(x,n):__ASHR(x,-(n))) +#define __ASHF(x, n) SYSTEM_ASH((LONGINT)(x), (LONGINT)(n)) +#define __SHORT(x, y) ((int)((unsigned LONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) +#define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) +#define __CHR(x) ((CHAR)__R(x, 256)) +#define __CHRF(x) ((CHAR)__RF(x, 256)) +#define __DIV(x, y) ((x)>=0?(x)/(y):-(((y)-1-(x))/(y))) +#define __DIVF(x, y) SYSTEM_DIV((LONGINT)(x),(LONGINT)(y)) +#define __MOD(x, y) ((x)>=0?(x)%(y):__MODF(x,y)) +#define __MODF(x, y) SYSTEM_MOD((LONGINT)(x),(LONGINT)(y)) +#define __ENTIER(x) SYSTEM_ENTIER(x) +#define __ABS(x) (((x)<0)?-(x):(x)) +#define __ABSF(x) SYSTEM_ABS((LONGINT)(x)) +#define __ABSFD(x) SYSTEM_ABSD((double)(x)) +#define __CAP(ch) ((CHAR)((ch)&0x5f)) +#define __ODD(x) ((x)&1) +#define __IN(x, s) (((s)>>(x))&1) +#define __SETOF(x) ((SET)1<<(x)) +#define __SETRNG(l, h) ((~(SET)0<<(l))&~(SET)0>>(8*sizeof(SET)-1-(h))) +#define __MASK(x, m) ((x)&~(m)) + + + +// Runtime checks + +#define __X(i, ub) (((unsigned LONGINT)(i)<(unsigned LONGINT)(ub))?i:(__HALT(-2),0)) +#define __XF(i, ub) SYSTEM_XCHK((LONGINT)(i), (LONGINT)(ub)) +#define __R(i, ub) (((unsigned LONGINT)(i)<(unsigned LONGINT)(ub))?i:(__HALT(-8),0)) +#define __RF(i, ub) SYSTEM_RCHK((LONGINT)(i),(LONGINT)(ub)) +#define __RETCHK __retchk: __HALT(-3); return 0; +#define __CASECHK __HALT(-4) +#define __WITHCHK __HALT(-7) + +#define __GUARDP(p, typ, level) ((typ*)(__ISP(p,typ,level)?p:(__HALT(-5),p))) +#define __GUARDR(r, typ, level) (*((typ*)(__IS(r##__typ,typ,level)?r:(__HALT(-5),r)))) +#define __GUARDA(p, typ, level) ((struct typ*)(__IS(__TYPEOF(p),typ,level)?p:(__HALT(-5),p))) +#define __GUARDEQR(p, dyntyp, typ) if(dyntyp!=typ##__typ) __HALT(-6);*(p) +#define __GUARDEQP(p, typ) if(__TYPEOF(p)!=typ##__typ)__HALT(-6);*(p) + + + +// Module entry/registration/exit + +extern void Heap_REGCMD(); +extern SYSTEM_PTR Heap_REGMOD(); +extern void Heap_REGTYP(); +extern void Heap_INCREF(); + +#define __DEFMOD static void *m; if (m!=0) {return m;} +#define __REGCMD(name, cmd) Heap_REGCMD(m, (CHAR*)name, cmd) +#define __REGMOD(name, enum) if (m==0) {m = Heap_REGMOD((CHAR*)name,enum);} +#define __ENDMOD return m +#define __MODULE_IMPORT(name) Heap_INCREF(name##__init()) + + + +// Main module initialisation, registration and finalisation + +extern void Platform_Init(INTEGER argc, LONGINT argv); +extern void *Platform_MainModule; +extern void Heap_FINALL(); + +#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (LONGINT)(uintptr_t)&argv); +#define __REGMAIN(name, enum) m = Heap_REGMOD((CHAR*)name,enum) +#define __FINI Heap_FINALL(); return 0 + + +// Assertions and Halts + +extern void Platform_Halt(LONGINT x); +extern void Platform_AssertFail(LONGINT x); + +#define __HALT(x) Platform_Halt(x) +#define __ASSERT(cond, x) if (!(cond)) Platform_AssertFail((LONGINT)(x)) + + +// Memory allocation + +extern SYSTEM_PTR Heap_NEWBLK (LONGINT size); +extern SYSTEM_PTR Heap_NEWREC (LONGINT tag); +extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); + +#define __SYSNEW(p, len) p = Heap_NEWBLK((LONGINT)(len)) +#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(uintptr_t)t##__typ) +#define __NEWARR SYSTEM_NEWARR + + + +/* Type handling */ + +#define __TDESC(t, m, n) \ + static struct t##__desc { \ + LONGINT tproc[m]; /* Proc for each ptr field */ \ + LONGINT tag; \ + LONGINT next; /* Module table type list points here */ \ + LONGINT level; \ + LONGINT module; \ + char name[24]; \ + LONGINT basep[__MAXEXT]; /* List of bases this extends */ \ + LONGINT reserved; \ + LONGINT blksz; /* xxx_typ points here */ \ + LONGINT ptr[n+1]; /* Offsets of ptrs up to -ve sentinel */ \ + } t##__desc + +#define __BASEOFF (__MAXEXT+1) // blksz as index to base. +#define __TPROC0OFF (__BASEOFF+24/sizeof(LONGINT)+5) // blksz as index to tproc IFF m=1. +#define __EOM 1 +#define __TDFLDS(name, size) {__EOM}, 1, 0, 0, 0, name, {0}, 0, size +#define __ENUMP(adr, n, P) SYSTEM_ENUMP(adr, (LONGINT)(n), P) +#define __ENUMR(adr, typ, size, n, P) SYSTEM_ENUMR(adr, typ, (LONGINT)(size), (LONGINT)(n), P) + +#define __INITYP(t, t0, level) \ + t##__typ = (LONGINT*)&t##__desc.blksz; \ + memcpy(t##__desc.basep, t0##__typ - __BASEOFF, level*sizeof(LONGINT)); \ + t##__desc.basep[level] = (LONGINT)(uintptr_t)t##__typ; \ + t##__desc.module = (LONGINT)(uintptr_t)m; \ + if(t##__desc.blksz!=sizeof(struct t)) __HALT(-15); \ + t##__desc.blksz = (t##__desc.blksz+5*sizeof(LONGINT)-1)/(4*sizeof(LONGINT))*(4*sizeof(LONGINT)); \ + Heap_REGTYP(m, (LONGINT)(uintptr_t)&t##__desc.next); \ + SYSTEM_INHERIT(t##__typ, t0##__typ) + +#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(uintptr_t)typ##__typ) +#define __TYPEOF(p) ((LONGINT*)(uintptr_t)(*(((LONGINT*)(p))-1))) +#define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) + +// Oberon-2 type bound procedures support +#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(uintptr_t)proc +#define __SEND(typ, num, funtyp, parlist) ((funtyp)((uintptr_t)*(typ-(__TPROC0OFF+num))))parlist + + + + +#endif diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c new file mode 100644 index 00000000..5038ca68 --- /dev/null +++ b/bootstrap/unix-48/Strings.c @@ -0,0 +1,243 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +#include "SYSTEM.h" + + + + +export void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len); +export void Strings_Cap (CHAR *s, LONGINT s__len); +export void Strings_Delete (CHAR *s, LONGINT s__len, INTEGER pos, INTEGER n); +export void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n, CHAR *dest, LONGINT dest__len); +export void Strings_Insert (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, LONGINT dest__len); +export INTEGER Strings_Length (CHAR *s, LONGINT s__len); +export BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len); +export INTEGER Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, INTEGER pos); +export void Strings_Replace (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, LONGINT dest__len); + + +INTEGER Strings_Length (CHAR *s, LONGINT s__len) +{ + INTEGER _o_result; + INTEGER i; + __DUP(s, s__len, CHAR); + i = 0; + while (((LONGINT)i < s__len && s[__X(i, s__len)] != 0x00)) { + i += 1; + } + _o_result = i; + __DEL(s); + return _o_result; +} + +void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len) +{ + INTEGER n1, n2, i; + __DUP(extra, extra__len, CHAR); + n1 = Strings_Length(dest, dest__len); + n2 = Strings_Length(extra, extra__len); + i = 0; + while ((i < n2 && (LONGINT)(i + n1) < dest__len)) { + dest[__X(i + n1, dest__len)] = extra[__X(i, extra__len)]; + i += 1; + } + if ((LONGINT)(i + n1) < dest__len) { + dest[__X(i + n1, dest__len)] = 0x00; + } + __DEL(extra); +} + +void Strings_Insert (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, LONGINT dest__len) +{ + INTEGER n1, n2, i; + __DUP(source, source__len, CHAR); + n1 = Strings_Length(dest, dest__len); + n2 = Strings_Length(source, source__len); + if (pos < 0) { + pos = 0; + } + if (pos > n1) { + Strings_Append(dest, dest__len, (void*)source, source__len); + return; + } + if ((LONGINT)(pos + n2) < dest__len) { + i = n1; + while (i >= pos) { + if ((LONGINT)(i + n2) < dest__len) { + dest[__X(i + n2, dest__len)] = dest[__X(i, dest__len)]; + } + i -= 1; + } + } + i = 0; + while (i < n2) { + dest[__X(pos + i, dest__len)] = source[__X(i, source__len)]; + i += 1; + } + __DEL(source); +} + +void Strings_Delete (CHAR *s, LONGINT s__len, INTEGER pos, INTEGER n) +{ + INTEGER len, i; + len = Strings_Length(s, s__len); + if (pos < 0) { + pos = 0; + } else if (pos >= len) { + return; + } + if (pos + n < len) { + i = pos + n; + while (i < len) { + s[__X(i - n, s__len)] = s[__X(i, s__len)]; + i += 1; + } + if ((LONGINT)(i - n) < s__len) { + s[__X(i - n, s__len)] = 0x00; + } + } else { + s[__X(pos, s__len)] = 0x00; + } +} + +void Strings_Replace (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, LONGINT dest__len) +{ + __DUP(source, source__len, CHAR); + Strings_Delete((void*)dest, dest__len, pos, pos + Strings_Length(source, source__len)); + Strings_Insert(source, source__len, pos, (void*)dest, dest__len); + __DEL(source); +} + +void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n, CHAR *dest, LONGINT dest__len) +{ + INTEGER len, destLen, i; + __DUP(source, source__len, CHAR); + len = Strings_Length(source, source__len); + destLen = (int)dest__len - 1; + if (pos < 0) { + pos = 0; + } + if (pos >= len) { + dest[0] = 0x00; + return; + } + i = 0; + while (((((LONGINT)(pos + i) <= source__len && source[__X(pos + i, source__len)] != 0x00)) && i < n)) { + if (i < destLen) { + dest[__X(i, dest__len)] = source[__X(pos + i, source__len)]; + } + i += 1; + } + dest[__X(i, dest__len)] = 0x00; + __DEL(source); +} + +INTEGER Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, INTEGER pos) +{ + INTEGER _o_result; + INTEGER n1, n2, i, j; + __DUP(pattern, pattern__len, CHAR); + __DUP(s, s__len, CHAR); + n1 = Strings_Length(s, s__len); + n2 = Strings_Length(pattern, pattern__len); + if (n2 == 0) { + _o_result = 0; + __DEL(pattern); + __DEL(s); + return _o_result; + } + i = pos; + while (i <= n1 - n2) { + if (s[__X(i, s__len)] == pattern[0]) { + j = 1; + while ((j < n2 && s[__X(i + j, s__len)] == pattern[__X(j, pattern__len)])) { + j += 1; + } + if (j == n2) { + _o_result = i; + __DEL(pattern); + __DEL(s); + return _o_result; + } + } + i += 1; + } + _o_result = -1; + __DEL(pattern); + __DEL(s); + return _o_result; +} + +void Strings_Cap (CHAR *s, LONGINT s__len) +{ + INTEGER i; + i = 0; + while (s[__X(i, s__len)] != 0x00) { + if (('a' <= s[__X(i, s__len)] && s[__X(i, s__len)] <= 'z')) { + s[__X(i, s__len)] = __CAP(s[__X(i, s__len)]); + } + i += 1; + } +} + +static struct Match__7 { + struct Match__7 *lnk; +} *Match__7_s; + +static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, INTEGER n, INTEGER m); + +static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, INTEGER n, INTEGER m) +{ + BOOLEAN _o_result; + while ((((n >= 0 && m >= 0)) && mask[__X(m, mask__len)] != '*')) { + if (name[__X(n, name__len)] != mask[__X(m, mask__len)]) { + _o_result = 0; + return _o_result; + } + n -= 1; + m -= 1; + } + if (m < 0) { + _o_result = n < 0; + return _o_result; + } + while ((m >= 0 && mask[__X(m, mask__len)] == '*')) { + m -= 1; + } + if (m < 0) { + _o_result = 1; + return _o_result; + } + while (n >= 0) { + if (M__8(name, name__len, mask, mask__len, n, m)) { + _o_result = 1; + return _o_result; + } + n -= 1; + } + _o_result = 0; + return _o_result; +} + +BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len) +{ + BOOLEAN _o_result; + struct Match__7 _s; + __DUP(string, string__len, CHAR); + __DUP(pattern, pattern__len, CHAR); + _s.lnk = Match__7_s; + Match__7_s = &_s; + _o_result = M__8((void*)string, string__len, (void*)pattern, pattern__len, Strings_Length(string, string__len) - 1, Strings_Length(pattern, pattern__len) - 1); + Match__7_s = _s.lnk; + __DEL(string); + __DEL(pattern); + return _o_result; +} + + +export void *Strings__init(void) +{ + __DEFMOD; + __REGMOD("Strings", 0); +/* BEGIN */ + __ENDMOD; +} diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h new file mode 100644 index 00000000..a8d8d207 --- /dev/null +++ b/bootstrap/unix-48/Strings.h @@ -0,0 +1,23 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ + +#ifndef Strings__h +#define Strings__h + +#include "SYSTEM.h" + + + + +import void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len); +import void Strings_Cap (CHAR *s, LONGINT s__len); +import void Strings_Delete (CHAR *s, LONGINT s__len, INTEGER pos, INTEGER n); +import void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n, CHAR *dest, LONGINT dest__len); +import void Strings_Insert (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, LONGINT dest__len); +import INTEGER Strings_Length (CHAR *s, LONGINT s__len); +import BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len); +import INTEGER Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, INTEGER pos); +import void Strings_Replace (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, LONGINT dest__len); +import void *Strings__init(void); + + +#endif diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c new file mode 100644 index 00000000..8c2cc3b2 --- /dev/null +++ b/bootstrap/unix-48/Texts.c @@ -0,0 +1,1838 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +#include "SYSTEM.h" +#include "Files.h" +#include "Modules.h" +#include "Reals.h" + +typedef + struct Texts_RunDesc *Texts_Run; + +typedef + struct Texts_FontDesc *Texts_FontsFont; + +typedef + struct Texts_RunDesc { + Texts_Run prev, next; + LONGINT len; + Texts_FontsFont fnt; + SHORTINT col, voff; + BOOLEAN ascii; + } Texts_RunDesc; + +typedef + struct Texts_ElemDesc *Texts_Elem; + +typedef + struct Texts_ElemMsg { + char _prvt0[1]; + } Texts_ElemMsg; + +typedef + void (*Texts_Handler)(Texts_Elem, Texts_ElemMsg*, LONGINT *); + +typedef + struct Texts_TextDesc *Texts_Text; + +typedef + struct Texts_ElemDesc { + Texts_Run prev, next; + LONGINT len; + Texts_FontsFont fnt; + SHORTINT col, voff; + BOOLEAN ascii; + LONGINT W, H; + Texts_Handler handle; + Texts_Text base; + } Texts_ElemDesc; + +struct Texts__1 { /* Texts_ElemDesc */ + Texts_Run prev, next; + LONGINT len; + Texts_FontsFont fnt; + SHORTINT col, voff; + BOOLEAN ascii; + LONGINT W, H; + Texts_Handler handle; + Texts_Text base; + Files_File file; + LONGINT org, span; + CHAR mod[32], proc[32]; +}; + +typedef + struct Texts__1 *Texts_Alien; + +typedef + struct Texts_BufDesc { + LONGINT len; + Texts_Run head; + } Texts_BufDesc; + +typedef + Texts_BufDesc *Texts_Buffer; + +typedef + struct Texts_CopyMsg { /* Texts_ElemMsg */ + Texts_Elem e; + } Texts_CopyMsg; + +typedef + struct Texts_FileMsg { /* Texts_ElemMsg */ + INTEGER id; + LONGINT pos; + Files_Rider r; + } Texts_FileMsg; + +typedef + struct Texts_FontDesc { + CHAR name[32]; + } Texts_FontDesc; + +typedef + struct Texts_IdentifyMsg { /* Texts_ElemMsg */ + CHAR mod[32], proc[32]; + } Texts_IdentifyMsg; + +typedef + void (*Texts_Notifier)(Texts_Text, INTEGER, LONGINT, LONGINT); + +typedef + struct Texts_PieceDesc *Texts_Piece; + +typedef + struct Texts_PieceDesc { + Texts_Run prev, next; + LONGINT len; + Texts_FontsFont fnt; + SHORTINT col, voff; + BOOLEAN ascii; + Files_File file; + LONGINT org; + } Texts_PieceDesc; + +typedef + struct Texts_Reader { + BOOLEAN eot; + Texts_FontsFont fnt; + SHORTINT col, voff; + Texts_Elem elem; + Files_Rider rider; + Texts_Run run; + LONGINT org, off; + } Texts_Reader; + +typedef + struct Texts_Scanner { /* Texts_Reader */ + BOOLEAN eot; + Texts_FontsFont fnt; + SHORTINT col, voff; + Texts_Elem elem; + Files_Rider rider; + Texts_Run run; + LONGINT org, off; + CHAR nextCh; + INTEGER line, class; + LONGINT i; + REAL x; + LONGREAL y; + CHAR c; + SHORTINT len; + CHAR s[64]; + } Texts_Scanner; + +typedef + struct Texts_TextDesc { + LONGINT len; + Texts_Notifier notify; + Texts_Run head, cache; + LONGINT corg; + } Texts_TextDesc; + +typedef + struct Texts_Writer { + Texts_Buffer buf; + Texts_FontsFont fnt; + SHORTINT col, voff; + Files_Rider rider; + Files_File file; + } Texts_Writer; + + +export Texts_Elem Texts_new; +static Texts_Buffer Texts_del; +static Texts_FontsFont Texts_FontsDefault; + +export LONGINT *Texts_FontDesc__typ; +export LONGINT *Texts_RunDesc__typ; +export LONGINT *Texts_PieceDesc__typ; +export LONGINT *Texts_ElemMsg__typ; +export LONGINT *Texts_ElemDesc__typ; +export LONGINT *Texts_FileMsg__typ; +export LONGINT *Texts_CopyMsg__typ; +export LONGINT *Texts_IdentifyMsg__typ; +export LONGINT *Texts_BufDesc__typ; +export LONGINT *Texts_TextDesc__typ; +export LONGINT *Texts_Reader__typ; +export LONGINT *Texts_Scanner__typ; +export LONGINT *Texts_Writer__typ; +export LONGINT *Texts__1__typ; + +export void Texts_Append (Texts_Text T, Texts_Buffer B); +export void Texts_ChangeLooks (Texts_Text T, LONGINT beg, LONGINT end, SET sel, Texts_FontsFont fnt, SHORTINT col, SHORTINT voff); +static Texts_Elem Texts_CloneElem (Texts_Elem e); +static Texts_Piece Texts_ClonePiece (Texts_Piece p); +export void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len); +export void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); +export void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); +export void Texts_Delete (Texts_Text T, LONGINT beg, LONGINT end); +export Texts_Text Texts_ElemBase (Texts_Elem E); +export LONGINT Texts_ElemPos (Texts_Elem E); +static void Texts_Find (Texts_Text T, LONGINT *pos, Texts_Run *u, LONGINT *org, LONGINT *off); +static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len); +static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, LONGINT *msg__typ); +export void Texts_Insert (Texts_Text T, LONGINT pos, Texts_Buffer B); +export void Texts_Load (Files_Rider *r, LONGINT *r__typ, Texts_Text T); +static void Texts_Load0 (Files_Rider *r, LONGINT *r__typ, Texts_Text T); +static void Texts_Merge (Texts_Text T, Texts_Run u, Texts_Run *v); +export void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len); +export void Texts_OpenBuf (Texts_Buffer B); +export void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, LONGINT pos); +export void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, LONGINT pos); +export void Texts_OpenWriter (Texts_Writer *W, LONGINT *W__typ); +export LONGINT Texts_Pos (Texts_Reader *R, LONGINT *R__typ); +export void Texts_Read (Texts_Reader *R, LONGINT *R__typ, CHAR *ch); +export void Texts_ReadElem (Texts_Reader *R, LONGINT *R__typ); +export void Texts_ReadPrevElem (Texts_Reader *R, LONGINT *R__typ); +export void Texts_Recall (Texts_Buffer *B); +export void Texts_Save (Texts_Text T, LONGINT beg, LONGINT end, Texts_Buffer B); +export void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ); +export void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, SHORTINT col); +export void Texts_SetFont (Texts_Writer *W, LONGINT *W__typ, Texts_FontsFont fnt); +export void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, SHORTINT voff); +static void Texts_Splice (Texts_Run un, Texts_Run v, Texts_Run w, Texts_Text base); +static void Texts_Split (LONGINT off, Texts_Run *u, Texts_Run *un); +export void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T); +export void Texts_Write (Texts_Writer *W, LONGINT *W__typ, CHAR ch); +export void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, LONGINT t, LONGINT d); +export void Texts_WriteElem (Texts_Writer *W, LONGINT *W__typ, Texts_Elem e); +export void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, LONGINT x); +export void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n); +export void Texts_WriteLn (Texts_Writer *W, LONGINT *W__typ); +export void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER n); +export void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x); +export void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n); +export void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n, INTEGER k); +export void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x); +export void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__len); + + +static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len) +{ + Texts_FontsFont _o_result; + Texts_FontsFont F = NIL; + __NEW(F, Texts_FontDesc); + __COPY(name, F->name, ((LONGINT)(32))); + _o_result = F; + return _o_result; +} + +static void Texts_Find (Texts_Text T, LONGINT *pos, Texts_Run *u, LONGINT *org, LONGINT *off) +{ + Texts_Run v = NIL; + LONGINT m; + if (*pos >= T->len) { + *pos = T->len; + *u = T->head; + *org = T->len; + *off = 0; + T->cache = T->head; + T->corg = 0; + } else { + v = T->cache->next; + m = *pos - T->corg; + if (*pos >= T->corg) { + while (m >= v->len) { + m -= v->len; + v = v->next; + } + } else { + while (m < 0) { + v = v->prev; + m += v->len; + } + } + *u = v; + *org = *pos - m; + *off = m; + T->cache = v->prev; + T->corg = *org; + } +} + +static void Texts_Split (LONGINT off, Texts_Run *u, Texts_Run *un) +{ + Texts_Piece p = NIL, U = NIL; + if (off == 0) { + *un = *u; + *u = (*un)->prev; + } else if (off >= (*u)->len) { + *un = (*u)->next; + } else { + __NEW(p, Texts_PieceDesc); + *un = (Texts_Run)p; + U = __GUARDP(*u, Texts_PieceDesc, 1); + __GUARDEQP(p, Texts_PieceDesc) = *U; + p->org += off; + p->len -= off; + U->len -= p->len; + p->ascii = (*u)->ascii; + p->prev = (Texts_Run)U; + p->next = U->next; + p->next->prev = (Texts_Run)p; + U->next = (Texts_Run)p; + } +} + +static void Texts_Merge (Texts_Text T, Texts_Run u, Texts_Run *v) +{ + Texts_Piece p = NIL, q = NIL; + if ((((((((((__ISP(u, Texts_PieceDesc, 1) && __ISP(*v, Texts_PieceDesc, 1))) && __STRCMP(u->fnt->name, (*v)->fnt->name) == 0)) && u->col == (*v)->col)) && u->voff == (*v)->voff)) && __GUARDP(u, Texts_PieceDesc, 1)->ascii == __GUARDP(*v, Texts_PieceDesc, 1)->ascii)) { + p = __GUARDP(u, Texts_PieceDesc, 1); + q = __GUARDP(*v, Texts_PieceDesc, 1); + if ((p->file == q->file && p->org + p->len == q->org)) { + if (T->cache == u) { + T->corg += q->len; + } else if (T->cache == *v) { + T->cache = T->head; + T->corg = 0; + } + p->len += q->len; + *v = (*v)->next; + } + } +} + +static void Texts_Splice (Texts_Run un, Texts_Run v, Texts_Run w, Texts_Text base) +{ + Texts_Run u = NIL; + if (v != w->next) { + u = un->prev; + u->next = v; + v->prev = u; + un->prev = w; + w->next = un; + do { + if (__ISP(v, Texts_ElemDesc, 1)) { + __GUARDP(v, Texts_ElemDesc, 1)->base = base; + } + v = v->next; + } while (!(v == un)); + } +} + +static Texts_Piece Texts_ClonePiece (Texts_Piece p) +{ + Texts_Piece _o_result; + Texts_Piece q = NIL; + __NEW(q, Texts_PieceDesc); + __GUARDEQP(q, Texts_PieceDesc) = *p; + _o_result = q; + return _o_result; +} + +static Texts_Elem Texts_CloneElem (Texts_Elem e) +{ + Texts_Elem _o_result; + Texts_CopyMsg msg; + msg.e = NIL; + (*e->handle)(e, (void*)&msg, Texts_CopyMsg__typ); + _o_result = msg.e; + return _o_result; +} + +void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE) +{ + DE->len = SE->len; + DE->fnt = SE->fnt; + DE->col = SE->col; + DE->voff = SE->voff; + DE->W = SE->W; + DE->H = SE->H; + DE->handle = SE->handle; +} + +Texts_Text Texts_ElemBase (Texts_Elem E) +{ + Texts_Text _o_result; + _o_result = E->base; + return _o_result; +} + +LONGINT Texts_ElemPos (Texts_Elem E) +{ + LONGINT _o_result; + Texts_Run u = NIL; + LONGINT pos; + u = E->base->head->next; + pos = 0; + while (u != (void *) E) { + pos = pos + u->len; + u = u->next; + } + _o_result = pos; + return _o_result; +} + +static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, LONGINT *msg__typ) +{ + Texts_Alien e = NIL; + Files_Rider r; + LONGINT i; + CHAR ch; + if (__ISP(E, Texts__1, 2)) { + if (__IS(msg__typ, Texts_CopyMsg, 1)) { + if (__IS(msg__typ, Texts_CopyMsg, 1)) { + Texts_CopyMsg *msg__ = (void*)msg; + __NEW(e, Texts__1); + Texts_CopyElem((void*)((Texts_Alien)E), (void*)e); + e->file = ((Texts_Alien)E)->file; + e->org = ((Texts_Alien)E)->org; + e->span = ((Texts_Alien)E)->span; + __COPY(((Texts_Alien)E)->mod, e->mod, ((LONGINT)(32))); + __COPY(((Texts_Alien)E)->proc, e->proc, ((LONGINT)(32))); + (*msg__).e = (Texts_Elem)e; + } else __WITHCHK; + } else if (__IS(msg__typ, Texts_IdentifyMsg, 1)) { + if (__IS(msg__typ, Texts_IdentifyMsg, 1)) { + Texts_IdentifyMsg *msg__ = (void*)msg; + __COPY(((Texts_Alien)E)->mod, (*msg__).mod, ((LONGINT)(32))); + __COPY(((Texts_Alien)E)->proc, (*msg__).proc, ((LONGINT)(32))); + (*msg__).mod[31] = 0x01; + } else __WITHCHK; + } else if (__IS(msg__typ, Texts_FileMsg, 1)) { + if (__IS(msg__typ, Texts_FileMsg, 1)) { + Texts_FileMsg *msg__ = (void*)msg; + if ((*msg__).id == 1) { + Files_Set(&r, Files_Rider__typ, ((Texts_Alien)E)->file, ((Texts_Alien)E)->org); + i = ((Texts_Alien)E)->span; + while (i > 0) { + Files_Read(&r, Files_Rider__typ, (void*)&ch); + Files_Write(&(*msg__).r, Files_Rider__typ, ch); + i -= 1; + } + } + } else __WITHCHK; + } + } else __WITHCHK; +} + +void Texts_OpenBuf (Texts_Buffer B) +{ + Texts_Run u = NIL; + __NEW(u, Texts_RunDesc); + u->next = u; + u->prev = u; + B->head = u; + B->len = 0; +} + +void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB) +{ + Texts_Run u = NIL, v = NIL, vn = NIL; + u = SB->head->next; + v = DB->head->prev; + while (u != SB->head) { + if (__ISP(u, Texts_PieceDesc, 1)) { + vn = (Texts_Run)Texts_ClonePiece(__GUARDP(u, Texts_PieceDesc, 1)); + } else { + vn = (Texts_Run)Texts_CloneElem(__GUARDP(u, Texts_ElemDesc, 1)); + } + v->next = vn; + vn->prev = v; + v = vn; + u = u->next; + } + v->next = DB->head; + DB->head->prev = v; + DB->len += SB->len; +} + +void Texts_Recall (Texts_Buffer *B) +{ + *B = Texts_del; + Texts_del = NIL; +} + +void Texts_Save (Texts_Text T, LONGINT beg, LONGINT end, Texts_Buffer B) +{ + Texts_Run u = NIL, v = NIL, w = NIL, wn = NIL; + LONGINT uo, ud, vo, vd; + Texts_Find(T, &beg, &u, &uo, &ud); + Texts_Find(T, &end, &v, &vo, &vd); + w = B->head->prev; + while (u != v) { + if (__ISP(u, Texts_PieceDesc, 1)) { + wn = (Texts_Run)Texts_ClonePiece(__GUARDP(u, Texts_PieceDesc, 1)); + wn->len -= ud; + __GUARDP(wn, Texts_PieceDesc, 1)->org += ud; + } else { + wn = (Texts_Run)Texts_CloneElem(__GUARDP(u, Texts_ElemDesc, 1)); + } + w->next = wn; + wn->prev = w; + w = wn; + u = u->next; + ud = 0; + } + if (vd > 0) { + wn = (Texts_Run)Texts_ClonePiece(__GUARDP(v, Texts_PieceDesc, 1)); + wn->len = vd - ud; + __GUARDP(wn, Texts_PieceDesc, 1)->org += ud; + w->next = wn; + wn->prev = w; + w = wn; + } + w->next = B->head; + B->head->prev = w; + B->len += end - beg; +} + +void Texts_Insert (Texts_Text T, LONGINT pos, Texts_Buffer B) +{ + Texts_Run u = NIL, un = NIL, v = NIL; + Texts_Piece p = NIL, q = NIL; + LONGINT uo, ud, len; + Texts_Find(T, &pos, &u, &uo, &ud); + Texts_Split(ud, &u, &un); + len = B->len; + v = B->head->next; + Texts_Merge(T, u, &v); + Texts_Splice(un, v, B->head->prev, T); + T->len += len; + B->head->next = B->head; + B->head->prev = B->head; + B->len = 0; + if (T->notify != NIL) { + (*T->notify)(T, 1, pos, pos + len); + } +} + +void Texts_Append (Texts_Text T, Texts_Buffer B) +{ + Texts_Run v = NIL; + LONGINT pos, len; + pos = T->len; + len = B->len; + v = B->head->next; + Texts_Merge(T, T->head->prev, &v); + Texts_Splice(T->head, v, B->head->prev, T); + T->len += len; + B->head->next = B->head; + B->head->prev = B->head; + B->len = 0; + if (T->notify != NIL) { + (*T->notify)(T, 1, pos, pos + len); + } +} + +void Texts_Delete (Texts_Text T, LONGINT beg, LONGINT end) +{ + Texts_Run c = NIL, u = NIL, un = NIL, v = NIL, vn = NIL; + LONGINT co, uo, ud, vo, vd; + Texts_Find(T, &beg, &u, &uo, &ud); + Texts_Split(ud, &u, &un); + c = T->cache; + co = T->corg; + Texts_Find(T, &end, &v, &vo, &vd); + Texts_Split(vd, &v, &vn); + T->cache = c; + T->corg = co; + __NEW(Texts_del, Texts_BufDesc); + Texts_OpenBuf(Texts_del); + Texts_del->len = end - beg; + Texts_Splice(Texts_del->head, un, v, NIL); + Texts_Merge(T, u, &vn); + u->next = vn; + vn->prev = u; + T->len -= end - beg; + if (T->notify != NIL) { + (*T->notify)(T, 2, beg, end); + } +} + +void Texts_ChangeLooks (Texts_Text T, LONGINT beg, LONGINT end, SET sel, Texts_FontsFont fnt, SHORTINT col, SHORTINT voff) +{ + Texts_Run c = NIL, u = NIL, un = NIL, v = NIL, vn = NIL; + LONGINT co, uo, ud, vo, vd; + Texts_Find(T, &beg, &u, &uo, &ud); + Texts_Split(ud, &u, &un); + c = T->cache; + co = T->corg; + Texts_Find(T, &end, &v, &vo, &vd); + Texts_Split(vd, &v, &vn); + T->cache = c; + T->corg = co; + while (un != vn) { + if ((__IN(0, sel) && fnt != NIL)) { + un->fnt = fnt; + } + if (__IN(1, sel)) { + un->col = col; + } + if (__IN(2, sel)) { + un->voff = voff; + } + Texts_Merge(T, u, &un); + if (u->next == un) { + u = un; + un = un->next; + } else { + u->next = un; + un->prev = u; + } + } + Texts_Merge(T, u, &un); + u->next = un; + un->prev = u; + if (T->notify != NIL) { + (*T->notify)(T, 0, beg, end); + } +} + +void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, LONGINT pos) +{ + Texts_Run u = NIL; + if (pos >= T->len) { + pos = T->len; + } + Texts_Find(T, &pos, &u, &(*R).org, &(*R).off); + (*R).run = u; + (*R).eot = 0; + if (__ISP(u, Texts_PieceDesc, 1)) { + Files_Set(&(*R).rider, Files_Rider__typ, __GUARDP(u, Texts_PieceDesc, 1)->file, __GUARDP(u, Texts_PieceDesc, 1)->org + (*R).off); + } +} + +void Texts_Read (Texts_Reader *R, LONGINT *R__typ, CHAR *ch) +{ + Texts_Run u = NIL; + LONGINT pos; + CHAR nextch; + u = (*R).run; + (*R).fnt = u->fnt; + (*R).col = u->col; + (*R).voff = u->voff; + (*R).off += 1; + if (__ISP(u, Texts_PieceDesc, 1)) { + Files_Read(&(*R).rider, Files_Rider__typ, (void*)&*ch); + (*R).elem = NIL; + if ((*ch == 0x0a && __GUARDP(u, Texts_PieceDesc, 1)->ascii)) { + *ch = 0x0d; + } else if ((*ch == 0x0d && __GUARDP(u, Texts_PieceDesc, 1)->ascii)) { + pos = Files_Pos(&(*R).rider, Files_Rider__typ); + Files_Read(&(*R).rider, Files_Rider__typ, (void*)&nextch); + if (nextch == 0x0a) { + (*R).off += 1; + } else { + Files_Set(&(*R).rider, Files_Rider__typ, __GUARDP(u, Texts_PieceDesc, 1)->file, pos); + } + } + } else if (__ISP(u, Texts_ElemDesc, 1)) { + *ch = 0x1c; + (*R).elem = __GUARDP(u, Texts_ElemDesc, 1); + } else { + *ch = 0x00; + (*R).elem = NIL; + (*R).eot = 1; + } + if ((*R).off == u->len) { + (*R).org += u->len; + u = u->next; + if (__ISP(u, Texts_PieceDesc, 1)) { + if (__ISP(u, Texts_PieceDesc, 1)) { + Files_Set(&(*R).rider, Files_Rider__typ, ((Texts_Piece)u)->file, ((Texts_Piece)u)->org); + } else __WITHCHK; + } + (*R).run = u; + (*R).off = 0; + } +} + +void Texts_ReadElem (Texts_Reader *R, LONGINT *R__typ) +{ + Texts_Run u = NIL, un = NIL; + u = (*R).run; + while (__ISP(u, Texts_PieceDesc, 1)) { + (*R).org += u->len; + u = u->next; + } + if (__ISP(u, Texts_ElemDesc, 1)) { + un = u->next; + (*R).run = un; + (*R).org += 1; + (*R).off = 0; + (*R).fnt = u->fnt; + (*R).col = u->col; + (*R).voff = u->voff; + (*R).elem = __GUARDP(u, Texts_ElemDesc, 1); + if (__ISP(un, Texts_PieceDesc, 1)) { + if (__ISP(un, Texts_PieceDesc, 1)) { + Files_Set(&(*R).rider, Files_Rider__typ, ((Texts_Piece)un)->file, ((Texts_Piece)un)->org); + } else __WITHCHK; + } + } else { + (*R).eot = 1; + (*R).elem = NIL; + } +} + +void Texts_ReadPrevElem (Texts_Reader *R, LONGINT *R__typ) +{ + Texts_Run u = NIL; + u = (*R).run->prev; + while (__ISP(u, Texts_PieceDesc, 1)) { + (*R).org -= u->len; + u = u->prev; + } + if (__ISP(u, Texts_ElemDesc, 1)) { + (*R).run = u; + (*R).org -= 1; + (*R).off = 0; + (*R).fnt = u->fnt; + (*R).col = u->col; + (*R).voff = u->voff; + (*R).elem = __GUARDP(u, Texts_ElemDesc, 1); + } else { + (*R).eot = 1; + (*R).elem = NIL; + } +} + +LONGINT Texts_Pos (Texts_Reader *R, LONGINT *R__typ) +{ + LONGINT _o_result; + _o_result = (*R).org + (*R).off; + return _o_result; +} + +void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, LONGINT pos) +{ + Texts_OpenReader((void*)&*S, S__typ, T, pos); + (*S).line = 0; + (*S).nextCh = ' '; +} + +static struct Scan__31 { + Texts_Scanner *S; + LONGINT *S__typ; + CHAR *ch; + BOOLEAN *negE; + INTEGER *e; + struct Scan__31 *lnk; +} *Scan__31_s; + +static void ReadScaleFactor__32 (void); + +static void ReadScaleFactor__32 (void) +{ + Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); + if (*Scan__31_s->ch == '-') { + *Scan__31_s->negE = 1; + Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); + } else { + *Scan__31_s->negE = 0; + if (*Scan__31_s->ch == '+') { + Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); + } + } + while (('0' <= *Scan__31_s->ch && *Scan__31_s->ch <= '9')) { + *Scan__31_s->e = (*Scan__31_s->e * 10 + (int)*Scan__31_s->ch) - 48; + Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); + } +} + +void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) +{ + CHAR ch, term; + BOOLEAN neg, negE, hex; + SHORTINT i, j, h; + INTEGER e; + LONGINT k; + REAL x, f; + LONGREAL y, g; + CHAR d[32]; + struct Scan__31 _s; + _s.S = S; _s.S__typ = S__typ; + _s.ch = &ch; + _s.negE = &negE; + _s.e = &e; + _s.lnk = Scan__31_s; + Scan__31_s = &_s; + ch = (*S).nextCh; + i = 0; + for (;;) { + if (ch == 0x0d) { + (*S).line += 1; + } else if ((ch != ' ' && ch != 0x09)) { + break; + } + Texts_Read((void*)&*S, S__typ, &ch); + } + if ((('A' <= __CAP(ch) && __CAP(ch) <= 'Z') || ch == '/') || ch == '.') { + do { + (*S).s[__X(i, ((LONGINT)(64)))] = ch; + i += 1; + Texts_Read((void*)&*S, S__typ, &ch); + } while (!((((__CAP(ch) > 'Z' && ch != '_') || ('A' > __CAP(ch) && ch > '9')) || ((('0' > ch && ch != '.')) && ch != '/')) || i == 63)); + (*S).s[__X(i, ((LONGINT)(64)))] = 0x00; + (*S).len = i; + (*S).class = 1; + } else if (ch == '\"') { + Texts_Read((void*)&*S, S__typ, &ch); + while ((((ch != '\"' && ch >= ' ')) && i != 63)) { + (*S).s[__X(i, ((LONGINT)(64)))] = ch; + i += 1; + Texts_Read((void*)&*S, S__typ, &ch); + } + (*S).s[__X(i, ((LONGINT)(64)))] = 0x00; + (*S).len = i + 1; + Texts_Read((void*)&*S, S__typ, &ch); + (*S).class = 2; + } else { + if (ch == '-') { + neg = 1; + Texts_Read((void*)&*S, S__typ, &ch); + } else { + neg = 0; + } + if (('0' <= ch && ch <= '9')) { + hex = 0; + j = 0; + for (;;) { + d[__X(i, ((LONGINT)(32)))] = ch; + i += 1; + Texts_Read((void*)&*S, S__typ, &ch); + if (ch < '0') { + break; + } + if ('9' < ch) { + if (('A' <= ch && ch <= 'F')) { + hex = 1; + ch = (CHAR)((int)ch - 7); + } else if (('a' <= ch && ch <= 'f')) { + hex = 1; + ch = (CHAR)((int)ch - 39); + } else { + break; + } + } + } + if (ch == 'H') { + Texts_Read((void*)&*S, S__typ, &ch); + (*S).class = 3; + if (i - j > 8) { + j = i - 8; + } + k = (int)d[__X(j, ((LONGINT)(32)))] - 48; + j += 1; + if ((i - j == 7 && k >= 8)) { + k -= 16; + } + while (j < i) { + k = __ASHL(k, 4) + (LONGINT)((int)d[__X(j, ((LONGINT)(32)))] - 48); + j += 1; + } + if (neg) { + (*S).i = -k; + } else { + (*S).i = k; + } + } else if (ch == '.') { + Texts_Read((void*)&*S, S__typ, &ch); + h = i; + while (('0' <= ch && ch <= '9')) { + d[__X(i, ((LONGINT)(32)))] = ch; + i += 1; + Texts_Read((void*)&*S, S__typ, &ch); + } + if (ch == 'D') { + e = 0; + y = (LONGREAL)0; + g = (LONGREAL)1; + do { + y = y * (LONGREAL)10 + ((int)d[__X(j, ((LONGINT)(32)))] - 48); + j += 1; + } while (!(j == h)); + while (j < i) { + g = g / (LONGREAL)(LONGREAL)10; + y = ((int)d[__X(j, ((LONGINT)(32)))] - 48) * g + y; + j += 1; + } + ReadScaleFactor__32(); + if (negE) { + if (e <= 308) { + y = y / (LONGREAL)Reals_TenL(e); + } else { + y = (LONGREAL)0; + } + } else if (e > 0) { + if (e <= 308) { + y = Reals_TenL(e) * y; + } else { + __HALT(40); + } + } + if (neg) { + y = -y; + } + (*S).class = 5; + (*S).y = y; + } else { + e = 0; + x = (REAL)0; + f = (REAL)1; + do { + x = x * (REAL)10 + ((int)d[__X(j, ((LONGINT)(32)))] - 48); + j += 1; + } while (!(j == h)); + while (j < i) { + f = f / (REAL)(REAL)10; + x = ((int)d[__X(j, ((LONGINT)(32)))] - 48) * f + x; + j += 1; + } + if (ch == 'E') { + ReadScaleFactor__32(); + } + if (negE) { + if (e <= 38) { + x = x / (REAL)Reals_Ten(e); + } else { + x = (REAL)0; + } + } else if (e > 0) { + if (e <= 38) { + x = Reals_Ten(e) * x; + } else { + __HALT(40); + } + } + if (neg) { + x = -x; + } + (*S).class = 4; + (*S).x = x; + } + if (hex) { + (*S).class = 0; + } + } else { + (*S).class = 3; + k = 0; + do { + k = k * 10 + (LONGINT)((int)d[__X(j, ((LONGINT)(32)))] - 48); + j += 1; + } while (!(j == i)); + if (neg) { + (*S).i = -k; + } else { + (*S).i = k; + } + if (hex) { + (*S).class = 0; + } else { + (*S).class = 3; + } + } + } else { + (*S).class = 6; + if (neg) { + (*S).c = '-'; + } else { + (*S).c = ch; + Texts_Read((void*)&*S, S__typ, &ch); + } + } + } + (*S).nextCh = ch; + Scan__31_s = _s.lnk; +} + +void Texts_OpenWriter (Texts_Writer *W, LONGINT *W__typ) +{ + __NEW((*W).buf, Texts_BufDesc); + Texts_OpenBuf((*W).buf); + (*W).fnt = Texts_FontsDefault; + (*W).col = 15; + (*W).voff = 0; + (*W).file = Files_New((CHAR*)"", (LONGINT)1); + Files_Set(&(*W).rider, Files_Rider__typ, (*W).file, ((LONGINT)(0))); +} + +void Texts_SetFont (Texts_Writer *W, LONGINT *W__typ, Texts_FontsFont fnt) +{ + (*W).fnt = fnt; +} + +void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, SHORTINT col) +{ + (*W).col = col; +} + +void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, SHORTINT voff) +{ + (*W).voff = voff; +} + +void Texts_Write (Texts_Writer *W, LONGINT *W__typ, CHAR ch) +{ + Texts_Run u = NIL, un = NIL; + Texts_Piece p = NIL; + Files_Write(&(*W).rider, Files_Rider__typ, ch); + (*W).buf->len += 1; + un = (*W).buf->head; + u = un->prev; + if ((((((((((__ISP(u, Texts_PieceDesc, 1) && __GUARDP(u, Texts_PieceDesc, 1)->file == (*W).file)) && __STRCMP(u->fnt->name, (*W).fnt->name) == 0)) && u->col == (*W).col)) && u->voff == (*W).voff)) && !__GUARDP(u, Texts_PieceDesc, 1)->ascii)) { + u->len += 1; + } else { + __NEW(p, Texts_PieceDesc); + u->next = (Texts_Run)p; + p->prev = u; + p->next = un; + un->prev = (Texts_Run)p; + p->len = 1; + p->fnt = (*W).fnt; + p->col = (*W).col; + p->voff = (*W).voff; + p->file = (*W).file; + p->org = Files_Length((*W).file) - 1; + p->ascii = 0; + } +} + +void Texts_WriteElem (Texts_Writer *W, LONGINT *W__typ, Texts_Elem e) +{ + Texts_Run u = NIL, un = NIL; + if (e->base != NIL) { + __HALT(99); + } + (*W).buf->len += 1; + e->len = 1; + e->fnt = (*W).fnt; + e->col = (*W).col; + e->voff = (*W).voff; + un = (*W).buf->head; + u = un->prev; + u->next = (Texts_Run)e; + e->prev = u; + e->next = un; + un->prev = (Texts_Run)e; +} + +void Texts_WriteLn (Texts_Writer *W, LONGINT *W__typ) +{ + Texts_Write(&*W, W__typ, 0x0d); +} + +void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__len) +{ + INTEGER i; + __DUP(s, s__len, CHAR); + i = 0; + while (s[__X(i, s__len)] >= ' ') { + Texts_Write(&*W, W__typ, s[__X(i, s__len)]); + i += 1; + } + __DEL(s); +} + +void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n) +{ + INTEGER i; + LONGINT x0; + CHAR a[22]; + i = 0; + if (x < 0) { + if (x == (-2147483647-1)) { + Texts_WriteString(&*W, W__typ, (CHAR*)" -2147483648", (LONGINT)13); + return; + } else { + n -= 1; + x0 = -x; + } + } else { + x0 = x; + } + do { + a[__X(i, ((LONGINT)(22)))] = (CHAR)(__MOD(x0, 10) + 48); + x0 = __DIV(x0, 10); + i += 1; + } while (!(x0 == 0)); + while (n > (LONGINT)i) { + Texts_Write(&*W, W__typ, ' '); + n -= 1; + } + if (x < 0) { + Texts_Write(&*W, W__typ, '-'); + } + do { + i -= 1; + Texts_Write(&*W, W__typ, a[__X(i, ((LONGINT)(22)))]); + } while (!(i == 0)); +} + +void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, LONGINT x) +{ + INTEGER i; + LONGINT y; + CHAR a[20]; + i = 0; + Texts_Write(&*W, W__typ, ' '); + do { + y = __MASK(x, -16); + if (y < 10) { + a[__X(i, ((LONGINT)(20)))] = (CHAR)(y + 48); + } else { + a[__X(i, ((LONGINT)(20)))] = (CHAR)(y + 55); + } + x = __ASHR(x, 4); + i += 1; + } while (!(i == 8)); + do { + i -= 1; + Texts_Write(&*W, W__typ, a[__X(i, ((LONGINT)(20)))]); + } while (!(i == 0)); +} + +void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n) +{ + INTEGER e; + REAL x0; + CHAR d[9]; + e = Reals_Expo(x); + if (e == 0) { + Texts_WriteString(&*W, W__typ, (CHAR*)" 0", (LONGINT)4); + do { + Texts_Write(&*W, W__typ, ' '); + n -= 1; + } while (!(n <= 3)); + } else if (e == 255) { + Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", (LONGINT)5); + while (n > 4) { + Texts_Write(&*W, W__typ, ' '); + n -= 1; + } + } else { + if (n <= 9) { + n = 3; + } else { + n -= 6; + } + do { + Texts_Write(&*W, W__typ, ' '); + n -= 1; + } while (!(n <= 8)); + if (x < (REAL)0) { + Texts_Write(&*W, W__typ, '-'); + x = -x; + } else { + Texts_Write(&*W, W__typ, ' '); + } + e = __ASHR((e - 127) * 77, 8); + if (e >= 0) { + x = x / (REAL)Reals_Ten(e); + } else { + x = Reals_Ten(-e) * x; + } + if (x >= (REAL)10) { + x = 1.0000000e-001 * x; + e += 1; + } + x0 = Reals_Ten(n - 1); + x = x0 * x + 5.0000000e-001; + if (x >= (REAL)10 * x0) { + x = x * 1.0000000e-001; + e += 1; + } + Reals_Convert(x, n, (void*)d, ((LONGINT)(9))); + n -= 1; + Texts_Write(&*W, W__typ, d[__X(n, ((LONGINT)(9)))]); + Texts_Write(&*W, W__typ, '.'); + do { + n -= 1; + Texts_Write(&*W, W__typ, d[__X(n, ((LONGINT)(9)))]); + } while (!(n == 0)); + Texts_Write(&*W, W__typ, 'E'); + if (e < 0) { + Texts_Write(&*W, W__typ, '-'); + e = -e; + } else { + Texts_Write(&*W, W__typ, '+'); + } + Texts_Write(&*W, W__typ, (CHAR)(__DIV(e, 10) + 48)); + Texts_Write(&*W, W__typ, (CHAR)((int)__MOD(e, 10) + 48)); + } +} + +static struct WriteRealFix__53 { + Texts_Writer *W; + LONGINT *W__typ; + INTEGER *i; + CHAR (*d)[9]; + struct WriteRealFix__53 *lnk; +} *WriteRealFix__53_s; + +static void dig__54 (INTEGER n); +static void seq__56 (CHAR ch, INTEGER n); + +static void seq__56 (CHAR ch, INTEGER n) +{ + while (n > 0) { + Texts_Write(&*WriteRealFix__53_s->W, WriteRealFix__53_s->W__typ, ch); + n -= 1; + } +} + +static void dig__54 (INTEGER n) +{ + while (n > 0) { + *WriteRealFix__53_s->i -= 1; + Texts_Write(&*WriteRealFix__53_s->W, WriteRealFix__53_s->W__typ, (*WriteRealFix__53_s->d)[__X(*WriteRealFix__53_s->i, ((LONGINT)(9)))]); + n -= 1; + } +} + +void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n, INTEGER k) +{ + INTEGER e, i; + CHAR sign; + REAL x0; + CHAR d[9]; + struct WriteRealFix__53 _s; + _s.W = W; _s.W__typ = W__typ; + _s.i = &i; + _s.d = (void*)d; + _s.lnk = WriteRealFix__53_s; + WriteRealFix__53_s = &_s; + e = Reals_Expo(x); + if (k < 0) { + k = 0; + } + if (e == 0) { + seq__56(' ', (n - k) - 2); + Texts_Write(&*W, W__typ, '0'); + seq__56(' ', k + 1); + } else if (e == 255) { + Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", (LONGINT)5); + seq__56(' ', n - 4); + } else { + e = __ASHR((e - 127) * 77, 8); + if (x < (REAL)0) { + sign = '-'; + x = -x; + } else { + sign = ' '; + } + if (e >= 0) { + x = x / (REAL)Reals_Ten(e); + } else { + x = Reals_Ten(-e) * x; + } + if (x >= (REAL)10) { + x = 1.0000000e-001 * x; + e += 1; + } + if (k + e >= 8) { + k = 8 - e; + } else if (k + e < 0) { + k = -e; + x = (REAL)0; + } + x0 = Reals_Ten(k + e); + x = x0 * x + 5.0000000e-001; + if (x >= (REAL)10 * x0) { + e += 1; + } + e += 1; + i = k + e; + Reals_Convert(x, i, (void*)d, ((LONGINT)(9))); + if (e > 0) { + seq__56(' ', ((n - e) - k) - 2); + Texts_Write(&*W, W__typ, sign); + dig__54(e); + Texts_Write(&*W, W__typ, '.'); + dig__54(k); + } else { + seq__56(' ', (n - k) - 3); + Texts_Write(&*W, W__typ, sign); + Texts_Write(&*W, W__typ, '0'); + Texts_Write(&*W, W__typ, '.'); + seq__56('0', -e); + dig__54(k + e); + } + } + WriteRealFix__53_s = _s.lnk; +} + +void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x) +{ + INTEGER i; + CHAR d[8]; + Reals_ConvertH(x, (void*)d, ((LONGINT)(8))); + i = 0; + do { + Texts_Write(&*W, W__typ, d[__X(i, ((LONGINT)(8)))]); + i += 1; + } while (!(i == 8)); +} + +void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER n) +{ + INTEGER e; + LONGREAL x0; + CHAR d[16]; + e = Reals_ExpoL(x); + if (e == 0) { + Texts_WriteString(&*W, W__typ, (CHAR*)" 0", (LONGINT)4); + do { + Texts_Write(&*W, W__typ, ' '); + n -= 1; + } while (!(n <= 3)); + } else if (e == 2047) { + Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", (LONGINT)5); + while (n > 4) { + Texts_Write(&*W, W__typ, ' '); + n -= 1; + } + } else { + if (n <= 10) { + n = 3; + } else { + n -= 7; + } + do { + Texts_Write(&*W, W__typ, ' '); + n -= 1; + } while (!(n <= 16)); + if (x < (LONGREAL)0) { + Texts_Write(&*W, W__typ, '-'); + x = -x; + } else { + Texts_Write(&*W, W__typ, ' '); + } + e = (int)__ASHR((LONGINT)(e - 1023) * 77, 8); + if (e >= 0) { + x = x / (LONGREAL)Reals_TenL(e); + } else { + x = Reals_TenL(-e) * x; + } + if (x >= (LONGREAL)10) { + x = 1.00000000000000e-001 * x; + e += 1; + } + x0 = Reals_TenL(n - 1); + x = x0 * x + 5.00000000000000e-001; + if (x >= (LONGREAL)10 * x0) { + x = 1.00000000000000e-001 * x; + e += 1; + } + Reals_ConvertL(x, n, (void*)d, ((LONGINT)(16))); + n -= 1; + Texts_Write(&*W, W__typ, d[__X(n, ((LONGINT)(16)))]); + Texts_Write(&*W, W__typ, '.'); + do { + n -= 1; + Texts_Write(&*W, W__typ, d[__X(n, ((LONGINT)(16)))]); + } while (!(n == 0)); + Texts_Write(&*W, W__typ, 'D'); + if (e < 0) { + Texts_Write(&*W, W__typ, '-'); + e = -e; + } else { + Texts_Write(&*W, W__typ, '+'); + } + Texts_Write(&*W, W__typ, (CHAR)(__DIV(e, 100) + 48)); + e = (int)__MOD(e, 100); + Texts_Write(&*W, W__typ, (CHAR)(__DIV(e, 10) + 48)); + Texts_Write(&*W, W__typ, (CHAR)((int)__MOD(e, 10) + 48)); + } +} + +void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x) +{ + INTEGER i; + CHAR d[16]; + Reals_ConvertHL(x, (void*)d, ((LONGINT)(16))); + i = 0; + do { + Texts_Write(&*W, W__typ, d[__X(i, ((LONGINT)(16)))]); + i += 1; + } while (!(i == 16)); +} + +static struct WriteDate__43 { + Texts_Writer *W; + LONGINT *W__typ; + struct WriteDate__43 *lnk; +} *WriteDate__43_s; + +static void WritePair__44 (CHAR ch, LONGINT x); + +static void WritePair__44 (CHAR ch, LONGINT x) +{ + Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, ch); + Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)(__DIV(x, 10) + 48)); + Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)(__MOD(x, 10) + 48)); +} + +void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, LONGINT t, LONGINT d) +{ + struct WriteDate__43 _s; + _s.W = W; _s.W__typ = W__typ; + _s.lnk = WriteDate__43_s; + WriteDate__43_s = &_s; + WritePair__44(' ', __MASK(d, -32)); + WritePair__44('.', __MASK(__ASHR(d, 5), -16)); + WritePair__44('.', __MASK(__ASHR(d, 9), -128)); + WritePair__44(' ', __MASK(__ASHR(t, 12), -32)); + WritePair__44(':', __MASK(__ASHR(t, 6), -64)); + WritePair__44(':', __MASK(t, -64)); + WriteDate__43_s = _s.lnk; +} + +static struct Load0__16 { + Texts_Text *T; + SHORTINT *ecnt; + Files_File *f; + Texts_FileMsg *msg; + CHAR (*mods)[64][32], (*procs)[64][32]; + struct Load0__16 *lnk; +} *Load0__16_s; + +static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, LONGINT span, Texts_Elem *e); + +static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, LONGINT span, Texts_Elem *e) +{ + Modules_Module M = NIL; + Modules_Command Cmd; + Texts_Alien a = NIL; + LONGINT org, ew, eh; + SHORTINT eno; + Texts_new = NIL; + Files_ReadLInt(&*r, r__typ, &ew); + Files_ReadLInt(&*r, r__typ, &eh); + Files_Read(&*r, r__typ, (void*)&eno); + if (eno > *Load0__16_s->ecnt) { + *Load0__16_s->ecnt = eno; + Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->mods)[__X(eno, ((LONGINT)(64)))], ((LONGINT)(32))); + Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->procs)[__X(eno, ((LONGINT)(64)))], ((LONGINT)(32))); + } + org = Files_Pos(&*r, r__typ); + M = Modules_ThisMod((*Load0__16_s->mods)[__X(eno, ((LONGINT)(64)))], ((LONGINT)(32))); + if (M != NIL) { + Cmd = Modules_ThisCommand(M, (*Load0__16_s->procs)[__X(eno, ((LONGINT)(64)))], ((LONGINT)(32))); + if (Cmd != NIL) { + (*Cmd)(); + } + } + *e = Texts_new; + if (*e != NIL) { + (*e)->W = ew; + (*e)->H = eh; + (*e)->base = *Load0__16_s->T; + (*Load0__16_s->msg).pos = pos; + (*(*e)->handle)(*e, (void*)&*Load0__16_s->msg, Texts_FileMsg__typ); + if (Files_Pos(&*r, r__typ) != org + span) { + *e = NIL; + } + } + if (*e == NIL) { + Files_Set(&*r, r__typ, *Load0__16_s->f, org + span); + __NEW(a, Texts__1); + a->W = ew; + a->H = eh; + a->handle = Texts_HandleAlien; + a->base = *Load0__16_s->T; + a->file = *Load0__16_s->f; + a->org = org; + a->span = span; + __COPY((*Load0__16_s->mods)[__X(eno, ((LONGINT)(64)))], a->mod, ((LONGINT)(32))); + __COPY((*Load0__16_s->procs)[__X(eno, ((LONGINT)(64)))], a->proc, ((LONGINT)(32))); + *e = (Texts_Elem)a; + } +} + +static void Texts_Load0 (Files_Rider *r, LONGINT *r__typ, Texts_Text T) +{ + Texts_Run u = NIL, un = NIL; + Texts_Piece p = NIL; + Texts_Elem e = NIL; + LONGINT org, pos, hlen, plen; + SHORTINT ecnt, fno, fcnt, col, voff; + Files_File f = NIL; + Texts_FileMsg msg; + CHAR mods[64][32], procs[64][32]; + CHAR name[32]; + Texts_FontsFont fnts[32]; + struct Load0__16 _s; + _s.T = &T; + _s.ecnt = &ecnt; + _s.f = &f; + _s.msg = &msg; + _s.mods = (void*)mods; + _s.procs = (void*)procs; + _s.lnk = Load0__16_s; + Load0__16_s = &_s; + pos = Files_Pos(&*r, r__typ); + f = Files_Base(&*r, r__typ); + __NEW(u, Texts_RunDesc); + u->len = 2147483647; + u->fnt = NIL; + u->col = 15; + T->head = u; + ecnt = 0; + fcnt = 0; + msg.id = 0; + msg.r = *r; + Files_ReadLInt(&msg.r, Files_Rider__typ, &hlen); + org = (pos - 2) + hlen; + pos = org; + Files_Read(&msg.r, Files_Rider__typ, (void*)&fno); + while (fno != 0) { + if (fno > fcnt) { + fcnt = fno; + Files_ReadString(&msg.r, Files_Rider__typ, (void*)name, ((LONGINT)(32))); + fnts[__X(fno, ((LONGINT)(32)))] = Texts_FontsThis((void*)name, ((LONGINT)(32))); + } + Files_Read(&msg.r, Files_Rider__typ, (void*)&col); + Files_Read(&msg.r, Files_Rider__typ, (void*)&voff); + Files_ReadLInt(&msg.r, Files_Rider__typ, &plen); + if (plen > 0) { + __NEW(p, Texts_PieceDesc); + p->file = f; + p->org = pos; + p->ascii = 0; + un = (Texts_Run)p; + un->len = plen; + } else { + LoadElem__17(&msg.r, Files_Rider__typ, pos - org, -plen, &e); + un = (Texts_Run)e; + un->len = 1; + } + un->col = col; + un->voff = voff; + pos += un->len; + u->next = un; + un->prev = u; + u = un; + Files_Read(&msg.r, Files_Rider__typ, (void*)&fno); + } + u->next = T->head; + T->head->prev = u; + T->cache = T->head; + T->corg = 0; + Files_ReadLInt(&msg.r, Files_Rider__typ, &T->len); + Files_Set(&*r, r__typ, f, Files_Pos(&msg.r, Files_Rider__typ) + T->len); + Load0__16_s = _s.lnk; +} + +void Texts_Load (Files_Rider *r, LONGINT *r__typ, Texts_Text T) +{ + INTEGER tag; + Files_ReadInt(&*r, r__typ, &tag); + if (tag != -4095) { + Files_Set(&*r, r__typ, Files_Base(&*r, r__typ), Files_Pos(&*r, r__typ) - 2); + } + Texts_Load0(&*r, r__typ, T); +} + +void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len) +{ + Files_File f = NIL; + Files_Rider r; + Texts_Run u = NIL; + Texts_Piece p = NIL; + CHAR tag, version; + LONGINT hlen; + __DUP(name, name__len, CHAR); + f = Files_Old(name, name__len); + if (f == NIL) { + f = Files_New((CHAR*)"", (LONGINT)1); + } + Files_Set(&r, Files_Rider__typ, f, ((LONGINT)(0))); + Files_Read(&r, Files_Rider__typ, (void*)&tag); + Files_Read(&r, Files_Rider__typ, (void*)&version); + if (tag == 0xf0 || (tag == 0x01 && version == 0xf0)) { + Texts_Load0(&r, Files_Rider__typ, T); + } else { + __NEW(u, Texts_RunDesc); + u->len = 2147483647; + u->fnt = NIL; + u->col = 15; + __NEW(p, Texts_PieceDesc); + if ((tag == 0xf7 && version == 0x07)) { + Files_Set(&r, Files_Rider__typ, f, ((LONGINT)(28))); + Files_ReadLInt(&r, Files_Rider__typ, &hlen); + Files_Set(&r, Files_Rider__typ, f, 22 + hlen); + Files_ReadLInt(&r, Files_Rider__typ, &T->len); + p->org = 26 + hlen; + } else { + T->len = Files_Length(f); + p->org = 0; + } + if (T->len > 0) { + p->len = T->len; + p->fnt = Texts_FontsDefault; + p->col = 15; + p->voff = 0; + p->file = f; + p->ascii = 1; + u->next = (Texts_Run)p; + u->prev = (Texts_Run)p; + p->next = u; + p->prev = u; + } else { + u->next = u; + u->prev = u; + } + T->head = u; + T->cache = T->head; + T->corg = 0; + } + __DEL(name); +} + +static struct Store__39 { + SHORTINT *ecnt; + Texts_FileMsg *msg; + Texts_IdentifyMsg *iden; + CHAR (*mods)[64][32], (*procs)[64][32]; + struct Store__39 *lnk; +} *Store__39_s; + +static void StoreElem__40 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, Texts_Elem e); + +static void StoreElem__40 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, Texts_Elem e) +{ + Files_Rider r1; + LONGINT org, span; + SHORTINT eno; + __COPY((*Store__39_s->iden).mod, (*Store__39_s->mods)[__X(*Store__39_s->ecnt, ((LONGINT)(64)))], ((LONGINT)(32))); + __COPY((*Store__39_s->iden).proc, (*Store__39_s->procs)[__X(*Store__39_s->ecnt, ((LONGINT)(64)))], ((LONGINT)(32))); + eno = 1; + while (__STRCMP((*Store__39_s->mods)[__X(eno, ((LONGINT)(64)))], (*Store__39_s->iden).mod) != 0 || __STRCMP((*Store__39_s->procs)[__X(eno, ((LONGINT)(64)))], (*Store__39_s->iden).proc) != 0) { + eno += 1; + } + Files_Set(&r1, Files_Rider__typ, Files_Base(&*r, r__typ), Files_Pos(&*r, r__typ)); + Files_WriteLInt(&*r, r__typ, ((LONGINT)(0))); + Files_WriteLInt(&*r, r__typ, ((LONGINT)(0))); + Files_WriteLInt(&*r, r__typ, ((LONGINT)(0))); + Files_Write(&*r, r__typ, eno); + if (eno == *Store__39_s->ecnt) { + *Store__39_s->ecnt += 1; + Files_WriteString(&*r, r__typ, (*Store__39_s->iden).mod, ((LONGINT)(32))); + Files_WriteString(&*r, r__typ, (*Store__39_s->iden).proc, ((LONGINT)(32))); + } + (*Store__39_s->msg).pos = pos; + org = Files_Pos(&*r, r__typ); + (*e->handle)(e, (void*)&*Store__39_s->msg, Texts_FileMsg__typ); + span = Files_Pos(&*r, r__typ) - org; + Files_WriteLInt(&r1, Files_Rider__typ, -span); + Files_WriteLInt(&r1, Files_Rider__typ, e->W); + Files_WriteLInt(&r1, Files_Rider__typ, e->H); +} + +void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T) +{ + Files_Rider r1; + Texts_Run u = NIL, un = NIL; + Texts_Elem e = NIL; + LONGINT org, pos, delta, hlen, rlen; + SHORTINT ecnt, fno, fcnt; + CHAR ch; + Texts_FileMsg msg; + Texts_IdentifyMsg iden; + CHAR mods[64][32], procs[64][32]; + Texts_FontsFont fnts[32]; + CHAR block[1024]; + struct Store__39 _s; + _s.ecnt = &ecnt; + _s.msg = &msg; + _s.iden = &iden; + _s.mods = (void*)mods; + _s.procs = (void*)procs; + _s.lnk = Store__39_s; + Store__39_s = &_s; + org = Files_Pos(&*r, r__typ); + msg.id = 1; + msg.r = *r; + Files_WriteLInt(&msg.r, Files_Rider__typ, ((LONGINT)(0))); + u = T->head->next; + pos = 0; + delta = 0; + fcnt = 1; + ecnt = 1; + while (u != T->head) { + if (__ISP(u, Texts_ElemDesc, 1)) { + iden.mod[0] = 0x00; + (*__GUARDP(u, Texts_ElemDesc, 1)->handle)(__GUARDP(u, Texts_ElemDesc, 1), (void*)&iden, Texts_IdentifyMsg__typ); + } else { + iden.mod[0] = 0x01; + } + if (iden.mod[0] != 0x00) { + fnts[__X(fcnt, ((LONGINT)(32)))] = u->fnt; + fno = 1; + while (__STRCMP(fnts[__X(fno, ((LONGINT)(32)))]->name, u->fnt->name) != 0) { + fno += 1; + } + Files_Write(&msg.r, Files_Rider__typ, fno); + if (fno == fcnt) { + fcnt += 1; + Files_WriteString(&msg.r, Files_Rider__typ, u->fnt->name, ((LONGINT)(32))); + } + Files_Write(&msg.r, Files_Rider__typ, u->col); + Files_Write(&msg.r, Files_Rider__typ, u->voff); + } + if (__ISP(u, Texts_PieceDesc, 1)) { + rlen = u->len; + un = u->next; + while ((((((__ISP(un, Texts_PieceDesc, 1) && un->fnt == u->fnt)) && un->col == u->col)) && un->voff == u->voff)) { + rlen += un->len; + un = un->next; + } + Files_WriteLInt(&msg.r, Files_Rider__typ, rlen); + pos += rlen; + u = un; + } else if (iden.mod[0] != 0x00) { + StoreElem__40(&msg.r, Files_Rider__typ, pos, __GUARDP(u, Texts_ElemDesc, 1)); + pos += 1; + u = u->next; + } else { + delta += 1; + u = u->next; + } + } + Files_Write(&msg.r, Files_Rider__typ, 0); + Files_WriteLInt(&msg.r, Files_Rider__typ, T->len - delta); + hlen = (Files_Pos(&msg.r, Files_Rider__typ) - org) + 2; + Files_Set(&r1, Files_Rider__typ, Files_Base(&msg.r, Files_Rider__typ), org); + Files_WriteLInt(&r1, Files_Rider__typ, hlen); + u = T->head->next; + while (u != T->head) { + if (__ISP(u, Texts_PieceDesc, 1)) { + if (__ISP(u, Texts_PieceDesc, 1)) { + if (((Texts_Piece)u)->ascii) { + Files_Set(&r1, Files_Rider__typ, ((Texts_Piece)u)->file, ((Texts_Piece)u)->org); + delta = ((Texts_Piece)u)->len; + while (delta > 0) { + Files_Read(&r1, Files_Rider__typ, (void*)&ch); + delta -= 1; + if (ch == 0x0a) { + Files_Write(&msg.r, Files_Rider__typ, 0x0d); + } else { + Files_Write(&msg.r, Files_Rider__typ, ch); + } + } + } else { + Files_Set(&r1, Files_Rider__typ, ((Texts_Piece)u)->file, ((Texts_Piece)u)->org); + delta = ((Texts_Piece)u)->len; + while (delta > 1024) { + Files_ReadBytes(&r1, Files_Rider__typ, (void*)block, ((LONGINT)(1024)), ((LONGINT)(1024))); + Files_WriteBytes(&msg.r, Files_Rider__typ, (void*)block, ((LONGINT)(1024)), ((LONGINT)(1024))); + delta -= 1024; + } + Files_ReadBytes(&r1, Files_Rider__typ, (void*)block, ((LONGINT)(1024)), delta); + Files_WriteBytes(&msg.r, Files_Rider__typ, (void*)block, ((LONGINT)(1024)), delta); + } + } else __WITHCHK; + } else { + iden.mod[0] = 0x00; + (*__GUARDP(u, Texts_ElemDesc, 1)->handle)(__GUARDP(u, Texts_ElemDesc, 1), (void*)&iden, Texts_IdentifyMsg__typ); + if (iden.mod[0] != 0x00) { + Files_Write(&msg.r, Files_Rider__typ, 0x1c); + } + } + u = u->next; + } + __GUARDEQR(r, r__typ, Files_Rider) = msg.r; + if (T->notify != NIL) { + (*T->notify)(T, 3, ((LONGINT)(0)), ((LONGINT)(0))); + } + Store__39_s = _s.lnk; +} + +void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len) +{ + Files_File f = NIL; + Files_Rider r; + INTEGER i, res; + CHAR bak[64]; + __DUP(name, name__len, CHAR); + f = Files_New(name, name__len); + Files_Set(&r, Files_Rider__typ, f, ((LONGINT)(0))); + Files_Write(&r, Files_Rider__typ, 0xf0); + Files_Write(&r, Files_Rider__typ, 0x01); + Texts_Store(&r, Files_Rider__typ, T); + i = 0; + while (name[__X(i, name__len)] != 0x00) { + i += 1; + } + __COPY(name, bak, ((LONGINT)(64))); + bak[__X(i, ((LONGINT)(64)))] = '.'; + bak[__X(i + 1, ((LONGINT)(64)))] = 'B'; + bak[__X(i + 2, ((LONGINT)(64)))] = 'a'; + bak[__X(i + 3, ((LONGINT)(64)))] = 'k'; + bak[__X(i + 4, ((LONGINT)(64)))] = 0x00; + Files_Rename(name, name__len, bak, ((LONGINT)(64)), &res); + Files_Register(f); + __DEL(name); +} + +static void EnumPtrs(void (*P)(void*)) +{ + P(Texts_new); + P(Texts_del); + P(Texts_FontsDefault); +} + +__TDESC(Texts_FontDesc, 1, 0) = {__TDFLDS("FontDesc", 32), {-4}}; +__TDESC(Texts_RunDesc, 1, 3) = {__TDFLDS("RunDesc", 20), {0, 4, 12, -16}}; +__TDESC(Texts_PieceDesc, 1, 4) = {__TDFLDS("PieceDesc", 28), {0, 4, 12, 20, -20}}; +__TDESC(Texts_ElemMsg, 1, 0) = {__TDFLDS("ElemMsg", 1), {-4}}; +__TDESC(Texts_ElemDesc, 1, 4) = {__TDFLDS("ElemDesc", 36), {0, 4, 12, 32, -20}}; +__TDESC(Texts_FileMsg, 1, 1) = {__TDFLDS("FileMsg", 28), {16, -8}}; +__TDESC(Texts_CopyMsg, 1, 1) = {__TDFLDS("CopyMsg", 4), {0, -8}}; +__TDESC(Texts_IdentifyMsg, 1, 0) = {__TDFLDS("IdentifyMsg", 64), {-4}}; +__TDESC(Texts_BufDesc, 1, 1) = {__TDFLDS("BufDesc", 8), {4, -8}}; +__TDESC(Texts_TextDesc, 1, 2) = {__TDFLDS("TextDesc", 20), {8, 12, -12}}; +__TDESC(Texts_Reader, 1, 4) = {__TDFLDS("Reader", 48), {4, 12, 24, 36, -20}}; +__TDESC(Texts_Scanner, 1, 4) = {__TDFLDS("Scanner", 144), {4, 12, 24, 36, -20}}; +__TDESC(Texts_Writer, 1, 4) = {__TDFLDS("Writer", 36), {0, 4, 20, 32, -20}}; +__TDESC(Texts__1, 1, 5) = {__TDFLDS("", 112), {0, 4, 12, 32, 36, -24}}; + +export void *Texts__init(void) +{ + __DEFMOD; + __MODULE_IMPORT(Files); + __MODULE_IMPORT(Modules); + __MODULE_IMPORT(Reals); + __REGMOD("Texts", EnumPtrs); + __INITYP(Texts_FontDesc, Texts_FontDesc, 0); + __INITYP(Texts_RunDesc, Texts_RunDesc, 0); + __INITYP(Texts_PieceDesc, Texts_RunDesc, 1); + __INITYP(Texts_ElemMsg, Texts_ElemMsg, 0); + __INITYP(Texts_ElemDesc, Texts_RunDesc, 1); + __INITYP(Texts_FileMsg, Texts_ElemMsg, 1); + __INITYP(Texts_CopyMsg, Texts_ElemMsg, 1); + __INITYP(Texts_IdentifyMsg, Texts_ElemMsg, 1); + __INITYP(Texts_BufDesc, Texts_BufDesc, 0); + __INITYP(Texts_TextDesc, Texts_TextDesc, 0); + __INITYP(Texts_Reader, Texts_Reader, 0); + __INITYP(Texts_Scanner, Texts_Reader, 1); + __INITYP(Texts_Writer, Texts_Writer, 0); + __INITYP(Texts__1, Texts_ElemDesc, 2); +/* BEGIN */ + Texts_del = NIL; + __NEW(Texts_FontsDefault, Texts_FontDesc); + __MOVE("Syntax10.Scn.Fnt", Texts_FontsDefault->name, 17); + __ENDMOD; +} diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h new file mode 100644 index 00000000..7b66d3ce --- /dev/null +++ b/bootstrap/unix-48/Texts.h @@ -0,0 +1,173 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ + +#ifndef Texts__h +#define Texts__h + +#include "SYSTEM.h" +#include "Files.h" + +typedef + struct Texts_BufDesc { + LONGINT len; + char _prvt0[4]; + } Texts_BufDesc; + +typedef + Texts_BufDesc *Texts_Buffer; + +typedef + struct Texts_ElemMsg { + char _prvt0[1]; + } Texts_ElemMsg; + +typedef + struct Texts_ElemDesc *Texts_Elem; + +typedef + struct Texts_CopyMsg { /* Texts_ElemMsg */ + Texts_Elem e; + } Texts_CopyMsg; + +typedef + struct Texts_RunDesc { + LONGINT _prvt0; + char _prvt1[15]; + } Texts_RunDesc; + +typedef + void (*Texts_Handler)(Texts_Elem, Texts_ElemMsg*, LONGINT *); + +typedef + struct Texts_ElemDesc { + char _prvt0[20]; + LONGINT W, H; + Texts_Handler handle; + char _prvt1[4]; + } Texts_ElemDesc; + +typedef + struct Texts_FileMsg { /* Texts_ElemMsg */ + INTEGER id; + LONGINT pos; + Files_Rider r; + } Texts_FileMsg; + +typedef + struct Texts_FontDesc { + char _prvt0[32]; + } Texts_FontDesc; + +typedef + Texts_FontDesc *Texts_FontsFont; + +typedef + struct Texts_IdentifyMsg { /* Texts_ElemMsg */ + CHAR mod[32], proc[32]; + } Texts_IdentifyMsg; + +typedef + struct Texts_TextDesc *Texts_Text; + +typedef + void (*Texts_Notifier)(Texts_Text, INTEGER, LONGINT, LONGINT); + +typedef + struct Texts_Reader { + BOOLEAN eot; + Texts_FontsFont fnt; + SHORTINT col, voff; + Texts_Elem elem; + char _prvt0[32]; + } Texts_Reader; + +typedef + struct Texts_Scanner { /* Texts_Reader */ + BOOLEAN eot; + Texts_FontsFont fnt; + SHORTINT col, voff; + Texts_Elem elem; + LONGREAL _prvt0; + char _prvt1[24]; + CHAR nextCh; + INTEGER line, class; + LONGINT i; + REAL x; + LONGREAL y; + CHAR c; + SHORTINT len; + CHAR s[64]; + } Texts_Scanner; + +typedef + struct Texts_TextDesc { + LONGINT len; + Texts_Notifier notify; + char _prvt0[12]; + } Texts_TextDesc; + +typedef + struct Texts_Writer { + Texts_Buffer buf; + Texts_FontsFont fnt; + SHORTINT col, voff; + char _prvt0[26]; + } Texts_Writer; + + +import Texts_Elem Texts_new; + +import LONGINT *Texts_FontDesc__typ; +import LONGINT *Texts_RunDesc__typ; +import LONGINT *Texts_ElemMsg__typ; +import LONGINT *Texts_ElemDesc__typ; +import LONGINT *Texts_FileMsg__typ; +import LONGINT *Texts_CopyMsg__typ; +import LONGINT *Texts_IdentifyMsg__typ; +import LONGINT *Texts_BufDesc__typ; +import LONGINT *Texts_TextDesc__typ; +import LONGINT *Texts_Reader__typ; +import LONGINT *Texts_Scanner__typ; +import LONGINT *Texts_Writer__typ; + +import void Texts_Append (Texts_Text T, Texts_Buffer B); +import void Texts_ChangeLooks (Texts_Text T, LONGINT beg, LONGINT end, SET sel, Texts_FontsFont fnt, SHORTINT col, SHORTINT voff); +import void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len); +import void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); +import void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); +import void Texts_Delete (Texts_Text T, LONGINT beg, LONGINT end); +import Texts_Text Texts_ElemBase (Texts_Elem E); +import LONGINT Texts_ElemPos (Texts_Elem E); +import void Texts_Insert (Texts_Text T, LONGINT pos, Texts_Buffer B); +import void Texts_Load (Files_Rider *r, LONGINT *r__typ, Texts_Text T); +import void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len); +import void Texts_OpenBuf (Texts_Buffer B); +import void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, LONGINT pos); +import void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, LONGINT pos); +import void Texts_OpenWriter (Texts_Writer *W, LONGINT *W__typ); +import LONGINT Texts_Pos (Texts_Reader *R, LONGINT *R__typ); +import void Texts_Read (Texts_Reader *R, LONGINT *R__typ, CHAR *ch); +import void Texts_ReadElem (Texts_Reader *R, LONGINT *R__typ); +import void Texts_ReadPrevElem (Texts_Reader *R, LONGINT *R__typ); +import void Texts_Recall (Texts_Buffer *B); +import void Texts_Save (Texts_Text T, LONGINT beg, LONGINT end, Texts_Buffer B); +import void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ); +import void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, SHORTINT col); +import void Texts_SetFont (Texts_Writer *W, LONGINT *W__typ, Texts_FontsFont fnt); +import void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, SHORTINT voff); +import void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T); +import void Texts_Write (Texts_Writer *W, LONGINT *W__typ, CHAR ch); +import void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, LONGINT t, LONGINT d); +import void Texts_WriteElem (Texts_Writer *W, LONGINT *W__typ, Texts_Elem e); +import void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, LONGINT x); +import void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n); +import void Texts_WriteLn (Texts_Writer *W, LONGINT *W__typ); +import void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER n); +import void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x); +import void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n); +import void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n, INTEGER k); +import void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x); +import void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__len); +import void *Texts__init(void); + + +#endif diff --git a/bootstrap/unix-48/Vishap.c b/bootstrap/unix-48/Vishap.c new file mode 100644 index 00000000..2b9c3901 --- /dev/null +++ b/bootstrap/unix-48/Vishap.c @@ -0,0 +1,168 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkamSf */ +#include "SYSTEM.h" +#include "Configuration.h" +#include "Heap.h" +#include "OPB.h" +#include "OPC.h" +#include "OPM.h" +#include "OPP.h" +#include "OPT.h" +#include "OPV.h" +#include "Platform.h" +#include "Strings.h" +#include "extTools.h" +#include "vt100.h" + + +static CHAR Vishap_mname[256]; + + +export void Vishap_Module (BOOLEAN *done); +static void Vishap_PropagateElementaryTypeSizes (void); +export void Vishap_Translate (void); +static void Vishap_Trap (INTEGER sig); + + +void Vishap_Module (BOOLEAN *done) +{ + BOOLEAN ext, new; + OPT_Node p = NIL; + OPP_Module(&p, OPM_opt); + if (OPM_noerr) { + OPV_Init(); + OPV_AdrAndSize(OPT_topScope); + OPT_Export(&ext, &new); + if (OPM_noerr) { + OPM_OpenFiles((void*)OPT_SelfName, ((LONGINT)(256))); + OPC_Init(); + OPV_Module(p); + if (OPM_noerr) { + if (((OPM_mainProg || OPM_mainLinkStat) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { + OPM_DeleteNewSym(); + if (!OPM_notColorOutput) { + vt100_SetAttr((CHAR*)"32m", (LONGINT)4); + } + OPM_LogWStr((CHAR*)" Main program.", (LONGINT)16); + if (!OPM_notColorOutput) { + vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + } + } else { + if (new) { + if (!OPM_notColorOutput) { + vt100_SetAttr((CHAR*)"32m", (LONGINT)4); + } + OPM_LogWStr((CHAR*)" New symbol file.", (LONGINT)19); + if (!OPM_notColorOutput) { + vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + } + OPM_RegisterNewSym(); + } else if (ext) { + OPM_LogWStr((CHAR*)" Extended symbol file.", (LONGINT)24); + OPM_RegisterNewSym(); + } + } + } else { + OPM_DeleteNewSym(); + } + } + } + OPM_CloseFiles(); + OPT_Close(); + OPM_LogWLn(); + *done = OPM_noerr; +} + +static void Vishap_PropagateElementaryTypeSizes (void) +{ + OPT_bytetyp->size = OPM_ByteSize; + OPT_sysptrtyp->size = OPM_PointerSize; + OPT_chartyp->size = OPM_CharSize; + OPT_settyp->size = OPM_SetSize; + OPT_realtyp->size = OPM_RealSize; + OPT_inttyp->size = OPM_IntSize; + OPT_linttyp->size = OPM_LIntSize; + OPT_lrltyp->size = OPM_LRealSize; + OPT_sinttyp->size = OPM_SIntSize; + OPT_booltyp->size = OPM_BoolSize; +} + +void Vishap_Translate (void) +{ + BOOLEAN done; + CHAR modulesobj[2048]; + modulesobj[0] = 0x00; + if (OPM_OpenPar()) { + for (;;) { + OPM_Init(&done, (void*)Vishap_mname, ((LONGINT)(256))); + if (!done) { + return; + } + OPM_InitOptions(); + Vishap_PropagateElementaryTypeSizes(); + Heap_GC(0); + Vishap_Module(&done); + if (!done) { + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Module compilation failed.", (LONGINT)27); + OPM_LogWLn(); + Platform_Exit(1); + } + if (!OPM_dontAsm) { + if (OPM_dontLink) { + extTools_Assemble(OPM_modName, ((LONGINT)(32))); + } else { + if (!(OPM_mainProg || OPM_mainLinkStat)) { + extTools_Assemble(OPM_modName, ((LONGINT)(32))); + Strings_Append((CHAR*)" ", (LONGINT)2, (void*)modulesobj, ((LONGINT)(2048))); + Strings_Append(OPM_modName, ((LONGINT)(32)), (void*)modulesobj, ((LONGINT)(2048))); + Strings_Append((CHAR*)".o", (LONGINT)3, (void*)modulesobj, ((LONGINT)(2048))); + } else { + extTools_LinkMain((void*)OPM_modName, ((LONGINT)(32)), OPM_mainLinkStat, modulesobj, ((LONGINT)(2048))); + } + } + } + } + } +} + +static void Vishap_Trap (INTEGER sig) +{ + Heap_FINALL(); + if (sig == 3) { + Platform_Exit(0); + } else { + if ((sig == 4 && Platform_HaltCode == -15)) { + OPM_LogWStr((CHAR*)" --- Vishap Oberon: internal error", (LONGINT)35); + OPM_LogWLn(); + } + Platform_Exit(2); + } +} + + +export int main(int argc, char **argv) +{ + __INIT(argc, argv); + __MODULE_IMPORT(Configuration); + __MODULE_IMPORT(Heap); + __MODULE_IMPORT(OPB); + __MODULE_IMPORT(OPC); + __MODULE_IMPORT(OPM); + __MODULE_IMPORT(OPP); + __MODULE_IMPORT(OPT); + __MODULE_IMPORT(OPV); + __MODULE_IMPORT(Platform); + __MODULE_IMPORT(Strings); + __MODULE_IMPORT(extTools); + __MODULE_IMPORT(vt100); + __REGMAIN("Vishap", 0); + __REGCMD("Translate", Vishap_Translate); +/* BEGIN */ + Platform_SetInterruptHandler(Vishap_Trap); + Platform_SetQuitHandler(Vishap_Trap); + Platform_SetBadInstructionHandler(Vishap_Trap); + OPB_typSize = OPV_TypSize; + OPT_typSize = OPV_TypSize; + Vishap_Translate(); + __FINI; +} diff --git a/bootstrap/unix-48/WindowsWrapper.h b/bootstrap/unix-48/WindowsWrapper.h new file mode 100644 index 00000000..cdb8714c --- /dev/null +++ b/bootstrap/unix-48/WindowsWrapper.h @@ -0,0 +1,9 @@ +// WindowsWrapper.h +// +// Includes Windows.h while avoiding conflicts with Oberon types. + +#undef BOOLEAN +#undef CHAR +#include +#define BOOLEAN char +#define CHAR unsigned char diff --git a/bootstrap/unix-48/errors.c b/bootstrap/unix-48/errors.c new file mode 100644 index 00000000..25a074a9 --- /dev/null +++ b/bootstrap/unix-48/errors.c @@ -0,0 +1,198 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +#include "SYSTEM.h" + +typedef + CHAR errors_string[128]; + + +export errors_string errors_errors[350]; + + + + + +export void *errors__init(void) +{ + __DEFMOD; + __REGMOD("errors", 0); +/* BEGIN */ + __MOVE("undeclared identifier", errors_errors[0], 22); + __MOVE("multiply defined identifier", errors_errors[1], 28); + __MOVE("illegal character in number", errors_errors[2], 28); + __MOVE("illegal character in string", errors_errors[3], 28); + __MOVE("identifier does not match procedure name", errors_errors[4], 41); + __MOVE("comment not closed", errors_errors[5], 19); + errors_errors[6][0] = 0x00; + errors_errors[7][0] = 0x00; + errors_errors[8][0] = 0x00; + __MOVE("\'=\' expected", errors_errors[9], 13); + errors_errors[10][0] = 0x00; + errors_errors[11][0] = 0x00; + __MOVE("type definition starts with incorrect symbol", errors_errors[12], 45); + __MOVE("factor starts with incorrect symbol", errors_errors[13], 36); + __MOVE("statement starts with incorrect symbol", errors_errors[14], 39); + __MOVE("declaration followed by incorrect symbol", errors_errors[15], 41); + __MOVE("MODULE expected", errors_errors[16], 16); + errors_errors[17][0] = 0x00; + __MOVE("\'.\' missing", errors_errors[18], 12); + __MOVE("\',\' missing", errors_errors[19], 12); + __MOVE("\':\' missing", errors_errors[20], 12); + errors_errors[21][0] = 0x00; + __MOVE("\')\' missing", errors_errors[22], 12); + __MOVE("\']\' missing", errors_errors[23], 12); + __MOVE("\'}\' missing", errors_errors[24], 12); + __MOVE("OF missing", errors_errors[25], 11); + __MOVE("THEN missing", errors_errors[26], 13); + __MOVE("DO missing", errors_errors[27], 11); + __MOVE("TO missing", errors_errors[28], 11); + errors_errors[29][0] = 0x00; + __MOVE("\'(\' missing", errors_errors[30], 12); + errors_errors[31][0] = 0x00; + errors_errors[32][0] = 0x00; + errors_errors[33][0] = 0x00; + __MOVE("\':=\' missing", errors_errors[34], 13); + __MOVE("\',\' or OF expected", errors_errors[35], 19); + errors_errors[36][0] = 0x00; + errors_errors[37][0] = 0x00; + __MOVE("identifier expected", errors_errors[38], 20); + __MOVE("\';\' missing", errors_errors[39], 12); + errors_errors[40][0] = 0x00; + __MOVE("END missing", errors_errors[41], 12); + errors_errors[42][0] = 0x00; + errors_errors[43][0] = 0x00; + __MOVE("UNTIL missing", errors_errors[44], 14); + errors_errors[45][0] = 0x00; + __MOVE("EXIT not within loop statement", errors_errors[46], 31); + __MOVE("illegally marked identifier", errors_errors[47], 28); + errors_errors[48][0] = 0x00; + errors_errors[49][0] = 0x00; + __MOVE("expression should be constant", errors_errors[50], 30); + __MOVE("constant not an integer", errors_errors[51], 24); + __MOVE("identifier does not denote a type", errors_errors[52], 34); + __MOVE("identifier does not denote a record type", errors_errors[53], 41); + __MOVE("result type of procedure is not a basic type", errors_errors[54], 45); + __MOVE("procedure call of a function", errors_errors[55], 29); + __MOVE("assignment to non-variable", errors_errors[56], 27); + __MOVE("pointer not bound to record or array type", errors_errors[57], 42); + __MOVE("recursive type definition", errors_errors[58], 26); + __MOVE("illegal open array parameter", errors_errors[59], 29); + __MOVE("wrong type of case label", errors_errors[60], 25); + __MOVE("inadmissible type of case label", errors_errors[61], 32); + __MOVE("case label defined more than once", errors_errors[62], 34); + __MOVE("illegal value of constant", errors_errors[63], 26); + __MOVE("more actual than formal parameters", errors_errors[64], 35); + __MOVE("fewer actual than formal parameters", errors_errors[65], 36); + __MOVE("element types of actual array and formal open array differ", errors_errors[66], 59); + __MOVE("actual parameter corresponding to open array is not an array", errors_errors[67], 61); + __MOVE("control variable must be integer", errors_errors[68], 33); + __MOVE("parameter must be an integer constant", errors_errors[69], 38); + __MOVE("pointer or VAR record required as formal receiver", errors_errors[70], 50); + __MOVE("pointer expected as actual receiver", errors_errors[71], 36); + __MOVE("procedure must be bound to a record of the same scope", errors_errors[72], 54); + __MOVE("procedure must have level 0", errors_errors[73], 28); + __MOVE("procedure unknown in base type", errors_errors[74], 31); + __MOVE("invalid call of base procedure", errors_errors[75], 31); + __MOVE("this variable (field) is read only", errors_errors[76], 35); + __MOVE("object is not a record", errors_errors[77], 23); + __MOVE("dereferenced object is not a variable", errors_errors[78], 38); + __MOVE("indexed object is not a variable", errors_errors[79], 33); + __MOVE("index expression is not an integer", errors_errors[80], 35); + __MOVE("index out of specified bounds", errors_errors[81], 30); + __MOVE("indexed variable is not an array", errors_errors[82], 33); + __MOVE("undefined record field", errors_errors[83], 23); + __MOVE("dereferenced variable is not a pointer", errors_errors[84], 39); + __MOVE("guard or test type is not an extension of variable type", errors_errors[85], 56); + __MOVE("guard or testtype is not a pointer", errors_errors[86], 35); + __MOVE("guarded or tested variable is neither a pointer nor a VAR-parameter record", errors_errors[87], 75); + __MOVE("open array not allowed as variable, record field or array element", errors_errors[88], 66); + errors_errors[89][0] = 0x00; + errors_errors[90][0] = 0x00; + errors_errors[91][0] = 0x00; + __MOVE("operand of IN not an integer, or not a set", errors_errors[92], 43); + __MOVE("set element type is not an integer", errors_errors[93], 35); + __MOVE("operand of & is not of type BOOLEAN", errors_errors[94], 36); + __MOVE("operand of OR is not of type BOOLEAN", errors_errors[95], 37); + __MOVE("operand not applicable to (unary) +", errors_errors[96], 36); + __MOVE("operand not applicable to (unary) -", errors_errors[97], 36); + __MOVE("operand of ~ is not of type BOOLEAN", errors_errors[98], 36); + __MOVE("ASSERT fault", errors_errors[99], 13); + __MOVE("incompatible operands of dyadic operator", errors_errors[100], 41); + __MOVE("operand type inapplicable to *", errors_errors[101], 31); + __MOVE("operand type inapplicable to /", errors_errors[102], 31); + __MOVE("operand type inapplicable to DIV", errors_errors[103], 33); + __MOVE("operand type inapplicable to MOD", errors_errors[104], 33); + __MOVE("operand type inapplicable to +", errors_errors[105], 31); + __MOVE("operand type inapplicable to -", errors_errors[106], 31); + __MOVE("operand type inapplicable to = or #", errors_errors[107], 36); + __MOVE("operand type inapplicable to relation", errors_errors[108], 38); + __MOVE("overriding method must be exported", errors_errors[109], 35); + __MOVE("operand is not a type", errors_errors[110], 22); + __MOVE("operand inapplicable to (this) function", errors_errors[111], 40); + __MOVE("operand is not a variable", errors_errors[112], 26); + __MOVE("incompatible assignment", errors_errors[113], 24); + __MOVE("string too long to be assigned", errors_errors[114], 31); + __MOVE("parameter doesn\'t match", errors_errors[115], 24); + __MOVE("number of parameters doesn\'t match", errors_errors[116], 35); + __MOVE("result type doesn\'t match", errors_errors[117], 26); + __MOVE("export mark doesn\'t match with forward declaration", errors_errors[118], 51); + __MOVE("redefinition textually precedes procedure bound to base type", errors_errors[119], 61); + __MOVE("type of expression following IF, WHILE, UNTIL or ASSERT is not BOOLEAN", errors_errors[120], 71); + __MOVE("called object is not a procedure (or is an interrupt procedure)", errors_errors[121], 64); + __MOVE("actual VAR-parameter is not a variable", errors_errors[122], 39); + __MOVE("type of actual parameter is not identical with that of formal VAR-parameter", errors_errors[123], 76); + __MOVE("type of result expression differs from that of procedure", errors_errors[124], 57); + __MOVE("type of case expression is neither INTEGER nor CHAR", errors_errors[125], 52); + __MOVE("this expression cannot be a type or a procedure", errors_errors[126], 48); + __MOVE("illegal use of object", errors_errors[127], 22); + __MOVE("unsatisfied forward reference", errors_errors[128], 30); + __MOVE("unsatisfied forward procedure", errors_errors[129], 30); + __MOVE("WITH clause does not specify a variable", errors_errors[130], 40); + __MOVE("LEN not applied to array", errors_errors[131], 25); + __MOVE("dimension in LEN too large or negative", errors_errors[132], 39); + __MOVE("SYSTEM not imported", errors_errors[135], 20); + __MOVE("key inconsistency of imported module", errors_errors[150], 37); + __MOVE("incorrect symbol file", errors_errors[151], 22); + __MOVE("symbol file of imported module not found", errors_errors[152], 41); + __MOVE("object or symbol file not opened (disk full\?)", errors_errors[153], 46); + __MOVE("recursive import not allowed", errors_errors[154], 29); + __MOVE("generation of new symbol file not allowed", errors_errors[155], 42); + __MOVE("parameter file not found", errors_errors[156], 25); + __MOVE("syntax error in parameter file", errors_errors[157], 31); + __MOVE("not yet implemented", errors_errors[200], 20); + __MOVE("lower bound of set range greater than higher bound", errors_errors[201], 51); + __MOVE("set element greater than MAX(SET) or less than 0", errors_errors[202], 49); + __MOVE("number too large", errors_errors[203], 17); + __MOVE("product too large", errors_errors[204], 18); + __MOVE("division by zero", errors_errors[205], 17); + __MOVE("sum too large", errors_errors[206], 14); + __MOVE("difference too large", errors_errors[207], 21); + __MOVE("overflow in arithmetic shift", errors_errors[208], 29); + __MOVE("case range too large", errors_errors[209], 21); + __MOVE("too many cases in case statement", errors_errors[213], 33); + __MOVE("illegal value of parameter (0 <= p < 256)", errors_errors[218], 42); + __MOVE("machine registers cannot be accessed", errors_errors[219], 37); + __MOVE("illegal value of parameter", errors_errors[220], 27); + __MOVE("too many pointers in a record", errors_errors[221], 30); + __MOVE("too many global pointers", errors_errors[222], 25); + __MOVE("too many record types", errors_errors[223], 22); + __MOVE("too many pointer types", errors_errors[224], 23); + __MOVE("address of pointer variable too large (move forward in text)", errors_errors[225], 61); + __MOVE("too many exported procedures", errors_errors[226], 29); + __MOVE("too many imported modules", errors_errors[227], 26); + __MOVE("too many exported structures", errors_errors[228], 29); + __MOVE("too many nested records for import", errors_errors[229], 35); + __MOVE("too many constants (strings) in module", errors_errors[230], 39); + __MOVE("too many link table entries (external procedures)", errors_errors[231], 50); + __MOVE("too many commands in module", errors_errors[232], 28); + __MOVE("record extension hierarchy too high", errors_errors[233], 36); + __MOVE("export of recursive type not allowed", errors_errors[234], 37); + __MOVE("identifier too long", errors_errors[240], 20); + __MOVE("string too long", errors_errors[241], 16); + __MOVE("address overflow", errors_errors[242], 17); + __MOVE("cyclic type definition not allowed", errors_errors[244], 35); + __MOVE("guarded pointer variable may be manipulated by non-local operations; use auxiliary pointer variable", errors_errors[245], 100); + __MOVE("implicit type cast", errors_errors[301], 19); + __MOVE("inappropriate symbol file ignored", errors_errors[306], 34); + __MOVE("no ELSE symbol after CASE statement sequence may lead to trap", errors_errors[307], 62); + __ENDMOD; +} diff --git a/bootstrap/unix-48/errors.h b/bootstrap/unix-48/errors.h new file mode 100644 index 00000000..c4fe8850 --- /dev/null +++ b/bootstrap/unix-48/errors.h @@ -0,0 +1,18 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ + +#ifndef errors__h +#define errors__h + +#include "SYSTEM.h" + +typedef + CHAR errors_string[128]; + + +import errors_string errors_errors[350]; + + +import void *errors__init(void); + + +#endif diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c new file mode 100644 index 00000000..6f1a6654 --- /dev/null +++ b/bootstrap/unix-48/extTools.c @@ -0,0 +1,112 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +#include "SYSTEM.h" +#include "Configuration.h" +#include "Console.h" +#include "OPM.h" +#include "Platform.h" +#include "Strings.h" + + +static CHAR extTools_compilationOptions[1023], extTools_CFLAGS[1023]; + + +export void extTools_Assemble (CHAR *moduleName, LONGINT moduleName__len); +export void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN statically, CHAR *additionalopts, LONGINT additionalopts__len); +static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGINT cmd__len); + + +static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGINT cmd__len) +{ + INTEGER r, status, exitcode; + __DUP(title, title__len, CHAR); + __DUP(cmd, cmd__len, CHAR); + if (OPM_Verbose) { + Console_String(title, title__len); + Console_String(cmd, cmd__len); + Console_Ln(); + } + r = Platform_System(cmd, cmd__len); + status = __MASK(r, -128); + exitcode = __ASHR(r, 8); + if (exitcode > 127) { + exitcode = exitcode - 256; + } + if (r != 0) { + Console_String(title, title__len); + Console_String(cmd, cmd__len); + Console_Ln(); + Console_String((CHAR*)"-- failed: status ", (LONGINT)19); + Console_Int(status, ((LONGINT)(1))); + Console_String((CHAR*)", exitcode ", (LONGINT)12); + Console_Int(exitcode, ((LONGINT)(1))); + Console_String((CHAR*)".", (LONGINT)2); + Console_Ln(); + if ((status == 0 && exitcode == 127)) { + Console_String((CHAR*)"Is the C compiler in the current command path\?", (LONGINT)47); + Console_Ln(); + } + if (status != 0) { + Platform_Halt(status); + } else { + Platform_Halt(exitcode); + } + } + __DEL(title); + __DEL(cmd); +} + +void extTools_Assemble (CHAR *moduleName, LONGINT moduleName__len) +{ + CHAR cmd[1023]; + __DUP(moduleName, moduleName__len, CHAR); + __MOVE("gcc -g", cmd, 7); + Strings_Append(extTools_compilationOptions, ((LONGINT)(1023)), (void*)cmd, ((LONGINT)(1023))); + Strings_Append((CHAR*)"-c ", (LONGINT)4, (void*)cmd, ((LONGINT)(1023))); + Strings_Append(moduleName, moduleName__len, (void*)cmd, ((LONGINT)(1023))); + Strings_Append((CHAR*)".c", (LONGINT)3, (void*)cmd, ((LONGINT)(1023))); + extTools_execute((CHAR*)"Assemble: ", (LONGINT)11, cmd, ((LONGINT)(1023))); + __DEL(moduleName); +} + +void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN statically, CHAR *additionalopts, LONGINT additionalopts__len) +{ + CHAR cmd[1023]; + __DUP(additionalopts, additionalopts__len, CHAR); + __MOVE("gcc -g", cmd, 7); + Strings_Append((CHAR*)" ", (LONGINT)2, (void*)cmd, ((LONGINT)(1023))); + Strings_Append(extTools_compilationOptions, ((LONGINT)(1023)), (void*)cmd, ((LONGINT)(1023))); + Strings_Append(moduleName, moduleName__len, (void*)cmd, ((LONGINT)(1023))); + Strings_Append((CHAR*)".c ", (LONGINT)4, (void*)cmd, ((LONGINT)(1023))); + Strings_Append(additionalopts, additionalopts__len, (void*)cmd, ((LONGINT)(1023))); + if (statically) { + Strings_Append((CHAR*)"-static", (LONGINT)8, (void*)cmd, ((LONGINT)(1023))); + } + Strings_Append((CHAR*)" -o ", (LONGINT)5, (void*)cmd, ((LONGINT)(1023))); + Strings_Append(moduleName, moduleName__len, (void*)cmd, ((LONGINT)(1023))); + Strings_Append((CHAR*)" -L\"", (LONGINT)5, (void*)cmd, ((LONGINT)(1023))); + Strings_Append((CHAR*)"/opt/voc", (LONGINT)9, (void*)cmd, ((LONGINT)(1023))); + Strings_Append((CHAR*)"/lib\"", (LONGINT)6, (void*)cmd, ((LONGINT)(1023))); + Strings_Append((CHAR*)" -l voc", (LONGINT)8, (void*)cmd, ((LONGINT)(1023))); + extTools_execute((CHAR*)"Assemble and link: ", (LONGINT)20, cmd, ((LONGINT)(1023))); + __DEL(additionalopts); +} + + +export void *extTools__init(void) +{ + __DEFMOD; + __MODULE_IMPORT(Configuration); + __MODULE_IMPORT(Console); + __MODULE_IMPORT(OPM); + __MODULE_IMPORT(Platform); + __MODULE_IMPORT(Strings); + __REGMOD("extTools", 0); +/* BEGIN */ + Strings_Append((CHAR*)" -I \"", (LONGINT)6, (void*)extTools_compilationOptions, ((LONGINT)(1023))); + Strings_Append((CHAR*)"/opt/voc", (LONGINT)9, (void*)extTools_compilationOptions, ((LONGINT)(1023))); + Strings_Append((CHAR*)"/include\" ", (LONGINT)11, (void*)extTools_compilationOptions, ((LONGINT)(1023))); + Platform_GetEnv((CHAR*)"CFLAGS", (LONGINT)7, (void*)extTools_CFLAGS, ((LONGINT)(1023))); + Strings_Append(extTools_CFLAGS, ((LONGINT)(1023)), (void*)extTools_compilationOptions, ((LONGINT)(1023))); + Strings_Append((CHAR*)" ", (LONGINT)2, (void*)extTools_compilationOptions, ((LONGINT)(1023))); + __ENDMOD; +} diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h new file mode 100644 index 00000000..95d07ddd --- /dev/null +++ b/bootstrap/unix-48/extTools.h @@ -0,0 +1,16 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ + +#ifndef extTools__h +#define extTools__h + +#include "SYSTEM.h" + + + + +import void extTools_Assemble (CHAR *moduleName, LONGINT moduleName__len); +import void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN statically, CHAR *additionalopts, LONGINT additionalopts__len); +import void *extTools__init(void); + + +#endif diff --git a/bootstrap/unix-48/vt100.c b/bootstrap/unix-48/vt100.c new file mode 100644 index 00000000..649ea068 --- /dev/null +++ b/bootstrap/unix-48/vt100.c @@ -0,0 +1,258 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +#include "SYSTEM.h" +#include "Console.h" +#include "Strings.h" + + +export CHAR vt100_CSI[5]; +static CHAR vt100_tmpstr[32]; + + +export void vt100_CHA (INTEGER n); +export void vt100_CNL (INTEGER n); +export void vt100_CPL (INTEGER n); +export void vt100_CUB (INTEGER n); +export void vt100_CUD (INTEGER n); +export void vt100_CUF (INTEGER n); +export void vt100_CUP (INTEGER n, INTEGER m); +export void vt100_CUU (INTEGER n); +export void vt100_DECTCEMh (void); +export void vt100_DECTCEMl (void); +export void vt100_DSR (INTEGER n); +export void vt100_ED (INTEGER n); +export void vt100_EL (INTEGER n); +static void vt100_EscSeq (INTEGER n, CHAR *letter, LONGINT letter__len); +static void vt100_EscSeq0 (CHAR *letter, LONGINT letter__len); +static void vt100_EscSeq2 (INTEGER n, INTEGER m, CHAR *letter, LONGINT letter__len); +static void vt100_EscSeqSwapped (INTEGER n, CHAR *letter, LONGINT letter__len); +export void vt100_HVP (INTEGER n, INTEGER m); +export void vt100_IntToStr (LONGINT int_, CHAR *str, LONGINT str__len); +export void vt100_RCP (void); +static void vt100_Reverse0 (CHAR *str, LONGINT str__len, INTEGER start, INTEGER end); +export void vt100_SCP (void); +export void vt100_SD (INTEGER n); +export void vt100_SGR (INTEGER n); +export void vt100_SGR2 (INTEGER n, INTEGER m); +export void vt100_SU (INTEGER n); +export void vt100_SetAttr (CHAR *attr, LONGINT attr__len); + + +static void vt100_Reverse0 (CHAR *str, LONGINT str__len, INTEGER start, INTEGER end) +{ + CHAR h; + while (start < end) { + h = str[__X(start, str__len)]; + str[__X(start, str__len)] = str[__X(end, str__len)]; + str[__X(end, str__len)] = h; + start += 1; + end -= 1; + } +} + +void vt100_IntToStr (LONGINT int_, CHAR *str, LONGINT str__len) +{ + CHAR b[21]; + INTEGER s, e; + SHORTINT maxLength; + maxLength = 11; + if (int_ == (-2147483647-1)) { + __MOVE("-2147483648", b, 12); + e = 11; + } else { + if (int_ < 0) { + b[0] = '-'; + int_ = -int_; + s = 1; + } else { + s = 0; + } + e = s; + do { + b[__X(e, ((LONGINT)(21)))] = (CHAR)(__MOD(int_, 10) + 48); + int_ = __DIV(int_, 10); + e += 1; + } while (!(int_ == 0)); + b[__X(e, ((LONGINT)(21)))] = 0x00; + vt100_Reverse0((void*)b, ((LONGINT)(21)), s, e - 1); + } + __COPY(b, str, str__len); +} + +static void vt100_EscSeq0 (CHAR *letter, LONGINT letter__len) +{ + CHAR cmd[9]; + __DUP(letter, letter__len, CHAR); + __COPY(vt100_CSI, cmd, ((LONGINT)(9))); + Strings_Append(letter, letter__len, (void*)cmd, ((LONGINT)(9))); + Console_String(cmd, ((LONGINT)(9))); + __DEL(letter); +} + +static void vt100_EscSeq (INTEGER n, CHAR *letter, LONGINT letter__len) +{ + CHAR nstr[2]; + CHAR cmd[7]; + __DUP(letter, letter__len, CHAR); + vt100_IntToStr(n, (void*)nstr, ((LONGINT)(2))); + __COPY(vt100_CSI, cmd, ((LONGINT)(7))); + Strings_Append(nstr, ((LONGINT)(2)), (void*)cmd, ((LONGINT)(7))); + Strings_Append(letter, letter__len, (void*)cmd, ((LONGINT)(7))); + Console_String(cmd, ((LONGINT)(7))); + __DEL(letter); +} + +static void vt100_EscSeqSwapped (INTEGER n, CHAR *letter, LONGINT letter__len) +{ + CHAR nstr[2]; + CHAR cmd[7]; + __DUP(letter, letter__len, CHAR); + vt100_IntToStr(n, (void*)nstr, ((LONGINT)(2))); + __COPY(vt100_CSI, cmd, ((LONGINT)(7))); + Strings_Append(letter, letter__len, (void*)cmd, ((LONGINT)(7))); + Strings_Append(nstr, ((LONGINT)(2)), (void*)cmd, ((LONGINT)(7))); + Console_String(cmd, ((LONGINT)(7))); + __DEL(letter); +} + +static void vt100_EscSeq2 (INTEGER n, INTEGER m, CHAR *letter, LONGINT letter__len) +{ + CHAR nstr[5], mstr[5]; + CHAR cmd[12]; + __DUP(letter, letter__len, CHAR); + vt100_IntToStr(n, (void*)nstr, ((LONGINT)(5))); + vt100_IntToStr(m, (void*)mstr, ((LONGINT)(5))); + __COPY(vt100_CSI, cmd, ((LONGINT)(12))); + Strings_Append(nstr, ((LONGINT)(5)), (void*)cmd, ((LONGINT)(12))); + Strings_Append((CHAR*)";", (LONGINT)2, (void*)cmd, ((LONGINT)(12))); + Strings_Append(mstr, ((LONGINT)(5)), (void*)cmd, ((LONGINT)(12))); + Strings_Append(letter, letter__len, (void*)cmd, ((LONGINT)(12))); + Console_String(cmd, ((LONGINT)(12))); + __DEL(letter); +} + +void vt100_CUU (INTEGER n) +{ + vt100_EscSeq(n, (CHAR*)"A", (LONGINT)2); +} + +void vt100_CUD (INTEGER n) +{ + vt100_EscSeq(n, (CHAR*)"B", (LONGINT)2); +} + +void vt100_CUF (INTEGER n) +{ + vt100_EscSeq(n, (CHAR*)"C", (LONGINT)2); +} + +void vt100_CUB (INTEGER n) +{ + vt100_EscSeq(n, (CHAR*)"D", (LONGINT)2); +} + +void vt100_CNL (INTEGER n) +{ + vt100_EscSeq(n, (CHAR*)"E", (LONGINT)2); +} + +void vt100_CPL (INTEGER n) +{ + vt100_EscSeq(n, (CHAR*)"F", (LONGINT)2); +} + +void vt100_CHA (INTEGER n) +{ + vt100_EscSeq(n, (CHAR*)"G", (LONGINT)2); +} + +void vt100_CUP (INTEGER n, INTEGER m) +{ + vt100_EscSeq2(n, m, (CHAR*)"H", (LONGINT)2); +} + +void vt100_ED (INTEGER n) +{ + vt100_EscSeq(n, (CHAR*)"J", (LONGINT)2); +} + +void vt100_EL (INTEGER n) +{ + vt100_EscSeq(n, (CHAR*)"K", (LONGINT)2); +} + +void vt100_SU (INTEGER n) +{ + vt100_EscSeq(n, (CHAR*)"S", (LONGINT)2); +} + +void vt100_SD (INTEGER n) +{ + vt100_EscSeq(n, (CHAR*)"T", (LONGINT)2); +} + +void vt100_HVP (INTEGER n, INTEGER m) +{ + vt100_EscSeq2(n, m, (CHAR*)"f", (LONGINT)2); +} + +void vt100_SGR (INTEGER n) +{ + vt100_EscSeq(n, (CHAR*)"m", (LONGINT)2); +} + +void vt100_SGR2 (INTEGER n, INTEGER m) +{ + vt100_EscSeq2(n, m, (CHAR*)"m", (LONGINT)2); +} + +void vt100_DSR (INTEGER n) +{ + vt100_EscSeq(6, (CHAR*)"n", (LONGINT)2); +} + +void vt100_SCP (void) +{ + vt100_EscSeq0((CHAR*)"s", (LONGINT)2); +} + +void vt100_RCP (void) +{ + vt100_EscSeq0((CHAR*)"u", (LONGINT)2); +} + +void vt100_DECTCEMl (void) +{ + vt100_EscSeq0((CHAR*)"\?25l", (LONGINT)5); +} + +void vt100_DECTCEMh (void) +{ + vt100_EscSeq0((CHAR*)"\?25h", (LONGINT)5); +} + +void vt100_SetAttr (CHAR *attr, LONGINT attr__len) +{ + CHAR tmpstr[16]; + __DUP(attr, attr__len, CHAR); + __COPY(vt100_CSI, tmpstr, ((LONGINT)(16))); + Strings_Append(attr, attr__len, (void*)tmpstr, ((LONGINT)(16))); + Console_String(tmpstr, ((LONGINT)(16))); + __DEL(attr); +} + + +export void *vt100__init(void) +{ + __DEFMOD; + __MODULE_IMPORT(Console); + __MODULE_IMPORT(Strings); + __REGMOD("vt100", 0); + __REGCMD("DECTCEMh", vt100_DECTCEMh); + __REGCMD("DECTCEMl", vt100_DECTCEMl); + __REGCMD("RCP", vt100_RCP); + __REGCMD("SCP", vt100_SCP); +/* BEGIN */ + __COPY("", vt100_CSI, ((LONGINT)(5))); + Strings_Append((CHAR*)"[", (LONGINT)2, (void*)vt100_CSI, ((LONGINT)(5))); + __ENDMOD; +} diff --git a/bootstrap/unix-48/vt100.h b/bootstrap/unix-48/vt100.h new file mode 100644 index 00000000..6d210ec9 --- /dev/null +++ b/bootstrap/unix-48/vt100.h @@ -0,0 +1,37 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ + +#ifndef vt100__h +#define vt100__h + +#include "SYSTEM.h" + + +import CHAR vt100_CSI[5]; + + +import void vt100_CHA (INTEGER n); +import void vt100_CNL (INTEGER n); +import void vt100_CPL (INTEGER n); +import void vt100_CUB (INTEGER n); +import void vt100_CUD (INTEGER n); +import void vt100_CUF (INTEGER n); +import void vt100_CUP (INTEGER n, INTEGER m); +import void vt100_CUU (INTEGER n); +import void vt100_DECTCEMh (void); +import void vt100_DECTCEMl (void); +import void vt100_DSR (INTEGER n); +import void vt100_ED (INTEGER n); +import void vt100_EL (INTEGER n); +import void vt100_HVP (INTEGER n, INTEGER m); +import void vt100_IntToStr (LONGINT int_, CHAR *str, LONGINT str__len); +import void vt100_RCP (void); +import void vt100_SCP (void); +import void vt100_SD (INTEGER n); +import void vt100_SGR (INTEGER n); +import void vt100_SGR2 (INTEGER n, INTEGER m); +import void vt100_SU (INTEGER n); +import void vt100_SetAttr (CHAR *attr, LONGINT attr__len); +import void *vt100__init(void); + + +#endif diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c new file mode 100644 index 00000000..c4d62d40 --- /dev/null +++ b/bootstrap/unix-88/Configuration.c @@ -0,0 +1,17 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +#define LARGE +#include "SYSTEM.h" + + + + + + + +export void *Configuration__init(void) +{ + __DEFMOD; + __REGMOD("Configuration", 0); +/* BEGIN */ + __ENDMOD; +} diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h new file mode 100644 index 00000000..b076eaee --- /dev/null +++ b/bootstrap/unix-88/Configuration.h @@ -0,0 +1,15 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ + +#ifndef Configuration__h +#define Configuration__h + +#define LARGE +#include "SYSTEM.h" + + + + +import void *Configuration__init(void); + + +#endif diff --git a/bootstrap/unix-88/Console.c b/bootstrap/unix-88/Console.c new file mode 100644 index 00000000..5946cb5d --- /dev/null +++ b/bootstrap/unix-88/Console.c @@ -0,0 +1,151 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +#define LARGE +#include "SYSTEM.h" +#include "Platform.h" + + +static CHAR Console_line[128]; +static INTEGER Console_pos; + + +export void Console_Bool (BOOLEAN b); +export void Console_Char (CHAR ch); +export void Console_Flush (void); +export void Console_Hex (LONGINT i); +export void Console_Int (LONGINT i, LONGINT n); +export void Console_Ln (void); +export void Console_Read (CHAR *ch); +export void Console_ReadLine (CHAR *line, LONGINT line__len); +export void Console_String (CHAR *s, LONGINT s__len); + + +void Console_Flush (void) +{ + INTEGER error; + error = Platform_Write(((LONGINT)(1)), (LONGINT)(uintptr_t)Console_line, Console_pos); + Console_pos = 0; +} + +void Console_Char (CHAR ch) +{ + if (Console_pos == 128) { + Console_Flush(); + } + Console_line[__X(Console_pos, ((LONGINT)(128)))] = ch; + Console_pos += 1; + if (ch == 0x0a) { + Console_Flush(); + } +} + +void Console_String (CHAR *s, LONGINT s__len) +{ + INTEGER i; + __DUP(s, s__len, CHAR); + i = 0; + while (s[__X(i, s__len)] != 0x00) { + Console_Char(s[__X(i, s__len)]); + i += 1; + } + __DEL(s); +} + +void Console_Int (LONGINT i, LONGINT n) +{ + CHAR s[32]; + LONGINT i1, k; + if (i == __LSHL(1, 63, LONGINT)) { + __MOVE("8085774586302733229", s, 20); + k = 19; + } else { + i1 = __ABS(i); + s[0] = (CHAR)(__MOD(i1, 10) + 48); + i1 = __DIV(i1, 10); + k = 1; + while (i1 > 0) { + s[__X(k, ((LONGINT)(32)))] = (CHAR)(__MOD(i1, 10) + 48); + i1 = __DIV(i1, 10); + k += 1; + } + } + if (i < 0) { + s[__X(k, ((LONGINT)(32)))] = '-'; + k += 1; + } + while (n > k) { + Console_Char(' '); + n -= 1; + } + while (k > 0) { + k -= 1; + Console_Char(s[__X(k, ((LONGINT)(32)))]); + } +} + +void Console_Ln (void) +{ + Console_Char(0x0a); +} + +void Console_Bool (BOOLEAN b) +{ + if (b) { + Console_String((CHAR*)"TRUE", (LONGINT)5); + } else { + Console_String((CHAR*)"FALSE", (LONGINT)6); + } +} + +void Console_Hex (LONGINT i) +{ + LONGINT k, n; + k = -28; + while (k <= 0) { + n = __MASK(__ASH(i, k), -16); + if (n <= 9) { + Console_Char((CHAR)(48 + n)); + } else { + Console_Char((CHAR)(55 + n)); + } + k += 4; + } +} + +void Console_Read (CHAR *ch) +{ + LONGINT n; + INTEGER error; + Console_Flush(); + error = Platform_ReadBuf(((LONGINT)(0)), (void*)&*ch, ((LONGINT)(1)), &n); + if (n != 1) { + *ch = 0x00; + } +} + +void Console_ReadLine (CHAR *line, LONGINT line__len) +{ + LONGINT i; + CHAR ch; + Console_Flush(); + i = 0; + Console_Read(&ch); + while ((((i < line__len - 1 && ch != 0x0a)) && ch != 0x00)) { + line[__X(i, line__len)] = ch; + i += 1; + Console_Read(&ch); + } + line[__X(i, line__len)] = 0x00; +} + + +export void *Console__init(void) +{ + __DEFMOD; + __MODULE_IMPORT(Platform); + __REGMOD("Console", 0); + __REGCMD("Flush", Console_Flush); + __REGCMD("Ln", Console_Ln); +/* BEGIN */ + Console_pos = 0; + __ENDMOD; +} diff --git a/bootstrap/unix-88/Console.h b/bootstrap/unix-88/Console.h new file mode 100644 index 00000000..d8a9b11e --- /dev/null +++ b/bootstrap/unix-88/Console.h @@ -0,0 +1,24 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ + +#ifndef Console__h +#define Console__h + +#define LARGE +#include "SYSTEM.h" + + + + +import void Console_Bool (BOOLEAN b); +import void Console_Char (CHAR ch); +import void Console_Flush (void); +import void Console_Hex (LONGINT i); +import void Console_Int (LONGINT i, LONGINT n); +import void Console_Ln (void); +import void Console_Read (CHAR *ch); +import void Console_ReadLine (CHAR *line, LONGINT line__len); +import void Console_String (CHAR *s, LONGINT s__len); +import void *Console__init(void); + + +#endif diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c new file mode 100644 index 00000000..b48620b0 --- /dev/null +++ b/bootstrap/unix-88/Files.c @@ -0,0 +1,1079 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin tspkaSfF */ +#define LARGE +#include "SYSTEM.h" +#include "Configuration.h" +#include "Console.h" +#include "Heap.h" +#include "Platform.h" +#include "Strings.h" + +typedef + struct Files_Handle *Files_File; + +typedef + struct Files_BufDesc { + Files_File f; + BOOLEAN chg; + LONGINT org, size; + SYSTEM_BYTE data[4096]; + } Files_BufDesc; + +typedef + Files_BufDesc *Files_Buffer; + +typedef + CHAR Files_FileName[101]; + +typedef + struct Files_Handle { + Files_FileName workName, registerName; + BOOLEAN tempFile; + Platform_FileIdentity identity; + LONGINT fd, len, pos; + Files_Buffer bufs[4]; + INTEGER swapper, state; + } Files_Handle; + +typedef + struct Files_Rider { + LONGINT res; + BOOLEAN eof; + Files_Buffer buf; + LONGINT org, offset; + } Files_Rider; + + +static LONGINT Files_fileTab[256]; +static INTEGER Files_tempno; +static CHAR Files_HOME[1024]; +static struct { + LONGINT len[1]; + CHAR data[1]; +} *Files_SearchPath; + +export LONGINT *Files_Handle__typ; +export LONGINT *Files_BufDesc__typ; +export LONGINT *Files_Rider__typ; + +export Files_File Files_Base (Files_Rider *r, LONGINT *r__typ); +static Files_File Files_CacheEntry (Platform_FileIdentity identity); +export void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INTEGER *res); +export void Files_Close (Files_File f); +static void Files_Create (Files_File f); +export void Files_Delete (CHAR *name, LONGINT name__len, INTEGER *res); +static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INTEGER errcode); +static void Files_Finalize (SYSTEM_PTR o); +static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *dest, LONGINT dest__len); +static void Files_Flush (Files_Buffer buf); +export void Files_GetDate (Files_File f, LONGINT *t, LONGINT *d); +export void Files_GetName (Files_File f, CHAR *name, LONGINT name__len); +static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *name, LONGINT name__len); +static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len); +static void Files_Init (void); +export LONGINT Files_Length (Files_File f); +static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT name__len, CHAR *dest, LONGINT dest__len); +export Files_File Files_New (CHAR *name, LONGINT name__len); +export Files_File Files_Old (CHAR *name, LONGINT name__len); +export LONGINT Files_Pos (Files_Rider *r, LONGINT *r__typ); +export void Files_Purge (Files_File f); +export void Files_Read (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x); +export void Files_ReadBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN *x); +export void Files_ReadByte (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len); +export void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, LONGINT n); +export void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, INTEGER *x); +export void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, LONGINT *x); +export void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x); +export void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); +export void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, LONGINT *x); +export void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x); +export void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x); +export void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); +export void Files_Register (Files_File f); +export void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INTEGER *res); +static void Files_ScanPath (INTEGER *pos, CHAR *dir, LONGINT dir__len); +export void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, LONGINT pos); +export void Files_SetSearchPath (CHAR *path, LONGINT path__len); +export void Files_Write (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE x); +export void Files_WriteBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN x); +export void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, LONGINT n); +export void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, INTEGER x); +export void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, LONGINT x); +export void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x); +export void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, LONGINT x); +export void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x); +export void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x); +export void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); + +#define Files_IdxTrap() __HALT(-1) + +static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INTEGER errcode) +{ + __DUP(s, s__len, CHAR); + Console_Ln(); + Console_String((CHAR*)"-- ", (LONGINT)4); + Console_String(s, s__len); + Console_String((CHAR*)": ", (LONGINT)3); + if (f != NIL) { + if (f->registerName[0] != 0x00) { + Console_String(f->registerName, ((LONGINT)(101))); + } else { + Console_String(f->workName, ((LONGINT)(101))); + } + if (f->fd != 0) { + Console_String((CHAR*)"f.fd = ", (LONGINT)8); + Console_Int(f->fd, ((LONGINT)(1))); + } + } + if (errcode != 0) { + Console_String((CHAR*)" errcode = ", (LONGINT)12); + Console_Int(errcode, ((LONGINT)(1))); + } + Console_Ln(); + __HALT(99); + __DEL(s); +} + +static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT name__len, CHAR *dest, LONGINT dest__len) +{ + INTEGER i, j; + __DUP(dir, dir__len, CHAR); + __DUP(name, name__len, CHAR); + i = 0; + j = 0; + while (dir[i] != 0x00) { + dest[i] = dir[i]; + i += 1; + } + if (dest[i - 1] != '/') { + dest[i] = '/'; + i += 1; + } + while (name[j] != 0x00) { + dest[i] = name[j]; + i += 1; + j += 1; + } + dest[i] = 0x00; + __DEL(dir); + __DEL(name); +} + +static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *name, LONGINT name__len) +{ + LONGINT n, i, j; + __DUP(finalName, finalName__len, CHAR); + Files_tempno += 1; + n = Files_tempno; + i = 0; + if (finalName[0] != '/') { + while (Platform_CWD[i] != 0x00) { + name[i] = Platform_CWD[i]; + i += 1; + } + if (Platform_CWD[i - 1] != '/') { + name[i] = '/'; + i += 1; + } + } + j = 0; + while (finalName[j] != 0x00) { + name[i] = finalName[j]; + i += 1; + j += 1; + } + i -= 1; + while (name[i] != '/') { + i -= 1; + } + name[i + 1] = '.'; + name[i + 2] = 't'; + name[i + 3] = 'm'; + name[i + 4] = 'p'; + name[i + 5] = '.'; + i += 6; + while (n > 0) { + name[i] = (CHAR)(__MOD(n, 10) + 48); + n = __DIV(n, 10); + i += 1; + } + name[i] = '.'; + i += 1; + n = Platform_PID; + while (n > 0) { + name[i] = (CHAR)(__MOD(n, 10) + 48); + n = __DIV(n, 10); + i += 1; + } + name[i] = 0x00; + __DEL(finalName); +} + +static void Files_Create (Files_File f) +{ + Platform_FileIdentity identity; + BOOLEAN done; + INTEGER error; + CHAR err[32]; + if (f->fd == -1) { + if (f->state == 1) { + Files_GetTempName(f->registerName, ((LONGINT)(101)), (void*)f->workName, ((LONGINT)(101))); + f->tempFile = 1; + } else if (f->state == 2) { + __COPY(f->registerName, f->workName, ((LONGINT)(101))); + f->registerName[0] = 0x00; + f->tempFile = 0; + } + error = Platform_Unlink((void*)f->workName, ((LONGINT)(101))); + error = Platform_New((void*)f->workName, ((LONGINT)(101)), &f->fd); + done = error == 0; + if ((!done && Platform_TooManyFiles(error)) || (done && f->fd >= 256)) { + if ((done && f->fd >= 256)) { + error = Platform_Close(f->fd); + } + Heap_GC(1); + error = Platform_New((void*)f->workName, ((LONGINT)(101)), &f->fd); + done = f->fd == 0; + } + if (done) { + if (f->fd >= 256) { + error = Platform_Close(f->fd); + Files_Err((CHAR*)"too many files open", (LONGINT)20, f, 0); + } else { + Files_fileTab[f->fd] = (LONGINT)(uintptr_t)f; + Heap_FileCount += 1; + Heap_RegisterFinalizer((void*)f, Files_Finalize); + f->state = 0; + f->pos = 0; + error = Platform_Identify(f->fd, &f->identity, Platform_FileIdentity__typ); + } + } else { + if (Platform_NoSuchDirectory(error)) { + __MOVE("no such directory", err, 18); + } else if (Platform_TooManyFiles(error)) { + __MOVE("too many files open", err, 20); + } else { + __MOVE("file not created", err, 17); + } + Files_Err(err, ((LONGINT)(32)), f, error); + } + } +} + +static void Files_Flush (Files_Buffer buf) +{ + INTEGER error; + Files_File f = NIL; + if (buf->chg) { + f = buf->f; + Files_Create(f); + if (buf->org != f->pos) { + error = Platform_Seek(f->fd, buf->org, Platform_SeekSet); + } + error = Platform_Write(f->fd, (LONGINT)(uintptr_t)buf->data, buf->size); + if (error != 0) { + Files_Err((CHAR*)"error writing file", (LONGINT)19, f, error); + } + f->pos = buf->org + buf->size; + buf->chg = 0; + error = Platform_Identify(f->fd, &f->identity, Platform_FileIdentity__typ); + if (error != 0) { + Files_Err((CHAR*)"error identifying file", (LONGINT)23, f, error); + } + } +} + +void Files_Close (Files_File f) +{ + LONGINT i; + INTEGER error; + if (f->state != 1 || f->registerName[0] != 0x00) { + Files_Create(f); + i = 0; + while ((i < 4 && f->bufs[i] != NIL)) { + Files_Flush(f->bufs[i]); + i += 1; + } + error = Platform_Sync(f->fd); + if (error != 0) { + Files_Err((CHAR*)"error writing file", (LONGINT)19, f, error); + } + Files_fileTab[f->fd] = 0; + error = Platform_Close(f->fd); + f->fd = -1; + f->state = 1; + Heap_FileCount -= 1; + } +} + +LONGINT Files_Length (Files_File f) +{ + LONGINT _o_result; + _o_result = f->len; + return _o_result; +} + +Files_File Files_New (CHAR *name, LONGINT name__len) +{ + Files_File _o_result; + Files_File f = NIL; + __DUP(name, name__len, CHAR); + __NEW(f, Files_Handle); + f->workName[0] = 0x00; + __COPY(name, f->registerName, ((LONGINT)(101))); + f->fd = -1; + f->state = 1; + f->len = 0; + f->pos = 0; + f->swapper = -1; + _o_result = f; + __DEL(name); + return _o_result; +} + +static void Files_ScanPath (INTEGER *pos, CHAR *dir, LONGINT dir__len) +{ + INTEGER i; + CHAR ch; + i = 0; + if (Files_SearchPath == NIL) { + if (*pos == 0) { + dir[0] = '.'; + i = 1; + *pos += 1; + } + } else { + ch = (Files_SearchPath->data)[*pos]; + while (ch == ' ' || ch == ';') { + *pos += 1; + ch = (Files_SearchPath->data)[*pos]; + } + if (ch == '~') { + *pos += 1; + ch = (Files_SearchPath->data)[*pos]; + while (Files_HOME[i] != 0x00) { + dir[i] = Files_HOME[i]; + i += 1; + } + if ((((((ch != '/' && ch != 0x00)) && ch != ';')) && ch != ' ')) { + while ((i > 0 && dir[i - 1] != '/')) { + i -= 1; + } + } + } + while ((ch != 0x00 && ch != ';')) { + dir[i] = ch; + i += 1; + *pos += 1; + ch = (Files_SearchPath->data)[*pos]; + } + while ((i > 0 && dir[i - 1] == ' ')) { + i -= 1; + } + } + dir[i] = 0x00; +} + +static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len) +{ + BOOLEAN _o_result; + INTEGER i; + CHAR ch; + i = 0; + ch = name[0]; + while ((ch != 0x00 && ch != '/')) { + i += 1; + ch = name[i]; + } + _o_result = ch == '/'; + return _o_result; +} + +static Files_File Files_CacheEntry (Platform_FileIdentity identity) +{ + Files_File _o_result; + Files_File f = NIL; + INTEGER i, error; + i = 0; + while (i < 256) { + f = (Files_File)(uintptr_t)Files_fileTab[i]; + if ((f != NIL && Platform_SameFile(identity, f->identity))) { + if (!Platform_SameFileTime(identity, f->identity)) { + i = 0; + while (i < 4) { + if (f->bufs[i] != NIL) { + f->bufs[i]->org = -1; + f->bufs[i] = NIL; + } + i += 1; + } + f->swapper = -1; + f->identity = identity; + error = Platform_Size(f->fd, &f->len); + } + _o_result = f; + return _o_result; + } + i += 1; + } + _o_result = NIL; + return _o_result; +} + +Files_File Files_Old (CHAR *name, LONGINT name__len) +{ + Files_File _o_result; + Files_File f = NIL; + LONGINT fd; + INTEGER pos; + BOOLEAN done; + CHAR dir[256], path[256]; + INTEGER error; + Platform_FileIdentity identity; + __DUP(name, name__len, CHAR); + if (name[0] != 0x00) { + if (Files_HasDir((void*)name, name__len)) { + dir[0] = 0x00; + __COPY(name, path, ((LONGINT)(256))); + } else { + pos = 0; + Files_ScanPath(&pos, (void*)dir, ((LONGINT)(256))); + Files_MakeFileName(dir, ((LONGINT)(256)), name, name__len, (void*)path, ((LONGINT)(256))); + Files_ScanPath(&pos, (void*)dir, ((LONGINT)(256))); + } + for (;;) { + error = Platform_OldRW((void*)path, ((LONGINT)(256)), &fd); + done = error == 0; + if ((!done && Platform_TooManyFiles(error)) || (done && fd >= 256)) { + if ((done && fd >= 256)) { + error = Platform_Close(fd); + } + Heap_GC(1); + error = Platform_OldRW((void*)path, ((LONGINT)(256)), &fd); + done = error == 0; + if ((!done && Platform_TooManyFiles(error))) { + Files_Err((CHAR*)"too many files open", (LONGINT)20, f, error); + } + } + if ((!done && Platform_Inaccessible(error))) { + error = Platform_OldRO((void*)path, ((LONGINT)(256)), &fd); + done = error == 0; + } + if ((!done && !Platform_Absent(error))) { + Console_String((CHAR*)"Warning: Files.Old ", (LONGINT)20); + Console_String(name, name__len); + Console_String((CHAR*)" error = ", (LONGINT)10); + Console_Int(error, ((LONGINT)(0))); + Console_Ln(); + } + if (done) { + error = Platform_Identify(fd, &identity, Platform_FileIdentity__typ); + f = Files_CacheEntry(identity); + if (f != NIL) { + error = Platform_Close(fd); + _o_result = f; + __DEL(name); + return _o_result; + } else if (fd >= 256) { + error = Platform_Close(fd); + Files_Err((CHAR*)"too many files open", (LONGINT)20, f, 0); + } else { + __NEW(f, Files_Handle); + Files_fileTab[fd] = (LONGINT)(uintptr_t)f; + Heap_FileCount += 1; + Heap_RegisterFinalizer((void*)f, Files_Finalize); + f->fd = fd; + f->state = 0; + f->pos = 0; + f->swapper = -1; + error = Platform_Size(fd, &f->len); + __COPY(name, f->workName, ((LONGINT)(101))); + f->registerName[0] = 0x00; + f->tempFile = 0; + f->identity = identity; + _o_result = f; + __DEL(name); + return _o_result; + } + } else if (dir[0] == 0x00) { + _o_result = NIL; + __DEL(name); + return _o_result; + } else { + Files_MakeFileName(dir, ((LONGINT)(256)), name, name__len, (void*)path, ((LONGINT)(256))); + Files_ScanPath(&pos, (void*)dir, ((LONGINT)(256))); + } + } + } else { + _o_result = NIL; + __DEL(name); + return _o_result; + } + __RETCHK; +} + +void Files_Purge (Files_File f) +{ + INTEGER i; + Platform_FileIdentity identity; + INTEGER error; + i = 0; + while (i < 4) { + if (f->bufs[i] != NIL) { + f->bufs[i]->org = -1; + f->bufs[i] = NIL; + } + i += 1; + } + if (f->fd != -1) { + error = Platform_Truncate(f->fd, ((LONGINT)(0))); + error = Platform_Seek(f->fd, ((LONGINT)(0)), Platform_SeekSet); + } + f->pos = 0; + f->len = 0; + f->swapper = -1; + error = Platform_Identify(f->fd, &identity, Platform_FileIdentity__typ); + Platform_SetMTime(&f->identity, Platform_FileIdentity__typ, identity); +} + +void Files_GetDate (Files_File f, LONGINT *t, LONGINT *d) +{ + Platform_FileIdentity identity; + INTEGER error; + Files_Create(f); + error = Platform_Identify(f->fd, &identity, Platform_FileIdentity__typ); + Platform_MTimeAsClock(identity, &*t, &*d); +} + +LONGINT Files_Pos (Files_Rider *r, LONGINT *r__typ) +{ + LONGINT _o_result; + _o_result = (*r).org + (*r).offset; + return _o_result; +} + +void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, LONGINT pos) +{ + LONGINT org, offset, i, n; + Files_Buffer buf = NIL; + INTEGER error; + if (f != NIL) { + if (pos > f->len) { + pos = f->len; + } else if (pos < 0) { + pos = 0; + } + offset = __MASK(pos, -4096); + org = pos - offset; + i = 0; + while ((((i < 4 && f->bufs[i] != NIL)) && org != f->bufs[i]->org)) { + i += 1; + } + if (i < 4) { + if (f->bufs[i] == NIL) { + __NEW(buf, Files_BufDesc); + buf->chg = 0; + buf->org = -1; + buf->f = f; + f->bufs[i] = buf; + } else { + buf = f->bufs[i]; + } + } else { + f->swapper = __MASK(f->swapper + 1, -4); + buf = f->bufs[f->swapper]; + Files_Flush(buf); + } + if (buf->org != org) { + if (org == f->len) { + buf->size = 0; + } else { + Files_Create(f); + if (f->pos != org) { + error = Platform_Seek(f->fd, org, Platform_SeekSet); + } + error = Platform_ReadBuf(f->fd, (void*)buf->data, ((LONGINT)(4096)), &n); + if (error != 0) { + Files_Err((CHAR*)"read from file not done", (LONGINT)24, f, error); + } + f->pos = org + n; + buf->size = n; + } + buf->org = org; + buf->chg = 0; + } + } else { + buf = NIL; + org = 0; + offset = 0; + } + (*r).buf = buf; + (*r).org = org; + (*r).offset = offset; + (*r).eof = 0; + (*r).res = 0; +} + +void Files_Read (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x) +{ + LONGINT offset; + Files_Buffer buf = NIL; + buf = (*r).buf; + offset = (*r).offset; + if ((*r).org != buf->org) { + Files_Set(&*r, r__typ, buf->f, (*r).org + offset); + buf = (*r).buf; + offset = (*r).offset; + } + if (offset < buf->size) { + *x = buf->data[offset]; + (*r).offset = offset + 1; + } else if ((*r).org + offset < buf->f->len) { + Files_Set(&*r, r__typ, (*r).buf->f, (*r).org + offset); + *x = (*r).buf->data[0]; + (*r).offset = 1; + } else { + *x = 0x00; + (*r).eof = 1; + } +} + +void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, LONGINT n) +{ + LONGINT xpos, min, restInBuf, offset; + Files_Buffer buf = NIL; + if (n > x__len) { + Files_IdxTrap(); + } + xpos = 0; + buf = (*r).buf; + offset = (*r).offset; + while (n > 0) { + if ((*r).org != buf->org || offset >= 4096) { + Files_Set(&*r, r__typ, buf->f, (*r).org + offset); + buf = (*r).buf; + offset = (*r).offset; + } + restInBuf = buf->size - offset; + if (restInBuf == 0) { + (*r).res = n; + (*r).eof = 1; + return; + } else if (n > restInBuf) { + min = restInBuf; + } else { + min = n; + } + __MOVE((LONGINT)(uintptr_t)buf->data + offset, (LONGINT)(uintptr_t)x + xpos, min); + offset += min; + (*r).offset = offset; + xpos += min; + n -= min; + } + (*r).res = 0; + (*r).eof = 0; +} + +void Files_ReadByte (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len) +{ + Files_ReadBytes(&*r, r__typ, (void*)x, x__len * ((LONGINT)(1)), ((LONGINT)(1))); +} + +Files_File Files_Base (Files_Rider *r, LONGINT *r__typ) +{ + Files_File _o_result; + _o_result = (*r).buf->f; + return _o_result; +} + +void Files_Write (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE x) +{ + Files_Buffer buf = NIL; + LONGINT offset; + buf = (*r).buf; + offset = (*r).offset; + if ((*r).org != buf->org || offset >= 4096) { + Files_Set(&*r, r__typ, buf->f, (*r).org + offset); + buf = (*r).buf; + offset = (*r).offset; + } + buf->data[offset] = x; + buf->chg = 1; + if (offset == buf->size) { + buf->size += 1; + buf->f->len += 1; + } + (*r).offset = offset + 1; + (*r).res = 0; +} + +void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, LONGINT n) +{ + LONGINT xpos, min, restInBuf, offset; + Files_Buffer buf = NIL; + if (n > x__len) { + Files_IdxTrap(); + } + xpos = 0; + buf = (*r).buf; + offset = (*r).offset; + while (n > 0) { + if ((*r).org != buf->org || offset >= 4096) { + Files_Set(&*r, r__typ, buf->f, (*r).org + offset); + buf = (*r).buf; + offset = (*r).offset; + } + restInBuf = 4096 - offset; + if (n > restInBuf) { + min = restInBuf; + } else { + min = n; + } + __MOVE((LONGINT)(uintptr_t)x + xpos, (LONGINT)(uintptr_t)buf->data + offset, min); + offset += min; + (*r).offset = offset; + if (offset > buf->size) { + buf->f->len += offset - buf->size; + buf->size = offset; + } + xpos += min; + n -= min; + buf->chg = 1; + } + (*r).res = 0; +} + +void Files_Delete (CHAR *name, LONGINT name__len, INTEGER *res) +{ + __DUP(name, name__len, CHAR); + *res = Platform_Unlink((void*)name, name__len); + __DEL(name); +} + +void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INTEGER *res) +{ + LONGINT fdold, fdnew, n; + INTEGER error, ignore; + Platform_FileIdentity oldidentity, newidentity; + CHAR buf[4096]; + __DUP(old, old__len, CHAR); + __DUP(new, new__len, CHAR); + error = Platform_IdentifyByName(old, old__len, &oldidentity, Platform_FileIdentity__typ); + if (error == 0) { + error = Platform_IdentifyByName(new, new__len, &newidentity, Platform_FileIdentity__typ); + if ((error != 0 && !Platform_SameFile(oldidentity, newidentity))) { + Files_Delete(new, new__len, &error); + } + error = Platform_Rename((void*)old, old__len, (void*)new, new__len); + if (!Platform_DifferentFilesystems(error)) { + *res = error; + return; + } else { + error = Platform_OldRO((void*)old, old__len, &fdold); + if (error != 0) { + *res = 2; + return; + } + error = Platform_New((void*)new, new__len, &fdnew); + if (error != 0) { + error = Platform_Close(fdold); + *res = 3; + return; + } + error = Platform_Read(fdold, (LONGINT)(uintptr_t)buf, ((LONGINT)(4096)), &n); + while (n > 0) { + error = Platform_Write(fdnew, (LONGINT)(uintptr_t)buf, n); + if (error != 0) { + ignore = Platform_Close(fdold); + ignore = Platform_Close(fdnew); + Files_Err((CHAR*)"cannot move file", (LONGINT)17, NIL, error); + } + error = Platform_Read(fdold, (LONGINT)(uintptr_t)buf, ((LONGINT)(4096)), &n); + } + ignore = Platform_Close(fdold); + ignore = Platform_Close(fdnew); + if (n == 0) { + error = Platform_Unlink((void*)old, old__len); + *res = 0; + } else { + Files_Err((CHAR*)"cannot move file", (LONGINT)17, NIL, error); + } + } + } else { + *res = 2; + } + __DEL(old); + __DEL(new); +} + +void Files_Register (Files_File f) +{ + INTEGER idx, errcode; + Files_File f1 = NIL; + CHAR file[104]; + if ((f->state == 1 && f->registerName[0] != 0x00)) { + f->state = 2; + } + Files_Close(f); + if (f->registerName[0] != 0x00) { + Files_Rename(f->workName, ((LONGINT)(101)), f->registerName, ((LONGINT)(101)), &errcode); + if (errcode != 0) { + __COPY(f->registerName, file, ((LONGINT)(104))); + __HALT(99); + } + __COPY(f->registerName, f->workName, ((LONGINT)(101))); + f->registerName[0] = 0x00; + f->tempFile = 0; + } +} + +void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INTEGER *res) +{ + __DUP(path, path__len, CHAR); + *res = Platform_Chdir((void*)path, path__len); + __DEL(path); +} + +static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *dest, LONGINT dest__len) +{ + LONGINT i, j; + if (!Platform_LittleEndian) { + i = src__len; + j = 0; + while (i > 0) { + i -= 1; + dest[j] = src[i]; + j += 1; + } + } else { + __MOVE((LONGINT)(uintptr_t)src, (LONGINT)(uintptr_t)dest, src__len); + } +} + +void Files_ReadBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN *x) +{ + Files_Read(&*R, R__typ, (CHAR*)(void*)&*x); +} + +void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, INTEGER *x) +{ + CHAR b[2]; + Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(2)), ((LONGINT)(2))); + *x = (int)b[0] + __ASHL((int)b[1], 8); +} + +void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, LONGINT *x) +{ + CHAR b[4]; + Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); + *x = (((int)b[0] + __ASHL((int)b[1], 8)) + __ASHL((int)b[2], 16)) + __ASHL((int)b[3], 24); +} + +void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x) +{ + CHAR b[4]; + Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); + *x = (SET)((((int)b[0] + __ASHL((int)b[1], 8)) + __ASHL((int)b[2], 16)) + __ASHL((int)b[3], 24)); +} + +void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x) +{ + CHAR b[4]; + Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); + Files_FlipBytes((void*)b, ((LONGINT)(4)), (void*)&*x, ((LONGINT)(4))); +} + +void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x) +{ + CHAR b[8]; + Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(8)), ((LONGINT)(8))); + Files_FlipBytes((void*)b, ((LONGINT)(8)), (void*)&*x, ((LONGINT)(8))); +} + +void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) +{ + INTEGER i; + CHAR ch; + i = 0; + do { + Files_Read(&*R, R__typ, (void*)&ch); + x[i] = ch; + i += 1; + } while (!(ch == 0x00)); +} + +void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) +{ + INTEGER i; + CHAR ch; + BOOLEAN b; + i = 0; + b = 0; + do { + Files_Read(&*R, R__typ, (void*)&ch); + if ((ch == 0x00 || ch == 0x0a) || ch == 0x0d) { + b = 1; + } else { + x[i] = ch; + i += 1; + } + } while (!b); +} + +void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, LONGINT *x) +{ + SHORTINT s; + CHAR ch; + LONGINT n; + s = 0; + n = 0; + Files_Read(&*R, R__typ, (void*)&ch); + while ((int)ch >= 128) { + n += __ASH((LONGINT)((int)ch - 128), s); + s += 7; + Files_Read(&*R, R__typ, (void*)&ch); + } + n += __ASH((LONGINT)(__MASK((int)ch, -64) - __ASHL(__ASHR((int)ch, 6), 6)), s); + *x = n; +} + +void Files_WriteBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN x) +{ + Files_Write(&*R, R__typ, __VAL(CHAR, x)); +} + +void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, INTEGER x) +{ + CHAR b[2]; + b[0] = (CHAR)x; + b[1] = (CHAR)__ASHR(x, 8); + Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(2)), ((LONGINT)(2))); +} + +void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, LONGINT x) +{ + CHAR b[4]; + b[0] = (CHAR)x; + b[1] = (CHAR)__ASHR(x, 8); + b[2] = (CHAR)__ASHR(x, 16); + b[3] = (CHAR)__ASHR(x, 24); + Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); +} + +void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x) +{ + CHAR b[4]; + LONGINT i; + i = (LONGINT)x; + b[0] = (CHAR)i; + b[1] = (CHAR)__ASHR(i, 8); + b[2] = (CHAR)__ASHR(i, 16); + b[3] = (CHAR)__ASHR(i, 24); + Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); +} + +void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x) +{ + CHAR b[4]; + Files_FlipBytes((void*)&x, ((LONGINT)(4)), (void*)b, ((LONGINT)(4))); + Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); +} + +void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x) +{ + CHAR b[8]; + Files_FlipBytes((void*)&x, ((LONGINT)(8)), (void*)b, ((LONGINT)(8))); + Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(8)), ((LONGINT)(8))); +} + +void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) +{ + INTEGER i; + i = 0; + while (x[i] != 0x00) { + i += 1; + } + Files_WriteBytes(&*R, R__typ, (void*)x, x__len * ((LONGINT)(1)), i + 1); +} + +void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, LONGINT x) +{ + while (x < -64 || x > 63) { + Files_Write(&*R, R__typ, (CHAR)(__MASK(x, -128) + 128)); + x = __ASHR(x, 7); + } + Files_Write(&*R, R__typ, (CHAR)__MASK(x, -128)); +} + +void Files_GetName (Files_File f, CHAR *name, LONGINT name__len) +{ + __COPY(f->workName, name, name__len); +} + +static void Files_Finalize (SYSTEM_PTR o) +{ + Files_File f = NIL; + LONGINT res; + f = (Files_File)(uintptr_t)o; + if (f->fd >= 0) { + Files_fileTab[f->fd] = 0; + res = Platform_Close(f->fd); + f->fd = -1; + Heap_FileCount -= 1; + if (f->tempFile) { + res = Platform_Unlink((void*)f->workName, ((LONGINT)(101))); + } + } +} + +void Files_SetSearchPath (CHAR *path, LONGINT path__len) +{ + __DUP(path, path__len, CHAR); + if (Strings_Length(path, path__len) != 0) { + Files_SearchPath = __NEWARR(NIL, ((LONGINT)(1)), 1, 1, 1, (LONGINT)(Strings_Length(path, path__len) + 1)); + __COPY(path, Files_SearchPath->data, Files_SearchPath->len[0]); + } else { + Files_SearchPath = NIL; + } + __DEL(path); +} + +static void Files_Init (void) +{ + LONGINT i; + i = 0; + while (i < 256) { + Files_fileTab[i] = 0; + i += 1; + } + Files_tempno = -1; + Heap_FileCount = 0; + Files_SearchPath = NIL; + Files_HOME[0] = 0x00; + Platform_GetEnv((CHAR*)"HOME", (LONGINT)5, (void*)Files_HOME, ((LONGINT)(1024))); +} + +static void EnumPtrs(void (*P)(void*)) +{ + P(Files_SearchPath); +} + +__TDESC(Files_Handle, 1, 4) = {__TDFLDS("Handle", 296), {256, 264, 272, 280, -40}}; +__TDESC(Files_BufDesc, 1, 1) = {__TDFLDS("BufDesc", 4128), {0, -16}}; +__TDESC(Files_Rider, 1, 1) = {__TDFLDS("Rider", 40), {16, -16}}; + +export void *Files__init(void) +{ + __DEFMOD; + __MODULE_IMPORT(Configuration); + __MODULE_IMPORT(Console); + __MODULE_IMPORT(Heap); + __MODULE_IMPORT(Platform); + __MODULE_IMPORT(Strings); + __REGMOD("Files", EnumPtrs); + __INITYP(Files_Handle, Files_Handle, 0); + __INITYP(Files_BufDesc, Files_BufDesc, 0); + __INITYP(Files_Rider, Files_Rider, 0); +/* BEGIN */ + Files_Init(); + __ENDMOD; +} diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h new file mode 100644 index 00000000..01c37212 --- /dev/null +++ b/bootstrap/unix-88/Files.h @@ -0,0 +1,71 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin tspkaSfF */ + +#ifndef Files__h +#define Files__h + +#define LARGE +#include "SYSTEM.h" + +typedef + struct Files_Handle *Files_File; + +typedef + struct Files_Handle { + char _prvt0[232]; + LONGINT fd; + char _prvt1[56]; + } Files_Handle; + +typedef + struct Files_Rider { + LONGINT res; + BOOLEAN eof; + char _prvt0[31]; + } Files_Rider; + + + +import LONGINT *Files_Handle__typ; +import LONGINT *Files_Rider__typ; + +import Files_File Files_Base (Files_Rider *r, LONGINT *r__typ); +import void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INTEGER *res); +import void Files_Close (Files_File f); +import void Files_Delete (CHAR *name, LONGINT name__len, INTEGER *res); +import void Files_GetDate (Files_File f, LONGINT *t, LONGINT *d); +import void Files_GetName (Files_File f, CHAR *name, LONGINT name__len); +import LONGINT Files_Length (Files_File f); +import Files_File Files_New (CHAR *name, LONGINT name__len); +import Files_File Files_Old (CHAR *name, LONGINT name__len); +import LONGINT Files_Pos (Files_Rider *r, LONGINT *r__typ); +import void Files_Purge (Files_File f); +import void Files_Read (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x); +import void Files_ReadBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN *x); +import void Files_ReadByte (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len); +import void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, LONGINT n); +import void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, INTEGER *x); +import void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, LONGINT *x); +import void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x); +import void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); +import void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, LONGINT *x); +import void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x); +import void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x); +import void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); +import void Files_Register (Files_File f); +import void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INTEGER *res); +import void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, LONGINT pos); +import void Files_SetSearchPath (CHAR *path, LONGINT path__len); +import void Files_Write (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE x); +import void Files_WriteBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN x); +import void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, LONGINT n); +import void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, INTEGER x); +import void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, LONGINT x); +import void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x); +import void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, LONGINT x); +import void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x); +import void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x); +import void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); +import void *Files__init(void); + + +#endif diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c new file mode 100644 index 00000000..929a8283 --- /dev/null +++ b/bootstrap/unix-88/Heap.c @@ -0,0 +1,753 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin tskSfF */ +#define LARGE +#include "SYSTEM.h" + +struct Heap__1 { + CHAR ch; + SYSTEM_PTR p; +}; + +typedef + struct Heap_CmdDesc *Heap_Cmd; + +typedef + CHAR Heap_CmdName[24]; + +typedef + void (*Heap_Command)(void); + +typedef + struct Heap_CmdDesc { + Heap_Cmd next; + Heap_CmdName name; + Heap_Command cmd; + } Heap_CmdDesc; + +typedef + void (*Heap_EnumProc)(void(*)(SYSTEM_PTR)); + +typedef + struct Heap_FinDesc *Heap_FinNode; + +typedef + void (*Heap_Finalizer)(SYSTEM_PTR); + +typedef + struct Heap_FinDesc { + Heap_FinNode next; + LONGINT obj; + BOOLEAN marked; + Heap_Finalizer finalize; + } Heap_FinDesc; + +typedef + struct Heap_ModuleDesc *Heap_Module; + +typedef + CHAR Heap_ModuleName[20]; + +typedef + struct Heap_ModuleDesc { + Heap_Module next; + Heap_ModuleName name; + LONGINT refcnt; + Heap_Cmd cmds; + LONGINT types; + Heap_EnumProc enumPtrs; + LONGINT reserved1, reserved2; + } Heap_ModuleDesc; + + +export SYSTEM_PTR Heap_modules; +static LONGINT Heap_freeList[10]; +static LONGINT Heap_bigBlocks; +export LONGINT Heap_allocated; +static BOOLEAN Heap_firstTry; +static LONGINT Heap_heap, Heap_heapend; +export LONGINT Heap_heapsize; +static Heap_FinNode Heap_fin; +static INTEGER Heap_lockdepth; +static BOOLEAN Heap_interrupted; +export INTEGER Heap_FileCount; + +export LONGINT *Heap_ModuleDesc__typ; +export LONGINT *Heap_CmdDesc__typ; +export LONGINT *Heap_FinDesc__typ; +export LONGINT *Heap__1__typ; + +static void Heap_CheckFin (void); +static void Heap_ExtendHeap (LONGINT blksz); +export void Heap_FINALL (void); +static void Heap_Finalize (void); +export void Heap_GC (BOOLEAN markStack); +static void Heap_HeapSort (LONGINT n, LONGINT *a, LONGINT a__len); +export void Heap_INCREF (Heap_Module m); +export void Heap_InitHeap (void); +export void Heap_Lock (void); +static void Heap_Mark (LONGINT q); +static void Heap_MarkCandidates (LONGINT n, LONGINT *cand, LONGINT cand__len); +static void Heap_MarkP (SYSTEM_PTR p); +static void Heap_MarkStack (LONGINT n, LONGINT *cand, LONGINT cand__len); +export SYSTEM_PTR Heap_NEWBLK (LONGINT size); +export SYSTEM_PTR Heap_NEWREC (LONGINT tag); +static LONGINT Heap_NewChunk (LONGINT blksz); +export void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); +export SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); +export void Heap_REGTYP (Heap_Module m, LONGINT typ); +export void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); +static void Heap_Scan (void); +static void Heap_Sift (LONGINT l, LONGINT r, LONGINT *a, LONGINT a__len); +export void Heap_Unlock (void); + +extern void *Heap__init(); +extern LONGINT Platform_MainStackFrame; +extern LONGINT Platform_OSAllocate(LONGINT size); +#define Heap_FetchAddress(pointer) (LONGINT)(uintptr_t)(*((void**)((uintptr_t)pointer))) +#define Heap_HeapModuleInit() Heap__init() +#define Heap_OSAllocate(size) Platform_OSAllocate(size) +#define Heap_PlatformHalt(code) Platform_Halt(code) +#define Heap_PlatformMainStackFrame() Platform_MainStackFrame + +void Heap_Lock (void) +{ + Heap_lockdepth += 1; +} + +void Heap_Unlock (void) +{ + Heap_lockdepth -= 1; + if ((Heap_interrupted && Heap_lockdepth == 0)) { + Heap_PlatformHalt(((LONGINT)(-9))); + } +} + +SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) +{ + SYSTEM_PTR _o_result; + Heap_Module m; + if (__STRCMP(name, "Heap") == 0) { + __SYSNEW(m, 80); + } else { + __NEW(m, Heap_ModuleDesc); + } + m->types = 0; + m->cmds = NIL; + __COPY(name, m->name, ((LONGINT)(20))); + m->refcnt = 0; + m->enumPtrs = enumPtrs; + m->next = (Heap_Module)(uintptr_t)Heap_modules; + Heap_modules = (SYSTEM_PTR)m; + _o_result = (void*)m; + return _o_result; +} + +void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) +{ + Heap_Cmd c; + if (__STRCMP(m->name, "Heap") == 0) { + __SYSNEW(c, 40); + } else { + __NEW(c, Heap_CmdDesc); + } + __COPY(name, c->name, ((LONGINT)(24))); + c->cmd = cmd; + c->next = m->cmds; + m->cmds = c; +} + +void Heap_REGTYP (Heap_Module m, LONGINT typ) +{ + __PUT(typ, m->types, LONGINT); + m->types = typ; +} + +void Heap_INCREF (Heap_Module m) +{ + m->refcnt += 1; +} + +static LONGINT Heap_NewChunk (LONGINT blksz) +{ + LONGINT _o_result; + LONGINT chnk; + chnk = Heap_OSAllocate(blksz + 24); + if (chnk != 0) { + __PUT(chnk + 8, chnk + (24 + blksz), LONGINT); + __PUT(chnk + 24, chnk + 32, LONGINT); + __PUT(chnk + 32, blksz, LONGINT); + __PUT(chnk + 40, -8, LONGINT); + __PUT(chnk + 48, Heap_bigBlocks, LONGINT); + Heap_bigBlocks = chnk + 24; + Heap_heapsize += blksz; + } + _o_result = chnk; + return _o_result; +} + +static void Heap_ExtendHeap (LONGINT blksz) +{ + LONGINT size, chnk, j, next; + if (blksz > 320000) { + size = blksz; + } else { + size = 320000; + } + chnk = Heap_NewChunk(size); + if (chnk != 0) { + if (chnk < Heap_heap) { + __PUT(chnk, Heap_heap, LONGINT); + Heap_heap = chnk; + } else { + j = Heap_heap; + next = Heap_FetchAddress(j); + while ((next != 0 && chnk > next)) { + j = next; + next = Heap_FetchAddress(j); + } + __PUT(chnk, next, LONGINT); + __PUT(j, chnk, LONGINT); + } + if (next == 0) { + Heap_heapend = Heap_FetchAddress(chnk + 8); + } + } +} + +SYSTEM_PTR Heap_NEWREC (LONGINT tag) +{ + SYSTEM_PTR _o_result; + LONGINT i, i0, di, blksz, restsize, t, adr, end, next, prev; + SYSTEM_PTR new; + Heap_Lock(); + blksz = Heap_FetchAddress(tag); + i0 = __ASHR(blksz, 5); + i = i0; + if (i < 9) { + adr = Heap_freeList[i]; + while (adr == 0) { + i += 1; + adr = Heap_freeList[i]; + } + } + if (i < 9) { + next = Heap_FetchAddress(adr + 24); + Heap_freeList[i] = next; + if (i != i0) { + di = i - i0; + restsize = __ASHL(di, 5); + end = adr + restsize; + __PUT(end + 8, blksz, LONGINT); + __PUT(end + 16, -8, LONGINT); + __PUT(end, end + 8, LONGINT); + __PUT(adr + 8, restsize, LONGINT); + __PUT(adr + 24, Heap_freeList[di], LONGINT); + Heap_freeList[di] = adr; + adr += restsize; + } + } else { + adr = Heap_bigBlocks; + prev = 0; + for (;;) { + if (adr == 0) { + if (Heap_firstTry) { + Heap_GC(1); + blksz += 32; + if (__ASHL((Heap_heapsize - Heap_allocated) - blksz, 2) < Heap_heapsize) { + Heap_ExtendHeap(__ASHL(__DIV(Heap_allocated + blksz, 96), 7) - Heap_heapsize); + } + Heap_firstTry = 0; + new = Heap_NEWREC(tag); + Heap_firstTry = 1; + if (new == NIL) { + Heap_ExtendHeap(__ASHL(__DIV(Heap_allocated + blksz, 96), 7) - Heap_heapsize); + new = Heap_NEWREC(tag); + } + Heap_Unlock(); + _o_result = new; + return _o_result; + } else { + Heap_Unlock(); + _o_result = NIL; + return _o_result; + } + } + t = Heap_FetchAddress(adr + 8); + if (t >= blksz) { + break; + } + prev = adr; + adr = Heap_FetchAddress(adr + 24); + } + restsize = t - blksz; + end = adr + restsize; + __PUT(end + 8, blksz, LONGINT); + __PUT(end + 16, -8, LONGINT); + __PUT(end, end + 8, LONGINT); + if (restsize > 288) { + __PUT(adr + 8, restsize, LONGINT); + } else { + next = Heap_FetchAddress(adr + 24); + if (prev == 0) { + Heap_bigBlocks = next; + } else { + __PUT(prev + 24, next, LONGINT); + } + if (restsize > 0) { + di = __ASHR(restsize, 5); + __PUT(adr + 8, restsize, LONGINT); + __PUT(adr + 24, Heap_freeList[di], LONGINT); + Heap_freeList[di] = adr; + } + } + adr += restsize; + } + i = adr + 32; + end = adr + blksz; + while (i < end) { + __PUT(i, 0, LONGINT); + __PUT(i + 8, 0, LONGINT); + __PUT(i + 16, 0, LONGINT); + __PUT(i + 24, 0, LONGINT); + i += 32; + } + __PUT(adr + 24, 0, LONGINT); + __PUT(adr, tag, LONGINT); + __PUT(adr + 8, 0, LONGINT); + __PUT(adr + 16, 0, LONGINT); + Heap_allocated += blksz; + Heap_Unlock(); + _o_result = (SYSTEM_PTR)(uintptr_t)(adr + 8); + return _o_result; +} + +SYSTEM_PTR Heap_NEWBLK (LONGINT size) +{ + SYSTEM_PTR _o_result; + LONGINT blksz, tag; + SYSTEM_PTR new; + Heap_Lock(); + blksz = __ASHL(__ASHR(size + 63, 5), 5); + new = Heap_NEWREC((LONGINT)(uintptr_t)&blksz); + tag = ((LONGINT)(uintptr_t)new + blksz) - 24; + __PUT(tag - 8, 0, LONGINT); + __PUT(tag, blksz, LONGINT); + __PUT(tag + 8, -8, LONGINT); + __PUT((LONGINT)(uintptr_t)new - 8, tag, LONGINT); + Heap_Unlock(); + _o_result = new; + return _o_result; +} + +static void Heap_Mark (LONGINT q) +{ + LONGINT p, tag, fld, n, offset, tagbits; + if (q != 0) { + tagbits = Heap_FetchAddress(q - 8); + if (!__ODD(tagbits)) { + __PUT(q - 8, tagbits + 1, LONGINT); + p = 0; + tag = tagbits + 8; + for (;;) { + __GET(tag, offset, LONGINT); + if (offset < 0) { + __PUT(q - 8, (tag + offset) + 1, LONGINT); + if (p == 0) { + break; + } + n = q; + q = p; + tag = Heap_FetchAddress(q - 8); + tag -= 1; + __GET(tag, offset, LONGINT); + fld = q + offset; + p = Heap_FetchAddress(fld); + __PUT(fld, (SYSTEM_PTR)(uintptr_t)n, SYSTEM_PTR); + } else { + fld = q + offset; + n = Heap_FetchAddress(fld); + if (n != 0) { + tagbits = Heap_FetchAddress(n - 8); + if (!__ODD(tagbits)) { + __PUT(n - 8, tagbits + 1, LONGINT); + __PUT(q - 8, tag + 1, LONGINT); + __PUT(fld, (SYSTEM_PTR)(uintptr_t)p, SYSTEM_PTR); + p = q; + q = n; + tag = tagbits; + } + } + } + tag += 8; + } + } + } +} + +static void Heap_MarkP (SYSTEM_PTR p) +{ + Heap_Mark((LONGINT)(uintptr_t)p); +} + +static void Heap_Scan (void) +{ + LONGINT chnk, adr, end, start, tag, i, size, freesize; + Heap_bigBlocks = 0; + i = 1; + while (i < 9) { + Heap_freeList[i] = 0; + i += 1; + } + freesize = 0; + Heap_allocated = 0; + chnk = Heap_heap; + while (chnk != 0) { + adr = chnk + 24; + end = Heap_FetchAddress(chnk + 8); + while (adr < end) { + tag = Heap_FetchAddress(adr); + if (__ODD(tag)) { + if (freesize > 0) { + start = adr - freesize; + __PUT(start, start + 8, LONGINT); + __PUT(start + 8, freesize, LONGINT); + __PUT(start + 16, -8, LONGINT); + i = __ASHR(freesize, 5); + freesize = 0; + if (i < 9) { + __PUT(start + 24, Heap_freeList[i], LONGINT); + Heap_freeList[i] = start; + } else { + __PUT(start + 24, Heap_bigBlocks, LONGINT); + Heap_bigBlocks = start; + } + } + tag -= 1; + __PUT(adr, tag, LONGINT); + size = Heap_FetchAddress(tag); + Heap_allocated += size; + adr += size; + } else { + size = Heap_FetchAddress(tag); + freesize += size; + adr += size; + } + } + if (freesize > 0) { + start = adr - freesize; + __PUT(start, start + 8, LONGINT); + __PUT(start + 8, freesize, LONGINT); + __PUT(start + 16, -8, LONGINT); + i = __ASHR(freesize, 5); + freesize = 0; + if (i < 9) { + __PUT(start + 24, Heap_freeList[i], LONGINT); + Heap_freeList[i] = start; + } else { + __PUT(start + 24, Heap_bigBlocks, LONGINT); + Heap_bigBlocks = start; + } + } + chnk = Heap_FetchAddress(chnk); + } +} + +static void Heap_Sift (LONGINT l, LONGINT r, LONGINT *a, LONGINT a__len) +{ + LONGINT i, j, x; + j = l; + x = a[j]; + for (;;) { + i = j; + j = __ASHL(j, 1) + 1; + if ((j < r && a[j] < a[j + 1])) { + j += 1; + } + if (j > r || a[j] <= x) { + break; + } + a[i] = a[j]; + } + a[i] = x; +} + +static void Heap_HeapSort (LONGINT n, LONGINT *a, LONGINT a__len) +{ + LONGINT l, r, x; + l = __ASHR(n, 1); + r = n - 1; + while (l > 0) { + l -= 1; + Heap_Sift(l, r, (void*)a, a__len); + } + while (r > 0) { + x = a[0]; + a[0] = a[r]; + a[r] = x; + r -= 1; + Heap_Sift(l, r, (void*)a, a__len); + } +} + +static void Heap_MarkCandidates (LONGINT n, LONGINT *cand, LONGINT cand__len) +{ + LONGINT chnk, adr, tag, next, lim, lim1, i, ptr, size; + chnk = Heap_heap; + i = 0; + lim = cand[n - 1]; + while ((chnk != 0 && chnk < lim)) { + adr = chnk + 24; + lim1 = Heap_FetchAddress(chnk + 8); + if (lim < lim1) { + lim1 = lim; + } + while (adr < lim1) { + tag = Heap_FetchAddress(adr); + if (__ODD(tag)) { + size = Heap_FetchAddress(tag - 1); + adr += size; + } else { + size = Heap_FetchAddress(tag); + ptr = adr + 8; + while (cand[i] < ptr) { + i += 1; + } + if (i == n) { + return; + } + next = adr + size; + if (cand[i] < next) { + Heap_Mark(ptr); + } + adr = next; + } + } + chnk = Heap_FetchAddress(chnk); + } +} + +static void Heap_CheckFin (void) +{ + Heap_FinNode n; + LONGINT tag; + n = Heap_fin; + while (n != NIL) { + tag = Heap_FetchAddress(n->obj - 8); + if (!__ODD(tag)) { + n->marked = 0; + Heap_Mark(n->obj); + } else { + n->marked = 1; + } + n = n->next; + } +} + +static void Heap_Finalize (void) +{ + Heap_FinNode n, prev; + n = Heap_fin; + prev = NIL; + while (n != NIL) { + if (!n->marked) { + if (n == Heap_fin) { + Heap_fin = Heap_fin->next; + } else { + prev->next = n->next; + } + (*n->finalize)((SYSTEM_PTR)(uintptr_t)n->obj); + if (prev == NIL) { + n = Heap_fin; + } else { + n = n->next; + } + } else { + prev = n; + n = n->next; + } + } +} + +void Heap_FINALL (void) +{ + Heap_FinNode n; + while (Heap_fin != NIL) { + n = Heap_fin; + Heap_fin = Heap_fin->next; + (*n->finalize)((SYSTEM_PTR)(uintptr_t)n->obj); + } +} + +static void Heap_MarkStack (LONGINT n, LONGINT *cand, LONGINT cand__len) +{ + SYSTEM_PTR frame; + LONGINT inc, nofcand, sp, p, stack0, ptr; + struct Heap__1 align; + if (n > 0) { + Heap_MarkStack(n - 1, cand, cand__len); + if (n > 100) { + return; + } + } + if (n == 0) { + nofcand = 0; + sp = (LONGINT)(uintptr_t)&frame; + stack0 = Heap_PlatformMainStackFrame(); + inc = (LONGINT)(uintptr_t)&align.p - (LONGINT)(uintptr_t)&align; + if (sp > stack0) { + inc = -inc; + } + while (sp != stack0) { + __GET(sp, p, LONGINT); + if ((p > Heap_heap && p < Heap_heapend)) { + if (nofcand == cand__len) { + Heap_HeapSort(nofcand, (void*)cand, cand__len); + Heap_MarkCandidates(nofcand, (void*)cand, cand__len); + nofcand = 0; + } + cand[nofcand] = p; + nofcand += 1; + } + sp += inc; + } + if (nofcand > 0) { + Heap_HeapSort(nofcand, (void*)cand, cand__len); + Heap_MarkCandidates(nofcand, (void*)cand, cand__len); + } + } +} + +void Heap_GC (BOOLEAN markStack) +{ + Heap_Module m; + LONGINT i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; + LONGINT cand[10000]; + if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { + Heap_Lock(); + m = (Heap_Module)(uintptr_t)Heap_modules; + while (m != NIL) { + if (m->enumPtrs != NIL) { + (*m->enumPtrs)(Heap_MarkP); + } + m = m->next; + } + if (markStack) { + i0 = -100; + i1 = -101; + i2 = -102; + i3 = -103; + i4 = -104; + i5 = -105; + i6 = -106; + i7 = -107; + i8 = 1; + i9 = 2; + i10 = 3; + i11 = 4; + i12 = 5; + i13 = 6; + i14 = 7; + i15 = 8; + i16 = 9; + i17 = 10; + i18 = 11; + i19 = 12; + i20 = 13; + i21 = 14; + i22 = 15; + i23 = 16; + for (;;) { + i0 += 1; + i1 += 2; + i2 += 3; + i3 += 4; + i4 += 5; + i5 += 6; + i6 += 7; + i7 += 8; + i8 += 9; + i9 += 10; + i10 += 11; + i11 += 12; + i12 += 13; + i13 += 14; + i14 += 15; + i15 += 16; + i16 += 17; + i17 += 18; + i18 += 19; + i19 += 20; + i20 += 21; + i21 += 22; + i22 += 23; + i23 += 24; + if ((i0 == -99 && i15 == 24)) { + Heap_MarkStack(((LONGINT)(32)), (void*)cand, ((LONGINT)(10000))); + break; + } + } + if (((((((((((((((((((((((i0 + i1) + i2) + i3) + i4) + i5) + i6) + i7) + i8) + i9) + i10) + i11) + i12) + i13) + i14) + i15) + i16) + i17) + i18) + i19) + i20) + i21) + i22) + i23 > 10000) { + return; + } + } + Heap_CheckFin(); + Heap_Scan(); + Heap_Finalize(); + Heap_Unlock(); + } +} + +void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) +{ + Heap_FinNode f; + __NEW(f, Heap_FinDesc); + f->obj = (LONGINT)(uintptr_t)obj; + f->finalize = finalize; + f->marked = 1; + f->next = Heap_fin; + Heap_fin = f; +} + +void Heap_InitHeap (void) +{ + Heap_heap = Heap_NewChunk(((LONGINT)(256000))); + Heap_heapend = Heap_FetchAddress(Heap_heap + 8); + __PUT(Heap_heap, 0, LONGINT); + Heap_allocated = 0; + Heap_firstTry = 1; + Heap_freeList[9] = 1; + Heap_lockdepth = 0; + Heap_FileCount = 0; + Heap_modules = NIL; + Heap_heapsize = 0; + Heap_bigBlocks = 0; + Heap_fin = NIL; + Heap_interrupted = 0; + Heap_HeapModuleInit(); +} + +static void EnumPtrs(void (*P)(void*)) +{ + P(Heap_modules); + P(Heap_fin); +} + +__TDESC(Heap_ModuleDesc, 1, 2) = {__TDFLDS("ModuleDesc", 80), {0, 40, -24}}; +__TDESC(Heap_CmdDesc, 1, 1) = {__TDFLDS("CmdDesc", 40), {0, -16}}; +__TDESC(Heap_FinDesc, 1, 1) = {__TDFLDS("FinDesc", 32), {0, -16}}; +__TDESC(Heap__1, 1, 1) = {__TDFLDS("", 16), {8, -16}}; + +export void *Heap__init(void) +{ + __DEFMOD; + __REGMOD("Heap", EnumPtrs); + __REGCMD("FINALL", Heap_FINALL); + __REGCMD("InitHeap", Heap_InitHeap); + __REGCMD("Lock", Heap_Lock); + __REGCMD("Unlock", Heap_Unlock); + __INITYP(Heap_ModuleDesc, Heap_ModuleDesc, 0); + __INITYP(Heap_CmdDesc, Heap_CmdDesc, 0); + __INITYP(Heap_FinDesc, Heap_FinDesc, 0); + __INITYP(Heap__1, Heap__1, 0); +/* BEGIN */ + __ENDMOD; +} diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h new file mode 100644 index 00000000..1b23ddb3 --- /dev/null +++ b/bootstrap/unix-88/Heap.h @@ -0,0 +1,55 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin tskSfF */ + +#ifndef Heap__h +#define Heap__h + +#define LARGE +#include "SYSTEM.h" + +typedef + CHAR Heap_CmdName[24]; + +typedef + void (*Heap_Command)(void); + +typedef + void (*Heap_EnumProc)(void(*)(SYSTEM_PTR)); + +typedef + void (*Heap_Finalizer)(SYSTEM_PTR); + +typedef + struct Heap_ModuleDesc *Heap_Module; + +typedef + struct Heap_ModuleDesc { + LONGINT _prvt0; + char _prvt1[72]; + } Heap_ModuleDesc; + +typedef + CHAR Heap_ModuleName[20]; + + +import SYSTEM_PTR Heap_modules; +import LONGINT Heap_allocated, Heap_heapsize; +import INTEGER Heap_FileCount; + +import LONGINT *Heap_ModuleDesc__typ; + +import void Heap_FINALL (void); +import void Heap_GC (BOOLEAN markStack); +import void Heap_INCREF (Heap_Module m); +import void Heap_InitHeap (void); +import void Heap_Lock (void); +import SYSTEM_PTR Heap_NEWBLK (LONGINT size); +import SYSTEM_PTR Heap_NEWREC (LONGINT tag); +import void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); +import SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); +import void Heap_REGTYP (Heap_Module m, LONGINT typ); +import void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); +import void Heap_Unlock (void); +import void *Heap__init(void); + + +#endif diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c new file mode 100644 index 00000000..77278391 --- /dev/null +++ b/bootstrap/unix-88/Modules.c @@ -0,0 +1,172 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +#define LARGE +#include "SYSTEM.h" +#include "Console.h" +#include "Heap.h" + +typedef + struct Modules_CmdDesc *Modules_Cmd; + +typedef + void (*Modules_Command)(void); + +typedef + struct Modules_CmdDesc { + Modules_Cmd next; + CHAR name[24]; + Modules_Command cmd; + } Modules_CmdDesc; + +typedef + struct Modules_ModuleDesc *Modules_Module; + +typedef + CHAR Modules_ModuleName[20]; + +typedef + struct Modules_ModuleDesc { + Modules_Module next; + Modules_ModuleName name; + LONGINT refcnt; + Modules_Cmd cmds; + LONGINT types; + void (*enumPtrs)(void(*)(LONGINT)); + LONGINT reserved1, reserved2; + } Modules_ModuleDesc; + + +export INTEGER Modules_res; +export CHAR Modules_resMsg[256]; +export Modules_ModuleName Modules_imported, Modules_importing; + +export LONGINT *Modules_ModuleDesc__typ; +export LONGINT *Modules_CmdDesc__typ; + +static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len); +export void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all); +export Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len); +export Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len); + +#define Modules_modules() (Modules_Module)Heap_modules +#define Modules_setmodules(m) Heap_modules = m + +static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len) +{ + INTEGER i, j; + __DUP(b, b__len, CHAR); + i = 0; + while (a[__X(i, a__len)] != 0x00) { + i += 1; + } + j = 0; + while (b[__X(j, b__len)] != 0x00) { + a[__X(i, a__len)] = b[__X(j, b__len)]; + i += 1; + j += 1; + } + a[__X(i, a__len)] = 0x00; + __DEL(b); +} + +Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len) +{ + Modules_Module _o_result; + Modules_Module m = NIL; + CHAR bodyname[64]; + Modules_Command body; + __DUP(name, name__len, CHAR); + m = Modules_modules(); + while ((m != NIL && __STRCMP(m->name, name) != 0)) { + m = m->next; + } + if (m != NIL) { + Modules_res = 0; + Modules_resMsg[0] = 0x00; + } else { + Modules_res = 1; + __COPY(name, Modules_importing, ((LONGINT)(20))); + __MOVE(" module \"", Modules_resMsg, 10); + Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), name, name__len); + Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), (CHAR*)"\" not found", (LONGINT)12); + } + _o_result = m; + __DEL(name); + return _o_result; +} + +Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len) +{ + Modules_Command _o_result; + Modules_Cmd c = NIL; + __DUP(name, name__len, CHAR); + c = mod->cmds; + while ((c != NIL && __STRCMP(c->name, name) != 0)) { + c = c->next; + } + if (c != NIL) { + Modules_res = 0; + Modules_resMsg[0] = 0x00; + _o_result = c->cmd; + __DEL(name); + return _o_result; + } else { + Modules_res = 2; + __MOVE(" command \"", Modules_resMsg, 11); + __COPY(name, Modules_importing, ((LONGINT)(20))); + Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), mod->name, ((LONGINT)(20))); + Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), (CHAR*)".", (LONGINT)2); + Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), name, name__len); + Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), (CHAR*)"\" not found", (LONGINT)12); + _o_result = NIL; + __DEL(name); + return _o_result; + } + __RETCHK; +} + +void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all) +{ + Modules_Module m = NIL, p = NIL; + __DUP(name, name__len, CHAR); + m = Modules_modules(); + if (all) { + Modules_res = 1; + __MOVE("unloading \"all\" not yet supported", Modules_resMsg, 34); + } else { + while ((m != NIL && __STRCMP(m->name, name) != 0)) { + p = m; + m = m->next; + } + if ((m != NIL && m->refcnt == 0)) { + if (m == Modules_modules()) { + Modules_setmodules(m->next); + } else { + p->next = m->next; + } + Modules_res = 0; + } else { + Modules_res = 1; + if (m == NIL) { + __MOVE("module not found", Modules_resMsg, 17); + } else { + __MOVE("clients of this module exist", Modules_resMsg, 29); + } + } + } + __DEL(name); +} + +__TDESC(Modules_ModuleDesc, 1, 2) = {__TDFLDS("ModuleDesc", 80), {0, 40, -24}}; +__TDESC(Modules_CmdDesc, 1, 1) = {__TDFLDS("CmdDesc", 40), {0, -16}}; + +export void *Modules__init(void) +{ + __DEFMOD; + __MODULE_IMPORT(Console); + __MODULE_IMPORT(Heap); + __REGMOD("Modules", 0); + __INITYP(Modules_ModuleDesc, Modules_ModuleDesc, 0); + __INITYP(Modules_CmdDesc, Modules_CmdDesc, 0); +/* BEGIN */ + __ENDMOD; +} diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h new file mode 100644 index 00000000..88bb46e1 --- /dev/null +++ b/bootstrap/unix-88/Modules.h @@ -0,0 +1,55 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ + +#ifndef Modules__h +#define Modules__h + +#define LARGE +#include "SYSTEM.h" + +typedef + struct Modules_CmdDesc *Modules_Cmd; + +typedef + void (*Modules_Command)(void); + +typedef + struct Modules_CmdDesc { + Modules_Cmd next; + CHAR name[24]; + Modules_Command cmd; + } Modules_CmdDesc; + +typedef + struct Modules_ModuleDesc *Modules_Module; + +typedef + CHAR Modules_ModuleName[20]; + +typedef + struct Modules_ModuleDesc { + Modules_Module next; + Modules_ModuleName name; + LONGINT refcnt; + Modules_Cmd cmds; + LONGINT types; + void (*enumPtrs)(void(*)(LONGINT)); + char _prvt0[16]; + } Modules_ModuleDesc; + + +import INTEGER Modules_res; +import CHAR Modules_resMsg[256]; +import Modules_ModuleName Modules_imported, Modules_importing; + +import LONGINT *Modules_ModuleDesc__typ; +import LONGINT *Modules_CmdDesc__typ; + +import void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all); +import Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len); +import Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len); +import void *Modules__init(void); + +#define Modules_modules() (Modules_Module)Heap_modules +#define Modules_setmodules(m) Heap_modules = m + +#endif diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c new file mode 100644 index 00000000..428d0881 --- /dev/null +++ b/bootstrap/unix-88/OPB.c @@ -0,0 +1,2678 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +#define LARGE +#include "SYSTEM.h" +#include "OPM.h" +#include "OPS.h" +#include "OPT.h" + + +export void (*OPB_typSize)(OPT_Struct); +static INTEGER OPB_exp; +static LONGINT OPB_maxExp; + + +export void OPB_Assign (OPT_Node *x, OPT_Node y); +static void OPB_BindNodes (SHORTINT class, OPT_Struct typ, OPT_Node *x, OPT_Node y); +static LONGINT OPB_BoolToInt (BOOLEAN b); +export void OPB_Call (OPT_Node *x, OPT_Node apar, OPT_Object fp); +static void OPB_CharToString (OPT_Node n); +static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode); +static void OPB_CheckLeaf (OPT_Node x, BOOLEAN dynArrToo); +export void OPB_CheckParameters (OPT_Object fp, OPT_Object ap, BOOLEAN checkNames); +static void OPB_CheckProc (OPT_Struct x, OPT_Object y); +static void OPB_CheckPtr (OPT_Node x, OPT_Node y); +static void OPB_CheckRealType (INTEGER f, INTEGER nr, OPT_Const x); +static void OPB_CheckReceiver (OPT_Node *x, OPT_Object fp); +static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y); +export void OPB_Construct (SHORTINT class, OPT_Node *x, OPT_Node y); +static void OPB_Convert (OPT_Node *x, OPT_Struct typ); +export void OPB_DeRef (OPT_Node *x); +static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpar); +export OPT_Node OPB_EmptySet (void); +export void OPB_Enter (OPT_Node *procdec, OPT_Node stat, OPT_Object proc); +export void OPB_Field (OPT_Node *x, OPT_Object y); +export void OPB_In (OPT_Node *x, OPT_Node y); +export void OPB_Index (OPT_Node *x, OPT_Node y); +export void OPB_Inittd (OPT_Node *inittd, OPT_Node *last, OPT_Struct typ); +static BOOLEAN OPB_IntToBool (LONGINT i); +export void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y); +export void OPB_MOp (SHORTINT op, OPT_Node *x); +export OPT_Node OPB_NewBoolConst (BOOLEAN boolval); +export OPT_Node OPB_NewIntConst (LONGINT intval); +export OPT_Node OPB_NewLeaf (OPT_Object obj); +export OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ); +export OPT_Node OPB_NewString (OPS_String str, LONGINT len); +export OPT_Node OPB_Nil (void); +static BOOLEAN OPB_NotVar (OPT_Node x); +export void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y); +export void OPB_OptIf (OPT_Node *x); +export void OPB_Param (OPT_Node ap, OPT_Object fp); +export void OPB_PrepCall (OPT_Node *x, OPT_Object *fpar); +export void OPB_Return (OPT_Node *x, OPT_Object proc); +export void OPB_SetElem (OPT_Node *x); +static void OPB_SetIntType (OPT_Node node); +export void OPB_SetRange (OPT_Node *x, OPT_Node y); +export void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno); +export void OPB_StPar0 (OPT_Node *par0, INTEGER fctno); +export void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno); +export void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n); +export void OPB_StaticLink (SHORTINT dlev); +export void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard); +static void OPB_err (INTEGER n); +static LONGINT OPB_log (LONGINT x); + + +static void OPB_err (INTEGER n) +{ + OPM_err(n); +} + +OPT_Node OPB_NewLeaf (OPT_Object obj) +{ + OPT_Node _o_result; + OPT_Node node = NIL; + switch (obj->mode) { + case 1: + node = OPT_NewNode(0); + node->readonly = (obj->vis == 2 && obj->mnolev < 0); + break; + case 2: + node = OPT_NewNode(1); + break; + case 3: + node = OPT_NewNode(7); + node->conval = OPT_NewConst(); + __GUARDEQP(node->conval, OPT_ConstDesc) = *obj->conval; + break; + case 5: + node = OPT_NewNode(8); + break; + case 6: case 7: case 8: case 9: case 10: + node = OPT_NewNode(9); + break; + default: + OPB_err(127); + node = OPT_NewNode(0); + break; + } + node->obj = obj; + node->typ = obj->typ; + _o_result = node; + return _o_result; +} + +void OPB_Construct (SHORTINT class, OPT_Node *x, OPT_Node y) +{ + OPT_Node node = NIL; + node = OPT_NewNode(class); + node->typ = OPT_notyp; + node->left = *x; + node->right = y; + *x = node; +} + +void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y) +{ + if (*x == NIL) { + *x = y; + } else { + (*last)->link = y; + } + while (y->link != NIL) { + y = y->link; + } + *last = y; +} + +static LONGINT OPB_BoolToInt (BOOLEAN b) +{ + LONGINT _o_result; + if (b) { + _o_result = 1; + return _o_result; + } else { + _o_result = 0; + return _o_result; + } + __RETCHK; +} + +static BOOLEAN OPB_IntToBool (LONGINT i) +{ + BOOLEAN _o_result; + if (i == 0) { + _o_result = 0; + return _o_result; + } else { + _o_result = 1; + return _o_result; + } + __RETCHK; +} + +OPT_Node OPB_NewBoolConst (BOOLEAN boolval) +{ + OPT_Node _o_result; + OPT_Node x = NIL; + x = OPT_NewNode(7); + x->typ = OPT_booltyp; + x->conval = OPT_NewConst(); + x->conval->intval = OPB_BoolToInt(boolval); + _o_result = x; + return _o_result; +} + +void OPB_OptIf (OPT_Node *x) +{ + OPT_Node if_ = NIL, pred = NIL; + if_ = (*x)->left; + while (if_->left->class == 7) { + if (OPB_IntToBool(if_->left->conval->intval)) { + *x = if_->right; + return; + } else if (if_->link == NIL) { + *x = (*x)->right; + return; + } else { + if_ = if_->link; + (*x)->left = if_; + } + } + pred = if_; + if_ = if_->link; + while (if_ != NIL) { + if (if_->left->class == 7) { + if (OPB_IntToBool(if_->left->conval->intval)) { + pred->link = NIL; + (*x)->right = if_->right; + return; + } else { + if_ = if_->link; + pred->link = if_; + } + } else { + pred = if_; + if_ = if_->link; + } + } +} + +OPT_Node OPB_Nil (void) +{ + OPT_Node _o_result; + OPT_Node x = NIL; + x = OPT_NewNode(7); + x->typ = OPT_niltyp; + x->conval = OPT_NewConst(); + x->conval->intval = 0; + _o_result = x; + return _o_result; +} + +OPT_Node OPB_EmptySet (void) +{ + OPT_Node _o_result; + OPT_Node x = NIL; + x = OPT_NewNode(7); + x->typ = OPT_settyp; + x->conval = OPT_NewConst(); + x->conval->setval = 0x0; + _o_result = x; + return _o_result; +} + +static void OPB_SetIntType (OPT_Node node) +{ + LONGINT v; + v = node->conval->intval; + if ((OPM_MinSInt <= (LONGINT)v && (LONGINT)v <= OPM_MaxSInt)) { + node->typ = OPT_sinttyp; + } else if ((OPM_MinInt <= (LONGINT)v && (LONGINT)v <= OPM_MaxInt)) { + node->typ = OPT_inttyp; + } else if ((OPM_MinLInt <= v && v <= OPM_MaxLInt)) { + node->typ = OPT_linttyp; + } else { + OPB_err(203); + node->typ = OPT_sinttyp; + node->conval->intval = 1; + } +} + +OPT_Node OPB_NewIntConst (LONGINT intval) +{ + OPT_Node _o_result; + OPT_Node x = NIL; + x = OPT_NewNode(7); + x->conval = OPT_NewConst(); + x->conval->intval = intval; + OPB_SetIntType(x); + _o_result = x; + return _o_result; +} + +OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ) +{ + OPT_Node _o_result; + OPT_Node x = NIL; + x = OPT_NewNode(7); + x->conval = OPT_NewConst(); + x->conval->realval = realval; + x->typ = typ; + x->conval->intval = -1; + _o_result = x; + return _o_result; +} + +OPT_Node OPB_NewString (OPS_String str, LONGINT len) +{ + OPT_Node _o_result; + OPT_Node x = NIL; + x = OPT_NewNode(7); + x->conval = OPT_NewConst(); + x->typ = OPT_stringtyp; + x->conval->intval = -1; + x->conval->intval2 = len; + x->conval->ext = OPT_NewExt(); + __COPY(str, *x->conval->ext, ((LONGINT)(256))); + _o_result = x; + return _o_result; +} + +static void OPB_CharToString (OPT_Node n) +{ + CHAR ch; + n->typ = OPT_stringtyp; + ch = (CHAR)n->conval->intval; + n->conval->ext = OPT_NewExt(); + if (ch == 0x00) { + n->conval->intval2 = 1; + } else { + n->conval->intval2 = 2; + (*n->conval->ext)[1] = 0x00; + } + (*n->conval->ext)[0] = ch; + n->conval->intval = -1; + n->obj = NIL; +} + +static void OPB_BindNodes (SHORTINT class, OPT_Struct typ, OPT_Node *x, OPT_Node y) +{ + OPT_Node node = NIL; + node = OPT_NewNode(class); + node->typ = typ; + node->left = *x; + node->right = y; + *x = node; +} + +static BOOLEAN OPB_NotVar (OPT_Node x) +{ + BOOLEAN _o_result; + _o_result = (x->class >= 7 && ((x->class != 11 || x->subcl != 29) || x->left->class >= 7)); + return _o_result; +} + +void OPB_DeRef (OPT_Node *x) +{ + OPT_Object strobj = NIL, bstrobj = NIL; + OPT_Struct typ = NIL, btyp = NIL; + typ = (*x)->typ; + if ((*x)->class >= 7) { + OPB_err(78); + } else if (typ->form == 13) { + if (typ == OPT_sysptrtyp) { + OPB_err(57); + } + btyp = typ->BaseTyp; + strobj = typ->strobj; + bstrobj = btyp->strobj; + if ((((((strobj != NIL && strobj->name[0] != 0x00)) && bstrobj != NIL)) && bstrobj->name[0] != 0x00)) { + btyp->pbused = 1; + } + OPB_BindNodes(3, btyp, &*x, NIL); + } else { + OPB_err(84); + } +} + +void OPB_Index (OPT_Node *x, OPT_Node y) +{ + INTEGER f; + OPT_Struct typ = NIL; + f = y->typ->form; + if ((*x)->class >= 7) { + OPB_err(79); + } else if (!__IN(f, 0x70) || __IN(y->class, 0x0300)) { + OPB_err(80); + y->typ = OPT_inttyp; + } + if ((*x)->typ->comp == 2) { + typ = (*x)->typ->BaseTyp; + if ((y->class == 7 && (y->conval->intval < 0 || y->conval->intval >= (*x)->typ->n))) { + OPB_err(81); + } + } else if ((*x)->typ->comp == 3) { + typ = (*x)->typ->BaseTyp; + if ((y->class == 7 && y->conval->intval < 0)) { + OPB_err(81); + } + } else { + OPB_err(82); + typ = OPT_undftyp; + } + OPB_BindNodes(4, typ, &*x, y); + (*x)->readonly = (*x)->left->readonly; +} + +void OPB_Field (OPT_Node *x, OPT_Object y) +{ + if ((*x)->class >= 7) { + OPB_err(77); + } + if ((y != NIL && __IN(y->mode, 0x2010))) { + OPB_BindNodes(2, y->typ, &*x, NIL); + (*x)->obj = y; + (*x)->readonly = (*x)->left->readonly || (y->vis == 2 && y->mnolev < 0); + } else { + OPB_err(83); + (*x)->typ = OPT_undftyp; + } +} + +static struct TypTest__57 { + OPT_Node *x; + OPT_Object *obj; + BOOLEAN *guard; + struct TypTest__57 *lnk; +} *TypTest__57_s; + +static void GTT__58 (OPT_Struct t0, OPT_Struct t1); + +static void GTT__58 (OPT_Struct t0, OPT_Struct t1) +{ + OPT_Node node = NIL; + OPT_Struct t = NIL; + t = t0; + while ((((t != NIL && t != t1)) && t != OPT_undftyp)) { + t = t->BaseTyp; + } + if (t != t1) { + while ((((t1 != NIL && t1 != t0)) && t1 != OPT_undftyp)) { + t1 = t1->BaseTyp; + } + if (t1 == t0 || t0->form == 0) { + if (*TypTest__57_s->guard) { + OPB_BindNodes(5, NIL, &*TypTest__57_s->x, NIL); + (*TypTest__57_s->x)->readonly = (*TypTest__57_s->x)->left->readonly; + } else { + node = OPT_NewNode(11); + node->subcl = 16; + node->left = *TypTest__57_s->x; + node->obj = *TypTest__57_s->obj; + *TypTest__57_s->x = node; + } + } else { + OPB_err(85); + } + } else if (t0 != t1) { + OPB_err(85); + } else if (!*TypTest__57_s->guard) { + if ((*TypTest__57_s->x)->class == 5) { + node = OPT_NewNode(11); + node->subcl = 16; + node->left = *TypTest__57_s->x; + node->obj = *TypTest__57_s->obj; + *TypTest__57_s->x = node; + } else { + *TypTest__57_s->x = OPB_NewBoolConst(1); + } + } +} + +void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) +{ + struct TypTest__57 _s; + _s.x = x; + _s.obj = &obj; + _s.guard = &guard; + _s.lnk = TypTest__57_s; + TypTest__57_s = &_s; + if (OPB_NotVar(*x)) { + OPB_err(112); + } else if ((*x)->typ->form == 13) { + if (((*x)->typ->BaseTyp->comp != 4 && (*x)->typ != OPT_sysptrtyp)) { + OPB_err(85); + } else if (obj->typ->form == 13) { + GTT__58((*x)->typ->BaseTyp, obj->typ->BaseTyp); + } else { + OPB_err(86); + } + } else if (((((*x)->typ->comp == 4 && (*x)->class == 1)) && obj->typ->comp == 4)) { + GTT__58((*x)->typ, obj->typ); + } else { + OPB_err(87); + } + if (guard) { + (*x)->typ = obj->typ; + } else { + (*x)->typ = OPT_booltyp; + } + TypTest__57_s = _s.lnk; +} + +void OPB_In (OPT_Node *x, OPT_Node y) +{ + INTEGER f; + LONGINT k; + f = (*x)->typ->form; + if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { + OPB_err(126); + } else if ((__IN(f, 0x70) && y->typ->form == 9)) { + if ((*x)->class == 7) { + k = (*x)->conval->intval; + if (k < 0 || k > (LONGINT)OPM_MaxSet) { + OPB_err(202); + } else if (y->class == 7) { + (*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval)); + (*x)->obj = NIL; + } else { + OPB_BindNodes(12, OPT_booltyp, &*x, y); + (*x)->subcl = 15; + } + } else { + OPB_BindNodes(12, OPT_booltyp, &*x, y); + (*x)->subcl = 15; + } + } else { + OPB_err(92); + } + (*x)->typ = OPT_booltyp; +} + +static LONGINT OPB_log (LONGINT x) +{ + LONGINT _o_result; + OPB_exp = 0; + if (x > 0) { + while (!__ODD(x)) { + x = __ASHR(x, 1); + OPB_exp += 1; + } + } + _o_result = x; + return _o_result; +} + +static void OPB_CheckRealType (INTEGER f, INTEGER nr, OPT_Const x) +{ + LONGREAL min, max, r; + if (f == 7) { + min = OPM_MinReal; + max = OPM_MaxReal; + } else { + min = OPM_MinLReal; + max = OPM_MaxLReal; + } + r = __ABS(x->realval); + if (r > max || r < min) { + OPB_err(nr); + x->realval = (LONGREAL)1; + } else if (f == 7) { + x->realval = x->realval; + } + x->intval = -1; +} + +static struct MOp__28 { + struct MOp__28 *lnk; +} *MOp__28_s; + +static OPT_Node NewOp__29 (SHORTINT op, OPT_Struct typ, OPT_Node z); + +static OPT_Node NewOp__29 (SHORTINT op, OPT_Struct typ, OPT_Node z) +{ + OPT_Node _o_result; + OPT_Node node = NIL; + node = OPT_NewNode(11); + node->subcl = op; + node->typ = typ; + node->left = z; + _o_result = node; + return _o_result; +} + +void OPB_MOp (SHORTINT op, OPT_Node *x) +{ + INTEGER f; + OPT_Struct typ = NIL; + OPT_Node z = NIL; + struct MOp__28 _s; + _s.lnk = MOp__28_s; + MOp__28_s = &_s; + z = *x; + if (z->class == 8 || z->class == 9) { + OPB_err(126); + } else { + typ = z->typ; + f = typ->form; + switch (op) { + case 33: + if (f == 2) { + if (z->class == 7) { + z->conval->intval = OPB_BoolToInt(!OPB_IntToBool(z->conval->intval)); + z->obj = NIL; + } else { + z = NewOp__29(op, typ, z); + } + } else { + OPB_err(98); + } + break; + case 6: + if (!__IN(f, 0x01f0)) { + OPB_err(96); + } + break; + case 7: + if (__IN(f, 0x03f0)) { + if (z->class == 7) { + if (__IN(f, 0x70)) { + if (z->conval->intval == (-9223372036854775807-1)) { + OPB_err(203); + } else { + z->conval->intval = -z->conval->intval; + OPB_SetIntType(z); + } + } else if (__IN(f, 0x0180)) { + z->conval->realval = -z->conval->realval; + } else { + z->conval->setval = ~z->conval->setval; + } + z->obj = NIL; + } else { + z = NewOp__29(op, typ, z); + } + } else { + OPB_err(97); + } + break; + case 21: + if (__IN(f, 0x01f0)) { + if (z->class == 7) { + if (__IN(f, 0x70)) { + if (z->conval->intval == (-9223372036854775807-1)) { + OPB_err(203); + } else { + z->conval->intval = __ABS(z->conval->intval); + OPB_SetIntType(z); + } + } else { + z->conval->realval = __ABS(z->conval->realval); + } + z->obj = NIL; + } else { + z = NewOp__29(op, typ, z); + } + } else { + OPB_err(111); + } + break; + case 22: + if (f == 3) { + if (z->class == 7) { + z->conval->intval = (int)__CAP((CHAR)z->conval->intval); + z->obj = NIL; + } else { + z = NewOp__29(op, typ, z); + } + } else { + OPB_err(111); + z->typ = OPT_chartyp; + } + break; + case 23: + if (__IN(f, 0x70)) { + if (z->class == 7) { + z->conval->intval = OPB_BoolToInt(__ODD(z->conval->intval)); + z->obj = NIL; + } else { + z = NewOp__29(op, typ, z); + } + } else { + OPB_err(111); + } + z->typ = OPT_booltyp; + break; + case 24: + if ((((z->class == 7 && f == 3)) && z->conval->intval >= 32)) { + OPB_CharToString(z); + f = 10; + } + if (z->class < 7 || f == 10) { + z = NewOp__29(op, typ, z); + } else { + OPB_err(127); + } + z->typ = OPT_linttyp; + break; + case 25: + if ((__IN(f, 0x70) && z->class == 7)) { + if ((0 <= z->conval->intval && z->conval->intval <= -1)) { + z = NewOp__29(op, typ, z); + } else { + OPB_err(219); + } + } else { + OPB_err(69); + } + z->typ = OPT_booltyp; + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPB.MOp, op = ", (LONGINT)33); + OPM_LogWNum(op, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + } + *x = z; + MOp__28_s = _s.lnk; +} + +static void OPB_CheckPtr (OPT_Node x, OPT_Node y) +{ + INTEGER g; + OPT_Struct p = NIL, q = NIL, t = NIL; + g = y->typ->form; + if (g == 13) { + p = x->typ->BaseTyp; + q = y->typ->BaseTyp; + if ((p->comp == 4 && q->comp == 4)) { + if (p->extlev < q->extlev) { + t = p; + p = q; + q = t; + } + while ((((p != q && p != NIL)) && p != OPT_undftyp)) { + p = p->BaseTyp; + } + if (p == NIL) { + OPB_err(100); + } + } else { + OPB_err(100); + } + } else if (g != 11) { + OPB_err(100); + } +} + +void OPB_CheckParameters (OPT_Object fp, OPT_Object ap, BOOLEAN checkNames) +{ + OPT_Struct ft = NIL, at = NIL; + while (fp != NIL) { + if (ap != NIL) { + ft = fp->typ; + at = ap->typ; + while ((ft->comp == 3 && at->comp == 3)) { + ft = ft->BaseTyp; + at = at->BaseTyp; + } + if (ft != at) { + if ((ft->form == 14 && at->form == 14)) { + if (ft->BaseTyp == at->BaseTyp) { + OPB_CheckParameters(ft->link, at->link, 0); + } else { + OPB_err(117); + } + } else { + OPB_err(115); + } + } + if (fp->mode != ap->mode || (checkNames && __STRCMP(fp->name, ap->name) != 0)) { + OPB_err(115); + } + ap = ap->link; + } else { + OPB_err(116); + } + fp = fp->link; + } + if (ap != NIL) { + OPB_err(116); + } +} + +static void OPB_CheckProc (OPT_Struct x, OPT_Object y) +{ + if (__IN(y->mode, 0x04c0)) { + if (y->mode == 6) { + if (y->mnolev == 0) { + y->mode = 7; + } else { + OPB_err(73); + } + } + if (x->BaseTyp == y->typ) { + OPB_CheckParameters(x->link, y->link, 0); + } else { + OPB_err(117); + } + } else { + OPB_err(113); + } +} + +static struct ConstOp__13 { + OPT_Node *x; + INTEGER *f; + OPT_Const *xval, *yval; + struct ConstOp__13 *lnk; +} *ConstOp__13_s; + +static INTEGER ConstCmp__14 (void); + +static INTEGER ConstCmp__14 (void) +{ + INTEGER _o_result; + INTEGER res; + switch (*ConstOp__13_s->f) { + case 0: + res = 9; + break; + case 1: case 3: case 4: case 5: case 6: + if ((*ConstOp__13_s->xval)->intval < (*ConstOp__13_s->yval)->intval) { + res = 11; + } else if ((*ConstOp__13_s->xval)->intval > (*ConstOp__13_s->yval)->intval) { + res = 13; + } else { + res = 9; + } + break; + case 7: case 8: + if ((*ConstOp__13_s->xval)->realval < (*ConstOp__13_s->yval)->realval) { + res = 11; + } else if ((*ConstOp__13_s->xval)->realval > (*ConstOp__13_s->yval)->realval) { + res = 13; + } else { + res = 9; + } + break; + case 2: + if ((*ConstOp__13_s->xval)->intval != (*ConstOp__13_s->yval)->intval) { + res = 10; + } else { + res = 9; + } + break; + case 9: + if ((*ConstOp__13_s->xval)->setval != (*ConstOp__13_s->yval)->setval) { + res = 10; + } else { + res = 9; + } + break; + case 10: + if (__STRCMP(*(*ConstOp__13_s->xval)->ext, *(*ConstOp__13_s->yval)->ext) < 0) { + res = 11; + } else if (__STRCMP(*(*ConstOp__13_s->xval)->ext, *(*ConstOp__13_s->yval)->ext) > 0) { + res = 13; + } else { + res = 9; + } + break; + case 11: case 13: case 14: + if ((*ConstOp__13_s->xval)->intval != (*ConstOp__13_s->yval)->intval) { + res = 10; + } else { + res = 9; + } + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPB.ConstCmp, f = ", (LONGINT)37); + OPM_LogWNum(*ConstOp__13_s->f, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + (*ConstOp__13_s->x)->typ = OPT_booltyp; + _o_result = res; + return _o_result; +} + +static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) +{ + INTEGER f, g; + OPT_Const xval = NIL, yval = NIL; + LONGINT xv, yv; + BOOLEAN temp; + struct ConstOp__13 _s; + _s.x = &x; + _s.f = &f; + _s.xval = &xval; + _s.yval = &yval; + _s.lnk = ConstOp__13_s; + ConstOp__13_s = &_s; + f = x->typ->form; + g = y->typ->form; + xval = x->conval; + yval = y->conval; + if (f != g) { + switch (f) { + case 3: + if (g == 10) { + OPB_CharToString(x); + } else { + OPB_err(100); + y->typ = x->typ; + __GUARDEQP(yval, OPT_ConstDesc) = *xval; + } + break; + case 4: + if (__IN(g, 0x70)) { + x->typ = y->typ; + } else if (g == 7) { + x->typ = OPT_realtyp; + xval->realval = xval->intval; + } else if (g == 8) { + x->typ = OPT_lrltyp; + xval->realval = xval->intval; + } else { + OPB_err(100); + y->typ = x->typ; + __GUARDEQP(yval, OPT_ConstDesc) = *xval; + } + break; + case 5: + if (g == 4) { + y->typ = OPT_inttyp; + } else if (__IN(g, 0x70)) { + x->typ = y->typ; + } else if (g == 7) { + x->typ = OPT_realtyp; + xval->realval = xval->intval; + } else if (g == 8) { + x->typ = OPT_lrltyp; + xval->realval = xval->intval; + } else { + OPB_err(100); + y->typ = x->typ; + __GUARDEQP(yval, OPT_ConstDesc) = *xval; + } + break; + case 6: + if (__IN(g, 0x70)) { + y->typ = OPT_linttyp; + } else if (g == 7) { + x->typ = OPT_realtyp; + xval->realval = xval->intval; + } else if (g == 8) { + x->typ = OPT_lrltyp; + xval->realval = xval->intval; + } else { + OPB_err(100); + y->typ = x->typ; + __GUARDEQP(yval, OPT_ConstDesc) = *xval; + } + break; + case 7: + if (__IN(g, 0x70)) { + y->typ = x->typ; + yval->realval = yval->intval; + } else if (g == 8) { + x->typ = OPT_lrltyp; + } else { + OPB_err(100); + y->typ = x->typ; + __GUARDEQP(yval, OPT_ConstDesc) = *xval; + } + break; + case 8: + if (__IN(g, 0x70)) { + y->typ = x->typ; + yval->realval = yval->intval; + } else if (g == 7) { + y->typ = OPT_lrltyp; + } else { + OPB_err(100); + y->typ = x->typ; + __GUARDEQP(yval, OPT_ConstDesc) = *xval; + } + break; + case 10: + if (g == 3) { + OPB_CharToString(y); + g = 10; + } else { + OPB_err(100); + y->typ = x->typ; + __GUARDEQP(yval, OPT_ConstDesc) = *xval; + } + break; + case 11: + if (!__IN(g, 0x6000)) { + OPB_err(100); + } + break; + case 13: + OPB_CheckPtr(x, y); + break; + case 14: + if (g != 11) { + OPB_err(100); + } + break; + default: + OPB_err(100); + y->typ = x->typ; + __GUARDEQP(yval, OPT_ConstDesc) = *xval; + break; + } + f = x->typ->form; + } + switch (op) { + case 1: + if (__IN(f, 0x70)) { + xv = xval->intval; + yv = yval->intval; + if (((((xv == 0 || yv == 0) || (((xv > 0 && yv > 0)) && yv <= __DIV(9223372036854775807, xv))) || (((xv > 0 && yv < 0)) && yv >= __DIV((-9223372036854775807-1), xv))) || (((xv < 0 && yv > 0)) && xv >= __DIV((-9223372036854775807-1), yv))) || (((((((xv < 0 && yv < 0)) && xv != (-9223372036854775807-1))) && yv != (-9223372036854775807-1))) && -xv <= __DIV(9223372036854775807, -yv))) { + xval->intval = xv * yv; + OPB_SetIntType(x); + } else { + OPB_err(204); + } + } else if (__IN(f, 0x0180)) { + temp = __ABS(yval->realval) <= (LONGREAL)1; + if (temp || __ABS(xval->realval) <= 1.79769296342094e+308 / (LONGREAL)__ABS(yval->realval)) { + xval->realval = xval->realval * yval->realval; + OPB_CheckRealType(f, 204, xval); + } else { + OPB_err(204); + } + } else if (f == 9) { + xval->setval = (xval->setval & yval->setval); + } else if (f != 0) { + OPB_err(101); + } + break; + case 2: + if (__IN(f, 0x70)) { + if (yval->intval != 0) { + xval->realval = xval->intval / (REAL)yval->intval; + OPB_CheckRealType(7, 205, xval); + } else { + OPB_err(205); + xval->realval = (LONGREAL)1; + } + x->typ = OPT_realtyp; + } else if (__IN(f, 0x0180)) { + temp = __ABS(yval->realval) >= (LONGREAL)1; + if (temp || __ABS(xval->realval) <= 1.79769296342094e+308 * __ABS(yval->realval)) { + xval->realval = xval->realval / yval->realval; + OPB_CheckRealType(f, 205, xval); + } else { + OPB_err(205); + } + } else if (f == 9) { + xval->setval = xval->setval ^ yval->setval; + } else if (f != 0) { + OPB_err(102); + } + break; + case 3: + if (__IN(f, 0x70)) { + if (yval->intval != 0) { + xval->intval = __DIV(xval->intval, yval->intval); + OPB_SetIntType(x); + } else { + OPB_err(205); + } + } else if (f != 0) { + OPB_err(103); + } + break; + case 4: + if (__IN(f, 0x70)) { + if (yval->intval != 0) { + xval->intval = __MOD(xval->intval, yval->intval); + OPB_SetIntType(x); + } else { + OPB_err(205); + } + } else if (f != 0) { + OPB_err(104); + } + break; + case 5: + if (f == 2) { + xval->intval = OPB_BoolToInt((OPB_IntToBool(xval->intval) && OPB_IntToBool(yval->intval))); + } else { + OPB_err(94); + } + break; + case 6: + if (__IN(f, 0x70)) { + temp = (yval->intval >= 0 && xval->intval <= 9223372036854775807 - yval->intval); + if (temp || (yval->intval < 0 && xval->intval >= (-9223372036854775807-1) - yval->intval)) { + xval->intval += yval->intval; + OPB_SetIntType(x); + } else { + OPB_err(206); + } + } else if (__IN(f, 0x0180)) { + temp = (yval->realval >= (LONGREAL)0 && xval->realval <= 1.79769296342094e+308 - yval->realval); + if (temp || (yval->realval < (LONGREAL)0 && xval->realval >= -1.79769296342094e+308 - yval->realval)) { + xval->realval = xval->realval + yval->realval; + OPB_CheckRealType(f, 206, xval); + } else { + OPB_err(206); + } + } else if (f == 9) { + xval->setval = xval->setval | yval->setval; + } else if (f != 0) { + OPB_err(105); + } + break; + case 7: + if (__IN(f, 0x70)) { + if ((yval->intval >= 0 && xval->intval >= (-9223372036854775807-1) + yval->intval) || (yval->intval < 0 && xval->intval <= 9223372036854775807 + yval->intval)) { + xval->intval -= yval->intval; + OPB_SetIntType(x); + } else { + OPB_err(207); + } + } else if (__IN(f, 0x0180)) { + temp = (yval->realval >= (LONGREAL)0 && xval->realval >= -1.79769296342094e+308 + yval->realval); + if (temp || (yval->realval < (LONGREAL)0 && xval->realval <= 1.79769296342094e+308 + yval->realval)) { + xval->realval = xval->realval - yval->realval; + OPB_CheckRealType(f, 207, xval); + } else { + OPB_err(207); + } + } else if (f == 9) { + xval->setval = (xval->setval & ~yval->setval); + } else if (f != 0) { + OPB_err(106); + } + break; + case 8: + if (f == 2) { + xval->intval = OPB_BoolToInt(OPB_IntToBool(xval->intval) || OPB_IntToBool(yval->intval)); + } else { + OPB_err(95); + } + break; + case 9: + xval->intval = OPB_BoolToInt(ConstCmp__14() == 9); + break; + case 10: + xval->intval = OPB_BoolToInt(ConstCmp__14() != 9); + break; + case 11: + if (__IN(f, 0x2a04)) { + OPB_err(108); + } else { + xval->intval = OPB_BoolToInt(ConstCmp__14() == 11); + } + break; + case 12: + if (__IN(f, 0x2a04)) { + OPB_err(108); + } else { + xval->intval = OPB_BoolToInt(ConstCmp__14() != 13); + } + break; + case 13: + if (__IN(f, 0x2a04)) { + OPB_err(108); + } else { + xval->intval = OPB_BoolToInt(ConstCmp__14() == 13); + } + break; + case 14: + if (__IN(f, 0x2a04)) { + OPB_err(108); + } else { + xval->intval = OPB_BoolToInt(ConstCmp__14() != 11); + } + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPB.ConstOp, op = ", (LONGINT)37); + OPM_LogWNum(op, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + ConstOp__13_s = _s.lnk; +} + +static void OPB_Convert (OPT_Node *x, OPT_Struct typ) +{ + OPT_Node node = NIL; + INTEGER f, g; + LONGINT k; + LONGREAL r; + f = (*x)->typ->form; + g = typ->form; + if ((*x)->class == 7) { + if (__IN(f, 0x70)) { + if (__IN(g, 0x70)) { + if (f > g) { + OPB_SetIntType(*x); + if ((int)(*x)->typ->form > g) { + OPB_err(203); + (*x)->conval->intval = 1; + } + } + } else if (__IN(g, 0x0180)) { + (*x)->conval->realval = (*x)->conval->intval; + (*x)->conval->intval = -1; + } else { + k = (*x)->conval->intval; + if (0 > k || k > 255) { + OPB_err(220); + } + } + } else if (__IN(f, 0x0180)) { + if (__IN(g, 0x0180)) { + OPB_CheckRealType(g, 203, (*x)->conval); + } else { + r = (*x)->conval->realval; + if (r < -9.22337203685478e+018 || r > 9.22337203685478e+018) { + OPB_err(203); + r = (LONGREAL)1; + } + (*x)->conval->intval = __ENTIER(r); + OPB_SetIntType(*x); + } + } + (*x)->obj = NIL; + } else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((int)(*x)->left->typ->form < f || f > g))) { + if ((*x)->left->typ == typ) { + *x = (*x)->left; + } + } else { + node = OPT_NewNode(11); + node->subcl = 20; + node->left = *x; + *x = node; + } + (*x)->typ = typ; +} + +static struct Op__38 { + INTEGER *f, *g; + struct Op__38 *lnk; +} *Op__38_s; + +static void NewOp__39 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y); +static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y); + +static void NewOp__39 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y) +{ + OPT_Node node = NIL; + node = OPT_NewNode(12); + node->subcl = op; + node->typ = typ; + node->left = *x; + node->right = y; + *x = node; +} + +static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) +{ + BOOLEAN _o_result; + BOOLEAN ok, xCharArr, yCharArr; + xCharArr = (__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp->form == 3) || *Op__38_s->f == 10; + yCharArr = (__IN((*y)->typ->comp, 0x0c) && (*y)->typ->BaseTyp->form == 3) || *Op__38_s->g == 10; + if ((((xCharArr && *Op__38_s->g == 3)) && (*y)->class == 7)) { + OPB_CharToString(*y); + *Op__38_s->g = 10; + yCharArr = 1; + } + if ((((yCharArr && *Op__38_s->f == 3)) && (*x)->class == 7)) { + OPB_CharToString(*x); + *Op__38_s->f = 10; + xCharArr = 1; + } + ok = (xCharArr && yCharArr); + if (ok) { + if ((*Op__38_s->f == 10 && (*x)->conval->intval2 == 1)) { + (*x)->typ = OPT_chartyp; + (*x)->conval->intval = 0; + OPB_Index(&*y, OPB_NewIntConst(((LONGINT)(0)))); + } else if ((*Op__38_s->g == 10 && (*y)->conval->intval2 == 1)) { + (*y)->typ = OPT_chartyp; + (*y)->conval->intval = 0; + OPB_Index(&*x, OPB_NewIntConst(((LONGINT)(0)))); + } + } + _o_result = ok; + return _o_result; +} + +void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) +{ + INTEGER f, g; + OPT_Node t = NIL, z = NIL; + OPT_Struct typ = NIL; + BOOLEAN do_; + LONGINT val; + struct Op__38 _s; + _s.f = &f; + _s.g = &g; + _s.lnk = Op__38_s; + Op__38_s = &_s; + z = *x; + if (((z->class == 8 || z->class == 9) || y->class == 8) || y->class == 9) { + OPB_err(126); + } else if ((z->class == 7 && y->class == 7)) { + OPB_ConstOp(op, z, y); + z->obj = NIL; + } else { + if (z->typ != y->typ) { + g = y->typ->form; + switch (z->typ->form) { + case 3: + if (z->class == 7) { + OPB_CharToString(z); + } else { + OPB_err(100); + } + break; + case 4: + if (__IN(g, 0x01f0)) { + OPB_Convert(&z, y->typ); + } else { + OPB_err(100); + } + break; + case 5: + if (g == 4) { + OPB_Convert(&y, z->typ); + } else if (__IN(g, 0x01f0)) { + OPB_Convert(&z, y->typ); + } else { + OPB_err(100); + } + break; + case 6: + if (__IN(g, 0x70)) { + OPB_Convert(&y, z->typ); + } else if (__IN(g, 0x0180)) { + OPB_Convert(&z, y->typ); + } else { + OPB_err(100); + } + break; + case 7: + if (__IN(g, 0x70)) { + OPB_Convert(&y, z->typ); + } else if (__IN(g, 0x0180)) { + OPB_Convert(&z, y->typ); + } else { + OPB_err(100); + } + break; + case 8: + if (__IN(g, 0x01f0)) { + OPB_Convert(&y, z->typ); + } else if (__IN(g, 0x0180)) { + OPB_Convert(&y, z->typ); + } else { + OPB_err(100); + } + break; + case 11: + if (!__IN(g, 0x6000)) { + OPB_err(100); + } + break; + case 13: + OPB_CheckPtr(z, y); + break; + case 14: + if (g != 11) { + OPB_err(100); + } + break; + case 10: + break; + case 15: + if (z->typ->comp == 4) { + OPB_err(100); + } + break; + default: + OPB_err(100); + break; + } + } + typ = z->typ; + f = typ->form; + g = y->typ->form; + switch (op) { + case 1: + do_ = 1; + if (__IN(f, 0x70)) { + if (z->class == 7) { + val = z->conval->intval; + if (val == 1) { + do_ = 0; + z = y; + } else if (val == 0) { + do_ = 0; + } else if (OPB_log(val) == 1) { + t = y; + y = z; + z = t; + op = 17; + y->typ = OPT_sinttyp; + y->conval->intval = OPB_exp; + y->obj = NIL; + } + } else if (y->class == 7) { + val = y->conval->intval; + if (val == 1) { + do_ = 0; + } else if (val == 0) { + do_ = 0; + z = y; + } else if (OPB_log(val) == 1) { + op = 17; + y->typ = OPT_sinttyp; + y->conval->intval = OPB_exp; + y->obj = NIL; + } + } + } else if (!__IN(f, 0x0381)) { + OPB_err(105); + typ = OPT_undftyp; + } + if (do_) { + NewOp__39(op, typ, &z, y); + } + break; + case 2: + if (__IN(f, 0x70)) { + if ((y->class == 7 && y->conval->intval == 0)) { + OPB_err(205); + } + OPB_Convert(&z, OPT_realtyp); + OPB_Convert(&y, OPT_realtyp); + typ = OPT_realtyp; + } else if (__IN(f, 0x0180)) { + if ((y->class == 7 && y->conval->realval == (LONGREAL)0)) { + OPB_err(205); + } + } else if ((f != 9 && f != 0)) { + OPB_err(102); + typ = OPT_undftyp; + } + NewOp__39(op, typ, &z, y); + break; + case 3: + do_ = 1; + if (__IN(f, 0x70)) { + if (y->class == 7) { + val = y->conval->intval; + if (val == 0) { + OPB_err(205); + } else if (val == 1) { + do_ = 0; + } else if (OPB_log(val) == 1) { + op = 17; + y->typ = OPT_sinttyp; + y->conval->intval = -OPB_exp; + y->obj = NIL; + } + } + } else if (f != 0) { + OPB_err(103); + typ = OPT_undftyp; + } + if (do_) { + NewOp__39(op, typ, &z, y); + } + break; + case 4: + if (__IN(f, 0x70)) { + if (y->class == 7) { + if (y->conval->intval == 0) { + OPB_err(205); + } else if (OPB_log(y->conval->intval) == 1) { + op = 18; + y->conval->intval = __ASH(-1, OPB_exp); + y->obj = NIL; + } + } + } else if (f != 0) { + OPB_err(104); + typ = OPT_undftyp; + } + NewOp__39(op, typ, &z, y); + break; + case 5: + if (f == 2) { + if (z->class == 7) { + if (OPB_IntToBool(z->conval->intval)) { + z = y; + } + } else if ((y->class == 7 && OPB_IntToBool(y->conval->intval))) { + } else { + NewOp__39(op, typ, &z, y); + } + } else if (f != 0) { + OPB_err(94); + z->typ = OPT_undftyp; + } + break; + case 6: + if (!__IN(f, 0x03f1)) { + OPB_err(105); + typ = OPT_undftyp; + } + do_ = 1; + if (__IN(f, 0x70)) { + if ((z->class == 7 && z->conval->intval == 0)) { + do_ = 0; + z = y; + } + if ((y->class == 7 && y->conval->intval == 0)) { + do_ = 0; + } + } + if (do_) { + NewOp__39(op, typ, &z, y); + } + break; + case 7: + if (!__IN(f, 0x03f1)) { + OPB_err(106); + typ = OPT_undftyp; + } + if ((!__IN(f, 0x70) || y->class != 7) || y->conval->intval != 0) { + NewOp__39(op, typ, &z, y); + } + break; + case 8: + if (f == 2) { + if (z->class == 7) { + if (!OPB_IntToBool(z->conval->intval)) { + z = y; + } + } else if ((y->class == 7 && !OPB_IntToBool(y->conval->intval))) { + } else { + NewOp__39(op, typ, &z, y); + } + } else if (f != 0) { + OPB_err(95); + z->typ = OPT_undftyp; + } + break; + case 9: case 10: + if (__IN(f, 0x6bff) || strings__41(&z, &y)) { + typ = OPT_booltyp; + } else { + OPB_err(107); + typ = OPT_undftyp; + } + NewOp__39(op, typ, &z, y); + break; + case 11: case 12: case 13: case 14: + if (__IN(f, 0x01f9) || strings__41(&z, &y)) { + typ = OPT_booltyp; + } else { + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"ELSE in Op()", (LONGINT)13); + OPM_LogWLn(); + OPB_err(108); + typ = OPT_undftyp; + } + NewOp__39(op, typ, &z, y); + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPB.Op, op = ", (LONGINT)32); + OPM_LogWNum(op, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + } + *x = z; + Op__38_s = _s.lnk; +} + +void OPB_SetRange (OPT_Node *x, OPT_Node y) +{ + LONGINT k, l; + if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { + OPB_err(126); + } else if ((__IN((*x)->typ->form, 0x70) && __IN(y->typ->form, 0x70))) { + if ((*x)->class == 7) { + k = (*x)->conval->intval; + if (0 > k || k > (LONGINT)OPM_MaxSet) { + OPB_err(202); + } + } + if (y->class == 7) { + l = y->conval->intval; + if (0 > l || l > (LONGINT)OPM_MaxSet) { + OPB_err(202); + } + } + if (((*x)->class == 7 && y->class == 7)) { + if (k <= l) { + (*x)->conval->setval = __SETRNG(k, l); + } else { + OPB_err(201); + (*x)->conval->setval = __SETRNG(l, k); + } + (*x)->obj = NIL; + } else { + OPB_BindNodes(10, OPT_settyp, &*x, y); + } + } else { + OPB_err(93); + } + (*x)->typ = OPT_settyp; +} + +void OPB_SetElem (OPT_Node *x) +{ + LONGINT k; + if ((*x)->class == 8 || (*x)->class == 9) { + OPB_err(126); + } else if (!__IN((*x)->typ->form, 0x70)) { + OPB_err(93); + } else if ((*x)->class == 7) { + k = (*x)->conval->intval; + if ((0 <= k && k <= (LONGINT)OPM_MaxSet)) { + (*x)->conval->setval = __SETOF(k); + } else { + OPB_err(202); + } + (*x)->obj = NIL; + } else { + OPB_Convert(&*x, OPT_settyp); + } + (*x)->typ = OPT_settyp; +} + +static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) +{ + INTEGER f, g; + OPT_Struct y = NIL, p = NIL, q = NIL; + if (OPM_Verbose) { + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"PROCEDURE CheckAssign", (LONGINT)22); + OPM_LogWLn(); + } + y = ynode->typ; + f = x->form; + g = y->form; + if (OPM_Verbose) { + OPM_LogWStr((CHAR*)"y.form = ", (LONGINT)10); + OPM_LogWNum(y->form, ((LONGINT)(0))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"f = ", (LONGINT)5); + OPM_LogWNum(f, ((LONGINT)(0))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"g = ", (LONGINT)5); + OPM_LogWNum(g, ((LONGINT)(0))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"ynode.typ.syze = ", (LONGINT)18); + OPM_LogWNum(ynode->typ->size, ((LONGINT)(0))); + OPM_LogWLn(); + } + if (ynode->class == 8 || (ynode->class == 9 && f != 14)) { + OPB_err(126); + } + switch (f) { + case 0: case 10: + break; + case 1: + if (!__IN(g, 0x1a)) { + OPB_err(113); + } + break; + case 2: case 3: case 4: case 9: + if (g != f) { + OPB_err(113); + } + break; + case 5: + if (!__IN(g, 0x30)) { + OPB_err(113); + } + break; + case 6: + if (OPM_LIntSize == 4) { + if (!__IN(g, 0x70)) { + OPB_err(113); + } + } else { + if (!__IN(g, 0x70)) { + OPB_err(113); + } + } + break; + case 7: + if (!__IN(g, 0xf0)) { + OPB_err(113); + } + break; + case 8: + if (!__IN(g, 0x01f0)) { + OPB_err(113); + } + break; + case 13: + if ((x == y || g == 11) || (x == OPT_sysptrtyp && g == 13)) { + } else if (g == 13) { + p = x->BaseTyp; + q = y->BaseTyp; + if ((p->comp == 4 && q->comp == 4)) { + while ((((q != p && q != NIL)) && q != OPT_undftyp)) { + q = q->BaseTyp; + } + if (q == NIL) { + OPB_err(113); + } + } else { + OPB_err(113); + } + } else { + OPB_err(113); + } + break; + case 14: + if (ynode->class == 9) { + OPB_CheckProc(x, ynode->obj); + } else if (x == y || g == 11) { + } else { + OPB_err(113); + } + break; + case 12: case 11: + OPB_err(113); + break; + case 15: + x->pvused = 1; + if (x->comp == 2) { + if ((ynode->class == 7 && g == 3)) { + OPB_CharToString(ynode); + y = ynode->typ; + g = 10; + } + if (x == y) { + } else if (x->BaseTyp == OPT_chartyp) { + if (g == 10) { + if (ynode->conval->intval2 > x->n) { + OPB_err(114); + } + } else if ((__IN(y->comp, 0x0c) && y->BaseTyp == OPT_chartyp)) { + } else { + OPB_err(113); + } + } else { + OPB_err(113); + } + } else if ((x->comp == 3 && x->BaseTyp == OPT_chartyp)) { + if ((__IN(y->comp, 0x0c) && y->BaseTyp == OPT_chartyp)) { + } else { + OPB_err(113); + } + } else if (x->comp == 4) { + if (x == y) { + } else if (y->comp == 4) { + q = y->BaseTyp; + while ((((q != NIL && q != x)) && q != OPT_undftyp)) { + q = q->BaseTyp; + } + if (q == NIL) { + OPB_err(113); + } + } else { + OPB_err(113); + } + } else { + OPB_err(113); + } + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPB.CheckAssign, f = ", (LONGINT)40); + OPM_LogWNum(f, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + if ((((((ynode->class == 7 && g < f)) && __IN(g, 0xf0))) && __IN(f, 0x01e0))) { + OPB_Convert(&ynode, x); + } +} + +static void OPB_CheckLeaf (OPT_Node x, BOOLEAN dynArrToo) +{ +} + +void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) +{ + INTEGER f; + OPT_Struct typ = NIL; + OPT_Node x = NIL; + x = *par0; + f = x->typ->form; + switch (fctno) { + case 0: + if ((__IN(f, 0x70) && x->class == 7)) { + if ((0 <= x->conval->intval && x->conval->intval <= 255)) { + OPB_BindNodes(28, OPT_notyp, &x, x); + } else { + OPB_err(218); + } + } else { + OPB_err(69); + } + x->typ = OPT_notyp; + break; + case 1: + typ = OPT_notyp; + if (OPB_NotVar(x)) { + OPB_err(112); + } else if (f == 13) { + if (x->readonly) { + OPB_err(76); + } + f = x->typ->BaseTyp->comp; + if (__IN(f, 0x1c)) { + if (f == 3) { + typ = x->typ->BaseTyp; + } + OPB_BindNodes(19, OPT_notyp, &x, NIL); + x->subcl = 1; + } else { + OPB_err(111); + } + } else { + OPB_err(111); + } + x->typ = typ; + break; + case 2: + OPB_MOp(21, &x); + break; + case 3: + OPB_MOp(22, &x); + break; + case 4: + if (x->class == 8 || x->class == 9) { + OPB_err(126); + } else if (f == 3) { + OPB_Convert(&x, OPT_inttyp); + } else { + OPB_err(111); + } + x->typ = OPT_inttyp; + break; + case 5: + if (x->class == 8 || x->class == 9) { + OPB_err(126); + } else if (__IN(f, 0x0180)) { + OPB_Convert(&x, OPT_linttyp); + } else { + OPB_err(111); + } + x->typ = OPT_linttyp; + break; + case 6: + OPB_MOp(23, &x); + break; + case 7: + if (x->class == 8) { + switch (f) { + case 2: + x = OPB_NewBoolConst(0); + break; + case 3: + x = OPB_NewIntConst(((LONGINT)(0))); + x->typ = OPT_chartyp; + break; + case 4: + x = OPB_NewIntConst(OPM_MinSInt); + break; + case 5: + x = OPB_NewIntConst(OPM_MinInt); + break; + case 6: + x = OPB_NewIntConst(OPM_MinLInt); + break; + case 9: + x = OPB_NewIntConst(((LONGINT)(0))); + x->typ = OPT_inttyp; + break; + case 7: + x = OPB_NewRealConst(OPM_MinReal, OPT_realtyp); + break; + case 8: + x = OPB_NewRealConst(OPM_MinLReal, OPT_lrltyp); + break; + default: + OPB_err(111); + break; + } + } else { + OPB_err(110); + } + break; + case 8: + if (x->class == 8) { + switch (f) { + case 2: + x = OPB_NewBoolConst(1); + break; + case 3: + x = OPB_NewIntConst(((LONGINT)(255))); + x->typ = OPT_chartyp; + break; + case 4: + x = OPB_NewIntConst(OPM_MaxSInt); + break; + case 5: + x = OPB_NewIntConst(OPM_MaxInt); + break; + case 6: + x = OPB_NewIntConst(OPM_MaxLInt); + break; + case 9: + x = OPB_NewIntConst(OPM_MaxSet); + x->typ = OPT_inttyp; + break; + case 7: + x = OPB_NewRealConst(OPM_MaxReal, OPT_realtyp); + break; + case 8: + x = OPB_NewRealConst(OPM_MaxLReal, OPT_lrltyp); + break; + default: + OPB_err(111); + break; + } + } else { + OPB_err(110); + } + break; + case 9: + if (x->class == 8 || x->class == 9) { + OPB_err(126); + } else if (__IN(f, 0x71)) { + OPB_Convert(&x, OPT_chartyp); + } else { + OPB_err(111); + x->typ = OPT_chartyp; + } + break; + case 10: + if (x->class == 8 || x->class == 9) { + OPB_err(126); + } else if (f == 5) { + OPB_Convert(&x, OPT_sinttyp); + } else if (f == 6) { + OPB_Convert(&x, OPT_inttyp); + } else if (f == 8) { + OPB_Convert(&x, OPT_realtyp); + } else { + OPB_err(111); + } + break; + case 11: + if (x->class == 8 || x->class == 9) { + OPB_err(126); + } else if (f == 4) { + OPB_Convert(&x, OPT_inttyp); + } else if (f == 5) { + OPB_Convert(&x, OPT_linttyp); + } else if (f == 7) { + OPB_Convert(&x, OPT_lrltyp); + } else if (f == 3) { + OPB_Convert(&x, OPT_linttyp); + } else { + OPB_err(111); + } + break; + case 13: case 14: + if (OPB_NotVar(x)) { + OPB_err(112); + } else if (!__IN(f, 0x70)) { + OPB_err(111); + } else if (x->readonly) { + OPB_err(76); + } + break; + case 15: case 16: + if (OPB_NotVar(x)) { + OPB_err(112); + } else if (x->typ != OPT_settyp) { + OPB_err(111); + x->typ = OPT_settyp; + } else if (x->readonly) { + OPB_err(76); + } + break; + case 17: + if (!__IN(x->typ->comp, 0x0c)) { + OPB_err(131); + } + break; + case 18: + if ((x->class == 7 && f == 3)) { + OPB_CharToString(x); + f = 10; + } + if (x->class == 8 || x->class == 9) { + OPB_err(126); + } else if (((!__IN(x->typ->comp, 0x0c) || x->typ->BaseTyp->form != 3) && f != 10)) { + OPB_err(111); + } + break; + case 19: + if (x->class == 8 || x->class == 9) { + OPB_err(126); + } else if (__IN(f, 0x70)) { + if (f != 6) { + OPB_Convert(&x, OPT_linttyp); + } + } else { + OPB_err(111); + x->typ = OPT_linttyp; + } + break; + case 20: + OPB_CheckLeaf(x, 0); + OPB_MOp(24, &x); + break; + case 12: + if (x->class != 8) { + OPB_err(110); + x = OPB_NewIntConst(((LONGINT)(1))); + } else if (__IN(f, 0x63fe) || __IN(x->typ->comp, 0x14)) { + (*OPB_typSize)(x->typ); + x->typ->pvused = 1; + x = OPB_NewIntConst(x->typ->size); + } else { + OPB_err(111); + x = OPB_NewIntConst(((LONGINT)(1))); + } + break; + case 21: + OPB_MOp(25, &x); + break; + case 22: case 23: + if (x->class == 8 || x->class == 9) { + OPB_err(126); + } else if (!__IN(f, 0x027a)) { + OPB_err(111); + } + break; + case 24: case 25: case 28: case 31: + if (x->class == 8 || x->class == 9) { + OPB_err(126); + } else if ((x->class == 7 && __IN(f, 0x30))) { + OPB_Convert(&x, OPT_linttyp); + } else if (!__IN(f, 0x2040)) { + OPB_err(111); + x->typ = OPT_linttyp; + } + break; + case 26: case 27: + if ((__IN(f, 0x70) && x->class == 7)) { + if (x->conval->intval < 0 || x->conval->intval > -1) { + OPB_err(220); + } + } else { + OPB_err(69); + } + break; + case 29: + if (x->class != 8) { + OPB_err(110); + } else if (__IN(f, 0x1401) || x->typ->comp == 3) { + OPB_err(111); + } + break; + case 30: + if (OPB_NotVar(x)) { + OPB_err(112); + } else if (f == 13) { + } else { + OPB_err(111); + } + break; + case 32: + if (x->class == 8 || x->class == 9) { + OPB_err(126); + x = OPB_NewBoolConst(0); + } else if (f != 2) { + OPB_err(120); + x = OPB_NewBoolConst(0); + } else { + OPB_MOp(33, &x); + } + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPB.StPar0, fctno = ", (LONGINT)39); + OPM_LogWNum(fctno, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + *par0 = x; +} + +static struct StPar1__52 { + struct StPar1__52 *lnk; +} *StPar1__52_s; + +static OPT_Node NewOp__53 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right); + +static OPT_Node NewOp__53 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right) +{ + OPT_Node _o_result; + OPT_Node node = NIL; + node = OPT_NewNode(class); + node->subcl = subcl; + node->left = left; + node->right = right; + _o_result = node; + return _o_result; +} + +void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) +{ + INTEGER f, L; + OPT_Struct typ = NIL; + OPT_Node p = NIL, t = NIL; + struct StPar1__52 _s; + _s.lnk = StPar1__52_s; + StPar1__52_s = &_s; + p = *par0; + f = x->typ->form; + switch (fctno) { + case 13: case 14: + if (x->class == 8 || x->class == 9) { + OPB_err(126); + p->typ = OPT_notyp; + } else { + if (x->typ != p->typ) { + if ((x->class == 7 && __IN(f, 0x70))) { + OPB_Convert(&x, p->typ); + } else { + OPB_err(111); + } + } + p = NewOp__53(19, fctno, p, x); + p->typ = OPT_notyp; + } + break; + case 15: case 16: + if (x->class == 8 || x->class == 9) { + OPB_err(126); + } else if (__IN(f, 0x70)) { + if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > (LONGINT)OPM_MaxSet))) { + OPB_err(202); + } + p = NewOp__53(19, fctno, p, x); + } else { + OPB_err(111); + } + p->typ = OPT_notyp; + break; + case 17: + if (!__IN(f, 0x70) || x->class != 7) { + OPB_err(69); + } else if (f == 4) { + L = (int)x->conval->intval; + typ = p->typ; + while ((L > 0 && __IN(typ->comp, 0x0c))) { + typ = typ->BaseTyp; + L -= 1; + } + if (L != 0 || !__IN(typ->comp, 0x0c)) { + OPB_err(132); + } else { + x->obj = NIL; + if (typ->comp == 3) { + while (p->class == 4) { + p = p->left; + x->conval->intval += 1; + } + p = NewOp__53(12, 19, p, x); + p->typ = OPT_linttyp; + } else { + p = x; + p->conval->intval = typ->n; + OPB_SetIntType(p); + } + } + } else { + OPB_err(132); + } + break; + case 18: + if (OPB_NotVar(x)) { + OPB_err(112); + } else if ((__IN(x->typ->comp, 0x0c) && x->typ->BaseTyp->form == 3)) { + if (x->readonly) { + OPB_err(76); + } + t = x; + x = p; + p = t; + p = NewOp__53(19, 18, p, x); + } else { + OPB_err(111); + } + p->typ = OPT_notyp; + break; + case 19: + if (x->class == 8 || x->class == 9) { + OPB_err(126); + } else if (__IN(f, 0x70)) { + if ((p->class == 7 && x->class == 7)) { + if (-OPB_maxExp > x->conval->intval || x->conval->intval > OPB_maxExp) { + OPB_err(208); + p->conval->intval = 1; + } else if (x->conval->intval >= 0) { + if (__ABS(p->conval->intval) <= __DIV(9223372036854775807, __ASH(1, x->conval->intval))) { + p->conval->intval = p->conval->intval * __ASH(1, x->conval->intval); + } else { + OPB_err(208); + p->conval->intval = 1; + } + } else { + p->conval->intval = __ASH(p->conval->intval, x->conval->intval); + } + p->obj = NIL; + } else { + p = NewOp__53(12, 17, p, x); + p->typ = OPT_linttyp; + } + } else { + OPB_err(111); + } + break; + case 1: + if (x->class == 8 || x->class == 9) { + OPB_err(126); + } else if (p->typ->comp == 3) { + if (__IN(f, 0x70)) { + if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > OPM_MaxIndex))) { + OPB_err(63); + } + } else { + OPB_err(111); + } + p->right = x; + p->typ = p->typ->BaseTyp; + } else { + OPB_err(64); + } + break; + case 22: case 23: + if (x->class == 8 || x->class == 9) { + OPB_err(126); + } else if (!__IN(f, 0x70)) { + OPB_err(111); + } else { + if (fctno == 22) { + p = NewOp__53(12, 27, p, x); + } else { + p = NewOp__53(12, 28, p, x); + } + p->typ = p->left->typ; + } + break; + case 24: case 25: case 26: case 27: + if (x->class == 8 || x->class == 9) { + OPB_err(126); + } else if (__IN(f, 0x63ff)) { + if (fctno == 24 || fctno == 26) { + if (OPB_NotVar(x)) { + OPB_err(112); + } + t = x; + x = p; + p = t; + } + p = NewOp__53(19, fctno, p, x); + } else { + OPB_err(111); + } + p->typ = OPT_notyp; + break; + case 28: + if (x->class == 8 || x->class == 9) { + OPB_err(126); + } else if (__IN(f, 0x70)) { + p = NewOp__53(12, 26, p, x); + } else { + OPB_err(111); + } + p->typ = OPT_booltyp; + break; + case 29: + if (((x->class == 8 || x->class == 9) || __IN(f, 0x1401)) || x->typ->comp == 3) { + OPB_err(126); + } + t = OPT_NewNode(11); + t->subcl = 29; + t->left = x; + x = t; + x->typ = p->typ; + p = x; + break; + case 30: + if (x->class == 8 || x->class == 9) { + OPB_err(126); + } else if (__IN(f, 0x70)) { + p = NewOp__53(19, 30, p, x); + } else { + OPB_err(111); + } + p->typ = OPT_notyp; + break; + case 31: + if (x->class == 8 || x->class == 9) { + OPB_err(126); + } else if ((x->class == 7 && __IN(f, 0x30))) { + OPB_Convert(&x, OPT_linttyp); + } else if (!__IN(f, 0x2040)) { + OPB_err(111); + x->typ = OPT_linttyp; + } + p->link = x; + break; + case 32: + if ((__IN(f, 0x70) && x->class == 7)) { + if ((0 <= x->conval->intval && x->conval->intval <= 255)) { + OPB_BindNodes(28, OPT_notyp, &x, x); + x->conval = OPT_NewConst(); + x->conval->intval = OPM_errpos; + OPB_Construct(15, &p, x); + p->conval = OPT_NewConst(); + p->conval->intval = OPM_errpos; + OPB_Construct(20, &p, NIL); + OPB_OptIf(&p); + if (p == NIL) { + } else if (p->class == 28) { + OPB_err(99); + } else { + p->subcl = 32; + } + } else { + OPB_err(218); + } + } else { + OPB_err(69); + } + break; + default: + OPB_err(64); + break; + } + *par0 = p; + StPar1__52_s = _s.lnk; +} + +void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n) +{ + OPT_Node node = NIL; + INTEGER f; + OPT_Node p = NIL; + p = *par0; + f = x->typ->form; + if (fctno == 1) { + if (x->class == 8 || x->class == 9) { + OPB_err(126); + } else if (p->typ->comp != 3) { + OPB_err(64); + } else if (__IN(f, 0x70)) { + if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > OPM_MaxIndex))) { + OPB_err(63); + } + node = p->right; + while (node->link != NIL) { + node = node->link; + } + node->link = x; + p->typ = p->typ->BaseTyp; + } else { + OPB_err(111); + } + } else if ((fctno == 31 && n == 2)) { + if (x->class == 8 || x->class == 9) { + OPB_err(126); + } else if (__IN(f, 0x70)) { + node = OPT_NewNode(19); + node->subcl = 31; + node->right = p; + node->left = p->link; + p->link = x; + p = node; + } else { + OPB_err(111); + } + p->typ = OPT_notyp; + } else { + OPB_err(64); + } + *par0 = p; +} + +void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno) +{ + INTEGER dim; + OPT_Node x = NIL, p = NIL; + p = *par0; + if (fctno <= 19) { + if ((fctno == 1 && p->typ != OPT_notyp)) { + if (p->typ->comp == 3) { + OPB_err(65); + } + p->typ = OPT_notyp; + } else if (fctno <= 12) { + if (parno < 1) { + OPB_err(65); + } + } else { + if (((fctno == 13 || fctno == 14) && parno == 1)) { + OPB_BindNodes(19, OPT_notyp, &p, OPB_NewIntConst(((LONGINT)(1)))); + p->subcl = fctno; + p->right->typ = p->left->typ; + } else if ((fctno == 17 && parno == 1)) { + if (p->typ->comp == 3) { + dim = 0; + while (p->class == 4) { + p = p->left; + dim += 1; + } + OPB_BindNodes(12, OPT_linttyp, &p, OPB_NewIntConst(dim)); + p->subcl = 19; + } else { + p = OPB_NewIntConst(p->typ->n); + } + } else if (parno < 2) { + OPB_err(65); + } + } + } else if (fctno == 32) { + if (parno == 1) { + x = NIL; + OPB_BindNodes(28, OPT_notyp, &x, OPB_NewIntConst(((LONGINT)(0)))); + x->conval = OPT_NewConst(); + x->conval->intval = OPM_errpos; + OPB_Construct(15, &p, x); + p->conval = OPT_NewConst(); + p->conval->intval = OPM_errpos; + OPB_Construct(20, &p, NIL); + OPB_OptIf(&p); + if (p == NIL) { + } else if (p->class == 28) { + OPB_err(99); + } else { + p->subcl = 32; + } + } else if (parno < 1) { + OPB_err(65); + } + } else { + if ((parno < 1 || (fctno > 21 && parno < 2)) || (fctno == 31 && parno < 3)) { + OPB_err(65); + } + } + *par0 = p; +} + +static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpar) +{ + INTEGER f; + f = atyp->comp; + ftyp = ftyp->BaseTyp; + atyp = atyp->BaseTyp; + if ((fvarpar && ftyp == OPT_bytetyp)) { + if (!__IN(f, 0x0c) || !__IN(atyp->form, 0x1e)) { + if (__IN(18, OPM_opt)) { + OPB_err(-301); + } + } + } else if (__IN(f, 0x0c)) { + if (ftyp->comp == 3) { + OPB_DynArrParCheck(ftyp, atyp, fvarpar); + } else if (ftyp != atyp) { + if ((((!fvarpar && ftyp->form == 13)) && atyp->form == 13)) { + ftyp = ftyp->BaseTyp; + atyp = atyp->BaseTyp; + if ((ftyp->comp == 4 && atyp->comp == 4)) { + while ((((ftyp != atyp && atyp != NIL)) && atyp != OPT_undftyp)) { + atyp = atyp->BaseTyp; + } + if (atyp == NIL) { + OPB_err(113); + } + } else { + OPB_err(66); + } + } else { + OPB_err(66); + } + } + } else { + OPB_err(67); + } +} + +static void OPB_CheckReceiver (OPT_Node *x, OPT_Object fp) +{ + if (fp->typ->form == 13) { + if ((*x)->class == 3) { + *x = (*x)->left; + } else { + OPB_err(71); + } + } +} + +void OPB_PrepCall (OPT_Node *x, OPT_Object *fpar) +{ + if (((*x)->obj != NIL && __IN((*x)->obj->mode, 0x22c0))) { + *fpar = (*x)->obj->link; + if ((*x)->obj->mode == 13) { + OPB_CheckReceiver(&(*x)->left, *fpar); + *fpar = (*fpar)->link; + } + } else if (((((*x)->class != 8 && (*x)->typ != NIL)) && (*x)->typ->form == 14)) { + *fpar = (*x)->typ->link; + } else { + OPB_err(121); + *fpar = NIL; + (*x)->typ = OPT_undftyp; + } +} + +void OPB_Param (OPT_Node ap, OPT_Object fp) +{ + OPT_Struct q = NIL; + if (fp->typ->form != 0) { + if (fp->mode == 2) { + if (OPB_NotVar(ap)) { + OPB_err(122); + } else { + OPB_CheckLeaf(ap, 0); + } + if (ap->readonly) { + OPB_err(76); + } + if (fp->typ->comp == 3) { + OPB_DynArrParCheck(fp->typ, ap->typ, 1); + } else if ((fp->typ->comp == 4 && ap->typ->comp == 4)) { + q = ap->typ; + while ((((q != fp->typ && q != NIL)) && q != OPT_undftyp)) { + q = q->BaseTyp; + } + if (q == NIL) { + OPB_err(111); + } + } else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 13)) { + } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && __IN(ap->typ->form, 0x18))))) { + OPB_err(123); + } else if ((fp->typ->form == 13 && ap->class == 5)) { + OPB_err(123); + } + } else if (fp->typ->comp == 3) { + if ((ap->class == 7 && ap->typ->form == 3)) { + OPB_CharToString(ap); + } + if ((ap->typ->form == 10 && fp->typ->BaseTyp->form == 3)) { + } else if (ap->class >= 7) { + OPB_err(59); + } else { + OPB_DynArrParCheck(fp->typ, ap->typ, 0); + } + } else { + OPB_CheckAssign(fp->typ, ap); + } + } +} + +void OPB_StaticLink (SHORTINT dlev) +{ + OPT_Object scope = NIL; + scope = OPT_topScope; + while (dlev > 0) { + dlev -= 1; + scope->link->conval->setval |= __SETOF(3); + scope = scope->left; + } +} + +void OPB_Call (OPT_Node *x, OPT_Node apar, OPT_Object fp) +{ + OPT_Struct typ = NIL; + OPT_Node p = NIL; + SHORTINT lev; + if ((*x)->class == 9) { + typ = (*x)->typ; + lev = (*x)->obj->mnolev; + if (lev > 0) { + OPB_StaticLink(OPT_topScope->mnolev - lev); + } + if ((*x)->obj->mode == 10) { + OPB_err(121); + } + } else if (((*x)->class == 2 && (*x)->obj->mode == 13)) { + typ = (*x)->typ; + (*x)->class = 9; + p = (*x)->left; + (*x)->left = NIL; + p->link = apar; + apar = p; + fp = (*x)->obj->link; + } else { + typ = (*x)->typ->BaseTyp; + } + OPB_BindNodes(13, typ, &*x, apar); + (*x)->obj = fp; +} + +void OPB_Enter (OPT_Node *procdec, OPT_Node stat, OPT_Object proc) +{ + OPT_Node x = NIL; + x = OPT_NewNode(18); + x->typ = OPT_notyp; + x->obj = proc; + x->left = *procdec; + x->right = stat; + *procdec = x; +} + +void OPB_Return (OPT_Node *x, OPT_Object proc) +{ + OPT_Node node = NIL; + if (proc == NIL) { + if (*x != NIL) { + OPB_err(124); + } + } else { + if (*x != NIL) { + OPB_CheckAssign(proc->typ, *x); + } else if (proc->typ != OPT_notyp) { + OPB_err(124); + } + } + node = OPT_NewNode(26); + node->typ = OPT_notyp; + node->obj = proc; + node->left = *x; + *x = node; +} + +void OPB_Assign (OPT_Node *x, OPT_Node y) +{ + OPT_Node z = NIL; + SHORTINT subcl; + if ((*x)->class >= 7) { + OPB_err(56); + } + OPB_CheckAssign((*x)->typ, y); + if ((*x)->readonly) { + OPB_err(76); + } + if ((*x)->typ->comp == 4) { + if ((*x)->class == 5) { + z = (*x)->left; + } else { + z = *x; + } + if ((z->class == 3 && z->left->class == 5)) { + z->left = z->left->left; + } + if (((*x)->typ->strobj != NIL && (z->class == 3 || z->class == 1))) { + OPB_BindNodes(6, (*x)->typ, &z, NIL); + *x = z; + } + } else if (((((((*x)->typ->comp == 2 && (*x)->typ->BaseTyp == OPT_chartyp)) && y->typ->form == 10)) && y->conval->intval2 == 1)) { + y->typ = OPT_chartyp; + y->conval->intval = 0; + OPB_Index(&*x, OPB_NewIntConst(((LONGINT)(0)))); + } + if ((((((__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp == OPT_chartyp)) && __IN(y->typ->comp, 0x0c))) && y->typ->BaseTyp == OPT_chartyp)) { + subcl = 18; + } else { + subcl = 0; + } + OPB_BindNodes(19, OPT_notyp, &*x, y); + (*x)->subcl = subcl; +} + +void OPB_Inittd (OPT_Node *inittd, OPT_Node *last, OPT_Struct typ) +{ + OPT_Node node = NIL; + node = OPT_NewNode(14); + node->typ = typ; + node->conval = OPT_NewConst(); + node->conval->intval = typ->txtpos; + if (*inittd == NIL) { + *inittd = node; + } else { + (*last)->link = node; + } + *last = node; +} + + +export void *OPB__init(void) +{ + __DEFMOD; + __MODULE_IMPORT(OPM); + __MODULE_IMPORT(OPS); + __MODULE_IMPORT(OPT); + __REGMOD("OPB", 0); +/* BEGIN */ + OPB_maxExp = OPB_log(4611686018427387904); + OPB_maxExp = OPB_exp; + __ENDMOD; +} diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h new file mode 100644 index 00000000..c8165f54 --- /dev/null +++ b/bootstrap/unix-88/OPB.h @@ -0,0 +1,50 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ + +#ifndef OPB__h +#define OPB__h + +#define LARGE +#include "SYSTEM.h" +#include "OPS.h" +#include "OPT.h" + + +import void (*OPB_typSize)(OPT_Struct); + + +import void OPB_Assign (OPT_Node *x, OPT_Node y); +import void OPB_Call (OPT_Node *x, OPT_Node apar, OPT_Object fp); +import void OPB_CheckParameters (OPT_Object fp, OPT_Object ap, BOOLEAN checkNames); +import void OPB_Construct (SHORTINT class, OPT_Node *x, OPT_Node y); +import void OPB_DeRef (OPT_Node *x); +import OPT_Node OPB_EmptySet (void); +import void OPB_Enter (OPT_Node *procdec, OPT_Node stat, OPT_Object proc); +import void OPB_Field (OPT_Node *x, OPT_Object y); +import void OPB_In (OPT_Node *x, OPT_Node y); +import void OPB_Index (OPT_Node *x, OPT_Node y); +import void OPB_Inittd (OPT_Node *inittd, OPT_Node *last, OPT_Struct typ); +import void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y); +import void OPB_MOp (SHORTINT op, OPT_Node *x); +import OPT_Node OPB_NewBoolConst (BOOLEAN boolval); +import OPT_Node OPB_NewIntConst (LONGINT intval); +import OPT_Node OPB_NewLeaf (OPT_Object obj); +import OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ); +import OPT_Node OPB_NewString (OPS_String str, LONGINT len); +import OPT_Node OPB_Nil (void); +import void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y); +import void OPB_OptIf (OPT_Node *x); +import void OPB_Param (OPT_Node ap, OPT_Object fp); +import void OPB_PrepCall (OPT_Node *x, OPT_Object *fpar); +import void OPB_Return (OPT_Node *x, OPT_Object proc); +import void OPB_SetElem (OPT_Node *x); +import void OPB_SetRange (OPT_Node *x, OPT_Node y); +import void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno); +import void OPB_StPar0 (OPT_Node *par0, INTEGER fctno); +import void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno); +import void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n); +import void OPB_StaticLink (SHORTINT dlev); +import void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard); +import void *OPB__init(void); + + +#endif diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c new file mode 100644 index 00000000..10468b9e --- /dev/null +++ b/bootstrap/unix-88/OPC.c @@ -0,0 +1,2109 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +#define LARGE +#include "SYSTEM.h" +#include "Configuration.h" +#include "OPM.h" +#include "OPT.h" + + +static INTEGER OPC_indentLevel; +static BOOLEAN OPC_ptrinit, OPC_mainprog, OPC_ansi; +static SHORTINT OPC_hashtab[105]; +static CHAR OPC_keytab[36][9]; +static BOOLEAN OPC_GlbPtrs; +static CHAR OPC_BodyNameExt[13]; + + +export void OPC_Align (LONGINT *adr, LONGINT base); +export void OPC_Andent (OPT_Struct typ); +static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames); +export LONGINT OPC_Base (OPT_Struct typ); +export OPT_Object OPC_BaseTProc (OPT_Object obj); +export void OPC_BegBlk (void); +export void OPC_BegStat (void); +static void OPC_CProcDefs (OPT_Object obj, INTEGER vis); +export void OPC_Case (LONGINT caseVal, INTEGER form); +export void OPC_Cmp (INTEGER rel); +export void OPC_CompleteIdent (OPT_Object obj); +export void OPC_Constant (OPT_Const con, INTEGER form); +static void OPC_DeclareBase (OPT_Object dcl); +static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef); +static void OPC_DeclareParams (OPT_Object par, BOOLEAN macro); +static void OPC_DeclareTProcs (OPT_Object obj, BOOLEAN *empty); +static void OPC_DefAnonRecs (OPT_Node n); +export void OPC_DefineInter (OPT_Object proc); +static void OPC_DefineTProcMacros (OPT_Object obj, BOOLEAN *empty); +static void OPC_DefineTProcTypes (OPT_Object obj); +static void OPC_DefineType (OPT_Struct str); +export void OPC_EndBlk (void); +export void OPC_EndBlk0 (void); +export void OPC_EndStat (void); +export void OPC_EnterBody (void); +export void OPC_EnterProc (OPT_Object proc); +export void OPC_ExitBody (void); +export void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet); +static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, LONGINT *off, LONGINT *n, LONGINT *curAlign); +static void OPC_FillGap (LONGINT gap, LONGINT off, LONGINT align, LONGINT *n, LONGINT *curAlign); +export void OPC_GenBdy (OPT_Node n); +static void OPC_GenDynTypes (OPT_Node n, INTEGER vis); +export void OPC_GenEnumPtrs (OPT_Object var); +export void OPC_GenHdr (OPT_Node n); +export void OPC_GenHdrIncludes (void); +static void OPC_GenHeaderMsg (void); +export void OPC_Halt (LONGINT n); +export void OPC_Ident (OPT_Object obj); +static void OPC_IdentList (OPT_Object obj, INTEGER vis); +static void OPC_Include (CHAR *name, LONGINT name__len); +static void OPC_IncludeImports (OPT_Object obj, INTEGER vis); +export void OPC_Increment (BOOLEAN decrement); +export void OPC_Indent (INTEGER count); +export void OPC_Init (void); +static void OPC_InitImports (OPT_Object obj); +static void OPC_InitKeywords (void); +export void OPC_InitTDesc (OPT_Struct typ); +static void OPC_InitTProcs (OPT_Object typ, OPT_Object obj); +export void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim); +static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName); +static INTEGER OPC_Length (CHAR *s, LONGINT s__len); +export LONGINT OPC_NofPtrs (OPT_Struct typ); +static INTEGER OPC_PerfectHash (CHAR *s, LONGINT s__len); +static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len); +static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define); +static void OPC_ProcPredefs (OPT_Object obj, SHORTINT vis); +static void OPC_PutBase (OPT_Struct typ); +static void OPC_PutPtrOffsets (OPT_Struct typ, LONGINT adr, LONGINT *cnt); +static void OPC_RegCmds (OPT_Object obj); +export void OPC_SetInclude (BOOLEAN exclude); +static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause); +static void OPC_Str1 (CHAR *s, LONGINT s__len, LONGINT x); +export void OPC_TDescDecl (OPT_Struct typ); +export void OPC_TypeDefs (OPT_Object obj, INTEGER vis); +export void OPC_TypeOf (OPT_Object ap); +static BOOLEAN OPC_Undefined (OPT_Object obj); + + +void OPC_Init (void) +{ + OPC_indentLevel = 0; + OPC_ptrinit = __IN(5, OPM_opt); + OPC_mainprog = OPM_mainProg || OPM_mainLinkStat; + OPC_ansi = __IN(6, OPM_opt); + if (OPC_ansi) { + __MOVE("__init(void)", OPC_BodyNameExt, 13); + } else { + __MOVE("__init()", OPC_BodyNameExt, 9); + } +} + +void OPC_Indent (INTEGER count) +{ + OPC_indentLevel += count; +} + +void OPC_BegStat (void) +{ + INTEGER i; + i = OPC_indentLevel; + while (i > 0) { + OPM_Write(0x09); + i -= 1; + } +} + +void OPC_EndStat (void) +{ + OPM_Write(';'); + OPM_WriteLn(); +} + +void OPC_BegBlk (void) +{ + OPM_Write('{'); + OPM_WriteLn(); + OPC_indentLevel += 1; +} + +void OPC_EndBlk (void) +{ + OPC_indentLevel -= 1; + OPC_BegStat(); + OPM_Write('}'); + OPM_WriteLn(); +} + +void OPC_EndBlk0 (void) +{ + OPC_indentLevel -= 1; + OPC_BegStat(); + OPM_Write('}'); +} + +static void OPC_Str1 (CHAR *s, LONGINT s__len, LONGINT x) +{ + CHAR ch; + INTEGER i; + __DUP(s, s__len, CHAR); + ch = s[0]; + i = 0; + while (ch != 0x00) { + if (ch == '#') { + OPM_WriteInt(x); + } else { + OPM_Write(ch); + } + i += 1; + ch = s[__X(i, s__len)]; + } + __DEL(s); +} + +static INTEGER OPC_Length (CHAR *s, LONGINT s__len) +{ + INTEGER _o_result; + INTEGER i; + i = 0; + while (s[__X(i, s__len)] != 0x00) { + i += 1; + } + _o_result = i; + return _o_result; +} + +static INTEGER OPC_PerfectHash (CHAR *s, LONGINT s__len) +{ + INTEGER _o_result; + INTEGER i, h; + i = 0; + h = 0; + while ((s[__X(i, s__len)] != 0x00 && i < 5)) { + h = 3 * h + (int)s[__X(i, s__len)]; + i += 1; + } + _o_result = (int)__MOD(h, 105); + return _o_result; +} + +void OPC_Ident (OPT_Object obj) +{ + INTEGER mode, level, h; + mode = obj->mode; + level = obj->mnolev; + if ((__IN(mode, 0x62) && level > 0) || __IN(mode, 0x14)) { + OPM_WriteStringVar((void*)obj->name, ((LONGINT)(256))); + h = OPC_PerfectHash((void*)obj->name, ((LONGINT)(256))); + if (OPC_hashtab[__X(h, ((LONGINT)(105)))] >= 0) { + if (__STRCMP(OPC_keytab[__X(OPC_hashtab[__X(h, ((LONGINT)(105)))], ((LONGINT)(36)))], obj->name) == 0) { + OPM_Write('_'); + } + } + } else { + if (mode != 5 || obj->linkadr != 2) { + if (mode == 13) { + OPC_Ident(obj->link->typ->strobj); + } else if (level < 0) { + OPM_WriteStringVar((void*)OPT_GlbMod[__X(-level, ((LONGINT)(64)))]->name, ((LONGINT)(256))); + if (OPM_currFile == 0) { + OPT_GlbMod[__X(-level, ((LONGINT)(64)))]->vis = 1; + } + } else { + OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); + } + OPM_Write('_'); + } else if (obj == OPT_sysptrtyp->strobj || obj == OPT_bytetyp->strobj) { + OPM_WriteString((CHAR*)"SYSTEM_", (LONGINT)8); + } + OPM_WriteStringVar((void*)obj->name, ((LONGINT)(256))); + } +} + +static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause) +{ + INTEGER pointers; + *openClause = 0; + if (((typ->strobj == NIL || typ->strobj->name[0] == 0x00) && typ->comp != 4)) { + if (__IN(typ->comp, 0x0c)) { + OPC_Stars(typ->BaseTyp, &*openClause); + *openClause = typ->comp == 2; + } else if (typ->form == 14) { + OPM_Write('('); + OPM_Write('*'); + } else { + pointers = 0; + while (((typ->strobj == NIL || typ->strobj->name[0] == 0x00) && typ->form == 13)) { + pointers += 1; + typ = typ->BaseTyp; + } + if (pointers > 0) { + if (typ->comp != 3) { + OPC_Stars(typ, &*openClause); + } + if (*openClause) { + OPM_Write('('); + *openClause = 0; + } + while (pointers > 0) { + OPM_Write('*'); + pointers -= 1; + } + } + } + } +} + +static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef) +{ + OPT_Struct typ = NIL; + BOOLEAN varPar, openClause; + INTEGER form, comp; + typ = dcl->typ; + varPar = ((dcl->mode == 2 && typ->comp != 2) || typ->comp == 3) || scopeDef; + OPC_Stars(typ, &openClause); + if (varPar) { + if (openClause) { + OPM_Write('('); + } + OPM_Write('*'); + } + if (dcl->name[0] != 0x00) { + OPC_Ident(dcl); + } + if ((varPar && openClause)) { + OPM_Write(')'); + } + openClause = 0; + for (;;) { + form = typ->form; + comp = typ->comp; + if (((typ->strobj != NIL && typ->strobj->name[0] != 0x00) || form == 12) || comp == 4) { + break; + } else if ((form == 13 && typ->BaseTyp->comp != 3)) { + openClause = 1; + } else if (form == 14 || __IN(comp, 0x0c)) { + if (openClause) { + OPM_Write(')'); + openClause = 0; + } + if (form == 14) { + if (OPC_ansi) { + OPM_Write(')'); + OPC_AnsiParamList(typ->link, 0); + } else { + OPM_WriteString((CHAR*)")()", (LONGINT)4); + } + break; + } else if (comp == 2) { + OPM_Write('['); + OPM_WriteInt(typ->n); + OPM_Write(']'); + } + } else { + break; + } + typ = typ->BaseTyp; + } +} + +void OPC_Andent (OPT_Struct typ) +{ + if (typ->strobj == NIL || typ->align >= 65536) { + OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); + OPC_Str1((CHAR*)"__#", (LONGINT)4, __ASHR(typ->align, 16)); + } else { + OPC_Ident(typ->strobj); + } +} + +static BOOLEAN OPC_Undefined (OPT_Object obj) +{ + BOOLEAN _o_result; + _o_result = (((obj->mnolev >= 0 && obj->linkadr != (LONGINT)(3 + OPM_currFile))) && obj->linkadr != 2) || obj->name[0] == 0x00; + return _o_result; +} + +static void OPC_DeclareBase (OPT_Object dcl) +{ + OPT_Struct typ = NIL, prev = NIL; + OPT_Object obj = NIL; + INTEGER nofdims; + LONGINT off, n, dummy; + typ = dcl->typ; + prev = typ; + while ((((((((typ->strobj == NIL || typ->comp == 3) || OPC_Undefined(typ->strobj)) && typ->comp != 4)) && typ->form != 12)) && !((typ->form == 13 && typ->BaseTyp->comp == 3)))) { + prev = typ; + typ = typ->BaseTyp; + } + obj = typ->strobj; + if (typ->form == 12) { + OPM_WriteString((CHAR*)"void", (LONGINT)5); + } else if ((obj != NIL && !OPC_Undefined(obj))) { + OPC_Ident(obj); + } else if (typ->comp == 4) { + OPM_WriteString((CHAR*)"struct ", (LONGINT)8); + OPC_Andent(typ); + if ((prev->form != 13 && (obj != NIL || dcl->name[0] == 0x00))) { + if ((typ->BaseTyp != NIL && typ->BaseTyp->strobj->vis != 0)) { + OPM_WriteString((CHAR*)" { /* ", (LONGINT)7); + OPC_Ident(typ->BaseTyp->strobj); + OPM_WriteString((CHAR*)" */", (LONGINT)4); + OPM_WriteLn(); + OPC_Indent(1); + } else { + OPM_Write(' '); + OPC_BegBlk(); + } + OPC_FieldList(typ, 1, &off, &n, &dummy); + OPC_EndBlk0(); + } + } else if ((typ->form == 13 && typ->BaseTyp->comp == 3)) { + typ = typ->BaseTyp->BaseTyp; + nofdims = 1; + while (typ->comp == 3) { + nofdims += 1; + typ = typ->BaseTyp; + } + OPM_WriteString((CHAR*)"struct ", (LONGINT)8); + OPC_BegBlk(); + OPC_BegStat(); + OPC_Str1((CHAR*)"LONGINT len[#]", (LONGINT)15, nofdims); + OPC_EndStat(); + OPC_BegStat(); + __NEW(obj, OPT_ObjDesc); + __NEW(obj->typ, OPT_StrDesc); + obj->typ->form = 15; + obj->typ->comp = 2; + obj->typ->n = 1; + obj->typ->BaseTyp = typ; + obj->mode = 4; + __MOVE("data", obj->name, 5); + obj->linkadr = 0; + OPC_DeclareBase(obj); + OPM_Write(' '); + OPC_DeclareObj(obj, 0); + OPC_EndStat(); + OPC_EndBlk0(); + } +} + +LONGINT OPC_NofPtrs (OPT_Struct typ) +{ + LONGINT _o_result; + OPT_Object fld = NIL; + OPT_Struct btyp = NIL; + LONGINT n; + if ((typ->form == 13 && typ->sysflag == 0)) { + _o_result = 1; + return _o_result; + } else if ((typ->comp == 4 && __MASK(typ->sysflag, -256) == 0)) { + btyp = typ->BaseTyp; + if (btyp != NIL) { + n = OPC_NofPtrs(btyp); + } else { + n = 0; + } + fld = typ->link; + while ((fld != NIL && fld->mode == 4)) { + if (__STRCMP(fld->name, "@ptr") != 0) { + n = n + OPC_NofPtrs(fld->typ); + } else { + n += 1; + } + fld = fld->link; + } + _o_result = n; + return _o_result; + } else if (typ->comp == 2) { + btyp = typ->BaseTyp; + n = typ->n; + while (btyp->comp == 2) { + n = btyp->n * n; + btyp = btyp->BaseTyp; + } + _o_result = OPC_NofPtrs(btyp) * n; + return _o_result; + } else { + _o_result = 0; + return _o_result; + } + __RETCHK; +} + +static void OPC_PutPtrOffsets (OPT_Struct typ, LONGINT adr, LONGINT *cnt) +{ + OPT_Object fld = NIL; + OPT_Struct btyp = NIL; + LONGINT n, i; + if ((typ->form == 13 && typ->sysflag == 0)) { + OPM_WriteInt(adr); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + *cnt += 1; + if (__MASK(*cnt, -16) == 0) { + OPM_WriteLn(); + OPM_Write(0x09); + } + } else if ((typ->comp == 4 && __MASK(typ->sysflag, -256) == 0)) { + btyp = typ->BaseTyp; + if (btyp != NIL) { + OPC_PutPtrOffsets(btyp, adr, &*cnt); + } + fld = typ->link; + while ((fld != NIL && fld->mode == 4)) { + if (__STRCMP(fld->name, "@ptr") != 0) { + OPC_PutPtrOffsets(fld->typ, adr + fld->adr, &*cnt); + } else { + OPM_WriteInt(adr + fld->adr); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + *cnt += 1; + if (__MASK(*cnt, -16) == 0) { + OPM_WriteLn(); + OPM_Write(0x09); + } + } + fld = fld->link; + } + } else if (typ->comp == 2) { + btyp = typ->BaseTyp; + n = typ->n; + while (btyp->comp == 2) { + n = btyp->n * n; + btyp = btyp->BaseTyp; + } + if (OPC_NofPtrs(btyp) > 0) { + i = 0; + while (i < n) { + OPC_PutPtrOffsets(btyp, adr + i * btyp->size, &*cnt); + i += 1; + } + } + } +} + +static void OPC_InitTProcs (OPT_Object typ, OPT_Object obj) +{ + if (obj != NIL) { + OPC_InitTProcs(typ, obj->left); + if (obj->mode == 13) { + OPC_BegStat(); + OPM_WriteString((CHAR*)"__INITBP(", (LONGINT)10); + OPC_Ident(typ); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPC_Ident(obj); + OPC_Str1((CHAR*)", #)", (LONGINT)5, __ASHR(obj->adr, 16)); + OPC_EndStat(); + } + OPC_InitTProcs(typ, obj->right); + } +} + +static void OPC_PutBase (OPT_Struct typ) +{ + if (typ != NIL) { + OPC_PutBase(typ->BaseTyp); + OPC_Ident(typ->strobj); + OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + } +} + +static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName) +{ + OPT_Struct typ = NIL; + INTEGER dim; + if (showParamName) { + OPC_Ident(par); + OPM_WriteString((CHAR*)"__len", (LONGINT)6); + } + dim = 1; + typ = par->typ->BaseTyp; + while (typ->comp == 3) { + if (ansiDefine) { + OPM_WriteString((CHAR*)", LONGINT ", (LONGINT)11); + } else { + OPM_WriteString((CHAR*)", ", (LONGINT)3); + } + if (showParamName) { + OPC_Ident(par); + OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteInt(dim); + } + typ = typ->BaseTyp; + dim += 1; + } +} + +static void OPC_DeclareParams (OPT_Object par, BOOLEAN macro) +{ + OPM_Write('('); + while (par != NIL) { + if (macro) { + OPM_WriteStringVar((void*)par->name, ((LONGINT)(256))); + } else { + if ((par->mode == 1 && par->typ->form == 7)) { + OPM_Write('_'); + } + OPC_Ident(par); + } + if (par->typ->comp == 3) { + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPC_LenList(par, 0, 1); + } else if ((par->mode == 2 && par->typ->comp == 4)) { + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteStringVar((void*)par->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + } + par = par->link; + if (par != NIL) { + OPM_WriteString((CHAR*)", ", (LONGINT)3); + } + } + OPM_Write(')'); +} + +static void OPC_DefineTProcTypes (OPT_Object obj) +{ + OPT_Object par = NIL; + if (obj->typ != OPT_notyp) { + OPC_DefineType(obj->typ); + } + if (OPC_ansi) { + par = obj->link; + while (par != NIL) { + OPC_DefineType(par->typ); + par = par->link; + } + } +} + +static void OPC_DeclareTProcs (OPT_Object obj, BOOLEAN *empty) +{ + if (obj != NIL) { + OPC_DeclareTProcs(obj->left, &*empty); + if (obj->mode == 13) { + if (obj->typ != OPT_notyp) { + OPC_DefineType(obj->typ); + } + if (OPM_currFile == 0) { + if (obj->vis == 1) { + OPC_DefineTProcTypes(obj); + OPM_WriteString((CHAR*)"import ", (LONGINT)8); + *empty = 0; + OPC_ProcHeader(obj, 0); + } + } else { + *empty = 0; + OPC_DefineTProcTypes(obj); + if (obj->vis == 0) { + OPM_WriteString((CHAR*)"static ", (LONGINT)8); + } else { + OPM_WriteString((CHAR*)"export ", (LONGINT)8); + } + OPC_ProcHeader(obj, 0); + } + } + OPC_DeclareTProcs(obj->right, &*empty); + } +} + +OPT_Object OPC_BaseTProc (OPT_Object obj) +{ + OPT_Object _o_result; + OPT_Struct typ = NIL, base = NIL; + LONGINT mno; + typ = obj->link->typ; + if (typ->form == 13) { + typ = typ->BaseTyp; + } + base = typ->BaseTyp; + mno = __ASHR(obj->adr, 16); + while ((base != NIL && mno < base->n)) { + typ = base; + base = typ->BaseTyp; + } + OPT_FindField(obj->name, typ, &obj); + _o_result = obj; + return _o_result; +} + +static void OPC_DefineTProcMacros (OPT_Object obj, BOOLEAN *empty) +{ + if (obj != NIL) { + OPC_DefineTProcMacros(obj->left, &*empty); + if ((((obj->mode == 13 && obj == OPC_BaseTProc(obj))) && (OPM_currFile != 0 || obj->vis == 1))) { + OPM_WriteString((CHAR*)"#define __", (LONGINT)11); + OPC_Ident(obj); + OPC_DeclareParams(obj->link, 1); + OPM_WriteString((CHAR*)" __SEND(", (LONGINT)9); + if (obj->link->typ->form == 13) { + OPM_WriteString((CHAR*)"__TYPEOF(", (LONGINT)10); + OPC_Ident(obj->link); + OPM_Write(')'); + } else { + OPC_Ident(obj->link); + OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + } + OPC_Str1((CHAR*)", #, ", (LONGINT)6, __ASHR(obj->adr, 16)); + if (obj->typ == OPT_notyp) { + OPM_WriteString((CHAR*)"void", (LONGINT)5); + } else { + OPC_Ident(obj->typ->strobj); + } + OPM_WriteString((CHAR*)"(*)", (LONGINT)4); + if (OPC_ansi) { + OPC_AnsiParamList(obj->link, 0); + } else { + OPM_WriteString((CHAR*)"()", (LONGINT)3); + } + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPC_DeclareParams(obj->link, 1); + OPM_Write(')'); + OPM_WriteLn(); + } + OPC_DefineTProcMacros(obj->right, &*empty); + } +} + +static void OPC_DefineType (OPT_Struct str) +{ + OPT_Object obj = NIL, field = NIL, par = NIL; + BOOLEAN empty; + if (OPM_currFile == 1 || str->ref < 255) { + obj = str->strobj; + if (obj == NIL || OPC_Undefined(obj)) { + if (obj != NIL) { + if (obj->linkadr == 1) { + if (str->form != 13) { + OPM_Mark(244, str->txtpos); + obj->linkadr = 2; + } + } else { + obj->linkadr = 1; + } + } + if (str->comp == 4) { + if (str->BaseTyp != NIL) { + OPC_DefineType(str->BaseTyp); + } + field = str->link; + while ((field != NIL && field->mode == 4)) { + if (field->vis != 0 || OPM_currFile == 1) { + OPC_DefineType(field->typ); + } + field = field->link; + } + } else if (str->form == 13) { + if (str->BaseTyp->comp != 4) { + OPC_DefineType(str->BaseTyp); + } + } else if (__IN(str->comp, 0x0c)) { + OPC_DefineType(str->BaseTyp); + } else if (str->form == 14) { + if (str->BaseTyp != OPT_notyp) { + OPC_DefineType(str->BaseTyp); + } + field = str->link; + while (field != NIL) { + OPC_DefineType(field->typ); + field = field->link; + } + } + } + if ((obj != NIL && OPC_Undefined(obj))) { + OPM_WriteString((CHAR*)"typedef", (LONGINT)8); + OPM_WriteLn(); + OPM_Write(0x09); + OPC_Indent(1); + obj->linkadr = 1; + OPC_DeclareBase(obj); + OPM_Write(' '); + obj->typ->strobj = NIL; + OPC_DeclareObj(obj, 0); + obj->typ->strobj = obj; + obj->linkadr = 3 + OPM_currFile; + OPC_EndStat(); + OPC_Indent(-1); + OPM_WriteLn(); + if (obj->typ->comp == 4) { + empty = 1; + OPC_DeclareTProcs(str->link, &empty); + OPC_DefineTProcMacros(str->link, &empty); + if (!empty) { + OPM_WriteLn(); + } + } + } + } +} + +static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len) +{ + BOOLEAN _o_result; + INTEGER i; + BOOLEAN r; + __DUP(y, y__len, CHAR); + i = 0; + while ((*x)[__X(i + 1, ((LONGINT)(256)))] == y[__X(i, y__len)]) { + i += 1; + } + r = y[__X(i, y__len)] == 0x00; + _o_result = r; + __DEL(y); + return _o_result; +} + +static void OPC_CProcDefs (OPT_Object obj, INTEGER vis) +{ + INTEGER i; + OPT_ConstExt ext = NIL; + INTEGER _for__9; + if (obj != NIL) { + OPC_CProcDefs(obj->left, vis); + if ((((obj->mode == 9 && (int)obj->vis >= vis)) && obj->adr == 1)) { + ext = obj->conval->ext; + i = 1; + if (((*ext)[1] != '#' && !(OPC_Prefixed(ext, (CHAR*)"extern ", (LONGINT)8) || OPC_Prefixed(ext, (CHAR*)"import ", (LONGINT)8)))) { + OPM_WriteString((CHAR*)"#define ", (LONGINT)9); + OPC_Ident(obj); + OPC_DeclareParams(obj->link, 1); + OPM_Write(0x09); + } + _for__9 = (int)(*obj->conval->ext)[0]; + i = i; + while (i <= _for__9) { + OPM_Write((*obj->conval->ext)[__X(i, ((LONGINT)(256)))]); + i += 1; + } + OPM_WriteLn(); + } + OPC_CProcDefs(obj->right, vis); + } +} + +void OPC_TypeDefs (OPT_Object obj, INTEGER vis) +{ + if (obj != NIL) { + OPC_TypeDefs(obj->left, vis); + if ((obj->mode == 5 && obj->typ->txtpos > 0)) { + OPC_DefineType(obj->typ); + } + OPC_TypeDefs(obj->right, vis); + } +} + +static void OPC_DefAnonRecs (OPT_Node n) +{ + OPT_Object o = NIL; + OPT_Struct typ = NIL; + while ((n != NIL && n->class == 14)) { + typ = n->typ; + if ((typ->strobj == NIL && (OPM_currFile == 1 || typ->ref < 255))) { + OPC_DefineType(typ); + __NEW(o, OPT_ObjDesc); + o->typ = typ; + o->name[0] = 0x00; + OPC_DeclareBase(o); + OPC_EndStat(); + OPM_WriteLn(); + } + n = n->link; + } +} + +void OPC_TDescDecl (OPT_Struct typ) +{ + LONGINT nofptrs; + OPT_Object o = NIL; + OPC_BegStat(); + OPM_WriteString((CHAR*)"__TDESC(", (LONGINT)9); + OPC_Andent(typ); + OPC_Str1((CHAR*)", #", (LONGINT)4, typ->n + 1); + OPC_Str1((CHAR*)", #) = {__TDFLDS(", (LONGINT)18, OPC_NofPtrs(typ)); + OPM_Write('\"'); + if (typ->strobj != NIL) { + OPM_WriteStringVar((void*)typ->strobj->name, ((LONGINT)(256))); + } + OPC_Str1((CHAR*)"\", #), {", (LONGINT)9, typ->size); + nofptrs = 0; + OPC_PutPtrOffsets(typ, ((LONGINT)(0)), &nofptrs); + OPC_Str1((CHAR*)"#}}", (LONGINT)4, -((nofptrs + 1) * (LONGINT)OPM_LIntSize)); + OPC_EndStat(); +} + +void OPC_InitTDesc (OPT_Struct typ) +{ + OPC_BegStat(); + OPM_WriteString((CHAR*)"__INITYP(", (LONGINT)10); + OPC_Andent(typ); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + if (typ->BaseTyp != NIL) { + OPC_Andent(typ->BaseTyp); + } else { + OPC_Andent(typ); + } + OPC_Str1((CHAR*)", #)", (LONGINT)5, typ->extlev); + OPC_EndStat(); + if (typ->strobj != NIL) { + OPC_InitTProcs(typ->strobj, typ->link); + } +} + +void OPC_Align (LONGINT *adr, LONGINT base) +{ + switch (base) { + case 2: + *adr += __MASK(*adr, -2); + break; + case 4: + *adr += __MASK(-*adr, -4); + break; + case 8: + *adr += __MASK(-*adr, -8); + break; + case 16: + *adr += __MASK(-*adr, -16); + break; + default: + break; + } +} + +LONGINT OPC_Base (OPT_Struct typ) +{ + LONGINT _o_result; + switch (typ->form) { + case 1: + _o_result = 1; + return _o_result; + break; + case 3: + _o_result = OPM_CharAlign; + return _o_result; + break; + case 2: + _o_result = OPM_BoolAlign; + return _o_result; + break; + case 4: + _o_result = OPM_SIntAlign; + return _o_result; + break; + case 5: + _o_result = OPM_IntAlign; + return _o_result; + break; + case 6: + _o_result = OPM_LIntAlign; + return _o_result; + break; + case 7: + _o_result = OPM_RealAlign; + return _o_result; + break; + case 8: + _o_result = OPM_LRealAlign; + return _o_result; + break; + case 9: + _o_result = OPM_SetAlign; + return _o_result; + break; + case 13: + _o_result = OPM_PointerAlign; + return _o_result; + break; + case 14: + _o_result = OPM_ProcAlign; + return _o_result; + break; + case 15: + if (typ->comp == 4) { + _o_result = __MASK(typ->align, -65536); + return _o_result; + } else { + _o_result = OPC_Base(typ->BaseTyp); + return _o_result; + } + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPC.Base, typ^form = ", (LONGINT)40); + OPM_LogWNum(typ->form, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + __RETCHK; +} + +static void OPC_FillGap (LONGINT gap, LONGINT off, LONGINT align, LONGINT *n, LONGINT *curAlign) +{ + LONGINT adr; + adr = off; + OPC_Align(&adr, align); + if ((*curAlign < align && gap - (adr - off) >= align)) { + gap -= (adr - off) + align; + OPC_BegStat(); + if (align == (LONGINT)OPM_IntSize) { + OPM_WriteString((CHAR*)"INTEGER", (LONGINT)8); + } else if (align == (LONGINT)OPM_LIntSize) { + OPM_WriteString((CHAR*)"LONGINT", (LONGINT)8); + } else if (align == (LONGINT)OPM_LRealSize) { + OPM_WriteString((CHAR*)"LONGREAL", (LONGINT)9); + } + OPC_Str1((CHAR*)" _prvt#", (LONGINT)8, *n); + *n += 1; + OPC_EndStat(); + *curAlign = align; + } + if (gap > 0) { + OPC_BegStat(); + OPC_Str1((CHAR*)"char _prvt#", (LONGINT)12, *n); + *n += 1; + OPC_Str1((CHAR*)"[#]", (LONGINT)4, gap); + OPC_EndStat(); + } +} + +static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, LONGINT *off, LONGINT *n, LONGINT *curAlign) +{ + OPT_Object fld = NIL; + OPT_Struct base = NIL; + LONGINT gap, adr, align, fldAlign; + fld = typ->link; + align = __MASK(typ->align, -65536); + if (typ->BaseTyp != NIL) { + OPC_FieldList(typ->BaseTyp, 0, &*off, &*n, &*curAlign); + } else { + *off = 0; + *n = 0; + *curAlign = 1; + } + while ((fld != NIL && fld->mode == 4)) { + if ((OPM_currFile == 0 && fld->vis == 0) || (((OPM_currFile == 1 && fld->vis == 0)) && typ->mno != 0)) { + fld = fld->link; + while ((((fld != NIL && fld->mode == 4)) && fld->vis == 0)) { + fld = fld->link; + } + } else { + adr = *off; + fldAlign = OPC_Base(fld->typ); + OPC_Align(&adr, fldAlign); + gap = fld->adr - adr; + if (fldAlign > *curAlign) { + *curAlign = fldAlign; + } + if (gap > 0) { + OPC_FillGap(gap, *off, align, &*n, &*curAlign); + } + OPC_BegStat(); + OPC_DeclareBase(fld); + OPM_Write(' '); + OPC_DeclareObj(fld, 0); + *off = fld->adr + fld->typ->size; + base = fld->typ; + fld = fld->link; + while ((((((((fld != NIL && fld->mode == 4)) && fld->typ == base)) && fld->adr == *off)) && ((OPM_currFile == 1 || fld->vis != 0) || fld->typ->strobj == NIL))) { + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPC_DeclareObj(fld, 0); + *off = fld->adr + fld->typ->size; + fld = fld->link; + } + OPC_EndStat(); + } + } + if (last) { + adr = typ->size - (LONGINT)__ASHR(typ->sysflag, 8); + if (adr == 0) { + gap = 1; + } else { + gap = adr - *off; + } + if (gap > 0) { + OPC_FillGap(gap, *off, align, &*n, &*curAlign); + } + } +} + +static void OPC_IdentList (OPT_Object obj, INTEGER vis) +{ + OPT_Struct base = NIL; + BOOLEAN first; + INTEGER lastvis; + base = NIL; + first = 1; + while ((obj != NIL && obj->mode != 13)) { + if ((__IN(vis, 0x05) || (vis == 1 && obj->vis != 0)) || (vis == 3 && !obj->leaf)) { + if (obj->typ != base || (int)obj->vis != lastvis) { + if (!first) { + OPC_EndStat(); + } + first = 0; + base = obj->typ; + lastvis = obj->vis; + OPC_BegStat(); + if ((vis == 1 && obj->vis != 0)) { + OPM_WriteString((CHAR*)"import ", (LONGINT)8); + } else if ((obj->mnolev == 0 && vis == 0)) { + if (obj->vis == 0) { + OPM_WriteString((CHAR*)"static ", (LONGINT)8); + } else { + OPM_WriteString((CHAR*)"export ", (LONGINT)8); + } + } + if ((((vis == 2 && obj->mode == 1)) && base->form == 7)) { + OPM_WriteString((CHAR*)"double", (LONGINT)7); + } else { + OPC_DeclareBase(obj); + } + } else { + OPM_Write(','); + } + OPM_Write(' '); + if ((((vis == 2 && obj->mode == 1)) && base->form == 7)) { + OPM_Write('_'); + } + OPC_DeclareObj(obj, vis == 3); + if (obj->typ->comp == 3) { + OPC_EndStat(); + OPC_BegStat(); + base = OPT_linttyp; + OPM_WriteString((CHAR*)"LONGINT ", (LONGINT)9); + OPC_LenList(obj, 0, 1); + } else if ((obj->mode == 2 && obj->typ->comp == 4)) { + OPC_EndStat(); + OPC_BegStat(); + OPM_WriteString((CHAR*)"LONGINT *", (LONGINT)10); + OPC_Ident(obj); + OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + base = NIL; + } else if ((((((OPC_ptrinit && vis == 0)) && obj->mnolev > 0)) && obj->typ->form == 13)) { + OPM_WriteString((CHAR*)" = NIL", (LONGINT)7); + } + } + obj = obj->link; + } + if (!first) { + OPC_EndStat(); + } +} + +static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames) +{ + CHAR name[32]; + OPM_Write('('); + if (obj == NIL || obj->mode == 13) { + OPM_WriteString((CHAR*)"void", (LONGINT)5); + } else { + for (;;) { + OPC_DeclareBase(obj); + if (showParamNames) { + OPM_Write(' '); + OPC_DeclareObj(obj, 0); + } else { + __COPY(obj->name, name, ((LONGINT)(32))); + obj->name[0] = 0x00; + OPC_DeclareObj(obj, 0); + __COPY(name, obj->name, ((LONGINT)(256))); + } + if (obj->typ->comp == 3) { + OPM_WriteString((CHAR*)", LONGINT ", (LONGINT)11); + OPC_LenList(obj, 1, showParamNames); + } else if ((obj->mode == 2 && obj->typ->comp == 4)) { + OPM_WriteString((CHAR*)", LONGINT *", (LONGINT)12); + if (showParamNames) { + OPC_Ident(obj); + OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + } + } + if (obj->link == NIL || obj->link->mode == 13) { + break; + } + OPM_WriteString((CHAR*)", ", (LONGINT)3); + obj = obj->link; + } + } + OPM_Write(')'); +} + +static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define) +{ + if (proc->typ == OPT_notyp) { + OPM_WriteString((CHAR*)"void", (LONGINT)5); + } else { + OPC_Ident(proc->typ->strobj); + } + OPM_Write(' '); + OPC_Ident(proc); + OPM_Write(' '); + if (OPC_ansi) { + OPC_AnsiParamList(proc->link, 1); + if (!define) { + OPM_Write(';'); + } + OPM_WriteLn(); + } else if (define) { + OPC_DeclareParams(proc->link, 0); + OPM_WriteLn(); + OPC_Indent(1); + OPC_IdentList(proc->link, 2); + OPC_Indent(-1); + } else { + OPM_WriteString((CHAR*)"();", (LONGINT)4); + OPM_WriteLn(); + } +} + +static void OPC_ProcPredefs (OPT_Object obj, SHORTINT vis) +{ + if (obj != NIL) { + OPC_ProcPredefs(obj->left, vis); + if ((((__IN(obj->mode, 0xc0) && obj->vis >= vis)) && (obj->history != 4 || obj->mode == 6))) { + if (vis == 1) { + OPM_WriteString((CHAR*)"import ", (LONGINT)8); + } else if (obj->vis == 0) { + OPM_WriteString((CHAR*)"static ", (LONGINT)8); + } else { + OPM_WriteString((CHAR*)"export ", (LONGINT)8); + } + OPC_ProcHeader(obj, 0); + } + OPC_ProcPredefs(obj->right, vis); + } +} + +static void OPC_Include (CHAR *name, LONGINT name__len) +{ + __DUP(name, name__len, CHAR); + OPM_WriteString((CHAR*)"#include ", (LONGINT)10); + OPM_Write('\"'); + OPM_WriteStringVar((void*)name, name__len); + OPM_WriteString((CHAR*)".h", (LONGINT)3); + OPM_Write('\"'); + OPM_WriteLn(); + __DEL(name); +} + +static void OPC_IncludeImports (OPT_Object obj, INTEGER vis) +{ + if (obj != NIL) { + OPC_IncludeImports(obj->left, vis); + if ((((obj->mode == 11 && obj->mnolev != 0)) && (int)OPT_GlbMod[__X(-obj->mnolev, ((LONGINT)(64)))]->vis >= vis)) { + OPC_Include(OPT_GlbMod[__X(-obj->mnolev, ((LONGINT)(64)))]->name, ((LONGINT)(256))); + } + OPC_IncludeImports(obj->right, vis); + } +} + +static void OPC_GenDynTypes (OPT_Node n, INTEGER vis) +{ + OPT_Struct typ = NIL; + while ((n != NIL && n->class == 14)) { + typ = n->typ; + if (vis == 0 || typ->ref < 255) { + OPC_BegStat(); + if (vis == 1) { + OPM_WriteString((CHAR*)"import ", (LONGINT)8); + } else if ((typ->strobj != NIL && typ->strobj->mnolev > 0)) { + OPM_WriteString((CHAR*)"static ", (LONGINT)8); + } else { + OPM_WriteString((CHAR*)"export ", (LONGINT)8); + } + OPM_WriteString((CHAR*)"LONGINT *", (LONGINT)10); + OPC_Andent(typ); + OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPC_EndStat(); + } + n = n->link; + } +} + +void OPC_GenHdr (OPT_Node n) +{ + OPM_currFile = 0; + OPC_DefAnonRecs(n); + OPC_TypeDefs(OPT_topScope->right, 1); + OPM_WriteLn(); + OPC_IdentList(OPT_topScope->scope, 1); + OPM_WriteLn(); + OPC_GenDynTypes(n, 1); + OPM_WriteLn(); + OPC_ProcPredefs(OPT_topScope->right, 1); + OPM_WriteString((CHAR*)"import ", (LONGINT)8); + OPM_WriteString((CHAR*)"void *", (LONGINT)7); + OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); + OPM_WriteString(OPC_BodyNameExt, ((LONGINT)(13))); + OPC_EndStat(); + OPM_WriteLn(); + OPC_CProcDefs(OPT_topScope->right, 1); + OPM_WriteLn(); + OPM_WriteString((CHAR*)"#endif", (LONGINT)7); + OPM_WriteLn(); +} + +static void OPC_GenHeaderMsg (void) +{ + INTEGER i; + OPM_WriteString((CHAR*)"/*", (LONGINT)3); + OPM_WriteString((CHAR*)" voc ", (LONGINT)6); + OPM_Write(' '); + OPM_WriteString((CHAR*)"1.2 [2016/06/15] for gcc LP64 on cygwin", (LONGINT)40); + OPM_Write(' '); + i = 0; + while (i <= 63) { + if (__IN(i, OPM_glbopt)) { + switch (i) { + case 0: + OPM_Write('x'); + break; + case 2: + OPM_Write('r'); + break; + case 3: + OPM_Write('t'); + break; + case 4: + OPM_Write('s'); + break; + case 5: + OPM_Write('p'); + break; + case 6: + OPM_Write('k'); + break; + case 7: + OPM_Write('a'); + break; + case 9: + OPM_Write('e'); + break; + case 10: + OPM_Write('m'); + break; + case 13: + OPM_Write('S'); + break; + case 14: + OPM_Write('c'); + break; + case 15: + OPM_Write('M'); + break; + case 16: + OPM_Write('f'); + break; + case 17: + OPM_Write('F'); + break; + case 18: + OPM_Write('v'); + break; + default: + OPM_LogWStr((CHAR*)"( more options defined in OPM than checked in OPC.GenHeaderMsg, if you are a compiler developer, add them to OPC.GenHeaderMsg", (LONGINT)126); + OPM_LogWLn(); + break; + } + } + i += 1; + } + OPM_WriteString((CHAR*)" */", (LONGINT)4); + OPM_WriteLn(); +} + +void OPC_GenHdrIncludes (void) +{ + OPM_currFile = 2; + OPC_GenHeaderMsg(); + OPM_WriteLn(); + OPM_WriteString((CHAR*)"#ifndef ", (LONGINT)9); + OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); + OPM_WriteString((CHAR*)"__h", (LONGINT)4); + OPM_WriteLn(); + OPM_WriteString((CHAR*)"#define ", (LONGINT)9); + OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); + OPM_WriteString((CHAR*)"__h", (LONGINT)4); + OPM_WriteLn(); + OPM_WriteLn(); + if (OPM_LIntSize == 8) { + OPM_WriteString((CHAR*)"#define LARGE", (LONGINT)14); + OPM_WriteLn(); + } + OPC_Include((CHAR*)"SYSTEM", (LONGINT)7); + OPC_IncludeImports(OPT_topScope->right, 1); + OPM_WriteLn(); +} + +void OPC_GenBdy (OPT_Node n) +{ + OPM_currFile = 1; + OPC_GenHeaderMsg(); + if (OPM_LIntSize == 8) { + OPM_WriteString((CHAR*)"#define LARGE", (LONGINT)14); + OPM_WriteLn(); + } + OPC_Include((CHAR*)"SYSTEM", (LONGINT)7); + OPC_IncludeImports(OPT_topScope->right, 0); + OPM_WriteLn(); + OPC_DefAnonRecs(n); + OPC_TypeDefs(OPT_topScope->right, 0); + OPM_WriteLn(); + OPC_IdentList(OPT_topScope->scope, 0); + OPM_WriteLn(); + OPC_GenDynTypes(n, 0); + OPM_WriteLn(); + OPC_ProcPredefs(OPT_topScope->right, 0); + OPM_WriteLn(); + OPC_CProcDefs(OPT_topScope->right, 0); + OPM_WriteLn(); +} + +static void OPC_RegCmds (OPT_Object obj) +{ + if (obj != NIL) { + OPC_RegCmds(obj->left); + if ((obj->mode == 7 && obj->history != 4)) { + if ((((obj->vis != 0 && obj->link == NIL)) && obj->typ == OPT_notyp)) { + OPC_BegStat(); + OPM_WriteString((CHAR*)"__REGCMD(\"", (LONGINT)11); + OPM_WriteStringVar((void*)obj->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"\", ", (LONGINT)4); + OPC_Ident(obj); + OPM_Write(')'); + OPC_EndStat(); + } + } + OPC_RegCmds(obj->right); + } +} + +static void OPC_InitImports (OPT_Object obj) +{ + if (obj != NIL) { + OPC_InitImports(obj->left); + if ((obj->mode == 11 && obj->mnolev != 0)) { + OPC_BegStat(); + OPM_WriteString((CHAR*)"__MODULE_IMPORT(", (LONGINT)17); + OPM_WriteStringVar((void*)OPT_GlbMod[__X(-obj->mnolev, ((LONGINT)(64)))]->name, ((LONGINT)(256))); + OPM_Write(')'); + OPC_EndStat(); + } + OPC_InitImports(obj->right); + } +} + +void OPC_GenEnumPtrs (OPT_Object var) +{ + OPT_Struct typ = NIL; + LONGINT n; + OPC_GlbPtrs = 0; + while (var != NIL) { + typ = var->typ; + if (OPC_NofPtrs(typ) > 0) { + if (!OPC_GlbPtrs) { + OPC_GlbPtrs = 1; + OPM_WriteString((CHAR*)"static ", (LONGINT)8); + if (OPC_ansi) { + OPM_WriteString((CHAR*)"void EnumPtrs(void (*P)(void*))", (LONGINT)32); + } else { + OPM_WriteString((CHAR*)"void EnumPtrs(P)", (LONGINT)17); + OPM_WriteLn(); + OPM_Write(0x09); + OPM_WriteString((CHAR*)"void (*P)();", (LONGINT)13); + } + OPM_WriteLn(); + OPC_BegBlk(); + } + OPC_BegStat(); + if (typ->form == 13) { + OPM_WriteString((CHAR*)"P(", (LONGINT)3); + OPC_Ident(var); + OPM_Write(')'); + } else if (typ->comp == 4) { + OPM_WriteString((CHAR*)"__ENUMR(&", (LONGINT)10); + OPC_Ident(var); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPC_Andent(typ); + OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPC_Str1((CHAR*)", #", (LONGINT)4, typ->size); + OPM_WriteString((CHAR*)", 1, P)", (LONGINT)8); + } else if (typ->comp == 2) { + n = typ->n; + typ = typ->BaseTyp; + while (typ->comp == 2) { + n = n * typ->n; + typ = typ->BaseTyp; + } + if (typ->form == 13) { + OPM_WriteString((CHAR*)"__ENUMP(", (LONGINT)9); + OPC_Ident(var); + OPC_Str1((CHAR*)", #, P)", (LONGINT)8, n); + } else if (typ->comp == 4) { + OPM_WriteString((CHAR*)"__ENUMR(", (LONGINT)9); + OPC_Ident(var); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPC_Andent(typ); + OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPC_Str1((CHAR*)", #", (LONGINT)4, typ->size); + OPC_Str1((CHAR*)", #, P)", (LONGINT)8, n); + } + } + OPC_EndStat(); + } + var = var->link; + } + if (OPC_GlbPtrs) { + OPC_EndBlk(); + OPM_WriteLn(); + } +} + +void OPC_EnterBody (void) +{ + OPM_WriteLn(); + OPM_WriteString((CHAR*)"export ", (LONGINT)8); + if (OPC_mainprog) { + if (OPC_ansi) { + OPM_WriteString((CHAR*)"int main(int argc, char **argv)", (LONGINT)32); + OPM_WriteLn(); + } else { + OPM_WriteString((CHAR*)"main(argc, argv)", (LONGINT)17); + OPM_WriteLn(); + OPM_Write(0x09); + OPM_WriteString((CHAR*)"int argc; char **argv;", (LONGINT)23); + OPM_WriteLn(); + } + } else { + OPM_WriteString((CHAR*)"void *", (LONGINT)7); + OPM_WriteString(OPM_modName, ((LONGINT)(32))); + OPM_WriteString(OPC_BodyNameExt, ((LONGINT)(13))); + OPM_WriteLn(); + } + OPC_BegBlk(); + OPC_BegStat(); + if (OPC_mainprog) { + OPM_WriteString((CHAR*)"__INIT(argc, argv)", (LONGINT)19); + } else { + OPM_WriteString((CHAR*)"__DEFMOD", (LONGINT)9); + } + OPC_EndStat(); + if ((OPC_mainprog && 0)) { + OPC_BegStat(); + OPM_WriteString((CHAR*)"/*don`t do it!*/ printf(\"DEMO VERSION: DO NOT USE THIS PROGRAM FOR ANY COMMERCIAL PURPOSE\\n\")", (LONGINT)94); + OPC_EndStat(); + } + OPC_InitImports(OPT_topScope->right); + OPC_BegStat(); + if (OPC_mainprog) { + OPM_WriteString((CHAR*)"__REGMAIN(\"", (LONGINT)12); + } else { + OPM_WriteString((CHAR*)"__REGMOD(\"", (LONGINT)11); + } + OPM_WriteString(OPM_modName, ((LONGINT)(32))); + if (OPC_GlbPtrs) { + OPM_WriteString((CHAR*)"\", EnumPtrs)", (LONGINT)13); + } else { + OPM_WriteString((CHAR*)"\", 0)", (LONGINT)6); + } + OPC_EndStat(); + if (__STRCMP(OPM_modName, "SYSTEM") != 0) { + OPC_RegCmds(OPT_topScope); + } +} + +void OPC_ExitBody (void) +{ + OPC_BegStat(); + if (OPC_mainprog) { + OPM_WriteString((CHAR*)"__FINI;", (LONGINT)8); + } else { + OPM_WriteString((CHAR*)"__ENDMOD;", (LONGINT)10); + } + OPM_WriteLn(); + OPC_EndBlk(); +} + +void OPC_DefineInter (OPT_Object proc) +{ + OPT_Object scope = NIL; + scope = proc->scope; + OPM_WriteString((CHAR*)"static ", (LONGINT)8); + OPM_WriteString((CHAR*)"struct ", (LONGINT)8); + OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); + OPM_Write(' '); + OPC_BegBlk(); + OPC_IdentList(proc->link, 3); + OPC_IdentList(scope->scope, 3); + OPC_BegStat(); + OPM_WriteString((CHAR*)"struct ", (LONGINT)8); + OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); + OPM_Write(' '); + OPM_Write('*'); + OPM_WriteString((CHAR*)"lnk", (LONGINT)4); + OPC_EndStat(); + OPC_EndBlk0(); + OPM_Write(' '); + OPM_Write('*'); + OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPC_EndStat(); + OPM_WriteLn(); + OPC_ProcPredefs(scope->right, 0); + OPM_WriteLn(); +} + +void OPC_EnterProc (OPT_Object proc) +{ + OPT_Object var = NIL, scope = NIL; + OPT_Struct typ = NIL; + INTEGER dim; + if (proc->vis != 1) { + OPM_WriteString((CHAR*)"static ", (LONGINT)8); + } + OPC_ProcHeader(proc, 1); + OPC_BegBlk(); + if (proc->typ != OPT_notyp) { + OPC_BegStat(); + OPC_Ident(proc->typ->strobj); + OPM_WriteString((CHAR*)" _o_result;", (LONGINT)12); + OPM_WriteLn(); + } + scope = proc->scope; + OPC_IdentList(scope->scope, 0); + if (!scope->leaf) { + OPC_BegStat(); + OPM_WriteString((CHAR*)"struct ", (LONGINT)8); + OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); + OPM_Write(' '); + OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPC_EndStat(); + } + var = proc->link; + while (var != NIL) { + if ((var->typ->comp == 2 && var->mode == 1)) { + OPC_BegStat(); + if (var->typ->strobj == NIL) { + OPM_Mark(200, var->typ->txtpos); + } else { + OPC_Ident(var->typ->strobj); + } + OPM_Write(' '); + OPC_Ident(var); + OPM_WriteString((CHAR*)"__copy", (LONGINT)7); + OPC_EndStat(); + } + var = var->link; + } + if (!OPC_ansi) { + var = proc->link; + while (var != NIL) { + if ((var->typ->form == 7 && var->mode == 1)) { + OPC_BegStat(); + OPC_Ident(var->typ->strobj); + OPM_Write(' '); + OPC_Ident(var); + OPM_WriteString((CHAR*)" = _", (LONGINT)5); + OPC_Ident(var); + OPC_EndStat(); + } + var = var->link; + } + } + var = proc->link; + while (var != NIL) { + if ((((__IN(var->typ->comp, 0x0c) && var->mode == 1)) && var->typ->sysflag == 0)) { + OPC_BegStat(); + if (var->typ->comp == 2) { + OPM_WriteString((CHAR*)"__DUPARR(", (LONGINT)10); + OPC_Ident(var); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + if (var->typ->strobj == NIL) { + OPM_Mark(200, var->typ->txtpos); + } else { + OPC_Ident(var->typ->strobj); + } + } else { + OPM_WriteString((CHAR*)"__DUP(", (LONGINT)7); + OPC_Ident(var); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPC_Ident(var); + OPM_WriteString((CHAR*)"__len", (LONGINT)6); + typ = var->typ->BaseTyp; + dim = 1; + while (typ->comp == 3) { + OPM_WriteString((CHAR*)" * ", (LONGINT)4); + OPC_Ident(var); + OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteInt(dim); + typ = typ->BaseTyp; + dim += 1; + } + OPM_WriteString((CHAR*)", ", (LONGINT)3); + if (typ->strobj == NIL) { + OPM_Mark(200, typ->txtpos); + } else { + OPC_Ident(typ->strobj); + } + } + OPM_Write(')'); + OPC_EndStat(); + } + var = var->link; + } + if (!scope->leaf) { + var = proc->link; + while (var != NIL) { + if (!var->leaf) { + OPC_BegStat(); + OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_Write('.'); + OPC_Ident(var); + OPM_WriteString((CHAR*)" = ", (LONGINT)4); + if (__IN(var->typ->comp, 0x0c)) { + OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + } else if (var->mode != 2) { + OPM_Write('&'); + } + OPC_Ident(var); + if (var->typ->comp == 3) { + typ = var->typ; + dim = 0; + do { + OPM_WriteString((CHAR*)"; ", (LONGINT)3); + OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_Write('.'); + OPC_Ident(var); + OPM_WriteString((CHAR*)"__len", (LONGINT)6); + if (dim != 0) { + OPM_WriteInt(dim); + } + OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPC_Ident(var); + OPM_WriteString((CHAR*)"__len", (LONGINT)6); + if (dim != 0) { + OPM_WriteInt(dim); + } + typ = typ->BaseTyp; + } while (!(typ->comp != 3)); + } else if ((var->mode == 2 && var->typ->comp == 4)) { + OPM_WriteString((CHAR*)"; ", (LONGINT)3); + OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_Write('.'); + OPC_Ident(var); + OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPC_Ident(var); + OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + } + OPC_EndStat(); + } + var = var->link; + } + var = scope->scope; + while (var != NIL) { + if (!var->leaf) { + OPC_BegStat(); + OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_Write('.'); + OPC_Ident(var); + OPM_WriteString((CHAR*)" = ", (LONGINT)4); + if (var->typ->comp != 2) { + OPM_Write('&'); + } else { + OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + } + OPC_Ident(var); + OPC_EndStat(); + } + var = var->link; + } + OPC_BegStat(); + OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_Write('.'); + OPM_WriteString((CHAR*)"lnk", (LONGINT)4); + OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPC_EndStat(); + OPC_BegStat(); + OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_Write('&'); + OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPC_EndStat(); + } +} + +void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet) +{ + OPT_Object var = NIL; + BOOLEAN indent; + indent = eoBlock; + if ((implicitRet && proc->typ != OPT_notyp)) { + OPM_Write(0x09); + OPM_WriteString((CHAR*)"__RETCHK;", (LONGINT)10); + OPM_WriteLn(); + } else if (!eoBlock || implicitRet) { + if (!proc->scope->leaf) { + if (indent) { + OPC_BegStat(); + } else { + indent = 1; + } + OPM_WriteStringVar((void*)proc->scope->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_Write('.'); + OPM_WriteString((CHAR*)"lnk", (LONGINT)4); + OPC_EndStat(); + } + var = proc->link; + while (var != NIL) { + if ((((var->typ->comp == 3 && var->mode == 1)) && var->typ->sysflag == 0)) { + if (indent) { + OPC_BegStat(); + } else { + indent = 1; + } + OPM_WriteString((CHAR*)"__DEL(", (LONGINT)7); + OPC_Ident(var); + OPM_Write(')'); + OPC_EndStat(); + } + var = var->link; + } + } + if (eoBlock) { + OPC_EndBlk(); + OPM_WriteLn(); + } else if (indent) { + OPC_BegStat(); + } +} + +void OPC_CompleteIdent (OPT_Object obj) +{ + INTEGER comp, level; + level = obj->mnolev; + if (obj->adr == 1) { + if (obj->typ->comp == 4) { + OPC_Ident(obj); + OPM_WriteString((CHAR*)"__", (LONGINT)3); + } else { + OPM_WriteString((CHAR*)"((", (LONGINT)3); + OPC_Ident(obj->typ->strobj); + OPM_Write(')'); + OPC_Ident(obj); + OPM_Write(')'); + } + } else if ((level != OPM_level && level > 0)) { + comp = obj->typ->comp; + if ((obj->mode != 2 && comp != 3)) { + OPM_Write('*'); + } + OPM_WriteStringVar((void*)obj->scope->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"->", (LONGINT)3); + OPC_Ident(obj); + } else { + OPC_Ident(obj); + } +} + +void OPC_TypeOf (OPT_Object ap) +{ + INTEGER i; + __ASSERT(ap->typ->comp == 4, 0); + if (ap->mode == 2) { + if ((int)ap->mnolev != OPM_level) { + OPM_WriteStringVar((void*)ap->scope->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"_s->", (LONGINT)5); + OPC_Ident(ap); + } else { + OPC_Ident(ap); + } + OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + } else if (ap->typ->strobj != NIL) { + OPC_Ident(ap->typ->strobj); + OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + } else { + OPC_Andent(ap->typ); + } +} + +void OPC_Cmp (INTEGER rel) +{ + switch (rel) { + case 9: + OPM_WriteString((CHAR*)" == ", (LONGINT)5); + break; + case 10: + OPM_WriteString((CHAR*)" != ", (LONGINT)5); + break; + case 11: + OPM_WriteString((CHAR*)" < ", (LONGINT)4); + break; + case 12: + OPM_WriteString((CHAR*)" <= ", (LONGINT)5); + break; + case 13: + OPM_WriteString((CHAR*)" > ", (LONGINT)4); + break; + case 14: + OPM_WriteString((CHAR*)" >= ", (LONGINT)5); + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPC.Cmp, rel = ", (LONGINT)34); + OPM_LogWNum(rel, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } +} + +void OPC_Case (LONGINT caseVal, INTEGER form) +{ + CHAR ch; + OPM_WriteString((CHAR*)"case ", (LONGINT)6); + switch (form) { + case 3: + ch = (CHAR)caseVal; + if ((ch >= ' ' && ch <= '~')) { + OPM_Write('\''); + if (((ch == '\\' || ch == '\?') || ch == '\'') || ch == '\"') { + OPM_Write('\\'); + OPM_Write(ch); + } else { + OPM_Write(ch); + } + OPM_Write('\''); + } else { + OPM_WriteString((CHAR*)"0x", (LONGINT)3); + OPM_WriteHex(caseVal); + } + break; + case 4: case 5: case 6: + OPM_WriteInt(caseVal); + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPC.Case, form = ", (LONGINT)36); + OPM_LogWNum(form, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + OPM_WriteString((CHAR*)": ", (LONGINT)3); +} + +void OPC_SetInclude (BOOLEAN exclude) +{ + if (exclude) { + OPM_WriteString((CHAR*)" &= ~", (LONGINT)6); + } else { + OPM_WriteString((CHAR*)" |= ", (LONGINT)5); + } +} + +void OPC_Increment (BOOLEAN decrement) +{ + if (decrement) { + OPM_WriteString((CHAR*)" -= ", (LONGINT)5); + } else { + OPM_WriteString((CHAR*)" += ", (LONGINT)5); + } +} + +void OPC_Halt (LONGINT n) +{ + OPC_Str1((CHAR*)"__HALT(#)", (LONGINT)10, n); +} + +void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim) +{ + if (array->comp == 3) { + OPC_CompleteIdent(obj); + OPM_WriteString((CHAR*)"__len", (LONGINT)6); + if (dim != 0) { + OPM_WriteInt(dim); + } + } else { + while (dim > 0) { + array = array->BaseTyp; + dim -= 1; + } + OPM_WriteString((CHAR*)"((LONGINT)(", (LONGINT)12); + OPM_WriteInt(array->n); + OPM_WriteString((CHAR*)"))", (LONGINT)3); + } +} + +void OPC_Constant (OPT_Const con, INTEGER form) +{ + INTEGER i, len; + CHAR ch; + SET s; + LONGINT hex; + BOOLEAN skipLeading; + switch (form) { + case 1: + OPM_WriteInt(con->intval); + break; + case 2: + OPM_WriteInt(con->intval); + break; + case 3: + ch = (CHAR)con->intval; + if ((ch >= ' ' && ch <= '~')) { + OPM_Write('\''); + if (((ch == '\\' || ch == '\?') || ch == '\'') || ch == '\"') { + OPM_Write('\\'); + } + OPM_Write(ch); + OPM_Write('\''); + } else { + OPM_WriteString((CHAR*)"0x", (LONGINT)3); + OPM_WriteHex(con->intval); + } + break; + case 4: case 5: case 6: + OPM_WriteInt(con->intval); + break; + case 7: + OPM_WriteReal(con->realval, 'f'); + break; + case 8: + OPM_WriteReal(con->realval, 0x00); + break; + case 9: + OPM_WriteString((CHAR*)"0x", (LONGINT)3); + skipLeading = 1; + s = con->setval; + i = 64; + do { + hex = 0; + do { + i -= 1; + hex = __ASHL(hex, 1); + if (__IN(i, s)) { + hex += 1; + } + } while (!(__MASK(i, -8) == 0)); + if (hex != 0 || !skipLeading) { + OPM_WriteHex(hex); + skipLeading = 0; + } + } while (!(i == 0)); + if (skipLeading) { + OPM_Write('0'); + } + break; + case 10: + OPM_Write('\"'); + len = (int)con->intval2 - 1; + i = 0; + while (i < len) { + ch = (*con->ext)[__X(i, ((LONGINT)(256)))]; + if (((ch == '\\' || ch == '\?') || ch == '\'') || ch == '\"') { + OPM_Write('\\'); + } + OPM_Write(ch); + i += 1; + } + OPM_Write('\"'); + break; + case 11: + OPM_WriteString((CHAR*)"NIL", (LONGINT)4); + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPC.Constant, form = ", (LONGINT)40); + OPM_LogWNum(form, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } +} + +static struct InitKeywords__47 { + SHORTINT *n; + struct InitKeywords__47 *lnk; +} *InitKeywords__47_s; + +static void Enter__48 (CHAR *s, LONGINT s__len); + +static void Enter__48 (CHAR *s, LONGINT s__len) +{ + INTEGER h; + __DUP(s, s__len, CHAR); + h = OPC_PerfectHash((void*)s, s__len); + OPC_hashtab[__X(h, ((LONGINT)(105)))] = *InitKeywords__47_s->n; + __COPY(s, OPC_keytab[__X(*InitKeywords__47_s->n, ((LONGINT)(36)))], ((LONGINT)(9))); + *InitKeywords__47_s->n += 1; + __DEL(s); +} + +static void OPC_InitKeywords (void) +{ + SHORTINT n, i; + struct InitKeywords__47 _s; + _s.n = &n; + _s.lnk = InitKeywords__47_s; + InitKeywords__47_s = &_s; + n = 0; + i = 0; + while (i <= 104) { + OPC_hashtab[__X(i, ((LONGINT)(105)))] = -1; + i += 1; + } + Enter__48((CHAR*)"asm", (LONGINT)4); + Enter__48((CHAR*)"auto", (LONGINT)5); + Enter__48((CHAR*)"break", (LONGINT)6); + Enter__48((CHAR*)"case", (LONGINT)5); + Enter__48((CHAR*)"char", (LONGINT)5); + Enter__48((CHAR*)"const", (LONGINT)6); + Enter__48((CHAR*)"continue", (LONGINT)9); + Enter__48((CHAR*)"default", (LONGINT)8); + Enter__48((CHAR*)"do", (LONGINT)3); + Enter__48((CHAR*)"double", (LONGINT)7); + Enter__48((CHAR*)"else", (LONGINT)5); + Enter__48((CHAR*)"enum", (LONGINT)5); + Enter__48((CHAR*)"extern", (LONGINT)7); + Enter__48((CHAR*)"export", (LONGINT)7); + Enter__48((CHAR*)"float", (LONGINT)6); + Enter__48((CHAR*)"for", (LONGINT)4); + Enter__48((CHAR*)"fortran", (LONGINT)8); + Enter__48((CHAR*)"goto", (LONGINT)5); + Enter__48((CHAR*)"if", (LONGINT)3); + Enter__48((CHAR*)"import", (LONGINT)7); + Enter__48((CHAR*)"int", (LONGINT)4); + Enter__48((CHAR*)"long", (LONGINT)5); + Enter__48((CHAR*)"register", (LONGINT)9); + Enter__48((CHAR*)"return", (LONGINT)7); + Enter__48((CHAR*)"short", (LONGINT)6); + Enter__48((CHAR*)"signed", (LONGINT)7); + Enter__48((CHAR*)"sizeof", (LONGINT)7); + Enter__48((CHAR*)"static", (LONGINT)7); + Enter__48((CHAR*)"struct", (LONGINT)7); + Enter__48((CHAR*)"switch", (LONGINT)7); + Enter__48((CHAR*)"typedef", (LONGINT)8); + Enter__48((CHAR*)"union", (LONGINT)6); + Enter__48((CHAR*)"unsigned", (LONGINT)9); + Enter__48((CHAR*)"void", (LONGINT)5); + Enter__48((CHAR*)"volatile", (LONGINT)9); + Enter__48((CHAR*)"while", (LONGINT)6); + InitKeywords__47_s = _s.lnk; +} + + +export void *OPC__init(void) +{ + __DEFMOD; + __MODULE_IMPORT(Configuration); + __MODULE_IMPORT(OPM); + __MODULE_IMPORT(OPT); + __REGMOD("OPC", 0); + __REGCMD("BegBlk", OPC_BegBlk); + __REGCMD("BegStat", OPC_BegStat); + __REGCMD("EndBlk", OPC_EndBlk); + __REGCMD("EndBlk0", OPC_EndBlk0); + __REGCMD("EndStat", OPC_EndStat); + __REGCMD("EnterBody", OPC_EnterBody); + __REGCMD("ExitBody", OPC_ExitBody); + __REGCMD("GenHdrIncludes", OPC_GenHdrIncludes); + __REGCMD("Init", OPC_Init); +/* BEGIN */ + OPC_InitKeywords(); + __ENDMOD; +} diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h new file mode 100644 index 00000000..a91a3810 --- /dev/null +++ b/bootstrap/unix-88/OPC.h @@ -0,0 +1,50 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ + +#ifndef OPC__h +#define OPC__h + +#define LARGE +#include "SYSTEM.h" +#include "OPT.h" + + + + +import void OPC_Align (LONGINT *adr, LONGINT base); +import void OPC_Andent (OPT_Struct typ); +import LONGINT OPC_Base (OPT_Struct typ); +import OPT_Object OPC_BaseTProc (OPT_Object obj); +import void OPC_BegBlk (void); +import void OPC_BegStat (void); +import void OPC_Case (LONGINT caseVal, INTEGER form); +import void OPC_Cmp (INTEGER rel); +import void OPC_CompleteIdent (OPT_Object obj); +import void OPC_Constant (OPT_Const con, INTEGER form); +import void OPC_DefineInter (OPT_Object proc); +import void OPC_EndBlk (void); +import void OPC_EndBlk0 (void); +import void OPC_EndStat (void); +import void OPC_EnterBody (void); +import void OPC_EnterProc (OPT_Object proc); +import void OPC_ExitBody (void); +import void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet); +import void OPC_GenBdy (OPT_Node n); +import void OPC_GenEnumPtrs (OPT_Object var); +import void OPC_GenHdr (OPT_Node n); +import void OPC_GenHdrIncludes (void); +import void OPC_Halt (LONGINT n); +import void OPC_Ident (OPT_Object obj); +import void OPC_Increment (BOOLEAN decrement); +import void OPC_Indent (INTEGER count); +import void OPC_Init (void); +import void OPC_InitTDesc (OPT_Struct typ); +import void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim); +import LONGINT OPC_NofPtrs (OPT_Struct typ); +import void OPC_SetInclude (BOOLEAN exclude); +import void OPC_TDescDecl (OPT_Struct typ); +import void OPC_TypeDefs (OPT_Object obj, INTEGER vis); +import void OPC_TypeOf (OPT_Object ap); +import void *OPC__init(void); + + +#endif diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c new file mode 100644 index 00000000..798fb492 --- /dev/null +++ b/bootstrap/unix-88/OPM.c @@ -0,0 +1,1092 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +#define LARGE +#include "SYSTEM.h" +#include "Configuration.h" +#include "Console.h" +#include "Files.h" +#include "Platform.h" +#include "Strings.h" +#include "Texts.h" +#include "errors.h" +#include "vt100.h" + +typedef + CHAR OPM_FileName[32]; + + +static CHAR OPM_SourceFileName[256]; +export INTEGER OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_CharAlign, OPM_BoolAlign, OPM_SIntAlign, OPM_IntAlign, OPM_LIntAlign, OPM_SetAlign, OPM_RealAlign, OPM_LRealAlign, OPM_PointerAlign, OPM_ProcAlign, OPM_RecAlign, OPM_MaxSet; +export LONGINT OPM_MinSInt, OPM_MinInt, OPM_MinLInt, OPM_MaxSInt, OPM_MaxInt, OPM_MaxLInt, OPM_MaxIndex; +export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; +export BOOLEAN OPM_noerr; +export LONGINT OPM_curpos, OPM_errpos, OPM_breakpc; +export INTEGER OPM_currFile, OPM_level, OPM_pc, OPM_entno; +export CHAR OPM_modName[32]; +export CHAR OPM_objname[64]; +export SET OPM_opt, OPM_glbopt; +static LONGINT OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; +static Texts_Reader OPM_inR; +static Texts_Text OPM_Log; +static Texts_Writer OPM_W; +static Files_Rider OPM_oldSF, OPM_newSF; +static Files_Rider OPM_R[3]; +static Files_File OPM_oldSFile, OPM_newSFile, OPM_HFile, OPM_BFile, OPM_HIFile; +static INTEGER OPM_S; +export BOOLEAN OPM_dontAsm, OPM_dontLink, OPM_mainProg, OPM_mainLinkStat, OPM_notColorOutput, OPM_forceNewSym, OPM_Verbose; +static CHAR OPM_OBERON[1024]; +static CHAR OPM_MODULES[1024]; + + +static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F); +export void OPM_CloseFiles (void); +export void OPM_CloseOldSym (void); +export void OPM_DeleteNewSym (void); +export void OPM_FPrint (LONGINT *fp, LONGINT val); +export void OPM_FPrintLReal (LONGINT *fp, LONGREAL lr); +export void OPM_FPrintReal (LONGINT *fp, REAL real); +export void OPM_FPrintSet (LONGINT *fp, SET set); +static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, LONGINT pos); +export void OPM_Get (CHAR *ch); +static void OPM_GetProperties (void); +static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONGINT name__len, INTEGER *size, INTEGER *align); +export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); +export void OPM_InitOptions (void); +static void OPM_LogErrMsg (INTEGER n); +export void OPM_LogW (CHAR ch); +export void OPM_LogWLn (void); +export void OPM_LogWNum (LONGINT i, LONGINT len); +export void OPM_LogWStr (CHAR *s, LONGINT s__len); +static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len); +export void OPM_Mark (INTEGER n, LONGINT pos); +static INTEGER OPM_Min (INTEGER a, INTEGER b); +export void OPM_NewSym (CHAR *modName, LONGINT modName__len); +export void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); +export void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); +export BOOLEAN OPM_OpenPar (void); +export void OPM_RegisterNewSym (void); +static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt); +static void OPM_ShowLine (LONGINT pos); +export void OPM_SymRCh (CHAR *ch); +export LONGINT OPM_SymRInt (void); +export void OPM_SymRLReal (LONGREAL *lr); +export void OPM_SymRReal (REAL *r); +export void OPM_SymRSet (SET *s); +export void OPM_SymWCh (CHAR ch); +export void OPM_SymWInt (LONGINT i); +export void OPM_SymWLReal (LONGREAL lr); +export void OPM_SymWReal (REAL r); +export void OPM_SymWSet (SET s); +static void OPM_VerboseListSizes (void); +export void OPM_Write (CHAR ch); +export void OPM_WriteHex (LONGINT i); +export void OPM_WriteInt (LONGINT i); +export void OPM_WriteLn (void); +export void OPM_WriteReal (LONGREAL r, CHAR suffx); +export void OPM_WriteString (CHAR *s, LONGINT s__len); +export void OPM_WriteStringVar (CHAR *s, LONGINT s__len); +export BOOLEAN OPM_eofSF (void); +export void OPM_err (INTEGER n); +static LONGINT OPM_minus (LONGINT i); +static LONGINT OPM_power0 (LONGINT i, LONGINT j); + + +void OPM_LogW (CHAR ch) +{ + Console_Char(ch); +} + +void OPM_LogWStr (CHAR *s, LONGINT s__len) +{ + __DUP(s, s__len, CHAR); + Console_String(s, s__len); + __DEL(s); +} + +void OPM_LogWNum (LONGINT i, LONGINT len) +{ + Console_Int(i, len); +} + +void OPM_LogWLn (void) +{ + Console_Ln(); +} + +static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) +{ + INTEGER i; + i = 1; + while (s[__X(i, s__len)] != 0x00) { + switch (s[__X(i, s__len)]) { + case 'e': + *opt = *opt ^ 0x0200; + break; + case 's': + *opt = *opt ^ 0x10; + break; + case 'm': + *opt = *opt ^ 0x0400; + break; + case 'x': + *opt = *opt ^ 0x01; + break; + case 'r': + *opt = *opt ^ 0x04; + break; + case 't': + *opt = *opt ^ 0x08; + break; + case 'a': + *opt = *opt ^ 0x80; + break; + case 'k': + *opt = *opt ^ 0x40; + break; + case 'p': + *opt = *opt ^ 0x20; + break; + case 'S': + *opt = *opt ^ 0x2000; + break; + case 'c': + *opt = *opt ^ 0x4000; + break; + case 'M': + *opt = *opt ^ 0x8000; + break; + case 'f': + *opt = *opt ^ 0x010000; + break; + case 'F': + *opt = *opt ^ 0x020000; + break; + case 'V': + *opt = *opt ^ 0x040000; + break; + case 'B': + if (s[__X(i + 1, s__len)] != 0x00) { + i += 1; + OPM_IntSize = (int)s[__X(i, s__len)] - 48; + } + if (s[__X(i + 1, s__len)] != 0x00) { + i += 1; + OPM_PointerSize = (int)s[__X(i, s__len)] - 48; + } + if (s[__X(i + 1, s__len)] != 0x00) { + i += 1; + OPM_Alignment = (int)s[__X(i, s__len)] - 48; + } + __ASSERT(OPM_IntSize == 2 || OPM_IntSize == 4, 0); + __ASSERT(OPM_PointerSize == 4 || OPM_PointerSize == 8, 0); + __ASSERT(OPM_Alignment == 4 || OPM_Alignment == 8, 0); + break; + default: + OPM_LogWStr((CHAR*)" warning: option ", (LONGINT)19); + OPM_LogW('-'); + OPM_LogW(s[__X(i, s__len)]); + OPM_LogWStr((CHAR*)" ignored", (LONGINT)9); + OPM_LogWLn(); + break; + } + i += 1; + } +} + +BOOLEAN OPM_OpenPar (void) +{ + BOOLEAN _o_result; + CHAR s[256]; + if (Platform_ArgCount == 1) { + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Vishap Oberon-2 compiler v", (LONGINT)27); + OPM_LogWStr((CHAR*)"1.2 [2016/06/15] for gcc LP64 on cygwin", (LONGINT)40); + OPM_LogW('.'); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Based on Ofront by Software Templ OEG, continued by Norayr Chilingarian and others.", (LONGINT)84); + OPM_LogWLn(); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Usage:", (LONGINT)7); + OPM_LogWLn(); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" ", (LONGINT)3); + OPM_LogWStr((CHAR*)"voc", (LONGINT)4); + OPM_LogWStr((CHAR*)" options {files {options}}.", (LONGINT)28); + OPM_LogWLn(); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Where options = [\"-\" {option} ].", (LONGINT)33); + OPM_LogWLn(); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" m - generate code for main module", (LONGINT)36); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" M - generate code for main module and link object statically", (LONGINT)63); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" s - generate new symbol file", (LONGINT)31); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" e - allow extending the module interface", (LONGINT)43); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" r - check value ranges", (LONGINT)25); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" x - turn off array indices check", (LONGINT)35); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" a - don\'t check ASSERTs at runtime, use this option in tested production code", (LONGINT)80); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" p - turn off automatic pointer initialization", (LONGINT)48); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" t - don\'t check type guards (use in rare cases such as low-level modules where every cycle counts)", (LONGINT)101); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" S - don\'t call external assembler/compiler, only generate C code", (LONGINT)67); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" c - don\'t call linker", (LONGINT)24); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" f - don\'t use color output", (LONGINT)29); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" F - force writing new symbol file in current directory", (LONGINT)57); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" V - verbose output", (LONGINT)21); + OPM_LogWLn(); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Initial options specify defaults for all files.", (LONGINT)48); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Options following a filename are specific to that file.", (LONGINT)56); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Repeating an option toggles its value.", (LONGINT)39); + OPM_LogWLn(); + _o_result = 0; + return _o_result; + } else { + OPM_S = 1; + s[0] = 0x00; + Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + OPM_glbopt = 0xe9; + while (s[0] == '-') { + OPM_ScanOptions((void*)s, ((LONGINT)(256)), &OPM_glbopt); + OPM_S += 1; + s[0] = 0x00; + Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + } + _o_result = 1; + return _o_result; + } + __RETCHK; +} + +void OPM_InitOptions (void) +{ + CHAR s[256]; + OPM_opt = OPM_glbopt; + s[0] = 0x00; + Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + while (s[0] == '-') { + OPM_ScanOptions((void*)s, ((LONGINT)(256)), &OPM_opt); + OPM_S += 1; + s[0] = 0x00; + Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + } + OPM_dontAsm = __IN(13, OPM_opt); + OPM_dontLink = __IN(14, OPM_opt); + OPM_mainProg = __IN(10, OPM_opt); + OPM_mainLinkStat = __IN(15, OPM_opt); + OPM_notColorOutput = __IN(16, OPM_opt); + OPM_forceNewSym = __IN(17, OPM_opt); + OPM_Verbose = __IN(18, OPM_opt); + if (OPM_mainLinkStat) { + OPM_glbopt |= __SETOF(10); + } + OPM_GetProperties(); +} + +void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len) +{ + Texts_Text T = NIL; + LONGINT beg, end, time; + CHAR s[256]; + *done = 0; + OPM_curpos = 0; + if (OPM_S >= Platform_ArgCount) { + return; + } + s[0] = 0x00; + Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + __NEW(T, Texts_TextDesc); + Texts_Open(T, s, ((LONGINT)(256))); + OPM_LogWStr(s, ((LONGINT)(256))); + OPM_LogWStr((CHAR*)" ", (LONGINT)3); + __COPY(s, mname, mname__len); + __COPY(s, OPM_SourceFileName, ((LONGINT)(256))); + if (T->len == 0) { + OPM_LogWStr(s, ((LONGINT)(256))); + OPM_LogWStr((CHAR*)" not found.", (LONGINT)12); + OPM_LogWLn(); + } else { + Texts_OpenReader(&OPM_inR, Texts_Reader__typ, T, ((LONGINT)(0))); + *done = 1; + } + OPM_S += 1; + OPM_level = 0; + OPM_noerr = 1; + OPM_errpos = OPM_curpos; + OPM_lasterrpos = OPM_curpos - 10; + OPM_ErrorLineStartPos = 0; + OPM_ErrorLineLimitPos = 0; + OPM_ErrorLineNumber = 0; +} + +void OPM_Get (CHAR *ch) +{ + Texts_Read(&OPM_inR, Texts_Reader__typ, &*ch); + if (*ch == 0x0d) { + OPM_curpos = Texts_Pos(&OPM_inR, Texts_Reader__typ); + } else { + OPM_curpos += 1; + } + if ((*ch < 0x09 && !OPM_inR.eot)) { + *ch = ' '; + } +} + +static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len) +{ + INTEGER i, j; + CHAR ch; + __DUP(ext, ext__len, CHAR); + i = 0; + for (;;) { + ch = name[__X(i, name__len)]; + if (ch == 0x00) { + break; + } + FName[__X(i, FName__len)] = ch; + i += 1; + } + j = 0; + do { + ch = ext[__X(j, ext__len)]; + FName[__X(i, FName__len)] = ch; + i += 1; + j += 1; + } while (!(ch == 0x00)); + __DEL(ext); +} + +static void OPM_LogErrMsg (INTEGER n) +{ + Texts_Scanner S; + Texts_Text T = NIL; + CHAR ch; + INTEGER i; + CHAR buf[1024]; + if (n >= 0) { + if (!OPM_notColorOutput) { + vt100_SetAttr((CHAR*)"31m", (LONGINT)4); + } + OPM_LogWStr((CHAR*)" err ", (LONGINT)7); + if (!OPM_notColorOutput) { + vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + } + } else { + if (!OPM_notColorOutput) { + vt100_SetAttr((CHAR*)"35m", (LONGINT)4); + } + OPM_LogWStr((CHAR*)" warning ", (LONGINT)11); + n = -n; + if (!OPM_notColorOutput) { + vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + } + } + OPM_LogWNum(n, ((LONGINT)(1))); + OPM_LogWStr((CHAR*)" ", (LONGINT)3); + OPM_LogWStr(errors_errors[__X(n, ((LONGINT)(350)))], ((LONGINT)(128))); +} + +static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, LONGINT pos) +{ + CHAR ch, cheol; + if (pos < OPM_ErrorLineStartPos) { + OPM_ErrorLineStartPos = 0; + OPM_ErrorLineLimitPos = 0; + OPM_ErrorLineNumber = 0; + } + if (pos < OPM_ErrorLineLimitPos) { + Files_Set(&*r, r__typ, f, OPM_ErrorLineStartPos); + return; + } + Files_Set(&*r, r__typ, f, OPM_ErrorLineLimitPos); + Files_Read(&*r, r__typ, (void*)&ch); + while ((OPM_ErrorLineLimitPos < pos && !(*r).eof)) { + OPM_ErrorLineStartPos = OPM_ErrorLineLimitPos; + OPM_ErrorLineNumber += 1; + while ((((ch != 0x00 && ch != 0x0d)) && ch != 0x0a)) { + Files_Read(&*r, r__typ, (void*)&ch); + OPM_ErrorLineLimitPos += 1; + } + cheol = ch; + Files_Read(&*r, r__typ, (void*)&ch); + OPM_ErrorLineLimitPos += 1; + if ((cheol == 0x0d && ch == 0x0a)) { + OPM_ErrorLineLimitPos += 1; + Files_Read(&*r, r__typ, (void*)&ch); + } + } + Files_Set(&*r, r__typ, f, OPM_ErrorLineStartPos); +} + +static void OPM_ShowLine (LONGINT pos) +{ + Files_File f = NIL; + Files_Rider r; + CHAR line[1023]; + INTEGER i; + CHAR ch; + f = Files_Old(OPM_SourceFileName, ((LONGINT)(256))); + OPM_FindLine(f, &r, Files_Rider__typ, pos); + i = 0; + Files_Read(&r, Files_Rider__typ, (void*)&ch); + while ((((((ch != 0x00 && ch != 0x0d)) && ch != 0x0a)) && i < 1022)) { + line[__X(i, ((LONGINT)(1023)))] = ch; + i += 1; + Files_Read(&r, Files_Rider__typ, (void*)&ch); + } + line[__X(i, ((LONGINT)(1023)))] = 0x00; + OPM_LogWLn(); + OPM_LogWLn(); + OPM_LogWNum(OPM_ErrorLineNumber, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)": ", (LONGINT)3); + OPM_LogWStr(line, ((LONGINT)(1023))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" ", (LONGINT)7); + if (pos >= OPM_ErrorLineLimitPos) { + pos = OPM_ErrorLineLimitPos - 1; + } + i = (int)(pos - OPM_ErrorLineStartPos); + while (i > 0) { + OPM_LogW(' '); + i -= 1; + } + if (!OPM_notColorOutput) { + vt100_SetAttr((CHAR*)"32m", (LONGINT)4); + } + OPM_LogW('^'); + if (!OPM_notColorOutput) { + vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + } + Files_Close(f); +} + +void OPM_Mark (INTEGER n, LONGINT pos) +{ + if (pos == -1) { + pos = 0; + } + if (n >= 0) { + OPM_noerr = 0; + if (pos < OPM_lasterrpos || OPM_lasterrpos + 9 < pos) { + OPM_lasterrpos = pos; + OPM_ShowLine(pos); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" ", (LONGINT)3); + if (n < 249) { + OPM_LogWStr((CHAR*)" pos", (LONGINT)6); + OPM_LogWNum(pos, ((LONGINT)(6))); + OPM_LogErrMsg(n); + } else if (n == 255) { + OPM_LogWStr((CHAR*)"pos", (LONGINT)4); + OPM_LogWNum(pos, ((LONGINT)(6))); + OPM_LogWStr((CHAR*)" pc ", (LONGINT)6); + OPM_LogWNum(OPM_breakpc, ((LONGINT)(1))); + } else if (n == 254) { + OPM_LogWStr((CHAR*)"pc not found", (LONGINT)13); + } else { + OPM_LogWStr(OPM_objname, ((LONGINT)(64))); + if (n == 253) { + OPM_LogWStr((CHAR*)" is new, compile with option e", (LONGINT)31); + } else if (n == 252) { + OPM_LogWStr((CHAR*)" is redefined, compile with option s", (LONGINT)37); + } else if (n == 251) { + OPM_LogWStr((CHAR*)" is redefined (private part only), compile with option s", (LONGINT)57); + } else if (n == 250) { + OPM_LogWStr((CHAR*)" is no longer visible, compile with option s", (LONGINT)45); + } else if (n == 249) { + OPM_LogWStr((CHAR*)" is not consistently imported, recompile imports", (LONGINT)49); + } + } + } + } else { + if (pos >= 0) { + OPM_ShowLine(pos); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" pos", (LONGINT)6); + OPM_LogWNum(pos, ((LONGINT)(6))); + } + OPM_LogErrMsg(n); + if (pos < 0) { + OPM_LogWLn(); + } + } +} + +void OPM_err (INTEGER n) +{ + OPM_Mark(n, OPM_errpos); +} + +void OPM_FPrint (LONGINT *fp, LONGINT val) +{ + *fp = __ROTL((LONGINT)((SET)*fp ^ (SET)val), 1, LONGINT); +} + +void OPM_FPrintSet (LONGINT *fp, SET set) +{ + OPM_FPrint(&*fp, (LONGINT)set); +} + +void OPM_FPrintReal (LONGINT *fp, REAL real) +{ + OPM_FPrint(&*fp, __VAL(LONGINT, real)); +} + +void OPM_FPrintLReal (LONGINT *fp, LONGREAL lr) +{ + LONGINT l, h; + __GET((LONGINT)(uintptr_t)&lr, l, LONGINT); + __GET((LONGINT)(uintptr_t)&lr + 4, h, LONGINT); + OPM_FPrint(&*fp, l); + OPM_FPrint(&*fp, h); +} + +static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONGINT name__len, INTEGER *size, INTEGER *align) +{ + __DUP(name, name__len, CHAR); + if (((*S).class == 1 && __STRCMP((*S).s, name) == 0)) { + Texts_Scan(&*S, S__typ); + if ((*S).class == 3) { + *size = (int)(*S).i; + Texts_Scan(&*S, S__typ); + } else { + OPM_Mark(-157, ((LONGINT)(-1))); + } + if ((*S).class == 3) { + *align = (int)(*S).i; + Texts_Scan(&*S, S__typ); + } else { + OPM_Mark(-157, ((LONGINT)(-1))); + } + } else { + OPM_Mark(-157, ((LONGINT)(-1))); + } + __DEL(name); +} + +static LONGINT OPM_minus (LONGINT i) +{ + LONGINT _o_result; + _o_result = -i; + return _o_result; +} + +static LONGINT OPM_power0 (LONGINT i, LONGINT j) +{ + LONGINT _o_result; + LONGINT k, p; + k = 1; + p = i; + do { + p = p * i; + k += 1; + } while (!(k == j)); + _o_result = p; + return _o_result; +} + +static void OPM_VerboseListSizes (void) +{ + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Type Size Alignement", (LONGINT)29); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"CHAR ", (LONGINT)14); + OPM_LogWNum(OPM_CharSize, ((LONGINT)(4))); + OPM_LogWNum(OPM_CharAlign, ((LONGINT)(5))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"BOOLEAN ", (LONGINT)14); + OPM_LogWNum(OPM_BoolSize, ((LONGINT)(4))); + OPM_LogWNum(OPM_BoolAlign, ((LONGINT)(5))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"SHORTINT ", (LONGINT)14); + OPM_LogWNum(OPM_SIntSize, ((LONGINT)(4))); + OPM_LogWNum(OPM_SIntAlign, ((LONGINT)(5))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"INTEGER ", (LONGINT)14); + OPM_LogWNum(OPM_IntSize, ((LONGINT)(4))); + OPM_LogWNum(OPM_IntAlign, ((LONGINT)(5))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"LONGINT ", (LONGINT)14); + OPM_LogWNum(OPM_LIntSize, ((LONGINT)(4))); + OPM_LogWNum(OPM_LIntAlign, ((LONGINT)(5))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"SET ", (LONGINT)14); + OPM_LogWNum(OPM_SetSize, ((LONGINT)(4))); + OPM_LogWNum(OPM_SetAlign, ((LONGINT)(5))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"REAL ", (LONGINT)14); + OPM_LogWNum(OPM_RealSize, ((LONGINT)(4))); + OPM_LogWNum(OPM_RealAlign, ((LONGINT)(5))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"LONGREAL ", (LONGINT)14); + OPM_LogWNum(OPM_LRealSize, ((LONGINT)(4))); + OPM_LogWNum(OPM_LRealAlign, ((LONGINT)(5))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"PTR ", (LONGINT)14); + OPM_LogWNum(OPM_PointerSize, ((LONGINT)(4))); + OPM_LogWNum(OPM_PointerAlign, ((LONGINT)(5))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"PROC ", (LONGINT)14); + OPM_LogWNum(OPM_ProcSize, ((LONGINT)(4))); + OPM_LogWNum(OPM_ProcAlign, ((LONGINT)(5))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"RECORD ", (LONGINT)14); + OPM_LogWNum(OPM_RecSize, ((LONGINT)(4))); + OPM_LogWNum(OPM_RecAlign, ((LONGINT)(5))); + OPM_LogWLn(); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Min shortint ", (LONGINT)14); + OPM_LogWNum(OPM_MinSInt, ((LONGINT)(4))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Max shortint ", (LONGINT)14); + OPM_LogWNum(OPM_MaxSInt, ((LONGINT)(4))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Min integer ", (LONGINT)14); + OPM_LogWNum(OPM_MinInt, ((LONGINT)(4))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Max integer ", (LONGINT)14); + OPM_LogWNum(OPM_MaxInt, ((LONGINT)(4))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Min longint ", (LONGINT)14); + OPM_LogWNum(OPM_MinLInt, ((LONGINT)(4))); + OPM_LogWLn(); +} + +static INTEGER OPM_Min (INTEGER a, INTEGER b) +{ + INTEGER _o_result; + if (a < b) { + _o_result = a; + return _o_result; + } else { + _o_result = b; + return _o_result; + } + __RETCHK; +} + +static void OPM_GetProperties (void) +{ + LONGINT base; + OPM_ProcSize = OPM_PointerSize; + OPM_LIntSize = __ASHL(OPM_IntSize, 1); + OPM_SetSize = OPM_LIntSize; + OPM_CharAlign = OPM_Min(OPM_Alignment, OPM_CharSize); + OPM_BoolAlign = OPM_Min(OPM_Alignment, OPM_BoolSize); + OPM_SIntAlign = OPM_Min(OPM_Alignment, OPM_SIntSize); + OPM_RecAlign = OPM_Min(OPM_Alignment, OPM_RecSize); + OPM_RealAlign = OPM_Min(OPM_Alignment, OPM_RealSize); + OPM_LRealAlign = OPM_Min(OPM_Alignment, OPM_LRealSize); + OPM_PointerAlign = OPM_Min(OPM_Alignment, OPM_PointerSize); + OPM_ProcAlign = OPM_Min(OPM_Alignment, OPM_ProcSize); + OPM_IntAlign = OPM_Min(OPM_Alignment, OPM_IntSize); + OPM_LIntAlign = OPM_Min(OPM_Alignment, OPM_LIntSize); + OPM_SetAlign = OPM_Min(OPM_Alignment, OPM_SetSize); + base = -2; + OPM_MinSInt = __ASH(base, __ASHL(OPM_SIntSize, 3) - 2); + OPM_MaxSInt = OPM_minus(OPM_MinSInt + 1); + OPM_MinInt = __ASH(base, __ASHL(OPM_IntSize, 3) - 2); + OPM_MaxInt = OPM_minus(OPM_MinInt + 1); + OPM_MinLInt = __ASH(base, __ASHL(OPM_LIntSize, 3) - 2); + OPM_MaxLInt = OPM_minus(OPM_MinLInt + 1); + if (OPM_RealSize == 4) { + OPM_MaxReal = 3.40282346000000e+038; + } else if (OPM_RealSize == 8) { + OPM_MaxReal = 1.79769296342094e+308; + } + if (OPM_LRealSize == 4) { + OPM_MaxLReal = 3.40282346000000e+038; + } else if (OPM_LRealSize == 8) { + OPM_MaxLReal = 1.79769296342094e+308; + } + OPM_MinReal = -OPM_MaxReal; + OPM_MinLReal = -OPM_MaxLReal; + OPM_MaxSet = __ASHL(OPM_SetSize, 3) - 1; + OPM_MaxIndex = OPM_MaxLInt; + if (OPM_Verbose) { + OPM_VerboseListSizes(); + } +} + +void OPM_SymRCh (CHAR *ch) +{ + Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&*ch); +} + +LONGINT OPM_SymRInt (void) +{ + LONGINT _o_result; + LONGINT k; + Files_ReadNum(&OPM_oldSF, Files_Rider__typ, &k); + _o_result = k; + return _o_result; +} + +void OPM_SymRSet (SET *s) +{ + Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (LONGINT*)&*s); +} + +void OPM_SymRReal (REAL *r) +{ + Files_ReadReal(&OPM_oldSF, Files_Rider__typ, &*r); +} + +void OPM_SymRLReal (LONGREAL *lr) +{ + Files_ReadLReal(&OPM_oldSF, Files_Rider__typ, &*lr); +} + +void OPM_CloseOldSym (void) +{ +} + +void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done) +{ + CHAR ch; + OPM_FileName fileName; + OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, ((LONGINT)(32)), (CHAR*)".sym", (LONGINT)5); + OPM_oldSFile = Files_Old(fileName, ((LONGINT)(32))); + *done = OPM_oldSFile != NIL; + if (*done) { + Files_Set(&OPM_oldSF, Files_Rider__typ, OPM_oldSFile, ((LONGINT)(0))); + Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&ch); + if (ch != 0xf7) { + OPM_err(-306); + OPM_CloseOldSym(); + *done = 0; + } + } +} + +BOOLEAN OPM_eofSF (void) +{ + BOOLEAN _o_result; + _o_result = OPM_oldSF.eof; + return _o_result; +} + +void OPM_SymWCh (CHAR ch) +{ + Files_Write(&OPM_newSF, Files_Rider__typ, ch); +} + +void OPM_SymWInt (LONGINT i) +{ + Files_WriteNum(&OPM_newSF, Files_Rider__typ, i); +} + +void OPM_SymWSet (SET s) +{ + Files_WriteNum(&OPM_newSF, Files_Rider__typ, (LONGINT)s); +} + +void OPM_SymWReal (REAL r) +{ + Files_WriteReal(&OPM_newSF, Files_Rider__typ, r); +} + +void OPM_SymWLReal (LONGREAL lr) +{ + Files_WriteLReal(&OPM_newSF, Files_Rider__typ, lr); +} + +void OPM_RegisterNewSym (void) +{ + if (__STRCMP(OPM_modName, "SYSTEM") != 0 || __IN(10, OPM_opt)) { + Files_Register(OPM_newSFile); + } +} + +void OPM_DeleteNewSym (void) +{ +} + +void OPM_NewSym (CHAR *modName, LONGINT modName__len) +{ + OPM_FileName fileName; + OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, ((LONGINT)(32)), (CHAR*)".sym", (LONGINT)5); + OPM_newSFile = Files_New(fileName, ((LONGINT)(32))); + if (OPM_newSFile != NIL) { + Files_Set(&OPM_newSF, Files_Rider__typ, OPM_newSFile, ((LONGINT)(0))); + Files_Write(&OPM_newSF, Files_Rider__typ, 0xf7); + } else { + OPM_err(153); + } +} + +void OPM_Write (CHAR ch) +{ + Files_Write(&OPM_R[__X(OPM_currFile, ((LONGINT)(3)))], Files_Rider__typ, ch); +} + +void OPM_WriteString (CHAR *s, LONGINT s__len) +{ + INTEGER i; + i = 0; + while (s[__X(i, s__len)] != 0x00) { + i += 1; + } + Files_WriteBytes(&OPM_R[__X(OPM_currFile, ((LONGINT)(3)))], Files_Rider__typ, (void*)s, s__len * ((LONGINT)(1)), i); +} + +void OPM_WriteStringVar (CHAR *s, LONGINT s__len) +{ + INTEGER i; + i = 0; + while (s[__X(i, s__len)] != 0x00) { + i += 1; + } + Files_WriteBytes(&OPM_R[__X(OPM_currFile, ((LONGINT)(3)))], Files_Rider__typ, (void*)s, s__len * ((LONGINT)(1)), i); +} + +void OPM_WriteHex (LONGINT i) +{ + CHAR s[3]; + INTEGER digit; + digit = __ASHR((int)i, 4); + if (digit < 10) { + s[0] = (CHAR)(48 + digit); + } else { + s[0] = (CHAR)(87 + digit); + } + digit = __MASK((int)i, -16); + if (digit < 10) { + s[1] = (CHAR)(48 + digit); + } else { + s[1] = (CHAR)(87 + digit); + } + s[2] = 0x00; + OPM_WriteString(s, ((LONGINT)(3))); +} + +void OPM_WriteInt (LONGINT i) +{ + CHAR s[20]; + LONGINT i1, k; + if (i == OPM_MinInt || i == OPM_MinLInt) { + OPM_Write('('); + OPM_WriteInt(i + 1); + OPM_WriteString((CHAR*)"-1)", (LONGINT)4); + } else { + i1 = __ABS(i); + s[0] = (CHAR)(__MOD(i1, 10) + 48); + i1 = __DIV(i1, 10); + k = 1; + while (i1 > 0) { + s[__X(k, ((LONGINT)(20)))] = (CHAR)(__MOD(i1, 10) + 48); + i1 = __DIV(i1, 10); + k += 1; + } + if (i < 0) { + s[__X(k, ((LONGINT)(20)))] = '-'; + k += 1; + } + while (k > 0) { + k -= 1; + OPM_Write(s[__X(k, ((LONGINT)(20)))]); + } + } +} + +void OPM_WriteReal (LONGREAL r, CHAR suffx) +{ + Texts_Writer W; + Texts_Text T = NIL; + Texts_Reader R; + CHAR s[32]; + CHAR ch; + INTEGER i; + if ((((r < OPM_MaxLInt && r > OPM_MinLInt)) && r == (__ENTIER(r)))) { + if (suffx == 'f') { + OPM_WriteString((CHAR*)"(REAL)", (LONGINT)7); + } else { + OPM_WriteString((CHAR*)"(LONGREAL)", (LONGINT)11); + } + OPM_WriteInt(__ENTIER(r)); + } else { + Texts_OpenWriter(&W, Texts_Writer__typ); + if (suffx == 'f') { + Texts_WriteLongReal(&W, Texts_Writer__typ, r, 16); + } else { + Texts_WriteLongReal(&W, Texts_Writer__typ, r, 23); + } + __NEW(T, Texts_TextDesc); + Texts_Open(T, (CHAR*)"", (LONGINT)1); + Texts_Append(T, W.buf); + Texts_OpenReader(&R, Texts_Reader__typ, T, ((LONGINT)(0))); + i = 0; + Texts_Read(&R, Texts_Reader__typ, &ch); + while (ch != 0x00) { + s[__X(i, ((LONGINT)(32)))] = ch; + i += 1; + Texts_Read(&R, Texts_Reader__typ, &ch); + } + s[__X(i, ((LONGINT)(32)))] = 0x00; + i = 0; + ch = s[0]; + while ((ch != 'D' && ch != 0x00)) { + i += 1; + ch = s[__X(i, ((LONGINT)(32)))]; + } + if (ch == 'D') { + s[__X(i, ((LONGINT)(32)))] = 'e'; + } + OPM_WriteString(s, ((LONGINT)(32))); + } +} + +void OPM_WriteLn (void) +{ + Files_Write(&OPM_R[__X(OPM_currFile, ((LONGINT)(3)))], Files_Rider__typ, 0x0a); +} + +static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F) +{ + Files_Rider R1; + CHAR buffer[4096]; + if (F != NIL) { + Files_Set(&R1, Files_Rider__typ, F, ((LONGINT)(0))); + Files_ReadBytes(&R1, Files_Rider__typ, (void*)buffer, ((LONGINT)(4096)), ((LONGINT)(4096))); + while (4096 - R1.res > 0) { + Files_WriteBytes(&*R, R__typ, (void*)buffer, ((LONGINT)(4096)), 4096 - R1.res); + Files_ReadBytes(&R1, Files_Rider__typ, (void*)buffer, ((LONGINT)(4096)), ((LONGINT)(4096))); + } + } +} + +void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len) +{ + CHAR FName[32]; + __COPY(moduleName, OPM_modName, ((LONGINT)(32))); + OPM_HFile = Files_New((CHAR*)"", (LONGINT)1); + if (OPM_HFile != NIL) { + Files_Set(&OPM_R[0], Files_Rider__typ, OPM_HFile, ((LONGINT)(0))); + } else { + OPM_err(153); + } + OPM_MakeFileName((void*)moduleName, moduleName__len, (void*)FName, ((LONGINT)(32)), (CHAR*)".c", (LONGINT)3); + OPM_BFile = Files_New(FName, ((LONGINT)(32))); + if (OPM_BFile != NIL) { + Files_Set(&OPM_R[1], Files_Rider__typ, OPM_BFile, ((LONGINT)(0))); + } else { + OPM_err(153); + } + OPM_MakeFileName((void*)moduleName, moduleName__len, (void*)FName, ((LONGINT)(32)), (CHAR*)".h", (LONGINT)3); + OPM_HIFile = Files_New(FName, ((LONGINT)(32))); + if (OPM_HIFile != NIL) { + Files_Set(&OPM_R[2], Files_Rider__typ, OPM_HIFile, ((LONGINT)(0))); + } else { + OPM_err(153); + } +} + +void OPM_CloseFiles (void) +{ + CHAR FName[32]; + INTEGER res; + if (OPM_noerr) { + OPM_LogWStr((CHAR*)" ", (LONGINT)3); + OPM_LogWNum(Files_Pos(&OPM_R[1], Files_Rider__typ), ((LONGINT)(0))); + OPM_LogWStr((CHAR*)" chars.", (LONGINT)8); + } + if (OPM_noerr) { + if (__STRCMP(OPM_modName, "SYSTEM") == 0) { + if (!__IN(10, OPM_opt)) { + Files_Register(OPM_BFile); + } + } else if (!__IN(10, OPM_opt)) { + OPM_Append(&OPM_R[2], Files_Rider__typ, OPM_HFile); + Files_Register(OPM_HIFile); + Files_Register(OPM_BFile); + } else { + OPM_MakeFileName((void*)OPM_modName, ((LONGINT)(32)), (void*)FName, ((LONGINT)(32)), (CHAR*)".h", (LONGINT)3); + Files_Delete(FName, ((LONGINT)(32)), &res); + OPM_MakeFileName((void*)OPM_modName, ((LONGINT)(32)), (void*)FName, ((LONGINT)(32)), (CHAR*)".sym", (LONGINT)5); + Files_Delete(FName, ((LONGINT)(32)), &res); + Files_Register(OPM_BFile); + } + } + OPM_HFile = NIL; + OPM_BFile = NIL; + OPM_HIFile = NIL; + OPM_newSFile = NIL; + OPM_oldSFile = NIL; + Files_Set(&OPM_R[0], Files_Rider__typ, NIL, ((LONGINT)(0))); + Files_Set(&OPM_R[1], Files_Rider__typ, NIL, ((LONGINT)(0))); + Files_Set(&OPM_R[2], Files_Rider__typ, NIL, ((LONGINT)(0))); + Files_Set(&OPM_newSF, Files_Rider__typ, NIL, ((LONGINT)(0))); + Files_Set(&OPM_oldSF, Files_Rider__typ, NIL, ((LONGINT)(0))); +} + +static void EnumPtrs(void (*P)(void*)) +{ + __ENUMR(&OPM_inR, Texts_Reader__typ, 96, 1, P); + P(OPM_Log); + __ENUMR(&OPM_W, Texts_Writer__typ, 72, 1, P); + __ENUMR(&OPM_oldSF, Files_Rider__typ, 40, 1, P); + __ENUMR(&OPM_newSF, Files_Rider__typ, 40, 1, P); + __ENUMR(OPM_R, Files_Rider__typ, 40, 3, P); + P(OPM_oldSFile); + P(OPM_newSFile); + P(OPM_HFile); + P(OPM_BFile); + P(OPM_HIFile); +} + + +export void *OPM__init(void) +{ + __DEFMOD; + __MODULE_IMPORT(Configuration); + __MODULE_IMPORT(Console); + __MODULE_IMPORT(Files); + __MODULE_IMPORT(Platform); + __MODULE_IMPORT(Strings); + __MODULE_IMPORT(Texts); + __MODULE_IMPORT(errors); + __MODULE_IMPORT(vt100); + __REGMOD("OPM", EnumPtrs); + __REGCMD("CloseFiles", OPM_CloseFiles); + __REGCMD("CloseOldSym", OPM_CloseOldSym); + __REGCMD("DeleteNewSym", OPM_DeleteNewSym); + __REGCMD("InitOptions", OPM_InitOptions); + __REGCMD("LogWLn", OPM_LogWLn); + __REGCMD("RegisterNewSym", OPM_RegisterNewSym); + __REGCMD("WriteLn", OPM_WriteLn); +/* BEGIN */ + Texts_OpenWriter(&OPM_W, Texts_Writer__typ); + OPM_MODULES[0] = 0x00; + Platform_GetEnv((CHAR*)"MODULES", (LONGINT)8, (void*)OPM_MODULES, ((LONGINT)(1024))); + __MOVE(".", OPM_OBERON, 2); + Platform_GetEnv((CHAR*)"OBERON", (LONGINT)7, (void*)OPM_OBERON, ((LONGINT)(1024))); + Strings_Append((CHAR*)";.;", (LONGINT)4, (void*)OPM_OBERON, ((LONGINT)(1024))); + Strings_Append(OPM_MODULES, ((LONGINT)(1024)), (void*)OPM_OBERON, ((LONGINT)(1024))); + Strings_Append((CHAR*)";", (LONGINT)2, (void*)OPM_OBERON, ((LONGINT)(1024))); + Strings_Append((CHAR*)"/opt/voc", (LONGINT)9, (void*)OPM_OBERON, ((LONGINT)(1024))); + Strings_Append((CHAR*)"/sym;", (LONGINT)6, (void*)OPM_OBERON, ((LONGINT)(1024))); + Files_SetSearchPath(OPM_OBERON, ((LONGINT)(1024))); + OPM_CharSize = 1; + OPM_BoolSize = 1; + OPM_SIntSize = 1; + OPM_RecSize = 1; + OPM_ByteSize = 1; + OPM_RealSize = 4; + OPM_LRealSize = 8; + OPM_PointerSize = 8; + OPM_Alignment = 8; + OPM_IntSize = 4; + __ENDMOD; +} diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h new file mode 100644 index 00000000..e09dbf82 --- /dev/null +++ b/bootstrap/unix-88/OPM.h @@ -0,0 +1,64 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ + +#ifndef OPM__h +#define OPM__h + +#define LARGE +#include "SYSTEM.h" + + +import INTEGER OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_CharAlign, OPM_BoolAlign, OPM_SIntAlign, OPM_IntAlign, OPM_LIntAlign, OPM_SetAlign, OPM_RealAlign, OPM_LRealAlign, OPM_PointerAlign, OPM_ProcAlign, OPM_RecAlign, OPM_MaxSet; +import LONGINT OPM_MinSInt, OPM_MinInt, OPM_MinLInt, OPM_MaxSInt, OPM_MaxInt, OPM_MaxLInt, OPM_MaxIndex; +import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; +import BOOLEAN OPM_noerr; +import LONGINT OPM_curpos, OPM_errpos, OPM_breakpc; +import INTEGER OPM_currFile, OPM_level, OPM_pc, OPM_entno; +import CHAR OPM_modName[32]; +import CHAR OPM_objname[64]; +import SET OPM_opt, OPM_glbopt; +import BOOLEAN OPM_dontAsm, OPM_dontLink, OPM_mainProg, OPM_mainLinkStat, OPM_notColorOutput, OPM_forceNewSym, OPM_Verbose; + + +import void OPM_CloseFiles (void); +import void OPM_CloseOldSym (void); +import void OPM_DeleteNewSym (void); +import void OPM_FPrint (LONGINT *fp, LONGINT val); +import void OPM_FPrintLReal (LONGINT *fp, LONGREAL lr); +import void OPM_FPrintReal (LONGINT *fp, REAL real); +import void OPM_FPrintSet (LONGINT *fp, SET set); +import void OPM_Get (CHAR *ch); +import void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); +import void OPM_InitOptions (void); +import void OPM_LogW (CHAR ch); +import void OPM_LogWLn (void); +import void OPM_LogWNum (LONGINT i, LONGINT len); +import void OPM_LogWStr (CHAR *s, LONGINT s__len); +import void OPM_Mark (INTEGER n, LONGINT pos); +import void OPM_NewSym (CHAR *modName, LONGINT modName__len); +import void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); +import void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); +import BOOLEAN OPM_OpenPar (void); +import void OPM_RegisterNewSym (void); +import void OPM_SymRCh (CHAR *ch); +import LONGINT OPM_SymRInt (void); +import void OPM_SymRLReal (LONGREAL *lr); +import void OPM_SymRReal (REAL *r); +import void OPM_SymRSet (SET *s); +import void OPM_SymWCh (CHAR ch); +import void OPM_SymWInt (LONGINT i); +import void OPM_SymWLReal (LONGREAL lr); +import void OPM_SymWReal (REAL r); +import void OPM_SymWSet (SET s); +import void OPM_Write (CHAR ch); +import void OPM_WriteHex (LONGINT i); +import void OPM_WriteInt (LONGINT i); +import void OPM_WriteLn (void); +import void OPM_WriteReal (LONGREAL r, CHAR suffx); +import void OPM_WriteString (CHAR *s, LONGINT s__len); +import void OPM_WriteStringVar (CHAR *s, LONGINT s__len); +import BOOLEAN OPM_eofSF (void); +import void OPM_err (INTEGER n); +import void *OPM__init(void); + + +#endif diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c new file mode 100644 index 00000000..3bc74ce6 --- /dev/null +++ b/bootstrap/unix-88/OPP.c @@ -0,0 +1,1874 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +#define LARGE +#include "SYSTEM.h" +#include "OPB.h" +#include "OPM.h" +#include "OPS.h" +#include "OPT.h" + +struct OPP__1 { + LONGINT low, high; +}; + +typedef + struct OPP__1 OPP_CaseTable[128]; + + +static SHORTINT OPP_sym, OPP_level; +static INTEGER OPP_LoopLevel; +static OPT_Node OPP_TDinit, OPP_lastTDinit; +static INTEGER OPP_nofFwdPtr; +static OPT_Struct OPP_FwdPtr[64]; + +export LONGINT *OPP__1__typ; + +static void OPP_ActualParameters (OPT_Node *aparlist, OPT_Object fpar); +static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned); +static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq); +static void OPP_CaseLabelList (OPT_Node *lab, INTEGER LabelForm, INTEGER *n, OPP_CaseTable tab); +static void OPP_CheckMark (SHORTINT *vis); +static void OPP_CheckSym (INTEGER s); +static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_); +static void OPP_ConstExpression (OPT_Node *x); +static void OPP_Element (OPT_Node *x); +static void OPP_Expression (OPT_Node *x); +static BOOLEAN OPP_Extends (OPT_Struct x, OPT_Struct b); +static void OPP_Factor (OPT_Node *x); +static void OPP_FormalParameters (OPT_Object *firstPar, OPT_Struct *resTyp); +export void OPP_Module (OPT_Node *prog, SET opt); +static void OPP_PointerType (OPT_Struct *typ); +static void OPP_ProcedureDeclaration (OPT_Node *x); +static void OPP_Receiver (SHORTINT *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec); +static void OPP_RecordType (OPT_Struct *typ, OPT_Struct *banned); +static void OPP_Sets (OPT_Node *x); +static void OPP_SimpleExpression (OPT_Node *x); +static void OPP_StandProcCall (OPT_Node *x); +static void OPP_StatSeq (OPT_Node *stat); +static void OPP_Term (OPT_Node *x); +static void OPP_Type (OPT_Struct *typ, OPT_Struct *banned); +static void OPP_TypeDecl (OPT_Struct *typ, OPT_Struct *banned); +static void OPP_err (INTEGER n); +static void OPP_qualident (OPT_Object *id); +static void OPP_selector (OPT_Node *x); + + +static void OPP_err (INTEGER n) +{ + OPM_err(n); +} + +static void OPP_CheckSym (INTEGER s) +{ + if ((int)OPP_sym == s) { + OPS_Get(&OPP_sym); + } else { + OPM_err(s); + } +} + +static void OPP_qualident (OPT_Object *id) +{ + OPT_Object obj = NIL; + SHORTINT lev; + OPT_Find(&obj); + OPS_Get(&OPP_sym); + if ((((OPP_sym == 18 && obj != NIL)) && obj->mode == 11)) { + OPS_Get(&OPP_sym); + if (OPP_sym == 38) { + OPT_FindImport(obj, &obj); + OPS_Get(&OPP_sym); + } else { + OPP_err(38); + obj = NIL; + } + } + if (obj == NIL) { + OPP_err(0); + obj = OPT_NewObj(); + obj->mode = 1; + obj->typ = OPT_undftyp; + obj->adr = 0; + } else { + lev = obj->mnolev; + if ((__IN(obj->mode, 0x06) && lev != OPP_level)) { + obj->leaf = 0; + if (lev > 0) { + OPB_StaticLink(OPP_level - lev); + } + } + } + *id = obj; +} + +static void OPP_ConstExpression (OPT_Node *x) +{ + OPP_Expression(&*x); + if ((*x)->class != 7) { + OPP_err(50); + *x = OPB_NewIntConst(((LONGINT)(1))); + } +} + +static void OPP_CheckMark (SHORTINT *vis) +{ + OPS_Get(&OPP_sym); + if (OPP_sym == 1 || OPP_sym == 7) { + if (OPP_level > 0) { + OPP_err(47); + } + if (OPP_sym == 1) { + *vis = 1; + } else { + *vis = 2; + } + OPS_Get(&OPP_sym); + } else { + *vis = 0; + } +} + +static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_) +{ + OPT_Node x = NIL; + LONGINT sf; + if (OPP_sym == 31) { + OPS_Get(&OPP_sym); + if (!OPT_SYSimported) { + OPP_err(135); + } + OPP_ConstExpression(&x); + if (__IN(x->typ->form, 0x70)) { + sf = x->conval->intval; + if (sf < 0 || sf > 1) { + OPP_err(220); + sf = 0; + } + } else { + OPP_err(51); + sf = 0; + } + *sysflag = (int)sf; + OPP_CheckSym(23); + } else { + *sysflag = default_; + } +} + +static void OPP_RecordType (OPT_Struct *typ, OPT_Struct *banned) +{ + OPT_Object fld = NIL, first = NIL, last = NIL, base = NIL; + OPT_Struct ftyp = NIL; + INTEGER sysflag; + *typ = OPT_NewStr(15, 4); + (*typ)->BaseTyp = NIL; + OPP_CheckSysFlag(&sysflag, -1); + if (OPP_sym == 30) { + OPS_Get(&OPP_sym); + if (OPP_sym == 38) { + OPP_qualident(&base); + if ((base->mode == 5 && base->typ->comp == 4)) { + if (base->typ == *banned) { + OPP_err(58); + } else { + base->typ->pvused = 1; + (*typ)->BaseTyp = base->typ; + (*typ)->extlev = base->typ->extlev + 1; + (*typ)->sysflag = base->typ->sysflag; + } + } else { + OPP_err(52); + } + } else { + OPP_err(38); + } + OPP_CheckSym(22); + } + if (sysflag >= 0) { + (*typ)->sysflag = sysflag; + } + OPT_OpenScope(0, NIL); + first = NIL; + last = NIL; + for (;;) { + if (OPP_sym == 38) { + for (;;) { + if (OPP_sym == 38) { + if ((*typ)->BaseTyp != NIL) { + OPT_FindField(OPS_name, (*typ)->BaseTyp, &fld); + if (fld != NIL) { + OPP_err(1); + } + } + OPT_Insert(OPS_name, &fld); + OPP_CheckMark(&fld->vis); + fld->mode = 4; + fld->link = NIL; + fld->typ = OPT_undftyp; + if (first == NIL) { + first = fld; + } + if (last == NIL) { + (*typ)->link = fld; + } else { + last->link = fld; + } + last = fld; + } else { + OPP_err(38); + } + if (OPP_sym == 19) { + OPS_Get(&OPP_sym); + } else if (OPP_sym == 38) { + OPP_err(19); + } else { + break; + } + } + OPP_CheckSym(20); + OPP_Type(&ftyp, &*banned); + ftyp->pvused = 1; + if (ftyp->comp == 3) { + ftyp = OPT_undftyp; + OPP_err(88); + } + while (first != NIL) { + first->typ = ftyp; + first = first->link; + } + } + if (OPP_sym == 39) { + OPS_Get(&OPP_sym); + } else if (OPP_sym == 38) { + OPP_err(39); + } else { + break; + } + } + OPT_CloseScope(); +} + +static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) +{ + OPT_Node x = NIL; + LONGINT n; + INTEGER sysflag; + OPP_CheckSysFlag(&sysflag, 0); + if (OPP_sym == 25) { + *typ = OPT_NewStr(15, 3); + (*typ)->mno = 0; + (*typ)->sysflag = sysflag; + OPS_Get(&OPP_sym); + OPP_Type(&(*typ)->BaseTyp, &*banned); + (*typ)->BaseTyp->pvused = 1; + if ((*typ)->BaseTyp->comp == 3) { + (*typ)->n = (*typ)->BaseTyp->n + 1; + } else { + (*typ)->n = 0; + } + } else { + *typ = OPT_NewStr(15, 2); + (*typ)->sysflag = sysflag; + OPP_ConstExpression(&x); + if (__IN(x->typ->form, 0x70)) { + n = x->conval->intval; + if (n <= 0 || n > OPM_MaxIndex) { + OPP_err(63); + n = 1; + } + } else { + OPP_err(51); + n = 1; + } + (*typ)->n = n; + if (OPP_sym == 25) { + OPS_Get(&OPP_sym); + OPP_Type(&(*typ)->BaseTyp, &*banned); + (*typ)->BaseTyp->pvused = 1; + } else if (OPP_sym == 19) { + OPS_Get(&OPP_sym); + if (OPP_sym != 25) { + OPP_ArrayType(&(*typ)->BaseTyp, &*banned); + } + } else { + OPP_err(35); + } + if ((*typ)->BaseTyp->comp == 3) { + (*typ)->BaseTyp = OPT_undftyp; + OPP_err(88); + } + } +} + +static void OPP_PointerType (OPT_Struct *typ) +{ + OPT_Object id = NIL; + *typ = OPT_NewStr(13, 1); + OPP_CheckSysFlag(&(*typ)->sysflag, 0); + OPP_CheckSym(28); + if (OPP_sym == 38) { + OPT_Find(&id); + if (id == NIL) { + if (OPP_nofFwdPtr < 64) { + OPP_FwdPtr[__X(OPP_nofFwdPtr, ((LONGINT)(64)))] = *typ; + OPP_nofFwdPtr += 1; + } else { + OPP_err(224); + } + (*typ)->link = OPT_NewObj(); + __COPY(OPS_name, (*typ)->link->name, ((LONGINT)(256))); + (*typ)->BaseTyp = OPT_undftyp; + OPS_Get(&OPP_sym); + } else { + OPP_qualident(&id); + if (id->mode == 5) { + if (__IN(id->typ->comp, 0x1c)) { + (*typ)->BaseTyp = id->typ; + } else { + (*typ)->BaseTyp = OPT_undftyp; + OPP_err(57); + } + } else { + (*typ)->BaseTyp = OPT_undftyp; + OPP_err(52); + } + } + } else { + OPP_Type(&(*typ)->BaseTyp, &OPT_notyp); + if (!__IN((*typ)->BaseTyp->comp, 0x1c)) { + (*typ)->BaseTyp = OPT_undftyp; + OPP_err(57); + } + } +} + +static void OPP_FormalParameters (OPT_Object *firstPar, OPT_Struct *resTyp) +{ + SHORTINT mode; + OPT_Object par = NIL, first = NIL, last = NIL, res = NIL; + OPT_Struct typ = NIL; + first = NIL; + last = *firstPar; + if (OPP_sym == 38 || OPP_sym == 60) { + for (;;) { + if (OPP_sym == 60) { + OPS_Get(&OPP_sym); + mode = 2; + } else { + mode = 1; + } + for (;;) { + if (OPP_sym == 38) { + OPT_Insert(OPS_name, &par); + OPS_Get(&OPP_sym); + par->mode = mode; + par->link = NIL; + if (first == NIL) { + first = par; + } + if (*firstPar == NIL) { + *firstPar = par; + } else { + last->link = par; + } + last = par; + } else { + OPP_err(38); + } + if (OPP_sym == 19) { + OPS_Get(&OPP_sym); + } else if (OPP_sym == 38) { + OPP_err(19); + } else if (OPP_sym == 60) { + OPP_err(19); + OPS_Get(&OPP_sym); + } else { + break; + } + } + OPP_CheckSym(20); + OPP_Type(&typ, &OPT_notyp); + if (mode == 1) { + typ->pvused = 1; + } + while (first != NIL) { + first->typ = typ; + first = first->link; + } + if (OPP_sym == 39) { + OPS_Get(&OPP_sym); + } else if (OPP_sym == 38) { + OPP_err(39); + } else { + break; + } + } + } + OPP_CheckSym(22); + if (OPP_sym == 20) { + OPS_Get(&OPP_sym); + *resTyp = OPT_undftyp; + if (OPP_sym == 38) { + OPP_qualident(&res); + if (res->mode == 5) { + if (res->typ->form < 15) { + *resTyp = res->typ; + } else { + OPP_err(54); + } + } else { + OPP_err(52); + } + } else { + OPP_err(38); + } + } else { + *resTyp = OPT_notyp; + } +} + +static void OPP_TypeDecl (OPT_Struct *typ, OPT_Struct *banned) +{ + OPT_Object id = NIL; + *typ = OPT_undftyp; + if (OPP_sym < 30) { + OPP_err(12); + do { + OPS_Get(&OPP_sym); + } while (!(OPP_sym >= 30)); + } + if (OPP_sym == 38) { + OPP_qualident(&id); + if (id->mode == 5) { + if (id->typ != *banned) { + *typ = id->typ; + } else { + OPP_err(58); + } + } else { + OPP_err(52); + } + } else if (OPP_sym == 54) { + OPS_Get(&OPP_sym); + OPP_ArrayType(&*typ, &*banned); + } else if (OPP_sym == 55) { + OPS_Get(&OPP_sym); + OPP_RecordType(&*typ, &*banned); + OPB_Inittd(&OPP_TDinit, &OPP_lastTDinit, *typ); + OPP_CheckSym(41); + } else if (OPP_sym == 56) { + OPS_Get(&OPP_sym); + OPP_PointerType(&*typ); + } else if (OPP_sym == 61) { + OPS_Get(&OPP_sym); + *typ = OPT_NewStr(14, 1); + OPP_CheckSysFlag(&(*typ)->sysflag, 0); + if (OPP_sym == 30) { + OPS_Get(&OPP_sym); + OPT_OpenScope(OPP_level, NIL); + OPP_FormalParameters(&(*typ)->link, &(*typ)->BaseTyp); + OPT_CloseScope(); + } else { + (*typ)->BaseTyp = OPT_notyp; + (*typ)->link = NIL; + } + } else { + OPP_err(12); + } + for (;;) { + if (((OPP_sym >= 39 && OPP_sym <= 42) || OPP_sym == 22) || OPP_sym == 64) { + break; + } + OPP_err(15); + if (OPP_sym == 38) { + break; + } + OPS_Get(&OPP_sym); + } +} + +static void OPP_Type (OPT_Struct *typ, OPT_Struct *banned) +{ + OPP_TypeDecl(&*typ, &*banned); + if (((((*typ)->form == 13 && (*typ)->BaseTyp == OPT_undftyp)) && (*typ)->strobj == NIL)) { + OPP_err(0); + } +} + +static void OPP_selector (OPT_Node *x) +{ + OPT_Object obj = NIL, proc = NIL; + OPT_Node y = NIL; + OPT_Struct typ = NIL; + OPS_Name name; + for (;;) { + if (OPP_sym == 31) { + OPS_Get(&OPP_sym); + for (;;) { + if (((*x)->typ != NIL && (*x)->typ->form == 13)) { + OPB_DeRef(&*x); + } + OPP_Expression(&y); + OPB_Index(&*x, y); + if (OPP_sym == 19) { + OPS_Get(&OPP_sym); + } else { + break; + } + } + OPP_CheckSym(23); + } else if (OPP_sym == 18) { + OPS_Get(&OPP_sym); + if (OPP_sym == 38) { + __COPY(OPS_name, name, ((LONGINT)(256))); + OPS_Get(&OPP_sym); + if ((*x)->typ != NIL) { + if ((*x)->typ->form == 13) { + OPB_DeRef(&*x); + } + if ((*x)->typ->comp == 4) { + OPT_FindField(name, (*x)->typ, &obj); + OPB_Field(&*x, obj); + if ((obj != NIL && obj->mode == 13)) { + if (OPP_sym == 17) { + OPS_Get(&OPP_sym); + y = (*x)->left; + if (y->class == 3) { + y = y->left; + } + if (y->obj != NIL) { + proc = OPT_topScope; + while ((proc->link != NIL && proc->link->mode != 13)) { + proc = proc->left; + } + if (proc->link == NIL || proc->link->link != y->obj) { + OPP_err(75); + } + typ = y->obj->typ; + if (typ->form == 13) { + typ = typ->BaseTyp; + } + OPT_FindField((*x)->obj->name, typ->BaseTyp, &proc); + if (proc != NIL) { + (*x)->subcl = 1; + } else { + OPP_err(74); + } + } else { + OPP_err(75); + } + } + if ((obj->typ != OPT_notyp && OPP_sym != 30)) { + OPP_err(30); + } + } + } else { + OPP_err(53); + } + } else { + OPP_err(52); + } + } else { + OPP_err(38); + } + } else if (OPP_sym == 17) { + OPS_Get(&OPP_sym); + OPB_DeRef(&*x); + } else if ((((((OPP_sym == 30 && (*x)->class < 7)) && (*x)->typ->form != 14)) && ((*x)->obj == NIL || (*x)->obj->mode != 13))) { + OPS_Get(&OPP_sym); + if (OPP_sym == 38) { + OPP_qualident(&obj); + if (obj->mode == 5) { + OPB_TypTest(&*x, obj, 1); + } else { + OPP_err(52); + } + } else { + OPP_err(38); + } + OPP_CheckSym(22); + } else { + break; + } + } +} + +static void OPP_ActualParameters (OPT_Node *aparlist, OPT_Object fpar) +{ + OPT_Node apar = NIL, last = NIL; + *aparlist = NIL; + last = NIL; + if (OPP_sym != 22) { + for (;;) { + OPP_Expression(&apar); + if (fpar != NIL) { + OPB_Param(apar, fpar); + OPB_Link(&*aparlist, &last, apar); + fpar = fpar->link; + } else { + OPP_err(64); + } + if (OPP_sym == 19) { + OPS_Get(&OPP_sym); + } else if ((30 <= OPP_sym && OPP_sym <= 38)) { + OPP_err(19); + } else { + break; + } + } + } + if (fpar != NIL) { + OPP_err(65); + } +} + +static void OPP_StandProcCall (OPT_Node *x) +{ + OPT_Node y = NIL; + SHORTINT m; + INTEGER n; + m = (int)(*x)->obj->adr; + n = 0; + if (OPP_sym == 30) { + OPS_Get(&OPP_sym); + if (OPP_sym != 22) { + for (;;) { + if (n == 0) { + OPP_Expression(&*x); + OPB_StPar0(&*x, m); + n = 1; + } else if (n == 1) { + OPP_Expression(&y); + OPB_StPar1(&*x, y, m); + n = 2; + } else { + OPP_Expression(&y); + OPB_StParN(&*x, y, m, n); + n += 1; + } + if (OPP_sym == 19) { + OPS_Get(&OPP_sym); + } else if ((30 <= OPP_sym && OPP_sym <= 38)) { + OPP_err(19); + } else { + break; + } + } + OPP_CheckSym(22); + } else { + OPS_Get(&OPP_sym); + } + OPB_StFct(&*x, m, n); + } else { + OPP_err(30); + } + if ((OPP_level > 0 && (m == 1 || m == 30))) { + OPT_topScope->link->leaf = 0; + } +} + +static void OPP_Element (OPT_Node *x) +{ + OPT_Node y = NIL; + OPP_Expression(&*x); + if (OPP_sym == 21) { + OPS_Get(&OPP_sym); + OPP_Expression(&y); + OPB_SetRange(&*x, y); + } else { + OPB_SetElem(&*x); + } +} + +static void OPP_Sets (OPT_Node *x) +{ + OPT_Node y = NIL; + if (OPP_sym != 24) { + OPP_Element(&*x); + for (;;) { + if (OPP_sym == 19) { + OPS_Get(&OPP_sym); + } else if ((30 <= OPP_sym && OPP_sym <= 38)) { + OPP_err(19); + } else { + break; + } + OPP_Element(&y); + OPB_Op(6, &*x, y); + } + } else { + *x = OPB_EmptySet(); + } + OPP_CheckSym(24); +} + +static void OPP_Factor (OPT_Node *x) +{ + OPT_Object fpar = NIL, id = NIL; + OPT_Node apar = NIL; + if (OPP_sym < 30) { + OPP_err(13); + do { + OPS_Get(&OPP_sym); + } while (!(OPP_sym >= 30)); + } + if (OPP_sym == 38) { + OPP_qualident(&id); + *x = OPB_NewLeaf(id); + OPP_selector(&*x); + if (((*x)->class == 9 && (*x)->obj->mode == 8)) { + OPP_StandProcCall(&*x); + } else if (OPP_sym == 30) { + OPS_Get(&OPP_sym); + OPB_PrepCall(&*x, &fpar); + OPP_ActualParameters(&apar, fpar); + OPB_Call(&*x, apar, fpar); + OPP_CheckSym(22); + if (OPP_level > 0) { + OPT_topScope->link->leaf = 0; + } + } + } else if (OPP_sym == 35) { + switch (OPS_numtyp) { + case 1: + *x = OPB_NewIntConst(OPS_intval); + (*x)->typ = OPT_chartyp; + break; + case 2: + *x = OPB_NewIntConst(OPS_intval); + break; + case 3: + *x = OPB_NewRealConst(OPS_realval, OPT_realtyp); + break; + case 4: + *x = OPB_NewRealConst(OPS_lrlval, OPT_lrltyp); + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPP.Factor, OPS.numtyp = ", (LONGINT)44); + OPM_LogWNum(OPS_numtyp, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + OPS_Get(&OPP_sym); + } else if (OPP_sym == 37) { + *x = OPB_NewString(OPS_str, OPS_intval); + OPS_Get(&OPP_sym); + } else if (OPP_sym == 36) { + *x = OPB_Nil(); + OPS_Get(&OPP_sym); + } else if (OPP_sym == 30) { + OPS_Get(&OPP_sym); + OPP_Expression(&*x); + OPP_CheckSym(22); + } else if (OPP_sym == 31) { + OPS_Get(&OPP_sym); + OPP_err(30); + OPP_Expression(&*x); + OPP_CheckSym(22); + } else if (OPP_sym == 32) { + OPS_Get(&OPP_sym); + OPP_Sets(&*x); + } else if (OPP_sym == 33) { + OPS_Get(&OPP_sym); + OPP_Factor(&*x); + OPB_MOp(33, &*x); + } else { + OPP_err(13); + OPS_Get(&OPP_sym); + *x = NIL; + } + if (*x == NIL) { + *x = OPB_NewIntConst(((LONGINT)(1))); + (*x)->typ = OPT_undftyp; + } +} + +static void OPP_Term (OPT_Node *x) +{ + OPT_Node y = NIL; + SHORTINT mulop; + OPP_Factor(&*x); + while ((1 <= OPP_sym && OPP_sym <= 5)) { + mulop = OPP_sym; + OPS_Get(&OPP_sym); + OPP_Factor(&y); + OPB_Op(mulop, &*x, y); + } +} + +static void OPP_SimpleExpression (OPT_Node *x) +{ + OPT_Node y = NIL; + SHORTINT addop; + if (OPP_sym == 7) { + OPS_Get(&OPP_sym); + OPP_Term(&*x); + OPB_MOp(7, &*x); + } else if (OPP_sym == 6) { + OPS_Get(&OPP_sym); + OPP_Term(&*x); + OPB_MOp(6, &*x); + } else { + OPP_Term(&*x); + } + while ((6 <= OPP_sym && OPP_sym <= 8)) { + addop = OPP_sym; + OPS_Get(&OPP_sym); + OPP_Term(&y); + OPB_Op(addop, &*x, y); + } +} + +static void OPP_Expression (OPT_Node *x) +{ + OPT_Node y = NIL; + OPT_Object obj = NIL; + SHORTINT relation; + OPP_SimpleExpression(&*x); + if ((9 <= OPP_sym && OPP_sym <= 14)) { + relation = OPP_sym; + OPS_Get(&OPP_sym); + OPP_SimpleExpression(&y); + OPB_Op(relation, &*x, y); + } else if (OPP_sym == 15) { + OPS_Get(&OPP_sym); + OPP_SimpleExpression(&y); + OPB_In(&*x, y); + } else if (OPP_sym == 16) { + OPS_Get(&OPP_sym); + if (OPP_sym == 38) { + OPP_qualident(&obj); + if (obj->mode == 5) { + OPB_TypTest(&*x, obj, 0); + } else { + OPP_err(52); + } + } else { + OPP_err(38); + } + } +} + +static void OPP_Receiver (SHORTINT *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec) +{ + OPT_Object obj = NIL; + *typ = OPT_undftyp; + *rec = NIL; + if (OPP_sym == 60) { + OPS_Get(&OPP_sym); + *mode = 2; + } else { + *mode = 1; + } + __COPY(OPS_name, name, ((LONGINT)(256))); + OPP_CheckSym(38); + OPP_CheckSym(20); + if (OPP_sym == 38) { + OPT_Find(&obj); + OPS_Get(&OPP_sym); + if (obj == NIL) { + OPP_err(0); + } else if (obj->mode != 5) { + OPP_err(72); + } else { + *typ = obj->typ; + *rec = *typ; + if ((*rec)->form == 13) { + *rec = (*rec)->BaseTyp; + } + if (!((((*mode == 1 && (*typ)->form == 13)) && (*rec)->comp == 4) || (*mode == 2 && (*typ)->comp == 4))) { + OPP_err(70); + *rec = NIL; + } + if ((*rec != NIL && (*rec)->mno != OPP_level)) { + OPP_err(72); + *rec = NIL; + } + } + } else { + OPP_err(38); + } + OPP_CheckSym(22); + if (*rec == NIL) { + *rec = OPT_NewStr(15, 4); + (*rec)->BaseTyp = NIL; + } +} + +static BOOLEAN OPP_Extends (OPT_Struct x, OPT_Struct b) +{ + BOOLEAN _o_result; + if ((b->form == 13 && x->form == 13)) { + b = b->BaseTyp; + x = x->BaseTyp; + } + if ((b->comp == 4 && x->comp == 4)) { + do { + x = x->BaseTyp; + } while (!(x == NIL || x == b)); + } + _o_result = x == b; + return _o_result; +} + +static struct ProcedureDeclaration__16 { + OPT_Node *x; + OPT_Object *proc, *fwd; + OPS_Name *name; + SHORTINT *mode, *vis; + BOOLEAN *forward; + struct ProcedureDeclaration__16 *lnk; +} *ProcedureDeclaration__16_s; + +static void Body__17 (void); +static void GetCode__19 (void); +static void GetParams__21 (void); +static void TProcDecl__23 (void); + +static void GetCode__19 (void) +{ + OPT_ConstExt ext = NIL; + INTEGER n; + LONGINT c; + ext = OPT_NewExt(); + (*ProcedureDeclaration__16_s->proc)->conval->ext = ext; + n = 0; + if (OPP_sym == 37) { + while (OPS_str[__X(n, ((LONGINT)(256)))] != 0x00) { + (*ext)[__X(n + 1, ((LONGINT)(256)))] = OPS_str[__X(n, ((LONGINT)(256)))]; + n += 1; + } + (*ext)[0] = (CHAR)n; + OPS_Get(&OPP_sym); + } else { + for (;;) { + if (OPP_sym == 35) { + c = OPS_intval; + n += 1; + if ((c < 0 || c > 255) || n == 256) { + OPP_err(64); + c = 1; + n = 1; + } + OPS_Get(&OPP_sym); + (*ext)[__X(n, ((LONGINT)(256)))] = (CHAR)c; + } + if (OPP_sym == 19) { + OPS_Get(&OPP_sym); + } else if (OPP_sym == 35) { + OPP_err(19); + } else { + (*ext)[0] = (CHAR)n; + break; + } + } + } + (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1); +} + +static void GetParams__21 (void) +{ + (*ProcedureDeclaration__16_s->proc)->vis = *ProcedureDeclaration__16_s->vis; + (*ProcedureDeclaration__16_s->proc)->mode = *ProcedureDeclaration__16_s->mode; + (*ProcedureDeclaration__16_s->proc)->typ = OPT_notyp; + (*ProcedureDeclaration__16_s->proc)->conval = OPT_NewConst(); + (*ProcedureDeclaration__16_s->proc)->conval->setval = 0x0; + if (OPP_sym == 30) { + OPS_Get(&OPP_sym); + OPP_FormalParameters(&(*ProcedureDeclaration__16_s->proc)->link, &(*ProcedureDeclaration__16_s->proc)->typ); + } + if (*ProcedureDeclaration__16_s->fwd != NIL) { + OPB_CheckParameters((*ProcedureDeclaration__16_s->proc)->link, (*ProcedureDeclaration__16_s->fwd)->link, 1); + if ((*ProcedureDeclaration__16_s->proc)->typ != (*ProcedureDeclaration__16_s->fwd)->typ) { + OPP_err(117); + } + *ProcedureDeclaration__16_s->proc = *ProcedureDeclaration__16_s->fwd; + OPT_topScope = (*ProcedureDeclaration__16_s->proc)->scope; + if (*ProcedureDeclaration__16_s->mode == 10) { + (*ProcedureDeclaration__16_s->proc)->mode = 10; + } + } +} + +static void Body__17 (void) +{ + OPT_Node procdec = NIL, statseq = NIL; + LONGINT c; + c = OPM_errpos; + (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1); + OPP_CheckSym(39); + OPP_Block(&procdec, &statseq); + OPB_Enter(&procdec, statseq, *ProcedureDeclaration__16_s->proc); + *ProcedureDeclaration__16_s->x = procdec; + (*ProcedureDeclaration__16_s->x)->conval = OPT_NewConst(); + (*ProcedureDeclaration__16_s->x)->conval->intval = c; + if (OPP_sym == 38) { + if (__STRCMP(OPS_name, (*ProcedureDeclaration__16_s->proc)->name) != 0) { + OPP_err(4); + } + OPS_Get(&OPP_sym); + } else { + OPP_err(38); + } +} + +static void TProcDecl__23 (void) +{ + OPT_Object baseProc = NIL; + OPT_Struct objTyp = NIL, recTyp = NIL; + SHORTINT objMode; + OPS_Name objName; + OPS_Get(&OPP_sym); + *ProcedureDeclaration__16_s->mode = 13; + if (OPP_level > 0) { + OPP_err(73); + } + OPP_Receiver(&objMode, objName, &objTyp, &recTyp); + if (OPP_sym == 38) { + __COPY(OPS_name, *ProcedureDeclaration__16_s->name, ((LONGINT)(256))); + OPP_CheckMark(&*ProcedureDeclaration__16_s->vis); + OPT_FindField(*ProcedureDeclaration__16_s->name, recTyp, &*ProcedureDeclaration__16_s->fwd); + OPT_FindField(*ProcedureDeclaration__16_s->name, recTyp->BaseTyp, &baseProc); + if ((baseProc != NIL && baseProc->mode != 13)) { + baseProc = NIL; + } + if (*ProcedureDeclaration__16_s->fwd == baseProc) { + *ProcedureDeclaration__16_s->fwd = NIL; + } + if ((*ProcedureDeclaration__16_s->fwd != NIL && (*ProcedureDeclaration__16_s->fwd)->mnolev != OPP_level)) { + *ProcedureDeclaration__16_s->fwd = NIL; + } + if ((((*ProcedureDeclaration__16_s->fwd != NIL && (*ProcedureDeclaration__16_s->fwd)->mode == 13)) && !__IN(1, (*ProcedureDeclaration__16_s->fwd)->conval->setval))) { + *ProcedureDeclaration__16_s->proc = OPT_NewObj(); + (*ProcedureDeclaration__16_s->proc)->leaf = 1; + if ((*ProcedureDeclaration__16_s->fwd)->vis != *ProcedureDeclaration__16_s->vis) { + OPP_err(118); + } + } else { + if (*ProcedureDeclaration__16_s->fwd != NIL) { + OPP_err(1); + *ProcedureDeclaration__16_s->fwd = NIL; + } + OPT_OpenScope(0, NIL); + OPT_topScope->right = recTyp->link; + OPT_Insert(*ProcedureDeclaration__16_s->name, &*ProcedureDeclaration__16_s->proc); + recTyp->link = OPT_topScope->right; + OPT_CloseScope(); + } + OPP_level += 1; + OPT_OpenScope(OPP_level, *ProcedureDeclaration__16_s->proc); + OPT_Insert(objName, &(*ProcedureDeclaration__16_s->proc)->link); + (*ProcedureDeclaration__16_s->proc)->link->mode = objMode; + (*ProcedureDeclaration__16_s->proc)->link->typ = objTyp; + GetParams__21(); + if (baseProc != NIL) { + if (objMode != baseProc->link->mode || !OPP_Extends(objTyp, baseProc->link->typ)) { + OPP_err(115); + } + OPB_CheckParameters((*ProcedureDeclaration__16_s->proc)->link->link, baseProc->link->link, 0); + if ((*ProcedureDeclaration__16_s->proc)->typ != baseProc->typ) { + OPP_err(117); + } + if ((((((baseProc->vis == 1 && (*ProcedureDeclaration__16_s->proc)->vis == 0)) && recTyp->strobj != NIL)) && recTyp->strobj->vis == 1)) { + OPP_err(109); + } + (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(2); + } + if (!*ProcedureDeclaration__16_s->forward) { + Body__17(); + } + OPP_level -= 1; + OPT_CloseScope(); + } else { + OPP_err(38); + } +} + +static void OPP_ProcedureDeclaration (OPT_Node *x) +{ + OPT_Object proc = NIL, fwd = NIL; + OPS_Name name; + SHORTINT mode, vis; + BOOLEAN forward; + struct ProcedureDeclaration__16 _s; + _s.x = x; + _s.proc = &proc; + _s.fwd = &fwd; + _s.name = (void*)name; + _s.mode = &mode; + _s.vis = &vis; + _s.forward = &forward; + _s.lnk = ProcedureDeclaration__16_s; + ProcedureDeclaration__16_s = &_s; + proc = NIL; + forward = 0; + *x = NIL; + mode = 6; + if ((OPP_sym != 38 && OPP_sym != 30)) { + if (OPP_sym == 1) { + } else if (OPP_sym == 17) { + forward = 1; + } else if (OPP_sym == 6) { + mode = 10; + } else if (OPP_sym == 7) { + mode = 9; + } else { + OPP_err(38); + } + if ((__IN(mode, 0x0600) && !OPT_SYSimported)) { + OPP_err(135); + } + OPS_Get(&OPP_sym); + } + if (OPP_sym == 30) { + TProcDecl__23(); + } else if (OPP_sym == 38) { + OPT_Find(&fwd); + __COPY(OPS_name, name, ((LONGINT)(256))); + OPP_CheckMark(&vis); + if ((vis != 0 && mode == 6)) { + mode = 7; + } + if ((fwd != NIL && (fwd->mnolev != OPP_level || fwd->mode == 8))) { + fwd = NIL; + } + if ((((fwd != NIL && __IN(fwd->mode, 0xc0))) && !__IN(1, fwd->conval->setval))) { + proc = OPT_NewObj(); + proc->leaf = 1; + if (fwd->vis != vis) { + OPP_err(118); + } + } else { + if (fwd != NIL) { + OPP_err(1); + fwd = NIL; + } + OPT_Insert(name, &proc); + } + if ((mode != 6 && OPP_level > 0)) { + OPP_err(73); + } + OPP_level += 1; + OPT_OpenScope(OPP_level, proc); + proc->link = NIL; + GetParams__21(); + if (mode == 9) { + GetCode__19(); + } else if (!forward) { + Body__17(); + } + OPP_level -= 1; + OPT_CloseScope(); + } else { + OPP_err(38); + } + ProcedureDeclaration__16_s = _s.lnk; +} + +static void OPP_CaseLabelList (OPT_Node *lab, INTEGER LabelForm, INTEGER *n, OPP_CaseTable tab) +{ + OPT_Node x = NIL, y = NIL, lastlab = NIL; + INTEGER i, f; + LONGINT xval, yval; + *lab = NIL; + lastlab = NIL; + for (;;) { + OPP_ConstExpression(&x); + f = x->typ->form; + if (__IN(f, 0x78)) { + xval = x->conval->intval; + } else { + OPP_err(61); + xval = 1; + } + if (__IN(f, 0x70)) { + if (LabelForm < f) { + OPP_err(60); + } + } else if (LabelForm != f) { + OPP_err(60); + } + if (OPP_sym == 21) { + OPS_Get(&OPP_sym); + OPP_ConstExpression(&y); + yval = y->conval->intval; + if (((int)y->typ->form != f && !((__IN(f, 0x70) && __IN(y->typ->form, 0x70))))) { + OPP_err(60); + } + if (yval < xval) { + OPP_err(63); + yval = xval; + } + } else { + yval = xval; + } + x->conval->intval2 = yval; + i = *n; + if (i < 128) { + for (;;) { + if (i == 0) { + break; + } + if (tab[__X(i - 1, ((LONGINT)(128)))].low <= yval) { + if (tab[__X(i - 1, ((LONGINT)(128)))].high >= xval) { + OPP_err(62); + } + break; + } + tab[__X(i, ((LONGINT)(128)))] = tab[__X(i - 1, ((LONGINT)(128)))]; + i -= 1; + } + tab[__X(i, ((LONGINT)(128)))].low = xval; + tab[__X(i, ((LONGINT)(128)))].high = yval; + *n += 1; + } else { + OPP_err(213); + } + OPB_Link(&*lab, &lastlab, x); + if (OPP_sym == 19) { + OPS_Get(&OPP_sym); + } else if (OPP_sym == 35 || OPP_sym == 38) { + OPP_err(19); + } else { + break; + } + } +} + +static struct StatSeq__30 { + LONGINT *pos; + struct StatSeq__30 *lnk; +} *StatSeq__30_s; + +static void CasePart__31 (OPT_Node *x); +static void CheckBool__33 (OPT_Node *x); +static void SetPos__35 (OPT_Node x); + +static void CasePart__31 (OPT_Node *x) +{ + INTEGER n; + LONGINT low, high; + BOOLEAN e; + OPP_CaseTable tab; + OPT_Node cases = NIL, lab = NIL, y = NIL, lastcase = NIL; + OPP_Expression(&*x); + *StatSeq__30_s->pos = OPM_errpos; + if ((*x)->class == 8 || (*x)->class == 9) { + OPP_err(126); + } else if (!__IN((*x)->typ->form, 0x78)) { + OPP_err(125); + } + OPP_CheckSym(25); + cases = NIL; + lastcase = NIL; + n = 0; + for (;;) { + if (OPP_sym < 40) { + OPP_CaseLabelList(&lab, (*x)->typ->form, &n, tab); + OPP_CheckSym(20); + OPP_StatSeq(&y); + OPB_Construct(17, &lab, y); + OPB_Link(&cases, &lastcase, lab); + } + if (OPP_sym == 40) { + OPS_Get(&OPP_sym); + } else { + break; + } + } + if (n > 0) { + low = tab[0].low; + high = tab[__X(n - 1, ((LONGINT)(128)))].high; + if (high - low > 512) { + OPP_err(209); + } + } else { + low = 1; + high = 0; + } + e = OPP_sym == 42; + if (e) { + OPS_Get(&OPP_sym); + OPP_StatSeq(&y); + } else { + y = NIL; + OPM_Mark(-307, OPM_curpos); + } + OPB_Construct(16, &cases, y); + OPB_Construct(21, &*x, cases); + cases->conval = OPT_NewConst(); + cases->conval->intval = low; + cases->conval->intval2 = high; + if (e) { + cases->conval->setval = 0x02; + } else { + cases->conval->setval = 0x0; + } +} + +static void SetPos__35 (OPT_Node x) +{ + x->conval = OPT_NewConst(); + x->conval->intval = *StatSeq__30_s->pos; +} + +static void CheckBool__33 (OPT_Node *x) +{ + if ((*x)->class == 8 || (*x)->class == 9) { + OPP_err(126); + *x = OPB_NewBoolConst(0); + } else if ((*x)->typ->form != 2) { + OPP_err(120); + *x = OPB_NewBoolConst(0); + } + *StatSeq__30_s->pos = OPM_errpos; +} + +static void OPP_StatSeq (OPT_Node *stat) +{ + OPT_Object fpar = NIL, id = NIL, t = NIL, obj = NIL; + OPT_Struct idtyp = NIL; + BOOLEAN e; + OPT_Node s = NIL, x = NIL, y = NIL, z = NIL, apar = NIL, last = NIL, lastif = NIL; + LONGINT pos; + OPS_Name name; + struct StatSeq__30 _s; + _s.pos = &pos; + _s.lnk = StatSeq__30_s; + StatSeq__30_s = &_s; + *stat = NIL; + last = NIL; + for (;;) { + x = NIL; + if (OPP_sym < 38) { + OPP_err(14); + do { + OPS_Get(&OPP_sym); + } while (!(OPP_sym >= 38)); + } + if (OPP_sym == 38) { + OPP_qualident(&id); + x = OPB_NewLeaf(id); + OPP_selector(&x); + if (OPP_sym == 34) { + OPS_Get(&OPP_sym); + OPP_Expression(&y); + OPB_Assign(&x, y); + } else if (OPP_sym == 9) { + OPP_err(34); + OPS_Get(&OPP_sym); + OPP_Expression(&y); + OPB_Assign(&x, y); + } else if ((x->class == 9 && x->obj->mode == 8)) { + OPP_StandProcCall(&x); + if ((x != NIL && x->typ != OPT_notyp)) { + OPP_err(55); + } + } else { + OPB_PrepCall(&x, &fpar); + if (OPP_sym == 30) { + OPS_Get(&OPP_sym); + OPP_ActualParameters(&apar, fpar); + OPP_CheckSym(22); + } else { + apar = NIL; + if (fpar != NIL) { + OPP_err(65); + } + } + OPB_Call(&x, apar, fpar); + if (x->typ != OPT_notyp) { + OPP_err(55); + } + if (OPP_level > 0) { + OPT_topScope->link->leaf = 0; + } + } + pos = OPM_errpos; + } else if (OPP_sym == 45) { + OPS_Get(&OPP_sym); + OPP_Expression(&x); + CheckBool__33(&x); + OPP_CheckSym(26); + OPP_StatSeq(&y); + OPB_Construct(15, &x, y); + SetPos__35(x); + lastif = x; + while (OPP_sym == 43) { + OPS_Get(&OPP_sym); + OPP_Expression(&y); + CheckBool__33(&y); + OPP_CheckSym(26); + OPP_StatSeq(&z); + OPB_Construct(15, &y, z); + SetPos__35(y); + OPB_Link(&x, &lastif, y); + } + if (OPP_sym == 42) { + OPS_Get(&OPP_sym); + OPP_StatSeq(&y); + } else { + y = NIL; + } + OPB_Construct(20, &x, y); + OPP_CheckSym(41); + OPB_OptIf(&x); + pos = OPM_errpos; + } else if (OPP_sym == 46) { + OPS_Get(&OPP_sym); + CasePart__31(&x); + OPP_CheckSym(41); + } else if (OPP_sym == 47) { + OPS_Get(&OPP_sym); + OPP_Expression(&x); + CheckBool__33(&x); + OPP_CheckSym(27); + OPP_StatSeq(&y); + OPB_Construct(22, &x, y); + OPP_CheckSym(41); + } else if (OPP_sym == 48) { + OPS_Get(&OPP_sym); + OPP_StatSeq(&x); + if (OPP_sym == 44) { + OPS_Get(&OPP_sym); + OPP_Expression(&y); + CheckBool__33(&y); + } else { + OPP_err(44); + } + OPB_Construct(23, &x, y); + } else if (OPP_sym == 49) { + OPS_Get(&OPP_sym); + if (OPP_sym == 38) { + OPP_qualident(&id); + if (!__IN(id->typ->form, 0x70)) { + OPP_err(68); + } + OPP_CheckSym(34); + OPP_Expression(&y); + pos = OPM_errpos; + x = OPB_NewLeaf(id); + OPB_Assign(&x, y); + SetPos__35(x); + OPP_CheckSym(28); + OPP_Expression(&y); + pos = OPM_errpos; + if (y->class != 7) { + __MOVE("@@", name, 3); + OPT_Insert(name, &t); + __MOVE("@for", t->name, 5); + t->mode = 1; + t->typ = x->left->typ; + obj = OPT_topScope->scope; + if (obj == NIL) { + OPT_topScope->scope = t; + } else { + while (obj->link != NIL) { + obj = obj->link; + } + obj->link = t; + } + z = OPB_NewLeaf(t); + OPB_Assign(&z, y); + SetPos__35(z); + OPB_Link(&*stat, &last, z); + y = OPB_NewLeaf(t); + } else if (y->typ->form < 4 || y->typ->form > x->left->typ->form) { + OPP_err(113); + } + OPB_Link(&*stat, &last, x); + if (OPP_sym == 29) { + OPS_Get(&OPP_sym); + OPP_ConstExpression(&z); + } else { + z = OPB_NewIntConst(((LONGINT)(1))); + } + pos = OPM_errpos; + x = OPB_NewLeaf(id); + if (z->conval->intval > 0) { + OPB_Op(12, &x, y); + } else if (z->conval->intval < 0) { + OPB_Op(14, &x, y); + } else { + OPP_err(63); + OPB_Op(14, &x, y); + } + OPP_CheckSym(27); + OPP_StatSeq(&s); + y = OPB_NewLeaf(id); + OPB_StPar1(&y, z, 13); + SetPos__35(y); + if (s == NIL) { + s = y; + } else { + z = s; + while (z->link != NIL) { + z = z->link; + } + z->link = y; + } + OPP_CheckSym(41); + OPB_Construct(22, &x, s); + } else { + OPP_err(38); + } + } else if (OPP_sym == 50) { + OPS_Get(&OPP_sym); + OPP_LoopLevel += 1; + OPP_StatSeq(&x); + OPP_LoopLevel -= 1; + OPB_Construct(24, &x, NIL); + OPP_CheckSym(41); + pos = OPM_errpos; + } else if (OPP_sym == 51) { + OPS_Get(&OPP_sym); + idtyp = NIL; + x = NIL; + for (;;) { + if (OPP_sym == 38) { + OPP_qualident(&id); + y = OPB_NewLeaf(id); + if ((((id != NIL && id->typ->form == 13)) && (id->mode == 2 || !id->leaf))) { + OPP_err(245); + } + OPP_CheckSym(20); + if (OPP_sym == 38) { + OPP_qualident(&t); + if (t->mode == 5) { + if (id != NIL) { + idtyp = id->typ; + OPB_TypTest(&y, t, 0); + id->typ = t->typ; + } else { + OPP_err(130); + } + } else { + OPP_err(52); + } + } else { + OPP_err(38); + } + } else { + OPP_err(38); + } + pos = OPM_errpos; + OPP_CheckSym(27); + OPP_StatSeq(&s); + OPB_Construct(15, &y, s); + SetPos__35(y); + if (idtyp != NIL) { + id->typ = idtyp; + idtyp = NIL; + } + if (x == NIL) { + x = y; + lastif = x; + } else { + OPB_Link(&x, &lastif, y); + } + if (OPP_sym == 40) { + OPS_Get(&OPP_sym); + } else { + break; + } + } + e = OPP_sym == 42; + if (e) { + OPS_Get(&OPP_sym); + OPP_StatSeq(&s); + } else { + s = NIL; + } + OPB_Construct(27, &x, s); + OPP_CheckSym(41); + if (e) { + x->subcl = 1; + } + } else if (OPP_sym == 52) { + OPS_Get(&OPP_sym); + if (OPP_LoopLevel == 0) { + OPP_err(46); + } + OPB_Construct(25, &x, NIL); + pos = OPM_errpos; + } else if (OPP_sym == 53) { + OPS_Get(&OPP_sym); + if (OPP_sym < 39) { + OPP_Expression(&x); + } + if (OPP_level > 0) { + OPB_Return(&x, OPT_topScope->link); + } else { + OPB_Return(&x, NIL); + } + pos = OPM_errpos; + } + if (x != NIL) { + SetPos__35(x); + OPB_Link(&*stat, &last, x); + } + if (OPP_sym == 39) { + OPS_Get(&OPP_sym); + } else if (OPP_sym <= 38 || (45 <= OPP_sym && OPP_sym <= 53)) { + OPP_err(39); + } else { + break; + } + } + StatSeq__30_s = _s.lnk; +} + +static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) +{ + OPT_Struct typ = NIL; + OPT_Object obj = NIL, first = NIL, last = NIL; + OPT_Node x = NIL, lastdec = NIL; + INTEGER i; + first = NIL; + last = NIL; + OPP_nofFwdPtr = 0; + for (;;) { + if (OPP_sym == 58) { + OPS_Get(&OPP_sym); + while (OPP_sym == 38) { + OPT_Insert(OPS_name, &obj); + OPP_CheckMark(&obj->vis); + obj->typ = OPT_sinttyp; + obj->mode = 1; + if (OPP_sym == 9) { + OPS_Get(&OPP_sym); + OPP_ConstExpression(&x); + } else if (OPP_sym == 34) { + OPP_err(9); + OPS_Get(&OPP_sym); + OPP_ConstExpression(&x); + } else { + OPP_err(9); + x = OPB_NewIntConst(((LONGINT)(1))); + } + obj->mode = 3; + obj->typ = x->typ; + obj->conval = x->conval; + OPP_CheckSym(39); + } + } + if (OPP_sym == 59) { + OPS_Get(&OPP_sym); + while (OPP_sym == 38) { + OPT_Insert(OPS_name, &obj); + obj->mode = 5; + obj->typ = OPT_undftyp; + OPP_CheckMark(&obj->vis); + if (OPP_sym == 9) { + OPS_Get(&OPP_sym); + OPP_TypeDecl(&obj->typ, &obj->typ); + } else if (OPP_sym == 34 || OPP_sym == 20) { + OPP_err(9); + OPS_Get(&OPP_sym); + OPP_TypeDecl(&obj->typ, &obj->typ); + } else { + OPP_err(9); + } + if (obj->typ->strobj == NIL) { + obj->typ->strobj = obj; + } + if (__IN(obj->typ->comp, 0x1c)) { + i = 0; + while (i < OPP_nofFwdPtr) { + typ = OPP_FwdPtr[__X(i, ((LONGINT)(64)))]; + i += 1; + if (__STRCMP(typ->link->name, obj->name) == 0) { + typ->BaseTyp = obj->typ; + typ->link->name[0] = 0x00; + } + } + } + OPP_CheckSym(39); + } + } + if (OPP_sym == 60) { + OPS_Get(&OPP_sym); + while (OPP_sym == 38) { + for (;;) { + if (OPP_sym == 38) { + OPT_Insert(OPS_name, &obj); + OPP_CheckMark(&obj->vis); + obj->mode = 1; + obj->link = NIL; + obj->leaf = obj->vis == 0; + obj->typ = OPT_undftyp; + if (first == NIL) { + first = obj; + } + if (last == NIL) { + OPT_topScope->scope = obj; + } else { + last->link = obj; + } + last = obj; + } else { + OPP_err(38); + } + if (OPP_sym == 19) { + OPS_Get(&OPP_sym); + } else if (OPP_sym == 38) { + OPP_err(19); + } else { + break; + } + } + OPP_CheckSym(20); + OPP_Type(&typ, &OPT_notyp); + typ->pvused = 1; + if (typ->comp == 3) { + typ = OPT_undftyp; + OPP_err(88); + } + while (first != NIL) { + first->typ = typ; + first = first->link; + } + OPP_CheckSym(39); + } + } + if (OPP_sym < 58 || OPP_sym > 60) { + break; + } + } + i = 0; + while (i < OPP_nofFwdPtr) { + if (OPP_FwdPtr[__X(i, ((LONGINT)(64)))]->link->name[0] != 0x00) { + OPP_err(128); + } + OPP_FwdPtr[__X(i, ((LONGINT)(64)))] = NIL; + i += 1; + } + OPT_topScope->adr = OPM_errpos; + *procdec = NIL; + lastdec = NIL; + while (OPP_sym == 61) { + OPS_Get(&OPP_sym); + OPP_ProcedureDeclaration(&x); + if (x != NIL) { + if (lastdec == NIL) { + *procdec = x; + } else { + lastdec->link = x; + } + lastdec = x; + } + OPP_CheckSym(39); + } + if (OPP_sym == 57) { + OPS_Get(&OPP_sym); + OPP_StatSeq(&*statseq); + } else { + *statseq = NIL; + } + if ((OPP_level == 0 && OPP_TDinit != NIL)) { + OPP_lastTDinit->link = *statseq; + *statseq = OPP_TDinit; + } + OPP_CheckSym(41); +} + +void OPP_Module (OPT_Node *prog, SET opt) +{ + OPS_Name impName, aliasName; + OPT_Node procdec = NIL, statseq = NIL; + LONGINT c; + BOOLEAN done; + OPS_Init(); + OPP_LoopLevel = 0; + OPP_level = 0; + OPS_Get(&OPP_sym); + if (OPP_sym == 63) { + OPS_Get(&OPP_sym); + } else { + OPP_err(16); + } + if (OPP_sym == 38) { + OPM_LogWStr((CHAR*)"compiling ", (LONGINT)11); + OPM_LogWStr(OPS_name, ((LONGINT)(256))); + OPM_LogW('.'); + OPT_Init(OPS_name, opt); + OPS_Get(&OPP_sym); + OPP_CheckSym(39); + if (OPP_sym == 62) { + OPS_Get(&OPP_sym); + for (;;) { + if (OPP_sym == 38) { + __COPY(OPS_name, aliasName, ((LONGINT)(256))); + __COPY(aliasName, impName, ((LONGINT)(256))); + OPS_Get(&OPP_sym); + if (OPP_sym == 34) { + OPS_Get(&OPP_sym); + if (OPP_sym == 38) { + __COPY(OPS_name, impName, ((LONGINT)(256))); + OPS_Get(&OPP_sym); + } else { + OPP_err(38); + } + } + OPT_Import(aliasName, impName, &done); + } else { + OPP_err(38); + } + if (OPP_sym == 19) { + OPS_Get(&OPP_sym); + } else if (OPP_sym == 38) { + OPP_err(19); + } else { + break; + } + } + OPP_CheckSym(39); + } + if (OPM_noerr) { + OPP_TDinit = NIL; + OPP_lastTDinit = NIL; + c = OPM_errpos; + OPP_Block(&procdec, &statseq); + OPB_Enter(&procdec, statseq, NIL); + *prog = procdec; + (*prog)->conval = OPT_NewConst(); + (*prog)->conval->intval = c; + if (OPP_sym == 38) { + if (__STRCMP(OPS_name, OPT_SelfName) != 0) { + OPP_err(4); + } + OPS_Get(&OPP_sym); + } else { + OPP_err(38); + } + if (OPP_sym != 18) { + OPP_err(18); + } + } + } else { + OPP_err(38); + } + OPP_TDinit = NIL; + OPP_lastTDinit = NIL; +} + +static void EnumPtrs(void (*P)(void*)) +{ + P(OPP_TDinit); + P(OPP_lastTDinit); + __ENUMP(OPP_FwdPtr, 64, P); +} + +__TDESC(OPP__1, 1, 0) = {__TDFLDS("", 16), {-8}}; + +export void *OPP__init(void) +{ + __DEFMOD; + __MODULE_IMPORT(OPB); + __MODULE_IMPORT(OPM); + __MODULE_IMPORT(OPS); + __MODULE_IMPORT(OPT); + __REGMOD("OPP", EnumPtrs); + __INITYP(OPP__1, OPP__1, 0); +/* BEGIN */ + __ENDMOD; +} diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h new file mode 100644 index 00000000..30cf0643 --- /dev/null +++ b/bootstrap/unix-88/OPP.h @@ -0,0 +1,17 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ + +#ifndef OPP__h +#define OPP__h + +#define LARGE +#include "SYSTEM.h" +#include "OPT.h" + + + + +import void OPP_Module (OPT_Node *prog, SET opt); +import void *OPP__init(void); + + +#endif diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c new file mode 100644 index 00000000..bb08e1f5 --- /dev/null +++ b/bootstrap/unix-88/OPS.c @@ -0,0 +1,624 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin tspkaSfF */ +#define LARGE +#include "SYSTEM.h" +#include "OPM.h" + +typedef + CHAR OPS_Name[256]; + +typedef + CHAR OPS_String[256]; + + +export OPS_Name OPS_name; +export OPS_String OPS_str; +export INTEGER OPS_numtyp; +export LONGINT OPS_intval; +export REAL OPS_realval; +export LONGREAL OPS_lrlval; +static CHAR OPS_ch; + + +export void OPS_Get (SHORTINT *sym); +static void OPS_Identifier (SHORTINT *sym); +export void OPS_Init (void); +static void OPS_Number (void); +static void OPS_Str (SHORTINT *sym); +static void OPS_err (INTEGER n); + + +static void OPS_err (INTEGER n) +{ + OPM_err(n); +} + +static void OPS_Str (SHORTINT *sym) +{ + INTEGER i; + CHAR och; + i = 0; + och = OPS_ch; + for (;;) { + OPM_Get(&OPS_ch); + if (OPS_ch == och) { + break; + } + if (OPS_ch < ' ') { + OPS_err(3); + break; + } + if (i == 255) { + OPS_err(241); + break; + } + OPS_str[i] = OPS_ch; + i += 1; + } + OPM_Get(&OPS_ch); + OPS_str[i] = 0x00; + OPS_intval = i + 1; + if (OPS_intval == 2) { + *sym = 35; + OPS_numtyp = 1; + OPS_intval = (int)OPS_str[0]; + } else { + *sym = 37; + } +} + +static void OPS_Identifier (SHORTINT *sym) +{ + INTEGER i; + i = 0; + do { + OPS_name[i] = OPS_ch; + i += 1; + OPM_Get(&OPS_ch); + } while (!(((OPS_ch < '0' || ('9' < OPS_ch && __CAP(OPS_ch) < 'A')) || 'Z' < __CAP(OPS_ch)) || i == 256)); + if (i == 256) { + OPS_err(240); + i -= 1; + } + OPS_name[i] = 0x00; + *sym = 38; +} + +static struct Number__6 { + struct Number__6 *lnk; +} *Number__6_s; + +static INTEGER Ord__7 (CHAR ch, BOOLEAN hex); +static LONGREAL Ten__9 (INTEGER e); + +static LONGREAL Ten__9 (INTEGER e) +{ + LONGREAL _o_result; + LONGREAL x, p; + x = (LONGREAL)1; + p = (LONGREAL)10; + while (e > 0) { + if (__ODD(e)) { + x = x * p; + } + e = __ASHR(e, 1); + if (e > 0) { + p = p * p; + } + } + _o_result = x; + return _o_result; +} + +static INTEGER Ord__7 (CHAR ch, BOOLEAN hex) +{ + INTEGER _o_result; + if (ch <= '9') { + _o_result = (int)ch - 48; + return _o_result; + } else if (hex) { + _o_result = ((int)ch - 65) + 10; + return _o_result; + } else { + OPS_err(2); + _o_result = 0; + return _o_result; + } + __RETCHK; +} + +static void OPS_Number (void) +{ + INTEGER i, m, n, d, e; + CHAR dig[24]; + LONGREAL f; + CHAR expCh; + BOOLEAN neg; + struct Number__6 _s; + _s.lnk = Number__6_s; + Number__6_s = &_s; + i = 0; + m = 0; + n = 0; + d = 0; + for (;;) { + if (('0' <= OPS_ch && OPS_ch <= '9') || (((d == 0 && 'A' <= OPS_ch)) && OPS_ch <= 'F')) { + if (m > 0 || OPS_ch != '0') { + if (n < 24) { + dig[n] = OPS_ch; + n += 1; + } + m += 1; + } + OPM_Get(&OPS_ch); + i += 1; + } else if (OPS_ch == '.') { + OPM_Get(&OPS_ch); + if (OPS_ch == '.') { + OPS_ch = 0x7f; + break; + } else if (d == 0) { + d = i; + } else { + OPS_err(2); + } + } else { + break; + } + } + if (d == 0) { + if (n == m) { + OPS_intval = 0; + i = 0; + if (OPS_ch == 'X') { + OPM_Get(&OPS_ch); + OPS_numtyp = 1; + if (n <= 2) { + while (i < n) { + OPS_intval = __ASHL(OPS_intval, 4) + (LONGINT)Ord__7(dig[i], 1); + i += 1; + } + } else { + OPS_err(203); + } + } else if (OPS_ch == 'H') { + OPM_Get(&OPS_ch); + OPS_numtyp = 2; + if (n <= 8) { + if ((n == 8 && dig[0] > '7')) { + OPS_intval = -1; + } + while (i < n) { + OPS_intval = __ASHL(OPS_intval, 4) + (LONGINT)Ord__7(dig[i], 1); + i += 1; + } + } else { + OPS_err(203); + } + } else { + OPS_numtyp = 2; + while (i < n) { + d = Ord__7(dig[i], 0); + i += 1; + if (OPS_intval <= __DIV(9223372036854775807 - (LONGINT)d, 10)) { + OPS_intval = OPS_intval * 10 + (LONGINT)d; + } else { + OPS_err(203); + } + } + } + } else { + OPS_err(203); + } + } else { + f = (LONGREAL)0; + e = 0; + expCh = 'E'; + while (n > 0) { + n -= 1; + f = (Ord__7(dig[n], 0) + f) / (LONGREAL)(LONGREAL)10; + } + if (OPS_ch == 'E' || OPS_ch == 'D') { + expCh = OPS_ch; + OPM_Get(&OPS_ch); + neg = 0; + if (OPS_ch == '-') { + neg = 1; + OPM_Get(&OPS_ch); + } else if (OPS_ch == '+') { + OPM_Get(&OPS_ch); + } + if (('0' <= OPS_ch && OPS_ch <= '9')) { + do { + n = Ord__7(OPS_ch, 0); + OPM_Get(&OPS_ch); + if (e <= __DIV(2147483647 - n, 10)) { + e = e * 10 + n; + } else { + OPS_err(203); + } + } while (!(OPS_ch < '0' || '9' < OPS_ch)); + if (neg) { + e = -e; + } + } else { + OPS_err(2); + } + } + e -= (i - d) - m; + if (expCh == 'E') { + OPS_numtyp = 3; + if ((-37 < e && e <= 38)) { + if (e < 0) { + OPS_realval = (f / (LONGREAL)Ten__9(-e)); + } else { + OPS_realval = (f * Ten__9(e)); + } + } else { + OPS_err(203); + } + } else { + OPS_numtyp = 4; + if ((-307 < e && e <= 308)) { + if (e < 0) { + OPS_lrlval = f / (LONGREAL)Ten__9(-e); + } else { + OPS_lrlval = f * Ten__9(e); + } + } else { + OPS_err(203); + } + } + } + Number__6_s = _s.lnk; +} + +static struct Get__1 { + struct Get__1 *lnk; +} *Get__1_s; + +static void Comment__2 (void); + +static void Comment__2 (void) +{ + OPM_Get(&OPS_ch); + for (;;) { + for (;;) { + while (OPS_ch == '(') { + OPM_Get(&OPS_ch); + if (OPS_ch == '*') { + Comment__2(); + } + } + if (OPS_ch == '*') { + OPM_Get(&OPS_ch); + break; + } + if (OPS_ch == 0x00) { + break; + } + OPM_Get(&OPS_ch); + } + if (OPS_ch == ')') { + OPM_Get(&OPS_ch); + break; + } + if (OPS_ch == 0x00) { + OPS_err(5); + break; + } + } +} + +void OPS_Get (SHORTINT *sym) +{ + SHORTINT s; + struct Get__1 _s; + _s.lnk = Get__1_s; + Get__1_s = &_s; + OPM_errpos = OPM_curpos - 1; + while (OPS_ch <= ' ') { + if (OPS_ch == 0x00) { + *sym = 64; + return; + } else { + OPM_Get(&OPS_ch); + } + } + switch (OPS_ch) { + case '\"': case '\'': + OPS_Str(&s); + break; + case '#': + s = 10; + OPM_Get(&OPS_ch); + break; + case '&': + s = 5; + OPM_Get(&OPS_ch); + break; + case '(': + OPM_Get(&OPS_ch); + if (OPS_ch == '*') { + Comment__2(); + OPS_Get(&s); + } else { + s = 30; + } + break; + case ')': + s = 22; + OPM_Get(&OPS_ch); + break; + case '*': + s = 1; + OPM_Get(&OPS_ch); + break; + case '+': + s = 6; + OPM_Get(&OPS_ch); + break; + case ',': + s = 19; + OPM_Get(&OPS_ch); + break; + case '-': + s = 7; + OPM_Get(&OPS_ch); + break; + case '.': + OPM_Get(&OPS_ch); + if (OPS_ch == '.') { + OPM_Get(&OPS_ch); + s = 21; + } else { + s = 18; + } + break; + case '/': + s = 2; + OPM_Get(&OPS_ch); + break; + case '0': case '1': case '2': case '3': case '4': + case '5': case '6': case '7': case '8': case '9': + OPS_Number(); + s = 35; + break; + case ':': + OPM_Get(&OPS_ch); + if (OPS_ch == '=') { + OPM_Get(&OPS_ch); + s = 34; + } else { + s = 20; + } + break; + case ';': + s = 39; + OPM_Get(&OPS_ch); + break; + case '<': + OPM_Get(&OPS_ch); + if (OPS_ch == '=') { + OPM_Get(&OPS_ch); + s = 12; + } else { + s = 11; + } + break; + case '=': + s = 9; + OPM_Get(&OPS_ch); + break; + case '>': + OPM_Get(&OPS_ch); + if (OPS_ch == '=') { + OPM_Get(&OPS_ch); + s = 14; + } else { + s = 13; + } + break; + case 'A': + OPS_Identifier(&s); + if (__STRCMP(OPS_name, "ARRAY") == 0) { + s = 54; + } + break; + case 'B': + OPS_Identifier(&s); + if (__STRCMP(OPS_name, "BEGIN") == 0) { + s = 57; + } else if (__STRCMP(OPS_name, "BY") == 0) { + s = 29; + } + break; + case 'C': + OPS_Identifier(&s); + if (__STRCMP(OPS_name, "CASE") == 0) { + s = 46; + } else if (__STRCMP(OPS_name, "CONST") == 0) { + s = 58; + } + break; + case 'D': + OPS_Identifier(&s); + if (__STRCMP(OPS_name, "DO") == 0) { + s = 27; + } else if (__STRCMP(OPS_name, "DIV") == 0) { + s = 3; + } + break; + case 'E': + OPS_Identifier(&s); + if (__STRCMP(OPS_name, "END") == 0) { + s = 41; + } else if (__STRCMP(OPS_name, "ELSE") == 0) { + s = 42; + } else if (__STRCMP(OPS_name, "ELSIF") == 0) { + s = 43; + } else if (__STRCMP(OPS_name, "EXIT") == 0) { + s = 52; + } + break; + case 'F': + OPS_Identifier(&s); + if (__STRCMP(OPS_name, "FOR") == 0) { + s = 49; + } + break; + case 'I': + OPS_Identifier(&s); + if (__STRCMP(OPS_name, "IF") == 0) { + s = 45; + } else if (__STRCMP(OPS_name, "IN") == 0) { + s = 15; + } else if (__STRCMP(OPS_name, "IS") == 0) { + s = 16; + } else if (__STRCMP(OPS_name, "IMPORT") == 0) { + s = 62; + } + break; + case 'L': + OPS_Identifier(&s); + if (__STRCMP(OPS_name, "LOOP") == 0) { + s = 50; + } + break; + case 'M': + OPS_Identifier(&s); + if (__STRCMP(OPS_name, "MOD") == 0) { + s = 4; + } else if (__STRCMP(OPS_name, "MODULE") == 0) { + s = 63; + } + break; + case 'N': + OPS_Identifier(&s); + if (__STRCMP(OPS_name, "NIL") == 0) { + s = 36; + } + break; + case 'O': + OPS_Identifier(&s); + if (__STRCMP(OPS_name, "OR") == 0) { + s = 8; + } else if (__STRCMP(OPS_name, "OF") == 0) { + s = 25; + } + break; + case 'P': + OPS_Identifier(&s); + if (__STRCMP(OPS_name, "PROCEDURE") == 0) { + s = 61; + } else if (__STRCMP(OPS_name, "POINTER") == 0) { + s = 56; + } + break; + case 'R': + OPS_Identifier(&s); + if (__STRCMP(OPS_name, "RECORD") == 0) { + s = 55; + } else if (__STRCMP(OPS_name, "REPEAT") == 0) { + s = 48; + } else if (__STRCMP(OPS_name, "RETURN") == 0) { + s = 53; + } + break; + case 'T': + OPS_Identifier(&s); + if (__STRCMP(OPS_name, "THEN") == 0) { + s = 26; + } else if (__STRCMP(OPS_name, "TO") == 0) { + s = 28; + } else if (__STRCMP(OPS_name, "TYPE") == 0) { + s = 59; + } + break; + case 'U': + OPS_Identifier(&s); + if (__STRCMP(OPS_name, "UNTIL") == 0) { + s = 44; + } + break; + case 'V': + OPS_Identifier(&s); + if (__STRCMP(OPS_name, "VAR") == 0) { + s = 60; + } + break; + case 'W': + OPS_Identifier(&s); + if (__STRCMP(OPS_name, "WHILE") == 0) { + s = 47; + } else if (__STRCMP(OPS_name, "WITH") == 0) { + s = 51; + } + break; + case 'G': case 'H': case 'J': case 'K': case 'Q': + case 'S': case 'X': case 'Y': case 'Z': + OPS_Identifier(&s); + break; + case '[': + s = 31; + OPM_Get(&OPS_ch); + break; + case ']': + s = 23; + OPM_Get(&OPS_ch); + break; + case '^': + s = 17; + OPM_Get(&OPS_ch); + break; + case 'a': case 'b': case 'c': case 'd': case 'e': + case 'f': case 'g': case 'h': case 'i': case 'j': + case 'k': case 'l': case 'm': case 'n': case 'o': + case 'p': case 'q': case 'r': case 's': case 't': + case 'u': case 'v': case 'w': case 'x': case 'y': + case 'z': + OPS_Identifier(&s); + break; + case '{': + s = 32; + OPM_Get(&OPS_ch); + break; + case '|': + s = 40; + OPM_Get(&OPS_ch); + break; + case '}': + s = 24; + OPM_Get(&OPS_ch); + break; + case '~': + s = 33; + OPM_Get(&OPS_ch); + break; + case 0x7f: + s = 21; + OPM_Get(&OPS_ch); + break; + default: + s = 0; + OPM_Get(&OPS_ch); + break; + } + *sym = s; + Get__1_s = _s.lnk; +} + +void OPS_Init (void) +{ + OPS_ch = ' '; +} + + +export void *OPS__init(void) +{ + __DEFMOD; + __MODULE_IMPORT(OPM); + __REGMOD("OPS", 0); + __REGCMD("Init", OPS_Init); +/* BEGIN */ + __ENDMOD; +} diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h new file mode 100644 index 00000000..eab85912 --- /dev/null +++ b/bootstrap/unix-88/OPS.h @@ -0,0 +1,29 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin tspkaSfF */ + +#ifndef OPS__h +#define OPS__h + +#define LARGE +#include "SYSTEM.h" + +typedef + CHAR OPS_Name[256]; + +typedef + CHAR OPS_String[256]; + + +import OPS_Name OPS_name; +import OPS_String OPS_str; +import INTEGER OPS_numtyp; +import LONGINT OPS_intval; +import REAL OPS_realval; +import LONGREAL OPS_lrlval; + + +import void OPS_Get (SHORTINT *sym); +import void OPS_Init (void); +import void *OPS__init(void); + + +#endif diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c new file mode 100644 index 00000000..5f8854a1 --- /dev/null +++ b/bootstrap/unix-88/OPT.c @@ -0,0 +1,1859 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +#define LARGE +#include "SYSTEM.h" +#include "OPM.h" +#include "OPS.h" + +typedef + struct OPT_ConstDesc *OPT_Const; + +typedef + OPS_String *OPT_ConstExt; + +typedef + struct OPT_ConstDesc { + OPT_ConstExt ext; + LONGINT intval, intval2; + SET setval; + LONGREAL realval; + } OPT_ConstDesc; + +typedef + struct OPT_ExpCtxt { + LONGINT reffp; + INTEGER ref; + SHORTINT nofm; + SHORTINT locmno[64]; + } OPT_ExpCtxt; + +typedef + struct OPT_StrDesc *OPT_Struct; + +typedef + struct OPT_ObjDesc *OPT_Object; + +typedef + struct OPT_ImpCtxt { + LONGINT nextTag, reffp; + INTEGER nofr, minr, nofm; + BOOLEAN self; + OPT_Struct ref[255]; + OPT_Object old[255]; + LONGINT pvfp[255]; + SHORTINT glbmno[64]; + } OPT_ImpCtxt; + +typedef + struct OPT_NodeDesc *OPT_Node; + +typedef + struct OPT_NodeDesc { + OPT_Node left, right, link; + SHORTINT class, subcl; + BOOLEAN readonly; + OPT_Struct typ; + OPT_Object obj; + OPT_Const conval; + } OPT_NodeDesc; + +typedef + struct OPT_ObjDesc { + OPT_Object left, right, link, scope; + OPS_Name name; + BOOLEAN leaf; + SHORTINT mode, mnolev, vis, history; + BOOLEAN used, fpdone; + LONGINT fprint; + OPT_Struct typ; + OPT_Const conval; + LONGINT adr, linkadr; + INTEGER x; + } OPT_ObjDesc; + +typedef + struct OPT_StrDesc { + SHORTINT form, comp, mno, extlev; + INTEGER ref, sysflag; + LONGINT n, size, align, txtpos; + BOOLEAN allocated, pbused, pvused, fpdone, idfpdone; + LONGINT idfp, pbfp, pvfp; + OPT_Struct BaseTyp; + OPT_Object link, strobj; + } OPT_StrDesc; + + +export void (*OPT_typSize)(OPT_Struct); +export OPT_Object OPT_topScope; +export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +export SHORTINT OPT_nofGmod; +export OPT_Object OPT_GlbMod[64]; +export OPS_Name OPT_SelfName; +export BOOLEAN OPT_SYSimported; +static OPT_Object OPT_universe, OPT_syslink; +static OPT_ImpCtxt OPT_impCtxt; +static OPT_ExpCtxt OPT_expCtxt; +static LONGINT OPT_nofhdfld; +static BOOLEAN OPT_newsf, OPT_findpc, OPT_extsf, OPT_sfpresent, OPT_symExtended, OPT_symNew; + +export LONGINT *OPT_ConstDesc__typ; +export LONGINT *OPT_ObjDesc__typ; +export LONGINT *OPT_StrDesc__typ; +export LONGINT *OPT_NodeDesc__typ; +export LONGINT *OPT_ImpCtxt__typ; +export LONGINT *OPT_ExpCtxt__typ; + +export void OPT_Close (void); +export void OPT_CloseScope (void); +static void OPT_DebugStruct (OPT_Struct btyp); +static void OPT_EnterBoolConst (OPS_Name name, LONGINT value); +static void OPT_EnterProc (OPS_Name name, INTEGER num); +static void OPT_EnterTyp (OPS_Name name, SHORTINT form, INTEGER size, OPT_Struct *res); +export void OPT_Export (BOOLEAN *ext, BOOLEAN *new); +export void OPT_FPrintErr (OPT_Object obj, INTEGER errcode); +static void OPT_FPrintName (LONGINT *fp, CHAR *name, LONGINT name__len); +export void OPT_FPrintObj (OPT_Object obj); +static void OPT_FPrintSign (LONGINT *fp, OPT_Struct result, OPT_Object par); +export void OPT_FPrintStr (OPT_Struct typ); +export void OPT_Find (OPT_Object *res); +export void OPT_FindField (OPS_Name name, OPT_Struct typ, OPT_Object *res); +export void OPT_FindImport (OPT_Object mod, OPT_Object *res); +export void OPT_IdFPrint (OPT_Struct typ); +export void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); +static void OPT_InConstant (LONGINT f, OPT_Const conval); +static OPT_Object OPT_InFld (void); +static void OPT_InMod (SHORTINT *mno); +static void OPT_InName (CHAR *name, LONGINT name__len); +static OPT_Object OPT_InObj (SHORTINT mno); +static void OPT_InSign (SHORTINT mno, OPT_Struct *res, OPT_Object *par); +static void OPT_InStruct (OPT_Struct *typ); +static OPT_Object OPT_InTProc (SHORTINT mno); +export void OPT_Init (OPS_Name name, SET opt); +static void OPT_InitStruct (OPT_Struct *typ, SHORTINT form); +export void OPT_Insert (OPS_Name name, OPT_Object *obj); +export void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); +export OPT_Const OPT_NewConst (void); +export OPT_ConstExt OPT_NewExt (void); +export OPT_Node OPT_NewNode (SHORTINT class); +export OPT_Object OPT_NewObj (void); +export OPT_Struct OPT_NewStr (SHORTINT form, SHORTINT comp); +export void OPT_OpenScope (SHORTINT level, OPT_Object owner); +static void OPT_OutConstant (OPT_Object obj); +static void OPT_OutFlds (OPT_Object fld, LONGINT adr, BOOLEAN visible); +static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, LONGINT adr); +static void OPT_OutMod (INTEGER mno); +static void OPT_OutName (CHAR *name, LONGINT name__len); +static void OPT_OutObj (OPT_Object obj); +static void OPT_OutSign (OPT_Struct result, OPT_Object par); +static void OPT_OutStr (OPT_Struct typ); +static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj); +static void OPT_err (INTEGER n); + + +static void OPT_err (INTEGER n) +{ + OPM_err(n); +} + +OPT_Const OPT_NewConst (void) +{ + OPT_Const _o_result; + OPT_Const const_ = NIL; + __NEW(const_, OPT_ConstDesc); + _o_result = const_; + return _o_result; +} + +OPT_Object OPT_NewObj (void) +{ + OPT_Object _o_result; + OPT_Object obj = NIL; + __NEW(obj, OPT_ObjDesc); + _o_result = obj; + return _o_result; +} + +OPT_Struct OPT_NewStr (SHORTINT form, SHORTINT comp) +{ + OPT_Struct _o_result; + OPT_Struct typ = NIL; + __NEW(typ, OPT_StrDesc); + typ->form = form; + typ->comp = comp; + typ->ref = 255; + if (form != 0) { + typ->txtpos = OPM_errpos; + } + typ->size = -1; + typ->BaseTyp = OPT_undftyp; + _o_result = typ; + return _o_result; +} + +OPT_Node OPT_NewNode (SHORTINT class) +{ + OPT_Node _o_result; + OPT_Node node = NIL; + __NEW(node, OPT_NodeDesc); + node->class = class; + _o_result = node; + return _o_result; +} + +OPT_ConstExt OPT_NewExt (void) +{ + OPT_ConstExt _o_result; + OPT_ConstExt ext = NIL; + ext = __NEWARR(NIL, ((LONGINT)(1)), 1, 1, 0, (LONGINT)256); + _o_result = ext; + return _o_result; +} + +void OPT_OpenScope (SHORTINT level, OPT_Object owner) +{ + OPT_Object head = NIL; + head = OPT_NewObj(); + head->mode = 12; + head->mnolev = level; + head->link = owner; + if (owner != NIL) { + owner->scope = head; + } + head->left = OPT_topScope; + head->right = NIL; + head->scope = NIL; + OPT_topScope = head; +} + +void OPT_CloseScope (void) +{ + OPT_topScope = OPT_topScope->left; +} + +void OPT_Init (OPS_Name name, SET opt) +{ + OPT_topScope = OPT_universe; + OPT_OpenScope(0, NIL); + OPT_SYSimported = 0; + __COPY(name, OPT_SelfName, ((LONGINT)(256))); + __COPY(name, OPT_topScope->name, ((LONGINT)(256))); + OPT_GlbMod[0] = OPT_topScope; + OPT_nofGmod = 1; + OPT_newsf = __IN(4, opt); + OPT_findpc = __IN(8, opt); + OPT_extsf = OPT_newsf || __IN(9, opt); + OPT_sfpresent = 1; +} + +void OPT_Close (void) +{ + INTEGER i; + OPT_CloseScope(); + i = 0; + while (i < 64) { + OPT_GlbMod[__X(i, ((LONGINT)(64)))] = NIL; + i += 1; + } + i = 16; + while (i < 255) { + OPT_impCtxt.ref[__X(i, ((LONGINT)(255)))] = NIL; + OPT_impCtxt.old[__X(i, ((LONGINT)(255)))] = NIL; + i += 1; + } +} + +void OPT_FindImport (OPT_Object mod, OPT_Object *res) +{ + OPT_Object obj = NIL; + obj = mod->scope; + for (;;) { + if (obj == NIL) { + break; + } + if (__STRCMP(OPS_name, obj->name) < 0) { + obj = obj->left; + } else if (__STRCMP(OPS_name, obj->name) > 0) { + obj = obj->right; + } else { + if ((obj->mode == 5 && obj->vis == 0)) { + obj = NIL; + } else { + obj->used = 1; + } + break; + } + } + *res = obj; +} + +void OPT_Find (OPT_Object *res) +{ + OPT_Object obj = NIL, head = NIL; + head = OPT_topScope; + for (;;) { + obj = head->right; + for (;;) { + if (obj == NIL) { + break; + } + if (__STRCMP(OPS_name, obj->name) < 0) { + obj = obj->left; + } else if (__STRCMP(OPS_name, obj->name) > 0) { + obj = obj->right; + } else { + break; + } + } + if (obj != NIL) { + break; + } + head = head->left; + if (head == NIL) { + break; + } + } + *res = obj; +} + +void OPT_FindField (OPS_Name name, OPT_Struct typ, OPT_Object *res) +{ + OPT_Object obj = NIL; + while (typ != NIL) { + obj = typ->link; + while (obj != NIL) { + if (__STRCMP(name, obj->name) < 0) { + obj = obj->left; + } else if (__STRCMP(name, obj->name) > 0) { + obj = obj->right; + } else { + *res = obj; + return; + } + } + typ = typ->BaseTyp; + } + *res = NIL; +} + +void OPT_Insert (OPS_Name name, OPT_Object *obj) +{ + OPT_Object ob0 = NIL, ob1 = NIL; + BOOLEAN left; + SHORTINT mnolev; + ob0 = OPT_topScope; + ob1 = ob0->right; + left = 0; + for (;;) { + if (ob1 != NIL) { + if (__STRCMP(name, ob1->name) < 0) { + ob0 = ob1; + ob1 = ob0->left; + left = 1; + } else if (__STRCMP(name, ob1->name) > 0) { + ob0 = ob1; + ob1 = ob0->right; + left = 0; + } else { + OPT_err(1); + ob0 = ob1; + ob1 = ob0->right; + } + } else { + ob1 = OPT_NewObj(); + ob1->leaf = 1; + if (left) { + ob0->left = ob1; + } else { + ob0->right = ob1; + } + ob1->left = NIL; + ob1->right = NIL; + __COPY(name, ob1->name, ((LONGINT)(256))); + mnolev = OPT_topScope->mnolev; + ob1->mnolev = mnolev; + break; + } + } + *obj = ob1; +} + +static void OPT_FPrintName (LONGINT *fp, CHAR *name, LONGINT name__len) +{ + INTEGER i; + CHAR ch; + i = 0; + do { + ch = name[__X(i, name__len)]; + OPM_FPrint(&*fp, (int)ch); + i += 1; + } while (!(ch == 0x00)); +} + +static void OPT_DebugStruct (OPT_Struct btyp) +{ + OPM_LogWLn(); + if (btyp == NIL) { + OPM_LogWStr((CHAR*)"btyp is nil", (LONGINT)12); + OPM_LogWLn(); + } + OPM_LogWStr((CHAR*)"btyp^.strobji^.name = ", (LONGINT)23); + OPM_LogWStr(btyp->strobj->name, ((LONGINT)(256))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"btyp^.form = ", (LONGINT)14); + OPM_LogWNum(btyp->form, ((LONGINT)(0))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"btyp^.comp = ", (LONGINT)14); + OPM_LogWNum(btyp->comp, ((LONGINT)(0))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"btyp^.mno = ", (LONGINT)13); + OPM_LogWNum(btyp->mno, ((LONGINT)(0))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"btyp^.extlev = ", (LONGINT)16); + OPM_LogWNum(btyp->extlev, ((LONGINT)(0))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"btyp^.size = ", (LONGINT)14); + OPM_LogWNum(btyp->size, ((LONGINT)(0))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"btyp^.align = ", (LONGINT)15); + OPM_LogWNum(btyp->align, ((LONGINT)(0))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"btyp^.txtpos = ", (LONGINT)16); + OPM_LogWNum(btyp->txtpos, ((LONGINT)(0))); + OPM_LogWLn(); +} + +static void OPT_FPrintSign (LONGINT *fp, OPT_Struct result, OPT_Object par) +{ + OPT_IdFPrint(result); + OPM_FPrint(&*fp, result->idfp); + while (par != NIL) { + OPM_FPrint(&*fp, par->mode); + OPT_IdFPrint(par->typ); + OPM_FPrint(&*fp, par->typ->idfp); + par = par->link; + } +} + +void OPT_IdFPrint (OPT_Struct typ) +{ + OPT_Struct btyp = NIL; + OPT_Object strobj = NIL; + LONGINT idfp; + INTEGER f, c; + if (!typ->idfpdone) { + typ->idfpdone = 1; + idfp = 0; + f = typ->form; + c = typ->comp; + OPM_FPrint(&idfp, f); + OPM_FPrint(&idfp, c); + btyp = typ->BaseTyp; + strobj = typ->strobj; + if ((strobj != NIL && strobj->name[0] != 0x00)) { + OPT_FPrintName(&idfp, (void*)OPT_GlbMod[__X(typ->mno, ((LONGINT)(64)))]->name, ((LONGINT)(256))); + OPT_FPrintName(&idfp, (void*)strobj->name, ((LONGINT)(256))); + } + if ((f == 13 || (c == 4 && btyp != NIL)) || c == 3) { + OPT_IdFPrint(btyp); + OPM_FPrint(&idfp, btyp->idfp); + } else if (c == 2) { + OPT_IdFPrint(btyp); + OPM_FPrint(&idfp, btyp->idfp); + OPM_FPrint(&idfp, typ->n); + } else if (f == 14) { + OPT_FPrintSign(&idfp, btyp, typ->link); + } + typ->idfp = idfp; + } +} + +static struct FPrintStr__12 { + LONGINT *pbfp, *pvfp; + struct FPrintStr__12 *lnk; +} *FPrintStr__12_s; + +static void FPrintFlds__13 (OPT_Object fld, LONGINT adr, BOOLEAN visible); +static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr); +static void FPrintTProcs__17 (OPT_Object obj); + +static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr) +{ + LONGINT i, j, n; + OPT_Struct btyp = NIL; + if (typ->comp == 4) { + FPrintFlds__13(typ->link, adr, 0); + } else if (typ->comp == 2) { + btyp = typ->BaseTyp; + n = typ->n; + while (btyp->comp == 2) { + n = btyp->n * n; + btyp = btyp->BaseTyp; + } + if (btyp->form == 13 || btyp->comp == 4) { + j = OPT_nofhdfld; + FPrintHdFld__15(btyp, fld, adr); + if (j != OPT_nofhdfld) { + i = 1; + while ((i < n && OPT_nofhdfld <= 2048)) { + adr += btyp->size; + FPrintHdFld__15(btyp, fld, adr); + i += 1; + } + } + } + } else if (typ->form == 13 || __STRCMP(fld->name, "@ptr") == 0) { + OPM_FPrint(&*FPrintStr__12_s->pvfp, ((LONGINT)(13))); + OPM_FPrint(&*FPrintStr__12_s->pvfp, adr); + OPT_nofhdfld += 1; + } +} + +static void FPrintFlds__13 (OPT_Object fld, LONGINT adr, BOOLEAN visible) +{ + while ((fld != NIL && fld->mode == 4)) { + if ((fld->vis != 0 && visible)) { + OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->vis); + OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)fld->name, ((LONGINT)(256))); + OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->adr); + OPT_FPrintStr(fld->typ); + OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->typ->pbfp); + OPM_FPrint(&*FPrintStr__12_s->pvfp, fld->typ->pvfp); + } else { + FPrintHdFld__15(fld->typ, fld, fld->adr + adr); + } + fld = fld->link; + } +} + +static void FPrintTProcs__17 (OPT_Object obj) +{ + if (obj != NIL) { + FPrintTProcs__17(obj->left); + if (obj->mode == 13) { + if (obj->vis != 0) { + OPM_FPrint(&*FPrintStr__12_s->pbfp, ((LONGINT)(13))); + OPM_FPrint(&*FPrintStr__12_s->pbfp, __ASHR(obj->adr, 16)); + OPT_FPrintSign(&*FPrintStr__12_s->pbfp, obj->typ, obj->link); + OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)obj->name, ((LONGINT)(256))); + } + } + FPrintTProcs__17(obj->right); + } +} + +void OPT_FPrintStr (OPT_Struct typ) +{ + INTEGER f, c; + OPT_Struct btyp = NIL; + OPT_Object strobj = NIL, bstrobj = NIL; + LONGINT pbfp, pvfp; + struct FPrintStr__12 _s; + _s.pbfp = &pbfp; + _s.pvfp = &pvfp; + _s.lnk = FPrintStr__12_s; + FPrintStr__12_s = &_s; + if (!typ->fpdone) { + OPT_IdFPrint(typ); + pbfp = typ->idfp; + if (typ->sysflag != 0) { + OPM_FPrint(&pbfp, typ->sysflag); + } + pvfp = pbfp; + typ->pbfp = pbfp; + typ->pvfp = pvfp; + typ->fpdone = 1; + f = typ->form; + c = typ->comp; + btyp = typ->BaseTyp; + if (f == 13) { + strobj = typ->strobj; + bstrobj = btyp->strobj; + if (((strobj == NIL || strobj->name[0] == 0x00) || bstrobj == NIL) || bstrobj->name[0] == 0x00) { + OPT_FPrintStr(btyp); + OPM_FPrint(&pbfp, btyp->pbfp); + pvfp = pbfp; + } + } else if (f == 14) { + } else if (__IN(c, 0x0c)) { + OPT_FPrintStr(btyp); + OPM_FPrint(&pbfp, btyp->pvfp); + pvfp = pbfp; + } else { + if (btyp != NIL) { + OPT_FPrintStr(btyp); + OPM_FPrint(&pbfp, btyp->pbfp); + OPM_FPrint(&pvfp, btyp->pvfp); + } + OPM_FPrint(&pvfp, typ->size); + OPM_FPrint(&pvfp, typ->align); + OPM_FPrint(&pvfp, typ->n); + OPT_nofhdfld = 0; + FPrintFlds__13(typ->link, ((LONGINT)(0)), 1); + if (OPT_nofhdfld > 2048) { + OPM_Mark(225, typ->txtpos); + } + FPrintTProcs__17(typ->link); + OPM_FPrint(&pvfp, pbfp); + strobj = typ->strobj; + if (strobj == NIL || strobj->name[0] == 0x00) { + pbfp = pvfp; + } + } + typ->pbfp = pbfp; + typ->pvfp = pvfp; + } + FPrintStr__12_s = _s.lnk; +} + +void OPT_FPrintObj (OPT_Object obj) +{ + LONGINT fprint; + INTEGER f, m; + REAL rval; + OPT_ConstExt ext = NIL; + if (!obj->fpdone) { + fprint = 0; + obj->fpdone = 1; + OPM_FPrint(&fprint, obj->mode); + if (obj->mode == 3) { + f = obj->typ->form; + OPM_FPrint(&fprint, f); + switch (f) { + case 2: case 3: case 4: case 5: case 6: + OPM_FPrint(&fprint, obj->conval->intval); + break; + case 9: + OPM_FPrintSet(&fprint, obj->conval->setval); + break; + case 7: + rval = obj->conval->realval; + OPM_FPrintReal(&fprint, rval); + break; + case 8: + OPM_FPrintLReal(&fprint, obj->conval->realval); + break; + case 10: + OPT_FPrintName(&fprint, (void*)*obj->conval->ext, ((LONGINT)(256))); + break; + case 11: + break; + default: + OPT_err(127); + break; + } + } else if (obj->mode == 1) { + OPM_FPrint(&fprint, obj->vis); + OPT_FPrintStr(obj->typ); + OPM_FPrint(&fprint, obj->typ->pbfp); + } else if (__IN(obj->mode, 0x0480)) { + OPT_FPrintSign(&fprint, obj->typ, obj->link); + } else if (obj->mode == 9) { + OPT_FPrintSign(&fprint, obj->typ, obj->link); + ext = obj->conval->ext; + m = (int)(*ext)[0]; + f = 1; + OPM_FPrint(&fprint, m); + while (f <= m) { + OPM_FPrint(&fprint, (int)(*ext)[__X(f, ((LONGINT)(256)))]); + f += 1; + } + } else if (obj->mode == 5) { + OPT_FPrintStr(obj->typ); + OPM_FPrint(&fprint, obj->typ->pbfp); + } + obj->fprint = fprint; + } +} + +void OPT_FPrintErr (OPT_Object obj, INTEGER errcode) +{ + INTEGER i, j; + CHAR ch; + if (obj->mnolev != 0) { + __COPY(OPT_GlbMod[__X(-obj->mnolev, ((LONGINT)(64)))]->name, OPM_objname, ((LONGINT)(64))); + i = 0; + while (OPM_objname[__X(i, ((LONGINT)(64)))] != 0x00) { + i += 1; + } + OPM_objname[__X(i, ((LONGINT)(64)))] = '.'; + j = 0; + i += 1; + do { + ch = obj->name[__X(j, ((LONGINT)(256)))]; + OPM_objname[__X(i, ((LONGINT)(64)))] = ch; + j += 1; + i += 1; + } while (!(ch == 0x00)); + } else { + __COPY(obj->name, OPM_objname, ((LONGINT)(64))); + } + if (errcode == 249) { + if (OPM_noerr) { + OPT_err(errcode); + } + } else if (errcode == 253) { + if ((((!OPT_symNew && !OPT_symExtended)) && !OPT_extsf)) { + OPT_err(errcode); + } + OPT_symExtended = 1; + } else { + if ((!OPT_symNew && !OPT_newsf)) { + OPT_err(errcode); + } + OPT_symNew = 1; + } +} + +void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old) +{ + OPT_Object ob0 = NIL, ob1 = NIL; + BOOLEAN left; + if (*root == NIL) { + *root = obj; + *old = NIL; + } else { + ob0 = *root; + ob1 = ob0->right; + left = 0; + if (__STRCMP(obj->name, ob0->name) < 0) { + ob1 = ob0->left; + left = 1; + } else if (__STRCMP(obj->name, ob0->name) > 0) { + ob1 = ob0->right; + left = 0; + } else { + *old = ob0; + return; + } + for (;;) { + if (ob1 != NIL) { + if (__STRCMP(obj->name, ob1->name) < 0) { + ob0 = ob1; + ob1 = ob1->left; + left = 1; + } else if (__STRCMP(obj->name, ob1->name) > 0) { + ob0 = ob1; + ob1 = ob1->right; + left = 0; + } else { + *old = ob1; + break; + } + } else { + ob1 = obj; + if (left) { + ob0->left = ob1; + } else { + ob0->right = ob1; + } + ob1->left = NIL; + ob1->right = NIL; + *old = NIL; + break; + } + } + } +} + +static void OPT_InName (CHAR *name, LONGINT name__len) +{ + INTEGER i; + CHAR ch; + i = 0; + do { + OPM_SymRCh(&ch); + name[__X(i, name__len)] = ch; + i += 1; + } while (!(ch == 0x00)); +} + +static void OPT_InMod (SHORTINT *mno) +{ + OPT_Object head = NIL; + OPS_Name name; + LONGINT mn; + SHORTINT i; + mn = OPM_SymRInt(); + if (mn == 0) { + *mno = OPT_impCtxt.glbmno[0]; + } else { + if (mn == 16) { + OPT_InName((void*)name, ((LONGINT)(256))); + if ((__STRCMP(name, OPT_SelfName) == 0 && !OPT_impCtxt.self)) { + OPT_err(154); + } + i = 0; + while ((i < OPT_nofGmod && __STRCMP(name, OPT_GlbMod[__X(i, ((LONGINT)(64)))]->name) != 0)) { + i += 1; + } + if (i < OPT_nofGmod) { + *mno = i; + } else { + head = OPT_NewObj(); + head->mode = 12; + __COPY(name, head->name, ((LONGINT)(256))); + *mno = OPT_nofGmod; + head->mnolev = -*mno; + if (OPT_nofGmod < 64) { + OPT_GlbMod[__X(*mno, ((LONGINT)(64)))] = head; + OPT_nofGmod += 1; + } else { + OPT_err(227); + } + } + OPT_impCtxt.glbmno[__X(OPT_impCtxt.nofm, ((LONGINT)(64)))] = *mno; + OPT_impCtxt.nofm += 1; + } else { + *mno = OPT_impCtxt.glbmno[__X(-mn, ((LONGINT)(64)))]; + } + } +} + +static void OPT_InConstant (LONGINT f, OPT_Const conval) +{ + CHAR ch; + INTEGER i; + OPT_ConstExt ext = NIL; + REAL rval; + switch (f) { + case 1: case 3: case 2: + OPM_SymRCh(&ch); + conval->intval = (int)ch; + break; + case 4: case 5: case 6: + conval->intval = OPM_SymRInt(); + break; + case 9: + OPM_SymRSet(&conval->setval); + break; + case 7: + OPM_SymRReal(&rval); + conval->realval = rval; + conval->intval = -1; + break; + case 8: + OPM_SymRLReal(&conval->realval); + conval->intval = -1; + break; + case 10: + ext = OPT_NewExt(); + conval->ext = ext; + i = 0; + do { + OPM_SymRCh(&ch); + (*ext)[__X(i, ((LONGINT)(256)))] = ch; + i += 1; + } while (!(ch == 0x00)); + conval->intval2 = i; + conval->intval = -1; + break; + case 11: + conval->intval = 0; + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPT.InConstant(), f = ", (LONGINT)41); + OPM_LogWNum(f, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } +} + +static void OPT_InSign (SHORTINT mno, OPT_Struct *res, OPT_Object *par) +{ + OPT_Object last = NIL, new = NIL; + LONGINT tag; + OPT_InStruct(&*res); + tag = OPM_SymRInt(); + last = NIL; + while (tag != 18) { + new = OPT_NewObj(); + new->mnolev = -mno; + if (last == NIL) { + *par = new; + } else { + last->link = new; + } + if (tag == 23) { + new->mode = 1; + } else { + new->mode = 2; + } + OPT_InStruct(&new->typ); + new->adr = OPM_SymRInt(); + OPT_InName((void*)new->name, ((LONGINT)(256))); + last = new; + tag = OPM_SymRInt(); + } +} + +static OPT_Object OPT_InFld (void) +{ + OPT_Object _o_result; + LONGINT tag; + OPT_Object obj = NIL; + tag = OPT_impCtxt.nextTag; + obj = OPT_NewObj(); + if (tag <= 26) { + obj->mode = 4; + if (tag == 26) { + obj->vis = 2; + } else { + obj->vis = 1; + } + OPT_InStruct(&obj->typ); + OPT_InName((void*)obj->name, ((LONGINT)(256))); + obj->adr = OPM_SymRInt(); + } else { + obj->mode = 4; + if (tag == 27) { + __MOVE("@ptr", obj->name, 5); + } else { + __MOVE("@proc", obj->name, 6); + } + obj->typ = OPT_undftyp; + obj->vis = 0; + obj->adr = OPM_SymRInt(); + } + _o_result = obj; + return _o_result; +} + +static OPT_Object OPT_InTProc (SHORTINT mno) +{ + OPT_Object _o_result; + LONGINT tag; + OPT_Object obj = NIL; + tag = OPT_impCtxt.nextTag; + obj = OPT_NewObj(); + obj->mnolev = -mno; + if (tag == 29) { + obj->mode = 13; + obj->conval = OPT_NewConst(); + obj->conval->intval = -1; + OPT_InSign(mno, &obj->typ, &obj->link); + obj->vis = 1; + OPT_InName((void*)obj->name, ((LONGINT)(256))); + obj->adr = __ASHL(OPM_SymRInt(), 16); + } else { + obj->mode = 13; + __MOVE("@tproc", obj->name, 7); + obj->link = OPT_NewObj(); + obj->typ = OPT_undftyp; + obj->vis = 0; + obj->adr = __ASHL(OPM_SymRInt(), 16); + } + _o_result = obj; + return _o_result; +} + +static void OPT_InStruct (OPT_Struct *typ) +{ + SHORTINT mno; + INTEGER ref; + LONGINT tag; + OPS_Name name; + OPT_Struct t = NIL; + OPT_Object obj = NIL, last = NIL, fld = NIL, old = NIL, dummy = NIL; + tag = OPM_SymRInt(); + if (tag != 34) { + *typ = OPT_impCtxt.ref[__X(-tag, ((LONGINT)(255)))]; + } else { + ref = OPT_impCtxt.nofr; + OPT_impCtxt.nofr += 1; + if (ref < OPT_impCtxt.minr) { + OPT_impCtxt.minr = ref; + } + OPT_InMod(&mno); + OPT_InName((void*)name, ((LONGINT)(256))); + obj = OPT_NewObj(); + if (name[0] == 0x00) { + if (OPT_impCtxt.self) { + old = NIL; + } else { + __MOVE("@", obj->name, 2); + OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->right, &old); + obj->name[0] = 0x00; + } + *typ = OPT_NewStr(0, 1); + } else { + __COPY(name, obj->name, ((LONGINT)(256))); + OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->right, &old); + if (old != NIL) { + OPT_FPrintObj(old); + OPT_impCtxt.pvfp[__X(ref, ((LONGINT)(255)))] = old->typ->pvfp; + if (OPT_impCtxt.self) { + *typ = OPT_NewStr(0, 1); + } else { + *typ = old->typ; + (*typ)->link = NIL; + (*typ)->sysflag = 0; + (*typ)->fpdone = 0; + (*typ)->idfpdone = 0; + } + } else { + *typ = OPT_NewStr(0, 1); + } + } + OPT_impCtxt.ref[__X(ref, ((LONGINT)(255)))] = *typ; + OPT_impCtxt.old[__X(ref, ((LONGINT)(255)))] = old; + (*typ)->ref = ref + 255; + (*typ)->mno = mno; + (*typ)->allocated = 1; + (*typ)->strobj = obj; + obj->mode = 5; + obj->typ = *typ; + obj->mnolev = -mno; + obj->vis = 0; + tag = OPM_SymRInt(); + if (tag == 35) { + (*typ)->sysflag = (int)OPM_SymRInt(); + tag = OPM_SymRInt(); + } + switch (tag) { + case 36: + (*typ)->form = 13; + (*typ)->size = OPM_PointerSize; + (*typ)->n = 0; + OPT_InStruct(&(*typ)->BaseTyp); + break; + case 37: + (*typ)->form = 15; + (*typ)->comp = 2; + OPT_InStruct(&(*typ)->BaseTyp); + (*typ)->n = OPM_SymRInt(); + (*OPT_typSize)(*typ); + break; + case 38: + (*typ)->form = 15; + (*typ)->comp = 3; + OPT_InStruct(&(*typ)->BaseTyp); + if ((*typ)->BaseTyp->comp == 3) { + (*typ)->n = (*typ)->BaseTyp->n + 1; + } else { + (*typ)->n = 0; + } + (*OPT_typSize)(*typ); + break; + case 39: + (*typ)->form = 15; + (*typ)->comp = 4; + OPT_InStruct(&(*typ)->BaseTyp); + if ((*typ)->BaseTyp == OPT_notyp) { + (*typ)->BaseTyp = NIL; + } + (*typ)->extlev = 0; + t = (*typ)->BaseTyp; + while (t != NIL) { + (*typ)->extlev += 1; + t = t->BaseTyp; + } + (*typ)->size = OPM_SymRInt(); + (*typ)->align = OPM_SymRInt(); + (*typ)->n = OPM_SymRInt(); + OPT_impCtxt.nextTag = OPM_SymRInt(); + last = NIL; + while ((OPT_impCtxt.nextTag >= 25 && OPT_impCtxt.nextTag <= 28)) { + fld = OPT_InFld(); + fld->mnolev = -mno; + if (last != NIL) { + last->link = fld; + } + last = fld; + OPT_InsertImport(fld, &(*typ)->link, &dummy); + OPT_impCtxt.nextTag = OPM_SymRInt(); + } + while (OPT_impCtxt.nextTag != 18) { + fld = OPT_InTProc(mno); + OPT_InsertImport(fld, &(*typ)->link, &dummy); + OPT_impCtxt.nextTag = OPM_SymRInt(); + } + break; + case 40: + (*typ)->form = 14; + (*typ)->size = OPM_ProcSize; + OPT_InSign(mno, &(*typ)->BaseTyp, &(*typ)->link); + break; + default: + OPM_LogWStr((CHAR*)"unhandled case at OPT.InStruct, tag = ", (LONGINT)39); + OPM_LogWNum(tag, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + if (ref == OPT_impCtxt.minr) { + while (ref < OPT_impCtxt.nofr) { + t = OPT_impCtxt.ref[__X(ref, ((LONGINT)(255)))]; + OPT_FPrintStr(t); + obj = t->strobj; + if (obj->name[0] != 0x00) { + OPT_FPrintObj(obj); + } + old = OPT_impCtxt.old[__X(ref, ((LONGINT)(255)))]; + if (old != NIL) { + t->strobj = old; + if (OPT_impCtxt.self) { + if (old->mnolev < 0) { + if (old->history != 5) { + if (old->fprint != obj->fprint) { + old->history = 2; + } else if (OPT_impCtxt.pvfp[__X(ref, ((LONGINT)(255)))] != t->pvfp) { + old->history = 3; + } + } + } else if (old->fprint != obj->fprint) { + old->history = 2; + } else if (OPT_impCtxt.pvfp[__X(ref, ((LONGINT)(255)))] != t->pvfp) { + old->history = 3; + } else if (old->vis == 0) { + old->history = 1; + } else { + old->history = 0; + } + } else { + if (OPT_impCtxt.pvfp[__X(ref, ((LONGINT)(255)))] != t->pvfp) { + old->history = 5; + } + if (old->fprint != obj->fprint) { + OPT_FPrintErr(old, 249); + } + } + } else if (OPT_impCtxt.self) { + obj->history = 4; + } else { + obj->history = 1; + } + ref += 1; + } + OPT_impCtxt.minr = 255; + } + } +} + +static OPT_Object OPT_InObj (SHORTINT mno) +{ + OPT_Object _o_result; + INTEGER i, s; + CHAR ch; + OPT_Object obj = NIL, old = NIL; + OPT_Struct typ = NIL; + LONGINT tag; + OPT_ConstExt ext = NIL; + tag = OPT_impCtxt.nextTag; + if (tag == 19) { + OPT_InStruct(&typ); + obj = typ->strobj; + if (!OPT_impCtxt.self) { + obj->vis = 1; + } + } else { + obj = OPT_NewObj(); + obj->mnolev = -mno; + obj->vis = 1; + if (tag <= 13) { + obj->mode = 3; + obj->typ = OPT_impCtxt.ref[__X(tag, ((LONGINT)(255)))]; + obj->conval = OPT_NewConst(); + OPT_InConstant(tag, obj->conval); + } else if (tag >= 31) { + obj->conval = OPT_NewConst(); + obj->conval->intval = -1; + OPT_InSign(mno, &obj->typ, &obj->link); + switch (tag) { + case 31: + obj->mode = 7; + break; + case 32: + obj->mode = 10; + break; + case 33: + obj->mode = 9; + ext = OPT_NewExt(); + obj->conval->ext = ext; + s = (int)OPM_SymRInt(); + (*ext)[0] = (CHAR)s; + i = 1; + while (i <= s) { + OPM_SymRCh(&(*ext)[__X(i, ((LONGINT)(256)))]); + i += 1; + } + break; + default: + OPM_LogWStr((CHAR*)"unhandled case at OPT.InObj, tag = ", (LONGINT)36); + OPM_LogWNum(tag, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + } else if (tag == 20) { + obj->mode = 5; + OPT_InStruct(&obj->typ); + } else { + obj->mode = 1; + if (tag == 22) { + obj->vis = 2; + } + OPT_InStruct(&obj->typ); + } + OPT_InName((void*)obj->name, ((LONGINT)(256))); + } + OPT_FPrintObj(obj); + if ((obj->mode == 1 && (obj->typ->strobj == NIL || obj->typ->strobj->name[0] == 0x00))) { + OPM_FPrint(&OPT_impCtxt.reffp, obj->typ->ref - 255); + } + if (tag != 19) { + OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->right, &old); + if (OPT_impCtxt.self) { + if (old != NIL) { + if (old->vis == 0) { + old->history = 4; + } else { + OPT_FPrintObj(old); + if (obj->fprint != old->fprint) { + old->history = 2; + } else if (obj->typ->pvfp != old->typ->pvfp) { + old->history = 3; + } else { + old->history = 1; + } + } + } else { + obj->history = 4; + } + } + } else { + if (OPT_impCtxt.self) { + if (obj->vis == 0) { + obj->history = 4; + } else if (obj->history == 0) { + obj->history = 1; + } + } + } + _o_result = obj; + return _o_result; +} + +void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) +{ + OPT_Object obj = NIL; + SHORTINT mno; + OPS_Name aliasName__copy; + __DUPARR(aliasName, OPS_Name); + if (__STRCMP(name, "SYSTEM") == 0) { + OPT_SYSimported = 1; + OPT_Insert(aliasName, &obj); + obj->mode = 11; + obj->mnolev = 0; + obj->scope = OPT_syslink; + obj->typ = OPT_notyp; + } else { + OPT_impCtxt.nofr = 16; + OPT_impCtxt.minr = 255; + OPT_impCtxt.nofm = 0; + OPT_impCtxt.self = __STRCMP(aliasName, "@self") == 0; + OPT_impCtxt.reffp = 0; + OPM_OldSym((void*)name, ((LONGINT)(256)), &*done); + if (*done) { + OPT_InMod(&mno); + OPT_impCtxt.nextTag = OPM_SymRInt(); + while (!OPM_eofSF()) { + obj = OPT_InObj(mno); + OPT_impCtxt.nextTag = OPM_SymRInt(); + } + OPT_Insert(aliasName, &obj); + obj->mode = 11; + obj->scope = OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->right; + OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->link = obj; + obj->mnolev = -mno; + obj->typ = OPT_notyp; + OPM_CloseOldSym(); + } else if (OPT_impCtxt.self) { + OPT_newsf = 1; + OPT_extsf = 1; + OPT_sfpresent = 0; + } else { + OPT_err(152); + } + } +} + +static void OPT_OutName (CHAR *name, LONGINT name__len) +{ + INTEGER i; + CHAR ch; + i = 0; + do { + ch = name[__X(i, name__len)]; + OPM_SymWCh(ch); + i += 1; + } while (!(ch == 0x00)); +} + +static void OPT_OutMod (INTEGER mno) +{ + if (OPT_expCtxt.locmno[__X(mno, ((LONGINT)(64)))] < 0) { + OPM_SymWInt(((LONGINT)(16))); + OPT_expCtxt.locmno[__X(mno, ((LONGINT)(64)))] = OPT_expCtxt.nofm; + OPT_expCtxt.nofm += 1; + OPT_OutName((void*)OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->name, ((LONGINT)(256))); + } else { + OPM_SymWInt(-OPT_expCtxt.locmno[__X(mno, ((LONGINT)(64)))]); + } +} + +static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, LONGINT adr) +{ + LONGINT i, j, n; + OPT_Struct btyp = NIL; + if (typ->comp == 4) { + OPT_OutFlds(typ->link, adr, 0); + } else if (typ->comp == 2) { + btyp = typ->BaseTyp; + n = typ->n; + while (btyp->comp == 2) { + n = btyp->n * n; + btyp = btyp->BaseTyp; + } + if (btyp->form == 13 || btyp->comp == 4) { + j = OPT_nofhdfld; + OPT_OutHdFld(btyp, fld, adr); + if (j != OPT_nofhdfld) { + i = 1; + while ((i < n && OPT_nofhdfld <= 2048)) { + adr += btyp->size; + OPT_OutHdFld(btyp, fld, adr); + i += 1; + } + } + } + } else if (typ->form == 13 || __STRCMP(fld->name, "@ptr") == 0) { + OPM_SymWInt(((LONGINT)(27))); + OPM_SymWInt(adr); + OPT_nofhdfld += 1; + } +} + +static void OPT_OutFlds (OPT_Object fld, LONGINT adr, BOOLEAN visible) +{ + while ((fld != NIL && fld->mode == 4)) { + if ((fld->vis != 0 && visible)) { + if (fld->vis == 2) { + OPM_SymWInt(((LONGINT)(26))); + } else { + OPM_SymWInt(((LONGINT)(25))); + } + OPT_OutStr(fld->typ); + OPT_OutName((void*)fld->name, ((LONGINT)(256))); + OPM_SymWInt(fld->adr); + } else { + OPT_OutHdFld(fld->typ, fld, fld->adr + adr); + } + fld = fld->link; + } +} + +static void OPT_OutSign (OPT_Struct result, OPT_Object par) +{ + OPT_OutStr(result); + while (par != NIL) { + if (par->mode == 1) { + OPM_SymWInt(((LONGINT)(23))); + } else { + OPM_SymWInt(((LONGINT)(24))); + } + OPT_OutStr(par->typ); + OPM_SymWInt(par->adr); + OPT_OutName((void*)par->name, ((LONGINT)(256))); + par = par->link; + } + OPM_SymWInt(((LONGINT)(18))); +} + +static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj) +{ + if (obj != NIL) { + OPT_OutTProcs(typ, obj->left); + if (obj->mode == 13) { + if ((((typ->BaseTyp != NIL && __ASHR(obj->adr, 16) < typ->BaseTyp->n)) && obj->vis == 0)) { + OPM_Mark(109, typ->txtpos); + } + if (obj->vis != 0) { + if (obj->vis != 0) { + OPM_SymWInt(((LONGINT)(29))); + OPT_OutSign(obj->typ, obj->link); + OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPM_SymWInt(__ASHR(obj->adr, 16)); + } else { + OPM_SymWInt(((LONGINT)(30))); + OPM_SymWInt(__ASHR(obj->adr, 16)); + } + } + } + OPT_OutTProcs(typ, obj->right); + } +} + +static void OPT_OutStr (OPT_Struct typ) +{ + OPT_Object strobj = NIL; + if (typ->ref < OPT_expCtxt.ref) { + OPM_SymWInt(-typ->ref); + } else { + OPM_SymWInt(((LONGINT)(34))); + typ->ref = OPT_expCtxt.ref; + OPT_expCtxt.ref += 1; + if (OPT_expCtxt.ref >= 255) { + OPT_err(228); + } + OPT_OutMod(typ->mno); + strobj = typ->strobj; + if ((strobj != NIL && strobj->name[0] != 0x00)) { + OPT_OutName((void*)strobj->name, ((LONGINT)(256))); + switch (strobj->history) { + case 2: + OPT_FPrintErr(strobj, 252); + break; + case 3: + OPT_FPrintErr(strobj, 251); + break; + case 5: + OPT_FPrintErr(strobj, 249); + break; + default: + break; + } + } else { + OPM_SymWCh(0x00); + } + if (typ->sysflag != 0) { + OPM_SymWInt(((LONGINT)(35))); + OPM_SymWInt(typ->sysflag); + } + switch (typ->form) { + case 13: + OPM_SymWInt(((LONGINT)(36))); + OPT_OutStr(typ->BaseTyp); + break; + case 14: + OPM_SymWInt(((LONGINT)(40))); + OPT_OutSign(typ->BaseTyp, typ->link); + break; + case 15: + switch (typ->comp) { + case 2: + OPM_SymWInt(((LONGINT)(37))); + OPT_OutStr(typ->BaseTyp); + OPM_SymWInt(typ->n); + break; + case 3: + OPM_SymWInt(((LONGINT)(38))); + OPT_OutStr(typ->BaseTyp); + break; + case 4: + OPM_SymWInt(((LONGINT)(39))); + if (typ->BaseTyp == NIL) { + OPT_OutStr(OPT_notyp); + } else { + OPT_OutStr(typ->BaseTyp); + } + OPM_SymWInt(typ->size); + OPM_SymWInt(typ->align); + OPM_SymWInt(typ->n); + OPT_nofhdfld = 0; + OPT_OutFlds(typ->link, ((LONGINT)(0)), 1); + if (OPT_nofhdfld > 2048) { + OPM_Mark(223, typ->txtpos); + } + OPT_OutTProcs(typ, typ->link); + OPM_SymWInt(((LONGINT)(18))); + break; + default: + OPM_LogWStr((CHAR*)"unhandled case at OPT.OutStr, typ^.comp = ", (LONGINT)43); + OPM_LogWNum(typ->comp, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + break; + default: + OPM_LogWStr((CHAR*)"unhandled case at OPT.OutStr, typ^.form = ", (LONGINT)43); + OPM_LogWNum(typ->form, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + } +} + +static void OPT_OutConstant (OPT_Object obj) +{ + INTEGER f; + REAL rval; + f = obj->typ->form; + OPM_SymWInt(f); + switch (f) { + case 2: case 3: + OPM_SymWCh((CHAR)obj->conval->intval); + break; + case 4: case 5: case 6: + OPM_SymWInt(obj->conval->intval); + break; + case 9: + OPM_SymWSet(obj->conval->setval); + break; + case 7: + rval = obj->conval->realval; + OPM_SymWReal(rval); + break; + case 8: + OPM_SymWLReal(obj->conval->realval); + break; + case 10: + OPT_OutName((void*)*obj->conval->ext, ((LONGINT)(256))); + break; + case 11: + break; + default: + OPT_err(127); + break; + } +} + +static void OPT_OutObj (OPT_Object obj) +{ + INTEGER i, j; + OPT_ConstExt ext = NIL; + if (obj != NIL) { + OPT_OutObj(obj->left); + if (__IN(obj->mode, 0x06ea)) { + if (obj->history == 4) { + OPT_FPrintErr(obj, 250); + } else if (obj->vis != 0) { + switch (obj->history) { + case 0: + OPT_FPrintErr(obj, 253); + break; + case 1: + break; + case 2: + OPT_FPrintErr(obj, 252); + break; + case 3: + OPT_FPrintErr(obj, 251); + break; + default: + OPM_LogWStr((CHAR*)"unhandled case at OPT.OutObj, obj^.history = ", (LONGINT)46); + OPM_LogWNum(obj->history, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + switch (obj->mode) { + case 3: + OPT_OutConstant(obj); + OPT_OutName((void*)obj->name, ((LONGINT)(256))); + break; + case 5: + if (obj->typ->strobj == obj) { + OPM_SymWInt(((LONGINT)(19))); + OPT_OutStr(obj->typ); + } else { + OPM_SymWInt(((LONGINT)(20))); + OPT_OutStr(obj->typ); + OPT_OutName((void*)obj->name, ((LONGINT)(256))); + } + break; + case 1: + if (obj->vis == 2) { + OPM_SymWInt(((LONGINT)(22))); + } else { + OPM_SymWInt(((LONGINT)(21))); + } + OPT_OutStr(obj->typ); + OPT_OutName((void*)obj->name, ((LONGINT)(256))); + if (obj->typ->strobj == NIL || obj->typ->strobj->name[0] == 0x00) { + OPM_FPrint(&OPT_expCtxt.reffp, obj->typ->ref); + } + break; + case 7: + OPM_SymWInt(((LONGINT)(31))); + OPT_OutSign(obj->typ, obj->link); + OPT_OutName((void*)obj->name, ((LONGINT)(256))); + break; + case 10: + OPM_SymWInt(((LONGINT)(32))); + OPT_OutSign(obj->typ, obj->link); + OPT_OutName((void*)obj->name, ((LONGINT)(256))); + break; + case 9: + OPM_SymWInt(((LONGINT)(33))); + OPT_OutSign(obj->typ, obj->link); + ext = obj->conval->ext; + j = (int)(*ext)[0]; + i = 1; + OPM_SymWInt(j); + while (i <= j) { + OPM_SymWCh((*ext)[__X(i, ((LONGINT)(256)))]); + i += 1; + } + OPT_OutName((void*)obj->name, ((LONGINT)(256))); + break; + default: + OPM_LogWStr((CHAR*)"unhandled case at OPT.OutObj, obj.mode = ", (LONGINT)42); + OPM_LogWNum(obj->mode, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + } + } + OPT_OutObj(obj->right); + } +} + +void OPT_Export (BOOLEAN *ext, BOOLEAN *new) +{ + INTEGER i; + SHORTINT nofmod; + BOOLEAN done; + OPT_symExtended = 0; + OPT_symNew = 0; + nofmod = OPT_nofGmod; + OPT_Import((CHAR*)"@self", OPT_SelfName, &done); + OPT_nofGmod = nofmod; + if (OPM_noerr) { + OPM_NewSym((void*)OPT_SelfName, ((LONGINT)(256))); + if (OPM_noerr) { + OPM_SymWInt(((LONGINT)(16))); + OPT_OutName((void*)OPT_SelfName, ((LONGINT)(256))); + OPT_expCtxt.reffp = 0; + OPT_expCtxt.ref = 16; + OPT_expCtxt.nofm = 1; + OPT_expCtxt.locmno[0] = 0; + i = 1; + while (i < 64) { + OPT_expCtxt.locmno[__X(i, ((LONGINT)(64)))] = -1; + i += 1; + } + OPT_OutObj(OPT_topScope->right); + *ext = (OPT_sfpresent && OPT_symExtended); + *new = !OPT_sfpresent || OPT_symNew; + if (OPM_forceNewSym) { + *new = 1; + } + if ((((OPM_noerr && OPT_sfpresent)) && OPT_impCtxt.reffp != OPT_expCtxt.reffp)) { + *new = 1; + if (!OPT_extsf) { + OPT_err(155); + } + } + OPT_newsf = 0; + OPT_symNew = 0; + if (!OPM_noerr || OPT_findpc) { + OPM_DeleteNewSym(); + } + } + } +} + +static void OPT_InitStruct (OPT_Struct *typ, SHORTINT form) +{ + *typ = OPT_NewStr(form, 1); + (*typ)->ref = form; + (*typ)->size = OPM_ByteSize; + (*typ)->allocated = 1; + (*typ)->strobj = OPT_NewObj(); + (*typ)->pbfp = form; + (*typ)->pvfp = form; + (*typ)->fpdone = 1; + (*typ)->idfp = form; + (*typ)->idfpdone = 1; +} + +static void OPT_EnterBoolConst (OPS_Name name, LONGINT value) +{ + OPT_Object obj = NIL; + OPS_Name name__copy; + __DUPARR(name, OPS_Name); + OPT_Insert(name, &obj); + obj->conval = OPT_NewConst(); + obj->mode = 3; + obj->typ = OPT_booltyp; + obj->conval->intval = value; +} + +static void OPT_EnterTyp (OPS_Name name, SHORTINT form, INTEGER size, OPT_Struct *res) +{ + OPT_Object obj = NIL; + OPT_Struct typ = NIL; + OPS_Name name__copy; + __DUPARR(name, OPS_Name); + OPT_Insert(name, &obj); + typ = OPT_NewStr(form, 1); + obj->mode = 5; + obj->typ = typ; + obj->vis = 1; + typ->strobj = obj; + typ->size = size; + typ->ref = form; + typ->allocated = 1; + typ->pbfp = form; + typ->pvfp = form; + typ->fpdone = 1; + typ->idfp = form; + typ->idfpdone = 1; + *res = typ; +} + +static void OPT_EnterProc (OPS_Name name, INTEGER num) +{ + OPT_Object obj = NIL; + OPS_Name name__copy; + __DUPARR(name, OPS_Name); + OPT_Insert(name, &obj); + obj->mode = 8; + obj->typ = OPT_notyp; + obj->adr = num; +} + +static void EnumPtrs(void (*P)(void*)) +{ + P(OPT_topScope); + P(OPT_undftyp); + P(OPT_bytetyp); + P(OPT_booltyp); + P(OPT_chartyp); + P(OPT_sinttyp); + P(OPT_inttyp); + P(OPT_linttyp); + P(OPT_realtyp); + P(OPT_lrltyp); + P(OPT_settyp); + P(OPT_stringtyp); + P(OPT_niltyp); + P(OPT_notyp); + P(OPT_sysptrtyp); + __ENUMP(OPT_GlbMod, 64, P); + P(OPT_universe); + P(OPT_syslink); + __ENUMR(&OPT_impCtxt, OPT_ImpCtxt__typ, 6216, 1, P); +} + +__TDESC(OPT_ConstDesc, 1, 1) = {__TDFLDS("ConstDesc", 40), {0, -16}}; +__TDESC(OPT_ObjDesc, 1, 6) = {__TDFLDS("ObjDesc", 344), {0, 8, 16, 24, 304, 312, -56}}; +__TDESC(OPT_StrDesc, 1, 3) = {__TDFLDS("StrDesc", 104), {80, 88, 96, -32}}; +__TDESC(OPT_NodeDesc, 1, 6) = {__TDFLDS("NodeDesc", 56), {0, 8, 16, 32, 40, 48, -56}}; +__TDESC(OPT_ImpCtxt, 1, 510) = {__TDFLDS("ImpCtxt", 6216), {32, 40, 48, 56, 64, 72, 80, 88, 96, 104, 112, 120, 128, 136, 144, 152, + 160, 168, 176, 184, 192, 200, 208, 216, 224, 232, 240, 248, 256, 264, 272, 280, + 288, 296, 304, 312, 320, 328, 336, 344, 352, 360, 368, 376, 384, 392, 400, 408, + 416, 424, 432, 440, 448, 456, 464, 472, 480, 488, 496, 504, 512, 520, 528, 536, + 544, 552, 560, 568, 576, 584, 592, 600, 608, 616, 624, 632, 640, 648, 656, 664, + 672, 680, 688, 696, 704, 712, 720, 728, 736, 744, 752, 760, 768, 776, 784, 792, + 800, 808, 816, 824, 832, 840, 848, 856, 864, 872, 880, 888, 896, 904, 912, 920, + 928, 936, 944, 952, 960, 968, 976, 984, 992, 1000, 1008, 1016, 1024, 1032, 1040, 1048, + 1056, 1064, 1072, 1080, 1088, 1096, 1104, 1112, 1120, 1128, 1136, 1144, 1152, 1160, 1168, 1176, + 1184, 1192, 1200, 1208, 1216, 1224, 1232, 1240, 1248, 1256, 1264, 1272, 1280, 1288, 1296, 1304, + 1312, 1320, 1328, 1336, 1344, 1352, 1360, 1368, 1376, 1384, 1392, 1400, 1408, 1416, 1424, 1432, + 1440, 1448, 1456, 1464, 1472, 1480, 1488, 1496, 1504, 1512, 1520, 1528, 1536, 1544, 1552, 1560, + 1568, 1576, 1584, 1592, 1600, 1608, 1616, 1624, 1632, 1640, 1648, 1656, 1664, 1672, 1680, 1688, + 1696, 1704, 1712, 1720, 1728, 1736, 1744, 1752, 1760, 1768, 1776, 1784, 1792, 1800, 1808, 1816, + 1824, 1832, 1840, 1848, 1856, 1864, 1872, 1880, 1888, 1896, 1904, 1912, 1920, 1928, 1936, 1944, + 1952, 1960, 1968, 1976, 1984, 1992, 2000, 2008, 2016, 2024, 2032, 2040, 2048, 2056, 2064, 2072, + 2080, 2088, 2096, 2104, 2112, 2120, 2128, 2136, 2144, 2152, 2160, 2168, 2176, 2184, 2192, 2200, + 2208, 2216, 2224, 2232, 2240, 2248, 2256, 2264, 2272, 2280, 2288, 2296, 2304, 2312, 2320, 2328, + 2336, 2344, 2352, 2360, 2368, 2376, 2384, 2392, 2400, 2408, 2416, 2424, 2432, 2440, 2448, 2456, + 2464, 2472, 2480, 2488, 2496, 2504, 2512, 2520, 2528, 2536, 2544, 2552, 2560, 2568, 2576, 2584, + 2592, 2600, 2608, 2616, 2624, 2632, 2640, 2648, 2656, 2664, 2672, 2680, 2688, 2696, 2704, 2712, + 2720, 2728, 2736, 2744, 2752, 2760, 2768, 2776, 2784, 2792, 2800, 2808, 2816, 2824, 2832, 2840, + 2848, 2856, 2864, 2872, 2880, 2888, 2896, 2904, 2912, 2920, 2928, 2936, 2944, 2952, 2960, 2968, + 2976, 2984, 2992, 3000, 3008, 3016, 3024, 3032, 3040, 3048, 3056, 3064, 3072, 3080, 3088, 3096, + 3104, 3112, 3120, 3128, 3136, 3144, 3152, 3160, 3168, 3176, 3184, 3192, 3200, 3208, 3216, 3224, + 3232, 3240, 3248, 3256, 3264, 3272, 3280, 3288, 3296, 3304, 3312, 3320, 3328, 3336, 3344, 3352, + 3360, 3368, 3376, 3384, 3392, 3400, 3408, 3416, 3424, 3432, 3440, 3448, 3456, 3464, 3472, 3480, + 3488, 3496, 3504, 3512, 3520, 3528, 3536, 3544, 3552, 3560, 3568, 3576, 3584, 3592, 3600, 3608, + 3616, 3624, 3632, 3640, 3648, 3656, 3664, 3672, 3680, 3688, 3696, 3704, 3712, 3720, 3728, 3736, + 3744, 3752, 3760, 3768, 3776, 3784, 3792, 3800, 3808, 3816, 3824, 3832, 3840, 3848, 3856, 3864, + 3872, 3880, 3888, 3896, 3904, 3912, 3920, 3928, 3936, 3944, 3952, 3960, 3968, 3976, 3984, 3992, + 4000, 4008, 4016, 4024, 4032, 4040, 4048, 4056, 4064, 4072, 4080, 4088, 4096, 4104, -4088}}; +__TDESC(OPT_ExpCtxt, 1, 0) = {__TDFLDS("ExpCtxt", 80), {-8}}; + +export void *OPT__init(void) +{ + __DEFMOD; + __MODULE_IMPORT(OPM); + __MODULE_IMPORT(OPS); + __REGMOD("OPT", EnumPtrs); + __REGCMD("Close", OPT_Close); + __REGCMD("CloseScope", OPT_CloseScope); + __INITYP(OPT_ConstDesc, OPT_ConstDesc, 0); + __INITYP(OPT_ObjDesc, OPT_ObjDesc, 0); + __INITYP(OPT_StrDesc, OPT_StrDesc, 0); + __INITYP(OPT_NodeDesc, OPT_NodeDesc, 0); + __INITYP(OPT_ImpCtxt, OPT_ImpCtxt, 0); + __INITYP(OPT_ExpCtxt, OPT_ExpCtxt, 0); +/* BEGIN */ + OPT_topScope = NIL; + OPT_OpenScope(0, NIL); + OPM_errpos = 0; + OPT_InitStruct(&OPT_undftyp, 0); + OPT_InitStruct(&OPT_notyp, 12); + OPT_InitStruct(&OPT_stringtyp, 10); + OPT_InitStruct(&OPT_niltyp, 11); + OPT_undftyp->BaseTyp = OPT_undftyp; + OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp); + OPT_EnterTyp((CHAR*)"PTR", 13, OPM_PointerSize, &OPT_sysptrtyp); + OPT_EnterProc((CHAR*)"ADR", 20); + OPT_EnterProc((CHAR*)"CC", 21); + OPT_EnterProc((CHAR*)"LSH", 22); + OPT_EnterProc((CHAR*)"ROT", 23); + OPT_EnterProc((CHAR*)"GET", 24); + OPT_EnterProc((CHAR*)"PUT", 25); + OPT_EnterProc((CHAR*)"GETREG", 26); + OPT_EnterProc((CHAR*)"PUTREG", 27); + OPT_EnterProc((CHAR*)"BIT", 28); + OPT_EnterProc((CHAR*)"VAL", 29); + OPT_EnterProc((CHAR*)"NEW", 30); + OPT_EnterProc((CHAR*)"MOVE", 31); + OPT_syslink = OPT_topScope->right; + OPT_universe = OPT_topScope; + OPT_topScope->right = NIL; + OPT_EnterTyp((CHAR*)"CHAR", 3, OPM_CharSize, &OPT_chartyp); + OPT_EnterTyp((CHAR*)"SET", 9, OPM_SetSize, &OPT_settyp); + OPT_EnterTyp((CHAR*)"REAL", 7, OPM_RealSize, &OPT_realtyp); + OPT_EnterTyp((CHAR*)"INTEGER", 5, OPM_IntSize, &OPT_inttyp); + OPT_EnterTyp((CHAR*)"LONGINT", 6, OPM_LIntSize, &OPT_linttyp); + OPT_EnterTyp((CHAR*)"LONGREAL", 8, OPM_LRealSize, &OPT_lrltyp); + OPT_EnterTyp((CHAR*)"SHORTINT", 4, OPM_SIntSize, &OPT_sinttyp); + OPT_EnterTyp((CHAR*)"BOOLEAN", 2, OPM_BoolSize, &OPT_booltyp); + OPT_EnterBoolConst((CHAR*)"FALSE", ((LONGINT)(0))); + OPT_EnterBoolConst((CHAR*)"TRUE", ((LONGINT)(1))); + OPT_EnterProc((CHAR*)"HALT", 0); + OPT_EnterProc((CHAR*)"NEW", 1); + OPT_EnterProc((CHAR*)"ABS", 2); + OPT_EnterProc((CHAR*)"CAP", 3); + OPT_EnterProc((CHAR*)"ORD", 4); + OPT_EnterProc((CHAR*)"ENTIER", 5); + OPT_EnterProc((CHAR*)"ODD", 6); + OPT_EnterProc((CHAR*)"MIN", 7); + OPT_EnterProc((CHAR*)"MAX", 8); + OPT_EnterProc((CHAR*)"CHR", 9); + OPT_EnterProc((CHAR*)"SHORT", 10); + OPT_EnterProc((CHAR*)"LONG", 11); + OPT_EnterProc((CHAR*)"SIZE", 12); + OPT_EnterProc((CHAR*)"INC", 13); + OPT_EnterProc((CHAR*)"DEC", 14); + OPT_EnterProc((CHAR*)"INCL", 15); + OPT_EnterProc((CHAR*)"EXCL", 16); + OPT_EnterProc((CHAR*)"LEN", 17); + OPT_EnterProc((CHAR*)"COPY", 18); + OPT_EnterProc((CHAR*)"ASH", 19); + OPT_EnterProc((CHAR*)"ASSERT", 32); + OPT_impCtxt.ref[0] = OPT_undftyp; + OPT_impCtxt.ref[1] = OPT_bytetyp; + OPT_impCtxt.ref[2] = OPT_booltyp; + OPT_impCtxt.ref[3] = OPT_chartyp; + OPT_impCtxt.ref[4] = OPT_sinttyp; + OPT_impCtxt.ref[5] = OPT_inttyp; + OPT_impCtxt.ref[6] = OPT_linttyp; + OPT_impCtxt.ref[7] = OPT_realtyp; + OPT_impCtxt.ref[8] = OPT_lrltyp; + OPT_impCtxt.ref[9] = OPT_settyp; + OPT_impCtxt.ref[10] = OPT_stringtyp; + OPT_impCtxt.ref[11] = OPT_niltyp; + OPT_impCtxt.ref[12] = OPT_notyp; + OPT_impCtxt.ref[13] = OPT_sysptrtyp; + __ENDMOD; +} diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h new file mode 100644 index 00000000..4c3442b5 --- /dev/null +++ b/bootstrap/unix-88/OPT.h @@ -0,0 +1,106 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ + +#ifndef OPT__h +#define OPT__h + +#define LARGE +#include "SYSTEM.h" +#include "OPS.h" + +typedef + struct OPT_ConstDesc *OPT_Const; + +typedef + OPS_String *OPT_ConstExt; + +typedef + struct OPT_ConstDesc { + OPT_ConstExt ext; + LONGINT intval, intval2; + SET setval; + LONGREAL realval; + } OPT_ConstDesc; + +typedef + struct OPT_NodeDesc *OPT_Node; + +typedef + struct OPT_StrDesc *OPT_Struct; + +typedef + struct OPT_ObjDesc *OPT_Object; + +typedef + struct OPT_NodeDesc { + OPT_Node left, right, link; + SHORTINT class, subcl; + BOOLEAN readonly; + OPT_Struct typ; + OPT_Object obj; + OPT_Const conval; + } OPT_NodeDesc; + +typedef + struct OPT_ObjDesc { + OPT_Object left, right, link, scope; + OPS_Name name; + BOOLEAN leaf; + SHORTINT mode, mnolev, vis, history; + BOOLEAN used, fpdone; + LONGINT fprint; + OPT_Struct typ; + OPT_Const conval; + LONGINT adr, linkadr; + INTEGER x; + } OPT_ObjDesc; + +typedef + struct OPT_StrDesc { + SHORTINT form, comp, mno, extlev; + INTEGER ref, sysflag; + LONGINT n, size, align, txtpos; + BOOLEAN allocated, pbused, pvused; + char _prvt0[8]; + LONGINT pbfp, pvfp; + OPT_Struct BaseTyp; + OPT_Object link, strobj; + } OPT_StrDesc; + + +import void (*OPT_typSize)(OPT_Struct); +import OPT_Object OPT_topScope; +import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +import SHORTINT OPT_nofGmod; +import OPT_Object OPT_GlbMod[64]; +import OPS_Name OPT_SelfName; +import BOOLEAN OPT_SYSimported; + +import LONGINT *OPT_ConstDesc__typ; +import LONGINT *OPT_ObjDesc__typ; +import LONGINT *OPT_StrDesc__typ; +import LONGINT *OPT_NodeDesc__typ; + +import void OPT_Close (void); +import void OPT_CloseScope (void); +import void OPT_Export (BOOLEAN *ext, BOOLEAN *new); +import void OPT_FPrintErr (OPT_Object obj, INTEGER errcode); +import void OPT_FPrintObj (OPT_Object obj); +import void OPT_FPrintStr (OPT_Struct typ); +import void OPT_Find (OPT_Object *res); +import void OPT_FindField (OPS_Name name, OPT_Struct typ, OPT_Object *res); +import void OPT_FindImport (OPT_Object mod, OPT_Object *res); +import void OPT_IdFPrint (OPT_Struct typ); +import void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); +import void OPT_Init (OPS_Name name, SET opt); +import void OPT_Insert (OPS_Name name, OPT_Object *obj); +import void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); +import OPT_Const OPT_NewConst (void); +import OPT_ConstExt OPT_NewExt (void); +import OPT_Node OPT_NewNode (SHORTINT class); +import OPT_Object OPT_NewObj (void); +import OPT_Struct OPT_NewStr (SHORTINT form, SHORTINT comp); +import void OPT_OpenScope (SHORTINT level, OPT_Object owner); +import void *OPT__init(void); + + +#endif diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c new file mode 100644 index 00000000..627e325b --- /dev/null +++ b/bootstrap/unix-88/OPV.c @@ -0,0 +1,1689 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +#define LARGE +#include "SYSTEM.h" +#include "OPC.h" +#include "OPM.h" +#include "OPS.h" +#include "OPT.h" + +typedef + struct OPV_ExitInfo { + INTEGER level, label; + } OPV_ExitInfo; + + +static BOOLEAN OPV_assert, OPV_inxchk, OPV_mainprog, OPV_ansi; +static INTEGER OPV_stamp; +static LONGINT OPV_recno; +static OPV_ExitInfo OPV_exit; +static INTEGER OPV_nofExitLabels; +static BOOLEAN OPV_naturalAlignment; + +export LONGINT *OPV_ExitInfo__typ; + +static void OPV_ActualPar (OPT_Node n, OPT_Object fp); +export void OPV_AdrAndSize (OPT_Object topScope); +static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc); +static void OPV_Convert (OPT_Node n, INTEGER form, INTEGER prec); +static void OPV_DefineTDescs (OPT_Node n); +static void OPV_Entier (OPT_Node n, INTEGER prec); +static void OPV_GetTProcNum (OPT_Object obj); +static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc); +static BOOLEAN OPV_ImplicitReturn (OPT_Node n); +static void OPV_Index (OPT_Node n, OPT_Node d, INTEGER prec, INTEGER dim); +export void OPV_Init (void); +static void OPV_InitTDescs (OPT_Node n); +static void OPV_Len (OPT_Node n, LONGINT dim); +export void OPV_Module (OPT_Node prog); +static LONGINT OPV_NaturalAlignment (LONGINT size, LONGINT max); +static void OPV_NewArr (OPT_Node d, OPT_Node x); +static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, INTEGER comp); +static BOOLEAN OPV_SideEffects (OPT_Node n); +static void OPV_Stamp (OPS_Name s); +static OPT_Object OPV_SuperProc (OPT_Node n); +static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported); +static void OPV_TraverseRecord (OPT_Struct typ); +export void OPV_TypSize (OPT_Struct typ); +static void OPV_TypeOf (OPT_Node n); +static void OPV_design (OPT_Node n, INTEGER prec); +static void OPV_expr (OPT_Node n, INTEGER prec); +static void OPV_stat (OPT_Node n, OPT_Object outerProc); + + +static LONGINT OPV_NaturalAlignment (LONGINT size, LONGINT max) +{ + LONGINT _o_result; + LONGINT i; + if (size >= max) { + _o_result = max; + return _o_result; + } else { + i = 1; + while (i < size) { + i += i; + } + _o_result = i; + return _o_result; + } + __RETCHK; +} + +void OPV_TypSize (OPT_Struct typ) +{ + INTEGER f, c; + LONGINT offset, size, base, fbase, off0; + OPT_Object fld = NIL; + OPT_Struct btyp = NIL; + if (typ == OPT_undftyp) { + OPM_err(58); + } else if (typ->size == -1) { + f = typ->form; + c = typ->comp; + if (c == 4) { + btyp = typ->BaseTyp; + if (btyp == NIL) { + offset = 0; + base = OPM_RecAlign; + } else { + OPV_TypSize(btyp); + offset = btyp->size - (LONGINT)__ASHR(btyp->sysflag, 8); + base = btyp->align; + } + fld = typ->link; + while ((fld != NIL && fld->mode == 4)) { + btyp = fld->typ; + OPV_TypSize(btyp); + size = btyp->size; + fbase = OPC_Base(btyp); + OPC_Align(&offset, fbase); + fld->adr = offset; + offset += size; + if (fbase > base) { + base = fbase; + } + fld = fld->link; + } + off0 = offset; + if (offset == 0) { + offset = 1; + } + if (OPM_RecSize == 0) { + base = OPV_NaturalAlignment(offset, OPM_RecAlign); + } + OPC_Align(&offset, base); + if ((typ->strobj == NIL && __MASK(typ->align, -65536) == 0)) { + OPV_recno += 1; + base += __ASHL(OPV_recno, 16); + } + typ->size = offset; + typ->align = base; + typ->sysflag = __MASK(typ->sysflag, -256) + (int)__ASHL(offset - off0, 8); + } else if (c == 2) { + OPV_TypSize(typ->BaseTyp); + typ->size = typ->n * typ->BaseTyp->size; + } else if (f == 13) { + typ->size = OPM_PointerSize; + if (typ->BaseTyp == OPT_undftyp) { + OPM_Mark(128, typ->n); + } else { + OPV_TypSize(typ->BaseTyp); + } + } else if (f == 14) { + typ->size = OPM_ProcSize; + } else if (c == 3) { + btyp = typ->BaseTyp; + OPV_TypSize(btyp); + if (btyp->comp == 3) { + typ->size = btyp->size + 4; + } else { + typ->size = 8; + } + } + } +} + +void OPV_Init (void) +{ + OPV_stamp = 0; + OPV_recno = 0; + OPV_nofExitLabels = 0; + OPV_assert = __IN(7, OPM_opt); + OPV_inxchk = __IN(0, OPM_opt); + OPV_mainprog = __IN(10, OPM_opt); + OPV_ansi = __IN(6, OPM_opt); +} + +static void OPV_GetTProcNum (OPT_Object obj) +{ + LONGINT oldPos; + OPT_Struct typ = NIL; + OPT_Object redef = NIL; + oldPos = OPM_errpos; + OPM_errpos = obj->scope->adr; + typ = obj->link->typ; + if (typ->form == 13) { + typ = typ->BaseTyp; + } + OPT_FindField(obj->name, typ->BaseTyp, &redef); + if (redef != NIL) { + obj->adr = __ASHL(__ASHR(redef->adr, 16), 16); + if (!__IN(2, obj->conval->setval)) { + OPM_err(119); + } + } else { + obj->adr += __ASHL(typ->n, 16); + typ->n += 1; + } + OPM_errpos = oldPos; +} + +static void OPV_TraverseRecord (OPT_Struct typ) +{ + if (!typ->allocated) { + if (typ->BaseTyp != NIL) { + OPV_TraverseRecord(typ->BaseTyp); + typ->n = typ->BaseTyp->n; + } + typ->allocated = 1; + OPV_Traverse(typ->link, typ->strobj, 0); + } +} + +static void OPV_Stamp (OPS_Name s) +{ + INTEGER i, j, k; + CHAR n[10]; + OPV_stamp += 1; + i = 0; + j = OPV_stamp; + while (s[__X(i, ((LONGINT)(256)))] != 0x00) { + i += 1; + } + if (i > 25) { + i = 25; + } + s[__X(i, ((LONGINT)(256)))] = '_'; + s[__X(i + 1, ((LONGINT)(256)))] = '_'; + i += 2; + k = 0; + do { + n[__X(k, ((LONGINT)(10)))] = (CHAR)((int)__MOD(j, 10) + 48); + j = __DIV(j, 10); + k += 1; + } while (!(j == 0)); + do { + k -= 1; + s[__X(i, ((LONGINT)(256)))] = n[__X(k, ((LONGINT)(10)))]; + i += 1; + } while (!(k == 0)); + s[__X(i, ((LONGINT)(256)))] = 0x00; +} + +static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported) +{ + INTEGER mode; + OPT_Object scope = NIL; + OPT_Struct typ = NIL; + if (obj != NIL) { + OPV_Traverse(obj->left, outerScope, exported); + if (obj->name[0] == '@') { + obj->name[0] = '_'; + OPV_Stamp(obj->name); + } + obj->linkadr = 0; + mode = obj->mode; + if ((mode == 5 && (obj->vis != 0) == exported)) { + typ = obj->typ; + OPV_TypSize(obj->typ); + if (typ->form == 13) { + typ = typ->BaseTyp; + } + if (typ->comp == 4) { + OPV_TraverseRecord(typ); + } + } else if (mode == 13) { + OPV_GetTProcNum(obj); + } else if (mode == 1) { + OPV_TypSize(obj->typ); + } + if (!exported) { + if ((__IN(mode, 0x60) && obj->mnolev > 0)) { + OPV_Stamp(obj->name); + } + if (__IN(mode, 0x26)) { + obj->scope = outerScope; + } else if (__IN(mode, 0x26c0)) { + if (obj->conval->setval == 0x0) { + OPM_err(129); + } + scope = obj->scope; + scope->leaf = 1; + __COPY(obj->name, scope->name, ((LONGINT)(256))); + OPV_Stamp(scope->name); + if (mode == 9) { + obj->adr = 1; + } + if (scope->mnolev > 1) { + outerScope->leaf = 0; + } + OPV_Traverse(obj->scope->right, obj->scope, 0); + } + } + OPV_Traverse(obj->right, outerScope, exported); + } +} + +void OPV_AdrAndSize (OPT_Object topScope) +{ + OPM_errpos = topScope->adr; + topScope->leaf = 1; + OPV_Traverse(topScope->right, topScope, 1); + OPV_Traverse(topScope->right, topScope, 0); + OPT_chartyp->strobj->linkadr = 2; + OPT_settyp->strobj->linkadr = 2; + OPT_realtyp->strobj->linkadr = 2; + OPT_inttyp->strobj->linkadr = 2; + OPT_linttyp->strobj->linkadr = 2; + OPT_lrltyp->strobj->linkadr = 2; + OPT_sinttyp->strobj->linkadr = 2; + OPT_booltyp->strobj->linkadr = 2; + OPT_bytetyp->strobj->linkadr = 2; + OPT_sysptrtyp->strobj->linkadr = 2; +} + +static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, INTEGER comp) +{ + INTEGER _o_result; + switch (class) { + case 7: case 0: case 2: case 4: case 9: + case 13: + _o_result = 10; + return _o_result; + break; + case 5: + if (__IN(3, OPM_opt)) { + _o_result = 10; + return _o_result; + } else { + _o_result = 9; + return _o_result; + } + break; + case 1: + if (__IN(comp, 0x0c)) { + _o_result = 10; + return _o_result; + } else { + _o_result = 9; + return _o_result; + } + break; + case 3: + _o_result = 9; + return _o_result; + break; + case 11: + switch (subclass) { + case 33: case 7: case 24: case 29: case 20: + _o_result = 9; + return _o_result; + break; + case 16: case 21: case 22: case 23: case 25: + _o_result = 10; + return _o_result; + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence Nmop, subclass = ", (LONGINT)51); + OPM_LogWNum(subclass, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + break; + case 12: + switch (subclass) { + case 1: + if (form == 9) { + _o_result = 4; + return _o_result; + } else { + _o_result = 8; + return _o_result; + } + break; + case 2: + if (form == 9) { + _o_result = 3; + return _o_result; + } else { + _o_result = 8; + return _o_result; + } + break; + case 3: case 4: + _o_result = 10; + return _o_result; + break; + case 6: + if (form == 9) { + _o_result = 2; + return _o_result; + } else { + _o_result = 7; + return _o_result; + } + break; + case 7: + if (form == 9) { + _o_result = 4; + return _o_result; + } else { + _o_result = 7; + return _o_result; + } + break; + case 11: case 12: case 13: case 14: + _o_result = 6; + return _o_result; + break; + case 9: case 10: + _o_result = 5; + return _o_result; + break; + case 5: + _o_result = 1; + return _o_result; + break; + case 8: + _o_result = 0; + return _o_result; + break; + case 19: case 15: case 17: case 18: case 26: + case 27: case 28: + _o_result = 10; + return _o_result; + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence Ndop, subclass = ", (LONGINT)51); + OPM_LogWNum(subclass, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + break; + case 10: + _o_result = 10; + return _o_result; + break; + case 8: case 6: + _o_result = 12; + return _o_result; + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence, class = ", (LONGINT)43); + OPM_LogWNum(class, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + __RETCHK; +} + +static void OPV_Len (OPT_Node n, LONGINT dim) +{ + while ((n->class == 4 && n->typ->comp == 3)) { + dim += 1; + n = n->left; + } + if ((n->class == 3 && n->typ->comp == 3)) { + OPV_design(n->left, 10); + OPM_WriteString((CHAR*)"->len[", (LONGINT)7); + OPM_WriteInt(dim); + OPM_Write(']'); + } else { + OPC_Len(n->obj, n->typ, dim); + } +} + +static BOOLEAN OPV_SideEffects (OPT_Node n) +{ + BOOLEAN _o_result; + if (n != NIL) { + _o_result = (n->class == 13 || OPV_SideEffects(n->left)) || OPV_SideEffects(n->right); + return _o_result; + } else { + _o_result = 0; + return _o_result; + } + __RETCHK; +} + +static void OPV_Entier (OPT_Node n, INTEGER prec) +{ + if (__IN(n->typ->form, 0x0180)) { + OPM_WriteString((CHAR*)"__ENTIER(", (LONGINT)10); + OPV_expr(n, -1); + OPM_Write(')'); + } else { + OPV_expr(n, prec); + } +} + +static void OPV_Convert (OPT_Node n, INTEGER form, INTEGER prec) +{ + INTEGER from; + from = n->typ->form; + if (form == 9) { + OPM_WriteString((CHAR*)"__SETOF(", (LONGINT)9); + OPV_Entier(n, -1); + OPM_Write(')'); + } else if (form == 6) { + if (from < 6) { + OPM_WriteString((CHAR*)"(LONGINT)", (LONGINT)10); + } + OPV_Entier(n, 9); + } else if (form == 5) { + if (from < 5) { + OPM_WriteString((CHAR*)"(int)", (LONGINT)6); + OPV_expr(n, 9); + } else { + if (__IN(2, OPM_opt)) { + OPM_WriteString((CHAR*)"__SHORT", (LONGINT)8); + if (OPV_SideEffects(n)) { + OPM_Write('F'); + } + OPM_Write('('); + OPV_Entier(n, -1); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteInt(OPM_MaxInt + 1); + OPM_Write(')'); + } else { + OPM_WriteString((CHAR*)"(int)", (LONGINT)6); + OPV_Entier(n, 9); + } + } + } else if (form == 4) { + if (__IN(2, OPM_opt)) { + OPM_WriteString((CHAR*)"__SHORT", (LONGINT)8); + if (OPV_SideEffects(n)) { + OPM_Write('F'); + } + OPM_Write('('); + OPV_Entier(n, -1); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteInt(OPM_MaxSInt + 1); + OPM_Write(')'); + } else { + OPM_WriteString((CHAR*)"(int)", (LONGINT)6); + OPV_Entier(n, 9); + } + } else if (form == 3) { + if (__IN(2, OPM_opt)) { + OPM_WriteString((CHAR*)"__CHR", (LONGINT)6); + if (OPV_SideEffects(n)) { + OPM_Write('F'); + } + OPM_Write('('); + OPV_Entier(n, -1); + OPM_Write(')'); + } else { + OPM_WriteString((CHAR*)"(CHAR)", (LONGINT)7); + OPV_Entier(n, 9); + } + } else { + OPV_expr(n, prec); + } +} + +static void OPV_TypeOf (OPT_Node n) +{ + if (n->typ->form == 13) { + OPM_WriteString((CHAR*)"__TYPEOF(", (LONGINT)10); + OPV_expr(n, -1); + OPM_Write(')'); + } else if (__IN(n->class, 0x15)) { + OPC_Andent(n->typ); + OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + } else if (n->class == 3) { + OPM_WriteString((CHAR*)"__TYPEOF(", (LONGINT)10); + OPV_expr(n->left, -1); + OPM_Write(')'); + } else if (n->class == 5) { + OPV_TypeOf(n->left); + } else if ((n->class == 11 && n->subcl == 29)) { + OPC_TypeOf(n->left->obj); + } else { + OPC_TypeOf(n->obj); + } +} + +static void OPV_Index (OPT_Node n, OPT_Node d, INTEGER prec, INTEGER dim) +{ + if (!OPV_inxchk || (n->right->class == 7 && (n->right->conval->intval == 0 || n->left->typ->comp != 3))) { + OPV_expr(n->right, prec); + } else { + if (OPV_SideEffects(n->right)) { + OPM_WriteString((CHAR*)"__XF(", (LONGINT)6); + } else { + OPM_WriteString((CHAR*)"__X(", (LONGINT)5); + } + OPV_expr(n->right, -1); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPV_Len(d, dim); + OPM_Write(')'); + } +} + +static void OPV_design (OPT_Node n, INTEGER prec) +{ + OPT_Object obj = NIL; + OPT_Struct typ = NIL; + INTEGER class, designPrec, comp; + OPT_Node d = NIL, x = NIL; + INTEGER dims, i, _for__26; + comp = n->typ->comp; + obj = n->obj; + class = n->class; + designPrec = OPV_Precedence(class, n->subcl, n->typ->form, comp); + if ((((((class == 0 && obj->mnolev > 0)) && (int)obj->mnolev != OPM_level)) && prec == 10)) { + designPrec = 9; + } + if (prec > designPrec) { + OPM_Write('('); + } + if (prec == 11) { + OPM_Write('*'); + } + switch (class) { + case 9: + OPC_Ident(n->obj); + break; + case 0: + OPC_CompleteIdent(n->obj); + break; + case 1: + if (!__IN(comp, 0x0c)) { + OPM_Write('*'); + } + OPC_CompleteIdent(n->obj); + break; + case 2: + if (n->left->class == 3) { + OPV_design(n->left->left, designPrec); + OPM_WriteString((CHAR*)"->", (LONGINT)3); + } else { + OPV_design(n->left, designPrec); + OPM_Write('.'); + } + OPC_Ident(n->obj); + break; + case 3: + if (n->typ->comp == 3) { + OPV_design(n->left, 10); + OPM_WriteString((CHAR*)"->data", (LONGINT)7); + } else { + OPM_Write('*'); + OPV_design(n->left, designPrec); + } + break; + case 4: + d = n->left; + if (d->typ->comp == 3) { + dims = 0; + while (d->class == 4) { + d = d->left; + dims += 1; + } + if (n->typ->comp == 3) { + OPM_Write('&'); + } + OPV_design(d, designPrec); + OPM_Write('['); + if (n->typ->comp == 3) { + OPM_Write('('); + } + i = dims; + x = n; + while (x != d) { + if (x->left != d) { + OPV_Index(x, d, 7, i); + OPM_WriteString((CHAR*)" + ", (LONGINT)4); + OPV_Len(d, i); + OPM_WriteString((CHAR*)" * (", (LONGINT)5); + i -= 1; + } else { + OPV_Index(x, d, -1, i); + } + x = x->left; + } + _for__26 = dims; + i = 1; + while (i <= _for__26) { + OPM_Write(')'); + i += 1; + } + if (n->typ->comp == 3) { + OPM_Write(')'); + while ((LONGINT)i < __ASHR(d->typ->size - 4, 2)) { + OPM_WriteString((CHAR*)" * ", (LONGINT)4); + OPV_Len(d, i); + i += 1; + } + } + OPM_Write(']'); + } else { + OPV_design(n->left, designPrec); + OPM_Write('['); + OPV_Index(n, n->left, -1, 0); + OPM_Write(']'); + } + break; + case 5: + typ = n->typ; + obj = n->left->obj; + if (__IN(3, OPM_opt)) { + if (typ->comp == 4) { + OPM_WriteString((CHAR*)"__GUARDR(", (LONGINT)10); + if ((int)obj->mnolev != OPM_level) { + OPM_WriteStringVar((void*)obj->scope->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"__curr->", (LONGINT)9); + OPC_Ident(obj); + } else { + OPC_Ident(obj); + } + } else { + if (typ->BaseTyp->strobj == NIL) { + OPM_WriteString((CHAR*)"__GUARDA(", (LONGINT)10); + } else { + OPM_WriteString((CHAR*)"__GUARDP(", (LONGINT)10); + } + OPV_expr(n->left, -1); + typ = typ->BaseTyp; + } + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPC_Andent(typ); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteInt(typ->extlev); + OPM_Write(')'); + } else { + if (typ->comp == 4) { + OPM_WriteString((CHAR*)"*(", (LONGINT)3); + OPC_Ident(typ->strobj); + OPM_WriteString((CHAR*)"*)", (LONGINT)3); + OPC_CompleteIdent(obj); + } else { + OPM_Write('('); + OPC_Ident(typ->strobj); + OPM_Write(')'); + OPV_expr(n->left, designPrec); + } + } + break; + case 6: + if (__IN(3, OPM_opt)) { + if (n->left->class == 1) { + OPM_WriteString((CHAR*)"__GUARDEQR(", (LONGINT)12); + OPC_CompleteIdent(n->left->obj); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPV_TypeOf(n->left); + } else { + OPM_WriteString((CHAR*)"__GUARDEQP(", (LONGINT)12); + OPV_expr(n->left->left, -1); + } + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPC_Ident(n->left->typ->strobj); + OPM_Write(')'); + } else { + OPV_expr(n->left, -1); + } + break; + case 11: + if (n->subcl == 29) { + OPV_design(n->left, prec); + } + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPV.design, class = ", (LONGINT)39); + OPM_LogWNum(class, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + if (prec > designPrec) { + OPM_Write(')'); + } +} + +static void OPV_ActualPar (OPT_Node n, OPT_Object fp) +{ + OPT_Struct typ = NIL, aptyp = NIL; + INTEGER comp, form, mode, prec, dim; + OPM_Write('('); + while (n != NIL) { + typ = fp->typ; + comp = typ->comp; + form = typ->form; + mode = fp->mode; + prec = -1; + if ((((mode == 2 && n->class == 11)) && n->subcl == 29)) { + OPM_Write('('); + OPC_Ident(n->typ->strobj); + OPM_WriteString((CHAR*)"*)", (LONGINT)3); + prec = 10; + } + if (!__IN(n->typ->comp, 0x0c)) { + if (mode == 2) { + if ((OPV_ansi && typ != n->typ)) { + OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + } + OPM_Write('&'); + prec = 9; + } else if (OPV_ansi) { + if ((__IN(comp, 0x0c) && n->class == 7)) { + OPM_WriteString((CHAR*)"(CHAR*)", (LONGINT)8); + } else if ((((form == 13 && typ != n->typ)) && n->typ != OPT_niltyp)) { + OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + } + } else { + if ((__IN(form, 0x0180) && __IN(n->typ->form, 0x70))) { + OPM_WriteString((CHAR*)"(double)", (LONGINT)9); + prec = 9; + } else if ((form == 6 && n->typ->form < 6)) { + OPM_WriteString((CHAR*)"(LONGINT)", (LONGINT)10); + prec = 9; + } + } + } else if (OPV_ansi) { + if ((((mode == 2 && typ != n->typ)) && prec == -1)) { + OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + } + } + if ((((mode == 2 && n->class == 11)) && n->subcl == 29)) { + OPV_expr(n->left, prec); + } else if ((((((form == 6 && n->class == 7)) && n->conval->intval <= OPM_MaxInt)) && n->conval->intval >= OPM_MinInt)) { + OPM_WriteString((CHAR*)"((LONGINT)(", (LONGINT)12); + OPV_expr(n, prec); + OPM_WriteString((CHAR*)"))", (LONGINT)3); + } else { + OPV_expr(n, prec); + } + if ((comp == 4 && mode == 2)) { + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPV_TypeOf(n); + } else if (comp == 3) { + if (n->class == 7) { + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)"(LONGINT)", (LONGINT)10); + OPM_WriteInt(n->conval->intval2); + } else { + aptyp = n->typ; + dim = 0; + while ((typ->comp == 3 && typ->BaseTyp->form != 1)) { + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPV_Len(n, dim); + typ = typ->BaseTyp; + aptyp = aptyp->BaseTyp; + dim += 1; + } + if ((typ->comp == 3 && typ->BaseTyp->form == 1)) { + OPM_WriteString((CHAR*)", ", (LONGINT)3); + while (aptyp->comp == 3) { + OPV_Len(n, dim); + OPM_WriteString((CHAR*)" * ", (LONGINT)4); + dim += 1; + aptyp = aptyp->BaseTyp; + } + OPM_WriteString((CHAR*)"((LONGINT)(", (LONGINT)12); + OPM_WriteInt(aptyp->size); + OPM_WriteString((CHAR*)"))", (LONGINT)3); + } + } + } + n = n->link; + fp = fp->link; + if (n != NIL) { + OPM_WriteString((CHAR*)", ", (LONGINT)3); + } + } + OPM_Write(')'); +} + +static OPT_Object OPV_SuperProc (OPT_Node n) +{ + OPT_Object _o_result; + OPT_Object obj = NIL; + OPT_Struct typ = NIL; + typ = n->right->typ; + if (typ->form == 13) { + typ = typ->BaseTyp; + } + OPT_FindField(n->left->obj->name, typ->BaseTyp, &obj); + _o_result = obj; + return _o_result; +} + +static void OPV_expr (OPT_Node n, INTEGER prec) +{ + INTEGER class, subclass, form, exprPrec; + OPT_Struct typ = NIL; + OPT_Node l = NIL, r = NIL; + OPT_Object proc = NIL; + class = n->class; + subclass = n->subcl; + form = n->typ->form; + l = n->left; + r = n->right; + exprPrec = OPV_Precedence(class, subclass, form, n->typ->comp); + if ((exprPrec <= prec && __IN(class, 0x3ce0))) { + OPM_Write('('); + } + switch (class) { + case 7: + OPC_Constant(n->conval, form); + break; + case 10: + OPM_WriteString((CHAR*)"__SETRNG(", (LONGINT)10); + OPV_expr(l, -1); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPV_expr(r, -1); + OPM_Write(')'); + break; + case 11: + switch (subclass) { + case 33: + OPM_Write('!'); + OPV_expr(l, exprPrec); + break; + case 7: + if (form == 9) { + OPM_Write('~'); + } else { + OPM_Write('-'); + } + OPV_expr(l, exprPrec); + break; + case 16: + typ = n->obj->typ; + if (l->typ->comp == 4) { + OPM_WriteString((CHAR*)"__IS(", (LONGINT)6); + OPC_TypeOf(l->obj); + } else { + OPM_WriteString((CHAR*)"__ISP(", (LONGINT)7); + OPV_expr(l, -1); + typ = typ->BaseTyp; + } + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPC_Andent(typ); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteInt(typ->extlev); + OPM_Write(')'); + break; + case 20: + OPV_Convert(l, form, exprPrec); + break; + case 21: + if (OPV_SideEffects(l)) { + if (l->typ->form < 7) { + if (l->typ->form < 6) { + OPM_WriteString((CHAR*)"(int)", (LONGINT)6); + } + OPM_WriteString((CHAR*)"__ABSF(", (LONGINT)8); + } else { + OPM_WriteString((CHAR*)"__ABSFD(", (LONGINT)9); + } + } else { + OPM_WriteString((CHAR*)"__ABS(", (LONGINT)7); + } + OPV_expr(l, -1); + OPM_Write(')'); + break; + case 22: + OPM_WriteString((CHAR*)"__CAP(", (LONGINT)7); + OPV_expr(l, -1); + OPM_Write(')'); + break; + case 23: + OPM_WriteString((CHAR*)"__ODD(", (LONGINT)7); + OPV_expr(l, -1); + OPM_Write(')'); + break; + case 24: + OPM_WriteString((CHAR*)"(LONGINT)(uintptr_t)", (LONGINT)21); + if (l->class == 1) { + OPC_CompleteIdent(l->obj); + } else { + if ((l->typ->form != 10 && !__IN(l->typ->comp, 0x0c))) { + OPM_Write('&'); + } + OPV_expr(l, exprPrec); + } + break; + case 29: + if ((((__IN(n->typ->form, 0x6240) && __IN(l->typ->form, 0x6240))) && n->typ->size == l->typ->size) || !__IN(l->class, 0x17)) { + OPM_Write('('); + OPC_Ident(n->typ->strobj); + OPM_Write(')'); + if (__IN(n->typ->form, 0x6000) || __IN(l->typ->form, 0x6000)) { + OPM_WriteString((CHAR*)"(uintptr_t)", (LONGINT)12); + } + OPV_expr(l, exprPrec); + } else { + if (__IN(n->typ->form, 0x6000) || __IN(l->typ->form, 0x6000)) { + OPM_WriteString((CHAR*)"__VALP(", (LONGINT)8); + } else { + OPM_WriteString((CHAR*)"__VAL(", (LONGINT)7); + } + OPC_Ident(n->typ->strobj); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPV_expr(l, -1); + OPM_Write(')'); + } + break; + default: + OPM_err(200); + break; + } + break; + case 12: + switch (subclass) { + case 19: + OPV_Len(l, r->conval->intval); + break; + case 15: case 17: case 18: case 26: case 27: + case 28: case 3: case 4: + switch (subclass) { + case 15: + OPM_WriteString((CHAR*)"__IN(", (LONGINT)6); + break; + case 17: + if (r->class == 7) { + if (r->conval->intval >= 0) { + OPM_WriteString((CHAR*)"__ASHL(", (LONGINT)8); + } else { + OPM_WriteString((CHAR*)"__ASHR(", (LONGINT)8); + } + } else if (OPV_SideEffects(r)) { + OPM_WriteString((CHAR*)"__ASHF(", (LONGINT)8); + } else { + OPM_WriteString((CHAR*)"__ASH(", (LONGINT)7); + } + break; + case 18: + OPM_WriteString((CHAR*)"__MASK(", (LONGINT)8); + break; + case 26: + OPM_WriteString((CHAR*)"__BIT(", (LONGINT)7); + break; + case 27: + if (r->class == 7) { + if (r->conval->intval >= 0) { + OPM_WriteString((CHAR*)"__LSHL(", (LONGINT)8); + } else { + OPM_WriteString((CHAR*)"__LSHR(", (LONGINT)8); + } + } else { + OPM_WriteString((CHAR*)"__LSH(", (LONGINT)7); + } + break; + case 28: + if (r->class == 7) { + if (r->conval->intval >= 0) { + OPM_WriteString((CHAR*)"__ROTL(", (LONGINT)8); + } else { + OPM_WriteString((CHAR*)"__ROTR(", (LONGINT)8); + } + } else { + OPM_WriteString((CHAR*)"__ROT(", (LONGINT)7); + } + break; + case 3: + if (OPV_SideEffects(n)) { + if (form < 6) { + OPM_WriteString((CHAR*)"(int)", (LONGINT)6); + } + OPM_WriteString((CHAR*)"__DIVF(", (LONGINT)8); + } else { + OPM_WriteString((CHAR*)"__DIV(", (LONGINT)7); + } + break; + case 4: + if (form < 6) { + OPM_WriteString((CHAR*)"(int)", (LONGINT)6); + } + if (OPV_SideEffects(n)) { + OPM_WriteString((CHAR*)"__MODF(", (LONGINT)8); + } else { + OPM_WriteString((CHAR*)"__MOD(", (LONGINT)7); + } + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, subclass = ", (LONGINT)40); + OPM_LogWNum(subclass, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + OPV_expr(l, -1); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + if ((((__IN(subclass, 0x18020000) && r->class == 7)) && r->conval->intval < 0)) { + OPM_WriteInt(-r->conval->intval); + } else { + OPV_expr(r, -1); + } + if (__IN(subclass, 0x18000000)) { + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPC_Ident(l->typ->strobj); + } + OPM_Write(')'); + break; + case 9: case 10: case 11: case 12: case 13: + case 14: + if (__IN(l->typ->form, 0x8400)) { + OPM_WriteString((CHAR*)"__STRCMP(", (LONGINT)10); + OPV_expr(l, -1); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPV_expr(r, -1); + OPM_Write(')'); + OPC_Cmp(subclass); + OPM_Write('0'); + } else { + OPV_expr(l, exprPrec); + OPC_Cmp(subclass); + typ = l->typ; + if ((((((typ->form == 13 && r->typ->form != 11)) && r->typ != typ)) && r->typ != OPT_sysptrtyp)) { + OPM_WriteString((CHAR*)"(void *) ", (LONGINT)10); + } + OPV_expr(r, exprPrec); + } + break; + default: + if (subclass == 5 || (form == 9 && (subclass == 1 || subclass == 7))) { + OPM_Write('('); + } + OPV_expr(l, exprPrec); + switch (subclass) { + case 1: + if (form == 9) { + OPM_WriteString((CHAR*)" & ", (LONGINT)4); + } else { + OPM_WriteString((CHAR*)" * ", (LONGINT)4); + } + break; + case 2: + if (form == 9) { + OPM_WriteString((CHAR*)" ^ ", (LONGINT)4); + } else { + OPM_WriteString((CHAR*)" / ", (LONGINT)4); + if (r->obj == NIL || __IN(r->obj->typ->form, 0x70)) { + OPM_Write('('); + OPC_Ident(n->typ->strobj); + OPM_Write(')'); + } + } + break; + case 5: + OPM_WriteString((CHAR*)" && ", (LONGINT)5); + break; + case 6: + if (form == 9) { + OPM_WriteString((CHAR*)" | ", (LONGINT)4); + } else { + OPM_WriteString((CHAR*)" + ", (LONGINT)4); + } + break; + case 7: + if (form == 9) { + OPM_WriteString((CHAR*)" & ~", (LONGINT)5); + } else { + OPM_WriteString((CHAR*)" - ", (LONGINT)4); + } + break; + case 8: + OPM_WriteString((CHAR*)" || ", (LONGINT)5); + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, subclass = ", (LONGINT)40); + OPM_LogWNum(subclass, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + OPV_expr(r, exprPrec); + if (subclass == 5 || (form == 9 && (subclass == 1 || subclass == 7))) { + OPM_Write(')'); + } + break; + } + break; + case 13: + if ((l->obj != NIL && l->obj->mode == 13)) { + if (l->subcl == 1) { + proc = OPV_SuperProc(n); + } else { + OPM_WriteString((CHAR*)"__", (LONGINT)3); + proc = OPC_BaseTProc(l->obj); + } + OPC_Ident(proc); + n->obj = proc->link; + } else if (l->class == 9) { + OPV_design(l, 10); + } else { + OPV_design(l, 11); + } + OPV_ActualPar(r, n->obj); + break; + default: + OPV_design(n, prec); + break; + } + if ((exprPrec <= prec && __IN(class, 0x3ca0))) { + OPM_Write(')'); + } +} + +static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) +{ + OPT_Node if_ = NIL; + OPT_Object obj = NIL; + OPT_Struct typ = NIL; + LONGINT adr; + if_ = n->left; + while (if_ != NIL) { + OPM_WriteString((CHAR*)"if ", (LONGINT)4); + OPV_expr(if_->left, 12); + OPM_Write(' '); + OPC_BegBlk(); + if ((n->class == 27 && if_->left->left != NIL)) { + obj = if_->left->left->obj; + typ = obj->typ; + adr = obj->adr; + if (typ->comp == 4) { + OPC_BegStat(); + OPC_Ident(if_->left->obj); + OPM_WriteString((CHAR*)" *", (LONGINT)3); + OPM_WriteString(obj->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"__ = (void*)", (LONGINT)13); + obj->adr = 0; + OPC_CompleteIdent(obj); + OPC_EndStat(); + } + obj->adr = 1; + obj->typ = if_->left->obj->typ; + OPV_stat(if_->right, outerProc); + obj->typ = typ; + obj->adr = adr; + } else { + OPV_stat(if_->right, outerProc); + } + if_ = if_->link; + if ((if_ != NIL || n->right != NIL) || withtrap) { + OPC_EndBlk0(); + OPM_WriteString((CHAR*)" else ", (LONGINT)7); + } else { + OPC_EndBlk(); + } + } + if (withtrap) { + OPM_WriteString((CHAR*)"__WITHCHK", (LONGINT)10); + OPC_EndStat(); + } else if (n->right != NIL) { + OPC_BegBlk(); + OPV_stat(n->right, outerProc); + OPC_EndBlk(); + } +} + +static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc) +{ + OPT_Node switchCase = NIL, label = NIL; + LONGINT low, high; + INTEGER form, i; + OPM_WriteString((CHAR*)"switch ", (LONGINT)8); + OPV_expr(n->left, 12); + OPM_Write(' '); + OPC_BegBlk(); + form = n->left->typ->form; + switchCase = n->right->left; + while (switchCase != NIL) { + label = switchCase->left; + i = 0; + while (label != NIL) { + low = label->conval->intval; + high = label->conval->intval2; + while (low <= high) { + if (i == 0) { + OPC_BegStat(); + } + OPC_Case(low, form); + low += 1; + i += 1; + if (i == 5) { + OPM_WriteLn(); + i = 0; + } + } + label = label->link; + } + if (i > 0) { + OPM_WriteLn(); + } + OPC_Indent(1); + OPV_stat(switchCase->right, outerProc); + OPC_BegStat(); + OPM_WriteString((CHAR*)"break", (LONGINT)6); + OPC_EndStat(); + OPC_Indent(-1); + switchCase = switchCase->link; + } + OPC_BegStat(); + OPM_WriteString((CHAR*)"default: ", (LONGINT)10); + if (n->right->conval->setval != 0x0) { + OPC_Indent(1); + OPM_WriteLn(); + OPV_stat(n->right->right, outerProc); + OPC_BegStat(); + OPM_WriteString((CHAR*)"break", (LONGINT)6); + OPC_Indent(-1); + } else { + OPM_WriteString((CHAR*)"__CASECHK", (LONGINT)10); + } + OPC_EndStat(); + OPC_EndBlk(); +} + +static BOOLEAN OPV_ImplicitReturn (OPT_Node n) +{ + BOOLEAN _o_result; + while ((n != NIL && n->class != 26)) { + n = n->link; + } + _o_result = n == NIL; + return _o_result; +} + +static void OPV_NewArr (OPT_Node d, OPT_Node x) +{ + OPT_Struct typ = NIL, base = NIL; + INTEGER nofdim, nofdyn; + typ = d->typ->BaseTyp; + base = typ; + nofdim = 0; + nofdyn = 0; + while (base->comp == 3) { + nofdim += 1; + nofdyn += 1; + base = base->BaseTyp; + } + OPV_design(d, -1); + OPM_WriteString((CHAR*)" = __NEWARR(", (LONGINT)13); + while (base->comp == 2) { + nofdim += 1; + base = base->BaseTyp; + } + if ((base->comp == 4 && OPC_NofPtrs(base) != 0)) { + OPC_Ident(base->strobj); + OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + } else if (base->form == 13) { + OPM_WriteString((CHAR*)"POINTER__typ", (LONGINT)13); + } else { + OPM_WriteString((CHAR*)"NIL", (LONGINT)4); + } + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)"((LONGINT)(", (LONGINT)12); + OPM_WriteInt(base->size); + OPM_WriteString((CHAR*)"))", (LONGINT)3); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteInt(OPC_Base(base)); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteInt(nofdim); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteInt(nofdyn); + while (typ != base) { + OPM_WriteString((CHAR*)", ", (LONGINT)3); + if (typ->comp == 3) { + if (x->class == 7) { + OPM_WriteString((CHAR*)"(LONGINT)(", (LONGINT)11); + OPV_expr(x, -1); + OPM_WriteString((CHAR*)")", (LONGINT)2); + } else { + OPM_WriteString((CHAR*)"(LONGINT)", (LONGINT)10); + OPV_expr(x, 10); + } + x = x->link; + } else { + OPM_WriteString((CHAR*)"(LONGINT)", (LONGINT)10); + OPM_WriteInt(typ->n); + } + typ = typ->BaseTyp; + } + OPM_Write(')'); +} + +static void OPV_DefineTDescs (OPT_Node n) +{ + while ((n != NIL && n->class == 14)) { + OPC_TDescDecl(n->typ); + n = n->link; + } +} + +static void OPV_InitTDescs (OPT_Node n) +{ + while ((n != NIL && n->class == 14)) { + OPC_InitTDesc(n->typ); + n = n->link; + } +} + +static void OPV_stat (OPT_Node n, OPT_Object outerProc) +{ + OPT_Object proc = NIL; + OPV_ExitInfo saved; + OPT_Node l = NIL, r = NIL; + while ((n != NIL && OPM_noerr)) { + OPM_errpos = n->conval->intval; + if (n->class != 14) { + OPC_BegStat(); + } + switch (n->class) { + case 18: + if (n->obj == NIL) { + OPM_level += 1; + OPV_stat(n->left, outerProc); + OPM_level -= 1; + OPC_GenEnumPtrs(OPT_topScope->scope); + OPV_DefineTDescs(n->right); + OPC_EnterBody(); + OPV_InitTDescs(n->right); + OPM_WriteString((CHAR*)"/* BEGIN */", (LONGINT)12); + OPM_WriteLn(); + OPV_stat(n->right, outerProc); + OPC_ExitBody(); + } else { + proc = n->obj; + OPC_TypeDefs(proc->scope->right, 0); + if (!proc->scope->leaf) { + OPC_DefineInter(proc); + } + OPM_level += 1; + OPV_stat(n->left, proc); + OPM_level -= 1; + OPC_EnterProc(proc); + OPV_stat(n->right, proc); + OPC_ExitProc(proc, 1, OPV_ImplicitReturn(n->right)); + } + break; + case 14: + break; + case 19: + switch (n->subcl) { + case 0: + l = n->left; + r = n->right; + if (l->typ->comp == 2) { + OPM_WriteString((CHAR*)"__MOVE(", (LONGINT)8); + OPV_expr(r, -1); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPV_expr(l, -1); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + if (r->typ == OPT_stringtyp) { + OPM_WriteInt(r->conval->intval2); + } else { + OPM_WriteInt(r->typ->size); + } + OPM_Write(')'); + } else { + if ((((((l->typ->form == 13 && l->obj != NIL)) && l->obj->adr == 1)) && l->obj->mode == 1)) { + l->obj->adr = 0; + OPV_design(l, -1); + l->obj->adr = 1; + if (r->typ->form != 11) { + OPM_WriteString((CHAR*)" = (void*)", (LONGINT)11); + } else { + OPM_WriteString((CHAR*)" = ", (LONGINT)4); + } + } else { + OPV_design(l, -1); + OPM_WriteString((CHAR*)" = ", (LONGINT)4); + } + if (l->typ == r->typ) { + OPV_expr(r, -1); + } else if ((((l->typ->form == 13 && r->typ->form != 11)) && l->typ->strobj != NIL)) { + OPM_Write('('); + OPC_Ident(l->typ->strobj); + OPM_Write(')'); + OPV_expr(r, -1); + } else if (l->typ->comp == 4) { + OPM_WriteString((CHAR*)"*(", (LONGINT)3); + OPC_Andent(l->typ); + OPM_WriteString((CHAR*)"*)&", (LONGINT)4); + OPV_expr(r, 9); + } else { + OPV_expr(r, -1); + } + } + break; + case 1: + if (n->left->typ->BaseTyp->comp == 4) { + OPM_WriteString((CHAR*)"__NEW(", (LONGINT)7); + OPV_design(n->left, -1); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPC_Andent(n->left->typ->BaseTyp); + OPM_WriteString((CHAR*)")", (LONGINT)2); + } else if (__IN(n->left->typ->BaseTyp->comp, 0x0c)) { + OPV_NewArr(n->left, n->right); + } + break; + case 13: case 14: + OPV_expr(n->left, -1); + OPC_Increment(n->subcl == 14); + OPV_expr(n->right, -1); + break; + case 15: case 16: + OPV_expr(n->left, -1); + OPC_SetInclude(n->subcl == 16); + OPM_WriteString((CHAR*)"__SETOF(", (LONGINT)9); + OPV_expr(n->right, -1); + OPM_Write(')'); + break; + case 18: + OPM_WriteString((CHAR*)"__COPY(", (LONGINT)8); + OPV_expr(n->right, -1); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPV_expr(n->left, -1); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPV_Len(n->left, ((LONGINT)(0))); + OPM_Write(')'); + break; + case 31: + OPM_WriteString((CHAR*)"__MOVE(", (LONGINT)8); + OPV_expr(n->right, -1); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPV_expr(n->left, -1); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPV_expr(n->right->link, -1); + OPM_Write(')'); + break; + case 24: + OPM_WriteString((CHAR*)"__GET(", (LONGINT)7); + OPV_expr(n->right, -1); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPV_expr(n->left, -1); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPC_Ident(n->left->typ->strobj); + OPM_Write(')'); + break; + case 25: + OPM_WriteString((CHAR*)"__PUT(", (LONGINT)7); + OPV_expr(n->left, -1); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPV_expr(n->right, -1); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPC_Ident(n->right->typ->strobj); + OPM_Write(')'); + break; + case 26: case 27: + OPM_err(200); + break; + case 30: + OPM_WriteString((CHAR*)"__SYSNEW(", (LONGINT)10); + OPV_design(n->left, -1); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPV_expr(n->right, -1); + OPM_Write(')'); + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, n^.subcl = ", (LONGINT)40); + OPM_LogWNum(n->subcl, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + break; + case 13: + if ((n->left->obj != NIL && n->left->obj->mode == 13)) { + if (n->left->subcl == 1) { + proc = OPV_SuperProc(n); + } else { + OPM_WriteString((CHAR*)"__", (LONGINT)3); + proc = OPC_BaseTProc(n->left->obj); + } + OPC_Ident(proc); + n->obj = proc->link; + } else if (n->left->class == 9) { + OPV_design(n->left, 10); + } else { + OPV_design(n->left, 11); + } + OPV_ActualPar(n->right, n->obj); + break; + case 20: + if (n->subcl != 32) { + OPV_IfStat(n, 0, outerProc); + } else if (OPV_assert) { + OPM_WriteString((CHAR*)"__ASSERT(", (LONGINT)10); + OPV_expr(n->left->left->left, -1); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteInt(n->left->right->right->conval->intval); + OPM_Write(')'); + OPC_EndStat(); + } + break; + case 21: + OPV_exit.level += 1; + OPV_CaseStat(n, outerProc); + OPV_exit.level -= 1; + break; + case 22: + OPV_exit.level += 1; + OPM_WriteString((CHAR*)"while ", (LONGINT)7); + OPV_expr(n->left, 12); + OPM_Write(' '); + OPC_BegBlk(); + OPV_stat(n->right, outerProc); + OPC_EndBlk(); + OPV_exit.level -= 1; + break; + case 23: + OPV_exit.level += 1; + OPM_WriteString((CHAR*)"do ", (LONGINT)4); + OPC_BegBlk(); + OPV_stat(n->left, outerProc); + OPC_EndBlk0(); + OPM_WriteString((CHAR*)" while (!", (LONGINT)10); + OPV_expr(n->right, 9); + OPM_Write(')'); + OPV_exit.level -= 1; + break; + case 24: + saved = OPV_exit; + OPV_exit.level = 0; + OPV_exit.label = -1; + OPM_WriteString((CHAR*)"for (;;) ", (LONGINT)10); + OPC_BegBlk(); + OPV_stat(n->left, outerProc); + OPC_EndBlk(); + if (OPV_exit.label != -1) { + OPC_BegStat(); + OPM_WriteString((CHAR*)"exit__", (LONGINT)7); + OPM_WriteInt(OPV_exit.label); + OPM_Write(':'); + OPC_EndStat(); + } + OPV_exit = saved; + break; + case 25: + if (OPV_exit.level == 0) { + OPM_WriteString((CHAR*)"break", (LONGINT)6); + } else { + if (OPV_exit.label == -1) { + OPV_exit.label = OPV_nofExitLabels; + OPV_nofExitLabels += 1; + } + OPM_WriteString((CHAR*)"goto exit__", (LONGINT)12); + OPM_WriteInt(OPV_exit.label); + } + break; + case 26: + if (OPM_level == 0) { + if (OPV_mainprog) { + OPM_WriteString((CHAR*)"__FINI", (LONGINT)7); + } else { + OPM_WriteString((CHAR*)"__ENDMOD", (LONGINT)9); + } + } else { + if (n->left != NIL) { + OPM_WriteString((CHAR*)"_o_result = ", (LONGINT)13); + if ((n->left->typ->form == 13 && n->obj->typ != n->left->typ)) { + OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + OPV_expr(n->left, 10); + } else { + OPV_expr(n->left, -1); + } + OPM_WriteString((CHAR*)";", (LONGINT)2); + OPM_WriteLn(); + OPC_BegStat(); + OPC_ExitProc(outerProc, 0, 0); + OPM_WriteString((CHAR*)"return _o_result", (LONGINT)17); + } else { + OPM_WriteString((CHAR*)"return", (LONGINT)7); + } + } + break; + case 27: + OPV_IfStat(n, n->subcl == 0, outerProc); + break; + case 28: + OPC_Halt(n->right->conval->intval); + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, n^.class = ", (LONGINT)40); + OPM_LogWNum(n->class, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + if (!__IN(n->class, 0x09744000)) { + OPC_EndStat(); + } + n = n->link; + } +} + +void OPV_Module (OPT_Node prog) +{ + if (!OPV_mainprog) { + OPC_GenHdr(prog->right); + OPC_GenHdrIncludes(); + } + OPC_GenBdy(prog->right); + OPV_stat(prog, NIL); +} + +__TDESC(OPV_ExitInfo, 1, 0) = {__TDFLDS("ExitInfo", 8), {-8}}; + +export void *OPV__init(void) +{ + __DEFMOD; + __MODULE_IMPORT(OPC); + __MODULE_IMPORT(OPM); + __MODULE_IMPORT(OPS); + __MODULE_IMPORT(OPT); + __REGMOD("OPV", 0); + __REGCMD("Init", OPV_Init); + __INITYP(OPV_ExitInfo, OPV_ExitInfo, 0); +/* BEGIN */ + __ENDMOD; +} diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h new file mode 100644 index 00000000..7f0a5b8a --- /dev/null +++ b/bootstrap/unix-88/OPV.h @@ -0,0 +1,20 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ + +#ifndef OPV__h +#define OPV__h + +#define LARGE +#include "SYSTEM.h" +#include "OPT.h" + + + + +import void OPV_AdrAndSize (OPT_Object topScope); +import void OPV_Init (void); +import void OPV_Module (OPT_Node prog); +import void OPV_TypSize (OPT_Struct typ); +import void *OPV__init(void); + + +#endif diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c new file mode 100644 index 00000000..9a892174 --- /dev/null +++ b/bootstrap/unix-88/Platform.c @@ -0,0 +1,793 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +#define LARGE +#include "SYSTEM.h" + +typedef + CHAR (*Platform_ArgPtr)[1024]; + +typedef + Platform_ArgPtr (*Platform_ArgVec)[1024]; + +typedef + LONGINT (*Platform_ArgVecPtr)[1]; + +typedef + CHAR (*Platform_EnvPtr)[1024]; + +typedef + struct Platform_FileIdentity { + LONGINT volume, index, mtime; + } Platform_FileIdentity; + +typedef + void (*Platform_HaltProcedure)(LONGINT); + +typedef + void (*Platform_SignalHandler)(INTEGER); + + +export BOOLEAN Platform_LittleEndian; +export LONGINT Platform_MainStackFrame, Platform_HaltCode; +export INTEGER Platform_PID; +export CHAR Platform_CWD[256]; +export INTEGER Platform_ArgCount; +export LONGINT Platform_ArgVector; +static Platform_HaltProcedure Platform_HaltHandler; +static LONGINT Platform_TimeStart; +export INTEGER Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; +export CHAR Platform_nl[3]; + +export LONGINT *Platform_FileIdentity__typ; + +export BOOLEAN Platform_Absent (INTEGER e); +export INTEGER Platform_ArgPos (CHAR *s, LONGINT s__len); +export void Platform_AssertFail (LONGINT code); +export INTEGER Platform_Chdir (CHAR *n, LONGINT n__len); +export INTEGER Platform_Close (LONGINT h); +export BOOLEAN Platform_ConnectionFailed (INTEGER e); +export void Platform_Delay (LONGINT ms); +export BOOLEAN Platform_DifferentFilesystems (INTEGER e); +static void Platform_DisplayHaltCode (LONGINT code); +export INTEGER Platform_Error (void); +export void Platform_Exit (INTEGER code); +export void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len); +export void Platform_GetClock (LONGINT *t, LONGINT *d); +export void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); +export void Platform_GetIntArg (INTEGER n, LONGINT *val); +export void Platform_GetTimeOfDay (LONGINT *sec, LONGINT *usec); +export void Platform_Halt (LONGINT code); +export INTEGER Platform_Identify (LONGINT h, Platform_FileIdentity *identity, LONGINT *identity__typ); +export INTEGER Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); +export BOOLEAN Platform_Inaccessible (INTEGER e); +export void Platform_Init (INTEGER argc, LONGINT argvadr); +export void Platform_MTimeAsClock (Platform_FileIdentity i, LONGINT *t, LONGINT *d); +export INTEGER Platform_New (CHAR *n, LONGINT n__len, LONGINT *h); +export BOOLEAN Platform_NoSuchDirectory (INTEGER e); +export LONGINT Platform_OSAllocate (LONGINT size); +export void Platform_OSFree (LONGINT address); +export INTEGER Platform_OldRO (CHAR *n, LONGINT n__len, LONGINT *h); +export INTEGER Platform_OldRW (CHAR *n, LONGINT n__len, LONGINT *h); +export INTEGER Platform_Read (LONGINT h, LONGINT p, LONGINT l, LONGINT *n); +export INTEGER Platform_ReadBuf (LONGINT h, SYSTEM_BYTE *b, LONGINT b__len, LONGINT *n); +export INTEGER Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); +export BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); +export BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); +export INTEGER Platform_Seek (LONGINT h, LONGINT offset, INTEGER whence); +export void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); +export void Platform_SetHalt (Platform_HaltProcedure p); +export void Platform_SetInterruptHandler (Platform_SignalHandler handler); +export void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Platform_FileIdentity source); +export void Platform_SetQuitHandler (Platform_SignalHandler handler); +export INTEGER Platform_Size (LONGINT h, LONGINT *l); +export INTEGER Platform_Sync (LONGINT h); +export INTEGER Platform_System (CHAR *cmd, LONGINT cmd__len); +static void Platform_TestLittleEndian (void); +export LONGINT Platform_Time (void); +export BOOLEAN Platform_TimedOut (INTEGER e); +export BOOLEAN Platform_TooManyFiles (INTEGER e); +export INTEGER Platform_Truncate (LONGINT h, LONGINT l); +export INTEGER Platform_Unlink (CHAR *n, LONGINT n__len); +export INTEGER Platform_Write (LONGINT h, LONGINT p, LONGINT l); +static void Platform_YMDHMStoClock (LONGINT ye, LONGINT mo, LONGINT da, LONGINT ho, LONGINT mi, LONGINT se, LONGINT *t, LONGINT *d); +static void Platform_errch (CHAR c); +static void Platform_errint (LONGINT l); +static void Platform_errln (void); +static void Platform_errposint (LONGINT l); +export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#define Platform_EACCES() EACCES +#define Platform_EAGAIN() EAGAIN +#define Platform_ECONNABORTED() ECONNABORTED +#define Platform_ECONNREFUSED() ECONNREFUSED +#define Platform_EHOSTUNREACH() EHOSTUNREACH +#define Platform_EMFILE() EMFILE +#define Platform_ENETUNREACH() ENETUNREACH +#define Platform_ENFILE() ENFILE +#define Platform_ENOENT() ENOENT +#define Platform_EROFS() EROFS +#define Platform_ETIMEDOUT() ETIMEDOUT +#define Platform_EXDEV() EXDEV +extern void Heap_InitHeap(); +#define Platform_HeapInitHeap() Heap_InitHeap() +#define Platform_allocate(size) (LONGINT)(uintptr_t)((void*)malloc((size_t)size)) +#define Platform_chdir(n, n__len) chdir((char*)n) +#define Platform_closefile(fd) close(fd) +#define Platform_err() errno +#define Platform_errc(c) write(1, &c, 1) +#define Platform_errstring(s, s__len) write(1, s, s__len-1) +#define Platform_exit(code) exit(code) +#define Platform_free(address) free((void*)(uintptr_t)address) +#define Platform_fstat(fd) fstat(fd, &s) +#define Platform_fsync(fd) fsync(fd) +#define Platform_ftruncate(fd, l) ftruncate(fd, l) +#define Platform_getcwd(cwd, cwd__len) getcwd((char*)cwd, cwd__len) +#define Platform_getenv(var, var__len) (Platform_EnvPtr)getenv((char*)var) +#define Platform_getpid() (INTEGER)getpid() +#define Platform_gettimeval() struct timeval tv; gettimeofday(&tv,0) +#define Platform_lseek(fd, o, w) lseek(fd, o, w) +#define Platform_nanosleep(s, ns) struct timespec req, rem; req.tv_sec = s; req.tv_nsec = ns; nanosleep(&req, &rem) +#define Platform_opennew(n, n__len) open((char*)n, O_CREAT | O_TRUNC | O_RDWR, 0664) +#define Platform_openro(n, n__len) open((char*)n, O_RDONLY) +#define Platform_openrw(n, n__len) open((char*)n, O_RDWR) +#define Platform_readfile(fd, p, l) read(fd, (void*)(uintptr_t)(p), l) +#define Platform_rename(o, o__len, n, n__len) rename((char*)o, (char*)n) +#define Platform_sectotm(s) struct tm *time = localtime((time_t*)&s) +#define Platform_seekcur() SEEK_CUR +#define Platform_seekend() SEEK_END +#define Platform_seekset() SEEK_SET +#define Platform_sethandler(s, h) SystemSetHandler(s, (uintptr_t)h) +#define Platform_stat(n, n__len) stat((char*)n, &s) +#define Platform_statdev() (LONGINT)s.st_dev +#define Platform_statino() (LONGINT)s.st_ino +#define Platform_statmtime() (LONGINT)s.st_mtime +#define Platform_statsize() (LONGINT)s.st_size +#define Platform_structstats() struct stat s +#define Platform_system(str, str__len) system((char*)str) +#define Platform_tmhour() (LONGINT)time->tm_hour +#define Platform_tmmday() (LONGINT)time->tm_mday +#define Platform_tmmin() (LONGINT)time->tm_min +#define Platform_tmmon() (LONGINT)time->tm_mon +#define Platform_tmsec() (LONGINT)time->tm_sec +#define Platform_tmyear() (LONGINT)time->tm_year +#define Platform_tvsec() tv.tv_sec +#define Platform_tvusec() tv.tv_usec +#define Platform_unlink(n, n__len) unlink((char*)n) +#define Platform_writefile(fd, p, l) write(fd, (void*)(uintptr_t)(p), l) + +BOOLEAN Platform_TooManyFiles (INTEGER e) +{ + BOOLEAN _o_result; + _o_result = e == Platform_EMFILE() || e == Platform_ENFILE(); + return _o_result; +} + +BOOLEAN Platform_NoSuchDirectory (INTEGER e) +{ + BOOLEAN _o_result; + _o_result = e == Platform_ENOENT(); + return _o_result; +} + +BOOLEAN Platform_DifferentFilesystems (INTEGER e) +{ + BOOLEAN _o_result; + _o_result = e == Platform_EXDEV(); + return _o_result; +} + +BOOLEAN Platform_Inaccessible (INTEGER e) +{ + BOOLEAN _o_result; + _o_result = (e == Platform_EACCES() || e == Platform_EROFS()) || e == Platform_EAGAIN(); + return _o_result; +} + +BOOLEAN Platform_Absent (INTEGER e) +{ + BOOLEAN _o_result; + _o_result = e == Platform_ENOENT(); + return _o_result; +} + +BOOLEAN Platform_TimedOut (INTEGER e) +{ + BOOLEAN _o_result; + _o_result = e == Platform_ETIMEDOUT(); + return _o_result; +} + +BOOLEAN Platform_ConnectionFailed (INTEGER e) +{ + BOOLEAN _o_result; + _o_result = ((e == Platform_ECONNREFUSED() || e == Platform_ECONNABORTED()) || e == Platform_ENETUNREACH()) || e == Platform_EHOSTUNREACH(); + return _o_result; +} + +LONGINT Platform_OSAllocate (LONGINT size) +{ + LONGINT _o_result; + _o_result = Platform_allocate(size); + return _o_result; +} + +void Platform_OSFree (LONGINT address) +{ + Platform_free(address); +} + +void Platform_Init (INTEGER argc, LONGINT argvadr) +{ + Platform_ArgVecPtr av = NIL; + Platform_MainStackFrame = argvadr; + Platform_ArgCount = argc; + av = (Platform_ArgVecPtr)(uintptr_t)argvadr; + Platform_ArgVector = (*av)[0]; + Platform_HaltCode = -128; + Platform_HeapInitHeap(); +} + +BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len) +{ + BOOLEAN _o_result; + Platform_EnvPtr p = NIL; + __DUP(var, var__len, CHAR); + p = Platform_getenv(var, var__len); + if (p != NIL) { + __COPY(*p, val, val__len); + } + _o_result = p != NIL; + __DEL(var); + return _o_result; +} + +void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len) +{ + __DUP(var, var__len, CHAR); + if (!Platform_getEnv(var, var__len, (void*)val, val__len)) { + val[0] = 0x00; + } + __DEL(var); +} + +void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len) +{ + Platform_ArgVec av = NIL; + if (n < Platform_ArgCount) { + av = (Platform_ArgVec)(uintptr_t)Platform_ArgVector; + __COPY(*(*av)[__X(n, ((LONGINT)(1024)))], val, val__len); + } +} + +void Platform_GetIntArg (INTEGER n, LONGINT *val) +{ + CHAR s[64]; + LONGINT k, d, i; + s[0] = 0x00; + Platform_GetArg(n, (void*)s, ((LONGINT)(64))); + i = 0; + if (s[0] == '-') { + i = 1; + } + k = 0; + d = (int)s[__X(i, ((LONGINT)(64)))] - 48; + while ((d >= 0 && d <= 9)) { + k = k * 10 + d; + i += 1; + d = (int)s[__X(i, ((LONGINT)(64)))] - 48; + } + if (s[0] == '-') { + k = -k; + i -= 1; + } + if (i > 0) { + *val = k; + } +} + +INTEGER Platform_ArgPos (CHAR *s, LONGINT s__len) +{ + INTEGER _o_result; + INTEGER i; + CHAR arg[256]; + __DUP(s, s__len, CHAR); + i = 0; + Platform_GetArg(i, (void*)arg, ((LONGINT)(256))); + while ((i < Platform_ArgCount && __STRCMP(s, arg) != 0)) { + i += 1; + Platform_GetArg(i, (void*)arg, ((LONGINT)(256))); + } + _o_result = i; + __DEL(s); + return _o_result; +} + +void Platform_SetInterruptHandler (Platform_SignalHandler handler) +{ + Platform_sethandler(2, handler); +} + +void Platform_SetQuitHandler (Platform_SignalHandler handler) +{ + Platform_sethandler(3, handler); +} + +void Platform_SetBadInstructionHandler (Platform_SignalHandler handler) +{ + Platform_sethandler(4, handler); +} + +static void Platform_YMDHMStoClock (LONGINT ye, LONGINT mo, LONGINT da, LONGINT ho, LONGINT mi, LONGINT se, LONGINT *t, LONGINT *d) +{ + *d = (__ASHL(__MOD(ye, 100), 9) + __ASHL(mo + 1, 5)) + da; + *t = (__ASHL(ho, 12) + __ASHL(mi, 6)) + se; +} + +void Platform_GetClock (LONGINT *t, LONGINT *d) +{ + Platform_gettimeval(); + Platform_sectotm(Platform_tvsec()); + Platform_YMDHMStoClock(Platform_tmyear(), Platform_tmmon(), Platform_tmmday(), Platform_tmhour(), Platform_tmmin(), Platform_tmsec(), &*t, &*d); +} + +void Platform_GetTimeOfDay (LONGINT *sec, LONGINT *usec) +{ + Platform_gettimeval(); + *sec = Platform_tvsec(); + *usec = Platform_tvusec(); +} + +LONGINT Platform_Time (void) +{ + LONGINT _o_result; + LONGINT ms; + Platform_gettimeval(); + ms = __DIVF(Platform_tvusec(), 1000) + Platform_tvsec() * 1000; + _o_result = __MOD(ms - Platform_TimeStart, 2147483647); + return _o_result; +} + +void Platform_Delay (LONGINT ms) +{ + LONGINT s, ns; + s = __DIV(ms, 1000); + ns = __MOD(ms, 1000) * 1000000; + Platform_nanosleep(s, ns); +} + +INTEGER Platform_System (CHAR *cmd, LONGINT cmd__len) +{ + INTEGER _o_result; + __DUP(cmd, cmd__len, CHAR); + _o_result = Platform_system(cmd, cmd__len); + __DEL(cmd); + return _o_result; +} + +INTEGER Platform_Error (void) +{ + INTEGER _o_result; + _o_result = Platform_err(); + return _o_result; +} + +INTEGER Platform_OldRO (CHAR *n, LONGINT n__len, LONGINT *h) +{ + INTEGER _o_result; + INTEGER fd; + fd = Platform_openro(n, n__len); + if (fd < 0) { + _o_result = Platform_err(); + return _o_result; + } else { + *h = fd; + _o_result = 0; + return _o_result; + } + __RETCHK; +} + +INTEGER Platform_OldRW (CHAR *n, LONGINT n__len, LONGINT *h) +{ + INTEGER _o_result; + INTEGER fd; + fd = Platform_openrw(n, n__len); + if (fd < 0) { + _o_result = Platform_err(); + return _o_result; + } else { + *h = fd; + _o_result = 0; + return _o_result; + } + __RETCHK; +} + +INTEGER Platform_New (CHAR *n, LONGINT n__len, LONGINT *h) +{ + INTEGER _o_result; + INTEGER fd; + fd = Platform_opennew(n, n__len); + if (fd < 0) { + _o_result = Platform_err(); + return _o_result; + } else { + *h = fd; + _o_result = 0; + return _o_result; + } + __RETCHK; +} + +INTEGER Platform_Close (LONGINT h) +{ + INTEGER _o_result; + if (Platform_closefile(h) < 0) { + _o_result = Platform_err(); + return _o_result; + } else { + _o_result = 0; + return _o_result; + } + __RETCHK; +} + +INTEGER Platform_Identify (LONGINT h, Platform_FileIdentity *identity, LONGINT *identity__typ) +{ + INTEGER _o_result; + Platform_structstats(); + if (Platform_fstat(h) < 0) { + _o_result = Platform_err(); + return _o_result; + } + (*identity).volume = Platform_statdev(); + (*identity).index = Platform_statino(); + (*identity).mtime = Platform_statmtime(); + _o_result = 0; + return _o_result; +} + +INTEGER Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ) +{ + INTEGER _o_result; + __DUP(n, n__len, CHAR); + Platform_structstats(); + if (Platform_stat(n, n__len) < 0) { + _o_result = Platform_err(); + __DEL(n); + return _o_result; + } + (*identity).volume = Platform_statdev(); + (*identity).index = Platform_statino(); + (*identity).mtime = Platform_statmtime(); + _o_result = 0; + __DEL(n); + return _o_result; +} + +BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2) +{ + BOOLEAN _o_result; + _o_result = (i1.index == i2.index && i1.volume == i2.volume); + return _o_result; +} + +BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2) +{ + BOOLEAN _o_result; + _o_result = i1.mtime == i2.mtime; + return _o_result; +} + +void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Platform_FileIdentity source) +{ + (*target).mtime = source.mtime; +} + +void Platform_MTimeAsClock (Platform_FileIdentity i, LONGINT *t, LONGINT *d) +{ + Platform_sectotm(i.mtime); + Platform_YMDHMStoClock(Platform_tmyear(), Platform_tmmon(), Platform_tmmday(), Platform_tmhour(), Platform_tmmin(), Platform_tmsec(), &*t, &*d); +} + +INTEGER Platform_Size (LONGINT h, LONGINT *l) +{ + INTEGER _o_result; + Platform_structstats(); + if (Platform_fstat(h) < 0) { + _o_result = Platform_err(); + return _o_result; + } + *l = Platform_statsize(); + _o_result = 0; + return _o_result; +} + +INTEGER Platform_Read (LONGINT h, LONGINT p, LONGINT l, LONGINT *n) +{ + INTEGER _o_result; + *n = Platform_readfile(h, p, l); + if (*n < 0) { + *n = 0; + _o_result = Platform_err(); + return _o_result; + } else { + _o_result = 0; + return _o_result; + } + __RETCHK; +} + +INTEGER Platform_ReadBuf (LONGINT h, SYSTEM_BYTE *b, LONGINT b__len, LONGINT *n) +{ + INTEGER _o_result; + *n = Platform_readfile(h, (LONGINT)(uintptr_t)b, b__len); + if (*n < 0) { + *n = 0; + _o_result = Platform_err(); + return _o_result; + } else { + _o_result = 0; + return _o_result; + } + __RETCHK; +} + +INTEGER Platform_Write (LONGINT h, LONGINT p, LONGINT l) +{ + INTEGER _o_result; + LONGINT written; + written = Platform_writefile(h, p, l); + if (written < 0) { + _o_result = Platform_err(); + return _o_result; + } else { + _o_result = 0; + return _o_result; + } + __RETCHK; +} + +INTEGER Platform_Sync (LONGINT h) +{ + INTEGER _o_result; + if (Platform_fsync(h) < 0) { + _o_result = Platform_err(); + return _o_result; + } else { + _o_result = 0; + return _o_result; + } + __RETCHK; +} + +INTEGER Platform_Seek (LONGINT h, LONGINT offset, INTEGER whence) +{ + INTEGER _o_result; + if (Platform_lseek(h, offset, whence) < 0) { + _o_result = Platform_err(); + return _o_result; + } else { + _o_result = 0; + return _o_result; + } + __RETCHK; +} + +INTEGER Platform_Truncate (LONGINT h, LONGINT l) +{ + INTEGER _o_result; + if (Platform_ftruncate(h, l) < 0) { + _o_result = Platform_err(); + return _o_result; + } else { + _o_result = 0; + return _o_result; + } + __RETCHK; +} + +INTEGER Platform_Unlink (CHAR *n, LONGINT n__len) +{ + INTEGER _o_result; + if (Platform_unlink(n, n__len) < 0) { + _o_result = Platform_err(); + return _o_result; + } else { + _o_result = 0; + return _o_result; + } + __RETCHK; +} + +INTEGER Platform_Chdir (CHAR *n, LONGINT n__len) +{ + INTEGER _o_result; + INTEGER r; + r = Platform_chdir(n, n__len); + Platform_getcwd((void*)Platform_CWD, ((LONGINT)(256))); + if (r < 0) { + _o_result = Platform_err(); + return _o_result; + } else { + _o_result = 0; + return _o_result; + } + __RETCHK; +} + +INTEGER Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) +{ + INTEGER _o_result; + if (Platform_rename(o, o__len, n, n__len) < 0) { + _o_result = Platform_err(); + return _o_result; + } else { + _o_result = 0; + return _o_result; + } + __RETCHK; +} + +void Platform_Exit (INTEGER code) +{ + Platform_exit(code); +} + +static void Platform_errch (CHAR c) +{ + Platform_errc(c); +} + +static void Platform_errln (void) +{ + Platform_errch(0x0d); + Platform_errch(0x0a); +} + +static void Platform_errposint (LONGINT l) +{ + if (l > 10) { + Platform_errposint(__DIV(l, 10)); + } + Platform_errch((CHAR)(48 + __MOD(l, 10))); +} + +static void Platform_errint (LONGINT l) +{ + if (l < 0) { + Platform_errch('-'); + l = -l; + } + Platform_errposint(l); +} + +static void Platform_DisplayHaltCode (LONGINT code) +{ + switch (code) { + case -1: + Platform_errstring((CHAR*)"Assertion failure.", (LONGINT)19); + break; + case -2: + Platform_errstring((CHAR*)"Index out of range.", (LONGINT)20); + break; + case -3: + Platform_errstring((CHAR*)"Reached end of function without reaching RETURN.", (LONGINT)49); + break; + case -4: + Platform_errstring((CHAR*)"CASE statement: no matching label and no ELSE.", (LONGINT)47); + break; + case -5: + Platform_errstring((CHAR*)"Type guard failed.", (LONGINT)19); + break; + case -6: + Platform_errstring((CHAR*)"Implicit type guard in record assignment failed.", (LONGINT)49); + break; + case -7: + Platform_errstring((CHAR*)"Invalid case in WITH statement.", (LONGINT)32); + break; + case -8: + Platform_errstring((CHAR*)"Value out of range.", (LONGINT)20); + break; + case -9: + Platform_errstring((CHAR*)"Heap interrupted while locked, but lockdepth = 0 at unlock.", (LONGINT)60); + break; + case -10: + Platform_errstring((CHAR*)"NIL access.", (LONGINT)12); + break; + case -11: + Platform_errstring((CHAR*)"Alignment error.", (LONGINT)17); + break; + case -12: + Platform_errstring((CHAR*)"Divide by zero.", (LONGINT)16); + break; + case -13: + Platform_errstring((CHAR*)"Arithmetic overflow/underflow.", (LONGINT)31); + break; + case -14: + Platform_errstring((CHAR*)"Invalid function argument.", (LONGINT)27); + break; + case -15: + Platform_errstring((CHAR*)"Internal error, e.g. Type descriptor size mismatch.", (LONGINT)52); + break; + case -20: + Platform_errstring((CHAR*)"Too many, or negative number of, elements in dynamic array.", (LONGINT)60); + break; + default: + break; + } +} + +void Platform_Halt (LONGINT code) +{ + INTEGER e; + Platform_HaltCode = code; + if (Platform_HaltHandler != NIL) { + (*Platform_HaltHandler)(code); + } + Platform_errstring((CHAR*)"Terminated by Halt(", (LONGINT)20); + Platform_errint(code); + Platform_errstring((CHAR*)"). ", (LONGINT)4); + if (code < 0) { + Platform_DisplayHaltCode(code); + } + Platform_errln(); + Platform_exit(__VAL(INTEGER, code)); +} + +void Platform_AssertFail (LONGINT code) +{ + INTEGER e; + Platform_errstring((CHAR*)"Assertion failure.", (LONGINT)19); + if (code != 0) { + Platform_errstring((CHAR*)" ASSERT code ", (LONGINT)14); + Platform_errint(code); + Platform_errstring((CHAR*)".", (LONGINT)2); + } + Platform_errln(); + Platform_exit(__VAL(INTEGER, code)); +} + +void Platform_SetHalt (Platform_HaltProcedure p) +{ + Platform_HaltHandler = p; +} + +static void Platform_TestLittleEndian (void) +{ + INTEGER i; + i = 1; + __GET((LONGINT)(uintptr_t)&i, Platform_LittleEndian, BOOLEAN); +} + +__TDESC(Platform_FileIdentity, 1, 0) = {__TDFLDS("FileIdentity", 24), {-8}}; + +export void *Platform__init(void) +{ + __DEFMOD; + __REGMOD("Platform", 0); + __INITYP(Platform_FileIdentity, Platform_FileIdentity, 0); +/* BEGIN */ + Platform_TestLittleEndian(); + Platform_HaltCode = -128; + Platform_HaltHandler = NIL; + Platform_TimeStart = Platform_Time(); + Platform_CWD[0] = 0x00; + Platform_getcwd((void*)Platform_CWD, ((LONGINT)(256))); + Platform_PID = Platform_getpid(); + Platform_SeekSet = Platform_seekset(); + Platform_SeekCur = Platform_seekcur(); + Platform_SeekEnd = Platform_seekend(); + Platform_nl[0] = 0x0a; + Platform_nl[1] = 0x00; + __ENDMOD; +} diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h new file mode 100644 index 00000000..7dca4035 --- /dev/null +++ b/bootstrap/unix-88/Platform.h @@ -0,0 +1,83 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ + +#ifndef Platform__h +#define Platform__h + +#define LARGE +#include "SYSTEM.h" + +typedef + struct Platform_FileIdentity { + LONGINT volume, index, mtime; + } Platform_FileIdentity; + +typedef + void (*Platform_HaltProcedure)(LONGINT); + +typedef + void (*Platform_SignalHandler)(INTEGER); + + +import BOOLEAN Platform_LittleEndian; +import LONGINT Platform_MainStackFrame, Platform_HaltCode; +import INTEGER Platform_PID; +import CHAR Platform_CWD[256]; +import INTEGER Platform_ArgCount; +import LONGINT Platform_ArgVector; +import INTEGER Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; +import CHAR Platform_nl[3]; + +import LONGINT *Platform_FileIdentity__typ; + +import BOOLEAN Platform_Absent (INTEGER e); +import INTEGER Platform_ArgPos (CHAR *s, LONGINT s__len); +import void Platform_AssertFail (LONGINT code); +import INTEGER Platform_Chdir (CHAR *n, LONGINT n__len); +import INTEGER Platform_Close (LONGINT h); +import BOOLEAN Platform_ConnectionFailed (INTEGER e); +import void Platform_Delay (LONGINT ms); +import BOOLEAN Platform_DifferentFilesystems (INTEGER e); +import INTEGER Platform_Error (void); +import void Platform_Exit (INTEGER code); +import void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len); +import void Platform_GetClock (LONGINT *t, LONGINT *d); +import void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); +import void Platform_GetIntArg (INTEGER n, LONGINT *val); +import void Platform_GetTimeOfDay (LONGINT *sec, LONGINT *usec); +import void Platform_Halt (LONGINT code); +import INTEGER Platform_Identify (LONGINT h, Platform_FileIdentity *identity, LONGINT *identity__typ); +import INTEGER Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); +import BOOLEAN Platform_Inaccessible (INTEGER e); +import void Platform_Init (INTEGER argc, LONGINT argvadr); +import void Platform_MTimeAsClock (Platform_FileIdentity i, LONGINT *t, LONGINT *d); +import INTEGER Platform_New (CHAR *n, LONGINT n__len, LONGINT *h); +import BOOLEAN Platform_NoSuchDirectory (INTEGER e); +import LONGINT Platform_OSAllocate (LONGINT size); +import void Platform_OSFree (LONGINT address); +import INTEGER Platform_OldRO (CHAR *n, LONGINT n__len, LONGINT *h); +import INTEGER Platform_OldRW (CHAR *n, LONGINT n__len, LONGINT *h); +import INTEGER Platform_Read (LONGINT h, LONGINT p, LONGINT l, LONGINT *n); +import INTEGER Platform_ReadBuf (LONGINT h, SYSTEM_BYTE *b, LONGINT b__len, LONGINT *n); +import INTEGER Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); +import BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); +import BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); +import INTEGER Platform_Seek (LONGINT h, LONGINT offset, INTEGER whence); +import void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); +import void Platform_SetHalt (Platform_HaltProcedure p); +import void Platform_SetInterruptHandler (Platform_SignalHandler handler); +import void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Platform_FileIdentity source); +import void Platform_SetQuitHandler (Platform_SignalHandler handler); +import INTEGER Platform_Size (LONGINT h, LONGINT *l); +import INTEGER Platform_Sync (LONGINT h); +import INTEGER Platform_System (CHAR *cmd, LONGINT cmd__len); +import LONGINT Platform_Time (void); +import BOOLEAN Platform_TimedOut (INTEGER e); +import BOOLEAN Platform_TooManyFiles (INTEGER e); +import INTEGER Platform_Truncate (LONGINT h, LONGINT l); +import INTEGER Platform_Unlink (CHAR *n, LONGINT n__len); +import INTEGER Platform_Write (LONGINT h, LONGINT p, LONGINT l); +import BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); +import void *Platform__init(void); + + +#endif diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c new file mode 100644 index 00000000..edf27d40 --- /dev/null +++ b/bootstrap/unix-88/Reals.c @@ -0,0 +1,143 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +#define LARGE +#include "SYSTEM.h" + + + + +export void Reals_Convert (REAL x, INTEGER n, CHAR *d, LONGINT d__len); +export void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len); +export void Reals_ConvertHL (LONGREAL y, CHAR *d, LONGINT d__len); +export void Reals_ConvertL (LONGREAL x, INTEGER n, CHAR *d, LONGINT d__len); +export INTEGER Reals_Expo (REAL x); +export INTEGER Reals_ExpoL (LONGREAL x); +export REAL Reals_Ten (INTEGER e); +export LONGREAL Reals_TenL (INTEGER e); +static CHAR Reals_ToHex (INTEGER i); + + +REAL Reals_Ten (INTEGER e) +{ + REAL _o_result; + LONGREAL r, power; + r = (LONGREAL)1; + power = (LONGREAL)10; + while (e > 0) { + if (__ODD(e)) { + r = r * power; + } + power = power * power; + e = __ASHR(e, 1); + } + _o_result = r; + return _o_result; +} + +LONGREAL Reals_TenL (INTEGER e) +{ + LONGREAL _o_result; + LONGREAL r, power; + r = (LONGREAL)1; + power = (LONGREAL)10; + for (;;) { + if (__ODD(e)) { + r = r * power; + } + e = __ASHR(e, 1); + if (e <= 0) { + _o_result = r; + return _o_result; + } + power = power * power; + } + __RETCHK; +} + +INTEGER Reals_Expo (REAL x) +{ + INTEGER _o_result; + _o_result = (int)__MASK(__ASHR((LONGINT)(__VAL(INTEGER, x)), 23), -256); + return _o_result; +} + +INTEGER Reals_ExpoL (LONGREAL x) +{ + INTEGER _o_result; + INTEGER i; + LONGINT l; + __GET((LONGINT)(uintptr_t)&x + 4, i, INTEGER); + _o_result = (int)__MASK(__ASHR((LONGINT)i, 20), -2048); + return _o_result; +} + +void Reals_ConvertL (LONGREAL x, INTEGER n, CHAR *d, LONGINT d__len) +{ + LONGINT i, j, k; + if (x < (LONGREAL)0) { + x = -x; + } + k = 0; + i = __ENTIER(x); + while (k < (LONGINT)n) { + d[__X(k, d__len)] = (CHAR)(__MOD(i, 10) + 48); + i = __DIV(i, 10); + k += 1; + } +} + +void Reals_Convert (REAL x, INTEGER n, CHAR *d, LONGINT d__len) +{ + Reals_ConvertL(x, n, (void*)d, d__len); +} + +static CHAR Reals_ToHex (INTEGER i) +{ + CHAR _o_result; + if (i < 10) { + _o_result = (CHAR)(i + 48); + return _o_result; + } else { + _o_result = (CHAR)(i + 55); + return _o_result; + } + __RETCHK; +} + +typedef + CHAR (*pc4__3)[4]; + +void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len) +{ + pc4__3 p = NIL; + INTEGER i; + p = (pc4__3)(uintptr_t)((LONGINT)(uintptr_t)&y); + i = 0; + while (i < 4) { + d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((int)(*p)[__X(i, ((LONGINT)(4)))], 4)); + d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((int)(*p)[__X(i, ((LONGINT)(4)))], -16)); + } +} + +typedef + CHAR (*pc8__5)[8]; + +void Reals_ConvertHL (LONGREAL y, CHAR *d, LONGINT d__len) +{ + pc8__5 p = NIL; + INTEGER i; + p = (pc8__5)(uintptr_t)((LONGINT)(uintptr_t)&y); + i = 0; + while (i < 8) { + d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((int)(*p)[__X(i, ((LONGINT)(8)))], 4)); + d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((int)(*p)[__X(i, ((LONGINT)(8)))], -16)); + } +} + + +export void *Reals__init(void) +{ + __DEFMOD; + __REGMOD("Reals", 0); +/* BEGIN */ + __ENDMOD; +} diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h new file mode 100644 index 00000000..5febc0f1 --- /dev/null +++ b/bootstrap/unix-88/Reals.h @@ -0,0 +1,23 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ + +#ifndef Reals__h +#define Reals__h + +#define LARGE +#include "SYSTEM.h" + + + + +import void Reals_Convert (REAL x, INTEGER n, CHAR *d, LONGINT d__len); +import void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len); +import void Reals_ConvertHL (LONGREAL y, CHAR *d, LONGINT d__len); +import void Reals_ConvertL (LONGREAL x, INTEGER n, CHAR *d, LONGINT d__len); +import INTEGER Reals_Expo (REAL x); +import INTEGER Reals_ExpoL (LONGREAL x); +import REAL Reals_Ten (INTEGER e); +import LONGREAL Reals_TenL (INTEGER e); +import void *Reals__init(void); + + +#endif diff --git a/bootstrap/unix-88/SYSTEM.c b/bootstrap/unix-88/SYSTEM.c new file mode 100644 index 00000000..0fcc5ee2 --- /dev/null +++ b/bootstrap/unix-88/SYSTEM.c @@ -0,0 +1,207 @@ +/* +* The body prefix file of the voc(jet backend) runtime system, Version 1.0 +* +* Copyright (c) Software Templ, 1994, 1995 +* +* Module SYSTEM is subject to change any time without prior notification. +* Software Templ disclaims all warranties with regard to module SYSTEM, +* in particular shall Software Templ not be liable for any damage resulting +* from inappropriate use or modification of module SYSTEM. +* +* Version 1.1 jt, 24.11.95 fixes for correct pointer arithmetic on Cray computers +* jt 31.1.2007 ANSI prototypes for malloc and exit in order to avoid cc warnings +* +*/ + +#include "SYSTEM.h" +#include "stdarg.h" +#include + + +LONGINT SYSTEM_XCHK(LONGINT i, LONGINT ub) {return __X(i, ub);} +LONGINT SYSTEM_RCHK(LONGINT i, LONGINT ub) {return __R(i, ub);} +LONGINT SYSTEM_ASH (LONGINT i, LONGINT n) {return __ASH(i, n);} +LONGINT SYSTEM_ABS (LONGINT i) {return __ABS(i);} +double SYSTEM_ABSD(double i) {return __ABS(i);} + +void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0) +{ + t -= __TPROC0OFF; + t0 -= __TPROC0OFF; + while (*t0 != __EOM) {*t = *t0; t--; t0--;} +} + + +void SYSTEM_ENUMP(void *adr, LONGINT n, void (*P)()) +{ + while (n > 0) { + P((LONGINT)(uintptr_t)(*((void**)(adr)))); + adr = ((void**)adr) + 1; + n--; + } +} + +void SYSTEM_ENUMR(void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()) +{ + LONGINT *t, off; + typ++; + while (n > 0) { + t = typ; + off = *t; + while (off >= 0) {P(*(LONGINT*)((char*)adr+off)); t++; off = *t;} + adr = ((char*)adr) + size; + n--; + } +} + +LONGINT SYSTEM_DIV(unsigned LONGINT x, unsigned LONGINT y) +{ if ((LONGINT) x >= 0) return (x / y); + else return -((y - 1 - x) / y); +} + +LONGINT SYSTEM_MOD(unsigned LONGINT x, unsigned LONGINT y) +{ unsigned LONGINT m; + if ((LONGINT) x >= 0) return (x % y); + else { m = (-x) % y; + if (m != 0) return (y - m); else return 0; + } +} + +LONGINT SYSTEM_ENTIER(double x) +{ + LONGINT y; + if (x >= 0) + return (LONGINT)x; + else { + y = (LONGINT)x; + if (y <= x) return y; else return y - 1; + } +} + +extern void Heap_Lock(); +extern void Heap_Unlock(); + +SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, int nofdyn, ...) +{ + LONGINT nofelems, size, dataoff, n, nptr, *x, *p, nofptrs, i, *ptab, off; + va_list ap; + va_start(ap, nofdyn); + nofelems = 1; + while (nofdim > 0) { + nofelems = nofelems * va_arg(ap, LONGINT); nofdim--; + if (nofelems <= 0) __HALT(-20); + } + va_end(ap); + dataoff = nofdyn * sizeof(LONGINT); + if (elemalgn > sizeof(LONGINT)) { + n = dataoff % elemalgn; + if (n != 0) dataoff += elemalgn - n; + } + size = dataoff + nofelems * elemsz; + Heap_Lock(); + if (typ == NIL) { + /* element typ does not contain pointers */ + x = Heap_NEWBLK(size); + } + else if (typ == (LONGINT*)POINTER__typ) { + /* element type is a pointer */ + x = Heap_NEWBLK(size + nofelems * sizeof(LONGINT)); + p = (LONGINT*)(uintptr_t)x[-1]; + p[-nofelems] = *p; /* build new type desc in situ: 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ + p -= nofelems - 1; n = 1; /* n =1 for skipping the size field */ + while (n <= nofelems) {*p = n*sizeof(LONGINT); p++; n++;} + *p = - (nofelems + 1) * sizeof(LONGINT); /* sentinel */ + x[-1] -= nofelems * sizeof(LONGINT); + } + else { + /* element type is a record that contains pointers */ + ptab = typ + 1; nofptrs = 0; + while (ptab[nofptrs] >= 0) {nofptrs++;} /* number of pointers per element */ + nptr = nofelems * nofptrs; /* total number of pointers */ + x = Heap_NEWBLK(size + nptr * sizeof(LONGINT)); + p = (LONGINT*)(uintptr_t)x[- 1]; + p[-nptr] = *p; /* build new type desc in situ; 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ + p -= nptr - 1; n = 0; off = dataoff; + while (n < nofelems) {i = 0; + while (i < nofptrs) {*p = off + ptab[i]; p++; i++;} + off += elemsz; n++; + } + *p = - (nptr + 1) * sizeof(LONGINT); /* sentinel */ + x[-1] -= nptr * sizeof(LONGINT); + } + if (nofdyn != 0) { + /* setup len vector for index checks */ + va_start(ap, nofdyn); + p = x; + while (nofdyn > 0) {*p = va_arg(ap, LONGINT); p++, nofdyn--;} + va_end(ap); + } + Heap_Unlock(); + return x; +} + + + + +typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler + +#ifndef _WIN32 + + SystemSignalHandler handler[3] = {0}; + + // Provide signal handling for Unix based systems + void signalHandler(int s) { + if (s >= 2 && s <= 4) handler[s-2](s); + // (Ignore other signals) + } + + void SystemSetHandler(int s, uintptr_t h) { + if (s >= 2 && s <= 4) { + int needtosetsystemhandler = handler[s-2] == 0; + handler[s-2] = (SystemSignalHandler)h; + if (needtosetsystemhandler) {signal(s, signalHandler);} + } + } + +#else + + // Provides Windows callback handlers for signal-like scenarios + #include "WindowsWrapper.h" + + SystemSignalHandler SystemInterruptHandler = 0; + SystemSignalHandler SystemQuitHandler = 0; + BOOL ConsoleCtrlHandlerSet = FALSE; + + BOOL WINAPI SystemConsoleCtrlHandler(DWORD ctrlType) { + if ((ctrlType == CTRL_C_EVENT) || (ctrlType == CTRL_BREAK_EVENT)) { + if (SystemInterruptHandler) { + SystemInterruptHandler(2); // SIGINT + return TRUE; + } + } else { // Close, logoff or shutdown + if (SystemQuitHandler) { + SystemQuitHandler(3); // SIGQUIT + return TRUE; + } + } + return FALSE; + } + + void EnsureConsoleCtrlHandler() { + if (!ConsoleCtrlHandlerSet) { + SetConsoleCtrlHandler(SystemConsoleCtrlHandler, TRUE); + ConsoleCtrlHandlerSet = TRUE; + } + } + + void SystemSetInterruptHandler(uintptr_t h) { + EnsureConsoleCtrlHandler(); + SystemInterruptHandler = (SystemSignalHandler)h; + } + + void SystemSetQuitHandler(uintptr_t h) { + EnsureConsoleCtrlHandler(); + SystemQuitHandler = (SystemSignalHandler)h; + } + +#endif diff --git a/bootstrap/unix-88/SYSTEM.h b/bootstrap/unix-88/SYSTEM.h new file mode 100644 index 00000000..f9e2f930 --- /dev/null +++ b/bootstrap/unix-88/SYSTEM.h @@ -0,0 +1,275 @@ +#ifndef SYSTEM__h +#define SYSTEM__h + +#ifndef _WIN32 + + // Building for a Unix/Linux based system + #include // For memcpy ... + #include // For uintptr_t ... + +#else + + // Building for Windows platform with either mingw under cygwin, or the MS C compiler + #ifdef _WIN64 + typedef unsigned long long size_t; + typedef unsigned long long uintptr_t; + #else + typedef unsigned int size_t; + typedef unsigned int uintptr_t; + #endif /* _WIN64 */ + + typedef unsigned int uint32_t; + void * __cdecl memcpy(void * dest, const void * source, size_t size); + +#endif + + +// The compiler uses 'import' and 'export' which translate to 'extern' and +// nothing respectively. + +#define import extern +#define export + + + +// Known constants + +#define NIL ((void*)0) +#define __MAXEXT 16 +#define POINTER__typ ((LONGINT*)(1)) // not NIL and not a valid type + + +// Oberon types + +#define BOOLEAN char +#define SYSTEM_BYTE unsigned char +#define CHAR unsigned char +#define SHORTINT signed char +#define REAL float +#define LONGREAL double +#define SYSTEM_PTR void* + +// For 32 bit builds, the size of LONGINT depends on a make option: + +#if (__SIZEOF_POINTER__ == 8) || defined(LARGE) || defined(_WIN64) + #define INTEGER int // INTEGER is 32 bit. + #define LONGINT long long // LONGINT is 64 bit. (long long is always 64 bits, while long can be 32 bits e.g. under MSC/MingW) +#else + #define INTEGER short int // INTEGER is 16 bit. + #define LONGINT long // LONGINT is 32 bit. +#endif + +#define SET unsigned LONGINT + + +// OS Memory allocation interfaces are in PlatformXXX.Mod + +extern LONGINT Platform_OSAllocate (LONGINT size); +extern void Platform_OSFree (LONGINT addr); + + +// Run time system routines in SYSTEM.c + +extern LONGINT SYSTEM_XCHK (LONGINT i, LONGINT ub); +extern LONGINT SYSTEM_RCHK (LONGINT i, LONGINT ub); +extern LONGINT SYSTEM_ASH (LONGINT i, LONGINT n); +extern LONGINT SYSTEM_ABS (LONGINT i); +extern double SYSTEM_ABSD (double i); +extern void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0); +extern void SYSTEM_ENUMP (void *adr, LONGINT n, void (*P)()); +extern void SYSTEM_ENUMR (void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()); +extern LONGINT SYSTEM_DIV (unsigned LONGINT x, unsigned LONGINT y); +extern LONGINT SYSTEM_MOD (unsigned LONGINT x, unsigned LONGINT y); +extern LONGINT SYSTEM_ENTIER (double x); + + +// Signal handling in SYSTEM.c + +#ifndef _WIN32 + extern void SystemSetHandler(int s, uintptr_t h); +#else + extern void SystemSetInterruptHandler(uintptr_t h); + extern void SystemSetQuitHandler (uintptr_t h); +#endif + + + +// String comparison + +static int __str_cmp(CHAR *x, CHAR *y){ + LONGINT i = 0; + CHAR ch1, ch2; + do {ch1 = x[i]; ch2 = y[i]; i++; + if (!ch1) return -(int)ch2; + } while (ch1==ch2); + return (int)ch1 - (int)ch2; +} +#define __STRCMP(a,b) __str_cmp((CHAR*)(a), (CHAR*)(b)) + + + +// Inline string, record and array copy + +#define __COPY(s, d, n) {char*_a=(void*)s,*_b=(void*)d; LONGINT _i=0,_t=n-1; \ + while(_i<_t&&((_b[_i]=_a[_i])!=0)){_i++;};_b[_i]=0;} +#define __DUP(x, l, t) x=(void*)memcpy((void*)(uintptr_t)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) +#define __DUPARR(v, t) v=(void*)memcpy(v##__copy,v,sizeof(t)) +#define __DEL(x) Platform_OSFree((LONGINT)(uintptr_t)x) + + + + +/* SYSTEM ops */ + +#define __VAL(t, x) ((t)(x)) +#define __VALP(t, x) ((t)(uintptr_t)(x)) + +#define __GET(a, x, t) x= *(t*)(uintptr_t)(a) +#define __PUT(a, x, t) *(t*)(uintptr_t)(a)=x +#define __LSHL(x, n, t) ((t)((unsigned t)(x)<<(n))) +#define __LSHR(x, n, t) ((t)((unsigned t)(x)>>(n))) +#define __LSH(x, n, t) ((n)>=0? __LSHL(x, n, t): __LSHR(x, -(n), t)) +#define __ROTL(x, n, t) ((t)((unsigned t)(x)<<(n)|(unsigned t)(x)>>(8*sizeof(t)-(n)))) +#define __ROTR(x, n, t) ((t)((unsigned t)(x)>>(n)|(unsigned t)(x)<<(8*sizeof(t)-(n)))) +#define __LSHR(x, n, t) ((t)((unsigned t)(x)>>(n))) +#define __LSH(x, n, t) ((n)>=0? __LSHL(x, n, t): __LSHR(x, -(n), t)) +#define __ROTL(x, n, t) ((t)((unsigned t)(x)<<(n)|(unsigned t)(x)>>(8*sizeof(t)-(n)))) +#define __ROTR(x, n, t) ((t)((unsigned t)(x)>>(n)|(unsigned t)(x)<<(8*sizeof(t)-(n)))) +#define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) +#define __BIT(x, n) (*(unsigned LONGINT*)(x)>>(n)&1) +#define __MOVE(s, d, n) memcpy((char*)(uintptr_t)(d),(char*)(uintptr_t)(s),n) +#define __ASHL(x, n) ((LONGINT)(x)<<(n)) +#define __ASHR(x, n) ((LONGINT)(x)>>(n)) +#define __ASH(x, n) ((n)>=0?__ASHL(x,n):__ASHR(x,-(n))) +#define __ASHF(x, n) SYSTEM_ASH((LONGINT)(x), (LONGINT)(n)) +#define __SHORT(x, y) ((int)((unsigned LONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) +#define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) +#define __CHR(x) ((CHAR)__R(x, 256)) +#define __CHRF(x) ((CHAR)__RF(x, 256)) +#define __DIV(x, y) ((x)>=0?(x)/(y):-(((y)-1-(x))/(y))) +#define __DIVF(x, y) SYSTEM_DIV((LONGINT)(x),(LONGINT)(y)) +#define __MOD(x, y) ((x)>=0?(x)%(y):__MODF(x,y)) +#define __MODF(x, y) SYSTEM_MOD((LONGINT)(x),(LONGINT)(y)) +#define __ENTIER(x) SYSTEM_ENTIER(x) +#define __ABS(x) (((x)<0)?-(x):(x)) +#define __ABSF(x) SYSTEM_ABS((LONGINT)(x)) +#define __ABSFD(x) SYSTEM_ABSD((double)(x)) +#define __CAP(ch) ((CHAR)((ch)&0x5f)) +#define __ODD(x) ((x)&1) +#define __IN(x, s) (((s)>>(x))&1) +#define __SETOF(x) ((SET)1<<(x)) +#define __SETRNG(l, h) ((~(SET)0<<(l))&~(SET)0>>(8*sizeof(SET)-1-(h))) +#define __MASK(x, m) ((x)&~(m)) + + + +// Runtime checks + +#define __X(i, ub) (((unsigned LONGINT)(i)<(unsigned LONGINT)(ub))?i:(__HALT(-2),0)) +#define __XF(i, ub) SYSTEM_XCHK((LONGINT)(i), (LONGINT)(ub)) +#define __R(i, ub) (((unsigned LONGINT)(i)<(unsigned LONGINT)(ub))?i:(__HALT(-8),0)) +#define __RF(i, ub) SYSTEM_RCHK((LONGINT)(i),(LONGINT)(ub)) +#define __RETCHK __retchk: __HALT(-3); return 0; +#define __CASECHK __HALT(-4) +#define __WITHCHK __HALT(-7) + +#define __GUARDP(p, typ, level) ((typ*)(__ISP(p,typ,level)?p:(__HALT(-5),p))) +#define __GUARDR(r, typ, level) (*((typ*)(__IS(r##__typ,typ,level)?r:(__HALT(-5),r)))) +#define __GUARDA(p, typ, level) ((struct typ*)(__IS(__TYPEOF(p),typ,level)?p:(__HALT(-5),p))) +#define __GUARDEQR(p, dyntyp, typ) if(dyntyp!=typ##__typ) __HALT(-6);*(p) +#define __GUARDEQP(p, typ) if(__TYPEOF(p)!=typ##__typ)__HALT(-6);*(p) + + + +// Module entry/registration/exit + +extern void Heap_REGCMD(); +extern SYSTEM_PTR Heap_REGMOD(); +extern void Heap_REGTYP(); +extern void Heap_INCREF(); + +#define __DEFMOD static void *m; if (m!=0) {return m;} +#define __REGCMD(name, cmd) Heap_REGCMD(m, (CHAR*)name, cmd) +#define __REGMOD(name, enum) if (m==0) {m = Heap_REGMOD((CHAR*)name,enum);} +#define __ENDMOD return m +#define __MODULE_IMPORT(name) Heap_INCREF(name##__init()) + + + +// Main module initialisation, registration and finalisation + +extern void Platform_Init(INTEGER argc, LONGINT argv); +extern void *Platform_MainModule; +extern void Heap_FINALL(); + +#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (LONGINT)(uintptr_t)&argv); +#define __REGMAIN(name, enum) m = Heap_REGMOD((CHAR*)name,enum) +#define __FINI Heap_FINALL(); return 0 + + +// Assertions and Halts + +extern void Platform_Halt(LONGINT x); +extern void Platform_AssertFail(LONGINT x); + +#define __HALT(x) Platform_Halt(x) +#define __ASSERT(cond, x) if (!(cond)) Platform_AssertFail((LONGINT)(x)) + + +// Memory allocation + +extern SYSTEM_PTR Heap_NEWBLK (LONGINT size); +extern SYSTEM_PTR Heap_NEWREC (LONGINT tag); +extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); + +#define __SYSNEW(p, len) p = Heap_NEWBLK((LONGINT)(len)) +#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(uintptr_t)t##__typ) +#define __NEWARR SYSTEM_NEWARR + + + +/* Type handling */ + +#define __TDESC(t, m, n) \ + static struct t##__desc { \ + LONGINT tproc[m]; /* Proc for each ptr field */ \ + LONGINT tag; \ + LONGINT next; /* Module table type list points here */ \ + LONGINT level; \ + LONGINT module; \ + char name[24]; \ + LONGINT basep[__MAXEXT]; /* List of bases this extends */ \ + LONGINT reserved; \ + LONGINT blksz; /* xxx_typ points here */ \ + LONGINT ptr[n+1]; /* Offsets of ptrs up to -ve sentinel */ \ + } t##__desc + +#define __BASEOFF (__MAXEXT+1) // blksz as index to base. +#define __TPROC0OFF (__BASEOFF+24/sizeof(LONGINT)+5) // blksz as index to tproc IFF m=1. +#define __EOM 1 +#define __TDFLDS(name, size) {__EOM}, 1, 0, 0, 0, name, {0}, 0, size +#define __ENUMP(adr, n, P) SYSTEM_ENUMP(adr, (LONGINT)(n), P) +#define __ENUMR(adr, typ, size, n, P) SYSTEM_ENUMR(adr, typ, (LONGINT)(size), (LONGINT)(n), P) + +#define __INITYP(t, t0, level) \ + t##__typ = (LONGINT*)&t##__desc.blksz; \ + memcpy(t##__desc.basep, t0##__typ - __BASEOFF, level*sizeof(LONGINT)); \ + t##__desc.basep[level] = (LONGINT)(uintptr_t)t##__typ; \ + t##__desc.module = (LONGINT)(uintptr_t)m; \ + if(t##__desc.blksz!=sizeof(struct t)) __HALT(-15); \ + t##__desc.blksz = (t##__desc.blksz+5*sizeof(LONGINT)-1)/(4*sizeof(LONGINT))*(4*sizeof(LONGINT)); \ + Heap_REGTYP(m, (LONGINT)(uintptr_t)&t##__desc.next); \ + SYSTEM_INHERIT(t##__typ, t0##__typ) + +#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(uintptr_t)typ##__typ) +#define __TYPEOF(p) ((LONGINT*)(uintptr_t)(*(((LONGINT*)(p))-1))) +#define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) + +// Oberon-2 type bound procedures support +#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(uintptr_t)proc +#define __SEND(typ, num, funtyp, parlist) ((funtyp)((uintptr_t)*(typ-(__TPROC0OFF+num))))parlist + + + + +#endif diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c new file mode 100644 index 00000000..98eef9eb --- /dev/null +++ b/bootstrap/unix-88/Strings.c @@ -0,0 +1,244 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +#define LARGE +#include "SYSTEM.h" + + + + +export void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len); +export void Strings_Cap (CHAR *s, LONGINT s__len); +export void Strings_Delete (CHAR *s, LONGINT s__len, INTEGER pos, INTEGER n); +export void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n, CHAR *dest, LONGINT dest__len); +export void Strings_Insert (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, LONGINT dest__len); +export INTEGER Strings_Length (CHAR *s, LONGINT s__len); +export BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len); +export INTEGER Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, INTEGER pos); +export void Strings_Replace (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, LONGINT dest__len); + + +INTEGER Strings_Length (CHAR *s, LONGINT s__len) +{ + INTEGER _o_result; + INTEGER i; + __DUP(s, s__len, CHAR); + i = 0; + while (((LONGINT)i < s__len && s[__X(i, s__len)] != 0x00)) { + i += 1; + } + _o_result = i; + __DEL(s); + return _o_result; +} + +void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len) +{ + INTEGER n1, n2, i; + __DUP(extra, extra__len, CHAR); + n1 = Strings_Length(dest, dest__len); + n2 = Strings_Length(extra, extra__len); + i = 0; + while ((i < n2 && (LONGINT)(i + n1) < dest__len)) { + dest[__X(i + n1, dest__len)] = extra[__X(i, extra__len)]; + i += 1; + } + if ((LONGINT)(i + n1) < dest__len) { + dest[__X(i + n1, dest__len)] = 0x00; + } + __DEL(extra); +} + +void Strings_Insert (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, LONGINT dest__len) +{ + INTEGER n1, n2, i; + __DUP(source, source__len, CHAR); + n1 = Strings_Length(dest, dest__len); + n2 = Strings_Length(source, source__len); + if (pos < 0) { + pos = 0; + } + if (pos > n1) { + Strings_Append(dest, dest__len, (void*)source, source__len); + return; + } + if ((LONGINT)(pos + n2) < dest__len) { + i = n1; + while (i >= pos) { + if ((LONGINT)(i + n2) < dest__len) { + dest[__X(i + n2, dest__len)] = dest[__X(i, dest__len)]; + } + i -= 1; + } + } + i = 0; + while (i < n2) { + dest[__X(pos + i, dest__len)] = source[__X(i, source__len)]; + i += 1; + } + __DEL(source); +} + +void Strings_Delete (CHAR *s, LONGINT s__len, INTEGER pos, INTEGER n) +{ + INTEGER len, i; + len = Strings_Length(s, s__len); + if (pos < 0) { + pos = 0; + } else if (pos >= len) { + return; + } + if (pos + n < len) { + i = pos + n; + while (i < len) { + s[__X(i - n, s__len)] = s[__X(i, s__len)]; + i += 1; + } + if ((LONGINT)(i - n) < s__len) { + s[__X(i - n, s__len)] = 0x00; + } + } else { + s[__X(pos, s__len)] = 0x00; + } +} + +void Strings_Replace (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, LONGINT dest__len) +{ + __DUP(source, source__len, CHAR); + Strings_Delete((void*)dest, dest__len, pos, pos + Strings_Length(source, source__len)); + Strings_Insert(source, source__len, pos, (void*)dest, dest__len); + __DEL(source); +} + +void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n, CHAR *dest, LONGINT dest__len) +{ + INTEGER len, destLen, i; + __DUP(source, source__len, CHAR); + len = Strings_Length(source, source__len); + destLen = (int)dest__len - 1; + if (pos < 0) { + pos = 0; + } + if (pos >= len) { + dest[0] = 0x00; + return; + } + i = 0; + while (((((LONGINT)(pos + i) <= source__len && source[__X(pos + i, source__len)] != 0x00)) && i < n)) { + if (i < destLen) { + dest[__X(i, dest__len)] = source[__X(pos + i, source__len)]; + } + i += 1; + } + dest[__X(i, dest__len)] = 0x00; + __DEL(source); +} + +INTEGER Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, INTEGER pos) +{ + INTEGER _o_result; + INTEGER n1, n2, i, j; + __DUP(pattern, pattern__len, CHAR); + __DUP(s, s__len, CHAR); + n1 = Strings_Length(s, s__len); + n2 = Strings_Length(pattern, pattern__len); + if (n2 == 0) { + _o_result = 0; + __DEL(pattern); + __DEL(s); + return _o_result; + } + i = pos; + while (i <= n1 - n2) { + if (s[__X(i, s__len)] == pattern[0]) { + j = 1; + while ((j < n2 && s[__X(i + j, s__len)] == pattern[__X(j, pattern__len)])) { + j += 1; + } + if (j == n2) { + _o_result = i; + __DEL(pattern); + __DEL(s); + return _o_result; + } + } + i += 1; + } + _o_result = -1; + __DEL(pattern); + __DEL(s); + return _o_result; +} + +void Strings_Cap (CHAR *s, LONGINT s__len) +{ + INTEGER i; + i = 0; + while (s[__X(i, s__len)] != 0x00) { + if (('a' <= s[__X(i, s__len)] && s[__X(i, s__len)] <= 'z')) { + s[__X(i, s__len)] = __CAP(s[__X(i, s__len)]); + } + i += 1; + } +} + +static struct Match__7 { + struct Match__7 *lnk; +} *Match__7_s; + +static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, INTEGER n, INTEGER m); + +static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, INTEGER n, INTEGER m) +{ + BOOLEAN _o_result; + while ((((n >= 0 && m >= 0)) && mask[__X(m, mask__len)] != '*')) { + if (name[__X(n, name__len)] != mask[__X(m, mask__len)]) { + _o_result = 0; + return _o_result; + } + n -= 1; + m -= 1; + } + if (m < 0) { + _o_result = n < 0; + return _o_result; + } + while ((m >= 0 && mask[__X(m, mask__len)] == '*')) { + m -= 1; + } + if (m < 0) { + _o_result = 1; + return _o_result; + } + while (n >= 0) { + if (M__8(name, name__len, mask, mask__len, n, m)) { + _o_result = 1; + return _o_result; + } + n -= 1; + } + _o_result = 0; + return _o_result; +} + +BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len) +{ + BOOLEAN _o_result; + struct Match__7 _s; + __DUP(string, string__len, CHAR); + __DUP(pattern, pattern__len, CHAR); + _s.lnk = Match__7_s; + Match__7_s = &_s; + _o_result = M__8((void*)string, string__len, (void*)pattern, pattern__len, Strings_Length(string, string__len) - 1, Strings_Length(pattern, pattern__len) - 1); + Match__7_s = _s.lnk; + __DEL(string); + __DEL(pattern); + return _o_result; +} + + +export void *Strings__init(void) +{ + __DEFMOD; + __REGMOD("Strings", 0); +/* BEGIN */ + __ENDMOD; +} diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h new file mode 100644 index 00000000..05e86973 --- /dev/null +++ b/bootstrap/unix-88/Strings.h @@ -0,0 +1,24 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ + +#ifndef Strings__h +#define Strings__h + +#define LARGE +#include "SYSTEM.h" + + + + +import void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len); +import void Strings_Cap (CHAR *s, LONGINT s__len); +import void Strings_Delete (CHAR *s, LONGINT s__len, INTEGER pos, INTEGER n); +import void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n, CHAR *dest, LONGINT dest__len); +import void Strings_Insert (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, LONGINT dest__len); +import INTEGER Strings_Length (CHAR *s, LONGINT s__len); +import BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len); +import INTEGER Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, INTEGER pos); +import void Strings_Replace (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, LONGINT dest__len); +import void *Strings__init(void); + + +#endif diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c new file mode 100644 index 00000000..307bec01 --- /dev/null +++ b/bootstrap/unix-88/Texts.c @@ -0,0 +1,1839 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +#define LARGE +#include "SYSTEM.h" +#include "Files.h" +#include "Modules.h" +#include "Reals.h" + +typedef + struct Texts_RunDesc *Texts_Run; + +typedef + struct Texts_FontDesc *Texts_FontsFont; + +typedef + struct Texts_RunDesc { + Texts_Run prev, next; + LONGINT len; + Texts_FontsFont fnt; + SHORTINT col, voff; + BOOLEAN ascii; + } Texts_RunDesc; + +typedef + struct Texts_ElemDesc *Texts_Elem; + +typedef + struct Texts_ElemMsg { + char _prvt0[1]; + } Texts_ElemMsg; + +typedef + void (*Texts_Handler)(Texts_Elem, Texts_ElemMsg*, LONGINT *); + +typedef + struct Texts_TextDesc *Texts_Text; + +typedef + struct Texts_ElemDesc { + Texts_Run prev, next; + LONGINT len; + Texts_FontsFont fnt; + SHORTINT col, voff; + BOOLEAN ascii; + LONGINT W, H; + Texts_Handler handle; + Texts_Text base; + } Texts_ElemDesc; + +struct Texts__1 { /* Texts_ElemDesc */ + Texts_Run prev, next; + LONGINT len; + Texts_FontsFont fnt; + SHORTINT col, voff; + BOOLEAN ascii; + LONGINT W, H; + Texts_Handler handle; + Texts_Text base; + Files_File file; + LONGINT org, span; + CHAR mod[32], proc[32]; +}; + +typedef + struct Texts__1 *Texts_Alien; + +typedef + struct Texts_BufDesc { + LONGINT len; + Texts_Run head; + } Texts_BufDesc; + +typedef + Texts_BufDesc *Texts_Buffer; + +typedef + struct Texts_CopyMsg { /* Texts_ElemMsg */ + Texts_Elem e; + } Texts_CopyMsg; + +typedef + struct Texts_FileMsg { /* Texts_ElemMsg */ + INTEGER id; + LONGINT pos; + Files_Rider r; + } Texts_FileMsg; + +typedef + struct Texts_FontDesc { + CHAR name[32]; + } Texts_FontDesc; + +typedef + struct Texts_IdentifyMsg { /* Texts_ElemMsg */ + CHAR mod[32], proc[32]; + } Texts_IdentifyMsg; + +typedef + void (*Texts_Notifier)(Texts_Text, INTEGER, LONGINT, LONGINT); + +typedef + struct Texts_PieceDesc *Texts_Piece; + +typedef + struct Texts_PieceDesc { + Texts_Run prev, next; + LONGINT len; + Texts_FontsFont fnt; + SHORTINT col, voff; + BOOLEAN ascii; + Files_File file; + LONGINT org; + } Texts_PieceDesc; + +typedef + struct Texts_Reader { + BOOLEAN eot; + Texts_FontsFont fnt; + SHORTINT col, voff; + Texts_Elem elem; + Files_Rider rider; + Texts_Run run; + LONGINT org, off; + } Texts_Reader; + +typedef + struct Texts_Scanner { /* Texts_Reader */ + BOOLEAN eot; + Texts_FontsFont fnt; + SHORTINT col, voff; + Texts_Elem elem; + Files_Rider rider; + Texts_Run run; + LONGINT org, off; + CHAR nextCh; + INTEGER line, class; + LONGINT i; + REAL x; + LONGREAL y; + CHAR c; + SHORTINT len; + CHAR s[64]; + } Texts_Scanner; + +typedef + struct Texts_TextDesc { + LONGINT len; + Texts_Notifier notify; + Texts_Run head, cache; + LONGINT corg; + } Texts_TextDesc; + +typedef + struct Texts_Writer { + Texts_Buffer buf; + Texts_FontsFont fnt; + SHORTINT col, voff; + Files_Rider rider; + Files_File file; + } Texts_Writer; + + +export Texts_Elem Texts_new; +static Texts_Buffer Texts_del; +static Texts_FontsFont Texts_FontsDefault; + +export LONGINT *Texts_FontDesc__typ; +export LONGINT *Texts_RunDesc__typ; +export LONGINT *Texts_PieceDesc__typ; +export LONGINT *Texts_ElemMsg__typ; +export LONGINT *Texts_ElemDesc__typ; +export LONGINT *Texts_FileMsg__typ; +export LONGINT *Texts_CopyMsg__typ; +export LONGINT *Texts_IdentifyMsg__typ; +export LONGINT *Texts_BufDesc__typ; +export LONGINT *Texts_TextDesc__typ; +export LONGINT *Texts_Reader__typ; +export LONGINT *Texts_Scanner__typ; +export LONGINT *Texts_Writer__typ; +export LONGINT *Texts__1__typ; + +export void Texts_Append (Texts_Text T, Texts_Buffer B); +export void Texts_ChangeLooks (Texts_Text T, LONGINT beg, LONGINT end, SET sel, Texts_FontsFont fnt, SHORTINT col, SHORTINT voff); +static Texts_Elem Texts_CloneElem (Texts_Elem e); +static Texts_Piece Texts_ClonePiece (Texts_Piece p); +export void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len); +export void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); +export void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); +export void Texts_Delete (Texts_Text T, LONGINT beg, LONGINT end); +export Texts_Text Texts_ElemBase (Texts_Elem E); +export LONGINT Texts_ElemPos (Texts_Elem E); +static void Texts_Find (Texts_Text T, LONGINT *pos, Texts_Run *u, LONGINT *org, LONGINT *off); +static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len); +static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, LONGINT *msg__typ); +export void Texts_Insert (Texts_Text T, LONGINT pos, Texts_Buffer B); +export void Texts_Load (Files_Rider *r, LONGINT *r__typ, Texts_Text T); +static void Texts_Load0 (Files_Rider *r, LONGINT *r__typ, Texts_Text T); +static void Texts_Merge (Texts_Text T, Texts_Run u, Texts_Run *v); +export void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len); +export void Texts_OpenBuf (Texts_Buffer B); +export void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, LONGINT pos); +export void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, LONGINT pos); +export void Texts_OpenWriter (Texts_Writer *W, LONGINT *W__typ); +export LONGINT Texts_Pos (Texts_Reader *R, LONGINT *R__typ); +export void Texts_Read (Texts_Reader *R, LONGINT *R__typ, CHAR *ch); +export void Texts_ReadElem (Texts_Reader *R, LONGINT *R__typ); +export void Texts_ReadPrevElem (Texts_Reader *R, LONGINT *R__typ); +export void Texts_Recall (Texts_Buffer *B); +export void Texts_Save (Texts_Text T, LONGINT beg, LONGINT end, Texts_Buffer B); +export void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ); +export void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, SHORTINT col); +export void Texts_SetFont (Texts_Writer *W, LONGINT *W__typ, Texts_FontsFont fnt); +export void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, SHORTINT voff); +static void Texts_Splice (Texts_Run un, Texts_Run v, Texts_Run w, Texts_Text base); +static void Texts_Split (LONGINT off, Texts_Run *u, Texts_Run *un); +export void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T); +export void Texts_Write (Texts_Writer *W, LONGINT *W__typ, CHAR ch); +export void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, LONGINT t, LONGINT d); +export void Texts_WriteElem (Texts_Writer *W, LONGINT *W__typ, Texts_Elem e); +export void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, LONGINT x); +export void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n); +export void Texts_WriteLn (Texts_Writer *W, LONGINT *W__typ); +export void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER n); +export void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x); +export void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n); +export void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n, INTEGER k); +export void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x); +export void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__len); + + +static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len) +{ + Texts_FontsFont _o_result; + Texts_FontsFont F = NIL; + __NEW(F, Texts_FontDesc); + __COPY(name, F->name, ((LONGINT)(32))); + _o_result = F; + return _o_result; +} + +static void Texts_Find (Texts_Text T, LONGINT *pos, Texts_Run *u, LONGINT *org, LONGINT *off) +{ + Texts_Run v = NIL; + LONGINT m; + if (*pos >= T->len) { + *pos = T->len; + *u = T->head; + *org = T->len; + *off = 0; + T->cache = T->head; + T->corg = 0; + } else { + v = T->cache->next; + m = *pos - T->corg; + if (*pos >= T->corg) { + while (m >= v->len) { + m -= v->len; + v = v->next; + } + } else { + while (m < 0) { + v = v->prev; + m += v->len; + } + } + *u = v; + *org = *pos - m; + *off = m; + T->cache = v->prev; + T->corg = *org; + } +} + +static void Texts_Split (LONGINT off, Texts_Run *u, Texts_Run *un) +{ + Texts_Piece p = NIL, U = NIL; + if (off == 0) { + *un = *u; + *u = (*un)->prev; + } else if (off >= (*u)->len) { + *un = (*u)->next; + } else { + __NEW(p, Texts_PieceDesc); + *un = (Texts_Run)p; + U = __GUARDP(*u, Texts_PieceDesc, 1); + __GUARDEQP(p, Texts_PieceDesc) = *U; + p->org += off; + p->len -= off; + U->len -= p->len; + p->ascii = (*u)->ascii; + p->prev = (Texts_Run)U; + p->next = U->next; + p->next->prev = (Texts_Run)p; + U->next = (Texts_Run)p; + } +} + +static void Texts_Merge (Texts_Text T, Texts_Run u, Texts_Run *v) +{ + Texts_Piece p = NIL, q = NIL; + if ((((((((((__ISP(u, Texts_PieceDesc, 1) && __ISP(*v, Texts_PieceDesc, 1))) && __STRCMP(u->fnt->name, (*v)->fnt->name) == 0)) && u->col == (*v)->col)) && u->voff == (*v)->voff)) && __GUARDP(u, Texts_PieceDesc, 1)->ascii == __GUARDP(*v, Texts_PieceDesc, 1)->ascii)) { + p = __GUARDP(u, Texts_PieceDesc, 1); + q = __GUARDP(*v, Texts_PieceDesc, 1); + if ((p->file == q->file && p->org + p->len == q->org)) { + if (T->cache == u) { + T->corg += q->len; + } else if (T->cache == *v) { + T->cache = T->head; + T->corg = 0; + } + p->len += q->len; + *v = (*v)->next; + } + } +} + +static void Texts_Splice (Texts_Run un, Texts_Run v, Texts_Run w, Texts_Text base) +{ + Texts_Run u = NIL; + if (v != w->next) { + u = un->prev; + u->next = v; + v->prev = u; + un->prev = w; + w->next = un; + do { + if (__ISP(v, Texts_ElemDesc, 1)) { + __GUARDP(v, Texts_ElemDesc, 1)->base = base; + } + v = v->next; + } while (!(v == un)); + } +} + +static Texts_Piece Texts_ClonePiece (Texts_Piece p) +{ + Texts_Piece _o_result; + Texts_Piece q = NIL; + __NEW(q, Texts_PieceDesc); + __GUARDEQP(q, Texts_PieceDesc) = *p; + _o_result = q; + return _o_result; +} + +static Texts_Elem Texts_CloneElem (Texts_Elem e) +{ + Texts_Elem _o_result; + Texts_CopyMsg msg; + msg.e = NIL; + (*e->handle)(e, (void*)&msg, Texts_CopyMsg__typ); + _o_result = msg.e; + return _o_result; +} + +void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE) +{ + DE->len = SE->len; + DE->fnt = SE->fnt; + DE->col = SE->col; + DE->voff = SE->voff; + DE->W = SE->W; + DE->H = SE->H; + DE->handle = SE->handle; +} + +Texts_Text Texts_ElemBase (Texts_Elem E) +{ + Texts_Text _o_result; + _o_result = E->base; + return _o_result; +} + +LONGINT Texts_ElemPos (Texts_Elem E) +{ + LONGINT _o_result; + Texts_Run u = NIL; + LONGINT pos; + u = E->base->head->next; + pos = 0; + while (u != (void *) E) { + pos = pos + u->len; + u = u->next; + } + _o_result = pos; + return _o_result; +} + +static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, LONGINT *msg__typ) +{ + Texts_Alien e = NIL; + Files_Rider r; + LONGINT i; + CHAR ch; + if (__ISP(E, Texts__1, 2)) { + if (__IS(msg__typ, Texts_CopyMsg, 1)) { + if (__IS(msg__typ, Texts_CopyMsg, 1)) { + Texts_CopyMsg *msg__ = (void*)msg; + __NEW(e, Texts__1); + Texts_CopyElem((void*)((Texts_Alien)E), (void*)e); + e->file = ((Texts_Alien)E)->file; + e->org = ((Texts_Alien)E)->org; + e->span = ((Texts_Alien)E)->span; + __COPY(((Texts_Alien)E)->mod, e->mod, ((LONGINT)(32))); + __COPY(((Texts_Alien)E)->proc, e->proc, ((LONGINT)(32))); + (*msg__).e = (Texts_Elem)e; + } else __WITHCHK; + } else if (__IS(msg__typ, Texts_IdentifyMsg, 1)) { + if (__IS(msg__typ, Texts_IdentifyMsg, 1)) { + Texts_IdentifyMsg *msg__ = (void*)msg; + __COPY(((Texts_Alien)E)->mod, (*msg__).mod, ((LONGINT)(32))); + __COPY(((Texts_Alien)E)->proc, (*msg__).proc, ((LONGINT)(32))); + (*msg__).mod[31] = 0x01; + } else __WITHCHK; + } else if (__IS(msg__typ, Texts_FileMsg, 1)) { + if (__IS(msg__typ, Texts_FileMsg, 1)) { + Texts_FileMsg *msg__ = (void*)msg; + if ((*msg__).id == 1) { + Files_Set(&r, Files_Rider__typ, ((Texts_Alien)E)->file, ((Texts_Alien)E)->org); + i = ((Texts_Alien)E)->span; + while (i > 0) { + Files_Read(&r, Files_Rider__typ, (void*)&ch); + Files_Write(&(*msg__).r, Files_Rider__typ, ch); + i -= 1; + } + } + } else __WITHCHK; + } + } else __WITHCHK; +} + +void Texts_OpenBuf (Texts_Buffer B) +{ + Texts_Run u = NIL; + __NEW(u, Texts_RunDesc); + u->next = u; + u->prev = u; + B->head = u; + B->len = 0; +} + +void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB) +{ + Texts_Run u = NIL, v = NIL, vn = NIL; + u = SB->head->next; + v = DB->head->prev; + while (u != SB->head) { + if (__ISP(u, Texts_PieceDesc, 1)) { + vn = (Texts_Run)Texts_ClonePiece(__GUARDP(u, Texts_PieceDesc, 1)); + } else { + vn = (Texts_Run)Texts_CloneElem(__GUARDP(u, Texts_ElemDesc, 1)); + } + v->next = vn; + vn->prev = v; + v = vn; + u = u->next; + } + v->next = DB->head; + DB->head->prev = v; + DB->len += SB->len; +} + +void Texts_Recall (Texts_Buffer *B) +{ + *B = Texts_del; + Texts_del = NIL; +} + +void Texts_Save (Texts_Text T, LONGINT beg, LONGINT end, Texts_Buffer B) +{ + Texts_Run u = NIL, v = NIL, w = NIL, wn = NIL; + LONGINT uo, ud, vo, vd; + Texts_Find(T, &beg, &u, &uo, &ud); + Texts_Find(T, &end, &v, &vo, &vd); + w = B->head->prev; + while (u != v) { + if (__ISP(u, Texts_PieceDesc, 1)) { + wn = (Texts_Run)Texts_ClonePiece(__GUARDP(u, Texts_PieceDesc, 1)); + wn->len -= ud; + __GUARDP(wn, Texts_PieceDesc, 1)->org += ud; + } else { + wn = (Texts_Run)Texts_CloneElem(__GUARDP(u, Texts_ElemDesc, 1)); + } + w->next = wn; + wn->prev = w; + w = wn; + u = u->next; + ud = 0; + } + if (vd > 0) { + wn = (Texts_Run)Texts_ClonePiece(__GUARDP(v, Texts_PieceDesc, 1)); + wn->len = vd - ud; + __GUARDP(wn, Texts_PieceDesc, 1)->org += ud; + w->next = wn; + wn->prev = w; + w = wn; + } + w->next = B->head; + B->head->prev = w; + B->len += end - beg; +} + +void Texts_Insert (Texts_Text T, LONGINT pos, Texts_Buffer B) +{ + Texts_Run u = NIL, un = NIL, v = NIL; + Texts_Piece p = NIL, q = NIL; + LONGINT uo, ud, len; + Texts_Find(T, &pos, &u, &uo, &ud); + Texts_Split(ud, &u, &un); + len = B->len; + v = B->head->next; + Texts_Merge(T, u, &v); + Texts_Splice(un, v, B->head->prev, T); + T->len += len; + B->head->next = B->head; + B->head->prev = B->head; + B->len = 0; + if (T->notify != NIL) { + (*T->notify)(T, 1, pos, pos + len); + } +} + +void Texts_Append (Texts_Text T, Texts_Buffer B) +{ + Texts_Run v = NIL; + LONGINT pos, len; + pos = T->len; + len = B->len; + v = B->head->next; + Texts_Merge(T, T->head->prev, &v); + Texts_Splice(T->head, v, B->head->prev, T); + T->len += len; + B->head->next = B->head; + B->head->prev = B->head; + B->len = 0; + if (T->notify != NIL) { + (*T->notify)(T, 1, pos, pos + len); + } +} + +void Texts_Delete (Texts_Text T, LONGINT beg, LONGINT end) +{ + Texts_Run c = NIL, u = NIL, un = NIL, v = NIL, vn = NIL; + LONGINT co, uo, ud, vo, vd; + Texts_Find(T, &beg, &u, &uo, &ud); + Texts_Split(ud, &u, &un); + c = T->cache; + co = T->corg; + Texts_Find(T, &end, &v, &vo, &vd); + Texts_Split(vd, &v, &vn); + T->cache = c; + T->corg = co; + __NEW(Texts_del, Texts_BufDesc); + Texts_OpenBuf(Texts_del); + Texts_del->len = end - beg; + Texts_Splice(Texts_del->head, un, v, NIL); + Texts_Merge(T, u, &vn); + u->next = vn; + vn->prev = u; + T->len -= end - beg; + if (T->notify != NIL) { + (*T->notify)(T, 2, beg, end); + } +} + +void Texts_ChangeLooks (Texts_Text T, LONGINT beg, LONGINT end, SET sel, Texts_FontsFont fnt, SHORTINT col, SHORTINT voff) +{ + Texts_Run c = NIL, u = NIL, un = NIL, v = NIL, vn = NIL; + LONGINT co, uo, ud, vo, vd; + Texts_Find(T, &beg, &u, &uo, &ud); + Texts_Split(ud, &u, &un); + c = T->cache; + co = T->corg; + Texts_Find(T, &end, &v, &vo, &vd); + Texts_Split(vd, &v, &vn); + T->cache = c; + T->corg = co; + while (un != vn) { + if ((__IN(0, sel) && fnt != NIL)) { + un->fnt = fnt; + } + if (__IN(1, sel)) { + un->col = col; + } + if (__IN(2, sel)) { + un->voff = voff; + } + Texts_Merge(T, u, &un); + if (u->next == un) { + u = un; + un = un->next; + } else { + u->next = un; + un->prev = u; + } + } + Texts_Merge(T, u, &un); + u->next = un; + un->prev = u; + if (T->notify != NIL) { + (*T->notify)(T, 0, beg, end); + } +} + +void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, LONGINT pos) +{ + Texts_Run u = NIL; + if (pos >= T->len) { + pos = T->len; + } + Texts_Find(T, &pos, &u, &(*R).org, &(*R).off); + (*R).run = u; + (*R).eot = 0; + if (__ISP(u, Texts_PieceDesc, 1)) { + Files_Set(&(*R).rider, Files_Rider__typ, __GUARDP(u, Texts_PieceDesc, 1)->file, __GUARDP(u, Texts_PieceDesc, 1)->org + (*R).off); + } +} + +void Texts_Read (Texts_Reader *R, LONGINT *R__typ, CHAR *ch) +{ + Texts_Run u = NIL; + LONGINT pos; + CHAR nextch; + u = (*R).run; + (*R).fnt = u->fnt; + (*R).col = u->col; + (*R).voff = u->voff; + (*R).off += 1; + if (__ISP(u, Texts_PieceDesc, 1)) { + Files_Read(&(*R).rider, Files_Rider__typ, (void*)&*ch); + (*R).elem = NIL; + if ((*ch == 0x0a && __GUARDP(u, Texts_PieceDesc, 1)->ascii)) { + *ch = 0x0d; + } else if ((*ch == 0x0d && __GUARDP(u, Texts_PieceDesc, 1)->ascii)) { + pos = Files_Pos(&(*R).rider, Files_Rider__typ); + Files_Read(&(*R).rider, Files_Rider__typ, (void*)&nextch); + if (nextch == 0x0a) { + (*R).off += 1; + } else { + Files_Set(&(*R).rider, Files_Rider__typ, __GUARDP(u, Texts_PieceDesc, 1)->file, pos); + } + } + } else if (__ISP(u, Texts_ElemDesc, 1)) { + *ch = 0x1c; + (*R).elem = __GUARDP(u, Texts_ElemDesc, 1); + } else { + *ch = 0x00; + (*R).elem = NIL; + (*R).eot = 1; + } + if ((*R).off == u->len) { + (*R).org += u->len; + u = u->next; + if (__ISP(u, Texts_PieceDesc, 1)) { + if (__ISP(u, Texts_PieceDesc, 1)) { + Files_Set(&(*R).rider, Files_Rider__typ, ((Texts_Piece)u)->file, ((Texts_Piece)u)->org); + } else __WITHCHK; + } + (*R).run = u; + (*R).off = 0; + } +} + +void Texts_ReadElem (Texts_Reader *R, LONGINT *R__typ) +{ + Texts_Run u = NIL, un = NIL; + u = (*R).run; + while (__ISP(u, Texts_PieceDesc, 1)) { + (*R).org += u->len; + u = u->next; + } + if (__ISP(u, Texts_ElemDesc, 1)) { + un = u->next; + (*R).run = un; + (*R).org += 1; + (*R).off = 0; + (*R).fnt = u->fnt; + (*R).col = u->col; + (*R).voff = u->voff; + (*R).elem = __GUARDP(u, Texts_ElemDesc, 1); + if (__ISP(un, Texts_PieceDesc, 1)) { + if (__ISP(un, Texts_PieceDesc, 1)) { + Files_Set(&(*R).rider, Files_Rider__typ, ((Texts_Piece)un)->file, ((Texts_Piece)un)->org); + } else __WITHCHK; + } + } else { + (*R).eot = 1; + (*R).elem = NIL; + } +} + +void Texts_ReadPrevElem (Texts_Reader *R, LONGINT *R__typ) +{ + Texts_Run u = NIL; + u = (*R).run->prev; + while (__ISP(u, Texts_PieceDesc, 1)) { + (*R).org -= u->len; + u = u->prev; + } + if (__ISP(u, Texts_ElemDesc, 1)) { + (*R).run = u; + (*R).org -= 1; + (*R).off = 0; + (*R).fnt = u->fnt; + (*R).col = u->col; + (*R).voff = u->voff; + (*R).elem = __GUARDP(u, Texts_ElemDesc, 1); + } else { + (*R).eot = 1; + (*R).elem = NIL; + } +} + +LONGINT Texts_Pos (Texts_Reader *R, LONGINT *R__typ) +{ + LONGINT _o_result; + _o_result = (*R).org + (*R).off; + return _o_result; +} + +void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, LONGINT pos) +{ + Texts_OpenReader((void*)&*S, S__typ, T, pos); + (*S).line = 0; + (*S).nextCh = ' '; +} + +static struct Scan__31 { + Texts_Scanner *S; + LONGINT *S__typ; + CHAR *ch; + BOOLEAN *negE; + INTEGER *e; + struct Scan__31 *lnk; +} *Scan__31_s; + +static void ReadScaleFactor__32 (void); + +static void ReadScaleFactor__32 (void) +{ + Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); + if (*Scan__31_s->ch == '-') { + *Scan__31_s->negE = 1; + Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); + } else { + *Scan__31_s->negE = 0; + if (*Scan__31_s->ch == '+') { + Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); + } + } + while (('0' <= *Scan__31_s->ch && *Scan__31_s->ch <= '9')) { + *Scan__31_s->e = (*Scan__31_s->e * 10 + (int)*Scan__31_s->ch) - 48; + Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); + } +} + +void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) +{ + CHAR ch, term; + BOOLEAN neg, negE, hex; + SHORTINT i, j, h; + INTEGER e; + LONGINT k; + REAL x, f; + LONGREAL y, g; + CHAR d[32]; + struct Scan__31 _s; + _s.S = S; _s.S__typ = S__typ; + _s.ch = &ch; + _s.negE = &negE; + _s.e = &e; + _s.lnk = Scan__31_s; + Scan__31_s = &_s; + ch = (*S).nextCh; + i = 0; + for (;;) { + if (ch == 0x0d) { + (*S).line += 1; + } else if ((ch != ' ' && ch != 0x09)) { + break; + } + Texts_Read((void*)&*S, S__typ, &ch); + } + if ((('A' <= __CAP(ch) && __CAP(ch) <= 'Z') || ch == '/') || ch == '.') { + do { + (*S).s[__X(i, ((LONGINT)(64)))] = ch; + i += 1; + Texts_Read((void*)&*S, S__typ, &ch); + } while (!((((__CAP(ch) > 'Z' && ch != '_') || ('A' > __CAP(ch) && ch > '9')) || ((('0' > ch && ch != '.')) && ch != '/')) || i == 63)); + (*S).s[__X(i, ((LONGINT)(64)))] = 0x00; + (*S).len = i; + (*S).class = 1; + } else if (ch == '\"') { + Texts_Read((void*)&*S, S__typ, &ch); + while ((((ch != '\"' && ch >= ' ')) && i != 63)) { + (*S).s[__X(i, ((LONGINT)(64)))] = ch; + i += 1; + Texts_Read((void*)&*S, S__typ, &ch); + } + (*S).s[__X(i, ((LONGINT)(64)))] = 0x00; + (*S).len = i + 1; + Texts_Read((void*)&*S, S__typ, &ch); + (*S).class = 2; + } else { + if (ch == '-') { + neg = 1; + Texts_Read((void*)&*S, S__typ, &ch); + } else { + neg = 0; + } + if (('0' <= ch && ch <= '9')) { + hex = 0; + j = 0; + for (;;) { + d[__X(i, ((LONGINT)(32)))] = ch; + i += 1; + Texts_Read((void*)&*S, S__typ, &ch); + if (ch < '0') { + break; + } + if ('9' < ch) { + if (('A' <= ch && ch <= 'F')) { + hex = 1; + ch = (CHAR)((int)ch - 7); + } else if (('a' <= ch && ch <= 'f')) { + hex = 1; + ch = (CHAR)((int)ch - 39); + } else { + break; + } + } + } + if (ch == 'H') { + Texts_Read((void*)&*S, S__typ, &ch); + (*S).class = 3; + if (i - j > 8) { + j = i - 8; + } + k = (int)d[__X(j, ((LONGINT)(32)))] - 48; + j += 1; + if ((i - j == 7 && k >= 8)) { + k -= 16; + } + while (j < i) { + k = __ASHL(k, 4) + (LONGINT)((int)d[__X(j, ((LONGINT)(32)))] - 48); + j += 1; + } + if (neg) { + (*S).i = -k; + } else { + (*S).i = k; + } + } else if (ch == '.') { + Texts_Read((void*)&*S, S__typ, &ch); + h = i; + while (('0' <= ch && ch <= '9')) { + d[__X(i, ((LONGINT)(32)))] = ch; + i += 1; + Texts_Read((void*)&*S, S__typ, &ch); + } + if (ch == 'D') { + e = 0; + y = (LONGREAL)0; + g = (LONGREAL)1; + do { + y = y * (LONGREAL)10 + ((int)d[__X(j, ((LONGINT)(32)))] - 48); + j += 1; + } while (!(j == h)); + while (j < i) { + g = g / (LONGREAL)(LONGREAL)10; + y = ((int)d[__X(j, ((LONGINT)(32)))] - 48) * g + y; + j += 1; + } + ReadScaleFactor__32(); + if (negE) { + if (e <= 308) { + y = y / (LONGREAL)Reals_TenL(e); + } else { + y = (LONGREAL)0; + } + } else if (e > 0) { + if (e <= 308) { + y = Reals_TenL(e) * y; + } else { + __HALT(40); + } + } + if (neg) { + y = -y; + } + (*S).class = 5; + (*S).y = y; + } else { + e = 0; + x = (REAL)0; + f = (REAL)1; + do { + x = x * (REAL)10 + ((int)d[__X(j, ((LONGINT)(32)))] - 48); + j += 1; + } while (!(j == h)); + while (j < i) { + f = f / (REAL)(REAL)10; + x = ((int)d[__X(j, ((LONGINT)(32)))] - 48) * f + x; + j += 1; + } + if (ch == 'E') { + ReadScaleFactor__32(); + } + if (negE) { + if (e <= 38) { + x = x / (REAL)Reals_Ten(e); + } else { + x = (REAL)0; + } + } else if (e > 0) { + if (e <= 38) { + x = Reals_Ten(e) * x; + } else { + __HALT(40); + } + } + if (neg) { + x = -x; + } + (*S).class = 4; + (*S).x = x; + } + if (hex) { + (*S).class = 0; + } + } else { + (*S).class = 3; + k = 0; + do { + k = k * 10 + (LONGINT)((int)d[__X(j, ((LONGINT)(32)))] - 48); + j += 1; + } while (!(j == i)); + if (neg) { + (*S).i = -k; + } else { + (*S).i = k; + } + if (hex) { + (*S).class = 0; + } else { + (*S).class = 3; + } + } + } else { + (*S).class = 6; + if (neg) { + (*S).c = '-'; + } else { + (*S).c = ch; + Texts_Read((void*)&*S, S__typ, &ch); + } + } + } + (*S).nextCh = ch; + Scan__31_s = _s.lnk; +} + +void Texts_OpenWriter (Texts_Writer *W, LONGINT *W__typ) +{ + __NEW((*W).buf, Texts_BufDesc); + Texts_OpenBuf((*W).buf); + (*W).fnt = Texts_FontsDefault; + (*W).col = 15; + (*W).voff = 0; + (*W).file = Files_New((CHAR*)"", (LONGINT)1); + Files_Set(&(*W).rider, Files_Rider__typ, (*W).file, ((LONGINT)(0))); +} + +void Texts_SetFont (Texts_Writer *W, LONGINT *W__typ, Texts_FontsFont fnt) +{ + (*W).fnt = fnt; +} + +void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, SHORTINT col) +{ + (*W).col = col; +} + +void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, SHORTINT voff) +{ + (*W).voff = voff; +} + +void Texts_Write (Texts_Writer *W, LONGINT *W__typ, CHAR ch) +{ + Texts_Run u = NIL, un = NIL; + Texts_Piece p = NIL; + Files_Write(&(*W).rider, Files_Rider__typ, ch); + (*W).buf->len += 1; + un = (*W).buf->head; + u = un->prev; + if ((((((((((__ISP(u, Texts_PieceDesc, 1) && __GUARDP(u, Texts_PieceDesc, 1)->file == (*W).file)) && __STRCMP(u->fnt->name, (*W).fnt->name) == 0)) && u->col == (*W).col)) && u->voff == (*W).voff)) && !__GUARDP(u, Texts_PieceDesc, 1)->ascii)) { + u->len += 1; + } else { + __NEW(p, Texts_PieceDesc); + u->next = (Texts_Run)p; + p->prev = u; + p->next = un; + un->prev = (Texts_Run)p; + p->len = 1; + p->fnt = (*W).fnt; + p->col = (*W).col; + p->voff = (*W).voff; + p->file = (*W).file; + p->org = Files_Length((*W).file) - 1; + p->ascii = 0; + } +} + +void Texts_WriteElem (Texts_Writer *W, LONGINT *W__typ, Texts_Elem e) +{ + Texts_Run u = NIL, un = NIL; + if (e->base != NIL) { + __HALT(99); + } + (*W).buf->len += 1; + e->len = 1; + e->fnt = (*W).fnt; + e->col = (*W).col; + e->voff = (*W).voff; + un = (*W).buf->head; + u = un->prev; + u->next = (Texts_Run)e; + e->prev = u; + e->next = un; + un->prev = (Texts_Run)e; +} + +void Texts_WriteLn (Texts_Writer *W, LONGINT *W__typ) +{ + Texts_Write(&*W, W__typ, 0x0d); +} + +void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__len) +{ + INTEGER i; + __DUP(s, s__len, CHAR); + i = 0; + while (s[__X(i, s__len)] >= ' ') { + Texts_Write(&*W, W__typ, s[__X(i, s__len)]); + i += 1; + } + __DEL(s); +} + +void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n) +{ + INTEGER i; + LONGINT x0; + CHAR a[22]; + i = 0; + if (x < 0) { + if (x == (-9223372036854775807-1)) { + Texts_WriteString(&*W, W__typ, (CHAR*)" -9223372036854775808", (LONGINT)22); + return; + } else { + n -= 1; + x0 = -x; + } + } else { + x0 = x; + } + do { + a[__X(i, ((LONGINT)(22)))] = (CHAR)(__MOD(x0, 10) + 48); + x0 = __DIV(x0, 10); + i += 1; + } while (!(x0 == 0)); + while (n > (LONGINT)i) { + Texts_Write(&*W, W__typ, ' '); + n -= 1; + } + if (x < 0) { + Texts_Write(&*W, W__typ, '-'); + } + do { + i -= 1; + Texts_Write(&*W, W__typ, a[__X(i, ((LONGINT)(22)))]); + } while (!(i == 0)); +} + +void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, LONGINT x) +{ + INTEGER i; + LONGINT y; + CHAR a[20]; + i = 0; + Texts_Write(&*W, W__typ, ' '); + do { + y = __MASK(x, -16); + if (y < 10) { + a[__X(i, ((LONGINT)(20)))] = (CHAR)(y + 48); + } else { + a[__X(i, ((LONGINT)(20)))] = (CHAR)(y + 55); + } + x = __ASHR(x, 4); + i += 1; + } while (!(i == 8)); + do { + i -= 1; + Texts_Write(&*W, W__typ, a[__X(i, ((LONGINT)(20)))]); + } while (!(i == 0)); +} + +void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n) +{ + INTEGER e; + REAL x0; + CHAR d[9]; + e = Reals_Expo(x); + if (e == 0) { + Texts_WriteString(&*W, W__typ, (CHAR*)" 0", (LONGINT)4); + do { + Texts_Write(&*W, W__typ, ' '); + n -= 1; + } while (!(n <= 3)); + } else if (e == 255) { + Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", (LONGINT)5); + while (n > 4) { + Texts_Write(&*W, W__typ, ' '); + n -= 1; + } + } else { + if (n <= 9) { + n = 3; + } else { + n -= 6; + } + do { + Texts_Write(&*W, W__typ, ' '); + n -= 1; + } while (!(n <= 8)); + if (x < (REAL)0) { + Texts_Write(&*W, W__typ, '-'); + x = -x; + } else { + Texts_Write(&*W, W__typ, ' '); + } + e = __ASHR((e - 127) * 77, 8); + if (e >= 0) { + x = x / (REAL)Reals_Ten(e); + } else { + x = Reals_Ten(-e) * x; + } + if (x >= (REAL)10) { + x = 1.0000000e-001 * x; + e += 1; + } + x0 = Reals_Ten(n - 1); + x = x0 * x + 5.0000000e-001; + if (x >= (REAL)10 * x0) { + x = x * 1.0000000e-001; + e += 1; + } + Reals_Convert(x, n, (void*)d, ((LONGINT)(9))); + n -= 1; + Texts_Write(&*W, W__typ, d[__X(n, ((LONGINT)(9)))]); + Texts_Write(&*W, W__typ, '.'); + do { + n -= 1; + Texts_Write(&*W, W__typ, d[__X(n, ((LONGINT)(9)))]); + } while (!(n == 0)); + Texts_Write(&*W, W__typ, 'E'); + if (e < 0) { + Texts_Write(&*W, W__typ, '-'); + e = -e; + } else { + Texts_Write(&*W, W__typ, '+'); + } + Texts_Write(&*W, W__typ, (CHAR)(__DIV(e, 10) + 48)); + Texts_Write(&*W, W__typ, (CHAR)((int)__MOD(e, 10) + 48)); + } +} + +static struct WriteRealFix__53 { + Texts_Writer *W; + LONGINT *W__typ; + INTEGER *i; + CHAR (*d)[9]; + struct WriteRealFix__53 *lnk; +} *WriteRealFix__53_s; + +static void dig__54 (INTEGER n); +static void seq__56 (CHAR ch, INTEGER n); + +static void seq__56 (CHAR ch, INTEGER n) +{ + while (n > 0) { + Texts_Write(&*WriteRealFix__53_s->W, WriteRealFix__53_s->W__typ, ch); + n -= 1; + } +} + +static void dig__54 (INTEGER n) +{ + while (n > 0) { + *WriteRealFix__53_s->i -= 1; + Texts_Write(&*WriteRealFix__53_s->W, WriteRealFix__53_s->W__typ, (*WriteRealFix__53_s->d)[__X(*WriteRealFix__53_s->i, ((LONGINT)(9)))]); + n -= 1; + } +} + +void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n, INTEGER k) +{ + INTEGER e, i; + CHAR sign; + REAL x0; + CHAR d[9]; + struct WriteRealFix__53 _s; + _s.W = W; _s.W__typ = W__typ; + _s.i = &i; + _s.d = (void*)d; + _s.lnk = WriteRealFix__53_s; + WriteRealFix__53_s = &_s; + e = Reals_Expo(x); + if (k < 0) { + k = 0; + } + if (e == 0) { + seq__56(' ', (n - k) - 2); + Texts_Write(&*W, W__typ, '0'); + seq__56(' ', k + 1); + } else if (e == 255) { + Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", (LONGINT)5); + seq__56(' ', n - 4); + } else { + e = __ASHR((e - 127) * 77, 8); + if (x < (REAL)0) { + sign = '-'; + x = -x; + } else { + sign = ' '; + } + if (e >= 0) { + x = x / (REAL)Reals_Ten(e); + } else { + x = Reals_Ten(-e) * x; + } + if (x >= (REAL)10) { + x = 1.0000000e-001 * x; + e += 1; + } + if (k + e >= 8) { + k = 8 - e; + } else if (k + e < 0) { + k = -e; + x = (REAL)0; + } + x0 = Reals_Ten(k + e); + x = x0 * x + 5.0000000e-001; + if (x >= (REAL)10 * x0) { + e += 1; + } + e += 1; + i = k + e; + Reals_Convert(x, i, (void*)d, ((LONGINT)(9))); + if (e > 0) { + seq__56(' ', ((n - e) - k) - 2); + Texts_Write(&*W, W__typ, sign); + dig__54(e); + Texts_Write(&*W, W__typ, '.'); + dig__54(k); + } else { + seq__56(' ', (n - k) - 3); + Texts_Write(&*W, W__typ, sign); + Texts_Write(&*W, W__typ, '0'); + Texts_Write(&*W, W__typ, '.'); + seq__56('0', -e); + dig__54(k + e); + } + } + WriteRealFix__53_s = _s.lnk; +} + +void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x) +{ + INTEGER i; + CHAR d[8]; + Reals_ConvertH(x, (void*)d, ((LONGINT)(8))); + i = 0; + do { + Texts_Write(&*W, W__typ, d[__X(i, ((LONGINT)(8)))]); + i += 1; + } while (!(i == 8)); +} + +void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER n) +{ + INTEGER e; + LONGREAL x0; + CHAR d[16]; + e = Reals_ExpoL(x); + if (e == 0) { + Texts_WriteString(&*W, W__typ, (CHAR*)" 0", (LONGINT)4); + do { + Texts_Write(&*W, W__typ, ' '); + n -= 1; + } while (!(n <= 3)); + } else if (e == 2047) { + Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", (LONGINT)5); + while (n > 4) { + Texts_Write(&*W, W__typ, ' '); + n -= 1; + } + } else { + if (n <= 10) { + n = 3; + } else { + n -= 7; + } + do { + Texts_Write(&*W, W__typ, ' '); + n -= 1; + } while (!(n <= 16)); + if (x < (LONGREAL)0) { + Texts_Write(&*W, W__typ, '-'); + x = -x; + } else { + Texts_Write(&*W, W__typ, ' '); + } + e = (int)__ASHR((LONGINT)(e - 1023) * 77, 8); + if (e >= 0) { + x = x / (LONGREAL)Reals_TenL(e); + } else { + x = Reals_TenL(-e) * x; + } + if (x >= (LONGREAL)10) { + x = 1.00000000000000e-001 * x; + e += 1; + } + x0 = Reals_TenL(n - 1); + x = x0 * x + 5.00000000000000e-001; + if (x >= (LONGREAL)10 * x0) { + x = 1.00000000000000e-001 * x; + e += 1; + } + Reals_ConvertL(x, n, (void*)d, ((LONGINT)(16))); + n -= 1; + Texts_Write(&*W, W__typ, d[__X(n, ((LONGINT)(16)))]); + Texts_Write(&*W, W__typ, '.'); + do { + n -= 1; + Texts_Write(&*W, W__typ, d[__X(n, ((LONGINT)(16)))]); + } while (!(n == 0)); + Texts_Write(&*W, W__typ, 'D'); + if (e < 0) { + Texts_Write(&*W, W__typ, '-'); + e = -e; + } else { + Texts_Write(&*W, W__typ, '+'); + } + Texts_Write(&*W, W__typ, (CHAR)(__DIV(e, 100) + 48)); + e = (int)__MOD(e, 100); + Texts_Write(&*W, W__typ, (CHAR)(__DIV(e, 10) + 48)); + Texts_Write(&*W, W__typ, (CHAR)((int)__MOD(e, 10) + 48)); + } +} + +void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x) +{ + INTEGER i; + CHAR d[16]; + Reals_ConvertHL(x, (void*)d, ((LONGINT)(16))); + i = 0; + do { + Texts_Write(&*W, W__typ, d[__X(i, ((LONGINT)(16)))]); + i += 1; + } while (!(i == 16)); +} + +static struct WriteDate__43 { + Texts_Writer *W; + LONGINT *W__typ; + struct WriteDate__43 *lnk; +} *WriteDate__43_s; + +static void WritePair__44 (CHAR ch, LONGINT x); + +static void WritePair__44 (CHAR ch, LONGINT x) +{ + Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, ch); + Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)(__DIV(x, 10) + 48)); + Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)(__MOD(x, 10) + 48)); +} + +void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, LONGINT t, LONGINT d) +{ + struct WriteDate__43 _s; + _s.W = W; _s.W__typ = W__typ; + _s.lnk = WriteDate__43_s; + WriteDate__43_s = &_s; + WritePair__44(' ', __MASK(d, -32)); + WritePair__44('.', __MASK(__ASHR(d, 5), -16)); + WritePair__44('.', __MASK(__ASHR(d, 9), -128)); + WritePair__44(' ', __MASK(__ASHR(t, 12), -32)); + WritePair__44(':', __MASK(__ASHR(t, 6), -64)); + WritePair__44(':', __MASK(t, -64)); + WriteDate__43_s = _s.lnk; +} + +static struct Load0__16 { + Texts_Text *T; + SHORTINT *ecnt; + Files_File *f; + Texts_FileMsg *msg; + CHAR (*mods)[64][32], (*procs)[64][32]; + struct Load0__16 *lnk; +} *Load0__16_s; + +static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, LONGINT span, Texts_Elem *e); + +static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, LONGINT span, Texts_Elem *e) +{ + Modules_Module M = NIL; + Modules_Command Cmd; + Texts_Alien a = NIL; + LONGINT org, ew, eh; + SHORTINT eno; + Texts_new = NIL; + Files_ReadLInt(&*r, r__typ, &ew); + Files_ReadLInt(&*r, r__typ, &eh); + Files_Read(&*r, r__typ, (void*)&eno); + if (eno > *Load0__16_s->ecnt) { + *Load0__16_s->ecnt = eno; + Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->mods)[__X(eno, ((LONGINT)(64)))], ((LONGINT)(32))); + Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->procs)[__X(eno, ((LONGINT)(64)))], ((LONGINT)(32))); + } + org = Files_Pos(&*r, r__typ); + M = Modules_ThisMod((*Load0__16_s->mods)[__X(eno, ((LONGINT)(64)))], ((LONGINT)(32))); + if (M != NIL) { + Cmd = Modules_ThisCommand(M, (*Load0__16_s->procs)[__X(eno, ((LONGINT)(64)))], ((LONGINT)(32))); + if (Cmd != NIL) { + (*Cmd)(); + } + } + *e = Texts_new; + if (*e != NIL) { + (*e)->W = ew; + (*e)->H = eh; + (*e)->base = *Load0__16_s->T; + (*Load0__16_s->msg).pos = pos; + (*(*e)->handle)(*e, (void*)&*Load0__16_s->msg, Texts_FileMsg__typ); + if (Files_Pos(&*r, r__typ) != org + span) { + *e = NIL; + } + } + if (*e == NIL) { + Files_Set(&*r, r__typ, *Load0__16_s->f, org + span); + __NEW(a, Texts__1); + a->W = ew; + a->H = eh; + a->handle = Texts_HandleAlien; + a->base = *Load0__16_s->T; + a->file = *Load0__16_s->f; + a->org = org; + a->span = span; + __COPY((*Load0__16_s->mods)[__X(eno, ((LONGINT)(64)))], a->mod, ((LONGINT)(32))); + __COPY((*Load0__16_s->procs)[__X(eno, ((LONGINT)(64)))], a->proc, ((LONGINT)(32))); + *e = (Texts_Elem)a; + } +} + +static void Texts_Load0 (Files_Rider *r, LONGINT *r__typ, Texts_Text T) +{ + Texts_Run u = NIL, un = NIL; + Texts_Piece p = NIL; + Texts_Elem e = NIL; + LONGINT org, pos, hlen, plen; + SHORTINT ecnt, fno, fcnt, col, voff; + Files_File f = NIL; + Texts_FileMsg msg; + CHAR mods[64][32], procs[64][32]; + CHAR name[32]; + Texts_FontsFont fnts[32]; + struct Load0__16 _s; + _s.T = &T; + _s.ecnt = &ecnt; + _s.f = &f; + _s.msg = &msg; + _s.mods = (void*)mods; + _s.procs = (void*)procs; + _s.lnk = Load0__16_s; + Load0__16_s = &_s; + pos = Files_Pos(&*r, r__typ); + f = Files_Base(&*r, r__typ); + __NEW(u, Texts_RunDesc); + u->len = 9223372036854775807; + u->fnt = NIL; + u->col = 15; + T->head = u; + ecnt = 0; + fcnt = 0; + msg.id = 0; + msg.r = *r; + Files_ReadLInt(&msg.r, Files_Rider__typ, &hlen); + org = (pos - 2) + hlen; + pos = org; + Files_Read(&msg.r, Files_Rider__typ, (void*)&fno); + while (fno != 0) { + if (fno > fcnt) { + fcnt = fno; + Files_ReadString(&msg.r, Files_Rider__typ, (void*)name, ((LONGINT)(32))); + fnts[__X(fno, ((LONGINT)(32)))] = Texts_FontsThis((void*)name, ((LONGINT)(32))); + } + Files_Read(&msg.r, Files_Rider__typ, (void*)&col); + Files_Read(&msg.r, Files_Rider__typ, (void*)&voff); + Files_ReadLInt(&msg.r, Files_Rider__typ, &plen); + if (plen > 0) { + __NEW(p, Texts_PieceDesc); + p->file = f; + p->org = pos; + p->ascii = 0; + un = (Texts_Run)p; + un->len = plen; + } else { + LoadElem__17(&msg.r, Files_Rider__typ, pos - org, -plen, &e); + un = (Texts_Run)e; + un->len = 1; + } + un->col = col; + un->voff = voff; + pos += un->len; + u->next = un; + un->prev = u; + u = un; + Files_Read(&msg.r, Files_Rider__typ, (void*)&fno); + } + u->next = T->head; + T->head->prev = u; + T->cache = T->head; + T->corg = 0; + Files_ReadLInt(&msg.r, Files_Rider__typ, &T->len); + Files_Set(&*r, r__typ, f, Files_Pos(&msg.r, Files_Rider__typ) + T->len); + Load0__16_s = _s.lnk; +} + +void Texts_Load (Files_Rider *r, LONGINT *r__typ, Texts_Text T) +{ + INTEGER tag; + Files_ReadInt(&*r, r__typ, &tag); + if (tag != -4095) { + Files_Set(&*r, r__typ, Files_Base(&*r, r__typ), Files_Pos(&*r, r__typ) - 2); + } + Texts_Load0(&*r, r__typ, T); +} + +void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len) +{ + Files_File f = NIL; + Files_Rider r; + Texts_Run u = NIL; + Texts_Piece p = NIL; + CHAR tag, version; + LONGINT hlen; + __DUP(name, name__len, CHAR); + f = Files_Old(name, name__len); + if (f == NIL) { + f = Files_New((CHAR*)"", (LONGINT)1); + } + Files_Set(&r, Files_Rider__typ, f, ((LONGINT)(0))); + Files_Read(&r, Files_Rider__typ, (void*)&tag); + Files_Read(&r, Files_Rider__typ, (void*)&version); + if (tag == 0xf0 || (tag == 0x01 && version == 0xf0)) { + Texts_Load0(&r, Files_Rider__typ, T); + } else { + __NEW(u, Texts_RunDesc); + u->len = 9223372036854775807; + u->fnt = NIL; + u->col = 15; + __NEW(p, Texts_PieceDesc); + if ((tag == 0xf7 && version == 0x07)) { + Files_Set(&r, Files_Rider__typ, f, ((LONGINT)(28))); + Files_ReadLInt(&r, Files_Rider__typ, &hlen); + Files_Set(&r, Files_Rider__typ, f, 22 + hlen); + Files_ReadLInt(&r, Files_Rider__typ, &T->len); + p->org = 26 + hlen; + } else { + T->len = Files_Length(f); + p->org = 0; + } + if (T->len > 0) { + p->len = T->len; + p->fnt = Texts_FontsDefault; + p->col = 15; + p->voff = 0; + p->file = f; + p->ascii = 1; + u->next = (Texts_Run)p; + u->prev = (Texts_Run)p; + p->next = u; + p->prev = u; + } else { + u->next = u; + u->prev = u; + } + T->head = u; + T->cache = T->head; + T->corg = 0; + } + __DEL(name); +} + +static struct Store__39 { + SHORTINT *ecnt; + Texts_FileMsg *msg; + Texts_IdentifyMsg *iden; + CHAR (*mods)[64][32], (*procs)[64][32]; + struct Store__39 *lnk; +} *Store__39_s; + +static void StoreElem__40 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, Texts_Elem e); + +static void StoreElem__40 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, Texts_Elem e) +{ + Files_Rider r1; + LONGINT org, span; + SHORTINT eno; + __COPY((*Store__39_s->iden).mod, (*Store__39_s->mods)[__X(*Store__39_s->ecnt, ((LONGINT)(64)))], ((LONGINT)(32))); + __COPY((*Store__39_s->iden).proc, (*Store__39_s->procs)[__X(*Store__39_s->ecnt, ((LONGINT)(64)))], ((LONGINT)(32))); + eno = 1; + while (__STRCMP((*Store__39_s->mods)[__X(eno, ((LONGINT)(64)))], (*Store__39_s->iden).mod) != 0 || __STRCMP((*Store__39_s->procs)[__X(eno, ((LONGINT)(64)))], (*Store__39_s->iden).proc) != 0) { + eno += 1; + } + Files_Set(&r1, Files_Rider__typ, Files_Base(&*r, r__typ), Files_Pos(&*r, r__typ)); + Files_WriteLInt(&*r, r__typ, ((LONGINT)(0))); + Files_WriteLInt(&*r, r__typ, ((LONGINT)(0))); + Files_WriteLInt(&*r, r__typ, ((LONGINT)(0))); + Files_Write(&*r, r__typ, eno); + if (eno == *Store__39_s->ecnt) { + *Store__39_s->ecnt += 1; + Files_WriteString(&*r, r__typ, (*Store__39_s->iden).mod, ((LONGINT)(32))); + Files_WriteString(&*r, r__typ, (*Store__39_s->iden).proc, ((LONGINT)(32))); + } + (*Store__39_s->msg).pos = pos; + org = Files_Pos(&*r, r__typ); + (*e->handle)(e, (void*)&*Store__39_s->msg, Texts_FileMsg__typ); + span = Files_Pos(&*r, r__typ) - org; + Files_WriteLInt(&r1, Files_Rider__typ, -span); + Files_WriteLInt(&r1, Files_Rider__typ, e->W); + Files_WriteLInt(&r1, Files_Rider__typ, e->H); +} + +void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T) +{ + Files_Rider r1; + Texts_Run u = NIL, un = NIL; + Texts_Elem e = NIL; + LONGINT org, pos, delta, hlen, rlen; + SHORTINT ecnt, fno, fcnt; + CHAR ch; + Texts_FileMsg msg; + Texts_IdentifyMsg iden; + CHAR mods[64][32], procs[64][32]; + Texts_FontsFont fnts[32]; + CHAR block[1024]; + struct Store__39 _s; + _s.ecnt = &ecnt; + _s.msg = &msg; + _s.iden = &iden; + _s.mods = (void*)mods; + _s.procs = (void*)procs; + _s.lnk = Store__39_s; + Store__39_s = &_s; + org = Files_Pos(&*r, r__typ); + msg.id = 1; + msg.r = *r; + Files_WriteLInt(&msg.r, Files_Rider__typ, ((LONGINT)(0))); + u = T->head->next; + pos = 0; + delta = 0; + fcnt = 1; + ecnt = 1; + while (u != T->head) { + if (__ISP(u, Texts_ElemDesc, 1)) { + iden.mod[0] = 0x00; + (*__GUARDP(u, Texts_ElemDesc, 1)->handle)(__GUARDP(u, Texts_ElemDesc, 1), (void*)&iden, Texts_IdentifyMsg__typ); + } else { + iden.mod[0] = 0x01; + } + if (iden.mod[0] != 0x00) { + fnts[__X(fcnt, ((LONGINT)(32)))] = u->fnt; + fno = 1; + while (__STRCMP(fnts[__X(fno, ((LONGINT)(32)))]->name, u->fnt->name) != 0) { + fno += 1; + } + Files_Write(&msg.r, Files_Rider__typ, fno); + if (fno == fcnt) { + fcnt += 1; + Files_WriteString(&msg.r, Files_Rider__typ, u->fnt->name, ((LONGINT)(32))); + } + Files_Write(&msg.r, Files_Rider__typ, u->col); + Files_Write(&msg.r, Files_Rider__typ, u->voff); + } + if (__ISP(u, Texts_PieceDesc, 1)) { + rlen = u->len; + un = u->next; + while ((((((__ISP(un, Texts_PieceDesc, 1) && un->fnt == u->fnt)) && un->col == u->col)) && un->voff == u->voff)) { + rlen += un->len; + un = un->next; + } + Files_WriteLInt(&msg.r, Files_Rider__typ, rlen); + pos += rlen; + u = un; + } else if (iden.mod[0] != 0x00) { + StoreElem__40(&msg.r, Files_Rider__typ, pos, __GUARDP(u, Texts_ElemDesc, 1)); + pos += 1; + u = u->next; + } else { + delta += 1; + u = u->next; + } + } + Files_Write(&msg.r, Files_Rider__typ, 0); + Files_WriteLInt(&msg.r, Files_Rider__typ, T->len - delta); + hlen = (Files_Pos(&msg.r, Files_Rider__typ) - org) + 2; + Files_Set(&r1, Files_Rider__typ, Files_Base(&msg.r, Files_Rider__typ), org); + Files_WriteLInt(&r1, Files_Rider__typ, hlen); + u = T->head->next; + while (u != T->head) { + if (__ISP(u, Texts_PieceDesc, 1)) { + if (__ISP(u, Texts_PieceDesc, 1)) { + if (((Texts_Piece)u)->ascii) { + Files_Set(&r1, Files_Rider__typ, ((Texts_Piece)u)->file, ((Texts_Piece)u)->org); + delta = ((Texts_Piece)u)->len; + while (delta > 0) { + Files_Read(&r1, Files_Rider__typ, (void*)&ch); + delta -= 1; + if (ch == 0x0a) { + Files_Write(&msg.r, Files_Rider__typ, 0x0d); + } else { + Files_Write(&msg.r, Files_Rider__typ, ch); + } + } + } else { + Files_Set(&r1, Files_Rider__typ, ((Texts_Piece)u)->file, ((Texts_Piece)u)->org); + delta = ((Texts_Piece)u)->len; + while (delta > 1024) { + Files_ReadBytes(&r1, Files_Rider__typ, (void*)block, ((LONGINT)(1024)), ((LONGINT)(1024))); + Files_WriteBytes(&msg.r, Files_Rider__typ, (void*)block, ((LONGINT)(1024)), ((LONGINT)(1024))); + delta -= 1024; + } + Files_ReadBytes(&r1, Files_Rider__typ, (void*)block, ((LONGINT)(1024)), delta); + Files_WriteBytes(&msg.r, Files_Rider__typ, (void*)block, ((LONGINT)(1024)), delta); + } + } else __WITHCHK; + } else { + iden.mod[0] = 0x00; + (*__GUARDP(u, Texts_ElemDesc, 1)->handle)(__GUARDP(u, Texts_ElemDesc, 1), (void*)&iden, Texts_IdentifyMsg__typ); + if (iden.mod[0] != 0x00) { + Files_Write(&msg.r, Files_Rider__typ, 0x1c); + } + } + u = u->next; + } + __GUARDEQR(r, r__typ, Files_Rider) = msg.r; + if (T->notify != NIL) { + (*T->notify)(T, 3, ((LONGINT)(0)), ((LONGINT)(0))); + } + Store__39_s = _s.lnk; +} + +void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len) +{ + Files_File f = NIL; + Files_Rider r; + INTEGER i, res; + CHAR bak[64]; + __DUP(name, name__len, CHAR); + f = Files_New(name, name__len); + Files_Set(&r, Files_Rider__typ, f, ((LONGINT)(0))); + Files_Write(&r, Files_Rider__typ, 0xf0); + Files_Write(&r, Files_Rider__typ, 0x01); + Texts_Store(&r, Files_Rider__typ, T); + i = 0; + while (name[__X(i, name__len)] != 0x00) { + i += 1; + } + __COPY(name, bak, ((LONGINT)(64))); + bak[__X(i, ((LONGINT)(64)))] = '.'; + bak[__X(i + 1, ((LONGINT)(64)))] = 'B'; + bak[__X(i + 2, ((LONGINT)(64)))] = 'a'; + bak[__X(i + 3, ((LONGINT)(64)))] = 'k'; + bak[__X(i + 4, ((LONGINT)(64)))] = 0x00; + Files_Rename(name, name__len, bak, ((LONGINT)(64)), &res); + Files_Register(f); + __DEL(name); +} + +static void EnumPtrs(void (*P)(void*)) +{ + P(Texts_new); + P(Texts_del); + P(Texts_FontsDefault); +} + +__TDESC(Texts_FontDesc, 1, 0) = {__TDFLDS("FontDesc", 32), {-8}}; +__TDESC(Texts_RunDesc, 1, 3) = {__TDFLDS("RunDesc", 40), {0, 8, 24, -32}}; +__TDESC(Texts_PieceDesc, 1, 4) = {__TDFLDS("PieceDesc", 56), {0, 8, 24, 40, -40}}; +__TDESC(Texts_ElemMsg, 1, 0) = {__TDFLDS("ElemMsg", 1), {-8}}; +__TDESC(Texts_ElemDesc, 1, 4) = {__TDFLDS("ElemDesc", 72), {0, 8, 24, 64, -40}}; +__TDESC(Texts_FileMsg, 1, 1) = {__TDFLDS("FileMsg", 56), {32, -16}}; +__TDESC(Texts_CopyMsg, 1, 1) = {__TDFLDS("CopyMsg", 8), {0, -16}}; +__TDESC(Texts_IdentifyMsg, 1, 0) = {__TDFLDS("IdentifyMsg", 64), {-8}}; +__TDESC(Texts_BufDesc, 1, 1) = {__TDFLDS("BufDesc", 16), {8, -16}}; +__TDESC(Texts_TextDesc, 1, 2) = {__TDFLDS("TextDesc", 40), {16, 24, -24}}; +__TDESC(Texts_Reader, 1, 4) = {__TDFLDS("Reader", 96), {8, 24, 48, 72, -40}}; +__TDESC(Texts_Scanner, 1, 4) = {__TDFLDS("Scanner", 208), {8, 24, 48, 72, -40}}; +__TDESC(Texts_Writer, 1, 4) = {__TDFLDS("Writer", 72), {0, 8, 40, 64, -40}}; +__TDESC(Texts__1, 1, 5) = {__TDFLDS("", 160), {0, 8, 24, 64, 72, -48}}; + +export void *Texts__init(void) +{ + __DEFMOD; + __MODULE_IMPORT(Files); + __MODULE_IMPORT(Modules); + __MODULE_IMPORT(Reals); + __REGMOD("Texts", EnumPtrs); + __INITYP(Texts_FontDesc, Texts_FontDesc, 0); + __INITYP(Texts_RunDesc, Texts_RunDesc, 0); + __INITYP(Texts_PieceDesc, Texts_RunDesc, 1); + __INITYP(Texts_ElemMsg, Texts_ElemMsg, 0); + __INITYP(Texts_ElemDesc, Texts_RunDesc, 1); + __INITYP(Texts_FileMsg, Texts_ElemMsg, 1); + __INITYP(Texts_CopyMsg, Texts_ElemMsg, 1); + __INITYP(Texts_IdentifyMsg, Texts_ElemMsg, 1); + __INITYP(Texts_BufDesc, Texts_BufDesc, 0); + __INITYP(Texts_TextDesc, Texts_TextDesc, 0); + __INITYP(Texts_Reader, Texts_Reader, 0); + __INITYP(Texts_Scanner, Texts_Reader, 1); + __INITYP(Texts_Writer, Texts_Writer, 0); + __INITYP(Texts__1, Texts_ElemDesc, 2); +/* BEGIN */ + Texts_del = NIL; + __NEW(Texts_FontsDefault, Texts_FontDesc); + __MOVE("Syntax10.Scn.Fnt", Texts_FontsDefault->name, 17); + __ENDMOD; +} diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h new file mode 100644 index 00000000..d1805878 --- /dev/null +++ b/bootstrap/unix-88/Texts.h @@ -0,0 +1,173 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ + +#ifndef Texts__h +#define Texts__h + +#define LARGE +#include "SYSTEM.h" +#include "Files.h" + +typedef + struct Texts_BufDesc { + LONGINT len; + char _prvt0[8]; + } Texts_BufDesc; + +typedef + Texts_BufDesc *Texts_Buffer; + +typedef + struct Texts_ElemMsg { + char _prvt0[1]; + } Texts_ElemMsg; + +typedef + struct Texts_ElemDesc *Texts_Elem; + +typedef + struct Texts_CopyMsg { /* Texts_ElemMsg */ + Texts_Elem e; + } Texts_CopyMsg; + +typedef + struct Texts_RunDesc { + LONGINT _prvt0; + char _prvt1[27]; + } Texts_RunDesc; + +typedef + void (*Texts_Handler)(Texts_Elem, Texts_ElemMsg*, LONGINT *); + +typedef + struct Texts_ElemDesc { + char _prvt0[40]; + LONGINT W, H; + Texts_Handler handle; + char _prvt1[8]; + } Texts_ElemDesc; + +typedef + struct Texts_FileMsg { /* Texts_ElemMsg */ + INTEGER id; + LONGINT pos; + Files_Rider r; + } Texts_FileMsg; + +typedef + struct Texts_FontDesc { + char _prvt0[32]; + } Texts_FontDesc; + +typedef + Texts_FontDesc *Texts_FontsFont; + +typedef + struct Texts_IdentifyMsg { /* Texts_ElemMsg */ + CHAR mod[32], proc[32]; + } Texts_IdentifyMsg; + +typedef + struct Texts_TextDesc *Texts_Text; + +typedef + void (*Texts_Notifier)(Texts_Text, INTEGER, LONGINT, LONGINT); + +typedef + struct Texts_Reader { + BOOLEAN eot; + Texts_FontsFont fnt; + SHORTINT col, voff; + Texts_Elem elem; + char _prvt0[64]; + } Texts_Reader; + +typedef + struct Texts_Scanner { /* Texts_Reader */ + BOOLEAN eot; + Texts_FontsFont fnt; + SHORTINT col, voff; + Texts_Elem elem; + char _prvt0[64]; + CHAR nextCh; + INTEGER line, class; + LONGINT i; + REAL x; + LONGREAL y; + CHAR c; + SHORTINT len; + CHAR s[64]; + } Texts_Scanner; + +typedef + struct Texts_TextDesc { + LONGINT len; + Texts_Notifier notify; + char _prvt0[24]; + } Texts_TextDesc; + +typedef + struct Texts_Writer { + Texts_Buffer buf; + Texts_FontsFont fnt; + SHORTINT col, voff; + char _prvt0[54]; + } Texts_Writer; + + +import Texts_Elem Texts_new; + +import LONGINT *Texts_FontDesc__typ; +import LONGINT *Texts_RunDesc__typ; +import LONGINT *Texts_ElemMsg__typ; +import LONGINT *Texts_ElemDesc__typ; +import LONGINT *Texts_FileMsg__typ; +import LONGINT *Texts_CopyMsg__typ; +import LONGINT *Texts_IdentifyMsg__typ; +import LONGINT *Texts_BufDesc__typ; +import LONGINT *Texts_TextDesc__typ; +import LONGINT *Texts_Reader__typ; +import LONGINT *Texts_Scanner__typ; +import LONGINT *Texts_Writer__typ; + +import void Texts_Append (Texts_Text T, Texts_Buffer B); +import void Texts_ChangeLooks (Texts_Text T, LONGINT beg, LONGINT end, SET sel, Texts_FontsFont fnt, SHORTINT col, SHORTINT voff); +import void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len); +import void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); +import void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); +import void Texts_Delete (Texts_Text T, LONGINT beg, LONGINT end); +import Texts_Text Texts_ElemBase (Texts_Elem E); +import LONGINT Texts_ElemPos (Texts_Elem E); +import void Texts_Insert (Texts_Text T, LONGINT pos, Texts_Buffer B); +import void Texts_Load (Files_Rider *r, LONGINT *r__typ, Texts_Text T); +import void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len); +import void Texts_OpenBuf (Texts_Buffer B); +import void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, LONGINT pos); +import void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, LONGINT pos); +import void Texts_OpenWriter (Texts_Writer *W, LONGINT *W__typ); +import LONGINT Texts_Pos (Texts_Reader *R, LONGINT *R__typ); +import void Texts_Read (Texts_Reader *R, LONGINT *R__typ, CHAR *ch); +import void Texts_ReadElem (Texts_Reader *R, LONGINT *R__typ); +import void Texts_ReadPrevElem (Texts_Reader *R, LONGINT *R__typ); +import void Texts_Recall (Texts_Buffer *B); +import void Texts_Save (Texts_Text T, LONGINT beg, LONGINT end, Texts_Buffer B); +import void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ); +import void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, SHORTINT col); +import void Texts_SetFont (Texts_Writer *W, LONGINT *W__typ, Texts_FontsFont fnt); +import void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, SHORTINT voff); +import void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T); +import void Texts_Write (Texts_Writer *W, LONGINT *W__typ, CHAR ch); +import void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, LONGINT t, LONGINT d); +import void Texts_WriteElem (Texts_Writer *W, LONGINT *W__typ, Texts_Elem e); +import void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, LONGINT x); +import void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n); +import void Texts_WriteLn (Texts_Writer *W, LONGINT *W__typ); +import void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER n); +import void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x); +import void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n); +import void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n, INTEGER k); +import void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x); +import void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__len); +import void *Texts__init(void); + + +#endif diff --git a/bootstrap/unix-88/Vishap.c b/bootstrap/unix-88/Vishap.c new file mode 100644 index 00000000..d084e34a --- /dev/null +++ b/bootstrap/unix-88/Vishap.c @@ -0,0 +1,169 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkamSf */ +#define LARGE +#include "SYSTEM.h" +#include "Configuration.h" +#include "Heap.h" +#include "OPB.h" +#include "OPC.h" +#include "OPM.h" +#include "OPP.h" +#include "OPT.h" +#include "OPV.h" +#include "Platform.h" +#include "Strings.h" +#include "extTools.h" +#include "vt100.h" + + +static CHAR Vishap_mname[256]; + + +export void Vishap_Module (BOOLEAN *done); +static void Vishap_PropagateElementaryTypeSizes (void); +export void Vishap_Translate (void); +static void Vishap_Trap (INTEGER sig); + + +void Vishap_Module (BOOLEAN *done) +{ + BOOLEAN ext, new; + OPT_Node p = NIL; + OPP_Module(&p, OPM_opt); + if (OPM_noerr) { + OPV_Init(); + OPV_AdrAndSize(OPT_topScope); + OPT_Export(&ext, &new); + if (OPM_noerr) { + OPM_OpenFiles((void*)OPT_SelfName, ((LONGINT)(256))); + OPC_Init(); + OPV_Module(p); + if (OPM_noerr) { + if (((OPM_mainProg || OPM_mainLinkStat) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { + OPM_DeleteNewSym(); + if (!OPM_notColorOutput) { + vt100_SetAttr((CHAR*)"32m", (LONGINT)4); + } + OPM_LogWStr((CHAR*)" Main program.", (LONGINT)16); + if (!OPM_notColorOutput) { + vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + } + } else { + if (new) { + if (!OPM_notColorOutput) { + vt100_SetAttr((CHAR*)"32m", (LONGINT)4); + } + OPM_LogWStr((CHAR*)" New symbol file.", (LONGINT)19); + if (!OPM_notColorOutput) { + vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + } + OPM_RegisterNewSym(); + } else if (ext) { + OPM_LogWStr((CHAR*)" Extended symbol file.", (LONGINT)24); + OPM_RegisterNewSym(); + } + } + } else { + OPM_DeleteNewSym(); + } + } + } + OPM_CloseFiles(); + OPT_Close(); + OPM_LogWLn(); + *done = OPM_noerr; +} + +static void Vishap_PropagateElementaryTypeSizes (void) +{ + OPT_bytetyp->size = OPM_ByteSize; + OPT_sysptrtyp->size = OPM_PointerSize; + OPT_chartyp->size = OPM_CharSize; + OPT_settyp->size = OPM_SetSize; + OPT_realtyp->size = OPM_RealSize; + OPT_inttyp->size = OPM_IntSize; + OPT_linttyp->size = OPM_LIntSize; + OPT_lrltyp->size = OPM_LRealSize; + OPT_sinttyp->size = OPM_SIntSize; + OPT_booltyp->size = OPM_BoolSize; +} + +void Vishap_Translate (void) +{ + BOOLEAN done; + CHAR modulesobj[2048]; + modulesobj[0] = 0x00; + if (OPM_OpenPar()) { + for (;;) { + OPM_Init(&done, (void*)Vishap_mname, ((LONGINT)(256))); + if (!done) { + return; + } + OPM_InitOptions(); + Vishap_PropagateElementaryTypeSizes(); + Heap_GC(0); + Vishap_Module(&done); + if (!done) { + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Module compilation failed.", (LONGINT)27); + OPM_LogWLn(); + Platform_Exit(1); + } + if (!OPM_dontAsm) { + if (OPM_dontLink) { + extTools_Assemble(OPM_modName, ((LONGINT)(32))); + } else { + if (!(OPM_mainProg || OPM_mainLinkStat)) { + extTools_Assemble(OPM_modName, ((LONGINT)(32))); + Strings_Append((CHAR*)" ", (LONGINT)2, (void*)modulesobj, ((LONGINT)(2048))); + Strings_Append(OPM_modName, ((LONGINT)(32)), (void*)modulesobj, ((LONGINT)(2048))); + Strings_Append((CHAR*)".o", (LONGINT)3, (void*)modulesobj, ((LONGINT)(2048))); + } else { + extTools_LinkMain((void*)OPM_modName, ((LONGINT)(32)), OPM_mainLinkStat, modulesobj, ((LONGINT)(2048))); + } + } + } + } + } +} + +static void Vishap_Trap (INTEGER sig) +{ + Heap_FINALL(); + if (sig == 3) { + Platform_Exit(0); + } else { + if ((sig == 4 && Platform_HaltCode == -15)) { + OPM_LogWStr((CHAR*)" --- Vishap Oberon: internal error", (LONGINT)35); + OPM_LogWLn(); + } + Platform_Exit(2); + } +} + + +export int main(int argc, char **argv) +{ + __INIT(argc, argv); + __MODULE_IMPORT(Configuration); + __MODULE_IMPORT(Heap); + __MODULE_IMPORT(OPB); + __MODULE_IMPORT(OPC); + __MODULE_IMPORT(OPM); + __MODULE_IMPORT(OPP); + __MODULE_IMPORT(OPT); + __MODULE_IMPORT(OPV); + __MODULE_IMPORT(Platform); + __MODULE_IMPORT(Strings); + __MODULE_IMPORT(extTools); + __MODULE_IMPORT(vt100); + __REGMAIN("Vishap", 0); + __REGCMD("Translate", Vishap_Translate); +/* BEGIN */ + Platform_SetInterruptHandler(Vishap_Trap); + Platform_SetQuitHandler(Vishap_Trap); + Platform_SetBadInstructionHandler(Vishap_Trap); + OPB_typSize = OPV_TypSize; + OPT_typSize = OPV_TypSize; + Vishap_Translate(); + __FINI; +} diff --git a/bootstrap/unix-88/WindowsWrapper.h b/bootstrap/unix-88/WindowsWrapper.h new file mode 100644 index 00000000..cdb8714c --- /dev/null +++ b/bootstrap/unix-88/WindowsWrapper.h @@ -0,0 +1,9 @@ +// WindowsWrapper.h +// +// Includes Windows.h while avoiding conflicts with Oberon types. + +#undef BOOLEAN +#undef CHAR +#include +#define BOOLEAN char +#define CHAR unsigned char diff --git a/bootstrap/unix-88/errors.c b/bootstrap/unix-88/errors.c new file mode 100644 index 00000000..879f5cf7 --- /dev/null +++ b/bootstrap/unix-88/errors.c @@ -0,0 +1,199 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +#define LARGE +#include "SYSTEM.h" + +typedef + CHAR errors_string[128]; + + +export errors_string errors_errors[350]; + + + + + +export void *errors__init(void) +{ + __DEFMOD; + __REGMOD("errors", 0); +/* BEGIN */ + __MOVE("undeclared identifier", errors_errors[0], 22); + __MOVE("multiply defined identifier", errors_errors[1], 28); + __MOVE("illegal character in number", errors_errors[2], 28); + __MOVE("illegal character in string", errors_errors[3], 28); + __MOVE("identifier does not match procedure name", errors_errors[4], 41); + __MOVE("comment not closed", errors_errors[5], 19); + errors_errors[6][0] = 0x00; + errors_errors[7][0] = 0x00; + errors_errors[8][0] = 0x00; + __MOVE("\'=\' expected", errors_errors[9], 13); + errors_errors[10][0] = 0x00; + errors_errors[11][0] = 0x00; + __MOVE("type definition starts with incorrect symbol", errors_errors[12], 45); + __MOVE("factor starts with incorrect symbol", errors_errors[13], 36); + __MOVE("statement starts with incorrect symbol", errors_errors[14], 39); + __MOVE("declaration followed by incorrect symbol", errors_errors[15], 41); + __MOVE("MODULE expected", errors_errors[16], 16); + errors_errors[17][0] = 0x00; + __MOVE("\'.\' missing", errors_errors[18], 12); + __MOVE("\',\' missing", errors_errors[19], 12); + __MOVE("\':\' missing", errors_errors[20], 12); + errors_errors[21][0] = 0x00; + __MOVE("\')\' missing", errors_errors[22], 12); + __MOVE("\']\' missing", errors_errors[23], 12); + __MOVE("\'}\' missing", errors_errors[24], 12); + __MOVE("OF missing", errors_errors[25], 11); + __MOVE("THEN missing", errors_errors[26], 13); + __MOVE("DO missing", errors_errors[27], 11); + __MOVE("TO missing", errors_errors[28], 11); + errors_errors[29][0] = 0x00; + __MOVE("\'(\' missing", errors_errors[30], 12); + errors_errors[31][0] = 0x00; + errors_errors[32][0] = 0x00; + errors_errors[33][0] = 0x00; + __MOVE("\':=\' missing", errors_errors[34], 13); + __MOVE("\',\' or OF expected", errors_errors[35], 19); + errors_errors[36][0] = 0x00; + errors_errors[37][0] = 0x00; + __MOVE("identifier expected", errors_errors[38], 20); + __MOVE("\';\' missing", errors_errors[39], 12); + errors_errors[40][0] = 0x00; + __MOVE("END missing", errors_errors[41], 12); + errors_errors[42][0] = 0x00; + errors_errors[43][0] = 0x00; + __MOVE("UNTIL missing", errors_errors[44], 14); + errors_errors[45][0] = 0x00; + __MOVE("EXIT not within loop statement", errors_errors[46], 31); + __MOVE("illegally marked identifier", errors_errors[47], 28); + errors_errors[48][0] = 0x00; + errors_errors[49][0] = 0x00; + __MOVE("expression should be constant", errors_errors[50], 30); + __MOVE("constant not an integer", errors_errors[51], 24); + __MOVE("identifier does not denote a type", errors_errors[52], 34); + __MOVE("identifier does not denote a record type", errors_errors[53], 41); + __MOVE("result type of procedure is not a basic type", errors_errors[54], 45); + __MOVE("procedure call of a function", errors_errors[55], 29); + __MOVE("assignment to non-variable", errors_errors[56], 27); + __MOVE("pointer not bound to record or array type", errors_errors[57], 42); + __MOVE("recursive type definition", errors_errors[58], 26); + __MOVE("illegal open array parameter", errors_errors[59], 29); + __MOVE("wrong type of case label", errors_errors[60], 25); + __MOVE("inadmissible type of case label", errors_errors[61], 32); + __MOVE("case label defined more than once", errors_errors[62], 34); + __MOVE("illegal value of constant", errors_errors[63], 26); + __MOVE("more actual than formal parameters", errors_errors[64], 35); + __MOVE("fewer actual than formal parameters", errors_errors[65], 36); + __MOVE("element types of actual array and formal open array differ", errors_errors[66], 59); + __MOVE("actual parameter corresponding to open array is not an array", errors_errors[67], 61); + __MOVE("control variable must be integer", errors_errors[68], 33); + __MOVE("parameter must be an integer constant", errors_errors[69], 38); + __MOVE("pointer or VAR record required as formal receiver", errors_errors[70], 50); + __MOVE("pointer expected as actual receiver", errors_errors[71], 36); + __MOVE("procedure must be bound to a record of the same scope", errors_errors[72], 54); + __MOVE("procedure must have level 0", errors_errors[73], 28); + __MOVE("procedure unknown in base type", errors_errors[74], 31); + __MOVE("invalid call of base procedure", errors_errors[75], 31); + __MOVE("this variable (field) is read only", errors_errors[76], 35); + __MOVE("object is not a record", errors_errors[77], 23); + __MOVE("dereferenced object is not a variable", errors_errors[78], 38); + __MOVE("indexed object is not a variable", errors_errors[79], 33); + __MOVE("index expression is not an integer", errors_errors[80], 35); + __MOVE("index out of specified bounds", errors_errors[81], 30); + __MOVE("indexed variable is not an array", errors_errors[82], 33); + __MOVE("undefined record field", errors_errors[83], 23); + __MOVE("dereferenced variable is not a pointer", errors_errors[84], 39); + __MOVE("guard or test type is not an extension of variable type", errors_errors[85], 56); + __MOVE("guard or testtype is not a pointer", errors_errors[86], 35); + __MOVE("guarded or tested variable is neither a pointer nor a VAR-parameter record", errors_errors[87], 75); + __MOVE("open array not allowed as variable, record field or array element", errors_errors[88], 66); + errors_errors[89][0] = 0x00; + errors_errors[90][0] = 0x00; + errors_errors[91][0] = 0x00; + __MOVE("operand of IN not an integer, or not a set", errors_errors[92], 43); + __MOVE("set element type is not an integer", errors_errors[93], 35); + __MOVE("operand of & is not of type BOOLEAN", errors_errors[94], 36); + __MOVE("operand of OR is not of type BOOLEAN", errors_errors[95], 37); + __MOVE("operand not applicable to (unary) +", errors_errors[96], 36); + __MOVE("operand not applicable to (unary) -", errors_errors[97], 36); + __MOVE("operand of ~ is not of type BOOLEAN", errors_errors[98], 36); + __MOVE("ASSERT fault", errors_errors[99], 13); + __MOVE("incompatible operands of dyadic operator", errors_errors[100], 41); + __MOVE("operand type inapplicable to *", errors_errors[101], 31); + __MOVE("operand type inapplicable to /", errors_errors[102], 31); + __MOVE("operand type inapplicable to DIV", errors_errors[103], 33); + __MOVE("operand type inapplicable to MOD", errors_errors[104], 33); + __MOVE("operand type inapplicable to +", errors_errors[105], 31); + __MOVE("operand type inapplicable to -", errors_errors[106], 31); + __MOVE("operand type inapplicable to = or #", errors_errors[107], 36); + __MOVE("operand type inapplicable to relation", errors_errors[108], 38); + __MOVE("overriding method must be exported", errors_errors[109], 35); + __MOVE("operand is not a type", errors_errors[110], 22); + __MOVE("operand inapplicable to (this) function", errors_errors[111], 40); + __MOVE("operand is not a variable", errors_errors[112], 26); + __MOVE("incompatible assignment", errors_errors[113], 24); + __MOVE("string too long to be assigned", errors_errors[114], 31); + __MOVE("parameter doesn\'t match", errors_errors[115], 24); + __MOVE("number of parameters doesn\'t match", errors_errors[116], 35); + __MOVE("result type doesn\'t match", errors_errors[117], 26); + __MOVE("export mark doesn\'t match with forward declaration", errors_errors[118], 51); + __MOVE("redefinition textually precedes procedure bound to base type", errors_errors[119], 61); + __MOVE("type of expression following IF, WHILE, UNTIL or ASSERT is not BOOLEAN", errors_errors[120], 71); + __MOVE("called object is not a procedure (or is an interrupt procedure)", errors_errors[121], 64); + __MOVE("actual VAR-parameter is not a variable", errors_errors[122], 39); + __MOVE("type of actual parameter is not identical with that of formal VAR-parameter", errors_errors[123], 76); + __MOVE("type of result expression differs from that of procedure", errors_errors[124], 57); + __MOVE("type of case expression is neither INTEGER nor CHAR", errors_errors[125], 52); + __MOVE("this expression cannot be a type or a procedure", errors_errors[126], 48); + __MOVE("illegal use of object", errors_errors[127], 22); + __MOVE("unsatisfied forward reference", errors_errors[128], 30); + __MOVE("unsatisfied forward procedure", errors_errors[129], 30); + __MOVE("WITH clause does not specify a variable", errors_errors[130], 40); + __MOVE("LEN not applied to array", errors_errors[131], 25); + __MOVE("dimension in LEN too large or negative", errors_errors[132], 39); + __MOVE("SYSTEM not imported", errors_errors[135], 20); + __MOVE("key inconsistency of imported module", errors_errors[150], 37); + __MOVE("incorrect symbol file", errors_errors[151], 22); + __MOVE("symbol file of imported module not found", errors_errors[152], 41); + __MOVE("object or symbol file not opened (disk full\?)", errors_errors[153], 46); + __MOVE("recursive import not allowed", errors_errors[154], 29); + __MOVE("generation of new symbol file not allowed", errors_errors[155], 42); + __MOVE("parameter file not found", errors_errors[156], 25); + __MOVE("syntax error in parameter file", errors_errors[157], 31); + __MOVE("not yet implemented", errors_errors[200], 20); + __MOVE("lower bound of set range greater than higher bound", errors_errors[201], 51); + __MOVE("set element greater than MAX(SET) or less than 0", errors_errors[202], 49); + __MOVE("number too large", errors_errors[203], 17); + __MOVE("product too large", errors_errors[204], 18); + __MOVE("division by zero", errors_errors[205], 17); + __MOVE("sum too large", errors_errors[206], 14); + __MOVE("difference too large", errors_errors[207], 21); + __MOVE("overflow in arithmetic shift", errors_errors[208], 29); + __MOVE("case range too large", errors_errors[209], 21); + __MOVE("too many cases in case statement", errors_errors[213], 33); + __MOVE("illegal value of parameter (0 <= p < 256)", errors_errors[218], 42); + __MOVE("machine registers cannot be accessed", errors_errors[219], 37); + __MOVE("illegal value of parameter", errors_errors[220], 27); + __MOVE("too many pointers in a record", errors_errors[221], 30); + __MOVE("too many global pointers", errors_errors[222], 25); + __MOVE("too many record types", errors_errors[223], 22); + __MOVE("too many pointer types", errors_errors[224], 23); + __MOVE("address of pointer variable too large (move forward in text)", errors_errors[225], 61); + __MOVE("too many exported procedures", errors_errors[226], 29); + __MOVE("too many imported modules", errors_errors[227], 26); + __MOVE("too many exported structures", errors_errors[228], 29); + __MOVE("too many nested records for import", errors_errors[229], 35); + __MOVE("too many constants (strings) in module", errors_errors[230], 39); + __MOVE("too many link table entries (external procedures)", errors_errors[231], 50); + __MOVE("too many commands in module", errors_errors[232], 28); + __MOVE("record extension hierarchy too high", errors_errors[233], 36); + __MOVE("export of recursive type not allowed", errors_errors[234], 37); + __MOVE("identifier too long", errors_errors[240], 20); + __MOVE("string too long", errors_errors[241], 16); + __MOVE("address overflow", errors_errors[242], 17); + __MOVE("cyclic type definition not allowed", errors_errors[244], 35); + __MOVE("guarded pointer variable may be manipulated by non-local operations; use auxiliary pointer variable", errors_errors[245], 100); + __MOVE("implicit type cast", errors_errors[301], 19); + __MOVE("inappropriate symbol file ignored", errors_errors[306], 34); + __MOVE("no ELSE symbol after CASE statement sequence may lead to trap", errors_errors[307], 62); + __ENDMOD; +} diff --git a/bootstrap/unix-88/errors.h b/bootstrap/unix-88/errors.h new file mode 100644 index 00000000..43cd79a9 --- /dev/null +++ b/bootstrap/unix-88/errors.h @@ -0,0 +1,19 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ + +#ifndef errors__h +#define errors__h + +#define LARGE +#include "SYSTEM.h" + +typedef + CHAR errors_string[128]; + + +import errors_string errors_errors[350]; + + +import void *errors__init(void); + + +#endif diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c new file mode 100644 index 00000000..7d1a2da9 --- /dev/null +++ b/bootstrap/unix-88/extTools.c @@ -0,0 +1,113 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +#define LARGE +#include "SYSTEM.h" +#include "Configuration.h" +#include "Console.h" +#include "OPM.h" +#include "Platform.h" +#include "Strings.h" + + +static CHAR extTools_compilationOptions[1023], extTools_CFLAGS[1023]; + + +export void extTools_Assemble (CHAR *moduleName, LONGINT moduleName__len); +export void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN statically, CHAR *additionalopts, LONGINT additionalopts__len); +static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGINT cmd__len); + + +static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGINT cmd__len) +{ + INTEGER r, status, exitcode; + __DUP(title, title__len, CHAR); + __DUP(cmd, cmd__len, CHAR); + if (OPM_Verbose) { + Console_String(title, title__len); + Console_String(cmd, cmd__len); + Console_Ln(); + } + r = Platform_System(cmd, cmd__len); + status = __MASK(r, -128); + exitcode = __ASHR(r, 8); + if (exitcode > 127) { + exitcode = exitcode - 256; + } + if (r != 0) { + Console_String(title, title__len); + Console_String(cmd, cmd__len); + Console_Ln(); + Console_String((CHAR*)"-- failed: status ", (LONGINT)19); + Console_Int(status, ((LONGINT)(1))); + Console_String((CHAR*)", exitcode ", (LONGINT)12); + Console_Int(exitcode, ((LONGINT)(1))); + Console_String((CHAR*)".", (LONGINT)2); + Console_Ln(); + if ((status == 0 && exitcode == 127)) { + Console_String((CHAR*)"Is the C compiler in the current command path\?", (LONGINT)47); + Console_Ln(); + } + if (status != 0) { + Platform_Halt(status); + } else { + Platform_Halt(exitcode); + } + } + __DEL(title); + __DEL(cmd); +} + +void extTools_Assemble (CHAR *moduleName, LONGINT moduleName__len) +{ + CHAR cmd[1023]; + __DUP(moduleName, moduleName__len, CHAR); + __MOVE("gcc -g", cmd, 7); + Strings_Append(extTools_compilationOptions, ((LONGINT)(1023)), (void*)cmd, ((LONGINT)(1023))); + Strings_Append((CHAR*)"-c ", (LONGINT)4, (void*)cmd, ((LONGINT)(1023))); + Strings_Append(moduleName, moduleName__len, (void*)cmd, ((LONGINT)(1023))); + Strings_Append((CHAR*)".c", (LONGINT)3, (void*)cmd, ((LONGINT)(1023))); + extTools_execute((CHAR*)"Assemble: ", (LONGINT)11, cmd, ((LONGINT)(1023))); + __DEL(moduleName); +} + +void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN statically, CHAR *additionalopts, LONGINT additionalopts__len) +{ + CHAR cmd[1023]; + __DUP(additionalopts, additionalopts__len, CHAR); + __MOVE("gcc -g", cmd, 7); + Strings_Append((CHAR*)" ", (LONGINT)2, (void*)cmd, ((LONGINT)(1023))); + Strings_Append(extTools_compilationOptions, ((LONGINT)(1023)), (void*)cmd, ((LONGINT)(1023))); + Strings_Append(moduleName, moduleName__len, (void*)cmd, ((LONGINT)(1023))); + Strings_Append((CHAR*)".c ", (LONGINT)4, (void*)cmd, ((LONGINT)(1023))); + Strings_Append(additionalopts, additionalopts__len, (void*)cmd, ((LONGINT)(1023))); + if (statically) { + Strings_Append((CHAR*)"-static", (LONGINT)8, (void*)cmd, ((LONGINT)(1023))); + } + Strings_Append((CHAR*)" -o ", (LONGINT)5, (void*)cmd, ((LONGINT)(1023))); + Strings_Append(moduleName, moduleName__len, (void*)cmd, ((LONGINT)(1023))); + Strings_Append((CHAR*)" -L\"", (LONGINT)5, (void*)cmd, ((LONGINT)(1023))); + Strings_Append((CHAR*)"/opt/voc", (LONGINT)9, (void*)cmd, ((LONGINT)(1023))); + Strings_Append((CHAR*)"/lib\"", (LONGINT)6, (void*)cmd, ((LONGINT)(1023))); + Strings_Append((CHAR*)" -l voc", (LONGINT)8, (void*)cmd, ((LONGINT)(1023))); + extTools_execute((CHAR*)"Assemble and link: ", (LONGINT)20, cmd, ((LONGINT)(1023))); + __DEL(additionalopts); +} + + +export void *extTools__init(void) +{ + __DEFMOD; + __MODULE_IMPORT(Configuration); + __MODULE_IMPORT(Console); + __MODULE_IMPORT(OPM); + __MODULE_IMPORT(Platform); + __MODULE_IMPORT(Strings); + __REGMOD("extTools", 0); +/* BEGIN */ + Strings_Append((CHAR*)" -I \"", (LONGINT)6, (void*)extTools_compilationOptions, ((LONGINT)(1023))); + Strings_Append((CHAR*)"/opt/voc", (LONGINT)9, (void*)extTools_compilationOptions, ((LONGINT)(1023))); + Strings_Append((CHAR*)"/include\" ", (LONGINT)11, (void*)extTools_compilationOptions, ((LONGINT)(1023))); + Platform_GetEnv((CHAR*)"CFLAGS", (LONGINT)7, (void*)extTools_CFLAGS, ((LONGINT)(1023))); + Strings_Append(extTools_CFLAGS, ((LONGINT)(1023)), (void*)extTools_compilationOptions, ((LONGINT)(1023))); + Strings_Append((CHAR*)" ", (LONGINT)2, (void*)extTools_compilationOptions, ((LONGINT)(1023))); + __ENDMOD; +} diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h new file mode 100644 index 00000000..61ca56e4 --- /dev/null +++ b/bootstrap/unix-88/extTools.h @@ -0,0 +1,17 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ + +#ifndef extTools__h +#define extTools__h + +#define LARGE +#include "SYSTEM.h" + + + + +import void extTools_Assemble (CHAR *moduleName, LONGINT moduleName__len); +import void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN statically, CHAR *additionalopts, LONGINT additionalopts__len); +import void *extTools__init(void); + + +#endif diff --git a/bootstrap/unix-88/vt100.c b/bootstrap/unix-88/vt100.c new file mode 100644 index 00000000..88c386a8 --- /dev/null +++ b/bootstrap/unix-88/vt100.c @@ -0,0 +1,259 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +#define LARGE +#include "SYSTEM.h" +#include "Console.h" +#include "Strings.h" + + +export CHAR vt100_CSI[5]; +static CHAR vt100_tmpstr[32]; + + +export void vt100_CHA (INTEGER n); +export void vt100_CNL (INTEGER n); +export void vt100_CPL (INTEGER n); +export void vt100_CUB (INTEGER n); +export void vt100_CUD (INTEGER n); +export void vt100_CUF (INTEGER n); +export void vt100_CUP (INTEGER n, INTEGER m); +export void vt100_CUU (INTEGER n); +export void vt100_DECTCEMh (void); +export void vt100_DECTCEMl (void); +export void vt100_DSR (INTEGER n); +export void vt100_ED (INTEGER n); +export void vt100_EL (INTEGER n); +static void vt100_EscSeq (INTEGER n, CHAR *letter, LONGINT letter__len); +static void vt100_EscSeq0 (CHAR *letter, LONGINT letter__len); +static void vt100_EscSeq2 (INTEGER n, INTEGER m, CHAR *letter, LONGINT letter__len); +static void vt100_EscSeqSwapped (INTEGER n, CHAR *letter, LONGINT letter__len); +export void vt100_HVP (INTEGER n, INTEGER m); +export void vt100_IntToStr (LONGINT int_, CHAR *str, LONGINT str__len); +export void vt100_RCP (void); +static void vt100_Reverse0 (CHAR *str, LONGINT str__len, INTEGER start, INTEGER end); +export void vt100_SCP (void); +export void vt100_SD (INTEGER n); +export void vt100_SGR (INTEGER n); +export void vt100_SGR2 (INTEGER n, INTEGER m); +export void vt100_SU (INTEGER n); +export void vt100_SetAttr (CHAR *attr, LONGINT attr__len); + + +static void vt100_Reverse0 (CHAR *str, LONGINT str__len, INTEGER start, INTEGER end) +{ + CHAR h; + while (start < end) { + h = str[__X(start, str__len)]; + str[__X(start, str__len)] = str[__X(end, str__len)]; + str[__X(end, str__len)] = h; + start += 1; + end -= 1; + } +} + +void vt100_IntToStr (LONGINT int_, CHAR *str, LONGINT str__len) +{ + CHAR b[21]; + INTEGER s, e; + SHORTINT maxLength; + maxLength = 20; + if (int_ == (-9223372036854775807-1)) { + __MOVE("-9223372036854775808", b, 21); + e = 20; + } else { + if (int_ < 0) { + b[0] = '-'; + int_ = -int_; + s = 1; + } else { + s = 0; + } + e = s; + do { + b[__X(e, ((LONGINT)(21)))] = (CHAR)(__MOD(int_, 10) + 48); + int_ = __DIV(int_, 10); + e += 1; + } while (!(int_ == 0)); + b[__X(e, ((LONGINT)(21)))] = 0x00; + vt100_Reverse0((void*)b, ((LONGINT)(21)), s, e - 1); + } + __COPY(b, str, str__len); +} + +static void vt100_EscSeq0 (CHAR *letter, LONGINT letter__len) +{ + CHAR cmd[9]; + __DUP(letter, letter__len, CHAR); + __COPY(vt100_CSI, cmd, ((LONGINT)(9))); + Strings_Append(letter, letter__len, (void*)cmd, ((LONGINT)(9))); + Console_String(cmd, ((LONGINT)(9))); + __DEL(letter); +} + +static void vt100_EscSeq (INTEGER n, CHAR *letter, LONGINT letter__len) +{ + CHAR nstr[2]; + CHAR cmd[7]; + __DUP(letter, letter__len, CHAR); + vt100_IntToStr(n, (void*)nstr, ((LONGINT)(2))); + __COPY(vt100_CSI, cmd, ((LONGINT)(7))); + Strings_Append(nstr, ((LONGINT)(2)), (void*)cmd, ((LONGINT)(7))); + Strings_Append(letter, letter__len, (void*)cmd, ((LONGINT)(7))); + Console_String(cmd, ((LONGINT)(7))); + __DEL(letter); +} + +static void vt100_EscSeqSwapped (INTEGER n, CHAR *letter, LONGINT letter__len) +{ + CHAR nstr[2]; + CHAR cmd[7]; + __DUP(letter, letter__len, CHAR); + vt100_IntToStr(n, (void*)nstr, ((LONGINT)(2))); + __COPY(vt100_CSI, cmd, ((LONGINT)(7))); + Strings_Append(letter, letter__len, (void*)cmd, ((LONGINT)(7))); + Strings_Append(nstr, ((LONGINT)(2)), (void*)cmd, ((LONGINT)(7))); + Console_String(cmd, ((LONGINT)(7))); + __DEL(letter); +} + +static void vt100_EscSeq2 (INTEGER n, INTEGER m, CHAR *letter, LONGINT letter__len) +{ + CHAR nstr[5], mstr[5]; + CHAR cmd[12]; + __DUP(letter, letter__len, CHAR); + vt100_IntToStr(n, (void*)nstr, ((LONGINT)(5))); + vt100_IntToStr(m, (void*)mstr, ((LONGINT)(5))); + __COPY(vt100_CSI, cmd, ((LONGINT)(12))); + Strings_Append(nstr, ((LONGINT)(5)), (void*)cmd, ((LONGINT)(12))); + Strings_Append((CHAR*)";", (LONGINT)2, (void*)cmd, ((LONGINT)(12))); + Strings_Append(mstr, ((LONGINT)(5)), (void*)cmd, ((LONGINT)(12))); + Strings_Append(letter, letter__len, (void*)cmd, ((LONGINT)(12))); + Console_String(cmd, ((LONGINT)(12))); + __DEL(letter); +} + +void vt100_CUU (INTEGER n) +{ + vt100_EscSeq(n, (CHAR*)"A", (LONGINT)2); +} + +void vt100_CUD (INTEGER n) +{ + vt100_EscSeq(n, (CHAR*)"B", (LONGINT)2); +} + +void vt100_CUF (INTEGER n) +{ + vt100_EscSeq(n, (CHAR*)"C", (LONGINT)2); +} + +void vt100_CUB (INTEGER n) +{ + vt100_EscSeq(n, (CHAR*)"D", (LONGINT)2); +} + +void vt100_CNL (INTEGER n) +{ + vt100_EscSeq(n, (CHAR*)"E", (LONGINT)2); +} + +void vt100_CPL (INTEGER n) +{ + vt100_EscSeq(n, (CHAR*)"F", (LONGINT)2); +} + +void vt100_CHA (INTEGER n) +{ + vt100_EscSeq(n, (CHAR*)"G", (LONGINT)2); +} + +void vt100_CUP (INTEGER n, INTEGER m) +{ + vt100_EscSeq2(n, m, (CHAR*)"H", (LONGINT)2); +} + +void vt100_ED (INTEGER n) +{ + vt100_EscSeq(n, (CHAR*)"J", (LONGINT)2); +} + +void vt100_EL (INTEGER n) +{ + vt100_EscSeq(n, (CHAR*)"K", (LONGINT)2); +} + +void vt100_SU (INTEGER n) +{ + vt100_EscSeq(n, (CHAR*)"S", (LONGINT)2); +} + +void vt100_SD (INTEGER n) +{ + vt100_EscSeq(n, (CHAR*)"T", (LONGINT)2); +} + +void vt100_HVP (INTEGER n, INTEGER m) +{ + vt100_EscSeq2(n, m, (CHAR*)"f", (LONGINT)2); +} + +void vt100_SGR (INTEGER n) +{ + vt100_EscSeq(n, (CHAR*)"m", (LONGINT)2); +} + +void vt100_SGR2 (INTEGER n, INTEGER m) +{ + vt100_EscSeq2(n, m, (CHAR*)"m", (LONGINT)2); +} + +void vt100_DSR (INTEGER n) +{ + vt100_EscSeq(6, (CHAR*)"n", (LONGINT)2); +} + +void vt100_SCP (void) +{ + vt100_EscSeq0((CHAR*)"s", (LONGINT)2); +} + +void vt100_RCP (void) +{ + vt100_EscSeq0((CHAR*)"u", (LONGINT)2); +} + +void vt100_DECTCEMl (void) +{ + vt100_EscSeq0((CHAR*)"\?25l", (LONGINT)5); +} + +void vt100_DECTCEMh (void) +{ + vt100_EscSeq0((CHAR*)"\?25h", (LONGINT)5); +} + +void vt100_SetAttr (CHAR *attr, LONGINT attr__len) +{ + CHAR tmpstr[16]; + __DUP(attr, attr__len, CHAR); + __COPY(vt100_CSI, tmpstr, ((LONGINT)(16))); + Strings_Append(attr, attr__len, (void*)tmpstr, ((LONGINT)(16))); + Console_String(tmpstr, ((LONGINT)(16))); + __DEL(attr); +} + + +export void *vt100__init(void) +{ + __DEFMOD; + __MODULE_IMPORT(Console); + __MODULE_IMPORT(Strings); + __REGMOD("vt100", 0); + __REGCMD("DECTCEMh", vt100_DECTCEMh); + __REGCMD("DECTCEMl", vt100_DECTCEMl); + __REGCMD("RCP", vt100_RCP); + __REGCMD("SCP", vt100_SCP); +/* BEGIN */ + __COPY("", vt100_CSI, ((LONGINT)(5))); + Strings_Append((CHAR*)"[", (LONGINT)2, (void*)vt100_CSI, ((LONGINT)(5))); + __ENDMOD; +} diff --git a/bootstrap/unix-88/vt100.h b/bootstrap/unix-88/vt100.h new file mode 100644 index 00000000..b124915f --- /dev/null +++ b/bootstrap/unix-88/vt100.h @@ -0,0 +1,38 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ + +#ifndef vt100__h +#define vt100__h + +#define LARGE +#include "SYSTEM.h" + + +import CHAR vt100_CSI[5]; + + +import void vt100_CHA (INTEGER n); +import void vt100_CNL (INTEGER n); +import void vt100_CPL (INTEGER n); +import void vt100_CUB (INTEGER n); +import void vt100_CUD (INTEGER n); +import void vt100_CUF (INTEGER n); +import void vt100_CUP (INTEGER n, INTEGER m); +import void vt100_CUU (INTEGER n); +import void vt100_DECTCEMh (void); +import void vt100_DECTCEMl (void); +import void vt100_DSR (INTEGER n); +import void vt100_ED (INTEGER n); +import void vt100_EL (INTEGER n); +import void vt100_HVP (INTEGER n, INTEGER m); +import void vt100_IntToStr (LONGINT int_, CHAR *str, LONGINT str__len); +import void vt100_RCP (void); +import void vt100_SCP (void); +import void vt100_SD (INTEGER n); +import void vt100_SGR (INTEGER n); +import void vt100_SGR2 (INTEGER n, INTEGER m); +import void vt100_SU (INTEGER n); +import void vt100_SetAttr (CHAR *attr, LONGINT attr__len); +import void *vt100__init(void); + + +#endif diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c new file mode 100644 index 00000000..a1992033 --- /dev/null +++ b/bootstrap/windows-48/Configuration.c @@ -0,0 +1,16 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +#include "SYSTEM.h" + + + + + + + +export void *Configuration__init(void) +{ + __DEFMOD; + __REGMOD("Configuration", 0); +/* BEGIN */ + __ENDMOD; +} diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h new file mode 100644 index 00000000..e7aed50a --- /dev/null +++ b/bootstrap/windows-48/Configuration.h @@ -0,0 +1,14 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ + +#ifndef Configuration__h +#define Configuration__h + +#include "SYSTEM.h" + + + + +import void *Configuration__init(void); + + +#endif diff --git a/bootstrap/windows-48/Console.c b/bootstrap/windows-48/Console.c new file mode 100644 index 00000000..2f8e5f21 --- /dev/null +++ b/bootstrap/windows-48/Console.c @@ -0,0 +1,150 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +#include "SYSTEM.h" +#include "Platform.h" + + +static CHAR Console_line[128]; +static INTEGER Console_pos; + + +export void Console_Bool (BOOLEAN b); +export void Console_Char (CHAR ch); +export void Console_Flush (void); +export void Console_Hex (LONGINT i); +export void Console_Int (LONGINT i, LONGINT n); +export void Console_Ln (void); +export void Console_Read (CHAR *ch); +export void Console_ReadLine (CHAR *line, LONGINT line__len); +export void Console_String (CHAR *s, LONGINT s__len); + + +void Console_Flush (void) +{ + INTEGER error; + error = Platform_Write(Platform_StdOut, (LONGINT)(uintptr_t)Console_line, Console_pos); + Console_pos = 0; +} + +void Console_Char (CHAR ch) +{ + if (Console_pos == 128) { + Console_Flush(); + } + Console_line[__X(Console_pos, ((LONGINT)(128)))] = ch; + Console_pos += 1; + if (ch == 0x0a) { + Console_Flush(); + } +} + +void Console_String (CHAR *s, LONGINT s__len) +{ + INTEGER i; + __DUP(s, s__len, CHAR); + i = 0; + while (s[__X(i, s__len)] != 0x00) { + Console_Char(s[__X(i, s__len)]); + i += 1; + } + __DEL(s); +} + +void Console_Int (LONGINT i, LONGINT n) +{ + CHAR s[32]; + LONGINT i1, k; + if (i == __LSHL(1, 31, LONGINT)) { + __MOVE("8463847412", s, 11); + k = 10; + } else { + i1 = __ABS(i); + s[0] = (CHAR)(__MOD(i1, 10) + 48); + i1 = __DIV(i1, 10); + k = 1; + while (i1 > 0) { + s[__X(k, ((LONGINT)(32)))] = (CHAR)(__MOD(i1, 10) + 48); + i1 = __DIV(i1, 10); + k += 1; + } + } + if (i < 0) { + s[__X(k, ((LONGINT)(32)))] = '-'; + k += 1; + } + while (n > k) { + Console_Char(' '); + n -= 1; + } + while (k > 0) { + k -= 1; + Console_Char(s[__X(k, ((LONGINT)(32)))]); + } +} + +void Console_Ln (void) +{ + Console_Char(0x0a); +} + +void Console_Bool (BOOLEAN b) +{ + if (b) { + Console_String((CHAR*)"TRUE", (LONGINT)5); + } else { + Console_String((CHAR*)"FALSE", (LONGINT)6); + } +} + +void Console_Hex (LONGINT i) +{ + LONGINT k, n; + k = -28; + while (k <= 0) { + n = __MASK(__ASH(i, k), -16); + if (n <= 9) { + Console_Char((CHAR)(48 + n)); + } else { + Console_Char((CHAR)(55 + n)); + } + k += 4; + } +} + +void Console_Read (CHAR *ch) +{ + LONGINT n; + INTEGER error; + Console_Flush(); + error = Platform_ReadBuf(Platform_StdIn, (void*)&*ch, ((LONGINT)(1)), &n); + if (n != 1) { + *ch = 0x00; + } +} + +void Console_ReadLine (CHAR *line, LONGINT line__len) +{ + LONGINT i; + CHAR ch; + Console_Flush(); + i = 0; + Console_Read(&ch); + while ((((i < line__len - 1 && ch != 0x0a)) && ch != 0x00)) { + line[__X(i, line__len)] = ch; + i += 1; + Console_Read(&ch); + } + line[__X(i, line__len)] = 0x00; +} + + +export void *Console__init(void) +{ + __DEFMOD; + __MODULE_IMPORT(Platform); + __REGMOD("Console", 0); + __REGCMD("Flush", Console_Flush); + __REGCMD("Ln", Console_Ln); +/* BEGIN */ + Console_pos = 0; + __ENDMOD; +} diff --git a/bootstrap/windows-48/Console.h b/bootstrap/windows-48/Console.h new file mode 100644 index 00000000..316e7e46 --- /dev/null +++ b/bootstrap/windows-48/Console.h @@ -0,0 +1,23 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ + +#ifndef Console__h +#define Console__h + +#include "SYSTEM.h" + + + + +import void Console_Bool (BOOLEAN b); +import void Console_Char (CHAR ch); +import void Console_Flush (void); +import void Console_Hex (LONGINT i); +import void Console_Int (LONGINT i, LONGINT n); +import void Console_Ln (void); +import void Console_Read (CHAR *ch); +import void Console_ReadLine (CHAR *line, LONGINT line__len); +import void Console_String (CHAR *s, LONGINT s__len); +import void *Console__init(void); + + +#endif diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c new file mode 100644 index 00000000..25fa879e --- /dev/null +++ b/bootstrap/windows-48/Files.c @@ -0,0 +1,1078 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin tspkaSfF */ +#include "SYSTEM.h" +#include "Configuration.h" +#include "Console.h" +#include "Heap.h" +#include "Platform.h" +#include "Strings.h" + +typedef + struct Files_Handle *Files_File; + +typedef + struct Files_BufDesc { + Files_File f; + BOOLEAN chg; + LONGINT org, size; + SYSTEM_BYTE data[4096]; + } Files_BufDesc; + +typedef + Files_BufDesc *Files_Buffer; + +typedef + CHAR Files_FileName[101]; + +typedef + struct Files_Handle { + Files_FileName workName, registerName; + BOOLEAN tempFile; + Platform_FileIdentity identity; + LONGINT fd, len, pos; + Files_Buffer bufs[4]; + INTEGER swapper, state; + } Files_Handle; + +typedef + struct Files_Rider { + LONGINT res; + BOOLEAN eof; + Files_Buffer buf; + LONGINT org, offset; + } Files_Rider; + + +static LONGINT Files_fileTab[256]; +static INTEGER Files_tempno; +static CHAR Files_HOME[1024]; +static struct { + LONGINT len[1]; + CHAR data[1]; +} *Files_SearchPath; + +export LONGINT *Files_Handle__typ; +export LONGINT *Files_BufDesc__typ; +export LONGINT *Files_Rider__typ; + +export Files_File Files_Base (Files_Rider *r, LONGINT *r__typ); +static Files_File Files_CacheEntry (Platform_FileIdentity identity); +export void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INTEGER *res); +export void Files_Close (Files_File f); +static void Files_Create (Files_File f); +export void Files_Delete (CHAR *name, LONGINT name__len, INTEGER *res); +static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INTEGER errcode); +static void Files_Finalize (SYSTEM_PTR o); +static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *dest, LONGINT dest__len); +static void Files_Flush (Files_Buffer buf); +export void Files_GetDate (Files_File f, LONGINT *t, LONGINT *d); +export void Files_GetName (Files_File f, CHAR *name, LONGINT name__len); +static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *name, LONGINT name__len); +static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len); +static void Files_Init (void); +export LONGINT Files_Length (Files_File f); +static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT name__len, CHAR *dest, LONGINT dest__len); +export Files_File Files_New (CHAR *name, LONGINT name__len); +export Files_File Files_Old (CHAR *name, LONGINT name__len); +export LONGINT Files_Pos (Files_Rider *r, LONGINT *r__typ); +export void Files_Purge (Files_File f); +export void Files_Read (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x); +export void Files_ReadBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN *x); +export void Files_ReadByte (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len); +export void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, LONGINT n); +export void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, INTEGER *x); +export void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, LONGINT *x); +export void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x); +export void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); +export void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, LONGINT *x); +export void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x); +export void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x); +export void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); +export void Files_Register (Files_File f); +export void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INTEGER *res); +static void Files_ScanPath (INTEGER *pos, CHAR *dir, LONGINT dir__len); +export void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, LONGINT pos); +export void Files_SetSearchPath (CHAR *path, LONGINT path__len); +export void Files_Write (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE x); +export void Files_WriteBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN x); +export void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, LONGINT n); +export void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, INTEGER x); +export void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, LONGINT x); +export void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x); +export void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, LONGINT x); +export void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x); +export void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x); +export void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); + +#define Files_IdxTrap() __HALT(-1) + +static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INTEGER errcode) +{ + __DUP(s, s__len, CHAR); + Console_Ln(); + Console_String((CHAR*)"-- ", (LONGINT)4); + Console_String(s, s__len); + Console_String((CHAR*)": ", (LONGINT)3); + if (f != NIL) { + if (f->registerName[0] != 0x00) { + Console_String(f->registerName, ((LONGINT)(101))); + } else { + Console_String(f->workName, ((LONGINT)(101))); + } + if (f->fd != 0) { + Console_String((CHAR*)"f.fd = ", (LONGINT)8); + Console_Int(f->fd, ((LONGINT)(1))); + } + } + if (errcode != 0) { + Console_String((CHAR*)" errcode = ", (LONGINT)12); + Console_Int(errcode, ((LONGINT)(1))); + } + Console_Ln(); + __HALT(99); + __DEL(s); +} + +static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT name__len, CHAR *dest, LONGINT dest__len) +{ + INTEGER i, j; + __DUP(dir, dir__len, CHAR); + __DUP(name, name__len, CHAR); + i = 0; + j = 0; + while (dir[i] != 0x00) { + dest[i] = dir[i]; + i += 1; + } + if (dest[i - 1] != '/') { + dest[i] = '/'; + i += 1; + } + while (name[j] != 0x00) { + dest[i] = name[j]; + i += 1; + j += 1; + } + dest[i] = 0x00; + __DEL(dir); + __DEL(name); +} + +static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *name, LONGINT name__len) +{ + LONGINT n, i, j; + __DUP(finalName, finalName__len, CHAR); + Files_tempno += 1; + n = Files_tempno; + i = 0; + if (finalName[0] != '/') { + while (Platform_CWD[i] != 0x00) { + name[i] = Platform_CWD[i]; + i += 1; + } + if (Platform_CWD[i - 1] != '/') { + name[i] = '/'; + i += 1; + } + } + j = 0; + while (finalName[j] != 0x00) { + name[i] = finalName[j]; + i += 1; + j += 1; + } + i -= 1; + while (name[i] != '/') { + i -= 1; + } + name[i + 1] = '.'; + name[i + 2] = 't'; + name[i + 3] = 'm'; + name[i + 4] = 'p'; + name[i + 5] = '.'; + i += 6; + while (n > 0) { + name[i] = (CHAR)(__MOD(n, 10) + 48); + n = __DIV(n, 10); + i += 1; + } + name[i] = '.'; + i += 1; + n = Platform_PID; + while (n > 0) { + name[i] = (CHAR)(__MOD(n, 10) + 48); + n = __DIV(n, 10); + i += 1; + } + name[i] = 0x00; + __DEL(finalName); +} + +static void Files_Create (Files_File f) +{ + Platform_FileIdentity identity; + BOOLEAN done; + INTEGER error; + CHAR err[32]; + if (f->fd == -1) { + if (f->state == 1) { + Files_GetTempName(f->registerName, ((LONGINT)(101)), (void*)f->workName, ((LONGINT)(101))); + f->tempFile = 1; + } else if (f->state == 2) { + __COPY(f->registerName, f->workName, ((LONGINT)(101))); + f->registerName[0] = 0x00; + f->tempFile = 0; + } + error = Platform_Unlink((void*)f->workName, ((LONGINT)(101))); + error = Platform_New((void*)f->workName, ((LONGINT)(101)), &f->fd); + done = error == 0; + if ((!done && Platform_TooManyFiles(error)) || (done && f->fd >= 256)) { + if ((done && f->fd >= 256)) { + error = Platform_Close(f->fd); + } + Heap_GC(1); + error = Platform_New((void*)f->workName, ((LONGINT)(101)), &f->fd); + done = f->fd == 0; + } + if (done) { + if (f->fd >= 256) { + error = Platform_Close(f->fd); + Files_Err((CHAR*)"too many files open", (LONGINT)20, f, 0); + } else { + Files_fileTab[f->fd] = (LONGINT)(uintptr_t)f; + Heap_FileCount += 1; + Heap_RegisterFinalizer((void*)f, Files_Finalize); + f->state = 0; + f->pos = 0; + error = Platform_Identify(f->fd, &f->identity, Platform_FileIdentity__typ); + } + } else { + if (Platform_NoSuchDirectory(error)) { + __MOVE("no such directory", err, 18); + } else if (Platform_TooManyFiles(error)) { + __MOVE("too many files open", err, 20); + } else { + __MOVE("file not created", err, 17); + } + Files_Err(err, ((LONGINT)(32)), f, error); + } + } +} + +static void Files_Flush (Files_Buffer buf) +{ + INTEGER error; + Files_File f = NIL; + if (buf->chg) { + f = buf->f; + Files_Create(f); + if (buf->org != f->pos) { + error = Platform_Seek(f->fd, buf->org, Platform_SeekSet); + } + error = Platform_Write(f->fd, (LONGINT)(uintptr_t)buf->data, buf->size); + if (error != 0) { + Files_Err((CHAR*)"error writing file", (LONGINT)19, f, error); + } + f->pos = buf->org + buf->size; + buf->chg = 0; + error = Platform_Identify(f->fd, &f->identity, Platform_FileIdentity__typ); + if (error != 0) { + Files_Err((CHAR*)"error identifying file", (LONGINT)23, f, error); + } + } +} + +void Files_Close (Files_File f) +{ + LONGINT i; + INTEGER error; + if (f->state != 1 || f->registerName[0] != 0x00) { + Files_Create(f); + i = 0; + while ((i < 4 && f->bufs[i] != NIL)) { + Files_Flush(f->bufs[i]); + i += 1; + } + error = Platform_Sync(f->fd); + if (error != 0) { + Files_Err((CHAR*)"error writing file", (LONGINT)19, f, error); + } + Files_fileTab[f->fd] = 0; + error = Platform_Close(f->fd); + f->fd = -1; + f->state = 1; + Heap_FileCount -= 1; + } +} + +LONGINT Files_Length (Files_File f) +{ + LONGINT _o_result; + _o_result = f->len; + return _o_result; +} + +Files_File Files_New (CHAR *name, LONGINT name__len) +{ + Files_File _o_result; + Files_File f = NIL; + __DUP(name, name__len, CHAR); + __NEW(f, Files_Handle); + f->workName[0] = 0x00; + __COPY(name, f->registerName, ((LONGINT)(101))); + f->fd = -1; + f->state = 1; + f->len = 0; + f->pos = 0; + f->swapper = -1; + _o_result = f; + __DEL(name); + return _o_result; +} + +static void Files_ScanPath (INTEGER *pos, CHAR *dir, LONGINT dir__len) +{ + INTEGER i; + CHAR ch; + i = 0; + if (Files_SearchPath == NIL) { + if (*pos == 0) { + dir[0] = '.'; + i = 1; + *pos += 1; + } + } else { + ch = (Files_SearchPath->data)[*pos]; + while (ch == ' ' || ch == ';') { + *pos += 1; + ch = (Files_SearchPath->data)[*pos]; + } + if (ch == '~') { + *pos += 1; + ch = (Files_SearchPath->data)[*pos]; + while (Files_HOME[i] != 0x00) { + dir[i] = Files_HOME[i]; + i += 1; + } + if ((((((ch != '/' && ch != 0x00)) && ch != ';')) && ch != ' ')) { + while ((i > 0 && dir[i - 1] != '/')) { + i -= 1; + } + } + } + while ((ch != 0x00 && ch != ';')) { + dir[i] = ch; + i += 1; + *pos += 1; + ch = (Files_SearchPath->data)[*pos]; + } + while ((i > 0 && dir[i - 1] == ' ')) { + i -= 1; + } + } + dir[i] = 0x00; +} + +static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len) +{ + BOOLEAN _o_result; + INTEGER i; + CHAR ch; + i = 0; + ch = name[0]; + while ((ch != 0x00 && ch != '/')) { + i += 1; + ch = name[i]; + } + _o_result = ch == '/'; + return _o_result; +} + +static Files_File Files_CacheEntry (Platform_FileIdentity identity) +{ + Files_File _o_result; + Files_File f = NIL; + INTEGER i, error; + i = 0; + while (i < 256) { + f = (Files_File)(uintptr_t)Files_fileTab[i]; + if ((f != NIL && Platform_SameFile(identity, f->identity))) { + if (!Platform_SameFileTime(identity, f->identity)) { + i = 0; + while (i < 4) { + if (f->bufs[i] != NIL) { + f->bufs[i]->org = -1; + f->bufs[i] = NIL; + } + i += 1; + } + f->swapper = -1; + f->identity = identity; + error = Platform_Size(f->fd, &f->len); + } + _o_result = f; + return _o_result; + } + i += 1; + } + _o_result = NIL; + return _o_result; +} + +Files_File Files_Old (CHAR *name, LONGINT name__len) +{ + Files_File _o_result; + Files_File f = NIL; + LONGINT fd; + INTEGER pos; + BOOLEAN done; + CHAR dir[256], path[256]; + INTEGER error; + Platform_FileIdentity identity; + __DUP(name, name__len, CHAR); + if (name[0] != 0x00) { + if (Files_HasDir((void*)name, name__len)) { + dir[0] = 0x00; + __COPY(name, path, ((LONGINT)(256))); + } else { + pos = 0; + Files_ScanPath(&pos, (void*)dir, ((LONGINT)(256))); + Files_MakeFileName(dir, ((LONGINT)(256)), name, name__len, (void*)path, ((LONGINT)(256))); + Files_ScanPath(&pos, (void*)dir, ((LONGINT)(256))); + } + for (;;) { + error = Platform_OldRW((void*)path, ((LONGINT)(256)), &fd); + done = error == 0; + if ((!done && Platform_TooManyFiles(error)) || (done && fd >= 256)) { + if ((done && fd >= 256)) { + error = Platform_Close(fd); + } + Heap_GC(1); + error = Platform_OldRW((void*)path, ((LONGINT)(256)), &fd); + done = error == 0; + if ((!done && Platform_TooManyFiles(error))) { + Files_Err((CHAR*)"too many files open", (LONGINT)20, f, error); + } + } + if ((!done && Platform_Inaccessible(error))) { + error = Platform_OldRO((void*)path, ((LONGINT)(256)), &fd); + done = error == 0; + } + if ((!done && !Platform_Absent(error))) { + Console_String((CHAR*)"Warning: Files.Old ", (LONGINT)20); + Console_String(name, name__len); + Console_String((CHAR*)" error = ", (LONGINT)10); + Console_Int(error, ((LONGINT)(0))); + Console_Ln(); + } + if (done) { + error = Platform_Identify(fd, &identity, Platform_FileIdentity__typ); + f = Files_CacheEntry(identity); + if (f != NIL) { + error = Platform_Close(fd); + _o_result = f; + __DEL(name); + return _o_result; + } else if (fd >= 256) { + error = Platform_Close(fd); + Files_Err((CHAR*)"too many files open", (LONGINT)20, f, 0); + } else { + __NEW(f, Files_Handle); + Files_fileTab[fd] = (LONGINT)(uintptr_t)f; + Heap_FileCount += 1; + Heap_RegisterFinalizer((void*)f, Files_Finalize); + f->fd = fd; + f->state = 0; + f->pos = 0; + f->swapper = -1; + error = Platform_Size(fd, &f->len); + __COPY(name, f->workName, ((LONGINT)(101))); + f->registerName[0] = 0x00; + f->tempFile = 0; + f->identity = identity; + _o_result = f; + __DEL(name); + return _o_result; + } + } else if (dir[0] == 0x00) { + _o_result = NIL; + __DEL(name); + return _o_result; + } else { + Files_MakeFileName(dir, ((LONGINT)(256)), name, name__len, (void*)path, ((LONGINT)(256))); + Files_ScanPath(&pos, (void*)dir, ((LONGINT)(256))); + } + } + } else { + _o_result = NIL; + __DEL(name); + return _o_result; + } + __RETCHK; +} + +void Files_Purge (Files_File f) +{ + INTEGER i; + Platform_FileIdentity identity; + INTEGER error; + i = 0; + while (i < 4) { + if (f->bufs[i] != NIL) { + f->bufs[i]->org = -1; + f->bufs[i] = NIL; + } + i += 1; + } + if (f->fd != -1) { + error = Platform_Truncate(f->fd, ((LONGINT)(0))); + error = Platform_Seek(f->fd, ((LONGINT)(0)), Platform_SeekSet); + } + f->pos = 0; + f->len = 0; + f->swapper = -1; + error = Platform_Identify(f->fd, &identity, Platform_FileIdentity__typ); + Platform_SetMTime(&f->identity, Platform_FileIdentity__typ, identity); +} + +void Files_GetDate (Files_File f, LONGINT *t, LONGINT *d) +{ + Platform_FileIdentity identity; + INTEGER error; + Files_Create(f); + error = Platform_Identify(f->fd, &identity, Platform_FileIdentity__typ); + Platform_MTimeAsClock(identity, &*t, &*d); +} + +LONGINT Files_Pos (Files_Rider *r, LONGINT *r__typ) +{ + LONGINT _o_result; + _o_result = (*r).org + (*r).offset; + return _o_result; +} + +void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, LONGINT pos) +{ + LONGINT org, offset, i, n; + Files_Buffer buf = NIL; + INTEGER error; + if (f != NIL) { + if (pos > f->len) { + pos = f->len; + } else if (pos < 0) { + pos = 0; + } + offset = __MASK(pos, -4096); + org = pos - offset; + i = 0; + while ((((i < 4 && f->bufs[i] != NIL)) && org != f->bufs[i]->org)) { + i += 1; + } + if (i < 4) { + if (f->bufs[i] == NIL) { + __NEW(buf, Files_BufDesc); + buf->chg = 0; + buf->org = -1; + buf->f = f; + f->bufs[i] = buf; + } else { + buf = f->bufs[i]; + } + } else { + f->swapper = __MASK(f->swapper + 1, -4); + buf = f->bufs[f->swapper]; + Files_Flush(buf); + } + if (buf->org != org) { + if (org == f->len) { + buf->size = 0; + } else { + Files_Create(f); + if (f->pos != org) { + error = Platform_Seek(f->fd, org, Platform_SeekSet); + } + error = Platform_ReadBuf(f->fd, (void*)buf->data, ((LONGINT)(4096)), &n); + if (error != 0) { + Files_Err((CHAR*)"read from file not done", (LONGINT)24, f, error); + } + f->pos = org + n; + buf->size = n; + } + buf->org = org; + buf->chg = 0; + } + } else { + buf = NIL; + org = 0; + offset = 0; + } + (*r).buf = buf; + (*r).org = org; + (*r).offset = offset; + (*r).eof = 0; + (*r).res = 0; +} + +void Files_Read (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x) +{ + LONGINT offset; + Files_Buffer buf = NIL; + buf = (*r).buf; + offset = (*r).offset; + if ((*r).org != buf->org) { + Files_Set(&*r, r__typ, buf->f, (*r).org + offset); + buf = (*r).buf; + offset = (*r).offset; + } + if (offset < buf->size) { + *x = buf->data[offset]; + (*r).offset = offset + 1; + } else if ((*r).org + offset < buf->f->len) { + Files_Set(&*r, r__typ, (*r).buf->f, (*r).org + offset); + *x = (*r).buf->data[0]; + (*r).offset = 1; + } else { + *x = 0x00; + (*r).eof = 1; + } +} + +void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, LONGINT n) +{ + LONGINT xpos, min, restInBuf, offset; + Files_Buffer buf = NIL; + if (n > x__len) { + Files_IdxTrap(); + } + xpos = 0; + buf = (*r).buf; + offset = (*r).offset; + while (n > 0) { + if ((*r).org != buf->org || offset >= 4096) { + Files_Set(&*r, r__typ, buf->f, (*r).org + offset); + buf = (*r).buf; + offset = (*r).offset; + } + restInBuf = buf->size - offset; + if (restInBuf == 0) { + (*r).res = n; + (*r).eof = 1; + return; + } else if (n > restInBuf) { + min = restInBuf; + } else { + min = n; + } + __MOVE((LONGINT)(uintptr_t)buf->data + offset, (LONGINT)(uintptr_t)x + xpos, min); + offset += min; + (*r).offset = offset; + xpos += min; + n -= min; + } + (*r).res = 0; + (*r).eof = 0; +} + +void Files_ReadByte (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len) +{ + Files_ReadBytes(&*r, r__typ, (void*)x, x__len * ((LONGINT)(1)), ((LONGINT)(1))); +} + +Files_File Files_Base (Files_Rider *r, LONGINT *r__typ) +{ + Files_File _o_result; + _o_result = (*r).buf->f; + return _o_result; +} + +void Files_Write (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE x) +{ + Files_Buffer buf = NIL; + LONGINT offset; + buf = (*r).buf; + offset = (*r).offset; + if ((*r).org != buf->org || offset >= 4096) { + Files_Set(&*r, r__typ, buf->f, (*r).org + offset); + buf = (*r).buf; + offset = (*r).offset; + } + buf->data[offset] = x; + buf->chg = 1; + if (offset == buf->size) { + buf->size += 1; + buf->f->len += 1; + } + (*r).offset = offset + 1; + (*r).res = 0; +} + +void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, LONGINT n) +{ + LONGINT xpos, min, restInBuf, offset; + Files_Buffer buf = NIL; + if (n > x__len) { + Files_IdxTrap(); + } + xpos = 0; + buf = (*r).buf; + offset = (*r).offset; + while (n > 0) { + if ((*r).org != buf->org || offset >= 4096) { + Files_Set(&*r, r__typ, buf->f, (*r).org + offset); + buf = (*r).buf; + offset = (*r).offset; + } + restInBuf = 4096 - offset; + if (n > restInBuf) { + min = restInBuf; + } else { + min = n; + } + __MOVE((LONGINT)(uintptr_t)x + xpos, (LONGINT)(uintptr_t)buf->data + offset, min); + offset += min; + (*r).offset = offset; + if (offset > buf->size) { + buf->f->len += offset - buf->size; + buf->size = offset; + } + xpos += min; + n -= min; + buf->chg = 1; + } + (*r).res = 0; +} + +void Files_Delete (CHAR *name, LONGINT name__len, INTEGER *res) +{ + __DUP(name, name__len, CHAR); + *res = Platform_Unlink((void*)name, name__len); + __DEL(name); +} + +void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INTEGER *res) +{ + LONGINT fdold, fdnew, n; + INTEGER error, ignore; + Platform_FileIdentity oldidentity, newidentity; + CHAR buf[4096]; + __DUP(old, old__len, CHAR); + __DUP(new, new__len, CHAR); + error = Platform_IdentifyByName(old, old__len, &oldidentity, Platform_FileIdentity__typ); + if (error == 0) { + error = Platform_IdentifyByName(new, new__len, &newidentity, Platform_FileIdentity__typ); + if ((error != 0 && !Platform_SameFile(oldidentity, newidentity))) { + Files_Delete(new, new__len, &error); + } + error = Platform_Rename((void*)old, old__len, (void*)new, new__len); + if (!Platform_DifferentFilesystems(error)) { + *res = error; + return; + } else { + error = Platform_OldRO((void*)old, old__len, &fdold); + if (error != 0) { + *res = 2; + return; + } + error = Platform_New((void*)new, new__len, &fdnew); + if (error != 0) { + error = Platform_Close(fdold); + *res = 3; + return; + } + error = Platform_Read(fdold, (LONGINT)(uintptr_t)buf, ((LONGINT)(4096)), &n); + while (n > 0) { + error = Platform_Write(fdnew, (LONGINT)(uintptr_t)buf, n); + if (error != 0) { + ignore = Platform_Close(fdold); + ignore = Platform_Close(fdnew); + Files_Err((CHAR*)"cannot move file", (LONGINT)17, NIL, error); + } + error = Platform_Read(fdold, (LONGINT)(uintptr_t)buf, ((LONGINT)(4096)), &n); + } + ignore = Platform_Close(fdold); + ignore = Platform_Close(fdnew); + if (n == 0) { + error = Platform_Unlink((void*)old, old__len); + *res = 0; + } else { + Files_Err((CHAR*)"cannot move file", (LONGINT)17, NIL, error); + } + } + } else { + *res = 2; + } + __DEL(old); + __DEL(new); +} + +void Files_Register (Files_File f) +{ + INTEGER idx, errcode; + Files_File f1 = NIL; + CHAR file[104]; + if ((f->state == 1 && f->registerName[0] != 0x00)) { + f->state = 2; + } + Files_Close(f); + if (f->registerName[0] != 0x00) { + Files_Rename(f->workName, ((LONGINT)(101)), f->registerName, ((LONGINT)(101)), &errcode); + if (errcode != 0) { + __COPY(f->registerName, file, ((LONGINT)(104))); + __HALT(99); + } + __COPY(f->registerName, f->workName, ((LONGINT)(101))); + f->registerName[0] = 0x00; + f->tempFile = 0; + } +} + +void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INTEGER *res) +{ + __DUP(path, path__len, CHAR); + *res = Platform_Chdir((void*)path, path__len); + __DEL(path); +} + +static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *dest, LONGINT dest__len) +{ + LONGINT i, j; + if (!Platform_LittleEndian) { + i = src__len; + j = 0; + while (i > 0) { + i -= 1; + dest[j] = src[i]; + j += 1; + } + } else { + __MOVE((LONGINT)(uintptr_t)src, (LONGINT)(uintptr_t)dest, src__len); + } +} + +void Files_ReadBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN *x) +{ + Files_Read(&*R, R__typ, (CHAR*)(void*)&*x); +} + +void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, INTEGER *x) +{ + CHAR b[2]; + Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(2)), ((LONGINT)(2))); + *x = (int)b[0] + __ASHL((int)b[1], 8); +} + +void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, LONGINT *x) +{ + CHAR b[4]; + Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); + *x = ((LONGINT)((int)b[0] + __ASHL((int)b[1], 8)) + __ASHL((LONGINT)b[2], 16)) + __ASHL((LONGINT)b[3], 24); +} + +void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x) +{ + CHAR b[4]; + Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); + *x = (SET)(((LONGINT)((int)b[0] + __ASHL((int)b[1], 8)) + __ASHL((LONGINT)b[2], 16)) + __ASHL((LONGINT)b[3], 24)); +} + +void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x) +{ + CHAR b[4]; + Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); + Files_FlipBytes((void*)b, ((LONGINT)(4)), (void*)&*x, ((LONGINT)(4))); +} + +void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x) +{ + CHAR b[8]; + Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(8)), ((LONGINT)(8))); + Files_FlipBytes((void*)b, ((LONGINT)(8)), (void*)&*x, ((LONGINT)(8))); +} + +void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) +{ + INTEGER i; + CHAR ch; + i = 0; + do { + Files_Read(&*R, R__typ, (void*)&ch); + x[i] = ch; + i += 1; + } while (!(ch == 0x00)); +} + +void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) +{ + INTEGER i; + CHAR ch; + BOOLEAN b; + i = 0; + b = 0; + do { + Files_Read(&*R, R__typ, (void*)&ch); + if ((ch == 0x00 || ch == 0x0a) || ch == 0x0d) { + b = 1; + } else { + x[i] = ch; + i += 1; + } + } while (!b); +} + +void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, LONGINT *x) +{ + SHORTINT s; + CHAR ch; + LONGINT n; + s = 0; + n = 0; + Files_Read(&*R, R__typ, (void*)&ch); + while ((int)ch >= 128) { + n += __ASH((LONGINT)((int)ch - 128), s); + s += 7; + Files_Read(&*R, R__typ, (void*)&ch); + } + n += __ASH((LONGINT)(__MASK((int)ch, -64) - __ASHL(__ASHR((int)ch, 6), 6)), s); + *x = n; +} + +void Files_WriteBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN x) +{ + Files_Write(&*R, R__typ, __VAL(CHAR, x)); +} + +void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, INTEGER x) +{ + CHAR b[2]; + b[0] = (CHAR)x; + b[1] = (CHAR)__ASHR(x, 8); + Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(2)), ((LONGINT)(2))); +} + +void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, LONGINT x) +{ + CHAR b[4]; + b[0] = (CHAR)x; + b[1] = (CHAR)__ASHR(x, 8); + b[2] = (CHAR)__ASHR(x, 16); + b[3] = (CHAR)__ASHR(x, 24); + Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); +} + +void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x) +{ + CHAR b[4]; + LONGINT i; + i = (LONGINT)x; + b[0] = (CHAR)i; + b[1] = (CHAR)__ASHR(i, 8); + b[2] = (CHAR)__ASHR(i, 16); + b[3] = (CHAR)__ASHR(i, 24); + Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); +} + +void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x) +{ + CHAR b[4]; + Files_FlipBytes((void*)&x, ((LONGINT)(4)), (void*)b, ((LONGINT)(4))); + Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); +} + +void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x) +{ + CHAR b[8]; + Files_FlipBytes((void*)&x, ((LONGINT)(8)), (void*)b, ((LONGINT)(8))); + Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(8)), ((LONGINT)(8))); +} + +void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) +{ + INTEGER i; + i = 0; + while (x[i] != 0x00) { + i += 1; + } + Files_WriteBytes(&*R, R__typ, (void*)x, x__len * ((LONGINT)(1)), i + 1); +} + +void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, LONGINT x) +{ + while (x < -64 || x > 63) { + Files_Write(&*R, R__typ, (CHAR)(__MASK(x, -128) + 128)); + x = __ASHR(x, 7); + } + Files_Write(&*R, R__typ, (CHAR)__MASK(x, -128)); +} + +void Files_GetName (Files_File f, CHAR *name, LONGINT name__len) +{ + __COPY(f->workName, name, name__len); +} + +static void Files_Finalize (SYSTEM_PTR o) +{ + Files_File f = NIL; + LONGINT res; + f = (Files_File)(uintptr_t)o; + if (f->fd >= 0) { + Files_fileTab[f->fd] = 0; + res = Platform_Close(f->fd); + f->fd = -1; + Heap_FileCount -= 1; + if (f->tempFile) { + res = Platform_Unlink((void*)f->workName, ((LONGINT)(101))); + } + } +} + +void Files_SetSearchPath (CHAR *path, LONGINT path__len) +{ + __DUP(path, path__len, CHAR); + if (Strings_Length(path, path__len) != 0) { + Files_SearchPath = __NEWARR(NIL, ((LONGINT)(1)), 1, 1, 1, (LONGINT)(Strings_Length(path, path__len) + 1)); + __COPY(path, Files_SearchPath->data, Files_SearchPath->len[0]); + } else { + Files_SearchPath = NIL; + } + __DEL(path); +} + +static void Files_Init (void) +{ + LONGINT i; + i = 0; + while (i < 256) { + Files_fileTab[i] = 0; + i += 1; + } + Files_tempno = -1; + Heap_FileCount = 0; + Files_SearchPath = NIL; + Files_HOME[0] = 0x00; + Platform_GetEnv((CHAR*)"HOME", (LONGINT)5, (void*)Files_HOME, ((LONGINT)(1024))); +} + +static void EnumPtrs(void (*P)(void*)) +{ + P(Files_SearchPath); +} + +__TDESC(Files_Handle, 1, 4) = {__TDFLDS("Handle", 256), {236, 240, 244, 248, -20}}; +__TDESC(Files_BufDesc, 1, 1) = {__TDFLDS("BufDesc", 4112), {0, -8}}; +__TDESC(Files_Rider, 1, 1) = {__TDFLDS("Rider", 20), {8, -8}}; + +export void *Files__init(void) +{ + __DEFMOD; + __MODULE_IMPORT(Configuration); + __MODULE_IMPORT(Console); + __MODULE_IMPORT(Heap); + __MODULE_IMPORT(Platform); + __MODULE_IMPORT(Strings); + __REGMOD("Files", EnumPtrs); + __INITYP(Files_Handle, Files_Handle, 0); + __INITYP(Files_BufDesc, Files_BufDesc, 0); + __INITYP(Files_Rider, Files_Rider, 0); +/* BEGIN */ + Files_Init(); + __ENDMOD; +} diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h new file mode 100644 index 00000000..226e2815 --- /dev/null +++ b/bootstrap/windows-48/Files.h @@ -0,0 +1,70 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin tspkaSfF */ + +#ifndef Files__h +#define Files__h + +#include "SYSTEM.h" + +typedef + struct Files_Handle *Files_File; + +typedef + struct Files_Handle { + char _prvt0[224]; + LONGINT fd; + char _prvt1[28]; + } Files_Handle; + +typedef + struct Files_Rider { + LONGINT res; + BOOLEAN eof; + char _prvt0[15]; + } Files_Rider; + + + +import LONGINT *Files_Handle__typ; +import LONGINT *Files_Rider__typ; + +import Files_File Files_Base (Files_Rider *r, LONGINT *r__typ); +import void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INTEGER *res); +import void Files_Close (Files_File f); +import void Files_Delete (CHAR *name, LONGINT name__len, INTEGER *res); +import void Files_GetDate (Files_File f, LONGINT *t, LONGINT *d); +import void Files_GetName (Files_File f, CHAR *name, LONGINT name__len); +import LONGINT Files_Length (Files_File f); +import Files_File Files_New (CHAR *name, LONGINT name__len); +import Files_File Files_Old (CHAR *name, LONGINT name__len); +import LONGINT Files_Pos (Files_Rider *r, LONGINT *r__typ); +import void Files_Purge (Files_File f); +import void Files_Read (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x); +import void Files_ReadBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN *x); +import void Files_ReadByte (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len); +import void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, LONGINT n); +import void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, INTEGER *x); +import void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, LONGINT *x); +import void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x); +import void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); +import void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, LONGINT *x); +import void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x); +import void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x); +import void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); +import void Files_Register (Files_File f); +import void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INTEGER *res); +import void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, LONGINT pos); +import void Files_SetSearchPath (CHAR *path, LONGINT path__len); +import void Files_Write (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE x); +import void Files_WriteBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN x); +import void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, LONGINT n); +import void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, INTEGER x); +import void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, LONGINT x); +import void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x); +import void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, LONGINT x); +import void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x); +import void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x); +import void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); +import void *Files__init(void); + + +#endif diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c new file mode 100644 index 00000000..cbb21626 --- /dev/null +++ b/bootstrap/windows-48/Heap.c @@ -0,0 +1,752 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin tskSfF */ +#include "SYSTEM.h" + +struct Heap__1 { + CHAR ch; + SYSTEM_PTR p; +}; + +typedef + struct Heap_CmdDesc *Heap_Cmd; + +typedef + CHAR Heap_CmdName[24]; + +typedef + void (*Heap_Command)(void); + +typedef + struct Heap_CmdDesc { + Heap_Cmd next; + Heap_CmdName name; + Heap_Command cmd; + } Heap_CmdDesc; + +typedef + void (*Heap_EnumProc)(void(*)(SYSTEM_PTR)); + +typedef + struct Heap_FinDesc *Heap_FinNode; + +typedef + void (*Heap_Finalizer)(SYSTEM_PTR); + +typedef + struct Heap_FinDesc { + Heap_FinNode next; + LONGINT obj; + BOOLEAN marked; + Heap_Finalizer finalize; + } Heap_FinDesc; + +typedef + struct Heap_ModuleDesc *Heap_Module; + +typedef + CHAR Heap_ModuleName[20]; + +typedef + struct Heap_ModuleDesc { + Heap_Module next; + Heap_ModuleName name; + LONGINT refcnt; + Heap_Cmd cmds; + LONGINT types; + Heap_EnumProc enumPtrs; + LONGINT reserved1, reserved2; + } Heap_ModuleDesc; + + +export SYSTEM_PTR Heap_modules; +static LONGINT Heap_freeList[10]; +static LONGINT Heap_bigBlocks; +export LONGINT Heap_allocated; +static BOOLEAN Heap_firstTry; +static LONGINT Heap_heap, Heap_heapend; +export LONGINT Heap_heapsize; +static Heap_FinNode Heap_fin; +static INTEGER Heap_lockdepth; +static BOOLEAN Heap_interrupted; +export INTEGER Heap_FileCount; + +export LONGINT *Heap_ModuleDesc__typ; +export LONGINT *Heap_CmdDesc__typ; +export LONGINT *Heap_FinDesc__typ; +export LONGINT *Heap__1__typ; + +static void Heap_CheckFin (void); +static void Heap_ExtendHeap (LONGINT blksz); +export void Heap_FINALL (void); +static void Heap_Finalize (void); +export void Heap_GC (BOOLEAN markStack); +static void Heap_HeapSort (LONGINT n, LONGINT *a, LONGINT a__len); +export void Heap_INCREF (Heap_Module m); +export void Heap_InitHeap (void); +export void Heap_Lock (void); +static void Heap_Mark (LONGINT q); +static void Heap_MarkCandidates (LONGINT n, LONGINT *cand, LONGINT cand__len); +static void Heap_MarkP (SYSTEM_PTR p); +static void Heap_MarkStack (LONGINT n, LONGINT *cand, LONGINT cand__len); +export SYSTEM_PTR Heap_NEWBLK (LONGINT size); +export SYSTEM_PTR Heap_NEWREC (LONGINT tag); +static LONGINT Heap_NewChunk (LONGINT blksz); +export void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); +export SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); +export void Heap_REGTYP (Heap_Module m, LONGINT typ); +export void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); +static void Heap_Scan (void); +static void Heap_Sift (LONGINT l, LONGINT r, LONGINT *a, LONGINT a__len); +export void Heap_Unlock (void); + +extern void *Heap__init(); +extern LONGINT Platform_MainStackFrame; +extern LONGINT Platform_OSAllocate(LONGINT size); +#define Heap_FetchAddress(pointer) (LONGINT)(uintptr_t)(*((void**)((uintptr_t)pointer))) +#define Heap_HeapModuleInit() Heap__init() +#define Heap_OSAllocate(size) Platform_OSAllocate(size) +#define Heap_PlatformHalt(code) Platform_Halt(code) +#define Heap_PlatformMainStackFrame() Platform_MainStackFrame + +void Heap_Lock (void) +{ + Heap_lockdepth += 1; +} + +void Heap_Unlock (void) +{ + Heap_lockdepth -= 1; + if ((Heap_interrupted && Heap_lockdepth == 0)) { + Heap_PlatformHalt(((LONGINT)(-9))); + } +} + +SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) +{ + SYSTEM_PTR _o_result; + Heap_Module m; + if (__STRCMP(name, "Heap") == 0) { + __SYSNEW(m, 48); + } else { + __NEW(m, Heap_ModuleDesc); + } + m->types = 0; + m->cmds = NIL; + __COPY(name, m->name, ((LONGINT)(20))); + m->refcnt = 0; + m->enumPtrs = enumPtrs; + m->next = (Heap_Module)(uintptr_t)Heap_modules; + Heap_modules = (SYSTEM_PTR)m; + _o_result = (void*)m; + return _o_result; +} + +void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) +{ + Heap_Cmd c; + if (__STRCMP(m->name, "Heap") == 0) { + __SYSNEW(c, 32); + } else { + __NEW(c, Heap_CmdDesc); + } + __COPY(name, c->name, ((LONGINT)(24))); + c->cmd = cmd; + c->next = m->cmds; + m->cmds = c; +} + +void Heap_REGTYP (Heap_Module m, LONGINT typ) +{ + __PUT(typ, m->types, LONGINT); + m->types = typ; +} + +void Heap_INCREF (Heap_Module m) +{ + m->refcnt += 1; +} + +static LONGINT Heap_NewChunk (LONGINT blksz) +{ + LONGINT _o_result; + LONGINT chnk; + chnk = Heap_OSAllocate(blksz + 12); + if (chnk != 0) { + __PUT(chnk + 4, chnk + (12 + blksz), LONGINT); + __PUT(chnk + 12, chnk + 16, LONGINT); + __PUT(chnk + 16, blksz, LONGINT); + __PUT(chnk + 20, -4, LONGINT); + __PUT(chnk + 24, Heap_bigBlocks, LONGINT); + Heap_bigBlocks = chnk + 12; + Heap_heapsize += blksz; + } + _o_result = chnk; + return _o_result; +} + +static void Heap_ExtendHeap (LONGINT blksz) +{ + LONGINT size, chnk, j, next; + if (blksz > 160000) { + size = blksz; + } else { + size = 160000; + } + chnk = Heap_NewChunk(size); + if (chnk != 0) { + if (chnk < Heap_heap) { + __PUT(chnk, Heap_heap, LONGINT); + Heap_heap = chnk; + } else { + j = Heap_heap; + next = Heap_FetchAddress(j); + while ((next != 0 && chnk > next)) { + j = next; + next = Heap_FetchAddress(j); + } + __PUT(chnk, next, LONGINT); + __PUT(j, chnk, LONGINT); + } + if (next == 0) { + Heap_heapend = Heap_FetchAddress(chnk + 4); + } + } +} + +SYSTEM_PTR Heap_NEWREC (LONGINT tag) +{ + SYSTEM_PTR _o_result; + LONGINT i, i0, di, blksz, restsize, t, adr, end, next, prev; + SYSTEM_PTR new; + Heap_Lock(); + blksz = Heap_FetchAddress(tag); + i0 = __ASHR(blksz, 4); + i = i0; + if (i < 9) { + adr = Heap_freeList[i]; + while (adr == 0) { + i += 1; + adr = Heap_freeList[i]; + } + } + if (i < 9) { + next = Heap_FetchAddress(adr + 12); + Heap_freeList[i] = next; + if (i != i0) { + di = i - i0; + restsize = __ASHL(di, 4); + end = adr + restsize; + __PUT(end + 4, blksz, LONGINT); + __PUT(end + 8, -4, LONGINT); + __PUT(end, end + 4, LONGINT); + __PUT(adr + 4, restsize, LONGINT); + __PUT(adr + 12, Heap_freeList[di], LONGINT); + Heap_freeList[di] = adr; + adr += restsize; + } + } else { + adr = Heap_bigBlocks; + prev = 0; + for (;;) { + if (adr == 0) { + if (Heap_firstTry) { + Heap_GC(1); + blksz += 16; + if (__ASHL((Heap_heapsize - Heap_allocated) - blksz, 2) < Heap_heapsize) { + Heap_ExtendHeap(__ASHL(__DIV(Heap_allocated + blksz, 48), 6) - Heap_heapsize); + } + Heap_firstTry = 0; + new = Heap_NEWREC(tag); + Heap_firstTry = 1; + if (new == NIL) { + Heap_ExtendHeap(__ASHL(__DIV(Heap_allocated + blksz, 48), 6) - Heap_heapsize); + new = Heap_NEWREC(tag); + } + Heap_Unlock(); + _o_result = new; + return _o_result; + } else { + Heap_Unlock(); + _o_result = NIL; + return _o_result; + } + } + t = Heap_FetchAddress(adr + 4); + if (t >= blksz) { + break; + } + prev = adr; + adr = Heap_FetchAddress(adr + 12); + } + restsize = t - blksz; + end = adr + restsize; + __PUT(end + 4, blksz, LONGINT); + __PUT(end + 8, -4, LONGINT); + __PUT(end, end + 4, LONGINT); + if (restsize > 144) { + __PUT(adr + 4, restsize, LONGINT); + } else { + next = Heap_FetchAddress(adr + 12); + if (prev == 0) { + Heap_bigBlocks = next; + } else { + __PUT(prev + 12, next, LONGINT); + } + if (restsize > 0) { + di = __ASHR(restsize, 4); + __PUT(adr + 4, restsize, LONGINT); + __PUT(adr + 12, Heap_freeList[di], LONGINT); + Heap_freeList[di] = adr; + } + } + adr += restsize; + } + i = adr + 16; + end = adr + blksz; + while (i < end) { + __PUT(i, 0, LONGINT); + __PUT(i + 4, 0, LONGINT); + __PUT(i + 8, 0, LONGINT); + __PUT(i + 12, 0, LONGINT); + i += 16; + } + __PUT(adr + 12, 0, LONGINT); + __PUT(adr, tag, LONGINT); + __PUT(adr + 4, 0, LONGINT); + __PUT(adr + 8, 0, LONGINT); + Heap_allocated += blksz; + Heap_Unlock(); + _o_result = (SYSTEM_PTR)(uintptr_t)(adr + 4); + return _o_result; +} + +SYSTEM_PTR Heap_NEWBLK (LONGINT size) +{ + SYSTEM_PTR _o_result; + LONGINT blksz, tag; + SYSTEM_PTR new; + Heap_Lock(); + blksz = __ASHL(__ASHR(size + 31, 4), 4); + new = Heap_NEWREC((LONGINT)(uintptr_t)&blksz); + tag = ((LONGINT)(uintptr_t)new + blksz) - 12; + __PUT(tag - 4, 0, LONGINT); + __PUT(tag, blksz, LONGINT); + __PUT(tag + 4, -4, LONGINT); + __PUT((LONGINT)(uintptr_t)new - 4, tag, LONGINT); + Heap_Unlock(); + _o_result = new; + return _o_result; +} + +static void Heap_Mark (LONGINT q) +{ + LONGINT p, tag, fld, n, offset, tagbits; + if (q != 0) { + tagbits = Heap_FetchAddress(q - 4); + if (!__ODD(tagbits)) { + __PUT(q - 4, tagbits + 1, LONGINT); + p = 0; + tag = tagbits + 4; + for (;;) { + __GET(tag, offset, LONGINT); + if (offset < 0) { + __PUT(q - 4, (tag + offset) + 1, LONGINT); + if (p == 0) { + break; + } + n = q; + q = p; + tag = Heap_FetchAddress(q - 4); + tag -= 1; + __GET(tag, offset, LONGINT); + fld = q + offset; + p = Heap_FetchAddress(fld); + __PUT(fld, (SYSTEM_PTR)(uintptr_t)n, SYSTEM_PTR); + } else { + fld = q + offset; + n = Heap_FetchAddress(fld); + if (n != 0) { + tagbits = Heap_FetchAddress(n - 4); + if (!__ODD(tagbits)) { + __PUT(n - 4, tagbits + 1, LONGINT); + __PUT(q - 4, tag + 1, LONGINT); + __PUT(fld, (SYSTEM_PTR)(uintptr_t)p, SYSTEM_PTR); + p = q; + q = n; + tag = tagbits; + } + } + } + tag += 4; + } + } + } +} + +static void Heap_MarkP (SYSTEM_PTR p) +{ + Heap_Mark((LONGINT)(uintptr_t)p); +} + +static void Heap_Scan (void) +{ + LONGINT chnk, adr, end, start, tag, i, size, freesize; + Heap_bigBlocks = 0; + i = 1; + while (i < 9) { + Heap_freeList[i] = 0; + i += 1; + } + freesize = 0; + Heap_allocated = 0; + chnk = Heap_heap; + while (chnk != 0) { + adr = chnk + 12; + end = Heap_FetchAddress(chnk + 4); + while (adr < end) { + tag = Heap_FetchAddress(adr); + if (__ODD(tag)) { + if (freesize > 0) { + start = adr - freesize; + __PUT(start, start + 4, LONGINT); + __PUT(start + 4, freesize, LONGINT); + __PUT(start + 8, -4, LONGINT); + i = __ASHR(freesize, 4); + freesize = 0; + if (i < 9) { + __PUT(start + 12, Heap_freeList[i], LONGINT); + Heap_freeList[i] = start; + } else { + __PUT(start + 12, Heap_bigBlocks, LONGINT); + Heap_bigBlocks = start; + } + } + tag -= 1; + __PUT(adr, tag, LONGINT); + size = Heap_FetchAddress(tag); + Heap_allocated += size; + adr += size; + } else { + size = Heap_FetchAddress(tag); + freesize += size; + adr += size; + } + } + if (freesize > 0) { + start = adr - freesize; + __PUT(start, start + 4, LONGINT); + __PUT(start + 4, freesize, LONGINT); + __PUT(start + 8, -4, LONGINT); + i = __ASHR(freesize, 4); + freesize = 0; + if (i < 9) { + __PUT(start + 12, Heap_freeList[i], LONGINT); + Heap_freeList[i] = start; + } else { + __PUT(start + 12, Heap_bigBlocks, LONGINT); + Heap_bigBlocks = start; + } + } + chnk = Heap_FetchAddress(chnk); + } +} + +static void Heap_Sift (LONGINT l, LONGINT r, LONGINT *a, LONGINT a__len) +{ + LONGINT i, j, x; + j = l; + x = a[j]; + for (;;) { + i = j; + j = __ASHL(j, 1) + 1; + if ((j < r && a[j] < a[j + 1])) { + j += 1; + } + if (j > r || a[j] <= x) { + break; + } + a[i] = a[j]; + } + a[i] = x; +} + +static void Heap_HeapSort (LONGINT n, LONGINT *a, LONGINT a__len) +{ + LONGINT l, r, x; + l = __ASHR(n, 1); + r = n - 1; + while (l > 0) { + l -= 1; + Heap_Sift(l, r, (void*)a, a__len); + } + while (r > 0) { + x = a[0]; + a[0] = a[r]; + a[r] = x; + r -= 1; + Heap_Sift(l, r, (void*)a, a__len); + } +} + +static void Heap_MarkCandidates (LONGINT n, LONGINT *cand, LONGINT cand__len) +{ + LONGINT chnk, adr, tag, next, lim, lim1, i, ptr, size; + chnk = Heap_heap; + i = 0; + lim = cand[n - 1]; + while ((chnk != 0 && chnk < lim)) { + adr = chnk + 12; + lim1 = Heap_FetchAddress(chnk + 4); + if (lim < lim1) { + lim1 = lim; + } + while (adr < lim1) { + tag = Heap_FetchAddress(adr); + if (__ODD(tag)) { + size = Heap_FetchAddress(tag - 1); + adr += size; + } else { + size = Heap_FetchAddress(tag); + ptr = adr + 4; + while (cand[i] < ptr) { + i += 1; + } + if (i == n) { + return; + } + next = adr + size; + if (cand[i] < next) { + Heap_Mark(ptr); + } + adr = next; + } + } + chnk = Heap_FetchAddress(chnk); + } +} + +static void Heap_CheckFin (void) +{ + Heap_FinNode n; + LONGINT tag; + n = Heap_fin; + while (n != NIL) { + tag = Heap_FetchAddress(n->obj - 4); + if (!__ODD(tag)) { + n->marked = 0; + Heap_Mark(n->obj); + } else { + n->marked = 1; + } + n = n->next; + } +} + +static void Heap_Finalize (void) +{ + Heap_FinNode n, prev; + n = Heap_fin; + prev = NIL; + while (n != NIL) { + if (!n->marked) { + if (n == Heap_fin) { + Heap_fin = Heap_fin->next; + } else { + prev->next = n->next; + } + (*n->finalize)((SYSTEM_PTR)(uintptr_t)n->obj); + if (prev == NIL) { + n = Heap_fin; + } else { + n = n->next; + } + } else { + prev = n; + n = n->next; + } + } +} + +void Heap_FINALL (void) +{ + Heap_FinNode n; + while (Heap_fin != NIL) { + n = Heap_fin; + Heap_fin = Heap_fin->next; + (*n->finalize)((SYSTEM_PTR)(uintptr_t)n->obj); + } +} + +static void Heap_MarkStack (LONGINT n, LONGINT *cand, LONGINT cand__len) +{ + SYSTEM_PTR frame; + LONGINT inc, nofcand, sp, p, stack0, ptr; + struct Heap__1 align; + if (n > 0) { + Heap_MarkStack(n - 1, cand, cand__len); + if (n > 100) { + return; + } + } + if (n == 0) { + nofcand = 0; + sp = (LONGINT)(uintptr_t)&frame; + stack0 = Heap_PlatformMainStackFrame(); + inc = (LONGINT)(uintptr_t)&align.p - (LONGINT)(uintptr_t)&align; + if (sp > stack0) { + inc = -inc; + } + while (sp != stack0) { + __GET(sp, p, LONGINT); + if ((p > Heap_heap && p < Heap_heapend)) { + if (nofcand == cand__len) { + Heap_HeapSort(nofcand, (void*)cand, cand__len); + Heap_MarkCandidates(nofcand, (void*)cand, cand__len); + nofcand = 0; + } + cand[nofcand] = p; + nofcand += 1; + } + sp += inc; + } + if (nofcand > 0) { + Heap_HeapSort(nofcand, (void*)cand, cand__len); + Heap_MarkCandidates(nofcand, (void*)cand, cand__len); + } + } +} + +void Heap_GC (BOOLEAN markStack) +{ + Heap_Module m; + LONGINT i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; + LONGINT cand[10000]; + if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { + Heap_Lock(); + m = (Heap_Module)(uintptr_t)Heap_modules; + while (m != NIL) { + if (m->enumPtrs != NIL) { + (*m->enumPtrs)(Heap_MarkP); + } + m = m->next; + } + if (markStack) { + i0 = -100; + i1 = -101; + i2 = -102; + i3 = -103; + i4 = -104; + i5 = -105; + i6 = -106; + i7 = -107; + i8 = 1; + i9 = 2; + i10 = 3; + i11 = 4; + i12 = 5; + i13 = 6; + i14 = 7; + i15 = 8; + i16 = 9; + i17 = 10; + i18 = 11; + i19 = 12; + i20 = 13; + i21 = 14; + i22 = 15; + i23 = 16; + for (;;) { + i0 += 1; + i1 += 2; + i2 += 3; + i3 += 4; + i4 += 5; + i5 += 6; + i6 += 7; + i7 += 8; + i8 += 9; + i9 += 10; + i10 += 11; + i11 += 12; + i12 += 13; + i13 += 14; + i14 += 15; + i15 += 16; + i16 += 17; + i17 += 18; + i18 += 19; + i19 += 20; + i20 += 21; + i21 += 22; + i22 += 23; + i23 += 24; + if ((i0 == -99 && i15 == 24)) { + Heap_MarkStack(((LONGINT)(32)), (void*)cand, ((LONGINT)(10000))); + break; + } + } + if (((((((((((((((((((((((i0 + i1) + i2) + i3) + i4) + i5) + i6) + i7) + i8) + i9) + i10) + i11) + i12) + i13) + i14) + i15) + i16) + i17) + i18) + i19) + i20) + i21) + i22) + i23 > 10000) { + return; + } + } + Heap_CheckFin(); + Heap_Scan(); + Heap_Finalize(); + Heap_Unlock(); + } +} + +void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) +{ + Heap_FinNode f; + __NEW(f, Heap_FinDesc); + f->obj = (LONGINT)(uintptr_t)obj; + f->finalize = finalize; + f->marked = 1; + f->next = Heap_fin; + Heap_fin = f; +} + +void Heap_InitHeap (void) +{ + Heap_heap = Heap_NewChunk(128000); + Heap_heapend = Heap_FetchAddress(Heap_heap + 4); + __PUT(Heap_heap, 0, LONGINT); + Heap_allocated = 0; + Heap_firstTry = 1; + Heap_freeList[9] = 1; + Heap_lockdepth = 0; + Heap_FileCount = 0; + Heap_modules = NIL; + Heap_heapsize = 0; + Heap_bigBlocks = 0; + Heap_fin = NIL; + Heap_interrupted = 0; + Heap_HeapModuleInit(); +} + +static void EnumPtrs(void (*P)(void*)) +{ + P(Heap_modules); + P(Heap_fin); +} + +__TDESC(Heap_ModuleDesc, 1, 2) = {__TDFLDS("ModuleDesc", 48), {0, 28, -12}}; +__TDESC(Heap_CmdDesc, 1, 1) = {__TDFLDS("CmdDesc", 32), {0, -8}}; +__TDESC(Heap_FinDesc, 1, 1) = {__TDFLDS("FinDesc", 16), {0, -8}}; +__TDESC(Heap__1, 1, 1) = {__TDFLDS("", 8), {4, -8}}; + +export void *Heap__init(void) +{ + __DEFMOD; + __REGMOD("Heap", EnumPtrs); + __REGCMD("FINALL", Heap_FINALL); + __REGCMD("InitHeap", Heap_InitHeap); + __REGCMD("Lock", Heap_Lock); + __REGCMD("Unlock", Heap_Unlock); + __INITYP(Heap_ModuleDesc, Heap_ModuleDesc, 0); + __INITYP(Heap_CmdDesc, Heap_CmdDesc, 0); + __INITYP(Heap_FinDesc, Heap_FinDesc, 0); + __INITYP(Heap__1, Heap__1, 0); +/* BEGIN */ + __ENDMOD; +} diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h new file mode 100644 index 00000000..d270a455 --- /dev/null +++ b/bootstrap/windows-48/Heap.h @@ -0,0 +1,54 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin tskSfF */ + +#ifndef Heap__h +#define Heap__h + +#include "SYSTEM.h" + +typedef + CHAR Heap_CmdName[24]; + +typedef + void (*Heap_Command)(void); + +typedef + void (*Heap_EnumProc)(void(*)(SYSTEM_PTR)); + +typedef + void (*Heap_Finalizer)(SYSTEM_PTR); + +typedef + struct Heap_ModuleDesc *Heap_Module; + +typedef + struct Heap_ModuleDesc { + LONGINT _prvt0; + char _prvt1[44]; + } Heap_ModuleDesc; + +typedef + CHAR Heap_ModuleName[20]; + + +import SYSTEM_PTR Heap_modules; +import LONGINT Heap_allocated, Heap_heapsize; +import INTEGER Heap_FileCount; + +import LONGINT *Heap_ModuleDesc__typ; + +import void Heap_FINALL (void); +import void Heap_GC (BOOLEAN markStack); +import void Heap_INCREF (Heap_Module m); +import void Heap_InitHeap (void); +import void Heap_Lock (void); +import SYSTEM_PTR Heap_NEWBLK (LONGINT size); +import SYSTEM_PTR Heap_NEWREC (LONGINT tag); +import void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); +import SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); +import void Heap_REGTYP (Heap_Module m, LONGINT typ); +import void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); +import void Heap_Unlock (void); +import void *Heap__init(void); + + +#endif diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c new file mode 100644 index 00000000..6c0f5e0b --- /dev/null +++ b/bootstrap/windows-48/Modules.c @@ -0,0 +1,171 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +#include "SYSTEM.h" +#include "Console.h" +#include "Heap.h" + +typedef + struct Modules_CmdDesc *Modules_Cmd; + +typedef + void (*Modules_Command)(void); + +typedef + struct Modules_CmdDesc { + Modules_Cmd next; + CHAR name[24]; + Modules_Command cmd; + } Modules_CmdDesc; + +typedef + struct Modules_ModuleDesc *Modules_Module; + +typedef + CHAR Modules_ModuleName[20]; + +typedef + struct Modules_ModuleDesc { + Modules_Module next; + Modules_ModuleName name; + LONGINT refcnt; + Modules_Cmd cmds; + LONGINT types; + void (*enumPtrs)(void(*)(LONGINT)); + LONGINT reserved1, reserved2; + } Modules_ModuleDesc; + + +export INTEGER Modules_res; +export CHAR Modules_resMsg[256]; +export Modules_ModuleName Modules_imported, Modules_importing; + +export LONGINT *Modules_ModuleDesc__typ; +export LONGINT *Modules_CmdDesc__typ; + +static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len); +export void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all); +export Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len); +export Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len); + +#define Modules_modules() (Modules_Module)Heap_modules +#define Modules_setmodules(m) Heap_modules = m + +static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len) +{ + INTEGER i, j; + __DUP(b, b__len, CHAR); + i = 0; + while (a[__X(i, a__len)] != 0x00) { + i += 1; + } + j = 0; + while (b[__X(j, b__len)] != 0x00) { + a[__X(i, a__len)] = b[__X(j, b__len)]; + i += 1; + j += 1; + } + a[__X(i, a__len)] = 0x00; + __DEL(b); +} + +Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len) +{ + Modules_Module _o_result; + Modules_Module m = NIL; + CHAR bodyname[64]; + Modules_Command body; + __DUP(name, name__len, CHAR); + m = Modules_modules(); + while ((m != NIL && __STRCMP(m->name, name) != 0)) { + m = m->next; + } + if (m != NIL) { + Modules_res = 0; + Modules_resMsg[0] = 0x00; + } else { + Modules_res = 1; + __COPY(name, Modules_importing, ((LONGINT)(20))); + __MOVE(" module \"", Modules_resMsg, 10); + Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), name, name__len); + Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), (CHAR*)"\" not found", (LONGINT)12); + } + _o_result = m; + __DEL(name); + return _o_result; +} + +Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len) +{ + Modules_Command _o_result; + Modules_Cmd c = NIL; + __DUP(name, name__len, CHAR); + c = mod->cmds; + while ((c != NIL && __STRCMP(c->name, name) != 0)) { + c = c->next; + } + if (c != NIL) { + Modules_res = 0; + Modules_resMsg[0] = 0x00; + _o_result = c->cmd; + __DEL(name); + return _o_result; + } else { + Modules_res = 2; + __MOVE(" command \"", Modules_resMsg, 11); + __COPY(name, Modules_importing, ((LONGINT)(20))); + Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), mod->name, ((LONGINT)(20))); + Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), (CHAR*)".", (LONGINT)2); + Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), name, name__len); + Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), (CHAR*)"\" not found", (LONGINT)12); + _o_result = NIL; + __DEL(name); + return _o_result; + } + __RETCHK; +} + +void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all) +{ + Modules_Module m = NIL, p = NIL; + __DUP(name, name__len, CHAR); + m = Modules_modules(); + if (all) { + Modules_res = 1; + __MOVE("unloading \"all\" not yet supported", Modules_resMsg, 34); + } else { + while ((m != NIL && __STRCMP(m->name, name) != 0)) { + p = m; + m = m->next; + } + if ((m != NIL && m->refcnt == 0)) { + if (m == Modules_modules()) { + Modules_setmodules(m->next); + } else { + p->next = m->next; + } + Modules_res = 0; + } else { + Modules_res = 1; + if (m == NIL) { + __MOVE("module not found", Modules_resMsg, 17); + } else { + __MOVE("clients of this module exist", Modules_resMsg, 29); + } + } + } + __DEL(name); +} + +__TDESC(Modules_ModuleDesc, 1, 2) = {__TDFLDS("ModuleDesc", 48), {0, 28, -12}}; +__TDESC(Modules_CmdDesc, 1, 1) = {__TDFLDS("CmdDesc", 32), {0, -8}}; + +export void *Modules__init(void) +{ + __DEFMOD; + __MODULE_IMPORT(Console); + __MODULE_IMPORT(Heap); + __REGMOD("Modules", 0); + __INITYP(Modules_ModuleDesc, Modules_ModuleDesc, 0); + __INITYP(Modules_CmdDesc, Modules_CmdDesc, 0); +/* BEGIN */ + __ENDMOD; +} diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h new file mode 100644 index 00000000..5968d1aa --- /dev/null +++ b/bootstrap/windows-48/Modules.h @@ -0,0 +1,54 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ + +#ifndef Modules__h +#define Modules__h + +#include "SYSTEM.h" + +typedef + struct Modules_CmdDesc *Modules_Cmd; + +typedef + void (*Modules_Command)(void); + +typedef + struct Modules_CmdDesc { + Modules_Cmd next; + CHAR name[24]; + Modules_Command cmd; + } Modules_CmdDesc; + +typedef + struct Modules_ModuleDesc *Modules_Module; + +typedef + CHAR Modules_ModuleName[20]; + +typedef + struct Modules_ModuleDesc { + Modules_Module next; + Modules_ModuleName name; + LONGINT refcnt; + Modules_Cmd cmds; + LONGINT types; + void (*enumPtrs)(void(*)(LONGINT)); + char _prvt0[8]; + } Modules_ModuleDesc; + + +import INTEGER Modules_res; +import CHAR Modules_resMsg[256]; +import Modules_ModuleName Modules_imported, Modules_importing; + +import LONGINT *Modules_ModuleDesc__typ; +import LONGINT *Modules_CmdDesc__typ; + +import void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all); +import Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len); +import Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len); +import void *Modules__init(void); + +#define Modules_modules() (Modules_Module)Heap_modules +#define Modules_setmodules(m) Heap_modules = m + +#endif diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c new file mode 100644 index 00000000..0c22a7a7 --- /dev/null +++ b/bootstrap/windows-48/OPB.c @@ -0,0 +1,2677 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +#include "SYSTEM.h" +#include "OPM.h" +#include "OPS.h" +#include "OPT.h" + + +export void (*OPB_typSize)(OPT_Struct); +static INTEGER OPB_exp; +static LONGINT OPB_maxExp; + + +export void OPB_Assign (OPT_Node *x, OPT_Node y); +static void OPB_BindNodes (SHORTINT class, OPT_Struct typ, OPT_Node *x, OPT_Node y); +static LONGINT OPB_BoolToInt (BOOLEAN b); +export void OPB_Call (OPT_Node *x, OPT_Node apar, OPT_Object fp); +static void OPB_CharToString (OPT_Node n); +static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode); +static void OPB_CheckLeaf (OPT_Node x, BOOLEAN dynArrToo); +export void OPB_CheckParameters (OPT_Object fp, OPT_Object ap, BOOLEAN checkNames); +static void OPB_CheckProc (OPT_Struct x, OPT_Object y); +static void OPB_CheckPtr (OPT_Node x, OPT_Node y); +static void OPB_CheckRealType (INTEGER f, INTEGER nr, OPT_Const x); +static void OPB_CheckReceiver (OPT_Node *x, OPT_Object fp); +static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y); +export void OPB_Construct (SHORTINT class, OPT_Node *x, OPT_Node y); +static void OPB_Convert (OPT_Node *x, OPT_Struct typ); +export void OPB_DeRef (OPT_Node *x); +static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpar); +export OPT_Node OPB_EmptySet (void); +export void OPB_Enter (OPT_Node *procdec, OPT_Node stat, OPT_Object proc); +export void OPB_Field (OPT_Node *x, OPT_Object y); +export void OPB_In (OPT_Node *x, OPT_Node y); +export void OPB_Index (OPT_Node *x, OPT_Node y); +export void OPB_Inittd (OPT_Node *inittd, OPT_Node *last, OPT_Struct typ); +static BOOLEAN OPB_IntToBool (LONGINT i); +export void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y); +export void OPB_MOp (SHORTINT op, OPT_Node *x); +export OPT_Node OPB_NewBoolConst (BOOLEAN boolval); +export OPT_Node OPB_NewIntConst (LONGINT intval); +export OPT_Node OPB_NewLeaf (OPT_Object obj); +export OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ); +export OPT_Node OPB_NewString (OPS_String str, LONGINT len); +export OPT_Node OPB_Nil (void); +static BOOLEAN OPB_NotVar (OPT_Node x); +export void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y); +export void OPB_OptIf (OPT_Node *x); +export void OPB_Param (OPT_Node ap, OPT_Object fp); +export void OPB_PrepCall (OPT_Node *x, OPT_Object *fpar); +export void OPB_Return (OPT_Node *x, OPT_Object proc); +export void OPB_SetElem (OPT_Node *x); +static void OPB_SetIntType (OPT_Node node); +export void OPB_SetRange (OPT_Node *x, OPT_Node y); +export void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno); +export void OPB_StPar0 (OPT_Node *par0, INTEGER fctno); +export void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno); +export void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n); +export void OPB_StaticLink (SHORTINT dlev); +export void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard); +static void OPB_err (INTEGER n); +static LONGINT OPB_log (LONGINT x); + + +static void OPB_err (INTEGER n) +{ + OPM_err(n); +} + +OPT_Node OPB_NewLeaf (OPT_Object obj) +{ + OPT_Node _o_result; + OPT_Node node = NIL; + switch (obj->mode) { + case 1: + node = OPT_NewNode(0); + node->readonly = (obj->vis == 2 && obj->mnolev < 0); + break; + case 2: + node = OPT_NewNode(1); + break; + case 3: + node = OPT_NewNode(7); + node->conval = OPT_NewConst(); + __GUARDEQP(node->conval, OPT_ConstDesc) = *obj->conval; + break; + case 5: + node = OPT_NewNode(8); + break; + case 6: case 7: case 8: case 9: case 10: + node = OPT_NewNode(9); + break; + default: + OPB_err(127); + node = OPT_NewNode(0); + break; + } + node->obj = obj; + node->typ = obj->typ; + _o_result = node; + return _o_result; +} + +void OPB_Construct (SHORTINT class, OPT_Node *x, OPT_Node y) +{ + OPT_Node node = NIL; + node = OPT_NewNode(class); + node->typ = OPT_notyp; + node->left = *x; + node->right = y; + *x = node; +} + +void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y) +{ + if (*x == NIL) { + *x = y; + } else { + (*last)->link = y; + } + while (y->link != NIL) { + y = y->link; + } + *last = y; +} + +static LONGINT OPB_BoolToInt (BOOLEAN b) +{ + LONGINT _o_result; + if (b) { + _o_result = 1; + return _o_result; + } else { + _o_result = 0; + return _o_result; + } + __RETCHK; +} + +static BOOLEAN OPB_IntToBool (LONGINT i) +{ + BOOLEAN _o_result; + if (i == 0) { + _o_result = 0; + return _o_result; + } else { + _o_result = 1; + return _o_result; + } + __RETCHK; +} + +OPT_Node OPB_NewBoolConst (BOOLEAN boolval) +{ + OPT_Node _o_result; + OPT_Node x = NIL; + x = OPT_NewNode(7); + x->typ = OPT_booltyp; + x->conval = OPT_NewConst(); + x->conval->intval = OPB_BoolToInt(boolval); + _o_result = x; + return _o_result; +} + +void OPB_OptIf (OPT_Node *x) +{ + OPT_Node if_ = NIL, pred = NIL; + if_ = (*x)->left; + while (if_->left->class == 7) { + if (OPB_IntToBool(if_->left->conval->intval)) { + *x = if_->right; + return; + } else if (if_->link == NIL) { + *x = (*x)->right; + return; + } else { + if_ = if_->link; + (*x)->left = if_; + } + } + pred = if_; + if_ = if_->link; + while (if_ != NIL) { + if (if_->left->class == 7) { + if (OPB_IntToBool(if_->left->conval->intval)) { + pred->link = NIL; + (*x)->right = if_->right; + return; + } else { + if_ = if_->link; + pred->link = if_; + } + } else { + pred = if_; + if_ = if_->link; + } + } +} + +OPT_Node OPB_Nil (void) +{ + OPT_Node _o_result; + OPT_Node x = NIL; + x = OPT_NewNode(7); + x->typ = OPT_niltyp; + x->conval = OPT_NewConst(); + x->conval->intval = 0; + _o_result = x; + return _o_result; +} + +OPT_Node OPB_EmptySet (void) +{ + OPT_Node _o_result; + OPT_Node x = NIL; + x = OPT_NewNode(7); + x->typ = OPT_settyp; + x->conval = OPT_NewConst(); + x->conval->setval = 0x0; + _o_result = x; + return _o_result; +} + +static void OPB_SetIntType (OPT_Node node) +{ + LONGINT v; + v = node->conval->intval; + if ((OPM_MinSInt <= (LONGINT)v && (LONGINT)v <= OPM_MaxSInt)) { + node->typ = OPT_sinttyp; + } else if ((OPM_MinInt <= (LONGINT)v && (LONGINT)v <= OPM_MaxInt)) { + node->typ = OPT_inttyp; + } else if ((OPM_MinLInt <= v && v <= OPM_MaxLInt)) { + node->typ = OPT_linttyp; + } else { + OPB_err(203); + node->typ = OPT_sinttyp; + node->conval->intval = 1; + } +} + +OPT_Node OPB_NewIntConst (LONGINT intval) +{ + OPT_Node _o_result; + OPT_Node x = NIL; + x = OPT_NewNode(7); + x->conval = OPT_NewConst(); + x->conval->intval = intval; + OPB_SetIntType(x); + _o_result = x; + return _o_result; +} + +OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ) +{ + OPT_Node _o_result; + OPT_Node x = NIL; + x = OPT_NewNode(7); + x->conval = OPT_NewConst(); + x->conval->realval = realval; + x->typ = typ; + x->conval->intval = -1; + _o_result = x; + return _o_result; +} + +OPT_Node OPB_NewString (OPS_String str, LONGINT len) +{ + OPT_Node _o_result; + OPT_Node x = NIL; + x = OPT_NewNode(7); + x->conval = OPT_NewConst(); + x->typ = OPT_stringtyp; + x->conval->intval = -1; + x->conval->intval2 = len; + x->conval->ext = OPT_NewExt(); + __COPY(str, *x->conval->ext, ((LONGINT)(256))); + _o_result = x; + return _o_result; +} + +static void OPB_CharToString (OPT_Node n) +{ + CHAR ch; + n->typ = OPT_stringtyp; + ch = (CHAR)n->conval->intval; + n->conval->ext = OPT_NewExt(); + if (ch == 0x00) { + n->conval->intval2 = 1; + } else { + n->conval->intval2 = 2; + (*n->conval->ext)[1] = 0x00; + } + (*n->conval->ext)[0] = ch; + n->conval->intval = -1; + n->obj = NIL; +} + +static void OPB_BindNodes (SHORTINT class, OPT_Struct typ, OPT_Node *x, OPT_Node y) +{ + OPT_Node node = NIL; + node = OPT_NewNode(class); + node->typ = typ; + node->left = *x; + node->right = y; + *x = node; +} + +static BOOLEAN OPB_NotVar (OPT_Node x) +{ + BOOLEAN _o_result; + _o_result = (x->class >= 7 && ((x->class != 11 || x->subcl != 29) || x->left->class >= 7)); + return _o_result; +} + +void OPB_DeRef (OPT_Node *x) +{ + OPT_Object strobj = NIL, bstrobj = NIL; + OPT_Struct typ = NIL, btyp = NIL; + typ = (*x)->typ; + if ((*x)->class >= 7) { + OPB_err(78); + } else if (typ->form == 13) { + if (typ == OPT_sysptrtyp) { + OPB_err(57); + } + btyp = typ->BaseTyp; + strobj = typ->strobj; + bstrobj = btyp->strobj; + if ((((((strobj != NIL && strobj->name[0] != 0x00)) && bstrobj != NIL)) && bstrobj->name[0] != 0x00)) { + btyp->pbused = 1; + } + OPB_BindNodes(3, btyp, &*x, NIL); + } else { + OPB_err(84); + } +} + +void OPB_Index (OPT_Node *x, OPT_Node y) +{ + INTEGER f; + OPT_Struct typ = NIL; + f = y->typ->form; + if ((*x)->class >= 7) { + OPB_err(79); + } else if (!__IN(f, 0x70) || __IN(y->class, 0x0300)) { + OPB_err(80); + y->typ = OPT_inttyp; + } + if ((*x)->typ->comp == 2) { + typ = (*x)->typ->BaseTyp; + if ((y->class == 7 && (y->conval->intval < 0 || y->conval->intval >= (*x)->typ->n))) { + OPB_err(81); + } + } else if ((*x)->typ->comp == 3) { + typ = (*x)->typ->BaseTyp; + if ((y->class == 7 && y->conval->intval < 0)) { + OPB_err(81); + } + } else { + OPB_err(82); + typ = OPT_undftyp; + } + OPB_BindNodes(4, typ, &*x, y); + (*x)->readonly = (*x)->left->readonly; +} + +void OPB_Field (OPT_Node *x, OPT_Object y) +{ + if ((*x)->class >= 7) { + OPB_err(77); + } + if ((y != NIL && __IN(y->mode, 0x2010))) { + OPB_BindNodes(2, y->typ, &*x, NIL); + (*x)->obj = y; + (*x)->readonly = (*x)->left->readonly || (y->vis == 2 && y->mnolev < 0); + } else { + OPB_err(83); + (*x)->typ = OPT_undftyp; + } +} + +static struct TypTest__57 { + OPT_Node *x; + OPT_Object *obj; + BOOLEAN *guard; + struct TypTest__57 *lnk; +} *TypTest__57_s; + +static void GTT__58 (OPT_Struct t0, OPT_Struct t1); + +static void GTT__58 (OPT_Struct t0, OPT_Struct t1) +{ + OPT_Node node = NIL; + OPT_Struct t = NIL; + t = t0; + while ((((t != NIL && t != t1)) && t != OPT_undftyp)) { + t = t->BaseTyp; + } + if (t != t1) { + while ((((t1 != NIL && t1 != t0)) && t1 != OPT_undftyp)) { + t1 = t1->BaseTyp; + } + if (t1 == t0 || t0->form == 0) { + if (*TypTest__57_s->guard) { + OPB_BindNodes(5, NIL, &*TypTest__57_s->x, NIL); + (*TypTest__57_s->x)->readonly = (*TypTest__57_s->x)->left->readonly; + } else { + node = OPT_NewNode(11); + node->subcl = 16; + node->left = *TypTest__57_s->x; + node->obj = *TypTest__57_s->obj; + *TypTest__57_s->x = node; + } + } else { + OPB_err(85); + } + } else if (t0 != t1) { + OPB_err(85); + } else if (!*TypTest__57_s->guard) { + if ((*TypTest__57_s->x)->class == 5) { + node = OPT_NewNode(11); + node->subcl = 16; + node->left = *TypTest__57_s->x; + node->obj = *TypTest__57_s->obj; + *TypTest__57_s->x = node; + } else { + *TypTest__57_s->x = OPB_NewBoolConst(1); + } + } +} + +void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) +{ + struct TypTest__57 _s; + _s.x = x; + _s.obj = &obj; + _s.guard = &guard; + _s.lnk = TypTest__57_s; + TypTest__57_s = &_s; + if (OPB_NotVar(*x)) { + OPB_err(112); + } else if ((*x)->typ->form == 13) { + if (((*x)->typ->BaseTyp->comp != 4 && (*x)->typ != OPT_sysptrtyp)) { + OPB_err(85); + } else if (obj->typ->form == 13) { + GTT__58((*x)->typ->BaseTyp, obj->typ->BaseTyp); + } else { + OPB_err(86); + } + } else if (((((*x)->typ->comp == 4 && (*x)->class == 1)) && obj->typ->comp == 4)) { + GTT__58((*x)->typ, obj->typ); + } else { + OPB_err(87); + } + if (guard) { + (*x)->typ = obj->typ; + } else { + (*x)->typ = OPT_booltyp; + } + TypTest__57_s = _s.lnk; +} + +void OPB_In (OPT_Node *x, OPT_Node y) +{ + INTEGER f; + LONGINT k; + f = (*x)->typ->form; + if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { + OPB_err(126); + } else if ((__IN(f, 0x70) && y->typ->form == 9)) { + if ((*x)->class == 7) { + k = (*x)->conval->intval; + if (k < 0 || k > (LONGINT)OPM_MaxSet) { + OPB_err(202); + } else if (y->class == 7) { + (*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval)); + (*x)->obj = NIL; + } else { + OPB_BindNodes(12, OPT_booltyp, &*x, y); + (*x)->subcl = 15; + } + } else { + OPB_BindNodes(12, OPT_booltyp, &*x, y); + (*x)->subcl = 15; + } + } else { + OPB_err(92); + } + (*x)->typ = OPT_booltyp; +} + +static LONGINT OPB_log (LONGINT x) +{ + LONGINT _o_result; + OPB_exp = 0; + if (x > 0) { + while (!__ODD(x)) { + x = __ASHR(x, 1); + OPB_exp += 1; + } + } + _o_result = x; + return _o_result; +} + +static void OPB_CheckRealType (INTEGER f, INTEGER nr, OPT_Const x) +{ + LONGREAL min, max, r; + if (f == 7) { + min = OPM_MinReal; + max = OPM_MaxReal; + } else { + min = OPM_MinLReal; + max = OPM_MaxLReal; + } + r = __ABS(x->realval); + if (r > max || r < min) { + OPB_err(nr); + x->realval = (LONGREAL)1; + } else if (f == 7) { + x->realval = x->realval; + } + x->intval = -1; +} + +static struct MOp__28 { + struct MOp__28 *lnk; +} *MOp__28_s; + +static OPT_Node NewOp__29 (SHORTINT op, OPT_Struct typ, OPT_Node z); + +static OPT_Node NewOp__29 (SHORTINT op, OPT_Struct typ, OPT_Node z) +{ + OPT_Node _o_result; + OPT_Node node = NIL; + node = OPT_NewNode(11); + node->subcl = op; + node->typ = typ; + node->left = z; + _o_result = node; + return _o_result; +} + +void OPB_MOp (SHORTINT op, OPT_Node *x) +{ + INTEGER f; + OPT_Struct typ = NIL; + OPT_Node z = NIL; + struct MOp__28 _s; + _s.lnk = MOp__28_s; + MOp__28_s = &_s; + z = *x; + if (z->class == 8 || z->class == 9) { + OPB_err(126); + } else { + typ = z->typ; + f = typ->form; + switch (op) { + case 33: + if (f == 2) { + if (z->class == 7) { + z->conval->intval = OPB_BoolToInt(!OPB_IntToBool(z->conval->intval)); + z->obj = NIL; + } else { + z = NewOp__29(op, typ, z); + } + } else { + OPB_err(98); + } + break; + case 6: + if (!__IN(f, 0x01f0)) { + OPB_err(96); + } + break; + case 7: + if (__IN(f, 0x03f0)) { + if (z->class == 7) { + if (__IN(f, 0x70)) { + if (z->conval->intval == (-2147483647-1)) { + OPB_err(203); + } else { + z->conval->intval = -z->conval->intval; + OPB_SetIntType(z); + } + } else if (__IN(f, 0x0180)) { + z->conval->realval = -z->conval->realval; + } else { + z->conval->setval = ~z->conval->setval; + } + z->obj = NIL; + } else { + z = NewOp__29(op, typ, z); + } + } else { + OPB_err(97); + } + break; + case 21: + if (__IN(f, 0x01f0)) { + if (z->class == 7) { + if (__IN(f, 0x70)) { + if (z->conval->intval == (-2147483647-1)) { + OPB_err(203); + } else { + z->conval->intval = __ABS(z->conval->intval); + OPB_SetIntType(z); + } + } else { + z->conval->realval = __ABS(z->conval->realval); + } + z->obj = NIL; + } else { + z = NewOp__29(op, typ, z); + } + } else { + OPB_err(111); + } + break; + case 22: + if (f == 3) { + if (z->class == 7) { + z->conval->intval = (int)__CAP((CHAR)z->conval->intval); + z->obj = NIL; + } else { + z = NewOp__29(op, typ, z); + } + } else { + OPB_err(111); + z->typ = OPT_chartyp; + } + break; + case 23: + if (__IN(f, 0x70)) { + if (z->class == 7) { + z->conval->intval = OPB_BoolToInt(__ODD(z->conval->intval)); + z->obj = NIL; + } else { + z = NewOp__29(op, typ, z); + } + } else { + OPB_err(111); + } + z->typ = OPT_booltyp; + break; + case 24: + if ((((z->class == 7 && f == 3)) && z->conval->intval >= 32)) { + OPB_CharToString(z); + f = 10; + } + if (z->class < 7 || f == 10) { + z = NewOp__29(op, typ, z); + } else { + OPB_err(127); + } + z->typ = OPT_linttyp; + break; + case 25: + if ((__IN(f, 0x70) && z->class == 7)) { + if ((0 <= z->conval->intval && z->conval->intval <= -1)) { + z = NewOp__29(op, typ, z); + } else { + OPB_err(219); + } + } else { + OPB_err(69); + } + z->typ = OPT_booltyp; + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPB.MOp, op = ", (LONGINT)33); + OPM_LogWNum(op, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + } + *x = z; + MOp__28_s = _s.lnk; +} + +static void OPB_CheckPtr (OPT_Node x, OPT_Node y) +{ + INTEGER g; + OPT_Struct p = NIL, q = NIL, t = NIL; + g = y->typ->form; + if (g == 13) { + p = x->typ->BaseTyp; + q = y->typ->BaseTyp; + if ((p->comp == 4 && q->comp == 4)) { + if (p->extlev < q->extlev) { + t = p; + p = q; + q = t; + } + while ((((p != q && p != NIL)) && p != OPT_undftyp)) { + p = p->BaseTyp; + } + if (p == NIL) { + OPB_err(100); + } + } else { + OPB_err(100); + } + } else if (g != 11) { + OPB_err(100); + } +} + +void OPB_CheckParameters (OPT_Object fp, OPT_Object ap, BOOLEAN checkNames) +{ + OPT_Struct ft = NIL, at = NIL; + while (fp != NIL) { + if (ap != NIL) { + ft = fp->typ; + at = ap->typ; + while ((ft->comp == 3 && at->comp == 3)) { + ft = ft->BaseTyp; + at = at->BaseTyp; + } + if (ft != at) { + if ((ft->form == 14 && at->form == 14)) { + if (ft->BaseTyp == at->BaseTyp) { + OPB_CheckParameters(ft->link, at->link, 0); + } else { + OPB_err(117); + } + } else { + OPB_err(115); + } + } + if (fp->mode != ap->mode || (checkNames && __STRCMP(fp->name, ap->name) != 0)) { + OPB_err(115); + } + ap = ap->link; + } else { + OPB_err(116); + } + fp = fp->link; + } + if (ap != NIL) { + OPB_err(116); + } +} + +static void OPB_CheckProc (OPT_Struct x, OPT_Object y) +{ + if (__IN(y->mode, 0x04c0)) { + if (y->mode == 6) { + if (y->mnolev == 0) { + y->mode = 7; + } else { + OPB_err(73); + } + } + if (x->BaseTyp == y->typ) { + OPB_CheckParameters(x->link, y->link, 0); + } else { + OPB_err(117); + } + } else { + OPB_err(113); + } +} + +static struct ConstOp__13 { + OPT_Node *x; + INTEGER *f; + OPT_Const *xval, *yval; + struct ConstOp__13 *lnk; +} *ConstOp__13_s; + +static INTEGER ConstCmp__14 (void); + +static INTEGER ConstCmp__14 (void) +{ + INTEGER _o_result; + INTEGER res; + switch (*ConstOp__13_s->f) { + case 0: + res = 9; + break; + case 1: case 3: case 4: case 5: case 6: + if ((*ConstOp__13_s->xval)->intval < (*ConstOp__13_s->yval)->intval) { + res = 11; + } else if ((*ConstOp__13_s->xval)->intval > (*ConstOp__13_s->yval)->intval) { + res = 13; + } else { + res = 9; + } + break; + case 7: case 8: + if ((*ConstOp__13_s->xval)->realval < (*ConstOp__13_s->yval)->realval) { + res = 11; + } else if ((*ConstOp__13_s->xval)->realval > (*ConstOp__13_s->yval)->realval) { + res = 13; + } else { + res = 9; + } + break; + case 2: + if ((*ConstOp__13_s->xval)->intval != (*ConstOp__13_s->yval)->intval) { + res = 10; + } else { + res = 9; + } + break; + case 9: + if ((*ConstOp__13_s->xval)->setval != (*ConstOp__13_s->yval)->setval) { + res = 10; + } else { + res = 9; + } + break; + case 10: + if (__STRCMP(*(*ConstOp__13_s->xval)->ext, *(*ConstOp__13_s->yval)->ext) < 0) { + res = 11; + } else if (__STRCMP(*(*ConstOp__13_s->xval)->ext, *(*ConstOp__13_s->yval)->ext) > 0) { + res = 13; + } else { + res = 9; + } + break; + case 11: case 13: case 14: + if ((*ConstOp__13_s->xval)->intval != (*ConstOp__13_s->yval)->intval) { + res = 10; + } else { + res = 9; + } + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPB.ConstCmp, f = ", (LONGINT)37); + OPM_LogWNum(*ConstOp__13_s->f, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + (*ConstOp__13_s->x)->typ = OPT_booltyp; + _o_result = res; + return _o_result; +} + +static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) +{ + INTEGER f, g; + OPT_Const xval = NIL, yval = NIL; + LONGINT xv, yv; + BOOLEAN temp; + struct ConstOp__13 _s; + _s.x = &x; + _s.f = &f; + _s.xval = &xval; + _s.yval = &yval; + _s.lnk = ConstOp__13_s; + ConstOp__13_s = &_s; + f = x->typ->form; + g = y->typ->form; + xval = x->conval; + yval = y->conval; + if (f != g) { + switch (f) { + case 3: + if (g == 10) { + OPB_CharToString(x); + } else { + OPB_err(100); + y->typ = x->typ; + __GUARDEQP(yval, OPT_ConstDesc) = *xval; + } + break; + case 4: + if (__IN(g, 0x70)) { + x->typ = y->typ; + } else if (g == 7) { + x->typ = OPT_realtyp; + xval->realval = xval->intval; + } else if (g == 8) { + x->typ = OPT_lrltyp; + xval->realval = xval->intval; + } else { + OPB_err(100); + y->typ = x->typ; + __GUARDEQP(yval, OPT_ConstDesc) = *xval; + } + break; + case 5: + if (g == 4) { + y->typ = OPT_inttyp; + } else if (__IN(g, 0x70)) { + x->typ = y->typ; + } else if (g == 7) { + x->typ = OPT_realtyp; + xval->realval = xval->intval; + } else if (g == 8) { + x->typ = OPT_lrltyp; + xval->realval = xval->intval; + } else { + OPB_err(100); + y->typ = x->typ; + __GUARDEQP(yval, OPT_ConstDesc) = *xval; + } + break; + case 6: + if (__IN(g, 0x70)) { + y->typ = OPT_linttyp; + } else if (g == 7) { + x->typ = OPT_realtyp; + xval->realval = xval->intval; + } else if (g == 8) { + x->typ = OPT_lrltyp; + xval->realval = xval->intval; + } else { + OPB_err(100); + y->typ = x->typ; + __GUARDEQP(yval, OPT_ConstDesc) = *xval; + } + break; + case 7: + if (__IN(g, 0x70)) { + y->typ = x->typ; + yval->realval = yval->intval; + } else if (g == 8) { + x->typ = OPT_lrltyp; + } else { + OPB_err(100); + y->typ = x->typ; + __GUARDEQP(yval, OPT_ConstDesc) = *xval; + } + break; + case 8: + if (__IN(g, 0x70)) { + y->typ = x->typ; + yval->realval = yval->intval; + } else if (g == 7) { + y->typ = OPT_lrltyp; + } else { + OPB_err(100); + y->typ = x->typ; + __GUARDEQP(yval, OPT_ConstDesc) = *xval; + } + break; + case 10: + if (g == 3) { + OPB_CharToString(y); + g = 10; + } else { + OPB_err(100); + y->typ = x->typ; + __GUARDEQP(yval, OPT_ConstDesc) = *xval; + } + break; + case 11: + if (!__IN(g, 0x6000)) { + OPB_err(100); + } + break; + case 13: + OPB_CheckPtr(x, y); + break; + case 14: + if (g != 11) { + OPB_err(100); + } + break; + default: + OPB_err(100); + y->typ = x->typ; + __GUARDEQP(yval, OPT_ConstDesc) = *xval; + break; + } + f = x->typ->form; + } + switch (op) { + case 1: + if (__IN(f, 0x70)) { + xv = xval->intval; + yv = yval->intval; + if (((((xv == 0 || yv == 0) || (((xv > 0 && yv > 0)) && yv <= __DIV(2147483647, xv))) || (((xv > 0 && yv < 0)) && yv >= __DIV((-2147483647-1), xv))) || (((xv < 0 && yv > 0)) && xv >= __DIV((-2147483647-1), yv))) || (((((((xv < 0 && yv < 0)) && xv != (-2147483647-1))) && yv != (-2147483647-1))) && -xv <= __DIV(2147483647, -yv))) { + xval->intval = xv * yv; + OPB_SetIntType(x); + } else { + OPB_err(204); + } + } else if (__IN(f, 0x0180)) { + temp = __ABS(yval->realval) <= (LONGREAL)1; + if (temp || __ABS(xval->realval) <= 1.79769296342094e+308 / (LONGREAL)__ABS(yval->realval)) { + xval->realval = xval->realval * yval->realval; + OPB_CheckRealType(f, 204, xval); + } else { + OPB_err(204); + } + } else if (f == 9) { + xval->setval = (xval->setval & yval->setval); + } else if (f != 0) { + OPB_err(101); + } + break; + case 2: + if (__IN(f, 0x70)) { + if (yval->intval != 0) { + xval->realval = xval->intval / (REAL)yval->intval; + OPB_CheckRealType(7, 205, xval); + } else { + OPB_err(205); + xval->realval = (LONGREAL)1; + } + x->typ = OPT_realtyp; + } else if (__IN(f, 0x0180)) { + temp = __ABS(yval->realval) >= (LONGREAL)1; + if (temp || __ABS(xval->realval) <= 1.79769296342094e+308 * __ABS(yval->realval)) { + xval->realval = xval->realval / yval->realval; + OPB_CheckRealType(f, 205, xval); + } else { + OPB_err(205); + } + } else if (f == 9) { + xval->setval = xval->setval ^ yval->setval; + } else if (f != 0) { + OPB_err(102); + } + break; + case 3: + if (__IN(f, 0x70)) { + if (yval->intval != 0) { + xval->intval = __DIV(xval->intval, yval->intval); + OPB_SetIntType(x); + } else { + OPB_err(205); + } + } else if (f != 0) { + OPB_err(103); + } + break; + case 4: + if (__IN(f, 0x70)) { + if (yval->intval != 0) { + xval->intval = __MOD(xval->intval, yval->intval); + OPB_SetIntType(x); + } else { + OPB_err(205); + } + } else if (f != 0) { + OPB_err(104); + } + break; + case 5: + if (f == 2) { + xval->intval = OPB_BoolToInt((OPB_IntToBool(xval->intval) && OPB_IntToBool(yval->intval))); + } else { + OPB_err(94); + } + break; + case 6: + if (__IN(f, 0x70)) { + temp = (yval->intval >= 0 && xval->intval <= 2147483647 - yval->intval); + if (temp || (yval->intval < 0 && xval->intval >= (-2147483647-1) - yval->intval)) { + xval->intval += yval->intval; + OPB_SetIntType(x); + } else { + OPB_err(206); + } + } else if (__IN(f, 0x0180)) { + temp = (yval->realval >= (LONGREAL)0 && xval->realval <= 1.79769296342094e+308 - yval->realval); + if (temp || (yval->realval < (LONGREAL)0 && xval->realval >= -1.79769296342094e+308 - yval->realval)) { + xval->realval = xval->realval + yval->realval; + OPB_CheckRealType(f, 206, xval); + } else { + OPB_err(206); + } + } else if (f == 9) { + xval->setval = xval->setval | yval->setval; + } else if (f != 0) { + OPB_err(105); + } + break; + case 7: + if (__IN(f, 0x70)) { + if ((yval->intval >= 0 && xval->intval >= (-2147483647-1) + yval->intval) || (yval->intval < 0 && xval->intval <= 2147483647 + yval->intval)) { + xval->intval -= yval->intval; + OPB_SetIntType(x); + } else { + OPB_err(207); + } + } else if (__IN(f, 0x0180)) { + temp = (yval->realval >= (LONGREAL)0 && xval->realval >= -1.79769296342094e+308 + yval->realval); + if (temp || (yval->realval < (LONGREAL)0 && xval->realval <= 1.79769296342094e+308 + yval->realval)) { + xval->realval = xval->realval - yval->realval; + OPB_CheckRealType(f, 207, xval); + } else { + OPB_err(207); + } + } else if (f == 9) { + xval->setval = (xval->setval & ~yval->setval); + } else if (f != 0) { + OPB_err(106); + } + break; + case 8: + if (f == 2) { + xval->intval = OPB_BoolToInt(OPB_IntToBool(xval->intval) || OPB_IntToBool(yval->intval)); + } else { + OPB_err(95); + } + break; + case 9: + xval->intval = OPB_BoolToInt(ConstCmp__14() == 9); + break; + case 10: + xval->intval = OPB_BoolToInt(ConstCmp__14() != 9); + break; + case 11: + if (__IN(f, 0x2a04)) { + OPB_err(108); + } else { + xval->intval = OPB_BoolToInt(ConstCmp__14() == 11); + } + break; + case 12: + if (__IN(f, 0x2a04)) { + OPB_err(108); + } else { + xval->intval = OPB_BoolToInt(ConstCmp__14() != 13); + } + break; + case 13: + if (__IN(f, 0x2a04)) { + OPB_err(108); + } else { + xval->intval = OPB_BoolToInt(ConstCmp__14() == 13); + } + break; + case 14: + if (__IN(f, 0x2a04)) { + OPB_err(108); + } else { + xval->intval = OPB_BoolToInt(ConstCmp__14() != 11); + } + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPB.ConstOp, op = ", (LONGINT)37); + OPM_LogWNum(op, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + ConstOp__13_s = _s.lnk; +} + +static void OPB_Convert (OPT_Node *x, OPT_Struct typ) +{ + OPT_Node node = NIL; + INTEGER f, g; + LONGINT k; + LONGREAL r; + f = (*x)->typ->form; + g = typ->form; + if ((*x)->class == 7) { + if (__IN(f, 0x70)) { + if (__IN(g, 0x70)) { + if (f > g) { + OPB_SetIntType(*x); + if ((int)(*x)->typ->form > g) { + OPB_err(203); + (*x)->conval->intval = 1; + } + } + } else if (__IN(g, 0x0180)) { + (*x)->conval->realval = (*x)->conval->intval; + (*x)->conval->intval = -1; + } else { + k = (*x)->conval->intval; + if (0 > k || k > 255) { + OPB_err(220); + } + } + } else if (__IN(f, 0x0180)) { + if (__IN(g, 0x0180)) { + OPB_CheckRealType(g, 203, (*x)->conval); + } else { + r = (*x)->conval->realval; + if (r < -2.14748364800000e+009 || r > 2.14748364700000e+009) { + OPB_err(203); + r = (LONGREAL)1; + } + (*x)->conval->intval = __ENTIER(r); + OPB_SetIntType(*x); + } + } + (*x)->obj = NIL; + } else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((int)(*x)->left->typ->form < f || f > g))) { + if ((*x)->left->typ == typ) { + *x = (*x)->left; + } + } else { + node = OPT_NewNode(11); + node->subcl = 20; + node->left = *x; + *x = node; + } + (*x)->typ = typ; +} + +static struct Op__38 { + INTEGER *f, *g; + struct Op__38 *lnk; +} *Op__38_s; + +static void NewOp__39 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y); +static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y); + +static void NewOp__39 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y) +{ + OPT_Node node = NIL; + node = OPT_NewNode(12); + node->subcl = op; + node->typ = typ; + node->left = *x; + node->right = y; + *x = node; +} + +static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) +{ + BOOLEAN _o_result; + BOOLEAN ok, xCharArr, yCharArr; + xCharArr = (__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp->form == 3) || *Op__38_s->f == 10; + yCharArr = (__IN((*y)->typ->comp, 0x0c) && (*y)->typ->BaseTyp->form == 3) || *Op__38_s->g == 10; + if ((((xCharArr && *Op__38_s->g == 3)) && (*y)->class == 7)) { + OPB_CharToString(*y); + *Op__38_s->g = 10; + yCharArr = 1; + } + if ((((yCharArr && *Op__38_s->f == 3)) && (*x)->class == 7)) { + OPB_CharToString(*x); + *Op__38_s->f = 10; + xCharArr = 1; + } + ok = (xCharArr && yCharArr); + if (ok) { + if ((*Op__38_s->f == 10 && (*x)->conval->intval2 == 1)) { + (*x)->typ = OPT_chartyp; + (*x)->conval->intval = 0; + OPB_Index(&*y, OPB_NewIntConst(((LONGINT)(0)))); + } else if ((*Op__38_s->g == 10 && (*y)->conval->intval2 == 1)) { + (*y)->typ = OPT_chartyp; + (*y)->conval->intval = 0; + OPB_Index(&*x, OPB_NewIntConst(((LONGINT)(0)))); + } + } + _o_result = ok; + return _o_result; +} + +void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) +{ + INTEGER f, g; + OPT_Node t = NIL, z = NIL; + OPT_Struct typ = NIL; + BOOLEAN do_; + LONGINT val; + struct Op__38 _s; + _s.f = &f; + _s.g = &g; + _s.lnk = Op__38_s; + Op__38_s = &_s; + z = *x; + if (((z->class == 8 || z->class == 9) || y->class == 8) || y->class == 9) { + OPB_err(126); + } else if ((z->class == 7 && y->class == 7)) { + OPB_ConstOp(op, z, y); + z->obj = NIL; + } else { + if (z->typ != y->typ) { + g = y->typ->form; + switch (z->typ->form) { + case 3: + if (z->class == 7) { + OPB_CharToString(z); + } else { + OPB_err(100); + } + break; + case 4: + if (__IN(g, 0x01f0)) { + OPB_Convert(&z, y->typ); + } else { + OPB_err(100); + } + break; + case 5: + if (g == 4) { + OPB_Convert(&y, z->typ); + } else if (__IN(g, 0x01f0)) { + OPB_Convert(&z, y->typ); + } else { + OPB_err(100); + } + break; + case 6: + if (__IN(g, 0x70)) { + OPB_Convert(&y, z->typ); + } else if (__IN(g, 0x0180)) { + OPB_Convert(&z, y->typ); + } else { + OPB_err(100); + } + break; + case 7: + if (__IN(g, 0x70)) { + OPB_Convert(&y, z->typ); + } else if (__IN(g, 0x0180)) { + OPB_Convert(&z, y->typ); + } else { + OPB_err(100); + } + break; + case 8: + if (__IN(g, 0x01f0)) { + OPB_Convert(&y, z->typ); + } else if (__IN(g, 0x0180)) { + OPB_Convert(&y, z->typ); + } else { + OPB_err(100); + } + break; + case 11: + if (!__IN(g, 0x6000)) { + OPB_err(100); + } + break; + case 13: + OPB_CheckPtr(z, y); + break; + case 14: + if (g != 11) { + OPB_err(100); + } + break; + case 10: + break; + case 15: + if (z->typ->comp == 4) { + OPB_err(100); + } + break; + default: + OPB_err(100); + break; + } + } + typ = z->typ; + f = typ->form; + g = y->typ->form; + switch (op) { + case 1: + do_ = 1; + if (__IN(f, 0x70)) { + if (z->class == 7) { + val = z->conval->intval; + if (val == 1) { + do_ = 0; + z = y; + } else if (val == 0) { + do_ = 0; + } else if (OPB_log(val) == 1) { + t = y; + y = z; + z = t; + op = 17; + y->typ = OPT_sinttyp; + y->conval->intval = OPB_exp; + y->obj = NIL; + } + } else if (y->class == 7) { + val = y->conval->intval; + if (val == 1) { + do_ = 0; + } else if (val == 0) { + do_ = 0; + z = y; + } else if (OPB_log(val) == 1) { + op = 17; + y->typ = OPT_sinttyp; + y->conval->intval = OPB_exp; + y->obj = NIL; + } + } + } else if (!__IN(f, 0x0381)) { + OPB_err(105); + typ = OPT_undftyp; + } + if (do_) { + NewOp__39(op, typ, &z, y); + } + break; + case 2: + if (__IN(f, 0x70)) { + if ((y->class == 7 && y->conval->intval == 0)) { + OPB_err(205); + } + OPB_Convert(&z, OPT_realtyp); + OPB_Convert(&y, OPT_realtyp); + typ = OPT_realtyp; + } else if (__IN(f, 0x0180)) { + if ((y->class == 7 && y->conval->realval == (LONGREAL)0)) { + OPB_err(205); + } + } else if ((f != 9 && f != 0)) { + OPB_err(102); + typ = OPT_undftyp; + } + NewOp__39(op, typ, &z, y); + break; + case 3: + do_ = 1; + if (__IN(f, 0x70)) { + if (y->class == 7) { + val = y->conval->intval; + if (val == 0) { + OPB_err(205); + } else if (val == 1) { + do_ = 0; + } else if (OPB_log(val) == 1) { + op = 17; + y->typ = OPT_sinttyp; + y->conval->intval = -OPB_exp; + y->obj = NIL; + } + } + } else if (f != 0) { + OPB_err(103); + typ = OPT_undftyp; + } + if (do_) { + NewOp__39(op, typ, &z, y); + } + break; + case 4: + if (__IN(f, 0x70)) { + if (y->class == 7) { + if (y->conval->intval == 0) { + OPB_err(205); + } else if (OPB_log(y->conval->intval) == 1) { + op = 18; + y->conval->intval = __ASH(-1, OPB_exp); + y->obj = NIL; + } + } + } else if (f != 0) { + OPB_err(104); + typ = OPT_undftyp; + } + NewOp__39(op, typ, &z, y); + break; + case 5: + if (f == 2) { + if (z->class == 7) { + if (OPB_IntToBool(z->conval->intval)) { + z = y; + } + } else if ((y->class == 7 && OPB_IntToBool(y->conval->intval))) { + } else { + NewOp__39(op, typ, &z, y); + } + } else if (f != 0) { + OPB_err(94); + z->typ = OPT_undftyp; + } + break; + case 6: + if (!__IN(f, 0x03f1)) { + OPB_err(105); + typ = OPT_undftyp; + } + do_ = 1; + if (__IN(f, 0x70)) { + if ((z->class == 7 && z->conval->intval == 0)) { + do_ = 0; + z = y; + } + if ((y->class == 7 && y->conval->intval == 0)) { + do_ = 0; + } + } + if (do_) { + NewOp__39(op, typ, &z, y); + } + break; + case 7: + if (!__IN(f, 0x03f1)) { + OPB_err(106); + typ = OPT_undftyp; + } + if ((!__IN(f, 0x70) || y->class != 7) || y->conval->intval != 0) { + NewOp__39(op, typ, &z, y); + } + break; + case 8: + if (f == 2) { + if (z->class == 7) { + if (!OPB_IntToBool(z->conval->intval)) { + z = y; + } + } else if ((y->class == 7 && !OPB_IntToBool(y->conval->intval))) { + } else { + NewOp__39(op, typ, &z, y); + } + } else if (f != 0) { + OPB_err(95); + z->typ = OPT_undftyp; + } + break; + case 9: case 10: + if (__IN(f, 0x6bff) || strings__41(&z, &y)) { + typ = OPT_booltyp; + } else { + OPB_err(107); + typ = OPT_undftyp; + } + NewOp__39(op, typ, &z, y); + break; + case 11: case 12: case 13: case 14: + if (__IN(f, 0x01f9) || strings__41(&z, &y)) { + typ = OPT_booltyp; + } else { + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"ELSE in Op()", (LONGINT)13); + OPM_LogWLn(); + OPB_err(108); + typ = OPT_undftyp; + } + NewOp__39(op, typ, &z, y); + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPB.Op, op = ", (LONGINT)32); + OPM_LogWNum(op, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + } + *x = z; + Op__38_s = _s.lnk; +} + +void OPB_SetRange (OPT_Node *x, OPT_Node y) +{ + LONGINT k, l; + if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { + OPB_err(126); + } else if ((__IN((*x)->typ->form, 0x70) && __IN(y->typ->form, 0x70))) { + if ((*x)->class == 7) { + k = (*x)->conval->intval; + if (0 > k || k > (LONGINT)OPM_MaxSet) { + OPB_err(202); + } + } + if (y->class == 7) { + l = y->conval->intval; + if (0 > l || l > (LONGINT)OPM_MaxSet) { + OPB_err(202); + } + } + if (((*x)->class == 7 && y->class == 7)) { + if (k <= l) { + (*x)->conval->setval = __SETRNG(k, l); + } else { + OPB_err(201); + (*x)->conval->setval = __SETRNG(l, k); + } + (*x)->obj = NIL; + } else { + OPB_BindNodes(10, OPT_settyp, &*x, y); + } + } else { + OPB_err(93); + } + (*x)->typ = OPT_settyp; +} + +void OPB_SetElem (OPT_Node *x) +{ + LONGINT k; + if ((*x)->class == 8 || (*x)->class == 9) { + OPB_err(126); + } else if (!__IN((*x)->typ->form, 0x70)) { + OPB_err(93); + } else if ((*x)->class == 7) { + k = (*x)->conval->intval; + if ((0 <= k && k <= (LONGINT)OPM_MaxSet)) { + (*x)->conval->setval = __SETOF(k); + } else { + OPB_err(202); + } + (*x)->obj = NIL; + } else { + OPB_Convert(&*x, OPT_settyp); + } + (*x)->typ = OPT_settyp; +} + +static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) +{ + INTEGER f, g; + OPT_Struct y = NIL, p = NIL, q = NIL; + if (OPM_Verbose) { + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"PROCEDURE CheckAssign", (LONGINT)22); + OPM_LogWLn(); + } + y = ynode->typ; + f = x->form; + g = y->form; + if (OPM_Verbose) { + OPM_LogWStr((CHAR*)"y.form = ", (LONGINT)10); + OPM_LogWNum(y->form, ((LONGINT)(0))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"f = ", (LONGINT)5); + OPM_LogWNum(f, ((LONGINT)(0))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"g = ", (LONGINT)5); + OPM_LogWNum(g, ((LONGINT)(0))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"ynode.typ.syze = ", (LONGINT)18); + OPM_LogWNum(ynode->typ->size, ((LONGINT)(0))); + OPM_LogWLn(); + } + if (ynode->class == 8 || (ynode->class == 9 && f != 14)) { + OPB_err(126); + } + switch (f) { + case 0: case 10: + break; + case 1: + if (!__IN(g, 0x1a)) { + OPB_err(113); + } + break; + case 2: case 3: case 4: case 9: + if (g != f) { + OPB_err(113); + } + break; + case 5: + if (!__IN(g, 0x30)) { + OPB_err(113); + } + break; + case 6: + if (OPM_LIntSize == 4) { + if (!__IN(g, 0x70)) { + OPB_err(113); + } + } else { + if (!__IN(g, 0x70)) { + OPB_err(113); + } + } + break; + case 7: + if (!__IN(g, 0xf0)) { + OPB_err(113); + } + break; + case 8: + if (!__IN(g, 0x01f0)) { + OPB_err(113); + } + break; + case 13: + if ((x == y || g == 11) || (x == OPT_sysptrtyp && g == 13)) { + } else if (g == 13) { + p = x->BaseTyp; + q = y->BaseTyp; + if ((p->comp == 4 && q->comp == 4)) { + while ((((q != p && q != NIL)) && q != OPT_undftyp)) { + q = q->BaseTyp; + } + if (q == NIL) { + OPB_err(113); + } + } else { + OPB_err(113); + } + } else { + OPB_err(113); + } + break; + case 14: + if (ynode->class == 9) { + OPB_CheckProc(x, ynode->obj); + } else if (x == y || g == 11) { + } else { + OPB_err(113); + } + break; + case 12: case 11: + OPB_err(113); + break; + case 15: + x->pvused = 1; + if (x->comp == 2) { + if ((ynode->class == 7 && g == 3)) { + OPB_CharToString(ynode); + y = ynode->typ; + g = 10; + } + if (x == y) { + } else if (x->BaseTyp == OPT_chartyp) { + if (g == 10) { + if (ynode->conval->intval2 > x->n) { + OPB_err(114); + } + } else if ((__IN(y->comp, 0x0c) && y->BaseTyp == OPT_chartyp)) { + } else { + OPB_err(113); + } + } else { + OPB_err(113); + } + } else if ((x->comp == 3 && x->BaseTyp == OPT_chartyp)) { + if ((__IN(y->comp, 0x0c) && y->BaseTyp == OPT_chartyp)) { + } else { + OPB_err(113); + } + } else if (x->comp == 4) { + if (x == y) { + } else if (y->comp == 4) { + q = y->BaseTyp; + while ((((q != NIL && q != x)) && q != OPT_undftyp)) { + q = q->BaseTyp; + } + if (q == NIL) { + OPB_err(113); + } + } else { + OPB_err(113); + } + } else { + OPB_err(113); + } + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPB.CheckAssign, f = ", (LONGINT)40); + OPM_LogWNum(f, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + if ((((((ynode->class == 7 && g < f)) && __IN(g, 0xf0))) && __IN(f, 0x01e0))) { + OPB_Convert(&ynode, x); + } +} + +static void OPB_CheckLeaf (OPT_Node x, BOOLEAN dynArrToo) +{ +} + +void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) +{ + INTEGER f; + OPT_Struct typ = NIL; + OPT_Node x = NIL; + x = *par0; + f = x->typ->form; + switch (fctno) { + case 0: + if ((__IN(f, 0x70) && x->class == 7)) { + if ((0 <= x->conval->intval && x->conval->intval <= 255)) { + OPB_BindNodes(28, OPT_notyp, &x, x); + } else { + OPB_err(218); + } + } else { + OPB_err(69); + } + x->typ = OPT_notyp; + break; + case 1: + typ = OPT_notyp; + if (OPB_NotVar(x)) { + OPB_err(112); + } else if (f == 13) { + if (x->readonly) { + OPB_err(76); + } + f = x->typ->BaseTyp->comp; + if (__IN(f, 0x1c)) { + if (f == 3) { + typ = x->typ->BaseTyp; + } + OPB_BindNodes(19, OPT_notyp, &x, NIL); + x->subcl = 1; + } else { + OPB_err(111); + } + } else { + OPB_err(111); + } + x->typ = typ; + break; + case 2: + OPB_MOp(21, &x); + break; + case 3: + OPB_MOp(22, &x); + break; + case 4: + if (x->class == 8 || x->class == 9) { + OPB_err(126); + } else if (f == 3) { + OPB_Convert(&x, OPT_inttyp); + } else { + OPB_err(111); + } + x->typ = OPT_inttyp; + break; + case 5: + if (x->class == 8 || x->class == 9) { + OPB_err(126); + } else if (__IN(f, 0x0180)) { + OPB_Convert(&x, OPT_linttyp); + } else { + OPB_err(111); + } + x->typ = OPT_linttyp; + break; + case 6: + OPB_MOp(23, &x); + break; + case 7: + if (x->class == 8) { + switch (f) { + case 2: + x = OPB_NewBoolConst(0); + break; + case 3: + x = OPB_NewIntConst(((LONGINT)(0))); + x->typ = OPT_chartyp; + break; + case 4: + x = OPB_NewIntConst(OPM_MinSInt); + break; + case 5: + x = OPB_NewIntConst(OPM_MinInt); + break; + case 6: + x = OPB_NewIntConst(OPM_MinLInt); + break; + case 9: + x = OPB_NewIntConst(((LONGINT)(0))); + x->typ = OPT_inttyp; + break; + case 7: + x = OPB_NewRealConst(OPM_MinReal, OPT_realtyp); + break; + case 8: + x = OPB_NewRealConst(OPM_MinLReal, OPT_lrltyp); + break; + default: + OPB_err(111); + break; + } + } else { + OPB_err(110); + } + break; + case 8: + if (x->class == 8) { + switch (f) { + case 2: + x = OPB_NewBoolConst(1); + break; + case 3: + x = OPB_NewIntConst(((LONGINT)(255))); + x->typ = OPT_chartyp; + break; + case 4: + x = OPB_NewIntConst(OPM_MaxSInt); + break; + case 5: + x = OPB_NewIntConst(OPM_MaxInt); + break; + case 6: + x = OPB_NewIntConst(OPM_MaxLInt); + break; + case 9: + x = OPB_NewIntConst(OPM_MaxSet); + x->typ = OPT_inttyp; + break; + case 7: + x = OPB_NewRealConst(OPM_MaxReal, OPT_realtyp); + break; + case 8: + x = OPB_NewRealConst(OPM_MaxLReal, OPT_lrltyp); + break; + default: + OPB_err(111); + break; + } + } else { + OPB_err(110); + } + break; + case 9: + if (x->class == 8 || x->class == 9) { + OPB_err(126); + } else if (__IN(f, 0x71)) { + OPB_Convert(&x, OPT_chartyp); + } else { + OPB_err(111); + x->typ = OPT_chartyp; + } + break; + case 10: + if (x->class == 8 || x->class == 9) { + OPB_err(126); + } else if (f == 5) { + OPB_Convert(&x, OPT_sinttyp); + } else if (f == 6) { + OPB_Convert(&x, OPT_inttyp); + } else if (f == 8) { + OPB_Convert(&x, OPT_realtyp); + } else { + OPB_err(111); + } + break; + case 11: + if (x->class == 8 || x->class == 9) { + OPB_err(126); + } else if (f == 4) { + OPB_Convert(&x, OPT_inttyp); + } else if (f == 5) { + OPB_Convert(&x, OPT_linttyp); + } else if (f == 7) { + OPB_Convert(&x, OPT_lrltyp); + } else if (f == 3) { + OPB_Convert(&x, OPT_linttyp); + } else { + OPB_err(111); + } + break; + case 13: case 14: + if (OPB_NotVar(x)) { + OPB_err(112); + } else if (!__IN(f, 0x70)) { + OPB_err(111); + } else if (x->readonly) { + OPB_err(76); + } + break; + case 15: case 16: + if (OPB_NotVar(x)) { + OPB_err(112); + } else if (x->typ != OPT_settyp) { + OPB_err(111); + x->typ = OPT_settyp; + } else if (x->readonly) { + OPB_err(76); + } + break; + case 17: + if (!__IN(x->typ->comp, 0x0c)) { + OPB_err(131); + } + break; + case 18: + if ((x->class == 7 && f == 3)) { + OPB_CharToString(x); + f = 10; + } + if (x->class == 8 || x->class == 9) { + OPB_err(126); + } else if (((!__IN(x->typ->comp, 0x0c) || x->typ->BaseTyp->form != 3) && f != 10)) { + OPB_err(111); + } + break; + case 19: + if (x->class == 8 || x->class == 9) { + OPB_err(126); + } else if (__IN(f, 0x70)) { + if (f != 6) { + OPB_Convert(&x, OPT_linttyp); + } + } else { + OPB_err(111); + x->typ = OPT_linttyp; + } + break; + case 20: + OPB_CheckLeaf(x, 0); + OPB_MOp(24, &x); + break; + case 12: + if (x->class != 8) { + OPB_err(110); + x = OPB_NewIntConst(((LONGINT)(1))); + } else if (__IN(f, 0x63fe) || __IN(x->typ->comp, 0x14)) { + (*OPB_typSize)(x->typ); + x->typ->pvused = 1; + x = OPB_NewIntConst(x->typ->size); + } else { + OPB_err(111); + x = OPB_NewIntConst(((LONGINT)(1))); + } + break; + case 21: + OPB_MOp(25, &x); + break; + case 22: case 23: + if (x->class == 8 || x->class == 9) { + OPB_err(126); + } else if (!__IN(f, 0x027a)) { + OPB_err(111); + } + break; + case 24: case 25: case 28: case 31: + if (x->class == 8 || x->class == 9) { + OPB_err(126); + } else if ((x->class == 7 && __IN(f, 0x30))) { + OPB_Convert(&x, OPT_linttyp); + } else if (!__IN(f, 0x2040)) { + OPB_err(111); + x->typ = OPT_linttyp; + } + break; + case 26: case 27: + if ((__IN(f, 0x70) && x->class == 7)) { + if (x->conval->intval < 0 || x->conval->intval > -1) { + OPB_err(220); + } + } else { + OPB_err(69); + } + break; + case 29: + if (x->class != 8) { + OPB_err(110); + } else if (__IN(f, 0x1401) || x->typ->comp == 3) { + OPB_err(111); + } + break; + case 30: + if (OPB_NotVar(x)) { + OPB_err(112); + } else if (f == 13) { + } else { + OPB_err(111); + } + break; + case 32: + if (x->class == 8 || x->class == 9) { + OPB_err(126); + x = OPB_NewBoolConst(0); + } else if (f != 2) { + OPB_err(120); + x = OPB_NewBoolConst(0); + } else { + OPB_MOp(33, &x); + } + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPB.StPar0, fctno = ", (LONGINT)39); + OPM_LogWNum(fctno, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + *par0 = x; +} + +static struct StPar1__52 { + struct StPar1__52 *lnk; +} *StPar1__52_s; + +static OPT_Node NewOp__53 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right); + +static OPT_Node NewOp__53 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right) +{ + OPT_Node _o_result; + OPT_Node node = NIL; + node = OPT_NewNode(class); + node->subcl = subcl; + node->left = left; + node->right = right; + _o_result = node; + return _o_result; +} + +void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) +{ + INTEGER f, L; + OPT_Struct typ = NIL; + OPT_Node p = NIL, t = NIL; + struct StPar1__52 _s; + _s.lnk = StPar1__52_s; + StPar1__52_s = &_s; + p = *par0; + f = x->typ->form; + switch (fctno) { + case 13: case 14: + if (x->class == 8 || x->class == 9) { + OPB_err(126); + p->typ = OPT_notyp; + } else { + if (x->typ != p->typ) { + if ((x->class == 7 && __IN(f, 0x70))) { + OPB_Convert(&x, p->typ); + } else { + OPB_err(111); + } + } + p = NewOp__53(19, fctno, p, x); + p->typ = OPT_notyp; + } + break; + case 15: case 16: + if (x->class == 8 || x->class == 9) { + OPB_err(126); + } else if (__IN(f, 0x70)) { + if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > (LONGINT)OPM_MaxSet))) { + OPB_err(202); + } + p = NewOp__53(19, fctno, p, x); + } else { + OPB_err(111); + } + p->typ = OPT_notyp; + break; + case 17: + if (!__IN(f, 0x70) || x->class != 7) { + OPB_err(69); + } else if (f == 4) { + L = (int)x->conval->intval; + typ = p->typ; + while ((L > 0 && __IN(typ->comp, 0x0c))) { + typ = typ->BaseTyp; + L -= 1; + } + if (L != 0 || !__IN(typ->comp, 0x0c)) { + OPB_err(132); + } else { + x->obj = NIL; + if (typ->comp == 3) { + while (p->class == 4) { + p = p->left; + x->conval->intval += 1; + } + p = NewOp__53(12, 19, p, x); + p->typ = OPT_linttyp; + } else { + p = x; + p->conval->intval = typ->n; + OPB_SetIntType(p); + } + } + } else { + OPB_err(132); + } + break; + case 18: + if (OPB_NotVar(x)) { + OPB_err(112); + } else if ((__IN(x->typ->comp, 0x0c) && x->typ->BaseTyp->form == 3)) { + if (x->readonly) { + OPB_err(76); + } + t = x; + x = p; + p = t; + p = NewOp__53(19, 18, p, x); + } else { + OPB_err(111); + } + p->typ = OPT_notyp; + break; + case 19: + if (x->class == 8 || x->class == 9) { + OPB_err(126); + } else if (__IN(f, 0x70)) { + if ((p->class == 7 && x->class == 7)) { + if (-OPB_maxExp > x->conval->intval || x->conval->intval > OPB_maxExp) { + OPB_err(208); + p->conval->intval = 1; + } else if (x->conval->intval >= 0) { + if (__ABS(p->conval->intval) <= __DIV(2147483647, __ASH(1, x->conval->intval))) { + p->conval->intval = p->conval->intval * __ASH(1, x->conval->intval); + } else { + OPB_err(208); + p->conval->intval = 1; + } + } else { + p->conval->intval = __ASH(p->conval->intval, x->conval->intval); + } + p->obj = NIL; + } else { + p = NewOp__53(12, 17, p, x); + p->typ = OPT_linttyp; + } + } else { + OPB_err(111); + } + break; + case 1: + if (x->class == 8 || x->class == 9) { + OPB_err(126); + } else if (p->typ->comp == 3) { + if (__IN(f, 0x70)) { + if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > OPM_MaxIndex))) { + OPB_err(63); + } + } else { + OPB_err(111); + } + p->right = x; + p->typ = p->typ->BaseTyp; + } else { + OPB_err(64); + } + break; + case 22: case 23: + if (x->class == 8 || x->class == 9) { + OPB_err(126); + } else if (!__IN(f, 0x70)) { + OPB_err(111); + } else { + if (fctno == 22) { + p = NewOp__53(12, 27, p, x); + } else { + p = NewOp__53(12, 28, p, x); + } + p->typ = p->left->typ; + } + break; + case 24: case 25: case 26: case 27: + if (x->class == 8 || x->class == 9) { + OPB_err(126); + } else if (__IN(f, 0x63ff)) { + if (fctno == 24 || fctno == 26) { + if (OPB_NotVar(x)) { + OPB_err(112); + } + t = x; + x = p; + p = t; + } + p = NewOp__53(19, fctno, p, x); + } else { + OPB_err(111); + } + p->typ = OPT_notyp; + break; + case 28: + if (x->class == 8 || x->class == 9) { + OPB_err(126); + } else if (__IN(f, 0x70)) { + p = NewOp__53(12, 26, p, x); + } else { + OPB_err(111); + } + p->typ = OPT_booltyp; + break; + case 29: + if (((x->class == 8 || x->class == 9) || __IN(f, 0x1401)) || x->typ->comp == 3) { + OPB_err(126); + } + t = OPT_NewNode(11); + t->subcl = 29; + t->left = x; + x = t; + x->typ = p->typ; + p = x; + break; + case 30: + if (x->class == 8 || x->class == 9) { + OPB_err(126); + } else if (__IN(f, 0x70)) { + p = NewOp__53(19, 30, p, x); + } else { + OPB_err(111); + } + p->typ = OPT_notyp; + break; + case 31: + if (x->class == 8 || x->class == 9) { + OPB_err(126); + } else if ((x->class == 7 && __IN(f, 0x30))) { + OPB_Convert(&x, OPT_linttyp); + } else if (!__IN(f, 0x2040)) { + OPB_err(111); + x->typ = OPT_linttyp; + } + p->link = x; + break; + case 32: + if ((__IN(f, 0x70) && x->class == 7)) { + if ((0 <= x->conval->intval && x->conval->intval <= 255)) { + OPB_BindNodes(28, OPT_notyp, &x, x); + x->conval = OPT_NewConst(); + x->conval->intval = OPM_errpos; + OPB_Construct(15, &p, x); + p->conval = OPT_NewConst(); + p->conval->intval = OPM_errpos; + OPB_Construct(20, &p, NIL); + OPB_OptIf(&p); + if (p == NIL) { + } else if (p->class == 28) { + OPB_err(99); + } else { + p->subcl = 32; + } + } else { + OPB_err(218); + } + } else { + OPB_err(69); + } + break; + default: + OPB_err(64); + break; + } + *par0 = p; + StPar1__52_s = _s.lnk; +} + +void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n) +{ + OPT_Node node = NIL; + INTEGER f; + OPT_Node p = NIL; + p = *par0; + f = x->typ->form; + if (fctno == 1) { + if (x->class == 8 || x->class == 9) { + OPB_err(126); + } else if (p->typ->comp != 3) { + OPB_err(64); + } else if (__IN(f, 0x70)) { + if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > OPM_MaxIndex))) { + OPB_err(63); + } + node = p->right; + while (node->link != NIL) { + node = node->link; + } + node->link = x; + p->typ = p->typ->BaseTyp; + } else { + OPB_err(111); + } + } else if ((fctno == 31 && n == 2)) { + if (x->class == 8 || x->class == 9) { + OPB_err(126); + } else if (__IN(f, 0x70)) { + node = OPT_NewNode(19); + node->subcl = 31; + node->right = p; + node->left = p->link; + p->link = x; + p = node; + } else { + OPB_err(111); + } + p->typ = OPT_notyp; + } else { + OPB_err(64); + } + *par0 = p; +} + +void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno) +{ + INTEGER dim; + OPT_Node x = NIL, p = NIL; + p = *par0; + if (fctno <= 19) { + if ((fctno == 1 && p->typ != OPT_notyp)) { + if (p->typ->comp == 3) { + OPB_err(65); + } + p->typ = OPT_notyp; + } else if (fctno <= 12) { + if (parno < 1) { + OPB_err(65); + } + } else { + if (((fctno == 13 || fctno == 14) && parno == 1)) { + OPB_BindNodes(19, OPT_notyp, &p, OPB_NewIntConst(((LONGINT)(1)))); + p->subcl = fctno; + p->right->typ = p->left->typ; + } else if ((fctno == 17 && parno == 1)) { + if (p->typ->comp == 3) { + dim = 0; + while (p->class == 4) { + p = p->left; + dim += 1; + } + OPB_BindNodes(12, OPT_linttyp, &p, OPB_NewIntConst(dim)); + p->subcl = 19; + } else { + p = OPB_NewIntConst(p->typ->n); + } + } else if (parno < 2) { + OPB_err(65); + } + } + } else if (fctno == 32) { + if (parno == 1) { + x = NIL; + OPB_BindNodes(28, OPT_notyp, &x, OPB_NewIntConst(((LONGINT)(0)))); + x->conval = OPT_NewConst(); + x->conval->intval = OPM_errpos; + OPB_Construct(15, &p, x); + p->conval = OPT_NewConst(); + p->conval->intval = OPM_errpos; + OPB_Construct(20, &p, NIL); + OPB_OptIf(&p); + if (p == NIL) { + } else if (p->class == 28) { + OPB_err(99); + } else { + p->subcl = 32; + } + } else if (parno < 1) { + OPB_err(65); + } + } else { + if ((parno < 1 || (fctno > 21 && parno < 2)) || (fctno == 31 && parno < 3)) { + OPB_err(65); + } + } + *par0 = p; +} + +static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpar) +{ + INTEGER f; + f = atyp->comp; + ftyp = ftyp->BaseTyp; + atyp = atyp->BaseTyp; + if ((fvarpar && ftyp == OPT_bytetyp)) { + if (!__IN(f, 0x0c) || !__IN(atyp->form, 0x1e)) { + if (__IN(18, OPM_opt)) { + OPB_err(-301); + } + } + } else if (__IN(f, 0x0c)) { + if (ftyp->comp == 3) { + OPB_DynArrParCheck(ftyp, atyp, fvarpar); + } else if (ftyp != atyp) { + if ((((!fvarpar && ftyp->form == 13)) && atyp->form == 13)) { + ftyp = ftyp->BaseTyp; + atyp = atyp->BaseTyp; + if ((ftyp->comp == 4 && atyp->comp == 4)) { + while ((((ftyp != atyp && atyp != NIL)) && atyp != OPT_undftyp)) { + atyp = atyp->BaseTyp; + } + if (atyp == NIL) { + OPB_err(113); + } + } else { + OPB_err(66); + } + } else { + OPB_err(66); + } + } + } else { + OPB_err(67); + } +} + +static void OPB_CheckReceiver (OPT_Node *x, OPT_Object fp) +{ + if (fp->typ->form == 13) { + if ((*x)->class == 3) { + *x = (*x)->left; + } else { + OPB_err(71); + } + } +} + +void OPB_PrepCall (OPT_Node *x, OPT_Object *fpar) +{ + if (((*x)->obj != NIL && __IN((*x)->obj->mode, 0x22c0))) { + *fpar = (*x)->obj->link; + if ((*x)->obj->mode == 13) { + OPB_CheckReceiver(&(*x)->left, *fpar); + *fpar = (*fpar)->link; + } + } else if (((((*x)->class != 8 && (*x)->typ != NIL)) && (*x)->typ->form == 14)) { + *fpar = (*x)->typ->link; + } else { + OPB_err(121); + *fpar = NIL; + (*x)->typ = OPT_undftyp; + } +} + +void OPB_Param (OPT_Node ap, OPT_Object fp) +{ + OPT_Struct q = NIL; + if (fp->typ->form != 0) { + if (fp->mode == 2) { + if (OPB_NotVar(ap)) { + OPB_err(122); + } else { + OPB_CheckLeaf(ap, 0); + } + if (ap->readonly) { + OPB_err(76); + } + if (fp->typ->comp == 3) { + OPB_DynArrParCheck(fp->typ, ap->typ, 1); + } else if ((fp->typ->comp == 4 && ap->typ->comp == 4)) { + q = ap->typ; + while ((((q != fp->typ && q != NIL)) && q != OPT_undftyp)) { + q = q->BaseTyp; + } + if (q == NIL) { + OPB_err(111); + } + } else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 13)) { + } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && __IN(ap->typ->form, 0x18))))) { + OPB_err(123); + } else if ((fp->typ->form == 13 && ap->class == 5)) { + OPB_err(123); + } + } else if (fp->typ->comp == 3) { + if ((ap->class == 7 && ap->typ->form == 3)) { + OPB_CharToString(ap); + } + if ((ap->typ->form == 10 && fp->typ->BaseTyp->form == 3)) { + } else if (ap->class >= 7) { + OPB_err(59); + } else { + OPB_DynArrParCheck(fp->typ, ap->typ, 0); + } + } else { + OPB_CheckAssign(fp->typ, ap); + } + } +} + +void OPB_StaticLink (SHORTINT dlev) +{ + OPT_Object scope = NIL; + scope = OPT_topScope; + while (dlev > 0) { + dlev -= 1; + scope->link->conval->setval |= __SETOF(3); + scope = scope->left; + } +} + +void OPB_Call (OPT_Node *x, OPT_Node apar, OPT_Object fp) +{ + OPT_Struct typ = NIL; + OPT_Node p = NIL; + SHORTINT lev; + if ((*x)->class == 9) { + typ = (*x)->typ; + lev = (*x)->obj->mnolev; + if (lev > 0) { + OPB_StaticLink(OPT_topScope->mnolev - lev); + } + if ((*x)->obj->mode == 10) { + OPB_err(121); + } + } else if (((*x)->class == 2 && (*x)->obj->mode == 13)) { + typ = (*x)->typ; + (*x)->class = 9; + p = (*x)->left; + (*x)->left = NIL; + p->link = apar; + apar = p; + fp = (*x)->obj->link; + } else { + typ = (*x)->typ->BaseTyp; + } + OPB_BindNodes(13, typ, &*x, apar); + (*x)->obj = fp; +} + +void OPB_Enter (OPT_Node *procdec, OPT_Node stat, OPT_Object proc) +{ + OPT_Node x = NIL; + x = OPT_NewNode(18); + x->typ = OPT_notyp; + x->obj = proc; + x->left = *procdec; + x->right = stat; + *procdec = x; +} + +void OPB_Return (OPT_Node *x, OPT_Object proc) +{ + OPT_Node node = NIL; + if (proc == NIL) { + if (*x != NIL) { + OPB_err(124); + } + } else { + if (*x != NIL) { + OPB_CheckAssign(proc->typ, *x); + } else if (proc->typ != OPT_notyp) { + OPB_err(124); + } + } + node = OPT_NewNode(26); + node->typ = OPT_notyp; + node->obj = proc; + node->left = *x; + *x = node; +} + +void OPB_Assign (OPT_Node *x, OPT_Node y) +{ + OPT_Node z = NIL; + SHORTINT subcl; + if ((*x)->class >= 7) { + OPB_err(56); + } + OPB_CheckAssign((*x)->typ, y); + if ((*x)->readonly) { + OPB_err(76); + } + if ((*x)->typ->comp == 4) { + if ((*x)->class == 5) { + z = (*x)->left; + } else { + z = *x; + } + if ((z->class == 3 && z->left->class == 5)) { + z->left = z->left->left; + } + if (((*x)->typ->strobj != NIL && (z->class == 3 || z->class == 1))) { + OPB_BindNodes(6, (*x)->typ, &z, NIL); + *x = z; + } + } else if (((((((*x)->typ->comp == 2 && (*x)->typ->BaseTyp == OPT_chartyp)) && y->typ->form == 10)) && y->conval->intval2 == 1)) { + y->typ = OPT_chartyp; + y->conval->intval = 0; + OPB_Index(&*x, OPB_NewIntConst(((LONGINT)(0)))); + } + if ((((((__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp == OPT_chartyp)) && __IN(y->typ->comp, 0x0c))) && y->typ->BaseTyp == OPT_chartyp)) { + subcl = 18; + } else { + subcl = 0; + } + OPB_BindNodes(19, OPT_notyp, &*x, y); + (*x)->subcl = subcl; +} + +void OPB_Inittd (OPT_Node *inittd, OPT_Node *last, OPT_Struct typ) +{ + OPT_Node node = NIL; + node = OPT_NewNode(14); + node->typ = typ; + node->conval = OPT_NewConst(); + node->conval->intval = typ->txtpos; + if (*inittd == NIL) { + *inittd = node; + } else { + (*last)->link = node; + } + *last = node; +} + + +export void *OPB__init(void) +{ + __DEFMOD; + __MODULE_IMPORT(OPM); + __MODULE_IMPORT(OPS); + __MODULE_IMPORT(OPT); + __REGMOD("OPB", 0); +/* BEGIN */ + OPB_maxExp = OPB_log(1073741824); + OPB_maxExp = OPB_exp; + __ENDMOD; +} diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h new file mode 100644 index 00000000..8cd47ee6 --- /dev/null +++ b/bootstrap/windows-48/OPB.h @@ -0,0 +1,49 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ + +#ifndef OPB__h +#define OPB__h + +#include "SYSTEM.h" +#include "OPS.h" +#include "OPT.h" + + +import void (*OPB_typSize)(OPT_Struct); + + +import void OPB_Assign (OPT_Node *x, OPT_Node y); +import void OPB_Call (OPT_Node *x, OPT_Node apar, OPT_Object fp); +import void OPB_CheckParameters (OPT_Object fp, OPT_Object ap, BOOLEAN checkNames); +import void OPB_Construct (SHORTINT class, OPT_Node *x, OPT_Node y); +import void OPB_DeRef (OPT_Node *x); +import OPT_Node OPB_EmptySet (void); +import void OPB_Enter (OPT_Node *procdec, OPT_Node stat, OPT_Object proc); +import void OPB_Field (OPT_Node *x, OPT_Object y); +import void OPB_In (OPT_Node *x, OPT_Node y); +import void OPB_Index (OPT_Node *x, OPT_Node y); +import void OPB_Inittd (OPT_Node *inittd, OPT_Node *last, OPT_Struct typ); +import void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y); +import void OPB_MOp (SHORTINT op, OPT_Node *x); +import OPT_Node OPB_NewBoolConst (BOOLEAN boolval); +import OPT_Node OPB_NewIntConst (LONGINT intval); +import OPT_Node OPB_NewLeaf (OPT_Object obj); +import OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ); +import OPT_Node OPB_NewString (OPS_String str, LONGINT len); +import OPT_Node OPB_Nil (void); +import void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y); +import void OPB_OptIf (OPT_Node *x); +import void OPB_Param (OPT_Node ap, OPT_Object fp); +import void OPB_PrepCall (OPT_Node *x, OPT_Object *fpar); +import void OPB_Return (OPT_Node *x, OPT_Object proc); +import void OPB_SetElem (OPT_Node *x); +import void OPB_SetRange (OPT_Node *x, OPT_Node y); +import void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno); +import void OPB_StPar0 (OPT_Node *par0, INTEGER fctno); +import void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno); +import void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n); +import void OPB_StaticLink (SHORTINT dlev); +import void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard); +import void *OPB__init(void); + + +#endif diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c new file mode 100644 index 00000000..32a1496f --- /dev/null +++ b/bootstrap/windows-48/OPC.c @@ -0,0 +1,2108 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +#include "SYSTEM.h" +#include "Configuration.h" +#include "OPM.h" +#include "OPT.h" + + +static INTEGER OPC_indentLevel; +static BOOLEAN OPC_ptrinit, OPC_mainprog, OPC_ansi; +static SHORTINT OPC_hashtab[105]; +static CHAR OPC_keytab[36][9]; +static BOOLEAN OPC_GlbPtrs; +static CHAR OPC_BodyNameExt[13]; + + +export void OPC_Align (LONGINT *adr, LONGINT base); +export void OPC_Andent (OPT_Struct typ); +static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames); +export LONGINT OPC_Base (OPT_Struct typ); +export OPT_Object OPC_BaseTProc (OPT_Object obj); +export void OPC_BegBlk (void); +export void OPC_BegStat (void); +static void OPC_CProcDefs (OPT_Object obj, INTEGER vis); +export void OPC_Case (LONGINT caseVal, INTEGER form); +export void OPC_Cmp (INTEGER rel); +export void OPC_CompleteIdent (OPT_Object obj); +export void OPC_Constant (OPT_Const con, INTEGER form); +static void OPC_DeclareBase (OPT_Object dcl); +static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef); +static void OPC_DeclareParams (OPT_Object par, BOOLEAN macro); +static void OPC_DeclareTProcs (OPT_Object obj, BOOLEAN *empty); +static void OPC_DefAnonRecs (OPT_Node n); +export void OPC_DefineInter (OPT_Object proc); +static void OPC_DefineTProcMacros (OPT_Object obj, BOOLEAN *empty); +static void OPC_DefineTProcTypes (OPT_Object obj); +static void OPC_DefineType (OPT_Struct str); +export void OPC_EndBlk (void); +export void OPC_EndBlk0 (void); +export void OPC_EndStat (void); +export void OPC_EnterBody (void); +export void OPC_EnterProc (OPT_Object proc); +export void OPC_ExitBody (void); +export void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet); +static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, LONGINT *off, LONGINT *n, LONGINT *curAlign); +static void OPC_FillGap (LONGINT gap, LONGINT off, LONGINT align, LONGINT *n, LONGINT *curAlign); +export void OPC_GenBdy (OPT_Node n); +static void OPC_GenDynTypes (OPT_Node n, INTEGER vis); +export void OPC_GenEnumPtrs (OPT_Object var); +export void OPC_GenHdr (OPT_Node n); +export void OPC_GenHdrIncludes (void); +static void OPC_GenHeaderMsg (void); +export void OPC_Halt (LONGINT n); +export void OPC_Ident (OPT_Object obj); +static void OPC_IdentList (OPT_Object obj, INTEGER vis); +static void OPC_Include (CHAR *name, LONGINT name__len); +static void OPC_IncludeImports (OPT_Object obj, INTEGER vis); +export void OPC_Increment (BOOLEAN decrement); +export void OPC_Indent (INTEGER count); +export void OPC_Init (void); +static void OPC_InitImports (OPT_Object obj); +static void OPC_InitKeywords (void); +export void OPC_InitTDesc (OPT_Struct typ); +static void OPC_InitTProcs (OPT_Object typ, OPT_Object obj); +export void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim); +static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName); +static INTEGER OPC_Length (CHAR *s, LONGINT s__len); +export LONGINT OPC_NofPtrs (OPT_Struct typ); +static INTEGER OPC_PerfectHash (CHAR *s, LONGINT s__len); +static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len); +static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define); +static void OPC_ProcPredefs (OPT_Object obj, SHORTINT vis); +static void OPC_PutBase (OPT_Struct typ); +static void OPC_PutPtrOffsets (OPT_Struct typ, LONGINT adr, LONGINT *cnt); +static void OPC_RegCmds (OPT_Object obj); +export void OPC_SetInclude (BOOLEAN exclude); +static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause); +static void OPC_Str1 (CHAR *s, LONGINT s__len, LONGINT x); +export void OPC_TDescDecl (OPT_Struct typ); +export void OPC_TypeDefs (OPT_Object obj, INTEGER vis); +export void OPC_TypeOf (OPT_Object ap); +static BOOLEAN OPC_Undefined (OPT_Object obj); + + +void OPC_Init (void) +{ + OPC_indentLevel = 0; + OPC_ptrinit = __IN(5, OPM_opt); + OPC_mainprog = OPM_mainProg || OPM_mainLinkStat; + OPC_ansi = __IN(6, OPM_opt); + if (OPC_ansi) { + __MOVE("__init(void)", OPC_BodyNameExt, 13); + } else { + __MOVE("__init()", OPC_BodyNameExt, 9); + } +} + +void OPC_Indent (INTEGER count) +{ + OPC_indentLevel += count; +} + +void OPC_BegStat (void) +{ + INTEGER i; + i = OPC_indentLevel; + while (i > 0) { + OPM_Write(0x09); + i -= 1; + } +} + +void OPC_EndStat (void) +{ + OPM_Write(';'); + OPM_WriteLn(); +} + +void OPC_BegBlk (void) +{ + OPM_Write('{'); + OPM_WriteLn(); + OPC_indentLevel += 1; +} + +void OPC_EndBlk (void) +{ + OPC_indentLevel -= 1; + OPC_BegStat(); + OPM_Write('}'); + OPM_WriteLn(); +} + +void OPC_EndBlk0 (void) +{ + OPC_indentLevel -= 1; + OPC_BegStat(); + OPM_Write('}'); +} + +static void OPC_Str1 (CHAR *s, LONGINT s__len, LONGINT x) +{ + CHAR ch; + INTEGER i; + __DUP(s, s__len, CHAR); + ch = s[0]; + i = 0; + while (ch != 0x00) { + if (ch == '#') { + OPM_WriteInt(x); + } else { + OPM_Write(ch); + } + i += 1; + ch = s[__X(i, s__len)]; + } + __DEL(s); +} + +static INTEGER OPC_Length (CHAR *s, LONGINT s__len) +{ + INTEGER _o_result; + INTEGER i; + i = 0; + while (s[__X(i, s__len)] != 0x00) { + i += 1; + } + _o_result = i; + return _o_result; +} + +static INTEGER OPC_PerfectHash (CHAR *s, LONGINT s__len) +{ + INTEGER _o_result; + INTEGER i, h; + i = 0; + h = 0; + while ((s[__X(i, s__len)] != 0x00 && i < 5)) { + h = 3 * h + (int)s[__X(i, s__len)]; + i += 1; + } + _o_result = (int)__MOD(h, 105); + return _o_result; +} + +void OPC_Ident (OPT_Object obj) +{ + INTEGER mode, level, h; + mode = obj->mode; + level = obj->mnolev; + if ((__IN(mode, 0x62) && level > 0) || __IN(mode, 0x14)) { + OPM_WriteStringVar((void*)obj->name, ((LONGINT)(256))); + h = OPC_PerfectHash((void*)obj->name, ((LONGINT)(256))); + if (OPC_hashtab[__X(h, ((LONGINT)(105)))] >= 0) { + if (__STRCMP(OPC_keytab[__X(OPC_hashtab[__X(h, ((LONGINT)(105)))], ((LONGINT)(36)))], obj->name) == 0) { + OPM_Write('_'); + } + } + } else { + if (mode != 5 || obj->linkadr != 2) { + if (mode == 13) { + OPC_Ident(obj->link->typ->strobj); + } else if (level < 0) { + OPM_WriteStringVar((void*)OPT_GlbMod[__X(-level, ((LONGINT)(64)))]->name, ((LONGINT)(256))); + if (OPM_currFile == 0) { + OPT_GlbMod[__X(-level, ((LONGINT)(64)))]->vis = 1; + } + } else { + OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); + } + OPM_Write('_'); + } else if (obj == OPT_sysptrtyp->strobj || obj == OPT_bytetyp->strobj) { + OPM_WriteString((CHAR*)"SYSTEM_", (LONGINT)8); + } + OPM_WriteStringVar((void*)obj->name, ((LONGINT)(256))); + } +} + +static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause) +{ + INTEGER pointers; + *openClause = 0; + if (((typ->strobj == NIL || typ->strobj->name[0] == 0x00) && typ->comp != 4)) { + if (__IN(typ->comp, 0x0c)) { + OPC_Stars(typ->BaseTyp, &*openClause); + *openClause = typ->comp == 2; + } else if (typ->form == 14) { + OPM_Write('('); + OPM_Write('*'); + } else { + pointers = 0; + while (((typ->strobj == NIL || typ->strobj->name[0] == 0x00) && typ->form == 13)) { + pointers += 1; + typ = typ->BaseTyp; + } + if (pointers > 0) { + if (typ->comp != 3) { + OPC_Stars(typ, &*openClause); + } + if (*openClause) { + OPM_Write('('); + *openClause = 0; + } + while (pointers > 0) { + OPM_Write('*'); + pointers -= 1; + } + } + } + } +} + +static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef) +{ + OPT_Struct typ = NIL; + BOOLEAN varPar, openClause; + INTEGER form, comp; + typ = dcl->typ; + varPar = ((dcl->mode == 2 && typ->comp != 2) || typ->comp == 3) || scopeDef; + OPC_Stars(typ, &openClause); + if (varPar) { + if (openClause) { + OPM_Write('('); + } + OPM_Write('*'); + } + if (dcl->name[0] != 0x00) { + OPC_Ident(dcl); + } + if ((varPar && openClause)) { + OPM_Write(')'); + } + openClause = 0; + for (;;) { + form = typ->form; + comp = typ->comp; + if (((typ->strobj != NIL && typ->strobj->name[0] != 0x00) || form == 12) || comp == 4) { + break; + } else if ((form == 13 && typ->BaseTyp->comp != 3)) { + openClause = 1; + } else if (form == 14 || __IN(comp, 0x0c)) { + if (openClause) { + OPM_Write(')'); + openClause = 0; + } + if (form == 14) { + if (OPC_ansi) { + OPM_Write(')'); + OPC_AnsiParamList(typ->link, 0); + } else { + OPM_WriteString((CHAR*)")()", (LONGINT)4); + } + break; + } else if (comp == 2) { + OPM_Write('['); + OPM_WriteInt(typ->n); + OPM_Write(']'); + } + } else { + break; + } + typ = typ->BaseTyp; + } +} + +void OPC_Andent (OPT_Struct typ) +{ + if (typ->strobj == NIL || typ->align >= 65536) { + OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); + OPC_Str1((CHAR*)"__#", (LONGINT)4, __ASHR(typ->align, 16)); + } else { + OPC_Ident(typ->strobj); + } +} + +static BOOLEAN OPC_Undefined (OPT_Object obj) +{ + BOOLEAN _o_result; + _o_result = (((obj->mnolev >= 0 && obj->linkadr != (LONGINT)(3 + OPM_currFile))) && obj->linkadr != 2) || obj->name[0] == 0x00; + return _o_result; +} + +static void OPC_DeclareBase (OPT_Object dcl) +{ + OPT_Struct typ = NIL, prev = NIL; + OPT_Object obj = NIL; + INTEGER nofdims; + LONGINT off, n, dummy; + typ = dcl->typ; + prev = typ; + while ((((((((typ->strobj == NIL || typ->comp == 3) || OPC_Undefined(typ->strobj)) && typ->comp != 4)) && typ->form != 12)) && !((typ->form == 13 && typ->BaseTyp->comp == 3)))) { + prev = typ; + typ = typ->BaseTyp; + } + obj = typ->strobj; + if (typ->form == 12) { + OPM_WriteString((CHAR*)"void", (LONGINT)5); + } else if ((obj != NIL && !OPC_Undefined(obj))) { + OPC_Ident(obj); + } else if (typ->comp == 4) { + OPM_WriteString((CHAR*)"struct ", (LONGINT)8); + OPC_Andent(typ); + if ((prev->form != 13 && (obj != NIL || dcl->name[0] == 0x00))) { + if ((typ->BaseTyp != NIL && typ->BaseTyp->strobj->vis != 0)) { + OPM_WriteString((CHAR*)" { /* ", (LONGINT)7); + OPC_Ident(typ->BaseTyp->strobj); + OPM_WriteString((CHAR*)" */", (LONGINT)4); + OPM_WriteLn(); + OPC_Indent(1); + } else { + OPM_Write(' '); + OPC_BegBlk(); + } + OPC_FieldList(typ, 1, &off, &n, &dummy); + OPC_EndBlk0(); + } + } else if ((typ->form == 13 && typ->BaseTyp->comp == 3)) { + typ = typ->BaseTyp->BaseTyp; + nofdims = 1; + while (typ->comp == 3) { + nofdims += 1; + typ = typ->BaseTyp; + } + OPM_WriteString((CHAR*)"struct ", (LONGINT)8); + OPC_BegBlk(); + OPC_BegStat(); + OPC_Str1((CHAR*)"LONGINT len[#]", (LONGINT)15, nofdims); + OPC_EndStat(); + OPC_BegStat(); + __NEW(obj, OPT_ObjDesc); + __NEW(obj->typ, OPT_StrDesc); + obj->typ->form = 15; + obj->typ->comp = 2; + obj->typ->n = 1; + obj->typ->BaseTyp = typ; + obj->mode = 4; + __MOVE("data", obj->name, 5); + obj->linkadr = 0; + OPC_DeclareBase(obj); + OPM_Write(' '); + OPC_DeclareObj(obj, 0); + OPC_EndStat(); + OPC_EndBlk0(); + } +} + +LONGINT OPC_NofPtrs (OPT_Struct typ) +{ + LONGINT _o_result; + OPT_Object fld = NIL; + OPT_Struct btyp = NIL; + LONGINT n; + if ((typ->form == 13 && typ->sysflag == 0)) { + _o_result = 1; + return _o_result; + } else if ((typ->comp == 4 && __MASK(typ->sysflag, -256) == 0)) { + btyp = typ->BaseTyp; + if (btyp != NIL) { + n = OPC_NofPtrs(btyp); + } else { + n = 0; + } + fld = typ->link; + while ((fld != NIL && fld->mode == 4)) { + if (__STRCMP(fld->name, "@ptr") != 0) { + n = n + OPC_NofPtrs(fld->typ); + } else { + n += 1; + } + fld = fld->link; + } + _o_result = n; + return _o_result; + } else if (typ->comp == 2) { + btyp = typ->BaseTyp; + n = typ->n; + while (btyp->comp == 2) { + n = btyp->n * n; + btyp = btyp->BaseTyp; + } + _o_result = OPC_NofPtrs(btyp) * n; + return _o_result; + } else { + _o_result = 0; + return _o_result; + } + __RETCHK; +} + +static void OPC_PutPtrOffsets (OPT_Struct typ, LONGINT adr, LONGINT *cnt) +{ + OPT_Object fld = NIL; + OPT_Struct btyp = NIL; + LONGINT n, i; + if ((typ->form == 13 && typ->sysflag == 0)) { + OPM_WriteInt(adr); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + *cnt += 1; + if (__MASK(*cnt, -16) == 0) { + OPM_WriteLn(); + OPM_Write(0x09); + } + } else if ((typ->comp == 4 && __MASK(typ->sysflag, -256) == 0)) { + btyp = typ->BaseTyp; + if (btyp != NIL) { + OPC_PutPtrOffsets(btyp, adr, &*cnt); + } + fld = typ->link; + while ((fld != NIL && fld->mode == 4)) { + if (__STRCMP(fld->name, "@ptr") != 0) { + OPC_PutPtrOffsets(fld->typ, adr + fld->adr, &*cnt); + } else { + OPM_WriteInt(adr + fld->adr); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + *cnt += 1; + if (__MASK(*cnt, -16) == 0) { + OPM_WriteLn(); + OPM_Write(0x09); + } + } + fld = fld->link; + } + } else if (typ->comp == 2) { + btyp = typ->BaseTyp; + n = typ->n; + while (btyp->comp == 2) { + n = btyp->n * n; + btyp = btyp->BaseTyp; + } + if (OPC_NofPtrs(btyp) > 0) { + i = 0; + while (i < n) { + OPC_PutPtrOffsets(btyp, adr + i * btyp->size, &*cnt); + i += 1; + } + } + } +} + +static void OPC_InitTProcs (OPT_Object typ, OPT_Object obj) +{ + if (obj != NIL) { + OPC_InitTProcs(typ, obj->left); + if (obj->mode == 13) { + OPC_BegStat(); + OPM_WriteString((CHAR*)"__INITBP(", (LONGINT)10); + OPC_Ident(typ); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPC_Ident(obj); + OPC_Str1((CHAR*)", #)", (LONGINT)5, __ASHR(obj->adr, 16)); + OPC_EndStat(); + } + OPC_InitTProcs(typ, obj->right); + } +} + +static void OPC_PutBase (OPT_Struct typ) +{ + if (typ != NIL) { + OPC_PutBase(typ->BaseTyp); + OPC_Ident(typ->strobj); + OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + } +} + +static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName) +{ + OPT_Struct typ = NIL; + INTEGER dim; + if (showParamName) { + OPC_Ident(par); + OPM_WriteString((CHAR*)"__len", (LONGINT)6); + } + dim = 1; + typ = par->typ->BaseTyp; + while (typ->comp == 3) { + if (ansiDefine) { + OPM_WriteString((CHAR*)", LONGINT ", (LONGINT)11); + } else { + OPM_WriteString((CHAR*)", ", (LONGINT)3); + } + if (showParamName) { + OPC_Ident(par); + OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteInt(dim); + } + typ = typ->BaseTyp; + dim += 1; + } +} + +static void OPC_DeclareParams (OPT_Object par, BOOLEAN macro) +{ + OPM_Write('('); + while (par != NIL) { + if (macro) { + OPM_WriteStringVar((void*)par->name, ((LONGINT)(256))); + } else { + if ((par->mode == 1 && par->typ->form == 7)) { + OPM_Write('_'); + } + OPC_Ident(par); + } + if (par->typ->comp == 3) { + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPC_LenList(par, 0, 1); + } else if ((par->mode == 2 && par->typ->comp == 4)) { + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteStringVar((void*)par->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + } + par = par->link; + if (par != NIL) { + OPM_WriteString((CHAR*)", ", (LONGINT)3); + } + } + OPM_Write(')'); +} + +static void OPC_DefineTProcTypes (OPT_Object obj) +{ + OPT_Object par = NIL; + if (obj->typ != OPT_notyp) { + OPC_DefineType(obj->typ); + } + if (OPC_ansi) { + par = obj->link; + while (par != NIL) { + OPC_DefineType(par->typ); + par = par->link; + } + } +} + +static void OPC_DeclareTProcs (OPT_Object obj, BOOLEAN *empty) +{ + if (obj != NIL) { + OPC_DeclareTProcs(obj->left, &*empty); + if (obj->mode == 13) { + if (obj->typ != OPT_notyp) { + OPC_DefineType(obj->typ); + } + if (OPM_currFile == 0) { + if (obj->vis == 1) { + OPC_DefineTProcTypes(obj); + OPM_WriteString((CHAR*)"import ", (LONGINT)8); + *empty = 0; + OPC_ProcHeader(obj, 0); + } + } else { + *empty = 0; + OPC_DefineTProcTypes(obj); + if (obj->vis == 0) { + OPM_WriteString((CHAR*)"static ", (LONGINT)8); + } else { + OPM_WriteString((CHAR*)"export ", (LONGINT)8); + } + OPC_ProcHeader(obj, 0); + } + } + OPC_DeclareTProcs(obj->right, &*empty); + } +} + +OPT_Object OPC_BaseTProc (OPT_Object obj) +{ + OPT_Object _o_result; + OPT_Struct typ = NIL, base = NIL; + LONGINT mno; + typ = obj->link->typ; + if (typ->form == 13) { + typ = typ->BaseTyp; + } + base = typ->BaseTyp; + mno = __ASHR(obj->adr, 16); + while ((base != NIL && mno < base->n)) { + typ = base; + base = typ->BaseTyp; + } + OPT_FindField(obj->name, typ, &obj); + _o_result = obj; + return _o_result; +} + +static void OPC_DefineTProcMacros (OPT_Object obj, BOOLEAN *empty) +{ + if (obj != NIL) { + OPC_DefineTProcMacros(obj->left, &*empty); + if ((((obj->mode == 13 && obj == OPC_BaseTProc(obj))) && (OPM_currFile != 0 || obj->vis == 1))) { + OPM_WriteString((CHAR*)"#define __", (LONGINT)11); + OPC_Ident(obj); + OPC_DeclareParams(obj->link, 1); + OPM_WriteString((CHAR*)" __SEND(", (LONGINT)9); + if (obj->link->typ->form == 13) { + OPM_WriteString((CHAR*)"__TYPEOF(", (LONGINT)10); + OPC_Ident(obj->link); + OPM_Write(')'); + } else { + OPC_Ident(obj->link); + OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + } + OPC_Str1((CHAR*)", #, ", (LONGINT)6, __ASHR(obj->adr, 16)); + if (obj->typ == OPT_notyp) { + OPM_WriteString((CHAR*)"void", (LONGINT)5); + } else { + OPC_Ident(obj->typ->strobj); + } + OPM_WriteString((CHAR*)"(*)", (LONGINT)4); + if (OPC_ansi) { + OPC_AnsiParamList(obj->link, 0); + } else { + OPM_WriteString((CHAR*)"()", (LONGINT)3); + } + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPC_DeclareParams(obj->link, 1); + OPM_Write(')'); + OPM_WriteLn(); + } + OPC_DefineTProcMacros(obj->right, &*empty); + } +} + +static void OPC_DefineType (OPT_Struct str) +{ + OPT_Object obj = NIL, field = NIL, par = NIL; + BOOLEAN empty; + if (OPM_currFile == 1 || str->ref < 255) { + obj = str->strobj; + if (obj == NIL || OPC_Undefined(obj)) { + if (obj != NIL) { + if (obj->linkadr == 1) { + if (str->form != 13) { + OPM_Mark(244, str->txtpos); + obj->linkadr = 2; + } + } else { + obj->linkadr = 1; + } + } + if (str->comp == 4) { + if (str->BaseTyp != NIL) { + OPC_DefineType(str->BaseTyp); + } + field = str->link; + while ((field != NIL && field->mode == 4)) { + if (field->vis != 0 || OPM_currFile == 1) { + OPC_DefineType(field->typ); + } + field = field->link; + } + } else if (str->form == 13) { + if (str->BaseTyp->comp != 4) { + OPC_DefineType(str->BaseTyp); + } + } else if (__IN(str->comp, 0x0c)) { + OPC_DefineType(str->BaseTyp); + } else if (str->form == 14) { + if (str->BaseTyp != OPT_notyp) { + OPC_DefineType(str->BaseTyp); + } + field = str->link; + while (field != NIL) { + OPC_DefineType(field->typ); + field = field->link; + } + } + } + if ((obj != NIL && OPC_Undefined(obj))) { + OPM_WriteString((CHAR*)"typedef", (LONGINT)8); + OPM_WriteLn(); + OPM_Write(0x09); + OPC_Indent(1); + obj->linkadr = 1; + OPC_DeclareBase(obj); + OPM_Write(' '); + obj->typ->strobj = NIL; + OPC_DeclareObj(obj, 0); + obj->typ->strobj = obj; + obj->linkadr = 3 + OPM_currFile; + OPC_EndStat(); + OPC_Indent(-1); + OPM_WriteLn(); + if (obj->typ->comp == 4) { + empty = 1; + OPC_DeclareTProcs(str->link, &empty); + OPC_DefineTProcMacros(str->link, &empty); + if (!empty) { + OPM_WriteLn(); + } + } + } + } +} + +static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len) +{ + BOOLEAN _o_result; + INTEGER i; + BOOLEAN r; + __DUP(y, y__len, CHAR); + i = 0; + while ((*x)[__X(i + 1, ((LONGINT)(256)))] == y[__X(i, y__len)]) { + i += 1; + } + r = y[__X(i, y__len)] == 0x00; + _o_result = r; + __DEL(y); + return _o_result; +} + +static void OPC_CProcDefs (OPT_Object obj, INTEGER vis) +{ + INTEGER i; + OPT_ConstExt ext = NIL; + INTEGER _for__9; + if (obj != NIL) { + OPC_CProcDefs(obj->left, vis); + if ((((obj->mode == 9 && (int)obj->vis >= vis)) && obj->adr == 1)) { + ext = obj->conval->ext; + i = 1; + if (((*ext)[1] != '#' && !(OPC_Prefixed(ext, (CHAR*)"extern ", (LONGINT)8) || OPC_Prefixed(ext, (CHAR*)"import ", (LONGINT)8)))) { + OPM_WriteString((CHAR*)"#define ", (LONGINT)9); + OPC_Ident(obj); + OPC_DeclareParams(obj->link, 1); + OPM_Write(0x09); + } + _for__9 = (int)(*obj->conval->ext)[0]; + i = i; + while (i <= _for__9) { + OPM_Write((*obj->conval->ext)[__X(i, ((LONGINT)(256)))]); + i += 1; + } + OPM_WriteLn(); + } + OPC_CProcDefs(obj->right, vis); + } +} + +void OPC_TypeDefs (OPT_Object obj, INTEGER vis) +{ + if (obj != NIL) { + OPC_TypeDefs(obj->left, vis); + if ((obj->mode == 5 && obj->typ->txtpos > 0)) { + OPC_DefineType(obj->typ); + } + OPC_TypeDefs(obj->right, vis); + } +} + +static void OPC_DefAnonRecs (OPT_Node n) +{ + OPT_Object o = NIL; + OPT_Struct typ = NIL; + while ((n != NIL && n->class == 14)) { + typ = n->typ; + if ((typ->strobj == NIL && (OPM_currFile == 1 || typ->ref < 255))) { + OPC_DefineType(typ); + __NEW(o, OPT_ObjDesc); + o->typ = typ; + o->name[0] = 0x00; + OPC_DeclareBase(o); + OPC_EndStat(); + OPM_WriteLn(); + } + n = n->link; + } +} + +void OPC_TDescDecl (OPT_Struct typ) +{ + LONGINT nofptrs; + OPT_Object o = NIL; + OPC_BegStat(); + OPM_WriteString((CHAR*)"__TDESC(", (LONGINT)9); + OPC_Andent(typ); + OPC_Str1((CHAR*)", #", (LONGINT)4, typ->n + 1); + OPC_Str1((CHAR*)", #) = {__TDFLDS(", (LONGINT)18, OPC_NofPtrs(typ)); + OPM_Write('\"'); + if (typ->strobj != NIL) { + OPM_WriteStringVar((void*)typ->strobj->name, ((LONGINT)(256))); + } + OPC_Str1((CHAR*)"\", #), {", (LONGINT)9, typ->size); + nofptrs = 0; + OPC_PutPtrOffsets(typ, ((LONGINT)(0)), &nofptrs); + OPC_Str1((CHAR*)"#}}", (LONGINT)4, -((nofptrs + 1) * (LONGINT)OPM_LIntSize)); + OPC_EndStat(); +} + +void OPC_InitTDesc (OPT_Struct typ) +{ + OPC_BegStat(); + OPM_WriteString((CHAR*)"__INITYP(", (LONGINT)10); + OPC_Andent(typ); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + if (typ->BaseTyp != NIL) { + OPC_Andent(typ->BaseTyp); + } else { + OPC_Andent(typ); + } + OPC_Str1((CHAR*)", #)", (LONGINT)5, typ->extlev); + OPC_EndStat(); + if (typ->strobj != NIL) { + OPC_InitTProcs(typ->strobj, typ->link); + } +} + +void OPC_Align (LONGINT *adr, LONGINT base) +{ + switch (base) { + case 2: + *adr += __MASK(*adr, -2); + break; + case 4: + *adr += __MASK(-*adr, -4); + break; + case 8: + *adr += __MASK(-*adr, -8); + break; + case 16: + *adr += __MASK(-*adr, -16); + break; + default: + break; + } +} + +LONGINT OPC_Base (OPT_Struct typ) +{ + LONGINT _o_result; + switch (typ->form) { + case 1: + _o_result = 1; + return _o_result; + break; + case 3: + _o_result = OPM_CharAlign; + return _o_result; + break; + case 2: + _o_result = OPM_BoolAlign; + return _o_result; + break; + case 4: + _o_result = OPM_SIntAlign; + return _o_result; + break; + case 5: + _o_result = OPM_IntAlign; + return _o_result; + break; + case 6: + _o_result = OPM_LIntAlign; + return _o_result; + break; + case 7: + _o_result = OPM_RealAlign; + return _o_result; + break; + case 8: + _o_result = OPM_LRealAlign; + return _o_result; + break; + case 9: + _o_result = OPM_SetAlign; + return _o_result; + break; + case 13: + _o_result = OPM_PointerAlign; + return _o_result; + break; + case 14: + _o_result = OPM_ProcAlign; + return _o_result; + break; + case 15: + if (typ->comp == 4) { + _o_result = __MASK(typ->align, -65536); + return _o_result; + } else { + _o_result = OPC_Base(typ->BaseTyp); + return _o_result; + } + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPC.Base, typ^form = ", (LONGINT)40); + OPM_LogWNum(typ->form, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + __RETCHK; +} + +static void OPC_FillGap (LONGINT gap, LONGINT off, LONGINT align, LONGINT *n, LONGINT *curAlign) +{ + LONGINT adr; + adr = off; + OPC_Align(&adr, align); + if ((*curAlign < align && gap - (adr - off) >= align)) { + gap -= (adr - off) + align; + OPC_BegStat(); + if (align == (LONGINT)OPM_IntSize) { + OPM_WriteString((CHAR*)"INTEGER", (LONGINT)8); + } else if (align == (LONGINT)OPM_LIntSize) { + OPM_WriteString((CHAR*)"LONGINT", (LONGINT)8); + } else if (align == (LONGINT)OPM_LRealSize) { + OPM_WriteString((CHAR*)"LONGREAL", (LONGINT)9); + } + OPC_Str1((CHAR*)" _prvt#", (LONGINT)8, *n); + *n += 1; + OPC_EndStat(); + *curAlign = align; + } + if (gap > 0) { + OPC_BegStat(); + OPC_Str1((CHAR*)"char _prvt#", (LONGINT)12, *n); + *n += 1; + OPC_Str1((CHAR*)"[#]", (LONGINT)4, gap); + OPC_EndStat(); + } +} + +static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, LONGINT *off, LONGINT *n, LONGINT *curAlign) +{ + OPT_Object fld = NIL; + OPT_Struct base = NIL; + LONGINT gap, adr, align, fldAlign; + fld = typ->link; + align = __MASK(typ->align, -65536); + if (typ->BaseTyp != NIL) { + OPC_FieldList(typ->BaseTyp, 0, &*off, &*n, &*curAlign); + } else { + *off = 0; + *n = 0; + *curAlign = 1; + } + while ((fld != NIL && fld->mode == 4)) { + if ((OPM_currFile == 0 && fld->vis == 0) || (((OPM_currFile == 1 && fld->vis == 0)) && typ->mno != 0)) { + fld = fld->link; + while ((((fld != NIL && fld->mode == 4)) && fld->vis == 0)) { + fld = fld->link; + } + } else { + adr = *off; + fldAlign = OPC_Base(fld->typ); + OPC_Align(&adr, fldAlign); + gap = fld->adr - adr; + if (fldAlign > *curAlign) { + *curAlign = fldAlign; + } + if (gap > 0) { + OPC_FillGap(gap, *off, align, &*n, &*curAlign); + } + OPC_BegStat(); + OPC_DeclareBase(fld); + OPM_Write(' '); + OPC_DeclareObj(fld, 0); + *off = fld->adr + fld->typ->size; + base = fld->typ; + fld = fld->link; + while ((((((((fld != NIL && fld->mode == 4)) && fld->typ == base)) && fld->adr == *off)) && ((OPM_currFile == 1 || fld->vis != 0) || fld->typ->strobj == NIL))) { + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPC_DeclareObj(fld, 0); + *off = fld->adr + fld->typ->size; + fld = fld->link; + } + OPC_EndStat(); + } + } + if (last) { + adr = typ->size - (LONGINT)__ASHR(typ->sysflag, 8); + if (adr == 0) { + gap = 1; + } else { + gap = adr - *off; + } + if (gap > 0) { + OPC_FillGap(gap, *off, align, &*n, &*curAlign); + } + } +} + +static void OPC_IdentList (OPT_Object obj, INTEGER vis) +{ + OPT_Struct base = NIL; + BOOLEAN first; + INTEGER lastvis; + base = NIL; + first = 1; + while ((obj != NIL && obj->mode != 13)) { + if ((__IN(vis, 0x05) || (vis == 1 && obj->vis != 0)) || (vis == 3 && !obj->leaf)) { + if (obj->typ != base || (int)obj->vis != lastvis) { + if (!first) { + OPC_EndStat(); + } + first = 0; + base = obj->typ; + lastvis = obj->vis; + OPC_BegStat(); + if ((vis == 1 && obj->vis != 0)) { + OPM_WriteString((CHAR*)"import ", (LONGINT)8); + } else if ((obj->mnolev == 0 && vis == 0)) { + if (obj->vis == 0) { + OPM_WriteString((CHAR*)"static ", (LONGINT)8); + } else { + OPM_WriteString((CHAR*)"export ", (LONGINT)8); + } + } + if ((((vis == 2 && obj->mode == 1)) && base->form == 7)) { + OPM_WriteString((CHAR*)"double", (LONGINT)7); + } else { + OPC_DeclareBase(obj); + } + } else { + OPM_Write(','); + } + OPM_Write(' '); + if ((((vis == 2 && obj->mode == 1)) && base->form == 7)) { + OPM_Write('_'); + } + OPC_DeclareObj(obj, vis == 3); + if (obj->typ->comp == 3) { + OPC_EndStat(); + OPC_BegStat(); + base = OPT_linttyp; + OPM_WriteString((CHAR*)"LONGINT ", (LONGINT)9); + OPC_LenList(obj, 0, 1); + } else if ((obj->mode == 2 && obj->typ->comp == 4)) { + OPC_EndStat(); + OPC_BegStat(); + OPM_WriteString((CHAR*)"LONGINT *", (LONGINT)10); + OPC_Ident(obj); + OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + base = NIL; + } else if ((((((OPC_ptrinit && vis == 0)) && obj->mnolev > 0)) && obj->typ->form == 13)) { + OPM_WriteString((CHAR*)" = NIL", (LONGINT)7); + } + } + obj = obj->link; + } + if (!first) { + OPC_EndStat(); + } +} + +static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames) +{ + CHAR name[32]; + OPM_Write('('); + if (obj == NIL || obj->mode == 13) { + OPM_WriteString((CHAR*)"void", (LONGINT)5); + } else { + for (;;) { + OPC_DeclareBase(obj); + if (showParamNames) { + OPM_Write(' '); + OPC_DeclareObj(obj, 0); + } else { + __COPY(obj->name, name, ((LONGINT)(32))); + obj->name[0] = 0x00; + OPC_DeclareObj(obj, 0); + __COPY(name, obj->name, ((LONGINT)(256))); + } + if (obj->typ->comp == 3) { + OPM_WriteString((CHAR*)", LONGINT ", (LONGINT)11); + OPC_LenList(obj, 1, showParamNames); + } else if ((obj->mode == 2 && obj->typ->comp == 4)) { + OPM_WriteString((CHAR*)", LONGINT *", (LONGINT)12); + if (showParamNames) { + OPC_Ident(obj); + OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + } + } + if (obj->link == NIL || obj->link->mode == 13) { + break; + } + OPM_WriteString((CHAR*)", ", (LONGINT)3); + obj = obj->link; + } + } + OPM_Write(')'); +} + +static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define) +{ + if (proc->typ == OPT_notyp) { + OPM_WriteString((CHAR*)"void", (LONGINT)5); + } else { + OPC_Ident(proc->typ->strobj); + } + OPM_Write(' '); + OPC_Ident(proc); + OPM_Write(' '); + if (OPC_ansi) { + OPC_AnsiParamList(proc->link, 1); + if (!define) { + OPM_Write(';'); + } + OPM_WriteLn(); + } else if (define) { + OPC_DeclareParams(proc->link, 0); + OPM_WriteLn(); + OPC_Indent(1); + OPC_IdentList(proc->link, 2); + OPC_Indent(-1); + } else { + OPM_WriteString((CHAR*)"();", (LONGINT)4); + OPM_WriteLn(); + } +} + +static void OPC_ProcPredefs (OPT_Object obj, SHORTINT vis) +{ + if (obj != NIL) { + OPC_ProcPredefs(obj->left, vis); + if ((((__IN(obj->mode, 0xc0) && obj->vis >= vis)) && (obj->history != 4 || obj->mode == 6))) { + if (vis == 1) { + OPM_WriteString((CHAR*)"import ", (LONGINT)8); + } else if (obj->vis == 0) { + OPM_WriteString((CHAR*)"static ", (LONGINT)8); + } else { + OPM_WriteString((CHAR*)"export ", (LONGINT)8); + } + OPC_ProcHeader(obj, 0); + } + OPC_ProcPredefs(obj->right, vis); + } +} + +static void OPC_Include (CHAR *name, LONGINT name__len) +{ + __DUP(name, name__len, CHAR); + OPM_WriteString((CHAR*)"#include ", (LONGINT)10); + OPM_Write('\"'); + OPM_WriteStringVar((void*)name, name__len); + OPM_WriteString((CHAR*)".h", (LONGINT)3); + OPM_Write('\"'); + OPM_WriteLn(); + __DEL(name); +} + +static void OPC_IncludeImports (OPT_Object obj, INTEGER vis) +{ + if (obj != NIL) { + OPC_IncludeImports(obj->left, vis); + if ((((obj->mode == 11 && obj->mnolev != 0)) && (int)OPT_GlbMod[__X(-obj->mnolev, ((LONGINT)(64)))]->vis >= vis)) { + OPC_Include(OPT_GlbMod[__X(-obj->mnolev, ((LONGINT)(64)))]->name, ((LONGINT)(256))); + } + OPC_IncludeImports(obj->right, vis); + } +} + +static void OPC_GenDynTypes (OPT_Node n, INTEGER vis) +{ + OPT_Struct typ = NIL; + while ((n != NIL && n->class == 14)) { + typ = n->typ; + if (vis == 0 || typ->ref < 255) { + OPC_BegStat(); + if (vis == 1) { + OPM_WriteString((CHAR*)"import ", (LONGINT)8); + } else if ((typ->strobj != NIL && typ->strobj->mnolev > 0)) { + OPM_WriteString((CHAR*)"static ", (LONGINT)8); + } else { + OPM_WriteString((CHAR*)"export ", (LONGINT)8); + } + OPM_WriteString((CHAR*)"LONGINT *", (LONGINT)10); + OPC_Andent(typ); + OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPC_EndStat(); + } + n = n->link; + } +} + +void OPC_GenHdr (OPT_Node n) +{ + OPM_currFile = 0; + OPC_DefAnonRecs(n); + OPC_TypeDefs(OPT_topScope->right, 1); + OPM_WriteLn(); + OPC_IdentList(OPT_topScope->scope, 1); + OPM_WriteLn(); + OPC_GenDynTypes(n, 1); + OPM_WriteLn(); + OPC_ProcPredefs(OPT_topScope->right, 1); + OPM_WriteString((CHAR*)"import ", (LONGINT)8); + OPM_WriteString((CHAR*)"void *", (LONGINT)7); + OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); + OPM_WriteString(OPC_BodyNameExt, ((LONGINT)(13))); + OPC_EndStat(); + OPM_WriteLn(); + OPC_CProcDefs(OPT_topScope->right, 1); + OPM_WriteLn(); + OPM_WriteString((CHAR*)"#endif", (LONGINT)7); + OPM_WriteLn(); +} + +static void OPC_GenHeaderMsg (void) +{ + INTEGER i; + OPM_WriteString((CHAR*)"/*", (LONGINT)3); + OPM_WriteString((CHAR*)" voc ", (LONGINT)6); + OPM_Write(' '); + OPM_WriteString((CHAR*)"1.2 [2016/06/15] for gcc LP64 on cygwin", (LONGINT)40); + OPM_Write(' '); + i = 0; + while (i <= 31) { + if (__IN(i, OPM_glbopt)) { + switch (i) { + case 0: + OPM_Write('x'); + break; + case 2: + OPM_Write('r'); + break; + case 3: + OPM_Write('t'); + break; + case 4: + OPM_Write('s'); + break; + case 5: + OPM_Write('p'); + break; + case 6: + OPM_Write('k'); + break; + case 7: + OPM_Write('a'); + break; + case 9: + OPM_Write('e'); + break; + case 10: + OPM_Write('m'); + break; + case 13: + OPM_Write('S'); + break; + case 14: + OPM_Write('c'); + break; + case 15: + OPM_Write('M'); + break; + case 16: + OPM_Write('f'); + break; + case 17: + OPM_Write('F'); + break; + case 18: + OPM_Write('v'); + break; + default: + OPM_LogWStr((CHAR*)"( more options defined in OPM than checked in OPC.GenHeaderMsg, if you are a compiler developer, add them to OPC.GenHeaderMsg", (LONGINT)126); + OPM_LogWLn(); + break; + } + } + i += 1; + } + OPM_WriteString((CHAR*)" */", (LONGINT)4); + OPM_WriteLn(); +} + +void OPC_GenHdrIncludes (void) +{ + OPM_currFile = 2; + OPC_GenHeaderMsg(); + OPM_WriteLn(); + OPM_WriteString((CHAR*)"#ifndef ", (LONGINT)9); + OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); + OPM_WriteString((CHAR*)"__h", (LONGINT)4); + OPM_WriteLn(); + OPM_WriteString((CHAR*)"#define ", (LONGINT)9); + OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); + OPM_WriteString((CHAR*)"__h", (LONGINT)4); + OPM_WriteLn(); + OPM_WriteLn(); + if (OPM_LIntSize == 8) { + OPM_WriteString((CHAR*)"#define LARGE", (LONGINT)14); + OPM_WriteLn(); + } + OPC_Include((CHAR*)"SYSTEM", (LONGINT)7); + OPC_IncludeImports(OPT_topScope->right, 1); + OPM_WriteLn(); +} + +void OPC_GenBdy (OPT_Node n) +{ + OPM_currFile = 1; + OPC_GenHeaderMsg(); + if (OPM_LIntSize == 8) { + OPM_WriteString((CHAR*)"#define LARGE", (LONGINT)14); + OPM_WriteLn(); + } + OPC_Include((CHAR*)"SYSTEM", (LONGINT)7); + OPC_IncludeImports(OPT_topScope->right, 0); + OPM_WriteLn(); + OPC_DefAnonRecs(n); + OPC_TypeDefs(OPT_topScope->right, 0); + OPM_WriteLn(); + OPC_IdentList(OPT_topScope->scope, 0); + OPM_WriteLn(); + OPC_GenDynTypes(n, 0); + OPM_WriteLn(); + OPC_ProcPredefs(OPT_topScope->right, 0); + OPM_WriteLn(); + OPC_CProcDefs(OPT_topScope->right, 0); + OPM_WriteLn(); +} + +static void OPC_RegCmds (OPT_Object obj) +{ + if (obj != NIL) { + OPC_RegCmds(obj->left); + if ((obj->mode == 7 && obj->history != 4)) { + if ((((obj->vis != 0 && obj->link == NIL)) && obj->typ == OPT_notyp)) { + OPC_BegStat(); + OPM_WriteString((CHAR*)"__REGCMD(\"", (LONGINT)11); + OPM_WriteStringVar((void*)obj->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"\", ", (LONGINT)4); + OPC_Ident(obj); + OPM_Write(')'); + OPC_EndStat(); + } + } + OPC_RegCmds(obj->right); + } +} + +static void OPC_InitImports (OPT_Object obj) +{ + if (obj != NIL) { + OPC_InitImports(obj->left); + if ((obj->mode == 11 && obj->mnolev != 0)) { + OPC_BegStat(); + OPM_WriteString((CHAR*)"__MODULE_IMPORT(", (LONGINT)17); + OPM_WriteStringVar((void*)OPT_GlbMod[__X(-obj->mnolev, ((LONGINT)(64)))]->name, ((LONGINT)(256))); + OPM_Write(')'); + OPC_EndStat(); + } + OPC_InitImports(obj->right); + } +} + +void OPC_GenEnumPtrs (OPT_Object var) +{ + OPT_Struct typ = NIL; + LONGINT n; + OPC_GlbPtrs = 0; + while (var != NIL) { + typ = var->typ; + if (OPC_NofPtrs(typ) > 0) { + if (!OPC_GlbPtrs) { + OPC_GlbPtrs = 1; + OPM_WriteString((CHAR*)"static ", (LONGINT)8); + if (OPC_ansi) { + OPM_WriteString((CHAR*)"void EnumPtrs(void (*P)(void*))", (LONGINT)32); + } else { + OPM_WriteString((CHAR*)"void EnumPtrs(P)", (LONGINT)17); + OPM_WriteLn(); + OPM_Write(0x09); + OPM_WriteString((CHAR*)"void (*P)();", (LONGINT)13); + } + OPM_WriteLn(); + OPC_BegBlk(); + } + OPC_BegStat(); + if (typ->form == 13) { + OPM_WriteString((CHAR*)"P(", (LONGINT)3); + OPC_Ident(var); + OPM_Write(')'); + } else if (typ->comp == 4) { + OPM_WriteString((CHAR*)"__ENUMR(&", (LONGINT)10); + OPC_Ident(var); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPC_Andent(typ); + OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPC_Str1((CHAR*)", #", (LONGINT)4, typ->size); + OPM_WriteString((CHAR*)", 1, P)", (LONGINT)8); + } else if (typ->comp == 2) { + n = typ->n; + typ = typ->BaseTyp; + while (typ->comp == 2) { + n = n * typ->n; + typ = typ->BaseTyp; + } + if (typ->form == 13) { + OPM_WriteString((CHAR*)"__ENUMP(", (LONGINT)9); + OPC_Ident(var); + OPC_Str1((CHAR*)", #, P)", (LONGINT)8, n); + } else if (typ->comp == 4) { + OPM_WriteString((CHAR*)"__ENUMR(", (LONGINT)9); + OPC_Ident(var); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPC_Andent(typ); + OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPC_Str1((CHAR*)", #", (LONGINT)4, typ->size); + OPC_Str1((CHAR*)", #, P)", (LONGINT)8, n); + } + } + OPC_EndStat(); + } + var = var->link; + } + if (OPC_GlbPtrs) { + OPC_EndBlk(); + OPM_WriteLn(); + } +} + +void OPC_EnterBody (void) +{ + OPM_WriteLn(); + OPM_WriteString((CHAR*)"export ", (LONGINT)8); + if (OPC_mainprog) { + if (OPC_ansi) { + OPM_WriteString((CHAR*)"int main(int argc, char **argv)", (LONGINT)32); + OPM_WriteLn(); + } else { + OPM_WriteString((CHAR*)"main(argc, argv)", (LONGINT)17); + OPM_WriteLn(); + OPM_Write(0x09); + OPM_WriteString((CHAR*)"int argc; char **argv;", (LONGINT)23); + OPM_WriteLn(); + } + } else { + OPM_WriteString((CHAR*)"void *", (LONGINT)7); + OPM_WriteString(OPM_modName, ((LONGINT)(32))); + OPM_WriteString(OPC_BodyNameExt, ((LONGINT)(13))); + OPM_WriteLn(); + } + OPC_BegBlk(); + OPC_BegStat(); + if (OPC_mainprog) { + OPM_WriteString((CHAR*)"__INIT(argc, argv)", (LONGINT)19); + } else { + OPM_WriteString((CHAR*)"__DEFMOD", (LONGINT)9); + } + OPC_EndStat(); + if ((OPC_mainprog && 0)) { + OPC_BegStat(); + OPM_WriteString((CHAR*)"/*don`t do it!*/ printf(\"DEMO VERSION: DO NOT USE THIS PROGRAM FOR ANY COMMERCIAL PURPOSE\\n\")", (LONGINT)94); + OPC_EndStat(); + } + OPC_InitImports(OPT_topScope->right); + OPC_BegStat(); + if (OPC_mainprog) { + OPM_WriteString((CHAR*)"__REGMAIN(\"", (LONGINT)12); + } else { + OPM_WriteString((CHAR*)"__REGMOD(\"", (LONGINT)11); + } + OPM_WriteString(OPM_modName, ((LONGINT)(32))); + if (OPC_GlbPtrs) { + OPM_WriteString((CHAR*)"\", EnumPtrs)", (LONGINT)13); + } else { + OPM_WriteString((CHAR*)"\", 0)", (LONGINT)6); + } + OPC_EndStat(); + if (__STRCMP(OPM_modName, "SYSTEM") != 0) { + OPC_RegCmds(OPT_topScope); + } +} + +void OPC_ExitBody (void) +{ + OPC_BegStat(); + if (OPC_mainprog) { + OPM_WriteString((CHAR*)"__FINI;", (LONGINT)8); + } else { + OPM_WriteString((CHAR*)"__ENDMOD;", (LONGINT)10); + } + OPM_WriteLn(); + OPC_EndBlk(); +} + +void OPC_DefineInter (OPT_Object proc) +{ + OPT_Object scope = NIL; + scope = proc->scope; + OPM_WriteString((CHAR*)"static ", (LONGINT)8); + OPM_WriteString((CHAR*)"struct ", (LONGINT)8); + OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); + OPM_Write(' '); + OPC_BegBlk(); + OPC_IdentList(proc->link, 3); + OPC_IdentList(scope->scope, 3); + OPC_BegStat(); + OPM_WriteString((CHAR*)"struct ", (LONGINT)8); + OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); + OPM_Write(' '); + OPM_Write('*'); + OPM_WriteString((CHAR*)"lnk", (LONGINT)4); + OPC_EndStat(); + OPC_EndBlk0(); + OPM_Write(' '); + OPM_Write('*'); + OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPC_EndStat(); + OPM_WriteLn(); + OPC_ProcPredefs(scope->right, 0); + OPM_WriteLn(); +} + +void OPC_EnterProc (OPT_Object proc) +{ + OPT_Object var = NIL, scope = NIL; + OPT_Struct typ = NIL; + INTEGER dim; + if (proc->vis != 1) { + OPM_WriteString((CHAR*)"static ", (LONGINT)8); + } + OPC_ProcHeader(proc, 1); + OPC_BegBlk(); + if (proc->typ != OPT_notyp) { + OPC_BegStat(); + OPC_Ident(proc->typ->strobj); + OPM_WriteString((CHAR*)" _o_result;", (LONGINT)12); + OPM_WriteLn(); + } + scope = proc->scope; + OPC_IdentList(scope->scope, 0); + if (!scope->leaf) { + OPC_BegStat(); + OPM_WriteString((CHAR*)"struct ", (LONGINT)8); + OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); + OPM_Write(' '); + OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPC_EndStat(); + } + var = proc->link; + while (var != NIL) { + if ((var->typ->comp == 2 && var->mode == 1)) { + OPC_BegStat(); + if (var->typ->strobj == NIL) { + OPM_Mark(200, var->typ->txtpos); + } else { + OPC_Ident(var->typ->strobj); + } + OPM_Write(' '); + OPC_Ident(var); + OPM_WriteString((CHAR*)"__copy", (LONGINT)7); + OPC_EndStat(); + } + var = var->link; + } + if (!OPC_ansi) { + var = proc->link; + while (var != NIL) { + if ((var->typ->form == 7 && var->mode == 1)) { + OPC_BegStat(); + OPC_Ident(var->typ->strobj); + OPM_Write(' '); + OPC_Ident(var); + OPM_WriteString((CHAR*)" = _", (LONGINT)5); + OPC_Ident(var); + OPC_EndStat(); + } + var = var->link; + } + } + var = proc->link; + while (var != NIL) { + if ((((__IN(var->typ->comp, 0x0c) && var->mode == 1)) && var->typ->sysflag == 0)) { + OPC_BegStat(); + if (var->typ->comp == 2) { + OPM_WriteString((CHAR*)"__DUPARR(", (LONGINT)10); + OPC_Ident(var); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + if (var->typ->strobj == NIL) { + OPM_Mark(200, var->typ->txtpos); + } else { + OPC_Ident(var->typ->strobj); + } + } else { + OPM_WriteString((CHAR*)"__DUP(", (LONGINT)7); + OPC_Ident(var); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPC_Ident(var); + OPM_WriteString((CHAR*)"__len", (LONGINT)6); + typ = var->typ->BaseTyp; + dim = 1; + while (typ->comp == 3) { + OPM_WriteString((CHAR*)" * ", (LONGINT)4); + OPC_Ident(var); + OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteInt(dim); + typ = typ->BaseTyp; + dim += 1; + } + OPM_WriteString((CHAR*)", ", (LONGINT)3); + if (typ->strobj == NIL) { + OPM_Mark(200, typ->txtpos); + } else { + OPC_Ident(typ->strobj); + } + } + OPM_Write(')'); + OPC_EndStat(); + } + var = var->link; + } + if (!scope->leaf) { + var = proc->link; + while (var != NIL) { + if (!var->leaf) { + OPC_BegStat(); + OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_Write('.'); + OPC_Ident(var); + OPM_WriteString((CHAR*)" = ", (LONGINT)4); + if (__IN(var->typ->comp, 0x0c)) { + OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + } else if (var->mode != 2) { + OPM_Write('&'); + } + OPC_Ident(var); + if (var->typ->comp == 3) { + typ = var->typ; + dim = 0; + do { + OPM_WriteString((CHAR*)"; ", (LONGINT)3); + OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_Write('.'); + OPC_Ident(var); + OPM_WriteString((CHAR*)"__len", (LONGINT)6); + if (dim != 0) { + OPM_WriteInt(dim); + } + OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPC_Ident(var); + OPM_WriteString((CHAR*)"__len", (LONGINT)6); + if (dim != 0) { + OPM_WriteInt(dim); + } + typ = typ->BaseTyp; + } while (!(typ->comp != 3)); + } else if ((var->mode == 2 && var->typ->comp == 4)) { + OPM_WriteString((CHAR*)"; ", (LONGINT)3); + OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_Write('.'); + OPC_Ident(var); + OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPC_Ident(var); + OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + } + OPC_EndStat(); + } + var = var->link; + } + var = scope->scope; + while (var != NIL) { + if (!var->leaf) { + OPC_BegStat(); + OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_Write('.'); + OPC_Ident(var); + OPM_WriteString((CHAR*)" = ", (LONGINT)4); + if (var->typ->comp != 2) { + OPM_Write('&'); + } else { + OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + } + OPC_Ident(var); + OPC_EndStat(); + } + var = var->link; + } + OPC_BegStat(); + OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_Write('.'); + OPM_WriteString((CHAR*)"lnk", (LONGINT)4); + OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPC_EndStat(); + OPC_BegStat(); + OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_Write('&'); + OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPC_EndStat(); + } +} + +void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet) +{ + OPT_Object var = NIL; + BOOLEAN indent; + indent = eoBlock; + if ((implicitRet && proc->typ != OPT_notyp)) { + OPM_Write(0x09); + OPM_WriteString((CHAR*)"__RETCHK;", (LONGINT)10); + OPM_WriteLn(); + } else if (!eoBlock || implicitRet) { + if (!proc->scope->leaf) { + if (indent) { + OPC_BegStat(); + } else { + indent = 1; + } + OPM_WriteStringVar((void*)proc->scope->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_Write('.'); + OPM_WriteString((CHAR*)"lnk", (LONGINT)4); + OPC_EndStat(); + } + var = proc->link; + while (var != NIL) { + if ((((var->typ->comp == 3 && var->mode == 1)) && var->typ->sysflag == 0)) { + if (indent) { + OPC_BegStat(); + } else { + indent = 1; + } + OPM_WriteString((CHAR*)"__DEL(", (LONGINT)7); + OPC_Ident(var); + OPM_Write(')'); + OPC_EndStat(); + } + var = var->link; + } + } + if (eoBlock) { + OPC_EndBlk(); + OPM_WriteLn(); + } else if (indent) { + OPC_BegStat(); + } +} + +void OPC_CompleteIdent (OPT_Object obj) +{ + INTEGER comp, level; + level = obj->mnolev; + if (obj->adr == 1) { + if (obj->typ->comp == 4) { + OPC_Ident(obj); + OPM_WriteString((CHAR*)"__", (LONGINT)3); + } else { + OPM_WriteString((CHAR*)"((", (LONGINT)3); + OPC_Ident(obj->typ->strobj); + OPM_Write(')'); + OPC_Ident(obj); + OPM_Write(')'); + } + } else if ((level != OPM_level && level > 0)) { + comp = obj->typ->comp; + if ((obj->mode != 2 && comp != 3)) { + OPM_Write('*'); + } + OPM_WriteStringVar((void*)obj->scope->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"->", (LONGINT)3); + OPC_Ident(obj); + } else { + OPC_Ident(obj); + } +} + +void OPC_TypeOf (OPT_Object ap) +{ + INTEGER i; + __ASSERT(ap->typ->comp == 4, 0); + if (ap->mode == 2) { + if ((int)ap->mnolev != OPM_level) { + OPM_WriteStringVar((void*)ap->scope->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"_s->", (LONGINT)5); + OPC_Ident(ap); + } else { + OPC_Ident(ap); + } + OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + } else if (ap->typ->strobj != NIL) { + OPC_Ident(ap->typ->strobj); + OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + } else { + OPC_Andent(ap->typ); + } +} + +void OPC_Cmp (INTEGER rel) +{ + switch (rel) { + case 9: + OPM_WriteString((CHAR*)" == ", (LONGINT)5); + break; + case 10: + OPM_WriteString((CHAR*)" != ", (LONGINT)5); + break; + case 11: + OPM_WriteString((CHAR*)" < ", (LONGINT)4); + break; + case 12: + OPM_WriteString((CHAR*)" <= ", (LONGINT)5); + break; + case 13: + OPM_WriteString((CHAR*)" > ", (LONGINT)4); + break; + case 14: + OPM_WriteString((CHAR*)" >= ", (LONGINT)5); + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPC.Cmp, rel = ", (LONGINT)34); + OPM_LogWNum(rel, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } +} + +void OPC_Case (LONGINT caseVal, INTEGER form) +{ + CHAR ch; + OPM_WriteString((CHAR*)"case ", (LONGINT)6); + switch (form) { + case 3: + ch = (CHAR)caseVal; + if ((ch >= ' ' && ch <= '~')) { + OPM_Write('\''); + if (((ch == '\\' || ch == '\?') || ch == '\'') || ch == '\"') { + OPM_Write('\\'); + OPM_Write(ch); + } else { + OPM_Write(ch); + } + OPM_Write('\''); + } else { + OPM_WriteString((CHAR*)"0x", (LONGINT)3); + OPM_WriteHex(caseVal); + } + break; + case 4: case 5: case 6: + OPM_WriteInt(caseVal); + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPC.Case, form = ", (LONGINT)36); + OPM_LogWNum(form, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + OPM_WriteString((CHAR*)": ", (LONGINT)3); +} + +void OPC_SetInclude (BOOLEAN exclude) +{ + if (exclude) { + OPM_WriteString((CHAR*)" &= ~", (LONGINT)6); + } else { + OPM_WriteString((CHAR*)" |= ", (LONGINT)5); + } +} + +void OPC_Increment (BOOLEAN decrement) +{ + if (decrement) { + OPM_WriteString((CHAR*)" -= ", (LONGINT)5); + } else { + OPM_WriteString((CHAR*)" += ", (LONGINT)5); + } +} + +void OPC_Halt (LONGINT n) +{ + OPC_Str1((CHAR*)"__HALT(#)", (LONGINT)10, n); +} + +void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim) +{ + if (array->comp == 3) { + OPC_CompleteIdent(obj); + OPM_WriteString((CHAR*)"__len", (LONGINT)6); + if (dim != 0) { + OPM_WriteInt(dim); + } + } else { + while (dim > 0) { + array = array->BaseTyp; + dim -= 1; + } + OPM_WriteString((CHAR*)"((LONGINT)(", (LONGINT)12); + OPM_WriteInt(array->n); + OPM_WriteString((CHAR*)"))", (LONGINT)3); + } +} + +void OPC_Constant (OPT_Const con, INTEGER form) +{ + INTEGER i, len; + CHAR ch; + SET s; + LONGINT hex; + BOOLEAN skipLeading; + switch (form) { + case 1: + OPM_WriteInt(con->intval); + break; + case 2: + OPM_WriteInt(con->intval); + break; + case 3: + ch = (CHAR)con->intval; + if ((ch >= ' ' && ch <= '~')) { + OPM_Write('\''); + if (((ch == '\\' || ch == '\?') || ch == '\'') || ch == '\"') { + OPM_Write('\\'); + } + OPM_Write(ch); + OPM_Write('\''); + } else { + OPM_WriteString((CHAR*)"0x", (LONGINT)3); + OPM_WriteHex(con->intval); + } + break; + case 4: case 5: case 6: + OPM_WriteInt(con->intval); + break; + case 7: + OPM_WriteReal(con->realval, 'f'); + break; + case 8: + OPM_WriteReal(con->realval, 0x00); + break; + case 9: + OPM_WriteString((CHAR*)"0x", (LONGINT)3); + skipLeading = 1; + s = con->setval; + i = 32; + do { + hex = 0; + do { + i -= 1; + hex = __ASHL(hex, 1); + if (__IN(i, s)) { + hex += 1; + } + } while (!(__MASK(i, -8) == 0)); + if (hex != 0 || !skipLeading) { + OPM_WriteHex(hex); + skipLeading = 0; + } + } while (!(i == 0)); + if (skipLeading) { + OPM_Write('0'); + } + break; + case 10: + OPM_Write('\"'); + len = (int)con->intval2 - 1; + i = 0; + while (i < len) { + ch = (*con->ext)[__X(i, ((LONGINT)(256)))]; + if (((ch == '\\' || ch == '\?') || ch == '\'') || ch == '\"') { + OPM_Write('\\'); + } + OPM_Write(ch); + i += 1; + } + OPM_Write('\"'); + break; + case 11: + OPM_WriteString((CHAR*)"NIL", (LONGINT)4); + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPC.Constant, form = ", (LONGINT)40); + OPM_LogWNum(form, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } +} + +static struct InitKeywords__47 { + SHORTINT *n; + struct InitKeywords__47 *lnk; +} *InitKeywords__47_s; + +static void Enter__48 (CHAR *s, LONGINT s__len); + +static void Enter__48 (CHAR *s, LONGINT s__len) +{ + INTEGER h; + __DUP(s, s__len, CHAR); + h = OPC_PerfectHash((void*)s, s__len); + OPC_hashtab[__X(h, ((LONGINT)(105)))] = *InitKeywords__47_s->n; + __COPY(s, OPC_keytab[__X(*InitKeywords__47_s->n, ((LONGINT)(36)))], ((LONGINT)(9))); + *InitKeywords__47_s->n += 1; + __DEL(s); +} + +static void OPC_InitKeywords (void) +{ + SHORTINT n, i; + struct InitKeywords__47 _s; + _s.n = &n; + _s.lnk = InitKeywords__47_s; + InitKeywords__47_s = &_s; + n = 0; + i = 0; + while (i <= 104) { + OPC_hashtab[__X(i, ((LONGINT)(105)))] = -1; + i += 1; + } + Enter__48((CHAR*)"asm", (LONGINT)4); + Enter__48((CHAR*)"auto", (LONGINT)5); + Enter__48((CHAR*)"break", (LONGINT)6); + Enter__48((CHAR*)"case", (LONGINT)5); + Enter__48((CHAR*)"char", (LONGINT)5); + Enter__48((CHAR*)"const", (LONGINT)6); + Enter__48((CHAR*)"continue", (LONGINT)9); + Enter__48((CHAR*)"default", (LONGINT)8); + Enter__48((CHAR*)"do", (LONGINT)3); + Enter__48((CHAR*)"double", (LONGINT)7); + Enter__48((CHAR*)"else", (LONGINT)5); + Enter__48((CHAR*)"enum", (LONGINT)5); + Enter__48((CHAR*)"extern", (LONGINT)7); + Enter__48((CHAR*)"export", (LONGINT)7); + Enter__48((CHAR*)"float", (LONGINT)6); + Enter__48((CHAR*)"for", (LONGINT)4); + Enter__48((CHAR*)"fortran", (LONGINT)8); + Enter__48((CHAR*)"goto", (LONGINT)5); + Enter__48((CHAR*)"if", (LONGINT)3); + Enter__48((CHAR*)"import", (LONGINT)7); + Enter__48((CHAR*)"int", (LONGINT)4); + Enter__48((CHAR*)"long", (LONGINT)5); + Enter__48((CHAR*)"register", (LONGINT)9); + Enter__48((CHAR*)"return", (LONGINT)7); + Enter__48((CHAR*)"short", (LONGINT)6); + Enter__48((CHAR*)"signed", (LONGINT)7); + Enter__48((CHAR*)"sizeof", (LONGINT)7); + Enter__48((CHAR*)"static", (LONGINT)7); + Enter__48((CHAR*)"struct", (LONGINT)7); + Enter__48((CHAR*)"switch", (LONGINT)7); + Enter__48((CHAR*)"typedef", (LONGINT)8); + Enter__48((CHAR*)"union", (LONGINT)6); + Enter__48((CHAR*)"unsigned", (LONGINT)9); + Enter__48((CHAR*)"void", (LONGINT)5); + Enter__48((CHAR*)"volatile", (LONGINT)9); + Enter__48((CHAR*)"while", (LONGINT)6); + InitKeywords__47_s = _s.lnk; +} + + +export void *OPC__init(void) +{ + __DEFMOD; + __MODULE_IMPORT(Configuration); + __MODULE_IMPORT(OPM); + __MODULE_IMPORT(OPT); + __REGMOD("OPC", 0); + __REGCMD("BegBlk", OPC_BegBlk); + __REGCMD("BegStat", OPC_BegStat); + __REGCMD("EndBlk", OPC_EndBlk); + __REGCMD("EndBlk0", OPC_EndBlk0); + __REGCMD("EndStat", OPC_EndStat); + __REGCMD("EnterBody", OPC_EnterBody); + __REGCMD("ExitBody", OPC_ExitBody); + __REGCMD("GenHdrIncludes", OPC_GenHdrIncludes); + __REGCMD("Init", OPC_Init); +/* BEGIN */ + OPC_InitKeywords(); + __ENDMOD; +} diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h new file mode 100644 index 00000000..713ea3b2 --- /dev/null +++ b/bootstrap/windows-48/OPC.h @@ -0,0 +1,49 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ + +#ifndef OPC__h +#define OPC__h + +#include "SYSTEM.h" +#include "OPT.h" + + + + +import void OPC_Align (LONGINT *adr, LONGINT base); +import void OPC_Andent (OPT_Struct typ); +import LONGINT OPC_Base (OPT_Struct typ); +import OPT_Object OPC_BaseTProc (OPT_Object obj); +import void OPC_BegBlk (void); +import void OPC_BegStat (void); +import void OPC_Case (LONGINT caseVal, INTEGER form); +import void OPC_Cmp (INTEGER rel); +import void OPC_CompleteIdent (OPT_Object obj); +import void OPC_Constant (OPT_Const con, INTEGER form); +import void OPC_DefineInter (OPT_Object proc); +import void OPC_EndBlk (void); +import void OPC_EndBlk0 (void); +import void OPC_EndStat (void); +import void OPC_EnterBody (void); +import void OPC_EnterProc (OPT_Object proc); +import void OPC_ExitBody (void); +import void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet); +import void OPC_GenBdy (OPT_Node n); +import void OPC_GenEnumPtrs (OPT_Object var); +import void OPC_GenHdr (OPT_Node n); +import void OPC_GenHdrIncludes (void); +import void OPC_Halt (LONGINT n); +import void OPC_Ident (OPT_Object obj); +import void OPC_Increment (BOOLEAN decrement); +import void OPC_Indent (INTEGER count); +import void OPC_Init (void); +import void OPC_InitTDesc (OPT_Struct typ); +import void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim); +import LONGINT OPC_NofPtrs (OPT_Struct typ); +import void OPC_SetInclude (BOOLEAN exclude); +import void OPC_TDescDecl (OPT_Struct typ); +import void OPC_TypeDefs (OPT_Object obj, INTEGER vis); +import void OPC_TypeOf (OPT_Object ap); +import void *OPC__init(void); + + +#endif diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c new file mode 100644 index 00000000..3d68d2be --- /dev/null +++ b/bootstrap/windows-48/OPM.c @@ -0,0 +1,1091 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +#include "SYSTEM.h" +#include "Configuration.h" +#include "Console.h" +#include "Files.h" +#include "Platform.h" +#include "Strings.h" +#include "Texts.h" +#include "errors.h" +#include "vt100.h" + +typedef + CHAR OPM_FileName[32]; + + +static CHAR OPM_SourceFileName[256]; +export INTEGER OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_CharAlign, OPM_BoolAlign, OPM_SIntAlign, OPM_IntAlign, OPM_LIntAlign, OPM_SetAlign, OPM_RealAlign, OPM_LRealAlign, OPM_PointerAlign, OPM_ProcAlign, OPM_RecAlign, OPM_MaxSet; +export LONGINT OPM_MinSInt, OPM_MinInt, OPM_MinLInt, OPM_MaxSInt, OPM_MaxInt, OPM_MaxLInt, OPM_MaxIndex; +export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; +export BOOLEAN OPM_noerr; +export LONGINT OPM_curpos, OPM_errpos, OPM_breakpc; +export INTEGER OPM_currFile, OPM_level, OPM_pc, OPM_entno; +export CHAR OPM_modName[32]; +export CHAR OPM_objname[64]; +export SET OPM_opt, OPM_glbopt; +static LONGINT OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; +static Texts_Reader OPM_inR; +static Texts_Text OPM_Log; +static Texts_Writer OPM_W; +static Files_Rider OPM_oldSF, OPM_newSF; +static Files_Rider OPM_R[3]; +static Files_File OPM_oldSFile, OPM_newSFile, OPM_HFile, OPM_BFile, OPM_HIFile; +static INTEGER OPM_S; +export BOOLEAN OPM_dontAsm, OPM_dontLink, OPM_mainProg, OPM_mainLinkStat, OPM_notColorOutput, OPM_forceNewSym, OPM_Verbose; +static CHAR OPM_OBERON[1024]; +static CHAR OPM_MODULES[1024]; + + +static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F); +export void OPM_CloseFiles (void); +export void OPM_CloseOldSym (void); +export void OPM_DeleteNewSym (void); +export void OPM_FPrint (LONGINT *fp, LONGINT val); +export void OPM_FPrintLReal (LONGINT *fp, LONGREAL lr); +export void OPM_FPrintReal (LONGINT *fp, REAL real); +export void OPM_FPrintSet (LONGINT *fp, SET set); +static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, LONGINT pos); +export void OPM_Get (CHAR *ch); +static void OPM_GetProperties (void); +static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONGINT name__len, INTEGER *size, INTEGER *align); +export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); +export void OPM_InitOptions (void); +static void OPM_LogErrMsg (INTEGER n); +export void OPM_LogW (CHAR ch); +export void OPM_LogWLn (void); +export void OPM_LogWNum (LONGINT i, LONGINT len); +export void OPM_LogWStr (CHAR *s, LONGINT s__len); +static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len); +export void OPM_Mark (INTEGER n, LONGINT pos); +static INTEGER OPM_Min (INTEGER a, INTEGER b); +export void OPM_NewSym (CHAR *modName, LONGINT modName__len); +export void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); +export void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); +export BOOLEAN OPM_OpenPar (void); +export void OPM_RegisterNewSym (void); +static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt); +static void OPM_ShowLine (LONGINT pos); +export void OPM_SymRCh (CHAR *ch); +export LONGINT OPM_SymRInt (void); +export void OPM_SymRLReal (LONGREAL *lr); +export void OPM_SymRReal (REAL *r); +export void OPM_SymRSet (SET *s); +export void OPM_SymWCh (CHAR ch); +export void OPM_SymWInt (LONGINT i); +export void OPM_SymWLReal (LONGREAL lr); +export void OPM_SymWReal (REAL r); +export void OPM_SymWSet (SET s); +static void OPM_VerboseListSizes (void); +export void OPM_Write (CHAR ch); +export void OPM_WriteHex (LONGINT i); +export void OPM_WriteInt (LONGINT i); +export void OPM_WriteLn (void); +export void OPM_WriteReal (LONGREAL r, CHAR suffx); +export void OPM_WriteString (CHAR *s, LONGINT s__len); +export void OPM_WriteStringVar (CHAR *s, LONGINT s__len); +export BOOLEAN OPM_eofSF (void); +export void OPM_err (INTEGER n); +static LONGINT OPM_minus (LONGINT i); +static LONGINT OPM_power0 (LONGINT i, LONGINT j); + + +void OPM_LogW (CHAR ch) +{ + Console_Char(ch); +} + +void OPM_LogWStr (CHAR *s, LONGINT s__len) +{ + __DUP(s, s__len, CHAR); + Console_String(s, s__len); + __DEL(s); +} + +void OPM_LogWNum (LONGINT i, LONGINT len) +{ + Console_Int(i, len); +} + +void OPM_LogWLn (void) +{ + Console_Ln(); +} + +static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) +{ + INTEGER i; + i = 1; + while (s[__X(i, s__len)] != 0x00) { + switch (s[__X(i, s__len)]) { + case 'e': + *opt = *opt ^ 0x0200; + break; + case 's': + *opt = *opt ^ 0x10; + break; + case 'm': + *opt = *opt ^ 0x0400; + break; + case 'x': + *opt = *opt ^ 0x01; + break; + case 'r': + *opt = *opt ^ 0x04; + break; + case 't': + *opt = *opt ^ 0x08; + break; + case 'a': + *opt = *opt ^ 0x80; + break; + case 'k': + *opt = *opt ^ 0x40; + break; + case 'p': + *opt = *opt ^ 0x20; + break; + case 'S': + *opt = *opt ^ 0x2000; + break; + case 'c': + *opt = *opt ^ 0x4000; + break; + case 'M': + *opt = *opt ^ 0x8000; + break; + case 'f': + *opt = *opt ^ 0x010000; + break; + case 'F': + *opt = *opt ^ 0x020000; + break; + case 'V': + *opt = *opt ^ 0x040000; + break; + case 'B': + if (s[__X(i + 1, s__len)] != 0x00) { + i += 1; + OPM_IntSize = (int)s[__X(i, s__len)] - 48; + } + if (s[__X(i + 1, s__len)] != 0x00) { + i += 1; + OPM_PointerSize = (int)s[__X(i, s__len)] - 48; + } + if (s[__X(i + 1, s__len)] != 0x00) { + i += 1; + OPM_Alignment = (int)s[__X(i, s__len)] - 48; + } + __ASSERT(OPM_IntSize == 2 || OPM_IntSize == 4, 0); + __ASSERT(OPM_PointerSize == 4 || OPM_PointerSize == 8, 0); + __ASSERT(OPM_Alignment == 4 || OPM_Alignment == 8, 0); + break; + default: + OPM_LogWStr((CHAR*)" warning: option ", (LONGINT)19); + OPM_LogW('-'); + OPM_LogW(s[__X(i, s__len)]); + OPM_LogWStr((CHAR*)" ignored", (LONGINT)9); + OPM_LogWLn(); + break; + } + i += 1; + } +} + +BOOLEAN OPM_OpenPar (void) +{ + BOOLEAN _o_result; + CHAR s[256]; + if (Platform_ArgCount == 1) { + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Vishap Oberon-2 compiler v", (LONGINT)27); + OPM_LogWStr((CHAR*)"1.2 [2016/06/15] for gcc LP64 on cygwin", (LONGINT)40); + OPM_LogW('.'); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Based on Ofront by Software Templ OEG, continued by Norayr Chilingarian and others.", (LONGINT)84); + OPM_LogWLn(); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Usage:", (LONGINT)7); + OPM_LogWLn(); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" ", (LONGINT)3); + OPM_LogWStr((CHAR*)"voc", (LONGINT)4); + OPM_LogWStr((CHAR*)" options {files {options}}.", (LONGINT)28); + OPM_LogWLn(); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Where options = [\"-\" {option} ].", (LONGINT)33); + OPM_LogWLn(); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" m - generate code for main module", (LONGINT)36); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" M - generate code for main module and link object statically", (LONGINT)63); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" s - generate new symbol file", (LONGINT)31); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" e - allow extending the module interface", (LONGINT)43); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" r - check value ranges", (LONGINT)25); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" x - turn off array indices check", (LONGINT)35); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" a - don\'t check ASSERTs at runtime, use this option in tested production code", (LONGINT)80); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" p - turn off automatic pointer initialization", (LONGINT)48); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" t - don\'t check type guards (use in rare cases such as low-level modules where every cycle counts)", (LONGINT)101); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" S - don\'t call external assembler/compiler, only generate C code", (LONGINT)67); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" c - don\'t call linker", (LONGINT)24); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" f - don\'t use color output", (LONGINT)29); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" F - force writing new symbol file in current directory", (LONGINT)57); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" V - verbose output", (LONGINT)21); + OPM_LogWLn(); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Initial options specify defaults for all files.", (LONGINT)48); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Options following a filename are specific to that file.", (LONGINT)56); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Repeating an option toggles its value.", (LONGINT)39); + OPM_LogWLn(); + _o_result = 0; + return _o_result; + } else { + OPM_S = 1; + s[0] = 0x00; + Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + OPM_glbopt = 0xe9; + while (s[0] == '-') { + OPM_ScanOptions((void*)s, ((LONGINT)(256)), &OPM_glbopt); + OPM_S += 1; + s[0] = 0x00; + Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + } + _o_result = 1; + return _o_result; + } + __RETCHK; +} + +void OPM_InitOptions (void) +{ + CHAR s[256]; + OPM_opt = OPM_glbopt; + s[0] = 0x00; + Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + while (s[0] == '-') { + OPM_ScanOptions((void*)s, ((LONGINT)(256)), &OPM_opt); + OPM_S += 1; + s[0] = 0x00; + Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + } + OPM_dontAsm = __IN(13, OPM_opt); + OPM_dontLink = __IN(14, OPM_opt); + OPM_mainProg = __IN(10, OPM_opt); + OPM_mainLinkStat = __IN(15, OPM_opt); + OPM_notColorOutput = __IN(16, OPM_opt); + OPM_forceNewSym = __IN(17, OPM_opt); + OPM_Verbose = __IN(18, OPM_opt); + if (OPM_mainLinkStat) { + OPM_glbopt |= __SETOF(10); + } + OPM_GetProperties(); +} + +void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len) +{ + Texts_Text T = NIL; + LONGINT beg, end, time; + CHAR s[256]; + *done = 0; + OPM_curpos = 0; + if (OPM_S >= Platform_ArgCount) { + return; + } + s[0] = 0x00; + Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + __NEW(T, Texts_TextDesc); + Texts_Open(T, s, ((LONGINT)(256))); + OPM_LogWStr(s, ((LONGINT)(256))); + OPM_LogWStr((CHAR*)" ", (LONGINT)3); + __COPY(s, mname, mname__len); + __COPY(s, OPM_SourceFileName, ((LONGINT)(256))); + if (T->len == 0) { + OPM_LogWStr(s, ((LONGINT)(256))); + OPM_LogWStr((CHAR*)" not found.", (LONGINT)12); + OPM_LogWLn(); + } else { + Texts_OpenReader(&OPM_inR, Texts_Reader__typ, T, ((LONGINT)(0))); + *done = 1; + } + OPM_S += 1; + OPM_level = 0; + OPM_noerr = 1; + OPM_errpos = OPM_curpos; + OPM_lasterrpos = OPM_curpos - 10; + OPM_ErrorLineStartPos = 0; + OPM_ErrorLineLimitPos = 0; + OPM_ErrorLineNumber = 0; +} + +void OPM_Get (CHAR *ch) +{ + Texts_Read(&OPM_inR, Texts_Reader__typ, &*ch); + if (*ch == 0x0d) { + OPM_curpos = Texts_Pos(&OPM_inR, Texts_Reader__typ); + } else { + OPM_curpos += 1; + } + if ((*ch < 0x09 && !OPM_inR.eot)) { + *ch = ' '; + } +} + +static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len) +{ + INTEGER i, j; + CHAR ch; + __DUP(ext, ext__len, CHAR); + i = 0; + for (;;) { + ch = name[__X(i, name__len)]; + if (ch == 0x00) { + break; + } + FName[__X(i, FName__len)] = ch; + i += 1; + } + j = 0; + do { + ch = ext[__X(j, ext__len)]; + FName[__X(i, FName__len)] = ch; + i += 1; + j += 1; + } while (!(ch == 0x00)); + __DEL(ext); +} + +static void OPM_LogErrMsg (INTEGER n) +{ + Texts_Scanner S; + Texts_Text T = NIL; + CHAR ch; + INTEGER i; + CHAR buf[1024]; + if (n >= 0) { + if (!OPM_notColorOutput) { + vt100_SetAttr((CHAR*)"31m", (LONGINT)4); + } + OPM_LogWStr((CHAR*)" err ", (LONGINT)7); + if (!OPM_notColorOutput) { + vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + } + } else { + if (!OPM_notColorOutput) { + vt100_SetAttr((CHAR*)"35m", (LONGINT)4); + } + OPM_LogWStr((CHAR*)" warning ", (LONGINT)11); + n = -n; + if (!OPM_notColorOutput) { + vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + } + } + OPM_LogWNum(n, ((LONGINT)(1))); + OPM_LogWStr((CHAR*)" ", (LONGINT)3); + OPM_LogWStr(errors_errors[__X(n, ((LONGINT)(350)))], ((LONGINT)(128))); +} + +static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, LONGINT pos) +{ + CHAR ch, cheol; + if (pos < OPM_ErrorLineStartPos) { + OPM_ErrorLineStartPos = 0; + OPM_ErrorLineLimitPos = 0; + OPM_ErrorLineNumber = 0; + } + if (pos < OPM_ErrorLineLimitPos) { + Files_Set(&*r, r__typ, f, OPM_ErrorLineStartPos); + return; + } + Files_Set(&*r, r__typ, f, OPM_ErrorLineLimitPos); + Files_Read(&*r, r__typ, (void*)&ch); + while ((OPM_ErrorLineLimitPos < pos && !(*r).eof)) { + OPM_ErrorLineStartPos = OPM_ErrorLineLimitPos; + OPM_ErrorLineNumber += 1; + while ((((ch != 0x00 && ch != 0x0d)) && ch != 0x0a)) { + Files_Read(&*r, r__typ, (void*)&ch); + OPM_ErrorLineLimitPos += 1; + } + cheol = ch; + Files_Read(&*r, r__typ, (void*)&ch); + OPM_ErrorLineLimitPos += 1; + if ((cheol == 0x0d && ch == 0x0a)) { + OPM_ErrorLineLimitPos += 1; + Files_Read(&*r, r__typ, (void*)&ch); + } + } + Files_Set(&*r, r__typ, f, OPM_ErrorLineStartPos); +} + +static void OPM_ShowLine (LONGINT pos) +{ + Files_File f = NIL; + Files_Rider r; + CHAR line[1023]; + INTEGER i; + CHAR ch; + f = Files_Old(OPM_SourceFileName, ((LONGINT)(256))); + OPM_FindLine(f, &r, Files_Rider__typ, pos); + i = 0; + Files_Read(&r, Files_Rider__typ, (void*)&ch); + while ((((((ch != 0x00 && ch != 0x0d)) && ch != 0x0a)) && i < 1022)) { + line[__X(i, ((LONGINT)(1023)))] = ch; + i += 1; + Files_Read(&r, Files_Rider__typ, (void*)&ch); + } + line[__X(i, ((LONGINT)(1023)))] = 0x00; + OPM_LogWLn(); + OPM_LogWLn(); + OPM_LogWNum(OPM_ErrorLineNumber, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)": ", (LONGINT)3); + OPM_LogWStr(line, ((LONGINT)(1023))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" ", (LONGINT)7); + if (pos >= OPM_ErrorLineLimitPos) { + pos = OPM_ErrorLineLimitPos - 1; + } + i = (int)(pos - OPM_ErrorLineStartPos); + while (i > 0) { + OPM_LogW(' '); + i -= 1; + } + if (!OPM_notColorOutput) { + vt100_SetAttr((CHAR*)"32m", (LONGINT)4); + } + OPM_LogW('^'); + if (!OPM_notColorOutput) { + vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + } + Files_Close(f); +} + +void OPM_Mark (INTEGER n, LONGINT pos) +{ + if (pos == -1) { + pos = 0; + } + if (n >= 0) { + OPM_noerr = 0; + if (pos < OPM_lasterrpos || OPM_lasterrpos + 9 < pos) { + OPM_lasterrpos = pos; + OPM_ShowLine(pos); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" ", (LONGINT)3); + if (n < 249) { + OPM_LogWStr((CHAR*)" pos", (LONGINT)6); + OPM_LogWNum(pos, ((LONGINT)(6))); + OPM_LogErrMsg(n); + } else if (n == 255) { + OPM_LogWStr((CHAR*)"pos", (LONGINT)4); + OPM_LogWNum(pos, ((LONGINT)(6))); + OPM_LogWStr((CHAR*)" pc ", (LONGINT)6); + OPM_LogWNum(OPM_breakpc, ((LONGINT)(1))); + } else if (n == 254) { + OPM_LogWStr((CHAR*)"pc not found", (LONGINT)13); + } else { + OPM_LogWStr(OPM_objname, ((LONGINT)(64))); + if (n == 253) { + OPM_LogWStr((CHAR*)" is new, compile with option e", (LONGINT)31); + } else if (n == 252) { + OPM_LogWStr((CHAR*)" is redefined, compile with option s", (LONGINT)37); + } else if (n == 251) { + OPM_LogWStr((CHAR*)" is redefined (private part only), compile with option s", (LONGINT)57); + } else if (n == 250) { + OPM_LogWStr((CHAR*)" is no longer visible, compile with option s", (LONGINT)45); + } else if (n == 249) { + OPM_LogWStr((CHAR*)" is not consistently imported, recompile imports", (LONGINT)49); + } + } + } + } else { + if (pos >= 0) { + OPM_ShowLine(pos); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" pos", (LONGINT)6); + OPM_LogWNum(pos, ((LONGINT)(6))); + } + OPM_LogErrMsg(n); + if (pos < 0) { + OPM_LogWLn(); + } + } +} + +void OPM_err (INTEGER n) +{ + OPM_Mark(n, OPM_errpos); +} + +void OPM_FPrint (LONGINT *fp, LONGINT val) +{ + *fp = __ROTL((LONGINT)((SET)*fp ^ (SET)val), 1, LONGINT); +} + +void OPM_FPrintSet (LONGINT *fp, SET set) +{ + OPM_FPrint(&*fp, (LONGINT)set); +} + +void OPM_FPrintReal (LONGINT *fp, REAL real) +{ + OPM_FPrint(&*fp, __VAL(LONGINT, real)); +} + +void OPM_FPrintLReal (LONGINT *fp, LONGREAL lr) +{ + LONGINT l, h; + __GET((LONGINT)(uintptr_t)&lr, l, LONGINT); + __GET((LONGINT)(uintptr_t)&lr + 4, h, LONGINT); + OPM_FPrint(&*fp, l); + OPM_FPrint(&*fp, h); +} + +static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONGINT name__len, INTEGER *size, INTEGER *align) +{ + __DUP(name, name__len, CHAR); + if (((*S).class == 1 && __STRCMP((*S).s, name) == 0)) { + Texts_Scan(&*S, S__typ); + if ((*S).class == 3) { + *size = (int)(*S).i; + Texts_Scan(&*S, S__typ); + } else { + OPM_Mark(-157, ((LONGINT)(-1))); + } + if ((*S).class == 3) { + *align = (int)(*S).i; + Texts_Scan(&*S, S__typ); + } else { + OPM_Mark(-157, ((LONGINT)(-1))); + } + } else { + OPM_Mark(-157, ((LONGINT)(-1))); + } + __DEL(name); +} + +static LONGINT OPM_minus (LONGINT i) +{ + LONGINT _o_result; + _o_result = -i; + return _o_result; +} + +static LONGINT OPM_power0 (LONGINT i, LONGINT j) +{ + LONGINT _o_result; + LONGINT k, p; + k = 1; + p = i; + do { + p = p * i; + k += 1; + } while (!(k == j)); + _o_result = p; + return _o_result; +} + +static void OPM_VerboseListSizes (void) +{ + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Type Size Alignement", (LONGINT)29); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"CHAR ", (LONGINT)14); + OPM_LogWNum(OPM_CharSize, ((LONGINT)(4))); + OPM_LogWNum(OPM_CharAlign, ((LONGINT)(5))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"BOOLEAN ", (LONGINT)14); + OPM_LogWNum(OPM_BoolSize, ((LONGINT)(4))); + OPM_LogWNum(OPM_BoolAlign, ((LONGINT)(5))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"SHORTINT ", (LONGINT)14); + OPM_LogWNum(OPM_SIntSize, ((LONGINT)(4))); + OPM_LogWNum(OPM_SIntAlign, ((LONGINT)(5))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"INTEGER ", (LONGINT)14); + OPM_LogWNum(OPM_IntSize, ((LONGINT)(4))); + OPM_LogWNum(OPM_IntAlign, ((LONGINT)(5))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"LONGINT ", (LONGINT)14); + OPM_LogWNum(OPM_LIntSize, ((LONGINT)(4))); + OPM_LogWNum(OPM_LIntAlign, ((LONGINT)(5))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"SET ", (LONGINT)14); + OPM_LogWNum(OPM_SetSize, ((LONGINT)(4))); + OPM_LogWNum(OPM_SetAlign, ((LONGINT)(5))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"REAL ", (LONGINT)14); + OPM_LogWNum(OPM_RealSize, ((LONGINT)(4))); + OPM_LogWNum(OPM_RealAlign, ((LONGINT)(5))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"LONGREAL ", (LONGINT)14); + OPM_LogWNum(OPM_LRealSize, ((LONGINT)(4))); + OPM_LogWNum(OPM_LRealAlign, ((LONGINT)(5))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"PTR ", (LONGINT)14); + OPM_LogWNum(OPM_PointerSize, ((LONGINT)(4))); + OPM_LogWNum(OPM_PointerAlign, ((LONGINT)(5))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"PROC ", (LONGINT)14); + OPM_LogWNum(OPM_ProcSize, ((LONGINT)(4))); + OPM_LogWNum(OPM_ProcAlign, ((LONGINT)(5))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"RECORD ", (LONGINT)14); + OPM_LogWNum(OPM_RecSize, ((LONGINT)(4))); + OPM_LogWNum(OPM_RecAlign, ((LONGINT)(5))); + OPM_LogWLn(); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Min shortint ", (LONGINT)14); + OPM_LogWNum(OPM_MinSInt, ((LONGINT)(4))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Max shortint ", (LONGINT)14); + OPM_LogWNum(OPM_MaxSInt, ((LONGINT)(4))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Min integer ", (LONGINT)14); + OPM_LogWNum(OPM_MinInt, ((LONGINT)(4))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Max integer ", (LONGINT)14); + OPM_LogWNum(OPM_MaxInt, ((LONGINT)(4))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Min longint ", (LONGINT)14); + OPM_LogWNum(OPM_MinLInt, ((LONGINT)(4))); + OPM_LogWLn(); +} + +static INTEGER OPM_Min (INTEGER a, INTEGER b) +{ + INTEGER _o_result; + if (a < b) { + _o_result = a; + return _o_result; + } else { + _o_result = b; + return _o_result; + } + __RETCHK; +} + +static void OPM_GetProperties (void) +{ + LONGINT base; + OPM_ProcSize = OPM_PointerSize; + OPM_LIntSize = __ASHL(OPM_IntSize, 1); + OPM_SetSize = OPM_LIntSize; + OPM_CharAlign = OPM_Min(OPM_Alignment, OPM_CharSize); + OPM_BoolAlign = OPM_Min(OPM_Alignment, OPM_BoolSize); + OPM_SIntAlign = OPM_Min(OPM_Alignment, OPM_SIntSize); + OPM_RecAlign = OPM_Min(OPM_Alignment, OPM_RecSize); + OPM_RealAlign = OPM_Min(OPM_Alignment, OPM_RealSize); + OPM_LRealAlign = OPM_Min(OPM_Alignment, OPM_LRealSize); + OPM_PointerAlign = OPM_Min(OPM_Alignment, OPM_PointerSize); + OPM_ProcAlign = OPM_Min(OPM_Alignment, OPM_ProcSize); + OPM_IntAlign = OPM_Min(OPM_Alignment, OPM_IntSize); + OPM_LIntAlign = OPM_Min(OPM_Alignment, OPM_LIntSize); + OPM_SetAlign = OPM_Min(OPM_Alignment, OPM_SetSize); + base = -2; + OPM_MinSInt = __ASH(base, __ASHL(OPM_SIntSize, 3) - 2); + OPM_MaxSInt = OPM_minus(OPM_MinSInt + 1); + OPM_MinInt = __ASH(base, __ASHL(OPM_IntSize, 3) - 2); + OPM_MaxInt = OPM_minus(OPM_MinInt + 1); + OPM_MinLInt = __ASH(base, __ASHL(OPM_LIntSize, 3) - 2); + OPM_MaxLInt = OPM_minus(OPM_MinLInt + 1); + if (OPM_RealSize == 4) { + OPM_MaxReal = 3.40282346000000e+038; + } else if (OPM_RealSize == 8) { + OPM_MaxReal = 1.79769296342094e+308; + } + if (OPM_LRealSize == 4) { + OPM_MaxLReal = 3.40282346000000e+038; + } else if (OPM_LRealSize == 8) { + OPM_MaxLReal = 1.79769296342094e+308; + } + OPM_MinReal = -OPM_MaxReal; + OPM_MinLReal = -OPM_MaxLReal; + OPM_MaxSet = __ASHL(OPM_SetSize, 3) - 1; + OPM_MaxIndex = OPM_MaxLInt; + if (OPM_Verbose) { + OPM_VerboseListSizes(); + } +} + +void OPM_SymRCh (CHAR *ch) +{ + Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&*ch); +} + +LONGINT OPM_SymRInt (void) +{ + LONGINT _o_result; + LONGINT k; + Files_ReadNum(&OPM_oldSF, Files_Rider__typ, &k); + _o_result = k; + return _o_result; +} + +void OPM_SymRSet (SET *s) +{ + Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (LONGINT*)&*s); +} + +void OPM_SymRReal (REAL *r) +{ + Files_ReadReal(&OPM_oldSF, Files_Rider__typ, &*r); +} + +void OPM_SymRLReal (LONGREAL *lr) +{ + Files_ReadLReal(&OPM_oldSF, Files_Rider__typ, &*lr); +} + +void OPM_CloseOldSym (void) +{ +} + +void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done) +{ + CHAR ch; + OPM_FileName fileName; + OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, ((LONGINT)(32)), (CHAR*)".sym", (LONGINT)5); + OPM_oldSFile = Files_Old(fileName, ((LONGINT)(32))); + *done = OPM_oldSFile != NIL; + if (*done) { + Files_Set(&OPM_oldSF, Files_Rider__typ, OPM_oldSFile, ((LONGINT)(0))); + Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&ch); + if (ch != 0xf7) { + OPM_err(-306); + OPM_CloseOldSym(); + *done = 0; + } + } +} + +BOOLEAN OPM_eofSF (void) +{ + BOOLEAN _o_result; + _o_result = OPM_oldSF.eof; + return _o_result; +} + +void OPM_SymWCh (CHAR ch) +{ + Files_Write(&OPM_newSF, Files_Rider__typ, ch); +} + +void OPM_SymWInt (LONGINT i) +{ + Files_WriteNum(&OPM_newSF, Files_Rider__typ, i); +} + +void OPM_SymWSet (SET s) +{ + Files_WriteNum(&OPM_newSF, Files_Rider__typ, (LONGINT)s); +} + +void OPM_SymWReal (REAL r) +{ + Files_WriteReal(&OPM_newSF, Files_Rider__typ, r); +} + +void OPM_SymWLReal (LONGREAL lr) +{ + Files_WriteLReal(&OPM_newSF, Files_Rider__typ, lr); +} + +void OPM_RegisterNewSym (void) +{ + if (__STRCMP(OPM_modName, "SYSTEM") != 0 || __IN(10, OPM_opt)) { + Files_Register(OPM_newSFile); + } +} + +void OPM_DeleteNewSym (void) +{ +} + +void OPM_NewSym (CHAR *modName, LONGINT modName__len) +{ + OPM_FileName fileName; + OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, ((LONGINT)(32)), (CHAR*)".sym", (LONGINT)5); + OPM_newSFile = Files_New(fileName, ((LONGINT)(32))); + if (OPM_newSFile != NIL) { + Files_Set(&OPM_newSF, Files_Rider__typ, OPM_newSFile, ((LONGINT)(0))); + Files_Write(&OPM_newSF, Files_Rider__typ, 0xf7); + } else { + OPM_err(153); + } +} + +void OPM_Write (CHAR ch) +{ + Files_Write(&OPM_R[__X(OPM_currFile, ((LONGINT)(3)))], Files_Rider__typ, ch); +} + +void OPM_WriteString (CHAR *s, LONGINT s__len) +{ + INTEGER i; + i = 0; + while (s[__X(i, s__len)] != 0x00) { + i += 1; + } + Files_WriteBytes(&OPM_R[__X(OPM_currFile, ((LONGINT)(3)))], Files_Rider__typ, (void*)s, s__len * ((LONGINT)(1)), i); +} + +void OPM_WriteStringVar (CHAR *s, LONGINT s__len) +{ + INTEGER i; + i = 0; + while (s[__X(i, s__len)] != 0x00) { + i += 1; + } + Files_WriteBytes(&OPM_R[__X(OPM_currFile, ((LONGINT)(3)))], Files_Rider__typ, (void*)s, s__len * ((LONGINT)(1)), i); +} + +void OPM_WriteHex (LONGINT i) +{ + CHAR s[3]; + INTEGER digit; + digit = __ASHR((int)i, 4); + if (digit < 10) { + s[0] = (CHAR)(48 + digit); + } else { + s[0] = (CHAR)(87 + digit); + } + digit = __MASK((int)i, -16); + if (digit < 10) { + s[1] = (CHAR)(48 + digit); + } else { + s[1] = (CHAR)(87 + digit); + } + s[2] = 0x00; + OPM_WriteString(s, ((LONGINT)(3))); +} + +void OPM_WriteInt (LONGINT i) +{ + CHAR s[20]; + LONGINT i1, k; + if (i == OPM_MinInt || i == OPM_MinLInt) { + OPM_Write('('); + OPM_WriteInt(i + 1); + OPM_WriteString((CHAR*)"-1)", (LONGINT)4); + } else { + i1 = __ABS(i); + s[0] = (CHAR)(__MOD(i1, 10) + 48); + i1 = __DIV(i1, 10); + k = 1; + while (i1 > 0) { + s[__X(k, ((LONGINT)(20)))] = (CHAR)(__MOD(i1, 10) + 48); + i1 = __DIV(i1, 10); + k += 1; + } + if (i < 0) { + s[__X(k, ((LONGINT)(20)))] = '-'; + k += 1; + } + while (k > 0) { + k -= 1; + OPM_Write(s[__X(k, ((LONGINT)(20)))]); + } + } +} + +void OPM_WriteReal (LONGREAL r, CHAR suffx) +{ + Texts_Writer W; + Texts_Text T = NIL; + Texts_Reader R; + CHAR s[32]; + CHAR ch; + INTEGER i; + if ((((r < OPM_MaxLInt && r > OPM_MinLInt)) && r == (__ENTIER(r)))) { + if (suffx == 'f') { + OPM_WriteString((CHAR*)"(REAL)", (LONGINT)7); + } else { + OPM_WriteString((CHAR*)"(LONGREAL)", (LONGINT)11); + } + OPM_WriteInt(__ENTIER(r)); + } else { + Texts_OpenWriter(&W, Texts_Writer__typ); + if (suffx == 'f') { + Texts_WriteLongReal(&W, Texts_Writer__typ, r, 16); + } else { + Texts_WriteLongReal(&W, Texts_Writer__typ, r, 23); + } + __NEW(T, Texts_TextDesc); + Texts_Open(T, (CHAR*)"", (LONGINT)1); + Texts_Append(T, W.buf); + Texts_OpenReader(&R, Texts_Reader__typ, T, ((LONGINT)(0))); + i = 0; + Texts_Read(&R, Texts_Reader__typ, &ch); + while (ch != 0x00) { + s[__X(i, ((LONGINT)(32)))] = ch; + i += 1; + Texts_Read(&R, Texts_Reader__typ, &ch); + } + s[__X(i, ((LONGINT)(32)))] = 0x00; + i = 0; + ch = s[0]; + while ((ch != 'D' && ch != 0x00)) { + i += 1; + ch = s[__X(i, ((LONGINT)(32)))]; + } + if (ch == 'D') { + s[__X(i, ((LONGINT)(32)))] = 'e'; + } + OPM_WriteString(s, ((LONGINT)(32))); + } +} + +void OPM_WriteLn (void) +{ + Files_Write(&OPM_R[__X(OPM_currFile, ((LONGINT)(3)))], Files_Rider__typ, 0x0a); +} + +static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F) +{ + Files_Rider R1; + CHAR buffer[4096]; + if (F != NIL) { + Files_Set(&R1, Files_Rider__typ, F, ((LONGINT)(0))); + Files_ReadBytes(&R1, Files_Rider__typ, (void*)buffer, ((LONGINT)(4096)), ((LONGINT)(4096))); + while (4096 - R1.res > 0) { + Files_WriteBytes(&*R, R__typ, (void*)buffer, ((LONGINT)(4096)), 4096 - R1.res); + Files_ReadBytes(&R1, Files_Rider__typ, (void*)buffer, ((LONGINT)(4096)), ((LONGINT)(4096))); + } + } +} + +void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len) +{ + CHAR FName[32]; + __COPY(moduleName, OPM_modName, ((LONGINT)(32))); + OPM_HFile = Files_New((CHAR*)"", (LONGINT)1); + if (OPM_HFile != NIL) { + Files_Set(&OPM_R[0], Files_Rider__typ, OPM_HFile, ((LONGINT)(0))); + } else { + OPM_err(153); + } + OPM_MakeFileName((void*)moduleName, moduleName__len, (void*)FName, ((LONGINT)(32)), (CHAR*)".c", (LONGINT)3); + OPM_BFile = Files_New(FName, ((LONGINT)(32))); + if (OPM_BFile != NIL) { + Files_Set(&OPM_R[1], Files_Rider__typ, OPM_BFile, ((LONGINT)(0))); + } else { + OPM_err(153); + } + OPM_MakeFileName((void*)moduleName, moduleName__len, (void*)FName, ((LONGINT)(32)), (CHAR*)".h", (LONGINT)3); + OPM_HIFile = Files_New(FName, ((LONGINT)(32))); + if (OPM_HIFile != NIL) { + Files_Set(&OPM_R[2], Files_Rider__typ, OPM_HIFile, ((LONGINT)(0))); + } else { + OPM_err(153); + } +} + +void OPM_CloseFiles (void) +{ + CHAR FName[32]; + INTEGER res; + if (OPM_noerr) { + OPM_LogWStr((CHAR*)" ", (LONGINT)3); + OPM_LogWNum(Files_Pos(&OPM_R[1], Files_Rider__typ), ((LONGINT)(0))); + OPM_LogWStr((CHAR*)" chars.", (LONGINT)8); + } + if (OPM_noerr) { + if (__STRCMP(OPM_modName, "SYSTEM") == 0) { + if (!__IN(10, OPM_opt)) { + Files_Register(OPM_BFile); + } + } else if (!__IN(10, OPM_opt)) { + OPM_Append(&OPM_R[2], Files_Rider__typ, OPM_HFile); + Files_Register(OPM_HIFile); + Files_Register(OPM_BFile); + } else { + OPM_MakeFileName((void*)OPM_modName, ((LONGINT)(32)), (void*)FName, ((LONGINT)(32)), (CHAR*)".h", (LONGINT)3); + Files_Delete(FName, ((LONGINT)(32)), &res); + OPM_MakeFileName((void*)OPM_modName, ((LONGINT)(32)), (void*)FName, ((LONGINT)(32)), (CHAR*)".sym", (LONGINT)5); + Files_Delete(FName, ((LONGINT)(32)), &res); + Files_Register(OPM_BFile); + } + } + OPM_HFile = NIL; + OPM_BFile = NIL; + OPM_HIFile = NIL; + OPM_newSFile = NIL; + OPM_oldSFile = NIL; + Files_Set(&OPM_R[0], Files_Rider__typ, NIL, ((LONGINT)(0))); + Files_Set(&OPM_R[1], Files_Rider__typ, NIL, ((LONGINT)(0))); + Files_Set(&OPM_R[2], Files_Rider__typ, NIL, ((LONGINT)(0))); + Files_Set(&OPM_newSF, Files_Rider__typ, NIL, ((LONGINT)(0))); + Files_Set(&OPM_oldSF, Files_Rider__typ, NIL, ((LONGINT)(0))); +} + +static void EnumPtrs(void (*P)(void*)) +{ + __ENUMR(&OPM_inR, Texts_Reader__typ, 48, 1, P); + P(OPM_Log); + __ENUMR(&OPM_W, Texts_Writer__typ, 36, 1, P); + __ENUMR(&OPM_oldSF, Files_Rider__typ, 20, 1, P); + __ENUMR(&OPM_newSF, Files_Rider__typ, 20, 1, P); + __ENUMR(OPM_R, Files_Rider__typ, 20, 3, P); + P(OPM_oldSFile); + P(OPM_newSFile); + P(OPM_HFile); + P(OPM_BFile); + P(OPM_HIFile); +} + + +export void *OPM__init(void) +{ + __DEFMOD; + __MODULE_IMPORT(Configuration); + __MODULE_IMPORT(Console); + __MODULE_IMPORT(Files); + __MODULE_IMPORT(Platform); + __MODULE_IMPORT(Strings); + __MODULE_IMPORT(Texts); + __MODULE_IMPORT(errors); + __MODULE_IMPORT(vt100); + __REGMOD("OPM", EnumPtrs); + __REGCMD("CloseFiles", OPM_CloseFiles); + __REGCMD("CloseOldSym", OPM_CloseOldSym); + __REGCMD("DeleteNewSym", OPM_DeleteNewSym); + __REGCMD("InitOptions", OPM_InitOptions); + __REGCMD("LogWLn", OPM_LogWLn); + __REGCMD("RegisterNewSym", OPM_RegisterNewSym); + __REGCMD("WriteLn", OPM_WriteLn); +/* BEGIN */ + Texts_OpenWriter(&OPM_W, Texts_Writer__typ); + OPM_MODULES[0] = 0x00; + Platform_GetEnv((CHAR*)"MODULES", (LONGINT)8, (void*)OPM_MODULES, ((LONGINT)(1024))); + __MOVE(".", OPM_OBERON, 2); + Platform_GetEnv((CHAR*)"OBERON", (LONGINT)7, (void*)OPM_OBERON, ((LONGINT)(1024))); + Strings_Append((CHAR*)";.;", (LONGINT)4, (void*)OPM_OBERON, ((LONGINT)(1024))); + Strings_Append(OPM_MODULES, ((LONGINT)(1024)), (void*)OPM_OBERON, ((LONGINT)(1024))); + Strings_Append((CHAR*)";", (LONGINT)2, (void*)OPM_OBERON, ((LONGINT)(1024))); + Strings_Append((CHAR*)"/opt/voc", (LONGINT)9, (void*)OPM_OBERON, ((LONGINT)(1024))); + Strings_Append((CHAR*)"/sym;", (LONGINT)6, (void*)OPM_OBERON, ((LONGINT)(1024))); + Files_SetSearchPath(OPM_OBERON, ((LONGINT)(1024))); + OPM_CharSize = 1; + OPM_BoolSize = 1; + OPM_SIntSize = 1; + OPM_RecSize = 1; + OPM_ByteSize = 1; + OPM_RealSize = 4; + OPM_LRealSize = 8; + OPM_PointerSize = 8; + OPM_Alignment = 8; + OPM_IntSize = 4; + __ENDMOD; +} diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h new file mode 100644 index 00000000..68bf3af0 --- /dev/null +++ b/bootstrap/windows-48/OPM.h @@ -0,0 +1,63 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ + +#ifndef OPM__h +#define OPM__h + +#include "SYSTEM.h" + + +import INTEGER OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_CharAlign, OPM_BoolAlign, OPM_SIntAlign, OPM_IntAlign, OPM_LIntAlign, OPM_SetAlign, OPM_RealAlign, OPM_LRealAlign, OPM_PointerAlign, OPM_ProcAlign, OPM_RecAlign, OPM_MaxSet; +import LONGINT OPM_MinSInt, OPM_MinInt, OPM_MinLInt, OPM_MaxSInt, OPM_MaxInt, OPM_MaxLInt, OPM_MaxIndex; +import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; +import BOOLEAN OPM_noerr; +import LONGINT OPM_curpos, OPM_errpos, OPM_breakpc; +import INTEGER OPM_currFile, OPM_level, OPM_pc, OPM_entno; +import CHAR OPM_modName[32]; +import CHAR OPM_objname[64]; +import SET OPM_opt, OPM_glbopt; +import BOOLEAN OPM_dontAsm, OPM_dontLink, OPM_mainProg, OPM_mainLinkStat, OPM_notColorOutput, OPM_forceNewSym, OPM_Verbose; + + +import void OPM_CloseFiles (void); +import void OPM_CloseOldSym (void); +import void OPM_DeleteNewSym (void); +import void OPM_FPrint (LONGINT *fp, LONGINT val); +import void OPM_FPrintLReal (LONGINT *fp, LONGREAL lr); +import void OPM_FPrintReal (LONGINT *fp, REAL real); +import void OPM_FPrintSet (LONGINT *fp, SET set); +import void OPM_Get (CHAR *ch); +import void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); +import void OPM_InitOptions (void); +import void OPM_LogW (CHAR ch); +import void OPM_LogWLn (void); +import void OPM_LogWNum (LONGINT i, LONGINT len); +import void OPM_LogWStr (CHAR *s, LONGINT s__len); +import void OPM_Mark (INTEGER n, LONGINT pos); +import void OPM_NewSym (CHAR *modName, LONGINT modName__len); +import void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); +import void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); +import BOOLEAN OPM_OpenPar (void); +import void OPM_RegisterNewSym (void); +import void OPM_SymRCh (CHAR *ch); +import LONGINT OPM_SymRInt (void); +import void OPM_SymRLReal (LONGREAL *lr); +import void OPM_SymRReal (REAL *r); +import void OPM_SymRSet (SET *s); +import void OPM_SymWCh (CHAR ch); +import void OPM_SymWInt (LONGINT i); +import void OPM_SymWLReal (LONGREAL lr); +import void OPM_SymWReal (REAL r); +import void OPM_SymWSet (SET s); +import void OPM_Write (CHAR ch); +import void OPM_WriteHex (LONGINT i); +import void OPM_WriteInt (LONGINT i); +import void OPM_WriteLn (void); +import void OPM_WriteReal (LONGREAL r, CHAR suffx); +import void OPM_WriteString (CHAR *s, LONGINT s__len); +import void OPM_WriteStringVar (CHAR *s, LONGINT s__len); +import BOOLEAN OPM_eofSF (void); +import void OPM_err (INTEGER n); +import void *OPM__init(void); + + +#endif diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c new file mode 100644 index 00000000..f0530bb4 --- /dev/null +++ b/bootstrap/windows-48/OPP.c @@ -0,0 +1,1873 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +#include "SYSTEM.h" +#include "OPB.h" +#include "OPM.h" +#include "OPS.h" +#include "OPT.h" + +struct OPP__1 { + LONGINT low, high; +}; + +typedef + struct OPP__1 OPP_CaseTable[128]; + + +static SHORTINT OPP_sym, OPP_level; +static INTEGER OPP_LoopLevel; +static OPT_Node OPP_TDinit, OPP_lastTDinit; +static INTEGER OPP_nofFwdPtr; +static OPT_Struct OPP_FwdPtr[64]; + +export LONGINT *OPP__1__typ; + +static void OPP_ActualParameters (OPT_Node *aparlist, OPT_Object fpar); +static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned); +static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq); +static void OPP_CaseLabelList (OPT_Node *lab, INTEGER LabelForm, INTEGER *n, OPP_CaseTable tab); +static void OPP_CheckMark (SHORTINT *vis); +static void OPP_CheckSym (INTEGER s); +static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_); +static void OPP_ConstExpression (OPT_Node *x); +static void OPP_Element (OPT_Node *x); +static void OPP_Expression (OPT_Node *x); +static BOOLEAN OPP_Extends (OPT_Struct x, OPT_Struct b); +static void OPP_Factor (OPT_Node *x); +static void OPP_FormalParameters (OPT_Object *firstPar, OPT_Struct *resTyp); +export void OPP_Module (OPT_Node *prog, SET opt); +static void OPP_PointerType (OPT_Struct *typ); +static void OPP_ProcedureDeclaration (OPT_Node *x); +static void OPP_Receiver (SHORTINT *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec); +static void OPP_RecordType (OPT_Struct *typ, OPT_Struct *banned); +static void OPP_Sets (OPT_Node *x); +static void OPP_SimpleExpression (OPT_Node *x); +static void OPP_StandProcCall (OPT_Node *x); +static void OPP_StatSeq (OPT_Node *stat); +static void OPP_Term (OPT_Node *x); +static void OPP_Type (OPT_Struct *typ, OPT_Struct *banned); +static void OPP_TypeDecl (OPT_Struct *typ, OPT_Struct *banned); +static void OPP_err (INTEGER n); +static void OPP_qualident (OPT_Object *id); +static void OPP_selector (OPT_Node *x); + + +static void OPP_err (INTEGER n) +{ + OPM_err(n); +} + +static void OPP_CheckSym (INTEGER s) +{ + if ((int)OPP_sym == s) { + OPS_Get(&OPP_sym); + } else { + OPM_err(s); + } +} + +static void OPP_qualident (OPT_Object *id) +{ + OPT_Object obj = NIL; + SHORTINT lev; + OPT_Find(&obj); + OPS_Get(&OPP_sym); + if ((((OPP_sym == 18 && obj != NIL)) && obj->mode == 11)) { + OPS_Get(&OPP_sym); + if (OPP_sym == 38) { + OPT_FindImport(obj, &obj); + OPS_Get(&OPP_sym); + } else { + OPP_err(38); + obj = NIL; + } + } + if (obj == NIL) { + OPP_err(0); + obj = OPT_NewObj(); + obj->mode = 1; + obj->typ = OPT_undftyp; + obj->adr = 0; + } else { + lev = obj->mnolev; + if ((__IN(obj->mode, 0x06) && lev != OPP_level)) { + obj->leaf = 0; + if (lev > 0) { + OPB_StaticLink(OPP_level - lev); + } + } + } + *id = obj; +} + +static void OPP_ConstExpression (OPT_Node *x) +{ + OPP_Expression(&*x); + if ((*x)->class != 7) { + OPP_err(50); + *x = OPB_NewIntConst(((LONGINT)(1))); + } +} + +static void OPP_CheckMark (SHORTINT *vis) +{ + OPS_Get(&OPP_sym); + if (OPP_sym == 1 || OPP_sym == 7) { + if (OPP_level > 0) { + OPP_err(47); + } + if (OPP_sym == 1) { + *vis = 1; + } else { + *vis = 2; + } + OPS_Get(&OPP_sym); + } else { + *vis = 0; + } +} + +static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_) +{ + OPT_Node x = NIL; + LONGINT sf; + if (OPP_sym == 31) { + OPS_Get(&OPP_sym); + if (!OPT_SYSimported) { + OPP_err(135); + } + OPP_ConstExpression(&x); + if (__IN(x->typ->form, 0x70)) { + sf = x->conval->intval; + if (sf < 0 || sf > 1) { + OPP_err(220); + sf = 0; + } + } else { + OPP_err(51); + sf = 0; + } + *sysflag = (int)sf; + OPP_CheckSym(23); + } else { + *sysflag = default_; + } +} + +static void OPP_RecordType (OPT_Struct *typ, OPT_Struct *banned) +{ + OPT_Object fld = NIL, first = NIL, last = NIL, base = NIL; + OPT_Struct ftyp = NIL; + INTEGER sysflag; + *typ = OPT_NewStr(15, 4); + (*typ)->BaseTyp = NIL; + OPP_CheckSysFlag(&sysflag, -1); + if (OPP_sym == 30) { + OPS_Get(&OPP_sym); + if (OPP_sym == 38) { + OPP_qualident(&base); + if ((base->mode == 5 && base->typ->comp == 4)) { + if (base->typ == *banned) { + OPP_err(58); + } else { + base->typ->pvused = 1; + (*typ)->BaseTyp = base->typ; + (*typ)->extlev = base->typ->extlev + 1; + (*typ)->sysflag = base->typ->sysflag; + } + } else { + OPP_err(52); + } + } else { + OPP_err(38); + } + OPP_CheckSym(22); + } + if (sysflag >= 0) { + (*typ)->sysflag = sysflag; + } + OPT_OpenScope(0, NIL); + first = NIL; + last = NIL; + for (;;) { + if (OPP_sym == 38) { + for (;;) { + if (OPP_sym == 38) { + if ((*typ)->BaseTyp != NIL) { + OPT_FindField(OPS_name, (*typ)->BaseTyp, &fld); + if (fld != NIL) { + OPP_err(1); + } + } + OPT_Insert(OPS_name, &fld); + OPP_CheckMark(&fld->vis); + fld->mode = 4; + fld->link = NIL; + fld->typ = OPT_undftyp; + if (first == NIL) { + first = fld; + } + if (last == NIL) { + (*typ)->link = fld; + } else { + last->link = fld; + } + last = fld; + } else { + OPP_err(38); + } + if (OPP_sym == 19) { + OPS_Get(&OPP_sym); + } else if (OPP_sym == 38) { + OPP_err(19); + } else { + break; + } + } + OPP_CheckSym(20); + OPP_Type(&ftyp, &*banned); + ftyp->pvused = 1; + if (ftyp->comp == 3) { + ftyp = OPT_undftyp; + OPP_err(88); + } + while (first != NIL) { + first->typ = ftyp; + first = first->link; + } + } + if (OPP_sym == 39) { + OPS_Get(&OPP_sym); + } else if (OPP_sym == 38) { + OPP_err(39); + } else { + break; + } + } + OPT_CloseScope(); +} + +static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) +{ + OPT_Node x = NIL; + LONGINT n; + INTEGER sysflag; + OPP_CheckSysFlag(&sysflag, 0); + if (OPP_sym == 25) { + *typ = OPT_NewStr(15, 3); + (*typ)->mno = 0; + (*typ)->sysflag = sysflag; + OPS_Get(&OPP_sym); + OPP_Type(&(*typ)->BaseTyp, &*banned); + (*typ)->BaseTyp->pvused = 1; + if ((*typ)->BaseTyp->comp == 3) { + (*typ)->n = (*typ)->BaseTyp->n + 1; + } else { + (*typ)->n = 0; + } + } else { + *typ = OPT_NewStr(15, 2); + (*typ)->sysflag = sysflag; + OPP_ConstExpression(&x); + if (__IN(x->typ->form, 0x70)) { + n = x->conval->intval; + if (n <= 0 || n > OPM_MaxIndex) { + OPP_err(63); + n = 1; + } + } else { + OPP_err(51); + n = 1; + } + (*typ)->n = n; + if (OPP_sym == 25) { + OPS_Get(&OPP_sym); + OPP_Type(&(*typ)->BaseTyp, &*banned); + (*typ)->BaseTyp->pvused = 1; + } else if (OPP_sym == 19) { + OPS_Get(&OPP_sym); + if (OPP_sym != 25) { + OPP_ArrayType(&(*typ)->BaseTyp, &*banned); + } + } else { + OPP_err(35); + } + if ((*typ)->BaseTyp->comp == 3) { + (*typ)->BaseTyp = OPT_undftyp; + OPP_err(88); + } + } +} + +static void OPP_PointerType (OPT_Struct *typ) +{ + OPT_Object id = NIL; + *typ = OPT_NewStr(13, 1); + OPP_CheckSysFlag(&(*typ)->sysflag, 0); + OPP_CheckSym(28); + if (OPP_sym == 38) { + OPT_Find(&id); + if (id == NIL) { + if (OPP_nofFwdPtr < 64) { + OPP_FwdPtr[__X(OPP_nofFwdPtr, ((LONGINT)(64)))] = *typ; + OPP_nofFwdPtr += 1; + } else { + OPP_err(224); + } + (*typ)->link = OPT_NewObj(); + __COPY(OPS_name, (*typ)->link->name, ((LONGINT)(256))); + (*typ)->BaseTyp = OPT_undftyp; + OPS_Get(&OPP_sym); + } else { + OPP_qualident(&id); + if (id->mode == 5) { + if (__IN(id->typ->comp, 0x1c)) { + (*typ)->BaseTyp = id->typ; + } else { + (*typ)->BaseTyp = OPT_undftyp; + OPP_err(57); + } + } else { + (*typ)->BaseTyp = OPT_undftyp; + OPP_err(52); + } + } + } else { + OPP_Type(&(*typ)->BaseTyp, &OPT_notyp); + if (!__IN((*typ)->BaseTyp->comp, 0x1c)) { + (*typ)->BaseTyp = OPT_undftyp; + OPP_err(57); + } + } +} + +static void OPP_FormalParameters (OPT_Object *firstPar, OPT_Struct *resTyp) +{ + SHORTINT mode; + OPT_Object par = NIL, first = NIL, last = NIL, res = NIL; + OPT_Struct typ = NIL; + first = NIL; + last = *firstPar; + if (OPP_sym == 38 || OPP_sym == 60) { + for (;;) { + if (OPP_sym == 60) { + OPS_Get(&OPP_sym); + mode = 2; + } else { + mode = 1; + } + for (;;) { + if (OPP_sym == 38) { + OPT_Insert(OPS_name, &par); + OPS_Get(&OPP_sym); + par->mode = mode; + par->link = NIL; + if (first == NIL) { + first = par; + } + if (*firstPar == NIL) { + *firstPar = par; + } else { + last->link = par; + } + last = par; + } else { + OPP_err(38); + } + if (OPP_sym == 19) { + OPS_Get(&OPP_sym); + } else if (OPP_sym == 38) { + OPP_err(19); + } else if (OPP_sym == 60) { + OPP_err(19); + OPS_Get(&OPP_sym); + } else { + break; + } + } + OPP_CheckSym(20); + OPP_Type(&typ, &OPT_notyp); + if (mode == 1) { + typ->pvused = 1; + } + while (first != NIL) { + first->typ = typ; + first = first->link; + } + if (OPP_sym == 39) { + OPS_Get(&OPP_sym); + } else if (OPP_sym == 38) { + OPP_err(39); + } else { + break; + } + } + } + OPP_CheckSym(22); + if (OPP_sym == 20) { + OPS_Get(&OPP_sym); + *resTyp = OPT_undftyp; + if (OPP_sym == 38) { + OPP_qualident(&res); + if (res->mode == 5) { + if (res->typ->form < 15) { + *resTyp = res->typ; + } else { + OPP_err(54); + } + } else { + OPP_err(52); + } + } else { + OPP_err(38); + } + } else { + *resTyp = OPT_notyp; + } +} + +static void OPP_TypeDecl (OPT_Struct *typ, OPT_Struct *banned) +{ + OPT_Object id = NIL; + *typ = OPT_undftyp; + if (OPP_sym < 30) { + OPP_err(12); + do { + OPS_Get(&OPP_sym); + } while (!(OPP_sym >= 30)); + } + if (OPP_sym == 38) { + OPP_qualident(&id); + if (id->mode == 5) { + if (id->typ != *banned) { + *typ = id->typ; + } else { + OPP_err(58); + } + } else { + OPP_err(52); + } + } else if (OPP_sym == 54) { + OPS_Get(&OPP_sym); + OPP_ArrayType(&*typ, &*banned); + } else if (OPP_sym == 55) { + OPS_Get(&OPP_sym); + OPP_RecordType(&*typ, &*banned); + OPB_Inittd(&OPP_TDinit, &OPP_lastTDinit, *typ); + OPP_CheckSym(41); + } else if (OPP_sym == 56) { + OPS_Get(&OPP_sym); + OPP_PointerType(&*typ); + } else if (OPP_sym == 61) { + OPS_Get(&OPP_sym); + *typ = OPT_NewStr(14, 1); + OPP_CheckSysFlag(&(*typ)->sysflag, 0); + if (OPP_sym == 30) { + OPS_Get(&OPP_sym); + OPT_OpenScope(OPP_level, NIL); + OPP_FormalParameters(&(*typ)->link, &(*typ)->BaseTyp); + OPT_CloseScope(); + } else { + (*typ)->BaseTyp = OPT_notyp; + (*typ)->link = NIL; + } + } else { + OPP_err(12); + } + for (;;) { + if (((OPP_sym >= 39 && OPP_sym <= 42) || OPP_sym == 22) || OPP_sym == 64) { + break; + } + OPP_err(15); + if (OPP_sym == 38) { + break; + } + OPS_Get(&OPP_sym); + } +} + +static void OPP_Type (OPT_Struct *typ, OPT_Struct *banned) +{ + OPP_TypeDecl(&*typ, &*banned); + if (((((*typ)->form == 13 && (*typ)->BaseTyp == OPT_undftyp)) && (*typ)->strobj == NIL)) { + OPP_err(0); + } +} + +static void OPP_selector (OPT_Node *x) +{ + OPT_Object obj = NIL, proc = NIL; + OPT_Node y = NIL; + OPT_Struct typ = NIL; + OPS_Name name; + for (;;) { + if (OPP_sym == 31) { + OPS_Get(&OPP_sym); + for (;;) { + if (((*x)->typ != NIL && (*x)->typ->form == 13)) { + OPB_DeRef(&*x); + } + OPP_Expression(&y); + OPB_Index(&*x, y); + if (OPP_sym == 19) { + OPS_Get(&OPP_sym); + } else { + break; + } + } + OPP_CheckSym(23); + } else if (OPP_sym == 18) { + OPS_Get(&OPP_sym); + if (OPP_sym == 38) { + __COPY(OPS_name, name, ((LONGINT)(256))); + OPS_Get(&OPP_sym); + if ((*x)->typ != NIL) { + if ((*x)->typ->form == 13) { + OPB_DeRef(&*x); + } + if ((*x)->typ->comp == 4) { + OPT_FindField(name, (*x)->typ, &obj); + OPB_Field(&*x, obj); + if ((obj != NIL && obj->mode == 13)) { + if (OPP_sym == 17) { + OPS_Get(&OPP_sym); + y = (*x)->left; + if (y->class == 3) { + y = y->left; + } + if (y->obj != NIL) { + proc = OPT_topScope; + while ((proc->link != NIL && proc->link->mode != 13)) { + proc = proc->left; + } + if (proc->link == NIL || proc->link->link != y->obj) { + OPP_err(75); + } + typ = y->obj->typ; + if (typ->form == 13) { + typ = typ->BaseTyp; + } + OPT_FindField((*x)->obj->name, typ->BaseTyp, &proc); + if (proc != NIL) { + (*x)->subcl = 1; + } else { + OPP_err(74); + } + } else { + OPP_err(75); + } + } + if ((obj->typ != OPT_notyp && OPP_sym != 30)) { + OPP_err(30); + } + } + } else { + OPP_err(53); + } + } else { + OPP_err(52); + } + } else { + OPP_err(38); + } + } else if (OPP_sym == 17) { + OPS_Get(&OPP_sym); + OPB_DeRef(&*x); + } else if ((((((OPP_sym == 30 && (*x)->class < 7)) && (*x)->typ->form != 14)) && ((*x)->obj == NIL || (*x)->obj->mode != 13))) { + OPS_Get(&OPP_sym); + if (OPP_sym == 38) { + OPP_qualident(&obj); + if (obj->mode == 5) { + OPB_TypTest(&*x, obj, 1); + } else { + OPP_err(52); + } + } else { + OPP_err(38); + } + OPP_CheckSym(22); + } else { + break; + } + } +} + +static void OPP_ActualParameters (OPT_Node *aparlist, OPT_Object fpar) +{ + OPT_Node apar = NIL, last = NIL; + *aparlist = NIL; + last = NIL; + if (OPP_sym != 22) { + for (;;) { + OPP_Expression(&apar); + if (fpar != NIL) { + OPB_Param(apar, fpar); + OPB_Link(&*aparlist, &last, apar); + fpar = fpar->link; + } else { + OPP_err(64); + } + if (OPP_sym == 19) { + OPS_Get(&OPP_sym); + } else if ((30 <= OPP_sym && OPP_sym <= 38)) { + OPP_err(19); + } else { + break; + } + } + } + if (fpar != NIL) { + OPP_err(65); + } +} + +static void OPP_StandProcCall (OPT_Node *x) +{ + OPT_Node y = NIL; + SHORTINT m; + INTEGER n; + m = (int)(*x)->obj->adr; + n = 0; + if (OPP_sym == 30) { + OPS_Get(&OPP_sym); + if (OPP_sym != 22) { + for (;;) { + if (n == 0) { + OPP_Expression(&*x); + OPB_StPar0(&*x, m); + n = 1; + } else if (n == 1) { + OPP_Expression(&y); + OPB_StPar1(&*x, y, m); + n = 2; + } else { + OPP_Expression(&y); + OPB_StParN(&*x, y, m, n); + n += 1; + } + if (OPP_sym == 19) { + OPS_Get(&OPP_sym); + } else if ((30 <= OPP_sym && OPP_sym <= 38)) { + OPP_err(19); + } else { + break; + } + } + OPP_CheckSym(22); + } else { + OPS_Get(&OPP_sym); + } + OPB_StFct(&*x, m, n); + } else { + OPP_err(30); + } + if ((OPP_level > 0 && (m == 1 || m == 30))) { + OPT_topScope->link->leaf = 0; + } +} + +static void OPP_Element (OPT_Node *x) +{ + OPT_Node y = NIL; + OPP_Expression(&*x); + if (OPP_sym == 21) { + OPS_Get(&OPP_sym); + OPP_Expression(&y); + OPB_SetRange(&*x, y); + } else { + OPB_SetElem(&*x); + } +} + +static void OPP_Sets (OPT_Node *x) +{ + OPT_Node y = NIL; + if (OPP_sym != 24) { + OPP_Element(&*x); + for (;;) { + if (OPP_sym == 19) { + OPS_Get(&OPP_sym); + } else if ((30 <= OPP_sym && OPP_sym <= 38)) { + OPP_err(19); + } else { + break; + } + OPP_Element(&y); + OPB_Op(6, &*x, y); + } + } else { + *x = OPB_EmptySet(); + } + OPP_CheckSym(24); +} + +static void OPP_Factor (OPT_Node *x) +{ + OPT_Object fpar = NIL, id = NIL; + OPT_Node apar = NIL; + if (OPP_sym < 30) { + OPP_err(13); + do { + OPS_Get(&OPP_sym); + } while (!(OPP_sym >= 30)); + } + if (OPP_sym == 38) { + OPP_qualident(&id); + *x = OPB_NewLeaf(id); + OPP_selector(&*x); + if (((*x)->class == 9 && (*x)->obj->mode == 8)) { + OPP_StandProcCall(&*x); + } else if (OPP_sym == 30) { + OPS_Get(&OPP_sym); + OPB_PrepCall(&*x, &fpar); + OPP_ActualParameters(&apar, fpar); + OPB_Call(&*x, apar, fpar); + OPP_CheckSym(22); + if (OPP_level > 0) { + OPT_topScope->link->leaf = 0; + } + } + } else if (OPP_sym == 35) { + switch (OPS_numtyp) { + case 1: + *x = OPB_NewIntConst(OPS_intval); + (*x)->typ = OPT_chartyp; + break; + case 2: + *x = OPB_NewIntConst(OPS_intval); + break; + case 3: + *x = OPB_NewRealConst(OPS_realval, OPT_realtyp); + break; + case 4: + *x = OPB_NewRealConst(OPS_lrlval, OPT_lrltyp); + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPP.Factor, OPS.numtyp = ", (LONGINT)44); + OPM_LogWNum(OPS_numtyp, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + OPS_Get(&OPP_sym); + } else if (OPP_sym == 37) { + *x = OPB_NewString(OPS_str, OPS_intval); + OPS_Get(&OPP_sym); + } else if (OPP_sym == 36) { + *x = OPB_Nil(); + OPS_Get(&OPP_sym); + } else if (OPP_sym == 30) { + OPS_Get(&OPP_sym); + OPP_Expression(&*x); + OPP_CheckSym(22); + } else if (OPP_sym == 31) { + OPS_Get(&OPP_sym); + OPP_err(30); + OPP_Expression(&*x); + OPP_CheckSym(22); + } else if (OPP_sym == 32) { + OPS_Get(&OPP_sym); + OPP_Sets(&*x); + } else if (OPP_sym == 33) { + OPS_Get(&OPP_sym); + OPP_Factor(&*x); + OPB_MOp(33, &*x); + } else { + OPP_err(13); + OPS_Get(&OPP_sym); + *x = NIL; + } + if (*x == NIL) { + *x = OPB_NewIntConst(((LONGINT)(1))); + (*x)->typ = OPT_undftyp; + } +} + +static void OPP_Term (OPT_Node *x) +{ + OPT_Node y = NIL; + SHORTINT mulop; + OPP_Factor(&*x); + while ((1 <= OPP_sym && OPP_sym <= 5)) { + mulop = OPP_sym; + OPS_Get(&OPP_sym); + OPP_Factor(&y); + OPB_Op(mulop, &*x, y); + } +} + +static void OPP_SimpleExpression (OPT_Node *x) +{ + OPT_Node y = NIL; + SHORTINT addop; + if (OPP_sym == 7) { + OPS_Get(&OPP_sym); + OPP_Term(&*x); + OPB_MOp(7, &*x); + } else if (OPP_sym == 6) { + OPS_Get(&OPP_sym); + OPP_Term(&*x); + OPB_MOp(6, &*x); + } else { + OPP_Term(&*x); + } + while ((6 <= OPP_sym && OPP_sym <= 8)) { + addop = OPP_sym; + OPS_Get(&OPP_sym); + OPP_Term(&y); + OPB_Op(addop, &*x, y); + } +} + +static void OPP_Expression (OPT_Node *x) +{ + OPT_Node y = NIL; + OPT_Object obj = NIL; + SHORTINT relation; + OPP_SimpleExpression(&*x); + if ((9 <= OPP_sym && OPP_sym <= 14)) { + relation = OPP_sym; + OPS_Get(&OPP_sym); + OPP_SimpleExpression(&y); + OPB_Op(relation, &*x, y); + } else if (OPP_sym == 15) { + OPS_Get(&OPP_sym); + OPP_SimpleExpression(&y); + OPB_In(&*x, y); + } else if (OPP_sym == 16) { + OPS_Get(&OPP_sym); + if (OPP_sym == 38) { + OPP_qualident(&obj); + if (obj->mode == 5) { + OPB_TypTest(&*x, obj, 0); + } else { + OPP_err(52); + } + } else { + OPP_err(38); + } + } +} + +static void OPP_Receiver (SHORTINT *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec) +{ + OPT_Object obj = NIL; + *typ = OPT_undftyp; + *rec = NIL; + if (OPP_sym == 60) { + OPS_Get(&OPP_sym); + *mode = 2; + } else { + *mode = 1; + } + __COPY(OPS_name, name, ((LONGINT)(256))); + OPP_CheckSym(38); + OPP_CheckSym(20); + if (OPP_sym == 38) { + OPT_Find(&obj); + OPS_Get(&OPP_sym); + if (obj == NIL) { + OPP_err(0); + } else if (obj->mode != 5) { + OPP_err(72); + } else { + *typ = obj->typ; + *rec = *typ; + if ((*rec)->form == 13) { + *rec = (*rec)->BaseTyp; + } + if (!((((*mode == 1 && (*typ)->form == 13)) && (*rec)->comp == 4) || (*mode == 2 && (*typ)->comp == 4))) { + OPP_err(70); + *rec = NIL; + } + if ((*rec != NIL && (*rec)->mno != OPP_level)) { + OPP_err(72); + *rec = NIL; + } + } + } else { + OPP_err(38); + } + OPP_CheckSym(22); + if (*rec == NIL) { + *rec = OPT_NewStr(15, 4); + (*rec)->BaseTyp = NIL; + } +} + +static BOOLEAN OPP_Extends (OPT_Struct x, OPT_Struct b) +{ + BOOLEAN _o_result; + if ((b->form == 13 && x->form == 13)) { + b = b->BaseTyp; + x = x->BaseTyp; + } + if ((b->comp == 4 && x->comp == 4)) { + do { + x = x->BaseTyp; + } while (!(x == NIL || x == b)); + } + _o_result = x == b; + return _o_result; +} + +static struct ProcedureDeclaration__16 { + OPT_Node *x; + OPT_Object *proc, *fwd; + OPS_Name *name; + SHORTINT *mode, *vis; + BOOLEAN *forward; + struct ProcedureDeclaration__16 *lnk; +} *ProcedureDeclaration__16_s; + +static void Body__17 (void); +static void GetCode__19 (void); +static void GetParams__21 (void); +static void TProcDecl__23 (void); + +static void GetCode__19 (void) +{ + OPT_ConstExt ext = NIL; + INTEGER n; + LONGINT c; + ext = OPT_NewExt(); + (*ProcedureDeclaration__16_s->proc)->conval->ext = ext; + n = 0; + if (OPP_sym == 37) { + while (OPS_str[__X(n, ((LONGINT)(256)))] != 0x00) { + (*ext)[__X(n + 1, ((LONGINT)(256)))] = OPS_str[__X(n, ((LONGINT)(256)))]; + n += 1; + } + (*ext)[0] = (CHAR)n; + OPS_Get(&OPP_sym); + } else { + for (;;) { + if (OPP_sym == 35) { + c = OPS_intval; + n += 1; + if ((c < 0 || c > 255) || n == 256) { + OPP_err(64); + c = 1; + n = 1; + } + OPS_Get(&OPP_sym); + (*ext)[__X(n, ((LONGINT)(256)))] = (CHAR)c; + } + if (OPP_sym == 19) { + OPS_Get(&OPP_sym); + } else if (OPP_sym == 35) { + OPP_err(19); + } else { + (*ext)[0] = (CHAR)n; + break; + } + } + } + (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1); +} + +static void GetParams__21 (void) +{ + (*ProcedureDeclaration__16_s->proc)->vis = *ProcedureDeclaration__16_s->vis; + (*ProcedureDeclaration__16_s->proc)->mode = *ProcedureDeclaration__16_s->mode; + (*ProcedureDeclaration__16_s->proc)->typ = OPT_notyp; + (*ProcedureDeclaration__16_s->proc)->conval = OPT_NewConst(); + (*ProcedureDeclaration__16_s->proc)->conval->setval = 0x0; + if (OPP_sym == 30) { + OPS_Get(&OPP_sym); + OPP_FormalParameters(&(*ProcedureDeclaration__16_s->proc)->link, &(*ProcedureDeclaration__16_s->proc)->typ); + } + if (*ProcedureDeclaration__16_s->fwd != NIL) { + OPB_CheckParameters((*ProcedureDeclaration__16_s->proc)->link, (*ProcedureDeclaration__16_s->fwd)->link, 1); + if ((*ProcedureDeclaration__16_s->proc)->typ != (*ProcedureDeclaration__16_s->fwd)->typ) { + OPP_err(117); + } + *ProcedureDeclaration__16_s->proc = *ProcedureDeclaration__16_s->fwd; + OPT_topScope = (*ProcedureDeclaration__16_s->proc)->scope; + if (*ProcedureDeclaration__16_s->mode == 10) { + (*ProcedureDeclaration__16_s->proc)->mode = 10; + } + } +} + +static void Body__17 (void) +{ + OPT_Node procdec = NIL, statseq = NIL; + LONGINT c; + c = OPM_errpos; + (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1); + OPP_CheckSym(39); + OPP_Block(&procdec, &statseq); + OPB_Enter(&procdec, statseq, *ProcedureDeclaration__16_s->proc); + *ProcedureDeclaration__16_s->x = procdec; + (*ProcedureDeclaration__16_s->x)->conval = OPT_NewConst(); + (*ProcedureDeclaration__16_s->x)->conval->intval = c; + if (OPP_sym == 38) { + if (__STRCMP(OPS_name, (*ProcedureDeclaration__16_s->proc)->name) != 0) { + OPP_err(4); + } + OPS_Get(&OPP_sym); + } else { + OPP_err(38); + } +} + +static void TProcDecl__23 (void) +{ + OPT_Object baseProc = NIL; + OPT_Struct objTyp = NIL, recTyp = NIL; + SHORTINT objMode; + OPS_Name objName; + OPS_Get(&OPP_sym); + *ProcedureDeclaration__16_s->mode = 13; + if (OPP_level > 0) { + OPP_err(73); + } + OPP_Receiver(&objMode, objName, &objTyp, &recTyp); + if (OPP_sym == 38) { + __COPY(OPS_name, *ProcedureDeclaration__16_s->name, ((LONGINT)(256))); + OPP_CheckMark(&*ProcedureDeclaration__16_s->vis); + OPT_FindField(*ProcedureDeclaration__16_s->name, recTyp, &*ProcedureDeclaration__16_s->fwd); + OPT_FindField(*ProcedureDeclaration__16_s->name, recTyp->BaseTyp, &baseProc); + if ((baseProc != NIL && baseProc->mode != 13)) { + baseProc = NIL; + } + if (*ProcedureDeclaration__16_s->fwd == baseProc) { + *ProcedureDeclaration__16_s->fwd = NIL; + } + if ((*ProcedureDeclaration__16_s->fwd != NIL && (*ProcedureDeclaration__16_s->fwd)->mnolev != OPP_level)) { + *ProcedureDeclaration__16_s->fwd = NIL; + } + if ((((*ProcedureDeclaration__16_s->fwd != NIL && (*ProcedureDeclaration__16_s->fwd)->mode == 13)) && !__IN(1, (*ProcedureDeclaration__16_s->fwd)->conval->setval))) { + *ProcedureDeclaration__16_s->proc = OPT_NewObj(); + (*ProcedureDeclaration__16_s->proc)->leaf = 1; + if ((*ProcedureDeclaration__16_s->fwd)->vis != *ProcedureDeclaration__16_s->vis) { + OPP_err(118); + } + } else { + if (*ProcedureDeclaration__16_s->fwd != NIL) { + OPP_err(1); + *ProcedureDeclaration__16_s->fwd = NIL; + } + OPT_OpenScope(0, NIL); + OPT_topScope->right = recTyp->link; + OPT_Insert(*ProcedureDeclaration__16_s->name, &*ProcedureDeclaration__16_s->proc); + recTyp->link = OPT_topScope->right; + OPT_CloseScope(); + } + OPP_level += 1; + OPT_OpenScope(OPP_level, *ProcedureDeclaration__16_s->proc); + OPT_Insert(objName, &(*ProcedureDeclaration__16_s->proc)->link); + (*ProcedureDeclaration__16_s->proc)->link->mode = objMode; + (*ProcedureDeclaration__16_s->proc)->link->typ = objTyp; + GetParams__21(); + if (baseProc != NIL) { + if (objMode != baseProc->link->mode || !OPP_Extends(objTyp, baseProc->link->typ)) { + OPP_err(115); + } + OPB_CheckParameters((*ProcedureDeclaration__16_s->proc)->link->link, baseProc->link->link, 0); + if ((*ProcedureDeclaration__16_s->proc)->typ != baseProc->typ) { + OPP_err(117); + } + if ((((((baseProc->vis == 1 && (*ProcedureDeclaration__16_s->proc)->vis == 0)) && recTyp->strobj != NIL)) && recTyp->strobj->vis == 1)) { + OPP_err(109); + } + (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(2); + } + if (!*ProcedureDeclaration__16_s->forward) { + Body__17(); + } + OPP_level -= 1; + OPT_CloseScope(); + } else { + OPP_err(38); + } +} + +static void OPP_ProcedureDeclaration (OPT_Node *x) +{ + OPT_Object proc = NIL, fwd = NIL; + OPS_Name name; + SHORTINT mode, vis; + BOOLEAN forward; + struct ProcedureDeclaration__16 _s; + _s.x = x; + _s.proc = &proc; + _s.fwd = &fwd; + _s.name = (void*)name; + _s.mode = &mode; + _s.vis = &vis; + _s.forward = &forward; + _s.lnk = ProcedureDeclaration__16_s; + ProcedureDeclaration__16_s = &_s; + proc = NIL; + forward = 0; + *x = NIL; + mode = 6; + if ((OPP_sym != 38 && OPP_sym != 30)) { + if (OPP_sym == 1) { + } else if (OPP_sym == 17) { + forward = 1; + } else if (OPP_sym == 6) { + mode = 10; + } else if (OPP_sym == 7) { + mode = 9; + } else { + OPP_err(38); + } + if ((__IN(mode, 0x0600) && !OPT_SYSimported)) { + OPP_err(135); + } + OPS_Get(&OPP_sym); + } + if (OPP_sym == 30) { + TProcDecl__23(); + } else if (OPP_sym == 38) { + OPT_Find(&fwd); + __COPY(OPS_name, name, ((LONGINT)(256))); + OPP_CheckMark(&vis); + if ((vis != 0 && mode == 6)) { + mode = 7; + } + if ((fwd != NIL && (fwd->mnolev != OPP_level || fwd->mode == 8))) { + fwd = NIL; + } + if ((((fwd != NIL && __IN(fwd->mode, 0xc0))) && !__IN(1, fwd->conval->setval))) { + proc = OPT_NewObj(); + proc->leaf = 1; + if (fwd->vis != vis) { + OPP_err(118); + } + } else { + if (fwd != NIL) { + OPP_err(1); + fwd = NIL; + } + OPT_Insert(name, &proc); + } + if ((mode != 6 && OPP_level > 0)) { + OPP_err(73); + } + OPP_level += 1; + OPT_OpenScope(OPP_level, proc); + proc->link = NIL; + GetParams__21(); + if (mode == 9) { + GetCode__19(); + } else if (!forward) { + Body__17(); + } + OPP_level -= 1; + OPT_CloseScope(); + } else { + OPP_err(38); + } + ProcedureDeclaration__16_s = _s.lnk; +} + +static void OPP_CaseLabelList (OPT_Node *lab, INTEGER LabelForm, INTEGER *n, OPP_CaseTable tab) +{ + OPT_Node x = NIL, y = NIL, lastlab = NIL; + INTEGER i, f; + LONGINT xval, yval; + *lab = NIL; + lastlab = NIL; + for (;;) { + OPP_ConstExpression(&x); + f = x->typ->form; + if (__IN(f, 0x78)) { + xval = x->conval->intval; + } else { + OPP_err(61); + xval = 1; + } + if (__IN(f, 0x70)) { + if (LabelForm < f) { + OPP_err(60); + } + } else if (LabelForm != f) { + OPP_err(60); + } + if (OPP_sym == 21) { + OPS_Get(&OPP_sym); + OPP_ConstExpression(&y); + yval = y->conval->intval; + if (((int)y->typ->form != f && !((__IN(f, 0x70) && __IN(y->typ->form, 0x70))))) { + OPP_err(60); + } + if (yval < xval) { + OPP_err(63); + yval = xval; + } + } else { + yval = xval; + } + x->conval->intval2 = yval; + i = *n; + if (i < 128) { + for (;;) { + if (i == 0) { + break; + } + if (tab[__X(i - 1, ((LONGINT)(128)))].low <= yval) { + if (tab[__X(i - 1, ((LONGINT)(128)))].high >= xval) { + OPP_err(62); + } + break; + } + tab[__X(i, ((LONGINT)(128)))] = tab[__X(i - 1, ((LONGINT)(128)))]; + i -= 1; + } + tab[__X(i, ((LONGINT)(128)))].low = xval; + tab[__X(i, ((LONGINT)(128)))].high = yval; + *n += 1; + } else { + OPP_err(213); + } + OPB_Link(&*lab, &lastlab, x); + if (OPP_sym == 19) { + OPS_Get(&OPP_sym); + } else if (OPP_sym == 35 || OPP_sym == 38) { + OPP_err(19); + } else { + break; + } + } +} + +static struct StatSeq__30 { + LONGINT *pos; + struct StatSeq__30 *lnk; +} *StatSeq__30_s; + +static void CasePart__31 (OPT_Node *x); +static void CheckBool__33 (OPT_Node *x); +static void SetPos__35 (OPT_Node x); + +static void CasePart__31 (OPT_Node *x) +{ + INTEGER n; + LONGINT low, high; + BOOLEAN e; + OPP_CaseTable tab; + OPT_Node cases = NIL, lab = NIL, y = NIL, lastcase = NIL; + OPP_Expression(&*x); + *StatSeq__30_s->pos = OPM_errpos; + if ((*x)->class == 8 || (*x)->class == 9) { + OPP_err(126); + } else if (!__IN((*x)->typ->form, 0x78)) { + OPP_err(125); + } + OPP_CheckSym(25); + cases = NIL; + lastcase = NIL; + n = 0; + for (;;) { + if (OPP_sym < 40) { + OPP_CaseLabelList(&lab, (*x)->typ->form, &n, tab); + OPP_CheckSym(20); + OPP_StatSeq(&y); + OPB_Construct(17, &lab, y); + OPB_Link(&cases, &lastcase, lab); + } + if (OPP_sym == 40) { + OPS_Get(&OPP_sym); + } else { + break; + } + } + if (n > 0) { + low = tab[0].low; + high = tab[__X(n - 1, ((LONGINT)(128)))].high; + if (high - low > 512) { + OPP_err(209); + } + } else { + low = 1; + high = 0; + } + e = OPP_sym == 42; + if (e) { + OPS_Get(&OPP_sym); + OPP_StatSeq(&y); + } else { + y = NIL; + OPM_Mark(-307, OPM_curpos); + } + OPB_Construct(16, &cases, y); + OPB_Construct(21, &*x, cases); + cases->conval = OPT_NewConst(); + cases->conval->intval = low; + cases->conval->intval2 = high; + if (e) { + cases->conval->setval = 0x02; + } else { + cases->conval->setval = 0x0; + } +} + +static void SetPos__35 (OPT_Node x) +{ + x->conval = OPT_NewConst(); + x->conval->intval = *StatSeq__30_s->pos; +} + +static void CheckBool__33 (OPT_Node *x) +{ + if ((*x)->class == 8 || (*x)->class == 9) { + OPP_err(126); + *x = OPB_NewBoolConst(0); + } else if ((*x)->typ->form != 2) { + OPP_err(120); + *x = OPB_NewBoolConst(0); + } + *StatSeq__30_s->pos = OPM_errpos; +} + +static void OPP_StatSeq (OPT_Node *stat) +{ + OPT_Object fpar = NIL, id = NIL, t = NIL, obj = NIL; + OPT_Struct idtyp = NIL; + BOOLEAN e; + OPT_Node s = NIL, x = NIL, y = NIL, z = NIL, apar = NIL, last = NIL, lastif = NIL; + LONGINT pos; + OPS_Name name; + struct StatSeq__30 _s; + _s.pos = &pos; + _s.lnk = StatSeq__30_s; + StatSeq__30_s = &_s; + *stat = NIL; + last = NIL; + for (;;) { + x = NIL; + if (OPP_sym < 38) { + OPP_err(14); + do { + OPS_Get(&OPP_sym); + } while (!(OPP_sym >= 38)); + } + if (OPP_sym == 38) { + OPP_qualident(&id); + x = OPB_NewLeaf(id); + OPP_selector(&x); + if (OPP_sym == 34) { + OPS_Get(&OPP_sym); + OPP_Expression(&y); + OPB_Assign(&x, y); + } else if (OPP_sym == 9) { + OPP_err(34); + OPS_Get(&OPP_sym); + OPP_Expression(&y); + OPB_Assign(&x, y); + } else if ((x->class == 9 && x->obj->mode == 8)) { + OPP_StandProcCall(&x); + if ((x != NIL && x->typ != OPT_notyp)) { + OPP_err(55); + } + } else { + OPB_PrepCall(&x, &fpar); + if (OPP_sym == 30) { + OPS_Get(&OPP_sym); + OPP_ActualParameters(&apar, fpar); + OPP_CheckSym(22); + } else { + apar = NIL; + if (fpar != NIL) { + OPP_err(65); + } + } + OPB_Call(&x, apar, fpar); + if (x->typ != OPT_notyp) { + OPP_err(55); + } + if (OPP_level > 0) { + OPT_topScope->link->leaf = 0; + } + } + pos = OPM_errpos; + } else if (OPP_sym == 45) { + OPS_Get(&OPP_sym); + OPP_Expression(&x); + CheckBool__33(&x); + OPP_CheckSym(26); + OPP_StatSeq(&y); + OPB_Construct(15, &x, y); + SetPos__35(x); + lastif = x; + while (OPP_sym == 43) { + OPS_Get(&OPP_sym); + OPP_Expression(&y); + CheckBool__33(&y); + OPP_CheckSym(26); + OPP_StatSeq(&z); + OPB_Construct(15, &y, z); + SetPos__35(y); + OPB_Link(&x, &lastif, y); + } + if (OPP_sym == 42) { + OPS_Get(&OPP_sym); + OPP_StatSeq(&y); + } else { + y = NIL; + } + OPB_Construct(20, &x, y); + OPP_CheckSym(41); + OPB_OptIf(&x); + pos = OPM_errpos; + } else if (OPP_sym == 46) { + OPS_Get(&OPP_sym); + CasePart__31(&x); + OPP_CheckSym(41); + } else if (OPP_sym == 47) { + OPS_Get(&OPP_sym); + OPP_Expression(&x); + CheckBool__33(&x); + OPP_CheckSym(27); + OPP_StatSeq(&y); + OPB_Construct(22, &x, y); + OPP_CheckSym(41); + } else if (OPP_sym == 48) { + OPS_Get(&OPP_sym); + OPP_StatSeq(&x); + if (OPP_sym == 44) { + OPS_Get(&OPP_sym); + OPP_Expression(&y); + CheckBool__33(&y); + } else { + OPP_err(44); + } + OPB_Construct(23, &x, y); + } else if (OPP_sym == 49) { + OPS_Get(&OPP_sym); + if (OPP_sym == 38) { + OPP_qualident(&id); + if (!__IN(id->typ->form, 0x70)) { + OPP_err(68); + } + OPP_CheckSym(34); + OPP_Expression(&y); + pos = OPM_errpos; + x = OPB_NewLeaf(id); + OPB_Assign(&x, y); + SetPos__35(x); + OPP_CheckSym(28); + OPP_Expression(&y); + pos = OPM_errpos; + if (y->class != 7) { + __MOVE("@@", name, 3); + OPT_Insert(name, &t); + __MOVE("@for", t->name, 5); + t->mode = 1; + t->typ = x->left->typ; + obj = OPT_topScope->scope; + if (obj == NIL) { + OPT_topScope->scope = t; + } else { + while (obj->link != NIL) { + obj = obj->link; + } + obj->link = t; + } + z = OPB_NewLeaf(t); + OPB_Assign(&z, y); + SetPos__35(z); + OPB_Link(&*stat, &last, z); + y = OPB_NewLeaf(t); + } else if (y->typ->form < 4 || y->typ->form > x->left->typ->form) { + OPP_err(113); + } + OPB_Link(&*stat, &last, x); + if (OPP_sym == 29) { + OPS_Get(&OPP_sym); + OPP_ConstExpression(&z); + } else { + z = OPB_NewIntConst(((LONGINT)(1))); + } + pos = OPM_errpos; + x = OPB_NewLeaf(id); + if (z->conval->intval > 0) { + OPB_Op(12, &x, y); + } else if (z->conval->intval < 0) { + OPB_Op(14, &x, y); + } else { + OPP_err(63); + OPB_Op(14, &x, y); + } + OPP_CheckSym(27); + OPP_StatSeq(&s); + y = OPB_NewLeaf(id); + OPB_StPar1(&y, z, 13); + SetPos__35(y); + if (s == NIL) { + s = y; + } else { + z = s; + while (z->link != NIL) { + z = z->link; + } + z->link = y; + } + OPP_CheckSym(41); + OPB_Construct(22, &x, s); + } else { + OPP_err(38); + } + } else if (OPP_sym == 50) { + OPS_Get(&OPP_sym); + OPP_LoopLevel += 1; + OPP_StatSeq(&x); + OPP_LoopLevel -= 1; + OPB_Construct(24, &x, NIL); + OPP_CheckSym(41); + pos = OPM_errpos; + } else if (OPP_sym == 51) { + OPS_Get(&OPP_sym); + idtyp = NIL; + x = NIL; + for (;;) { + if (OPP_sym == 38) { + OPP_qualident(&id); + y = OPB_NewLeaf(id); + if ((((id != NIL && id->typ->form == 13)) && (id->mode == 2 || !id->leaf))) { + OPP_err(245); + } + OPP_CheckSym(20); + if (OPP_sym == 38) { + OPP_qualident(&t); + if (t->mode == 5) { + if (id != NIL) { + idtyp = id->typ; + OPB_TypTest(&y, t, 0); + id->typ = t->typ; + } else { + OPP_err(130); + } + } else { + OPP_err(52); + } + } else { + OPP_err(38); + } + } else { + OPP_err(38); + } + pos = OPM_errpos; + OPP_CheckSym(27); + OPP_StatSeq(&s); + OPB_Construct(15, &y, s); + SetPos__35(y); + if (idtyp != NIL) { + id->typ = idtyp; + idtyp = NIL; + } + if (x == NIL) { + x = y; + lastif = x; + } else { + OPB_Link(&x, &lastif, y); + } + if (OPP_sym == 40) { + OPS_Get(&OPP_sym); + } else { + break; + } + } + e = OPP_sym == 42; + if (e) { + OPS_Get(&OPP_sym); + OPP_StatSeq(&s); + } else { + s = NIL; + } + OPB_Construct(27, &x, s); + OPP_CheckSym(41); + if (e) { + x->subcl = 1; + } + } else if (OPP_sym == 52) { + OPS_Get(&OPP_sym); + if (OPP_LoopLevel == 0) { + OPP_err(46); + } + OPB_Construct(25, &x, NIL); + pos = OPM_errpos; + } else if (OPP_sym == 53) { + OPS_Get(&OPP_sym); + if (OPP_sym < 39) { + OPP_Expression(&x); + } + if (OPP_level > 0) { + OPB_Return(&x, OPT_topScope->link); + } else { + OPB_Return(&x, NIL); + } + pos = OPM_errpos; + } + if (x != NIL) { + SetPos__35(x); + OPB_Link(&*stat, &last, x); + } + if (OPP_sym == 39) { + OPS_Get(&OPP_sym); + } else if (OPP_sym <= 38 || (45 <= OPP_sym && OPP_sym <= 53)) { + OPP_err(39); + } else { + break; + } + } + StatSeq__30_s = _s.lnk; +} + +static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) +{ + OPT_Struct typ = NIL; + OPT_Object obj = NIL, first = NIL, last = NIL; + OPT_Node x = NIL, lastdec = NIL; + INTEGER i; + first = NIL; + last = NIL; + OPP_nofFwdPtr = 0; + for (;;) { + if (OPP_sym == 58) { + OPS_Get(&OPP_sym); + while (OPP_sym == 38) { + OPT_Insert(OPS_name, &obj); + OPP_CheckMark(&obj->vis); + obj->typ = OPT_sinttyp; + obj->mode = 1; + if (OPP_sym == 9) { + OPS_Get(&OPP_sym); + OPP_ConstExpression(&x); + } else if (OPP_sym == 34) { + OPP_err(9); + OPS_Get(&OPP_sym); + OPP_ConstExpression(&x); + } else { + OPP_err(9); + x = OPB_NewIntConst(((LONGINT)(1))); + } + obj->mode = 3; + obj->typ = x->typ; + obj->conval = x->conval; + OPP_CheckSym(39); + } + } + if (OPP_sym == 59) { + OPS_Get(&OPP_sym); + while (OPP_sym == 38) { + OPT_Insert(OPS_name, &obj); + obj->mode = 5; + obj->typ = OPT_undftyp; + OPP_CheckMark(&obj->vis); + if (OPP_sym == 9) { + OPS_Get(&OPP_sym); + OPP_TypeDecl(&obj->typ, &obj->typ); + } else if (OPP_sym == 34 || OPP_sym == 20) { + OPP_err(9); + OPS_Get(&OPP_sym); + OPP_TypeDecl(&obj->typ, &obj->typ); + } else { + OPP_err(9); + } + if (obj->typ->strobj == NIL) { + obj->typ->strobj = obj; + } + if (__IN(obj->typ->comp, 0x1c)) { + i = 0; + while (i < OPP_nofFwdPtr) { + typ = OPP_FwdPtr[__X(i, ((LONGINT)(64)))]; + i += 1; + if (__STRCMP(typ->link->name, obj->name) == 0) { + typ->BaseTyp = obj->typ; + typ->link->name[0] = 0x00; + } + } + } + OPP_CheckSym(39); + } + } + if (OPP_sym == 60) { + OPS_Get(&OPP_sym); + while (OPP_sym == 38) { + for (;;) { + if (OPP_sym == 38) { + OPT_Insert(OPS_name, &obj); + OPP_CheckMark(&obj->vis); + obj->mode = 1; + obj->link = NIL; + obj->leaf = obj->vis == 0; + obj->typ = OPT_undftyp; + if (first == NIL) { + first = obj; + } + if (last == NIL) { + OPT_topScope->scope = obj; + } else { + last->link = obj; + } + last = obj; + } else { + OPP_err(38); + } + if (OPP_sym == 19) { + OPS_Get(&OPP_sym); + } else if (OPP_sym == 38) { + OPP_err(19); + } else { + break; + } + } + OPP_CheckSym(20); + OPP_Type(&typ, &OPT_notyp); + typ->pvused = 1; + if (typ->comp == 3) { + typ = OPT_undftyp; + OPP_err(88); + } + while (first != NIL) { + first->typ = typ; + first = first->link; + } + OPP_CheckSym(39); + } + } + if (OPP_sym < 58 || OPP_sym > 60) { + break; + } + } + i = 0; + while (i < OPP_nofFwdPtr) { + if (OPP_FwdPtr[__X(i, ((LONGINT)(64)))]->link->name[0] != 0x00) { + OPP_err(128); + } + OPP_FwdPtr[__X(i, ((LONGINT)(64)))] = NIL; + i += 1; + } + OPT_topScope->adr = OPM_errpos; + *procdec = NIL; + lastdec = NIL; + while (OPP_sym == 61) { + OPS_Get(&OPP_sym); + OPP_ProcedureDeclaration(&x); + if (x != NIL) { + if (lastdec == NIL) { + *procdec = x; + } else { + lastdec->link = x; + } + lastdec = x; + } + OPP_CheckSym(39); + } + if (OPP_sym == 57) { + OPS_Get(&OPP_sym); + OPP_StatSeq(&*statseq); + } else { + *statseq = NIL; + } + if ((OPP_level == 0 && OPP_TDinit != NIL)) { + OPP_lastTDinit->link = *statseq; + *statseq = OPP_TDinit; + } + OPP_CheckSym(41); +} + +void OPP_Module (OPT_Node *prog, SET opt) +{ + OPS_Name impName, aliasName; + OPT_Node procdec = NIL, statseq = NIL; + LONGINT c; + BOOLEAN done; + OPS_Init(); + OPP_LoopLevel = 0; + OPP_level = 0; + OPS_Get(&OPP_sym); + if (OPP_sym == 63) { + OPS_Get(&OPP_sym); + } else { + OPP_err(16); + } + if (OPP_sym == 38) { + OPM_LogWStr((CHAR*)"compiling ", (LONGINT)11); + OPM_LogWStr(OPS_name, ((LONGINT)(256))); + OPM_LogW('.'); + OPT_Init(OPS_name, opt); + OPS_Get(&OPP_sym); + OPP_CheckSym(39); + if (OPP_sym == 62) { + OPS_Get(&OPP_sym); + for (;;) { + if (OPP_sym == 38) { + __COPY(OPS_name, aliasName, ((LONGINT)(256))); + __COPY(aliasName, impName, ((LONGINT)(256))); + OPS_Get(&OPP_sym); + if (OPP_sym == 34) { + OPS_Get(&OPP_sym); + if (OPP_sym == 38) { + __COPY(OPS_name, impName, ((LONGINT)(256))); + OPS_Get(&OPP_sym); + } else { + OPP_err(38); + } + } + OPT_Import(aliasName, impName, &done); + } else { + OPP_err(38); + } + if (OPP_sym == 19) { + OPS_Get(&OPP_sym); + } else if (OPP_sym == 38) { + OPP_err(19); + } else { + break; + } + } + OPP_CheckSym(39); + } + if (OPM_noerr) { + OPP_TDinit = NIL; + OPP_lastTDinit = NIL; + c = OPM_errpos; + OPP_Block(&procdec, &statseq); + OPB_Enter(&procdec, statseq, NIL); + *prog = procdec; + (*prog)->conval = OPT_NewConst(); + (*prog)->conval->intval = c; + if (OPP_sym == 38) { + if (__STRCMP(OPS_name, OPT_SelfName) != 0) { + OPP_err(4); + } + OPS_Get(&OPP_sym); + } else { + OPP_err(38); + } + if (OPP_sym != 18) { + OPP_err(18); + } + } + } else { + OPP_err(38); + } + OPP_TDinit = NIL; + OPP_lastTDinit = NIL; +} + +static void EnumPtrs(void (*P)(void*)) +{ + P(OPP_TDinit); + P(OPP_lastTDinit); + __ENUMP(OPP_FwdPtr, 64, P); +} + +__TDESC(OPP__1, 1, 0) = {__TDFLDS("", 8), {-4}}; + +export void *OPP__init(void) +{ + __DEFMOD; + __MODULE_IMPORT(OPB); + __MODULE_IMPORT(OPM); + __MODULE_IMPORT(OPS); + __MODULE_IMPORT(OPT); + __REGMOD("OPP", EnumPtrs); + __INITYP(OPP__1, OPP__1, 0); +/* BEGIN */ + __ENDMOD; +} diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h new file mode 100644 index 00000000..1e0a1809 --- /dev/null +++ b/bootstrap/windows-48/OPP.h @@ -0,0 +1,16 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ + +#ifndef OPP__h +#define OPP__h + +#include "SYSTEM.h" +#include "OPT.h" + + + + +import void OPP_Module (OPT_Node *prog, SET opt); +import void *OPP__init(void); + + +#endif diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c new file mode 100644 index 00000000..88944148 --- /dev/null +++ b/bootstrap/windows-48/OPS.c @@ -0,0 +1,623 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin tspkaSfF */ +#include "SYSTEM.h" +#include "OPM.h" + +typedef + CHAR OPS_Name[256]; + +typedef + CHAR OPS_String[256]; + + +export OPS_Name OPS_name; +export OPS_String OPS_str; +export INTEGER OPS_numtyp; +export LONGINT OPS_intval; +export REAL OPS_realval; +export LONGREAL OPS_lrlval; +static CHAR OPS_ch; + + +export void OPS_Get (SHORTINT *sym); +static void OPS_Identifier (SHORTINT *sym); +export void OPS_Init (void); +static void OPS_Number (void); +static void OPS_Str (SHORTINT *sym); +static void OPS_err (INTEGER n); + + +static void OPS_err (INTEGER n) +{ + OPM_err(n); +} + +static void OPS_Str (SHORTINT *sym) +{ + INTEGER i; + CHAR och; + i = 0; + och = OPS_ch; + for (;;) { + OPM_Get(&OPS_ch); + if (OPS_ch == och) { + break; + } + if (OPS_ch < ' ') { + OPS_err(3); + break; + } + if (i == 255) { + OPS_err(241); + break; + } + OPS_str[i] = OPS_ch; + i += 1; + } + OPM_Get(&OPS_ch); + OPS_str[i] = 0x00; + OPS_intval = i + 1; + if (OPS_intval == 2) { + *sym = 35; + OPS_numtyp = 1; + OPS_intval = (int)OPS_str[0]; + } else { + *sym = 37; + } +} + +static void OPS_Identifier (SHORTINT *sym) +{ + INTEGER i; + i = 0; + do { + OPS_name[i] = OPS_ch; + i += 1; + OPM_Get(&OPS_ch); + } while (!(((OPS_ch < '0' || ('9' < OPS_ch && __CAP(OPS_ch) < 'A')) || 'Z' < __CAP(OPS_ch)) || i == 256)); + if (i == 256) { + OPS_err(240); + i -= 1; + } + OPS_name[i] = 0x00; + *sym = 38; +} + +static struct Number__6 { + struct Number__6 *lnk; +} *Number__6_s; + +static INTEGER Ord__7 (CHAR ch, BOOLEAN hex); +static LONGREAL Ten__9 (INTEGER e); + +static LONGREAL Ten__9 (INTEGER e) +{ + LONGREAL _o_result; + LONGREAL x, p; + x = (LONGREAL)1; + p = (LONGREAL)10; + while (e > 0) { + if (__ODD(e)) { + x = x * p; + } + e = __ASHR(e, 1); + if (e > 0) { + p = p * p; + } + } + _o_result = x; + return _o_result; +} + +static INTEGER Ord__7 (CHAR ch, BOOLEAN hex) +{ + INTEGER _o_result; + if (ch <= '9') { + _o_result = (int)ch - 48; + return _o_result; + } else if (hex) { + _o_result = ((int)ch - 65) + 10; + return _o_result; + } else { + OPS_err(2); + _o_result = 0; + return _o_result; + } + __RETCHK; +} + +static void OPS_Number (void) +{ + INTEGER i, m, n, d, e; + CHAR dig[24]; + LONGREAL f; + CHAR expCh; + BOOLEAN neg; + struct Number__6 _s; + _s.lnk = Number__6_s; + Number__6_s = &_s; + i = 0; + m = 0; + n = 0; + d = 0; + for (;;) { + if (('0' <= OPS_ch && OPS_ch <= '9') || (((d == 0 && 'A' <= OPS_ch)) && OPS_ch <= 'F')) { + if (m > 0 || OPS_ch != '0') { + if (n < 24) { + dig[n] = OPS_ch; + n += 1; + } + m += 1; + } + OPM_Get(&OPS_ch); + i += 1; + } else if (OPS_ch == '.') { + OPM_Get(&OPS_ch); + if (OPS_ch == '.') { + OPS_ch = 0x7f; + break; + } else if (d == 0) { + d = i; + } else { + OPS_err(2); + } + } else { + break; + } + } + if (d == 0) { + if (n == m) { + OPS_intval = 0; + i = 0; + if (OPS_ch == 'X') { + OPM_Get(&OPS_ch); + OPS_numtyp = 1; + if (n <= 2) { + while (i < n) { + OPS_intval = __ASHL(OPS_intval, 4) + (LONGINT)Ord__7(dig[i], 1); + i += 1; + } + } else { + OPS_err(203); + } + } else if (OPS_ch == 'H') { + OPM_Get(&OPS_ch); + OPS_numtyp = 2; + if (n <= 8) { + if ((n == 8 && dig[0] > '7')) { + OPS_intval = -1; + } + while (i < n) { + OPS_intval = __ASHL(OPS_intval, 4) + (LONGINT)Ord__7(dig[i], 1); + i += 1; + } + } else { + OPS_err(203); + } + } else { + OPS_numtyp = 2; + while (i < n) { + d = Ord__7(dig[i], 0); + i += 1; + if (OPS_intval <= __DIV(2147483647 - (LONGINT)d, 10)) { + OPS_intval = OPS_intval * 10 + (LONGINT)d; + } else { + OPS_err(203); + } + } + } + } else { + OPS_err(203); + } + } else { + f = (LONGREAL)0; + e = 0; + expCh = 'E'; + while (n > 0) { + n -= 1; + f = (Ord__7(dig[n], 0) + f) / (LONGREAL)(LONGREAL)10; + } + if (OPS_ch == 'E' || OPS_ch == 'D') { + expCh = OPS_ch; + OPM_Get(&OPS_ch); + neg = 0; + if (OPS_ch == '-') { + neg = 1; + OPM_Get(&OPS_ch); + } else if (OPS_ch == '+') { + OPM_Get(&OPS_ch); + } + if (('0' <= OPS_ch && OPS_ch <= '9')) { + do { + n = Ord__7(OPS_ch, 0); + OPM_Get(&OPS_ch); + if (e <= __DIV(32767 - n, 10)) { + e = e * 10 + n; + } else { + OPS_err(203); + } + } while (!(OPS_ch < '0' || '9' < OPS_ch)); + if (neg) { + e = -e; + } + } else { + OPS_err(2); + } + } + e -= (i - d) - m; + if (expCh == 'E') { + OPS_numtyp = 3; + if ((-37 < e && e <= 38)) { + if (e < 0) { + OPS_realval = (f / (LONGREAL)Ten__9(-e)); + } else { + OPS_realval = (f * Ten__9(e)); + } + } else { + OPS_err(203); + } + } else { + OPS_numtyp = 4; + if ((-307 < e && e <= 308)) { + if (e < 0) { + OPS_lrlval = f / (LONGREAL)Ten__9(-e); + } else { + OPS_lrlval = f * Ten__9(e); + } + } else { + OPS_err(203); + } + } + } + Number__6_s = _s.lnk; +} + +static struct Get__1 { + struct Get__1 *lnk; +} *Get__1_s; + +static void Comment__2 (void); + +static void Comment__2 (void) +{ + OPM_Get(&OPS_ch); + for (;;) { + for (;;) { + while (OPS_ch == '(') { + OPM_Get(&OPS_ch); + if (OPS_ch == '*') { + Comment__2(); + } + } + if (OPS_ch == '*') { + OPM_Get(&OPS_ch); + break; + } + if (OPS_ch == 0x00) { + break; + } + OPM_Get(&OPS_ch); + } + if (OPS_ch == ')') { + OPM_Get(&OPS_ch); + break; + } + if (OPS_ch == 0x00) { + OPS_err(5); + break; + } + } +} + +void OPS_Get (SHORTINT *sym) +{ + SHORTINT s; + struct Get__1 _s; + _s.lnk = Get__1_s; + Get__1_s = &_s; + OPM_errpos = OPM_curpos - 1; + while (OPS_ch <= ' ') { + if (OPS_ch == 0x00) { + *sym = 64; + return; + } else { + OPM_Get(&OPS_ch); + } + } + switch (OPS_ch) { + case '\"': case '\'': + OPS_Str(&s); + break; + case '#': + s = 10; + OPM_Get(&OPS_ch); + break; + case '&': + s = 5; + OPM_Get(&OPS_ch); + break; + case '(': + OPM_Get(&OPS_ch); + if (OPS_ch == '*') { + Comment__2(); + OPS_Get(&s); + } else { + s = 30; + } + break; + case ')': + s = 22; + OPM_Get(&OPS_ch); + break; + case '*': + s = 1; + OPM_Get(&OPS_ch); + break; + case '+': + s = 6; + OPM_Get(&OPS_ch); + break; + case ',': + s = 19; + OPM_Get(&OPS_ch); + break; + case '-': + s = 7; + OPM_Get(&OPS_ch); + break; + case '.': + OPM_Get(&OPS_ch); + if (OPS_ch == '.') { + OPM_Get(&OPS_ch); + s = 21; + } else { + s = 18; + } + break; + case '/': + s = 2; + OPM_Get(&OPS_ch); + break; + case '0': case '1': case '2': case '3': case '4': + case '5': case '6': case '7': case '8': case '9': + OPS_Number(); + s = 35; + break; + case ':': + OPM_Get(&OPS_ch); + if (OPS_ch == '=') { + OPM_Get(&OPS_ch); + s = 34; + } else { + s = 20; + } + break; + case ';': + s = 39; + OPM_Get(&OPS_ch); + break; + case '<': + OPM_Get(&OPS_ch); + if (OPS_ch == '=') { + OPM_Get(&OPS_ch); + s = 12; + } else { + s = 11; + } + break; + case '=': + s = 9; + OPM_Get(&OPS_ch); + break; + case '>': + OPM_Get(&OPS_ch); + if (OPS_ch == '=') { + OPM_Get(&OPS_ch); + s = 14; + } else { + s = 13; + } + break; + case 'A': + OPS_Identifier(&s); + if (__STRCMP(OPS_name, "ARRAY") == 0) { + s = 54; + } + break; + case 'B': + OPS_Identifier(&s); + if (__STRCMP(OPS_name, "BEGIN") == 0) { + s = 57; + } else if (__STRCMP(OPS_name, "BY") == 0) { + s = 29; + } + break; + case 'C': + OPS_Identifier(&s); + if (__STRCMP(OPS_name, "CASE") == 0) { + s = 46; + } else if (__STRCMP(OPS_name, "CONST") == 0) { + s = 58; + } + break; + case 'D': + OPS_Identifier(&s); + if (__STRCMP(OPS_name, "DO") == 0) { + s = 27; + } else if (__STRCMP(OPS_name, "DIV") == 0) { + s = 3; + } + break; + case 'E': + OPS_Identifier(&s); + if (__STRCMP(OPS_name, "END") == 0) { + s = 41; + } else if (__STRCMP(OPS_name, "ELSE") == 0) { + s = 42; + } else if (__STRCMP(OPS_name, "ELSIF") == 0) { + s = 43; + } else if (__STRCMP(OPS_name, "EXIT") == 0) { + s = 52; + } + break; + case 'F': + OPS_Identifier(&s); + if (__STRCMP(OPS_name, "FOR") == 0) { + s = 49; + } + break; + case 'I': + OPS_Identifier(&s); + if (__STRCMP(OPS_name, "IF") == 0) { + s = 45; + } else if (__STRCMP(OPS_name, "IN") == 0) { + s = 15; + } else if (__STRCMP(OPS_name, "IS") == 0) { + s = 16; + } else if (__STRCMP(OPS_name, "IMPORT") == 0) { + s = 62; + } + break; + case 'L': + OPS_Identifier(&s); + if (__STRCMP(OPS_name, "LOOP") == 0) { + s = 50; + } + break; + case 'M': + OPS_Identifier(&s); + if (__STRCMP(OPS_name, "MOD") == 0) { + s = 4; + } else if (__STRCMP(OPS_name, "MODULE") == 0) { + s = 63; + } + break; + case 'N': + OPS_Identifier(&s); + if (__STRCMP(OPS_name, "NIL") == 0) { + s = 36; + } + break; + case 'O': + OPS_Identifier(&s); + if (__STRCMP(OPS_name, "OR") == 0) { + s = 8; + } else if (__STRCMP(OPS_name, "OF") == 0) { + s = 25; + } + break; + case 'P': + OPS_Identifier(&s); + if (__STRCMP(OPS_name, "PROCEDURE") == 0) { + s = 61; + } else if (__STRCMP(OPS_name, "POINTER") == 0) { + s = 56; + } + break; + case 'R': + OPS_Identifier(&s); + if (__STRCMP(OPS_name, "RECORD") == 0) { + s = 55; + } else if (__STRCMP(OPS_name, "REPEAT") == 0) { + s = 48; + } else if (__STRCMP(OPS_name, "RETURN") == 0) { + s = 53; + } + break; + case 'T': + OPS_Identifier(&s); + if (__STRCMP(OPS_name, "THEN") == 0) { + s = 26; + } else if (__STRCMP(OPS_name, "TO") == 0) { + s = 28; + } else if (__STRCMP(OPS_name, "TYPE") == 0) { + s = 59; + } + break; + case 'U': + OPS_Identifier(&s); + if (__STRCMP(OPS_name, "UNTIL") == 0) { + s = 44; + } + break; + case 'V': + OPS_Identifier(&s); + if (__STRCMP(OPS_name, "VAR") == 0) { + s = 60; + } + break; + case 'W': + OPS_Identifier(&s); + if (__STRCMP(OPS_name, "WHILE") == 0) { + s = 47; + } else if (__STRCMP(OPS_name, "WITH") == 0) { + s = 51; + } + break; + case 'G': case 'H': case 'J': case 'K': case 'Q': + case 'S': case 'X': case 'Y': case 'Z': + OPS_Identifier(&s); + break; + case '[': + s = 31; + OPM_Get(&OPS_ch); + break; + case ']': + s = 23; + OPM_Get(&OPS_ch); + break; + case '^': + s = 17; + OPM_Get(&OPS_ch); + break; + case 'a': case 'b': case 'c': case 'd': case 'e': + case 'f': case 'g': case 'h': case 'i': case 'j': + case 'k': case 'l': case 'm': case 'n': case 'o': + case 'p': case 'q': case 'r': case 's': case 't': + case 'u': case 'v': case 'w': case 'x': case 'y': + case 'z': + OPS_Identifier(&s); + break; + case '{': + s = 32; + OPM_Get(&OPS_ch); + break; + case '|': + s = 40; + OPM_Get(&OPS_ch); + break; + case '}': + s = 24; + OPM_Get(&OPS_ch); + break; + case '~': + s = 33; + OPM_Get(&OPS_ch); + break; + case 0x7f: + s = 21; + OPM_Get(&OPS_ch); + break; + default: + s = 0; + OPM_Get(&OPS_ch); + break; + } + *sym = s; + Get__1_s = _s.lnk; +} + +void OPS_Init (void) +{ + OPS_ch = ' '; +} + + +export void *OPS__init(void) +{ + __DEFMOD; + __MODULE_IMPORT(OPM); + __REGMOD("OPS", 0); + __REGCMD("Init", OPS_Init); +/* BEGIN */ + __ENDMOD; +} diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h new file mode 100644 index 00000000..87a614f4 --- /dev/null +++ b/bootstrap/windows-48/OPS.h @@ -0,0 +1,28 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin tspkaSfF */ + +#ifndef OPS__h +#define OPS__h + +#include "SYSTEM.h" + +typedef + CHAR OPS_Name[256]; + +typedef + CHAR OPS_String[256]; + + +import OPS_Name OPS_name; +import OPS_String OPS_str; +import INTEGER OPS_numtyp; +import LONGINT OPS_intval; +import REAL OPS_realval; +import LONGREAL OPS_lrlval; + + +import void OPS_Get (SHORTINT *sym); +import void OPS_Init (void); +import void *OPS__init(void); + + +#endif diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c new file mode 100644 index 00000000..fc80ce02 --- /dev/null +++ b/bootstrap/windows-48/OPT.c @@ -0,0 +1,1858 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +#include "SYSTEM.h" +#include "OPM.h" +#include "OPS.h" + +typedef + struct OPT_ConstDesc *OPT_Const; + +typedef + OPS_String *OPT_ConstExt; + +typedef + struct OPT_ConstDesc { + OPT_ConstExt ext; + LONGINT intval, intval2; + SET setval; + LONGREAL realval; + } OPT_ConstDesc; + +typedef + struct OPT_ExpCtxt { + LONGINT reffp; + INTEGER ref; + SHORTINT nofm; + SHORTINT locmno[64]; + } OPT_ExpCtxt; + +typedef + struct OPT_StrDesc *OPT_Struct; + +typedef + struct OPT_ObjDesc *OPT_Object; + +typedef + struct OPT_ImpCtxt { + LONGINT nextTag, reffp; + INTEGER nofr, minr, nofm; + BOOLEAN self; + OPT_Struct ref[255]; + OPT_Object old[255]; + LONGINT pvfp[255]; + SHORTINT glbmno[64]; + } OPT_ImpCtxt; + +typedef + struct OPT_NodeDesc *OPT_Node; + +typedef + struct OPT_NodeDesc { + OPT_Node left, right, link; + SHORTINT class, subcl; + BOOLEAN readonly; + OPT_Struct typ; + OPT_Object obj; + OPT_Const conval; + } OPT_NodeDesc; + +typedef + struct OPT_ObjDesc { + OPT_Object left, right, link, scope; + OPS_Name name; + BOOLEAN leaf; + SHORTINT mode, mnolev, vis, history; + BOOLEAN used, fpdone; + LONGINT fprint; + OPT_Struct typ; + OPT_Const conval; + LONGINT adr, linkadr; + INTEGER x; + } OPT_ObjDesc; + +typedef + struct OPT_StrDesc { + SHORTINT form, comp, mno, extlev; + INTEGER ref, sysflag; + LONGINT n, size, align, txtpos; + BOOLEAN allocated, pbused, pvused, fpdone, idfpdone; + LONGINT idfp, pbfp, pvfp; + OPT_Struct BaseTyp; + OPT_Object link, strobj; + } OPT_StrDesc; + + +export void (*OPT_typSize)(OPT_Struct); +export OPT_Object OPT_topScope; +export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +export SHORTINT OPT_nofGmod; +export OPT_Object OPT_GlbMod[64]; +export OPS_Name OPT_SelfName; +export BOOLEAN OPT_SYSimported; +static OPT_Object OPT_universe, OPT_syslink; +static OPT_ImpCtxt OPT_impCtxt; +static OPT_ExpCtxt OPT_expCtxt; +static LONGINT OPT_nofhdfld; +static BOOLEAN OPT_newsf, OPT_findpc, OPT_extsf, OPT_sfpresent, OPT_symExtended, OPT_symNew; + +export LONGINT *OPT_ConstDesc__typ; +export LONGINT *OPT_ObjDesc__typ; +export LONGINT *OPT_StrDesc__typ; +export LONGINT *OPT_NodeDesc__typ; +export LONGINT *OPT_ImpCtxt__typ; +export LONGINT *OPT_ExpCtxt__typ; + +export void OPT_Close (void); +export void OPT_CloseScope (void); +static void OPT_DebugStruct (OPT_Struct btyp); +static void OPT_EnterBoolConst (OPS_Name name, LONGINT value); +static void OPT_EnterProc (OPS_Name name, INTEGER num); +static void OPT_EnterTyp (OPS_Name name, SHORTINT form, INTEGER size, OPT_Struct *res); +export void OPT_Export (BOOLEAN *ext, BOOLEAN *new); +export void OPT_FPrintErr (OPT_Object obj, INTEGER errcode); +static void OPT_FPrintName (LONGINT *fp, CHAR *name, LONGINT name__len); +export void OPT_FPrintObj (OPT_Object obj); +static void OPT_FPrintSign (LONGINT *fp, OPT_Struct result, OPT_Object par); +export void OPT_FPrintStr (OPT_Struct typ); +export void OPT_Find (OPT_Object *res); +export void OPT_FindField (OPS_Name name, OPT_Struct typ, OPT_Object *res); +export void OPT_FindImport (OPT_Object mod, OPT_Object *res); +export void OPT_IdFPrint (OPT_Struct typ); +export void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); +static void OPT_InConstant (LONGINT f, OPT_Const conval); +static OPT_Object OPT_InFld (void); +static void OPT_InMod (SHORTINT *mno); +static void OPT_InName (CHAR *name, LONGINT name__len); +static OPT_Object OPT_InObj (SHORTINT mno); +static void OPT_InSign (SHORTINT mno, OPT_Struct *res, OPT_Object *par); +static void OPT_InStruct (OPT_Struct *typ); +static OPT_Object OPT_InTProc (SHORTINT mno); +export void OPT_Init (OPS_Name name, SET opt); +static void OPT_InitStruct (OPT_Struct *typ, SHORTINT form); +export void OPT_Insert (OPS_Name name, OPT_Object *obj); +export void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); +export OPT_Const OPT_NewConst (void); +export OPT_ConstExt OPT_NewExt (void); +export OPT_Node OPT_NewNode (SHORTINT class); +export OPT_Object OPT_NewObj (void); +export OPT_Struct OPT_NewStr (SHORTINT form, SHORTINT comp); +export void OPT_OpenScope (SHORTINT level, OPT_Object owner); +static void OPT_OutConstant (OPT_Object obj); +static void OPT_OutFlds (OPT_Object fld, LONGINT adr, BOOLEAN visible); +static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, LONGINT adr); +static void OPT_OutMod (INTEGER mno); +static void OPT_OutName (CHAR *name, LONGINT name__len); +static void OPT_OutObj (OPT_Object obj); +static void OPT_OutSign (OPT_Struct result, OPT_Object par); +static void OPT_OutStr (OPT_Struct typ); +static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj); +static void OPT_err (INTEGER n); + + +static void OPT_err (INTEGER n) +{ + OPM_err(n); +} + +OPT_Const OPT_NewConst (void) +{ + OPT_Const _o_result; + OPT_Const const_ = NIL; + __NEW(const_, OPT_ConstDesc); + _o_result = const_; + return _o_result; +} + +OPT_Object OPT_NewObj (void) +{ + OPT_Object _o_result; + OPT_Object obj = NIL; + __NEW(obj, OPT_ObjDesc); + _o_result = obj; + return _o_result; +} + +OPT_Struct OPT_NewStr (SHORTINT form, SHORTINT comp) +{ + OPT_Struct _o_result; + OPT_Struct typ = NIL; + __NEW(typ, OPT_StrDesc); + typ->form = form; + typ->comp = comp; + typ->ref = 255; + if (form != 0) { + typ->txtpos = OPM_errpos; + } + typ->size = -1; + typ->BaseTyp = OPT_undftyp; + _o_result = typ; + return _o_result; +} + +OPT_Node OPT_NewNode (SHORTINT class) +{ + OPT_Node _o_result; + OPT_Node node = NIL; + __NEW(node, OPT_NodeDesc); + node->class = class; + _o_result = node; + return _o_result; +} + +OPT_ConstExt OPT_NewExt (void) +{ + OPT_ConstExt _o_result; + OPT_ConstExt ext = NIL; + ext = __NEWARR(NIL, ((LONGINT)(1)), 1, 1, 0, (LONGINT)256); + _o_result = ext; + return _o_result; +} + +void OPT_OpenScope (SHORTINT level, OPT_Object owner) +{ + OPT_Object head = NIL; + head = OPT_NewObj(); + head->mode = 12; + head->mnolev = level; + head->link = owner; + if (owner != NIL) { + owner->scope = head; + } + head->left = OPT_topScope; + head->right = NIL; + head->scope = NIL; + OPT_topScope = head; +} + +void OPT_CloseScope (void) +{ + OPT_topScope = OPT_topScope->left; +} + +void OPT_Init (OPS_Name name, SET opt) +{ + OPT_topScope = OPT_universe; + OPT_OpenScope(0, NIL); + OPT_SYSimported = 0; + __COPY(name, OPT_SelfName, ((LONGINT)(256))); + __COPY(name, OPT_topScope->name, ((LONGINT)(256))); + OPT_GlbMod[0] = OPT_topScope; + OPT_nofGmod = 1; + OPT_newsf = __IN(4, opt); + OPT_findpc = __IN(8, opt); + OPT_extsf = OPT_newsf || __IN(9, opt); + OPT_sfpresent = 1; +} + +void OPT_Close (void) +{ + INTEGER i; + OPT_CloseScope(); + i = 0; + while (i < 64) { + OPT_GlbMod[__X(i, ((LONGINT)(64)))] = NIL; + i += 1; + } + i = 16; + while (i < 255) { + OPT_impCtxt.ref[__X(i, ((LONGINT)(255)))] = NIL; + OPT_impCtxt.old[__X(i, ((LONGINT)(255)))] = NIL; + i += 1; + } +} + +void OPT_FindImport (OPT_Object mod, OPT_Object *res) +{ + OPT_Object obj = NIL; + obj = mod->scope; + for (;;) { + if (obj == NIL) { + break; + } + if (__STRCMP(OPS_name, obj->name) < 0) { + obj = obj->left; + } else if (__STRCMP(OPS_name, obj->name) > 0) { + obj = obj->right; + } else { + if ((obj->mode == 5 && obj->vis == 0)) { + obj = NIL; + } else { + obj->used = 1; + } + break; + } + } + *res = obj; +} + +void OPT_Find (OPT_Object *res) +{ + OPT_Object obj = NIL, head = NIL; + head = OPT_topScope; + for (;;) { + obj = head->right; + for (;;) { + if (obj == NIL) { + break; + } + if (__STRCMP(OPS_name, obj->name) < 0) { + obj = obj->left; + } else if (__STRCMP(OPS_name, obj->name) > 0) { + obj = obj->right; + } else { + break; + } + } + if (obj != NIL) { + break; + } + head = head->left; + if (head == NIL) { + break; + } + } + *res = obj; +} + +void OPT_FindField (OPS_Name name, OPT_Struct typ, OPT_Object *res) +{ + OPT_Object obj = NIL; + while (typ != NIL) { + obj = typ->link; + while (obj != NIL) { + if (__STRCMP(name, obj->name) < 0) { + obj = obj->left; + } else if (__STRCMP(name, obj->name) > 0) { + obj = obj->right; + } else { + *res = obj; + return; + } + } + typ = typ->BaseTyp; + } + *res = NIL; +} + +void OPT_Insert (OPS_Name name, OPT_Object *obj) +{ + OPT_Object ob0 = NIL, ob1 = NIL; + BOOLEAN left; + SHORTINT mnolev; + ob0 = OPT_topScope; + ob1 = ob0->right; + left = 0; + for (;;) { + if (ob1 != NIL) { + if (__STRCMP(name, ob1->name) < 0) { + ob0 = ob1; + ob1 = ob0->left; + left = 1; + } else if (__STRCMP(name, ob1->name) > 0) { + ob0 = ob1; + ob1 = ob0->right; + left = 0; + } else { + OPT_err(1); + ob0 = ob1; + ob1 = ob0->right; + } + } else { + ob1 = OPT_NewObj(); + ob1->leaf = 1; + if (left) { + ob0->left = ob1; + } else { + ob0->right = ob1; + } + ob1->left = NIL; + ob1->right = NIL; + __COPY(name, ob1->name, ((LONGINT)(256))); + mnolev = OPT_topScope->mnolev; + ob1->mnolev = mnolev; + break; + } + } + *obj = ob1; +} + +static void OPT_FPrintName (LONGINT *fp, CHAR *name, LONGINT name__len) +{ + INTEGER i; + CHAR ch; + i = 0; + do { + ch = name[__X(i, name__len)]; + OPM_FPrint(&*fp, (int)ch); + i += 1; + } while (!(ch == 0x00)); +} + +static void OPT_DebugStruct (OPT_Struct btyp) +{ + OPM_LogWLn(); + if (btyp == NIL) { + OPM_LogWStr((CHAR*)"btyp is nil", (LONGINT)12); + OPM_LogWLn(); + } + OPM_LogWStr((CHAR*)"btyp^.strobji^.name = ", (LONGINT)23); + OPM_LogWStr(btyp->strobj->name, ((LONGINT)(256))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"btyp^.form = ", (LONGINT)14); + OPM_LogWNum(btyp->form, ((LONGINT)(0))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"btyp^.comp = ", (LONGINT)14); + OPM_LogWNum(btyp->comp, ((LONGINT)(0))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"btyp^.mno = ", (LONGINT)13); + OPM_LogWNum(btyp->mno, ((LONGINT)(0))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"btyp^.extlev = ", (LONGINT)16); + OPM_LogWNum(btyp->extlev, ((LONGINT)(0))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"btyp^.size = ", (LONGINT)14); + OPM_LogWNum(btyp->size, ((LONGINT)(0))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"btyp^.align = ", (LONGINT)15); + OPM_LogWNum(btyp->align, ((LONGINT)(0))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"btyp^.txtpos = ", (LONGINT)16); + OPM_LogWNum(btyp->txtpos, ((LONGINT)(0))); + OPM_LogWLn(); +} + +static void OPT_FPrintSign (LONGINT *fp, OPT_Struct result, OPT_Object par) +{ + OPT_IdFPrint(result); + OPM_FPrint(&*fp, result->idfp); + while (par != NIL) { + OPM_FPrint(&*fp, par->mode); + OPT_IdFPrint(par->typ); + OPM_FPrint(&*fp, par->typ->idfp); + par = par->link; + } +} + +void OPT_IdFPrint (OPT_Struct typ) +{ + OPT_Struct btyp = NIL; + OPT_Object strobj = NIL; + LONGINT idfp; + INTEGER f, c; + if (!typ->idfpdone) { + typ->idfpdone = 1; + idfp = 0; + f = typ->form; + c = typ->comp; + OPM_FPrint(&idfp, f); + OPM_FPrint(&idfp, c); + btyp = typ->BaseTyp; + strobj = typ->strobj; + if ((strobj != NIL && strobj->name[0] != 0x00)) { + OPT_FPrintName(&idfp, (void*)OPT_GlbMod[__X(typ->mno, ((LONGINT)(64)))]->name, ((LONGINT)(256))); + OPT_FPrintName(&idfp, (void*)strobj->name, ((LONGINT)(256))); + } + if ((f == 13 || (c == 4 && btyp != NIL)) || c == 3) { + OPT_IdFPrint(btyp); + OPM_FPrint(&idfp, btyp->idfp); + } else if (c == 2) { + OPT_IdFPrint(btyp); + OPM_FPrint(&idfp, btyp->idfp); + OPM_FPrint(&idfp, typ->n); + } else if (f == 14) { + OPT_FPrintSign(&idfp, btyp, typ->link); + } + typ->idfp = idfp; + } +} + +static struct FPrintStr__12 { + LONGINT *pbfp, *pvfp; + struct FPrintStr__12 *lnk; +} *FPrintStr__12_s; + +static void FPrintFlds__13 (OPT_Object fld, LONGINT adr, BOOLEAN visible); +static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr); +static void FPrintTProcs__17 (OPT_Object obj); + +static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr) +{ + LONGINT i, j, n; + OPT_Struct btyp = NIL; + if (typ->comp == 4) { + FPrintFlds__13(typ->link, adr, 0); + } else if (typ->comp == 2) { + btyp = typ->BaseTyp; + n = typ->n; + while (btyp->comp == 2) { + n = btyp->n * n; + btyp = btyp->BaseTyp; + } + if (btyp->form == 13 || btyp->comp == 4) { + j = OPT_nofhdfld; + FPrintHdFld__15(btyp, fld, adr); + if (j != OPT_nofhdfld) { + i = 1; + while ((i < n && OPT_nofhdfld <= 2048)) { + adr += btyp->size; + FPrintHdFld__15(btyp, fld, adr); + i += 1; + } + } + } + } else if (typ->form == 13 || __STRCMP(fld->name, "@ptr") == 0) { + OPM_FPrint(&*FPrintStr__12_s->pvfp, ((LONGINT)(13))); + OPM_FPrint(&*FPrintStr__12_s->pvfp, adr); + OPT_nofhdfld += 1; + } +} + +static void FPrintFlds__13 (OPT_Object fld, LONGINT adr, BOOLEAN visible) +{ + while ((fld != NIL && fld->mode == 4)) { + if ((fld->vis != 0 && visible)) { + OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->vis); + OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)fld->name, ((LONGINT)(256))); + OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->adr); + OPT_FPrintStr(fld->typ); + OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->typ->pbfp); + OPM_FPrint(&*FPrintStr__12_s->pvfp, fld->typ->pvfp); + } else { + FPrintHdFld__15(fld->typ, fld, fld->adr + adr); + } + fld = fld->link; + } +} + +static void FPrintTProcs__17 (OPT_Object obj) +{ + if (obj != NIL) { + FPrintTProcs__17(obj->left); + if (obj->mode == 13) { + if (obj->vis != 0) { + OPM_FPrint(&*FPrintStr__12_s->pbfp, ((LONGINT)(13))); + OPM_FPrint(&*FPrintStr__12_s->pbfp, __ASHR(obj->adr, 16)); + OPT_FPrintSign(&*FPrintStr__12_s->pbfp, obj->typ, obj->link); + OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)obj->name, ((LONGINT)(256))); + } + } + FPrintTProcs__17(obj->right); + } +} + +void OPT_FPrintStr (OPT_Struct typ) +{ + INTEGER f, c; + OPT_Struct btyp = NIL; + OPT_Object strobj = NIL, bstrobj = NIL; + LONGINT pbfp, pvfp; + struct FPrintStr__12 _s; + _s.pbfp = &pbfp; + _s.pvfp = &pvfp; + _s.lnk = FPrintStr__12_s; + FPrintStr__12_s = &_s; + if (!typ->fpdone) { + OPT_IdFPrint(typ); + pbfp = typ->idfp; + if (typ->sysflag != 0) { + OPM_FPrint(&pbfp, typ->sysflag); + } + pvfp = pbfp; + typ->pbfp = pbfp; + typ->pvfp = pvfp; + typ->fpdone = 1; + f = typ->form; + c = typ->comp; + btyp = typ->BaseTyp; + if (f == 13) { + strobj = typ->strobj; + bstrobj = btyp->strobj; + if (((strobj == NIL || strobj->name[0] == 0x00) || bstrobj == NIL) || bstrobj->name[0] == 0x00) { + OPT_FPrintStr(btyp); + OPM_FPrint(&pbfp, btyp->pbfp); + pvfp = pbfp; + } + } else if (f == 14) { + } else if (__IN(c, 0x0c)) { + OPT_FPrintStr(btyp); + OPM_FPrint(&pbfp, btyp->pvfp); + pvfp = pbfp; + } else { + if (btyp != NIL) { + OPT_FPrintStr(btyp); + OPM_FPrint(&pbfp, btyp->pbfp); + OPM_FPrint(&pvfp, btyp->pvfp); + } + OPM_FPrint(&pvfp, typ->size); + OPM_FPrint(&pvfp, typ->align); + OPM_FPrint(&pvfp, typ->n); + OPT_nofhdfld = 0; + FPrintFlds__13(typ->link, ((LONGINT)(0)), 1); + if (OPT_nofhdfld > 2048) { + OPM_Mark(225, typ->txtpos); + } + FPrintTProcs__17(typ->link); + OPM_FPrint(&pvfp, pbfp); + strobj = typ->strobj; + if (strobj == NIL || strobj->name[0] == 0x00) { + pbfp = pvfp; + } + } + typ->pbfp = pbfp; + typ->pvfp = pvfp; + } + FPrintStr__12_s = _s.lnk; +} + +void OPT_FPrintObj (OPT_Object obj) +{ + LONGINT fprint; + INTEGER f, m; + REAL rval; + OPT_ConstExt ext = NIL; + if (!obj->fpdone) { + fprint = 0; + obj->fpdone = 1; + OPM_FPrint(&fprint, obj->mode); + if (obj->mode == 3) { + f = obj->typ->form; + OPM_FPrint(&fprint, f); + switch (f) { + case 2: case 3: case 4: case 5: case 6: + OPM_FPrint(&fprint, obj->conval->intval); + break; + case 9: + OPM_FPrintSet(&fprint, obj->conval->setval); + break; + case 7: + rval = obj->conval->realval; + OPM_FPrintReal(&fprint, rval); + break; + case 8: + OPM_FPrintLReal(&fprint, obj->conval->realval); + break; + case 10: + OPT_FPrintName(&fprint, (void*)*obj->conval->ext, ((LONGINT)(256))); + break; + case 11: + break; + default: + OPT_err(127); + break; + } + } else if (obj->mode == 1) { + OPM_FPrint(&fprint, obj->vis); + OPT_FPrintStr(obj->typ); + OPM_FPrint(&fprint, obj->typ->pbfp); + } else if (__IN(obj->mode, 0x0480)) { + OPT_FPrintSign(&fprint, obj->typ, obj->link); + } else if (obj->mode == 9) { + OPT_FPrintSign(&fprint, obj->typ, obj->link); + ext = obj->conval->ext; + m = (int)(*ext)[0]; + f = 1; + OPM_FPrint(&fprint, m); + while (f <= m) { + OPM_FPrint(&fprint, (int)(*ext)[__X(f, ((LONGINT)(256)))]); + f += 1; + } + } else if (obj->mode == 5) { + OPT_FPrintStr(obj->typ); + OPM_FPrint(&fprint, obj->typ->pbfp); + } + obj->fprint = fprint; + } +} + +void OPT_FPrintErr (OPT_Object obj, INTEGER errcode) +{ + INTEGER i, j; + CHAR ch; + if (obj->mnolev != 0) { + __COPY(OPT_GlbMod[__X(-obj->mnolev, ((LONGINT)(64)))]->name, OPM_objname, ((LONGINT)(64))); + i = 0; + while (OPM_objname[__X(i, ((LONGINT)(64)))] != 0x00) { + i += 1; + } + OPM_objname[__X(i, ((LONGINT)(64)))] = '.'; + j = 0; + i += 1; + do { + ch = obj->name[__X(j, ((LONGINT)(256)))]; + OPM_objname[__X(i, ((LONGINT)(64)))] = ch; + j += 1; + i += 1; + } while (!(ch == 0x00)); + } else { + __COPY(obj->name, OPM_objname, ((LONGINT)(64))); + } + if (errcode == 249) { + if (OPM_noerr) { + OPT_err(errcode); + } + } else if (errcode == 253) { + if ((((!OPT_symNew && !OPT_symExtended)) && !OPT_extsf)) { + OPT_err(errcode); + } + OPT_symExtended = 1; + } else { + if ((!OPT_symNew && !OPT_newsf)) { + OPT_err(errcode); + } + OPT_symNew = 1; + } +} + +void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old) +{ + OPT_Object ob0 = NIL, ob1 = NIL; + BOOLEAN left; + if (*root == NIL) { + *root = obj; + *old = NIL; + } else { + ob0 = *root; + ob1 = ob0->right; + left = 0; + if (__STRCMP(obj->name, ob0->name) < 0) { + ob1 = ob0->left; + left = 1; + } else if (__STRCMP(obj->name, ob0->name) > 0) { + ob1 = ob0->right; + left = 0; + } else { + *old = ob0; + return; + } + for (;;) { + if (ob1 != NIL) { + if (__STRCMP(obj->name, ob1->name) < 0) { + ob0 = ob1; + ob1 = ob1->left; + left = 1; + } else if (__STRCMP(obj->name, ob1->name) > 0) { + ob0 = ob1; + ob1 = ob1->right; + left = 0; + } else { + *old = ob1; + break; + } + } else { + ob1 = obj; + if (left) { + ob0->left = ob1; + } else { + ob0->right = ob1; + } + ob1->left = NIL; + ob1->right = NIL; + *old = NIL; + break; + } + } + } +} + +static void OPT_InName (CHAR *name, LONGINT name__len) +{ + INTEGER i; + CHAR ch; + i = 0; + do { + OPM_SymRCh(&ch); + name[__X(i, name__len)] = ch; + i += 1; + } while (!(ch == 0x00)); +} + +static void OPT_InMod (SHORTINT *mno) +{ + OPT_Object head = NIL; + OPS_Name name; + LONGINT mn; + SHORTINT i; + mn = OPM_SymRInt(); + if (mn == 0) { + *mno = OPT_impCtxt.glbmno[0]; + } else { + if (mn == 16) { + OPT_InName((void*)name, ((LONGINT)(256))); + if ((__STRCMP(name, OPT_SelfName) == 0 && !OPT_impCtxt.self)) { + OPT_err(154); + } + i = 0; + while ((i < OPT_nofGmod && __STRCMP(name, OPT_GlbMod[__X(i, ((LONGINT)(64)))]->name) != 0)) { + i += 1; + } + if (i < OPT_nofGmod) { + *mno = i; + } else { + head = OPT_NewObj(); + head->mode = 12; + __COPY(name, head->name, ((LONGINT)(256))); + *mno = OPT_nofGmod; + head->mnolev = -*mno; + if (OPT_nofGmod < 64) { + OPT_GlbMod[__X(*mno, ((LONGINT)(64)))] = head; + OPT_nofGmod += 1; + } else { + OPT_err(227); + } + } + OPT_impCtxt.glbmno[__X(OPT_impCtxt.nofm, ((LONGINT)(64)))] = *mno; + OPT_impCtxt.nofm += 1; + } else { + *mno = OPT_impCtxt.glbmno[__X(-mn, ((LONGINT)(64)))]; + } + } +} + +static void OPT_InConstant (LONGINT f, OPT_Const conval) +{ + CHAR ch; + INTEGER i; + OPT_ConstExt ext = NIL; + REAL rval; + switch (f) { + case 1: case 3: case 2: + OPM_SymRCh(&ch); + conval->intval = (int)ch; + break; + case 4: case 5: case 6: + conval->intval = OPM_SymRInt(); + break; + case 9: + OPM_SymRSet(&conval->setval); + break; + case 7: + OPM_SymRReal(&rval); + conval->realval = rval; + conval->intval = -1; + break; + case 8: + OPM_SymRLReal(&conval->realval); + conval->intval = -1; + break; + case 10: + ext = OPT_NewExt(); + conval->ext = ext; + i = 0; + do { + OPM_SymRCh(&ch); + (*ext)[__X(i, ((LONGINT)(256)))] = ch; + i += 1; + } while (!(ch == 0x00)); + conval->intval2 = i; + conval->intval = -1; + break; + case 11: + conval->intval = 0; + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPT.InConstant(), f = ", (LONGINT)41); + OPM_LogWNum(f, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } +} + +static void OPT_InSign (SHORTINT mno, OPT_Struct *res, OPT_Object *par) +{ + OPT_Object last = NIL, new = NIL; + LONGINT tag; + OPT_InStruct(&*res); + tag = OPM_SymRInt(); + last = NIL; + while (tag != 18) { + new = OPT_NewObj(); + new->mnolev = -mno; + if (last == NIL) { + *par = new; + } else { + last->link = new; + } + if (tag == 23) { + new->mode = 1; + } else { + new->mode = 2; + } + OPT_InStruct(&new->typ); + new->adr = OPM_SymRInt(); + OPT_InName((void*)new->name, ((LONGINT)(256))); + last = new; + tag = OPM_SymRInt(); + } +} + +static OPT_Object OPT_InFld (void) +{ + OPT_Object _o_result; + LONGINT tag; + OPT_Object obj = NIL; + tag = OPT_impCtxt.nextTag; + obj = OPT_NewObj(); + if (tag <= 26) { + obj->mode = 4; + if (tag == 26) { + obj->vis = 2; + } else { + obj->vis = 1; + } + OPT_InStruct(&obj->typ); + OPT_InName((void*)obj->name, ((LONGINT)(256))); + obj->adr = OPM_SymRInt(); + } else { + obj->mode = 4; + if (tag == 27) { + __MOVE("@ptr", obj->name, 5); + } else { + __MOVE("@proc", obj->name, 6); + } + obj->typ = OPT_undftyp; + obj->vis = 0; + obj->adr = OPM_SymRInt(); + } + _o_result = obj; + return _o_result; +} + +static OPT_Object OPT_InTProc (SHORTINT mno) +{ + OPT_Object _o_result; + LONGINT tag; + OPT_Object obj = NIL; + tag = OPT_impCtxt.nextTag; + obj = OPT_NewObj(); + obj->mnolev = -mno; + if (tag == 29) { + obj->mode = 13; + obj->conval = OPT_NewConst(); + obj->conval->intval = -1; + OPT_InSign(mno, &obj->typ, &obj->link); + obj->vis = 1; + OPT_InName((void*)obj->name, ((LONGINT)(256))); + obj->adr = __ASHL(OPM_SymRInt(), 16); + } else { + obj->mode = 13; + __MOVE("@tproc", obj->name, 7); + obj->link = OPT_NewObj(); + obj->typ = OPT_undftyp; + obj->vis = 0; + obj->adr = __ASHL(OPM_SymRInt(), 16); + } + _o_result = obj; + return _o_result; +} + +static void OPT_InStruct (OPT_Struct *typ) +{ + SHORTINT mno; + INTEGER ref; + LONGINT tag; + OPS_Name name; + OPT_Struct t = NIL; + OPT_Object obj = NIL, last = NIL, fld = NIL, old = NIL, dummy = NIL; + tag = OPM_SymRInt(); + if (tag != 34) { + *typ = OPT_impCtxt.ref[__X(-tag, ((LONGINT)(255)))]; + } else { + ref = OPT_impCtxt.nofr; + OPT_impCtxt.nofr += 1; + if (ref < OPT_impCtxt.minr) { + OPT_impCtxt.minr = ref; + } + OPT_InMod(&mno); + OPT_InName((void*)name, ((LONGINT)(256))); + obj = OPT_NewObj(); + if (name[0] == 0x00) { + if (OPT_impCtxt.self) { + old = NIL; + } else { + __MOVE("@", obj->name, 2); + OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->right, &old); + obj->name[0] = 0x00; + } + *typ = OPT_NewStr(0, 1); + } else { + __COPY(name, obj->name, ((LONGINT)(256))); + OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->right, &old); + if (old != NIL) { + OPT_FPrintObj(old); + OPT_impCtxt.pvfp[__X(ref, ((LONGINT)(255)))] = old->typ->pvfp; + if (OPT_impCtxt.self) { + *typ = OPT_NewStr(0, 1); + } else { + *typ = old->typ; + (*typ)->link = NIL; + (*typ)->sysflag = 0; + (*typ)->fpdone = 0; + (*typ)->idfpdone = 0; + } + } else { + *typ = OPT_NewStr(0, 1); + } + } + OPT_impCtxt.ref[__X(ref, ((LONGINT)(255)))] = *typ; + OPT_impCtxt.old[__X(ref, ((LONGINT)(255)))] = old; + (*typ)->ref = ref + 255; + (*typ)->mno = mno; + (*typ)->allocated = 1; + (*typ)->strobj = obj; + obj->mode = 5; + obj->typ = *typ; + obj->mnolev = -mno; + obj->vis = 0; + tag = OPM_SymRInt(); + if (tag == 35) { + (*typ)->sysflag = (int)OPM_SymRInt(); + tag = OPM_SymRInt(); + } + switch (tag) { + case 36: + (*typ)->form = 13; + (*typ)->size = OPM_PointerSize; + (*typ)->n = 0; + OPT_InStruct(&(*typ)->BaseTyp); + break; + case 37: + (*typ)->form = 15; + (*typ)->comp = 2; + OPT_InStruct(&(*typ)->BaseTyp); + (*typ)->n = OPM_SymRInt(); + (*OPT_typSize)(*typ); + break; + case 38: + (*typ)->form = 15; + (*typ)->comp = 3; + OPT_InStruct(&(*typ)->BaseTyp); + if ((*typ)->BaseTyp->comp == 3) { + (*typ)->n = (*typ)->BaseTyp->n + 1; + } else { + (*typ)->n = 0; + } + (*OPT_typSize)(*typ); + break; + case 39: + (*typ)->form = 15; + (*typ)->comp = 4; + OPT_InStruct(&(*typ)->BaseTyp); + if ((*typ)->BaseTyp == OPT_notyp) { + (*typ)->BaseTyp = NIL; + } + (*typ)->extlev = 0; + t = (*typ)->BaseTyp; + while (t != NIL) { + (*typ)->extlev += 1; + t = t->BaseTyp; + } + (*typ)->size = OPM_SymRInt(); + (*typ)->align = OPM_SymRInt(); + (*typ)->n = OPM_SymRInt(); + OPT_impCtxt.nextTag = OPM_SymRInt(); + last = NIL; + while ((OPT_impCtxt.nextTag >= 25 && OPT_impCtxt.nextTag <= 28)) { + fld = OPT_InFld(); + fld->mnolev = -mno; + if (last != NIL) { + last->link = fld; + } + last = fld; + OPT_InsertImport(fld, &(*typ)->link, &dummy); + OPT_impCtxt.nextTag = OPM_SymRInt(); + } + while (OPT_impCtxt.nextTag != 18) { + fld = OPT_InTProc(mno); + OPT_InsertImport(fld, &(*typ)->link, &dummy); + OPT_impCtxt.nextTag = OPM_SymRInt(); + } + break; + case 40: + (*typ)->form = 14; + (*typ)->size = OPM_ProcSize; + OPT_InSign(mno, &(*typ)->BaseTyp, &(*typ)->link); + break; + default: + OPM_LogWStr((CHAR*)"unhandled case at OPT.InStruct, tag = ", (LONGINT)39); + OPM_LogWNum(tag, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + if (ref == OPT_impCtxt.minr) { + while (ref < OPT_impCtxt.nofr) { + t = OPT_impCtxt.ref[__X(ref, ((LONGINT)(255)))]; + OPT_FPrintStr(t); + obj = t->strobj; + if (obj->name[0] != 0x00) { + OPT_FPrintObj(obj); + } + old = OPT_impCtxt.old[__X(ref, ((LONGINT)(255)))]; + if (old != NIL) { + t->strobj = old; + if (OPT_impCtxt.self) { + if (old->mnolev < 0) { + if (old->history != 5) { + if (old->fprint != obj->fprint) { + old->history = 2; + } else if (OPT_impCtxt.pvfp[__X(ref, ((LONGINT)(255)))] != t->pvfp) { + old->history = 3; + } + } + } else if (old->fprint != obj->fprint) { + old->history = 2; + } else if (OPT_impCtxt.pvfp[__X(ref, ((LONGINT)(255)))] != t->pvfp) { + old->history = 3; + } else if (old->vis == 0) { + old->history = 1; + } else { + old->history = 0; + } + } else { + if (OPT_impCtxt.pvfp[__X(ref, ((LONGINT)(255)))] != t->pvfp) { + old->history = 5; + } + if (old->fprint != obj->fprint) { + OPT_FPrintErr(old, 249); + } + } + } else if (OPT_impCtxt.self) { + obj->history = 4; + } else { + obj->history = 1; + } + ref += 1; + } + OPT_impCtxt.minr = 255; + } + } +} + +static OPT_Object OPT_InObj (SHORTINT mno) +{ + OPT_Object _o_result; + INTEGER i, s; + CHAR ch; + OPT_Object obj = NIL, old = NIL; + OPT_Struct typ = NIL; + LONGINT tag; + OPT_ConstExt ext = NIL; + tag = OPT_impCtxt.nextTag; + if (tag == 19) { + OPT_InStruct(&typ); + obj = typ->strobj; + if (!OPT_impCtxt.self) { + obj->vis = 1; + } + } else { + obj = OPT_NewObj(); + obj->mnolev = -mno; + obj->vis = 1; + if (tag <= 13) { + obj->mode = 3; + obj->typ = OPT_impCtxt.ref[__X(tag, ((LONGINT)(255)))]; + obj->conval = OPT_NewConst(); + OPT_InConstant(tag, obj->conval); + } else if (tag >= 31) { + obj->conval = OPT_NewConst(); + obj->conval->intval = -1; + OPT_InSign(mno, &obj->typ, &obj->link); + switch (tag) { + case 31: + obj->mode = 7; + break; + case 32: + obj->mode = 10; + break; + case 33: + obj->mode = 9; + ext = OPT_NewExt(); + obj->conval->ext = ext; + s = (int)OPM_SymRInt(); + (*ext)[0] = (CHAR)s; + i = 1; + while (i <= s) { + OPM_SymRCh(&(*ext)[__X(i, ((LONGINT)(256)))]); + i += 1; + } + break; + default: + OPM_LogWStr((CHAR*)"unhandled case at OPT.InObj, tag = ", (LONGINT)36); + OPM_LogWNum(tag, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + } else if (tag == 20) { + obj->mode = 5; + OPT_InStruct(&obj->typ); + } else { + obj->mode = 1; + if (tag == 22) { + obj->vis = 2; + } + OPT_InStruct(&obj->typ); + } + OPT_InName((void*)obj->name, ((LONGINT)(256))); + } + OPT_FPrintObj(obj); + if ((obj->mode == 1 && (obj->typ->strobj == NIL || obj->typ->strobj->name[0] == 0x00))) { + OPM_FPrint(&OPT_impCtxt.reffp, obj->typ->ref - 255); + } + if (tag != 19) { + OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->right, &old); + if (OPT_impCtxt.self) { + if (old != NIL) { + if (old->vis == 0) { + old->history = 4; + } else { + OPT_FPrintObj(old); + if (obj->fprint != old->fprint) { + old->history = 2; + } else if (obj->typ->pvfp != old->typ->pvfp) { + old->history = 3; + } else { + old->history = 1; + } + } + } else { + obj->history = 4; + } + } + } else { + if (OPT_impCtxt.self) { + if (obj->vis == 0) { + obj->history = 4; + } else if (obj->history == 0) { + obj->history = 1; + } + } + } + _o_result = obj; + return _o_result; +} + +void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) +{ + OPT_Object obj = NIL; + SHORTINT mno; + OPS_Name aliasName__copy; + __DUPARR(aliasName, OPS_Name); + if (__STRCMP(name, "SYSTEM") == 0) { + OPT_SYSimported = 1; + OPT_Insert(aliasName, &obj); + obj->mode = 11; + obj->mnolev = 0; + obj->scope = OPT_syslink; + obj->typ = OPT_notyp; + } else { + OPT_impCtxt.nofr = 16; + OPT_impCtxt.minr = 255; + OPT_impCtxt.nofm = 0; + OPT_impCtxt.self = __STRCMP(aliasName, "@self") == 0; + OPT_impCtxt.reffp = 0; + OPM_OldSym((void*)name, ((LONGINT)(256)), &*done); + if (*done) { + OPT_InMod(&mno); + OPT_impCtxt.nextTag = OPM_SymRInt(); + while (!OPM_eofSF()) { + obj = OPT_InObj(mno); + OPT_impCtxt.nextTag = OPM_SymRInt(); + } + OPT_Insert(aliasName, &obj); + obj->mode = 11; + obj->scope = OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->right; + OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->link = obj; + obj->mnolev = -mno; + obj->typ = OPT_notyp; + OPM_CloseOldSym(); + } else if (OPT_impCtxt.self) { + OPT_newsf = 1; + OPT_extsf = 1; + OPT_sfpresent = 0; + } else { + OPT_err(152); + } + } +} + +static void OPT_OutName (CHAR *name, LONGINT name__len) +{ + INTEGER i; + CHAR ch; + i = 0; + do { + ch = name[__X(i, name__len)]; + OPM_SymWCh(ch); + i += 1; + } while (!(ch == 0x00)); +} + +static void OPT_OutMod (INTEGER mno) +{ + if (OPT_expCtxt.locmno[__X(mno, ((LONGINT)(64)))] < 0) { + OPM_SymWInt(((LONGINT)(16))); + OPT_expCtxt.locmno[__X(mno, ((LONGINT)(64)))] = OPT_expCtxt.nofm; + OPT_expCtxt.nofm += 1; + OPT_OutName((void*)OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->name, ((LONGINT)(256))); + } else { + OPM_SymWInt(-OPT_expCtxt.locmno[__X(mno, ((LONGINT)(64)))]); + } +} + +static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, LONGINT adr) +{ + LONGINT i, j, n; + OPT_Struct btyp = NIL; + if (typ->comp == 4) { + OPT_OutFlds(typ->link, adr, 0); + } else if (typ->comp == 2) { + btyp = typ->BaseTyp; + n = typ->n; + while (btyp->comp == 2) { + n = btyp->n * n; + btyp = btyp->BaseTyp; + } + if (btyp->form == 13 || btyp->comp == 4) { + j = OPT_nofhdfld; + OPT_OutHdFld(btyp, fld, adr); + if (j != OPT_nofhdfld) { + i = 1; + while ((i < n && OPT_nofhdfld <= 2048)) { + adr += btyp->size; + OPT_OutHdFld(btyp, fld, adr); + i += 1; + } + } + } + } else if (typ->form == 13 || __STRCMP(fld->name, "@ptr") == 0) { + OPM_SymWInt(((LONGINT)(27))); + OPM_SymWInt(adr); + OPT_nofhdfld += 1; + } +} + +static void OPT_OutFlds (OPT_Object fld, LONGINT adr, BOOLEAN visible) +{ + while ((fld != NIL && fld->mode == 4)) { + if ((fld->vis != 0 && visible)) { + if (fld->vis == 2) { + OPM_SymWInt(((LONGINT)(26))); + } else { + OPM_SymWInt(((LONGINT)(25))); + } + OPT_OutStr(fld->typ); + OPT_OutName((void*)fld->name, ((LONGINT)(256))); + OPM_SymWInt(fld->adr); + } else { + OPT_OutHdFld(fld->typ, fld, fld->adr + adr); + } + fld = fld->link; + } +} + +static void OPT_OutSign (OPT_Struct result, OPT_Object par) +{ + OPT_OutStr(result); + while (par != NIL) { + if (par->mode == 1) { + OPM_SymWInt(((LONGINT)(23))); + } else { + OPM_SymWInt(((LONGINT)(24))); + } + OPT_OutStr(par->typ); + OPM_SymWInt(par->adr); + OPT_OutName((void*)par->name, ((LONGINT)(256))); + par = par->link; + } + OPM_SymWInt(((LONGINT)(18))); +} + +static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj) +{ + if (obj != NIL) { + OPT_OutTProcs(typ, obj->left); + if (obj->mode == 13) { + if ((((typ->BaseTyp != NIL && __ASHR(obj->adr, 16) < typ->BaseTyp->n)) && obj->vis == 0)) { + OPM_Mark(109, typ->txtpos); + } + if (obj->vis != 0) { + if (obj->vis != 0) { + OPM_SymWInt(((LONGINT)(29))); + OPT_OutSign(obj->typ, obj->link); + OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPM_SymWInt(__ASHR(obj->adr, 16)); + } else { + OPM_SymWInt(((LONGINT)(30))); + OPM_SymWInt(__ASHR(obj->adr, 16)); + } + } + } + OPT_OutTProcs(typ, obj->right); + } +} + +static void OPT_OutStr (OPT_Struct typ) +{ + OPT_Object strobj = NIL; + if (typ->ref < OPT_expCtxt.ref) { + OPM_SymWInt(-typ->ref); + } else { + OPM_SymWInt(((LONGINT)(34))); + typ->ref = OPT_expCtxt.ref; + OPT_expCtxt.ref += 1; + if (OPT_expCtxt.ref >= 255) { + OPT_err(228); + } + OPT_OutMod(typ->mno); + strobj = typ->strobj; + if ((strobj != NIL && strobj->name[0] != 0x00)) { + OPT_OutName((void*)strobj->name, ((LONGINT)(256))); + switch (strobj->history) { + case 2: + OPT_FPrintErr(strobj, 252); + break; + case 3: + OPT_FPrintErr(strobj, 251); + break; + case 5: + OPT_FPrintErr(strobj, 249); + break; + default: + break; + } + } else { + OPM_SymWCh(0x00); + } + if (typ->sysflag != 0) { + OPM_SymWInt(((LONGINT)(35))); + OPM_SymWInt(typ->sysflag); + } + switch (typ->form) { + case 13: + OPM_SymWInt(((LONGINT)(36))); + OPT_OutStr(typ->BaseTyp); + break; + case 14: + OPM_SymWInt(((LONGINT)(40))); + OPT_OutSign(typ->BaseTyp, typ->link); + break; + case 15: + switch (typ->comp) { + case 2: + OPM_SymWInt(((LONGINT)(37))); + OPT_OutStr(typ->BaseTyp); + OPM_SymWInt(typ->n); + break; + case 3: + OPM_SymWInt(((LONGINT)(38))); + OPT_OutStr(typ->BaseTyp); + break; + case 4: + OPM_SymWInt(((LONGINT)(39))); + if (typ->BaseTyp == NIL) { + OPT_OutStr(OPT_notyp); + } else { + OPT_OutStr(typ->BaseTyp); + } + OPM_SymWInt(typ->size); + OPM_SymWInt(typ->align); + OPM_SymWInt(typ->n); + OPT_nofhdfld = 0; + OPT_OutFlds(typ->link, ((LONGINT)(0)), 1); + if (OPT_nofhdfld > 2048) { + OPM_Mark(223, typ->txtpos); + } + OPT_OutTProcs(typ, typ->link); + OPM_SymWInt(((LONGINT)(18))); + break; + default: + OPM_LogWStr((CHAR*)"unhandled case at OPT.OutStr, typ^.comp = ", (LONGINT)43); + OPM_LogWNum(typ->comp, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + break; + default: + OPM_LogWStr((CHAR*)"unhandled case at OPT.OutStr, typ^.form = ", (LONGINT)43); + OPM_LogWNum(typ->form, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + } +} + +static void OPT_OutConstant (OPT_Object obj) +{ + INTEGER f; + REAL rval; + f = obj->typ->form; + OPM_SymWInt(f); + switch (f) { + case 2: case 3: + OPM_SymWCh((CHAR)obj->conval->intval); + break; + case 4: case 5: case 6: + OPM_SymWInt(obj->conval->intval); + break; + case 9: + OPM_SymWSet(obj->conval->setval); + break; + case 7: + rval = obj->conval->realval; + OPM_SymWReal(rval); + break; + case 8: + OPM_SymWLReal(obj->conval->realval); + break; + case 10: + OPT_OutName((void*)*obj->conval->ext, ((LONGINT)(256))); + break; + case 11: + break; + default: + OPT_err(127); + break; + } +} + +static void OPT_OutObj (OPT_Object obj) +{ + INTEGER i, j; + OPT_ConstExt ext = NIL; + if (obj != NIL) { + OPT_OutObj(obj->left); + if (__IN(obj->mode, 0x06ea)) { + if (obj->history == 4) { + OPT_FPrintErr(obj, 250); + } else if (obj->vis != 0) { + switch (obj->history) { + case 0: + OPT_FPrintErr(obj, 253); + break; + case 1: + break; + case 2: + OPT_FPrintErr(obj, 252); + break; + case 3: + OPT_FPrintErr(obj, 251); + break; + default: + OPM_LogWStr((CHAR*)"unhandled case at OPT.OutObj, obj^.history = ", (LONGINT)46); + OPM_LogWNum(obj->history, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + switch (obj->mode) { + case 3: + OPT_OutConstant(obj); + OPT_OutName((void*)obj->name, ((LONGINT)(256))); + break; + case 5: + if (obj->typ->strobj == obj) { + OPM_SymWInt(((LONGINT)(19))); + OPT_OutStr(obj->typ); + } else { + OPM_SymWInt(((LONGINT)(20))); + OPT_OutStr(obj->typ); + OPT_OutName((void*)obj->name, ((LONGINT)(256))); + } + break; + case 1: + if (obj->vis == 2) { + OPM_SymWInt(((LONGINT)(22))); + } else { + OPM_SymWInt(((LONGINT)(21))); + } + OPT_OutStr(obj->typ); + OPT_OutName((void*)obj->name, ((LONGINT)(256))); + if (obj->typ->strobj == NIL || obj->typ->strobj->name[0] == 0x00) { + OPM_FPrint(&OPT_expCtxt.reffp, obj->typ->ref); + } + break; + case 7: + OPM_SymWInt(((LONGINT)(31))); + OPT_OutSign(obj->typ, obj->link); + OPT_OutName((void*)obj->name, ((LONGINT)(256))); + break; + case 10: + OPM_SymWInt(((LONGINT)(32))); + OPT_OutSign(obj->typ, obj->link); + OPT_OutName((void*)obj->name, ((LONGINT)(256))); + break; + case 9: + OPM_SymWInt(((LONGINT)(33))); + OPT_OutSign(obj->typ, obj->link); + ext = obj->conval->ext; + j = (int)(*ext)[0]; + i = 1; + OPM_SymWInt(j); + while (i <= j) { + OPM_SymWCh((*ext)[__X(i, ((LONGINT)(256)))]); + i += 1; + } + OPT_OutName((void*)obj->name, ((LONGINT)(256))); + break; + default: + OPM_LogWStr((CHAR*)"unhandled case at OPT.OutObj, obj.mode = ", (LONGINT)42); + OPM_LogWNum(obj->mode, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + } + } + OPT_OutObj(obj->right); + } +} + +void OPT_Export (BOOLEAN *ext, BOOLEAN *new) +{ + INTEGER i; + SHORTINT nofmod; + BOOLEAN done; + OPT_symExtended = 0; + OPT_symNew = 0; + nofmod = OPT_nofGmod; + OPT_Import((CHAR*)"@self", OPT_SelfName, &done); + OPT_nofGmod = nofmod; + if (OPM_noerr) { + OPM_NewSym((void*)OPT_SelfName, ((LONGINT)(256))); + if (OPM_noerr) { + OPM_SymWInt(((LONGINT)(16))); + OPT_OutName((void*)OPT_SelfName, ((LONGINT)(256))); + OPT_expCtxt.reffp = 0; + OPT_expCtxt.ref = 16; + OPT_expCtxt.nofm = 1; + OPT_expCtxt.locmno[0] = 0; + i = 1; + while (i < 64) { + OPT_expCtxt.locmno[__X(i, ((LONGINT)(64)))] = -1; + i += 1; + } + OPT_OutObj(OPT_topScope->right); + *ext = (OPT_sfpresent && OPT_symExtended); + *new = !OPT_sfpresent || OPT_symNew; + if (OPM_forceNewSym) { + *new = 1; + } + if ((((OPM_noerr && OPT_sfpresent)) && OPT_impCtxt.reffp != OPT_expCtxt.reffp)) { + *new = 1; + if (!OPT_extsf) { + OPT_err(155); + } + } + OPT_newsf = 0; + OPT_symNew = 0; + if (!OPM_noerr || OPT_findpc) { + OPM_DeleteNewSym(); + } + } + } +} + +static void OPT_InitStruct (OPT_Struct *typ, SHORTINT form) +{ + *typ = OPT_NewStr(form, 1); + (*typ)->ref = form; + (*typ)->size = OPM_ByteSize; + (*typ)->allocated = 1; + (*typ)->strobj = OPT_NewObj(); + (*typ)->pbfp = form; + (*typ)->pvfp = form; + (*typ)->fpdone = 1; + (*typ)->idfp = form; + (*typ)->idfpdone = 1; +} + +static void OPT_EnterBoolConst (OPS_Name name, LONGINT value) +{ + OPT_Object obj = NIL; + OPS_Name name__copy; + __DUPARR(name, OPS_Name); + OPT_Insert(name, &obj); + obj->conval = OPT_NewConst(); + obj->mode = 3; + obj->typ = OPT_booltyp; + obj->conval->intval = value; +} + +static void OPT_EnterTyp (OPS_Name name, SHORTINT form, INTEGER size, OPT_Struct *res) +{ + OPT_Object obj = NIL; + OPT_Struct typ = NIL; + OPS_Name name__copy; + __DUPARR(name, OPS_Name); + OPT_Insert(name, &obj); + typ = OPT_NewStr(form, 1); + obj->mode = 5; + obj->typ = typ; + obj->vis = 1; + typ->strobj = obj; + typ->size = size; + typ->ref = form; + typ->allocated = 1; + typ->pbfp = form; + typ->pvfp = form; + typ->fpdone = 1; + typ->idfp = form; + typ->idfpdone = 1; + *res = typ; +} + +static void OPT_EnterProc (OPS_Name name, INTEGER num) +{ + OPT_Object obj = NIL; + OPS_Name name__copy; + __DUPARR(name, OPS_Name); + OPT_Insert(name, &obj); + obj->mode = 8; + obj->typ = OPT_notyp; + obj->adr = num; +} + +static void EnumPtrs(void (*P)(void*)) +{ + P(OPT_topScope); + P(OPT_undftyp); + P(OPT_bytetyp); + P(OPT_booltyp); + P(OPT_chartyp); + P(OPT_sinttyp); + P(OPT_inttyp); + P(OPT_linttyp); + P(OPT_realtyp); + P(OPT_lrltyp); + P(OPT_settyp); + P(OPT_stringtyp); + P(OPT_niltyp); + P(OPT_notyp); + P(OPT_sysptrtyp); + __ENUMP(OPT_GlbMod, 64, P); + P(OPT_universe); + P(OPT_syslink); + __ENUMR(&OPT_impCtxt, OPT_ImpCtxt__typ, 3140, 1, P); +} + +__TDESC(OPT_ConstDesc, 1, 1) = {__TDFLDS("ConstDesc", 24), {0, -8}}; +__TDESC(OPT_ObjDesc, 1, 6) = {__TDFLDS("ObjDesc", 304), {0, 4, 8, 12, 284, 288, -28}}; +__TDESC(OPT_StrDesc, 1, 3) = {__TDFLDS("StrDesc", 56), {44, 48, 52, -16}}; +__TDESC(OPT_NodeDesc, 1, 6) = {__TDFLDS("NodeDesc", 28), {0, 4, 8, 16, 20, 24, -28}}; +__TDESC(OPT_ImpCtxt, 1, 510) = {__TDFLDS("ImpCtxt", 3140), {16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60, 64, 68, 72, 76, + 80, 84, 88, 92, 96, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, + 144, 148, 152, 156, 160, 164, 168, 172, 176, 180, 184, 188, 192, 196, 200, 204, + 208, 212, 216, 220, 224, 228, 232, 236, 240, 244, 248, 252, 256, 260, 264, 268, + 272, 276, 280, 284, 288, 292, 296, 300, 304, 308, 312, 316, 320, 324, 328, 332, + 336, 340, 344, 348, 352, 356, 360, 364, 368, 372, 376, 380, 384, 388, 392, 396, + 400, 404, 408, 412, 416, 420, 424, 428, 432, 436, 440, 444, 448, 452, 456, 460, + 464, 468, 472, 476, 480, 484, 488, 492, 496, 500, 504, 508, 512, 516, 520, 524, + 528, 532, 536, 540, 544, 548, 552, 556, 560, 564, 568, 572, 576, 580, 584, 588, + 592, 596, 600, 604, 608, 612, 616, 620, 624, 628, 632, 636, 640, 644, 648, 652, + 656, 660, 664, 668, 672, 676, 680, 684, 688, 692, 696, 700, 704, 708, 712, 716, + 720, 724, 728, 732, 736, 740, 744, 748, 752, 756, 760, 764, 768, 772, 776, 780, + 784, 788, 792, 796, 800, 804, 808, 812, 816, 820, 824, 828, 832, 836, 840, 844, + 848, 852, 856, 860, 864, 868, 872, 876, 880, 884, 888, 892, 896, 900, 904, 908, + 912, 916, 920, 924, 928, 932, 936, 940, 944, 948, 952, 956, 960, 964, 968, 972, + 976, 980, 984, 988, 992, 996, 1000, 1004, 1008, 1012, 1016, 1020, 1024, 1028, 1032, 1036, + 1040, 1044, 1048, 1052, 1056, 1060, 1064, 1068, 1072, 1076, 1080, 1084, 1088, 1092, 1096, 1100, + 1104, 1108, 1112, 1116, 1120, 1124, 1128, 1132, 1136, 1140, 1144, 1148, 1152, 1156, 1160, 1164, + 1168, 1172, 1176, 1180, 1184, 1188, 1192, 1196, 1200, 1204, 1208, 1212, 1216, 1220, 1224, 1228, + 1232, 1236, 1240, 1244, 1248, 1252, 1256, 1260, 1264, 1268, 1272, 1276, 1280, 1284, 1288, 1292, + 1296, 1300, 1304, 1308, 1312, 1316, 1320, 1324, 1328, 1332, 1336, 1340, 1344, 1348, 1352, 1356, + 1360, 1364, 1368, 1372, 1376, 1380, 1384, 1388, 1392, 1396, 1400, 1404, 1408, 1412, 1416, 1420, + 1424, 1428, 1432, 1436, 1440, 1444, 1448, 1452, 1456, 1460, 1464, 1468, 1472, 1476, 1480, 1484, + 1488, 1492, 1496, 1500, 1504, 1508, 1512, 1516, 1520, 1524, 1528, 1532, 1536, 1540, 1544, 1548, + 1552, 1556, 1560, 1564, 1568, 1572, 1576, 1580, 1584, 1588, 1592, 1596, 1600, 1604, 1608, 1612, + 1616, 1620, 1624, 1628, 1632, 1636, 1640, 1644, 1648, 1652, 1656, 1660, 1664, 1668, 1672, 1676, + 1680, 1684, 1688, 1692, 1696, 1700, 1704, 1708, 1712, 1716, 1720, 1724, 1728, 1732, 1736, 1740, + 1744, 1748, 1752, 1756, 1760, 1764, 1768, 1772, 1776, 1780, 1784, 1788, 1792, 1796, 1800, 1804, + 1808, 1812, 1816, 1820, 1824, 1828, 1832, 1836, 1840, 1844, 1848, 1852, 1856, 1860, 1864, 1868, + 1872, 1876, 1880, 1884, 1888, 1892, 1896, 1900, 1904, 1908, 1912, 1916, 1920, 1924, 1928, 1932, + 1936, 1940, 1944, 1948, 1952, 1956, 1960, 1964, 1968, 1972, 1976, 1980, 1984, 1988, 1992, 1996, + 2000, 2004, 2008, 2012, 2016, 2020, 2024, 2028, 2032, 2036, 2040, 2044, 2048, 2052, -2044}}; +__TDESC(OPT_ExpCtxt, 1, 0) = {__TDFLDS("ExpCtxt", 72), {-4}}; + +export void *OPT__init(void) +{ + __DEFMOD; + __MODULE_IMPORT(OPM); + __MODULE_IMPORT(OPS); + __REGMOD("OPT", EnumPtrs); + __REGCMD("Close", OPT_Close); + __REGCMD("CloseScope", OPT_CloseScope); + __INITYP(OPT_ConstDesc, OPT_ConstDesc, 0); + __INITYP(OPT_ObjDesc, OPT_ObjDesc, 0); + __INITYP(OPT_StrDesc, OPT_StrDesc, 0); + __INITYP(OPT_NodeDesc, OPT_NodeDesc, 0); + __INITYP(OPT_ImpCtxt, OPT_ImpCtxt, 0); + __INITYP(OPT_ExpCtxt, OPT_ExpCtxt, 0); +/* BEGIN */ + OPT_topScope = NIL; + OPT_OpenScope(0, NIL); + OPM_errpos = 0; + OPT_InitStruct(&OPT_undftyp, 0); + OPT_InitStruct(&OPT_notyp, 12); + OPT_InitStruct(&OPT_stringtyp, 10); + OPT_InitStruct(&OPT_niltyp, 11); + OPT_undftyp->BaseTyp = OPT_undftyp; + OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp); + OPT_EnterTyp((CHAR*)"PTR", 13, OPM_PointerSize, &OPT_sysptrtyp); + OPT_EnterProc((CHAR*)"ADR", 20); + OPT_EnterProc((CHAR*)"CC", 21); + OPT_EnterProc((CHAR*)"LSH", 22); + OPT_EnterProc((CHAR*)"ROT", 23); + OPT_EnterProc((CHAR*)"GET", 24); + OPT_EnterProc((CHAR*)"PUT", 25); + OPT_EnterProc((CHAR*)"GETREG", 26); + OPT_EnterProc((CHAR*)"PUTREG", 27); + OPT_EnterProc((CHAR*)"BIT", 28); + OPT_EnterProc((CHAR*)"VAL", 29); + OPT_EnterProc((CHAR*)"NEW", 30); + OPT_EnterProc((CHAR*)"MOVE", 31); + OPT_syslink = OPT_topScope->right; + OPT_universe = OPT_topScope; + OPT_topScope->right = NIL; + OPT_EnterTyp((CHAR*)"CHAR", 3, OPM_CharSize, &OPT_chartyp); + OPT_EnterTyp((CHAR*)"SET", 9, OPM_SetSize, &OPT_settyp); + OPT_EnterTyp((CHAR*)"REAL", 7, OPM_RealSize, &OPT_realtyp); + OPT_EnterTyp((CHAR*)"INTEGER", 5, OPM_IntSize, &OPT_inttyp); + OPT_EnterTyp((CHAR*)"LONGINT", 6, OPM_LIntSize, &OPT_linttyp); + OPT_EnterTyp((CHAR*)"LONGREAL", 8, OPM_LRealSize, &OPT_lrltyp); + OPT_EnterTyp((CHAR*)"SHORTINT", 4, OPM_SIntSize, &OPT_sinttyp); + OPT_EnterTyp((CHAR*)"BOOLEAN", 2, OPM_BoolSize, &OPT_booltyp); + OPT_EnterBoolConst((CHAR*)"FALSE", ((LONGINT)(0))); + OPT_EnterBoolConst((CHAR*)"TRUE", ((LONGINT)(1))); + OPT_EnterProc((CHAR*)"HALT", 0); + OPT_EnterProc((CHAR*)"NEW", 1); + OPT_EnterProc((CHAR*)"ABS", 2); + OPT_EnterProc((CHAR*)"CAP", 3); + OPT_EnterProc((CHAR*)"ORD", 4); + OPT_EnterProc((CHAR*)"ENTIER", 5); + OPT_EnterProc((CHAR*)"ODD", 6); + OPT_EnterProc((CHAR*)"MIN", 7); + OPT_EnterProc((CHAR*)"MAX", 8); + OPT_EnterProc((CHAR*)"CHR", 9); + OPT_EnterProc((CHAR*)"SHORT", 10); + OPT_EnterProc((CHAR*)"LONG", 11); + OPT_EnterProc((CHAR*)"SIZE", 12); + OPT_EnterProc((CHAR*)"INC", 13); + OPT_EnterProc((CHAR*)"DEC", 14); + OPT_EnterProc((CHAR*)"INCL", 15); + OPT_EnterProc((CHAR*)"EXCL", 16); + OPT_EnterProc((CHAR*)"LEN", 17); + OPT_EnterProc((CHAR*)"COPY", 18); + OPT_EnterProc((CHAR*)"ASH", 19); + OPT_EnterProc((CHAR*)"ASSERT", 32); + OPT_impCtxt.ref[0] = OPT_undftyp; + OPT_impCtxt.ref[1] = OPT_bytetyp; + OPT_impCtxt.ref[2] = OPT_booltyp; + OPT_impCtxt.ref[3] = OPT_chartyp; + OPT_impCtxt.ref[4] = OPT_sinttyp; + OPT_impCtxt.ref[5] = OPT_inttyp; + OPT_impCtxt.ref[6] = OPT_linttyp; + OPT_impCtxt.ref[7] = OPT_realtyp; + OPT_impCtxt.ref[8] = OPT_lrltyp; + OPT_impCtxt.ref[9] = OPT_settyp; + OPT_impCtxt.ref[10] = OPT_stringtyp; + OPT_impCtxt.ref[11] = OPT_niltyp; + OPT_impCtxt.ref[12] = OPT_notyp; + OPT_impCtxt.ref[13] = OPT_sysptrtyp; + __ENDMOD; +} diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h new file mode 100644 index 00000000..1a22d0df --- /dev/null +++ b/bootstrap/windows-48/OPT.h @@ -0,0 +1,105 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ + +#ifndef OPT__h +#define OPT__h + +#include "SYSTEM.h" +#include "OPS.h" + +typedef + struct OPT_ConstDesc *OPT_Const; + +typedef + OPS_String *OPT_ConstExt; + +typedef + struct OPT_ConstDesc { + OPT_ConstExt ext; + LONGINT intval, intval2; + SET setval; + LONGREAL realval; + } OPT_ConstDesc; + +typedef + struct OPT_NodeDesc *OPT_Node; + +typedef + struct OPT_StrDesc *OPT_Struct; + +typedef + struct OPT_ObjDesc *OPT_Object; + +typedef + struct OPT_NodeDesc { + OPT_Node left, right, link; + SHORTINT class, subcl; + BOOLEAN readonly; + OPT_Struct typ; + OPT_Object obj; + OPT_Const conval; + } OPT_NodeDesc; + +typedef + struct OPT_ObjDesc { + OPT_Object left, right, link, scope; + OPS_Name name; + BOOLEAN leaf; + SHORTINT mode, mnolev, vis, history; + BOOLEAN used, fpdone; + LONGINT fprint; + OPT_Struct typ; + OPT_Const conval; + LONGINT adr, linkadr; + INTEGER x; + } OPT_ObjDesc; + +typedef + struct OPT_StrDesc { + SHORTINT form, comp, mno, extlev; + INTEGER ref, sysflag; + LONGINT n, size, align, txtpos; + BOOLEAN allocated, pbused, pvused; + char _prvt0[8]; + LONGINT pbfp, pvfp; + OPT_Struct BaseTyp; + OPT_Object link, strobj; + } OPT_StrDesc; + + +import void (*OPT_typSize)(OPT_Struct); +import OPT_Object OPT_topScope; +import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +import SHORTINT OPT_nofGmod; +import OPT_Object OPT_GlbMod[64]; +import OPS_Name OPT_SelfName; +import BOOLEAN OPT_SYSimported; + +import LONGINT *OPT_ConstDesc__typ; +import LONGINT *OPT_ObjDesc__typ; +import LONGINT *OPT_StrDesc__typ; +import LONGINT *OPT_NodeDesc__typ; + +import void OPT_Close (void); +import void OPT_CloseScope (void); +import void OPT_Export (BOOLEAN *ext, BOOLEAN *new); +import void OPT_FPrintErr (OPT_Object obj, INTEGER errcode); +import void OPT_FPrintObj (OPT_Object obj); +import void OPT_FPrintStr (OPT_Struct typ); +import void OPT_Find (OPT_Object *res); +import void OPT_FindField (OPS_Name name, OPT_Struct typ, OPT_Object *res); +import void OPT_FindImport (OPT_Object mod, OPT_Object *res); +import void OPT_IdFPrint (OPT_Struct typ); +import void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); +import void OPT_Init (OPS_Name name, SET opt); +import void OPT_Insert (OPS_Name name, OPT_Object *obj); +import void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); +import OPT_Const OPT_NewConst (void); +import OPT_ConstExt OPT_NewExt (void); +import OPT_Node OPT_NewNode (SHORTINT class); +import OPT_Object OPT_NewObj (void); +import OPT_Struct OPT_NewStr (SHORTINT form, SHORTINT comp); +import void OPT_OpenScope (SHORTINT level, OPT_Object owner); +import void *OPT__init(void); + + +#endif diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c new file mode 100644 index 00000000..572285dc --- /dev/null +++ b/bootstrap/windows-48/OPV.c @@ -0,0 +1,1688 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +#include "SYSTEM.h" +#include "OPC.h" +#include "OPM.h" +#include "OPS.h" +#include "OPT.h" + +typedef + struct OPV_ExitInfo { + INTEGER level, label; + } OPV_ExitInfo; + + +static BOOLEAN OPV_assert, OPV_inxchk, OPV_mainprog, OPV_ansi; +static INTEGER OPV_stamp; +static LONGINT OPV_recno; +static OPV_ExitInfo OPV_exit; +static INTEGER OPV_nofExitLabels; +static BOOLEAN OPV_naturalAlignment; + +export LONGINT *OPV_ExitInfo__typ; + +static void OPV_ActualPar (OPT_Node n, OPT_Object fp); +export void OPV_AdrAndSize (OPT_Object topScope); +static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc); +static void OPV_Convert (OPT_Node n, INTEGER form, INTEGER prec); +static void OPV_DefineTDescs (OPT_Node n); +static void OPV_Entier (OPT_Node n, INTEGER prec); +static void OPV_GetTProcNum (OPT_Object obj); +static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc); +static BOOLEAN OPV_ImplicitReturn (OPT_Node n); +static void OPV_Index (OPT_Node n, OPT_Node d, INTEGER prec, INTEGER dim); +export void OPV_Init (void); +static void OPV_InitTDescs (OPT_Node n); +static void OPV_Len (OPT_Node n, LONGINT dim); +export void OPV_Module (OPT_Node prog); +static LONGINT OPV_NaturalAlignment (LONGINT size, LONGINT max); +static void OPV_NewArr (OPT_Node d, OPT_Node x); +static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, INTEGER comp); +static BOOLEAN OPV_SideEffects (OPT_Node n); +static void OPV_Stamp (OPS_Name s); +static OPT_Object OPV_SuperProc (OPT_Node n); +static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported); +static void OPV_TraverseRecord (OPT_Struct typ); +export void OPV_TypSize (OPT_Struct typ); +static void OPV_TypeOf (OPT_Node n); +static void OPV_design (OPT_Node n, INTEGER prec); +static void OPV_expr (OPT_Node n, INTEGER prec); +static void OPV_stat (OPT_Node n, OPT_Object outerProc); + + +static LONGINT OPV_NaturalAlignment (LONGINT size, LONGINT max) +{ + LONGINT _o_result; + LONGINT i; + if (size >= max) { + _o_result = max; + return _o_result; + } else { + i = 1; + while (i < size) { + i += i; + } + _o_result = i; + return _o_result; + } + __RETCHK; +} + +void OPV_TypSize (OPT_Struct typ) +{ + INTEGER f, c; + LONGINT offset, size, base, fbase, off0; + OPT_Object fld = NIL; + OPT_Struct btyp = NIL; + if (typ == OPT_undftyp) { + OPM_err(58); + } else if (typ->size == -1) { + f = typ->form; + c = typ->comp; + if (c == 4) { + btyp = typ->BaseTyp; + if (btyp == NIL) { + offset = 0; + base = OPM_RecAlign; + } else { + OPV_TypSize(btyp); + offset = btyp->size - (LONGINT)__ASHR(btyp->sysflag, 8); + base = btyp->align; + } + fld = typ->link; + while ((fld != NIL && fld->mode == 4)) { + btyp = fld->typ; + OPV_TypSize(btyp); + size = btyp->size; + fbase = OPC_Base(btyp); + OPC_Align(&offset, fbase); + fld->adr = offset; + offset += size; + if (fbase > base) { + base = fbase; + } + fld = fld->link; + } + off0 = offset; + if (offset == 0) { + offset = 1; + } + if (OPM_RecSize == 0) { + base = OPV_NaturalAlignment(offset, OPM_RecAlign); + } + OPC_Align(&offset, base); + if ((typ->strobj == NIL && __MASK(typ->align, -65536) == 0)) { + OPV_recno += 1; + base += __ASHL(OPV_recno, 16); + } + typ->size = offset; + typ->align = base; + typ->sysflag = __MASK(typ->sysflag, -256) + (int)__ASHL(offset - off0, 8); + } else if (c == 2) { + OPV_TypSize(typ->BaseTyp); + typ->size = typ->n * typ->BaseTyp->size; + } else if (f == 13) { + typ->size = OPM_PointerSize; + if (typ->BaseTyp == OPT_undftyp) { + OPM_Mark(128, typ->n); + } else { + OPV_TypSize(typ->BaseTyp); + } + } else if (f == 14) { + typ->size = OPM_ProcSize; + } else if (c == 3) { + btyp = typ->BaseTyp; + OPV_TypSize(btyp); + if (btyp->comp == 3) { + typ->size = btyp->size + 4; + } else { + typ->size = 8; + } + } + } +} + +void OPV_Init (void) +{ + OPV_stamp = 0; + OPV_recno = 0; + OPV_nofExitLabels = 0; + OPV_assert = __IN(7, OPM_opt); + OPV_inxchk = __IN(0, OPM_opt); + OPV_mainprog = __IN(10, OPM_opt); + OPV_ansi = __IN(6, OPM_opt); +} + +static void OPV_GetTProcNum (OPT_Object obj) +{ + LONGINT oldPos; + OPT_Struct typ = NIL; + OPT_Object redef = NIL; + oldPos = OPM_errpos; + OPM_errpos = obj->scope->adr; + typ = obj->link->typ; + if (typ->form == 13) { + typ = typ->BaseTyp; + } + OPT_FindField(obj->name, typ->BaseTyp, &redef); + if (redef != NIL) { + obj->adr = __ASHL(__ASHR(redef->adr, 16), 16); + if (!__IN(2, obj->conval->setval)) { + OPM_err(119); + } + } else { + obj->adr += __ASHL(typ->n, 16); + typ->n += 1; + } + OPM_errpos = oldPos; +} + +static void OPV_TraverseRecord (OPT_Struct typ) +{ + if (!typ->allocated) { + if (typ->BaseTyp != NIL) { + OPV_TraverseRecord(typ->BaseTyp); + typ->n = typ->BaseTyp->n; + } + typ->allocated = 1; + OPV_Traverse(typ->link, typ->strobj, 0); + } +} + +static void OPV_Stamp (OPS_Name s) +{ + INTEGER i, j, k; + CHAR n[10]; + OPV_stamp += 1; + i = 0; + j = OPV_stamp; + while (s[__X(i, ((LONGINT)(256)))] != 0x00) { + i += 1; + } + if (i > 25) { + i = 25; + } + s[__X(i, ((LONGINT)(256)))] = '_'; + s[__X(i + 1, ((LONGINT)(256)))] = '_'; + i += 2; + k = 0; + do { + n[__X(k, ((LONGINT)(10)))] = (CHAR)((int)__MOD(j, 10) + 48); + j = __DIV(j, 10); + k += 1; + } while (!(j == 0)); + do { + k -= 1; + s[__X(i, ((LONGINT)(256)))] = n[__X(k, ((LONGINT)(10)))]; + i += 1; + } while (!(k == 0)); + s[__X(i, ((LONGINT)(256)))] = 0x00; +} + +static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported) +{ + INTEGER mode; + OPT_Object scope = NIL; + OPT_Struct typ = NIL; + if (obj != NIL) { + OPV_Traverse(obj->left, outerScope, exported); + if (obj->name[0] == '@') { + obj->name[0] = '_'; + OPV_Stamp(obj->name); + } + obj->linkadr = 0; + mode = obj->mode; + if ((mode == 5 && (obj->vis != 0) == exported)) { + typ = obj->typ; + OPV_TypSize(obj->typ); + if (typ->form == 13) { + typ = typ->BaseTyp; + } + if (typ->comp == 4) { + OPV_TraverseRecord(typ); + } + } else if (mode == 13) { + OPV_GetTProcNum(obj); + } else if (mode == 1) { + OPV_TypSize(obj->typ); + } + if (!exported) { + if ((__IN(mode, 0x60) && obj->mnolev > 0)) { + OPV_Stamp(obj->name); + } + if (__IN(mode, 0x26)) { + obj->scope = outerScope; + } else if (__IN(mode, 0x26c0)) { + if (obj->conval->setval == 0x0) { + OPM_err(129); + } + scope = obj->scope; + scope->leaf = 1; + __COPY(obj->name, scope->name, ((LONGINT)(256))); + OPV_Stamp(scope->name); + if (mode == 9) { + obj->adr = 1; + } + if (scope->mnolev > 1) { + outerScope->leaf = 0; + } + OPV_Traverse(obj->scope->right, obj->scope, 0); + } + } + OPV_Traverse(obj->right, outerScope, exported); + } +} + +void OPV_AdrAndSize (OPT_Object topScope) +{ + OPM_errpos = topScope->adr; + topScope->leaf = 1; + OPV_Traverse(topScope->right, topScope, 1); + OPV_Traverse(topScope->right, topScope, 0); + OPT_chartyp->strobj->linkadr = 2; + OPT_settyp->strobj->linkadr = 2; + OPT_realtyp->strobj->linkadr = 2; + OPT_inttyp->strobj->linkadr = 2; + OPT_linttyp->strobj->linkadr = 2; + OPT_lrltyp->strobj->linkadr = 2; + OPT_sinttyp->strobj->linkadr = 2; + OPT_booltyp->strobj->linkadr = 2; + OPT_bytetyp->strobj->linkadr = 2; + OPT_sysptrtyp->strobj->linkadr = 2; +} + +static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, INTEGER comp) +{ + INTEGER _o_result; + switch (class) { + case 7: case 0: case 2: case 4: case 9: + case 13: + _o_result = 10; + return _o_result; + break; + case 5: + if (__IN(3, OPM_opt)) { + _o_result = 10; + return _o_result; + } else { + _o_result = 9; + return _o_result; + } + break; + case 1: + if (__IN(comp, 0x0c)) { + _o_result = 10; + return _o_result; + } else { + _o_result = 9; + return _o_result; + } + break; + case 3: + _o_result = 9; + return _o_result; + break; + case 11: + switch (subclass) { + case 33: case 7: case 24: case 29: case 20: + _o_result = 9; + return _o_result; + break; + case 16: case 21: case 22: case 23: case 25: + _o_result = 10; + return _o_result; + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence Nmop, subclass = ", (LONGINT)51); + OPM_LogWNum(subclass, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + break; + case 12: + switch (subclass) { + case 1: + if (form == 9) { + _o_result = 4; + return _o_result; + } else { + _o_result = 8; + return _o_result; + } + break; + case 2: + if (form == 9) { + _o_result = 3; + return _o_result; + } else { + _o_result = 8; + return _o_result; + } + break; + case 3: case 4: + _o_result = 10; + return _o_result; + break; + case 6: + if (form == 9) { + _o_result = 2; + return _o_result; + } else { + _o_result = 7; + return _o_result; + } + break; + case 7: + if (form == 9) { + _o_result = 4; + return _o_result; + } else { + _o_result = 7; + return _o_result; + } + break; + case 11: case 12: case 13: case 14: + _o_result = 6; + return _o_result; + break; + case 9: case 10: + _o_result = 5; + return _o_result; + break; + case 5: + _o_result = 1; + return _o_result; + break; + case 8: + _o_result = 0; + return _o_result; + break; + case 19: case 15: case 17: case 18: case 26: + case 27: case 28: + _o_result = 10; + return _o_result; + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence Ndop, subclass = ", (LONGINT)51); + OPM_LogWNum(subclass, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + break; + case 10: + _o_result = 10; + return _o_result; + break; + case 8: case 6: + _o_result = 12; + return _o_result; + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence, class = ", (LONGINT)43); + OPM_LogWNum(class, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + __RETCHK; +} + +static void OPV_Len (OPT_Node n, LONGINT dim) +{ + while ((n->class == 4 && n->typ->comp == 3)) { + dim += 1; + n = n->left; + } + if ((n->class == 3 && n->typ->comp == 3)) { + OPV_design(n->left, 10); + OPM_WriteString((CHAR*)"->len[", (LONGINT)7); + OPM_WriteInt(dim); + OPM_Write(']'); + } else { + OPC_Len(n->obj, n->typ, dim); + } +} + +static BOOLEAN OPV_SideEffects (OPT_Node n) +{ + BOOLEAN _o_result; + if (n != NIL) { + _o_result = (n->class == 13 || OPV_SideEffects(n->left)) || OPV_SideEffects(n->right); + return _o_result; + } else { + _o_result = 0; + return _o_result; + } + __RETCHK; +} + +static void OPV_Entier (OPT_Node n, INTEGER prec) +{ + if (__IN(n->typ->form, 0x0180)) { + OPM_WriteString((CHAR*)"__ENTIER(", (LONGINT)10); + OPV_expr(n, -1); + OPM_Write(')'); + } else { + OPV_expr(n, prec); + } +} + +static void OPV_Convert (OPT_Node n, INTEGER form, INTEGER prec) +{ + INTEGER from; + from = n->typ->form; + if (form == 9) { + OPM_WriteString((CHAR*)"__SETOF(", (LONGINT)9); + OPV_Entier(n, -1); + OPM_Write(')'); + } else if (form == 6) { + if (from < 6) { + OPM_WriteString((CHAR*)"(LONGINT)", (LONGINT)10); + } + OPV_Entier(n, 9); + } else if (form == 5) { + if (from < 5) { + OPM_WriteString((CHAR*)"(int)", (LONGINT)6); + OPV_expr(n, 9); + } else { + if (__IN(2, OPM_opt)) { + OPM_WriteString((CHAR*)"__SHORT", (LONGINT)8); + if (OPV_SideEffects(n)) { + OPM_Write('F'); + } + OPM_Write('('); + OPV_Entier(n, -1); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteInt(OPM_MaxInt + 1); + OPM_Write(')'); + } else { + OPM_WriteString((CHAR*)"(int)", (LONGINT)6); + OPV_Entier(n, 9); + } + } + } else if (form == 4) { + if (__IN(2, OPM_opt)) { + OPM_WriteString((CHAR*)"__SHORT", (LONGINT)8); + if (OPV_SideEffects(n)) { + OPM_Write('F'); + } + OPM_Write('('); + OPV_Entier(n, -1); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteInt(OPM_MaxSInt + 1); + OPM_Write(')'); + } else { + OPM_WriteString((CHAR*)"(int)", (LONGINT)6); + OPV_Entier(n, 9); + } + } else if (form == 3) { + if (__IN(2, OPM_opt)) { + OPM_WriteString((CHAR*)"__CHR", (LONGINT)6); + if (OPV_SideEffects(n)) { + OPM_Write('F'); + } + OPM_Write('('); + OPV_Entier(n, -1); + OPM_Write(')'); + } else { + OPM_WriteString((CHAR*)"(CHAR)", (LONGINT)7); + OPV_Entier(n, 9); + } + } else { + OPV_expr(n, prec); + } +} + +static void OPV_TypeOf (OPT_Node n) +{ + if (n->typ->form == 13) { + OPM_WriteString((CHAR*)"__TYPEOF(", (LONGINT)10); + OPV_expr(n, -1); + OPM_Write(')'); + } else if (__IN(n->class, 0x15)) { + OPC_Andent(n->typ); + OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + } else if (n->class == 3) { + OPM_WriteString((CHAR*)"__TYPEOF(", (LONGINT)10); + OPV_expr(n->left, -1); + OPM_Write(')'); + } else if (n->class == 5) { + OPV_TypeOf(n->left); + } else if ((n->class == 11 && n->subcl == 29)) { + OPC_TypeOf(n->left->obj); + } else { + OPC_TypeOf(n->obj); + } +} + +static void OPV_Index (OPT_Node n, OPT_Node d, INTEGER prec, INTEGER dim) +{ + if (!OPV_inxchk || (n->right->class == 7 && (n->right->conval->intval == 0 || n->left->typ->comp != 3))) { + OPV_expr(n->right, prec); + } else { + if (OPV_SideEffects(n->right)) { + OPM_WriteString((CHAR*)"__XF(", (LONGINT)6); + } else { + OPM_WriteString((CHAR*)"__X(", (LONGINT)5); + } + OPV_expr(n->right, -1); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPV_Len(d, dim); + OPM_Write(')'); + } +} + +static void OPV_design (OPT_Node n, INTEGER prec) +{ + OPT_Object obj = NIL; + OPT_Struct typ = NIL; + INTEGER class, designPrec, comp; + OPT_Node d = NIL, x = NIL; + INTEGER dims, i, _for__26; + comp = n->typ->comp; + obj = n->obj; + class = n->class; + designPrec = OPV_Precedence(class, n->subcl, n->typ->form, comp); + if ((((((class == 0 && obj->mnolev > 0)) && (int)obj->mnolev != OPM_level)) && prec == 10)) { + designPrec = 9; + } + if (prec > designPrec) { + OPM_Write('('); + } + if (prec == 11) { + OPM_Write('*'); + } + switch (class) { + case 9: + OPC_Ident(n->obj); + break; + case 0: + OPC_CompleteIdent(n->obj); + break; + case 1: + if (!__IN(comp, 0x0c)) { + OPM_Write('*'); + } + OPC_CompleteIdent(n->obj); + break; + case 2: + if (n->left->class == 3) { + OPV_design(n->left->left, designPrec); + OPM_WriteString((CHAR*)"->", (LONGINT)3); + } else { + OPV_design(n->left, designPrec); + OPM_Write('.'); + } + OPC_Ident(n->obj); + break; + case 3: + if (n->typ->comp == 3) { + OPV_design(n->left, 10); + OPM_WriteString((CHAR*)"->data", (LONGINT)7); + } else { + OPM_Write('*'); + OPV_design(n->left, designPrec); + } + break; + case 4: + d = n->left; + if (d->typ->comp == 3) { + dims = 0; + while (d->class == 4) { + d = d->left; + dims += 1; + } + if (n->typ->comp == 3) { + OPM_Write('&'); + } + OPV_design(d, designPrec); + OPM_Write('['); + if (n->typ->comp == 3) { + OPM_Write('('); + } + i = dims; + x = n; + while (x != d) { + if (x->left != d) { + OPV_Index(x, d, 7, i); + OPM_WriteString((CHAR*)" + ", (LONGINT)4); + OPV_Len(d, i); + OPM_WriteString((CHAR*)" * (", (LONGINT)5); + i -= 1; + } else { + OPV_Index(x, d, -1, i); + } + x = x->left; + } + _for__26 = dims; + i = 1; + while (i <= _for__26) { + OPM_Write(')'); + i += 1; + } + if (n->typ->comp == 3) { + OPM_Write(')'); + while ((LONGINT)i < __ASHR(d->typ->size - 4, 2)) { + OPM_WriteString((CHAR*)" * ", (LONGINT)4); + OPV_Len(d, i); + i += 1; + } + } + OPM_Write(']'); + } else { + OPV_design(n->left, designPrec); + OPM_Write('['); + OPV_Index(n, n->left, -1, 0); + OPM_Write(']'); + } + break; + case 5: + typ = n->typ; + obj = n->left->obj; + if (__IN(3, OPM_opt)) { + if (typ->comp == 4) { + OPM_WriteString((CHAR*)"__GUARDR(", (LONGINT)10); + if ((int)obj->mnolev != OPM_level) { + OPM_WriteStringVar((void*)obj->scope->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"__curr->", (LONGINT)9); + OPC_Ident(obj); + } else { + OPC_Ident(obj); + } + } else { + if (typ->BaseTyp->strobj == NIL) { + OPM_WriteString((CHAR*)"__GUARDA(", (LONGINT)10); + } else { + OPM_WriteString((CHAR*)"__GUARDP(", (LONGINT)10); + } + OPV_expr(n->left, -1); + typ = typ->BaseTyp; + } + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPC_Andent(typ); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteInt(typ->extlev); + OPM_Write(')'); + } else { + if (typ->comp == 4) { + OPM_WriteString((CHAR*)"*(", (LONGINT)3); + OPC_Ident(typ->strobj); + OPM_WriteString((CHAR*)"*)", (LONGINT)3); + OPC_CompleteIdent(obj); + } else { + OPM_Write('('); + OPC_Ident(typ->strobj); + OPM_Write(')'); + OPV_expr(n->left, designPrec); + } + } + break; + case 6: + if (__IN(3, OPM_opt)) { + if (n->left->class == 1) { + OPM_WriteString((CHAR*)"__GUARDEQR(", (LONGINT)12); + OPC_CompleteIdent(n->left->obj); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPV_TypeOf(n->left); + } else { + OPM_WriteString((CHAR*)"__GUARDEQP(", (LONGINT)12); + OPV_expr(n->left->left, -1); + } + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPC_Ident(n->left->typ->strobj); + OPM_Write(')'); + } else { + OPV_expr(n->left, -1); + } + break; + case 11: + if (n->subcl == 29) { + OPV_design(n->left, prec); + } + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPV.design, class = ", (LONGINT)39); + OPM_LogWNum(class, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + if (prec > designPrec) { + OPM_Write(')'); + } +} + +static void OPV_ActualPar (OPT_Node n, OPT_Object fp) +{ + OPT_Struct typ = NIL, aptyp = NIL; + INTEGER comp, form, mode, prec, dim; + OPM_Write('('); + while (n != NIL) { + typ = fp->typ; + comp = typ->comp; + form = typ->form; + mode = fp->mode; + prec = -1; + if ((((mode == 2 && n->class == 11)) && n->subcl == 29)) { + OPM_Write('('); + OPC_Ident(n->typ->strobj); + OPM_WriteString((CHAR*)"*)", (LONGINT)3); + prec = 10; + } + if (!__IN(n->typ->comp, 0x0c)) { + if (mode == 2) { + if ((OPV_ansi && typ != n->typ)) { + OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + } + OPM_Write('&'); + prec = 9; + } else if (OPV_ansi) { + if ((__IN(comp, 0x0c) && n->class == 7)) { + OPM_WriteString((CHAR*)"(CHAR*)", (LONGINT)8); + } else if ((((form == 13 && typ != n->typ)) && n->typ != OPT_niltyp)) { + OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + } + } else { + if ((__IN(form, 0x0180) && __IN(n->typ->form, 0x70))) { + OPM_WriteString((CHAR*)"(double)", (LONGINT)9); + prec = 9; + } else if ((form == 6 && n->typ->form < 6)) { + OPM_WriteString((CHAR*)"(LONGINT)", (LONGINT)10); + prec = 9; + } + } + } else if (OPV_ansi) { + if ((((mode == 2 && typ != n->typ)) && prec == -1)) { + OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + } + } + if ((((mode == 2 && n->class == 11)) && n->subcl == 29)) { + OPV_expr(n->left, prec); + } else if ((((((form == 6 && n->class == 7)) && n->conval->intval <= OPM_MaxInt)) && n->conval->intval >= OPM_MinInt)) { + OPM_WriteString((CHAR*)"((LONGINT)(", (LONGINT)12); + OPV_expr(n, prec); + OPM_WriteString((CHAR*)"))", (LONGINT)3); + } else { + OPV_expr(n, prec); + } + if ((comp == 4 && mode == 2)) { + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPV_TypeOf(n); + } else if (comp == 3) { + if (n->class == 7) { + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)"(LONGINT)", (LONGINT)10); + OPM_WriteInt(n->conval->intval2); + } else { + aptyp = n->typ; + dim = 0; + while ((typ->comp == 3 && typ->BaseTyp->form != 1)) { + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPV_Len(n, dim); + typ = typ->BaseTyp; + aptyp = aptyp->BaseTyp; + dim += 1; + } + if ((typ->comp == 3 && typ->BaseTyp->form == 1)) { + OPM_WriteString((CHAR*)", ", (LONGINT)3); + while (aptyp->comp == 3) { + OPV_Len(n, dim); + OPM_WriteString((CHAR*)" * ", (LONGINT)4); + dim += 1; + aptyp = aptyp->BaseTyp; + } + OPM_WriteString((CHAR*)"((LONGINT)(", (LONGINT)12); + OPM_WriteInt(aptyp->size); + OPM_WriteString((CHAR*)"))", (LONGINT)3); + } + } + } + n = n->link; + fp = fp->link; + if (n != NIL) { + OPM_WriteString((CHAR*)", ", (LONGINT)3); + } + } + OPM_Write(')'); +} + +static OPT_Object OPV_SuperProc (OPT_Node n) +{ + OPT_Object _o_result; + OPT_Object obj = NIL; + OPT_Struct typ = NIL; + typ = n->right->typ; + if (typ->form == 13) { + typ = typ->BaseTyp; + } + OPT_FindField(n->left->obj->name, typ->BaseTyp, &obj); + _o_result = obj; + return _o_result; +} + +static void OPV_expr (OPT_Node n, INTEGER prec) +{ + INTEGER class, subclass, form, exprPrec; + OPT_Struct typ = NIL; + OPT_Node l = NIL, r = NIL; + OPT_Object proc = NIL; + class = n->class; + subclass = n->subcl; + form = n->typ->form; + l = n->left; + r = n->right; + exprPrec = OPV_Precedence(class, subclass, form, n->typ->comp); + if ((exprPrec <= prec && __IN(class, 0x3ce0))) { + OPM_Write('('); + } + switch (class) { + case 7: + OPC_Constant(n->conval, form); + break; + case 10: + OPM_WriteString((CHAR*)"__SETRNG(", (LONGINT)10); + OPV_expr(l, -1); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPV_expr(r, -1); + OPM_Write(')'); + break; + case 11: + switch (subclass) { + case 33: + OPM_Write('!'); + OPV_expr(l, exprPrec); + break; + case 7: + if (form == 9) { + OPM_Write('~'); + } else { + OPM_Write('-'); + } + OPV_expr(l, exprPrec); + break; + case 16: + typ = n->obj->typ; + if (l->typ->comp == 4) { + OPM_WriteString((CHAR*)"__IS(", (LONGINT)6); + OPC_TypeOf(l->obj); + } else { + OPM_WriteString((CHAR*)"__ISP(", (LONGINT)7); + OPV_expr(l, -1); + typ = typ->BaseTyp; + } + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPC_Andent(typ); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteInt(typ->extlev); + OPM_Write(')'); + break; + case 20: + OPV_Convert(l, form, exprPrec); + break; + case 21: + if (OPV_SideEffects(l)) { + if (l->typ->form < 7) { + if (l->typ->form < 6) { + OPM_WriteString((CHAR*)"(int)", (LONGINT)6); + } + OPM_WriteString((CHAR*)"__ABSF(", (LONGINT)8); + } else { + OPM_WriteString((CHAR*)"__ABSFD(", (LONGINT)9); + } + } else { + OPM_WriteString((CHAR*)"__ABS(", (LONGINT)7); + } + OPV_expr(l, -1); + OPM_Write(')'); + break; + case 22: + OPM_WriteString((CHAR*)"__CAP(", (LONGINT)7); + OPV_expr(l, -1); + OPM_Write(')'); + break; + case 23: + OPM_WriteString((CHAR*)"__ODD(", (LONGINT)7); + OPV_expr(l, -1); + OPM_Write(')'); + break; + case 24: + OPM_WriteString((CHAR*)"(LONGINT)(uintptr_t)", (LONGINT)21); + if (l->class == 1) { + OPC_CompleteIdent(l->obj); + } else { + if ((l->typ->form != 10 && !__IN(l->typ->comp, 0x0c))) { + OPM_Write('&'); + } + OPV_expr(l, exprPrec); + } + break; + case 29: + if ((((__IN(n->typ->form, 0x6240) && __IN(l->typ->form, 0x6240))) && n->typ->size == l->typ->size) || !__IN(l->class, 0x17)) { + OPM_Write('('); + OPC_Ident(n->typ->strobj); + OPM_Write(')'); + if (__IN(n->typ->form, 0x6000) || __IN(l->typ->form, 0x6000)) { + OPM_WriteString((CHAR*)"(uintptr_t)", (LONGINT)12); + } + OPV_expr(l, exprPrec); + } else { + if (__IN(n->typ->form, 0x6000) || __IN(l->typ->form, 0x6000)) { + OPM_WriteString((CHAR*)"__VALP(", (LONGINT)8); + } else { + OPM_WriteString((CHAR*)"__VAL(", (LONGINT)7); + } + OPC_Ident(n->typ->strobj); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPV_expr(l, -1); + OPM_Write(')'); + } + break; + default: + OPM_err(200); + break; + } + break; + case 12: + switch (subclass) { + case 19: + OPV_Len(l, r->conval->intval); + break; + case 15: case 17: case 18: case 26: case 27: + case 28: case 3: case 4: + switch (subclass) { + case 15: + OPM_WriteString((CHAR*)"__IN(", (LONGINT)6); + break; + case 17: + if (r->class == 7) { + if (r->conval->intval >= 0) { + OPM_WriteString((CHAR*)"__ASHL(", (LONGINT)8); + } else { + OPM_WriteString((CHAR*)"__ASHR(", (LONGINT)8); + } + } else if (OPV_SideEffects(r)) { + OPM_WriteString((CHAR*)"__ASHF(", (LONGINT)8); + } else { + OPM_WriteString((CHAR*)"__ASH(", (LONGINT)7); + } + break; + case 18: + OPM_WriteString((CHAR*)"__MASK(", (LONGINT)8); + break; + case 26: + OPM_WriteString((CHAR*)"__BIT(", (LONGINT)7); + break; + case 27: + if (r->class == 7) { + if (r->conval->intval >= 0) { + OPM_WriteString((CHAR*)"__LSHL(", (LONGINT)8); + } else { + OPM_WriteString((CHAR*)"__LSHR(", (LONGINT)8); + } + } else { + OPM_WriteString((CHAR*)"__LSH(", (LONGINT)7); + } + break; + case 28: + if (r->class == 7) { + if (r->conval->intval >= 0) { + OPM_WriteString((CHAR*)"__ROTL(", (LONGINT)8); + } else { + OPM_WriteString((CHAR*)"__ROTR(", (LONGINT)8); + } + } else { + OPM_WriteString((CHAR*)"__ROT(", (LONGINT)7); + } + break; + case 3: + if (OPV_SideEffects(n)) { + if (form < 6) { + OPM_WriteString((CHAR*)"(int)", (LONGINT)6); + } + OPM_WriteString((CHAR*)"__DIVF(", (LONGINT)8); + } else { + OPM_WriteString((CHAR*)"__DIV(", (LONGINT)7); + } + break; + case 4: + if (form < 6) { + OPM_WriteString((CHAR*)"(int)", (LONGINT)6); + } + if (OPV_SideEffects(n)) { + OPM_WriteString((CHAR*)"__MODF(", (LONGINT)8); + } else { + OPM_WriteString((CHAR*)"__MOD(", (LONGINT)7); + } + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, subclass = ", (LONGINT)40); + OPM_LogWNum(subclass, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + OPV_expr(l, -1); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + if ((((__IN(subclass, 0x18020000) && r->class == 7)) && r->conval->intval < 0)) { + OPM_WriteInt(-r->conval->intval); + } else { + OPV_expr(r, -1); + } + if (__IN(subclass, 0x18000000)) { + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPC_Ident(l->typ->strobj); + } + OPM_Write(')'); + break; + case 9: case 10: case 11: case 12: case 13: + case 14: + if (__IN(l->typ->form, 0x8400)) { + OPM_WriteString((CHAR*)"__STRCMP(", (LONGINT)10); + OPV_expr(l, -1); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPV_expr(r, -1); + OPM_Write(')'); + OPC_Cmp(subclass); + OPM_Write('0'); + } else { + OPV_expr(l, exprPrec); + OPC_Cmp(subclass); + typ = l->typ; + if ((((((typ->form == 13 && r->typ->form != 11)) && r->typ != typ)) && r->typ != OPT_sysptrtyp)) { + OPM_WriteString((CHAR*)"(void *) ", (LONGINT)10); + } + OPV_expr(r, exprPrec); + } + break; + default: + if (subclass == 5 || (form == 9 && (subclass == 1 || subclass == 7))) { + OPM_Write('('); + } + OPV_expr(l, exprPrec); + switch (subclass) { + case 1: + if (form == 9) { + OPM_WriteString((CHAR*)" & ", (LONGINT)4); + } else { + OPM_WriteString((CHAR*)" * ", (LONGINT)4); + } + break; + case 2: + if (form == 9) { + OPM_WriteString((CHAR*)" ^ ", (LONGINT)4); + } else { + OPM_WriteString((CHAR*)" / ", (LONGINT)4); + if (r->obj == NIL || __IN(r->obj->typ->form, 0x70)) { + OPM_Write('('); + OPC_Ident(n->typ->strobj); + OPM_Write(')'); + } + } + break; + case 5: + OPM_WriteString((CHAR*)" && ", (LONGINT)5); + break; + case 6: + if (form == 9) { + OPM_WriteString((CHAR*)" | ", (LONGINT)4); + } else { + OPM_WriteString((CHAR*)" + ", (LONGINT)4); + } + break; + case 7: + if (form == 9) { + OPM_WriteString((CHAR*)" & ~", (LONGINT)5); + } else { + OPM_WriteString((CHAR*)" - ", (LONGINT)4); + } + break; + case 8: + OPM_WriteString((CHAR*)" || ", (LONGINT)5); + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, subclass = ", (LONGINT)40); + OPM_LogWNum(subclass, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + OPV_expr(r, exprPrec); + if (subclass == 5 || (form == 9 && (subclass == 1 || subclass == 7))) { + OPM_Write(')'); + } + break; + } + break; + case 13: + if ((l->obj != NIL && l->obj->mode == 13)) { + if (l->subcl == 1) { + proc = OPV_SuperProc(n); + } else { + OPM_WriteString((CHAR*)"__", (LONGINT)3); + proc = OPC_BaseTProc(l->obj); + } + OPC_Ident(proc); + n->obj = proc->link; + } else if (l->class == 9) { + OPV_design(l, 10); + } else { + OPV_design(l, 11); + } + OPV_ActualPar(r, n->obj); + break; + default: + OPV_design(n, prec); + break; + } + if ((exprPrec <= prec && __IN(class, 0x3ca0))) { + OPM_Write(')'); + } +} + +static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) +{ + OPT_Node if_ = NIL; + OPT_Object obj = NIL; + OPT_Struct typ = NIL; + LONGINT adr; + if_ = n->left; + while (if_ != NIL) { + OPM_WriteString((CHAR*)"if ", (LONGINT)4); + OPV_expr(if_->left, 12); + OPM_Write(' '); + OPC_BegBlk(); + if ((n->class == 27 && if_->left->left != NIL)) { + obj = if_->left->left->obj; + typ = obj->typ; + adr = obj->adr; + if (typ->comp == 4) { + OPC_BegStat(); + OPC_Ident(if_->left->obj); + OPM_WriteString((CHAR*)" *", (LONGINT)3); + OPM_WriteString(obj->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"__ = (void*)", (LONGINT)13); + obj->adr = 0; + OPC_CompleteIdent(obj); + OPC_EndStat(); + } + obj->adr = 1; + obj->typ = if_->left->obj->typ; + OPV_stat(if_->right, outerProc); + obj->typ = typ; + obj->adr = adr; + } else { + OPV_stat(if_->right, outerProc); + } + if_ = if_->link; + if ((if_ != NIL || n->right != NIL) || withtrap) { + OPC_EndBlk0(); + OPM_WriteString((CHAR*)" else ", (LONGINT)7); + } else { + OPC_EndBlk(); + } + } + if (withtrap) { + OPM_WriteString((CHAR*)"__WITHCHK", (LONGINT)10); + OPC_EndStat(); + } else if (n->right != NIL) { + OPC_BegBlk(); + OPV_stat(n->right, outerProc); + OPC_EndBlk(); + } +} + +static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc) +{ + OPT_Node switchCase = NIL, label = NIL; + LONGINT low, high; + INTEGER form, i; + OPM_WriteString((CHAR*)"switch ", (LONGINT)8); + OPV_expr(n->left, 12); + OPM_Write(' '); + OPC_BegBlk(); + form = n->left->typ->form; + switchCase = n->right->left; + while (switchCase != NIL) { + label = switchCase->left; + i = 0; + while (label != NIL) { + low = label->conval->intval; + high = label->conval->intval2; + while (low <= high) { + if (i == 0) { + OPC_BegStat(); + } + OPC_Case(low, form); + low += 1; + i += 1; + if (i == 5) { + OPM_WriteLn(); + i = 0; + } + } + label = label->link; + } + if (i > 0) { + OPM_WriteLn(); + } + OPC_Indent(1); + OPV_stat(switchCase->right, outerProc); + OPC_BegStat(); + OPM_WriteString((CHAR*)"break", (LONGINT)6); + OPC_EndStat(); + OPC_Indent(-1); + switchCase = switchCase->link; + } + OPC_BegStat(); + OPM_WriteString((CHAR*)"default: ", (LONGINT)10); + if (n->right->conval->setval != 0x0) { + OPC_Indent(1); + OPM_WriteLn(); + OPV_stat(n->right->right, outerProc); + OPC_BegStat(); + OPM_WriteString((CHAR*)"break", (LONGINT)6); + OPC_Indent(-1); + } else { + OPM_WriteString((CHAR*)"__CASECHK", (LONGINT)10); + } + OPC_EndStat(); + OPC_EndBlk(); +} + +static BOOLEAN OPV_ImplicitReturn (OPT_Node n) +{ + BOOLEAN _o_result; + while ((n != NIL && n->class != 26)) { + n = n->link; + } + _o_result = n == NIL; + return _o_result; +} + +static void OPV_NewArr (OPT_Node d, OPT_Node x) +{ + OPT_Struct typ = NIL, base = NIL; + INTEGER nofdim, nofdyn; + typ = d->typ->BaseTyp; + base = typ; + nofdim = 0; + nofdyn = 0; + while (base->comp == 3) { + nofdim += 1; + nofdyn += 1; + base = base->BaseTyp; + } + OPV_design(d, -1); + OPM_WriteString((CHAR*)" = __NEWARR(", (LONGINT)13); + while (base->comp == 2) { + nofdim += 1; + base = base->BaseTyp; + } + if ((base->comp == 4 && OPC_NofPtrs(base) != 0)) { + OPC_Ident(base->strobj); + OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + } else if (base->form == 13) { + OPM_WriteString((CHAR*)"POINTER__typ", (LONGINT)13); + } else { + OPM_WriteString((CHAR*)"NIL", (LONGINT)4); + } + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)"((LONGINT)(", (LONGINT)12); + OPM_WriteInt(base->size); + OPM_WriteString((CHAR*)"))", (LONGINT)3); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteInt(OPC_Base(base)); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteInt(nofdim); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteInt(nofdyn); + while (typ != base) { + OPM_WriteString((CHAR*)", ", (LONGINT)3); + if (typ->comp == 3) { + if (x->class == 7) { + OPM_WriteString((CHAR*)"(LONGINT)(", (LONGINT)11); + OPV_expr(x, -1); + OPM_WriteString((CHAR*)")", (LONGINT)2); + } else { + OPM_WriteString((CHAR*)"(LONGINT)", (LONGINT)10); + OPV_expr(x, 10); + } + x = x->link; + } else { + OPM_WriteString((CHAR*)"(LONGINT)", (LONGINT)10); + OPM_WriteInt(typ->n); + } + typ = typ->BaseTyp; + } + OPM_Write(')'); +} + +static void OPV_DefineTDescs (OPT_Node n) +{ + while ((n != NIL && n->class == 14)) { + OPC_TDescDecl(n->typ); + n = n->link; + } +} + +static void OPV_InitTDescs (OPT_Node n) +{ + while ((n != NIL && n->class == 14)) { + OPC_InitTDesc(n->typ); + n = n->link; + } +} + +static void OPV_stat (OPT_Node n, OPT_Object outerProc) +{ + OPT_Object proc = NIL; + OPV_ExitInfo saved; + OPT_Node l = NIL, r = NIL; + while ((n != NIL && OPM_noerr)) { + OPM_errpos = n->conval->intval; + if (n->class != 14) { + OPC_BegStat(); + } + switch (n->class) { + case 18: + if (n->obj == NIL) { + OPM_level += 1; + OPV_stat(n->left, outerProc); + OPM_level -= 1; + OPC_GenEnumPtrs(OPT_topScope->scope); + OPV_DefineTDescs(n->right); + OPC_EnterBody(); + OPV_InitTDescs(n->right); + OPM_WriteString((CHAR*)"/* BEGIN */", (LONGINT)12); + OPM_WriteLn(); + OPV_stat(n->right, outerProc); + OPC_ExitBody(); + } else { + proc = n->obj; + OPC_TypeDefs(proc->scope->right, 0); + if (!proc->scope->leaf) { + OPC_DefineInter(proc); + } + OPM_level += 1; + OPV_stat(n->left, proc); + OPM_level -= 1; + OPC_EnterProc(proc); + OPV_stat(n->right, proc); + OPC_ExitProc(proc, 1, OPV_ImplicitReturn(n->right)); + } + break; + case 14: + break; + case 19: + switch (n->subcl) { + case 0: + l = n->left; + r = n->right; + if (l->typ->comp == 2) { + OPM_WriteString((CHAR*)"__MOVE(", (LONGINT)8); + OPV_expr(r, -1); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPV_expr(l, -1); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + if (r->typ == OPT_stringtyp) { + OPM_WriteInt(r->conval->intval2); + } else { + OPM_WriteInt(r->typ->size); + } + OPM_Write(')'); + } else { + if ((((((l->typ->form == 13 && l->obj != NIL)) && l->obj->adr == 1)) && l->obj->mode == 1)) { + l->obj->adr = 0; + OPV_design(l, -1); + l->obj->adr = 1; + if (r->typ->form != 11) { + OPM_WriteString((CHAR*)" = (void*)", (LONGINT)11); + } else { + OPM_WriteString((CHAR*)" = ", (LONGINT)4); + } + } else { + OPV_design(l, -1); + OPM_WriteString((CHAR*)" = ", (LONGINT)4); + } + if (l->typ == r->typ) { + OPV_expr(r, -1); + } else if ((((l->typ->form == 13 && r->typ->form != 11)) && l->typ->strobj != NIL)) { + OPM_Write('('); + OPC_Ident(l->typ->strobj); + OPM_Write(')'); + OPV_expr(r, -1); + } else if (l->typ->comp == 4) { + OPM_WriteString((CHAR*)"*(", (LONGINT)3); + OPC_Andent(l->typ); + OPM_WriteString((CHAR*)"*)&", (LONGINT)4); + OPV_expr(r, 9); + } else { + OPV_expr(r, -1); + } + } + break; + case 1: + if (n->left->typ->BaseTyp->comp == 4) { + OPM_WriteString((CHAR*)"__NEW(", (LONGINT)7); + OPV_design(n->left, -1); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPC_Andent(n->left->typ->BaseTyp); + OPM_WriteString((CHAR*)")", (LONGINT)2); + } else if (__IN(n->left->typ->BaseTyp->comp, 0x0c)) { + OPV_NewArr(n->left, n->right); + } + break; + case 13: case 14: + OPV_expr(n->left, -1); + OPC_Increment(n->subcl == 14); + OPV_expr(n->right, -1); + break; + case 15: case 16: + OPV_expr(n->left, -1); + OPC_SetInclude(n->subcl == 16); + OPM_WriteString((CHAR*)"__SETOF(", (LONGINT)9); + OPV_expr(n->right, -1); + OPM_Write(')'); + break; + case 18: + OPM_WriteString((CHAR*)"__COPY(", (LONGINT)8); + OPV_expr(n->right, -1); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPV_expr(n->left, -1); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPV_Len(n->left, ((LONGINT)(0))); + OPM_Write(')'); + break; + case 31: + OPM_WriteString((CHAR*)"__MOVE(", (LONGINT)8); + OPV_expr(n->right, -1); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPV_expr(n->left, -1); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPV_expr(n->right->link, -1); + OPM_Write(')'); + break; + case 24: + OPM_WriteString((CHAR*)"__GET(", (LONGINT)7); + OPV_expr(n->right, -1); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPV_expr(n->left, -1); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPC_Ident(n->left->typ->strobj); + OPM_Write(')'); + break; + case 25: + OPM_WriteString((CHAR*)"__PUT(", (LONGINT)7); + OPV_expr(n->left, -1); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPV_expr(n->right, -1); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPC_Ident(n->right->typ->strobj); + OPM_Write(')'); + break; + case 26: case 27: + OPM_err(200); + break; + case 30: + OPM_WriteString((CHAR*)"__SYSNEW(", (LONGINT)10); + OPV_design(n->left, -1); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPV_expr(n->right, -1); + OPM_Write(')'); + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, n^.subcl = ", (LONGINT)40); + OPM_LogWNum(n->subcl, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + break; + case 13: + if ((n->left->obj != NIL && n->left->obj->mode == 13)) { + if (n->left->subcl == 1) { + proc = OPV_SuperProc(n); + } else { + OPM_WriteString((CHAR*)"__", (LONGINT)3); + proc = OPC_BaseTProc(n->left->obj); + } + OPC_Ident(proc); + n->obj = proc->link; + } else if (n->left->class == 9) { + OPV_design(n->left, 10); + } else { + OPV_design(n->left, 11); + } + OPV_ActualPar(n->right, n->obj); + break; + case 20: + if (n->subcl != 32) { + OPV_IfStat(n, 0, outerProc); + } else if (OPV_assert) { + OPM_WriteString((CHAR*)"__ASSERT(", (LONGINT)10); + OPV_expr(n->left->left->left, -1); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteInt(n->left->right->right->conval->intval); + OPM_Write(')'); + OPC_EndStat(); + } + break; + case 21: + OPV_exit.level += 1; + OPV_CaseStat(n, outerProc); + OPV_exit.level -= 1; + break; + case 22: + OPV_exit.level += 1; + OPM_WriteString((CHAR*)"while ", (LONGINT)7); + OPV_expr(n->left, 12); + OPM_Write(' '); + OPC_BegBlk(); + OPV_stat(n->right, outerProc); + OPC_EndBlk(); + OPV_exit.level -= 1; + break; + case 23: + OPV_exit.level += 1; + OPM_WriteString((CHAR*)"do ", (LONGINT)4); + OPC_BegBlk(); + OPV_stat(n->left, outerProc); + OPC_EndBlk0(); + OPM_WriteString((CHAR*)" while (!", (LONGINT)10); + OPV_expr(n->right, 9); + OPM_Write(')'); + OPV_exit.level -= 1; + break; + case 24: + saved = OPV_exit; + OPV_exit.level = 0; + OPV_exit.label = -1; + OPM_WriteString((CHAR*)"for (;;) ", (LONGINT)10); + OPC_BegBlk(); + OPV_stat(n->left, outerProc); + OPC_EndBlk(); + if (OPV_exit.label != -1) { + OPC_BegStat(); + OPM_WriteString((CHAR*)"exit__", (LONGINT)7); + OPM_WriteInt(OPV_exit.label); + OPM_Write(':'); + OPC_EndStat(); + } + OPV_exit = saved; + break; + case 25: + if (OPV_exit.level == 0) { + OPM_WriteString((CHAR*)"break", (LONGINT)6); + } else { + if (OPV_exit.label == -1) { + OPV_exit.label = OPV_nofExitLabels; + OPV_nofExitLabels += 1; + } + OPM_WriteString((CHAR*)"goto exit__", (LONGINT)12); + OPM_WriteInt(OPV_exit.label); + } + break; + case 26: + if (OPM_level == 0) { + if (OPV_mainprog) { + OPM_WriteString((CHAR*)"__FINI", (LONGINT)7); + } else { + OPM_WriteString((CHAR*)"__ENDMOD", (LONGINT)9); + } + } else { + if (n->left != NIL) { + OPM_WriteString((CHAR*)"_o_result = ", (LONGINT)13); + if ((n->left->typ->form == 13 && n->obj->typ != n->left->typ)) { + OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + OPV_expr(n->left, 10); + } else { + OPV_expr(n->left, -1); + } + OPM_WriteString((CHAR*)";", (LONGINT)2); + OPM_WriteLn(); + OPC_BegStat(); + OPC_ExitProc(outerProc, 0, 0); + OPM_WriteString((CHAR*)"return _o_result", (LONGINT)17); + } else { + OPM_WriteString((CHAR*)"return", (LONGINT)7); + } + } + break; + case 27: + OPV_IfStat(n, n->subcl == 0, outerProc); + break; + case 28: + OPC_Halt(n->right->conval->intval); + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, n^.class = ", (LONGINT)40); + OPM_LogWNum(n->class, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + if (!__IN(n->class, 0x09744000)) { + OPC_EndStat(); + } + n = n->link; + } +} + +void OPV_Module (OPT_Node prog) +{ + if (!OPV_mainprog) { + OPC_GenHdr(prog->right); + OPC_GenHdrIncludes(); + } + OPC_GenBdy(prog->right); + OPV_stat(prog, NIL); +} + +__TDESC(OPV_ExitInfo, 1, 0) = {__TDFLDS("ExitInfo", 4), {-4}}; + +export void *OPV__init(void) +{ + __DEFMOD; + __MODULE_IMPORT(OPC); + __MODULE_IMPORT(OPM); + __MODULE_IMPORT(OPS); + __MODULE_IMPORT(OPT); + __REGMOD("OPV", 0); + __REGCMD("Init", OPV_Init); + __INITYP(OPV_ExitInfo, OPV_ExitInfo, 0); +/* BEGIN */ + __ENDMOD; +} diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h new file mode 100644 index 00000000..9907a1ef --- /dev/null +++ b/bootstrap/windows-48/OPV.h @@ -0,0 +1,19 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ + +#ifndef OPV__h +#define OPV__h + +#include "SYSTEM.h" +#include "OPT.h" + + + + +import void OPV_AdrAndSize (OPT_Object topScope); +import void OPV_Init (void); +import void OPV_Module (OPT_Node prog); +import void OPV_TypSize (OPT_Struct typ); +import void *OPV__init(void); + + +#endif diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c new file mode 100644 index 00000000..d097f9db --- /dev/null +++ b/bootstrap/windows-48/Platform.c @@ -0,0 +1,818 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +#include "SYSTEM.h" + +typedef + CHAR (*Platform_ArgPtr)[1024]; + +typedef + Platform_ArgPtr (*Platform_ArgVec)[1024]; + +typedef + LONGINT (*Platform_ArgVecPtr)[1]; + +typedef + CHAR (*Platform_EnvPtr)[1024]; + +typedef + struct Platform_FileIdentity { + LONGINT volume, indexhigh, indexlow, mtimehigh, mtimelow; + } Platform_FileIdentity; + +typedef + void (*Platform_HaltProcedure)(LONGINT); + +typedef + void (*Platform_SignalHandler)(INTEGER); + + +export BOOLEAN Platform_LittleEndian; +export LONGINT Platform_MainStackFrame, Platform_HaltCode; +export INTEGER Platform_PID; +export CHAR Platform_CWD[4096]; +export INTEGER Platform_ArgCount; +export LONGINT Platform_ArgVector; +static Platform_HaltProcedure Platform_HaltHandler; +static LONGINT Platform_TimeStart; +export INTEGER Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; +export LONGINT Platform_StdIn, Platform_StdOut, Platform_StdErr; +static Platform_SignalHandler Platform_InterruptHandler; +export CHAR Platform_nl[3]; + +export LONGINT *Platform_FileIdentity__typ; + +export BOOLEAN Platform_Absent (INTEGER e); +export INTEGER Platform_ArgPos (CHAR *s, LONGINT s__len); +export void Platform_AssertFail (LONGINT code); +export INTEGER Platform_Chdir (CHAR *n, LONGINT n__len); +export INTEGER Platform_Close (LONGINT h); +export BOOLEAN Platform_ConnectionFailed (INTEGER e); +export void Platform_Delay (LONGINT ms); +export BOOLEAN Platform_DifferentFilesystems (INTEGER e); +static void Platform_DisplayHaltCode (LONGINT code); +export INTEGER Platform_Error (void); +export void Platform_Exit (INTEGER code); +export void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len); +export void Platform_GetClock (LONGINT *t, LONGINT *d); +export void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); +export void Platform_GetIntArg (INTEGER n, LONGINT *val); +export void Platform_GetTimeOfDay (LONGINT *sec, LONGINT *usec); +export void Platform_Halt (LONGINT code); +export INTEGER Platform_Identify (LONGINT h, Platform_FileIdentity *identity, LONGINT *identity__typ); +export INTEGER Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); +export BOOLEAN Platform_Inaccessible (INTEGER e); +export void Platform_Init (INTEGER argc, LONGINT argvadr); +export void Platform_MTimeAsClock (Platform_FileIdentity i, LONGINT *t, LONGINT *d); +export INTEGER Platform_New (CHAR *n, LONGINT n__len, LONGINT *h); +export BOOLEAN Platform_NoSuchDirectory (INTEGER e); +export LONGINT Platform_OSAllocate (LONGINT size); +export void Platform_OSFree (LONGINT address); +export INTEGER Platform_OldRO (CHAR *n, LONGINT n__len, LONGINT *h); +export INTEGER Platform_OldRW (CHAR *n, LONGINT n__len, LONGINT *h); +export INTEGER Platform_Read (LONGINT h, LONGINT p, LONGINT l, LONGINT *n); +export INTEGER Platform_ReadBuf (LONGINT h, SYSTEM_BYTE *b, LONGINT b__len, LONGINT *n); +export INTEGER Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); +export BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); +export BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); +export INTEGER Platform_Seek (LONGINT h, LONGINT o, INTEGER r); +export void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); +export void Platform_SetHalt (Platform_HaltProcedure p); +export void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Platform_FileIdentity source); +export INTEGER Platform_Size (LONGINT h, LONGINT *l); +export INTEGER Platform_Sync (LONGINT h); +export INTEGER Platform_System (CHAR *cmd, LONGINT cmd__len); +static void Platform_TestLittleEndian (void); +export LONGINT Platform_Time (void); +export BOOLEAN Platform_TimedOut (INTEGER e); +export BOOLEAN Platform_TooManyFiles (INTEGER e); +export INTEGER Platform_Truncate (LONGINT h, LONGINT limit); +export INTEGER Platform_Unlink (CHAR *n, LONGINT n__len); +export INTEGER Platform_Write (LONGINT h, LONGINT p, LONGINT l); +static void Platform_YMDHMStoClock (INTEGER ye, INTEGER mo, INTEGER da, INTEGER ho, INTEGER mi, INTEGER se, LONGINT *t, LONGINT *d); +static void Platform_errch (CHAR c); +static void Platform_errint (LONGINT l); +static void Platform_errln (void); +static void Platform_errposint (LONGINT l); +export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); + +#include "WindowsWrapper.h" +#define Platform_ECONNABORTED() WSAECONNABORTED +#define Platform_ECONNREFUSED() WSAECONNREFUSED +#define Platform_EHOSTUNREACH() WSAEHOSTUNREACH +#define Platform_ENETUNREACH() WSAENETUNREACH +#define Platform_ERRORACCESSDENIED() ERROR_ACCESS_DENIED +#define Platform_ERRORFILENOTFOUND() ERROR_FILE_NOT_FOUND +#define Platform_ERRORNOTREADY() ERROR_NOT_READY +#define Platform_ERRORNOTSAMEDEVICE() ERROR_NOT_SAME_DEVICE +#define Platform_ERRORPATHNOTFOUND() ERROR_PATH_NOT_FOUND +#define Platform_ERRORSHARINGVIOLATION() ERROR_SHARING_VIOLATION +#define Platform_ERRORTOOMANYOPENFILES() ERROR_TOO_MANY_OPEN_FILES +#define Platform_ERRORWRITEPROTECT() ERROR_WRITE_PROTECT +#define Platform_ETIMEDOUT() WSAETIMEDOUT +extern void Heap_InitHeap(); +#define Platform_GetTickCount() (LONGINT)(uint32_t)GetTickCount() +#define Platform_HeapInitHeap() Heap_InitHeap() +#define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((uintptr_t)h) +#define Platform_SetQuitHandler(h) SystemSetQuitHandler((uintptr_t)h) +#define Platform_allocate(size) (LONGINT)(uintptr_t)((void*)HeapAlloc(GetProcessHeap(), 0, (size_t)size)) +#define Platform_bhfiIndexHigh() (LONGINT)bhfi.nFileIndexHigh +#define Platform_bhfiIndexLow() (LONGINT)bhfi.nFileIndexLow +#define Platform_bhfiMtimeHigh() (LONGINT)bhfi.ftLastWriteTime.dwHighDateTime +#define Platform_bhfiMtimeLow() (LONGINT)bhfi.ftLastWriteTime.dwLowDateTime +#define Platform_bhfiVsn() (LONGINT)bhfi.dwVolumeSerialNumber +#define Platform_byHandleFileInformation() BY_HANDLE_FILE_INFORMATION bhfi +#define Platform_cleanupProcess() CloseHandle(pi.hProcess); CloseHandle(pi.hThread); +#define Platform_closeHandle(h) (INTEGER)CloseHandle((HANDLE)(uintptr_t)h) +#define Platform_createProcess(str, str__len) (INTEGER)CreateProcess(0, (char*)str, 0,0,0,0,0,0,&si,&pi) +#define Platform_deleteFile(n, n__len) (INTEGER)DeleteFile((char*)n) +#define Platform_err() (INTEGER)GetLastError() +#define Platform_errc(c) WriteFile((HANDLE)(uintptr_t)Platform_StdOut, &c, 1, 0,0) +#define Platform_errstring(s, s__len) WriteFile((HANDLE)(uintptr_t)Platform_StdOut, s, s__len-1, 0,0) +#define Platform_exit(code) ExitProcess((UINT)code) +#define Platform_fileTimeToSysTime() SYSTEMTIME st; FileTimeToSystemTime(&ft, &st) +#define Platform_flushFileBuffers(h) (INTEGER)FlushFileBuffers((HANDLE)(uintptr_t)h) +#define Platform_free(address) HeapFree(GetProcessHeap(), 0, (void*)(uintptr_t)address) +#define Platform_getCurrentDirectory(n, n__len) GetCurrentDirectory(n__len, (char*)n) +#define Platform_getExitCodeProcess(exitcode) GetExitCodeProcess(pi.hProcess, (DWORD*)exitcode); +#define Platform_getFileInformationByHandle(h) (INTEGER)GetFileInformationByHandle((HANDLE)(uintptr_t)h, &bhfi) +#define Platform_getFilePos(h, r, rc) LARGE_INTEGER liz = {0}; *rc = (INTEGER)SetFilePointerEx((HANDLE)(uintptr_t)h, liz, &li, FILE_CURRENT); *r = (LONGINT)li.QuadPart +#define Platform_getFileSize(h) (INTEGER)GetFileSizeEx((HANDLE)(uintptr_t)h, &li) +#define Platform_getLocalTime() SYSTEMTIME st; GetLocalTime(&st) +#define Platform_getenv(name, name__len, buf, buf__len) (INTEGER)GetEnvironmentVariable((char*)name, (char*)buf, buf__len) +#define Platform_getpid() (INTEGER)GetCurrentProcessId() +#define Platform_getstderrhandle() (uintptr_t)GetStdHandle(STD_ERROR_HANDLE) +#define Platform_getstdinhandle() (uintptr_t)GetStdHandle(STD_INPUT_HANDLE) +#define Platform_getstdouthandle() (uintptr_t)GetStdHandle(STD_OUTPUT_HANDLE) +#define Platform_identityToFileTime(i) FILETIME ft; ft.dwHighDateTime = i.mtimehigh; ft.dwLowDateTime = i.mtimelow +#define Platform_invalidHandleValue() ((LONGINT)(uintptr_t)INVALID_HANDLE_VALUE) +#define Platform_largeInteger() LARGE_INTEGER li +#define Platform_liLongint() (LONGINT)li.QuadPart +#define Platform_moveFile(o, o__len, n, n__len) (INTEGER)MoveFileEx((char*)o, (char*)n, MOVEFILE_REPLACE_EXISTING) +#define Platform_opennew(n, n__len) (LONGINT)(uintptr_t)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0) +#define Platform_openro(n, n__len) (LONGINT)(uintptr_t)CreateFile((char*)n, GENERIC_READ , FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) +#define Platform_openrw(n, n__len) (LONGINT)(uintptr_t)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) +#define Platform_processInfo() PROCESS_INFORMATION pi = {0}; +#define Platform_readfile(fd, p, l, n) (INTEGER)ReadFile ((HANDLE)(uintptr_t)fd, (void*)(uintptr_t)(p), (DWORD)l, (DWORD*)n, 0) +#define Platform_seekcur() FILE_CURRENT +#define Platform_seekend() FILE_END +#define Platform_seekset() FILE_BEGIN +#define Platform_setCurrentDirectory(n, n__len) (INTEGER)SetCurrentDirectory((char*)n) +#define Platform_setEndOfFile(h) (INTEGER)SetEndOfFile((HANDLE)(uintptr_t)h) +#define Platform_setFilePointerEx(h, o, r, rc) li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((HANDLE)(uintptr_t)h, li, 0, (DWORD)r) +#define Platform_sleep(ms) Sleep((DWORD)ms) +#define Platform_startupInfo() STARTUPINFO si = {0}; si.cb = sizeof(si); +#define Platform_sthour() (INTEGER)st.wHour +#define Platform_stmday() (INTEGER)st.wDay +#define Platform_stmin() (INTEGER)st.wMinute +#define Platform_stmon() (INTEGER)st.wMonth +#define Platform_stmsec() (INTEGER)st.wMilliseconds +#define Platform_stsec() (INTEGER)st.wSecond +#define Platform_styear() (INTEGER)st.wYear +#define Platform_waitForProcess() (INTEGER)WaitForSingleObject(pi.hProcess, INFINITE) +#define Platform_writefile(fd, p, l) (INTEGER)WriteFile((HANDLE)(uintptr_t)fd, (void*)(uintptr_t)(p), (DWORD)l, 0,0) + +BOOLEAN Platform_TooManyFiles (INTEGER e) +{ + BOOLEAN _o_result; + _o_result = e == Platform_ERRORTOOMANYOPENFILES(); + return _o_result; +} + +BOOLEAN Platform_NoSuchDirectory (INTEGER e) +{ + BOOLEAN _o_result; + _o_result = e == Platform_ERRORPATHNOTFOUND(); + return _o_result; +} + +BOOLEAN Platform_DifferentFilesystems (INTEGER e) +{ + BOOLEAN _o_result; + _o_result = e == Platform_ERRORNOTSAMEDEVICE(); + return _o_result; +} + +BOOLEAN Platform_Inaccessible (INTEGER e) +{ + BOOLEAN _o_result; + _o_result = ((e == Platform_ERRORACCESSDENIED() || e == Platform_ERRORWRITEPROTECT()) || e == Platform_ERRORNOTREADY()) || e == Platform_ERRORSHARINGVIOLATION(); + return _o_result; +} + +BOOLEAN Platform_Absent (INTEGER e) +{ + BOOLEAN _o_result; + _o_result = e == Platform_ERRORFILENOTFOUND() || e == Platform_ERRORPATHNOTFOUND(); + return _o_result; +} + +BOOLEAN Platform_TimedOut (INTEGER e) +{ + BOOLEAN _o_result; + _o_result = e == Platform_ETIMEDOUT(); + return _o_result; +} + +BOOLEAN Platform_ConnectionFailed (INTEGER e) +{ + BOOLEAN _o_result; + _o_result = ((e == Platform_ECONNREFUSED() || e == Platform_ECONNABORTED()) || e == Platform_ENETUNREACH()) || e == Platform_EHOSTUNREACH(); + return _o_result; +} + +LONGINT Platform_OSAllocate (LONGINT size) +{ + LONGINT _o_result; + _o_result = Platform_allocate(size); + return _o_result; +} + +void Platform_OSFree (LONGINT address) +{ + Platform_free(address); +} + +void Platform_Init (INTEGER argc, LONGINT argvadr) +{ + Platform_ArgVecPtr av = NIL; + Platform_MainStackFrame = argvadr; + Platform_ArgCount = argc; + av = (Platform_ArgVecPtr)(uintptr_t)argvadr; + Platform_ArgVector = (*av)[0]; + Platform_HaltCode = -128; + Platform_HeapInitHeap(); +} + +BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len) +{ + BOOLEAN _o_result; + CHAR buf[4096]; + INTEGER res; + __DUP(var, var__len, CHAR); + res = Platform_getenv(var, var__len, (void*)buf, ((LONGINT)(4096))); + if ((res > 0 && res < 4096)) { + __COPY(buf, val, val__len); + _o_result = 1; + __DEL(var); + return _o_result; + } else { + _o_result = 0; + __DEL(var); + return _o_result; + } + __RETCHK; +} + +void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len) +{ + __DUP(var, var__len, CHAR); + if (!Platform_getEnv(var, var__len, (void*)val, val__len)) { + val[0] = 0x00; + } + __DEL(var); +} + +void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len) +{ + Platform_ArgVec av = NIL; + if (n < Platform_ArgCount) { + av = (Platform_ArgVec)(uintptr_t)Platform_ArgVector; + __COPY(*(*av)[__X(n, ((LONGINT)(1024)))], val, val__len); + } +} + +void Platform_GetIntArg (INTEGER n, LONGINT *val) +{ + CHAR s[64]; + LONGINT k, d, i; + s[0] = 0x00; + Platform_GetArg(n, (void*)s, ((LONGINT)(64))); + i = 0; + if (s[0] == '-') { + i = 1; + } + k = 0; + d = (int)s[__X(i, ((LONGINT)(64)))] - 48; + while ((d >= 0 && d <= 9)) { + k = k * 10 + d; + i += 1; + d = (int)s[__X(i, ((LONGINT)(64)))] - 48; + } + if (s[0] == '-') { + k = -k; + i -= 1; + } + if (i > 0) { + *val = k; + } +} + +INTEGER Platform_ArgPos (CHAR *s, LONGINT s__len) +{ + INTEGER _o_result; + INTEGER i; + CHAR arg[256]; + __DUP(s, s__len, CHAR); + i = 0; + Platform_GetArg(i, (void*)arg, ((LONGINT)(256))); + while ((i < Platform_ArgCount && __STRCMP(s, arg) != 0)) { + i += 1; + Platform_GetArg(i, (void*)arg, ((LONGINT)(256))); + } + _o_result = i; + __DEL(s); + return _o_result; +} + +void Platform_SetBadInstructionHandler (Platform_SignalHandler handler) +{ +} + +static void Platform_YMDHMStoClock (INTEGER ye, INTEGER mo, INTEGER da, INTEGER ho, INTEGER mi, INTEGER se, LONGINT *t, LONGINT *d) +{ + *d = (__ASHL((LONGINT)(int)__MOD(ye, 100), 9) + __ASHL((LONGINT)(mo + 1), 5)) + (LONGINT)da; + *t = (__ASHL((LONGINT)ho, 12) + __ASHL((LONGINT)mi, 6)) + (LONGINT)se; +} + +void Platform_GetClock (LONGINT *t, LONGINT *d) +{ + Platform_getLocalTime(); + Platform_YMDHMStoClock(Platform_styear(), Platform_stmon(), Platform_stmday(), Platform_sthour(), Platform_stmin(), Platform_stsec(), &*t, &*d); +} + +void Platform_GetTimeOfDay (LONGINT *sec, LONGINT *usec) +{ + Platform_getLocalTime(); + *sec = Platform_stsec(); + *usec = (LONGINT)Platform_stmsec() * 1000; +} + +LONGINT Platform_Time (void) +{ + LONGINT _o_result; + LONGINT ms; + ms = Platform_GetTickCount(); + _o_result = __MOD(ms - Platform_TimeStart, 2147483647); + return _o_result; +} + +void Platform_Delay (LONGINT ms) +{ + while (ms > 30000) { + Platform_sleep(((LONGINT)(30000))); + ms = ms - 30000; + } + if (ms > 0) { + Platform_sleep(ms); + } +} + +INTEGER Platform_System (CHAR *cmd, LONGINT cmd__len) +{ + INTEGER _o_result; + INTEGER result; + __DUP(cmd, cmd__len, CHAR); + result = 127; + Platform_startupInfo(); + Platform_processInfo(); + if (Platform_createProcess(cmd, cmd__len) != 0) { + if (Platform_waitForProcess() == 0) { + Platform_getExitCodeProcess(&result); + } + Platform_cleanupProcess(); + } + _o_result = __ASHL(result, 8); + __DEL(cmd); + return _o_result; +} + +INTEGER Platform_Error (void) +{ + INTEGER _o_result; + _o_result = Platform_err(); + return _o_result; +} + +INTEGER Platform_OldRO (CHAR *n, LONGINT n__len, LONGINT *h) +{ + INTEGER _o_result; + LONGINT fd; + fd = Platform_openro(n, n__len); + if (fd == Platform_invalidHandleValue()) { + _o_result = Platform_err(); + return _o_result; + } else { + *h = fd; + _o_result = 0; + return _o_result; + } + __RETCHK; +} + +INTEGER Platform_OldRW (CHAR *n, LONGINT n__len, LONGINT *h) +{ + INTEGER _o_result; + LONGINT fd; + fd = Platform_openrw(n, n__len); + if (fd == Platform_invalidHandleValue()) { + _o_result = Platform_err(); + return _o_result; + } else { + *h = fd; + _o_result = 0; + return _o_result; + } + __RETCHK; +} + +INTEGER Platform_New (CHAR *n, LONGINT n__len, LONGINT *h) +{ + INTEGER _o_result; + LONGINT fd; + fd = Platform_opennew(n, n__len); + if (fd == Platform_invalidHandleValue()) { + _o_result = Platform_err(); + return _o_result; + } else { + *h = fd; + _o_result = 0; + return _o_result; + } + __RETCHK; +} + +INTEGER Platform_Close (LONGINT h) +{ + INTEGER _o_result; + if (Platform_closeHandle(h) == 0) { + _o_result = Platform_err(); + return _o_result; + } else { + _o_result = 0; + return _o_result; + } + __RETCHK; +} + +INTEGER Platform_Identify (LONGINT h, Platform_FileIdentity *identity, LONGINT *identity__typ) +{ + INTEGER _o_result; + Platform_byHandleFileInformation(); + if (Platform_getFileInformationByHandle(h) == 0) { + _o_result = Platform_err(); + return _o_result; + } + (*identity).volume = Platform_bhfiVsn(); + (*identity).indexhigh = Platform_bhfiIndexHigh(); + (*identity).indexlow = Platform_bhfiIndexLow(); + (*identity).mtimehigh = Platform_bhfiMtimeHigh(); + (*identity).mtimelow = Platform_bhfiMtimeLow(); + _o_result = 0; + return _o_result; +} + +INTEGER Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ) +{ + INTEGER _o_result; + LONGINT h; + INTEGER e, i; + __DUP(n, n__len, CHAR); + e = Platform_OldRO((void*)n, n__len, &h); + if (e != 0) { + _o_result = e; + __DEL(n); + return _o_result; + } + e = Platform_Identify(h, &*identity, identity__typ); + i = Platform_Close(h); + _o_result = e; + __DEL(n); + return _o_result; +} + +BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2) +{ + BOOLEAN _o_result; + _o_result = (((i1.indexhigh == i2.indexhigh && i1.indexlow == i2.indexlow)) && i1.volume == i2.volume); + return _o_result; +} + +BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2) +{ + BOOLEAN _o_result; + _o_result = (i1.mtimehigh == i2.mtimehigh && i1.mtimelow == i2.mtimelow); + return _o_result; +} + +void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Platform_FileIdentity source) +{ + (*target).mtimehigh = source.mtimehigh; + (*target).mtimelow = source.mtimelow; +} + +void Platform_MTimeAsClock (Platform_FileIdentity i, LONGINT *t, LONGINT *d) +{ + Platform_identityToFileTime(i); + Platform_fileTimeToSysTime(); + Platform_YMDHMStoClock(Platform_styear(), Platform_stmon(), Platform_stmday(), Platform_sthour(), Platform_stmin(), Platform_stsec(), &*t, &*d); +} + +INTEGER Platform_Size (LONGINT h, LONGINT *l) +{ + INTEGER _o_result; + Platform_largeInteger(); + if (Platform_getFileSize(h) == 0) { + _o_result = Platform_err(); + return _o_result; + } + *l = Platform_liLongint(); + _o_result = 0; + return _o_result; +} + +INTEGER Platform_Read (LONGINT h, LONGINT p, LONGINT l, LONGINT *n) +{ + INTEGER _o_result; + INTEGER result; + *n = 0; + result = Platform_readfile(h, p, l, &*n); + if (result == 0) { + *n = 0; + _o_result = Platform_err(); + return _o_result; + } else { + _o_result = 0; + return _o_result; + } + __RETCHK; +} + +INTEGER Platform_ReadBuf (LONGINT h, SYSTEM_BYTE *b, LONGINT b__len, LONGINT *n) +{ + INTEGER _o_result; + INTEGER result; + *n = 0; + result = Platform_readfile(h, (LONGINT)(uintptr_t)b, b__len, &*n); + if (result == 0) { + *n = 0; + _o_result = Platform_err(); + return _o_result; + } else { + _o_result = 0; + return _o_result; + } + __RETCHK; +} + +INTEGER Platform_Write (LONGINT h, LONGINT p, LONGINT l) +{ + INTEGER _o_result; + if (Platform_writefile(h, p, l) == 0) { + _o_result = Platform_err(); + return _o_result; + } else { + _o_result = 0; + return _o_result; + } + __RETCHK; +} + +INTEGER Platform_Sync (LONGINT h) +{ + INTEGER _o_result; + if (Platform_flushFileBuffers(h) == 0) { + _o_result = Platform_err(); + return _o_result; + } else { + _o_result = 0; + return _o_result; + } + __RETCHK; +} + +INTEGER Platform_Seek (LONGINT h, LONGINT o, INTEGER r) +{ + INTEGER _o_result; + INTEGER rc; + Platform_largeInteger(); + Platform_setFilePointerEx(h, o, r, &rc); + if (rc == 0) { + _o_result = Platform_err(); + return _o_result; + } else { + _o_result = 0; + return _o_result; + } + __RETCHK; +} + +INTEGER Platform_Truncate (LONGINT h, LONGINT limit) +{ + INTEGER _o_result; + INTEGER rc; + LONGINT oldpos; + Platform_largeInteger(); + Platform_getFilePos(h, &oldpos, &rc); + if (rc == 0) { + _o_result = Platform_err(); + return _o_result; + } + Platform_setFilePointerEx(h, limit, Platform_seekset(), &rc); + if (rc == 0) { + _o_result = Platform_err(); + return _o_result; + } + if (Platform_setEndOfFile(h) == 0) { + _o_result = Platform_err(); + return _o_result; + } + Platform_setFilePointerEx(h, oldpos, Platform_seekset(), &rc); + if (rc == 0) { + _o_result = Platform_err(); + return _o_result; + } + _o_result = 0; + return _o_result; +} + +INTEGER Platform_Unlink (CHAR *n, LONGINT n__len) +{ + INTEGER _o_result; + if (Platform_deleteFile(n, n__len) == 0) { + _o_result = Platform_err(); + return _o_result; + } else { + _o_result = 0; + return _o_result; + } + __RETCHK; +} + +INTEGER Platform_Chdir (CHAR *n, LONGINT n__len) +{ + INTEGER _o_result; + INTEGER r; + r = Platform_setCurrentDirectory(n, n__len); + if (r == 0) { + _o_result = Platform_err(); + return _o_result; + } + Platform_getCurrentDirectory((void*)Platform_CWD, ((LONGINT)(4096))); + _o_result = 0; + return _o_result; +} + +INTEGER Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) +{ + INTEGER _o_result; + if (Platform_moveFile(o, o__len, n, n__len) == 0) { + _o_result = Platform_err(); + return _o_result; + } else { + _o_result = 0; + return _o_result; + } + __RETCHK; +} + +void Platform_Exit (INTEGER code) +{ + Platform_exit(code); +} + +static void Platform_errch (CHAR c) +{ + Platform_errc(c); +} + +static void Platform_errln (void) +{ + Platform_errch(0x0d); + Platform_errch(0x0a); +} + +static void Platform_errposint (LONGINT l) +{ + if (l > 10) { + Platform_errposint(__DIV(l, 10)); + } + Platform_errch((CHAR)(48 + __MOD(l, 10))); +} + +static void Platform_errint (LONGINT l) +{ + if (l < 0) { + Platform_errch('-'); + l = -l; + } + Platform_errposint(l); +} + +static void Platform_DisplayHaltCode (LONGINT code) +{ + switch (code) { + case -1: + Platform_errstring((CHAR*)"Rider ReadBuf/WriteBuf transfer size longer than buffer.", (LONGINT)57); + break; + case -2: + Platform_errstring((CHAR*)"Index out of range.", (LONGINT)20); + break; + case -3: + Platform_errstring((CHAR*)"Reached end of function without reaching RETURN.", (LONGINT)49); + break; + case -4: + Platform_errstring((CHAR*)"CASE statement: no matching label and no ELSE.", (LONGINT)47); + break; + case -5: + Platform_errstring((CHAR*)"Type guard failed.", (LONGINT)19); + break; + case -6: + Platform_errstring((CHAR*)"Type equality failed.", (LONGINT)22); + break; + case -7: + Platform_errstring((CHAR*)"WITH statement type guard failed.", (LONGINT)34); + break; + case -8: + Platform_errstring((CHAR*)"SHORT: Value too large for shorter type.", (LONGINT)41); + break; + case -9: + Platform_errstring((CHAR*)"Heap interrupted while locked, but lockdepth = 0 at unlock.", (LONGINT)60); + break; + case -15: + Platform_errstring((CHAR*)"Type descriptor size mismatch.", (LONGINT)31); + break; + case -20: + Platform_errstring((CHAR*)"Too many, or negative number of, elements in dynamic array.", (LONGINT)60); + break; + default: + break; + } +} + +void Platform_Halt (LONGINT code) +{ + INTEGER e; + Platform_HaltCode = code; + if (Platform_HaltHandler != NIL) { + (*Platform_HaltHandler)(code); + } + Platform_errstring((CHAR*)"Terminated by Halt(", (LONGINT)20); + Platform_errint(code); + Platform_errstring((CHAR*)"). ", (LONGINT)4); + if (code < 0) { + Platform_DisplayHaltCode(code); + } + Platform_errln(); + Platform_exit(__VAL(INTEGER, code)); +} + +void Platform_AssertFail (LONGINT code) +{ + INTEGER e; + Platform_errstring((CHAR*)"Assertion failure.", (LONGINT)19); + if (code != 0) { + Platform_errstring((CHAR*)" ASSERT code ", (LONGINT)14); + Platform_errint(code); + Platform_errstring((CHAR*)".", (LONGINT)2); + } + Platform_errln(); + Platform_exit(__VAL(INTEGER, code)); +} + +void Platform_SetHalt (Platform_HaltProcedure p) +{ + Platform_HaltHandler = p; +} + +static void Platform_TestLittleEndian (void) +{ + INTEGER i; + i = 1; + __GET((LONGINT)(uintptr_t)&i, Platform_LittleEndian, BOOLEAN); +} + +__TDESC(Platform_FileIdentity, 1, 0) = {__TDFLDS("FileIdentity", 20), {-4}}; + +export void *Platform__init(void) +{ + __DEFMOD; + __REGMOD("Platform", 0); + __INITYP(Platform_FileIdentity, Platform_FileIdentity, 0); +/* BEGIN */ + Platform_TestLittleEndian(); + Platform_HaltCode = -128; + Platform_HaltHandler = NIL; + Platform_TimeStart = Platform_Time(); + Platform_CWD[0] = 0x00; + Platform_getCurrentDirectory((void*)Platform_CWD, ((LONGINT)(4096))); + Platform_PID = Platform_getpid(); + Platform_SeekSet = Platform_seekset(); + Platform_SeekCur = Platform_seekcur(); + Platform_SeekEnd = Platform_seekend(); + Platform_StdIn = Platform_getstdinhandle(); + Platform_StdOut = Platform_getstdouthandle(); + Platform_StdErr = Platform_getstderrhandle(); + Platform_nl[0] = 0x0d; + Platform_nl[1] = 0x0a; + Platform_nl[2] = 0x00; + __ENDMOD; +} diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h new file mode 100644 index 00000000..e912678e --- /dev/null +++ b/bootstrap/windows-48/Platform.h @@ -0,0 +1,84 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ + +#ifndef Platform__h +#define Platform__h + +#include "SYSTEM.h" + +typedef + struct Platform_FileIdentity { + LONGINT _prvt0; + char _prvt1[16]; + } Platform_FileIdentity; + +typedef + void (*Platform_HaltProcedure)(LONGINT); + +typedef + void (*Platform_SignalHandler)(INTEGER); + + +import BOOLEAN Platform_LittleEndian; +import LONGINT Platform_MainStackFrame, Platform_HaltCode; +import INTEGER Platform_PID; +import CHAR Platform_CWD[4096]; +import INTEGER Platform_ArgCount; +import LONGINT Platform_ArgVector; +import INTEGER Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; +import LONGINT Platform_StdIn, Platform_StdOut, Platform_StdErr; +import CHAR Platform_nl[3]; + +import LONGINT *Platform_FileIdentity__typ; + +import BOOLEAN Platform_Absent (INTEGER e); +import INTEGER Platform_ArgPos (CHAR *s, LONGINT s__len); +import void Platform_AssertFail (LONGINT code); +import INTEGER Platform_Chdir (CHAR *n, LONGINT n__len); +import INTEGER Platform_Close (LONGINT h); +import BOOLEAN Platform_ConnectionFailed (INTEGER e); +import void Platform_Delay (LONGINT ms); +import BOOLEAN Platform_DifferentFilesystems (INTEGER e); +import INTEGER Platform_Error (void); +import void Platform_Exit (INTEGER code); +import void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len); +import void Platform_GetClock (LONGINT *t, LONGINT *d); +import void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); +import void Platform_GetIntArg (INTEGER n, LONGINT *val); +import void Platform_GetTimeOfDay (LONGINT *sec, LONGINT *usec); +import void Platform_Halt (LONGINT code); +import INTEGER Platform_Identify (LONGINT h, Platform_FileIdentity *identity, LONGINT *identity__typ); +import INTEGER Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); +import BOOLEAN Platform_Inaccessible (INTEGER e); +import void Platform_Init (INTEGER argc, LONGINT argvadr); +import void Platform_MTimeAsClock (Platform_FileIdentity i, LONGINT *t, LONGINT *d); +import INTEGER Platform_New (CHAR *n, LONGINT n__len, LONGINT *h); +import BOOLEAN Platform_NoSuchDirectory (INTEGER e); +import LONGINT Platform_OSAllocate (LONGINT size); +import void Platform_OSFree (LONGINT address); +import INTEGER Platform_OldRO (CHAR *n, LONGINT n__len, LONGINT *h); +import INTEGER Platform_OldRW (CHAR *n, LONGINT n__len, LONGINT *h); +import INTEGER Platform_Read (LONGINT h, LONGINT p, LONGINT l, LONGINT *n); +import INTEGER Platform_ReadBuf (LONGINT h, SYSTEM_BYTE *b, LONGINT b__len, LONGINT *n); +import INTEGER Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); +import BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); +import BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); +import INTEGER Platform_Seek (LONGINT h, LONGINT o, INTEGER r); +import void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); +import void Platform_SetHalt (Platform_HaltProcedure p); +import void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Platform_FileIdentity source); +import INTEGER Platform_Size (LONGINT h, LONGINT *l); +import INTEGER Platform_Sync (LONGINT h); +import INTEGER Platform_System (CHAR *cmd, LONGINT cmd__len); +import LONGINT Platform_Time (void); +import BOOLEAN Platform_TimedOut (INTEGER e); +import BOOLEAN Platform_TooManyFiles (INTEGER e); +import INTEGER Platform_Truncate (LONGINT h, LONGINT limit); +import INTEGER Platform_Unlink (CHAR *n, LONGINT n__len); +import INTEGER Platform_Write (LONGINT h, LONGINT p, LONGINT l); +import BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); +import void *Platform__init(void); + +#define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((uintptr_t)h) +#define Platform_SetQuitHandler(h) SystemSetQuitHandler((uintptr_t)h) + +#endif diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c new file mode 100644 index 00000000..65dad750 --- /dev/null +++ b/bootstrap/windows-48/Reals.c @@ -0,0 +1,155 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +#include "SYSTEM.h" + + + + +export void Reals_Convert (REAL x, INTEGER n, CHAR *d, LONGINT d__len); +export void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len); +export void Reals_ConvertHL (LONGREAL y, CHAR *d, LONGINT d__len); +export void Reals_ConvertL (LONGREAL x, INTEGER n, CHAR *d, LONGINT d__len); +export INTEGER Reals_Expo (REAL x); +export INTEGER Reals_ExpoL (LONGREAL x); +export REAL Reals_Ten (INTEGER e); +export LONGREAL Reals_TenL (INTEGER e); +static CHAR Reals_ToHex (INTEGER i); + + +REAL Reals_Ten (INTEGER e) +{ + REAL _o_result; + LONGREAL r, power; + r = (LONGREAL)1; + power = (LONGREAL)10; + while (e > 0) { + if (__ODD(e)) { + r = r * power; + } + power = power * power; + e = __ASHR(e, 1); + } + _o_result = r; + return _o_result; +} + +LONGREAL Reals_TenL (INTEGER e) +{ + LONGREAL _o_result; + LONGREAL r, power; + r = (LONGREAL)1; + power = (LONGREAL)10; + for (;;) { + if (__ODD(e)) { + r = r * power; + } + e = __ASHR(e, 1); + if (e <= 0) { + _o_result = r; + return _o_result; + } + power = power * power; + } + __RETCHK; +} + +INTEGER Reals_Expo (REAL x) +{ + INTEGER _o_result; + _o_result = (int)__MASK(__ASHR((LONGINT)(__VAL(INTEGER, x)), 23), -256); + return _o_result; +} + +INTEGER Reals_ExpoL (LONGREAL x) +{ + INTEGER _o_result; + INTEGER i; + LONGINT l; + __GET((LONGINT)(uintptr_t)&x + 4, l, LONGINT); + _o_result = (int)__MASK(__ASHR(l, 20), -2048); + return _o_result; +} + +void Reals_ConvertL (LONGREAL x, INTEGER n, CHAR *d, LONGINT d__len) +{ + LONGINT i, j, k; + if (x < (LONGREAL)0) { + x = -x; + } + k = 0; + if (n > 9) { + i = __ENTIER(x / (LONGREAL)(LONGREAL)1000000000); + j = __ENTIER(x - i * (LONGREAL)1000000000); + if (j < 0) { + j = 0; + } + while (k < 9) { + d[__X(k, d__len)] = (CHAR)(__MOD(j, 10) + 48); + j = __DIV(j, 10); + k += 1; + } + } else { + i = __ENTIER(x); + } + while (k < (LONGINT)n) { + d[__X(k, d__len)] = (CHAR)(__MOD(i, 10) + 48); + i = __DIV(i, 10); + k += 1; + } +} + +void Reals_Convert (REAL x, INTEGER n, CHAR *d, LONGINT d__len) +{ + Reals_ConvertL(x, n, (void*)d, d__len); +} + +static CHAR Reals_ToHex (INTEGER i) +{ + CHAR _o_result; + if (i < 10) { + _o_result = (CHAR)(i + 48); + return _o_result; + } else { + _o_result = (CHAR)(i + 55); + return _o_result; + } + __RETCHK; +} + +typedef + CHAR (*pc4__3)[4]; + +void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len) +{ + pc4__3 p = NIL; + INTEGER i; + p = (pc4__3)(uintptr_t)((LONGINT)(uintptr_t)&y); + i = 0; + while (i < 4) { + d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((int)(*p)[__X(i, ((LONGINT)(4)))], 4)); + d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((int)(*p)[__X(i, ((LONGINT)(4)))], -16)); + } +} + +typedef + CHAR (*pc8__5)[8]; + +void Reals_ConvertHL (LONGREAL y, CHAR *d, LONGINT d__len) +{ + pc8__5 p = NIL; + INTEGER i; + p = (pc8__5)(uintptr_t)((LONGINT)(uintptr_t)&y); + i = 0; + while (i < 8) { + d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((int)(*p)[__X(i, ((LONGINT)(8)))], 4)); + d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((int)(*p)[__X(i, ((LONGINT)(8)))], -16)); + } +} + + +export void *Reals__init(void) +{ + __DEFMOD; + __REGMOD("Reals", 0); +/* BEGIN */ + __ENDMOD; +} diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h new file mode 100644 index 00000000..166e977b --- /dev/null +++ b/bootstrap/windows-48/Reals.h @@ -0,0 +1,22 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ + +#ifndef Reals__h +#define Reals__h + +#include "SYSTEM.h" + + + + +import void Reals_Convert (REAL x, INTEGER n, CHAR *d, LONGINT d__len); +import void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len); +import void Reals_ConvertHL (LONGREAL y, CHAR *d, LONGINT d__len); +import void Reals_ConvertL (LONGREAL x, INTEGER n, CHAR *d, LONGINT d__len); +import INTEGER Reals_Expo (REAL x); +import INTEGER Reals_ExpoL (LONGREAL x); +import REAL Reals_Ten (INTEGER e); +import LONGREAL Reals_TenL (INTEGER e); +import void *Reals__init(void); + + +#endif diff --git a/bootstrap/windows-48/SYSTEM.c b/bootstrap/windows-48/SYSTEM.c new file mode 100644 index 00000000..0fcc5ee2 --- /dev/null +++ b/bootstrap/windows-48/SYSTEM.c @@ -0,0 +1,207 @@ +/* +* The body prefix file of the voc(jet backend) runtime system, Version 1.0 +* +* Copyright (c) Software Templ, 1994, 1995 +* +* Module SYSTEM is subject to change any time without prior notification. +* Software Templ disclaims all warranties with regard to module SYSTEM, +* in particular shall Software Templ not be liable for any damage resulting +* from inappropriate use or modification of module SYSTEM. +* +* Version 1.1 jt, 24.11.95 fixes for correct pointer arithmetic on Cray computers +* jt 31.1.2007 ANSI prototypes for malloc and exit in order to avoid cc warnings +* +*/ + +#include "SYSTEM.h" +#include "stdarg.h" +#include + + +LONGINT SYSTEM_XCHK(LONGINT i, LONGINT ub) {return __X(i, ub);} +LONGINT SYSTEM_RCHK(LONGINT i, LONGINT ub) {return __R(i, ub);} +LONGINT SYSTEM_ASH (LONGINT i, LONGINT n) {return __ASH(i, n);} +LONGINT SYSTEM_ABS (LONGINT i) {return __ABS(i);} +double SYSTEM_ABSD(double i) {return __ABS(i);} + +void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0) +{ + t -= __TPROC0OFF; + t0 -= __TPROC0OFF; + while (*t0 != __EOM) {*t = *t0; t--; t0--;} +} + + +void SYSTEM_ENUMP(void *adr, LONGINT n, void (*P)()) +{ + while (n > 0) { + P((LONGINT)(uintptr_t)(*((void**)(adr)))); + adr = ((void**)adr) + 1; + n--; + } +} + +void SYSTEM_ENUMR(void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()) +{ + LONGINT *t, off; + typ++; + while (n > 0) { + t = typ; + off = *t; + while (off >= 0) {P(*(LONGINT*)((char*)adr+off)); t++; off = *t;} + adr = ((char*)adr) + size; + n--; + } +} + +LONGINT SYSTEM_DIV(unsigned LONGINT x, unsigned LONGINT y) +{ if ((LONGINT) x >= 0) return (x / y); + else return -((y - 1 - x) / y); +} + +LONGINT SYSTEM_MOD(unsigned LONGINT x, unsigned LONGINT y) +{ unsigned LONGINT m; + if ((LONGINT) x >= 0) return (x % y); + else { m = (-x) % y; + if (m != 0) return (y - m); else return 0; + } +} + +LONGINT SYSTEM_ENTIER(double x) +{ + LONGINT y; + if (x >= 0) + return (LONGINT)x; + else { + y = (LONGINT)x; + if (y <= x) return y; else return y - 1; + } +} + +extern void Heap_Lock(); +extern void Heap_Unlock(); + +SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, int nofdyn, ...) +{ + LONGINT nofelems, size, dataoff, n, nptr, *x, *p, nofptrs, i, *ptab, off; + va_list ap; + va_start(ap, nofdyn); + nofelems = 1; + while (nofdim > 0) { + nofelems = nofelems * va_arg(ap, LONGINT); nofdim--; + if (nofelems <= 0) __HALT(-20); + } + va_end(ap); + dataoff = nofdyn * sizeof(LONGINT); + if (elemalgn > sizeof(LONGINT)) { + n = dataoff % elemalgn; + if (n != 0) dataoff += elemalgn - n; + } + size = dataoff + nofelems * elemsz; + Heap_Lock(); + if (typ == NIL) { + /* element typ does not contain pointers */ + x = Heap_NEWBLK(size); + } + else if (typ == (LONGINT*)POINTER__typ) { + /* element type is a pointer */ + x = Heap_NEWBLK(size + nofelems * sizeof(LONGINT)); + p = (LONGINT*)(uintptr_t)x[-1]; + p[-nofelems] = *p; /* build new type desc in situ: 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ + p -= nofelems - 1; n = 1; /* n =1 for skipping the size field */ + while (n <= nofelems) {*p = n*sizeof(LONGINT); p++; n++;} + *p = - (nofelems + 1) * sizeof(LONGINT); /* sentinel */ + x[-1] -= nofelems * sizeof(LONGINT); + } + else { + /* element type is a record that contains pointers */ + ptab = typ + 1; nofptrs = 0; + while (ptab[nofptrs] >= 0) {nofptrs++;} /* number of pointers per element */ + nptr = nofelems * nofptrs; /* total number of pointers */ + x = Heap_NEWBLK(size + nptr * sizeof(LONGINT)); + p = (LONGINT*)(uintptr_t)x[- 1]; + p[-nptr] = *p; /* build new type desc in situ; 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ + p -= nptr - 1; n = 0; off = dataoff; + while (n < nofelems) {i = 0; + while (i < nofptrs) {*p = off + ptab[i]; p++; i++;} + off += elemsz; n++; + } + *p = - (nptr + 1) * sizeof(LONGINT); /* sentinel */ + x[-1] -= nptr * sizeof(LONGINT); + } + if (nofdyn != 0) { + /* setup len vector for index checks */ + va_start(ap, nofdyn); + p = x; + while (nofdyn > 0) {*p = va_arg(ap, LONGINT); p++, nofdyn--;} + va_end(ap); + } + Heap_Unlock(); + return x; +} + + + + +typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler + +#ifndef _WIN32 + + SystemSignalHandler handler[3] = {0}; + + // Provide signal handling for Unix based systems + void signalHandler(int s) { + if (s >= 2 && s <= 4) handler[s-2](s); + // (Ignore other signals) + } + + void SystemSetHandler(int s, uintptr_t h) { + if (s >= 2 && s <= 4) { + int needtosetsystemhandler = handler[s-2] == 0; + handler[s-2] = (SystemSignalHandler)h; + if (needtosetsystemhandler) {signal(s, signalHandler);} + } + } + +#else + + // Provides Windows callback handlers for signal-like scenarios + #include "WindowsWrapper.h" + + SystemSignalHandler SystemInterruptHandler = 0; + SystemSignalHandler SystemQuitHandler = 0; + BOOL ConsoleCtrlHandlerSet = FALSE; + + BOOL WINAPI SystemConsoleCtrlHandler(DWORD ctrlType) { + if ((ctrlType == CTRL_C_EVENT) || (ctrlType == CTRL_BREAK_EVENT)) { + if (SystemInterruptHandler) { + SystemInterruptHandler(2); // SIGINT + return TRUE; + } + } else { // Close, logoff or shutdown + if (SystemQuitHandler) { + SystemQuitHandler(3); // SIGQUIT + return TRUE; + } + } + return FALSE; + } + + void EnsureConsoleCtrlHandler() { + if (!ConsoleCtrlHandlerSet) { + SetConsoleCtrlHandler(SystemConsoleCtrlHandler, TRUE); + ConsoleCtrlHandlerSet = TRUE; + } + } + + void SystemSetInterruptHandler(uintptr_t h) { + EnsureConsoleCtrlHandler(); + SystemInterruptHandler = (SystemSignalHandler)h; + } + + void SystemSetQuitHandler(uintptr_t h) { + EnsureConsoleCtrlHandler(); + SystemQuitHandler = (SystemSignalHandler)h; + } + +#endif diff --git a/bootstrap/windows-48/SYSTEM.h b/bootstrap/windows-48/SYSTEM.h new file mode 100644 index 00000000..f9e2f930 --- /dev/null +++ b/bootstrap/windows-48/SYSTEM.h @@ -0,0 +1,275 @@ +#ifndef SYSTEM__h +#define SYSTEM__h + +#ifndef _WIN32 + + // Building for a Unix/Linux based system + #include // For memcpy ... + #include // For uintptr_t ... + +#else + + // Building for Windows platform with either mingw under cygwin, or the MS C compiler + #ifdef _WIN64 + typedef unsigned long long size_t; + typedef unsigned long long uintptr_t; + #else + typedef unsigned int size_t; + typedef unsigned int uintptr_t; + #endif /* _WIN64 */ + + typedef unsigned int uint32_t; + void * __cdecl memcpy(void * dest, const void * source, size_t size); + +#endif + + +// The compiler uses 'import' and 'export' which translate to 'extern' and +// nothing respectively. + +#define import extern +#define export + + + +// Known constants + +#define NIL ((void*)0) +#define __MAXEXT 16 +#define POINTER__typ ((LONGINT*)(1)) // not NIL and not a valid type + + +// Oberon types + +#define BOOLEAN char +#define SYSTEM_BYTE unsigned char +#define CHAR unsigned char +#define SHORTINT signed char +#define REAL float +#define LONGREAL double +#define SYSTEM_PTR void* + +// For 32 bit builds, the size of LONGINT depends on a make option: + +#if (__SIZEOF_POINTER__ == 8) || defined(LARGE) || defined(_WIN64) + #define INTEGER int // INTEGER is 32 bit. + #define LONGINT long long // LONGINT is 64 bit. (long long is always 64 bits, while long can be 32 bits e.g. under MSC/MingW) +#else + #define INTEGER short int // INTEGER is 16 bit. + #define LONGINT long // LONGINT is 32 bit. +#endif + +#define SET unsigned LONGINT + + +// OS Memory allocation interfaces are in PlatformXXX.Mod + +extern LONGINT Platform_OSAllocate (LONGINT size); +extern void Platform_OSFree (LONGINT addr); + + +// Run time system routines in SYSTEM.c + +extern LONGINT SYSTEM_XCHK (LONGINT i, LONGINT ub); +extern LONGINT SYSTEM_RCHK (LONGINT i, LONGINT ub); +extern LONGINT SYSTEM_ASH (LONGINT i, LONGINT n); +extern LONGINT SYSTEM_ABS (LONGINT i); +extern double SYSTEM_ABSD (double i); +extern void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0); +extern void SYSTEM_ENUMP (void *adr, LONGINT n, void (*P)()); +extern void SYSTEM_ENUMR (void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()); +extern LONGINT SYSTEM_DIV (unsigned LONGINT x, unsigned LONGINT y); +extern LONGINT SYSTEM_MOD (unsigned LONGINT x, unsigned LONGINT y); +extern LONGINT SYSTEM_ENTIER (double x); + + +// Signal handling in SYSTEM.c + +#ifndef _WIN32 + extern void SystemSetHandler(int s, uintptr_t h); +#else + extern void SystemSetInterruptHandler(uintptr_t h); + extern void SystemSetQuitHandler (uintptr_t h); +#endif + + + +// String comparison + +static int __str_cmp(CHAR *x, CHAR *y){ + LONGINT i = 0; + CHAR ch1, ch2; + do {ch1 = x[i]; ch2 = y[i]; i++; + if (!ch1) return -(int)ch2; + } while (ch1==ch2); + return (int)ch1 - (int)ch2; +} +#define __STRCMP(a,b) __str_cmp((CHAR*)(a), (CHAR*)(b)) + + + +// Inline string, record and array copy + +#define __COPY(s, d, n) {char*_a=(void*)s,*_b=(void*)d; LONGINT _i=0,_t=n-1; \ + while(_i<_t&&((_b[_i]=_a[_i])!=0)){_i++;};_b[_i]=0;} +#define __DUP(x, l, t) x=(void*)memcpy((void*)(uintptr_t)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) +#define __DUPARR(v, t) v=(void*)memcpy(v##__copy,v,sizeof(t)) +#define __DEL(x) Platform_OSFree((LONGINT)(uintptr_t)x) + + + + +/* SYSTEM ops */ + +#define __VAL(t, x) ((t)(x)) +#define __VALP(t, x) ((t)(uintptr_t)(x)) + +#define __GET(a, x, t) x= *(t*)(uintptr_t)(a) +#define __PUT(a, x, t) *(t*)(uintptr_t)(a)=x +#define __LSHL(x, n, t) ((t)((unsigned t)(x)<<(n))) +#define __LSHR(x, n, t) ((t)((unsigned t)(x)>>(n))) +#define __LSH(x, n, t) ((n)>=0? __LSHL(x, n, t): __LSHR(x, -(n), t)) +#define __ROTL(x, n, t) ((t)((unsigned t)(x)<<(n)|(unsigned t)(x)>>(8*sizeof(t)-(n)))) +#define __ROTR(x, n, t) ((t)((unsigned t)(x)>>(n)|(unsigned t)(x)<<(8*sizeof(t)-(n)))) +#define __LSHR(x, n, t) ((t)((unsigned t)(x)>>(n))) +#define __LSH(x, n, t) ((n)>=0? __LSHL(x, n, t): __LSHR(x, -(n), t)) +#define __ROTL(x, n, t) ((t)((unsigned t)(x)<<(n)|(unsigned t)(x)>>(8*sizeof(t)-(n)))) +#define __ROTR(x, n, t) ((t)((unsigned t)(x)>>(n)|(unsigned t)(x)<<(8*sizeof(t)-(n)))) +#define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) +#define __BIT(x, n) (*(unsigned LONGINT*)(x)>>(n)&1) +#define __MOVE(s, d, n) memcpy((char*)(uintptr_t)(d),(char*)(uintptr_t)(s),n) +#define __ASHL(x, n) ((LONGINT)(x)<<(n)) +#define __ASHR(x, n) ((LONGINT)(x)>>(n)) +#define __ASH(x, n) ((n)>=0?__ASHL(x,n):__ASHR(x,-(n))) +#define __ASHF(x, n) SYSTEM_ASH((LONGINT)(x), (LONGINT)(n)) +#define __SHORT(x, y) ((int)((unsigned LONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) +#define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) +#define __CHR(x) ((CHAR)__R(x, 256)) +#define __CHRF(x) ((CHAR)__RF(x, 256)) +#define __DIV(x, y) ((x)>=0?(x)/(y):-(((y)-1-(x))/(y))) +#define __DIVF(x, y) SYSTEM_DIV((LONGINT)(x),(LONGINT)(y)) +#define __MOD(x, y) ((x)>=0?(x)%(y):__MODF(x,y)) +#define __MODF(x, y) SYSTEM_MOD((LONGINT)(x),(LONGINT)(y)) +#define __ENTIER(x) SYSTEM_ENTIER(x) +#define __ABS(x) (((x)<0)?-(x):(x)) +#define __ABSF(x) SYSTEM_ABS((LONGINT)(x)) +#define __ABSFD(x) SYSTEM_ABSD((double)(x)) +#define __CAP(ch) ((CHAR)((ch)&0x5f)) +#define __ODD(x) ((x)&1) +#define __IN(x, s) (((s)>>(x))&1) +#define __SETOF(x) ((SET)1<<(x)) +#define __SETRNG(l, h) ((~(SET)0<<(l))&~(SET)0>>(8*sizeof(SET)-1-(h))) +#define __MASK(x, m) ((x)&~(m)) + + + +// Runtime checks + +#define __X(i, ub) (((unsigned LONGINT)(i)<(unsigned LONGINT)(ub))?i:(__HALT(-2),0)) +#define __XF(i, ub) SYSTEM_XCHK((LONGINT)(i), (LONGINT)(ub)) +#define __R(i, ub) (((unsigned LONGINT)(i)<(unsigned LONGINT)(ub))?i:(__HALT(-8),0)) +#define __RF(i, ub) SYSTEM_RCHK((LONGINT)(i),(LONGINT)(ub)) +#define __RETCHK __retchk: __HALT(-3); return 0; +#define __CASECHK __HALT(-4) +#define __WITHCHK __HALT(-7) + +#define __GUARDP(p, typ, level) ((typ*)(__ISP(p,typ,level)?p:(__HALT(-5),p))) +#define __GUARDR(r, typ, level) (*((typ*)(__IS(r##__typ,typ,level)?r:(__HALT(-5),r)))) +#define __GUARDA(p, typ, level) ((struct typ*)(__IS(__TYPEOF(p),typ,level)?p:(__HALT(-5),p))) +#define __GUARDEQR(p, dyntyp, typ) if(dyntyp!=typ##__typ) __HALT(-6);*(p) +#define __GUARDEQP(p, typ) if(__TYPEOF(p)!=typ##__typ)__HALT(-6);*(p) + + + +// Module entry/registration/exit + +extern void Heap_REGCMD(); +extern SYSTEM_PTR Heap_REGMOD(); +extern void Heap_REGTYP(); +extern void Heap_INCREF(); + +#define __DEFMOD static void *m; if (m!=0) {return m;} +#define __REGCMD(name, cmd) Heap_REGCMD(m, (CHAR*)name, cmd) +#define __REGMOD(name, enum) if (m==0) {m = Heap_REGMOD((CHAR*)name,enum);} +#define __ENDMOD return m +#define __MODULE_IMPORT(name) Heap_INCREF(name##__init()) + + + +// Main module initialisation, registration and finalisation + +extern void Platform_Init(INTEGER argc, LONGINT argv); +extern void *Platform_MainModule; +extern void Heap_FINALL(); + +#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (LONGINT)(uintptr_t)&argv); +#define __REGMAIN(name, enum) m = Heap_REGMOD((CHAR*)name,enum) +#define __FINI Heap_FINALL(); return 0 + + +// Assertions and Halts + +extern void Platform_Halt(LONGINT x); +extern void Platform_AssertFail(LONGINT x); + +#define __HALT(x) Platform_Halt(x) +#define __ASSERT(cond, x) if (!(cond)) Platform_AssertFail((LONGINT)(x)) + + +// Memory allocation + +extern SYSTEM_PTR Heap_NEWBLK (LONGINT size); +extern SYSTEM_PTR Heap_NEWREC (LONGINT tag); +extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); + +#define __SYSNEW(p, len) p = Heap_NEWBLK((LONGINT)(len)) +#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(uintptr_t)t##__typ) +#define __NEWARR SYSTEM_NEWARR + + + +/* Type handling */ + +#define __TDESC(t, m, n) \ + static struct t##__desc { \ + LONGINT tproc[m]; /* Proc for each ptr field */ \ + LONGINT tag; \ + LONGINT next; /* Module table type list points here */ \ + LONGINT level; \ + LONGINT module; \ + char name[24]; \ + LONGINT basep[__MAXEXT]; /* List of bases this extends */ \ + LONGINT reserved; \ + LONGINT blksz; /* xxx_typ points here */ \ + LONGINT ptr[n+1]; /* Offsets of ptrs up to -ve sentinel */ \ + } t##__desc + +#define __BASEOFF (__MAXEXT+1) // blksz as index to base. +#define __TPROC0OFF (__BASEOFF+24/sizeof(LONGINT)+5) // blksz as index to tproc IFF m=1. +#define __EOM 1 +#define __TDFLDS(name, size) {__EOM}, 1, 0, 0, 0, name, {0}, 0, size +#define __ENUMP(adr, n, P) SYSTEM_ENUMP(adr, (LONGINT)(n), P) +#define __ENUMR(adr, typ, size, n, P) SYSTEM_ENUMR(adr, typ, (LONGINT)(size), (LONGINT)(n), P) + +#define __INITYP(t, t0, level) \ + t##__typ = (LONGINT*)&t##__desc.blksz; \ + memcpy(t##__desc.basep, t0##__typ - __BASEOFF, level*sizeof(LONGINT)); \ + t##__desc.basep[level] = (LONGINT)(uintptr_t)t##__typ; \ + t##__desc.module = (LONGINT)(uintptr_t)m; \ + if(t##__desc.blksz!=sizeof(struct t)) __HALT(-15); \ + t##__desc.blksz = (t##__desc.blksz+5*sizeof(LONGINT)-1)/(4*sizeof(LONGINT))*(4*sizeof(LONGINT)); \ + Heap_REGTYP(m, (LONGINT)(uintptr_t)&t##__desc.next); \ + SYSTEM_INHERIT(t##__typ, t0##__typ) + +#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(uintptr_t)typ##__typ) +#define __TYPEOF(p) ((LONGINT*)(uintptr_t)(*(((LONGINT*)(p))-1))) +#define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) + +// Oberon-2 type bound procedures support +#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(uintptr_t)proc +#define __SEND(typ, num, funtyp, parlist) ((funtyp)((uintptr_t)*(typ-(__TPROC0OFF+num))))parlist + + + + +#endif diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c new file mode 100644 index 00000000..5038ca68 --- /dev/null +++ b/bootstrap/windows-48/Strings.c @@ -0,0 +1,243 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +#include "SYSTEM.h" + + + + +export void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len); +export void Strings_Cap (CHAR *s, LONGINT s__len); +export void Strings_Delete (CHAR *s, LONGINT s__len, INTEGER pos, INTEGER n); +export void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n, CHAR *dest, LONGINT dest__len); +export void Strings_Insert (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, LONGINT dest__len); +export INTEGER Strings_Length (CHAR *s, LONGINT s__len); +export BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len); +export INTEGER Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, INTEGER pos); +export void Strings_Replace (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, LONGINT dest__len); + + +INTEGER Strings_Length (CHAR *s, LONGINT s__len) +{ + INTEGER _o_result; + INTEGER i; + __DUP(s, s__len, CHAR); + i = 0; + while (((LONGINT)i < s__len && s[__X(i, s__len)] != 0x00)) { + i += 1; + } + _o_result = i; + __DEL(s); + return _o_result; +} + +void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len) +{ + INTEGER n1, n2, i; + __DUP(extra, extra__len, CHAR); + n1 = Strings_Length(dest, dest__len); + n2 = Strings_Length(extra, extra__len); + i = 0; + while ((i < n2 && (LONGINT)(i + n1) < dest__len)) { + dest[__X(i + n1, dest__len)] = extra[__X(i, extra__len)]; + i += 1; + } + if ((LONGINT)(i + n1) < dest__len) { + dest[__X(i + n1, dest__len)] = 0x00; + } + __DEL(extra); +} + +void Strings_Insert (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, LONGINT dest__len) +{ + INTEGER n1, n2, i; + __DUP(source, source__len, CHAR); + n1 = Strings_Length(dest, dest__len); + n2 = Strings_Length(source, source__len); + if (pos < 0) { + pos = 0; + } + if (pos > n1) { + Strings_Append(dest, dest__len, (void*)source, source__len); + return; + } + if ((LONGINT)(pos + n2) < dest__len) { + i = n1; + while (i >= pos) { + if ((LONGINT)(i + n2) < dest__len) { + dest[__X(i + n2, dest__len)] = dest[__X(i, dest__len)]; + } + i -= 1; + } + } + i = 0; + while (i < n2) { + dest[__X(pos + i, dest__len)] = source[__X(i, source__len)]; + i += 1; + } + __DEL(source); +} + +void Strings_Delete (CHAR *s, LONGINT s__len, INTEGER pos, INTEGER n) +{ + INTEGER len, i; + len = Strings_Length(s, s__len); + if (pos < 0) { + pos = 0; + } else if (pos >= len) { + return; + } + if (pos + n < len) { + i = pos + n; + while (i < len) { + s[__X(i - n, s__len)] = s[__X(i, s__len)]; + i += 1; + } + if ((LONGINT)(i - n) < s__len) { + s[__X(i - n, s__len)] = 0x00; + } + } else { + s[__X(pos, s__len)] = 0x00; + } +} + +void Strings_Replace (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, LONGINT dest__len) +{ + __DUP(source, source__len, CHAR); + Strings_Delete((void*)dest, dest__len, pos, pos + Strings_Length(source, source__len)); + Strings_Insert(source, source__len, pos, (void*)dest, dest__len); + __DEL(source); +} + +void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n, CHAR *dest, LONGINT dest__len) +{ + INTEGER len, destLen, i; + __DUP(source, source__len, CHAR); + len = Strings_Length(source, source__len); + destLen = (int)dest__len - 1; + if (pos < 0) { + pos = 0; + } + if (pos >= len) { + dest[0] = 0x00; + return; + } + i = 0; + while (((((LONGINT)(pos + i) <= source__len && source[__X(pos + i, source__len)] != 0x00)) && i < n)) { + if (i < destLen) { + dest[__X(i, dest__len)] = source[__X(pos + i, source__len)]; + } + i += 1; + } + dest[__X(i, dest__len)] = 0x00; + __DEL(source); +} + +INTEGER Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, INTEGER pos) +{ + INTEGER _o_result; + INTEGER n1, n2, i, j; + __DUP(pattern, pattern__len, CHAR); + __DUP(s, s__len, CHAR); + n1 = Strings_Length(s, s__len); + n2 = Strings_Length(pattern, pattern__len); + if (n2 == 0) { + _o_result = 0; + __DEL(pattern); + __DEL(s); + return _o_result; + } + i = pos; + while (i <= n1 - n2) { + if (s[__X(i, s__len)] == pattern[0]) { + j = 1; + while ((j < n2 && s[__X(i + j, s__len)] == pattern[__X(j, pattern__len)])) { + j += 1; + } + if (j == n2) { + _o_result = i; + __DEL(pattern); + __DEL(s); + return _o_result; + } + } + i += 1; + } + _o_result = -1; + __DEL(pattern); + __DEL(s); + return _o_result; +} + +void Strings_Cap (CHAR *s, LONGINT s__len) +{ + INTEGER i; + i = 0; + while (s[__X(i, s__len)] != 0x00) { + if (('a' <= s[__X(i, s__len)] && s[__X(i, s__len)] <= 'z')) { + s[__X(i, s__len)] = __CAP(s[__X(i, s__len)]); + } + i += 1; + } +} + +static struct Match__7 { + struct Match__7 *lnk; +} *Match__7_s; + +static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, INTEGER n, INTEGER m); + +static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, INTEGER n, INTEGER m) +{ + BOOLEAN _o_result; + while ((((n >= 0 && m >= 0)) && mask[__X(m, mask__len)] != '*')) { + if (name[__X(n, name__len)] != mask[__X(m, mask__len)]) { + _o_result = 0; + return _o_result; + } + n -= 1; + m -= 1; + } + if (m < 0) { + _o_result = n < 0; + return _o_result; + } + while ((m >= 0 && mask[__X(m, mask__len)] == '*')) { + m -= 1; + } + if (m < 0) { + _o_result = 1; + return _o_result; + } + while (n >= 0) { + if (M__8(name, name__len, mask, mask__len, n, m)) { + _o_result = 1; + return _o_result; + } + n -= 1; + } + _o_result = 0; + return _o_result; +} + +BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len) +{ + BOOLEAN _o_result; + struct Match__7 _s; + __DUP(string, string__len, CHAR); + __DUP(pattern, pattern__len, CHAR); + _s.lnk = Match__7_s; + Match__7_s = &_s; + _o_result = M__8((void*)string, string__len, (void*)pattern, pattern__len, Strings_Length(string, string__len) - 1, Strings_Length(pattern, pattern__len) - 1); + Match__7_s = _s.lnk; + __DEL(string); + __DEL(pattern); + return _o_result; +} + + +export void *Strings__init(void) +{ + __DEFMOD; + __REGMOD("Strings", 0); +/* BEGIN */ + __ENDMOD; +} diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h new file mode 100644 index 00000000..a8d8d207 --- /dev/null +++ b/bootstrap/windows-48/Strings.h @@ -0,0 +1,23 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ + +#ifndef Strings__h +#define Strings__h + +#include "SYSTEM.h" + + + + +import void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len); +import void Strings_Cap (CHAR *s, LONGINT s__len); +import void Strings_Delete (CHAR *s, LONGINT s__len, INTEGER pos, INTEGER n); +import void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n, CHAR *dest, LONGINT dest__len); +import void Strings_Insert (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, LONGINT dest__len); +import INTEGER Strings_Length (CHAR *s, LONGINT s__len); +import BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len); +import INTEGER Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, INTEGER pos); +import void Strings_Replace (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, LONGINT dest__len); +import void *Strings__init(void); + + +#endif diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c new file mode 100644 index 00000000..8c2cc3b2 --- /dev/null +++ b/bootstrap/windows-48/Texts.c @@ -0,0 +1,1838 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +#include "SYSTEM.h" +#include "Files.h" +#include "Modules.h" +#include "Reals.h" + +typedef + struct Texts_RunDesc *Texts_Run; + +typedef + struct Texts_FontDesc *Texts_FontsFont; + +typedef + struct Texts_RunDesc { + Texts_Run prev, next; + LONGINT len; + Texts_FontsFont fnt; + SHORTINT col, voff; + BOOLEAN ascii; + } Texts_RunDesc; + +typedef + struct Texts_ElemDesc *Texts_Elem; + +typedef + struct Texts_ElemMsg { + char _prvt0[1]; + } Texts_ElemMsg; + +typedef + void (*Texts_Handler)(Texts_Elem, Texts_ElemMsg*, LONGINT *); + +typedef + struct Texts_TextDesc *Texts_Text; + +typedef + struct Texts_ElemDesc { + Texts_Run prev, next; + LONGINT len; + Texts_FontsFont fnt; + SHORTINT col, voff; + BOOLEAN ascii; + LONGINT W, H; + Texts_Handler handle; + Texts_Text base; + } Texts_ElemDesc; + +struct Texts__1 { /* Texts_ElemDesc */ + Texts_Run prev, next; + LONGINT len; + Texts_FontsFont fnt; + SHORTINT col, voff; + BOOLEAN ascii; + LONGINT W, H; + Texts_Handler handle; + Texts_Text base; + Files_File file; + LONGINT org, span; + CHAR mod[32], proc[32]; +}; + +typedef + struct Texts__1 *Texts_Alien; + +typedef + struct Texts_BufDesc { + LONGINT len; + Texts_Run head; + } Texts_BufDesc; + +typedef + Texts_BufDesc *Texts_Buffer; + +typedef + struct Texts_CopyMsg { /* Texts_ElemMsg */ + Texts_Elem e; + } Texts_CopyMsg; + +typedef + struct Texts_FileMsg { /* Texts_ElemMsg */ + INTEGER id; + LONGINT pos; + Files_Rider r; + } Texts_FileMsg; + +typedef + struct Texts_FontDesc { + CHAR name[32]; + } Texts_FontDesc; + +typedef + struct Texts_IdentifyMsg { /* Texts_ElemMsg */ + CHAR mod[32], proc[32]; + } Texts_IdentifyMsg; + +typedef + void (*Texts_Notifier)(Texts_Text, INTEGER, LONGINT, LONGINT); + +typedef + struct Texts_PieceDesc *Texts_Piece; + +typedef + struct Texts_PieceDesc { + Texts_Run prev, next; + LONGINT len; + Texts_FontsFont fnt; + SHORTINT col, voff; + BOOLEAN ascii; + Files_File file; + LONGINT org; + } Texts_PieceDesc; + +typedef + struct Texts_Reader { + BOOLEAN eot; + Texts_FontsFont fnt; + SHORTINT col, voff; + Texts_Elem elem; + Files_Rider rider; + Texts_Run run; + LONGINT org, off; + } Texts_Reader; + +typedef + struct Texts_Scanner { /* Texts_Reader */ + BOOLEAN eot; + Texts_FontsFont fnt; + SHORTINT col, voff; + Texts_Elem elem; + Files_Rider rider; + Texts_Run run; + LONGINT org, off; + CHAR nextCh; + INTEGER line, class; + LONGINT i; + REAL x; + LONGREAL y; + CHAR c; + SHORTINT len; + CHAR s[64]; + } Texts_Scanner; + +typedef + struct Texts_TextDesc { + LONGINT len; + Texts_Notifier notify; + Texts_Run head, cache; + LONGINT corg; + } Texts_TextDesc; + +typedef + struct Texts_Writer { + Texts_Buffer buf; + Texts_FontsFont fnt; + SHORTINT col, voff; + Files_Rider rider; + Files_File file; + } Texts_Writer; + + +export Texts_Elem Texts_new; +static Texts_Buffer Texts_del; +static Texts_FontsFont Texts_FontsDefault; + +export LONGINT *Texts_FontDesc__typ; +export LONGINT *Texts_RunDesc__typ; +export LONGINT *Texts_PieceDesc__typ; +export LONGINT *Texts_ElemMsg__typ; +export LONGINT *Texts_ElemDesc__typ; +export LONGINT *Texts_FileMsg__typ; +export LONGINT *Texts_CopyMsg__typ; +export LONGINT *Texts_IdentifyMsg__typ; +export LONGINT *Texts_BufDesc__typ; +export LONGINT *Texts_TextDesc__typ; +export LONGINT *Texts_Reader__typ; +export LONGINT *Texts_Scanner__typ; +export LONGINT *Texts_Writer__typ; +export LONGINT *Texts__1__typ; + +export void Texts_Append (Texts_Text T, Texts_Buffer B); +export void Texts_ChangeLooks (Texts_Text T, LONGINT beg, LONGINT end, SET sel, Texts_FontsFont fnt, SHORTINT col, SHORTINT voff); +static Texts_Elem Texts_CloneElem (Texts_Elem e); +static Texts_Piece Texts_ClonePiece (Texts_Piece p); +export void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len); +export void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); +export void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); +export void Texts_Delete (Texts_Text T, LONGINT beg, LONGINT end); +export Texts_Text Texts_ElemBase (Texts_Elem E); +export LONGINT Texts_ElemPos (Texts_Elem E); +static void Texts_Find (Texts_Text T, LONGINT *pos, Texts_Run *u, LONGINT *org, LONGINT *off); +static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len); +static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, LONGINT *msg__typ); +export void Texts_Insert (Texts_Text T, LONGINT pos, Texts_Buffer B); +export void Texts_Load (Files_Rider *r, LONGINT *r__typ, Texts_Text T); +static void Texts_Load0 (Files_Rider *r, LONGINT *r__typ, Texts_Text T); +static void Texts_Merge (Texts_Text T, Texts_Run u, Texts_Run *v); +export void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len); +export void Texts_OpenBuf (Texts_Buffer B); +export void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, LONGINT pos); +export void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, LONGINT pos); +export void Texts_OpenWriter (Texts_Writer *W, LONGINT *W__typ); +export LONGINT Texts_Pos (Texts_Reader *R, LONGINT *R__typ); +export void Texts_Read (Texts_Reader *R, LONGINT *R__typ, CHAR *ch); +export void Texts_ReadElem (Texts_Reader *R, LONGINT *R__typ); +export void Texts_ReadPrevElem (Texts_Reader *R, LONGINT *R__typ); +export void Texts_Recall (Texts_Buffer *B); +export void Texts_Save (Texts_Text T, LONGINT beg, LONGINT end, Texts_Buffer B); +export void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ); +export void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, SHORTINT col); +export void Texts_SetFont (Texts_Writer *W, LONGINT *W__typ, Texts_FontsFont fnt); +export void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, SHORTINT voff); +static void Texts_Splice (Texts_Run un, Texts_Run v, Texts_Run w, Texts_Text base); +static void Texts_Split (LONGINT off, Texts_Run *u, Texts_Run *un); +export void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T); +export void Texts_Write (Texts_Writer *W, LONGINT *W__typ, CHAR ch); +export void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, LONGINT t, LONGINT d); +export void Texts_WriteElem (Texts_Writer *W, LONGINT *W__typ, Texts_Elem e); +export void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, LONGINT x); +export void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n); +export void Texts_WriteLn (Texts_Writer *W, LONGINT *W__typ); +export void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER n); +export void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x); +export void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n); +export void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n, INTEGER k); +export void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x); +export void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__len); + + +static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len) +{ + Texts_FontsFont _o_result; + Texts_FontsFont F = NIL; + __NEW(F, Texts_FontDesc); + __COPY(name, F->name, ((LONGINT)(32))); + _o_result = F; + return _o_result; +} + +static void Texts_Find (Texts_Text T, LONGINT *pos, Texts_Run *u, LONGINT *org, LONGINT *off) +{ + Texts_Run v = NIL; + LONGINT m; + if (*pos >= T->len) { + *pos = T->len; + *u = T->head; + *org = T->len; + *off = 0; + T->cache = T->head; + T->corg = 0; + } else { + v = T->cache->next; + m = *pos - T->corg; + if (*pos >= T->corg) { + while (m >= v->len) { + m -= v->len; + v = v->next; + } + } else { + while (m < 0) { + v = v->prev; + m += v->len; + } + } + *u = v; + *org = *pos - m; + *off = m; + T->cache = v->prev; + T->corg = *org; + } +} + +static void Texts_Split (LONGINT off, Texts_Run *u, Texts_Run *un) +{ + Texts_Piece p = NIL, U = NIL; + if (off == 0) { + *un = *u; + *u = (*un)->prev; + } else if (off >= (*u)->len) { + *un = (*u)->next; + } else { + __NEW(p, Texts_PieceDesc); + *un = (Texts_Run)p; + U = __GUARDP(*u, Texts_PieceDesc, 1); + __GUARDEQP(p, Texts_PieceDesc) = *U; + p->org += off; + p->len -= off; + U->len -= p->len; + p->ascii = (*u)->ascii; + p->prev = (Texts_Run)U; + p->next = U->next; + p->next->prev = (Texts_Run)p; + U->next = (Texts_Run)p; + } +} + +static void Texts_Merge (Texts_Text T, Texts_Run u, Texts_Run *v) +{ + Texts_Piece p = NIL, q = NIL; + if ((((((((((__ISP(u, Texts_PieceDesc, 1) && __ISP(*v, Texts_PieceDesc, 1))) && __STRCMP(u->fnt->name, (*v)->fnt->name) == 0)) && u->col == (*v)->col)) && u->voff == (*v)->voff)) && __GUARDP(u, Texts_PieceDesc, 1)->ascii == __GUARDP(*v, Texts_PieceDesc, 1)->ascii)) { + p = __GUARDP(u, Texts_PieceDesc, 1); + q = __GUARDP(*v, Texts_PieceDesc, 1); + if ((p->file == q->file && p->org + p->len == q->org)) { + if (T->cache == u) { + T->corg += q->len; + } else if (T->cache == *v) { + T->cache = T->head; + T->corg = 0; + } + p->len += q->len; + *v = (*v)->next; + } + } +} + +static void Texts_Splice (Texts_Run un, Texts_Run v, Texts_Run w, Texts_Text base) +{ + Texts_Run u = NIL; + if (v != w->next) { + u = un->prev; + u->next = v; + v->prev = u; + un->prev = w; + w->next = un; + do { + if (__ISP(v, Texts_ElemDesc, 1)) { + __GUARDP(v, Texts_ElemDesc, 1)->base = base; + } + v = v->next; + } while (!(v == un)); + } +} + +static Texts_Piece Texts_ClonePiece (Texts_Piece p) +{ + Texts_Piece _o_result; + Texts_Piece q = NIL; + __NEW(q, Texts_PieceDesc); + __GUARDEQP(q, Texts_PieceDesc) = *p; + _o_result = q; + return _o_result; +} + +static Texts_Elem Texts_CloneElem (Texts_Elem e) +{ + Texts_Elem _o_result; + Texts_CopyMsg msg; + msg.e = NIL; + (*e->handle)(e, (void*)&msg, Texts_CopyMsg__typ); + _o_result = msg.e; + return _o_result; +} + +void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE) +{ + DE->len = SE->len; + DE->fnt = SE->fnt; + DE->col = SE->col; + DE->voff = SE->voff; + DE->W = SE->W; + DE->H = SE->H; + DE->handle = SE->handle; +} + +Texts_Text Texts_ElemBase (Texts_Elem E) +{ + Texts_Text _o_result; + _o_result = E->base; + return _o_result; +} + +LONGINT Texts_ElemPos (Texts_Elem E) +{ + LONGINT _o_result; + Texts_Run u = NIL; + LONGINT pos; + u = E->base->head->next; + pos = 0; + while (u != (void *) E) { + pos = pos + u->len; + u = u->next; + } + _o_result = pos; + return _o_result; +} + +static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, LONGINT *msg__typ) +{ + Texts_Alien e = NIL; + Files_Rider r; + LONGINT i; + CHAR ch; + if (__ISP(E, Texts__1, 2)) { + if (__IS(msg__typ, Texts_CopyMsg, 1)) { + if (__IS(msg__typ, Texts_CopyMsg, 1)) { + Texts_CopyMsg *msg__ = (void*)msg; + __NEW(e, Texts__1); + Texts_CopyElem((void*)((Texts_Alien)E), (void*)e); + e->file = ((Texts_Alien)E)->file; + e->org = ((Texts_Alien)E)->org; + e->span = ((Texts_Alien)E)->span; + __COPY(((Texts_Alien)E)->mod, e->mod, ((LONGINT)(32))); + __COPY(((Texts_Alien)E)->proc, e->proc, ((LONGINT)(32))); + (*msg__).e = (Texts_Elem)e; + } else __WITHCHK; + } else if (__IS(msg__typ, Texts_IdentifyMsg, 1)) { + if (__IS(msg__typ, Texts_IdentifyMsg, 1)) { + Texts_IdentifyMsg *msg__ = (void*)msg; + __COPY(((Texts_Alien)E)->mod, (*msg__).mod, ((LONGINT)(32))); + __COPY(((Texts_Alien)E)->proc, (*msg__).proc, ((LONGINT)(32))); + (*msg__).mod[31] = 0x01; + } else __WITHCHK; + } else if (__IS(msg__typ, Texts_FileMsg, 1)) { + if (__IS(msg__typ, Texts_FileMsg, 1)) { + Texts_FileMsg *msg__ = (void*)msg; + if ((*msg__).id == 1) { + Files_Set(&r, Files_Rider__typ, ((Texts_Alien)E)->file, ((Texts_Alien)E)->org); + i = ((Texts_Alien)E)->span; + while (i > 0) { + Files_Read(&r, Files_Rider__typ, (void*)&ch); + Files_Write(&(*msg__).r, Files_Rider__typ, ch); + i -= 1; + } + } + } else __WITHCHK; + } + } else __WITHCHK; +} + +void Texts_OpenBuf (Texts_Buffer B) +{ + Texts_Run u = NIL; + __NEW(u, Texts_RunDesc); + u->next = u; + u->prev = u; + B->head = u; + B->len = 0; +} + +void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB) +{ + Texts_Run u = NIL, v = NIL, vn = NIL; + u = SB->head->next; + v = DB->head->prev; + while (u != SB->head) { + if (__ISP(u, Texts_PieceDesc, 1)) { + vn = (Texts_Run)Texts_ClonePiece(__GUARDP(u, Texts_PieceDesc, 1)); + } else { + vn = (Texts_Run)Texts_CloneElem(__GUARDP(u, Texts_ElemDesc, 1)); + } + v->next = vn; + vn->prev = v; + v = vn; + u = u->next; + } + v->next = DB->head; + DB->head->prev = v; + DB->len += SB->len; +} + +void Texts_Recall (Texts_Buffer *B) +{ + *B = Texts_del; + Texts_del = NIL; +} + +void Texts_Save (Texts_Text T, LONGINT beg, LONGINT end, Texts_Buffer B) +{ + Texts_Run u = NIL, v = NIL, w = NIL, wn = NIL; + LONGINT uo, ud, vo, vd; + Texts_Find(T, &beg, &u, &uo, &ud); + Texts_Find(T, &end, &v, &vo, &vd); + w = B->head->prev; + while (u != v) { + if (__ISP(u, Texts_PieceDesc, 1)) { + wn = (Texts_Run)Texts_ClonePiece(__GUARDP(u, Texts_PieceDesc, 1)); + wn->len -= ud; + __GUARDP(wn, Texts_PieceDesc, 1)->org += ud; + } else { + wn = (Texts_Run)Texts_CloneElem(__GUARDP(u, Texts_ElemDesc, 1)); + } + w->next = wn; + wn->prev = w; + w = wn; + u = u->next; + ud = 0; + } + if (vd > 0) { + wn = (Texts_Run)Texts_ClonePiece(__GUARDP(v, Texts_PieceDesc, 1)); + wn->len = vd - ud; + __GUARDP(wn, Texts_PieceDesc, 1)->org += ud; + w->next = wn; + wn->prev = w; + w = wn; + } + w->next = B->head; + B->head->prev = w; + B->len += end - beg; +} + +void Texts_Insert (Texts_Text T, LONGINT pos, Texts_Buffer B) +{ + Texts_Run u = NIL, un = NIL, v = NIL; + Texts_Piece p = NIL, q = NIL; + LONGINT uo, ud, len; + Texts_Find(T, &pos, &u, &uo, &ud); + Texts_Split(ud, &u, &un); + len = B->len; + v = B->head->next; + Texts_Merge(T, u, &v); + Texts_Splice(un, v, B->head->prev, T); + T->len += len; + B->head->next = B->head; + B->head->prev = B->head; + B->len = 0; + if (T->notify != NIL) { + (*T->notify)(T, 1, pos, pos + len); + } +} + +void Texts_Append (Texts_Text T, Texts_Buffer B) +{ + Texts_Run v = NIL; + LONGINT pos, len; + pos = T->len; + len = B->len; + v = B->head->next; + Texts_Merge(T, T->head->prev, &v); + Texts_Splice(T->head, v, B->head->prev, T); + T->len += len; + B->head->next = B->head; + B->head->prev = B->head; + B->len = 0; + if (T->notify != NIL) { + (*T->notify)(T, 1, pos, pos + len); + } +} + +void Texts_Delete (Texts_Text T, LONGINT beg, LONGINT end) +{ + Texts_Run c = NIL, u = NIL, un = NIL, v = NIL, vn = NIL; + LONGINT co, uo, ud, vo, vd; + Texts_Find(T, &beg, &u, &uo, &ud); + Texts_Split(ud, &u, &un); + c = T->cache; + co = T->corg; + Texts_Find(T, &end, &v, &vo, &vd); + Texts_Split(vd, &v, &vn); + T->cache = c; + T->corg = co; + __NEW(Texts_del, Texts_BufDesc); + Texts_OpenBuf(Texts_del); + Texts_del->len = end - beg; + Texts_Splice(Texts_del->head, un, v, NIL); + Texts_Merge(T, u, &vn); + u->next = vn; + vn->prev = u; + T->len -= end - beg; + if (T->notify != NIL) { + (*T->notify)(T, 2, beg, end); + } +} + +void Texts_ChangeLooks (Texts_Text T, LONGINT beg, LONGINT end, SET sel, Texts_FontsFont fnt, SHORTINT col, SHORTINT voff) +{ + Texts_Run c = NIL, u = NIL, un = NIL, v = NIL, vn = NIL; + LONGINT co, uo, ud, vo, vd; + Texts_Find(T, &beg, &u, &uo, &ud); + Texts_Split(ud, &u, &un); + c = T->cache; + co = T->corg; + Texts_Find(T, &end, &v, &vo, &vd); + Texts_Split(vd, &v, &vn); + T->cache = c; + T->corg = co; + while (un != vn) { + if ((__IN(0, sel) && fnt != NIL)) { + un->fnt = fnt; + } + if (__IN(1, sel)) { + un->col = col; + } + if (__IN(2, sel)) { + un->voff = voff; + } + Texts_Merge(T, u, &un); + if (u->next == un) { + u = un; + un = un->next; + } else { + u->next = un; + un->prev = u; + } + } + Texts_Merge(T, u, &un); + u->next = un; + un->prev = u; + if (T->notify != NIL) { + (*T->notify)(T, 0, beg, end); + } +} + +void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, LONGINT pos) +{ + Texts_Run u = NIL; + if (pos >= T->len) { + pos = T->len; + } + Texts_Find(T, &pos, &u, &(*R).org, &(*R).off); + (*R).run = u; + (*R).eot = 0; + if (__ISP(u, Texts_PieceDesc, 1)) { + Files_Set(&(*R).rider, Files_Rider__typ, __GUARDP(u, Texts_PieceDesc, 1)->file, __GUARDP(u, Texts_PieceDesc, 1)->org + (*R).off); + } +} + +void Texts_Read (Texts_Reader *R, LONGINT *R__typ, CHAR *ch) +{ + Texts_Run u = NIL; + LONGINT pos; + CHAR nextch; + u = (*R).run; + (*R).fnt = u->fnt; + (*R).col = u->col; + (*R).voff = u->voff; + (*R).off += 1; + if (__ISP(u, Texts_PieceDesc, 1)) { + Files_Read(&(*R).rider, Files_Rider__typ, (void*)&*ch); + (*R).elem = NIL; + if ((*ch == 0x0a && __GUARDP(u, Texts_PieceDesc, 1)->ascii)) { + *ch = 0x0d; + } else if ((*ch == 0x0d && __GUARDP(u, Texts_PieceDesc, 1)->ascii)) { + pos = Files_Pos(&(*R).rider, Files_Rider__typ); + Files_Read(&(*R).rider, Files_Rider__typ, (void*)&nextch); + if (nextch == 0x0a) { + (*R).off += 1; + } else { + Files_Set(&(*R).rider, Files_Rider__typ, __GUARDP(u, Texts_PieceDesc, 1)->file, pos); + } + } + } else if (__ISP(u, Texts_ElemDesc, 1)) { + *ch = 0x1c; + (*R).elem = __GUARDP(u, Texts_ElemDesc, 1); + } else { + *ch = 0x00; + (*R).elem = NIL; + (*R).eot = 1; + } + if ((*R).off == u->len) { + (*R).org += u->len; + u = u->next; + if (__ISP(u, Texts_PieceDesc, 1)) { + if (__ISP(u, Texts_PieceDesc, 1)) { + Files_Set(&(*R).rider, Files_Rider__typ, ((Texts_Piece)u)->file, ((Texts_Piece)u)->org); + } else __WITHCHK; + } + (*R).run = u; + (*R).off = 0; + } +} + +void Texts_ReadElem (Texts_Reader *R, LONGINT *R__typ) +{ + Texts_Run u = NIL, un = NIL; + u = (*R).run; + while (__ISP(u, Texts_PieceDesc, 1)) { + (*R).org += u->len; + u = u->next; + } + if (__ISP(u, Texts_ElemDesc, 1)) { + un = u->next; + (*R).run = un; + (*R).org += 1; + (*R).off = 0; + (*R).fnt = u->fnt; + (*R).col = u->col; + (*R).voff = u->voff; + (*R).elem = __GUARDP(u, Texts_ElemDesc, 1); + if (__ISP(un, Texts_PieceDesc, 1)) { + if (__ISP(un, Texts_PieceDesc, 1)) { + Files_Set(&(*R).rider, Files_Rider__typ, ((Texts_Piece)un)->file, ((Texts_Piece)un)->org); + } else __WITHCHK; + } + } else { + (*R).eot = 1; + (*R).elem = NIL; + } +} + +void Texts_ReadPrevElem (Texts_Reader *R, LONGINT *R__typ) +{ + Texts_Run u = NIL; + u = (*R).run->prev; + while (__ISP(u, Texts_PieceDesc, 1)) { + (*R).org -= u->len; + u = u->prev; + } + if (__ISP(u, Texts_ElemDesc, 1)) { + (*R).run = u; + (*R).org -= 1; + (*R).off = 0; + (*R).fnt = u->fnt; + (*R).col = u->col; + (*R).voff = u->voff; + (*R).elem = __GUARDP(u, Texts_ElemDesc, 1); + } else { + (*R).eot = 1; + (*R).elem = NIL; + } +} + +LONGINT Texts_Pos (Texts_Reader *R, LONGINT *R__typ) +{ + LONGINT _o_result; + _o_result = (*R).org + (*R).off; + return _o_result; +} + +void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, LONGINT pos) +{ + Texts_OpenReader((void*)&*S, S__typ, T, pos); + (*S).line = 0; + (*S).nextCh = ' '; +} + +static struct Scan__31 { + Texts_Scanner *S; + LONGINT *S__typ; + CHAR *ch; + BOOLEAN *negE; + INTEGER *e; + struct Scan__31 *lnk; +} *Scan__31_s; + +static void ReadScaleFactor__32 (void); + +static void ReadScaleFactor__32 (void) +{ + Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); + if (*Scan__31_s->ch == '-') { + *Scan__31_s->negE = 1; + Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); + } else { + *Scan__31_s->negE = 0; + if (*Scan__31_s->ch == '+') { + Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); + } + } + while (('0' <= *Scan__31_s->ch && *Scan__31_s->ch <= '9')) { + *Scan__31_s->e = (*Scan__31_s->e * 10 + (int)*Scan__31_s->ch) - 48; + Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); + } +} + +void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) +{ + CHAR ch, term; + BOOLEAN neg, negE, hex; + SHORTINT i, j, h; + INTEGER e; + LONGINT k; + REAL x, f; + LONGREAL y, g; + CHAR d[32]; + struct Scan__31 _s; + _s.S = S; _s.S__typ = S__typ; + _s.ch = &ch; + _s.negE = &negE; + _s.e = &e; + _s.lnk = Scan__31_s; + Scan__31_s = &_s; + ch = (*S).nextCh; + i = 0; + for (;;) { + if (ch == 0x0d) { + (*S).line += 1; + } else if ((ch != ' ' && ch != 0x09)) { + break; + } + Texts_Read((void*)&*S, S__typ, &ch); + } + if ((('A' <= __CAP(ch) && __CAP(ch) <= 'Z') || ch == '/') || ch == '.') { + do { + (*S).s[__X(i, ((LONGINT)(64)))] = ch; + i += 1; + Texts_Read((void*)&*S, S__typ, &ch); + } while (!((((__CAP(ch) > 'Z' && ch != '_') || ('A' > __CAP(ch) && ch > '9')) || ((('0' > ch && ch != '.')) && ch != '/')) || i == 63)); + (*S).s[__X(i, ((LONGINT)(64)))] = 0x00; + (*S).len = i; + (*S).class = 1; + } else if (ch == '\"') { + Texts_Read((void*)&*S, S__typ, &ch); + while ((((ch != '\"' && ch >= ' ')) && i != 63)) { + (*S).s[__X(i, ((LONGINT)(64)))] = ch; + i += 1; + Texts_Read((void*)&*S, S__typ, &ch); + } + (*S).s[__X(i, ((LONGINT)(64)))] = 0x00; + (*S).len = i + 1; + Texts_Read((void*)&*S, S__typ, &ch); + (*S).class = 2; + } else { + if (ch == '-') { + neg = 1; + Texts_Read((void*)&*S, S__typ, &ch); + } else { + neg = 0; + } + if (('0' <= ch && ch <= '9')) { + hex = 0; + j = 0; + for (;;) { + d[__X(i, ((LONGINT)(32)))] = ch; + i += 1; + Texts_Read((void*)&*S, S__typ, &ch); + if (ch < '0') { + break; + } + if ('9' < ch) { + if (('A' <= ch && ch <= 'F')) { + hex = 1; + ch = (CHAR)((int)ch - 7); + } else if (('a' <= ch && ch <= 'f')) { + hex = 1; + ch = (CHAR)((int)ch - 39); + } else { + break; + } + } + } + if (ch == 'H') { + Texts_Read((void*)&*S, S__typ, &ch); + (*S).class = 3; + if (i - j > 8) { + j = i - 8; + } + k = (int)d[__X(j, ((LONGINT)(32)))] - 48; + j += 1; + if ((i - j == 7 && k >= 8)) { + k -= 16; + } + while (j < i) { + k = __ASHL(k, 4) + (LONGINT)((int)d[__X(j, ((LONGINT)(32)))] - 48); + j += 1; + } + if (neg) { + (*S).i = -k; + } else { + (*S).i = k; + } + } else if (ch == '.') { + Texts_Read((void*)&*S, S__typ, &ch); + h = i; + while (('0' <= ch && ch <= '9')) { + d[__X(i, ((LONGINT)(32)))] = ch; + i += 1; + Texts_Read((void*)&*S, S__typ, &ch); + } + if (ch == 'D') { + e = 0; + y = (LONGREAL)0; + g = (LONGREAL)1; + do { + y = y * (LONGREAL)10 + ((int)d[__X(j, ((LONGINT)(32)))] - 48); + j += 1; + } while (!(j == h)); + while (j < i) { + g = g / (LONGREAL)(LONGREAL)10; + y = ((int)d[__X(j, ((LONGINT)(32)))] - 48) * g + y; + j += 1; + } + ReadScaleFactor__32(); + if (negE) { + if (e <= 308) { + y = y / (LONGREAL)Reals_TenL(e); + } else { + y = (LONGREAL)0; + } + } else if (e > 0) { + if (e <= 308) { + y = Reals_TenL(e) * y; + } else { + __HALT(40); + } + } + if (neg) { + y = -y; + } + (*S).class = 5; + (*S).y = y; + } else { + e = 0; + x = (REAL)0; + f = (REAL)1; + do { + x = x * (REAL)10 + ((int)d[__X(j, ((LONGINT)(32)))] - 48); + j += 1; + } while (!(j == h)); + while (j < i) { + f = f / (REAL)(REAL)10; + x = ((int)d[__X(j, ((LONGINT)(32)))] - 48) * f + x; + j += 1; + } + if (ch == 'E') { + ReadScaleFactor__32(); + } + if (negE) { + if (e <= 38) { + x = x / (REAL)Reals_Ten(e); + } else { + x = (REAL)0; + } + } else if (e > 0) { + if (e <= 38) { + x = Reals_Ten(e) * x; + } else { + __HALT(40); + } + } + if (neg) { + x = -x; + } + (*S).class = 4; + (*S).x = x; + } + if (hex) { + (*S).class = 0; + } + } else { + (*S).class = 3; + k = 0; + do { + k = k * 10 + (LONGINT)((int)d[__X(j, ((LONGINT)(32)))] - 48); + j += 1; + } while (!(j == i)); + if (neg) { + (*S).i = -k; + } else { + (*S).i = k; + } + if (hex) { + (*S).class = 0; + } else { + (*S).class = 3; + } + } + } else { + (*S).class = 6; + if (neg) { + (*S).c = '-'; + } else { + (*S).c = ch; + Texts_Read((void*)&*S, S__typ, &ch); + } + } + } + (*S).nextCh = ch; + Scan__31_s = _s.lnk; +} + +void Texts_OpenWriter (Texts_Writer *W, LONGINT *W__typ) +{ + __NEW((*W).buf, Texts_BufDesc); + Texts_OpenBuf((*W).buf); + (*W).fnt = Texts_FontsDefault; + (*W).col = 15; + (*W).voff = 0; + (*W).file = Files_New((CHAR*)"", (LONGINT)1); + Files_Set(&(*W).rider, Files_Rider__typ, (*W).file, ((LONGINT)(0))); +} + +void Texts_SetFont (Texts_Writer *W, LONGINT *W__typ, Texts_FontsFont fnt) +{ + (*W).fnt = fnt; +} + +void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, SHORTINT col) +{ + (*W).col = col; +} + +void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, SHORTINT voff) +{ + (*W).voff = voff; +} + +void Texts_Write (Texts_Writer *W, LONGINT *W__typ, CHAR ch) +{ + Texts_Run u = NIL, un = NIL; + Texts_Piece p = NIL; + Files_Write(&(*W).rider, Files_Rider__typ, ch); + (*W).buf->len += 1; + un = (*W).buf->head; + u = un->prev; + if ((((((((((__ISP(u, Texts_PieceDesc, 1) && __GUARDP(u, Texts_PieceDesc, 1)->file == (*W).file)) && __STRCMP(u->fnt->name, (*W).fnt->name) == 0)) && u->col == (*W).col)) && u->voff == (*W).voff)) && !__GUARDP(u, Texts_PieceDesc, 1)->ascii)) { + u->len += 1; + } else { + __NEW(p, Texts_PieceDesc); + u->next = (Texts_Run)p; + p->prev = u; + p->next = un; + un->prev = (Texts_Run)p; + p->len = 1; + p->fnt = (*W).fnt; + p->col = (*W).col; + p->voff = (*W).voff; + p->file = (*W).file; + p->org = Files_Length((*W).file) - 1; + p->ascii = 0; + } +} + +void Texts_WriteElem (Texts_Writer *W, LONGINT *W__typ, Texts_Elem e) +{ + Texts_Run u = NIL, un = NIL; + if (e->base != NIL) { + __HALT(99); + } + (*W).buf->len += 1; + e->len = 1; + e->fnt = (*W).fnt; + e->col = (*W).col; + e->voff = (*W).voff; + un = (*W).buf->head; + u = un->prev; + u->next = (Texts_Run)e; + e->prev = u; + e->next = un; + un->prev = (Texts_Run)e; +} + +void Texts_WriteLn (Texts_Writer *W, LONGINT *W__typ) +{ + Texts_Write(&*W, W__typ, 0x0d); +} + +void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__len) +{ + INTEGER i; + __DUP(s, s__len, CHAR); + i = 0; + while (s[__X(i, s__len)] >= ' ') { + Texts_Write(&*W, W__typ, s[__X(i, s__len)]); + i += 1; + } + __DEL(s); +} + +void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n) +{ + INTEGER i; + LONGINT x0; + CHAR a[22]; + i = 0; + if (x < 0) { + if (x == (-2147483647-1)) { + Texts_WriteString(&*W, W__typ, (CHAR*)" -2147483648", (LONGINT)13); + return; + } else { + n -= 1; + x0 = -x; + } + } else { + x0 = x; + } + do { + a[__X(i, ((LONGINT)(22)))] = (CHAR)(__MOD(x0, 10) + 48); + x0 = __DIV(x0, 10); + i += 1; + } while (!(x0 == 0)); + while (n > (LONGINT)i) { + Texts_Write(&*W, W__typ, ' '); + n -= 1; + } + if (x < 0) { + Texts_Write(&*W, W__typ, '-'); + } + do { + i -= 1; + Texts_Write(&*W, W__typ, a[__X(i, ((LONGINT)(22)))]); + } while (!(i == 0)); +} + +void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, LONGINT x) +{ + INTEGER i; + LONGINT y; + CHAR a[20]; + i = 0; + Texts_Write(&*W, W__typ, ' '); + do { + y = __MASK(x, -16); + if (y < 10) { + a[__X(i, ((LONGINT)(20)))] = (CHAR)(y + 48); + } else { + a[__X(i, ((LONGINT)(20)))] = (CHAR)(y + 55); + } + x = __ASHR(x, 4); + i += 1; + } while (!(i == 8)); + do { + i -= 1; + Texts_Write(&*W, W__typ, a[__X(i, ((LONGINT)(20)))]); + } while (!(i == 0)); +} + +void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n) +{ + INTEGER e; + REAL x0; + CHAR d[9]; + e = Reals_Expo(x); + if (e == 0) { + Texts_WriteString(&*W, W__typ, (CHAR*)" 0", (LONGINT)4); + do { + Texts_Write(&*W, W__typ, ' '); + n -= 1; + } while (!(n <= 3)); + } else if (e == 255) { + Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", (LONGINT)5); + while (n > 4) { + Texts_Write(&*W, W__typ, ' '); + n -= 1; + } + } else { + if (n <= 9) { + n = 3; + } else { + n -= 6; + } + do { + Texts_Write(&*W, W__typ, ' '); + n -= 1; + } while (!(n <= 8)); + if (x < (REAL)0) { + Texts_Write(&*W, W__typ, '-'); + x = -x; + } else { + Texts_Write(&*W, W__typ, ' '); + } + e = __ASHR((e - 127) * 77, 8); + if (e >= 0) { + x = x / (REAL)Reals_Ten(e); + } else { + x = Reals_Ten(-e) * x; + } + if (x >= (REAL)10) { + x = 1.0000000e-001 * x; + e += 1; + } + x0 = Reals_Ten(n - 1); + x = x0 * x + 5.0000000e-001; + if (x >= (REAL)10 * x0) { + x = x * 1.0000000e-001; + e += 1; + } + Reals_Convert(x, n, (void*)d, ((LONGINT)(9))); + n -= 1; + Texts_Write(&*W, W__typ, d[__X(n, ((LONGINT)(9)))]); + Texts_Write(&*W, W__typ, '.'); + do { + n -= 1; + Texts_Write(&*W, W__typ, d[__X(n, ((LONGINT)(9)))]); + } while (!(n == 0)); + Texts_Write(&*W, W__typ, 'E'); + if (e < 0) { + Texts_Write(&*W, W__typ, '-'); + e = -e; + } else { + Texts_Write(&*W, W__typ, '+'); + } + Texts_Write(&*W, W__typ, (CHAR)(__DIV(e, 10) + 48)); + Texts_Write(&*W, W__typ, (CHAR)((int)__MOD(e, 10) + 48)); + } +} + +static struct WriteRealFix__53 { + Texts_Writer *W; + LONGINT *W__typ; + INTEGER *i; + CHAR (*d)[9]; + struct WriteRealFix__53 *lnk; +} *WriteRealFix__53_s; + +static void dig__54 (INTEGER n); +static void seq__56 (CHAR ch, INTEGER n); + +static void seq__56 (CHAR ch, INTEGER n) +{ + while (n > 0) { + Texts_Write(&*WriteRealFix__53_s->W, WriteRealFix__53_s->W__typ, ch); + n -= 1; + } +} + +static void dig__54 (INTEGER n) +{ + while (n > 0) { + *WriteRealFix__53_s->i -= 1; + Texts_Write(&*WriteRealFix__53_s->W, WriteRealFix__53_s->W__typ, (*WriteRealFix__53_s->d)[__X(*WriteRealFix__53_s->i, ((LONGINT)(9)))]); + n -= 1; + } +} + +void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n, INTEGER k) +{ + INTEGER e, i; + CHAR sign; + REAL x0; + CHAR d[9]; + struct WriteRealFix__53 _s; + _s.W = W; _s.W__typ = W__typ; + _s.i = &i; + _s.d = (void*)d; + _s.lnk = WriteRealFix__53_s; + WriteRealFix__53_s = &_s; + e = Reals_Expo(x); + if (k < 0) { + k = 0; + } + if (e == 0) { + seq__56(' ', (n - k) - 2); + Texts_Write(&*W, W__typ, '0'); + seq__56(' ', k + 1); + } else if (e == 255) { + Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", (LONGINT)5); + seq__56(' ', n - 4); + } else { + e = __ASHR((e - 127) * 77, 8); + if (x < (REAL)0) { + sign = '-'; + x = -x; + } else { + sign = ' '; + } + if (e >= 0) { + x = x / (REAL)Reals_Ten(e); + } else { + x = Reals_Ten(-e) * x; + } + if (x >= (REAL)10) { + x = 1.0000000e-001 * x; + e += 1; + } + if (k + e >= 8) { + k = 8 - e; + } else if (k + e < 0) { + k = -e; + x = (REAL)0; + } + x0 = Reals_Ten(k + e); + x = x0 * x + 5.0000000e-001; + if (x >= (REAL)10 * x0) { + e += 1; + } + e += 1; + i = k + e; + Reals_Convert(x, i, (void*)d, ((LONGINT)(9))); + if (e > 0) { + seq__56(' ', ((n - e) - k) - 2); + Texts_Write(&*W, W__typ, sign); + dig__54(e); + Texts_Write(&*W, W__typ, '.'); + dig__54(k); + } else { + seq__56(' ', (n - k) - 3); + Texts_Write(&*W, W__typ, sign); + Texts_Write(&*W, W__typ, '0'); + Texts_Write(&*W, W__typ, '.'); + seq__56('0', -e); + dig__54(k + e); + } + } + WriteRealFix__53_s = _s.lnk; +} + +void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x) +{ + INTEGER i; + CHAR d[8]; + Reals_ConvertH(x, (void*)d, ((LONGINT)(8))); + i = 0; + do { + Texts_Write(&*W, W__typ, d[__X(i, ((LONGINT)(8)))]); + i += 1; + } while (!(i == 8)); +} + +void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER n) +{ + INTEGER e; + LONGREAL x0; + CHAR d[16]; + e = Reals_ExpoL(x); + if (e == 0) { + Texts_WriteString(&*W, W__typ, (CHAR*)" 0", (LONGINT)4); + do { + Texts_Write(&*W, W__typ, ' '); + n -= 1; + } while (!(n <= 3)); + } else if (e == 2047) { + Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", (LONGINT)5); + while (n > 4) { + Texts_Write(&*W, W__typ, ' '); + n -= 1; + } + } else { + if (n <= 10) { + n = 3; + } else { + n -= 7; + } + do { + Texts_Write(&*W, W__typ, ' '); + n -= 1; + } while (!(n <= 16)); + if (x < (LONGREAL)0) { + Texts_Write(&*W, W__typ, '-'); + x = -x; + } else { + Texts_Write(&*W, W__typ, ' '); + } + e = (int)__ASHR((LONGINT)(e - 1023) * 77, 8); + if (e >= 0) { + x = x / (LONGREAL)Reals_TenL(e); + } else { + x = Reals_TenL(-e) * x; + } + if (x >= (LONGREAL)10) { + x = 1.00000000000000e-001 * x; + e += 1; + } + x0 = Reals_TenL(n - 1); + x = x0 * x + 5.00000000000000e-001; + if (x >= (LONGREAL)10 * x0) { + x = 1.00000000000000e-001 * x; + e += 1; + } + Reals_ConvertL(x, n, (void*)d, ((LONGINT)(16))); + n -= 1; + Texts_Write(&*W, W__typ, d[__X(n, ((LONGINT)(16)))]); + Texts_Write(&*W, W__typ, '.'); + do { + n -= 1; + Texts_Write(&*W, W__typ, d[__X(n, ((LONGINT)(16)))]); + } while (!(n == 0)); + Texts_Write(&*W, W__typ, 'D'); + if (e < 0) { + Texts_Write(&*W, W__typ, '-'); + e = -e; + } else { + Texts_Write(&*W, W__typ, '+'); + } + Texts_Write(&*W, W__typ, (CHAR)(__DIV(e, 100) + 48)); + e = (int)__MOD(e, 100); + Texts_Write(&*W, W__typ, (CHAR)(__DIV(e, 10) + 48)); + Texts_Write(&*W, W__typ, (CHAR)((int)__MOD(e, 10) + 48)); + } +} + +void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x) +{ + INTEGER i; + CHAR d[16]; + Reals_ConvertHL(x, (void*)d, ((LONGINT)(16))); + i = 0; + do { + Texts_Write(&*W, W__typ, d[__X(i, ((LONGINT)(16)))]); + i += 1; + } while (!(i == 16)); +} + +static struct WriteDate__43 { + Texts_Writer *W; + LONGINT *W__typ; + struct WriteDate__43 *lnk; +} *WriteDate__43_s; + +static void WritePair__44 (CHAR ch, LONGINT x); + +static void WritePair__44 (CHAR ch, LONGINT x) +{ + Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, ch); + Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)(__DIV(x, 10) + 48)); + Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)(__MOD(x, 10) + 48)); +} + +void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, LONGINT t, LONGINT d) +{ + struct WriteDate__43 _s; + _s.W = W; _s.W__typ = W__typ; + _s.lnk = WriteDate__43_s; + WriteDate__43_s = &_s; + WritePair__44(' ', __MASK(d, -32)); + WritePair__44('.', __MASK(__ASHR(d, 5), -16)); + WritePair__44('.', __MASK(__ASHR(d, 9), -128)); + WritePair__44(' ', __MASK(__ASHR(t, 12), -32)); + WritePair__44(':', __MASK(__ASHR(t, 6), -64)); + WritePair__44(':', __MASK(t, -64)); + WriteDate__43_s = _s.lnk; +} + +static struct Load0__16 { + Texts_Text *T; + SHORTINT *ecnt; + Files_File *f; + Texts_FileMsg *msg; + CHAR (*mods)[64][32], (*procs)[64][32]; + struct Load0__16 *lnk; +} *Load0__16_s; + +static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, LONGINT span, Texts_Elem *e); + +static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, LONGINT span, Texts_Elem *e) +{ + Modules_Module M = NIL; + Modules_Command Cmd; + Texts_Alien a = NIL; + LONGINT org, ew, eh; + SHORTINT eno; + Texts_new = NIL; + Files_ReadLInt(&*r, r__typ, &ew); + Files_ReadLInt(&*r, r__typ, &eh); + Files_Read(&*r, r__typ, (void*)&eno); + if (eno > *Load0__16_s->ecnt) { + *Load0__16_s->ecnt = eno; + Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->mods)[__X(eno, ((LONGINT)(64)))], ((LONGINT)(32))); + Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->procs)[__X(eno, ((LONGINT)(64)))], ((LONGINT)(32))); + } + org = Files_Pos(&*r, r__typ); + M = Modules_ThisMod((*Load0__16_s->mods)[__X(eno, ((LONGINT)(64)))], ((LONGINT)(32))); + if (M != NIL) { + Cmd = Modules_ThisCommand(M, (*Load0__16_s->procs)[__X(eno, ((LONGINT)(64)))], ((LONGINT)(32))); + if (Cmd != NIL) { + (*Cmd)(); + } + } + *e = Texts_new; + if (*e != NIL) { + (*e)->W = ew; + (*e)->H = eh; + (*e)->base = *Load0__16_s->T; + (*Load0__16_s->msg).pos = pos; + (*(*e)->handle)(*e, (void*)&*Load0__16_s->msg, Texts_FileMsg__typ); + if (Files_Pos(&*r, r__typ) != org + span) { + *e = NIL; + } + } + if (*e == NIL) { + Files_Set(&*r, r__typ, *Load0__16_s->f, org + span); + __NEW(a, Texts__1); + a->W = ew; + a->H = eh; + a->handle = Texts_HandleAlien; + a->base = *Load0__16_s->T; + a->file = *Load0__16_s->f; + a->org = org; + a->span = span; + __COPY((*Load0__16_s->mods)[__X(eno, ((LONGINT)(64)))], a->mod, ((LONGINT)(32))); + __COPY((*Load0__16_s->procs)[__X(eno, ((LONGINT)(64)))], a->proc, ((LONGINT)(32))); + *e = (Texts_Elem)a; + } +} + +static void Texts_Load0 (Files_Rider *r, LONGINT *r__typ, Texts_Text T) +{ + Texts_Run u = NIL, un = NIL; + Texts_Piece p = NIL; + Texts_Elem e = NIL; + LONGINT org, pos, hlen, plen; + SHORTINT ecnt, fno, fcnt, col, voff; + Files_File f = NIL; + Texts_FileMsg msg; + CHAR mods[64][32], procs[64][32]; + CHAR name[32]; + Texts_FontsFont fnts[32]; + struct Load0__16 _s; + _s.T = &T; + _s.ecnt = &ecnt; + _s.f = &f; + _s.msg = &msg; + _s.mods = (void*)mods; + _s.procs = (void*)procs; + _s.lnk = Load0__16_s; + Load0__16_s = &_s; + pos = Files_Pos(&*r, r__typ); + f = Files_Base(&*r, r__typ); + __NEW(u, Texts_RunDesc); + u->len = 2147483647; + u->fnt = NIL; + u->col = 15; + T->head = u; + ecnt = 0; + fcnt = 0; + msg.id = 0; + msg.r = *r; + Files_ReadLInt(&msg.r, Files_Rider__typ, &hlen); + org = (pos - 2) + hlen; + pos = org; + Files_Read(&msg.r, Files_Rider__typ, (void*)&fno); + while (fno != 0) { + if (fno > fcnt) { + fcnt = fno; + Files_ReadString(&msg.r, Files_Rider__typ, (void*)name, ((LONGINT)(32))); + fnts[__X(fno, ((LONGINT)(32)))] = Texts_FontsThis((void*)name, ((LONGINT)(32))); + } + Files_Read(&msg.r, Files_Rider__typ, (void*)&col); + Files_Read(&msg.r, Files_Rider__typ, (void*)&voff); + Files_ReadLInt(&msg.r, Files_Rider__typ, &plen); + if (plen > 0) { + __NEW(p, Texts_PieceDesc); + p->file = f; + p->org = pos; + p->ascii = 0; + un = (Texts_Run)p; + un->len = plen; + } else { + LoadElem__17(&msg.r, Files_Rider__typ, pos - org, -plen, &e); + un = (Texts_Run)e; + un->len = 1; + } + un->col = col; + un->voff = voff; + pos += un->len; + u->next = un; + un->prev = u; + u = un; + Files_Read(&msg.r, Files_Rider__typ, (void*)&fno); + } + u->next = T->head; + T->head->prev = u; + T->cache = T->head; + T->corg = 0; + Files_ReadLInt(&msg.r, Files_Rider__typ, &T->len); + Files_Set(&*r, r__typ, f, Files_Pos(&msg.r, Files_Rider__typ) + T->len); + Load0__16_s = _s.lnk; +} + +void Texts_Load (Files_Rider *r, LONGINT *r__typ, Texts_Text T) +{ + INTEGER tag; + Files_ReadInt(&*r, r__typ, &tag); + if (tag != -4095) { + Files_Set(&*r, r__typ, Files_Base(&*r, r__typ), Files_Pos(&*r, r__typ) - 2); + } + Texts_Load0(&*r, r__typ, T); +} + +void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len) +{ + Files_File f = NIL; + Files_Rider r; + Texts_Run u = NIL; + Texts_Piece p = NIL; + CHAR tag, version; + LONGINT hlen; + __DUP(name, name__len, CHAR); + f = Files_Old(name, name__len); + if (f == NIL) { + f = Files_New((CHAR*)"", (LONGINT)1); + } + Files_Set(&r, Files_Rider__typ, f, ((LONGINT)(0))); + Files_Read(&r, Files_Rider__typ, (void*)&tag); + Files_Read(&r, Files_Rider__typ, (void*)&version); + if (tag == 0xf0 || (tag == 0x01 && version == 0xf0)) { + Texts_Load0(&r, Files_Rider__typ, T); + } else { + __NEW(u, Texts_RunDesc); + u->len = 2147483647; + u->fnt = NIL; + u->col = 15; + __NEW(p, Texts_PieceDesc); + if ((tag == 0xf7 && version == 0x07)) { + Files_Set(&r, Files_Rider__typ, f, ((LONGINT)(28))); + Files_ReadLInt(&r, Files_Rider__typ, &hlen); + Files_Set(&r, Files_Rider__typ, f, 22 + hlen); + Files_ReadLInt(&r, Files_Rider__typ, &T->len); + p->org = 26 + hlen; + } else { + T->len = Files_Length(f); + p->org = 0; + } + if (T->len > 0) { + p->len = T->len; + p->fnt = Texts_FontsDefault; + p->col = 15; + p->voff = 0; + p->file = f; + p->ascii = 1; + u->next = (Texts_Run)p; + u->prev = (Texts_Run)p; + p->next = u; + p->prev = u; + } else { + u->next = u; + u->prev = u; + } + T->head = u; + T->cache = T->head; + T->corg = 0; + } + __DEL(name); +} + +static struct Store__39 { + SHORTINT *ecnt; + Texts_FileMsg *msg; + Texts_IdentifyMsg *iden; + CHAR (*mods)[64][32], (*procs)[64][32]; + struct Store__39 *lnk; +} *Store__39_s; + +static void StoreElem__40 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, Texts_Elem e); + +static void StoreElem__40 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, Texts_Elem e) +{ + Files_Rider r1; + LONGINT org, span; + SHORTINT eno; + __COPY((*Store__39_s->iden).mod, (*Store__39_s->mods)[__X(*Store__39_s->ecnt, ((LONGINT)(64)))], ((LONGINT)(32))); + __COPY((*Store__39_s->iden).proc, (*Store__39_s->procs)[__X(*Store__39_s->ecnt, ((LONGINT)(64)))], ((LONGINT)(32))); + eno = 1; + while (__STRCMP((*Store__39_s->mods)[__X(eno, ((LONGINT)(64)))], (*Store__39_s->iden).mod) != 0 || __STRCMP((*Store__39_s->procs)[__X(eno, ((LONGINT)(64)))], (*Store__39_s->iden).proc) != 0) { + eno += 1; + } + Files_Set(&r1, Files_Rider__typ, Files_Base(&*r, r__typ), Files_Pos(&*r, r__typ)); + Files_WriteLInt(&*r, r__typ, ((LONGINT)(0))); + Files_WriteLInt(&*r, r__typ, ((LONGINT)(0))); + Files_WriteLInt(&*r, r__typ, ((LONGINT)(0))); + Files_Write(&*r, r__typ, eno); + if (eno == *Store__39_s->ecnt) { + *Store__39_s->ecnt += 1; + Files_WriteString(&*r, r__typ, (*Store__39_s->iden).mod, ((LONGINT)(32))); + Files_WriteString(&*r, r__typ, (*Store__39_s->iden).proc, ((LONGINT)(32))); + } + (*Store__39_s->msg).pos = pos; + org = Files_Pos(&*r, r__typ); + (*e->handle)(e, (void*)&*Store__39_s->msg, Texts_FileMsg__typ); + span = Files_Pos(&*r, r__typ) - org; + Files_WriteLInt(&r1, Files_Rider__typ, -span); + Files_WriteLInt(&r1, Files_Rider__typ, e->W); + Files_WriteLInt(&r1, Files_Rider__typ, e->H); +} + +void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T) +{ + Files_Rider r1; + Texts_Run u = NIL, un = NIL; + Texts_Elem e = NIL; + LONGINT org, pos, delta, hlen, rlen; + SHORTINT ecnt, fno, fcnt; + CHAR ch; + Texts_FileMsg msg; + Texts_IdentifyMsg iden; + CHAR mods[64][32], procs[64][32]; + Texts_FontsFont fnts[32]; + CHAR block[1024]; + struct Store__39 _s; + _s.ecnt = &ecnt; + _s.msg = &msg; + _s.iden = &iden; + _s.mods = (void*)mods; + _s.procs = (void*)procs; + _s.lnk = Store__39_s; + Store__39_s = &_s; + org = Files_Pos(&*r, r__typ); + msg.id = 1; + msg.r = *r; + Files_WriteLInt(&msg.r, Files_Rider__typ, ((LONGINT)(0))); + u = T->head->next; + pos = 0; + delta = 0; + fcnt = 1; + ecnt = 1; + while (u != T->head) { + if (__ISP(u, Texts_ElemDesc, 1)) { + iden.mod[0] = 0x00; + (*__GUARDP(u, Texts_ElemDesc, 1)->handle)(__GUARDP(u, Texts_ElemDesc, 1), (void*)&iden, Texts_IdentifyMsg__typ); + } else { + iden.mod[0] = 0x01; + } + if (iden.mod[0] != 0x00) { + fnts[__X(fcnt, ((LONGINT)(32)))] = u->fnt; + fno = 1; + while (__STRCMP(fnts[__X(fno, ((LONGINT)(32)))]->name, u->fnt->name) != 0) { + fno += 1; + } + Files_Write(&msg.r, Files_Rider__typ, fno); + if (fno == fcnt) { + fcnt += 1; + Files_WriteString(&msg.r, Files_Rider__typ, u->fnt->name, ((LONGINT)(32))); + } + Files_Write(&msg.r, Files_Rider__typ, u->col); + Files_Write(&msg.r, Files_Rider__typ, u->voff); + } + if (__ISP(u, Texts_PieceDesc, 1)) { + rlen = u->len; + un = u->next; + while ((((((__ISP(un, Texts_PieceDesc, 1) && un->fnt == u->fnt)) && un->col == u->col)) && un->voff == u->voff)) { + rlen += un->len; + un = un->next; + } + Files_WriteLInt(&msg.r, Files_Rider__typ, rlen); + pos += rlen; + u = un; + } else if (iden.mod[0] != 0x00) { + StoreElem__40(&msg.r, Files_Rider__typ, pos, __GUARDP(u, Texts_ElemDesc, 1)); + pos += 1; + u = u->next; + } else { + delta += 1; + u = u->next; + } + } + Files_Write(&msg.r, Files_Rider__typ, 0); + Files_WriteLInt(&msg.r, Files_Rider__typ, T->len - delta); + hlen = (Files_Pos(&msg.r, Files_Rider__typ) - org) + 2; + Files_Set(&r1, Files_Rider__typ, Files_Base(&msg.r, Files_Rider__typ), org); + Files_WriteLInt(&r1, Files_Rider__typ, hlen); + u = T->head->next; + while (u != T->head) { + if (__ISP(u, Texts_PieceDesc, 1)) { + if (__ISP(u, Texts_PieceDesc, 1)) { + if (((Texts_Piece)u)->ascii) { + Files_Set(&r1, Files_Rider__typ, ((Texts_Piece)u)->file, ((Texts_Piece)u)->org); + delta = ((Texts_Piece)u)->len; + while (delta > 0) { + Files_Read(&r1, Files_Rider__typ, (void*)&ch); + delta -= 1; + if (ch == 0x0a) { + Files_Write(&msg.r, Files_Rider__typ, 0x0d); + } else { + Files_Write(&msg.r, Files_Rider__typ, ch); + } + } + } else { + Files_Set(&r1, Files_Rider__typ, ((Texts_Piece)u)->file, ((Texts_Piece)u)->org); + delta = ((Texts_Piece)u)->len; + while (delta > 1024) { + Files_ReadBytes(&r1, Files_Rider__typ, (void*)block, ((LONGINT)(1024)), ((LONGINT)(1024))); + Files_WriteBytes(&msg.r, Files_Rider__typ, (void*)block, ((LONGINT)(1024)), ((LONGINT)(1024))); + delta -= 1024; + } + Files_ReadBytes(&r1, Files_Rider__typ, (void*)block, ((LONGINT)(1024)), delta); + Files_WriteBytes(&msg.r, Files_Rider__typ, (void*)block, ((LONGINT)(1024)), delta); + } + } else __WITHCHK; + } else { + iden.mod[0] = 0x00; + (*__GUARDP(u, Texts_ElemDesc, 1)->handle)(__GUARDP(u, Texts_ElemDesc, 1), (void*)&iden, Texts_IdentifyMsg__typ); + if (iden.mod[0] != 0x00) { + Files_Write(&msg.r, Files_Rider__typ, 0x1c); + } + } + u = u->next; + } + __GUARDEQR(r, r__typ, Files_Rider) = msg.r; + if (T->notify != NIL) { + (*T->notify)(T, 3, ((LONGINT)(0)), ((LONGINT)(0))); + } + Store__39_s = _s.lnk; +} + +void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len) +{ + Files_File f = NIL; + Files_Rider r; + INTEGER i, res; + CHAR bak[64]; + __DUP(name, name__len, CHAR); + f = Files_New(name, name__len); + Files_Set(&r, Files_Rider__typ, f, ((LONGINT)(0))); + Files_Write(&r, Files_Rider__typ, 0xf0); + Files_Write(&r, Files_Rider__typ, 0x01); + Texts_Store(&r, Files_Rider__typ, T); + i = 0; + while (name[__X(i, name__len)] != 0x00) { + i += 1; + } + __COPY(name, bak, ((LONGINT)(64))); + bak[__X(i, ((LONGINT)(64)))] = '.'; + bak[__X(i + 1, ((LONGINT)(64)))] = 'B'; + bak[__X(i + 2, ((LONGINT)(64)))] = 'a'; + bak[__X(i + 3, ((LONGINT)(64)))] = 'k'; + bak[__X(i + 4, ((LONGINT)(64)))] = 0x00; + Files_Rename(name, name__len, bak, ((LONGINT)(64)), &res); + Files_Register(f); + __DEL(name); +} + +static void EnumPtrs(void (*P)(void*)) +{ + P(Texts_new); + P(Texts_del); + P(Texts_FontsDefault); +} + +__TDESC(Texts_FontDesc, 1, 0) = {__TDFLDS("FontDesc", 32), {-4}}; +__TDESC(Texts_RunDesc, 1, 3) = {__TDFLDS("RunDesc", 20), {0, 4, 12, -16}}; +__TDESC(Texts_PieceDesc, 1, 4) = {__TDFLDS("PieceDesc", 28), {0, 4, 12, 20, -20}}; +__TDESC(Texts_ElemMsg, 1, 0) = {__TDFLDS("ElemMsg", 1), {-4}}; +__TDESC(Texts_ElemDesc, 1, 4) = {__TDFLDS("ElemDesc", 36), {0, 4, 12, 32, -20}}; +__TDESC(Texts_FileMsg, 1, 1) = {__TDFLDS("FileMsg", 28), {16, -8}}; +__TDESC(Texts_CopyMsg, 1, 1) = {__TDFLDS("CopyMsg", 4), {0, -8}}; +__TDESC(Texts_IdentifyMsg, 1, 0) = {__TDFLDS("IdentifyMsg", 64), {-4}}; +__TDESC(Texts_BufDesc, 1, 1) = {__TDFLDS("BufDesc", 8), {4, -8}}; +__TDESC(Texts_TextDesc, 1, 2) = {__TDFLDS("TextDesc", 20), {8, 12, -12}}; +__TDESC(Texts_Reader, 1, 4) = {__TDFLDS("Reader", 48), {4, 12, 24, 36, -20}}; +__TDESC(Texts_Scanner, 1, 4) = {__TDFLDS("Scanner", 144), {4, 12, 24, 36, -20}}; +__TDESC(Texts_Writer, 1, 4) = {__TDFLDS("Writer", 36), {0, 4, 20, 32, -20}}; +__TDESC(Texts__1, 1, 5) = {__TDFLDS("", 112), {0, 4, 12, 32, 36, -24}}; + +export void *Texts__init(void) +{ + __DEFMOD; + __MODULE_IMPORT(Files); + __MODULE_IMPORT(Modules); + __MODULE_IMPORT(Reals); + __REGMOD("Texts", EnumPtrs); + __INITYP(Texts_FontDesc, Texts_FontDesc, 0); + __INITYP(Texts_RunDesc, Texts_RunDesc, 0); + __INITYP(Texts_PieceDesc, Texts_RunDesc, 1); + __INITYP(Texts_ElemMsg, Texts_ElemMsg, 0); + __INITYP(Texts_ElemDesc, Texts_RunDesc, 1); + __INITYP(Texts_FileMsg, Texts_ElemMsg, 1); + __INITYP(Texts_CopyMsg, Texts_ElemMsg, 1); + __INITYP(Texts_IdentifyMsg, Texts_ElemMsg, 1); + __INITYP(Texts_BufDesc, Texts_BufDesc, 0); + __INITYP(Texts_TextDesc, Texts_TextDesc, 0); + __INITYP(Texts_Reader, Texts_Reader, 0); + __INITYP(Texts_Scanner, Texts_Reader, 1); + __INITYP(Texts_Writer, Texts_Writer, 0); + __INITYP(Texts__1, Texts_ElemDesc, 2); +/* BEGIN */ + Texts_del = NIL; + __NEW(Texts_FontsDefault, Texts_FontDesc); + __MOVE("Syntax10.Scn.Fnt", Texts_FontsDefault->name, 17); + __ENDMOD; +} diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h new file mode 100644 index 00000000..7b66d3ce --- /dev/null +++ b/bootstrap/windows-48/Texts.h @@ -0,0 +1,173 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ + +#ifndef Texts__h +#define Texts__h + +#include "SYSTEM.h" +#include "Files.h" + +typedef + struct Texts_BufDesc { + LONGINT len; + char _prvt0[4]; + } Texts_BufDesc; + +typedef + Texts_BufDesc *Texts_Buffer; + +typedef + struct Texts_ElemMsg { + char _prvt0[1]; + } Texts_ElemMsg; + +typedef + struct Texts_ElemDesc *Texts_Elem; + +typedef + struct Texts_CopyMsg { /* Texts_ElemMsg */ + Texts_Elem e; + } Texts_CopyMsg; + +typedef + struct Texts_RunDesc { + LONGINT _prvt0; + char _prvt1[15]; + } Texts_RunDesc; + +typedef + void (*Texts_Handler)(Texts_Elem, Texts_ElemMsg*, LONGINT *); + +typedef + struct Texts_ElemDesc { + char _prvt0[20]; + LONGINT W, H; + Texts_Handler handle; + char _prvt1[4]; + } Texts_ElemDesc; + +typedef + struct Texts_FileMsg { /* Texts_ElemMsg */ + INTEGER id; + LONGINT pos; + Files_Rider r; + } Texts_FileMsg; + +typedef + struct Texts_FontDesc { + char _prvt0[32]; + } Texts_FontDesc; + +typedef + Texts_FontDesc *Texts_FontsFont; + +typedef + struct Texts_IdentifyMsg { /* Texts_ElemMsg */ + CHAR mod[32], proc[32]; + } Texts_IdentifyMsg; + +typedef + struct Texts_TextDesc *Texts_Text; + +typedef + void (*Texts_Notifier)(Texts_Text, INTEGER, LONGINT, LONGINT); + +typedef + struct Texts_Reader { + BOOLEAN eot; + Texts_FontsFont fnt; + SHORTINT col, voff; + Texts_Elem elem; + char _prvt0[32]; + } Texts_Reader; + +typedef + struct Texts_Scanner { /* Texts_Reader */ + BOOLEAN eot; + Texts_FontsFont fnt; + SHORTINT col, voff; + Texts_Elem elem; + LONGREAL _prvt0; + char _prvt1[24]; + CHAR nextCh; + INTEGER line, class; + LONGINT i; + REAL x; + LONGREAL y; + CHAR c; + SHORTINT len; + CHAR s[64]; + } Texts_Scanner; + +typedef + struct Texts_TextDesc { + LONGINT len; + Texts_Notifier notify; + char _prvt0[12]; + } Texts_TextDesc; + +typedef + struct Texts_Writer { + Texts_Buffer buf; + Texts_FontsFont fnt; + SHORTINT col, voff; + char _prvt0[26]; + } Texts_Writer; + + +import Texts_Elem Texts_new; + +import LONGINT *Texts_FontDesc__typ; +import LONGINT *Texts_RunDesc__typ; +import LONGINT *Texts_ElemMsg__typ; +import LONGINT *Texts_ElemDesc__typ; +import LONGINT *Texts_FileMsg__typ; +import LONGINT *Texts_CopyMsg__typ; +import LONGINT *Texts_IdentifyMsg__typ; +import LONGINT *Texts_BufDesc__typ; +import LONGINT *Texts_TextDesc__typ; +import LONGINT *Texts_Reader__typ; +import LONGINT *Texts_Scanner__typ; +import LONGINT *Texts_Writer__typ; + +import void Texts_Append (Texts_Text T, Texts_Buffer B); +import void Texts_ChangeLooks (Texts_Text T, LONGINT beg, LONGINT end, SET sel, Texts_FontsFont fnt, SHORTINT col, SHORTINT voff); +import void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len); +import void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); +import void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); +import void Texts_Delete (Texts_Text T, LONGINT beg, LONGINT end); +import Texts_Text Texts_ElemBase (Texts_Elem E); +import LONGINT Texts_ElemPos (Texts_Elem E); +import void Texts_Insert (Texts_Text T, LONGINT pos, Texts_Buffer B); +import void Texts_Load (Files_Rider *r, LONGINT *r__typ, Texts_Text T); +import void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len); +import void Texts_OpenBuf (Texts_Buffer B); +import void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, LONGINT pos); +import void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, LONGINT pos); +import void Texts_OpenWriter (Texts_Writer *W, LONGINT *W__typ); +import LONGINT Texts_Pos (Texts_Reader *R, LONGINT *R__typ); +import void Texts_Read (Texts_Reader *R, LONGINT *R__typ, CHAR *ch); +import void Texts_ReadElem (Texts_Reader *R, LONGINT *R__typ); +import void Texts_ReadPrevElem (Texts_Reader *R, LONGINT *R__typ); +import void Texts_Recall (Texts_Buffer *B); +import void Texts_Save (Texts_Text T, LONGINT beg, LONGINT end, Texts_Buffer B); +import void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ); +import void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, SHORTINT col); +import void Texts_SetFont (Texts_Writer *W, LONGINT *W__typ, Texts_FontsFont fnt); +import void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, SHORTINT voff); +import void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T); +import void Texts_Write (Texts_Writer *W, LONGINT *W__typ, CHAR ch); +import void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, LONGINT t, LONGINT d); +import void Texts_WriteElem (Texts_Writer *W, LONGINT *W__typ, Texts_Elem e); +import void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, LONGINT x); +import void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n); +import void Texts_WriteLn (Texts_Writer *W, LONGINT *W__typ); +import void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER n); +import void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x); +import void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n); +import void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n, INTEGER k); +import void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x); +import void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__len); +import void *Texts__init(void); + + +#endif diff --git a/bootstrap/windows-48/Vishap.c b/bootstrap/windows-48/Vishap.c new file mode 100644 index 00000000..2b9c3901 --- /dev/null +++ b/bootstrap/windows-48/Vishap.c @@ -0,0 +1,168 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkamSf */ +#include "SYSTEM.h" +#include "Configuration.h" +#include "Heap.h" +#include "OPB.h" +#include "OPC.h" +#include "OPM.h" +#include "OPP.h" +#include "OPT.h" +#include "OPV.h" +#include "Platform.h" +#include "Strings.h" +#include "extTools.h" +#include "vt100.h" + + +static CHAR Vishap_mname[256]; + + +export void Vishap_Module (BOOLEAN *done); +static void Vishap_PropagateElementaryTypeSizes (void); +export void Vishap_Translate (void); +static void Vishap_Trap (INTEGER sig); + + +void Vishap_Module (BOOLEAN *done) +{ + BOOLEAN ext, new; + OPT_Node p = NIL; + OPP_Module(&p, OPM_opt); + if (OPM_noerr) { + OPV_Init(); + OPV_AdrAndSize(OPT_topScope); + OPT_Export(&ext, &new); + if (OPM_noerr) { + OPM_OpenFiles((void*)OPT_SelfName, ((LONGINT)(256))); + OPC_Init(); + OPV_Module(p); + if (OPM_noerr) { + if (((OPM_mainProg || OPM_mainLinkStat) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { + OPM_DeleteNewSym(); + if (!OPM_notColorOutput) { + vt100_SetAttr((CHAR*)"32m", (LONGINT)4); + } + OPM_LogWStr((CHAR*)" Main program.", (LONGINT)16); + if (!OPM_notColorOutput) { + vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + } + } else { + if (new) { + if (!OPM_notColorOutput) { + vt100_SetAttr((CHAR*)"32m", (LONGINT)4); + } + OPM_LogWStr((CHAR*)" New symbol file.", (LONGINT)19); + if (!OPM_notColorOutput) { + vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + } + OPM_RegisterNewSym(); + } else if (ext) { + OPM_LogWStr((CHAR*)" Extended symbol file.", (LONGINT)24); + OPM_RegisterNewSym(); + } + } + } else { + OPM_DeleteNewSym(); + } + } + } + OPM_CloseFiles(); + OPT_Close(); + OPM_LogWLn(); + *done = OPM_noerr; +} + +static void Vishap_PropagateElementaryTypeSizes (void) +{ + OPT_bytetyp->size = OPM_ByteSize; + OPT_sysptrtyp->size = OPM_PointerSize; + OPT_chartyp->size = OPM_CharSize; + OPT_settyp->size = OPM_SetSize; + OPT_realtyp->size = OPM_RealSize; + OPT_inttyp->size = OPM_IntSize; + OPT_linttyp->size = OPM_LIntSize; + OPT_lrltyp->size = OPM_LRealSize; + OPT_sinttyp->size = OPM_SIntSize; + OPT_booltyp->size = OPM_BoolSize; +} + +void Vishap_Translate (void) +{ + BOOLEAN done; + CHAR modulesobj[2048]; + modulesobj[0] = 0x00; + if (OPM_OpenPar()) { + for (;;) { + OPM_Init(&done, (void*)Vishap_mname, ((LONGINT)(256))); + if (!done) { + return; + } + OPM_InitOptions(); + Vishap_PropagateElementaryTypeSizes(); + Heap_GC(0); + Vishap_Module(&done); + if (!done) { + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Module compilation failed.", (LONGINT)27); + OPM_LogWLn(); + Platform_Exit(1); + } + if (!OPM_dontAsm) { + if (OPM_dontLink) { + extTools_Assemble(OPM_modName, ((LONGINT)(32))); + } else { + if (!(OPM_mainProg || OPM_mainLinkStat)) { + extTools_Assemble(OPM_modName, ((LONGINT)(32))); + Strings_Append((CHAR*)" ", (LONGINT)2, (void*)modulesobj, ((LONGINT)(2048))); + Strings_Append(OPM_modName, ((LONGINT)(32)), (void*)modulesobj, ((LONGINT)(2048))); + Strings_Append((CHAR*)".o", (LONGINT)3, (void*)modulesobj, ((LONGINT)(2048))); + } else { + extTools_LinkMain((void*)OPM_modName, ((LONGINT)(32)), OPM_mainLinkStat, modulesobj, ((LONGINT)(2048))); + } + } + } + } + } +} + +static void Vishap_Trap (INTEGER sig) +{ + Heap_FINALL(); + if (sig == 3) { + Platform_Exit(0); + } else { + if ((sig == 4 && Platform_HaltCode == -15)) { + OPM_LogWStr((CHAR*)" --- Vishap Oberon: internal error", (LONGINT)35); + OPM_LogWLn(); + } + Platform_Exit(2); + } +} + + +export int main(int argc, char **argv) +{ + __INIT(argc, argv); + __MODULE_IMPORT(Configuration); + __MODULE_IMPORT(Heap); + __MODULE_IMPORT(OPB); + __MODULE_IMPORT(OPC); + __MODULE_IMPORT(OPM); + __MODULE_IMPORT(OPP); + __MODULE_IMPORT(OPT); + __MODULE_IMPORT(OPV); + __MODULE_IMPORT(Platform); + __MODULE_IMPORT(Strings); + __MODULE_IMPORT(extTools); + __MODULE_IMPORT(vt100); + __REGMAIN("Vishap", 0); + __REGCMD("Translate", Vishap_Translate); +/* BEGIN */ + Platform_SetInterruptHandler(Vishap_Trap); + Platform_SetQuitHandler(Vishap_Trap); + Platform_SetBadInstructionHandler(Vishap_Trap); + OPB_typSize = OPV_TypSize; + OPT_typSize = OPV_TypSize; + Vishap_Translate(); + __FINI; +} diff --git a/bootstrap/windows-48/WindowsWrapper.h b/bootstrap/windows-48/WindowsWrapper.h new file mode 100644 index 00000000..cdb8714c --- /dev/null +++ b/bootstrap/windows-48/WindowsWrapper.h @@ -0,0 +1,9 @@ +// WindowsWrapper.h +// +// Includes Windows.h while avoiding conflicts with Oberon types. + +#undef BOOLEAN +#undef CHAR +#include +#define BOOLEAN char +#define CHAR unsigned char diff --git a/bootstrap/windows-48/errors.c b/bootstrap/windows-48/errors.c new file mode 100644 index 00000000..25a074a9 --- /dev/null +++ b/bootstrap/windows-48/errors.c @@ -0,0 +1,198 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +#include "SYSTEM.h" + +typedef + CHAR errors_string[128]; + + +export errors_string errors_errors[350]; + + + + + +export void *errors__init(void) +{ + __DEFMOD; + __REGMOD("errors", 0); +/* BEGIN */ + __MOVE("undeclared identifier", errors_errors[0], 22); + __MOVE("multiply defined identifier", errors_errors[1], 28); + __MOVE("illegal character in number", errors_errors[2], 28); + __MOVE("illegal character in string", errors_errors[3], 28); + __MOVE("identifier does not match procedure name", errors_errors[4], 41); + __MOVE("comment not closed", errors_errors[5], 19); + errors_errors[6][0] = 0x00; + errors_errors[7][0] = 0x00; + errors_errors[8][0] = 0x00; + __MOVE("\'=\' expected", errors_errors[9], 13); + errors_errors[10][0] = 0x00; + errors_errors[11][0] = 0x00; + __MOVE("type definition starts with incorrect symbol", errors_errors[12], 45); + __MOVE("factor starts with incorrect symbol", errors_errors[13], 36); + __MOVE("statement starts with incorrect symbol", errors_errors[14], 39); + __MOVE("declaration followed by incorrect symbol", errors_errors[15], 41); + __MOVE("MODULE expected", errors_errors[16], 16); + errors_errors[17][0] = 0x00; + __MOVE("\'.\' missing", errors_errors[18], 12); + __MOVE("\',\' missing", errors_errors[19], 12); + __MOVE("\':\' missing", errors_errors[20], 12); + errors_errors[21][0] = 0x00; + __MOVE("\')\' missing", errors_errors[22], 12); + __MOVE("\']\' missing", errors_errors[23], 12); + __MOVE("\'}\' missing", errors_errors[24], 12); + __MOVE("OF missing", errors_errors[25], 11); + __MOVE("THEN missing", errors_errors[26], 13); + __MOVE("DO missing", errors_errors[27], 11); + __MOVE("TO missing", errors_errors[28], 11); + errors_errors[29][0] = 0x00; + __MOVE("\'(\' missing", errors_errors[30], 12); + errors_errors[31][0] = 0x00; + errors_errors[32][0] = 0x00; + errors_errors[33][0] = 0x00; + __MOVE("\':=\' missing", errors_errors[34], 13); + __MOVE("\',\' or OF expected", errors_errors[35], 19); + errors_errors[36][0] = 0x00; + errors_errors[37][0] = 0x00; + __MOVE("identifier expected", errors_errors[38], 20); + __MOVE("\';\' missing", errors_errors[39], 12); + errors_errors[40][0] = 0x00; + __MOVE("END missing", errors_errors[41], 12); + errors_errors[42][0] = 0x00; + errors_errors[43][0] = 0x00; + __MOVE("UNTIL missing", errors_errors[44], 14); + errors_errors[45][0] = 0x00; + __MOVE("EXIT not within loop statement", errors_errors[46], 31); + __MOVE("illegally marked identifier", errors_errors[47], 28); + errors_errors[48][0] = 0x00; + errors_errors[49][0] = 0x00; + __MOVE("expression should be constant", errors_errors[50], 30); + __MOVE("constant not an integer", errors_errors[51], 24); + __MOVE("identifier does not denote a type", errors_errors[52], 34); + __MOVE("identifier does not denote a record type", errors_errors[53], 41); + __MOVE("result type of procedure is not a basic type", errors_errors[54], 45); + __MOVE("procedure call of a function", errors_errors[55], 29); + __MOVE("assignment to non-variable", errors_errors[56], 27); + __MOVE("pointer not bound to record or array type", errors_errors[57], 42); + __MOVE("recursive type definition", errors_errors[58], 26); + __MOVE("illegal open array parameter", errors_errors[59], 29); + __MOVE("wrong type of case label", errors_errors[60], 25); + __MOVE("inadmissible type of case label", errors_errors[61], 32); + __MOVE("case label defined more than once", errors_errors[62], 34); + __MOVE("illegal value of constant", errors_errors[63], 26); + __MOVE("more actual than formal parameters", errors_errors[64], 35); + __MOVE("fewer actual than formal parameters", errors_errors[65], 36); + __MOVE("element types of actual array and formal open array differ", errors_errors[66], 59); + __MOVE("actual parameter corresponding to open array is not an array", errors_errors[67], 61); + __MOVE("control variable must be integer", errors_errors[68], 33); + __MOVE("parameter must be an integer constant", errors_errors[69], 38); + __MOVE("pointer or VAR record required as formal receiver", errors_errors[70], 50); + __MOVE("pointer expected as actual receiver", errors_errors[71], 36); + __MOVE("procedure must be bound to a record of the same scope", errors_errors[72], 54); + __MOVE("procedure must have level 0", errors_errors[73], 28); + __MOVE("procedure unknown in base type", errors_errors[74], 31); + __MOVE("invalid call of base procedure", errors_errors[75], 31); + __MOVE("this variable (field) is read only", errors_errors[76], 35); + __MOVE("object is not a record", errors_errors[77], 23); + __MOVE("dereferenced object is not a variable", errors_errors[78], 38); + __MOVE("indexed object is not a variable", errors_errors[79], 33); + __MOVE("index expression is not an integer", errors_errors[80], 35); + __MOVE("index out of specified bounds", errors_errors[81], 30); + __MOVE("indexed variable is not an array", errors_errors[82], 33); + __MOVE("undefined record field", errors_errors[83], 23); + __MOVE("dereferenced variable is not a pointer", errors_errors[84], 39); + __MOVE("guard or test type is not an extension of variable type", errors_errors[85], 56); + __MOVE("guard or testtype is not a pointer", errors_errors[86], 35); + __MOVE("guarded or tested variable is neither a pointer nor a VAR-parameter record", errors_errors[87], 75); + __MOVE("open array not allowed as variable, record field or array element", errors_errors[88], 66); + errors_errors[89][0] = 0x00; + errors_errors[90][0] = 0x00; + errors_errors[91][0] = 0x00; + __MOVE("operand of IN not an integer, or not a set", errors_errors[92], 43); + __MOVE("set element type is not an integer", errors_errors[93], 35); + __MOVE("operand of & is not of type BOOLEAN", errors_errors[94], 36); + __MOVE("operand of OR is not of type BOOLEAN", errors_errors[95], 37); + __MOVE("operand not applicable to (unary) +", errors_errors[96], 36); + __MOVE("operand not applicable to (unary) -", errors_errors[97], 36); + __MOVE("operand of ~ is not of type BOOLEAN", errors_errors[98], 36); + __MOVE("ASSERT fault", errors_errors[99], 13); + __MOVE("incompatible operands of dyadic operator", errors_errors[100], 41); + __MOVE("operand type inapplicable to *", errors_errors[101], 31); + __MOVE("operand type inapplicable to /", errors_errors[102], 31); + __MOVE("operand type inapplicable to DIV", errors_errors[103], 33); + __MOVE("operand type inapplicable to MOD", errors_errors[104], 33); + __MOVE("operand type inapplicable to +", errors_errors[105], 31); + __MOVE("operand type inapplicable to -", errors_errors[106], 31); + __MOVE("operand type inapplicable to = or #", errors_errors[107], 36); + __MOVE("operand type inapplicable to relation", errors_errors[108], 38); + __MOVE("overriding method must be exported", errors_errors[109], 35); + __MOVE("operand is not a type", errors_errors[110], 22); + __MOVE("operand inapplicable to (this) function", errors_errors[111], 40); + __MOVE("operand is not a variable", errors_errors[112], 26); + __MOVE("incompatible assignment", errors_errors[113], 24); + __MOVE("string too long to be assigned", errors_errors[114], 31); + __MOVE("parameter doesn\'t match", errors_errors[115], 24); + __MOVE("number of parameters doesn\'t match", errors_errors[116], 35); + __MOVE("result type doesn\'t match", errors_errors[117], 26); + __MOVE("export mark doesn\'t match with forward declaration", errors_errors[118], 51); + __MOVE("redefinition textually precedes procedure bound to base type", errors_errors[119], 61); + __MOVE("type of expression following IF, WHILE, UNTIL or ASSERT is not BOOLEAN", errors_errors[120], 71); + __MOVE("called object is not a procedure (or is an interrupt procedure)", errors_errors[121], 64); + __MOVE("actual VAR-parameter is not a variable", errors_errors[122], 39); + __MOVE("type of actual parameter is not identical with that of formal VAR-parameter", errors_errors[123], 76); + __MOVE("type of result expression differs from that of procedure", errors_errors[124], 57); + __MOVE("type of case expression is neither INTEGER nor CHAR", errors_errors[125], 52); + __MOVE("this expression cannot be a type or a procedure", errors_errors[126], 48); + __MOVE("illegal use of object", errors_errors[127], 22); + __MOVE("unsatisfied forward reference", errors_errors[128], 30); + __MOVE("unsatisfied forward procedure", errors_errors[129], 30); + __MOVE("WITH clause does not specify a variable", errors_errors[130], 40); + __MOVE("LEN not applied to array", errors_errors[131], 25); + __MOVE("dimension in LEN too large or negative", errors_errors[132], 39); + __MOVE("SYSTEM not imported", errors_errors[135], 20); + __MOVE("key inconsistency of imported module", errors_errors[150], 37); + __MOVE("incorrect symbol file", errors_errors[151], 22); + __MOVE("symbol file of imported module not found", errors_errors[152], 41); + __MOVE("object or symbol file not opened (disk full\?)", errors_errors[153], 46); + __MOVE("recursive import not allowed", errors_errors[154], 29); + __MOVE("generation of new symbol file not allowed", errors_errors[155], 42); + __MOVE("parameter file not found", errors_errors[156], 25); + __MOVE("syntax error in parameter file", errors_errors[157], 31); + __MOVE("not yet implemented", errors_errors[200], 20); + __MOVE("lower bound of set range greater than higher bound", errors_errors[201], 51); + __MOVE("set element greater than MAX(SET) or less than 0", errors_errors[202], 49); + __MOVE("number too large", errors_errors[203], 17); + __MOVE("product too large", errors_errors[204], 18); + __MOVE("division by zero", errors_errors[205], 17); + __MOVE("sum too large", errors_errors[206], 14); + __MOVE("difference too large", errors_errors[207], 21); + __MOVE("overflow in arithmetic shift", errors_errors[208], 29); + __MOVE("case range too large", errors_errors[209], 21); + __MOVE("too many cases in case statement", errors_errors[213], 33); + __MOVE("illegal value of parameter (0 <= p < 256)", errors_errors[218], 42); + __MOVE("machine registers cannot be accessed", errors_errors[219], 37); + __MOVE("illegal value of parameter", errors_errors[220], 27); + __MOVE("too many pointers in a record", errors_errors[221], 30); + __MOVE("too many global pointers", errors_errors[222], 25); + __MOVE("too many record types", errors_errors[223], 22); + __MOVE("too many pointer types", errors_errors[224], 23); + __MOVE("address of pointer variable too large (move forward in text)", errors_errors[225], 61); + __MOVE("too many exported procedures", errors_errors[226], 29); + __MOVE("too many imported modules", errors_errors[227], 26); + __MOVE("too many exported structures", errors_errors[228], 29); + __MOVE("too many nested records for import", errors_errors[229], 35); + __MOVE("too many constants (strings) in module", errors_errors[230], 39); + __MOVE("too many link table entries (external procedures)", errors_errors[231], 50); + __MOVE("too many commands in module", errors_errors[232], 28); + __MOVE("record extension hierarchy too high", errors_errors[233], 36); + __MOVE("export of recursive type not allowed", errors_errors[234], 37); + __MOVE("identifier too long", errors_errors[240], 20); + __MOVE("string too long", errors_errors[241], 16); + __MOVE("address overflow", errors_errors[242], 17); + __MOVE("cyclic type definition not allowed", errors_errors[244], 35); + __MOVE("guarded pointer variable may be manipulated by non-local operations; use auxiliary pointer variable", errors_errors[245], 100); + __MOVE("implicit type cast", errors_errors[301], 19); + __MOVE("inappropriate symbol file ignored", errors_errors[306], 34); + __MOVE("no ELSE symbol after CASE statement sequence may lead to trap", errors_errors[307], 62); + __ENDMOD; +} diff --git a/bootstrap/windows-48/errors.h b/bootstrap/windows-48/errors.h new file mode 100644 index 00000000..c4fe8850 --- /dev/null +++ b/bootstrap/windows-48/errors.h @@ -0,0 +1,18 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ + +#ifndef errors__h +#define errors__h + +#include "SYSTEM.h" + +typedef + CHAR errors_string[128]; + + +import errors_string errors_errors[350]; + + +import void *errors__init(void); + + +#endif diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c new file mode 100644 index 00000000..6f1a6654 --- /dev/null +++ b/bootstrap/windows-48/extTools.c @@ -0,0 +1,112 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +#include "SYSTEM.h" +#include "Configuration.h" +#include "Console.h" +#include "OPM.h" +#include "Platform.h" +#include "Strings.h" + + +static CHAR extTools_compilationOptions[1023], extTools_CFLAGS[1023]; + + +export void extTools_Assemble (CHAR *moduleName, LONGINT moduleName__len); +export void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN statically, CHAR *additionalopts, LONGINT additionalopts__len); +static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGINT cmd__len); + + +static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGINT cmd__len) +{ + INTEGER r, status, exitcode; + __DUP(title, title__len, CHAR); + __DUP(cmd, cmd__len, CHAR); + if (OPM_Verbose) { + Console_String(title, title__len); + Console_String(cmd, cmd__len); + Console_Ln(); + } + r = Platform_System(cmd, cmd__len); + status = __MASK(r, -128); + exitcode = __ASHR(r, 8); + if (exitcode > 127) { + exitcode = exitcode - 256; + } + if (r != 0) { + Console_String(title, title__len); + Console_String(cmd, cmd__len); + Console_Ln(); + Console_String((CHAR*)"-- failed: status ", (LONGINT)19); + Console_Int(status, ((LONGINT)(1))); + Console_String((CHAR*)", exitcode ", (LONGINT)12); + Console_Int(exitcode, ((LONGINT)(1))); + Console_String((CHAR*)".", (LONGINT)2); + Console_Ln(); + if ((status == 0 && exitcode == 127)) { + Console_String((CHAR*)"Is the C compiler in the current command path\?", (LONGINT)47); + Console_Ln(); + } + if (status != 0) { + Platform_Halt(status); + } else { + Platform_Halt(exitcode); + } + } + __DEL(title); + __DEL(cmd); +} + +void extTools_Assemble (CHAR *moduleName, LONGINT moduleName__len) +{ + CHAR cmd[1023]; + __DUP(moduleName, moduleName__len, CHAR); + __MOVE("gcc -g", cmd, 7); + Strings_Append(extTools_compilationOptions, ((LONGINT)(1023)), (void*)cmd, ((LONGINT)(1023))); + Strings_Append((CHAR*)"-c ", (LONGINT)4, (void*)cmd, ((LONGINT)(1023))); + Strings_Append(moduleName, moduleName__len, (void*)cmd, ((LONGINT)(1023))); + Strings_Append((CHAR*)".c", (LONGINT)3, (void*)cmd, ((LONGINT)(1023))); + extTools_execute((CHAR*)"Assemble: ", (LONGINT)11, cmd, ((LONGINT)(1023))); + __DEL(moduleName); +} + +void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN statically, CHAR *additionalopts, LONGINT additionalopts__len) +{ + CHAR cmd[1023]; + __DUP(additionalopts, additionalopts__len, CHAR); + __MOVE("gcc -g", cmd, 7); + Strings_Append((CHAR*)" ", (LONGINT)2, (void*)cmd, ((LONGINT)(1023))); + Strings_Append(extTools_compilationOptions, ((LONGINT)(1023)), (void*)cmd, ((LONGINT)(1023))); + Strings_Append(moduleName, moduleName__len, (void*)cmd, ((LONGINT)(1023))); + Strings_Append((CHAR*)".c ", (LONGINT)4, (void*)cmd, ((LONGINT)(1023))); + Strings_Append(additionalopts, additionalopts__len, (void*)cmd, ((LONGINT)(1023))); + if (statically) { + Strings_Append((CHAR*)"-static", (LONGINT)8, (void*)cmd, ((LONGINT)(1023))); + } + Strings_Append((CHAR*)" -o ", (LONGINT)5, (void*)cmd, ((LONGINT)(1023))); + Strings_Append(moduleName, moduleName__len, (void*)cmd, ((LONGINT)(1023))); + Strings_Append((CHAR*)" -L\"", (LONGINT)5, (void*)cmd, ((LONGINT)(1023))); + Strings_Append((CHAR*)"/opt/voc", (LONGINT)9, (void*)cmd, ((LONGINT)(1023))); + Strings_Append((CHAR*)"/lib\"", (LONGINT)6, (void*)cmd, ((LONGINT)(1023))); + Strings_Append((CHAR*)" -l voc", (LONGINT)8, (void*)cmd, ((LONGINT)(1023))); + extTools_execute((CHAR*)"Assemble and link: ", (LONGINT)20, cmd, ((LONGINT)(1023))); + __DEL(additionalopts); +} + + +export void *extTools__init(void) +{ + __DEFMOD; + __MODULE_IMPORT(Configuration); + __MODULE_IMPORT(Console); + __MODULE_IMPORT(OPM); + __MODULE_IMPORT(Platform); + __MODULE_IMPORT(Strings); + __REGMOD("extTools", 0); +/* BEGIN */ + Strings_Append((CHAR*)" -I \"", (LONGINT)6, (void*)extTools_compilationOptions, ((LONGINT)(1023))); + Strings_Append((CHAR*)"/opt/voc", (LONGINT)9, (void*)extTools_compilationOptions, ((LONGINT)(1023))); + Strings_Append((CHAR*)"/include\" ", (LONGINT)11, (void*)extTools_compilationOptions, ((LONGINT)(1023))); + Platform_GetEnv((CHAR*)"CFLAGS", (LONGINT)7, (void*)extTools_CFLAGS, ((LONGINT)(1023))); + Strings_Append(extTools_CFLAGS, ((LONGINT)(1023)), (void*)extTools_compilationOptions, ((LONGINT)(1023))); + Strings_Append((CHAR*)" ", (LONGINT)2, (void*)extTools_compilationOptions, ((LONGINT)(1023))); + __ENDMOD; +} diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h new file mode 100644 index 00000000..95d07ddd --- /dev/null +++ b/bootstrap/windows-48/extTools.h @@ -0,0 +1,16 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ + +#ifndef extTools__h +#define extTools__h + +#include "SYSTEM.h" + + + + +import void extTools_Assemble (CHAR *moduleName, LONGINT moduleName__len); +import void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN statically, CHAR *additionalopts, LONGINT additionalopts__len); +import void *extTools__init(void); + + +#endif diff --git a/bootstrap/windows-48/vt100.c b/bootstrap/windows-48/vt100.c new file mode 100644 index 00000000..649ea068 --- /dev/null +++ b/bootstrap/windows-48/vt100.c @@ -0,0 +1,258 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +#include "SYSTEM.h" +#include "Console.h" +#include "Strings.h" + + +export CHAR vt100_CSI[5]; +static CHAR vt100_tmpstr[32]; + + +export void vt100_CHA (INTEGER n); +export void vt100_CNL (INTEGER n); +export void vt100_CPL (INTEGER n); +export void vt100_CUB (INTEGER n); +export void vt100_CUD (INTEGER n); +export void vt100_CUF (INTEGER n); +export void vt100_CUP (INTEGER n, INTEGER m); +export void vt100_CUU (INTEGER n); +export void vt100_DECTCEMh (void); +export void vt100_DECTCEMl (void); +export void vt100_DSR (INTEGER n); +export void vt100_ED (INTEGER n); +export void vt100_EL (INTEGER n); +static void vt100_EscSeq (INTEGER n, CHAR *letter, LONGINT letter__len); +static void vt100_EscSeq0 (CHAR *letter, LONGINT letter__len); +static void vt100_EscSeq2 (INTEGER n, INTEGER m, CHAR *letter, LONGINT letter__len); +static void vt100_EscSeqSwapped (INTEGER n, CHAR *letter, LONGINT letter__len); +export void vt100_HVP (INTEGER n, INTEGER m); +export void vt100_IntToStr (LONGINT int_, CHAR *str, LONGINT str__len); +export void vt100_RCP (void); +static void vt100_Reverse0 (CHAR *str, LONGINT str__len, INTEGER start, INTEGER end); +export void vt100_SCP (void); +export void vt100_SD (INTEGER n); +export void vt100_SGR (INTEGER n); +export void vt100_SGR2 (INTEGER n, INTEGER m); +export void vt100_SU (INTEGER n); +export void vt100_SetAttr (CHAR *attr, LONGINT attr__len); + + +static void vt100_Reverse0 (CHAR *str, LONGINT str__len, INTEGER start, INTEGER end) +{ + CHAR h; + while (start < end) { + h = str[__X(start, str__len)]; + str[__X(start, str__len)] = str[__X(end, str__len)]; + str[__X(end, str__len)] = h; + start += 1; + end -= 1; + } +} + +void vt100_IntToStr (LONGINT int_, CHAR *str, LONGINT str__len) +{ + CHAR b[21]; + INTEGER s, e; + SHORTINT maxLength; + maxLength = 11; + if (int_ == (-2147483647-1)) { + __MOVE("-2147483648", b, 12); + e = 11; + } else { + if (int_ < 0) { + b[0] = '-'; + int_ = -int_; + s = 1; + } else { + s = 0; + } + e = s; + do { + b[__X(e, ((LONGINT)(21)))] = (CHAR)(__MOD(int_, 10) + 48); + int_ = __DIV(int_, 10); + e += 1; + } while (!(int_ == 0)); + b[__X(e, ((LONGINT)(21)))] = 0x00; + vt100_Reverse0((void*)b, ((LONGINT)(21)), s, e - 1); + } + __COPY(b, str, str__len); +} + +static void vt100_EscSeq0 (CHAR *letter, LONGINT letter__len) +{ + CHAR cmd[9]; + __DUP(letter, letter__len, CHAR); + __COPY(vt100_CSI, cmd, ((LONGINT)(9))); + Strings_Append(letter, letter__len, (void*)cmd, ((LONGINT)(9))); + Console_String(cmd, ((LONGINT)(9))); + __DEL(letter); +} + +static void vt100_EscSeq (INTEGER n, CHAR *letter, LONGINT letter__len) +{ + CHAR nstr[2]; + CHAR cmd[7]; + __DUP(letter, letter__len, CHAR); + vt100_IntToStr(n, (void*)nstr, ((LONGINT)(2))); + __COPY(vt100_CSI, cmd, ((LONGINT)(7))); + Strings_Append(nstr, ((LONGINT)(2)), (void*)cmd, ((LONGINT)(7))); + Strings_Append(letter, letter__len, (void*)cmd, ((LONGINT)(7))); + Console_String(cmd, ((LONGINT)(7))); + __DEL(letter); +} + +static void vt100_EscSeqSwapped (INTEGER n, CHAR *letter, LONGINT letter__len) +{ + CHAR nstr[2]; + CHAR cmd[7]; + __DUP(letter, letter__len, CHAR); + vt100_IntToStr(n, (void*)nstr, ((LONGINT)(2))); + __COPY(vt100_CSI, cmd, ((LONGINT)(7))); + Strings_Append(letter, letter__len, (void*)cmd, ((LONGINT)(7))); + Strings_Append(nstr, ((LONGINT)(2)), (void*)cmd, ((LONGINT)(7))); + Console_String(cmd, ((LONGINT)(7))); + __DEL(letter); +} + +static void vt100_EscSeq2 (INTEGER n, INTEGER m, CHAR *letter, LONGINT letter__len) +{ + CHAR nstr[5], mstr[5]; + CHAR cmd[12]; + __DUP(letter, letter__len, CHAR); + vt100_IntToStr(n, (void*)nstr, ((LONGINT)(5))); + vt100_IntToStr(m, (void*)mstr, ((LONGINT)(5))); + __COPY(vt100_CSI, cmd, ((LONGINT)(12))); + Strings_Append(nstr, ((LONGINT)(5)), (void*)cmd, ((LONGINT)(12))); + Strings_Append((CHAR*)";", (LONGINT)2, (void*)cmd, ((LONGINT)(12))); + Strings_Append(mstr, ((LONGINT)(5)), (void*)cmd, ((LONGINT)(12))); + Strings_Append(letter, letter__len, (void*)cmd, ((LONGINT)(12))); + Console_String(cmd, ((LONGINT)(12))); + __DEL(letter); +} + +void vt100_CUU (INTEGER n) +{ + vt100_EscSeq(n, (CHAR*)"A", (LONGINT)2); +} + +void vt100_CUD (INTEGER n) +{ + vt100_EscSeq(n, (CHAR*)"B", (LONGINT)2); +} + +void vt100_CUF (INTEGER n) +{ + vt100_EscSeq(n, (CHAR*)"C", (LONGINT)2); +} + +void vt100_CUB (INTEGER n) +{ + vt100_EscSeq(n, (CHAR*)"D", (LONGINT)2); +} + +void vt100_CNL (INTEGER n) +{ + vt100_EscSeq(n, (CHAR*)"E", (LONGINT)2); +} + +void vt100_CPL (INTEGER n) +{ + vt100_EscSeq(n, (CHAR*)"F", (LONGINT)2); +} + +void vt100_CHA (INTEGER n) +{ + vt100_EscSeq(n, (CHAR*)"G", (LONGINT)2); +} + +void vt100_CUP (INTEGER n, INTEGER m) +{ + vt100_EscSeq2(n, m, (CHAR*)"H", (LONGINT)2); +} + +void vt100_ED (INTEGER n) +{ + vt100_EscSeq(n, (CHAR*)"J", (LONGINT)2); +} + +void vt100_EL (INTEGER n) +{ + vt100_EscSeq(n, (CHAR*)"K", (LONGINT)2); +} + +void vt100_SU (INTEGER n) +{ + vt100_EscSeq(n, (CHAR*)"S", (LONGINT)2); +} + +void vt100_SD (INTEGER n) +{ + vt100_EscSeq(n, (CHAR*)"T", (LONGINT)2); +} + +void vt100_HVP (INTEGER n, INTEGER m) +{ + vt100_EscSeq2(n, m, (CHAR*)"f", (LONGINT)2); +} + +void vt100_SGR (INTEGER n) +{ + vt100_EscSeq(n, (CHAR*)"m", (LONGINT)2); +} + +void vt100_SGR2 (INTEGER n, INTEGER m) +{ + vt100_EscSeq2(n, m, (CHAR*)"m", (LONGINT)2); +} + +void vt100_DSR (INTEGER n) +{ + vt100_EscSeq(6, (CHAR*)"n", (LONGINT)2); +} + +void vt100_SCP (void) +{ + vt100_EscSeq0((CHAR*)"s", (LONGINT)2); +} + +void vt100_RCP (void) +{ + vt100_EscSeq0((CHAR*)"u", (LONGINT)2); +} + +void vt100_DECTCEMl (void) +{ + vt100_EscSeq0((CHAR*)"\?25l", (LONGINT)5); +} + +void vt100_DECTCEMh (void) +{ + vt100_EscSeq0((CHAR*)"\?25h", (LONGINT)5); +} + +void vt100_SetAttr (CHAR *attr, LONGINT attr__len) +{ + CHAR tmpstr[16]; + __DUP(attr, attr__len, CHAR); + __COPY(vt100_CSI, tmpstr, ((LONGINT)(16))); + Strings_Append(attr, attr__len, (void*)tmpstr, ((LONGINT)(16))); + Console_String(tmpstr, ((LONGINT)(16))); + __DEL(attr); +} + + +export void *vt100__init(void) +{ + __DEFMOD; + __MODULE_IMPORT(Console); + __MODULE_IMPORT(Strings); + __REGMOD("vt100", 0); + __REGCMD("DECTCEMh", vt100_DECTCEMh); + __REGCMD("DECTCEMl", vt100_DECTCEMl); + __REGCMD("RCP", vt100_RCP); + __REGCMD("SCP", vt100_SCP); +/* BEGIN */ + __COPY("", vt100_CSI, ((LONGINT)(5))); + Strings_Append((CHAR*)"[", (LONGINT)2, (void*)vt100_CSI, ((LONGINT)(5))); + __ENDMOD; +} diff --git a/bootstrap/windows-48/vt100.h b/bootstrap/windows-48/vt100.h new file mode 100644 index 00000000..6d210ec9 --- /dev/null +++ b/bootstrap/windows-48/vt100.h @@ -0,0 +1,37 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ + +#ifndef vt100__h +#define vt100__h + +#include "SYSTEM.h" + + +import CHAR vt100_CSI[5]; + + +import void vt100_CHA (INTEGER n); +import void vt100_CNL (INTEGER n); +import void vt100_CPL (INTEGER n); +import void vt100_CUB (INTEGER n); +import void vt100_CUD (INTEGER n); +import void vt100_CUF (INTEGER n); +import void vt100_CUP (INTEGER n, INTEGER m); +import void vt100_CUU (INTEGER n); +import void vt100_DECTCEMh (void); +import void vt100_DECTCEMl (void); +import void vt100_DSR (INTEGER n); +import void vt100_ED (INTEGER n); +import void vt100_EL (INTEGER n); +import void vt100_HVP (INTEGER n, INTEGER m); +import void vt100_IntToStr (LONGINT int_, CHAR *str, LONGINT str__len); +import void vt100_RCP (void); +import void vt100_SCP (void); +import void vt100_SD (INTEGER n); +import void vt100_SGR (INTEGER n); +import void vt100_SGR2 (INTEGER n, INTEGER m); +import void vt100_SU (INTEGER n); +import void vt100_SetAttr (CHAR *attr, LONGINT attr__len); +import void *vt100__init(void); + + +#endif diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c new file mode 100644 index 00000000..c4d62d40 --- /dev/null +++ b/bootstrap/windows-88/Configuration.c @@ -0,0 +1,17 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +#define LARGE +#include "SYSTEM.h" + + + + + + + +export void *Configuration__init(void) +{ + __DEFMOD; + __REGMOD("Configuration", 0); +/* BEGIN */ + __ENDMOD; +} diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h new file mode 100644 index 00000000..b076eaee --- /dev/null +++ b/bootstrap/windows-88/Configuration.h @@ -0,0 +1,15 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ + +#ifndef Configuration__h +#define Configuration__h + +#define LARGE +#include "SYSTEM.h" + + + + +import void *Configuration__init(void); + + +#endif diff --git a/bootstrap/windows-88/Console.c b/bootstrap/windows-88/Console.c new file mode 100644 index 00000000..e4c5285c --- /dev/null +++ b/bootstrap/windows-88/Console.c @@ -0,0 +1,151 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +#define LARGE +#include "SYSTEM.h" +#include "Platform.h" + + +static CHAR Console_line[128]; +static INTEGER Console_pos; + + +export void Console_Bool (BOOLEAN b); +export void Console_Char (CHAR ch); +export void Console_Flush (void); +export void Console_Hex (LONGINT i); +export void Console_Int (LONGINT i, LONGINT n); +export void Console_Ln (void); +export void Console_Read (CHAR *ch); +export void Console_ReadLine (CHAR *line, LONGINT line__len); +export void Console_String (CHAR *s, LONGINT s__len); + + +void Console_Flush (void) +{ + INTEGER error; + error = Platform_Write(Platform_StdOut, (LONGINT)(uintptr_t)Console_line, Console_pos); + Console_pos = 0; +} + +void Console_Char (CHAR ch) +{ + if (Console_pos == 128) { + Console_Flush(); + } + Console_line[__X(Console_pos, ((LONGINT)(128)))] = ch; + Console_pos += 1; + if (ch == 0x0a) { + Console_Flush(); + } +} + +void Console_String (CHAR *s, LONGINT s__len) +{ + INTEGER i; + __DUP(s, s__len, CHAR); + i = 0; + while (s[__X(i, s__len)] != 0x00) { + Console_Char(s[__X(i, s__len)]); + i += 1; + } + __DEL(s); +} + +void Console_Int (LONGINT i, LONGINT n) +{ + CHAR s[32]; + LONGINT i1, k; + if (i == __LSHL(1, 63, LONGINT)) { + __MOVE("8085774586302733229", s, 20); + k = 19; + } else { + i1 = __ABS(i); + s[0] = (CHAR)(__MOD(i1, 10) + 48); + i1 = __DIV(i1, 10); + k = 1; + while (i1 > 0) { + s[__X(k, ((LONGINT)(32)))] = (CHAR)(__MOD(i1, 10) + 48); + i1 = __DIV(i1, 10); + k += 1; + } + } + if (i < 0) { + s[__X(k, ((LONGINT)(32)))] = '-'; + k += 1; + } + while (n > k) { + Console_Char(' '); + n -= 1; + } + while (k > 0) { + k -= 1; + Console_Char(s[__X(k, ((LONGINT)(32)))]); + } +} + +void Console_Ln (void) +{ + Console_Char(0x0a); +} + +void Console_Bool (BOOLEAN b) +{ + if (b) { + Console_String((CHAR*)"TRUE", (LONGINT)5); + } else { + Console_String((CHAR*)"FALSE", (LONGINT)6); + } +} + +void Console_Hex (LONGINT i) +{ + LONGINT k, n; + k = -28; + while (k <= 0) { + n = __MASK(__ASH(i, k), -16); + if (n <= 9) { + Console_Char((CHAR)(48 + n)); + } else { + Console_Char((CHAR)(55 + n)); + } + k += 4; + } +} + +void Console_Read (CHAR *ch) +{ + LONGINT n; + INTEGER error; + Console_Flush(); + error = Platform_ReadBuf(Platform_StdIn, (void*)&*ch, ((LONGINT)(1)), &n); + if (n != 1) { + *ch = 0x00; + } +} + +void Console_ReadLine (CHAR *line, LONGINT line__len) +{ + LONGINT i; + CHAR ch; + Console_Flush(); + i = 0; + Console_Read(&ch); + while ((((i < line__len - 1 && ch != 0x0a)) && ch != 0x00)) { + line[__X(i, line__len)] = ch; + i += 1; + Console_Read(&ch); + } + line[__X(i, line__len)] = 0x00; +} + + +export void *Console__init(void) +{ + __DEFMOD; + __MODULE_IMPORT(Platform); + __REGMOD("Console", 0); + __REGCMD("Flush", Console_Flush); + __REGCMD("Ln", Console_Ln); +/* BEGIN */ + Console_pos = 0; + __ENDMOD; +} diff --git a/bootstrap/windows-88/Console.h b/bootstrap/windows-88/Console.h new file mode 100644 index 00000000..d8a9b11e --- /dev/null +++ b/bootstrap/windows-88/Console.h @@ -0,0 +1,24 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ + +#ifndef Console__h +#define Console__h + +#define LARGE +#include "SYSTEM.h" + + + + +import void Console_Bool (BOOLEAN b); +import void Console_Char (CHAR ch); +import void Console_Flush (void); +import void Console_Hex (LONGINT i); +import void Console_Int (LONGINT i, LONGINT n); +import void Console_Ln (void); +import void Console_Read (CHAR *ch); +import void Console_ReadLine (CHAR *line, LONGINT line__len); +import void Console_String (CHAR *s, LONGINT s__len); +import void *Console__init(void); + + +#endif diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c new file mode 100644 index 00000000..f5f4a2aa --- /dev/null +++ b/bootstrap/windows-88/Files.c @@ -0,0 +1,1079 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin tspkaSfF */ +#define LARGE +#include "SYSTEM.h" +#include "Configuration.h" +#include "Console.h" +#include "Heap.h" +#include "Platform.h" +#include "Strings.h" + +typedef + struct Files_Handle *Files_File; + +typedef + struct Files_BufDesc { + Files_File f; + BOOLEAN chg; + LONGINT org, size; + SYSTEM_BYTE data[4096]; + } Files_BufDesc; + +typedef + Files_BufDesc *Files_Buffer; + +typedef + CHAR Files_FileName[101]; + +typedef + struct Files_Handle { + Files_FileName workName, registerName; + BOOLEAN tempFile; + Platform_FileIdentity identity; + LONGINT fd, len, pos; + Files_Buffer bufs[4]; + INTEGER swapper, state; + } Files_Handle; + +typedef + struct Files_Rider { + LONGINT res; + BOOLEAN eof; + Files_Buffer buf; + LONGINT org, offset; + } Files_Rider; + + +static LONGINT Files_fileTab[256]; +static INTEGER Files_tempno; +static CHAR Files_HOME[1024]; +static struct { + LONGINT len[1]; + CHAR data[1]; +} *Files_SearchPath; + +export LONGINT *Files_Handle__typ; +export LONGINT *Files_BufDesc__typ; +export LONGINT *Files_Rider__typ; + +export Files_File Files_Base (Files_Rider *r, LONGINT *r__typ); +static Files_File Files_CacheEntry (Platform_FileIdentity identity); +export void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INTEGER *res); +export void Files_Close (Files_File f); +static void Files_Create (Files_File f); +export void Files_Delete (CHAR *name, LONGINT name__len, INTEGER *res); +static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INTEGER errcode); +static void Files_Finalize (SYSTEM_PTR o); +static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *dest, LONGINT dest__len); +static void Files_Flush (Files_Buffer buf); +export void Files_GetDate (Files_File f, LONGINT *t, LONGINT *d); +export void Files_GetName (Files_File f, CHAR *name, LONGINT name__len); +static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *name, LONGINT name__len); +static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len); +static void Files_Init (void); +export LONGINT Files_Length (Files_File f); +static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT name__len, CHAR *dest, LONGINT dest__len); +export Files_File Files_New (CHAR *name, LONGINT name__len); +export Files_File Files_Old (CHAR *name, LONGINT name__len); +export LONGINT Files_Pos (Files_Rider *r, LONGINT *r__typ); +export void Files_Purge (Files_File f); +export void Files_Read (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x); +export void Files_ReadBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN *x); +export void Files_ReadByte (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len); +export void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, LONGINT n); +export void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, INTEGER *x); +export void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, LONGINT *x); +export void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x); +export void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); +export void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, LONGINT *x); +export void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x); +export void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x); +export void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); +export void Files_Register (Files_File f); +export void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INTEGER *res); +static void Files_ScanPath (INTEGER *pos, CHAR *dir, LONGINT dir__len); +export void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, LONGINT pos); +export void Files_SetSearchPath (CHAR *path, LONGINT path__len); +export void Files_Write (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE x); +export void Files_WriteBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN x); +export void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, LONGINT n); +export void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, INTEGER x); +export void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, LONGINT x); +export void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x); +export void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, LONGINT x); +export void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x); +export void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x); +export void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); + +#define Files_IdxTrap() __HALT(-1) + +static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INTEGER errcode) +{ + __DUP(s, s__len, CHAR); + Console_Ln(); + Console_String((CHAR*)"-- ", (LONGINT)4); + Console_String(s, s__len); + Console_String((CHAR*)": ", (LONGINT)3); + if (f != NIL) { + if (f->registerName[0] != 0x00) { + Console_String(f->registerName, ((LONGINT)(101))); + } else { + Console_String(f->workName, ((LONGINT)(101))); + } + if (f->fd != 0) { + Console_String((CHAR*)"f.fd = ", (LONGINT)8); + Console_Int(f->fd, ((LONGINT)(1))); + } + } + if (errcode != 0) { + Console_String((CHAR*)" errcode = ", (LONGINT)12); + Console_Int(errcode, ((LONGINT)(1))); + } + Console_Ln(); + __HALT(99); + __DEL(s); +} + +static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT name__len, CHAR *dest, LONGINT dest__len) +{ + INTEGER i, j; + __DUP(dir, dir__len, CHAR); + __DUP(name, name__len, CHAR); + i = 0; + j = 0; + while (dir[i] != 0x00) { + dest[i] = dir[i]; + i += 1; + } + if (dest[i - 1] != '/') { + dest[i] = '/'; + i += 1; + } + while (name[j] != 0x00) { + dest[i] = name[j]; + i += 1; + j += 1; + } + dest[i] = 0x00; + __DEL(dir); + __DEL(name); +} + +static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *name, LONGINT name__len) +{ + LONGINT n, i, j; + __DUP(finalName, finalName__len, CHAR); + Files_tempno += 1; + n = Files_tempno; + i = 0; + if (finalName[0] != '/') { + while (Platform_CWD[i] != 0x00) { + name[i] = Platform_CWD[i]; + i += 1; + } + if (Platform_CWD[i - 1] != '/') { + name[i] = '/'; + i += 1; + } + } + j = 0; + while (finalName[j] != 0x00) { + name[i] = finalName[j]; + i += 1; + j += 1; + } + i -= 1; + while (name[i] != '/') { + i -= 1; + } + name[i + 1] = '.'; + name[i + 2] = 't'; + name[i + 3] = 'm'; + name[i + 4] = 'p'; + name[i + 5] = '.'; + i += 6; + while (n > 0) { + name[i] = (CHAR)(__MOD(n, 10) + 48); + n = __DIV(n, 10); + i += 1; + } + name[i] = '.'; + i += 1; + n = Platform_PID; + while (n > 0) { + name[i] = (CHAR)(__MOD(n, 10) + 48); + n = __DIV(n, 10); + i += 1; + } + name[i] = 0x00; + __DEL(finalName); +} + +static void Files_Create (Files_File f) +{ + Platform_FileIdentity identity; + BOOLEAN done; + INTEGER error; + CHAR err[32]; + if (f->fd == -1) { + if (f->state == 1) { + Files_GetTempName(f->registerName, ((LONGINT)(101)), (void*)f->workName, ((LONGINT)(101))); + f->tempFile = 1; + } else if (f->state == 2) { + __COPY(f->registerName, f->workName, ((LONGINT)(101))); + f->registerName[0] = 0x00; + f->tempFile = 0; + } + error = Platform_Unlink((void*)f->workName, ((LONGINT)(101))); + error = Platform_New((void*)f->workName, ((LONGINT)(101)), &f->fd); + done = error == 0; + if ((!done && Platform_TooManyFiles(error)) || (done && f->fd >= 256)) { + if ((done && f->fd >= 256)) { + error = Platform_Close(f->fd); + } + Heap_GC(1); + error = Platform_New((void*)f->workName, ((LONGINT)(101)), &f->fd); + done = f->fd == 0; + } + if (done) { + if (f->fd >= 256) { + error = Platform_Close(f->fd); + Files_Err((CHAR*)"too many files open", (LONGINT)20, f, 0); + } else { + Files_fileTab[f->fd] = (LONGINT)(uintptr_t)f; + Heap_FileCount += 1; + Heap_RegisterFinalizer((void*)f, Files_Finalize); + f->state = 0; + f->pos = 0; + error = Platform_Identify(f->fd, &f->identity, Platform_FileIdentity__typ); + } + } else { + if (Platform_NoSuchDirectory(error)) { + __MOVE("no such directory", err, 18); + } else if (Platform_TooManyFiles(error)) { + __MOVE("too many files open", err, 20); + } else { + __MOVE("file not created", err, 17); + } + Files_Err(err, ((LONGINT)(32)), f, error); + } + } +} + +static void Files_Flush (Files_Buffer buf) +{ + INTEGER error; + Files_File f = NIL; + if (buf->chg) { + f = buf->f; + Files_Create(f); + if (buf->org != f->pos) { + error = Platform_Seek(f->fd, buf->org, Platform_SeekSet); + } + error = Platform_Write(f->fd, (LONGINT)(uintptr_t)buf->data, buf->size); + if (error != 0) { + Files_Err((CHAR*)"error writing file", (LONGINT)19, f, error); + } + f->pos = buf->org + buf->size; + buf->chg = 0; + error = Platform_Identify(f->fd, &f->identity, Platform_FileIdentity__typ); + if (error != 0) { + Files_Err((CHAR*)"error identifying file", (LONGINT)23, f, error); + } + } +} + +void Files_Close (Files_File f) +{ + LONGINT i; + INTEGER error; + if (f->state != 1 || f->registerName[0] != 0x00) { + Files_Create(f); + i = 0; + while ((i < 4 && f->bufs[i] != NIL)) { + Files_Flush(f->bufs[i]); + i += 1; + } + error = Platform_Sync(f->fd); + if (error != 0) { + Files_Err((CHAR*)"error writing file", (LONGINT)19, f, error); + } + Files_fileTab[f->fd] = 0; + error = Platform_Close(f->fd); + f->fd = -1; + f->state = 1; + Heap_FileCount -= 1; + } +} + +LONGINT Files_Length (Files_File f) +{ + LONGINT _o_result; + _o_result = f->len; + return _o_result; +} + +Files_File Files_New (CHAR *name, LONGINT name__len) +{ + Files_File _o_result; + Files_File f = NIL; + __DUP(name, name__len, CHAR); + __NEW(f, Files_Handle); + f->workName[0] = 0x00; + __COPY(name, f->registerName, ((LONGINT)(101))); + f->fd = -1; + f->state = 1; + f->len = 0; + f->pos = 0; + f->swapper = -1; + _o_result = f; + __DEL(name); + return _o_result; +} + +static void Files_ScanPath (INTEGER *pos, CHAR *dir, LONGINT dir__len) +{ + INTEGER i; + CHAR ch; + i = 0; + if (Files_SearchPath == NIL) { + if (*pos == 0) { + dir[0] = '.'; + i = 1; + *pos += 1; + } + } else { + ch = (Files_SearchPath->data)[*pos]; + while (ch == ' ' || ch == ';') { + *pos += 1; + ch = (Files_SearchPath->data)[*pos]; + } + if (ch == '~') { + *pos += 1; + ch = (Files_SearchPath->data)[*pos]; + while (Files_HOME[i] != 0x00) { + dir[i] = Files_HOME[i]; + i += 1; + } + if ((((((ch != '/' && ch != 0x00)) && ch != ';')) && ch != ' ')) { + while ((i > 0 && dir[i - 1] != '/')) { + i -= 1; + } + } + } + while ((ch != 0x00 && ch != ';')) { + dir[i] = ch; + i += 1; + *pos += 1; + ch = (Files_SearchPath->data)[*pos]; + } + while ((i > 0 && dir[i - 1] == ' ')) { + i -= 1; + } + } + dir[i] = 0x00; +} + +static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len) +{ + BOOLEAN _o_result; + INTEGER i; + CHAR ch; + i = 0; + ch = name[0]; + while ((ch != 0x00 && ch != '/')) { + i += 1; + ch = name[i]; + } + _o_result = ch == '/'; + return _o_result; +} + +static Files_File Files_CacheEntry (Platform_FileIdentity identity) +{ + Files_File _o_result; + Files_File f = NIL; + INTEGER i, error; + i = 0; + while (i < 256) { + f = (Files_File)(uintptr_t)Files_fileTab[i]; + if ((f != NIL && Platform_SameFile(identity, f->identity))) { + if (!Platform_SameFileTime(identity, f->identity)) { + i = 0; + while (i < 4) { + if (f->bufs[i] != NIL) { + f->bufs[i]->org = -1; + f->bufs[i] = NIL; + } + i += 1; + } + f->swapper = -1; + f->identity = identity; + error = Platform_Size(f->fd, &f->len); + } + _o_result = f; + return _o_result; + } + i += 1; + } + _o_result = NIL; + return _o_result; +} + +Files_File Files_Old (CHAR *name, LONGINT name__len) +{ + Files_File _o_result; + Files_File f = NIL; + LONGINT fd; + INTEGER pos; + BOOLEAN done; + CHAR dir[256], path[256]; + INTEGER error; + Platform_FileIdentity identity; + __DUP(name, name__len, CHAR); + if (name[0] != 0x00) { + if (Files_HasDir((void*)name, name__len)) { + dir[0] = 0x00; + __COPY(name, path, ((LONGINT)(256))); + } else { + pos = 0; + Files_ScanPath(&pos, (void*)dir, ((LONGINT)(256))); + Files_MakeFileName(dir, ((LONGINT)(256)), name, name__len, (void*)path, ((LONGINT)(256))); + Files_ScanPath(&pos, (void*)dir, ((LONGINT)(256))); + } + for (;;) { + error = Platform_OldRW((void*)path, ((LONGINT)(256)), &fd); + done = error == 0; + if ((!done && Platform_TooManyFiles(error)) || (done && fd >= 256)) { + if ((done && fd >= 256)) { + error = Platform_Close(fd); + } + Heap_GC(1); + error = Platform_OldRW((void*)path, ((LONGINT)(256)), &fd); + done = error == 0; + if ((!done && Platform_TooManyFiles(error))) { + Files_Err((CHAR*)"too many files open", (LONGINT)20, f, error); + } + } + if ((!done && Platform_Inaccessible(error))) { + error = Platform_OldRO((void*)path, ((LONGINT)(256)), &fd); + done = error == 0; + } + if ((!done && !Platform_Absent(error))) { + Console_String((CHAR*)"Warning: Files.Old ", (LONGINT)20); + Console_String(name, name__len); + Console_String((CHAR*)" error = ", (LONGINT)10); + Console_Int(error, ((LONGINT)(0))); + Console_Ln(); + } + if (done) { + error = Platform_Identify(fd, &identity, Platform_FileIdentity__typ); + f = Files_CacheEntry(identity); + if (f != NIL) { + error = Platform_Close(fd); + _o_result = f; + __DEL(name); + return _o_result; + } else if (fd >= 256) { + error = Platform_Close(fd); + Files_Err((CHAR*)"too many files open", (LONGINT)20, f, 0); + } else { + __NEW(f, Files_Handle); + Files_fileTab[fd] = (LONGINT)(uintptr_t)f; + Heap_FileCount += 1; + Heap_RegisterFinalizer((void*)f, Files_Finalize); + f->fd = fd; + f->state = 0; + f->pos = 0; + f->swapper = -1; + error = Platform_Size(fd, &f->len); + __COPY(name, f->workName, ((LONGINT)(101))); + f->registerName[0] = 0x00; + f->tempFile = 0; + f->identity = identity; + _o_result = f; + __DEL(name); + return _o_result; + } + } else if (dir[0] == 0x00) { + _o_result = NIL; + __DEL(name); + return _o_result; + } else { + Files_MakeFileName(dir, ((LONGINT)(256)), name, name__len, (void*)path, ((LONGINT)(256))); + Files_ScanPath(&pos, (void*)dir, ((LONGINT)(256))); + } + } + } else { + _o_result = NIL; + __DEL(name); + return _o_result; + } + __RETCHK; +} + +void Files_Purge (Files_File f) +{ + INTEGER i; + Platform_FileIdentity identity; + INTEGER error; + i = 0; + while (i < 4) { + if (f->bufs[i] != NIL) { + f->bufs[i]->org = -1; + f->bufs[i] = NIL; + } + i += 1; + } + if (f->fd != -1) { + error = Platform_Truncate(f->fd, ((LONGINT)(0))); + error = Platform_Seek(f->fd, ((LONGINT)(0)), Platform_SeekSet); + } + f->pos = 0; + f->len = 0; + f->swapper = -1; + error = Platform_Identify(f->fd, &identity, Platform_FileIdentity__typ); + Platform_SetMTime(&f->identity, Platform_FileIdentity__typ, identity); +} + +void Files_GetDate (Files_File f, LONGINT *t, LONGINT *d) +{ + Platform_FileIdentity identity; + INTEGER error; + Files_Create(f); + error = Platform_Identify(f->fd, &identity, Platform_FileIdentity__typ); + Platform_MTimeAsClock(identity, &*t, &*d); +} + +LONGINT Files_Pos (Files_Rider *r, LONGINT *r__typ) +{ + LONGINT _o_result; + _o_result = (*r).org + (*r).offset; + return _o_result; +} + +void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, LONGINT pos) +{ + LONGINT org, offset, i, n; + Files_Buffer buf = NIL; + INTEGER error; + if (f != NIL) { + if (pos > f->len) { + pos = f->len; + } else if (pos < 0) { + pos = 0; + } + offset = __MASK(pos, -4096); + org = pos - offset; + i = 0; + while ((((i < 4 && f->bufs[i] != NIL)) && org != f->bufs[i]->org)) { + i += 1; + } + if (i < 4) { + if (f->bufs[i] == NIL) { + __NEW(buf, Files_BufDesc); + buf->chg = 0; + buf->org = -1; + buf->f = f; + f->bufs[i] = buf; + } else { + buf = f->bufs[i]; + } + } else { + f->swapper = __MASK(f->swapper + 1, -4); + buf = f->bufs[f->swapper]; + Files_Flush(buf); + } + if (buf->org != org) { + if (org == f->len) { + buf->size = 0; + } else { + Files_Create(f); + if (f->pos != org) { + error = Platform_Seek(f->fd, org, Platform_SeekSet); + } + error = Platform_ReadBuf(f->fd, (void*)buf->data, ((LONGINT)(4096)), &n); + if (error != 0) { + Files_Err((CHAR*)"read from file not done", (LONGINT)24, f, error); + } + f->pos = org + n; + buf->size = n; + } + buf->org = org; + buf->chg = 0; + } + } else { + buf = NIL; + org = 0; + offset = 0; + } + (*r).buf = buf; + (*r).org = org; + (*r).offset = offset; + (*r).eof = 0; + (*r).res = 0; +} + +void Files_Read (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x) +{ + LONGINT offset; + Files_Buffer buf = NIL; + buf = (*r).buf; + offset = (*r).offset; + if ((*r).org != buf->org) { + Files_Set(&*r, r__typ, buf->f, (*r).org + offset); + buf = (*r).buf; + offset = (*r).offset; + } + if (offset < buf->size) { + *x = buf->data[offset]; + (*r).offset = offset + 1; + } else if ((*r).org + offset < buf->f->len) { + Files_Set(&*r, r__typ, (*r).buf->f, (*r).org + offset); + *x = (*r).buf->data[0]; + (*r).offset = 1; + } else { + *x = 0x00; + (*r).eof = 1; + } +} + +void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, LONGINT n) +{ + LONGINT xpos, min, restInBuf, offset; + Files_Buffer buf = NIL; + if (n > x__len) { + Files_IdxTrap(); + } + xpos = 0; + buf = (*r).buf; + offset = (*r).offset; + while (n > 0) { + if ((*r).org != buf->org || offset >= 4096) { + Files_Set(&*r, r__typ, buf->f, (*r).org + offset); + buf = (*r).buf; + offset = (*r).offset; + } + restInBuf = buf->size - offset; + if (restInBuf == 0) { + (*r).res = n; + (*r).eof = 1; + return; + } else if (n > restInBuf) { + min = restInBuf; + } else { + min = n; + } + __MOVE((LONGINT)(uintptr_t)buf->data + offset, (LONGINT)(uintptr_t)x + xpos, min); + offset += min; + (*r).offset = offset; + xpos += min; + n -= min; + } + (*r).res = 0; + (*r).eof = 0; +} + +void Files_ReadByte (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len) +{ + Files_ReadBytes(&*r, r__typ, (void*)x, x__len * ((LONGINT)(1)), ((LONGINT)(1))); +} + +Files_File Files_Base (Files_Rider *r, LONGINT *r__typ) +{ + Files_File _o_result; + _o_result = (*r).buf->f; + return _o_result; +} + +void Files_Write (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE x) +{ + Files_Buffer buf = NIL; + LONGINT offset; + buf = (*r).buf; + offset = (*r).offset; + if ((*r).org != buf->org || offset >= 4096) { + Files_Set(&*r, r__typ, buf->f, (*r).org + offset); + buf = (*r).buf; + offset = (*r).offset; + } + buf->data[offset] = x; + buf->chg = 1; + if (offset == buf->size) { + buf->size += 1; + buf->f->len += 1; + } + (*r).offset = offset + 1; + (*r).res = 0; +} + +void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, LONGINT n) +{ + LONGINT xpos, min, restInBuf, offset; + Files_Buffer buf = NIL; + if (n > x__len) { + Files_IdxTrap(); + } + xpos = 0; + buf = (*r).buf; + offset = (*r).offset; + while (n > 0) { + if ((*r).org != buf->org || offset >= 4096) { + Files_Set(&*r, r__typ, buf->f, (*r).org + offset); + buf = (*r).buf; + offset = (*r).offset; + } + restInBuf = 4096 - offset; + if (n > restInBuf) { + min = restInBuf; + } else { + min = n; + } + __MOVE((LONGINT)(uintptr_t)x + xpos, (LONGINT)(uintptr_t)buf->data + offset, min); + offset += min; + (*r).offset = offset; + if (offset > buf->size) { + buf->f->len += offset - buf->size; + buf->size = offset; + } + xpos += min; + n -= min; + buf->chg = 1; + } + (*r).res = 0; +} + +void Files_Delete (CHAR *name, LONGINT name__len, INTEGER *res) +{ + __DUP(name, name__len, CHAR); + *res = Platform_Unlink((void*)name, name__len); + __DEL(name); +} + +void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INTEGER *res) +{ + LONGINT fdold, fdnew, n; + INTEGER error, ignore; + Platform_FileIdentity oldidentity, newidentity; + CHAR buf[4096]; + __DUP(old, old__len, CHAR); + __DUP(new, new__len, CHAR); + error = Platform_IdentifyByName(old, old__len, &oldidentity, Platform_FileIdentity__typ); + if (error == 0) { + error = Platform_IdentifyByName(new, new__len, &newidentity, Platform_FileIdentity__typ); + if ((error != 0 && !Platform_SameFile(oldidentity, newidentity))) { + Files_Delete(new, new__len, &error); + } + error = Platform_Rename((void*)old, old__len, (void*)new, new__len); + if (!Platform_DifferentFilesystems(error)) { + *res = error; + return; + } else { + error = Platform_OldRO((void*)old, old__len, &fdold); + if (error != 0) { + *res = 2; + return; + } + error = Platform_New((void*)new, new__len, &fdnew); + if (error != 0) { + error = Platform_Close(fdold); + *res = 3; + return; + } + error = Platform_Read(fdold, (LONGINT)(uintptr_t)buf, ((LONGINT)(4096)), &n); + while (n > 0) { + error = Platform_Write(fdnew, (LONGINT)(uintptr_t)buf, n); + if (error != 0) { + ignore = Platform_Close(fdold); + ignore = Platform_Close(fdnew); + Files_Err((CHAR*)"cannot move file", (LONGINT)17, NIL, error); + } + error = Platform_Read(fdold, (LONGINT)(uintptr_t)buf, ((LONGINT)(4096)), &n); + } + ignore = Platform_Close(fdold); + ignore = Platform_Close(fdnew); + if (n == 0) { + error = Platform_Unlink((void*)old, old__len); + *res = 0; + } else { + Files_Err((CHAR*)"cannot move file", (LONGINT)17, NIL, error); + } + } + } else { + *res = 2; + } + __DEL(old); + __DEL(new); +} + +void Files_Register (Files_File f) +{ + INTEGER idx, errcode; + Files_File f1 = NIL; + CHAR file[104]; + if ((f->state == 1 && f->registerName[0] != 0x00)) { + f->state = 2; + } + Files_Close(f); + if (f->registerName[0] != 0x00) { + Files_Rename(f->workName, ((LONGINT)(101)), f->registerName, ((LONGINT)(101)), &errcode); + if (errcode != 0) { + __COPY(f->registerName, file, ((LONGINT)(104))); + __HALT(99); + } + __COPY(f->registerName, f->workName, ((LONGINT)(101))); + f->registerName[0] = 0x00; + f->tempFile = 0; + } +} + +void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INTEGER *res) +{ + __DUP(path, path__len, CHAR); + *res = Platform_Chdir((void*)path, path__len); + __DEL(path); +} + +static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *dest, LONGINT dest__len) +{ + LONGINT i, j; + if (!Platform_LittleEndian) { + i = src__len; + j = 0; + while (i > 0) { + i -= 1; + dest[j] = src[i]; + j += 1; + } + } else { + __MOVE((LONGINT)(uintptr_t)src, (LONGINT)(uintptr_t)dest, src__len); + } +} + +void Files_ReadBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN *x) +{ + Files_Read(&*R, R__typ, (CHAR*)(void*)&*x); +} + +void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, INTEGER *x) +{ + CHAR b[2]; + Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(2)), ((LONGINT)(2))); + *x = (int)b[0] + __ASHL((int)b[1], 8); +} + +void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, LONGINT *x) +{ + CHAR b[4]; + Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); + *x = (((int)b[0] + __ASHL((int)b[1], 8)) + __ASHL((int)b[2], 16)) + __ASHL((int)b[3], 24); +} + +void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x) +{ + CHAR b[4]; + Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); + *x = (SET)((((int)b[0] + __ASHL((int)b[1], 8)) + __ASHL((int)b[2], 16)) + __ASHL((int)b[3], 24)); +} + +void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x) +{ + CHAR b[4]; + Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); + Files_FlipBytes((void*)b, ((LONGINT)(4)), (void*)&*x, ((LONGINT)(4))); +} + +void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x) +{ + CHAR b[8]; + Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(8)), ((LONGINT)(8))); + Files_FlipBytes((void*)b, ((LONGINT)(8)), (void*)&*x, ((LONGINT)(8))); +} + +void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) +{ + INTEGER i; + CHAR ch; + i = 0; + do { + Files_Read(&*R, R__typ, (void*)&ch); + x[i] = ch; + i += 1; + } while (!(ch == 0x00)); +} + +void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) +{ + INTEGER i; + CHAR ch; + BOOLEAN b; + i = 0; + b = 0; + do { + Files_Read(&*R, R__typ, (void*)&ch); + if ((ch == 0x00 || ch == 0x0a) || ch == 0x0d) { + b = 1; + } else { + x[i] = ch; + i += 1; + } + } while (!b); +} + +void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, LONGINT *x) +{ + SHORTINT s; + CHAR ch; + LONGINT n; + s = 0; + n = 0; + Files_Read(&*R, R__typ, (void*)&ch); + while ((int)ch >= 128) { + n += __ASH((LONGINT)((int)ch - 128), s); + s += 7; + Files_Read(&*R, R__typ, (void*)&ch); + } + n += __ASH((LONGINT)(__MASK((int)ch, -64) - __ASHL(__ASHR((int)ch, 6), 6)), s); + *x = n; +} + +void Files_WriteBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN x) +{ + Files_Write(&*R, R__typ, __VAL(CHAR, x)); +} + +void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, INTEGER x) +{ + CHAR b[2]; + b[0] = (CHAR)x; + b[1] = (CHAR)__ASHR(x, 8); + Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(2)), ((LONGINT)(2))); +} + +void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, LONGINT x) +{ + CHAR b[4]; + b[0] = (CHAR)x; + b[1] = (CHAR)__ASHR(x, 8); + b[2] = (CHAR)__ASHR(x, 16); + b[3] = (CHAR)__ASHR(x, 24); + Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); +} + +void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x) +{ + CHAR b[4]; + LONGINT i; + i = (LONGINT)x; + b[0] = (CHAR)i; + b[1] = (CHAR)__ASHR(i, 8); + b[2] = (CHAR)__ASHR(i, 16); + b[3] = (CHAR)__ASHR(i, 24); + Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); +} + +void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x) +{ + CHAR b[4]; + Files_FlipBytes((void*)&x, ((LONGINT)(4)), (void*)b, ((LONGINT)(4))); + Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); +} + +void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x) +{ + CHAR b[8]; + Files_FlipBytes((void*)&x, ((LONGINT)(8)), (void*)b, ((LONGINT)(8))); + Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(8)), ((LONGINT)(8))); +} + +void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) +{ + INTEGER i; + i = 0; + while (x[i] != 0x00) { + i += 1; + } + Files_WriteBytes(&*R, R__typ, (void*)x, x__len * ((LONGINT)(1)), i + 1); +} + +void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, LONGINT x) +{ + while (x < -64 || x > 63) { + Files_Write(&*R, R__typ, (CHAR)(__MASK(x, -128) + 128)); + x = __ASHR(x, 7); + } + Files_Write(&*R, R__typ, (CHAR)__MASK(x, -128)); +} + +void Files_GetName (Files_File f, CHAR *name, LONGINT name__len) +{ + __COPY(f->workName, name, name__len); +} + +static void Files_Finalize (SYSTEM_PTR o) +{ + Files_File f = NIL; + LONGINT res; + f = (Files_File)(uintptr_t)o; + if (f->fd >= 0) { + Files_fileTab[f->fd] = 0; + res = Platform_Close(f->fd); + f->fd = -1; + Heap_FileCount -= 1; + if (f->tempFile) { + res = Platform_Unlink((void*)f->workName, ((LONGINT)(101))); + } + } +} + +void Files_SetSearchPath (CHAR *path, LONGINT path__len) +{ + __DUP(path, path__len, CHAR); + if (Strings_Length(path, path__len) != 0) { + Files_SearchPath = __NEWARR(NIL, ((LONGINT)(1)), 1, 1, 1, (LONGINT)(Strings_Length(path, path__len) + 1)); + __COPY(path, Files_SearchPath->data, Files_SearchPath->len[0]); + } else { + Files_SearchPath = NIL; + } + __DEL(path); +} + +static void Files_Init (void) +{ + LONGINT i; + i = 0; + while (i < 256) { + Files_fileTab[i] = 0; + i += 1; + } + Files_tempno = -1; + Heap_FileCount = 0; + Files_SearchPath = NIL; + Files_HOME[0] = 0x00; + Platform_GetEnv((CHAR*)"HOME", (LONGINT)5, (void*)Files_HOME, ((LONGINT)(1024))); +} + +static void EnumPtrs(void (*P)(void*)) +{ + P(Files_SearchPath); +} + +__TDESC(Files_Handle, 1, 4) = {__TDFLDS("Handle", 312), {272, 280, 288, 296, -40}}; +__TDESC(Files_BufDesc, 1, 1) = {__TDFLDS("BufDesc", 4128), {0, -16}}; +__TDESC(Files_Rider, 1, 1) = {__TDFLDS("Rider", 40), {16, -16}}; + +export void *Files__init(void) +{ + __DEFMOD; + __MODULE_IMPORT(Configuration); + __MODULE_IMPORT(Console); + __MODULE_IMPORT(Heap); + __MODULE_IMPORT(Platform); + __MODULE_IMPORT(Strings); + __REGMOD("Files", EnumPtrs); + __INITYP(Files_Handle, Files_Handle, 0); + __INITYP(Files_BufDesc, Files_BufDesc, 0); + __INITYP(Files_Rider, Files_Rider, 0); +/* BEGIN */ + Files_Init(); + __ENDMOD; +} diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h new file mode 100644 index 00000000..565ac5ff --- /dev/null +++ b/bootstrap/windows-88/Files.h @@ -0,0 +1,71 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin tspkaSfF */ + +#ifndef Files__h +#define Files__h + +#define LARGE +#include "SYSTEM.h" + +typedef + struct Files_Handle *Files_File; + +typedef + struct Files_Handle { + char _prvt0[248]; + LONGINT fd; + char _prvt1[56]; + } Files_Handle; + +typedef + struct Files_Rider { + LONGINT res; + BOOLEAN eof; + char _prvt0[31]; + } Files_Rider; + + + +import LONGINT *Files_Handle__typ; +import LONGINT *Files_Rider__typ; + +import Files_File Files_Base (Files_Rider *r, LONGINT *r__typ); +import void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INTEGER *res); +import void Files_Close (Files_File f); +import void Files_Delete (CHAR *name, LONGINT name__len, INTEGER *res); +import void Files_GetDate (Files_File f, LONGINT *t, LONGINT *d); +import void Files_GetName (Files_File f, CHAR *name, LONGINT name__len); +import LONGINT Files_Length (Files_File f); +import Files_File Files_New (CHAR *name, LONGINT name__len); +import Files_File Files_Old (CHAR *name, LONGINT name__len); +import LONGINT Files_Pos (Files_Rider *r, LONGINT *r__typ); +import void Files_Purge (Files_File f); +import void Files_Read (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x); +import void Files_ReadBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN *x); +import void Files_ReadByte (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len); +import void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, LONGINT n); +import void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, INTEGER *x); +import void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, LONGINT *x); +import void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x); +import void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); +import void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, LONGINT *x); +import void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x); +import void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x); +import void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); +import void Files_Register (Files_File f); +import void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INTEGER *res); +import void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, LONGINT pos); +import void Files_SetSearchPath (CHAR *path, LONGINT path__len); +import void Files_Write (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE x); +import void Files_WriteBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN x); +import void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, LONGINT n); +import void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, INTEGER x); +import void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, LONGINT x); +import void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x); +import void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, LONGINT x); +import void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x); +import void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x); +import void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); +import void *Files__init(void); + + +#endif diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c new file mode 100644 index 00000000..929a8283 --- /dev/null +++ b/bootstrap/windows-88/Heap.c @@ -0,0 +1,753 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin tskSfF */ +#define LARGE +#include "SYSTEM.h" + +struct Heap__1 { + CHAR ch; + SYSTEM_PTR p; +}; + +typedef + struct Heap_CmdDesc *Heap_Cmd; + +typedef + CHAR Heap_CmdName[24]; + +typedef + void (*Heap_Command)(void); + +typedef + struct Heap_CmdDesc { + Heap_Cmd next; + Heap_CmdName name; + Heap_Command cmd; + } Heap_CmdDesc; + +typedef + void (*Heap_EnumProc)(void(*)(SYSTEM_PTR)); + +typedef + struct Heap_FinDesc *Heap_FinNode; + +typedef + void (*Heap_Finalizer)(SYSTEM_PTR); + +typedef + struct Heap_FinDesc { + Heap_FinNode next; + LONGINT obj; + BOOLEAN marked; + Heap_Finalizer finalize; + } Heap_FinDesc; + +typedef + struct Heap_ModuleDesc *Heap_Module; + +typedef + CHAR Heap_ModuleName[20]; + +typedef + struct Heap_ModuleDesc { + Heap_Module next; + Heap_ModuleName name; + LONGINT refcnt; + Heap_Cmd cmds; + LONGINT types; + Heap_EnumProc enumPtrs; + LONGINT reserved1, reserved2; + } Heap_ModuleDesc; + + +export SYSTEM_PTR Heap_modules; +static LONGINT Heap_freeList[10]; +static LONGINT Heap_bigBlocks; +export LONGINT Heap_allocated; +static BOOLEAN Heap_firstTry; +static LONGINT Heap_heap, Heap_heapend; +export LONGINT Heap_heapsize; +static Heap_FinNode Heap_fin; +static INTEGER Heap_lockdepth; +static BOOLEAN Heap_interrupted; +export INTEGER Heap_FileCount; + +export LONGINT *Heap_ModuleDesc__typ; +export LONGINT *Heap_CmdDesc__typ; +export LONGINT *Heap_FinDesc__typ; +export LONGINT *Heap__1__typ; + +static void Heap_CheckFin (void); +static void Heap_ExtendHeap (LONGINT blksz); +export void Heap_FINALL (void); +static void Heap_Finalize (void); +export void Heap_GC (BOOLEAN markStack); +static void Heap_HeapSort (LONGINT n, LONGINT *a, LONGINT a__len); +export void Heap_INCREF (Heap_Module m); +export void Heap_InitHeap (void); +export void Heap_Lock (void); +static void Heap_Mark (LONGINT q); +static void Heap_MarkCandidates (LONGINT n, LONGINT *cand, LONGINT cand__len); +static void Heap_MarkP (SYSTEM_PTR p); +static void Heap_MarkStack (LONGINT n, LONGINT *cand, LONGINT cand__len); +export SYSTEM_PTR Heap_NEWBLK (LONGINT size); +export SYSTEM_PTR Heap_NEWREC (LONGINT tag); +static LONGINT Heap_NewChunk (LONGINT blksz); +export void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); +export SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); +export void Heap_REGTYP (Heap_Module m, LONGINT typ); +export void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); +static void Heap_Scan (void); +static void Heap_Sift (LONGINT l, LONGINT r, LONGINT *a, LONGINT a__len); +export void Heap_Unlock (void); + +extern void *Heap__init(); +extern LONGINT Platform_MainStackFrame; +extern LONGINT Platform_OSAllocate(LONGINT size); +#define Heap_FetchAddress(pointer) (LONGINT)(uintptr_t)(*((void**)((uintptr_t)pointer))) +#define Heap_HeapModuleInit() Heap__init() +#define Heap_OSAllocate(size) Platform_OSAllocate(size) +#define Heap_PlatformHalt(code) Platform_Halt(code) +#define Heap_PlatformMainStackFrame() Platform_MainStackFrame + +void Heap_Lock (void) +{ + Heap_lockdepth += 1; +} + +void Heap_Unlock (void) +{ + Heap_lockdepth -= 1; + if ((Heap_interrupted && Heap_lockdepth == 0)) { + Heap_PlatformHalt(((LONGINT)(-9))); + } +} + +SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) +{ + SYSTEM_PTR _o_result; + Heap_Module m; + if (__STRCMP(name, "Heap") == 0) { + __SYSNEW(m, 80); + } else { + __NEW(m, Heap_ModuleDesc); + } + m->types = 0; + m->cmds = NIL; + __COPY(name, m->name, ((LONGINT)(20))); + m->refcnt = 0; + m->enumPtrs = enumPtrs; + m->next = (Heap_Module)(uintptr_t)Heap_modules; + Heap_modules = (SYSTEM_PTR)m; + _o_result = (void*)m; + return _o_result; +} + +void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) +{ + Heap_Cmd c; + if (__STRCMP(m->name, "Heap") == 0) { + __SYSNEW(c, 40); + } else { + __NEW(c, Heap_CmdDesc); + } + __COPY(name, c->name, ((LONGINT)(24))); + c->cmd = cmd; + c->next = m->cmds; + m->cmds = c; +} + +void Heap_REGTYP (Heap_Module m, LONGINT typ) +{ + __PUT(typ, m->types, LONGINT); + m->types = typ; +} + +void Heap_INCREF (Heap_Module m) +{ + m->refcnt += 1; +} + +static LONGINT Heap_NewChunk (LONGINT blksz) +{ + LONGINT _o_result; + LONGINT chnk; + chnk = Heap_OSAllocate(blksz + 24); + if (chnk != 0) { + __PUT(chnk + 8, chnk + (24 + blksz), LONGINT); + __PUT(chnk + 24, chnk + 32, LONGINT); + __PUT(chnk + 32, blksz, LONGINT); + __PUT(chnk + 40, -8, LONGINT); + __PUT(chnk + 48, Heap_bigBlocks, LONGINT); + Heap_bigBlocks = chnk + 24; + Heap_heapsize += blksz; + } + _o_result = chnk; + return _o_result; +} + +static void Heap_ExtendHeap (LONGINT blksz) +{ + LONGINT size, chnk, j, next; + if (blksz > 320000) { + size = blksz; + } else { + size = 320000; + } + chnk = Heap_NewChunk(size); + if (chnk != 0) { + if (chnk < Heap_heap) { + __PUT(chnk, Heap_heap, LONGINT); + Heap_heap = chnk; + } else { + j = Heap_heap; + next = Heap_FetchAddress(j); + while ((next != 0 && chnk > next)) { + j = next; + next = Heap_FetchAddress(j); + } + __PUT(chnk, next, LONGINT); + __PUT(j, chnk, LONGINT); + } + if (next == 0) { + Heap_heapend = Heap_FetchAddress(chnk + 8); + } + } +} + +SYSTEM_PTR Heap_NEWREC (LONGINT tag) +{ + SYSTEM_PTR _o_result; + LONGINT i, i0, di, blksz, restsize, t, adr, end, next, prev; + SYSTEM_PTR new; + Heap_Lock(); + blksz = Heap_FetchAddress(tag); + i0 = __ASHR(blksz, 5); + i = i0; + if (i < 9) { + adr = Heap_freeList[i]; + while (adr == 0) { + i += 1; + adr = Heap_freeList[i]; + } + } + if (i < 9) { + next = Heap_FetchAddress(adr + 24); + Heap_freeList[i] = next; + if (i != i0) { + di = i - i0; + restsize = __ASHL(di, 5); + end = adr + restsize; + __PUT(end + 8, blksz, LONGINT); + __PUT(end + 16, -8, LONGINT); + __PUT(end, end + 8, LONGINT); + __PUT(adr + 8, restsize, LONGINT); + __PUT(adr + 24, Heap_freeList[di], LONGINT); + Heap_freeList[di] = adr; + adr += restsize; + } + } else { + adr = Heap_bigBlocks; + prev = 0; + for (;;) { + if (adr == 0) { + if (Heap_firstTry) { + Heap_GC(1); + blksz += 32; + if (__ASHL((Heap_heapsize - Heap_allocated) - blksz, 2) < Heap_heapsize) { + Heap_ExtendHeap(__ASHL(__DIV(Heap_allocated + blksz, 96), 7) - Heap_heapsize); + } + Heap_firstTry = 0; + new = Heap_NEWREC(tag); + Heap_firstTry = 1; + if (new == NIL) { + Heap_ExtendHeap(__ASHL(__DIV(Heap_allocated + blksz, 96), 7) - Heap_heapsize); + new = Heap_NEWREC(tag); + } + Heap_Unlock(); + _o_result = new; + return _o_result; + } else { + Heap_Unlock(); + _o_result = NIL; + return _o_result; + } + } + t = Heap_FetchAddress(adr + 8); + if (t >= blksz) { + break; + } + prev = adr; + adr = Heap_FetchAddress(adr + 24); + } + restsize = t - blksz; + end = adr + restsize; + __PUT(end + 8, blksz, LONGINT); + __PUT(end + 16, -8, LONGINT); + __PUT(end, end + 8, LONGINT); + if (restsize > 288) { + __PUT(adr + 8, restsize, LONGINT); + } else { + next = Heap_FetchAddress(adr + 24); + if (prev == 0) { + Heap_bigBlocks = next; + } else { + __PUT(prev + 24, next, LONGINT); + } + if (restsize > 0) { + di = __ASHR(restsize, 5); + __PUT(adr + 8, restsize, LONGINT); + __PUT(adr + 24, Heap_freeList[di], LONGINT); + Heap_freeList[di] = adr; + } + } + adr += restsize; + } + i = adr + 32; + end = adr + blksz; + while (i < end) { + __PUT(i, 0, LONGINT); + __PUT(i + 8, 0, LONGINT); + __PUT(i + 16, 0, LONGINT); + __PUT(i + 24, 0, LONGINT); + i += 32; + } + __PUT(adr + 24, 0, LONGINT); + __PUT(adr, tag, LONGINT); + __PUT(adr + 8, 0, LONGINT); + __PUT(adr + 16, 0, LONGINT); + Heap_allocated += blksz; + Heap_Unlock(); + _o_result = (SYSTEM_PTR)(uintptr_t)(adr + 8); + return _o_result; +} + +SYSTEM_PTR Heap_NEWBLK (LONGINT size) +{ + SYSTEM_PTR _o_result; + LONGINT blksz, tag; + SYSTEM_PTR new; + Heap_Lock(); + blksz = __ASHL(__ASHR(size + 63, 5), 5); + new = Heap_NEWREC((LONGINT)(uintptr_t)&blksz); + tag = ((LONGINT)(uintptr_t)new + blksz) - 24; + __PUT(tag - 8, 0, LONGINT); + __PUT(tag, blksz, LONGINT); + __PUT(tag + 8, -8, LONGINT); + __PUT((LONGINT)(uintptr_t)new - 8, tag, LONGINT); + Heap_Unlock(); + _o_result = new; + return _o_result; +} + +static void Heap_Mark (LONGINT q) +{ + LONGINT p, tag, fld, n, offset, tagbits; + if (q != 0) { + tagbits = Heap_FetchAddress(q - 8); + if (!__ODD(tagbits)) { + __PUT(q - 8, tagbits + 1, LONGINT); + p = 0; + tag = tagbits + 8; + for (;;) { + __GET(tag, offset, LONGINT); + if (offset < 0) { + __PUT(q - 8, (tag + offset) + 1, LONGINT); + if (p == 0) { + break; + } + n = q; + q = p; + tag = Heap_FetchAddress(q - 8); + tag -= 1; + __GET(tag, offset, LONGINT); + fld = q + offset; + p = Heap_FetchAddress(fld); + __PUT(fld, (SYSTEM_PTR)(uintptr_t)n, SYSTEM_PTR); + } else { + fld = q + offset; + n = Heap_FetchAddress(fld); + if (n != 0) { + tagbits = Heap_FetchAddress(n - 8); + if (!__ODD(tagbits)) { + __PUT(n - 8, tagbits + 1, LONGINT); + __PUT(q - 8, tag + 1, LONGINT); + __PUT(fld, (SYSTEM_PTR)(uintptr_t)p, SYSTEM_PTR); + p = q; + q = n; + tag = tagbits; + } + } + } + tag += 8; + } + } + } +} + +static void Heap_MarkP (SYSTEM_PTR p) +{ + Heap_Mark((LONGINT)(uintptr_t)p); +} + +static void Heap_Scan (void) +{ + LONGINT chnk, adr, end, start, tag, i, size, freesize; + Heap_bigBlocks = 0; + i = 1; + while (i < 9) { + Heap_freeList[i] = 0; + i += 1; + } + freesize = 0; + Heap_allocated = 0; + chnk = Heap_heap; + while (chnk != 0) { + adr = chnk + 24; + end = Heap_FetchAddress(chnk + 8); + while (adr < end) { + tag = Heap_FetchAddress(adr); + if (__ODD(tag)) { + if (freesize > 0) { + start = adr - freesize; + __PUT(start, start + 8, LONGINT); + __PUT(start + 8, freesize, LONGINT); + __PUT(start + 16, -8, LONGINT); + i = __ASHR(freesize, 5); + freesize = 0; + if (i < 9) { + __PUT(start + 24, Heap_freeList[i], LONGINT); + Heap_freeList[i] = start; + } else { + __PUT(start + 24, Heap_bigBlocks, LONGINT); + Heap_bigBlocks = start; + } + } + tag -= 1; + __PUT(adr, tag, LONGINT); + size = Heap_FetchAddress(tag); + Heap_allocated += size; + adr += size; + } else { + size = Heap_FetchAddress(tag); + freesize += size; + adr += size; + } + } + if (freesize > 0) { + start = adr - freesize; + __PUT(start, start + 8, LONGINT); + __PUT(start + 8, freesize, LONGINT); + __PUT(start + 16, -8, LONGINT); + i = __ASHR(freesize, 5); + freesize = 0; + if (i < 9) { + __PUT(start + 24, Heap_freeList[i], LONGINT); + Heap_freeList[i] = start; + } else { + __PUT(start + 24, Heap_bigBlocks, LONGINT); + Heap_bigBlocks = start; + } + } + chnk = Heap_FetchAddress(chnk); + } +} + +static void Heap_Sift (LONGINT l, LONGINT r, LONGINT *a, LONGINT a__len) +{ + LONGINT i, j, x; + j = l; + x = a[j]; + for (;;) { + i = j; + j = __ASHL(j, 1) + 1; + if ((j < r && a[j] < a[j + 1])) { + j += 1; + } + if (j > r || a[j] <= x) { + break; + } + a[i] = a[j]; + } + a[i] = x; +} + +static void Heap_HeapSort (LONGINT n, LONGINT *a, LONGINT a__len) +{ + LONGINT l, r, x; + l = __ASHR(n, 1); + r = n - 1; + while (l > 0) { + l -= 1; + Heap_Sift(l, r, (void*)a, a__len); + } + while (r > 0) { + x = a[0]; + a[0] = a[r]; + a[r] = x; + r -= 1; + Heap_Sift(l, r, (void*)a, a__len); + } +} + +static void Heap_MarkCandidates (LONGINT n, LONGINT *cand, LONGINT cand__len) +{ + LONGINT chnk, adr, tag, next, lim, lim1, i, ptr, size; + chnk = Heap_heap; + i = 0; + lim = cand[n - 1]; + while ((chnk != 0 && chnk < lim)) { + adr = chnk + 24; + lim1 = Heap_FetchAddress(chnk + 8); + if (lim < lim1) { + lim1 = lim; + } + while (adr < lim1) { + tag = Heap_FetchAddress(adr); + if (__ODD(tag)) { + size = Heap_FetchAddress(tag - 1); + adr += size; + } else { + size = Heap_FetchAddress(tag); + ptr = adr + 8; + while (cand[i] < ptr) { + i += 1; + } + if (i == n) { + return; + } + next = adr + size; + if (cand[i] < next) { + Heap_Mark(ptr); + } + adr = next; + } + } + chnk = Heap_FetchAddress(chnk); + } +} + +static void Heap_CheckFin (void) +{ + Heap_FinNode n; + LONGINT tag; + n = Heap_fin; + while (n != NIL) { + tag = Heap_FetchAddress(n->obj - 8); + if (!__ODD(tag)) { + n->marked = 0; + Heap_Mark(n->obj); + } else { + n->marked = 1; + } + n = n->next; + } +} + +static void Heap_Finalize (void) +{ + Heap_FinNode n, prev; + n = Heap_fin; + prev = NIL; + while (n != NIL) { + if (!n->marked) { + if (n == Heap_fin) { + Heap_fin = Heap_fin->next; + } else { + prev->next = n->next; + } + (*n->finalize)((SYSTEM_PTR)(uintptr_t)n->obj); + if (prev == NIL) { + n = Heap_fin; + } else { + n = n->next; + } + } else { + prev = n; + n = n->next; + } + } +} + +void Heap_FINALL (void) +{ + Heap_FinNode n; + while (Heap_fin != NIL) { + n = Heap_fin; + Heap_fin = Heap_fin->next; + (*n->finalize)((SYSTEM_PTR)(uintptr_t)n->obj); + } +} + +static void Heap_MarkStack (LONGINT n, LONGINT *cand, LONGINT cand__len) +{ + SYSTEM_PTR frame; + LONGINT inc, nofcand, sp, p, stack0, ptr; + struct Heap__1 align; + if (n > 0) { + Heap_MarkStack(n - 1, cand, cand__len); + if (n > 100) { + return; + } + } + if (n == 0) { + nofcand = 0; + sp = (LONGINT)(uintptr_t)&frame; + stack0 = Heap_PlatformMainStackFrame(); + inc = (LONGINT)(uintptr_t)&align.p - (LONGINT)(uintptr_t)&align; + if (sp > stack0) { + inc = -inc; + } + while (sp != stack0) { + __GET(sp, p, LONGINT); + if ((p > Heap_heap && p < Heap_heapend)) { + if (nofcand == cand__len) { + Heap_HeapSort(nofcand, (void*)cand, cand__len); + Heap_MarkCandidates(nofcand, (void*)cand, cand__len); + nofcand = 0; + } + cand[nofcand] = p; + nofcand += 1; + } + sp += inc; + } + if (nofcand > 0) { + Heap_HeapSort(nofcand, (void*)cand, cand__len); + Heap_MarkCandidates(nofcand, (void*)cand, cand__len); + } + } +} + +void Heap_GC (BOOLEAN markStack) +{ + Heap_Module m; + LONGINT i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; + LONGINT cand[10000]; + if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { + Heap_Lock(); + m = (Heap_Module)(uintptr_t)Heap_modules; + while (m != NIL) { + if (m->enumPtrs != NIL) { + (*m->enumPtrs)(Heap_MarkP); + } + m = m->next; + } + if (markStack) { + i0 = -100; + i1 = -101; + i2 = -102; + i3 = -103; + i4 = -104; + i5 = -105; + i6 = -106; + i7 = -107; + i8 = 1; + i9 = 2; + i10 = 3; + i11 = 4; + i12 = 5; + i13 = 6; + i14 = 7; + i15 = 8; + i16 = 9; + i17 = 10; + i18 = 11; + i19 = 12; + i20 = 13; + i21 = 14; + i22 = 15; + i23 = 16; + for (;;) { + i0 += 1; + i1 += 2; + i2 += 3; + i3 += 4; + i4 += 5; + i5 += 6; + i6 += 7; + i7 += 8; + i8 += 9; + i9 += 10; + i10 += 11; + i11 += 12; + i12 += 13; + i13 += 14; + i14 += 15; + i15 += 16; + i16 += 17; + i17 += 18; + i18 += 19; + i19 += 20; + i20 += 21; + i21 += 22; + i22 += 23; + i23 += 24; + if ((i0 == -99 && i15 == 24)) { + Heap_MarkStack(((LONGINT)(32)), (void*)cand, ((LONGINT)(10000))); + break; + } + } + if (((((((((((((((((((((((i0 + i1) + i2) + i3) + i4) + i5) + i6) + i7) + i8) + i9) + i10) + i11) + i12) + i13) + i14) + i15) + i16) + i17) + i18) + i19) + i20) + i21) + i22) + i23 > 10000) { + return; + } + } + Heap_CheckFin(); + Heap_Scan(); + Heap_Finalize(); + Heap_Unlock(); + } +} + +void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) +{ + Heap_FinNode f; + __NEW(f, Heap_FinDesc); + f->obj = (LONGINT)(uintptr_t)obj; + f->finalize = finalize; + f->marked = 1; + f->next = Heap_fin; + Heap_fin = f; +} + +void Heap_InitHeap (void) +{ + Heap_heap = Heap_NewChunk(((LONGINT)(256000))); + Heap_heapend = Heap_FetchAddress(Heap_heap + 8); + __PUT(Heap_heap, 0, LONGINT); + Heap_allocated = 0; + Heap_firstTry = 1; + Heap_freeList[9] = 1; + Heap_lockdepth = 0; + Heap_FileCount = 0; + Heap_modules = NIL; + Heap_heapsize = 0; + Heap_bigBlocks = 0; + Heap_fin = NIL; + Heap_interrupted = 0; + Heap_HeapModuleInit(); +} + +static void EnumPtrs(void (*P)(void*)) +{ + P(Heap_modules); + P(Heap_fin); +} + +__TDESC(Heap_ModuleDesc, 1, 2) = {__TDFLDS("ModuleDesc", 80), {0, 40, -24}}; +__TDESC(Heap_CmdDesc, 1, 1) = {__TDFLDS("CmdDesc", 40), {0, -16}}; +__TDESC(Heap_FinDesc, 1, 1) = {__TDFLDS("FinDesc", 32), {0, -16}}; +__TDESC(Heap__1, 1, 1) = {__TDFLDS("", 16), {8, -16}}; + +export void *Heap__init(void) +{ + __DEFMOD; + __REGMOD("Heap", EnumPtrs); + __REGCMD("FINALL", Heap_FINALL); + __REGCMD("InitHeap", Heap_InitHeap); + __REGCMD("Lock", Heap_Lock); + __REGCMD("Unlock", Heap_Unlock); + __INITYP(Heap_ModuleDesc, Heap_ModuleDesc, 0); + __INITYP(Heap_CmdDesc, Heap_CmdDesc, 0); + __INITYP(Heap_FinDesc, Heap_FinDesc, 0); + __INITYP(Heap__1, Heap__1, 0); +/* BEGIN */ + __ENDMOD; +} diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h new file mode 100644 index 00000000..1b23ddb3 --- /dev/null +++ b/bootstrap/windows-88/Heap.h @@ -0,0 +1,55 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin tskSfF */ + +#ifndef Heap__h +#define Heap__h + +#define LARGE +#include "SYSTEM.h" + +typedef + CHAR Heap_CmdName[24]; + +typedef + void (*Heap_Command)(void); + +typedef + void (*Heap_EnumProc)(void(*)(SYSTEM_PTR)); + +typedef + void (*Heap_Finalizer)(SYSTEM_PTR); + +typedef + struct Heap_ModuleDesc *Heap_Module; + +typedef + struct Heap_ModuleDesc { + LONGINT _prvt0; + char _prvt1[72]; + } Heap_ModuleDesc; + +typedef + CHAR Heap_ModuleName[20]; + + +import SYSTEM_PTR Heap_modules; +import LONGINT Heap_allocated, Heap_heapsize; +import INTEGER Heap_FileCount; + +import LONGINT *Heap_ModuleDesc__typ; + +import void Heap_FINALL (void); +import void Heap_GC (BOOLEAN markStack); +import void Heap_INCREF (Heap_Module m); +import void Heap_InitHeap (void); +import void Heap_Lock (void); +import SYSTEM_PTR Heap_NEWBLK (LONGINT size); +import SYSTEM_PTR Heap_NEWREC (LONGINT tag); +import void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); +import SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); +import void Heap_REGTYP (Heap_Module m, LONGINT typ); +import void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); +import void Heap_Unlock (void); +import void *Heap__init(void); + + +#endif diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c new file mode 100644 index 00000000..77278391 --- /dev/null +++ b/bootstrap/windows-88/Modules.c @@ -0,0 +1,172 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +#define LARGE +#include "SYSTEM.h" +#include "Console.h" +#include "Heap.h" + +typedef + struct Modules_CmdDesc *Modules_Cmd; + +typedef + void (*Modules_Command)(void); + +typedef + struct Modules_CmdDesc { + Modules_Cmd next; + CHAR name[24]; + Modules_Command cmd; + } Modules_CmdDesc; + +typedef + struct Modules_ModuleDesc *Modules_Module; + +typedef + CHAR Modules_ModuleName[20]; + +typedef + struct Modules_ModuleDesc { + Modules_Module next; + Modules_ModuleName name; + LONGINT refcnt; + Modules_Cmd cmds; + LONGINT types; + void (*enumPtrs)(void(*)(LONGINT)); + LONGINT reserved1, reserved2; + } Modules_ModuleDesc; + + +export INTEGER Modules_res; +export CHAR Modules_resMsg[256]; +export Modules_ModuleName Modules_imported, Modules_importing; + +export LONGINT *Modules_ModuleDesc__typ; +export LONGINT *Modules_CmdDesc__typ; + +static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len); +export void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all); +export Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len); +export Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len); + +#define Modules_modules() (Modules_Module)Heap_modules +#define Modules_setmodules(m) Heap_modules = m + +static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len) +{ + INTEGER i, j; + __DUP(b, b__len, CHAR); + i = 0; + while (a[__X(i, a__len)] != 0x00) { + i += 1; + } + j = 0; + while (b[__X(j, b__len)] != 0x00) { + a[__X(i, a__len)] = b[__X(j, b__len)]; + i += 1; + j += 1; + } + a[__X(i, a__len)] = 0x00; + __DEL(b); +} + +Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len) +{ + Modules_Module _o_result; + Modules_Module m = NIL; + CHAR bodyname[64]; + Modules_Command body; + __DUP(name, name__len, CHAR); + m = Modules_modules(); + while ((m != NIL && __STRCMP(m->name, name) != 0)) { + m = m->next; + } + if (m != NIL) { + Modules_res = 0; + Modules_resMsg[0] = 0x00; + } else { + Modules_res = 1; + __COPY(name, Modules_importing, ((LONGINT)(20))); + __MOVE(" module \"", Modules_resMsg, 10); + Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), name, name__len); + Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), (CHAR*)"\" not found", (LONGINT)12); + } + _o_result = m; + __DEL(name); + return _o_result; +} + +Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len) +{ + Modules_Command _o_result; + Modules_Cmd c = NIL; + __DUP(name, name__len, CHAR); + c = mod->cmds; + while ((c != NIL && __STRCMP(c->name, name) != 0)) { + c = c->next; + } + if (c != NIL) { + Modules_res = 0; + Modules_resMsg[0] = 0x00; + _o_result = c->cmd; + __DEL(name); + return _o_result; + } else { + Modules_res = 2; + __MOVE(" command \"", Modules_resMsg, 11); + __COPY(name, Modules_importing, ((LONGINT)(20))); + Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), mod->name, ((LONGINT)(20))); + Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), (CHAR*)".", (LONGINT)2); + Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), name, name__len); + Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), (CHAR*)"\" not found", (LONGINT)12); + _o_result = NIL; + __DEL(name); + return _o_result; + } + __RETCHK; +} + +void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all) +{ + Modules_Module m = NIL, p = NIL; + __DUP(name, name__len, CHAR); + m = Modules_modules(); + if (all) { + Modules_res = 1; + __MOVE("unloading \"all\" not yet supported", Modules_resMsg, 34); + } else { + while ((m != NIL && __STRCMP(m->name, name) != 0)) { + p = m; + m = m->next; + } + if ((m != NIL && m->refcnt == 0)) { + if (m == Modules_modules()) { + Modules_setmodules(m->next); + } else { + p->next = m->next; + } + Modules_res = 0; + } else { + Modules_res = 1; + if (m == NIL) { + __MOVE("module not found", Modules_resMsg, 17); + } else { + __MOVE("clients of this module exist", Modules_resMsg, 29); + } + } + } + __DEL(name); +} + +__TDESC(Modules_ModuleDesc, 1, 2) = {__TDFLDS("ModuleDesc", 80), {0, 40, -24}}; +__TDESC(Modules_CmdDesc, 1, 1) = {__TDFLDS("CmdDesc", 40), {0, -16}}; + +export void *Modules__init(void) +{ + __DEFMOD; + __MODULE_IMPORT(Console); + __MODULE_IMPORT(Heap); + __REGMOD("Modules", 0); + __INITYP(Modules_ModuleDesc, Modules_ModuleDesc, 0); + __INITYP(Modules_CmdDesc, Modules_CmdDesc, 0); +/* BEGIN */ + __ENDMOD; +} diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h new file mode 100644 index 00000000..88bb46e1 --- /dev/null +++ b/bootstrap/windows-88/Modules.h @@ -0,0 +1,55 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ + +#ifndef Modules__h +#define Modules__h + +#define LARGE +#include "SYSTEM.h" + +typedef + struct Modules_CmdDesc *Modules_Cmd; + +typedef + void (*Modules_Command)(void); + +typedef + struct Modules_CmdDesc { + Modules_Cmd next; + CHAR name[24]; + Modules_Command cmd; + } Modules_CmdDesc; + +typedef + struct Modules_ModuleDesc *Modules_Module; + +typedef + CHAR Modules_ModuleName[20]; + +typedef + struct Modules_ModuleDesc { + Modules_Module next; + Modules_ModuleName name; + LONGINT refcnt; + Modules_Cmd cmds; + LONGINT types; + void (*enumPtrs)(void(*)(LONGINT)); + char _prvt0[16]; + } Modules_ModuleDesc; + + +import INTEGER Modules_res; +import CHAR Modules_resMsg[256]; +import Modules_ModuleName Modules_imported, Modules_importing; + +import LONGINT *Modules_ModuleDesc__typ; +import LONGINT *Modules_CmdDesc__typ; + +import void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all); +import Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len); +import Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len); +import void *Modules__init(void); + +#define Modules_modules() (Modules_Module)Heap_modules +#define Modules_setmodules(m) Heap_modules = m + +#endif diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c new file mode 100644 index 00000000..428d0881 --- /dev/null +++ b/bootstrap/windows-88/OPB.c @@ -0,0 +1,2678 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +#define LARGE +#include "SYSTEM.h" +#include "OPM.h" +#include "OPS.h" +#include "OPT.h" + + +export void (*OPB_typSize)(OPT_Struct); +static INTEGER OPB_exp; +static LONGINT OPB_maxExp; + + +export void OPB_Assign (OPT_Node *x, OPT_Node y); +static void OPB_BindNodes (SHORTINT class, OPT_Struct typ, OPT_Node *x, OPT_Node y); +static LONGINT OPB_BoolToInt (BOOLEAN b); +export void OPB_Call (OPT_Node *x, OPT_Node apar, OPT_Object fp); +static void OPB_CharToString (OPT_Node n); +static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode); +static void OPB_CheckLeaf (OPT_Node x, BOOLEAN dynArrToo); +export void OPB_CheckParameters (OPT_Object fp, OPT_Object ap, BOOLEAN checkNames); +static void OPB_CheckProc (OPT_Struct x, OPT_Object y); +static void OPB_CheckPtr (OPT_Node x, OPT_Node y); +static void OPB_CheckRealType (INTEGER f, INTEGER nr, OPT_Const x); +static void OPB_CheckReceiver (OPT_Node *x, OPT_Object fp); +static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y); +export void OPB_Construct (SHORTINT class, OPT_Node *x, OPT_Node y); +static void OPB_Convert (OPT_Node *x, OPT_Struct typ); +export void OPB_DeRef (OPT_Node *x); +static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpar); +export OPT_Node OPB_EmptySet (void); +export void OPB_Enter (OPT_Node *procdec, OPT_Node stat, OPT_Object proc); +export void OPB_Field (OPT_Node *x, OPT_Object y); +export void OPB_In (OPT_Node *x, OPT_Node y); +export void OPB_Index (OPT_Node *x, OPT_Node y); +export void OPB_Inittd (OPT_Node *inittd, OPT_Node *last, OPT_Struct typ); +static BOOLEAN OPB_IntToBool (LONGINT i); +export void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y); +export void OPB_MOp (SHORTINT op, OPT_Node *x); +export OPT_Node OPB_NewBoolConst (BOOLEAN boolval); +export OPT_Node OPB_NewIntConst (LONGINT intval); +export OPT_Node OPB_NewLeaf (OPT_Object obj); +export OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ); +export OPT_Node OPB_NewString (OPS_String str, LONGINT len); +export OPT_Node OPB_Nil (void); +static BOOLEAN OPB_NotVar (OPT_Node x); +export void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y); +export void OPB_OptIf (OPT_Node *x); +export void OPB_Param (OPT_Node ap, OPT_Object fp); +export void OPB_PrepCall (OPT_Node *x, OPT_Object *fpar); +export void OPB_Return (OPT_Node *x, OPT_Object proc); +export void OPB_SetElem (OPT_Node *x); +static void OPB_SetIntType (OPT_Node node); +export void OPB_SetRange (OPT_Node *x, OPT_Node y); +export void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno); +export void OPB_StPar0 (OPT_Node *par0, INTEGER fctno); +export void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno); +export void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n); +export void OPB_StaticLink (SHORTINT dlev); +export void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard); +static void OPB_err (INTEGER n); +static LONGINT OPB_log (LONGINT x); + + +static void OPB_err (INTEGER n) +{ + OPM_err(n); +} + +OPT_Node OPB_NewLeaf (OPT_Object obj) +{ + OPT_Node _o_result; + OPT_Node node = NIL; + switch (obj->mode) { + case 1: + node = OPT_NewNode(0); + node->readonly = (obj->vis == 2 && obj->mnolev < 0); + break; + case 2: + node = OPT_NewNode(1); + break; + case 3: + node = OPT_NewNode(7); + node->conval = OPT_NewConst(); + __GUARDEQP(node->conval, OPT_ConstDesc) = *obj->conval; + break; + case 5: + node = OPT_NewNode(8); + break; + case 6: case 7: case 8: case 9: case 10: + node = OPT_NewNode(9); + break; + default: + OPB_err(127); + node = OPT_NewNode(0); + break; + } + node->obj = obj; + node->typ = obj->typ; + _o_result = node; + return _o_result; +} + +void OPB_Construct (SHORTINT class, OPT_Node *x, OPT_Node y) +{ + OPT_Node node = NIL; + node = OPT_NewNode(class); + node->typ = OPT_notyp; + node->left = *x; + node->right = y; + *x = node; +} + +void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y) +{ + if (*x == NIL) { + *x = y; + } else { + (*last)->link = y; + } + while (y->link != NIL) { + y = y->link; + } + *last = y; +} + +static LONGINT OPB_BoolToInt (BOOLEAN b) +{ + LONGINT _o_result; + if (b) { + _o_result = 1; + return _o_result; + } else { + _o_result = 0; + return _o_result; + } + __RETCHK; +} + +static BOOLEAN OPB_IntToBool (LONGINT i) +{ + BOOLEAN _o_result; + if (i == 0) { + _o_result = 0; + return _o_result; + } else { + _o_result = 1; + return _o_result; + } + __RETCHK; +} + +OPT_Node OPB_NewBoolConst (BOOLEAN boolval) +{ + OPT_Node _o_result; + OPT_Node x = NIL; + x = OPT_NewNode(7); + x->typ = OPT_booltyp; + x->conval = OPT_NewConst(); + x->conval->intval = OPB_BoolToInt(boolval); + _o_result = x; + return _o_result; +} + +void OPB_OptIf (OPT_Node *x) +{ + OPT_Node if_ = NIL, pred = NIL; + if_ = (*x)->left; + while (if_->left->class == 7) { + if (OPB_IntToBool(if_->left->conval->intval)) { + *x = if_->right; + return; + } else if (if_->link == NIL) { + *x = (*x)->right; + return; + } else { + if_ = if_->link; + (*x)->left = if_; + } + } + pred = if_; + if_ = if_->link; + while (if_ != NIL) { + if (if_->left->class == 7) { + if (OPB_IntToBool(if_->left->conval->intval)) { + pred->link = NIL; + (*x)->right = if_->right; + return; + } else { + if_ = if_->link; + pred->link = if_; + } + } else { + pred = if_; + if_ = if_->link; + } + } +} + +OPT_Node OPB_Nil (void) +{ + OPT_Node _o_result; + OPT_Node x = NIL; + x = OPT_NewNode(7); + x->typ = OPT_niltyp; + x->conval = OPT_NewConst(); + x->conval->intval = 0; + _o_result = x; + return _o_result; +} + +OPT_Node OPB_EmptySet (void) +{ + OPT_Node _o_result; + OPT_Node x = NIL; + x = OPT_NewNode(7); + x->typ = OPT_settyp; + x->conval = OPT_NewConst(); + x->conval->setval = 0x0; + _o_result = x; + return _o_result; +} + +static void OPB_SetIntType (OPT_Node node) +{ + LONGINT v; + v = node->conval->intval; + if ((OPM_MinSInt <= (LONGINT)v && (LONGINT)v <= OPM_MaxSInt)) { + node->typ = OPT_sinttyp; + } else if ((OPM_MinInt <= (LONGINT)v && (LONGINT)v <= OPM_MaxInt)) { + node->typ = OPT_inttyp; + } else if ((OPM_MinLInt <= v && v <= OPM_MaxLInt)) { + node->typ = OPT_linttyp; + } else { + OPB_err(203); + node->typ = OPT_sinttyp; + node->conval->intval = 1; + } +} + +OPT_Node OPB_NewIntConst (LONGINT intval) +{ + OPT_Node _o_result; + OPT_Node x = NIL; + x = OPT_NewNode(7); + x->conval = OPT_NewConst(); + x->conval->intval = intval; + OPB_SetIntType(x); + _o_result = x; + return _o_result; +} + +OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ) +{ + OPT_Node _o_result; + OPT_Node x = NIL; + x = OPT_NewNode(7); + x->conval = OPT_NewConst(); + x->conval->realval = realval; + x->typ = typ; + x->conval->intval = -1; + _o_result = x; + return _o_result; +} + +OPT_Node OPB_NewString (OPS_String str, LONGINT len) +{ + OPT_Node _o_result; + OPT_Node x = NIL; + x = OPT_NewNode(7); + x->conval = OPT_NewConst(); + x->typ = OPT_stringtyp; + x->conval->intval = -1; + x->conval->intval2 = len; + x->conval->ext = OPT_NewExt(); + __COPY(str, *x->conval->ext, ((LONGINT)(256))); + _o_result = x; + return _o_result; +} + +static void OPB_CharToString (OPT_Node n) +{ + CHAR ch; + n->typ = OPT_stringtyp; + ch = (CHAR)n->conval->intval; + n->conval->ext = OPT_NewExt(); + if (ch == 0x00) { + n->conval->intval2 = 1; + } else { + n->conval->intval2 = 2; + (*n->conval->ext)[1] = 0x00; + } + (*n->conval->ext)[0] = ch; + n->conval->intval = -1; + n->obj = NIL; +} + +static void OPB_BindNodes (SHORTINT class, OPT_Struct typ, OPT_Node *x, OPT_Node y) +{ + OPT_Node node = NIL; + node = OPT_NewNode(class); + node->typ = typ; + node->left = *x; + node->right = y; + *x = node; +} + +static BOOLEAN OPB_NotVar (OPT_Node x) +{ + BOOLEAN _o_result; + _o_result = (x->class >= 7 && ((x->class != 11 || x->subcl != 29) || x->left->class >= 7)); + return _o_result; +} + +void OPB_DeRef (OPT_Node *x) +{ + OPT_Object strobj = NIL, bstrobj = NIL; + OPT_Struct typ = NIL, btyp = NIL; + typ = (*x)->typ; + if ((*x)->class >= 7) { + OPB_err(78); + } else if (typ->form == 13) { + if (typ == OPT_sysptrtyp) { + OPB_err(57); + } + btyp = typ->BaseTyp; + strobj = typ->strobj; + bstrobj = btyp->strobj; + if ((((((strobj != NIL && strobj->name[0] != 0x00)) && bstrobj != NIL)) && bstrobj->name[0] != 0x00)) { + btyp->pbused = 1; + } + OPB_BindNodes(3, btyp, &*x, NIL); + } else { + OPB_err(84); + } +} + +void OPB_Index (OPT_Node *x, OPT_Node y) +{ + INTEGER f; + OPT_Struct typ = NIL; + f = y->typ->form; + if ((*x)->class >= 7) { + OPB_err(79); + } else if (!__IN(f, 0x70) || __IN(y->class, 0x0300)) { + OPB_err(80); + y->typ = OPT_inttyp; + } + if ((*x)->typ->comp == 2) { + typ = (*x)->typ->BaseTyp; + if ((y->class == 7 && (y->conval->intval < 0 || y->conval->intval >= (*x)->typ->n))) { + OPB_err(81); + } + } else if ((*x)->typ->comp == 3) { + typ = (*x)->typ->BaseTyp; + if ((y->class == 7 && y->conval->intval < 0)) { + OPB_err(81); + } + } else { + OPB_err(82); + typ = OPT_undftyp; + } + OPB_BindNodes(4, typ, &*x, y); + (*x)->readonly = (*x)->left->readonly; +} + +void OPB_Field (OPT_Node *x, OPT_Object y) +{ + if ((*x)->class >= 7) { + OPB_err(77); + } + if ((y != NIL && __IN(y->mode, 0x2010))) { + OPB_BindNodes(2, y->typ, &*x, NIL); + (*x)->obj = y; + (*x)->readonly = (*x)->left->readonly || (y->vis == 2 && y->mnolev < 0); + } else { + OPB_err(83); + (*x)->typ = OPT_undftyp; + } +} + +static struct TypTest__57 { + OPT_Node *x; + OPT_Object *obj; + BOOLEAN *guard; + struct TypTest__57 *lnk; +} *TypTest__57_s; + +static void GTT__58 (OPT_Struct t0, OPT_Struct t1); + +static void GTT__58 (OPT_Struct t0, OPT_Struct t1) +{ + OPT_Node node = NIL; + OPT_Struct t = NIL; + t = t0; + while ((((t != NIL && t != t1)) && t != OPT_undftyp)) { + t = t->BaseTyp; + } + if (t != t1) { + while ((((t1 != NIL && t1 != t0)) && t1 != OPT_undftyp)) { + t1 = t1->BaseTyp; + } + if (t1 == t0 || t0->form == 0) { + if (*TypTest__57_s->guard) { + OPB_BindNodes(5, NIL, &*TypTest__57_s->x, NIL); + (*TypTest__57_s->x)->readonly = (*TypTest__57_s->x)->left->readonly; + } else { + node = OPT_NewNode(11); + node->subcl = 16; + node->left = *TypTest__57_s->x; + node->obj = *TypTest__57_s->obj; + *TypTest__57_s->x = node; + } + } else { + OPB_err(85); + } + } else if (t0 != t1) { + OPB_err(85); + } else if (!*TypTest__57_s->guard) { + if ((*TypTest__57_s->x)->class == 5) { + node = OPT_NewNode(11); + node->subcl = 16; + node->left = *TypTest__57_s->x; + node->obj = *TypTest__57_s->obj; + *TypTest__57_s->x = node; + } else { + *TypTest__57_s->x = OPB_NewBoolConst(1); + } + } +} + +void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) +{ + struct TypTest__57 _s; + _s.x = x; + _s.obj = &obj; + _s.guard = &guard; + _s.lnk = TypTest__57_s; + TypTest__57_s = &_s; + if (OPB_NotVar(*x)) { + OPB_err(112); + } else if ((*x)->typ->form == 13) { + if (((*x)->typ->BaseTyp->comp != 4 && (*x)->typ != OPT_sysptrtyp)) { + OPB_err(85); + } else if (obj->typ->form == 13) { + GTT__58((*x)->typ->BaseTyp, obj->typ->BaseTyp); + } else { + OPB_err(86); + } + } else if (((((*x)->typ->comp == 4 && (*x)->class == 1)) && obj->typ->comp == 4)) { + GTT__58((*x)->typ, obj->typ); + } else { + OPB_err(87); + } + if (guard) { + (*x)->typ = obj->typ; + } else { + (*x)->typ = OPT_booltyp; + } + TypTest__57_s = _s.lnk; +} + +void OPB_In (OPT_Node *x, OPT_Node y) +{ + INTEGER f; + LONGINT k; + f = (*x)->typ->form; + if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { + OPB_err(126); + } else if ((__IN(f, 0x70) && y->typ->form == 9)) { + if ((*x)->class == 7) { + k = (*x)->conval->intval; + if (k < 0 || k > (LONGINT)OPM_MaxSet) { + OPB_err(202); + } else if (y->class == 7) { + (*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval)); + (*x)->obj = NIL; + } else { + OPB_BindNodes(12, OPT_booltyp, &*x, y); + (*x)->subcl = 15; + } + } else { + OPB_BindNodes(12, OPT_booltyp, &*x, y); + (*x)->subcl = 15; + } + } else { + OPB_err(92); + } + (*x)->typ = OPT_booltyp; +} + +static LONGINT OPB_log (LONGINT x) +{ + LONGINT _o_result; + OPB_exp = 0; + if (x > 0) { + while (!__ODD(x)) { + x = __ASHR(x, 1); + OPB_exp += 1; + } + } + _o_result = x; + return _o_result; +} + +static void OPB_CheckRealType (INTEGER f, INTEGER nr, OPT_Const x) +{ + LONGREAL min, max, r; + if (f == 7) { + min = OPM_MinReal; + max = OPM_MaxReal; + } else { + min = OPM_MinLReal; + max = OPM_MaxLReal; + } + r = __ABS(x->realval); + if (r > max || r < min) { + OPB_err(nr); + x->realval = (LONGREAL)1; + } else if (f == 7) { + x->realval = x->realval; + } + x->intval = -1; +} + +static struct MOp__28 { + struct MOp__28 *lnk; +} *MOp__28_s; + +static OPT_Node NewOp__29 (SHORTINT op, OPT_Struct typ, OPT_Node z); + +static OPT_Node NewOp__29 (SHORTINT op, OPT_Struct typ, OPT_Node z) +{ + OPT_Node _o_result; + OPT_Node node = NIL; + node = OPT_NewNode(11); + node->subcl = op; + node->typ = typ; + node->left = z; + _o_result = node; + return _o_result; +} + +void OPB_MOp (SHORTINT op, OPT_Node *x) +{ + INTEGER f; + OPT_Struct typ = NIL; + OPT_Node z = NIL; + struct MOp__28 _s; + _s.lnk = MOp__28_s; + MOp__28_s = &_s; + z = *x; + if (z->class == 8 || z->class == 9) { + OPB_err(126); + } else { + typ = z->typ; + f = typ->form; + switch (op) { + case 33: + if (f == 2) { + if (z->class == 7) { + z->conval->intval = OPB_BoolToInt(!OPB_IntToBool(z->conval->intval)); + z->obj = NIL; + } else { + z = NewOp__29(op, typ, z); + } + } else { + OPB_err(98); + } + break; + case 6: + if (!__IN(f, 0x01f0)) { + OPB_err(96); + } + break; + case 7: + if (__IN(f, 0x03f0)) { + if (z->class == 7) { + if (__IN(f, 0x70)) { + if (z->conval->intval == (-9223372036854775807-1)) { + OPB_err(203); + } else { + z->conval->intval = -z->conval->intval; + OPB_SetIntType(z); + } + } else if (__IN(f, 0x0180)) { + z->conval->realval = -z->conval->realval; + } else { + z->conval->setval = ~z->conval->setval; + } + z->obj = NIL; + } else { + z = NewOp__29(op, typ, z); + } + } else { + OPB_err(97); + } + break; + case 21: + if (__IN(f, 0x01f0)) { + if (z->class == 7) { + if (__IN(f, 0x70)) { + if (z->conval->intval == (-9223372036854775807-1)) { + OPB_err(203); + } else { + z->conval->intval = __ABS(z->conval->intval); + OPB_SetIntType(z); + } + } else { + z->conval->realval = __ABS(z->conval->realval); + } + z->obj = NIL; + } else { + z = NewOp__29(op, typ, z); + } + } else { + OPB_err(111); + } + break; + case 22: + if (f == 3) { + if (z->class == 7) { + z->conval->intval = (int)__CAP((CHAR)z->conval->intval); + z->obj = NIL; + } else { + z = NewOp__29(op, typ, z); + } + } else { + OPB_err(111); + z->typ = OPT_chartyp; + } + break; + case 23: + if (__IN(f, 0x70)) { + if (z->class == 7) { + z->conval->intval = OPB_BoolToInt(__ODD(z->conval->intval)); + z->obj = NIL; + } else { + z = NewOp__29(op, typ, z); + } + } else { + OPB_err(111); + } + z->typ = OPT_booltyp; + break; + case 24: + if ((((z->class == 7 && f == 3)) && z->conval->intval >= 32)) { + OPB_CharToString(z); + f = 10; + } + if (z->class < 7 || f == 10) { + z = NewOp__29(op, typ, z); + } else { + OPB_err(127); + } + z->typ = OPT_linttyp; + break; + case 25: + if ((__IN(f, 0x70) && z->class == 7)) { + if ((0 <= z->conval->intval && z->conval->intval <= -1)) { + z = NewOp__29(op, typ, z); + } else { + OPB_err(219); + } + } else { + OPB_err(69); + } + z->typ = OPT_booltyp; + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPB.MOp, op = ", (LONGINT)33); + OPM_LogWNum(op, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + } + *x = z; + MOp__28_s = _s.lnk; +} + +static void OPB_CheckPtr (OPT_Node x, OPT_Node y) +{ + INTEGER g; + OPT_Struct p = NIL, q = NIL, t = NIL; + g = y->typ->form; + if (g == 13) { + p = x->typ->BaseTyp; + q = y->typ->BaseTyp; + if ((p->comp == 4 && q->comp == 4)) { + if (p->extlev < q->extlev) { + t = p; + p = q; + q = t; + } + while ((((p != q && p != NIL)) && p != OPT_undftyp)) { + p = p->BaseTyp; + } + if (p == NIL) { + OPB_err(100); + } + } else { + OPB_err(100); + } + } else if (g != 11) { + OPB_err(100); + } +} + +void OPB_CheckParameters (OPT_Object fp, OPT_Object ap, BOOLEAN checkNames) +{ + OPT_Struct ft = NIL, at = NIL; + while (fp != NIL) { + if (ap != NIL) { + ft = fp->typ; + at = ap->typ; + while ((ft->comp == 3 && at->comp == 3)) { + ft = ft->BaseTyp; + at = at->BaseTyp; + } + if (ft != at) { + if ((ft->form == 14 && at->form == 14)) { + if (ft->BaseTyp == at->BaseTyp) { + OPB_CheckParameters(ft->link, at->link, 0); + } else { + OPB_err(117); + } + } else { + OPB_err(115); + } + } + if (fp->mode != ap->mode || (checkNames && __STRCMP(fp->name, ap->name) != 0)) { + OPB_err(115); + } + ap = ap->link; + } else { + OPB_err(116); + } + fp = fp->link; + } + if (ap != NIL) { + OPB_err(116); + } +} + +static void OPB_CheckProc (OPT_Struct x, OPT_Object y) +{ + if (__IN(y->mode, 0x04c0)) { + if (y->mode == 6) { + if (y->mnolev == 0) { + y->mode = 7; + } else { + OPB_err(73); + } + } + if (x->BaseTyp == y->typ) { + OPB_CheckParameters(x->link, y->link, 0); + } else { + OPB_err(117); + } + } else { + OPB_err(113); + } +} + +static struct ConstOp__13 { + OPT_Node *x; + INTEGER *f; + OPT_Const *xval, *yval; + struct ConstOp__13 *lnk; +} *ConstOp__13_s; + +static INTEGER ConstCmp__14 (void); + +static INTEGER ConstCmp__14 (void) +{ + INTEGER _o_result; + INTEGER res; + switch (*ConstOp__13_s->f) { + case 0: + res = 9; + break; + case 1: case 3: case 4: case 5: case 6: + if ((*ConstOp__13_s->xval)->intval < (*ConstOp__13_s->yval)->intval) { + res = 11; + } else if ((*ConstOp__13_s->xval)->intval > (*ConstOp__13_s->yval)->intval) { + res = 13; + } else { + res = 9; + } + break; + case 7: case 8: + if ((*ConstOp__13_s->xval)->realval < (*ConstOp__13_s->yval)->realval) { + res = 11; + } else if ((*ConstOp__13_s->xval)->realval > (*ConstOp__13_s->yval)->realval) { + res = 13; + } else { + res = 9; + } + break; + case 2: + if ((*ConstOp__13_s->xval)->intval != (*ConstOp__13_s->yval)->intval) { + res = 10; + } else { + res = 9; + } + break; + case 9: + if ((*ConstOp__13_s->xval)->setval != (*ConstOp__13_s->yval)->setval) { + res = 10; + } else { + res = 9; + } + break; + case 10: + if (__STRCMP(*(*ConstOp__13_s->xval)->ext, *(*ConstOp__13_s->yval)->ext) < 0) { + res = 11; + } else if (__STRCMP(*(*ConstOp__13_s->xval)->ext, *(*ConstOp__13_s->yval)->ext) > 0) { + res = 13; + } else { + res = 9; + } + break; + case 11: case 13: case 14: + if ((*ConstOp__13_s->xval)->intval != (*ConstOp__13_s->yval)->intval) { + res = 10; + } else { + res = 9; + } + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPB.ConstCmp, f = ", (LONGINT)37); + OPM_LogWNum(*ConstOp__13_s->f, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + (*ConstOp__13_s->x)->typ = OPT_booltyp; + _o_result = res; + return _o_result; +} + +static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) +{ + INTEGER f, g; + OPT_Const xval = NIL, yval = NIL; + LONGINT xv, yv; + BOOLEAN temp; + struct ConstOp__13 _s; + _s.x = &x; + _s.f = &f; + _s.xval = &xval; + _s.yval = &yval; + _s.lnk = ConstOp__13_s; + ConstOp__13_s = &_s; + f = x->typ->form; + g = y->typ->form; + xval = x->conval; + yval = y->conval; + if (f != g) { + switch (f) { + case 3: + if (g == 10) { + OPB_CharToString(x); + } else { + OPB_err(100); + y->typ = x->typ; + __GUARDEQP(yval, OPT_ConstDesc) = *xval; + } + break; + case 4: + if (__IN(g, 0x70)) { + x->typ = y->typ; + } else if (g == 7) { + x->typ = OPT_realtyp; + xval->realval = xval->intval; + } else if (g == 8) { + x->typ = OPT_lrltyp; + xval->realval = xval->intval; + } else { + OPB_err(100); + y->typ = x->typ; + __GUARDEQP(yval, OPT_ConstDesc) = *xval; + } + break; + case 5: + if (g == 4) { + y->typ = OPT_inttyp; + } else if (__IN(g, 0x70)) { + x->typ = y->typ; + } else if (g == 7) { + x->typ = OPT_realtyp; + xval->realval = xval->intval; + } else if (g == 8) { + x->typ = OPT_lrltyp; + xval->realval = xval->intval; + } else { + OPB_err(100); + y->typ = x->typ; + __GUARDEQP(yval, OPT_ConstDesc) = *xval; + } + break; + case 6: + if (__IN(g, 0x70)) { + y->typ = OPT_linttyp; + } else if (g == 7) { + x->typ = OPT_realtyp; + xval->realval = xval->intval; + } else if (g == 8) { + x->typ = OPT_lrltyp; + xval->realval = xval->intval; + } else { + OPB_err(100); + y->typ = x->typ; + __GUARDEQP(yval, OPT_ConstDesc) = *xval; + } + break; + case 7: + if (__IN(g, 0x70)) { + y->typ = x->typ; + yval->realval = yval->intval; + } else if (g == 8) { + x->typ = OPT_lrltyp; + } else { + OPB_err(100); + y->typ = x->typ; + __GUARDEQP(yval, OPT_ConstDesc) = *xval; + } + break; + case 8: + if (__IN(g, 0x70)) { + y->typ = x->typ; + yval->realval = yval->intval; + } else if (g == 7) { + y->typ = OPT_lrltyp; + } else { + OPB_err(100); + y->typ = x->typ; + __GUARDEQP(yval, OPT_ConstDesc) = *xval; + } + break; + case 10: + if (g == 3) { + OPB_CharToString(y); + g = 10; + } else { + OPB_err(100); + y->typ = x->typ; + __GUARDEQP(yval, OPT_ConstDesc) = *xval; + } + break; + case 11: + if (!__IN(g, 0x6000)) { + OPB_err(100); + } + break; + case 13: + OPB_CheckPtr(x, y); + break; + case 14: + if (g != 11) { + OPB_err(100); + } + break; + default: + OPB_err(100); + y->typ = x->typ; + __GUARDEQP(yval, OPT_ConstDesc) = *xval; + break; + } + f = x->typ->form; + } + switch (op) { + case 1: + if (__IN(f, 0x70)) { + xv = xval->intval; + yv = yval->intval; + if (((((xv == 0 || yv == 0) || (((xv > 0 && yv > 0)) && yv <= __DIV(9223372036854775807, xv))) || (((xv > 0 && yv < 0)) && yv >= __DIV((-9223372036854775807-1), xv))) || (((xv < 0 && yv > 0)) && xv >= __DIV((-9223372036854775807-1), yv))) || (((((((xv < 0 && yv < 0)) && xv != (-9223372036854775807-1))) && yv != (-9223372036854775807-1))) && -xv <= __DIV(9223372036854775807, -yv))) { + xval->intval = xv * yv; + OPB_SetIntType(x); + } else { + OPB_err(204); + } + } else if (__IN(f, 0x0180)) { + temp = __ABS(yval->realval) <= (LONGREAL)1; + if (temp || __ABS(xval->realval) <= 1.79769296342094e+308 / (LONGREAL)__ABS(yval->realval)) { + xval->realval = xval->realval * yval->realval; + OPB_CheckRealType(f, 204, xval); + } else { + OPB_err(204); + } + } else if (f == 9) { + xval->setval = (xval->setval & yval->setval); + } else if (f != 0) { + OPB_err(101); + } + break; + case 2: + if (__IN(f, 0x70)) { + if (yval->intval != 0) { + xval->realval = xval->intval / (REAL)yval->intval; + OPB_CheckRealType(7, 205, xval); + } else { + OPB_err(205); + xval->realval = (LONGREAL)1; + } + x->typ = OPT_realtyp; + } else if (__IN(f, 0x0180)) { + temp = __ABS(yval->realval) >= (LONGREAL)1; + if (temp || __ABS(xval->realval) <= 1.79769296342094e+308 * __ABS(yval->realval)) { + xval->realval = xval->realval / yval->realval; + OPB_CheckRealType(f, 205, xval); + } else { + OPB_err(205); + } + } else if (f == 9) { + xval->setval = xval->setval ^ yval->setval; + } else if (f != 0) { + OPB_err(102); + } + break; + case 3: + if (__IN(f, 0x70)) { + if (yval->intval != 0) { + xval->intval = __DIV(xval->intval, yval->intval); + OPB_SetIntType(x); + } else { + OPB_err(205); + } + } else if (f != 0) { + OPB_err(103); + } + break; + case 4: + if (__IN(f, 0x70)) { + if (yval->intval != 0) { + xval->intval = __MOD(xval->intval, yval->intval); + OPB_SetIntType(x); + } else { + OPB_err(205); + } + } else if (f != 0) { + OPB_err(104); + } + break; + case 5: + if (f == 2) { + xval->intval = OPB_BoolToInt((OPB_IntToBool(xval->intval) && OPB_IntToBool(yval->intval))); + } else { + OPB_err(94); + } + break; + case 6: + if (__IN(f, 0x70)) { + temp = (yval->intval >= 0 && xval->intval <= 9223372036854775807 - yval->intval); + if (temp || (yval->intval < 0 && xval->intval >= (-9223372036854775807-1) - yval->intval)) { + xval->intval += yval->intval; + OPB_SetIntType(x); + } else { + OPB_err(206); + } + } else if (__IN(f, 0x0180)) { + temp = (yval->realval >= (LONGREAL)0 && xval->realval <= 1.79769296342094e+308 - yval->realval); + if (temp || (yval->realval < (LONGREAL)0 && xval->realval >= -1.79769296342094e+308 - yval->realval)) { + xval->realval = xval->realval + yval->realval; + OPB_CheckRealType(f, 206, xval); + } else { + OPB_err(206); + } + } else if (f == 9) { + xval->setval = xval->setval | yval->setval; + } else if (f != 0) { + OPB_err(105); + } + break; + case 7: + if (__IN(f, 0x70)) { + if ((yval->intval >= 0 && xval->intval >= (-9223372036854775807-1) + yval->intval) || (yval->intval < 0 && xval->intval <= 9223372036854775807 + yval->intval)) { + xval->intval -= yval->intval; + OPB_SetIntType(x); + } else { + OPB_err(207); + } + } else if (__IN(f, 0x0180)) { + temp = (yval->realval >= (LONGREAL)0 && xval->realval >= -1.79769296342094e+308 + yval->realval); + if (temp || (yval->realval < (LONGREAL)0 && xval->realval <= 1.79769296342094e+308 + yval->realval)) { + xval->realval = xval->realval - yval->realval; + OPB_CheckRealType(f, 207, xval); + } else { + OPB_err(207); + } + } else if (f == 9) { + xval->setval = (xval->setval & ~yval->setval); + } else if (f != 0) { + OPB_err(106); + } + break; + case 8: + if (f == 2) { + xval->intval = OPB_BoolToInt(OPB_IntToBool(xval->intval) || OPB_IntToBool(yval->intval)); + } else { + OPB_err(95); + } + break; + case 9: + xval->intval = OPB_BoolToInt(ConstCmp__14() == 9); + break; + case 10: + xval->intval = OPB_BoolToInt(ConstCmp__14() != 9); + break; + case 11: + if (__IN(f, 0x2a04)) { + OPB_err(108); + } else { + xval->intval = OPB_BoolToInt(ConstCmp__14() == 11); + } + break; + case 12: + if (__IN(f, 0x2a04)) { + OPB_err(108); + } else { + xval->intval = OPB_BoolToInt(ConstCmp__14() != 13); + } + break; + case 13: + if (__IN(f, 0x2a04)) { + OPB_err(108); + } else { + xval->intval = OPB_BoolToInt(ConstCmp__14() == 13); + } + break; + case 14: + if (__IN(f, 0x2a04)) { + OPB_err(108); + } else { + xval->intval = OPB_BoolToInt(ConstCmp__14() != 11); + } + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPB.ConstOp, op = ", (LONGINT)37); + OPM_LogWNum(op, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + ConstOp__13_s = _s.lnk; +} + +static void OPB_Convert (OPT_Node *x, OPT_Struct typ) +{ + OPT_Node node = NIL; + INTEGER f, g; + LONGINT k; + LONGREAL r; + f = (*x)->typ->form; + g = typ->form; + if ((*x)->class == 7) { + if (__IN(f, 0x70)) { + if (__IN(g, 0x70)) { + if (f > g) { + OPB_SetIntType(*x); + if ((int)(*x)->typ->form > g) { + OPB_err(203); + (*x)->conval->intval = 1; + } + } + } else if (__IN(g, 0x0180)) { + (*x)->conval->realval = (*x)->conval->intval; + (*x)->conval->intval = -1; + } else { + k = (*x)->conval->intval; + if (0 > k || k > 255) { + OPB_err(220); + } + } + } else if (__IN(f, 0x0180)) { + if (__IN(g, 0x0180)) { + OPB_CheckRealType(g, 203, (*x)->conval); + } else { + r = (*x)->conval->realval; + if (r < -9.22337203685478e+018 || r > 9.22337203685478e+018) { + OPB_err(203); + r = (LONGREAL)1; + } + (*x)->conval->intval = __ENTIER(r); + OPB_SetIntType(*x); + } + } + (*x)->obj = NIL; + } else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((int)(*x)->left->typ->form < f || f > g))) { + if ((*x)->left->typ == typ) { + *x = (*x)->left; + } + } else { + node = OPT_NewNode(11); + node->subcl = 20; + node->left = *x; + *x = node; + } + (*x)->typ = typ; +} + +static struct Op__38 { + INTEGER *f, *g; + struct Op__38 *lnk; +} *Op__38_s; + +static void NewOp__39 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y); +static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y); + +static void NewOp__39 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y) +{ + OPT_Node node = NIL; + node = OPT_NewNode(12); + node->subcl = op; + node->typ = typ; + node->left = *x; + node->right = y; + *x = node; +} + +static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) +{ + BOOLEAN _o_result; + BOOLEAN ok, xCharArr, yCharArr; + xCharArr = (__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp->form == 3) || *Op__38_s->f == 10; + yCharArr = (__IN((*y)->typ->comp, 0x0c) && (*y)->typ->BaseTyp->form == 3) || *Op__38_s->g == 10; + if ((((xCharArr && *Op__38_s->g == 3)) && (*y)->class == 7)) { + OPB_CharToString(*y); + *Op__38_s->g = 10; + yCharArr = 1; + } + if ((((yCharArr && *Op__38_s->f == 3)) && (*x)->class == 7)) { + OPB_CharToString(*x); + *Op__38_s->f = 10; + xCharArr = 1; + } + ok = (xCharArr && yCharArr); + if (ok) { + if ((*Op__38_s->f == 10 && (*x)->conval->intval2 == 1)) { + (*x)->typ = OPT_chartyp; + (*x)->conval->intval = 0; + OPB_Index(&*y, OPB_NewIntConst(((LONGINT)(0)))); + } else if ((*Op__38_s->g == 10 && (*y)->conval->intval2 == 1)) { + (*y)->typ = OPT_chartyp; + (*y)->conval->intval = 0; + OPB_Index(&*x, OPB_NewIntConst(((LONGINT)(0)))); + } + } + _o_result = ok; + return _o_result; +} + +void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) +{ + INTEGER f, g; + OPT_Node t = NIL, z = NIL; + OPT_Struct typ = NIL; + BOOLEAN do_; + LONGINT val; + struct Op__38 _s; + _s.f = &f; + _s.g = &g; + _s.lnk = Op__38_s; + Op__38_s = &_s; + z = *x; + if (((z->class == 8 || z->class == 9) || y->class == 8) || y->class == 9) { + OPB_err(126); + } else if ((z->class == 7 && y->class == 7)) { + OPB_ConstOp(op, z, y); + z->obj = NIL; + } else { + if (z->typ != y->typ) { + g = y->typ->form; + switch (z->typ->form) { + case 3: + if (z->class == 7) { + OPB_CharToString(z); + } else { + OPB_err(100); + } + break; + case 4: + if (__IN(g, 0x01f0)) { + OPB_Convert(&z, y->typ); + } else { + OPB_err(100); + } + break; + case 5: + if (g == 4) { + OPB_Convert(&y, z->typ); + } else if (__IN(g, 0x01f0)) { + OPB_Convert(&z, y->typ); + } else { + OPB_err(100); + } + break; + case 6: + if (__IN(g, 0x70)) { + OPB_Convert(&y, z->typ); + } else if (__IN(g, 0x0180)) { + OPB_Convert(&z, y->typ); + } else { + OPB_err(100); + } + break; + case 7: + if (__IN(g, 0x70)) { + OPB_Convert(&y, z->typ); + } else if (__IN(g, 0x0180)) { + OPB_Convert(&z, y->typ); + } else { + OPB_err(100); + } + break; + case 8: + if (__IN(g, 0x01f0)) { + OPB_Convert(&y, z->typ); + } else if (__IN(g, 0x0180)) { + OPB_Convert(&y, z->typ); + } else { + OPB_err(100); + } + break; + case 11: + if (!__IN(g, 0x6000)) { + OPB_err(100); + } + break; + case 13: + OPB_CheckPtr(z, y); + break; + case 14: + if (g != 11) { + OPB_err(100); + } + break; + case 10: + break; + case 15: + if (z->typ->comp == 4) { + OPB_err(100); + } + break; + default: + OPB_err(100); + break; + } + } + typ = z->typ; + f = typ->form; + g = y->typ->form; + switch (op) { + case 1: + do_ = 1; + if (__IN(f, 0x70)) { + if (z->class == 7) { + val = z->conval->intval; + if (val == 1) { + do_ = 0; + z = y; + } else if (val == 0) { + do_ = 0; + } else if (OPB_log(val) == 1) { + t = y; + y = z; + z = t; + op = 17; + y->typ = OPT_sinttyp; + y->conval->intval = OPB_exp; + y->obj = NIL; + } + } else if (y->class == 7) { + val = y->conval->intval; + if (val == 1) { + do_ = 0; + } else if (val == 0) { + do_ = 0; + z = y; + } else if (OPB_log(val) == 1) { + op = 17; + y->typ = OPT_sinttyp; + y->conval->intval = OPB_exp; + y->obj = NIL; + } + } + } else if (!__IN(f, 0x0381)) { + OPB_err(105); + typ = OPT_undftyp; + } + if (do_) { + NewOp__39(op, typ, &z, y); + } + break; + case 2: + if (__IN(f, 0x70)) { + if ((y->class == 7 && y->conval->intval == 0)) { + OPB_err(205); + } + OPB_Convert(&z, OPT_realtyp); + OPB_Convert(&y, OPT_realtyp); + typ = OPT_realtyp; + } else if (__IN(f, 0x0180)) { + if ((y->class == 7 && y->conval->realval == (LONGREAL)0)) { + OPB_err(205); + } + } else if ((f != 9 && f != 0)) { + OPB_err(102); + typ = OPT_undftyp; + } + NewOp__39(op, typ, &z, y); + break; + case 3: + do_ = 1; + if (__IN(f, 0x70)) { + if (y->class == 7) { + val = y->conval->intval; + if (val == 0) { + OPB_err(205); + } else if (val == 1) { + do_ = 0; + } else if (OPB_log(val) == 1) { + op = 17; + y->typ = OPT_sinttyp; + y->conval->intval = -OPB_exp; + y->obj = NIL; + } + } + } else if (f != 0) { + OPB_err(103); + typ = OPT_undftyp; + } + if (do_) { + NewOp__39(op, typ, &z, y); + } + break; + case 4: + if (__IN(f, 0x70)) { + if (y->class == 7) { + if (y->conval->intval == 0) { + OPB_err(205); + } else if (OPB_log(y->conval->intval) == 1) { + op = 18; + y->conval->intval = __ASH(-1, OPB_exp); + y->obj = NIL; + } + } + } else if (f != 0) { + OPB_err(104); + typ = OPT_undftyp; + } + NewOp__39(op, typ, &z, y); + break; + case 5: + if (f == 2) { + if (z->class == 7) { + if (OPB_IntToBool(z->conval->intval)) { + z = y; + } + } else if ((y->class == 7 && OPB_IntToBool(y->conval->intval))) { + } else { + NewOp__39(op, typ, &z, y); + } + } else if (f != 0) { + OPB_err(94); + z->typ = OPT_undftyp; + } + break; + case 6: + if (!__IN(f, 0x03f1)) { + OPB_err(105); + typ = OPT_undftyp; + } + do_ = 1; + if (__IN(f, 0x70)) { + if ((z->class == 7 && z->conval->intval == 0)) { + do_ = 0; + z = y; + } + if ((y->class == 7 && y->conval->intval == 0)) { + do_ = 0; + } + } + if (do_) { + NewOp__39(op, typ, &z, y); + } + break; + case 7: + if (!__IN(f, 0x03f1)) { + OPB_err(106); + typ = OPT_undftyp; + } + if ((!__IN(f, 0x70) || y->class != 7) || y->conval->intval != 0) { + NewOp__39(op, typ, &z, y); + } + break; + case 8: + if (f == 2) { + if (z->class == 7) { + if (!OPB_IntToBool(z->conval->intval)) { + z = y; + } + } else if ((y->class == 7 && !OPB_IntToBool(y->conval->intval))) { + } else { + NewOp__39(op, typ, &z, y); + } + } else if (f != 0) { + OPB_err(95); + z->typ = OPT_undftyp; + } + break; + case 9: case 10: + if (__IN(f, 0x6bff) || strings__41(&z, &y)) { + typ = OPT_booltyp; + } else { + OPB_err(107); + typ = OPT_undftyp; + } + NewOp__39(op, typ, &z, y); + break; + case 11: case 12: case 13: case 14: + if (__IN(f, 0x01f9) || strings__41(&z, &y)) { + typ = OPT_booltyp; + } else { + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"ELSE in Op()", (LONGINT)13); + OPM_LogWLn(); + OPB_err(108); + typ = OPT_undftyp; + } + NewOp__39(op, typ, &z, y); + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPB.Op, op = ", (LONGINT)32); + OPM_LogWNum(op, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + } + *x = z; + Op__38_s = _s.lnk; +} + +void OPB_SetRange (OPT_Node *x, OPT_Node y) +{ + LONGINT k, l; + if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { + OPB_err(126); + } else if ((__IN((*x)->typ->form, 0x70) && __IN(y->typ->form, 0x70))) { + if ((*x)->class == 7) { + k = (*x)->conval->intval; + if (0 > k || k > (LONGINT)OPM_MaxSet) { + OPB_err(202); + } + } + if (y->class == 7) { + l = y->conval->intval; + if (0 > l || l > (LONGINT)OPM_MaxSet) { + OPB_err(202); + } + } + if (((*x)->class == 7 && y->class == 7)) { + if (k <= l) { + (*x)->conval->setval = __SETRNG(k, l); + } else { + OPB_err(201); + (*x)->conval->setval = __SETRNG(l, k); + } + (*x)->obj = NIL; + } else { + OPB_BindNodes(10, OPT_settyp, &*x, y); + } + } else { + OPB_err(93); + } + (*x)->typ = OPT_settyp; +} + +void OPB_SetElem (OPT_Node *x) +{ + LONGINT k; + if ((*x)->class == 8 || (*x)->class == 9) { + OPB_err(126); + } else if (!__IN((*x)->typ->form, 0x70)) { + OPB_err(93); + } else if ((*x)->class == 7) { + k = (*x)->conval->intval; + if ((0 <= k && k <= (LONGINT)OPM_MaxSet)) { + (*x)->conval->setval = __SETOF(k); + } else { + OPB_err(202); + } + (*x)->obj = NIL; + } else { + OPB_Convert(&*x, OPT_settyp); + } + (*x)->typ = OPT_settyp; +} + +static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) +{ + INTEGER f, g; + OPT_Struct y = NIL, p = NIL, q = NIL; + if (OPM_Verbose) { + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"PROCEDURE CheckAssign", (LONGINT)22); + OPM_LogWLn(); + } + y = ynode->typ; + f = x->form; + g = y->form; + if (OPM_Verbose) { + OPM_LogWStr((CHAR*)"y.form = ", (LONGINT)10); + OPM_LogWNum(y->form, ((LONGINT)(0))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"f = ", (LONGINT)5); + OPM_LogWNum(f, ((LONGINT)(0))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"g = ", (LONGINT)5); + OPM_LogWNum(g, ((LONGINT)(0))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"ynode.typ.syze = ", (LONGINT)18); + OPM_LogWNum(ynode->typ->size, ((LONGINT)(0))); + OPM_LogWLn(); + } + if (ynode->class == 8 || (ynode->class == 9 && f != 14)) { + OPB_err(126); + } + switch (f) { + case 0: case 10: + break; + case 1: + if (!__IN(g, 0x1a)) { + OPB_err(113); + } + break; + case 2: case 3: case 4: case 9: + if (g != f) { + OPB_err(113); + } + break; + case 5: + if (!__IN(g, 0x30)) { + OPB_err(113); + } + break; + case 6: + if (OPM_LIntSize == 4) { + if (!__IN(g, 0x70)) { + OPB_err(113); + } + } else { + if (!__IN(g, 0x70)) { + OPB_err(113); + } + } + break; + case 7: + if (!__IN(g, 0xf0)) { + OPB_err(113); + } + break; + case 8: + if (!__IN(g, 0x01f0)) { + OPB_err(113); + } + break; + case 13: + if ((x == y || g == 11) || (x == OPT_sysptrtyp && g == 13)) { + } else if (g == 13) { + p = x->BaseTyp; + q = y->BaseTyp; + if ((p->comp == 4 && q->comp == 4)) { + while ((((q != p && q != NIL)) && q != OPT_undftyp)) { + q = q->BaseTyp; + } + if (q == NIL) { + OPB_err(113); + } + } else { + OPB_err(113); + } + } else { + OPB_err(113); + } + break; + case 14: + if (ynode->class == 9) { + OPB_CheckProc(x, ynode->obj); + } else if (x == y || g == 11) { + } else { + OPB_err(113); + } + break; + case 12: case 11: + OPB_err(113); + break; + case 15: + x->pvused = 1; + if (x->comp == 2) { + if ((ynode->class == 7 && g == 3)) { + OPB_CharToString(ynode); + y = ynode->typ; + g = 10; + } + if (x == y) { + } else if (x->BaseTyp == OPT_chartyp) { + if (g == 10) { + if (ynode->conval->intval2 > x->n) { + OPB_err(114); + } + } else if ((__IN(y->comp, 0x0c) && y->BaseTyp == OPT_chartyp)) { + } else { + OPB_err(113); + } + } else { + OPB_err(113); + } + } else if ((x->comp == 3 && x->BaseTyp == OPT_chartyp)) { + if ((__IN(y->comp, 0x0c) && y->BaseTyp == OPT_chartyp)) { + } else { + OPB_err(113); + } + } else if (x->comp == 4) { + if (x == y) { + } else if (y->comp == 4) { + q = y->BaseTyp; + while ((((q != NIL && q != x)) && q != OPT_undftyp)) { + q = q->BaseTyp; + } + if (q == NIL) { + OPB_err(113); + } + } else { + OPB_err(113); + } + } else { + OPB_err(113); + } + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPB.CheckAssign, f = ", (LONGINT)40); + OPM_LogWNum(f, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + if ((((((ynode->class == 7 && g < f)) && __IN(g, 0xf0))) && __IN(f, 0x01e0))) { + OPB_Convert(&ynode, x); + } +} + +static void OPB_CheckLeaf (OPT_Node x, BOOLEAN dynArrToo) +{ +} + +void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) +{ + INTEGER f; + OPT_Struct typ = NIL; + OPT_Node x = NIL; + x = *par0; + f = x->typ->form; + switch (fctno) { + case 0: + if ((__IN(f, 0x70) && x->class == 7)) { + if ((0 <= x->conval->intval && x->conval->intval <= 255)) { + OPB_BindNodes(28, OPT_notyp, &x, x); + } else { + OPB_err(218); + } + } else { + OPB_err(69); + } + x->typ = OPT_notyp; + break; + case 1: + typ = OPT_notyp; + if (OPB_NotVar(x)) { + OPB_err(112); + } else if (f == 13) { + if (x->readonly) { + OPB_err(76); + } + f = x->typ->BaseTyp->comp; + if (__IN(f, 0x1c)) { + if (f == 3) { + typ = x->typ->BaseTyp; + } + OPB_BindNodes(19, OPT_notyp, &x, NIL); + x->subcl = 1; + } else { + OPB_err(111); + } + } else { + OPB_err(111); + } + x->typ = typ; + break; + case 2: + OPB_MOp(21, &x); + break; + case 3: + OPB_MOp(22, &x); + break; + case 4: + if (x->class == 8 || x->class == 9) { + OPB_err(126); + } else if (f == 3) { + OPB_Convert(&x, OPT_inttyp); + } else { + OPB_err(111); + } + x->typ = OPT_inttyp; + break; + case 5: + if (x->class == 8 || x->class == 9) { + OPB_err(126); + } else if (__IN(f, 0x0180)) { + OPB_Convert(&x, OPT_linttyp); + } else { + OPB_err(111); + } + x->typ = OPT_linttyp; + break; + case 6: + OPB_MOp(23, &x); + break; + case 7: + if (x->class == 8) { + switch (f) { + case 2: + x = OPB_NewBoolConst(0); + break; + case 3: + x = OPB_NewIntConst(((LONGINT)(0))); + x->typ = OPT_chartyp; + break; + case 4: + x = OPB_NewIntConst(OPM_MinSInt); + break; + case 5: + x = OPB_NewIntConst(OPM_MinInt); + break; + case 6: + x = OPB_NewIntConst(OPM_MinLInt); + break; + case 9: + x = OPB_NewIntConst(((LONGINT)(0))); + x->typ = OPT_inttyp; + break; + case 7: + x = OPB_NewRealConst(OPM_MinReal, OPT_realtyp); + break; + case 8: + x = OPB_NewRealConst(OPM_MinLReal, OPT_lrltyp); + break; + default: + OPB_err(111); + break; + } + } else { + OPB_err(110); + } + break; + case 8: + if (x->class == 8) { + switch (f) { + case 2: + x = OPB_NewBoolConst(1); + break; + case 3: + x = OPB_NewIntConst(((LONGINT)(255))); + x->typ = OPT_chartyp; + break; + case 4: + x = OPB_NewIntConst(OPM_MaxSInt); + break; + case 5: + x = OPB_NewIntConst(OPM_MaxInt); + break; + case 6: + x = OPB_NewIntConst(OPM_MaxLInt); + break; + case 9: + x = OPB_NewIntConst(OPM_MaxSet); + x->typ = OPT_inttyp; + break; + case 7: + x = OPB_NewRealConst(OPM_MaxReal, OPT_realtyp); + break; + case 8: + x = OPB_NewRealConst(OPM_MaxLReal, OPT_lrltyp); + break; + default: + OPB_err(111); + break; + } + } else { + OPB_err(110); + } + break; + case 9: + if (x->class == 8 || x->class == 9) { + OPB_err(126); + } else if (__IN(f, 0x71)) { + OPB_Convert(&x, OPT_chartyp); + } else { + OPB_err(111); + x->typ = OPT_chartyp; + } + break; + case 10: + if (x->class == 8 || x->class == 9) { + OPB_err(126); + } else if (f == 5) { + OPB_Convert(&x, OPT_sinttyp); + } else if (f == 6) { + OPB_Convert(&x, OPT_inttyp); + } else if (f == 8) { + OPB_Convert(&x, OPT_realtyp); + } else { + OPB_err(111); + } + break; + case 11: + if (x->class == 8 || x->class == 9) { + OPB_err(126); + } else if (f == 4) { + OPB_Convert(&x, OPT_inttyp); + } else if (f == 5) { + OPB_Convert(&x, OPT_linttyp); + } else if (f == 7) { + OPB_Convert(&x, OPT_lrltyp); + } else if (f == 3) { + OPB_Convert(&x, OPT_linttyp); + } else { + OPB_err(111); + } + break; + case 13: case 14: + if (OPB_NotVar(x)) { + OPB_err(112); + } else if (!__IN(f, 0x70)) { + OPB_err(111); + } else if (x->readonly) { + OPB_err(76); + } + break; + case 15: case 16: + if (OPB_NotVar(x)) { + OPB_err(112); + } else if (x->typ != OPT_settyp) { + OPB_err(111); + x->typ = OPT_settyp; + } else if (x->readonly) { + OPB_err(76); + } + break; + case 17: + if (!__IN(x->typ->comp, 0x0c)) { + OPB_err(131); + } + break; + case 18: + if ((x->class == 7 && f == 3)) { + OPB_CharToString(x); + f = 10; + } + if (x->class == 8 || x->class == 9) { + OPB_err(126); + } else if (((!__IN(x->typ->comp, 0x0c) || x->typ->BaseTyp->form != 3) && f != 10)) { + OPB_err(111); + } + break; + case 19: + if (x->class == 8 || x->class == 9) { + OPB_err(126); + } else if (__IN(f, 0x70)) { + if (f != 6) { + OPB_Convert(&x, OPT_linttyp); + } + } else { + OPB_err(111); + x->typ = OPT_linttyp; + } + break; + case 20: + OPB_CheckLeaf(x, 0); + OPB_MOp(24, &x); + break; + case 12: + if (x->class != 8) { + OPB_err(110); + x = OPB_NewIntConst(((LONGINT)(1))); + } else if (__IN(f, 0x63fe) || __IN(x->typ->comp, 0x14)) { + (*OPB_typSize)(x->typ); + x->typ->pvused = 1; + x = OPB_NewIntConst(x->typ->size); + } else { + OPB_err(111); + x = OPB_NewIntConst(((LONGINT)(1))); + } + break; + case 21: + OPB_MOp(25, &x); + break; + case 22: case 23: + if (x->class == 8 || x->class == 9) { + OPB_err(126); + } else if (!__IN(f, 0x027a)) { + OPB_err(111); + } + break; + case 24: case 25: case 28: case 31: + if (x->class == 8 || x->class == 9) { + OPB_err(126); + } else if ((x->class == 7 && __IN(f, 0x30))) { + OPB_Convert(&x, OPT_linttyp); + } else if (!__IN(f, 0x2040)) { + OPB_err(111); + x->typ = OPT_linttyp; + } + break; + case 26: case 27: + if ((__IN(f, 0x70) && x->class == 7)) { + if (x->conval->intval < 0 || x->conval->intval > -1) { + OPB_err(220); + } + } else { + OPB_err(69); + } + break; + case 29: + if (x->class != 8) { + OPB_err(110); + } else if (__IN(f, 0x1401) || x->typ->comp == 3) { + OPB_err(111); + } + break; + case 30: + if (OPB_NotVar(x)) { + OPB_err(112); + } else if (f == 13) { + } else { + OPB_err(111); + } + break; + case 32: + if (x->class == 8 || x->class == 9) { + OPB_err(126); + x = OPB_NewBoolConst(0); + } else if (f != 2) { + OPB_err(120); + x = OPB_NewBoolConst(0); + } else { + OPB_MOp(33, &x); + } + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPB.StPar0, fctno = ", (LONGINT)39); + OPM_LogWNum(fctno, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + *par0 = x; +} + +static struct StPar1__52 { + struct StPar1__52 *lnk; +} *StPar1__52_s; + +static OPT_Node NewOp__53 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right); + +static OPT_Node NewOp__53 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right) +{ + OPT_Node _o_result; + OPT_Node node = NIL; + node = OPT_NewNode(class); + node->subcl = subcl; + node->left = left; + node->right = right; + _o_result = node; + return _o_result; +} + +void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) +{ + INTEGER f, L; + OPT_Struct typ = NIL; + OPT_Node p = NIL, t = NIL; + struct StPar1__52 _s; + _s.lnk = StPar1__52_s; + StPar1__52_s = &_s; + p = *par0; + f = x->typ->form; + switch (fctno) { + case 13: case 14: + if (x->class == 8 || x->class == 9) { + OPB_err(126); + p->typ = OPT_notyp; + } else { + if (x->typ != p->typ) { + if ((x->class == 7 && __IN(f, 0x70))) { + OPB_Convert(&x, p->typ); + } else { + OPB_err(111); + } + } + p = NewOp__53(19, fctno, p, x); + p->typ = OPT_notyp; + } + break; + case 15: case 16: + if (x->class == 8 || x->class == 9) { + OPB_err(126); + } else if (__IN(f, 0x70)) { + if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > (LONGINT)OPM_MaxSet))) { + OPB_err(202); + } + p = NewOp__53(19, fctno, p, x); + } else { + OPB_err(111); + } + p->typ = OPT_notyp; + break; + case 17: + if (!__IN(f, 0x70) || x->class != 7) { + OPB_err(69); + } else if (f == 4) { + L = (int)x->conval->intval; + typ = p->typ; + while ((L > 0 && __IN(typ->comp, 0x0c))) { + typ = typ->BaseTyp; + L -= 1; + } + if (L != 0 || !__IN(typ->comp, 0x0c)) { + OPB_err(132); + } else { + x->obj = NIL; + if (typ->comp == 3) { + while (p->class == 4) { + p = p->left; + x->conval->intval += 1; + } + p = NewOp__53(12, 19, p, x); + p->typ = OPT_linttyp; + } else { + p = x; + p->conval->intval = typ->n; + OPB_SetIntType(p); + } + } + } else { + OPB_err(132); + } + break; + case 18: + if (OPB_NotVar(x)) { + OPB_err(112); + } else if ((__IN(x->typ->comp, 0x0c) && x->typ->BaseTyp->form == 3)) { + if (x->readonly) { + OPB_err(76); + } + t = x; + x = p; + p = t; + p = NewOp__53(19, 18, p, x); + } else { + OPB_err(111); + } + p->typ = OPT_notyp; + break; + case 19: + if (x->class == 8 || x->class == 9) { + OPB_err(126); + } else if (__IN(f, 0x70)) { + if ((p->class == 7 && x->class == 7)) { + if (-OPB_maxExp > x->conval->intval || x->conval->intval > OPB_maxExp) { + OPB_err(208); + p->conval->intval = 1; + } else if (x->conval->intval >= 0) { + if (__ABS(p->conval->intval) <= __DIV(9223372036854775807, __ASH(1, x->conval->intval))) { + p->conval->intval = p->conval->intval * __ASH(1, x->conval->intval); + } else { + OPB_err(208); + p->conval->intval = 1; + } + } else { + p->conval->intval = __ASH(p->conval->intval, x->conval->intval); + } + p->obj = NIL; + } else { + p = NewOp__53(12, 17, p, x); + p->typ = OPT_linttyp; + } + } else { + OPB_err(111); + } + break; + case 1: + if (x->class == 8 || x->class == 9) { + OPB_err(126); + } else if (p->typ->comp == 3) { + if (__IN(f, 0x70)) { + if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > OPM_MaxIndex))) { + OPB_err(63); + } + } else { + OPB_err(111); + } + p->right = x; + p->typ = p->typ->BaseTyp; + } else { + OPB_err(64); + } + break; + case 22: case 23: + if (x->class == 8 || x->class == 9) { + OPB_err(126); + } else if (!__IN(f, 0x70)) { + OPB_err(111); + } else { + if (fctno == 22) { + p = NewOp__53(12, 27, p, x); + } else { + p = NewOp__53(12, 28, p, x); + } + p->typ = p->left->typ; + } + break; + case 24: case 25: case 26: case 27: + if (x->class == 8 || x->class == 9) { + OPB_err(126); + } else if (__IN(f, 0x63ff)) { + if (fctno == 24 || fctno == 26) { + if (OPB_NotVar(x)) { + OPB_err(112); + } + t = x; + x = p; + p = t; + } + p = NewOp__53(19, fctno, p, x); + } else { + OPB_err(111); + } + p->typ = OPT_notyp; + break; + case 28: + if (x->class == 8 || x->class == 9) { + OPB_err(126); + } else if (__IN(f, 0x70)) { + p = NewOp__53(12, 26, p, x); + } else { + OPB_err(111); + } + p->typ = OPT_booltyp; + break; + case 29: + if (((x->class == 8 || x->class == 9) || __IN(f, 0x1401)) || x->typ->comp == 3) { + OPB_err(126); + } + t = OPT_NewNode(11); + t->subcl = 29; + t->left = x; + x = t; + x->typ = p->typ; + p = x; + break; + case 30: + if (x->class == 8 || x->class == 9) { + OPB_err(126); + } else if (__IN(f, 0x70)) { + p = NewOp__53(19, 30, p, x); + } else { + OPB_err(111); + } + p->typ = OPT_notyp; + break; + case 31: + if (x->class == 8 || x->class == 9) { + OPB_err(126); + } else if ((x->class == 7 && __IN(f, 0x30))) { + OPB_Convert(&x, OPT_linttyp); + } else if (!__IN(f, 0x2040)) { + OPB_err(111); + x->typ = OPT_linttyp; + } + p->link = x; + break; + case 32: + if ((__IN(f, 0x70) && x->class == 7)) { + if ((0 <= x->conval->intval && x->conval->intval <= 255)) { + OPB_BindNodes(28, OPT_notyp, &x, x); + x->conval = OPT_NewConst(); + x->conval->intval = OPM_errpos; + OPB_Construct(15, &p, x); + p->conval = OPT_NewConst(); + p->conval->intval = OPM_errpos; + OPB_Construct(20, &p, NIL); + OPB_OptIf(&p); + if (p == NIL) { + } else if (p->class == 28) { + OPB_err(99); + } else { + p->subcl = 32; + } + } else { + OPB_err(218); + } + } else { + OPB_err(69); + } + break; + default: + OPB_err(64); + break; + } + *par0 = p; + StPar1__52_s = _s.lnk; +} + +void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n) +{ + OPT_Node node = NIL; + INTEGER f; + OPT_Node p = NIL; + p = *par0; + f = x->typ->form; + if (fctno == 1) { + if (x->class == 8 || x->class == 9) { + OPB_err(126); + } else if (p->typ->comp != 3) { + OPB_err(64); + } else if (__IN(f, 0x70)) { + if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > OPM_MaxIndex))) { + OPB_err(63); + } + node = p->right; + while (node->link != NIL) { + node = node->link; + } + node->link = x; + p->typ = p->typ->BaseTyp; + } else { + OPB_err(111); + } + } else if ((fctno == 31 && n == 2)) { + if (x->class == 8 || x->class == 9) { + OPB_err(126); + } else if (__IN(f, 0x70)) { + node = OPT_NewNode(19); + node->subcl = 31; + node->right = p; + node->left = p->link; + p->link = x; + p = node; + } else { + OPB_err(111); + } + p->typ = OPT_notyp; + } else { + OPB_err(64); + } + *par0 = p; +} + +void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno) +{ + INTEGER dim; + OPT_Node x = NIL, p = NIL; + p = *par0; + if (fctno <= 19) { + if ((fctno == 1 && p->typ != OPT_notyp)) { + if (p->typ->comp == 3) { + OPB_err(65); + } + p->typ = OPT_notyp; + } else if (fctno <= 12) { + if (parno < 1) { + OPB_err(65); + } + } else { + if (((fctno == 13 || fctno == 14) && parno == 1)) { + OPB_BindNodes(19, OPT_notyp, &p, OPB_NewIntConst(((LONGINT)(1)))); + p->subcl = fctno; + p->right->typ = p->left->typ; + } else if ((fctno == 17 && parno == 1)) { + if (p->typ->comp == 3) { + dim = 0; + while (p->class == 4) { + p = p->left; + dim += 1; + } + OPB_BindNodes(12, OPT_linttyp, &p, OPB_NewIntConst(dim)); + p->subcl = 19; + } else { + p = OPB_NewIntConst(p->typ->n); + } + } else if (parno < 2) { + OPB_err(65); + } + } + } else if (fctno == 32) { + if (parno == 1) { + x = NIL; + OPB_BindNodes(28, OPT_notyp, &x, OPB_NewIntConst(((LONGINT)(0)))); + x->conval = OPT_NewConst(); + x->conval->intval = OPM_errpos; + OPB_Construct(15, &p, x); + p->conval = OPT_NewConst(); + p->conval->intval = OPM_errpos; + OPB_Construct(20, &p, NIL); + OPB_OptIf(&p); + if (p == NIL) { + } else if (p->class == 28) { + OPB_err(99); + } else { + p->subcl = 32; + } + } else if (parno < 1) { + OPB_err(65); + } + } else { + if ((parno < 1 || (fctno > 21 && parno < 2)) || (fctno == 31 && parno < 3)) { + OPB_err(65); + } + } + *par0 = p; +} + +static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpar) +{ + INTEGER f; + f = atyp->comp; + ftyp = ftyp->BaseTyp; + atyp = atyp->BaseTyp; + if ((fvarpar && ftyp == OPT_bytetyp)) { + if (!__IN(f, 0x0c) || !__IN(atyp->form, 0x1e)) { + if (__IN(18, OPM_opt)) { + OPB_err(-301); + } + } + } else if (__IN(f, 0x0c)) { + if (ftyp->comp == 3) { + OPB_DynArrParCheck(ftyp, atyp, fvarpar); + } else if (ftyp != atyp) { + if ((((!fvarpar && ftyp->form == 13)) && atyp->form == 13)) { + ftyp = ftyp->BaseTyp; + atyp = atyp->BaseTyp; + if ((ftyp->comp == 4 && atyp->comp == 4)) { + while ((((ftyp != atyp && atyp != NIL)) && atyp != OPT_undftyp)) { + atyp = atyp->BaseTyp; + } + if (atyp == NIL) { + OPB_err(113); + } + } else { + OPB_err(66); + } + } else { + OPB_err(66); + } + } + } else { + OPB_err(67); + } +} + +static void OPB_CheckReceiver (OPT_Node *x, OPT_Object fp) +{ + if (fp->typ->form == 13) { + if ((*x)->class == 3) { + *x = (*x)->left; + } else { + OPB_err(71); + } + } +} + +void OPB_PrepCall (OPT_Node *x, OPT_Object *fpar) +{ + if (((*x)->obj != NIL && __IN((*x)->obj->mode, 0x22c0))) { + *fpar = (*x)->obj->link; + if ((*x)->obj->mode == 13) { + OPB_CheckReceiver(&(*x)->left, *fpar); + *fpar = (*fpar)->link; + } + } else if (((((*x)->class != 8 && (*x)->typ != NIL)) && (*x)->typ->form == 14)) { + *fpar = (*x)->typ->link; + } else { + OPB_err(121); + *fpar = NIL; + (*x)->typ = OPT_undftyp; + } +} + +void OPB_Param (OPT_Node ap, OPT_Object fp) +{ + OPT_Struct q = NIL; + if (fp->typ->form != 0) { + if (fp->mode == 2) { + if (OPB_NotVar(ap)) { + OPB_err(122); + } else { + OPB_CheckLeaf(ap, 0); + } + if (ap->readonly) { + OPB_err(76); + } + if (fp->typ->comp == 3) { + OPB_DynArrParCheck(fp->typ, ap->typ, 1); + } else if ((fp->typ->comp == 4 && ap->typ->comp == 4)) { + q = ap->typ; + while ((((q != fp->typ && q != NIL)) && q != OPT_undftyp)) { + q = q->BaseTyp; + } + if (q == NIL) { + OPB_err(111); + } + } else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 13)) { + } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && __IN(ap->typ->form, 0x18))))) { + OPB_err(123); + } else if ((fp->typ->form == 13 && ap->class == 5)) { + OPB_err(123); + } + } else if (fp->typ->comp == 3) { + if ((ap->class == 7 && ap->typ->form == 3)) { + OPB_CharToString(ap); + } + if ((ap->typ->form == 10 && fp->typ->BaseTyp->form == 3)) { + } else if (ap->class >= 7) { + OPB_err(59); + } else { + OPB_DynArrParCheck(fp->typ, ap->typ, 0); + } + } else { + OPB_CheckAssign(fp->typ, ap); + } + } +} + +void OPB_StaticLink (SHORTINT dlev) +{ + OPT_Object scope = NIL; + scope = OPT_topScope; + while (dlev > 0) { + dlev -= 1; + scope->link->conval->setval |= __SETOF(3); + scope = scope->left; + } +} + +void OPB_Call (OPT_Node *x, OPT_Node apar, OPT_Object fp) +{ + OPT_Struct typ = NIL; + OPT_Node p = NIL; + SHORTINT lev; + if ((*x)->class == 9) { + typ = (*x)->typ; + lev = (*x)->obj->mnolev; + if (lev > 0) { + OPB_StaticLink(OPT_topScope->mnolev - lev); + } + if ((*x)->obj->mode == 10) { + OPB_err(121); + } + } else if (((*x)->class == 2 && (*x)->obj->mode == 13)) { + typ = (*x)->typ; + (*x)->class = 9; + p = (*x)->left; + (*x)->left = NIL; + p->link = apar; + apar = p; + fp = (*x)->obj->link; + } else { + typ = (*x)->typ->BaseTyp; + } + OPB_BindNodes(13, typ, &*x, apar); + (*x)->obj = fp; +} + +void OPB_Enter (OPT_Node *procdec, OPT_Node stat, OPT_Object proc) +{ + OPT_Node x = NIL; + x = OPT_NewNode(18); + x->typ = OPT_notyp; + x->obj = proc; + x->left = *procdec; + x->right = stat; + *procdec = x; +} + +void OPB_Return (OPT_Node *x, OPT_Object proc) +{ + OPT_Node node = NIL; + if (proc == NIL) { + if (*x != NIL) { + OPB_err(124); + } + } else { + if (*x != NIL) { + OPB_CheckAssign(proc->typ, *x); + } else if (proc->typ != OPT_notyp) { + OPB_err(124); + } + } + node = OPT_NewNode(26); + node->typ = OPT_notyp; + node->obj = proc; + node->left = *x; + *x = node; +} + +void OPB_Assign (OPT_Node *x, OPT_Node y) +{ + OPT_Node z = NIL; + SHORTINT subcl; + if ((*x)->class >= 7) { + OPB_err(56); + } + OPB_CheckAssign((*x)->typ, y); + if ((*x)->readonly) { + OPB_err(76); + } + if ((*x)->typ->comp == 4) { + if ((*x)->class == 5) { + z = (*x)->left; + } else { + z = *x; + } + if ((z->class == 3 && z->left->class == 5)) { + z->left = z->left->left; + } + if (((*x)->typ->strobj != NIL && (z->class == 3 || z->class == 1))) { + OPB_BindNodes(6, (*x)->typ, &z, NIL); + *x = z; + } + } else if (((((((*x)->typ->comp == 2 && (*x)->typ->BaseTyp == OPT_chartyp)) && y->typ->form == 10)) && y->conval->intval2 == 1)) { + y->typ = OPT_chartyp; + y->conval->intval = 0; + OPB_Index(&*x, OPB_NewIntConst(((LONGINT)(0)))); + } + if ((((((__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp == OPT_chartyp)) && __IN(y->typ->comp, 0x0c))) && y->typ->BaseTyp == OPT_chartyp)) { + subcl = 18; + } else { + subcl = 0; + } + OPB_BindNodes(19, OPT_notyp, &*x, y); + (*x)->subcl = subcl; +} + +void OPB_Inittd (OPT_Node *inittd, OPT_Node *last, OPT_Struct typ) +{ + OPT_Node node = NIL; + node = OPT_NewNode(14); + node->typ = typ; + node->conval = OPT_NewConst(); + node->conval->intval = typ->txtpos; + if (*inittd == NIL) { + *inittd = node; + } else { + (*last)->link = node; + } + *last = node; +} + + +export void *OPB__init(void) +{ + __DEFMOD; + __MODULE_IMPORT(OPM); + __MODULE_IMPORT(OPS); + __MODULE_IMPORT(OPT); + __REGMOD("OPB", 0); +/* BEGIN */ + OPB_maxExp = OPB_log(4611686018427387904); + OPB_maxExp = OPB_exp; + __ENDMOD; +} diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h new file mode 100644 index 00000000..c8165f54 --- /dev/null +++ b/bootstrap/windows-88/OPB.h @@ -0,0 +1,50 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ + +#ifndef OPB__h +#define OPB__h + +#define LARGE +#include "SYSTEM.h" +#include "OPS.h" +#include "OPT.h" + + +import void (*OPB_typSize)(OPT_Struct); + + +import void OPB_Assign (OPT_Node *x, OPT_Node y); +import void OPB_Call (OPT_Node *x, OPT_Node apar, OPT_Object fp); +import void OPB_CheckParameters (OPT_Object fp, OPT_Object ap, BOOLEAN checkNames); +import void OPB_Construct (SHORTINT class, OPT_Node *x, OPT_Node y); +import void OPB_DeRef (OPT_Node *x); +import OPT_Node OPB_EmptySet (void); +import void OPB_Enter (OPT_Node *procdec, OPT_Node stat, OPT_Object proc); +import void OPB_Field (OPT_Node *x, OPT_Object y); +import void OPB_In (OPT_Node *x, OPT_Node y); +import void OPB_Index (OPT_Node *x, OPT_Node y); +import void OPB_Inittd (OPT_Node *inittd, OPT_Node *last, OPT_Struct typ); +import void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y); +import void OPB_MOp (SHORTINT op, OPT_Node *x); +import OPT_Node OPB_NewBoolConst (BOOLEAN boolval); +import OPT_Node OPB_NewIntConst (LONGINT intval); +import OPT_Node OPB_NewLeaf (OPT_Object obj); +import OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ); +import OPT_Node OPB_NewString (OPS_String str, LONGINT len); +import OPT_Node OPB_Nil (void); +import void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y); +import void OPB_OptIf (OPT_Node *x); +import void OPB_Param (OPT_Node ap, OPT_Object fp); +import void OPB_PrepCall (OPT_Node *x, OPT_Object *fpar); +import void OPB_Return (OPT_Node *x, OPT_Object proc); +import void OPB_SetElem (OPT_Node *x); +import void OPB_SetRange (OPT_Node *x, OPT_Node y); +import void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno); +import void OPB_StPar0 (OPT_Node *par0, INTEGER fctno); +import void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno); +import void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n); +import void OPB_StaticLink (SHORTINT dlev); +import void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard); +import void *OPB__init(void); + + +#endif diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c new file mode 100644 index 00000000..10468b9e --- /dev/null +++ b/bootstrap/windows-88/OPC.c @@ -0,0 +1,2109 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +#define LARGE +#include "SYSTEM.h" +#include "Configuration.h" +#include "OPM.h" +#include "OPT.h" + + +static INTEGER OPC_indentLevel; +static BOOLEAN OPC_ptrinit, OPC_mainprog, OPC_ansi; +static SHORTINT OPC_hashtab[105]; +static CHAR OPC_keytab[36][9]; +static BOOLEAN OPC_GlbPtrs; +static CHAR OPC_BodyNameExt[13]; + + +export void OPC_Align (LONGINT *adr, LONGINT base); +export void OPC_Andent (OPT_Struct typ); +static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames); +export LONGINT OPC_Base (OPT_Struct typ); +export OPT_Object OPC_BaseTProc (OPT_Object obj); +export void OPC_BegBlk (void); +export void OPC_BegStat (void); +static void OPC_CProcDefs (OPT_Object obj, INTEGER vis); +export void OPC_Case (LONGINT caseVal, INTEGER form); +export void OPC_Cmp (INTEGER rel); +export void OPC_CompleteIdent (OPT_Object obj); +export void OPC_Constant (OPT_Const con, INTEGER form); +static void OPC_DeclareBase (OPT_Object dcl); +static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef); +static void OPC_DeclareParams (OPT_Object par, BOOLEAN macro); +static void OPC_DeclareTProcs (OPT_Object obj, BOOLEAN *empty); +static void OPC_DefAnonRecs (OPT_Node n); +export void OPC_DefineInter (OPT_Object proc); +static void OPC_DefineTProcMacros (OPT_Object obj, BOOLEAN *empty); +static void OPC_DefineTProcTypes (OPT_Object obj); +static void OPC_DefineType (OPT_Struct str); +export void OPC_EndBlk (void); +export void OPC_EndBlk0 (void); +export void OPC_EndStat (void); +export void OPC_EnterBody (void); +export void OPC_EnterProc (OPT_Object proc); +export void OPC_ExitBody (void); +export void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet); +static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, LONGINT *off, LONGINT *n, LONGINT *curAlign); +static void OPC_FillGap (LONGINT gap, LONGINT off, LONGINT align, LONGINT *n, LONGINT *curAlign); +export void OPC_GenBdy (OPT_Node n); +static void OPC_GenDynTypes (OPT_Node n, INTEGER vis); +export void OPC_GenEnumPtrs (OPT_Object var); +export void OPC_GenHdr (OPT_Node n); +export void OPC_GenHdrIncludes (void); +static void OPC_GenHeaderMsg (void); +export void OPC_Halt (LONGINT n); +export void OPC_Ident (OPT_Object obj); +static void OPC_IdentList (OPT_Object obj, INTEGER vis); +static void OPC_Include (CHAR *name, LONGINT name__len); +static void OPC_IncludeImports (OPT_Object obj, INTEGER vis); +export void OPC_Increment (BOOLEAN decrement); +export void OPC_Indent (INTEGER count); +export void OPC_Init (void); +static void OPC_InitImports (OPT_Object obj); +static void OPC_InitKeywords (void); +export void OPC_InitTDesc (OPT_Struct typ); +static void OPC_InitTProcs (OPT_Object typ, OPT_Object obj); +export void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim); +static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName); +static INTEGER OPC_Length (CHAR *s, LONGINT s__len); +export LONGINT OPC_NofPtrs (OPT_Struct typ); +static INTEGER OPC_PerfectHash (CHAR *s, LONGINT s__len); +static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len); +static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define); +static void OPC_ProcPredefs (OPT_Object obj, SHORTINT vis); +static void OPC_PutBase (OPT_Struct typ); +static void OPC_PutPtrOffsets (OPT_Struct typ, LONGINT adr, LONGINT *cnt); +static void OPC_RegCmds (OPT_Object obj); +export void OPC_SetInclude (BOOLEAN exclude); +static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause); +static void OPC_Str1 (CHAR *s, LONGINT s__len, LONGINT x); +export void OPC_TDescDecl (OPT_Struct typ); +export void OPC_TypeDefs (OPT_Object obj, INTEGER vis); +export void OPC_TypeOf (OPT_Object ap); +static BOOLEAN OPC_Undefined (OPT_Object obj); + + +void OPC_Init (void) +{ + OPC_indentLevel = 0; + OPC_ptrinit = __IN(5, OPM_opt); + OPC_mainprog = OPM_mainProg || OPM_mainLinkStat; + OPC_ansi = __IN(6, OPM_opt); + if (OPC_ansi) { + __MOVE("__init(void)", OPC_BodyNameExt, 13); + } else { + __MOVE("__init()", OPC_BodyNameExt, 9); + } +} + +void OPC_Indent (INTEGER count) +{ + OPC_indentLevel += count; +} + +void OPC_BegStat (void) +{ + INTEGER i; + i = OPC_indentLevel; + while (i > 0) { + OPM_Write(0x09); + i -= 1; + } +} + +void OPC_EndStat (void) +{ + OPM_Write(';'); + OPM_WriteLn(); +} + +void OPC_BegBlk (void) +{ + OPM_Write('{'); + OPM_WriteLn(); + OPC_indentLevel += 1; +} + +void OPC_EndBlk (void) +{ + OPC_indentLevel -= 1; + OPC_BegStat(); + OPM_Write('}'); + OPM_WriteLn(); +} + +void OPC_EndBlk0 (void) +{ + OPC_indentLevel -= 1; + OPC_BegStat(); + OPM_Write('}'); +} + +static void OPC_Str1 (CHAR *s, LONGINT s__len, LONGINT x) +{ + CHAR ch; + INTEGER i; + __DUP(s, s__len, CHAR); + ch = s[0]; + i = 0; + while (ch != 0x00) { + if (ch == '#') { + OPM_WriteInt(x); + } else { + OPM_Write(ch); + } + i += 1; + ch = s[__X(i, s__len)]; + } + __DEL(s); +} + +static INTEGER OPC_Length (CHAR *s, LONGINT s__len) +{ + INTEGER _o_result; + INTEGER i; + i = 0; + while (s[__X(i, s__len)] != 0x00) { + i += 1; + } + _o_result = i; + return _o_result; +} + +static INTEGER OPC_PerfectHash (CHAR *s, LONGINT s__len) +{ + INTEGER _o_result; + INTEGER i, h; + i = 0; + h = 0; + while ((s[__X(i, s__len)] != 0x00 && i < 5)) { + h = 3 * h + (int)s[__X(i, s__len)]; + i += 1; + } + _o_result = (int)__MOD(h, 105); + return _o_result; +} + +void OPC_Ident (OPT_Object obj) +{ + INTEGER mode, level, h; + mode = obj->mode; + level = obj->mnolev; + if ((__IN(mode, 0x62) && level > 0) || __IN(mode, 0x14)) { + OPM_WriteStringVar((void*)obj->name, ((LONGINT)(256))); + h = OPC_PerfectHash((void*)obj->name, ((LONGINT)(256))); + if (OPC_hashtab[__X(h, ((LONGINT)(105)))] >= 0) { + if (__STRCMP(OPC_keytab[__X(OPC_hashtab[__X(h, ((LONGINT)(105)))], ((LONGINT)(36)))], obj->name) == 0) { + OPM_Write('_'); + } + } + } else { + if (mode != 5 || obj->linkadr != 2) { + if (mode == 13) { + OPC_Ident(obj->link->typ->strobj); + } else if (level < 0) { + OPM_WriteStringVar((void*)OPT_GlbMod[__X(-level, ((LONGINT)(64)))]->name, ((LONGINT)(256))); + if (OPM_currFile == 0) { + OPT_GlbMod[__X(-level, ((LONGINT)(64)))]->vis = 1; + } + } else { + OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); + } + OPM_Write('_'); + } else if (obj == OPT_sysptrtyp->strobj || obj == OPT_bytetyp->strobj) { + OPM_WriteString((CHAR*)"SYSTEM_", (LONGINT)8); + } + OPM_WriteStringVar((void*)obj->name, ((LONGINT)(256))); + } +} + +static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause) +{ + INTEGER pointers; + *openClause = 0; + if (((typ->strobj == NIL || typ->strobj->name[0] == 0x00) && typ->comp != 4)) { + if (__IN(typ->comp, 0x0c)) { + OPC_Stars(typ->BaseTyp, &*openClause); + *openClause = typ->comp == 2; + } else if (typ->form == 14) { + OPM_Write('('); + OPM_Write('*'); + } else { + pointers = 0; + while (((typ->strobj == NIL || typ->strobj->name[0] == 0x00) && typ->form == 13)) { + pointers += 1; + typ = typ->BaseTyp; + } + if (pointers > 0) { + if (typ->comp != 3) { + OPC_Stars(typ, &*openClause); + } + if (*openClause) { + OPM_Write('('); + *openClause = 0; + } + while (pointers > 0) { + OPM_Write('*'); + pointers -= 1; + } + } + } + } +} + +static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef) +{ + OPT_Struct typ = NIL; + BOOLEAN varPar, openClause; + INTEGER form, comp; + typ = dcl->typ; + varPar = ((dcl->mode == 2 && typ->comp != 2) || typ->comp == 3) || scopeDef; + OPC_Stars(typ, &openClause); + if (varPar) { + if (openClause) { + OPM_Write('('); + } + OPM_Write('*'); + } + if (dcl->name[0] != 0x00) { + OPC_Ident(dcl); + } + if ((varPar && openClause)) { + OPM_Write(')'); + } + openClause = 0; + for (;;) { + form = typ->form; + comp = typ->comp; + if (((typ->strobj != NIL && typ->strobj->name[0] != 0x00) || form == 12) || comp == 4) { + break; + } else if ((form == 13 && typ->BaseTyp->comp != 3)) { + openClause = 1; + } else if (form == 14 || __IN(comp, 0x0c)) { + if (openClause) { + OPM_Write(')'); + openClause = 0; + } + if (form == 14) { + if (OPC_ansi) { + OPM_Write(')'); + OPC_AnsiParamList(typ->link, 0); + } else { + OPM_WriteString((CHAR*)")()", (LONGINT)4); + } + break; + } else if (comp == 2) { + OPM_Write('['); + OPM_WriteInt(typ->n); + OPM_Write(']'); + } + } else { + break; + } + typ = typ->BaseTyp; + } +} + +void OPC_Andent (OPT_Struct typ) +{ + if (typ->strobj == NIL || typ->align >= 65536) { + OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); + OPC_Str1((CHAR*)"__#", (LONGINT)4, __ASHR(typ->align, 16)); + } else { + OPC_Ident(typ->strobj); + } +} + +static BOOLEAN OPC_Undefined (OPT_Object obj) +{ + BOOLEAN _o_result; + _o_result = (((obj->mnolev >= 0 && obj->linkadr != (LONGINT)(3 + OPM_currFile))) && obj->linkadr != 2) || obj->name[0] == 0x00; + return _o_result; +} + +static void OPC_DeclareBase (OPT_Object dcl) +{ + OPT_Struct typ = NIL, prev = NIL; + OPT_Object obj = NIL; + INTEGER nofdims; + LONGINT off, n, dummy; + typ = dcl->typ; + prev = typ; + while ((((((((typ->strobj == NIL || typ->comp == 3) || OPC_Undefined(typ->strobj)) && typ->comp != 4)) && typ->form != 12)) && !((typ->form == 13 && typ->BaseTyp->comp == 3)))) { + prev = typ; + typ = typ->BaseTyp; + } + obj = typ->strobj; + if (typ->form == 12) { + OPM_WriteString((CHAR*)"void", (LONGINT)5); + } else if ((obj != NIL && !OPC_Undefined(obj))) { + OPC_Ident(obj); + } else if (typ->comp == 4) { + OPM_WriteString((CHAR*)"struct ", (LONGINT)8); + OPC_Andent(typ); + if ((prev->form != 13 && (obj != NIL || dcl->name[0] == 0x00))) { + if ((typ->BaseTyp != NIL && typ->BaseTyp->strobj->vis != 0)) { + OPM_WriteString((CHAR*)" { /* ", (LONGINT)7); + OPC_Ident(typ->BaseTyp->strobj); + OPM_WriteString((CHAR*)" */", (LONGINT)4); + OPM_WriteLn(); + OPC_Indent(1); + } else { + OPM_Write(' '); + OPC_BegBlk(); + } + OPC_FieldList(typ, 1, &off, &n, &dummy); + OPC_EndBlk0(); + } + } else if ((typ->form == 13 && typ->BaseTyp->comp == 3)) { + typ = typ->BaseTyp->BaseTyp; + nofdims = 1; + while (typ->comp == 3) { + nofdims += 1; + typ = typ->BaseTyp; + } + OPM_WriteString((CHAR*)"struct ", (LONGINT)8); + OPC_BegBlk(); + OPC_BegStat(); + OPC_Str1((CHAR*)"LONGINT len[#]", (LONGINT)15, nofdims); + OPC_EndStat(); + OPC_BegStat(); + __NEW(obj, OPT_ObjDesc); + __NEW(obj->typ, OPT_StrDesc); + obj->typ->form = 15; + obj->typ->comp = 2; + obj->typ->n = 1; + obj->typ->BaseTyp = typ; + obj->mode = 4; + __MOVE("data", obj->name, 5); + obj->linkadr = 0; + OPC_DeclareBase(obj); + OPM_Write(' '); + OPC_DeclareObj(obj, 0); + OPC_EndStat(); + OPC_EndBlk0(); + } +} + +LONGINT OPC_NofPtrs (OPT_Struct typ) +{ + LONGINT _o_result; + OPT_Object fld = NIL; + OPT_Struct btyp = NIL; + LONGINT n; + if ((typ->form == 13 && typ->sysflag == 0)) { + _o_result = 1; + return _o_result; + } else if ((typ->comp == 4 && __MASK(typ->sysflag, -256) == 0)) { + btyp = typ->BaseTyp; + if (btyp != NIL) { + n = OPC_NofPtrs(btyp); + } else { + n = 0; + } + fld = typ->link; + while ((fld != NIL && fld->mode == 4)) { + if (__STRCMP(fld->name, "@ptr") != 0) { + n = n + OPC_NofPtrs(fld->typ); + } else { + n += 1; + } + fld = fld->link; + } + _o_result = n; + return _o_result; + } else if (typ->comp == 2) { + btyp = typ->BaseTyp; + n = typ->n; + while (btyp->comp == 2) { + n = btyp->n * n; + btyp = btyp->BaseTyp; + } + _o_result = OPC_NofPtrs(btyp) * n; + return _o_result; + } else { + _o_result = 0; + return _o_result; + } + __RETCHK; +} + +static void OPC_PutPtrOffsets (OPT_Struct typ, LONGINT adr, LONGINT *cnt) +{ + OPT_Object fld = NIL; + OPT_Struct btyp = NIL; + LONGINT n, i; + if ((typ->form == 13 && typ->sysflag == 0)) { + OPM_WriteInt(adr); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + *cnt += 1; + if (__MASK(*cnt, -16) == 0) { + OPM_WriteLn(); + OPM_Write(0x09); + } + } else if ((typ->comp == 4 && __MASK(typ->sysflag, -256) == 0)) { + btyp = typ->BaseTyp; + if (btyp != NIL) { + OPC_PutPtrOffsets(btyp, adr, &*cnt); + } + fld = typ->link; + while ((fld != NIL && fld->mode == 4)) { + if (__STRCMP(fld->name, "@ptr") != 0) { + OPC_PutPtrOffsets(fld->typ, adr + fld->adr, &*cnt); + } else { + OPM_WriteInt(adr + fld->adr); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + *cnt += 1; + if (__MASK(*cnt, -16) == 0) { + OPM_WriteLn(); + OPM_Write(0x09); + } + } + fld = fld->link; + } + } else if (typ->comp == 2) { + btyp = typ->BaseTyp; + n = typ->n; + while (btyp->comp == 2) { + n = btyp->n * n; + btyp = btyp->BaseTyp; + } + if (OPC_NofPtrs(btyp) > 0) { + i = 0; + while (i < n) { + OPC_PutPtrOffsets(btyp, adr + i * btyp->size, &*cnt); + i += 1; + } + } + } +} + +static void OPC_InitTProcs (OPT_Object typ, OPT_Object obj) +{ + if (obj != NIL) { + OPC_InitTProcs(typ, obj->left); + if (obj->mode == 13) { + OPC_BegStat(); + OPM_WriteString((CHAR*)"__INITBP(", (LONGINT)10); + OPC_Ident(typ); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPC_Ident(obj); + OPC_Str1((CHAR*)", #)", (LONGINT)5, __ASHR(obj->adr, 16)); + OPC_EndStat(); + } + OPC_InitTProcs(typ, obj->right); + } +} + +static void OPC_PutBase (OPT_Struct typ) +{ + if (typ != NIL) { + OPC_PutBase(typ->BaseTyp); + OPC_Ident(typ->strobj); + OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + } +} + +static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName) +{ + OPT_Struct typ = NIL; + INTEGER dim; + if (showParamName) { + OPC_Ident(par); + OPM_WriteString((CHAR*)"__len", (LONGINT)6); + } + dim = 1; + typ = par->typ->BaseTyp; + while (typ->comp == 3) { + if (ansiDefine) { + OPM_WriteString((CHAR*)", LONGINT ", (LONGINT)11); + } else { + OPM_WriteString((CHAR*)", ", (LONGINT)3); + } + if (showParamName) { + OPC_Ident(par); + OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteInt(dim); + } + typ = typ->BaseTyp; + dim += 1; + } +} + +static void OPC_DeclareParams (OPT_Object par, BOOLEAN macro) +{ + OPM_Write('('); + while (par != NIL) { + if (macro) { + OPM_WriteStringVar((void*)par->name, ((LONGINT)(256))); + } else { + if ((par->mode == 1 && par->typ->form == 7)) { + OPM_Write('_'); + } + OPC_Ident(par); + } + if (par->typ->comp == 3) { + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPC_LenList(par, 0, 1); + } else if ((par->mode == 2 && par->typ->comp == 4)) { + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteStringVar((void*)par->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + } + par = par->link; + if (par != NIL) { + OPM_WriteString((CHAR*)", ", (LONGINT)3); + } + } + OPM_Write(')'); +} + +static void OPC_DefineTProcTypes (OPT_Object obj) +{ + OPT_Object par = NIL; + if (obj->typ != OPT_notyp) { + OPC_DefineType(obj->typ); + } + if (OPC_ansi) { + par = obj->link; + while (par != NIL) { + OPC_DefineType(par->typ); + par = par->link; + } + } +} + +static void OPC_DeclareTProcs (OPT_Object obj, BOOLEAN *empty) +{ + if (obj != NIL) { + OPC_DeclareTProcs(obj->left, &*empty); + if (obj->mode == 13) { + if (obj->typ != OPT_notyp) { + OPC_DefineType(obj->typ); + } + if (OPM_currFile == 0) { + if (obj->vis == 1) { + OPC_DefineTProcTypes(obj); + OPM_WriteString((CHAR*)"import ", (LONGINT)8); + *empty = 0; + OPC_ProcHeader(obj, 0); + } + } else { + *empty = 0; + OPC_DefineTProcTypes(obj); + if (obj->vis == 0) { + OPM_WriteString((CHAR*)"static ", (LONGINT)8); + } else { + OPM_WriteString((CHAR*)"export ", (LONGINT)8); + } + OPC_ProcHeader(obj, 0); + } + } + OPC_DeclareTProcs(obj->right, &*empty); + } +} + +OPT_Object OPC_BaseTProc (OPT_Object obj) +{ + OPT_Object _o_result; + OPT_Struct typ = NIL, base = NIL; + LONGINT mno; + typ = obj->link->typ; + if (typ->form == 13) { + typ = typ->BaseTyp; + } + base = typ->BaseTyp; + mno = __ASHR(obj->adr, 16); + while ((base != NIL && mno < base->n)) { + typ = base; + base = typ->BaseTyp; + } + OPT_FindField(obj->name, typ, &obj); + _o_result = obj; + return _o_result; +} + +static void OPC_DefineTProcMacros (OPT_Object obj, BOOLEAN *empty) +{ + if (obj != NIL) { + OPC_DefineTProcMacros(obj->left, &*empty); + if ((((obj->mode == 13 && obj == OPC_BaseTProc(obj))) && (OPM_currFile != 0 || obj->vis == 1))) { + OPM_WriteString((CHAR*)"#define __", (LONGINT)11); + OPC_Ident(obj); + OPC_DeclareParams(obj->link, 1); + OPM_WriteString((CHAR*)" __SEND(", (LONGINT)9); + if (obj->link->typ->form == 13) { + OPM_WriteString((CHAR*)"__TYPEOF(", (LONGINT)10); + OPC_Ident(obj->link); + OPM_Write(')'); + } else { + OPC_Ident(obj->link); + OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + } + OPC_Str1((CHAR*)", #, ", (LONGINT)6, __ASHR(obj->adr, 16)); + if (obj->typ == OPT_notyp) { + OPM_WriteString((CHAR*)"void", (LONGINT)5); + } else { + OPC_Ident(obj->typ->strobj); + } + OPM_WriteString((CHAR*)"(*)", (LONGINT)4); + if (OPC_ansi) { + OPC_AnsiParamList(obj->link, 0); + } else { + OPM_WriteString((CHAR*)"()", (LONGINT)3); + } + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPC_DeclareParams(obj->link, 1); + OPM_Write(')'); + OPM_WriteLn(); + } + OPC_DefineTProcMacros(obj->right, &*empty); + } +} + +static void OPC_DefineType (OPT_Struct str) +{ + OPT_Object obj = NIL, field = NIL, par = NIL; + BOOLEAN empty; + if (OPM_currFile == 1 || str->ref < 255) { + obj = str->strobj; + if (obj == NIL || OPC_Undefined(obj)) { + if (obj != NIL) { + if (obj->linkadr == 1) { + if (str->form != 13) { + OPM_Mark(244, str->txtpos); + obj->linkadr = 2; + } + } else { + obj->linkadr = 1; + } + } + if (str->comp == 4) { + if (str->BaseTyp != NIL) { + OPC_DefineType(str->BaseTyp); + } + field = str->link; + while ((field != NIL && field->mode == 4)) { + if (field->vis != 0 || OPM_currFile == 1) { + OPC_DefineType(field->typ); + } + field = field->link; + } + } else if (str->form == 13) { + if (str->BaseTyp->comp != 4) { + OPC_DefineType(str->BaseTyp); + } + } else if (__IN(str->comp, 0x0c)) { + OPC_DefineType(str->BaseTyp); + } else if (str->form == 14) { + if (str->BaseTyp != OPT_notyp) { + OPC_DefineType(str->BaseTyp); + } + field = str->link; + while (field != NIL) { + OPC_DefineType(field->typ); + field = field->link; + } + } + } + if ((obj != NIL && OPC_Undefined(obj))) { + OPM_WriteString((CHAR*)"typedef", (LONGINT)8); + OPM_WriteLn(); + OPM_Write(0x09); + OPC_Indent(1); + obj->linkadr = 1; + OPC_DeclareBase(obj); + OPM_Write(' '); + obj->typ->strobj = NIL; + OPC_DeclareObj(obj, 0); + obj->typ->strobj = obj; + obj->linkadr = 3 + OPM_currFile; + OPC_EndStat(); + OPC_Indent(-1); + OPM_WriteLn(); + if (obj->typ->comp == 4) { + empty = 1; + OPC_DeclareTProcs(str->link, &empty); + OPC_DefineTProcMacros(str->link, &empty); + if (!empty) { + OPM_WriteLn(); + } + } + } + } +} + +static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len) +{ + BOOLEAN _o_result; + INTEGER i; + BOOLEAN r; + __DUP(y, y__len, CHAR); + i = 0; + while ((*x)[__X(i + 1, ((LONGINT)(256)))] == y[__X(i, y__len)]) { + i += 1; + } + r = y[__X(i, y__len)] == 0x00; + _o_result = r; + __DEL(y); + return _o_result; +} + +static void OPC_CProcDefs (OPT_Object obj, INTEGER vis) +{ + INTEGER i; + OPT_ConstExt ext = NIL; + INTEGER _for__9; + if (obj != NIL) { + OPC_CProcDefs(obj->left, vis); + if ((((obj->mode == 9 && (int)obj->vis >= vis)) && obj->adr == 1)) { + ext = obj->conval->ext; + i = 1; + if (((*ext)[1] != '#' && !(OPC_Prefixed(ext, (CHAR*)"extern ", (LONGINT)8) || OPC_Prefixed(ext, (CHAR*)"import ", (LONGINT)8)))) { + OPM_WriteString((CHAR*)"#define ", (LONGINT)9); + OPC_Ident(obj); + OPC_DeclareParams(obj->link, 1); + OPM_Write(0x09); + } + _for__9 = (int)(*obj->conval->ext)[0]; + i = i; + while (i <= _for__9) { + OPM_Write((*obj->conval->ext)[__X(i, ((LONGINT)(256)))]); + i += 1; + } + OPM_WriteLn(); + } + OPC_CProcDefs(obj->right, vis); + } +} + +void OPC_TypeDefs (OPT_Object obj, INTEGER vis) +{ + if (obj != NIL) { + OPC_TypeDefs(obj->left, vis); + if ((obj->mode == 5 && obj->typ->txtpos > 0)) { + OPC_DefineType(obj->typ); + } + OPC_TypeDefs(obj->right, vis); + } +} + +static void OPC_DefAnonRecs (OPT_Node n) +{ + OPT_Object o = NIL; + OPT_Struct typ = NIL; + while ((n != NIL && n->class == 14)) { + typ = n->typ; + if ((typ->strobj == NIL && (OPM_currFile == 1 || typ->ref < 255))) { + OPC_DefineType(typ); + __NEW(o, OPT_ObjDesc); + o->typ = typ; + o->name[0] = 0x00; + OPC_DeclareBase(o); + OPC_EndStat(); + OPM_WriteLn(); + } + n = n->link; + } +} + +void OPC_TDescDecl (OPT_Struct typ) +{ + LONGINT nofptrs; + OPT_Object o = NIL; + OPC_BegStat(); + OPM_WriteString((CHAR*)"__TDESC(", (LONGINT)9); + OPC_Andent(typ); + OPC_Str1((CHAR*)", #", (LONGINT)4, typ->n + 1); + OPC_Str1((CHAR*)", #) = {__TDFLDS(", (LONGINT)18, OPC_NofPtrs(typ)); + OPM_Write('\"'); + if (typ->strobj != NIL) { + OPM_WriteStringVar((void*)typ->strobj->name, ((LONGINT)(256))); + } + OPC_Str1((CHAR*)"\", #), {", (LONGINT)9, typ->size); + nofptrs = 0; + OPC_PutPtrOffsets(typ, ((LONGINT)(0)), &nofptrs); + OPC_Str1((CHAR*)"#}}", (LONGINT)4, -((nofptrs + 1) * (LONGINT)OPM_LIntSize)); + OPC_EndStat(); +} + +void OPC_InitTDesc (OPT_Struct typ) +{ + OPC_BegStat(); + OPM_WriteString((CHAR*)"__INITYP(", (LONGINT)10); + OPC_Andent(typ); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + if (typ->BaseTyp != NIL) { + OPC_Andent(typ->BaseTyp); + } else { + OPC_Andent(typ); + } + OPC_Str1((CHAR*)", #)", (LONGINT)5, typ->extlev); + OPC_EndStat(); + if (typ->strobj != NIL) { + OPC_InitTProcs(typ->strobj, typ->link); + } +} + +void OPC_Align (LONGINT *adr, LONGINT base) +{ + switch (base) { + case 2: + *adr += __MASK(*adr, -2); + break; + case 4: + *adr += __MASK(-*adr, -4); + break; + case 8: + *adr += __MASK(-*adr, -8); + break; + case 16: + *adr += __MASK(-*adr, -16); + break; + default: + break; + } +} + +LONGINT OPC_Base (OPT_Struct typ) +{ + LONGINT _o_result; + switch (typ->form) { + case 1: + _o_result = 1; + return _o_result; + break; + case 3: + _o_result = OPM_CharAlign; + return _o_result; + break; + case 2: + _o_result = OPM_BoolAlign; + return _o_result; + break; + case 4: + _o_result = OPM_SIntAlign; + return _o_result; + break; + case 5: + _o_result = OPM_IntAlign; + return _o_result; + break; + case 6: + _o_result = OPM_LIntAlign; + return _o_result; + break; + case 7: + _o_result = OPM_RealAlign; + return _o_result; + break; + case 8: + _o_result = OPM_LRealAlign; + return _o_result; + break; + case 9: + _o_result = OPM_SetAlign; + return _o_result; + break; + case 13: + _o_result = OPM_PointerAlign; + return _o_result; + break; + case 14: + _o_result = OPM_ProcAlign; + return _o_result; + break; + case 15: + if (typ->comp == 4) { + _o_result = __MASK(typ->align, -65536); + return _o_result; + } else { + _o_result = OPC_Base(typ->BaseTyp); + return _o_result; + } + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPC.Base, typ^form = ", (LONGINT)40); + OPM_LogWNum(typ->form, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + __RETCHK; +} + +static void OPC_FillGap (LONGINT gap, LONGINT off, LONGINT align, LONGINT *n, LONGINT *curAlign) +{ + LONGINT adr; + adr = off; + OPC_Align(&adr, align); + if ((*curAlign < align && gap - (adr - off) >= align)) { + gap -= (adr - off) + align; + OPC_BegStat(); + if (align == (LONGINT)OPM_IntSize) { + OPM_WriteString((CHAR*)"INTEGER", (LONGINT)8); + } else if (align == (LONGINT)OPM_LIntSize) { + OPM_WriteString((CHAR*)"LONGINT", (LONGINT)8); + } else if (align == (LONGINT)OPM_LRealSize) { + OPM_WriteString((CHAR*)"LONGREAL", (LONGINT)9); + } + OPC_Str1((CHAR*)" _prvt#", (LONGINT)8, *n); + *n += 1; + OPC_EndStat(); + *curAlign = align; + } + if (gap > 0) { + OPC_BegStat(); + OPC_Str1((CHAR*)"char _prvt#", (LONGINT)12, *n); + *n += 1; + OPC_Str1((CHAR*)"[#]", (LONGINT)4, gap); + OPC_EndStat(); + } +} + +static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, LONGINT *off, LONGINT *n, LONGINT *curAlign) +{ + OPT_Object fld = NIL; + OPT_Struct base = NIL; + LONGINT gap, adr, align, fldAlign; + fld = typ->link; + align = __MASK(typ->align, -65536); + if (typ->BaseTyp != NIL) { + OPC_FieldList(typ->BaseTyp, 0, &*off, &*n, &*curAlign); + } else { + *off = 0; + *n = 0; + *curAlign = 1; + } + while ((fld != NIL && fld->mode == 4)) { + if ((OPM_currFile == 0 && fld->vis == 0) || (((OPM_currFile == 1 && fld->vis == 0)) && typ->mno != 0)) { + fld = fld->link; + while ((((fld != NIL && fld->mode == 4)) && fld->vis == 0)) { + fld = fld->link; + } + } else { + adr = *off; + fldAlign = OPC_Base(fld->typ); + OPC_Align(&adr, fldAlign); + gap = fld->adr - adr; + if (fldAlign > *curAlign) { + *curAlign = fldAlign; + } + if (gap > 0) { + OPC_FillGap(gap, *off, align, &*n, &*curAlign); + } + OPC_BegStat(); + OPC_DeclareBase(fld); + OPM_Write(' '); + OPC_DeclareObj(fld, 0); + *off = fld->adr + fld->typ->size; + base = fld->typ; + fld = fld->link; + while ((((((((fld != NIL && fld->mode == 4)) && fld->typ == base)) && fld->adr == *off)) && ((OPM_currFile == 1 || fld->vis != 0) || fld->typ->strobj == NIL))) { + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPC_DeclareObj(fld, 0); + *off = fld->adr + fld->typ->size; + fld = fld->link; + } + OPC_EndStat(); + } + } + if (last) { + adr = typ->size - (LONGINT)__ASHR(typ->sysflag, 8); + if (adr == 0) { + gap = 1; + } else { + gap = adr - *off; + } + if (gap > 0) { + OPC_FillGap(gap, *off, align, &*n, &*curAlign); + } + } +} + +static void OPC_IdentList (OPT_Object obj, INTEGER vis) +{ + OPT_Struct base = NIL; + BOOLEAN first; + INTEGER lastvis; + base = NIL; + first = 1; + while ((obj != NIL && obj->mode != 13)) { + if ((__IN(vis, 0x05) || (vis == 1 && obj->vis != 0)) || (vis == 3 && !obj->leaf)) { + if (obj->typ != base || (int)obj->vis != lastvis) { + if (!first) { + OPC_EndStat(); + } + first = 0; + base = obj->typ; + lastvis = obj->vis; + OPC_BegStat(); + if ((vis == 1 && obj->vis != 0)) { + OPM_WriteString((CHAR*)"import ", (LONGINT)8); + } else if ((obj->mnolev == 0 && vis == 0)) { + if (obj->vis == 0) { + OPM_WriteString((CHAR*)"static ", (LONGINT)8); + } else { + OPM_WriteString((CHAR*)"export ", (LONGINT)8); + } + } + if ((((vis == 2 && obj->mode == 1)) && base->form == 7)) { + OPM_WriteString((CHAR*)"double", (LONGINT)7); + } else { + OPC_DeclareBase(obj); + } + } else { + OPM_Write(','); + } + OPM_Write(' '); + if ((((vis == 2 && obj->mode == 1)) && base->form == 7)) { + OPM_Write('_'); + } + OPC_DeclareObj(obj, vis == 3); + if (obj->typ->comp == 3) { + OPC_EndStat(); + OPC_BegStat(); + base = OPT_linttyp; + OPM_WriteString((CHAR*)"LONGINT ", (LONGINT)9); + OPC_LenList(obj, 0, 1); + } else if ((obj->mode == 2 && obj->typ->comp == 4)) { + OPC_EndStat(); + OPC_BegStat(); + OPM_WriteString((CHAR*)"LONGINT *", (LONGINT)10); + OPC_Ident(obj); + OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + base = NIL; + } else if ((((((OPC_ptrinit && vis == 0)) && obj->mnolev > 0)) && obj->typ->form == 13)) { + OPM_WriteString((CHAR*)" = NIL", (LONGINT)7); + } + } + obj = obj->link; + } + if (!first) { + OPC_EndStat(); + } +} + +static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames) +{ + CHAR name[32]; + OPM_Write('('); + if (obj == NIL || obj->mode == 13) { + OPM_WriteString((CHAR*)"void", (LONGINT)5); + } else { + for (;;) { + OPC_DeclareBase(obj); + if (showParamNames) { + OPM_Write(' '); + OPC_DeclareObj(obj, 0); + } else { + __COPY(obj->name, name, ((LONGINT)(32))); + obj->name[0] = 0x00; + OPC_DeclareObj(obj, 0); + __COPY(name, obj->name, ((LONGINT)(256))); + } + if (obj->typ->comp == 3) { + OPM_WriteString((CHAR*)", LONGINT ", (LONGINT)11); + OPC_LenList(obj, 1, showParamNames); + } else if ((obj->mode == 2 && obj->typ->comp == 4)) { + OPM_WriteString((CHAR*)", LONGINT *", (LONGINT)12); + if (showParamNames) { + OPC_Ident(obj); + OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + } + } + if (obj->link == NIL || obj->link->mode == 13) { + break; + } + OPM_WriteString((CHAR*)", ", (LONGINT)3); + obj = obj->link; + } + } + OPM_Write(')'); +} + +static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define) +{ + if (proc->typ == OPT_notyp) { + OPM_WriteString((CHAR*)"void", (LONGINT)5); + } else { + OPC_Ident(proc->typ->strobj); + } + OPM_Write(' '); + OPC_Ident(proc); + OPM_Write(' '); + if (OPC_ansi) { + OPC_AnsiParamList(proc->link, 1); + if (!define) { + OPM_Write(';'); + } + OPM_WriteLn(); + } else if (define) { + OPC_DeclareParams(proc->link, 0); + OPM_WriteLn(); + OPC_Indent(1); + OPC_IdentList(proc->link, 2); + OPC_Indent(-1); + } else { + OPM_WriteString((CHAR*)"();", (LONGINT)4); + OPM_WriteLn(); + } +} + +static void OPC_ProcPredefs (OPT_Object obj, SHORTINT vis) +{ + if (obj != NIL) { + OPC_ProcPredefs(obj->left, vis); + if ((((__IN(obj->mode, 0xc0) && obj->vis >= vis)) && (obj->history != 4 || obj->mode == 6))) { + if (vis == 1) { + OPM_WriteString((CHAR*)"import ", (LONGINT)8); + } else if (obj->vis == 0) { + OPM_WriteString((CHAR*)"static ", (LONGINT)8); + } else { + OPM_WriteString((CHAR*)"export ", (LONGINT)8); + } + OPC_ProcHeader(obj, 0); + } + OPC_ProcPredefs(obj->right, vis); + } +} + +static void OPC_Include (CHAR *name, LONGINT name__len) +{ + __DUP(name, name__len, CHAR); + OPM_WriteString((CHAR*)"#include ", (LONGINT)10); + OPM_Write('\"'); + OPM_WriteStringVar((void*)name, name__len); + OPM_WriteString((CHAR*)".h", (LONGINT)3); + OPM_Write('\"'); + OPM_WriteLn(); + __DEL(name); +} + +static void OPC_IncludeImports (OPT_Object obj, INTEGER vis) +{ + if (obj != NIL) { + OPC_IncludeImports(obj->left, vis); + if ((((obj->mode == 11 && obj->mnolev != 0)) && (int)OPT_GlbMod[__X(-obj->mnolev, ((LONGINT)(64)))]->vis >= vis)) { + OPC_Include(OPT_GlbMod[__X(-obj->mnolev, ((LONGINT)(64)))]->name, ((LONGINT)(256))); + } + OPC_IncludeImports(obj->right, vis); + } +} + +static void OPC_GenDynTypes (OPT_Node n, INTEGER vis) +{ + OPT_Struct typ = NIL; + while ((n != NIL && n->class == 14)) { + typ = n->typ; + if (vis == 0 || typ->ref < 255) { + OPC_BegStat(); + if (vis == 1) { + OPM_WriteString((CHAR*)"import ", (LONGINT)8); + } else if ((typ->strobj != NIL && typ->strobj->mnolev > 0)) { + OPM_WriteString((CHAR*)"static ", (LONGINT)8); + } else { + OPM_WriteString((CHAR*)"export ", (LONGINT)8); + } + OPM_WriteString((CHAR*)"LONGINT *", (LONGINT)10); + OPC_Andent(typ); + OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPC_EndStat(); + } + n = n->link; + } +} + +void OPC_GenHdr (OPT_Node n) +{ + OPM_currFile = 0; + OPC_DefAnonRecs(n); + OPC_TypeDefs(OPT_topScope->right, 1); + OPM_WriteLn(); + OPC_IdentList(OPT_topScope->scope, 1); + OPM_WriteLn(); + OPC_GenDynTypes(n, 1); + OPM_WriteLn(); + OPC_ProcPredefs(OPT_topScope->right, 1); + OPM_WriteString((CHAR*)"import ", (LONGINT)8); + OPM_WriteString((CHAR*)"void *", (LONGINT)7); + OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); + OPM_WriteString(OPC_BodyNameExt, ((LONGINT)(13))); + OPC_EndStat(); + OPM_WriteLn(); + OPC_CProcDefs(OPT_topScope->right, 1); + OPM_WriteLn(); + OPM_WriteString((CHAR*)"#endif", (LONGINT)7); + OPM_WriteLn(); +} + +static void OPC_GenHeaderMsg (void) +{ + INTEGER i; + OPM_WriteString((CHAR*)"/*", (LONGINT)3); + OPM_WriteString((CHAR*)" voc ", (LONGINT)6); + OPM_Write(' '); + OPM_WriteString((CHAR*)"1.2 [2016/06/15] for gcc LP64 on cygwin", (LONGINT)40); + OPM_Write(' '); + i = 0; + while (i <= 63) { + if (__IN(i, OPM_glbopt)) { + switch (i) { + case 0: + OPM_Write('x'); + break; + case 2: + OPM_Write('r'); + break; + case 3: + OPM_Write('t'); + break; + case 4: + OPM_Write('s'); + break; + case 5: + OPM_Write('p'); + break; + case 6: + OPM_Write('k'); + break; + case 7: + OPM_Write('a'); + break; + case 9: + OPM_Write('e'); + break; + case 10: + OPM_Write('m'); + break; + case 13: + OPM_Write('S'); + break; + case 14: + OPM_Write('c'); + break; + case 15: + OPM_Write('M'); + break; + case 16: + OPM_Write('f'); + break; + case 17: + OPM_Write('F'); + break; + case 18: + OPM_Write('v'); + break; + default: + OPM_LogWStr((CHAR*)"( more options defined in OPM than checked in OPC.GenHeaderMsg, if you are a compiler developer, add them to OPC.GenHeaderMsg", (LONGINT)126); + OPM_LogWLn(); + break; + } + } + i += 1; + } + OPM_WriteString((CHAR*)" */", (LONGINT)4); + OPM_WriteLn(); +} + +void OPC_GenHdrIncludes (void) +{ + OPM_currFile = 2; + OPC_GenHeaderMsg(); + OPM_WriteLn(); + OPM_WriteString((CHAR*)"#ifndef ", (LONGINT)9); + OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); + OPM_WriteString((CHAR*)"__h", (LONGINT)4); + OPM_WriteLn(); + OPM_WriteString((CHAR*)"#define ", (LONGINT)9); + OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); + OPM_WriteString((CHAR*)"__h", (LONGINT)4); + OPM_WriteLn(); + OPM_WriteLn(); + if (OPM_LIntSize == 8) { + OPM_WriteString((CHAR*)"#define LARGE", (LONGINT)14); + OPM_WriteLn(); + } + OPC_Include((CHAR*)"SYSTEM", (LONGINT)7); + OPC_IncludeImports(OPT_topScope->right, 1); + OPM_WriteLn(); +} + +void OPC_GenBdy (OPT_Node n) +{ + OPM_currFile = 1; + OPC_GenHeaderMsg(); + if (OPM_LIntSize == 8) { + OPM_WriteString((CHAR*)"#define LARGE", (LONGINT)14); + OPM_WriteLn(); + } + OPC_Include((CHAR*)"SYSTEM", (LONGINT)7); + OPC_IncludeImports(OPT_topScope->right, 0); + OPM_WriteLn(); + OPC_DefAnonRecs(n); + OPC_TypeDefs(OPT_topScope->right, 0); + OPM_WriteLn(); + OPC_IdentList(OPT_topScope->scope, 0); + OPM_WriteLn(); + OPC_GenDynTypes(n, 0); + OPM_WriteLn(); + OPC_ProcPredefs(OPT_topScope->right, 0); + OPM_WriteLn(); + OPC_CProcDefs(OPT_topScope->right, 0); + OPM_WriteLn(); +} + +static void OPC_RegCmds (OPT_Object obj) +{ + if (obj != NIL) { + OPC_RegCmds(obj->left); + if ((obj->mode == 7 && obj->history != 4)) { + if ((((obj->vis != 0 && obj->link == NIL)) && obj->typ == OPT_notyp)) { + OPC_BegStat(); + OPM_WriteString((CHAR*)"__REGCMD(\"", (LONGINT)11); + OPM_WriteStringVar((void*)obj->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"\", ", (LONGINT)4); + OPC_Ident(obj); + OPM_Write(')'); + OPC_EndStat(); + } + } + OPC_RegCmds(obj->right); + } +} + +static void OPC_InitImports (OPT_Object obj) +{ + if (obj != NIL) { + OPC_InitImports(obj->left); + if ((obj->mode == 11 && obj->mnolev != 0)) { + OPC_BegStat(); + OPM_WriteString((CHAR*)"__MODULE_IMPORT(", (LONGINT)17); + OPM_WriteStringVar((void*)OPT_GlbMod[__X(-obj->mnolev, ((LONGINT)(64)))]->name, ((LONGINT)(256))); + OPM_Write(')'); + OPC_EndStat(); + } + OPC_InitImports(obj->right); + } +} + +void OPC_GenEnumPtrs (OPT_Object var) +{ + OPT_Struct typ = NIL; + LONGINT n; + OPC_GlbPtrs = 0; + while (var != NIL) { + typ = var->typ; + if (OPC_NofPtrs(typ) > 0) { + if (!OPC_GlbPtrs) { + OPC_GlbPtrs = 1; + OPM_WriteString((CHAR*)"static ", (LONGINT)8); + if (OPC_ansi) { + OPM_WriteString((CHAR*)"void EnumPtrs(void (*P)(void*))", (LONGINT)32); + } else { + OPM_WriteString((CHAR*)"void EnumPtrs(P)", (LONGINT)17); + OPM_WriteLn(); + OPM_Write(0x09); + OPM_WriteString((CHAR*)"void (*P)();", (LONGINT)13); + } + OPM_WriteLn(); + OPC_BegBlk(); + } + OPC_BegStat(); + if (typ->form == 13) { + OPM_WriteString((CHAR*)"P(", (LONGINT)3); + OPC_Ident(var); + OPM_Write(')'); + } else if (typ->comp == 4) { + OPM_WriteString((CHAR*)"__ENUMR(&", (LONGINT)10); + OPC_Ident(var); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPC_Andent(typ); + OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPC_Str1((CHAR*)", #", (LONGINT)4, typ->size); + OPM_WriteString((CHAR*)", 1, P)", (LONGINT)8); + } else if (typ->comp == 2) { + n = typ->n; + typ = typ->BaseTyp; + while (typ->comp == 2) { + n = n * typ->n; + typ = typ->BaseTyp; + } + if (typ->form == 13) { + OPM_WriteString((CHAR*)"__ENUMP(", (LONGINT)9); + OPC_Ident(var); + OPC_Str1((CHAR*)", #, P)", (LONGINT)8, n); + } else if (typ->comp == 4) { + OPM_WriteString((CHAR*)"__ENUMR(", (LONGINT)9); + OPC_Ident(var); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPC_Andent(typ); + OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPC_Str1((CHAR*)", #", (LONGINT)4, typ->size); + OPC_Str1((CHAR*)", #, P)", (LONGINT)8, n); + } + } + OPC_EndStat(); + } + var = var->link; + } + if (OPC_GlbPtrs) { + OPC_EndBlk(); + OPM_WriteLn(); + } +} + +void OPC_EnterBody (void) +{ + OPM_WriteLn(); + OPM_WriteString((CHAR*)"export ", (LONGINT)8); + if (OPC_mainprog) { + if (OPC_ansi) { + OPM_WriteString((CHAR*)"int main(int argc, char **argv)", (LONGINT)32); + OPM_WriteLn(); + } else { + OPM_WriteString((CHAR*)"main(argc, argv)", (LONGINT)17); + OPM_WriteLn(); + OPM_Write(0x09); + OPM_WriteString((CHAR*)"int argc; char **argv;", (LONGINT)23); + OPM_WriteLn(); + } + } else { + OPM_WriteString((CHAR*)"void *", (LONGINT)7); + OPM_WriteString(OPM_modName, ((LONGINT)(32))); + OPM_WriteString(OPC_BodyNameExt, ((LONGINT)(13))); + OPM_WriteLn(); + } + OPC_BegBlk(); + OPC_BegStat(); + if (OPC_mainprog) { + OPM_WriteString((CHAR*)"__INIT(argc, argv)", (LONGINT)19); + } else { + OPM_WriteString((CHAR*)"__DEFMOD", (LONGINT)9); + } + OPC_EndStat(); + if ((OPC_mainprog && 0)) { + OPC_BegStat(); + OPM_WriteString((CHAR*)"/*don`t do it!*/ printf(\"DEMO VERSION: DO NOT USE THIS PROGRAM FOR ANY COMMERCIAL PURPOSE\\n\")", (LONGINT)94); + OPC_EndStat(); + } + OPC_InitImports(OPT_topScope->right); + OPC_BegStat(); + if (OPC_mainprog) { + OPM_WriteString((CHAR*)"__REGMAIN(\"", (LONGINT)12); + } else { + OPM_WriteString((CHAR*)"__REGMOD(\"", (LONGINT)11); + } + OPM_WriteString(OPM_modName, ((LONGINT)(32))); + if (OPC_GlbPtrs) { + OPM_WriteString((CHAR*)"\", EnumPtrs)", (LONGINT)13); + } else { + OPM_WriteString((CHAR*)"\", 0)", (LONGINT)6); + } + OPC_EndStat(); + if (__STRCMP(OPM_modName, "SYSTEM") != 0) { + OPC_RegCmds(OPT_topScope); + } +} + +void OPC_ExitBody (void) +{ + OPC_BegStat(); + if (OPC_mainprog) { + OPM_WriteString((CHAR*)"__FINI;", (LONGINT)8); + } else { + OPM_WriteString((CHAR*)"__ENDMOD;", (LONGINT)10); + } + OPM_WriteLn(); + OPC_EndBlk(); +} + +void OPC_DefineInter (OPT_Object proc) +{ + OPT_Object scope = NIL; + scope = proc->scope; + OPM_WriteString((CHAR*)"static ", (LONGINT)8); + OPM_WriteString((CHAR*)"struct ", (LONGINT)8); + OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); + OPM_Write(' '); + OPC_BegBlk(); + OPC_IdentList(proc->link, 3); + OPC_IdentList(scope->scope, 3); + OPC_BegStat(); + OPM_WriteString((CHAR*)"struct ", (LONGINT)8); + OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); + OPM_Write(' '); + OPM_Write('*'); + OPM_WriteString((CHAR*)"lnk", (LONGINT)4); + OPC_EndStat(); + OPC_EndBlk0(); + OPM_Write(' '); + OPM_Write('*'); + OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPC_EndStat(); + OPM_WriteLn(); + OPC_ProcPredefs(scope->right, 0); + OPM_WriteLn(); +} + +void OPC_EnterProc (OPT_Object proc) +{ + OPT_Object var = NIL, scope = NIL; + OPT_Struct typ = NIL; + INTEGER dim; + if (proc->vis != 1) { + OPM_WriteString((CHAR*)"static ", (LONGINT)8); + } + OPC_ProcHeader(proc, 1); + OPC_BegBlk(); + if (proc->typ != OPT_notyp) { + OPC_BegStat(); + OPC_Ident(proc->typ->strobj); + OPM_WriteString((CHAR*)" _o_result;", (LONGINT)12); + OPM_WriteLn(); + } + scope = proc->scope; + OPC_IdentList(scope->scope, 0); + if (!scope->leaf) { + OPC_BegStat(); + OPM_WriteString((CHAR*)"struct ", (LONGINT)8); + OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); + OPM_Write(' '); + OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPC_EndStat(); + } + var = proc->link; + while (var != NIL) { + if ((var->typ->comp == 2 && var->mode == 1)) { + OPC_BegStat(); + if (var->typ->strobj == NIL) { + OPM_Mark(200, var->typ->txtpos); + } else { + OPC_Ident(var->typ->strobj); + } + OPM_Write(' '); + OPC_Ident(var); + OPM_WriteString((CHAR*)"__copy", (LONGINT)7); + OPC_EndStat(); + } + var = var->link; + } + if (!OPC_ansi) { + var = proc->link; + while (var != NIL) { + if ((var->typ->form == 7 && var->mode == 1)) { + OPC_BegStat(); + OPC_Ident(var->typ->strobj); + OPM_Write(' '); + OPC_Ident(var); + OPM_WriteString((CHAR*)" = _", (LONGINT)5); + OPC_Ident(var); + OPC_EndStat(); + } + var = var->link; + } + } + var = proc->link; + while (var != NIL) { + if ((((__IN(var->typ->comp, 0x0c) && var->mode == 1)) && var->typ->sysflag == 0)) { + OPC_BegStat(); + if (var->typ->comp == 2) { + OPM_WriteString((CHAR*)"__DUPARR(", (LONGINT)10); + OPC_Ident(var); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + if (var->typ->strobj == NIL) { + OPM_Mark(200, var->typ->txtpos); + } else { + OPC_Ident(var->typ->strobj); + } + } else { + OPM_WriteString((CHAR*)"__DUP(", (LONGINT)7); + OPC_Ident(var); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPC_Ident(var); + OPM_WriteString((CHAR*)"__len", (LONGINT)6); + typ = var->typ->BaseTyp; + dim = 1; + while (typ->comp == 3) { + OPM_WriteString((CHAR*)" * ", (LONGINT)4); + OPC_Ident(var); + OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteInt(dim); + typ = typ->BaseTyp; + dim += 1; + } + OPM_WriteString((CHAR*)", ", (LONGINT)3); + if (typ->strobj == NIL) { + OPM_Mark(200, typ->txtpos); + } else { + OPC_Ident(typ->strobj); + } + } + OPM_Write(')'); + OPC_EndStat(); + } + var = var->link; + } + if (!scope->leaf) { + var = proc->link; + while (var != NIL) { + if (!var->leaf) { + OPC_BegStat(); + OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_Write('.'); + OPC_Ident(var); + OPM_WriteString((CHAR*)" = ", (LONGINT)4); + if (__IN(var->typ->comp, 0x0c)) { + OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + } else if (var->mode != 2) { + OPM_Write('&'); + } + OPC_Ident(var); + if (var->typ->comp == 3) { + typ = var->typ; + dim = 0; + do { + OPM_WriteString((CHAR*)"; ", (LONGINT)3); + OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_Write('.'); + OPC_Ident(var); + OPM_WriteString((CHAR*)"__len", (LONGINT)6); + if (dim != 0) { + OPM_WriteInt(dim); + } + OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPC_Ident(var); + OPM_WriteString((CHAR*)"__len", (LONGINT)6); + if (dim != 0) { + OPM_WriteInt(dim); + } + typ = typ->BaseTyp; + } while (!(typ->comp != 3)); + } else if ((var->mode == 2 && var->typ->comp == 4)) { + OPM_WriteString((CHAR*)"; ", (LONGINT)3); + OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_Write('.'); + OPC_Ident(var); + OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPC_Ident(var); + OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + } + OPC_EndStat(); + } + var = var->link; + } + var = scope->scope; + while (var != NIL) { + if (!var->leaf) { + OPC_BegStat(); + OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_Write('.'); + OPC_Ident(var); + OPM_WriteString((CHAR*)" = ", (LONGINT)4); + if (var->typ->comp != 2) { + OPM_Write('&'); + } else { + OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + } + OPC_Ident(var); + OPC_EndStat(); + } + var = var->link; + } + OPC_BegStat(); + OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_Write('.'); + OPM_WriteString((CHAR*)"lnk", (LONGINT)4); + OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPC_EndStat(); + OPC_BegStat(); + OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_Write('&'); + OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPC_EndStat(); + } +} + +void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet) +{ + OPT_Object var = NIL; + BOOLEAN indent; + indent = eoBlock; + if ((implicitRet && proc->typ != OPT_notyp)) { + OPM_Write(0x09); + OPM_WriteString((CHAR*)"__RETCHK;", (LONGINT)10); + OPM_WriteLn(); + } else if (!eoBlock || implicitRet) { + if (!proc->scope->leaf) { + if (indent) { + OPC_BegStat(); + } else { + indent = 1; + } + OPM_WriteStringVar((void*)proc->scope->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_Write('.'); + OPM_WriteString((CHAR*)"lnk", (LONGINT)4); + OPC_EndStat(); + } + var = proc->link; + while (var != NIL) { + if ((((var->typ->comp == 3 && var->mode == 1)) && var->typ->sysflag == 0)) { + if (indent) { + OPC_BegStat(); + } else { + indent = 1; + } + OPM_WriteString((CHAR*)"__DEL(", (LONGINT)7); + OPC_Ident(var); + OPM_Write(')'); + OPC_EndStat(); + } + var = var->link; + } + } + if (eoBlock) { + OPC_EndBlk(); + OPM_WriteLn(); + } else if (indent) { + OPC_BegStat(); + } +} + +void OPC_CompleteIdent (OPT_Object obj) +{ + INTEGER comp, level; + level = obj->mnolev; + if (obj->adr == 1) { + if (obj->typ->comp == 4) { + OPC_Ident(obj); + OPM_WriteString((CHAR*)"__", (LONGINT)3); + } else { + OPM_WriteString((CHAR*)"((", (LONGINT)3); + OPC_Ident(obj->typ->strobj); + OPM_Write(')'); + OPC_Ident(obj); + OPM_Write(')'); + } + } else if ((level != OPM_level && level > 0)) { + comp = obj->typ->comp; + if ((obj->mode != 2 && comp != 3)) { + OPM_Write('*'); + } + OPM_WriteStringVar((void*)obj->scope->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"->", (LONGINT)3); + OPC_Ident(obj); + } else { + OPC_Ident(obj); + } +} + +void OPC_TypeOf (OPT_Object ap) +{ + INTEGER i; + __ASSERT(ap->typ->comp == 4, 0); + if (ap->mode == 2) { + if ((int)ap->mnolev != OPM_level) { + OPM_WriteStringVar((void*)ap->scope->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"_s->", (LONGINT)5); + OPC_Ident(ap); + } else { + OPC_Ident(ap); + } + OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + } else if (ap->typ->strobj != NIL) { + OPC_Ident(ap->typ->strobj); + OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + } else { + OPC_Andent(ap->typ); + } +} + +void OPC_Cmp (INTEGER rel) +{ + switch (rel) { + case 9: + OPM_WriteString((CHAR*)" == ", (LONGINT)5); + break; + case 10: + OPM_WriteString((CHAR*)" != ", (LONGINT)5); + break; + case 11: + OPM_WriteString((CHAR*)" < ", (LONGINT)4); + break; + case 12: + OPM_WriteString((CHAR*)" <= ", (LONGINT)5); + break; + case 13: + OPM_WriteString((CHAR*)" > ", (LONGINT)4); + break; + case 14: + OPM_WriteString((CHAR*)" >= ", (LONGINT)5); + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPC.Cmp, rel = ", (LONGINT)34); + OPM_LogWNum(rel, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } +} + +void OPC_Case (LONGINT caseVal, INTEGER form) +{ + CHAR ch; + OPM_WriteString((CHAR*)"case ", (LONGINT)6); + switch (form) { + case 3: + ch = (CHAR)caseVal; + if ((ch >= ' ' && ch <= '~')) { + OPM_Write('\''); + if (((ch == '\\' || ch == '\?') || ch == '\'') || ch == '\"') { + OPM_Write('\\'); + OPM_Write(ch); + } else { + OPM_Write(ch); + } + OPM_Write('\''); + } else { + OPM_WriteString((CHAR*)"0x", (LONGINT)3); + OPM_WriteHex(caseVal); + } + break; + case 4: case 5: case 6: + OPM_WriteInt(caseVal); + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPC.Case, form = ", (LONGINT)36); + OPM_LogWNum(form, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + OPM_WriteString((CHAR*)": ", (LONGINT)3); +} + +void OPC_SetInclude (BOOLEAN exclude) +{ + if (exclude) { + OPM_WriteString((CHAR*)" &= ~", (LONGINT)6); + } else { + OPM_WriteString((CHAR*)" |= ", (LONGINT)5); + } +} + +void OPC_Increment (BOOLEAN decrement) +{ + if (decrement) { + OPM_WriteString((CHAR*)" -= ", (LONGINT)5); + } else { + OPM_WriteString((CHAR*)" += ", (LONGINT)5); + } +} + +void OPC_Halt (LONGINT n) +{ + OPC_Str1((CHAR*)"__HALT(#)", (LONGINT)10, n); +} + +void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim) +{ + if (array->comp == 3) { + OPC_CompleteIdent(obj); + OPM_WriteString((CHAR*)"__len", (LONGINT)6); + if (dim != 0) { + OPM_WriteInt(dim); + } + } else { + while (dim > 0) { + array = array->BaseTyp; + dim -= 1; + } + OPM_WriteString((CHAR*)"((LONGINT)(", (LONGINT)12); + OPM_WriteInt(array->n); + OPM_WriteString((CHAR*)"))", (LONGINT)3); + } +} + +void OPC_Constant (OPT_Const con, INTEGER form) +{ + INTEGER i, len; + CHAR ch; + SET s; + LONGINT hex; + BOOLEAN skipLeading; + switch (form) { + case 1: + OPM_WriteInt(con->intval); + break; + case 2: + OPM_WriteInt(con->intval); + break; + case 3: + ch = (CHAR)con->intval; + if ((ch >= ' ' && ch <= '~')) { + OPM_Write('\''); + if (((ch == '\\' || ch == '\?') || ch == '\'') || ch == '\"') { + OPM_Write('\\'); + } + OPM_Write(ch); + OPM_Write('\''); + } else { + OPM_WriteString((CHAR*)"0x", (LONGINT)3); + OPM_WriteHex(con->intval); + } + break; + case 4: case 5: case 6: + OPM_WriteInt(con->intval); + break; + case 7: + OPM_WriteReal(con->realval, 'f'); + break; + case 8: + OPM_WriteReal(con->realval, 0x00); + break; + case 9: + OPM_WriteString((CHAR*)"0x", (LONGINT)3); + skipLeading = 1; + s = con->setval; + i = 64; + do { + hex = 0; + do { + i -= 1; + hex = __ASHL(hex, 1); + if (__IN(i, s)) { + hex += 1; + } + } while (!(__MASK(i, -8) == 0)); + if (hex != 0 || !skipLeading) { + OPM_WriteHex(hex); + skipLeading = 0; + } + } while (!(i == 0)); + if (skipLeading) { + OPM_Write('0'); + } + break; + case 10: + OPM_Write('\"'); + len = (int)con->intval2 - 1; + i = 0; + while (i < len) { + ch = (*con->ext)[__X(i, ((LONGINT)(256)))]; + if (((ch == '\\' || ch == '\?') || ch == '\'') || ch == '\"') { + OPM_Write('\\'); + } + OPM_Write(ch); + i += 1; + } + OPM_Write('\"'); + break; + case 11: + OPM_WriteString((CHAR*)"NIL", (LONGINT)4); + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPC.Constant, form = ", (LONGINT)40); + OPM_LogWNum(form, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } +} + +static struct InitKeywords__47 { + SHORTINT *n; + struct InitKeywords__47 *lnk; +} *InitKeywords__47_s; + +static void Enter__48 (CHAR *s, LONGINT s__len); + +static void Enter__48 (CHAR *s, LONGINT s__len) +{ + INTEGER h; + __DUP(s, s__len, CHAR); + h = OPC_PerfectHash((void*)s, s__len); + OPC_hashtab[__X(h, ((LONGINT)(105)))] = *InitKeywords__47_s->n; + __COPY(s, OPC_keytab[__X(*InitKeywords__47_s->n, ((LONGINT)(36)))], ((LONGINT)(9))); + *InitKeywords__47_s->n += 1; + __DEL(s); +} + +static void OPC_InitKeywords (void) +{ + SHORTINT n, i; + struct InitKeywords__47 _s; + _s.n = &n; + _s.lnk = InitKeywords__47_s; + InitKeywords__47_s = &_s; + n = 0; + i = 0; + while (i <= 104) { + OPC_hashtab[__X(i, ((LONGINT)(105)))] = -1; + i += 1; + } + Enter__48((CHAR*)"asm", (LONGINT)4); + Enter__48((CHAR*)"auto", (LONGINT)5); + Enter__48((CHAR*)"break", (LONGINT)6); + Enter__48((CHAR*)"case", (LONGINT)5); + Enter__48((CHAR*)"char", (LONGINT)5); + Enter__48((CHAR*)"const", (LONGINT)6); + Enter__48((CHAR*)"continue", (LONGINT)9); + Enter__48((CHAR*)"default", (LONGINT)8); + Enter__48((CHAR*)"do", (LONGINT)3); + Enter__48((CHAR*)"double", (LONGINT)7); + Enter__48((CHAR*)"else", (LONGINT)5); + Enter__48((CHAR*)"enum", (LONGINT)5); + Enter__48((CHAR*)"extern", (LONGINT)7); + Enter__48((CHAR*)"export", (LONGINT)7); + Enter__48((CHAR*)"float", (LONGINT)6); + Enter__48((CHAR*)"for", (LONGINT)4); + Enter__48((CHAR*)"fortran", (LONGINT)8); + Enter__48((CHAR*)"goto", (LONGINT)5); + Enter__48((CHAR*)"if", (LONGINT)3); + Enter__48((CHAR*)"import", (LONGINT)7); + Enter__48((CHAR*)"int", (LONGINT)4); + Enter__48((CHAR*)"long", (LONGINT)5); + Enter__48((CHAR*)"register", (LONGINT)9); + Enter__48((CHAR*)"return", (LONGINT)7); + Enter__48((CHAR*)"short", (LONGINT)6); + Enter__48((CHAR*)"signed", (LONGINT)7); + Enter__48((CHAR*)"sizeof", (LONGINT)7); + Enter__48((CHAR*)"static", (LONGINT)7); + Enter__48((CHAR*)"struct", (LONGINT)7); + Enter__48((CHAR*)"switch", (LONGINT)7); + Enter__48((CHAR*)"typedef", (LONGINT)8); + Enter__48((CHAR*)"union", (LONGINT)6); + Enter__48((CHAR*)"unsigned", (LONGINT)9); + Enter__48((CHAR*)"void", (LONGINT)5); + Enter__48((CHAR*)"volatile", (LONGINT)9); + Enter__48((CHAR*)"while", (LONGINT)6); + InitKeywords__47_s = _s.lnk; +} + + +export void *OPC__init(void) +{ + __DEFMOD; + __MODULE_IMPORT(Configuration); + __MODULE_IMPORT(OPM); + __MODULE_IMPORT(OPT); + __REGMOD("OPC", 0); + __REGCMD("BegBlk", OPC_BegBlk); + __REGCMD("BegStat", OPC_BegStat); + __REGCMD("EndBlk", OPC_EndBlk); + __REGCMD("EndBlk0", OPC_EndBlk0); + __REGCMD("EndStat", OPC_EndStat); + __REGCMD("EnterBody", OPC_EnterBody); + __REGCMD("ExitBody", OPC_ExitBody); + __REGCMD("GenHdrIncludes", OPC_GenHdrIncludes); + __REGCMD("Init", OPC_Init); +/* BEGIN */ + OPC_InitKeywords(); + __ENDMOD; +} diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h new file mode 100644 index 00000000..a91a3810 --- /dev/null +++ b/bootstrap/windows-88/OPC.h @@ -0,0 +1,50 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ + +#ifndef OPC__h +#define OPC__h + +#define LARGE +#include "SYSTEM.h" +#include "OPT.h" + + + + +import void OPC_Align (LONGINT *adr, LONGINT base); +import void OPC_Andent (OPT_Struct typ); +import LONGINT OPC_Base (OPT_Struct typ); +import OPT_Object OPC_BaseTProc (OPT_Object obj); +import void OPC_BegBlk (void); +import void OPC_BegStat (void); +import void OPC_Case (LONGINT caseVal, INTEGER form); +import void OPC_Cmp (INTEGER rel); +import void OPC_CompleteIdent (OPT_Object obj); +import void OPC_Constant (OPT_Const con, INTEGER form); +import void OPC_DefineInter (OPT_Object proc); +import void OPC_EndBlk (void); +import void OPC_EndBlk0 (void); +import void OPC_EndStat (void); +import void OPC_EnterBody (void); +import void OPC_EnterProc (OPT_Object proc); +import void OPC_ExitBody (void); +import void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet); +import void OPC_GenBdy (OPT_Node n); +import void OPC_GenEnumPtrs (OPT_Object var); +import void OPC_GenHdr (OPT_Node n); +import void OPC_GenHdrIncludes (void); +import void OPC_Halt (LONGINT n); +import void OPC_Ident (OPT_Object obj); +import void OPC_Increment (BOOLEAN decrement); +import void OPC_Indent (INTEGER count); +import void OPC_Init (void); +import void OPC_InitTDesc (OPT_Struct typ); +import void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim); +import LONGINT OPC_NofPtrs (OPT_Struct typ); +import void OPC_SetInclude (BOOLEAN exclude); +import void OPC_TDescDecl (OPT_Struct typ); +import void OPC_TypeDefs (OPT_Object obj, INTEGER vis); +import void OPC_TypeOf (OPT_Object ap); +import void *OPC__init(void); + + +#endif diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c new file mode 100644 index 00000000..798fb492 --- /dev/null +++ b/bootstrap/windows-88/OPM.c @@ -0,0 +1,1092 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +#define LARGE +#include "SYSTEM.h" +#include "Configuration.h" +#include "Console.h" +#include "Files.h" +#include "Platform.h" +#include "Strings.h" +#include "Texts.h" +#include "errors.h" +#include "vt100.h" + +typedef + CHAR OPM_FileName[32]; + + +static CHAR OPM_SourceFileName[256]; +export INTEGER OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_CharAlign, OPM_BoolAlign, OPM_SIntAlign, OPM_IntAlign, OPM_LIntAlign, OPM_SetAlign, OPM_RealAlign, OPM_LRealAlign, OPM_PointerAlign, OPM_ProcAlign, OPM_RecAlign, OPM_MaxSet; +export LONGINT OPM_MinSInt, OPM_MinInt, OPM_MinLInt, OPM_MaxSInt, OPM_MaxInt, OPM_MaxLInt, OPM_MaxIndex; +export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; +export BOOLEAN OPM_noerr; +export LONGINT OPM_curpos, OPM_errpos, OPM_breakpc; +export INTEGER OPM_currFile, OPM_level, OPM_pc, OPM_entno; +export CHAR OPM_modName[32]; +export CHAR OPM_objname[64]; +export SET OPM_opt, OPM_glbopt; +static LONGINT OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; +static Texts_Reader OPM_inR; +static Texts_Text OPM_Log; +static Texts_Writer OPM_W; +static Files_Rider OPM_oldSF, OPM_newSF; +static Files_Rider OPM_R[3]; +static Files_File OPM_oldSFile, OPM_newSFile, OPM_HFile, OPM_BFile, OPM_HIFile; +static INTEGER OPM_S; +export BOOLEAN OPM_dontAsm, OPM_dontLink, OPM_mainProg, OPM_mainLinkStat, OPM_notColorOutput, OPM_forceNewSym, OPM_Verbose; +static CHAR OPM_OBERON[1024]; +static CHAR OPM_MODULES[1024]; + + +static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F); +export void OPM_CloseFiles (void); +export void OPM_CloseOldSym (void); +export void OPM_DeleteNewSym (void); +export void OPM_FPrint (LONGINT *fp, LONGINT val); +export void OPM_FPrintLReal (LONGINT *fp, LONGREAL lr); +export void OPM_FPrintReal (LONGINT *fp, REAL real); +export void OPM_FPrintSet (LONGINT *fp, SET set); +static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, LONGINT pos); +export void OPM_Get (CHAR *ch); +static void OPM_GetProperties (void); +static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONGINT name__len, INTEGER *size, INTEGER *align); +export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); +export void OPM_InitOptions (void); +static void OPM_LogErrMsg (INTEGER n); +export void OPM_LogW (CHAR ch); +export void OPM_LogWLn (void); +export void OPM_LogWNum (LONGINT i, LONGINT len); +export void OPM_LogWStr (CHAR *s, LONGINT s__len); +static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len); +export void OPM_Mark (INTEGER n, LONGINT pos); +static INTEGER OPM_Min (INTEGER a, INTEGER b); +export void OPM_NewSym (CHAR *modName, LONGINT modName__len); +export void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); +export void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); +export BOOLEAN OPM_OpenPar (void); +export void OPM_RegisterNewSym (void); +static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt); +static void OPM_ShowLine (LONGINT pos); +export void OPM_SymRCh (CHAR *ch); +export LONGINT OPM_SymRInt (void); +export void OPM_SymRLReal (LONGREAL *lr); +export void OPM_SymRReal (REAL *r); +export void OPM_SymRSet (SET *s); +export void OPM_SymWCh (CHAR ch); +export void OPM_SymWInt (LONGINT i); +export void OPM_SymWLReal (LONGREAL lr); +export void OPM_SymWReal (REAL r); +export void OPM_SymWSet (SET s); +static void OPM_VerboseListSizes (void); +export void OPM_Write (CHAR ch); +export void OPM_WriteHex (LONGINT i); +export void OPM_WriteInt (LONGINT i); +export void OPM_WriteLn (void); +export void OPM_WriteReal (LONGREAL r, CHAR suffx); +export void OPM_WriteString (CHAR *s, LONGINT s__len); +export void OPM_WriteStringVar (CHAR *s, LONGINT s__len); +export BOOLEAN OPM_eofSF (void); +export void OPM_err (INTEGER n); +static LONGINT OPM_minus (LONGINT i); +static LONGINT OPM_power0 (LONGINT i, LONGINT j); + + +void OPM_LogW (CHAR ch) +{ + Console_Char(ch); +} + +void OPM_LogWStr (CHAR *s, LONGINT s__len) +{ + __DUP(s, s__len, CHAR); + Console_String(s, s__len); + __DEL(s); +} + +void OPM_LogWNum (LONGINT i, LONGINT len) +{ + Console_Int(i, len); +} + +void OPM_LogWLn (void) +{ + Console_Ln(); +} + +static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) +{ + INTEGER i; + i = 1; + while (s[__X(i, s__len)] != 0x00) { + switch (s[__X(i, s__len)]) { + case 'e': + *opt = *opt ^ 0x0200; + break; + case 's': + *opt = *opt ^ 0x10; + break; + case 'm': + *opt = *opt ^ 0x0400; + break; + case 'x': + *opt = *opt ^ 0x01; + break; + case 'r': + *opt = *opt ^ 0x04; + break; + case 't': + *opt = *opt ^ 0x08; + break; + case 'a': + *opt = *opt ^ 0x80; + break; + case 'k': + *opt = *opt ^ 0x40; + break; + case 'p': + *opt = *opt ^ 0x20; + break; + case 'S': + *opt = *opt ^ 0x2000; + break; + case 'c': + *opt = *opt ^ 0x4000; + break; + case 'M': + *opt = *opt ^ 0x8000; + break; + case 'f': + *opt = *opt ^ 0x010000; + break; + case 'F': + *opt = *opt ^ 0x020000; + break; + case 'V': + *opt = *opt ^ 0x040000; + break; + case 'B': + if (s[__X(i + 1, s__len)] != 0x00) { + i += 1; + OPM_IntSize = (int)s[__X(i, s__len)] - 48; + } + if (s[__X(i + 1, s__len)] != 0x00) { + i += 1; + OPM_PointerSize = (int)s[__X(i, s__len)] - 48; + } + if (s[__X(i + 1, s__len)] != 0x00) { + i += 1; + OPM_Alignment = (int)s[__X(i, s__len)] - 48; + } + __ASSERT(OPM_IntSize == 2 || OPM_IntSize == 4, 0); + __ASSERT(OPM_PointerSize == 4 || OPM_PointerSize == 8, 0); + __ASSERT(OPM_Alignment == 4 || OPM_Alignment == 8, 0); + break; + default: + OPM_LogWStr((CHAR*)" warning: option ", (LONGINT)19); + OPM_LogW('-'); + OPM_LogW(s[__X(i, s__len)]); + OPM_LogWStr((CHAR*)" ignored", (LONGINT)9); + OPM_LogWLn(); + break; + } + i += 1; + } +} + +BOOLEAN OPM_OpenPar (void) +{ + BOOLEAN _o_result; + CHAR s[256]; + if (Platform_ArgCount == 1) { + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Vishap Oberon-2 compiler v", (LONGINT)27); + OPM_LogWStr((CHAR*)"1.2 [2016/06/15] for gcc LP64 on cygwin", (LONGINT)40); + OPM_LogW('.'); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Based on Ofront by Software Templ OEG, continued by Norayr Chilingarian and others.", (LONGINT)84); + OPM_LogWLn(); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Usage:", (LONGINT)7); + OPM_LogWLn(); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" ", (LONGINT)3); + OPM_LogWStr((CHAR*)"voc", (LONGINT)4); + OPM_LogWStr((CHAR*)" options {files {options}}.", (LONGINT)28); + OPM_LogWLn(); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Where options = [\"-\" {option} ].", (LONGINT)33); + OPM_LogWLn(); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" m - generate code for main module", (LONGINT)36); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" M - generate code for main module and link object statically", (LONGINT)63); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" s - generate new symbol file", (LONGINT)31); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" e - allow extending the module interface", (LONGINT)43); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" r - check value ranges", (LONGINT)25); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" x - turn off array indices check", (LONGINT)35); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" a - don\'t check ASSERTs at runtime, use this option in tested production code", (LONGINT)80); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" p - turn off automatic pointer initialization", (LONGINT)48); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" t - don\'t check type guards (use in rare cases such as low-level modules where every cycle counts)", (LONGINT)101); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" S - don\'t call external assembler/compiler, only generate C code", (LONGINT)67); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" c - don\'t call linker", (LONGINT)24); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" f - don\'t use color output", (LONGINT)29); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" F - force writing new symbol file in current directory", (LONGINT)57); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" V - verbose output", (LONGINT)21); + OPM_LogWLn(); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Initial options specify defaults for all files.", (LONGINT)48); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Options following a filename are specific to that file.", (LONGINT)56); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Repeating an option toggles its value.", (LONGINT)39); + OPM_LogWLn(); + _o_result = 0; + return _o_result; + } else { + OPM_S = 1; + s[0] = 0x00; + Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + OPM_glbopt = 0xe9; + while (s[0] == '-') { + OPM_ScanOptions((void*)s, ((LONGINT)(256)), &OPM_glbopt); + OPM_S += 1; + s[0] = 0x00; + Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + } + _o_result = 1; + return _o_result; + } + __RETCHK; +} + +void OPM_InitOptions (void) +{ + CHAR s[256]; + OPM_opt = OPM_glbopt; + s[0] = 0x00; + Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + while (s[0] == '-') { + OPM_ScanOptions((void*)s, ((LONGINT)(256)), &OPM_opt); + OPM_S += 1; + s[0] = 0x00; + Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + } + OPM_dontAsm = __IN(13, OPM_opt); + OPM_dontLink = __IN(14, OPM_opt); + OPM_mainProg = __IN(10, OPM_opt); + OPM_mainLinkStat = __IN(15, OPM_opt); + OPM_notColorOutput = __IN(16, OPM_opt); + OPM_forceNewSym = __IN(17, OPM_opt); + OPM_Verbose = __IN(18, OPM_opt); + if (OPM_mainLinkStat) { + OPM_glbopt |= __SETOF(10); + } + OPM_GetProperties(); +} + +void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len) +{ + Texts_Text T = NIL; + LONGINT beg, end, time; + CHAR s[256]; + *done = 0; + OPM_curpos = 0; + if (OPM_S >= Platform_ArgCount) { + return; + } + s[0] = 0x00; + Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + __NEW(T, Texts_TextDesc); + Texts_Open(T, s, ((LONGINT)(256))); + OPM_LogWStr(s, ((LONGINT)(256))); + OPM_LogWStr((CHAR*)" ", (LONGINT)3); + __COPY(s, mname, mname__len); + __COPY(s, OPM_SourceFileName, ((LONGINT)(256))); + if (T->len == 0) { + OPM_LogWStr(s, ((LONGINT)(256))); + OPM_LogWStr((CHAR*)" not found.", (LONGINT)12); + OPM_LogWLn(); + } else { + Texts_OpenReader(&OPM_inR, Texts_Reader__typ, T, ((LONGINT)(0))); + *done = 1; + } + OPM_S += 1; + OPM_level = 0; + OPM_noerr = 1; + OPM_errpos = OPM_curpos; + OPM_lasterrpos = OPM_curpos - 10; + OPM_ErrorLineStartPos = 0; + OPM_ErrorLineLimitPos = 0; + OPM_ErrorLineNumber = 0; +} + +void OPM_Get (CHAR *ch) +{ + Texts_Read(&OPM_inR, Texts_Reader__typ, &*ch); + if (*ch == 0x0d) { + OPM_curpos = Texts_Pos(&OPM_inR, Texts_Reader__typ); + } else { + OPM_curpos += 1; + } + if ((*ch < 0x09 && !OPM_inR.eot)) { + *ch = ' '; + } +} + +static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len) +{ + INTEGER i, j; + CHAR ch; + __DUP(ext, ext__len, CHAR); + i = 0; + for (;;) { + ch = name[__X(i, name__len)]; + if (ch == 0x00) { + break; + } + FName[__X(i, FName__len)] = ch; + i += 1; + } + j = 0; + do { + ch = ext[__X(j, ext__len)]; + FName[__X(i, FName__len)] = ch; + i += 1; + j += 1; + } while (!(ch == 0x00)); + __DEL(ext); +} + +static void OPM_LogErrMsg (INTEGER n) +{ + Texts_Scanner S; + Texts_Text T = NIL; + CHAR ch; + INTEGER i; + CHAR buf[1024]; + if (n >= 0) { + if (!OPM_notColorOutput) { + vt100_SetAttr((CHAR*)"31m", (LONGINT)4); + } + OPM_LogWStr((CHAR*)" err ", (LONGINT)7); + if (!OPM_notColorOutput) { + vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + } + } else { + if (!OPM_notColorOutput) { + vt100_SetAttr((CHAR*)"35m", (LONGINT)4); + } + OPM_LogWStr((CHAR*)" warning ", (LONGINT)11); + n = -n; + if (!OPM_notColorOutput) { + vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + } + } + OPM_LogWNum(n, ((LONGINT)(1))); + OPM_LogWStr((CHAR*)" ", (LONGINT)3); + OPM_LogWStr(errors_errors[__X(n, ((LONGINT)(350)))], ((LONGINT)(128))); +} + +static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, LONGINT pos) +{ + CHAR ch, cheol; + if (pos < OPM_ErrorLineStartPos) { + OPM_ErrorLineStartPos = 0; + OPM_ErrorLineLimitPos = 0; + OPM_ErrorLineNumber = 0; + } + if (pos < OPM_ErrorLineLimitPos) { + Files_Set(&*r, r__typ, f, OPM_ErrorLineStartPos); + return; + } + Files_Set(&*r, r__typ, f, OPM_ErrorLineLimitPos); + Files_Read(&*r, r__typ, (void*)&ch); + while ((OPM_ErrorLineLimitPos < pos && !(*r).eof)) { + OPM_ErrorLineStartPos = OPM_ErrorLineLimitPos; + OPM_ErrorLineNumber += 1; + while ((((ch != 0x00 && ch != 0x0d)) && ch != 0x0a)) { + Files_Read(&*r, r__typ, (void*)&ch); + OPM_ErrorLineLimitPos += 1; + } + cheol = ch; + Files_Read(&*r, r__typ, (void*)&ch); + OPM_ErrorLineLimitPos += 1; + if ((cheol == 0x0d && ch == 0x0a)) { + OPM_ErrorLineLimitPos += 1; + Files_Read(&*r, r__typ, (void*)&ch); + } + } + Files_Set(&*r, r__typ, f, OPM_ErrorLineStartPos); +} + +static void OPM_ShowLine (LONGINT pos) +{ + Files_File f = NIL; + Files_Rider r; + CHAR line[1023]; + INTEGER i; + CHAR ch; + f = Files_Old(OPM_SourceFileName, ((LONGINT)(256))); + OPM_FindLine(f, &r, Files_Rider__typ, pos); + i = 0; + Files_Read(&r, Files_Rider__typ, (void*)&ch); + while ((((((ch != 0x00 && ch != 0x0d)) && ch != 0x0a)) && i < 1022)) { + line[__X(i, ((LONGINT)(1023)))] = ch; + i += 1; + Files_Read(&r, Files_Rider__typ, (void*)&ch); + } + line[__X(i, ((LONGINT)(1023)))] = 0x00; + OPM_LogWLn(); + OPM_LogWLn(); + OPM_LogWNum(OPM_ErrorLineNumber, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)": ", (LONGINT)3); + OPM_LogWStr(line, ((LONGINT)(1023))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" ", (LONGINT)7); + if (pos >= OPM_ErrorLineLimitPos) { + pos = OPM_ErrorLineLimitPos - 1; + } + i = (int)(pos - OPM_ErrorLineStartPos); + while (i > 0) { + OPM_LogW(' '); + i -= 1; + } + if (!OPM_notColorOutput) { + vt100_SetAttr((CHAR*)"32m", (LONGINT)4); + } + OPM_LogW('^'); + if (!OPM_notColorOutput) { + vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + } + Files_Close(f); +} + +void OPM_Mark (INTEGER n, LONGINT pos) +{ + if (pos == -1) { + pos = 0; + } + if (n >= 0) { + OPM_noerr = 0; + if (pos < OPM_lasterrpos || OPM_lasterrpos + 9 < pos) { + OPM_lasterrpos = pos; + OPM_ShowLine(pos); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" ", (LONGINT)3); + if (n < 249) { + OPM_LogWStr((CHAR*)" pos", (LONGINT)6); + OPM_LogWNum(pos, ((LONGINT)(6))); + OPM_LogErrMsg(n); + } else if (n == 255) { + OPM_LogWStr((CHAR*)"pos", (LONGINT)4); + OPM_LogWNum(pos, ((LONGINT)(6))); + OPM_LogWStr((CHAR*)" pc ", (LONGINT)6); + OPM_LogWNum(OPM_breakpc, ((LONGINT)(1))); + } else if (n == 254) { + OPM_LogWStr((CHAR*)"pc not found", (LONGINT)13); + } else { + OPM_LogWStr(OPM_objname, ((LONGINT)(64))); + if (n == 253) { + OPM_LogWStr((CHAR*)" is new, compile with option e", (LONGINT)31); + } else if (n == 252) { + OPM_LogWStr((CHAR*)" is redefined, compile with option s", (LONGINT)37); + } else if (n == 251) { + OPM_LogWStr((CHAR*)" is redefined (private part only), compile with option s", (LONGINT)57); + } else if (n == 250) { + OPM_LogWStr((CHAR*)" is no longer visible, compile with option s", (LONGINT)45); + } else if (n == 249) { + OPM_LogWStr((CHAR*)" is not consistently imported, recompile imports", (LONGINT)49); + } + } + } + } else { + if (pos >= 0) { + OPM_ShowLine(pos); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" pos", (LONGINT)6); + OPM_LogWNum(pos, ((LONGINT)(6))); + } + OPM_LogErrMsg(n); + if (pos < 0) { + OPM_LogWLn(); + } + } +} + +void OPM_err (INTEGER n) +{ + OPM_Mark(n, OPM_errpos); +} + +void OPM_FPrint (LONGINT *fp, LONGINT val) +{ + *fp = __ROTL((LONGINT)((SET)*fp ^ (SET)val), 1, LONGINT); +} + +void OPM_FPrintSet (LONGINT *fp, SET set) +{ + OPM_FPrint(&*fp, (LONGINT)set); +} + +void OPM_FPrintReal (LONGINT *fp, REAL real) +{ + OPM_FPrint(&*fp, __VAL(LONGINT, real)); +} + +void OPM_FPrintLReal (LONGINT *fp, LONGREAL lr) +{ + LONGINT l, h; + __GET((LONGINT)(uintptr_t)&lr, l, LONGINT); + __GET((LONGINT)(uintptr_t)&lr + 4, h, LONGINT); + OPM_FPrint(&*fp, l); + OPM_FPrint(&*fp, h); +} + +static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONGINT name__len, INTEGER *size, INTEGER *align) +{ + __DUP(name, name__len, CHAR); + if (((*S).class == 1 && __STRCMP((*S).s, name) == 0)) { + Texts_Scan(&*S, S__typ); + if ((*S).class == 3) { + *size = (int)(*S).i; + Texts_Scan(&*S, S__typ); + } else { + OPM_Mark(-157, ((LONGINT)(-1))); + } + if ((*S).class == 3) { + *align = (int)(*S).i; + Texts_Scan(&*S, S__typ); + } else { + OPM_Mark(-157, ((LONGINT)(-1))); + } + } else { + OPM_Mark(-157, ((LONGINT)(-1))); + } + __DEL(name); +} + +static LONGINT OPM_minus (LONGINT i) +{ + LONGINT _o_result; + _o_result = -i; + return _o_result; +} + +static LONGINT OPM_power0 (LONGINT i, LONGINT j) +{ + LONGINT _o_result; + LONGINT k, p; + k = 1; + p = i; + do { + p = p * i; + k += 1; + } while (!(k == j)); + _o_result = p; + return _o_result; +} + +static void OPM_VerboseListSizes (void) +{ + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Type Size Alignement", (LONGINT)29); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"CHAR ", (LONGINT)14); + OPM_LogWNum(OPM_CharSize, ((LONGINT)(4))); + OPM_LogWNum(OPM_CharAlign, ((LONGINT)(5))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"BOOLEAN ", (LONGINT)14); + OPM_LogWNum(OPM_BoolSize, ((LONGINT)(4))); + OPM_LogWNum(OPM_BoolAlign, ((LONGINT)(5))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"SHORTINT ", (LONGINT)14); + OPM_LogWNum(OPM_SIntSize, ((LONGINT)(4))); + OPM_LogWNum(OPM_SIntAlign, ((LONGINT)(5))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"INTEGER ", (LONGINT)14); + OPM_LogWNum(OPM_IntSize, ((LONGINT)(4))); + OPM_LogWNum(OPM_IntAlign, ((LONGINT)(5))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"LONGINT ", (LONGINT)14); + OPM_LogWNum(OPM_LIntSize, ((LONGINT)(4))); + OPM_LogWNum(OPM_LIntAlign, ((LONGINT)(5))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"SET ", (LONGINT)14); + OPM_LogWNum(OPM_SetSize, ((LONGINT)(4))); + OPM_LogWNum(OPM_SetAlign, ((LONGINT)(5))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"REAL ", (LONGINT)14); + OPM_LogWNum(OPM_RealSize, ((LONGINT)(4))); + OPM_LogWNum(OPM_RealAlign, ((LONGINT)(5))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"LONGREAL ", (LONGINT)14); + OPM_LogWNum(OPM_LRealSize, ((LONGINT)(4))); + OPM_LogWNum(OPM_LRealAlign, ((LONGINT)(5))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"PTR ", (LONGINT)14); + OPM_LogWNum(OPM_PointerSize, ((LONGINT)(4))); + OPM_LogWNum(OPM_PointerAlign, ((LONGINT)(5))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"PROC ", (LONGINT)14); + OPM_LogWNum(OPM_ProcSize, ((LONGINT)(4))); + OPM_LogWNum(OPM_ProcAlign, ((LONGINT)(5))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"RECORD ", (LONGINT)14); + OPM_LogWNum(OPM_RecSize, ((LONGINT)(4))); + OPM_LogWNum(OPM_RecAlign, ((LONGINT)(5))); + OPM_LogWLn(); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Min shortint ", (LONGINT)14); + OPM_LogWNum(OPM_MinSInt, ((LONGINT)(4))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Max shortint ", (LONGINT)14); + OPM_LogWNum(OPM_MaxSInt, ((LONGINT)(4))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Min integer ", (LONGINT)14); + OPM_LogWNum(OPM_MinInt, ((LONGINT)(4))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Max integer ", (LONGINT)14); + OPM_LogWNum(OPM_MaxInt, ((LONGINT)(4))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Min longint ", (LONGINT)14); + OPM_LogWNum(OPM_MinLInt, ((LONGINT)(4))); + OPM_LogWLn(); +} + +static INTEGER OPM_Min (INTEGER a, INTEGER b) +{ + INTEGER _o_result; + if (a < b) { + _o_result = a; + return _o_result; + } else { + _o_result = b; + return _o_result; + } + __RETCHK; +} + +static void OPM_GetProperties (void) +{ + LONGINT base; + OPM_ProcSize = OPM_PointerSize; + OPM_LIntSize = __ASHL(OPM_IntSize, 1); + OPM_SetSize = OPM_LIntSize; + OPM_CharAlign = OPM_Min(OPM_Alignment, OPM_CharSize); + OPM_BoolAlign = OPM_Min(OPM_Alignment, OPM_BoolSize); + OPM_SIntAlign = OPM_Min(OPM_Alignment, OPM_SIntSize); + OPM_RecAlign = OPM_Min(OPM_Alignment, OPM_RecSize); + OPM_RealAlign = OPM_Min(OPM_Alignment, OPM_RealSize); + OPM_LRealAlign = OPM_Min(OPM_Alignment, OPM_LRealSize); + OPM_PointerAlign = OPM_Min(OPM_Alignment, OPM_PointerSize); + OPM_ProcAlign = OPM_Min(OPM_Alignment, OPM_ProcSize); + OPM_IntAlign = OPM_Min(OPM_Alignment, OPM_IntSize); + OPM_LIntAlign = OPM_Min(OPM_Alignment, OPM_LIntSize); + OPM_SetAlign = OPM_Min(OPM_Alignment, OPM_SetSize); + base = -2; + OPM_MinSInt = __ASH(base, __ASHL(OPM_SIntSize, 3) - 2); + OPM_MaxSInt = OPM_minus(OPM_MinSInt + 1); + OPM_MinInt = __ASH(base, __ASHL(OPM_IntSize, 3) - 2); + OPM_MaxInt = OPM_minus(OPM_MinInt + 1); + OPM_MinLInt = __ASH(base, __ASHL(OPM_LIntSize, 3) - 2); + OPM_MaxLInt = OPM_minus(OPM_MinLInt + 1); + if (OPM_RealSize == 4) { + OPM_MaxReal = 3.40282346000000e+038; + } else if (OPM_RealSize == 8) { + OPM_MaxReal = 1.79769296342094e+308; + } + if (OPM_LRealSize == 4) { + OPM_MaxLReal = 3.40282346000000e+038; + } else if (OPM_LRealSize == 8) { + OPM_MaxLReal = 1.79769296342094e+308; + } + OPM_MinReal = -OPM_MaxReal; + OPM_MinLReal = -OPM_MaxLReal; + OPM_MaxSet = __ASHL(OPM_SetSize, 3) - 1; + OPM_MaxIndex = OPM_MaxLInt; + if (OPM_Verbose) { + OPM_VerboseListSizes(); + } +} + +void OPM_SymRCh (CHAR *ch) +{ + Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&*ch); +} + +LONGINT OPM_SymRInt (void) +{ + LONGINT _o_result; + LONGINT k; + Files_ReadNum(&OPM_oldSF, Files_Rider__typ, &k); + _o_result = k; + return _o_result; +} + +void OPM_SymRSet (SET *s) +{ + Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (LONGINT*)&*s); +} + +void OPM_SymRReal (REAL *r) +{ + Files_ReadReal(&OPM_oldSF, Files_Rider__typ, &*r); +} + +void OPM_SymRLReal (LONGREAL *lr) +{ + Files_ReadLReal(&OPM_oldSF, Files_Rider__typ, &*lr); +} + +void OPM_CloseOldSym (void) +{ +} + +void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done) +{ + CHAR ch; + OPM_FileName fileName; + OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, ((LONGINT)(32)), (CHAR*)".sym", (LONGINT)5); + OPM_oldSFile = Files_Old(fileName, ((LONGINT)(32))); + *done = OPM_oldSFile != NIL; + if (*done) { + Files_Set(&OPM_oldSF, Files_Rider__typ, OPM_oldSFile, ((LONGINT)(0))); + Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&ch); + if (ch != 0xf7) { + OPM_err(-306); + OPM_CloseOldSym(); + *done = 0; + } + } +} + +BOOLEAN OPM_eofSF (void) +{ + BOOLEAN _o_result; + _o_result = OPM_oldSF.eof; + return _o_result; +} + +void OPM_SymWCh (CHAR ch) +{ + Files_Write(&OPM_newSF, Files_Rider__typ, ch); +} + +void OPM_SymWInt (LONGINT i) +{ + Files_WriteNum(&OPM_newSF, Files_Rider__typ, i); +} + +void OPM_SymWSet (SET s) +{ + Files_WriteNum(&OPM_newSF, Files_Rider__typ, (LONGINT)s); +} + +void OPM_SymWReal (REAL r) +{ + Files_WriteReal(&OPM_newSF, Files_Rider__typ, r); +} + +void OPM_SymWLReal (LONGREAL lr) +{ + Files_WriteLReal(&OPM_newSF, Files_Rider__typ, lr); +} + +void OPM_RegisterNewSym (void) +{ + if (__STRCMP(OPM_modName, "SYSTEM") != 0 || __IN(10, OPM_opt)) { + Files_Register(OPM_newSFile); + } +} + +void OPM_DeleteNewSym (void) +{ +} + +void OPM_NewSym (CHAR *modName, LONGINT modName__len) +{ + OPM_FileName fileName; + OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, ((LONGINT)(32)), (CHAR*)".sym", (LONGINT)5); + OPM_newSFile = Files_New(fileName, ((LONGINT)(32))); + if (OPM_newSFile != NIL) { + Files_Set(&OPM_newSF, Files_Rider__typ, OPM_newSFile, ((LONGINT)(0))); + Files_Write(&OPM_newSF, Files_Rider__typ, 0xf7); + } else { + OPM_err(153); + } +} + +void OPM_Write (CHAR ch) +{ + Files_Write(&OPM_R[__X(OPM_currFile, ((LONGINT)(3)))], Files_Rider__typ, ch); +} + +void OPM_WriteString (CHAR *s, LONGINT s__len) +{ + INTEGER i; + i = 0; + while (s[__X(i, s__len)] != 0x00) { + i += 1; + } + Files_WriteBytes(&OPM_R[__X(OPM_currFile, ((LONGINT)(3)))], Files_Rider__typ, (void*)s, s__len * ((LONGINT)(1)), i); +} + +void OPM_WriteStringVar (CHAR *s, LONGINT s__len) +{ + INTEGER i; + i = 0; + while (s[__X(i, s__len)] != 0x00) { + i += 1; + } + Files_WriteBytes(&OPM_R[__X(OPM_currFile, ((LONGINT)(3)))], Files_Rider__typ, (void*)s, s__len * ((LONGINT)(1)), i); +} + +void OPM_WriteHex (LONGINT i) +{ + CHAR s[3]; + INTEGER digit; + digit = __ASHR((int)i, 4); + if (digit < 10) { + s[0] = (CHAR)(48 + digit); + } else { + s[0] = (CHAR)(87 + digit); + } + digit = __MASK((int)i, -16); + if (digit < 10) { + s[1] = (CHAR)(48 + digit); + } else { + s[1] = (CHAR)(87 + digit); + } + s[2] = 0x00; + OPM_WriteString(s, ((LONGINT)(3))); +} + +void OPM_WriteInt (LONGINT i) +{ + CHAR s[20]; + LONGINT i1, k; + if (i == OPM_MinInt || i == OPM_MinLInt) { + OPM_Write('('); + OPM_WriteInt(i + 1); + OPM_WriteString((CHAR*)"-1)", (LONGINT)4); + } else { + i1 = __ABS(i); + s[0] = (CHAR)(__MOD(i1, 10) + 48); + i1 = __DIV(i1, 10); + k = 1; + while (i1 > 0) { + s[__X(k, ((LONGINT)(20)))] = (CHAR)(__MOD(i1, 10) + 48); + i1 = __DIV(i1, 10); + k += 1; + } + if (i < 0) { + s[__X(k, ((LONGINT)(20)))] = '-'; + k += 1; + } + while (k > 0) { + k -= 1; + OPM_Write(s[__X(k, ((LONGINT)(20)))]); + } + } +} + +void OPM_WriteReal (LONGREAL r, CHAR suffx) +{ + Texts_Writer W; + Texts_Text T = NIL; + Texts_Reader R; + CHAR s[32]; + CHAR ch; + INTEGER i; + if ((((r < OPM_MaxLInt && r > OPM_MinLInt)) && r == (__ENTIER(r)))) { + if (suffx == 'f') { + OPM_WriteString((CHAR*)"(REAL)", (LONGINT)7); + } else { + OPM_WriteString((CHAR*)"(LONGREAL)", (LONGINT)11); + } + OPM_WriteInt(__ENTIER(r)); + } else { + Texts_OpenWriter(&W, Texts_Writer__typ); + if (suffx == 'f') { + Texts_WriteLongReal(&W, Texts_Writer__typ, r, 16); + } else { + Texts_WriteLongReal(&W, Texts_Writer__typ, r, 23); + } + __NEW(T, Texts_TextDesc); + Texts_Open(T, (CHAR*)"", (LONGINT)1); + Texts_Append(T, W.buf); + Texts_OpenReader(&R, Texts_Reader__typ, T, ((LONGINT)(0))); + i = 0; + Texts_Read(&R, Texts_Reader__typ, &ch); + while (ch != 0x00) { + s[__X(i, ((LONGINT)(32)))] = ch; + i += 1; + Texts_Read(&R, Texts_Reader__typ, &ch); + } + s[__X(i, ((LONGINT)(32)))] = 0x00; + i = 0; + ch = s[0]; + while ((ch != 'D' && ch != 0x00)) { + i += 1; + ch = s[__X(i, ((LONGINT)(32)))]; + } + if (ch == 'D') { + s[__X(i, ((LONGINT)(32)))] = 'e'; + } + OPM_WriteString(s, ((LONGINT)(32))); + } +} + +void OPM_WriteLn (void) +{ + Files_Write(&OPM_R[__X(OPM_currFile, ((LONGINT)(3)))], Files_Rider__typ, 0x0a); +} + +static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F) +{ + Files_Rider R1; + CHAR buffer[4096]; + if (F != NIL) { + Files_Set(&R1, Files_Rider__typ, F, ((LONGINT)(0))); + Files_ReadBytes(&R1, Files_Rider__typ, (void*)buffer, ((LONGINT)(4096)), ((LONGINT)(4096))); + while (4096 - R1.res > 0) { + Files_WriteBytes(&*R, R__typ, (void*)buffer, ((LONGINT)(4096)), 4096 - R1.res); + Files_ReadBytes(&R1, Files_Rider__typ, (void*)buffer, ((LONGINT)(4096)), ((LONGINT)(4096))); + } + } +} + +void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len) +{ + CHAR FName[32]; + __COPY(moduleName, OPM_modName, ((LONGINT)(32))); + OPM_HFile = Files_New((CHAR*)"", (LONGINT)1); + if (OPM_HFile != NIL) { + Files_Set(&OPM_R[0], Files_Rider__typ, OPM_HFile, ((LONGINT)(0))); + } else { + OPM_err(153); + } + OPM_MakeFileName((void*)moduleName, moduleName__len, (void*)FName, ((LONGINT)(32)), (CHAR*)".c", (LONGINT)3); + OPM_BFile = Files_New(FName, ((LONGINT)(32))); + if (OPM_BFile != NIL) { + Files_Set(&OPM_R[1], Files_Rider__typ, OPM_BFile, ((LONGINT)(0))); + } else { + OPM_err(153); + } + OPM_MakeFileName((void*)moduleName, moduleName__len, (void*)FName, ((LONGINT)(32)), (CHAR*)".h", (LONGINT)3); + OPM_HIFile = Files_New(FName, ((LONGINT)(32))); + if (OPM_HIFile != NIL) { + Files_Set(&OPM_R[2], Files_Rider__typ, OPM_HIFile, ((LONGINT)(0))); + } else { + OPM_err(153); + } +} + +void OPM_CloseFiles (void) +{ + CHAR FName[32]; + INTEGER res; + if (OPM_noerr) { + OPM_LogWStr((CHAR*)" ", (LONGINT)3); + OPM_LogWNum(Files_Pos(&OPM_R[1], Files_Rider__typ), ((LONGINT)(0))); + OPM_LogWStr((CHAR*)" chars.", (LONGINT)8); + } + if (OPM_noerr) { + if (__STRCMP(OPM_modName, "SYSTEM") == 0) { + if (!__IN(10, OPM_opt)) { + Files_Register(OPM_BFile); + } + } else if (!__IN(10, OPM_opt)) { + OPM_Append(&OPM_R[2], Files_Rider__typ, OPM_HFile); + Files_Register(OPM_HIFile); + Files_Register(OPM_BFile); + } else { + OPM_MakeFileName((void*)OPM_modName, ((LONGINT)(32)), (void*)FName, ((LONGINT)(32)), (CHAR*)".h", (LONGINT)3); + Files_Delete(FName, ((LONGINT)(32)), &res); + OPM_MakeFileName((void*)OPM_modName, ((LONGINT)(32)), (void*)FName, ((LONGINT)(32)), (CHAR*)".sym", (LONGINT)5); + Files_Delete(FName, ((LONGINT)(32)), &res); + Files_Register(OPM_BFile); + } + } + OPM_HFile = NIL; + OPM_BFile = NIL; + OPM_HIFile = NIL; + OPM_newSFile = NIL; + OPM_oldSFile = NIL; + Files_Set(&OPM_R[0], Files_Rider__typ, NIL, ((LONGINT)(0))); + Files_Set(&OPM_R[1], Files_Rider__typ, NIL, ((LONGINT)(0))); + Files_Set(&OPM_R[2], Files_Rider__typ, NIL, ((LONGINT)(0))); + Files_Set(&OPM_newSF, Files_Rider__typ, NIL, ((LONGINT)(0))); + Files_Set(&OPM_oldSF, Files_Rider__typ, NIL, ((LONGINT)(0))); +} + +static void EnumPtrs(void (*P)(void*)) +{ + __ENUMR(&OPM_inR, Texts_Reader__typ, 96, 1, P); + P(OPM_Log); + __ENUMR(&OPM_W, Texts_Writer__typ, 72, 1, P); + __ENUMR(&OPM_oldSF, Files_Rider__typ, 40, 1, P); + __ENUMR(&OPM_newSF, Files_Rider__typ, 40, 1, P); + __ENUMR(OPM_R, Files_Rider__typ, 40, 3, P); + P(OPM_oldSFile); + P(OPM_newSFile); + P(OPM_HFile); + P(OPM_BFile); + P(OPM_HIFile); +} + + +export void *OPM__init(void) +{ + __DEFMOD; + __MODULE_IMPORT(Configuration); + __MODULE_IMPORT(Console); + __MODULE_IMPORT(Files); + __MODULE_IMPORT(Platform); + __MODULE_IMPORT(Strings); + __MODULE_IMPORT(Texts); + __MODULE_IMPORT(errors); + __MODULE_IMPORT(vt100); + __REGMOD("OPM", EnumPtrs); + __REGCMD("CloseFiles", OPM_CloseFiles); + __REGCMD("CloseOldSym", OPM_CloseOldSym); + __REGCMD("DeleteNewSym", OPM_DeleteNewSym); + __REGCMD("InitOptions", OPM_InitOptions); + __REGCMD("LogWLn", OPM_LogWLn); + __REGCMD("RegisterNewSym", OPM_RegisterNewSym); + __REGCMD("WriteLn", OPM_WriteLn); +/* BEGIN */ + Texts_OpenWriter(&OPM_W, Texts_Writer__typ); + OPM_MODULES[0] = 0x00; + Platform_GetEnv((CHAR*)"MODULES", (LONGINT)8, (void*)OPM_MODULES, ((LONGINT)(1024))); + __MOVE(".", OPM_OBERON, 2); + Platform_GetEnv((CHAR*)"OBERON", (LONGINT)7, (void*)OPM_OBERON, ((LONGINT)(1024))); + Strings_Append((CHAR*)";.;", (LONGINT)4, (void*)OPM_OBERON, ((LONGINT)(1024))); + Strings_Append(OPM_MODULES, ((LONGINT)(1024)), (void*)OPM_OBERON, ((LONGINT)(1024))); + Strings_Append((CHAR*)";", (LONGINT)2, (void*)OPM_OBERON, ((LONGINT)(1024))); + Strings_Append((CHAR*)"/opt/voc", (LONGINT)9, (void*)OPM_OBERON, ((LONGINT)(1024))); + Strings_Append((CHAR*)"/sym;", (LONGINT)6, (void*)OPM_OBERON, ((LONGINT)(1024))); + Files_SetSearchPath(OPM_OBERON, ((LONGINT)(1024))); + OPM_CharSize = 1; + OPM_BoolSize = 1; + OPM_SIntSize = 1; + OPM_RecSize = 1; + OPM_ByteSize = 1; + OPM_RealSize = 4; + OPM_LRealSize = 8; + OPM_PointerSize = 8; + OPM_Alignment = 8; + OPM_IntSize = 4; + __ENDMOD; +} diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h new file mode 100644 index 00000000..e09dbf82 --- /dev/null +++ b/bootstrap/windows-88/OPM.h @@ -0,0 +1,64 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ + +#ifndef OPM__h +#define OPM__h + +#define LARGE +#include "SYSTEM.h" + + +import INTEGER OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_CharAlign, OPM_BoolAlign, OPM_SIntAlign, OPM_IntAlign, OPM_LIntAlign, OPM_SetAlign, OPM_RealAlign, OPM_LRealAlign, OPM_PointerAlign, OPM_ProcAlign, OPM_RecAlign, OPM_MaxSet; +import LONGINT OPM_MinSInt, OPM_MinInt, OPM_MinLInt, OPM_MaxSInt, OPM_MaxInt, OPM_MaxLInt, OPM_MaxIndex; +import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; +import BOOLEAN OPM_noerr; +import LONGINT OPM_curpos, OPM_errpos, OPM_breakpc; +import INTEGER OPM_currFile, OPM_level, OPM_pc, OPM_entno; +import CHAR OPM_modName[32]; +import CHAR OPM_objname[64]; +import SET OPM_opt, OPM_glbopt; +import BOOLEAN OPM_dontAsm, OPM_dontLink, OPM_mainProg, OPM_mainLinkStat, OPM_notColorOutput, OPM_forceNewSym, OPM_Verbose; + + +import void OPM_CloseFiles (void); +import void OPM_CloseOldSym (void); +import void OPM_DeleteNewSym (void); +import void OPM_FPrint (LONGINT *fp, LONGINT val); +import void OPM_FPrintLReal (LONGINT *fp, LONGREAL lr); +import void OPM_FPrintReal (LONGINT *fp, REAL real); +import void OPM_FPrintSet (LONGINT *fp, SET set); +import void OPM_Get (CHAR *ch); +import void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); +import void OPM_InitOptions (void); +import void OPM_LogW (CHAR ch); +import void OPM_LogWLn (void); +import void OPM_LogWNum (LONGINT i, LONGINT len); +import void OPM_LogWStr (CHAR *s, LONGINT s__len); +import void OPM_Mark (INTEGER n, LONGINT pos); +import void OPM_NewSym (CHAR *modName, LONGINT modName__len); +import void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); +import void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); +import BOOLEAN OPM_OpenPar (void); +import void OPM_RegisterNewSym (void); +import void OPM_SymRCh (CHAR *ch); +import LONGINT OPM_SymRInt (void); +import void OPM_SymRLReal (LONGREAL *lr); +import void OPM_SymRReal (REAL *r); +import void OPM_SymRSet (SET *s); +import void OPM_SymWCh (CHAR ch); +import void OPM_SymWInt (LONGINT i); +import void OPM_SymWLReal (LONGREAL lr); +import void OPM_SymWReal (REAL r); +import void OPM_SymWSet (SET s); +import void OPM_Write (CHAR ch); +import void OPM_WriteHex (LONGINT i); +import void OPM_WriteInt (LONGINT i); +import void OPM_WriteLn (void); +import void OPM_WriteReal (LONGREAL r, CHAR suffx); +import void OPM_WriteString (CHAR *s, LONGINT s__len); +import void OPM_WriteStringVar (CHAR *s, LONGINT s__len); +import BOOLEAN OPM_eofSF (void); +import void OPM_err (INTEGER n); +import void *OPM__init(void); + + +#endif diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c new file mode 100644 index 00000000..3bc74ce6 --- /dev/null +++ b/bootstrap/windows-88/OPP.c @@ -0,0 +1,1874 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +#define LARGE +#include "SYSTEM.h" +#include "OPB.h" +#include "OPM.h" +#include "OPS.h" +#include "OPT.h" + +struct OPP__1 { + LONGINT low, high; +}; + +typedef + struct OPP__1 OPP_CaseTable[128]; + + +static SHORTINT OPP_sym, OPP_level; +static INTEGER OPP_LoopLevel; +static OPT_Node OPP_TDinit, OPP_lastTDinit; +static INTEGER OPP_nofFwdPtr; +static OPT_Struct OPP_FwdPtr[64]; + +export LONGINT *OPP__1__typ; + +static void OPP_ActualParameters (OPT_Node *aparlist, OPT_Object fpar); +static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned); +static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq); +static void OPP_CaseLabelList (OPT_Node *lab, INTEGER LabelForm, INTEGER *n, OPP_CaseTable tab); +static void OPP_CheckMark (SHORTINT *vis); +static void OPP_CheckSym (INTEGER s); +static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_); +static void OPP_ConstExpression (OPT_Node *x); +static void OPP_Element (OPT_Node *x); +static void OPP_Expression (OPT_Node *x); +static BOOLEAN OPP_Extends (OPT_Struct x, OPT_Struct b); +static void OPP_Factor (OPT_Node *x); +static void OPP_FormalParameters (OPT_Object *firstPar, OPT_Struct *resTyp); +export void OPP_Module (OPT_Node *prog, SET opt); +static void OPP_PointerType (OPT_Struct *typ); +static void OPP_ProcedureDeclaration (OPT_Node *x); +static void OPP_Receiver (SHORTINT *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec); +static void OPP_RecordType (OPT_Struct *typ, OPT_Struct *banned); +static void OPP_Sets (OPT_Node *x); +static void OPP_SimpleExpression (OPT_Node *x); +static void OPP_StandProcCall (OPT_Node *x); +static void OPP_StatSeq (OPT_Node *stat); +static void OPP_Term (OPT_Node *x); +static void OPP_Type (OPT_Struct *typ, OPT_Struct *banned); +static void OPP_TypeDecl (OPT_Struct *typ, OPT_Struct *banned); +static void OPP_err (INTEGER n); +static void OPP_qualident (OPT_Object *id); +static void OPP_selector (OPT_Node *x); + + +static void OPP_err (INTEGER n) +{ + OPM_err(n); +} + +static void OPP_CheckSym (INTEGER s) +{ + if ((int)OPP_sym == s) { + OPS_Get(&OPP_sym); + } else { + OPM_err(s); + } +} + +static void OPP_qualident (OPT_Object *id) +{ + OPT_Object obj = NIL; + SHORTINT lev; + OPT_Find(&obj); + OPS_Get(&OPP_sym); + if ((((OPP_sym == 18 && obj != NIL)) && obj->mode == 11)) { + OPS_Get(&OPP_sym); + if (OPP_sym == 38) { + OPT_FindImport(obj, &obj); + OPS_Get(&OPP_sym); + } else { + OPP_err(38); + obj = NIL; + } + } + if (obj == NIL) { + OPP_err(0); + obj = OPT_NewObj(); + obj->mode = 1; + obj->typ = OPT_undftyp; + obj->adr = 0; + } else { + lev = obj->mnolev; + if ((__IN(obj->mode, 0x06) && lev != OPP_level)) { + obj->leaf = 0; + if (lev > 0) { + OPB_StaticLink(OPP_level - lev); + } + } + } + *id = obj; +} + +static void OPP_ConstExpression (OPT_Node *x) +{ + OPP_Expression(&*x); + if ((*x)->class != 7) { + OPP_err(50); + *x = OPB_NewIntConst(((LONGINT)(1))); + } +} + +static void OPP_CheckMark (SHORTINT *vis) +{ + OPS_Get(&OPP_sym); + if (OPP_sym == 1 || OPP_sym == 7) { + if (OPP_level > 0) { + OPP_err(47); + } + if (OPP_sym == 1) { + *vis = 1; + } else { + *vis = 2; + } + OPS_Get(&OPP_sym); + } else { + *vis = 0; + } +} + +static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_) +{ + OPT_Node x = NIL; + LONGINT sf; + if (OPP_sym == 31) { + OPS_Get(&OPP_sym); + if (!OPT_SYSimported) { + OPP_err(135); + } + OPP_ConstExpression(&x); + if (__IN(x->typ->form, 0x70)) { + sf = x->conval->intval; + if (sf < 0 || sf > 1) { + OPP_err(220); + sf = 0; + } + } else { + OPP_err(51); + sf = 0; + } + *sysflag = (int)sf; + OPP_CheckSym(23); + } else { + *sysflag = default_; + } +} + +static void OPP_RecordType (OPT_Struct *typ, OPT_Struct *banned) +{ + OPT_Object fld = NIL, first = NIL, last = NIL, base = NIL; + OPT_Struct ftyp = NIL; + INTEGER sysflag; + *typ = OPT_NewStr(15, 4); + (*typ)->BaseTyp = NIL; + OPP_CheckSysFlag(&sysflag, -1); + if (OPP_sym == 30) { + OPS_Get(&OPP_sym); + if (OPP_sym == 38) { + OPP_qualident(&base); + if ((base->mode == 5 && base->typ->comp == 4)) { + if (base->typ == *banned) { + OPP_err(58); + } else { + base->typ->pvused = 1; + (*typ)->BaseTyp = base->typ; + (*typ)->extlev = base->typ->extlev + 1; + (*typ)->sysflag = base->typ->sysflag; + } + } else { + OPP_err(52); + } + } else { + OPP_err(38); + } + OPP_CheckSym(22); + } + if (sysflag >= 0) { + (*typ)->sysflag = sysflag; + } + OPT_OpenScope(0, NIL); + first = NIL; + last = NIL; + for (;;) { + if (OPP_sym == 38) { + for (;;) { + if (OPP_sym == 38) { + if ((*typ)->BaseTyp != NIL) { + OPT_FindField(OPS_name, (*typ)->BaseTyp, &fld); + if (fld != NIL) { + OPP_err(1); + } + } + OPT_Insert(OPS_name, &fld); + OPP_CheckMark(&fld->vis); + fld->mode = 4; + fld->link = NIL; + fld->typ = OPT_undftyp; + if (first == NIL) { + first = fld; + } + if (last == NIL) { + (*typ)->link = fld; + } else { + last->link = fld; + } + last = fld; + } else { + OPP_err(38); + } + if (OPP_sym == 19) { + OPS_Get(&OPP_sym); + } else if (OPP_sym == 38) { + OPP_err(19); + } else { + break; + } + } + OPP_CheckSym(20); + OPP_Type(&ftyp, &*banned); + ftyp->pvused = 1; + if (ftyp->comp == 3) { + ftyp = OPT_undftyp; + OPP_err(88); + } + while (first != NIL) { + first->typ = ftyp; + first = first->link; + } + } + if (OPP_sym == 39) { + OPS_Get(&OPP_sym); + } else if (OPP_sym == 38) { + OPP_err(39); + } else { + break; + } + } + OPT_CloseScope(); +} + +static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) +{ + OPT_Node x = NIL; + LONGINT n; + INTEGER sysflag; + OPP_CheckSysFlag(&sysflag, 0); + if (OPP_sym == 25) { + *typ = OPT_NewStr(15, 3); + (*typ)->mno = 0; + (*typ)->sysflag = sysflag; + OPS_Get(&OPP_sym); + OPP_Type(&(*typ)->BaseTyp, &*banned); + (*typ)->BaseTyp->pvused = 1; + if ((*typ)->BaseTyp->comp == 3) { + (*typ)->n = (*typ)->BaseTyp->n + 1; + } else { + (*typ)->n = 0; + } + } else { + *typ = OPT_NewStr(15, 2); + (*typ)->sysflag = sysflag; + OPP_ConstExpression(&x); + if (__IN(x->typ->form, 0x70)) { + n = x->conval->intval; + if (n <= 0 || n > OPM_MaxIndex) { + OPP_err(63); + n = 1; + } + } else { + OPP_err(51); + n = 1; + } + (*typ)->n = n; + if (OPP_sym == 25) { + OPS_Get(&OPP_sym); + OPP_Type(&(*typ)->BaseTyp, &*banned); + (*typ)->BaseTyp->pvused = 1; + } else if (OPP_sym == 19) { + OPS_Get(&OPP_sym); + if (OPP_sym != 25) { + OPP_ArrayType(&(*typ)->BaseTyp, &*banned); + } + } else { + OPP_err(35); + } + if ((*typ)->BaseTyp->comp == 3) { + (*typ)->BaseTyp = OPT_undftyp; + OPP_err(88); + } + } +} + +static void OPP_PointerType (OPT_Struct *typ) +{ + OPT_Object id = NIL; + *typ = OPT_NewStr(13, 1); + OPP_CheckSysFlag(&(*typ)->sysflag, 0); + OPP_CheckSym(28); + if (OPP_sym == 38) { + OPT_Find(&id); + if (id == NIL) { + if (OPP_nofFwdPtr < 64) { + OPP_FwdPtr[__X(OPP_nofFwdPtr, ((LONGINT)(64)))] = *typ; + OPP_nofFwdPtr += 1; + } else { + OPP_err(224); + } + (*typ)->link = OPT_NewObj(); + __COPY(OPS_name, (*typ)->link->name, ((LONGINT)(256))); + (*typ)->BaseTyp = OPT_undftyp; + OPS_Get(&OPP_sym); + } else { + OPP_qualident(&id); + if (id->mode == 5) { + if (__IN(id->typ->comp, 0x1c)) { + (*typ)->BaseTyp = id->typ; + } else { + (*typ)->BaseTyp = OPT_undftyp; + OPP_err(57); + } + } else { + (*typ)->BaseTyp = OPT_undftyp; + OPP_err(52); + } + } + } else { + OPP_Type(&(*typ)->BaseTyp, &OPT_notyp); + if (!__IN((*typ)->BaseTyp->comp, 0x1c)) { + (*typ)->BaseTyp = OPT_undftyp; + OPP_err(57); + } + } +} + +static void OPP_FormalParameters (OPT_Object *firstPar, OPT_Struct *resTyp) +{ + SHORTINT mode; + OPT_Object par = NIL, first = NIL, last = NIL, res = NIL; + OPT_Struct typ = NIL; + first = NIL; + last = *firstPar; + if (OPP_sym == 38 || OPP_sym == 60) { + for (;;) { + if (OPP_sym == 60) { + OPS_Get(&OPP_sym); + mode = 2; + } else { + mode = 1; + } + for (;;) { + if (OPP_sym == 38) { + OPT_Insert(OPS_name, &par); + OPS_Get(&OPP_sym); + par->mode = mode; + par->link = NIL; + if (first == NIL) { + first = par; + } + if (*firstPar == NIL) { + *firstPar = par; + } else { + last->link = par; + } + last = par; + } else { + OPP_err(38); + } + if (OPP_sym == 19) { + OPS_Get(&OPP_sym); + } else if (OPP_sym == 38) { + OPP_err(19); + } else if (OPP_sym == 60) { + OPP_err(19); + OPS_Get(&OPP_sym); + } else { + break; + } + } + OPP_CheckSym(20); + OPP_Type(&typ, &OPT_notyp); + if (mode == 1) { + typ->pvused = 1; + } + while (first != NIL) { + first->typ = typ; + first = first->link; + } + if (OPP_sym == 39) { + OPS_Get(&OPP_sym); + } else if (OPP_sym == 38) { + OPP_err(39); + } else { + break; + } + } + } + OPP_CheckSym(22); + if (OPP_sym == 20) { + OPS_Get(&OPP_sym); + *resTyp = OPT_undftyp; + if (OPP_sym == 38) { + OPP_qualident(&res); + if (res->mode == 5) { + if (res->typ->form < 15) { + *resTyp = res->typ; + } else { + OPP_err(54); + } + } else { + OPP_err(52); + } + } else { + OPP_err(38); + } + } else { + *resTyp = OPT_notyp; + } +} + +static void OPP_TypeDecl (OPT_Struct *typ, OPT_Struct *banned) +{ + OPT_Object id = NIL; + *typ = OPT_undftyp; + if (OPP_sym < 30) { + OPP_err(12); + do { + OPS_Get(&OPP_sym); + } while (!(OPP_sym >= 30)); + } + if (OPP_sym == 38) { + OPP_qualident(&id); + if (id->mode == 5) { + if (id->typ != *banned) { + *typ = id->typ; + } else { + OPP_err(58); + } + } else { + OPP_err(52); + } + } else if (OPP_sym == 54) { + OPS_Get(&OPP_sym); + OPP_ArrayType(&*typ, &*banned); + } else if (OPP_sym == 55) { + OPS_Get(&OPP_sym); + OPP_RecordType(&*typ, &*banned); + OPB_Inittd(&OPP_TDinit, &OPP_lastTDinit, *typ); + OPP_CheckSym(41); + } else if (OPP_sym == 56) { + OPS_Get(&OPP_sym); + OPP_PointerType(&*typ); + } else if (OPP_sym == 61) { + OPS_Get(&OPP_sym); + *typ = OPT_NewStr(14, 1); + OPP_CheckSysFlag(&(*typ)->sysflag, 0); + if (OPP_sym == 30) { + OPS_Get(&OPP_sym); + OPT_OpenScope(OPP_level, NIL); + OPP_FormalParameters(&(*typ)->link, &(*typ)->BaseTyp); + OPT_CloseScope(); + } else { + (*typ)->BaseTyp = OPT_notyp; + (*typ)->link = NIL; + } + } else { + OPP_err(12); + } + for (;;) { + if (((OPP_sym >= 39 && OPP_sym <= 42) || OPP_sym == 22) || OPP_sym == 64) { + break; + } + OPP_err(15); + if (OPP_sym == 38) { + break; + } + OPS_Get(&OPP_sym); + } +} + +static void OPP_Type (OPT_Struct *typ, OPT_Struct *banned) +{ + OPP_TypeDecl(&*typ, &*banned); + if (((((*typ)->form == 13 && (*typ)->BaseTyp == OPT_undftyp)) && (*typ)->strobj == NIL)) { + OPP_err(0); + } +} + +static void OPP_selector (OPT_Node *x) +{ + OPT_Object obj = NIL, proc = NIL; + OPT_Node y = NIL; + OPT_Struct typ = NIL; + OPS_Name name; + for (;;) { + if (OPP_sym == 31) { + OPS_Get(&OPP_sym); + for (;;) { + if (((*x)->typ != NIL && (*x)->typ->form == 13)) { + OPB_DeRef(&*x); + } + OPP_Expression(&y); + OPB_Index(&*x, y); + if (OPP_sym == 19) { + OPS_Get(&OPP_sym); + } else { + break; + } + } + OPP_CheckSym(23); + } else if (OPP_sym == 18) { + OPS_Get(&OPP_sym); + if (OPP_sym == 38) { + __COPY(OPS_name, name, ((LONGINT)(256))); + OPS_Get(&OPP_sym); + if ((*x)->typ != NIL) { + if ((*x)->typ->form == 13) { + OPB_DeRef(&*x); + } + if ((*x)->typ->comp == 4) { + OPT_FindField(name, (*x)->typ, &obj); + OPB_Field(&*x, obj); + if ((obj != NIL && obj->mode == 13)) { + if (OPP_sym == 17) { + OPS_Get(&OPP_sym); + y = (*x)->left; + if (y->class == 3) { + y = y->left; + } + if (y->obj != NIL) { + proc = OPT_topScope; + while ((proc->link != NIL && proc->link->mode != 13)) { + proc = proc->left; + } + if (proc->link == NIL || proc->link->link != y->obj) { + OPP_err(75); + } + typ = y->obj->typ; + if (typ->form == 13) { + typ = typ->BaseTyp; + } + OPT_FindField((*x)->obj->name, typ->BaseTyp, &proc); + if (proc != NIL) { + (*x)->subcl = 1; + } else { + OPP_err(74); + } + } else { + OPP_err(75); + } + } + if ((obj->typ != OPT_notyp && OPP_sym != 30)) { + OPP_err(30); + } + } + } else { + OPP_err(53); + } + } else { + OPP_err(52); + } + } else { + OPP_err(38); + } + } else if (OPP_sym == 17) { + OPS_Get(&OPP_sym); + OPB_DeRef(&*x); + } else if ((((((OPP_sym == 30 && (*x)->class < 7)) && (*x)->typ->form != 14)) && ((*x)->obj == NIL || (*x)->obj->mode != 13))) { + OPS_Get(&OPP_sym); + if (OPP_sym == 38) { + OPP_qualident(&obj); + if (obj->mode == 5) { + OPB_TypTest(&*x, obj, 1); + } else { + OPP_err(52); + } + } else { + OPP_err(38); + } + OPP_CheckSym(22); + } else { + break; + } + } +} + +static void OPP_ActualParameters (OPT_Node *aparlist, OPT_Object fpar) +{ + OPT_Node apar = NIL, last = NIL; + *aparlist = NIL; + last = NIL; + if (OPP_sym != 22) { + for (;;) { + OPP_Expression(&apar); + if (fpar != NIL) { + OPB_Param(apar, fpar); + OPB_Link(&*aparlist, &last, apar); + fpar = fpar->link; + } else { + OPP_err(64); + } + if (OPP_sym == 19) { + OPS_Get(&OPP_sym); + } else if ((30 <= OPP_sym && OPP_sym <= 38)) { + OPP_err(19); + } else { + break; + } + } + } + if (fpar != NIL) { + OPP_err(65); + } +} + +static void OPP_StandProcCall (OPT_Node *x) +{ + OPT_Node y = NIL; + SHORTINT m; + INTEGER n; + m = (int)(*x)->obj->adr; + n = 0; + if (OPP_sym == 30) { + OPS_Get(&OPP_sym); + if (OPP_sym != 22) { + for (;;) { + if (n == 0) { + OPP_Expression(&*x); + OPB_StPar0(&*x, m); + n = 1; + } else if (n == 1) { + OPP_Expression(&y); + OPB_StPar1(&*x, y, m); + n = 2; + } else { + OPP_Expression(&y); + OPB_StParN(&*x, y, m, n); + n += 1; + } + if (OPP_sym == 19) { + OPS_Get(&OPP_sym); + } else if ((30 <= OPP_sym && OPP_sym <= 38)) { + OPP_err(19); + } else { + break; + } + } + OPP_CheckSym(22); + } else { + OPS_Get(&OPP_sym); + } + OPB_StFct(&*x, m, n); + } else { + OPP_err(30); + } + if ((OPP_level > 0 && (m == 1 || m == 30))) { + OPT_topScope->link->leaf = 0; + } +} + +static void OPP_Element (OPT_Node *x) +{ + OPT_Node y = NIL; + OPP_Expression(&*x); + if (OPP_sym == 21) { + OPS_Get(&OPP_sym); + OPP_Expression(&y); + OPB_SetRange(&*x, y); + } else { + OPB_SetElem(&*x); + } +} + +static void OPP_Sets (OPT_Node *x) +{ + OPT_Node y = NIL; + if (OPP_sym != 24) { + OPP_Element(&*x); + for (;;) { + if (OPP_sym == 19) { + OPS_Get(&OPP_sym); + } else if ((30 <= OPP_sym && OPP_sym <= 38)) { + OPP_err(19); + } else { + break; + } + OPP_Element(&y); + OPB_Op(6, &*x, y); + } + } else { + *x = OPB_EmptySet(); + } + OPP_CheckSym(24); +} + +static void OPP_Factor (OPT_Node *x) +{ + OPT_Object fpar = NIL, id = NIL; + OPT_Node apar = NIL; + if (OPP_sym < 30) { + OPP_err(13); + do { + OPS_Get(&OPP_sym); + } while (!(OPP_sym >= 30)); + } + if (OPP_sym == 38) { + OPP_qualident(&id); + *x = OPB_NewLeaf(id); + OPP_selector(&*x); + if (((*x)->class == 9 && (*x)->obj->mode == 8)) { + OPP_StandProcCall(&*x); + } else if (OPP_sym == 30) { + OPS_Get(&OPP_sym); + OPB_PrepCall(&*x, &fpar); + OPP_ActualParameters(&apar, fpar); + OPB_Call(&*x, apar, fpar); + OPP_CheckSym(22); + if (OPP_level > 0) { + OPT_topScope->link->leaf = 0; + } + } + } else if (OPP_sym == 35) { + switch (OPS_numtyp) { + case 1: + *x = OPB_NewIntConst(OPS_intval); + (*x)->typ = OPT_chartyp; + break; + case 2: + *x = OPB_NewIntConst(OPS_intval); + break; + case 3: + *x = OPB_NewRealConst(OPS_realval, OPT_realtyp); + break; + case 4: + *x = OPB_NewRealConst(OPS_lrlval, OPT_lrltyp); + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPP.Factor, OPS.numtyp = ", (LONGINT)44); + OPM_LogWNum(OPS_numtyp, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + OPS_Get(&OPP_sym); + } else if (OPP_sym == 37) { + *x = OPB_NewString(OPS_str, OPS_intval); + OPS_Get(&OPP_sym); + } else if (OPP_sym == 36) { + *x = OPB_Nil(); + OPS_Get(&OPP_sym); + } else if (OPP_sym == 30) { + OPS_Get(&OPP_sym); + OPP_Expression(&*x); + OPP_CheckSym(22); + } else if (OPP_sym == 31) { + OPS_Get(&OPP_sym); + OPP_err(30); + OPP_Expression(&*x); + OPP_CheckSym(22); + } else if (OPP_sym == 32) { + OPS_Get(&OPP_sym); + OPP_Sets(&*x); + } else if (OPP_sym == 33) { + OPS_Get(&OPP_sym); + OPP_Factor(&*x); + OPB_MOp(33, &*x); + } else { + OPP_err(13); + OPS_Get(&OPP_sym); + *x = NIL; + } + if (*x == NIL) { + *x = OPB_NewIntConst(((LONGINT)(1))); + (*x)->typ = OPT_undftyp; + } +} + +static void OPP_Term (OPT_Node *x) +{ + OPT_Node y = NIL; + SHORTINT mulop; + OPP_Factor(&*x); + while ((1 <= OPP_sym && OPP_sym <= 5)) { + mulop = OPP_sym; + OPS_Get(&OPP_sym); + OPP_Factor(&y); + OPB_Op(mulop, &*x, y); + } +} + +static void OPP_SimpleExpression (OPT_Node *x) +{ + OPT_Node y = NIL; + SHORTINT addop; + if (OPP_sym == 7) { + OPS_Get(&OPP_sym); + OPP_Term(&*x); + OPB_MOp(7, &*x); + } else if (OPP_sym == 6) { + OPS_Get(&OPP_sym); + OPP_Term(&*x); + OPB_MOp(6, &*x); + } else { + OPP_Term(&*x); + } + while ((6 <= OPP_sym && OPP_sym <= 8)) { + addop = OPP_sym; + OPS_Get(&OPP_sym); + OPP_Term(&y); + OPB_Op(addop, &*x, y); + } +} + +static void OPP_Expression (OPT_Node *x) +{ + OPT_Node y = NIL; + OPT_Object obj = NIL; + SHORTINT relation; + OPP_SimpleExpression(&*x); + if ((9 <= OPP_sym && OPP_sym <= 14)) { + relation = OPP_sym; + OPS_Get(&OPP_sym); + OPP_SimpleExpression(&y); + OPB_Op(relation, &*x, y); + } else if (OPP_sym == 15) { + OPS_Get(&OPP_sym); + OPP_SimpleExpression(&y); + OPB_In(&*x, y); + } else if (OPP_sym == 16) { + OPS_Get(&OPP_sym); + if (OPP_sym == 38) { + OPP_qualident(&obj); + if (obj->mode == 5) { + OPB_TypTest(&*x, obj, 0); + } else { + OPP_err(52); + } + } else { + OPP_err(38); + } + } +} + +static void OPP_Receiver (SHORTINT *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec) +{ + OPT_Object obj = NIL; + *typ = OPT_undftyp; + *rec = NIL; + if (OPP_sym == 60) { + OPS_Get(&OPP_sym); + *mode = 2; + } else { + *mode = 1; + } + __COPY(OPS_name, name, ((LONGINT)(256))); + OPP_CheckSym(38); + OPP_CheckSym(20); + if (OPP_sym == 38) { + OPT_Find(&obj); + OPS_Get(&OPP_sym); + if (obj == NIL) { + OPP_err(0); + } else if (obj->mode != 5) { + OPP_err(72); + } else { + *typ = obj->typ; + *rec = *typ; + if ((*rec)->form == 13) { + *rec = (*rec)->BaseTyp; + } + if (!((((*mode == 1 && (*typ)->form == 13)) && (*rec)->comp == 4) || (*mode == 2 && (*typ)->comp == 4))) { + OPP_err(70); + *rec = NIL; + } + if ((*rec != NIL && (*rec)->mno != OPP_level)) { + OPP_err(72); + *rec = NIL; + } + } + } else { + OPP_err(38); + } + OPP_CheckSym(22); + if (*rec == NIL) { + *rec = OPT_NewStr(15, 4); + (*rec)->BaseTyp = NIL; + } +} + +static BOOLEAN OPP_Extends (OPT_Struct x, OPT_Struct b) +{ + BOOLEAN _o_result; + if ((b->form == 13 && x->form == 13)) { + b = b->BaseTyp; + x = x->BaseTyp; + } + if ((b->comp == 4 && x->comp == 4)) { + do { + x = x->BaseTyp; + } while (!(x == NIL || x == b)); + } + _o_result = x == b; + return _o_result; +} + +static struct ProcedureDeclaration__16 { + OPT_Node *x; + OPT_Object *proc, *fwd; + OPS_Name *name; + SHORTINT *mode, *vis; + BOOLEAN *forward; + struct ProcedureDeclaration__16 *lnk; +} *ProcedureDeclaration__16_s; + +static void Body__17 (void); +static void GetCode__19 (void); +static void GetParams__21 (void); +static void TProcDecl__23 (void); + +static void GetCode__19 (void) +{ + OPT_ConstExt ext = NIL; + INTEGER n; + LONGINT c; + ext = OPT_NewExt(); + (*ProcedureDeclaration__16_s->proc)->conval->ext = ext; + n = 0; + if (OPP_sym == 37) { + while (OPS_str[__X(n, ((LONGINT)(256)))] != 0x00) { + (*ext)[__X(n + 1, ((LONGINT)(256)))] = OPS_str[__X(n, ((LONGINT)(256)))]; + n += 1; + } + (*ext)[0] = (CHAR)n; + OPS_Get(&OPP_sym); + } else { + for (;;) { + if (OPP_sym == 35) { + c = OPS_intval; + n += 1; + if ((c < 0 || c > 255) || n == 256) { + OPP_err(64); + c = 1; + n = 1; + } + OPS_Get(&OPP_sym); + (*ext)[__X(n, ((LONGINT)(256)))] = (CHAR)c; + } + if (OPP_sym == 19) { + OPS_Get(&OPP_sym); + } else if (OPP_sym == 35) { + OPP_err(19); + } else { + (*ext)[0] = (CHAR)n; + break; + } + } + } + (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1); +} + +static void GetParams__21 (void) +{ + (*ProcedureDeclaration__16_s->proc)->vis = *ProcedureDeclaration__16_s->vis; + (*ProcedureDeclaration__16_s->proc)->mode = *ProcedureDeclaration__16_s->mode; + (*ProcedureDeclaration__16_s->proc)->typ = OPT_notyp; + (*ProcedureDeclaration__16_s->proc)->conval = OPT_NewConst(); + (*ProcedureDeclaration__16_s->proc)->conval->setval = 0x0; + if (OPP_sym == 30) { + OPS_Get(&OPP_sym); + OPP_FormalParameters(&(*ProcedureDeclaration__16_s->proc)->link, &(*ProcedureDeclaration__16_s->proc)->typ); + } + if (*ProcedureDeclaration__16_s->fwd != NIL) { + OPB_CheckParameters((*ProcedureDeclaration__16_s->proc)->link, (*ProcedureDeclaration__16_s->fwd)->link, 1); + if ((*ProcedureDeclaration__16_s->proc)->typ != (*ProcedureDeclaration__16_s->fwd)->typ) { + OPP_err(117); + } + *ProcedureDeclaration__16_s->proc = *ProcedureDeclaration__16_s->fwd; + OPT_topScope = (*ProcedureDeclaration__16_s->proc)->scope; + if (*ProcedureDeclaration__16_s->mode == 10) { + (*ProcedureDeclaration__16_s->proc)->mode = 10; + } + } +} + +static void Body__17 (void) +{ + OPT_Node procdec = NIL, statseq = NIL; + LONGINT c; + c = OPM_errpos; + (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1); + OPP_CheckSym(39); + OPP_Block(&procdec, &statseq); + OPB_Enter(&procdec, statseq, *ProcedureDeclaration__16_s->proc); + *ProcedureDeclaration__16_s->x = procdec; + (*ProcedureDeclaration__16_s->x)->conval = OPT_NewConst(); + (*ProcedureDeclaration__16_s->x)->conval->intval = c; + if (OPP_sym == 38) { + if (__STRCMP(OPS_name, (*ProcedureDeclaration__16_s->proc)->name) != 0) { + OPP_err(4); + } + OPS_Get(&OPP_sym); + } else { + OPP_err(38); + } +} + +static void TProcDecl__23 (void) +{ + OPT_Object baseProc = NIL; + OPT_Struct objTyp = NIL, recTyp = NIL; + SHORTINT objMode; + OPS_Name objName; + OPS_Get(&OPP_sym); + *ProcedureDeclaration__16_s->mode = 13; + if (OPP_level > 0) { + OPP_err(73); + } + OPP_Receiver(&objMode, objName, &objTyp, &recTyp); + if (OPP_sym == 38) { + __COPY(OPS_name, *ProcedureDeclaration__16_s->name, ((LONGINT)(256))); + OPP_CheckMark(&*ProcedureDeclaration__16_s->vis); + OPT_FindField(*ProcedureDeclaration__16_s->name, recTyp, &*ProcedureDeclaration__16_s->fwd); + OPT_FindField(*ProcedureDeclaration__16_s->name, recTyp->BaseTyp, &baseProc); + if ((baseProc != NIL && baseProc->mode != 13)) { + baseProc = NIL; + } + if (*ProcedureDeclaration__16_s->fwd == baseProc) { + *ProcedureDeclaration__16_s->fwd = NIL; + } + if ((*ProcedureDeclaration__16_s->fwd != NIL && (*ProcedureDeclaration__16_s->fwd)->mnolev != OPP_level)) { + *ProcedureDeclaration__16_s->fwd = NIL; + } + if ((((*ProcedureDeclaration__16_s->fwd != NIL && (*ProcedureDeclaration__16_s->fwd)->mode == 13)) && !__IN(1, (*ProcedureDeclaration__16_s->fwd)->conval->setval))) { + *ProcedureDeclaration__16_s->proc = OPT_NewObj(); + (*ProcedureDeclaration__16_s->proc)->leaf = 1; + if ((*ProcedureDeclaration__16_s->fwd)->vis != *ProcedureDeclaration__16_s->vis) { + OPP_err(118); + } + } else { + if (*ProcedureDeclaration__16_s->fwd != NIL) { + OPP_err(1); + *ProcedureDeclaration__16_s->fwd = NIL; + } + OPT_OpenScope(0, NIL); + OPT_topScope->right = recTyp->link; + OPT_Insert(*ProcedureDeclaration__16_s->name, &*ProcedureDeclaration__16_s->proc); + recTyp->link = OPT_topScope->right; + OPT_CloseScope(); + } + OPP_level += 1; + OPT_OpenScope(OPP_level, *ProcedureDeclaration__16_s->proc); + OPT_Insert(objName, &(*ProcedureDeclaration__16_s->proc)->link); + (*ProcedureDeclaration__16_s->proc)->link->mode = objMode; + (*ProcedureDeclaration__16_s->proc)->link->typ = objTyp; + GetParams__21(); + if (baseProc != NIL) { + if (objMode != baseProc->link->mode || !OPP_Extends(objTyp, baseProc->link->typ)) { + OPP_err(115); + } + OPB_CheckParameters((*ProcedureDeclaration__16_s->proc)->link->link, baseProc->link->link, 0); + if ((*ProcedureDeclaration__16_s->proc)->typ != baseProc->typ) { + OPP_err(117); + } + if ((((((baseProc->vis == 1 && (*ProcedureDeclaration__16_s->proc)->vis == 0)) && recTyp->strobj != NIL)) && recTyp->strobj->vis == 1)) { + OPP_err(109); + } + (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(2); + } + if (!*ProcedureDeclaration__16_s->forward) { + Body__17(); + } + OPP_level -= 1; + OPT_CloseScope(); + } else { + OPP_err(38); + } +} + +static void OPP_ProcedureDeclaration (OPT_Node *x) +{ + OPT_Object proc = NIL, fwd = NIL; + OPS_Name name; + SHORTINT mode, vis; + BOOLEAN forward; + struct ProcedureDeclaration__16 _s; + _s.x = x; + _s.proc = &proc; + _s.fwd = &fwd; + _s.name = (void*)name; + _s.mode = &mode; + _s.vis = &vis; + _s.forward = &forward; + _s.lnk = ProcedureDeclaration__16_s; + ProcedureDeclaration__16_s = &_s; + proc = NIL; + forward = 0; + *x = NIL; + mode = 6; + if ((OPP_sym != 38 && OPP_sym != 30)) { + if (OPP_sym == 1) { + } else if (OPP_sym == 17) { + forward = 1; + } else if (OPP_sym == 6) { + mode = 10; + } else if (OPP_sym == 7) { + mode = 9; + } else { + OPP_err(38); + } + if ((__IN(mode, 0x0600) && !OPT_SYSimported)) { + OPP_err(135); + } + OPS_Get(&OPP_sym); + } + if (OPP_sym == 30) { + TProcDecl__23(); + } else if (OPP_sym == 38) { + OPT_Find(&fwd); + __COPY(OPS_name, name, ((LONGINT)(256))); + OPP_CheckMark(&vis); + if ((vis != 0 && mode == 6)) { + mode = 7; + } + if ((fwd != NIL && (fwd->mnolev != OPP_level || fwd->mode == 8))) { + fwd = NIL; + } + if ((((fwd != NIL && __IN(fwd->mode, 0xc0))) && !__IN(1, fwd->conval->setval))) { + proc = OPT_NewObj(); + proc->leaf = 1; + if (fwd->vis != vis) { + OPP_err(118); + } + } else { + if (fwd != NIL) { + OPP_err(1); + fwd = NIL; + } + OPT_Insert(name, &proc); + } + if ((mode != 6 && OPP_level > 0)) { + OPP_err(73); + } + OPP_level += 1; + OPT_OpenScope(OPP_level, proc); + proc->link = NIL; + GetParams__21(); + if (mode == 9) { + GetCode__19(); + } else if (!forward) { + Body__17(); + } + OPP_level -= 1; + OPT_CloseScope(); + } else { + OPP_err(38); + } + ProcedureDeclaration__16_s = _s.lnk; +} + +static void OPP_CaseLabelList (OPT_Node *lab, INTEGER LabelForm, INTEGER *n, OPP_CaseTable tab) +{ + OPT_Node x = NIL, y = NIL, lastlab = NIL; + INTEGER i, f; + LONGINT xval, yval; + *lab = NIL; + lastlab = NIL; + for (;;) { + OPP_ConstExpression(&x); + f = x->typ->form; + if (__IN(f, 0x78)) { + xval = x->conval->intval; + } else { + OPP_err(61); + xval = 1; + } + if (__IN(f, 0x70)) { + if (LabelForm < f) { + OPP_err(60); + } + } else if (LabelForm != f) { + OPP_err(60); + } + if (OPP_sym == 21) { + OPS_Get(&OPP_sym); + OPP_ConstExpression(&y); + yval = y->conval->intval; + if (((int)y->typ->form != f && !((__IN(f, 0x70) && __IN(y->typ->form, 0x70))))) { + OPP_err(60); + } + if (yval < xval) { + OPP_err(63); + yval = xval; + } + } else { + yval = xval; + } + x->conval->intval2 = yval; + i = *n; + if (i < 128) { + for (;;) { + if (i == 0) { + break; + } + if (tab[__X(i - 1, ((LONGINT)(128)))].low <= yval) { + if (tab[__X(i - 1, ((LONGINT)(128)))].high >= xval) { + OPP_err(62); + } + break; + } + tab[__X(i, ((LONGINT)(128)))] = tab[__X(i - 1, ((LONGINT)(128)))]; + i -= 1; + } + tab[__X(i, ((LONGINT)(128)))].low = xval; + tab[__X(i, ((LONGINT)(128)))].high = yval; + *n += 1; + } else { + OPP_err(213); + } + OPB_Link(&*lab, &lastlab, x); + if (OPP_sym == 19) { + OPS_Get(&OPP_sym); + } else if (OPP_sym == 35 || OPP_sym == 38) { + OPP_err(19); + } else { + break; + } + } +} + +static struct StatSeq__30 { + LONGINT *pos; + struct StatSeq__30 *lnk; +} *StatSeq__30_s; + +static void CasePart__31 (OPT_Node *x); +static void CheckBool__33 (OPT_Node *x); +static void SetPos__35 (OPT_Node x); + +static void CasePart__31 (OPT_Node *x) +{ + INTEGER n; + LONGINT low, high; + BOOLEAN e; + OPP_CaseTable tab; + OPT_Node cases = NIL, lab = NIL, y = NIL, lastcase = NIL; + OPP_Expression(&*x); + *StatSeq__30_s->pos = OPM_errpos; + if ((*x)->class == 8 || (*x)->class == 9) { + OPP_err(126); + } else if (!__IN((*x)->typ->form, 0x78)) { + OPP_err(125); + } + OPP_CheckSym(25); + cases = NIL; + lastcase = NIL; + n = 0; + for (;;) { + if (OPP_sym < 40) { + OPP_CaseLabelList(&lab, (*x)->typ->form, &n, tab); + OPP_CheckSym(20); + OPP_StatSeq(&y); + OPB_Construct(17, &lab, y); + OPB_Link(&cases, &lastcase, lab); + } + if (OPP_sym == 40) { + OPS_Get(&OPP_sym); + } else { + break; + } + } + if (n > 0) { + low = tab[0].low; + high = tab[__X(n - 1, ((LONGINT)(128)))].high; + if (high - low > 512) { + OPP_err(209); + } + } else { + low = 1; + high = 0; + } + e = OPP_sym == 42; + if (e) { + OPS_Get(&OPP_sym); + OPP_StatSeq(&y); + } else { + y = NIL; + OPM_Mark(-307, OPM_curpos); + } + OPB_Construct(16, &cases, y); + OPB_Construct(21, &*x, cases); + cases->conval = OPT_NewConst(); + cases->conval->intval = low; + cases->conval->intval2 = high; + if (e) { + cases->conval->setval = 0x02; + } else { + cases->conval->setval = 0x0; + } +} + +static void SetPos__35 (OPT_Node x) +{ + x->conval = OPT_NewConst(); + x->conval->intval = *StatSeq__30_s->pos; +} + +static void CheckBool__33 (OPT_Node *x) +{ + if ((*x)->class == 8 || (*x)->class == 9) { + OPP_err(126); + *x = OPB_NewBoolConst(0); + } else if ((*x)->typ->form != 2) { + OPP_err(120); + *x = OPB_NewBoolConst(0); + } + *StatSeq__30_s->pos = OPM_errpos; +} + +static void OPP_StatSeq (OPT_Node *stat) +{ + OPT_Object fpar = NIL, id = NIL, t = NIL, obj = NIL; + OPT_Struct idtyp = NIL; + BOOLEAN e; + OPT_Node s = NIL, x = NIL, y = NIL, z = NIL, apar = NIL, last = NIL, lastif = NIL; + LONGINT pos; + OPS_Name name; + struct StatSeq__30 _s; + _s.pos = &pos; + _s.lnk = StatSeq__30_s; + StatSeq__30_s = &_s; + *stat = NIL; + last = NIL; + for (;;) { + x = NIL; + if (OPP_sym < 38) { + OPP_err(14); + do { + OPS_Get(&OPP_sym); + } while (!(OPP_sym >= 38)); + } + if (OPP_sym == 38) { + OPP_qualident(&id); + x = OPB_NewLeaf(id); + OPP_selector(&x); + if (OPP_sym == 34) { + OPS_Get(&OPP_sym); + OPP_Expression(&y); + OPB_Assign(&x, y); + } else if (OPP_sym == 9) { + OPP_err(34); + OPS_Get(&OPP_sym); + OPP_Expression(&y); + OPB_Assign(&x, y); + } else if ((x->class == 9 && x->obj->mode == 8)) { + OPP_StandProcCall(&x); + if ((x != NIL && x->typ != OPT_notyp)) { + OPP_err(55); + } + } else { + OPB_PrepCall(&x, &fpar); + if (OPP_sym == 30) { + OPS_Get(&OPP_sym); + OPP_ActualParameters(&apar, fpar); + OPP_CheckSym(22); + } else { + apar = NIL; + if (fpar != NIL) { + OPP_err(65); + } + } + OPB_Call(&x, apar, fpar); + if (x->typ != OPT_notyp) { + OPP_err(55); + } + if (OPP_level > 0) { + OPT_topScope->link->leaf = 0; + } + } + pos = OPM_errpos; + } else if (OPP_sym == 45) { + OPS_Get(&OPP_sym); + OPP_Expression(&x); + CheckBool__33(&x); + OPP_CheckSym(26); + OPP_StatSeq(&y); + OPB_Construct(15, &x, y); + SetPos__35(x); + lastif = x; + while (OPP_sym == 43) { + OPS_Get(&OPP_sym); + OPP_Expression(&y); + CheckBool__33(&y); + OPP_CheckSym(26); + OPP_StatSeq(&z); + OPB_Construct(15, &y, z); + SetPos__35(y); + OPB_Link(&x, &lastif, y); + } + if (OPP_sym == 42) { + OPS_Get(&OPP_sym); + OPP_StatSeq(&y); + } else { + y = NIL; + } + OPB_Construct(20, &x, y); + OPP_CheckSym(41); + OPB_OptIf(&x); + pos = OPM_errpos; + } else if (OPP_sym == 46) { + OPS_Get(&OPP_sym); + CasePart__31(&x); + OPP_CheckSym(41); + } else if (OPP_sym == 47) { + OPS_Get(&OPP_sym); + OPP_Expression(&x); + CheckBool__33(&x); + OPP_CheckSym(27); + OPP_StatSeq(&y); + OPB_Construct(22, &x, y); + OPP_CheckSym(41); + } else if (OPP_sym == 48) { + OPS_Get(&OPP_sym); + OPP_StatSeq(&x); + if (OPP_sym == 44) { + OPS_Get(&OPP_sym); + OPP_Expression(&y); + CheckBool__33(&y); + } else { + OPP_err(44); + } + OPB_Construct(23, &x, y); + } else if (OPP_sym == 49) { + OPS_Get(&OPP_sym); + if (OPP_sym == 38) { + OPP_qualident(&id); + if (!__IN(id->typ->form, 0x70)) { + OPP_err(68); + } + OPP_CheckSym(34); + OPP_Expression(&y); + pos = OPM_errpos; + x = OPB_NewLeaf(id); + OPB_Assign(&x, y); + SetPos__35(x); + OPP_CheckSym(28); + OPP_Expression(&y); + pos = OPM_errpos; + if (y->class != 7) { + __MOVE("@@", name, 3); + OPT_Insert(name, &t); + __MOVE("@for", t->name, 5); + t->mode = 1; + t->typ = x->left->typ; + obj = OPT_topScope->scope; + if (obj == NIL) { + OPT_topScope->scope = t; + } else { + while (obj->link != NIL) { + obj = obj->link; + } + obj->link = t; + } + z = OPB_NewLeaf(t); + OPB_Assign(&z, y); + SetPos__35(z); + OPB_Link(&*stat, &last, z); + y = OPB_NewLeaf(t); + } else if (y->typ->form < 4 || y->typ->form > x->left->typ->form) { + OPP_err(113); + } + OPB_Link(&*stat, &last, x); + if (OPP_sym == 29) { + OPS_Get(&OPP_sym); + OPP_ConstExpression(&z); + } else { + z = OPB_NewIntConst(((LONGINT)(1))); + } + pos = OPM_errpos; + x = OPB_NewLeaf(id); + if (z->conval->intval > 0) { + OPB_Op(12, &x, y); + } else if (z->conval->intval < 0) { + OPB_Op(14, &x, y); + } else { + OPP_err(63); + OPB_Op(14, &x, y); + } + OPP_CheckSym(27); + OPP_StatSeq(&s); + y = OPB_NewLeaf(id); + OPB_StPar1(&y, z, 13); + SetPos__35(y); + if (s == NIL) { + s = y; + } else { + z = s; + while (z->link != NIL) { + z = z->link; + } + z->link = y; + } + OPP_CheckSym(41); + OPB_Construct(22, &x, s); + } else { + OPP_err(38); + } + } else if (OPP_sym == 50) { + OPS_Get(&OPP_sym); + OPP_LoopLevel += 1; + OPP_StatSeq(&x); + OPP_LoopLevel -= 1; + OPB_Construct(24, &x, NIL); + OPP_CheckSym(41); + pos = OPM_errpos; + } else if (OPP_sym == 51) { + OPS_Get(&OPP_sym); + idtyp = NIL; + x = NIL; + for (;;) { + if (OPP_sym == 38) { + OPP_qualident(&id); + y = OPB_NewLeaf(id); + if ((((id != NIL && id->typ->form == 13)) && (id->mode == 2 || !id->leaf))) { + OPP_err(245); + } + OPP_CheckSym(20); + if (OPP_sym == 38) { + OPP_qualident(&t); + if (t->mode == 5) { + if (id != NIL) { + idtyp = id->typ; + OPB_TypTest(&y, t, 0); + id->typ = t->typ; + } else { + OPP_err(130); + } + } else { + OPP_err(52); + } + } else { + OPP_err(38); + } + } else { + OPP_err(38); + } + pos = OPM_errpos; + OPP_CheckSym(27); + OPP_StatSeq(&s); + OPB_Construct(15, &y, s); + SetPos__35(y); + if (idtyp != NIL) { + id->typ = idtyp; + idtyp = NIL; + } + if (x == NIL) { + x = y; + lastif = x; + } else { + OPB_Link(&x, &lastif, y); + } + if (OPP_sym == 40) { + OPS_Get(&OPP_sym); + } else { + break; + } + } + e = OPP_sym == 42; + if (e) { + OPS_Get(&OPP_sym); + OPP_StatSeq(&s); + } else { + s = NIL; + } + OPB_Construct(27, &x, s); + OPP_CheckSym(41); + if (e) { + x->subcl = 1; + } + } else if (OPP_sym == 52) { + OPS_Get(&OPP_sym); + if (OPP_LoopLevel == 0) { + OPP_err(46); + } + OPB_Construct(25, &x, NIL); + pos = OPM_errpos; + } else if (OPP_sym == 53) { + OPS_Get(&OPP_sym); + if (OPP_sym < 39) { + OPP_Expression(&x); + } + if (OPP_level > 0) { + OPB_Return(&x, OPT_topScope->link); + } else { + OPB_Return(&x, NIL); + } + pos = OPM_errpos; + } + if (x != NIL) { + SetPos__35(x); + OPB_Link(&*stat, &last, x); + } + if (OPP_sym == 39) { + OPS_Get(&OPP_sym); + } else if (OPP_sym <= 38 || (45 <= OPP_sym && OPP_sym <= 53)) { + OPP_err(39); + } else { + break; + } + } + StatSeq__30_s = _s.lnk; +} + +static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) +{ + OPT_Struct typ = NIL; + OPT_Object obj = NIL, first = NIL, last = NIL; + OPT_Node x = NIL, lastdec = NIL; + INTEGER i; + first = NIL; + last = NIL; + OPP_nofFwdPtr = 0; + for (;;) { + if (OPP_sym == 58) { + OPS_Get(&OPP_sym); + while (OPP_sym == 38) { + OPT_Insert(OPS_name, &obj); + OPP_CheckMark(&obj->vis); + obj->typ = OPT_sinttyp; + obj->mode = 1; + if (OPP_sym == 9) { + OPS_Get(&OPP_sym); + OPP_ConstExpression(&x); + } else if (OPP_sym == 34) { + OPP_err(9); + OPS_Get(&OPP_sym); + OPP_ConstExpression(&x); + } else { + OPP_err(9); + x = OPB_NewIntConst(((LONGINT)(1))); + } + obj->mode = 3; + obj->typ = x->typ; + obj->conval = x->conval; + OPP_CheckSym(39); + } + } + if (OPP_sym == 59) { + OPS_Get(&OPP_sym); + while (OPP_sym == 38) { + OPT_Insert(OPS_name, &obj); + obj->mode = 5; + obj->typ = OPT_undftyp; + OPP_CheckMark(&obj->vis); + if (OPP_sym == 9) { + OPS_Get(&OPP_sym); + OPP_TypeDecl(&obj->typ, &obj->typ); + } else if (OPP_sym == 34 || OPP_sym == 20) { + OPP_err(9); + OPS_Get(&OPP_sym); + OPP_TypeDecl(&obj->typ, &obj->typ); + } else { + OPP_err(9); + } + if (obj->typ->strobj == NIL) { + obj->typ->strobj = obj; + } + if (__IN(obj->typ->comp, 0x1c)) { + i = 0; + while (i < OPP_nofFwdPtr) { + typ = OPP_FwdPtr[__X(i, ((LONGINT)(64)))]; + i += 1; + if (__STRCMP(typ->link->name, obj->name) == 0) { + typ->BaseTyp = obj->typ; + typ->link->name[0] = 0x00; + } + } + } + OPP_CheckSym(39); + } + } + if (OPP_sym == 60) { + OPS_Get(&OPP_sym); + while (OPP_sym == 38) { + for (;;) { + if (OPP_sym == 38) { + OPT_Insert(OPS_name, &obj); + OPP_CheckMark(&obj->vis); + obj->mode = 1; + obj->link = NIL; + obj->leaf = obj->vis == 0; + obj->typ = OPT_undftyp; + if (first == NIL) { + first = obj; + } + if (last == NIL) { + OPT_topScope->scope = obj; + } else { + last->link = obj; + } + last = obj; + } else { + OPP_err(38); + } + if (OPP_sym == 19) { + OPS_Get(&OPP_sym); + } else if (OPP_sym == 38) { + OPP_err(19); + } else { + break; + } + } + OPP_CheckSym(20); + OPP_Type(&typ, &OPT_notyp); + typ->pvused = 1; + if (typ->comp == 3) { + typ = OPT_undftyp; + OPP_err(88); + } + while (first != NIL) { + first->typ = typ; + first = first->link; + } + OPP_CheckSym(39); + } + } + if (OPP_sym < 58 || OPP_sym > 60) { + break; + } + } + i = 0; + while (i < OPP_nofFwdPtr) { + if (OPP_FwdPtr[__X(i, ((LONGINT)(64)))]->link->name[0] != 0x00) { + OPP_err(128); + } + OPP_FwdPtr[__X(i, ((LONGINT)(64)))] = NIL; + i += 1; + } + OPT_topScope->adr = OPM_errpos; + *procdec = NIL; + lastdec = NIL; + while (OPP_sym == 61) { + OPS_Get(&OPP_sym); + OPP_ProcedureDeclaration(&x); + if (x != NIL) { + if (lastdec == NIL) { + *procdec = x; + } else { + lastdec->link = x; + } + lastdec = x; + } + OPP_CheckSym(39); + } + if (OPP_sym == 57) { + OPS_Get(&OPP_sym); + OPP_StatSeq(&*statseq); + } else { + *statseq = NIL; + } + if ((OPP_level == 0 && OPP_TDinit != NIL)) { + OPP_lastTDinit->link = *statseq; + *statseq = OPP_TDinit; + } + OPP_CheckSym(41); +} + +void OPP_Module (OPT_Node *prog, SET opt) +{ + OPS_Name impName, aliasName; + OPT_Node procdec = NIL, statseq = NIL; + LONGINT c; + BOOLEAN done; + OPS_Init(); + OPP_LoopLevel = 0; + OPP_level = 0; + OPS_Get(&OPP_sym); + if (OPP_sym == 63) { + OPS_Get(&OPP_sym); + } else { + OPP_err(16); + } + if (OPP_sym == 38) { + OPM_LogWStr((CHAR*)"compiling ", (LONGINT)11); + OPM_LogWStr(OPS_name, ((LONGINT)(256))); + OPM_LogW('.'); + OPT_Init(OPS_name, opt); + OPS_Get(&OPP_sym); + OPP_CheckSym(39); + if (OPP_sym == 62) { + OPS_Get(&OPP_sym); + for (;;) { + if (OPP_sym == 38) { + __COPY(OPS_name, aliasName, ((LONGINT)(256))); + __COPY(aliasName, impName, ((LONGINT)(256))); + OPS_Get(&OPP_sym); + if (OPP_sym == 34) { + OPS_Get(&OPP_sym); + if (OPP_sym == 38) { + __COPY(OPS_name, impName, ((LONGINT)(256))); + OPS_Get(&OPP_sym); + } else { + OPP_err(38); + } + } + OPT_Import(aliasName, impName, &done); + } else { + OPP_err(38); + } + if (OPP_sym == 19) { + OPS_Get(&OPP_sym); + } else if (OPP_sym == 38) { + OPP_err(19); + } else { + break; + } + } + OPP_CheckSym(39); + } + if (OPM_noerr) { + OPP_TDinit = NIL; + OPP_lastTDinit = NIL; + c = OPM_errpos; + OPP_Block(&procdec, &statseq); + OPB_Enter(&procdec, statseq, NIL); + *prog = procdec; + (*prog)->conval = OPT_NewConst(); + (*prog)->conval->intval = c; + if (OPP_sym == 38) { + if (__STRCMP(OPS_name, OPT_SelfName) != 0) { + OPP_err(4); + } + OPS_Get(&OPP_sym); + } else { + OPP_err(38); + } + if (OPP_sym != 18) { + OPP_err(18); + } + } + } else { + OPP_err(38); + } + OPP_TDinit = NIL; + OPP_lastTDinit = NIL; +} + +static void EnumPtrs(void (*P)(void*)) +{ + P(OPP_TDinit); + P(OPP_lastTDinit); + __ENUMP(OPP_FwdPtr, 64, P); +} + +__TDESC(OPP__1, 1, 0) = {__TDFLDS("", 16), {-8}}; + +export void *OPP__init(void) +{ + __DEFMOD; + __MODULE_IMPORT(OPB); + __MODULE_IMPORT(OPM); + __MODULE_IMPORT(OPS); + __MODULE_IMPORT(OPT); + __REGMOD("OPP", EnumPtrs); + __INITYP(OPP__1, OPP__1, 0); +/* BEGIN */ + __ENDMOD; +} diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h new file mode 100644 index 00000000..30cf0643 --- /dev/null +++ b/bootstrap/windows-88/OPP.h @@ -0,0 +1,17 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ + +#ifndef OPP__h +#define OPP__h + +#define LARGE +#include "SYSTEM.h" +#include "OPT.h" + + + + +import void OPP_Module (OPT_Node *prog, SET opt); +import void *OPP__init(void); + + +#endif diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c new file mode 100644 index 00000000..bb08e1f5 --- /dev/null +++ b/bootstrap/windows-88/OPS.c @@ -0,0 +1,624 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin tspkaSfF */ +#define LARGE +#include "SYSTEM.h" +#include "OPM.h" + +typedef + CHAR OPS_Name[256]; + +typedef + CHAR OPS_String[256]; + + +export OPS_Name OPS_name; +export OPS_String OPS_str; +export INTEGER OPS_numtyp; +export LONGINT OPS_intval; +export REAL OPS_realval; +export LONGREAL OPS_lrlval; +static CHAR OPS_ch; + + +export void OPS_Get (SHORTINT *sym); +static void OPS_Identifier (SHORTINT *sym); +export void OPS_Init (void); +static void OPS_Number (void); +static void OPS_Str (SHORTINT *sym); +static void OPS_err (INTEGER n); + + +static void OPS_err (INTEGER n) +{ + OPM_err(n); +} + +static void OPS_Str (SHORTINT *sym) +{ + INTEGER i; + CHAR och; + i = 0; + och = OPS_ch; + for (;;) { + OPM_Get(&OPS_ch); + if (OPS_ch == och) { + break; + } + if (OPS_ch < ' ') { + OPS_err(3); + break; + } + if (i == 255) { + OPS_err(241); + break; + } + OPS_str[i] = OPS_ch; + i += 1; + } + OPM_Get(&OPS_ch); + OPS_str[i] = 0x00; + OPS_intval = i + 1; + if (OPS_intval == 2) { + *sym = 35; + OPS_numtyp = 1; + OPS_intval = (int)OPS_str[0]; + } else { + *sym = 37; + } +} + +static void OPS_Identifier (SHORTINT *sym) +{ + INTEGER i; + i = 0; + do { + OPS_name[i] = OPS_ch; + i += 1; + OPM_Get(&OPS_ch); + } while (!(((OPS_ch < '0' || ('9' < OPS_ch && __CAP(OPS_ch) < 'A')) || 'Z' < __CAP(OPS_ch)) || i == 256)); + if (i == 256) { + OPS_err(240); + i -= 1; + } + OPS_name[i] = 0x00; + *sym = 38; +} + +static struct Number__6 { + struct Number__6 *lnk; +} *Number__6_s; + +static INTEGER Ord__7 (CHAR ch, BOOLEAN hex); +static LONGREAL Ten__9 (INTEGER e); + +static LONGREAL Ten__9 (INTEGER e) +{ + LONGREAL _o_result; + LONGREAL x, p; + x = (LONGREAL)1; + p = (LONGREAL)10; + while (e > 0) { + if (__ODD(e)) { + x = x * p; + } + e = __ASHR(e, 1); + if (e > 0) { + p = p * p; + } + } + _o_result = x; + return _o_result; +} + +static INTEGER Ord__7 (CHAR ch, BOOLEAN hex) +{ + INTEGER _o_result; + if (ch <= '9') { + _o_result = (int)ch - 48; + return _o_result; + } else if (hex) { + _o_result = ((int)ch - 65) + 10; + return _o_result; + } else { + OPS_err(2); + _o_result = 0; + return _o_result; + } + __RETCHK; +} + +static void OPS_Number (void) +{ + INTEGER i, m, n, d, e; + CHAR dig[24]; + LONGREAL f; + CHAR expCh; + BOOLEAN neg; + struct Number__6 _s; + _s.lnk = Number__6_s; + Number__6_s = &_s; + i = 0; + m = 0; + n = 0; + d = 0; + for (;;) { + if (('0' <= OPS_ch && OPS_ch <= '9') || (((d == 0 && 'A' <= OPS_ch)) && OPS_ch <= 'F')) { + if (m > 0 || OPS_ch != '0') { + if (n < 24) { + dig[n] = OPS_ch; + n += 1; + } + m += 1; + } + OPM_Get(&OPS_ch); + i += 1; + } else if (OPS_ch == '.') { + OPM_Get(&OPS_ch); + if (OPS_ch == '.') { + OPS_ch = 0x7f; + break; + } else if (d == 0) { + d = i; + } else { + OPS_err(2); + } + } else { + break; + } + } + if (d == 0) { + if (n == m) { + OPS_intval = 0; + i = 0; + if (OPS_ch == 'X') { + OPM_Get(&OPS_ch); + OPS_numtyp = 1; + if (n <= 2) { + while (i < n) { + OPS_intval = __ASHL(OPS_intval, 4) + (LONGINT)Ord__7(dig[i], 1); + i += 1; + } + } else { + OPS_err(203); + } + } else if (OPS_ch == 'H') { + OPM_Get(&OPS_ch); + OPS_numtyp = 2; + if (n <= 8) { + if ((n == 8 && dig[0] > '7')) { + OPS_intval = -1; + } + while (i < n) { + OPS_intval = __ASHL(OPS_intval, 4) + (LONGINT)Ord__7(dig[i], 1); + i += 1; + } + } else { + OPS_err(203); + } + } else { + OPS_numtyp = 2; + while (i < n) { + d = Ord__7(dig[i], 0); + i += 1; + if (OPS_intval <= __DIV(9223372036854775807 - (LONGINT)d, 10)) { + OPS_intval = OPS_intval * 10 + (LONGINT)d; + } else { + OPS_err(203); + } + } + } + } else { + OPS_err(203); + } + } else { + f = (LONGREAL)0; + e = 0; + expCh = 'E'; + while (n > 0) { + n -= 1; + f = (Ord__7(dig[n], 0) + f) / (LONGREAL)(LONGREAL)10; + } + if (OPS_ch == 'E' || OPS_ch == 'D') { + expCh = OPS_ch; + OPM_Get(&OPS_ch); + neg = 0; + if (OPS_ch == '-') { + neg = 1; + OPM_Get(&OPS_ch); + } else if (OPS_ch == '+') { + OPM_Get(&OPS_ch); + } + if (('0' <= OPS_ch && OPS_ch <= '9')) { + do { + n = Ord__7(OPS_ch, 0); + OPM_Get(&OPS_ch); + if (e <= __DIV(2147483647 - n, 10)) { + e = e * 10 + n; + } else { + OPS_err(203); + } + } while (!(OPS_ch < '0' || '9' < OPS_ch)); + if (neg) { + e = -e; + } + } else { + OPS_err(2); + } + } + e -= (i - d) - m; + if (expCh == 'E') { + OPS_numtyp = 3; + if ((-37 < e && e <= 38)) { + if (e < 0) { + OPS_realval = (f / (LONGREAL)Ten__9(-e)); + } else { + OPS_realval = (f * Ten__9(e)); + } + } else { + OPS_err(203); + } + } else { + OPS_numtyp = 4; + if ((-307 < e && e <= 308)) { + if (e < 0) { + OPS_lrlval = f / (LONGREAL)Ten__9(-e); + } else { + OPS_lrlval = f * Ten__9(e); + } + } else { + OPS_err(203); + } + } + } + Number__6_s = _s.lnk; +} + +static struct Get__1 { + struct Get__1 *lnk; +} *Get__1_s; + +static void Comment__2 (void); + +static void Comment__2 (void) +{ + OPM_Get(&OPS_ch); + for (;;) { + for (;;) { + while (OPS_ch == '(') { + OPM_Get(&OPS_ch); + if (OPS_ch == '*') { + Comment__2(); + } + } + if (OPS_ch == '*') { + OPM_Get(&OPS_ch); + break; + } + if (OPS_ch == 0x00) { + break; + } + OPM_Get(&OPS_ch); + } + if (OPS_ch == ')') { + OPM_Get(&OPS_ch); + break; + } + if (OPS_ch == 0x00) { + OPS_err(5); + break; + } + } +} + +void OPS_Get (SHORTINT *sym) +{ + SHORTINT s; + struct Get__1 _s; + _s.lnk = Get__1_s; + Get__1_s = &_s; + OPM_errpos = OPM_curpos - 1; + while (OPS_ch <= ' ') { + if (OPS_ch == 0x00) { + *sym = 64; + return; + } else { + OPM_Get(&OPS_ch); + } + } + switch (OPS_ch) { + case '\"': case '\'': + OPS_Str(&s); + break; + case '#': + s = 10; + OPM_Get(&OPS_ch); + break; + case '&': + s = 5; + OPM_Get(&OPS_ch); + break; + case '(': + OPM_Get(&OPS_ch); + if (OPS_ch == '*') { + Comment__2(); + OPS_Get(&s); + } else { + s = 30; + } + break; + case ')': + s = 22; + OPM_Get(&OPS_ch); + break; + case '*': + s = 1; + OPM_Get(&OPS_ch); + break; + case '+': + s = 6; + OPM_Get(&OPS_ch); + break; + case ',': + s = 19; + OPM_Get(&OPS_ch); + break; + case '-': + s = 7; + OPM_Get(&OPS_ch); + break; + case '.': + OPM_Get(&OPS_ch); + if (OPS_ch == '.') { + OPM_Get(&OPS_ch); + s = 21; + } else { + s = 18; + } + break; + case '/': + s = 2; + OPM_Get(&OPS_ch); + break; + case '0': case '1': case '2': case '3': case '4': + case '5': case '6': case '7': case '8': case '9': + OPS_Number(); + s = 35; + break; + case ':': + OPM_Get(&OPS_ch); + if (OPS_ch == '=') { + OPM_Get(&OPS_ch); + s = 34; + } else { + s = 20; + } + break; + case ';': + s = 39; + OPM_Get(&OPS_ch); + break; + case '<': + OPM_Get(&OPS_ch); + if (OPS_ch == '=') { + OPM_Get(&OPS_ch); + s = 12; + } else { + s = 11; + } + break; + case '=': + s = 9; + OPM_Get(&OPS_ch); + break; + case '>': + OPM_Get(&OPS_ch); + if (OPS_ch == '=') { + OPM_Get(&OPS_ch); + s = 14; + } else { + s = 13; + } + break; + case 'A': + OPS_Identifier(&s); + if (__STRCMP(OPS_name, "ARRAY") == 0) { + s = 54; + } + break; + case 'B': + OPS_Identifier(&s); + if (__STRCMP(OPS_name, "BEGIN") == 0) { + s = 57; + } else if (__STRCMP(OPS_name, "BY") == 0) { + s = 29; + } + break; + case 'C': + OPS_Identifier(&s); + if (__STRCMP(OPS_name, "CASE") == 0) { + s = 46; + } else if (__STRCMP(OPS_name, "CONST") == 0) { + s = 58; + } + break; + case 'D': + OPS_Identifier(&s); + if (__STRCMP(OPS_name, "DO") == 0) { + s = 27; + } else if (__STRCMP(OPS_name, "DIV") == 0) { + s = 3; + } + break; + case 'E': + OPS_Identifier(&s); + if (__STRCMP(OPS_name, "END") == 0) { + s = 41; + } else if (__STRCMP(OPS_name, "ELSE") == 0) { + s = 42; + } else if (__STRCMP(OPS_name, "ELSIF") == 0) { + s = 43; + } else if (__STRCMP(OPS_name, "EXIT") == 0) { + s = 52; + } + break; + case 'F': + OPS_Identifier(&s); + if (__STRCMP(OPS_name, "FOR") == 0) { + s = 49; + } + break; + case 'I': + OPS_Identifier(&s); + if (__STRCMP(OPS_name, "IF") == 0) { + s = 45; + } else if (__STRCMP(OPS_name, "IN") == 0) { + s = 15; + } else if (__STRCMP(OPS_name, "IS") == 0) { + s = 16; + } else if (__STRCMP(OPS_name, "IMPORT") == 0) { + s = 62; + } + break; + case 'L': + OPS_Identifier(&s); + if (__STRCMP(OPS_name, "LOOP") == 0) { + s = 50; + } + break; + case 'M': + OPS_Identifier(&s); + if (__STRCMP(OPS_name, "MOD") == 0) { + s = 4; + } else if (__STRCMP(OPS_name, "MODULE") == 0) { + s = 63; + } + break; + case 'N': + OPS_Identifier(&s); + if (__STRCMP(OPS_name, "NIL") == 0) { + s = 36; + } + break; + case 'O': + OPS_Identifier(&s); + if (__STRCMP(OPS_name, "OR") == 0) { + s = 8; + } else if (__STRCMP(OPS_name, "OF") == 0) { + s = 25; + } + break; + case 'P': + OPS_Identifier(&s); + if (__STRCMP(OPS_name, "PROCEDURE") == 0) { + s = 61; + } else if (__STRCMP(OPS_name, "POINTER") == 0) { + s = 56; + } + break; + case 'R': + OPS_Identifier(&s); + if (__STRCMP(OPS_name, "RECORD") == 0) { + s = 55; + } else if (__STRCMP(OPS_name, "REPEAT") == 0) { + s = 48; + } else if (__STRCMP(OPS_name, "RETURN") == 0) { + s = 53; + } + break; + case 'T': + OPS_Identifier(&s); + if (__STRCMP(OPS_name, "THEN") == 0) { + s = 26; + } else if (__STRCMP(OPS_name, "TO") == 0) { + s = 28; + } else if (__STRCMP(OPS_name, "TYPE") == 0) { + s = 59; + } + break; + case 'U': + OPS_Identifier(&s); + if (__STRCMP(OPS_name, "UNTIL") == 0) { + s = 44; + } + break; + case 'V': + OPS_Identifier(&s); + if (__STRCMP(OPS_name, "VAR") == 0) { + s = 60; + } + break; + case 'W': + OPS_Identifier(&s); + if (__STRCMP(OPS_name, "WHILE") == 0) { + s = 47; + } else if (__STRCMP(OPS_name, "WITH") == 0) { + s = 51; + } + break; + case 'G': case 'H': case 'J': case 'K': case 'Q': + case 'S': case 'X': case 'Y': case 'Z': + OPS_Identifier(&s); + break; + case '[': + s = 31; + OPM_Get(&OPS_ch); + break; + case ']': + s = 23; + OPM_Get(&OPS_ch); + break; + case '^': + s = 17; + OPM_Get(&OPS_ch); + break; + case 'a': case 'b': case 'c': case 'd': case 'e': + case 'f': case 'g': case 'h': case 'i': case 'j': + case 'k': case 'l': case 'm': case 'n': case 'o': + case 'p': case 'q': case 'r': case 's': case 't': + case 'u': case 'v': case 'w': case 'x': case 'y': + case 'z': + OPS_Identifier(&s); + break; + case '{': + s = 32; + OPM_Get(&OPS_ch); + break; + case '|': + s = 40; + OPM_Get(&OPS_ch); + break; + case '}': + s = 24; + OPM_Get(&OPS_ch); + break; + case '~': + s = 33; + OPM_Get(&OPS_ch); + break; + case 0x7f: + s = 21; + OPM_Get(&OPS_ch); + break; + default: + s = 0; + OPM_Get(&OPS_ch); + break; + } + *sym = s; + Get__1_s = _s.lnk; +} + +void OPS_Init (void) +{ + OPS_ch = ' '; +} + + +export void *OPS__init(void) +{ + __DEFMOD; + __MODULE_IMPORT(OPM); + __REGMOD("OPS", 0); + __REGCMD("Init", OPS_Init); +/* BEGIN */ + __ENDMOD; +} diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h new file mode 100644 index 00000000..eab85912 --- /dev/null +++ b/bootstrap/windows-88/OPS.h @@ -0,0 +1,29 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin tspkaSfF */ + +#ifndef OPS__h +#define OPS__h + +#define LARGE +#include "SYSTEM.h" + +typedef + CHAR OPS_Name[256]; + +typedef + CHAR OPS_String[256]; + + +import OPS_Name OPS_name; +import OPS_String OPS_str; +import INTEGER OPS_numtyp; +import LONGINT OPS_intval; +import REAL OPS_realval; +import LONGREAL OPS_lrlval; + + +import void OPS_Get (SHORTINT *sym); +import void OPS_Init (void); +import void *OPS__init(void); + + +#endif diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c new file mode 100644 index 00000000..5f8854a1 --- /dev/null +++ b/bootstrap/windows-88/OPT.c @@ -0,0 +1,1859 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +#define LARGE +#include "SYSTEM.h" +#include "OPM.h" +#include "OPS.h" + +typedef + struct OPT_ConstDesc *OPT_Const; + +typedef + OPS_String *OPT_ConstExt; + +typedef + struct OPT_ConstDesc { + OPT_ConstExt ext; + LONGINT intval, intval2; + SET setval; + LONGREAL realval; + } OPT_ConstDesc; + +typedef + struct OPT_ExpCtxt { + LONGINT reffp; + INTEGER ref; + SHORTINT nofm; + SHORTINT locmno[64]; + } OPT_ExpCtxt; + +typedef + struct OPT_StrDesc *OPT_Struct; + +typedef + struct OPT_ObjDesc *OPT_Object; + +typedef + struct OPT_ImpCtxt { + LONGINT nextTag, reffp; + INTEGER nofr, minr, nofm; + BOOLEAN self; + OPT_Struct ref[255]; + OPT_Object old[255]; + LONGINT pvfp[255]; + SHORTINT glbmno[64]; + } OPT_ImpCtxt; + +typedef + struct OPT_NodeDesc *OPT_Node; + +typedef + struct OPT_NodeDesc { + OPT_Node left, right, link; + SHORTINT class, subcl; + BOOLEAN readonly; + OPT_Struct typ; + OPT_Object obj; + OPT_Const conval; + } OPT_NodeDesc; + +typedef + struct OPT_ObjDesc { + OPT_Object left, right, link, scope; + OPS_Name name; + BOOLEAN leaf; + SHORTINT mode, mnolev, vis, history; + BOOLEAN used, fpdone; + LONGINT fprint; + OPT_Struct typ; + OPT_Const conval; + LONGINT adr, linkadr; + INTEGER x; + } OPT_ObjDesc; + +typedef + struct OPT_StrDesc { + SHORTINT form, comp, mno, extlev; + INTEGER ref, sysflag; + LONGINT n, size, align, txtpos; + BOOLEAN allocated, pbused, pvused, fpdone, idfpdone; + LONGINT idfp, pbfp, pvfp; + OPT_Struct BaseTyp; + OPT_Object link, strobj; + } OPT_StrDesc; + + +export void (*OPT_typSize)(OPT_Struct); +export OPT_Object OPT_topScope; +export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +export SHORTINT OPT_nofGmod; +export OPT_Object OPT_GlbMod[64]; +export OPS_Name OPT_SelfName; +export BOOLEAN OPT_SYSimported; +static OPT_Object OPT_universe, OPT_syslink; +static OPT_ImpCtxt OPT_impCtxt; +static OPT_ExpCtxt OPT_expCtxt; +static LONGINT OPT_nofhdfld; +static BOOLEAN OPT_newsf, OPT_findpc, OPT_extsf, OPT_sfpresent, OPT_symExtended, OPT_symNew; + +export LONGINT *OPT_ConstDesc__typ; +export LONGINT *OPT_ObjDesc__typ; +export LONGINT *OPT_StrDesc__typ; +export LONGINT *OPT_NodeDesc__typ; +export LONGINT *OPT_ImpCtxt__typ; +export LONGINT *OPT_ExpCtxt__typ; + +export void OPT_Close (void); +export void OPT_CloseScope (void); +static void OPT_DebugStruct (OPT_Struct btyp); +static void OPT_EnterBoolConst (OPS_Name name, LONGINT value); +static void OPT_EnterProc (OPS_Name name, INTEGER num); +static void OPT_EnterTyp (OPS_Name name, SHORTINT form, INTEGER size, OPT_Struct *res); +export void OPT_Export (BOOLEAN *ext, BOOLEAN *new); +export void OPT_FPrintErr (OPT_Object obj, INTEGER errcode); +static void OPT_FPrintName (LONGINT *fp, CHAR *name, LONGINT name__len); +export void OPT_FPrintObj (OPT_Object obj); +static void OPT_FPrintSign (LONGINT *fp, OPT_Struct result, OPT_Object par); +export void OPT_FPrintStr (OPT_Struct typ); +export void OPT_Find (OPT_Object *res); +export void OPT_FindField (OPS_Name name, OPT_Struct typ, OPT_Object *res); +export void OPT_FindImport (OPT_Object mod, OPT_Object *res); +export void OPT_IdFPrint (OPT_Struct typ); +export void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); +static void OPT_InConstant (LONGINT f, OPT_Const conval); +static OPT_Object OPT_InFld (void); +static void OPT_InMod (SHORTINT *mno); +static void OPT_InName (CHAR *name, LONGINT name__len); +static OPT_Object OPT_InObj (SHORTINT mno); +static void OPT_InSign (SHORTINT mno, OPT_Struct *res, OPT_Object *par); +static void OPT_InStruct (OPT_Struct *typ); +static OPT_Object OPT_InTProc (SHORTINT mno); +export void OPT_Init (OPS_Name name, SET opt); +static void OPT_InitStruct (OPT_Struct *typ, SHORTINT form); +export void OPT_Insert (OPS_Name name, OPT_Object *obj); +export void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); +export OPT_Const OPT_NewConst (void); +export OPT_ConstExt OPT_NewExt (void); +export OPT_Node OPT_NewNode (SHORTINT class); +export OPT_Object OPT_NewObj (void); +export OPT_Struct OPT_NewStr (SHORTINT form, SHORTINT comp); +export void OPT_OpenScope (SHORTINT level, OPT_Object owner); +static void OPT_OutConstant (OPT_Object obj); +static void OPT_OutFlds (OPT_Object fld, LONGINT adr, BOOLEAN visible); +static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, LONGINT adr); +static void OPT_OutMod (INTEGER mno); +static void OPT_OutName (CHAR *name, LONGINT name__len); +static void OPT_OutObj (OPT_Object obj); +static void OPT_OutSign (OPT_Struct result, OPT_Object par); +static void OPT_OutStr (OPT_Struct typ); +static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj); +static void OPT_err (INTEGER n); + + +static void OPT_err (INTEGER n) +{ + OPM_err(n); +} + +OPT_Const OPT_NewConst (void) +{ + OPT_Const _o_result; + OPT_Const const_ = NIL; + __NEW(const_, OPT_ConstDesc); + _o_result = const_; + return _o_result; +} + +OPT_Object OPT_NewObj (void) +{ + OPT_Object _o_result; + OPT_Object obj = NIL; + __NEW(obj, OPT_ObjDesc); + _o_result = obj; + return _o_result; +} + +OPT_Struct OPT_NewStr (SHORTINT form, SHORTINT comp) +{ + OPT_Struct _o_result; + OPT_Struct typ = NIL; + __NEW(typ, OPT_StrDesc); + typ->form = form; + typ->comp = comp; + typ->ref = 255; + if (form != 0) { + typ->txtpos = OPM_errpos; + } + typ->size = -1; + typ->BaseTyp = OPT_undftyp; + _o_result = typ; + return _o_result; +} + +OPT_Node OPT_NewNode (SHORTINT class) +{ + OPT_Node _o_result; + OPT_Node node = NIL; + __NEW(node, OPT_NodeDesc); + node->class = class; + _o_result = node; + return _o_result; +} + +OPT_ConstExt OPT_NewExt (void) +{ + OPT_ConstExt _o_result; + OPT_ConstExt ext = NIL; + ext = __NEWARR(NIL, ((LONGINT)(1)), 1, 1, 0, (LONGINT)256); + _o_result = ext; + return _o_result; +} + +void OPT_OpenScope (SHORTINT level, OPT_Object owner) +{ + OPT_Object head = NIL; + head = OPT_NewObj(); + head->mode = 12; + head->mnolev = level; + head->link = owner; + if (owner != NIL) { + owner->scope = head; + } + head->left = OPT_topScope; + head->right = NIL; + head->scope = NIL; + OPT_topScope = head; +} + +void OPT_CloseScope (void) +{ + OPT_topScope = OPT_topScope->left; +} + +void OPT_Init (OPS_Name name, SET opt) +{ + OPT_topScope = OPT_universe; + OPT_OpenScope(0, NIL); + OPT_SYSimported = 0; + __COPY(name, OPT_SelfName, ((LONGINT)(256))); + __COPY(name, OPT_topScope->name, ((LONGINT)(256))); + OPT_GlbMod[0] = OPT_topScope; + OPT_nofGmod = 1; + OPT_newsf = __IN(4, opt); + OPT_findpc = __IN(8, opt); + OPT_extsf = OPT_newsf || __IN(9, opt); + OPT_sfpresent = 1; +} + +void OPT_Close (void) +{ + INTEGER i; + OPT_CloseScope(); + i = 0; + while (i < 64) { + OPT_GlbMod[__X(i, ((LONGINT)(64)))] = NIL; + i += 1; + } + i = 16; + while (i < 255) { + OPT_impCtxt.ref[__X(i, ((LONGINT)(255)))] = NIL; + OPT_impCtxt.old[__X(i, ((LONGINT)(255)))] = NIL; + i += 1; + } +} + +void OPT_FindImport (OPT_Object mod, OPT_Object *res) +{ + OPT_Object obj = NIL; + obj = mod->scope; + for (;;) { + if (obj == NIL) { + break; + } + if (__STRCMP(OPS_name, obj->name) < 0) { + obj = obj->left; + } else if (__STRCMP(OPS_name, obj->name) > 0) { + obj = obj->right; + } else { + if ((obj->mode == 5 && obj->vis == 0)) { + obj = NIL; + } else { + obj->used = 1; + } + break; + } + } + *res = obj; +} + +void OPT_Find (OPT_Object *res) +{ + OPT_Object obj = NIL, head = NIL; + head = OPT_topScope; + for (;;) { + obj = head->right; + for (;;) { + if (obj == NIL) { + break; + } + if (__STRCMP(OPS_name, obj->name) < 0) { + obj = obj->left; + } else if (__STRCMP(OPS_name, obj->name) > 0) { + obj = obj->right; + } else { + break; + } + } + if (obj != NIL) { + break; + } + head = head->left; + if (head == NIL) { + break; + } + } + *res = obj; +} + +void OPT_FindField (OPS_Name name, OPT_Struct typ, OPT_Object *res) +{ + OPT_Object obj = NIL; + while (typ != NIL) { + obj = typ->link; + while (obj != NIL) { + if (__STRCMP(name, obj->name) < 0) { + obj = obj->left; + } else if (__STRCMP(name, obj->name) > 0) { + obj = obj->right; + } else { + *res = obj; + return; + } + } + typ = typ->BaseTyp; + } + *res = NIL; +} + +void OPT_Insert (OPS_Name name, OPT_Object *obj) +{ + OPT_Object ob0 = NIL, ob1 = NIL; + BOOLEAN left; + SHORTINT mnolev; + ob0 = OPT_topScope; + ob1 = ob0->right; + left = 0; + for (;;) { + if (ob1 != NIL) { + if (__STRCMP(name, ob1->name) < 0) { + ob0 = ob1; + ob1 = ob0->left; + left = 1; + } else if (__STRCMP(name, ob1->name) > 0) { + ob0 = ob1; + ob1 = ob0->right; + left = 0; + } else { + OPT_err(1); + ob0 = ob1; + ob1 = ob0->right; + } + } else { + ob1 = OPT_NewObj(); + ob1->leaf = 1; + if (left) { + ob0->left = ob1; + } else { + ob0->right = ob1; + } + ob1->left = NIL; + ob1->right = NIL; + __COPY(name, ob1->name, ((LONGINT)(256))); + mnolev = OPT_topScope->mnolev; + ob1->mnolev = mnolev; + break; + } + } + *obj = ob1; +} + +static void OPT_FPrintName (LONGINT *fp, CHAR *name, LONGINT name__len) +{ + INTEGER i; + CHAR ch; + i = 0; + do { + ch = name[__X(i, name__len)]; + OPM_FPrint(&*fp, (int)ch); + i += 1; + } while (!(ch == 0x00)); +} + +static void OPT_DebugStruct (OPT_Struct btyp) +{ + OPM_LogWLn(); + if (btyp == NIL) { + OPM_LogWStr((CHAR*)"btyp is nil", (LONGINT)12); + OPM_LogWLn(); + } + OPM_LogWStr((CHAR*)"btyp^.strobji^.name = ", (LONGINT)23); + OPM_LogWStr(btyp->strobj->name, ((LONGINT)(256))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"btyp^.form = ", (LONGINT)14); + OPM_LogWNum(btyp->form, ((LONGINT)(0))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"btyp^.comp = ", (LONGINT)14); + OPM_LogWNum(btyp->comp, ((LONGINT)(0))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"btyp^.mno = ", (LONGINT)13); + OPM_LogWNum(btyp->mno, ((LONGINT)(0))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"btyp^.extlev = ", (LONGINT)16); + OPM_LogWNum(btyp->extlev, ((LONGINT)(0))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"btyp^.size = ", (LONGINT)14); + OPM_LogWNum(btyp->size, ((LONGINT)(0))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"btyp^.align = ", (LONGINT)15); + OPM_LogWNum(btyp->align, ((LONGINT)(0))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"btyp^.txtpos = ", (LONGINT)16); + OPM_LogWNum(btyp->txtpos, ((LONGINT)(0))); + OPM_LogWLn(); +} + +static void OPT_FPrintSign (LONGINT *fp, OPT_Struct result, OPT_Object par) +{ + OPT_IdFPrint(result); + OPM_FPrint(&*fp, result->idfp); + while (par != NIL) { + OPM_FPrint(&*fp, par->mode); + OPT_IdFPrint(par->typ); + OPM_FPrint(&*fp, par->typ->idfp); + par = par->link; + } +} + +void OPT_IdFPrint (OPT_Struct typ) +{ + OPT_Struct btyp = NIL; + OPT_Object strobj = NIL; + LONGINT idfp; + INTEGER f, c; + if (!typ->idfpdone) { + typ->idfpdone = 1; + idfp = 0; + f = typ->form; + c = typ->comp; + OPM_FPrint(&idfp, f); + OPM_FPrint(&idfp, c); + btyp = typ->BaseTyp; + strobj = typ->strobj; + if ((strobj != NIL && strobj->name[0] != 0x00)) { + OPT_FPrintName(&idfp, (void*)OPT_GlbMod[__X(typ->mno, ((LONGINT)(64)))]->name, ((LONGINT)(256))); + OPT_FPrintName(&idfp, (void*)strobj->name, ((LONGINT)(256))); + } + if ((f == 13 || (c == 4 && btyp != NIL)) || c == 3) { + OPT_IdFPrint(btyp); + OPM_FPrint(&idfp, btyp->idfp); + } else if (c == 2) { + OPT_IdFPrint(btyp); + OPM_FPrint(&idfp, btyp->idfp); + OPM_FPrint(&idfp, typ->n); + } else if (f == 14) { + OPT_FPrintSign(&idfp, btyp, typ->link); + } + typ->idfp = idfp; + } +} + +static struct FPrintStr__12 { + LONGINT *pbfp, *pvfp; + struct FPrintStr__12 *lnk; +} *FPrintStr__12_s; + +static void FPrintFlds__13 (OPT_Object fld, LONGINT adr, BOOLEAN visible); +static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr); +static void FPrintTProcs__17 (OPT_Object obj); + +static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr) +{ + LONGINT i, j, n; + OPT_Struct btyp = NIL; + if (typ->comp == 4) { + FPrintFlds__13(typ->link, adr, 0); + } else if (typ->comp == 2) { + btyp = typ->BaseTyp; + n = typ->n; + while (btyp->comp == 2) { + n = btyp->n * n; + btyp = btyp->BaseTyp; + } + if (btyp->form == 13 || btyp->comp == 4) { + j = OPT_nofhdfld; + FPrintHdFld__15(btyp, fld, adr); + if (j != OPT_nofhdfld) { + i = 1; + while ((i < n && OPT_nofhdfld <= 2048)) { + adr += btyp->size; + FPrintHdFld__15(btyp, fld, adr); + i += 1; + } + } + } + } else if (typ->form == 13 || __STRCMP(fld->name, "@ptr") == 0) { + OPM_FPrint(&*FPrintStr__12_s->pvfp, ((LONGINT)(13))); + OPM_FPrint(&*FPrintStr__12_s->pvfp, adr); + OPT_nofhdfld += 1; + } +} + +static void FPrintFlds__13 (OPT_Object fld, LONGINT adr, BOOLEAN visible) +{ + while ((fld != NIL && fld->mode == 4)) { + if ((fld->vis != 0 && visible)) { + OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->vis); + OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)fld->name, ((LONGINT)(256))); + OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->adr); + OPT_FPrintStr(fld->typ); + OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->typ->pbfp); + OPM_FPrint(&*FPrintStr__12_s->pvfp, fld->typ->pvfp); + } else { + FPrintHdFld__15(fld->typ, fld, fld->adr + adr); + } + fld = fld->link; + } +} + +static void FPrintTProcs__17 (OPT_Object obj) +{ + if (obj != NIL) { + FPrintTProcs__17(obj->left); + if (obj->mode == 13) { + if (obj->vis != 0) { + OPM_FPrint(&*FPrintStr__12_s->pbfp, ((LONGINT)(13))); + OPM_FPrint(&*FPrintStr__12_s->pbfp, __ASHR(obj->adr, 16)); + OPT_FPrintSign(&*FPrintStr__12_s->pbfp, obj->typ, obj->link); + OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)obj->name, ((LONGINT)(256))); + } + } + FPrintTProcs__17(obj->right); + } +} + +void OPT_FPrintStr (OPT_Struct typ) +{ + INTEGER f, c; + OPT_Struct btyp = NIL; + OPT_Object strobj = NIL, bstrobj = NIL; + LONGINT pbfp, pvfp; + struct FPrintStr__12 _s; + _s.pbfp = &pbfp; + _s.pvfp = &pvfp; + _s.lnk = FPrintStr__12_s; + FPrintStr__12_s = &_s; + if (!typ->fpdone) { + OPT_IdFPrint(typ); + pbfp = typ->idfp; + if (typ->sysflag != 0) { + OPM_FPrint(&pbfp, typ->sysflag); + } + pvfp = pbfp; + typ->pbfp = pbfp; + typ->pvfp = pvfp; + typ->fpdone = 1; + f = typ->form; + c = typ->comp; + btyp = typ->BaseTyp; + if (f == 13) { + strobj = typ->strobj; + bstrobj = btyp->strobj; + if (((strobj == NIL || strobj->name[0] == 0x00) || bstrobj == NIL) || bstrobj->name[0] == 0x00) { + OPT_FPrintStr(btyp); + OPM_FPrint(&pbfp, btyp->pbfp); + pvfp = pbfp; + } + } else if (f == 14) { + } else if (__IN(c, 0x0c)) { + OPT_FPrintStr(btyp); + OPM_FPrint(&pbfp, btyp->pvfp); + pvfp = pbfp; + } else { + if (btyp != NIL) { + OPT_FPrintStr(btyp); + OPM_FPrint(&pbfp, btyp->pbfp); + OPM_FPrint(&pvfp, btyp->pvfp); + } + OPM_FPrint(&pvfp, typ->size); + OPM_FPrint(&pvfp, typ->align); + OPM_FPrint(&pvfp, typ->n); + OPT_nofhdfld = 0; + FPrintFlds__13(typ->link, ((LONGINT)(0)), 1); + if (OPT_nofhdfld > 2048) { + OPM_Mark(225, typ->txtpos); + } + FPrintTProcs__17(typ->link); + OPM_FPrint(&pvfp, pbfp); + strobj = typ->strobj; + if (strobj == NIL || strobj->name[0] == 0x00) { + pbfp = pvfp; + } + } + typ->pbfp = pbfp; + typ->pvfp = pvfp; + } + FPrintStr__12_s = _s.lnk; +} + +void OPT_FPrintObj (OPT_Object obj) +{ + LONGINT fprint; + INTEGER f, m; + REAL rval; + OPT_ConstExt ext = NIL; + if (!obj->fpdone) { + fprint = 0; + obj->fpdone = 1; + OPM_FPrint(&fprint, obj->mode); + if (obj->mode == 3) { + f = obj->typ->form; + OPM_FPrint(&fprint, f); + switch (f) { + case 2: case 3: case 4: case 5: case 6: + OPM_FPrint(&fprint, obj->conval->intval); + break; + case 9: + OPM_FPrintSet(&fprint, obj->conval->setval); + break; + case 7: + rval = obj->conval->realval; + OPM_FPrintReal(&fprint, rval); + break; + case 8: + OPM_FPrintLReal(&fprint, obj->conval->realval); + break; + case 10: + OPT_FPrintName(&fprint, (void*)*obj->conval->ext, ((LONGINT)(256))); + break; + case 11: + break; + default: + OPT_err(127); + break; + } + } else if (obj->mode == 1) { + OPM_FPrint(&fprint, obj->vis); + OPT_FPrintStr(obj->typ); + OPM_FPrint(&fprint, obj->typ->pbfp); + } else if (__IN(obj->mode, 0x0480)) { + OPT_FPrintSign(&fprint, obj->typ, obj->link); + } else if (obj->mode == 9) { + OPT_FPrintSign(&fprint, obj->typ, obj->link); + ext = obj->conval->ext; + m = (int)(*ext)[0]; + f = 1; + OPM_FPrint(&fprint, m); + while (f <= m) { + OPM_FPrint(&fprint, (int)(*ext)[__X(f, ((LONGINT)(256)))]); + f += 1; + } + } else if (obj->mode == 5) { + OPT_FPrintStr(obj->typ); + OPM_FPrint(&fprint, obj->typ->pbfp); + } + obj->fprint = fprint; + } +} + +void OPT_FPrintErr (OPT_Object obj, INTEGER errcode) +{ + INTEGER i, j; + CHAR ch; + if (obj->mnolev != 0) { + __COPY(OPT_GlbMod[__X(-obj->mnolev, ((LONGINT)(64)))]->name, OPM_objname, ((LONGINT)(64))); + i = 0; + while (OPM_objname[__X(i, ((LONGINT)(64)))] != 0x00) { + i += 1; + } + OPM_objname[__X(i, ((LONGINT)(64)))] = '.'; + j = 0; + i += 1; + do { + ch = obj->name[__X(j, ((LONGINT)(256)))]; + OPM_objname[__X(i, ((LONGINT)(64)))] = ch; + j += 1; + i += 1; + } while (!(ch == 0x00)); + } else { + __COPY(obj->name, OPM_objname, ((LONGINT)(64))); + } + if (errcode == 249) { + if (OPM_noerr) { + OPT_err(errcode); + } + } else if (errcode == 253) { + if ((((!OPT_symNew && !OPT_symExtended)) && !OPT_extsf)) { + OPT_err(errcode); + } + OPT_symExtended = 1; + } else { + if ((!OPT_symNew && !OPT_newsf)) { + OPT_err(errcode); + } + OPT_symNew = 1; + } +} + +void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old) +{ + OPT_Object ob0 = NIL, ob1 = NIL; + BOOLEAN left; + if (*root == NIL) { + *root = obj; + *old = NIL; + } else { + ob0 = *root; + ob1 = ob0->right; + left = 0; + if (__STRCMP(obj->name, ob0->name) < 0) { + ob1 = ob0->left; + left = 1; + } else if (__STRCMP(obj->name, ob0->name) > 0) { + ob1 = ob0->right; + left = 0; + } else { + *old = ob0; + return; + } + for (;;) { + if (ob1 != NIL) { + if (__STRCMP(obj->name, ob1->name) < 0) { + ob0 = ob1; + ob1 = ob1->left; + left = 1; + } else if (__STRCMP(obj->name, ob1->name) > 0) { + ob0 = ob1; + ob1 = ob1->right; + left = 0; + } else { + *old = ob1; + break; + } + } else { + ob1 = obj; + if (left) { + ob0->left = ob1; + } else { + ob0->right = ob1; + } + ob1->left = NIL; + ob1->right = NIL; + *old = NIL; + break; + } + } + } +} + +static void OPT_InName (CHAR *name, LONGINT name__len) +{ + INTEGER i; + CHAR ch; + i = 0; + do { + OPM_SymRCh(&ch); + name[__X(i, name__len)] = ch; + i += 1; + } while (!(ch == 0x00)); +} + +static void OPT_InMod (SHORTINT *mno) +{ + OPT_Object head = NIL; + OPS_Name name; + LONGINT mn; + SHORTINT i; + mn = OPM_SymRInt(); + if (mn == 0) { + *mno = OPT_impCtxt.glbmno[0]; + } else { + if (mn == 16) { + OPT_InName((void*)name, ((LONGINT)(256))); + if ((__STRCMP(name, OPT_SelfName) == 0 && !OPT_impCtxt.self)) { + OPT_err(154); + } + i = 0; + while ((i < OPT_nofGmod && __STRCMP(name, OPT_GlbMod[__X(i, ((LONGINT)(64)))]->name) != 0)) { + i += 1; + } + if (i < OPT_nofGmod) { + *mno = i; + } else { + head = OPT_NewObj(); + head->mode = 12; + __COPY(name, head->name, ((LONGINT)(256))); + *mno = OPT_nofGmod; + head->mnolev = -*mno; + if (OPT_nofGmod < 64) { + OPT_GlbMod[__X(*mno, ((LONGINT)(64)))] = head; + OPT_nofGmod += 1; + } else { + OPT_err(227); + } + } + OPT_impCtxt.glbmno[__X(OPT_impCtxt.nofm, ((LONGINT)(64)))] = *mno; + OPT_impCtxt.nofm += 1; + } else { + *mno = OPT_impCtxt.glbmno[__X(-mn, ((LONGINT)(64)))]; + } + } +} + +static void OPT_InConstant (LONGINT f, OPT_Const conval) +{ + CHAR ch; + INTEGER i; + OPT_ConstExt ext = NIL; + REAL rval; + switch (f) { + case 1: case 3: case 2: + OPM_SymRCh(&ch); + conval->intval = (int)ch; + break; + case 4: case 5: case 6: + conval->intval = OPM_SymRInt(); + break; + case 9: + OPM_SymRSet(&conval->setval); + break; + case 7: + OPM_SymRReal(&rval); + conval->realval = rval; + conval->intval = -1; + break; + case 8: + OPM_SymRLReal(&conval->realval); + conval->intval = -1; + break; + case 10: + ext = OPT_NewExt(); + conval->ext = ext; + i = 0; + do { + OPM_SymRCh(&ch); + (*ext)[__X(i, ((LONGINT)(256)))] = ch; + i += 1; + } while (!(ch == 0x00)); + conval->intval2 = i; + conval->intval = -1; + break; + case 11: + conval->intval = 0; + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPT.InConstant(), f = ", (LONGINT)41); + OPM_LogWNum(f, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } +} + +static void OPT_InSign (SHORTINT mno, OPT_Struct *res, OPT_Object *par) +{ + OPT_Object last = NIL, new = NIL; + LONGINT tag; + OPT_InStruct(&*res); + tag = OPM_SymRInt(); + last = NIL; + while (tag != 18) { + new = OPT_NewObj(); + new->mnolev = -mno; + if (last == NIL) { + *par = new; + } else { + last->link = new; + } + if (tag == 23) { + new->mode = 1; + } else { + new->mode = 2; + } + OPT_InStruct(&new->typ); + new->adr = OPM_SymRInt(); + OPT_InName((void*)new->name, ((LONGINT)(256))); + last = new; + tag = OPM_SymRInt(); + } +} + +static OPT_Object OPT_InFld (void) +{ + OPT_Object _o_result; + LONGINT tag; + OPT_Object obj = NIL; + tag = OPT_impCtxt.nextTag; + obj = OPT_NewObj(); + if (tag <= 26) { + obj->mode = 4; + if (tag == 26) { + obj->vis = 2; + } else { + obj->vis = 1; + } + OPT_InStruct(&obj->typ); + OPT_InName((void*)obj->name, ((LONGINT)(256))); + obj->adr = OPM_SymRInt(); + } else { + obj->mode = 4; + if (tag == 27) { + __MOVE("@ptr", obj->name, 5); + } else { + __MOVE("@proc", obj->name, 6); + } + obj->typ = OPT_undftyp; + obj->vis = 0; + obj->adr = OPM_SymRInt(); + } + _o_result = obj; + return _o_result; +} + +static OPT_Object OPT_InTProc (SHORTINT mno) +{ + OPT_Object _o_result; + LONGINT tag; + OPT_Object obj = NIL; + tag = OPT_impCtxt.nextTag; + obj = OPT_NewObj(); + obj->mnolev = -mno; + if (tag == 29) { + obj->mode = 13; + obj->conval = OPT_NewConst(); + obj->conval->intval = -1; + OPT_InSign(mno, &obj->typ, &obj->link); + obj->vis = 1; + OPT_InName((void*)obj->name, ((LONGINT)(256))); + obj->adr = __ASHL(OPM_SymRInt(), 16); + } else { + obj->mode = 13; + __MOVE("@tproc", obj->name, 7); + obj->link = OPT_NewObj(); + obj->typ = OPT_undftyp; + obj->vis = 0; + obj->adr = __ASHL(OPM_SymRInt(), 16); + } + _o_result = obj; + return _o_result; +} + +static void OPT_InStruct (OPT_Struct *typ) +{ + SHORTINT mno; + INTEGER ref; + LONGINT tag; + OPS_Name name; + OPT_Struct t = NIL; + OPT_Object obj = NIL, last = NIL, fld = NIL, old = NIL, dummy = NIL; + tag = OPM_SymRInt(); + if (tag != 34) { + *typ = OPT_impCtxt.ref[__X(-tag, ((LONGINT)(255)))]; + } else { + ref = OPT_impCtxt.nofr; + OPT_impCtxt.nofr += 1; + if (ref < OPT_impCtxt.minr) { + OPT_impCtxt.minr = ref; + } + OPT_InMod(&mno); + OPT_InName((void*)name, ((LONGINT)(256))); + obj = OPT_NewObj(); + if (name[0] == 0x00) { + if (OPT_impCtxt.self) { + old = NIL; + } else { + __MOVE("@", obj->name, 2); + OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->right, &old); + obj->name[0] = 0x00; + } + *typ = OPT_NewStr(0, 1); + } else { + __COPY(name, obj->name, ((LONGINT)(256))); + OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->right, &old); + if (old != NIL) { + OPT_FPrintObj(old); + OPT_impCtxt.pvfp[__X(ref, ((LONGINT)(255)))] = old->typ->pvfp; + if (OPT_impCtxt.self) { + *typ = OPT_NewStr(0, 1); + } else { + *typ = old->typ; + (*typ)->link = NIL; + (*typ)->sysflag = 0; + (*typ)->fpdone = 0; + (*typ)->idfpdone = 0; + } + } else { + *typ = OPT_NewStr(0, 1); + } + } + OPT_impCtxt.ref[__X(ref, ((LONGINT)(255)))] = *typ; + OPT_impCtxt.old[__X(ref, ((LONGINT)(255)))] = old; + (*typ)->ref = ref + 255; + (*typ)->mno = mno; + (*typ)->allocated = 1; + (*typ)->strobj = obj; + obj->mode = 5; + obj->typ = *typ; + obj->mnolev = -mno; + obj->vis = 0; + tag = OPM_SymRInt(); + if (tag == 35) { + (*typ)->sysflag = (int)OPM_SymRInt(); + tag = OPM_SymRInt(); + } + switch (tag) { + case 36: + (*typ)->form = 13; + (*typ)->size = OPM_PointerSize; + (*typ)->n = 0; + OPT_InStruct(&(*typ)->BaseTyp); + break; + case 37: + (*typ)->form = 15; + (*typ)->comp = 2; + OPT_InStruct(&(*typ)->BaseTyp); + (*typ)->n = OPM_SymRInt(); + (*OPT_typSize)(*typ); + break; + case 38: + (*typ)->form = 15; + (*typ)->comp = 3; + OPT_InStruct(&(*typ)->BaseTyp); + if ((*typ)->BaseTyp->comp == 3) { + (*typ)->n = (*typ)->BaseTyp->n + 1; + } else { + (*typ)->n = 0; + } + (*OPT_typSize)(*typ); + break; + case 39: + (*typ)->form = 15; + (*typ)->comp = 4; + OPT_InStruct(&(*typ)->BaseTyp); + if ((*typ)->BaseTyp == OPT_notyp) { + (*typ)->BaseTyp = NIL; + } + (*typ)->extlev = 0; + t = (*typ)->BaseTyp; + while (t != NIL) { + (*typ)->extlev += 1; + t = t->BaseTyp; + } + (*typ)->size = OPM_SymRInt(); + (*typ)->align = OPM_SymRInt(); + (*typ)->n = OPM_SymRInt(); + OPT_impCtxt.nextTag = OPM_SymRInt(); + last = NIL; + while ((OPT_impCtxt.nextTag >= 25 && OPT_impCtxt.nextTag <= 28)) { + fld = OPT_InFld(); + fld->mnolev = -mno; + if (last != NIL) { + last->link = fld; + } + last = fld; + OPT_InsertImport(fld, &(*typ)->link, &dummy); + OPT_impCtxt.nextTag = OPM_SymRInt(); + } + while (OPT_impCtxt.nextTag != 18) { + fld = OPT_InTProc(mno); + OPT_InsertImport(fld, &(*typ)->link, &dummy); + OPT_impCtxt.nextTag = OPM_SymRInt(); + } + break; + case 40: + (*typ)->form = 14; + (*typ)->size = OPM_ProcSize; + OPT_InSign(mno, &(*typ)->BaseTyp, &(*typ)->link); + break; + default: + OPM_LogWStr((CHAR*)"unhandled case at OPT.InStruct, tag = ", (LONGINT)39); + OPM_LogWNum(tag, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + if (ref == OPT_impCtxt.minr) { + while (ref < OPT_impCtxt.nofr) { + t = OPT_impCtxt.ref[__X(ref, ((LONGINT)(255)))]; + OPT_FPrintStr(t); + obj = t->strobj; + if (obj->name[0] != 0x00) { + OPT_FPrintObj(obj); + } + old = OPT_impCtxt.old[__X(ref, ((LONGINT)(255)))]; + if (old != NIL) { + t->strobj = old; + if (OPT_impCtxt.self) { + if (old->mnolev < 0) { + if (old->history != 5) { + if (old->fprint != obj->fprint) { + old->history = 2; + } else if (OPT_impCtxt.pvfp[__X(ref, ((LONGINT)(255)))] != t->pvfp) { + old->history = 3; + } + } + } else if (old->fprint != obj->fprint) { + old->history = 2; + } else if (OPT_impCtxt.pvfp[__X(ref, ((LONGINT)(255)))] != t->pvfp) { + old->history = 3; + } else if (old->vis == 0) { + old->history = 1; + } else { + old->history = 0; + } + } else { + if (OPT_impCtxt.pvfp[__X(ref, ((LONGINT)(255)))] != t->pvfp) { + old->history = 5; + } + if (old->fprint != obj->fprint) { + OPT_FPrintErr(old, 249); + } + } + } else if (OPT_impCtxt.self) { + obj->history = 4; + } else { + obj->history = 1; + } + ref += 1; + } + OPT_impCtxt.minr = 255; + } + } +} + +static OPT_Object OPT_InObj (SHORTINT mno) +{ + OPT_Object _o_result; + INTEGER i, s; + CHAR ch; + OPT_Object obj = NIL, old = NIL; + OPT_Struct typ = NIL; + LONGINT tag; + OPT_ConstExt ext = NIL; + tag = OPT_impCtxt.nextTag; + if (tag == 19) { + OPT_InStruct(&typ); + obj = typ->strobj; + if (!OPT_impCtxt.self) { + obj->vis = 1; + } + } else { + obj = OPT_NewObj(); + obj->mnolev = -mno; + obj->vis = 1; + if (tag <= 13) { + obj->mode = 3; + obj->typ = OPT_impCtxt.ref[__X(tag, ((LONGINT)(255)))]; + obj->conval = OPT_NewConst(); + OPT_InConstant(tag, obj->conval); + } else if (tag >= 31) { + obj->conval = OPT_NewConst(); + obj->conval->intval = -1; + OPT_InSign(mno, &obj->typ, &obj->link); + switch (tag) { + case 31: + obj->mode = 7; + break; + case 32: + obj->mode = 10; + break; + case 33: + obj->mode = 9; + ext = OPT_NewExt(); + obj->conval->ext = ext; + s = (int)OPM_SymRInt(); + (*ext)[0] = (CHAR)s; + i = 1; + while (i <= s) { + OPM_SymRCh(&(*ext)[__X(i, ((LONGINT)(256)))]); + i += 1; + } + break; + default: + OPM_LogWStr((CHAR*)"unhandled case at OPT.InObj, tag = ", (LONGINT)36); + OPM_LogWNum(tag, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + } else if (tag == 20) { + obj->mode = 5; + OPT_InStruct(&obj->typ); + } else { + obj->mode = 1; + if (tag == 22) { + obj->vis = 2; + } + OPT_InStruct(&obj->typ); + } + OPT_InName((void*)obj->name, ((LONGINT)(256))); + } + OPT_FPrintObj(obj); + if ((obj->mode == 1 && (obj->typ->strobj == NIL || obj->typ->strobj->name[0] == 0x00))) { + OPM_FPrint(&OPT_impCtxt.reffp, obj->typ->ref - 255); + } + if (tag != 19) { + OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->right, &old); + if (OPT_impCtxt.self) { + if (old != NIL) { + if (old->vis == 0) { + old->history = 4; + } else { + OPT_FPrintObj(old); + if (obj->fprint != old->fprint) { + old->history = 2; + } else if (obj->typ->pvfp != old->typ->pvfp) { + old->history = 3; + } else { + old->history = 1; + } + } + } else { + obj->history = 4; + } + } + } else { + if (OPT_impCtxt.self) { + if (obj->vis == 0) { + obj->history = 4; + } else if (obj->history == 0) { + obj->history = 1; + } + } + } + _o_result = obj; + return _o_result; +} + +void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) +{ + OPT_Object obj = NIL; + SHORTINT mno; + OPS_Name aliasName__copy; + __DUPARR(aliasName, OPS_Name); + if (__STRCMP(name, "SYSTEM") == 0) { + OPT_SYSimported = 1; + OPT_Insert(aliasName, &obj); + obj->mode = 11; + obj->mnolev = 0; + obj->scope = OPT_syslink; + obj->typ = OPT_notyp; + } else { + OPT_impCtxt.nofr = 16; + OPT_impCtxt.minr = 255; + OPT_impCtxt.nofm = 0; + OPT_impCtxt.self = __STRCMP(aliasName, "@self") == 0; + OPT_impCtxt.reffp = 0; + OPM_OldSym((void*)name, ((LONGINT)(256)), &*done); + if (*done) { + OPT_InMod(&mno); + OPT_impCtxt.nextTag = OPM_SymRInt(); + while (!OPM_eofSF()) { + obj = OPT_InObj(mno); + OPT_impCtxt.nextTag = OPM_SymRInt(); + } + OPT_Insert(aliasName, &obj); + obj->mode = 11; + obj->scope = OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->right; + OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->link = obj; + obj->mnolev = -mno; + obj->typ = OPT_notyp; + OPM_CloseOldSym(); + } else if (OPT_impCtxt.self) { + OPT_newsf = 1; + OPT_extsf = 1; + OPT_sfpresent = 0; + } else { + OPT_err(152); + } + } +} + +static void OPT_OutName (CHAR *name, LONGINT name__len) +{ + INTEGER i; + CHAR ch; + i = 0; + do { + ch = name[__X(i, name__len)]; + OPM_SymWCh(ch); + i += 1; + } while (!(ch == 0x00)); +} + +static void OPT_OutMod (INTEGER mno) +{ + if (OPT_expCtxt.locmno[__X(mno, ((LONGINT)(64)))] < 0) { + OPM_SymWInt(((LONGINT)(16))); + OPT_expCtxt.locmno[__X(mno, ((LONGINT)(64)))] = OPT_expCtxt.nofm; + OPT_expCtxt.nofm += 1; + OPT_OutName((void*)OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->name, ((LONGINT)(256))); + } else { + OPM_SymWInt(-OPT_expCtxt.locmno[__X(mno, ((LONGINT)(64)))]); + } +} + +static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, LONGINT adr) +{ + LONGINT i, j, n; + OPT_Struct btyp = NIL; + if (typ->comp == 4) { + OPT_OutFlds(typ->link, adr, 0); + } else if (typ->comp == 2) { + btyp = typ->BaseTyp; + n = typ->n; + while (btyp->comp == 2) { + n = btyp->n * n; + btyp = btyp->BaseTyp; + } + if (btyp->form == 13 || btyp->comp == 4) { + j = OPT_nofhdfld; + OPT_OutHdFld(btyp, fld, adr); + if (j != OPT_nofhdfld) { + i = 1; + while ((i < n && OPT_nofhdfld <= 2048)) { + adr += btyp->size; + OPT_OutHdFld(btyp, fld, adr); + i += 1; + } + } + } + } else if (typ->form == 13 || __STRCMP(fld->name, "@ptr") == 0) { + OPM_SymWInt(((LONGINT)(27))); + OPM_SymWInt(adr); + OPT_nofhdfld += 1; + } +} + +static void OPT_OutFlds (OPT_Object fld, LONGINT adr, BOOLEAN visible) +{ + while ((fld != NIL && fld->mode == 4)) { + if ((fld->vis != 0 && visible)) { + if (fld->vis == 2) { + OPM_SymWInt(((LONGINT)(26))); + } else { + OPM_SymWInt(((LONGINT)(25))); + } + OPT_OutStr(fld->typ); + OPT_OutName((void*)fld->name, ((LONGINT)(256))); + OPM_SymWInt(fld->adr); + } else { + OPT_OutHdFld(fld->typ, fld, fld->adr + adr); + } + fld = fld->link; + } +} + +static void OPT_OutSign (OPT_Struct result, OPT_Object par) +{ + OPT_OutStr(result); + while (par != NIL) { + if (par->mode == 1) { + OPM_SymWInt(((LONGINT)(23))); + } else { + OPM_SymWInt(((LONGINT)(24))); + } + OPT_OutStr(par->typ); + OPM_SymWInt(par->adr); + OPT_OutName((void*)par->name, ((LONGINT)(256))); + par = par->link; + } + OPM_SymWInt(((LONGINT)(18))); +} + +static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj) +{ + if (obj != NIL) { + OPT_OutTProcs(typ, obj->left); + if (obj->mode == 13) { + if ((((typ->BaseTyp != NIL && __ASHR(obj->adr, 16) < typ->BaseTyp->n)) && obj->vis == 0)) { + OPM_Mark(109, typ->txtpos); + } + if (obj->vis != 0) { + if (obj->vis != 0) { + OPM_SymWInt(((LONGINT)(29))); + OPT_OutSign(obj->typ, obj->link); + OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPM_SymWInt(__ASHR(obj->adr, 16)); + } else { + OPM_SymWInt(((LONGINT)(30))); + OPM_SymWInt(__ASHR(obj->adr, 16)); + } + } + } + OPT_OutTProcs(typ, obj->right); + } +} + +static void OPT_OutStr (OPT_Struct typ) +{ + OPT_Object strobj = NIL; + if (typ->ref < OPT_expCtxt.ref) { + OPM_SymWInt(-typ->ref); + } else { + OPM_SymWInt(((LONGINT)(34))); + typ->ref = OPT_expCtxt.ref; + OPT_expCtxt.ref += 1; + if (OPT_expCtxt.ref >= 255) { + OPT_err(228); + } + OPT_OutMod(typ->mno); + strobj = typ->strobj; + if ((strobj != NIL && strobj->name[0] != 0x00)) { + OPT_OutName((void*)strobj->name, ((LONGINT)(256))); + switch (strobj->history) { + case 2: + OPT_FPrintErr(strobj, 252); + break; + case 3: + OPT_FPrintErr(strobj, 251); + break; + case 5: + OPT_FPrintErr(strobj, 249); + break; + default: + break; + } + } else { + OPM_SymWCh(0x00); + } + if (typ->sysflag != 0) { + OPM_SymWInt(((LONGINT)(35))); + OPM_SymWInt(typ->sysflag); + } + switch (typ->form) { + case 13: + OPM_SymWInt(((LONGINT)(36))); + OPT_OutStr(typ->BaseTyp); + break; + case 14: + OPM_SymWInt(((LONGINT)(40))); + OPT_OutSign(typ->BaseTyp, typ->link); + break; + case 15: + switch (typ->comp) { + case 2: + OPM_SymWInt(((LONGINT)(37))); + OPT_OutStr(typ->BaseTyp); + OPM_SymWInt(typ->n); + break; + case 3: + OPM_SymWInt(((LONGINT)(38))); + OPT_OutStr(typ->BaseTyp); + break; + case 4: + OPM_SymWInt(((LONGINT)(39))); + if (typ->BaseTyp == NIL) { + OPT_OutStr(OPT_notyp); + } else { + OPT_OutStr(typ->BaseTyp); + } + OPM_SymWInt(typ->size); + OPM_SymWInt(typ->align); + OPM_SymWInt(typ->n); + OPT_nofhdfld = 0; + OPT_OutFlds(typ->link, ((LONGINT)(0)), 1); + if (OPT_nofhdfld > 2048) { + OPM_Mark(223, typ->txtpos); + } + OPT_OutTProcs(typ, typ->link); + OPM_SymWInt(((LONGINT)(18))); + break; + default: + OPM_LogWStr((CHAR*)"unhandled case at OPT.OutStr, typ^.comp = ", (LONGINT)43); + OPM_LogWNum(typ->comp, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + break; + default: + OPM_LogWStr((CHAR*)"unhandled case at OPT.OutStr, typ^.form = ", (LONGINT)43); + OPM_LogWNum(typ->form, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + } +} + +static void OPT_OutConstant (OPT_Object obj) +{ + INTEGER f; + REAL rval; + f = obj->typ->form; + OPM_SymWInt(f); + switch (f) { + case 2: case 3: + OPM_SymWCh((CHAR)obj->conval->intval); + break; + case 4: case 5: case 6: + OPM_SymWInt(obj->conval->intval); + break; + case 9: + OPM_SymWSet(obj->conval->setval); + break; + case 7: + rval = obj->conval->realval; + OPM_SymWReal(rval); + break; + case 8: + OPM_SymWLReal(obj->conval->realval); + break; + case 10: + OPT_OutName((void*)*obj->conval->ext, ((LONGINT)(256))); + break; + case 11: + break; + default: + OPT_err(127); + break; + } +} + +static void OPT_OutObj (OPT_Object obj) +{ + INTEGER i, j; + OPT_ConstExt ext = NIL; + if (obj != NIL) { + OPT_OutObj(obj->left); + if (__IN(obj->mode, 0x06ea)) { + if (obj->history == 4) { + OPT_FPrintErr(obj, 250); + } else if (obj->vis != 0) { + switch (obj->history) { + case 0: + OPT_FPrintErr(obj, 253); + break; + case 1: + break; + case 2: + OPT_FPrintErr(obj, 252); + break; + case 3: + OPT_FPrintErr(obj, 251); + break; + default: + OPM_LogWStr((CHAR*)"unhandled case at OPT.OutObj, obj^.history = ", (LONGINT)46); + OPM_LogWNum(obj->history, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + switch (obj->mode) { + case 3: + OPT_OutConstant(obj); + OPT_OutName((void*)obj->name, ((LONGINT)(256))); + break; + case 5: + if (obj->typ->strobj == obj) { + OPM_SymWInt(((LONGINT)(19))); + OPT_OutStr(obj->typ); + } else { + OPM_SymWInt(((LONGINT)(20))); + OPT_OutStr(obj->typ); + OPT_OutName((void*)obj->name, ((LONGINT)(256))); + } + break; + case 1: + if (obj->vis == 2) { + OPM_SymWInt(((LONGINT)(22))); + } else { + OPM_SymWInt(((LONGINT)(21))); + } + OPT_OutStr(obj->typ); + OPT_OutName((void*)obj->name, ((LONGINT)(256))); + if (obj->typ->strobj == NIL || obj->typ->strobj->name[0] == 0x00) { + OPM_FPrint(&OPT_expCtxt.reffp, obj->typ->ref); + } + break; + case 7: + OPM_SymWInt(((LONGINT)(31))); + OPT_OutSign(obj->typ, obj->link); + OPT_OutName((void*)obj->name, ((LONGINT)(256))); + break; + case 10: + OPM_SymWInt(((LONGINT)(32))); + OPT_OutSign(obj->typ, obj->link); + OPT_OutName((void*)obj->name, ((LONGINT)(256))); + break; + case 9: + OPM_SymWInt(((LONGINT)(33))); + OPT_OutSign(obj->typ, obj->link); + ext = obj->conval->ext; + j = (int)(*ext)[0]; + i = 1; + OPM_SymWInt(j); + while (i <= j) { + OPM_SymWCh((*ext)[__X(i, ((LONGINT)(256)))]); + i += 1; + } + OPT_OutName((void*)obj->name, ((LONGINT)(256))); + break; + default: + OPM_LogWStr((CHAR*)"unhandled case at OPT.OutObj, obj.mode = ", (LONGINT)42); + OPM_LogWNum(obj->mode, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + } + } + OPT_OutObj(obj->right); + } +} + +void OPT_Export (BOOLEAN *ext, BOOLEAN *new) +{ + INTEGER i; + SHORTINT nofmod; + BOOLEAN done; + OPT_symExtended = 0; + OPT_symNew = 0; + nofmod = OPT_nofGmod; + OPT_Import((CHAR*)"@self", OPT_SelfName, &done); + OPT_nofGmod = nofmod; + if (OPM_noerr) { + OPM_NewSym((void*)OPT_SelfName, ((LONGINT)(256))); + if (OPM_noerr) { + OPM_SymWInt(((LONGINT)(16))); + OPT_OutName((void*)OPT_SelfName, ((LONGINT)(256))); + OPT_expCtxt.reffp = 0; + OPT_expCtxt.ref = 16; + OPT_expCtxt.nofm = 1; + OPT_expCtxt.locmno[0] = 0; + i = 1; + while (i < 64) { + OPT_expCtxt.locmno[__X(i, ((LONGINT)(64)))] = -1; + i += 1; + } + OPT_OutObj(OPT_topScope->right); + *ext = (OPT_sfpresent && OPT_symExtended); + *new = !OPT_sfpresent || OPT_symNew; + if (OPM_forceNewSym) { + *new = 1; + } + if ((((OPM_noerr && OPT_sfpresent)) && OPT_impCtxt.reffp != OPT_expCtxt.reffp)) { + *new = 1; + if (!OPT_extsf) { + OPT_err(155); + } + } + OPT_newsf = 0; + OPT_symNew = 0; + if (!OPM_noerr || OPT_findpc) { + OPM_DeleteNewSym(); + } + } + } +} + +static void OPT_InitStruct (OPT_Struct *typ, SHORTINT form) +{ + *typ = OPT_NewStr(form, 1); + (*typ)->ref = form; + (*typ)->size = OPM_ByteSize; + (*typ)->allocated = 1; + (*typ)->strobj = OPT_NewObj(); + (*typ)->pbfp = form; + (*typ)->pvfp = form; + (*typ)->fpdone = 1; + (*typ)->idfp = form; + (*typ)->idfpdone = 1; +} + +static void OPT_EnterBoolConst (OPS_Name name, LONGINT value) +{ + OPT_Object obj = NIL; + OPS_Name name__copy; + __DUPARR(name, OPS_Name); + OPT_Insert(name, &obj); + obj->conval = OPT_NewConst(); + obj->mode = 3; + obj->typ = OPT_booltyp; + obj->conval->intval = value; +} + +static void OPT_EnterTyp (OPS_Name name, SHORTINT form, INTEGER size, OPT_Struct *res) +{ + OPT_Object obj = NIL; + OPT_Struct typ = NIL; + OPS_Name name__copy; + __DUPARR(name, OPS_Name); + OPT_Insert(name, &obj); + typ = OPT_NewStr(form, 1); + obj->mode = 5; + obj->typ = typ; + obj->vis = 1; + typ->strobj = obj; + typ->size = size; + typ->ref = form; + typ->allocated = 1; + typ->pbfp = form; + typ->pvfp = form; + typ->fpdone = 1; + typ->idfp = form; + typ->idfpdone = 1; + *res = typ; +} + +static void OPT_EnterProc (OPS_Name name, INTEGER num) +{ + OPT_Object obj = NIL; + OPS_Name name__copy; + __DUPARR(name, OPS_Name); + OPT_Insert(name, &obj); + obj->mode = 8; + obj->typ = OPT_notyp; + obj->adr = num; +} + +static void EnumPtrs(void (*P)(void*)) +{ + P(OPT_topScope); + P(OPT_undftyp); + P(OPT_bytetyp); + P(OPT_booltyp); + P(OPT_chartyp); + P(OPT_sinttyp); + P(OPT_inttyp); + P(OPT_linttyp); + P(OPT_realtyp); + P(OPT_lrltyp); + P(OPT_settyp); + P(OPT_stringtyp); + P(OPT_niltyp); + P(OPT_notyp); + P(OPT_sysptrtyp); + __ENUMP(OPT_GlbMod, 64, P); + P(OPT_universe); + P(OPT_syslink); + __ENUMR(&OPT_impCtxt, OPT_ImpCtxt__typ, 6216, 1, P); +} + +__TDESC(OPT_ConstDesc, 1, 1) = {__TDFLDS("ConstDesc", 40), {0, -16}}; +__TDESC(OPT_ObjDesc, 1, 6) = {__TDFLDS("ObjDesc", 344), {0, 8, 16, 24, 304, 312, -56}}; +__TDESC(OPT_StrDesc, 1, 3) = {__TDFLDS("StrDesc", 104), {80, 88, 96, -32}}; +__TDESC(OPT_NodeDesc, 1, 6) = {__TDFLDS("NodeDesc", 56), {0, 8, 16, 32, 40, 48, -56}}; +__TDESC(OPT_ImpCtxt, 1, 510) = {__TDFLDS("ImpCtxt", 6216), {32, 40, 48, 56, 64, 72, 80, 88, 96, 104, 112, 120, 128, 136, 144, 152, + 160, 168, 176, 184, 192, 200, 208, 216, 224, 232, 240, 248, 256, 264, 272, 280, + 288, 296, 304, 312, 320, 328, 336, 344, 352, 360, 368, 376, 384, 392, 400, 408, + 416, 424, 432, 440, 448, 456, 464, 472, 480, 488, 496, 504, 512, 520, 528, 536, + 544, 552, 560, 568, 576, 584, 592, 600, 608, 616, 624, 632, 640, 648, 656, 664, + 672, 680, 688, 696, 704, 712, 720, 728, 736, 744, 752, 760, 768, 776, 784, 792, + 800, 808, 816, 824, 832, 840, 848, 856, 864, 872, 880, 888, 896, 904, 912, 920, + 928, 936, 944, 952, 960, 968, 976, 984, 992, 1000, 1008, 1016, 1024, 1032, 1040, 1048, + 1056, 1064, 1072, 1080, 1088, 1096, 1104, 1112, 1120, 1128, 1136, 1144, 1152, 1160, 1168, 1176, + 1184, 1192, 1200, 1208, 1216, 1224, 1232, 1240, 1248, 1256, 1264, 1272, 1280, 1288, 1296, 1304, + 1312, 1320, 1328, 1336, 1344, 1352, 1360, 1368, 1376, 1384, 1392, 1400, 1408, 1416, 1424, 1432, + 1440, 1448, 1456, 1464, 1472, 1480, 1488, 1496, 1504, 1512, 1520, 1528, 1536, 1544, 1552, 1560, + 1568, 1576, 1584, 1592, 1600, 1608, 1616, 1624, 1632, 1640, 1648, 1656, 1664, 1672, 1680, 1688, + 1696, 1704, 1712, 1720, 1728, 1736, 1744, 1752, 1760, 1768, 1776, 1784, 1792, 1800, 1808, 1816, + 1824, 1832, 1840, 1848, 1856, 1864, 1872, 1880, 1888, 1896, 1904, 1912, 1920, 1928, 1936, 1944, + 1952, 1960, 1968, 1976, 1984, 1992, 2000, 2008, 2016, 2024, 2032, 2040, 2048, 2056, 2064, 2072, + 2080, 2088, 2096, 2104, 2112, 2120, 2128, 2136, 2144, 2152, 2160, 2168, 2176, 2184, 2192, 2200, + 2208, 2216, 2224, 2232, 2240, 2248, 2256, 2264, 2272, 2280, 2288, 2296, 2304, 2312, 2320, 2328, + 2336, 2344, 2352, 2360, 2368, 2376, 2384, 2392, 2400, 2408, 2416, 2424, 2432, 2440, 2448, 2456, + 2464, 2472, 2480, 2488, 2496, 2504, 2512, 2520, 2528, 2536, 2544, 2552, 2560, 2568, 2576, 2584, + 2592, 2600, 2608, 2616, 2624, 2632, 2640, 2648, 2656, 2664, 2672, 2680, 2688, 2696, 2704, 2712, + 2720, 2728, 2736, 2744, 2752, 2760, 2768, 2776, 2784, 2792, 2800, 2808, 2816, 2824, 2832, 2840, + 2848, 2856, 2864, 2872, 2880, 2888, 2896, 2904, 2912, 2920, 2928, 2936, 2944, 2952, 2960, 2968, + 2976, 2984, 2992, 3000, 3008, 3016, 3024, 3032, 3040, 3048, 3056, 3064, 3072, 3080, 3088, 3096, + 3104, 3112, 3120, 3128, 3136, 3144, 3152, 3160, 3168, 3176, 3184, 3192, 3200, 3208, 3216, 3224, + 3232, 3240, 3248, 3256, 3264, 3272, 3280, 3288, 3296, 3304, 3312, 3320, 3328, 3336, 3344, 3352, + 3360, 3368, 3376, 3384, 3392, 3400, 3408, 3416, 3424, 3432, 3440, 3448, 3456, 3464, 3472, 3480, + 3488, 3496, 3504, 3512, 3520, 3528, 3536, 3544, 3552, 3560, 3568, 3576, 3584, 3592, 3600, 3608, + 3616, 3624, 3632, 3640, 3648, 3656, 3664, 3672, 3680, 3688, 3696, 3704, 3712, 3720, 3728, 3736, + 3744, 3752, 3760, 3768, 3776, 3784, 3792, 3800, 3808, 3816, 3824, 3832, 3840, 3848, 3856, 3864, + 3872, 3880, 3888, 3896, 3904, 3912, 3920, 3928, 3936, 3944, 3952, 3960, 3968, 3976, 3984, 3992, + 4000, 4008, 4016, 4024, 4032, 4040, 4048, 4056, 4064, 4072, 4080, 4088, 4096, 4104, -4088}}; +__TDESC(OPT_ExpCtxt, 1, 0) = {__TDFLDS("ExpCtxt", 80), {-8}}; + +export void *OPT__init(void) +{ + __DEFMOD; + __MODULE_IMPORT(OPM); + __MODULE_IMPORT(OPS); + __REGMOD("OPT", EnumPtrs); + __REGCMD("Close", OPT_Close); + __REGCMD("CloseScope", OPT_CloseScope); + __INITYP(OPT_ConstDesc, OPT_ConstDesc, 0); + __INITYP(OPT_ObjDesc, OPT_ObjDesc, 0); + __INITYP(OPT_StrDesc, OPT_StrDesc, 0); + __INITYP(OPT_NodeDesc, OPT_NodeDesc, 0); + __INITYP(OPT_ImpCtxt, OPT_ImpCtxt, 0); + __INITYP(OPT_ExpCtxt, OPT_ExpCtxt, 0); +/* BEGIN */ + OPT_topScope = NIL; + OPT_OpenScope(0, NIL); + OPM_errpos = 0; + OPT_InitStruct(&OPT_undftyp, 0); + OPT_InitStruct(&OPT_notyp, 12); + OPT_InitStruct(&OPT_stringtyp, 10); + OPT_InitStruct(&OPT_niltyp, 11); + OPT_undftyp->BaseTyp = OPT_undftyp; + OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp); + OPT_EnterTyp((CHAR*)"PTR", 13, OPM_PointerSize, &OPT_sysptrtyp); + OPT_EnterProc((CHAR*)"ADR", 20); + OPT_EnterProc((CHAR*)"CC", 21); + OPT_EnterProc((CHAR*)"LSH", 22); + OPT_EnterProc((CHAR*)"ROT", 23); + OPT_EnterProc((CHAR*)"GET", 24); + OPT_EnterProc((CHAR*)"PUT", 25); + OPT_EnterProc((CHAR*)"GETREG", 26); + OPT_EnterProc((CHAR*)"PUTREG", 27); + OPT_EnterProc((CHAR*)"BIT", 28); + OPT_EnterProc((CHAR*)"VAL", 29); + OPT_EnterProc((CHAR*)"NEW", 30); + OPT_EnterProc((CHAR*)"MOVE", 31); + OPT_syslink = OPT_topScope->right; + OPT_universe = OPT_topScope; + OPT_topScope->right = NIL; + OPT_EnterTyp((CHAR*)"CHAR", 3, OPM_CharSize, &OPT_chartyp); + OPT_EnterTyp((CHAR*)"SET", 9, OPM_SetSize, &OPT_settyp); + OPT_EnterTyp((CHAR*)"REAL", 7, OPM_RealSize, &OPT_realtyp); + OPT_EnterTyp((CHAR*)"INTEGER", 5, OPM_IntSize, &OPT_inttyp); + OPT_EnterTyp((CHAR*)"LONGINT", 6, OPM_LIntSize, &OPT_linttyp); + OPT_EnterTyp((CHAR*)"LONGREAL", 8, OPM_LRealSize, &OPT_lrltyp); + OPT_EnterTyp((CHAR*)"SHORTINT", 4, OPM_SIntSize, &OPT_sinttyp); + OPT_EnterTyp((CHAR*)"BOOLEAN", 2, OPM_BoolSize, &OPT_booltyp); + OPT_EnterBoolConst((CHAR*)"FALSE", ((LONGINT)(0))); + OPT_EnterBoolConst((CHAR*)"TRUE", ((LONGINT)(1))); + OPT_EnterProc((CHAR*)"HALT", 0); + OPT_EnterProc((CHAR*)"NEW", 1); + OPT_EnterProc((CHAR*)"ABS", 2); + OPT_EnterProc((CHAR*)"CAP", 3); + OPT_EnterProc((CHAR*)"ORD", 4); + OPT_EnterProc((CHAR*)"ENTIER", 5); + OPT_EnterProc((CHAR*)"ODD", 6); + OPT_EnterProc((CHAR*)"MIN", 7); + OPT_EnterProc((CHAR*)"MAX", 8); + OPT_EnterProc((CHAR*)"CHR", 9); + OPT_EnterProc((CHAR*)"SHORT", 10); + OPT_EnterProc((CHAR*)"LONG", 11); + OPT_EnterProc((CHAR*)"SIZE", 12); + OPT_EnterProc((CHAR*)"INC", 13); + OPT_EnterProc((CHAR*)"DEC", 14); + OPT_EnterProc((CHAR*)"INCL", 15); + OPT_EnterProc((CHAR*)"EXCL", 16); + OPT_EnterProc((CHAR*)"LEN", 17); + OPT_EnterProc((CHAR*)"COPY", 18); + OPT_EnterProc((CHAR*)"ASH", 19); + OPT_EnterProc((CHAR*)"ASSERT", 32); + OPT_impCtxt.ref[0] = OPT_undftyp; + OPT_impCtxt.ref[1] = OPT_bytetyp; + OPT_impCtxt.ref[2] = OPT_booltyp; + OPT_impCtxt.ref[3] = OPT_chartyp; + OPT_impCtxt.ref[4] = OPT_sinttyp; + OPT_impCtxt.ref[5] = OPT_inttyp; + OPT_impCtxt.ref[6] = OPT_linttyp; + OPT_impCtxt.ref[7] = OPT_realtyp; + OPT_impCtxt.ref[8] = OPT_lrltyp; + OPT_impCtxt.ref[9] = OPT_settyp; + OPT_impCtxt.ref[10] = OPT_stringtyp; + OPT_impCtxt.ref[11] = OPT_niltyp; + OPT_impCtxt.ref[12] = OPT_notyp; + OPT_impCtxt.ref[13] = OPT_sysptrtyp; + __ENDMOD; +} diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h new file mode 100644 index 00000000..4c3442b5 --- /dev/null +++ b/bootstrap/windows-88/OPT.h @@ -0,0 +1,106 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ + +#ifndef OPT__h +#define OPT__h + +#define LARGE +#include "SYSTEM.h" +#include "OPS.h" + +typedef + struct OPT_ConstDesc *OPT_Const; + +typedef + OPS_String *OPT_ConstExt; + +typedef + struct OPT_ConstDesc { + OPT_ConstExt ext; + LONGINT intval, intval2; + SET setval; + LONGREAL realval; + } OPT_ConstDesc; + +typedef + struct OPT_NodeDesc *OPT_Node; + +typedef + struct OPT_StrDesc *OPT_Struct; + +typedef + struct OPT_ObjDesc *OPT_Object; + +typedef + struct OPT_NodeDesc { + OPT_Node left, right, link; + SHORTINT class, subcl; + BOOLEAN readonly; + OPT_Struct typ; + OPT_Object obj; + OPT_Const conval; + } OPT_NodeDesc; + +typedef + struct OPT_ObjDesc { + OPT_Object left, right, link, scope; + OPS_Name name; + BOOLEAN leaf; + SHORTINT mode, mnolev, vis, history; + BOOLEAN used, fpdone; + LONGINT fprint; + OPT_Struct typ; + OPT_Const conval; + LONGINT adr, linkadr; + INTEGER x; + } OPT_ObjDesc; + +typedef + struct OPT_StrDesc { + SHORTINT form, comp, mno, extlev; + INTEGER ref, sysflag; + LONGINT n, size, align, txtpos; + BOOLEAN allocated, pbused, pvused; + char _prvt0[8]; + LONGINT pbfp, pvfp; + OPT_Struct BaseTyp; + OPT_Object link, strobj; + } OPT_StrDesc; + + +import void (*OPT_typSize)(OPT_Struct); +import OPT_Object OPT_topScope; +import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +import SHORTINT OPT_nofGmod; +import OPT_Object OPT_GlbMod[64]; +import OPS_Name OPT_SelfName; +import BOOLEAN OPT_SYSimported; + +import LONGINT *OPT_ConstDesc__typ; +import LONGINT *OPT_ObjDesc__typ; +import LONGINT *OPT_StrDesc__typ; +import LONGINT *OPT_NodeDesc__typ; + +import void OPT_Close (void); +import void OPT_CloseScope (void); +import void OPT_Export (BOOLEAN *ext, BOOLEAN *new); +import void OPT_FPrintErr (OPT_Object obj, INTEGER errcode); +import void OPT_FPrintObj (OPT_Object obj); +import void OPT_FPrintStr (OPT_Struct typ); +import void OPT_Find (OPT_Object *res); +import void OPT_FindField (OPS_Name name, OPT_Struct typ, OPT_Object *res); +import void OPT_FindImport (OPT_Object mod, OPT_Object *res); +import void OPT_IdFPrint (OPT_Struct typ); +import void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); +import void OPT_Init (OPS_Name name, SET opt); +import void OPT_Insert (OPS_Name name, OPT_Object *obj); +import void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); +import OPT_Const OPT_NewConst (void); +import OPT_ConstExt OPT_NewExt (void); +import OPT_Node OPT_NewNode (SHORTINT class); +import OPT_Object OPT_NewObj (void); +import OPT_Struct OPT_NewStr (SHORTINT form, SHORTINT comp); +import void OPT_OpenScope (SHORTINT level, OPT_Object owner); +import void *OPT__init(void); + + +#endif diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c new file mode 100644 index 00000000..627e325b --- /dev/null +++ b/bootstrap/windows-88/OPV.c @@ -0,0 +1,1689 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +#define LARGE +#include "SYSTEM.h" +#include "OPC.h" +#include "OPM.h" +#include "OPS.h" +#include "OPT.h" + +typedef + struct OPV_ExitInfo { + INTEGER level, label; + } OPV_ExitInfo; + + +static BOOLEAN OPV_assert, OPV_inxchk, OPV_mainprog, OPV_ansi; +static INTEGER OPV_stamp; +static LONGINT OPV_recno; +static OPV_ExitInfo OPV_exit; +static INTEGER OPV_nofExitLabels; +static BOOLEAN OPV_naturalAlignment; + +export LONGINT *OPV_ExitInfo__typ; + +static void OPV_ActualPar (OPT_Node n, OPT_Object fp); +export void OPV_AdrAndSize (OPT_Object topScope); +static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc); +static void OPV_Convert (OPT_Node n, INTEGER form, INTEGER prec); +static void OPV_DefineTDescs (OPT_Node n); +static void OPV_Entier (OPT_Node n, INTEGER prec); +static void OPV_GetTProcNum (OPT_Object obj); +static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc); +static BOOLEAN OPV_ImplicitReturn (OPT_Node n); +static void OPV_Index (OPT_Node n, OPT_Node d, INTEGER prec, INTEGER dim); +export void OPV_Init (void); +static void OPV_InitTDescs (OPT_Node n); +static void OPV_Len (OPT_Node n, LONGINT dim); +export void OPV_Module (OPT_Node prog); +static LONGINT OPV_NaturalAlignment (LONGINT size, LONGINT max); +static void OPV_NewArr (OPT_Node d, OPT_Node x); +static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, INTEGER comp); +static BOOLEAN OPV_SideEffects (OPT_Node n); +static void OPV_Stamp (OPS_Name s); +static OPT_Object OPV_SuperProc (OPT_Node n); +static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported); +static void OPV_TraverseRecord (OPT_Struct typ); +export void OPV_TypSize (OPT_Struct typ); +static void OPV_TypeOf (OPT_Node n); +static void OPV_design (OPT_Node n, INTEGER prec); +static void OPV_expr (OPT_Node n, INTEGER prec); +static void OPV_stat (OPT_Node n, OPT_Object outerProc); + + +static LONGINT OPV_NaturalAlignment (LONGINT size, LONGINT max) +{ + LONGINT _o_result; + LONGINT i; + if (size >= max) { + _o_result = max; + return _o_result; + } else { + i = 1; + while (i < size) { + i += i; + } + _o_result = i; + return _o_result; + } + __RETCHK; +} + +void OPV_TypSize (OPT_Struct typ) +{ + INTEGER f, c; + LONGINT offset, size, base, fbase, off0; + OPT_Object fld = NIL; + OPT_Struct btyp = NIL; + if (typ == OPT_undftyp) { + OPM_err(58); + } else if (typ->size == -1) { + f = typ->form; + c = typ->comp; + if (c == 4) { + btyp = typ->BaseTyp; + if (btyp == NIL) { + offset = 0; + base = OPM_RecAlign; + } else { + OPV_TypSize(btyp); + offset = btyp->size - (LONGINT)__ASHR(btyp->sysflag, 8); + base = btyp->align; + } + fld = typ->link; + while ((fld != NIL && fld->mode == 4)) { + btyp = fld->typ; + OPV_TypSize(btyp); + size = btyp->size; + fbase = OPC_Base(btyp); + OPC_Align(&offset, fbase); + fld->adr = offset; + offset += size; + if (fbase > base) { + base = fbase; + } + fld = fld->link; + } + off0 = offset; + if (offset == 0) { + offset = 1; + } + if (OPM_RecSize == 0) { + base = OPV_NaturalAlignment(offset, OPM_RecAlign); + } + OPC_Align(&offset, base); + if ((typ->strobj == NIL && __MASK(typ->align, -65536) == 0)) { + OPV_recno += 1; + base += __ASHL(OPV_recno, 16); + } + typ->size = offset; + typ->align = base; + typ->sysflag = __MASK(typ->sysflag, -256) + (int)__ASHL(offset - off0, 8); + } else if (c == 2) { + OPV_TypSize(typ->BaseTyp); + typ->size = typ->n * typ->BaseTyp->size; + } else if (f == 13) { + typ->size = OPM_PointerSize; + if (typ->BaseTyp == OPT_undftyp) { + OPM_Mark(128, typ->n); + } else { + OPV_TypSize(typ->BaseTyp); + } + } else if (f == 14) { + typ->size = OPM_ProcSize; + } else if (c == 3) { + btyp = typ->BaseTyp; + OPV_TypSize(btyp); + if (btyp->comp == 3) { + typ->size = btyp->size + 4; + } else { + typ->size = 8; + } + } + } +} + +void OPV_Init (void) +{ + OPV_stamp = 0; + OPV_recno = 0; + OPV_nofExitLabels = 0; + OPV_assert = __IN(7, OPM_opt); + OPV_inxchk = __IN(0, OPM_opt); + OPV_mainprog = __IN(10, OPM_opt); + OPV_ansi = __IN(6, OPM_opt); +} + +static void OPV_GetTProcNum (OPT_Object obj) +{ + LONGINT oldPos; + OPT_Struct typ = NIL; + OPT_Object redef = NIL; + oldPos = OPM_errpos; + OPM_errpos = obj->scope->adr; + typ = obj->link->typ; + if (typ->form == 13) { + typ = typ->BaseTyp; + } + OPT_FindField(obj->name, typ->BaseTyp, &redef); + if (redef != NIL) { + obj->adr = __ASHL(__ASHR(redef->adr, 16), 16); + if (!__IN(2, obj->conval->setval)) { + OPM_err(119); + } + } else { + obj->adr += __ASHL(typ->n, 16); + typ->n += 1; + } + OPM_errpos = oldPos; +} + +static void OPV_TraverseRecord (OPT_Struct typ) +{ + if (!typ->allocated) { + if (typ->BaseTyp != NIL) { + OPV_TraverseRecord(typ->BaseTyp); + typ->n = typ->BaseTyp->n; + } + typ->allocated = 1; + OPV_Traverse(typ->link, typ->strobj, 0); + } +} + +static void OPV_Stamp (OPS_Name s) +{ + INTEGER i, j, k; + CHAR n[10]; + OPV_stamp += 1; + i = 0; + j = OPV_stamp; + while (s[__X(i, ((LONGINT)(256)))] != 0x00) { + i += 1; + } + if (i > 25) { + i = 25; + } + s[__X(i, ((LONGINT)(256)))] = '_'; + s[__X(i + 1, ((LONGINT)(256)))] = '_'; + i += 2; + k = 0; + do { + n[__X(k, ((LONGINT)(10)))] = (CHAR)((int)__MOD(j, 10) + 48); + j = __DIV(j, 10); + k += 1; + } while (!(j == 0)); + do { + k -= 1; + s[__X(i, ((LONGINT)(256)))] = n[__X(k, ((LONGINT)(10)))]; + i += 1; + } while (!(k == 0)); + s[__X(i, ((LONGINT)(256)))] = 0x00; +} + +static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported) +{ + INTEGER mode; + OPT_Object scope = NIL; + OPT_Struct typ = NIL; + if (obj != NIL) { + OPV_Traverse(obj->left, outerScope, exported); + if (obj->name[0] == '@') { + obj->name[0] = '_'; + OPV_Stamp(obj->name); + } + obj->linkadr = 0; + mode = obj->mode; + if ((mode == 5 && (obj->vis != 0) == exported)) { + typ = obj->typ; + OPV_TypSize(obj->typ); + if (typ->form == 13) { + typ = typ->BaseTyp; + } + if (typ->comp == 4) { + OPV_TraverseRecord(typ); + } + } else if (mode == 13) { + OPV_GetTProcNum(obj); + } else if (mode == 1) { + OPV_TypSize(obj->typ); + } + if (!exported) { + if ((__IN(mode, 0x60) && obj->mnolev > 0)) { + OPV_Stamp(obj->name); + } + if (__IN(mode, 0x26)) { + obj->scope = outerScope; + } else if (__IN(mode, 0x26c0)) { + if (obj->conval->setval == 0x0) { + OPM_err(129); + } + scope = obj->scope; + scope->leaf = 1; + __COPY(obj->name, scope->name, ((LONGINT)(256))); + OPV_Stamp(scope->name); + if (mode == 9) { + obj->adr = 1; + } + if (scope->mnolev > 1) { + outerScope->leaf = 0; + } + OPV_Traverse(obj->scope->right, obj->scope, 0); + } + } + OPV_Traverse(obj->right, outerScope, exported); + } +} + +void OPV_AdrAndSize (OPT_Object topScope) +{ + OPM_errpos = topScope->adr; + topScope->leaf = 1; + OPV_Traverse(topScope->right, topScope, 1); + OPV_Traverse(topScope->right, topScope, 0); + OPT_chartyp->strobj->linkadr = 2; + OPT_settyp->strobj->linkadr = 2; + OPT_realtyp->strobj->linkadr = 2; + OPT_inttyp->strobj->linkadr = 2; + OPT_linttyp->strobj->linkadr = 2; + OPT_lrltyp->strobj->linkadr = 2; + OPT_sinttyp->strobj->linkadr = 2; + OPT_booltyp->strobj->linkadr = 2; + OPT_bytetyp->strobj->linkadr = 2; + OPT_sysptrtyp->strobj->linkadr = 2; +} + +static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, INTEGER comp) +{ + INTEGER _o_result; + switch (class) { + case 7: case 0: case 2: case 4: case 9: + case 13: + _o_result = 10; + return _o_result; + break; + case 5: + if (__IN(3, OPM_opt)) { + _o_result = 10; + return _o_result; + } else { + _o_result = 9; + return _o_result; + } + break; + case 1: + if (__IN(comp, 0x0c)) { + _o_result = 10; + return _o_result; + } else { + _o_result = 9; + return _o_result; + } + break; + case 3: + _o_result = 9; + return _o_result; + break; + case 11: + switch (subclass) { + case 33: case 7: case 24: case 29: case 20: + _o_result = 9; + return _o_result; + break; + case 16: case 21: case 22: case 23: case 25: + _o_result = 10; + return _o_result; + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence Nmop, subclass = ", (LONGINT)51); + OPM_LogWNum(subclass, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + break; + case 12: + switch (subclass) { + case 1: + if (form == 9) { + _o_result = 4; + return _o_result; + } else { + _o_result = 8; + return _o_result; + } + break; + case 2: + if (form == 9) { + _o_result = 3; + return _o_result; + } else { + _o_result = 8; + return _o_result; + } + break; + case 3: case 4: + _o_result = 10; + return _o_result; + break; + case 6: + if (form == 9) { + _o_result = 2; + return _o_result; + } else { + _o_result = 7; + return _o_result; + } + break; + case 7: + if (form == 9) { + _o_result = 4; + return _o_result; + } else { + _o_result = 7; + return _o_result; + } + break; + case 11: case 12: case 13: case 14: + _o_result = 6; + return _o_result; + break; + case 9: case 10: + _o_result = 5; + return _o_result; + break; + case 5: + _o_result = 1; + return _o_result; + break; + case 8: + _o_result = 0; + return _o_result; + break; + case 19: case 15: case 17: case 18: case 26: + case 27: case 28: + _o_result = 10; + return _o_result; + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence Ndop, subclass = ", (LONGINT)51); + OPM_LogWNum(subclass, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + break; + case 10: + _o_result = 10; + return _o_result; + break; + case 8: case 6: + _o_result = 12; + return _o_result; + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence, class = ", (LONGINT)43); + OPM_LogWNum(class, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + __RETCHK; +} + +static void OPV_Len (OPT_Node n, LONGINT dim) +{ + while ((n->class == 4 && n->typ->comp == 3)) { + dim += 1; + n = n->left; + } + if ((n->class == 3 && n->typ->comp == 3)) { + OPV_design(n->left, 10); + OPM_WriteString((CHAR*)"->len[", (LONGINT)7); + OPM_WriteInt(dim); + OPM_Write(']'); + } else { + OPC_Len(n->obj, n->typ, dim); + } +} + +static BOOLEAN OPV_SideEffects (OPT_Node n) +{ + BOOLEAN _o_result; + if (n != NIL) { + _o_result = (n->class == 13 || OPV_SideEffects(n->left)) || OPV_SideEffects(n->right); + return _o_result; + } else { + _o_result = 0; + return _o_result; + } + __RETCHK; +} + +static void OPV_Entier (OPT_Node n, INTEGER prec) +{ + if (__IN(n->typ->form, 0x0180)) { + OPM_WriteString((CHAR*)"__ENTIER(", (LONGINT)10); + OPV_expr(n, -1); + OPM_Write(')'); + } else { + OPV_expr(n, prec); + } +} + +static void OPV_Convert (OPT_Node n, INTEGER form, INTEGER prec) +{ + INTEGER from; + from = n->typ->form; + if (form == 9) { + OPM_WriteString((CHAR*)"__SETOF(", (LONGINT)9); + OPV_Entier(n, -1); + OPM_Write(')'); + } else if (form == 6) { + if (from < 6) { + OPM_WriteString((CHAR*)"(LONGINT)", (LONGINT)10); + } + OPV_Entier(n, 9); + } else if (form == 5) { + if (from < 5) { + OPM_WriteString((CHAR*)"(int)", (LONGINT)6); + OPV_expr(n, 9); + } else { + if (__IN(2, OPM_opt)) { + OPM_WriteString((CHAR*)"__SHORT", (LONGINT)8); + if (OPV_SideEffects(n)) { + OPM_Write('F'); + } + OPM_Write('('); + OPV_Entier(n, -1); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteInt(OPM_MaxInt + 1); + OPM_Write(')'); + } else { + OPM_WriteString((CHAR*)"(int)", (LONGINT)6); + OPV_Entier(n, 9); + } + } + } else if (form == 4) { + if (__IN(2, OPM_opt)) { + OPM_WriteString((CHAR*)"__SHORT", (LONGINT)8); + if (OPV_SideEffects(n)) { + OPM_Write('F'); + } + OPM_Write('('); + OPV_Entier(n, -1); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteInt(OPM_MaxSInt + 1); + OPM_Write(')'); + } else { + OPM_WriteString((CHAR*)"(int)", (LONGINT)6); + OPV_Entier(n, 9); + } + } else if (form == 3) { + if (__IN(2, OPM_opt)) { + OPM_WriteString((CHAR*)"__CHR", (LONGINT)6); + if (OPV_SideEffects(n)) { + OPM_Write('F'); + } + OPM_Write('('); + OPV_Entier(n, -1); + OPM_Write(')'); + } else { + OPM_WriteString((CHAR*)"(CHAR)", (LONGINT)7); + OPV_Entier(n, 9); + } + } else { + OPV_expr(n, prec); + } +} + +static void OPV_TypeOf (OPT_Node n) +{ + if (n->typ->form == 13) { + OPM_WriteString((CHAR*)"__TYPEOF(", (LONGINT)10); + OPV_expr(n, -1); + OPM_Write(')'); + } else if (__IN(n->class, 0x15)) { + OPC_Andent(n->typ); + OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + } else if (n->class == 3) { + OPM_WriteString((CHAR*)"__TYPEOF(", (LONGINT)10); + OPV_expr(n->left, -1); + OPM_Write(')'); + } else if (n->class == 5) { + OPV_TypeOf(n->left); + } else if ((n->class == 11 && n->subcl == 29)) { + OPC_TypeOf(n->left->obj); + } else { + OPC_TypeOf(n->obj); + } +} + +static void OPV_Index (OPT_Node n, OPT_Node d, INTEGER prec, INTEGER dim) +{ + if (!OPV_inxchk || (n->right->class == 7 && (n->right->conval->intval == 0 || n->left->typ->comp != 3))) { + OPV_expr(n->right, prec); + } else { + if (OPV_SideEffects(n->right)) { + OPM_WriteString((CHAR*)"__XF(", (LONGINT)6); + } else { + OPM_WriteString((CHAR*)"__X(", (LONGINT)5); + } + OPV_expr(n->right, -1); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPV_Len(d, dim); + OPM_Write(')'); + } +} + +static void OPV_design (OPT_Node n, INTEGER prec) +{ + OPT_Object obj = NIL; + OPT_Struct typ = NIL; + INTEGER class, designPrec, comp; + OPT_Node d = NIL, x = NIL; + INTEGER dims, i, _for__26; + comp = n->typ->comp; + obj = n->obj; + class = n->class; + designPrec = OPV_Precedence(class, n->subcl, n->typ->form, comp); + if ((((((class == 0 && obj->mnolev > 0)) && (int)obj->mnolev != OPM_level)) && prec == 10)) { + designPrec = 9; + } + if (prec > designPrec) { + OPM_Write('('); + } + if (prec == 11) { + OPM_Write('*'); + } + switch (class) { + case 9: + OPC_Ident(n->obj); + break; + case 0: + OPC_CompleteIdent(n->obj); + break; + case 1: + if (!__IN(comp, 0x0c)) { + OPM_Write('*'); + } + OPC_CompleteIdent(n->obj); + break; + case 2: + if (n->left->class == 3) { + OPV_design(n->left->left, designPrec); + OPM_WriteString((CHAR*)"->", (LONGINT)3); + } else { + OPV_design(n->left, designPrec); + OPM_Write('.'); + } + OPC_Ident(n->obj); + break; + case 3: + if (n->typ->comp == 3) { + OPV_design(n->left, 10); + OPM_WriteString((CHAR*)"->data", (LONGINT)7); + } else { + OPM_Write('*'); + OPV_design(n->left, designPrec); + } + break; + case 4: + d = n->left; + if (d->typ->comp == 3) { + dims = 0; + while (d->class == 4) { + d = d->left; + dims += 1; + } + if (n->typ->comp == 3) { + OPM_Write('&'); + } + OPV_design(d, designPrec); + OPM_Write('['); + if (n->typ->comp == 3) { + OPM_Write('('); + } + i = dims; + x = n; + while (x != d) { + if (x->left != d) { + OPV_Index(x, d, 7, i); + OPM_WriteString((CHAR*)" + ", (LONGINT)4); + OPV_Len(d, i); + OPM_WriteString((CHAR*)" * (", (LONGINT)5); + i -= 1; + } else { + OPV_Index(x, d, -1, i); + } + x = x->left; + } + _for__26 = dims; + i = 1; + while (i <= _for__26) { + OPM_Write(')'); + i += 1; + } + if (n->typ->comp == 3) { + OPM_Write(')'); + while ((LONGINT)i < __ASHR(d->typ->size - 4, 2)) { + OPM_WriteString((CHAR*)" * ", (LONGINT)4); + OPV_Len(d, i); + i += 1; + } + } + OPM_Write(']'); + } else { + OPV_design(n->left, designPrec); + OPM_Write('['); + OPV_Index(n, n->left, -1, 0); + OPM_Write(']'); + } + break; + case 5: + typ = n->typ; + obj = n->left->obj; + if (__IN(3, OPM_opt)) { + if (typ->comp == 4) { + OPM_WriteString((CHAR*)"__GUARDR(", (LONGINT)10); + if ((int)obj->mnolev != OPM_level) { + OPM_WriteStringVar((void*)obj->scope->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"__curr->", (LONGINT)9); + OPC_Ident(obj); + } else { + OPC_Ident(obj); + } + } else { + if (typ->BaseTyp->strobj == NIL) { + OPM_WriteString((CHAR*)"__GUARDA(", (LONGINT)10); + } else { + OPM_WriteString((CHAR*)"__GUARDP(", (LONGINT)10); + } + OPV_expr(n->left, -1); + typ = typ->BaseTyp; + } + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPC_Andent(typ); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteInt(typ->extlev); + OPM_Write(')'); + } else { + if (typ->comp == 4) { + OPM_WriteString((CHAR*)"*(", (LONGINT)3); + OPC_Ident(typ->strobj); + OPM_WriteString((CHAR*)"*)", (LONGINT)3); + OPC_CompleteIdent(obj); + } else { + OPM_Write('('); + OPC_Ident(typ->strobj); + OPM_Write(')'); + OPV_expr(n->left, designPrec); + } + } + break; + case 6: + if (__IN(3, OPM_opt)) { + if (n->left->class == 1) { + OPM_WriteString((CHAR*)"__GUARDEQR(", (LONGINT)12); + OPC_CompleteIdent(n->left->obj); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPV_TypeOf(n->left); + } else { + OPM_WriteString((CHAR*)"__GUARDEQP(", (LONGINT)12); + OPV_expr(n->left->left, -1); + } + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPC_Ident(n->left->typ->strobj); + OPM_Write(')'); + } else { + OPV_expr(n->left, -1); + } + break; + case 11: + if (n->subcl == 29) { + OPV_design(n->left, prec); + } + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPV.design, class = ", (LONGINT)39); + OPM_LogWNum(class, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + if (prec > designPrec) { + OPM_Write(')'); + } +} + +static void OPV_ActualPar (OPT_Node n, OPT_Object fp) +{ + OPT_Struct typ = NIL, aptyp = NIL; + INTEGER comp, form, mode, prec, dim; + OPM_Write('('); + while (n != NIL) { + typ = fp->typ; + comp = typ->comp; + form = typ->form; + mode = fp->mode; + prec = -1; + if ((((mode == 2 && n->class == 11)) && n->subcl == 29)) { + OPM_Write('('); + OPC_Ident(n->typ->strobj); + OPM_WriteString((CHAR*)"*)", (LONGINT)3); + prec = 10; + } + if (!__IN(n->typ->comp, 0x0c)) { + if (mode == 2) { + if ((OPV_ansi && typ != n->typ)) { + OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + } + OPM_Write('&'); + prec = 9; + } else if (OPV_ansi) { + if ((__IN(comp, 0x0c) && n->class == 7)) { + OPM_WriteString((CHAR*)"(CHAR*)", (LONGINT)8); + } else if ((((form == 13 && typ != n->typ)) && n->typ != OPT_niltyp)) { + OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + } + } else { + if ((__IN(form, 0x0180) && __IN(n->typ->form, 0x70))) { + OPM_WriteString((CHAR*)"(double)", (LONGINT)9); + prec = 9; + } else if ((form == 6 && n->typ->form < 6)) { + OPM_WriteString((CHAR*)"(LONGINT)", (LONGINT)10); + prec = 9; + } + } + } else if (OPV_ansi) { + if ((((mode == 2 && typ != n->typ)) && prec == -1)) { + OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + } + } + if ((((mode == 2 && n->class == 11)) && n->subcl == 29)) { + OPV_expr(n->left, prec); + } else if ((((((form == 6 && n->class == 7)) && n->conval->intval <= OPM_MaxInt)) && n->conval->intval >= OPM_MinInt)) { + OPM_WriteString((CHAR*)"((LONGINT)(", (LONGINT)12); + OPV_expr(n, prec); + OPM_WriteString((CHAR*)"))", (LONGINT)3); + } else { + OPV_expr(n, prec); + } + if ((comp == 4 && mode == 2)) { + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPV_TypeOf(n); + } else if (comp == 3) { + if (n->class == 7) { + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)"(LONGINT)", (LONGINT)10); + OPM_WriteInt(n->conval->intval2); + } else { + aptyp = n->typ; + dim = 0; + while ((typ->comp == 3 && typ->BaseTyp->form != 1)) { + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPV_Len(n, dim); + typ = typ->BaseTyp; + aptyp = aptyp->BaseTyp; + dim += 1; + } + if ((typ->comp == 3 && typ->BaseTyp->form == 1)) { + OPM_WriteString((CHAR*)", ", (LONGINT)3); + while (aptyp->comp == 3) { + OPV_Len(n, dim); + OPM_WriteString((CHAR*)" * ", (LONGINT)4); + dim += 1; + aptyp = aptyp->BaseTyp; + } + OPM_WriteString((CHAR*)"((LONGINT)(", (LONGINT)12); + OPM_WriteInt(aptyp->size); + OPM_WriteString((CHAR*)"))", (LONGINT)3); + } + } + } + n = n->link; + fp = fp->link; + if (n != NIL) { + OPM_WriteString((CHAR*)", ", (LONGINT)3); + } + } + OPM_Write(')'); +} + +static OPT_Object OPV_SuperProc (OPT_Node n) +{ + OPT_Object _o_result; + OPT_Object obj = NIL; + OPT_Struct typ = NIL; + typ = n->right->typ; + if (typ->form == 13) { + typ = typ->BaseTyp; + } + OPT_FindField(n->left->obj->name, typ->BaseTyp, &obj); + _o_result = obj; + return _o_result; +} + +static void OPV_expr (OPT_Node n, INTEGER prec) +{ + INTEGER class, subclass, form, exprPrec; + OPT_Struct typ = NIL; + OPT_Node l = NIL, r = NIL; + OPT_Object proc = NIL; + class = n->class; + subclass = n->subcl; + form = n->typ->form; + l = n->left; + r = n->right; + exprPrec = OPV_Precedence(class, subclass, form, n->typ->comp); + if ((exprPrec <= prec && __IN(class, 0x3ce0))) { + OPM_Write('('); + } + switch (class) { + case 7: + OPC_Constant(n->conval, form); + break; + case 10: + OPM_WriteString((CHAR*)"__SETRNG(", (LONGINT)10); + OPV_expr(l, -1); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPV_expr(r, -1); + OPM_Write(')'); + break; + case 11: + switch (subclass) { + case 33: + OPM_Write('!'); + OPV_expr(l, exprPrec); + break; + case 7: + if (form == 9) { + OPM_Write('~'); + } else { + OPM_Write('-'); + } + OPV_expr(l, exprPrec); + break; + case 16: + typ = n->obj->typ; + if (l->typ->comp == 4) { + OPM_WriteString((CHAR*)"__IS(", (LONGINT)6); + OPC_TypeOf(l->obj); + } else { + OPM_WriteString((CHAR*)"__ISP(", (LONGINT)7); + OPV_expr(l, -1); + typ = typ->BaseTyp; + } + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPC_Andent(typ); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteInt(typ->extlev); + OPM_Write(')'); + break; + case 20: + OPV_Convert(l, form, exprPrec); + break; + case 21: + if (OPV_SideEffects(l)) { + if (l->typ->form < 7) { + if (l->typ->form < 6) { + OPM_WriteString((CHAR*)"(int)", (LONGINT)6); + } + OPM_WriteString((CHAR*)"__ABSF(", (LONGINT)8); + } else { + OPM_WriteString((CHAR*)"__ABSFD(", (LONGINT)9); + } + } else { + OPM_WriteString((CHAR*)"__ABS(", (LONGINT)7); + } + OPV_expr(l, -1); + OPM_Write(')'); + break; + case 22: + OPM_WriteString((CHAR*)"__CAP(", (LONGINT)7); + OPV_expr(l, -1); + OPM_Write(')'); + break; + case 23: + OPM_WriteString((CHAR*)"__ODD(", (LONGINT)7); + OPV_expr(l, -1); + OPM_Write(')'); + break; + case 24: + OPM_WriteString((CHAR*)"(LONGINT)(uintptr_t)", (LONGINT)21); + if (l->class == 1) { + OPC_CompleteIdent(l->obj); + } else { + if ((l->typ->form != 10 && !__IN(l->typ->comp, 0x0c))) { + OPM_Write('&'); + } + OPV_expr(l, exprPrec); + } + break; + case 29: + if ((((__IN(n->typ->form, 0x6240) && __IN(l->typ->form, 0x6240))) && n->typ->size == l->typ->size) || !__IN(l->class, 0x17)) { + OPM_Write('('); + OPC_Ident(n->typ->strobj); + OPM_Write(')'); + if (__IN(n->typ->form, 0x6000) || __IN(l->typ->form, 0x6000)) { + OPM_WriteString((CHAR*)"(uintptr_t)", (LONGINT)12); + } + OPV_expr(l, exprPrec); + } else { + if (__IN(n->typ->form, 0x6000) || __IN(l->typ->form, 0x6000)) { + OPM_WriteString((CHAR*)"__VALP(", (LONGINT)8); + } else { + OPM_WriteString((CHAR*)"__VAL(", (LONGINT)7); + } + OPC_Ident(n->typ->strobj); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPV_expr(l, -1); + OPM_Write(')'); + } + break; + default: + OPM_err(200); + break; + } + break; + case 12: + switch (subclass) { + case 19: + OPV_Len(l, r->conval->intval); + break; + case 15: case 17: case 18: case 26: case 27: + case 28: case 3: case 4: + switch (subclass) { + case 15: + OPM_WriteString((CHAR*)"__IN(", (LONGINT)6); + break; + case 17: + if (r->class == 7) { + if (r->conval->intval >= 0) { + OPM_WriteString((CHAR*)"__ASHL(", (LONGINT)8); + } else { + OPM_WriteString((CHAR*)"__ASHR(", (LONGINT)8); + } + } else if (OPV_SideEffects(r)) { + OPM_WriteString((CHAR*)"__ASHF(", (LONGINT)8); + } else { + OPM_WriteString((CHAR*)"__ASH(", (LONGINT)7); + } + break; + case 18: + OPM_WriteString((CHAR*)"__MASK(", (LONGINT)8); + break; + case 26: + OPM_WriteString((CHAR*)"__BIT(", (LONGINT)7); + break; + case 27: + if (r->class == 7) { + if (r->conval->intval >= 0) { + OPM_WriteString((CHAR*)"__LSHL(", (LONGINT)8); + } else { + OPM_WriteString((CHAR*)"__LSHR(", (LONGINT)8); + } + } else { + OPM_WriteString((CHAR*)"__LSH(", (LONGINT)7); + } + break; + case 28: + if (r->class == 7) { + if (r->conval->intval >= 0) { + OPM_WriteString((CHAR*)"__ROTL(", (LONGINT)8); + } else { + OPM_WriteString((CHAR*)"__ROTR(", (LONGINT)8); + } + } else { + OPM_WriteString((CHAR*)"__ROT(", (LONGINT)7); + } + break; + case 3: + if (OPV_SideEffects(n)) { + if (form < 6) { + OPM_WriteString((CHAR*)"(int)", (LONGINT)6); + } + OPM_WriteString((CHAR*)"__DIVF(", (LONGINT)8); + } else { + OPM_WriteString((CHAR*)"__DIV(", (LONGINT)7); + } + break; + case 4: + if (form < 6) { + OPM_WriteString((CHAR*)"(int)", (LONGINT)6); + } + if (OPV_SideEffects(n)) { + OPM_WriteString((CHAR*)"__MODF(", (LONGINT)8); + } else { + OPM_WriteString((CHAR*)"__MOD(", (LONGINT)7); + } + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, subclass = ", (LONGINT)40); + OPM_LogWNum(subclass, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + OPV_expr(l, -1); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + if ((((__IN(subclass, 0x18020000) && r->class == 7)) && r->conval->intval < 0)) { + OPM_WriteInt(-r->conval->intval); + } else { + OPV_expr(r, -1); + } + if (__IN(subclass, 0x18000000)) { + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPC_Ident(l->typ->strobj); + } + OPM_Write(')'); + break; + case 9: case 10: case 11: case 12: case 13: + case 14: + if (__IN(l->typ->form, 0x8400)) { + OPM_WriteString((CHAR*)"__STRCMP(", (LONGINT)10); + OPV_expr(l, -1); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPV_expr(r, -1); + OPM_Write(')'); + OPC_Cmp(subclass); + OPM_Write('0'); + } else { + OPV_expr(l, exprPrec); + OPC_Cmp(subclass); + typ = l->typ; + if ((((((typ->form == 13 && r->typ->form != 11)) && r->typ != typ)) && r->typ != OPT_sysptrtyp)) { + OPM_WriteString((CHAR*)"(void *) ", (LONGINT)10); + } + OPV_expr(r, exprPrec); + } + break; + default: + if (subclass == 5 || (form == 9 && (subclass == 1 || subclass == 7))) { + OPM_Write('('); + } + OPV_expr(l, exprPrec); + switch (subclass) { + case 1: + if (form == 9) { + OPM_WriteString((CHAR*)" & ", (LONGINT)4); + } else { + OPM_WriteString((CHAR*)" * ", (LONGINT)4); + } + break; + case 2: + if (form == 9) { + OPM_WriteString((CHAR*)" ^ ", (LONGINT)4); + } else { + OPM_WriteString((CHAR*)" / ", (LONGINT)4); + if (r->obj == NIL || __IN(r->obj->typ->form, 0x70)) { + OPM_Write('('); + OPC_Ident(n->typ->strobj); + OPM_Write(')'); + } + } + break; + case 5: + OPM_WriteString((CHAR*)" && ", (LONGINT)5); + break; + case 6: + if (form == 9) { + OPM_WriteString((CHAR*)" | ", (LONGINT)4); + } else { + OPM_WriteString((CHAR*)" + ", (LONGINT)4); + } + break; + case 7: + if (form == 9) { + OPM_WriteString((CHAR*)" & ~", (LONGINT)5); + } else { + OPM_WriteString((CHAR*)" - ", (LONGINT)4); + } + break; + case 8: + OPM_WriteString((CHAR*)" || ", (LONGINT)5); + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, subclass = ", (LONGINT)40); + OPM_LogWNum(subclass, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + OPV_expr(r, exprPrec); + if (subclass == 5 || (form == 9 && (subclass == 1 || subclass == 7))) { + OPM_Write(')'); + } + break; + } + break; + case 13: + if ((l->obj != NIL && l->obj->mode == 13)) { + if (l->subcl == 1) { + proc = OPV_SuperProc(n); + } else { + OPM_WriteString((CHAR*)"__", (LONGINT)3); + proc = OPC_BaseTProc(l->obj); + } + OPC_Ident(proc); + n->obj = proc->link; + } else if (l->class == 9) { + OPV_design(l, 10); + } else { + OPV_design(l, 11); + } + OPV_ActualPar(r, n->obj); + break; + default: + OPV_design(n, prec); + break; + } + if ((exprPrec <= prec && __IN(class, 0x3ca0))) { + OPM_Write(')'); + } +} + +static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) +{ + OPT_Node if_ = NIL; + OPT_Object obj = NIL; + OPT_Struct typ = NIL; + LONGINT adr; + if_ = n->left; + while (if_ != NIL) { + OPM_WriteString((CHAR*)"if ", (LONGINT)4); + OPV_expr(if_->left, 12); + OPM_Write(' '); + OPC_BegBlk(); + if ((n->class == 27 && if_->left->left != NIL)) { + obj = if_->left->left->obj; + typ = obj->typ; + adr = obj->adr; + if (typ->comp == 4) { + OPC_BegStat(); + OPC_Ident(if_->left->obj); + OPM_WriteString((CHAR*)" *", (LONGINT)3); + OPM_WriteString(obj->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"__ = (void*)", (LONGINT)13); + obj->adr = 0; + OPC_CompleteIdent(obj); + OPC_EndStat(); + } + obj->adr = 1; + obj->typ = if_->left->obj->typ; + OPV_stat(if_->right, outerProc); + obj->typ = typ; + obj->adr = adr; + } else { + OPV_stat(if_->right, outerProc); + } + if_ = if_->link; + if ((if_ != NIL || n->right != NIL) || withtrap) { + OPC_EndBlk0(); + OPM_WriteString((CHAR*)" else ", (LONGINT)7); + } else { + OPC_EndBlk(); + } + } + if (withtrap) { + OPM_WriteString((CHAR*)"__WITHCHK", (LONGINT)10); + OPC_EndStat(); + } else if (n->right != NIL) { + OPC_BegBlk(); + OPV_stat(n->right, outerProc); + OPC_EndBlk(); + } +} + +static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc) +{ + OPT_Node switchCase = NIL, label = NIL; + LONGINT low, high; + INTEGER form, i; + OPM_WriteString((CHAR*)"switch ", (LONGINT)8); + OPV_expr(n->left, 12); + OPM_Write(' '); + OPC_BegBlk(); + form = n->left->typ->form; + switchCase = n->right->left; + while (switchCase != NIL) { + label = switchCase->left; + i = 0; + while (label != NIL) { + low = label->conval->intval; + high = label->conval->intval2; + while (low <= high) { + if (i == 0) { + OPC_BegStat(); + } + OPC_Case(low, form); + low += 1; + i += 1; + if (i == 5) { + OPM_WriteLn(); + i = 0; + } + } + label = label->link; + } + if (i > 0) { + OPM_WriteLn(); + } + OPC_Indent(1); + OPV_stat(switchCase->right, outerProc); + OPC_BegStat(); + OPM_WriteString((CHAR*)"break", (LONGINT)6); + OPC_EndStat(); + OPC_Indent(-1); + switchCase = switchCase->link; + } + OPC_BegStat(); + OPM_WriteString((CHAR*)"default: ", (LONGINT)10); + if (n->right->conval->setval != 0x0) { + OPC_Indent(1); + OPM_WriteLn(); + OPV_stat(n->right->right, outerProc); + OPC_BegStat(); + OPM_WriteString((CHAR*)"break", (LONGINT)6); + OPC_Indent(-1); + } else { + OPM_WriteString((CHAR*)"__CASECHK", (LONGINT)10); + } + OPC_EndStat(); + OPC_EndBlk(); +} + +static BOOLEAN OPV_ImplicitReturn (OPT_Node n) +{ + BOOLEAN _o_result; + while ((n != NIL && n->class != 26)) { + n = n->link; + } + _o_result = n == NIL; + return _o_result; +} + +static void OPV_NewArr (OPT_Node d, OPT_Node x) +{ + OPT_Struct typ = NIL, base = NIL; + INTEGER nofdim, nofdyn; + typ = d->typ->BaseTyp; + base = typ; + nofdim = 0; + nofdyn = 0; + while (base->comp == 3) { + nofdim += 1; + nofdyn += 1; + base = base->BaseTyp; + } + OPV_design(d, -1); + OPM_WriteString((CHAR*)" = __NEWARR(", (LONGINT)13); + while (base->comp == 2) { + nofdim += 1; + base = base->BaseTyp; + } + if ((base->comp == 4 && OPC_NofPtrs(base) != 0)) { + OPC_Ident(base->strobj); + OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + } else if (base->form == 13) { + OPM_WriteString((CHAR*)"POINTER__typ", (LONGINT)13); + } else { + OPM_WriteString((CHAR*)"NIL", (LONGINT)4); + } + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)"((LONGINT)(", (LONGINT)12); + OPM_WriteInt(base->size); + OPM_WriteString((CHAR*)"))", (LONGINT)3); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteInt(OPC_Base(base)); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteInt(nofdim); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteInt(nofdyn); + while (typ != base) { + OPM_WriteString((CHAR*)", ", (LONGINT)3); + if (typ->comp == 3) { + if (x->class == 7) { + OPM_WriteString((CHAR*)"(LONGINT)(", (LONGINT)11); + OPV_expr(x, -1); + OPM_WriteString((CHAR*)")", (LONGINT)2); + } else { + OPM_WriteString((CHAR*)"(LONGINT)", (LONGINT)10); + OPV_expr(x, 10); + } + x = x->link; + } else { + OPM_WriteString((CHAR*)"(LONGINT)", (LONGINT)10); + OPM_WriteInt(typ->n); + } + typ = typ->BaseTyp; + } + OPM_Write(')'); +} + +static void OPV_DefineTDescs (OPT_Node n) +{ + while ((n != NIL && n->class == 14)) { + OPC_TDescDecl(n->typ); + n = n->link; + } +} + +static void OPV_InitTDescs (OPT_Node n) +{ + while ((n != NIL && n->class == 14)) { + OPC_InitTDesc(n->typ); + n = n->link; + } +} + +static void OPV_stat (OPT_Node n, OPT_Object outerProc) +{ + OPT_Object proc = NIL; + OPV_ExitInfo saved; + OPT_Node l = NIL, r = NIL; + while ((n != NIL && OPM_noerr)) { + OPM_errpos = n->conval->intval; + if (n->class != 14) { + OPC_BegStat(); + } + switch (n->class) { + case 18: + if (n->obj == NIL) { + OPM_level += 1; + OPV_stat(n->left, outerProc); + OPM_level -= 1; + OPC_GenEnumPtrs(OPT_topScope->scope); + OPV_DefineTDescs(n->right); + OPC_EnterBody(); + OPV_InitTDescs(n->right); + OPM_WriteString((CHAR*)"/* BEGIN */", (LONGINT)12); + OPM_WriteLn(); + OPV_stat(n->right, outerProc); + OPC_ExitBody(); + } else { + proc = n->obj; + OPC_TypeDefs(proc->scope->right, 0); + if (!proc->scope->leaf) { + OPC_DefineInter(proc); + } + OPM_level += 1; + OPV_stat(n->left, proc); + OPM_level -= 1; + OPC_EnterProc(proc); + OPV_stat(n->right, proc); + OPC_ExitProc(proc, 1, OPV_ImplicitReturn(n->right)); + } + break; + case 14: + break; + case 19: + switch (n->subcl) { + case 0: + l = n->left; + r = n->right; + if (l->typ->comp == 2) { + OPM_WriteString((CHAR*)"__MOVE(", (LONGINT)8); + OPV_expr(r, -1); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPV_expr(l, -1); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + if (r->typ == OPT_stringtyp) { + OPM_WriteInt(r->conval->intval2); + } else { + OPM_WriteInt(r->typ->size); + } + OPM_Write(')'); + } else { + if ((((((l->typ->form == 13 && l->obj != NIL)) && l->obj->adr == 1)) && l->obj->mode == 1)) { + l->obj->adr = 0; + OPV_design(l, -1); + l->obj->adr = 1; + if (r->typ->form != 11) { + OPM_WriteString((CHAR*)" = (void*)", (LONGINT)11); + } else { + OPM_WriteString((CHAR*)" = ", (LONGINT)4); + } + } else { + OPV_design(l, -1); + OPM_WriteString((CHAR*)" = ", (LONGINT)4); + } + if (l->typ == r->typ) { + OPV_expr(r, -1); + } else if ((((l->typ->form == 13 && r->typ->form != 11)) && l->typ->strobj != NIL)) { + OPM_Write('('); + OPC_Ident(l->typ->strobj); + OPM_Write(')'); + OPV_expr(r, -1); + } else if (l->typ->comp == 4) { + OPM_WriteString((CHAR*)"*(", (LONGINT)3); + OPC_Andent(l->typ); + OPM_WriteString((CHAR*)"*)&", (LONGINT)4); + OPV_expr(r, 9); + } else { + OPV_expr(r, -1); + } + } + break; + case 1: + if (n->left->typ->BaseTyp->comp == 4) { + OPM_WriteString((CHAR*)"__NEW(", (LONGINT)7); + OPV_design(n->left, -1); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPC_Andent(n->left->typ->BaseTyp); + OPM_WriteString((CHAR*)")", (LONGINT)2); + } else if (__IN(n->left->typ->BaseTyp->comp, 0x0c)) { + OPV_NewArr(n->left, n->right); + } + break; + case 13: case 14: + OPV_expr(n->left, -1); + OPC_Increment(n->subcl == 14); + OPV_expr(n->right, -1); + break; + case 15: case 16: + OPV_expr(n->left, -1); + OPC_SetInclude(n->subcl == 16); + OPM_WriteString((CHAR*)"__SETOF(", (LONGINT)9); + OPV_expr(n->right, -1); + OPM_Write(')'); + break; + case 18: + OPM_WriteString((CHAR*)"__COPY(", (LONGINT)8); + OPV_expr(n->right, -1); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPV_expr(n->left, -1); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPV_Len(n->left, ((LONGINT)(0))); + OPM_Write(')'); + break; + case 31: + OPM_WriteString((CHAR*)"__MOVE(", (LONGINT)8); + OPV_expr(n->right, -1); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPV_expr(n->left, -1); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPV_expr(n->right->link, -1); + OPM_Write(')'); + break; + case 24: + OPM_WriteString((CHAR*)"__GET(", (LONGINT)7); + OPV_expr(n->right, -1); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPV_expr(n->left, -1); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPC_Ident(n->left->typ->strobj); + OPM_Write(')'); + break; + case 25: + OPM_WriteString((CHAR*)"__PUT(", (LONGINT)7); + OPV_expr(n->left, -1); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPV_expr(n->right, -1); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPC_Ident(n->right->typ->strobj); + OPM_Write(')'); + break; + case 26: case 27: + OPM_err(200); + break; + case 30: + OPM_WriteString((CHAR*)"__SYSNEW(", (LONGINT)10); + OPV_design(n->left, -1); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPV_expr(n->right, -1); + OPM_Write(')'); + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, n^.subcl = ", (LONGINT)40); + OPM_LogWNum(n->subcl, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + break; + case 13: + if ((n->left->obj != NIL && n->left->obj->mode == 13)) { + if (n->left->subcl == 1) { + proc = OPV_SuperProc(n); + } else { + OPM_WriteString((CHAR*)"__", (LONGINT)3); + proc = OPC_BaseTProc(n->left->obj); + } + OPC_Ident(proc); + n->obj = proc->link; + } else if (n->left->class == 9) { + OPV_design(n->left, 10); + } else { + OPV_design(n->left, 11); + } + OPV_ActualPar(n->right, n->obj); + break; + case 20: + if (n->subcl != 32) { + OPV_IfStat(n, 0, outerProc); + } else if (OPV_assert) { + OPM_WriteString((CHAR*)"__ASSERT(", (LONGINT)10); + OPV_expr(n->left->left->left, -1); + OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteInt(n->left->right->right->conval->intval); + OPM_Write(')'); + OPC_EndStat(); + } + break; + case 21: + OPV_exit.level += 1; + OPV_CaseStat(n, outerProc); + OPV_exit.level -= 1; + break; + case 22: + OPV_exit.level += 1; + OPM_WriteString((CHAR*)"while ", (LONGINT)7); + OPV_expr(n->left, 12); + OPM_Write(' '); + OPC_BegBlk(); + OPV_stat(n->right, outerProc); + OPC_EndBlk(); + OPV_exit.level -= 1; + break; + case 23: + OPV_exit.level += 1; + OPM_WriteString((CHAR*)"do ", (LONGINT)4); + OPC_BegBlk(); + OPV_stat(n->left, outerProc); + OPC_EndBlk0(); + OPM_WriteString((CHAR*)" while (!", (LONGINT)10); + OPV_expr(n->right, 9); + OPM_Write(')'); + OPV_exit.level -= 1; + break; + case 24: + saved = OPV_exit; + OPV_exit.level = 0; + OPV_exit.label = -1; + OPM_WriteString((CHAR*)"for (;;) ", (LONGINT)10); + OPC_BegBlk(); + OPV_stat(n->left, outerProc); + OPC_EndBlk(); + if (OPV_exit.label != -1) { + OPC_BegStat(); + OPM_WriteString((CHAR*)"exit__", (LONGINT)7); + OPM_WriteInt(OPV_exit.label); + OPM_Write(':'); + OPC_EndStat(); + } + OPV_exit = saved; + break; + case 25: + if (OPV_exit.level == 0) { + OPM_WriteString((CHAR*)"break", (LONGINT)6); + } else { + if (OPV_exit.label == -1) { + OPV_exit.label = OPV_nofExitLabels; + OPV_nofExitLabels += 1; + } + OPM_WriteString((CHAR*)"goto exit__", (LONGINT)12); + OPM_WriteInt(OPV_exit.label); + } + break; + case 26: + if (OPM_level == 0) { + if (OPV_mainprog) { + OPM_WriteString((CHAR*)"__FINI", (LONGINT)7); + } else { + OPM_WriteString((CHAR*)"__ENDMOD", (LONGINT)9); + } + } else { + if (n->left != NIL) { + OPM_WriteString((CHAR*)"_o_result = ", (LONGINT)13); + if ((n->left->typ->form == 13 && n->obj->typ != n->left->typ)) { + OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + OPV_expr(n->left, 10); + } else { + OPV_expr(n->left, -1); + } + OPM_WriteString((CHAR*)";", (LONGINT)2); + OPM_WriteLn(); + OPC_BegStat(); + OPC_ExitProc(outerProc, 0, 0); + OPM_WriteString((CHAR*)"return _o_result", (LONGINT)17); + } else { + OPM_WriteString((CHAR*)"return", (LONGINT)7); + } + } + break; + case 27: + OPV_IfStat(n, n->subcl == 0, outerProc); + break; + case 28: + OPC_Halt(n->right->conval->intval); + break; + default: + OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, n^.class = ", (LONGINT)40); + OPM_LogWNum(n->class, ((LONGINT)(0))); + OPM_LogWLn(); + break; + } + if (!__IN(n->class, 0x09744000)) { + OPC_EndStat(); + } + n = n->link; + } +} + +void OPV_Module (OPT_Node prog) +{ + if (!OPV_mainprog) { + OPC_GenHdr(prog->right); + OPC_GenHdrIncludes(); + } + OPC_GenBdy(prog->right); + OPV_stat(prog, NIL); +} + +__TDESC(OPV_ExitInfo, 1, 0) = {__TDFLDS("ExitInfo", 8), {-8}}; + +export void *OPV__init(void) +{ + __DEFMOD; + __MODULE_IMPORT(OPC); + __MODULE_IMPORT(OPM); + __MODULE_IMPORT(OPS); + __MODULE_IMPORT(OPT); + __REGMOD("OPV", 0); + __REGCMD("Init", OPV_Init); + __INITYP(OPV_ExitInfo, OPV_ExitInfo, 0); +/* BEGIN */ + __ENDMOD; +} diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h new file mode 100644 index 00000000..7f0a5b8a --- /dev/null +++ b/bootstrap/windows-88/OPV.h @@ -0,0 +1,20 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ + +#ifndef OPV__h +#define OPV__h + +#define LARGE +#include "SYSTEM.h" +#include "OPT.h" + + + + +import void OPV_AdrAndSize (OPT_Object topScope); +import void OPV_Init (void); +import void OPV_Module (OPT_Node prog); +import void OPV_TypSize (OPT_Struct typ); +import void *OPV__init(void); + + +#endif diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c new file mode 100644 index 00000000..78274e99 --- /dev/null +++ b/bootstrap/windows-88/Platform.c @@ -0,0 +1,819 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +#define LARGE +#include "SYSTEM.h" + +typedef + CHAR (*Platform_ArgPtr)[1024]; + +typedef + Platform_ArgPtr (*Platform_ArgVec)[1024]; + +typedef + LONGINT (*Platform_ArgVecPtr)[1]; + +typedef + CHAR (*Platform_EnvPtr)[1024]; + +typedef + struct Platform_FileIdentity { + LONGINT volume, indexhigh, indexlow, mtimehigh, mtimelow; + } Platform_FileIdentity; + +typedef + void (*Platform_HaltProcedure)(LONGINT); + +typedef + void (*Platform_SignalHandler)(INTEGER); + + +export BOOLEAN Platform_LittleEndian; +export LONGINT Platform_MainStackFrame, Platform_HaltCode; +export INTEGER Platform_PID; +export CHAR Platform_CWD[4096]; +export INTEGER Platform_ArgCount; +export LONGINT Platform_ArgVector; +static Platform_HaltProcedure Platform_HaltHandler; +static LONGINT Platform_TimeStart; +export INTEGER Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; +export LONGINT Platform_StdIn, Platform_StdOut, Platform_StdErr; +static Platform_SignalHandler Platform_InterruptHandler; +export CHAR Platform_nl[3]; + +export LONGINT *Platform_FileIdentity__typ; + +export BOOLEAN Platform_Absent (INTEGER e); +export INTEGER Platform_ArgPos (CHAR *s, LONGINT s__len); +export void Platform_AssertFail (LONGINT code); +export INTEGER Platform_Chdir (CHAR *n, LONGINT n__len); +export INTEGER Platform_Close (LONGINT h); +export BOOLEAN Platform_ConnectionFailed (INTEGER e); +export void Platform_Delay (LONGINT ms); +export BOOLEAN Platform_DifferentFilesystems (INTEGER e); +static void Platform_DisplayHaltCode (LONGINT code); +export INTEGER Platform_Error (void); +export void Platform_Exit (INTEGER code); +export void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len); +export void Platform_GetClock (LONGINT *t, LONGINT *d); +export void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); +export void Platform_GetIntArg (INTEGER n, LONGINT *val); +export void Platform_GetTimeOfDay (LONGINT *sec, LONGINT *usec); +export void Platform_Halt (LONGINT code); +export INTEGER Platform_Identify (LONGINT h, Platform_FileIdentity *identity, LONGINT *identity__typ); +export INTEGER Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); +export BOOLEAN Platform_Inaccessible (INTEGER e); +export void Platform_Init (INTEGER argc, LONGINT argvadr); +export void Platform_MTimeAsClock (Platform_FileIdentity i, LONGINT *t, LONGINT *d); +export INTEGER Platform_New (CHAR *n, LONGINT n__len, LONGINT *h); +export BOOLEAN Platform_NoSuchDirectory (INTEGER e); +export LONGINT Platform_OSAllocate (LONGINT size); +export void Platform_OSFree (LONGINT address); +export INTEGER Platform_OldRO (CHAR *n, LONGINT n__len, LONGINT *h); +export INTEGER Platform_OldRW (CHAR *n, LONGINT n__len, LONGINT *h); +export INTEGER Platform_Read (LONGINT h, LONGINT p, LONGINT l, LONGINT *n); +export INTEGER Platform_ReadBuf (LONGINT h, SYSTEM_BYTE *b, LONGINT b__len, LONGINT *n); +export INTEGER Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); +export BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); +export BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); +export INTEGER Platform_Seek (LONGINT h, LONGINT o, INTEGER r); +export void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); +export void Platform_SetHalt (Platform_HaltProcedure p); +export void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Platform_FileIdentity source); +export INTEGER Platform_Size (LONGINT h, LONGINT *l); +export INTEGER Platform_Sync (LONGINT h); +export INTEGER Platform_System (CHAR *cmd, LONGINT cmd__len); +static void Platform_TestLittleEndian (void); +export LONGINT Platform_Time (void); +export BOOLEAN Platform_TimedOut (INTEGER e); +export BOOLEAN Platform_TooManyFiles (INTEGER e); +export INTEGER Platform_Truncate (LONGINT h, LONGINT limit); +export INTEGER Platform_Unlink (CHAR *n, LONGINT n__len); +export INTEGER Platform_Write (LONGINT h, LONGINT p, LONGINT l); +static void Platform_YMDHMStoClock (INTEGER ye, INTEGER mo, INTEGER da, INTEGER ho, INTEGER mi, INTEGER se, LONGINT *t, LONGINT *d); +static void Platform_errch (CHAR c); +static void Platform_errint (LONGINT l); +static void Platform_errln (void); +static void Platform_errposint (LONGINT l); +export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); + +#include "WindowsWrapper.h" +#define Platform_ECONNABORTED() WSAECONNABORTED +#define Platform_ECONNREFUSED() WSAECONNREFUSED +#define Platform_EHOSTUNREACH() WSAEHOSTUNREACH +#define Platform_ENETUNREACH() WSAENETUNREACH +#define Platform_ERRORACCESSDENIED() ERROR_ACCESS_DENIED +#define Platform_ERRORFILENOTFOUND() ERROR_FILE_NOT_FOUND +#define Platform_ERRORNOTREADY() ERROR_NOT_READY +#define Platform_ERRORNOTSAMEDEVICE() ERROR_NOT_SAME_DEVICE +#define Platform_ERRORPATHNOTFOUND() ERROR_PATH_NOT_FOUND +#define Platform_ERRORSHARINGVIOLATION() ERROR_SHARING_VIOLATION +#define Platform_ERRORTOOMANYOPENFILES() ERROR_TOO_MANY_OPEN_FILES +#define Platform_ERRORWRITEPROTECT() ERROR_WRITE_PROTECT +#define Platform_ETIMEDOUT() WSAETIMEDOUT +extern void Heap_InitHeap(); +#define Platform_GetTickCount() (LONGINT)(uint32_t)GetTickCount() +#define Platform_HeapInitHeap() Heap_InitHeap() +#define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((uintptr_t)h) +#define Platform_SetQuitHandler(h) SystemSetQuitHandler((uintptr_t)h) +#define Platform_allocate(size) (LONGINT)(uintptr_t)((void*)HeapAlloc(GetProcessHeap(), 0, (size_t)size)) +#define Platform_bhfiIndexHigh() (LONGINT)bhfi.nFileIndexHigh +#define Platform_bhfiIndexLow() (LONGINT)bhfi.nFileIndexLow +#define Platform_bhfiMtimeHigh() (LONGINT)bhfi.ftLastWriteTime.dwHighDateTime +#define Platform_bhfiMtimeLow() (LONGINT)bhfi.ftLastWriteTime.dwLowDateTime +#define Platform_bhfiVsn() (LONGINT)bhfi.dwVolumeSerialNumber +#define Platform_byHandleFileInformation() BY_HANDLE_FILE_INFORMATION bhfi +#define Platform_cleanupProcess() CloseHandle(pi.hProcess); CloseHandle(pi.hThread); +#define Platform_closeHandle(h) (INTEGER)CloseHandle((HANDLE)(uintptr_t)h) +#define Platform_createProcess(str, str__len) (INTEGER)CreateProcess(0, (char*)str, 0,0,0,0,0,0,&si,&pi) +#define Platform_deleteFile(n, n__len) (INTEGER)DeleteFile((char*)n) +#define Platform_err() (INTEGER)GetLastError() +#define Platform_errc(c) WriteFile((HANDLE)(uintptr_t)Platform_StdOut, &c, 1, 0,0) +#define Platform_errstring(s, s__len) WriteFile((HANDLE)(uintptr_t)Platform_StdOut, s, s__len-1, 0,0) +#define Platform_exit(code) ExitProcess((UINT)code) +#define Platform_fileTimeToSysTime() SYSTEMTIME st; FileTimeToSystemTime(&ft, &st) +#define Platform_flushFileBuffers(h) (INTEGER)FlushFileBuffers((HANDLE)(uintptr_t)h) +#define Platform_free(address) HeapFree(GetProcessHeap(), 0, (void*)(uintptr_t)address) +#define Platform_getCurrentDirectory(n, n__len) GetCurrentDirectory(n__len, (char*)n) +#define Platform_getExitCodeProcess(exitcode) GetExitCodeProcess(pi.hProcess, (DWORD*)exitcode); +#define Platform_getFileInformationByHandle(h) (INTEGER)GetFileInformationByHandle((HANDLE)(uintptr_t)h, &bhfi) +#define Platform_getFilePos(h, r, rc) LARGE_INTEGER liz = {0}; *rc = (INTEGER)SetFilePointerEx((HANDLE)(uintptr_t)h, liz, &li, FILE_CURRENT); *r = (LONGINT)li.QuadPart +#define Platform_getFileSize(h) (INTEGER)GetFileSizeEx((HANDLE)(uintptr_t)h, &li) +#define Platform_getLocalTime() SYSTEMTIME st; GetLocalTime(&st) +#define Platform_getenv(name, name__len, buf, buf__len) (INTEGER)GetEnvironmentVariable((char*)name, (char*)buf, buf__len) +#define Platform_getpid() (INTEGER)GetCurrentProcessId() +#define Platform_getstderrhandle() (uintptr_t)GetStdHandle(STD_ERROR_HANDLE) +#define Platform_getstdinhandle() (uintptr_t)GetStdHandle(STD_INPUT_HANDLE) +#define Platform_getstdouthandle() (uintptr_t)GetStdHandle(STD_OUTPUT_HANDLE) +#define Platform_identityToFileTime(i) FILETIME ft; ft.dwHighDateTime = i.mtimehigh; ft.dwLowDateTime = i.mtimelow +#define Platform_invalidHandleValue() ((LONGINT)(uintptr_t)INVALID_HANDLE_VALUE) +#define Platform_largeInteger() LARGE_INTEGER li +#define Platform_liLongint() (LONGINT)li.QuadPart +#define Platform_moveFile(o, o__len, n, n__len) (INTEGER)MoveFileEx((char*)o, (char*)n, MOVEFILE_REPLACE_EXISTING) +#define Platform_opennew(n, n__len) (LONGINT)(uintptr_t)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0) +#define Platform_openro(n, n__len) (LONGINT)(uintptr_t)CreateFile((char*)n, GENERIC_READ , FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) +#define Platform_openrw(n, n__len) (LONGINT)(uintptr_t)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) +#define Platform_processInfo() PROCESS_INFORMATION pi = {0}; +#define Platform_readfile(fd, p, l, n) (INTEGER)ReadFile ((HANDLE)(uintptr_t)fd, (void*)(uintptr_t)(p), (DWORD)l, (DWORD*)n, 0) +#define Platform_seekcur() FILE_CURRENT +#define Platform_seekend() FILE_END +#define Platform_seekset() FILE_BEGIN +#define Platform_setCurrentDirectory(n, n__len) (INTEGER)SetCurrentDirectory((char*)n) +#define Platform_setEndOfFile(h) (INTEGER)SetEndOfFile((HANDLE)(uintptr_t)h) +#define Platform_setFilePointerEx(h, o, r, rc) li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((HANDLE)(uintptr_t)h, li, 0, (DWORD)r) +#define Platform_sleep(ms) Sleep((DWORD)ms) +#define Platform_startupInfo() STARTUPINFO si = {0}; si.cb = sizeof(si); +#define Platform_sthour() (INTEGER)st.wHour +#define Platform_stmday() (INTEGER)st.wDay +#define Platform_stmin() (INTEGER)st.wMinute +#define Platform_stmon() (INTEGER)st.wMonth +#define Platform_stmsec() (INTEGER)st.wMilliseconds +#define Platform_stsec() (INTEGER)st.wSecond +#define Platform_styear() (INTEGER)st.wYear +#define Platform_waitForProcess() (INTEGER)WaitForSingleObject(pi.hProcess, INFINITE) +#define Platform_writefile(fd, p, l) (INTEGER)WriteFile((HANDLE)(uintptr_t)fd, (void*)(uintptr_t)(p), (DWORD)l, 0,0) + +BOOLEAN Platform_TooManyFiles (INTEGER e) +{ + BOOLEAN _o_result; + _o_result = e == Platform_ERRORTOOMANYOPENFILES(); + return _o_result; +} + +BOOLEAN Platform_NoSuchDirectory (INTEGER e) +{ + BOOLEAN _o_result; + _o_result = e == Platform_ERRORPATHNOTFOUND(); + return _o_result; +} + +BOOLEAN Platform_DifferentFilesystems (INTEGER e) +{ + BOOLEAN _o_result; + _o_result = e == Platform_ERRORNOTSAMEDEVICE(); + return _o_result; +} + +BOOLEAN Platform_Inaccessible (INTEGER e) +{ + BOOLEAN _o_result; + _o_result = ((e == Platform_ERRORACCESSDENIED() || e == Platform_ERRORWRITEPROTECT()) || e == Platform_ERRORNOTREADY()) || e == Platform_ERRORSHARINGVIOLATION(); + return _o_result; +} + +BOOLEAN Platform_Absent (INTEGER e) +{ + BOOLEAN _o_result; + _o_result = e == Platform_ERRORFILENOTFOUND() || e == Platform_ERRORPATHNOTFOUND(); + return _o_result; +} + +BOOLEAN Platform_TimedOut (INTEGER e) +{ + BOOLEAN _o_result; + _o_result = e == Platform_ETIMEDOUT(); + return _o_result; +} + +BOOLEAN Platform_ConnectionFailed (INTEGER e) +{ + BOOLEAN _o_result; + _o_result = ((e == Platform_ECONNREFUSED() || e == Platform_ECONNABORTED()) || e == Platform_ENETUNREACH()) || e == Platform_EHOSTUNREACH(); + return _o_result; +} + +LONGINT Platform_OSAllocate (LONGINT size) +{ + LONGINT _o_result; + _o_result = Platform_allocate(size); + return _o_result; +} + +void Platform_OSFree (LONGINT address) +{ + Platform_free(address); +} + +void Platform_Init (INTEGER argc, LONGINT argvadr) +{ + Platform_ArgVecPtr av = NIL; + Platform_MainStackFrame = argvadr; + Platform_ArgCount = argc; + av = (Platform_ArgVecPtr)(uintptr_t)argvadr; + Platform_ArgVector = (*av)[0]; + Platform_HaltCode = -128; + Platform_HeapInitHeap(); +} + +BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len) +{ + BOOLEAN _o_result; + CHAR buf[4096]; + INTEGER res; + __DUP(var, var__len, CHAR); + res = Platform_getenv(var, var__len, (void*)buf, ((LONGINT)(4096))); + if ((res > 0 && res < 4096)) { + __COPY(buf, val, val__len); + _o_result = 1; + __DEL(var); + return _o_result; + } else { + _o_result = 0; + __DEL(var); + return _o_result; + } + __RETCHK; +} + +void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len) +{ + __DUP(var, var__len, CHAR); + if (!Platform_getEnv(var, var__len, (void*)val, val__len)) { + val[0] = 0x00; + } + __DEL(var); +} + +void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len) +{ + Platform_ArgVec av = NIL; + if (n < Platform_ArgCount) { + av = (Platform_ArgVec)(uintptr_t)Platform_ArgVector; + __COPY(*(*av)[__X(n, ((LONGINT)(1024)))], val, val__len); + } +} + +void Platform_GetIntArg (INTEGER n, LONGINT *val) +{ + CHAR s[64]; + LONGINT k, d, i; + s[0] = 0x00; + Platform_GetArg(n, (void*)s, ((LONGINT)(64))); + i = 0; + if (s[0] == '-') { + i = 1; + } + k = 0; + d = (int)s[__X(i, ((LONGINT)(64)))] - 48; + while ((d >= 0 && d <= 9)) { + k = k * 10 + d; + i += 1; + d = (int)s[__X(i, ((LONGINT)(64)))] - 48; + } + if (s[0] == '-') { + k = -k; + i -= 1; + } + if (i > 0) { + *val = k; + } +} + +INTEGER Platform_ArgPos (CHAR *s, LONGINT s__len) +{ + INTEGER _o_result; + INTEGER i; + CHAR arg[256]; + __DUP(s, s__len, CHAR); + i = 0; + Platform_GetArg(i, (void*)arg, ((LONGINT)(256))); + while ((i < Platform_ArgCount && __STRCMP(s, arg) != 0)) { + i += 1; + Platform_GetArg(i, (void*)arg, ((LONGINT)(256))); + } + _o_result = i; + __DEL(s); + return _o_result; +} + +void Platform_SetBadInstructionHandler (Platform_SignalHandler handler) +{ +} + +static void Platform_YMDHMStoClock (INTEGER ye, INTEGER mo, INTEGER da, INTEGER ho, INTEGER mi, INTEGER se, LONGINT *t, LONGINT *d) +{ + *d = (__ASHL((LONGINT)(int)__MOD(ye, 100), 9) + __ASHL((LONGINT)(mo + 1), 5)) + (LONGINT)da; + *t = (__ASHL((LONGINT)ho, 12) + __ASHL((LONGINT)mi, 6)) + (LONGINT)se; +} + +void Platform_GetClock (LONGINT *t, LONGINT *d) +{ + Platform_getLocalTime(); + Platform_YMDHMStoClock(Platform_styear(), Platform_stmon(), Platform_stmday(), Platform_sthour(), Platform_stmin(), Platform_stsec(), &*t, &*d); +} + +void Platform_GetTimeOfDay (LONGINT *sec, LONGINT *usec) +{ + Platform_getLocalTime(); + *sec = Platform_stsec(); + *usec = (LONGINT)Platform_stmsec() * 1000; +} + +LONGINT Platform_Time (void) +{ + LONGINT _o_result; + LONGINT ms; + ms = Platform_GetTickCount(); + _o_result = __MOD(ms - Platform_TimeStart, 2147483647); + return _o_result; +} + +void Platform_Delay (LONGINT ms) +{ + while (ms > 30000) { + Platform_sleep(((LONGINT)(30000))); + ms = ms - 30000; + } + if (ms > 0) { + Platform_sleep(ms); + } +} + +INTEGER Platform_System (CHAR *cmd, LONGINT cmd__len) +{ + INTEGER _o_result; + INTEGER result; + __DUP(cmd, cmd__len, CHAR); + result = 127; + Platform_startupInfo(); + Platform_processInfo(); + if (Platform_createProcess(cmd, cmd__len) != 0) { + if (Platform_waitForProcess() == 0) { + Platform_getExitCodeProcess(&result); + } + Platform_cleanupProcess(); + } + _o_result = __ASHL(result, 8); + __DEL(cmd); + return _o_result; +} + +INTEGER Platform_Error (void) +{ + INTEGER _o_result; + _o_result = Platform_err(); + return _o_result; +} + +INTEGER Platform_OldRO (CHAR *n, LONGINT n__len, LONGINT *h) +{ + INTEGER _o_result; + LONGINT fd; + fd = Platform_openro(n, n__len); + if (fd == Platform_invalidHandleValue()) { + _o_result = Platform_err(); + return _o_result; + } else { + *h = fd; + _o_result = 0; + return _o_result; + } + __RETCHK; +} + +INTEGER Platform_OldRW (CHAR *n, LONGINT n__len, LONGINT *h) +{ + INTEGER _o_result; + LONGINT fd; + fd = Platform_openrw(n, n__len); + if (fd == Platform_invalidHandleValue()) { + _o_result = Platform_err(); + return _o_result; + } else { + *h = fd; + _o_result = 0; + return _o_result; + } + __RETCHK; +} + +INTEGER Platform_New (CHAR *n, LONGINT n__len, LONGINT *h) +{ + INTEGER _o_result; + LONGINT fd; + fd = Platform_opennew(n, n__len); + if (fd == Platform_invalidHandleValue()) { + _o_result = Platform_err(); + return _o_result; + } else { + *h = fd; + _o_result = 0; + return _o_result; + } + __RETCHK; +} + +INTEGER Platform_Close (LONGINT h) +{ + INTEGER _o_result; + if (Platform_closeHandle(h) == 0) { + _o_result = Platform_err(); + return _o_result; + } else { + _o_result = 0; + return _o_result; + } + __RETCHK; +} + +INTEGER Platform_Identify (LONGINT h, Platform_FileIdentity *identity, LONGINT *identity__typ) +{ + INTEGER _o_result; + Platform_byHandleFileInformation(); + if (Platform_getFileInformationByHandle(h) == 0) { + _o_result = Platform_err(); + return _o_result; + } + (*identity).volume = Platform_bhfiVsn(); + (*identity).indexhigh = Platform_bhfiIndexHigh(); + (*identity).indexlow = Platform_bhfiIndexLow(); + (*identity).mtimehigh = Platform_bhfiMtimeHigh(); + (*identity).mtimelow = Platform_bhfiMtimeLow(); + _o_result = 0; + return _o_result; +} + +INTEGER Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ) +{ + INTEGER _o_result; + LONGINT h; + INTEGER e, i; + __DUP(n, n__len, CHAR); + e = Platform_OldRO((void*)n, n__len, &h); + if (e != 0) { + _o_result = e; + __DEL(n); + return _o_result; + } + e = Platform_Identify(h, &*identity, identity__typ); + i = Platform_Close(h); + _o_result = e; + __DEL(n); + return _o_result; +} + +BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2) +{ + BOOLEAN _o_result; + _o_result = (((i1.indexhigh == i2.indexhigh && i1.indexlow == i2.indexlow)) && i1.volume == i2.volume); + return _o_result; +} + +BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2) +{ + BOOLEAN _o_result; + _o_result = (i1.mtimehigh == i2.mtimehigh && i1.mtimelow == i2.mtimelow); + return _o_result; +} + +void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Platform_FileIdentity source) +{ + (*target).mtimehigh = source.mtimehigh; + (*target).mtimelow = source.mtimelow; +} + +void Platform_MTimeAsClock (Platform_FileIdentity i, LONGINT *t, LONGINT *d) +{ + Platform_identityToFileTime(i); + Platform_fileTimeToSysTime(); + Platform_YMDHMStoClock(Platform_styear(), Platform_stmon(), Platform_stmday(), Platform_sthour(), Platform_stmin(), Platform_stsec(), &*t, &*d); +} + +INTEGER Platform_Size (LONGINT h, LONGINT *l) +{ + INTEGER _o_result; + Platform_largeInteger(); + if (Platform_getFileSize(h) == 0) { + _o_result = Platform_err(); + return _o_result; + } + *l = Platform_liLongint(); + _o_result = 0; + return _o_result; +} + +INTEGER Platform_Read (LONGINT h, LONGINT p, LONGINT l, LONGINT *n) +{ + INTEGER _o_result; + INTEGER result; + *n = 0; + result = Platform_readfile(h, p, l, &*n); + if (result == 0) { + *n = 0; + _o_result = Platform_err(); + return _o_result; + } else { + _o_result = 0; + return _o_result; + } + __RETCHK; +} + +INTEGER Platform_ReadBuf (LONGINT h, SYSTEM_BYTE *b, LONGINT b__len, LONGINT *n) +{ + INTEGER _o_result; + INTEGER result; + *n = 0; + result = Platform_readfile(h, (LONGINT)(uintptr_t)b, b__len, &*n); + if (result == 0) { + *n = 0; + _o_result = Platform_err(); + return _o_result; + } else { + _o_result = 0; + return _o_result; + } + __RETCHK; +} + +INTEGER Platform_Write (LONGINT h, LONGINT p, LONGINT l) +{ + INTEGER _o_result; + if (Platform_writefile(h, p, l) == 0) { + _o_result = Platform_err(); + return _o_result; + } else { + _o_result = 0; + return _o_result; + } + __RETCHK; +} + +INTEGER Platform_Sync (LONGINT h) +{ + INTEGER _o_result; + if (Platform_flushFileBuffers(h) == 0) { + _o_result = Platform_err(); + return _o_result; + } else { + _o_result = 0; + return _o_result; + } + __RETCHK; +} + +INTEGER Platform_Seek (LONGINT h, LONGINT o, INTEGER r) +{ + INTEGER _o_result; + INTEGER rc; + Platform_largeInteger(); + Platform_setFilePointerEx(h, o, r, &rc); + if (rc == 0) { + _o_result = Platform_err(); + return _o_result; + } else { + _o_result = 0; + return _o_result; + } + __RETCHK; +} + +INTEGER Platform_Truncate (LONGINT h, LONGINT limit) +{ + INTEGER _o_result; + INTEGER rc; + LONGINT oldpos; + Platform_largeInteger(); + Platform_getFilePos(h, &oldpos, &rc); + if (rc == 0) { + _o_result = Platform_err(); + return _o_result; + } + Platform_setFilePointerEx(h, limit, Platform_seekset(), &rc); + if (rc == 0) { + _o_result = Platform_err(); + return _o_result; + } + if (Platform_setEndOfFile(h) == 0) { + _o_result = Platform_err(); + return _o_result; + } + Platform_setFilePointerEx(h, oldpos, Platform_seekset(), &rc); + if (rc == 0) { + _o_result = Platform_err(); + return _o_result; + } + _o_result = 0; + return _o_result; +} + +INTEGER Platform_Unlink (CHAR *n, LONGINT n__len) +{ + INTEGER _o_result; + if (Platform_deleteFile(n, n__len) == 0) { + _o_result = Platform_err(); + return _o_result; + } else { + _o_result = 0; + return _o_result; + } + __RETCHK; +} + +INTEGER Platform_Chdir (CHAR *n, LONGINT n__len) +{ + INTEGER _o_result; + INTEGER r; + r = Platform_setCurrentDirectory(n, n__len); + if (r == 0) { + _o_result = Platform_err(); + return _o_result; + } + Platform_getCurrentDirectory((void*)Platform_CWD, ((LONGINT)(4096))); + _o_result = 0; + return _o_result; +} + +INTEGER Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) +{ + INTEGER _o_result; + if (Platform_moveFile(o, o__len, n, n__len) == 0) { + _o_result = Platform_err(); + return _o_result; + } else { + _o_result = 0; + return _o_result; + } + __RETCHK; +} + +void Platform_Exit (INTEGER code) +{ + Platform_exit(code); +} + +static void Platform_errch (CHAR c) +{ + Platform_errc(c); +} + +static void Platform_errln (void) +{ + Platform_errch(0x0d); + Platform_errch(0x0a); +} + +static void Platform_errposint (LONGINT l) +{ + if (l > 10) { + Platform_errposint(__DIV(l, 10)); + } + Platform_errch((CHAR)(48 + __MOD(l, 10))); +} + +static void Platform_errint (LONGINT l) +{ + if (l < 0) { + Platform_errch('-'); + l = -l; + } + Platform_errposint(l); +} + +static void Platform_DisplayHaltCode (LONGINT code) +{ + switch (code) { + case -1: + Platform_errstring((CHAR*)"Rider ReadBuf/WriteBuf transfer size longer than buffer.", (LONGINT)57); + break; + case -2: + Platform_errstring((CHAR*)"Index out of range.", (LONGINT)20); + break; + case -3: + Platform_errstring((CHAR*)"Reached end of function without reaching RETURN.", (LONGINT)49); + break; + case -4: + Platform_errstring((CHAR*)"CASE statement: no matching label and no ELSE.", (LONGINT)47); + break; + case -5: + Platform_errstring((CHAR*)"Type guard failed.", (LONGINT)19); + break; + case -6: + Platform_errstring((CHAR*)"Type equality failed.", (LONGINT)22); + break; + case -7: + Platform_errstring((CHAR*)"WITH statement type guard failed.", (LONGINT)34); + break; + case -8: + Platform_errstring((CHAR*)"SHORT: Value too large for shorter type.", (LONGINT)41); + break; + case -9: + Platform_errstring((CHAR*)"Heap interrupted while locked, but lockdepth = 0 at unlock.", (LONGINT)60); + break; + case -15: + Platform_errstring((CHAR*)"Type descriptor size mismatch.", (LONGINT)31); + break; + case -20: + Platform_errstring((CHAR*)"Too many, or negative number of, elements in dynamic array.", (LONGINT)60); + break; + default: + break; + } +} + +void Platform_Halt (LONGINT code) +{ + INTEGER e; + Platform_HaltCode = code; + if (Platform_HaltHandler != NIL) { + (*Platform_HaltHandler)(code); + } + Platform_errstring((CHAR*)"Terminated by Halt(", (LONGINT)20); + Platform_errint(code); + Platform_errstring((CHAR*)"). ", (LONGINT)4); + if (code < 0) { + Platform_DisplayHaltCode(code); + } + Platform_errln(); + Platform_exit(__VAL(INTEGER, code)); +} + +void Platform_AssertFail (LONGINT code) +{ + INTEGER e; + Platform_errstring((CHAR*)"Assertion failure.", (LONGINT)19); + if (code != 0) { + Platform_errstring((CHAR*)" ASSERT code ", (LONGINT)14); + Platform_errint(code); + Platform_errstring((CHAR*)".", (LONGINT)2); + } + Platform_errln(); + Platform_exit(__VAL(INTEGER, code)); +} + +void Platform_SetHalt (Platform_HaltProcedure p) +{ + Platform_HaltHandler = p; +} + +static void Platform_TestLittleEndian (void) +{ + INTEGER i; + i = 1; + __GET((LONGINT)(uintptr_t)&i, Platform_LittleEndian, BOOLEAN); +} + +__TDESC(Platform_FileIdentity, 1, 0) = {__TDFLDS("FileIdentity", 40), {-8}}; + +export void *Platform__init(void) +{ + __DEFMOD; + __REGMOD("Platform", 0); + __INITYP(Platform_FileIdentity, Platform_FileIdentity, 0); +/* BEGIN */ + Platform_TestLittleEndian(); + Platform_HaltCode = -128; + Platform_HaltHandler = NIL; + Platform_TimeStart = Platform_Time(); + Platform_CWD[0] = 0x00; + Platform_getCurrentDirectory((void*)Platform_CWD, ((LONGINT)(4096))); + Platform_PID = Platform_getpid(); + Platform_SeekSet = Platform_seekset(); + Platform_SeekCur = Platform_seekcur(); + Platform_SeekEnd = Platform_seekend(); + Platform_StdIn = Platform_getstdinhandle(); + Platform_StdOut = Platform_getstdouthandle(); + Platform_StdErr = Platform_getstderrhandle(); + Platform_nl[0] = 0x0d; + Platform_nl[1] = 0x0a; + Platform_nl[2] = 0x00; + __ENDMOD; +} diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h new file mode 100644 index 00000000..c3b2dd2d --- /dev/null +++ b/bootstrap/windows-88/Platform.h @@ -0,0 +1,85 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ + +#ifndef Platform__h +#define Platform__h + +#define LARGE +#include "SYSTEM.h" + +typedef + struct Platform_FileIdentity { + LONGINT _prvt0; + char _prvt1[32]; + } Platform_FileIdentity; + +typedef + void (*Platform_HaltProcedure)(LONGINT); + +typedef + void (*Platform_SignalHandler)(INTEGER); + + +import BOOLEAN Platform_LittleEndian; +import LONGINT Platform_MainStackFrame, Platform_HaltCode; +import INTEGER Platform_PID; +import CHAR Platform_CWD[4096]; +import INTEGER Platform_ArgCount; +import LONGINT Platform_ArgVector; +import INTEGER Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; +import LONGINT Platform_StdIn, Platform_StdOut, Platform_StdErr; +import CHAR Platform_nl[3]; + +import LONGINT *Platform_FileIdentity__typ; + +import BOOLEAN Platform_Absent (INTEGER e); +import INTEGER Platform_ArgPos (CHAR *s, LONGINT s__len); +import void Platform_AssertFail (LONGINT code); +import INTEGER Platform_Chdir (CHAR *n, LONGINT n__len); +import INTEGER Platform_Close (LONGINT h); +import BOOLEAN Platform_ConnectionFailed (INTEGER e); +import void Platform_Delay (LONGINT ms); +import BOOLEAN Platform_DifferentFilesystems (INTEGER e); +import INTEGER Platform_Error (void); +import void Platform_Exit (INTEGER code); +import void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len); +import void Platform_GetClock (LONGINT *t, LONGINT *d); +import void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); +import void Platform_GetIntArg (INTEGER n, LONGINT *val); +import void Platform_GetTimeOfDay (LONGINT *sec, LONGINT *usec); +import void Platform_Halt (LONGINT code); +import INTEGER Platform_Identify (LONGINT h, Platform_FileIdentity *identity, LONGINT *identity__typ); +import INTEGER Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); +import BOOLEAN Platform_Inaccessible (INTEGER e); +import void Platform_Init (INTEGER argc, LONGINT argvadr); +import void Platform_MTimeAsClock (Platform_FileIdentity i, LONGINT *t, LONGINT *d); +import INTEGER Platform_New (CHAR *n, LONGINT n__len, LONGINT *h); +import BOOLEAN Platform_NoSuchDirectory (INTEGER e); +import LONGINT Platform_OSAllocate (LONGINT size); +import void Platform_OSFree (LONGINT address); +import INTEGER Platform_OldRO (CHAR *n, LONGINT n__len, LONGINT *h); +import INTEGER Platform_OldRW (CHAR *n, LONGINT n__len, LONGINT *h); +import INTEGER Platform_Read (LONGINT h, LONGINT p, LONGINT l, LONGINT *n); +import INTEGER Platform_ReadBuf (LONGINT h, SYSTEM_BYTE *b, LONGINT b__len, LONGINT *n); +import INTEGER Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); +import BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); +import BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); +import INTEGER Platform_Seek (LONGINT h, LONGINT o, INTEGER r); +import void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); +import void Platform_SetHalt (Platform_HaltProcedure p); +import void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Platform_FileIdentity source); +import INTEGER Platform_Size (LONGINT h, LONGINT *l); +import INTEGER Platform_Sync (LONGINT h); +import INTEGER Platform_System (CHAR *cmd, LONGINT cmd__len); +import LONGINT Platform_Time (void); +import BOOLEAN Platform_TimedOut (INTEGER e); +import BOOLEAN Platform_TooManyFiles (INTEGER e); +import INTEGER Platform_Truncate (LONGINT h, LONGINT limit); +import INTEGER Platform_Unlink (CHAR *n, LONGINT n__len); +import INTEGER Platform_Write (LONGINT h, LONGINT p, LONGINT l); +import BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); +import void *Platform__init(void); + +#define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((uintptr_t)h) +#define Platform_SetQuitHandler(h) SystemSetQuitHandler((uintptr_t)h) + +#endif diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c new file mode 100644 index 00000000..edf27d40 --- /dev/null +++ b/bootstrap/windows-88/Reals.c @@ -0,0 +1,143 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +#define LARGE +#include "SYSTEM.h" + + + + +export void Reals_Convert (REAL x, INTEGER n, CHAR *d, LONGINT d__len); +export void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len); +export void Reals_ConvertHL (LONGREAL y, CHAR *d, LONGINT d__len); +export void Reals_ConvertL (LONGREAL x, INTEGER n, CHAR *d, LONGINT d__len); +export INTEGER Reals_Expo (REAL x); +export INTEGER Reals_ExpoL (LONGREAL x); +export REAL Reals_Ten (INTEGER e); +export LONGREAL Reals_TenL (INTEGER e); +static CHAR Reals_ToHex (INTEGER i); + + +REAL Reals_Ten (INTEGER e) +{ + REAL _o_result; + LONGREAL r, power; + r = (LONGREAL)1; + power = (LONGREAL)10; + while (e > 0) { + if (__ODD(e)) { + r = r * power; + } + power = power * power; + e = __ASHR(e, 1); + } + _o_result = r; + return _o_result; +} + +LONGREAL Reals_TenL (INTEGER e) +{ + LONGREAL _o_result; + LONGREAL r, power; + r = (LONGREAL)1; + power = (LONGREAL)10; + for (;;) { + if (__ODD(e)) { + r = r * power; + } + e = __ASHR(e, 1); + if (e <= 0) { + _o_result = r; + return _o_result; + } + power = power * power; + } + __RETCHK; +} + +INTEGER Reals_Expo (REAL x) +{ + INTEGER _o_result; + _o_result = (int)__MASK(__ASHR((LONGINT)(__VAL(INTEGER, x)), 23), -256); + return _o_result; +} + +INTEGER Reals_ExpoL (LONGREAL x) +{ + INTEGER _o_result; + INTEGER i; + LONGINT l; + __GET((LONGINT)(uintptr_t)&x + 4, i, INTEGER); + _o_result = (int)__MASK(__ASHR((LONGINT)i, 20), -2048); + return _o_result; +} + +void Reals_ConvertL (LONGREAL x, INTEGER n, CHAR *d, LONGINT d__len) +{ + LONGINT i, j, k; + if (x < (LONGREAL)0) { + x = -x; + } + k = 0; + i = __ENTIER(x); + while (k < (LONGINT)n) { + d[__X(k, d__len)] = (CHAR)(__MOD(i, 10) + 48); + i = __DIV(i, 10); + k += 1; + } +} + +void Reals_Convert (REAL x, INTEGER n, CHAR *d, LONGINT d__len) +{ + Reals_ConvertL(x, n, (void*)d, d__len); +} + +static CHAR Reals_ToHex (INTEGER i) +{ + CHAR _o_result; + if (i < 10) { + _o_result = (CHAR)(i + 48); + return _o_result; + } else { + _o_result = (CHAR)(i + 55); + return _o_result; + } + __RETCHK; +} + +typedef + CHAR (*pc4__3)[4]; + +void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len) +{ + pc4__3 p = NIL; + INTEGER i; + p = (pc4__3)(uintptr_t)((LONGINT)(uintptr_t)&y); + i = 0; + while (i < 4) { + d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((int)(*p)[__X(i, ((LONGINT)(4)))], 4)); + d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((int)(*p)[__X(i, ((LONGINT)(4)))], -16)); + } +} + +typedef + CHAR (*pc8__5)[8]; + +void Reals_ConvertHL (LONGREAL y, CHAR *d, LONGINT d__len) +{ + pc8__5 p = NIL; + INTEGER i; + p = (pc8__5)(uintptr_t)((LONGINT)(uintptr_t)&y); + i = 0; + while (i < 8) { + d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((int)(*p)[__X(i, ((LONGINT)(8)))], 4)); + d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((int)(*p)[__X(i, ((LONGINT)(8)))], -16)); + } +} + + +export void *Reals__init(void) +{ + __DEFMOD; + __REGMOD("Reals", 0); +/* BEGIN */ + __ENDMOD; +} diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h new file mode 100644 index 00000000..5febc0f1 --- /dev/null +++ b/bootstrap/windows-88/Reals.h @@ -0,0 +1,23 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ + +#ifndef Reals__h +#define Reals__h + +#define LARGE +#include "SYSTEM.h" + + + + +import void Reals_Convert (REAL x, INTEGER n, CHAR *d, LONGINT d__len); +import void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len); +import void Reals_ConvertHL (LONGREAL y, CHAR *d, LONGINT d__len); +import void Reals_ConvertL (LONGREAL x, INTEGER n, CHAR *d, LONGINT d__len); +import INTEGER Reals_Expo (REAL x); +import INTEGER Reals_ExpoL (LONGREAL x); +import REAL Reals_Ten (INTEGER e); +import LONGREAL Reals_TenL (INTEGER e); +import void *Reals__init(void); + + +#endif diff --git a/bootstrap/windows-88/SYSTEM.c b/bootstrap/windows-88/SYSTEM.c new file mode 100644 index 00000000..0fcc5ee2 --- /dev/null +++ b/bootstrap/windows-88/SYSTEM.c @@ -0,0 +1,207 @@ +/* +* The body prefix file of the voc(jet backend) runtime system, Version 1.0 +* +* Copyright (c) Software Templ, 1994, 1995 +* +* Module SYSTEM is subject to change any time without prior notification. +* Software Templ disclaims all warranties with regard to module SYSTEM, +* in particular shall Software Templ not be liable for any damage resulting +* from inappropriate use or modification of module SYSTEM. +* +* Version 1.1 jt, 24.11.95 fixes for correct pointer arithmetic on Cray computers +* jt 31.1.2007 ANSI prototypes for malloc and exit in order to avoid cc warnings +* +*/ + +#include "SYSTEM.h" +#include "stdarg.h" +#include + + +LONGINT SYSTEM_XCHK(LONGINT i, LONGINT ub) {return __X(i, ub);} +LONGINT SYSTEM_RCHK(LONGINT i, LONGINT ub) {return __R(i, ub);} +LONGINT SYSTEM_ASH (LONGINT i, LONGINT n) {return __ASH(i, n);} +LONGINT SYSTEM_ABS (LONGINT i) {return __ABS(i);} +double SYSTEM_ABSD(double i) {return __ABS(i);} + +void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0) +{ + t -= __TPROC0OFF; + t0 -= __TPROC0OFF; + while (*t0 != __EOM) {*t = *t0; t--; t0--;} +} + + +void SYSTEM_ENUMP(void *adr, LONGINT n, void (*P)()) +{ + while (n > 0) { + P((LONGINT)(uintptr_t)(*((void**)(adr)))); + adr = ((void**)adr) + 1; + n--; + } +} + +void SYSTEM_ENUMR(void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()) +{ + LONGINT *t, off; + typ++; + while (n > 0) { + t = typ; + off = *t; + while (off >= 0) {P(*(LONGINT*)((char*)adr+off)); t++; off = *t;} + adr = ((char*)adr) + size; + n--; + } +} + +LONGINT SYSTEM_DIV(unsigned LONGINT x, unsigned LONGINT y) +{ if ((LONGINT) x >= 0) return (x / y); + else return -((y - 1 - x) / y); +} + +LONGINT SYSTEM_MOD(unsigned LONGINT x, unsigned LONGINT y) +{ unsigned LONGINT m; + if ((LONGINT) x >= 0) return (x % y); + else { m = (-x) % y; + if (m != 0) return (y - m); else return 0; + } +} + +LONGINT SYSTEM_ENTIER(double x) +{ + LONGINT y; + if (x >= 0) + return (LONGINT)x; + else { + y = (LONGINT)x; + if (y <= x) return y; else return y - 1; + } +} + +extern void Heap_Lock(); +extern void Heap_Unlock(); + +SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, int nofdyn, ...) +{ + LONGINT nofelems, size, dataoff, n, nptr, *x, *p, nofptrs, i, *ptab, off; + va_list ap; + va_start(ap, nofdyn); + nofelems = 1; + while (nofdim > 0) { + nofelems = nofelems * va_arg(ap, LONGINT); nofdim--; + if (nofelems <= 0) __HALT(-20); + } + va_end(ap); + dataoff = nofdyn * sizeof(LONGINT); + if (elemalgn > sizeof(LONGINT)) { + n = dataoff % elemalgn; + if (n != 0) dataoff += elemalgn - n; + } + size = dataoff + nofelems * elemsz; + Heap_Lock(); + if (typ == NIL) { + /* element typ does not contain pointers */ + x = Heap_NEWBLK(size); + } + else if (typ == (LONGINT*)POINTER__typ) { + /* element type is a pointer */ + x = Heap_NEWBLK(size + nofelems * sizeof(LONGINT)); + p = (LONGINT*)(uintptr_t)x[-1]; + p[-nofelems] = *p; /* build new type desc in situ: 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ + p -= nofelems - 1; n = 1; /* n =1 for skipping the size field */ + while (n <= nofelems) {*p = n*sizeof(LONGINT); p++; n++;} + *p = - (nofelems + 1) * sizeof(LONGINT); /* sentinel */ + x[-1] -= nofelems * sizeof(LONGINT); + } + else { + /* element type is a record that contains pointers */ + ptab = typ + 1; nofptrs = 0; + while (ptab[nofptrs] >= 0) {nofptrs++;} /* number of pointers per element */ + nptr = nofelems * nofptrs; /* total number of pointers */ + x = Heap_NEWBLK(size + nptr * sizeof(LONGINT)); + p = (LONGINT*)(uintptr_t)x[- 1]; + p[-nptr] = *p; /* build new type desc in situ; 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ + p -= nptr - 1; n = 0; off = dataoff; + while (n < nofelems) {i = 0; + while (i < nofptrs) {*p = off + ptab[i]; p++; i++;} + off += elemsz; n++; + } + *p = - (nptr + 1) * sizeof(LONGINT); /* sentinel */ + x[-1] -= nptr * sizeof(LONGINT); + } + if (nofdyn != 0) { + /* setup len vector for index checks */ + va_start(ap, nofdyn); + p = x; + while (nofdyn > 0) {*p = va_arg(ap, LONGINT); p++, nofdyn--;} + va_end(ap); + } + Heap_Unlock(); + return x; +} + + + + +typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler + +#ifndef _WIN32 + + SystemSignalHandler handler[3] = {0}; + + // Provide signal handling for Unix based systems + void signalHandler(int s) { + if (s >= 2 && s <= 4) handler[s-2](s); + // (Ignore other signals) + } + + void SystemSetHandler(int s, uintptr_t h) { + if (s >= 2 && s <= 4) { + int needtosetsystemhandler = handler[s-2] == 0; + handler[s-2] = (SystemSignalHandler)h; + if (needtosetsystemhandler) {signal(s, signalHandler);} + } + } + +#else + + // Provides Windows callback handlers for signal-like scenarios + #include "WindowsWrapper.h" + + SystemSignalHandler SystemInterruptHandler = 0; + SystemSignalHandler SystemQuitHandler = 0; + BOOL ConsoleCtrlHandlerSet = FALSE; + + BOOL WINAPI SystemConsoleCtrlHandler(DWORD ctrlType) { + if ((ctrlType == CTRL_C_EVENT) || (ctrlType == CTRL_BREAK_EVENT)) { + if (SystemInterruptHandler) { + SystemInterruptHandler(2); // SIGINT + return TRUE; + } + } else { // Close, logoff or shutdown + if (SystemQuitHandler) { + SystemQuitHandler(3); // SIGQUIT + return TRUE; + } + } + return FALSE; + } + + void EnsureConsoleCtrlHandler() { + if (!ConsoleCtrlHandlerSet) { + SetConsoleCtrlHandler(SystemConsoleCtrlHandler, TRUE); + ConsoleCtrlHandlerSet = TRUE; + } + } + + void SystemSetInterruptHandler(uintptr_t h) { + EnsureConsoleCtrlHandler(); + SystemInterruptHandler = (SystemSignalHandler)h; + } + + void SystemSetQuitHandler(uintptr_t h) { + EnsureConsoleCtrlHandler(); + SystemQuitHandler = (SystemSignalHandler)h; + } + +#endif diff --git a/bootstrap/windows-88/SYSTEM.h b/bootstrap/windows-88/SYSTEM.h new file mode 100644 index 00000000..f9e2f930 --- /dev/null +++ b/bootstrap/windows-88/SYSTEM.h @@ -0,0 +1,275 @@ +#ifndef SYSTEM__h +#define SYSTEM__h + +#ifndef _WIN32 + + // Building for a Unix/Linux based system + #include // For memcpy ... + #include // For uintptr_t ... + +#else + + // Building for Windows platform with either mingw under cygwin, or the MS C compiler + #ifdef _WIN64 + typedef unsigned long long size_t; + typedef unsigned long long uintptr_t; + #else + typedef unsigned int size_t; + typedef unsigned int uintptr_t; + #endif /* _WIN64 */ + + typedef unsigned int uint32_t; + void * __cdecl memcpy(void * dest, const void * source, size_t size); + +#endif + + +// The compiler uses 'import' and 'export' which translate to 'extern' and +// nothing respectively. + +#define import extern +#define export + + + +// Known constants + +#define NIL ((void*)0) +#define __MAXEXT 16 +#define POINTER__typ ((LONGINT*)(1)) // not NIL and not a valid type + + +// Oberon types + +#define BOOLEAN char +#define SYSTEM_BYTE unsigned char +#define CHAR unsigned char +#define SHORTINT signed char +#define REAL float +#define LONGREAL double +#define SYSTEM_PTR void* + +// For 32 bit builds, the size of LONGINT depends on a make option: + +#if (__SIZEOF_POINTER__ == 8) || defined(LARGE) || defined(_WIN64) + #define INTEGER int // INTEGER is 32 bit. + #define LONGINT long long // LONGINT is 64 bit. (long long is always 64 bits, while long can be 32 bits e.g. under MSC/MingW) +#else + #define INTEGER short int // INTEGER is 16 bit. + #define LONGINT long // LONGINT is 32 bit. +#endif + +#define SET unsigned LONGINT + + +// OS Memory allocation interfaces are in PlatformXXX.Mod + +extern LONGINT Platform_OSAllocate (LONGINT size); +extern void Platform_OSFree (LONGINT addr); + + +// Run time system routines in SYSTEM.c + +extern LONGINT SYSTEM_XCHK (LONGINT i, LONGINT ub); +extern LONGINT SYSTEM_RCHK (LONGINT i, LONGINT ub); +extern LONGINT SYSTEM_ASH (LONGINT i, LONGINT n); +extern LONGINT SYSTEM_ABS (LONGINT i); +extern double SYSTEM_ABSD (double i); +extern void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0); +extern void SYSTEM_ENUMP (void *adr, LONGINT n, void (*P)()); +extern void SYSTEM_ENUMR (void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()); +extern LONGINT SYSTEM_DIV (unsigned LONGINT x, unsigned LONGINT y); +extern LONGINT SYSTEM_MOD (unsigned LONGINT x, unsigned LONGINT y); +extern LONGINT SYSTEM_ENTIER (double x); + + +// Signal handling in SYSTEM.c + +#ifndef _WIN32 + extern void SystemSetHandler(int s, uintptr_t h); +#else + extern void SystemSetInterruptHandler(uintptr_t h); + extern void SystemSetQuitHandler (uintptr_t h); +#endif + + + +// String comparison + +static int __str_cmp(CHAR *x, CHAR *y){ + LONGINT i = 0; + CHAR ch1, ch2; + do {ch1 = x[i]; ch2 = y[i]; i++; + if (!ch1) return -(int)ch2; + } while (ch1==ch2); + return (int)ch1 - (int)ch2; +} +#define __STRCMP(a,b) __str_cmp((CHAR*)(a), (CHAR*)(b)) + + + +// Inline string, record and array copy + +#define __COPY(s, d, n) {char*_a=(void*)s,*_b=(void*)d; LONGINT _i=0,_t=n-1; \ + while(_i<_t&&((_b[_i]=_a[_i])!=0)){_i++;};_b[_i]=0;} +#define __DUP(x, l, t) x=(void*)memcpy((void*)(uintptr_t)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) +#define __DUPARR(v, t) v=(void*)memcpy(v##__copy,v,sizeof(t)) +#define __DEL(x) Platform_OSFree((LONGINT)(uintptr_t)x) + + + + +/* SYSTEM ops */ + +#define __VAL(t, x) ((t)(x)) +#define __VALP(t, x) ((t)(uintptr_t)(x)) + +#define __GET(a, x, t) x= *(t*)(uintptr_t)(a) +#define __PUT(a, x, t) *(t*)(uintptr_t)(a)=x +#define __LSHL(x, n, t) ((t)((unsigned t)(x)<<(n))) +#define __LSHR(x, n, t) ((t)((unsigned t)(x)>>(n))) +#define __LSH(x, n, t) ((n)>=0? __LSHL(x, n, t): __LSHR(x, -(n), t)) +#define __ROTL(x, n, t) ((t)((unsigned t)(x)<<(n)|(unsigned t)(x)>>(8*sizeof(t)-(n)))) +#define __ROTR(x, n, t) ((t)((unsigned t)(x)>>(n)|(unsigned t)(x)<<(8*sizeof(t)-(n)))) +#define __LSHR(x, n, t) ((t)((unsigned t)(x)>>(n))) +#define __LSH(x, n, t) ((n)>=0? __LSHL(x, n, t): __LSHR(x, -(n), t)) +#define __ROTL(x, n, t) ((t)((unsigned t)(x)<<(n)|(unsigned t)(x)>>(8*sizeof(t)-(n)))) +#define __ROTR(x, n, t) ((t)((unsigned t)(x)>>(n)|(unsigned t)(x)<<(8*sizeof(t)-(n)))) +#define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) +#define __BIT(x, n) (*(unsigned LONGINT*)(x)>>(n)&1) +#define __MOVE(s, d, n) memcpy((char*)(uintptr_t)(d),(char*)(uintptr_t)(s),n) +#define __ASHL(x, n) ((LONGINT)(x)<<(n)) +#define __ASHR(x, n) ((LONGINT)(x)>>(n)) +#define __ASH(x, n) ((n)>=0?__ASHL(x,n):__ASHR(x,-(n))) +#define __ASHF(x, n) SYSTEM_ASH((LONGINT)(x), (LONGINT)(n)) +#define __SHORT(x, y) ((int)((unsigned LONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) +#define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) +#define __CHR(x) ((CHAR)__R(x, 256)) +#define __CHRF(x) ((CHAR)__RF(x, 256)) +#define __DIV(x, y) ((x)>=0?(x)/(y):-(((y)-1-(x))/(y))) +#define __DIVF(x, y) SYSTEM_DIV((LONGINT)(x),(LONGINT)(y)) +#define __MOD(x, y) ((x)>=0?(x)%(y):__MODF(x,y)) +#define __MODF(x, y) SYSTEM_MOD((LONGINT)(x),(LONGINT)(y)) +#define __ENTIER(x) SYSTEM_ENTIER(x) +#define __ABS(x) (((x)<0)?-(x):(x)) +#define __ABSF(x) SYSTEM_ABS((LONGINT)(x)) +#define __ABSFD(x) SYSTEM_ABSD((double)(x)) +#define __CAP(ch) ((CHAR)((ch)&0x5f)) +#define __ODD(x) ((x)&1) +#define __IN(x, s) (((s)>>(x))&1) +#define __SETOF(x) ((SET)1<<(x)) +#define __SETRNG(l, h) ((~(SET)0<<(l))&~(SET)0>>(8*sizeof(SET)-1-(h))) +#define __MASK(x, m) ((x)&~(m)) + + + +// Runtime checks + +#define __X(i, ub) (((unsigned LONGINT)(i)<(unsigned LONGINT)(ub))?i:(__HALT(-2),0)) +#define __XF(i, ub) SYSTEM_XCHK((LONGINT)(i), (LONGINT)(ub)) +#define __R(i, ub) (((unsigned LONGINT)(i)<(unsigned LONGINT)(ub))?i:(__HALT(-8),0)) +#define __RF(i, ub) SYSTEM_RCHK((LONGINT)(i),(LONGINT)(ub)) +#define __RETCHK __retchk: __HALT(-3); return 0; +#define __CASECHK __HALT(-4) +#define __WITHCHK __HALT(-7) + +#define __GUARDP(p, typ, level) ((typ*)(__ISP(p,typ,level)?p:(__HALT(-5),p))) +#define __GUARDR(r, typ, level) (*((typ*)(__IS(r##__typ,typ,level)?r:(__HALT(-5),r)))) +#define __GUARDA(p, typ, level) ((struct typ*)(__IS(__TYPEOF(p),typ,level)?p:(__HALT(-5),p))) +#define __GUARDEQR(p, dyntyp, typ) if(dyntyp!=typ##__typ) __HALT(-6);*(p) +#define __GUARDEQP(p, typ) if(__TYPEOF(p)!=typ##__typ)__HALT(-6);*(p) + + + +// Module entry/registration/exit + +extern void Heap_REGCMD(); +extern SYSTEM_PTR Heap_REGMOD(); +extern void Heap_REGTYP(); +extern void Heap_INCREF(); + +#define __DEFMOD static void *m; if (m!=0) {return m;} +#define __REGCMD(name, cmd) Heap_REGCMD(m, (CHAR*)name, cmd) +#define __REGMOD(name, enum) if (m==0) {m = Heap_REGMOD((CHAR*)name,enum);} +#define __ENDMOD return m +#define __MODULE_IMPORT(name) Heap_INCREF(name##__init()) + + + +// Main module initialisation, registration and finalisation + +extern void Platform_Init(INTEGER argc, LONGINT argv); +extern void *Platform_MainModule; +extern void Heap_FINALL(); + +#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (LONGINT)(uintptr_t)&argv); +#define __REGMAIN(name, enum) m = Heap_REGMOD((CHAR*)name,enum) +#define __FINI Heap_FINALL(); return 0 + + +// Assertions and Halts + +extern void Platform_Halt(LONGINT x); +extern void Platform_AssertFail(LONGINT x); + +#define __HALT(x) Platform_Halt(x) +#define __ASSERT(cond, x) if (!(cond)) Platform_AssertFail((LONGINT)(x)) + + +// Memory allocation + +extern SYSTEM_PTR Heap_NEWBLK (LONGINT size); +extern SYSTEM_PTR Heap_NEWREC (LONGINT tag); +extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); + +#define __SYSNEW(p, len) p = Heap_NEWBLK((LONGINT)(len)) +#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(uintptr_t)t##__typ) +#define __NEWARR SYSTEM_NEWARR + + + +/* Type handling */ + +#define __TDESC(t, m, n) \ + static struct t##__desc { \ + LONGINT tproc[m]; /* Proc for each ptr field */ \ + LONGINT tag; \ + LONGINT next; /* Module table type list points here */ \ + LONGINT level; \ + LONGINT module; \ + char name[24]; \ + LONGINT basep[__MAXEXT]; /* List of bases this extends */ \ + LONGINT reserved; \ + LONGINT blksz; /* xxx_typ points here */ \ + LONGINT ptr[n+1]; /* Offsets of ptrs up to -ve sentinel */ \ + } t##__desc + +#define __BASEOFF (__MAXEXT+1) // blksz as index to base. +#define __TPROC0OFF (__BASEOFF+24/sizeof(LONGINT)+5) // blksz as index to tproc IFF m=1. +#define __EOM 1 +#define __TDFLDS(name, size) {__EOM}, 1, 0, 0, 0, name, {0}, 0, size +#define __ENUMP(adr, n, P) SYSTEM_ENUMP(adr, (LONGINT)(n), P) +#define __ENUMR(adr, typ, size, n, P) SYSTEM_ENUMR(adr, typ, (LONGINT)(size), (LONGINT)(n), P) + +#define __INITYP(t, t0, level) \ + t##__typ = (LONGINT*)&t##__desc.blksz; \ + memcpy(t##__desc.basep, t0##__typ - __BASEOFF, level*sizeof(LONGINT)); \ + t##__desc.basep[level] = (LONGINT)(uintptr_t)t##__typ; \ + t##__desc.module = (LONGINT)(uintptr_t)m; \ + if(t##__desc.blksz!=sizeof(struct t)) __HALT(-15); \ + t##__desc.blksz = (t##__desc.blksz+5*sizeof(LONGINT)-1)/(4*sizeof(LONGINT))*(4*sizeof(LONGINT)); \ + Heap_REGTYP(m, (LONGINT)(uintptr_t)&t##__desc.next); \ + SYSTEM_INHERIT(t##__typ, t0##__typ) + +#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(uintptr_t)typ##__typ) +#define __TYPEOF(p) ((LONGINT*)(uintptr_t)(*(((LONGINT*)(p))-1))) +#define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) + +// Oberon-2 type bound procedures support +#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(uintptr_t)proc +#define __SEND(typ, num, funtyp, parlist) ((funtyp)((uintptr_t)*(typ-(__TPROC0OFF+num))))parlist + + + + +#endif diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c new file mode 100644 index 00000000..98eef9eb --- /dev/null +++ b/bootstrap/windows-88/Strings.c @@ -0,0 +1,244 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +#define LARGE +#include "SYSTEM.h" + + + + +export void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len); +export void Strings_Cap (CHAR *s, LONGINT s__len); +export void Strings_Delete (CHAR *s, LONGINT s__len, INTEGER pos, INTEGER n); +export void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n, CHAR *dest, LONGINT dest__len); +export void Strings_Insert (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, LONGINT dest__len); +export INTEGER Strings_Length (CHAR *s, LONGINT s__len); +export BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len); +export INTEGER Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, INTEGER pos); +export void Strings_Replace (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, LONGINT dest__len); + + +INTEGER Strings_Length (CHAR *s, LONGINT s__len) +{ + INTEGER _o_result; + INTEGER i; + __DUP(s, s__len, CHAR); + i = 0; + while (((LONGINT)i < s__len && s[__X(i, s__len)] != 0x00)) { + i += 1; + } + _o_result = i; + __DEL(s); + return _o_result; +} + +void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len) +{ + INTEGER n1, n2, i; + __DUP(extra, extra__len, CHAR); + n1 = Strings_Length(dest, dest__len); + n2 = Strings_Length(extra, extra__len); + i = 0; + while ((i < n2 && (LONGINT)(i + n1) < dest__len)) { + dest[__X(i + n1, dest__len)] = extra[__X(i, extra__len)]; + i += 1; + } + if ((LONGINT)(i + n1) < dest__len) { + dest[__X(i + n1, dest__len)] = 0x00; + } + __DEL(extra); +} + +void Strings_Insert (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, LONGINT dest__len) +{ + INTEGER n1, n2, i; + __DUP(source, source__len, CHAR); + n1 = Strings_Length(dest, dest__len); + n2 = Strings_Length(source, source__len); + if (pos < 0) { + pos = 0; + } + if (pos > n1) { + Strings_Append(dest, dest__len, (void*)source, source__len); + return; + } + if ((LONGINT)(pos + n2) < dest__len) { + i = n1; + while (i >= pos) { + if ((LONGINT)(i + n2) < dest__len) { + dest[__X(i + n2, dest__len)] = dest[__X(i, dest__len)]; + } + i -= 1; + } + } + i = 0; + while (i < n2) { + dest[__X(pos + i, dest__len)] = source[__X(i, source__len)]; + i += 1; + } + __DEL(source); +} + +void Strings_Delete (CHAR *s, LONGINT s__len, INTEGER pos, INTEGER n) +{ + INTEGER len, i; + len = Strings_Length(s, s__len); + if (pos < 0) { + pos = 0; + } else if (pos >= len) { + return; + } + if (pos + n < len) { + i = pos + n; + while (i < len) { + s[__X(i - n, s__len)] = s[__X(i, s__len)]; + i += 1; + } + if ((LONGINT)(i - n) < s__len) { + s[__X(i - n, s__len)] = 0x00; + } + } else { + s[__X(pos, s__len)] = 0x00; + } +} + +void Strings_Replace (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, LONGINT dest__len) +{ + __DUP(source, source__len, CHAR); + Strings_Delete((void*)dest, dest__len, pos, pos + Strings_Length(source, source__len)); + Strings_Insert(source, source__len, pos, (void*)dest, dest__len); + __DEL(source); +} + +void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n, CHAR *dest, LONGINT dest__len) +{ + INTEGER len, destLen, i; + __DUP(source, source__len, CHAR); + len = Strings_Length(source, source__len); + destLen = (int)dest__len - 1; + if (pos < 0) { + pos = 0; + } + if (pos >= len) { + dest[0] = 0x00; + return; + } + i = 0; + while (((((LONGINT)(pos + i) <= source__len && source[__X(pos + i, source__len)] != 0x00)) && i < n)) { + if (i < destLen) { + dest[__X(i, dest__len)] = source[__X(pos + i, source__len)]; + } + i += 1; + } + dest[__X(i, dest__len)] = 0x00; + __DEL(source); +} + +INTEGER Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, INTEGER pos) +{ + INTEGER _o_result; + INTEGER n1, n2, i, j; + __DUP(pattern, pattern__len, CHAR); + __DUP(s, s__len, CHAR); + n1 = Strings_Length(s, s__len); + n2 = Strings_Length(pattern, pattern__len); + if (n2 == 0) { + _o_result = 0; + __DEL(pattern); + __DEL(s); + return _o_result; + } + i = pos; + while (i <= n1 - n2) { + if (s[__X(i, s__len)] == pattern[0]) { + j = 1; + while ((j < n2 && s[__X(i + j, s__len)] == pattern[__X(j, pattern__len)])) { + j += 1; + } + if (j == n2) { + _o_result = i; + __DEL(pattern); + __DEL(s); + return _o_result; + } + } + i += 1; + } + _o_result = -1; + __DEL(pattern); + __DEL(s); + return _o_result; +} + +void Strings_Cap (CHAR *s, LONGINT s__len) +{ + INTEGER i; + i = 0; + while (s[__X(i, s__len)] != 0x00) { + if (('a' <= s[__X(i, s__len)] && s[__X(i, s__len)] <= 'z')) { + s[__X(i, s__len)] = __CAP(s[__X(i, s__len)]); + } + i += 1; + } +} + +static struct Match__7 { + struct Match__7 *lnk; +} *Match__7_s; + +static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, INTEGER n, INTEGER m); + +static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, INTEGER n, INTEGER m) +{ + BOOLEAN _o_result; + while ((((n >= 0 && m >= 0)) && mask[__X(m, mask__len)] != '*')) { + if (name[__X(n, name__len)] != mask[__X(m, mask__len)]) { + _o_result = 0; + return _o_result; + } + n -= 1; + m -= 1; + } + if (m < 0) { + _o_result = n < 0; + return _o_result; + } + while ((m >= 0 && mask[__X(m, mask__len)] == '*')) { + m -= 1; + } + if (m < 0) { + _o_result = 1; + return _o_result; + } + while (n >= 0) { + if (M__8(name, name__len, mask, mask__len, n, m)) { + _o_result = 1; + return _o_result; + } + n -= 1; + } + _o_result = 0; + return _o_result; +} + +BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len) +{ + BOOLEAN _o_result; + struct Match__7 _s; + __DUP(string, string__len, CHAR); + __DUP(pattern, pattern__len, CHAR); + _s.lnk = Match__7_s; + Match__7_s = &_s; + _o_result = M__8((void*)string, string__len, (void*)pattern, pattern__len, Strings_Length(string, string__len) - 1, Strings_Length(pattern, pattern__len) - 1); + Match__7_s = _s.lnk; + __DEL(string); + __DEL(pattern); + return _o_result; +} + + +export void *Strings__init(void) +{ + __DEFMOD; + __REGMOD("Strings", 0); +/* BEGIN */ + __ENDMOD; +} diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h new file mode 100644 index 00000000..05e86973 --- /dev/null +++ b/bootstrap/windows-88/Strings.h @@ -0,0 +1,24 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ + +#ifndef Strings__h +#define Strings__h + +#define LARGE +#include "SYSTEM.h" + + + + +import void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len); +import void Strings_Cap (CHAR *s, LONGINT s__len); +import void Strings_Delete (CHAR *s, LONGINT s__len, INTEGER pos, INTEGER n); +import void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n, CHAR *dest, LONGINT dest__len); +import void Strings_Insert (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, LONGINT dest__len); +import INTEGER Strings_Length (CHAR *s, LONGINT s__len); +import BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len); +import INTEGER Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, INTEGER pos); +import void Strings_Replace (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, LONGINT dest__len); +import void *Strings__init(void); + + +#endif diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c new file mode 100644 index 00000000..307bec01 --- /dev/null +++ b/bootstrap/windows-88/Texts.c @@ -0,0 +1,1839 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +#define LARGE +#include "SYSTEM.h" +#include "Files.h" +#include "Modules.h" +#include "Reals.h" + +typedef + struct Texts_RunDesc *Texts_Run; + +typedef + struct Texts_FontDesc *Texts_FontsFont; + +typedef + struct Texts_RunDesc { + Texts_Run prev, next; + LONGINT len; + Texts_FontsFont fnt; + SHORTINT col, voff; + BOOLEAN ascii; + } Texts_RunDesc; + +typedef + struct Texts_ElemDesc *Texts_Elem; + +typedef + struct Texts_ElemMsg { + char _prvt0[1]; + } Texts_ElemMsg; + +typedef + void (*Texts_Handler)(Texts_Elem, Texts_ElemMsg*, LONGINT *); + +typedef + struct Texts_TextDesc *Texts_Text; + +typedef + struct Texts_ElemDesc { + Texts_Run prev, next; + LONGINT len; + Texts_FontsFont fnt; + SHORTINT col, voff; + BOOLEAN ascii; + LONGINT W, H; + Texts_Handler handle; + Texts_Text base; + } Texts_ElemDesc; + +struct Texts__1 { /* Texts_ElemDesc */ + Texts_Run prev, next; + LONGINT len; + Texts_FontsFont fnt; + SHORTINT col, voff; + BOOLEAN ascii; + LONGINT W, H; + Texts_Handler handle; + Texts_Text base; + Files_File file; + LONGINT org, span; + CHAR mod[32], proc[32]; +}; + +typedef + struct Texts__1 *Texts_Alien; + +typedef + struct Texts_BufDesc { + LONGINT len; + Texts_Run head; + } Texts_BufDesc; + +typedef + Texts_BufDesc *Texts_Buffer; + +typedef + struct Texts_CopyMsg { /* Texts_ElemMsg */ + Texts_Elem e; + } Texts_CopyMsg; + +typedef + struct Texts_FileMsg { /* Texts_ElemMsg */ + INTEGER id; + LONGINT pos; + Files_Rider r; + } Texts_FileMsg; + +typedef + struct Texts_FontDesc { + CHAR name[32]; + } Texts_FontDesc; + +typedef + struct Texts_IdentifyMsg { /* Texts_ElemMsg */ + CHAR mod[32], proc[32]; + } Texts_IdentifyMsg; + +typedef + void (*Texts_Notifier)(Texts_Text, INTEGER, LONGINT, LONGINT); + +typedef + struct Texts_PieceDesc *Texts_Piece; + +typedef + struct Texts_PieceDesc { + Texts_Run prev, next; + LONGINT len; + Texts_FontsFont fnt; + SHORTINT col, voff; + BOOLEAN ascii; + Files_File file; + LONGINT org; + } Texts_PieceDesc; + +typedef + struct Texts_Reader { + BOOLEAN eot; + Texts_FontsFont fnt; + SHORTINT col, voff; + Texts_Elem elem; + Files_Rider rider; + Texts_Run run; + LONGINT org, off; + } Texts_Reader; + +typedef + struct Texts_Scanner { /* Texts_Reader */ + BOOLEAN eot; + Texts_FontsFont fnt; + SHORTINT col, voff; + Texts_Elem elem; + Files_Rider rider; + Texts_Run run; + LONGINT org, off; + CHAR nextCh; + INTEGER line, class; + LONGINT i; + REAL x; + LONGREAL y; + CHAR c; + SHORTINT len; + CHAR s[64]; + } Texts_Scanner; + +typedef + struct Texts_TextDesc { + LONGINT len; + Texts_Notifier notify; + Texts_Run head, cache; + LONGINT corg; + } Texts_TextDesc; + +typedef + struct Texts_Writer { + Texts_Buffer buf; + Texts_FontsFont fnt; + SHORTINT col, voff; + Files_Rider rider; + Files_File file; + } Texts_Writer; + + +export Texts_Elem Texts_new; +static Texts_Buffer Texts_del; +static Texts_FontsFont Texts_FontsDefault; + +export LONGINT *Texts_FontDesc__typ; +export LONGINT *Texts_RunDesc__typ; +export LONGINT *Texts_PieceDesc__typ; +export LONGINT *Texts_ElemMsg__typ; +export LONGINT *Texts_ElemDesc__typ; +export LONGINT *Texts_FileMsg__typ; +export LONGINT *Texts_CopyMsg__typ; +export LONGINT *Texts_IdentifyMsg__typ; +export LONGINT *Texts_BufDesc__typ; +export LONGINT *Texts_TextDesc__typ; +export LONGINT *Texts_Reader__typ; +export LONGINT *Texts_Scanner__typ; +export LONGINT *Texts_Writer__typ; +export LONGINT *Texts__1__typ; + +export void Texts_Append (Texts_Text T, Texts_Buffer B); +export void Texts_ChangeLooks (Texts_Text T, LONGINT beg, LONGINT end, SET sel, Texts_FontsFont fnt, SHORTINT col, SHORTINT voff); +static Texts_Elem Texts_CloneElem (Texts_Elem e); +static Texts_Piece Texts_ClonePiece (Texts_Piece p); +export void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len); +export void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); +export void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); +export void Texts_Delete (Texts_Text T, LONGINT beg, LONGINT end); +export Texts_Text Texts_ElemBase (Texts_Elem E); +export LONGINT Texts_ElemPos (Texts_Elem E); +static void Texts_Find (Texts_Text T, LONGINT *pos, Texts_Run *u, LONGINT *org, LONGINT *off); +static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len); +static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, LONGINT *msg__typ); +export void Texts_Insert (Texts_Text T, LONGINT pos, Texts_Buffer B); +export void Texts_Load (Files_Rider *r, LONGINT *r__typ, Texts_Text T); +static void Texts_Load0 (Files_Rider *r, LONGINT *r__typ, Texts_Text T); +static void Texts_Merge (Texts_Text T, Texts_Run u, Texts_Run *v); +export void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len); +export void Texts_OpenBuf (Texts_Buffer B); +export void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, LONGINT pos); +export void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, LONGINT pos); +export void Texts_OpenWriter (Texts_Writer *W, LONGINT *W__typ); +export LONGINT Texts_Pos (Texts_Reader *R, LONGINT *R__typ); +export void Texts_Read (Texts_Reader *R, LONGINT *R__typ, CHAR *ch); +export void Texts_ReadElem (Texts_Reader *R, LONGINT *R__typ); +export void Texts_ReadPrevElem (Texts_Reader *R, LONGINT *R__typ); +export void Texts_Recall (Texts_Buffer *B); +export void Texts_Save (Texts_Text T, LONGINT beg, LONGINT end, Texts_Buffer B); +export void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ); +export void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, SHORTINT col); +export void Texts_SetFont (Texts_Writer *W, LONGINT *W__typ, Texts_FontsFont fnt); +export void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, SHORTINT voff); +static void Texts_Splice (Texts_Run un, Texts_Run v, Texts_Run w, Texts_Text base); +static void Texts_Split (LONGINT off, Texts_Run *u, Texts_Run *un); +export void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T); +export void Texts_Write (Texts_Writer *W, LONGINT *W__typ, CHAR ch); +export void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, LONGINT t, LONGINT d); +export void Texts_WriteElem (Texts_Writer *W, LONGINT *W__typ, Texts_Elem e); +export void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, LONGINT x); +export void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n); +export void Texts_WriteLn (Texts_Writer *W, LONGINT *W__typ); +export void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER n); +export void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x); +export void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n); +export void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n, INTEGER k); +export void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x); +export void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__len); + + +static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len) +{ + Texts_FontsFont _o_result; + Texts_FontsFont F = NIL; + __NEW(F, Texts_FontDesc); + __COPY(name, F->name, ((LONGINT)(32))); + _o_result = F; + return _o_result; +} + +static void Texts_Find (Texts_Text T, LONGINT *pos, Texts_Run *u, LONGINT *org, LONGINT *off) +{ + Texts_Run v = NIL; + LONGINT m; + if (*pos >= T->len) { + *pos = T->len; + *u = T->head; + *org = T->len; + *off = 0; + T->cache = T->head; + T->corg = 0; + } else { + v = T->cache->next; + m = *pos - T->corg; + if (*pos >= T->corg) { + while (m >= v->len) { + m -= v->len; + v = v->next; + } + } else { + while (m < 0) { + v = v->prev; + m += v->len; + } + } + *u = v; + *org = *pos - m; + *off = m; + T->cache = v->prev; + T->corg = *org; + } +} + +static void Texts_Split (LONGINT off, Texts_Run *u, Texts_Run *un) +{ + Texts_Piece p = NIL, U = NIL; + if (off == 0) { + *un = *u; + *u = (*un)->prev; + } else if (off >= (*u)->len) { + *un = (*u)->next; + } else { + __NEW(p, Texts_PieceDesc); + *un = (Texts_Run)p; + U = __GUARDP(*u, Texts_PieceDesc, 1); + __GUARDEQP(p, Texts_PieceDesc) = *U; + p->org += off; + p->len -= off; + U->len -= p->len; + p->ascii = (*u)->ascii; + p->prev = (Texts_Run)U; + p->next = U->next; + p->next->prev = (Texts_Run)p; + U->next = (Texts_Run)p; + } +} + +static void Texts_Merge (Texts_Text T, Texts_Run u, Texts_Run *v) +{ + Texts_Piece p = NIL, q = NIL; + if ((((((((((__ISP(u, Texts_PieceDesc, 1) && __ISP(*v, Texts_PieceDesc, 1))) && __STRCMP(u->fnt->name, (*v)->fnt->name) == 0)) && u->col == (*v)->col)) && u->voff == (*v)->voff)) && __GUARDP(u, Texts_PieceDesc, 1)->ascii == __GUARDP(*v, Texts_PieceDesc, 1)->ascii)) { + p = __GUARDP(u, Texts_PieceDesc, 1); + q = __GUARDP(*v, Texts_PieceDesc, 1); + if ((p->file == q->file && p->org + p->len == q->org)) { + if (T->cache == u) { + T->corg += q->len; + } else if (T->cache == *v) { + T->cache = T->head; + T->corg = 0; + } + p->len += q->len; + *v = (*v)->next; + } + } +} + +static void Texts_Splice (Texts_Run un, Texts_Run v, Texts_Run w, Texts_Text base) +{ + Texts_Run u = NIL; + if (v != w->next) { + u = un->prev; + u->next = v; + v->prev = u; + un->prev = w; + w->next = un; + do { + if (__ISP(v, Texts_ElemDesc, 1)) { + __GUARDP(v, Texts_ElemDesc, 1)->base = base; + } + v = v->next; + } while (!(v == un)); + } +} + +static Texts_Piece Texts_ClonePiece (Texts_Piece p) +{ + Texts_Piece _o_result; + Texts_Piece q = NIL; + __NEW(q, Texts_PieceDesc); + __GUARDEQP(q, Texts_PieceDesc) = *p; + _o_result = q; + return _o_result; +} + +static Texts_Elem Texts_CloneElem (Texts_Elem e) +{ + Texts_Elem _o_result; + Texts_CopyMsg msg; + msg.e = NIL; + (*e->handle)(e, (void*)&msg, Texts_CopyMsg__typ); + _o_result = msg.e; + return _o_result; +} + +void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE) +{ + DE->len = SE->len; + DE->fnt = SE->fnt; + DE->col = SE->col; + DE->voff = SE->voff; + DE->W = SE->W; + DE->H = SE->H; + DE->handle = SE->handle; +} + +Texts_Text Texts_ElemBase (Texts_Elem E) +{ + Texts_Text _o_result; + _o_result = E->base; + return _o_result; +} + +LONGINT Texts_ElemPos (Texts_Elem E) +{ + LONGINT _o_result; + Texts_Run u = NIL; + LONGINT pos; + u = E->base->head->next; + pos = 0; + while (u != (void *) E) { + pos = pos + u->len; + u = u->next; + } + _o_result = pos; + return _o_result; +} + +static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, LONGINT *msg__typ) +{ + Texts_Alien e = NIL; + Files_Rider r; + LONGINT i; + CHAR ch; + if (__ISP(E, Texts__1, 2)) { + if (__IS(msg__typ, Texts_CopyMsg, 1)) { + if (__IS(msg__typ, Texts_CopyMsg, 1)) { + Texts_CopyMsg *msg__ = (void*)msg; + __NEW(e, Texts__1); + Texts_CopyElem((void*)((Texts_Alien)E), (void*)e); + e->file = ((Texts_Alien)E)->file; + e->org = ((Texts_Alien)E)->org; + e->span = ((Texts_Alien)E)->span; + __COPY(((Texts_Alien)E)->mod, e->mod, ((LONGINT)(32))); + __COPY(((Texts_Alien)E)->proc, e->proc, ((LONGINT)(32))); + (*msg__).e = (Texts_Elem)e; + } else __WITHCHK; + } else if (__IS(msg__typ, Texts_IdentifyMsg, 1)) { + if (__IS(msg__typ, Texts_IdentifyMsg, 1)) { + Texts_IdentifyMsg *msg__ = (void*)msg; + __COPY(((Texts_Alien)E)->mod, (*msg__).mod, ((LONGINT)(32))); + __COPY(((Texts_Alien)E)->proc, (*msg__).proc, ((LONGINT)(32))); + (*msg__).mod[31] = 0x01; + } else __WITHCHK; + } else if (__IS(msg__typ, Texts_FileMsg, 1)) { + if (__IS(msg__typ, Texts_FileMsg, 1)) { + Texts_FileMsg *msg__ = (void*)msg; + if ((*msg__).id == 1) { + Files_Set(&r, Files_Rider__typ, ((Texts_Alien)E)->file, ((Texts_Alien)E)->org); + i = ((Texts_Alien)E)->span; + while (i > 0) { + Files_Read(&r, Files_Rider__typ, (void*)&ch); + Files_Write(&(*msg__).r, Files_Rider__typ, ch); + i -= 1; + } + } + } else __WITHCHK; + } + } else __WITHCHK; +} + +void Texts_OpenBuf (Texts_Buffer B) +{ + Texts_Run u = NIL; + __NEW(u, Texts_RunDesc); + u->next = u; + u->prev = u; + B->head = u; + B->len = 0; +} + +void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB) +{ + Texts_Run u = NIL, v = NIL, vn = NIL; + u = SB->head->next; + v = DB->head->prev; + while (u != SB->head) { + if (__ISP(u, Texts_PieceDesc, 1)) { + vn = (Texts_Run)Texts_ClonePiece(__GUARDP(u, Texts_PieceDesc, 1)); + } else { + vn = (Texts_Run)Texts_CloneElem(__GUARDP(u, Texts_ElemDesc, 1)); + } + v->next = vn; + vn->prev = v; + v = vn; + u = u->next; + } + v->next = DB->head; + DB->head->prev = v; + DB->len += SB->len; +} + +void Texts_Recall (Texts_Buffer *B) +{ + *B = Texts_del; + Texts_del = NIL; +} + +void Texts_Save (Texts_Text T, LONGINT beg, LONGINT end, Texts_Buffer B) +{ + Texts_Run u = NIL, v = NIL, w = NIL, wn = NIL; + LONGINT uo, ud, vo, vd; + Texts_Find(T, &beg, &u, &uo, &ud); + Texts_Find(T, &end, &v, &vo, &vd); + w = B->head->prev; + while (u != v) { + if (__ISP(u, Texts_PieceDesc, 1)) { + wn = (Texts_Run)Texts_ClonePiece(__GUARDP(u, Texts_PieceDesc, 1)); + wn->len -= ud; + __GUARDP(wn, Texts_PieceDesc, 1)->org += ud; + } else { + wn = (Texts_Run)Texts_CloneElem(__GUARDP(u, Texts_ElemDesc, 1)); + } + w->next = wn; + wn->prev = w; + w = wn; + u = u->next; + ud = 0; + } + if (vd > 0) { + wn = (Texts_Run)Texts_ClonePiece(__GUARDP(v, Texts_PieceDesc, 1)); + wn->len = vd - ud; + __GUARDP(wn, Texts_PieceDesc, 1)->org += ud; + w->next = wn; + wn->prev = w; + w = wn; + } + w->next = B->head; + B->head->prev = w; + B->len += end - beg; +} + +void Texts_Insert (Texts_Text T, LONGINT pos, Texts_Buffer B) +{ + Texts_Run u = NIL, un = NIL, v = NIL; + Texts_Piece p = NIL, q = NIL; + LONGINT uo, ud, len; + Texts_Find(T, &pos, &u, &uo, &ud); + Texts_Split(ud, &u, &un); + len = B->len; + v = B->head->next; + Texts_Merge(T, u, &v); + Texts_Splice(un, v, B->head->prev, T); + T->len += len; + B->head->next = B->head; + B->head->prev = B->head; + B->len = 0; + if (T->notify != NIL) { + (*T->notify)(T, 1, pos, pos + len); + } +} + +void Texts_Append (Texts_Text T, Texts_Buffer B) +{ + Texts_Run v = NIL; + LONGINT pos, len; + pos = T->len; + len = B->len; + v = B->head->next; + Texts_Merge(T, T->head->prev, &v); + Texts_Splice(T->head, v, B->head->prev, T); + T->len += len; + B->head->next = B->head; + B->head->prev = B->head; + B->len = 0; + if (T->notify != NIL) { + (*T->notify)(T, 1, pos, pos + len); + } +} + +void Texts_Delete (Texts_Text T, LONGINT beg, LONGINT end) +{ + Texts_Run c = NIL, u = NIL, un = NIL, v = NIL, vn = NIL; + LONGINT co, uo, ud, vo, vd; + Texts_Find(T, &beg, &u, &uo, &ud); + Texts_Split(ud, &u, &un); + c = T->cache; + co = T->corg; + Texts_Find(T, &end, &v, &vo, &vd); + Texts_Split(vd, &v, &vn); + T->cache = c; + T->corg = co; + __NEW(Texts_del, Texts_BufDesc); + Texts_OpenBuf(Texts_del); + Texts_del->len = end - beg; + Texts_Splice(Texts_del->head, un, v, NIL); + Texts_Merge(T, u, &vn); + u->next = vn; + vn->prev = u; + T->len -= end - beg; + if (T->notify != NIL) { + (*T->notify)(T, 2, beg, end); + } +} + +void Texts_ChangeLooks (Texts_Text T, LONGINT beg, LONGINT end, SET sel, Texts_FontsFont fnt, SHORTINT col, SHORTINT voff) +{ + Texts_Run c = NIL, u = NIL, un = NIL, v = NIL, vn = NIL; + LONGINT co, uo, ud, vo, vd; + Texts_Find(T, &beg, &u, &uo, &ud); + Texts_Split(ud, &u, &un); + c = T->cache; + co = T->corg; + Texts_Find(T, &end, &v, &vo, &vd); + Texts_Split(vd, &v, &vn); + T->cache = c; + T->corg = co; + while (un != vn) { + if ((__IN(0, sel) && fnt != NIL)) { + un->fnt = fnt; + } + if (__IN(1, sel)) { + un->col = col; + } + if (__IN(2, sel)) { + un->voff = voff; + } + Texts_Merge(T, u, &un); + if (u->next == un) { + u = un; + un = un->next; + } else { + u->next = un; + un->prev = u; + } + } + Texts_Merge(T, u, &un); + u->next = un; + un->prev = u; + if (T->notify != NIL) { + (*T->notify)(T, 0, beg, end); + } +} + +void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, LONGINT pos) +{ + Texts_Run u = NIL; + if (pos >= T->len) { + pos = T->len; + } + Texts_Find(T, &pos, &u, &(*R).org, &(*R).off); + (*R).run = u; + (*R).eot = 0; + if (__ISP(u, Texts_PieceDesc, 1)) { + Files_Set(&(*R).rider, Files_Rider__typ, __GUARDP(u, Texts_PieceDesc, 1)->file, __GUARDP(u, Texts_PieceDesc, 1)->org + (*R).off); + } +} + +void Texts_Read (Texts_Reader *R, LONGINT *R__typ, CHAR *ch) +{ + Texts_Run u = NIL; + LONGINT pos; + CHAR nextch; + u = (*R).run; + (*R).fnt = u->fnt; + (*R).col = u->col; + (*R).voff = u->voff; + (*R).off += 1; + if (__ISP(u, Texts_PieceDesc, 1)) { + Files_Read(&(*R).rider, Files_Rider__typ, (void*)&*ch); + (*R).elem = NIL; + if ((*ch == 0x0a && __GUARDP(u, Texts_PieceDesc, 1)->ascii)) { + *ch = 0x0d; + } else if ((*ch == 0x0d && __GUARDP(u, Texts_PieceDesc, 1)->ascii)) { + pos = Files_Pos(&(*R).rider, Files_Rider__typ); + Files_Read(&(*R).rider, Files_Rider__typ, (void*)&nextch); + if (nextch == 0x0a) { + (*R).off += 1; + } else { + Files_Set(&(*R).rider, Files_Rider__typ, __GUARDP(u, Texts_PieceDesc, 1)->file, pos); + } + } + } else if (__ISP(u, Texts_ElemDesc, 1)) { + *ch = 0x1c; + (*R).elem = __GUARDP(u, Texts_ElemDesc, 1); + } else { + *ch = 0x00; + (*R).elem = NIL; + (*R).eot = 1; + } + if ((*R).off == u->len) { + (*R).org += u->len; + u = u->next; + if (__ISP(u, Texts_PieceDesc, 1)) { + if (__ISP(u, Texts_PieceDesc, 1)) { + Files_Set(&(*R).rider, Files_Rider__typ, ((Texts_Piece)u)->file, ((Texts_Piece)u)->org); + } else __WITHCHK; + } + (*R).run = u; + (*R).off = 0; + } +} + +void Texts_ReadElem (Texts_Reader *R, LONGINT *R__typ) +{ + Texts_Run u = NIL, un = NIL; + u = (*R).run; + while (__ISP(u, Texts_PieceDesc, 1)) { + (*R).org += u->len; + u = u->next; + } + if (__ISP(u, Texts_ElemDesc, 1)) { + un = u->next; + (*R).run = un; + (*R).org += 1; + (*R).off = 0; + (*R).fnt = u->fnt; + (*R).col = u->col; + (*R).voff = u->voff; + (*R).elem = __GUARDP(u, Texts_ElemDesc, 1); + if (__ISP(un, Texts_PieceDesc, 1)) { + if (__ISP(un, Texts_PieceDesc, 1)) { + Files_Set(&(*R).rider, Files_Rider__typ, ((Texts_Piece)un)->file, ((Texts_Piece)un)->org); + } else __WITHCHK; + } + } else { + (*R).eot = 1; + (*R).elem = NIL; + } +} + +void Texts_ReadPrevElem (Texts_Reader *R, LONGINT *R__typ) +{ + Texts_Run u = NIL; + u = (*R).run->prev; + while (__ISP(u, Texts_PieceDesc, 1)) { + (*R).org -= u->len; + u = u->prev; + } + if (__ISP(u, Texts_ElemDesc, 1)) { + (*R).run = u; + (*R).org -= 1; + (*R).off = 0; + (*R).fnt = u->fnt; + (*R).col = u->col; + (*R).voff = u->voff; + (*R).elem = __GUARDP(u, Texts_ElemDesc, 1); + } else { + (*R).eot = 1; + (*R).elem = NIL; + } +} + +LONGINT Texts_Pos (Texts_Reader *R, LONGINT *R__typ) +{ + LONGINT _o_result; + _o_result = (*R).org + (*R).off; + return _o_result; +} + +void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, LONGINT pos) +{ + Texts_OpenReader((void*)&*S, S__typ, T, pos); + (*S).line = 0; + (*S).nextCh = ' '; +} + +static struct Scan__31 { + Texts_Scanner *S; + LONGINT *S__typ; + CHAR *ch; + BOOLEAN *negE; + INTEGER *e; + struct Scan__31 *lnk; +} *Scan__31_s; + +static void ReadScaleFactor__32 (void); + +static void ReadScaleFactor__32 (void) +{ + Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); + if (*Scan__31_s->ch == '-') { + *Scan__31_s->negE = 1; + Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); + } else { + *Scan__31_s->negE = 0; + if (*Scan__31_s->ch == '+') { + Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); + } + } + while (('0' <= *Scan__31_s->ch && *Scan__31_s->ch <= '9')) { + *Scan__31_s->e = (*Scan__31_s->e * 10 + (int)*Scan__31_s->ch) - 48; + Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); + } +} + +void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) +{ + CHAR ch, term; + BOOLEAN neg, negE, hex; + SHORTINT i, j, h; + INTEGER e; + LONGINT k; + REAL x, f; + LONGREAL y, g; + CHAR d[32]; + struct Scan__31 _s; + _s.S = S; _s.S__typ = S__typ; + _s.ch = &ch; + _s.negE = &negE; + _s.e = &e; + _s.lnk = Scan__31_s; + Scan__31_s = &_s; + ch = (*S).nextCh; + i = 0; + for (;;) { + if (ch == 0x0d) { + (*S).line += 1; + } else if ((ch != ' ' && ch != 0x09)) { + break; + } + Texts_Read((void*)&*S, S__typ, &ch); + } + if ((('A' <= __CAP(ch) && __CAP(ch) <= 'Z') || ch == '/') || ch == '.') { + do { + (*S).s[__X(i, ((LONGINT)(64)))] = ch; + i += 1; + Texts_Read((void*)&*S, S__typ, &ch); + } while (!((((__CAP(ch) > 'Z' && ch != '_') || ('A' > __CAP(ch) && ch > '9')) || ((('0' > ch && ch != '.')) && ch != '/')) || i == 63)); + (*S).s[__X(i, ((LONGINT)(64)))] = 0x00; + (*S).len = i; + (*S).class = 1; + } else if (ch == '\"') { + Texts_Read((void*)&*S, S__typ, &ch); + while ((((ch != '\"' && ch >= ' ')) && i != 63)) { + (*S).s[__X(i, ((LONGINT)(64)))] = ch; + i += 1; + Texts_Read((void*)&*S, S__typ, &ch); + } + (*S).s[__X(i, ((LONGINT)(64)))] = 0x00; + (*S).len = i + 1; + Texts_Read((void*)&*S, S__typ, &ch); + (*S).class = 2; + } else { + if (ch == '-') { + neg = 1; + Texts_Read((void*)&*S, S__typ, &ch); + } else { + neg = 0; + } + if (('0' <= ch && ch <= '9')) { + hex = 0; + j = 0; + for (;;) { + d[__X(i, ((LONGINT)(32)))] = ch; + i += 1; + Texts_Read((void*)&*S, S__typ, &ch); + if (ch < '0') { + break; + } + if ('9' < ch) { + if (('A' <= ch && ch <= 'F')) { + hex = 1; + ch = (CHAR)((int)ch - 7); + } else if (('a' <= ch && ch <= 'f')) { + hex = 1; + ch = (CHAR)((int)ch - 39); + } else { + break; + } + } + } + if (ch == 'H') { + Texts_Read((void*)&*S, S__typ, &ch); + (*S).class = 3; + if (i - j > 8) { + j = i - 8; + } + k = (int)d[__X(j, ((LONGINT)(32)))] - 48; + j += 1; + if ((i - j == 7 && k >= 8)) { + k -= 16; + } + while (j < i) { + k = __ASHL(k, 4) + (LONGINT)((int)d[__X(j, ((LONGINT)(32)))] - 48); + j += 1; + } + if (neg) { + (*S).i = -k; + } else { + (*S).i = k; + } + } else if (ch == '.') { + Texts_Read((void*)&*S, S__typ, &ch); + h = i; + while (('0' <= ch && ch <= '9')) { + d[__X(i, ((LONGINT)(32)))] = ch; + i += 1; + Texts_Read((void*)&*S, S__typ, &ch); + } + if (ch == 'D') { + e = 0; + y = (LONGREAL)0; + g = (LONGREAL)1; + do { + y = y * (LONGREAL)10 + ((int)d[__X(j, ((LONGINT)(32)))] - 48); + j += 1; + } while (!(j == h)); + while (j < i) { + g = g / (LONGREAL)(LONGREAL)10; + y = ((int)d[__X(j, ((LONGINT)(32)))] - 48) * g + y; + j += 1; + } + ReadScaleFactor__32(); + if (negE) { + if (e <= 308) { + y = y / (LONGREAL)Reals_TenL(e); + } else { + y = (LONGREAL)0; + } + } else if (e > 0) { + if (e <= 308) { + y = Reals_TenL(e) * y; + } else { + __HALT(40); + } + } + if (neg) { + y = -y; + } + (*S).class = 5; + (*S).y = y; + } else { + e = 0; + x = (REAL)0; + f = (REAL)1; + do { + x = x * (REAL)10 + ((int)d[__X(j, ((LONGINT)(32)))] - 48); + j += 1; + } while (!(j == h)); + while (j < i) { + f = f / (REAL)(REAL)10; + x = ((int)d[__X(j, ((LONGINT)(32)))] - 48) * f + x; + j += 1; + } + if (ch == 'E') { + ReadScaleFactor__32(); + } + if (negE) { + if (e <= 38) { + x = x / (REAL)Reals_Ten(e); + } else { + x = (REAL)0; + } + } else if (e > 0) { + if (e <= 38) { + x = Reals_Ten(e) * x; + } else { + __HALT(40); + } + } + if (neg) { + x = -x; + } + (*S).class = 4; + (*S).x = x; + } + if (hex) { + (*S).class = 0; + } + } else { + (*S).class = 3; + k = 0; + do { + k = k * 10 + (LONGINT)((int)d[__X(j, ((LONGINT)(32)))] - 48); + j += 1; + } while (!(j == i)); + if (neg) { + (*S).i = -k; + } else { + (*S).i = k; + } + if (hex) { + (*S).class = 0; + } else { + (*S).class = 3; + } + } + } else { + (*S).class = 6; + if (neg) { + (*S).c = '-'; + } else { + (*S).c = ch; + Texts_Read((void*)&*S, S__typ, &ch); + } + } + } + (*S).nextCh = ch; + Scan__31_s = _s.lnk; +} + +void Texts_OpenWriter (Texts_Writer *W, LONGINT *W__typ) +{ + __NEW((*W).buf, Texts_BufDesc); + Texts_OpenBuf((*W).buf); + (*W).fnt = Texts_FontsDefault; + (*W).col = 15; + (*W).voff = 0; + (*W).file = Files_New((CHAR*)"", (LONGINT)1); + Files_Set(&(*W).rider, Files_Rider__typ, (*W).file, ((LONGINT)(0))); +} + +void Texts_SetFont (Texts_Writer *W, LONGINT *W__typ, Texts_FontsFont fnt) +{ + (*W).fnt = fnt; +} + +void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, SHORTINT col) +{ + (*W).col = col; +} + +void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, SHORTINT voff) +{ + (*W).voff = voff; +} + +void Texts_Write (Texts_Writer *W, LONGINT *W__typ, CHAR ch) +{ + Texts_Run u = NIL, un = NIL; + Texts_Piece p = NIL; + Files_Write(&(*W).rider, Files_Rider__typ, ch); + (*W).buf->len += 1; + un = (*W).buf->head; + u = un->prev; + if ((((((((((__ISP(u, Texts_PieceDesc, 1) && __GUARDP(u, Texts_PieceDesc, 1)->file == (*W).file)) && __STRCMP(u->fnt->name, (*W).fnt->name) == 0)) && u->col == (*W).col)) && u->voff == (*W).voff)) && !__GUARDP(u, Texts_PieceDesc, 1)->ascii)) { + u->len += 1; + } else { + __NEW(p, Texts_PieceDesc); + u->next = (Texts_Run)p; + p->prev = u; + p->next = un; + un->prev = (Texts_Run)p; + p->len = 1; + p->fnt = (*W).fnt; + p->col = (*W).col; + p->voff = (*W).voff; + p->file = (*W).file; + p->org = Files_Length((*W).file) - 1; + p->ascii = 0; + } +} + +void Texts_WriteElem (Texts_Writer *W, LONGINT *W__typ, Texts_Elem e) +{ + Texts_Run u = NIL, un = NIL; + if (e->base != NIL) { + __HALT(99); + } + (*W).buf->len += 1; + e->len = 1; + e->fnt = (*W).fnt; + e->col = (*W).col; + e->voff = (*W).voff; + un = (*W).buf->head; + u = un->prev; + u->next = (Texts_Run)e; + e->prev = u; + e->next = un; + un->prev = (Texts_Run)e; +} + +void Texts_WriteLn (Texts_Writer *W, LONGINT *W__typ) +{ + Texts_Write(&*W, W__typ, 0x0d); +} + +void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__len) +{ + INTEGER i; + __DUP(s, s__len, CHAR); + i = 0; + while (s[__X(i, s__len)] >= ' ') { + Texts_Write(&*W, W__typ, s[__X(i, s__len)]); + i += 1; + } + __DEL(s); +} + +void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n) +{ + INTEGER i; + LONGINT x0; + CHAR a[22]; + i = 0; + if (x < 0) { + if (x == (-9223372036854775807-1)) { + Texts_WriteString(&*W, W__typ, (CHAR*)" -9223372036854775808", (LONGINT)22); + return; + } else { + n -= 1; + x0 = -x; + } + } else { + x0 = x; + } + do { + a[__X(i, ((LONGINT)(22)))] = (CHAR)(__MOD(x0, 10) + 48); + x0 = __DIV(x0, 10); + i += 1; + } while (!(x0 == 0)); + while (n > (LONGINT)i) { + Texts_Write(&*W, W__typ, ' '); + n -= 1; + } + if (x < 0) { + Texts_Write(&*W, W__typ, '-'); + } + do { + i -= 1; + Texts_Write(&*W, W__typ, a[__X(i, ((LONGINT)(22)))]); + } while (!(i == 0)); +} + +void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, LONGINT x) +{ + INTEGER i; + LONGINT y; + CHAR a[20]; + i = 0; + Texts_Write(&*W, W__typ, ' '); + do { + y = __MASK(x, -16); + if (y < 10) { + a[__X(i, ((LONGINT)(20)))] = (CHAR)(y + 48); + } else { + a[__X(i, ((LONGINT)(20)))] = (CHAR)(y + 55); + } + x = __ASHR(x, 4); + i += 1; + } while (!(i == 8)); + do { + i -= 1; + Texts_Write(&*W, W__typ, a[__X(i, ((LONGINT)(20)))]); + } while (!(i == 0)); +} + +void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n) +{ + INTEGER e; + REAL x0; + CHAR d[9]; + e = Reals_Expo(x); + if (e == 0) { + Texts_WriteString(&*W, W__typ, (CHAR*)" 0", (LONGINT)4); + do { + Texts_Write(&*W, W__typ, ' '); + n -= 1; + } while (!(n <= 3)); + } else if (e == 255) { + Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", (LONGINT)5); + while (n > 4) { + Texts_Write(&*W, W__typ, ' '); + n -= 1; + } + } else { + if (n <= 9) { + n = 3; + } else { + n -= 6; + } + do { + Texts_Write(&*W, W__typ, ' '); + n -= 1; + } while (!(n <= 8)); + if (x < (REAL)0) { + Texts_Write(&*W, W__typ, '-'); + x = -x; + } else { + Texts_Write(&*W, W__typ, ' '); + } + e = __ASHR((e - 127) * 77, 8); + if (e >= 0) { + x = x / (REAL)Reals_Ten(e); + } else { + x = Reals_Ten(-e) * x; + } + if (x >= (REAL)10) { + x = 1.0000000e-001 * x; + e += 1; + } + x0 = Reals_Ten(n - 1); + x = x0 * x + 5.0000000e-001; + if (x >= (REAL)10 * x0) { + x = x * 1.0000000e-001; + e += 1; + } + Reals_Convert(x, n, (void*)d, ((LONGINT)(9))); + n -= 1; + Texts_Write(&*W, W__typ, d[__X(n, ((LONGINT)(9)))]); + Texts_Write(&*W, W__typ, '.'); + do { + n -= 1; + Texts_Write(&*W, W__typ, d[__X(n, ((LONGINT)(9)))]); + } while (!(n == 0)); + Texts_Write(&*W, W__typ, 'E'); + if (e < 0) { + Texts_Write(&*W, W__typ, '-'); + e = -e; + } else { + Texts_Write(&*W, W__typ, '+'); + } + Texts_Write(&*W, W__typ, (CHAR)(__DIV(e, 10) + 48)); + Texts_Write(&*W, W__typ, (CHAR)((int)__MOD(e, 10) + 48)); + } +} + +static struct WriteRealFix__53 { + Texts_Writer *W; + LONGINT *W__typ; + INTEGER *i; + CHAR (*d)[9]; + struct WriteRealFix__53 *lnk; +} *WriteRealFix__53_s; + +static void dig__54 (INTEGER n); +static void seq__56 (CHAR ch, INTEGER n); + +static void seq__56 (CHAR ch, INTEGER n) +{ + while (n > 0) { + Texts_Write(&*WriteRealFix__53_s->W, WriteRealFix__53_s->W__typ, ch); + n -= 1; + } +} + +static void dig__54 (INTEGER n) +{ + while (n > 0) { + *WriteRealFix__53_s->i -= 1; + Texts_Write(&*WriteRealFix__53_s->W, WriteRealFix__53_s->W__typ, (*WriteRealFix__53_s->d)[__X(*WriteRealFix__53_s->i, ((LONGINT)(9)))]); + n -= 1; + } +} + +void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n, INTEGER k) +{ + INTEGER e, i; + CHAR sign; + REAL x0; + CHAR d[9]; + struct WriteRealFix__53 _s; + _s.W = W; _s.W__typ = W__typ; + _s.i = &i; + _s.d = (void*)d; + _s.lnk = WriteRealFix__53_s; + WriteRealFix__53_s = &_s; + e = Reals_Expo(x); + if (k < 0) { + k = 0; + } + if (e == 0) { + seq__56(' ', (n - k) - 2); + Texts_Write(&*W, W__typ, '0'); + seq__56(' ', k + 1); + } else if (e == 255) { + Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", (LONGINT)5); + seq__56(' ', n - 4); + } else { + e = __ASHR((e - 127) * 77, 8); + if (x < (REAL)0) { + sign = '-'; + x = -x; + } else { + sign = ' '; + } + if (e >= 0) { + x = x / (REAL)Reals_Ten(e); + } else { + x = Reals_Ten(-e) * x; + } + if (x >= (REAL)10) { + x = 1.0000000e-001 * x; + e += 1; + } + if (k + e >= 8) { + k = 8 - e; + } else if (k + e < 0) { + k = -e; + x = (REAL)0; + } + x0 = Reals_Ten(k + e); + x = x0 * x + 5.0000000e-001; + if (x >= (REAL)10 * x0) { + e += 1; + } + e += 1; + i = k + e; + Reals_Convert(x, i, (void*)d, ((LONGINT)(9))); + if (e > 0) { + seq__56(' ', ((n - e) - k) - 2); + Texts_Write(&*W, W__typ, sign); + dig__54(e); + Texts_Write(&*W, W__typ, '.'); + dig__54(k); + } else { + seq__56(' ', (n - k) - 3); + Texts_Write(&*W, W__typ, sign); + Texts_Write(&*W, W__typ, '0'); + Texts_Write(&*W, W__typ, '.'); + seq__56('0', -e); + dig__54(k + e); + } + } + WriteRealFix__53_s = _s.lnk; +} + +void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x) +{ + INTEGER i; + CHAR d[8]; + Reals_ConvertH(x, (void*)d, ((LONGINT)(8))); + i = 0; + do { + Texts_Write(&*W, W__typ, d[__X(i, ((LONGINT)(8)))]); + i += 1; + } while (!(i == 8)); +} + +void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER n) +{ + INTEGER e; + LONGREAL x0; + CHAR d[16]; + e = Reals_ExpoL(x); + if (e == 0) { + Texts_WriteString(&*W, W__typ, (CHAR*)" 0", (LONGINT)4); + do { + Texts_Write(&*W, W__typ, ' '); + n -= 1; + } while (!(n <= 3)); + } else if (e == 2047) { + Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", (LONGINT)5); + while (n > 4) { + Texts_Write(&*W, W__typ, ' '); + n -= 1; + } + } else { + if (n <= 10) { + n = 3; + } else { + n -= 7; + } + do { + Texts_Write(&*W, W__typ, ' '); + n -= 1; + } while (!(n <= 16)); + if (x < (LONGREAL)0) { + Texts_Write(&*W, W__typ, '-'); + x = -x; + } else { + Texts_Write(&*W, W__typ, ' '); + } + e = (int)__ASHR((LONGINT)(e - 1023) * 77, 8); + if (e >= 0) { + x = x / (LONGREAL)Reals_TenL(e); + } else { + x = Reals_TenL(-e) * x; + } + if (x >= (LONGREAL)10) { + x = 1.00000000000000e-001 * x; + e += 1; + } + x0 = Reals_TenL(n - 1); + x = x0 * x + 5.00000000000000e-001; + if (x >= (LONGREAL)10 * x0) { + x = 1.00000000000000e-001 * x; + e += 1; + } + Reals_ConvertL(x, n, (void*)d, ((LONGINT)(16))); + n -= 1; + Texts_Write(&*W, W__typ, d[__X(n, ((LONGINT)(16)))]); + Texts_Write(&*W, W__typ, '.'); + do { + n -= 1; + Texts_Write(&*W, W__typ, d[__X(n, ((LONGINT)(16)))]); + } while (!(n == 0)); + Texts_Write(&*W, W__typ, 'D'); + if (e < 0) { + Texts_Write(&*W, W__typ, '-'); + e = -e; + } else { + Texts_Write(&*W, W__typ, '+'); + } + Texts_Write(&*W, W__typ, (CHAR)(__DIV(e, 100) + 48)); + e = (int)__MOD(e, 100); + Texts_Write(&*W, W__typ, (CHAR)(__DIV(e, 10) + 48)); + Texts_Write(&*W, W__typ, (CHAR)((int)__MOD(e, 10) + 48)); + } +} + +void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x) +{ + INTEGER i; + CHAR d[16]; + Reals_ConvertHL(x, (void*)d, ((LONGINT)(16))); + i = 0; + do { + Texts_Write(&*W, W__typ, d[__X(i, ((LONGINT)(16)))]); + i += 1; + } while (!(i == 16)); +} + +static struct WriteDate__43 { + Texts_Writer *W; + LONGINT *W__typ; + struct WriteDate__43 *lnk; +} *WriteDate__43_s; + +static void WritePair__44 (CHAR ch, LONGINT x); + +static void WritePair__44 (CHAR ch, LONGINT x) +{ + Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, ch); + Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)(__DIV(x, 10) + 48)); + Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)(__MOD(x, 10) + 48)); +} + +void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, LONGINT t, LONGINT d) +{ + struct WriteDate__43 _s; + _s.W = W; _s.W__typ = W__typ; + _s.lnk = WriteDate__43_s; + WriteDate__43_s = &_s; + WritePair__44(' ', __MASK(d, -32)); + WritePair__44('.', __MASK(__ASHR(d, 5), -16)); + WritePair__44('.', __MASK(__ASHR(d, 9), -128)); + WritePair__44(' ', __MASK(__ASHR(t, 12), -32)); + WritePair__44(':', __MASK(__ASHR(t, 6), -64)); + WritePair__44(':', __MASK(t, -64)); + WriteDate__43_s = _s.lnk; +} + +static struct Load0__16 { + Texts_Text *T; + SHORTINT *ecnt; + Files_File *f; + Texts_FileMsg *msg; + CHAR (*mods)[64][32], (*procs)[64][32]; + struct Load0__16 *lnk; +} *Load0__16_s; + +static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, LONGINT span, Texts_Elem *e); + +static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, LONGINT span, Texts_Elem *e) +{ + Modules_Module M = NIL; + Modules_Command Cmd; + Texts_Alien a = NIL; + LONGINT org, ew, eh; + SHORTINT eno; + Texts_new = NIL; + Files_ReadLInt(&*r, r__typ, &ew); + Files_ReadLInt(&*r, r__typ, &eh); + Files_Read(&*r, r__typ, (void*)&eno); + if (eno > *Load0__16_s->ecnt) { + *Load0__16_s->ecnt = eno; + Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->mods)[__X(eno, ((LONGINT)(64)))], ((LONGINT)(32))); + Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->procs)[__X(eno, ((LONGINT)(64)))], ((LONGINT)(32))); + } + org = Files_Pos(&*r, r__typ); + M = Modules_ThisMod((*Load0__16_s->mods)[__X(eno, ((LONGINT)(64)))], ((LONGINT)(32))); + if (M != NIL) { + Cmd = Modules_ThisCommand(M, (*Load0__16_s->procs)[__X(eno, ((LONGINT)(64)))], ((LONGINT)(32))); + if (Cmd != NIL) { + (*Cmd)(); + } + } + *e = Texts_new; + if (*e != NIL) { + (*e)->W = ew; + (*e)->H = eh; + (*e)->base = *Load0__16_s->T; + (*Load0__16_s->msg).pos = pos; + (*(*e)->handle)(*e, (void*)&*Load0__16_s->msg, Texts_FileMsg__typ); + if (Files_Pos(&*r, r__typ) != org + span) { + *e = NIL; + } + } + if (*e == NIL) { + Files_Set(&*r, r__typ, *Load0__16_s->f, org + span); + __NEW(a, Texts__1); + a->W = ew; + a->H = eh; + a->handle = Texts_HandleAlien; + a->base = *Load0__16_s->T; + a->file = *Load0__16_s->f; + a->org = org; + a->span = span; + __COPY((*Load0__16_s->mods)[__X(eno, ((LONGINT)(64)))], a->mod, ((LONGINT)(32))); + __COPY((*Load0__16_s->procs)[__X(eno, ((LONGINT)(64)))], a->proc, ((LONGINT)(32))); + *e = (Texts_Elem)a; + } +} + +static void Texts_Load0 (Files_Rider *r, LONGINT *r__typ, Texts_Text T) +{ + Texts_Run u = NIL, un = NIL; + Texts_Piece p = NIL; + Texts_Elem e = NIL; + LONGINT org, pos, hlen, plen; + SHORTINT ecnt, fno, fcnt, col, voff; + Files_File f = NIL; + Texts_FileMsg msg; + CHAR mods[64][32], procs[64][32]; + CHAR name[32]; + Texts_FontsFont fnts[32]; + struct Load0__16 _s; + _s.T = &T; + _s.ecnt = &ecnt; + _s.f = &f; + _s.msg = &msg; + _s.mods = (void*)mods; + _s.procs = (void*)procs; + _s.lnk = Load0__16_s; + Load0__16_s = &_s; + pos = Files_Pos(&*r, r__typ); + f = Files_Base(&*r, r__typ); + __NEW(u, Texts_RunDesc); + u->len = 9223372036854775807; + u->fnt = NIL; + u->col = 15; + T->head = u; + ecnt = 0; + fcnt = 0; + msg.id = 0; + msg.r = *r; + Files_ReadLInt(&msg.r, Files_Rider__typ, &hlen); + org = (pos - 2) + hlen; + pos = org; + Files_Read(&msg.r, Files_Rider__typ, (void*)&fno); + while (fno != 0) { + if (fno > fcnt) { + fcnt = fno; + Files_ReadString(&msg.r, Files_Rider__typ, (void*)name, ((LONGINT)(32))); + fnts[__X(fno, ((LONGINT)(32)))] = Texts_FontsThis((void*)name, ((LONGINT)(32))); + } + Files_Read(&msg.r, Files_Rider__typ, (void*)&col); + Files_Read(&msg.r, Files_Rider__typ, (void*)&voff); + Files_ReadLInt(&msg.r, Files_Rider__typ, &plen); + if (plen > 0) { + __NEW(p, Texts_PieceDesc); + p->file = f; + p->org = pos; + p->ascii = 0; + un = (Texts_Run)p; + un->len = plen; + } else { + LoadElem__17(&msg.r, Files_Rider__typ, pos - org, -plen, &e); + un = (Texts_Run)e; + un->len = 1; + } + un->col = col; + un->voff = voff; + pos += un->len; + u->next = un; + un->prev = u; + u = un; + Files_Read(&msg.r, Files_Rider__typ, (void*)&fno); + } + u->next = T->head; + T->head->prev = u; + T->cache = T->head; + T->corg = 0; + Files_ReadLInt(&msg.r, Files_Rider__typ, &T->len); + Files_Set(&*r, r__typ, f, Files_Pos(&msg.r, Files_Rider__typ) + T->len); + Load0__16_s = _s.lnk; +} + +void Texts_Load (Files_Rider *r, LONGINT *r__typ, Texts_Text T) +{ + INTEGER tag; + Files_ReadInt(&*r, r__typ, &tag); + if (tag != -4095) { + Files_Set(&*r, r__typ, Files_Base(&*r, r__typ), Files_Pos(&*r, r__typ) - 2); + } + Texts_Load0(&*r, r__typ, T); +} + +void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len) +{ + Files_File f = NIL; + Files_Rider r; + Texts_Run u = NIL; + Texts_Piece p = NIL; + CHAR tag, version; + LONGINT hlen; + __DUP(name, name__len, CHAR); + f = Files_Old(name, name__len); + if (f == NIL) { + f = Files_New((CHAR*)"", (LONGINT)1); + } + Files_Set(&r, Files_Rider__typ, f, ((LONGINT)(0))); + Files_Read(&r, Files_Rider__typ, (void*)&tag); + Files_Read(&r, Files_Rider__typ, (void*)&version); + if (tag == 0xf0 || (tag == 0x01 && version == 0xf0)) { + Texts_Load0(&r, Files_Rider__typ, T); + } else { + __NEW(u, Texts_RunDesc); + u->len = 9223372036854775807; + u->fnt = NIL; + u->col = 15; + __NEW(p, Texts_PieceDesc); + if ((tag == 0xf7 && version == 0x07)) { + Files_Set(&r, Files_Rider__typ, f, ((LONGINT)(28))); + Files_ReadLInt(&r, Files_Rider__typ, &hlen); + Files_Set(&r, Files_Rider__typ, f, 22 + hlen); + Files_ReadLInt(&r, Files_Rider__typ, &T->len); + p->org = 26 + hlen; + } else { + T->len = Files_Length(f); + p->org = 0; + } + if (T->len > 0) { + p->len = T->len; + p->fnt = Texts_FontsDefault; + p->col = 15; + p->voff = 0; + p->file = f; + p->ascii = 1; + u->next = (Texts_Run)p; + u->prev = (Texts_Run)p; + p->next = u; + p->prev = u; + } else { + u->next = u; + u->prev = u; + } + T->head = u; + T->cache = T->head; + T->corg = 0; + } + __DEL(name); +} + +static struct Store__39 { + SHORTINT *ecnt; + Texts_FileMsg *msg; + Texts_IdentifyMsg *iden; + CHAR (*mods)[64][32], (*procs)[64][32]; + struct Store__39 *lnk; +} *Store__39_s; + +static void StoreElem__40 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, Texts_Elem e); + +static void StoreElem__40 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, Texts_Elem e) +{ + Files_Rider r1; + LONGINT org, span; + SHORTINT eno; + __COPY((*Store__39_s->iden).mod, (*Store__39_s->mods)[__X(*Store__39_s->ecnt, ((LONGINT)(64)))], ((LONGINT)(32))); + __COPY((*Store__39_s->iden).proc, (*Store__39_s->procs)[__X(*Store__39_s->ecnt, ((LONGINT)(64)))], ((LONGINT)(32))); + eno = 1; + while (__STRCMP((*Store__39_s->mods)[__X(eno, ((LONGINT)(64)))], (*Store__39_s->iden).mod) != 0 || __STRCMP((*Store__39_s->procs)[__X(eno, ((LONGINT)(64)))], (*Store__39_s->iden).proc) != 0) { + eno += 1; + } + Files_Set(&r1, Files_Rider__typ, Files_Base(&*r, r__typ), Files_Pos(&*r, r__typ)); + Files_WriteLInt(&*r, r__typ, ((LONGINT)(0))); + Files_WriteLInt(&*r, r__typ, ((LONGINT)(0))); + Files_WriteLInt(&*r, r__typ, ((LONGINT)(0))); + Files_Write(&*r, r__typ, eno); + if (eno == *Store__39_s->ecnt) { + *Store__39_s->ecnt += 1; + Files_WriteString(&*r, r__typ, (*Store__39_s->iden).mod, ((LONGINT)(32))); + Files_WriteString(&*r, r__typ, (*Store__39_s->iden).proc, ((LONGINT)(32))); + } + (*Store__39_s->msg).pos = pos; + org = Files_Pos(&*r, r__typ); + (*e->handle)(e, (void*)&*Store__39_s->msg, Texts_FileMsg__typ); + span = Files_Pos(&*r, r__typ) - org; + Files_WriteLInt(&r1, Files_Rider__typ, -span); + Files_WriteLInt(&r1, Files_Rider__typ, e->W); + Files_WriteLInt(&r1, Files_Rider__typ, e->H); +} + +void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T) +{ + Files_Rider r1; + Texts_Run u = NIL, un = NIL; + Texts_Elem e = NIL; + LONGINT org, pos, delta, hlen, rlen; + SHORTINT ecnt, fno, fcnt; + CHAR ch; + Texts_FileMsg msg; + Texts_IdentifyMsg iden; + CHAR mods[64][32], procs[64][32]; + Texts_FontsFont fnts[32]; + CHAR block[1024]; + struct Store__39 _s; + _s.ecnt = &ecnt; + _s.msg = &msg; + _s.iden = &iden; + _s.mods = (void*)mods; + _s.procs = (void*)procs; + _s.lnk = Store__39_s; + Store__39_s = &_s; + org = Files_Pos(&*r, r__typ); + msg.id = 1; + msg.r = *r; + Files_WriteLInt(&msg.r, Files_Rider__typ, ((LONGINT)(0))); + u = T->head->next; + pos = 0; + delta = 0; + fcnt = 1; + ecnt = 1; + while (u != T->head) { + if (__ISP(u, Texts_ElemDesc, 1)) { + iden.mod[0] = 0x00; + (*__GUARDP(u, Texts_ElemDesc, 1)->handle)(__GUARDP(u, Texts_ElemDesc, 1), (void*)&iden, Texts_IdentifyMsg__typ); + } else { + iden.mod[0] = 0x01; + } + if (iden.mod[0] != 0x00) { + fnts[__X(fcnt, ((LONGINT)(32)))] = u->fnt; + fno = 1; + while (__STRCMP(fnts[__X(fno, ((LONGINT)(32)))]->name, u->fnt->name) != 0) { + fno += 1; + } + Files_Write(&msg.r, Files_Rider__typ, fno); + if (fno == fcnt) { + fcnt += 1; + Files_WriteString(&msg.r, Files_Rider__typ, u->fnt->name, ((LONGINT)(32))); + } + Files_Write(&msg.r, Files_Rider__typ, u->col); + Files_Write(&msg.r, Files_Rider__typ, u->voff); + } + if (__ISP(u, Texts_PieceDesc, 1)) { + rlen = u->len; + un = u->next; + while ((((((__ISP(un, Texts_PieceDesc, 1) && un->fnt == u->fnt)) && un->col == u->col)) && un->voff == u->voff)) { + rlen += un->len; + un = un->next; + } + Files_WriteLInt(&msg.r, Files_Rider__typ, rlen); + pos += rlen; + u = un; + } else if (iden.mod[0] != 0x00) { + StoreElem__40(&msg.r, Files_Rider__typ, pos, __GUARDP(u, Texts_ElemDesc, 1)); + pos += 1; + u = u->next; + } else { + delta += 1; + u = u->next; + } + } + Files_Write(&msg.r, Files_Rider__typ, 0); + Files_WriteLInt(&msg.r, Files_Rider__typ, T->len - delta); + hlen = (Files_Pos(&msg.r, Files_Rider__typ) - org) + 2; + Files_Set(&r1, Files_Rider__typ, Files_Base(&msg.r, Files_Rider__typ), org); + Files_WriteLInt(&r1, Files_Rider__typ, hlen); + u = T->head->next; + while (u != T->head) { + if (__ISP(u, Texts_PieceDesc, 1)) { + if (__ISP(u, Texts_PieceDesc, 1)) { + if (((Texts_Piece)u)->ascii) { + Files_Set(&r1, Files_Rider__typ, ((Texts_Piece)u)->file, ((Texts_Piece)u)->org); + delta = ((Texts_Piece)u)->len; + while (delta > 0) { + Files_Read(&r1, Files_Rider__typ, (void*)&ch); + delta -= 1; + if (ch == 0x0a) { + Files_Write(&msg.r, Files_Rider__typ, 0x0d); + } else { + Files_Write(&msg.r, Files_Rider__typ, ch); + } + } + } else { + Files_Set(&r1, Files_Rider__typ, ((Texts_Piece)u)->file, ((Texts_Piece)u)->org); + delta = ((Texts_Piece)u)->len; + while (delta > 1024) { + Files_ReadBytes(&r1, Files_Rider__typ, (void*)block, ((LONGINT)(1024)), ((LONGINT)(1024))); + Files_WriteBytes(&msg.r, Files_Rider__typ, (void*)block, ((LONGINT)(1024)), ((LONGINT)(1024))); + delta -= 1024; + } + Files_ReadBytes(&r1, Files_Rider__typ, (void*)block, ((LONGINT)(1024)), delta); + Files_WriteBytes(&msg.r, Files_Rider__typ, (void*)block, ((LONGINT)(1024)), delta); + } + } else __WITHCHK; + } else { + iden.mod[0] = 0x00; + (*__GUARDP(u, Texts_ElemDesc, 1)->handle)(__GUARDP(u, Texts_ElemDesc, 1), (void*)&iden, Texts_IdentifyMsg__typ); + if (iden.mod[0] != 0x00) { + Files_Write(&msg.r, Files_Rider__typ, 0x1c); + } + } + u = u->next; + } + __GUARDEQR(r, r__typ, Files_Rider) = msg.r; + if (T->notify != NIL) { + (*T->notify)(T, 3, ((LONGINT)(0)), ((LONGINT)(0))); + } + Store__39_s = _s.lnk; +} + +void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len) +{ + Files_File f = NIL; + Files_Rider r; + INTEGER i, res; + CHAR bak[64]; + __DUP(name, name__len, CHAR); + f = Files_New(name, name__len); + Files_Set(&r, Files_Rider__typ, f, ((LONGINT)(0))); + Files_Write(&r, Files_Rider__typ, 0xf0); + Files_Write(&r, Files_Rider__typ, 0x01); + Texts_Store(&r, Files_Rider__typ, T); + i = 0; + while (name[__X(i, name__len)] != 0x00) { + i += 1; + } + __COPY(name, bak, ((LONGINT)(64))); + bak[__X(i, ((LONGINT)(64)))] = '.'; + bak[__X(i + 1, ((LONGINT)(64)))] = 'B'; + bak[__X(i + 2, ((LONGINT)(64)))] = 'a'; + bak[__X(i + 3, ((LONGINT)(64)))] = 'k'; + bak[__X(i + 4, ((LONGINT)(64)))] = 0x00; + Files_Rename(name, name__len, bak, ((LONGINT)(64)), &res); + Files_Register(f); + __DEL(name); +} + +static void EnumPtrs(void (*P)(void*)) +{ + P(Texts_new); + P(Texts_del); + P(Texts_FontsDefault); +} + +__TDESC(Texts_FontDesc, 1, 0) = {__TDFLDS("FontDesc", 32), {-8}}; +__TDESC(Texts_RunDesc, 1, 3) = {__TDFLDS("RunDesc", 40), {0, 8, 24, -32}}; +__TDESC(Texts_PieceDesc, 1, 4) = {__TDFLDS("PieceDesc", 56), {0, 8, 24, 40, -40}}; +__TDESC(Texts_ElemMsg, 1, 0) = {__TDFLDS("ElemMsg", 1), {-8}}; +__TDESC(Texts_ElemDesc, 1, 4) = {__TDFLDS("ElemDesc", 72), {0, 8, 24, 64, -40}}; +__TDESC(Texts_FileMsg, 1, 1) = {__TDFLDS("FileMsg", 56), {32, -16}}; +__TDESC(Texts_CopyMsg, 1, 1) = {__TDFLDS("CopyMsg", 8), {0, -16}}; +__TDESC(Texts_IdentifyMsg, 1, 0) = {__TDFLDS("IdentifyMsg", 64), {-8}}; +__TDESC(Texts_BufDesc, 1, 1) = {__TDFLDS("BufDesc", 16), {8, -16}}; +__TDESC(Texts_TextDesc, 1, 2) = {__TDFLDS("TextDesc", 40), {16, 24, -24}}; +__TDESC(Texts_Reader, 1, 4) = {__TDFLDS("Reader", 96), {8, 24, 48, 72, -40}}; +__TDESC(Texts_Scanner, 1, 4) = {__TDFLDS("Scanner", 208), {8, 24, 48, 72, -40}}; +__TDESC(Texts_Writer, 1, 4) = {__TDFLDS("Writer", 72), {0, 8, 40, 64, -40}}; +__TDESC(Texts__1, 1, 5) = {__TDFLDS("", 160), {0, 8, 24, 64, 72, -48}}; + +export void *Texts__init(void) +{ + __DEFMOD; + __MODULE_IMPORT(Files); + __MODULE_IMPORT(Modules); + __MODULE_IMPORT(Reals); + __REGMOD("Texts", EnumPtrs); + __INITYP(Texts_FontDesc, Texts_FontDesc, 0); + __INITYP(Texts_RunDesc, Texts_RunDesc, 0); + __INITYP(Texts_PieceDesc, Texts_RunDesc, 1); + __INITYP(Texts_ElemMsg, Texts_ElemMsg, 0); + __INITYP(Texts_ElemDesc, Texts_RunDesc, 1); + __INITYP(Texts_FileMsg, Texts_ElemMsg, 1); + __INITYP(Texts_CopyMsg, Texts_ElemMsg, 1); + __INITYP(Texts_IdentifyMsg, Texts_ElemMsg, 1); + __INITYP(Texts_BufDesc, Texts_BufDesc, 0); + __INITYP(Texts_TextDesc, Texts_TextDesc, 0); + __INITYP(Texts_Reader, Texts_Reader, 0); + __INITYP(Texts_Scanner, Texts_Reader, 1); + __INITYP(Texts_Writer, Texts_Writer, 0); + __INITYP(Texts__1, Texts_ElemDesc, 2); +/* BEGIN */ + Texts_del = NIL; + __NEW(Texts_FontsDefault, Texts_FontDesc); + __MOVE("Syntax10.Scn.Fnt", Texts_FontsDefault->name, 17); + __ENDMOD; +} diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h new file mode 100644 index 00000000..d1805878 --- /dev/null +++ b/bootstrap/windows-88/Texts.h @@ -0,0 +1,173 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ + +#ifndef Texts__h +#define Texts__h + +#define LARGE +#include "SYSTEM.h" +#include "Files.h" + +typedef + struct Texts_BufDesc { + LONGINT len; + char _prvt0[8]; + } Texts_BufDesc; + +typedef + Texts_BufDesc *Texts_Buffer; + +typedef + struct Texts_ElemMsg { + char _prvt0[1]; + } Texts_ElemMsg; + +typedef + struct Texts_ElemDesc *Texts_Elem; + +typedef + struct Texts_CopyMsg { /* Texts_ElemMsg */ + Texts_Elem e; + } Texts_CopyMsg; + +typedef + struct Texts_RunDesc { + LONGINT _prvt0; + char _prvt1[27]; + } Texts_RunDesc; + +typedef + void (*Texts_Handler)(Texts_Elem, Texts_ElemMsg*, LONGINT *); + +typedef + struct Texts_ElemDesc { + char _prvt0[40]; + LONGINT W, H; + Texts_Handler handle; + char _prvt1[8]; + } Texts_ElemDesc; + +typedef + struct Texts_FileMsg { /* Texts_ElemMsg */ + INTEGER id; + LONGINT pos; + Files_Rider r; + } Texts_FileMsg; + +typedef + struct Texts_FontDesc { + char _prvt0[32]; + } Texts_FontDesc; + +typedef + Texts_FontDesc *Texts_FontsFont; + +typedef + struct Texts_IdentifyMsg { /* Texts_ElemMsg */ + CHAR mod[32], proc[32]; + } Texts_IdentifyMsg; + +typedef + struct Texts_TextDesc *Texts_Text; + +typedef + void (*Texts_Notifier)(Texts_Text, INTEGER, LONGINT, LONGINT); + +typedef + struct Texts_Reader { + BOOLEAN eot; + Texts_FontsFont fnt; + SHORTINT col, voff; + Texts_Elem elem; + char _prvt0[64]; + } Texts_Reader; + +typedef + struct Texts_Scanner { /* Texts_Reader */ + BOOLEAN eot; + Texts_FontsFont fnt; + SHORTINT col, voff; + Texts_Elem elem; + char _prvt0[64]; + CHAR nextCh; + INTEGER line, class; + LONGINT i; + REAL x; + LONGREAL y; + CHAR c; + SHORTINT len; + CHAR s[64]; + } Texts_Scanner; + +typedef + struct Texts_TextDesc { + LONGINT len; + Texts_Notifier notify; + char _prvt0[24]; + } Texts_TextDesc; + +typedef + struct Texts_Writer { + Texts_Buffer buf; + Texts_FontsFont fnt; + SHORTINT col, voff; + char _prvt0[54]; + } Texts_Writer; + + +import Texts_Elem Texts_new; + +import LONGINT *Texts_FontDesc__typ; +import LONGINT *Texts_RunDesc__typ; +import LONGINT *Texts_ElemMsg__typ; +import LONGINT *Texts_ElemDesc__typ; +import LONGINT *Texts_FileMsg__typ; +import LONGINT *Texts_CopyMsg__typ; +import LONGINT *Texts_IdentifyMsg__typ; +import LONGINT *Texts_BufDesc__typ; +import LONGINT *Texts_TextDesc__typ; +import LONGINT *Texts_Reader__typ; +import LONGINT *Texts_Scanner__typ; +import LONGINT *Texts_Writer__typ; + +import void Texts_Append (Texts_Text T, Texts_Buffer B); +import void Texts_ChangeLooks (Texts_Text T, LONGINT beg, LONGINT end, SET sel, Texts_FontsFont fnt, SHORTINT col, SHORTINT voff); +import void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len); +import void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); +import void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); +import void Texts_Delete (Texts_Text T, LONGINT beg, LONGINT end); +import Texts_Text Texts_ElemBase (Texts_Elem E); +import LONGINT Texts_ElemPos (Texts_Elem E); +import void Texts_Insert (Texts_Text T, LONGINT pos, Texts_Buffer B); +import void Texts_Load (Files_Rider *r, LONGINT *r__typ, Texts_Text T); +import void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len); +import void Texts_OpenBuf (Texts_Buffer B); +import void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, LONGINT pos); +import void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, LONGINT pos); +import void Texts_OpenWriter (Texts_Writer *W, LONGINT *W__typ); +import LONGINT Texts_Pos (Texts_Reader *R, LONGINT *R__typ); +import void Texts_Read (Texts_Reader *R, LONGINT *R__typ, CHAR *ch); +import void Texts_ReadElem (Texts_Reader *R, LONGINT *R__typ); +import void Texts_ReadPrevElem (Texts_Reader *R, LONGINT *R__typ); +import void Texts_Recall (Texts_Buffer *B); +import void Texts_Save (Texts_Text T, LONGINT beg, LONGINT end, Texts_Buffer B); +import void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ); +import void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, SHORTINT col); +import void Texts_SetFont (Texts_Writer *W, LONGINT *W__typ, Texts_FontsFont fnt); +import void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, SHORTINT voff); +import void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T); +import void Texts_Write (Texts_Writer *W, LONGINT *W__typ, CHAR ch); +import void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, LONGINT t, LONGINT d); +import void Texts_WriteElem (Texts_Writer *W, LONGINT *W__typ, Texts_Elem e); +import void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, LONGINT x); +import void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n); +import void Texts_WriteLn (Texts_Writer *W, LONGINT *W__typ); +import void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER n); +import void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x); +import void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n); +import void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n, INTEGER k); +import void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x); +import void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__len); +import void *Texts__init(void); + + +#endif diff --git a/bootstrap/windows-88/Vishap.c b/bootstrap/windows-88/Vishap.c new file mode 100644 index 00000000..d084e34a --- /dev/null +++ b/bootstrap/windows-88/Vishap.c @@ -0,0 +1,169 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkamSf */ +#define LARGE +#include "SYSTEM.h" +#include "Configuration.h" +#include "Heap.h" +#include "OPB.h" +#include "OPC.h" +#include "OPM.h" +#include "OPP.h" +#include "OPT.h" +#include "OPV.h" +#include "Platform.h" +#include "Strings.h" +#include "extTools.h" +#include "vt100.h" + + +static CHAR Vishap_mname[256]; + + +export void Vishap_Module (BOOLEAN *done); +static void Vishap_PropagateElementaryTypeSizes (void); +export void Vishap_Translate (void); +static void Vishap_Trap (INTEGER sig); + + +void Vishap_Module (BOOLEAN *done) +{ + BOOLEAN ext, new; + OPT_Node p = NIL; + OPP_Module(&p, OPM_opt); + if (OPM_noerr) { + OPV_Init(); + OPV_AdrAndSize(OPT_topScope); + OPT_Export(&ext, &new); + if (OPM_noerr) { + OPM_OpenFiles((void*)OPT_SelfName, ((LONGINT)(256))); + OPC_Init(); + OPV_Module(p); + if (OPM_noerr) { + if (((OPM_mainProg || OPM_mainLinkStat) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { + OPM_DeleteNewSym(); + if (!OPM_notColorOutput) { + vt100_SetAttr((CHAR*)"32m", (LONGINT)4); + } + OPM_LogWStr((CHAR*)" Main program.", (LONGINT)16); + if (!OPM_notColorOutput) { + vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + } + } else { + if (new) { + if (!OPM_notColorOutput) { + vt100_SetAttr((CHAR*)"32m", (LONGINT)4); + } + OPM_LogWStr((CHAR*)" New symbol file.", (LONGINT)19); + if (!OPM_notColorOutput) { + vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + } + OPM_RegisterNewSym(); + } else if (ext) { + OPM_LogWStr((CHAR*)" Extended symbol file.", (LONGINT)24); + OPM_RegisterNewSym(); + } + } + } else { + OPM_DeleteNewSym(); + } + } + } + OPM_CloseFiles(); + OPT_Close(); + OPM_LogWLn(); + *done = OPM_noerr; +} + +static void Vishap_PropagateElementaryTypeSizes (void) +{ + OPT_bytetyp->size = OPM_ByteSize; + OPT_sysptrtyp->size = OPM_PointerSize; + OPT_chartyp->size = OPM_CharSize; + OPT_settyp->size = OPM_SetSize; + OPT_realtyp->size = OPM_RealSize; + OPT_inttyp->size = OPM_IntSize; + OPT_linttyp->size = OPM_LIntSize; + OPT_lrltyp->size = OPM_LRealSize; + OPT_sinttyp->size = OPM_SIntSize; + OPT_booltyp->size = OPM_BoolSize; +} + +void Vishap_Translate (void) +{ + BOOLEAN done; + CHAR modulesobj[2048]; + modulesobj[0] = 0x00; + if (OPM_OpenPar()) { + for (;;) { + OPM_Init(&done, (void*)Vishap_mname, ((LONGINT)(256))); + if (!done) { + return; + } + OPM_InitOptions(); + Vishap_PropagateElementaryTypeSizes(); + Heap_GC(0); + Vishap_Module(&done); + if (!done) { + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Module compilation failed.", (LONGINT)27); + OPM_LogWLn(); + Platform_Exit(1); + } + if (!OPM_dontAsm) { + if (OPM_dontLink) { + extTools_Assemble(OPM_modName, ((LONGINT)(32))); + } else { + if (!(OPM_mainProg || OPM_mainLinkStat)) { + extTools_Assemble(OPM_modName, ((LONGINT)(32))); + Strings_Append((CHAR*)" ", (LONGINT)2, (void*)modulesobj, ((LONGINT)(2048))); + Strings_Append(OPM_modName, ((LONGINT)(32)), (void*)modulesobj, ((LONGINT)(2048))); + Strings_Append((CHAR*)".o", (LONGINT)3, (void*)modulesobj, ((LONGINT)(2048))); + } else { + extTools_LinkMain((void*)OPM_modName, ((LONGINT)(32)), OPM_mainLinkStat, modulesobj, ((LONGINT)(2048))); + } + } + } + } + } +} + +static void Vishap_Trap (INTEGER sig) +{ + Heap_FINALL(); + if (sig == 3) { + Platform_Exit(0); + } else { + if ((sig == 4 && Platform_HaltCode == -15)) { + OPM_LogWStr((CHAR*)" --- Vishap Oberon: internal error", (LONGINT)35); + OPM_LogWLn(); + } + Platform_Exit(2); + } +} + + +export int main(int argc, char **argv) +{ + __INIT(argc, argv); + __MODULE_IMPORT(Configuration); + __MODULE_IMPORT(Heap); + __MODULE_IMPORT(OPB); + __MODULE_IMPORT(OPC); + __MODULE_IMPORT(OPM); + __MODULE_IMPORT(OPP); + __MODULE_IMPORT(OPT); + __MODULE_IMPORT(OPV); + __MODULE_IMPORT(Platform); + __MODULE_IMPORT(Strings); + __MODULE_IMPORT(extTools); + __MODULE_IMPORT(vt100); + __REGMAIN("Vishap", 0); + __REGCMD("Translate", Vishap_Translate); +/* BEGIN */ + Platform_SetInterruptHandler(Vishap_Trap); + Platform_SetQuitHandler(Vishap_Trap); + Platform_SetBadInstructionHandler(Vishap_Trap); + OPB_typSize = OPV_TypSize; + OPT_typSize = OPV_TypSize; + Vishap_Translate(); + __FINI; +} diff --git a/bootstrap/windows-88/WindowsWrapper.h b/bootstrap/windows-88/WindowsWrapper.h new file mode 100644 index 00000000..cdb8714c --- /dev/null +++ b/bootstrap/windows-88/WindowsWrapper.h @@ -0,0 +1,9 @@ +// WindowsWrapper.h +// +// Includes Windows.h while avoiding conflicts with Oberon types. + +#undef BOOLEAN +#undef CHAR +#include +#define BOOLEAN char +#define CHAR unsigned char diff --git a/bootstrap/windows-88/errors.c b/bootstrap/windows-88/errors.c new file mode 100644 index 00000000..879f5cf7 --- /dev/null +++ b/bootstrap/windows-88/errors.c @@ -0,0 +1,199 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +#define LARGE +#include "SYSTEM.h" + +typedef + CHAR errors_string[128]; + + +export errors_string errors_errors[350]; + + + + + +export void *errors__init(void) +{ + __DEFMOD; + __REGMOD("errors", 0); +/* BEGIN */ + __MOVE("undeclared identifier", errors_errors[0], 22); + __MOVE("multiply defined identifier", errors_errors[1], 28); + __MOVE("illegal character in number", errors_errors[2], 28); + __MOVE("illegal character in string", errors_errors[3], 28); + __MOVE("identifier does not match procedure name", errors_errors[4], 41); + __MOVE("comment not closed", errors_errors[5], 19); + errors_errors[6][0] = 0x00; + errors_errors[7][0] = 0x00; + errors_errors[8][0] = 0x00; + __MOVE("\'=\' expected", errors_errors[9], 13); + errors_errors[10][0] = 0x00; + errors_errors[11][0] = 0x00; + __MOVE("type definition starts with incorrect symbol", errors_errors[12], 45); + __MOVE("factor starts with incorrect symbol", errors_errors[13], 36); + __MOVE("statement starts with incorrect symbol", errors_errors[14], 39); + __MOVE("declaration followed by incorrect symbol", errors_errors[15], 41); + __MOVE("MODULE expected", errors_errors[16], 16); + errors_errors[17][0] = 0x00; + __MOVE("\'.\' missing", errors_errors[18], 12); + __MOVE("\',\' missing", errors_errors[19], 12); + __MOVE("\':\' missing", errors_errors[20], 12); + errors_errors[21][0] = 0x00; + __MOVE("\')\' missing", errors_errors[22], 12); + __MOVE("\']\' missing", errors_errors[23], 12); + __MOVE("\'}\' missing", errors_errors[24], 12); + __MOVE("OF missing", errors_errors[25], 11); + __MOVE("THEN missing", errors_errors[26], 13); + __MOVE("DO missing", errors_errors[27], 11); + __MOVE("TO missing", errors_errors[28], 11); + errors_errors[29][0] = 0x00; + __MOVE("\'(\' missing", errors_errors[30], 12); + errors_errors[31][0] = 0x00; + errors_errors[32][0] = 0x00; + errors_errors[33][0] = 0x00; + __MOVE("\':=\' missing", errors_errors[34], 13); + __MOVE("\',\' or OF expected", errors_errors[35], 19); + errors_errors[36][0] = 0x00; + errors_errors[37][0] = 0x00; + __MOVE("identifier expected", errors_errors[38], 20); + __MOVE("\';\' missing", errors_errors[39], 12); + errors_errors[40][0] = 0x00; + __MOVE("END missing", errors_errors[41], 12); + errors_errors[42][0] = 0x00; + errors_errors[43][0] = 0x00; + __MOVE("UNTIL missing", errors_errors[44], 14); + errors_errors[45][0] = 0x00; + __MOVE("EXIT not within loop statement", errors_errors[46], 31); + __MOVE("illegally marked identifier", errors_errors[47], 28); + errors_errors[48][0] = 0x00; + errors_errors[49][0] = 0x00; + __MOVE("expression should be constant", errors_errors[50], 30); + __MOVE("constant not an integer", errors_errors[51], 24); + __MOVE("identifier does not denote a type", errors_errors[52], 34); + __MOVE("identifier does not denote a record type", errors_errors[53], 41); + __MOVE("result type of procedure is not a basic type", errors_errors[54], 45); + __MOVE("procedure call of a function", errors_errors[55], 29); + __MOVE("assignment to non-variable", errors_errors[56], 27); + __MOVE("pointer not bound to record or array type", errors_errors[57], 42); + __MOVE("recursive type definition", errors_errors[58], 26); + __MOVE("illegal open array parameter", errors_errors[59], 29); + __MOVE("wrong type of case label", errors_errors[60], 25); + __MOVE("inadmissible type of case label", errors_errors[61], 32); + __MOVE("case label defined more than once", errors_errors[62], 34); + __MOVE("illegal value of constant", errors_errors[63], 26); + __MOVE("more actual than formal parameters", errors_errors[64], 35); + __MOVE("fewer actual than formal parameters", errors_errors[65], 36); + __MOVE("element types of actual array and formal open array differ", errors_errors[66], 59); + __MOVE("actual parameter corresponding to open array is not an array", errors_errors[67], 61); + __MOVE("control variable must be integer", errors_errors[68], 33); + __MOVE("parameter must be an integer constant", errors_errors[69], 38); + __MOVE("pointer or VAR record required as formal receiver", errors_errors[70], 50); + __MOVE("pointer expected as actual receiver", errors_errors[71], 36); + __MOVE("procedure must be bound to a record of the same scope", errors_errors[72], 54); + __MOVE("procedure must have level 0", errors_errors[73], 28); + __MOVE("procedure unknown in base type", errors_errors[74], 31); + __MOVE("invalid call of base procedure", errors_errors[75], 31); + __MOVE("this variable (field) is read only", errors_errors[76], 35); + __MOVE("object is not a record", errors_errors[77], 23); + __MOVE("dereferenced object is not a variable", errors_errors[78], 38); + __MOVE("indexed object is not a variable", errors_errors[79], 33); + __MOVE("index expression is not an integer", errors_errors[80], 35); + __MOVE("index out of specified bounds", errors_errors[81], 30); + __MOVE("indexed variable is not an array", errors_errors[82], 33); + __MOVE("undefined record field", errors_errors[83], 23); + __MOVE("dereferenced variable is not a pointer", errors_errors[84], 39); + __MOVE("guard or test type is not an extension of variable type", errors_errors[85], 56); + __MOVE("guard or testtype is not a pointer", errors_errors[86], 35); + __MOVE("guarded or tested variable is neither a pointer nor a VAR-parameter record", errors_errors[87], 75); + __MOVE("open array not allowed as variable, record field or array element", errors_errors[88], 66); + errors_errors[89][0] = 0x00; + errors_errors[90][0] = 0x00; + errors_errors[91][0] = 0x00; + __MOVE("operand of IN not an integer, or not a set", errors_errors[92], 43); + __MOVE("set element type is not an integer", errors_errors[93], 35); + __MOVE("operand of & is not of type BOOLEAN", errors_errors[94], 36); + __MOVE("operand of OR is not of type BOOLEAN", errors_errors[95], 37); + __MOVE("operand not applicable to (unary) +", errors_errors[96], 36); + __MOVE("operand not applicable to (unary) -", errors_errors[97], 36); + __MOVE("operand of ~ is not of type BOOLEAN", errors_errors[98], 36); + __MOVE("ASSERT fault", errors_errors[99], 13); + __MOVE("incompatible operands of dyadic operator", errors_errors[100], 41); + __MOVE("operand type inapplicable to *", errors_errors[101], 31); + __MOVE("operand type inapplicable to /", errors_errors[102], 31); + __MOVE("operand type inapplicable to DIV", errors_errors[103], 33); + __MOVE("operand type inapplicable to MOD", errors_errors[104], 33); + __MOVE("operand type inapplicable to +", errors_errors[105], 31); + __MOVE("operand type inapplicable to -", errors_errors[106], 31); + __MOVE("operand type inapplicable to = or #", errors_errors[107], 36); + __MOVE("operand type inapplicable to relation", errors_errors[108], 38); + __MOVE("overriding method must be exported", errors_errors[109], 35); + __MOVE("operand is not a type", errors_errors[110], 22); + __MOVE("operand inapplicable to (this) function", errors_errors[111], 40); + __MOVE("operand is not a variable", errors_errors[112], 26); + __MOVE("incompatible assignment", errors_errors[113], 24); + __MOVE("string too long to be assigned", errors_errors[114], 31); + __MOVE("parameter doesn\'t match", errors_errors[115], 24); + __MOVE("number of parameters doesn\'t match", errors_errors[116], 35); + __MOVE("result type doesn\'t match", errors_errors[117], 26); + __MOVE("export mark doesn\'t match with forward declaration", errors_errors[118], 51); + __MOVE("redefinition textually precedes procedure bound to base type", errors_errors[119], 61); + __MOVE("type of expression following IF, WHILE, UNTIL or ASSERT is not BOOLEAN", errors_errors[120], 71); + __MOVE("called object is not a procedure (or is an interrupt procedure)", errors_errors[121], 64); + __MOVE("actual VAR-parameter is not a variable", errors_errors[122], 39); + __MOVE("type of actual parameter is not identical with that of formal VAR-parameter", errors_errors[123], 76); + __MOVE("type of result expression differs from that of procedure", errors_errors[124], 57); + __MOVE("type of case expression is neither INTEGER nor CHAR", errors_errors[125], 52); + __MOVE("this expression cannot be a type or a procedure", errors_errors[126], 48); + __MOVE("illegal use of object", errors_errors[127], 22); + __MOVE("unsatisfied forward reference", errors_errors[128], 30); + __MOVE("unsatisfied forward procedure", errors_errors[129], 30); + __MOVE("WITH clause does not specify a variable", errors_errors[130], 40); + __MOVE("LEN not applied to array", errors_errors[131], 25); + __MOVE("dimension in LEN too large or negative", errors_errors[132], 39); + __MOVE("SYSTEM not imported", errors_errors[135], 20); + __MOVE("key inconsistency of imported module", errors_errors[150], 37); + __MOVE("incorrect symbol file", errors_errors[151], 22); + __MOVE("symbol file of imported module not found", errors_errors[152], 41); + __MOVE("object or symbol file not opened (disk full\?)", errors_errors[153], 46); + __MOVE("recursive import not allowed", errors_errors[154], 29); + __MOVE("generation of new symbol file not allowed", errors_errors[155], 42); + __MOVE("parameter file not found", errors_errors[156], 25); + __MOVE("syntax error in parameter file", errors_errors[157], 31); + __MOVE("not yet implemented", errors_errors[200], 20); + __MOVE("lower bound of set range greater than higher bound", errors_errors[201], 51); + __MOVE("set element greater than MAX(SET) or less than 0", errors_errors[202], 49); + __MOVE("number too large", errors_errors[203], 17); + __MOVE("product too large", errors_errors[204], 18); + __MOVE("division by zero", errors_errors[205], 17); + __MOVE("sum too large", errors_errors[206], 14); + __MOVE("difference too large", errors_errors[207], 21); + __MOVE("overflow in arithmetic shift", errors_errors[208], 29); + __MOVE("case range too large", errors_errors[209], 21); + __MOVE("too many cases in case statement", errors_errors[213], 33); + __MOVE("illegal value of parameter (0 <= p < 256)", errors_errors[218], 42); + __MOVE("machine registers cannot be accessed", errors_errors[219], 37); + __MOVE("illegal value of parameter", errors_errors[220], 27); + __MOVE("too many pointers in a record", errors_errors[221], 30); + __MOVE("too many global pointers", errors_errors[222], 25); + __MOVE("too many record types", errors_errors[223], 22); + __MOVE("too many pointer types", errors_errors[224], 23); + __MOVE("address of pointer variable too large (move forward in text)", errors_errors[225], 61); + __MOVE("too many exported procedures", errors_errors[226], 29); + __MOVE("too many imported modules", errors_errors[227], 26); + __MOVE("too many exported structures", errors_errors[228], 29); + __MOVE("too many nested records for import", errors_errors[229], 35); + __MOVE("too many constants (strings) in module", errors_errors[230], 39); + __MOVE("too many link table entries (external procedures)", errors_errors[231], 50); + __MOVE("too many commands in module", errors_errors[232], 28); + __MOVE("record extension hierarchy too high", errors_errors[233], 36); + __MOVE("export of recursive type not allowed", errors_errors[234], 37); + __MOVE("identifier too long", errors_errors[240], 20); + __MOVE("string too long", errors_errors[241], 16); + __MOVE("address overflow", errors_errors[242], 17); + __MOVE("cyclic type definition not allowed", errors_errors[244], 35); + __MOVE("guarded pointer variable may be manipulated by non-local operations; use auxiliary pointer variable", errors_errors[245], 100); + __MOVE("implicit type cast", errors_errors[301], 19); + __MOVE("inappropriate symbol file ignored", errors_errors[306], 34); + __MOVE("no ELSE symbol after CASE statement sequence may lead to trap", errors_errors[307], 62); + __ENDMOD; +} diff --git a/bootstrap/windows-88/errors.h b/bootstrap/windows-88/errors.h new file mode 100644 index 00000000..43cd79a9 --- /dev/null +++ b/bootstrap/windows-88/errors.h @@ -0,0 +1,19 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ + +#ifndef errors__h +#define errors__h + +#define LARGE +#include "SYSTEM.h" + +typedef + CHAR errors_string[128]; + + +import errors_string errors_errors[350]; + + +import void *errors__init(void); + + +#endif diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c new file mode 100644 index 00000000..7d1a2da9 --- /dev/null +++ b/bootstrap/windows-88/extTools.c @@ -0,0 +1,113 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +#define LARGE +#include "SYSTEM.h" +#include "Configuration.h" +#include "Console.h" +#include "OPM.h" +#include "Platform.h" +#include "Strings.h" + + +static CHAR extTools_compilationOptions[1023], extTools_CFLAGS[1023]; + + +export void extTools_Assemble (CHAR *moduleName, LONGINT moduleName__len); +export void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN statically, CHAR *additionalopts, LONGINT additionalopts__len); +static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGINT cmd__len); + + +static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGINT cmd__len) +{ + INTEGER r, status, exitcode; + __DUP(title, title__len, CHAR); + __DUP(cmd, cmd__len, CHAR); + if (OPM_Verbose) { + Console_String(title, title__len); + Console_String(cmd, cmd__len); + Console_Ln(); + } + r = Platform_System(cmd, cmd__len); + status = __MASK(r, -128); + exitcode = __ASHR(r, 8); + if (exitcode > 127) { + exitcode = exitcode - 256; + } + if (r != 0) { + Console_String(title, title__len); + Console_String(cmd, cmd__len); + Console_Ln(); + Console_String((CHAR*)"-- failed: status ", (LONGINT)19); + Console_Int(status, ((LONGINT)(1))); + Console_String((CHAR*)", exitcode ", (LONGINT)12); + Console_Int(exitcode, ((LONGINT)(1))); + Console_String((CHAR*)".", (LONGINT)2); + Console_Ln(); + if ((status == 0 && exitcode == 127)) { + Console_String((CHAR*)"Is the C compiler in the current command path\?", (LONGINT)47); + Console_Ln(); + } + if (status != 0) { + Platform_Halt(status); + } else { + Platform_Halt(exitcode); + } + } + __DEL(title); + __DEL(cmd); +} + +void extTools_Assemble (CHAR *moduleName, LONGINT moduleName__len) +{ + CHAR cmd[1023]; + __DUP(moduleName, moduleName__len, CHAR); + __MOVE("gcc -g", cmd, 7); + Strings_Append(extTools_compilationOptions, ((LONGINT)(1023)), (void*)cmd, ((LONGINT)(1023))); + Strings_Append((CHAR*)"-c ", (LONGINT)4, (void*)cmd, ((LONGINT)(1023))); + Strings_Append(moduleName, moduleName__len, (void*)cmd, ((LONGINT)(1023))); + Strings_Append((CHAR*)".c", (LONGINT)3, (void*)cmd, ((LONGINT)(1023))); + extTools_execute((CHAR*)"Assemble: ", (LONGINT)11, cmd, ((LONGINT)(1023))); + __DEL(moduleName); +} + +void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN statically, CHAR *additionalopts, LONGINT additionalopts__len) +{ + CHAR cmd[1023]; + __DUP(additionalopts, additionalopts__len, CHAR); + __MOVE("gcc -g", cmd, 7); + Strings_Append((CHAR*)" ", (LONGINT)2, (void*)cmd, ((LONGINT)(1023))); + Strings_Append(extTools_compilationOptions, ((LONGINT)(1023)), (void*)cmd, ((LONGINT)(1023))); + Strings_Append(moduleName, moduleName__len, (void*)cmd, ((LONGINT)(1023))); + Strings_Append((CHAR*)".c ", (LONGINT)4, (void*)cmd, ((LONGINT)(1023))); + Strings_Append(additionalopts, additionalopts__len, (void*)cmd, ((LONGINT)(1023))); + if (statically) { + Strings_Append((CHAR*)"-static", (LONGINT)8, (void*)cmd, ((LONGINT)(1023))); + } + Strings_Append((CHAR*)" -o ", (LONGINT)5, (void*)cmd, ((LONGINT)(1023))); + Strings_Append(moduleName, moduleName__len, (void*)cmd, ((LONGINT)(1023))); + Strings_Append((CHAR*)" -L\"", (LONGINT)5, (void*)cmd, ((LONGINT)(1023))); + Strings_Append((CHAR*)"/opt/voc", (LONGINT)9, (void*)cmd, ((LONGINT)(1023))); + Strings_Append((CHAR*)"/lib\"", (LONGINT)6, (void*)cmd, ((LONGINT)(1023))); + Strings_Append((CHAR*)" -l voc", (LONGINT)8, (void*)cmd, ((LONGINT)(1023))); + extTools_execute((CHAR*)"Assemble and link: ", (LONGINT)20, cmd, ((LONGINT)(1023))); + __DEL(additionalopts); +} + + +export void *extTools__init(void) +{ + __DEFMOD; + __MODULE_IMPORT(Configuration); + __MODULE_IMPORT(Console); + __MODULE_IMPORT(OPM); + __MODULE_IMPORT(Platform); + __MODULE_IMPORT(Strings); + __REGMOD("extTools", 0); +/* BEGIN */ + Strings_Append((CHAR*)" -I \"", (LONGINT)6, (void*)extTools_compilationOptions, ((LONGINT)(1023))); + Strings_Append((CHAR*)"/opt/voc", (LONGINT)9, (void*)extTools_compilationOptions, ((LONGINT)(1023))); + Strings_Append((CHAR*)"/include\" ", (LONGINT)11, (void*)extTools_compilationOptions, ((LONGINT)(1023))); + Platform_GetEnv((CHAR*)"CFLAGS", (LONGINT)7, (void*)extTools_CFLAGS, ((LONGINT)(1023))); + Strings_Append(extTools_CFLAGS, ((LONGINT)(1023)), (void*)extTools_compilationOptions, ((LONGINT)(1023))); + Strings_Append((CHAR*)" ", (LONGINT)2, (void*)extTools_compilationOptions, ((LONGINT)(1023))); + __ENDMOD; +} diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h new file mode 100644 index 00000000..61ca56e4 --- /dev/null +++ b/bootstrap/windows-88/extTools.h @@ -0,0 +1,17 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ + +#ifndef extTools__h +#define extTools__h + +#define LARGE +#include "SYSTEM.h" + + + + +import void extTools_Assemble (CHAR *moduleName, LONGINT moduleName__len); +import void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN statically, CHAR *additionalopts, LONGINT additionalopts__len); +import void *extTools__init(void); + + +#endif diff --git a/bootstrap/windows-88/vt100.c b/bootstrap/windows-88/vt100.c new file mode 100644 index 00000000..88c386a8 --- /dev/null +++ b/bootstrap/windows-88/vt100.c @@ -0,0 +1,259 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +#define LARGE +#include "SYSTEM.h" +#include "Console.h" +#include "Strings.h" + + +export CHAR vt100_CSI[5]; +static CHAR vt100_tmpstr[32]; + + +export void vt100_CHA (INTEGER n); +export void vt100_CNL (INTEGER n); +export void vt100_CPL (INTEGER n); +export void vt100_CUB (INTEGER n); +export void vt100_CUD (INTEGER n); +export void vt100_CUF (INTEGER n); +export void vt100_CUP (INTEGER n, INTEGER m); +export void vt100_CUU (INTEGER n); +export void vt100_DECTCEMh (void); +export void vt100_DECTCEMl (void); +export void vt100_DSR (INTEGER n); +export void vt100_ED (INTEGER n); +export void vt100_EL (INTEGER n); +static void vt100_EscSeq (INTEGER n, CHAR *letter, LONGINT letter__len); +static void vt100_EscSeq0 (CHAR *letter, LONGINT letter__len); +static void vt100_EscSeq2 (INTEGER n, INTEGER m, CHAR *letter, LONGINT letter__len); +static void vt100_EscSeqSwapped (INTEGER n, CHAR *letter, LONGINT letter__len); +export void vt100_HVP (INTEGER n, INTEGER m); +export void vt100_IntToStr (LONGINT int_, CHAR *str, LONGINT str__len); +export void vt100_RCP (void); +static void vt100_Reverse0 (CHAR *str, LONGINT str__len, INTEGER start, INTEGER end); +export void vt100_SCP (void); +export void vt100_SD (INTEGER n); +export void vt100_SGR (INTEGER n); +export void vt100_SGR2 (INTEGER n, INTEGER m); +export void vt100_SU (INTEGER n); +export void vt100_SetAttr (CHAR *attr, LONGINT attr__len); + + +static void vt100_Reverse0 (CHAR *str, LONGINT str__len, INTEGER start, INTEGER end) +{ + CHAR h; + while (start < end) { + h = str[__X(start, str__len)]; + str[__X(start, str__len)] = str[__X(end, str__len)]; + str[__X(end, str__len)] = h; + start += 1; + end -= 1; + } +} + +void vt100_IntToStr (LONGINT int_, CHAR *str, LONGINT str__len) +{ + CHAR b[21]; + INTEGER s, e; + SHORTINT maxLength; + maxLength = 20; + if (int_ == (-9223372036854775807-1)) { + __MOVE("-9223372036854775808", b, 21); + e = 20; + } else { + if (int_ < 0) { + b[0] = '-'; + int_ = -int_; + s = 1; + } else { + s = 0; + } + e = s; + do { + b[__X(e, ((LONGINT)(21)))] = (CHAR)(__MOD(int_, 10) + 48); + int_ = __DIV(int_, 10); + e += 1; + } while (!(int_ == 0)); + b[__X(e, ((LONGINT)(21)))] = 0x00; + vt100_Reverse0((void*)b, ((LONGINT)(21)), s, e - 1); + } + __COPY(b, str, str__len); +} + +static void vt100_EscSeq0 (CHAR *letter, LONGINT letter__len) +{ + CHAR cmd[9]; + __DUP(letter, letter__len, CHAR); + __COPY(vt100_CSI, cmd, ((LONGINT)(9))); + Strings_Append(letter, letter__len, (void*)cmd, ((LONGINT)(9))); + Console_String(cmd, ((LONGINT)(9))); + __DEL(letter); +} + +static void vt100_EscSeq (INTEGER n, CHAR *letter, LONGINT letter__len) +{ + CHAR nstr[2]; + CHAR cmd[7]; + __DUP(letter, letter__len, CHAR); + vt100_IntToStr(n, (void*)nstr, ((LONGINT)(2))); + __COPY(vt100_CSI, cmd, ((LONGINT)(7))); + Strings_Append(nstr, ((LONGINT)(2)), (void*)cmd, ((LONGINT)(7))); + Strings_Append(letter, letter__len, (void*)cmd, ((LONGINT)(7))); + Console_String(cmd, ((LONGINT)(7))); + __DEL(letter); +} + +static void vt100_EscSeqSwapped (INTEGER n, CHAR *letter, LONGINT letter__len) +{ + CHAR nstr[2]; + CHAR cmd[7]; + __DUP(letter, letter__len, CHAR); + vt100_IntToStr(n, (void*)nstr, ((LONGINT)(2))); + __COPY(vt100_CSI, cmd, ((LONGINT)(7))); + Strings_Append(letter, letter__len, (void*)cmd, ((LONGINT)(7))); + Strings_Append(nstr, ((LONGINT)(2)), (void*)cmd, ((LONGINT)(7))); + Console_String(cmd, ((LONGINT)(7))); + __DEL(letter); +} + +static void vt100_EscSeq2 (INTEGER n, INTEGER m, CHAR *letter, LONGINT letter__len) +{ + CHAR nstr[5], mstr[5]; + CHAR cmd[12]; + __DUP(letter, letter__len, CHAR); + vt100_IntToStr(n, (void*)nstr, ((LONGINT)(5))); + vt100_IntToStr(m, (void*)mstr, ((LONGINT)(5))); + __COPY(vt100_CSI, cmd, ((LONGINT)(12))); + Strings_Append(nstr, ((LONGINT)(5)), (void*)cmd, ((LONGINT)(12))); + Strings_Append((CHAR*)";", (LONGINT)2, (void*)cmd, ((LONGINT)(12))); + Strings_Append(mstr, ((LONGINT)(5)), (void*)cmd, ((LONGINT)(12))); + Strings_Append(letter, letter__len, (void*)cmd, ((LONGINT)(12))); + Console_String(cmd, ((LONGINT)(12))); + __DEL(letter); +} + +void vt100_CUU (INTEGER n) +{ + vt100_EscSeq(n, (CHAR*)"A", (LONGINT)2); +} + +void vt100_CUD (INTEGER n) +{ + vt100_EscSeq(n, (CHAR*)"B", (LONGINT)2); +} + +void vt100_CUF (INTEGER n) +{ + vt100_EscSeq(n, (CHAR*)"C", (LONGINT)2); +} + +void vt100_CUB (INTEGER n) +{ + vt100_EscSeq(n, (CHAR*)"D", (LONGINT)2); +} + +void vt100_CNL (INTEGER n) +{ + vt100_EscSeq(n, (CHAR*)"E", (LONGINT)2); +} + +void vt100_CPL (INTEGER n) +{ + vt100_EscSeq(n, (CHAR*)"F", (LONGINT)2); +} + +void vt100_CHA (INTEGER n) +{ + vt100_EscSeq(n, (CHAR*)"G", (LONGINT)2); +} + +void vt100_CUP (INTEGER n, INTEGER m) +{ + vt100_EscSeq2(n, m, (CHAR*)"H", (LONGINT)2); +} + +void vt100_ED (INTEGER n) +{ + vt100_EscSeq(n, (CHAR*)"J", (LONGINT)2); +} + +void vt100_EL (INTEGER n) +{ + vt100_EscSeq(n, (CHAR*)"K", (LONGINT)2); +} + +void vt100_SU (INTEGER n) +{ + vt100_EscSeq(n, (CHAR*)"S", (LONGINT)2); +} + +void vt100_SD (INTEGER n) +{ + vt100_EscSeq(n, (CHAR*)"T", (LONGINT)2); +} + +void vt100_HVP (INTEGER n, INTEGER m) +{ + vt100_EscSeq2(n, m, (CHAR*)"f", (LONGINT)2); +} + +void vt100_SGR (INTEGER n) +{ + vt100_EscSeq(n, (CHAR*)"m", (LONGINT)2); +} + +void vt100_SGR2 (INTEGER n, INTEGER m) +{ + vt100_EscSeq2(n, m, (CHAR*)"m", (LONGINT)2); +} + +void vt100_DSR (INTEGER n) +{ + vt100_EscSeq(6, (CHAR*)"n", (LONGINT)2); +} + +void vt100_SCP (void) +{ + vt100_EscSeq0((CHAR*)"s", (LONGINT)2); +} + +void vt100_RCP (void) +{ + vt100_EscSeq0((CHAR*)"u", (LONGINT)2); +} + +void vt100_DECTCEMl (void) +{ + vt100_EscSeq0((CHAR*)"\?25l", (LONGINT)5); +} + +void vt100_DECTCEMh (void) +{ + vt100_EscSeq0((CHAR*)"\?25h", (LONGINT)5); +} + +void vt100_SetAttr (CHAR *attr, LONGINT attr__len) +{ + CHAR tmpstr[16]; + __DUP(attr, attr__len, CHAR); + __COPY(vt100_CSI, tmpstr, ((LONGINT)(16))); + Strings_Append(attr, attr__len, (void*)tmpstr, ((LONGINT)(16))); + Console_String(tmpstr, ((LONGINT)(16))); + __DEL(attr); +} + + +export void *vt100__init(void) +{ + __DEFMOD; + __MODULE_IMPORT(Console); + __MODULE_IMPORT(Strings); + __REGMOD("vt100", 0); + __REGCMD("DECTCEMh", vt100_DECTCEMh); + __REGCMD("DECTCEMl", vt100_DECTCEMl); + __REGCMD("RCP", vt100_RCP); + __REGCMD("SCP", vt100_SCP); +/* BEGIN */ + __COPY("", vt100_CSI, ((LONGINT)(5))); + Strings_Append((CHAR*)"[", (LONGINT)2, (void*)vt100_CSI, ((LONGINT)(5))); + __ENDMOD; +} diff --git a/bootstrap/windows-88/vt100.h b/bootstrap/windows-88/vt100.h new file mode 100644 index 00000000..b124915f --- /dev/null +++ b/bootstrap/windows-88/vt100.h @@ -0,0 +1,38 @@ +/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ + +#ifndef vt100__h +#define vt100__h + +#define LARGE +#include "SYSTEM.h" + + +import CHAR vt100_CSI[5]; + + +import void vt100_CHA (INTEGER n); +import void vt100_CNL (INTEGER n); +import void vt100_CPL (INTEGER n); +import void vt100_CUB (INTEGER n); +import void vt100_CUD (INTEGER n); +import void vt100_CUF (INTEGER n); +import void vt100_CUP (INTEGER n, INTEGER m); +import void vt100_CUU (INTEGER n); +import void vt100_DECTCEMh (void); +import void vt100_DECTCEMl (void); +import void vt100_DSR (INTEGER n); +import void vt100_ED (INTEGER n); +import void vt100_EL (INTEGER n); +import void vt100_HVP (INTEGER n, INTEGER m); +import void vt100_IntToStr (LONGINT int_, CHAR *str, LONGINT str__len); +import void vt100_RCP (void); +import void vt100_SCP (void); +import void vt100_SD (INTEGER n); +import void vt100_SGR (INTEGER n); +import void vt100_SGR2 (INTEGER n, INTEGER m); +import void vt100_SU (INTEGER n); +import void vt100_SetAttr (CHAR *attr, LONGINT attr__len); +import void *vt100__init(void); + + +#endif diff --git a/make.cmd b/make.cmd new file mode 100644 index 00000000..5ff269df --- /dev/null +++ b/make.cmd @@ -0,0 +1,429 @@ +@echo off + +:: mscmake.cmd - Build Oberon with Microsoft C compiler. + +:: Expects the path to include cl.exe. + +:: As of 10th Feb 2016 the miscrosoft c compiler and build tools +:: can be downloaded independently of the full Visual Studio IDE +:: as the 'Visual C++ Build Tools 2015'. + +:: See: https://blogs.msdn.microsoft.com/vcblog/2015/11/02/announcing-visual-c-build-tools-2015-standalone-c-tools-for-build-environments/ + +:: With this installed, from the start button select: +:: All Apps / Visual C++ Build Tools / Visual C++ x86 Native Build Tools Command Prompt + + +:: Create configuration and parameter files. + +cl -nologo -Isrc\system src\tools\make\configure.c >nul +setlocal +configure.exe >nul +del configure.obj configure.exe 2>nul + +:: Extract make variables into local environment + +for /F "delims='=' tokens=1,2" %%a in (Configuration.make) do set %%a=%%b + +set FLAVOUR=%OS%.%DATAMODEL%.%COMPILER% +set BUILDDIR=build\%FLAVOUR% +set VISHAP=%ONAME%%BINEXT% + +for /F %%d in ('cd');do set ROOTDIR=%%d + + + +:: Process target parameter + +if "%1" equ "" ( + call :usage +) else ( + call :%1 +) +endlocal +goto :eof + + + + +:usage +@echo. +@echo Usage: +@echo. +@echo. make full - Make and install compiler (from administrator prompt) +@echo. +@echo. make clean - Remove made files +@echo. make compiler - Build the compiler but not the library +@echo. make library - Build all library files and make library +@echo. make install - Install built compiler and library (from administrator prompt) +goto :eof + + + + +:full +call :clean || exit /b +call :compiler || exit /b +call :browsercmd || exit /b +call :library || exit /b +call :install || exit /b +goto :eof + + + + +:compiler +call :translate || exit /b +call :assemble || exit /b +goto :eof + + + + +:library +call :v4 || exit /b +call :ooc2 || exit /b +call :ooc || exit /b +call :ulm || exit /b +call :pow32 || exit /b +call :misc || exit /b +call :s3 || exit /b +call :librarybinary || exit /b +goto :eof + + + + +:clean +rd /s /q %BUILDDIR% 2>nul +del /q %VISHAP% 2>nul +goto :eof + + + + +:assemble +echo. +echo.make assemble - compiling Oberon compiler c source:: +echo. VERSION: %VERSION% +echo. Target characeristics: +echo. PLATFORM: %PLATFORM% +echo. OS: %OS% +echo. BUILDDIR: %BUILDDIR% +echo. Oberon characteristics: +echo. INTSIZE: %INTSIZE% +echo. ADRSIZE: %ADRSIZE% +echo. ALIGNMENT: %ALIGNMENT% +echo. C compiler: +echo. COMPILER: %COMPILER% +echo. COMPILE: %COMPILE% +echo. DATAMODEL: %DATAMODEL% + +cd %BUILDDIR% + +cl -nologo /Zi -c SYSTEM.c Configuration.c Platform.c Heap.c || exit /b +cl -nologo /Zi -c Console.c Strings.c Modules.c Files.c || exit /b +cl -nologo /Zi -c Reals.c Texts.c vt100.c errors.c || exit /b +cl -nologo /Zi -c OPM.c extTools.c OPS.c OPT.c || exit /b +cl -nologo /Zi -c OPC.c OPV.c OPB.c OPP.c || exit /b + +cl -nologo /Zi Vishap.c /Fe%ROOTDIR%\%VISHAP% ^ +SYSTEM.obj Configuration.obj Platform.obj Heap.obj ^ +Console.obj Strings.obj Modules.obj Files.obj ^ +Reals.obj Texts.obj vt100.obj errors.obj ^ +OPM.obj extTools.obj OPS.obj OPT.obj ^ +OPC.obj OPV.obj OPB.obj OPP.obj || exit /b + +echo.%VISHAP% created. +cd %ROOTDIR% +goto :eof + + + + +:compilefromsavedsource +echo.Populating clean build directory from bootstrap C sources. +mkdir %BUILDDIR% >nul 2>nul +copy bootstrap\%PLATFORM%-%ADRSIZE%%ALIGNMENT%\*.* %BUILDDIR% >nul +call :assemble || exit /b +goto :eof + + + + +:translate +:: Make sure we have an oberon compiler binary: if we built one earlier we'll use it, +:: otherwise use one of the saved sets of C sources in the bootstrap directory. +if not exist %VISHAP% call :compilefromsavedsource + +echo. +echo.make translate - translating compiler source: +echo. PLATFORM: %PLATFORM% +echo. INTSIZE: %INTSIZE% +echo. ADRSIZE: %ADRSIZE% +echo. ALIGNMENT: %ALIGNMENT% + +md %BUILDDIR% 2>nul +cd %BUILDDIR% +%ROOTDIR%\%VISHAP% -SFs -B%INTSIZE%%ADRSIZE%%ALIGNMENT% ../../Configuration.Mod || exit /b +%ROOTDIR%\%VISHAP% -SFs -B%INTSIZE%%ADRSIZE%%ALIGNMENT% ../../src/system/Platform%PLATFORM%.Mod || exit /b +%ROOTDIR%\%VISHAP% -SFsapx -B%INTSIZE%%ADRSIZE%%ALIGNMENT% ../../src/system/Heap.Mod || exit /b +%ROOTDIR%\%VISHAP% -SFs -B%INTSIZE%%ADRSIZE%%ALIGNMENT% ../../src/system/Console.Mod || exit /b +%ROOTDIR%\%VISHAP% -SFs -B%INTSIZE%%ADRSIZE%%ALIGNMENT% ../../src/library/v4/Strings.Mod || exit /b +%ROOTDIR%\%VISHAP% -SFs -B%INTSIZE%%ADRSIZE%%ALIGNMENT% ../../src/library/v4/Modules.Mod || exit /b +%ROOTDIR%\%VISHAP% -SFsx -B%INTSIZE%%ADRSIZE%%ALIGNMENT% ../../src/system/Files.Mod || exit /b +%ROOTDIR%\%VISHAP% -SFs -B%INTSIZE%%ADRSIZE%%ALIGNMENT% ../../src/library/v4/Reals.Mod || exit /b +%ROOTDIR%\%VISHAP% -SFs -B%INTSIZE%%ADRSIZE%%ALIGNMENT% ../../src/library/v4/Texts.Mod || exit /b +%ROOTDIR%\%VISHAP% -SFs -B%INTSIZE%%ADRSIZE%%ALIGNMENT% ../../src/library/misc/vt100.Mod || exit /b +%ROOTDIR%\%VISHAP% -SFs -B%INTSIZE%%ADRSIZE%%ALIGNMENT% ../../src/compiler/errors.Mod || exit /b +%ROOTDIR%\%VISHAP% -SFs -B%INTSIZE%%ADRSIZE%%ALIGNMENT% ../../src/compiler/OPM.cmdln.Mod || exit /b +%ROOTDIR%\%VISHAP% -SFs -B%INTSIZE%%ADRSIZE%%ALIGNMENT% ../../src/compiler/extTools.Mod || exit /b +%ROOTDIR%\%VISHAP% -SFsx -B%INTSIZE%%ADRSIZE%%ALIGNMENT% ../../src/compiler/OPS.Mod || exit /b +%ROOTDIR%\%VISHAP% -SFs -B%INTSIZE%%ADRSIZE%%ALIGNMENT% ../../src/compiler/OPT.Mod || exit /b +%ROOTDIR%\%VISHAP% -SFs -B%INTSIZE%%ADRSIZE%%ALIGNMENT% ../../src/compiler/OPC.Mod || exit /b +%ROOTDIR%\%VISHAP% -SFs -B%INTSIZE%%ADRSIZE%%ALIGNMENT% ../../src/compiler/OPV.Mod || exit /b +%ROOTDIR%\%VISHAP% -SFs -B%INTSIZE%%ADRSIZE%%ALIGNMENT% ../../src/compiler/OPB.Mod || exit /b +%ROOTDIR%\%VISHAP% -SFs -B%INTSIZE%%ADRSIZE%%ALIGNMENT% ../../src/compiler/OPP.Mod || exit /b +%ROOTDIR%\%VISHAP% -Ssm -B%INTSIZE%%ADRSIZE%%ALIGNMENT% ../../src/compiler/Vishap.Mod || exit /b +cd %ROOTDIR% +copy src\system\*.c %BUILDDIR% >nul +copy src\system\*.h %BUILDDIR% >nul +echo.%BUILDDIR% filled with compiler C source. +goto :eof + + + + +:browsercmd +echo. +echo.Making symbol browser +cd %BUILDDIR% +%ROOTDIR%/%VISHAP% -Sm ../../src/tools/browser/BrowserCmd.Mod +cl -nologo BrowserCmd.c /Feshowdef.exe ^ + Platform.obj Texts.obj OPT.obj Heap.obj Console.obj SYSTEM.obj OPM.obj OPS.obj OPV.obj ^ + Files.obj Reals.obj Modules.obj vt100.obj errors.obj Configuration.obj Strings.obj ^ + OPC.obj +cd %ROOTDIR% +goto :eof + + + + +:install +whoami /groups | find "12288" >nul +if errorlevel 1 ( +echo make install - administrator rights required. Please run under an administrator command prompt. +goto :eof +) +rmdir /s /q "%INSTALLDIR%" >nul 2>&1 +mkdir "%INSTALLDIR%" >nul 2>&1 +mkdir "%INSTALLDIR%\bin" >nul 2>&1 +mkdir "%INSTALLDIR%\include" >nul 2>&1 +mkdir "%INSTALLDIR%\sym" >nul 2>&1 +mkdir "%INSTALLDIR%\lib" >nul 2>&1 +copy %BUILDDIR%\*.h "%INSTALLDIR%\include" >nul +copy %BUILDDIR%\*.sym "%INSTALLDIR%\sym" >nul +copy %VISHAP% "%INSTALLDIR%\bin" >nul +copy %BUILDDIR%\showdef.exe "%INSTALLDIR%\bin" >nul +copy %BUILDDIR%\lib%ONAME%.lib "%INSTALLDIR%\lib" >nul +echo. +echo.Now add "%INSTALLDIR%\bin" to your path. +goto :eof + + +:uninstall +whoami /groups | find "12288" >nul +if errorlevel 1 ( +echo make uninstall - administrator rights required. Please run under an administrator command prompt. +goto :eof +) +rmdir /s /q "%INSTALLDIR%" >nul 2>&1 +goto :eof + + + + +:v4 +echo. +echo.Making V4 library +cd %BUILDDIR% +%ROOTDIR%\%VISHAP% -Fs ../../src/library/v4/Args.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/v4/Printer.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/v4/Sets.Mod || exit /b +cd %ROOTDIR% +goto :eof + +:ooc2 +echo.Making ooc2 library +cd %BUILDDIR% +%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc2/ooc2Strings.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc2/ooc2Ascii.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc2/ooc2CharClass.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc2/ooc2ConvTypes.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc2/ooc2IntConv.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc2/ooc2IntStr.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc2/ooc2Real0.Mod || exit /b +cd %ROOTDIR% +goto :eof + +:ooc +echo.Making ooc library +cd %BUILDDIR% +%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc/oocLowReal.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc/oocLowLReal.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc/oocRealMath.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc/oocOakMath.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc/oocLRealMath.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc/oocLongInts.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc/oocComplexMath.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc/oocLComplexMath.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc/oocAscii.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc/oocCharClass.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc/oocStrings.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc/oocConvTypes.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc/oocLRealConv.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc/oocLRealStr.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc/oocRealConv.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc/oocRealStr.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc/oocIntConv.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc/oocIntStr.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc/oocMsg.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc/oocSysClock.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc/oocTime.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc/oocChannel.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc/oocStrings2.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc/oocRts.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc/oocFilenames.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc/oocTextRider.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc/oocBinaryRider.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc/oocJulianDay.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc/oocFilenames.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc/oocwrapperlibc.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc/oocC%DATAMODEL%.Mod || exit /b +cd %ROOTDIR% +goto :eof + +:oocX11 +echo No X11 support on plain Windows - use cygwin and build with cygwin make. +goto :eof + +:ulm +echo.Making ulm library +cd %BUILDDIR% +%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmObjects.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmPriorities.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmDisciplines.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmServices.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmSys.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmSYSTEM.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmEvents.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmProcess.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmResources.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmForwarders.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmRelatedEvents.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmTypes.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmStreams.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmStrings.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmSysTypes.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmTexts.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmSysConversions.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmErrors.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmSysErrors.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmSysStat.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmASCII.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmSets.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmIO.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmAssertions.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmIndirectDisciplines.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmStreamDisciplines.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmIEEE.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmMC68881.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmReals.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmPrint.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmWrite.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmConstStrings.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmPlotters.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmSysIO.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmLoader.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmNetIO.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmPersistentObjects.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmPersistentDisciplines.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmOperations.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmScales.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmTimes.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmClocks.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmTimers.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmConditions.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmStreamConditions.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmTimeConditions.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmCiphers.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmCipherOps.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmBlockCiphers.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmAsymmetricCiphers.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmConclusions.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmRandomGenerators.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmTCrypt.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmIntOperations.Mod || exit /b +cd %ROOTDIR% +goto :eof + +:pow32 +echo.Making pow32 library +cd %BUILDDIR% +%ROOTDIR%\%VISHAP% -Fs ../../src/library/pow/powStrings.Mod || exit /b +cd %ROOTDIR% +goto :eof + +:misc +echo.Making misc library +cd %BUILDDIR% +%ROOTDIR%\%VISHAP% -Fs ../../src/system/Oberon.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/misc/crt.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/misc/Listen.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/misc/MersenneTwister.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/misc/MultiArrays.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/misc/MultiArrayRiders.Mod || exit /b +cd %ROOTDIR% +goto :eof + +:s3 +echo.Making s3 library +cd %BUILDDIR% +%ROOTDIR%\%VISHAP% -Fs ../../src/library/s3/ethBTrees.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/s3/ethMD5.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/s3/ethSets.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/s3/ethZlib.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/s3/ethZlibBuffers.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/s3/ethZlibInflate.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/s3/ethZlibDeflate.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/s3/ethZlibReaders.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/s3/ethZlibWriters.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/s3/ethZip.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/s3/ethRandomNumbers.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/s3/ethGZReaders.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/s3/ethGZWriters.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/s3/ethUnicode.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/s3/ethDates.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/s3/ethReals.Mod || exit /b +%ROOTDIR%\%VISHAP% -Fs ../../src/library/s3/ethStrings.Mod || exit /b +cd %ROOTDIR% +goto :eof + + + + +:librarybinary +echo. +echo.Making lib%ONAME% +:: Remove objects that should not be part of the library +del /q %BUILDDIR%\Vishap.obj +:: Make static library +lib -nologo %BUILDDIR%\*.obj -out:%BUILDDIR%\lib%ONAME%.lib || exit /b +goto :eof + + + + + + + diff --git a/makefile b/makefile new file mode 100644 index 00000000..2cc4da4e --- /dev/null +++ b/makefile @@ -0,0 +1,247 @@ +# Vishap Oberon master makefile. +# +# Makes sure configuration parameters are up to date and then hands off +# to src/tools/make/vishap.make. + + + + +# To build and install the Oberon compiler and library on a Unix based +# OS (Linux/Mac/BSD etc.) or on cygwin, run: +# +# make full +# +# To override your OSs default C compiler, first run +# +# export CC=compiler +# +# Where compiler is one of: +# +# clang +# gcc +# i686-w64-mingw32-gcc (32 bit cygwin only) +# x86_64-w64-mingw32-gcc (64 bit cygwin only) +# +# (To build on native Windows use make.cmd, not this makefile. Make.cmd automatically +# assumes use of the Microsoft compiler cl.) + + + + +# C compiler data models and sizes and alignments of Oberon types. +# +# There are just three distinct data models that we build for: +# +# 44 - 32 bit pointers, 32 bit alignment +# 48 - 32 bit pointers, 64 bit alignment +# 88 - 64 bit pointers, 64 bit alignment +# +# Meaning of n bit alignment: +# +# Individual variables of up to n bits are aligned in memory to +# whole multiples of their own size, rounded up to a power of two. +# Variables larger than n bits are aligned to n bits. +# +# (n will always be a power of 2). +# +# Thus: +# +# Size 32 bit alignment 64 bit alignment +# -------- ---------------- ---------------- +# CHAR 1 byte 1 byte 1 byte +# INTEGER 4 bytes 4 bytes 4 bytes +# LONGINT 8 bytes 4 bytes 8 bytes +# +# Note that in practice for 32 and 64 bit systems, this only affects +# LONGINT. +# +# C data model names: +# +# name 32 bit types 64 bit types alignment +# --------- ------------------ ------------------------ --------- +# ILP32 int, long, pointer long long 32 or 64 +# LP64 int long, long long, pointer 64 +# LLP64 int, long long long 64 + + + + +# Default make target - explain usage +usage: + @echo "" + @echo Usage: + @echo "" + @echo " make full" + @echo "" + @echo " Does a full, clean build, installs it, and runs confidence tests." + @echo " Requires root access (for the install) except on cygwin." + @echo "" + @echo "Targets for building and installation:" + @echo " make clean - Clean out the build directory" + @echo " make compiler - Build the compiler but not the library" + @echo " make browsercmd - Build the symbol browser (showdef)" + @echo " make library - Build all library files and make library" + @echo " make install - Install built compiler and library in /opt or C:\\PROGRAM FILES*" + @echo " (Needs root access)" + @echo "" + @echo "Targets for (re)creating and reverting bootstrap C sources:" + @echo " make bootstrap - Uddate bootstrap C source directories. Always run on 64 bit." + @echo " make revertbootstrap - Use git checkout to restore bootstrap C source directories" + @echo "" + @echo "" + @echo "Multi-platform coordinated network build:" + @echo " make coordinator - Start central task to trigger builds and collect logs" + @echo " make auto - Start machine specific build server" + @echo " make autobuild - Trigger all machines running 'make auto' to start a build" + @echo " make autobuild - Terminate 'make auto' on all machines" + + + + +# Generate config files Configuration.Make and Configuartion.Mod +FORCE: + +configuration: FORCE + @$(CC) -I src/system -o a.o src/tools/make/configure.c + @./a.o + @rm a.o + + + + +reportsizes: FORCE + @$(CC) -I src/system -o a.o src/tools/make/configure.c + @./a.o report + @rm a.o + + + + +# --- Building and installation --- + + + + +# clean - clean out the bulid directory +clean: configuration + @make -f src/tools/make/vishap.make -s clean + + + + +# full: Full build of compiler and libarary. +full: configuration + @make -f src/tools/make/vishap.make -s clean + @make -f src/tools/make/vishap.make -s translate + @make -f src/tools/make/vishap.make -s assemble + @make -f src/tools/make/vishap.make -s browsercmd + @make -f src/tools/make/vishap.make -s library + @make -f src/tools/make/vishap.make -s install + @make -f src/tools/make/vishap.make -s confidence + + + + +# compile: compiler only, without cleaning +compiler: configuration + @make -f src/tools/make/vishap.make -s translate + @make -f src/tools/make/vishap.make -s assemble + + + + +# browsercmd: build the 'showdef' command +browsercmd: configuration + @make -f src/tools/make/vishap.make -s browsercmd + + + + +# library: build all directories under src/library +library: configuration + @make -f src/tools/make/vishap.make -s library + + + + +# install: Copy built files to install directory +install: configuration + @make -f src/tools/make/vishap.make -s install + +uninstall: configuration + @make -f src/tools/make/vishap.make -s uninstall + + + + +# --- Bootstrap C source generation and reversion --- + + +# bootstrap: Rebuild the bootstrap directories +bootstrap: configuration + rm -rf bootstrap/* + make -f src/tools/make/vishap.make -s translate INTSIZE=2 ADRSIZE=4 ALIGNMENT=4 PLATFORM=unix BUILDDIR=bootstrap/unix-44 && rm bootstrap/unix-44/*.sym + make -f src/tools/make/vishap.make -s translate INTSIZE=2 ADRSIZE=4 ALIGNMENT=8 PLATFORM=unix BUILDDIR=bootstrap/unix-48 && rm bootstrap/unix-48/*.sym + make -f src/tools/make/vishap.make -s translate INTSIZE=4 ADRSIZE=8 ALIGNMENT=8 PLATFORM=unix BUILDDIR=bootstrap/unix-88 && rm bootstrap/unix-88/*.sym + make -f src/tools/make/vishap.make -s translate INTSIZE=2 ADRSIZE=4 ALIGNMENT=8 PLATFORM=windows BUILDDIR=bootstrap/windows-48 && rm bootstrap/windows-48/*.sym + make -f src/tools/make/vishap.make -s translate INTSIZE=4 ADRSIZE=8 ALIGNMENT=8 PLATFORM=windows BUILDDIR=bootstrap/windows-88 && rm bootstrap/windows-88/*.sym + + + + +revertbootstrap: + @rm -rf bootstrap/* + git checkout bootstrap + + + + +# --- multi-machine multi-platform build management --- + + + +# coordinator: Start the test machine coordinator +coordinator: configuration + @make -f src/tools/make/vishap.make -s clean + @make -f src/tools/make/vishap.make -s translate + @make -f src/tools/make/vishap.make -s assemble + @make -f src/tools/make/vishap.make -s testtools + @rm -f "build/*.log" + cd build && ../testcoordinator.exe + + + + +# auto: machine specific build server +auto: configuration + @make -f src/tools/make/vishap.make -s auto + + + + +# autoonce: What auto does each time a build is triggered. +autoonce: configuration + git pull + @if make -s full; then echo \*\* Succeeded \*\*; else echo \*\* Failed \*\*;fi + + + + +# autobuild: Start test clients. +autobuild: configuration + ./testclient -c "make -s autoonce" + + + + +# autostop: Tell test clients to exit their wait loop. +autostop: configuration + ./testclient -c "exit" + + + + + + + + From 1a7a7615dff058c2fff24c3906c6871b0875c804 Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 16 Jun 2016 16:52:05 +0100 Subject: [PATCH 084/580] Add olang readme as v2changes in triage dir. --- triage/V2CHANGES.md | 317 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 317 insertions(+) create mode 100644 triage/V2CHANGES.md diff --git a/triage/V2CHANGES.md b/triage/V2CHANGES.md new file mode 100644 index 00000000..652e93b7 --- /dev/null +++ b/triage/V2CHANGES.md @@ -0,0 +1,317 @@ +### Vishap Oberon - Cross-platform Oberon language compiler. + +This is Norayr Chilingarian's Vishap Oberon adapted to build a little more easily on a wider variety of modern platforms, including Linuxes, BSDs, MAC OSx Darwin, Cygwin on Windows, Mingw on Cygwin on Windows, Microsoft Visual C++ and even Android under Termux. See 'Changes relative to Vishap Oberon' below. + +#### Building and installation summary + +1. git clone https://github.com/dcwbrown/olang +2. cd olang +3. make full + +Since 'make full' will install the compiler and libraries, it needs root (unix) or administrator (windows) privileges. + +| System | Install dir | Access required | +| ----------------------- | -------------------------------------- | ------------------------------ | +| Linux | /opt/voc | Needs root except under cygwin | +| BSD | /usr/local/share/voc | Needs root | +| Windows (mingw or Visual C) | %ProgramFiles[(X86)]% | Needs administrator | +| Termux (android) | /data/data/com.termux/files/opt/voc | | + + +#### 32 and 64 bit + +The size of compiler built is determined by the C compiler that runs, which is in turn determined by +the shell or command prompt configuration you are running under. + +The following Oberon types are independent of compiler size: + +| Types | Size | +| ----- | -------| +| CHAR, SHORTINT | 8 bit | +| REAL | 32 bit | +| LONGREAL | 64 bit | + +The following type sizes follow the built compiler size: + +| Types | 32 bit builds | 64 bit builds | +| ----- | ------------- | ------------- | +| INTEGER | 16 bit | 32 bit | +| LONGINT, SET | 32 bit | 16 bit | + +Note that many library modules have been written with the assumption that INTEGER +is 16 bit and LONGINT 32 bit, therefore they will only work in 32 bit builds. + +#### Which compiler? (gcc vs clang) + +By default make uses the compiler defined in variable CC. This can be overriden by running 'export CC=gcc' or 'export CC=clang' from the command line before running make. + +*Note*: be sure to run 'make clean' any time you change the value of CC. Otherwise directories will be mixed up. + +*Note*: Darwin (MAC OS/X) redirects gcc to clang, so specifying CC=gcc still builds clang binaries under Darwin. + + +#### Building on Windows + +There are three ways to build on Windows: + +| Type | How to build | Compiled binary uses: | +| ----------- | ------- | --------------------- | +| cygwin | Use 'make' from cygwin bash shell. | cygwin.dll | +| mingw under cygwin | Set CC for mingw then use 'make' from cygwin bash shell. | Win32 API | +| Visual C | Use 'make.cmd' from Visual C command prompt. | Win32 API | + +##### mingw on cygwin + +To use mingw, install the correct sized package and export CC= the compiler name: + + - For 32 bit cygwin + + - use setup-x86.exe to add the package mingw64-i686-gcc-core. + - run 'export CC=i686-w64-mingw32-gcc' then 'make full' + + - For 64 bit cygwin + + - use setup-x86\_64.exe to add the package mingw64-x86\_64-gcc-core. + - run 'export CC=x86_64-w64-mingw32-gcc' then 'make full' + +(*Note*: Don't be put off by the name 'mingw64' in the 32 bit package.) + +##### Microsoft Visual C compiler + +Use the free command line Visual C++ compiler. At the time of writing it can be +downloaded here: + + http://landinghub.visualstudio.com/visual-cpp-build-tools + +For example (Windows 10): + +Start an adminstrator command prompt from the start button as follows: + + Start / All apps / Visual C++ Build Tools + +Right click on + + Visual C++ 2015 x86 Native Build Tools Command Prompt + +or + + Visual C++ 2015 x64 Native Build Tools Command Prompt + +And select + + More / Administrative Command Prompt + +#### A 'Hello' application + +Anything appended to Oberon.Log is automatically displayed on the console, so the +following conventional Oberon program will display 'Hello.': + + MODULE hello; + IMPORT Oberon, Texts; + VAR W: Texts.Writer; + BEGIN + Texts.OpenWriter(W); + Texts.WriteString(W, "Hello."); Texts.WriteLn(W); + Texts.Append(Oberon.Log, W.buf) + END hello. + +Alternatively the Console may be accessed directly as follows: + + MODULE hello; + IMPORT Console; + BEGIN + Console.String("Hello."); Console.Ln; + END hello. + +Compile as follows: + + voc hello.mod -m + +The -m parameter tells voc that this is a main module, and to generate an +executable binary. + +Execute as usual on Linux ('./hello') or Windows ('hello'). + +#### How make adapts to each platform + +On all platforms other than Visual C on Windows, make runs from a bash shell, +using makefile in the enlistment root, and vishap.make in the src/tools/make +directory. + +For Visual C only, there is a slightly cut down implementation of the same +functionality in the file 'make.cmd' in the enlistment root. + +In all cases src/tools/make/configure.c is executed to determine all +platform dependent parameters: it generates two files: + + - Configuration.Make: a set of environment variables included by the makefile + - Configuration.Mod: An Oberon MODULE containing just configuraton constants. + +The following examples correspond to a 32 bit Ubuntu build using GCC: + +Configuration.Make: + + OLANGDIR=/home/dave/projects/oberon/olang + COMPILER=gcc + OS=ubuntu + VERSION=1.2 + ONAME=voc + DATAMODEL=ILP32 + INTSIZE=2 + ADRSIZE=4 + ALIGNMENT=4 + INSTALLDIR=/opt/voc + PLATFORM=unix + BINEXT= + COMPILE=gcc -fPIC -g + STATICLINK=-static + LDCONFIG=if echo "/opt/voc/lib" >/etc/ld.so.conf.d/libvoc.conf; then ldconfig; fi + +Configuration.Mod: + + MODULE Configuration; + CONST + name* = 'voc'; + versionLong* = '1.2 [2016/06/11] for gcc ILP32 on ubuntu'; + intsize* = 2; + addressSize* = 4; + alignment* = 4; + objext* = '.o'; + objflag* = ' -o '; + linkflags* = ' -L"'; + libspec* = ' -l voc'; + compile* = 'gcc -fPIC -g'; + dataModel* = 'ILP32'; + installdir* = '/opt/voc'; + staticLink* = '-static'; + END Configuration. + + +#### Changes relative to Vishap Oberon + +The biggest changes relative to Vishap Oberon are in the build system and in the implementation of platform specific support. Where possible platform specific code has removed or replaced by platform agnostic code. + + - The same make commands are used for all platforms, Linux, BSD, Darwin and Windows. In particular 'make full' +builds the compiler, library and tools, installs the compiler and tools, and runs a couple of confidence tests. + + - The C program 'configure.c', a much expanded version of vocparam.c, generates all the platform specific make variables, and the configuration constants compiled into the compiler. Configure.c is compiled and executed at the start of every make command. + + - Both makefiles are platform independent, compatible with both BSD make and GNU make. (For Visual C builds on Windows a separate make.cmd contains the equivalent functionality expressed as a Windows .cmd file.) + + - All duplicate files required to build Linux/BSD/Darwin variants have been removed by refactoring them to be platform independent: + - Rather than accessing Linux structures through Oberon RECORDs intended to match their memory layout, code procedures are used to reference C constants and struct fields directly. (This resolves a number of complexities with structure field order and layout variations across operating systems.) + - Size dependent code is abstracted into simple definitions in SYSTEM.h and referenced from code procedures. + - Files.Mod is extended with a file search path feature removing the need for Files0.Mod, Text0.Mod and Kernel0.Mod. Instead OPM.cmdln.Mod calls the new Files.SetSearchPath. + - Kernel.Mod, Unix.Mod and SYSTEM.Mod are refactored into Heap.Mod and PlatformUnix.Mod. An alternate Platform module implementation PlatformWindows.Mod is used for Microsoft C based builds, using the Win32 API directly. + - All use of the LONGINT type in C source, including in code procedures, now explicitly specify 'LONGINT'. Previously the code often used 'long' instead, assuming it was interchangeable with 'LONGINT', but for some platforms LONGINT is 'long long', not 'long'. + + - The enlistment no longer includes compiled binaries. Instead it includes pre-translated sets of C source covering both platforms and the three C data model variants. (See directory 'bootstrap'.) + + - The bootstrap sources are used on any fresh enlistment or clean build ('make full' is always a clean build). These sources, combined with the platform independence improvements outlined above, have built correctly from a fresh enlistment on all Linux, BSD and cygwin platforms that I have tried, including the raspberry pi under raspbian, and in the termux terminal emulator on android. + +The result is that there is now a single version of earch Oberon source file, with the exceptions only of PlatformUnix.Mod/PlatformWindows.Mod in the compiler, and oocCILP32.Mod/oocCLP64.Mod/oocCLLP64.Mod in the ooc library. + +The full build is now free of warnings: + + - Missing ELSE warnings solved by adding ELSE. + + - C code conversion between integer and pointer of different size solved by casting with with uintptr_t as an intermediate type. + + - C code conversion between signed and unsigned char types solved by explicitly casting 'CHAR's passed to system APIs in code procedures to 'char'. + +The full build now includes a few confidence tests to make sure that the basics work OK. + +HALT/exit code has been simplified. Exit now just calls the system exit API rather than calling the kill API and passing our own process ID. For runtime errors it now displayes the appropriate error message (e.g. Index out of range). + +The jump buffer was not used by any code and has been removed. (It seems from a comment to have been intended for use during some termination code, but the termination code does not use it.) + +Compilation errors now include the line number at the start of the displayed source line. The pos (character offset) is still displayed on the error message line. The error handling code was already doing some walking of the source file to find start and end of line - I changed this to walk through the source file from the start identifying line end positions, counting lines and caching the position at the start of the last error line. The resultant code is simpler, and displays the line number without losing the pos. The performance cost of walking the source file is not an issue. + +##### A few bug fix details: + + - There was a problem with the dynamic array size parameter passed to NEW when expressed as a literal on 64 bit builds. This happens a number of times in the compiler and library. Now in theory it is not necessary to specify the size of numeric literals on parameters to ANSI C functions as the compiler should know the size from the declaration of the called function. (i.e. it shouldn't matter whether one passes '1', '1l', or '1ll'.) +Therefore while OPM.PromoteIntConstToLInt was coded to generate 'l' at the end of long literal parameters on K&R C, it intentionally omitted the 'l' when the compiler was known to be ANSI - and all currently supported compilers are ANSI. +**But** it is not safe to omit the 'l' in literal parameters to C vararg functions: the C compiler cannot get the vararg parameter size from the declaration, and so uses the literal size. Thus only 32 bits are pushed to the stack where 64 bits are required. On a 64 bit Oberon, the implementation of SYSTEM\_NEWARR then reads a full 64 bits. Often the uninitialised 32 bits are zero, and everything works correctly. Rarely they are a very small integer and the system thrashes a while allocating page tables and then continues normally. Other times a segmentation fault or out of memery error is generated. +Removing the test for ANSI and thus always generating the trailing 'l' for LONGINTs is a sufficient fix for the data models supported by the previous versions of Vishap Oberon. +However there is a further complication - this is not sufficient for the LLP64 C data model used by 64 bit Windows. In LLP64, 'long' is only 32 bit. The 64 bit integer type is 'long long' and literal numerics of this type would require an 'll' suffix. +The simple solution was to generate a (LONGINT)(n) typecast, which forces n to the correct size in all cases. + + - SYSTEM.H __VAL(t, x) was defined as (\*(t\*)&(x)) which maps the new type onto the memory of the old. This produces the wrong result if the new type is larger than the old type, because it includes memory that does not belong to the variable into the result. This has been corrected to the simpler ((t)(x)) which will do the appropriate signed or unsigned extension. + + - There was a serious issue with accessing free'd memory in RETURN expressions. Oberon generates code to create local copies of dynamic strings passed by value (so that code is free to change the value parameter without affecting the original string). +The copy is not allocated from the Oberon Heap, but direct from the OS (e.g. via malloc on Linux/Unix). At function return the compiler inserts a call to C's free before the return statement. +The problem comes when the expression on the Oberon RETURN statement references the local string copy. This gets compiled to a C 'return' statement that references the free'd memory. Sometimes the C free will not have modified the string copy, and no error is seen. However all bets are off - the OS or C runtime could have done anything to this memory as part of heap management (e.g. used it for free chain linkage), and with pre-emptive multitasking it may have been reallocated and used for another purpose before the return expression refers to it. This bug hit me occasionally and took a while to find. +The solution I have implemented is to generate declaration of a return value variable at the entry of every function, and to generate code to evaluate the return expression into the variable *before* generating the code to free the local string copy. +In theory the Oberon compiler could inspect the return value for reference to a local copy and only generate the result variable when necessary, however this considerably complicate the Oberon compiler source code for procedure entry and would be of questionalble value, as the C compiler should be able to optimize code with a result variable much the same as code without it. + + - Texts.WriteInt corrected to work with both 4 and 8 byte LONGINTs. Previously values with more than 11 digits caused an index out of range error. + + - Between voc.Translate and extTools.Mod, the main program was being compiled twice by the C compiler. It is now compiled once. + +#### Other changes: + + - In his latest specs (around 2013) Wirth removed the 'COPY(a, b)' character array copy procedure, replacing it with 'b := a'. I have accordingly enabled 'b := a' in voc as an alternative to 'COPY(a, b)' (COPY is still supported.). + + - Oberon code often writes to Oberon.Log expecting the text to appear on the screen. While voc has an Oberon.DumpLog procedure, I looked into making the behaviour automatic. Interestingly the voc source declares the Text notifier constants replace, insert and delete, but omits implementation of the notifier calls. The implementation turned out to be very little code, and I have used it to echo all text written to Oberon.Log to the console. This has the advantage over DumpLog that text is written immediately rather than only when DumpLog is called, and allows existing program source to work unchanged. + + - While working on Vishap Oberon I have been using the name 'olang' rather than 'voc', partly to avoid mixing up binary files, and partly because I had not (re)reached compatability with voc. Since I reckon I'm close to complete, I have now parameterised the code to allow any file name for the compiler and install dir, and switched it back to 'voc' by default. src/tools/make/configure.c line 12 specifies the name that will be built. + + - I experimented with making INTEGER always 32 bit and LONGINT always 64 bit (i.e. even on 32 bit platfroms), but soon found that the libraries assume 16 bit INTEGER and 32 bit LONGINT all over the place. This experimental behaviour is still available by uncommenting the '#define LARGE' in src/tools/make/configure.c line 14. + +#### Machine size issues + +I don't see any really good solutions to different machine sizes. Existing code, such as the libraries, assumes that INTEGER is 16 bit and LONGINT is 32 bit and so is broken on 64 bit builds of voc. + +Looking at the voc source I see an unfinished implementaton of built-in types INT8, INT16, INT32 and INT64. Since this code is neither complete nor tested and I have not retained where it has been in the way of changes. + +Could the implementation of INTxx help? It does not solve (for example) the need for a type that always matches address size. Nor does it provide unsigned types. Implementation of low level memory management ideally needs both. + +Wirth's latest spec includes a BYTE type (not SYSTEM.BYTE, just BYTE) that behaves as an unsigned 8 bit integer, for use in low level code. BYTE thus avoids the need for SYSTEM.VAL when manipulating 8 bit unsigned numeric values, making code easier to write and, more importantly, easier to read. A BYTE type would be useful for microcontroller C support. So I believe it makes sense to add Wirths's BYTE to voc. (I have not done so yet). + +Linux/Unix specifies many API datatypes and structure fields in terms of named C numeric types, with the result that they vary in size between implementations. This is perhaps the strongest driving force for adding support for various numeric types to voc - but they would better match the C types than be of fixed size. + +So maybe one could provide Platform.int, Platform.long, Platform.longlong, Platform.unsignedint, Platform.unsignedlong, Platform.unsignedlonglong and, importantly for memory management, Platform.uintptr. + +Personally I miss Pascal and Modula's subrange variables. As well as being great for error detection (assuming value checking code is generated), they can also be used to imply variables of arbitrary sizes (e.g. 'VAR mybyte = 0..255;'). With these one could remove the Platform.int* types and replace them with constants Platform.MaxInt, Platform.MaxLong etc. I think this would be a cleaner more generalised option - but maybe, probably, it is a step too far. Always beware of over-generalising. Wirth found that most programmers did not use, or very rarely used, subrange types. + +#### A feature I'd really like to see + +When exiting abnormally, e.g. due to index out of range, report .Mod file name and line number at fault. Preferably include a stack trace. Wirth's original Pascal (Pascal 6000 on the CDC mainframe at ETHZ) had this at least by 1975 when I first used it. This could be achieved by including a table of line number (in .Mod file) vs code address, and having the runtime seach this table for the failure address. It would be quite a lot of work! + +#### Norayr/voc issues addressed + +The following issues are taken from https://github.com/norayr/voc/issues. + +##### Issue 7 - 'silence ccomp warnings'. +This has been done. + +##### Issue 9 - 'oberon.par arguments'. +Done for all supported platforms including Ubuntu, FreeBSD, OpenBSD, Raspbian, Darwin, Cygwin and MS C, on a mixture of 32 and 64 bit architectures. + +The vast majority of info in the .par file is redundant. For example the size and alignment of char, unsigned char, int and float is independent of platform. + +A single value is sufficient to specify alignment: above this size this value is the alignment, below this size, the alignment is the same as the type size. (Actually the latter is the type size rounded up to the enclosing power of two, but as all the Oberon type sizes are powers of two this step is unecessary.) + +The only platform differences come around the meaning of 'long' vs 'long long', pointer size and alignment of 64 bit values. These are just 3 possible combinations: + +| Pointer size | Alignment | Used on | Bootstrap directories | +| ------------ | --------- | ---------------- | --------------------- | +| 32 bit | 32 bit | Unix | unix-44 | +| 32 bit | 64 bit | Unix and Windows | unix-48, windows-48 | +| 64 bit | 64 bit | Unix and Windows | unix-88, windows-88 | + +The various C data models are named using common C compiler terminology as follows: + +| Name | 'int' size | 'long' size | 'long long' size | pointer size | +| ----- | ---------- | ----------- | ---------------- | ------------ | +| ILP32 | 32 | 32 | 64 | 32 | +| LLP64 | 32 | 32 | 64 | 64 | +| LP64 | 32 | 64 | 64 | 64 | + +##### Issue 13 - 'prepare Linux/x86asm target'. +Linux is currently compiled using PlatfromUnix.Mod, but the integration of Windows support has made the Platform interface reasonably OS independent, so implementing a PlatformLinux.Mod using Linux kernel calls directly should be straightforward. + +##### Issue 14 - 'separate rtl from SYSTEM?'. +OS specific code is now all in Platformxxx.Mod. Memory management (including the loaded module list) is now in Heap.Mod. SYSTEM.h is platform independent, with minimal ifdefs to allow compiling on all platforms. For example, when SYSTEM.h/SYSTEM.c need to allocate memory, or to halt, they call into Platform.Mod. + + From 2b3b6a822a7424d40c0a908757796955b77d103d Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 16 Jun 2016 18:14:58 +0100 Subject: [PATCH 085/580] File mode corrections. Add lol filetype to 'lf' eolns. --- .gitattributes | 2 ++ .gitconfig | 0 .gitignore | 0 src/library/ooc/oocwrapperlibc.Mod | 0 src/system/Platformwindows.Mod | 0 src/system/WindowsWrapper.h | 0 src/test/confidence/arrayassignment/test.sh | 0 src/test/confidence/hello/test.sh | 0 src/test/confidence/lola/LSB.Mod | 0 src/test/confidence/lola/LSC.Mod | 0 src/test/confidence/lola/LSS.Mod | 0 src/test/confidence/lola/LSV.Mod | 0 src/test/confidence/lola/RISC5.Lola | 0 src/test/confidence/lola/lola.Mod | 0 src/test/confidence/lola/test.sh | 0 src/test/confidence/signal/test.sh | 0 src/test/confidence/testenv.sh | 0 src/test/confidence/testresult.sh | 0 src/tools/HeapDump/HeapDump.Mod | 0 triage/gen_changelog.sh | 0 20 files changed, 2 insertions(+) mode change 100755 => 100644 .gitattributes mode change 100755 => 100644 .gitconfig mode change 100755 => 100644 .gitignore mode change 100755 => 100644 src/library/ooc/oocwrapperlibc.Mod mode change 100755 => 100644 src/system/Platformwindows.Mod mode change 100755 => 100644 src/system/WindowsWrapper.h mode change 100755 => 100644 src/test/confidence/arrayassignment/test.sh mode change 100755 => 100644 src/test/confidence/hello/test.sh mode change 100755 => 100644 src/test/confidence/lola/LSB.Mod mode change 100755 => 100644 src/test/confidence/lola/LSC.Mod mode change 100755 => 100644 src/test/confidence/lola/LSS.Mod mode change 100755 => 100644 src/test/confidence/lola/LSV.Mod mode change 100755 => 100644 src/test/confidence/lola/RISC5.Lola mode change 100755 => 100644 src/test/confidence/lola/lola.Mod mode change 100755 => 100644 src/test/confidence/lola/test.sh mode change 100755 => 100644 src/test/confidence/signal/test.sh mode change 100755 => 100644 src/test/confidence/testenv.sh mode change 100755 => 100644 src/test/confidence/testresult.sh mode change 100755 => 100644 src/tools/HeapDump/HeapDump.Mod mode change 100755 => 100644 triage/gen_changelog.sh diff --git a/.gitattributes b/.gitattributes old mode 100755 new mode 100644 index 2746b870..08b0dbe0 --- a/.gitattributes +++ b/.gitattributes @@ -11,6 +11,8 @@ *.h text eol=lf *.Mod text eol=lf *.mod text eol=lf +*.Lola text eol=lf +*.lola text eol=lf *.make text eol=lf *makefile text eol=lf *.sh text eol=lf diff --git a/.gitconfig b/.gitconfig old mode 100755 new mode 100644 diff --git a/.gitignore b/.gitignore old mode 100755 new mode 100644 diff --git a/src/library/ooc/oocwrapperlibc.Mod b/src/library/ooc/oocwrapperlibc.Mod old mode 100755 new mode 100644 diff --git a/src/system/Platformwindows.Mod b/src/system/Platformwindows.Mod old mode 100755 new mode 100644 diff --git a/src/system/WindowsWrapper.h b/src/system/WindowsWrapper.h old mode 100755 new mode 100644 diff --git a/src/test/confidence/arrayassignment/test.sh b/src/test/confidence/arrayassignment/test.sh old mode 100755 new mode 100644 diff --git a/src/test/confidence/hello/test.sh b/src/test/confidence/hello/test.sh old mode 100755 new mode 100644 diff --git a/src/test/confidence/lola/LSB.Mod b/src/test/confidence/lola/LSB.Mod old mode 100755 new mode 100644 diff --git a/src/test/confidence/lola/LSC.Mod b/src/test/confidence/lola/LSC.Mod old mode 100755 new mode 100644 diff --git a/src/test/confidence/lola/LSS.Mod b/src/test/confidence/lola/LSS.Mod old mode 100755 new mode 100644 diff --git a/src/test/confidence/lola/LSV.Mod b/src/test/confidence/lola/LSV.Mod old mode 100755 new mode 100644 diff --git a/src/test/confidence/lola/RISC5.Lola b/src/test/confidence/lola/RISC5.Lola old mode 100755 new mode 100644 diff --git a/src/test/confidence/lola/lola.Mod b/src/test/confidence/lola/lola.Mod old mode 100755 new mode 100644 diff --git a/src/test/confidence/lola/test.sh b/src/test/confidence/lola/test.sh old mode 100755 new mode 100644 diff --git a/src/test/confidence/signal/test.sh b/src/test/confidence/signal/test.sh old mode 100755 new mode 100644 diff --git a/src/test/confidence/testenv.sh b/src/test/confidence/testenv.sh old mode 100755 new mode 100644 diff --git a/src/test/confidence/testresult.sh b/src/test/confidence/testresult.sh old mode 100755 new mode 100644 diff --git a/src/tools/HeapDump/HeapDump.Mod b/src/tools/HeapDump/HeapDump.Mod old mode 100755 new mode 100644 diff --git a/triage/gen_changelog.sh b/triage/gen_changelog.sh old mode 100755 new mode 100644 From f838e58c50fffef105bbb3aef4a5cf95380db141 Mon Sep 17 00:00:00 2001 From: David C W Brown Date: Fri, 17 Jun 2016 13:41:02 +0100 Subject: [PATCH 086/580] Make tests shell scripts executable. --- src/test/confidence/arrayassignment/test.sh | 0 src/test/confidence/hello/test.sh | 0 src/test/confidence/lola/test.sh | 0 src/test/confidence/signal/test.sh | 0 src/test/confidence/testenv.sh | 0 src/test/confidence/testresult.sh | 0 6 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 src/test/confidence/arrayassignment/test.sh mode change 100644 => 100755 src/test/confidence/hello/test.sh mode change 100644 => 100755 src/test/confidence/lola/test.sh mode change 100644 => 100755 src/test/confidence/signal/test.sh mode change 100644 => 100755 src/test/confidence/testenv.sh mode change 100644 => 100755 src/test/confidence/testresult.sh diff --git a/src/test/confidence/arrayassignment/test.sh b/src/test/confidence/arrayassignment/test.sh old mode 100644 new mode 100755 diff --git a/src/test/confidence/hello/test.sh b/src/test/confidence/hello/test.sh old mode 100644 new mode 100755 diff --git a/src/test/confidence/lola/test.sh b/src/test/confidence/lola/test.sh old mode 100644 new mode 100755 diff --git a/src/test/confidence/signal/test.sh b/src/test/confidence/signal/test.sh old mode 100644 new mode 100755 diff --git a/src/test/confidence/testenv.sh b/src/test/confidence/testenv.sh old mode 100644 new mode 100755 diff --git a/src/test/confidence/testresult.sh b/src/test/confidence/testresult.sh old mode 100644 new mode 100755 From f828e80e5627aefb639f63ff7d02f580ca83df54 Mon Sep 17 00:00:00 2001 From: David Brown Date: Sat, 18 Jun 2016 12:05:23 +0100 Subject: [PATCH 087/580] Start organising documentation. --- ReadMe.md | 98 ++++++++++++++++++++++++++++++++++ triage/hints => doc/Porting.md | 0 2 files changed, 98 insertions(+) create mode 100644 ReadMe.md rename triage/hints => doc/Porting.md (100%) diff --git a/ReadMe.md b/ReadMe.md new file mode 100644 index 00000000..cd2b6e04 --- /dev/null +++ b/ReadMe.md @@ -0,0 +1,98 @@ +### Vishap Oberon + +[â±±ishap Oberon Compiler](http://oberon.vishap.am) (voc) is a free (GPLv3) professional oberon-2 compiler. + + + +### Ñ´ishap Oberon + +[Ñ´ishap Oberon Compiler](http://oberon.vishap.am) (voc) is a free (GPLv3) professional oberon-2 compiler. + + + +### á‰ishap Oberon + +[á‰ishap Oberon Compiler](http://oberon.vishap.am) (voc) is a free (GPLv3) professional oberon-2 compiler. + + + +### ð“¥ishap Oberon + +[ð“¥ishap Oberon Compiler](http://oberon.vishap.am) (voc) is a free (GPLv3) professional oberon-2 compiler. + + + +##### Licensing + +Vishap Oberon's frontend and C backend engine is a fork of Josef Templ’s Ofront, which has been released +under the FreeBSD License. Unlike Ofront, Vishap Oberon does not include the Oberon v4 environment. + +The Ulm Oberon Library is distributed under GPL. + +The Ooc library is distributed under GPL. + +Voc tools are distributed under GPLv3. + +Most of the runtime in libVishapOberon is distributed under GPLv3 with runtime exception. + +Proprietry code using the Ulm or Ooc libraries may not be statically linked as they are +distributed under the GPL. + + +##### Platform support + +Vishap Oberon supports 32 and 64 bit little-endian architectures including Intel x86 and x64, arm and ppc. + +It compiles under gcc, clang and Microsoft Visual C. + +Installation supports GNU/Linux, MAC OSX, BSD and Windows (native and cygwin). + +##### Language support + +Vishap Oberon supports the Oberon 2 programming language, including type-bound procedures. + +It can also compile programs written to the Oberon07 report. + + +##### Libraries + +Vishap Oberon comes with libraries easing the porting of code from the major +Oberon systems: + + - Oberon V4 and S3 compatible library set. + + - ooc (optimizing oberon-2 compiler) library port. + + - Ulm’s Oberon system library port. + +Some other freely redistributable libraries are available as a part of voc distribution. + + +##### Features + +See [Features](/doc/Features.md). + +##### Installing + +See [Installing](/doc/Installing.md). + +##### Compiling Oberon modules + +See [Compiling](/doc/Compiling.md). + +##### Porting to new platforms + +See [Porting](/doc/Porting.md). + +##### Roadmap + +See [Roadmap](/doc/Roadmap.md). + +##### Contributors + +##### Origin of the name Vishap + +##### To be left out? + +Work on other compatibility layers is in progress. +voc team also works on bindings to existing C/Pascal libraries. diff --git a/triage/hints b/doc/Porting.md similarity index 100% rename from triage/hints rename to doc/Porting.md From 342d883d110cbd90b0fa27a73ab7c44fdf15e8df Mon Sep 17 00:00:00 2001 From: David Brown Date: Sat, 18 Jun 2016 16:38:42 +0100 Subject: [PATCH 088/580] Update version to 1.95. Add more early version documentation. --- ReadMe.md | 37 +++++--- doc/Features.md | 9 ++ doc/History.md | 108 +++++++++++++++++++++ doc/Installation.md | 188 +++++++++++++++++++++++++++++++++++++ doc/Roadmap.md | 84 +++++++++++++++++ makefile | 11 +-- src/tools/make/configure.c | 2 +- src/tools/make/vishap.make | 15 ++- triage/hints | 39 ++++++++ 9 files changed, 467 insertions(+), 26 deletions(-) create mode 100644 doc/Features.md create mode 100644 doc/History.md create mode 100644 doc/Installation.md create mode 100644 doc/Roadmap.md create mode 100644 triage/hints diff --git a/ReadMe.md b/ReadMe.md index cd2b6e04..d15b111f 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -22,7 +22,7 @@ -##### Licensing +#### Licensing Vishap Oberon's frontend and C backend engine is a fork of Josef Templ’s Ofront, which has been released under the FreeBSD License. Unlike Ofront, Vishap Oberon does not include the Oberon v4 environment. @@ -39,7 +39,7 @@ Proprietry code using the Ulm or Ooc libraries may not be statically linked as t distributed under the GPL. -##### Platform support +#### Platform support Vishap Oberon supports 32 and 64 bit little-endian architectures including Intel x86 and x64, arm and ppc. @@ -47,14 +47,14 @@ It compiles under gcc, clang and Microsoft Visual C. Installation supports GNU/Linux, MAC OSX, BSD and Windows (native and cygwin). -##### Language support +#### Language support Vishap Oberon supports the Oberon 2 programming language, including type-bound procedures. It can also compile programs written to the Oberon07 report. -##### Libraries +#### Libraries Vishap Oberon comes with libraries easing the porting of code from the major Oberon systems: @@ -68,31 +68,44 @@ Oberon systems: Some other freely redistributable libraries are available as a part of voc distribution. -##### Features +#### Features See [Features](/doc/Features.md). -##### Installing +#### Installing See [Installing](/doc/Installing.md). -##### Compiling Oberon modules +#### Compiling Oberon modules See [Compiling](/doc/Compiling.md). -##### Porting to new platforms +#### Porting to new platforms See [Porting](/doc/Porting.md). -##### Roadmap +#### History + +See [History](/doc/History.md). + +#### Roadmap See [Roadmap](/doc/Roadmap.md). -##### Contributors +#### Contributors -##### Origin of the name Vishap +Originally developed as a cross platform implementation of the +Oberon system by Joseph Templ. -##### To be left out? +Updated for 64 bit support, refactored as a standalone compiler and brought +to new platforms by Norayr Chilingarian. + +Build process simplified for more platform support and bugs fixed by David +C W Brown. + +#### Origin of the name Vishap + +#### To be left out? Work on other compatibility layers is in progress. voc team also works on bindings to existing C/Pascal libraries. diff --git a/doc/Features.md b/doc/Features.md new file mode 100644 index 00000000..4548c77f --- /dev/null +++ b/doc/Features.md @@ -0,0 +1,9 @@ +HALT/exit code has been simplified. Exit now just calls the system exit API rather than calling the kill API and passing our own process ID. For runtime errors it now displayes the appropriate error message (e.g. Index out of range). + +Compilation errors now include the line number at the start of the displayed source line. The pos (character offset) is still displayed on the error message line. The error handling code was already doing some walking of the source file to find start and end of line - I changed this to walk through the source file from the start identifying line end positions, counting lines and caching the position at the start of the last error line. The resultant code is simpler, and displays the line number without losing the pos. The performance cost of walking the source file is not an issue. + + + - In his latest specs (around 2013) Wirth removed the 'COPY(a, b)' character array copy procedure, replacing it with 'b := a'. I have accordingly enabled 'b := a' in voc as an alternative to 'COPY(a, b)' (COPY is still supported.). + + - Oberon code often writes to Oberon.Log expecting the text to appear on the screen. While voc has an Oberon.DumpLog procedure, I looked into making the behaviour automatic. Interestingly the voc source declares the Text notifier constants replace, insert and delete, but omits implementation of the notifier calls. The implementation turned out to be very little code, and I have used it to echo all text written to Oberon.Log to the console. This has the advantage over DumpLog that text is written immediately rather than only when DumpLog is called, and allows existing program source to work unchanged. + diff --git a/doc/History.md b/doc/History.md new file mode 100644 index 00000000..c5793673 --- /dev/null +++ b/doc/History.md @@ -0,0 +1,108 @@ +#### Changes from 1.2 to 2.0 + +The biggest changes relative to Vishap Oberon 1.2 are in the build system and in the implementation of platform specific support. Where possible platform specific code has removed or replaced by platform agnostic code. + + - The same make commands are used for all platforms, Linux, BSD, Darwin and Windows. In particular 'make full' +builds the compiler, library and tools, installs the compiler and tools, and runs a couple of confidence tests. + + - The C program 'configure.c', a much expanded version of vocparam.c, generates all the platform specific make variables, and the configuration constants compiled into the compiler. Configure.c is compiled and executed at the start of every make command. + + - Both makefiles are platform independent, compatible with both BSD make and GNU make. (For Visual C builds on Windows a separate make.cmd contains the equivalent functionality expressed as a Windows .cmd file.) + + - All duplicate files required to build Linux/BSD/Darwin variants have been removed by refactoring them to be platform independent: + - Rather than accessing Linux structures through Oberon RECORDs intended to match their memory layout, code procedures are used to reference C constants and struct fields directly. (This resolves a number of complexities with structure field order and layout variations across operating systems.) + - Size dependent code is abstracted into simple definitions in SYSTEM.h and referenced from code procedures. + - Files.Mod is extended with a file search path feature removing the need for Files0.Mod, Text0.Mod and Kernel0.Mod. Instead OPM.cmdln.Mod calls the new Files.SetSearchPath. + - Kernel.Mod, Unix.Mod and SYSTEM.Mod are refactored into Heap.Mod and PlatformUnix.Mod. An alternate Platform module implementation PlatformWindows.Mod is used for Microsoft C based builds, using the Win32 API directly. + - All use of the LONGINT type in C source, including in code procedures, now explicitly specify 'LONGINT'. Previously the code often used 'long' instead, assuming it was interchangeable with 'LONGINT', but for some platforms LONGINT is 'long long', not 'long'. + + - The enlistment no longer includes compiled binaries. Instead it includes pre-translated sets of C source covering both platforms and the three C data model variants. (See directory 'bootstrap'.) + + - The bootstrap sources are used on any fresh enlistment or clean build ('make full' is always a clean build). These sources, combined with the platform independence improvements outlined above, have built correctly from a fresh enlistment on all Linux, BSD and cygwin platforms that I have tried, including the raspberry pi under raspbian, and in the termux terminal emulator on android. + +The result is that there is now a single version of earch Oberon source file, with the exceptions only of PlatformUnix.Mod/PlatformWindows.Mod in the compiler, and oocCILP32.Mod/oocCLP64.Mod/oocCLLP64.Mod in the ooc library. + +The full build is now free of warnings: + + - Missing ELSE warnings solved by adding ELSE. + + - C code conversion between integer and pointer of different size solved by casting with with uintptr_t as an intermediate type. + + - C code conversion between signed and unsigned char types solved by explicitly casting 'CHAR's passed to system APIs in code procedures to 'char'. + +The full build now includes a few confidence tests to make sure that the basics work OK. + +HALT/exit code has been simplified. Exit now just calls the system exit API rather than calling the kill API and passing our own process ID. For runtime errors it now displayes the appropriate error message (e.g. Index out of range). + +The jump buffer was not used by any code and has been removed. (It seems from a comment to have been intended for use during some termination code, but the termination code does not use it.) + +Compilation errors now include the line number at the start of the displayed source line. The pos (character offset) is still displayed on the error message line. The error handling code was already doing some walking of the source file to find start and end of line - I changed this to walk through the source file from the start identifying line end positions, counting lines and caching the position at the start of the last error line. The resultant code is simpler, and displays the line number without losing the pos. The performance cost of walking the source file is not an issue. + +##### A few bug fix details: + + - There was a problem with the dynamic array size parameter passed to NEW when expressed as a literal on 64 bit builds. This happens a number of times in the compiler and library. Now in theory it is not necessary to specify the size of numeric literals on parameters to ANSI C functions as the compiler should know the size from the declaration of the called function. (i.e. it shouldn't matter whether one passes '1', '1l', or '1ll'.) +Therefore while OPM.PromoteIntConstToLInt was coded to generate 'l' at the end of long literal parameters on K&R C, it intentionally omitted the 'l' when the compiler was known to be ANSI - and all currently supported compilers are ANSI. +**But** it is not safe to omit the 'l' in literal parameters to C vararg functions: the C compiler cannot get the vararg parameter size from the declaration, and so uses the literal size. Thus only 32 bits are pushed to the stack where 64 bits are required. On a 64 bit Oberon, the implementation of SYSTEM\_NEWARR then reads a full 64 bits. Often the uninitialised 32 bits are zero, and everything works correctly. Rarely they are a very small integer and the system thrashes a while allocating page tables and then continues normally. Other times a segmentation fault or out of memery error is generated. +Removing the test for ANSI and thus always generating the trailing 'l' for LONGINTs is a sufficient fix for the data models supported by the previous versions of Vishap Oberon. +However there is a further complication - this is not sufficient for the LLP64 C data model used by 64 bit Windows. In LLP64, 'long' is only 32 bit. The 64 bit integer type is 'long long' and literal numerics of this type would require an 'll' suffix. +The simple solution was to generate a (LONGINT)(n) typecast, which forces n to the correct size in all cases. + + - SYSTEM.H __VAL(t, x) was defined as (\*(t\*)&(x)) which maps the new type onto the memory of the old. This produces the wrong result if the new type is larger than the old type, because it includes memory that does not belong to the variable into the result. This has been corrected to the simpler ((t)(x)) which will do the appropriate signed or unsigned extension. + + - There was a serious issue with accessing free'd memory in RETURN expressions. Oberon generates code to create local copies of dynamic strings passed by value (so that code is free to change the value parameter without affecting the original string). +The copy is not allocated from the Oberon Heap, but direct from the OS (e.g. via malloc on Linux/Unix). At function return the compiler inserts a call to C's free before the return statement. +The problem comes when the expression on the Oberon RETURN statement references the local string copy. This gets compiled to a C 'return' statement that references the free'd memory. Sometimes the C free will not have modified the string copy, and no error is seen. However all bets are off - the OS or C runtime could have done anything to this memory as part of heap management (e.g. used it for free chain linkage), and with pre-emptive multitasking it may have been reallocated and used for another purpose before the return expression refers to it. This bug hit me occasionally and took a while to find. +The solution I have implemented is to generate declaration of a return value variable at the entry of every function, and to generate code to evaluate the return expression into the variable *before* generating the code to free the local string copy. +In theory the Oberon compiler could inspect the return value for reference to a local copy and only generate the result variable when necessary, however this considerably complicate the Oberon compiler source code for procedure entry and would be of questionalble value, as the C compiler should be able to optimize code with a result variable much the same as code without it. + + - Texts.WriteInt corrected to work with both 4 and 8 byte LONGINTs. Previously values with more than 11 digits caused an index out of range error. + + - Between voc.Translate and extTools.Mod, the main program was being compiled twice by the C compiler. It is now compiled once. + +#### Other changes: + + - In his latest specs (around 2013) Wirth removed the 'COPY(a, b)' character array copy procedure, replacing it with 'b := a'. I have accordingly enabled 'b := a' in voc as an alternative to 'COPY(a, b)' (COPY is still supported.). + + - Oberon code often writes to Oberon.Log expecting the text to appear on the screen. While voc has an Oberon.DumpLog procedure, I looked into making the behaviour automatic. Interestingly the voc source declares the Text notifier constants replace, insert and delete, but omits implementation of the notifier calls. The implementation turned out to be very little code, and I have used it to echo all text written to Oberon.Log to the console. This has the advantage over DumpLog that text is written immediately rather than only when DumpLog is called, and allows existing program source to work unchanged. + + - While working on Vishap Oberon I have been using the name 'olang' rather than 'voc', partly to avoid mixing up binary files, and partly because I had not (re)reached compatability with voc. Since I reckon I'm close to complete, I have now parameterised the code to allow any file name for the compiler and install dir, and switched it back to 'voc' by default. src/tools/make/configure.c line 12 specifies the name that will be built. + + - I experimented with making INTEGER always 32 bit and LONGINT always 64 bit (i.e. even on 32 bit platfroms), but soon found that the libraries assume 16 bit INTEGER and 32 bit LONGINT all over the place. This experimental behaviour is still available by uncommenting the '#define LARGE' in src/tools/make/configure.c line 14. + +#### Norayr/voc issues addressed + +The following issues are taken from https://github.com/norayr/voc/issues. + +##### Issue 7 - 'silence ccomp warnings'. +This has been done. + +##### Issue 9 - 'oberon.par arguments'. +Done for all supported platforms including Ubuntu, FreeBSD, OpenBSD, Raspbian, Darwin, Cygwin and MS C, on a mixture of 32 and 64 bit architectures. + +The vast majority of info in the .par file is redundant. For example the size and alignment of char, unsigned char, int and float is independent of platform. + +A single value is sufficient to specify alignment: above this size this value is the alignment, below this size, the alignment is the same as the type size. (Actually the latter is the type size rounded up to the enclosing power of two, but as all the Oberon type sizes are powers of two this step is unecessary.) + +The only platform differences come around the meaning of 'long' vs 'long long', pointer size and alignment of 64 bit values. These are just 3 possible combinations: + +| Pointer size | Alignment | Used on | Bootstrap directories | +| ------------ | --------- | ---------------- | --------------------- | +| 32 bit | 32 bit | Unix | unix-44 | +| 32 bit | 64 bit | Unix and Windows | unix-48, windows-48 | +| 64 bit | 64 bit | Unix and Windows | unix-88, windows-88 | + +The various C data models are named using common C compiler terminology as follows: + +| Name | 'int' size | 'long' size | 'long long' size | pointer size | +| ----- | ---------- | ----------- | ---------------- | ------------ | +| ILP32 | 32 | 32 | 64 | 32 | +| LLP64 | 32 | 32 | 64 | 64 | +| LP64 | 32 | 64 | 64 | 64 | + +##### Issue 13 - 'prepare Linux/x86asm target'. +Linux is currently compiled using PlatfromUnix.Mod, but the integration of Windows support has made the Platform interface reasonably OS independent, so implementing a PlatformLinux.Mod using Linux kernel calls directly should be straightforward. + +##### Issue 14 - 'separate rtl from SYSTEM?'. +OS specific code is now all in Platformxxx.Mod. Memory management (including the loaded module list) is now in Heap.Mod. SYSTEM.h is platform independent, with minimal ifdefs to allow compiling on all platforms. For example, when SYSTEM.h/SYSTEM.c need to allocate memory, or to halt, they call into Platform.Mod. + + diff --git a/doc/Installation.md b/doc/Installation.md new file mode 100644 index 00000000..e53ad28f --- /dev/null +++ b/doc/Installation.md @@ -0,0 +1,188 @@ +## TODO + - Organise into summary and per-platfrom sections + - with subsections for linux and BSD variants + - Add pre-requisites. E.g. static library support. + +#### Building and installation summary + +1. git clone https://github.com/dcwbrown/olang +2. cd olang +3. make full + +Since 'make full' will install the compiler and libraries, it needs root (unix) or administrator (windows) privileges. + +| System | Install dir | Access required | +| ----------------------- | -------------------------------------- | ------------------------------ | +| Linux | /opt/voc | Needs root except under cygwin | +| BSD | /usr/local/share/voc | Needs root | +| Windows (mingw or Visual C) | %ProgramFiles[(X86)]% | Needs administrator | +| Termux (android) | /data/data/com.termux/files/opt/voc | | + + +#### 32 and 64 bit + +The size of compiler built is determined by the C compiler that runs, which is in turn determined by +the shell or command prompt configuration you are running under. + +The following Oberon types are independent of compiler size: + +| Types | Size | +| ----- | -------| +| CHAR, SHORTINT | 8 bit | +| REAL | 32 bit | +| LONGREAL | 64 bit | + +The following type sizes follow the built compiler size: + +| Types | 32 bit builds | 64 bit builds | +| ----- | ------------- | ------------- | +| INTEGER | 16 bit | 32 bit | +| LONGINT, SET | 32 bit | 16 bit | + +Note that many library modules have been written with the assumption that INTEGER +is 16 bit and LONGINT 32 bit, therefore they will only work in 32 bit builds. + +#### Which compiler? (gcc vs clang) + +By default make uses the compiler defined in variable CC. This can be overriden by running 'export CC=gcc' or 'export CC=clang' from the command line before running make. + +*Note*: be sure to run 'make clean' any time you change the value of CC. Otherwise directories will be mixed up. + +*Note*: Darwin (MAC OS/X) redirects gcc to clang, so specifying CC=gcc still builds clang binaries under Darwin. + + +#### Building on Windows + +There are three ways to build on Windows: + +| Type | How to build | Compiled binary uses: | +| ----------- | ------- | --------------------- | +| cygwin | Use 'make' from cygwin bash shell. | cygwin.dll | +| mingw under cygwin | Set CC for mingw then use 'make' from cygwin bash shell. | Win32 API | +| Visual C | Use 'make.cmd' from Visual C command prompt. | Win32 API | + +##### mingw on cygwin + +To use mingw, install the correct sized package and export CC= the compiler name: + + - For 32 bit cygwin + + - use setup-x86.exe to add the package mingw64-i686-gcc-core. + - run 'export CC=i686-w64-mingw32-gcc' then 'make full' + + - For 64 bit cygwin + + - use setup-x86\_64.exe to add the package mingw64-x86\_64-gcc-core. + - run 'export CC=x86_64-w64-mingw32-gcc' then 'make full' + +(*Note*: Don't be put off by the name 'mingw64' in the 32 bit package.) + +##### Microsoft Visual C compiler + +Use the free command line Visual C++ compiler. At the time of writing it can be +downloaded here: + + http://landinghub.visualstudio.com/visual-cpp-build-tools + +For example (Windows 10): + +Start an adminstrator command prompt from the start button as follows: + + Start / All apps / Visual C++ Build Tools + +Right click on + + Visual C++ 2015 x86 Native Build Tools Command Prompt + +or + + Visual C++ 2015 x64 Native Build Tools Command Prompt + +And select + + More / Administrative Command Prompt + +#### A 'Hello' application + +Anything appended to Oberon.Log is automatically displayed on the console, so the +following conventional Oberon program will display 'Hello.': + + MODULE hello; + IMPORT Oberon, Texts; + VAR W: Texts.Writer; + BEGIN + Texts.OpenWriter(W); + Texts.WriteString(W, "Hello."); Texts.WriteLn(W); + Texts.Append(Oberon.Log, W.buf) + END hello. + +Alternatively the Console may be accessed directly as follows: + + MODULE hello; + IMPORT Console; + BEGIN + Console.String("Hello."); Console.Ln; + END hello. + +Compile as follows: + + voc hello.mod -m + +The -m parameter tells voc that this is a main module, and to generate an +executable binary. + +Execute as usual on Linux ('./hello') or Windows ('hello'). + +#### How make adapts to each platform + +On all platforms other than Visual C on Windows, make runs from a bash shell, +using makefile in the enlistment root, and vishap.make in the src/tools/make +directory. + +For Visual C only, there is a slightly cut down implementation of the same +functionality in the file 'make.cmd' in the enlistment root. + +In all cases src/tools/make/configure.c is executed to determine all +platform dependent parameters: it generates two files: + + - Configuration.Make: a set of environment variables included by the makefile + - Configuration.Mod: An Oberon MODULE containing just configuraton constants. + +The following examples correspond to a 32 bit Ubuntu build using GCC: + +Configuration.Make: + + OLANGDIR=/home/dave/projects/oberon/olang + COMPILER=gcc + OS=ubuntu + VERSION=1.2 + ONAME=voc + DATAMODEL=ILP32 + INTSIZE=2 + ADRSIZE=4 + ALIGNMENT=4 + INSTALLDIR=/opt/voc + PLATFORM=unix + BINEXT= + COMPILE=gcc -fPIC -g + STATICLINK=-static + LDCONFIG=if echo "/opt/voc/lib" >/etc/ld.so.conf.d/libvoc.conf; then ldconfig; fi + +Configuration.Mod: + + MODULE Configuration; + CONST + name* = 'voc'; + versionLong* = '1.2 [2016/06/11] for gcc ILP32 on ubuntu'; + intsize* = 2; + addressSize* = 4; + alignment* = 4; + objext* = '.o'; + objflag* = ' -o '; + linkflags* = ' -L"'; + libspec* = ' -l voc'; + compile* = 'gcc -fPIC -g'; + dataModel* = 'ILP32'; + installdir* = '/opt/voc'; + staticLink* = '-static'; + END Configuration. diff --git a/doc/Roadmap.md b/doc/Roadmap.md new file mode 100644 index 00000000..460e5f51 --- /dev/null +++ b/doc/Roadmap.md @@ -0,0 +1,84 @@ + +#### Machine size issues + +I don't see any really good solutions to different machine sizes. Existing code, +such as the libraries, assumes that INTEGER is 16 bit and LONGINT is 32 bit and +so is broken on 64 bit builds of voc. + +Could the implementation of INTnn types help? It would not solve (for example) +the need for a type that always matches address size. Nor would it provide +unsigned types. Implementation of low level memory management needs both. + +Wirth's latest spec includes a BYTE type (not SYSTEM.BYTE, just BYTE) that +behaves as an unsigned 8 bit integer, for use in low level code. BYTE thus +avoids the need for SYSTEM.VAL when manipulating 8 bit unsigned numeric values, +making code easier to write and, more importantly, easier to read. A BYTE type +would be useful for microcontroller C support. So I believe it makes sense to +add Wirths's BYTE to voc. + +Linux/Unix specifies many API datatypes and structure fields in terms of named C +numeric types, with the result that they vary in size between implementations. +This is perhaps the strongest driving force for adding support for various +numeric types to voc - but they would better match the C types than be of fixed +size. + +So maybe one could provide Platform.int, Platform.long, Platform.longlong, +Platform.unsignedint, Platform.unsignedlong, Platform.unsignedlonglong and, +importantly for memory management, Platform.uintptr. + +Personally I miss Pascal and Modula's subrange variables. As well as being great +for error detection (assuming value checking code is generated), they can also +be used to imply variables of arbitrary sizes (e.g. 'VAR mybyte = 0..255;'). +With these one could remove the Platform.int* types and replace them with +constants Platform.MaxInt, Platform.MaxLong etc. I think this would be a cleaner +more generalised option - but maybe, probably, it is a step too far. Always +beware of over-generalising. Wirth found that most programmers did not use, or +very rarely used, subrange types. + +#### More thoughts about 64 bit support and what INTEGER and LONGINT mean + +Arguably, because Oberon says LONGINT is big enough for addresses, +it seems that LONGINT has to be 64 bits on a 64 bit system. + +But I'm having second thoughts. + +There's a lot of code out there that assumes the size of INTEGER and LONGINT +and is broken if they are not 16 and 32 bits respectively. Frustratingly a +lot of the broken code doesn't go wrong until it encounters values outside the +16 and 32 bit ranges - like Texts.WriteInt which handles values up 2**32 fine, +and then aborts the program with an index out of range error when the number +is more than 11 characters long. + +I suggest use of LONGINT for addresses is a small subset of use cases of LONGINT. + +Instead I propose we + - keep INTEGER at 16 bits and LONGINT at 32 bits. + - Add LONG64 for 64 bit signed integers, to be available on both 32 and 64 + bit systems, (quite possible as C has an int64_t on both systems). + - add a SYSTEM.ADDRESS type for address manipulation + - an unsigned type that always matches the machine address size (32, 64 or even 16 bit). + - is compatible with SHORTINT, INTEGER, LONGINT and LONG64. + +It means changing the memory management and platform interface code, but it +means client code does not need changing. + +This fixes the current 16 bit hole in the range of INTEGER types on 64 bit systems. + + +#### A feature I'd really like to see + +We should report .Mod file name and line number at fault when exiting abnormally, +e.g. due to index out of range. Followed by a stack trace. + +Wirth's original Pascal (Pascal 6000 on the CDC mainframe at ETHZ) had this at +least by 1975. This could be achieved by including a table of .Mod file line +number vs code address, and having the runtime seach this table for the failure +address. It would be quite a lot of work! + +#### Oberon 07/15 mode + + - Add standard BYTE type being an unsigned integer between 0 and 255. + - Structured value parameters become read-only and get passed the same way as + VAR parameters - i.e. no copying. + - CASE statements only support INTEGER (with low positive values) and CHAR. + - Reject LOOP statements. diff --git a/makefile b/makefile index 2cc4da4e..a9185517 100644 --- a/makefile +++ b/makefile @@ -131,6 +131,7 @@ clean: configuration # full: Full build of compiler and libarary. full: configuration + @make -f src/tools/make/vishap.make -s installable @make -f src/tools/make/vishap.make -s clean @make -f src/tools/make/vishap.make -s translate @make -f src/tools/make/vishap.make -s assemble @@ -166,9 +167,11 @@ library: configuration # install: Copy built files to install directory install: configuration + @make -f src/tools/make/vishap.make -s installable @make -f src/tools/make/vishap.make -s install uninstall: configuration + @make -f src/tools/make/vishap.make -s installable @make -f src/tools/make/vishap.make -s uninstall @@ -237,11 +240,3 @@ autobuild: configuration # autostop: Tell test clients to exit their wait loop. autostop: configuration ./testclient -c "exit" - - - - - - - - diff --git a/src/tools/make/configure.c b/src/tools/make/configure.c index 7eb7123b..1117962f 100644 --- a/src/tools/make/configure.c +++ b/src/tools/make/configure.c @@ -8,7 +8,7 @@ // Derived from vocparam.c originally by J. Templ 23.6.95 -#define O_VER 1.2 // Version number to be reported by compiler. +#define O_VER 1.95 // Version number to be reported by compiler. #define O_NAME voc // Compiler name used for binary, install dir and references in text. // #define LARGE // Define this to get 32 bit INTEGER and 64 bit longints even on 32 bit platforms. diff --git a/src/tools/make/vishap.make b/src/tools/make/vishap.make index d7fdbe23..c2fd9015 100644 --- a/src/tools/make/vishap.make +++ b/src/tools/make/vishap.make @@ -150,6 +150,16 @@ testtools: +# installable: Check for access to the installation directory + +installable: + @rm -rf "S(INSTALLDIR)/test-access-qqq" + @if ! mkdir -p "$(INSTALLDIR)/test-access-qqq";then echo Cannot write to install directory, please use sudo or run as root/administrator; exit 1;fi + @rm -rf "S(INSTALLDIR)/test-access-qqq" + + + + # install: Use only after a successful full build. Installs the compiler # and libraries in /opt/$(ONAME). # May require root access. @@ -365,8 +375,3 @@ auto: @make -f src/tools/make/vishap.make -s assemble @make -f src/tools/make/vishap.make -s testtools while cmd=$$(./testclient -w "$(FLAVOUR)"); do $$cmd 2>&1 | ./testclient -s "$(FLAVOUR)"; done - - - - - diff --git a/triage/hints b/triage/hints new file mode 100644 index 00000000..2722e294 --- /dev/null +++ b/triage/hints @@ -0,0 +1,39 @@ +==how to port to a new platform== +0) generate voc.par file for the target platform(if it does not exist in src/par). + you can do it by compiling vocparam, and running it as "./vocparam > voc.par" +1) generate voc, ocat, showdef source for target platform by running + make -f makefile.gcc. port0 + (or copy corresponding voc.par to the source directory yourself, remove stage2 from port0 section of the makefile, and run make port0) +2) transfer source to a target platform and write + make port1 + (or use a crosscompiler) + now you have voc, showdef, and ocat binaries for your target platform +3) cp voc vocstatic + make -f makefile for your target. +that's how I've done x86 port. +voc was originally run on x86_64. + +notes** in practice everything is not always simple, because you may need to edit Unix.Mod, Args.Mod and SYSTEM.h, and put them to src/lib/system/gcc/, and create new makefile for your target. + + +==how to add a new option== + +define it in OPM as a constant before defopt is defined. +define a BOOLEAN variable in OPM which will describe if setting is set. +add handling of a new option in OPM.ScanOptions +set your BOOLEAN value in OPM.OpenPari (or in ScanOptions, after the CASE) so you can check it later. +check your boolean when necessary, (see useParFile in OPM.GetOptions) +add it in OPC.GenHeaderMsg function. + +==known bugs== + +when using SYSTEM.LSH(s, n) where s is SET, +c compiler generates an error like +"error: duplicate 'unsigned'", +that's because SET is defined as unsigned in SYSTEM.h, +while LSH is defined in SYSTEM.h as ((t)((unsigned t)(x)<<(n))), +and it makes not possible to make SYSTEM.LSH with type SET. +I don't want to prohibit it at the parser level +because C backend is only one of possible backends. +The solution currently is to cast set type to longint before lsh-ing it. +And then casting it back to set if necessary. From f050fc2fe42d0d5c945d7ab9d6f94beb2da9c0d5 Mon Sep 17 00:00:00 2001 From: David Date: Sat, 18 Jun 2016 17:44:02 +0100 Subject: [PATCH 089/580] Nice error message when install dir inaccessible. --- src/tools/make/vishap.make | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/make/vishap.make b/src/tools/make/vishap.make index c2fd9015..87015b71 100644 --- a/src/tools/make/vishap.make +++ b/src/tools/make/vishap.make @@ -154,7 +154,7 @@ testtools: installable: @rm -rf "S(INSTALLDIR)/test-access-qqq" - @if ! mkdir -p "$(INSTALLDIR)/test-access-qqq";then echo Cannot write to install directory, please use sudo or run as root/administrator; exit 1;fi + @if ! mkdir -p "$(INSTALLDIR)/test-access-qqq";then echo "\\n\\n Cannot write to install directory.\\n Please use sudo or run as root/administrator.\\n\\n"; exit 1;fi @rm -rf "S(INSTALLDIR)/test-access-qqq" From 739a94313b45d9e9da21ac6a0dce2eabf18b9baf Mon Sep 17 00:00:00 2001 From: David Brown Date: Mon, 20 Jun 2016 18:36:44 +0100 Subject: [PATCH 090/580] Slight doc changes, new multi-machine build approach. --- ReadMe.md | 4 +-- doc/Roadmap.md | 1 + src/tools/make/vishap.make | 2 +- src/tools/testcoordinator/buildall.sh | 39 +++++++++++++++++++++++++++ 4 files changed, 43 insertions(+), 3 deletions(-) create mode 100644 src/tools/testcoordinator/buildall.sh diff --git a/ReadMe.md b/ReadMe.md index d15b111f..4407c569 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -72,9 +72,9 @@ Some other freely redistributable libraries are available as a part of voc distr See [Features](/doc/Features.md). -#### Installing +#### Installation -See [Installing](/doc/Installing.md). +See [Installation](/doc/Installation.md). #### Compiling Oberon modules diff --git a/doc/Roadmap.md b/doc/Roadmap.md index 460e5f51..593f9e6f 100644 --- a/doc/Roadmap.md +++ b/doc/Roadmap.md @@ -82,3 +82,4 @@ address. It would be quite a lot of work! VAR parameters - i.e. no copying. - CASE statements only support INTEGER (with low positive values) and CHAR. - Reject LOOP statements. + - All imported variables are read-only. diff --git a/src/tools/make/vishap.make b/src/tools/make/vishap.make index 87015b71..43986b73 100644 --- a/src/tools/make/vishap.make +++ b/src/tools/make/vishap.make @@ -364,7 +364,7 @@ confidence: if [ "$(PLATFORM)" != "windows" ] ; then cd src/test/confidence/signal; ./test.sh "$(INSTALLDIR)"; fi cd src/test/confidence/lola; ./test.sh "$(INSTALLDIR)" cd src/test/confidence/arrayassignment; ./test.sh "$(INSTALLDIR)" - @printf "\n\n--- Confidence tests passed ---\n\n" + @printf "\n\n--- Branch $$(git rev-parse --abbrev-ref HEAD) $(OS) $(COMPILER) $(DATAMODEL) confidence tests passed ---\n\n" diff --git a/src/tools/testcoordinator/buildall.sh b/src/tools/testcoordinator/buildall.sh new file mode 100644 index 00000000..ad420253 --- /dev/null +++ b/src/tools/testcoordinator/buildall.sh @@ -0,0 +1,39 @@ +#branch=v2docs +#ssh pi@pie "cd projects/oberon/vishap/voc && sudo git checkout $branch && sudo make clean" & +#ssh dave@dcb "cd projects/oberon/vishap/voc && sudo git checkout $branch && sudo make clean" & +#ssh dave@nas-ub64 "cd vishap/voc && sudo git checkout $branch && sudo make clean" & +#ssh dave@lub32 "cd vishap/voc && sudo git checkout $branch && sudo make clean" & +#ssh root@nas-ob32 "cd vishap/voc && git checkout $branch && make clean" & +#ssh root@oberon "cd vishap/voc && git checkout $branch && make clean" & + +declare -A VOCLOGIN +VOCLOGIN[pi]=pi@pie +VOCLOGIN[darwin]=dave@dcb +VOCLOGIN[ub64]=dave@nas-ub64 +VOCLOGIN[lub32]=dave@lub32 +VOCLOGIN[ob32]=root@nas-ob32 +VOCLOGIN[fb64]=root@oberon + +declare -A VOCDIR +VOCDIR[pi]=projects/oberon/vishap/voc +VOCDIR[darwin]=projects/oberon/vishap/voc +VOCDIR[ub64]=vishap/voc +VOCDIR[lub32]=vishap/voc +VOCDIR[ob32]=vishap/voc +VOCDIR[fb64]=vishap/voc + +declare -A VOCSUDO +VOCSUDO[pi]="sudo " +VOCSUDO[darwin]="sudo " +VOCSUDO[ub64]="sudo " +VOCSUDO[lub32]="sudo " +VOCSUDO[ob32]="" +VOCSUDO[fb64]="" + +for MACHINE in "${!VOCLOGIN[@]}" +do +SETBRANCH="${VOCSUDO[$MACHINE]} git checkout $branch" +PULL="${VOCSUDO[$MACHINE]} git pull" +MAKE="${VOCSUDO[$MACHINE]} make full" +ssh ${VOCLOGIN[$MACHINE]} "cd ${VOCDIR[$MACHINE]} && $SETBRANCH && $PULL && $MAKE" | perl -pe "use POSIX strftime; print strftime \"%H:%M:%S $MACHINE: \", localtime" | tee log/$MACHINE.log & +done From 119365d4a9ee910de98f8087da8a6e8414443357 Mon Sep 17 00:00:00 2001 From: David Brown Date: Wed, 22 Jun 2016 14:12:14 +0100 Subject: [PATCH 091/580] Add buildall perl script --- src/compiler/OPM.cmdln.Mod | 2 +- src/tools/testcoordinator/buildall.pl | 71 +++++++++++++++++++++++++++ 2 files changed, 72 insertions(+), 1 deletion(-) create mode 100644 src/tools/testcoordinator/buildall.pl diff --git a/src/compiler/OPM.cmdln.Mod b/src/compiler/OPM.cmdln.Mod index 6a02cc91..32b95689 100644 --- a/src/compiler/OPM.cmdln.Mod +++ b/src/compiler/OPM.cmdln.Mod @@ -181,7 +181,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) (* Undocumented options used by the build system: - The following two parameter overrides the integer size, pointer size and alignment + The following parameter overrides the integer size, pointer size and alignment settings compiled into the binary. They are used when bootstrapping to generate the C source for a compiler with different sizes to the current compiler. diff --git a/src/tools/testcoordinator/buildall.pl b/src/tools/testcoordinator/buildall.pl new file mode 100644 index 00000000..7f0360f4 --- /dev/null +++ b/src/tools/testcoordinator/buildall.pl @@ -0,0 +1,71 @@ +#!perl -w +use strict; +use warnings; +use POSIX "strftime"; + +my $branch = "v2docs"; + +my %machines = ( + "pi" => ['pi@pie', "projects/oberon/vishap/voc", "sudo"], + "darwin" => ['dave@dcb', "projects/oberon/vishap/voc", "sudo"], + "lub32" => ['dave@lub32', "vishap/voc", "sudo"], + "ob32" => ['root@nas-ob32', "vishap/voc", "" ], + "fb64" => ['root@oberon', "vishap/voc", "" ], + "ub64" => ['dave@nas-ub64', "vishap/voc", "sudo"] +); + + +sub logged { + my ($cmd, $id) = @_; + my $child = fork; + if (not defined $child) {die "Fork failed.";} + if ($child) { + # parent process + print "Started $id, pid = $child\n"; + } else { + # child process + open(my $log, ">log/$id.log") // die "Could not create log file log/$id.log"; + print $log strftime("%Y/%m/%d %H.%M.%S ", localtime), "$id.log\n"; + print $log strftime("%H.%M.%S", localtime), "> $cmd\n"; + print $id, " ", strftime("%H.%M.%S", localtime), "> $cmd\n"; + open(my $pipe, "$cmd 2>&1 |") // die "Could not open pipe from command $cmd."; + while (<$pipe>) { + my $line = $_; + print $id, " ", strftime("%H.%M.%S", localtime), " ", $line; + print $log strftime("%H.%M.%S", localtime), " ", $line; + } + close($pipe); + close($log); + exit; + } +} + + + +for my $machine (sort keys %machines) { + my ($login, $dir, $sudo) = @{$machines{$machine}}; + my $cmd = "ssh $login \"cd $dir && $sudo git checkout $branch && $sudo git pull && $sudo make full\" "; + logged($cmd, $machine); +} + +while ((my $pid = wait) > 0) {print "Child pid $pid completed.\n";} +print "Buildall complete.\n"; +exit; + + + +#branch=v2docs +#ssh pi@pie "cd projects/oberon/vishap/voc && sudo git checkout $branch && sudo make clean" & +#ssh dave@dcb "cd projects/oberon/vishap/voc && sudo git checkout $branch && sudo make clean" & +#ssh dave@nas-ub64 "cd vishap/voc && sudo git checkout $branch && sudo make clean" & +#ssh dave@lub32 "cd vishap/voc && sudo git checkout $branch && sudo make clean" & +#ssh root@nas-ob32 "cd vishap/voc && git checkout $branch && make clean" & +#ssh root@oberon "cd vishap/voc && git checkout $branch && make clean" & + +#for MACHINE in "${!VOCLOGIN[@]}" +#do +#SETBRANCH="${VOCSUDO[$MACHINE]} git checkout $branch" +#PULL="${VOCSUDO[$MACHINE]} git pull" +#MAKE="${VOCSUDO[$MACHINE]} make full" +#ssh ${VOCLOGIN[$MACHINE]} "cd ${VOCDIR[$MACHINE]} && $SETBRANCH && $PULL && $MAKE" | perl -pe "use POSIX strftime; print strftime \"%H:%M:%S $MACHINE: \", localtime" | tee log/$MACHINE.log & +#done From f2c55cc4de16be573e57f42efd5862a084773cb4 Mon Sep 17 00:00:00 2001 From: David C W Brown Date: Thu, 23 Jun 2016 14:25:31 +0100 Subject: [PATCH 092/580] Simple readme change (to test web hook). --- ReadMe.md | 8 ++----- src/compiler/OPB.Mod | 56 ++++++++++++++++++++++---------------------- 2 files changed, 30 insertions(+), 34 deletions(-) diff --git a/ReadMe.md b/ReadMe.md index 4407c569..5fc6881e 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -27,17 +27,13 @@ Vishap Oberon's frontend and C backend engine is a fork of Josef Templ’s Ofront, which has been released under the FreeBSD License. Unlike Ofront, Vishap Oberon does not include the Oberon v4 environment. -The Ulm Oberon Library is distributed under GPL. - -The Ooc library is distributed under GPL. +The Ulm Oberon Library and the Ooc libraries are distributed under GPL. Proprietry code +using these libraries may not be statically linked. Voc tools are distributed under GPLv3. Most of the runtime in libVishapOberon is distributed under GPLv3 with runtime exception. -Proprietry code using the Ulm or Ooc libraries may not be statically linked as they are -distributed under the GPL. - #### Platform support diff --git a/src/compiler/OPB.Mod b/src/compiler/OPB.Mod index 8b7468c1..a06b1cfc 100644 --- a/src/compiler/OPB.Mod +++ b/src/compiler/OPB.Mod @@ -409,9 +409,9 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) END ; z^.typ := OPT.booltyp | adr: (*SYSTEM.ADR*) - IF (z^.class = Nconst) & (f = Char) & (z^.conval^.intval >= 20H) THEN - CharToString(z); f := String - END; + IF (z^.class = Nconst) & (f = Char) & (z^.conval^.intval >= 20H) THEN + CharToString(z); f := String + END; IF (z^.class < Nconst) OR (f = String) THEN z := NewOp(op, typ, z) ELSE err(127) END ; @@ -906,8 +906,8 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) | lss, leq, gtr, geq: IF (f IN {Undef, Char..LReal(*, Int8..Int64*)}) OR strings(z, y) THEN typ := OPT.booltyp ELSE - OPM.LogWLn; OPM.LogWStr("ELSE in Op()"); OPM.LogWLn; - err(108); typ := OPT.undftyp + OPM.LogWLn; OPM.LogWStr("ELSE in Op()"); OPM.LogWLn; + err(108); typ := OPT.undftyp END ; NewOp(op, typ, z, y) ELSE @@ -977,24 +977,24 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) Undef, String: (* | Int8: IF (ynode.typ.size > OPM.Int8Size) THEN - IF OPM.Verbose THEN OPM.LogWStr("f of int8"); OPM.LogWLn END; - err(113) - END + IF OPM.Verbose THEN OPM.LogWStr("f of int8"); OPM.LogWLn END; + err(113) + END | Int16: IF (ynode.typ.size > OPM.Int16Size) THEN - IF OPM.Verbose THEN OPM.LogWStr("f of int16"); OPM.LogWLn END; - err(113) - END + IF OPM.Verbose THEN OPM.LogWStr("f of int16"); OPM.LogWLn END; + err(113) + END | Int32: IF (ynode.typ.size > OPM.Int32Size) THEN - IF OPM.Verbose THEN OPM.LogWStr("f of int32"); OPM.LogWLn END; - err(113) - END + IF OPM.Verbose THEN OPM.LogWStr("f of int32"); OPM.LogWLn END; + err(113) + END | Int64: IF ynode.typ.size > OPM.Int64Size THEN - IF OPM.Verbose THEN OPM.LogWStr("f of int64"); OPM.LogWLn END; - err(113) - END*) + IF OPM.Verbose THEN OPM.LogWStr("f of int64"); OPM.LogWLn END; + err(113) + END*) | Byte: IF ~(g IN {Byte, Char, SInt}) THEN err(113) END | Bool, Char, SInt, Set: @@ -1003,10 +1003,10 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) IF ~(g IN {SInt, Int}) THEN err(113) END | LInt: IF OPM.LIntSize = 4 THEN - IF ~(g IN {SInt, Int, LInt(*, Int8, Int16, Int32*)}) THEN err(113) END - ELSE (* assume OPM.LIntSize = 8 *) + IF ~(g IN {SInt, Int, LInt(*, Int8, Int16, Int32*)}) THEN err(113) END + ELSE (* assume OPM.LIntSize = 8 *) IF ~(g IN {SInt, Int, LInt(*, Int8, Int16, Int32, Int64*)}) THEN err(113) END - END; + END; | Real: IF ~(g IN {SInt..Real}) THEN err(113) END | LReal: @@ -1131,10 +1131,10 @@ avoid unnecessary intermediate variables in voc | SInt: x := NewIntConst(OPM.MinSInt) | Int: x := NewIntConst(OPM.MinInt) | LInt: x := NewIntConst(OPM.MinLInt) - (* | Int8: x := NewIntConst(OPM.MinInt8) - | Int16: x := NewIntConst(OPM.MinInt16) - | Int32: x := NewIntConst(OPM.MinInt32) - | Int64: err(111)(*x := NewIntConst(OPM.MinInt64)*) (* int64 constants not implemented yet *)*) + (* | Int8: x := NewIntConst(OPM.MinInt8) + | Int16: x := NewIntConst(OPM.MinInt16) + | Int32: x := NewIntConst(OPM.MinInt32) + | Int64: err(111)(*x := NewIntConst(OPM.MinInt64)*) (* int64 constants not implemented yet *)*) | Set: x := NewIntConst(0); x^.typ := OPT.inttyp | Real: x := NewRealConst(OPM.MinReal, OPT.realtyp) | LReal: x := NewRealConst(OPM.MinLReal, OPT.lrltyp) @@ -1150,10 +1150,10 @@ avoid unnecessary intermediate variables in voc | SInt: x := NewIntConst(OPM.MaxSInt) | Int: x := NewIntConst(OPM.MaxInt) | LInt: x := NewIntConst(OPM.MaxLInt) - (* | Int8: x := NewIntConst(OPM.MaxInt8) - | Int16: x := NewIntConst(OPM.MaxInt16) - | Int32: x := NewIntConst(OPM.MaxInt32) - | Int64: err(111); (*x := NewIntConst(OPM.MaxInt64)*) (* int64 contstants not implemented yet *)*) + (* | Int8: x := NewIntConst(OPM.MaxInt8) + | Int16: x := NewIntConst(OPM.MaxInt16) + | Int32: x := NewIntConst(OPM.MaxInt32) + | Int64: err(111); (*x := NewIntConst(OPM.MaxInt64)*) (* int64 contstants not implemented yet *)*) | Set: x := NewIntConst(OPM.MaxSet); x^.typ := OPT.inttyp | Real: x := NewRealConst(OPM.MaxReal, OPT.realtyp) | LReal: x := NewRealConst(OPM.MaxLReal, OPT.lrltyp) From 03805e5fdb7821ea93c7df5ec5e0a21c852363a1 Mon Sep 17 00:00:00 2001 From: David C W Brown Date: Thu, 23 Jun 2016 14:29:27 +0100 Subject: [PATCH 093/580] Simple readme change (to ttry json web hook). --- ReadMe.md | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/ReadMe.md b/ReadMe.md index 5fc6881e..4435c195 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -3,22 +3,19 @@ [â±±ishap Oberon Compiler](http://oberon.vishap.am) (voc) is a free (GPLv3) professional oberon-2 compiler. +-- or -- -### Ñ´ishap Oberon - -[Ñ´ishap Oberon Compiler](http://oberon.vishap.am) (voc) is a free (GPLv3) professional oberon-2 compiler. - - +### Ñ´ishap Oberon ### á‰ishap Oberon -[á‰ishap Oberon Compiler](http://oberon.vishap.am) (voc) is a free (GPLv3) professional oberon-2 compiler. - - - ### ð“¥ishap Oberon -[ð“¥ishap Oberon Compiler](http://oberon.vishap.am) (voc) is a free (GPLv3) professional oberon-2 compiler. +[ Ñ´ishap Oberon Compiler](http://oberon.vishap.am) + +[á‰ishap Oberon Compiler](http://oberon.vishap.am) + +[ð“¥ishap Oberon Compiler](http://oberon.vishap.am) From d8e26c635e5193e021bd0d4681d05d9660fab774 Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 24 Jun 2016 00:30:27 +0100 Subject: [PATCH 094/580] Another readme twiddle to generate a github hook. --- ReadMe.md | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/ReadMe.md b/ReadMe.md index 4435c195..333942dd 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -5,18 +5,9 @@ -- or -- -### Ñ´ishap Oberon - -### á‰ishap Oberon - -### ð“¥ishap Oberon - -[ Ñ´ishap Oberon Compiler](http://oberon.vishap.am) - -[á‰ishap Oberon Compiler](http://oberon.vishap.am) - -[ð“¥ishap Oberon Compiler](http://oberon.vishap.am) +### Ñ´ishap -- á‰ishap -- ð“¥ishap +Ñ´ishap -- á‰ishap -- ð“¥ishap #### Licensing From a5a8809b91f147d4b54c11a7a3c88eb3c6c64401 Mon Sep 17 00:00:00 2001 From: David Brown Date: Sun, 26 Jun 2016 17:07:40 +0100 Subject: [PATCH 095/580] Git push webhook script beginning to work. Fiddle with readme. --- ReadMe.md | 21 ++++++++++----- src/tools/testcoordinator/buildall.pl | 18 ------------- src/tools/testcoordinator/buildall.sh | 39 --------------------------- src/tools/testcoordinator/postpush.pl | 31 +++++++++++++++++++++ 4 files changed, 46 insertions(+), 63 deletions(-) delete mode 100644 src/tools/testcoordinator/buildall.sh create mode 100644 src/tools/testcoordinator/postpush.pl diff --git a/ReadMe.md b/ReadMe.md index 333942dd..549bf4aa 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -1,14 +1,23 @@ -### Vishap Oberon +### ð“¥ishap Ñ´ishap á‰ishap Oberon -[â±±ishap Oberon Compiler](http://oberon.vishap.am) (voc) is a free (GPLv3) professional oberon-2 compiler. +Oberon is both a computer language, an operating system and a graphical +user interface. Originally designed and implemented by by Niklaus Wirth and +Jürg Gutknecht at ETH Zürich in the late 1980s, it demonstrates that the +fundamentals of a modern OS and GUI can be implemented in clean and simple code +orders of magnitude smaller than found in contemporary systems. +[ð“¥ishap â±±ishap á‰ishap Oberon](http://oberon.vishap.am) is a free and open source (GPLv3) +implementation of the Oberon-2 language compiler and libraries for use on +current operating systems such as Linux, BSD, Android, Mac and Windows. --- or -- +The Oberon language is the logical evolution of the Pascal and Modula languages, +following the principals of Einstein and Antoine de Saint-Exupéry: -### Ñ´ishap -- á‰ishap -- ð“¥ishap - -Ñ´ishap -- á‰ishap -- ð“¥ishap +> Make it as simple as possible, but not simpler. (A. Einstein) +> Perfection is finally attained not when there is no longer anything to add, but +> when there is no longer anything to take away. (Antoine de Saint-Exupéry, +> Terre des Hommes, 1939, translated by Lewis Galantière.) #### Licensing diff --git a/src/tools/testcoordinator/buildall.pl b/src/tools/testcoordinator/buildall.pl index 7f0360f4..2aedc2c2 100644 --- a/src/tools/testcoordinator/buildall.pl +++ b/src/tools/testcoordinator/buildall.pl @@ -51,21 +51,3 @@ for my $machine (sort keys %machines) { while ((my $pid = wait) > 0) {print "Child pid $pid completed.\n";} print "Buildall complete.\n"; exit; - - - -#branch=v2docs -#ssh pi@pie "cd projects/oberon/vishap/voc && sudo git checkout $branch && sudo make clean" & -#ssh dave@dcb "cd projects/oberon/vishap/voc && sudo git checkout $branch && sudo make clean" & -#ssh dave@nas-ub64 "cd vishap/voc && sudo git checkout $branch && sudo make clean" & -#ssh dave@lub32 "cd vishap/voc && sudo git checkout $branch && sudo make clean" & -#ssh root@nas-ob32 "cd vishap/voc && git checkout $branch && make clean" & -#ssh root@oberon "cd vishap/voc && git checkout $branch && make clean" & - -#for MACHINE in "${!VOCLOGIN[@]}" -#do -#SETBRANCH="${VOCSUDO[$MACHINE]} git checkout $branch" -#PULL="${VOCSUDO[$MACHINE]} git pull" -#MAKE="${VOCSUDO[$MACHINE]} make full" -#ssh ${VOCLOGIN[$MACHINE]} "cd ${VOCDIR[$MACHINE]} && $SETBRANCH && $PULL && $MAKE" | perl -pe "use POSIX strftime; print strftime \"%H:%M:%S $MACHINE: \", localtime" | tee log/$MACHINE.log & -#done diff --git a/src/tools/testcoordinator/buildall.sh b/src/tools/testcoordinator/buildall.sh deleted file mode 100644 index ad420253..00000000 --- a/src/tools/testcoordinator/buildall.sh +++ /dev/null @@ -1,39 +0,0 @@ -#branch=v2docs -#ssh pi@pie "cd projects/oberon/vishap/voc && sudo git checkout $branch && sudo make clean" & -#ssh dave@dcb "cd projects/oberon/vishap/voc && sudo git checkout $branch && sudo make clean" & -#ssh dave@nas-ub64 "cd vishap/voc && sudo git checkout $branch && sudo make clean" & -#ssh dave@lub32 "cd vishap/voc && sudo git checkout $branch && sudo make clean" & -#ssh root@nas-ob32 "cd vishap/voc && git checkout $branch && make clean" & -#ssh root@oberon "cd vishap/voc && git checkout $branch && make clean" & - -declare -A VOCLOGIN -VOCLOGIN[pi]=pi@pie -VOCLOGIN[darwin]=dave@dcb -VOCLOGIN[ub64]=dave@nas-ub64 -VOCLOGIN[lub32]=dave@lub32 -VOCLOGIN[ob32]=root@nas-ob32 -VOCLOGIN[fb64]=root@oberon - -declare -A VOCDIR -VOCDIR[pi]=projects/oberon/vishap/voc -VOCDIR[darwin]=projects/oberon/vishap/voc -VOCDIR[ub64]=vishap/voc -VOCDIR[lub32]=vishap/voc -VOCDIR[ob32]=vishap/voc -VOCDIR[fb64]=vishap/voc - -declare -A VOCSUDO -VOCSUDO[pi]="sudo " -VOCSUDO[darwin]="sudo " -VOCSUDO[ub64]="sudo " -VOCSUDO[lub32]="sudo " -VOCSUDO[ob32]="" -VOCSUDO[fb64]="" - -for MACHINE in "${!VOCLOGIN[@]}" -do -SETBRANCH="${VOCSUDO[$MACHINE]} git checkout $branch" -PULL="${VOCSUDO[$MACHINE]} git pull" -MAKE="${VOCSUDO[$MACHINE]} make full" -ssh ${VOCLOGIN[$MACHINE]} "cd ${VOCDIR[$MACHINE]} && $SETBRANCH && $PULL && $MAKE" | perl -pe "use POSIX strftime; print strftime \"%H:%M:%S $MACHINE: \", localtime" | tee log/$MACHINE.log & -done diff --git a/src/tools/testcoordinator/postpush.pl b/src/tools/testcoordinator/postpush.pl new file mode 100644 index 00000000..9a7dcf5e --- /dev/null +++ b/src/tools/testcoordinator/postpush.pl @@ -0,0 +1,31 @@ +#!/usr/bin/perl -w + + +use strict; +use warnings; + + +use CGI qw(:standard escapeHTML); +use JSON; + + +my $postdata = from_json(param('POSTDATA')); + +my $url = $postdata->{'repository'}->{'url'}; +my $ref = $postdata->{'ref'}; +my $name = $postdata->{'head_commit'}->{'author'}->{'name'}; + +my $branch = $ref; $branch =~ s'^.*\/''; +my $repo = $url; $repo =~ s'^.*\/''; + + +print header(), + start_html("Vishap Oberon github post push web hook."), + p("Repository $repo, branch $branch, name $name."), + end_html(); + + +open(LOG, ">>/tmp/postpush.log") or die "Could not create postpush.log"; +flock(LOG, 2) or die "Could not lock postpush.log"; +printf LOG "Repository $repo, branch $branch, name $name."; +close(LOG); From 44889a1b2f49d51731d2653bbcb17f7892092149 Mon Sep 17 00:00:00 2001 From: David Brown Date: Sun, 26 Jun 2016 17:12:47 +0100 Subject: [PATCH 096/580] Add newline to postpush script --- src/tools/testcoordinator/postpush.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/testcoordinator/postpush.pl b/src/tools/testcoordinator/postpush.pl index 9a7dcf5e..e98e94cd 100644 --- a/src/tools/testcoordinator/postpush.pl +++ b/src/tools/testcoordinator/postpush.pl @@ -27,5 +27,5 @@ print header(), open(LOG, ">>/tmp/postpush.log") or die "Could not create postpush.log"; flock(LOG, 2) or die "Could not lock postpush.log"; -printf LOG "Repository $repo, branch $branch, name $name."; +printf LOG "Repository $repo, branch $branch, name $name.\n"; close(LOG); From a359e16ae901cbef47fda724cc1fa74631fd3b93 Mon Sep 17 00:00:00 2001 From: David Brown Date: Mon, 27 Jun 2016 12:31:00 +0100 Subject: [PATCH 097/580] webhook progress --- ReadMe.md | 8 ++++---- src/tools/testcoordinator/postpush.pl | 5 ++++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/ReadMe.md b/ReadMe.md index 549bf4aa..81c82cf3 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -1,6 +1,6 @@ ### ð“¥ishap Ñ´ishap á‰ishap Oberon -Oberon is both a computer language, an operating system and a graphical +Oberon is a programming language, an operating system and a graphical user interface. Originally designed and implemented by by Niklaus Wirth and Jürg Gutknecht at ETH Zürich in the late 1980s, it demonstrates that the fundamentals of a modern OS and GUI can be implemented in clean and simple code @@ -10,8 +10,8 @@ orders of magnitude smaller than found in contemporary systems. implementation of the Oberon-2 language compiler and libraries for use on current operating systems such as Linux, BSD, Android, Mac and Windows. -The Oberon language is the logical evolution of the Pascal and Modula languages, -following the principals of Einstein and Antoine de Saint-Exupéry: +The language is an evolution of the Pascal and Modula languages, following the +principals of Einstein and Antoine de Saint-Exupéry: > Make it as simple as possible, but not simpler. (A. Einstein) @@ -44,7 +44,7 @@ Installation supports GNU/Linux, MAC OSX, BSD and Windows (native and cygwin). Vishap Oberon supports the Oberon 2 programming language, including type-bound procedures. -It can also compile programs written to the Oberon07 report. +It also supports some features of Oberon-07. #### Libraries diff --git a/src/tools/testcoordinator/postpush.pl b/src/tools/testcoordinator/postpush.pl index e98e94cd..3eb07825 100644 --- a/src/tools/testcoordinator/postpush.pl +++ b/src/tools/testcoordinator/postpush.pl @@ -3,6 +3,7 @@ use strict; use warnings; +use POSIX "strftime"; use CGI qw(:standard escapeHTML); @@ -27,5 +28,7 @@ print header(), open(LOG, ">>/tmp/postpush.log") or die "Could not create postpush.log"; flock(LOG, 2) or die "Could not lock postpush.log"; -printf LOG "Repository $repo, branch $branch, name $name.\n"; +printf LOG strftime("%Y/%m/%d %H.%M.%S", localtime), " Repository $repo, branch $branch, name $name.\n"; close(LOG); + +system "ssh root@oberon perl vishap/voc/src/tools/testcoordinator/buildall.pl >/tmp/buildall.log &"; From b495b2725c6c6d39bc9bbc14d307739e6c361ed4 Mon Sep 17 00:00:00 2001 From: David C W Brown Date: Mon, 27 Jun 2016 15:53:36 +0100 Subject: [PATCH 098/580] Some more significant ReadMe work. --- ReadMe.md | 69 +++++- doc/Features.md | 16 +- doc/History.md | 5 +- doc/Installation.md | 45 +--- doc/Porting.md | 95 +++++--- triage/V2CHANGES.md | 132 ---------- triage/makefile.darwin.clang.x86_64 | 310 ------------------------ triage/makefile.freebsd.clang.x86_64 | 309 ----------------------- triage/makefile.linux.clang.powerpc | 309 ----------------------- triage/makefile.linux.clang.x86_64 | 309 ----------------------- triage/makefile.linux.gcc.armv6j_hardfp | 309 ----------------------- triage/makefile.linux.gcc.powerpc | 309 ----------------------- triage/makefile.linux.gcc.x86 | 309 ----------------------- triage/makefile.linux.gcc.x86_64 | 309 ----------------------- triage/makefile.openbsd.gcc.x86_64 | 310 ------------------------ 15 files changed, 148 insertions(+), 2997 deletions(-) delete mode 100644 triage/makefile.darwin.clang.x86_64 delete mode 100644 triage/makefile.freebsd.clang.x86_64 delete mode 100644 triage/makefile.linux.clang.powerpc delete mode 100644 triage/makefile.linux.clang.x86_64 delete mode 100644 triage/makefile.linux.gcc.armv6j_hardfp delete mode 100644 triage/makefile.linux.gcc.powerpc delete mode 100644 triage/makefile.linux.gcc.x86 delete mode 100644 triage/makefile.linux.gcc.x86_64 delete mode 100644 triage/makefile.openbsd.gcc.x86_64 diff --git a/ReadMe.md b/ReadMe.md index 81c82cf3..46738ec7 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -10,7 +10,12 @@ orders of magnitude smaller than found in contemporary systems. implementation of the Oberon-2 language compiler and libraries for use on current operating systems such as Linux, BSD, Android, Mac and Windows. -The language is an evolution of the Pascal and Modula languages, following the +Vishap's Oberon Compiler (voc) uses a C backend to compile +Oberon programs under Unix or Windows. Vishap Oberon includes +libraries from the Ulm, oo2c and Ofront Oberon compilers, as well as +default libraries complying with the Oakwood Guidelines for Oberon-2 compilers. + +The Oberon language is an evolution of the Pascal and Modula languages, following the principals of Einstein and Antoine de Saint-Exupéry: > Make it as simple as possible, but not simpler. (A. Einstein) @@ -19,6 +24,60 @@ principals of Einstein and Antoine de Saint-Exupéry: > when there is no longer anything to take away. (Antoine de Saint-Exupéry, > Terre des Hommes, 1939, translated by Lewis Galantière.) +#### Installation + +1. `git clone https://github.com/vishaps/voc` +2. `cd voc` +3. `[sudo] make full` + +Since 'make full' will install the compiler and libraries, it needs root (unix) or administrator (windows) privileges. + +Then set your path to the installed compiler binary location as reported +by make full, e.g. + +| System | Set path | +| --------- | -------------------------------------- | +| Linux | `export PATH="/opt/voc/bin:$PATH"` | +| BSD | `export PATH="/usr/local/share/voc/bin:$PATH"` | +| Windows | See [Installation](/doc/Installation.md) | +| Termux | `export PATH="/data/data/com.termux/files/opt/voc/bin:$PATH"` | + +Also see [Installation](/doc/Installation.md). + +#### A 'Hello' application + +Anything appended to Oberon.Log is automatically displayed on the console, so the +following conventional Oberon program will display 'Hello.': + + MODULE hello; + IMPORT Oberon, Texts; + VAR W: Texts.Writer; + BEGIN + Texts.OpenWriter(W); + Texts.WriteString(W, "Hello."); Texts.WriteLn(W); + Texts.Append(Oberon.Log, W.buf) + END hello. + +Alternatively the Console may be accessed directly as follows: + + MODULE hello; + IMPORT Console; + BEGIN + Console.String("Hello."); Console.Ln; + END hello. + +Compile as follows: + + voc hello.mod -m + +The -m parameter tells voc that this is a main module, and to generate an +executable binary. + +Execute as usual on Linux ('./hello') or Windows ('hello'). + + +Also see [Compiling](/doc/Compiling.md). + #### Licensing Vishap Oberon's frontend and C backend engine is a fork of Josef Templ’s Ofront, which has been released @@ -65,14 +124,6 @@ Some other freely redistributable libraries are available as a part of voc distr See [Features](/doc/Features.md). -#### Installation - -See [Installation](/doc/Installation.md). - -#### Compiling Oberon modules - -See [Compiling](/doc/Compiling.md). - #### Porting to new platforms See [Porting](/doc/Porting.md). diff --git a/doc/Features.md b/doc/Features.md index 4548c77f..64d19e68 100644 --- a/doc/Features.md +++ b/doc/Features.md @@ -1,3 +1,18 @@ +The following Oberon types are independent of compiler size: + +| Types | Size | +| ----- | -------| +| CHAR, SHORTINT | 8 bit | +| REAL | 32 bit | +| LONGREAL | 64 bit | + +The following type sizes follow the built compiler size: + +| Types | 32 bit builds | 64 bit builds | +| ----- | ------------- | ------------- | +| INTEGER | 16 bit | 32 bit | +| LONGINT, SET | 32 bit | 16 bit | + HALT/exit code has been simplified. Exit now just calls the system exit API rather than calling the kill API and passing our own process ID. For runtime errors it now displayes the appropriate error message (e.g. Index out of range). Compilation errors now include the line number at the start of the displayed source line. The pos (character offset) is still displayed on the error message line. The error handling code was already doing some walking of the source file to find start and end of line - I changed this to walk through the source file from the start identifying line end positions, counting lines and caching the position at the start of the last error line. The resultant code is simpler, and displays the line number without losing the pos. The performance cost of walking the source file is not an issue. @@ -6,4 +21,3 @@ Compilation errors now include the line number at the start of the displayed sou - In his latest specs (around 2013) Wirth removed the 'COPY(a, b)' character array copy procedure, replacing it with 'b := a'. I have accordingly enabled 'b := a' in voc as an alternative to 'COPY(a, b)' (COPY is still supported.). - Oberon code often writes to Oberon.Log expecting the text to appear on the screen. While voc has an Oberon.DumpLog procedure, I looked into making the behaviour automatic. Interestingly the voc source declares the Text notifier constants replace, insert and delete, but omits implementation of the notifier calls. The implementation turned out to be very little code, and I have used it to echo all text written to Oberon.Log to the console. This has the advantage over DumpLog that text is written immediately rather than only when DumpLog is called, and allows existing program source to work unchanged. - diff --git a/doc/History.md b/doc/History.md index c5793673..3bfe2a27 100644 --- a/doc/History.md +++ b/doc/History.md @@ -1,3 +1,6 @@ +### History + + #### Changes from 1.2 to 2.0 The biggest changes relative to Vishap Oberon 1.2 are in the build system and in the implementation of platform specific support. Where possible platform specific code has removed or replaced by platform agnostic code. @@ -104,5 +107,3 @@ Linux is currently compiled using PlatfromUnix.Mod, but the integration of Windo ##### Issue 14 - 'separate rtl from SYSTEM?'. OS specific code is now all in Platformxxx.Mod. Memory management (including the loaded module list) is now in Heap.Mod. SYSTEM.h is platform independent, with minimal ifdefs to allow compiling on all platforms. For example, when SYSTEM.h/SYSTEM.c need to allocate memory, or to halt, they call into Platform.Mod. - - diff --git a/doc/Installation.md b/doc/Installation.md index e53ad28f..fe08aa3d 100644 --- a/doc/Installation.md +++ b/doc/Installation.md @@ -5,9 +5,9 @@ #### Building and installation summary -1. git clone https://github.com/dcwbrown/olang -2. cd olang -3. make full +1. git clone https://github.com/vishaps/voc +2. cd voc +3. [sudo] make full Since 'make full' will install the compiler and libraries, it needs root (unix) or administrator (windows) privileges. @@ -24,14 +24,6 @@ Since 'make full' will install the compiler and libraries, it needs root (unix) The size of compiler built is determined by the C compiler that runs, which is in turn determined by the shell or command prompt configuration you are running under. -The following Oberon types are independent of compiler size: - -| Types | Size | -| ----- | -------| -| CHAR, SHORTINT | 8 bit | -| REAL | 32 bit | -| LONGREAL | 64 bit | - The following type sizes follow the built compiler size: | Types | 32 bit builds | 64 bit builds | @@ -102,37 +94,6 @@ And select More / Administrative Command Prompt -#### A 'Hello' application - -Anything appended to Oberon.Log is automatically displayed on the console, so the -following conventional Oberon program will display 'Hello.': - - MODULE hello; - IMPORT Oberon, Texts; - VAR W: Texts.Writer; - BEGIN - Texts.OpenWriter(W); - Texts.WriteString(W, "Hello."); Texts.WriteLn(W); - Texts.Append(Oberon.Log, W.buf) - END hello. - -Alternatively the Console may be accessed directly as follows: - - MODULE hello; - IMPORT Console; - BEGIN - Console.String("Hello."); Console.Ln; - END hello. - -Compile as follows: - - voc hello.mod -m - -The -m parameter tells voc that this is a main module, and to generate an -executable binary. - -Execute as usual on Linux ('./hello') or Windows ('hello'). - #### How make adapts to each platform On all platforms other than Visual C on Windows, make runs from a bash shell, diff --git a/doc/Porting.md b/doc/Porting.md index 29585f90..5145e7b9 100644 --- a/doc/Porting.md +++ b/doc/Porting.md @@ -1,39 +1,78 @@ -==how to port to a new platform== -0) generate voc.par file for the target platform(if it does not exist in src/par). - you can do it by compiling vocparam, and running it as "./vocparam > voc.par" -1) generate voc, ocat, showdef source for target platform by running - make -f makefile.gcc. port0 - (or copy corresponding voc.par to the source directory yourself, remove stage2 from port0 section of the makefile, and run make port0) -2) transfer source to a target platform and write - make port1 - (or use a crosscompiler) - now you have voc, showdef, and ocat binaries for your target platform -3) cp voc vocstatic - make -f makefile for your target. -that's how I've done x86 port. -voc was originally run on x86_64. +### Porting to a new platform -notes** in practice everything is not always simple, because you may need to edit Unix.Mod, Args.Mod and SYSTEM.h, and put them to src/lib/system/gcc/, and create new makefile for your target. +Porting to a new 32 or 64 bits platform is usually automatically handled +by `make full`: + + - The makefile compiles `src/tools/make/configure.c` with the + platform's default C compiler. + - `configure.c` determines which types to use for 32 and 64 bit + variables, and their alignment. + - `configure.c` uses a number of strategies to determine the + operating system it is running on and what the appropriate + installation directory will be. + - `configure.c` sets makefile variables that are used to select + which of 5 sets of preprepared C source files to build to create + the bootstrap compiler. + +On most systems this will be sufficient for `make full` to build +and install the compiler and libraries. + +`make full` will terminate with a message such as: + +`--- Branch v2docs freebsd gcc LP64 confidence tests passed ---` + +#### Updating configure.c + +It should only be necessary to change `configure.c` if it +cannot determine the correct install directory. + +In this case add code to `src/tools/make/configure.c`'s +function `determineOS()` to set the `os` variable to the name +of the new OS platform. + +The following variables are also set by `determineOS()` to the +followind defaults: + +variable | set to | example +-------- | ------ | ------- +`platform` | Base platform | `"unix"` +`binext` | Binary file extension | `""` +`staticlink` | Static linking option | `"-static"` + +If your new platform does not support static removing, set the +`staticlink` variable to `""`. + +Then modify `determineInstallDirectory()` to select the correct +instalation root based on the changes you have made to `determineOS()`. + +The `platform` variable selects which variety of the Platform +module is compiled. Vishap provides two varieties, one specific +to the Windows API (`Platformwindows.Mod`), and one suitable for +Unix-like systems including Linux, BSD, Android and cygwin +(`Platformunix.Mod`). -==how to add a new option== +#### How to add a new compiler option -define it in OPM as a constant before defopt is defined. -define a BOOLEAN variable in OPM which will describe if setting is set. -add handling of a new option in OPM.ScanOptions -set your BOOLEAN value in OPM.OpenPari (or in ScanOptions, after the CASE) so you can check it later. -check your boolean when necessary, (see useParFile in OPM.GetOptions) -add it in OPC.GenHeaderMsg function. + - Define it in OPM as a constant before defopt is defined. + - Define a BOOLEAN variable in OPM which will describe if setting is set. + - Add handling of a new option in OPM.ScanOptions + - Set your BOOLEAN value in OPM.OpenPari (or in ScanOptions, after the + CASE) so you can check it later. + - Check your boolean when necessary, (see useParFile in OPM.GetOptions) + - Add it in OPC.GenHeaderMsg function. -==known bugs== +#### Known bugs -when using SYSTEM.LSH(s, n) where s is SET, -c compiler generates an error like -"error: duplicate 'unsigned'", +When using SYSTEM.LSH(s, n) where s is SET, +the C compiler generates an error like +`error: duplicate 'unsigned'`, that's because SET is defined as unsigned in SYSTEM.h, -while LSH is defined in SYSTEM.h as ((t)((unsigned t)(x)<<(n))), +while LSH is defined in SYSTEM.h as ((t)((unsigned t)(x)<<(n))), and it makes not possible to make SYSTEM.LSH with type SET. -I don't want to prohibit it at the parser level + +I don't want to prohibit it at the parser level because C backend is only one of possible backends. + The solution currently is to cast set type to longint before lsh-ing it. And then casting it back to set if necessary. diff --git a/triage/V2CHANGES.md b/triage/V2CHANGES.md index 652e93b7..65c9de8e 100644 --- a/triage/V2CHANGES.md +++ b/triage/V2CHANGES.md @@ -2,136 +2,6 @@ This is Norayr Chilingarian's Vishap Oberon adapted to build a little more easily on a wider variety of modern platforms, including Linuxes, BSDs, MAC OSx Darwin, Cygwin on Windows, Mingw on Cygwin on Windows, Microsoft Visual C++ and even Android under Termux. See 'Changes relative to Vishap Oberon' below. -#### Building and installation summary - -1. git clone https://github.com/dcwbrown/olang -2. cd olang -3. make full - -Since 'make full' will install the compiler and libraries, it needs root (unix) or administrator (windows) privileges. - -| System | Install dir | Access required | -| ----------------------- | -------------------------------------- | ------------------------------ | -| Linux | /opt/voc | Needs root except under cygwin | -| BSD | /usr/local/share/voc | Needs root | -| Windows (mingw or Visual C) | %ProgramFiles[(X86)]% | Needs administrator | -| Termux (android) | /data/data/com.termux/files/opt/voc | | - - -#### 32 and 64 bit - -The size of compiler built is determined by the C compiler that runs, which is in turn determined by -the shell or command prompt configuration you are running under. - -The following Oberon types are independent of compiler size: - -| Types | Size | -| ----- | -------| -| CHAR, SHORTINT | 8 bit | -| REAL | 32 bit | -| LONGREAL | 64 bit | - -The following type sizes follow the built compiler size: - -| Types | 32 bit builds | 64 bit builds | -| ----- | ------------- | ------------- | -| INTEGER | 16 bit | 32 bit | -| LONGINT, SET | 32 bit | 16 bit | - -Note that many library modules have been written with the assumption that INTEGER -is 16 bit and LONGINT 32 bit, therefore they will only work in 32 bit builds. - -#### Which compiler? (gcc vs clang) - -By default make uses the compiler defined in variable CC. This can be overriden by running 'export CC=gcc' or 'export CC=clang' from the command line before running make. - -*Note*: be sure to run 'make clean' any time you change the value of CC. Otherwise directories will be mixed up. - -*Note*: Darwin (MAC OS/X) redirects gcc to clang, so specifying CC=gcc still builds clang binaries under Darwin. - - -#### Building on Windows - -There are three ways to build on Windows: - -| Type | How to build | Compiled binary uses: | -| ----------- | ------- | --------------------- | -| cygwin | Use 'make' from cygwin bash shell. | cygwin.dll | -| mingw under cygwin | Set CC for mingw then use 'make' from cygwin bash shell. | Win32 API | -| Visual C | Use 'make.cmd' from Visual C command prompt. | Win32 API | - -##### mingw on cygwin - -To use mingw, install the correct sized package and export CC= the compiler name: - - - For 32 bit cygwin - - - use setup-x86.exe to add the package mingw64-i686-gcc-core. - - run 'export CC=i686-w64-mingw32-gcc' then 'make full' - - - For 64 bit cygwin - - - use setup-x86\_64.exe to add the package mingw64-x86\_64-gcc-core. - - run 'export CC=x86_64-w64-mingw32-gcc' then 'make full' - -(*Note*: Don't be put off by the name 'mingw64' in the 32 bit package.) - -##### Microsoft Visual C compiler - -Use the free command line Visual C++ compiler. At the time of writing it can be -downloaded here: - - http://landinghub.visualstudio.com/visual-cpp-build-tools - -For example (Windows 10): - -Start an adminstrator command prompt from the start button as follows: - - Start / All apps / Visual C++ Build Tools - -Right click on - - Visual C++ 2015 x86 Native Build Tools Command Prompt - -or - - Visual C++ 2015 x64 Native Build Tools Command Prompt - -And select - - More / Administrative Command Prompt - -#### A 'Hello' application - -Anything appended to Oberon.Log is automatically displayed on the console, so the -following conventional Oberon program will display 'Hello.': - - MODULE hello; - IMPORT Oberon, Texts; - VAR W: Texts.Writer; - BEGIN - Texts.OpenWriter(W); - Texts.WriteString(W, "Hello."); Texts.WriteLn(W); - Texts.Append(Oberon.Log, W.buf) - END hello. - -Alternatively the Console may be accessed directly as follows: - - MODULE hello; - IMPORT Console; - BEGIN - Console.String("Hello."); Console.Ln; - END hello. - -Compile as follows: - - voc hello.mod -m - -The -m parameter tells voc that this is a main module, and to generate an -executable binary. - -Execute as usual on Linux ('./hello') or Windows ('hello'). - #### How make adapts to each platform On all platforms other than Visual C on Windows, make runs from a bash shell, @@ -313,5 +183,3 @@ Linux is currently compiled using PlatfromUnix.Mod, but the integration of Windo ##### Issue 14 - 'separate rtl from SYSTEM?'. OS specific code is now all in Platformxxx.Mod. Memory management (including the loaded module list) is now in Heap.Mod. SYSTEM.h is platform independent, with minimal ifdefs to allow compiling on all platforms. For example, when SYSTEM.h/SYSTEM.c need to allocate memory, or to halt, they call into Platform.Mod. - - diff --git a/triage/makefile.darwin.clang.x86_64 b/triage/makefile.darwin.clang.x86_64 deleted file mode 100644 index 10309ead..00000000 --- a/triage/makefile.darwin.clang.x86_64 +++ /dev/null @@ -1,310 +0,0 @@ -#SHELL := /bin/bash -BUILDID=$(shell date +%Y/%m/%d) -TOS = darwin -TARCH = x86_64 -#TARCH = x86 x86_64 armv6j armv6j_hardfp armv7a_hardfp powerpc -CCOMP = clang -RELEASE = 1.1 - - -INCLUDEPATH = -Isrc/lib/system/$(TOS)/$(CCOMP)/$(TARCH) - -SETPATH = CFLAGS=$(INCLUDEPATH) PATH=.:/bin:/usr/bin MODULES=.:src/lib:src/lib/v4:src/lib/v4/$(TARCH):src/lib/v4_compat:src/lib/system/$(TOS)/$(CCOMP):src/lib/system/$(TOS)/$(CCOMP)/$(TARCH):src/lib/ulm:src/lib/ulm/$(TARCH):src/lib/ooc2:src/lib/ooc2/$(TOS)/$(CCOMP):src/lib/ooc:src/lib/ooc/$(TOS)/$(CCOMP)/$(TARCH):src/lib/pow:src/lib/misc:src/lib/s3:src/lib/s3/$(TARCH):src/voc:src/voc/$(TOS)/$(CCOMP):src/voc/$(TOS)/$(CCOMP)/$(TARCH):src/tools/ocat:src/tools/browser:src/tools/vocparam:src/tools/vmake:src/tools/coco:src/test - -VOC = voc -VERSION = $(TOS).$(CCOMP).$(TARCH) -VOCSTATIC0 = $(SETPATH) ./vocstatic.$(TOS).$(CCOMP).$(TARCH) -VOCSTATIC = $(SETPATH) ./voc -VOCPARAM = $(shell ./vocparam > voc.par) -LIBNAME = VishapOberon -LIBRARY = lib$(LIBNAME) - -ifndef PRF -PRF = "/opt" -#PRF = "/Users/noch/local" -endif -PREFIX = $(PRF)/voc-$(RELEASE) -PREFIXLN = $(PRF)/voc - -CCOPT = -fPIC $(INCLUDEPATH) -g -SHRLIBEXT = dylib -CC = $(CCOMP) $(CCOPT) -c -CL = $(CCOMP) $(CCOPT) -LD = libtool -dynamic -lSystem -compatibility_version $(RELEASE) -current_version $(RELEASE) -install_name $(PREFIX)/lib/$(LIBRARY).$(SHRLIBEXT) -o $(LIBRARY).$(SHRLIBEXT) -# s is necessary to create index inside a archive -ARCHIVE = ar rcs $(LIBRARY).a - -#%.c: %.Mod -#%.o: %.c -# $(CC) $(input) - -all: stage2 stage3 stage4 stage5 stage6 stage7 - -# when porting to new platform: -# * put corresponding .par file into current directory. it can be generated on the target platform by compiling vocparam (stage0) and running (stage1) -# * run make port0 - this will generate C source files for the target architecture -# * move the source tree to the target machine, and compile (or compile here via crosscompiler) (port1) -port0: stage2 stage3 stage4 - -# now compile C source files for voc, showdef and ocat on target machine (or by using crosscompiler) -port1: stage5 -# after you have "voc" compiled for target architecture. replace vocstatic with it and run make on target platform to get everything compiled - -# this builds binary which generates voc.par -stage0: src/tools/vocparam/vocparam.c - $(CL) -I src/lib/system/$(TOS)/$(CCOMP)/$(TARCH) -o vocparam src/tools/vocparam/vocparam.c - -# this creates voc.par for a host architecture. -# comment this out if you need to build a compiler for a different architecture. -stage1: - #rm voc.par - #$(shell "./vocparam > voc.par") - #./vocparam > voc.par - $(VOCPARAM) - -# this copies necessary voc.par to the current directory. -# skip this if you are building compiler for the host architecture. -stage2: - cp src/par/voc.par.$(CCOMP).$(TARCH) voc.par -# cp src/par/voc.par.gnu.x86_64 voc.par -# cp src/par/voc.par.gnu.x86 voc.par -# cp src/par/voc.par.gnu.armv6 voc.par -# cp src/par/voc.par.gnu.armv7 voc.par - cp src/voc/prf.Mod_default src/voc/prf.Mod - -# this prepares modules necessary to build the compiler itself -stage3: - - $(VOCSTATIC0) -siapxPS SYSTEM.Mod - $(VOCSTATIC0) -sPFS Args.Mod Console.Mod Unix.Mod - sed -i.tmp "s#/opt#$(PRF)#g" src/voc/prf.Mod - $(VOCSTATIC0) -sPFS prf.Mod - $(VOCSTATIC0) -sPFS Strings.Mod architecture.Mod version.Mod Kernel0.Mod Modules.Mod - $(VOCSTATIC0) -sxPFS Files0.Mod - $(VOCSTATIC0) -sPFS Reals.Mod Texts0.Mod - $(VOCSTATIC0) -sPFS vt100.Mod - -# build the compiler -stage4: - $(VOCSTATIC0) -sPFS errors.Mod - $(VOCSTATIC0) -sPFS extTools.Mod - $(VOCSTATIC0) -sPFS OPM.cmdln.Mod - $(VOCSTATIC0) -sxPFS OPS.Mod - $(VOCSTATIC0) -sPFS OPT.Mod OPC.Mod OPV.Mod OPB.Mod OPP.Mod - $(VOCSTATIC0) -smPS voc.Mod - $(VOCSTATIC0) -smPS BrowserCmd.Mod - $(VOCSTATIC0) -smPS OCatCmd.Mod - -#this is to build the compiler from C sources. -#this is a way to create a bootstrap binary. -stage5: - $(CC) SYSTEM.c Args.c Console.c Modules.c Unix.c \ - Strings.c architecture.c prf.c version.c Kernel0.c Files0.c Reals.c Texts0.c vt100.c \ - extTools.c \ - OPM.c OPS.c OPT.c OPC.c OPV.c OPB.c OPP.c errors.c - - $(CL) voc.c -o voc \ - SYSTEM.o Args.o Console.o Modules.o Unix.o \ - Strings.o architecture.o prf.o version.o Kernel0.o Files0.o Reals.o Texts0.o vt100.o \ - extTools.o \ - OPM.o OPS.o OPT.o OPC.o OPV.o OPB.o OPP.o errors.o - $(CL) BrowserCmd.c -o showdef \ - SYSTEM.o Args.o Console.o Modules.o Unix.o Strings.o architecture.o prf.o version.o Kernel0.o Files0.o Reals.o Texts0.o vt100.o \ - OPM.o OPS.o OPT.o OPV.o OPC.o errors.o - - $(CL) OCatCmd.c -o ocat \ - SYSTEM.o Args.o Console.o Modules.o Unix.o Strings.o architecture.o prf.o version.o Kernel0.o Files0.o Reals.o Texts0.o - -# build all library files -stage6: - #v4 libs - $(VOCSTATIC) -sPF Kernel.Mod - $(VOCSTATIC) -sPF Files.Mod - $(VOCSTATIC) -sPF Texts.Mod - $(VOCSTATIC) -sPF Printer.Mod - $(VOCSTATIC) -sPF Strings.Mod - $(VOCSTATIC) -sPF Sets.Mod - $(VOCSTATIC) -sPF Sets0.Mod - $(VOCSTATIC) -sPF Oberon.Mod - - #ooc libs - $(VOCSTATIC) -sPF oocAscii.Mod - $(VOCSTATIC) -sPF oocStrings.Mod - $(VOCSTATIC) -sPF oocStrings2.Mod - $(VOCSTATIC) -sPF oocOakStrings.Mod - $(VOCSTATIC) -sPF oocCharClass.Mod - $(VOCSTATIC) -sPF oocConvTypes.Mod - $(VOCSTATIC) -sPF oocIntConv.Mod - $(VOCSTATIC) -sPF oocIntStr.Mod - $(VOCSTATIC) -sPF oocSysClock.Mod - $(VOCSTATIC) -sPF oocTime.Mod - $(VOCSTATIC) -sPF oocRandomNumbers.Mod -# $(VOCSTATIC) -s oocLongStrings.Mod -# $(CC) oocLongStrings.c -# $(VOCSTATIC) -s oocMsg.Mod -# $(CC) oocMsg.c - - - #ooc2 libs - $(VOCSTATIC) -sPF ooc2Strings.Mod - $(VOCSTATIC) -sPF ooc2Ascii.Mod - $(VOCSTATIC) -sPF ooc2CharClass.Mod - $(VOCSTATIC) -sPF ooc2ConvTypes.Mod - $(VOCSTATIC) -sPF ooc2IntConv.Mod - $(VOCSTATIC) -sPF ooc2IntStr.Mod - $(VOCSTATIC) -sPF ooc2Real0.Mod - #ooc libs - $(VOCSTATIC) -sPF oocLowReal.Mod oocLowLReal.Mod - $(VOCSTATIC) -sPF oocRealMath.Mod oocOakMath.Mod - $(VOCSTATIC) -sPF oocLRealMath.Mod - $(VOCSTATIC) -sPF oocLongInts.Mod - $(VOCSTATIC) -sPF oocComplexMath.Mod oocLComplexMath.Mod - $(VOCSTATIC) -sPF oocLRealConv.Mod oocLRealStr.Mod - $(VOCSTATIC) -sPF oocRealConv.Mod oocRealStr.Mod - $(VOCSTATIC) -sPF oocMsg.Mod oocChannel.Mod - $(VOCSTATIC) -sPF oocStrings2.Mod oocRts.Mod oocFilenames.Mod - $(VOCSTATIC) -sPF oocTextRider.Mod oocBinaryRider.Mod oocJulianDay.Mod - $(VOCSTATIC) -sPF oocFilenames.Mod - $(VOCSTATIC) -sPF oocwrapperlibc.Mod - $(VOCSTATIC) -sPF oocC.Mod - - #Ulm's Oberon system libs - $(VOCSTATIC) -sPF ulmSys.Mod - $(VOCSTATIC) -sPF ulmSYSTEM.Mod - $(VOCSTATIC) -sPF ulmASCII.Mod - $(VOCSTATIC) -sPF ulmSets.Mod - $(VOCSTATIC) -sPF ulmObjects.Mod - $(VOCSTATIC) -sPF ulmDisciplines.Mod - $(VOCSTATIC) -sPF ulmPriorities.Mod - $(VOCSTATIC) -sPF ulmServices.Mod - $(VOCSTATIC) -sPF ulmEvents.Mod - $(VOCSTATIC) -sPF ulmResources.Mod - $(VOCSTATIC) -sPF ulmForwarders.Mod - $(VOCSTATIC) -sPF ulmRelatedEvents.Mod - $(VOCSTATIC) -sPF ulmIO.Mod - $(VOCSTATIC) -sPF ulmProcess.Mod - $(VOCSTATIC) -sPF ulmTypes.Mod - $(VOCSTATIC) -sPF ulmStreams.Mod - $(VOCSTATIC) -sPF ulmAssertions.Mod - $(VOCSTATIC) -sPF ulmIndirectDisciplines.Mod - $(VOCSTATIC) -sPF ulmStreamDisciplines.Mod - $(VOCSTATIC) -sPF ulmIEEE.Mod - $(VOCSTATIC) -sPF ulmMC68881.Mod - $(VOCSTATIC) -sPF ulmReals.Mod - $(VOCSTATIC) -sPF ulmPrint.Mod - $(VOCSTATIC) -sPF ulmWrite.Mod - $(VOCSTATIC) -sPF ulmTexts.Mod - $(VOCSTATIC) -sPF ulmStrings.Mod - $(VOCSTATIC) -sPF ulmConstStrings.Mod - $(VOCSTATIC) -sPF ulmPlotters.Mod - $(VOCSTATIC) -sPF ulmSysTypes.Mod - $(VOCSTATIC) -sPF ulmSysConversions.Mod - $(VOCSTATIC) -sPF ulmErrors.Mod - $(VOCSTATIC) -sPF ulmSysErrors.Mod - $(VOCSTATIC) -sPF ulmSysIO.Mod - $(VOCSTATIC) -sPF ulmLoader.Mod - $(VOCSTATIC) -sPF ulmNetIO.Mod - $(VOCSTATIC) -sPF ulmPersistentObjects.Mod - $(VOCSTATIC) -sPF ulmPersistentDisciplines.Mod - $(VOCSTATIC) -sPF ulmOperations.Mod - $(VOCSTATIC) -sPF ulmScales.Mod - $(VOCSTATIC) -sPF ulmTimes.Mod - $(VOCSTATIC) -sPF ulmClocks.Mod - $(VOCSTATIC) -sPF ulmTimers.Mod - $(VOCSTATIC) -sPF ulmConditions.Mod - $(VOCSTATIC) -sPF ulmStreamConditions.Mod - $(VOCSTATIC) -sPF ulmTimeConditions.Mod - $(VOCSTATIC) -sPF ulmSysConversions.Mod - $(VOCSTATIC) -sPF ulmSysStat.Mod - $(VOCSTATIC) -sPF ulmCiphers.Mod - $(VOCSTATIC) -sPF ulmCipherOps.Mod - $(VOCSTATIC) -sPF ulmBlockCiphers.Mod - $(VOCSTATIC) -sPF ulmAsymmetricCiphers.Mod - $(VOCSTATIC) -sPF ulmConclusions.Mod - $(VOCSTATIC) -sPF ulmRandomGenerators.Mod - $(VOCSTATIC) -sPF ulmTCrypt.Mod - $(VOCSTATIC) -sPF ulmIntOperations.Mod - - #pow32 libs - $(VOCSTATIC) -sPF powStrings.Mod - - #misc libs - $(VOCSTATIC) -sPF MultiArrays.Mod - $(VOCSTATIC) -sPF MultiArrayRiders.Mod - $(VOCSTATIC) -sPF MersenneTwister.Mod - $(VOCSTATIC) -sPF Listen.Mod - - #s3 libs - $(VOCSTATIC) -sPF ethBTrees.Mod - $(VOCSTATIC) -sPF ethMD5.Mod - $(VOCSTATIC) -sPF ethSets.Mod - $(VOCSTATIC) -sPF ethZlib.Mod - $(VOCSTATIC) -sPF ethZlibBuffers.Mod - $(VOCSTATIC) -sPF ethZlibInflate.Mod - $(VOCSTATIC) -sPF ethZlibDeflate.Mod - $(VOCSTATIC) -sPF ethZlibReaders.Mod - $(VOCSTATIC) -sPF ethZlibWriters.Mod - $(VOCSTATIC) -sPF ethZip.Mod - $(VOCSTATIC) -sPF ethRandomNumbers.Mod - $(VOCSTATIC) -sPF ethGZReaders.Mod - $(VOCSTATIC) -sPF ethGZWriters.Mod - $(VOCSTATIC) -sPF ethUnicode.Mod - $(VOCSTATIC) -sPF ethDates.Mod - $(VOCSTATIC) -sPF ethReals.Mod - $(VOCSTATIC) -sPF ethStrings.Mod - -# build remaining tools -# $(VOCSTATIC0) -sPFS compatIn.Mod -# $(VOCSTATIC0) -smPS vmake.Mod -# $(CC) compatIn.c -# $(CL) vmake.c -o vmake SYSTEM.o Args.o compatIn.o Texts.o Console.o Files.o Reals.o Modules.o Kernel.o Unix.o Strings.o oocIntStr.o oocConvTypes.o oocIntConv.o - - - -stage7: - #remove non library objects - rm -f Kernel0.o Files0.o Texts0.o architecture.o prf.o version.o extTools.o OPM.o OPS.o OPT.o OPC.o OPV.o OPB.o OPP.o errors.o - #objects := $(wildcard *.o) - #$(LD) objects - $(ARCHIVE) *.o - #$(ARCHIVE) objects - $(LD) *.o - echo "$(PREFIX)/lib" > 05vishap.conf - -clean: -# rm_objects := rm $(wildcard *.o) -# objects - rm *.h - rm *.c - rm *.sym - rm *.o - rm *.a - rm *.$(SHRLIBEXT) - -install: - test -d $(PREFIX)/bin | mkdir -p $(PREFIX)/bin - cp voc $(PREFIX)/bin/ - cp showdef $(PREFIX)/bin/ - cp ocat $(PREFIX)/bin/ - #cp vmake $(PREFIX)/bin/ - cp -a src $(PREFIX)/ - - test -d $(PREFIX)/lib/voc | mkdir -p $(PREFIX)/lib/voc - test -d $(PREFIX)/lib/voc/ | mkdir -p $(PREFIX)/lib/voc - test -d $(PREFIX)/lib/voc/obj | mkdir -p $(PREFIX)/lib/voc/obj - test -d $(PREFIX)/lib/voc/sym | mkdir -p $(PREFIX)/lib/voc/sym - - cp $(LIBRARY).$(SHRLIBEXT) $(PREFIX)/lib - cp $(LIBRARY).a $(PREFIX)/lib - cp *.c $(PREFIX)/lib/voc/obj/ - cp *.h $(PREFIX)/lib/voc/obj/ - cp *.sym $(PREFIX)/lib/voc/sym/ - - #cp 05vishap.conf /etc/ld.so.conf.d/ - #ldconfig - ln -s $(PREFIX) $(PREFIXLN) - -# cp *.o $(PREFIX)/lib/voc/$(RELEASE)/obj/ -uninstall: - rm -rf $(PREFIX) - rm -rf $(PREFIXLN) diff --git a/triage/makefile.freebsd.clang.x86_64 b/triage/makefile.freebsd.clang.x86_64 deleted file mode 100644 index 57b44287..00000000 --- a/triage/makefile.freebsd.clang.x86_64 +++ /dev/null @@ -1,309 +0,0 @@ -#SHELL := /bin/bash -BUILDID=$(shell date +%Y/%m/%d) -TOS = freebsd -TARCH = x86_64 -#TARCH = x86 x86_64 armv6j armv6j_hardfp armv7a_hardfp powerpc -CCOMP = clang -RELEASE = 1.1 - - -INCLUDEPATH = -Isrc/lib/system/$(TOS)/$(CCOMP)/$(TARCH) - -SETPATH = CFLAGS=$(INCLUDEPATH) PATH=.:/bin:/usr/bin MODULES=.:src/lib:src/lib/v4:src/lib/v4/$(TARCH):src/lib/v4_compat:src/lib/system/$(TOS)/$(CCOMP):src/lib/system/$(TOS)/$(CCOMP)/$(TARCH):src/lib/ulm:src/lib/ulm/$(TARCH):src/lib/ooc2:src/lib/ooc2/$(TOS)/$(CCOMP):src/lib/ooc:src/lib/ooc/$(TOS)/$(CCOMP)/$(TARCH):src/lib/pow:src/lib/misc:src/lib/s3:src/lib/s3/$(TARCH):src/voc:src/voc/$(TOS)/$(CCOMP):src/voc/$(TOS)/$(CCOMP)/$(TARCH):src/tools/ocat:src/tools/browser:src/tools/vocparam:src/tools/vmake:src/tools/coco:src/test - -VOC = voc -VERSION = $(TOS).$(CCOMP).$(TARCH) -VOCSTATIC0 = $(SETPATH) ./vocstatic.$(TOS).$(CCOMP).$(TARCH) -VOCSTATIC = $(SETPATH) ./voc -VOCPARAM = $(shell ./vocparam > voc.par) -LIBNAME = VishapOberon -LIBRARY = lib$(LIBNAME) - -ifndef PRF -PRF = "/opt" -endif -PREFIX = $(PRF)/voc-$(RELEASE) -PREFIXLN = $(PRF)/voc - -CCOPT = -fPIC $(INCLUDEPATH) -g -SHRLIBEXT = so -CC = $(CCOMP) $(CCOPT) -c -CL = $(CCOMP) $(CCOPT) -LD = $(CCOMP) -shared -o $(LIBRARY).$(SHRLIBEXT) -# s is necessary to create index inside a archive -ARCHIVE = ar rcs $(LIBRARY).a - -#%.c: %.Mod -#%.o: %.c -# $(CC) $(input) - -all: stage2 stage3 stage4 stage5 stage6 stage7 - -# when porting to new platform: -# * put corresponding .par file into current directory. it can be generated on the target platform by compiling vocparam (stage0) and running (stage1) -# * run make port0 - this will generate C source files for the target architecture -# * move the source tree to the target machine, and compile (or compile here via crosscompiler) (port1) -port0: stage2 stage3 stage4 - -# now compile C source files for voc, showdef and ocat on target machine (or by using crosscompiler) -port1: stage5 -# after you have "voc" compiled for target architecture. replace vocstatic with it and run make on target platform to get everything compiled - -# this builds binary which generates voc.par -stage0: src/tools/vocparam/vocparam.c - $(CL) -I src/lib/system/$(TOS)/$(CCOMP)/$(TARCH) -o vocparam src/tools/vocparam/vocparam.c - -# this creates voc.par for a host architecture. -# comment this out if you need to build a compiler for a different architecture. -stage1: - #rm voc.par - #$(shell "./vocparam > voc.par") - #./vocparam > voc.par - $(VOCPARAM) - -# this copies necessary voc.par to the current directory. -# skip this if you are building compiler for the host architecture. -stage2: - cp src/par/voc.par.$(CCOMP).$(TARCH) voc.par -# cp src/par/voc.par.gnu.x86_64 voc.par -# cp src/par/voc.par.gnu.x86 voc.par -# cp src/par/voc.par.gnu.armv6 voc.par -# cp src/par/voc.par.gnu.armv7 voc.par - cp src/voc/prf.Mod_default src/voc/prf.Mod - -# this prepares modules necessary to build the compiler itself -stage3: - - $(VOCSTATIC0) -siapxPS SYSTEM.Mod - $(VOCSTATIC0) -sPFS Args.Mod Console.Mod Unix.Mod - sed -i.tmp "s#/opt#$(PRF)#g" src/voc/prf.Mod - $(VOCSTATIC0) -sPFS prf.Mod - $(VOCSTATIC0) -sPFS Strings.Mod architecture.Mod version.Mod Kernel0.Mod Modules.Mod - $(VOCSTATIC0) -sxPFS Files0.Mod - $(VOCSTATIC0) -sPFS Reals.Mod Texts0.Mod - $(VOCSTATIC0) -sPFS vt100.Mod - -# build the compiler -stage4: - $(VOCSTATIC0) -sPFS errors.Mod - $(VOCSTATIC0) -sPFS extTools.Mod - $(VOCSTATIC0) -sPFS OPM.cmdln.Mod - $(VOCSTATIC0) -sxPFS OPS.Mod - $(VOCSTATIC0) -sPFS OPT.Mod OPC.Mod OPV.Mod OPB.Mod OPP.Mod - $(VOCSTATIC0) -smPS voc.Mod - $(VOCSTATIC0) -smPS BrowserCmd.Mod - $(VOCSTATIC0) -smPS OCatCmd.Mod - -#this is to build the compiler from C sources. -#this is a way to create a bootstrap binary. -stage5: - $(CC) SYSTEM.c Args.c Console.c Modules.c Unix.c \ - Strings.c architecture.c prf.c version.c Kernel0.c Files0.c Reals.c Texts0.c vt100.c \ - extTools.c \ - OPM.c OPS.c OPT.c OPC.c OPV.c OPB.c OPP.c errors.c - - $(CL) -static voc.c -o voc \ - SYSTEM.o Args.o Console.o Modules.o Unix.o \ - Strings.o architecture.o prf.o version.o Kernel0.o Files0.o Reals.o Texts0.o vt100.o \ - extTools.o \ - OPM.o OPS.o OPT.o OPC.o OPV.o OPB.o OPP.o errors.o - $(CL) BrowserCmd.c -o showdef \ - SYSTEM.o Args.o Console.o Modules.o Unix.o Strings.o architecture.o prf.o version.o Kernel0.o Files0.o Reals.o Texts0.o vt100.o \ - OPM.o OPS.o OPT.o OPV.o OPC.o errors.o - - $(CL) OCatCmd.c -o ocat \ - SYSTEM.o Args.o Console.o Modules.o Unix.o Strings.o architecture.o prf.o version.o Kernel0.o Files0.o Reals.o Texts0.o - -# build all library files -stage6: - #v4 libs - $(VOCSTATIC) -sPF Kernel.Mod - $(VOCSTATIC) -sPF Files.Mod - $(VOCSTATIC) -sPF Texts.Mod - $(VOCSTATIC) -sPF Printer.Mod - $(VOCSTATIC) -sPF Strings.Mod - $(VOCSTATIC) -sPF Sets.Mod - $(VOCSTATIC) -sPF Sets0.Mod - $(VOCSTATIC) -sPF Oberon.Mod - - #ooc libs - $(VOCSTATIC) -sPF oocAscii.Mod - $(VOCSTATIC) -sPF oocStrings.Mod - $(VOCSTATIC) -sPF oocStrings2.Mod - $(VOCSTATIC) -sPF oocOakStrings.Mod - $(VOCSTATIC) -sPF oocCharClass.Mod - $(VOCSTATIC) -sPF oocConvTypes.Mod - $(VOCSTATIC) -sPF oocIntConv.Mod - $(VOCSTATIC) -sPF oocIntStr.Mod - $(VOCSTATIC) -sPF oocSysClock.Mod - $(VOCSTATIC) -sPF oocTime.Mod - $(VOCSTATIC) -sPF oocRandomNumbers.Mod -# $(VOCSTATIC) -s oocLongStrings.Mod -# $(CC) oocLongStrings.c -# $(VOCSTATIC) -s oocMsg.Mod -# $(CC) oocMsg.c - - - #ooc2 libs - $(VOCSTATIC) -sPF ooc2Strings.Mod - $(VOCSTATIC) -sPF ooc2Ascii.Mod - $(VOCSTATIC) -sPF ooc2CharClass.Mod - $(VOCSTATIC) -sPF ooc2ConvTypes.Mod - $(VOCSTATIC) -sPF ooc2IntConv.Mod - $(VOCSTATIC) -sPF ooc2IntStr.Mod - $(VOCSTATIC) -sPF ooc2Real0.Mod - #ooc libs - $(VOCSTATIC) -sPF oocLowReal.Mod oocLowLReal.Mod - $(VOCSTATIC) -sPF oocRealMath.Mod oocOakMath.Mod - $(VOCSTATIC) -sPF oocLRealMath.Mod - $(VOCSTATIC) -sPF oocLongInts.Mod - $(VOCSTATIC) -sPF oocComplexMath.Mod oocLComplexMath.Mod - $(VOCSTATIC) -sPF oocLRealConv.Mod oocLRealStr.Mod - $(VOCSTATIC) -sPF oocRealConv.Mod oocRealStr.Mod - $(VOCSTATIC) -sPF oocMsg.Mod oocChannel.Mod - $(VOCSTATIC) -sPF oocStrings2.Mod oocRts.Mod oocFilenames.Mod - $(VOCSTATIC) -sPF oocTextRider.Mod oocBinaryRider.Mod oocJulianDay.Mod - $(VOCSTATIC) -sPF oocFilenames.Mod - $(VOCSTATIC) -sPF oocwrapperlibc.Mod - $(VOCSTATIC) -sPF oocC.Mod - - #Ulm's Oberon system libs - $(VOCSTATIC) -sPF ulmSys.Mod - $(VOCSTATIC) -sPF ulmSYSTEM.Mod - $(VOCSTATIC) -sPF ulmASCII.Mod - $(VOCSTATIC) -sPF ulmSets.Mod - $(VOCSTATIC) -sPF ulmObjects.Mod - $(VOCSTATIC) -sPF ulmDisciplines.Mod - $(VOCSTATIC) -sPF ulmPriorities.Mod - $(VOCSTATIC) -sPF ulmServices.Mod - $(VOCSTATIC) -sPF ulmEvents.Mod - $(VOCSTATIC) -sPF ulmResources.Mod - $(VOCSTATIC) -sPF ulmForwarders.Mod - $(VOCSTATIC) -sPF ulmRelatedEvents.Mod - $(VOCSTATIC) -sPF ulmIO.Mod - $(VOCSTATIC) -sPF ulmProcess.Mod - $(VOCSTATIC) -sPF ulmTypes.Mod - $(VOCSTATIC) -sPF ulmStreams.Mod - $(VOCSTATIC) -sPF ulmAssertions.Mod - $(VOCSTATIC) -sPF ulmIndirectDisciplines.Mod - $(VOCSTATIC) -sPF ulmStreamDisciplines.Mod - $(VOCSTATIC) -sPF ulmIEEE.Mod - $(VOCSTATIC) -sPF ulmMC68881.Mod - $(VOCSTATIC) -sPF ulmReals.Mod - $(VOCSTATIC) -sPF ulmPrint.Mod - $(VOCSTATIC) -sPF ulmWrite.Mod - $(VOCSTATIC) -sPF ulmTexts.Mod - $(VOCSTATIC) -sPF ulmStrings.Mod - $(VOCSTATIC) -sPF ulmConstStrings.Mod - $(VOCSTATIC) -sPF ulmPlotters.Mod - $(VOCSTATIC) -sPF ulmSysTypes.Mod - $(VOCSTATIC) -sPF ulmSysConversions.Mod - $(VOCSTATIC) -sPF ulmErrors.Mod - $(VOCSTATIC) -sPF ulmSysErrors.Mod - $(VOCSTATIC) -sPF ulmSysIO.Mod - $(VOCSTATIC) -sPF ulmLoader.Mod - $(VOCSTATIC) -sPF ulmNetIO.Mod - $(VOCSTATIC) -sPF ulmPersistentObjects.Mod - $(VOCSTATIC) -sPF ulmPersistentDisciplines.Mod - $(VOCSTATIC) -sPF ulmOperations.Mod - $(VOCSTATIC) -sPF ulmScales.Mod - $(VOCSTATIC) -sPF ulmTimes.Mod - $(VOCSTATIC) -sPF ulmClocks.Mod - $(VOCSTATIC) -sPF ulmTimers.Mod - $(VOCSTATIC) -sPF ulmConditions.Mod - $(VOCSTATIC) -sPF ulmStreamConditions.Mod - $(VOCSTATIC) -sPF ulmTimeConditions.Mod - $(VOCSTATIC) -sPF ulmSysConversions.Mod - $(VOCSTATIC) -sPF ulmSysStat.Mod - $(VOCSTATIC) -sPF ulmCiphers.Mod - $(VOCSTATIC) -sPF ulmCipherOps.Mod - $(VOCSTATIC) -sPF ulmBlockCiphers.Mod - $(VOCSTATIC) -sPF ulmAsymmetricCiphers.Mod - $(VOCSTATIC) -sPF ulmConclusions.Mod - $(VOCSTATIC) -sPF ulmRandomGenerators.Mod - $(VOCSTATIC) -sPF ulmTCrypt.Mod - $(VOCSTATIC) -sPF ulmIntOperations.Mod - - #pow32 libs - $(VOCSTATIC) -sPF powStrings.Mod - - #misc libs - $(VOCSTATIC) -sPF MultiArrays.Mod - $(VOCSTATIC) -sPF MultiArrayRiders.Mod - $(VOCSTATIC) -sPF MersenneTwister.Mod - $(VOCSTATIC) -sPF Listen.Mod - - #s3 libs - $(VOCSTATIC) -sPF ethBTrees.Mod - $(VOCSTATIC) -sPF ethMD5.Mod - $(VOCSTATIC) -sPF ethSets.Mod - $(VOCSTATIC) -sPF ethZlib.Mod - $(VOCSTATIC) -sPF ethZlibBuffers.Mod - $(VOCSTATIC) -sPF ethZlibInflate.Mod - $(VOCSTATIC) -sPF ethZlibDeflate.Mod - $(VOCSTATIC) -sPF ethZlibReaders.Mod - $(VOCSTATIC) -sPF ethZlibWriters.Mod - $(VOCSTATIC) -sPF ethZip.Mod - $(VOCSTATIC) -sPF ethRandomNumbers.Mod - $(VOCSTATIC) -sPF ethGZReaders.Mod - $(VOCSTATIC) -sPF ethGZWriters.Mod - $(VOCSTATIC) -sPF ethUnicode.Mod - $(VOCSTATIC) -sPF ethDates.Mod - $(VOCSTATIC) -sPF ethReals.Mod - $(VOCSTATIC) -sPF ethStrings.Mod - -# build remaining tools -# $(VOCSTATIC0) -sPFS compatIn.Mod -# $(VOCSTATIC0) -smPS vmake.Mod -# $(CC) compatIn.c -# $(CL) vmake.c -o vmake SYSTEM.o Args.o compatIn.o Texts.o Console.o Files.o Reals.o Modules.o Kernel.o Unix.o Strings.o oocIntStr.o oocConvTypes.o oocIntConv.o - - - -stage7: - #remove non library objects - rm -f Kernel0.o Files0.o Texts0.o architecture.o prf.o version.o extTools.o OPM.o OPS.o OPT.o OPC.o OPV.o OPB.o OPP.o errors.o - #objects := $(wildcard *.o) - #$(LD) objects - $(ARCHIVE) *.o - #$(ARCHIVE) objects - $(LD) *.o - echo "$(PREFIX)/lib" > 05vishap.conf - -clean: -# rm_objects := rm $(wildcard *.o) -# objects - rm *.h - rm *.c - rm *.sym - rm *.o - rm *.a - rm *.$(SHRLIBEXT) - -install: - test -d $(PREFIX)/bin | mkdir -p $(PREFIX)/bin - cp voc $(PREFIX)/bin/ - cp showdef $(PREFIX)/bin/ - cp ocat $(PREFIX)/bin/ - #cp vmake $(PREFIX)/bin/ - cp -a src $(PREFIX)/ - - test -d $(PREFIX)/lib/voc | mkdir -p $(PREFIX)/lib/voc - test -d $(PREFIX)/lib/voc/ | mkdir -p $(PREFIX)/lib/voc - test -d $(PREFIX)/lib/voc/obj | mkdir -p $(PREFIX)/lib/voc/obj - test -d $(PREFIX)/lib/voc/sym | mkdir -p $(PREFIX)/lib/voc/sym - - cp $(LIBRARY).$(SHRLIBEXT) $(PREFIX)/lib - cp $(LIBRARY).a $(PREFIX)/lib - cp *.c $(PREFIX)/lib/voc/obj/ - cp *.h $(PREFIX)/lib/voc/obj/ - cp *.sym $(PREFIX)/lib/voc/sym/ - - #cp 05vishap.conf /etc/ld.so.conf.d/ - ldconfig -m $(PREFIX)/lib - ln -s $(PREFIX) $(PREFIXLN) - -# cp *.o $(PREFIX)/lib/voc/$(RELEASE)/obj/ -uninstall: - rm -rf $(PREFIX) - rm -rf $(PREFIXLN) diff --git a/triage/makefile.linux.clang.powerpc b/triage/makefile.linux.clang.powerpc deleted file mode 100644 index 787e0ca5..00000000 --- a/triage/makefile.linux.clang.powerpc +++ /dev/null @@ -1,309 +0,0 @@ -#SHELL := /bin/bash -BUILDID=$(shell date +%Y/%m/%d) -TOS = linux -TARCH = powerpc -#TARCH = x86 x86_64 armv6j armv6j_hardfp armv7a_hardfp powerpc -CCOMP = clang -RELEASE = 1.1 - - -INCLUDEPATH = -Isrc/lib/system/$(TOS)/$(CCOMP)/$(TARCH) - -SETPATH = CFLAGS=$(INCLUDEPATH) PATH=.:/bin:/usr/bin MODULES=.:src/lib:src/lib/v4:src/lib/v4/$(TARCH):src/lib/v4_compat:src/lib/system/$(TOS)/$(CCOMP):src/lib/system/$(TOS)/$(CCOMP)/$(TARCH):src/lib/ulm:src/lib/ulm/$(TARCH):src/lib/ooc2:src/lib/ooc2/$(TOS)/$(CCOMP):src/lib/ooc:src/lib/ooc/$(TOS)/$(CCOMP)/$(TARCH):src/lib/pow:src/lib/misc:src/lib/s3:src/lib/s3/$(TARCH):src/voc:src/voc/$(TOS)/$(CCOMP):src/voc/$(TOS)/$(CCOMP)/$(TARCH):src/tools/ocat:src/tools/browser:src/tools/vocparam:src/tools/vmake:src/tools/coco:src/test - -VOC = voc -VERSION = $(TOS).$(CCOMP).$(TARCH) -VOCSTATIC0 = $(SETPATH) ./vocstatic.$(TOS).$(CCOMP).$(TARCH) -VOCSTATIC = $(SETPATH) ./voc -VOCPARAM = $(shell ./vocparam > voc.par) -LIBNAME = VishapOberon -LIBRARY = lib$(LIBNAME) - -ifndef PRF -PRF = "/opt" -endif -PREFIX = $(PRF)/voc-$(RELEASE) -PREFIXLN = $(PRF)/voc - -CCOPT = -fPIC $(INCLUDEPATH) -g -SHRLIBEXT = so -CC = $(CCOMP) $(CCOPT) -c -CL = $(CCOMP) $(CCOPT) -LD = $(CCOMP) -shared -o $(LIBRARY).$(SHRLIBEXT) -# s is necessary to create index inside a archive -ARCHIVE = ar rcs $(LIBRARY).a - -#%.c: %.Mod -#%.o: %.c -# $(CC) $(input) - -all: stage2 stage3 stage4 stage5 stage6 stage7 - -# when porting to new platform: -# * put corresponding .par file into current directory. it can be generated on the target platform by compiling vocparam (stage0) and running (stage1) -# * run make port0 - this will generate C source files for the target architecture -# * move the source tree to the target machine, and compile (or compile here via crosscompiler) (port1) -port0: stage2 stage3 stage4 - -# now compile C source files for voc, showdef and ocat on target machine (or by using crosscompiler) -port1: stage5 -# after you have "voc" compiled for target architecture. replace vocstatic with it and run make on target platform to get everything compiled - -# this builds binary which generates voc.par -stage0: src/tools/vocparam/vocparam.c - $(CL) -I src/lib/system/$(TOS)/$(CCOMP)/$(TARCH) -o vocparam src/tools/vocparam/vocparam.c - -# this creates voc.par for a host architecture. -# comment this out if you need to build a compiler for a different architecture. -stage1: - #rm voc.par - #$(shell "./vocparam > voc.par") - #./vocparam > voc.par - $(VOCPARAM) - -# this copies necessary voc.par to the current directory. -# skip this if you are building compiler for the host architecture. -stage2: - cp src/par/voc.par.$(CCOMP).$(TARCH) voc.par -# cp src/par/voc.par.gnu.x86_64 voc.par -# cp src/par/voc.par.gnu.x86 voc.par -# cp src/par/voc.par.gnu.armv6 voc.par -# cp src/par/voc.par.gnu.armv7 voc.par - cp src/voc/prf.Mod_default src/voc/prf.Mod - -# this prepares modules necessary to build the compiler itself -stage3: - - $(VOCSTATIC0) -siapxPS SYSTEM.Mod - $(VOCSTATIC0) -sPFS Args.Mod Console.Mod Unix.Mod - sed -i.tmp "s#/opt#$(PRF)#g" src/voc/prf.Mod - $(VOCSTATIC0) -sPFS prf.Mod - $(VOCSTATIC0) -sPFS Strings.Mod architecture.Mod version.Mod Kernel0.Mod Modules.Mod - $(VOCSTATIC0) -sxPFS Files0.Mod - $(VOCSTATIC0) -sPFS Reals.Mod Texts0.Mod - $(VOCSTATIC0) -sPFS vt100.Mod - -# build the compiler -stage4: - $(VOCSTATIC0) -sPFS errors.Mod - $(VOCSTATIC0) -sPFS extTools.Mod - $(VOCSTATIC0) -sPFS OPM.cmdln.Mod - $(VOCSTATIC0) -sxPFS OPS.Mod - $(VOCSTATIC0) -sPFS OPT.Mod OPC.Mod OPV.Mod OPB.Mod OPP.Mod - $(VOCSTATIC0) -smPS voc.Mod - $(VOCSTATIC0) -smPS BrowserCmd.Mod - $(VOCSTATIC0) -smPS OCatCmd.Mod - -#this is to build the compiler from C sources. -#this is a way to create a bootstrap binary. -stage5: - $(CC) SYSTEM.c Args.c Console.c Modules.c Unix.c \ - Strings.c architecture.c prf.c version.c Kernel0.c Files0.c Reals.c Texts0.c vt100.c \ - extTools.c \ - OPM.c OPS.c OPT.c OPC.c OPV.c OPB.c OPP.c errors.c - - $(CL) -static voc.c -o voc \ - SYSTEM.o Args.o Console.o Modules.o Unix.o \ - Strings.o architecture.o prf.o version.o Kernel0.o Files0.o Reals.o Texts0.o vt100.o \ - extTools.o \ - OPM.o OPS.o OPT.o OPC.o OPV.o OPB.o OPP.o errors.o - $(CL) BrowserCmd.c -o showdef \ - SYSTEM.o Args.o Console.o Modules.o Unix.o Strings.o architecture.o prf.o version.o Kernel0.o Files0.o Reals.o Texts0.o vt100.o \ - OPM.o OPS.o OPT.o OPV.o OPC.o errors.o - - $(CL) OCatCmd.c -o ocat \ - SYSTEM.o Args.o Console.o Modules.o Unix.o Strings.o architecture.o prf.o version.o Kernel0.o Files0.o Reals.o Texts0.o - -# build all library files -stage6: - #v4 libs - $(VOCSTATIC) -sPF Kernel.Mod - $(VOCSTATIC) -sPF Files.Mod - $(VOCSTATIC) -sPF Texts.Mod - $(VOCSTATIC) -sPF Printer.Mod - $(VOCSTATIC) -sPF Strings.Mod - $(VOCSTATIC) -sPF Sets.Mod - $(VOCSTATIC) -sPF Sets0.Mod - $(VOCSTATIC) -sPF Oberon.Mod - - #ooc libs - $(VOCSTATIC) -sPF oocAscii.Mod - $(VOCSTATIC) -sPF oocStrings.Mod - $(VOCSTATIC) -sPF oocStrings2.Mod - $(VOCSTATIC) -sPF oocOakStrings.Mod - $(VOCSTATIC) -sPF oocCharClass.Mod - $(VOCSTATIC) -sPF oocConvTypes.Mod - $(VOCSTATIC) -sPF oocIntConv.Mod - $(VOCSTATIC) -sPF oocIntStr.Mod - $(VOCSTATIC) -sPF oocSysClock.Mod - $(VOCSTATIC) -sPF oocTime.Mod - $(VOCSTATIC) -sPF oocRandomNumbers.Mod -# $(VOCSTATIC) -s oocLongStrings.Mod -# $(CC) oocLongStrings.c -# $(VOCSTATIC) -s oocMsg.Mod -# $(CC) oocMsg.c - - - #ooc2 libs - $(VOCSTATIC) -sPF ooc2Strings.Mod - $(VOCSTATIC) -sPF ooc2Ascii.Mod - $(VOCSTATIC) -sPF ooc2CharClass.Mod - $(VOCSTATIC) -sPF ooc2ConvTypes.Mod - $(VOCSTATIC) -sPF ooc2IntConv.Mod - $(VOCSTATIC) -sPF ooc2IntStr.Mod - $(VOCSTATIC) -sPF ooc2Real0.Mod - #ooc libs - $(VOCSTATIC) -sPF oocLowReal.Mod oocLowLReal.Mod - $(VOCSTATIC) -sPF oocRealMath.Mod oocOakMath.Mod - $(VOCSTATIC) -sPF oocLRealMath.Mod - $(VOCSTATIC) -sPF oocLongInts.Mod - $(VOCSTATIC) -sPF oocComplexMath.Mod oocLComplexMath.Mod - $(VOCSTATIC) -sPF oocLRealConv.Mod oocLRealStr.Mod - $(VOCSTATIC) -sPF oocRealConv.Mod oocRealStr.Mod - $(VOCSTATIC) -sPF oocMsg.Mod oocChannel.Mod - $(VOCSTATIC) -sPF oocStrings2.Mod oocRts.Mod oocFilenames.Mod - $(VOCSTATIC) -sPF oocTextRider.Mod oocBinaryRider.Mod oocJulianDay.Mod - $(VOCSTATIC) -sPF oocFilenames.Mod - $(VOCSTATIC) -sPF oocwrapperlibc.Mod - $(VOCSTATIC) -sPF oocC.Mod - - #Ulm's Oberon system libs - $(VOCSTATIC) -sPF ulmSys.Mod - $(VOCSTATIC) -sPF ulmSYSTEM.Mod - $(VOCSTATIC) -sPF ulmASCII.Mod - $(VOCSTATIC) -sPF ulmSets.Mod - $(VOCSTATIC) -sPF ulmObjects.Mod - $(VOCSTATIC) -sPF ulmDisciplines.Mod - $(VOCSTATIC) -sPF ulmPriorities.Mod - $(VOCSTATIC) -sPF ulmServices.Mod - $(VOCSTATIC) -sPF ulmEvents.Mod - $(VOCSTATIC) -sPF ulmResources.Mod - $(VOCSTATIC) -sPF ulmForwarders.Mod - $(VOCSTATIC) -sPF ulmRelatedEvents.Mod - $(VOCSTATIC) -sPF ulmIO.Mod - $(VOCSTATIC) -sPF ulmProcess.Mod - $(VOCSTATIC) -sPF ulmTypes.Mod - $(VOCSTATIC) -sPF ulmStreams.Mod - $(VOCSTATIC) -sPF ulmAssertions.Mod - $(VOCSTATIC) -sPF ulmIndirectDisciplines.Mod - $(VOCSTATIC) -sPF ulmStreamDisciplines.Mod - $(VOCSTATIC) -sPF ulmIEEE.Mod - $(VOCSTATIC) -sPF ulmMC68881.Mod - $(VOCSTATIC) -sPF ulmReals.Mod - $(VOCSTATIC) -sPF ulmPrint.Mod - $(VOCSTATIC) -sPF ulmWrite.Mod - $(VOCSTATIC) -sPF ulmTexts.Mod - $(VOCSTATIC) -sPF ulmStrings.Mod - $(VOCSTATIC) -sPF ulmConstStrings.Mod - $(VOCSTATIC) -sPF ulmPlotters.Mod - $(VOCSTATIC) -sPF ulmSysTypes.Mod - $(VOCSTATIC) -sPF ulmSysConversions.Mod - $(VOCSTATIC) -sPF ulmErrors.Mod - $(VOCSTATIC) -sPF ulmSysErrors.Mod - $(VOCSTATIC) -sPF ulmSysIO.Mod - $(VOCSTATIC) -sPF ulmLoader.Mod - $(VOCSTATIC) -sPF ulmNetIO.Mod - $(VOCSTATIC) -sPF ulmPersistentObjects.Mod - $(VOCSTATIC) -sPF ulmPersistentDisciplines.Mod - $(VOCSTATIC) -sPF ulmOperations.Mod - $(VOCSTATIC) -sPF ulmScales.Mod - $(VOCSTATIC) -sPF ulmTimes.Mod - $(VOCSTATIC) -sPF ulmClocks.Mod - $(VOCSTATIC) -sPF ulmTimers.Mod - $(VOCSTATIC) -sPF ulmConditions.Mod - $(VOCSTATIC) -sPF ulmStreamConditions.Mod - $(VOCSTATIC) -sPF ulmTimeConditions.Mod - $(VOCSTATIC) -sPF ulmSysConversions.Mod - $(VOCSTATIC) -sPF ulmSysStat.Mod - $(VOCSTATIC) -sPF ulmCiphers.Mod - $(VOCSTATIC) -sPF ulmCipherOps.Mod - $(VOCSTATIC) -sPF ulmBlockCiphers.Mod - $(VOCSTATIC) -sPF ulmAsymmetricCiphers.Mod - $(VOCSTATIC) -sPF ulmConclusions.Mod - $(VOCSTATIC) -sPF ulmRandomGenerators.Mod - $(VOCSTATIC) -sPF ulmTCrypt.Mod - $(VOCSTATIC) -sPF ulmIntOperations.Mod - - #pow32 libs - $(VOCSTATIC) -sPF powStrings.Mod - - #misc libs - $(VOCSTATIC) -sPF MultiArrays.Mod - $(VOCSTATIC) -sPF MultiArrayRiders.Mod - $(VOCSTATIC) -sPF MersenneTwister.Mod - $(VOCSTATIC) -sPF Listen.Mod - - #s3 libs - $(VOCSTATIC) -sPF ethBTrees.Mod - $(VOCSTATIC) -sPF ethMD5.Mod - $(VOCSTATIC) -sPF ethSets.Mod - $(VOCSTATIC) -sPF ethZlib.Mod - $(VOCSTATIC) -sPF ethZlibBuffers.Mod - $(VOCSTATIC) -sPF ethZlibInflate.Mod - $(VOCSTATIC) -sPF ethZlibDeflate.Mod - $(VOCSTATIC) -sPF ethZlibReaders.Mod - $(VOCSTATIC) -sPF ethZlibWriters.Mod - $(VOCSTATIC) -sPF ethZip.Mod - $(VOCSTATIC) -sPF ethRandomNumbers.Mod - $(VOCSTATIC) -sPF ethGZReaders.Mod - $(VOCSTATIC) -sPF ethGZWriters.Mod - $(VOCSTATIC) -sPF ethUnicode.Mod - $(VOCSTATIC) -sPF ethDates.Mod - $(VOCSTATIC) -sPF ethReals.Mod - $(VOCSTATIC) -sPF ethStrings.Mod - -# build remaining tools -# $(VOCSTATIC0) -sPFS compatIn.Mod -# $(VOCSTATIC0) -smPS vmake.Mod -# $(CC) compatIn.c -# $(CL) vmake.c -o vmake SYSTEM.o Args.o compatIn.o Texts.o Console.o Files.o Reals.o Modules.o Kernel.o Unix.o Strings.o oocIntStr.o oocConvTypes.o oocIntConv.o - - - -stage7: - #remove non library objects - rm -f Kernel0.o Files0.o Texts0.o architecture.o prf.o version.o extTools.o OPM.o OPS.o OPT.o OPC.o OPV.o OPB.o OPP.o errors.o - #objects := $(wildcard *.o) - #$(LD) objects - $(ARCHIVE) *.o - #$(ARCHIVE) objects - $(LD) *.o - echo "$(PREFIX)/lib" > 05vishap.conf - -clean: -# rm_objects := rm $(wildcard *.o) -# objects - rm *.h - rm *.c - rm *.sym - rm *.o - rm *.a - rm *.$(SHRLIBEXT) - -install: - test -d $(PREFIX)/bin | mkdir -p $(PREFIX)/bin - cp voc $(PREFIX)/bin/ - cp showdef $(PREFIX)/bin/ - cp ocat $(PREFIX)/bin/ - #cp vmake $(PREFIX)/bin/ - cp -a src $(PREFIX)/ - - test -d $(PREFIX)/lib/voc | mkdir -p $(PREFIX)/lib/voc - test -d $(PREFIX)/lib/voc/ | mkdir -p $(PREFIX)/lib/voc - test -d $(PREFIX)/lib/voc/obj | mkdir -p $(PREFIX)/lib/voc/obj - test -d $(PREFIX)/lib/voc/sym | mkdir -p $(PREFIX)/lib/voc/sym - - cp $(LIBRARY).$(SHRLIBEXT) $(PREFIX)/lib - cp $(LIBRARY).a $(PREFIX)/lib - cp *.c $(PREFIX)/lib/voc/obj/ - cp *.h $(PREFIX)/lib/voc/obj/ - cp *.sym $(PREFIX)/lib/voc/sym/ - - cp 05vishap.conf /etc/ld.so.conf.d/ - ldconfig - ln -s $(PREFIX) $(PREFIXLN) - -# cp *.o $(PREFIX)/lib/voc/$(RELEASE)/obj/ -uninstall: - rm -rf $(PREFIX) - rm -rf $(PREFIXLN) diff --git a/triage/makefile.linux.clang.x86_64 b/triage/makefile.linux.clang.x86_64 deleted file mode 100644 index 377d7e53..00000000 --- a/triage/makefile.linux.clang.x86_64 +++ /dev/null @@ -1,309 +0,0 @@ -#SHELL := /bin/bash -BUILDID=$(shell date +%Y/%m/%d) -TOS = linux -TARCH = x86_64 -#TARCH = x86 x86_64 armv6j armv6j_hardfp armv7a_hardfp powerpc -CCOMP = clang -RELEASE = 1.1 - - -INCLUDEPATH = -Isrc/lib/system/$(TOS)/$(CCOMP)/$(TARCH) - -SETPATH = CFLAGS=$(INCLUDEPATH) PATH=.:/bin:/usr/bin MODULES=.:src/lib:src/lib/v4:src/lib/v4/$(TARCH):src/lib/v4_compat:src/lib/system/$(TOS)/$(CCOMP):src/lib/system/$(TOS)/$(CCOMP)/$(TARCH):src/lib/ulm:src/lib/ulm/$(TARCH):src/lib/ooc2:src/lib/ooc2/$(TOS)/$(CCOMP):src/lib/ooc:src/lib/ooc/$(TOS)/$(CCOMP)/$(TARCH):src/lib/pow:src/lib/misc:src/lib/s3:src/lib/s3/$(TARCH):src/voc:src/voc/$(TOS)/$(CCOMP):src/voc/$(TOS)/$(CCOMP)/$(TARCH):src/tools/ocat:src/tools/browser:src/tools/vocparam:src/tools/vmake:src/tools/coco:src/test - -VOC = voc -VERSION = $(TOS).$(CCOMP).$(TARCH) -VOCSTATIC0 = $(SETPATH) ./vocstatic.$(TOS).$(CCOMP).$(TARCH) -VOCSTATIC = $(SETPATH) ./voc -VOCPARAM = $(shell ./vocparam > voc.par) -LIBNAME = VishapOberon -LIBRARY = lib$(LIBNAME) - -ifndef PRF -PRF = "/opt" -endif -PREFIX = $(PRF)/voc-$(RELEASE) -PREFIXLN = $(PRF)/voc - -CCOPT = -fPIC $(INCLUDEPATH) -g -SHRLIBEXT = so -CC = $(CCOMP) $(CCOPT) -c -CL = $(CCOMP) $(CCOPT) -LD = $(CCOMP) -shared -o $(LIBRARY).$(SHRLIBEXT) -# s is necessary to create index inside a archive -ARCHIVE = ar rcs $(LIBRARY).a - -#%.c: %.Mod -#%.o: %.c -# $(CC) $(input) - -all: stage2 stage3 stage4 stage5 stage6 stage7 - -# when porting to new platform: -# * put corresponding .par file into current directory. it can be generated on the target platform by compiling vocparam (stage0) and running (stage1) -# * run make port0 - this will generate C source files for the target architecture -# * move the source tree to the target machine, and compile (or compile here via crosscompiler) (port1) -port0: stage2 stage3 stage4 - -# now compile C source files for voc, showdef and ocat on target machine (or by using crosscompiler) -port1: stage5 -# after you have "voc" compiled for target architecture. replace vocstatic with it and run make on target platform to get everything compiled - -# this builds binary which generates voc.par -stage0: src/tools/vocparam/vocparam.c - $(CL) -I src/lib/system/$(TOS)/$(CCOMP)/$(TARCH) -o vocparam src/tools/vocparam/vocparam.c - -# this creates voc.par for a host architecture. -# comment this out if you need to build a compiler for a different architecture. -stage1: - #rm voc.par - #$(shell "./vocparam > voc.par") - #./vocparam > voc.par - $(VOCPARAM) - -# this copies necessary voc.par to the current directory. -# skip this if you are building compiler for the host architecture. -stage2: - cp src/par/voc.par.$(CCOMP).$(TARCH) voc.par -# cp src/par/voc.par.gnu.x86_64 voc.par -# cp src/par/voc.par.gnu.x86 voc.par -# cp src/par/voc.par.gnu.armv6 voc.par -# cp src/par/voc.par.gnu.armv7 voc.par - cp src/voc/prf.Mod_default src/voc/prf.Mod - -# this prepares modules necessary to build the compiler itself -stage3: - - $(VOCSTATIC0) -siapxPS SYSTEM.Mod - $(VOCSTATIC0) -sPFS Args.Mod Console.Mod Unix.Mod - sed -i.tmp "s#/opt#$(PRF)#g" src/voc/prf.Mod - $(VOCSTATIC0) -sPFS prf.Mod - $(VOCSTATIC0) -sPFS Strings.Mod architecture.Mod version.Mod Kernel0.Mod Modules.Mod - $(VOCSTATIC0) -sxPFS Files0.Mod - $(VOCSTATIC0) -sPFS Reals.Mod Texts0.Mod - $(VOCSTATIC0) -sPFS vt100.Mod - -# build the compiler -stage4: - $(VOCSTATIC0) -sPFS errors.Mod - $(VOCSTATIC0) -sPFS extTools.Mod - $(VOCSTATIC0) -sPFS OPM.cmdln.Mod - $(VOCSTATIC0) -sxPFS OPS.Mod - $(VOCSTATIC0) -sPFS OPT.Mod OPC.Mod OPV.Mod OPB.Mod OPP.Mod - $(VOCSTATIC0) -smPS voc.Mod - $(VOCSTATIC0) -smPS BrowserCmd.Mod - $(VOCSTATIC0) -smPS OCatCmd.Mod - -#this is to build the compiler from C sources. -#this is a way to create a bootstrap binary. -stage5: - $(CC) SYSTEM.c Args.c Console.c Modules.c Unix.c \ - Strings.c architecture.c prf.c version.c Kernel0.c Files0.c Reals.c Texts0.c vt100.c \ - extTools.c \ - OPM.c OPS.c OPT.c OPC.c OPV.c OPB.c OPP.c errors.c - - $(CL) -static voc.c -o voc \ - SYSTEM.o Args.o Console.o Modules.o Unix.o \ - Strings.o architecture.o prf.o version.o Kernel0.o Files0.o Reals.o Texts0.o vt100.o \ - extTools.o \ - OPM.o OPS.o OPT.o OPC.o OPV.o OPB.o OPP.o errors.o - $(CL) BrowserCmd.c -o showdef \ - SYSTEM.o Args.o Console.o Modules.o Unix.o Strings.o architecture.o prf.o version.o Kernel0.o Files0.o Reals.o Texts0.o vt100.o \ - OPM.o OPS.o OPT.o OPV.o OPC.o errors.o - - $(CL) OCatCmd.c -o ocat \ - SYSTEM.o Args.o Console.o Modules.o Unix.o Strings.o architecture.o prf.o version.o Kernel0.o Files0.o Reals.o Texts0.o - -# build all library files -stage6: - #v4 libs - $(VOCSTATIC) -sPF Kernel.Mod - $(VOCSTATIC) -sPF Files.Mod - $(VOCSTATIC) -sPF Texts.Mod - $(VOCSTATIC) -sPF Printer.Mod - $(VOCSTATIC) -sPF Strings.Mod - $(VOCSTATIC) -sPF Sets.Mod - $(VOCSTATIC) -sPF Sets0.Mod - $(VOCSTATIC) -sPF Oberon.Mod - - #ooc libs - $(VOCSTATIC) -sPF oocAscii.Mod - $(VOCSTATIC) -sPF oocStrings.Mod - $(VOCSTATIC) -sPF oocStrings2.Mod - $(VOCSTATIC) -sPF oocOakStrings.Mod - $(VOCSTATIC) -sPF oocCharClass.Mod - $(VOCSTATIC) -sPF oocConvTypes.Mod - $(VOCSTATIC) -sPF oocIntConv.Mod - $(VOCSTATIC) -sPF oocIntStr.Mod - $(VOCSTATIC) -sPF oocSysClock.Mod - $(VOCSTATIC) -sPF oocTime.Mod - $(VOCSTATIC) -sPF oocRandomNumbers.Mod -# $(VOCSTATIC) -s oocLongStrings.Mod -# $(CC) oocLongStrings.c -# $(VOCSTATIC) -s oocMsg.Mod -# $(CC) oocMsg.c - - - #ooc2 libs - $(VOCSTATIC) -sPF ooc2Strings.Mod - $(VOCSTATIC) -sPF ooc2Ascii.Mod - $(VOCSTATIC) -sPF ooc2CharClass.Mod - $(VOCSTATIC) -sPF ooc2ConvTypes.Mod - $(VOCSTATIC) -sPF ooc2IntConv.Mod - $(VOCSTATIC) -sPF ooc2IntStr.Mod - $(VOCSTATIC) -sPF ooc2Real0.Mod - #ooc libs - $(VOCSTATIC) -sPF oocLowReal.Mod oocLowLReal.Mod - $(VOCSTATIC) -sPF oocRealMath.Mod oocOakMath.Mod - $(VOCSTATIC) -sPF oocLRealMath.Mod - $(VOCSTATIC) -sPF oocLongInts.Mod - $(VOCSTATIC) -sPF oocComplexMath.Mod oocLComplexMath.Mod - $(VOCSTATIC) -sPF oocLRealConv.Mod oocLRealStr.Mod - $(VOCSTATIC) -sPF oocRealConv.Mod oocRealStr.Mod - $(VOCSTATIC) -sPF oocMsg.Mod oocChannel.Mod - $(VOCSTATIC) -sPF oocStrings2.Mod oocRts.Mod oocFilenames.Mod - $(VOCSTATIC) -sPF oocTextRider.Mod oocBinaryRider.Mod oocJulianDay.Mod - $(VOCSTATIC) -sPF oocFilenames.Mod - $(VOCSTATIC) -sPF oocwrapperlibc.Mod - $(VOCSTATIC) -sPF oocC.Mod - - #Ulm's Oberon system libs - $(VOCSTATIC) -sPF ulmSys.Mod - $(VOCSTATIC) -sPF ulmSYSTEM.Mod - $(VOCSTATIC) -sPF ulmASCII.Mod - $(VOCSTATIC) -sPF ulmSets.Mod - $(VOCSTATIC) -sPF ulmObjects.Mod - $(VOCSTATIC) -sPF ulmDisciplines.Mod - $(VOCSTATIC) -sPF ulmPriorities.Mod - $(VOCSTATIC) -sPF ulmServices.Mod - $(VOCSTATIC) -sPF ulmEvents.Mod - $(VOCSTATIC) -sPF ulmResources.Mod - $(VOCSTATIC) -sPF ulmForwarders.Mod - $(VOCSTATIC) -sPF ulmRelatedEvents.Mod - $(VOCSTATIC) -sPF ulmIO.Mod - $(VOCSTATIC) -sPF ulmProcess.Mod - $(VOCSTATIC) -sPF ulmTypes.Mod - $(VOCSTATIC) -sPF ulmStreams.Mod - $(VOCSTATIC) -sPF ulmAssertions.Mod - $(VOCSTATIC) -sPF ulmIndirectDisciplines.Mod - $(VOCSTATIC) -sPF ulmStreamDisciplines.Mod - $(VOCSTATIC) -sPF ulmIEEE.Mod - $(VOCSTATIC) -sPF ulmMC68881.Mod - $(VOCSTATIC) -sPF ulmReals.Mod - $(VOCSTATIC) -sPF ulmPrint.Mod - $(VOCSTATIC) -sPF ulmWrite.Mod - $(VOCSTATIC) -sPF ulmTexts.Mod - $(VOCSTATIC) -sPF ulmStrings.Mod - $(VOCSTATIC) -sPF ulmConstStrings.Mod - $(VOCSTATIC) -sPF ulmPlotters.Mod - $(VOCSTATIC) -sPF ulmSysTypes.Mod - $(VOCSTATIC) -sPF ulmSysConversions.Mod - $(VOCSTATIC) -sPF ulmErrors.Mod - $(VOCSTATIC) -sPF ulmSysErrors.Mod - $(VOCSTATIC) -sPF ulmSysIO.Mod - $(VOCSTATIC) -sPF ulmLoader.Mod - $(VOCSTATIC) -sPF ulmNetIO.Mod - $(VOCSTATIC) -sPF ulmPersistentObjects.Mod - $(VOCSTATIC) -sPF ulmPersistentDisciplines.Mod - $(VOCSTATIC) -sPF ulmOperations.Mod - $(VOCSTATIC) -sPF ulmScales.Mod - $(VOCSTATIC) -sPF ulmTimes.Mod - $(VOCSTATIC) -sPF ulmClocks.Mod - $(VOCSTATIC) -sPF ulmTimers.Mod - $(VOCSTATIC) -sPF ulmConditions.Mod - $(VOCSTATIC) -sPF ulmStreamConditions.Mod - $(VOCSTATIC) -sPF ulmTimeConditions.Mod - $(VOCSTATIC) -sPF ulmSysConversions.Mod - $(VOCSTATIC) -sPF ulmSysStat.Mod - $(VOCSTATIC) -sPF ulmCiphers.Mod - $(VOCSTATIC) -sPF ulmCipherOps.Mod - $(VOCSTATIC) -sPF ulmBlockCiphers.Mod - $(VOCSTATIC) -sPF ulmAsymmetricCiphers.Mod - $(VOCSTATIC) -sPF ulmConclusions.Mod - $(VOCSTATIC) -sPF ulmRandomGenerators.Mod - $(VOCSTATIC) -sPF ulmTCrypt.Mod - $(VOCSTATIC) -sPF ulmIntOperations.Mod - - #pow32 libs - $(VOCSTATIC) -sPF powStrings.Mod - - #misc libs - $(VOCSTATIC) -sPF MultiArrays.Mod - $(VOCSTATIC) -sPF MultiArrayRiders.Mod - $(VOCSTATIC) -sPF MersenneTwister.Mod - $(VOCSTATIC) -sPF Listen.Mod - - #s3 libs - $(VOCSTATIC) -sPF ethBTrees.Mod - $(VOCSTATIC) -sPF ethMD5.Mod - $(VOCSTATIC) -sPF ethSets.Mod - $(VOCSTATIC) -sPF ethZlib.Mod - $(VOCSTATIC) -sPF ethZlibBuffers.Mod - $(VOCSTATIC) -sPF ethZlibInflate.Mod - $(VOCSTATIC) -sPF ethZlibDeflate.Mod - $(VOCSTATIC) -sPF ethZlibReaders.Mod - $(VOCSTATIC) -sPF ethZlibWriters.Mod - $(VOCSTATIC) -sPF ethZip.Mod - $(VOCSTATIC) -sPF ethRandomNumbers.Mod - $(VOCSTATIC) -sPF ethGZReaders.Mod - $(VOCSTATIC) -sPF ethGZWriters.Mod - $(VOCSTATIC) -sPF ethUnicode.Mod - $(VOCSTATIC) -sPF ethDates.Mod - $(VOCSTATIC) -sPF ethReals.Mod - $(VOCSTATIC) -sPF ethStrings.Mod - -# build remaining tools -# $(VOCSTATIC0) -sPFS compatIn.Mod -# $(VOCSTATIC0) -smPS vmake.Mod -# $(CC) compatIn.c -# $(CL) vmake.c -o vmake SYSTEM.o Args.o compatIn.o Texts.o Console.o Files.o Reals.o Modules.o Kernel.o Unix.o Strings.o oocIntStr.o oocConvTypes.o oocIntConv.o - - - -stage7: - #remove non library objects - rm -f Kernel0.o Files0.o Texts0.o architecture.o prf.o version.o extTools.o OPM.o OPS.o OPT.o OPC.o OPV.o OPB.o OPP.o errors.o - #objects := $(wildcard *.o) - #$(LD) objects - $(ARCHIVE) *.o - #$(ARCHIVE) objects - $(LD) *.o - echo "$(PREFIX)/lib" > 05vishap.conf - -clean: -# rm_objects := rm $(wildcard *.o) -# objects - rm *.h - rm *.c - rm *.sym - rm *.o - rm *.a - rm *.$(SHRLIBEXT) - -install: - test -d $(PREFIX)/bin | mkdir -p $(PREFIX)/bin - cp voc $(PREFIX)/bin/ - cp showdef $(PREFIX)/bin/ - cp ocat $(PREFIX)/bin/ - #cp vmake $(PREFIX)/bin/ - cp -a src $(PREFIX)/ - - test -d $(PREFIX)/lib/voc | mkdir -p $(PREFIX)/lib/voc - test -d $(PREFIX)/lib/voc/ | mkdir -p $(PREFIX)/lib/voc - test -d $(PREFIX)/lib/voc/obj | mkdir -p $(PREFIX)/lib/voc/obj - test -d $(PREFIX)/lib/voc/sym | mkdir -p $(PREFIX)/lib/voc/sym - - cp $(LIBRARY).$(SHRLIBEXT) $(PREFIX)/lib - cp $(LIBRARY).a $(PREFIX)/lib - cp *.c $(PREFIX)/lib/voc/obj/ - cp *.h $(PREFIX)/lib/voc/obj/ - cp *.sym $(PREFIX)/lib/voc/sym/ - - cp 05vishap.conf /etc/ld.so.conf.d/ - ldconfig - ln -s $(PREFIX) $(PREFIXLN) - -# cp *.o $(PREFIX)/lib/voc/$(RELEASE)/obj/ -uninstall: - rm -rf $(PREFIX) - rm -rf $(PREFIXLN) diff --git a/triage/makefile.linux.gcc.armv6j_hardfp b/triage/makefile.linux.gcc.armv6j_hardfp deleted file mode 100644 index 10d6cc29..00000000 --- a/triage/makefile.linux.gcc.armv6j_hardfp +++ /dev/null @@ -1,309 +0,0 @@ -#SHELL := /bin/bash -BUILDID=$(shell date +%Y/%m/%d) -TOS = linux -TARCH = armv6j_hardfp -#TARCH = x86 x86_64 armv6j armv6j_hardfp armv7a_hardfp powerpc -CCOMP = gcc -RELEASE = 1.1 - - -INCLUDEPATH = -Isrc/lib/system/$(TOS)/$(CCOMP)/$(TARCH) - -SETPATH = CFLAGS=$(INCLUDEPATH) PATH=.:/bin:/usr/bin MODULES=.:src/lib:src/lib/v4:src/lib/v4/$(TARCH):src/lib/v4_compat:src/lib/system/$(TOS)/$(CCOMP):src/lib/system/$(TOS)/$(CCOMP)/$(TARCH):src/lib/ulm:src/lib/ulm/$(TARCH):src/lib/ooc2:src/lib/ooc2/$(TOS)/$(CCOMP):src/lib/ooc:src/lib/ooc/$(TOS)/$(CCOMP)/$(TARCH):src/lib/pow:src/lib/misc:src/lib/s3:src/lib/s3/$(TARCH):src/voc:src/voc/$(TOS)/$(CCOMP):src/voc/$(TOS)/$(CCOMP)/$(TARCH):src/tools/ocat:src/tools/browser:src/tools/vocparam:src/tools/vmake:src/tools/coco:src/test - -VOC = voc -VERSION = $(TOS).$(CCOMP).$(TARCH) -VOCSTATIC0 = $(SETPATH) ./vocstatic.$(TOS).$(CCOMP).$(TARCH) -VOCSTATIC = $(SETPATH) ./voc -VOCPARAM = $(shell ./vocparam > voc.par) -LIBNAME = VishapOberon -LIBRARY = lib$(LIBNAME) - -ifndef PRF -PRF = "/opt" -endif -PREFIX = $(PRF)/voc-$(RELEASE) -PREFIXLN = $(PRF)/voc - -CCOPT = -fPIC $(INCLUDEPATH) -g -fno-stack-protector -SHRLIBEXT = so -CC = $(CCOMP) $(CCOPT) -c -CL = $(CCOMP) $(CCOPT) -LD = $(CCOMP) -shared -o $(LIBRARY).$(SHRLIBEXT) -# s is necessary to create index inside a archive -ARCHIVE = ar rcs $(LIBRARY).a - -#%.c: %.Mod -#%.o: %.c -# $(CC) $(input) - -all: stage2 stage3 stage4 stage5 stage6 stage7 - -# when porting to new platform: -# * put corresponding .par file into current directory. it can be generated on the target platform by compiling vocparam (stage0) and running (stage1) -# * run make port0 - this will generate C source files for the target architecture -# * move the source tree to the target machine, and compile (or compile here via crosscompiler) (port1) -port0: stage2 stage3 stage4 - -# now compile C source files for voc, showdef and ocat on target machine (or by using crosscompiler) -port1: stage5 -# after you have "voc" compiled for target architecture. replace vocstatic with it and run make on target platform to get everything compiled - -# this builds binary which generates voc.par -stage0: src/tools/vocparam/vocparam.c - $(CL) -I src/lib/system/$(TOS)/$(CCOMP)/$(TARCH) -o vocparam src/tools/vocparam/vocparam.c - -# this creates voc.par for a host architecture. -# comment this out if you need to build a compiler for a different architecture. -stage1: - #rm voc.par - #$(shell "./vocparam > voc.par") - #./vocparam > voc.par - $(VOCPARAM) - -# this copies necessary voc.par to the current directory. -# skip this if you are building compiler for the host architecture. -stage2: - cp src/par/voc.par.$(CCOMP).$(TARCH) voc.par -# cp src/par/voc.par.gnu.x86_64 voc.par -# cp src/par/voc.par.gnu.x86 voc.par -# cp src/par/voc.par.gnu.armv6 voc.par -# cp src/par/voc.par.gnu.armv7 voc.par - cp src/voc/prf.Mod_default src/voc/prf.Mod - -# this prepares modules necessary to build the compiler itself -stage3: - - $(VOCSTATIC0) -siapxPS SYSTEM.Mod - $(VOCSTATIC0) -sPFS Args.Mod Console.Mod Unix.Mod - sed -i.tmp "s#/opt#$(PRF)#g" src/voc/prf.Mod - $(VOCSTATIC0) -sPFS prf.Mod - $(VOCSTATIC0) -sPFS Strings.Mod architecture.Mod version.Mod Kernel0.Mod Modules.Mod - $(VOCSTATIC0) -sxPFS Files0.Mod - $(VOCSTATIC0) -sPFS Reals.Mod Texts0.Mod - $(VOCSTATIC0) -sPFS vt100.Mod - -# build the compiler -stage4: - $(VOCSTATIC0) -sPFS errors.Mod - $(VOCSTATIC0) -sPFS extTools.Mod - $(VOCSTATIC0) -sPFS OPM.cmdln.Mod - $(VOCSTATIC0) -sxPFS OPS.Mod - $(VOCSTATIC0) -sPFS OPT.Mod OPC.Mod OPV.Mod OPB.Mod OPP.Mod - $(VOCSTATIC0) -smPS voc.Mod - $(VOCSTATIC0) -smPS BrowserCmd.Mod - $(VOCSTATIC0) -smPS OCatCmd.Mod - -#this is to build the compiler from C sources. -#this is a way to create a bootstrap binary. -stage5: - $(CC) SYSTEM.c Args.c Console.c Modules.c Unix.c \ - Strings.c architecture.c prf.c version.c Kernel0.c Files0.c Reals.c Texts0.c vt100.c \ - extTools.c \ - OPM.c OPS.c OPT.c OPC.c OPV.c OPB.c OPP.c errors.c - - $(CL) -static voc.c -o voc \ - SYSTEM.o Args.o Console.o Modules.o Unix.o \ - Strings.o architecture.o prf.o version.o Kernel0.o Files0.o Reals.o Texts0.o vt100.o \ - extTools.o \ - OPM.o OPS.o OPT.o OPC.o OPV.o OPB.o OPP.o errors.o - $(CL) BrowserCmd.c -o showdef \ - SYSTEM.o Args.o Console.o Modules.o Unix.o Strings.o architecture.o prf.o version.o Kernel0.o Files0.o Reals.o Texts0.o vt100.o \ - OPM.o OPS.o OPT.o OPV.o OPC.o errors.o - - $(CL) OCatCmd.c -o ocat \ - SYSTEM.o Args.o Console.o Modules.o Unix.o Strings.o architecture.o prf.o version.o Kernel0.o Files0.o Reals.o Texts0.o - -# build all library files -stage6: - #v4 libs - $(VOCSTATIC) -sPF Kernel.Mod - $(VOCSTATIC) -sPF Files.Mod - $(VOCSTATIC) -sPF Texts.Mod - $(VOCSTATIC) -sPF Printer.Mod - $(VOCSTATIC) -sPF Strings.Mod - $(VOCSTATIC) -sPF Sets.Mod - $(VOCSTATIC) -sPF Sets0.Mod - $(VOCSTATIC) -sPF Oberon.Mod - - #ooc libs - $(VOCSTATIC) -sPF oocAscii.Mod - $(VOCSTATIC) -sPF oocStrings.Mod - $(VOCSTATIC) -sPF oocStrings2.Mod - $(VOCSTATIC) -sPF oocOakStrings.Mod - $(VOCSTATIC) -sPF oocCharClass.Mod - $(VOCSTATIC) -sPF oocConvTypes.Mod - $(VOCSTATIC) -sPF oocIntConv.Mod - $(VOCSTATIC) -sPF oocIntStr.Mod - $(VOCSTATIC) -sPF oocSysClock.Mod - $(VOCSTATIC) -sPF oocTime.Mod - $(VOCSTATIC) -sPF oocRandomNumbers.Mod -# $(VOCSTATIC) -s oocLongStrings.Mod -# $(CC) oocLongStrings.c -# $(VOCSTATIC) -s oocMsg.Mod -# $(CC) oocMsg.c - - - #ooc2 libs - $(VOCSTATIC) -sPF ooc2Strings.Mod - $(VOCSTATIC) -sPF ooc2Ascii.Mod - $(VOCSTATIC) -sPF ooc2CharClass.Mod - $(VOCSTATIC) -sPF ooc2ConvTypes.Mod - $(VOCSTATIC) -sPF ooc2IntConv.Mod - $(VOCSTATIC) -sPF ooc2IntStr.Mod - $(VOCSTATIC) -sPF ooc2Real0.Mod - #ooc libs - $(VOCSTATIC) -sPF oocLowReal.Mod oocLowLReal.Mod - $(VOCSTATIC) -sPF oocRealMath.Mod oocOakMath.Mod - $(VOCSTATIC) -sPF oocLRealMath.Mod - $(VOCSTATIC) -sPF oocLongInts.Mod - $(VOCSTATIC) -sPF oocComplexMath.Mod oocLComplexMath.Mod - $(VOCSTATIC) -sPF oocLRealConv.Mod oocLRealStr.Mod - $(VOCSTATIC) -sPF oocRealConv.Mod oocRealStr.Mod - $(VOCSTATIC) -sPF oocMsg.Mod oocChannel.Mod - $(VOCSTATIC) -sPF oocStrings2.Mod oocRts.Mod oocFilenames.Mod - $(VOCSTATIC) -sPF oocTextRider.Mod oocBinaryRider.Mod oocJulianDay.Mod - $(VOCSTATIC) -sPF oocFilenames.Mod - $(VOCSTATIC) -sPF oocwrapperlibc.Mod - $(VOCSTATIC) -sPF oocC.Mod - - #Ulm's Oberon system libs - $(VOCSTATIC) -sPF ulmSys.Mod - $(VOCSTATIC) -sPF ulmSYSTEM.Mod - $(VOCSTATIC) -sPF ulmASCII.Mod - $(VOCSTATIC) -sPF ulmSets.Mod - $(VOCSTATIC) -sPF ulmObjects.Mod - $(VOCSTATIC) -sPF ulmDisciplines.Mod - $(VOCSTATIC) -sPF ulmPriorities.Mod - $(VOCSTATIC) -sPF ulmServices.Mod - $(VOCSTATIC) -sPF ulmEvents.Mod - $(VOCSTATIC) -sPF ulmResources.Mod - $(VOCSTATIC) -sPF ulmForwarders.Mod - $(VOCSTATIC) -sPF ulmRelatedEvents.Mod - $(VOCSTATIC) -sPF ulmIO.Mod - $(VOCSTATIC) -sPF ulmProcess.Mod - $(VOCSTATIC) -sPF ulmTypes.Mod - $(VOCSTATIC) -sPF ulmStreams.Mod - $(VOCSTATIC) -sPF ulmAssertions.Mod - $(VOCSTATIC) -sPF ulmIndirectDisciplines.Mod - $(VOCSTATIC) -sPF ulmStreamDisciplines.Mod - $(VOCSTATIC) -sPF ulmIEEE.Mod - $(VOCSTATIC) -sPF ulmMC68881.Mod - $(VOCSTATIC) -sPF ulmReals.Mod - $(VOCSTATIC) -sPF ulmPrint.Mod - $(VOCSTATIC) -sPF ulmWrite.Mod - $(VOCSTATIC) -sPF ulmTexts.Mod - $(VOCSTATIC) -sPF ulmStrings.Mod - $(VOCSTATIC) -sPF ulmConstStrings.Mod - $(VOCSTATIC) -sPF ulmPlotters.Mod - $(VOCSTATIC) -sPF ulmSysTypes.Mod - $(VOCSTATIC) -sPF ulmSysConversions.Mod - $(VOCSTATIC) -sPF ulmErrors.Mod - $(VOCSTATIC) -sPF ulmSysErrors.Mod - $(VOCSTATIC) -sPF ulmSysIO.Mod - $(VOCSTATIC) -sPF ulmLoader.Mod - $(VOCSTATIC) -sPF ulmNetIO.Mod - $(VOCSTATIC) -sPF ulmPersistentObjects.Mod - $(VOCSTATIC) -sPF ulmPersistentDisciplines.Mod - $(VOCSTATIC) -sPF ulmOperations.Mod - $(VOCSTATIC) -sPF ulmScales.Mod - $(VOCSTATIC) -sPF ulmTimes.Mod - $(VOCSTATIC) -sPF ulmClocks.Mod - $(VOCSTATIC) -sPF ulmTimers.Mod - $(VOCSTATIC) -sPF ulmConditions.Mod - $(VOCSTATIC) -sPF ulmStreamConditions.Mod - $(VOCSTATIC) -sPF ulmTimeConditions.Mod - $(VOCSTATIC) -sPF ulmSysConversions.Mod - $(VOCSTATIC) -sPF ulmSysStat.Mod - $(VOCSTATIC) -sPF ulmCiphers.Mod - $(VOCSTATIC) -sPF ulmCipherOps.Mod - $(VOCSTATIC) -sPF ulmBlockCiphers.Mod - $(VOCSTATIC) -sPF ulmAsymmetricCiphers.Mod - $(VOCSTATIC) -sPF ulmConclusions.Mod - $(VOCSTATIC) -sPF ulmRandomGenerators.Mod - $(VOCSTATIC) -sPF ulmTCrypt.Mod - $(VOCSTATIC) -sPF ulmIntOperations.Mod - - #pow32 libs - $(VOCSTATIC) -sPF powStrings.Mod - - #misc libs - $(VOCSTATIC) -sPF MultiArrays.Mod - $(VOCSTATIC) -sPF MultiArrayRiders.Mod - $(VOCSTATIC) -sPF MersenneTwister.Mod - $(VOCSTATIC) -sPF Listen.Mod - - #s3 libs - $(VOCSTATIC) -sPF ethBTrees.Mod - $(VOCSTATIC) -sPF ethMD5.Mod - $(VOCSTATIC) -sPF ethSets.Mod - $(VOCSTATIC) -sPF ethZlib.Mod - $(VOCSTATIC) -sPF ethZlibBuffers.Mod - $(VOCSTATIC) -sPF ethZlibInflate.Mod - $(VOCSTATIC) -sPF ethZlibDeflate.Mod - $(VOCSTATIC) -sPF ethZlibReaders.Mod - $(VOCSTATIC) -sPF ethZlibWriters.Mod - $(VOCSTATIC) -sPF ethZip.Mod - $(VOCSTATIC) -sPF ethRandomNumbers.Mod - $(VOCSTATIC) -sPF ethGZReaders.Mod - $(VOCSTATIC) -sPF ethGZWriters.Mod - $(VOCSTATIC) -sPF ethUnicode.Mod - $(VOCSTATIC) -sPF ethDates.Mod - $(VOCSTATIC) -sPF ethReals.Mod - $(VOCSTATIC) -sPF ethStrings.Mod - -# build remaining tools -# $(VOCSTATIC0) -sPFS compatIn.Mod -# $(VOCSTATIC0) -smPS vmake.Mod -# $(CC) compatIn.c -# $(CL) vmake.c -o vmake SYSTEM.o Args.o compatIn.o Texts.o Console.o Files.o Reals.o Modules.o Kernel.o Unix.o Strings.o oocIntStr.o oocConvTypes.o oocIntConv.o - - - -stage7: - #remove non library objects - rm -f Kernel0.o Files0.o Texts0.o architecture.o prf.o version.o extTools.o OPM.o OPS.o OPT.o OPC.o OPV.o OPB.o OPP.o errors.o - #objects := $(wildcard *.o) - #$(LD) objects - $(ARCHIVE) *.o - #$(ARCHIVE) objects - $(LD) *.o - echo "$(PREFIX)/lib" > 05vishap.conf - -clean: -# rm_objects := rm $(wildcard *.o) -# objects - rm *.h - rm *.c - rm *.sym - rm *.o - rm *.a - rm *.$(SHRLIBEXT) - -install: - test -d $(PREFIX)/bin | mkdir -p $(PREFIX)/bin - cp voc $(PREFIX)/bin/ - cp showdef $(PREFIX)/bin/ - cp ocat $(PREFIX)/bin/ - #cp vmake $(PREFIX)/bin/ - cp -a src $(PREFIX)/ - - test -d $(PREFIX)/lib/voc | mkdir -p $(PREFIX)/lib/voc - test -d $(PREFIX)/lib/voc/ | mkdir -p $(PREFIX)/lib/voc - test -d $(PREFIX)/lib/voc/obj | mkdir -p $(PREFIX)/lib/voc/obj - test -d $(PREFIX)/lib/voc/sym | mkdir -p $(PREFIX)/lib/voc/sym - - cp $(LIBRARY).$(SHRLIBEXT) $(PREFIX)/lib - cp $(LIBRARY).a $(PREFIX)/lib - cp *.c $(PREFIX)/lib/voc/obj/ - cp *.h $(PREFIX)/lib/voc/obj/ - cp *.sym $(PREFIX)/lib/voc/sym/ - - cp 05vishap.conf /etc/ld.so.conf.d/ - ldconfig - ln -s $(PREFIX) $(PREFIXLN) - -# cp *.o $(PREFIX)/lib/voc/$(RELEASE)/obj/ -uninstall: - rm -rf $(PREFIX) - rm -rf $(PREFIXLN) diff --git a/triage/makefile.linux.gcc.powerpc b/triage/makefile.linux.gcc.powerpc deleted file mode 100644 index 547ba913..00000000 --- a/triage/makefile.linux.gcc.powerpc +++ /dev/null @@ -1,309 +0,0 @@ -#SHELL := /bin/bash -BUILDID=$(shell date +%Y/%m/%d) -TOS = linux -TARCH = powerpc -#TARCH = x86 x86_64 armv6j armv6j_hardfp armv7a_hardfp powerpc -CCOMP = gcc -RELEASE = 1.1 - - -INCLUDEPATH = -Isrc/lib/system/$(TOS)/$(CCOMP)/$(TARCH) - -SETPATH = CFLAGS=$(INCLUDEPATH) PATH=.:/bin:/usr/bin MODULES=.:src/lib:src/lib/v4:src/lib/v4/$(TARCH):src/lib/v4_compat:src/lib/system/$(TOS)/$(CCOMP):src/lib/system/$(TOS)/$(CCOMP)/$(TARCH):src/lib/ulm:src/lib/ulm/$(TARCH):src/lib/ooc2:src/lib/ooc2/$(TOS)/$(CCOMP):src/lib/ooc:src/lib/ooc/$(TOS)/$(CCOMP)/$(TARCH):src/lib/pow:src/lib/misc:src/lib/s3:src/lib/s3/$(TARCH):src/voc:src/voc/$(TOS)/$(CCOMP):src/voc/$(TOS)/$(CCOMP)/$(TARCH):src/tools/ocat:src/tools/browser:src/tools/vocparam:src/tools/vmake:src/tools/coco:src/test - -VOC = voc -VERSION = $(TOS).$(CCOMP).$(TARCH) -VOCSTATIC0 = $(SETPATH) ./vocstatic.$(TOS).$(CCOMP).$(TARCH) -VOCSTATIC = $(SETPATH) ./voc -VOCPARAM = $(shell ./vocparam > voc.par) -LIBNAME = VishapOberon -LIBRARY = lib$(LIBNAME) - -ifndef PRF -PRF = "/opt" -endif -PREFIX = $(PRF)/voc-$(RELEASE) -PREFIXLN = $(PRF)/voc - -CCOPT = -fPIC $(INCLUDEPATH) -g -fno-stack-protector -SHRLIBEXT = so -CC = $(CCOMP) $(CCOPT) -c -CL = $(CCOMP) $(CCOPT) -LD = $(CCOMP) -shared -o $(LIBRARY).$(SHRLIBEXT) -# s is necessary to create index inside a archive -ARCHIVE = ar rcs $(LIBRARY).a - -#%.c: %.Mod -#%.o: %.c -# $(CC) $(input) - -all: stage2 stage3 stage4 stage5 stage6 stage7 - -# when porting to new platform: -# * put corresponding .par file into current directory. it can be generated on the target platform by compiling vocparam (stage0) and running (stage1) -# * run make port0 - this will generate C source files for the target architecture -# * move the source tree to the target machine, and compile (or compile here via crosscompiler) (port1) -port0: stage2 stage3 stage4 - -# now compile C source files for voc, showdef and ocat on target machine (or by using crosscompiler) -port1: stage5 -# after you have "voc" compiled for target architecture. replace vocstatic with it and run make on target platform to get everything compiled - -# this builds binary which generates voc.par -stage0: src/tools/vocparam/vocparam.c - $(CL) -I src/lib/system/$(TOS)/$(CCOMP)/$(TARCH) -o vocparam src/tools/vocparam/vocparam.c - -# this creates voc.par for a host architecture. -# comment this out if you need to build a compiler for a different architecture. -stage1: - #rm voc.par - #$(shell "./vocparam > voc.par") - #./vocparam > voc.par - $(VOCPARAM) - -# this copies necessary voc.par to the current directory. -# skip this if you are building compiler for the host architecture. -stage2: - cp src/par/voc.par.$(CCOMP).$(TARCH) voc.par -# cp src/par/voc.par.gnu.x86_64 voc.par -# cp src/par/voc.par.gnu.x86 voc.par -# cp src/par/voc.par.gnu.armv6 voc.par -# cp src/par/voc.par.gnu.armv7 voc.par - cp src/voc/prf.Mod_default src/voc/prf.Mod - -# this prepares modules necessary to build the compiler itself -stage3: - - $(VOCSTATIC0) -siapxPS SYSTEM.Mod - $(VOCSTATIC0) -sPFS Args.Mod Console.Mod Unix.Mod - sed -i.tmp "s#/opt#$(PRF)#g" src/voc/prf.Mod - $(VOCSTATIC0) -sPFS prf.Mod - $(VOCSTATIC0) -sPFS Strings.Mod architecture.Mod version.Mod Kernel0.Mod Modules.Mod - $(VOCSTATIC0) -sxPFS Files0.Mod - $(VOCSTATIC0) -sPFS Reals.Mod Texts0.Mod - $(VOCSTATIC0) -sPFS vt100.Mod - -# build the compiler -stage4: - $(VOCSTATIC0) -sPFS errors.Mod - $(VOCSTATIC0) -sPFS extTools.Mod - $(VOCSTATIC0) -sPFS OPM.cmdln.Mod - $(VOCSTATIC0) -sxPFS OPS.Mod - $(VOCSTATIC0) -sPFS OPT.Mod OPC.Mod OPV.Mod OPB.Mod OPP.Mod - $(VOCSTATIC0) -smPS voc.Mod - $(VOCSTATIC0) -smPS BrowserCmd.Mod - $(VOCSTATIC0) -smPS OCatCmd.Mod - -#this is to build the compiler from C sources. -#this is a way to create a bootstrap binary. -stage5: - $(CC) SYSTEM.c Args.c Console.c Modules.c Unix.c \ - Strings.c architecture.c prf.c version.c Kernel0.c Files0.c Reals.c Texts0.c vt100.c \ - extTools.c \ - OPM.c OPS.c OPT.c OPC.c OPV.c OPB.c OPP.c errors.c - - $(CL) -static voc.c -o voc \ - SYSTEM.o Args.o Console.o Modules.o Unix.o \ - Strings.o architecture.o prf.o version.o Kernel0.o Files0.o Reals.o Texts0.o vt100.o \ - extTools.o \ - OPM.o OPS.o OPT.o OPC.o OPV.o OPB.o OPP.o errors.o - $(CL) BrowserCmd.c -o showdef \ - SYSTEM.o Args.o Console.o Modules.o Unix.o Strings.o architecture.o prf.o version.o Kernel0.o Files0.o Reals.o Texts0.o vt100.o \ - OPM.o OPS.o OPT.o OPV.o OPC.o errors.o - - $(CL) OCatCmd.c -o ocat \ - SYSTEM.o Args.o Console.o Modules.o Unix.o Strings.o architecture.o prf.o version.o Kernel0.o Files0.o Reals.o Texts0.o - -# build all library files -stage6: - #v4 libs - $(VOCSTATIC) -sPF Kernel.Mod - $(VOCSTATIC) -sPF Files.Mod - $(VOCSTATIC) -sPF Texts.Mod - $(VOCSTATIC) -sPF Printer.Mod - $(VOCSTATIC) -sPF Strings.Mod - $(VOCSTATIC) -sPF Sets.Mod - $(VOCSTATIC) -sPF Sets0.Mod - $(VOCSTATIC) -sPF Oberon.Mod - - #ooc libs - $(VOCSTATIC) -sPF oocAscii.Mod - $(VOCSTATIC) -sPF oocStrings.Mod - $(VOCSTATIC) -sPF oocStrings2.Mod - $(VOCSTATIC) -sPF oocOakStrings.Mod - $(VOCSTATIC) -sPF oocCharClass.Mod - $(VOCSTATIC) -sPF oocConvTypes.Mod - $(VOCSTATIC) -sPF oocIntConv.Mod - $(VOCSTATIC) -sPF oocIntStr.Mod - $(VOCSTATIC) -sPF oocSysClock.Mod - $(VOCSTATIC) -sPF oocTime.Mod - $(VOCSTATIC) -sPF oocRandomNumbers.Mod -# $(VOCSTATIC) -s oocLongStrings.Mod -# $(CC) oocLongStrings.c -# $(VOCSTATIC) -s oocMsg.Mod -# $(CC) oocMsg.c - - - #ooc2 libs - $(VOCSTATIC) -sPF ooc2Strings.Mod - $(VOCSTATIC) -sPF ooc2Ascii.Mod - $(VOCSTATIC) -sPF ooc2CharClass.Mod - $(VOCSTATIC) -sPF ooc2ConvTypes.Mod - $(VOCSTATIC) -sPF ooc2IntConv.Mod - $(VOCSTATIC) -sPF ooc2IntStr.Mod - $(VOCSTATIC) -sPF ooc2Real0.Mod - #ooc libs - $(VOCSTATIC) -sPF oocLowReal.Mod oocLowLReal.Mod - $(VOCSTATIC) -sPF oocRealMath.Mod oocOakMath.Mod - $(VOCSTATIC) -sPF oocLRealMath.Mod - $(VOCSTATIC) -sPF oocLongInts.Mod - $(VOCSTATIC) -sPF oocComplexMath.Mod oocLComplexMath.Mod - $(VOCSTATIC) -sPF oocLRealConv.Mod oocLRealStr.Mod - $(VOCSTATIC) -sPF oocRealConv.Mod oocRealStr.Mod - $(VOCSTATIC) -sPF oocMsg.Mod oocChannel.Mod - $(VOCSTATIC) -sPF oocStrings2.Mod oocRts.Mod oocFilenames.Mod - $(VOCSTATIC) -sPF oocTextRider.Mod oocBinaryRider.Mod oocJulianDay.Mod - $(VOCSTATIC) -sPF oocFilenames.Mod - $(VOCSTATIC) -sPF oocwrapperlibc.Mod - $(VOCSTATIC) -sPF oocC.Mod - - #Ulm's Oberon system libs - $(VOCSTATIC) -sPF ulmSys.Mod - $(VOCSTATIC) -sPF ulmSYSTEM.Mod - $(VOCSTATIC) -sPF ulmASCII.Mod - $(VOCSTATIC) -sPF ulmSets.Mod - $(VOCSTATIC) -sPF ulmObjects.Mod - $(VOCSTATIC) -sPF ulmDisciplines.Mod - $(VOCSTATIC) -sPF ulmPriorities.Mod - $(VOCSTATIC) -sPF ulmServices.Mod - $(VOCSTATIC) -sPF ulmEvents.Mod - $(VOCSTATIC) -sPF ulmResources.Mod - $(VOCSTATIC) -sPF ulmForwarders.Mod - $(VOCSTATIC) -sPF ulmRelatedEvents.Mod - $(VOCSTATIC) -sPF ulmIO.Mod - $(VOCSTATIC) -sPF ulmProcess.Mod - $(VOCSTATIC) -sPF ulmTypes.Mod - $(VOCSTATIC) -sPF ulmStreams.Mod - $(VOCSTATIC) -sPF ulmAssertions.Mod - $(VOCSTATIC) -sPF ulmIndirectDisciplines.Mod - $(VOCSTATIC) -sPF ulmStreamDisciplines.Mod - $(VOCSTATIC) -sPF ulmIEEE.Mod - $(VOCSTATIC) -sPF ulmMC68881.Mod - $(VOCSTATIC) -sPF ulmReals.Mod - $(VOCSTATIC) -sPF ulmPrint.Mod - $(VOCSTATIC) -sPF ulmWrite.Mod - $(VOCSTATIC) -sPF ulmTexts.Mod - $(VOCSTATIC) -sPF ulmStrings.Mod - $(VOCSTATIC) -sPF ulmConstStrings.Mod - $(VOCSTATIC) -sPF ulmPlotters.Mod - $(VOCSTATIC) -sPF ulmSysTypes.Mod - $(VOCSTATIC) -sPF ulmSysConversions.Mod - $(VOCSTATIC) -sPF ulmErrors.Mod - $(VOCSTATIC) -sPF ulmSysErrors.Mod - $(VOCSTATIC) -sPF ulmSysIO.Mod - $(VOCSTATIC) -sPF ulmLoader.Mod - $(VOCSTATIC) -sPF ulmNetIO.Mod - $(VOCSTATIC) -sPF ulmPersistentObjects.Mod - $(VOCSTATIC) -sPF ulmPersistentDisciplines.Mod - $(VOCSTATIC) -sPF ulmOperations.Mod - $(VOCSTATIC) -sPF ulmScales.Mod - $(VOCSTATIC) -sPF ulmTimes.Mod - $(VOCSTATIC) -sPF ulmClocks.Mod - $(VOCSTATIC) -sPF ulmTimers.Mod - $(VOCSTATIC) -sPF ulmConditions.Mod - $(VOCSTATIC) -sPF ulmStreamConditions.Mod - $(VOCSTATIC) -sPF ulmTimeConditions.Mod - $(VOCSTATIC) -sPF ulmSysConversions.Mod - $(VOCSTATIC) -sPF ulmSysStat.Mod - $(VOCSTATIC) -sPF ulmCiphers.Mod - $(VOCSTATIC) -sPF ulmCipherOps.Mod - $(VOCSTATIC) -sPF ulmBlockCiphers.Mod - $(VOCSTATIC) -sPF ulmAsymmetricCiphers.Mod - $(VOCSTATIC) -sPF ulmConclusions.Mod - $(VOCSTATIC) -sPF ulmRandomGenerators.Mod - $(VOCSTATIC) -sPF ulmTCrypt.Mod - $(VOCSTATIC) -sPF ulmIntOperations.Mod - - #pow32 libs - $(VOCSTATIC) -sPF powStrings.Mod - - #misc libs - $(VOCSTATIC) -sPF MultiArrays.Mod - $(VOCSTATIC) -sPF MultiArrayRiders.Mod - $(VOCSTATIC) -sPF MersenneTwister.Mod - $(VOCSTATIC) -sPF Listen.Mod - - #s3 libs - $(VOCSTATIC) -sPF ethBTrees.Mod - $(VOCSTATIC) -sPF ethMD5.Mod - $(VOCSTATIC) -sPF ethSets.Mod - $(VOCSTATIC) -sPF ethZlib.Mod - $(VOCSTATIC) -sPF ethZlibBuffers.Mod - $(VOCSTATIC) -sPF ethZlibInflate.Mod - $(VOCSTATIC) -sPF ethZlibDeflate.Mod - $(VOCSTATIC) -sPF ethZlibReaders.Mod - $(VOCSTATIC) -sPF ethZlibWriters.Mod - $(VOCSTATIC) -sPF ethZip.Mod - $(VOCSTATIC) -sPF ethRandomNumbers.Mod - $(VOCSTATIC) -sPF ethGZReaders.Mod - $(VOCSTATIC) -sPF ethGZWriters.Mod - $(VOCSTATIC) -sPF ethUnicode.Mod - $(VOCSTATIC) -sPF ethDates.Mod - $(VOCSTATIC) -sPF ethReals.Mod - $(VOCSTATIC) -sPF ethStrings.Mod - -# build remaining tools -# $(VOCSTATIC0) -sPFS compatIn.Mod -# $(VOCSTATIC0) -smPS vmake.Mod -# $(CC) compatIn.c -# $(CL) vmake.c -o vmake SYSTEM.o Args.o compatIn.o Texts.o Console.o Files.o Reals.o Modules.o Kernel.o Unix.o Strings.o oocIntStr.o oocConvTypes.o oocIntConv.o - - - -stage7: - #remove non library objects - rm -f Kernel0.o Files0.o Texts0.o architecture.o prf.o version.o extTools.o OPM.o OPS.o OPT.o OPC.o OPV.o OPB.o OPP.o errors.o - #objects := $(wildcard *.o) - #$(LD) objects - $(ARCHIVE) *.o - #$(ARCHIVE) objects - $(LD) *.o - echo "$(PREFIX)/lib" > 05vishap.conf - -clean: -# rm_objects := rm $(wildcard *.o) -# objects - rm *.h - rm *.c - rm *.sym - rm *.o - rm *.a - rm *.$(SHRLIBEXT) - -install: - test -d $(PREFIX)/bin | mkdir -p $(PREFIX)/bin - cp voc $(PREFIX)/bin/ - cp showdef $(PREFIX)/bin/ - cp ocat $(PREFIX)/bin/ - #cp vmake $(PREFIX)/bin/ - cp -a src $(PREFIX)/ - - test -d $(PREFIX)/lib/voc | mkdir -p $(PREFIX)/lib/voc - test -d $(PREFIX)/lib/voc/ | mkdir -p $(PREFIX)/lib/voc - test -d $(PREFIX)/lib/voc/obj | mkdir -p $(PREFIX)/lib/voc/obj - test -d $(PREFIX)/lib/voc/sym | mkdir -p $(PREFIX)/lib/voc/sym - - cp $(LIBRARY).$(SHRLIBEXT) $(PREFIX)/lib - cp $(LIBRARY).a $(PREFIX)/lib - cp *.c $(PREFIX)/lib/voc/obj/ - cp *.h $(PREFIX)/lib/voc/obj/ - cp *.sym $(PREFIX)/lib/voc/sym/ - - cp 05vishap.conf /etc/ld.so.conf.d/ - ldconfig - ln -s $(PREFIX) $(PREFIXLN) - -# cp *.o $(PREFIX)/lib/voc/$(RELEASE)/obj/ -uninstall: - rm -rf $(PREFIX) - rm -rf $(PREFIXLN) diff --git a/triage/makefile.linux.gcc.x86 b/triage/makefile.linux.gcc.x86 deleted file mode 100644 index f283a0dc..00000000 --- a/triage/makefile.linux.gcc.x86 +++ /dev/null @@ -1,309 +0,0 @@ -#SHELL := /bin/bash -BUILDID=$(shell date +%Y/%m/%d) -TOS = linux -TARCH = x86 -#TARCH = x86 x86_64 armv6j armv6j_hardfp armv7a_hardfp powerpc -CCOMP = gcc -RELEASE = 1.1 - - -INCLUDEPATH = -Isrc/lib/system/$(TOS)/$(CCOMP)/$(TARCH) - -SETPATH = CFLAGS=$(INCLUDEPATH) PATH=.:/bin:/usr/bin MODULES=.:src/lib:src/lib/v4:src/lib/v4/$(TARCH):src/lib/v4_compat:src/lib/system/$(TOS)/$(CCOMP):src/lib/system/$(TOS)/$(CCOMP)/$(TARCH):src/lib/ulm:src/lib/ulm/$(TARCH):src/lib/ooc2:src/lib/ooc2/$(TOS)/$(CCOMP):src/lib/ooc:src/lib/ooc/$(TOS)/$(CCOMP)/$(TARCH):src/lib/pow:src/lib/misc:src/lib/s3:src/lib/s3/$(TARCH):src/voc:src/voc/$(TOS)/$(CCOMP):src/voc/$(TOS)/$(CCOMP)/$(TARCH):src/tools/ocat:src/tools/browser:src/tools/vocparam:src/tools/vmake:src/tools/coco:src/test - -VOC = voc -VERSION = $(TOS).$(CCOMP).$(TARCH) -VOCSTATIC0 = $(SETPATH) ./vocstatic.$(TOS).$(CCOMP).$(TARCH) -VOCSTATIC = $(SETPATH) ./voc -VOCPARAM = $(shell ./vocparam > voc.par) -LIBNAME = VishapOberon -LIBRARY = lib$(LIBNAME) - -ifndef PRF -PRF = "/opt" -endif -PREFIX = $(PRF)/voc-$(RELEASE) -PREFIXLN = $(PRF)/voc - -CCOPT = -fPIC $(INCLUDEPATH) -g -fno-stack-protector -SHRLIBEXT = so -CC = $(CCOMP) $(CCOPT) -c -CL = $(CCOMP) $(CCOPT) -LD = $(CCOMP) -shared -o $(LIBRARY).$(SHRLIBEXT) -# s is necessary to create index inside a archive -ARCHIVE = ar rcs $(LIBRARY).a - -#%.c: %.Mod -#%.o: %.c -# $(CC) $(input) - -all: stage2 stage3 stage4 stage5 stage6 stage7 - -# when porting to new platform: -# * put corresponding .par file into current directory. it can be generated on the target platform by compiling vocparam (stage0) and running (stage1) -# * run make port0 - this will generate C source files for the target architecture -# * move the source tree to the target machine, and compile (or compile here via crosscompiler) (port1) -port0: stage2 stage3 stage4 - -# now compile C source files for voc, showdef and ocat on target machine (or by using crosscompiler) -port1: stage5 -# after you have "voc" compiled for target architecture. replace vocstatic with it and run make on target platform to get everything compiled - -# this builds binary which generates voc.par -stage0: src/tools/vocparam/vocparam.c - $(CL) -I src/lib/system/$(TOS)/$(CCOMP)/$(TARCH) -o vocparam src/tools/vocparam/vocparam.c - -# this creates voc.par for a host architecture. -# comment this out if you need to build a compiler for a different architecture. -stage1: - #rm voc.par - #$(shell "./vocparam > voc.par") - #./vocparam > voc.par - $(VOCPARAM) - -# this copies necessary voc.par to the current directory. -# skip this if you are building compiler for the host architecture. -stage2: - cp src/par/voc.par.$(CCOMP).$(TARCH) voc.par -# cp src/par/voc.par.gnu.x86_64 voc.par -# cp src/par/voc.par.gnu.x86 voc.par -# cp src/par/voc.par.gnu.armv6 voc.par -# cp src/par/voc.par.gnu.armv7 voc.par - cp src/voc/prf.Mod_default src/voc/prf.Mod - -# this prepares modules necessary to build the compiler itself -stage3: - - $(VOCSTATIC0) -siapxPS SYSTEM.Mod - $(VOCSTATIC0) -sPFS Args.Mod Console.Mod Unix.Mod - sed -i.tmp "s#/opt#$(PRF)#g" src/voc/prf.Mod - $(VOCSTATIC0) -sPFS prf.Mod - $(VOCSTATIC0) -sPFS Strings.Mod architecture.Mod version.Mod Kernel0.Mod Modules.Mod - $(VOCSTATIC0) -sxPFS Files0.Mod - $(VOCSTATIC0) -sPFS Reals.Mod Texts0.Mod - $(VOCSTATIC0) -sPFS vt100.Mod - -# build the compiler -stage4: - $(VOCSTATIC0) -sPFS errors.Mod - $(VOCSTATIC0) -sPFS extTools.Mod - $(VOCSTATIC0) -sPFS OPM.cmdln.Mod - $(VOCSTATIC0) -sxPFS OPS.Mod - $(VOCSTATIC0) -sPFS OPT.Mod OPC.Mod OPV.Mod OPB.Mod OPP.Mod - $(VOCSTATIC0) -smPS voc.Mod - $(VOCSTATIC0) -smPS BrowserCmd.Mod - $(VOCSTATIC0) -smPS OCatCmd.Mod - -#this is to build the compiler from C sources. -#this is a way to create a bootstrap binary. -stage5: - $(CC) SYSTEM.c Args.c Console.c Modules.c Unix.c \ - Strings.c architecture.c prf.c version.c Kernel0.c Files0.c Reals.c Texts0.c vt100.c \ - extTools.c \ - OPM.c OPS.c OPT.c OPC.c OPV.c OPB.c OPP.c errors.c - - $(CL) -static voc.c -o voc \ - SYSTEM.o Args.o Console.o Modules.o Unix.o \ - Strings.o architecture.o prf.o version.o Kernel0.o Files0.o Reals.o Texts0.o vt100.o \ - extTools.o \ - OPM.o OPS.o OPT.o OPC.o OPV.o OPB.o OPP.o errors.o - $(CL) BrowserCmd.c -o showdef \ - SYSTEM.o Args.o Console.o Modules.o Unix.o Strings.o architecture.o prf.o version.o Kernel0.o Files0.o Reals.o Texts0.o vt100.o \ - OPM.o OPS.o OPT.o OPV.o OPC.o errors.o - - $(CL) OCatCmd.c -o ocat \ - SYSTEM.o Args.o Console.o Modules.o Unix.o Strings.o architecture.o prf.o version.o Kernel0.o Files0.o Reals.o Texts0.o - -# build all library files -stage6: - #v4 libs - $(VOCSTATIC) -sPF Kernel.Mod - $(VOCSTATIC) -sPF Files.Mod - $(VOCSTATIC) -sPF Texts.Mod - $(VOCSTATIC) -sPF Printer.Mod - $(VOCSTATIC) -sPF Strings.Mod - $(VOCSTATIC) -sPF Sets.Mod - $(VOCSTATIC) -sPF Sets0.Mod - $(VOCSTATIC) -sPF Oberon.Mod - - #ooc libs - $(VOCSTATIC) -sPF oocAscii.Mod - $(VOCSTATIC) -sPF oocStrings.Mod - $(VOCSTATIC) -sPF oocStrings2.Mod - $(VOCSTATIC) -sPF oocOakStrings.Mod - $(VOCSTATIC) -sPF oocCharClass.Mod - $(VOCSTATIC) -sPF oocConvTypes.Mod - $(VOCSTATIC) -sPF oocIntConv.Mod - $(VOCSTATIC) -sPF oocIntStr.Mod - $(VOCSTATIC) -sPF oocSysClock.Mod - $(VOCSTATIC) -sPF oocTime.Mod - $(VOCSTATIC) -sPF oocRandomNumbers.Mod -# $(VOCSTATIC) -s oocLongStrings.Mod -# $(CC) oocLongStrings.c -# $(VOCSTATIC) -s oocMsg.Mod -# $(CC) oocMsg.c - - - #ooc2 libs - $(VOCSTATIC) -sPF ooc2Strings.Mod - $(VOCSTATIC) -sPF ooc2Ascii.Mod - $(VOCSTATIC) -sPF ooc2CharClass.Mod - $(VOCSTATIC) -sPF ooc2ConvTypes.Mod - $(VOCSTATIC) -sPF ooc2IntConv.Mod - $(VOCSTATIC) -sPF ooc2IntStr.Mod - $(VOCSTATIC) -sPF ooc2Real0.Mod - #ooc libs - $(VOCSTATIC) -sPF oocLowReal.Mod oocLowLReal.Mod - $(VOCSTATIC) -sPF oocRealMath.Mod oocOakMath.Mod - $(VOCSTATIC) -sPF oocLRealMath.Mod - $(VOCSTATIC) -sPF oocLongInts.Mod - $(VOCSTATIC) -sPF oocComplexMath.Mod oocLComplexMath.Mod - $(VOCSTATIC) -sPF oocLRealConv.Mod oocLRealStr.Mod - $(VOCSTATIC) -sPF oocRealConv.Mod oocRealStr.Mod - $(VOCSTATIC) -sPF oocMsg.Mod oocChannel.Mod - $(VOCSTATIC) -sPF oocStrings2.Mod oocRts.Mod oocFilenames.Mod - $(VOCSTATIC) -sPF oocTextRider.Mod oocBinaryRider.Mod oocJulianDay.Mod - $(VOCSTATIC) -sPF oocFilenames.Mod - $(VOCSTATIC) -sPF oocwrapperlibc.Mod - $(VOCSTATIC) -sPF oocC.Mod - - #Ulm's Oberon system libs - $(VOCSTATIC) -sPF ulmSys.Mod - $(VOCSTATIC) -sPF ulmSYSTEM.Mod - $(VOCSTATIC) -sPF ulmASCII.Mod - $(VOCSTATIC) -sPF ulmSets.Mod - $(VOCSTATIC) -sPF ulmObjects.Mod - $(VOCSTATIC) -sPF ulmDisciplines.Mod - $(VOCSTATIC) -sPF ulmPriorities.Mod - $(VOCSTATIC) -sPF ulmServices.Mod - $(VOCSTATIC) -sPF ulmEvents.Mod - $(VOCSTATIC) -sPF ulmResources.Mod - $(VOCSTATIC) -sPF ulmForwarders.Mod - $(VOCSTATIC) -sPF ulmRelatedEvents.Mod - $(VOCSTATIC) -sPF ulmIO.Mod - $(VOCSTATIC) -sPF ulmProcess.Mod - $(VOCSTATIC) -sPF ulmTypes.Mod - $(VOCSTATIC) -sPF ulmStreams.Mod - $(VOCSTATIC) -sPF ulmAssertions.Mod - $(VOCSTATIC) -sPF ulmIndirectDisciplines.Mod - $(VOCSTATIC) -sPF ulmStreamDisciplines.Mod - $(VOCSTATIC) -sPF ulmIEEE.Mod - $(VOCSTATIC) -sPF ulmMC68881.Mod - $(VOCSTATIC) -sPF ulmReals.Mod - $(VOCSTATIC) -sPF ulmPrint.Mod - $(VOCSTATIC) -sPF ulmWrite.Mod - $(VOCSTATIC) -sPF ulmTexts.Mod - $(VOCSTATIC) -sPF ulmStrings.Mod - $(VOCSTATIC) -sPF ulmConstStrings.Mod - $(VOCSTATIC) -sPF ulmPlotters.Mod - $(VOCSTATIC) -sPF ulmSysTypes.Mod - $(VOCSTATIC) -sPF ulmSysConversions.Mod - $(VOCSTATIC) -sPF ulmErrors.Mod - $(VOCSTATIC) -sPF ulmSysErrors.Mod - $(VOCSTATIC) -sPF ulmSysIO.Mod - $(VOCSTATIC) -sPF ulmLoader.Mod - $(VOCSTATIC) -sPF ulmNetIO.Mod - $(VOCSTATIC) -sPF ulmPersistentObjects.Mod - $(VOCSTATIC) -sPF ulmPersistentDisciplines.Mod - $(VOCSTATIC) -sPF ulmOperations.Mod - $(VOCSTATIC) -sPF ulmScales.Mod - $(VOCSTATIC) -sPF ulmTimes.Mod - $(VOCSTATIC) -sPF ulmClocks.Mod - $(VOCSTATIC) -sPF ulmTimers.Mod - $(VOCSTATIC) -sPF ulmConditions.Mod - $(VOCSTATIC) -sPF ulmStreamConditions.Mod - $(VOCSTATIC) -sPF ulmTimeConditions.Mod - $(VOCSTATIC) -sPF ulmSysConversions.Mod - $(VOCSTATIC) -sPF ulmSysStat.Mod - $(VOCSTATIC) -sPF ulmCiphers.Mod - $(VOCSTATIC) -sPF ulmCipherOps.Mod - $(VOCSTATIC) -sPF ulmBlockCiphers.Mod - $(VOCSTATIC) -sPF ulmAsymmetricCiphers.Mod - $(VOCSTATIC) -sPF ulmConclusions.Mod - $(VOCSTATIC) -sPF ulmRandomGenerators.Mod - $(VOCSTATIC) -sPF ulmTCrypt.Mod - $(VOCSTATIC) -sPF ulmIntOperations.Mod - - #pow32 libs - $(VOCSTATIC) -sPF powStrings.Mod - - #misc libs - $(VOCSTATIC) -sPF MultiArrays.Mod - $(VOCSTATIC) -sPF MultiArrayRiders.Mod - $(VOCSTATIC) -sPF MersenneTwister.Mod - $(VOCSTATIC) -sPF Listen.Mod - - #s3 libs - $(VOCSTATIC) -sPF ethBTrees.Mod - $(VOCSTATIC) -sPF ethMD5.Mod - $(VOCSTATIC) -sPF ethSets.Mod - $(VOCSTATIC) -sPF ethZlib.Mod - $(VOCSTATIC) -sPF ethZlibBuffers.Mod - $(VOCSTATIC) -sPF ethZlibInflate.Mod - $(VOCSTATIC) -sPF ethZlibDeflate.Mod - $(VOCSTATIC) -sPF ethZlibReaders.Mod - $(VOCSTATIC) -sPF ethZlibWriters.Mod - $(VOCSTATIC) -sPF ethZip.Mod - $(VOCSTATIC) -sPF ethRandomNumbers.Mod - $(VOCSTATIC) -sPF ethGZReaders.Mod - $(VOCSTATIC) -sPF ethGZWriters.Mod - $(VOCSTATIC) -sPF ethUnicode.Mod - $(VOCSTATIC) -sPF ethDates.Mod - $(VOCSTATIC) -sPF ethReals.Mod - $(VOCSTATIC) -sPF ethStrings.Mod - -# build remaining tools -# $(VOCSTATIC0) -sPFS compatIn.Mod -# $(VOCSTATIC0) -smPS vmake.Mod -# $(CC) compatIn.c -# $(CL) vmake.c -o vmake SYSTEM.o Args.o compatIn.o Texts.o Console.o Files.o Reals.o Modules.o Kernel.o Unix.o Strings.o oocIntStr.o oocConvTypes.o oocIntConv.o - - - -stage7: - #remove non library objects - rm -f Kernel0.o Files0.o Texts0.o architecture.o prf.o version.o extTools.o OPM.o OPS.o OPT.o OPC.o OPV.o OPB.o OPP.o errors.o - #objects := $(wildcard *.o) - #$(LD) objects - $(ARCHIVE) *.o - #$(ARCHIVE) objects - $(LD) *.o - echo "$(PREFIX)/lib" > 05vishap.conf - -clean: -# rm_objects := rm $(wildcard *.o) -# objects - rm *.h - rm *.c - rm *.sym - rm *.o - rm *.a - rm *.$(SHRLIBEXT) - -install: - test -d $(PREFIX)/bin | mkdir -p $(PREFIX)/bin - cp voc $(PREFIX)/bin/ - cp showdef $(PREFIX)/bin/ - cp ocat $(PREFIX)/bin/ - #cp vmake $(PREFIX)/bin/ - cp -a src $(PREFIX)/ - - test -d $(PREFIX)/lib/voc | mkdir -p $(PREFIX)/lib/voc - test -d $(PREFIX)/lib/voc/ | mkdir -p $(PREFIX)/lib/voc - test -d $(PREFIX)/lib/voc/obj | mkdir -p $(PREFIX)/lib/voc/obj - test -d $(PREFIX)/lib/voc/sym | mkdir -p $(PREFIX)/lib/voc/sym - - cp $(LIBRARY).$(SHRLIBEXT) $(PREFIX)/lib - cp $(LIBRARY).a $(PREFIX)/lib - cp *.c $(PREFIX)/lib/voc/obj/ - cp *.h $(PREFIX)/lib/voc/obj/ - cp *.sym $(PREFIX)/lib/voc/sym/ - - cp 05vishap.conf /etc/ld.so.conf.d/ - ldconfig - ln -s $(PREFIX) $(PREFIXLN) - -# cp *.o $(PREFIX)/lib/voc/$(RELEASE)/obj/ -uninstall: - rm -rf $(PREFIX) - rm -rf $(PREFIXLN) diff --git a/triage/makefile.linux.gcc.x86_64 b/triage/makefile.linux.gcc.x86_64 deleted file mode 100644 index e0513400..00000000 --- a/triage/makefile.linux.gcc.x86_64 +++ /dev/null @@ -1,309 +0,0 @@ -#SHELL := /bin/bash -BUILDID=$(shell date +%Y/%m/%d) -TOS = linux -TARCH = x86_64 -#TARCH = x86 x86_64 armv6j armv6j_hardfp armv7a_hardfp powerpc -CCOMP = gcc -RELEASE = 1.1 - - -INCLUDEPATH = -Isrc/lib/system/$(TOS)/$(CCOMP)/$(TARCH) - -SETPATH = CFLAGS=$(INCLUDEPATH) PATH=.:/bin:/usr/bin MODULES=.:src/lib:src/lib/v4:src/lib/v4/$(TARCH):src/lib/v4_compat:src/lib/system/$(TOS)/$(CCOMP):src/lib/system/$(TOS)/$(CCOMP)/$(TARCH):src/lib/ulm:src/lib/ulm/$(TARCH):src/lib/ooc2:src/lib/ooc2/$(TOS)/$(CCOMP):src/lib/ooc:src/lib/ooc/$(TOS)/$(CCOMP)/$(TARCH):src/lib/pow:src/lib/misc:src/lib/s3:src/lib/s3/$(TARCH):src/voc:src/voc/$(TOS)/$(CCOMP):src/voc/$(TOS)/$(CCOMP)/$(TARCH):src/tools/ocat:src/tools/browser:src/tools/vocparam:src/tools/vmake:src/tools/coco:src/test - -VOC = voc -VERSION = $(TOS).$(CCOMP).$(TARCH) -VOCSTATIC0 = $(SETPATH) ./vocstatic.$(TOS).$(CCOMP).$(TARCH) -VOCSTATIC = $(SETPATH) ./voc -VOCPARAM = $(shell ./vocparam > voc.par) -LIBNAME = VishapOberon -LIBRARY = lib$(LIBNAME) - -ifndef PRF -PRF = "/opt" -endif -PREFIX = $(PRF)/voc-$(RELEASE) -PREFIXLN = $(PRF)/voc - -CCOPT = -fPIC $(INCLUDEPATH) -g -fno-stack-protector -SHRLIBEXT = so -CC = $(CCOMP) $(CCOPT) -c -CL = $(CCOMP) $(CCOPT) -LD = $(CCOMP) -shared -o $(LIBRARY).$(SHRLIBEXT) -# s is necessary to create index inside a archive -ARCHIVE = ar rcs $(LIBRARY).a - -#%.c: %.Mod -#%.o: %.c -# $(CC) $(input) - -all: stage2 stage3 stage4 stage5 stage6 stage7 - -# when porting to new platform: -# * put corresponding .par file into current directory. it can be generated on the target platform by compiling vocparam (stage0) and running (stage1) -# * run make port0 - this will generate C source files for the target architecture -# * move the source tree to the target machine, and compile (or compile here via crosscompiler) (port1) -port0: stage2 stage3 stage4 - -# now compile C source files for voc, showdef and ocat on target machine (or by using crosscompiler) -port1: stage5 -# after you have "voc" compiled for target architecture. replace vocstatic with it and run make on target platform to get everything compiled - -# this builds binary which generates voc.par -stage0: src/tools/vocparam/vocparam.c - $(CL) -I src/lib/system/$(TOS)/$(CCOMP)/$(TARCH) -o vocparam src/tools/vocparam/vocparam.c - -# this creates voc.par for a host architecture. -# comment this out if you need to build a compiler for a different architecture. -stage1: - #rm voc.par - #$(shell "./vocparam > voc.par") - #./vocparam > voc.par - $(VOCPARAM) - -# this copies necessary voc.par to the current directory. -# skip this if you are building compiler for the host architecture. -stage2: - cp src/par/voc.par.$(CCOMP).$(TARCH) voc.par -# cp src/par/voc.par.gnu.x86_64 voc.par -# cp src/par/voc.par.gnu.x86 voc.par -# cp src/par/voc.par.gnu.armv6 voc.par -# cp src/par/voc.par.gnu.armv7 voc.par - cp src/voc/prf.Mod_default src/voc/prf.Mod - -# this prepares modules necessary to build the compiler itself -stage3: - - $(VOCSTATIC0) -siapxPS SYSTEM.Mod - $(VOCSTATIC0) -sPFS Args.Mod Console.Mod Unix.Mod - sed -i.tmp "s#/opt#$(PRF)#g" src/voc/prf.Mod - $(VOCSTATIC0) -sPFS prf.Mod - $(VOCSTATIC0) -sPFS Strings.Mod architecture.Mod version.Mod Kernel0.Mod Modules.Mod - $(VOCSTATIC0) -sxPFS Files0.Mod - $(VOCSTATIC0) -sPFS Reals.Mod Texts0.Mod - $(VOCSTATIC0) -sPFS vt100.Mod - -# build the compiler -stage4: - $(VOCSTATIC0) -sPFS errors.Mod - $(VOCSTATIC0) -sPFS extTools.Mod - $(VOCSTATIC0) -sPFS OPM.cmdln.Mod - $(VOCSTATIC0) -sxPFS OPS.Mod - $(VOCSTATIC0) -sPFS OPT.Mod OPC.Mod OPV.Mod OPB.Mod OPP.Mod - $(VOCSTATIC0) -smPS voc.Mod - $(VOCSTATIC0) -smPS BrowserCmd.Mod - $(VOCSTATIC0) -smPS OCatCmd.Mod - -#this is to build the compiler from C sources. -#this is a way to create a bootstrap binary. -stage5: - $(CC) SYSTEM.c Args.c Console.c Modules.c Unix.c \ - Strings.c architecture.c prf.c version.c Kernel0.c Files0.c Reals.c Texts0.c vt100.c \ - extTools.c \ - OPM.c OPS.c OPT.c OPC.c OPV.c OPB.c OPP.c errors.c - - $(CL) -static voc.c -o voc \ - SYSTEM.o Args.o Console.o Modules.o Unix.o \ - Strings.o architecture.o prf.o version.o Kernel0.o Files0.o Reals.o Texts0.o vt100.o \ - extTools.o \ - OPM.o OPS.o OPT.o OPC.o OPV.o OPB.o OPP.o errors.o - $(CL) BrowserCmd.c -o showdef \ - SYSTEM.o Args.o Console.o Modules.o Unix.o Strings.o architecture.o prf.o version.o Kernel0.o Files0.o Reals.o Texts0.o vt100.o \ - OPM.o OPS.o OPT.o OPV.o OPC.o errors.o - - $(CL) OCatCmd.c -o ocat \ - SYSTEM.o Args.o Console.o Modules.o Unix.o Strings.o architecture.o prf.o version.o Kernel0.o Files0.o Reals.o Texts0.o - -# build all library files -stage6: - #v4 libs - $(VOCSTATIC) -sPF Kernel.Mod - $(VOCSTATIC) -sPF Files.Mod - $(VOCSTATIC) -sPF Texts.Mod - $(VOCSTATIC) -sPF Printer.Mod - $(VOCSTATIC) -sPF Strings.Mod - $(VOCSTATIC) -sPF Sets.Mod - $(VOCSTATIC) -sPF Sets0.Mod - $(VOCSTATIC) -sPF Oberon.Mod - - #ooc libs - $(VOCSTATIC) -sPF oocAscii.Mod - $(VOCSTATIC) -sPF oocStrings.Mod - $(VOCSTATIC) -sPF oocStrings2.Mod - $(VOCSTATIC) -sPF oocOakStrings.Mod - $(VOCSTATIC) -sPF oocCharClass.Mod - $(VOCSTATIC) -sPF oocConvTypes.Mod - $(VOCSTATIC) -sPF oocIntConv.Mod - $(VOCSTATIC) -sPF oocIntStr.Mod - $(VOCSTATIC) -sPF oocSysClock.Mod - $(VOCSTATIC) -sPF oocTime.Mod - $(VOCSTATIC) -sPF oocRandomNumbers.Mod -# $(VOCSTATIC) -s oocLongStrings.Mod -# $(CC) oocLongStrings.c -# $(VOCSTATIC) -s oocMsg.Mod -# $(CC) oocMsg.c - - - #ooc2 libs - $(VOCSTATIC) -sPF ooc2Strings.Mod - $(VOCSTATIC) -sPF ooc2Ascii.Mod - $(VOCSTATIC) -sPF ooc2CharClass.Mod - $(VOCSTATIC) -sPF ooc2ConvTypes.Mod - $(VOCSTATIC) -sPF ooc2IntConv.Mod - $(VOCSTATIC) -sPF ooc2IntStr.Mod - $(VOCSTATIC) -sPF ooc2Real0.Mod - #ooc libs - $(VOCSTATIC) -sPF oocLowReal.Mod oocLowLReal.Mod - $(VOCSTATIC) -sPF oocRealMath.Mod oocOakMath.Mod - $(VOCSTATIC) -sPF oocLRealMath.Mod - $(VOCSTATIC) -sPF oocLongInts.Mod - $(VOCSTATIC) -sPF oocComplexMath.Mod oocLComplexMath.Mod - $(VOCSTATIC) -sPF oocLRealConv.Mod oocLRealStr.Mod - $(VOCSTATIC) -sPF oocRealConv.Mod oocRealStr.Mod - $(VOCSTATIC) -sPF oocMsg.Mod oocChannel.Mod - $(VOCSTATIC) -sPF oocStrings2.Mod oocRts.Mod oocFilenames.Mod - $(VOCSTATIC) -sPF oocTextRider.Mod oocBinaryRider.Mod oocJulianDay.Mod - $(VOCSTATIC) -sPF oocFilenames.Mod - $(VOCSTATIC) -sPF oocwrapperlibc.Mod - $(VOCSTATIC) -sPF oocC.Mod - - #Ulm's Oberon system libs - $(VOCSTATIC) -sPF ulmSys.Mod - $(VOCSTATIC) -sPF ulmSYSTEM.Mod - $(VOCSTATIC) -sPF ulmASCII.Mod - $(VOCSTATIC) -sPF ulmSets.Mod - $(VOCSTATIC) -sPF ulmObjects.Mod - $(VOCSTATIC) -sPF ulmDisciplines.Mod - $(VOCSTATIC) -sPF ulmPriorities.Mod - $(VOCSTATIC) -sPF ulmServices.Mod - $(VOCSTATIC) -sPF ulmEvents.Mod - $(VOCSTATIC) -sPF ulmResources.Mod - $(VOCSTATIC) -sPF ulmForwarders.Mod - $(VOCSTATIC) -sPF ulmRelatedEvents.Mod - $(VOCSTATIC) -sPF ulmIO.Mod - $(VOCSTATIC) -sPF ulmProcess.Mod - $(VOCSTATIC) -sPF ulmTypes.Mod - $(VOCSTATIC) -sPF ulmStreams.Mod - $(VOCSTATIC) -sPF ulmAssertions.Mod - $(VOCSTATIC) -sPF ulmIndirectDisciplines.Mod - $(VOCSTATIC) -sPF ulmStreamDisciplines.Mod - $(VOCSTATIC) -sPF ulmIEEE.Mod - $(VOCSTATIC) -sPF ulmMC68881.Mod - $(VOCSTATIC) -sPF ulmReals.Mod - $(VOCSTATIC) -sPF ulmPrint.Mod - $(VOCSTATIC) -sPF ulmWrite.Mod - $(VOCSTATIC) -sPF ulmTexts.Mod - $(VOCSTATIC) -sPF ulmStrings.Mod - $(VOCSTATIC) -sPF ulmConstStrings.Mod - $(VOCSTATIC) -sPF ulmPlotters.Mod - $(VOCSTATIC) -sPF ulmSysTypes.Mod - $(VOCSTATIC) -sPF ulmSysConversions.Mod - $(VOCSTATIC) -sPF ulmErrors.Mod - $(VOCSTATIC) -sPF ulmSysErrors.Mod - $(VOCSTATIC) -sPF ulmSysIO.Mod - $(VOCSTATIC) -sPF ulmLoader.Mod - $(VOCSTATIC) -sPF ulmNetIO.Mod - $(VOCSTATIC) -sPF ulmPersistentObjects.Mod - $(VOCSTATIC) -sPF ulmPersistentDisciplines.Mod - $(VOCSTATIC) -sPF ulmOperations.Mod - $(VOCSTATIC) -sPF ulmScales.Mod - $(VOCSTATIC) -sPF ulmTimes.Mod - $(VOCSTATIC) -sPF ulmClocks.Mod - $(VOCSTATIC) -sPF ulmTimers.Mod - $(VOCSTATIC) -sPF ulmConditions.Mod - $(VOCSTATIC) -sPF ulmStreamConditions.Mod - $(VOCSTATIC) -sPF ulmTimeConditions.Mod - $(VOCSTATIC) -sPF ulmSysConversions.Mod - $(VOCSTATIC) -sPF ulmSysStat.Mod - $(VOCSTATIC) -sPF ulmCiphers.Mod - $(VOCSTATIC) -sPF ulmCipherOps.Mod - $(VOCSTATIC) -sPF ulmBlockCiphers.Mod - $(VOCSTATIC) -sPF ulmAsymmetricCiphers.Mod - $(VOCSTATIC) -sPF ulmConclusions.Mod - $(VOCSTATIC) -sPF ulmRandomGenerators.Mod - $(VOCSTATIC) -sPF ulmTCrypt.Mod - $(VOCSTATIC) -sPF ulmIntOperations.Mod - - #pow32 libs - $(VOCSTATIC) -sPF powStrings.Mod - - #misc libs - $(VOCSTATIC) -sPF MultiArrays.Mod - $(VOCSTATIC) -sPF MultiArrayRiders.Mod - $(VOCSTATIC) -sPF MersenneTwister.Mod - $(VOCSTATIC) -sPF Listen.Mod - - #s3 libs - $(VOCSTATIC) -sPF ethBTrees.Mod - $(VOCSTATIC) -sPF ethMD5.Mod - $(VOCSTATIC) -sPF ethSets.Mod - $(VOCSTATIC) -sPF ethZlib.Mod - $(VOCSTATIC) -sPF ethZlibBuffers.Mod - $(VOCSTATIC) -sPF ethZlibInflate.Mod - $(VOCSTATIC) -sPF ethZlibDeflate.Mod - $(VOCSTATIC) -sPF ethZlibReaders.Mod - $(VOCSTATIC) -sPF ethZlibWriters.Mod - $(VOCSTATIC) -sPF ethZip.Mod - $(VOCSTATIC) -sPF ethRandomNumbers.Mod - $(VOCSTATIC) -sPF ethGZReaders.Mod - $(VOCSTATIC) -sPF ethGZWriters.Mod - $(VOCSTATIC) -sPF ethUnicode.Mod - $(VOCSTATIC) -sPF ethDates.Mod - $(VOCSTATIC) -sPF ethReals.Mod - $(VOCSTATIC) -sPF ethStrings.Mod - -# build remaining tools -# $(VOCSTATIC0) -sPFS compatIn.Mod -# $(VOCSTATIC0) -smPS vmake.Mod -# $(CC) compatIn.c -# $(CL) vmake.c -o vmake SYSTEM.o Args.o compatIn.o Texts.o Console.o Files.o Reals.o Modules.o Kernel.o Unix.o Strings.o oocIntStr.o oocConvTypes.o oocIntConv.o - - - -stage7: - #remove non library objects - rm -f Kernel0.o Files0.o Texts0.o architecture.o prf.o version.o extTools.o OPM.o OPS.o OPT.o OPC.o OPV.o OPB.o OPP.o errors.o - #objects := $(wildcard *.o) - #$(LD) objects - $(ARCHIVE) *.o - #$(ARCHIVE) objects - $(LD) *.o - echo "$(PREFIX)/lib" > 05vishap.conf - -clean: -# rm_objects := rm $(wildcard *.o) -# objects - rm *.h - rm *.c - rm *.sym - rm *.o - rm *.a - rm *.$(SHRLIBEXT) - -install: - test -d $(PREFIX)/bin | mkdir -p $(PREFIX)/bin - cp voc $(PREFIX)/bin/ - cp showdef $(PREFIX)/bin/ - cp ocat $(PREFIX)/bin/ - #cp vmake $(PREFIX)/bin/ - cp -a src $(PREFIX)/ - - test -d $(PREFIX)/lib/voc | mkdir -p $(PREFIX)/lib/voc - test -d $(PREFIX)/lib/voc/ | mkdir -p $(PREFIX)/lib/voc - test -d $(PREFIX)/lib/voc/obj | mkdir -p $(PREFIX)/lib/voc/obj - test -d $(PREFIX)/lib/voc/sym | mkdir -p $(PREFIX)/lib/voc/sym - - cp $(LIBRARY).$(SHRLIBEXT) $(PREFIX)/lib - cp $(LIBRARY).a $(PREFIX)/lib - cp *.c $(PREFIX)/lib/voc/obj/ - cp *.h $(PREFIX)/lib/voc/obj/ - cp *.sym $(PREFIX)/lib/voc/sym/ - - cp 05vishap.conf /etc/ld.so.conf.d/ - ldconfig - ln -s $(PREFIX) $(PREFIXLN) - -# cp *.o $(PREFIX)/lib/voc/$(RELEASE)/obj/ -uninstall: - rm -rf $(PREFIX) - rm -rf $(PREFIXLN) diff --git a/triage/makefile.openbsd.gcc.x86_64 b/triage/makefile.openbsd.gcc.x86_64 deleted file mode 100644 index 801e1c18..00000000 --- a/triage/makefile.openbsd.gcc.x86_64 +++ /dev/null @@ -1,310 +0,0 @@ -#SHELL := /bin/bash -BUILDID=$(shell date +%Y/%m/%d) -TOS = openbsd -TARCH = x86_64 -#TARCH = x86 x86_64 armv6j armv6j_hardfp armv7a_hardfp powerpc -CCOMP = gcc -RELEASE = 1.1 - - -INCLUDEPATH = -Isrc/lib/system/$(TOS)/$(CCOMP)/$(TARCH) - -SETPATH = CFLAGS=$(INCLUDEPATH) PATH=.:/bin:/usr/bin MODULES=.:src/lib:src/lib/v4:src/lib/v4/$(TARCH):src/lib/v4_compat:src/lib/system/$(TOS)/$(CCOMP):src/lib/system/$(TOS)/$(CCOMP)/$(TARCH):src/lib/ulm:src/lib/ulm/$(TARCH):src/lib/ooc2:src/lib/ooc2/$(TOS)/$(CCOMP):src/lib/ooc:src/lib/ooc/$(TOS)/$(CCOMP)/$(TARCH):src/lib/pow:src/lib/misc:src/lib/s3:src/lib/s3/$(TARCH):src/voc:src/voc/$(TOS)/$(CCOMP):src/voc/$(TOS)/$(CCOMP)/$(TARCH):src/tools/ocat:src/tools/browser:src/tools/vocparam:src/tools/vmake:src/tools/coco:src/test - -VOC = voc -VERSION = $(TOS).$(CCOMP).$(TARCH) -VOCSTATIC0 = $(SETPATH) ./vocstatic.$(TOS).$(CCOMP).$(TARCH) -VOCSTATIC = $(SETPATH) ./voc -VOCPARAM = $(shell ./vocparam > voc.par) -LIBNAME = VishapOberon -LIBRARY = lib$(LIBNAME) - -ifndef PRF -PRF = "/opt" -endif -PREFIX = $(PRF)/voc-$(RELEASE) -PREFIXLN = $(PRF)/voc - -CCOPT = -fPIC $(INCLUDEPATH) -g -SHRLIBEXT = so -CC = $(CCOMP) $(CCOPT) -c -CL = $(CCOMP) $(CCOPT) -LD = $(CCOMP) -shared -o $(LIBRARY).$(SHRLIBEXT) -# s is necessary to create index inside a archive -ARCHIVE = ar rcs $(LIBRARY).a - -#%.c: %.Mod -#%.o: %.c -# $(CC) $(input) - -all: stage2 stage3 stage4 stage5 stage6 stage7 - -# when porting to new platform: -# * put corresponding .par file into current directory. it can be generated on the target platform by compiling vocparam (stage0) and running (stage1) -# * run make port0 - this will generate C source files for the target architecture -# * move the source tree to the target machine, and compile (or compile here via crosscompiler) (port1) -port0: stage2 stage3 stage4 - -# now compile C source files for voc, showdef and ocat on target machine (or by using crosscompiler) -port1: stage5 -# after you have "voc" compiled for target architecture. replace vocstatic with it and run make on target platform to get everything compiled - -# this builds binary which generates voc.par -stage0: src/tools/vocparam/vocparam.c - $(CL) -I src/lib/system/$(TOS)/$(CCOMP)/$(TARCH) -o vocparam src/tools/vocparam/vocparam.c - -# this creates voc.par for a host architecture. -# comment this out if you need to build a compiler for a different architecture. -stage1: - #rm voc.par - #$(shell "./vocparam > voc.par") - #./vocparam > voc.par - $(VOCPARAM) - -# this copies necessary voc.par to the current directory. -# skip this if you are building compiler for the host architecture. -stage2: - cp src/par/voc.par.$(CCOMP).$(TARCH) voc.par -# cp src/par/voc.par.gnu.x86_64 voc.par -# cp src/par/voc.par.gnu.x86 voc.par -# cp src/par/voc.par.gnu.armv6 voc.par -# cp src/par/voc.par.gnu.armv7 voc.par - cp src/voc/prf.Mod_default src/voc/prf.Mod - -# this prepares modules necessary to build the compiler itself -stage3: - - $(VOCSTATIC0) -siapxPS SYSTEM.Mod - $(VOCSTATIC0) -sPFS Args.Mod Console.Mod Unix.Mod - sed "s#/opt#$(PRF)#g" src/voc/prf.Mod > tmp.Mod - mv tmp.Mod src/voc/prf.Mod - $(VOCSTATIC0) -sPFS prf.Mod - $(VOCSTATIC0) -sPFS Strings.Mod architecture.Mod version.Mod Kernel0.Mod Modules.Mod - $(VOCSTATIC0) -sxPFS Files0.Mod - $(VOCSTATIC0) -sPFS Reals.Mod Texts0.Mod - $(VOCSTATIC0) -sPFS vt100.Mod - -# build the compiler -stage4: - $(VOCSTATIC0) -sPFS errors.Mod - $(VOCSTATIC0) -sPFS extTools.Mod - $(VOCSTATIC0) -sPFS OPM.cmdln.Mod - $(VOCSTATIC0) -sxPFS OPS.Mod - $(VOCSTATIC0) -sPFS OPT.Mod OPC.Mod OPV.Mod OPB.Mod OPP.Mod - $(VOCSTATIC0) -smPS voc.Mod - $(VOCSTATIC0) -smPS BrowserCmd.Mod - $(VOCSTATIC0) -smPS OCatCmd.Mod - -#this is to build the compiler from C sources. -#this is a way to create a bootstrap binary. -stage5: - $(CC) SYSTEM.c Args.c Console.c Modules.c Unix.c \ - Strings.c architecture.c prf.c version.c Kernel0.c Files0.c Reals.c Texts0.c vt100.c \ - extTools.c \ - OPM.c OPS.c OPT.c OPC.c OPV.c OPB.c OPP.c errors.c - - $(CL) -static voc.c -o voc \ - SYSTEM.o Args.o Console.o Modules.o Unix.o \ - Strings.o architecture.o prf.o version.o Kernel0.o Files0.o Reals.o Texts0.o vt100.o \ - extTools.o \ - OPM.o OPS.o OPT.o OPC.o OPV.o OPB.o OPP.o errors.o - $(CL) BrowserCmd.c -o showdef \ - SYSTEM.o Args.o Console.o Modules.o Unix.o Strings.o architecture.o prf.o version.o Kernel0.o Files0.o Reals.o Texts0.o vt100.o \ - OPM.o OPS.o OPT.o OPV.o OPC.o errors.o - - $(CL) OCatCmd.c -o ocat \ - SYSTEM.o Args.o Console.o Modules.o Unix.o Strings.o architecture.o prf.o version.o Kernel0.o Files0.o Reals.o Texts0.o - -# build all library files -stage6: - #v4 libs - $(VOCSTATIC) -sPF Kernel.Mod - $(VOCSTATIC) -sPF Files.Mod - $(VOCSTATIC) -sPF Texts.Mod - $(VOCSTATIC) -sPF Printer.Mod - $(VOCSTATIC) -sPF Strings.Mod - $(VOCSTATIC) -sPF Sets.Mod - $(VOCSTATIC) -sPF Sets0.Mod - $(VOCSTATIC) -sPF Oberon.Mod - - #ooc libs - $(VOCSTATIC) -sPF oocAscii.Mod - $(VOCSTATIC) -sPF oocStrings.Mod - $(VOCSTATIC) -sPF oocStrings2.Mod - $(VOCSTATIC) -sPF oocOakStrings.Mod - $(VOCSTATIC) -sPF oocCharClass.Mod - $(VOCSTATIC) -sPF oocConvTypes.Mod - $(VOCSTATIC) -sPF oocIntConv.Mod - $(VOCSTATIC) -sPF oocIntStr.Mod - $(VOCSTATIC) -sPF oocSysClock.Mod - $(VOCSTATIC) -sPF oocTime.Mod - $(VOCSTATIC) -sPF oocRandomNumbers.Mod -# $(VOCSTATIC) -s oocLongStrings.Mod -# $(CC) oocLongStrings.c -# $(VOCSTATIC) -s oocMsg.Mod -# $(CC) oocMsg.c - - - #ooc2 libs - $(VOCSTATIC) -sPF ooc2Strings.Mod - $(VOCSTATIC) -sPF ooc2Ascii.Mod - $(VOCSTATIC) -sPF ooc2CharClass.Mod - $(VOCSTATIC) -sPF ooc2ConvTypes.Mod - $(VOCSTATIC) -sPF ooc2IntConv.Mod - $(VOCSTATIC) -sPF ooc2IntStr.Mod - $(VOCSTATIC) -sPF ooc2Real0.Mod - #ooc libs - $(VOCSTATIC) -sPF oocLowReal.Mod oocLowLReal.Mod - $(VOCSTATIC) -sPF oocRealMath.Mod oocOakMath.Mod - $(VOCSTATIC) -sPF oocLRealMath.Mod - $(VOCSTATIC) -sPF oocLongInts.Mod - $(VOCSTATIC) -sPF oocComplexMath.Mod oocLComplexMath.Mod - $(VOCSTATIC) -sPF oocLRealConv.Mod oocLRealStr.Mod - $(VOCSTATIC) -sPF oocRealConv.Mod oocRealStr.Mod - $(VOCSTATIC) -sPF oocMsg.Mod oocChannel.Mod - $(VOCSTATIC) -sPF oocStrings2.Mod oocRts.Mod oocFilenames.Mod - $(VOCSTATIC) -sPF oocTextRider.Mod oocBinaryRider.Mod oocJulianDay.Mod - $(VOCSTATIC) -sPF oocFilenames.Mod - $(VOCSTATIC) -sPF oocwrapperlibc.Mod - $(VOCSTATIC) -sPF oocC.Mod - - #Ulm's Oberon system libs - $(VOCSTATIC) -sPF ulmSys.Mod - $(VOCSTATIC) -sPF ulmSYSTEM.Mod - $(VOCSTATIC) -sPF ulmASCII.Mod - $(VOCSTATIC) -sPF ulmSets.Mod - $(VOCSTATIC) -sPF ulmObjects.Mod - $(VOCSTATIC) -sPF ulmDisciplines.Mod - $(VOCSTATIC) -sPF ulmPriorities.Mod - $(VOCSTATIC) -sPF ulmServices.Mod - $(VOCSTATIC) -sPF ulmEvents.Mod - $(VOCSTATIC) -sPF ulmResources.Mod - $(VOCSTATIC) -sPF ulmForwarders.Mod - $(VOCSTATIC) -sPF ulmRelatedEvents.Mod - $(VOCSTATIC) -sPF ulmIO.Mod - $(VOCSTATIC) -sPF ulmProcess.Mod - $(VOCSTATIC) -sPF ulmTypes.Mod - $(VOCSTATIC) -sPF ulmStreams.Mod - $(VOCSTATIC) -sPF ulmAssertions.Mod - $(VOCSTATIC) -sPF ulmIndirectDisciplines.Mod - $(VOCSTATIC) -sPF ulmStreamDisciplines.Mod - $(VOCSTATIC) -sPF ulmIEEE.Mod - $(VOCSTATIC) -sPF ulmMC68881.Mod - $(VOCSTATIC) -sPF ulmReals.Mod - $(VOCSTATIC) -sPF ulmPrint.Mod - $(VOCSTATIC) -sPF ulmWrite.Mod - $(VOCSTATIC) -sPF ulmTexts.Mod - $(VOCSTATIC) -sPF ulmStrings.Mod - $(VOCSTATIC) -sPF ulmConstStrings.Mod - $(VOCSTATIC) -sPF ulmPlotters.Mod - $(VOCSTATIC) -sPF ulmSysTypes.Mod - $(VOCSTATIC) -sPF ulmSysConversions.Mod - $(VOCSTATIC) -sPF ulmErrors.Mod - $(VOCSTATIC) -sPF ulmSysErrors.Mod - $(VOCSTATIC) -sPF ulmSysIO.Mod - $(VOCSTATIC) -sPF ulmLoader.Mod - $(VOCSTATIC) -sPF ulmNetIO.Mod - $(VOCSTATIC) -sPF ulmPersistentObjects.Mod - $(VOCSTATIC) -sPF ulmPersistentDisciplines.Mod - $(VOCSTATIC) -sPF ulmOperations.Mod - $(VOCSTATIC) -sPF ulmScales.Mod - $(VOCSTATIC) -sPF ulmTimes.Mod - $(VOCSTATIC) -sPF ulmClocks.Mod - $(VOCSTATIC) -sPF ulmTimers.Mod - $(VOCSTATIC) -sPF ulmConditions.Mod - $(VOCSTATIC) -sPF ulmStreamConditions.Mod - $(VOCSTATIC) -sPF ulmTimeConditions.Mod - $(VOCSTATIC) -sPF ulmSysConversions.Mod - $(VOCSTATIC) -sPF ulmSysStat.Mod - $(VOCSTATIC) -sPF ulmCiphers.Mod - $(VOCSTATIC) -sPF ulmCipherOps.Mod - $(VOCSTATIC) -sPF ulmBlockCiphers.Mod - $(VOCSTATIC) -sPF ulmAsymmetricCiphers.Mod - $(VOCSTATIC) -sPF ulmConclusions.Mod - $(VOCSTATIC) -sPF ulmRandomGenerators.Mod - $(VOCSTATIC) -sPF ulmTCrypt.Mod - $(VOCSTATIC) -sPF ulmIntOperations.Mod - - #pow32 libs - $(VOCSTATIC) -sPF powStrings.Mod - - #misc libs - $(VOCSTATIC) -sPF MultiArrays.Mod - $(VOCSTATIC) -sPF MultiArrayRiders.Mod - $(VOCSTATIC) -sPF MersenneTwister.Mod - $(VOCSTATIC) -sPF Listen.Mod - - #s3 libs - $(VOCSTATIC) -sPF ethBTrees.Mod - $(VOCSTATIC) -sPF ethMD5.Mod - $(VOCSTATIC) -sPF ethSets.Mod - $(VOCSTATIC) -sPF ethZlib.Mod - $(VOCSTATIC) -sPF ethZlibBuffers.Mod - $(VOCSTATIC) -sPF ethZlibInflate.Mod - $(VOCSTATIC) -sPF ethZlibDeflate.Mod - $(VOCSTATIC) -sPF ethZlibReaders.Mod - $(VOCSTATIC) -sPF ethZlibWriters.Mod - $(VOCSTATIC) -sPF ethZip.Mod - $(VOCSTATIC) -sPF ethRandomNumbers.Mod - $(VOCSTATIC) -sPF ethGZReaders.Mod - $(VOCSTATIC) -sPF ethGZWriters.Mod - $(VOCSTATIC) -sPF ethUnicode.Mod - $(VOCSTATIC) -sPF ethDates.Mod - $(VOCSTATIC) -sPF ethReals.Mod - $(VOCSTATIC) -sPF ethStrings.Mod - -# build remaining tools -# $(VOCSTATIC0) -sPFS compatIn.Mod -# $(VOCSTATIC0) -smPS vmake.Mod -# $(CC) compatIn.c -# $(CL) vmake.c -o vmake SYSTEM.o Args.o compatIn.o Texts.o Console.o Files.o Reals.o Modules.o Kernel.o Unix.o Strings.o oocIntStr.o oocConvTypes.o oocIntConv.o - - - -stage7: - #remove non library objects - rm -f Kernel0.o Files0.o Texts0.o architecture.o prf.o version.o extTools.o OPM.o OPS.o OPT.o OPC.o OPV.o OPB.o OPP.o errors.o - #objects := $(wildcard *.o) - #$(LD) objects - $(ARCHIVE) *.o - #$(ARCHIVE) objects - $(LD) *.o - echo "$(PREFIX)/lib" > 05vishap.conf - -clean: -# rm_objects := rm $(wildcard *.o) -# objects - rm *.h - rm *.c - rm *.sym - rm *.o - rm *.a - rm *.$(SHRLIBEXT) - -install: - test -d $(PREFIX)/bin | mkdir -p $(PREFIX)/bin - cp voc $(PREFIX)/bin/ - cp showdef $(PREFIX)/bin/ - cp ocat $(PREFIX)/bin/ - #cp vmake $(PREFIX)/bin/ - cp -RPp src $(PREFIX)/ - - test -d $(PREFIX)/lib/voc | mkdir -p $(PREFIX)/lib/voc - test -d $(PREFIX)/lib/voc/ | mkdir -p $(PREFIX)/lib/voc - test -d $(PREFIX)/lib/voc/obj | mkdir -p $(PREFIX)/lib/voc/obj - test -d $(PREFIX)/lib/voc/sym | mkdir -p $(PREFIX)/lib/voc/sym - - cp $(LIBRARY).$(SHRLIBEXT) $(PREFIX)/lib - cp $(LIBRARY).a $(PREFIX)/lib - cp *.c $(PREFIX)/lib/voc/obj/ - cp *.h $(PREFIX)/lib/voc/obj/ - cp *.sym $(PREFIX)/lib/voc/sym/ - - #cp 05vishap.conf /etc/ld.so.conf.d/ - ldconfig -m $(PREFIX)/lib - ln -s $(PREFIX) $(PREFIXLN) - -# cp *.o $(PREFIX)/lib/voc/$(RELEASE)/obj/ -uninstall: - rm -rf $(PREFIX) - rm -rf $(PREFIXLN) From 88dd4e4d13c49317029a7f5a3def9a95afb76ebb Mon Sep 17 00:00:00 2001 From: David Brown Date: Mon, 27 Jun 2016 17:07:54 +0100 Subject: [PATCH 099/580] Emit 'now set path' message at end of 'make full'. --- makefile | 2 ++ src/tools/make/vishap.make | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/makefile b/makefile index a9185517..4f2dfc60 100644 --- a/makefile +++ b/makefile @@ -139,6 +139,7 @@ full: configuration @make -f src/tools/make/vishap.make -s library @make -f src/tools/make/vishap.make -s install @make -f src/tools/make/vishap.make -s confidence + @make -f src/tools/make/vishap.make -s showpath @@ -169,6 +170,7 @@ library: configuration install: configuration @make -f src/tools/make/vishap.make -s installable @make -f src/tools/make/vishap.make -s install + @make -f src/tools/make/vishap.make -s showpath uninstall: configuration @make -f src/tools/make/vishap.make -s installable diff --git a/src/tools/make/vishap.make b/src/tools/make/vishap.make index 43986b73..cd88c04e 100644 --- a/src/tools/make/vishap.make +++ b/src/tools/make/vishap.make @@ -173,6 +173,10 @@ install: @-cp $(BUILDDIR)/showdef$(BINEXT) "$(INSTALLDIR)/bin" @cp $(BUILDDIR)/lib$(ONAME).* "$(INSTALLDIR)/lib/" @if which ldconfig >/dev/null 2>&1; then $(LDCONFIG); fi + + +# showpath: Describe how to set the PATH variable +showpath: @printf "\nNow add $(INSTALLDIR)/bin to your path, for example with the command:\n" @printf "export PATH=\"$(INSTALLDIR)/bin:\$$PATH\"\n" @printf "\n" From f383a6c0329f5f58ac8627aaa54547e7a7f6bb20 Mon Sep 17 00:00:00 2001 From: David Brown Date: Mon, 27 Jun 2016 17:23:18 +0100 Subject: [PATCH 100/580] Correct quoting in postpush.pl. --- src/tools/testcoordinator/postpush.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/testcoordinator/postpush.pl b/src/tools/testcoordinator/postpush.pl index 3eb07825..079f9e56 100644 --- a/src/tools/testcoordinator/postpush.pl +++ b/src/tools/testcoordinator/postpush.pl @@ -31,4 +31,4 @@ flock(LOG, 2) or die "Could not lock postpush.log"; printf LOG strftime("%Y/%m/%d %H.%M.%S", localtime), " Repository $repo, branch $branch, name $name.\n"; close(LOG); -system "ssh root@oberon perl vishap/voc/src/tools/testcoordinator/buildall.pl >/tmp/buildall.log &"; +system 'ssh root@oberon perl vishap/voc/src/tools/testcoordinator/buildall.pl >/tmp/buildall.log &'; From 71e5e38d89ffd5fa80fe49a747ec0ab9a77ae7a8 Mon Sep 17 00:00:00 2001 From: David Brown Date: Mon, 27 Jun 2016 17:43:49 +0100 Subject: [PATCH 101/580] Debugging postpush.pl --- src/tools/testcoordinator/postpush.pl | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/src/tools/testcoordinator/postpush.pl b/src/tools/testcoordinator/postpush.pl index 079f9e56..de0eb616 100644 --- a/src/tools/testcoordinator/postpush.pl +++ b/src/tools/testcoordinator/postpush.pl @@ -9,6 +9,16 @@ use POSIX "strftime"; use CGI qw(:standard escapeHTML); use JSON; +sub writelog { + my ($msg) = @_; + + open(LOG, ">>/tmp/postpush.log") or die "Could not create postpush.log"; + flock(LOG, 2) or die "Could not lock postpush.log"; + print LOG sprintf("%s %s\n", strftime("%Y/%m/%d %H.%M.%S", localtime), $msg); + close(LOG); +} + +writelog "Postpush."; my $postdata = from_json(param('POSTDATA')); @@ -19,16 +29,15 @@ my $name = $postdata->{'head_commit'}->{'author'}->{'name'}; my $branch = $ref; $branch =~ s'^.*\/''; my $repo = $url; $repo =~ s'^.*\/''; +#my $repo="repo"; my $branch="branch"; my $name="name"; + +writelog "Repository $repo, branch $branch, name $name."; print header(), start_html("Vishap Oberon github post push web hook."), p("Repository $repo, branch $branch, name $name."), end_html(); - -open(LOG, ">>/tmp/postpush.log") or die "Could not create postpush.log"; -flock(LOG, 2) or die "Could not lock postpush.log"; -printf LOG strftime("%Y/%m/%d %H.%M.%S", localtime), " Repository $repo, branch $branch, name $name.\n"; -close(LOG); - system 'ssh root@oberon perl vishap/voc/src/tools/testcoordinator/buildall.pl >/tmp/buildall.log &'; + +writelog "Buildall triggered." From dff410e5b58b7997cce5f58cac8bebcaec88639d Mon Sep 17 00:00:00 2001 From: David Brown Date: Mon, 27 Jun 2016 17:49:22 +0100 Subject: [PATCH 102/580] Debugging postpush.pl --- src/tools/testcoordinator/postpush.pl | 42 +++++++++++++-------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/src/tools/testcoordinator/postpush.pl b/src/tools/testcoordinator/postpush.pl index de0eb616..a3c0c6de 100644 --- a/src/tools/testcoordinator/postpush.pl +++ b/src/tools/testcoordinator/postpush.pl @@ -20,24 +20,24 @@ sub writelog { writelog "Postpush."; -my $postdata = from_json(param('POSTDATA')); - -my $url = $postdata->{'repository'}->{'url'}; -my $ref = $postdata->{'ref'}; -my $name = $postdata->{'head_commit'}->{'author'}->{'name'}; - -my $branch = $ref; $branch =~ s'^.*\/''; -my $repo = $url; $repo =~ s'^.*\/''; - -#my $repo="repo"; my $branch="branch"; my $name="name"; - -writelog "Repository $repo, branch $branch, name $name."; - -print header(), - start_html("Vishap Oberon github post push web hook."), - p("Repository $repo, branch $branch, name $name."), - end_html(); - -system 'ssh root@oberon perl vishap/voc/src/tools/testcoordinator/buildall.pl >/tmp/buildall.log &'; - -writelog "Buildall triggered." +# my $postdata = from_json(param('POSTDATA')); +# +# my $url = $postdata->{'repository'}->{'url'}; +# my $ref = $postdata->{'ref'}; +# my $name = $postdata->{'head_commit'}->{'author'}->{'name'}; +# +# my $branch = $ref; $branch =~ s'^.*\/''; +# my $repo = $url; $repo =~ s'^.*\/''; +# +# #my $repo="repo"; my $branch="branch"; my $name="name"; +# +# writelog "Repository $repo, branch $branch, name $name."; +# +# print header(), +# start_html("Vishap Oberon github post push web hook."), +# p("Repository $repo, branch $branch, name $name."), +# end_html(); +# +# system 'ssh root@oberon perl vishap/voc/src/tools/testcoordinator/buildall.pl >/tmp/buildall.log &'; +# +# writelog "Buildall triggered." From 61c9790edc0b97fc1b44b1ce5c0ef1fa86f4838f Mon Sep 17 00:00:00 2001 From: David Brown Date: Mon, 27 Jun 2016 17:53:20 +0100 Subject: [PATCH 103/580] Debugging postpush.pl --- src/tools/testcoordinator/postpush.pl | 42 +++++++++++++-------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/src/tools/testcoordinator/postpush.pl b/src/tools/testcoordinator/postpush.pl index a3c0c6de..de0eb616 100644 --- a/src/tools/testcoordinator/postpush.pl +++ b/src/tools/testcoordinator/postpush.pl @@ -20,24 +20,24 @@ sub writelog { writelog "Postpush."; -# my $postdata = from_json(param('POSTDATA')); -# -# my $url = $postdata->{'repository'}->{'url'}; -# my $ref = $postdata->{'ref'}; -# my $name = $postdata->{'head_commit'}->{'author'}->{'name'}; -# -# my $branch = $ref; $branch =~ s'^.*\/''; -# my $repo = $url; $repo =~ s'^.*\/''; -# -# #my $repo="repo"; my $branch="branch"; my $name="name"; -# -# writelog "Repository $repo, branch $branch, name $name."; -# -# print header(), -# start_html("Vishap Oberon github post push web hook."), -# p("Repository $repo, branch $branch, name $name."), -# end_html(); -# -# system 'ssh root@oberon perl vishap/voc/src/tools/testcoordinator/buildall.pl >/tmp/buildall.log &'; -# -# writelog "Buildall triggered." +my $postdata = from_json(param('POSTDATA')); + +my $url = $postdata->{'repository'}->{'url'}; +my $ref = $postdata->{'ref'}; +my $name = $postdata->{'head_commit'}->{'author'}->{'name'}; + +my $branch = $ref; $branch =~ s'^.*\/''; +my $repo = $url; $repo =~ s'^.*\/''; + +#my $repo="repo"; my $branch="branch"; my $name="name"; + +writelog "Repository $repo, branch $branch, name $name."; + +print header(), + start_html("Vishap Oberon github post push web hook."), + p("Repository $repo, branch $branch, name $name."), + end_html(); + +system 'ssh root@oberon perl vishap/voc/src/tools/testcoordinator/buildall.pl >/tmp/buildall.log &'; + +writelog "Buildall triggered." From 3a17e1a65685db28158fd65fff295e93a1bec31f Mon Sep 17 00:00:00 2001 From: David Brown Date: Mon, 27 Jun 2016 17:56:19 +0100 Subject: [PATCH 104/580] Debugging postpush.pl --- src/tools/testcoordinator/postpush.pl | 1 + 1 file changed, 1 insertion(+) diff --git a/src/tools/testcoordinator/postpush.pl b/src/tools/testcoordinator/postpush.pl index de0eb616..947ef1d5 100644 --- a/src/tools/testcoordinator/postpush.pl +++ b/src/tools/testcoordinator/postpush.pl @@ -9,6 +9,7 @@ use POSIX "strftime"; use CGI qw(:standard escapeHTML); use JSON; + sub writelog { my ($msg) = @_; From 77f6fa772ceb6b348ec062fa1aeb0884a11b152f Mon Sep 17 00:00:00 2001 From: David C W Brown Date: Mon, 27 Jun 2016 20:41:49 +0100 Subject: [PATCH 105/580] Working post push hook now? --- src/tools/testcoordinator/postpush.pl | 30 ++++++++++++++++++++------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/src/tools/testcoordinator/postpush.pl b/src/tools/testcoordinator/postpush.pl index 3eb07825..f0edcec7 100644 --- a/src/tools/testcoordinator/postpush.pl +++ b/src/tools/testcoordinator/postpush.pl @@ -9,6 +9,14 @@ use POSIX "strftime"; use CGI qw(:standard escapeHTML); use JSON; +sub writelog { + my ($msg) = @_; + + open(LOG, ">>/tmp/postpush.log") or die "Could not create postpush.log"; + flock(LOG, 2) or die "Could not lock postpush.log"; + print LOG sprintf("%s %s\n", strftime("%Y/%m/%d %H.%M.%S", localtime), $msg); + close(LOG); +} my $postdata = from_json(param('POSTDATA')); @@ -19,16 +27,22 @@ my $name = $postdata->{'head_commit'}->{'author'}->{'name'}; my $branch = $ref; $branch =~ s'^.*\/''; my $repo = $url; $repo =~ s'^.*\/''; +#my $repo="repo"; my $branch="branch"; my $name="name"; + +writelog "Post push github web hook for repository $repo, branch $branch, name $name."; + +my $child = fork; +if (not defined $child) {die "Fork failed.";} +if ($child) { + # parent process + writelog "Started ssh, pid = $child."; +} else { + # child process + exec 'ssh root@oberon "perl vishap/voc/src/tools/testcoordinator/buildall.pl >/tmp/buildall.log &"'; + exit; +} print header(), start_html("Vishap Oberon github post push web hook."), p("Repository $repo, branch $branch, name $name."), end_html(); - - -open(LOG, ">>/tmp/postpush.log") or die "Could not create postpush.log"; -flock(LOG, 2) or die "Could not lock postpush.log"; -printf LOG strftime("%Y/%m/%d %H.%M.%S", localtime), " Repository $repo, branch $branch, name $name.\n"; -close(LOG); - -system "ssh root@oberon perl vishap/voc/src/tools/testcoordinator/buildall.pl >/tmp/buildall.log &"; From 99bd3b3105fb6d8d2817ea87166ba9b6e7694632 Mon Sep 17 00:00:00 2001 From: David C W Brown Date: Mon, 27 Jun 2016 20:46:43 +0100 Subject: [PATCH 106/580] Checkin real (not merged) postpush.pl --- src/tools/testcoordinator/postpush.pl | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/src/tools/testcoordinator/postpush.pl b/src/tools/testcoordinator/postpush.pl index 67be27ab..25bb2a89 100644 --- a/src/tools/testcoordinator/postpush.pl +++ b/src/tools/testcoordinator/postpush.pl @@ -18,17 +18,6 @@ sub writelog { close(LOG); } -sub writelog { - my ($msg) = @_; - - open(LOG, ">>/tmp/postpush.log") or die "Could not create postpush.log"; - flock(LOG, 2) or die "Could not lock postpush.log"; - print LOG sprintf("%s %s\n", strftime("%Y/%m/%d %H.%M.%S", localtime), $msg); - close(LOG); -} - -writelog "Postpush."; - my $postdata = from_json(param('POSTDATA')); my $url = $postdata->{'repository'}->{'url'}; @@ -40,9 +29,9 @@ my $repo = $url; $repo =~ s'^.*\/''; #my $repo="repo"; my $branch="branch"; my $name="name"; -<<<<<<< HEAD writelog "Post push github web hook for repository $repo, branch $branch, name $name."; + my $child = fork; if (not defined $child) {die "Fork failed.";} if ($child) { @@ -53,18 +42,8 @@ if ($child) { exec 'ssh root@oberon "perl vishap/voc/src/tools/testcoordinator/buildall.pl >/tmp/buildall.log &"'; exit; } -======= -writelog "Repository $repo, branch $branch, name $name."; ->>>>>>> 3a17e1a65685db28158fd65fff295e93a1bec31f print header(), start_html("Vishap Oberon github post push web hook."), p("Repository $repo, branch $branch, name $name."), end_html(); -<<<<<<< HEAD -======= - -system 'ssh root@oberon perl vishap/voc/src/tools/testcoordinator/buildall.pl >/tmp/buildall.log &'; - -writelog "Buildall triggered." ->>>>>>> 3a17e1a65685db28158fd65fff295e93a1bec31f From 92365d501cc5309477b03b4b3b62eabfb302125e Mon Sep 17 00:00:00 2001 From: David C W Brown Date: Mon, 27 Jun 2016 21:01:56 +0100 Subject: [PATCH 107/580] Add passing build extraction script. --- src/tools/testcoordinator/buildall.pl | 0 src/tools/testcoordinator/passes.pl | 17 +++++++++++++++++ src/tools/testcoordinator/postpush.pl | 0 3 files changed, 17 insertions(+) mode change 100644 => 100755 src/tools/testcoordinator/buildall.pl create mode 100755 src/tools/testcoordinator/passes.pl mode change 100644 => 100755 src/tools/testcoordinator/postpush.pl diff --git a/src/tools/testcoordinator/buildall.pl b/src/tools/testcoordinator/buildall.pl old mode 100644 new mode 100755 diff --git a/src/tools/testcoordinator/passes.pl b/src/tools/testcoordinator/passes.pl new file mode 100755 index 00000000..c7ca9bde --- /dev/null +++ b/src/tools/testcoordinator/passes.pl @@ -0,0 +1,17 @@ +#!perl -w +use strict; +use warnings; +use POSIX "strftime"; + +# Now parse the combined logs extracting build pass messages +# lub32 20.47.55 --- Branch v2docs ubuntu gcc ILP32 confidence tests passed --- + +open(my $buildlog, "log/buildpasses.log") // die "Could not create buildpasses.log."; +while (<$buildlog>) { + if (/ --- Branch .* confidence tests passed ---/) { + print $passes $_; + } +} +close($buildlog); +close($passes); diff --git a/src/tools/testcoordinator/postpush.pl b/src/tools/testcoordinator/postpush.pl old mode 100644 new mode 100755 From f9ced032af7d24a5ee78ad1ec055f5e00cb4633f Mon Sep 17 00:00:00 2001 From: David Brown Date: Wed, 29 Jun 2016 12:48:35 +0100 Subject: [PATCH 108/580] Can github access my SVG? --- ReadMe.md | 34 +++++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/ReadMe.md b/ReadMe.md index 46738ec7..07fbbf6c 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -1,11 +1,5 @@ ### ð“¥ishap Ñ´ishap á‰ishap Oberon -Oberon is a programming language, an operating system and a graphical -user interface. Originally designed and implemented by by Niklaus Wirth and -Jürg Gutknecht at ETH Zürich in the late 1980s, it demonstrates that the -fundamentals of a modern OS and GUI can be implemented in clean and simple code -orders of magnitude smaller than found in contemporary systems. - [ð“¥ishap â±±ishap á‰ishap Oberon](http://oberon.vishap.am) is a free and open source (GPLv3) implementation of the Oberon-2 language compiler and libraries for use on current operating systems such as Linux, BSD, Android, Mac and Windows. @@ -15,24 +9,42 @@ Oberon programs under Unix or Windows. Vishap Oberon includes libraries from the Ulm, oo2c and Ofront Oberon compilers, as well as default libraries complying with the Oakwood Guidelines for Oberon-2 compilers. -The Oberon language is an evolution of the Pascal and Modula languages, following the -principals of Einstein and Antoine de Saint-Exupéry: +##### Oberon - System and Programming Language -> Make it as simple as possible, but not simpler. (A. Einstein) +Oberon is a programming language, an operating system and a graphical +user interface. Originally designed and implemented by by Niklaus Wirth and +Jürg Gutknecht at ETH Zürich in the late 1980s, it demonstrates that the +fundamentals of a modern OS and GUI can be implemented in clean and simple code +orders of magnitude smaller than found in contemporary systems. + +The Oberon programming language is an evolution of the Pascal and Modula +languages, following the principals of Einstein and Antoine de Saint-Exupéry: + +> Make it as simple as possible, but not simpler. (Albert Einstein) > Perfection is finally attained not when there is no longer anything to add, but > when there is no longer anything to take away. (Antoine de Saint-Exupéry, -> Terre des Hommes, 1939, translated by Lewis Galantière.) +> translated by Lewis Galantière.) + +##### Build status + +![Build status](https://www.brownsmeet.com/githubhook/passes.svg) #### Installation +##### Prerequisites + +##### Build and install + 1. `git clone https://github.com/vishaps/voc` 2. `cd voc` 3. `[sudo] make full` Since 'make full' will install the compiler and libraries, it needs root (unix) or administrator (windows) privileges. -Then set your path to the installed compiler binary location as reported +##### PATH environment variable + +Set your path to the installed compiler binary location as reported by make full, e.g. | System | Set path | From fe0803e6be34ed53d91b8980d3b64a61f2df151a Mon Sep 17 00:00:00 2001 From: David Brown Date: Wed, 29 Jun 2016 16:16:38 +0000 Subject: [PATCH 109/580] Try another way to get passing status image into readme. --- ReadMe.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ReadMe.md b/ReadMe.md index 07fbbf6c..4e1040c3 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -1,6 +1,6 @@ -### ð“¥ishap Ñ´ishap á‰ishap Oberon +### Ñ´ishap Oberon -[ð“¥ishap â±±ishap á‰ishap Oberon](http://oberon.vishap.am) is a free and open source (GPLv3) +[Ñ´ishap Oberon](http://oberon.vishap.am) is a free and open source (GPLv3) implementation of the Oberon-2 language compiler and libraries for use on current operating systems such as Linux, BSD, Android, Mac and Windows. @@ -28,7 +28,7 @@ languages, following the principals of Einstein and Antoine de Saint-Exupéry: ##### Build status -![Build status](https://www.brownsmeet.com/githubhook/passes.svg) +![Build status](https://www.brownsmeet.com/githubhook/passes.png?raw=true) #### Installation @@ -161,6 +161,8 @@ C W Brown. #### Origin of the name Vishap +ð“¥ishap á‰ishap â±±ishap + #### To be left out? Work on other compatibility layers is in progress. From 15ee11b2aad82c53a3017f116938b5dc9166d186 Mon Sep 17 00:00:00 2001 From: David Brown Date: Wed, 29 Jun 2016 17:31:15 +0100 Subject: [PATCH 110/580] Aother attempt to get the readme to display the passing status image from brownsmeet.com. --- ReadMe.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReadMe.md b/ReadMe.md index 4e1040c3..e96d6867 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -28,7 +28,7 @@ languages, following the principals of Einstein and Antoine de Saint-Exupéry: ##### Build status -![Build status](https://www.brownsmeet.com/githubhook/passes.png?raw=true) +![Build status](http://brownsmeet.com/passes.png?raw=true) #### Installation From 5c93ec0bcd03e321bf26d6b71da03c28de14f7f8 Mon Sep 17 00:00:00 2001 From: David Brown Date: Wed, 29 Jun 2016 22:44:25 +0100 Subject: [PATCH 111/580] Try without the raw=true. --- ReadMe.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReadMe.md b/ReadMe.md index e96d6867..117339d8 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -28,7 +28,7 @@ languages, following the principals of Einstein and Antoine de Saint-Exupéry: ##### Build status -![Build status](http://brownsmeet.com/passes.png?raw=true) +![Build status](http://brownsmeet.com/passes.png) #### Installation From 5aabb5a95578133bf260e45c8d8d2b8d3dae4d4a Mon Sep 17 00:00:00 2001 From: David Brown Date: Wed, 29 Jun 2016 23:53:15 +0100 Subject: [PATCH 112/580] Another checkin to see if no-cache fixes it. --- ReadMe.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReadMe.md b/ReadMe.md index 117339d8..a5a27562 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -2,7 +2,7 @@ [Ñ´ishap Oberon](http://oberon.vishap.am) is a free and open source (GPLv3) implementation of the Oberon-2 language compiler and libraries for use on -current operating systems such as Linux, BSD, Android, Mac and Windows. +conventional operating systems such as Linux, BSD, Android, Mac and Windows. Vishap's Oberon Compiler (voc) uses a C backend to compile Oberon programs under Unix or Windows. Vishap Oberon includes From 3ac00d55359cf269023a1c7e3b5b80a1673e3122 Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 30 Jun 2016 11:39:10 +0100 Subject: [PATCH 113/580] Avoid htaccess. Try svg directly again. --- ReadMe.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ReadMe.md b/ReadMe.md index a5a27562..432f97e7 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -26,9 +26,13 @@ languages, following the principals of Einstein and Antoine de Saint-Exupéry: > when there is no longer anything to take away. (Antoine de Saint-Exupéry, > translated by Lewis Galantière.) -##### Build status +##### Build status (png) -![Build status](http://brownsmeet.com/passes.png) +![Build status (png)](http://brownsmeet.com/build-staus.png) + +##### Build status (svg) + +![Build status (svg)](http://brownsmeet.com/build-staus.svg) #### Installation From 54757d336cc79e1a3f4c82f238b7f6612740c3b0 Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 30 Jun 2016 11:41:12 +0100 Subject: [PATCH 114/580] Phew, just a typo. build-staus. --- ReadMe.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ReadMe.md b/ReadMe.md index 432f97e7..308c9c56 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -28,11 +28,11 @@ languages, following the principals of Einstein and Antoine de Saint-Exupéry: ##### Build status (png) -![Build status (png)](http://brownsmeet.com/build-staus.png) +![Build status (png)](http://brownsmeet.com/build-status.png) ##### Build status (svg) -![Build status (svg)](http://brownsmeet.com/build-staus.svg) +![Build status (svg)](http://brownsmeet.com/build-status.svg) #### Installation From d24d436808ae22d8a760b55cd2046f8b57f7ef47 Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 30 Jun 2016 12:07:54 +0100 Subject: [PATCH 115/580] Wow, svg is working fine. --- ReadMe.md | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/ReadMe.md b/ReadMe.md index 308c9c56..c6e75b4f 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -26,13 +26,9 @@ languages, following the principals of Einstein and Antoine de Saint-Exupéry: > when there is no longer anything to take away. (Antoine de Saint-Exupéry, > translated by Lewis Galantière.) -##### Build status (png) +##### Build status -![Build status (png)](http://brownsmeet.com/build-status.png) - -##### Build status (svg) - -![Build status (svg)](http://brownsmeet.com/build-status.svg) +![Build status](http://brownsmeet.com/build-status.svg) #### Installation From d97668a20912d43d7314c86d01c665cdbfdc2e3d Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 30 Jun 2016 18:36:17 +0100 Subject: [PATCH 116/580] Initial checksum support in build. --- bootstrap/unix-44/Configuration.c | 2 +- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Console.c | 2 +- bootstrap/unix-44/Console.h | 2 +- bootstrap/unix-44/Files.c | 2 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 2 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 4 ++-- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 4 ++-- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 2 +- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 2 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/Vishap.c | 2 +- bootstrap/unix-44/errors.c | 2 +- bootstrap/unix-44/errors.h | 2 +- bootstrap/unix-44/extTools.c | 2 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-44/vt100.c | 2 +- bootstrap/unix-44/vt100.h | 2 +- bootstrap/unix-48/Configuration.c | 2 +- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Console.c | 2 +- bootstrap/unix-48/Console.h | 2 +- bootstrap/unix-48/Files.c | 2 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 2 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 4 ++-- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 4 ++-- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 2 +- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 2 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/Vishap.c | 2 +- bootstrap/unix-48/errors.c | 2 +- bootstrap/unix-48/errors.h | 2 +- bootstrap/unix-48/extTools.c | 2 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-48/vt100.c | 2 +- bootstrap/unix-48/vt100.h | 2 +- bootstrap/unix-88/Configuration.c | 2 +- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Console.c | 2 +- bootstrap/unix-88/Console.h | 2 +- bootstrap/unix-88/Files.c | 2 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 2 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 4 ++-- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 4 ++-- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 2 +- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 2 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/Vishap.c | 2 +- bootstrap/unix-88/errors.c | 2 +- bootstrap/unix-88/errors.h | 2 +- bootstrap/unix-88/extTools.c | 2 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/unix-88/vt100.c | 2 +- bootstrap/unix-88/vt100.h | 2 +- bootstrap/windows-48/Configuration.c | 2 +- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Console.c | 2 +- bootstrap/windows-48/Console.h | 2 +- bootstrap/windows-48/Files.c | 2 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 2 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 4 ++-- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 4 ++-- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 2 +- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 2 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/Vishap.c | 2 +- bootstrap/windows-48/errors.c | 2 +- bootstrap/windows-48/errors.h | 2 +- bootstrap/windows-48/extTools.c | 2 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-48/vt100.c | 2 +- bootstrap/windows-48/vt100.h | 2 +- bootstrap/windows-88/Configuration.c | 2 +- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Console.c | 2 +- bootstrap/windows-88/Console.h | 2 +- bootstrap/windows-88/Files.c | 2 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 2 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 4 ++-- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 4 ++-- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 2 +- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 2 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Platform.c | 2 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/Vishap.c | 2 +- bootstrap/windows-88/errors.c | 2 +- bootstrap/windows-88/errors.h | 2 +- bootstrap/windows-88/extTools.c | 2 +- bootstrap/windows-88/extTools.h | 2 +- bootstrap/windows-88/vt100.c | 2 +- bootstrap/windows-88/vt100.h | 2 +- makefile | 14 ++++++++++++++ src/tools/make/vishap.make | 6 ++++++ src/tools/testcoordinator/buildall.pl | 15 ++++++++------- 198 files changed, 233 insertions(+), 212 deletions(-) diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index a1992033..aef0c6c0 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index e7aed50a..4c931710 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Console.c b/bootstrap/unix-44/Console.c index 7f8fd8c0..1d3fe81f 100644 --- a/bootstrap/unix-44/Console.c +++ b/bootstrap/unix-44/Console.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Platform.h" diff --git a/bootstrap/unix-44/Console.h b/bootstrap/unix-44/Console.h index 316e7e46..8e12fc26 100644 --- a/bootstrap/unix-44/Console.h +++ b/bootstrap/unix-44/Console.h @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index f3b9b280..14bf860b 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index 002d2dc5..2461434a 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index cbb21626..4158550b 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin tskSfF */ #include "SYSTEM.h" struct Heap__1 { diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index d270a455..33b7f49f 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index 6c0f5e0b..c2c2920a 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Heap.h" diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index 5968d1aa..d3b57a01 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index 0c22a7a7..7a1ae82b 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index 8cd47ee6..8e98db79 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 32a1496f..1d2d84d1 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "OPM.h" @@ -1241,7 +1241,7 @@ static void OPC_GenHeaderMsg (void) OPM_WriteString((CHAR*)"/*", (LONGINT)3); OPM_WriteString((CHAR*)" voc ", (LONGINT)6); OPM_Write(' '); - OPM_WriteString((CHAR*)"1.2 [2016/06/15] for gcc LP64 on cygwin", (LONGINT)40); + OPM_WriteString((CHAR*)"1.95 [2016/06/30] for gcc LP64 on cygwin", (LONGINT)41); OPM_Write(' '); i = 0; while (i <= 31) { diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index 713ea3b2..467de9eb 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 3d68d2be..3ad30ae3 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" @@ -198,7 +198,7 @@ BOOLEAN OPM_OpenPar (void) if (Platform_ArgCount == 1) { OPM_LogWLn(); OPM_LogWStr((CHAR*)"Vishap Oberon-2 compiler v", (LONGINT)27); - OPM_LogWStr((CHAR*)"1.2 [2016/06/15] for gcc LP64 on cygwin", (LONGINT)40); + OPM_LogWStr((CHAR*)"1.95 [2016/06/30] for gcc LP64 on cygwin", (LONGINT)41); OPM_LogW('.'); OPM_LogWLn(); OPM_LogWStr((CHAR*)"Based on Ofront by Software Templ OEG, continued by Norayr Chilingarian and others.", (LONGINT)84); diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index 68bf3af0..8f0040f4 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index f0530bb4..845635b3 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPB.h" #include "OPM.h" diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index 1e0a1809..ddacbb19 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index 88944148..071a1dc0 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index 87a614f4..afca4213 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index fc80ce02..16157fca 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index 1a22d0df..826b5123 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index 572285dc..2223918b 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPC.h" #include "OPM.h" diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index 9907a1ef..ecacbf6f 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 013e6f9c..864918a3 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index 8b47d1c9..1d2eb565 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 65dad750..3f43d082 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index 166e977b..d6dbab1c 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index 5038ca68..02a8124d 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index a8d8d207..809d6efe 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index 1e81c3df..569e31bb 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Files.h" #include "Modules.h" diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index 354c7ce7..eee6ba91 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/Vishap.c b/bootstrap/unix-44/Vishap.c index 2b9c3901..96510cf9 100644 --- a/bootstrap/unix-44/Vishap.c +++ b/bootstrap/unix-44/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkamSf */ #include "SYSTEM.h" #include "Configuration.h" #include "Heap.h" diff --git a/bootstrap/unix-44/errors.c b/bootstrap/unix-44/errors.c index 25a074a9..987f1c5e 100644 --- a/bootstrap/unix-44/errors.c +++ b/bootstrap/unix-44/errors.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/unix-44/errors.h b/bootstrap/unix-44/errors.h index c4fe8850..cf182e80 100644 --- a/bootstrap/unix-44/errors.h +++ b/bootstrap/unix-44/errors.h @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index 6f1a6654..a362ee65 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index 95d07ddd..e064ef01 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-44/vt100.c b/bootstrap/unix-44/vt100.c index 649ea068..93a59097 100644 --- a/bootstrap/unix-44/vt100.c +++ b/bootstrap/unix-44/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Strings.h" diff --git a/bootstrap/unix-44/vt100.h b/bootstrap/unix-44/vt100.h index 6d210ec9..db19e2a6 100644 --- a/bootstrap/unix-44/vt100.h +++ b/bootstrap/unix-44/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index a1992033..aef0c6c0 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index e7aed50a..4c931710 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Console.c b/bootstrap/unix-48/Console.c index 7f8fd8c0..1d3fe81f 100644 --- a/bootstrap/unix-48/Console.c +++ b/bootstrap/unix-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Platform.h" diff --git a/bootstrap/unix-48/Console.h b/bootstrap/unix-48/Console.h index 316e7e46..8e12fc26 100644 --- a/bootstrap/unix-48/Console.h +++ b/bootstrap/unix-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index f3b9b280..14bf860b 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index 002d2dc5..2461434a 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index cbb21626..4158550b 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin tskSfF */ #include "SYSTEM.h" struct Heap__1 { diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index d270a455..33b7f49f 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index 6c0f5e0b..c2c2920a 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Heap.h" diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index 5968d1aa..d3b57a01 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index 0c22a7a7..7a1ae82b 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index 8cd47ee6..8e98db79 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 32a1496f..1d2d84d1 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "OPM.h" @@ -1241,7 +1241,7 @@ static void OPC_GenHeaderMsg (void) OPM_WriteString((CHAR*)"/*", (LONGINT)3); OPM_WriteString((CHAR*)" voc ", (LONGINT)6); OPM_Write(' '); - OPM_WriteString((CHAR*)"1.2 [2016/06/15] for gcc LP64 on cygwin", (LONGINT)40); + OPM_WriteString((CHAR*)"1.95 [2016/06/30] for gcc LP64 on cygwin", (LONGINT)41); OPM_Write(' '); i = 0; while (i <= 31) { diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index 713ea3b2..467de9eb 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 3d68d2be..3ad30ae3 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" @@ -198,7 +198,7 @@ BOOLEAN OPM_OpenPar (void) if (Platform_ArgCount == 1) { OPM_LogWLn(); OPM_LogWStr((CHAR*)"Vishap Oberon-2 compiler v", (LONGINT)27); - OPM_LogWStr((CHAR*)"1.2 [2016/06/15] for gcc LP64 on cygwin", (LONGINT)40); + OPM_LogWStr((CHAR*)"1.95 [2016/06/30] for gcc LP64 on cygwin", (LONGINT)41); OPM_LogW('.'); OPM_LogWLn(); OPM_LogWStr((CHAR*)"Based on Ofront by Software Templ OEG, continued by Norayr Chilingarian and others.", (LONGINT)84); diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index 68bf3af0..8f0040f4 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index f0530bb4..845635b3 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPB.h" #include "OPM.h" diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index 1e0a1809..ddacbb19 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index 88944148..071a1dc0 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index 87a614f4..afca4213 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index fc80ce02..16157fca 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index 1a22d0df..826b5123 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index 572285dc..2223918b 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPC.h" #include "OPM.h" diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index 9907a1ef..ecacbf6f 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 013e6f9c..864918a3 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index 8b47d1c9..1d2eb565 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 65dad750..3f43d082 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index 166e977b..d6dbab1c 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index 5038ca68..02a8124d 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index a8d8d207..809d6efe 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index 8c2cc3b2..5888e0b3 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Files.h" #include "Modules.h" diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index 7b66d3ce..a6e717f6 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/Vishap.c b/bootstrap/unix-48/Vishap.c index 2b9c3901..96510cf9 100644 --- a/bootstrap/unix-48/Vishap.c +++ b/bootstrap/unix-48/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkamSf */ #include "SYSTEM.h" #include "Configuration.h" #include "Heap.h" diff --git a/bootstrap/unix-48/errors.c b/bootstrap/unix-48/errors.c index 25a074a9..987f1c5e 100644 --- a/bootstrap/unix-48/errors.c +++ b/bootstrap/unix-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/unix-48/errors.h b/bootstrap/unix-48/errors.h index c4fe8850..cf182e80 100644 --- a/bootstrap/unix-48/errors.h +++ b/bootstrap/unix-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index 6f1a6654..a362ee65 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index 95d07ddd..e064ef01 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/vt100.c b/bootstrap/unix-48/vt100.c index 649ea068..93a59097 100644 --- a/bootstrap/unix-48/vt100.c +++ b/bootstrap/unix-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Strings.h" diff --git a/bootstrap/unix-48/vt100.h b/bootstrap/unix-48/vt100.h index 6d210ec9..db19e2a6 100644 --- a/bootstrap/unix-48/vt100.h +++ b/bootstrap/unix-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index c4d62d40..bbdc22b6 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index b076eaee..70939b4f 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Console.c b/bootstrap/unix-88/Console.c index 5946cb5d..8a185970 100644 --- a/bootstrap/unix-88/Console.c +++ b/bootstrap/unix-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Platform.h" diff --git a/bootstrap/unix-88/Console.h b/bootstrap/unix-88/Console.h index d8a9b11e..fb5f7f79 100644 --- a/bootstrap/unix-88/Console.h +++ b/bootstrap/unix-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index b48620b0..aac48dc7 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin tspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 01c37212..4690dbf8 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index 929a8283..28826f74 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin tskSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index 1b23ddb3..5b65ee7d 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 77278391..b59eaa3b 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index 88bb46e1..77f3c9a7 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index 428d0881..25c048b7 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index c8165f54..50e1e1f3 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index 10468b9e..9e4a4560 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -1242,7 +1242,7 @@ static void OPC_GenHeaderMsg (void) OPM_WriteString((CHAR*)"/*", (LONGINT)3); OPM_WriteString((CHAR*)" voc ", (LONGINT)6); OPM_Write(' '); - OPM_WriteString((CHAR*)"1.2 [2016/06/15] for gcc LP64 on cygwin", (LONGINT)40); + OPM_WriteString((CHAR*)"1.95 [2016/06/30] for gcc LP64 on cygwin", (LONGINT)41); OPM_Write(' '); i = 0; while (i <= 63) { diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index a91a3810..14f92cf9 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 798fb492..05ccbb11 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -199,7 +199,7 @@ BOOLEAN OPM_OpenPar (void) if (Platform_ArgCount == 1) { OPM_LogWLn(); OPM_LogWStr((CHAR*)"Vishap Oberon-2 compiler v", (LONGINT)27); - OPM_LogWStr((CHAR*)"1.2 [2016/06/15] for gcc LP64 on cygwin", (LONGINT)40); + OPM_LogWStr((CHAR*)"1.95 [2016/06/30] for gcc LP64 on cygwin", (LONGINT)41); OPM_LogW('.'); OPM_LogWLn(); OPM_LogWStr((CHAR*)"Based on Ofront by Software Templ OEG, continued by Norayr Chilingarian and others.", (LONGINT)84); diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index e09dbf82..72cb3858 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index 3bc74ce6..5c5c5010 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPB.h" diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index 30cf0643..6c46f388 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index bb08e1f5..6fbbdde1 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin tspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index eab85912..62358186 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index 5f8854a1..9a1045af 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 4c3442b5..99ba8c8a 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 627e325b..2a83cc64 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPC.h" diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index 7f0a5b8a..23d69e2d 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 9a892174..52f8d7bf 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index 7dca4035..88defee9 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index edf27d40..152db07b 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index 5febc0f1..bdc8e2a5 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index 98eef9eb..c8d54be5 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index 05e86973..256941f4 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index 307bec01..077da855 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Files.h" diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index d1805878..2d4eb745 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/Vishap.c b/bootstrap/unix-88/Vishap.c index d084e34a..ac122892 100644 --- a/bootstrap/unix-88/Vishap.c +++ b/bootstrap/unix-88/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkamSf */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/unix-88/errors.c b/bootstrap/unix-88/errors.c index 879f5cf7..6a733b09 100644 --- a/bootstrap/unix-88/errors.c +++ b/bootstrap/unix-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/unix-88/errors.h b/bootstrap/unix-88/errors.h index 43cd79a9..72bdc98e 100644 --- a/bootstrap/unix-88/errors.h +++ b/bootstrap/unix-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index 7d1a2da9..2fd5ccd0 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index 61ca56e4..81db5d3b 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/vt100.c b/bootstrap/unix-88/vt100.c index 88c386a8..c584b083 100644 --- a/bootstrap/unix-88/vt100.c +++ b/bootstrap/unix-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/unix-88/vt100.h b/bootstrap/unix-88/vt100.h index b124915f..d981ba62 100644 --- a/bootstrap/unix-88/vt100.h +++ b/bootstrap/unix-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index a1992033..aef0c6c0 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index e7aed50a..4c931710 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Console.c b/bootstrap/windows-48/Console.c index 2f8e5f21..ba50baa8 100644 --- a/bootstrap/windows-48/Console.c +++ b/bootstrap/windows-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Platform.h" diff --git a/bootstrap/windows-48/Console.h b/bootstrap/windows-48/Console.h index 316e7e46..8e12fc26 100644 --- a/bootstrap/windows-48/Console.h +++ b/bootstrap/windows-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 25fa879e..0e1ffba8 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index 226e2815..b6b7879e 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index cbb21626..4158550b 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin tskSfF */ #include "SYSTEM.h" struct Heap__1 { diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index d270a455..33b7f49f 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index 6c0f5e0b..c2c2920a 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Heap.h" diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index 5968d1aa..d3b57a01 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index 0c22a7a7..7a1ae82b 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index 8cd47ee6..8e98db79 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 32a1496f..1d2d84d1 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "OPM.h" @@ -1241,7 +1241,7 @@ static void OPC_GenHeaderMsg (void) OPM_WriteString((CHAR*)"/*", (LONGINT)3); OPM_WriteString((CHAR*)" voc ", (LONGINT)6); OPM_Write(' '); - OPM_WriteString((CHAR*)"1.2 [2016/06/15] for gcc LP64 on cygwin", (LONGINT)40); + OPM_WriteString((CHAR*)"1.95 [2016/06/30] for gcc LP64 on cygwin", (LONGINT)41); OPM_Write(' '); i = 0; while (i <= 31) { diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index 713ea3b2..467de9eb 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 3d68d2be..3ad30ae3 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" @@ -198,7 +198,7 @@ BOOLEAN OPM_OpenPar (void) if (Platform_ArgCount == 1) { OPM_LogWLn(); OPM_LogWStr((CHAR*)"Vishap Oberon-2 compiler v", (LONGINT)27); - OPM_LogWStr((CHAR*)"1.2 [2016/06/15] for gcc LP64 on cygwin", (LONGINT)40); + OPM_LogWStr((CHAR*)"1.95 [2016/06/30] for gcc LP64 on cygwin", (LONGINT)41); OPM_LogW('.'); OPM_LogWLn(); OPM_LogWStr((CHAR*)"Based on Ofront by Software Templ OEG, continued by Norayr Chilingarian and others.", (LONGINT)84); diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index 68bf3af0..8f0040f4 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index f0530bb4..845635b3 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPB.h" #include "OPM.h" diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index 1e0a1809..ddacbb19 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index 88944148..071a1dc0 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index 87a614f4..afca4213 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index fc80ce02..16157fca 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index 1a22d0df..826b5123 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index 572285dc..2223918b 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPC.h" #include "OPM.h" diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index 9907a1ef..ecacbf6f 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index d097f9db..b5310405 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index e912678e..11bd3410 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 65dad750..3f43d082 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index 166e977b..d6dbab1c 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index 5038ca68..02a8124d 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index a8d8d207..809d6efe 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index 8c2cc3b2..5888e0b3 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Files.h" #include "Modules.h" diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index 7b66d3ce..a6e717f6 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/Vishap.c b/bootstrap/windows-48/Vishap.c index 2b9c3901..96510cf9 100644 --- a/bootstrap/windows-48/Vishap.c +++ b/bootstrap/windows-48/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkamSf */ #include "SYSTEM.h" #include "Configuration.h" #include "Heap.h" diff --git a/bootstrap/windows-48/errors.c b/bootstrap/windows-48/errors.c index 25a074a9..987f1c5e 100644 --- a/bootstrap/windows-48/errors.c +++ b/bootstrap/windows-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/windows-48/errors.h b/bootstrap/windows-48/errors.h index c4fe8850..cf182e80 100644 --- a/bootstrap/windows-48/errors.h +++ b/bootstrap/windows-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index 6f1a6654..a362ee65 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index 95d07ddd..e064ef01 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/vt100.c b/bootstrap/windows-48/vt100.c index 649ea068..93a59097 100644 --- a/bootstrap/windows-48/vt100.c +++ b/bootstrap/windows-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Strings.h" diff --git a/bootstrap/windows-48/vt100.h b/bootstrap/windows-48/vt100.h index 6d210ec9..db19e2a6 100644 --- a/bootstrap/windows-48/vt100.h +++ b/bootstrap/windows-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index c4d62d40..bbdc22b6 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index b076eaee..70939b4f 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Console.c b/bootstrap/windows-88/Console.c index e4c5285c..3c4d2c36 100644 --- a/bootstrap/windows-88/Console.c +++ b/bootstrap/windows-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Platform.h" diff --git a/bootstrap/windows-88/Console.h b/bootstrap/windows-88/Console.h index d8a9b11e..fb5f7f79 100644 --- a/bootstrap/windows-88/Console.h +++ b/bootstrap/windows-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index f5f4a2aa..38a8e591 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin tspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 565ac5ff..dc789b69 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index 929a8283..28826f74 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin tskSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index 1b23ddb3..5b65ee7d 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 77278391..b59eaa3b 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index 88bb46e1..77f3c9a7 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index 428d0881..25c048b7 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index c8165f54..50e1e1f3 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index 10468b9e..9e4a4560 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -1242,7 +1242,7 @@ static void OPC_GenHeaderMsg (void) OPM_WriteString((CHAR*)"/*", (LONGINT)3); OPM_WriteString((CHAR*)" voc ", (LONGINT)6); OPM_Write(' '); - OPM_WriteString((CHAR*)"1.2 [2016/06/15] for gcc LP64 on cygwin", (LONGINT)40); + OPM_WriteString((CHAR*)"1.95 [2016/06/30] for gcc LP64 on cygwin", (LONGINT)41); OPM_Write(' '); i = 0; while (i <= 63) { diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index a91a3810..14f92cf9 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 798fb492..05ccbb11 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -199,7 +199,7 @@ BOOLEAN OPM_OpenPar (void) if (Platform_ArgCount == 1) { OPM_LogWLn(); OPM_LogWStr((CHAR*)"Vishap Oberon-2 compiler v", (LONGINT)27); - OPM_LogWStr((CHAR*)"1.2 [2016/06/15] for gcc LP64 on cygwin", (LONGINT)40); + OPM_LogWStr((CHAR*)"1.95 [2016/06/30] for gcc LP64 on cygwin", (LONGINT)41); OPM_LogW('.'); OPM_LogWLn(); OPM_LogWStr((CHAR*)"Based on Ofront by Software Templ OEG, continued by Norayr Chilingarian and others.", (LONGINT)84); diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index e09dbf82..72cb3858 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index 3bc74ce6..5c5c5010 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPB.h" diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index 30cf0643..6c46f388 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index bb08e1f5..6fbbdde1 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin tspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index eab85912..62358186 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index 5f8854a1..9a1045af 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 4c3442b5..99ba8c8a 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 627e325b..2a83cc64 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPC.h" diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index 7f0a5b8a..23d69e2d 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 78274e99..1079f225 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index c3b2dd2d..90e32ce3 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index edf27d40..152db07b 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index 5febc0f1..bdc8e2a5 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index 98eef9eb..c8d54be5 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index 05e86973..256941f4 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index 307bec01..077da855 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Files.h" diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index d1805878..2d4eb745 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/Vishap.c b/bootstrap/windows-88/Vishap.c index d084e34a..ac122892 100644 --- a/bootstrap/windows-88/Vishap.c +++ b/bootstrap/windows-88/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkamSf */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/windows-88/errors.c b/bootstrap/windows-88/errors.c index 879f5cf7..6a733b09 100644 --- a/bootstrap/windows-88/errors.c +++ b/bootstrap/windows-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/windows-88/errors.h b/bootstrap/windows-88/errors.h index 43cd79a9..72bdc98e 100644 --- a/bootstrap/windows-88/errors.h +++ b/bootstrap/windows-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index 7d1a2da9..2fd5ccd0 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index 61ca56e4..81db5d3b 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/vt100.c b/bootstrap/windows-88/vt100.c index 88c386a8..c584b083 100644 --- a/bootstrap/windows-88/vt100.c +++ b/bootstrap/windows-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/windows-88/vt100.h b/bootstrap/windows-88/vt100.h index b124915f..d981ba62 100644 --- a/bootstrap/windows-88/vt100.h +++ b/bootstrap/windows-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.2 [2016/06/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/makefile b/makefile index 4f2dfc60..777da4a7 100644 --- a/makefile +++ b/makefile @@ -133,10 +133,19 @@ clean: configuration full: configuration @make -f src/tools/make/vishap.make -s installable @make -f src/tools/make/vishap.make -s clean +# Make bootstrap compiler from source suitable for current data model + @make -f src/tools/make/vishap.make -s compilerfromsavedsource +# Use bootstrap compiler to make compiler binary from latest compiler sources @make -f src/tools/make/vishap.make -s translate @make -f src/tools/make/vishap.make -s assemble +# Use latest compiler to make compiler binary from latest compiler sources + @make -f src/tools/make/vishap.make -s translate + @make -f src/tools/make/vishap.make -s assemble + @printf "\n\n--- Compiler build successfull ---\n\n" @make -f src/tools/make/vishap.make -s browsercmd @make -f src/tools/make/vishap.make -s library + @printf "\n\n--- Library build successfull ---\n\n" + @make -f src/tools/make/vishap.make -s checksum @make -f src/tools/make/vishap.make -s install @make -f src/tools/make/vishap.make -s confidence @make -f src/tools/make/vishap.make -s showpath @@ -183,7 +192,12 @@ uninstall: configuration # bootstrap: Rebuild the bootstrap directories +# If the bootstrap directories are broken or only partially +# built then run 'make revertbootstrap' first. bootstrap: configuration + @make -f src/tools/make/vishap.make -s clean + @make -f src/tools/make/vishap.make -s translate + @make -f src/tools/make/vishap.make -s assemble rm -rf bootstrap/* make -f src/tools/make/vishap.make -s translate INTSIZE=2 ADRSIZE=4 ALIGNMENT=4 PLATFORM=unix BUILDDIR=bootstrap/unix-44 && rm bootstrap/unix-44/*.sym make -f src/tools/make/vishap.make -s translate INTSIZE=2 ADRSIZE=4 ALIGNMENT=8 PLATFORM=unix BUILDDIR=bootstrap/unix-48 && rm bootstrap/unix-48/*.sym diff --git a/src/tools/make/vishap.make b/src/tools/make/vishap.make index cd88c04e..54ee3289 100644 --- a/src/tools/make/vishap.make +++ b/src/tools/make/vishap.make @@ -362,6 +362,12 @@ library: v4 ooc2 ooc ulm pow32 misc s3 librarybinary +checksum: + @cd $(BUILDDIR) && sh $(ROOTDIR)/src/tools/make/checksumtest.sh $(ROOTDIR)/$(BUILDDIR).md5 + + + + confidence: @printf "\n\n--- Confidence tests ---\n\n" cd src/test/confidence/hello; ./test.sh "$(INSTALLDIR)" diff --git a/src/tools/testcoordinator/buildall.pl b/src/tools/testcoordinator/buildall.pl index 2aedc2c2..bbc77e8b 100755 --- a/src/tools/testcoordinator/buildall.pl +++ b/src/tools/testcoordinator/buildall.pl @@ -6,12 +6,13 @@ use POSIX "strftime"; my $branch = "v2docs"; my %machines = ( - "pi" => ['pi@pie', "projects/oberon/vishap/voc", "sudo"], - "darwin" => ['dave@dcb', "projects/oberon/vishap/voc", "sudo"], - "lub32" => ['dave@lub32', "vishap/voc", "sudo"], - "ob32" => ['root@nas-ob32', "vishap/voc", "" ], - "fb64" => ['root@oberon', "vishap/voc", "" ], - "ub64" => ['dave@nas-ub64', "vishap/voc", "sudo"] + "pi" => ['pi@pie', "sudo", "projects/oberon/vishap/voc"], + "darwin" => ['dave@dcb', "sudo", "projects/oberon/vishap/voc"], + "lub32" => ['dave@lub32', "sudo", "vishap/voc"], + "ob32" => ['root@nas-ob32', "", "vishap/voc"], + "fb64" => ['root@oberon', "", "vishap/voc"], + "ub64" => ['dave@nas-ub64', "sudo", "vishap/voc"], + "ce64" => ['-p5922 obe@www', "sudo", "vishap/voc"] ); @@ -43,7 +44,7 @@ sub logged { for my $machine (sort keys %machines) { - my ($login, $dir, $sudo) = @{$machines{$machine}}; + my ($login, $sudo, $dir) = @{$machines{$machine}}; my $cmd = "ssh $login \"cd $dir && $sudo git checkout $branch && $sudo git pull && $sudo make full\" "; logged($cmd, $machine); } From 3cd3376139d6689b93ca93b24f22257e7db8a83c Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 30 Jun 2016 19:41:14 +0100 Subject: [PATCH 117/580] Test build progress --- src/tools/testcoordinator/buildall.pl | 34 ++++++++++++- src/tools/testcoordinator/postpush.pl | 9 ++-- src/tools/testcoordinator/pt.pl | 70 +++++++++++++++++++++++++++ 3 files changed, 107 insertions(+), 6 deletions(-) create mode 100755 src/tools/testcoordinator/pt.pl diff --git a/src/tools/testcoordinator/buildall.pl b/src/tools/testcoordinator/buildall.pl index bbc77e8b..49b90800 100755 --- a/src/tools/testcoordinator/buildall.pl +++ b/src/tools/testcoordinator/buildall.pl @@ -50,5 +50,35 @@ for my $machine (sort keys %machines) { } while ((my $pid = wait) > 0) {print "Child pid $pid completed.\n";} -print "Buildall complete.\n"; -exit; + + +# # All builds have completed. Now scan the logs for pass/fail and build the passing report. +# +# my %status = (); +# open(my $logs, "/tmp/buildall.log") // die "Couldn't open combined build log."; +# while (<$logs>) { +# if (/^([^ ]+) ([^ ]+) --- Branch ([^ ]+) ([^ ]+) ([^ ]+) ([^ ]+) confidence tests passed ---/) { +# $status{$1} = [$2, $3, $4, $5, $6]; +# } +# } +# close(my $logs); +# +# +# sub svgtext { +# my ($f, $x, $y, $msg) = @_; +# print($f ""; +# print($f $msg); +# print($f "\n"); +# } +# +# +# open(my $svg, ">passing.svg") // dir "Could not create passing.svg."); +# print $svg '\n'; +# +# my $i=1; +# for my $host (sort keys %status) { +# svgtext($svg, 10, $i*20, $host); +# $i++; +# } +# +# print $svg '\n'; diff --git a/src/tools/testcoordinator/postpush.pl b/src/tools/testcoordinator/postpush.pl index 25bb2a89..4db1e46b 100755 --- a/src/tools/testcoordinator/postpush.pl +++ b/src/tools/testcoordinator/postpush.pl @@ -11,7 +11,7 @@ use JSON; sub writelog { my ($msg) = @_; - + open(LOG, ">>/tmp/postpush.log") or die "Could not create postpush.log"; flock(LOG, 2) or die "Could not lock postpush.log"; print LOG sprintf("%s %s\n", strftime("%Y/%m/%d %H.%M.%S", localtime), $msg); @@ -36,12 +36,13 @@ my $child = fork; if (not defined $child) {die "Fork failed.";} if ($child) { # parent process - writelog "Started ssh, pid = $child."; + writelog "Started buildall, pid = $child."; } else { # child process - exec 'ssh root@oberon "perl vishap/voc/src/tools/testcoordinator/buildall.pl >/tmp/buildall.log &"'; + close(STDIN); close(STDOUT); close(STDERR); + exec 'perl /var/lib/nethserver/ibay/githubhook/buildall.pl >/tmp/buildall.log'; exit; -} +} print header(), start_html("Vishap Oberon github post push web hook."), diff --git a/src/tools/testcoordinator/pt.pl b/src/tools/testcoordinator/pt.pl new file mode 100755 index 00000000..a39618d4 --- /dev/null +++ b/src/tools/testcoordinator/pt.pl @@ -0,0 +1,70 @@ +#!perl -w +use strict; +use warnings; +use POSIX "strftime"; + + + +my %status = (); +open(my $logs, "/tmp/buildall.log") // die "Couldn't open combined build log."; +while (<$logs>) { + if (/^([^ ]+) ([^ ]+) --- Branch ([^ ]+) ([^ ]+) ([^ ]+) ([^ ]+) confidence tests passed ---/) { + my $key = "$4-$6-$5"; + $status{$key} = [$1, $2, $3, $4, $5, $6]; + } +} +close($logs); + +my $emsperline = 1.2; + +sub svgtext { + my ($f, $x, $y, $colour, $msg) = @_; + print $f ''; + print $f $msg; + print $f "\n"; +} + +my $rows = keys %status; + +open(my $svg, ">build-status.svg") // die "Could not create build-status.svg."; +print $svg '', "\n"; +print $svg '', "\n"; + +my $col1 = 20; +my $col2 = 110; +my $col3 = 200; +my $col4 = 310; +my $col5 = 400; +my $col6 = 490; +my $col7 = 580; + +svgtext($svg, $col1, 0, "#e0e0e0", "OS"); +svgtext($svg, $col2, 0, "#e0e0e0", "Compiler"); +svgtext($svg, $col3, 0, "#e0e0e0", "Data model"); +svgtext($svg, $col4, 0, "#e0e0e0", "Compiler"); +svgtext($svg, $col5, 0, "#e0e0e0", "Library"); +svgtext($svg, $col6, 0, "#e0e0e0", "Cksum"); +svgtext($svg, $col7, 0, "#e0e0e0", "Tests"); + +my $i=1; +for my $key (sort keys %status) { + my ($host, $time, $branch, $os, $compiler, $datamodel) = @{$status{$key}}; + svgtext($svg, $col1, $i, "#c0c0c0", $os); + svgtext($svg, $col2, $i, "#c0c0c0", $compiler); + svgtext($svg, $col3, $i, "#c0c0c0", $datamodel); + svgtext($svg, $col4, $i, "#60ff60", "Pass"); + svgtext($svg, $col5, $i, "#60ff60", "Pass"); +# svgtext($svg, $col6, $i, "#60ff60", "Pass"); + svgtext($svg, $col7, $i, "#60ff60", "Pass"); + $i++; +} + +print $svg "\n"; + +system 'scp -p build-status.svg dave@hub:/var/www'; From c45c1112377c5de6d4d29bfe0a6eefa63a116537 Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 30 Jun 2016 20:11:09 +0100 Subject: [PATCH 118/580] Add brnachname to checksum fileneame. --- makefile | 3 ++- src/tools/make/vishap.make | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/makefile b/makefile index 777da4a7..1b18dec3 100644 --- a/makefile +++ b/makefile @@ -98,13 +98,14 @@ usage: -# Generate config files Configuration.Make and Configuartion.Mod +# Generate config files Configuration.Make and Configuration.Mod FORCE: configuration: FORCE @$(CC) -I src/system -o a.o src/tools/make/configure.c @./a.o @rm a.o + @echo BRANCH=$$(git rev-parse --abbrev-ref HEAD)>>Configuration.Make diff --git a/src/tools/make/vishap.make b/src/tools/make/vishap.make index 54ee3289..c9edfa55 100644 --- a/src/tools/make/vishap.make +++ b/src/tools/make/vishap.make @@ -363,7 +363,7 @@ library: v4 ooc2 ooc ulm pow32 misc s3 librarybinary checksum: - @cd $(BUILDDIR) && sh $(ROOTDIR)/src/tools/make/checksumtest.sh $(ROOTDIR)/$(BUILDDIR).md5 + @cd $(BUILDDIR) && sh $(ROOTDIR)/src/tools/make/checksumtest.sh $(ROOTDIR)/$(BUILDDIR).$(BRANCH).md5 From 6470000cff6d233d8ed1167c5306738283040f28 Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 30 Jun 2016 21:02:06 +0100 Subject: [PATCH 119/580] Parse logs for build and test status. --- src/tools/make/checksumtest.sh | 14 ++++++++ src/tools/make/vishap.make | 3 +- src/tools/testcoordinator/pt.pl | 59 ++++++++++++++++++++++++++------- 3 files changed, 63 insertions(+), 13 deletions(-) create mode 100644 src/tools/make/checksumtest.sh diff --git a/src/tools/make/checksumtest.sh b/src/tools/make/checksumtest.sh new file mode 100644 index 00000000..a4d4262f --- /dev/null +++ b/src/tools/make/checksumtest.sh @@ -0,0 +1,14 @@ +# Checksum tests + +md5=$((which md5;which md5sum)2>/dev/null) +if [ -f $1 ] +then + $md5 *.o >newsums + if diff -b $1 newsums + then printf "\n--- Object file checksums match ---\n"; rm newsums +else printf "\n--- Object file checksum mismatch ---\n"; rm newsums; exit 1 + fi +else + $md5 *.o >$1 + printf "\n--- Object files checksummed ---\n" +fi diff --git a/src/tools/make/vishap.make b/src/tools/make/vishap.make index c9edfa55..ca4daefa 100644 --- a/src/tools/make/vishap.make +++ b/src/tools/make/vishap.make @@ -28,6 +28,7 @@ usage: clean: + @printf "\n\n--- Cleaning branch $$(BRANCH) $(OS) $(COMPILER) $(DATAMODEL) ---\n\n" rm -rf $(BUILDDIR) rm -f $(VISHAP) @@ -374,7 +375,7 @@ confidence: if [ "$(PLATFORM)" != "windows" ] ; then cd src/test/confidence/signal; ./test.sh "$(INSTALLDIR)"; fi cd src/test/confidence/lola; ./test.sh "$(INSTALLDIR)" cd src/test/confidence/arrayassignment; ./test.sh "$(INSTALLDIR)" - @printf "\n\n--- Branch $$(git rev-parse --abbrev-ref HEAD) $(OS) $(COMPILER) $(DATAMODEL) confidence tests passed ---\n\n" + @printf "\n\n--- Confidence tests passed ---\n\n" diff --git a/src/tools/testcoordinator/pt.pl b/src/tools/testcoordinator/pt.pl index a39618d4..0d5058f8 100755 --- a/src/tools/testcoordinator/pt.pl +++ b/src/tools/testcoordinator/pt.pl @@ -5,15 +5,49 @@ use POSIX "strftime"; + my %status = (); -open(my $logs, "/tmp/buildall.log") // die "Couldn't open combined build log."; -while (<$logs>) { - if (/^([^ ]+) ([^ ]+) --- Branch ([^ ]+) ([^ ]+) ([^ ]+) ([^ ]+) confidence tests passed ---/) { - my $key = "$4-$6-$5"; - $status{$key} = [$1, $2, $3, $4, $5, $6]; + + +sub parselog { + my ($fn) = @_; + my $date = ""; + my $time = ""; + my $branch = ""; + my $os = ""; + my $compiler = ""; + my $datamodel = ""; + my $compilerok = ""; + my $libraryok = ""; + my $checksum = ""; + my $tests = ""; + open(my $log, $fn) // die "Couldn't open build log $fn."; + while (<$log>) { + if (/^([0-9/]+) [0-9.]+ [^ ]+\.log$/) {$date = $1;} + if (/^[^ ]+ --- Cleaning branch ([^ ]+) ([^ ]+) ([^ ]+) ([^ ]+) ---$/) { + ($branch, $os, $compiler, $datamodel) = ($1, $2, $3, $4, $5); + } + if (/^--- Compiler build successfull ---$/) {$compilerok = "Built";} + if (/^--- Library build successfull ---$/) {$libraryok = "Built";} + if (/^--- Confidence tests passed ---$/) {$tests = "Passed";} + if (/^--- Object file checksums match ---$/) {$checksum = "Match";} + if (/^--- Object file checksum mismatch ---$/) {$checksum = "Changed";} + if (/^--- Object files checksummed ---$/) {$checksum = "New";} + } + close($log); + my $key = "$os-$compiler-$datamodel"; + if ($key ne "") { + status{$key} = [$date, $time, $os, %compiler, $datamodel, $branch, $compilerok, $libraryok, $checksum, $tests]; } } -close($logs); + +opendir DIR, "log" // die "Could not openlog directory."; +my @logs = readdir DIR; +closedir DIR; + +for my $logname (sort @logs) { + if (-f $logname) {parselog($logname);} +} my $emsperline = 1.2; @@ -49,19 +83,20 @@ svgtext($svg, $col2, 0, "#e0e0e0", "Compiler"); svgtext($svg, $col3, 0, "#e0e0e0", "Data model"); svgtext($svg, $col4, 0, "#e0e0e0", "Compiler"); svgtext($svg, $col5, 0, "#e0e0e0", "Library"); -svgtext($svg, $col6, 0, "#e0e0e0", "Cksum"); +svgtext($svg, $col6, 0, "#e0e0e0", "Checksum"); svgtext($svg, $col7, 0, "#e0e0e0", "Tests"); my $i=1; for my $key (sort keys %status) { - my ($host, $time, $branch, $os, $compiler, $datamodel) = @{$status{$key}}; + my ($date, $time, $os, %compiler, $datamodel, + $branch, $compilerok, $libraryok, $checksum, $tests) = @{$status{$key}}; svgtext($svg, $col1, $i, "#c0c0c0", $os); svgtext($svg, $col2, $i, "#c0c0c0", $compiler); svgtext($svg, $col3, $i, "#c0c0c0", $datamodel); - svgtext($svg, $col4, $i, "#60ff60", "Pass"); - svgtext($svg, $col5, $i, "#60ff60", "Pass"); -# svgtext($svg, $col6, $i, "#60ff60", "Pass"); - svgtext($svg, $col7, $i, "#60ff60", "Pass"); + svgtext($svg, $col4, $i, "#60ff60", $compilerok); + svgtext($svg, $col5, $i, "#60ff60", $libraryok); + svgtext($svg, $col6, $i, "#60ff60", $checksum); + svgtext($svg, $col7, $i, "#60ff60", $tests); $i++; } From b2e446d352578574205da7ed563df07e28f60852 Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 1 Jul 2016 14:17:26 +0100 Subject: [PATCH 120/580] Typo in vishap.make --- src/tools/make/vishap.make | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/make/vishap.make b/src/tools/make/vishap.make index ca4daefa..4cbbf52e 100644 --- a/src/tools/make/vishap.make +++ b/src/tools/make/vishap.make @@ -28,7 +28,7 @@ usage: clean: - @printf "\n\n--- Cleaning branch $$(BRANCH) $(OS) $(COMPILER) $(DATAMODEL) ---\n\n" + @printf "\n\n--- Cleaning branch $(BRANCH) $(OS) $(COMPILER) $(DATAMODEL) ---\n\n" rm -rf $(BUILDDIR) rm -f $(VISHAP) From 78540bcaba28531d260edd705ff56560d6c51563 Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 1 Jul 2016 14:50:05 +0100 Subject: [PATCH 121/580] Move test build scripts. --- src/tools/{testcoordinator => make}/buildall.pl | 0 src/tools/{testcoordinator => make}/postpush.pl | 0 src/tools/{testcoordinator => make}/pt.pl | 0 src/tools/testcoordinator/passes.pl | 17 ----------------- 4 files changed, 17 deletions(-) rename src/tools/{testcoordinator => make}/buildall.pl (100%) rename src/tools/{testcoordinator => make}/postpush.pl (100%) rename src/tools/{testcoordinator => make}/pt.pl (100%) delete mode 100755 src/tools/testcoordinator/passes.pl diff --git a/src/tools/testcoordinator/buildall.pl b/src/tools/make/buildall.pl similarity index 100% rename from src/tools/testcoordinator/buildall.pl rename to src/tools/make/buildall.pl diff --git a/src/tools/testcoordinator/postpush.pl b/src/tools/make/postpush.pl similarity index 100% rename from src/tools/testcoordinator/postpush.pl rename to src/tools/make/postpush.pl diff --git a/src/tools/testcoordinator/pt.pl b/src/tools/make/pt.pl similarity index 100% rename from src/tools/testcoordinator/pt.pl rename to src/tools/make/pt.pl diff --git a/src/tools/testcoordinator/passes.pl b/src/tools/testcoordinator/passes.pl deleted file mode 100755 index c7ca9bde..00000000 --- a/src/tools/testcoordinator/passes.pl +++ /dev/null @@ -1,17 +0,0 @@ -#!perl -w -use strict; -use warnings; -use POSIX "strftime"; - -# Now parse the combined logs extracting build pass messages -# lub32 20.47.55 --- Branch v2docs ubuntu gcc ILP32 confidence tests passed --- - -open(my $buildlog, "log/buildpasses.log") // die "Could not create buildpasses.log."; -while (<$buildlog>) { - if (/ --- Branch .* confidence tests passed ---/) { - print $passes $_; - } -} -close($buildlog); -close($passes); From ec7888859c405129d24d1afd95f765ba33340a68 Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 1 Jul 2016 15:16:11 +0100 Subject: [PATCH 122/580] Omit OPC and OPM from checksums as they contain the build date. --- src/tools/make/checksumtest.sh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/tools/make/checksumtest.sh b/src/tools/make/checksumtest.sh index a4d4262f..84a333d5 100644 --- a/src/tools/make/checksumtest.sh +++ b/src/tools/make/checksumtest.sh @@ -1,14 +1,16 @@ # Checksum tests -md5=$((which md5;which md5sum)2>/dev/null) +md5=md5 +if which md5sum >/dev/null 2>&1; then md5=md5sum; fi if [ -f $1 ] then - $md5 *.o >newsums + $md5 *.o | egrep -v "OP[CM]\\.o" >newsums if diff -b $1 newsums - then printf "\n--- Object file checksums match ---\n"; rm newsums -else printf "\n--- Object file checksum mismatch ---\n"; rm newsums; exit 1 + then printf "\n--- Object file checksums match ---\n" + else printf "\n--- Object file checksum mismatch ---\n" fi + rm newsums else - $md5 *.o >$1 + $md5 *.o | egrep -v "OP[CM]\\.o" >$1 printf "\n--- Object files checksummed ---\n" fi From c7984ffdac5fef8712102d2f1bb0c96b891ca065 Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 1 Jul 2016 15:32:18 +0100 Subject: [PATCH 123/580] Build machine to pick up latest buildall.pl every time. --- src/tools/make/buildall.pl | 15 ++++++++------- src/tools/make/postpush.pl | 7 ++++--- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/tools/make/buildall.pl b/src/tools/make/buildall.pl index 49b90800..7ac0a819 100755 --- a/src/tools/make/buildall.pl +++ b/src/tools/make/buildall.pl @@ -42,6 +42,7 @@ sub logged { } +unlink glob "log/*"; for my $machine (sort keys %machines) { my ($login, $sudo, $dir) = @{$machines{$machine}}; @@ -53,7 +54,7 @@ while ((my $pid = wait) > 0) {print "Child pid $pid completed.\n";} # # All builds have completed. Now scan the logs for pass/fail and build the passing report. -# +# # my %status = (); # open(my $logs, "/tmp/buildall.log") // die "Couldn't open combined build log."; # while (<$logs>) { @@ -62,23 +63,23 @@ while ((my $pid = wait) > 0) {print "Child pid $pid completed.\n";} # } # } # close(my $logs); -# -# +# +# # sub svgtext { # my ($f, $x, $y, $msg) = @_; # print($f ""; # print($f $msg); # print($f "\n"); # } -# -# +# +# # open(my $svg, ">passing.svg") // dir "Could not create passing.svg."); # print $svg '\n'; -# +# # my $i=1; # for my $host (sort keys %status) { # svgtext($svg, 10, $i*20, $host); # $i++; # } -# +# # print $svg '\n'; diff --git a/src/tools/make/postpush.pl b/src/tools/make/postpush.pl index 4db1e46b..94a4394b 100755 --- a/src/tools/make/postpush.pl +++ b/src/tools/make/postpush.pl @@ -11,7 +11,7 @@ use JSON; sub writelog { my ($msg) = @_; - + open(LOG, ">>/tmp/postpush.log") or die "Could not create postpush.log"; flock(LOG, 2) or die "Could not lock postpush.log"; print LOG sprintf("%s %s\n", strftime("%Y/%m/%d %H.%M.%S", localtime), $msg); @@ -40,9 +40,10 @@ if ($child) { } else { # child process close(STDIN); close(STDOUT); close(STDERR); - exec 'perl /var/lib/nethserver/ibay/githubhook/buildall.pl >/tmp/buildall.log'; + system 'wget https://raw.githubusercontent.com/vishaps/voc/v2docs/src/tools/make/buildall.pl'; + exec 'perl buildall.pl >/tmp/buildall.log'; exit; -} +} print header(), start_html("Vishap Oberon github post push web hook."), From 3c8a347d331b8b315957fa7281edcb9c5643d7e7 Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 1 Jul 2016 15:44:06 +0100 Subject: [PATCH 124/580] Need to remove prior buildall.pl as wget won't overwrite. --- src/tools/make/postpush.pl | 1 + 1 file changed, 1 insertion(+) diff --git a/src/tools/make/postpush.pl b/src/tools/make/postpush.pl index 94a4394b..fdbe8829 100755 --- a/src/tools/make/postpush.pl +++ b/src/tools/make/postpush.pl @@ -40,6 +40,7 @@ if ($child) { } else { # child process close(STDIN); close(STDOUT); close(STDERR); + unlink "buildall.pl"; system 'wget https://raw.githubusercontent.com/vishaps/voc/v2docs/src/tools/make/buildall.pl'; exec 'perl buildall.pl >/tmp/buildall.log'; exit; From e68743eadc25f065389690cf2e2892766a075ecc Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 1 Jul 2016 15:53:29 +0100 Subject: [PATCH 125/580] Make sure buildall starts in the cirrect directory. --- src/tools/make/buildall.pl | 2 ++ src/tools/make/postpush.pl | 1 + 2 files changed, 3 insertions(+) diff --git a/src/tools/make/buildall.pl b/src/tools/make/buildall.pl index 7ac0a819..c67642e8 100755 --- a/src/tools/make/buildall.pl +++ b/src/tools/make/buildall.pl @@ -2,6 +2,7 @@ use strict; use warnings; use POSIX "strftime"; +use Cwd; my $branch = "v2docs"; @@ -41,6 +42,7 @@ sub logged { } } +print "Buildall starting in ", getcwd, "\n"; unlink glob "log/*"; diff --git a/src/tools/make/postpush.pl b/src/tools/make/postpush.pl index fdbe8829..954d604e 100755 --- a/src/tools/make/postpush.pl +++ b/src/tools/make/postpush.pl @@ -40,6 +40,7 @@ if ($child) { } else { # child process close(STDIN); close(STDOUT); close(STDERR); + chdir "/var/lib/nethserver/ibay/githubhook"; unlink "buildall.pl"; system 'wget https://raw.githubusercontent.com/vishaps/voc/v2docs/src/tools/make/buildall.pl'; exec 'perl buildall.pl >/tmp/buildall.log'; From 4981afd55adae4c3fb36d2c4dfc5341a632dcc11 Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 1 Jul 2016 18:19:55 +0100 Subject: [PATCH 126/580] Pickup of latest buildall.pl working. --- src/tools/make/checksumtest.sh | 7 +++++++ src/tools/make/postpush.pl | 10 +++------- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/tools/make/checksumtest.sh b/src/tools/make/checksumtest.sh index 84a333d5..47926771 100644 --- a/src/tools/make/checksumtest.sh +++ b/src/tools/make/checksumtest.sh @@ -1,4 +1,11 @@ # Checksum tests +# +# Checksums object binaries (*.o) and compares with previous +# checksum for this branch. +# +# Note: OPC.o and OPM.o are omitted as they both have text string constants +# that include the build date. + md5=md5 if which md5sum >/dev/null 2>&1; then md5=md5sum; fi diff --git a/src/tools/make/postpush.pl b/src/tools/make/postpush.pl index 954d604e..e2c275d9 100755 --- a/src/tools/make/postpush.pl +++ b/src/tools/make/postpush.pl @@ -9,6 +9,7 @@ use POSIX "strftime"; use CGI qw(:standard escapeHTML); use JSON; + sub writelog { my ($msg) = @_; @@ -27,20 +28,15 @@ my $name = $postdata->{'head_commit'}->{'author'}->{'name'}; my $branch = $ref; $branch =~ s'^.*\/''; my $repo = $url; $repo =~ s'^.*\/''; -#my $repo="repo"; my $branch="branch"; my $name="name"; - writelog "Post push github web hook for repository $repo, branch $branch, name $name."; my $child = fork; if (not defined $child) {die "Fork failed.";} if ($child) { - # parent process - writelog "Started buildall, pid = $child."; + writelog "Started buildall, pid = $child."; # parent process } else { - # child process - close(STDIN); close(STDOUT); close(STDERR); - chdir "/var/lib/nethserver/ibay/githubhook"; + close(STDIN); close(STDOUT); close(STDERR); # child process unlink "buildall.pl"; system 'wget https://raw.githubusercontent.com/vishaps/voc/v2docs/src/tools/make/buildall.pl'; exec 'perl buildall.pl >/tmp/buildall.log'; From 43d120814c64e564a82f37842df8b21d78f28914 Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 1 Jul 2016 19:40:19 +0100 Subject: [PATCH 127/580] Log scanner beginning to work. --- ReadMe.md | 6 +- src/tools/make/buildall.pl | 131 +++++++++++++++++++++++++++++-------- src/tools/make/pt.pl | 23 ++++--- 3 files changed, 117 insertions(+), 43 deletions(-) diff --git a/ReadMe.md b/ReadMe.md index c6e75b4f..d80ed5eb 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -1,3 +1,5 @@ +![Build status](http://brownsmeet.com/build-status.svg) + ### Ñ´ishap Oberon [Ñ´ishap Oberon](http://oberon.vishap.am) is a free and open source (GPLv3) @@ -26,10 +28,6 @@ languages, following the principals of Einstein and Antoine de Saint-Exupéry: > when there is no longer anything to take away. (Antoine de Saint-Exupéry, > translated by Lewis Galantière.) -##### Build status - -![Build status](http://brownsmeet.com/build-status.svg) - #### Installation ##### Prerequisites diff --git a/src/tools/make/buildall.pl b/src/tools/make/buildall.pl index c67642e8..35a19045 100755 --- a/src/tools/make/buildall.pl +++ b/src/tools/make/buildall.pl @@ -56,32 +56,105 @@ while ((my $pid = wait) > 0) {print "Child pid $pid completed.\n";} # # All builds have completed. Now scan the logs for pass/fail and build the passing report. -# -# my %status = (); -# open(my $logs, "/tmp/buildall.log") // die "Couldn't open combined build log."; -# while (<$logs>) { -# if (/^([^ ]+) ([^ ]+) --- Branch ([^ ]+) ([^ ]+) ([^ ]+) ([^ ]+) confidence tests passed ---/) { -# $status{$1} = [$2, $3, $4, $5, $6]; -# } -# } -# close(my $logs); -# -# -# sub svgtext { -# my ($f, $x, $y, $msg) = @_; -# print($f ""; -# print($f $msg); -# print($f "\n"); -# } -# -# -# open(my $svg, ">passing.svg") // dir "Could not create passing.svg."); -# print $svg '\n'; -# -# my $i=1; -# for my $host (sort keys %status) { -# svgtext($svg, 10, $i*20, $host); -# $i++; -# } -# -# print $svg '\n'; + + +my %status = (); + + +sub parselog { + my ($fn) = @_; + #print "Parsing log $fn\n"; + my $date = ""; + my $time = ""; + my $branch = ""; + my $os = ""; + my $compiler = ""; + my $datamodel = ""; + my $compilerok = ""; + my $libraryok = ""; + my $checksum = ""; + my $tests = ""; + open(my $log, $fn) // die "Couldn't open build log $fn."; + while (<$log>) { + if (/^([0-9\/]+) [0-9.]+ [^ ]+\.log$/) {$date = $1;} + if (/^[^ ]+ --- Cleaning branch ([^ ]+) ([^ ]+) ([^ ]+) ([^ ]+) ---$/) { + ($branch, $os, $compiler, $datamodel) = ($1, $2, $3, $4, $5); + } + if (/^([0-9.]+) --- Compiler build successfull ---$/) {$compilerok = "Built";} + if (/^([0-9.]+) --- Library build successfull ---$/) {$libraryok = "Built";} + if (/^([0-9.]+) --- Confidence tests passed ---$/) {$tests = "Passed";} + if (/^([0-9.]+) --- Object file checksums match ---$/) {$checksum = "Match";} + if (/^([0-9.]+) --- Object file checksum mismatch ---$/) {$checksum = "Changed";} + if (/^([0-9.]+) --- Object files checksummed ---$/) {$checksum = "New";} + } + close($log); + my $key = "$os-$compiler-$datamodel"; + if ($key ne "") { + $status{$key} = [$date, $time, $os, $compiler, $datamodel, $branch, $compilerok, $libraryok, $checksum, $tests]; + } +} + +opendir DIR, "log" // die "Could not open log directory."; +my @logs = readdir DIR; +closedir DIR; + +for my $logname (sort @logs) { + $logname = "log/" . $logname; + #print "Consider $logname\n"; + if (-f $logname) {parselog($logname);} +} + +my $emsperline = 1.2; + +sub svgtext { + my ($f, $x, $y, $colour, $msg) = @_; + print $f ''; + print $f $msg; + print $f "\n"; +} + +my $rows = keys %status; + +open(my $svg, ">build-status.svg") // die "Could not create build-status.svg."; +print $svg '', "\n"; +print $svg '', "\n"; + +my $col1 = 20; +my $col2 = 110; +my $col3 = 200; +my $col4 = 310; +my $col5 = 400; +my $col6 = 490; +my $col7 = 580; + +svgtext($svg, $col1, 0, "#e0e0e0", "OS"); +svgtext($svg, $col2, 0, "#e0e0e0", "Compiler"); +svgtext($svg, $col3, 0, "#e0e0e0", "Data model"); +svgtext($svg, $col4, 0, "#e0e0e0", "Compiler"); +svgtext($svg, $col5, 0, "#e0e0e0", "Library"); +svgtext($svg, $col6, 0, "#e0e0e0", "Checksum"); +svgtext($svg, $col7, 0, "#e0e0e0", "Tests"); + +my $i=1; +for my $key (sort keys %status) { + my ($date, $time, $os, $compiler, $datamodel, + $branch, $compilerok, $libraryok, $checksum, $tests) = @{$status{$key}}; + svgtext($svg, $col1, $i, "#c0c0c0", $os); + svgtext($svg, $col2, $i, "#c0c0c0", $compiler); + svgtext($svg, $col3, $i, "#c0c0c0", $datamodel); + svgtext($svg, $col4, $i, "#60ff60", $compilerok); + svgtext($svg, $col5, $i, "#60ff60", $libraryok); + svgtext($svg, $col6, $i, "#60ff60", $checksum); + svgtext($svg, $col7, $i, "#60ff60", $tests); + $i++; +} + +print $svg "\n"; + +system 'scp -p build-status.svg dave@hub:/var/www'; diff --git a/src/tools/make/pt.pl b/src/tools/make/pt.pl index 0d5058f8..0c3243c1 100755 --- a/src/tools/make/pt.pl +++ b/src/tools/make/pt.pl @@ -11,6 +11,7 @@ my %status = (); sub parselog { my ($fn) = @_; + #print "Parsing log $fn\n"; my $date = ""; my $time = ""; my $branch = ""; @@ -23,29 +24,31 @@ sub parselog { my $tests = ""; open(my $log, $fn) // die "Couldn't open build log $fn."; while (<$log>) { - if (/^([0-9/]+) [0-9.]+ [^ ]+\.log$/) {$date = $1;} + if (/^([0-9\/]+) [0-9.]+ [^ ]+\.log$/) {$date = $1;} if (/^[^ ]+ --- Cleaning branch ([^ ]+) ([^ ]+) ([^ ]+) ([^ ]+) ---$/) { ($branch, $os, $compiler, $datamodel) = ($1, $2, $3, $4, $5); } - if (/^--- Compiler build successfull ---$/) {$compilerok = "Built";} - if (/^--- Library build successfull ---$/) {$libraryok = "Built";} - if (/^--- Confidence tests passed ---$/) {$tests = "Passed";} - if (/^--- Object file checksums match ---$/) {$checksum = "Match";} - if (/^--- Object file checksum mismatch ---$/) {$checksum = "Changed";} - if (/^--- Object files checksummed ---$/) {$checksum = "New";} + if (/^([0-9.]+) --- Compiler build successfull ---$/) {$compilerok = "Built";} + if (/^([0-9.]+) --- Library build successfull ---$/) {$libraryok = "Built";} + if (/^([0-9.]+) --- Confidence tests passed ---$/) {$tests = "Passed";} + if (/^([0-9.]+) --- Object file checksums match ---$/) {$checksum = "Match";} + if (/^([0-9.]+) --- Object file checksum mismatch ---$/) {$checksum = "Changed";} + if (/^([0-9.]+) --- Object files checksummed ---$/) {$checksum = "New";} } close($log); my $key = "$os-$compiler-$datamodel"; if ($key ne "") { - status{$key} = [$date, $time, $os, %compiler, $datamodel, $branch, $compilerok, $libraryok, $checksum, $tests]; + $status{$key} = [$date, $time, $os, $compiler, $datamodel, $branch, $compilerok, $libraryok, $checksum, $tests]; } } -opendir DIR, "log" // die "Could not openlog directory."; +opendir DIR, "log" // die "Could not open log directory."; my @logs = readdir DIR; closedir DIR; for my $logname (sort @logs) { + $logname = "log/" . $logname; + #print "Consider $logname\n"; if (-f $logname) {parselog($logname);} } @@ -88,7 +91,7 @@ svgtext($svg, $col7, 0, "#e0e0e0", "Tests"); my $i=1; for my $key (sort keys %status) { - my ($date, $time, $os, %compiler, $datamodel, + my ($date, $time, $os, $compiler, $datamodel, $branch, $compilerok, $libraryok, $checksum, $tests) = @{$status{$key}}; svgtext($svg, $col1, $i, "#c0c0c0", $os); svgtext($svg, $col2, $i, "#c0c0c0", $compiler); From feff10c22c4f9ed7b0a4c2be418ce31497175917 Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 1 Jul 2016 19:52:04 +0100 Subject: [PATCH 128/580] Tweak build report --- src/tools/make/buildall.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tools/make/buildall.pl b/src/tools/make/buildall.pl index 35a19045..cc3492a7 100755 --- a/src/tools/make/buildall.pl +++ b/src/tools/make/buildall.pl @@ -83,7 +83,7 @@ sub parselog { if (/^([0-9.]+) --- Compiler build successfull ---$/) {$compilerok = "Built";} if (/^([0-9.]+) --- Library build successfull ---$/) {$libraryok = "Built";} if (/^([0-9.]+) --- Confidence tests passed ---$/) {$tests = "Passed";} - if (/^([0-9.]+) --- Object file checksums match ---$/) {$checksum = "Match";} + if (/^([0-9.]+) --- Object file checksums match ---$/) {$checksum = "Unchanged";} if (/^([0-9.]+) --- Object file checksum mismatch ---$/) {$checksum = "Changed";} if (/^([0-9.]+) --- Object files checksummed ---$/) {$checksum = "New";} } @@ -130,7 +130,7 @@ my $col2 = 110; my $col3 = 200; my $col4 = 310; my $col5 = 400; -my $col6 = 490; +my $col6 = 480; my $col7 = 580; svgtext($svg, $col1, 0, "#e0e0e0", "OS"); From 96f84b3937722fb5df443f8db3e27324bd82c0e7 Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 1 Jul 2016 19:58:55 +0100 Subject: [PATCH 129/580] Tweak build report --- src/tools/make/buildall.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tools/make/buildall.pl b/src/tools/make/buildall.pl index cc3492a7..f6a731d4 100755 --- a/src/tools/make/buildall.pl +++ b/src/tools/make/buildall.pl @@ -123,7 +123,7 @@ open(my $svg, ">build-status.svg") // die "Could not create build-status.svg."; print $svg '', "\n"; -print $svg '', "\n"; +print $svg '', "\n"; my $col1 = 20; my $col2 = 110; @@ -157,4 +157,4 @@ for my $key (sort keys %status) { print $svg "\n"; -system 'scp -p build-status.svg dave@hub:/var/www'; +system 'scp build-status.svg dave@hub:/var/www'; From e16f1c13b6fe3bb142e66e2c4cbc2732c3a78451 Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 1 Jul 2016 20:15:53 +0100 Subject: [PATCH 130/580] Prettify build report --- src/tools/make/buildall.pl | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/tools/make/buildall.pl b/src/tools/make/buildall.pl index f6a731d4..3b8b2805 100755 --- a/src/tools/make/buildall.pl +++ b/src/tools/make/buildall.pl @@ -119,18 +119,20 @@ sub svgtext { my $rows = keys %status; +my $width = 680; +my $height = ($rows+2) * $emsperline; + open(my $svg, ">build-status.svg") // die "Could not create build-status.svg."; -print $svg '', "\n"; -print $svg '', "\n"; +print $svg '', "\n"; +print $svg '', "\n"; my $col1 = 20; my $col2 = 110; my $col3 = 200; my $col4 = 310; my $col5 = 400; -my $col6 = 480; +my $col6 = 475; my $col7 = 580; svgtext($svg, $col1, 0, "#e0e0e0", "OS"); From 8f7e25fe2f263874e768f1c51cc7f2b072e15571 Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 1 Jul 2016 20:35:11 +0100 Subject: [PATCH 131/580] Begin to add logs to build report --- src/tools/make/buildall.pl | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/src/tools/make/buildall.pl b/src/tools/make/buildall.pl index 3b8b2805..94da86a7 100755 --- a/src/tools/make/buildall.pl +++ b/src/tools/make/buildall.pl @@ -7,12 +7,12 @@ use Cwd; my $branch = "v2docs"; my %machines = ( - "pi" => ['pi@pie', "sudo", "projects/oberon/vishap/voc"], - "darwin" => ['dave@dcb', "sudo", "projects/oberon/vishap/voc"], - "lub32" => ['dave@lub32', "sudo", "vishap/voc"], - "ob32" => ['root@nas-ob32', "", "vishap/voc"], +# "pi" => ['pi@pie', "sudo", "projects/oberon/vishap/voc"], +# "darwin" => ['dave@dcb', "sudo", "projects/oberon/vishap/voc"], +# "lub32" => ['dave@lub32', "sudo", "vishap/voc"], +# "ob32" => ['root@nas-ob32', "", "vishap/voc"], "fb64" => ['root@oberon', "", "vishap/voc"], - "ub64" => ['dave@nas-ub64', "sudo", "vishap/voc"], +# "ub64" => ['dave@nas-ub64', "sudo", "vishap/voc"], "ce64" => ['-p5922 obe@www', "sudo", "vishap/voc"] ); @@ -42,8 +42,6 @@ sub logged { } } -print "Buildall starting in ", getcwd, "\n"; - unlink glob "log/*"; for my $machine (sort keys %machines) { @@ -90,7 +88,7 @@ sub parselog { close($log); my $key = "$os-$compiler-$datamodel"; if ($key ne "") { - $status{$key} = [$date, $time, $os, $compiler, $datamodel, $branch, $compilerok, $libraryok, $checksum, $tests]; + $status{$key} = [$fn, $date, $time, $os, $compiler, $datamodel, $branch, $compilerok, $libraryok, $checksum, $tests]; } } @@ -123,9 +121,11 @@ my $width = 680; my $height = ($rows+2) * $emsperline; open(my $svg, ">build-status.svg") // die "Could not create build-status.svg."; -print $svg '', "\n"; -print $svg '', "\n"; +print $svg '\n"; +print $svg '', "\n"; my $col1 = 20; my $col2 = 110; @@ -145,8 +145,9 @@ svgtext($svg, $col7, 0, "#e0e0e0", "Tests"); my $i=1; for my $key (sort keys %status) { - my ($date, $time, $os, $compiler, $datamodel, - $branch, $compilerok, $libraryok, $checksum, $tests) = @{$status{$key}}; + my ($fn, $date, $time, $os, $compiler, $datamodel, $branch, + $compilerok, $libraryok, $checksum, $tests) = @{$status{$key}}; + print $svg ''; svgtext($svg, $col1, $i, "#c0c0c0", $os); svgtext($svg, $col2, $i, "#c0c0c0", $compiler); svgtext($svg, $col3, $i, "#c0c0c0", $datamodel); @@ -154,9 +155,11 @@ for my $key (sort keys %status) { svgtext($svg, $col5, $i, "#60ff60", $libraryok); svgtext($svg, $col6, $i, "#60ff60", $checksum); svgtext($svg, $col7, $i, "#60ff60", $tests); + print $svg ''; $i++; } print $svg "\n"; system 'scp build-status.svg dave@hub:/var/www'; +system 'scp log/* dave@hub:/var/www/log'; From 2d531ad8d6838d9841b5fde5ba28fe930894ce47 Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 1 Jul 2016 20:50:17 +0100 Subject: [PATCH 132/580] Tweak build report border --- src/tools/make/buildall.pl | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/tools/make/buildall.pl b/src/tools/make/buildall.pl index 94da86a7..4539cf9c 100755 --- a/src/tools/make/buildall.pl +++ b/src/tools/make/buildall.pl @@ -11,9 +11,9 @@ my %machines = ( # "darwin" => ['dave@dcb', "sudo", "projects/oberon/vishap/voc"], # "lub32" => ['dave@lub32', "sudo", "vishap/voc"], # "ob32" => ['root@nas-ob32', "", "vishap/voc"], - "fb64" => ['root@oberon', "", "vishap/voc"], +# "ce64" => ['-p5922 obe@www', "sudo", "vishap/voc"], # "ub64" => ['dave@nas-ub64', "sudo", "vishap/voc"], - "ce64" => ['-p5922 obe@www', "sudo", "vishap/voc"] + "fb64" => ['root@oberon', "", "vishap/voc"] ); @@ -102,13 +102,14 @@ for my $logname (sort @logs) { if (-f $logname) {parselog($logname);} } -my $emsperline = 1.2; +my $fontheight = 10; +my $lineheight = 13; sub svgtext { my ($f, $x, $y, $colour, $msg) = @_; print $f ''; print $f $msg; @@ -118,14 +119,15 @@ sub svgtext { my $rows = keys %status; my $width = 680; -my $height = ($rows+2) * $emsperline; +my $height = ($rows+2) * $lineheight; open(my $svg, ">build-status.svg") // die "Could not create build-status.svg."; -print $svg '\n"; -print $svg '', "\n"; +print $svg '', "\n"; my $col1 = 20; my $col2 = 110; From 0c5d71dc197270e9b863a0e6cdecc8454fcaa55a Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 1 Jul 2016 20:52:12 +0100 Subject: [PATCH 133/580] buildall.pl typo --- src/tools/make/buildall.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/make/buildall.pl b/src/tools/make/buildall.pl index 4539cf9c..d5486e69 100755 --- a/src/tools/make/buildall.pl +++ b/src/tools/make/buildall.pl @@ -125,7 +125,7 @@ open(my $svg, ">build-status.svg") // die "Could not create build-status.svg."; print $svg '\n"; -print $svg '', "\n"; From b7871e1927dbab1f78a65776bbc1f0b531d42290 Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 1 Jul 2016 21:02:26 +0100 Subject: [PATCH 134/580] move text down very slightly. --- src/tools/make/buildall.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/make/buildall.pl b/src/tools/make/buildall.pl index d5486e69..c9d95b4b 100755 --- a/src/tools/make/buildall.pl +++ b/src/tools/make/buildall.pl @@ -108,7 +108,7 @@ my $lineheight = 13; sub svgtext { my ($f, $x, $y, $colour, $msg) = @_; print $f ''; From bb519dc27a061fbba360f83e64230aa83c0ab4d1 Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 1 Jul 2016 21:08:45 +0100 Subject: [PATCH 135/580] Reenable most builds. --- src/tools/make/buildall.pl | 14 +++++++------- src/tools/make/postpush.pl | 1 + 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/tools/make/buildall.pl b/src/tools/make/buildall.pl index c9d95b4b..495fdc2b 100755 --- a/src/tools/make/buildall.pl +++ b/src/tools/make/buildall.pl @@ -7,13 +7,13 @@ use Cwd; my $branch = "v2docs"; my %machines = ( -# "pi" => ['pi@pie', "sudo", "projects/oberon/vishap/voc"], -# "darwin" => ['dave@dcb', "sudo", "projects/oberon/vishap/voc"], -# "lub32" => ['dave@lub32', "sudo", "vishap/voc"], -# "ob32" => ['root@nas-ob32', "", "vishap/voc"], -# "ce64" => ['-p5922 obe@www', "sudo", "vishap/voc"], -# "ub64" => ['dave@nas-ub64', "sudo", "vishap/voc"], - "fb64" => ['root@oberon', "", "vishap/voc"] + "pi" => ['pi@pie', "sudo", "projects/oberon/vishap/voc"], + "darwin" => ['dave@dcb', "sudo", "projects/oberon/vishap/voc"], + "lub32" => ['dave@lub32', "sudo", "vishap/voc"], + "ob32" => ['root@nas-ob32', "", "vishap/voc"], + "ce64" => ['-p5922 obe@www', "sudo", "vishap/voc"], + "ub64" => ['dave@nas-ub64', "sudo", "vishap/voc"], + "fb64" => ['root@oberon', "", "vishap/voc"] ); diff --git a/src/tools/make/postpush.pl b/src/tools/make/postpush.pl index e2c275d9..8916e0d1 100755 --- a/src/tools/make/postpush.pl +++ b/src/tools/make/postpush.pl @@ -38,6 +38,7 @@ if ($child) { } else { close(STDIN); close(STDOUT); close(STDERR); # child process unlink "buildall.pl"; + sleep 5; # Leave time for the push to complete. (Yuk!) system 'wget https://raw.githubusercontent.com/vishaps/voc/v2docs/src/tools/make/buildall.pl'; exec 'perl buildall.pl >/tmp/buildall.log'; exit; From f780a801f4832f48adba78820c343b84d2a3694f Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 1 Jul 2016 21:24:44 +0100 Subject: [PATCH 136/580] 10% increase of build status font height. --- src/tools/make/buildall.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tools/make/buildall.pl b/src/tools/make/buildall.pl index 495fdc2b..5b9df6fd 100755 --- a/src/tools/make/buildall.pl +++ b/src/tools/make/buildall.pl @@ -102,13 +102,13 @@ for my $logname (sort @logs) { if (-f $logname) {parselog($logname);} } -my $fontheight = 10; +my $fontheight = 11; my $lineheight = 13; sub svgtext { my ($f, $x, $y, $colour, $msg) = @_; print $f ''; From 1f73ab6856fe3fdd782605cd3678db835fc36ad6 Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 1 Jul 2016 22:45:40 +0100 Subject: [PATCH 137/580] Just a bit more font height. --- src/tools/make/buildall.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tools/make/buildall.pl b/src/tools/make/buildall.pl index 5b9df6fd..c290b942 100755 --- a/src/tools/make/buildall.pl +++ b/src/tools/make/buildall.pl @@ -102,8 +102,8 @@ for my $logname (sort @logs) { if (-f $logname) {parselog($logname);} } -my $fontheight = 11; -my $lineheight = 13; +my $fontheight = 12; +my $lineheight = 15; sub svgtext { my ($f, $x, $y, $colour, $msg) = @_; From 8e4367e5c9246374534ff4b217d9655eee2834b4 Mon Sep 17 00:00:00 2001 From: David Brown Date: Wed, 6 Jul 2016 17:20:12 +0100 Subject: [PATCH 138/580] ReadMe tweaking. Simplify. Add References and links. --- ReadMe.md | 132 +++++++++++++++++++++++++++++--------------- doc/Features.md | 2 + doc/History.md | 4 ++ doc/Installation.md | 3 + doc/Porting.md | 2 + doc/Roadmap.md | 7 +++ src/system/SYSTEM.h | 20 +++---- 7 files changed, 115 insertions(+), 55 deletions(-) diff --git a/ReadMe.md b/ReadMe.md index d80ed5eb..d28b2796 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -1,37 +1,30 @@ ![Build status](http://brownsmeet.com/build-status.svg) -### Ñ´ishap Oberon +## Ñ´ishap Oberon [Ñ´ishap Oberon](http://oberon.vishap.am) is a free and open source (GPLv3) -implementation of the Oberon-2 language compiler and libraries for use on +implementation of the Oberon-2 language and libraries for use on conventional operating systems such as Linux, BSD, Android, Mac and Windows. -Vishap's Oberon Compiler (voc) uses a C backend to compile -Oberon programs under Unix or Windows. Vishap Oberon includes +Vishap's Oberon Compiler (voc) uses a C backend (gcc, clang or msc) to compile +Oberon programs under Unix, Mac or Windows. Vishap Oberon includes libraries from the Ulm, oo2c and Ofront Oberon compilers, as well as default libraries complying with the Oakwood Guidelines for Oberon-2 compilers. -##### Oberon - System and Programming Language - -Oberon is a programming language, an operating system and a graphical -user interface. Originally designed and implemented by by Niklaus Wirth and -Jürg Gutknecht at ETH Zürich in the late 1980s, it demonstrates that the -fundamentals of a modern OS and GUI can be implemented in clean and simple code -orders of magnitude smaller than found in contemporary systems. - -The Oberon programming language is an evolution of the Pascal and Modula -languages, following the principals of Einstein and Antoine de Saint-Exupéry: - -> Make it as simple as possible, but not simpler. (Albert Einstein) - -> Perfection is finally attained not when there is no longer anything to add, but -> when there is no longer anything to take away. (Antoine de Saint-Exupéry, -> translated by Lewis Galantière.) - -#### Installation +### Installation ##### Prerequisites +| Platform | Packages | +| --------- | ------------ | +| Debian/Ubuntu/Mint ... | apt-get install git | +| Fedora/RHEL/CentOS ... | yum install git gcc glibc-static | +| FreeBSD/OpenBSD/NetBSD | pkg install git | +| Cygwin | use setup-x86[_x64] to add packages git, make and gcc-core | +| Darwin | run 'git' at the command line and accept the prompt to install it. | + +More details, including for MingW and MS C, in [Installation](/doc/Installation.md). + ##### Build and install 1. `git clone https://github.com/vishaps/voc` @@ -54,7 +47,7 @@ by make full, e.g. Also see [Installation](/doc/Installation.md). -#### A 'Hello' application +### A 'Hello' application Anything appended to Oberon.Log is automatically displayed on the console, so the following conventional Oberon program will display 'Hello.': @@ -88,7 +81,7 @@ Execute as usual on Linux ('./hello') or Windows ('hello'). Also see [Compiling](/doc/Compiling.md). -#### Licensing +### Licensing Vishap Oberon's frontend and C backend engine is a fork of Josef Templ’s Ofront, which has been released under the FreeBSD License. Unlike Ofront, Vishap Oberon does not include the Oberon v4 environment. @@ -101,7 +94,7 @@ Voc tools are distributed under GPLv3. Most of the runtime in libVishapOberon is distributed under GPLv3 with runtime exception. -#### Platform support +### Platform support and porting Vishap Oberon supports 32 and 64 bit little-endian architectures including Intel x86 and x64, arm and ppc. @@ -109,15 +102,28 @@ It compiles under gcc, clang and Microsoft Visual C. Installation supports GNU/Linux, MAC OSX, BSD and Windows (native and cygwin). -#### Language support +A C program (src/tools/make/configure.c) detects the details of the C compiler +and operating system on which it is running. In most cases it will automatically +determine all that is needed for the port to a new platform. and 'make full' +will just work. + +In some cases manual work will be required: + + - If configure.c cannot recognise the operating system on which it is running + a few lines will need to be added to detect and set the make variables + correctly. + - If porting to a system that does not provide a Unix style API, it will be + necessary to implement a new variant of Platform.Mod providing the same + interface as Platformunix.Mod and Platform Windows.Mod. + +For details, see [Porting](/doc/Porting.md). + +### Language support and libraries Vishap Oberon supports the Oberon 2 programming language, including type-bound procedures. It also supports some features of Oberon-07. - -#### Libraries - Vishap Oberon comes with libraries easing the porting of code from the major Oberon systems: @@ -129,24 +135,17 @@ Oberon systems: Some other freely redistributable libraries are available as a part of voc distribution. +See also [Features](/doc/Features.md). -#### Features - -See [Features](/doc/Features.md). - -#### Porting to new platforms - -See [Porting](/doc/Porting.md). - -#### History +### History See [History](/doc/History.md). -#### Roadmap +### Roadmap See [Roadmap](/doc/Roadmap.md). -#### Contributors +### Contributors Originally developed as a cross platform implementation of the Oberon system by Joseph Templ. @@ -157,11 +156,54 @@ to new platforms by Norayr Chilingarian. Build process simplified for more platform support and bugs fixed by David C W Brown. -#### Origin of the name Vishap +### Origin of the name "Ñ´ishap Oberon" -ð“¥ishap á‰ishap â±±ishap +##### Ñ´ishap -#### To be left out? +Vishaps are dragons inhabiting the Armenian Highlands. +We decided to name the project “Vishap†because ties between compilers and dragons have ancient traditions. -Work on other compatibility layers is in progress. -voc team also works on bindings to existing C/Pascal libraries. +Also, Vishaps are known in tales, fiction. [This page](http://blog.fogus.me/2015/04/27/six-works-of-computer-science-fiction/) refers to some technologies as “computer science fictionâ€. Among them to Oberon. This brings another meaning, Oberon is like aliens, ghosts. And Vishaps. + +##### Oberon - System and Programming Language + +Oberon is a programming language, an operating system and a graphical +user interface. Originally designed and implemented by by Niklaus Wirth and +Jürg Gutknecht at ETH Zürich in the late 1980s, it demonstrates that the +fundamentals of a modern OS and GUI can be implemented in clean and simple code +orders of magnitude smaller than found in contemporary systems. + +The Oberon programming language is an evolution of the Pascal and Modula +languages. While it adds garbage collection, extensible types and (in +Oberon-2) type-bound procedures, it is also simplified following the principals +of Einstein and Antoine de Saint-Exupéry: + +> Make it as simple as possible, but not simpler. (Albert Einstein) + +> Perfection is finally attained not when there is no longer anything to add, but +> when there is no longer anything to take away. (Antoine de Saint-Exupéry, +> translated by Lewis Galantière.) + +### References + +###### Oberon + - [The History of Modula-2 and Oberon](http://people.inf.ethz.ch/wirth/Articles/Modula-Oberon-June.pdf) + - [The Programming Language Oberon](https://www.inf.ethz.ch/personal/wirth/Oberon/Oberon.Report.pdf) + - [Project Oberon: The Design of an Operating System and Compiler ](http://www.ethoberon.ethz.ch/WirthPubl/ProjectOberon.pdf) + - [Oberon - the Overlooked Jewel](http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.90.7173&rep=rep1&type=pdf) + +###### Oberon 2 + - [Differences between Oberon and Oberon-2](http://members.home.nl/jmr272/Oberon/Oberon2.Differences.pdf) + - [The Programming Language Oberon-2](http://www.ssw.uni-linz.ac.at/Research/Papers/Oberon2.pdf) + - [Programming in Oberon. Steps beyond Pascal and Modula](www.ethoberon.ethz.ch/WirthPubl/ProgInOberonWR.pdf) + - [The Oakwood Guidelines for Oberon-2 Compiler Developers](http://www.math.bas.bg/bantchev/place/oberon/oakwood-guidelines.pdf) + +###### Oberon 07 + - [Difference between Oberon-07 and Oberon](https://www.inf.ethz.ch/personal/wirth/Oberon/Oberon07.pdf) + - [The Programming Language Oberon-07](https://www.inf.ethz.ch/personal/wirth/Oberon/Oberon07.Report.pdf) + - [Programming in Oberon - a Tutorial](https://www.inf.ethz.ch/personal/wirth/Oberon/PIO.pdf) + +###### Links + - [Niklaus Wirth's personal page at ETH Zurich](https://www.inf.ethz.ch/personal/wirth/) + - [ETH Zurich's Wirth publications page](http://www.ethoberon.ethz.ch/WirthPubl/) + - [Oberon: Steps beyond Pascal and Modula](http://fruttenboel.verhoeven272.nl/Oberon/) diff --git a/doc/Features.md b/doc/Features.md index 64d19e68..e7e8a39d 100644 --- a/doc/Features.md +++ b/doc/Features.md @@ -1,3 +1,5 @@ +#### (Work in progress) + The following Oberon types are independent of compiler size: | Types | Size | diff --git a/doc/History.md b/doc/History.md index 3bfe2a27..6ff44199 100644 --- a/doc/History.md +++ b/doc/History.md @@ -1,3 +1,7 @@ +#### (Work in progress) + + + ### History diff --git a/doc/Installation.md b/doc/Installation.md index fe08aa3d..cf073524 100644 --- a/doc/Installation.md +++ b/doc/Installation.md @@ -1,3 +1,6 @@ +#### (Work in progress) + + ## TODO - Organise into summary and per-platfrom sections - with subsections for linux and BSD variants diff --git a/doc/Porting.md b/doc/Porting.md index 5145e7b9..94707e04 100644 --- a/doc/Porting.md +++ b/doc/Porting.md @@ -1,3 +1,5 @@ +#### (Work in progress) + ### Porting to a new platform Porting to a new 32 or 64 bits platform is usually automatically handled diff --git a/doc/Roadmap.md b/doc/Roadmap.md index 593f9e6f..e99440bd 100644 --- a/doc/Roadmap.md +++ b/doc/Roadmap.md @@ -1,4 +1,6 @@ +#### (Work in progress) + #### Machine size issues I don't see any really good solutions to different machine sizes. Existing code, @@ -83,3 +85,8 @@ address. It would be quite a lot of work! - CASE statements only support INTEGER (with low positive values) and CHAR. - Reject LOOP statements. - All imported variables are read-only. + +#### To be left out? + +Work on other compatibility layers is in progress. +voc team also works on bindings to existing C/Pascal libraries. diff --git a/src/system/SYSTEM.h b/src/system/SYSTEM.h index f9e2f930..41ef9995 100644 --- a/src/system/SYSTEM.h +++ b/src/system/SYSTEM.h @@ -49,7 +49,7 @@ #define LONGREAL double #define SYSTEM_PTR void* -// For 32 bit builds, the size of LONGINT depends on a make option: +// For 32 bit builds, the size of LONGINT depends on a make option: #if (__SIZEOF_POINTER__ == 8) || defined(LARGE) || defined(_WIN64) #define INTEGER int // INTEGER is 32 bit. @@ -126,21 +126,21 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __GET(a, x, t) x= *(t*)(uintptr_t)(a) #define __PUT(a, x, t) *(t*)(uintptr_t)(a)=x + #define __LSHL(x, n, t) ((t)((unsigned t)(x)<<(n))) #define __LSHR(x, n, t) ((t)((unsigned t)(x)>>(n))) #define __LSH(x, n, t) ((n)>=0? __LSHL(x, n, t): __LSHR(x, -(n), t)) -#define __ROTL(x, n, t) ((t)((unsigned t)(x)<<(n)|(unsigned t)(x)>>(8*sizeof(t)-(n)))) -#define __ROTR(x, n, t) ((t)((unsigned t)(x)>>(n)|(unsigned t)(x)<<(8*sizeof(t)-(n)))) -#define __LSHR(x, n, t) ((t)((unsigned t)(x)>>(n))) -#define __LSH(x, n, t) ((n)>=0? __LSHL(x, n, t): __LSHR(x, -(n), t)) -#define __ROTL(x, n, t) ((t)((unsigned t)(x)<<(n)|(unsigned t)(x)>>(8*sizeof(t)-(n)))) -#define __ROTR(x, n, t) ((t)((unsigned t)(x)>>(n)|(unsigned t)(x)<<(8*sizeof(t)-(n)))) -#define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) -#define __BIT(x, n) (*(unsigned LONGINT*)(x)>>(n)&1) -#define __MOVE(s, d, n) memcpy((char*)(uintptr_t)(d),(char*)(uintptr_t)(s),n) + #define __ASHL(x, n) ((LONGINT)(x)<<(n)) #define __ASHR(x, n) ((LONGINT)(x)>>(n)) #define __ASH(x, n) ((n)>=0?__ASHL(x,n):__ASHR(x,-(n))) + +#define __ROTL(x, n, t) ((t)((unsigned t)(x)<<(n)|(unsigned t)(x)>>(8*sizeof(t)-(n)))) +#define __ROTR(x, n, t) ((t)((unsigned t)(x)>>(n)|(unsigned t)(x)<<(8*sizeof(t)-(n)))) +#define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) + +#define __BIT(x, n) (*(unsigned LONGINT*)(x)>>(n)&1) +#define __MOVE(s, d, n) memcpy((char*)(uintptr_t)(d),(char*)(uintptr_t)(s),n) #define __ASHF(x, n) SYSTEM_ASH((LONGINT)(x), (LONGINT)(n)) #define __SHORT(x, y) ((int)((unsigned LONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) #define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) From d50e08ac3fb5bef8dbd5e0e6babb41a473ce0524 Mon Sep 17 00:00:00 2001 From: David Brown Date: Wed, 6 Jul 2016 18:55:56 +0100 Subject: [PATCH 139/580] Buildall.pl script switched to master branch. --- src/tools/make/buildall.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/make/buildall.pl b/src/tools/make/buildall.pl index c290b942..ed290b81 100755 --- a/src/tools/make/buildall.pl +++ b/src/tools/make/buildall.pl @@ -4,7 +4,7 @@ use warnings; use POSIX "strftime"; use Cwd; -my $branch = "v2docs"; +my $branch = "master"; my %machines = ( "pi" => ['pi@pie', "sudo", "projects/oberon/vishap/voc"], From 56256a49f29c36b4e6eaa6f7e9af30900907660a Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 8 Jul 2016 12:53:30 +0100 Subject: [PATCH 140/580] Fix hex parsing, readme typos. --- ReadMe.md | 2 +- doc/Installation.md | 2 +- doc/Roadmap.md | 23 +++++++++++++++++++++++ src/compiler/OPM.cmdln.Mod | 1 - src/compiler/OPS.Mod | 7 ++++--- 5 files changed, 29 insertions(+), 6 deletions(-) diff --git a/ReadMe.md b/ReadMe.md index d28b2796..0f1c190d 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -195,7 +195,7 @@ of Einstein and Antoine de Saint-Exupéry: ###### Oberon 2 - [Differences between Oberon and Oberon-2](http://members.home.nl/jmr272/Oberon/Oberon2.Differences.pdf) - [The Programming Language Oberon-2](http://www.ssw.uni-linz.ac.at/Research/Papers/Oberon2.pdf) - - [Programming in Oberon. Steps beyond Pascal and Modula](www.ethoberon.ethz.ch/WirthPubl/ProgInOberonWR.pdf) + - [Programming in Oberon. Steps beyond Pascal and Modula](http://www.ethoberon.ethz.ch/WirthPubl/ProgInOberonWR.pdf) - [The Oakwood Guidelines for Oberon-2 Compiler Developers](http://www.math.bas.bg/bantchev/place/oberon/oakwood-guidelines.pdf) ###### Oberon 07 diff --git a/doc/Installation.md b/doc/Installation.md index cf073524..64c50555 100644 --- a/doc/Installation.md +++ b/doc/Installation.md @@ -32,7 +32,7 @@ The following type sizes follow the built compiler size: | Types | 32 bit builds | 64 bit builds | | ----- | ------------- | ------------- | | INTEGER | 16 bit | 32 bit | -| LONGINT, SET | 32 bit | 16 bit | +| LONGINT, SET | 32 bit | 64 bit | Note that many library modules have been written with the assumption that INTEGER is 16 bit and LONGINT 32 bit, therefore they will only work in 32 bit builds. diff --git a/doc/Roadmap.md b/doc/Roadmap.md index e99440bd..757e8478 100644 --- a/doc/Roadmap.md +++ b/doc/Roadmap.md @@ -66,6 +66,29 @@ means client code does not need changing. This fixes the current 16 bit hole in the range of INTEGER types on 64 bit systems. +#### Oakwood Guidelines on type sizes + +The Oakwood guidelines are interesting. + + - 5.2 requires that e.g. LONGINT is 32 bits *or more*, + +but + - Appendix A 1.2.5.4 requires that MODULE Files *always* reads and writes + LONGINT as 4 bytes. + +The restriction for the Files module makes sense as it is intended to produce +and consume files in a compatible way between platforms. Thus if a system uses +64 bit LONGINT, it is an error (detected or not) to write +to MODULE Files any LONGINT values outside the 32 bit range. + +To put it shockingly, it is an error to write the vast majority of possible +LONGINT values - specifically over 99.998% of LONGINT values are invalid for +MODULE Files. + +I see this as another argument in favour of locking LONGINT down as 32 bits. + + + #### A feature I'd really like to see diff --git a/src/compiler/OPM.cmdln.Mod b/src/compiler/OPM.cmdln.Mod index 32b95689..5bd9b015 100644 --- a/src/compiler/OPM.cmdln.Mod +++ b/src/compiler/OPM.cmdln.Mod @@ -31,7 +31,6 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) MaxRExp* = 38; MaxLExp* = 308; - MaxHDig* = 8; MinHaltNr* = 0; MaxHaltNr* = 255; diff --git a/src/compiler/OPS.Mod b/src/compiler/OPS.Mod index 53d7e2e7..8514886c 100644 --- a/src/compiler/OPS.Mod +++ b/src/compiler/OPS.Mod @@ -90,7 +90,7 @@ MODULE OPS; (* NW, RC 6.3.89 / 18.10.92 *) (* object model 3.6.92 *) END Identifier; PROCEDURE Number; - VAR i, m, n, d, e: INTEGER; dig: ARRAY 24 OF CHAR; f: LONGREAL; expCh: CHAR; neg: BOOLEAN; + VAR i, m, n, d, e, maxHdig: INTEGER; dig: ARRAY 24 OF CHAR; f: LONGREAL; expCh: CHAR; neg: BOOLEAN; PROCEDURE Ten(e: INTEGER): LONGREAL; VAR x, p: LONGREAL; @@ -136,8 +136,9 @@ MODULE OPS; (* NW, RC 6.3.89 / 18.10.92 *) (* object model 3.6.92 *) ELSE err(203) END ELSIF ch = "H" THEN (* hexadecimal *) OPM.Get(ch); numtyp := integer; - IF n <= OPM.MaxHDig THEN - IF (n = OPM.MaxHDig) & (dig[0] > "7") THEN (* prevent overflow *) intval := -1 END; + IF MAX(LONGINT) > 2147483647 THEN maxHdig := 16 ELSE maxHdig := 8 END; + IF n <= maxHdig THEN + IF (n = maxHdig) & (dig[0] > "7") THEN (* prevent overflow *) intval := -1 END; WHILE i < n DO intval := intval*10H + Ord(dig[i], TRUE); INC(i) END ELSE err(203) END From 2a352ff67bfe3311f8f2b08deaaa1d6154e3bfcb Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 8 Jul 2016 17:17:09 +0100 Subject: [PATCH 141/580] Add cygwin32 build and more thoughts on 64 bit support and runtime error reporting. --- doc/Roadmap.md | 35 +++++++++++++++++++++++++++++++++++ src/tools/make/buildall.pl | 19 ++++++++++--------- 2 files changed, 45 insertions(+), 9 deletions(-) diff --git a/doc/Roadmap.md b/doc/Roadmap.md index 757e8478..5fac7121 100644 --- a/doc/Roadmap.md +++ b/doc/Roadmap.md @@ -87,8 +87,33 @@ MODULE Files. I see this as another argument in favour of locking LONGINT down as 32 bits. +#### It's all the same to C +It should be possible to make the 32/64 bit compilation a compiler option +available whether the compiler binary itself was built with 32 or 64 bit C. +Indeed - is there any benefit in a 64 bit compiler binary? A 32 bit compiler +binary will be smaller and faster. The memory requirements of the compiler are +orders of magnitude less than those that would need a 64 bit implementation. + +The only need for a 64 bit compiler binary is for systems that can only run +64 bit binaries. + +Point being - the bit size of the compiler binary should be independent of the +bit size of the target machine of the C code being generated. + +So the compiler options could be: + + 1. Generated binary bit size - 32 or 64 bit. Determines bit size of + SYSTEM.ADDRESS. Add 16 bit option for controllers. + 2. Size of INTEGER, SET and LONGINT. Defaulting to 16,32,32 the parameter would + also allow 32/64/64. + +The libraries would be written and compiled to handle all cases. e.g. + - A WriteInt routine needs it's value parameter to accept integers of all + sizes and would be coded as LONG64. + - ReadInt is slightly more difficult because the parameter is VAR. Make the + parameter ARRAY OF BYTE and process according to SIZE(param). #### A feature I'd really like to see @@ -100,6 +125,14 @@ least by 1975. This could be achieved by including a table of .Mod file line number vs code address, and having the runtime seach this table for the failure address. It would be quite a lot of work! +The current position tracking code in the compiler is buggy - for example the +position at the end of the `expr` in `WHILE expr DO stmt END` is recorded as +the position of the END when it should be of the 'DO'. This makes compiler error +reporting a bit unhelpful, but it's worse for runtime error reporting as we end +up with duplicate entries in the line number table. The position handling code +is somewhat obscure as it uses a convenient but misnamed spare integer field in +the symbol record and it's difficult to follow just when it patches it. + #### Oberon 07/15 mode - Add standard BYTE type being an unsigned integer between 0 and 255. @@ -109,6 +142,8 @@ address. It would be quite a lot of work! - Reject LOOP statements. - All imported variables are read-only. +See [Difference between Oberon-07 and Oberon](https://www.inf.ethz.ch/personal/wirth/Oberon/Oberon07.pdf). + #### To be left out? Work on other compatibility layers is in progress. diff --git a/src/tools/make/buildall.pl b/src/tools/make/buildall.pl index ed290b81..20031295 100755 --- a/src/tools/make/buildall.pl +++ b/src/tools/make/buildall.pl @@ -7,13 +7,14 @@ use Cwd; my $branch = "master"; my %machines = ( - "pi" => ['pi@pie', "sudo", "projects/oberon/vishap/voc"], - "darwin" => ['dave@dcb', "sudo", "projects/oberon/vishap/voc"], - "lub32" => ['dave@lub32', "sudo", "vishap/voc"], - "ob32" => ['root@nas-ob32', "", "vishap/voc"], - "ce64" => ['-p5922 obe@www', "sudo", "vishap/voc"], - "ub64" => ['dave@nas-ub64', "sudo", "vishap/voc"], - "fb64" => ['root@oberon', "", "vishap/voc"] + "pi" => ['pi@pie', "sudo", "make full", "projects/oberon/vishap/voc"], + "darwin" => ['dave@dcb', "sudo", "make full", "projects/oberon/vishap/voc"], + "wind" => ['-p5932 dave@wax', "", "make full", "vishaps/voc"], + "lub32" => ['dave@lub32', "sudo", "make full", "vishap/voc"], + "ob32" => ['root@nas-ob32', "", "make full", "vishap/voc"], + "ce64" => ['-p5922 obe@www', "sudo", "make full", "vishap/voc"], + "ub64" => ['dave@nas-ub64', "sudo", "make full", "vishap/voc"], + "fb64" => ['root@oberon', "", "make full", "vishap/voc"] ); @@ -45,8 +46,8 @@ sub logged { unlink glob "log/*"; for my $machine (sort keys %machines) { - my ($login, $sudo, $dir) = @{$machines{$machine}}; - my $cmd = "ssh $login \"cd $dir && $sudo git checkout $branch && $sudo git pull && $sudo make full\" "; + my ($login, $sudo, $mkcmd, $dir) = @{$machines{$machine}}; + my $cmd = "ssh $login \"cd $dir && $sudo git checkout $branch && $sudo git pull && $sudo $mkcmd\" "; logged($cmd, $machine); } From 9ad2a8682757ff2b9d0631dbcb4f175d307ed415 Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 8 Jul 2016 18:33:51 +0100 Subject: [PATCH 142/580] Try adding a TOC to the readme, and formatting the hello app code. --- ReadMe.md | 76 ++++++++++++++++++++++++++++++++++--------------------- 1 file changed, 47 insertions(+), 29 deletions(-) diff --git a/ReadMe.md b/ReadMe.md index 0f1c190d..47ee2acf 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -1,6 +1,6 @@ ![Build status](http://brownsmeet.com/build-status.svg) -## Ñ´ishap Oberon +# Ñ´ishap Oberon [Ñ´ishap Oberon](http://oberon.vishap.am) is a free and open source (GPLv3) implementation of the Oberon-2 language and libraries for use on @@ -11,9 +11,23 @@ Oberon programs under Unix, Mac or Windows. Vishap Oberon includes libraries from the Ulm, oo2c and Ofront Oberon compilers, as well as default libraries complying with the Oakwood Guidelines for Oberon-2 compilers. -### Installation +###### Contents -##### Prerequisites +> [Installation](#installation) +> [A 'Hello' application](#a-hello-application) +> [Licensing](#licensing) +> [Platform support and porting](#platform-support-and-porting) +> [Language support and libraries](#language-support-and-libraries) +> [History](#history) +> [Roadmap](#roadmap) +> [Contributors](#contributors) +> [Origin of the name "Ñ´ishap Oberon"](#origin-of-the-name-Ñ´ishap-oberon) +> [References](#references) + + +## Installation + +###### Prerequisites | Platform | Packages | | --------- | ------------ | @@ -25,7 +39,7 @@ default libraries complying with the Oakwood Guidelines for Oberon-2 compilers. More details, including for MingW and MS C, in [Installation](/doc/Installation.md). -##### Build and install +###### Build and install 1. `git clone https://github.com/vishaps/voc` 2. `cd voc` @@ -33,7 +47,7 @@ More details, including for MingW and MS C, in [Installation](/doc/Installation. Since 'make full' will install the compiler and libraries, it needs root (unix) or administrator (windows) privileges. -##### PATH environment variable +###### PATH environment variable Set your path to the installed compiler binary location as reported by make full, e.g. @@ -47,27 +61,31 @@ by make full, e.g. Also see [Installation](/doc/Installation.md). -### A 'Hello' application +## A 'Hello' application Anything appended to Oberon.Log is automatically displayed on the console, so the following conventional Oberon program will display 'Hello.': - MODULE hello; - IMPORT Oberon, Texts; - VAR W: Texts.Writer; - BEGIN - Texts.OpenWriter(W); - Texts.WriteString(W, "Hello."); Texts.WriteLn(W); - Texts.Append(Oberon.Log, W.buf) - END hello. +```Modula-2 +MODULE hello; + IMPORT Oberon, Texts; + VAR W: Texts.Writer; +BEGIN + Texts.OpenWriter(W); + Texts.WriteString(W, "Hello."); Texts.WriteLn(W); + Texts.Append(Oberon.Log, W.buf) +END hello. +``` Alternatively the Console may be accessed directly as follows: - MODULE hello; - IMPORT Console; - BEGIN - Console.String("Hello."); Console.Ln; - END hello. +```Modula-2 +MODULE hello; + IMPORT Console; +BEGIN + Console.String("Hello."); Console.Ln; +END hello. +``` Compile as follows: @@ -81,7 +99,7 @@ Execute as usual on Linux ('./hello') or Windows ('hello'). Also see [Compiling](/doc/Compiling.md). -### Licensing +## Licensing Vishap Oberon's frontend and C backend engine is a fork of Josef Templ’s Ofront, which has been released under the FreeBSD License. Unlike Ofront, Vishap Oberon does not include the Oberon v4 environment. @@ -94,7 +112,7 @@ Voc tools are distributed under GPLv3. Most of the runtime in libVishapOberon is distributed under GPLv3 with runtime exception. -### Platform support and porting +## Platform support and porting Vishap Oberon supports 32 and 64 bit little-endian architectures including Intel x86 and x64, arm and ppc. @@ -118,7 +136,7 @@ In some cases manual work will be required: For details, see [Porting](/doc/Porting.md). -### Language support and libraries +## Language support and libraries Vishap Oberon supports the Oberon 2 programming language, including type-bound procedures. @@ -137,15 +155,15 @@ Some other freely redistributable libraries are available as a part of voc distr See also [Features](/doc/Features.md). -### History +## History See [History](/doc/History.md). -### Roadmap +## Roadmap See [Roadmap](/doc/Roadmap.md). -### Contributors +## Contributors Originally developed as a cross platform implementation of the Oberon system by Joseph Templ. @@ -156,16 +174,16 @@ to new platforms by Norayr Chilingarian. Build process simplified for more platform support and bugs fixed by David C W Brown. -### Origin of the name "Ñ´ishap Oberon" +## Origin of the name "Ñ´ishap Oberon" -##### Ñ´ishap +###### Ñ´ishap Vishaps are dragons inhabiting the Armenian Highlands. We decided to name the project “Vishap†because ties between compilers and dragons have ancient traditions. Also, Vishaps are known in tales, fiction. [This page](http://blog.fogus.me/2015/04/27/six-works-of-computer-science-fiction/) refers to some technologies as “computer science fictionâ€. Among them to Oberon. This brings another meaning, Oberon is like aliens, ghosts. And Vishaps. -##### Oberon - System and Programming Language +###### Oberon - System and Programming Language Oberon is a programming language, an operating system and a graphical user interface. Originally designed and implemented by by Niklaus Wirth and @@ -184,7 +202,7 @@ of Einstein and Antoine de Saint-Exupéry: > when there is no longer anything to take away. (Antoine de Saint-Exupéry, > translated by Lewis Galantière.) -### References +## References ###### Oberon - [The History of Modula-2 and Oberon](http://people.inf.ethz.ch/wirth/Articles/Modula-Oberon-June.pdf) From b445d95772aa1e9c9734bc62a1a324b9cd9e82f1 Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 8 Jul 2016 22:47:40 +0100 Subject: [PATCH 143/580] Use source diff to identify compiler changes. --- makefile | 5 +++- src/tools/make/pt.pl | 42 +++++++++++++++++---------------- src/tools/make/sourcechanges.sh | 33 ++++++++++++++++++++++++++ src/tools/make/vishap.make | 4 ++-- 4 files changed, 61 insertions(+), 23 deletions(-) create mode 100644 src/tools/make/sourcechanges.sh diff --git a/makefile b/makefile index 1b18dec3..076a2218 100644 --- a/makefile +++ b/makefile @@ -135,6 +135,7 @@ full: configuration @make -f src/tools/make/vishap.make -s installable @make -f src/tools/make/vishap.make -s clean # Make bootstrap compiler from source suitable for current data model + @printf "\n\n--- Compiler build started ---\n\n" @make -f src/tools/make/vishap.make -s compilerfromsavedsource # Use bootstrap compiler to make compiler binary from latest compiler sources @make -f src/tools/make/vishap.make -s translate @@ -144,10 +145,12 @@ full: configuration @make -f src/tools/make/vishap.make -s assemble @printf "\n\n--- Compiler build successfull ---\n\n" @make -f src/tools/make/vishap.make -s browsercmd + @printf "\n\n--- Library build started ---\n\n" @make -f src/tools/make/vishap.make -s library @printf "\n\n--- Library build successfull ---\n\n" - @make -f src/tools/make/vishap.make -s checksum + @make -f src/tools/make/vishap.make -s sourcechanges @make -f src/tools/make/vishap.make -s install + @printf "\n\n--- Confidence tests started ---\n\n" @make -f src/tools/make/vishap.make -s confidence @make -f src/tools/make/vishap.make -s showpath diff --git a/src/tools/make/pt.pl b/src/tools/make/pt.pl index 0c3243c1..e8da4b4b 100755 --- a/src/tools/make/pt.pl +++ b/src/tools/make/pt.pl @@ -12,33 +12,35 @@ my %status = (); sub parselog { my ($fn) = @_; #print "Parsing log $fn\n"; - my $date = ""; - my $time = ""; - my $branch = ""; - my $os = ""; - my $compiler = ""; - my $datamodel = ""; - my $compilerok = ""; - my $libraryok = ""; - my $checksum = ""; - my $tests = ""; + my $date = ""; + my $time = ""; + my $branch = ""; + my $os = ""; + my $compiler = ""; + my $datamodel = ""; + my $compilerok = ""; + my $libraryok = ""; + my $sourcechange = ""; + my $tests = ""; open(my $log, $fn) // die "Couldn't open build log $fn."; while (<$log>) { if (/^([0-9\/]+) [0-9.]+ [^ ]+\.log$/) {$date = $1;} if (/^[^ ]+ --- Cleaning branch ([^ ]+) ([^ ]+) ([^ ]+) ([^ ]+) ---$/) { ($branch, $os, $compiler, $datamodel) = ($1, $2, $3, $4, $5); } - if (/^([0-9.]+) --- Compiler build successfull ---$/) {$compilerok = "Built";} - if (/^([0-9.]+) --- Library build successfull ---$/) {$libraryok = "Built";} - if (/^([0-9.]+) --- Confidence tests passed ---$/) {$tests = "Passed";} - if (/^([0-9.]+) --- Object file checksums match ---$/) {$checksum = "Match";} - if (/^([0-9.]+) --- Object file checksum mismatch ---$/) {$checksum = "Changed";} - if (/^([0-9.]+) --- Object files checksummed ---$/) {$checksum = "New";} + if (/^([0-9.]+) --- Compiler build started ---$/) {$compilerok = "Started";} + if (/^([0-9.]+) --- Compiler build successfull ---$/) {$compilerok = "Built";} + if (/^([0-9.]+) --- Library build started ---$/) {$libraryok = "Started";} + if (/^([0-9.]+) --- Library build successfull ---$/) {$libraryok = "Built";} + if (/^([0-9.]+) --- Generated c source files match bootstrap ---$/) {$sourcechange = "Unchanged";} + if (/^([0-9.]+) --- Generated c source files differ from bootstrap ---$/) {$sourcechange = "Changed";} + if (/^([0-9.]+) --- Confidence tests started ---$/) {$tests = "Started";} + if (/^([0-9.]+) --- Confidence tests passed ---$/) {$tests = "Passed";} } close($log); my $key = "$os-$compiler-$datamodel"; if ($key ne "") { - $status{$key} = [$date, $time, $os, $compiler, $datamodel, $branch, $compilerok, $libraryok, $checksum, $tests]; + $status{$key} = [$date, $time, $os, $compiler, $datamodel, $branch, $compilerok, $libraryok, $sourcechange, $tests]; } } @@ -86,19 +88,19 @@ svgtext($svg, $col2, 0, "#e0e0e0", "Compiler"); svgtext($svg, $col3, 0, "#e0e0e0", "Data model"); svgtext($svg, $col4, 0, "#e0e0e0", "Compiler"); svgtext($svg, $col5, 0, "#e0e0e0", "Library"); -svgtext($svg, $col6, 0, "#e0e0e0", "Checksum"); +svgtext($svg, $col6, 0, "#e0e0e0", "C Source"); svgtext($svg, $col7, 0, "#e0e0e0", "Tests"); my $i=1; for my $key (sort keys %status) { my ($date, $time, $os, $compiler, $datamodel, - $branch, $compilerok, $libraryok, $checksum, $tests) = @{$status{$key}}; + $branch, $compilerok, $libraryok, $sourcechange, $tests) = @{$status{$key}}; svgtext($svg, $col1, $i, "#c0c0c0", $os); svgtext($svg, $col2, $i, "#c0c0c0", $compiler); svgtext($svg, $col3, $i, "#c0c0c0", $datamodel); svgtext($svg, $col4, $i, "#60ff60", $compilerok); svgtext($svg, $col5, $i, "#60ff60", $libraryok); - svgtext($svg, $col6, $i, "#60ff60", $checksum); + svgtext($svg, $col6, $i, "#60ff60", $sourcechange); svgtext($svg, $col7, $i, "#60ff60", $tests); $i++; } diff --git a/src/tools/make/sourcechanges.sh b/src/tools/make/sourcechanges.sh new file mode 100644 index 00000000..47129832 --- /dev/null +++ b/src/tools/make/sourcechanges.sh @@ -0,0 +1,33 @@ +# Source change tests. +# +# Compares compiler source files against the appropriate bootstrap source. +# The voc compiler version comment line is skipped. +# +# Parameters +# +# $1 - bootstrap directory +# +# Assumptions +# +# The current directory is the build directory + +changes="0" +for f in $1/*; do + fn=$(basename $f) + egrep -v "^/\* voc " $f >$fn.old + egrep -v "^/\* voc " $fn >$fn.new + if ! diff --tabsize=2 -U 2 -b $fn.old $fn.new >$fn.diff; then + echo "" + echo "" + cat $fn.diff + changes=1; + fi + rm -f $fn.old $fn.new $fn.diff +done +echo "" +if [ $changes == "0" ]; then + echo "--- Generated c source files match bootstrap ---" +else + echo "--- Generated c source files differ from bootstrap ---" +fi +echo "" diff --git a/src/tools/make/vishap.make b/src/tools/make/vishap.make index 4cbbf52e..544b6708 100644 --- a/src/tools/make/vishap.make +++ b/src/tools/make/vishap.make @@ -363,8 +363,8 @@ library: v4 ooc2 ooc ulm pow32 misc s3 librarybinary -checksum: - @cd $(BUILDDIR) && sh $(ROOTDIR)/src/tools/make/checksumtest.sh $(ROOTDIR)/$(BUILDDIR).$(BRANCH).md5 +sourcechanges: + @cd $(BUILDDIR) && sh $(ROOTDIR)/src/tools/make/sourcechanges.sh $(ROOTDIR)/bootstrap/$(PLATFORM)-$(ADRSIZE)$(ALIGNMENT) From 365275ebcd1fbef40b8fc123816344ca42f53eab Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 8 Jul 2016 22:59:58 +0100 Subject: [PATCH 144/580] Check in buildall.pl changes too. Oops. --- src/tools/make/buildall.pl | 42 ++++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/src/tools/make/buildall.pl b/src/tools/make/buildall.pl index 20031295..ee4bbeac 100755 --- a/src/tools/make/buildall.pl +++ b/src/tools/make/buildall.pl @@ -63,33 +63,35 @@ my %status = (); sub parselog { my ($fn) = @_; #print "Parsing log $fn\n"; - my $date = ""; - my $time = ""; - my $branch = ""; - my $os = ""; - my $compiler = ""; - my $datamodel = ""; - my $compilerok = ""; - my $libraryok = ""; - my $checksum = ""; - my $tests = ""; + my $date = ""; + my $time = ""; + my $branch = ""; + my $os = ""; + my $compiler = ""; + my $datamodel = ""; + my $compilerok = ""; + my $libraryok = ""; + my $sourcechange = ""; + my $tests = ""; open(my $log, $fn) // die "Couldn't open build log $fn."; while (<$log>) { if (/^([0-9\/]+) [0-9.]+ [^ ]+\.log$/) {$date = $1;} if (/^[^ ]+ --- Cleaning branch ([^ ]+) ([^ ]+) ([^ ]+) ([^ ]+) ---$/) { ($branch, $os, $compiler, $datamodel) = ($1, $2, $3, $4, $5); } - if (/^([0-9.]+) --- Compiler build successfull ---$/) {$compilerok = "Built";} - if (/^([0-9.]+) --- Library build successfull ---$/) {$libraryok = "Built";} - if (/^([0-9.]+) --- Confidence tests passed ---$/) {$tests = "Passed";} - if (/^([0-9.]+) --- Object file checksums match ---$/) {$checksum = "Unchanged";} - if (/^([0-9.]+) --- Object file checksum mismatch ---$/) {$checksum = "Changed";} - if (/^([0-9.]+) --- Object files checksummed ---$/) {$checksum = "New";} + if (/^([0-9.]+) --- Compiler build started ---$/) {$compilerok = "Started";} + if (/^([0-9.]+) --- Compiler build successfull ---$/) {$compilerok = "Built";} + if (/^([0-9.]+) --- Library build started ---$/) {$libraryok = "Started";} + if (/^([0-9.]+) --- Library build successfull ---$/) {$libraryok = "Built";} + if (/^([0-9.]+) --- Generated c source files match bootstrap ---$/) {$sourcechange = "Unchanged";} + if (/^([0-9.]+) --- Generated c source files differ from bootstrap ---$/) {$sourcechange = "Changed";} + if (/^([0-9.]+) --- Confidence tests started ---$/) {$tests = "Started";} + if (/^([0-9.]+) --- Confidence tests passed ---$/) {$tests = "Passed";} } close($log); my $key = "$os-$compiler-$datamodel"; if ($key ne "") { - $status{$key} = [$fn, $date, $time, $os, $compiler, $datamodel, $branch, $compilerok, $libraryok, $checksum, $tests]; + $status{$key} = [$fn, $date, $time, $os, $compiler, $datamodel, $branch, $compilerok, $libraryok, $sourcechange, $tests]; } } @@ -143,20 +145,20 @@ svgtext($svg, $col2, 0, "#e0e0e0", "Compiler"); svgtext($svg, $col3, 0, "#e0e0e0", "Data model"); svgtext($svg, $col4, 0, "#e0e0e0", "Compiler"); svgtext($svg, $col5, 0, "#e0e0e0", "Library"); -svgtext($svg, $col6, 0, "#e0e0e0", "Checksum"); +svgtext($svg, $col6, 0, "#e0e0e0", "C Source"); svgtext($svg, $col7, 0, "#e0e0e0", "Tests"); my $i=1; for my $key (sort keys %status) { my ($fn, $date, $time, $os, $compiler, $datamodel, $branch, - $compilerok, $libraryok, $checksum, $tests) = @{$status{$key}}; + $compilerok, $libraryok, $sourcechange, $tests) = @{$status{$key}}; print $svg ''; svgtext($svg, $col1, $i, "#c0c0c0", $os); svgtext($svg, $col2, $i, "#c0c0c0", $compiler); svgtext($svg, $col3, $i, "#c0c0c0", $datamodel); svgtext($svg, $col4, $i, "#60ff60", $compilerok); svgtext($svg, $col5, $i, "#60ff60", $libraryok); - svgtext($svg, $col6, $i, "#60ff60", $checksum); + svgtext($svg, $col6, $i, "#60ff60", $sourcechange); svgtext($svg, $col7, $i, "#60ff60", $tests); print $svg ''; $i++; From 92e2c51806dffced315b6ddda62f72bf91a6687d Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 8 Jul 2016 23:28:51 +0100 Subject: [PATCH 145/580] Move version string physically into Version binary, fix diff parm on centos. --- src/tools/make/configure.c | 5 +- src/tools/make/pt.pl | 110 -------------------------------- src/tools/make/sourcechanges.sh | 2 +- 3 files changed, 5 insertions(+), 112 deletions(-) delete mode 100755 src/tools/make/pt.pl diff --git a/src/tools/make/configure.c b/src/tools/make/configure.c index 1117962f..0ec8e6b1 100644 --- a/src/tools/make/configure.c +++ b/src/tools/make/configure.c @@ -394,7 +394,6 @@ void writeConfigurationMod() { fprintf(fd, "MODULE Configuration;\n"); fprintf(fd, "CONST\n"); fprintf(fd, " name* = '%s';\n", oname); - fprintf(fd, " versionLong* = '%s';\n", versionstring); fprintf(fd, " intsize* = %d;\n", intsize); fprintf(fd, " addressSize* = %d;\n", addressSize); fprintf(fd, " alignment* = %d;\n", alignment); @@ -406,6 +405,10 @@ void writeConfigurationMod() { fprintf(fd, " dataModel* = '%s';\n", dataModel); fprintf(fd, " installdir* = '%s';\n", installdir); fprintf(fd, " staticLink* = '%s';\n", staticlink); + fprintf(fd, "VAR\n"); + fprintf(fd, " versionLong-: ARRAY %d OF CHAR;\n", strnlen(versionstring, 100)+1); + fprintf(fd, "BEGIN\n"); + fprintf(fd, " versionLong := '%s';\n", versionstring); fprintf(fd, "END Configuration.\n"); fclose(fd); diff --git a/src/tools/make/pt.pl b/src/tools/make/pt.pl deleted file mode 100755 index e8da4b4b..00000000 --- a/src/tools/make/pt.pl +++ /dev/null @@ -1,110 +0,0 @@ -#!perl -w -use strict; -use warnings; -use POSIX "strftime"; - - - - -my %status = (); - - -sub parselog { - my ($fn) = @_; - #print "Parsing log $fn\n"; - my $date = ""; - my $time = ""; - my $branch = ""; - my $os = ""; - my $compiler = ""; - my $datamodel = ""; - my $compilerok = ""; - my $libraryok = ""; - my $sourcechange = ""; - my $tests = ""; - open(my $log, $fn) // die "Couldn't open build log $fn."; - while (<$log>) { - if (/^([0-9\/]+) [0-9.]+ [^ ]+\.log$/) {$date = $1;} - if (/^[^ ]+ --- Cleaning branch ([^ ]+) ([^ ]+) ([^ ]+) ([^ ]+) ---$/) { - ($branch, $os, $compiler, $datamodel) = ($1, $2, $3, $4, $5); - } - if (/^([0-9.]+) --- Compiler build started ---$/) {$compilerok = "Started";} - if (/^([0-9.]+) --- Compiler build successfull ---$/) {$compilerok = "Built";} - if (/^([0-9.]+) --- Library build started ---$/) {$libraryok = "Started";} - if (/^([0-9.]+) --- Library build successfull ---$/) {$libraryok = "Built";} - if (/^([0-9.]+) --- Generated c source files match bootstrap ---$/) {$sourcechange = "Unchanged";} - if (/^([0-9.]+) --- Generated c source files differ from bootstrap ---$/) {$sourcechange = "Changed";} - if (/^([0-9.]+) --- Confidence tests started ---$/) {$tests = "Started";} - if (/^([0-9.]+) --- Confidence tests passed ---$/) {$tests = "Passed";} - } - close($log); - my $key = "$os-$compiler-$datamodel"; - if ($key ne "") { - $status{$key} = [$date, $time, $os, $compiler, $datamodel, $branch, $compilerok, $libraryok, $sourcechange, $tests]; - } -} - -opendir DIR, "log" // die "Could not open log directory."; -my @logs = readdir DIR; -closedir DIR; - -for my $logname (sort @logs) { - $logname = "log/" . $logname; - #print "Consider $logname\n"; - if (-f $logname) {parselog($logname);} -} - -my $emsperline = 1.2; - -sub svgtext { - my ($f, $x, $y, $colour, $msg) = @_; - print $f ''; - print $f $msg; - print $f "\n"; -} - -my $rows = keys %status; - -open(my $svg, ">build-status.svg") // die "Could not create build-status.svg."; -print $svg '', "\n"; -print $svg '', "\n"; - -my $col1 = 20; -my $col2 = 110; -my $col3 = 200; -my $col4 = 310; -my $col5 = 400; -my $col6 = 490; -my $col7 = 580; - -svgtext($svg, $col1, 0, "#e0e0e0", "OS"); -svgtext($svg, $col2, 0, "#e0e0e0", "Compiler"); -svgtext($svg, $col3, 0, "#e0e0e0", "Data model"); -svgtext($svg, $col4, 0, "#e0e0e0", "Compiler"); -svgtext($svg, $col5, 0, "#e0e0e0", "Library"); -svgtext($svg, $col6, 0, "#e0e0e0", "C Source"); -svgtext($svg, $col7, 0, "#e0e0e0", "Tests"); - -my $i=1; -for my $key (sort keys %status) { - my ($date, $time, $os, $compiler, $datamodel, - $branch, $compilerok, $libraryok, $sourcechange, $tests) = @{$status{$key}}; - svgtext($svg, $col1, $i, "#c0c0c0", $os); - svgtext($svg, $col2, $i, "#c0c0c0", $compiler); - svgtext($svg, $col3, $i, "#c0c0c0", $datamodel); - svgtext($svg, $col4, $i, "#60ff60", $compilerok); - svgtext($svg, $col5, $i, "#60ff60", $libraryok); - svgtext($svg, $col6, $i, "#60ff60", $sourcechange); - svgtext($svg, $col7, $i, "#60ff60", $tests); - $i++; -} - -print $svg "\n"; - -system 'scp -p build-status.svg dave@hub:/var/www'; diff --git a/src/tools/make/sourcechanges.sh b/src/tools/make/sourcechanges.sh index 47129832..d0ef7e9a 100644 --- a/src/tools/make/sourcechanges.sh +++ b/src/tools/make/sourcechanges.sh @@ -16,7 +16,7 @@ for f in $1/*; do fn=$(basename $f) egrep -v "^/\* voc " $f >$fn.old egrep -v "^/\* voc " $fn >$fn.new - if ! diff --tabsize=2 -U 2 -b $fn.old $fn.new >$fn.diff; then + if ! diff -U 2 -b $fn.old $fn.new >$fn.diff; then echo "" echo "" cat $fn.diff From 89e2616c5bc599415007dee0d7b00a9936aa4f78 Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 8 Jul 2016 23:37:59 +0100 Subject: [PATCH 146/580] Fix equality test in sourcechanges.pl --- src/tools/make/sourcechanges.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/make/sourcechanges.sh b/src/tools/make/sourcechanges.sh index d0ef7e9a..dbb69c59 100644 --- a/src/tools/make/sourcechanges.sh +++ b/src/tools/make/sourcechanges.sh @@ -25,7 +25,7 @@ for f in $1/*; do rm -f $fn.old $fn.new $fn.diff done echo "" -if [ $changes == "0" ]; then +if [ "$changes" = "0" ]; then echo "--- Generated c source files match bootstrap ---" else echo "--- Generated c source files differ from bootstrap ---" From 5c8b98dd05bf78412fdfa0c3772bd7e63e01a2fc Mon Sep 17 00:00:00 2001 From: David Brown Date: Sat, 9 Jul 2016 23:15:02 +0100 Subject: [PATCH 147/580] Don't trigger autobuild when change only affects .md or .svg files. --- src/tools/make/postpush.pl | 50 +++++++++++++++++++++++--------------- 1 file changed, 30 insertions(+), 20 deletions(-) diff --git a/src/tools/make/postpush.pl b/src/tools/make/postpush.pl index 8916e0d1..cbf82ca9 100755 --- a/src/tools/make/postpush.pl +++ b/src/tools/make/postpush.pl @@ -21,29 +21,39 @@ sub writelog { my $postdata = from_json(param('POSTDATA')); -my $url = $postdata->{'repository'}->{'url'}; -my $ref = $postdata->{'ref'}; -my $name = $postdata->{'head_commit'}->{'author'}->{'name'}; +my $url = $postdata->{'repository'}->{'url'}; +my $ref = $postdata->{'ref'}; +my $name = $postdata->{'head_commit'}->{'author'}->{'name'}; +my $branch = $ref; $branch =~ s'^.*\/''; +my $repo = $url; $repo =~ s'^.*\/''; +my $modified = $postdata->{'head_commit'}->{'modified'}; -my $branch = $ref; $branch =~ s'^.*\/''; -my $repo = $url; $repo =~ s'^.*\/''; - -writelog "Post push github web hook for repository $repo, branch $branch, name $name."; - - -my $child = fork; -if (not defined $child) {die "Fork failed.";} -if ($child) { - writelog "Started buildall, pid = $child."; # parent process -} else { - close(STDIN); close(STDOUT); close(STDERR); # child process - unlink "buildall.pl"; - sleep 5; # Leave time for the push to complete. (Yuk!) - system 'wget https://raw.githubusercontent.com/vishaps/voc/v2docs/src/tools/make/buildall.pl'; - exec 'perl buildall.pl >/tmp/buildall.log'; - exit; +my $buildneeded = 0; +for my $file (@{$modified}) { + if ($file !~ m/\.(md|svg)$/i) {$buildneeded = 1;} } +if ($buildneeded) { + writelog "Post push github web hook for repository $repo, branch $branch, name $name. Build required."; + + + my $child = fork; + if (not defined $child) {die "Fork failed.";} + if ($child) { + writelog "Started buildall, pid = $child."; # parent process + } else { + close(STDIN); close(STDOUT); close(STDERR); # child process + unlink "buildall.pl"; + sleep 5; # Leave time for the push to complete. (Yuk!) + system 'wget https://raw.githubusercontent.com/vishaps/voc/master/src/tools/make/buildall.pl'; + exec 'perl buildall.pl >/tmp/buildall.log'; + exit; + } +} else { + writelog "Post push github web hook for repository $repo, branch $branch, name $name. No build required."; +} + + print header(), start_html("Vishap Oberon github post push web hook."), p("Repository $repo, branch $branch, name $name."), From 2c2fa4963cb4faae0ee81035c90519c95d715427 Mon Sep 17 00:00:00 2001 From: David Brown Date: Sun, 10 Jul 2016 14:21:49 +0100 Subject: [PATCH 148/580] Link to build status that can access logs, add date, time and branch to status. --- doc/BasicTypeSize.md | 172 +++++++++++++++++++++++++++++++++ src/tools/make/buildall.pl | 57 ++++++----- src/tools/make/checksumtest.sh | 23 ----- 3 files changed, 205 insertions(+), 47 deletions(-) create mode 100644 doc/BasicTypeSize.md delete mode 100644 src/tools/make/checksumtest.sh diff --git a/doc/BasicTypeSize.md b/doc/BasicTypeSize.md new file mode 100644 index 00000000..ab3364fb --- /dev/null +++ b/doc/BasicTypeSize.md @@ -0,0 +1,172 @@ +## Cross Platform Compatibility and Basic Type Sizes in Vishap Oberon + +###### Abstract + +Vishap Oberon needs to support 32 and 64 bit machine architectures. 16 and +possibly 8 bits would be good too. + +Currently Vishap Oberon has different INTEGER, LONGINT and SET sizes on 16 +and 32 bit architectures. While this enables memory management code to use +LONGINT on all architectures, it breaks library and user code which makes +assumptions about type sizes. + +The goal is to specify changes to the Vishap compiler and library to allow C +code generation for multiple machine architectures without breaking existing +code, and to allow serialized data to be interchangeable between machine +architectures. + +###### Motivation + +Current type sizes are loosely specified and vary between implementations. There +are conflicting general assumptions, for example: that LONGINT is large enough +to contain any machine address; but also that LONGINT always take 32 bits when +serialised to files. (See Oakwood guidelines appendix A 1.2.5.4.) + +The compiler has ended up with a number of INTEGER types, each with its own +set of code to handle declaration, access, storage etc. There is a good +opportunity to refactor and simplify the current duplicated code. + +Neither C's basic types, nor Oberon's are fixed in size. Yet for cross platform +compatability we need fixed size types. + +###### Basis of implementation - integers and sets + +In the generated C code we use these types for all integer and set variables: + +| Unsigned | Signed | Sets | +| ----------- | ----------- | ------ | +| INTEGER_U8 | INTEGER_S8 | SET_8 | +| INTEGER_U16 | INTEGER_S16 | SET_16 | +| INTEGER_U32 | INTEGER_S32 | SET_32 | +| INTEGER_U64 | INTEGER_S64 | SET_64 | + +SYSTEM.H uses conditional compilation to derive these types from the types +available in the C compiler we are building on. + +Then, with suitable compiler options we control the mapping of compiler types +to these C types. + +There are three strategies that clients may wish to use: + +1) Emphasizing compatability with serialised data and existing code. Here + we fix Oberon type sizes across platforms, and introduce a new LONG64 type + as follows: + + | Oberon type | Size | + | ----------- | ---------------- | + | BOOLEAN | 8 bits | + | BYTE | 8 bits unsigned | + | SHORTINT | 8 bits signed | + | INTEGER | 16 bits signed | + | LONGINT | 32 bits signed | + | SET | 32 flag bits | + | LONG64 | 64 bits signed | + + This gives a set of sizes that are available on all platforms (even SDCC + supports 64 bit ints), and which have fixed characteristics (e.g. the size of + character array sufficient to support any LONGINT values is fixed.) + + Note that these sizes match current Vishap Oberon behaviour on x86. + +2) Emphasizing performant maxima. Here we make e.g. LONGINT the largest + efficient size available. On x86 we stick with the sizes as above, but for + x64 we make changes to INTEGER, LONGINT and SET as follows: + + | Oberon type | Size on x64 | + | ----------- | ---------------- | + | INTEGER | 32 bits signed | + | LONGINT | 64 bits signed | + | SET | 64 flag bits | + +3) Supporting system code, especially memory management. + + With SYSTEM imported, we extend the parsing of type INTEGER to accept a + subsequent qualifier which may be U8, S8, U16, S16, U32, S32, U64, S64 or + ADDRESS. + + Thus the type `INTEGER ADDRESS` takes over the role of `LONGINT` in existing + memory management code. The compiler will map `INTEGER ADDRESS` to the + relevant `INTEGER_U32` or `INTEGER_U64` in generated C code. + + Additionally the fixed size qualifiers U8, S8, U16, etc. allow the writing of + Oberon source code that generates the same C code regardless of compilation + options used. + +###### Cross platform libraries + +Many integral input parameters are currently coded as LONGINT with the intention +of accepting any size of integer. E.g. Texts.WriteInt. All such code needs +upgrading to accept LONG64 with implementation changes where necessary to +account for the larger values. Boring, but straightforward. + +Some integral output parameter are currently coded as `VAR LONGINT`, for example +the integer value field `i` in RECORD type `Scanner`. This is a problem: + +Assuming scenario 1 - LONGINT is always 32 bits. + + - If retained as LONGINT, Scanner won't be able to handle 64 bit integers. + - If changed to LONG64, existing code will compile with type compatibility + errors. + +So neither option is possible on its own. + +The simplest workaround is to add a new field `l` and a new scanner class +Long64 (similar to the pair of REAL and LONGREAL values already in Scanner). + +Existing code will continue to work with values in the 32 bit range (which is +OK, because that's all the existing code can generate). New code can allow for +thye LongReal case. + +(Ugly but workable). + +Oakwood says that INTEGER must be stored as 2 bytes little endian, so Files.Mod +must use 16 bits on file for Files.ReadInt and Files.WriteInt. So what happens +in scenario 2 above? Since INTEGER is 32 bits in scenario 2, it would be +necessary to call Files.WriteLInt Files.ReadLInt. This is not obvious, and will +need the coder to work around the apparent type incompatibility. + +If only the type compatibility of passing a smaller integer variable to a larger +value parameter also worked for a larger var parameter. + +Would this be possible? + +e.g. + +```Modula-2 + PROCEDURE p(VAR x: LONGINT); BEGIN ... END p; + + PROCEDURE q; + VAR r: INTEGER; + BEGIN p(r) END q; +``` + +q passes an `INTEGER` to the `VAR x: LONGINT` parameter of p. Normally this +would be a type compatability error. + +If we want to defer value range checking until runtime, the compiler would have +to behave as if q was written with a temp LONGINT variable like this: + +```Modula-2 + PROCEDURE q; + VAR r: INTEGER; temp: LONGINT; + BEGIN p(temp); r := SHORT(temp) END q; +``` + +Not simple enough. + + +###### IMPORT SYSTEM + +With SYSTEM imported, we allow the type INTEGER to be followed by a size and +sign specification consiting of a letter (U for unsigned or S for signed) +followed by a numeric bit count which may be 8, 16, 32 or 64. Additionally +INTEGER may be followed by the word ADDRESS to request an unsigned integer type +of the same size as a machine address. + +Thus we could define + +###### Not supported + +This solution does not seek to handle architectures such as the 8086/80286 where +a generalised address is not a single numeric value. TopSpeed Modula handled +this nicely, but we don't go that far. diff --git a/src/tools/make/buildall.pl b/src/tools/make/buildall.pl index ee4bbeac..14e6cd60 100755 --- a/src/tools/make/buildall.pl +++ b/src/tools/make/buildall.pl @@ -75,7 +75,7 @@ sub parselog { my $tests = ""; open(my $log, $fn) // die "Couldn't open build log $fn."; while (<$log>) { - if (/^([0-9\/]+) [0-9.]+ [^ ]+\.log$/) {$date = $1;} + if (/^([0-9\/]+) [0-9.]+ [^ ]+\.log$/) {$date = $1; $time = $2} if (/^[^ ]+ --- Cleaning branch ([^ ]+) ([^ ]+) ([^ ]+) ([^ ]+) ---$/) { ($branch, $os, $compiler, $datamodel) = ($1, $2, $3, $4, $5); } @@ -121,8 +121,8 @@ sub svgtext { my $rows = keys %status; -my $width = 680; -my $height = ($rows+2) * $lineheight; +my $width = 1080; +my $height = ($rows+2.2) * $lineheight; open(my $svg, ">build-status.svg") // die "Could not create build-status.svg."; print $svg '', "\n"; -my $col1 = 20; -my $col2 = 110; -my $col3 = 200; -my $col4 = 310; -my $col5 = 400; -my $col6 = 475; -my $col7 = 580; +my $col1 = 20; +my $col2 = 120; +my $col3 = 220; +my $col4 = 320; +my $col5 = 420; +my $col6 = 520; +my $col7 = 620; +my $col8 = 720; +my $col9 = 820; +my $col10 = 920; -svgtext($svg, $col1, 0, "#e0e0e0", "OS"); -svgtext($svg, $col2, 0, "#e0e0e0", "Compiler"); -svgtext($svg, $col3, 0, "#e0e0e0", "Data model"); -svgtext($svg, $col4, 0, "#e0e0e0", "Compiler"); -svgtext($svg, $col5, 0, "#e0e0e0", "Library"); -svgtext($svg, $col6, 0, "#e0e0e0", "C Source"); -svgtext($svg, $col7, 0, "#e0e0e0", "Tests"); +svgtext($svg, $col1, 0, "#e0e0e0", "Date"); +svgtext($svg, $col2, 0, "#e0e0e0", "Time"); +svgtext($svg, $col3, 0, "#e0e0e0", "Branch"); +svgtext($svg, $col4, 0, "#e0e0e0", "OS"); +svgtext($svg, $col5, 0, "#e0e0e0", "Compiler"); +svgtext($svg, $col6, 0, "#e0e0e0", "Data model"); +svgtext($svg, $col7, 0, "#e0e0e0", "Compiler"); +svgtext($svg, $col8, 0, "#e0e0e0", "Library"); +svgtext($svg, $col9, 0, "#e0e0e0", "C Source"); +svgtext($svg, $col10, 0, "#e0e0e0", "Tests"); my $i=1; for my $key (sort keys %status) { my ($fn, $date, $time, $os, $compiler, $datamodel, $branch, $compilerok, $libraryok, $sourcechange, $tests) = @{$status{$key}}; print $svg ''; - svgtext($svg, $col1, $i, "#c0c0c0", $os); - svgtext($svg, $col2, $i, "#c0c0c0", $compiler); - svgtext($svg, $col3, $i, "#c0c0c0", $datamodel); - svgtext($svg, $col4, $i, "#60ff60", $compilerok); - svgtext($svg, $col5, $i, "#60ff60", $libraryok); - svgtext($svg, $col6, $i, "#60ff60", $sourcechange); - svgtext($svg, $col7, $i, "#60ff60", $tests); + svgtext($svg, $col1, $i, "#c0c0c0", $date); + svgtext($svg, $col2, $i, "#c0c0c0", $time); + svgtext($svg, $col3, $i, "#c0c0c0", $branch); + svgtext($svg, $col4, $i, "#c0c0c0", $os); + svgtext($svg, $col5, $i, "#c0c0c0", $compiler); + svgtext($svg, $col6, $i, "#c0c0c0", $datamodel); + svgtext($svg, $col7, $i, "#60ff60", $compilerok); + svgtext($svg, $col8, $i, "#60ff60", $libraryok); + svgtext($svg, $col9, $i, "#60ff60", $sourcechange); + svgtext($svg, $col10, $i, "#60ff60", $tests); print $svg ''; $i++; } diff --git a/src/tools/make/checksumtest.sh b/src/tools/make/checksumtest.sh deleted file mode 100644 index 47926771..00000000 --- a/src/tools/make/checksumtest.sh +++ /dev/null @@ -1,23 +0,0 @@ -# Checksum tests -# -# Checksums object binaries (*.o) and compares with previous -# checksum for this branch. -# -# Note: OPC.o and OPM.o are omitted as they both have text string constants -# that include the build date. - - -md5=md5 -if which md5sum >/dev/null 2>&1; then md5=md5sum; fi -if [ -f $1 ] -then - $md5 *.o | egrep -v "OP[CM]\\.o" >newsums - if diff -b $1 newsums - then printf "\n--- Object file checksums match ---\n" - else printf "\n--- Object file checksum mismatch ---\n" - fi - rm newsums -else - $md5 *.o | egrep -v "OP[CM]\\.o" >$1 - printf "\n--- Object files checksummed ---\n" -fi From d59bfa05d351ebb57917c8409d42b68b7ebe74b1 Mon Sep 17 00:00:00 2001 From: David Brown Date: Sun, 10 Jul 2016 14:48:06 +0100 Subject: [PATCH 149/580] Fix build status formatting --- src/tools/make/buildall.pl | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/src/tools/make/buildall.pl b/src/tools/make/buildall.pl index 14e6cd60..f7d09ca8 100755 --- a/src/tools/make/buildall.pl +++ b/src/tools/make/buildall.pl @@ -75,7 +75,7 @@ sub parselog { my $tests = ""; open(my $log, $fn) // die "Couldn't open build log $fn."; while (<$log>) { - if (/^([0-9\/]+) [0-9.]+ [^ ]+\.log$/) {$date = $1; $time = $2} + if (/^([0-9\/]+) ([0-9.]+) .+\.log$/) {$date = $1; $time = $2} if (/^[^ ]+ --- Cleaning branch ([^ ]+) ([^ ]+) ([^ ]+) ([^ ]+) ---$/) { ($branch, $os, $compiler, $datamodel) = ($1, $2, $3, $4, $5); } @@ -121,7 +121,7 @@ sub svgtext { my $rows = keys %status; -my $width = 1080; +my $width = 620; my $height = ($rows+2.2) * $lineheight; open(my $svg, ">build-status.svg") // die "Could not create build-status.svg."; @@ -133,22 +133,19 @@ print $svg ' rx="20" ry="20" fill="#404040"'; print $svg ' stroke="#20c020" stroke-width="4"/>', "\n"; my $col1 = 20; -my $col2 = 120; -my $col3 = 220; -my $col4 = 320; -my $col5 = 420; -my $col6 = 520; -my $col7 = 620; -my $col8 = 720; -my $col9 = 820; -my $col10 = 920; +my $col2 = 97; +my $col3 = 160; +my $col4 = 220; +my $col5 = 280; +my $col6 = 320; +my $col7 = 370; +my $col8 = 430; +my $col9 = 480; +my $col10 = 560; svgtext($svg, $col1, 0, "#e0e0e0", "Date"); -svgtext($svg, $col2, 0, "#e0e0e0", "Time"); svgtext($svg, $col3, 0, "#e0e0e0", "Branch"); -svgtext($svg, $col4, 0, "#e0e0e0", "OS"); -svgtext($svg, $col5, 0, "#e0e0e0", "Compiler"); -svgtext($svg, $col6, 0, "#e0e0e0", "Data model"); +svgtext($svg, $col4, 0, "#e0e0e0", "Platform"); svgtext($svg, $col7, 0, "#e0e0e0", "Compiler"); svgtext($svg, $col8, 0, "#e0e0e0", "Library"); svgtext($svg, $col9, 0, "#e0e0e0", "C Source"); From 66d36728dbae84c1bca27340ed2460ff3e474771 Mon Sep 17 00:00:00 2001 From: David Brown Date: Sun, 10 Jul 2016 14:59:43 +0100 Subject: [PATCH 150/580] Point status at a directory so github doesn't try to cache it. --- ReadMe.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReadMe.md b/ReadMe.md index 47ee2acf..d40fea04 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -1,4 +1,4 @@ -![Build status](http://brownsmeet.com/build-status.svg) +[![Build status](http://brownsmeet.com/build-status.svg)](http://brownsmeet.com/build-status/) # Ñ´ishap Oberon From 156d9b01839fd971da7dc596441553478b866ac0 Mon Sep 17 00:00:00 2001 From: David Brown Date: Sun, 10 Jul 2016 15:17:43 +0100 Subject: [PATCH 151/580] For now, just link to a directory containing copies of the latest logs. --- ReadMe.md | 2 +- src/tools/make/buildall.pl | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ReadMe.md b/ReadMe.md index d40fea04..cc3dd955 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -1,4 +1,4 @@ -[![Build status](http://brownsmeet.com/build-status.svg)](http://brownsmeet.com/build-status/) +[![Build status](http://brownsmeet.com/build-status.svg)](http://brownsmeet.com/log/) # Ñ´ishap Oberon diff --git a/src/tools/make/buildall.pl b/src/tools/make/buildall.pl index f7d09ca8..7cdf2aab 100755 --- a/src/tools/make/buildall.pl +++ b/src/tools/make/buildall.pl @@ -172,5 +172,6 @@ for my $key (sort keys %status) { print $svg "\n"; +system 'chmod +r log/*'; system 'scp build-status.svg dave@hub:/var/www'; system 'scp log/* dave@hub:/var/www/log'; From 57cd40aa9dd4c80f51fb83f4e1cbb1fa5512fd9e Mon Sep 17 00:00:00 2001 From: David Brown Date: Sun, 10 Jul 2016 16:49:30 +0100 Subject: [PATCH 152/580] Experiment with assmbly code listing - thinking about new tests. --- src/test/confidence/hello/test.sh | 3 ++- src/tools/make/vishap.make | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/test/confidence/hello/test.sh b/src/test/confidence/hello/test.sh index b3098d72..006a3f01 100755 --- a/src/test/confidence/hello/test.sh +++ b/src/test/confidence/hello/test.sh @@ -1,4 +1,5 @@ . ../testenv.sh -voc hello.mod -m +# Generate mixed source and assembly code listing +CFLAGS="-gstabs -g1 -Wa,-acdhln=hello.s" && voc hello.mod -m ./hello >result . ../testresult.sh diff --git a/src/tools/make/vishap.make b/src/tools/make/vishap.make index 544b6708..ac7b5b24 100644 --- a/src/tools/make/vishap.make +++ b/src/tools/make/vishap.make @@ -6,9 +6,14 @@ +# Be independent of any CFLAGS settings in the calling environment +CFLAGS = + # Gnu make has the make initial directory in CURDIR, BSD make has it in .CURDIR. ROOTDIR = $(CURDIR)$(.CURDIR) +# Configuration.Make is created by src/tools/make/configure.c, which is run on +# *every* build by the makefile in the enlistment root. include ./Configuration.Make FLAVOUR = $(OS).$(DATAMODEL).$(COMPILER) From f784a41f8f96520be913f5ca39a1a8c63c0c893c Mon Sep 17 00:00:00 2001 From: David Brown Date: Mon, 11 Jul 2016 11:01:11 +0100 Subject: [PATCH 153/580] Update bootstrap sources. --- ReadMe.md | 24 ++++++++++++------------ bootstrap/unix-44/Configuration.c | 4 +++- bootstrap/unix-44/Configuration.h | 3 ++- bootstrap/unix-44/Console.c | 2 +- bootstrap/unix-44/Console.h | 2 +- bootstrap/unix-44/Files.c | 2 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 2 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 4 ++-- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 4 ++-- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 9 +++++---- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 2 +- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 2 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/SYSTEM.h | 20 ++++++++++---------- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/Vishap.c | 2 +- bootstrap/unix-44/errors.c | 2 +- bootstrap/unix-44/errors.h | 2 +- bootstrap/unix-44/extTools.c | 2 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-44/vt100.c | 2 +- bootstrap/unix-44/vt100.h | 2 +- bootstrap/unix-48/Configuration.c | 4 +++- bootstrap/unix-48/Configuration.h | 3 ++- bootstrap/unix-48/Console.c | 2 +- bootstrap/unix-48/Console.h | 2 +- bootstrap/unix-48/Files.c | 2 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 2 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 4 ++-- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 4 ++-- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 9 +++++---- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 2 +- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 2 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/SYSTEM.h | 20 ++++++++++---------- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/Vishap.c | 2 +- bootstrap/unix-48/errors.c | 2 +- bootstrap/unix-48/errors.h | 2 +- bootstrap/unix-48/extTools.c | 2 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-48/vt100.c | 2 +- bootstrap/unix-48/vt100.h | 2 +- bootstrap/unix-88/Configuration.c | 4 +++- bootstrap/unix-88/Configuration.h | 3 ++- bootstrap/unix-88/Console.c | 2 +- bootstrap/unix-88/Console.h | 2 +- bootstrap/unix-88/Files.c | 2 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 2 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 4 ++-- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 4 ++-- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 9 +++++---- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 2 +- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 2 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/SYSTEM.h | 20 ++++++++++---------- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/Vishap.c | 2 +- bootstrap/unix-88/errors.c | 2 +- bootstrap/unix-88/errors.h | 2 +- bootstrap/unix-88/extTools.c | 2 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/unix-88/vt100.c | 2 +- bootstrap/unix-88/vt100.h | 2 +- bootstrap/windows-48/Configuration.c | 4 +++- bootstrap/windows-48/Configuration.h | 3 ++- bootstrap/windows-48/Console.c | 2 +- bootstrap/windows-48/Console.h | 2 +- bootstrap/windows-48/Files.c | 2 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 2 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 4 ++-- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 4 ++-- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 9 +++++---- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 2 +- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 2 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/SYSTEM.h | 20 ++++++++++---------- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/Vishap.c | 2 +- bootstrap/windows-48/errors.c | 2 +- bootstrap/windows-48/errors.h | 2 +- bootstrap/windows-48/extTools.c | 2 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-48/vt100.c | 2 +- bootstrap/windows-48/vt100.h | 2 +- bootstrap/windows-88/Configuration.c | 4 +++- bootstrap/windows-88/Configuration.h | 3 ++- bootstrap/windows-88/Console.c | 2 +- bootstrap/windows-88/Console.h | 2 +- bootstrap/windows-88/Files.c | 2 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 2 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 4 ++-- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 4 ++-- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 9 +++++---- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 2 +- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 2 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Platform.c | 2 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/SYSTEM.h | 20 ++++++++++---------- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/Vishap.c | 2 +- bootstrap/windows-88/errors.c | 2 +- bootstrap/windows-88/errors.h | 2 +- bootstrap/windows-88/extTools.c | 2 +- bootstrap/windows-88/extTools.h | 2 +- bootstrap/windows-88/vt100.c | 2 +- bootstrap/windows-88/vt100.h | 2 +- 201 files changed, 302 insertions(+), 282 deletions(-) diff --git a/ReadMe.md b/ReadMe.md index cc3dd955..be623b82 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -29,13 +29,13 @@ default libraries complying with the Oakwood Guidelines for Oberon-2 compilers. ###### Prerequisites -| Platform | Packages | -| --------- | ------------ | -| Debian/Ubuntu/Mint ... | apt-get install git | -| Fedora/RHEL/CentOS ... | yum install git gcc glibc-static | -| FreeBSD/OpenBSD/NetBSD | pkg install git | -| Cygwin | use setup-x86[_x64] to add packages git, make and gcc-core | -| Darwin | run 'git' at the command line and accept the prompt to install it. | +| Platform | Packages | +| --------- | ------------ | +| Debian/Ubuntu/Mint ... | `apt-get install git` | +| Fedora/RHEL/CentOS ... | `yum install git gcc glibc-static` | +| FreeBSD/OpenBSD/NetBSD | `pkg install git` | +| Cygwin | use setup-x86[_x64] to add packages git, make and gcc-core | +| Darwin | type 'git' at the command line and accept the prompt to install it. | More details, including for MingW and MS C, in [Installation](/doc/Installation.md). @@ -52,11 +52,11 @@ Since 'make full' will install the compiler and libraries, it needs root (unix) Set your path to the installed compiler binary location as reported by make full, e.g. -| System | Set path | -| --------- | -------------------------------------- | -| Linux | `export PATH="/opt/voc/bin:$PATH"` | -| BSD | `export PATH="/usr/local/share/voc/bin:$PATH"` | -| Windows | See [Installation](/doc/Installation.md) | +| System | Set path | +| --------- | -------------------------------------- | +| Linux | `export PATH="/opt/voc/bin:$PATH"` | +| BSD | `export PATH="/usr/local/share/voc/bin:$PATH"` | +| Windows | See [Installation](/doc/Installation.md) | | Termux | `export PATH="/data/data/com.termux/files/opt/voc/bin:$PATH"` | Also see [Installation](/doc/Installation.md). diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index aef0c6c0..6cc8caad 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,7 +1,8 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" +export CHAR Configuration_versionLong[41]; @@ -12,5 +13,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ + __MOVE("1.95 [2016/07/11] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index 4c931710..a9c49d8e 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h @@ -6,6 +6,7 @@ #include "SYSTEM.h" +import CHAR Configuration_versionLong[41]; import void *Configuration__init(void); diff --git a/bootstrap/unix-44/Console.c b/bootstrap/unix-44/Console.c index 1d3fe81f..e0c4cf80 100644 --- a/bootstrap/unix-44/Console.c +++ b/bootstrap/unix-44/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Platform.h" diff --git a/bootstrap/unix-44/Console.h b/bootstrap/unix-44/Console.h index 8e12fc26..8df4d5f3 100644 --- a/bootstrap/unix-44/Console.h +++ b/bootstrap/unix-44/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 14bf860b..92d3593e 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index 2461434a..bdb8f0a0 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index 4158550b..0e8d2178 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin tskSfF */ #include "SYSTEM.h" struct Heap__1 { diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index 33b7f49f..ce80df86 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index c2c2920a..a29a7f9b 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Heap.h" diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index d3b57a01..c605ebc6 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index 7a1ae82b..40d66396 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index 8e98db79..0a4e9b21 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 1d2d84d1..f67f0cda 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "OPM.h" @@ -1241,7 +1241,7 @@ static void OPC_GenHeaderMsg (void) OPM_WriteString((CHAR*)"/*", (LONGINT)3); OPM_WriteString((CHAR*)" voc ", (LONGINT)6); OPM_Write(' '); - OPM_WriteString((CHAR*)"1.95 [2016/06/30] for gcc LP64 on cygwin", (LONGINT)41); + OPM_WriteString(Configuration_versionLong, ((LONGINT)(41))); OPM_Write(' '); i = 0; while (i <= 31) { diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index 467de9eb..6209887e 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 3ad30ae3..397d4683 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" @@ -198,7 +198,7 @@ BOOLEAN OPM_OpenPar (void) if (Platform_ArgCount == 1) { OPM_LogWLn(); OPM_LogWStr((CHAR*)"Vishap Oberon-2 compiler v", (LONGINT)27); - OPM_LogWStr((CHAR*)"1.95 [2016/06/30] for gcc LP64 on cygwin", (LONGINT)41); + OPM_LogWStr(Configuration_versionLong, ((LONGINT)(41))); OPM_LogW('.'); OPM_LogWLn(); OPM_LogWStr((CHAR*)"Based on Ofront by Software Templ OEG, continued by Norayr Chilingarian and others.", (LONGINT)84); diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index 8f0040f4..42e2c9d5 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index 845635b3..207e39fc 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPB.h" #include "OPM.h" diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index ddacbb19..b0c639c0 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index 071a1dc0..3945d04c 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "OPM.h" @@ -127,7 +127,7 @@ static INTEGER Ord__7 (CHAR ch, BOOLEAN hex) static void OPS_Number (void) { - INTEGER i, m, n, d, e; + INTEGER i, m, n, d, e, maxHdig; CHAR dig[24]; LONGREAL f; CHAR expCh; @@ -182,8 +182,9 @@ static void OPS_Number (void) } else if (OPS_ch == 'H') { OPM_Get(&OPS_ch); OPS_numtyp = 2; - if (n <= 8) { - if ((n == 8 && dig[0] > '7')) { + maxHdig = 8; + if (n <= maxHdig) { + if ((n == maxHdig && dig[0] > '7')) { OPS_intval = -1; } while (i < n) { diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index afca4213..d09d39b6 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index 16157fca..db859ffa 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index 826b5123..3c2cf4f3 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index 2223918b..fabbd4ab 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPC.h" #include "OPM.h" diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index ecacbf6f..3d6bec56 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 864918a3..03dad80c 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index 1d2eb565..8fa874e7 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 3f43d082..b9cd1c3d 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index d6dbab1c..aefa8974 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/SYSTEM.h b/bootstrap/unix-44/SYSTEM.h index f9e2f930..41ef9995 100644 --- a/bootstrap/unix-44/SYSTEM.h +++ b/bootstrap/unix-44/SYSTEM.h @@ -49,7 +49,7 @@ #define LONGREAL double #define SYSTEM_PTR void* -// For 32 bit builds, the size of LONGINT depends on a make option: +// For 32 bit builds, the size of LONGINT depends on a make option: #if (__SIZEOF_POINTER__ == 8) || defined(LARGE) || defined(_WIN64) #define INTEGER int // INTEGER is 32 bit. @@ -126,21 +126,21 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __GET(a, x, t) x= *(t*)(uintptr_t)(a) #define __PUT(a, x, t) *(t*)(uintptr_t)(a)=x + #define __LSHL(x, n, t) ((t)((unsigned t)(x)<<(n))) #define __LSHR(x, n, t) ((t)((unsigned t)(x)>>(n))) #define __LSH(x, n, t) ((n)>=0? __LSHL(x, n, t): __LSHR(x, -(n), t)) -#define __ROTL(x, n, t) ((t)((unsigned t)(x)<<(n)|(unsigned t)(x)>>(8*sizeof(t)-(n)))) -#define __ROTR(x, n, t) ((t)((unsigned t)(x)>>(n)|(unsigned t)(x)<<(8*sizeof(t)-(n)))) -#define __LSHR(x, n, t) ((t)((unsigned t)(x)>>(n))) -#define __LSH(x, n, t) ((n)>=0? __LSHL(x, n, t): __LSHR(x, -(n), t)) -#define __ROTL(x, n, t) ((t)((unsigned t)(x)<<(n)|(unsigned t)(x)>>(8*sizeof(t)-(n)))) -#define __ROTR(x, n, t) ((t)((unsigned t)(x)>>(n)|(unsigned t)(x)<<(8*sizeof(t)-(n)))) -#define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) -#define __BIT(x, n) (*(unsigned LONGINT*)(x)>>(n)&1) -#define __MOVE(s, d, n) memcpy((char*)(uintptr_t)(d),(char*)(uintptr_t)(s),n) + #define __ASHL(x, n) ((LONGINT)(x)<<(n)) #define __ASHR(x, n) ((LONGINT)(x)>>(n)) #define __ASH(x, n) ((n)>=0?__ASHL(x,n):__ASHR(x,-(n))) + +#define __ROTL(x, n, t) ((t)((unsigned t)(x)<<(n)|(unsigned t)(x)>>(8*sizeof(t)-(n)))) +#define __ROTR(x, n, t) ((t)((unsigned t)(x)>>(n)|(unsigned t)(x)<<(8*sizeof(t)-(n)))) +#define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) + +#define __BIT(x, n) (*(unsigned LONGINT*)(x)>>(n)&1) +#define __MOVE(s, d, n) memcpy((char*)(uintptr_t)(d),(char*)(uintptr_t)(s),n) #define __ASHF(x, n) SYSTEM_ASH((LONGINT)(x), (LONGINT)(n)) #define __SHORT(x, y) ((int)((unsigned LONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) #define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index 02a8124d..9b7cedf9 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index 809d6efe..4e768eb2 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index 569e31bb..f975bd5d 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Files.h" #include "Modules.h" diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index eee6ba91..7eaaec81 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/Vishap.c b/bootstrap/unix-44/Vishap.c index 96510cf9..b1d58deb 100644 --- a/bootstrap/unix-44/Vishap.c +++ b/bootstrap/unix-44/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkamSf */ #include "SYSTEM.h" #include "Configuration.h" #include "Heap.h" diff --git a/bootstrap/unix-44/errors.c b/bootstrap/unix-44/errors.c index 987f1c5e..8a192c44 100644 --- a/bootstrap/unix-44/errors.c +++ b/bootstrap/unix-44/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/unix-44/errors.h b/bootstrap/unix-44/errors.h index cf182e80..faa4b1ce 100644 --- a/bootstrap/unix-44/errors.h +++ b/bootstrap/unix-44/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index a362ee65..cf9b6b4c 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index e064ef01..ea47d26c 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-44/vt100.c b/bootstrap/unix-44/vt100.c index 93a59097..fdcd322d 100644 --- a/bootstrap/unix-44/vt100.c +++ b/bootstrap/unix-44/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Strings.h" diff --git a/bootstrap/unix-44/vt100.h b/bootstrap/unix-44/vt100.h index db19e2a6..88660721 100644 --- a/bootstrap/unix-44/vt100.h +++ b/bootstrap/unix-44/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index aef0c6c0..6cc8caad 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,7 +1,8 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" +export CHAR Configuration_versionLong[41]; @@ -12,5 +13,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ + __MOVE("1.95 [2016/07/11] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index 4c931710..a9c49d8e 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h @@ -6,6 +6,7 @@ #include "SYSTEM.h" +import CHAR Configuration_versionLong[41]; import void *Configuration__init(void); diff --git a/bootstrap/unix-48/Console.c b/bootstrap/unix-48/Console.c index 1d3fe81f..e0c4cf80 100644 --- a/bootstrap/unix-48/Console.c +++ b/bootstrap/unix-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Platform.h" diff --git a/bootstrap/unix-48/Console.h b/bootstrap/unix-48/Console.h index 8e12fc26..8df4d5f3 100644 --- a/bootstrap/unix-48/Console.h +++ b/bootstrap/unix-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 14bf860b..92d3593e 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index 2461434a..bdb8f0a0 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index 4158550b..0e8d2178 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin tskSfF */ #include "SYSTEM.h" struct Heap__1 { diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index 33b7f49f..ce80df86 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index c2c2920a..a29a7f9b 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Heap.h" diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index d3b57a01..c605ebc6 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index 7a1ae82b..40d66396 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index 8e98db79..0a4e9b21 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 1d2d84d1..f67f0cda 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "OPM.h" @@ -1241,7 +1241,7 @@ static void OPC_GenHeaderMsg (void) OPM_WriteString((CHAR*)"/*", (LONGINT)3); OPM_WriteString((CHAR*)" voc ", (LONGINT)6); OPM_Write(' '); - OPM_WriteString((CHAR*)"1.95 [2016/06/30] for gcc LP64 on cygwin", (LONGINT)41); + OPM_WriteString(Configuration_versionLong, ((LONGINT)(41))); OPM_Write(' '); i = 0; while (i <= 31) { diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index 467de9eb..6209887e 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 3ad30ae3..397d4683 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" @@ -198,7 +198,7 @@ BOOLEAN OPM_OpenPar (void) if (Platform_ArgCount == 1) { OPM_LogWLn(); OPM_LogWStr((CHAR*)"Vishap Oberon-2 compiler v", (LONGINT)27); - OPM_LogWStr((CHAR*)"1.95 [2016/06/30] for gcc LP64 on cygwin", (LONGINT)41); + OPM_LogWStr(Configuration_versionLong, ((LONGINT)(41))); OPM_LogW('.'); OPM_LogWLn(); OPM_LogWStr((CHAR*)"Based on Ofront by Software Templ OEG, continued by Norayr Chilingarian and others.", (LONGINT)84); diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index 8f0040f4..42e2c9d5 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index 845635b3..207e39fc 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPB.h" #include "OPM.h" diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index ddacbb19..b0c639c0 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index 071a1dc0..3945d04c 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "OPM.h" @@ -127,7 +127,7 @@ static INTEGER Ord__7 (CHAR ch, BOOLEAN hex) static void OPS_Number (void) { - INTEGER i, m, n, d, e; + INTEGER i, m, n, d, e, maxHdig; CHAR dig[24]; LONGREAL f; CHAR expCh; @@ -182,8 +182,9 @@ static void OPS_Number (void) } else if (OPS_ch == 'H') { OPM_Get(&OPS_ch); OPS_numtyp = 2; - if (n <= 8) { - if ((n == 8 && dig[0] > '7')) { + maxHdig = 8; + if (n <= maxHdig) { + if ((n == maxHdig && dig[0] > '7')) { OPS_intval = -1; } while (i < n) { diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index afca4213..d09d39b6 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 16157fca..db859ffa 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index 826b5123..3c2cf4f3 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index 2223918b..fabbd4ab 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPC.h" #include "OPM.h" diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index ecacbf6f..3d6bec56 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 864918a3..03dad80c 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index 1d2eb565..8fa874e7 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 3f43d082..b9cd1c3d 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index d6dbab1c..aefa8974 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/SYSTEM.h b/bootstrap/unix-48/SYSTEM.h index f9e2f930..41ef9995 100644 --- a/bootstrap/unix-48/SYSTEM.h +++ b/bootstrap/unix-48/SYSTEM.h @@ -49,7 +49,7 @@ #define LONGREAL double #define SYSTEM_PTR void* -// For 32 bit builds, the size of LONGINT depends on a make option: +// For 32 bit builds, the size of LONGINT depends on a make option: #if (__SIZEOF_POINTER__ == 8) || defined(LARGE) || defined(_WIN64) #define INTEGER int // INTEGER is 32 bit. @@ -126,21 +126,21 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __GET(a, x, t) x= *(t*)(uintptr_t)(a) #define __PUT(a, x, t) *(t*)(uintptr_t)(a)=x + #define __LSHL(x, n, t) ((t)((unsigned t)(x)<<(n))) #define __LSHR(x, n, t) ((t)((unsigned t)(x)>>(n))) #define __LSH(x, n, t) ((n)>=0? __LSHL(x, n, t): __LSHR(x, -(n), t)) -#define __ROTL(x, n, t) ((t)((unsigned t)(x)<<(n)|(unsigned t)(x)>>(8*sizeof(t)-(n)))) -#define __ROTR(x, n, t) ((t)((unsigned t)(x)>>(n)|(unsigned t)(x)<<(8*sizeof(t)-(n)))) -#define __LSHR(x, n, t) ((t)((unsigned t)(x)>>(n))) -#define __LSH(x, n, t) ((n)>=0? __LSHL(x, n, t): __LSHR(x, -(n), t)) -#define __ROTL(x, n, t) ((t)((unsigned t)(x)<<(n)|(unsigned t)(x)>>(8*sizeof(t)-(n)))) -#define __ROTR(x, n, t) ((t)((unsigned t)(x)>>(n)|(unsigned t)(x)<<(8*sizeof(t)-(n)))) -#define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) -#define __BIT(x, n) (*(unsigned LONGINT*)(x)>>(n)&1) -#define __MOVE(s, d, n) memcpy((char*)(uintptr_t)(d),(char*)(uintptr_t)(s),n) + #define __ASHL(x, n) ((LONGINT)(x)<<(n)) #define __ASHR(x, n) ((LONGINT)(x)>>(n)) #define __ASH(x, n) ((n)>=0?__ASHL(x,n):__ASHR(x,-(n))) + +#define __ROTL(x, n, t) ((t)((unsigned t)(x)<<(n)|(unsigned t)(x)>>(8*sizeof(t)-(n)))) +#define __ROTR(x, n, t) ((t)((unsigned t)(x)>>(n)|(unsigned t)(x)<<(8*sizeof(t)-(n)))) +#define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) + +#define __BIT(x, n) (*(unsigned LONGINT*)(x)>>(n)&1) +#define __MOVE(s, d, n) memcpy((char*)(uintptr_t)(d),(char*)(uintptr_t)(s),n) #define __ASHF(x, n) SYSTEM_ASH((LONGINT)(x), (LONGINT)(n)) #define __SHORT(x, y) ((int)((unsigned LONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) #define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index 02a8124d..9b7cedf9 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index 809d6efe..4e768eb2 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index 5888e0b3..06256562 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Files.h" #include "Modules.h" diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index a6e717f6..7d6146f4 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/Vishap.c b/bootstrap/unix-48/Vishap.c index 96510cf9..b1d58deb 100644 --- a/bootstrap/unix-48/Vishap.c +++ b/bootstrap/unix-48/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkamSf */ #include "SYSTEM.h" #include "Configuration.h" #include "Heap.h" diff --git a/bootstrap/unix-48/errors.c b/bootstrap/unix-48/errors.c index 987f1c5e..8a192c44 100644 --- a/bootstrap/unix-48/errors.c +++ b/bootstrap/unix-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/unix-48/errors.h b/bootstrap/unix-48/errors.h index cf182e80..faa4b1ce 100644 --- a/bootstrap/unix-48/errors.h +++ b/bootstrap/unix-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index a362ee65..cf9b6b4c 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index e064ef01..ea47d26c 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/vt100.c b/bootstrap/unix-48/vt100.c index 93a59097..fdcd322d 100644 --- a/bootstrap/unix-48/vt100.c +++ b/bootstrap/unix-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Strings.h" diff --git a/bootstrap/unix-48/vt100.h b/bootstrap/unix-48/vt100.h index db19e2a6..88660721 100644 --- a/bootstrap/unix-48/vt100.h +++ b/bootstrap/unix-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index bbdc22b6..2e9247b8 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" +export CHAR Configuration_versionLong[41]; @@ -13,5 +14,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ + __MOVE("1.95 [2016/07/11] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index 70939b4f..b8c7482a 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h @@ -7,6 +7,7 @@ #include "SYSTEM.h" +import CHAR Configuration_versionLong[41]; import void *Configuration__init(void); diff --git a/bootstrap/unix-88/Console.c b/bootstrap/unix-88/Console.c index 8a185970..243cef3d 100644 --- a/bootstrap/unix-88/Console.c +++ b/bootstrap/unix-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Platform.h" diff --git a/bootstrap/unix-88/Console.h b/bootstrap/unix-88/Console.h index fb5f7f79..afcd718c 100644 --- a/bootstrap/unix-88/Console.h +++ b/bootstrap/unix-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index aac48dc7..ec13a168 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin tspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 4690dbf8..83125844 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index 28826f74..a119ef7f 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin tskSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index 5b65ee7d..04fd5506 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index b59eaa3b..1c649e58 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index 77f3c9a7..29c581b4 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index 25c048b7..8915bdff 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index 50e1e1f3..c363d1ef 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index 9e4a4560..29166703 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -1242,7 +1242,7 @@ static void OPC_GenHeaderMsg (void) OPM_WriteString((CHAR*)"/*", (LONGINT)3); OPM_WriteString((CHAR*)" voc ", (LONGINT)6); OPM_Write(' '); - OPM_WriteString((CHAR*)"1.95 [2016/06/30] for gcc LP64 on cygwin", (LONGINT)41); + OPM_WriteString(Configuration_versionLong, ((LONGINT)(41))); OPM_Write(' '); i = 0; while (i <= 63) { diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index 14f92cf9..957409f7 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 05ccbb11..0e9f11f4 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -199,7 +199,7 @@ BOOLEAN OPM_OpenPar (void) if (Platform_ArgCount == 1) { OPM_LogWLn(); OPM_LogWStr((CHAR*)"Vishap Oberon-2 compiler v", (LONGINT)27); - OPM_LogWStr((CHAR*)"1.95 [2016/06/30] for gcc LP64 on cygwin", (LONGINT)41); + OPM_LogWStr(Configuration_versionLong, ((LONGINT)(41))); OPM_LogW('.'); OPM_LogWLn(); OPM_LogWStr((CHAR*)"Based on Ofront by Software Templ OEG, continued by Norayr Chilingarian and others.", (LONGINT)84); diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index 72cb3858..e56dad24 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index 5c5c5010..478ec10b 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPB.h" diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index 6c46f388..6e41e6d9 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index 6fbbdde1..fcfc8cdf 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin tspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" @@ -128,7 +128,7 @@ static INTEGER Ord__7 (CHAR ch, BOOLEAN hex) static void OPS_Number (void) { - INTEGER i, m, n, d, e; + INTEGER i, m, n, d, e, maxHdig; CHAR dig[24]; LONGREAL f; CHAR expCh; @@ -183,8 +183,9 @@ static void OPS_Number (void) } else if (OPS_ch == 'H') { OPM_Get(&OPS_ch); OPS_numtyp = 2; - if (n <= 8) { - if ((n == 8 && dig[0] > '7')) { + maxHdig = 16; + if (n <= maxHdig) { + if ((n == maxHdig && dig[0] > '7')) { OPS_intval = -1; } while (i < n) { diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index 62358186..b0f099c1 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index 9a1045af..e9543cbc 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 99ba8c8a..a1d3e4b5 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 2a83cc64..875f2aed 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPC.h" diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index 23d69e2d..9afa026c 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 52f8d7bf..228c634b 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index 88defee9..2868bffc 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 152db07b..15cb6037 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index bdc8e2a5..304178b9 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/SYSTEM.h b/bootstrap/unix-88/SYSTEM.h index f9e2f930..41ef9995 100644 --- a/bootstrap/unix-88/SYSTEM.h +++ b/bootstrap/unix-88/SYSTEM.h @@ -49,7 +49,7 @@ #define LONGREAL double #define SYSTEM_PTR void* -// For 32 bit builds, the size of LONGINT depends on a make option: +// For 32 bit builds, the size of LONGINT depends on a make option: #if (__SIZEOF_POINTER__ == 8) || defined(LARGE) || defined(_WIN64) #define INTEGER int // INTEGER is 32 bit. @@ -126,21 +126,21 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __GET(a, x, t) x= *(t*)(uintptr_t)(a) #define __PUT(a, x, t) *(t*)(uintptr_t)(a)=x + #define __LSHL(x, n, t) ((t)((unsigned t)(x)<<(n))) #define __LSHR(x, n, t) ((t)((unsigned t)(x)>>(n))) #define __LSH(x, n, t) ((n)>=0? __LSHL(x, n, t): __LSHR(x, -(n), t)) -#define __ROTL(x, n, t) ((t)((unsigned t)(x)<<(n)|(unsigned t)(x)>>(8*sizeof(t)-(n)))) -#define __ROTR(x, n, t) ((t)((unsigned t)(x)>>(n)|(unsigned t)(x)<<(8*sizeof(t)-(n)))) -#define __LSHR(x, n, t) ((t)((unsigned t)(x)>>(n))) -#define __LSH(x, n, t) ((n)>=0? __LSHL(x, n, t): __LSHR(x, -(n), t)) -#define __ROTL(x, n, t) ((t)((unsigned t)(x)<<(n)|(unsigned t)(x)>>(8*sizeof(t)-(n)))) -#define __ROTR(x, n, t) ((t)((unsigned t)(x)>>(n)|(unsigned t)(x)<<(8*sizeof(t)-(n)))) -#define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) -#define __BIT(x, n) (*(unsigned LONGINT*)(x)>>(n)&1) -#define __MOVE(s, d, n) memcpy((char*)(uintptr_t)(d),(char*)(uintptr_t)(s),n) + #define __ASHL(x, n) ((LONGINT)(x)<<(n)) #define __ASHR(x, n) ((LONGINT)(x)>>(n)) #define __ASH(x, n) ((n)>=0?__ASHL(x,n):__ASHR(x,-(n))) + +#define __ROTL(x, n, t) ((t)((unsigned t)(x)<<(n)|(unsigned t)(x)>>(8*sizeof(t)-(n)))) +#define __ROTR(x, n, t) ((t)((unsigned t)(x)>>(n)|(unsigned t)(x)<<(8*sizeof(t)-(n)))) +#define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) + +#define __BIT(x, n) (*(unsigned LONGINT*)(x)>>(n)&1) +#define __MOVE(s, d, n) memcpy((char*)(uintptr_t)(d),(char*)(uintptr_t)(s),n) #define __ASHF(x, n) SYSTEM_ASH((LONGINT)(x), (LONGINT)(n)) #define __SHORT(x, y) ((int)((unsigned LONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) #define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index c8d54be5..77aeeac7 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index 256941f4..daaf5699 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index 077da855..bf7ca304 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Files.h" diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index 2d4eb745..9b0a8375 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/Vishap.c b/bootstrap/unix-88/Vishap.c index ac122892..adda1b61 100644 --- a/bootstrap/unix-88/Vishap.c +++ b/bootstrap/unix-88/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkamSf */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/unix-88/errors.c b/bootstrap/unix-88/errors.c index 6a733b09..53223732 100644 --- a/bootstrap/unix-88/errors.c +++ b/bootstrap/unix-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/unix-88/errors.h b/bootstrap/unix-88/errors.h index 72bdc98e..12762322 100644 --- a/bootstrap/unix-88/errors.h +++ b/bootstrap/unix-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index 2fd5ccd0..63030983 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index 81db5d3b..3efe7c26 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/vt100.c b/bootstrap/unix-88/vt100.c index c584b083..a59c9241 100644 --- a/bootstrap/unix-88/vt100.c +++ b/bootstrap/unix-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/unix-88/vt100.h b/bootstrap/unix-88/vt100.h index d981ba62..9deec89a 100644 --- a/bootstrap/unix-88/vt100.h +++ b/bootstrap/unix-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index aef0c6c0..6cc8caad 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,7 +1,8 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" +export CHAR Configuration_versionLong[41]; @@ -12,5 +13,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ + __MOVE("1.95 [2016/07/11] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index 4c931710..a9c49d8e 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h @@ -6,6 +6,7 @@ #include "SYSTEM.h" +import CHAR Configuration_versionLong[41]; import void *Configuration__init(void); diff --git a/bootstrap/windows-48/Console.c b/bootstrap/windows-48/Console.c index ba50baa8..fc3b5226 100644 --- a/bootstrap/windows-48/Console.c +++ b/bootstrap/windows-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Platform.h" diff --git a/bootstrap/windows-48/Console.h b/bootstrap/windows-48/Console.h index 8e12fc26..8df4d5f3 100644 --- a/bootstrap/windows-48/Console.h +++ b/bootstrap/windows-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 0e1ffba8..f28675b3 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index b6b7879e..ad0f8733 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index 4158550b..0e8d2178 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin tskSfF */ #include "SYSTEM.h" struct Heap__1 { diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index 33b7f49f..ce80df86 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index c2c2920a..a29a7f9b 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Heap.h" diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index d3b57a01..c605ebc6 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index 7a1ae82b..40d66396 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index 8e98db79..0a4e9b21 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 1d2d84d1..f67f0cda 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "OPM.h" @@ -1241,7 +1241,7 @@ static void OPC_GenHeaderMsg (void) OPM_WriteString((CHAR*)"/*", (LONGINT)3); OPM_WriteString((CHAR*)" voc ", (LONGINT)6); OPM_Write(' '); - OPM_WriteString((CHAR*)"1.95 [2016/06/30] for gcc LP64 on cygwin", (LONGINT)41); + OPM_WriteString(Configuration_versionLong, ((LONGINT)(41))); OPM_Write(' '); i = 0; while (i <= 31) { diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index 467de9eb..6209887e 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 3ad30ae3..397d4683 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" @@ -198,7 +198,7 @@ BOOLEAN OPM_OpenPar (void) if (Platform_ArgCount == 1) { OPM_LogWLn(); OPM_LogWStr((CHAR*)"Vishap Oberon-2 compiler v", (LONGINT)27); - OPM_LogWStr((CHAR*)"1.95 [2016/06/30] for gcc LP64 on cygwin", (LONGINT)41); + OPM_LogWStr(Configuration_versionLong, ((LONGINT)(41))); OPM_LogW('.'); OPM_LogWLn(); OPM_LogWStr((CHAR*)"Based on Ofront by Software Templ OEG, continued by Norayr Chilingarian and others.", (LONGINT)84); diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index 8f0040f4..42e2c9d5 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index 845635b3..207e39fc 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPB.h" #include "OPM.h" diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index ddacbb19..b0c639c0 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index 071a1dc0..3945d04c 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "OPM.h" @@ -127,7 +127,7 @@ static INTEGER Ord__7 (CHAR ch, BOOLEAN hex) static void OPS_Number (void) { - INTEGER i, m, n, d, e; + INTEGER i, m, n, d, e, maxHdig; CHAR dig[24]; LONGREAL f; CHAR expCh; @@ -182,8 +182,9 @@ static void OPS_Number (void) } else if (OPS_ch == 'H') { OPM_Get(&OPS_ch); OPS_numtyp = 2; - if (n <= 8) { - if ((n == 8 && dig[0] > '7')) { + maxHdig = 8; + if (n <= maxHdig) { + if ((n == maxHdig && dig[0] > '7')) { OPS_intval = -1; } while (i < n) { diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index afca4213..d09d39b6 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 16157fca..db859ffa 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index 826b5123..3c2cf4f3 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index 2223918b..fabbd4ab 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPC.h" #include "OPM.h" diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index ecacbf6f..3d6bec56 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index b5310405..ec3a17f4 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index 11bd3410..f0054fdb 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 3f43d082..b9cd1c3d 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index d6dbab1c..aefa8974 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/SYSTEM.h b/bootstrap/windows-48/SYSTEM.h index f9e2f930..41ef9995 100644 --- a/bootstrap/windows-48/SYSTEM.h +++ b/bootstrap/windows-48/SYSTEM.h @@ -49,7 +49,7 @@ #define LONGREAL double #define SYSTEM_PTR void* -// For 32 bit builds, the size of LONGINT depends on a make option: +// For 32 bit builds, the size of LONGINT depends on a make option: #if (__SIZEOF_POINTER__ == 8) || defined(LARGE) || defined(_WIN64) #define INTEGER int // INTEGER is 32 bit. @@ -126,21 +126,21 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __GET(a, x, t) x= *(t*)(uintptr_t)(a) #define __PUT(a, x, t) *(t*)(uintptr_t)(a)=x + #define __LSHL(x, n, t) ((t)((unsigned t)(x)<<(n))) #define __LSHR(x, n, t) ((t)((unsigned t)(x)>>(n))) #define __LSH(x, n, t) ((n)>=0? __LSHL(x, n, t): __LSHR(x, -(n), t)) -#define __ROTL(x, n, t) ((t)((unsigned t)(x)<<(n)|(unsigned t)(x)>>(8*sizeof(t)-(n)))) -#define __ROTR(x, n, t) ((t)((unsigned t)(x)>>(n)|(unsigned t)(x)<<(8*sizeof(t)-(n)))) -#define __LSHR(x, n, t) ((t)((unsigned t)(x)>>(n))) -#define __LSH(x, n, t) ((n)>=0? __LSHL(x, n, t): __LSHR(x, -(n), t)) -#define __ROTL(x, n, t) ((t)((unsigned t)(x)<<(n)|(unsigned t)(x)>>(8*sizeof(t)-(n)))) -#define __ROTR(x, n, t) ((t)((unsigned t)(x)>>(n)|(unsigned t)(x)<<(8*sizeof(t)-(n)))) -#define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) -#define __BIT(x, n) (*(unsigned LONGINT*)(x)>>(n)&1) -#define __MOVE(s, d, n) memcpy((char*)(uintptr_t)(d),(char*)(uintptr_t)(s),n) + #define __ASHL(x, n) ((LONGINT)(x)<<(n)) #define __ASHR(x, n) ((LONGINT)(x)>>(n)) #define __ASH(x, n) ((n)>=0?__ASHL(x,n):__ASHR(x,-(n))) + +#define __ROTL(x, n, t) ((t)((unsigned t)(x)<<(n)|(unsigned t)(x)>>(8*sizeof(t)-(n)))) +#define __ROTR(x, n, t) ((t)((unsigned t)(x)>>(n)|(unsigned t)(x)<<(8*sizeof(t)-(n)))) +#define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) + +#define __BIT(x, n) (*(unsigned LONGINT*)(x)>>(n)&1) +#define __MOVE(s, d, n) memcpy((char*)(uintptr_t)(d),(char*)(uintptr_t)(s),n) #define __ASHF(x, n) SYSTEM_ASH((LONGINT)(x), (LONGINT)(n)) #define __SHORT(x, y) ((int)((unsigned LONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) #define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index 02a8124d..9b7cedf9 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index 809d6efe..4e768eb2 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index 5888e0b3..06256562 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Files.h" #include "Modules.h" diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index a6e717f6..7d6146f4 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/Vishap.c b/bootstrap/windows-48/Vishap.c index 96510cf9..b1d58deb 100644 --- a/bootstrap/windows-48/Vishap.c +++ b/bootstrap/windows-48/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkamSf */ #include "SYSTEM.h" #include "Configuration.h" #include "Heap.h" diff --git a/bootstrap/windows-48/errors.c b/bootstrap/windows-48/errors.c index 987f1c5e..8a192c44 100644 --- a/bootstrap/windows-48/errors.c +++ b/bootstrap/windows-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/windows-48/errors.h b/bootstrap/windows-48/errors.h index cf182e80..faa4b1ce 100644 --- a/bootstrap/windows-48/errors.h +++ b/bootstrap/windows-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index a362ee65..cf9b6b4c 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index e064ef01..ea47d26c 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/vt100.c b/bootstrap/windows-48/vt100.c index 93a59097..fdcd322d 100644 --- a/bootstrap/windows-48/vt100.c +++ b/bootstrap/windows-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Strings.h" diff --git a/bootstrap/windows-48/vt100.h b/bootstrap/windows-48/vt100.h index db19e2a6..88660721 100644 --- a/bootstrap/windows-48/vt100.h +++ b/bootstrap/windows-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index bbdc22b6..2e9247b8 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" +export CHAR Configuration_versionLong[41]; @@ -13,5 +14,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ + __MOVE("1.95 [2016/07/11] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index 70939b4f..b8c7482a 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h @@ -7,6 +7,7 @@ #include "SYSTEM.h" +import CHAR Configuration_versionLong[41]; import void *Configuration__init(void); diff --git a/bootstrap/windows-88/Console.c b/bootstrap/windows-88/Console.c index 3c4d2c36..49fab6b4 100644 --- a/bootstrap/windows-88/Console.c +++ b/bootstrap/windows-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Platform.h" diff --git a/bootstrap/windows-88/Console.h b/bootstrap/windows-88/Console.h index fb5f7f79..afcd718c 100644 --- a/bootstrap/windows-88/Console.h +++ b/bootstrap/windows-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 38a8e591..5a4bcb4b 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin tspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index dc789b69..23dca75b 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index 28826f74..a119ef7f 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin tskSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index 5b65ee7d..04fd5506 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index b59eaa3b..1c649e58 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index 77f3c9a7..29c581b4 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index 25c048b7..8915bdff 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index 50e1e1f3..c363d1ef 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index 9e4a4560..29166703 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -1242,7 +1242,7 @@ static void OPC_GenHeaderMsg (void) OPM_WriteString((CHAR*)"/*", (LONGINT)3); OPM_WriteString((CHAR*)" voc ", (LONGINT)6); OPM_Write(' '); - OPM_WriteString((CHAR*)"1.95 [2016/06/30] for gcc LP64 on cygwin", (LONGINT)41); + OPM_WriteString(Configuration_versionLong, ((LONGINT)(41))); OPM_Write(' '); i = 0; while (i <= 63) { diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index 14f92cf9..957409f7 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 05ccbb11..0e9f11f4 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -199,7 +199,7 @@ BOOLEAN OPM_OpenPar (void) if (Platform_ArgCount == 1) { OPM_LogWLn(); OPM_LogWStr((CHAR*)"Vishap Oberon-2 compiler v", (LONGINT)27); - OPM_LogWStr((CHAR*)"1.95 [2016/06/30] for gcc LP64 on cygwin", (LONGINT)41); + OPM_LogWStr(Configuration_versionLong, ((LONGINT)(41))); OPM_LogW('.'); OPM_LogWLn(); OPM_LogWStr((CHAR*)"Based on Ofront by Software Templ OEG, continued by Norayr Chilingarian and others.", (LONGINT)84); diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index 72cb3858..e56dad24 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index 5c5c5010..478ec10b 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPB.h" diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index 6c46f388..6e41e6d9 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index 6fbbdde1..fcfc8cdf 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin tspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" @@ -128,7 +128,7 @@ static INTEGER Ord__7 (CHAR ch, BOOLEAN hex) static void OPS_Number (void) { - INTEGER i, m, n, d, e; + INTEGER i, m, n, d, e, maxHdig; CHAR dig[24]; LONGREAL f; CHAR expCh; @@ -183,8 +183,9 @@ static void OPS_Number (void) } else if (OPS_ch == 'H') { OPM_Get(&OPS_ch); OPS_numtyp = 2; - if (n <= 8) { - if ((n == 8 && dig[0] > '7')) { + maxHdig = 16; + if (n <= maxHdig) { + if ((n == maxHdig && dig[0] > '7')) { OPS_intval = -1; } while (i < n) { diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index 62358186..b0f099c1 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index 9a1045af..e9543cbc 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 99ba8c8a..a1d3e4b5 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 2a83cc64..875f2aed 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPC.h" diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index 23d69e2d..9afa026c 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 1079f225..e16a72de 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index 90e32ce3..f229d6a9 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 152db07b..15cb6037 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index bdc8e2a5..304178b9 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/SYSTEM.h b/bootstrap/windows-88/SYSTEM.h index f9e2f930..41ef9995 100644 --- a/bootstrap/windows-88/SYSTEM.h +++ b/bootstrap/windows-88/SYSTEM.h @@ -49,7 +49,7 @@ #define LONGREAL double #define SYSTEM_PTR void* -// For 32 bit builds, the size of LONGINT depends on a make option: +// For 32 bit builds, the size of LONGINT depends on a make option: #if (__SIZEOF_POINTER__ == 8) || defined(LARGE) || defined(_WIN64) #define INTEGER int // INTEGER is 32 bit. @@ -126,21 +126,21 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __GET(a, x, t) x= *(t*)(uintptr_t)(a) #define __PUT(a, x, t) *(t*)(uintptr_t)(a)=x + #define __LSHL(x, n, t) ((t)((unsigned t)(x)<<(n))) #define __LSHR(x, n, t) ((t)((unsigned t)(x)>>(n))) #define __LSH(x, n, t) ((n)>=0? __LSHL(x, n, t): __LSHR(x, -(n), t)) -#define __ROTL(x, n, t) ((t)((unsigned t)(x)<<(n)|(unsigned t)(x)>>(8*sizeof(t)-(n)))) -#define __ROTR(x, n, t) ((t)((unsigned t)(x)>>(n)|(unsigned t)(x)<<(8*sizeof(t)-(n)))) -#define __LSHR(x, n, t) ((t)((unsigned t)(x)>>(n))) -#define __LSH(x, n, t) ((n)>=0? __LSHL(x, n, t): __LSHR(x, -(n), t)) -#define __ROTL(x, n, t) ((t)((unsigned t)(x)<<(n)|(unsigned t)(x)>>(8*sizeof(t)-(n)))) -#define __ROTR(x, n, t) ((t)((unsigned t)(x)>>(n)|(unsigned t)(x)<<(8*sizeof(t)-(n)))) -#define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) -#define __BIT(x, n) (*(unsigned LONGINT*)(x)>>(n)&1) -#define __MOVE(s, d, n) memcpy((char*)(uintptr_t)(d),(char*)(uintptr_t)(s),n) + #define __ASHL(x, n) ((LONGINT)(x)<<(n)) #define __ASHR(x, n) ((LONGINT)(x)>>(n)) #define __ASH(x, n) ((n)>=0?__ASHL(x,n):__ASHR(x,-(n))) + +#define __ROTL(x, n, t) ((t)((unsigned t)(x)<<(n)|(unsigned t)(x)>>(8*sizeof(t)-(n)))) +#define __ROTR(x, n, t) ((t)((unsigned t)(x)>>(n)|(unsigned t)(x)<<(8*sizeof(t)-(n)))) +#define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) + +#define __BIT(x, n) (*(unsigned LONGINT*)(x)>>(n)&1) +#define __MOVE(s, d, n) memcpy((char*)(uintptr_t)(d),(char*)(uintptr_t)(s),n) #define __ASHF(x, n) SYSTEM_ASH((LONGINT)(x), (LONGINT)(n)) #define __SHORT(x, y) ((int)((unsigned LONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) #define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index c8d54be5..77aeeac7 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index 256941f4..daaf5699 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index 077da855..bf7ca304 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Files.h" diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index 2d4eb745..9b0a8375 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/Vishap.c b/bootstrap/windows-88/Vishap.c index ac122892..adda1b61 100644 --- a/bootstrap/windows-88/Vishap.c +++ b/bootstrap/windows-88/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkamSf */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/windows-88/errors.c b/bootstrap/windows-88/errors.c index 6a733b09..53223732 100644 --- a/bootstrap/windows-88/errors.c +++ b/bootstrap/windows-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/windows-88/errors.h b/bootstrap/windows-88/errors.h index 72bdc98e..12762322 100644 --- a/bootstrap/windows-88/errors.h +++ b/bootstrap/windows-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index 2fd5ccd0..63030983 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index 81db5d3b..3efe7c26 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/vt100.c b/bootstrap/windows-88/vt100.c index c584b083..a59c9241 100644 --- a/bootstrap/windows-88/vt100.c +++ b/bootstrap/windows-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/windows-88/vt100.h b/bootstrap/windows-88/vt100.h index d981ba62..9deec89a 100644 --- a/bootstrap/windows-88/vt100.h +++ b/bootstrap/windows-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/06/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h From 240c29c6dd4ef17159f1d9a6adcd597e17885403 Mon Sep 17 00:00:00 2001 From: David Brown Date: Mon, 11 Jul 2016 12:50:06 +0100 Subject: [PATCH 154/580] Omit config dependent strings from source change tests. --- src/tools/make/sourcechanges.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tools/make/sourcechanges.sh b/src/tools/make/sourcechanges.sh index dbb69c59..4c76f406 100644 --- a/src/tools/make/sourcechanges.sh +++ b/src/tools/make/sourcechanges.sh @@ -14,8 +14,8 @@ changes="0" for f in $1/*; do fn=$(basename $f) - egrep -v "^/\* voc " $f >$fn.old - egrep -v "^/\* voc " $fn >$fn.new + egrep -v "(^/\* voc )|Configuration_|__MOVE.* cmd, " $f >$fn.old + egrep -v "(^/\* voc )|Configuration_|__MOVE.* cmd, " $fn >$fn.new if ! diff -U 2 -b $fn.old $fn.new >$fn.diff; then echo "" echo "" From 9903c9c43531ed20a9ab70597f22251fc491e8a8 Mon Sep 17 00:00:00 2001 From: David C W Brown Date: Thu, 14 Jul 2016 09:44:52 +0100 Subject: [PATCH 155/580] Fix table formatting. --- doc/BasicTypeSize.md | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/doc/BasicTypeSize.md b/doc/BasicTypeSize.md index ab3364fb..a6dc52ef 100644 --- a/doc/BasicTypeSize.md +++ b/doc/BasicTypeSize.md @@ -52,15 +52,15 @@ There are three strategies that clients may wish to use: we fix Oberon type sizes across platforms, and introduce a new LONG64 type as follows: - | Oberon type | Size | - | ----------- | ---------------- | - | BOOLEAN | 8 bits | - | BYTE | 8 bits unsigned | - | SHORTINT | 8 bits signed | - | INTEGER | 16 bits signed | - | LONGINT | 32 bits signed | - | SET | 32 flag bits | - | LONG64 | 64 bits signed | +| Oberon type | Size | +| ----------- | ---------------- | +| BOOLEAN | 8 bits | +| BYTE | 8 bits unsigned | +| SHORTINT | 8 bits signed | +| INTEGER | 16 bits signed | +| LONGINT | 32 bits signed | +| SET | 32 flag bits | +| LONG64 | 64 bits signed | This gives a set of sizes that are available on all platforms (even SDCC supports 64 bit ints), and which have fixed characteristics (e.g. the size of @@ -72,11 +72,11 @@ There are three strategies that clients may wish to use: efficient size available. On x86 we stick with the sizes as above, but for x64 we make changes to INTEGER, LONGINT and SET as follows: - | Oberon type | Size on x64 | - | ----------- | ---------------- | - | INTEGER | 32 bits signed | - | LONGINT | 64 bits signed | - | SET | 64 flag bits | +| Oberon type | Size on x64 | +| ----------- | ---------------- | +| INTEGER | 32 bits signed | +| LONGINT | 64 bits signed | +| SET | 64 flag bits | 3) Supporting system code, especially memory management. From d4fe8b3bdc816871567f5a4c07115ffbec9b6939 Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 14 Jul 2016 16:19:50 +0100 Subject: [PATCH 156/580] Add mingw32 bit build to autobuild. --- src/tools/make/buildall.pl | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/tools/make/buildall.pl b/src/tools/make/buildall.pl index 7cdf2aab..3aeb7d35 100755 --- a/src/tools/make/buildall.pl +++ b/src/tools/make/buildall.pl @@ -9,7 +9,7 @@ my $branch = "master"; my %machines = ( "pi" => ['pi@pie', "sudo", "make full", "projects/oberon/vishap/voc"], "darwin" => ['dave@dcb', "sudo", "make full", "projects/oberon/vishap/voc"], - "wind" => ['-p5932 dave@wax', "", "make full", "vishaps/voc"], + "wind" => ['-p5932 dave@wax', "", "sh makeall.sh", "~"], "lub32" => ['dave@lub32', "sudo", "make full", "vishap/voc"], "ob32" => ['root@nas-ob32', "", "make full", "vishap/voc"], "ce64" => ['-p5922 obe@www', "sudo", "make full", "vishap/voc"], @@ -75,7 +75,15 @@ sub parselog { my $tests = ""; open(my $log, $fn) // die "Couldn't open build log $fn."; while (<$log>) { - if (/^([0-9\/]+) ([0-9.]+) .+\.log$/) {$date = $1; $time = $2} + if (/^([0-9\/]+) ([0-9.]+) .+\.log$/) { + if ($date ne "") { # Write previous make status + my $key = "$os-$compiler-$datamodel"; + if ($key ne "") { + $status{$key} = [$fn, $date, $time, $os, $compiler, $datamodel, $branch, $compilerok, $libraryok, $sourcechange, $tests]; + } + } + $date = $1; $time = $2 + } if (/^[^ ]+ --- Cleaning branch ([^ ]+) ([^ ]+) ([^ ]+) ([^ ]+) ---$/) { ($branch, $os, $compiler, $datamodel) = ($1, $2, $3, $4, $5); } From e8738e51de414825b24cf82be9286ff6969704a3 Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 14 Jul 2016 17:01:20 +0100 Subject: [PATCH 157/580] Add termux build to buildall. --- src/tools/make/buildall.pl | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/tools/make/buildall.pl b/src/tools/make/buildall.pl index 3aeb7d35..160de3b0 100755 --- a/src/tools/make/buildall.pl +++ b/src/tools/make/buildall.pl @@ -7,14 +7,15 @@ use Cwd; my $branch = "master"; my %machines = ( - "pi" => ['pi@pie', "sudo", "make full", "projects/oberon/vishap/voc"], - "darwin" => ['dave@dcb', "sudo", "make full", "projects/oberon/vishap/voc"], - "wind" => ['-p5932 dave@wax', "", "sh makeall.sh", "~"], - "lub32" => ['dave@lub32', "sudo", "make full", "vishap/voc"], - "ob32" => ['root@nas-ob32', "", "make full", "vishap/voc"], - "ce64" => ['-p5922 obe@www', "sudo", "make full", "vishap/voc"], - "ub64" => ['dave@nas-ub64', "sudo", "make full", "vishap/voc"], - "fb64" => ['root@oberon', "", "make full", "vishap/voc"] + "pi" => ['pi@pie', "sudo", "make full", "projects/oberon/vishap/voc"], + "darwin" => ['dave@dcb', "sudo", "make full", "projects/oberon/vishap/voc"], + "wind" => ['-p5932 dave@wax', "", "sh makeall.sh", "~"], + "android" => ['-p8022 root@and', "", "sh makeall.sh", "~"], + "lub32" => ['dave@lub32', "sudo", "make full", "vishap/voc"], + "ob32" => ['root@nas-ob32', "", "make full", "vishap/voc"], + "ce64" => ['-p5922 obe@www', "sudo", "make full", "vishap/voc"], + "ub64" => ['dave@nas-ub64', "sudo", "make full", "vishap/voc"], + "fb64" => ['root@oberon', "", "make full", "vishap/voc"] ); @@ -73,11 +74,12 @@ sub parselog { my $libraryok = ""; my $sourcechange = ""; my $tests = ""; + my $key = ""; open(my $log, $fn) // die "Couldn't open build log $fn."; while (<$log>) { if (/^([0-9\/]+) ([0-9.]+) .+\.log$/) { if ($date ne "") { # Write previous make status - my $key = "$os-$compiler-$datamodel"; + $key = "$os-$compiler-$datamodel"; if ($key ne "") { $status{$key} = [$fn, $date, $time, $os, $compiler, $datamodel, $branch, $compilerok, $libraryok, $sourcechange, $tests]; } @@ -97,7 +99,7 @@ sub parselog { if (/^([0-9.]+) --- Confidence tests passed ---$/) {$tests = "Passed";} } close($log); - my $key = "$os-$compiler-$datamodel"; + $key = "$os-$compiler-$datamodel"; if ($key ne "") { $status{$key} = [$fn, $date, $time, $os, $compiler, $datamodel, $branch, $compilerok, $libraryok, $sourcechange, $tests]; } From 9145a64b4477f877d0ddd325cbc763705b418953 Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 14 Jul 2016 18:06:20 +0100 Subject: [PATCH 158/580] Fix buildall build directories for windows and android. --- src/tools/make/buildall.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tools/make/buildall.pl b/src/tools/make/buildall.pl index 160de3b0..9239873c 100755 --- a/src/tools/make/buildall.pl +++ b/src/tools/make/buildall.pl @@ -9,8 +9,8 @@ my $branch = "master"; my %machines = ( "pi" => ['pi@pie', "sudo", "make full", "projects/oberon/vishap/voc"], "darwin" => ['dave@dcb', "sudo", "make full", "projects/oberon/vishap/voc"], - "wind" => ['-p5932 dave@wax', "", "sh makeall.sh", "~"], - "android" => ['-p8022 root@and', "", "sh makeall.sh", "~"], + "wind" => ['-p5932 dave@wax', "", "sh ~/makeall.sh", "vishaps/voc"], + "android" => ['-p8022 root@and', "", "sh ~/makeall.sh", "vishap/voc"], "lub32" => ['dave@lub32', "sudo", "make full", "vishap/voc"], "ob32" => ['root@nas-ob32', "", "make full", "vishap/voc"], "ce64" => ['-p5922 obe@www', "sudo", "make full", "vishap/voc"], From a42d4c4a03a3d671bf831aa9f4d6937451e68a0d Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 14 Jul 2016 19:39:32 +0100 Subject: [PATCH 159/580] Another try at handling the Windows twofold build. --- src/tools/make/buildall.pl | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/src/tools/make/buildall.pl b/src/tools/make/buildall.pl index 9239873c..1c46e7f1 100755 --- a/src/tools/make/buildall.pl +++ b/src/tools/make/buildall.pl @@ -60,6 +60,14 @@ while ((my $pid = wait) > 0) {print "Child pid $pid completed.\n";} my %status = (); +sub logstatus { + my ($fn, $date, $time, $os, $compiler, $datamodel, $branch, $compilerok, $libraryok, $sourcechange, $tests) = @_; + if ($compiler ne "") { + $status{$os-$compiler-$datamodel} = + [$fn, $date, $time, $os, $compiler, $datamodel, $branch, $compilerok, $libraryok, $sourcechange, $tests]; + } +} + sub parselog { my ($fn) = @_; @@ -75,34 +83,29 @@ sub parselog { my $sourcechange = ""; my $tests = ""; my $key = ""; + my $ver = ""; open(my $log, $fn) // die "Couldn't open build log $fn."; while (<$log>) { - if (/^([0-9\/]+) ([0-9.]+) .+\.log$/) { - if ($date ne "") { # Write previous make status - $key = "$os-$compiler-$datamodel"; - if ($key ne "") { - $status{$key} = [$fn, $date, $time, $os, $compiler, $datamodel, $branch, $compilerok, $libraryok, $sourcechange, $tests]; - } - } - $date = $1; $time = $2 + if (/^([0-9\/]+) ([0-9.]+) .+\.log$/) {$date = $1} + if (/^([0-9.]+) /) {$time = $1} + if (/^[^ ]+ Configuration: ([0-9a-zA-Z.]+) \[[0-9\/]+\] for (.+) *$/) { + logstatus($fn, $date, $time, $os, $compiler, $datamodel, $branch, $compilerok, $libraryok, $sourcechange, $tests); + $ver = $1; } if (/^[^ ]+ --- Cleaning branch ([^ ]+) ([^ ]+) ([^ ]+) ([^ ]+) ---$/) { ($branch, $os, $compiler, $datamodel) = ($1, $2, $3, $4, $5); } - if (/^([0-9.]+) --- Compiler build started ---$/) {$compilerok = "Started";} + if (/^([0-9.]+) --- Compiler build started ---$/) {$compilerok = "Failed";} if (/^([0-9.]+) --- Compiler build successfull ---$/) {$compilerok = "Built";} - if (/^([0-9.]+) --- Library build started ---$/) {$libraryok = "Started";} + if (/^([0-9.]+) --- Library build started ---$/) {$libraryok = "Failed";} if (/^([0-9.]+) --- Library build successfull ---$/) {$libraryok = "Built";} if (/^([0-9.]+) --- Generated c source files match bootstrap ---$/) {$sourcechange = "Unchanged";} if (/^([0-9.]+) --- Generated c source files differ from bootstrap ---$/) {$sourcechange = "Changed";} - if (/^([0-9.]+) --- Confidence tests started ---$/) {$tests = "Started";} + if (/^([0-9.]+) --- Confidence tests started ---$/) {$tests = "Failed";} if (/^([0-9.]+) --- Confidence tests passed ---$/) {$tests = "Passed";} } close($log); - $key = "$os-$compiler-$datamodel"; - if ($key ne "") { - $status{$key} = [$fn, $date, $time, $os, $compiler, $datamodel, $branch, $compilerok, $libraryok, $sourcechange, $tests]; - } + logstatus($fn, $date, $time, $os, $compiler, $datamodel, $branch, $compilerok, $libraryok, $sourcechange, $tests); } opendir DIR, "log" // die "Could not open log directory."; From 73ff9f50a201acf72adb3625978e5d88cf983ba4 Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 14 Jul 2016 20:14:23 +0100 Subject: [PATCH 160/580] Try again to handle multifold builds without losing singlefold build status. --- src/tools/make/buildall.pl | 68 ++++++++++++++++++++++---------------- 1 file changed, 39 insertions(+), 29 deletions(-) diff --git a/src/tools/make/buildall.pl b/src/tools/make/buildall.pl index 1c46e7f1..45e6073d 100755 --- a/src/tools/make/buildall.pl +++ b/src/tools/make/buildall.pl @@ -60,37 +60,47 @@ while ((my $pid = wait) > 0) {print "Child pid $pid completed.\n";} my %status = (); -sub logstatus { - my ($fn, $date, $time, $os, $compiler, $datamodel, $branch, $compilerok, $libraryok, $sourcechange, $tests) = @_; - if ($compiler ne "") { - $status{$os-$compiler-$datamodel} = - [$fn, $date, $time, $os, $compiler, $datamodel, $branch, $compilerok, $libraryok, $sourcechange, $tests]; - } +my $fn; +my $date; +my $time; +my $branch; +my $os; +my $compiler; +my $datamodel; +my $compilerok; +my $libraryok; +my $sourcechange; +my $tests; +my $key; +my $ver; + +sub clearvars { + $time = ""; $branch = ""; $os = ""; $compiler = ""; + $datamodel = ""; $compilerok = ""; $libraryok = ""; $sourcechange = ""; + $tests = ""; $key = ""; $ver = ""; } +sub logstatus { + my ($fn) = @_; + if ($compiler ne "") { + $status{"$os-$compiler-$datamodel"} = + [$fn, $date, $time, $os, $compiler, $datamodel, $branch, $compilerok, $libraryok, $sourcechange, $tests]; + } + clearvars(); +} sub parselog { - my ($fn) = @_; - #print "Parsing log $fn\n"; - my $date = ""; - my $time = ""; - my $branch = ""; - my $os = ""; - my $compiler = ""; - my $datamodel = ""; - my $compilerok = ""; - my $libraryok = ""; - my $sourcechange = ""; - my $tests = ""; - my $key = ""; - my $ver = ""; + ($fn) = @_; + clearvars(); open(my $log, $fn) // die "Couldn't open build log $fn."; while (<$log>) { if (/^([0-9\/]+) ([0-9.]+) .+\.log$/) {$date = $1} - if (/^([0-9.]+) /) {$time = $1} + if (/^([0-9.]+) /) {$time = $1} + # 19.39.58 Configuration: 1.95 [2016/07/14] for gcc LP64 on centos if (/^[^ ]+ Configuration: ([0-9a-zA-Z.]+) \[[0-9\/]+\] for (.+) *$/) { - logstatus($fn, $date, $time, $os, $compiler, $datamodel, $branch, $compilerok, $libraryok, $sourcechange, $tests); + logstatus($fn); $ver = $1; + printf "--- Config for $fn: $1 for $2.\n"; } if (/^[^ ]+ --- Cleaning branch ([^ ]+) ([^ ]+) ([^ ]+) ([^ ]+) ---$/) { ($branch, $os, $compiler, $datamodel) = ($1, $2, $3, $4, $5); @@ -105,7 +115,7 @@ sub parselog { if (/^([0-9.]+) --- Confidence tests passed ---$/) {$tests = "Passed";} } close($log); - logstatus($fn, $date, $time, $os, $compiler, $datamodel, $branch, $compilerok, $libraryok, $sourcechange, $tests); + logstatus($fn); } opendir DIR, "log" // die "Could not open log directory."; @@ -134,7 +144,7 @@ sub svgtext { my $rows = keys %status; -my $width = 620; +my $width = 630; my $height = ($rows+2.2) * $lineheight; open(my $svg, ">build-status.svg") // die "Could not create build-status.svg."; @@ -150,11 +160,11 @@ my $col2 = 97; my $col3 = 160; my $col4 = 220; my $col5 = 280; -my $col6 = 320; -my $col7 = 370; -my $col8 = 430; -my $col9 = 480; -my $col10 = 560; +my $col6 = 330; +my $col7 = 380; +my $col8 = 440; +my $col9 = 490; +my $col10 = 570; svgtext($svg, $col1, 0, "#e0e0e0", "Date"); svgtext($svg, $col3, 0, "#e0e0e0", "Branch"); From 16072f9dc37fb57300dba02a15f99f6fdbefc733 Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 15 Jul 2016 12:57:31 +0100 Subject: [PATCH 161/580] Move all build commands back into buildall.pl. --- src/tools/make/buildall.pl | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/tools/make/buildall.pl b/src/tools/make/buildall.pl index 45e6073d..5fd2a729 100755 --- a/src/tools/make/buildall.pl +++ b/src/tools/make/buildall.pl @@ -7,15 +7,16 @@ use Cwd; my $branch = "master"; my %machines = ( - "pi" => ['pi@pie', "sudo", "make full", "projects/oberon/vishap/voc"], - "darwin" => ['dave@dcb', "sudo", "make full", "projects/oberon/vishap/voc"], - "wind" => ['-p5932 dave@wax', "", "sh ~/makeall.sh", "vishaps/voc"], - "android" => ['-p8022 root@and', "", "sh ~/makeall.sh", "vishap/voc"], - "lub32" => ['dave@lub32', "sudo", "make full", "vishap/voc"], - "ob32" => ['root@nas-ob32', "", "make full", "vishap/voc"], - "ce64" => ['-p5922 obe@www', "sudo", "make full", "vishap/voc"], - "ub64" => ['dave@nas-ub64', "sudo", "make full", "vishap/voc"], - "fb64" => ['root@oberon', "", "make full", "vishap/voc"] + "pi" => ['pi@pie', "sudo", "projects/oberon/vishap/voc", "make full"] + "darwin" => ['dave@dcb', "sudo", "projects/oberon/vishap/voc", "make full"] + "wind" => ['-p5932 dave@wax', "", "vishaps/voc", "export CC=gcc && make full;" + . "export CC=i686-w64-mingw32-gcc && make full"] + "android" => ['-p8022 root@and', "", "vishap/voc", "export CC=gcc && make full"] + "lub32" => ['dave@lub32', "sudo", "vishap/voc", "make full"] + "ob32" => ['root@nas-ob32', "", "vishap/voc", "make full"] + "ce64" => ['-p5922 obe@www', "sudo", "vishap/voc", "make full"] + "ub64" => ['dave@nas-ub64', "sudo", "vishap/voc", "make full"] + "fb64" => ['root@oberon', "", "vishap/voc", "make full"] ); From 77f8280e90ff57c2774468c99fe905566c4fc2f8 Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 15 Jul 2016 13:00:27 +0100 Subject: [PATCH 162/580] Missingg comma typo in buildall.pl. --- src/tools/make/buildall.pl | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/tools/make/buildall.pl b/src/tools/make/buildall.pl index 5fd2a729..08659521 100755 --- a/src/tools/make/buildall.pl +++ b/src/tools/make/buildall.pl @@ -7,15 +7,15 @@ use Cwd; my $branch = "master"; my %machines = ( - "pi" => ['pi@pie', "sudo", "projects/oberon/vishap/voc", "make full"] - "darwin" => ['dave@dcb', "sudo", "projects/oberon/vishap/voc", "make full"] + "pi" => ['pi@pie', "sudo", "projects/oberon/vishap/voc", "make full"], + "darwin" => ['dave@dcb', "sudo", "projects/oberon/vishap/voc", "make full"], "wind" => ['-p5932 dave@wax', "", "vishaps/voc", "export CC=gcc && make full;" - . "export CC=i686-w64-mingw32-gcc && make full"] - "android" => ['-p8022 root@and', "", "vishap/voc", "export CC=gcc && make full"] - "lub32" => ['dave@lub32', "sudo", "vishap/voc", "make full"] - "ob32" => ['root@nas-ob32', "", "vishap/voc", "make full"] - "ce64" => ['-p5922 obe@www', "sudo", "vishap/voc", "make full"] - "ub64" => ['dave@nas-ub64', "sudo", "vishap/voc", "make full"] + . "export CC=i686-w64-mingw32-gcc && make full"], + "android" => ['-p8022 root@and', "", "vishap/voc", "export CC=gcc && make full"], + "lub32" => ['dave@lub32', "sudo", "vishap/voc", "make full"], + "ob32" => ['root@nas-ob32', "", "vishap/voc", "make full"], + "ce64" => ['-p5922 obe@www', "sudo", "vishap/voc", "make full"], + "ub64" => ['dave@nas-ub64', "sudo", "vishap/voc", "make full"], "fb64" => ['root@oberon', "", "vishap/voc", "make full"] ); From 8bf94eddfe13ff4d1fd3fa3e387e60afa29e181c Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 15 Jul 2016 13:05:21 +0100 Subject: [PATCH 163/580] Still getting buildall.pl right. --- src/tools/make/buildall.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/make/buildall.pl b/src/tools/make/buildall.pl index 08659521..512e32d5 100755 --- a/src/tools/make/buildall.pl +++ b/src/tools/make/buildall.pl @@ -48,7 +48,7 @@ sub logged { unlink glob "log/*"; for my $machine (sort keys %machines) { - my ($login, $sudo, $mkcmd, $dir) = @{$machines{$machine}}; + my ($login, $sudo, $dir, $mkcmd) = @{$machines{$machine}}; my $cmd = "ssh $login \"cd $dir && $sudo git checkout $branch && $sudo git pull && $sudo $mkcmd\" "; logged($cmd, $machine); } From 86de8a6fe5286090ac614e3c3e316cf3d2faa373 Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 15 Jul 2016 15:12:08 +0100 Subject: [PATCH 164/580] Try adding cygwin and mingw 64 bit builds. --- src/tools/make/buildall.pl | 6 +++++- src/tools/make/postpush.pl | 6 +++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/tools/make/buildall.pl b/src/tools/make/buildall.pl index 512e32d5..939888ff 100755 --- a/src/tools/make/buildall.pl +++ b/src/tools/make/buildall.pl @@ -10,7 +10,11 @@ my %machines = ( "pi" => ['pi@pie', "sudo", "projects/oberon/vishap/voc", "make full"], "darwin" => ['dave@dcb', "sudo", "projects/oberon/vishap/voc", "make full"], "wind" => ['-p5932 dave@wax', "", "vishaps/voc", "export CC=gcc && make full;" - . "export CC=i686-w64-mingw32-gcc && make full"], + . "export CC=i686-w64-mingw32-gcc && make full;" + . "cd ~;" + . "sh start64.sh \"cd vishaps/voc && git checkout $branch && git pull\";"], + . "sh start64.sh \"cd vishaps/voc && make full\";" + . "sh start64.sh \"cd vishaps/voc && export CC=x86_64-w64-mingw32-gcc && make full\""], "android" => ['-p8022 root@and', "", "vishap/voc", "export CC=gcc && make full"], "lub32" => ['dave@lub32', "sudo", "vishap/voc", "make full"], "ob32" => ['root@nas-ob32', "", "vishap/voc", "make full"], diff --git a/src/tools/make/postpush.pl b/src/tools/make/postpush.pl index cbf82ca9..60636a8c 100755 --- a/src/tools/make/postpush.pl +++ b/src/tools/make/postpush.pl @@ -43,9 +43,9 @@ if ($buildneeded) { writelog "Started buildall, pid = $child."; # parent process } else { close(STDIN); close(STDOUT); close(STDERR); # child process - unlink "buildall.pl"; - sleep 5; # Leave time for the push to complete. (Yuk!) - system 'wget https://raw.githubusercontent.com/vishaps/voc/master/src/tools/make/buildall.pl'; + # unlink "buildall.pl"; + sleep 10; # Leave time for github to have the new version ready. (Yuk!) + system 'curl https://raw.githubusercontent.com/vishaps/voc/master/src/tools/make/buildall.pl >buildall.pl'; exec 'perl buildall.pl >/tmp/buildall.log'; exit; } From b5dbf13af4a7ab91dd7c0b44c571b08cd1286d67 Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 15 Jul 2016 15:30:26 +0100 Subject: [PATCH 165/580] Try using git pull to get updated buildall.pl as raw fetch is never up to date. --- src/tools/make/postpush.pl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/tools/make/postpush.pl b/src/tools/make/postpush.pl index 60636a8c..0ef53b72 100755 --- a/src/tools/make/postpush.pl +++ b/src/tools/make/postpush.pl @@ -43,9 +43,9 @@ if ($buildneeded) { writelog "Started buildall, pid = $child."; # parent process } else { close(STDIN); close(STDOUT); close(STDERR); # child process - # unlink "buildall.pl"; - sleep 10; # Leave time for github to have the new version ready. (Yuk!) - system 'curl https://raw.githubusercontent.com/vishaps/voc/master/src/tools/make/buildall.pl >buildall.pl'; + #sleep 5; # Leave time for github to have the new version ready. (Yuk!) + system 'cd voc && git pull'; + system 'cd ~ && cp voc/src/tools/make/buildall.pl .'; exec 'perl buildall.pl >/tmp/buildall.log'; exit; } From c7511287bb269c555e27afb8054e8764b665368c Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 15 Jul 2016 15:42:37 +0100 Subject: [PATCH 166/580] Fix mismatchedbracket in buildall.pl. --- src/tools/make/buildall.pl | 2 +- src/tools/make/postpush.pl | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/tools/make/buildall.pl b/src/tools/make/buildall.pl index 939888ff..b2536704 100755 --- a/src/tools/make/buildall.pl +++ b/src/tools/make/buildall.pl @@ -12,7 +12,7 @@ my %machines = ( "wind" => ['-p5932 dave@wax', "", "vishaps/voc", "export CC=gcc && make full;" . "export CC=i686-w64-mingw32-gcc && make full;" . "cd ~;" - . "sh start64.sh \"cd vishaps/voc && git checkout $branch && git pull\";"], + . "sh start64.sh \"cd vishaps/voc && git checkout $branch && git pull\";" . "sh start64.sh \"cd vishaps/voc && make full\";" . "sh start64.sh \"cd vishaps/voc && export CC=x86_64-w64-mingw32-gcc && make full\""], "android" => ['-p8022 root@and', "", "vishap/voc", "export CC=gcc && make full"], diff --git a/src/tools/make/postpush.pl b/src/tools/make/postpush.pl index 0ef53b72..43a4b548 100755 --- a/src/tools/make/postpush.pl +++ b/src/tools/make/postpush.pl @@ -43,10 +43,8 @@ if ($buildneeded) { writelog "Started buildall, pid = $child."; # parent process } else { close(STDIN); close(STDOUT); close(STDERR); # child process - #sleep 5; # Leave time for github to have the new version ready. (Yuk!) - system 'cd voc && git pull'; - system 'cd ~ && cp voc/src/tools/make/buildall.pl .'; - exec 'perl buildall.pl >/tmp/buildall.log'; + system '(cd voc && git pull) >postpush.log'; + exec 'perl voc/src/tools/make/buildall.pl >/tmp/buildall.log'; exit; } } else { From 347cefc614becd10bfff776d520c264327b86e3a Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 15 Jul 2016 16:58:45 +0100 Subject: [PATCH 167/580] Fix quoting of parameters passed through to 64 bit shell. --- src/tools/make/buildall.pl | 24 +++++++++++++++++++++--- src/tools/make/postpush.pl | 3 ++- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/src/tools/make/buildall.pl b/src/tools/make/buildall.pl index b2536704..e00b76d5 100755 --- a/src/tools/make/buildall.pl +++ b/src/tools/make/buildall.pl @@ -6,15 +6,33 @@ use Cwd; my $branch = "master"; +---- + +my $mkcmd = +# "export CC=gcc && make full;" +# . "export CC=i686-w64-mingw32-gcc && make full;" +# . + "cd ~;" +. "sh start64.sh \\\"cd vishaps/voc && git checkout $branch && git pull;" + . "make full;" + . "export CC=x86_64-w64-mingw32-gcc && make full\\\""; + +my $cmd = "ssh -p5932 dave\@wax \"cd vishaps/voc && git checkout $branch && git pull && $mkcmd\" "; +print $cmd, "\n"; + +system($cmd); + +---- + my %machines = ( "pi" => ['pi@pie', "sudo", "projects/oberon/vishap/voc", "make full"], "darwin" => ['dave@dcb', "sudo", "projects/oberon/vishap/voc", "make full"], "wind" => ['-p5932 dave@wax', "", "vishaps/voc", "export CC=gcc && make full;" . "export CC=i686-w64-mingw32-gcc && make full;" . "cd ~;" - . "sh start64.sh \"cd vishaps/voc && git checkout $branch && git pull\";" - . "sh start64.sh \"cd vishaps/voc && make full\";" - . "sh start64.sh \"cd vishaps/voc && export CC=x86_64-w64-mingw32-gcc && make full\""], + . "sh start64.sh \\\"cd vishaps/voc && git checkout $branch && git pull;" + . "make full;" + . "export CC=x86_64-w64-mingw32-gcc && make full\\\""], "android" => ['-p8022 root@and', "", "vishap/voc", "export CC=gcc && make full"], "lub32" => ['dave@lub32', "sudo", "vishap/voc", "make full"], "ob32" => ['root@nas-ob32', "", "vishap/voc", "make full"], diff --git a/src/tools/make/postpush.pl b/src/tools/make/postpush.pl index 43a4b548..2b3a2ad6 100755 --- a/src/tools/make/postpush.pl +++ b/src/tools/make/postpush.pl @@ -43,7 +43,8 @@ if ($buildneeded) { writelog "Started buildall, pid = $child."; # parent process } else { close(STDIN); close(STDOUT); close(STDERR); # child process - system '(cd voc && git pull) >postpush.log'; + system 'echo Syncing voc>postpush.log'; + system '(cd voc && git pull) >>postpush.log'; exec 'perl voc/src/tools/make/buildall.pl >/tmp/buildall.log'; exit; } From 64790ceff7bb1a3a3f31c0f6363ea85a9428add3 Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 15 Jul 2016 17:02:15 +0100 Subject: [PATCH 168/580] Remove invalid working source. --- src/tools/make/buildall.pl | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/src/tools/make/buildall.pl b/src/tools/make/buildall.pl index e00b76d5..b15f7b79 100755 --- a/src/tools/make/buildall.pl +++ b/src/tools/make/buildall.pl @@ -6,24 +6,6 @@ use Cwd; my $branch = "master"; ----- - -my $mkcmd = -# "export CC=gcc && make full;" -# . "export CC=i686-w64-mingw32-gcc && make full;" -# . - "cd ~;" -. "sh start64.sh \\\"cd vishaps/voc && git checkout $branch && git pull;" - . "make full;" - . "export CC=x86_64-w64-mingw32-gcc && make full\\\""; - -my $cmd = "ssh -p5932 dave\@wax \"cd vishaps/voc && git checkout $branch && git pull && $mkcmd\" "; -print $cmd, "\n"; - -system($cmd); - ----- - my %machines = ( "pi" => ['pi@pie', "sudo", "projects/oberon/vishap/voc", "make full"], "darwin" => ['dave@dcb', "sudo", "projects/oberon/vishap/voc", "make full"], From d3ee82a0c4d4d2c411acac48514ddd692d68abcb Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 15 Jul 2016 17:23:04 +0100 Subject: [PATCH 169/580] Remove invalid working source. --- src/tools/make/buildall.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/make/buildall.pl b/src/tools/make/buildall.pl index b15f7b79..204b6a2d 100755 --- a/src/tools/make/buildall.pl +++ b/src/tools/make/buildall.pl @@ -13,7 +13,7 @@ my %machines = ( . "export CC=i686-w64-mingw32-gcc && make full;" . "cd ~;" . "sh start64.sh \\\"cd vishaps/voc && git checkout $branch && git pull;" - . "make full;" + . "export CC=gcc && make full;" . "export CC=x86_64-w64-mingw32-gcc && make full\\\""], "android" => ['-p8022 root@and', "", "vishap/voc", "export CC=gcc && make full"], "lub32" => ['dave@lub32', "sudo", "vishap/voc", "make full"], From 5b77460e4fa72762b7e03068f35e37158227eaa8 Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 15 Jul 2016 20:26:40 +0100 Subject: [PATCH 170/580] Use typedefs rather than defines for basic types. --- src/system/SYSTEM.c | 20 +++++++------- src/system/SYSTEM.h | 54 ++++++++++++++++++++++--------------- src/system/WindowsWrapper.h | 7 ++--- 3 files changed, 46 insertions(+), 35 deletions(-) diff --git a/src/system/SYSTEM.c b/src/system/SYSTEM.c index 0fcc5ee2..50e91c6d 100644 --- a/src/system/SYSTEM.c +++ b/src/system/SYSTEM.c @@ -36,7 +36,7 @@ void SYSTEM_ENUMP(void *adr, LONGINT n, void (*P)()) { while (n > 0) { P((LONGINT)(uintptr_t)(*((void**)(adr)))); - adr = ((void**)adr) + 1; + adr = ((void**)adr) + 1; n--; } } @@ -49,18 +49,18 @@ void SYSTEM_ENUMR(void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()) t = typ; off = *t; while (off >= 0) {P(*(LONGINT*)((char*)adr+off)); t++; off = *t;} - adr = ((char*)adr) + size; + adr = ((char*)adr) + size; n--; } } -LONGINT SYSTEM_DIV(unsigned LONGINT x, unsigned LONGINT y) +LONGINT SYSTEM_DIV(U_LONGINT x, U_LONGINT y) { if ((LONGINT) x >= 0) return (x / y); else return -((y - 1 - x) / y); } -LONGINT SYSTEM_MOD(unsigned LONGINT x, unsigned LONGINT y) -{ unsigned LONGINT m; +LONGINT SYSTEM_MOD(U_LONGINT x, U_LONGINT y) +{ U_LONGINT m; if ((LONGINT) x >= 0) return (x % y); else { m = (-x) % y; if (m != 0) return (y - m); else return 0; @@ -171,29 +171,29 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler SystemSignalHandler SystemInterruptHandler = 0; SystemSignalHandler SystemQuitHandler = 0; BOOL ConsoleCtrlHandlerSet = FALSE; - + BOOL WINAPI SystemConsoleCtrlHandler(DWORD ctrlType) { if ((ctrlType == CTRL_C_EVENT) || (ctrlType == CTRL_BREAK_EVENT)) { if (SystemInterruptHandler) { SystemInterruptHandler(2); // SIGINT return TRUE; - } + } } else { // Close, logoff or shutdown - if (SystemQuitHandler) { + if (SystemQuitHandler) { SystemQuitHandler(3); // SIGQUIT return TRUE; } } return FALSE; } - + void EnsureConsoleCtrlHandler() { if (!ConsoleCtrlHandlerSet) { SetConsoleCtrlHandler(SystemConsoleCtrlHandler, TRUE); ConsoleCtrlHandlerSet = TRUE; } } - + void SystemSetInterruptHandler(uintptr_t h) { EnsureConsoleCtrlHandler(); SystemInterruptHandler = (SystemSignalHandler)h; diff --git a/src/system/SYSTEM.h b/src/system/SYSTEM.h index 41ef9995..420ca1cd 100644 --- a/src/system/SYSTEM.h +++ b/src/system/SYSTEM.h @@ -41,25 +41,35 @@ // Oberon types -#define BOOLEAN char -#define SYSTEM_BYTE unsigned char -#define CHAR unsigned char -#define SHORTINT signed char -#define REAL float -#define LONGREAL double -#define SYSTEM_PTR void* +typedef char BOOLEAN; +typedef unsigned char SYSTEM_BYTE; +typedef unsigned char CHAR; +typedef signed char SHORTINT; +typedef float REAL; +typedef double LONGREAL; +typedef void* SYSTEM_PTR; + +// Unsigned variants are for use by shift and rotate macros. + +typedef unsigned char U_SYSTEM_BYTE; +typedef unsigned char U_CHAR; +typedef unsigned char U_SHORTINT; // For 32 bit builds, the size of LONGINT depends on a make option: #if (__SIZEOF_POINTER__ == 8) || defined(LARGE) || defined(_WIN64) - #define INTEGER int // INTEGER is 32 bit. - #define LONGINT long long // LONGINT is 64 bit. (long long is always 64 bits, while long can be 32 bits e.g. under MSC/MingW) + typedef int INTEGER; // INTEGER is 32 bit. + typedef long long LONGINT; // LONGINT is 64 bit. (long long is always 64 bits, while long can be 32 bits e.g. under MSC/MingW) + typedef int U_INTEGER; + typedef unsigned long long U_LONGINT; #else - #define INTEGER short int // INTEGER is 16 bit. - #define LONGINT long // LONGINT is 32 bit. + typedef short int INTEGER; // INTEGER is 16 bit. + typedef long LONGINT; // LONGINT is 32 bit. + typedef unsigned short int U_INTEGER; + typedef unsigned long U_LONGINT; #endif -#define SET unsigned LONGINT +typedef U_LONGINT SET; // OS Memory allocation interfaces are in PlatformXXX.Mod @@ -78,8 +88,8 @@ extern double SYSTEM_ABSD (double i); extern void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0); extern void SYSTEM_ENUMP (void *adr, LONGINT n, void (*P)()); extern void SYSTEM_ENUMR (void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()); -extern LONGINT SYSTEM_DIV (unsigned LONGINT x, unsigned LONGINT y); -extern LONGINT SYSTEM_MOD (unsigned LONGINT x, unsigned LONGINT y); +extern LONGINT SYSTEM_DIV (U_LONGINT x, U_LONGINT y); +extern LONGINT SYSTEM_MOD (U_LONGINT x, U_LONGINT y); extern LONGINT SYSTEM_ENTIER (double x); @@ -127,22 +137,22 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __GET(a, x, t) x= *(t*)(uintptr_t)(a) #define __PUT(a, x, t) *(t*)(uintptr_t)(a)=x -#define __LSHL(x, n, t) ((t)((unsigned t)(x)<<(n))) -#define __LSHR(x, n, t) ((t)((unsigned t)(x)>>(n))) +#define __LSHL(x, n, t) ((t)((U_##t)(x)<<(n))) +#define __LSHR(x, n, t) ((t)((U_##t)(x)>>(n))) #define __LSH(x, n, t) ((n)>=0? __LSHL(x, n, t): __LSHR(x, -(n), t)) #define __ASHL(x, n) ((LONGINT)(x)<<(n)) #define __ASHR(x, n) ((LONGINT)(x)>>(n)) #define __ASH(x, n) ((n)>=0?__ASHL(x,n):__ASHR(x,-(n))) -#define __ROTL(x, n, t) ((t)((unsigned t)(x)<<(n)|(unsigned t)(x)>>(8*sizeof(t)-(n)))) -#define __ROTR(x, n, t) ((t)((unsigned t)(x)>>(n)|(unsigned t)(x)<<(8*sizeof(t)-(n)))) +#define __ROTL(x, n, t) ((t)((U_##t)(x)<<(n)|(U_##t)(x)>>(8*sizeof(t)-(n)))) +#define __ROTR(x, n, t) ((t)((U_##t)(x)>>(n)|(U_##t)(x)<<(8*sizeof(t)-(n)))) #define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) -#define __BIT(x, n) (*(unsigned LONGINT*)(x)>>(n)&1) +#define __BIT(x, n) (*(U_LONGINT*)(x)>>(n)&1) #define __MOVE(s, d, n) memcpy((char*)(uintptr_t)(d),(char*)(uintptr_t)(s),n) #define __ASHF(x, n) SYSTEM_ASH((LONGINT)(x), (LONGINT)(n)) -#define __SHORT(x, y) ((int)((unsigned LONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) +#define __SHORT(x, y) ((int)((U_LONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) #define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) #define __CHR(x) ((CHAR)__R(x, 256)) #define __CHRF(x) ((CHAR)__RF(x, 256)) @@ -165,9 +175,9 @@ static int __str_cmp(CHAR *x, CHAR *y){ // Runtime checks -#define __X(i, ub) (((unsigned LONGINT)(i)<(unsigned LONGINT)(ub))?i:(__HALT(-2),0)) +#define __X(i, ub) (((U_LONGINT)(i)<(U_LONGINT)(ub))?i:(__HALT(-2),0)) #define __XF(i, ub) SYSTEM_XCHK((LONGINT)(i), (LONGINT)(ub)) -#define __R(i, ub) (((unsigned LONGINT)(i)<(unsigned LONGINT)(ub))?i:(__HALT(-8),0)) +#define __R(i, ub) (((U_LONGINT)(i)<(U_LONGINT)(ub))?i:(__HALT(-8),0)) #define __RF(i, ub) SYSTEM_RCHK((LONGINT)(i),(LONGINT)(ub)) #define __RETCHK __retchk: __HALT(-3); return 0; #define __CASECHK __HALT(-4) diff --git a/src/system/WindowsWrapper.h b/src/system/WindowsWrapper.h index cdb8714c..b72c815a 100644 --- a/src/system/WindowsWrapper.h +++ b/src/system/WindowsWrapper.h @@ -2,8 +2,9 @@ // // Includes Windows.h while avoiding conflicts with Oberon types. + +#define BOOLEAN _BOOLEAN +#define CHAR _CHAR +#include #undef BOOLEAN #undef CHAR -#include -#define BOOLEAN char -#define CHAR unsigned char From c146cab6c123aa74cf5251241e62f6d5538e2207 Mon Sep 17 00:00:00 2001 From: David Brown Date: Sat, 16 Jul 2016 18:29:51 +0100 Subject: [PATCH 171/580] Add tests for ASH, SYSTEM.LSH and SYSTEM.ROT. --- makefile | 7 ++ src/test/confidence/language/TestLanguage.mod | 101 ++++++++++++++++++ src/test/confidence/language/expected | 1 + src/test/confidence/language/test.sh | 5 + .../confidence/language/updateassertions.pl | 16 +++ src/tools/make/vishap.make | 1 + 6 files changed, 131 insertions(+) create mode 100644 src/test/confidence/language/TestLanguage.mod create mode 100644 src/test/confidence/language/expected create mode 100644 src/test/confidence/language/test.sh create mode 100644 src/test/confidence/language/updateassertions.pl diff --git a/makefile b/makefile index 076a2218..811ecefc 100644 --- a/makefile +++ b/makefile @@ -192,6 +192,13 @@ uninstall: configuration +# confidence: Run a set of confidence tests +confidence: configuration + @make -f src/tools/make/vishap.make -s confidence + + + + # --- Bootstrap C source generation and reversion --- diff --git a/src/test/confidence/language/TestLanguage.mod b/src/test/confidence/language/TestLanguage.mod new file mode 100644 index 00000000..11aa3f5d --- /dev/null +++ b/src/test/confidence/language/TestLanguage.mod @@ -0,0 +1,101 @@ +MODULE TestLanguage; + +IMPORT SYSTEM, Console; + +PROCEDURE Shift; +VAR c: CHAR; b: SYSTEM.BYTE; s,t,u: SHORTINT; h,i,j,k: INTEGER; l,m,n: LONGINT; +(* + Aritmetic shift always returns type LONGINT. Defined as x * 2**n. + LSH and ROT produces results of the same type as the value being shifted. +*) +BEGIN + (* Positive LSH shifts and ROTs without overflow *) + + i := 0; m := 1; + WHILE i < SIZE(LONGINT)*8 DO + l := 1; l := SYSTEM.LSH(l,i); ASSERT(l = m, 16); + l := 1; l := SYSTEM.ROT(l,i); ASSERT(l = m, 17); + m := m * 2; INC(i); + END; + + i := 0; k := 1; + WHILE i < SIZE(INTEGER)*8 DO + j := 1; j := SYSTEM.LSH(j,i); ASSERT(j = k, 23); + j := 1; j := SYSTEM.ROT(j,i); ASSERT(j = k, 24); + k := k * 2; INC(i); + END; + + i := 0; t := 1; + WHILE i < SIZE(SHORTINT)*8 DO + s := 1; s := SYSTEM.LSH(s,i); ASSERT(s = t, 30); + s := 1; s := SYSTEM.ROT(s,i); ASSERT(s = t, 31); + t := t * 2; INC(i); + END; + + (* Negative LSH shifts and ROTs without overflow *) + + i := -1; m := 1; m := SYSTEM.LSH(m, SIZE(LONGINT)*8 - 2); n := m*2; + WHILE i > -SIZE(LONGINT)*8 DO + l := n; l := SYSTEM.LSH(l,i); ASSERT(l = m, 39); + l := n; l := SYSTEM.ROT(l,i); ASSERT(l = m, 40); + m := m DIV 2; DEC(i); + END; + + i := -1; k := 1; k := SYSTEM.LSH(k, SIZE(INTEGER)*8 - 2); h := k*2; + WHILE i > -SIZE(INTEGER)*8 DO + j := h; j := SYSTEM.LSH(j,i); ASSERT(j = k, 46); + j := h; j := SYSTEM.ROT(j,i); ASSERT(j = k, 47); + k := k DIV 2; DEC(i); + END; + + i := -1; t := 1; t := SYSTEM.LSH(t, SIZE(SHORTINT)*8 - 2); u := t*2; + WHILE i > -SIZE(SHORTINT)*8 DO + s := u; s := SYSTEM.LSH(s,i); ASSERT(s = t, 53); + s := u; s := SYSTEM.ROT(s,i); ASSERT(s = t, 54); + t := t DIV 2; DEC(i); + END; + + (* Positive ASHs of a negative number *) + + i := 0; m := 1; m := SYSTEM.LSH(m, SIZE(LONGINT)*8 - 1); n := m; + WHILE i > -SIZE(LONGINT)*8 DO + l := n; l := ASH(l,i); ASSERT(l = m, 62); + m := m DIV 2; DEC(i); + END; + + i := 0; j := 1; j := SYSTEM.LSH(j, SIZE(INTEGER)*8 - 1); k := j; + WHILE i > -SIZE(INTEGER)*8 DO + l := ASH(j,i); ASSERT(l = LONG(k), 68); + k := k DIV 2; DEC(i); + END; + + i := 0; s := 1; s := SYSTEM.LSH(s, SIZE(SHORTINT)*8 - 1); t := s; + WHILE i > -SIZE(SHORTINT)*8 DO + l := ASH(s,i); ASSERT(l = LONG(LONG(t)), 74); + t := t DIV 2; DEC(i); + END; + + (* Positive ASHs of a positive number *) + + i := 0; m := 1; m := SYSTEM.LSH(m, SIZE(LONGINT)*8 - 2); n := m; + WHILE i > 1-SIZE(LONGINT)*8 DO + l := n; l := ASH(l,i); ASSERT(l = m, 82); + m := m DIV 2; DEC(i); + END; + + + + (* Also need tests that bits that are shifted / rotated off the end + are zeroed or wrapped correctly. *) + + (* Also need full tests for CHAR, and poossibly SYSTEM.BYTE. Here's a simple one *) + + c := 1X; c := SYSTEM.LSH(c,2); c := SYSTEM.ROT(c,-2); ASSERT(c=1X, 93); + b := 1; b := SYSTEM.LSH(b,2); b := SYSTEM.ROT(b,-2); ASSERT(SYSTEM.VAL(INTEGER,b)=1, 94); + +END Shift; + +BEGIN + Shift; + Console.String("Language tests successful."); Console.Ln; +END TestLanguage. diff --git a/src/test/confidence/language/expected b/src/test/confidence/language/expected new file mode 100644 index 00000000..041933c1 --- /dev/null +++ b/src/test/confidence/language/expected @@ -0,0 +1 @@ +Language tests successful. diff --git a/src/test/confidence/language/test.sh b/src/test/confidence/language/test.sh new file mode 100644 index 00000000..18d8e9cf --- /dev/null +++ b/src/test/confidence/language/test.sh @@ -0,0 +1,5 @@ +. ../testenv.sh +# Generate mixed source and assembly code listing +voc TestLanguage.mod -m +./TestLanguage >result +. ../testresult.sh diff --git a/src/test/confidence/language/updateassertions.pl b/src/test/confidence/language/updateassertions.pl new file mode 100644 index 00000000..70b8063f --- /dev/null +++ b/src/test/confidence/language/updateassertions.pl @@ -0,0 +1,16 @@ +#!perl -w +use strict; +use warnings; + +my ($fn) = @ARGV; + +open MOD,$fn // die "Could not open $fn."; +while () { + if (/^(.*)ASSERT\((.*?)(, +[0-9]+)\)(.*$)/) { + print $1, "ASSERT($2, $.)", $4, "\n"; + } else { + print $_; + } +} + +close MOD; diff --git a/src/tools/make/vishap.make b/src/tools/make/vishap.make index ac7b5b24..818e96f4 100644 --- a/src/tools/make/vishap.make +++ b/src/tools/make/vishap.make @@ -377,6 +377,7 @@ sourcechanges: confidence: @printf "\n\n--- Confidence tests ---\n\n" cd src/test/confidence/hello; ./test.sh "$(INSTALLDIR)" + cd src/test/confidence/language; ./test.sh "$(INSTALLDIR)" if [ "$(PLATFORM)" != "windows" ] ; then cd src/test/confidence/signal; ./test.sh "$(INSTALLDIR)"; fi cd src/test/confidence/lola; ./test.sh "$(INSTALLDIR)" cd src/test/confidence/arrayassignment; ./test.sh "$(INSTALLDIR)" From f2e12bf48128228af5e569e6876a8420cdb4db85 Mon Sep 17 00:00:00 2001 From: David Brown Date: Sat, 16 Jul 2016 20:59:12 +0100 Subject: [PATCH 172/580] Make confidence test .sh s executable under cygwin by putting #! on first line. --- src/test/confidence/arrayassignment/test.sh | 1 + src/test/confidence/hello/test.sh | 1 + src/test/confidence/language/test.sh | 1 + src/test/confidence/lola/test.sh | 1 + src/test/confidence/signal/test.sh | 1 + src/test/confidence/testenv.sh | 1 + src/test/confidence/testresult.sh | 1 + 7 files changed, 7 insertions(+) diff --git a/src/test/confidence/arrayassignment/test.sh b/src/test/confidence/arrayassignment/test.sh index b4cb1ee8..570e2268 100755 --- a/src/test/confidence/arrayassignment/test.sh +++ b/src/test/confidence/arrayassignment/test.sh @@ -1,3 +1,4 @@ +#! . ../testenv.sh voc aa.mod -m ./aa >result diff --git a/src/test/confidence/hello/test.sh b/src/test/confidence/hello/test.sh index 006a3f01..ac683cb9 100755 --- a/src/test/confidence/hello/test.sh +++ b/src/test/confidence/hello/test.sh @@ -1,3 +1,4 @@ +#! . ../testenv.sh # Generate mixed source and assembly code listing CFLAGS="-gstabs -g1 -Wa,-acdhln=hello.s" && voc hello.mod -m diff --git a/src/test/confidence/language/test.sh b/src/test/confidence/language/test.sh index 18d8e9cf..a593488c 100644 --- a/src/test/confidence/language/test.sh +++ b/src/test/confidence/language/test.sh @@ -1,3 +1,4 @@ +#! . ../testenv.sh # Generate mixed source and assembly code listing voc TestLanguage.mod -m diff --git a/src/test/confidence/lola/test.sh b/src/test/confidence/lola/test.sh index c8d4a27a..77f401e0 100755 --- a/src/test/confidence/lola/test.sh +++ b/src/test/confidence/lola/test.sh @@ -1,3 +1,4 @@ +#! . ../testenv.sh voc LSS.Mod LSB.Mod LSC.Mod LSV.Mod lola.Mod -m ./Lola RISC5.Lola result diff --git a/src/test/confidence/signal/test.sh b/src/test/confidence/signal/test.sh index ab1d584c..d18c022d 100755 --- a/src/test/confidence/signal/test.sh +++ b/src/test/confidence/signal/test.sh @@ -1,3 +1,4 @@ +#! . ../testenv.sh voc signal.mod -m ./SignalTest x & diff --git a/src/test/confidence/testenv.sh b/src/test/confidence/testenv.sh index 6c8cfb93..85352592 100755 --- a/src/test/confidence/testenv.sh +++ b/src/test/confidence/testenv.sh @@ -1,3 +1,4 @@ +#! ## '.' this file from individual test.sh files. #set -e if which cygpath >/dev/null diff --git a/src/test/confidence/testresult.sh b/src/test/confidence/testresult.sh index 171fd1b1..10a82930 100755 --- a/src/test/confidence/testresult.sh +++ b/src/test/confidence/testresult.sh @@ -1,3 +1,4 @@ +#! # '.' this from indiviual test.sh files if diff -b expected result then printf "PASSED: $PWD\n\n" From cd53085613913f20e9f707dffbdd7cfbc381281c Mon Sep 17 00:00:00 2001 From: David CW Brown Date: Sun, 17 Jul 2016 11:06:49 +0100 Subject: [PATCH 173/580] Language test script must be executable. --- src/test/confidence/language/test.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 src/test/confidence/language/test.sh diff --git a/src/test/confidence/language/test.sh b/src/test/confidence/language/test.sh old mode 100644 new mode 100755 From d8882462b187094cb389d37a20f92bfe9e51653d Mon Sep 17 00:00:00 2001 From: David Brown Date: Sun, 17 Jul 2016 11:44:25 +0100 Subject: [PATCH 174/580] Still fiddling to make test.sh work everywhere. Set first line to #!/bin/sh. --- src/test/confidence/arrayassignment/test.sh | 2 +- src/test/confidence/hello/test.sh | 2 +- src/test/confidence/language/test.sh | 2 +- src/test/confidence/lola/test.sh | 2 +- src/test/confidence/signal/test.sh | 2 +- src/test/confidence/testenv.sh | 2 +- src/test/confidence/testresult.sh | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/test/confidence/arrayassignment/test.sh b/src/test/confidence/arrayassignment/test.sh index 570e2268..9f4206e2 100755 --- a/src/test/confidence/arrayassignment/test.sh +++ b/src/test/confidence/arrayassignment/test.sh @@ -1,4 +1,4 @@ -#! +#!/bin/sh . ../testenv.sh voc aa.mod -m ./aa >result diff --git a/src/test/confidence/hello/test.sh b/src/test/confidence/hello/test.sh index ac683cb9..decaa458 100755 --- a/src/test/confidence/hello/test.sh +++ b/src/test/confidence/hello/test.sh @@ -1,4 +1,4 @@ -#! +#!/bin/sh . ../testenv.sh # Generate mixed source and assembly code listing CFLAGS="-gstabs -g1 -Wa,-acdhln=hello.s" && voc hello.mod -m diff --git a/src/test/confidence/language/test.sh b/src/test/confidence/language/test.sh index a593488c..217e6c49 100644 --- a/src/test/confidence/language/test.sh +++ b/src/test/confidence/language/test.sh @@ -1,4 +1,4 @@ -#! +#!/bin/sh . ../testenv.sh # Generate mixed source and assembly code listing voc TestLanguage.mod -m diff --git a/src/test/confidence/lola/test.sh b/src/test/confidence/lola/test.sh index 77f401e0..523dd7bb 100755 --- a/src/test/confidence/lola/test.sh +++ b/src/test/confidence/lola/test.sh @@ -1,4 +1,4 @@ -#! +#!/bin/sh . ../testenv.sh voc LSS.Mod LSB.Mod LSC.Mod LSV.Mod lola.Mod -m ./Lola RISC5.Lola result diff --git a/src/test/confidence/signal/test.sh b/src/test/confidence/signal/test.sh index d18c022d..8e507edc 100755 --- a/src/test/confidence/signal/test.sh +++ b/src/test/confidence/signal/test.sh @@ -1,4 +1,4 @@ -#! +#!/bin/sh . ../testenv.sh voc signal.mod -m ./SignalTest x & diff --git a/src/test/confidence/testenv.sh b/src/test/confidence/testenv.sh index 85352592..bd6ff5b0 100755 --- a/src/test/confidence/testenv.sh +++ b/src/test/confidence/testenv.sh @@ -1,4 +1,4 @@ -#! +#!/bin/sh ## '.' this file from individual test.sh files. #set -e if which cygpath >/dev/null diff --git a/src/test/confidence/testresult.sh b/src/test/confidence/testresult.sh index 10a82930..9234ab82 100755 --- a/src/test/confidence/testresult.sh +++ b/src/test/confidence/testresult.sh @@ -1,4 +1,4 @@ -#! +#!/bin/sh # '.' this from indiviual test.sh files if diff -b expected result then printf "PASSED: $PWD\n\n" From 3f6c6243cbda4ed80d53a21790110d3ebaa59575 Mon Sep 17 00:00:00 2001 From: David Brown Date: Mon, 18 Jul 2016 16:41:52 +0100 Subject: [PATCH 175/580] Fix typo in typedef of U_INTEGER. Thanks Oleg! --- src/system/SYSTEM.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/system/SYSTEM.h b/src/system/SYSTEM.h index 420ca1cd..34b69a8a 100644 --- a/src/system/SYSTEM.h +++ b/src/system/SYSTEM.h @@ -60,7 +60,7 @@ typedef unsigned char U_SHORTINT; #if (__SIZEOF_POINTER__ == 8) || defined(LARGE) || defined(_WIN64) typedef int INTEGER; // INTEGER is 32 bit. typedef long long LONGINT; // LONGINT is 64 bit. (long long is always 64 bits, while long can be 32 bits e.g. under MSC/MingW) - typedef int U_INTEGER; + typedef unsigned int U_INTEGER; typedef unsigned long long U_LONGINT; #else typedef short int INTEGER; // INTEGER is 16 bit. From afb70fa178ee6ae1b1228294872674b052965d72 Mon Sep 17 00:00:00 2001 From: David Brown Date: Mon, 18 Jul 2016 17:25:25 +0100 Subject: [PATCH 176/580] Try explicitly calling 'sh' in confidence tests to avoid limitation on termux. --- src/tools/make/vishap.make | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/tools/make/vishap.make b/src/tools/make/vishap.make index 818e96f4..8b50cb20 100644 --- a/src/tools/make/vishap.make +++ b/src/tools/make/vishap.make @@ -376,11 +376,11 @@ sourcechanges: confidence: @printf "\n\n--- Confidence tests ---\n\n" - cd src/test/confidence/hello; ./test.sh "$(INSTALLDIR)" - cd src/test/confidence/language; ./test.sh "$(INSTALLDIR)" - if [ "$(PLATFORM)" != "windows" ] ; then cd src/test/confidence/signal; ./test.sh "$(INSTALLDIR)"; fi - cd src/test/confidence/lola; ./test.sh "$(INSTALLDIR)" - cd src/test/confidence/arrayassignment; ./test.sh "$(INSTALLDIR)" + cd src/test/confidence/hello; sh ./test.sh "$(INSTALLDIR)" + cd src/test/confidence/language; sh ./test.sh "$(INSTALLDIR)" + if [ "$(PLATFORM)" != "windows" ] ; then cd src/test/confidence/signal; sh ./test.sh "$(INSTALLDIR)"; fi + cd src/test/confidence/lola; sh ./test.sh "$(INSTALLDIR)" + cd src/test/confidence/arrayassignment; sh ./test.sh "$(INSTALLDIR)" @printf "\n\n--- Confidence tests passed ---\n\n" From d6acf117002d8ca633d9d3b5e7039d11f03a28ed Mon Sep 17 00:00:00 2001 From: David Brown Date: Tue, 19 Jul 2016 15:37:07 +0100 Subject: [PATCH 177/580] Update bootstrap sources. --- bootstrap/unix-44/Configuration.c | 4 +- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Console.c | 2 +- bootstrap/unix-44/Console.h | 2 +- bootstrap/unix-44/Files.c | 2 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 2 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 2 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 2 +- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 2 +- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 2 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/SYSTEM.c | 20 +++++----- bootstrap/unix-44/SYSTEM.h | 54 ++++++++++++++++----------- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/Vishap.c | 2 +- bootstrap/unix-44/WindowsWrapper.h | 7 ++-- bootstrap/unix-44/errors.c | 2 +- bootstrap/unix-44/errors.h | 2 +- bootstrap/unix-44/extTools.c | 2 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-44/vt100.c | 2 +- bootstrap/unix-44/vt100.h | 2 +- bootstrap/unix-48/Configuration.c | 4 +- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Console.c | 2 +- bootstrap/unix-48/Console.h | 2 +- bootstrap/unix-48/Files.c | 2 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 2 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 2 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 2 +- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 2 +- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 2 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/SYSTEM.c | 20 +++++----- bootstrap/unix-48/SYSTEM.h | 54 ++++++++++++++++----------- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/Vishap.c | 2 +- bootstrap/unix-48/WindowsWrapper.h | 7 ++-- bootstrap/unix-48/errors.c | 2 +- bootstrap/unix-48/errors.h | 2 +- bootstrap/unix-48/extTools.c | 2 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-48/vt100.c | 2 +- bootstrap/unix-48/vt100.h | 2 +- bootstrap/unix-88/Configuration.c | 4 +- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Console.c | 2 +- bootstrap/unix-88/Console.h | 2 +- bootstrap/unix-88/Files.c | 2 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 2 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 2 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 2 +- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 2 +- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 2 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/SYSTEM.c | 20 +++++----- bootstrap/unix-88/SYSTEM.h | 54 ++++++++++++++++----------- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/Vishap.c | 2 +- bootstrap/unix-88/WindowsWrapper.h | 7 ++-- bootstrap/unix-88/errors.c | 2 +- bootstrap/unix-88/errors.h | 2 +- bootstrap/unix-88/extTools.c | 2 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/unix-88/vt100.c | 2 +- bootstrap/unix-88/vt100.h | 2 +- bootstrap/windows-48/Configuration.c | 4 +- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Console.c | 2 +- bootstrap/windows-48/Console.h | 2 +- bootstrap/windows-48/Files.c | 2 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 2 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 2 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 2 +- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 2 +- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 2 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/SYSTEM.c | 20 +++++----- bootstrap/windows-48/SYSTEM.h | 54 ++++++++++++++++----------- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/Vishap.c | 2 +- bootstrap/windows-48/WindowsWrapper.h | 7 ++-- bootstrap/windows-48/errors.c | 2 +- bootstrap/windows-48/errors.h | 2 +- bootstrap/windows-48/extTools.c | 2 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-48/vt100.c | 2 +- bootstrap/windows-48/vt100.h | 2 +- bootstrap/windows-88/Configuration.c | 4 +- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Console.c | 2 +- bootstrap/windows-88/Console.h | 2 +- bootstrap/windows-88/Files.c | 2 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 2 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 2 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 2 +- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 2 +- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 2 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Platform.c | 2 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/SYSTEM.c | 20 +++++----- bootstrap/windows-88/SYSTEM.h | 54 ++++++++++++++++----------- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/Vishap.c | 2 +- bootstrap/windows-88/WindowsWrapper.h | 7 ++-- bootstrap/windows-88/errors.c | 2 +- bootstrap/windows-88/errors.h | 2 +- bootstrap/windows-88/extTools.c | 2 +- bootstrap/windows-88/extTools.h | 2 +- bootstrap/windows-88/vt100.c | 2 +- bootstrap/windows-88/vt100.h | 2 +- src/tools/make/sourcechanges.sh | 4 +- 211 files changed, 432 insertions(+), 377 deletions(-) diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index 6cc8caad..40ee14ce 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -13,6 +13,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/07/11] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/07/19] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index a9c49d8e..bf6756e8 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Console.c b/bootstrap/unix-44/Console.c index e0c4cf80..a17cab07 100644 --- a/bootstrap/unix-44/Console.c +++ b/bootstrap/unix-44/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Platform.h" diff --git a/bootstrap/unix-44/Console.h b/bootstrap/unix-44/Console.h index 8df4d5f3..a4799f33 100644 --- a/bootstrap/unix-44/Console.h +++ b/bootstrap/unix-44/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 92d3593e..4ca7a5cf 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index bdb8f0a0..9e409adc 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index 0e8d2178..d6248ab0 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin tskSfF */ #include "SYSTEM.h" struct Heap__1 { diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index ce80df86..a7c115d1 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index a29a7f9b..5e0ba69f 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Heap.h" diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index c605ebc6..2387f45f 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index 40d66396..a69a396f 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index 0a4e9b21..9391eccb 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index f67f0cda..81cadc05 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "OPM.h" diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index 6209887e..27fe129c 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 397d4683..05ec3144 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index 42e2c9d5..c5e413a3 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index 207e39fc..877f2dc0 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPB.h" #include "OPM.h" diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index b0c639c0..c7a155eb 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index 3945d04c..e4fb2cf6 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index d09d39b6..73fb31d0 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index db859ffa..34c1acb6 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index 3c2cf4f3..998a6db8 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index fabbd4ab..1c086988 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPC.h" #include "OPM.h" diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index 3d6bec56..c9a566de 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 03dad80c..2832d8d3 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index 8fa874e7..f5315fd6 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index b9cd1c3d..146ece15 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index aefa8974..79518e88 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/SYSTEM.c b/bootstrap/unix-44/SYSTEM.c index 0fcc5ee2..50e91c6d 100644 --- a/bootstrap/unix-44/SYSTEM.c +++ b/bootstrap/unix-44/SYSTEM.c @@ -36,7 +36,7 @@ void SYSTEM_ENUMP(void *adr, LONGINT n, void (*P)()) { while (n > 0) { P((LONGINT)(uintptr_t)(*((void**)(adr)))); - adr = ((void**)adr) + 1; + adr = ((void**)adr) + 1; n--; } } @@ -49,18 +49,18 @@ void SYSTEM_ENUMR(void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()) t = typ; off = *t; while (off >= 0) {P(*(LONGINT*)((char*)adr+off)); t++; off = *t;} - adr = ((char*)adr) + size; + adr = ((char*)adr) + size; n--; } } -LONGINT SYSTEM_DIV(unsigned LONGINT x, unsigned LONGINT y) +LONGINT SYSTEM_DIV(U_LONGINT x, U_LONGINT y) { if ((LONGINT) x >= 0) return (x / y); else return -((y - 1 - x) / y); } -LONGINT SYSTEM_MOD(unsigned LONGINT x, unsigned LONGINT y) -{ unsigned LONGINT m; +LONGINT SYSTEM_MOD(U_LONGINT x, U_LONGINT y) +{ U_LONGINT m; if ((LONGINT) x >= 0) return (x % y); else { m = (-x) % y; if (m != 0) return (y - m); else return 0; @@ -171,29 +171,29 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler SystemSignalHandler SystemInterruptHandler = 0; SystemSignalHandler SystemQuitHandler = 0; BOOL ConsoleCtrlHandlerSet = FALSE; - + BOOL WINAPI SystemConsoleCtrlHandler(DWORD ctrlType) { if ((ctrlType == CTRL_C_EVENT) || (ctrlType == CTRL_BREAK_EVENT)) { if (SystemInterruptHandler) { SystemInterruptHandler(2); // SIGINT return TRUE; - } + } } else { // Close, logoff or shutdown - if (SystemQuitHandler) { + if (SystemQuitHandler) { SystemQuitHandler(3); // SIGQUIT return TRUE; } } return FALSE; } - + void EnsureConsoleCtrlHandler() { if (!ConsoleCtrlHandlerSet) { SetConsoleCtrlHandler(SystemConsoleCtrlHandler, TRUE); ConsoleCtrlHandlerSet = TRUE; } } - + void SystemSetInterruptHandler(uintptr_t h) { EnsureConsoleCtrlHandler(); SystemInterruptHandler = (SystemSignalHandler)h; diff --git a/bootstrap/unix-44/SYSTEM.h b/bootstrap/unix-44/SYSTEM.h index 41ef9995..34b69a8a 100644 --- a/bootstrap/unix-44/SYSTEM.h +++ b/bootstrap/unix-44/SYSTEM.h @@ -41,25 +41,35 @@ // Oberon types -#define BOOLEAN char -#define SYSTEM_BYTE unsigned char -#define CHAR unsigned char -#define SHORTINT signed char -#define REAL float -#define LONGREAL double -#define SYSTEM_PTR void* +typedef char BOOLEAN; +typedef unsigned char SYSTEM_BYTE; +typedef unsigned char CHAR; +typedef signed char SHORTINT; +typedef float REAL; +typedef double LONGREAL; +typedef void* SYSTEM_PTR; + +// Unsigned variants are for use by shift and rotate macros. + +typedef unsigned char U_SYSTEM_BYTE; +typedef unsigned char U_CHAR; +typedef unsigned char U_SHORTINT; // For 32 bit builds, the size of LONGINT depends on a make option: #if (__SIZEOF_POINTER__ == 8) || defined(LARGE) || defined(_WIN64) - #define INTEGER int // INTEGER is 32 bit. - #define LONGINT long long // LONGINT is 64 bit. (long long is always 64 bits, while long can be 32 bits e.g. under MSC/MingW) + typedef int INTEGER; // INTEGER is 32 bit. + typedef long long LONGINT; // LONGINT is 64 bit. (long long is always 64 bits, while long can be 32 bits e.g. under MSC/MingW) + typedef unsigned int U_INTEGER; + typedef unsigned long long U_LONGINT; #else - #define INTEGER short int // INTEGER is 16 bit. - #define LONGINT long // LONGINT is 32 bit. + typedef short int INTEGER; // INTEGER is 16 bit. + typedef long LONGINT; // LONGINT is 32 bit. + typedef unsigned short int U_INTEGER; + typedef unsigned long U_LONGINT; #endif -#define SET unsigned LONGINT +typedef U_LONGINT SET; // OS Memory allocation interfaces are in PlatformXXX.Mod @@ -78,8 +88,8 @@ extern double SYSTEM_ABSD (double i); extern void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0); extern void SYSTEM_ENUMP (void *adr, LONGINT n, void (*P)()); extern void SYSTEM_ENUMR (void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()); -extern LONGINT SYSTEM_DIV (unsigned LONGINT x, unsigned LONGINT y); -extern LONGINT SYSTEM_MOD (unsigned LONGINT x, unsigned LONGINT y); +extern LONGINT SYSTEM_DIV (U_LONGINT x, U_LONGINT y); +extern LONGINT SYSTEM_MOD (U_LONGINT x, U_LONGINT y); extern LONGINT SYSTEM_ENTIER (double x); @@ -127,22 +137,22 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __GET(a, x, t) x= *(t*)(uintptr_t)(a) #define __PUT(a, x, t) *(t*)(uintptr_t)(a)=x -#define __LSHL(x, n, t) ((t)((unsigned t)(x)<<(n))) -#define __LSHR(x, n, t) ((t)((unsigned t)(x)>>(n))) +#define __LSHL(x, n, t) ((t)((U_##t)(x)<<(n))) +#define __LSHR(x, n, t) ((t)((U_##t)(x)>>(n))) #define __LSH(x, n, t) ((n)>=0? __LSHL(x, n, t): __LSHR(x, -(n), t)) #define __ASHL(x, n) ((LONGINT)(x)<<(n)) #define __ASHR(x, n) ((LONGINT)(x)>>(n)) #define __ASH(x, n) ((n)>=0?__ASHL(x,n):__ASHR(x,-(n))) -#define __ROTL(x, n, t) ((t)((unsigned t)(x)<<(n)|(unsigned t)(x)>>(8*sizeof(t)-(n)))) -#define __ROTR(x, n, t) ((t)((unsigned t)(x)>>(n)|(unsigned t)(x)<<(8*sizeof(t)-(n)))) +#define __ROTL(x, n, t) ((t)((U_##t)(x)<<(n)|(U_##t)(x)>>(8*sizeof(t)-(n)))) +#define __ROTR(x, n, t) ((t)((U_##t)(x)>>(n)|(U_##t)(x)<<(8*sizeof(t)-(n)))) #define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) -#define __BIT(x, n) (*(unsigned LONGINT*)(x)>>(n)&1) +#define __BIT(x, n) (*(U_LONGINT*)(x)>>(n)&1) #define __MOVE(s, d, n) memcpy((char*)(uintptr_t)(d),(char*)(uintptr_t)(s),n) #define __ASHF(x, n) SYSTEM_ASH((LONGINT)(x), (LONGINT)(n)) -#define __SHORT(x, y) ((int)((unsigned LONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) +#define __SHORT(x, y) ((int)((U_LONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) #define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) #define __CHR(x) ((CHAR)__R(x, 256)) #define __CHRF(x) ((CHAR)__RF(x, 256)) @@ -165,9 +175,9 @@ static int __str_cmp(CHAR *x, CHAR *y){ // Runtime checks -#define __X(i, ub) (((unsigned LONGINT)(i)<(unsigned LONGINT)(ub))?i:(__HALT(-2),0)) +#define __X(i, ub) (((U_LONGINT)(i)<(U_LONGINT)(ub))?i:(__HALT(-2),0)) #define __XF(i, ub) SYSTEM_XCHK((LONGINT)(i), (LONGINT)(ub)) -#define __R(i, ub) (((unsigned LONGINT)(i)<(unsigned LONGINT)(ub))?i:(__HALT(-8),0)) +#define __R(i, ub) (((U_LONGINT)(i)<(U_LONGINT)(ub))?i:(__HALT(-8),0)) #define __RF(i, ub) SYSTEM_RCHK((LONGINT)(i),(LONGINT)(ub)) #define __RETCHK __retchk: __HALT(-3); return 0; #define __CASECHK __HALT(-4) diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index 9b7cedf9..5ea5720d 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index 4e768eb2..3a8ef7a3 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index f975bd5d..3bec2632 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Files.h" #include "Modules.h" diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index 7eaaec81..f8eeb41d 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/Vishap.c b/bootstrap/unix-44/Vishap.c index b1d58deb..a5d922e9 100644 --- a/bootstrap/unix-44/Vishap.c +++ b/bootstrap/unix-44/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkamSf */ #include "SYSTEM.h" #include "Configuration.h" #include "Heap.h" diff --git a/bootstrap/unix-44/WindowsWrapper.h b/bootstrap/unix-44/WindowsWrapper.h index cdb8714c..b72c815a 100644 --- a/bootstrap/unix-44/WindowsWrapper.h +++ b/bootstrap/unix-44/WindowsWrapper.h @@ -2,8 +2,9 @@ // // Includes Windows.h while avoiding conflicts with Oberon types. + +#define BOOLEAN _BOOLEAN +#define CHAR _CHAR +#include #undef BOOLEAN #undef CHAR -#include -#define BOOLEAN char -#define CHAR unsigned char diff --git a/bootstrap/unix-44/errors.c b/bootstrap/unix-44/errors.c index 8a192c44..e8272348 100644 --- a/bootstrap/unix-44/errors.c +++ b/bootstrap/unix-44/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/unix-44/errors.h b/bootstrap/unix-44/errors.h index faa4b1ce..7a085f56 100644 --- a/bootstrap/unix-44/errors.h +++ b/bootstrap/unix-44/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index cf9b6b4c..646b357b 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index ea47d26c..1c63c923 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-44/vt100.c b/bootstrap/unix-44/vt100.c index fdcd322d..67bed77e 100644 --- a/bootstrap/unix-44/vt100.c +++ b/bootstrap/unix-44/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Strings.h" diff --git a/bootstrap/unix-44/vt100.h b/bootstrap/unix-44/vt100.h index 88660721..83c4e777 100644 --- a/bootstrap/unix-44/vt100.h +++ b/bootstrap/unix-44/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index 6cc8caad..40ee14ce 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -13,6 +13,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/07/11] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/07/19] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index a9c49d8e..bf6756e8 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Console.c b/bootstrap/unix-48/Console.c index e0c4cf80..a17cab07 100644 --- a/bootstrap/unix-48/Console.c +++ b/bootstrap/unix-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Platform.h" diff --git a/bootstrap/unix-48/Console.h b/bootstrap/unix-48/Console.h index 8df4d5f3..a4799f33 100644 --- a/bootstrap/unix-48/Console.h +++ b/bootstrap/unix-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 92d3593e..4ca7a5cf 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index bdb8f0a0..9e409adc 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index 0e8d2178..d6248ab0 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin tskSfF */ #include "SYSTEM.h" struct Heap__1 { diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index ce80df86..a7c115d1 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index a29a7f9b..5e0ba69f 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Heap.h" diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index c605ebc6..2387f45f 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index 40d66396..a69a396f 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index 0a4e9b21..9391eccb 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index f67f0cda..81cadc05 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "OPM.h" diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index 6209887e..27fe129c 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 397d4683..05ec3144 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index 42e2c9d5..c5e413a3 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index 207e39fc..877f2dc0 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPB.h" #include "OPM.h" diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index b0c639c0..c7a155eb 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index 3945d04c..e4fb2cf6 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index d09d39b6..73fb31d0 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index db859ffa..34c1acb6 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index 3c2cf4f3..998a6db8 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index fabbd4ab..1c086988 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPC.h" #include "OPM.h" diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index 3d6bec56..c9a566de 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 03dad80c..2832d8d3 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index 8fa874e7..f5315fd6 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index b9cd1c3d..146ece15 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index aefa8974..79518e88 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/SYSTEM.c b/bootstrap/unix-48/SYSTEM.c index 0fcc5ee2..50e91c6d 100644 --- a/bootstrap/unix-48/SYSTEM.c +++ b/bootstrap/unix-48/SYSTEM.c @@ -36,7 +36,7 @@ void SYSTEM_ENUMP(void *adr, LONGINT n, void (*P)()) { while (n > 0) { P((LONGINT)(uintptr_t)(*((void**)(adr)))); - adr = ((void**)adr) + 1; + adr = ((void**)adr) + 1; n--; } } @@ -49,18 +49,18 @@ void SYSTEM_ENUMR(void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()) t = typ; off = *t; while (off >= 0) {P(*(LONGINT*)((char*)adr+off)); t++; off = *t;} - adr = ((char*)adr) + size; + adr = ((char*)adr) + size; n--; } } -LONGINT SYSTEM_DIV(unsigned LONGINT x, unsigned LONGINT y) +LONGINT SYSTEM_DIV(U_LONGINT x, U_LONGINT y) { if ((LONGINT) x >= 0) return (x / y); else return -((y - 1 - x) / y); } -LONGINT SYSTEM_MOD(unsigned LONGINT x, unsigned LONGINT y) -{ unsigned LONGINT m; +LONGINT SYSTEM_MOD(U_LONGINT x, U_LONGINT y) +{ U_LONGINT m; if ((LONGINT) x >= 0) return (x % y); else { m = (-x) % y; if (m != 0) return (y - m); else return 0; @@ -171,29 +171,29 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler SystemSignalHandler SystemInterruptHandler = 0; SystemSignalHandler SystemQuitHandler = 0; BOOL ConsoleCtrlHandlerSet = FALSE; - + BOOL WINAPI SystemConsoleCtrlHandler(DWORD ctrlType) { if ((ctrlType == CTRL_C_EVENT) || (ctrlType == CTRL_BREAK_EVENT)) { if (SystemInterruptHandler) { SystemInterruptHandler(2); // SIGINT return TRUE; - } + } } else { // Close, logoff or shutdown - if (SystemQuitHandler) { + if (SystemQuitHandler) { SystemQuitHandler(3); // SIGQUIT return TRUE; } } return FALSE; } - + void EnsureConsoleCtrlHandler() { if (!ConsoleCtrlHandlerSet) { SetConsoleCtrlHandler(SystemConsoleCtrlHandler, TRUE); ConsoleCtrlHandlerSet = TRUE; } } - + void SystemSetInterruptHandler(uintptr_t h) { EnsureConsoleCtrlHandler(); SystemInterruptHandler = (SystemSignalHandler)h; diff --git a/bootstrap/unix-48/SYSTEM.h b/bootstrap/unix-48/SYSTEM.h index 41ef9995..34b69a8a 100644 --- a/bootstrap/unix-48/SYSTEM.h +++ b/bootstrap/unix-48/SYSTEM.h @@ -41,25 +41,35 @@ // Oberon types -#define BOOLEAN char -#define SYSTEM_BYTE unsigned char -#define CHAR unsigned char -#define SHORTINT signed char -#define REAL float -#define LONGREAL double -#define SYSTEM_PTR void* +typedef char BOOLEAN; +typedef unsigned char SYSTEM_BYTE; +typedef unsigned char CHAR; +typedef signed char SHORTINT; +typedef float REAL; +typedef double LONGREAL; +typedef void* SYSTEM_PTR; + +// Unsigned variants are for use by shift and rotate macros. + +typedef unsigned char U_SYSTEM_BYTE; +typedef unsigned char U_CHAR; +typedef unsigned char U_SHORTINT; // For 32 bit builds, the size of LONGINT depends on a make option: #if (__SIZEOF_POINTER__ == 8) || defined(LARGE) || defined(_WIN64) - #define INTEGER int // INTEGER is 32 bit. - #define LONGINT long long // LONGINT is 64 bit. (long long is always 64 bits, while long can be 32 bits e.g. under MSC/MingW) + typedef int INTEGER; // INTEGER is 32 bit. + typedef long long LONGINT; // LONGINT is 64 bit. (long long is always 64 bits, while long can be 32 bits e.g. under MSC/MingW) + typedef unsigned int U_INTEGER; + typedef unsigned long long U_LONGINT; #else - #define INTEGER short int // INTEGER is 16 bit. - #define LONGINT long // LONGINT is 32 bit. + typedef short int INTEGER; // INTEGER is 16 bit. + typedef long LONGINT; // LONGINT is 32 bit. + typedef unsigned short int U_INTEGER; + typedef unsigned long U_LONGINT; #endif -#define SET unsigned LONGINT +typedef U_LONGINT SET; // OS Memory allocation interfaces are in PlatformXXX.Mod @@ -78,8 +88,8 @@ extern double SYSTEM_ABSD (double i); extern void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0); extern void SYSTEM_ENUMP (void *adr, LONGINT n, void (*P)()); extern void SYSTEM_ENUMR (void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()); -extern LONGINT SYSTEM_DIV (unsigned LONGINT x, unsigned LONGINT y); -extern LONGINT SYSTEM_MOD (unsigned LONGINT x, unsigned LONGINT y); +extern LONGINT SYSTEM_DIV (U_LONGINT x, U_LONGINT y); +extern LONGINT SYSTEM_MOD (U_LONGINT x, U_LONGINT y); extern LONGINT SYSTEM_ENTIER (double x); @@ -127,22 +137,22 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __GET(a, x, t) x= *(t*)(uintptr_t)(a) #define __PUT(a, x, t) *(t*)(uintptr_t)(a)=x -#define __LSHL(x, n, t) ((t)((unsigned t)(x)<<(n))) -#define __LSHR(x, n, t) ((t)((unsigned t)(x)>>(n))) +#define __LSHL(x, n, t) ((t)((U_##t)(x)<<(n))) +#define __LSHR(x, n, t) ((t)((U_##t)(x)>>(n))) #define __LSH(x, n, t) ((n)>=0? __LSHL(x, n, t): __LSHR(x, -(n), t)) #define __ASHL(x, n) ((LONGINT)(x)<<(n)) #define __ASHR(x, n) ((LONGINT)(x)>>(n)) #define __ASH(x, n) ((n)>=0?__ASHL(x,n):__ASHR(x,-(n))) -#define __ROTL(x, n, t) ((t)((unsigned t)(x)<<(n)|(unsigned t)(x)>>(8*sizeof(t)-(n)))) -#define __ROTR(x, n, t) ((t)((unsigned t)(x)>>(n)|(unsigned t)(x)<<(8*sizeof(t)-(n)))) +#define __ROTL(x, n, t) ((t)((U_##t)(x)<<(n)|(U_##t)(x)>>(8*sizeof(t)-(n)))) +#define __ROTR(x, n, t) ((t)((U_##t)(x)>>(n)|(U_##t)(x)<<(8*sizeof(t)-(n)))) #define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) -#define __BIT(x, n) (*(unsigned LONGINT*)(x)>>(n)&1) +#define __BIT(x, n) (*(U_LONGINT*)(x)>>(n)&1) #define __MOVE(s, d, n) memcpy((char*)(uintptr_t)(d),(char*)(uintptr_t)(s),n) #define __ASHF(x, n) SYSTEM_ASH((LONGINT)(x), (LONGINT)(n)) -#define __SHORT(x, y) ((int)((unsigned LONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) +#define __SHORT(x, y) ((int)((U_LONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) #define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) #define __CHR(x) ((CHAR)__R(x, 256)) #define __CHRF(x) ((CHAR)__RF(x, 256)) @@ -165,9 +175,9 @@ static int __str_cmp(CHAR *x, CHAR *y){ // Runtime checks -#define __X(i, ub) (((unsigned LONGINT)(i)<(unsigned LONGINT)(ub))?i:(__HALT(-2),0)) +#define __X(i, ub) (((U_LONGINT)(i)<(U_LONGINT)(ub))?i:(__HALT(-2),0)) #define __XF(i, ub) SYSTEM_XCHK((LONGINT)(i), (LONGINT)(ub)) -#define __R(i, ub) (((unsigned LONGINT)(i)<(unsigned LONGINT)(ub))?i:(__HALT(-8),0)) +#define __R(i, ub) (((U_LONGINT)(i)<(U_LONGINT)(ub))?i:(__HALT(-8),0)) #define __RF(i, ub) SYSTEM_RCHK((LONGINT)(i),(LONGINT)(ub)) #define __RETCHK __retchk: __HALT(-3); return 0; #define __CASECHK __HALT(-4) diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index 9b7cedf9..5ea5720d 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index 4e768eb2..3a8ef7a3 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index 06256562..6e92e862 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Files.h" #include "Modules.h" diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index 7d6146f4..169fe56b 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/Vishap.c b/bootstrap/unix-48/Vishap.c index b1d58deb..a5d922e9 100644 --- a/bootstrap/unix-48/Vishap.c +++ b/bootstrap/unix-48/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkamSf */ #include "SYSTEM.h" #include "Configuration.h" #include "Heap.h" diff --git a/bootstrap/unix-48/WindowsWrapper.h b/bootstrap/unix-48/WindowsWrapper.h index cdb8714c..b72c815a 100644 --- a/bootstrap/unix-48/WindowsWrapper.h +++ b/bootstrap/unix-48/WindowsWrapper.h @@ -2,8 +2,9 @@ // // Includes Windows.h while avoiding conflicts with Oberon types. + +#define BOOLEAN _BOOLEAN +#define CHAR _CHAR +#include #undef BOOLEAN #undef CHAR -#include -#define BOOLEAN char -#define CHAR unsigned char diff --git a/bootstrap/unix-48/errors.c b/bootstrap/unix-48/errors.c index 8a192c44..e8272348 100644 --- a/bootstrap/unix-48/errors.c +++ b/bootstrap/unix-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/unix-48/errors.h b/bootstrap/unix-48/errors.h index faa4b1ce..7a085f56 100644 --- a/bootstrap/unix-48/errors.h +++ b/bootstrap/unix-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index cf9b6b4c..646b357b 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index ea47d26c..1c63c923 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/vt100.c b/bootstrap/unix-48/vt100.c index fdcd322d..67bed77e 100644 --- a/bootstrap/unix-48/vt100.c +++ b/bootstrap/unix-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Strings.h" diff --git a/bootstrap/unix-48/vt100.h b/bootstrap/unix-48/vt100.h index 88660721..83c4e777 100644 --- a/bootstrap/unix-48/vt100.h +++ b/bootstrap/unix-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index 2e9247b8..bdec7223 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -14,6 +14,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/07/11] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/07/19] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index b8c7482a..00d35df8 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Console.c b/bootstrap/unix-88/Console.c index 243cef3d..28a3d5cf 100644 --- a/bootstrap/unix-88/Console.c +++ b/bootstrap/unix-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Platform.h" diff --git a/bootstrap/unix-88/Console.h b/bootstrap/unix-88/Console.h index afcd718c..ae5997db 100644 --- a/bootstrap/unix-88/Console.h +++ b/bootstrap/unix-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index ec13a168..f8e3a46a 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin tspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 83125844..7b4ace20 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index a119ef7f..9122c75d 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin tskSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index 04fd5506..070c972a 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 1c649e58..0aae7575 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index 29c581b4..39c8f674 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index 8915bdff..592ee7e0 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index c363d1ef..3e8819ed 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index 29166703..008bc7ca 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index 957409f7..a80eedad 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 0e9f11f4..b5198578 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index e56dad24..56fcf196 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index 478ec10b..3adde5cb 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPB.h" diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index 6e41e6d9..71e6e1fb 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index fcfc8cdf..8e85be6e 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin tspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index b0f099c1..dfa2d800 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index e9543cbc..57333946 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index a1d3e4b5..7f7aff33 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 875f2aed..1091acf3 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPC.h" diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index 9afa026c..0370a1d7 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 228c634b..7f0a4d64 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index 2868bffc..9ee31f1b 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 15cb6037..911df230 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index 304178b9..f166c1b9 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/SYSTEM.c b/bootstrap/unix-88/SYSTEM.c index 0fcc5ee2..50e91c6d 100644 --- a/bootstrap/unix-88/SYSTEM.c +++ b/bootstrap/unix-88/SYSTEM.c @@ -36,7 +36,7 @@ void SYSTEM_ENUMP(void *adr, LONGINT n, void (*P)()) { while (n > 0) { P((LONGINT)(uintptr_t)(*((void**)(adr)))); - adr = ((void**)adr) + 1; + adr = ((void**)adr) + 1; n--; } } @@ -49,18 +49,18 @@ void SYSTEM_ENUMR(void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()) t = typ; off = *t; while (off >= 0) {P(*(LONGINT*)((char*)adr+off)); t++; off = *t;} - adr = ((char*)adr) + size; + adr = ((char*)adr) + size; n--; } } -LONGINT SYSTEM_DIV(unsigned LONGINT x, unsigned LONGINT y) +LONGINT SYSTEM_DIV(U_LONGINT x, U_LONGINT y) { if ((LONGINT) x >= 0) return (x / y); else return -((y - 1 - x) / y); } -LONGINT SYSTEM_MOD(unsigned LONGINT x, unsigned LONGINT y) -{ unsigned LONGINT m; +LONGINT SYSTEM_MOD(U_LONGINT x, U_LONGINT y) +{ U_LONGINT m; if ((LONGINT) x >= 0) return (x % y); else { m = (-x) % y; if (m != 0) return (y - m); else return 0; @@ -171,29 +171,29 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler SystemSignalHandler SystemInterruptHandler = 0; SystemSignalHandler SystemQuitHandler = 0; BOOL ConsoleCtrlHandlerSet = FALSE; - + BOOL WINAPI SystemConsoleCtrlHandler(DWORD ctrlType) { if ((ctrlType == CTRL_C_EVENT) || (ctrlType == CTRL_BREAK_EVENT)) { if (SystemInterruptHandler) { SystemInterruptHandler(2); // SIGINT return TRUE; - } + } } else { // Close, logoff or shutdown - if (SystemQuitHandler) { + if (SystemQuitHandler) { SystemQuitHandler(3); // SIGQUIT return TRUE; } } return FALSE; } - + void EnsureConsoleCtrlHandler() { if (!ConsoleCtrlHandlerSet) { SetConsoleCtrlHandler(SystemConsoleCtrlHandler, TRUE); ConsoleCtrlHandlerSet = TRUE; } } - + void SystemSetInterruptHandler(uintptr_t h) { EnsureConsoleCtrlHandler(); SystemInterruptHandler = (SystemSignalHandler)h; diff --git a/bootstrap/unix-88/SYSTEM.h b/bootstrap/unix-88/SYSTEM.h index 41ef9995..34b69a8a 100644 --- a/bootstrap/unix-88/SYSTEM.h +++ b/bootstrap/unix-88/SYSTEM.h @@ -41,25 +41,35 @@ // Oberon types -#define BOOLEAN char -#define SYSTEM_BYTE unsigned char -#define CHAR unsigned char -#define SHORTINT signed char -#define REAL float -#define LONGREAL double -#define SYSTEM_PTR void* +typedef char BOOLEAN; +typedef unsigned char SYSTEM_BYTE; +typedef unsigned char CHAR; +typedef signed char SHORTINT; +typedef float REAL; +typedef double LONGREAL; +typedef void* SYSTEM_PTR; + +// Unsigned variants are for use by shift and rotate macros. + +typedef unsigned char U_SYSTEM_BYTE; +typedef unsigned char U_CHAR; +typedef unsigned char U_SHORTINT; // For 32 bit builds, the size of LONGINT depends on a make option: #if (__SIZEOF_POINTER__ == 8) || defined(LARGE) || defined(_WIN64) - #define INTEGER int // INTEGER is 32 bit. - #define LONGINT long long // LONGINT is 64 bit. (long long is always 64 bits, while long can be 32 bits e.g. under MSC/MingW) + typedef int INTEGER; // INTEGER is 32 bit. + typedef long long LONGINT; // LONGINT is 64 bit. (long long is always 64 bits, while long can be 32 bits e.g. under MSC/MingW) + typedef unsigned int U_INTEGER; + typedef unsigned long long U_LONGINT; #else - #define INTEGER short int // INTEGER is 16 bit. - #define LONGINT long // LONGINT is 32 bit. + typedef short int INTEGER; // INTEGER is 16 bit. + typedef long LONGINT; // LONGINT is 32 bit. + typedef unsigned short int U_INTEGER; + typedef unsigned long U_LONGINT; #endif -#define SET unsigned LONGINT +typedef U_LONGINT SET; // OS Memory allocation interfaces are in PlatformXXX.Mod @@ -78,8 +88,8 @@ extern double SYSTEM_ABSD (double i); extern void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0); extern void SYSTEM_ENUMP (void *adr, LONGINT n, void (*P)()); extern void SYSTEM_ENUMR (void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()); -extern LONGINT SYSTEM_DIV (unsigned LONGINT x, unsigned LONGINT y); -extern LONGINT SYSTEM_MOD (unsigned LONGINT x, unsigned LONGINT y); +extern LONGINT SYSTEM_DIV (U_LONGINT x, U_LONGINT y); +extern LONGINT SYSTEM_MOD (U_LONGINT x, U_LONGINT y); extern LONGINT SYSTEM_ENTIER (double x); @@ -127,22 +137,22 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __GET(a, x, t) x= *(t*)(uintptr_t)(a) #define __PUT(a, x, t) *(t*)(uintptr_t)(a)=x -#define __LSHL(x, n, t) ((t)((unsigned t)(x)<<(n))) -#define __LSHR(x, n, t) ((t)((unsigned t)(x)>>(n))) +#define __LSHL(x, n, t) ((t)((U_##t)(x)<<(n))) +#define __LSHR(x, n, t) ((t)((U_##t)(x)>>(n))) #define __LSH(x, n, t) ((n)>=0? __LSHL(x, n, t): __LSHR(x, -(n), t)) #define __ASHL(x, n) ((LONGINT)(x)<<(n)) #define __ASHR(x, n) ((LONGINT)(x)>>(n)) #define __ASH(x, n) ((n)>=0?__ASHL(x,n):__ASHR(x,-(n))) -#define __ROTL(x, n, t) ((t)((unsigned t)(x)<<(n)|(unsigned t)(x)>>(8*sizeof(t)-(n)))) -#define __ROTR(x, n, t) ((t)((unsigned t)(x)>>(n)|(unsigned t)(x)<<(8*sizeof(t)-(n)))) +#define __ROTL(x, n, t) ((t)((U_##t)(x)<<(n)|(U_##t)(x)>>(8*sizeof(t)-(n)))) +#define __ROTR(x, n, t) ((t)((U_##t)(x)>>(n)|(U_##t)(x)<<(8*sizeof(t)-(n)))) #define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) -#define __BIT(x, n) (*(unsigned LONGINT*)(x)>>(n)&1) +#define __BIT(x, n) (*(U_LONGINT*)(x)>>(n)&1) #define __MOVE(s, d, n) memcpy((char*)(uintptr_t)(d),(char*)(uintptr_t)(s),n) #define __ASHF(x, n) SYSTEM_ASH((LONGINT)(x), (LONGINT)(n)) -#define __SHORT(x, y) ((int)((unsigned LONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) +#define __SHORT(x, y) ((int)((U_LONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) #define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) #define __CHR(x) ((CHAR)__R(x, 256)) #define __CHRF(x) ((CHAR)__RF(x, 256)) @@ -165,9 +175,9 @@ static int __str_cmp(CHAR *x, CHAR *y){ // Runtime checks -#define __X(i, ub) (((unsigned LONGINT)(i)<(unsigned LONGINT)(ub))?i:(__HALT(-2),0)) +#define __X(i, ub) (((U_LONGINT)(i)<(U_LONGINT)(ub))?i:(__HALT(-2),0)) #define __XF(i, ub) SYSTEM_XCHK((LONGINT)(i), (LONGINT)(ub)) -#define __R(i, ub) (((unsigned LONGINT)(i)<(unsigned LONGINT)(ub))?i:(__HALT(-8),0)) +#define __R(i, ub) (((U_LONGINT)(i)<(U_LONGINT)(ub))?i:(__HALT(-8),0)) #define __RF(i, ub) SYSTEM_RCHK((LONGINT)(i),(LONGINT)(ub)) #define __RETCHK __retchk: __HALT(-3); return 0; #define __CASECHK __HALT(-4) diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index 77aeeac7..e767e842 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index daaf5699..94a70d57 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index bf7ca304..f5efee7c 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Files.h" diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index 9b0a8375..5d8e0c33 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/Vishap.c b/bootstrap/unix-88/Vishap.c index adda1b61..822287a3 100644 --- a/bootstrap/unix-88/Vishap.c +++ b/bootstrap/unix-88/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkamSf */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/unix-88/WindowsWrapper.h b/bootstrap/unix-88/WindowsWrapper.h index cdb8714c..b72c815a 100644 --- a/bootstrap/unix-88/WindowsWrapper.h +++ b/bootstrap/unix-88/WindowsWrapper.h @@ -2,8 +2,9 @@ // // Includes Windows.h while avoiding conflicts with Oberon types. + +#define BOOLEAN _BOOLEAN +#define CHAR _CHAR +#include #undef BOOLEAN #undef CHAR -#include -#define BOOLEAN char -#define CHAR unsigned char diff --git a/bootstrap/unix-88/errors.c b/bootstrap/unix-88/errors.c index 53223732..a54d8e43 100644 --- a/bootstrap/unix-88/errors.c +++ b/bootstrap/unix-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/unix-88/errors.h b/bootstrap/unix-88/errors.h index 12762322..205ba3a1 100644 --- a/bootstrap/unix-88/errors.h +++ b/bootstrap/unix-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index 63030983..327aeac4 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index 3efe7c26..f19d95a4 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/vt100.c b/bootstrap/unix-88/vt100.c index a59c9241..4b742768 100644 --- a/bootstrap/unix-88/vt100.c +++ b/bootstrap/unix-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/unix-88/vt100.h b/bootstrap/unix-88/vt100.h index 9deec89a..dd08fa37 100644 --- a/bootstrap/unix-88/vt100.h +++ b/bootstrap/unix-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index 6cc8caad..40ee14ce 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -13,6 +13,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/07/11] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/07/19] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index a9c49d8e..bf6756e8 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Console.c b/bootstrap/windows-48/Console.c index fc3b5226..84f4ea3b 100644 --- a/bootstrap/windows-48/Console.c +++ b/bootstrap/windows-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Platform.h" diff --git a/bootstrap/windows-48/Console.h b/bootstrap/windows-48/Console.h index 8df4d5f3..a4799f33 100644 --- a/bootstrap/windows-48/Console.h +++ b/bootstrap/windows-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index f28675b3..0eb0643d 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index ad0f8733..cac52834 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index 0e8d2178..d6248ab0 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin tskSfF */ #include "SYSTEM.h" struct Heap__1 { diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index ce80df86..a7c115d1 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index a29a7f9b..5e0ba69f 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Heap.h" diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index c605ebc6..2387f45f 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index 40d66396..a69a396f 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index 0a4e9b21..9391eccb 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index f67f0cda..81cadc05 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "OPM.h" diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index 6209887e..27fe129c 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 397d4683..05ec3144 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index 42e2c9d5..c5e413a3 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index 207e39fc..877f2dc0 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPB.h" #include "OPM.h" diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index b0c639c0..c7a155eb 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index 3945d04c..e4fb2cf6 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index d09d39b6..73fb31d0 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index db859ffa..34c1acb6 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index 3c2cf4f3..998a6db8 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index fabbd4ab..1c086988 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPC.h" #include "OPM.h" diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index 3d6bec56..c9a566de 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index ec3a17f4..8de5b802 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index f0054fdb..c72e975f 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index b9cd1c3d..146ece15 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index aefa8974..79518e88 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/SYSTEM.c b/bootstrap/windows-48/SYSTEM.c index 0fcc5ee2..50e91c6d 100644 --- a/bootstrap/windows-48/SYSTEM.c +++ b/bootstrap/windows-48/SYSTEM.c @@ -36,7 +36,7 @@ void SYSTEM_ENUMP(void *adr, LONGINT n, void (*P)()) { while (n > 0) { P((LONGINT)(uintptr_t)(*((void**)(adr)))); - adr = ((void**)adr) + 1; + adr = ((void**)adr) + 1; n--; } } @@ -49,18 +49,18 @@ void SYSTEM_ENUMR(void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()) t = typ; off = *t; while (off >= 0) {P(*(LONGINT*)((char*)adr+off)); t++; off = *t;} - adr = ((char*)adr) + size; + adr = ((char*)adr) + size; n--; } } -LONGINT SYSTEM_DIV(unsigned LONGINT x, unsigned LONGINT y) +LONGINT SYSTEM_DIV(U_LONGINT x, U_LONGINT y) { if ((LONGINT) x >= 0) return (x / y); else return -((y - 1 - x) / y); } -LONGINT SYSTEM_MOD(unsigned LONGINT x, unsigned LONGINT y) -{ unsigned LONGINT m; +LONGINT SYSTEM_MOD(U_LONGINT x, U_LONGINT y) +{ U_LONGINT m; if ((LONGINT) x >= 0) return (x % y); else { m = (-x) % y; if (m != 0) return (y - m); else return 0; @@ -171,29 +171,29 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler SystemSignalHandler SystemInterruptHandler = 0; SystemSignalHandler SystemQuitHandler = 0; BOOL ConsoleCtrlHandlerSet = FALSE; - + BOOL WINAPI SystemConsoleCtrlHandler(DWORD ctrlType) { if ((ctrlType == CTRL_C_EVENT) || (ctrlType == CTRL_BREAK_EVENT)) { if (SystemInterruptHandler) { SystemInterruptHandler(2); // SIGINT return TRUE; - } + } } else { // Close, logoff or shutdown - if (SystemQuitHandler) { + if (SystemQuitHandler) { SystemQuitHandler(3); // SIGQUIT return TRUE; } } return FALSE; } - + void EnsureConsoleCtrlHandler() { if (!ConsoleCtrlHandlerSet) { SetConsoleCtrlHandler(SystemConsoleCtrlHandler, TRUE); ConsoleCtrlHandlerSet = TRUE; } } - + void SystemSetInterruptHandler(uintptr_t h) { EnsureConsoleCtrlHandler(); SystemInterruptHandler = (SystemSignalHandler)h; diff --git a/bootstrap/windows-48/SYSTEM.h b/bootstrap/windows-48/SYSTEM.h index 41ef9995..34b69a8a 100644 --- a/bootstrap/windows-48/SYSTEM.h +++ b/bootstrap/windows-48/SYSTEM.h @@ -41,25 +41,35 @@ // Oberon types -#define BOOLEAN char -#define SYSTEM_BYTE unsigned char -#define CHAR unsigned char -#define SHORTINT signed char -#define REAL float -#define LONGREAL double -#define SYSTEM_PTR void* +typedef char BOOLEAN; +typedef unsigned char SYSTEM_BYTE; +typedef unsigned char CHAR; +typedef signed char SHORTINT; +typedef float REAL; +typedef double LONGREAL; +typedef void* SYSTEM_PTR; + +// Unsigned variants are for use by shift and rotate macros. + +typedef unsigned char U_SYSTEM_BYTE; +typedef unsigned char U_CHAR; +typedef unsigned char U_SHORTINT; // For 32 bit builds, the size of LONGINT depends on a make option: #if (__SIZEOF_POINTER__ == 8) || defined(LARGE) || defined(_WIN64) - #define INTEGER int // INTEGER is 32 bit. - #define LONGINT long long // LONGINT is 64 bit. (long long is always 64 bits, while long can be 32 bits e.g. under MSC/MingW) + typedef int INTEGER; // INTEGER is 32 bit. + typedef long long LONGINT; // LONGINT is 64 bit. (long long is always 64 bits, while long can be 32 bits e.g. under MSC/MingW) + typedef unsigned int U_INTEGER; + typedef unsigned long long U_LONGINT; #else - #define INTEGER short int // INTEGER is 16 bit. - #define LONGINT long // LONGINT is 32 bit. + typedef short int INTEGER; // INTEGER is 16 bit. + typedef long LONGINT; // LONGINT is 32 bit. + typedef unsigned short int U_INTEGER; + typedef unsigned long U_LONGINT; #endif -#define SET unsigned LONGINT +typedef U_LONGINT SET; // OS Memory allocation interfaces are in PlatformXXX.Mod @@ -78,8 +88,8 @@ extern double SYSTEM_ABSD (double i); extern void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0); extern void SYSTEM_ENUMP (void *adr, LONGINT n, void (*P)()); extern void SYSTEM_ENUMR (void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()); -extern LONGINT SYSTEM_DIV (unsigned LONGINT x, unsigned LONGINT y); -extern LONGINT SYSTEM_MOD (unsigned LONGINT x, unsigned LONGINT y); +extern LONGINT SYSTEM_DIV (U_LONGINT x, U_LONGINT y); +extern LONGINT SYSTEM_MOD (U_LONGINT x, U_LONGINT y); extern LONGINT SYSTEM_ENTIER (double x); @@ -127,22 +137,22 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __GET(a, x, t) x= *(t*)(uintptr_t)(a) #define __PUT(a, x, t) *(t*)(uintptr_t)(a)=x -#define __LSHL(x, n, t) ((t)((unsigned t)(x)<<(n))) -#define __LSHR(x, n, t) ((t)((unsigned t)(x)>>(n))) +#define __LSHL(x, n, t) ((t)((U_##t)(x)<<(n))) +#define __LSHR(x, n, t) ((t)((U_##t)(x)>>(n))) #define __LSH(x, n, t) ((n)>=0? __LSHL(x, n, t): __LSHR(x, -(n), t)) #define __ASHL(x, n) ((LONGINT)(x)<<(n)) #define __ASHR(x, n) ((LONGINT)(x)>>(n)) #define __ASH(x, n) ((n)>=0?__ASHL(x,n):__ASHR(x,-(n))) -#define __ROTL(x, n, t) ((t)((unsigned t)(x)<<(n)|(unsigned t)(x)>>(8*sizeof(t)-(n)))) -#define __ROTR(x, n, t) ((t)((unsigned t)(x)>>(n)|(unsigned t)(x)<<(8*sizeof(t)-(n)))) +#define __ROTL(x, n, t) ((t)((U_##t)(x)<<(n)|(U_##t)(x)>>(8*sizeof(t)-(n)))) +#define __ROTR(x, n, t) ((t)((U_##t)(x)>>(n)|(U_##t)(x)<<(8*sizeof(t)-(n)))) #define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) -#define __BIT(x, n) (*(unsigned LONGINT*)(x)>>(n)&1) +#define __BIT(x, n) (*(U_LONGINT*)(x)>>(n)&1) #define __MOVE(s, d, n) memcpy((char*)(uintptr_t)(d),(char*)(uintptr_t)(s),n) #define __ASHF(x, n) SYSTEM_ASH((LONGINT)(x), (LONGINT)(n)) -#define __SHORT(x, y) ((int)((unsigned LONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) +#define __SHORT(x, y) ((int)((U_LONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) #define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) #define __CHR(x) ((CHAR)__R(x, 256)) #define __CHRF(x) ((CHAR)__RF(x, 256)) @@ -165,9 +175,9 @@ static int __str_cmp(CHAR *x, CHAR *y){ // Runtime checks -#define __X(i, ub) (((unsigned LONGINT)(i)<(unsigned LONGINT)(ub))?i:(__HALT(-2),0)) +#define __X(i, ub) (((U_LONGINT)(i)<(U_LONGINT)(ub))?i:(__HALT(-2),0)) #define __XF(i, ub) SYSTEM_XCHK((LONGINT)(i), (LONGINT)(ub)) -#define __R(i, ub) (((unsigned LONGINT)(i)<(unsigned LONGINT)(ub))?i:(__HALT(-8),0)) +#define __R(i, ub) (((U_LONGINT)(i)<(U_LONGINT)(ub))?i:(__HALT(-8),0)) #define __RF(i, ub) SYSTEM_RCHK((LONGINT)(i),(LONGINT)(ub)) #define __RETCHK __retchk: __HALT(-3); return 0; #define __CASECHK __HALT(-4) diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index 9b7cedf9..5ea5720d 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index 4e768eb2..3a8ef7a3 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index 06256562..6e92e862 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Files.h" #include "Modules.h" diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index 7d6146f4..169fe56b 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/Vishap.c b/bootstrap/windows-48/Vishap.c index b1d58deb..a5d922e9 100644 --- a/bootstrap/windows-48/Vishap.c +++ b/bootstrap/windows-48/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkamSf */ #include "SYSTEM.h" #include "Configuration.h" #include "Heap.h" diff --git a/bootstrap/windows-48/WindowsWrapper.h b/bootstrap/windows-48/WindowsWrapper.h index cdb8714c..b72c815a 100644 --- a/bootstrap/windows-48/WindowsWrapper.h +++ b/bootstrap/windows-48/WindowsWrapper.h @@ -2,8 +2,9 @@ // // Includes Windows.h while avoiding conflicts with Oberon types. + +#define BOOLEAN _BOOLEAN +#define CHAR _CHAR +#include #undef BOOLEAN #undef CHAR -#include -#define BOOLEAN char -#define CHAR unsigned char diff --git a/bootstrap/windows-48/errors.c b/bootstrap/windows-48/errors.c index 8a192c44..e8272348 100644 --- a/bootstrap/windows-48/errors.c +++ b/bootstrap/windows-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/windows-48/errors.h b/bootstrap/windows-48/errors.h index faa4b1ce..7a085f56 100644 --- a/bootstrap/windows-48/errors.h +++ b/bootstrap/windows-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index cf9b6b4c..646b357b 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index ea47d26c..1c63c923 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/vt100.c b/bootstrap/windows-48/vt100.c index fdcd322d..67bed77e 100644 --- a/bootstrap/windows-48/vt100.c +++ b/bootstrap/windows-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Strings.h" diff --git a/bootstrap/windows-48/vt100.h b/bootstrap/windows-48/vt100.h index 88660721..83c4e777 100644 --- a/bootstrap/windows-48/vt100.h +++ b/bootstrap/windows-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index 2e9247b8..bdec7223 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -14,6 +14,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/07/11] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/07/19] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index b8c7482a..00d35df8 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Console.c b/bootstrap/windows-88/Console.c index 49fab6b4..82ab9c30 100644 --- a/bootstrap/windows-88/Console.c +++ b/bootstrap/windows-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Platform.h" diff --git a/bootstrap/windows-88/Console.h b/bootstrap/windows-88/Console.h index afcd718c..ae5997db 100644 --- a/bootstrap/windows-88/Console.h +++ b/bootstrap/windows-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 5a4bcb4b..cdaf4440 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin tspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 23dca75b..03f88e71 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index a119ef7f..9122c75d 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin tskSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index 04fd5506..070c972a 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 1c649e58..0aae7575 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index 29c581b4..39c8f674 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index 8915bdff..592ee7e0 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index c363d1ef..3e8819ed 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index 29166703..008bc7ca 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index 957409f7..a80eedad 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 0e9f11f4..b5198578 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index e56dad24..56fcf196 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index 478ec10b..3adde5cb 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPB.h" diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index 6e41e6d9..71e6e1fb 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index fcfc8cdf..8e85be6e 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin tspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index b0f099c1..dfa2d800 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index e9543cbc..57333946 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index a1d3e4b5..7f7aff33 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 875f2aed..1091acf3 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPC.h" diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index 9afa026c..0370a1d7 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index e16a72de..3d29e466 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index f229d6a9..a15fd477 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 15cb6037..911df230 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index 304178b9..f166c1b9 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/SYSTEM.c b/bootstrap/windows-88/SYSTEM.c index 0fcc5ee2..50e91c6d 100644 --- a/bootstrap/windows-88/SYSTEM.c +++ b/bootstrap/windows-88/SYSTEM.c @@ -36,7 +36,7 @@ void SYSTEM_ENUMP(void *adr, LONGINT n, void (*P)()) { while (n > 0) { P((LONGINT)(uintptr_t)(*((void**)(adr)))); - adr = ((void**)adr) + 1; + adr = ((void**)adr) + 1; n--; } } @@ -49,18 +49,18 @@ void SYSTEM_ENUMR(void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()) t = typ; off = *t; while (off >= 0) {P(*(LONGINT*)((char*)adr+off)); t++; off = *t;} - adr = ((char*)adr) + size; + adr = ((char*)adr) + size; n--; } } -LONGINT SYSTEM_DIV(unsigned LONGINT x, unsigned LONGINT y) +LONGINT SYSTEM_DIV(U_LONGINT x, U_LONGINT y) { if ((LONGINT) x >= 0) return (x / y); else return -((y - 1 - x) / y); } -LONGINT SYSTEM_MOD(unsigned LONGINT x, unsigned LONGINT y) -{ unsigned LONGINT m; +LONGINT SYSTEM_MOD(U_LONGINT x, U_LONGINT y) +{ U_LONGINT m; if ((LONGINT) x >= 0) return (x % y); else { m = (-x) % y; if (m != 0) return (y - m); else return 0; @@ -171,29 +171,29 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler SystemSignalHandler SystemInterruptHandler = 0; SystemSignalHandler SystemQuitHandler = 0; BOOL ConsoleCtrlHandlerSet = FALSE; - + BOOL WINAPI SystemConsoleCtrlHandler(DWORD ctrlType) { if ((ctrlType == CTRL_C_EVENT) || (ctrlType == CTRL_BREAK_EVENT)) { if (SystemInterruptHandler) { SystemInterruptHandler(2); // SIGINT return TRUE; - } + } } else { // Close, logoff or shutdown - if (SystemQuitHandler) { + if (SystemQuitHandler) { SystemQuitHandler(3); // SIGQUIT return TRUE; } } return FALSE; } - + void EnsureConsoleCtrlHandler() { if (!ConsoleCtrlHandlerSet) { SetConsoleCtrlHandler(SystemConsoleCtrlHandler, TRUE); ConsoleCtrlHandlerSet = TRUE; } } - + void SystemSetInterruptHandler(uintptr_t h) { EnsureConsoleCtrlHandler(); SystemInterruptHandler = (SystemSignalHandler)h; diff --git a/bootstrap/windows-88/SYSTEM.h b/bootstrap/windows-88/SYSTEM.h index 41ef9995..34b69a8a 100644 --- a/bootstrap/windows-88/SYSTEM.h +++ b/bootstrap/windows-88/SYSTEM.h @@ -41,25 +41,35 @@ // Oberon types -#define BOOLEAN char -#define SYSTEM_BYTE unsigned char -#define CHAR unsigned char -#define SHORTINT signed char -#define REAL float -#define LONGREAL double -#define SYSTEM_PTR void* +typedef char BOOLEAN; +typedef unsigned char SYSTEM_BYTE; +typedef unsigned char CHAR; +typedef signed char SHORTINT; +typedef float REAL; +typedef double LONGREAL; +typedef void* SYSTEM_PTR; + +// Unsigned variants are for use by shift and rotate macros. + +typedef unsigned char U_SYSTEM_BYTE; +typedef unsigned char U_CHAR; +typedef unsigned char U_SHORTINT; // For 32 bit builds, the size of LONGINT depends on a make option: #if (__SIZEOF_POINTER__ == 8) || defined(LARGE) || defined(_WIN64) - #define INTEGER int // INTEGER is 32 bit. - #define LONGINT long long // LONGINT is 64 bit. (long long is always 64 bits, while long can be 32 bits e.g. under MSC/MingW) + typedef int INTEGER; // INTEGER is 32 bit. + typedef long long LONGINT; // LONGINT is 64 bit. (long long is always 64 bits, while long can be 32 bits e.g. under MSC/MingW) + typedef unsigned int U_INTEGER; + typedef unsigned long long U_LONGINT; #else - #define INTEGER short int // INTEGER is 16 bit. - #define LONGINT long // LONGINT is 32 bit. + typedef short int INTEGER; // INTEGER is 16 bit. + typedef long LONGINT; // LONGINT is 32 bit. + typedef unsigned short int U_INTEGER; + typedef unsigned long U_LONGINT; #endif -#define SET unsigned LONGINT +typedef U_LONGINT SET; // OS Memory allocation interfaces are in PlatformXXX.Mod @@ -78,8 +88,8 @@ extern double SYSTEM_ABSD (double i); extern void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0); extern void SYSTEM_ENUMP (void *adr, LONGINT n, void (*P)()); extern void SYSTEM_ENUMR (void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()); -extern LONGINT SYSTEM_DIV (unsigned LONGINT x, unsigned LONGINT y); -extern LONGINT SYSTEM_MOD (unsigned LONGINT x, unsigned LONGINT y); +extern LONGINT SYSTEM_DIV (U_LONGINT x, U_LONGINT y); +extern LONGINT SYSTEM_MOD (U_LONGINT x, U_LONGINT y); extern LONGINT SYSTEM_ENTIER (double x); @@ -127,22 +137,22 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __GET(a, x, t) x= *(t*)(uintptr_t)(a) #define __PUT(a, x, t) *(t*)(uintptr_t)(a)=x -#define __LSHL(x, n, t) ((t)((unsigned t)(x)<<(n))) -#define __LSHR(x, n, t) ((t)((unsigned t)(x)>>(n))) +#define __LSHL(x, n, t) ((t)((U_##t)(x)<<(n))) +#define __LSHR(x, n, t) ((t)((U_##t)(x)>>(n))) #define __LSH(x, n, t) ((n)>=0? __LSHL(x, n, t): __LSHR(x, -(n), t)) #define __ASHL(x, n) ((LONGINT)(x)<<(n)) #define __ASHR(x, n) ((LONGINT)(x)>>(n)) #define __ASH(x, n) ((n)>=0?__ASHL(x,n):__ASHR(x,-(n))) -#define __ROTL(x, n, t) ((t)((unsigned t)(x)<<(n)|(unsigned t)(x)>>(8*sizeof(t)-(n)))) -#define __ROTR(x, n, t) ((t)((unsigned t)(x)>>(n)|(unsigned t)(x)<<(8*sizeof(t)-(n)))) +#define __ROTL(x, n, t) ((t)((U_##t)(x)<<(n)|(U_##t)(x)>>(8*sizeof(t)-(n)))) +#define __ROTR(x, n, t) ((t)((U_##t)(x)>>(n)|(U_##t)(x)<<(8*sizeof(t)-(n)))) #define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) -#define __BIT(x, n) (*(unsigned LONGINT*)(x)>>(n)&1) +#define __BIT(x, n) (*(U_LONGINT*)(x)>>(n)&1) #define __MOVE(s, d, n) memcpy((char*)(uintptr_t)(d),(char*)(uintptr_t)(s),n) #define __ASHF(x, n) SYSTEM_ASH((LONGINT)(x), (LONGINT)(n)) -#define __SHORT(x, y) ((int)((unsigned LONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) +#define __SHORT(x, y) ((int)((U_LONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) #define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) #define __CHR(x) ((CHAR)__R(x, 256)) #define __CHRF(x) ((CHAR)__RF(x, 256)) @@ -165,9 +175,9 @@ static int __str_cmp(CHAR *x, CHAR *y){ // Runtime checks -#define __X(i, ub) (((unsigned LONGINT)(i)<(unsigned LONGINT)(ub))?i:(__HALT(-2),0)) +#define __X(i, ub) (((U_LONGINT)(i)<(U_LONGINT)(ub))?i:(__HALT(-2),0)) #define __XF(i, ub) SYSTEM_XCHK((LONGINT)(i), (LONGINT)(ub)) -#define __R(i, ub) (((unsigned LONGINT)(i)<(unsigned LONGINT)(ub))?i:(__HALT(-8),0)) +#define __R(i, ub) (((U_LONGINT)(i)<(U_LONGINT)(ub))?i:(__HALT(-8),0)) #define __RF(i, ub) SYSTEM_RCHK((LONGINT)(i),(LONGINT)(ub)) #define __RETCHK __retchk: __HALT(-3); return 0; #define __CASECHK __HALT(-4) diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index 77aeeac7..e767e842 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index daaf5699..94a70d57 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index bf7ca304..f5efee7c 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Files.h" diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index 9b0a8375..5d8e0c33 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/Vishap.c b/bootstrap/windows-88/Vishap.c index adda1b61..822287a3 100644 --- a/bootstrap/windows-88/Vishap.c +++ b/bootstrap/windows-88/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkamSf */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/windows-88/WindowsWrapper.h b/bootstrap/windows-88/WindowsWrapper.h index cdb8714c..b72c815a 100644 --- a/bootstrap/windows-88/WindowsWrapper.h +++ b/bootstrap/windows-88/WindowsWrapper.h @@ -2,8 +2,9 @@ // // Includes Windows.h while avoiding conflicts with Oberon types. + +#define BOOLEAN _BOOLEAN +#define CHAR _CHAR +#include #undef BOOLEAN #undef CHAR -#include -#define BOOLEAN char -#define CHAR unsigned char diff --git a/bootstrap/windows-88/errors.c b/bootstrap/windows-88/errors.c index 53223732..a54d8e43 100644 --- a/bootstrap/windows-88/errors.c +++ b/bootstrap/windows-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/windows-88/errors.h b/bootstrap/windows-88/errors.h index 12762322..205ba3a1 100644 --- a/bootstrap/windows-88/errors.h +++ b/bootstrap/windows-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index 63030983..327aeac4 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index 3efe7c26..f19d95a4 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/vt100.c b/bootstrap/windows-88/vt100.c index a59c9241..4b742768 100644 --- a/bootstrap/windows-88/vt100.c +++ b/bootstrap/windows-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/windows-88/vt100.h b/bootstrap/windows-88/vt100.h index 9deec89a..dd08fa37 100644 --- a/bootstrap/windows-88/vt100.h +++ b/bootstrap/windows-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/src/tools/make/sourcechanges.sh b/src/tools/make/sourcechanges.sh index 4c76f406..dcfb6552 100644 --- a/src/tools/make/sourcechanges.sh +++ b/src/tools/make/sourcechanges.sh @@ -14,8 +14,8 @@ changes="0" for f in $1/*; do fn=$(basename $f) - egrep -v "(^/\* voc )|Configuration_|__MOVE.* cmd, " $f >$fn.old - egrep -v "(^/\* voc )|Configuration_|__MOVE.* cmd, " $fn >$fn.new + egrep -v "(^/\* voc )|Configuration_|__MOVE.* cmd, |OPM_(IntSize|PointerSize|Alignment) =" $f >$fn.old + egrep -v "(^/\* voc )|Configuration_|__MOVE.* cmd, |OPM_(IntSize|PointerSize|Alignment) =" $fn >$fn.new if ! diff -U 2 -b $fn.old $fn.new >$fn.diff; then echo "" echo "" From ece90b85c5f567d0f1eb1a588ab69ae02e7b128f Mon Sep 17 00:00:00 2001 From: David Brown Date: Tue, 19 Jul 2016 15:54:09 +0100 Subject: [PATCH 178/580] Omit (more) platform specific settings from code change tests. --- src/tools/make/sourcechanges.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tools/make/sourcechanges.sh b/src/tools/make/sourcechanges.sh index dcfb6552..b2460d25 100644 --- a/src/tools/make/sourcechanges.sh +++ b/src/tools/make/sourcechanges.sh @@ -14,8 +14,8 @@ changes="0" for f in $1/*; do fn=$(basename $f) - egrep -v "(^/\* voc )|Configuration_|__MOVE.* cmd, |OPM_(IntSize|PointerSize|Alignment) =" $f >$fn.old - egrep -v "(^/\* voc )|Configuration_|__MOVE.* cmd, |OPM_(IntSize|PointerSize|Alignment) =" $fn >$fn.new + egrep -v "(^/\* voc )|Configuration_|__MOVE.* cmd, |OPM_(IntSize|PointerSize|Alignment) =|Strings_Append.+void\*\)(cmd|OPM_OBERON|extTools_comp)" $f >$fn.old + egrep -v "(^/\* voc )|Configuration_|__MOVE.* cmd, |OPM_(IntSize|PointerSize|Alignment) =|Strings_Append.+void\*\)(cmd|OPM_OBERON|extTools_comp)" $fn >$fn.new if ! diff -U 2 -b $fn.old $fn.new >$fn.diff; then echo "" echo "" From 359aa1c43f24705bee86b8c2e613cd6476852633 Mon Sep 17 00:00:00 2001 From: David Brown Date: Tue, 19 Jul 2016 17:59:04 +0100 Subject: [PATCH 179/580] Add preliminary tests for generated code changes in the confidence tests. --- src/test/confidence/arrayassignment/old.s | 224 ++++++++++ src/test/confidence/hello/old.s | 60 +++ src/test/confidence/hello/test.sh | 3 +- src/test/confidence/language/old.s | 486 ++++++++++++++++++++++ src/test/confidence/lola/old.s | 105 +++++ src/test/confidence/signal/old.s | 400 ++++++++++++++++++ src/test/confidence/testenv.sh | 13 + src/test/confidence/testresult.sh | 9 + 8 files changed, 1298 insertions(+), 2 deletions(-) create mode 100644 src/test/confidence/arrayassignment/old.s create mode 100644 src/test/confidence/hello/old.s create mode 100644 src/test/confidence/language/old.s create mode 100644 src/test/confidence/lola/old.s create mode 100644 src/test/confidence/signal/old.s diff --git a/src/test/confidence/arrayassignment/old.s b/src/test/confidence/arrayassignment/old.s new file mode 100644 index 00000000..9d765cf0 --- /dev/null +++ b/src/test/confidence/arrayassignment/old.s @@ -0,0 +1,224 @@ +55 pushl %ebp +89E5 movl %esp, %ebp +83EC10 subl $16, %esp +C745FC00 movl $0, -4(%ebp) +8B55FC movl -4(%ebp), %edx +8B4508 movl 8(%ebp), %eax +01D0 addl %edx, %eax +0FB600 movzbl (%eax), %eax +8845FB movb %al, -5(%ebp) +8B55FC movl -4(%ebp), %edx +8B450C movl 12(%ebp), %eax +01D0 addl %edx, %eax +0FB600 movzbl (%eax), %eax +8845FA movb %al, -6(%ebp) +8345FC01 addl $1, -4(%ebp) +807DFB00 cmpb $0, -5(%ebp) +7508 jne L2 +0FB645FA movzbl -6(%ebp), %eax +F7D8 negl %eax +EB15 jmp L3 +0FB645FB movzbl -5(%ebp), %eax +3A45FA cmpb -6(%ebp), %al +74C9 je L4 +0FB655FB movzbl -5(%ebp), %edx +0FB645FA movzbl -6(%ebp), %eax +29C2 subl %eax, %edx +89D0 movl %edx, %eax +C9 leave +C3 ret +616100 .ascii "aa\0" +6133303A .ascii "a30: \0" +6132303A .ascii "a20: \0" +6131303A .ascii "a10: \0" +000000 .align 4 +41727261 .ascii "Array assignment test complete.\0" +79206173 +7369676E +6D656E74 +20746573 +55 pushl %ebp +89E5 movl %esp, %ebp +83E4F0 andl $-16, %esp +83EC40 subl $64, %esp +E8000000 call ___main +8D550C leal 12(%ebp), %edx +8B4508 movl 8(%ebp), %eax +98 cwtl +89542404 movl %edx, 4(%esp) +890424 movl %eax, (%esp) +E8000000 call _Platform_Init +E8000000 call _Console__init +890424 movl %eax, (%esp) +E8000000 call _Heap_INCREF +C7442404 movl $0, 4(%esp) +00000000 +C7042400 movl $LC0, (%esp) +E8000000 call _Heap_REGMOD +A3800000 movl %eax, _m.2056 +C7050000 movl $544502577, _aa_a30 +00003173 +C7050400 movl $1663053873, _aa_a30+4 +00003130 +C7050800 movl $1848778856, _aa_a30+8 +00006820 +C7050C00 movl $808525924, _aa_a30+12 +00006420 +C7051000 movl $543712032, _aa_a30+16 +00002063 +C7051400 movl $543453747, _aa_a30+20 +00003372 +C7051800 movl $1663053873, _aa_a30+24 +00003130 +66C7051C movw $104, _aa_a30+28 +00000068 +C7442404 movl $6, 4(%esp) +06000000 +C7042403 movl $LC1, (%esp) +E8000000 call _Console_String +C7442404 movl $30, 4(%esp) +1E000000 +C7042400 movl $_aa_a30, (%esp) +E8000000 call _Console_String +E8000000 call _Console_Ln +C7442430 movl $_aa_a30, 48(%esp) +00000000 +C744242C movl $_aa_a20, 44(%esp) +2C000000 +C744243C movl $0, 60(%esp) +00000000 +C7442428 movl $19, 40(%esp) +13000000 +EB05 jmp L6 +8344243C addl $1, 60(%esp) +8B44243C movl 60(%esp), %eax +3B442428 cmpl 40(%esp), %eax +7D20 jge L7 +8B54243C movl 60(%esp), %edx +8B44242C movl 44(%esp), %eax +01D0 addl %edx, %eax +8B4C243C movl 60(%esp), %ecx +8B542430 movl 48(%esp), %edx +01CA addl %ecx, %edx +0FB612 movzbl (%edx), %edx +8810 movb %dl, (%eax) +0FB600 movzbl (%eax), %eax +84C0 testb %al, %al +75D1 jne L8 +8B54243C movl 60(%esp), %edx +8B44242C movl 44(%esp), %eax +01D0 addl %edx, %eax +C60000 movb $0, (%eax) +C7442404 movl $6, 4(%esp) +06000000 +C7042409 movl $LC2, (%esp) +E8000000 call _Console_String +C7442404 movl $20, 4(%esp) +14000000 +C704242C movl $_aa_a20, (%esp) +E8000000 call _Console_String +E8000000 call _Console_Ln +E8000000 call _Console_Ln +C7442424 movl $_aa_a30, 36(%esp) +00000000 +C7442420 movl $_aa_a10, 32(%esp) +20000000 +C7442438 movl $0, 56(%esp) +00000000 +C744241C movl $9, 28(%esp) +09000000 +EB05 jmp L9 +83442438 addl $1, 56(%esp) +8B442438 movl 56(%esp), %eax +3B44241C cmpl 28(%esp), %eax +7D20 jge L10 +8B542438 movl 56(%esp), %edx +8B442420 movl 32(%esp), %eax +01D0 addl %edx, %eax +8B4C2438 movl 56(%esp), %ecx +8B542424 movl 36(%esp), %edx +01CA addl %ecx, %edx +0FB612 movzbl (%edx), %edx +8810 movb %dl, (%eax) +0FB600 movzbl (%eax), %eax +84C0 testb %al, %al +75D1 jne L11 +8B542438 movl 56(%esp), %edx +8B442420 movl 32(%esp), %eax +01D0 addl %edx, %eax +C60000 movb $0, (%eax) +C7442404 movl $6, 4(%esp) +06000000 +C704240F movl $LC3, (%esp) +E8000000 call _Console_String +C7442404 movl $10, 4(%esp) +0A000000 +C7042420 movl $_aa_a10, (%esp) +E8000000 call _Console_String +E8000000 call _Console_Ln +C7442404 movl $6, 4(%esp) +06000000 +C7042409 movl $LC2, (%esp) +E8000000 call _Console_String +C7442404 movl $20, 4(%esp) +14000000 +C704242C movl $_aa_a20, (%esp) +E8000000 call _Console_String +E8000000 call _Console_Ln +E8000000 call _Console_Ln +C7442418 movl $_aa_a30, 24(%esp) +00000000 +C7442414 movl $_aa_a10, 20(%esp) +20000000 +C7442434 movl $0, 52(%esp) +00000000 +C7442410 movl $9, 16(%esp) +09000000 +EB05 jmp L12 +83442434 addl $1, 52(%esp) +8B442434 movl 52(%esp), %eax +3B442410 cmpl 16(%esp), %eax +7D20 jge L13 +8B542434 movl 52(%esp), %edx +8B442414 movl 20(%esp), %eax +01D0 addl %edx, %eax +8B4C2434 movl 52(%esp), %ecx +8B542418 movl 24(%esp), %edx +01CA addl %ecx, %edx +0FB612 movzbl (%edx), %edx +8810 movb %dl, (%eax) +0FB600 movzbl (%eax), %eax +84C0 testb %al, %al +75D1 jne L14 +8B542434 movl 52(%esp), %edx +8B442414 movl 20(%esp), %eax +01D0 addl %edx, %eax +C60000 movb $0, (%eax) +C7442404 movl $6, 4(%esp) +06000000 +C704240F movl $LC3, (%esp) +E8000000 call _Console_String +C7442404 movl $10, 4(%esp) +0A000000 +C7042420 movl $_aa_a10, (%esp) +E8000000 call _Console_String +E8000000 call _Console_Ln +C7442404 movl $6, 4(%esp) +06000000 +C7042409 movl $LC2, (%esp) +E8000000 call _Console_String +C7442404 movl $20, 4(%esp) +14000000 +C704242C movl $_aa_a20, (%esp) +E8000000 call _Console_String +E8000000 call _Console_Ln +E8000000 call _Console_Ln +C7442404 movl $32, 4(%esp) +20000000 +C7042418 movl $LC4, (%esp) +E8000000 call _Console_String +E8000000 call _Console_Ln +E8000000 call _Heap_FINALL +B8000000 movl $0, %eax +C9 leave +C3 ret diff --git a/src/test/confidence/hello/old.s b/src/test/confidence/hello/old.s new file mode 100644 index 00000000..618e26e5 --- /dev/null +++ b/src/test/confidence/hello/old.s @@ -0,0 +1,60 @@ +55 pushl %ebp +89E5 movl %esp, %ebp +83EC10 subl $16, %esp +C745FC00 movl $0, -4(%ebp) +8B55FC movl -4(%ebp), %edx +8B4508 movl 8(%ebp), %eax +01D0 addl %edx, %eax +0FB600 movzbl (%eax), %eax +8845FB movb %al, -5(%ebp) +8B55FC movl -4(%ebp), %edx +8B450C movl 12(%ebp), %eax +01D0 addl %edx, %eax +0FB600 movzbl (%eax), %eax +8845FA movb %al, -6(%ebp) +8345FC01 addl $1, -4(%ebp) +807DFB00 cmpb $0, -5(%ebp) +7508 jne L2 +0FB645FA movzbl -6(%ebp), %eax +F7D8 negl %eax +EB15 jmp L3 +0FB645FB movzbl -5(%ebp), %eax +3A45FA cmpb -6(%ebp), %al +74C9 je L4 +0FB655FB movzbl -5(%ebp), %edx +0FB645FA movzbl -6(%ebp), %eax +29C2 subl %eax, %edx +89D0 movl %edx, %eax +C9 leave +C3 ret +68656C6C .ascii "hello\0" +48656C6C .ascii "Hello.\0" +000000 .text +55 pushl %ebp +89E5 movl %esp, %ebp +83E4F0 andl $-16, %esp +83EC10 subl $16, %esp +E8000000 call ___main +8D550C leal 12(%ebp), %edx +8B4508 movl 8(%ebp), %eax +98 cwtl +89542404 movl %edx, 4(%esp) +890424 movl %eax, (%esp) +E8000000 call _Platform_Init +E8000000 call _Console__init +890424 movl %eax, (%esp) +E8000000 call _Heap_INCREF +C7442404 movl $0, 4(%esp) +00000000 +C7042400 movl $LC0, (%esp) +E8000000 call _Heap_REGMOD +A3000000 movl %eax, _m.2052 +C7442404 movl $7, 4(%esp) +07000000 +C7042406 movl $LC1, (%esp) +E8000000 call _Console_String +E8000000 call _Console_Ln +E8000000 call _Heap_FINALL +B8000000 movl $0, %eax +C9 leave +C3 ret diff --git a/src/test/confidence/hello/test.sh b/src/test/confidence/hello/test.sh index decaa458..4ebe71c3 100755 --- a/src/test/confidence/hello/test.sh +++ b/src/test/confidence/hello/test.sh @@ -1,6 +1,5 @@ #!/bin/sh . ../testenv.sh -# Generate mixed source and assembly code listing -CFLAGS="-gstabs -g1 -Wa,-acdhln=hello.s" && voc hello.mod -m +voc hello.mod -m ./hello >result . ../testresult.sh diff --git a/src/test/confidence/language/old.s b/src/test/confidence/language/old.s new file mode 100644 index 00000000..9a4499d2 --- /dev/null +++ b/src/test/confidence/language/old.s @@ -0,0 +1,486 @@ +55 pushl %ebp +89E5 movl %esp, %ebp +83EC10 subl $16, %esp +C745FC00 movl $0, -4(%ebp) +8B55FC movl -4(%ebp), %edx +8B4508 movl 8(%ebp), %eax +01D0 addl %edx, %eax +0FB600 movzbl (%eax), %eax +8845FB movb %al, -5(%ebp) +8B55FC movl -4(%ebp), %edx +8B450C movl 12(%ebp), %eax +01D0 addl %edx, %eax +0FB600 movzbl (%eax), %eax +8845FA movb %al, -6(%ebp) +8345FC01 addl $1, -4(%ebp) +807DFB00 cmpb $0, -5(%ebp) +7508 jne L2 +0FB645FA movzbl -6(%ebp), %eax +F7D8 negl %eax +EB15 jmp L3 +0FB645FB movzbl -5(%ebp), %eax +3A45FA cmpb -6(%ebp), %al +74C9 je L4 +0FB655FB movzbl -5(%ebp), %edx +0FB645FA movzbl -6(%ebp), %eax +29C2 subl %eax, %edx +89D0 movl %edx, %eax +C9 leave +C3 ret +55 pushl %ebp +89E5 movl %esp, %ebp +53 pushl %ebx +83EC34 subl $52, %esp +66C745F4 movw $0, -12(%ebp) +C745EC01 movl $1, -20(%ebp) +E9BE0000 jmp L6 +C745E801 movl $1, -24(%ebp) +66837DF4 cmpw $0, -12(%ebp) +780F js L7 +8B55E8 movl -24(%ebp), %edx +0FBF45F4 movswl -12(%ebp), %eax +89C1 movl %eax, %ecx +D3E2 sall %cl, %edx +89D0 movl %edx, %eax +EB0F jmp L8 +8B55E8 movl -24(%ebp), %edx +0FBF45F4 movswl -12(%ebp), %eax +F7D8 negl %eax +89C1 movl %eax, %ecx +D3EA shrl %cl, %edx +89D0 movl %edx, %eax +8945E8 movl %eax, -24(%ebp) +8B45E8 movl -24(%ebp), %eax +3B45EC cmpl -20(%ebp), %eax +740C je L9 +C7042410 movl $16, (%esp) +E8000000 call _Platform_AssertFail +C745E801 movl $1, -24(%ebp) +66837DF4 cmpw $0, -12(%ebp) +7827 js L10 +8B55E8 movl -24(%ebp), %edx +0FBF45F4 movswl -12(%ebp), %eax +89D3 movl %edx, %ebx +89C1 movl %eax, %ecx +D3E3 sall %cl, %ebx +8B55E8 movl -24(%ebp), %edx +0FBF45F4 movswl -12(%ebp), %eax +B9200000 movl $32, %ecx +29C1 subl %eax, %ecx +89C8 movl %ecx, %eax +89C1 movl %eax, %ecx +D3EA shrl %cl, %edx +89D0 movl %edx, %eax +09D8 orl %ebx, %eax +EB21 jmp L11 +8B55E8 movl -24(%ebp), %edx +0FBF45F4 movswl -12(%ebp), %eax +F7D8 negl %eax +89D3 movl %edx, %ebx +89C1 movl %eax, %ecx +D3EB shrl %cl, %ebx +8B55E8 movl -24(%ebp), %edx +0FBF45F4 movswl -12(%ebp), %eax +83C020 addl $32, %eax +89C1 movl %eax, %ecx +D3E2 sall %cl, %edx +89D0 movl %edx, %eax +09D8 orl %ebx, %eax +8945E8 movl %eax, -24(%ebp) +8B45E8 movl -24(%ebp), %eax +3B45EC cmpl -20(%ebp), %eax +740C je L12 +C7042411 movl $17, (%esp) +E8000000 call _Platform_AssertFail +D165EC sall -20(%ebp) +0FB745F4 movzwl -12(%ebp), %eax +83C001 addl $1, %eax +668945F4 movw %ax, -12(%ebp) +66837DF4 cmpw $31, -12(%ebp) +0F8E37FF jle L13 +66C745F4 movw $0, -12(%ebp) +66C745F2 movw $1, -14(%ebp) +E9E50000 jmp L14 +66C745E6 movw $1, -26(%ebp) +66837DF4 cmpw $0, -12(%ebp) +7813 js L15 +0FB745E6 movzwl -26(%ebp), %eax +0FB7D0 movzwl %ax, %edx +0FBF45F4 movswl -12(%ebp), %eax +89C1 movl %eax, %ecx +D3E2 sall %cl, %edx +89D0 movl %edx, %eax +EB13 jmp L16 +0FB745E6 movzwl -26(%ebp), %eax +0FB7D0 movzwl %ax, %edx +0FBF45F4 movswl -12(%ebp), %eax +F7D8 negl %eax +89C1 movl %eax, %ecx +D3FA sarl %cl, %edx +89D0 movl %edx, %eax +668945E6 movw %ax, -26(%ebp) +0FB745E6 movzwl -26(%ebp), %eax +663B45F2 cmpw -14(%ebp), %ax +740C je L17 +C7042417 movl $23, (%esp) +E8000000 call _Platform_AssertFail +66C745E6 movw $1, -26(%ebp) +66837DF4 cmpw $0, -12(%ebp) +7831 js L18 +0FB745E6 movzwl -26(%ebp), %eax +0FB7D0 movzwl %ax, %edx +0FBF45F4 movswl -12(%ebp), %eax +89C1 movl %eax, %ecx +D3E2 sall %cl, %edx +89D0 movl %edx, %eax +89C3 movl %eax, %ebx +0FB745E6 movzwl -26(%ebp), %eax +0FB7D0 movzwl %ax, %edx +0FBF45F4 movswl -12(%ebp), %eax +B9100000 movl $16, %ecx +29C1 subl %eax, %ecx +89C8 movl %ecx, %eax +89C1 movl %eax, %ecx +D3FA sarl %cl, %edx +89D0 movl %edx, %eax +09D8 orl %ebx, %eax +EB2B jmp L19 +0FB745E6 movzwl -26(%ebp), %eax +0FB7D0 movzwl %ax, %edx +0FBF45F4 movswl -12(%ebp), %eax +F7D8 negl %eax +89C1 movl %eax, %ecx +D3FA sarl %cl, %edx +89D0 movl %edx, %eax +89C3 movl %eax, %ebx +0FB745E6 movzwl -26(%ebp), %eax +0FB7D0 movzwl %ax, %edx +0FBF45F4 movswl -12(%ebp), %eax +83C010 addl $16, %eax +89C1 movl %eax, %ecx +D3E2 sall %cl, %edx +89D0 movl %edx, %eax +09D8 orl %ebx, %eax +668945E6 movw %ax, -26(%ebp) +0FB745E6 movzwl -26(%ebp), %eax +663B45F2 cmpw -14(%ebp), %ax +740C je L20 +C7042418 movl $24, (%esp) +E8000000 call _Platform_AssertFail +0FBF45F2 movswl -14(%ebp), %eax +01C0 addl %eax, %eax +668945F2 movw %ax, -14(%ebp) +0FB745F4 movzwl -12(%ebp), %eax +83C001 addl $1, %eax +668945F4 movw %ax, -12(%ebp) +66837DF4 cmpw $15, -12(%ebp) +0F8E10FF jle L21 +66C745F4 movw $0, -12(%ebp) +C645F701 movb $1, -9(%ebp) +E9DC0000 jmp L22 +C645E501 movb $1, -27(%ebp) +66837DF4 cmpw $0, -12(%ebp) +7813 js L23 +0FB645E5 movzbl -27(%ebp), %eax +0FB6D0 movzbl %al, %edx +0FBF45F4 movswl -12(%ebp), %eax +89C1 movl %eax, %ecx +D3E2 sall %cl, %edx +89D0 movl %edx, %eax +EB13 jmp L24 +0FB645E5 movzbl -27(%ebp), %eax +0FB6D0 movzbl %al, %edx +0FBF45F4 movswl -12(%ebp), %eax +F7D8 negl %eax +89C1 movl %eax, %ecx +D3FA sarl %cl, %edx +89D0 movl %edx, %eax +8845E5 movb %al, -27(%ebp) +0FB645E5 movzbl -27(%ebp), %eax +3A45F7 cmpb -9(%ebp), %al +740C je L25 +C704241E movl $30, (%esp) +E8000000 call _Platform_AssertFail +C645E501 movb $1, -27(%ebp) +66837DF4 cmpw $0, -12(%ebp) +7831 js L26 +0FB645E5 movzbl -27(%ebp), %eax +0FB6D0 movzbl %al, %edx +0FBF45F4 movswl -12(%ebp), %eax +89C1 movl %eax, %ecx +D3E2 sall %cl, %edx +89D0 movl %edx, %eax +89C3 movl %eax, %ebx +0FB645E5 movzbl -27(%ebp), %eax +0FB6D0 movzbl %al, %edx +0FBF45F4 movswl -12(%ebp), %eax +B9080000 movl $8, %ecx +29C1 subl %eax, %ecx +89C8 movl %ecx, %eax +89C1 movl %eax, %ecx +D3FA sarl %cl, %edx +89D0 movl %edx, %eax +09D8 orl %ebx, %eax +EB2B jmp L27 +0FB645E5 movzbl -27(%ebp), %eax +0FB6D0 movzbl %al, %edx +0FBF45F4 movswl -12(%ebp), %eax +F7D8 negl %eax +89C1 movl %eax, %ecx +D3FA sarl %cl, %edx +89D0 movl %edx, %eax +89C3 movl %eax, %ebx +0FB645E5 movzbl -27(%ebp), %eax +0FB6D0 movzbl %al, %edx +0FBF45F4 movswl -12(%ebp), %eax +83C008 addl $8, %eax +89C1 movl %eax, %ecx +D3E2 sall %cl, %edx +89D0 movl %edx, %eax +09D8 orl %ebx, %eax +8845E5 movb %al, -27(%ebp) +0FB645E5 movzbl -27(%ebp), %eax +3A45F7 cmpb -9(%ebp), %al +740C je L28 +C704241F movl $31, (%esp) +E8000000 call _Platform_AssertFail +0FBE45F7 movsbl -9(%ebp), %eax +01C0 addl %eax, %eax +8845F7 movb %al, -9(%ebp) +0FB745F4 movzwl -12(%ebp), %eax +83C001 addl $1, %eax +668945F4 movw %ax, -12(%ebp) +66837DF4 cmpw $7, -12(%ebp) +0F8E19FF jle L29 +66C745F4 movw $-1, -12(%ebp) +C745EC01 movl $1, -20(%ebp) +8B45EC movl -20(%ebp), %eax +C1E01E sall $30, %eax +8945EC movl %eax, -20(%ebp) +8B45EC movl -20(%ebp), %eax +01C0 addl %eax, %eax +8945E0 movl %eax, -32(%ebp) +E9BC0000 jmp L30 +8B45E0 movl -32(%ebp), %eax +8945E8 movl %eax, -24(%ebp) +66837DF4 cmpw $0, -12(%ebp) +780F js L31 +8B55E8 movl -24(%ebp), %edx +0FBF45F4 movswl -12(%ebp), %eax +89C1 movl %eax, %ecx +D3E2 sall %cl, %edx +89D0 movl %edx, %eax +EB0F jmp L32 +8B55E8 movl -24(%ebp), %edx +0FBF45F4 movswl -12(%ebp), %eax +F7D8 negl %eax +89C1 movl %eax, %ecx +D3EA shrl %cl, %edx +89D0 movl %edx, %eax +8945E8 movl %eax, -24(%ebp) +8B45E8 movl -24(%ebp), %eax +3B45EC cmpl -20(%ebp), %eax +740C je L33 +C7042427 movl $39, (%esp) +E8000000 call _Platform_AssertFail +8B45E0 movl -32(%ebp), %eax +8945E8 movl %eax, -24(%ebp) +66837DF4 cmpw $0, -12(%ebp) +7827 js L34 +8B55E8 movl -24(%ebp), %edx +0FBF45F4 movswl -12(%ebp), %eax +89D3 movl %edx, %ebx +89C1 movl %eax, %ecx +D3E3 sall %cl, %ebx +8B55E8 movl -24(%ebp), %edx +0FBF45F4 movswl -12(%ebp), %eax +B9200000 movl $32, %ecx +29C1 subl %eax, %ecx +89C8 movl %ecx, %eax +89C1 movl %eax, %ecx +D3EA shrl %cl, %edx +89D0 movl %edx, %eax +09D8 orl %ebx, %eax +EB21 jmp L35 +8B55E8 movl -24(%ebp), %edx +0FBF45F4 movswl -12(%ebp), %eax +F7D8 negl %eax +89D3 movl %edx, %ebx +89C1 movl %eax, %ecx +D3EB shrl %cl, %ebx +8B55E8 movl -24(%ebp), %edx +0FBF45F4 movswl -12(%ebp), %eax +83C020 addl $32, %eax +89C1 movl %eax, %ecx +D3E2 sall %cl, %edx +89D0 movl %edx, %eax +09D8 orl %ebx, %eax +8945E8 movl %eax, -24(%ebp) +8B45E8 movl -24(%ebp), %eax +3B45EC cmpl -20(%ebp), %eax +740C je L36 +C7042428 movl $40, (%esp) +E8000000 call _Platform_AssertFail +D17DEC sarl -20(%ebp) +0FB745F4 movzwl -12(%ebp), %eax +83E801 subl $1, %eax +668945F4 movw %ax, -12(%ebp) +66837DF4 cmpw $-31, -12(%ebp) +0F8D39FF jge L37 +66C745F4 movw $-1, -12(%ebp) +66C745F2 movw $1, -14(%ebp) +0FB745F2 movzwl -14(%ebp), %eax +0FB7C0 movzwl %ax, %eax +C1E00E sall $14, %eax +668945F2 movw %ax, -14(%ebp) +0FBF45F2 movswl -14(%ebp), %eax +01C0 addl %eax, %eax +668945DE movw %ax, -34(%ebp) +E9E30000 jmp L38 +0FB745DE movzwl -34(%ebp), %eax +668945E6 movw %ax, -26(%ebp) +66837DF4 cmpw $0, -12(%ebp) +7813 js L39 +0FB745E6 movzwl -26(%ebp), %eax +0FB7D0 movzwl %ax, %edx +0FBF45F4 movswl -12(%ebp), %eax +89C1 movl %eax, %ecx +D3E2 sall %cl, %edx +89D0 movl %edx, %eax +EB13 jmp L40 +0FB745E6 movzwl -26(%ebp), %eax +0FB7D0 movzwl %ax, %edx +0FBF45F4 movswl -12(%ebp), %eax +F7D8 negl %eax +89C1 movl %eax, %ecx +D3FA sarl %cl, %edx +89D0 movl %edx, %eax +668945E6 movw %ax, -26(%ebp) +0FB745E6 movzwl -26(%ebp), %eax +663B45F2 cmpw -14(%ebp), %ax +740C je L41 +C704242E movl $46, (%esp) +E8000000 call _Platform_AssertFail +0FB745DE movzwl -34(%ebp), %eax +668945E6 movw %ax, -26(%ebp) +66837DF4 cmpw $0, -12(%ebp) +7831 js L42 +0FB745E6 movzwl -26(%ebp), %eax +0FB7D0 movzwl %ax, %edx +0FBF45F4 movswl -12(%ebp), %eax +89C1 movl %eax, %ecx +D3E2 sall %cl, %edx +89D0 movl %edx, %eax +89C3 movl %eax, %ebx +0FB745E6 movzwl -26(%ebp), %eax +0FB7D0 movzwl %ax, %edx +0FBF45F4 movswl -12(%ebp), %eax +B9100000 movl $16, %ecx +29C1 subl %eax, %ecx +89C8 movl %ecx, %eax +89C1 movl %eax, %ecx +D3FA sarl %cl, %edx +89D0 movl %edx, %eax +09D8 orl %ebx, %eax +EB2B jmp L43 +0FB745E6 movzwl -26(%ebp), %eax +0FB7D0 movzwl %ax, %edx +0FBF45F4 movswl -12(%ebp), %eax +F7D8 negl %eax +89C1 movl %eax, %ecx +D3FA sarl %cl, %edx +89D0 movl %edx, %eax +89C3 movl %eax, %ebx +0FB745E6 movzwl -26(%ebp), %eax +0FB7D0 movzwl %ax, %edx +0FBF45F4 movswl -12(%ebp), %eax +83C010 addl $16, %eax +89C1 movl %eax, %ecx +D3E2 sall %cl, %edx +89D0 movl %edx, %eax +09D8 orl %ebx, %eax +668945E6 movw %ax, -26(%ebp) +0FB745E6 movzwl -26(%ebp), %eax +663B45F2 cmpw -14(%ebp), %ax +740C je L44 +C704242F movl $47, (%esp) +E8000000 call _Platform_AssertFail +66D17DF2 sarw -14(%ebp) +0FB745F4 movzwl -12(%ebp), %eax +83E801 subl $1, %eax +668945F4 movw %ax, -12(%ebp) +66837DF4 cmpw $-15, -12(%ebp) +0F8D12FF jge L45 +66C745F4 movw $-1, -12(%ebp) +C645F701 movb $1, -9(%ebp) +0FB645F7 movzbl -9(%ebp), %eax +0FB6C0 movzbl %al, %eax +C1E006 sall $6, %eax +8845F7 movb %al, -9(%ebp) +0FBE45F7 movsbl -9(%ebp), %eax +01C0 addl %eax, %eax +8845DD movb %al, -35(%ebp) +E9DC0000 jmp L46 +0FB645DD movzbl -35(%ebp), %eax +8845E5 movb %al, -27(%ebp) +66837DF4 cmpw $0, -12(%ebp) +7813 js L47 +0FB645E5 movzbl -27(%ebp), %eax +0FB6D0 movzbl %al, %edx +0FBF45F4 movswl -12(%ebp), %eax +89C1 movl %eax, %ecx +D3E2 sall %cl, %edx +89D0 movl %edx, %eax +EB13 jmp L48 +0FB645E5 movzbl -27(%ebp), %eax +0FB6D0 movzbl %al, %edx +0FBF45F4 movswl -12(%ebp), %eax +F7D8 negl %eax +89C1 movl %eax, %ecx +D3FA sarl %cl, %edx +89D0 movl %edx, %eax +8845E5 movb %al, -27(%ebp) +0FB645E5 movzbl -27(%ebp), %eax +3A45F7 cmpb -9(%ebp), %al +740C je L49 +C7042435 movl $53, (%esp) +E8000000 call _Platform_AssertFail +0FB645DD movzbl -35(%ebp), %eax +8845E5 movb %al, -27(%ebp) +66837DF4 cmpw $0, -12(%ebp) +7831 js L50 +0FB645E5 movzbl -27(%ebp), %eax +0FB6D0 movzbl %al, %edx +0FBF45F4 movswl -12(%ebp), %eax +89C1 movl %eax, %ecx +D3E2 sall %cl, %edx +89D0 movl %edx, %eax +89C3 movl %eax, %ebx +0FB645E5 movzbl -27(%ebp), %eax +0FB6D0 movzbl %al, %edx +0FBF45F4 movswl -12(%ebp), %eax +B9080000 movl $8, %ecx +29C1 subl %eax, %ecx +89C8 movl %ecx, %eax +89C1 movl %eax, %ecx +D3FA sarl %cl, %edx +89D0 movl %edx, %eax +09D8 orl %ebx, %eax +EB2B jmp L51 +0FB645E5 movzbl -27(%ebp), %eax +0FB6D0 movzbl %al, %edx +0FBF45F4 movswl -12(%ebp), %eax +F7D8 negl %eax +89C1 movl %eax, %ecx +D3FA sarl %cl, %edx +89D0 movl %edx, %eax +89C3 movl %eax, %ebx +0FB645E5 movzbl -27(%ebp), %eax +0FB6D0 movzbl %al, %edx +0FBF45F4 movswl -12(%ebp), %eax +83C008 addl $8, %eax +89C1 movl %eax, %ecx +D3E2 sall %cl, %edx +89D0 movl %edx, %eax +09D8 orl %ebx, %eax +8845E5 movb %al, -27(%ebp) diff --git a/src/test/confidence/lola/old.s b/src/test/confidence/lola/old.s new file mode 100644 index 00000000..bd2a8780 --- /dev/null +++ b/src/test/confidence/lola/old.s @@ -0,0 +1,105 @@ +55 pushl %ebp +89E5 movl %esp, %ebp +83EC10 subl $16, %esp +C745FC00 movl $0, -4(%ebp) +8B55FC movl -4(%ebp), %edx +8B4508 movl 8(%ebp), %eax +01D0 addl %edx, %eax +0FB600 movzbl (%eax), %eax +8845FB movb %al, -5(%ebp) +8B55FC movl -4(%ebp), %edx +8B450C movl 12(%ebp), %eax +01D0 addl %edx, %eax +0FB600 movzbl (%eax), %eax +8845FA movb %al, -6(%ebp) +8345FC01 addl $1, -4(%ebp) +807DFB00 cmpb $0, -5(%ebp) +7508 jne L2 +0FB645FA movzbl -6(%ebp), %eax +F7D8 negl %eax +EB15 jmp L3 +0FB645FB movzbl -5(%ebp), %eax +3A45FA cmpb -6(%ebp), %al +74C9 je L4 +0FB655FB movzbl -5(%ebp), %edx +0FB645FA movzbl -6(%ebp), %eax +29C2 subl %eax, %edx +89D0 movl %edx, %eax +C9 leave +C3 ret +4C6F6C61 .ascii "Lola\0" +000000 .align 4 +4C6F6C61 .ascii "Lola - compile lola source to verilog source.\0" +202D2063 +6F6D7069 +6C65206C +6F6C6120 +75736167 .ascii "usage:\0" +000000 .align 4 +20206C6F .ascii " lola lola-source-file verilog-source-file\0" +6C61206C +6F6C612D +736F7572 +63652D66 +55 pushl %ebp +89E5 movl %esp, %ebp +83E4F0 andl $-16, %esp +83EC10 subl $16, %esp +E8000000 call ___main +8D550C leal 12(%ebp), %edx +8B4508 movl 8(%ebp), %eax +98 cwtl +89542404 movl %edx, 4(%esp) +890424 movl %eax, (%esp) +E8000000 call _Platform_Init +E8000000 call _Console__init +890424 movl %eax, (%esp) +E8000000 call _Heap_INCREF +E8000000 call _LSB__init +890424 movl %eax, (%esp) +E8000000 call _Heap_INCREF +E8000000 call _LSC__init +890424 movl %eax, (%esp) +E8000000 call _Heap_INCREF +E8000000 call _LSV__init +890424 movl %eax, (%esp) +E8000000 call _Heap_INCREF +E8000000 call _Platform__init +890424 movl %eax, (%esp) +E8000000 call _Heap_INCREF +C7442404 movl $0, 4(%esp) +00000000 +C7042400 movl $LC0, (%esp) +E8000000 call _Heap_REGMOD +A3000000 movl %eax, _m.2287 +0FB70500 movzwl _Platform_ArgCount, %eax +6683F802 cmpw $2, %ax +7F5C jg L6 +C7442404 movl $46, 4(%esp) +2E000000 +C7042408 movl $LC1, (%esp) +E8000000 call _Console_String +E8000000 call _Console_Ln +E8000000 call _Console_Ln +C7442404 movl $7, 4(%esp) +07000000 +C7042436 movl $LC2, (%esp) +E8000000 call _Console_String +E8000000 call _Console_Ln +E8000000 call _Console_Ln +C7442404 movl $44, 4(%esp) +2C000000 +C7042440 movl $LC3, (%esp) +E8000000 call _Console_String +E8000000 call _Console_Ln +E8000000 call _Console_Ln +EB15 jmp L7 +E8000000 call _LSC_Compile +0FB60500 movzbl _LSB_modname, %eax +84C0 testb %al, %al +7405 je L7 +E8000000 call _LSV_List +E8000000 call _Heap_FINALL +B8000000 movl $0, %eax +C9 leave +C3 ret diff --git a/src/test/confidence/signal/old.s b/src/test/confidence/signal/old.s new file mode 100644 index 00000000..6d7de14d --- /dev/null +++ b/src/test/confidence/signal/old.s @@ -0,0 +1,400 @@ +55 pushl %ebp +89E5 movl %esp, %ebp +83EC10 subl $16, %esp +C745FC00 movl $0, -4(%ebp) +8B55FC movl -4(%ebp), %edx +8B4508 movl 8(%ebp), %eax +01D0 addl %edx, %eax +0FB600 movzbl (%eax), %eax +8845FB movb %al, -5(%ebp) +8B55FC movl -4(%ebp), %edx +8B450C movl 12(%ebp), %eax +01D0 addl %edx, %eax +0FB600 movzbl (%eax), %eax +8845FA movb %al, -6(%ebp) +8345FC01 addl $1, -4(%ebp) +807DFB00 cmpb $0, -5(%ebp) +7508 jne L2 +0FB645FA movzbl -6(%ebp), %eax +F7D8 negl %eax +EB15 jmp L3 +0FB645FB movzbl -5(%ebp), %eax +3A45FA cmpb -6(%ebp), %al +74C9 je L4 +0FB655FB movzbl -5(%ebp), %edx +0FB645FA movzbl -6(%ebp), %eax +29C2 subl %eax, %edx +89D0 movl %edx, %eax +C9 leave +C3 ret +55 pushl %ebp +89E5 movl %esp, %ebp +53 pushl %ebx +83EC24 subl $36, %esp +8B5D0C movl 12(%ebp), %ebx +8B450C movl 12(%ebp), %eax +890424 movl %eax, (%esp) +E8000000 call _Platform_OSAllocate +89C2 movl %eax, %edx +895C2408 movl %ebx, 8(%esp) +8B4508 movl 8(%ebp), %eax +89442404 movl %eax, 4(%esp) +891424 movl %edx, (%esp) +E8000000 call _memcpy +894508 movl %eax, 8(%ebp) +66C745F6 movw $0, -10(%ebp) +EB51 jmp L6 +0FBF55F6 movswl -10(%ebp), %edx +8B450C movl 12(%ebp), %eax +39C2 cmpl %eax, %edx +7306 jnb L7 +0FBF45F6 movswl -10(%ebp), %eax +EB11 jmp L8 +C70424FE movl $-2, (%esp) +E8000000 call _Platform_Halt +B8000000 movl $0, %eax +8B5508 movl 8(%ebp), %edx +01D0 addl %edx, %eax +0FB600 movzbl (%eax), %eax +0FB6D0 movzbl %al, %edx +A1000000 movl _Files_Rider__typ, %eax +89542408 movl %edx, 8(%esp) +89442404 movl %eax, 4(%esp) +C7042404 movl $_SignalTest_rider, (%esp) +E8000000 call _Files_Write +0FB745F6 movzwl -10(%ebp), %eax +83C001 addl $1, %eax +668945F6 movw %ax, -10(%ebp) +0FBF45F6 movswl -10(%ebp), %eax +3B450C cmpl 12(%ebp), %eax +7D32 jge L9 +0FBF55F6 movswl -10(%ebp), %edx +8B450C movl 12(%ebp), %eax +39C2 cmpl %eax, %edx +7306 jnb L10 +0FBF45F6 movswl -10(%ebp), %eax +EB11 jmp L11 +C70424FE movl $-2, (%esp) +E8000000 call _Platform_Halt +B8000000 movl $0, %eax +8B5508 movl 8(%ebp), %edx +01D0 addl %edx, %eax +0FB600 movzbl (%eax), %eax +84C0 testb %al, %al +0F8574FF jne L12 +8B4508 movl 8(%ebp), %eax +890424 movl %eax, (%esp) +E8000000 call _Platform_OSFree +90 nop +83C424 addl $36, %esp +5B popl %ebx +5D popl %ebp +C3 ret +55 pushl %ebp +89E5 movl %esp, %ebp +83EC18 subl $24, %esp +A1000000 movl _Files_Rider__typ, %eax +C7442408 movl $10, 8(%esp) +0A000000 +89442404 movl %eax, 4(%esp) +C7042404 movl $_SignalTest_rider, (%esp) +E8000000 call _Files_Write +90 nop +C9 leave +C3 ret +55 pushl %ebp +89E5 movl %esp, %ebp +53 pushl %ebx +83EC34 subl $52, %esp +66C745F6 movw $0, -10(%ebp) +837D0800 cmpl $0, 8(%ebp) +790F jns L15 +C645D82D movb $45, -40(%ebp) +0FB745F6 movzwl -10(%ebp), %eax +83C001 addl $1, %eax +668945F6 movw %ax, -10(%ebp) +0FB745F6 movzwl -10(%ebp), %eax +6683F81D cmpw $29, %ax +7706 ja L16 +0FBF5DF6 movswl -10(%ebp), %ebx +EB11 jmp L17 +C70424FE movl $-2, (%esp) +E8000000 call _Platform_Halt +BB000000 movl $0, %ebx +837D0800 cmpl $0, 8(%ebp) +782A js L18 +8B4D08 movl 8(%ebp), %ecx +BA676666 movl $1717986919, %edx +89C8 movl %ecx, %eax +F7EA imull %edx +C1FA02 sarl $2, %edx +89C8 movl %ecx, %eax +C1F81F sarl $31, %eax +29C2 subl %eax, %edx +89D0 movl %edx, %eax +C1E002 sall $2, %eax +01D0 addl %edx, %eax +01C0 addl %eax, %eax +29C1 subl %eax, %ecx +89CA movl %ecx, %edx +89D0 movl %edx, %eax +83C030 addl $48, %eax +EB16 jmp L19 +8B4508 movl 8(%ebp), %eax +C7442404 movl $10, 4(%esp) +0A000000 +890424 movl %eax, (%esp) +E8000000 call _SYSTEM_MOD +83C030 addl $48, %eax +88441DD8 movb %al, -40(%ebp,%ebx) +0FB745F6 movzwl -10(%ebp), %eax +83C001 addl $1, %eax +668945F6 movw %ax, -10(%ebp) +837D0800 cmpl $0, 8(%ebp) +781A js L20 +8B4D08 movl 8(%ebp), %ecx +BA676666 movl $1717986919, %edx +89C8 movl %ecx, %eax +F7EA imull %edx +C1FA02 sarl $2, %edx +89C8 movl %ecx, %eax +C1F81F sarl $31, %eax +29C2 subl %eax, %edx +89D0 movl %edx, %eax +EB21 jmp L21 +B8090000 movl $9, %eax +2B4508 subl 8(%ebp), %eax +89C1 movl %eax, %ecx +BA676666 movl $1717986919, %edx +89C8 movl %ecx, %eax +F7EA imull %edx +C1FA02 sarl $2, %edx +89C8 movl %ecx, %eax +C1F81F sarl $31, %eax +29C2 subl %eax, %edx +89D0 movl %edx, %eax +F7D8 negl %eax +894508 movl %eax, 8(%ebp) +E9BA0000 jmp L22 +0FB745F6 movzwl -10(%ebp), %eax +6683F81D cmpw $29, %ax +7706 ja L23 +0FBF5DF6 movswl -10(%ebp), %ebx +EB11 jmp L24 +C70424FE movl $-2, (%esp) +E8000000 call _Platform_Halt +BB000000 movl $0, %ebx +837D0800 cmpl $0, 8(%ebp) +782A js L25 +8B4D08 movl 8(%ebp), %ecx +BA676666 movl $1717986919, %edx +89C8 movl %ecx, %eax +F7EA imull %edx +C1FA02 sarl $2, %edx +89C8 movl %ecx, %eax +C1F81F sarl $31, %eax +29C2 subl %eax, %edx +89D0 movl %edx, %eax +C1E002 sall $2, %eax +01D0 addl %edx, %eax +01C0 addl %eax, %eax +29C1 subl %eax, %ecx +89CA movl %ecx, %edx +89D0 movl %edx, %eax +83C030 addl $48, %eax +EB16 jmp L26 +8B4508 movl 8(%ebp), %eax +C7442404 movl $10, 4(%esp) +0A000000 +890424 movl %eax, (%esp) +E8000000 call _SYSTEM_MOD +83C030 addl $48, %eax +88441DD8 movb %al, -40(%ebp,%ebx) +0FB745F6 movzwl -10(%ebp), %eax +83C001 addl $1, %eax +668945F6 movw %ax, -10(%ebp) +837D0800 cmpl $0, 8(%ebp) +781A js L27 +8B4D08 movl 8(%ebp), %ecx +BA676666 movl $1717986919, %edx +89C8 movl %ecx, %eax +F7EA imull %edx +C1FA02 sarl $2, %edx +89C8 movl %ecx, %eax +C1F81F sarl $31, %eax +29C2 subl %eax, %edx +89D0 movl %edx, %eax +EB21 jmp L28 +B8090000 movl $9, %eax +2B4508 subl 8(%ebp), %eax +89C1 movl %eax, %ecx +BA676666 movl $1717986919, %edx +89C8 movl %ecx, %eax +F7EA imull %edx +C1FA02 sarl $2, %edx +89C8 movl %ecx, %eax +C1F81F sarl $31, %eax +29C2 subl %eax, %edx +89D0 movl %edx, %eax +F7D8 negl %eax +894508 movl %eax, 8(%ebp) +837D0800 cmpl $0, 8(%ebp) +0F8F3CFF jg L29 +EB4D jmp L30 +0FB745F6 movzwl -10(%ebp), %eax +83E801 subl $1, %eax +668945F6 movw %ax, -10(%ebp) +0FB745F6 movzwl -10(%ebp), %eax +6683F81D cmpw $29, %ax +7706 ja L31 +0FBF45F6 movswl -10(%ebp), %eax +EB11 jmp L32 +C70424FE movl $-2, (%esp) +E8000000 call _Platform_Halt +B8000000 movl $0, %eax +0FB64405 movzbl -40(%ebp,%eax), %eax +0FB6D0 movzbl %al, %edx +A1000000 movl _Files_Rider__typ, %eax +89542408 movl %edx, 8(%esp) +89442404 movl %eax, 4(%esp) +C7042404 movl $_SignalTest_rider, (%esp) +E8000000 call _Files_Write +66837DF6 cmpw $0, -10(%ebp) +7FAC jg L33 +90 nop +83C434 addl $52, %esp +5B popl %ebx +5D popl %ebp +C3 ret +5369676E .ascii "Signal: \0" +616C3A20 +5369676E .ascii "Signal \0" +616C2000 +55 pushl %ebp +89E5 movl %esp, %ebp +83EC28 subl $40, %esp +8B4508 movl 8(%ebp), %eax +668945F4 movw %ax, -12(%ebp) +E8000000 call _Console_Ln +C7442404 movl $9, 4(%esp) +09000000 +C7042400 movl $LC0, (%esp) +E8000000 call _Console_String +0FBF45F4 movswl -12(%ebp), %eax +C7442404 movl $1, 4(%esp) +01000000 +890424 movl %eax, (%esp) +E8000000 call _Console_Int +E8000000 call _Console_Ln +C7442404 movl $8, 4(%esp) +08000000 +C7042409 movl $LC1, (%esp) +E8B2FCFF call _SignalTest_ws +0FBF45F4 movswl -12(%ebp), %eax +890424 movl %eax, (%esp) +E89FFDFF call _SignalTest_wi +E874FDFF call _SignalTest_wl +90 nop +C9 leave +C3 ret +55 pushl %ebp +89E5 movl %esp, %ebp +83EC28 subl $40, %esp +8B4508 movl 8(%ebp), %eax +668945F4 movw %ax, -12(%ebp) +EB30 jmp L36 +0FBF45F4 movswl -12(%ebp), %eax +C7442404 movl $2, 4(%esp) +02000000 +890424 movl %eax, (%esp) +E8000000 call _Console_Int +E8000000 call _Console_Flush +C70424E8 movl $1000, (%esp) +E8000000 call _Platform_Delay +0FB745F4 movzwl -12(%ebp), %eax +83E801 subl $1, %eax +668945F4 movw %ax, -12(%ebp) +66837DF4 cmpw $0, -12(%ebp) +7FC9 jg L37 +E8000000 call _Console_Ln +90 nop +C9 leave +C3 ret +55 pushl %ebp +89E5 movl %esp, %ebp +83EC28 subl $40, %esp +A1000000 movl _SignalTest_result, %eax +890424 movl %eax, (%esp) +8B4508 movl 8(%ebp), %eax +FFD0 call *%eax +A1000000 movl _Files_Rider__typ, %eax +8B5508 movl 8(%ebp), %edx +89542410 movl %edx, 16(%esp) +C744240C movl $1, 12(%esp) +01000000 +C7442408 movl $20, 8(%esp) +14000000 +89442404 movl %eax, 4(%esp) +C7042404 movl $_SignalTest_rider, (%esp) +E8000000 call _SYSTEM_ENUMR +90 nop +C9 leave +C3 ret +5369676E .ascii "SignalTest\0" +616C5465 +72657375 .ascii "result\0" +00 .text +55 pushl %ebp +89E5 movl %esp, %ebp +83E4F0 andl $-16, %esp +83EC10 subl $16, %esp +E8000000 call ___main +8D550C leal 12(%ebp), %edx +8B4508 movl 8(%ebp), %eax +98 cwtl +89542404 movl %edx, 4(%esp) +890424 movl %eax, (%esp) +E8000000 call _Platform_Init +E8000000 call _Console__init +890424 movl %eax, (%esp) +E8000000 call _Heap_INCREF +E8000000 call _Files__init +890424 movl %eax, (%esp) +E8000000 call _Heap_INCREF +E8000000 call _Platform__init +890424 movl %eax, (%esp) +E8000000 call _Heap_INCREF +C7442404 movl $_EnumPtrs, 4(%esp) +02040000 +C7042411 movl $LC2, (%esp) +E8000000 call _Heap_REGMOD +A3180000 movl %eax, _m.2428 +C7442404 movl $7, 4(%esp) +07000000 +C704241C movl $LC3, (%esp) +E8000000 call _Files_New +A3000000 movl %eax, _SignalTest_result +8B150000 movl _SignalTest_result, %edx +A1000000 movl _Files_Rider__typ, %eax +C744240C movl $0, 12(%esp) +00000000 +89542408 movl %edx, 8(%esp) +89442404 movl %eax, 4(%esp) +C7042404 movl $_SignalTest_rider, (%esp) +E8000000 call _Files_Set +0FB70500 movzwl _Platform_ArgCount, %eax +6683F801 cmpw $1, %ax +7E18 jle L40 +C704244D movl $_SignalTest_handle, (%esp) +E8000000 call _Platform_SetInterruptHandler +C704244D movl $_SignalTest_handle, (%esp) +E8000000 call _Platform_SetQuitHandler +C7042404 movl $4, (%esp) +E89EFEFF call _SignalTest_Take5 +A1000000 movl _SignalTest_result, %eax +890424 movl %eax, (%esp) +E8000000 call _Files_Register +E8000000 call _Heap_FINALL +B8000000 movl $0, %eax +C9 leave +C3 ret diff --git a/src/test/confidence/testenv.sh b/src/test/confidence/testenv.sh index bd6ff5b0..cf5a5ac9 100755 --- a/src/test/confidence/testenv.sh +++ b/src/test/confidence/testenv.sh @@ -1,6 +1,9 @@ #!/bin/sh ## '.' this file from individual test.sh files. #set -e + +echo --- Confidence test $(basename $PWD) --- + if which cygpath >/dev/null then export PATH="$(cygpath "$1")/bin":$PATH else export PATH="$1/bin":$PATH @@ -9,3 +12,13 @@ fi export DYLD_LIBRARY_PATH=$1/lib:$DYLD_LIBRARY_PATH export LD_LIBRARY_PATH=$1/lib:$LD_LIBRARY_PATH rm -f *.o *.obj *.exe *.sym *.c *.h result + +# Under gcc generate assembly source for source change test. +# NOTE: The following CFLAGS causes the assembler to write source +# to a single file. When there are multiple Mod files, each +# corresponding assembly file will overwrite the previous. I +# cannot see any way to overcome this short of using -S +# on the voc command and calling 'as' explicitly. +if [ $COMPILER=gcc ] +then export CFLAGS="-gstabs -g1 -Wa,-acdhln=new.asm" +fi diff --git a/src/test/confidence/testresult.sh b/src/test/confidence/testresult.sh index 9234ab82..d873e263 100755 --- a/src/test/confidence/testresult.sh +++ b/src/test/confidence/testresult.sh @@ -4,3 +4,12 @@ if diff -b expected result then printf "PASSED: $PWD\n\n" else printf "FAILED: $PWD\n\n"; exit 1 fi + +# Compare generated code +if [ -f old.s -a -f new.asm ] +then + egrep '^[0-9 ]{4} ([0-9a-f]{4}| ) [0-9A-F]{2}[0-9A-F ]{6}' new.asm|cut -c 11- >new.s + if ! diff -b old.s new.s + then echo "--- Generated code changed ---" + fi +fi From 034918947966439b25ffafcd11d1992ff5c519c4 Mon Sep 17 00:00:00 2001 From: David Brown Date: Tue, 19 Jul 2016 20:38:41 +0100 Subject: [PATCH 180/580] Separate assembly source by build flavour. --- .../{old.s => old.cygwin.ILP32.gcc.s} | 0 .../hello/{old.s => old.cygwin.ILP32.gcc.s} | 0 .../language/{old.s => old.cygwin.ILP32.gcc.s} | 0 .../lola/{old.s => old.cygwin.ILP32.gcc.s} | 0 .../signal/{old.s => old.cygwin.ILP32.gcc.s} | 0 src/test/confidence/testenv.sh | 6 ++++-- src/test/confidence/testresult.sh | 16 +++++++++++----- src/tools/make/vishap.make | 10 +++++----- 8 files changed, 20 insertions(+), 12 deletions(-) rename src/test/confidence/arrayassignment/{old.s => old.cygwin.ILP32.gcc.s} (100%) rename src/test/confidence/hello/{old.s => old.cygwin.ILP32.gcc.s} (100%) rename src/test/confidence/language/{old.s => old.cygwin.ILP32.gcc.s} (100%) rename src/test/confidence/lola/{old.s => old.cygwin.ILP32.gcc.s} (100%) rename src/test/confidence/signal/{old.s => old.cygwin.ILP32.gcc.s} (100%) diff --git a/src/test/confidence/arrayassignment/old.s b/src/test/confidence/arrayassignment/old.cygwin.ILP32.gcc.s similarity index 100% rename from src/test/confidence/arrayassignment/old.s rename to src/test/confidence/arrayassignment/old.cygwin.ILP32.gcc.s diff --git a/src/test/confidence/hello/old.s b/src/test/confidence/hello/old.cygwin.ILP32.gcc.s similarity index 100% rename from src/test/confidence/hello/old.s rename to src/test/confidence/hello/old.cygwin.ILP32.gcc.s diff --git a/src/test/confidence/language/old.s b/src/test/confidence/language/old.cygwin.ILP32.gcc.s similarity index 100% rename from src/test/confidence/language/old.s rename to src/test/confidence/language/old.cygwin.ILP32.gcc.s diff --git a/src/test/confidence/lola/old.s b/src/test/confidence/lola/old.cygwin.ILP32.gcc.s similarity index 100% rename from src/test/confidence/lola/old.s rename to src/test/confidence/lola/old.cygwin.ILP32.gcc.s diff --git a/src/test/confidence/signal/old.s b/src/test/confidence/signal/old.cygwin.ILP32.gcc.s similarity index 100% rename from src/test/confidence/signal/old.s rename to src/test/confidence/signal/old.cygwin.ILP32.gcc.s diff --git a/src/test/confidence/testenv.sh b/src/test/confidence/testenv.sh index cf5a5ac9..5d331aa1 100755 --- a/src/test/confidence/testenv.sh +++ b/src/test/confidence/testenv.sh @@ -4,7 +4,7 @@ echo --- Confidence test $(basename $PWD) --- -if which cygpath >/dev/null +if which cygpath >/dev/null 2>/dev/null then export PATH="$(cygpath "$1")/bin":$PATH else export PATH="$1/bin":$PATH fi @@ -19,6 +19,8 @@ rm -f *.o *.obj *.exe *.sym *.c *.h result # corresponding assembly file will overwrite the previous. I # cannot see any way to overcome this short of using -S # on the voc command and calling 'as' explicitly. -if [ $COMPILER=gcc ] +# NOTE 2: The cygwin 64 bit build has relocation errors with +# these assembly generation options. +if [ $COMPILER=gcc -a $FLAVOUR!=cygwin.LP64.gcc ] then export CFLAGS="-gstabs -g1 -Wa,-acdhln=new.asm" fi diff --git a/src/test/confidence/testresult.sh b/src/test/confidence/testresult.sh index d873e263..d7e7d13e 100755 --- a/src/test/confidence/testresult.sh +++ b/src/test/confidence/testresult.sh @@ -6,10 +6,16 @@ else printf "FAILED: $PWD\n\n"; exit 1 fi # Compare generated code -if [ -f old.s -a -f new.asm ] -then - egrep '^[0-9 ]{4} ([0-9a-f]{4}| ) [0-9A-F]{2}[0-9A-F ]{6}' new.asm|cut -c 11- >new.s - if ! diff -b old.s new.s - then echo "--- Generated code changed ---" +if [ -f new.asm ] +then egrep '^[0-9 ]{4} ([0-9a-f]{4}| ) [0-9A-F]{2}[0-9A-F ]{6}' new.asm|cut -c 11- >new.$FLAVOUR.s + + if [ -f old.$FLAVOUR.s ] + then + if ! diff -b old.$FLAVOUR.s new.$FLAVOUR.s + then echo "--- Generated code changed ---" + fi + else + cp new.$FLAVOUR.s old.$FLAVOUR.s fi + fi diff --git a/src/tools/make/vishap.make b/src/tools/make/vishap.make index 8b50cb20..256a69ee 100644 --- a/src/tools/make/vishap.make +++ b/src/tools/make/vishap.make @@ -376,11 +376,11 @@ sourcechanges: confidence: @printf "\n\n--- Confidence tests ---\n\n" - cd src/test/confidence/hello; sh ./test.sh "$(INSTALLDIR)" - cd src/test/confidence/language; sh ./test.sh "$(INSTALLDIR)" - if [ "$(PLATFORM)" != "windows" ] ; then cd src/test/confidence/signal; sh ./test.sh "$(INSTALLDIR)"; fi - cd src/test/confidence/lola; sh ./test.sh "$(INSTALLDIR)" - cd src/test/confidence/arrayassignment; sh ./test.sh "$(INSTALLDIR)" + cd src/test/confidence/hello; FLAVOUR=$(FLAVOUR) sh ./test.sh "$(INSTALLDIR)" + cd src/test/confidence/language; FLAVOUR=$(FLAVOUR) sh ./test.sh "$(INSTALLDIR)" + if [ "$(PLATFORM)" != "windows" ] ; then cd src/test/confidence/signal; FLAVOUR=$(FLAVOUR) sh ./test.sh "$(INSTALLDIR)"; fi + cd src/test/confidence/lola; FLAVOUR=$(FLAVOUR) sh ./test.sh "$(INSTALLDIR)" + cd src/test/confidence/arrayassignment; FLAVOUR=$(FLAVOUR) sh ./test.sh "$(INSTALLDIR)" @printf "\n\n--- Confidence tests passed ---\n\n" From b3e2c5f9a67ce6f43f3e1dd84dcf485925927ac7 Mon Sep 17 00:00:00 2001 From: David Brown Date: Tue, 19 Jul 2016 21:55:47 +0100 Subject: [PATCH 181/580] Second attempt at disabling assembler generation for cygwin 64. --- src/test/confidence/testenv.sh | 2 +- src/tools/make/vishap.make | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/test/confidence/testenv.sh b/src/test/confidence/testenv.sh index 5d331aa1..f62a3ce8 100755 --- a/src/test/confidence/testenv.sh +++ b/src/test/confidence/testenv.sh @@ -21,6 +21,6 @@ rm -f *.o *.obj *.exe *.sym *.c *.h result # on the voc command and calling 'as' explicitly. # NOTE 2: The cygwin 64 bit build has relocation errors with # these assembly generation options. -if [ $COMPILER=gcc -a $FLAVOUR!=cygwin.LP64.gcc ] +if [ "$COMPILER" = "gcc" -a "$FLAVOUR" != "cygwin.LP64.gcc" ] then export CFLAGS="-gstabs -g1 -Wa,-acdhln=new.asm" fi diff --git a/src/tools/make/vishap.make b/src/tools/make/vishap.make index 256a69ee..62d90166 100644 --- a/src/tools/make/vishap.make +++ b/src/tools/make/vishap.make @@ -376,11 +376,11 @@ sourcechanges: confidence: @printf "\n\n--- Confidence tests ---\n\n" - cd src/test/confidence/hello; FLAVOUR=$(FLAVOUR) sh ./test.sh "$(INSTALLDIR)" - cd src/test/confidence/language; FLAVOUR=$(FLAVOUR) sh ./test.sh "$(INSTALLDIR)" - if [ "$(PLATFORM)" != "windows" ] ; then cd src/test/confidence/signal; FLAVOUR=$(FLAVOUR) sh ./test.sh "$(INSTALLDIR)"; fi - cd src/test/confidence/lola; FLAVOUR=$(FLAVOUR) sh ./test.sh "$(INSTALLDIR)" - cd src/test/confidence/arrayassignment; FLAVOUR=$(FLAVOUR) sh ./test.sh "$(INSTALLDIR)" + cd src/test/confidence/hello; COMPILER=$(COMPILER) FLAVOUR=$(FLAVOUR) sh ./test.sh "$(INSTALLDIR)" + cd src/test/confidence/language; COMPILER=$(COMPILER) FLAVOUR=$(FLAVOUR) sh ./test.sh "$(INSTALLDIR)" + if [ "$(PLATFORM)" != "windows" ] ; then cd src/test/confidence/signal; COMPILER=$(COMPILER) FLAVOUR=$(FLAVOUR) sh ./test.sh "$(INSTALLDIR)"; fi + cd src/test/confidence/lola; COMPILER=$(COMPILER) FLAVOUR=$(FLAVOUR) sh ./test.sh "$(INSTALLDIR)" + cd src/test/confidence/arrayassignment; COMPILER=$(COMPILER) FLAVOUR=$(FLAVOUR) sh ./test.sh "$(INSTALLDIR)" @printf "\n\n--- Confidence tests passed ---\n\n" From 4bbfe120c7bfc852eb7a5206924bb8ea3ee79eb2 Mon Sep 17 00:00:00 2001 From: David Brown Date: Wed, 20 Jul 2016 11:15:19 +0100 Subject: [PATCH 182/580] Add reporting of generated assembler changes. --- src/test/confidence/testresult.sh | 5 ++-- src/tools/make/buildall.pl | 40 +++++++++++++++++++++---------- 2 files changed, 31 insertions(+), 14 deletions(-) diff --git a/src/test/confidence/testresult.sh b/src/test/confidence/testresult.sh index d7e7d13e..a8389ad3 100755 --- a/src/test/confidence/testresult.sh +++ b/src/test/confidence/testresult.sh @@ -11,8 +11,9 @@ then egrep '^[0-9 ]{4} ([0-9a-f]{4}| ) [0-9A-F]{2}[0-9A-F ]{6}' new.asm|cut - if [ -f old.$FLAVOUR.s ] then - if ! diff -b old.$FLAVOUR.s new.$FLAVOUR.s - then echo "--- Generated code changed ---" + if diff -b old.$FLAVOUR.s new.$FLAVOUR.s + then echo "--- Generated code unchanged ---" + else echo "--- Generated code changed ---" fi else cp new.$FLAVOUR.s old.$FLAVOUR.s diff --git a/src/tools/make/buildall.pl b/src/tools/make/buildall.pl index 204b6a2d..73a7e23f 100755 --- a/src/tools/make/buildall.pl +++ b/src/tools/make/buildall.pl @@ -68,13 +68,13 @@ my %status = (); my $fn; my $date; my $time; -my $branch; my $os; my $compiler; my $datamodel; my $compilerok; my $libraryok; my $sourcechange; +my $asmchange; my $tests; my $key; my $ver; @@ -82,14 +82,14 @@ my $ver; sub clearvars { $time = ""; $branch = ""; $os = ""; $compiler = ""; $datamodel = ""; $compilerok = ""; $libraryok = ""; $sourcechange = ""; - $tests = ""; $key = ""; $ver = ""; + $asmchange = ""; $tests = ""; $key = ""; $ver = ""; } sub logstatus { my ($fn) = @_; if ($compiler ne "") { $status{"$os-$compiler-$datamodel"} = - [$fn, $date, $time, $os, $compiler, $datamodel, $branch, $compilerok, $libraryok, $sourcechange, $tests]; + [$fn, $date, $time, $os, $compiler, $datamodel, $branch, $compilerok, $libraryok, $sourcechange, $asmchange, $tests]; } clearvars(); } @@ -112,10 +112,16 @@ sub parselog { } if (/^([0-9.]+) --- Compiler build started ---$/) {$compilerok = "Failed";} if (/^([0-9.]+) --- Compiler build successfull ---$/) {$compilerok = "Built";} + if (/^([0-9.]+) --- Library build started ---$/) {$libraryok = "Failed";} if (/^([0-9.]+) --- Library build successfull ---$/) {$libraryok = "Built";} + if (/^([0-9.]+) --- Generated c source files match bootstrap ---$/) {$sourcechange = "Unchanged";} if (/^([0-9.]+) --- Generated c source files differ from bootstrap ---$/) {$sourcechange = "Changed";} + + if (/^([0-9.]+) --- Generated code unchanged ---$/) {if ($asmchange eq "") {$asmchange = "Unchanged"}} + if (/^([0-9.]+) --- Generated code changed ---$/) {$asmchange = "Changed"} + if (/^([0-9.]+) --- Confidence tests started ---$/) {$tests = "Failed";} if (/^([0-9.]+) --- Confidence tests passed ---$/) {$tests = "Passed";} } @@ -147,9 +153,16 @@ sub svgtext { print $f "\n"; } +sub colourfor { + my ($str) = @_; + if ($str eq "Failed") {return "#e03030";} + if ($str eq "Changed") {return "#d0a030";} + return #60ff60; +} + my $rows = keys %status; -my $width = 630; +my $width = 710; my $height = ($rows+2.2) * $lineheight; open(my $svg, ">build-status.svg") // die "Could not create build-status.svg."; @@ -158,7 +171,7 @@ print $svg ' xmlns="http://www.w3.org/2000/svg" version="1.1"'; print $svg ' xmlns:xlink="http://www.w3.org/1999/xlink"', ">\n"; print $svg '', "\n"; +print $svg ' stroke="#d5850d" stroke-width="4"/>', "\n"; my $col1 = 20; my $col2 = 97; @@ -170,6 +183,7 @@ my $col7 = 380; my $col8 = 440; my $col9 = 490; my $col10 = 570; +my $col11 = 650; svgtext($svg, $col1, 0, "#e0e0e0", "Date"); svgtext($svg, $col3, 0, "#e0e0e0", "Branch"); @@ -177,12 +191,13 @@ svgtext($svg, $col4, 0, "#e0e0e0", "Platform"); svgtext($svg, $col7, 0, "#e0e0e0", "Compiler"); svgtext($svg, $col8, 0, "#e0e0e0", "Library"); svgtext($svg, $col9, 0, "#e0e0e0", "C Source"); -svgtext($svg, $col10, 0, "#e0e0e0", "Tests"); +svgtext($svg, $col10, 0, "#e0e0e0", "Assembler"); +svgtext($svg, $col11, 0, "#e0e0e0", "Tests"); my $i=1; for my $key (sort keys %status) { - my ($fn, $date, $time, $os, $compiler, $datamodel, $branch, - $compilerok, $libraryok, $sourcechange, $tests) = @{$status{$key}}; + my ($fn, $date, $time, $os, $compiler, $datamodel, $branch, $compilerok, $libraryok, + $sourcechange, $asmchange, $tests) = @{$status{$key}}; print $svg ''; svgtext($svg, $col1, $i, "#c0c0c0", $date); svgtext($svg, $col2, $i, "#c0c0c0", $time); @@ -190,10 +205,11 @@ for my $key (sort keys %status) { svgtext($svg, $col4, $i, "#c0c0c0", $os); svgtext($svg, $col5, $i, "#c0c0c0", $compiler); svgtext($svg, $col6, $i, "#c0c0c0", $datamodel); - svgtext($svg, $col7, $i, "#60ff60", $compilerok); - svgtext($svg, $col8, $i, "#60ff60", $libraryok); - svgtext($svg, $col9, $i, "#60ff60", $sourcechange); - svgtext($svg, $col10, $i, "#60ff60", $tests); + svgtext($svg, $col7, $i, colourfor($compilerok), $compilerok); + svgtext($svg, $col8, $i, colourfor($libraryok), $libraryok); + svgtext($svg, $col9, $i, colourfor($sourcechange), $sourcechange); + svgtext($svg, $col10, $i, colourfor($asmchange), $asmchange); + svgtext($svg, $col11, $i, colourfor($tests), $tests); print $svg ''; $i++; } From 92e892c450a7377928e20ee4240bcbe4199ae13d Mon Sep 17 00:00:00 2001 From: David Brown Date: Wed, 20 Jul 2016 12:25:41 +0100 Subject: [PATCH 183/580] Fix success colour and width of build status report. --- src/tools/make/buildall.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tools/make/buildall.pl b/src/tools/make/buildall.pl index 73a7e23f..7e059d05 100755 --- a/src/tools/make/buildall.pl +++ b/src/tools/make/buildall.pl @@ -157,7 +157,7 @@ sub colourfor { my ($str) = @_; if ($str eq "Failed") {return "#e03030";} if ($str eq "Changed") {return "#d0a030";} - return #60ff60; + return "#60ff60"; } my $rows = keys %status; @@ -166,7 +166,7 @@ my $width = 710; my $height = ($rows+2.2) * $lineheight; open(my $svg, ">build-status.svg") // die "Could not create build-status.svg."; -print $svg '\n"; print $svg ' Date: Wed, 20 Jul 2016 14:32:15 +0100 Subject: [PATCH 184/580] Status report tweaks. --- src/test/confidence/testenv.sh | 2 +- src/tools/make/buildall.pl | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/test/confidence/testenv.sh b/src/test/confidence/testenv.sh index f62a3ce8..63d5fa26 100755 --- a/src/test/confidence/testenv.sh +++ b/src/test/confidence/testenv.sh @@ -11,7 +11,7 @@ fi # Set ibrary paths for darwin and termux(android) export DYLD_LIBRARY_PATH=$1/lib:$DYLD_LIBRARY_PATH export LD_LIBRARY_PATH=$1/lib:$LD_LIBRARY_PATH -rm -f *.o *.obj *.exe *.sym *.c *.h result +rm -f *.o *.obj *.exe *.sym *.c *.h result new.asm # Under gcc generate assembly source for source change test. # NOTE: The following CFLAGS causes the assembler to write source diff --git a/src/tools/make/buildall.pl b/src/tools/make/buildall.pl index 7e059d05..19d8fc80 100755 --- a/src/tools/make/buildall.pl +++ b/src/tools/make/buildall.pl @@ -156,8 +156,8 @@ sub svgtext { sub colourfor { my ($str) = @_; if ($str eq "Failed") {return "#e03030";} - if ($str eq "Changed") {return "#d0a030";} - return "#60ff60"; + if ($str eq "Changed") {return "#ff9d4d";} + return "#5adb5a"; } my $rows = keys %status; From c21975dc2a5a11d57f57664966d576d4e7002890 Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 21 Jul 2016 12:26:20 +0100 Subject: [PATCH 185/580] Remove limit on numeric value of OS file handle. --- bootstrap/unix-44/Configuration.c | 4 +- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Console.c | 2 +- bootstrap/unix-44/Console.h | 2 +- bootstrap/unix-44/Files.c | 132 ++++++++++++--------------- bootstrap/unix-44/Files.h | 12 +-- bootstrap/unix-44/Heap.c | 2 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 2 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 2 +- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 2 +- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 2 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/Vishap.c | 2 +- bootstrap/unix-44/errors.c | 2 +- bootstrap/unix-44/errors.h | 2 +- bootstrap/unix-44/extTools.c | 2 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-44/vt100.c | 2 +- bootstrap/unix-44/vt100.h | 2 +- bootstrap/unix-48/Configuration.c | 4 +- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Console.c | 2 +- bootstrap/unix-48/Console.h | 2 +- bootstrap/unix-48/Files.c | 132 ++++++++++++--------------- bootstrap/unix-48/Files.h | 12 +-- bootstrap/unix-48/Heap.c | 2 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 2 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 2 +- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 2 +- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 2 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/Vishap.c | 2 +- bootstrap/unix-48/errors.c | 2 +- bootstrap/unix-48/errors.h | 2 +- bootstrap/unix-48/extTools.c | 2 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-48/vt100.c | 2 +- bootstrap/unix-48/vt100.h | 2 +- bootstrap/unix-88/Configuration.c | 4 +- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Console.c | 2 +- bootstrap/unix-88/Console.h | 2 +- bootstrap/unix-88/Files.c | 132 ++++++++++++--------------- bootstrap/unix-88/Files.h | 12 +-- bootstrap/unix-88/Heap.c | 2 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 2 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 2 +- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 2 +- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 2 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/Vishap.c | 2 +- bootstrap/unix-88/errors.c | 2 +- bootstrap/unix-88/errors.h | 2 +- bootstrap/unix-88/extTools.c | 2 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/unix-88/vt100.c | 2 +- bootstrap/unix-88/vt100.h | 2 +- bootstrap/windows-48/Configuration.c | 4 +- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Console.c | 2 +- bootstrap/windows-48/Console.h | 2 +- bootstrap/windows-48/Files.c | 132 ++++++++++++--------------- bootstrap/windows-48/Files.h | 12 +-- bootstrap/windows-48/Heap.c | 2 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 2 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 2 +- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 2 +- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 2 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/Vishap.c | 2 +- bootstrap/windows-48/errors.c | 2 +- bootstrap/windows-48/errors.h | 2 +- bootstrap/windows-48/extTools.c | 2 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-48/vt100.c | 2 +- bootstrap/windows-48/vt100.h | 2 +- bootstrap/windows-88/Configuration.c | 4 +- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Console.c | 2 +- bootstrap/windows-88/Console.h | 2 +- bootstrap/windows-88/Files.c | 132 ++++++++++++--------------- bootstrap/windows-88/Files.h | 12 +-- bootstrap/windows-88/Heap.c | 2 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 2 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 2 +- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 2 +- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 2 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Platform.c | 2 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/Vishap.c | 2 +- bootstrap/windows-88/errors.c | 2 +- bootstrap/windows-88/errors.h | 2 +- bootstrap/windows-88/extTools.c | 2 +- bootstrap/windows-88/extTools.h | 2 +- bootstrap/windows-88/vt100.c | 2 +- bootstrap/windows-88/vt100.h | 2 +- src/system/Files.Mod | 117 +++++++++--------------- 196 files changed, 545 insertions(+), 672 deletions(-) diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index 40ee14ce..532bfc28 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -13,6 +13,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/07/19] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/07/21] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index bf6756e8..9c7095b9 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Console.c b/bootstrap/unix-44/Console.c index a17cab07..2119fef2 100644 --- a/bootstrap/unix-44/Console.c +++ b/bootstrap/unix-44/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Platform.h" diff --git a/bootstrap/unix-44/Console.h b/bootstrap/unix-44/Console.h index a4799f33..8558cf0e 100644 --- a/bootstrap/unix-44/Console.h +++ b/bootstrap/unix-44/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 4ca7a5cf..4834d8bc 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" @@ -7,7 +7,7 @@ #include "Strings.h" typedef - struct Files_Handle *Files_File; + struct Files_FileDesc *Files_File; typedef struct Files_BufDesc { @@ -24,14 +24,15 @@ typedef CHAR Files_FileName[101]; typedef - struct Files_Handle { + struct Files_FileDesc { Files_FileName workName, registerName; BOOLEAN tempFile; Platform_FileIdentity identity; LONGINT fd, len, pos; Files_Buffer bufs[4]; INTEGER swapper, state; - } Files_Handle; + Files_File next; + } Files_FileDesc; typedef struct Files_Rider { @@ -42,7 +43,7 @@ typedef } Files_Rider; -static LONGINT Files_fileTab[256]; +static Files_File Files_files; static INTEGER Files_tempno; static CHAR Files_HOME[1024]; static struct { @@ -50,7 +51,7 @@ static struct { CHAR data[1]; } *Files_SearchPath; -export LONGINT *Files_Handle__typ; +export LONGINT *Files_FileDesc__typ; export LONGINT *Files_BufDesc__typ; export LONGINT *Files_Rider__typ; @@ -58,6 +59,7 @@ export Files_File Files_Base (Files_Rider *r, LONGINT *r__typ); static Files_File Files_CacheEntry (Platform_FileIdentity identity); export void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INTEGER *res); export void Files_Close (Files_File f); +static void Files_CloseOSFile (Files_File f); static void Files_Create (Files_File f); export void Files_Delete (CHAR *name, LONGINT name__len, INTEGER *res); static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INTEGER errcode); @@ -68,7 +70,6 @@ export void Files_GetDate (Files_File f, LONGINT *t, LONGINT *d); export void Files_GetName (Files_File f, CHAR *name, LONGINT name__len); static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *name, LONGINT name__len); static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len); -static void Files_Init (void); export LONGINT Files_Length (Files_File f); static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT name__len, CHAR *dest, LONGINT dest__len); export Files_File Files_New (CHAR *name, LONGINT name__len); @@ -225,26 +226,14 @@ static void Files_Create (Files_File f) error = Platform_Unlink((void*)f->workName, ((LONGINT)(101))); error = Platform_New((void*)f->workName, ((LONGINT)(101)), &f->fd); done = error == 0; - if ((!done && Platform_TooManyFiles(error)) || (done && f->fd >= 256)) { - if ((done && f->fd >= 256)) { - error = Platform_Close(f->fd); - } - Heap_GC(1); - error = Platform_New((void*)f->workName, ((LONGINT)(101)), &f->fd); - done = f->fd == 0; - } if (done) { - if (f->fd >= 256) { - error = Platform_Close(f->fd); - Files_Err((CHAR*)"too many files open", (LONGINT)20, f, 0); - } else { - Files_fileTab[f->fd] = (LONGINT)(uintptr_t)f; - Heap_FileCount += 1; - Heap_RegisterFinalizer((void*)f, Files_Finalize); - f->state = 0; - f->pos = 0; - error = Platform_Identify(f->fd, &f->identity, Platform_FileIdentity__typ); - } + f->next = Files_files; + Files_files = f; + Heap_FileCount += 1; + Heap_RegisterFinalizer((void*)f, Files_Finalize); + f->state = 0; + f->pos = 0; + error = Platform_Identify(f->fd, &f->identity, Platform_FileIdentity__typ); } else { if (Platform_NoSuchDirectory(error)) { __MOVE("no such directory", err, 18); @@ -281,6 +270,27 @@ static void Files_Flush (Files_Buffer buf) } } +static void Files_CloseOSFile (Files_File f) +{ + Files_File prev = NIL; + INTEGER error; + if (Files_files == f) { + Files_files = f->next; + } else { + prev = Files_files; + while ((prev != NIL && prev->next != f)) { + prev = prev->next; + } + if (prev->next != NIL) { + prev->next = f->next; + } + } + error = Platform_Close(f->fd); + f->fd = -1; + f->state = 1; + Heap_FileCount -= 1; +} + void Files_Close (Files_File f) { LONGINT i; @@ -296,11 +306,7 @@ void Files_Close (Files_File f) if (error != 0) { Files_Err((CHAR*)"error writing file", (LONGINT)19, f, error); } - Files_fileTab[f->fd] = 0; - error = Platform_Close(f->fd); - f->fd = -1; - f->state = 1; - Heap_FileCount -= 1; + Files_CloseOSFile(f); } } @@ -316,7 +322,7 @@ Files_File Files_New (CHAR *name, LONGINT name__len) Files_File _o_result; Files_File f = NIL; __DUP(name, name__len, CHAR); - __NEW(f, Files_Handle); + __NEW(f, Files_FileDesc); f->workName[0] = 0x00; __COPY(name, f->registerName, ((LONGINT)(101))); f->fd = -1; @@ -392,10 +398,9 @@ static Files_File Files_CacheEntry (Platform_FileIdentity identity) Files_File _o_result; Files_File f = NIL; INTEGER i, error; - i = 0; - while (i < 256) { - f = (Files_File)(uintptr_t)Files_fileTab[i]; - if ((f != NIL && Platform_SameFile(identity, f->identity))) { + f = Files_files; + while (f != NIL) { + if (Platform_SameFile(identity, f->identity)) { if (!Platform_SameFileTime(identity, f->identity)) { i = 0; while (i < 4) { @@ -412,7 +417,7 @@ static Files_File Files_CacheEntry (Platform_FileIdentity identity) _o_result = f; return _o_result; } - i += 1; + f = f->next; } _o_result = NIL; return _o_result; @@ -442,16 +447,8 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) for (;;) { error = Platform_OldRW((void*)path, ((LONGINT)(256)), &fd); done = error == 0; - if ((!done && Platform_TooManyFiles(error)) || (done && fd >= 256)) { - if ((done && fd >= 256)) { - error = Platform_Close(fd); - } - Heap_GC(1); - error = Platform_OldRW((void*)path, ((LONGINT)(256)), &fd); - done = error == 0; - if ((!done && Platform_TooManyFiles(error))) { - Files_Err((CHAR*)"too many files open", (LONGINT)20, f, error); - } + if ((!done && Platform_TooManyFiles(error))) { + Files_Err((CHAR*)"too many files open", (LONGINT)20, f, error); } if ((!done && Platform_Inaccessible(error))) { error = Platform_OldRO((void*)path, ((LONGINT)(256)), &fd); @@ -468,17 +465,11 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) error = Platform_Identify(fd, &identity, Platform_FileIdentity__typ); f = Files_CacheEntry(identity); if (f != NIL) { - error = Platform_Close(fd); _o_result = f; __DEL(name); return _o_result; - } else if (fd >= 256) { - error = Platform_Close(fd); - Files_Err((CHAR*)"too many files open", (LONGINT)20, f, 0); } else { - __NEW(f, Files_Handle); - Files_fileTab[fd] = (LONGINT)(uintptr_t)f; - Heap_FileCount += 1; + __NEW(f, Files_FileDesc); Heap_RegisterFinalizer((void*)f, Files_Finalize); f->fd = fd; f->state = 0; @@ -489,6 +480,9 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) f->registerName[0] = 0x00; f->tempFile = 0; f->identity = identity; + f->next = Files_files; + Files_files = f; + Heap_FileCount += 1; _o_result = f; __DEL(name); return _o_result; @@ -1014,10 +1008,7 @@ static void Files_Finalize (SYSTEM_PTR o) LONGINT res; f = (Files_File)(uintptr_t)o; if (f->fd >= 0) { - Files_fileTab[f->fd] = 0; - res = Platform_Close(f->fd); - f->fd = -1; - Heap_FileCount -= 1; + Files_CloseOSFile(f); if (f->tempFile) { res = Platform_Unlink((void*)f->workName, ((LONGINT)(101))); } @@ -1036,27 +1027,13 @@ void Files_SetSearchPath (CHAR *path, LONGINT path__len) __DEL(path); } -static void Files_Init (void) -{ - LONGINT i; - i = 0; - while (i < 256) { - Files_fileTab[i] = 0; - i += 1; - } - Files_tempno = -1; - Heap_FileCount = 0; - Files_SearchPath = NIL; - Files_HOME[0] = 0x00; - Platform_GetEnv((CHAR*)"HOME", (LONGINT)5, (void*)Files_HOME, ((LONGINT)(1024))); -} - static void EnumPtrs(void (*P)(void*)) { + P(Files_files); P(Files_SearchPath); } -__TDESC(Files_Handle, 1, 4) = {__TDFLDS("Handle", 248), {228, 232, 236, 240, -20}}; +__TDESC(Files_FileDesc, 1, 5) = {__TDFLDS("FileDesc", 252), {228, 232, 236, 240, 248, -24}}; __TDESC(Files_BufDesc, 1, 1) = {__TDFLDS("BufDesc", 4112), {0, -8}}; __TDESC(Files_Rider, 1, 1) = {__TDFLDS("Rider", 20), {8, -8}}; @@ -1069,10 +1046,13 @@ export void *Files__init(void) __MODULE_IMPORT(Platform); __MODULE_IMPORT(Strings); __REGMOD("Files", EnumPtrs); - __INITYP(Files_Handle, Files_Handle, 0); + __INITYP(Files_FileDesc, Files_FileDesc, 0); __INITYP(Files_BufDesc, Files_BufDesc, 0); __INITYP(Files_Rider, Files_Rider, 0); /* BEGIN */ - Files_Init(); + Files_tempno = -1; + Heap_FileCount = 0; + Files_HOME[0] = 0x00; + Platform_GetEnv((CHAR*)"HOME", (LONGINT)5, (void*)Files_HOME, ((LONGINT)(1024))); __ENDMOD; } diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index 9e409adc..dbc01a40 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h @@ -6,14 +6,14 @@ #include "SYSTEM.h" typedef - struct Files_Handle *Files_File; + struct Files_FileDesc *Files_File; typedef - struct Files_Handle { + struct Files_FileDesc { char _prvt0[216]; LONGINT fd; - char _prvt1[28]; - } Files_Handle; + char _prvt1[32]; + } Files_FileDesc; typedef struct Files_Rider { @@ -24,7 +24,7 @@ typedef -import LONGINT *Files_Handle__typ; +import LONGINT *Files_FileDesc__typ; import LONGINT *Files_Rider__typ; import Files_File Files_Base (Files_Rider *r, LONGINT *r__typ); diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index d6248ab0..6888d3b4 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin tskSfF */ #include "SYSTEM.h" struct Heap__1 { diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index a7c115d1..4d58aaa0 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index 5e0ba69f..4051a16b 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Heap.h" diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index 2387f45f..674b8179 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index a69a396f..d5151e32 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index 9391eccb..077cea05 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 81cadc05..358871cb 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "OPM.h" diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index 27fe129c..8bf1d703 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 05ec3144..b3849a7b 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index c5e413a3..58dd953e 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index 877f2dc0..dddb24bb 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPB.h" #include "OPM.h" diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index c7a155eb..51c1177d 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index e4fb2cf6..5d3430ff 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index 73fb31d0..2c8af702 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index 34c1acb6..8e4c0838 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index 998a6db8..0e0961c2 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index 1c086988..552dde2e 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPC.h" #include "OPM.h" diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index c9a566de..99e51118 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 2832d8d3..351690cc 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index f5315fd6..7f649145 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 146ece15..9174951e 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index 79518e88..d68a783e 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index 5ea5720d..0236f251 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index 3a8ef7a3..db08524a 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index 3bec2632..3303218b 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Files.h" #include "Modules.h" diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index f8eeb41d..8818827b 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/Vishap.c b/bootstrap/unix-44/Vishap.c index a5d922e9..8b14dc22 100644 --- a/bootstrap/unix-44/Vishap.c +++ b/bootstrap/unix-44/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkamSf */ #include "SYSTEM.h" #include "Configuration.h" #include "Heap.h" diff --git a/bootstrap/unix-44/errors.c b/bootstrap/unix-44/errors.c index e8272348..918c86fe 100644 --- a/bootstrap/unix-44/errors.c +++ b/bootstrap/unix-44/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/unix-44/errors.h b/bootstrap/unix-44/errors.h index 7a085f56..3762b03f 100644 --- a/bootstrap/unix-44/errors.h +++ b/bootstrap/unix-44/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index 646b357b..fb1322bb 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index 1c63c923..2530385b 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-44/vt100.c b/bootstrap/unix-44/vt100.c index 67bed77e..0697fe1d 100644 --- a/bootstrap/unix-44/vt100.c +++ b/bootstrap/unix-44/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Strings.h" diff --git a/bootstrap/unix-44/vt100.h b/bootstrap/unix-44/vt100.h index 83c4e777..bb6e8f9c 100644 --- a/bootstrap/unix-44/vt100.h +++ b/bootstrap/unix-44/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index 40ee14ce..532bfc28 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -13,6 +13,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/07/19] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/07/21] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index bf6756e8..9c7095b9 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Console.c b/bootstrap/unix-48/Console.c index a17cab07..2119fef2 100644 --- a/bootstrap/unix-48/Console.c +++ b/bootstrap/unix-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Platform.h" diff --git a/bootstrap/unix-48/Console.h b/bootstrap/unix-48/Console.h index a4799f33..8558cf0e 100644 --- a/bootstrap/unix-48/Console.h +++ b/bootstrap/unix-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 4ca7a5cf..4834d8bc 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" @@ -7,7 +7,7 @@ #include "Strings.h" typedef - struct Files_Handle *Files_File; + struct Files_FileDesc *Files_File; typedef struct Files_BufDesc { @@ -24,14 +24,15 @@ typedef CHAR Files_FileName[101]; typedef - struct Files_Handle { + struct Files_FileDesc { Files_FileName workName, registerName; BOOLEAN tempFile; Platform_FileIdentity identity; LONGINT fd, len, pos; Files_Buffer bufs[4]; INTEGER swapper, state; - } Files_Handle; + Files_File next; + } Files_FileDesc; typedef struct Files_Rider { @@ -42,7 +43,7 @@ typedef } Files_Rider; -static LONGINT Files_fileTab[256]; +static Files_File Files_files; static INTEGER Files_tempno; static CHAR Files_HOME[1024]; static struct { @@ -50,7 +51,7 @@ static struct { CHAR data[1]; } *Files_SearchPath; -export LONGINT *Files_Handle__typ; +export LONGINT *Files_FileDesc__typ; export LONGINT *Files_BufDesc__typ; export LONGINT *Files_Rider__typ; @@ -58,6 +59,7 @@ export Files_File Files_Base (Files_Rider *r, LONGINT *r__typ); static Files_File Files_CacheEntry (Platform_FileIdentity identity); export void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INTEGER *res); export void Files_Close (Files_File f); +static void Files_CloseOSFile (Files_File f); static void Files_Create (Files_File f); export void Files_Delete (CHAR *name, LONGINT name__len, INTEGER *res); static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INTEGER errcode); @@ -68,7 +70,6 @@ export void Files_GetDate (Files_File f, LONGINT *t, LONGINT *d); export void Files_GetName (Files_File f, CHAR *name, LONGINT name__len); static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *name, LONGINT name__len); static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len); -static void Files_Init (void); export LONGINT Files_Length (Files_File f); static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT name__len, CHAR *dest, LONGINT dest__len); export Files_File Files_New (CHAR *name, LONGINT name__len); @@ -225,26 +226,14 @@ static void Files_Create (Files_File f) error = Platform_Unlink((void*)f->workName, ((LONGINT)(101))); error = Platform_New((void*)f->workName, ((LONGINT)(101)), &f->fd); done = error == 0; - if ((!done && Platform_TooManyFiles(error)) || (done && f->fd >= 256)) { - if ((done && f->fd >= 256)) { - error = Platform_Close(f->fd); - } - Heap_GC(1); - error = Platform_New((void*)f->workName, ((LONGINT)(101)), &f->fd); - done = f->fd == 0; - } if (done) { - if (f->fd >= 256) { - error = Platform_Close(f->fd); - Files_Err((CHAR*)"too many files open", (LONGINT)20, f, 0); - } else { - Files_fileTab[f->fd] = (LONGINT)(uintptr_t)f; - Heap_FileCount += 1; - Heap_RegisterFinalizer((void*)f, Files_Finalize); - f->state = 0; - f->pos = 0; - error = Platform_Identify(f->fd, &f->identity, Platform_FileIdentity__typ); - } + f->next = Files_files; + Files_files = f; + Heap_FileCount += 1; + Heap_RegisterFinalizer((void*)f, Files_Finalize); + f->state = 0; + f->pos = 0; + error = Platform_Identify(f->fd, &f->identity, Platform_FileIdentity__typ); } else { if (Platform_NoSuchDirectory(error)) { __MOVE("no such directory", err, 18); @@ -281,6 +270,27 @@ static void Files_Flush (Files_Buffer buf) } } +static void Files_CloseOSFile (Files_File f) +{ + Files_File prev = NIL; + INTEGER error; + if (Files_files == f) { + Files_files = f->next; + } else { + prev = Files_files; + while ((prev != NIL && prev->next != f)) { + prev = prev->next; + } + if (prev->next != NIL) { + prev->next = f->next; + } + } + error = Platform_Close(f->fd); + f->fd = -1; + f->state = 1; + Heap_FileCount -= 1; +} + void Files_Close (Files_File f) { LONGINT i; @@ -296,11 +306,7 @@ void Files_Close (Files_File f) if (error != 0) { Files_Err((CHAR*)"error writing file", (LONGINT)19, f, error); } - Files_fileTab[f->fd] = 0; - error = Platform_Close(f->fd); - f->fd = -1; - f->state = 1; - Heap_FileCount -= 1; + Files_CloseOSFile(f); } } @@ -316,7 +322,7 @@ Files_File Files_New (CHAR *name, LONGINT name__len) Files_File _o_result; Files_File f = NIL; __DUP(name, name__len, CHAR); - __NEW(f, Files_Handle); + __NEW(f, Files_FileDesc); f->workName[0] = 0x00; __COPY(name, f->registerName, ((LONGINT)(101))); f->fd = -1; @@ -392,10 +398,9 @@ static Files_File Files_CacheEntry (Platform_FileIdentity identity) Files_File _o_result; Files_File f = NIL; INTEGER i, error; - i = 0; - while (i < 256) { - f = (Files_File)(uintptr_t)Files_fileTab[i]; - if ((f != NIL && Platform_SameFile(identity, f->identity))) { + f = Files_files; + while (f != NIL) { + if (Platform_SameFile(identity, f->identity)) { if (!Platform_SameFileTime(identity, f->identity)) { i = 0; while (i < 4) { @@ -412,7 +417,7 @@ static Files_File Files_CacheEntry (Platform_FileIdentity identity) _o_result = f; return _o_result; } - i += 1; + f = f->next; } _o_result = NIL; return _o_result; @@ -442,16 +447,8 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) for (;;) { error = Platform_OldRW((void*)path, ((LONGINT)(256)), &fd); done = error == 0; - if ((!done && Platform_TooManyFiles(error)) || (done && fd >= 256)) { - if ((done && fd >= 256)) { - error = Platform_Close(fd); - } - Heap_GC(1); - error = Platform_OldRW((void*)path, ((LONGINT)(256)), &fd); - done = error == 0; - if ((!done && Platform_TooManyFiles(error))) { - Files_Err((CHAR*)"too many files open", (LONGINT)20, f, error); - } + if ((!done && Platform_TooManyFiles(error))) { + Files_Err((CHAR*)"too many files open", (LONGINT)20, f, error); } if ((!done && Platform_Inaccessible(error))) { error = Platform_OldRO((void*)path, ((LONGINT)(256)), &fd); @@ -468,17 +465,11 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) error = Platform_Identify(fd, &identity, Platform_FileIdentity__typ); f = Files_CacheEntry(identity); if (f != NIL) { - error = Platform_Close(fd); _o_result = f; __DEL(name); return _o_result; - } else if (fd >= 256) { - error = Platform_Close(fd); - Files_Err((CHAR*)"too many files open", (LONGINT)20, f, 0); } else { - __NEW(f, Files_Handle); - Files_fileTab[fd] = (LONGINT)(uintptr_t)f; - Heap_FileCount += 1; + __NEW(f, Files_FileDesc); Heap_RegisterFinalizer((void*)f, Files_Finalize); f->fd = fd; f->state = 0; @@ -489,6 +480,9 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) f->registerName[0] = 0x00; f->tempFile = 0; f->identity = identity; + f->next = Files_files; + Files_files = f; + Heap_FileCount += 1; _o_result = f; __DEL(name); return _o_result; @@ -1014,10 +1008,7 @@ static void Files_Finalize (SYSTEM_PTR o) LONGINT res; f = (Files_File)(uintptr_t)o; if (f->fd >= 0) { - Files_fileTab[f->fd] = 0; - res = Platform_Close(f->fd); - f->fd = -1; - Heap_FileCount -= 1; + Files_CloseOSFile(f); if (f->tempFile) { res = Platform_Unlink((void*)f->workName, ((LONGINT)(101))); } @@ -1036,27 +1027,13 @@ void Files_SetSearchPath (CHAR *path, LONGINT path__len) __DEL(path); } -static void Files_Init (void) -{ - LONGINT i; - i = 0; - while (i < 256) { - Files_fileTab[i] = 0; - i += 1; - } - Files_tempno = -1; - Heap_FileCount = 0; - Files_SearchPath = NIL; - Files_HOME[0] = 0x00; - Platform_GetEnv((CHAR*)"HOME", (LONGINT)5, (void*)Files_HOME, ((LONGINT)(1024))); -} - static void EnumPtrs(void (*P)(void*)) { + P(Files_files); P(Files_SearchPath); } -__TDESC(Files_Handle, 1, 4) = {__TDFLDS("Handle", 248), {228, 232, 236, 240, -20}}; +__TDESC(Files_FileDesc, 1, 5) = {__TDFLDS("FileDesc", 252), {228, 232, 236, 240, 248, -24}}; __TDESC(Files_BufDesc, 1, 1) = {__TDFLDS("BufDesc", 4112), {0, -8}}; __TDESC(Files_Rider, 1, 1) = {__TDFLDS("Rider", 20), {8, -8}}; @@ -1069,10 +1046,13 @@ export void *Files__init(void) __MODULE_IMPORT(Platform); __MODULE_IMPORT(Strings); __REGMOD("Files", EnumPtrs); - __INITYP(Files_Handle, Files_Handle, 0); + __INITYP(Files_FileDesc, Files_FileDesc, 0); __INITYP(Files_BufDesc, Files_BufDesc, 0); __INITYP(Files_Rider, Files_Rider, 0); /* BEGIN */ - Files_Init(); + Files_tempno = -1; + Heap_FileCount = 0; + Files_HOME[0] = 0x00; + Platform_GetEnv((CHAR*)"HOME", (LONGINT)5, (void*)Files_HOME, ((LONGINT)(1024))); __ENDMOD; } diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index 9e409adc..dbc01a40 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h @@ -6,14 +6,14 @@ #include "SYSTEM.h" typedef - struct Files_Handle *Files_File; + struct Files_FileDesc *Files_File; typedef - struct Files_Handle { + struct Files_FileDesc { char _prvt0[216]; LONGINT fd; - char _prvt1[28]; - } Files_Handle; + char _prvt1[32]; + } Files_FileDesc; typedef struct Files_Rider { @@ -24,7 +24,7 @@ typedef -import LONGINT *Files_Handle__typ; +import LONGINT *Files_FileDesc__typ; import LONGINT *Files_Rider__typ; import Files_File Files_Base (Files_Rider *r, LONGINT *r__typ); diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index d6248ab0..6888d3b4 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin tskSfF */ #include "SYSTEM.h" struct Heap__1 { diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index a7c115d1..4d58aaa0 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index 5e0ba69f..4051a16b 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Heap.h" diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index 2387f45f..674b8179 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index a69a396f..d5151e32 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index 9391eccb..077cea05 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 81cadc05..358871cb 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "OPM.h" diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index 27fe129c..8bf1d703 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 05ec3144..b3849a7b 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index c5e413a3..58dd953e 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index 877f2dc0..dddb24bb 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPB.h" #include "OPM.h" diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index c7a155eb..51c1177d 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index e4fb2cf6..5d3430ff 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index 73fb31d0..2c8af702 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 34c1acb6..8e4c0838 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index 998a6db8..0e0961c2 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index 1c086988..552dde2e 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPC.h" #include "OPM.h" diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index c9a566de..99e51118 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 2832d8d3..351690cc 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index f5315fd6..7f649145 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 146ece15..9174951e 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index 79518e88..d68a783e 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index 5ea5720d..0236f251 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index 3a8ef7a3..db08524a 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index 6e92e862..107d4836 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Files.h" #include "Modules.h" diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index 169fe56b..612534d4 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/Vishap.c b/bootstrap/unix-48/Vishap.c index a5d922e9..8b14dc22 100644 --- a/bootstrap/unix-48/Vishap.c +++ b/bootstrap/unix-48/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkamSf */ #include "SYSTEM.h" #include "Configuration.h" #include "Heap.h" diff --git a/bootstrap/unix-48/errors.c b/bootstrap/unix-48/errors.c index e8272348..918c86fe 100644 --- a/bootstrap/unix-48/errors.c +++ b/bootstrap/unix-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/unix-48/errors.h b/bootstrap/unix-48/errors.h index 7a085f56..3762b03f 100644 --- a/bootstrap/unix-48/errors.h +++ b/bootstrap/unix-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index 646b357b..fb1322bb 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index 1c63c923..2530385b 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/vt100.c b/bootstrap/unix-48/vt100.c index 67bed77e..0697fe1d 100644 --- a/bootstrap/unix-48/vt100.c +++ b/bootstrap/unix-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Strings.h" diff --git a/bootstrap/unix-48/vt100.h b/bootstrap/unix-48/vt100.h index 83c4e777..bb6e8f9c 100644 --- a/bootstrap/unix-48/vt100.h +++ b/bootstrap/unix-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index bdec7223..5ba6cdf8 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -14,6 +14,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/07/19] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/07/21] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index 00d35df8..4d9593cc 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Console.c b/bootstrap/unix-88/Console.c index 28a3d5cf..0e642fae 100644 --- a/bootstrap/unix-88/Console.c +++ b/bootstrap/unix-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Platform.h" diff --git a/bootstrap/unix-88/Console.h b/bootstrap/unix-88/Console.h index ae5997db..d1875d91 100644 --- a/bootstrap/unix-88/Console.h +++ b/bootstrap/unix-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index f8e3a46a..e952925a 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin tspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -8,7 +8,7 @@ #include "Strings.h" typedef - struct Files_Handle *Files_File; + struct Files_FileDesc *Files_File; typedef struct Files_BufDesc { @@ -25,14 +25,15 @@ typedef CHAR Files_FileName[101]; typedef - struct Files_Handle { + struct Files_FileDesc { Files_FileName workName, registerName; BOOLEAN tempFile; Platform_FileIdentity identity; LONGINT fd, len, pos; Files_Buffer bufs[4]; INTEGER swapper, state; - } Files_Handle; + Files_File next; + } Files_FileDesc; typedef struct Files_Rider { @@ -43,7 +44,7 @@ typedef } Files_Rider; -static LONGINT Files_fileTab[256]; +static Files_File Files_files; static INTEGER Files_tempno; static CHAR Files_HOME[1024]; static struct { @@ -51,7 +52,7 @@ static struct { CHAR data[1]; } *Files_SearchPath; -export LONGINT *Files_Handle__typ; +export LONGINT *Files_FileDesc__typ; export LONGINT *Files_BufDesc__typ; export LONGINT *Files_Rider__typ; @@ -59,6 +60,7 @@ export Files_File Files_Base (Files_Rider *r, LONGINT *r__typ); static Files_File Files_CacheEntry (Platform_FileIdentity identity); export void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INTEGER *res); export void Files_Close (Files_File f); +static void Files_CloseOSFile (Files_File f); static void Files_Create (Files_File f); export void Files_Delete (CHAR *name, LONGINT name__len, INTEGER *res); static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INTEGER errcode); @@ -69,7 +71,6 @@ export void Files_GetDate (Files_File f, LONGINT *t, LONGINT *d); export void Files_GetName (Files_File f, CHAR *name, LONGINT name__len); static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *name, LONGINT name__len); static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len); -static void Files_Init (void); export LONGINT Files_Length (Files_File f); static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT name__len, CHAR *dest, LONGINT dest__len); export Files_File Files_New (CHAR *name, LONGINT name__len); @@ -226,26 +227,14 @@ static void Files_Create (Files_File f) error = Platform_Unlink((void*)f->workName, ((LONGINT)(101))); error = Platform_New((void*)f->workName, ((LONGINT)(101)), &f->fd); done = error == 0; - if ((!done && Platform_TooManyFiles(error)) || (done && f->fd >= 256)) { - if ((done && f->fd >= 256)) { - error = Platform_Close(f->fd); - } - Heap_GC(1); - error = Platform_New((void*)f->workName, ((LONGINT)(101)), &f->fd); - done = f->fd == 0; - } if (done) { - if (f->fd >= 256) { - error = Platform_Close(f->fd); - Files_Err((CHAR*)"too many files open", (LONGINT)20, f, 0); - } else { - Files_fileTab[f->fd] = (LONGINT)(uintptr_t)f; - Heap_FileCount += 1; - Heap_RegisterFinalizer((void*)f, Files_Finalize); - f->state = 0; - f->pos = 0; - error = Platform_Identify(f->fd, &f->identity, Platform_FileIdentity__typ); - } + f->next = Files_files; + Files_files = f; + Heap_FileCount += 1; + Heap_RegisterFinalizer((void*)f, Files_Finalize); + f->state = 0; + f->pos = 0; + error = Platform_Identify(f->fd, &f->identity, Platform_FileIdentity__typ); } else { if (Platform_NoSuchDirectory(error)) { __MOVE("no such directory", err, 18); @@ -282,6 +271,27 @@ static void Files_Flush (Files_Buffer buf) } } +static void Files_CloseOSFile (Files_File f) +{ + Files_File prev = NIL; + INTEGER error; + if (Files_files == f) { + Files_files = f->next; + } else { + prev = Files_files; + while ((prev != NIL && prev->next != f)) { + prev = prev->next; + } + if (prev->next != NIL) { + prev->next = f->next; + } + } + error = Platform_Close(f->fd); + f->fd = -1; + f->state = 1; + Heap_FileCount -= 1; +} + void Files_Close (Files_File f) { LONGINT i; @@ -297,11 +307,7 @@ void Files_Close (Files_File f) if (error != 0) { Files_Err((CHAR*)"error writing file", (LONGINT)19, f, error); } - Files_fileTab[f->fd] = 0; - error = Platform_Close(f->fd); - f->fd = -1; - f->state = 1; - Heap_FileCount -= 1; + Files_CloseOSFile(f); } } @@ -317,7 +323,7 @@ Files_File Files_New (CHAR *name, LONGINT name__len) Files_File _o_result; Files_File f = NIL; __DUP(name, name__len, CHAR); - __NEW(f, Files_Handle); + __NEW(f, Files_FileDesc); f->workName[0] = 0x00; __COPY(name, f->registerName, ((LONGINT)(101))); f->fd = -1; @@ -393,10 +399,9 @@ static Files_File Files_CacheEntry (Platform_FileIdentity identity) Files_File _o_result; Files_File f = NIL; INTEGER i, error; - i = 0; - while (i < 256) { - f = (Files_File)(uintptr_t)Files_fileTab[i]; - if ((f != NIL && Platform_SameFile(identity, f->identity))) { + f = Files_files; + while (f != NIL) { + if (Platform_SameFile(identity, f->identity)) { if (!Platform_SameFileTime(identity, f->identity)) { i = 0; while (i < 4) { @@ -413,7 +418,7 @@ static Files_File Files_CacheEntry (Platform_FileIdentity identity) _o_result = f; return _o_result; } - i += 1; + f = f->next; } _o_result = NIL; return _o_result; @@ -443,16 +448,8 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) for (;;) { error = Platform_OldRW((void*)path, ((LONGINT)(256)), &fd); done = error == 0; - if ((!done && Platform_TooManyFiles(error)) || (done && fd >= 256)) { - if ((done && fd >= 256)) { - error = Platform_Close(fd); - } - Heap_GC(1); - error = Platform_OldRW((void*)path, ((LONGINT)(256)), &fd); - done = error == 0; - if ((!done && Platform_TooManyFiles(error))) { - Files_Err((CHAR*)"too many files open", (LONGINT)20, f, error); - } + if ((!done && Platform_TooManyFiles(error))) { + Files_Err((CHAR*)"too many files open", (LONGINT)20, f, error); } if ((!done && Platform_Inaccessible(error))) { error = Platform_OldRO((void*)path, ((LONGINT)(256)), &fd); @@ -469,17 +466,11 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) error = Platform_Identify(fd, &identity, Platform_FileIdentity__typ); f = Files_CacheEntry(identity); if (f != NIL) { - error = Platform_Close(fd); _o_result = f; __DEL(name); return _o_result; - } else if (fd >= 256) { - error = Platform_Close(fd); - Files_Err((CHAR*)"too many files open", (LONGINT)20, f, 0); } else { - __NEW(f, Files_Handle); - Files_fileTab[fd] = (LONGINT)(uintptr_t)f; - Heap_FileCount += 1; + __NEW(f, Files_FileDesc); Heap_RegisterFinalizer((void*)f, Files_Finalize); f->fd = fd; f->state = 0; @@ -490,6 +481,9 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) f->registerName[0] = 0x00; f->tempFile = 0; f->identity = identity; + f->next = Files_files; + Files_files = f; + Heap_FileCount += 1; _o_result = f; __DEL(name); return _o_result; @@ -1015,10 +1009,7 @@ static void Files_Finalize (SYSTEM_PTR o) LONGINT res; f = (Files_File)(uintptr_t)o; if (f->fd >= 0) { - Files_fileTab[f->fd] = 0; - res = Platform_Close(f->fd); - f->fd = -1; - Heap_FileCount -= 1; + Files_CloseOSFile(f); if (f->tempFile) { res = Platform_Unlink((void*)f->workName, ((LONGINT)(101))); } @@ -1037,27 +1028,13 @@ void Files_SetSearchPath (CHAR *path, LONGINT path__len) __DEL(path); } -static void Files_Init (void) -{ - LONGINT i; - i = 0; - while (i < 256) { - Files_fileTab[i] = 0; - i += 1; - } - Files_tempno = -1; - Heap_FileCount = 0; - Files_SearchPath = NIL; - Files_HOME[0] = 0x00; - Platform_GetEnv((CHAR*)"HOME", (LONGINT)5, (void*)Files_HOME, ((LONGINT)(1024))); -} - static void EnumPtrs(void (*P)(void*)) { + P(Files_files); P(Files_SearchPath); } -__TDESC(Files_Handle, 1, 4) = {__TDFLDS("Handle", 296), {256, 264, 272, 280, -40}}; +__TDESC(Files_FileDesc, 1, 5) = {__TDFLDS("FileDesc", 304), {256, 264, 272, 280, 296, -48}}; __TDESC(Files_BufDesc, 1, 1) = {__TDFLDS("BufDesc", 4128), {0, -16}}; __TDESC(Files_Rider, 1, 1) = {__TDFLDS("Rider", 40), {16, -16}}; @@ -1070,10 +1047,13 @@ export void *Files__init(void) __MODULE_IMPORT(Platform); __MODULE_IMPORT(Strings); __REGMOD("Files", EnumPtrs); - __INITYP(Files_Handle, Files_Handle, 0); + __INITYP(Files_FileDesc, Files_FileDesc, 0); __INITYP(Files_BufDesc, Files_BufDesc, 0); __INITYP(Files_Rider, Files_Rider, 0); /* BEGIN */ - Files_Init(); + Files_tempno = -1; + Heap_FileCount = 0; + Files_HOME[0] = 0x00; + Platform_GetEnv((CHAR*)"HOME", (LONGINT)5, (void*)Files_HOME, ((LONGINT)(1024))); __ENDMOD; } diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 7b4ace20..88756ec8 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h @@ -7,14 +7,14 @@ #include "SYSTEM.h" typedef - struct Files_Handle *Files_File; + struct Files_FileDesc *Files_File; typedef - struct Files_Handle { + struct Files_FileDesc { char _prvt0[232]; LONGINT fd; - char _prvt1[56]; - } Files_Handle; + char _prvt1[64]; + } Files_FileDesc; typedef struct Files_Rider { @@ -25,7 +25,7 @@ typedef -import LONGINT *Files_Handle__typ; +import LONGINT *Files_FileDesc__typ; import LONGINT *Files_Rider__typ; import Files_File Files_Base (Files_Rider *r, LONGINT *r__typ); diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index 9122c75d..ab8bd793 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin tskSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index 070c972a..1a13a9af 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 0aae7575..d5411050 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index 39c8f674..e6254a2e 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index 592ee7e0..2b3ff4f7 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index 3e8819ed..8b8d0a4c 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index 008bc7ca..ebcd0651 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index a80eedad..1562be22 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index b5198578..40658c18 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index 56fcf196..7d4b03b1 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index 3adde5cb..a01ab45f 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPB.h" diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index 71e6e1fb..3df6ebfe 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index 8e85be6e..c89a1322 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin tspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index dfa2d800..1ce9683e 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index 57333946..a1ef6cf9 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 7f7aff33..6f5f182a 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 1091acf3..dbdc1868 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPC.h" diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index 0370a1d7..1963d30e 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 7f0a4d64..d418ba24 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index 9ee31f1b..4145a946 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 911df230..b82cd526 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index f166c1b9..61320bbb 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index e767e842..090e4a68 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index 94a70d57..b09d7336 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index f5efee7c..a489adbb 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Files.h" diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index 5d8e0c33..1aaf0c32 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/Vishap.c b/bootstrap/unix-88/Vishap.c index 822287a3..37d64ec3 100644 --- a/bootstrap/unix-88/Vishap.c +++ b/bootstrap/unix-88/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkamSf */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/unix-88/errors.c b/bootstrap/unix-88/errors.c index a54d8e43..3e819c0b 100644 --- a/bootstrap/unix-88/errors.c +++ b/bootstrap/unix-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/unix-88/errors.h b/bootstrap/unix-88/errors.h index 205ba3a1..14e6456a 100644 --- a/bootstrap/unix-88/errors.h +++ b/bootstrap/unix-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index 327aeac4..816ab551 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index f19d95a4..d9e89e69 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/vt100.c b/bootstrap/unix-88/vt100.c index 4b742768..8a30b13f 100644 --- a/bootstrap/unix-88/vt100.c +++ b/bootstrap/unix-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/unix-88/vt100.h b/bootstrap/unix-88/vt100.h index dd08fa37..49a57eb4 100644 --- a/bootstrap/unix-88/vt100.h +++ b/bootstrap/unix-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index 40ee14ce..532bfc28 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -13,6 +13,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/07/19] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/07/21] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index bf6756e8..9c7095b9 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Console.c b/bootstrap/windows-48/Console.c index 84f4ea3b..79526e86 100644 --- a/bootstrap/windows-48/Console.c +++ b/bootstrap/windows-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Platform.h" diff --git a/bootstrap/windows-48/Console.h b/bootstrap/windows-48/Console.h index a4799f33..8558cf0e 100644 --- a/bootstrap/windows-48/Console.h +++ b/bootstrap/windows-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 0eb0643d..ff9e1dd6 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" @@ -7,7 +7,7 @@ #include "Strings.h" typedef - struct Files_Handle *Files_File; + struct Files_FileDesc *Files_File; typedef struct Files_BufDesc { @@ -24,14 +24,15 @@ typedef CHAR Files_FileName[101]; typedef - struct Files_Handle { + struct Files_FileDesc { Files_FileName workName, registerName; BOOLEAN tempFile; Platform_FileIdentity identity; LONGINT fd, len, pos; Files_Buffer bufs[4]; INTEGER swapper, state; - } Files_Handle; + Files_File next; + } Files_FileDesc; typedef struct Files_Rider { @@ -42,7 +43,7 @@ typedef } Files_Rider; -static LONGINT Files_fileTab[256]; +static Files_File Files_files; static INTEGER Files_tempno; static CHAR Files_HOME[1024]; static struct { @@ -50,7 +51,7 @@ static struct { CHAR data[1]; } *Files_SearchPath; -export LONGINT *Files_Handle__typ; +export LONGINT *Files_FileDesc__typ; export LONGINT *Files_BufDesc__typ; export LONGINT *Files_Rider__typ; @@ -58,6 +59,7 @@ export Files_File Files_Base (Files_Rider *r, LONGINT *r__typ); static Files_File Files_CacheEntry (Platform_FileIdentity identity); export void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INTEGER *res); export void Files_Close (Files_File f); +static void Files_CloseOSFile (Files_File f); static void Files_Create (Files_File f); export void Files_Delete (CHAR *name, LONGINT name__len, INTEGER *res); static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INTEGER errcode); @@ -68,7 +70,6 @@ export void Files_GetDate (Files_File f, LONGINT *t, LONGINT *d); export void Files_GetName (Files_File f, CHAR *name, LONGINT name__len); static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *name, LONGINT name__len); static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len); -static void Files_Init (void); export LONGINT Files_Length (Files_File f); static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT name__len, CHAR *dest, LONGINT dest__len); export Files_File Files_New (CHAR *name, LONGINT name__len); @@ -225,26 +226,14 @@ static void Files_Create (Files_File f) error = Platform_Unlink((void*)f->workName, ((LONGINT)(101))); error = Platform_New((void*)f->workName, ((LONGINT)(101)), &f->fd); done = error == 0; - if ((!done && Platform_TooManyFiles(error)) || (done && f->fd >= 256)) { - if ((done && f->fd >= 256)) { - error = Platform_Close(f->fd); - } - Heap_GC(1); - error = Platform_New((void*)f->workName, ((LONGINT)(101)), &f->fd); - done = f->fd == 0; - } if (done) { - if (f->fd >= 256) { - error = Platform_Close(f->fd); - Files_Err((CHAR*)"too many files open", (LONGINT)20, f, 0); - } else { - Files_fileTab[f->fd] = (LONGINT)(uintptr_t)f; - Heap_FileCount += 1; - Heap_RegisterFinalizer((void*)f, Files_Finalize); - f->state = 0; - f->pos = 0; - error = Platform_Identify(f->fd, &f->identity, Platform_FileIdentity__typ); - } + f->next = Files_files; + Files_files = f; + Heap_FileCount += 1; + Heap_RegisterFinalizer((void*)f, Files_Finalize); + f->state = 0; + f->pos = 0; + error = Platform_Identify(f->fd, &f->identity, Platform_FileIdentity__typ); } else { if (Platform_NoSuchDirectory(error)) { __MOVE("no such directory", err, 18); @@ -281,6 +270,27 @@ static void Files_Flush (Files_Buffer buf) } } +static void Files_CloseOSFile (Files_File f) +{ + Files_File prev = NIL; + INTEGER error; + if (Files_files == f) { + Files_files = f->next; + } else { + prev = Files_files; + while ((prev != NIL && prev->next != f)) { + prev = prev->next; + } + if (prev->next != NIL) { + prev->next = f->next; + } + } + error = Platform_Close(f->fd); + f->fd = -1; + f->state = 1; + Heap_FileCount -= 1; +} + void Files_Close (Files_File f) { LONGINT i; @@ -296,11 +306,7 @@ void Files_Close (Files_File f) if (error != 0) { Files_Err((CHAR*)"error writing file", (LONGINT)19, f, error); } - Files_fileTab[f->fd] = 0; - error = Platform_Close(f->fd); - f->fd = -1; - f->state = 1; - Heap_FileCount -= 1; + Files_CloseOSFile(f); } } @@ -316,7 +322,7 @@ Files_File Files_New (CHAR *name, LONGINT name__len) Files_File _o_result; Files_File f = NIL; __DUP(name, name__len, CHAR); - __NEW(f, Files_Handle); + __NEW(f, Files_FileDesc); f->workName[0] = 0x00; __COPY(name, f->registerName, ((LONGINT)(101))); f->fd = -1; @@ -392,10 +398,9 @@ static Files_File Files_CacheEntry (Platform_FileIdentity identity) Files_File _o_result; Files_File f = NIL; INTEGER i, error; - i = 0; - while (i < 256) { - f = (Files_File)(uintptr_t)Files_fileTab[i]; - if ((f != NIL && Platform_SameFile(identity, f->identity))) { + f = Files_files; + while (f != NIL) { + if (Platform_SameFile(identity, f->identity)) { if (!Platform_SameFileTime(identity, f->identity)) { i = 0; while (i < 4) { @@ -412,7 +417,7 @@ static Files_File Files_CacheEntry (Platform_FileIdentity identity) _o_result = f; return _o_result; } - i += 1; + f = f->next; } _o_result = NIL; return _o_result; @@ -442,16 +447,8 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) for (;;) { error = Platform_OldRW((void*)path, ((LONGINT)(256)), &fd); done = error == 0; - if ((!done && Platform_TooManyFiles(error)) || (done && fd >= 256)) { - if ((done && fd >= 256)) { - error = Platform_Close(fd); - } - Heap_GC(1); - error = Platform_OldRW((void*)path, ((LONGINT)(256)), &fd); - done = error == 0; - if ((!done && Platform_TooManyFiles(error))) { - Files_Err((CHAR*)"too many files open", (LONGINT)20, f, error); - } + if ((!done && Platform_TooManyFiles(error))) { + Files_Err((CHAR*)"too many files open", (LONGINT)20, f, error); } if ((!done && Platform_Inaccessible(error))) { error = Platform_OldRO((void*)path, ((LONGINT)(256)), &fd); @@ -468,17 +465,11 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) error = Platform_Identify(fd, &identity, Platform_FileIdentity__typ); f = Files_CacheEntry(identity); if (f != NIL) { - error = Platform_Close(fd); _o_result = f; __DEL(name); return _o_result; - } else if (fd >= 256) { - error = Platform_Close(fd); - Files_Err((CHAR*)"too many files open", (LONGINT)20, f, 0); } else { - __NEW(f, Files_Handle); - Files_fileTab[fd] = (LONGINT)(uintptr_t)f; - Heap_FileCount += 1; + __NEW(f, Files_FileDesc); Heap_RegisterFinalizer((void*)f, Files_Finalize); f->fd = fd; f->state = 0; @@ -489,6 +480,9 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) f->registerName[0] = 0x00; f->tempFile = 0; f->identity = identity; + f->next = Files_files; + Files_files = f; + Heap_FileCount += 1; _o_result = f; __DEL(name); return _o_result; @@ -1014,10 +1008,7 @@ static void Files_Finalize (SYSTEM_PTR o) LONGINT res; f = (Files_File)(uintptr_t)o; if (f->fd >= 0) { - Files_fileTab[f->fd] = 0; - res = Platform_Close(f->fd); - f->fd = -1; - Heap_FileCount -= 1; + Files_CloseOSFile(f); if (f->tempFile) { res = Platform_Unlink((void*)f->workName, ((LONGINT)(101))); } @@ -1036,27 +1027,13 @@ void Files_SetSearchPath (CHAR *path, LONGINT path__len) __DEL(path); } -static void Files_Init (void) -{ - LONGINT i; - i = 0; - while (i < 256) { - Files_fileTab[i] = 0; - i += 1; - } - Files_tempno = -1; - Heap_FileCount = 0; - Files_SearchPath = NIL; - Files_HOME[0] = 0x00; - Platform_GetEnv((CHAR*)"HOME", (LONGINT)5, (void*)Files_HOME, ((LONGINT)(1024))); -} - static void EnumPtrs(void (*P)(void*)) { + P(Files_files); P(Files_SearchPath); } -__TDESC(Files_Handle, 1, 4) = {__TDFLDS("Handle", 256), {236, 240, 244, 248, -20}}; +__TDESC(Files_FileDesc, 1, 5) = {__TDFLDS("FileDesc", 260), {236, 240, 244, 248, 256, -24}}; __TDESC(Files_BufDesc, 1, 1) = {__TDFLDS("BufDesc", 4112), {0, -8}}; __TDESC(Files_Rider, 1, 1) = {__TDFLDS("Rider", 20), {8, -8}}; @@ -1069,10 +1046,13 @@ export void *Files__init(void) __MODULE_IMPORT(Platform); __MODULE_IMPORT(Strings); __REGMOD("Files", EnumPtrs); - __INITYP(Files_Handle, Files_Handle, 0); + __INITYP(Files_FileDesc, Files_FileDesc, 0); __INITYP(Files_BufDesc, Files_BufDesc, 0); __INITYP(Files_Rider, Files_Rider, 0); /* BEGIN */ - Files_Init(); + Files_tempno = -1; + Heap_FileCount = 0; + Files_HOME[0] = 0x00; + Platform_GetEnv((CHAR*)"HOME", (LONGINT)5, (void*)Files_HOME, ((LONGINT)(1024))); __ENDMOD; } diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index cac52834..4a470229 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h @@ -6,14 +6,14 @@ #include "SYSTEM.h" typedef - struct Files_Handle *Files_File; + struct Files_FileDesc *Files_File; typedef - struct Files_Handle { + struct Files_FileDesc { char _prvt0[224]; LONGINT fd; - char _prvt1[28]; - } Files_Handle; + char _prvt1[32]; + } Files_FileDesc; typedef struct Files_Rider { @@ -24,7 +24,7 @@ typedef -import LONGINT *Files_Handle__typ; +import LONGINT *Files_FileDesc__typ; import LONGINT *Files_Rider__typ; import Files_File Files_Base (Files_Rider *r, LONGINT *r__typ); diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index d6248ab0..6888d3b4 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin tskSfF */ #include "SYSTEM.h" struct Heap__1 { diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index a7c115d1..4d58aaa0 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index 5e0ba69f..4051a16b 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Heap.h" diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index 2387f45f..674b8179 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index a69a396f..d5151e32 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index 9391eccb..077cea05 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 81cadc05..358871cb 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "OPM.h" diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index 27fe129c..8bf1d703 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 05ec3144..b3849a7b 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index c5e413a3..58dd953e 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index 877f2dc0..dddb24bb 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPB.h" #include "OPM.h" diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index c7a155eb..51c1177d 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index e4fb2cf6..5d3430ff 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index 73fb31d0..2c8af702 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 34c1acb6..8e4c0838 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index 998a6db8..0e0961c2 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index 1c086988..552dde2e 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPC.h" #include "OPM.h" diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index c9a566de..99e51118 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 8de5b802..3ba426f1 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index c72e975f..a912723a 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 146ece15..9174951e 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index 79518e88..d68a783e 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index 5ea5720d..0236f251 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index 3a8ef7a3..db08524a 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index 6e92e862..107d4836 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Files.h" #include "Modules.h" diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index 169fe56b..612534d4 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/Vishap.c b/bootstrap/windows-48/Vishap.c index a5d922e9..8b14dc22 100644 --- a/bootstrap/windows-48/Vishap.c +++ b/bootstrap/windows-48/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkamSf */ #include "SYSTEM.h" #include "Configuration.h" #include "Heap.h" diff --git a/bootstrap/windows-48/errors.c b/bootstrap/windows-48/errors.c index e8272348..918c86fe 100644 --- a/bootstrap/windows-48/errors.c +++ b/bootstrap/windows-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/windows-48/errors.h b/bootstrap/windows-48/errors.h index 7a085f56..3762b03f 100644 --- a/bootstrap/windows-48/errors.h +++ b/bootstrap/windows-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index 646b357b..fb1322bb 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index 1c63c923..2530385b 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/vt100.c b/bootstrap/windows-48/vt100.c index 67bed77e..0697fe1d 100644 --- a/bootstrap/windows-48/vt100.c +++ b/bootstrap/windows-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Strings.h" diff --git a/bootstrap/windows-48/vt100.h b/bootstrap/windows-48/vt100.h index 83c4e777..bb6e8f9c 100644 --- a/bootstrap/windows-48/vt100.h +++ b/bootstrap/windows-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index bdec7223..5ba6cdf8 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -14,6 +14,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/07/19] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/07/21] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index 00d35df8..4d9593cc 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Console.c b/bootstrap/windows-88/Console.c index 82ab9c30..2ad8373b 100644 --- a/bootstrap/windows-88/Console.c +++ b/bootstrap/windows-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Platform.h" diff --git a/bootstrap/windows-88/Console.h b/bootstrap/windows-88/Console.h index ae5997db..d1875d91 100644 --- a/bootstrap/windows-88/Console.h +++ b/bootstrap/windows-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index cdaf4440..752e5c07 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin tspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -8,7 +8,7 @@ #include "Strings.h" typedef - struct Files_Handle *Files_File; + struct Files_FileDesc *Files_File; typedef struct Files_BufDesc { @@ -25,14 +25,15 @@ typedef CHAR Files_FileName[101]; typedef - struct Files_Handle { + struct Files_FileDesc { Files_FileName workName, registerName; BOOLEAN tempFile; Platform_FileIdentity identity; LONGINT fd, len, pos; Files_Buffer bufs[4]; INTEGER swapper, state; - } Files_Handle; + Files_File next; + } Files_FileDesc; typedef struct Files_Rider { @@ -43,7 +44,7 @@ typedef } Files_Rider; -static LONGINT Files_fileTab[256]; +static Files_File Files_files; static INTEGER Files_tempno; static CHAR Files_HOME[1024]; static struct { @@ -51,7 +52,7 @@ static struct { CHAR data[1]; } *Files_SearchPath; -export LONGINT *Files_Handle__typ; +export LONGINT *Files_FileDesc__typ; export LONGINT *Files_BufDesc__typ; export LONGINT *Files_Rider__typ; @@ -59,6 +60,7 @@ export Files_File Files_Base (Files_Rider *r, LONGINT *r__typ); static Files_File Files_CacheEntry (Platform_FileIdentity identity); export void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INTEGER *res); export void Files_Close (Files_File f); +static void Files_CloseOSFile (Files_File f); static void Files_Create (Files_File f); export void Files_Delete (CHAR *name, LONGINT name__len, INTEGER *res); static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INTEGER errcode); @@ -69,7 +71,6 @@ export void Files_GetDate (Files_File f, LONGINT *t, LONGINT *d); export void Files_GetName (Files_File f, CHAR *name, LONGINT name__len); static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *name, LONGINT name__len); static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len); -static void Files_Init (void); export LONGINT Files_Length (Files_File f); static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT name__len, CHAR *dest, LONGINT dest__len); export Files_File Files_New (CHAR *name, LONGINT name__len); @@ -226,26 +227,14 @@ static void Files_Create (Files_File f) error = Platform_Unlink((void*)f->workName, ((LONGINT)(101))); error = Platform_New((void*)f->workName, ((LONGINT)(101)), &f->fd); done = error == 0; - if ((!done && Platform_TooManyFiles(error)) || (done && f->fd >= 256)) { - if ((done && f->fd >= 256)) { - error = Platform_Close(f->fd); - } - Heap_GC(1); - error = Platform_New((void*)f->workName, ((LONGINT)(101)), &f->fd); - done = f->fd == 0; - } if (done) { - if (f->fd >= 256) { - error = Platform_Close(f->fd); - Files_Err((CHAR*)"too many files open", (LONGINT)20, f, 0); - } else { - Files_fileTab[f->fd] = (LONGINT)(uintptr_t)f; - Heap_FileCount += 1; - Heap_RegisterFinalizer((void*)f, Files_Finalize); - f->state = 0; - f->pos = 0; - error = Platform_Identify(f->fd, &f->identity, Platform_FileIdentity__typ); - } + f->next = Files_files; + Files_files = f; + Heap_FileCount += 1; + Heap_RegisterFinalizer((void*)f, Files_Finalize); + f->state = 0; + f->pos = 0; + error = Platform_Identify(f->fd, &f->identity, Platform_FileIdentity__typ); } else { if (Platform_NoSuchDirectory(error)) { __MOVE("no such directory", err, 18); @@ -282,6 +271,27 @@ static void Files_Flush (Files_Buffer buf) } } +static void Files_CloseOSFile (Files_File f) +{ + Files_File prev = NIL; + INTEGER error; + if (Files_files == f) { + Files_files = f->next; + } else { + prev = Files_files; + while ((prev != NIL && prev->next != f)) { + prev = prev->next; + } + if (prev->next != NIL) { + prev->next = f->next; + } + } + error = Platform_Close(f->fd); + f->fd = -1; + f->state = 1; + Heap_FileCount -= 1; +} + void Files_Close (Files_File f) { LONGINT i; @@ -297,11 +307,7 @@ void Files_Close (Files_File f) if (error != 0) { Files_Err((CHAR*)"error writing file", (LONGINT)19, f, error); } - Files_fileTab[f->fd] = 0; - error = Platform_Close(f->fd); - f->fd = -1; - f->state = 1; - Heap_FileCount -= 1; + Files_CloseOSFile(f); } } @@ -317,7 +323,7 @@ Files_File Files_New (CHAR *name, LONGINT name__len) Files_File _o_result; Files_File f = NIL; __DUP(name, name__len, CHAR); - __NEW(f, Files_Handle); + __NEW(f, Files_FileDesc); f->workName[0] = 0x00; __COPY(name, f->registerName, ((LONGINT)(101))); f->fd = -1; @@ -393,10 +399,9 @@ static Files_File Files_CacheEntry (Platform_FileIdentity identity) Files_File _o_result; Files_File f = NIL; INTEGER i, error; - i = 0; - while (i < 256) { - f = (Files_File)(uintptr_t)Files_fileTab[i]; - if ((f != NIL && Platform_SameFile(identity, f->identity))) { + f = Files_files; + while (f != NIL) { + if (Platform_SameFile(identity, f->identity)) { if (!Platform_SameFileTime(identity, f->identity)) { i = 0; while (i < 4) { @@ -413,7 +418,7 @@ static Files_File Files_CacheEntry (Platform_FileIdentity identity) _o_result = f; return _o_result; } - i += 1; + f = f->next; } _o_result = NIL; return _o_result; @@ -443,16 +448,8 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) for (;;) { error = Platform_OldRW((void*)path, ((LONGINT)(256)), &fd); done = error == 0; - if ((!done && Platform_TooManyFiles(error)) || (done && fd >= 256)) { - if ((done && fd >= 256)) { - error = Platform_Close(fd); - } - Heap_GC(1); - error = Platform_OldRW((void*)path, ((LONGINT)(256)), &fd); - done = error == 0; - if ((!done && Platform_TooManyFiles(error))) { - Files_Err((CHAR*)"too many files open", (LONGINT)20, f, error); - } + if ((!done && Platform_TooManyFiles(error))) { + Files_Err((CHAR*)"too many files open", (LONGINT)20, f, error); } if ((!done && Platform_Inaccessible(error))) { error = Platform_OldRO((void*)path, ((LONGINT)(256)), &fd); @@ -469,17 +466,11 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) error = Platform_Identify(fd, &identity, Platform_FileIdentity__typ); f = Files_CacheEntry(identity); if (f != NIL) { - error = Platform_Close(fd); _o_result = f; __DEL(name); return _o_result; - } else if (fd >= 256) { - error = Platform_Close(fd); - Files_Err((CHAR*)"too many files open", (LONGINT)20, f, 0); } else { - __NEW(f, Files_Handle); - Files_fileTab[fd] = (LONGINT)(uintptr_t)f; - Heap_FileCount += 1; + __NEW(f, Files_FileDesc); Heap_RegisterFinalizer((void*)f, Files_Finalize); f->fd = fd; f->state = 0; @@ -490,6 +481,9 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) f->registerName[0] = 0x00; f->tempFile = 0; f->identity = identity; + f->next = Files_files; + Files_files = f; + Heap_FileCount += 1; _o_result = f; __DEL(name); return _o_result; @@ -1015,10 +1009,7 @@ static void Files_Finalize (SYSTEM_PTR o) LONGINT res; f = (Files_File)(uintptr_t)o; if (f->fd >= 0) { - Files_fileTab[f->fd] = 0; - res = Platform_Close(f->fd); - f->fd = -1; - Heap_FileCount -= 1; + Files_CloseOSFile(f); if (f->tempFile) { res = Platform_Unlink((void*)f->workName, ((LONGINT)(101))); } @@ -1037,27 +1028,13 @@ void Files_SetSearchPath (CHAR *path, LONGINT path__len) __DEL(path); } -static void Files_Init (void) -{ - LONGINT i; - i = 0; - while (i < 256) { - Files_fileTab[i] = 0; - i += 1; - } - Files_tempno = -1; - Heap_FileCount = 0; - Files_SearchPath = NIL; - Files_HOME[0] = 0x00; - Platform_GetEnv((CHAR*)"HOME", (LONGINT)5, (void*)Files_HOME, ((LONGINT)(1024))); -} - static void EnumPtrs(void (*P)(void*)) { + P(Files_files); P(Files_SearchPath); } -__TDESC(Files_Handle, 1, 4) = {__TDFLDS("Handle", 312), {272, 280, 288, 296, -40}}; +__TDESC(Files_FileDesc, 1, 5) = {__TDFLDS("FileDesc", 320), {272, 280, 288, 296, 312, -48}}; __TDESC(Files_BufDesc, 1, 1) = {__TDFLDS("BufDesc", 4128), {0, -16}}; __TDESC(Files_Rider, 1, 1) = {__TDFLDS("Rider", 40), {16, -16}}; @@ -1070,10 +1047,13 @@ export void *Files__init(void) __MODULE_IMPORT(Platform); __MODULE_IMPORT(Strings); __REGMOD("Files", EnumPtrs); - __INITYP(Files_Handle, Files_Handle, 0); + __INITYP(Files_FileDesc, Files_FileDesc, 0); __INITYP(Files_BufDesc, Files_BufDesc, 0); __INITYP(Files_Rider, Files_Rider, 0); /* BEGIN */ - Files_Init(); + Files_tempno = -1; + Heap_FileCount = 0; + Files_HOME[0] = 0x00; + Platform_GetEnv((CHAR*)"HOME", (LONGINT)5, (void*)Files_HOME, ((LONGINT)(1024))); __ENDMOD; } diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 03f88e71..5889b25b 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h @@ -7,14 +7,14 @@ #include "SYSTEM.h" typedef - struct Files_Handle *Files_File; + struct Files_FileDesc *Files_File; typedef - struct Files_Handle { + struct Files_FileDesc { char _prvt0[248]; LONGINT fd; - char _prvt1[56]; - } Files_Handle; + char _prvt1[64]; + } Files_FileDesc; typedef struct Files_Rider { @@ -25,7 +25,7 @@ typedef -import LONGINT *Files_Handle__typ; +import LONGINT *Files_FileDesc__typ; import LONGINT *Files_Rider__typ; import Files_File Files_Base (Files_Rider *r, LONGINT *r__typ); diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index 9122c75d..ab8bd793 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin tskSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index 070c972a..1a13a9af 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 0aae7575..d5411050 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index 39c8f674..e6254a2e 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index 592ee7e0..2b3ff4f7 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index 3e8819ed..8b8d0a4c 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index 008bc7ca..ebcd0651 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index a80eedad..1562be22 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index b5198578..40658c18 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index 56fcf196..7d4b03b1 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index 3adde5cb..a01ab45f 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPB.h" diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index 71e6e1fb..3df6ebfe 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index 8e85be6e..c89a1322 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin tspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index dfa2d800..1ce9683e 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index 57333946..a1ef6cf9 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 7f7aff33..6f5f182a 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 1091acf3..dbdc1868 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPC.h" diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index 0370a1d7..1963d30e 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 3d29e466..6c415d24 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index a15fd477..c6f87611 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 911df230..b82cd526 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index f166c1b9..61320bbb 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index e767e842..090e4a68 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index 94a70d57..b09d7336 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index f5efee7c..a489adbb 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Files.h" diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index 5d8e0c33..1aaf0c32 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/Vishap.c b/bootstrap/windows-88/Vishap.c index 822287a3..37d64ec3 100644 --- a/bootstrap/windows-88/Vishap.c +++ b/bootstrap/windows-88/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkamSf */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/windows-88/errors.c b/bootstrap/windows-88/errors.c index a54d8e43..3e819c0b 100644 --- a/bootstrap/windows-88/errors.c +++ b/bootstrap/windows-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/windows-88/errors.h b/bootstrap/windows-88/errors.h index 205ba3a1..14e6456a 100644 --- a/bootstrap/windows-88/errors.h +++ b/bootstrap/windows-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index 327aeac4..816ab551 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index f19d95a4..d9e89e69 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/vt100.c b/bootstrap/windows-88/vt100.c index 4b742768..8a30b13f 100644 --- a/bootstrap/windows-88/vt100.c +++ b/bootstrap/windows-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/windows-88/vt100.h b/bootstrap/windows-88/vt100.h index dd08fa37..49a57eb4 100644 --- a/bootstrap/windows-88/vt100.h +++ b/bootstrap/windows-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/src/system/Files.Mod b/src/system/Files.Mod index 73a78028..02bc69fc 100644 --- a/src/system/Files.Mod +++ b/src/system/Files.Mod @@ -16,7 +16,6 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files CONST nofbufs = 4; bufsize = 4096; - fileTabSize = 256; (* 256 needed for Windows *) noDesc = -1; notDone = -1; @@ -31,17 +30,18 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files TYPE FileName = ARRAY 101 OF CHAR; - File* = POINTER TO Handle; + File* = POINTER TO FileDesc; Buffer = POINTER TO BufDesc; - Handle = RECORD + FileDesc = RECORD workName, registerName: FileName; tempFile: BOOLEAN; identity: Platform.FileIdentity; fd-: Platform.FileHandle; len, pos: LONGINT; bufs: ARRAY nofbufs OF Buffer; - swapper, state: INTEGER + swapper, state: INTEGER; + next: File; END; BufDesc = RECORD @@ -61,7 +61,7 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files VAR - fileTab: ARRAY fileTabSize OF LONGINT (*=File*); + files: File; (* List of files that have an OS file handle/descriptor assigned *) tempno: INTEGER; HOME: ARRAY 1024 OF CHAR; SearchPath: POINTER TO ARRAY OF CHAR; @@ -137,30 +137,16 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files error := Platform.New(f.workName, f.fd); done := error = 0; - (* In case of too many files, try just once more. *) - IF (~done & Platform.TooManyFiles(error)) OR (done & (f.fd >= fileTabSize)) THEN - IF done & (f.fd >= fileTabSize) THEN error := Platform.Close(f.fd) END; - Heap.GC(TRUE); - error := Platform.New(f.workName, f.fd); - done := f.fd = 0 - END; IF done THEN - IF f.fd >= fileTabSize THEN - (* Console.String("f.fd = "); Console.Int(f.fd,1); Console.Ln; *) - error := Platform.Close(f.fd); Err("too many files open", f, 0) - ELSE - fileTab[f.fd] := SYSTEM.VAL(LONGINT, f); - INC(Heap.FileCount); - Heap.RegisterFinalizer(f, Finalize); - f.state := open; - f.pos := 0; - error := Platform.Identify(f.fd, f.identity); - END + f.next := files; files := f; + INC(Heap.FileCount); + Heap.RegisterFinalizer(f, Finalize); + f.state := open; + f.pos := 0; + error := Platform.Identify(f.fd, f.identity); ELSE IF Platform.NoSuchDirectory(error) THEN err := "no such directory" - ELSIF Platform.TooManyFiles(error) THEN - (* Console.String("f.fd = "); Console.Int(f.fd,1); Console.Ln; *) - err := "too many files open" + ELSIF Platform.TooManyFiles(error) THEN err := "too many files open" ELSE err := "file not created" END; Err(err, f, error) @@ -201,30 +187,33 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files END END Flush; + + PROCEDURE CloseOSFile(f: File); + (* Close the OS file handle and remove f from 'files' *) + VAR prev: File; error: Platform.ErrorCode; + BEGIN + IF files = f THEN files := f.next + ELSE + prev := files; + WHILE (prev # NIL) & (prev.next # f) DO prev := prev.next END; + IF prev.next # NIL THEN prev.next := f.next END + END; + error := Platform.Close(f.fd); + f.fd := noDesc; f.state := create; DEC(Heap.FileCount); + END CloseOSFile; + + PROCEDURE Close* (f: File); VAR i: LONGINT; error: Platform.ErrorCode; BEGIN - (* - Console.String("Files.Close f.fd = "); Console.Int(f.fd,1); - Console.String(" f.registername = "); Console.String(f.registerName); - Console.String(", f.workName = "); Console.String(f.workName); Console.Ln; - *) IF (f.state # create) OR (f.registerName # "") THEN Create(f); i := 0; WHILE (i < nofbufs) & (f.bufs[i] # NIL) DO Flush(f.bufs[i]); INC(i) END; error := Platform.Sync(f.fd); - (* - Console.String("Syncing closed file. fd = "); Console.Int(f.fd, 1); - Console.String(" error = "); Console.Int(error,1); Console.Ln; - *) IF error # 0 THEN Err("error writing file", f, error) END; - (* Windows needs us to actually cose the file so that subsequent rename - will not encounter a sharing error. *) - fileTab[f.fd] := 0; - error := Platform.Close(f.fd); - f.fd := noDesc; f.state := create; DEC(Heap.FileCount); + CloseOSFile(f); END END Close; @@ -275,10 +264,9 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files PROCEDURE CacheEntry(identity: Platform.FileIdentity): File; VAR f: File; i: INTEGER; error: Platform.ErrorCode; - BEGIN i := 0; - WHILE i < fileTabSize DO - f := SYSTEM.VAL(File, fileTab[i]); - IF (f # NIL) & Platform.SameFile(identity, f.identity) THEN + BEGIN f := files; + WHILE f # NIL DO + IF Platform.SameFile(identity, f.identity) THEN IF ~Platform.SameFileTime(identity, f.identity) THEN i := 0; WHILE i < nofbufs DO IF f.bufs[i] # NIL THEN f.bufs[i].org := -1; f.bufs[i] := NIL END; @@ -289,7 +277,7 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files END; RETURN f END; - INC(i) + f := f.next END; RETURN NIL END CacheEntry; @@ -311,19 +299,11 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files END; LOOP error := Platform.OldRW(path, fd); done := error = 0; - IF (~done & Platform.TooManyFiles(error)) OR (done & (fd >= fileTabSize)) THEN - IF done & (fd >= fileTabSize) THEN error := Platform.Close(fd) END; - Heap.GC(TRUE); - error := Platform.OldRW(path, fd); done := error = 0; - IF ~done & Platform.TooManyFiles(error) THEN - (* Console.String("fd = "); Console.Int(fd,1); Console.Ln; *) - Err("too many files open", f, error) - END - END; + IF ~done & Platform.TooManyFiles(error) THEN Err("too many files open", f, error) END; IF ~done & Platform.Inaccessible(error) THEN error := Platform.OldRO(path, fd); done := error = 0; END; - IF (~done) & (~Platform.Absent(error)) THEN + IF ~done & ~Platform.Absent(error) THEN Console.String("Warning: Files.Old "); Console.String(name); Console.String(" error = "); Console.Int(error, 0); Console.Ln; END; @@ -331,16 +311,15 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files (* Console.String(" fd = "); Console.Int(fd,1); Console.Ln; *) error := Platform.Identify(fd, identity); f := CacheEntry(identity); - IF f # NIL THEN error := Platform.Close(fd); RETURN f - ELSIF fd >= fileTabSize THEN - (* Console.String("fd = "); Console.Int(fd,1); Console.Ln; *) - error := Platform.Close(fd); - Err("too many files open", f, 0) - ELSE NEW(f); fileTab[fd] := SYSTEM.VAL(LONGINT, f); INC(Heap.FileCount); Heap.RegisterFinalizer(f, Finalize); + IF f # NIL THEN + (* error := Platform.Close(fd); DCWB: Either this should be removed or should call CloseOSFile. *) + RETURN f + ELSE NEW(f); Heap.RegisterFinalizer(f, Finalize); f.fd := fd; f.state := open; f.pos := 0; f.swapper := -1; (*all f.buf[i] = NIL*) error := Platform.Size(fd, f.len); COPY(name, f.workName); f.registerName := ""; f.tempFile := FALSE; f.identity := identity; + f.next := files; files := f; INC(Heap.FileCount); RETURN f END ELSIF dir = "" THEN RETURN NIL @@ -743,7 +722,7 @@ Especially Length would become fairly complex. Console.String(", f.workName = "); Console.String(f.workName); Console.Ln; *) IF f.fd >= 0 THEN - fileTab[f.fd] := 0; res := Platform.Close(f.fd); f.fd := -1; DEC(Heap.FileCount); + CloseOSFile(f); IF f.tempFile THEN res := Platform.Unlink(f.workName) END END END Finalize; @@ -758,15 +737,9 @@ Especially Length would become fairly complex. END END SetSearchPath; - PROCEDURE Init; - VAR i: LONGINT; - BEGIN - i := 0; WHILE i < fileTabSize DO fileTab[i] := 0; INC(i) END; - tempno := -1; - Heap.FileCount := 0; - SearchPath := NIL; - HOME := ""; Platform.GetEnv("HOME", HOME); - END Init; -BEGIN Init +BEGIN + tempno := -1; + Heap.FileCount := 0; + HOME := ""; Platform.GetEnv("HOME", HOME); END Files. From 61eb8199d47e6aa6f25e09dfab621e856afce57d Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 21 Jul 2016 12:39:10 +0100 Subject: [PATCH 186/580] Make autobuild use latest changed branch. --- src/tools/make/buildall.pl | 2 ++ src/tools/make/postpush.pl | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/tools/make/buildall.pl b/src/tools/make/buildall.pl index 19d8fc80..3363bbc4 100755 --- a/src/tools/make/buildall.pl +++ b/src/tools/make/buildall.pl @@ -6,6 +6,8 @@ use Cwd; my $branch = "master"; +if (defined($ARGV[0]) && ($ARGV[0] ne "")) {$branch = $ARGV[0]} + my %machines = ( "pi" => ['pi@pie', "sudo", "projects/oberon/vishap/voc", "make full"], "darwin" => ['dave@dcb', "sudo", "projects/oberon/vishap/voc", "make full"], diff --git a/src/tools/make/postpush.pl b/src/tools/make/postpush.pl index 2b3a2ad6..85cde3b7 100755 --- a/src/tools/make/postpush.pl +++ b/src/tools/make/postpush.pl @@ -36,7 +36,6 @@ for my $file (@{$modified}) { if ($buildneeded) { writelog "Post push github web hook for repository $repo, branch $branch, name $name. Build required."; - my $child = fork; if (not defined $child) {die "Fork failed.";} if ($child) { @@ -45,7 +44,7 @@ if ($buildneeded) { close(STDIN); close(STDOUT); close(STDERR); # child process system 'echo Syncing voc>postpush.log'; system '(cd voc && git pull) >>postpush.log'; - exec 'perl voc/src/tools/make/buildall.pl >/tmp/buildall.log'; + exec 'perl voc/src/tools/make/buildall.pl $branch >/tmp/buildall.log'; exit; } } else { From ff9a45bc1ad850125ca2abf86105b24fc638b65e Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 21 Jul 2016 12:49:27 +0100 Subject: [PATCH 187/580] postpush.pl must pull latest changed branch to get appropriate buildall.pl. --- src/tools/make/postpush.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/make/postpush.pl b/src/tools/make/postpush.pl index 85cde3b7..fc4b0efe 100755 --- a/src/tools/make/postpush.pl +++ b/src/tools/make/postpush.pl @@ -43,7 +43,7 @@ if ($buildneeded) { } else { close(STDIN); close(STDOUT); close(STDERR); # child process system 'echo Syncing voc>postpush.log'; - system '(cd voc && git pull) >>postpush.log'; + system '(cd voc && git pull && git checkout $branch) >>postpush.log'; exec 'perl voc/src/tools/make/buildall.pl $branch >/tmp/buildall.log'; exit; } From 0d988a8ea06555c78a25e33aff27f1e0f418d8b8 Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 21 Jul 2016 12:56:10 +0100 Subject: [PATCH 188/580] postpush.pl fix branch passed to buildall. --- src/tools/make/postpush.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/make/postpush.pl b/src/tools/make/postpush.pl index fc4b0efe..b9b60c14 100755 --- a/src/tools/make/postpush.pl +++ b/src/tools/make/postpush.pl @@ -43,7 +43,7 @@ if ($buildneeded) { } else { close(STDIN); close(STDOUT); close(STDERR); # child process system 'echo Syncing voc>postpush.log'; - system '(cd voc && git pull && git checkout $branch) >>postpush.log'; + system '(cd voc; git pull; git checkout ' . $branch . ') >>postpush.log'; exec 'perl voc/src/tools/make/buildall.pl $branch >/tmp/buildall.log'; exit; } From d43279d0538f71fb0a359ca5fabed78df63fdca5 Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 21 Jul 2016 13:58:46 +0100 Subject: [PATCH 189/580] postpushpl fix buildall parameter (yes, again). --- src/tools/make/postpush.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/make/postpush.pl b/src/tools/make/postpush.pl index b9b60c14..a65fbb86 100755 --- a/src/tools/make/postpush.pl +++ b/src/tools/make/postpush.pl @@ -44,7 +44,7 @@ if ($buildneeded) { close(STDIN); close(STDOUT); close(STDERR); # child process system 'echo Syncing voc>postpush.log'; system '(cd voc; git pull; git checkout ' . $branch . ') >>postpush.log'; - exec 'perl voc/src/tools/make/buildall.pl $branch >/tmp/buildall.log'; + exec 'perl voc/src/tools/make/buildall.pl ' . $branch . ' >/tmp/buildall.log'; exit; } } else { From d9c319ef3a221fb67eece291a47086761e1874b4 Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 22 Jul 2016 14:25:39 +0100 Subject: [PATCH 190/580] Fix initial Time() value and fix GetTimeOfDay on Windows. Thanks Oleg. --- src/system/Platformunix.Mod | 3 +-- src/system/Platformwindows.Mod | 20 +++++++++++++------- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/system/Platformunix.Mod b/src/system/Platformunix.Mod index fbb015e8..6da2b7d7 100644 --- a/src/system/Platformunix.Mod +++ b/src/system/Platformunix.Mod @@ -537,7 +537,7 @@ BEGIN HaltCode := -128; HaltHandler := NIL; - TimeStart := Time(); + TimeStart := 0; TimeStart := Time(); CWD := ""; getcwd(CWD); PID := getpid(); @@ -548,4 +548,3 @@ BEGIN nl[0] := 0AX; (* LF *) nl[1] := 0X; END Platform. - diff --git a/src/system/Platformwindows.Mod b/src/system/Platformwindows.Mod index c9b67b7c..0e30e3f9 100644 --- a/src/system/Platformwindows.Mod +++ b/src/system/Platformwindows.Mod @@ -232,11 +232,6 @@ BEGIN YMDHMStoClock(styear(), stmon(), stmday(), sthour(), stmin(), stsec(), t, d); END GetClock; -PROCEDURE GetTimeOfDay*(VAR sec, usec: LONGINT); -BEGIN - getLocalTime; sec := stsec(); usec := LONG(stmsec()) * 1000; -END GetTimeOfDay; - PROCEDURE -GetTickCount(): LONGINT "(LONGINT)(uint32_t)GetTickCount()"; PROCEDURE Time*(): LONGINT; @@ -256,6 +251,18 @@ BEGIN END Delay; +PROCEDURE -stToFt "FILETIME ft; SystemTimeToFileTime(&st, &ft)"; +PROCEDURE -ftToUli "ULARGE_INTEGER ul; ul.LowPart=ft.dwLowDateTime; ul.HighPart=ft.dwHighDateTime"; +PROCEDURE -tous1970 "ul.QuadPart = (ul.QuadPart - 116444736000000000ULL)/10LL"; +PROCEDURE -ulSec(): LONGINT "(LONGINT)(ul.QuadPart / 1000000LL)"; +PROCEDURE -uluSec(): LONGINT "(LONGINT)(ul.QuadPart % 1000000LL)"; + +PROCEDURE GetTimeOfDay*(VAR sec, usec: LONGINT); +BEGIN + getLocalTime; stToFt; ftToUli; tous1970; + sec := ulSec(); usec := uluSec(); +END GetTimeOfDay; + (* System call *) @@ -592,7 +599,7 @@ BEGIN HaltCode := -128; HaltHandler := NIL; - TimeStart := Time(); + TimeStart := 0; TimeStart := Time(); CWD := ""; getCurrentDirectory(CWD); PID := getpid(); @@ -608,4 +615,3 @@ BEGIN nl[1] := 0AX; (* LF *) nl[2] := 0X; END Platform. - From 6d957bf0bba2b30769ba96fd271843292349ad60 Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 22 Jul 2016 18:56:14 +0100 Subject: [PATCH 191/580] Remove unused variable and export. Thanks Oleg. --- src/system/Heap.Mod | 18 +++++++++--------- src/system/SYSTEM.h | 1 - 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/system/Heap.Mod b/src/system/Heap.Mod index a323c785..73534c46 100644 --- a/src/system/Heap.Mod +++ b/src/system/Heap.Mod @@ -3,7 +3,7 @@ MODULE Heap; IMPORT SYSTEM; (* Cannot import anything else as heap initialization must complete before any other modules are initialized. *) - CONST + CONST ModNameLen = 20; CmdNameLen = 24; SZL = SIZE(LONGINT); @@ -124,8 +124,8 @@ MODULE Heap; VAR m: Module; BEGIN (* REGMOD is called at the start of module initialisation code before that modules - type descriptors have been set up. 'NEW' depends on the Heap modules type - descriptors being ready for use, therefore, just for the Heap module itself, we + type descriptors have been set up. 'NEW' depends on the Heap modules type + descriptors being ready for use, therefore, just for the Heap module itself, we must use SYSTEM.NEW. *) IF name = "Heap" THEN SYSTEM.NEW(m, SIZE(ModuleDesc)) @@ -142,7 +142,7 @@ MODULE Heap; VAR c: Cmd; BEGIN (* REGCMD is called during module initialisation code before that modules - type descriptors have been set up. 'NEW' depends on the Heap modules type + type descriptors have been set up. 'NEW' depends on the Heap modules type descriptors being ready for use, therefore, just for the commands registered by the Heap module itself, we must use SYSTEM.NEW. *) IF m.name = "Heap" THEN @@ -184,7 +184,7 @@ MODULE Heap; (* FetchAddress fetches a pointer from memory and returns it as a LONGINT. It works correctly regardless of the size of an address. Specifically on 32 bit address - architectures with 64 bit LONGINT, it loads 32 bits and extends it to LONGINT + architectures with 64 bit LONGINT, it loads 32 bits and extends it to LONGINT rather than loading 64 bits. *) PROCEDURE -FetchAddress(pointer: LONGINT): LONGINT "(LONGINT)(uintptr_t)(*((void**)((uintptr_t)pointer)))"; @@ -455,7 +455,7 @@ MODULE Heap; PROCEDURE CheckFin; VAR n: FinNode; tag: LONGINT; - BEGIN + BEGIN n := fin; WHILE n # NIL DO tag := FetchAddress(n.obj - SZL); @@ -475,7 +475,7 @@ MODULE Heap; n.finalize(SYSTEM.VAL(SYSTEM.PTR, n.obj)); (* new nodes may have been pushed in n.finalize, therefore: *) IF prev = NIL THEN n := fin ELSE n := n.next END - ELSE + ELSE prev := n; n := n.next END END @@ -497,7 +497,7 @@ MODULE Heap; VAR frame: SYSTEM.PTR; inc, nofcand: LONGINT; - sp, p, stack0, ptr: LONGINT; + sp, p, stack0: LONGINT; align: RECORD ch: CHAR; p: SYSTEM.PTR END ; BEGIN IF n > 0 THEN MarkStack(n-1, cand); (* flush register windows by means of recursive calls *) @@ -560,7 +560,7 @@ MODULE Heap; PROCEDURE RegisterFinalizer*(obj: SYSTEM.PTR; finalize: Finalizer); VAR f: FinNode; BEGIN NEW(f); - f.obj := SYSTEM.VAL(LONGINT, obj); f.finalize := finalize; f.marked := TRUE; + f.obj := SYSTEM.VAL(LONGINT, obj); f.finalize := finalize; f.marked := TRUE; f.next := fin; fin := f; END RegisterFinalizer; diff --git a/src/system/SYSTEM.h b/src/system/SYSTEM.h index 34b69a8a..949951ac 100644 --- a/src/system/SYSTEM.h +++ b/src/system/SYSTEM.h @@ -209,7 +209,6 @@ extern void Heap_INCREF(); // Main module initialisation, registration and finalisation extern void Platform_Init(INTEGER argc, LONGINT argv); -extern void *Platform_MainModule; extern void Heap_FINALL(); #define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (LONGINT)(uintptr_t)&argv); From b1dc7d77e882483be97db220001e852bdbb44a2f Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 22 Jul 2016 20:20:57 +0100 Subject: [PATCH 192/580] Update boostrap source --- bootstrap/unix-44/Configuration.c | 4 ++-- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Console.c | 2 +- bootstrap/unix-44/Console.h | 2 +- bootstrap/unix-44/Files.c | 2 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 4 ++-- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 2 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 2 +- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 2 +- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 2 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Platform.c | 3 ++- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/SYSTEM.h | 1 - bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/Vishap.c | 2 +- bootstrap/unix-44/errors.c | 2 +- bootstrap/unix-44/errors.h | 2 +- bootstrap/unix-44/extTools.c | 2 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-44/vt100.c | 2 +- bootstrap/unix-44/vt100.h | 2 +- bootstrap/unix-48/Configuration.c | 4 ++-- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Console.c | 2 +- bootstrap/unix-48/Console.h | 2 +- bootstrap/unix-48/Files.c | 2 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 4 ++-- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 2 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 2 +- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 2 +- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 2 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Platform.c | 3 ++- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/SYSTEM.h | 1 - bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/Vishap.c | 2 +- bootstrap/unix-48/errors.c | 2 +- bootstrap/unix-48/errors.h | 2 +- bootstrap/unix-48/extTools.c | 2 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-48/vt100.c | 2 +- bootstrap/unix-48/vt100.h | 2 +- bootstrap/unix-88/Configuration.c | 4 ++-- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Console.c | 2 +- bootstrap/unix-88/Console.h | 2 +- bootstrap/unix-88/Files.c | 2 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 4 ++-- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 2 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 2 +- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 2 +- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 2 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Platform.c | 3 ++- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/SYSTEM.h | 1 - bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/Vishap.c | 2 +- bootstrap/unix-88/errors.c | 2 +- bootstrap/unix-88/errors.h | 2 +- bootstrap/unix-88/extTools.c | 2 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/unix-88/vt100.c | 2 +- bootstrap/unix-88/vt100.h | 2 +- bootstrap/windows-48/Configuration.c | 4 ++-- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Console.c | 2 +- bootstrap/windows-48/Console.h | 2 +- bootstrap/windows-48/Files.c | 2 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 4 ++-- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 2 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 2 +- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 2 +- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 2 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Platform.c | 25 +++++++++++++++++-------- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/SYSTEM.h | 1 - bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/Vishap.c | 2 +- bootstrap/windows-48/errors.c | 2 +- bootstrap/windows-48/errors.h | 2 +- bootstrap/windows-48/extTools.c | 2 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-48/vt100.c | 2 +- bootstrap/windows-48/vt100.h | 2 +- bootstrap/windows-88/Configuration.c | 4 ++-- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Console.c | 2 +- bootstrap/windows-88/Console.h | 2 +- bootstrap/windows-88/Files.c | 2 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 4 ++-- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 2 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 2 +- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 2 +- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 2 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Platform.c | 25 +++++++++++++++++-------- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/SYSTEM.h | 1 - bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/Vishap.c | 2 +- bootstrap/windows-88/errors.c | 2 +- bootstrap/windows-88/errors.h | 2 +- bootstrap/windows-88/extTools.c | 2 +- bootstrap/windows-88/extTools.h | 2 +- bootstrap/windows-88/vt100.c | 2 +- bootstrap/windows-88/vt100.h | 2 +- src/test/confidence/testresult.sh | 3 ++- 201 files changed, 242 insertions(+), 225 deletions(-) diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index 532bfc28..c4a99497 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -13,6 +13,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/07/21] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/07/22] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index 9c7095b9..9ccb175b 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Console.c b/bootstrap/unix-44/Console.c index 2119fef2..529459d3 100644 --- a/bootstrap/unix-44/Console.c +++ b/bootstrap/unix-44/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Platform.h" diff --git a/bootstrap/unix-44/Console.h b/bootstrap/unix-44/Console.h index 8558cf0e..fe4dd1e8 100644 --- a/bootstrap/unix-44/Console.h +++ b/bootstrap/unix-44/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 4834d8bc..564d7975 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index dbc01a40..2539b65b 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index 6888d3b4..2cb7c777 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin tskSfF */ #include "SYSTEM.h" struct Heap__1 { @@ -579,7 +579,7 @@ void Heap_FINALL (void) static void Heap_MarkStack (LONGINT n, LONGINT *cand, LONGINT cand__len) { SYSTEM_PTR frame; - LONGINT inc, nofcand, sp, p, stack0, ptr; + LONGINT inc, nofcand, sp, p, stack0; struct Heap__1 align; if (n > 0) { Heap_MarkStack(n - 1, cand, cand__len); diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index 4d58aaa0..7e1bfa5e 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index 4051a16b..94c48dac 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Heap.h" diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index 674b8179..10f4d96d 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index d5151e32..ea10b5d7 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index 077cea05..4a0aad65 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 358871cb..58a32122 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "OPM.h" diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index 8bf1d703..90b9b2b9 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index b3849a7b..8016a6bb 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index 58dd953e..fc3808a8 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index dddb24bb..d6930745 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPB.h" #include "OPM.h" diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index 51c1177d..00534e5c 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index 5d3430ff..3be820a5 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index 2c8af702..3cd6b899 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index 8e4c0838..e91a1a68 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index 0e0961c2..0035ead1 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index 552dde2e..96f02b38 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPC.h" #include "OPM.h" diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index 99e51118..a4f208c5 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 351690cc..2baa87e7 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef @@ -779,6 +779,7 @@ export void *Platform__init(void) Platform_TestLittleEndian(); Platform_HaltCode = -128; Platform_HaltHandler = NIL; + Platform_TimeStart = 0; Platform_TimeStart = Platform_Time(); Platform_CWD[0] = 0x00; Platform_getcwd((void*)Platform_CWD, ((LONGINT)(256))); diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index 7f649145..7bc6a7f9 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 9174951e..1ebd0438 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index d68a783e..ae81f6e7 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/SYSTEM.h b/bootstrap/unix-44/SYSTEM.h index 34b69a8a..949951ac 100644 --- a/bootstrap/unix-44/SYSTEM.h +++ b/bootstrap/unix-44/SYSTEM.h @@ -209,7 +209,6 @@ extern void Heap_INCREF(); // Main module initialisation, registration and finalisation extern void Platform_Init(INTEGER argc, LONGINT argv); -extern void *Platform_MainModule; extern void Heap_FINALL(); #define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (LONGINT)(uintptr_t)&argv); diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index 0236f251..6ecc5e7b 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index db08524a..ee20ae49 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index 3303218b..a985d2fc 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Files.h" #include "Modules.h" diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index 8818827b..454de29e 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/Vishap.c b/bootstrap/unix-44/Vishap.c index 8b14dc22..4660166b 100644 --- a/bootstrap/unix-44/Vishap.c +++ b/bootstrap/unix-44/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkamSf */ #include "SYSTEM.h" #include "Configuration.h" #include "Heap.h" diff --git a/bootstrap/unix-44/errors.c b/bootstrap/unix-44/errors.c index 918c86fe..0122b025 100644 --- a/bootstrap/unix-44/errors.c +++ b/bootstrap/unix-44/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/unix-44/errors.h b/bootstrap/unix-44/errors.h index 3762b03f..94835309 100644 --- a/bootstrap/unix-44/errors.h +++ b/bootstrap/unix-44/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index fb1322bb..e53881fe 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index 2530385b..e393ad88 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-44/vt100.c b/bootstrap/unix-44/vt100.c index 0697fe1d..f905ffc7 100644 --- a/bootstrap/unix-44/vt100.c +++ b/bootstrap/unix-44/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Strings.h" diff --git a/bootstrap/unix-44/vt100.h b/bootstrap/unix-44/vt100.h index bb6e8f9c..2af72bac 100644 --- a/bootstrap/unix-44/vt100.h +++ b/bootstrap/unix-44/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index 532bfc28..c4a99497 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -13,6 +13,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/07/21] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/07/22] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index 9c7095b9..9ccb175b 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Console.c b/bootstrap/unix-48/Console.c index 2119fef2..529459d3 100644 --- a/bootstrap/unix-48/Console.c +++ b/bootstrap/unix-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Platform.h" diff --git a/bootstrap/unix-48/Console.h b/bootstrap/unix-48/Console.h index 8558cf0e..fe4dd1e8 100644 --- a/bootstrap/unix-48/Console.h +++ b/bootstrap/unix-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 4834d8bc..564d7975 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index dbc01a40..2539b65b 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index 6888d3b4..2cb7c777 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin tskSfF */ #include "SYSTEM.h" struct Heap__1 { @@ -579,7 +579,7 @@ void Heap_FINALL (void) static void Heap_MarkStack (LONGINT n, LONGINT *cand, LONGINT cand__len) { SYSTEM_PTR frame; - LONGINT inc, nofcand, sp, p, stack0, ptr; + LONGINT inc, nofcand, sp, p, stack0; struct Heap__1 align; if (n > 0) { Heap_MarkStack(n - 1, cand, cand__len); diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index 4d58aaa0..7e1bfa5e 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index 4051a16b..94c48dac 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Heap.h" diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index 674b8179..10f4d96d 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index d5151e32..ea10b5d7 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index 077cea05..4a0aad65 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 358871cb..58a32122 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "OPM.h" diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index 8bf1d703..90b9b2b9 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index b3849a7b..8016a6bb 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index 58dd953e..fc3808a8 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index dddb24bb..d6930745 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPB.h" #include "OPM.h" diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index 51c1177d..00534e5c 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index 5d3430ff..3be820a5 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index 2c8af702..3cd6b899 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 8e4c0838..e91a1a68 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index 0e0961c2..0035ead1 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index 552dde2e..96f02b38 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPC.h" #include "OPM.h" diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index 99e51118..a4f208c5 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 351690cc..2baa87e7 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef @@ -779,6 +779,7 @@ export void *Platform__init(void) Platform_TestLittleEndian(); Platform_HaltCode = -128; Platform_HaltHandler = NIL; + Platform_TimeStart = 0; Platform_TimeStart = Platform_Time(); Platform_CWD[0] = 0x00; Platform_getcwd((void*)Platform_CWD, ((LONGINT)(256))); diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index 7f649145..7bc6a7f9 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 9174951e..1ebd0438 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index d68a783e..ae81f6e7 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/SYSTEM.h b/bootstrap/unix-48/SYSTEM.h index 34b69a8a..949951ac 100644 --- a/bootstrap/unix-48/SYSTEM.h +++ b/bootstrap/unix-48/SYSTEM.h @@ -209,7 +209,6 @@ extern void Heap_INCREF(); // Main module initialisation, registration and finalisation extern void Platform_Init(INTEGER argc, LONGINT argv); -extern void *Platform_MainModule; extern void Heap_FINALL(); #define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (LONGINT)(uintptr_t)&argv); diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index 0236f251..6ecc5e7b 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index db08524a..ee20ae49 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index 107d4836..43955368 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Files.h" #include "Modules.h" diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index 612534d4..928de612 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/Vishap.c b/bootstrap/unix-48/Vishap.c index 8b14dc22..4660166b 100644 --- a/bootstrap/unix-48/Vishap.c +++ b/bootstrap/unix-48/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkamSf */ #include "SYSTEM.h" #include "Configuration.h" #include "Heap.h" diff --git a/bootstrap/unix-48/errors.c b/bootstrap/unix-48/errors.c index 918c86fe..0122b025 100644 --- a/bootstrap/unix-48/errors.c +++ b/bootstrap/unix-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/unix-48/errors.h b/bootstrap/unix-48/errors.h index 3762b03f..94835309 100644 --- a/bootstrap/unix-48/errors.h +++ b/bootstrap/unix-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index fb1322bb..e53881fe 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index 2530385b..e393ad88 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/vt100.c b/bootstrap/unix-48/vt100.c index 0697fe1d..f905ffc7 100644 --- a/bootstrap/unix-48/vt100.c +++ b/bootstrap/unix-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Strings.h" diff --git a/bootstrap/unix-48/vt100.h b/bootstrap/unix-48/vt100.h index bb6e8f9c..2af72bac 100644 --- a/bootstrap/unix-48/vt100.h +++ b/bootstrap/unix-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index 5ba6cdf8..ab2d4040 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -14,6 +14,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/07/21] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/07/22] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index 4d9593cc..932a72f5 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Console.c b/bootstrap/unix-88/Console.c index 0e642fae..1c91edd0 100644 --- a/bootstrap/unix-88/Console.c +++ b/bootstrap/unix-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Platform.h" diff --git a/bootstrap/unix-88/Console.h b/bootstrap/unix-88/Console.h index d1875d91..341bc4cb 100644 --- a/bootstrap/unix-88/Console.h +++ b/bootstrap/unix-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index e952925a..818b1445 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin tspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 88756ec8..fac2b753 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index ab8bd793..2fef0b01 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin tskSfF */ #define LARGE #include "SYSTEM.h" @@ -580,7 +580,7 @@ void Heap_FINALL (void) static void Heap_MarkStack (LONGINT n, LONGINT *cand, LONGINT cand__len) { SYSTEM_PTR frame; - LONGINT inc, nofcand, sp, p, stack0, ptr; + LONGINT inc, nofcand, sp, p, stack0; struct Heap__1 align; if (n > 0) { Heap_MarkStack(n - 1, cand, cand__len); diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index 1a13a9af..c284f0f3 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index d5411050..db12f96d 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index e6254a2e..b2fdac26 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index 2b3ff4f7..9192e087 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index 8b8d0a4c..644f8330 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index ebcd0651..181da1e9 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index 1562be22..671e1325 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 40658c18..73f7ab23 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index 7d4b03b1..031a726d 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index a01ab45f..9854e906 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPB.h" diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index 3df6ebfe..3fc22ca6 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index c89a1322..55314019 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin tspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index 1ce9683e..ee049f54 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index a1ef6cf9..ce5819e4 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 6f5f182a..463ce607 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index dbdc1868..0100f58d 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPC.h" diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index 1963d30e..2d3f7cd4 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index d418ba24..e42fe8ef 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -780,6 +780,7 @@ export void *Platform__init(void) Platform_TestLittleEndian(); Platform_HaltCode = -128; Platform_HaltHandler = NIL; + Platform_TimeStart = 0; Platform_TimeStart = Platform_Time(); Platform_CWD[0] = 0x00; Platform_getcwd((void*)Platform_CWD, ((LONGINT)(256))); diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index 4145a946..570192bf 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index b82cd526..5c8f8117 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index 61320bbb..813b3ef5 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/SYSTEM.h b/bootstrap/unix-88/SYSTEM.h index 34b69a8a..949951ac 100644 --- a/bootstrap/unix-88/SYSTEM.h +++ b/bootstrap/unix-88/SYSTEM.h @@ -209,7 +209,6 @@ extern void Heap_INCREF(); // Main module initialisation, registration and finalisation extern void Platform_Init(INTEGER argc, LONGINT argv); -extern void *Platform_MainModule; extern void Heap_FINALL(); #define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (LONGINT)(uintptr_t)&argv); diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index 090e4a68..46e8b812 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index b09d7336..56dacf40 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index a489adbb..056a0391 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Files.h" diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index 1aaf0c32..2e2be576 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/Vishap.c b/bootstrap/unix-88/Vishap.c index 37d64ec3..9f66b328 100644 --- a/bootstrap/unix-88/Vishap.c +++ b/bootstrap/unix-88/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkamSf */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/unix-88/errors.c b/bootstrap/unix-88/errors.c index 3e819c0b..d6ba2eeb 100644 --- a/bootstrap/unix-88/errors.c +++ b/bootstrap/unix-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/unix-88/errors.h b/bootstrap/unix-88/errors.h index 14e6456a..847af188 100644 --- a/bootstrap/unix-88/errors.h +++ b/bootstrap/unix-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index 816ab551..a9de34cf 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index d9e89e69..84ae119b 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/vt100.c b/bootstrap/unix-88/vt100.c index 8a30b13f..2a02ae93 100644 --- a/bootstrap/unix-88/vt100.c +++ b/bootstrap/unix-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/unix-88/vt100.h b/bootstrap/unix-88/vt100.h index 49a57eb4..365596ac 100644 --- a/bootstrap/unix-88/vt100.h +++ b/bootstrap/unix-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index 532bfc28..c4a99497 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -13,6 +13,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/07/21] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/07/22] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index 9c7095b9..9ccb175b 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Console.c b/bootstrap/windows-48/Console.c index 79526e86..676f93c7 100644 --- a/bootstrap/windows-48/Console.c +++ b/bootstrap/windows-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Platform.h" diff --git a/bootstrap/windows-48/Console.h b/bootstrap/windows-48/Console.h index 8558cf0e..fe4dd1e8 100644 --- a/bootstrap/windows-48/Console.h +++ b/bootstrap/windows-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index ff9e1dd6..f15a9971 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index 4a470229..49ae3db6 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index 6888d3b4..2cb7c777 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin tskSfF */ #include "SYSTEM.h" struct Heap__1 { @@ -579,7 +579,7 @@ void Heap_FINALL (void) static void Heap_MarkStack (LONGINT n, LONGINT *cand, LONGINT cand__len) { SYSTEM_PTR frame; - LONGINT inc, nofcand, sp, p, stack0, ptr; + LONGINT inc, nofcand, sp, p, stack0; struct Heap__1 align; if (n > 0) { Heap_MarkStack(n - 1, cand, cand__len); diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index 4d58aaa0..7e1bfa5e 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index 4051a16b..94c48dac 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Heap.h" diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index 674b8179..10f4d96d 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index d5151e32..ea10b5d7 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index 077cea05..4a0aad65 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 358871cb..58a32122 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "OPM.h" diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index 8bf1d703..90b9b2b9 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index b3849a7b..8016a6bb 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index 58dd953e..fc3808a8 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index dddb24bb..d6930745 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPB.h" #include "OPM.h" diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index 51c1177d..00534e5c 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index 5d3430ff..3be820a5 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index 2c8af702..3cd6b899 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 8e4c0838..e91a1a68 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index 0e0961c2..0035ead1 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index 552dde2e..96f02b38 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPC.h" #include "OPM.h" diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index 99e51118..a4f208c5 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 3ba426f1..5b709627 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef @@ -131,6 +131,7 @@ extern void Heap_InitHeap(); #define Platform_fileTimeToSysTime() SYSTEMTIME st; FileTimeToSystemTime(&ft, &st) #define Platform_flushFileBuffers(h) (INTEGER)FlushFileBuffers((HANDLE)(uintptr_t)h) #define Platform_free(address) HeapFree(GetProcessHeap(), 0, (void*)(uintptr_t)address) +#define Platform_ftToUli() ULARGE_INTEGER ul; ul.LowPart=ft.dwLowDateTime; ul.HighPart=ft.dwHighDateTime #define Platform_getCurrentDirectory(n, n__len) GetCurrentDirectory(n__len, (char*)n) #define Platform_getExitCodeProcess(exitcode) GetExitCodeProcess(pi.hProcess, (DWORD*)exitcode); #define Platform_getFileInformationByHandle(h) (INTEGER)GetFileInformationByHandle((HANDLE)(uintptr_t)h, &bhfi) @@ -159,6 +160,7 @@ extern void Heap_InitHeap(); #define Platform_setEndOfFile(h) (INTEGER)SetEndOfFile((HANDLE)(uintptr_t)h) #define Platform_setFilePointerEx(h, o, r, rc) li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((HANDLE)(uintptr_t)h, li, 0, (DWORD)r) #define Platform_sleep(ms) Sleep((DWORD)ms) +#define Platform_stToFt() FILETIME ft; SystemTimeToFileTime(&st, &ft) #define Platform_startupInfo() STARTUPINFO si = {0}; si.cb = sizeof(si); #define Platform_sthour() (INTEGER)st.wHour #define Platform_stmday() (INTEGER)st.wDay @@ -167,6 +169,9 @@ extern void Heap_InitHeap(); #define Platform_stmsec() (INTEGER)st.wMilliseconds #define Platform_stsec() (INTEGER)st.wSecond #define Platform_styear() (INTEGER)st.wYear +#define Platform_tous1970() ul.QuadPart = (ul.QuadPart - 116444736000000000ULL)/10LL +#define Platform_ulSec() (LONGINT)(ul.QuadPart / 1000000LL) +#define Platform_uluSec() (LONGINT)(ul.QuadPart % 1000000LL) #define Platform_waitForProcess() (INTEGER)WaitForSingleObject(pi.hProcess, INFINITE) #define Platform_writefile(fd, p, l) (INTEGER)WriteFile((HANDLE)(uintptr_t)fd, (void*)(uintptr_t)(p), (DWORD)l, 0,0) @@ -339,13 +344,6 @@ void Platform_GetClock (LONGINT *t, LONGINT *d) Platform_YMDHMStoClock(Platform_styear(), Platform_stmon(), Platform_stmday(), Platform_sthour(), Platform_stmin(), Platform_stsec(), &*t, &*d); } -void Platform_GetTimeOfDay (LONGINT *sec, LONGINT *usec) -{ - Platform_getLocalTime(); - *sec = Platform_stsec(); - *usec = (LONGINT)Platform_stmsec() * 1000; -} - LONGINT Platform_Time (void) { LONGINT _o_result; @@ -366,6 +364,16 @@ void Platform_Delay (LONGINT ms) } } +void Platform_GetTimeOfDay (LONGINT *sec, LONGINT *usec) +{ + Platform_getLocalTime(); + Platform_stToFt(); + Platform_ftToUli(); + Platform_tous1970(); + *sec = Platform_ulSec(); + *usec = Platform_uluSec(); +} + INTEGER Platform_System (CHAR *cmd, LONGINT cmd__len) { INTEGER _o_result; @@ -801,6 +809,7 @@ export void *Platform__init(void) Platform_TestLittleEndian(); Platform_HaltCode = -128; Platform_HaltHandler = NIL; + Platform_TimeStart = 0; Platform_TimeStart = Platform_Time(); Platform_CWD[0] = 0x00; Platform_getCurrentDirectory((void*)Platform_CWD, ((LONGINT)(4096))); diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index a912723a..96919602 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 9174951e..1ebd0438 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index d68a783e..ae81f6e7 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/SYSTEM.h b/bootstrap/windows-48/SYSTEM.h index 34b69a8a..949951ac 100644 --- a/bootstrap/windows-48/SYSTEM.h +++ b/bootstrap/windows-48/SYSTEM.h @@ -209,7 +209,6 @@ extern void Heap_INCREF(); // Main module initialisation, registration and finalisation extern void Platform_Init(INTEGER argc, LONGINT argv); -extern void *Platform_MainModule; extern void Heap_FINALL(); #define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (LONGINT)(uintptr_t)&argv); diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index 0236f251..6ecc5e7b 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index db08524a..ee20ae49 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index 107d4836..43955368 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Files.h" #include "Modules.h" diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index 612534d4..928de612 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/Vishap.c b/bootstrap/windows-48/Vishap.c index 8b14dc22..4660166b 100644 --- a/bootstrap/windows-48/Vishap.c +++ b/bootstrap/windows-48/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkamSf */ #include "SYSTEM.h" #include "Configuration.h" #include "Heap.h" diff --git a/bootstrap/windows-48/errors.c b/bootstrap/windows-48/errors.c index 918c86fe..0122b025 100644 --- a/bootstrap/windows-48/errors.c +++ b/bootstrap/windows-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/windows-48/errors.h b/bootstrap/windows-48/errors.h index 3762b03f..94835309 100644 --- a/bootstrap/windows-48/errors.h +++ b/bootstrap/windows-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index fb1322bb..e53881fe 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index 2530385b..e393ad88 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/vt100.c b/bootstrap/windows-48/vt100.c index 0697fe1d..f905ffc7 100644 --- a/bootstrap/windows-48/vt100.c +++ b/bootstrap/windows-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Strings.h" diff --git a/bootstrap/windows-48/vt100.h b/bootstrap/windows-48/vt100.h index bb6e8f9c..2af72bac 100644 --- a/bootstrap/windows-48/vt100.h +++ b/bootstrap/windows-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index 5ba6cdf8..ab2d4040 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -14,6 +14,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/07/21] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/07/22] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index 4d9593cc..932a72f5 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Console.c b/bootstrap/windows-88/Console.c index 2ad8373b..622da4c3 100644 --- a/bootstrap/windows-88/Console.c +++ b/bootstrap/windows-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Platform.h" diff --git a/bootstrap/windows-88/Console.h b/bootstrap/windows-88/Console.h index d1875d91..341bc4cb 100644 --- a/bootstrap/windows-88/Console.h +++ b/bootstrap/windows-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 752e5c07..2106bb31 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin tspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 5889b25b..5cea8802 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index ab8bd793..2fef0b01 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin tskSfF */ #define LARGE #include "SYSTEM.h" @@ -580,7 +580,7 @@ void Heap_FINALL (void) static void Heap_MarkStack (LONGINT n, LONGINT *cand, LONGINT cand__len) { SYSTEM_PTR frame; - LONGINT inc, nofcand, sp, p, stack0, ptr; + LONGINT inc, nofcand, sp, p, stack0; struct Heap__1 align; if (n > 0) { Heap_MarkStack(n - 1, cand, cand__len); diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index 1a13a9af..c284f0f3 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index d5411050..db12f96d 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index e6254a2e..b2fdac26 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index 2b3ff4f7..9192e087 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index 8b8d0a4c..644f8330 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index ebcd0651..181da1e9 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index 1562be22..671e1325 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 40658c18..73f7ab23 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index 7d4b03b1..031a726d 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index a01ab45f..9854e906 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPB.h" diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index 3df6ebfe..3fc22ca6 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index c89a1322..55314019 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin tspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index 1ce9683e..ee049f54 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index a1ef6cf9..ce5819e4 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 6f5f182a..463ce607 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index dbdc1868..0100f58d 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPC.h" diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index 1963d30e..2d3f7cd4 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 6c415d24..4c3cb5f0 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -132,6 +132,7 @@ extern void Heap_InitHeap(); #define Platform_fileTimeToSysTime() SYSTEMTIME st; FileTimeToSystemTime(&ft, &st) #define Platform_flushFileBuffers(h) (INTEGER)FlushFileBuffers((HANDLE)(uintptr_t)h) #define Platform_free(address) HeapFree(GetProcessHeap(), 0, (void*)(uintptr_t)address) +#define Platform_ftToUli() ULARGE_INTEGER ul; ul.LowPart=ft.dwLowDateTime; ul.HighPart=ft.dwHighDateTime #define Platform_getCurrentDirectory(n, n__len) GetCurrentDirectory(n__len, (char*)n) #define Platform_getExitCodeProcess(exitcode) GetExitCodeProcess(pi.hProcess, (DWORD*)exitcode); #define Platform_getFileInformationByHandle(h) (INTEGER)GetFileInformationByHandle((HANDLE)(uintptr_t)h, &bhfi) @@ -160,6 +161,7 @@ extern void Heap_InitHeap(); #define Platform_setEndOfFile(h) (INTEGER)SetEndOfFile((HANDLE)(uintptr_t)h) #define Platform_setFilePointerEx(h, o, r, rc) li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((HANDLE)(uintptr_t)h, li, 0, (DWORD)r) #define Platform_sleep(ms) Sleep((DWORD)ms) +#define Platform_stToFt() FILETIME ft; SystemTimeToFileTime(&st, &ft) #define Platform_startupInfo() STARTUPINFO si = {0}; si.cb = sizeof(si); #define Platform_sthour() (INTEGER)st.wHour #define Platform_stmday() (INTEGER)st.wDay @@ -168,6 +170,9 @@ extern void Heap_InitHeap(); #define Platform_stmsec() (INTEGER)st.wMilliseconds #define Platform_stsec() (INTEGER)st.wSecond #define Platform_styear() (INTEGER)st.wYear +#define Platform_tous1970() ul.QuadPart = (ul.QuadPart - 116444736000000000ULL)/10LL +#define Platform_ulSec() (LONGINT)(ul.QuadPart / 1000000LL) +#define Platform_uluSec() (LONGINT)(ul.QuadPart % 1000000LL) #define Platform_waitForProcess() (INTEGER)WaitForSingleObject(pi.hProcess, INFINITE) #define Platform_writefile(fd, p, l) (INTEGER)WriteFile((HANDLE)(uintptr_t)fd, (void*)(uintptr_t)(p), (DWORD)l, 0,0) @@ -340,13 +345,6 @@ void Platform_GetClock (LONGINT *t, LONGINT *d) Platform_YMDHMStoClock(Platform_styear(), Platform_stmon(), Platform_stmday(), Platform_sthour(), Platform_stmin(), Platform_stsec(), &*t, &*d); } -void Platform_GetTimeOfDay (LONGINT *sec, LONGINT *usec) -{ - Platform_getLocalTime(); - *sec = Platform_stsec(); - *usec = (LONGINT)Platform_stmsec() * 1000; -} - LONGINT Platform_Time (void) { LONGINT _o_result; @@ -367,6 +365,16 @@ void Platform_Delay (LONGINT ms) } } +void Platform_GetTimeOfDay (LONGINT *sec, LONGINT *usec) +{ + Platform_getLocalTime(); + Platform_stToFt(); + Platform_ftToUli(); + Platform_tous1970(); + *sec = Platform_ulSec(); + *usec = Platform_uluSec(); +} + INTEGER Platform_System (CHAR *cmd, LONGINT cmd__len) { INTEGER _o_result; @@ -802,6 +810,7 @@ export void *Platform__init(void) Platform_TestLittleEndian(); Platform_HaltCode = -128; Platform_HaltHandler = NIL; + Platform_TimeStart = 0; Platform_TimeStart = Platform_Time(); Platform_CWD[0] = 0x00; Platform_getCurrentDirectory((void*)Platform_CWD, ((LONGINT)(4096))); diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index c6f87611..4458ef75 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index b82cd526..5c8f8117 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index 61320bbb..813b3ef5 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/SYSTEM.h b/bootstrap/windows-88/SYSTEM.h index 34b69a8a..949951ac 100644 --- a/bootstrap/windows-88/SYSTEM.h +++ b/bootstrap/windows-88/SYSTEM.h @@ -209,7 +209,6 @@ extern void Heap_INCREF(); // Main module initialisation, registration and finalisation extern void Platform_Init(INTEGER argc, LONGINT argv); -extern void *Platform_MainModule; extern void Heap_FINALL(); #define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (LONGINT)(uintptr_t)&argv); diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index 090e4a68..46e8b812 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index b09d7336..56dacf40 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index a489adbb..056a0391 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Files.h" diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index 1aaf0c32..2e2be576 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/Vishap.c b/bootstrap/windows-88/Vishap.c index 37d64ec3..9f66b328 100644 --- a/bootstrap/windows-88/Vishap.c +++ b/bootstrap/windows-88/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkamSf */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/windows-88/errors.c b/bootstrap/windows-88/errors.c index 3e819c0b..d6ba2eeb 100644 --- a/bootstrap/windows-88/errors.c +++ b/bootstrap/windows-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/windows-88/errors.h b/bootstrap/windows-88/errors.h index 14e6456a..847af188 100644 --- a/bootstrap/windows-88/errors.h +++ b/bootstrap/windows-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index 816ab551..a9de34cf 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index d9e89e69..84ae119b 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/vt100.c b/bootstrap/windows-88/vt100.c index 8a30b13f..2a02ae93 100644 --- a/bootstrap/windows-88/vt100.c +++ b/bootstrap/windows-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/windows-88/vt100.h b/bootstrap/windows-88/vt100.h index 49a57eb4..365596ac 100644 --- a/bootstrap/windows-88/vt100.h +++ b/bootstrap/windows-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/src/test/confidence/testresult.sh b/src/test/confidence/testresult.sh index a8389ad3..a827345f 100755 --- a/src/test/confidence/testresult.sh +++ b/src/test/confidence/testresult.sh @@ -9,7 +9,7 @@ fi if [ -f new.asm ] then egrep '^[0-9 ]{4} ([0-9a-f]{4}| ) [0-9A-F]{2}[0-9A-F ]{6}' new.asm|cut -c 11- >new.$FLAVOUR.s - if [ -f old.$FLAVOUR.s ] + if [ -f old.$FLAVOUR.s -a old.$FLAVOUR -nt ../../../../bootstrap/unix-44/Configuration.c ] then if diff -b old.$FLAVOUR.s new.$FLAVOUR.s then echo "--- Generated code unchanged ---" @@ -17,6 +17,7 @@ then egrep '^[0-9 ]{4} ([0-9a-f]{4}| ) [0-9A-F]{2}[0-9A-F ]{6}' new.asm|cut - fi else cp new.$FLAVOUR.s old.$FLAVOUR.s + echo "--- Generated code snapped ---" fi fi From ca2cc52a44c27bb8c050715c16c66ef8c38faddf Mon Sep 17 00:00:00 2001 From: David Brown Date: Wed, 24 Aug 2016 14:10:06 +0100 Subject: [PATCH 193/580] Port updated tests and binary snapping, with corrected Reals code, from tidy branch. --- .gitignore | 4 +- bootstrap/unix-44/Configuration.c | 4 +- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Console.c | 2 +- bootstrap/unix-44/Console.h | 2 +- bootstrap/unix-44/Files.c | 2 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 2 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 2 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 2 +- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 2 +- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 2 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 61 +++--- bootstrap/unix-44/Reals.h | 5 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/Vishap.c | 2 +- bootstrap/unix-44/errors.c | 2 +- bootstrap/unix-44/errors.h | 2 +- bootstrap/unix-44/extTools.c | 2 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-44/vt100.c | 2 +- bootstrap/unix-44/vt100.h | 2 +- bootstrap/unix-48/Configuration.c | 4 +- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Console.c | 2 +- bootstrap/unix-48/Console.h | 2 +- bootstrap/unix-48/Files.c | 2 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 2 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 2 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 2 +- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 2 +- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 2 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 61 +++--- bootstrap/unix-48/Reals.h | 5 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/Vishap.c | 2 +- bootstrap/unix-48/errors.c | 2 +- bootstrap/unix-48/errors.h | 2 +- bootstrap/unix-48/extTools.c | 2 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-48/vt100.c | 2 +- bootstrap/unix-48/vt100.h | 2 +- bootstrap/unix-88/Configuration.c | 4 +- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Console.c | 2 +- bootstrap/unix-88/Console.h | 2 +- bootstrap/unix-88/Files.c | 2 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 2 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 2 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 2 +- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 2 +- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 2 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 61 +++--- bootstrap/unix-88/Reals.h | 5 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/Vishap.c | 2 +- bootstrap/unix-88/errors.c | 2 +- bootstrap/unix-88/errors.h | 2 +- bootstrap/unix-88/extTools.c | 2 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/unix-88/vt100.c | 2 +- bootstrap/unix-88/vt100.h | 2 +- bootstrap/windows-48/Configuration.c | 4 +- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Console.c | 2 +- bootstrap/windows-48/Console.h | 2 +- bootstrap/windows-48/Files.c | 2 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 2 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 2 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 2 +- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 2 +- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 2 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 61 +++--- bootstrap/windows-48/Reals.h | 5 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/Vishap.c | 2 +- bootstrap/windows-48/errors.c | 2 +- bootstrap/windows-48/errors.h | 2 +- bootstrap/windows-48/extTools.c | 2 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-48/vt100.c | 2 +- bootstrap/windows-48/vt100.h | 2 +- bootstrap/windows-88/Configuration.c | 4 +- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Console.c | 2 +- bootstrap/windows-88/Console.h | 2 +- bootstrap/windows-88/Files.c | 2 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 2 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 2 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 2 +- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 2 +- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 2 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Platform.c | 2 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 61 +++--- bootstrap/windows-88/Reals.h | 5 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/Vishap.c | 2 +- bootstrap/windows-88/errors.c | 2 +- bootstrap/windows-88/errors.h | 2 +- bootstrap/windows-88/extTools.c | 2 +- bootstrap/windows-88/extTools.h | 2 +- bootstrap/windows-88/vt100.c | 2 +- bootstrap/windows-88/vt100.h | 2 +- src/library/ooc/oocLowReal.Mod | 202 ++++++++++-------- src/library/v4/Reals.Mod | 114 ++++++---- .../arrayassignment/old.cygwin.ILP32.gcc.s | 2 +- src/test/confidence/arrayassignment/test.sh | 2 +- .../confidence/hello/old.cygwin.ILP32.gcc.s | 2 +- src/test/confidence/hello/test.sh | 2 +- src/test/confidence/intsyntax/IntSyntax.mod | 18 ++ src/test/confidence/intsyntax/expected | 15 ++ src/test/confidence/intsyntax/test.sh | 5 + src/test/confidence/language/TestLanguage.mod | 42 +++- .../language/old.cygwin.ILP32.gcc.s | 55 +++++ src/test/confidence/language/test.sh | 2 +- src/test/confidence/library/TestLibrary.mod | 99 +++++++++ src/test/confidence/library/expected | 26 +++ src/test/confidence/library/test.sh | 6 + .../confidence/lola/old.cygwin.ILP32.gcc.s | 2 +- src/test/confidence/lola/test.sh | 2 +- src/test/confidence/planned-binary-change | 0 .../confidence/signal/old.cygwin.ILP32.gcc.s | 2 +- src/test/confidence/signal/test.sh | 2 +- src/test/confidence/testresult.sh | 8 +- src/test/confidence/texts/expected | 4 + src/test/confidence/texts/test.sh | 5 + src/test/confidence/texts/testTexts.mod | 41 ++++ src/tools/make/vishap.make | 127 ++++++----- 221 files changed, 949 insertions(+), 550 deletions(-) create mode 100644 src/test/confidence/intsyntax/IntSyntax.mod create mode 100644 src/test/confidence/intsyntax/expected create mode 100644 src/test/confidence/intsyntax/test.sh create mode 100644 src/test/confidence/library/TestLibrary.mod create mode 100644 src/test/confidence/library/expected create mode 100644 src/test/confidence/library/test.sh create mode 100644 src/test/confidence/planned-binary-change create mode 100644 src/test/confidence/texts/expected create mode 100644 src/test/confidence/texts/test.sh create mode 100644 src/test/confidence/texts/testTexts.mod diff --git a/.gitignore b/.gitignore index 3f69b59d..0e401127 100644 --- a/.gitignore +++ b/.gitignore @@ -16,9 +16,11 @@ /src/test/**/*.sym /src/test/**/*.stackdump /src/test/confidence/**/result +/src/test/confidence/**/*.asm +/src/test/confidence/**/*.s /.DS_store **/.DS_store **/*.dSYM **/.tmp.* /*.pdb -/*.ilk \ No newline at end of file +/*.ilk diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index c4a99497..1f5afbb7 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -13,6 +13,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/07/22] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/08/24] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index 9ccb175b..eef3a15d 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Console.c b/bootstrap/unix-44/Console.c index 529459d3..5fa65e00 100644 --- a/bootstrap/unix-44/Console.c +++ b/bootstrap/unix-44/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Platform.h" diff --git a/bootstrap/unix-44/Console.h b/bootstrap/unix-44/Console.h index fe4dd1e8..53dbdfa8 100644 --- a/bootstrap/unix-44/Console.h +++ b/bootstrap/unix-44/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 564d7975..5d92e963 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index 2539b65b..b60e6242 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index 2cb7c777..4cabf8c6 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin tskSfF */ #include "SYSTEM.h" struct Heap__1 { diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index 7e1bfa5e..38e549be 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index 94c48dac..d5164a2a 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Heap.h" diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index 10f4d96d..5e27b653 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index ea10b5d7..d834a9e8 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index 4a0aad65..4c37f01f 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 58a32122..417337c0 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "OPM.h" diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index 90b9b2b9..52ed8dab 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 8016a6bb..8e5add20 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index fc3808a8..db46c598 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index d6930745..ffe3dff2 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPB.h" #include "OPM.h" diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index 00534e5c..40e2def4 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index 3be820a5..efed04c6 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index 3cd6b899..dae6e457 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index e91a1a68..8c943c20 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index 0035ead1..45816124 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index 96f02b38..23bff9c0 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPC.h" #include "OPM.h" diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index a4f208c5..0de9e6cc 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 2baa87e7..3cce2026 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index 7bc6a7f9..581da770 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 1ebd0438..0f1c3a92 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,15 +1,17 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" +static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LONGINT d__len); export void Reals_Convert (REAL x, INTEGER n, CHAR *d, LONGINT d__len); export void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len); -export void Reals_ConvertHL (LONGREAL y, CHAR *d, LONGINT d__len); +export void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len); export void Reals_ConvertL (LONGREAL x, INTEGER n, CHAR *d, LONGINT d__len); export INTEGER Reals_Expo (REAL x); export INTEGER Reals_ExpoL (LONGREAL x); +export void Reals_SetExpo (REAL *x, INTEGER ex); export REAL Reals_Ten (INTEGER e); export LONGREAL Reals_TenL (INTEGER e); static CHAR Reals_ToHex (INTEGER i); @@ -55,17 +57,27 @@ LONGREAL Reals_TenL (INTEGER e) INTEGER Reals_Expo (REAL x) { INTEGER _o_result; - _o_result = (int)__MASK(__ASHR((LONGINT)(__VAL(INTEGER, x)), 23), -256); + INTEGER i; + __GET((LONGINT)(uintptr_t)&x + 2, i, INTEGER); + _o_result = __MASK(__ASHR(i, 7), -256); return _o_result; } +void Reals_SetExpo (REAL *x, INTEGER ex) +{ + CHAR c; + __GET((LONGINT)(uintptr_t)x + 3, c, CHAR); + __PUT((LONGINT)(uintptr_t)x + 3, (CHAR)(__ASHL(__ASHR((int)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __GET((LONGINT)(uintptr_t)x + 2, c, CHAR); + __PUT((LONGINT)(uintptr_t)x + 2, (CHAR)(__MASK((int)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); +} + INTEGER Reals_ExpoL (LONGREAL x) { INTEGER _o_result; INTEGER i; - LONGINT l; - __GET((LONGINT)(uintptr_t)&x + 4, l, LONGINT); - _o_result = (int)__MASK(__ASHR(l, 20), -2048); + __GET((LONGINT)(uintptr_t)&x + 6, i, INTEGER); + _o_result = __MASK(__ASHR(i, 4), -2048); return _o_result; } @@ -115,34 +127,29 @@ static CHAR Reals_ToHex (INTEGER i) __RETCHK; } -typedef - CHAR (*pc4__3)[4]; - -void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len) +static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LONGINT d__len) { - pc4__3 p = NIL; INTEGER i; - p = (pc4__3)(uintptr_t)((LONGINT)(uintptr_t)&y); + LONGINT l; + CHAR by; i = 0; - while (i < 4) { - d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((int)(*p)[__X(i, ((LONGINT)(4)))], 4)); - d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((int)(*p)[__X(i, ((LONGINT)(4)))], -16)); + l = b__len; + while ((LONGINT)i < l) { + by = __VAL(CHAR, b[__X(i, b__len)]); + d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((int)by, 4)); + d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((int)by, -16)); + i += 1; } } -typedef - CHAR (*pc8__5)[8]; - -void Reals_ConvertHL (LONGREAL y, CHAR *d, LONGINT d__len) +void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len) { - pc8__5 p = NIL; - INTEGER i; - p = (pc8__5)(uintptr_t)((LONGINT)(uintptr_t)&y); - i = 0; - while (i < 8) { - d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((int)(*p)[__X(i, ((LONGINT)(8)))], 4)); - d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((int)(*p)[__X(i, ((LONGINT)(8)))], -16)); - } + Reals_BytesToHex((void*)&y, ((LONGINT)(4)), (void*)d, d__len * ((LONGINT)(1))); +} + +void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len) +{ + Reals_BytesToHex((void*)&x, ((LONGINT)(8)), (void*)d, d__len * ((LONGINT)(1))); } diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index ae81f6e7..4a783296 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h @@ -10,10 +10,11 @@ import void Reals_Convert (REAL x, INTEGER n, CHAR *d, LONGINT d__len); import void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len); -import void Reals_ConvertHL (LONGREAL y, CHAR *d, LONGINT d__len); +import void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len); import void Reals_ConvertL (LONGREAL x, INTEGER n, CHAR *d, LONGINT d__len); import INTEGER Reals_Expo (REAL x); import INTEGER Reals_ExpoL (LONGREAL x); +import void Reals_SetExpo (REAL *x, INTEGER ex); import REAL Reals_Ten (INTEGER e); import LONGREAL Reals_TenL (INTEGER e); import void *Reals__init(void); diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index 6ecc5e7b..d2713d0f 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index ee20ae49..5f45d8a8 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index a985d2fc..0e6ee85e 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Files.h" #include "Modules.h" diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index 454de29e..c8abf16a 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/Vishap.c b/bootstrap/unix-44/Vishap.c index 4660166b..74d0e984 100644 --- a/bootstrap/unix-44/Vishap.c +++ b/bootstrap/unix-44/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkamSf */ #include "SYSTEM.h" #include "Configuration.h" #include "Heap.h" diff --git a/bootstrap/unix-44/errors.c b/bootstrap/unix-44/errors.c index 0122b025..f8ddb53a 100644 --- a/bootstrap/unix-44/errors.c +++ b/bootstrap/unix-44/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/unix-44/errors.h b/bootstrap/unix-44/errors.h index 94835309..5068083b 100644 --- a/bootstrap/unix-44/errors.h +++ b/bootstrap/unix-44/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index e53881fe..03bd540b 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index e393ad88..695ea164 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-44/vt100.c b/bootstrap/unix-44/vt100.c index f905ffc7..c499aceb 100644 --- a/bootstrap/unix-44/vt100.c +++ b/bootstrap/unix-44/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Strings.h" diff --git a/bootstrap/unix-44/vt100.h b/bootstrap/unix-44/vt100.h index 2af72bac..1aaeca77 100644 --- a/bootstrap/unix-44/vt100.h +++ b/bootstrap/unix-44/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index c4a99497..1f5afbb7 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -13,6 +13,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/07/22] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/08/24] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index 9ccb175b..eef3a15d 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Console.c b/bootstrap/unix-48/Console.c index 529459d3..5fa65e00 100644 --- a/bootstrap/unix-48/Console.c +++ b/bootstrap/unix-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Platform.h" diff --git a/bootstrap/unix-48/Console.h b/bootstrap/unix-48/Console.h index fe4dd1e8..53dbdfa8 100644 --- a/bootstrap/unix-48/Console.h +++ b/bootstrap/unix-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 564d7975..5d92e963 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index 2539b65b..b60e6242 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index 2cb7c777..4cabf8c6 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin tskSfF */ #include "SYSTEM.h" struct Heap__1 { diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index 7e1bfa5e..38e549be 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index 94c48dac..d5164a2a 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Heap.h" diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index 10f4d96d..5e27b653 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index ea10b5d7..d834a9e8 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index 4a0aad65..4c37f01f 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 58a32122..417337c0 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "OPM.h" diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index 90b9b2b9..52ed8dab 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 8016a6bb..8e5add20 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index fc3808a8..db46c598 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index d6930745..ffe3dff2 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPB.h" #include "OPM.h" diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index 00534e5c..40e2def4 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index 3be820a5..efed04c6 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index 3cd6b899..dae6e457 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index e91a1a68..8c943c20 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index 0035ead1..45816124 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index 96f02b38..23bff9c0 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPC.h" #include "OPM.h" diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index a4f208c5..0de9e6cc 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 2baa87e7..3cce2026 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index 7bc6a7f9..581da770 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 1ebd0438..0f1c3a92 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,15 +1,17 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" +static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LONGINT d__len); export void Reals_Convert (REAL x, INTEGER n, CHAR *d, LONGINT d__len); export void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len); -export void Reals_ConvertHL (LONGREAL y, CHAR *d, LONGINT d__len); +export void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len); export void Reals_ConvertL (LONGREAL x, INTEGER n, CHAR *d, LONGINT d__len); export INTEGER Reals_Expo (REAL x); export INTEGER Reals_ExpoL (LONGREAL x); +export void Reals_SetExpo (REAL *x, INTEGER ex); export REAL Reals_Ten (INTEGER e); export LONGREAL Reals_TenL (INTEGER e); static CHAR Reals_ToHex (INTEGER i); @@ -55,17 +57,27 @@ LONGREAL Reals_TenL (INTEGER e) INTEGER Reals_Expo (REAL x) { INTEGER _o_result; - _o_result = (int)__MASK(__ASHR((LONGINT)(__VAL(INTEGER, x)), 23), -256); + INTEGER i; + __GET((LONGINT)(uintptr_t)&x + 2, i, INTEGER); + _o_result = __MASK(__ASHR(i, 7), -256); return _o_result; } +void Reals_SetExpo (REAL *x, INTEGER ex) +{ + CHAR c; + __GET((LONGINT)(uintptr_t)x + 3, c, CHAR); + __PUT((LONGINT)(uintptr_t)x + 3, (CHAR)(__ASHL(__ASHR((int)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __GET((LONGINT)(uintptr_t)x + 2, c, CHAR); + __PUT((LONGINT)(uintptr_t)x + 2, (CHAR)(__MASK((int)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); +} + INTEGER Reals_ExpoL (LONGREAL x) { INTEGER _o_result; INTEGER i; - LONGINT l; - __GET((LONGINT)(uintptr_t)&x + 4, l, LONGINT); - _o_result = (int)__MASK(__ASHR(l, 20), -2048); + __GET((LONGINT)(uintptr_t)&x + 6, i, INTEGER); + _o_result = __MASK(__ASHR(i, 4), -2048); return _o_result; } @@ -115,34 +127,29 @@ static CHAR Reals_ToHex (INTEGER i) __RETCHK; } -typedef - CHAR (*pc4__3)[4]; - -void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len) +static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LONGINT d__len) { - pc4__3 p = NIL; INTEGER i; - p = (pc4__3)(uintptr_t)((LONGINT)(uintptr_t)&y); + LONGINT l; + CHAR by; i = 0; - while (i < 4) { - d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((int)(*p)[__X(i, ((LONGINT)(4)))], 4)); - d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((int)(*p)[__X(i, ((LONGINT)(4)))], -16)); + l = b__len; + while ((LONGINT)i < l) { + by = __VAL(CHAR, b[__X(i, b__len)]); + d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((int)by, 4)); + d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((int)by, -16)); + i += 1; } } -typedef - CHAR (*pc8__5)[8]; - -void Reals_ConvertHL (LONGREAL y, CHAR *d, LONGINT d__len) +void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len) { - pc8__5 p = NIL; - INTEGER i; - p = (pc8__5)(uintptr_t)((LONGINT)(uintptr_t)&y); - i = 0; - while (i < 8) { - d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((int)(*p)[__X(i, ((LONGINT)(8)))], 4)); - d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((int)(*p)[__X(i, ((LONGINT)(8)))], -16)); - } + Reals_BytesToHex((void*)&y, ((LONGINT)(4)), (void*)d, d__len * ((LONGINT)(1))); +} + +void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len) +{ + Reals_BytesToHex((void*)&x, ((LONGINT)(8)), (void*)d, d__len * ((LONGINT)(1))); } diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index ae81f6e7..4a783296 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h @@ -10,10 +10,11 @@ import void Reals_Convert (REAL x, INTEGER n, CHAR *d, LONGINT d__len); import void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len); -import void Reals_ConvertHL (LONGREAL y, CHAR *d, LONGINT d__len); +import void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len); import void Reals_ConvertL (LONGREAL x, INTEGER n, CHAR *d, LONGINT d__len); import INTEGER Reals_Expo (REAL x); import INTEGER Reals_ExpoL (LONGREAL x); +import void Reals_SetExpo (REAL *x, INTEGER ex); import REAL Reals_Ten (INTEGER e); import LONGREAL Reals_TenL (INTEGER e); import void *Reals__init(void); diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index 6ecc5e7b..d2713d0f 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index ee20ae49..5f45d8a8 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index 43955368..2dab1e0f 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Files.h" #include "Modules.h" diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index 928de612..189403c9 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/Vishap.c b/bootstrap/unix-48/Vishap.c index 4660166b..74d0e984 100644 --- a/bootstrap/unix-48/Vishap.c +++ b/bootstrap/unix-48/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkamSf */ #include "SYSTEM.h" #include "Configuration.h" #include "Heap.h" diff --git a/bootstrap/unix-48/errors.c b/bootstrap/unix-48/errors.c index 0122b025..f8ddb53a 100644 --- a/bootstrap/unix-48/errors.c +++ b/bootstrap/unix-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/unix-48/errors.h b/bootstrap/unix-48/errors.h index 94835309..5068083b 100644 --- a/bootstrap/unix-48/errors.h +++ b/bootstrap/unix-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index e53881fe..03bd540b 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index e393ad88..695ea164 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/vt100.c b/bootstrap/unix-48/vt100.c index f905ffc7..c499aceb 100644 --- a/bootstrap/unix-48/vt100.c +++ b/bootstrap/unix-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Strings.h" diff --git a/bootstrap/unix-48/vt100.h b/bootstrap/unix-48/vt100.h index 2af72bac..1aaeca77 100644 --- a/bootstrap/unix-48/vt100.h +++ b/bootstrap/unix-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index ab2d4040..951bea6e 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -14,6 +14,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/07/22] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/08/24] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index 932a72f5..15594379 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Console.c b/bootstrap/unix-88/Console.c index 1c91edd0..29555980 100644 --- a/bootstrap/unix-88/Console.c +++ b/bootstrap/unix-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Platform.h" diff --git a/bootstrap/unix-88/Console.h b/bootstrap/unix-88/Console.h index 341bc4cb..11152de0 100644 --- a/bootstrap/unix-88/Console.h +++ b/bootstrap/unix-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 818b1445..be91d89c 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin tspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index fac2b753..6dcba157 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index 2fef0b01..69ba4ffb 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin tskSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index c284f0f3..40db2aca 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index db12f96d..eaf370c4 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index b2fdac26..d273cf1a 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index 9192e087..2fccfe61 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index 644f8330..48c946c5 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index 181da1e9..40697da9 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index 671e1325..58679d74 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 73f7ab23..40d53974 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index 031a726d..2e93dfcf 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index 9854e906..9ce53b1f 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPB.h" diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index 3fc22ca6..372c5f88 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index 55314019..8276ecf9 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin tspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index ee049f54..8f1581bb 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index ce5819e4..7f03064b 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 463ce607..7e03d42c 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 0100f58d..c86ba15e 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPC.h" diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index 2d3f7cd4..eeb89a76 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index e42fe8ef..842c232d 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index 570192bf..bdb39b1d 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 5c8f8117..0fb9a236 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,16 +1,18 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" +static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LONGINT d__len); export void Reals_Convert (REAL x, INTEGER n, CHAR *d, LONGINT d__len); export void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len); -export void Reals_ConvertHL (LONGREAL y, CHAR *d, LONGINT d__len); +export void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len); export void Reals_ConvertL (LONGREAL x, INTEGER n, CHAR *d, LONGINT d__len); export INTEGER Reals_Expo (REAL x); export INTEGER Reals_ExpoL (LONGREAL x); +export void Reals_SetExpo (REAL *x, INTEGER ex); export REAL Reals_Ten (INTEGER e); export LONGREAL Reals_TenL (INTEGER e); static CHAR Reals_ToHex (INTEGER i); @@ -56,17 +58,27 @@ LONGREAL Reals_TenL (INTEGER e) INTEGER Reals_Expo (REAL x) { INTEGER _o_result; - _o_result = (int)__MASK(__ASHR((LONGINT)(__VAL(INTEGER, x)), 23), -256); + INTEGER i; + __GET((LONGINT)(uintptr_t)&x + 2, i, INTEGER); + _o_result = __MASK(__ASHR(i, 7), -256); return _o_result; } +void Reals_SetExpo (REAL *x, INTEGER ex) +{ + CHAR c; + __GET((LONGINT)(uintptr_t)x + 3, c, CHAR); + __PUT((LONGINT)(uintptr_t)x + 3, (CHAR)(__ASHL(__ASHR((int)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __GET((LONGINT)(uintptr_t)x + 2, c, CHAR); + __PUT((LONGINT)(uintptr_t)x + 2, (CHAR)(__MASK((int)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); +} + INTEGER Reals_ExpoL (LONGREAL x) { INTEGER _o_result; INTEGER i; - LONGINT l; - __GET((LONGINT)(uintptr_t)&x + 4, i, INTEGER); - _o_result = (int)__MASK(__ASHR((LONGINT)i, 20), -2048); + __GET((LONGINT)(uintptr_t)&x + 6, i, INTEGER); + _o_result = __MASK(__ASHR(i, 4), -2048); return _o_result; } @@ -103,34 +115,29 @@ static CHAR Reals_ToHex (INTEGER i) __RETCHK; } -typedef - CHAR (*pc4__3)[4]; - -void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len) +static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LONGINT d__len) { - pc4__3 p = NIL; INTEGER i; - p = (pc4__3)(uintptr_t)((LONGINT)(uintptr_t)&y); + LONGINT l; + CHAR by; i = 0; - while (i < 4) { - d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((int)(*p)[__X(i, ((LONGINT)(4)))], 4)); - d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((int)(*p)[__X(i, ((LONGINT)(4)))], -16)); + l = b__len; + while ((LONGINT)i < l) { + by = __VAL(CHAR, b[__X(i, b__len)]); + d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((int)by, 4)); + d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((int)by, -16)); + i += 1; } } -typedef - CHAR (*pc8__5)[8]; - -void Reals_ConvertHL (LONGREAL y, CHAR *d, LONGINT d__len) +void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len) { - pc8__5 p = NIL; - INTEGER i; - p = (pc8__5)(uintptr_t)((LONGINT)(uintptr_t)&y); - i = 0; - while (i < 8) { - d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((int)(*p)[__X(i, ((LONGINT)(8)))], 4)); - d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((int)(*p)[__X(i, ((LONGINT)(8)))], -16)); - } + Reals_BytesToHex((void*)&y, ((LONGINT)(4)), (void*)d, d__len * ((LONGINT)(1))); +} + +void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len) +{ + Reals_BytesToHex((void*)&x, ((LONGINT)(8)), (void*)d, d__len * ((LONGINT)(1))); } diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index 813b3ef5..db522698 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h @@ -11,10 +11,11 @@ import void Reals_Convert (REAL x, INTEGER n, CHAR *d, LONGINT d__len); import void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len); -import void Reals_ConvertHL (LONGREAL y, CHAR *d, LONGINT d__len); +import void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len); import void Reals_ConvertL (LONGREAL x, INTEGER n, CHAR *d, LONGINT d__len); import INTEGER Reals_Expo (REAL x); import INTEGER Reals_ExpoL (LONGREAL x); +import void Reals_SetExpo (REAL *x, INTEGER ex); import REAL Reals_Ten (INTEGER e); import LONGREAL Reals_TenL (INTEGER e); import void *Reals__init(void); diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index 46e8b812..962b86a0 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index 56dacf40..549337ee 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index 056a0391..fe673ac8 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Files.h" diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index 2e2be576..dcee9f40 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/Vishap.c b/bootstrap/unix-88/Vishap.c index 9f66b328..ccb3e59e 100644 --- a/bootstrap/unix-88/Vishap.c +++ b/bootstrap/unix-88/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkamSf */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/unix-88/errors.c b/bootstrap/unix-88/errors.c index d6ba2eeb..9b9ec275 100644 --- a/bootstrap/unix-88/errors.c +++ b/bootstrap/unix-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/unix-88/errors.h b/bootstrap/unix-88/errors.h index 847af188..fdf34cf1 100644 --- a/bootstrap/unix-88/errors.h +++ b/bootstrap/unix-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index a9de34cf..521538ae 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index 84ae119b..de353aeb 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/vt100.c b/bootstrap/unix-88/vt100.c index 2a02ae93..1b8568fe 100644 --- a/bootstrap/unix-88/vt100.c +++ b/bootstrap/unix-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/unix-88/vt100.h b/bootstrap/unix-88/vt100.h index 365596ac..2d276238 100644 --- a/bootstrap/unix-88/vt100.h +++ b/bootstrap/unix-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index c4a99497..1f5afbb7 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -13,6 +13,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/07/22] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/08/24] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index 9ccb175b..eef3a15d 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Console.c b/bootstrap/windows-48/Console.c index 676f93c7..b1cc9707 100644 --- a/bootstrap/windows-48/Console.c +++ b/bootstrap/windows-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Platform.h" diff --git a/bootstrap/windows-48/Console.h b/bootstrap/windows-48/Console.h index fe4dd1e8..53dbdfa8 100644 --- a/bootstrap/windows-48/Console.h +++ b/bootstrap/windows-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index f15a9971..49be5f7c 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index 49ae3db6..10a35cd2 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index 2cb7c777..4cabf8c6 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin tskSfF */ #include "SYSTEM.h" struct Heap__1 { diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index 7e1bfa5e..38e549be 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index 94c48dac..d5164a2a 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Heap.h" diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index 10f4d96d..5e27b653 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index ea10b5d7..d834a9e8 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index 4a0aad65..4c37f01f 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 58a32122..417337c0 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "OPM.h" diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index 90b9b2b9..52ed8dab 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 8016a6bb..8e5add20 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index fc3808a8..db46c598 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index d6930745..ffe3dff2 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPB.h" #include "OPM.h" diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index 00534e5c..40e2def4 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index 3be820a5..efed04c6 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index 3cd6b899..dae6e457 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index e91a1a68..8c943c20 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index 0035ead1..45816124 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index 96f02b38..23bff9c0 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPC.h" #include "OPM.h" diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index a4f208c5..0de9e6cc 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 5b709627..78bdbf70 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index 96919602..aecbb66c 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 1ebd0438..0f1c3a92 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,15 +1,17 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" +static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LONGINT d__len); export void Reals_Convert (REAL x, INTEGER n, CHAR *d, LONGINT d__len); export void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len); -export void Reals_ConvertHL (LONGREAL y, CHAR *d, LONGINT d__len); +export void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len); export void Reals_ConvertL (LONGREAL x, INTEGER n, CHAR *d, LONGINT d__len); export INTEGER Reals_Expo (REAL x); export INTEGER Reals_ExpoL (LONGREAL x); +export void Reals_SetExpo (REAL *x, INTEGER ex); export REAL Reals_Ten (INTEGER e); export LONGREAL Reals_TenL (INTEGER e); static CHAR Reals_ToHex (INTEGER i); @@ -55,17 +57,27 @@ LONGREAL Reals_TenL (INTEGER e) INTEGER Reals_Expo (REAL x) { INTEGER _o_result; - _o_result = (int)__MASK(__ASHR((LONGINT)(__VAL(INTEGER, x)), 23), -256); + INTEGER i; + __GET((LONGINT)(uintptr_t)&x + 2, i, INTEGER); + _o_result = __MASK(__ASHR(i, 7), -256); return _o_result; } +void Reals_SetExpo (REAL *x, INTEGER ex) +{ + CHAR c; + __GET((LONGINT)(uintptr_t)x + 3, c, CHAR); + __PUT((LONGINT)(uintptr_t)x + 3, (CHAR)(__ASHL(__ASHR((int)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __GET((LONGINT)(uintptr_t)x + 2, c, CHAR); + __PUT((LONGINT)(uintptr_t)x + 2, (CHAR)(__MASK((int)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); +} + INTEGER Reals_ExpoL (LONGREAL x) { INTEGER _o_result; INTEGER i; - LONGINT l; - __GET((LONGINT)(uintptr_t)&x + 4, l, LONGINT); - _o_result = (int)__MASK(__ASHR(l, 20), -2048); + __GET((LONGINT)(uintptr_t)&x + 6, i, INTEGER); + _o_result = __MASK(__ASHR(i, 4), -2048); return _o_result; } @@ -115,34 +127,29 @@ static CHAR Reals_ToHex (INTEGER i) __RETCHK; } -typedef - CHAR (*pc4__3)[4]; - -void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len) +static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LONGINT d__len) { - pc4__3 p = NIL; INTEGER i; - p = (pc4__3)(uintptr_t)((LONGINT)(uintptr_t)&y); + LONGINT l; + CHAR by; i = 0; - while (i < 4) { - d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((int)(*p)[__X(i, ((LONGINT)(4)))], 4)); - d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((int)(*p)[__X(i, ((LONGINT)(4)))], -16)); + l = b__len; + while ((LONGINT)i < l) { + by = __VAL(CHAR, b[__X(i, b__len)]); + d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((int)by, 4)); + d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((int)by, -16)); + i += 1; } } -typedef - CHAR (*pc8__5)[8]; - -void Reals_ConvertHL (LONGREAL y, CHAR *d, LONGINT d__len) +void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len) { - pc8__5 p = NIL; - INTEGER i; - p = (pc8__5)(uintptr_t)((LONGINT)(uintptr_t)&y); - i = 0; - while (i < 8) { - d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((int)(*p)[__X(i, ((LONGINT)(8)))], 4)); - d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((int)(*p)[__X(i, ((LONGINT)(8)))], -16)); - } + Reals_BytesToHex((void*)&y, ((LONGINT)(4)), (void*)d, d__len * ((LONGINT)(1))); +} + +void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len) +{ + Reals_BytesToHex((void*)&x, ((LONGINT)(8)), (void*)d, d__len * ((LONGINT)(1))); } diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index ae81f6e7..4a783296 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h @@ -10,10 +10,11 @@ import void Reals_Convert (REAL x, INTEGER n, CHAR *d, LONGINT d__len); import void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len); -import void Reals_ConvertHL (LONGREAL y, CHAR *d, LONGINT d__len); +import void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len); import void Reals_ConvertL (LONGREAL x, INTEGER n, CHAR *d, LONGINT d__len); import INTEGER Reals_Expo (REAL x); import INTEGER Reals_ExpoL (LONGREAL x); +import void Reals_SetExpo (REAL *x, INTEGER ex); import REAL Reals_Ten (INTEGER e); import LONGREAL Reals_TenL (INTEGER e); import void *Reals__init(void); diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index 6ecc5e7b..d2713d0f 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index ee20ae49..5f45d8a8 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index 43955368..2dab1e0f 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Files.h" #include "Modules.h" diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index 928de612..189403c9 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/Vishap.c b/bootstrap/windows-48/Vishap.c index 4660166b..74d0e984 100644 --- a/bootstrap/windows-48/Vishap.c +++ b/bootstrap/windows-48/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkamSf */ #include "SYSTEM.h" #include "Configuration.h" #include "Heap.h" diff --git a/bootstrap/windows-48/errors.c b/bootstrap/windows-48/errors.c index 0122b025..f8ddb53a 100644 --- a/bootstrap/windows-48/errors.c +++ b/bootstrap/windows-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/windows-48/errors.h b/bootstrap/windows-48/errors.h index 94835309..5068083b 100644 --- a/bootstrap/windows-48/errors.h +++ b/bootstrap/windows-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index e53881fe..03bd540b 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index e393ad88..695ea164 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/vt100.c b/bootstrap/windows-48/vt100.c index f905ffc7..c499aceb 100644 --- a/bootstrap/windows-48/vt100.c +++ b/bootstrap/windows-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Strings.h" diff --git a/bootstrap/windows-48/vt100.h b/bootstrap/windows-48/vt100.h index 2af72bac..1aaeca77 100644 --- a/bootstrap/windows-48/vt100.h +++ b/bootstrap/windows-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index ab2d4040..951bea6e 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -14,6 +14,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/07/22] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/08/24] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index 932a72f5..15594379 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Console.c b/bootstrap/windows-88/Console.c index 622da4c3..0e1c708d 100644 --- a/bootstrap/windows-88/Console.c +++ b/bootstrap/windows-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Platform.h" diff --git a/bootstrap/windows-88/Console.h b/bootstrap/windows-88/Console.h index 341bc4cb..11152de0 100644 --- a/bootstrap/windows-88/Console.h +++ b/bootstrap/windows-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 2106bb31..b9b748e0 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin tspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 5cea8802..da7d6e44 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index 2fef0b01..69ba4ffb 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin tskSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index c284f0f3..40db2aca 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index db12f96d..eaf370c4 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index b2fdac26..d273cf1a 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index 9192e087..2fccfe61 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index 644f8330..48c946c5 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index 181da1e9..40697da9 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index 671e1325..58679d74 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 73f7ab23..40d53974 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index 031a726d..2e93dfcf 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index 9854e906..9ce53b1f 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPB.h" diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index 3fc22ca6..372c5f88 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index 55314019..8276ecf9 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin tspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index ee049f54..8f1581bb 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index ce5819e4..7f03064b 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 463ce607..7e03d42c 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 0100f58d..c86ba15e 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPC.h" diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index 2d3f7cd4..eeb89a76 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 4c3cb5f0..ec8fb7a9 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index 4458ef75..179bd3c3 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 5c8f8117..0fb9a236 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,16 +1,18 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" +static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LONGINT d__len); export void Reals_Convert (REAL x, INTEGER n, CHAR *d, LONGINT d__len); export void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len); -export void Reals_ConvertHL (LONGREAL y, CHAR *d, LONGINT d__len); +export void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len); export void Reals_ConvertL (LONGREAL x, INTEGER n, CHAR *d, LONGINT d__len); export INTEGER Reals_Expo (REAL x); export INTEGER Reals_ExpoL (LONGREAL x); +export void Reals_SetExpo (REAL *x, INTEGER ex); export REAL Reals_Ten (INTEGER e); export LONGREAL Reals_TenL (INTEGER e); static CHAR Reals_ToHex (INTEGER i); @@ -56,17 +58,27 @@ LONGREAL Reals_TenL (INTEGER e) INTEGER Reals_Expo (REAL x) { INTEGER _o_result; - _o_result = (int)__MASK(__ASHR((LONGINT)(__VAL(INTEGER, x)), 23), -256); + INTEGER i; + __GET((LONGINT)(uintptr_t)&x + 2, i, INTEGER); + _o_result = __MASK(__ASHR(i, 7), -256); return _o_result; } +void Reals_SetExpo (REAL *x, INTEGER ex) +{ + CHAR c; + __GET((LONGINT)(uintptr_t)x + 3, c, CHAR); + __PUT((LONGINT)(uintptr_t)x + 3, (CHAR)(__ASHL(__ASHR((int)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __GET((LONGINT)(uintptr_t)x + 2, c, CHAR); + __PUT((LONGINT)(uintptr_t)x + 2, (CHAR)(__MASK((int)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); +} + INTEGER Reals_ExpoL (LONGREAL x) { INTEGER _o_result; INTEGER i; - LONGINT l; - __GET((LONGINT)(uintptr_t)&x + 4, i, INTEGER); - _o_result = (int)__MASK(__ASHR((LONGINT)i, 20), -2048); + __GET((LONGINT)(uintptr_t)&x + 6, i, INTEGER); + _o_result = __MASK(__ASHR(i, 4), -2048); return _o_result; } @@ -103,34 +115,29 @@ static CHAR Reals_ToHex (INTEGER i) __RETCHK; } -typedef - CHAR (*pc4__3)[4]; - -void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len) +static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LONGINT d__len) { - pc4__3 p = NIL; INTEGER i; - p = (pc4__3)(uintptr_t)((LONGINT)(uintptr_t)&y); + LONGINT l; + CHAR by; i = 0; - while (i < 4) { - d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((int)(*p)[__X(i, ((LONGINT)(4)))], 4)); - d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((int)(*p)[__X(i, ((LONGINT)(4)))], -16)); + l = b__len; + while ((LONGINT)i < l) { + by = __VAL(CHAR, b[__X(i, b__len)]); + d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((int)by, 4)); + d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((int)by, -16)); + i += 1; } } -typedef - CHAR (*pc8__5)[8]; - -void Reals_ConvertHL (LONGREAL y, CHAR *d, LONGINT d__len) +void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len) { - pc8__5 p = NIL; - INTEGER i; - p = (pc8__5)(uintptr_t)((LONGINT)(uintptr_t)&y); - i = 0; - while (i < 8) { - d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((int)(*p)[__X(i, ((LONGINT)(8)))], 4)); - d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((int)(*p)[__X(i, ((LONGINT)(8)))], -16)); - } + Reals_BytesToHex((void*)&y, ((LONGINT)(4)), (void*)d, d__len * ((LONGINT)(1))); +} + +void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len) +{ + Reals_BytesToHex((void*)&x, ((LONGINT)(8)), (void*)d, d__len * ((LONGINT)(1))); } diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index 813b3ef5..db522698 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h @@ -11,10 +11,11 @@ import void Reals_Convert (REAL x, INTEGER n, CHAR *d, LONGINT d__len); import void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len); -import void Reals_ConvertHL (LONGREAL y, CHAR *d, LONGINT d__len); +import void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len); import void Reals_ConvertL (LONGREAL x, INTEGER n, CHAR *d, LONGINT d__len); import INTEGER Reals_Expo (REAL x); import INTEGER Reals_ExpoL (LONGREAL x); +import void Reals_SetExpo (REAL *x, INTEGER ex); import REAL Reals_Ten (INTEGER e); import LONGREAL Reals_TenL (INTEGER e); import void *Reals__init(void); diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index 46e8b812..962b86a0 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index 56dacf40..549337ee 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index 056a0391..fe673ac8 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Files.h" diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index 2e2be576..dcee9f40 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/Vishap.c b/bootstrap/windows-88/Vishap.c index 9f66b328..ccb3e59e 100644 --- a/bootstrap/windows-88/Vishap.c +++ b/bootstrap/windows-88/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkamSf */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/windows-88/errors.c b/bootstrap/windows-88/errors.c index d6ba2eeb..9b9ec275 100644 --- a/bootstrap/windows-88/errors.c +++ b/bootstrap/windows-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/windows-88/errors.h b/bootstrap/windows-88/errors.h index 847af188..fdf34cf1 100644 --- a/bootstrap/windows-88/errors.h +++ b/bootstrap/windows-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index a9de34cf..521538ae 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index 84ae119b..de353aeb 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/vt100.c b/bootstrap/windows-88/vt100.c index 2a02ae93..1b8568fe 100644 --- a/bootstrap/windows-88/vt100.c +++ b/bootstrap/windows-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/windows-88/vt100.h b/bootstrap/windows-88/vt100.h index 365596ac..2d276238 100644 --- a/bootstrap/windows-88/vt100.h +++ b/bootstrap/windows-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/07/22] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/src/library/ooc/oocLowReal.Mod b/src/library/ooc/oocLowReal.Mod index 33859dcc..83ae8e32 100644 --- a/src/library/ooc/oocLowReal.Mod +++ b/src/library/ooc/oocLowReal.Mod @@ -2,20 +2,20 @@ MODULE oocLowReal; (* - LowReal - Gives access to the underlying properties of the type REAL - for IEEE single-precision numbers. + LowReal - Gives access to the underlying properties of the type REAL + for IEEE single-precision numbers. Copyright (C) 1995 Michael Griebling - + This module is free software; you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as + it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This module is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. - + You should have received a copy of the GNU Lesser General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA @@ -23,10 +23,10 @@ MODULE oocLowReal; *) -IMPORT S := SYSTEM, Console; - +IMPORT S := SYSTEM, Console, Reals; + (* - + Real number properties are defined as follows: radix--The whole number value of the radix used to represent the @@ -44,69 +44,69 @@ IMPORT S := SYSTEM, Console; small--The smallest positive value of the corresponding real number type, represented to maximal precision. - IEC559--A Boolean value that is TRUE if and only if the implementation - of the corresponding real number type conforms to IEC 559:1989 + IEC559--A Boolean value that is TRUE if and only if the implementation + of the corresponding real number type conforms to IEC 559:1989 (IEEE 754:1987) in all regards. NOTES 6 -- If `IEC559' is TRUE, the value of `radix' is 2. - 7 -- If LowReal.IEC559 is TRUE, the 32-bit format of IEC 559:1989 + 7 -- If LowReal.IEC559 is TRUE, the 32-bit format of IEC 559:1989 is used for the type REAL. - 7 -- If LowLong.IEC559 is TRUE, the 64-bit format of IEC 559:1989 + 7 -- If LowLong.IEC559 is TRUE, the 64-bit format of IEC 559:1989 is used for the type REAL. - LIA1--A Boolean value that is TRUE if and only if the implementation of - the corresponding real number type conforms to ISO/IEC 10967-1:199x - (LIA-1) in all regards: parameters, arithmetic, exceptions, and + LIA1--A Boolean value that is TRUE if and only if the implementation of + the corresponding real number type conforms to ISO/IEC 10967-1:199x + (LIA-1) in all regards: parameters, arithmetic, exceptions, and notification. - rounds--A Boolean value that is TRUE if and only if each operation produces - a result that is one of the values of the corresponding real number + rounds--A Boolean value that is TRUE if and only if each operation produces + a result that is one of the values of the corresponding real number type nearest to the mathematical result. - gUnderflow--A Boolean value that is TRUE if and only if there are values of - the corresponding real number type between 0.0 and `small'. + gUnderflow--A Boolean value that is TRUE if and only if there are values of + the corresponding real number type between 0.0 and `small'. - exception--A Boolean value that is TRUE if and only if every operation that + exception--A Boolean value that is TRUE if and only if every operation that attempts to produce a real value out of range raises an exception. - extend--A Boolean value that is TRUE if and only if expressions of the - corresponding real number type are computed to higher precision than + extend--A Boolean value that is TRUE if and only if expressions of the + corresponding real number type are computed to higher precision than the stored values. - nModes--The whole number value giving the number of bit positions needed for + nModes--The whole number value giving the number of bit positions needed for the status flags for mode control. - + *) -CONST - radix*= 2; +CONST + radix*= 2; places*= 24; - expoMax*= 127; + expoMax*= 127; expoMin*= 1-expoMax; large*= MAX(REAL);(*3.40282347E+38;*) (* MAX(REAL) *) (*small*= 1.17549435E-38; (* 2^(-126) *)*) small* = 1/8.50705917E37; (* don't know better way; -- noch *) IEC559*= TRUE; LIA1*= FALSE; - rounds*= FALSE; + rounds*= FALSE; gUnderflow*= TRUE; (* there are IEEE numbers smaller than `small' *) exception*= FALSE; (* at least in the default implementation *) extend*= FALSE; nModes*= 0; - + TEN=10.0; (* some commonly-used constants *) - ONE=1.0; + ONE=1.0; ZERO=0.0; - - expOffset=expoMax; - hiBit=22; + + expOffset=expoMax; + hiBit=22; expBit=hiBit+1; nMask={0..hiBit,31}; (* number mask *) expMask={expBit..30}; (* exponent mask *) - + TYPE Modes*= SET; - + VAR (*small* : REAL; tmp: REAL;*) (* this was a test to get small as a variable at runtime. obviously, compile time preferred; -- noch *) ErrorHandler*: PROCEDURE (errno : INTEGER); @@ -114,33 +114,19 @@ VAR (* Error handler default stub which can be replaced *) -(* PROCEDURE power0(i, j : INTEGER) : REAL; (* used to calculate sml at runtime; -- noch *) - VAR k : INTEGER; - p : REAL; - BEGIN - k := 1; - p := i; - REPEAT -p := p * i; - INC(k); - UNTIL k=j; - RETURN p; - END power0;*) - - - PROCEDURE DefaultHandler (errno : INTEGER); BEGIN err:=errno -END DefaultHandler; +END DefaultHandler; PROCEDURE ClearError*; BEGIN err:=0 -END ClearError; - +END ClearError; + + PROCEDURE exponent*(x: REAL): INTEGER; -(* +(* The value of the call exponent(x) shall be the exponent value of `x' that lies between `expoMin' and `expoMax'. An exception shall occur and may be raised if `x' is equal to 0.0. @@ -148,14 +134,14 @@ PROCEDURE exponent*(x: REAL): INTEGER; BEGIN (* NOTE: x=0.0 should raise exception *) IF x=ZERO THEN RETURN 0 - ELSE RETURN SHORT(S.LSH(S.VAL(LONGINT,x),-expBit) MOD 256)-expOffset + ELSE RETURN Reals.Expo(x) - expOffset END END exponent; PROCEDURE exponent10*(x: REAL): INTEGER; -(* - The value of the call exponent10(x) shall be the base 10 exponent - value of `x'. An exception shall occur and may be raised if `x' is +(* + The value of the call exponent10(x) shall be the base 10 exponent + value of `x'. An exception shall occur and may be raised if `x' is equal to 0.0. *) VAR exp: INTEGER; @@ -163,47 +149,74 @@ BEGIN exp:=0; x:=ABS(x); IF x=ZERO THEN RETURN exp END; (* exception could be raised here *) WHILE x>=TEN DO x:=x/TEN; INC(exp) END; - WHILE (x>ZERO) & (x<1.0) DO x:=x*TEN; DEC(exp) END; + WHILE (x>ZERO) & (x<1.0) DO x:=x*TEN; DEC(exp) END; RETURN exp END exponent10; - + +(* TYPE REAL: 1/sign, 8/exponent, 23/significand *) + PROCEDURE fraction*(x: REAL): REAL; (* The value of the call fraction(x) shall be the significand (or significant) part of `x'. Hence the following relationship shall - hold: x = scale(fraction(x), exponent(x)). + hold: x = scale(fraction(x), exponent(x)). *) - CONST eZero={(hiBit+2)..29}; +VAR c: CHAR; BEGIN - IF x=ZERO THEN RETURN ZERO + IF x=ZERO THEN RETURN ZERO + ELSE + (* Set top 7 bits of exponent to 0111111 *) + S.GET(S.ADR(x)+3, c); + c := CHR(((ORD(c) DIV 128) * 128) + 63); (* Set X0111111 (X unchanged) *) + S.PUT(S.ADR(x)+3, c); + (* Set bottom bit of exponent to 0 *) + S.GET(S.ADR(x)+2, c); + c := CHR(ORD(c) MOD 128); (* Set 0XXXXXXX (X unchanged) *) + S.PUT(S.ADR(x)+2, c); + RETURN x * 2.0; + END +(* + CONST eZero={(hiBit+2)..29}; +BEGIN + IF x=ZERO THEN RETURN ZERO ELSE RETURN S.VAL(REAL,(S.VAL(SET,x)*nMask)+eZero)*2.0 (* set the mantissa's exponent to zero *) END +*) END fraction; PROCEDURE IsInfinity * (real: REAL) : BOOLEAN; - CONST signMask={0..30}; + VAR c0, c1, c2, c3: CHAR; BEGIN - RETURN S.VAL(SET,real)*signMask=expMask + S.GET(S.ADR(real)+0, c3); + S.GET(S.ADR(real)+1, c2); + S.GET(S.ADR(real)+2, c1); + S.GET(S.ADR(real)+3, c0); + RETURN (ORD(c0) MOD 128 = 127) & (ORD(c1) = 128) & (ORD(c2) = 0) & (ORD(c3) = 0) END IsInfinity; PROCEDURE IsNaN * (real: REAL) : BOOLEAN; - CONST fracMask={0..hiBit}; - VAR sreal: SET; + VAR c0, c1, c2, c3: CHAR; BEGIN - sreal:=S.VAL(SET, real); - RETURN (sreal*expMask=expMask) & (sreal*fracMask#{}) -END IsNaN; + S.GET(S.ADR(real)+0, c3); + S.GET(S.ADR(real)+1, c2); + S.GET(S.ADR(real)+2, c1); + S.GET(S.ADR(real)+3, c0); + RETURN (ORD(c0) MOD 128 = 127) + & (ORD(c1) DIV 128 = 1) + & ((ORD(c1) MOD 128 # 0) OR (ORD(c2) # 0) OR (ORD(c3) # 0)) +END IsNaN; PROCEDURE sign*(x: REAL): REAL; (* The value of the call sign(x) shall be 1.0 if `x' is greater than 0.0, or shall be -1.0 if `x' is less than 0.0, or shall be either 1.0 or - -1.0 if `x' is equal to 0.0. + -1.0 if `x' is equal to 0.0. *) BEGIN IF xresult . ../testresult.sh diff --git a/src/test/confidence/hello/old.cygwin.ILP32.gcc.s b/src/test/confidence/hello/old.cygwin.ILP32.gcc.s index 618e26e5..ab9053fa 100644 --- a/src/test/confidence/hello/old.cygwin.ILP32.gcc.s +++ b/src/test/confidence/hello/old.cygwin.ILP32.gcc.s @@ -48,7 +48,7 @@ C7442404 movl $0, 4(%esp) 00000000 C7042400 movl $LC0, (%esp) E8000000 call _Heap_REGMOD -A3000000 movl %eax, _m.2052 +A3000000 movl %eax, _m.1608 C7442404 movl $7, 4(%esp) 07000000 C7042406 movl $LC1, (%esp) diff --git a/src/test/confidence/hello/test.sh b/src/test/confidence/hello/test.sh index 4ebe71c3..e49e2b2a 100755 --- a/src/test/confidence/hello/test.sh +++ b/src/test/confidence/hello/test.sh @@ -1,5 +1,5 @@ #!/bin/sh . ../testenv.sh -voc hello.mod -m +$OBECOMP hello.mod -m ./hello >result . ../testresult.sh diff --git a/src/test/confidence/intsyntax/IntSyntax.mod b/src/test/confidence/intsyntax/IntSyntax.mod new file mode 100644 index 00000000..c5ac799c --- /dev/null +++ b/src/test/confidence/intsyntax/IntSyntax.mod @@ -0,0 +1,18 @@ +MODULE IntSyntax; + +(* Test for error messages generated by incompatible integer types *) + +VAR s: SHORTINT; i: INTEGER; l: LONGINT; + +BEGIN + + l := l; (* Good, same types *) + l := i; (* Good, LONGINT longer than INTEGER *) + l := s; (* Good, LONGINT longer than SHORTINT *) + i := s; (* Good, INTEGER longer then SHORTINT *) + + i := l; (* Bad, INTEGER shorter than LONGINT *) + s := l; (* Bad, SHORTINT shorter than LONGINT *) + i := l; (* Bad, SHORTINT shorter than INTEGER *) + +END IntSyntax. \ No newline at end of file diff --git a/src/test/confidence/intsyntax/expected b/src/test/confidence/intsyntax/expected new file mode 100644 index 00000000..82813b89 --- /dev/null +++ b/src/test/confidence/intsyntax/expected @@ -0,0 +1,15 @@ +IntSyntax.mod compiling IntSyntax. + + 14: i := l; (* Bad, INTEGER shorter than LONGINT *) + ^ + pos 341 err 113 incompatible assignment + + 15: s := l; (* Bad, SHORTINT shorter than LONGINT *) + ^ + pos 393 err 113 incompatible assignment + + 16: i := l; (* Bad, SHORTINT shorter than INTEGER *) + ^ + pos 446 err 113 incompatible assignment + +Module compilation failed. diff --git a/src/test/confidence/intsyntax/test.sh b/src/test/confidence/intsyntax/test.sh new file mode 100644 index 00000000..7699daea --- /dev/null +++ b/src/test/confidence/intsyntax/test.sh @@ -0,0 +1,5 @@ +#!/bin/sh +. ../testenv.sh +# Generate mixed source and assembly code listing +$OBECOMP IntSyntax.mod -m >result +. ../testresult.sh diff --git a/src/test/confidence/language/TestLanguage.mod b/src/test/confidence/language/TestLanguage.mod index 11aa3f5d..d3653c0b 100644 --- a/src/test/confidence/language/TestLanguage.mod +++ b/src/test/confidence/language/TestLanguage.mod @@ -91,11 +91,51 @@ BEGIN (* Also need full tests for CHAR, and poossibly SYSTEM.BYTE. Here's a simple one *) c := 1X; c := SYSTEM.LSH(c,2); c := SYSTEM.ROT(c,-2); ASSERT(c=1X, 93); - b := 1; b := SYSTEM.LSH(b,2); b := SYSTEM.ROT(b,-2); ASSERT(SYSTEM.VAL(INTEGER,b)=1, 94); + b := 1; b := SYSTEM.LSH(b,2); b := SYSTEM.ROT(b,-2); ASSERT(SYSTEM.VAL(CHAR,b)=1X, 94); END Shift; + +PROCEDURE TestValue(v,e: LONGINT; name: ARRAY OF CHAR); +BEGIN + IF v # e THEN + Console.String(name); + Console.String(" = "); + Console.Int(v,1); + Console.String(", expected "); + Console.Int(e,1); + Console.Ln; + END +END TestValue; + +PROCEDURE IntSize; + VAR l: LONGINT; +BEGIN + TestValue(MIN(SHORTINT), -80H, "MIN(SHORTINT)"); + TestValue(MAX(SHORTINT), 7FH, "MAX(SHORTINT)"); + IF SIZE(INTEGER) = 2 THEN (* 32 bit machine *) + TestValue(MIN(INTEGER), -7FFFH - 1, "MIN(INTEGER)"); + TestValue(MAX(INTEGER), 7FFFH, "MAX(INTEGER)"); + TestValue(MIN(LONGINT), -7FFFFFFFH - 1, "MIN(LONGINT)"); + TestValue(MAX(LONGINT), 7FFFFFFFH, "MAX(LONGINT)"); + ELSIF SIZE(INTEGER) = 4 THEN (* 64 bit machine *) + TestValue(MIN(INTEGER), -7FFFFFFFH - 1, "MIN(INTEGER)"); + TestValue(MAX(INTEGER), 7FFFFFFFH, "MAX(INTEGER)"); + (* Since we need to be compilable on 32 bit machines we cannot use + a 64 bit constant, so use arithmetic. *) + l := 1; l := SYSTEM.LSH(l, 63); l := l-1; (* Generate l = 7FFFFFFFFFFFFFFFH *) + TestValue(MIN(LONGINT), -l - 1, "MIN(LONGINT)"); + TestValue(MAX(LONGINT), l, "MAX(LONGINT)"); + ELSE + Console.String("SIZE(INTEGER) = "); + Console.Int(SIZE(INTEGER),1); + Console.String(", expected 2 or 4."); + Console.Ln; + END; +END IntSize; + BEGIN Shift; + IntSize; Console.String("Language tests successful."); Console.Ln; END TestLanguage. diff --git a/src/test/confidence/language/old.cygwin.ILP32.gcc.s b/src/test/confidence/language/old.cygwin.ILP32.gcc.s index 9a4499d2..4e35c971 100644 --- a/src/test/confidence/language/old.cygwin.ILP32.gcc.s +++ b/src/test/confidence/language/old.cygwin.ILP32.gcc.s @@ -484,3 +484,58 @@ D3E2 sall %cl, %edx 89D0 movl %edx, %eax 09D8 orl %ebx, %eax 8845E5 movb %al, -27(%ebp) +0FB645E5 movzbl -27(%ebp), %eax +3A45F7 cmpb -9(%ebp), %al +740C je L52 +C7042436 movl $54, (%esp) +E8000000 call _Platform_AssertFail +D07DF7 sarb -9(%ebp) +0FB745F4 movzwl -12(%ebp), %eax +83E801 subl $1, %eax +668945F4 movw %ax, -12(%ebp) +66837DF4 cmpw $-7, -12(%ebp) +0F8D19FF jge L53 +66C745F4 movw $0, -12(%ebp) +C745EC01 movl $1, -20(%ebp) +8B45EC movl -20(%ebp), %eax +C1E01F sall $31, %eax +8945EC movl %eax, -20(%ebp) +8B45EC movl -20(%ebp), %eax +8945E0 movl %eax, -32(%ebp) +EB50 jmp L54 +8B45E0 movl -32(%ebp), %eax +8945E8 movl %eax, -24(%ebp) +66837DF4 cmpw $0, -12(%ebp) +780F js L55 +0FBF45F4 movswl -12(%ebp), %eax +8B55E8 movl -24(%ebp), %edx +89C1 movl %eax, %ecx +D3E2 sall %cl, %edx +89D0 movl %edx, %eax +EB0F jmp L56 +0FBF45F4 movswl -12(%ebp), %eax +F7D8 negl %eax +8B55E8 movl -24(%ebp), %edx +89C1 movl %eax, %ecx +D3FA sarl %cl, %edx +89D0 movl %edx, %eax +8945E8 movl %eax, -24(%ebp) +8B45E8 movl -24(%ebp), %eax +3B45EC cmpl -20(%ebp), %eax +740C je L57 +C704243E movl $62, (%esp) +E8000000 call _Platform_AssertFail +D17DEC sarl -20(%ebp) +0FB745F4 movzwl -12(%ebp), %eax +83E801 subl $1, %eax +668945F4 movw %ax, -12(%ebp) +66837DF4 cmpw $-31, -12(%ebp) +7DA9 jge L58 +66C745F4 movw $0, -12(%ebp) +66C745E6 movw $1, -26(%ebp) +0FB745E6 movzwl -26(%ebp), %eax +0FB7C0 movzwl %ax, %eax +C1E00F sall $15, %eax +668945E6 movw %ax, -26(%ebp) +0FB745E6 movzwl -26(%ebp), %eax +668945F2 movw %ax, -14(%ebp) diff --git a/src/test/confidence/language/test.sh b/src/test/confidence/language/test.sh index 217e6c49..82f3efbf 100755 --- a/src/test/confidence/language/test.sh +++ b/src/test/confidence/language/test.sh @@ -1,6 +1,6 @@ #!/bin/sh . ../testenv.sh # Generate mixed source and assembly code listing -voc TestLanguage.mod -m +$OBECOMP TestLanguage.mod -m ./TestLanguage >result . ../testresult.sh diff --git a/src/test/confidence/library/TestLibrary.mod b/src/test/confidence/library/TestLibrary.mod new file mode 100644 index 00000000..32f7c91b --- /dev/null +++ b/src/test/confidence/library/TestLibrary.mod @@ -0,0 +1,99 @@ +MODULE TestLibrary; + +IMPORT SYSTEM, Oberon, Texts, Reals, oocLowReal; + +VAR W: Texts.Writer; + +PROCEDURE tc(c: CHAR); BEGIN Texts.Write(W, c) END tc; +PROCEDURE ts(s: ARRAY OF CHAR); BEGIN Texts.WriteString(W, s) END ts; +PROCEDURE ti(i, n: LONGINT); BEGIN Texts.WriteInt(W, i, n) END ti; +PROCEDURE tr(r: LONGREAL; n: INTEGER); BEGIN Texts.WriteLongReal(W, r, n) END tr; +PROCEDURE tn; BEGIN Texts.WriteLn(W); Texts.Append(Oberon.Log, W.buf) END tn; + + +PROCEDURE TestConvert(lr: LONGREAL); + VAR str: ARRAY 20 OF CHAR; i: INTEGER; +BEGIN + Reals.ConvertL(lr, 6, str); + i := 6; WHILE i > 0 DO DEC(i); tc(str[i]) END; + tn; +END TestConvert; + +PROCEDURE TestHex(r: REAL); + VAR str: ARRAY 20 OF CHAR; +BEGIN + Reals.ConvertH(r, str); str[8] := 0X; ts(str); tn; +END TestHex; + +PROCEDURE TestSetExpo(r: REAL; i: INTEGER); +BEGIN + ts("r = "); tr(r,10); + ts(", i = "); ti(Reals.Expo(r),1); + Reals.SetExpo(r, i); + ts(" -> r = "); tr(r,10); + ts(", i = "); ti(Reals.Expo(r),1); tn; +END TestSetExpo; + +PROCEDURE TestFractionPart(r: REAL); +BEGIN + ts("r = "); tr(r,14); + ts(", exp = "); ti(Reals.Expo(r),1); + r := oocLowReal.fraction(r); + ts(" -> r = "); tr(r,14); + ts(", exp = "); ti(Reals.Expo(r),1); tn; +END TestFractionPart; + +PROCEDURE RealTests; + VAR + str: ARRAY 20 OF CHAR; + r: REAL; +(* + lr: LONGREAL; +*) +BEGIN + TestConvert(1.0); + TestConvert(1.5); + TestConvert(2.0); + TestConvert(2.99); + TestConvert(3.0); + + TestHex(1.0); + TestHex(1.5); + TestHex(2.0); + TestHex(2.99); + TestHex(3.0); + + ti(Reals.Expo(0.5),1); tn; (* 126 *) + ti(Reals.Expo(1.0),1); tn; (* 127 *) + ti(Reals.Expo(2.0),1); tn; (* 128 *) + ti(Reals.Expo(3.0),1); tn; (* 128 *) + ti(Reals.Expo(4.0),1); tn; (* 129 *) + + TestSetExpo(1.0, 129); + TestSetExpo(-1.0, 129); + TestSetExpo(2.0, 129); + TestSetExpo(-4.0, 129); + TestSetExpo(1.5, 129); + TestSetExpo(-1.5, 129); + + TestFractionPart(1.234); + TestFractionPart(-1.234); + TestFractionPart(32.678); + TestFractionPart(-32.678); + + r := 0.0; + ASSERT(~oocLowReal.IsInfinity(r), 3); ASSERT(~oocLowReal.IsNaN(r), 4); + + r := 0.0; Reals.SetExpo(r, 255); + ASSERT(oocLowReal.IsInfinity(r), 5); ASSERT(~oocLowReal.IsNaN(r), 6); + + r := 0.123; Reals.SetExpo(r, 255); + ASSERT(~oocLowReal.IsInfinity(r), 7); ASSERT(oocLowReal.IsNaN(r), 8); +END RealTests; + + +BEGIN + Texts.OpenWriter(W); + RealTests; + ts("Library tests successful."); tn +END TestLibrary. \ No newline at end of file diff --git a/src/test/confidence/library/expected b/src/test/confidence/library/expected new file mode 100644 index 00000000..3e361735 --- /dev/null +++ b/src/test/confidence/library/expected @@ -0,0 +1,26 @@ +000001 +000001 +000002 +000002 +000003 +0000803F +0000C03F +00000040 +295C3F40 +00004040 +126 +127 +128 +128 +129 +r = 1.0D+000, i = 127 -> r = 4.0D+000, i = 129 +r = -1.0D+000, i = 127 -> r = -4.0D+000, i = 129 +r = 2.0D+000, i = 128 -> r = 4.0D+000, i = 129 +r = -4.0D+000, i = 129 -> r = -4.0D+000, i = 129 +r = 1.5D+000, i = 127 -> r = 6.0D+000, i = 129 +r = -1.5D+000, i = 127 -> r = -6.0D+000, i = 129 +r = 1.23400D+000, exp = 127 -> r = 1.23400D+000, exp = 127 +r = -1.23400D+000, exp = 127 -> r = -1.23400D+000, exp = 127 +r = 3.26780D+001, exp = 132 -> r = 1.02119D+000, exp = 127 +r = -3.26780D+001, exp = 132 -> r = -1.02119D+000, exp = 127 +Library tests successful. diff --git a/src/test/confidence/library/test.sh b/src/test/confidence/library/test.sh new file mode 100644 index 00000000..e59c074c --- /dev/null +++ b/src/test/confidence/library/test.sh @@ -0,0 +1,6 @@ +#!/bin/sh +. ../testenv.sh +# Generate mixed source and assembly code listing +$OBECOMP TestLibrary.mod -m +./TestLibrary >result +. ../testresult.sh diff --git a/src/test/confidence/lola/old.cygwin.ILP32.gcc.s b/src/test/confidence/lola/old.cygwin.ILP32.gcc.s index bd2a8780..601c26da 100644 --- a/src/test/confidence/lola/old.cygwin.ILP32.gcc.s +++ b/src/test/confidence/lola/old.cygwin.ILP32.gcc.s @@ -71,7 +71,7 @@ C7442404 movl $0, 4(%esp) 00000000 C7042400 movl $LC0, (%esp) E8000000 call _Heap_REGMOD -A3000000 movl %eax, _m.2287 +A3000000 movl %eax, _m.1843 0FB70500 movzwl _Platform_ArgCount, %eax 6683F802 cmpw $2, %ax 7F5C jg L6 diff --git a/src/test/confidence/lola/test.sh b/src/test/confidence/lola/test.sh index 523dd7bb..315d6d8e 100755 --- a/src/test/confidence/lola/test.sh +++ b/src/test/confidence/lola/test.sh @@ -1,5 +1,5 @@ #!/bin/sh . ../testenv.sh -voc LSS.Mod LSB.Mod LSC.Mod LSV.Mod lola.Mod -m +$OBECOMP LSS.Mod LSB.Mod LSC.Mod LSV.Mod lola.Mod -m ./Lola RISC5.Lola result . ../testresult.sh diff --git a/src/test/confidence/planned-binary-change b/src/test/confidence/planned-binary-change new file mode 100644 index 00000000..e69de29b diff --git a/src/test/confidence/signal/old.cygwin.ILP32.gcc.s b/src/test/confidence/signal/old.cygwin.ILP32.gcc.s index 6d7de14d..d9de6f01 100644 --- a/src/test/confidence/signal/old.cygwin.ILP32.gcc.s +++ b/src/test/confidence/signal/old.cygwin.ILP32.gcc.s @@ -368,7 +368,7 @@ C7442404 movl $_EnumPtrs, 4(%esp) 02040000 C7042411 movl $LC2, (%esp) E8000000 call _Heap_REGMOD -A3180000 movl %eax, _m.2428 +A3180000 movl %eax, _m.1984 C7442404 movl $7, 4(%esp) 07000000 C704241C movl $LC3, (%esp) diff --git a/src/test/confidence/signal/test.sh b/src/test/confidence/signal/test.sh index 8e507edc..fadc1879 100755 --- a/src/test/confidence/signal/test.sh +++ b/src/test/confidence/signal/test.sh @@ -1,6 +1,6 @@ #!/bin/sh . ../testenv.sh -voc signal.mod -m +$OBECOMP signal.mod -m ./SignalTest x & sleep 1 kill -2 $! diff --git a/src/test/confidence/testresult.sh b/src/test/confidence/testresult.sh index a827345f..eb7e485b 100755 --- a/src/test/confidence/testresult.sh +++ b/src/test/confidence/testresult.sh @@ -7,16 +7,16 @@ fi # Compare generated code if [ -f new.asm ] -then egrep '^[0-9 ]{4} ([0-9a-f]{4}| ) [0-9A-F]{2}[0-9A-F ]{6}' new.asm|cut -c 11- >new.$FLAVOUR.s +then egrep '^[0-9 ]{4} ([0-9a-f]{4}| ) [0-9A-F]{2}[0-9A-F ]{6}' new.asm|cut -c 11- >new.$FLAVOUR.$BRANCH.s - if [ -f old.$FLAVOUR.s -a old.$FLAVOUR -nt ../../../../bootstrap/unix-44/Configuration.c ] + if [ -f old.$FLAVOUR.$BRANCH.s -a old.$FLAVOUR.$BRANCH -nt ../planned-binary-change ] then - if diff -b old.$FLAVOUR.s new.$FLAVOUR.s + if diff -b old.$FLAVOUR.$BRANCH.s new.$FLAVOUR.$BRANCH.s then echo "--- Generated code unchanged ---" else echo "--- Generated code changed ---" fi else - cp new.$FLAVOUR.s old.$FLAVOUR.s + cp new.$FLAVOUR.$BRANCH.s old.$FLAVOUR.$BRANCH.s echo "--- Generated code snapped ---" fi diff --git a/src/test/confidence/texts/expected b/src/test/confidence/texts/expected new file mode 100644 index 00000000..96ea4526 --- /dev/null +++ b/src/test/confidence/texts/expected @@ -0,0 +1,4 @@ +aaa + -3.1E+02 +-311.141504 + -3.1D+002 diff --git a/src/test/confidence/texts/test.sh b/src/test/confidence/texts/test.sh new file mode 100644 index 00000000..6a798eee --- /dev/null +++ b/src/test/confidence/texts/test.sh @@ -0,0 +1,5 @@ +#!/bin/sh +. ../testenv.sh +$OBECOMP testTexts.mod -m +./testTexts >result +. ../testresult.sh diff --git a/src/test/confidence/texts/testTexts.mod b/src/test/confidence/texts/testTexts.mod new file mode 100644 index 00000000..cc2484d1 --- /dev/null +++ b/src/test/confidence/texts/testTexts.mod @@ -0,0 +1,41 @@ +(* compile with voc -M testTexts.Mod *) +MODULE testTexts; + +IMPORT Texts, Console; + +CONST pi = -311.1415; + +VAR + W: Texts.Writer; + T: Texts.Text; + R: Texts.Reader; + ch: CHAR; + i: INTEGER; + s: ARRAY 1024 OF CHAR; + +BEGIN + Texts.OpenWriter(W); + + Texts.WriteString(W, "aaa"); Texts.WriteLn(W); + Texts.WriteReal(W, pi, 7); Texts.WriteLn(W); + Texts.WriteRealFix(W, pi, 0, 7); Texts.WriteLn(W); + Texts.WriteLongReal(W, pi, 7); Texts.WriteLn(W); + + NEW(T); Texts.Open(T, "test.txt"); + + Texts.Append(T, W.buf); + (*Texts.Store(W, T);*) + + Texts.OpenReader(R, T, 0); + Texts.Read(R, ch); + i := 0; + WHILE ~R.eot DO + IF ch = 0DX THEN + s[i] := 0X; i := 0; Console.String(s); Console.Ln + ELSE + s[i] := ch; INC(i) + END; + Texts.Read(R, ch) + END; + s[i] := 0X; (*Console.String(s)*) +END testTexts. diff --git a/src/tools/make/vishap.make b/src/tools/make/vishap.make index 62d90166..17bb1b95 100644 --- a/src/tools/make/vishap.make +++ b/src/tools/make/vishap.make @@ -45,7 +45,8 @@ clean: assemble: @printf "\nmake assemble - compiling Oberon compiler c source:\n" @printf " VERSION: %s\n" "$(VERSION)" - @printf " Target characeristics:\n" + @printf " BRANCH: %s\n" "$(BRANCH)" + @printf " Target characteristics:\n" @printf " PLATFORM: %s\n" "$(PLATFORM)" @printf " OS: %s\n" "$(OS)" @printf " BUILDDIR: %s\n" "$(BUILDDIR)" @@ -215,24 +216,27 @@ ooc2: cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc2/ooc2IntStr.Mod cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc2/ooc2Real0.Mod + +TODO: Comment disabled lines contain use of VAL that reads beyond source variable + ooc: @printf "\nMaking ooc library\n" cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocLowReal.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocLowLReal.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocRealMath.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocOakMath.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocLRealMath.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocLowLReal.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocRealMath.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocOakMath.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocLRealMath.Mod cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocLongInts.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocComplexMath.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocLComplexMath.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocComplexMath.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocLComplexMath.Mod cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocAscii.Mod cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocCharClass.Mod cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocStrings.Mod cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocConvTypes.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocLRealConv.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocLRealStr.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocRealConv.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocRealStr.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocLRealConv.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocLRealStr.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocRealConv.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocRealStr.Mod cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocIntConv.Mod cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocIntStr.Mod cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocMsg.Mod @@ -242,7 +246,7 @@ ooc: cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocStrings2.Mod cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocRts.Mod cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocFilenames.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocTextRider.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocTextRider.Mod cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocBinaryRider.Mod cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocJulianDay.Mod cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocFilenames.Mod @@ -265,52 +269,52 @@ ulm: cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmSYSTEM.Mod cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmEvents.Mod cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmProcess.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmResources.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmForwarders.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmRelatedEvents.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmResources.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmForwarders.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmRelatedEvents.Mod cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmTypes.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmStreams.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmStrings.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmStreams.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmStrings.Mod cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmSysTypes.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmTexts.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmSysConversions.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmErrors.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmSysErrors.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmSysStat.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmTexts.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmSysConversions.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmErrors.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmSysErrors.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmSysStat.Mod cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmASCII.Mod cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmSets.Mod cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmIO.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmAssertions.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmIndirectDisciplines.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmStreamDisciplines.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmAssertions.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmIndirectDisciplines.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmStreamDisciplines.Mod cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmIEEE.Mod cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmMC68881.Mod cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmReals.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmPrint.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmWrite.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmConstStrings.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmPlotters.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmSysIO.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmLoader.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmNetIO.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmPersistentObjects.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmPersistentDisciplines.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmOperations.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmScales.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmTimes.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmClocks.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmTimers.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmConditions.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmStreamConditions.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmTimeConditions.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmCiphers.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmCipherOps.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmBlockCiphers.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmAsymmetricCiphers.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmConclusions.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmRandomGenerators.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmTCrypt.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmIntOperations.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmPrint.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmWrite.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmConstStrings.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmPlotters.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmSysIO.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmLoader.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmNetIO.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmPersistentObjects.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmPersistentDisciplines.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmOperations.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmScales.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmTimes.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmClocks.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmTimers.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmConditions.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmStreamConditions.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmTimeConditions.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmCiphers.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmCipherOps.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmBlockCiphers.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmAsymmetricCiphers.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmConclusions.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmRandomGenerators.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmTCrypt.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmIntOperations.Mod pow32: @printf "\nMaking pow library\n" @@ -321,7 +325,7 @@ misc: cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/system/Oberon.Mod cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/misc/crt.Mod cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/misc/Listen.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/misc/MersenneTwister.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/misc/MersenneTwister.Mod cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/misc/MultiArrays.Mod cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/misc/MultiArrayRiders.Mod @@ -337,13 +341,13 @@ s3: cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/s3/ethZlibReaders.Mod cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/s3/ethZlibWriters.Mod cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/s3/ethZip.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/s3/ethRandomNumbers.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/s3/ethRandomNumbers.Mod cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/s3/ethGZReaders.Mod cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/s3/ethGZWriters.Mod cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/s3/ethUnicode.Mod cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/s3/ethDates.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/s3/ethReals.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/s3/ethStrings.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/s3/ethReals.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/s3/ethStrings.Mod librarybinary: @printf "\nMaking lib$(ONAME)\n" @@ -374,13 +378,18 @@ sourcechanges: +RUNTEST = COMPILER=$(COMPILER) OBECOMP=$(VISHAP) FLAVOUR=$(FLAVOUR) BRANCH=$(BRANCH) sh ./test.sh "$(INSTALLDIR)" + confidence: @printf "\n\n--- Confidence tests ---\n\n" - cd src/test/confidence/hello; COMPILER=$(COMPILER) FLAVOUR=$(FLAVOUR) sh ./test.sh "$(INSTALLDIR)" - cd src/test/confidence/language; COMPILER=$(COMPILER) FLAVOUR=$(FLAVOUR) sh ./test.sh "$(INSTALLDIR)" - if [ "$(PLATFORM)" != "windows" ] ; then cd src/test/confidence/signal; COMPILER=$(COMPILER) FLAVOUR=$(FLAVOUR) sh ./test.sh "$(INSTALLDIR)"; fi - cd src/test/confidence/lola; COMPILER=$(COMPILER) FLAVOUR=$(FLAVOUR) sh ./test.sh "$(INSTALLDIR)" - cd src/test/confidence/arrayassignment; COMPILER=$(COMPILER) FLAVOUR=$(FLAVOUR) sh ./test.sh "$(INSTALLDIR)" + cd src/test/confidence/hello; $(RUNTEST) + cd src/test/confidence/intsyntax; $(RUNTEST) + cd src/test/confidence/language; $(RUNTEST) + cd src/test/confidence/texts; $(RUNTEST) + cd src/test/confidence/library; $(RUNTEST) + cd src/test/confidence/lola; $(RUNTEST) + cd src/test/confidence/arrayassignment; $(RUNTEST) + if [ "$(PLATFORM)" != "windows" ] ; then cd src/test/confidence/signal; $(RUNTEST); fi @printf "\n\n--- Confidence tests passed ---\n\n" From 3a7b742ea78c9344f96be53cf50f86b3d0077656 Mon Sep 17 00:00:00 2001 From: David Brown Date: Wed, 24 Aug 2016 16:26:43 +0100 Subject: [PATCH 194/580] Update binary test process. --- src/test/confidence/testresult.sh | 2 +- src/tools/make/buildall.pl | 4 ++-- src/tools/make/postpush.pl | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/test/confidence/testresult.sh b/src/test/confidence/testresult.sh index eb7e485b..b4c7bd19 100755 --- a/src/test/confidence/testresult.sh +++ b/src/test/confidence/testresult.sh @@ -9,7 +9,7 @@ fi if [ -f new.asm ] then egrep '^[0-9 ]{4} ([0-9a-f]{4}| ) [0-9A-F]{2}[0-9A-F ]{6}' new.asm|cut -c 11- >new.$FLAVOUR.$BRANCH.s - if [ -f old.$FLAVOUR.$BRANCH.s -a old.$FLAVOUR.$BRANCH -nt ../planned-binary-change ] + if [ -f old.$FLAVOUR.$BRANCH.s -a old.$FLAVOUR.$BRANCH.s -nt ../planned-binary-change ] then if diff -b old.$FLAVOUR.$BRANCH.s new.$FLAVOUR.$BRANCH.s then echo "--- Generated code unchanged ---" diff --git a/src/tools/make/buildall.pl b/src/tools/make/buildall.pl index 3363bbc4..01f262c2 100755 --- a/src/tools/make/buildall.pl +++ b/src/tools/make/buildall.pl @@ -14,7 +14,7 @@ my %machines = ( "wind" => ['-p5932 dave@wax', "", "vishaps/voc", "export CC=gcc && make full;" . "export CC=i686-w64-mingw32-gcc && make full;" . "cd ~;" - . "sh start64.sh \\\"cd vishaps/voc && git checkout $branch && git pull;" + . "sh start64.sh \\\"cd vishaps/voc && git pull && git checkout $branch && git pull;" . "export CC=gcc && make full;" . "export CC=x86_64-w64-mingw32-gcc && make full\\\""], "android" => ['-p8022 root@and', "", "vishap/voc", "export CC=gcc && make full"], @@ -55,7 +55,7 @@ unlink glob "log/*"; for my $machine (sort keys %machines) { my ($login, $sudo, $dir, $mkcmd) = @{$machines{$machine}}; - my $cmd = "ssh $login \"cd $dir && $sudo git checkout $branch && $sudo git pull && $sudo $mkcmd\" "; + my $cmd = "ssh $login \"cd $dir && $sudo git pull && $sudo git checkout -f $branch && $sudo git pull && $sudo $mkcmd\" "; logged($cmd, $machine); } diff --git a/src/tools/make/postpush.pl b/src/tools/make/postpush.pl index a65fbb86..fe9e62ad 100755 --- a/src/tools/make/postpush.pl +++ b/src/tools/make/postpush.pl @@ -43,7 +43,7 @@ if ($buildneeded) { } else { close(STDIN); close(STDOUT); close(STDERR); # child process system 'echo Syncing voc>postpush.log'; - system '(cd voc; git pull; git checkout ' . $branch . ') >>postpush.log'; + system '(cd voc; git pull; git checkout -f ' . $branch . '; git pull; git checkout -f) >>postpush.log'; exec 'perl voc/src/tools/make/buildall.pl ' . $branch . ' >/tmp/buildall.log'; exit; } From 1f41d80b1efaf5c181588dbc6a944d14b8cd641c Mon Sep 17 00:00:00 2001 From: David Brown Date: Wed, 24 Aug 2016 18:45:52 +0100 Subject: [PATCH 195/580] Resnap test binaries with improved buinary extraction. --- src/test/confidence/planned-binary-change | 1 + src/test/confidence/testresult.sh | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/test/confidence/planned-binary-change b/src/test/confidence/planned-binary-change index e69de29b..78981922 100644 --- a/src/test/confidence/planned-binary-change +++ b/src/test/confidence/planned-binary-change @@ -0,0 +1 @@ +a diff --git a/src/test/confidence/testresult.sh b/src/test/confidence/testresult.sh index b4c7bd19..bdfcccfe 100755 --- a/src/test/confidence/testresult.sh +++ b/src/test/confidence/testresult.sh @@ -7,7 +7,8 @@ fi # Compare generated code if [ -f new.asm ] -then egrep '^[0-9 ]{4} ([0-9a-f]{4}| ) [0-9A-F]{2}[0-9A-F ]{6}' new.asm|cut -c 11- >new.$FLAVOUR.$BRANCH.s +#then egrep '^[0-9 ]{4} ([0-9a-f]{4}| ) [0-9A-F]{2}[0-9A-F ]{6}' new.asm|cut -c 11- >new.$FLAVOUR.$BRANCH.s +then sed -n '/^ *[0-9]\+ \([0-9a-f]\{4\}\| \) [0-9A-F]\{2\}[0-9A-F ]\{6\}/s/^ *[0-9]\+ ....//p' new.asm>new.$FLAVOUR.$BRANCH.s if [ -f old.$FLAVOUR.$BRANCH.s -a old.$FLAVOUR.$BRANCH.s -nt ../planned-binary-change ] then From da88496c5f0e45a3057530fd4fc76d35d6845824 Mon Sep 17 00:00:00 2001 From: David C W Brown Date: Thu, 25 Aug 2016 14:41:00 +0100 Subject: [PATCH 196/580] Tidy (#41) * Deduplicate common constants into OPM and do some source format tidying. * Fix postpush buildall script to force checkout of updated buildall. * Show enlistment branch in makefiles * Support non-printables in string literals and tidy case alignment and constant literals. * Common code for MIN and MAX of integer types. * Common code for SInt/Int/LInt in ConstOp parameter preparation. * Common code for SInt/Int/LInt in Op parameter preparation. * Refactor SetIntType to work with byte size directly. Prepare to revert my incorrect VAL changes. * Original meaning of VAL restored. Many library files disabled until use of VAL in 64 bits fixed. * Make Reals.Mod independent of INTEGER size and add reals tests. * Implement fraction, IsInfinity and IsNaN in oocLowReal.Mod. * OPB little simplifications and ShorterSize/LongerSize functions. * Add test for alignment computability * Replace alignment constants with calculated alignment. * typ.size aware OPV.Convert * Add SYSTEM_INT64 and make tests name independent. * Remove SYSTEM.H includes (string.h and stdint.h). * Replace uses of uintptr_t and size_t with SYSTEM_ADDRESS. * Sad hack to make FreeBSD and OpenBSD happy with memcpy declaration. * Detect 64 bit on FreeBSD, and size_t defined on OpenBSD. * %zd not supportd by mingw, cast strnlen return to int. * Add debug for intermittent failure only on OpenBSD. * Add textTexts as a confidence test and tidy up a couple of other tests. * Update binary test process. --- bootstrap/unix-44/Configuration.c | 4 +- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Console.c | 4 +- bootstrap/unix-44/Console.h | 2 +- bootstrap/unix-44/Files.c | 28 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 32 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 404 ++-- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 306 ++- bootstrap/unix-44/OPC.h | 5 +- bootstrap/unix-44/OPM.c | 176 +- bootstrap/unix-44/OPM.h | 8 +- bootstrap/unix-44/OPP.c | 26 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 12 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 18 +- bootstrap/unix-44/OPT.h | 5 +- bootstrap/unix-44/OPV.c | 96 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Platform.c | 20 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 24 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/SYSTEM.c | 12 +- bootstrap/unix-44/SYSTEM.h | 87 +- bootstrap/unix-44/Strings.c | 16 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 14 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/Vishap.c | 2 +- bootstrap/unix-44/errors.c | 33 +- bootstrap/unix-44/errors.h | 2 +- bootstrap/unix-44/extTools.c | 2 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-44/vt100.c | 4 +- bootstrap/unix-44/vt100.h | 2 +- bootstrap/unix-48/Configuration.c | 4 +- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Console.c | 4 +- bootstrap/unix-48/Console.h | 2 +- bootstrap/unix-48/Files.c | 28 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 32 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 404 ++-- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 306 ++- bootstrap/unix-48/OPC.h | 5 +- bootstrap/unix-48/OPM.c | 176 +- bootstrap/unix-48/OPM.h | 8 +- bootstrap/unix-48/OPP.c | 26 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 12 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 18 +- bootstrap/unix-48/OPT.h | 5 +- bootstrap/unix-48/OPV.c | 96 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Platform.c | 20 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 24 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/SYSTEM.c | 12 +- bootstrap/unix-48/SYSTEM.h | 87 +- bootstrap/unix-48/Strings.c | 16 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 14 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/Vishap.c | 2 +- bootstrap/unix-48/errors.c | 33 +- bootstrap/unix-48/errors.h | 2 +- bootstrap/unix-48/extTools.c | 2 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-48/vt100.c | 4 +- bootstrap/unix-48/vt100.h | 2 +- bootstrap/unix-88/Configuration.c | 4 +- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Console.c | 4 +- bootstrap/unix-88/Console.h | 2 +- bootstrap/unix-88/Files.c | 26 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 32 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 402 ++-- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 306 ++- bootstrap/unix-88/OPC.h | 5 +- bootstrap/unix-88/OPM.c | 176 +- bootstrap/unix-88/OPM.h | 8 +- bootstrap/unix-88/OPP.c | 26 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 12 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 18 +- bootstrap/unix-88/OPT.h | 5 +- bootstrap/unix-88/OPV.c | 96 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Platform.c | 20 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 18 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/SYSTEM.c | 12 +- bootstrap/unix-88/SYSTEM.h | 87 +- bootstrap/unix-88/Strings.c | 16 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 14 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/Vishap.c | 2 +- bootstrap/unix-88/errors.c | 33 +- bootstrap/unix-88/errors.h | 2 +- bootstrap/unix-88/extTools.c | 2 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/unix-88/vt100.c | 4 +- bootstrap/unix-88/vt100.h | 2 +- bootstrap/windows-48/Configuration.c | 4 +- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Console.c | 4 +- bootstrap/windows-48/Console.h | 2 +- bootstrap/windows-48/Files.c | 28 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 32 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 404 ++-- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 306 ++- bootstrap/windows-48/OPC.h | 5 +- bootstrap/windows-48/OPM.c | 176 +- bootstrap/windows-48/OPM.h | 8 +- bootstrap/windows-48/OPP.c | 26 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 12 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 18 +- bootstrap/windows-48/OPT.h | 5 +- bootstrap/windows-48/OPV.c | 96 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Platform.c | 60 +- bootstrap/windows-48/Platform.h | 6 +- bootstrap/windows-48/Reals.c | 24 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/SYSTEM.c | 12 +- bootstrap/windows-48/SYSTEM.h | 87 +- bootstrap/windows-48/Strings.c | 16 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 14 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/Vishap.c | 2 +- bootstrap/windows-48/errors.c | 33 +- bootstrap/windows-48/errors.h | 2 +- bootstrap/windows-48/extTools.c | 2 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-48/vt100.c | 4 +- bootstrap/windows-48/vt100.h | 2 +- bootstrap/windows-88/Configuration.c | 4 +- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Console.c | 4 +- bootstrap/windows-88/Console.h | 2 +- bootstrap/windows-88/Files.c | 26 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 32 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 402 ++-- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 306 ++- bootstrap/windows-88/OPC.h | 5 +- bootstrap/windows-88/OPM.c | 176 +- bootstrap/windows-88/OPM.h | 8 +- bootstrap/windows-88/OPP.c | 26 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 12 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 18 +- bootstrap/windows-88/OPT.h | 5 +- bootstrap/windows-88/OPV.c | 96 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Platform.c | 60 +- bootstrap/windows-88/Platform.h | 6 +- bootstrap/windows-88/Reals.c | 18 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/SYSTEM.c | 12 +- bootstrap/windows-88/SYSTEM.h | 87 +- bootstrap/windows-88/Strings.c | 16 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 14 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/Vishap.c | 2 +- bootstrap/windows-88/errors.c | 33 +- bootstrap/windows-88/errors.h | 2 +- bootstrap/windows-88/extTools.c | 2 +- bootstrap/windows-88/extTools.h | 2 +- bootstrap/windows-88/vt100.c | 4 +- bootstrap/windows-88/vt100.h | 2 +- makefile | 29 + src/compiler/OPB.Mod | 1944 +++++++++--------- src/compiler/OPC.Mod | 2710 +++++++++++++------------- src/compiler/OPM.cmdln.Mod | 159 +- src/compiler/OPP.Mod | 716 ++++--- src/compiler/OPS.Mod | 261 +-- src/compiler/OPT.Mod | 1448 +++++++------- src/compiler/OPV.Mod | 1112 +++++------ src/compiler/errors.Mod | 5 +- src/system/Files.Mod | 7 +- src/system/Heap.Mod | 2 +- src/system/Platformunix.Mod | 10 +- src/system/Platformwindows.Mod | 46 +- src/system/SYSTEM.c | 12 +- src/system/SYSTEM.h | 87 +- src/test/events/clb.Mod | 43 +- src/test/files/testFiles.Mod | 33 +- src/tools/make/configure.c | 3 +- src/tools/make/sourcechanges.sh | 4 +- 224 files changed, 7494 insertions(+), 8065 deletions(-) diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index 1f5afbb7..821dff97 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -13,6 +13,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/08/24] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/08/23] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index eef3a15d..ec5e865a 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Console.c b/bootstrap/unix-44/Console.c index 5fa65e00..f9161937 100644 --- a/bootstrap/unix-44/Console.c +++ b/bootstrap/unix-44/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Platform.h" @@ -21,7 +21,7 @@ export void Console_String (CHAR *s, LONGINT s__len); void Console_Flush (void) { INTEGER error; - error = Platform_Write(((LONGINT)(1)), (LONGINT)(uintptr_t)Console_line, Console_pos); + error = Platform_Write(((LONGINT)(1)), (LONGINT)(SYSTEM_ADDRESS)Console_line, Console_pos); Console_pos = 0; } diff --git a/bootstrap/unix-44/Console.h b/bootstrap/unix-44/Console.h index 53dbdfa8..5fdd4e4d 100644 --- a/bootstrap/unix-44/Console.h +++ b/bootstrap/unix-44/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 5d92e963..5a1dd875 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" @@ -257,7 +257,7 @@ static void Files_Flush (Files_Buffer buf) if (buf->org != f->pos) { error = Platform_Seek(f->fd, buf->org, Platform_SeekSet); } - error = Platform_Write(f->fd, (LONGINT)(uintptr_t)buf->data, buf->size); + error = Platform_Write(f->fd, (LONGINT)(SYSTEM_ADDRESS)buf->data, buf->size); if (error != 0) { Files_Err((CHAR*)"error writing file", (LONGINT)19, f, error); } @@ -656,7 +656,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x } else { min = n; } - __MOVE((LONGINT)(uintptr_t)buf->data + offset, (LONGINT)(uintptr_t)x + xpos, min); + __MOVE((LONGINT)(SYSTEM_ADDRESS)buf->data + offset, (LONGINT)(SYSTEM_ADDRESS)x + xpos, min); offset += min; (*r).offset = offset; xpos += min; @@ -721,7 +721,7 @@ void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT } else { min = n; } - __MOVE((LONGINT)(uintptr_t)x + xpos, (LONGINT)(uintptr_t)buf->data + offset, min); + __MOVE((LONGINT)(SYSTEM_ADDRESS)x + xpos, (LONGINT)(SYSTEM_ADDRESS)buf->data + offset, min); offset += min; (*r).offset = offset; if (offset > buf->size) { @@ -772,15 +772,15 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT *res = 3; return; } - error = Platform_Read(fdold, (LONGINT)(uintptr_t)buf, ((LONGINT)(4096)), &n); + error = Platform_Read(fdold, (LONGINT)(SYSTEM_ADDRESS)buf, ((LONGINT)(4096)), &n); while (n > 0) { - error = Platform_Write(fdnew, (LONGINT)(uintptr_t)buf, n); + error = Platform_Write(fdnew, (LONGINT)(SYSTEM_ADDRESS)buf, n); if (error != 0) { ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); Files_Err((CHAR*)"cannot move file", (LONGINT)17, NIL, error); } - error = Platform_Read(fdold, (LONGINT)(uintptr_t)buf, ((LONGINT)(4096)), &n); + error = Platform_Read(fdold, (LONGINT)(SYSTEM_ADDRESS)buf, ((LONGINT)(4096)), &n); } ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); @@ -838,7 +838,7 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *de j += 1; } } else { - __MOVE((LONGINT)(uintptr_t)src, (LONGINT)(uintptr_t)dest, src__len); + __MOVE((LONGINT)(SYSTEM_ADDRESS)src, (LONGINT)(SYSTEM_ADDRESS)dest, src__len); } } @@ -858,14 +858,16 @@ void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, LONGINT *x) { CHAR b[4]; Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); - *x = ((LONGINT)((int)b[0] + __ASHL((int)b[1], 8)) + __ASHL((LONGINT)b[2], 16)) + __ASHL((LONGINT)b[3], 24); + *x = ((int)((int)b[0] + __ASHL((int)b[1], 8)) + __ASHL((int)b[2], 16)) + __ASHL((int)b[3], 24); } void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x) { CHAR b[4]; + LONGINT l; Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); - *x = (SET)(((LONGINT)((int)b[0] + __ASHL((int)b[1], 8)) + __ASHL((LONGINT)b[2], 16)) + __ASHL((LONGINT)b[3], 24)); + l = ((int)((int)b[0] + __ASHL((int)b[1], 8)) + __ASHL((int)b[2], 16)) + __ASHL((int)b[3], 24); + *x = (SET)l; } void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x) @@ -921,11 +923,11 @@ void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, LONGINT *x) n = 0; Files_Read(&*R, R__typ, (void*)&ch); while ((int)ch >= 128) { - n += __ASH((LONGINT)((int)ch - 128), s); + n += __ASH((int)((int)ch - 128), s); s += 7; Files_Read(&*R, R__typ, (void*)&ch); } - n += __ASH((LONGINT)(__MASK((int)ch, -64) - __ASHL(__ASHR((int)ch, 6), 6)), s); + n += __ASH((int)(__MASK((int)ch, -64) - __ASHL(__ASHR((int)ch, 6), 6)), s); *x = n; } @@ -1006,7 +1008,7 @@ static void Files_Finalize (SYSTEM_PTR o) { Files_File f = NIL; LONGINT res; - f = (Files_File)(uintptr_t)o; + f = (Files_File)(SYSTEM_ADDRESS)o; if (f->fd >= 0) { Files_CloseOSFile(f); if (f->tempFile) { diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index b60e6242..a4a4ea8c 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index 4cabf8c6..30ec687a 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tskSfF */ #include "SYSTEM.h" struct Heap__1 { @@ -101,7 +101,7 @@ export void Heap_Unlock (void); extern void *Heap__init(); extern LONGINT Platform_MainStackFrame; extern LONGINT Platform_OSAllocate(LONGINT size); -#define Heap_FetchAddress(pointer) (LONGINT)(uintptr_t)(*((void**)((uintptr_t)pointer))) +#define Heap_FetchAddress(pointer) (LONGINT)(SYSTEM_ADDRESS)(*((void**)((SYSTEM_ADDRESS)pointer))) #define Heap_HeapModuleInit() Heap__init() #define Heap_OSAllocate(size) Platform_OSAllocate(size) #define Heap_PlatformHalt(code) Platform_Halt(code) @@ -134,7 +134,7 @@ SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) __COPY(name, m->name, ((LONGINT)(20))); m->refcnt = 0; m->enumPtrs = enumPtrs; - m->next = (Heap_Module)(uintptr_t)Heap_modules; + m->next = (Heap_Module)(SYSTEM_ADDRESS)Heap_modules; Heap_modules = (SYSTEM_PTR)m; _o_result = (void*)m; return _o_result; @@ -315,7 +315,7 @@ SYSTEM_PTR Heap_NEWREC (LONGINT tag) __PUT(adr + 8, 0, LONGINT); Heap_allocated += blksz; Heap_Unlock(); - _o_result = (SYSTEM_PTR)(uintptr_t)(adr + 4); + _o_result = (SYSTEM_PTR)(SYSTEM_ADDRESS)(adr + 4); return _o_result; } @@ -326,12 +326,12 @@ SYSTEM_PTR Heap_NEWBLK (LONGINT size) SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 31, 4), 4); - new = Heap_NEWREC((LONGINT)(uintptr_t)&blksz); - tag = ((LONGINT)(uintptr_t)new + blksz) - 12; + new = Heap_NEWREC((LONGINT)(SYSTEM_ADDRESS)&blksz); + tag = ((LONGINT)(SYSTEM_ADDRESS)new + blksz) - 12; __PUT(tag - 4, 0, LONGINT); __PUT(tag, blksz, LONGINT); __PUT(tag + 4, -4, LONGINT); - __PUT((LONGINT)(uintptr_t)new - 4, tag, LONGINT); + __PUT((LONGINT)(SYSTEM_ADDRESS)new - 4, tag, LONGINT); Heap_Unlock(); _o_result = new; return _o_result; @@ -360,7 +360,7 @@ static void Heap_Mark (LONGINT q) __GET(tag, offset, LONGINT); fld = q + offset; p = Heap_FetchAddress(fld); - __PUT(fld, (SYSTEM_PTR)(uintptr_t)n, SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADDRESS)n, SYSTEM_PTR); } else { fld = q + offset; n = Heap_FetchAddress(fld); @@ -369,7 +369,7 @@ static void Heap_Mark (LONGINT q) if (!__ODD(tagbits)) { __PUT(n - 4, tagbits + 1, LONGINT); __PUT(q - 4, tag + 1, LONGINT); - __PUT(fld, (SYSTEM_PTR)(uintptr_t)p, SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADDRESS)p, SYSTEM_PTR); p = q; q = n; tag = tagbits; @@ -384,7 +384,7 @@ static void Heap_Mark (LONGINT q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((LONGINT)(uintptr_t)p); + Heap_Mark((LONGINT)(SYSTEM_ADDRESS)p); } static void Heap_Scan (void) @@ -553,7 +553,7 @@ static void Heap_Finalize (void) } else { prev->next = n->next; } - (*n->finalize)((SYSTEM_PTR)(uintptr_t)n->obj); + (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADDRESS)n->obj); if (prev == NIL) { n = Heap_fin; } else { @@ -572,7 +572,7 @@ void Heap_FINALL (void) while (Heap_fin != NIL) { n = Heap_fin; Heap_fin = Heap_fin->next; - (*n->finalize)((SYSTEM_PTR)(uintptr_t)n->obj); + (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADDRESS)n->obj); } } @@ -589,9 +589,9 @@ static void Heap_MarkStack (LONGINT n, LONGINT *cand, LONGINT cand__len) } if (n == 0) { nofcand = 0; - sp = (LONGINT)(uintptr_t)&frame; + sp = (LONGINT)(SYSTEM_ADDRESS)&frame; stack0 = Heap_PlatformMainStackFrame(); - inc = (LONGINT)(uintptr_t)&align.p - (LONGINT)(uintptr_t)&align; + inc = (LONGINT)(SYSTEM_ADDRESS)&align.p - (LONGINT)(SYSTEM_ADDRESS)&align; if (sp > stack0) { inc = -inc; } @@ -622,7 +622,7 @@ void Heap_GC (BOOLEAN markStack) LONGINT cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); - m = (Heap_Module)(uintptr_t)Heap_modules; + m = (Heap_Module)(SYSTEM_ADDRESS)Heap_modules; while (m != NIL) { if (m->enumPtrs != NIL) { (*m->enumPtrs)(Heap_MarkP); @@ -699,7 +699,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (LONGINT)(uintptr_t)obj; + f->obj = (LONGINT)(SYSTEM_ADDRESS)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index 38e549be..a2cab30c 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index d5164a2a..330b7506 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Heap.h" diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index 5e27b653..ac8ac89e 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index d834a9e8..0f614e6a 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" @@ -34,7 +34,9 @@ export void OPB_In (OPT_Node *x, OPT_Node y); export void OPB_Index (OPT_Node *x, OPT_Node y); export void OPB_Inittd (OPT_Node *inittd, OPT_Node *last, OPT_Struct typ); static BOOLEAN OPB_IntToBool (LONGINT i); +static OPT_Struct OPB_IntType (LONGINT size); export void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y); +static LONGINT OPB_LongerSize (LONGINT i); export void OPB_MOp (SHORTINT op, OPT_Node *x); export OPT_Node OPB_NewBoolConst (BOOLEAN boolval); export OPT_Node OPB_NewIntConst (LONGINT intval); @@ -51,6 +53,8 @@ export void OPB_Return (OPT_Node *x, OPT_Object proc); export void OPB_SetElem (OPT_Node *x); static void OPB_SetIntType (OPT_Node node); export void OPB_SetRange (OPT_Node *x, OPT_Node y); +static LONGINT OPB_ShorterSize (LONGINT i); +static INTEGER OPB_SignedByteSize (LONGINT n); export void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno); export void OPB_StPar0 (OPT_Node *par0, INTEGER fctno); export void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno); @@ -90,8 +94,8 @@ OPT_Node OPB_NewLeaf (OPT_Object obj) node = OPT_NewNode(9); break; default: - OPB_err(127); node = OPT_NewNode(0); + OPB_err(127); break; } node->obj = obj; @@ -220,21 +224,68 @@ OPT_Node OPB_EmptySet (void) return _o_result; } +static INTEGER OPB_SignedByteSize (LONGINT n) +{ + INTEGER _o_result; + INTEGER b; + if (n < 0) { + n = -(n + 1); + } + b = 1; + while ((b < 8 && __ASH(n, -(__ASHL(b, 3) - 1)) != 0)) { + b += 1; + } + _o_result = b; + return _o_result; +} + +static LONGINT OPB_ShorterSize (LONGINT i) +{ + LONGINT _o_result; + if (i >= (int)OPM_LIntSize) { + _o_result = OPM_IntSize; + return _o_result; + } else { + _o_result = OPM_SIntSize; + return _o_result; + } + __RETCHK; +} + +static LONGINT OPB_LongerSize (LONGINT i) +{ + LONGINT _o_result; + if (i <= (int)OPM_SIntSize) { + _o_result = OPM_IntSize; + return _o_result; + } else { + _o_result = OPM_LIntSize; + return _o_result; + } + __RETCHK; +} + +static OPT_Struct OPB_IntType (LONGINT size) +{ + OPT_Struct _o_result; + OPT_Struct result = NIL; + if (size <= OPT_sinttyp->size) { + result = OPT_sinttyp; + } else if (size <= OPT_inttyp->size) { + result = OPT_inttyp; + } else { + result = OPT_linttyp; + } + if (size > OPT_linttyp->size) { + OPB_err(203); + } + _o_result = result; + return _o_result; +} + static void OPB_SetIntType (OPT_Node node) { - LONGINT v; - v = node->conval->intval; - if ((OPM_MinSInt <= (LONGINT)v && (LONGINT)v <= OPM_MaxSInt)) { - node->typ = OPT_sinttyp; - } else if ((OPM_MinInt <= (LONGINT)v && (LONGINT)v <= OPM_MaxInt)) { - node->typ = OPT_inttyp; - } else if ((OPM_MinLInt <= v && v <= OPM_MaxLInt)) { - node->typ = OPT_linttyp; - } else { - OPB_err(203); - node->typ = OPT_sinttyp; - node->conval->intval = 1; - } + node->typ = OPB_IntType(OPB_SignedByteSize(node->conval->intval)); } OPT_Node OPB_NewIntConst (LONGINT intval) @@ -378,16 +429,16 @@ void OPB_Field (OPT_Node *x, OPT_Object y) } } -static struct TypTest__57 { +static struct TypTest__61 { OPT_Node *x; OPT_Object *obj; BOOLEAN *guard; - struct TypTest__57 *lnk; -} *TypTest__57_s; + struct TypTest__61 *lnk; +} *TypTest__61_s; -static void GTT__58 (OPT_Struct t0, OPT_Struct t1); +static void GTT__62 (OPT_Struct t0, OPT_Struct t1); -static void GTT__58 (OPT_Struct t0, OPT_Struct t1) +static void GTT__62 (OPT_Struct t0, OPT_Struct t1) { OPT_Node node = NIL; OPT_Struct t = NIL; @@ -400,54 +451,54 @@ static void GTT__58 (OPT_Struct t0, OPT_Struct t1) t1 = t1->BaseTyp; } if (t1 == t0 || t0->form == 0) { - if (*TypTest__57_s->guard) { - OPB_BindNodes(5, NIL, &*TypTest__57_s->x, NIL); - (*TypTest__57_s->x)->readonly = (*TypTest__57_s->x)->left->readonly; + if (*TypTest__61_s->guard) { + OPB_BindNodes(5, NIL, &*TypTest__61_s->x, NIL); + (*TypTest__61_s->x)->readonly = (*TypTest__61_s->x)->left->readonly; } else { node = OPT_NewNode(11); node->subcl = 16; - node->left = *TypTest__57_s->x; - node->obj = *TypTest__57_s->obj; - *TypTest__57_s->x = node; + node->left = *TypTest__61_s->x; + node->obj = *TypTest__61_s->obj; + *TypTest__61_s->x = node; } } else { OPB_err(85); } } else if (t0 != t1) { OPB_err(85); - } else if (!*TypTest__57_s->guard) { - if ((*TypTest__57_s->x)->class == 5) { + } else if (!*TypTest__61_s->guard) { + if ((*TypTest__61_s->x)->class == 5) { node = OPT_NewNode(11); node->subcl = 16; - node->left = *TypTest__57_s->x; - node->obj = *TypTest__57_s->obj; - *TypTest__57_s->x = node; + node->left = *TypTest__61_s->x; + node->obj = *TypTest__61_s->obj; + *TypTest__61_s->x = node; } else { - *TypTest__57_s->x = OPB_NewBoolConst(1); + *TypTest__61_s->x = OPB_NewBoolConst(1); } } } void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) { - struct TypTest__57 _s; + struct TypTest__61 _s; _s.x = x; _s.obj = &obj; _s.guard = &guard; - _s.lnk = TypTest__57_s; - TypTest__57_s = &_s; + _s.lnk = TypTest__61_s; + TypTest__61_s = &_s; if (OPB_NotVar(*x)) { OPB_err(112); } else if ((*x)->typ->form == 13) { if (((*x)->typ->BaseTyp->comp != 4 && (*x)->typ != OPT_sysptrtyp)) { OPB_err(85); } else if (obj->typ->form == 13) { - GTT__58((*x)->typ->BaseTyp, obj->typ->BaseTyp); + GTT__62((*x)->typ->BaseTyp, obj->typ->BaseTyp); } else { OPB_err(86); } } else if (((((*x)->typ->comp == 4 && (*x)->class == 1)) && obj->typ->comp == 4)) { - GTT__58((*x)->typ, obj->typ); + GTT__62((*x)->typ, obj->typ); } else { OPB_err(87); } @@ -456,7 +507,7 @@ void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) } else { (*x)->typ = OPT_booltyp; } - TypTest__57_s = _s.lnk; + TypTest__61_s = _s.lnk; } void OPB_In (OPT_Node *x, OPT_Node y) @@ -469,7 +520,7 @@ void OPB_In (OPT_Node *x, OPT_Node y) } else if ((__IN(f, 0x70) && y->typ->form == 9)) { if ((*x)->class == 7) { k = (*x)->conval->intval; - if (k < 0 || k > (LONGINT)OPM_MaxSet) { + if (k < 0 || k > (int)OPM_MaxSet) { OPB_err(202); } else if (y->class == 7) { (*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval)); @@ -522,13 +573,13 @@ static void OPB_CheckRealType (INTEGER f, INTEGER nr, OPT_Const x) x->intval = -1; } -static struct MOp__28 { - struct MOp__28 *lnk; -} *MOp__28_s; +static struct MOp__30 { + struct MOp__30 *lnk; +} *MOp__30_s; -static OPT_Node NewOp__29 (SHORTINT op, OPT_Struct typ, OPT_Node z); +static OPT_Node NewOp__31 (SHORTINT op, OPT_Struct typ, OPT_Node z); -static OPT_Node NewOp__29 (SHORTINT op, OPT_Struct typ, OPT_Node z) +static OPT_Node NewOp__31 (SHORTINT op, OPT_Struct typ, OPT_Node z) { OPT_Node _o_result; OPT_Node node = NIL; @@ -545,9 +596,9 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) INTEGER f; OPT_Struct typ = NIL; OPT_Node z = NIL; - struct MOp__28 _s; - _s.lnk = MOp__28_s; - MOp__28_s = &_s; + struct MOp__30 _s; + _s.lnk = MOp__30_s; + MOp__30_s = &_s; z = *x; if (z->class == 8 || z->class == 9) { OPB_err(126); @@ -561,7 +612,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->conval->intval = OPB_BoolToInt(!OPB_IntToBool(z->conval->intval)); z->obj = NIL; } else { - z = NewOp__29(op, typ, z); + z = NewOp__31(op, typ, z); } } else { OPB_err(98); @@ -589,7 +640,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } z->obj = NIL; } else { - z = NewOp__29(op, typ, z); + z = NewOp__31(op, typ, z); } } else { OPB_err(97); @@ -610,7 +661,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } z->obj = NIL; } else { - z = NewOp__29(op, typ, z); + z = NewOp__31(op, typ, z); } } else { OPB_err(111); @@ -622,7 +673,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->conval->intval = (int)__CAP((CHAR)z->conval->intval); z->obj = NIL; } else { - z = NewOp__29(op, typ, z); + z = NewOp__31(op, typ, z); } } else { OPB_err(111); @@ -635,7 +686,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->conval->intval = OPB_BoolToInt(__ODD(z->conval->intval)); z->obj = NIL; } else { - z = NewOp__29(op, typ, z); + z = NewOp__31(op, typ, z); } } else { OPB_err(111); @@ -648,7 +699,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) f = 10; } if (z->class < 7 || f == 10) { - z = NewOp__29(op, typ, z); + z = NewOp__31(op, typ, z); } else { OPB_err(127); } @@ -657,7 +708,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) case 25: if ((__IN(f, 0x70) && z->class == 7)) { if ((0 <= z->conval->intval && z->conval->intval <= -1)) { - z = NewOp__29(op, typ, z); + z = NewOp__31(op, typ, z); } else { OPB_err(219); } @@ -674,7 +725,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } } *x = z; - MOp__28_s = _s.lnk; + MOp__30_s = _s.lnk; } static void OPB_CheckPtr (OPT_Node x, OPT_Node y) @@ -865,41 +916,13 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) __GUARDEQP(yval, OPT_ConstDesc) = *xval; } break; - case 4: + case 4: case 5: case 6: if (__IN(g, 0x70)) { - x->typ = y->typ; - } else if (g == 7) { - x->typ = OPT_realtyp; - xval->realval = xval->intval; - } else if (g == 8) { - x->typ = OPT_lrltyp; - xval->realval = xval->intval; - } else { - OPB_err(100); - y->typ = x->typ; - __GUARDEQP(yval, OPT_ConstDesc) = *xval; - } - break; - case 5: - if (g == 4) { - y->typ = OPT_inttyp; - } else if (__IN(g, 0x70)) { - x->typ = y->typ; - } else if (g == 7) { - x->typ = OPT_realtyp; - xval->realval = xval->intval; - } else if (g == 8) { - x->typ = OPT_lrltyp; - xval->realval = xval->intval; - } else { - OPB_err(100); - y->typ = x->typ; - __GUARDEQP(yval, OPT_ConstDesc) = *xval; - } - break; - case 6: - if (__IN(g, 0x70)) { - y->typ = OPT_linttyp; + if (x->typ->size <= y->typ->size) { + x->typ = y->typ; + } else { + x->typ = OPB_IntType(x->typ->size); + } } else if (g == 7) { x->typ = OPT_realtyp; xval->realval = xval->intval; @@ -1178,7 +1201,7 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) OPB_err(203); r = (LONGREAL)1; } - (*x)->conval->intval = __ENTIER(r); + (*x)->conval->intval = (int)__ENTIER(r); OPB_SetIntType(*x); } } @@ -1196,15 +1219,15 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) (*x)->typ = typ; } -static struct Op__38 { +static struct Op__40 { INTEGER *f, *g; - struct Op__38 *lnk; -} *Op__38_s; + struct Op__40 *lnk; +} *Op__40_s; -static void NewOp__39 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y); -static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y); +static void NewOp__41 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y); +static BOOLEAN strings__43 (OPT_Node *x, OPT_Node *y); -static void NewOp__39 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y) +static void NewOp__41 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y) { OPT_Node node = NIL; node = OPT_NewNode(12); @@ -1215,29 +1238,29 @@ static void NewOp__39 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y) *x = node; } -static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) +static BOOLEAN strings__43 (OPT_Node *x, OPT_Node *y) { BOOLEAN _o_result; BOOLEAN ok, xCharArr, yCharArr; - xCharArr = (__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp->form == 3) || *Op__38_s->f == 10; - yCharArr = (__IN((*y)->typ->comp, 0x0c) && (*y)->typ->BaseTyp->form == 3) || *Op__38_s->g == 10; - if ((((xCharArr && *Op__38_s->g == 3)) && (*y)->class == 7)) { + xCharArr = (__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp->form == 3) || *Op__40_s->f == 10; + yCharArr = (__IN((*y)->typ->comp, 0x0c) && (*y)->typ->BaseTyp->form == 3) || *Op__40_s->g == 10; + if ((((xCharArr && *Op__40_s->g == 3)) && (*y)->class == 7)) { OPB_CharToString(*y); - *Op__38_s->g = 10; + *Op__40_s->g = 10; yCharArr = 1; } - if ((((yCharArr && *Op__38_s->f == 3)) && (*x)->class == 7)) { + if ((((yCharArr && *Op__40_s->f == 3)) && (*x)->class == 7)) { OPB_CharToString(*x); - *Op__38_s->f = 10; + *Op__40_s->f = 10; xCharArr = 1; } ok = (xCharArr && yCharArr); if (ok) { - if ((*Op__38_s->f == 10 && (*x)->conval->intval2 == 1)) { + if ((*Op__40_s->f == 10 && (*x)->conval->intval2 == 1)) { (*x)->typ = OPT_chartyp; (*x)->conval->intval = 0; OPB_Index(&*y, OPB_NewIntConst(((LONGINT)(0)))); - } else if ((*Op__38_s->g == 10 && (*y)->conval->intval2 == 1)) { + } else if ((*Op__40_s->g == 10 && (*y)->conval->intval2 == 1)) { (*y)->typ = OPT_chartyp; (*y)->conval->intval = 0; OPB_Index(&*x, OPB_NewIntConst(((LONGINT)(0)))); @@ -1254,11 +1277,11 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPT_Struct typ = NIL; BOOLEAN do_; LONGINT val; - struct Op__38 _s; + struct Op__40 _s; _s.f = &f; _s.g = &g; - _s.lnk = Op__38_s; - Op__38_s = &_s; + _s.lnk = Op__40_s; + Op__40_s = &_s; z = *x; if (((z->class == 8 || z->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); @@ -1276,15 +1299,8 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPB_err(100); } break; - case 4: - if (__IN(g, 0x01f0)) { - OPB_Convert(&z, y->typ); - } else { - OPB_err(100); - } - break; - case 5: - if (g == 4) { + case 4: case 5: case 6: + if ((__IN(g, 0x70) && y->typ->size < z->typ->size)) { OPB_Convert(&y, z->typ); } else if (__IN(g, 0x01f0)) { OPB_Convert(&z, y->typ); @@ -1292,15 +1308,6 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPB_err(100); } break; - case 6: - if (__IN(g, 0x70)) { - OPB_Convert(&y, z->typ); - } else if (__IN(g, 0x0180)) { - OPB_Convert(&z, y->typ); - } else { - OPB_err(100); - } - break; case 7: if (__IN(g, 0x70)) { OPB_Convert(&y, z->typ); @@ -1386,7 +1393,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) typ = OPT_undftyp; } if (do_) { - NewOp__39(op, typ, &z, y); + NewOp__41(op, typ, &z, y); } break; case 2: @@ -1405,7 +1412,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPB_err(102); typ = OPT_undftyp; } - NewOp__39(op, typ, &z, y); + NewOp__41(op, typ, &z, y); break; case 3: do_ = 1; @@ -1428,7 +1435,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) typ = OPT_undftyp; } if (do_) { - NewOp__39(op, typ, &z, y); + NewOp__41(op, typ, &z, y); } break; case 4: @@ -1446,7 +1453,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPB_err(104); typ = OPT_undftyp; } - NewOp__39(op, typ, &z, y); + NewOp__41(op, typ, &z, y); break; case 5: if (f == 2) { @@ -1456,7 +1463,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } } else if ((y->class == 7 && OPB_IntToBool(y->conval->intval))) { } else { - NewOp__39(op, typ, &z, y); + NewOp__41(op, typ, &z, y); } } else if (f != 0) { OPB_err(94); @@ -1479,7 +1486,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } } if (do_) { - NewOp__39(op, typ, &z, y); + NewOp__41(op, typ, &z, y); } break; case 7: @@ -1488,7 +1495,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) typ = OPT_undftyp; } if ((!__IN(f, 0x70) || y->class != 7) || y->conval->intval != 0) { - NewOp__39(op, typ, &z, y); + NewOp__41(op, typ, &z, y); } break; case 8: @@ -1499,7 +1506,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } } else if ((y->class == 7 && !OPB_IntToBool(y->conval->intval))) { } else { - NewOp__39(op, typ, &z, y); + NewOp__41(op, typ, &z, y); } } else if (f != 0) { OPB_err(95); @@ -1507,16 +1514,16 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 9: case 10: - if (__IN(f, 0x6bff) || strings__41(&z, &y)) { + if (__IN(f, 0x6bff) || strings__43(&z, &y)) { typ = OPT_booltyp; } else { OPB_err(107); typ = OPT_undftyp; } - NewOp__39(op, typ, &z, y); + NewOp__41(op, typ, &z, y); break; case 11: case 12: case 13: case 14: - if (__IN(f, 0x01f9) || strings__41(&z, &y)) { + if (__IN(f, 0x01f9) || strings__43(&z, &y)) { typ = OPT_booltyp; } else { OPM_LogWLn(); @@ -1525,7 +1532,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPB_err(108); typ = OPT_undftyp; } - NewOp__39(op, typ, &z, y); + NewOp__41(op, typ, &z, y); break; default: OPM_LogWStr((CHAR*)"unhandled case in OPB.Op, op = ", (LONGINT)32); @@ -1535,7 +1542,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } } *x = z; - Op__38_s = _s.lnk; + Op__40_s = _s.lnk; } void OPB_SetRange (OPT_Node *x, OPT_Node y) @@ -1546,13 +1553,13 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y) } else if ((__IN((*x)->typ->form, 0x70) && __IN(y->typ->form, 0x70))) { if ((*x)->class == 7) { k = (*x)->conval->intval; - if (0 > k || k > (LONGINT)OPM_MaxSet) { + if (0 > k || k > (int)OPM_MaxSet) { OPB_err(202); } } if (y->class == 7) { l = y->conval->intval; - if (0 > l || l > (LONGINT)OPM_MaxSet) { + if (0 > l || l > (int)OPM_MaxSet) { OPB_err(202); } } @@ -1582,7 +1589,7 @@ void OPB_SetElem (OPT_Node *x) OPB_err(93); } else if ((*x)->class == 7) { k = (*x)->conval->intval; - if ((0 <= k && k <= (LONGINT)OPM_MaxSet)) { + if ((0 <= k && k <= (int)OPM_MaxSet)) { (*x)->conval->setval = __SETOF(k); } else { OPB_err(202); @@ -1596,8 +1603,9 @@ void OPB_SetElem (OPT_Node *x) static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) { + OPT_Struct y = NIL; INTEGER f, g; - OPT_Struct y = NIL, p = NIL, q = NIL; + OPT_Struct p = NIL, q = NIL; if (OPM_Verbose) { OPM_LogWLn(); OPM_LogWStr((CHAR*)"PROCEDURE CheckAssign", (LONGINT)22); @@ -1627,31 +1635,20 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) case 0: case 10: break; case 1: - if (!__IN(g, 0x1a)) { + if (!((__IN(g, 0x7a) && y->size == 1))) { OPB_err(113); } break; - case 2: case 3: case 4: case 9: + case 2: case 3: case 9: if (g != f) { OPB_err(113); } break; - case 5: - if (!__IN(g, 0x30)) { + case 4: case 5: case 6: + if (!__IN(g, 0x70) || x->size < y->size) { OPB_err(113); } break; - case 6: - if (OPM_LIntSize == 4) { - if (!__IN(g, 0x70)) { - OPB_err(113); - } - } else { - if (!__IN(g, 0x70)) { - OPB_err(113); - } - } - break; case 7: if (!__IN(g, 0xf0)) { OPB_err(113); @@ -1832,14 +1829,8 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) x = OPB_NewIntConst(((LONGINT)(0))); x->typ = OPT_chartyp; break; - case 4: - x = OPB_NewIntConst(OPM_MinSInt); - break; - case 5: - x = OPB_NewIntConst(OPM_MinInt); - break; - case 6: - x = OPB_NewIntConst(OPM_MinLInt); + case 4: case 5: case 6: + x = OPB_NewIntConst(OPM_SignedMinimum(x->typ->size)); break; case 9: x = OPB_NewIntConst(((LONGINT)(0))); @@ -1869,14 +1860,8 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) x = OPB_NewIntConst(((LONGINT)(255))); x->typ = OPT_chartyp; break; - case 4: - x = OPB_NewIntConst(OPM_MaxSInt); - break; - case 5: - x = OPB_NewIntConst(OPM_MaxInt); - break; - case 6: - x = OPB_NewIntConst(OPM_MaxLInt); + case 4: case 5: case 6: + x = OPB_NewIntConst(OPM_SignedMaximum(x->typ->size)); break; case 9: x = OPB_NewIntConst(OPM_MaxSet); @@ -1909,10 +1894,8 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 10: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 5) { - OPB_Convert(&x, OPT_sinttyp); - } else if (f == 6) { - OPB_Convert(&x, OPT_inttyp); + } else if ((__IN(f, 0x70) && x->typ->size > (int)OPM_SIntSize)) { + OPB_Convert(&x, OPB_IntType(OPB_ShorterSize(x->typ->size))); } else if (f == 8) { OPB_Convert(&x, OPT_realtyp); } else { @@ -1922,10 +1905,8 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 11: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 4) { - OPB_Convert(&x, OPT_inttyp); - } else if (f == 5) { - OPB_Convert(&x, OPT_linttyp); + } else if ((__IN(f, 0x70) && x->typ->size < (int)OPM_LIntSize)) { + OPB_Convert(&x, OPB_IntType(OPB_LongerSize(x->typ->size))); } else if (f == 7) { OPB_Convert(&x, OPT_lrltyp); } else if (f == 3) { @@ -1973,7 +1954,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (__IN(f, 0x70)) { - if (f != 6) { + if (x->typ->size != (int)OPM_LIntSize) { OPB_Convert(&x, OPT_linttyp); } } else { @@ -2011,9 +1992,9 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 24: case 25: case 28: case 31: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((x->class == 7 && __IN(f, 0x30))) { + } else if ((((x->class == 7 && __IN(f, 0x70))) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!__IN(f, 0x2040)) { + } else if (!((__IN(x->typ->form, 0x2070) && x->typ->size == (int)OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } @@ -2062,13 +2043,13 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) *par0 = x; } -static struct StPar1__52 { - struct StPar1__52 *lnk; -} *StPar1__52_s; +static struct StPar1__56 { + struct StPar1__56 *lnk; +} *StPar1__56_s; -static OPT_Node NewOp__53 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right); +static OPT_Node NewOp__57 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right); -static OPT_Node NewOp__53 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right) +static OPT_Node NewOp__57 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right) { OPT_Node _o_result; OPT_Node node = NIL; @@ -2085,9 +2066,9 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) INTEGER f, L; OPT_Struct typ = NIL; OPT_Node p = NIL, t = NIL; - struct StPar1__52 _s; - _s.lnk = StPar1__52_s; - StPar1__52_s = &_s; + struct StPar1__56 _s; + _s.lnk = StPar1__56_s; + StPar1__56_s = &_s; p = *par0; f = x->typ->form; switch (fctno) { @@ -2103,7 +2084,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) OPB_err(111); } } - p = NewOp__53(19, fctno, p, x); + p = NewOp__57(19, fctno, p, x); p->typ = OPT_notyp; } break; @@ -2111,10 +2092,10 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (__IN(f, 0x70)) { - if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > (LONGINT)OPM_MaxSet))) { + if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > (int)OPM_MaxSet))) { OPB_err(202); } - p = NewOp__53(19, fctno, p, x); + p = NewOp__57(19, fctno, p, x); } else { OPB_err(111); } @@ -2123,7 +2104,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 17: if (!__IN(f, 0x70) || x->class != 7) { OPB_err(69); - } else if (f == 4) { + } else if (x->typ->size == 1) { L = (int)x->conval->intval; typ = p->typ; while ((L > 0 && __IN(typ->comp, 0x0c))) { @@ -2139,7 +2120,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) p = p->left; x->conval->intval += 1; } - p = NewOp__53(12, 19, p, x); + p = NewOp__57(12, 19, p, x); p->typ = OPT_linttyp; } else { p = x; @@ -2161,7 +2142,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) t = x; x = p; p = t; - p = NewOp__53(19, 18, p, x); + p = NewOp__57(19, 18, p, x); } else { OPB_err(111); } @@ -2187,7 +2168,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) } p->obj = NIL; } else { - p = NewOp__53(12, 17, p, x); + p = NewOp__57(12, 17, p, x); p->typ = OPT_linttyp; } } else { @@ -2218,9 +2199,9 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) OPB_err(111); } else { if (fctno == 22) { - p = NewOp__53(12, 27, p, x); + p = NewOp__57(12, 27, p, x); } else { - p = NewOp__53(12, 28, p, x); + p = NewOp__57(12, 28, p, x); } p->typ = p->left->typ; } @@ -2237,7 +2218,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) x = p; p = t; } - p = NewOp__53(19, fctno, p, x); + p = NewOp__57(19, fctno, p, x); } else { OPB_err(111); } @@ -2247,7 +2228,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (__IN(f, 0x70)) { - p = NewOp__53(12, 26, p, x); + p = NewOp__57(12, 26, p, x); } else { OPB_err(111); } @@ -2257,6 +2238,9 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (((x->class == 8 || x->class == 9) || __IN(f, 0x1401)) || x->typ->comp == 3) { OPB_err(126); } + if (x->typ->size < p->typ->size) { + OPB_err(-308); + } t = OPT_NewNode(11); t->subcl = 29; t->left = x; @@ -2268,7 +2252,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (__IN(f, 0x70)) { - p = NewOp__53(19, 30, p, x); + p = NewOp__57(19, 30, p, x); } else { OPB_err(111); } @@ -2277,9 +2261,9 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 31: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((x->class == 7 && __IN(f, 0x30))) { + } else if ((((x->class == 7 && __IN(f, 0x70))) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!__IN(f, 0x2040)) { + } else if (!((__IN(x->typ->form, 0x2070) && x->typ->size == (int)OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } @@ -2314,7 +2298,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) break; } *par0 = p; - StPar1__52_s = _s.lnk; + StPar1__56_s = _s.lnk; } void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n) @@ -2433,7 +2417,7 @@ static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpa ftyp = ftyp->BaseTyp; atyp = atyp->BaseTyp; if ((fvarpar && ftyp == OPT_bytetyp)) { - if (!__IN(f, 0x0c) || !__IN(atyp->form, 0x1e)) { + if (!__IN(f, 0x0c) || !((__IN(atyp->form, 0x7e) && atyp->size == 1))) { if (__IN(18, OPM_opt)) { OPB_err(-301); } @@ -2516,7 +2500,7 @@ void OPB_Param (OPT_Node ap, OPT_Object fp) OPB_err(111); } } else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 13)) { - } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && __IN(ap->typ->form, 0x18))))) { + } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x7e) && ap->typ->size == 1)))))) { OPB_err(123); } else if ((fp->typ->form == 13 && ap->class == 5)) { OPB_err(123); diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index 4c37f01f..d1c88266 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 417337c0..3abccc9a 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "OPM.h" @@ -16,12 +16,13 @@ static CHAR OPC_BodyNameExt[13]; export void OPC_Align (LONGINT *adr, LONGINT base); export void OPC_Andent (OPT_Struct typ); static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames); -export LONGINT OPC_Base (OPT_Struct typ); +export LONGINT OPC_BaseAlignment (OPT_Struct typ); export OPT_Object OPC_BaseTProc (OPT_Object obj); export void OPC_BegBlk (void); export void OPC_BegStat (void); static void OPC_CProcDefs (OPT_Object obj, INTEGER vis); export void OPC_Case (LONGINT caseVal, INTEGER form); +static void OPC_CharacterLiteral (LONGINT c); export void OPC_Cmp (INTEGER rel); export void OPC_CompleteIdent (OPT_Object obj); export void OPC_Constant (OPT_Const con, INTEGER form); @@ -73,8 +74,10 @@ static void OPC_PutBase (OPT_Struct typ); static void OPC_PutPtrOffsets (OPT_Struct typ, LONGINT adr, LONGINT *cnt); static void OPC_RegCmds (OPT_Object obj); export void OPC_SetInclude (BOOLEAN exclude); +export LONGINT OPC_SizeAlignment (LONGINT size); static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause); static void OPC_Str1 (CHAR *s, LONGINT s__len, LONGINT x); +static void OPC_StringLiteral (CHAR *s, LONGINT s__len, LONGINT l); export void OPC_TDescDecl (OPT_Struct typ); export void OPC_TypeDefs (OPT_Object obj, INTEGER vis); export void OPC_TypeOf (OPT_Object ap); @@ -315,7 +318,7 @@ void OPC_Andent (OPT_Struct typ) static BOOLEAN OPC_Undefined (OPT_Object obj) { BOOLEAN _o_result; - _o_result = (((obj->mnolev >= 0 && obj->linkadr != (LONGINT)(3 + OPM_currFile))) && obj->linkadr != 2) || obj->name[0] == 0x00; + _o_result = obj->name[0] == 0x00 || (((obj->mnolev >= 0 && obj->linkadr != (int)(3 + OPM_currFile))) && obj->linkadr != 2); return _o_result; } @@ -815,14 +818,15 @@ void OPC_TDescDecl (OPT_Struct typ) OPC_Andent(typ); OPC_Str1((CHAR*)", #", (LONGINT)4, typ->n + 1); OPC_Str1((CHAR*)", #) = {__TDFLDS(", (LONGINT)18, OPC_NofPtrs(typ)); - OPM_Write('\"'); + OPM_Write('"'); if (typ->strobj != NIL) { OPM_WriteStringVar((void*)typ->strobj->name, ((LONGINT)(256))); } - OPC_Str1((CHAR*)"\", #), {", (LONGINT)9, typ->size); + OPM_Write('"'); + OPC_Str1((CHAR*)", #), {", (LONGINT)8, typ->size); nofptrs = 0; OPC_PutPtrOffsets(typ, ((LONGINT)(0)), &nofptrs); - OPC_Str1((CHAR*)"#}}", (LONGINT)4, -((nofptrs + 1) * (LONGINT)OPM_LIntSize)); + OPC_Str1((CHAR*)"#}}", (LONGINT)4, -((nofptrs + 1) * (int)OPM_LIntSize)); OPC_EndStat(); } @@ -864,70 +868,37 @@ void OPC_Align (LONGINT *adr, LONGINT base) } } -LONGINT OPC_Base (OPT_Struct typ) +LONGINT OPC_SizeAlignment (LONGINT size) { LONGINT _o_result; - switch (typ->form) { - case 1: - _o_result = 1; - return _o_result; - break; - case 3: - _o_result = OPM_CharAlign; - return _o_result; - break; - case 2: - _o_result = OPM_BoolAlign; - return _o_result; - break; - case 4: - _o_result = OPM_SIntAlign; - return _o_result; - break; - case 5: - _o_result = OPM_IntAlign; - return _o_result; - break; - case 6: - _o_result = OPM_LIntAlign; - return _o_result; - break; - case 7: - _o_result = OPM_RealAlign; - return _o_result; - break; - case 8: - _o_result = OPM_LRealAlign; - return _o_result; - break; - case 9: - _o_result = OPM_SetAlign; - return _o_result; - break; - case 13: - _o_result = OPM_PointerAlign; - return _o_result; - break; - case 14: - _o_result = OPM_ProcAlign; - return _o_result; - break; - case 15: - if (typ->comp == 4) { - _o_result = __MASK(typ->align, -65536); - return _o_result; - } else { - _o_result = OPC_Base(typ->BaseTyp); - return _o_result; - } - break; - default: - OPM_LogWStr((CHAR*)"unhandled case in OPC.Base, typ^form = ", (LONGINT)40); - OPM_LogWNum(typ->form, ((LONGINT)(0))); - OPM_LogWLn(); - break; + LONGINT alignment; + if (size < (int)OPM_Alignment) { + alignment = 1; + while (alignment < size) { + alignment = __ASHL(alignment, 1); + } + } else { + alignment = OPM_Alignment; } - __RETCHK; + _o_result = alignment; + return _o_result; +} + +LONGINT OPC_BaseAlignment (OPT_Struct typ) +{ + LONGINT _o_result; + LONGINT alignment; + if (typ->form == 15) { + if (typ->comp == 4) { + alignment = __MASK(typ->align, -65536); + } else { + alignment = OPC_BaseAlignment(typ->BaseTyp); + } + } else { + alignment = OPC_SizeAlignment(typ->size); + } + _o_result = alignment; + return _o_result; } static void OPC_FillGap (LONGINT gap, LONGINT off, LONGINT align, LONGINT *n, LONGINT *curAlign) @@ -938,11 +909,11 @@ static void OPC_FillGap (LONGINT gap, LONGINT off, LONGINT align, LONGINT *n, LO if ((*curAlign < align && gap - (adr - off) >= align)) { gap -= (adr - off) + align; OPC_BegStat(); - if (align == (LONGINT)OPM_IntSize) { + if (align == (int)OPM_IntSize) { OPM_WriteString((CHAR*)"INTEGER", (LONGINT)8); - } else if (align == (LONGINT)OPM_LIntSize) { + } else if (align == (int)OPM_LIntSize) { OPM_WriteString((CHAR*)"LONGINT", (LONGINT)8); - } else if (align == (LONGINT)OPM_LRealSize) { + } else if (align == (int)OPM_LRealSize) { OPM_WriteString((CHAR*)"LONGREAL", (LONGINT)9); } OPC_Str1((CHAR*)" _prvt#", (LONGINT)8, *n); @@ -981,7 +952,7 @@ static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, LONGINT *off, LONGINT * } } else { adr = *off; - fldAlign = OPC_Base(fld->typ); + fldAlign = OPC_BaseAlignment(fld->typ); OPC_Align(&adr, fldAlign); gap = fld->adr - adr; if (fldAlign > *curAlign) { @@ -1007,7 +978,7 @@ static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, LONGINT *off, LONGINT * } } if (last) { - adr = typ->size - (LONGINT)__ASHR(typ->sysflag, 8); + adr = typ->size - (int)__ASHR(typ->sysflag, 8); if (adr == 0) { gap = 1; } else { @@ -1170,10 +1141,10 @@ static void OPC_Include (CHAR *name, LONGINT name__len) { __DUP(name, name__len, CHAR); OPM_WriteString((CHAR*)"#include ", (LONGINT)10); - OPM_Write('\"'); + OPM_Write('"'); OPM_WriteStringVar((void*)name, name__len); OPM_WriteString((CHAR*)".h", (LONGINT)3); - OPM_Write('\"'); + OPM_Write('"'); OPM_WriteLn(); __DEL(name); } @@ -1238,8 +1209,8 @@ void OPC_GenHdr (OPT_Node n) static void OPC_GenHeaderMsg (void) { INTEGER i; - OPM_WriteString((CHAR*)"/*", (LONGINT)3); - OPM_WriteString((CHAR*)" voc ", (LONGINT)6); + OPM_WriteString((CHAR*)"/* ", (LONGINT)4); + OPM_WriteString((CHAR*)"voc", (LONGINT)4); OPM_Write(' '); OPM_WriteString(Configuration_versionLong, ((LONGINT)(41))); OPM_Write(' '); @@ -1855,26 +1826,56 @@ void OPC_Cmp (INTEGER rel) } } +static void OPC_CharacterLiteral (LONGINT c) +{ + if (c < 32 || c > 126) { + OPM_WriteString((CHAR*)"0x", (LONGINT)3); + OPM_WriteHex(c); + } else { + OPM_Write('\''); + if ((c == 92 || c == 39) || c == 63) { + OPM_Write('\\'); + } + OPM_Write((CHAR)c); + OPM_Write('\''); + } +} + +static void OPC_StringLiteral (CHAR *s, LONGINT s__len, LONGINT l) +{ + LONGINT i; + INTEGER c; + __DUP(s, s__len, CHAR); + OPM_Write('"'); + i = 0; + while (i < l) { + c = (int)s[__X(i, s__len)]; + if (c < 32 || c > 126) { + OPM_Write('\\'); + OPM_Write((CHAR)(48 + __ASHR(c, 6))); + c = __MASK(c, -64); + OPM_Write((CHAR)(48 + __ASHR(c, 3))); + c = __MASK(c, -8); + OPM_Write((CHAR)(48 + c)); + } else { + if ((c == 92 || c == 34) || c == 63) { + OPM_Write('\\'); + } + OPM_Write((CHAR)c); + } + i += 1; + } + OPM_Write('"'); + __DEL(s); +} + void OPC_Case (LONGINT caseVal, INTEGER form) { CHAR ch; OPM_WriteString((CHAR*)"case ", (LONGINT)6); switch (form) { case 3: - ch = (CHAR)caseVal; - if ((ch >= ' ' && ch <= '~')) { - OPM_Write('\''); - if (((ch == '\\' || ch == '\?') || ch == '\'') || ch == '\"') { - OPM_Write('\\'); - OPM_Write(ch); - } else { - OPM_Write(ch); - } - OPM_Write('\''); - } else { - OPM_WriteString((CHAR*)"0x", (LONGINT)3); - OPM_WriteHex(caseVal); - } + OPC_CharacterLiteral(caseVal); break; case 4: case 5: case 6: OPM_WriteInt(caseVal); @@ -1932,8 +1933,7 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim) void OPC_Constant (OPT_Const con, INTEGER form) { - INTEGER i, len; - CHAR ch; + INTEGER i; SET s; LONGINT hex; BOOLEAN skipLeading; @@ -1945,18 +1945,7 @@ void OPC_Constant (OPT_Const con, INTEGER form) OPM_WriteInt(con->intval); break; case 3: - ch = (CHAR)con->intval; - if ((ch >= ' ' && ch <= '~')) { - OPM_Write('\''); - if (((ch == '\\' || ch == '\?') || ch == '\'') || ch == '\"') { - OPM_Write('\\'); - } - OPM_Write(ch); - OPM_Write('\''); - } else { - OPM_WriteString((CHAR*)"0x", (LONGINT)3); - OPM_WriteHex(con->intval); - } + OPC_CharacterLiteral(con->intval); break; case 4: case 5: case 6: OPM_WriteInt(con->intval); @@ -1991,18 +1980,7 @@ void OPC_Constant (OPT_Const con, INTEGER form) } break; case 10: - OPM_Write('\"'); - len = (int)con->intval2 - 1; - i = 0; - while (i < len) { - ch = (*con->ext)[__X(i, ((LONGINT)(256)))]; - if (((ch == '\\' || ch == '\?') || ch == '\'') || ch == '\"') { - OPM_Write('\\'); - } - OPM_Write(ch); - i += 1; - } - OPM_Write('\"'); + OPC_StringLiteral(*con->ext, ((LONGINT)(256)), con->intval2 - 1); break; case 11: OPM_WriteString((CHAR*)"NIL", (LONGINT)4); @@ -2015,74 +1993,74 @@ void OPC_Constant (OPT_Const con, INTEGER form) } } -static struct InitKeywords__47 { +static struct InitKeywords__48 { SHORTINT *n; - struct InitKeywords__47 *lnk; -} *InitKeywords__47_s; + struct InitKeywords__48 *lnk; +} *InitKeywords__48_s; -static void Enter__48 (CHAR *s, LONGINT s__len); +static void Enter__49 (CHAR *s, LONGINT s__len); -static void Enter__48 (CHAR *s, LONGINT s__len) +static void Enter__49 (CHAR *s, LONGINT s__len) { INTEGER h; __DUP(s, s__len, CHAR); h = OPC_PerfectHash((void*)s, s__len); - OPC_hashtab[__X(h, ((LONGINT)(105)))] = *InitKeywords__47_s->n; - __COPY(s, OPC_keytab[__X(*InitKeywords__47_s->n, ((LONGINT)(36)))], ((LONGINT)(9))); - *InitKeywords__47_s->n += 1; + OPC_hashtab[__X(h, ((LONGINT)(105)))] = *InitKeywords__48_s->n; + __COPY(s, OPC_keytab[__X(*InitKeywords__48_s->n, ((LONGINT)(36)))], ((LONGINT)(9))); + *InitKeywords__48_s->n += 1; __DEL(s); } static void OPC_InitKeywords (void) { SHORTINT n, i; - struct InitKeywords__47 _s; + struct InitKeywords__48 _s; _s.n = &n; - _s.lnk = InitKeywords__47_s; - InitKeywords__47_s = &_s; + _s.lnk = InitKeywords__48_s; + InitKeywords__48_s = &_s; n = 0; i = 0; while (i <= 104) { OPC_hashtab[__X(i, ((LONGINT)(105)))] = -1; i += 1; } - Enter__48((CHAR*)"asm", (LONGINT)4); - Enter__48((CHAR*)"auto", (LONGINT)5); - Enter__48((CHAR*)"break", (LONGINT)6); - Enter__48((CHAR*)"case", (LONGINT)5); - Enter__48((CHAR*)"char", (LONGINT)5); - Enter__48((CHAR*)"const", (LONGINT)6); - Enter__48((CHAR*)"continue", (LONGINT)9); - Enter__48((CHAR*)"default", (LONGINT)8); - Enter__48((CHAR*)"do", (LONGINT)3); - Enter__48((CHAR*)"double", (LONGINT)7); - Enter__48((CHAR*)"else", (LONGINT)5); - Enter__48((CHAR*)"enum", (LONGINT)5); - Enter__48((CHAR*)"extern", (LONGINT)7); - Enter__48((CHAR*)"export", (LONGINT)7); - Enter__48((CHAR*)"float", (LONGINT)6); - Enter__48((CHAR*)"for", (LONGINT)4); - Enter__48((CHAR*)"fortran", (LONGINT)8); - Enter__48((CHAR*)"goto", (LONGINT)5); - Enter__48((CHAR*)"if", (LONGINT)3); - Enter__48((CHAR*)"import", (LONGINT)7); - Enter__48((CHAR*)"int", (LONGINT)4); - Enter__48((CHAR*)"long", (LONGINT)5); - Enter__48((CHAR*)"register", (LONGINT)9); - Enter__48((CHAR*)"return", (LONGINT)7); - Enter__48((CHAR*)"short", (LONGINT)6); - Enter__48((CHAR*)"signed", (LONGINT)7); - Enter__48((CHAR*)"sizeof", (LONGINT)7); - Enter__48((CHAR*)"static", (LONGINT)7); - Enter__48((CHAR*)"struct", (LONGINT)7); - Enter__48((CHAR*)"switch", (LONGINT)7); - Enter__48((CHAR*)"typedef", (LONGINT)8); - Enter__48((CHAR*)"union", (LONGINT)6); - Enter__48((CHAR*)"unsigned", (LONGINT)9); - Enter__48((CHAR*)"void", (LONGINT)5); - Enter__48((CHAR*)"volatile", (LONGINT)9); - Enter__48((CHAR*)"while", (LONGINT)6); - InitKeywords__47_s = _s.lnk; + Enter__49((CHAR*)"asm", (LONGINT)4); + Enter__49((CHAR*)"auto", (LONGINT)5); + Enter__49((CHAR*)"break", (LONGINT)6); + Enter__49((CHAR*)"case", (LONGINT)5); + Enter__49((CHAR*)"char", (LONGINT)5); + Enter__49((CHAR*)"const", (LONGINT)6); + Enter__49((CHAR*)"continue", (LONGINT)9); + Enter__49((CHAR*)"default", (LONGINT)8); + Enter__49((CHAR*)"do", (LONGINT)3); + Enter__49((CHAR*)"double", (LONGINT)7); + Enter__49((CHAR*)"else", (LONGINT)5); + Enter__49((CHAR*)"enum", (LONGINT)5); + Enter__49((CHAR*)"extern", (LONGINT)7); + Enter__49((CHAR*)"export", (LONGINT)7); + Enter__49((CHAR*)"float", (LONGINT)6); + Enter__49((CHAR*)"for", (LONGINT)4); + Enter__49((CHAR*)"fortran", (LONGINT)8); + Enter__49((CHAR*)"goto", (LONGINT)5); + Enter__49((CHAR*)"if", (LONGINT)3); + Enter__49((CHAR*)"import", (LONGINT)7); + Enter__49((CHAR*)"int", (LONGINT)4); + Enter__49((CHAR*)"long", (LONGINT)5); + Enter__49((CHAR*)"register", (LONGINT)9); + Enter__49((CHAR*)"return", (LONGINT)7); + Enter__49((CHAR*)"short", (LONGINT)6); + Enter__49((CHAR*)"signed", (LONGINT)7); + Enter__49((CHAR*)"sizeof", (LONGINT)7); + Enter__49((CHAR*)"static", (LONGINT)7); + Enter__49((CHAR*)"struct", (LONGINT)7); + Enter__49((CHAR*)"switch", (LONGINT)7); + Enter__49((CHAR*)"typedef", (LONGINT)8); + Enter__49((CHAR*)"union", (LONGINT)6); + Enter__49((CHAR*)"unsigned", (LONGINT)9); + Enter__49((CHAR*)"void", (LONGINT)5); + Enter__49((CHAR*)"volatile", (LONGINT)9); + Enter__49((CHAR*)"while", (LONGINT)6); + InitKeywords__48_s = _s.lnk; } diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index 52ed8dab..b7d34a07 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h @@ -11,7 +11,7 @@ import void OPC_Align (LONGINT *adr, LONGINT base); import void OPC_Andent (OPT_Struct typ); -import LONGINT OPC_Base (OPT_Struct typ); +import LONGINT OPC_BaseAlignment (OPT_Struct typ); import OPT_Object OPC_BaseTProc (OPT_Object obj); import void OPC_BegBlk (void); import void OPC_BegStat (void); @@ -40,6 +40,7 @@ import void OPC_InitTDesc (OPT_Struct typ); import void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim); import LONGINT OPC_NofPtrs (OPT_Struct typ); import void OPC_SetInclude (BOOLEAN exclude); +import LONGINT OPC_SizeAlignment (LONGINT size); import void OPC_TDescDecl (OPT_Struct typ); import void OPC_TypeDefs (OPT_Object obj, INTEGER vis); import void OPC_TypeOf (OPT_Object ap); diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 8e5add20..bf683e41 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" @@ -14,8 +14,8 @@ typedef static CHAR OPM_SourceFileName[256]; -export INTEGER OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_CharAlign, OPM_BoolAlign, OPM_SIntAlign, OPM_IntAlign, OPM_LIntAlign, OPM_SetAlign, OPM_RealAlign, OPM_LRealAlign, OPM_PointerAlign, OPM_ProcAlign, OPM_RecAlign, OPM_MaxSet; -export LONGINT OPM_MinSInt, OPM_MinInt, OPM_MinLInt, OPM_MaxSInt, OPM_MaxInt, OPM_MaxLInt, OPM_MaxIndex; +export INTEGER OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet; +export LONGINT OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; export LONGINT OPM_curpos, OPM_errpos, OPM_breakpc; @@ -57,7 +57,6 @@ export void OPM_LogWNum (LONGINT i, LONGINT len); export void OPM_LogWStr (CHAR *s, LONGINT s__len); static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len); export void OPM_Mark (INTEGER n, LONGINT pos); -static INTEGER OPM_Min (INTEGER a, INTEGER b); export void OPM_NewSym (CHAR *modName, LONGINT modName__len); export void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); export void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); @@ -65,6 +64,8 @@ export BOOLEAN OPM_OpenPar (void); export void OPM_RegisterNewSym (void); static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt); static void OPM_ShowLine (LONGINT pos); +export LONGINT OPM_SignedMaximum (LONGINT bytecount); +export LONGINT OPM_SignedMinimum (LONGINT bytecount); export void OPM_SymRCh (CHAR *ch); export LONGINT OPM_SymRInt (void); export void OPM_SymRLReal (LONGREAL *lr); @@ -85,7 +86,7 @@ export void OPM_WriteString (CHAR *s, LONGINT s__len); export void OPM_WriteStringVar (CHAR *s, LONGINT s__len); export BOOLEAN OPM_eofSF (void); export void OPM_err (INTEGER n); -static LONGINT OPM_minus (LONGINT i); +static LONGINT OPM_minusop (LONGINT i); static LONGINT OPM_power0 (LONGINT i, LONGINT j); @@ -117,50 +118,38 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) i = 1; while (s[__X(i, s__len)] != 0x00) { switch (s[__X(i, s__len)]) { - case 'e': - *opt = *opt ^ 0x0200; - break; - case 's': - *opt = *opt ^ 0x10; - break; - case 'm': - *opt = *opt ^ 0x0400; - break; - case 'x': - *opt = *opt ^ 0x01; - break; - case 'r': - *opt = *opt ^ 0x04; - break; - case 't': - *opt = *opt ^ 0x08; - break; case 'a': *opt = *opt ^ 0x80; break; - case 'k': - *opt = *opt ^ 0x40; - break; - case 'p': - *opt = *opt ^ 0x20; - break; - case 'S': - *opt = *opt ^ 0x2000; - break; case 'c': *opt = *opt ^ 0x4000; break; - case 'M': - *opt = *opt ^ 0x8000; + case 'e': + *opt = *opt ^ 0x0200; break; case 'f': *opt = *opt ^ 0x010000; break; - case 'F': - *opt = *opt ^ 0x020000; + case 'k': + *opt = *opt ^ 0x40; break; - case 'V': - *opt = *opt ^ 0x040000; + case 'm': + *opt = *opt ^ 0x0400; + break; + case 'p': + *opt = *opt ^ 0x20; + break; + case 'r': + *opt = *opt ^ 0x04; + break; + case 's': + *opt = *opt ^ 0x10; + break; + case 't': + *opt = *opt ^ 0x08; + break; + case 'x': + *opt = *opt ^ 0x01; break; case 'B': if (s[__X(i + 1, s__len)] != 0x00) { @@ -178,6 +167,19 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) __ASSERT(OPM_IntSize == 2 || OPM_IntSize == 4, 0); __ASSERT(OPM_PointerSize == 4 || OPM_PointerSize == 8, 0); __ASSERT(OPM_Alignment == 4 || OPM_Alignment == 8, 0); + Files_SetSearchPath((CHAR*)"", (LONGINT)1); + break; + case 'F': + *opt = *opt ^ 0x020000; + break; + case 'M': + *opt = *opt ^ 0x8000; + break; + case 'S': + *opt = *opt ^ 0x2000; + break; + case 'V': + *opt = *opt ^ 0x040000; break; default: OPM_LogWStr((CHAR*)" warning: option ", (LONGINT)19); @@ -227,17 +229,17 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWLn(); OPM_LogWStr((CHAR*)" x - turn off array indices check", (LONGINT)35); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" a - don\'t check ASSERTs at runtime, use this option in tested production code", (LONGINT)80); + OPM_LogWStr((CHAR*)" a - don't check ASSERTs at runtime, use this option in tested production code", (LONGINT)80); OPM_LogWLn(); OPM_LogWStr((CHAR*)" p - turn off automatic pointer initialization", (LONGINT)48); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" t - don\'t check type guards (use in rare cases such as low-level modules where every cycle counts)", (LONGINT)101); + OPM_LogWStr((CHAR*)" t - don't check type guards (use in rare cases such as low-level modules where every cycle counts)", (LONGINT)101); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" S - don\'t call external assembler/compiler, only generate C code", (LONGINT)67); + OPM_LogWStr((CHAR*)" S - don't call external assembler/compiler, only generate C code", (LONGINT)67); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" c - don\'t call linker", (LONGINT)24); + OPM_LogWStr((CHAR*)" c - don't call linker", (LONGINT)24); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" f - don\'t use color output", (LONGINT)29); + OPM_LogWStr((CHAR*)" f - don't use color output", (LONGINT)29); OPM_LogWLn(); OPM_LogWStr((CHAR*)" F - force writing new symbol file in current directory", (LONGINT)57); OPM_LogWLn(); @@ -540,14 +542,17 @@ void OPM_FPrintSet (LONGINT *fp, SET set) void OPM_FPrintReal (LONGINT *fp, REAL real) { - OPM_FPrint(&*fp, __VAL(LONGINT, real)); + INTEGER i; + LONGINT l; + __GET((LONGINT)(SYSTEM_ADDRESS)&real, l, LONGINT); + OPM_FPrint(&*fp, l); } void OPM_FPrintLReal (LONGINT *fp, LONGREAL lr) { LONGINT l, h; - __GET((LONGINT)(uintptr_t)&lr, l, LONGINT); - __GET((LONGINT)(uintptr_t)&lr + 4, h, LONGINT); + __GET((LONGINT)(SYSTEM_ADDRESS)&lr, l, LONGINT); + __GET((LONGINT)(SYSTEM_ADDRESS)&lr + 4, h, LONGINT); OPM_FPrint(&*fp, l); OPM_FPrint(&*fp, h); } @@ -575,7 +580,7 @@ static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONG __DEL(name); } -static LONGINT OPM_minus (LONGINT i) +static LONGINT OPM_minusop (LONGINT i) { LONGINT _o_result; _o_result = -i; @@ -603,103 +608,62 @@ static void OPM_VerboseListSizes (void) OPM_LogWLn(); OPM_LogWStr((CHAR*)"CHAR ", (LONGINT)14); OPM_LogWNum(OPM_CharSize, ((LONGINT)(4))); - OPM_LogWNum(OPM_CharAlign, ((LONGINT)(5))); OPM_LogWLn(); OPM_LogWStr((CHAR*)"BOOLEAN ", (LONGINT)14); OPM_LogWNum(OPM_BoolSize, ((LONGINT)(4))); - OPM_LogWNum(OPM_BoolAlign, ((LONGINT)(5))); OPM_LogWLn(); OPM_LogWStr((CHAR*)"SHORTINT ", (LONGINT)14); OPM_LogWNum(OPM_SIntSize, ((LONGINT)(4))); - OPM_LogWNum(OPM_SIntAlign, ((LONGINT)(5))); OPM_LogWLn(); OPM_LogWStr((CHAR*)"INTEGER ", (LONGINT)14); OPM_LogWNum(OPM_IntSize, ((LONGINT)(4))); - OPM_LogWNum(OPM_IntAlign, ((LONGINT)(5))); OPM_LogWLn(); OPM_LogWStr((CHAR*)"LONGINT ", (LONGINT)14); OPM_LogWNum(OPM_LIntSize, ((LONGINT)(4))); - OPM_LogWNum(OPM_LIntAlign, ((LONGINT)(5))); OPM_LogWLn(); OPM_LogWStr((CHAR*)"SET ", (LONGINT)14); OPM_LogWNum(OPM_SetSize, ((LONGINT)(4))); - OPM_LogWNum(OPM_SetAlign, ((LONGINT)(5))); OPM_LogWLn(); OPM_LogWStr((CHAR*)"REAL ", (LONGINT)14); OPM_LogWNum(OPM_RealSize, ((LONGINT)(4))); - OPM_LogWNum(OPM_RealAlign, ((LONGINT)(5))); OPM_LogWLn(); OPM_LogWStr((CHAR*)"LONGREAL ", (LONGINT)14); OPM_LogWNum(OPM_LRealSize, ((LONGINT)(4))); - OPM_LogWNum(OPM_LRealAlign, ((LONGINT)(5))); OPM_LogWLn(); OPM_LogWStr((CHAR*)"PTR ", (LONGINT)14); OPM_LogWNum(OPM_PointerSize, ((LONGINT)(4))); - OPM_LogWNum(OPM_PointerAlign, ((LONGINT)(5))); OPM_LogWLn(); OPM_LogWStr((CHAR*)"PROC ", (LONGINT)14); OPM_LogWNum(OPM_ProcSize, ((LONGINT)(4))); - OPM_LogWNum(OPM_ProcAlign, ((LONGINT)(5))); OPM_LogWLn(); OPM_LogWStr((CHAR*)"RECORD ", (LONGINT)14); OPM_LogWNum(OPM_RecSize, ((LONGINT)(4))); - OPM_LogWNum(OPM_RecAlign, ((LONGINT)(5))); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Min shortint ", (LONGINT)14); - OPM_LogWNum(OPM_MinSInt, ((LONGINT)(4))); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Max shortint ", (LONGINT)14); - OPM_LogWNum(OPM_MaxSInt, ((LONGINT)(4))); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Min integer ", (LONGINT)14); - OPM_LogWNum(OPM_MinInt, ((LONGINT)(4))); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Max integer ", (LONGINT)14); - OPM_LogWNum(OPM_MaxInt, ((LONGINT)(4))); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Min longint ", (LONGINT)14); - OPM_LogWNum(OPM_MinLInt, ((LONGINT)(4))); - OPM_LogWLn(); } -static INTEGER OPM_Min (INTEGER a, INTEGER b) +LONGINT OPM_SignedMaximum (LONGINT bytecount) { - INTEGER _o_result; - if (a < b) { - _o_result = a; - return _o_result; - } else { - _o_result = b; - return _o_result; - } - __RETCHK; + LONGINT _o_result; + LONGINT result; + result = 1; + result = __LSH(result, __ASHL(bytecount, 3) - 1, LONGINT); + _o_result = result - 1; + return _o_result; +} + +LONGINT OPM_SignedMinimum (LONGINT bytecount) +{ + LONGINT _o_result; + _o_result = -OPM_SignedMaximum(bytecount) - 1; + return _o_result; } static void OPM_GetProperties (void) { - LONGINT base; OPM_ProcSize = OPM_PointerSize; OPM_LIntSize = __ASHL(OPM_IntSize, 1); OPM_SetSize = OPM_LIntSize; - OPM_CharAlign = OPM_Min(OPM_Alignment, OPM_CharSize); - OPM_BoolAlign = OPM_Min(OPM_Alignment, OPM_BoolSize); - OPM_SIntAlign = OPM_Min(OPM_Alignment, OPM_SIntSize); - OPM_RecAlign = OPM_Min(OPM_Alignment, OPM_RecSize); - OPM_RealAlign = OPM_Min(OPM_Alignment, OPM_RealSize); - OPM_LRealAlign = OPM_Min(OPM_Alignment, OPM_LRealSize); - OPM_PointerAlign = OPM_Min(OPM_Alignment, OPM_PointerSize); - OPM_ProcAlign = OPM_Min(OPM_Alignment, OPM_ProcSize); - OPM_IntAlign = OPM_Min(OPM_Alignment, OPM_IntSize); - OPM_LIntAlign = OPM_Min(OPM_Alignment, OPM_LIntSize); - OPM_SetAlign = OPM_Min(OPM_Alignment, OPM_SetSize); - base = -2; - OPM_MinSInt = __ASH(base, __ASHL(OPM_SIntSize, 3) - 2); - OPM_MaxSInt = OPM_minus(OPM_MinSInt + 1); - OPM_MinInt = __ASH(base, __ASHL(OPM_IntSize, 3) - 2); - OPM_MaxInt = OPM_minus(OPM_MinInt + 1); - OPM_MinLInt = __ASH(base, __ASHL(OPM_LIntSize, 3) - 2); - OPM_MaxLInt = OPM_minus(OPM_MinLInt + 1); if (OPM_RealSize == 4) { OPM_MaxReal = 3.40282346000000e+038; } else if (OPM_RealSize == 8) { @@ -713,7 +677,7 @@ static void OPM_GetProperties (void) OPM_MinReal = -OPM_MaxReal; OPM_MinLReal = -OPM_MaxLReal; OPM_MaxSet = __ASHL(OPM_SetSize, 3) - 1; - OPM_MaxIndex = OPM_MaxLInt; + OPM_MaxIndex = OPM_SignedMaximum(OPM_PointerSize); if (OPM_Verbose) { OPM_VerboseListSizes(); } @@ -875,7 +839,7 @@ void OPM_WriteInt (LONGINT i) { CHAR s[20]; LONGINT i1, k; - if (i == OPM_MinInt || i == OPM_MinLInt) { + if (i == OPM_SignedMinimum(OPM_IntSize) || i == OPM_SignedMinimum(OPM_LIntSize)) { OPM_Write('('); OPM_WriteInt(i + 1); OPM_WriteString((CHAR*)"-1)", (LONGINT)4); @@ -908,13 +872,13 @@ void OPM_WriteReal (LONGREAL r, CHAR suffx) CHAR s[32]; CHAR ch; INTEGER i; - if ((((r < OPM_MaxLInt && r > OPM_MinLInt)) && r == (__ENTIER(r)))) { + if ((((r < OPM_SignedMaximum(OPM_LIntSize) && r > OPM_SignedMinimum(OPM_LIntSize))) && r == ((int)__ENTIER(r)))) { if (suffx == 'f') { OPM_WriteString((CHAR*)"(REAL)", (LONGINT)7); } else { OPM_WriteString((CHAR*)"(LONGREAL)", (LONGINT)11); } - OPM_WriteInt(__ENTIER(r)); + OPM_WriteInt((int)__ENTIER(r)); } else { Texts_OpenWriter(&W, Texts_Writer__typ); if (suffx == 'f') { diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index db46c598..ed914bff 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h @@ -6,8 +6,8 @@ #include "SYSTEM.h" -import INTEGER OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_CharAlign, OPM_BoolAlign, OPM_SIntAlign, OPM_IntAlign, OPM_LIntAlign, OPM_SetAlign, OPM_RealAlign, OPM_LRealAlign, OPM_PointerAlign, OPM_ProcAlign, OPM_RecAlign, OPM_MaxSet; -import LONGINT OPM_MinSInt, OPM_MinInt, OPM_MinLInt, OPM_MaxSInt, OPM_MaxInt, OPM_MaxLInt, OPM_MaxIndex; +import INTEGER OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet; +import LONGINT OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; import LONGINT OPM_curpos, OPM_errpos, OPM_breakpc; @@ -38,6 +38,8 @@ import void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); import void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); import BOOLEAN OPM_OpenPar (void); import void OPM_RegisterNewSym (void); +import LONGINT OPM_SignedMaximum (LONGINT bytecount); +import LONGINT OPM_SignedMinimum (LONGINT bytecount); import void OPM_SymRCh (CHAR *ch); import LONGINT OPM_SymRInt (void); import void OPM_SymRLReal (LONGREAL *lr); diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index ffe3dff2..01d2144d 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPB.h" #include "OPM.h" @@ -438,10 +438,10 @@ static void OPP_TypeDecl (OPT_Struct *typ, OPT_Struct *banned) if (OPP_sym == 38) { OPP_qualident(&id); if (id->mode == 5) { - if (id->typ != *banned) { - *typ = id->typ; - } else { + if (id->typ == *banned) { OPP_err(58); + } else { + *typ = id->typ; } } else { OPP_err(52); @@ -1783,6 +1783,24 @@ void OPP_Module (OPT_Node *prog, SET opt) if (OPP_sym == 63) { OPS_Get(&OPP_sym); } else { + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Unexpected symbol found when MODULE expected:", (LONGINT)46); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" sym: ", (LONGINT)15); + OPM_LogWNum(OPP_sym, ((LONGINT)(1))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" OPS.name: ", (LONGINT)15); + OPM_LogWStr(OPS_name, ((LONGINT)(256))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" OPS.str: ", (LONGINT)15); + OPM_LogWStr(OPS_str, ((LONGINT)(256))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" OPS.numtyp: ", (LONGINT)15); + OPM_LogWNum(OPS_numtyp, ((LONGINT)(1))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" OPS.intval: ", (LONGINT)15); + OPM_LogWNum(OPS_intval, ((LONGINT)(1))); + OPM_LogWLn(); OPP_err(16); } if (OPP_sym == 38) { diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index 40e2def4..bf56b7d7 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index efed04c6..cacf9256 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "OPM.h" @@ -173,7 +173,7 @@ static void OPS_Number (void) OPS_numtyp = 1; if (n <= 2) { while (i < n) { - OPS_intval = __ASHL(OPS_intval, 4) + (LONGINT)Ord__7(dig[i], 1); + OPS_intval = __ASHL(OPS_intval, 4) + (int)Ord__7(dig[i], 1); i += 1; } } else { @@ -188,7 +188,7 @@ static void OPS_Number (void) OPS_intval = -1; } while (i < n) { - OPS_intval = __ASHL(OPS_intval, 4) + (LONGINT)Ord__7(dig[i], 1); + OPS_intval = __ASHL(OPS_intval, 4) + (int)Ord__7(dig[i], 1); i += 1; } } else { @@ -199,8 +199,8 @@ static void OPS_Number (void) while (i < n) { d = Ord__7(dig[i], 0); i += 1; - if (OPS_intval <= __DIV(2147483647 - (LONGINT)d, 10)) { - OPS_intval = OPS_intval * 10 + (LONGINT)d; + if (OPS_intval <= __DIV(2147483647 - (int)d, 10)) { + OPS_intval = OPS_intval * 10 + (int)d; } else { OPS_err(203); } @@ -325,7 +325,7 @@ void OPS_Get (SHORTINT *sym) } } switch (OPS_ch) { - case '\"': case '\'': + case '"': case '\'': OPS_Str(&s); break; case '#': diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index dae6e457..e901bcfc 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index 8c943c20..b32d0ebd 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" @@ -849,7 +849,7 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval) conval->intval = 0; break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPT.InConstant(), f = ", (LONGINT)41); + OPM_LogWStr((CHAR*)"unhandled case in InConstant(), f = ", (LONGINT)37); OPM_LogWNum(f, ((LONGINT)(0))); OPM_LogWLn(); break; @@ -1072,7 +1072,7 @@ static void OPT_InStruct (OPT_Struct *typ) OPT_InSign(mno, &(*typ)->BaseTyp, &(*typ)->link); break; default: - OPM_LogWStr((CHAR*)"unhandled case at OPT.InStruct, tag = ", (LONGINT)39); + OPM_LogWStr((CHAR*)"unhandled case at InStruct, tag = ", (LONGINT)35); OPM_LogWNum(tag, ((LONGINT)(0))); OPM_LogWLn(); break; @@ -1175,7 +1175,7 @@ static OPT_Object OPT_InObj (SHORTINT mno) } break; default: - OPM_LogWStr((CHAR*)"unhandled case at OPT.InObj, tag = ", (LONGINT)36); + OPM_LogWStr((CHAR*)"unhandled case at InObj, tag = ", (LONGINT)32); OPM_LogWNum(tag, ((LONGINT)(0))); OPM_LogWLn(); break; @@ -1464,14 +1464,14 @@ static void OPT_OutStr (OPT_Struct typ) OPM_SymWInt(((LONGINT)(18))); break; default: - OPM_LogWStr((CHAR*)"unhandled case at OPT.OutStr, typ^.comp = ", (LONGINT)43); + OPM_LogWStr((CHAR*)"unhandled case at OutStr, typ^.comp = ", (LONGINT)39); OPM_LogWNum(typ->comp, ((LONGINT)(0))); OPM_LogWLn(); break; } break; default: - OPM_LogWStr((CHAR*)"unhandled case at OPT.OutStr, typ^.form = ", (LONGINT)43); + OPM_LogWStr((CHAR*)"unhandled case at OutStr, typ^.form = ", (LONGINT)39); OPM_LogWNum(typ->form, ((LONGINT)(0))); OPM_LogWLn(); break; @@ -1536,7 +1536,7 @@ static void OPT_OutObj (OPT_Object obj) OPT_FPrintErr(obj, 251); break; default: - OPM_LogWStr((CHAR*)"unhandled case at OPT.OutObj, obj^.history = ", (LONGINT)46); + OPM_LogWStr((CHAR*)"unhandled case at OutObj, obj^.history = ", (LONGINT)42); OPM_LogWNum(obj->history, ((LONGINT)(0))); OPM_LogWLn(); break; @@ -1592,7 +1592,7 @@ static void OPT_OutObj (OPT_Object obj) OPT_OutName((void*)obj->name, ((LONGINT)(256))); break; default: - OPM_LogWStr((CHAR*)"unhandled case at OPT.OutObj, obj.mode = ", (LONGINT)42); + OPM_LogWStr((CHAR*)"unhandled case at OutObj, obj.mode = ", (LONGINT)38); OPM_LogWNum(obj->mode, ((LONGINT)(0))); OPM_LogWLn(); break; @@ -1809,6 +1809,7 @@ export void *OPT__init(void) OPT_syslink = OPT_topScope->right; OPT_universe = OPT_topScope; OPT_topScope->right = NIL; + OPT_EnterTyp((CHAR*)"BOOLEAN", 2, OPM_BoolSize, &OPT_booltyp); OPT_EnterTyp((CHAR*)"CHAR", 3, OPM_CharSize, &OPT_chartyp); OPT_EnterTyp((CHAR*)"SET", 9, OPM_SetSize, &OPT_settyp); OPT_EnterTyp((CHAR*)"REAL", 7, OPM_RealSize, &OPT_realtyp); @@ -1816,7 +1817,6 @@ export void *OPT__init(void) OPT_EnterTyp((CHAR*)"LONGINT", 6, OPM_LIntSize, &OPT_linttyp); OPT_EnterTyp((CHAR*)"LONGREAL", 8, OPM_LRealSize, &OPT_lrltyp); OPT_EnterTyp((CHAR*)"SHORTINT", 4, OPM_SIntSize, &OPT_sinttyp); - OPT_EnterTyp((CHAR*)"BOOLEAN", 2, OPM_BoolSize, &OPT_booltyp); OPT_EnterBoolConst((CHAR*)"FALSE", ((LONGINT)(0))); OPT_EnterBoolConst((CHAR*)"TRUE", ((LONGINT)(1))); OPT_EnterProc((CHAR*)"HALT", 0); diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index 45816124..41b3e7ec 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h @@ -59,8 +59,7 @@ typedef INTEGER ref, sysflag; LONGINT n, size, align, txtpos; BOOLEAN allocated, pbused, pvused; - char _prvt0[8]; - LONGINT pbfp, pvfp; + char _prvt0[16]; OPT_Struct BaseTyp; OPT_Object link, strobj; } OPT_StrDesc; diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index 23bff9c0..cf646f5e 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPC.h" #include "OPM.h" @@ -23,7 +23,7 @@ export LONGINT *OPV_ExitInfo__typ; static void OPV_ActualPar (OPT_Node n, OPT_Object fp); export void OPV_AdrAndSize (OPT_Object topScope); static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc); -static void OPV_Convert (OPT_Node n, INTEGER form, INTEGER prec); +static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec); static void OPV_DefineTDescs (OPT_Node n); static void OPV_Entier (OPT_Node n, INTEGER prec); static void OPV_GetTProcNum (OPT_Object obj); @@ -38,6 +38,7 @@ static LONGINT OPV_NaturalAlignment (LONGINT size, LONGINT max); static void OPV_NewArr (OPT_Node d, OPT_Node x); static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, INTEGER comp); static BOOLEAN OPV_SideEffects (OPT_Node n); +static void OPV_SizeCast (LONGINT size); static void OPV_Stamp (OPS_Name s); static OPT_Object OPV_SuperProc (OPT_Node n); static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported); @@ -82,10 +83,10 @@ void OPV_TypSize (OPT_Struct typ) btyp = typ->BaseTyp; if (btyp == NIL) { offset = 0; - base = OPM_RecAlign; + base = OPC_SizeAlignment(OPM_RecSize); } else { OPV_TypSize(btyp); - offset = btyp->size - (LONGINT)__ASHR(btyp->sysflag, 8); + offset = btyp->size - (int)__ASHR(btyp->sysflag, 8); base = btyp->align; } fld = typ->link; @@ -93,7 +94,7 @@ void OPV_TypSize (OPT_Struct typ) btyp = fld->typ; OPV_TypSize(btyp); size = btyp->size; - fbase = OPC_Base(btyp); + fbase = OPC_BaseAlignment(btyp); OPC_Align(&offset, fbase); fld->adr = offset; offset += size; @@ -107,7 +108,7 @@ void OPV_TypSize (OPT_Struct typ) offset = 1; } if (OPM_RecSize == 0) { - base = OPV_NaturalAlignment(offset, OPM_RecAlign); + base = OPV_NaturalAlignment(offset, OPC_SizeAlignment(OPM_RecSize)); } OPC_Align(&offset, base); if ((typ->strobj == NIL && __MASK(typ->align, -65536) == 0)) { @@ -332,7 +333,7 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN return _o_result; break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence Nmop, subclass = ", (LONGINT)51); + OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Nmop, subclass = ", (LONGINT)55); OPM_LogWNum(subclass, ((LONGINT)(0))); OPM_LogWLn(); break; @@ -402,7 +403,7 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN return _o_result; break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence Ndop, subclass = ", (LONGINT)51); + OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Ndop, subclass = ", (LONGINT)55); OPM_LogWNum(subclass, ((LONGINT)(0))); OPM_LogWLn(); break; @@ -465,41 +466,26 @@ static void OPV_Entier (OPT_Node n, INTEGER prec) } } -static void OPV_Convert (OPT_Node n, INTEGER form, INTEGER prec) +static void OPV_SizeCast (LONGINT size) { - INTEGER from; + if (size <= 4) { + OPM_WriteString((CHAR*)"(int)", (LONGINT)6); + } else { + OPM_WriteString((CHAR*)"(SYSTEM_INT64)", (LONGINT)15); + } +} + +static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec) +{ + INTEGER from, to; from = n->typ->form; - if (form == 9) { + to = newtype->form; + if (to == 9) { OPM_WriteString((CHAR*)"__SETOF(", (LONGINT)9); OPV_Entier(n, -1); OPM_Write(')'); - } else if (form == 6) { - if (from < 6) { - OPM_WriteString((CHAR*)"(LONGINT)", (LONGINT)10); - } - OPV_Entier(n, 9); - } else if (form == 5) { - if (from < 5) { - OPM_WriteString((CHAR*)"(int)", (LONGINT)6); - OPV_expr(n, 9); - } else { - if (__IN(2, OPM_opt)) { - OPM_WriteString((CHAR*)"__SHORT", (LONGINT)8); - if (OPV_SideEffects(n)) { - OPM_Write('F'); - } - OPM_Write('('); - OPV_Entier(n, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); - OPM_WriteInt(OPM_MaxInt + 1); - OPM_Write(')'); - } else { - OPM_WriteString((CHAR*)"(int)", (LONGINT)6); - OPV_Entier(n, 9); - } - } - } else if (form == 4) { - if (__IN(2, OPM_opt)) { + } else if (__IN(to, 0x70)) { + if ((newtype->size < n->typ->size && __IN(2, OPM_opt))) { OPM_WriteString((CHAR*)"__SHORT", (LONGINT)8); if (OPV_SideEffects(n)) { OPM_Write('F'); @@ -507,13 +493,15 @@ static void OPV_Convert (OPT_Node n, INTEGER form, INTEGER prec) OPM_Write('('); OPV_Entier(n, -1); OPM_WriteString((CHAR*)", ", (LONGINT)3); - OPM_WriteInt(OPM_MaxSInt + 1); + OPM_WriteInt(OPM_SignedMaximum(newtype->size) + 1); OPM_Write(')'); } else { - OPM_WriteString((CHAR*)"(int)", (LONGINT)6); + if (newtype->size != n->typ->size) { + OPV_SizeCast(newtype->size); + } OPV_Entier(n, 9); } - } else if (form == 3) { + } else if (to == 3) { if (__IN(2, OPM_opt)) { OPM_WriteString((CHAR*)"__CHR", (LONGINT)6); if (OPV_SideEffects(n)) { @@ -576,7 +564,7 @@ static void OPV_design (OPT_Node n, INTEGER prec) OPT_Struct typ = NIL; INTEGER class, designPrec, comp; OPT_Node d = NIL, x = NIL; - INTEGER dims, i, _for__26; + INTEGER dims, i, _for__27; comp = n->typ->comp; obj = n->obj; class = n->class; @@ -652,15 +640,15 @@ static void OPV_design (OPT_Node n, INTEGER prec) } x = x->left; } - _for__26 = dims; + _for__27 = dims; i = 1; - while (i <= _for__26) { + while (i <= _for__27) { OPM_Write(')'); i += 1; } if (n->typ->comp == 3) { OPM_Write(')'); - while ((LONGINT)i < __ASHR(d->typ->size - 4, 2)) { + while ((int)i < __ASHR(d->typ->size - 4, 2)) { OPM_WriteString((CHAR*)" * ", (LONGINT)4); OPV_Len(d, i); i += 1; @@ -795,7 +783,7 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) } if ((((mode == 2 && n->class == 11)) && n->subcl == 29)) { OPV_expr(n->left, prec); - } else if ((((((form == 6 && n->class == 7)) && n->conval->intval <= OPM_MaxInt)) && n->conval->intval >= OPM_MinInt)) { + } else if ((((((form == 6 && n->class == 7)) && n->conval->intval <= OPM_SignedMaximum(OPM_IntSize))) && n->conval->intval >= OPM_SignedMinimum(OPM_IntSize))) { OPM_WriteString((CHAR*)"((LONGINT)(", (LONGINT)12); OPV_expr(n, prec); OPM_WriteString((CHAR*)"))", (LONGINT)3); @@ -914,7 +902,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPM_Write(')'); break; case 20: - OPV_Convert(l, form, exprPrec); + OPV_Convert(l, n->typ, exprPrec); break; case 21: if (OPV_SideEffects(l)) { @@ -943,7 +931,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPM_Write(')'); break; case 24: - OPM_WriteString((CHAR*)"(LONGINT)(uintptr_t)", (LONGINT)21); + OPM_WriteString((CHAR*)"(LONGINT)(SYSTEM_ADDRESS)", (LONGINT)26); if (l->class == 1) { OPC_CompleteIdent(l->obj); } else { @@ -954,20 +942,16 @@ static void OPV_expr (OPT_Node n, INTEGER prec) } break; case 29: - if ((((__IN(n->typ->form, 0x6240) && __IN(l->typ->form, 0x6240))) && n->typ->size == l->typ->size) || !__IN(l->class, 0x17)) { + if (!__IN(l->class, 0x17) || (((__IN(n->typ->form, 0x6240) && __IN(l->typ->form, 0x6240))) && n->typ->size == l->typ->size)) { OPM_Write('('); OPC_Ident(n->typ->strobj); OPM_Write(')'); if (__IN(n->typ->form, 0x6000) || __IN(l->typ->form, 0x6000)) { - OPM_WriteString((CHAR*)"(uintptr_t)", (LONGINT)12); + OPM_WriteString((CHAR*)"(SYSTEM_ADDRESS)", (LONGINT)17); } OPV_expr(l, exprPrec); } else { - if (__IN(n->typ->form, 0x6000) || __IN(l->typ->form, 0x6000)) { - OPM_WriteString((CHAR*)"__VALP(", (LONGINT)8); - } else { - OPM_WriteString((CHAR*)"__VAL(", (LONGINT)7); - } + OPM_WriteString((CHAR*)"__VAL(", (LONGINT)7); OPC_Ident(n->typ->strobj); OPM_WriteString((CHAR*)", ", (LONGINT)3); OPV_expr(l, -1); @@ -1326,7 +1310,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) OPM_WriteInt(base->size); OPM_WriteString((CHAR*)"))", (LONGINT)3); OPM_WriteString((CHAR*)", ", (LONGINT)3); - OPM_WriteInt(OPC_Base(base)); + OPM_WriteInt(OPC_BaseAlignment(base)); OPM_WriteString((CHAR*)", ", (LONGINT)3); OPM_WriteInt(nofdim); OPM_WriteString((CHAR*)", ", (LONGINT)3); diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index 0de9e6cc..04828b2f 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 3cce2026..74c43788 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef @@ -118,14 +118,14 @@ export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT #define Platform_EXDEV() EXDEV extern void Heap_InitHeap(); #define Platform_HeapInitHeap() Heap_InitHeap() -#define Platform_allocate(size) (LONGINT)(uintptr_t)((void*)malloc((size_t)size)) +#define Platform_allocate(size) (LONGINT)(SYSTEM_ADDRESS)((void*)malloc((size_t)size)) #define Platform_chdir(n, n__len) chdir((char*)n) #define Platform_closefile(fd) close(fd) #define Platform_err() errno #define Platform_errc(c) write(1, &c, 1) #define Platform_errstring(s, s__len) write(1, s, s__len-1) #define Platform_exit(code) exit(code) -#define Platform_free(address) free((void*)(uintptr_t)address) +#define Platform_free(address) free((void*)(SYSTEM_ADDRESS)address) #define Platform_fstat(fd) fstat(fd, &s) #define Platform_fsync(fd) fsync(fd) #define Platform_ftruncate(fd, l) ftruncate(fd, l) @@ -138,13 +138,13 @@ extern void Heap_InitHeap(); #define Platform_opennew(n, n__len) open((char*)n, O_CREAT | O_TRUNC | O_RDWR, 0664) #define Platform_openro(n, n__len) open((char*)n, O_RDONLY) #define Platform_openrw(n, n__len) open((char*)n, O_RDWR) -#define Platform_readfile(fd, p, l) read(fd, (void*)(uintptr_t)(p), l) +#define Platform_readfile(fd, p, l) read(fd, (void*)(SYSTEM_ADDRESS)(p), l) #define Platform_rename(o, o__len, n, n__len) rename((char*)o, (char*)n) #define Platform_sectotm(s) struct tm *time = localtime((time_t*)&s) #define Platform_seekcur() SEEK_CUR #define Platform_seekend() SEEK_END #define Platform_seekset() SEEK_SET -#define Platform_sethandler(s, h) SystemSetHandler(s, (uintptr_t)h) +#define Platform_sethandler(s, h) SystemSetHandler(s, (SYSTEM_ADDRESS)h) #define Platform_stat(n, n__len) stat((char*)n, &s) #define Platform_statdev() (LONGINT)s.st_dev #define Platform_statino() (LONGINT)s.st_ino @@ -161,7 +161,7 @@ extern void Heap_InitHeap(); #define Platform_tvsec() tv.tv_sec #define Platform_tvusec() tv.tv_usec #define Platform_unlink(n, n__len) unlink((char*)n) -#define Platform_writefile(fd, p, l) write(fd, (void*)(uintptr_t)(p), l) +#define Platform_writefile(fd, p, l) write(fd, (void*)(SYSTEM_ADDRESS)(p), l) BOOLEAN Platform_TooManyFiles (INTEGER e) { @@ -229,7 +229,7 @@ void Platform_Init (INTEGER argc, LONGINT argvadr) Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; Platform_ArgCount = argc; - av = (Platform_ArgVecPtr)(uintptr_t)argvadr; + av = (Platform_ArgVecPtr)(SYSTEM_ADDRESS)argvadr; Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; Platform_HeapInitHeap(); @@ -262,7 +262,7 @@ void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { - av = (Platform_ArgVec)(uintptr_t)Platform_ArgVector; + av = (Platform_ArgVec)(SYSTEM_ADDRESS)Platform_ArgVector; __COPY(*(*av)[__X(n, ((LONGINT)(1024)))], val, val__len); } } @@ -529,7 +529,7 @@ INTEGER Platform_Read (LONGINT h, LONGINT p, LONGINT l, LONGINT *n) INTEGER Platform_ReadBuf (LONGINT h, SYSTEM_BYTE *b, LONGINT b__len, LONGINT *n) { INTEGER _o_result; - *n = Platform_readfile(h, (LONGINT)(uintptr_t)b, b__len); + *n = Platform_readfile(h, (LONGINT)(SYSTEM_ADDRESS)b, b__len); if (*n < 0) { *n = 0; _o_result = Platform_err(); @@ -765,7 +765,7 @@ static void Platform_TestLittleEndian (void) { INTEGER i; i = 1; - __GET((LONGINT)(uintptr_t)&i, Platform_LittleEndian, BOOLEAN); + __GET((LONGINT)(SYSTEM_ADDRESS)&i, Platform_LittleEndian, BOOLEAN); } __TDESC(Platform_FileIdentity, 1, 0) = {__TDFLDS("FileIdentity", 12), {-4}}; diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index 581da770..dd5ce434 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 0f1c3a92..2323e34d 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -58,7 +58,7 @@ INTEGER Reals_Expo (REAL x) { INTEGER _o_result; INTEGER i; - __GET((LONGINT)(uintptr_t)&x + 2, i, INTEGER); + __GET((LONGINT)(SYSTEM_ADDRESS)&x + 2, i, INTEGER); _o_result = __MASK(__ASHR(i, 7), -256); return _o_result; } @@ -66,17 +66,17 @@ INTEGER Reals_Expo (REAL x) void Reals_SetExpo (REAL *x, INTEGER ex) { CHAR c; - __GET((LONGINT)(uintptr_t)x + 3, c, CHAR); - __PUT((LONGINT)(uintptr_t)x + 3, (CHAR)(__ASHL(__ASHR((int)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); - __GET((LONGINT)(uintptr_t)x + 2, c, CHAR); - __PUT((LONGINT)(uintptr_t)x + 2, (CHAR)(__MASK((int)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); + __GET((LONGINT)(SYSTEM_ADDRESS)x + 3, c, CHAR); + __PUT((LONGINT)(SYSTEM_ADDRESS)x + 3, (CHAR)(__ASHL(__ASHR((int)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __GET((LONGINT)(SYSTEM_ADDRESS)x + 2, c, CHAR); + __PUT((LONGINT)(SYSTEM_ADDRESS)x + 2, (CHAR)(__MASK((int)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } INTEGER Reals_ExpoL (LONGREAL x) { INTEGER _o_result; INTEGER i; - __GET((LONGINT)(uintptr_t)&x + 6, i, INTEGER); + __GET((LONGINT)(SYSTEM_ADDRESS)&x + 6, i, INTEGER); _o_result = __MASK(__ASHR(i, 4), -2048); return _o_result; } @@ -89,8 +89,8 @@ void Reals_ConvertL (LONGREAL x, INTEGER n, CHAR *d, LONGINT d__len) } k = 0; if (n > 9) { - i = __ENTIER(x / (LONGREAL)(LONGREAL)1000000000); - j = __ENTIER(x - i * (LONGREAL)1000000000); + i = (int)__ENTIER(x / (LONGREAL)(LONGREAL)1000000000); + j = (int)__ENTIER(x - i * (LONGREAL)1000000000); if (j < 0) { j = 0; } @@ -100,9 +100,9 @@ void Reals_ConvertL (LONGREAL x, INTEGER n, CHAR *d, LONGINT d__len) k += 1; } } else { - i = __ENTIER(x); + i = (int)__ENTIER(x); } - while (k < (LONGINT)n) { + while (k < (int)n) { d[__X(k, d__len)] = (CHAR)(__MOD(i, 10) + 48); i = __DIV(i, 10); k += 1; @@ -134,7 +134,7 @@ static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LO CHAR by; i = 0; l = b__len; - while ((LONGINT)i < l) { + while ((int)i < l) { by = __VAL(CHAR, b[__X(i, b__len)]); d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((int)by, 4)); d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((int)by, -16)); diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index 4a783296..7e6b534c 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/SYSTEM.c b/bootstrap/unix-44/SYSTEM.c index 50e91c6d..33511a70 100644 --- a/bootstrap/unix-44/SYSTEM.c +++ b/bootstrap/unix-44/SYSTEM.c @@ -35,7 +35,7 @@ void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0) void SYSTEM_ENUMP(void *adr, LONGINT n, void (*P)()) { while (n > 0) { - P((LONGINT)(uintptr_t)(*((void**)(adr)))); + P((LONGINT)(SYSTEM_ADDRESS)(*((void**)(adr)))); adr = ((void**)adr) + 1; n--; } @@ -106,7 +106,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, else if (typ == (LONGINT*)POINTER__typ) { /* element type is a pointer */ x = Heap_NEWBLK(size + nofelems * sizeof(LONGINT)); - p = (LONGINT*)(uintptr_t)x[-1]; + p = (LONGINT*)(SYSTEM_ADDRESS)x[-1]; p[-nofelems] = *p; /* build new type desc in situ: 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nofelems - 1; n = 1; /* n =1 for skipping the size field */ while (n <= nofelems) {*p = n*sizeof(LONGINT); p++; n++;} @@ -119,7 +119,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, while (ptab[nofptrs] >= 0) {nofptrs++;} /* number of pointers per element */ nptr = nofelems * nofptrs; /* total number of pointers */ x = Heap_NEWBLK(size + nptr * sizeof(LONGINT)); - p = (LONGINT*)(uintptr_t)x[- 1]; + p = (LONGINT*)(SYSTEM_ADDRESS)x[- 1]; p[-nptr] = *p; /* build new type desc in situ; 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nptr - 1; n = 0; off = dataoff; while (n < nofelems) {i = 0; @@ -155,7 +155,7 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler // (Ignore other signals) } - void SystemSetHandler(int s, uintptr_t h) { + void SystemSetHandler(int s, SYSTEM_ADDRESS h) { if (s >= 2 && s <= 4) { int needtosetsystemhandler = handler[s-2] == 0; handler[s-2] = (SystemSignalHandler)h; @@ -194,12 +194,12 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler } } - void SystemSetInterruptHandler(uintptr_t h) { + void SystemSetInterruptHandler(SYSTEM_ADDRESS h) { EnsureConsoleCtrlHandler(); SystemInterruptHandler = (SystemSignalHandler)h; } - void SystemSetQuitHandler(uintptr_t h) { + void SystemSetQuitHandler(SYSTEM_ADDRESS h) { EnsureConsoleCtrlHandler(); SystemQuitHandler = (SystemSignalHandler)h; } diff --git a/bootstrap/unix-44/SYSTEM.h b/bootstrap/unix-44/SYSTEM.h index 949951ac..6377745e 100644 --- a/bootstrap/unix-44/SYSTEM.h +++ b/bootstrap/unix-44/SYSTEM.h @@ -1,28 +1,38 @@ #ifndef SYSTEM__h #define SYSTEM__h -#ifndef _WIN32 - - // Building for a Unix/Linux based system - #include // For memcpy ... - #include // For uintptr_t ... - +#if defined(_WIN64) + typedef long long SYSTEM_INT64; + typedef unsigned long long SYSTEM_CARD64; #else - - // Building for Windows platform with either mingw under cygwin, or the MS C compiler - #ifdef _WIN64 - typedef unsigned long long size_t; - typedef unsigned long long uintptr_t; - #else - typedef unsigned int size_t; - typedef unsigned int uintptr_t; - #endif /* _WIN64 */ - - typedef unsigned int uint32_t; - void * __cdecl memcpy(void * dest, const void * source, size_t size); - + typedef long SYSTEM_INT64; + typedef unsigned long SYSTEM_CARD64; #endif +typedef int SYSTEM_INT32; +typedef unsigned int SYSTEM_CARD32; +typedef short int SYSTEM_INT16; +typedef unsigned short int SYSTEM_CARD16; +typedef signed char SYSTEM_INT8; +typedef unsigned char SYSTEM_CARD8; + +#if (__SIZEOF_POINTER__ == 8) || defined(_WIN64) || defined(__LP64__) + #if defined(_WIN64) + typedef unsigned long long size_t; + #else + typedef unsigned long size_t; + #endif +#else + typedef unsigned int size_t; +#endif + +#define SYSTEM_ADDRESS size_t +#define _SIZE_T_DECLARED // For FreeBSD +#define _SIZE_T_DEFINED_ // For OpenBSD + +void *memcpy(void *dest, const void *source, SYSTEM_ADDRESS size); + + // The compiler uses 'import' and 'export' which translate to 'extern' and // nothing respectively. @@ -70,6 +80,7 @@ typedef unsigned char U_SHORTINT; #endif typedef U_LONGINT SET; +typedef U_LONGINT U_SET; // OS Memory allocation interfaces are in PlatformXXX.Mod @@ -96,10 +107,10 @@ extern LONGINT SYSTEM_ENTIER (double x); // Signal handling in SYSTEM.c #ifndef _WIN32 - extern void SystemSetHandler(int s, uintptr_t h); + extern void SystemSetHandler(int s, SYSTEM_ADDRESS h); #else - extern void SystemSetInterruptHandler(uintptr_t h); - extern void SystemSetQuitHandler (uintptr_t h); + extern void SystemSetInterruptHandler(SYSTEM_ADDRESS h); + extern void SystemSetQuitHandler (SYSTEM_ADDRESS h); #endif @@ -122,20 +133,20 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __COPY(s, d, n) {char*_a=(void*)s,*_b=(void*)d; LONGINT _i=0,_t=n-1; \ while(_i<_t&&((_b[_i]=_a[_i])!=0)){_i++;};_b[_i]=0;} -#define __DUP(x, l, t) x=(void*)memcpy((void*)(uintptr_t)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) +#define __DUP(x, l, t) x=(void*)memcpy((void*)(SYSTEM_ADDRESS)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) #define __DUPARR(v, t) v=(void*)memcpy(v##__copy,v,sizeof(t)) -#define __DEL(x) Platform_OSFree((LONGINT)(uintptr_t)x) +#define __DEL(x) Platform_OSFree((LONGINT)(SYSTEM_ADDRESS)x) /* 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 + +#define __GET(a, x, t) x= *(t*)(SYSTEM_ADDRESS)(a) +#define __PUT(a, x, t) *(t*)(SYSTEM_ADDRESS)(a)=x #define __LSHL(x, n, t) ((t)((U_##t)(x)<<(n))) #define __LSHR(x, n, t) ((t)((U_##t)(x)>>(n))) @@ -150,7 +161,7 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) #define __BIT(x, n) (*(U_LONGINT*)(x)>>(n)&1) -#define __MOVE(s, d, n) memcpy((char*)(uintptr_t)(d),(char*)(uintptr_t)(s),n) +#define __MOVE(s, d, n) memcpy((char*)(SYSTEM_ADDRESS)(d),(char*)(SYSTEM_ADDRESS)(s),n) #define __ASHF(x, n) SYSTEM_ASH((LONGINT)(x), (LONGINT)(n)) #define __SHORT(x, y) ((int)((U_LONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) #define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) @@ -211,7 +222,7 @@ extern void Heap_INCREF(); extern void Platform_Init(INTEGER argc, LONGINT argv); extern void Heap_FINALL(); -#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (LONGINT)(uintptr_t)&argv); +#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (LONGINT)(SYSTEM_ADDRESS)&argv); #define __REGMAIN(name, enum) m = Heap_REGMOD((CHAR*)name,enum) #define __FINI Heap_FINALL(); return 0 @@ -232,7 +243,7 @@ extern SYSTEM_PTR Heap_NEWREC (LONGINT tag); extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __SYSNEW(p, len) p = Heap_NEWBLK((LONGINT)(len)) -#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(uintptr_t)t##__typ) +#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(SYSTEM_ADDRESS)t##__typ) #define __NEWARR SYSTEM_NEWARR @@ -263,20 +274,20 @@ extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __INITYP(t, t0, level) \ t##__typ = (LONGINT*)&t##__desc.blksz; \ memcpy(t##__desc.basep, t0##__typ - __BASEOFF, level*sizeof(LONGINT)); \ - t##__desc.basep[level] = (LONGINT)(uintptr_t)t##__typ; \ - t##__desc.module = (LONGINT)(uintptr_t)m; \ + t##__desc.basep[level] = (LONGINT)(SYSTEM_ADDRESS)t##__typ; \ + t##__desc.module = (LONGINT)(SYSTEM_ADDRESS)m; \ if(t##__desc.blksz!=sizeof(struct t)) __HALT(-15); \ t##__desc.blksz = (t##__desc.blksz+5*sizeof(LONGINT)-1)/(4*sizeof(LONGINT))*(4*sizeof(LONGINT)); \ - Heap_REGTYP(m, (LONGINT)(uintptr_t)&t##__desc.next); \ + Heap_REGTYP(m, (LONGINT)(SYSTEM_ADDRESS)&t##__desc.next); \ SYSTEM_INHERIT(t##__typ, t0##__typ) -#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(uintptr_t)typ##__typ) -#define __TYPEOF(p) ((LONGINT*)(uintptr_t)(*(((LONGINT*)(p))-1))) +#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(SYSTEM_ADDRESS)typ##__typ) +#define __TYPEOF(p) ((LONGINT*)(SYSTEM_ADDRESS)(*(((LONGINT*)(p))-1))) #define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) // Oberon-2 type bound procedures support -#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(uintptr_t)proc -#define __SEND(typ, num, funtyp, parlist) ((funtyp)((uintptr_t)*(typ-(__TPROC0OFF+num))))parlist +#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(SYSTEM_ADDRESS)proc +#define __SEND(typ, num, funtyp, parlist) ((funtyp)((SYSTEM_ADDRESS)*(typ-(__TPROC0OFF+num))))parlist diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index d2713d0f..115456ea 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -21,7 +21,7 @@ INTEGER Strings_Length (CHAR *s, LONGINT s__len) INTEGER i; __DUP(s, s__len, CHAR); i = 0; - while (((LONGINT)i < s__len && s[__X(i, s__len)] != 0x00)) { + while (((int)i < s__len && s[__X(i, s__len)] != 0x00)) { i += 1; } _o_result = i; @@ -36,11 +36,11 @@ void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__ n1 = Strings_Length(dest, dest__len); n2 = Strings_Length(extra, extra__len); i = 0; - while ((i < n2 && (LONGINT)(i + n1) < dest__len)) { + while ((i < n2 && (int)(i + n1) < dest__len)) { dest[__X(i + n1, dest__len)] = extra[__X(i, extra__len)]; i += 1; } - if ((LONGINT)(i + n1) < dest__len) { + if ((int)(i + n1) < dest__len) { dest[__X(i + n1, dest__len)] = 0x00; } __DEL(extra); @@ -59,10 +59,10 @@ void Strings_Insert (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, Strings_Append(dest, dest__len, (void*)source, source__len); return; } - if ((LONGINT)(pos + n2) < dest__len) { + if ((int)(pos + n2) < dest__len) { i = n1; while (i >= pos) { - if ((LONGINT)(i + n2) < dest__len) { + if ((int)(i + n2) < dest__len) { dest[__X(i + n2, dest__len)] = dest[__X(i, dest__len)]; } i -= 1; @@ -91,7 +91,7 @@ void Strings_Delete (CHAR *s, LONGINT s__len, INTEGER pos, INTEGER n) s[__X(i - n, s__len)] = s[__X(i, s__len)]; i += 1; } - if ((LONGINT)(i - n) < s__len) { + if ((int)(i - n) < s__len) { s[__X(i - n, s__len)] = 0x00; } } else { @@ -121,7 +121,7 @@ void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n, return; } i = 0; - while (((((LONGINT)(pos + i) <= source__len && source[__X(pos + i, source__len)] != 0x00)) && i < n)) { + while (((((int)(pos + i) <= source__len && source[__X(pos + i, source__len)] != 0x00)) && i < n)) { if (i < destLen) { dest[__X(i, dest__len)] = source[__X(pos + i, source__len)]; } diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index 5f45d8a8..96dbb01d 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index 0e6ee85e..9ab3b430 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Files.h" #include "Modules.h" @@ -787,9 +787,9 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) (*S).s[__X(i, ((LONGINT)(64)))] = 0x00; (*S).len = i; (*S).class = 1; - } else if (ch == '\"') { + } else if (ch == '"') { Texts_Read((void*)&*S, S__typ, &ch); - while ((((ch != '\"' && ch >= ' ')) && i != 63)) { + while ((((ch != '"' && ch >= ' ')) && i != 63)) { (*S).s[__X(i, ((LONGINT)(64)))] = ch; i += 1; Texts_Read((void*)&*S, S__typ, &ch); @@ -839,7 +839,7 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) k -= 16; } while (j < i) { - k = __ASHL(k, 4) + (LONGINT)((int)d[__X(j, ((LONGINT)(32)))] - 48); + k = __ASHL(k, 4) + (int)((int)d[__X(j, ((LONGINT)(32)))] - 48); j += 1; } if (neg) { @@ -929,7 +929,7 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) (*S).class = 3; k = 0; do { - k = k * 10 + (LONGINT)((int)d[__X(j, ((LONGINT)(32)))] - 48); + k = k * 10 + (int)((int)d[__X(j, ((LONGINT)(32)))] - 48); j += 1; } while (!(j == i)); if (neg) { @@ -1067,7 +1067,7 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n) x0 = __DIV(x0, 10); i += 1; } while (!(x0 == 0)); - while (n > (LONGINT)i) { + while (n > (int)i) { Texts_Write(&*W, W__typ, ' '); n -= 1; } @@ -1319,7 +1319,7 @@ void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER } else { Texts_Write(&*W, W__typ, ' '); } - e = (int)__ASHR((LONGINT)(e - 1023) * 77, 8); + e = (int)__ASHR((int)(e - 1023) * 77, 8); if (e >= 0) { x = x / (LONGREAL)Reals_TenL(e); } else { diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index c8abf16a..777a6c22 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/Vishap.c b/bootstrap/unix-44/Vishap.c index 74d0e984..4c9e3b45 100644 --- a/bootstrap/unix-44/Vishap.c +++ b/bootstrap/unix-44/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkamSf */ #include "SYSTEM.h" #include "Configuration.h" #include "Heap.h" diff --git a/bootstrap/unix-44/errors.c b/bootstrap/unix-44/errors.c index f8ddb53a..68e433df 100644 --- a/bootstrap/unix-44/errors.c +++ b/bootstrap/unix-44/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef @@ -25,7 +25,7 @@ export void *errors__init(void) errors_errors[6][0] = 0x00; errors_errors[7][0] = 0x00; errors_errors[8][0] = 0x00; - __MOVE("\'=\' expected", errors_errors[9], 13); + __MOVE("'=' expected", errors_errors[9], 13); errors_errors[10][0] = 0x00; errors_errors[11][0] = 0x00; __MOVE("type definition starts with incorrect symbol", errors_errors[12], 45); @@ -34,28 +34,28 @@ export void *errors__init(void) __MOVE("declaration followed by incorrect symbol", errors_errors[15], 41); __MOVE("MODULE expected", errors_errors[16], 16); errors_errors[17][0] = 0x00; - __MOVE("\'.\' missing", errors_errors[18], 12); - __MOVE("\',\' missing", errors_errors[19], 12); - __MOVE("\':\' missing", errors_errors[20], 12); + __MOVE("'.' missing", errors_errors[18], 12); + __MOVE("',' missing", errors_errors[19], 12); + __MOVE("':' missing", errors_errors[20], 12); errors_errors[21][0] = 0x00; - __MOVE("\')\' missing", errors_errors[22], 12); - __MOVE("\']\' missing", errors_errors[23], 12); - __MOVE("\'}\' missing", errors_errors[24], 12); + __MOVE("')' missing", errors_errors[22], 12); + __MOVE("']' missing", errors_errors[23], 12); + __MOVE("'}' missing", errors_errors[24], 12); __MOVE("OF missing", errors_errors[25], 11); __MOVE("THEN missing", errors_errors[26], 13); __MOVE("DO missing", errors_errors[27], 11); __MOVE("TO missing", errors_errors[28], 11); errors_errors[29][0] = 0x00; - __MOVE("\'(\' missing", errors_errors[30], 12); + __MOVE("'(' missing", errors_errors[30], 12); errors_errors[31][0] = 0x00; errors_errors[32][0] = 0x00; errors_errors[33][0] = 0x00; - __MOVE("\':=\' missing", errors_errors[34], 13); - __MOVE("\',\' or OF expected", errors_errors[35], 19); + __MOVE("':=' missing", errors_errors[34], 13); + __MOVE("',' or OF expected", errors_errors[35], 19); errors_errors[36][0] = 0x00; errors_errors[37][0] = 0x00; __MOVE("identifier expected", errors_errors[38], 20); - __MOVE("\';\' missing", errors_errors[39], 12); + __MOVE("';' missing", errors_errors[39], 12); errors_errors[40][0] = 0x00; __MOVE("END missing", errors_errors[41], 12); errors_errors[42][0] = 0x00; @@ -131,10 +131,10 @@ export void *errors__init(void) __MOVE("operand is not a variable", errors_errors[112], 26); __MOVE("incompatible assignment", errors_errors[113], 24); __MOVE("string too long to be assigned", errors_errors[114], 31); - __MOVE("parameter doesn\'t match", errors_errors[115], 24); - __MOVE("number of parameters doesn\'t match", errors_errors[116], 35); - __MOVE("result type doesn\'t match", errors_errors[117], 26); - __MOVE("export mark doesn\'t match with forward declaration", errors_errors[118], 51); + __MOVE("parameter doesn't match", errors_errors[115], 24); + __MOVE("number of parameters doesn't match", errors_errors[116], 35); + __MOVE("result type doesn't match", errors_errors[117], 26); + __MOVE("export mark doesn't match with forward declaration", errors_errors[118], 51); __MOVE("redefinition textually precedes procedure bound to base type", errors_errors[119], 61); __MOVE("type of expression following IF, WHILE, UNTIL or ASSERT is not BOOLEAN", errors_errors[120], 71); __MOVE("called object is not a procedure (or is an interrupt procedure)", errors_errors[121], 64); @@ -194,5 +194,6 @@ export void *errors__init(void) __MOVE("implicit type cast", errors_errors[301], 19); __MOVE("inappropriate symbol file ignored", errors_errors[306], 34); __MOVE("no ELSE symbol after CASE statement sequence may lead to trap", errors_errors[307], 62); + __MOVE("SYSTEM.VAL result includes memory past end of source variable", errors_errors[308], 62); __ENDMOD; } diff --git a/bootstrap/unix-44/errors.h b/bootstrap/unix-44/errors.h index 5068083b..41d399ad 100644 --- a/bootstrap/unix-44/errors.h +++ b/bootstrap/unix-44/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index 03bd540b..4efd107a 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index 695ea164..fc4f0da1 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-44/vt100.c b/bootstrap/unix-44/vt100.c index c499aceb..d77b0b84 100644 --- a/bootstrap/unix-44/vt100.c +++ b/bootstrap/unix-44/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Strings.h" @@ -252,7 +252,7 @@ export void *vt100__init(void) __REGCMD("RCP", vt100_RCP); __REGCMD("SCP", vt100_SCP); /* BEGIN */ - __COPY("", vt100_CSI, ((LONGINT)(5))); + __COPY("\033", vt100_CSI, ((LONGINT)(5))); Strings_Append((CHAR*)"[", (LONGINT)2, (void*)vt100_CSI, ((LONGINT)(5))); __ENDMOD; } diff --git a/bootstrap/unix-44/vt100.h b/bootstrap/unix-44/vt100.h index 1aaeca77..4af04d6e 100644 --- a/bootstrap/unix-44/vt100.h +++ b/bootstrap/unix-44/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index 1f5afbb7..821dff97 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -13,6 +13,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/08/24] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/08/23] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index eef3a15d..ec5e865a 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Console.c b/bootstrap/unix-48/Console.c index 5fa65e00..f9161937 100644 --- a/bootstrap/unix-48/Console.c +++ b/bootstrap/unix-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Platform.h" @@ -21,7 +21,7 @@ export void Console_String (CHAR *s, LONGINT s__len); void Console_Flush (void) { INTEGER error; - error = Platform_Write(((LONGINT)(1)), (LONGINT)(uintptr_t)Console_line, Console_pos); + error = Platform_Write(((LONGINT)(1)), (LONGINT)(SYSTEM_ADDRESS)Console_line, Console_pos); Console_pos = 0; } diff --git a/bootstrap/unix-48/Console.h b/bootstrap/unix-48/Console.h index 53dbdfa8..5fdd4e4d 100644 --- a/bootstrap/unix-48/Console.h +++ b/bootstrap/unix-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 5d92e963..5a1dd875 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" @@ -257,7 +257,7 @@ static void Files_Flush (Files_Buffer buf) if (buf->org != f->pos) { error = Platform_Seek(f->fd, buf->org, Platform_SeekSet); } - error = Platform_Write(f->fd, (LONGINT)(uintptr_t)buf->data, buf->size); + error = Platform_Write(f->fd, (LONGINT)(SYSTEM_ADDRESS)buf->data, buf->size); if (error != 0) { Files_Err((CHAR*)"error writing file", (LONGINT)19, f, error); } @@ -656,7 +656,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x } else { min = n; } - __MOVE((LONGINT)(uintptr_t)buf->data + offset, (LONGINT)(uintptr_t)x + xpos, min); + __MOVE((LONGINT)(SYSTEM_ADDRESS)buf->data + offset, (LONGINT)(SYSTEM_ADDRESS)x + xpos, min); offset += min; (*r).offset = offset; xpos += min; @@ -721,7 +721,7 @@ void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT } else { min = n; } - __MOVE((LONGINT)(uintptr_t)x + xpos, (LONGINT)(uintptr_t)buf->data + offset, min); + __MOVE((LONGINT)(SYSTEM_ADDRESS)x + xpos, (LONGINT)(SYSTEM_ADDRESS)buf->data + offset, min); offset += min; (*r).offset = offset; if (offset > buf->size) { @@ -772,15 +772,15 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT *res = 3; return; } - error = Platform_Read(fdold, (LONGINT)(uintptr_t)buf, ((LONGINT)(4096)), &n); + error = Platform_Read(fdold, (LONGINT)(SYSTEM_ADDRESS)buf, ((LONGINT)(4096)), &n); while (n > 0) { - error = Platform_Write(fdnew, (LONGINT)(uintptr_t)buf, n); + error = Platform_Write(fdnew, (LONGINT)(SYSTEM_ADDRESS)buf, n); if (error != 0) { ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); Files_Err((CHAR*)"cannot move file", (LONGINT)17, NIL, error); } - error = Platform_Read(fdold, (LONGINT)(uintptr_t)buf, ((LONGINT)(4096)), &n); + error = Platform_Read(fdold, (LONGINT)(SYSTEM_ADDRESS)buf, ((LONGINT)(4096)), &n); } ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); @@ -838,7 +838,7 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *de j += 1; } } else { - __MOVE((LONGINT)(uintptr_t)src, (LONGINT)(uintptr_t)dest, src__len); + __MOVE((LONGINT)(SYSTEM_ADDRESS)src, (LONGINT)(SYSTEM_ADDRESS)dest, src__len); } } @@ -858,14 +858,16 @@ void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, LONGINT *x) { CHAR b[4]; Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); - *x = ((LONGINT)((int)b[0] + __ASHL((int)b[1], 8)) + __ASHL((LONGINT)b[2], 16)) + __ASHL((LONGINT)b[3], 24); + *x = ((int)((int)b[0] + __ASHL((int)b[1], 8)) + __ASHL((int)b[2], 16)) + __ASHL((int)b[3], 24); } void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x) { CHAR b[4]; + LONGINT l; Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); - *x = (SET)(((LONGINT)((int)b[0] + __ASHL((int)b[1], 8)) + __ASHL((LONGINT)b[2], 16)) + __ASHL((LONGINT)b[3], 24)); + l = ((int)((int)b[0] + __ASHL((int)b[1], 8)) + __ASHL((int)b[2], 16)) + __ASHL((int)b[3], 24); + *x = (SET)l; } void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x) @@ -921,11 +923,11 @@ void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, LONGINT *x) n = 0; Files_Read(&*R, R__typ, (void*)&ch); while ((int)ch >= 128) { - n += __ASH((LONGINT)((int)ch - 128), s); + n += __ASH((int)((int)ch - 128), s); s += 7; Files_Read(&*R, R__typ, (void*)&ch); } - n += __ASH((LONGINT)(__MASK((int)ch, -64) - __ASHL(__ASHR((int)ch, 6), 6)), s); + n += __ASH((int)(__MASK((int)ch, -64) - __ASHL(__ASHR((int)ch, 6), 6)), s); *x = n; } @@ -1006,7 +1008,7 @@ static void Files_Finalize (SYSTEM_PTR o) { Files_File f = NIL; LONGINT res; - f = (Files_File)(uintptr_t)o; + f = (Files_File)(SYSTEM_ADDRESS)o; if (f->fd >= 0) { Files_CloseOSFile(f); if (f->tempFile) { diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index b60e6242..a4a4ea8c 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index 4cabf8c6..30ec687a 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tskSfF */ #include "SYSTEM.h" struct Heap__1 { @@ -101,7 +101,7 @@ export void Heap_Unlock (void); extern void *Heap__init(); extern LONGINT Platform_MainStackFrame; extern LONGINT Platform_OSAllocate(LONGINT size); -#define Heap_FetchAddress(pointer) (LONGINT)(uintptr_t)(*((void**)((uintptr_t)pointer))) +#define Heap_FetchAddress(pointer) (LONGINT)(SYSTEM_ADDRESS)(*((void**)((SYSTEM_ADDRESS)pointer))) #define Heap_HeapModuleInit() Heap__init() #define Heap_OSAllocate(size) Platform_OSAllocate(size) #define Heap_PlatformHalt(code) Platform_Halt(code) @@ -134,7 +134,7 @@ SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) __COPY(name, m->name, ((LONGINT)(20))); m->refcnt = 0; m->enumPtrs = enumPtrs; - m->next = (Heap_Module)(uintptr_t)Heap_modules; + m->next = (Heap_Module)(SYSTEM_ADDRESS)Heap_modules; Heap_modules = (SYSTEM_PTR)m; _o_result = (void*)m; return _o_result; @@ -315,7 +315,7 @@ SYSTEM_PTR Heap_NEWREC (LONGINT tag) __PUT(adr + 8, 0, LONGINT); Heap_allocated += blksz; Heap_Unlock(); - _o_result = (SYSTEM_PTR)(uintptr_t)(adr + 4); + _o_result = (SYSTEM_PTR)(SYSTEM_ADDRESS)(adr + 4); return _o_result; } @@ -326,12 +326,12 @@ SYSTEM_PTR Heap_NEWBLK (LONGINT size) SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 31, 4), 4); - new = Heap_NEWREC((LONGINT)(uintptr_t)&blksz); - tag = ((LONGINT)(uintptr_t)new + blksz) - 12; + new = Heap_NEWREC((LONGINT)(SYSTEM_ADDRESS)&blksz); + tag = ((LONGINT)(SYSTEM_ADDRESS)new + blksz) - 12; __PUT(tag - 4, 0, LONGINT); __PUT(tag, blksz, LONGINT); __PUT(tag + 4, -4, LONGINT); - __PUT((LONGINT)(uintptr_t)new - 4, tag, LONGINT); + __PUT((LONGINT)(SYSTEM_ADDRESS)new - 4, tag, LONGINT); Heap_Unlock(); _o_result = new; return _o_result; @@ -360,7 +360,7 @@ static void Heap_Mark (LONGINT q) __GET(tag, offset, LONGINT); fld = q + offset; p = Heap_FetchAddress(fld); - __PUT(fld, (SYSTEM_PTR)(uintptr_t)n, SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADDRESS)n, SYSTEM_PTR); } else { fld = q + offset; n = Heap_FetchAddress(fld); @@ -369,7 +369,7 @@ static void Heap_Mark (LONGINT q) if (!__ODD(tagbits)) { __PUT(n - 4, tagbits + 1, LONGINT); __PUT(q - 4, tag + 1, LONGINT); - __PUT(fld, (SYSTEM_PTR)(uintptr_t)p, SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADDRESS)p, SYSTEM_PTR); p = q; q = n; tag = tagbits; @@ -384,7 +384,7 @@ static void Heap_Mark (LONGINT q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((LONGINT)(uintptr_t)p); + Heap_Mark((LONGINT)(SYSTEM_ADDRESS)p); } static void Heap_Scan (void) @@ -553,7 +553,7 @@ static void Heap_Finalize (void) } else { prev->next = n->next; } - (*n->finalize)((SYSTEM_PTR)(uintptr_t)n->obj); + (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADDRESS)n->obj); if (prev == NIL) { n = Heap_fin; } else { @@ -572,7 +572,7 @@ void Heap_FINALL (void) while (Heap_fin != NIL) { n = Heap_fin; Heap_fin = Heap_fin->next; - (*n->finalize)((SYSTEM_PTR)(uintptr_t)n->obj); + (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADDRESS)n->obj); } } @@ -589,9 +589,9 @@ static void Heap_MarkStack (LONGINT n, LONGINT *cand, LONGINT cand__len) } if (n == 0) { nofcand = 0; - sp = (LONGINT)(uintptr_t)&frame; + sp = (LONGINT)(SYSTEM_ADDRESS)&frame; stack0 = Heap_PlatformMainStackFrame(); - inc = (LONGINT)(uintptr_t)&align.p - (LONGINT)(uintptr_t)&align; + inc = (LONGINT)(SYSTEM_ADDRESS)&align.p - (LONGINT)(SYSTEM_ADDRESS)&align; if (sp > stack0) { inc = -inc; } @@ -622,7 +622,7 @@ void Heap_GC (BOOLEAN markStack) LONGINT cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); - m = (Heap_Module)(uintptr_t)Heap_modules; + m = (Heap_Module)(SYSTEM_ADDRESS)Heap_modules; while (m != NIL) { if (m->enumPtrs != NIL) { (*m->enumPtrs)(Heap_MarkP); @@ -699,7 +699,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (LONGINT)(uintptr_t)obj; + f->obj = (LONGINT)(SYSTEM_ADDRESS)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index 38e549be..a2cab30c 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index d5164a2a..330b7506 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Heap.h" diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index 5e27b653..ac8ac89e 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index d834a9e8..0f614e6a 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" @@ -34,7 +34,9 @@ export void OPB_In (OPT_Node *x, OPT_Node y); export void OPB_Index (OPT_Node *x, OPT_Node y); export void OPB_Inittd (OPT_Node *inittd, OPT_Node *last, OPT_Struct typ); static BOOLEAN OPB_IntToBool (LONGINT i); +static OPT_Struct OPB_IntType (LONGINT size); export void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y); +static LONGINT OPB_LongerSize (LONGINT i); export void OPB_MOp (SHORTINT op, OPT_Node *x); export OPT_Node OPB_NewBoolConst (BOOLEAN boolval); export OPT_Node OPB_NewIntConst (LONGINT intval); @@ -51,6 +53,8 @@ export void OPB_Return (OPT_Node *x, OPT_Object proc); export void OPB_SetElem (OPT_Node *x); static void OPB_SetIntType (OPT_Node node); export void OPB_SetRange (OPT_Node *x, OPT_Node y); +static LONGINT OPB_ShorterSize (LONGINT i); +static INTEGER OPB_SignedByteSize (LONGINT n); export void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno); export void OPB_StPar0 (OPT_Node *par0, INTEGER fctno); export void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno); @@ -90,8 +94,8 @@ OPT_Node OPB_NewLeaf (OPT_Object obj) node = OPT_NewNode(9); break; default: - OPB_err(127); node = OPT_NewNode(0); + OPB_err(127); break; } node->obj = obj; @@ -220,21 +224,68 @@ OPT_Node OPB_EmptySet (void) return _o_result; } +static INTEGER OPB_SignedByteSize (LONGINT n) +{ + INTEGER _o_result; + INTEGER b; + if (n < 0) { + n = -(n + 1); + } + b = 1; + while ((b < 8 && __ASH(n, -(__ASHL(b, 3) - 1)) != 0)) { + b += 1; + } + _o_result = b; + return _o_result; +} + +static LONGINT OPB_ShorterSize (LONGINT i) +{ + LONGINT _o_result; + if (i >= (int)OPM_LIntSize) { + _o_result = OPM_IntSize; + return _o_result; + } else { + _o_result = OPM_SIntSize; + return _o_result; + } + __RETCHK; +} + +static LONGINT OPB_LongerSize (LONGINT i) +{ + LONGINT _o_result; + if (i <= (int)OPM_SIntSize) { + _o_result = OPM_IntSize; + return _o_result; + } else { + _o_result = OPM_LIntSize; + return _o_result; + } + __RETCHK; +} + +static OPT_Struct OPB_IntType (LONGINT size) +{ + OPT_Struct _o_result; + OPT_Struct result = NIL; + if (size <= OPT_sinttyp->size) { + result = OPT_sinttyp; + } else if (size <= OPT_inttyp->size) { + result = OPT_inttyp; + } else { + result = OPT_linttyp; + } + if (size > OPT_linttyp->size) { + OPB_err(203); + } + _o_result = result; + return _o_result; +} + static void OPB_SetIntType (OPT_Node node) { - LONGINT v; - v = node->conval->intval; - if ((OPM_MinSInt <= (LONGINT)v && (LONGINT)v <= OPM_MaxSInt)) { - node->typ = OPT_sinttyp; - } else if ((OPM_MinInt <= (LONGINT)v && (LONGINT)v <= OPM_MaxInt)) { - node->typ = OPT_inttyp; - } else if ((OPM_MinLInt <= v && v <= OPM_MaxLInt)) { - node->typ = OPT_linttyp; - } else { - OPB_err(203); - node->typ = OPT_sinttyp; - node->conval->intval = 1; - } + node->typ = OPB_IntType(OPB_SignedByteSize(node->conval->intval)); } OPT_Node OPB_NewIntConst (LONGINT intval) @@ -378,16 +429,16 @@ void OPB_Field (OPT_Node *x, OPT_Object y) } } -static struct TypTest__57 { +static struct TypTest__61 { OPT_Node *x; OPT_Object *obj; BOOLEAN *guard; - struct TypTest__57 *lnk; -} *TypTest__57_s; + struct TypTest__61 *lnk; +} *TypTest__61_s; -static void GTT__58 (OPT_Struct t0, OPT_Struct t1); +static void GTT__62 (OPT_Struct t0, OPT_Struct t1); -static void GTT__58 (OPT_Struct t0, OPT_Struct t1) +static void GTT__62 (OPT_Struct t0, OPT_Struct t1) { OPT_Node node = NIL; OPT_Struct t = NIL; @@ -400,54 +451,54 @@ static void GTT__58 (OPT_Struct t0, OPT_Struct t1) t1 = t1->BaseTyp; } if (t1 == t0 || t0->form == 0) { - if (*TypTest__57_s->guard) { - OPB_BindNodes(5, NIL, &*TypTest__57_s->x, NIL); - (*TypTest__57_s->x)->readonly = (*TypTest__57_s->x)->left->readonly; + if (*TypTest__61_s->guard) { + OPB_BindNodes(5, NIL, &*TypTest__61_s->x, NIL); + (*TypTest__61_s->x)->readonly = (*TypTest__61_s->x)->left->readonly; } else { node = OPT_NewNode(11); node->subcl = 16; - node->left = *TypTest__57_s->x; - node->obj = *TypTest__57_s->obj; - *TypTest__57_s->x = node; + node->left = *TypTest__61_s->x; + node->obj = *TypTest__61_s->obj; + *TypTest__61_s->x = node; } } else { OPB_err(85); } } else if (t0 != t1) { OPB_err(85); - } else if (!*TypTest__57_s->guard) { - if ((*TypTest__57_s->x)->class == 5) { + } else if (!*TypTest__61_s->guard) { + if ((*TypTest__61_s->x)->class == 5) { node = OPT_NewNode(11); node->subcl = 16; - node->left = *TypTest__57_s->x; - node->obj = *TypTest__57_s->obj; - *TypTest__57_s->x = node; + node->left = *TypTest__61_s->x; + node->obj = *TypTest__61_s->obj; + *TypTest__61_s->x = node; } else { - *TypTest__57_s->x = OPB_NewBoolConst(1); + *TypTest__61_s->x = OPB_NewBoolConst(1); } } } void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) { - struct TypTest__57 _s; + struct TypTest__61 _s; _s.x = x; _s.obj = &obj; _s.guard = &guard; - _s.lnk = TypTest__57_s; - TypTest__57_s = &_s; + _s.lnk = TypTest__61_s; + TypTest__61_s = &_s; if (OPB_NotVar(*x)) { OPB_err(112); } else if ((*x)->typ->form == 13) { if (((*x)->typ->BaseTyp->comp != 4 && (*x)->typ != OPT_sysptrtyp)) { OPB_err(85); } else if (obj->typ->form == 13) { - GTT__58((*x)->typ->BaseTyp, obj->typ->BaseTyp); + GTT__62((*x)->typ->BaseTyp, obj->typ->BaseTyp); } else { OPB_err(86); } } else if (((((*x)->typ->comp == 4 && (*x)->class == 1)) && obj->typ->comp == 4)) { - GTT__58((*x)->typ, obj->typ); + GTT__62((*x)->typ, obj->typ); } else { OPB_err(87); } @@ -456,7 +507,7 @@ void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) } else { (*x)->typ = OPT_booltyp; } - TypTest__57_s = _s.lnk; + TypTest__61_s = _s.lnk; } void OPB_In (OPT_Node *x, OPT_Node y) @@ -469,7 +520,7 @@ void OPB_In (OPT_Node *x, OPT_Node y) } else if ((__IN(f, 0x70) && y->typ->form == 9)) { if ((*x)->class == 7) { k = (*x)->conval->intval; - if (k < 0 || k > (LONGINT)OPM_MaxSet) { + if (k < 0 || k > (int)OPM_MaxSet) { OPB_err(202); } else if (y->class == 7) { (*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval)); @@ -522,13 +573,13 @@ static void OPB_CheckRealType (INTEGER f, INTEGER nr, OPT_Const x) x->intval = -1; } -static struct MOp__28 { - struct MOp__28 *lnk; -} *MOp__28_s; +static struct MOp__30 { + struct MOp__30 *lnk; +} *MOp__30_s; -static OPT_Node NewOp__29 (SHORTINT op, OPT_Struct typ, OPT_Node z); +static OPT_Node NewOp__31 (SHORTINT op, OPT_Struct typ, OPT_Node z); -static OPT_Node NewOp__29 (SHORTINT op, OPT_Struct typ, OPT_Node z) +static OPT_Node NewOp__31 (SHORTINT op, OPT_Struct typ, OPT_Node z) { OPT_Node _o_result; OPT_Node node = NIL; @@ -545,9 +596,9 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) INTEGER f; OPT_Struct typ = NIL; OPT_Node z = NIL; - struct MOp__28 _s; - _s.lnk = MOp__28_s; - MOp__28_s = &_s; + struct MOp__30 _s; + _s.lnk = MOp__30_s; + MOp__30_s = &_s; z = *x; if (z->class == 8 || z->class == 9) { OPB_err(126); @@ -561,7 +612,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->conval->intval = OPB_BoolToInt(!OPB_IntToBool(z->conval->intval)); z->obj = NIL; } else { - z = NewOp__29(op, typ, z); + z = NewOp__31(op, typ, z); } } else { OPB_err(98); @@ -589,7 +640,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } z->obj = NIL; } else { - z = NewOp__29(op, typ, z); + z = NewOp__31(op, typ, z); } } else { OPB_err(97); @@ -610,7 +661,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } z->obj = NIL; } else { - z = NewOp__29(op, typ, z); + z = NewOp__31(op, typ, z); } } else { OPB_err(111); @@ -622,7 +673,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->conval->intval = (int)__CAP((CHAR)z->conval->intval); z->obj = NIL; } else { - z = NewOp__29(op, typ, z); + z = NewOp__31(op, typ, z); } } else { OPB_err(111); @@ -635,7 +686,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->conval->intval = OPB_BoolToInt(__ODD(z->conval->intval)); z->obj = NIL; } else { - z = NewOp__29(op, typ, z); + z = NewOp__31(op, typ, z); } } else { OPB_err(111); @@ -648,7 +699,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) f = 10; } if (z->class < 7 || f == 10) { - z = NewOp__29(op, typ, z); + z = NewOp__31(op, typ, z); } else { OPB_err(127); } @@ -657,7 +708,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) case 25: if ((__IN(f, 0x70) && z->class == 7)) { if ((0 <= z->conval->intval && z->conval->intval <= -1)) { - z = NewOp__29(op, typ, z); + z = NewOp__31(op, typ, z); } else { OPB_err(219); } @@ -674,7 +725,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } } *x = z; - MOp__28_s = _s.lnk; + MOp__30_s = _s.lnk; } static void OPB_CheckPtr (OPT_Node x, OPT_Node y) @@ -865,41 +916,13 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) __GUARDEQP(yval, OPT_ConstDesc) = *xval; } break; - case 4: + case 4: case 5: case 6: if (__IN(g, 0x70)) { - x->typ = y->typ; - } else if (g == 7) { - x->typ = OPT_realtyp; - xval->realval = xval->intval; - } else if (g == 8) { - x->typ = OPT_lrltyp; - xval->realval = xval->intval; - } else { - OPB_err(100); - y->typ = x->typ; - __GUARDEQP(yval, OPT_ConstDesc) = *xval; - } - break; - case 5: - if (g == 4) { - y->typ = OPT_inttyp; - } else if (__IN(g, 0x70)) { - x->typ = y->typ; - } else if (g == 7) { - x->typ = OPT_realtyp; - xval->realval = xval->intval; - } else if (g == 8) { - x->typ = OPT_lrltyp; - xval->realval = xval->intval; - } else { - OPB_err(100); - y->typ = x->typ; - __GUARDEQP(yval, OPT_ConstDesc) = *xval; - } - break; - case 6: - if (__IN(g, 0x70)) { - y->typ = OPT_linttyp; + if (x->typ->size <= y->typ->size) { + x->typ = y->typ; + } else { + x->typ = OPB_IntType(x->typ->size); + } } else if (g == 7) { x->typ = OPT_realtyp; xval->realval = xval->intval; @@ -1178,7 +1201,7 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) OPB_err(203); r = (LONGREAL)1; } - (*x)->conval->intval = __ENTIER(r); + (*x)->conval->intval = (int)__ENTIER(r); OPB_SetIntType(*x); } } @@ -1196,15 +1219,15 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) (*x)->typ = typ; } -static struct Op__38 { +static struct Op__40 { INTEGER *f, *g; - struct Op__38 *lnk; -} *Op__38_s; + struct Op__40 *lnk; +} *Op__40_s; -static void NewOp__39 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y); -static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y); +static void NewOp__41 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y); +static BOOLEAN strings__43 (OPT_Node *x, OPT_Node *y); -static void NewOp__39 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y) +static void NewOp__41 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y) { OPT_Node node = NIL; node = OPT_NewNode(12); @@ -1215,29 +1238,29 @@ static void NewOp__39 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y) *x = node; } -static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) +static BOOLEAN strings__43 (OPT_Node *x, OPT_Node *y) { BOOLEAN _o_result; BOOLEAN ok, xCharArr, yCharArr; - xCharArr = (__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp->form == 3) || *Op__38_s->f == 10; - yCharArr = (__IN((*y)->typ->comp, 0x0c) && (*y)->typ->BaseTyp->form == 3) || *Op__38_s->g == 10; - if ((((xCharArr && *Op__38_s->g == 3)) && (*y)->class == 7)) { + xCharArr = (__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp->form == 3) || *Op__40_s->f == 10; + yCharArr = (__IN((*y)->typ->comp, 0x0c) && (*y)->typ->BaseTyp->form == 3) || *Op__40_s->g == 10; + if ((((xCharArr && *Op__40_s->g == 3)) && (*y)->class == 7)) { OPB_CharToString(*y); - *Op__38_s->g = 10; + *Op__40_s->g = 10; yCharArr = 1; } - if ((((yCharArr && *Op__38_s->f == 3)) && (*x)->class == 7)) { + if ((((yCharArr && *Op__40_s->f == 3)) && (*x)->class == 7)) { OPB_CharToString(*x); - *Op__38_s->f = 10; + *Op__40_s->f = 10; xCharArr = 1; } ok = (xCharArr && yCharArr); if (ok) { - if ((*Op__38_s->f == 10 && (*x)->conval->intval2 == 1)) { + if ((*Op__40_s->f == 10 && (*x)->conval->intval2 == 1)) { (*x)->typ = OPT_chartyp; (*x)->conval->intval = 0; OPB_Index(&*y, OPB_NewIntConst(((LONGINT)(0)))); - } else if ((*Op__38_s->g == 10 && (*y)->conval->intval2 == 1)) { + } else if ((*Op__40_s->g == 10 && (*y)->conval->intval2 == 1)) { (*y)->typ = OPT_chartyp; (*y)->conval->intval = 0; OPB_Index(&*x, OPB_NewIntConst(((LONGINT)(0)))); @@ -1254,11 +1277,11 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPT_Struct typ = NIL; BOOLEAN do_; LONGINT val; - struct Op__38 _s; + struct Op__40 _s; _s.f = &f; _s.g = &g; - _s.lnk = Op__38_s; - Op__38_s = &_s; + _s.lnk = Op__40_s; + Op__40_s = &_s; z = *x; if (((z->class == 8 || z->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); @@ -1276,15 +1299,8 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPB_err(100); } break; - case 4: - if (__IN(g, 0x01f0)) { - OPB_Convert(&z, y->typ); - } else { - OPB_err(100); - } - break; - case 5: - if (g == 4) { + case 4: case 5: case 6: + if ((__IN(g, 0x70) && y->typ->size < z->typ->size)) { OPB_Convert(&y, z->typ); } else if (__IN(g, 0x01f0)) { OPB_Convert(&z, y->typ); @@ -1292,15 +1308,6 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPB_err(100); } break; - case 6: - if (__IN(g, 0x70)) { - OPB_Convert(&y, z->typ); - } else if (__IN(g, 0x0180)) { - OPB_Convert(&z, y->typ); - } else { - OPB_err(100); - } - break; case 7: if (__IN(g, 0x70)) { OPB_Convert(&y, z->typ); @@ -1386,7 +1393,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) typ = OPT_undftyp; } if (do_) { - NewOp__39(op, typ, &z, y); + NewOp__41(op, typ, &z, y); } break; case 2: @@ -1405,7 +1412,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPB_err(102); typ = OPT_undftyp; } - NewOp__39(op, typ, &z, y); + NewOp__41(op, typ, &z, y); break; case 3: do_ = 1; @@ -1428,7 +1435,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) typ = OPT_undftyp; } if (do_) { - NewOp__39(op, typ, &z, y); + NewOp__41(op, typ, &z, y); } break; case 4: @@ -1446,7 +1453,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPB_err(104); typ = OPT_undftyp; } - NewOp__39(op, typ, &z, y); + NewOp__41(op, typ, &z, y); break; case 5: if (f == 2) { @@ -1456,7 +1463,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } } else if ((y->class == 7 && OPB_IntToBool(y->conval->intval))) { } else { - NewOp__39(op, typ, &z, y); + NewOp__41(op, typ, &z, y); } } else if (f != 0) { OPB_err(94); @@ -1479,7 +1486,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } } if (do_) { - NewOp__39(op, typ, &z, y); + NewOp__41(op, typ, &z, y); } break; case 7: @@ -1488,7 +1495,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) typ = OPT_undftyp; } if ((!__IN(f, 0x70) || y->class != 7) || y->conval->intval != 0) { - NewOp__39(op, typ, &z, y); + NewOp__41(op, typ, &z, y); } break; case 8: @@ -1499,7 +1506,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } } else if ((y->class == 7 && !OPB_IntToBool(y->conval->intval))) { } else { - NewOp__39(op, typ, &z, y); + NewOp__41(op, typ, &z, y); } } else if (f != 0) { OPB_err(95); @@ -1507,16 +1514,16 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 9: case 10: - if (__IN(f, 0x6bff) || strings__41(&z, &y)) { + if (__IN(f, 0x6bff) || strings__43(&z, &y)) { typ = OPT_booltyp; } else { OPB_err(107); typ = OPT_undftyp; } - NewOp__39(op, typ, &z, y); + NewOp__41(op, typ, &z, y); break; case 11: case 12: case 13: case 14: - if (__IN(f, 0x01f9) || strings__41(&z, &y)) { + if (__IN(f, 0x01f9) || strings__43(&z, &y)) { typ = OPT_booltyp; } else { OPM_LogWLn(); @@ -1525,7 +1532,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPB_err(108); typ = OPT_undftyp; } - NewOp__39(op, typ, &z, y); + NewOp__41(op, typ, &z, y); break; default: OPM_LogWStr((CHAR*)"unhandled case in OPB.Op, op = ", (LONGINT)32); @@ -1535,7 +1542,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } } *x = z; - Op__38_s = _s.lnk; + Op__40_s = _s.lnk; } void OPB_SetRange (OPT_Node *x, OPT_Node y) @@ -1546,13 +1553,13 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y) } else if ((__IN((*x)->typ->form, 0x70) && __IN(y->typ->form, 0x70))) { if ((*x)->class == 7) { k = (*x)->conval->intval; - if (0 > k || k > (LONGINT)OPM_MaxSet) { + if (0 > k || k > (int)OPM_MaxSet) { OPB_err(202); } } if (y->class == 7) { l = y->conval->intval; - if (0 > l || l > (LONGINT)OPM_MaxSet) { + if (0 > l || l > (int)OPM_MaxSet) { OPB_err(202); } } @@ -1582,7 +1589,7 @@ void OPB_SetElem (OPT_Node *x) OPB_err(93); } else if ((*x)->class == 7) { k = (*x)->conval->intval; - if ((0 <= k && k <= (LONGINT)OPM_MaxSet)) { + if ((0 <= k && k <= (int)OPM_MaxSet)) { (*x)->conval->setval = __SETOF(k); } else { OPB_err(202); @@ -1596,8 +1603,9 @@ void OPB_SetElem (OPT_Node *x) static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) { + OPT_Struct y = NIL; INTEGER f, g; - OPT_Struct y = NIL, p = NIL, q = NIL; + OPT_Struct p = NIL, q = NIL; if (OPM_Verbose) { OPM_LogWLn(); OPM_LogWStr((CHAR*)"PROCEDURE CheckAssign", (LONGINT)22); @@ -1627,31 +1635,20 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) case 0: case 10: break; case 1: - if (!__IN(g, 0x1a)) { + if (!((__IN(g, 0x7a) && y->size == 1))) { OPB_err(113); } break; - case 2: case 3: case 4: case 9: + case 2: case 3: case 9: if (g != f) { OPB_err(113); } break; - case 5: - if (!__IN(g, 0x30)) { + case 4: case 5: case 6: + if (!__IN(g, 0x70) || x->size < y->size) { OPB_err(113); } break; - case 6: - if (OPM_LIntSize == 4) { - if (!__IN(g, 0x70)) { - OPB_err(113); - } - } else { - if (!__IN(g, 0x70)) { - OPB_err(113); - } - } - break; case 7: if (!__IN(g, 0xf0)) { OPB_err(113); @@ -1832,14 +1829,8 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) x = OPB_NewIntConst(((LONGINT)(0))); x->typ = OPT_chartyp; break; - case 4: - x = OPB_NewIntConst(OPM_MinSInt); - break; - case 5: - x = OPB_NewIntConst(OPM_MinInt); - break; - case 6: - x = OPB_NewIntConst(OPM_MinLInt); + case 4: case 5: case 6: + x = OPB_NewIntConst(OPM_SignedMinimum(x->typ->size)); break; case 9: x = OPB_NewIntConst(((LONGINT)(0))); @@ -1869,14 +1860,8 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) x = OPB_NewIntConst(((LONGINT)(255))); x->typ = OPT_chartyp; break; - case 4: - x = OPB_NewIntConst(OPM_MaxSInt); - break; - case 5: - x = OPB_NewIntConst(OPM_MaxInt); - break; - case 6: - x = OPB_NewIntConst(OPM_MaxLInt); + case 4: case 5: case 6: + x = OPB_NewIntConst(OPM_SignedMaximum(x->typ->size)); break; case 9: x = OPB_NewIntConst(OPM_MaxSet); @@ -1909,10 +1894,8 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 10: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 5) { - OPB_Convert(&x, OPT_sinttyp); - } else if (f == 6) { - OPB_Convert(&x, OPT_inttyp); + } else if ((__IN(f, 0x70) && x->typ->size > (int)OPM_SIntSize)) { + OPB_Convert(&x, OPB_IntType(OPB_ShorterSize(x->typ->size))); } else if (f == 8) { OPB_Convert(&x, OPT_realtyp); } else { @@ -1922,10 +1905,8 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 11: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 4) { - OPB_Convert(&x, OPT_inttyp); - } else if (f == 5) { - OPB_Convert(&x, OPT_linttyp); + } else if ((__IN(f, 0x70) && x->typ->size < (int)OPM_LIntSize)) { + OPB_Convert(&x, OPB_IntType(OPB_LongerSize(x->typ->size))); } else if (f == 7) { OPB_Convert(&x, OPT_lrltyp); } else if (f == 3) { @@ -1973,7 +1954,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (__IN(f, 0x70)) { - if (f != 6) { + if (x->typ->size != (int)OPM_LIntSize) { OPB_Convert(&x, OPT_linttyp); } } else { @@ -2011,9 +1992,9 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 24: case 25: case 28: case 31: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((x->class == 7 && __IN(f, 0x30))) { + } else if ((((x->class == 7 && __IN(f, 0x70))) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!__IN(f, 0x2040)) { + } else if (!((__IN(x->typ->form, 0x2070) && x->typ->size == (int)OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } @@ -2062,13 +2043,13 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) *par0 = x; } -static struct StPar1__52 { - struct StPar1__52 *lnk; -} *StPar1__52_s; +static struct StPar1__56 { + struct StPar1__56 *lnk; +} *StPar1__56_s; -static OPT_Node NewOp__53 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right); +static OPT_Node NewOp__57 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right); -static OPT_Node NewOp__53 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right) +static OPT_Node NewOp__57 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right) { OPT_Node _o_result; OPT_Node node = NIL; @@ -2085,9 +2066,9 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) INTEGER f, L; OPT_Struct typ = NIL; OPT_Node p = NIL, t = NIL; - struct StPar1__52 _s; - _s.lnk = StPar1__52_s; - StPar1__52_s = &_s; + struct StPar1__56 _s; + _s.lnk = StPar1__56_s; + StPar1__56_s = &_s; p = *par0; f = x->typ->form; switch (fctno) { @@ -2103,7 +2084,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) OPB_err(111); } } - p = NewOp__53(19, fctno, p, x); + p = NewOp__57(19, fctno, p, x); p->typ = OPT_notyp; } break; @@ -2111,10 +2092,10 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (__IN(f, 0x70)) { - if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > (LONGINT)OPM_MaxSet))) { + if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > (int)OPM_MaxSet))) { OPB_err(202); } - p = NewOp__53(19, fctno, p, x); + p = NewOp__57(19, fctno, p, x); } else { OPB_err(111); } @@ -2123,7 +2104,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 17: if (!__IN(f, 0x70) || x->class != 7) { OPB_err(69); - } else if (f == 4) { + } else if (x->typ->size == 1) { L = (int)x->conval->intval; typ = p->typ; while ((L > 0 && __IN(typ->comp, 0x0c))) { @@ -2139,7 +2120,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) p = p->left; x->conval->intval += 1; } - p = NewOp__53(12, 19, p, x); + p = NewOp__57(12, 19, p, x); p->typ = OPT_linttyp; } else { p = x; @@ -2161,7 +2142,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) t = x; x = p; p = t; - p = NewOp__53(19, 18, p, x); + p = NewOp__57(19, 18, p, x); } else { OPB_err(111); } @@ -2187,7 +2168,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) } p->obj = NIL; } else { - p = NewOp__53(12, 17, p, x); + p = NewOp__57(12, 17, p, x); p->typ = OPT_linttyp; } } else { @@ -2218,9 +2199,9 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) OPB_err(111); } else { if (fctno == 22) { - p = NewOp__53(12, 27, p, x); + p = NewOp__57(12, 27, p, x); } else { - p = NewOp__53(12, 28, p, x); + p = NewOp__57(12, 28, p, x); } p->typ = p->left->typ; } @@ -2237,7 +2218,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) x = p; p = t; } - p = NewOp__53(19, fctno, p, x); + p = NewOp__57(19, fctno, p, x); } else { OPB_err(111); } @@ -2247,7 +2228,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (__IN(f, 0x70)) { - p = NewOp__53(12, 26, p, x); + p = NewOp__57(12, 26, p, x); } else { OPB_err(111); } @@ -2257,6 +2238,9 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (((x->class == 8 || x->class == 9) || __IN(f, 0x1401)) || x->typ->comp == 3) { OPB_err(126); } + if (x->typ->size < p->typ->size) { + OPB_err(-308); + } t = OPT_NewNode(11); t->subcl = 29; t->left = x; @@ -2268,7 +2252,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (__IN(f, 0x70)) { - p = NewOp__53(19, 30, p, x); + p = NewOp__57(19, 30, p, x); } else { OPB_err(111); } @@ -2277,9 +2261,9 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 31: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((x->class == 7 && __IN(f, 0x30))) { + } else if ((((x->class == 7 && __IN(f, 0x70))) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!__IN(f, 0x2040)) { + } else if (!((__IN(x->typ->form, 0x2070) && x->typ->size == (int)OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } @@ -2314,7 +2298,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) break; } *par0 = p; - StPar1__52_s = _s.lnk; + StPar1__56_s = _s.lnk; } void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n) @@ -2433,7 +2417,7 @@ static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpa ftyp = ftyp->BaseTyp; atyp = atyp->BaseTyp; if ((fvarpar && ftyp == OPT_bytetyp)) { - if (!__IN(f, 0x0c) || !__IN(atyp->form, 0x1e)) { + if (!__IN(f, 0x0c) || !((__IN(atyp->form, 0x7e) && atyp->size == 1))) { if (__IN(18, OPM_opt)) { OPB_err(-301); } @@ -2516,7 +2500,7 @@ void OPB_Param (OPT_Node ap, OPT_Object fp) OPB_err(111); } } else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 13)) { - } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && __IN(ap->typ->form, 0x18))))) { + } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x7e) && ap->typ->size == 1)))))) { OPB_err(123); } else if ((fp->typ->form == 13 && ap->class == 5)) { OPB_err(123); diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index 4c37f01f..d1c88266 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 417337c0..3abccc9a 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "OPM.h" @@ -16,12 +16,13 @@ static CHAR OPC_BodyNameExt[13]; export void OPC_Align (LONGINT *adr, LONGINT base); export void OPC_Andent (OPT_Struct typ); static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames); -export LONGINT OPC_Base (OPT_Struct typ); +export LONGINT OPC_BaseAlignment (OPT_Struct typ); export OPT_Object OPC_BaseTProc (OPT_Object obj); export void OPC_BegBlk (void); export void OPC_BegStat (void); static void OPC_CProcDefs (OPT_Object obj, INTEGER vis); export void OPC_Case (LONGINT caseVal, INTEGER form); +static void OPC_CharacterLiteral (LONGINT c); export void OPC_Cmp (INTEGER rel); export void OPC_CompleteIdent (OPT_Object obj); export void OPC_Constant (OPT_Const con, INTEGER form); @@ -73,8 +74,10 @@ static void OPC_PutBase (OPT_Struct typ); static void OPC_PutPtrOffsets (OPT_Struct typ, LONGINT adr, LONGINT *cnt); static void OPC_RegCmds (OPT_Object obj); export void OPC_SetInclude (BOOLEAN exclude); +export LONGINT OPC_SizeAlignment (LONGINT size); static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause); static void OPC_Str1 (CHAR *s, LONGINT s__len, LONGINT x); +static void OPC_StringLiteral (CHAR *s, LONGINT s__len, LONGINT l); export void OPC_TDescDecl (OPT_Struct typ); export void OPC_TypeDefs (OPT_Object obj, INTEGER vis); export void OPC_TypeOf (OPT_Object ap); @@ -315,7 +318,7 @@ void OPC_Andent (OPT_Struct typ) static BOOLEAN OPC_Undefined (OPT_Object obj) { BOOLEAN _o_result; - _o_result = (((obj->mnolev >= 0 && obj->linkadr != (LONGINT)(3 + OPM_currFile))) && obj->linkadr != 2) || obj->name[0] == 0x00; + _o_result = obj->name[0] == 0x00 || (((obj->mnolev >= 0 && obj->linkadr != (int)(3 + OPM_currFile))) && obj->linkadr != 2); return _o_result; } @@ -815,14 +818,15 @@ void OPC_TDescDecl (OPT_Struct typ) OPC_Andent(typ); OPC_Str1((CHAR*)", #", (LONGINT)4, typ->n + 1); OPC_Str1((CHAR*)", #) = {__TDFLDS(", (LONGINT)18, OPC_NofPtrs(typ)); - OPM_Write('\"'); + OPM_Write('"'); if (typ->strobj != NIL) { OPM_WriteStringVar((void*)typ->strobj->name, ((LONGINT)(256))); } - OPC_Str1((CHAR*)"\", #), {", (LONGINT)9, typ->size); + OPM_Write('"'); + OPC_Str1((CHAR*)", #), {", (LONGINT)8, typ->size); nofptrs = 0; OPC_PutPtrOffsets(typ, ((LONGINT)(0)), &nofptrs); - OPC_Str1((CHAR*)"#}}", (LONGINT)4, -((nofptrs + 1) * (LONGINT)OPM_LIntSize)); + OPC_Str1((CHAR*)"#}}", (LONGINT)4, -((nofptrs + 1) * (int)OPM_LIntSize)); OPC_EndStat(); } @@ -864,70 +868,37 @@ void OPC_Align (LONGINT *adr, LONGINT base) } } -LONGINT OPC_Base (OPT_Struct typ) +LONGINT OPC_SizeAlignment (LONGINT size) { LONGINT _o_result; - switch (typ->form) { - case 1: - _o_result = 1; - return _o_result; - break; - case 3: - _o_result = OPM_CharAlign; - return _o_result; - break; - case 2: - _o_result = OPM_BoolAlign; - return _o_result; - break; - case 4: - _o_result = OPM_SIntAlign; - return _o_result; - break; - case 5: - _o_result = OPM_IntAlign; - return _o_result; - break; - case 6: - _o_result = OPM_LIntAlign; - return _o_result; - break; - case 7: - _o_result = OPM_RealAlign; - return _o_result; - break; - case 8: - _o_result = OPM_LRealAlign; - return _o_result; - break; - case 9: - _o_result = OPM_SetAlign; - return _o_result; - break; - case 13: - _o_result = OPM_PointerAlign; - return _o_result; - break; - case 14: - _o_result = OPM_ProcAlign; - return _o_result; - break; - case 15: - if (typ->comp == 4) { - _o_result = __MASK(typ->align, -65536); - return _o_result; - } else { - _o_result = OPC_Base(typ->BaseTyp); - return _o_result; - } - break; - default: - OPM_LogWStr((CHAR*)"unhandled case in OPC.Base, typ^form = ", (LONGINT)40); - OPM_LogWNum(typ->form, ((LONGINT)(0))); - OPM_LogWLn(); - break; + LONGINT alignment; + if (size < (int)OPM_Alignment) { + alignment = 1; + while (alignment < size) { + alignment = __ASHL(alignment, 1); + } + } else { + alignment = OPM_Alignment; } - __RETCHK; + _o_result = alignment; + return _o_result; +} + +LONGINT OPC_BaseAlignment (OPT_Struct typ) +{ + LONGINT _o_result; + LONGINT alignment; + if (typ->form == 15) { + if (typ->comp == 4) { + alignment = __MASK(typ->align, -65536); + } else { + alignment = OPC_BaseAlignment(typ->BaseTyp); + } + } else { + alignment = OPC_SizeAlignment(typ->size); + } + _o_result = alignment; + return _o_result; } static void OPC_FillGap (LONGINT gap, LONGINT off, LONGINT align, LONGINT *n, LONGINT *curAlign) @@ -938,11 +909,11 @@ static void OPC_FillGap (LONGINT gap, LONGINT off, LONGINT align, LONGINT *n, LO if ((*curAlign < align && gap - (adr - off) >= align)) { gap -= (adr - off) + align; OPC_BegStat(); - if (align == (LONGINT)OPM_IntSize) { + if (align == (int)OPM_IntSize) { OPM_WriteString((CHAR*)"INTEGER", (LONGINT)8); - } else if (align == (LONGINT)OPM_LIntSize) { + } else if (align == (int)OPM_LIntSize) { OPM_WriteString((CHAR*)"LONGINT", (LONGINT)8); - } else if (align == (LONGINT)OPM_LRealSize) { + } else if (align == (int)OPM_LRealSize) { OPM_WriteString((CHAR*)"LONGREAL", (LONGINT)9); } OPC_Str1((CHAR*)" _prvt#", (LONGINT)8, *n); @@ -981,7 +952,7 @@ static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, LONGINT *off, LONGINT * } } else { adr = *off; - fldAlign = OPC_Base(fld->typ); + fldAlign = OPC_BaseAlignment(fld->typ); OPC_Align(&adr, fldAlign); gap = fld->adr - adr; if (fldAlign > *curAlign) { @@ -1007,7 +978,7 @@ static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, LONGINT *off, LONGINT * } } if (last) { - adr = typ->size - (LONGINT)__ASHR(typ->sysflag, 8); + adr = typ->size - (int)__ASHR(typ->sysflag, 8); if (adr == 0) { gap = 1; } else { @@ -1170,10 +1141,10 @@ static void OPC_Include (CHAR *name, LONGINT name__len) { __DUP(name, name__len, CHAR); OPM_WriteString((CHAR*)"#include ", (LONGINT)10); - OPM_Write('\"'); + OPM_Write('"'); OPM_WriteStringVar((void*)name, name__len); OPM_WriteString((CHAR*)".h", (LONGINT)3); - OPM_Write('\"'); + OPM_Write('"'); OPM_WriteLn(); __DEL(name); } @@ -1238,8 +1209,8 @@ void OPC_GenHdr (OPT_Node n) static void OPC_GenHeaderMsg (void) { INTEGER i; - OPM_WriteString((CHAR*)"/*", (LONGINT)3); - OPM_WriteString((CHAR*)" voc ", (LONGINT)6); + OPM_WriteString((CHAR*)"/* ", (LONGINT)4); + OPM_WriteString((CHAR*)"voc", (LONGINT)4); OPM_Write(' '); OPM_WriteString(Configuration_versionLong, ((LONGINT)(41))); OPM_Write(' '); @@ -1855,26 +1826,56 @@ void OPC_Cmp (INTEGER rel) } } +static void OPC_CharacterLiteral (LONGINT c) +{ + if (c < 32 || c > 126) { + OPM_WriteString((CHAR*)"0x", (LONGINT)3); + OPM_WriteHex(c); + } else { + OPM_Write('\''); + if ((c == 92 || c == 39) || c == 63) { + OPM_Write('\\'); + } + OPM_Write((CHAR)c); + OPM_Write('\''); + } +} + +static void OPC_StringLiteral (CHAR *s, LONGINT s__len, LONGINT l) +{ + LONGINT i; + INTEGER c; + __DUP(s, s__len, CHAR); + OPM_Write('"'); + i = 0; + while (i < l) { + c = (int)s[__X(i, s__len)]; + if (c < 32 || c > 126) { + OPM_Write('\\'); + OPM_Write((CHAR)(48 + __ASHR(c, 6))); + c = __MASK(c, -64); + OPM_Write((CHAR)(48 + __ASHR(c, 3))); + c = __MASK(c, -8); + OPM_Write((CHAR)(48 + c)); + } else { + if ((c == 92 || c == 34) || c == 63) { + OPM_Write('\\'); + } + OPM_Write((CHAR)c); + } + i += 1; + } + OPM_Write('"'); + __DEL(s); +} + void OPC_Case (LONGINT caseVal, INTEGER form) { CHAR ch; OPM_WriteString((CHAR*)"case ", (LONGINT)6); switch (form) { case 3: - ch = (CHAR)caseVal; - if ((ch >= ' ' && ch <= '~')) { - OPM_Write('\''); - if (((ch == '\\' || ch == '\?') || ch == '\'') || ch == '\"') { - OPM_Write('\\'); - OPM_Write(ch); - } else { - OPM_Write(ch); - } - OPM_Write('\''); - } else { - OPM_WriteString((CHAR*)"0x", (LONGINT)3); - OPM_WriteHex(caseVal); - } + OPC_CharacterLiteral(caseVal); break; case 4: case 5: case 6: OPM_WriteInt(caseVal); @@ -1932,8 +1933,7 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim) void OPC_Constant (OPT_Const con, INTEGER form) { - INTEGER i, len; - CHAR ch; + INTEGER i; SET s; LONGINT hex; BOOLEAN skipLeading; @@ -1945,18 +1945,7 @@ void OPC_Constant (OPT_Const con, INTEGER form) OPM_WriteInt(con->intval); break; case 3: - ch = (CHAR)con->intval; - if ((ch >= ' ' && ch <= '~')) { - OPM_Write('\''); - if (((ch == '\\' || ch == '\?') || ch == '\'') || ch == '\"') { - OPM_Write('\\'); - } - OPM_Write(ch); - OPM_Write('\''); - } else { - OPM_WriteString((CHAR*)"0x", (LONGINT)3); - OPM_WriteHex(con->intval); - } + OPC_CharacterLiteral(con->intval); break; case 4: case 5: case 6: OPM_WriteInt(con->intval); @@ -1991,18 +1980,7 @@ void OPC_Constant (OPT_Const con, INTEGER form) } break; case 10: - OPM_Write('\"'); - len = (int)con->intval2 - 1; - i = 0; - while (i < len) { - ch = (*con->ext)[__X(i, ((LONGINT)(256)))]; - if (((ch == '\\' || ch == '\?') || ch == '\'') || ch == '\"') { - OPM_Write('\\'); - } - OPM_Write(ch); - i += 1; - } - OPM_Write('\"'); + OPC_StringLiteral(*con->ext, ((LONGINT)(256)), con->intval2 - 1); break; case 11: OPM_WriteString((CHAR*)"NIL", (LONGINT)4); @@ -2015,74 +1993,74 @@ void OPC_Constant (OPT_Const con, INTEGER form) } } -static struct InitKeywords__47 { +static struct InitKeywords__48 { SHORTINT *n; - struct InitKeywords__47 *lnk; -} *InitKeywords__47_s; + struct InitKeywords__48 *lnk; +} *InitKeywords__48_s; -static void Enter__48 (CHAR *s, LONGINT s__len); +static void Enter__49 (CHAR *s, LONGINT s__len); -static void Enter__48 (CHAR *s, LONGINT s__len) +static void Enter__49 (CHAR *s, LONGINT s__len) { INTEGER h; __DUP(s, s__len, CHAR); h = OPC_PerfectHash((void*)s, s__len); - OPC_hashtab[__X(h, ((LONGINT)(105)))] = *InitKeywords__47_s->n; - __COPY(s, OPC_keytab[__X(*InitKeywords__47_s->n, ((LONGINT)(36)))], ((LONGINT)(9))); - *InitKeywords__47_s->n += 1; + OPC_hashtab[__X(h, ((LONGINT)(105)))] = *InitKeywords__48_s->n; + __COPY(s, OPC_keytab[__X(*InitKeywords__48_s->n, ((LONGINT)(36)))], ((LONGINT)(9))); + *InitKeywords__48_s->n += 1; __DEL(s); } static void OPC_InitKeywords (void) { SHORTINT n, i; - struct InitKeywords__47 _s; + struct InitKeywords__48 _s; _s.n = &n; - _s.lnk = InitKeywords__47_s; - InitKeywords__47_s = &_s; + _s.lnk = InitKeywords__48_s; + InitKeywords__48_s = &_s; n = 0; i = 0; while (i <= 104) { OPC_hashtab[__X(i, ((LONGINT)(105)))] = -1; i += 1; } - Enter__48((CHAR*)"asm", (LONGINT)4); - Enter__48((CHAR*)"auto", (LONGINT)5); - Enter__48((CHAR*)"break", (LONGINT)6); - Enter__48((CHAR*)"case", (LONGINT)5); - Enter__48((CHAR*)"char", (LONGINT)5); - Enter__48((CHAR*)"const", (LONGINT)6); - Enter__48((CHAR*)"continue", (LONGINT)9); - Enter__48((CHAR*)"default", (LONGINT)8); - Enter__48((CHAR*)"do", (LONGINT)3); - Enter__48((CHAR*)"double", (LONGINT)7); - Enter__48((CHAR*)"else", (LONGINT)5); - Enter__48((CHAR*)"enum", (LONGINT)5); - Enter__48((CHAR*)"extern", (LONGINT)7); - Enter__48((CHAR*)"export", (LONGINT)7); - Enter__48((CHAR*)"float", (LONGINT)6); - Enter__48((CHAR*)"for", (LONGINT)4); - Enter__48((CHAR*)"fortran", (LONGINT)8); - Enter__48((CHAR*)"goto", (LONGINT)5); - Enter__48((CHAR*)"if", (LONGINT)3); - Enter__48((CHAR*)"import", (LONGINT)7); - Enter__48((CHAR*)"int", (LONGINT)4); - Enter__48((CHAR*)"long", (LONGINT)5); - Enter__48((CHAR*)"register", (LONGINT)9); - Enter__48((CHAR*)"return", (LONGINT)7); - Enter__48((CHAR*)"short", (LONGINT)6); - Enter__48((CHAR*)"signed", (LONGINT)7); - Enter__48((CHAR*)"sizeof", (LONGINT)7); - Enter__48((CHAR*)"static", (LONGINT)7); - Enter__48((CHAR*)"struct", (LONGINT)7); - Enter__48((CHAR*)"switch", (LONGINT)7); - Enter__48((CHAR*)"typedef", (LONGINT)8); - Enter__48((CHAR*)"union", (LONGINT)6); - Enter__48((CHAR*)"unsigned", (LONGINT)9); - Enter__48((CHAR*)"void", (LONGINT)5); - Enter__48((CHAR*)"volatile", (LONGINT)9); - Enter__48((CHAR*)"while", (LONGINT)6); - InitKeywords__47_s = _s.lnk; + Enter__49((CHAR*)"asm", (LONGINT)4); + Enter__49((CHAR*)"auto", (LONGINT)5); + Enter__49((CHAR*)"break", (LONGINT)6); + Enter__49((CHAR*)"case", (LONGINT)5); + Enter__49((CHAR*)"char", (LONGINT)5); + Enter__49((CHAR*)"const", (LONGINT)6); + Enter__49((CHAR*)"continue", (LONGINT)9); + Enter__49((CHAR*)"default", (LONGINT)8); + Enter__49((CHAR*)"do", (LONGINT)3); + Enter__49((CHAR*)"double", (LONGINT)7); + Enter__49((CHAR*)"else", (LONGINT)5); + Enter__49((CHAR*)"enum", (LONGINT)5); + Enter__49((CHAR*)"extern", (LONGINT)7); + Enter__49((CHAR*)"export", (LONGINT)7); + Enter__49((CHAR*)"float", (LONGINT)6); + Enter__49((CHAR*)"for", (LONGINT)4); + Enter__49((CHAR*)"fortran", (LONGINT)8); + Enter__49((CHAR*)"goto", (LONGINT)5); + Enter__49((CHAR*)"if", (LONGINT)3); + Enter__49((CHAR*)"import", (LONGINT)7); + Enter__49((CHAR*)"int", (LONGINT)4); + Enter__49((CHAR*)"long", (LONGINT)5); + Enter__49((CHAR*)"register", (LONGINT)9); + Enter__49((CHAR*)"return", (LONGINT)7); + Enter__49((CHAR*)"short", (LONGINT)6); + Enter__49((CHAR*)"signed", (LONGINT)7); + Enter__49((CHAR*)"sizeof", (LONGINT)7); + Enter__49((CHAR*)"static", (LONGINT)7); + Enter__49((CHAR*)"struct", (LONGINT)7); + Enter__49((CHAR*)"switch", (LONGINT)7); + Enter__49((CHAR*)"typedef", (LONGINT)8); + Enter__49((CHAR*)"union", (LONGINT)6); + Enter__49((CHAR*)"unsigned", (LONGINT)9); + Enter__49((CHAR*)"void", (LONGINT)5); + Enter__49((CHAR*)"volatile", (LONGINT)9); + Enter__49((CHAR*)"while", (LONGINT)6); + InitKeywords__48_s = _s.lnk; } diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index 52ed8dab..b7d34a07 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h @@ -11,7 +11,7 @@ import void OPC_Align (LONGINT *adr, LONGINT base); import void OPC_Andent (OPT_Struct typ); -import LONGINT OPC_Base (OPT_Struct typ); +import LONGINT OPC_BaseAlignment (OPT_Struct typ); import OPT_Object OPC_BaseTProc (OPT_Object obj); import void OPC_BegBlk (void); import void OPC_BegStat (void); @@ -40,6 +40,7 @@ import void OPC_InitTDesc (OPT_Struct typ); import void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim); import LONGINT OPC_NofPtrs (OPT_Struct typ); import void OPC_SetInclude (BOOLEAN exclude); +import LONGINT OPC_SizeAlignment (LONGINT size); import void OPC_TDescDecl (OPT_Struct typ); import void OPC_TypeDefs (OPT_Object obj, INTEGER vis); import void OPC_TypeOf (OPT_Object ap); diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 8e5add20..bf683e41 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" @@ -14,8 +14,8 @@ typedef static CHAR OPM_SourceFileName[256]; -export INTEGER OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_CharAlign, OPM_BoolAlign, OPM_SIntAlign, OPM_IntAlign, OPM_LIntAlign, OPM_SetAlign, OPM_RealAlign, OPM_LRealAlign, OPM_PointerAlign, OPM_ProcAlign, OPM_RecAlign, OPM_MaxSet; -export LONGINT OPM_MinSInt, OPM_MinInt, OPM_MinLInt, OPM_MaxSInt, OPM_MaxInt, OPM_MaxLInt, OPM_MaxIndex; +export INTEGER OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet; +export LONGINT OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; export LONGINT OPM_curpos, OPM_errpos, OPM_breakpc; @@ -57,7 +57,6 @@ export void OPM_LogWNum (LONGINT i, LONGINT len); export void OPM_LogWStr (CHAR *s, LONGINT s__len); static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len); export void OPM_Mark (INTEGER n, LONGINT pos); -static INTEGER OPM_Min (INTEGER a, INTEGER b); export void OPM_NewSym (CHAR *modName, LONGINT modName__len); export void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); export void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); @@ -65,6 +64,8 @@ export BOOLEAN OPM_OpenPar (void); export void OPM_RegisterNewSym (void); static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt); static void OPM_ShowLine (LONGINT pos); +export LONGINT OPM_SignedMaximum (LONGINT bytecount); +export LONGINT OPM_SignedMinimum (LONGINT bytecount); export void OPM_SymRCh (CHAR *ch); export LONGINT OPM_SymRInt (void); export void OPM_SymRLReal (LONGREAL *lr); @@ -85,7 +86,7 @@ export void OPM_WriteString (CHAR *s, LONGINT s__len); export void OPM_WriteStringVar (CHAR *s, LONGINT s__len); export BOOLEAN OPM_eofSF (void); export void OPM_err (INTEGER n); -static LONGINT OPM_minus (LONGINT i); +static LONGINT OPM_minusop (LONGINT i); static LONGINT OPM_power0 (LONGINT i, LONGINT j); @@ -117,50 +118,38 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) i = 1; while (s[__X(i, s__len)] != 0x00) { switch (s[__X(i, s__len)]) { - case 'e': - *opt = *opt ^ 0x0200; - break; - case 's': - *opt = *opt ^ 0x10; - break; - case 'm': - *opt = *opt ^ 0x0400; - break; - case 'x': - *opt = *opt ^ 0x01; - break; - case 'r': - *opt = *opt ^ 0x04; - break; - case 't': - *opt = *opt ^ 0x08; - break; case 'a': *opt = *opt ^ 0x80; break; - case 'k': - *opt = *opt ^ 0x40; - break; - case 'p': - *opt = *opt ^ 0x20; - break; - case 'S': - *opt = *opt ^ 0x2000; - break; case 'c': *opt = *opt ^ 0x4000; break; - case 'M': - *opt = *opt ^ 0x8000; + case 'e': + *opt = *opt ^ 0x0200; break; case 'f': *opt = *opt ^ 0x010000; break; - case 'F': - *opt = *opt ^ 0x020000; + case 'k': + *opt = *opt ^ 0x40; break; - case 'V': - *opt = *opt ^ 0x040000; + case 'm': + *opt = *opt ^ 0x0400; + break; + case 'p': + *opt = *opt ^ 0x20; + break; + case 'r': + *opt = *opt ^ 0x04; + break; + case 's': + *opt = *opt ^ 0x10; + break; + case 't': + *opt = *opt ^ 0x08; + break; + case 'x': + *opt = *opt ^ 0x01; break; case 'B': if (s[__X(i + 1, s__len)] != 0x00) { @@ -178,6 +167,19 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) __ASSERT(OPM_IntSize == 2 || OPM_IntSize == 4, 0); __ASSERT(OPM_PointerSize == 4 || OPM_PointerSize == 8, 0); __ASSERT(OPM_Alignment == 4 || OPM_Alignment == 8, 0); + Files_SetSearchPath((CHAR*)"", (LONGINT)1); + break; + case 'F': + *opt = *opt ^ 0x020000; + break; + case 'M': + *opt = *opt ^ 0x8000; + break; + case 'S': + *opt = *opt ^ 0x2000; + break; + case 'V': + *opt = *opt ^ 0x040000; break; default: OPM_LogWStr((CHAR*)" warning: option ", (LONGINT)19); @@ -227,17 +229,17 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWLn(); OPM_LogWStr((CHAR*)" x - turn off array indices check", (LONGINT)35); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" a - don\'t check ASSERTs at runtime, use this option in tested production code", (LONGINT)80); + OPM_LogWStr((CHAR*)" a - don't check ASSERTs at runtime, use this option in tested production code", (LONGINT)80); OPM_LogWLn(); OPM_LogWStr((CHAR*)" p - turn off automatic pointer initialization", (LONGINT)48); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" t - don\'t check type guards (use in rare cases such as low-level modules where every cycle counts)", (LONGINT)101); + OPM_LogWStr((CHAR*)" t - don't check type guards (use in rare cases such as low-level modules where every cycle counts)", (LONGINT)101); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" S - don\'t call external assembler/compiler, only generate C code", (LONGINT)67); + OPM_LogWStr((CHAR*)" S - don't call external assembler/compiler, only generate C code", (LONGINT)67); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" c - don\'t call linker", (LONGINT)24); + OPM_LogWStr((CHAR*)" c - don't call linker", (LONGINT)24); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" f - don\'t use color output", (LONGINT)29); + OPM_LogWStr((CHAR*)" f - don't use color output", (LONGINT)29); OPM_LogWLn(); OPM_LogWStr((CHAR*)" F - force writing new symbol file in current directory", (LONGINT)57); OPM_LogWLn(); @@ -540,14 +542,17 @@ void OPM_FPrintSet (LONGINT *fp, SET set) void OPM_FPrintReal (LONGINT *fp, REAL real) { - OPM_FPrint(&*fp, __VAL(LONGINT, real)); + INTEGER i; + LONGINT l; + __GET((LONGINT)(SYSTEM_ADDRESS)&real, l, LONGINT); + OPM_FPrint(&*fp, l); } void OPM_FPrintLReal (LONGINT *fp, LONGREAL lr) { LONGINT l, h; - __GET((LONGINT)(uintptr_t)&lr, l, LONGINT); - __GET((LONGINT)(uintptr_t)&lr + 4, h, LONGINT); + __GET((LONGINT)(SYSTEM_ADDRESS)&lr, l, LONGINT); + __GET((LONGINT)(SYSTEM_ADDRESS)&lr + 4, h, LONGINT); OPM_FPrint(&*fp, l); OPM_FPrint(&*fp, h); } @@ -575,7 +580,7 @@ static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONG __DEL(name); } -static LONGINT OPM_minus (LONGINT i) +static LONGINT OPM_minusop (LONGINT i) { LONGINT _o_result; _o_result = -i; @@ -603,103 +608,62 @@ static void OPM_VerboseListSizes (void) OPM_LogWLn(); OPM_LogWStr((CHAR*)"CHAR ", (LONGINT)14); OPM_LogWNum(OPM_CharSize, ((LONGINT)(4))); - OPM_LogWNum(OPM_CharAlign, ((LONGINT)(5))); OPM_LogWLn(); OPM_LogWStr((CHAR*)"BOOLEAN ", (LONGINT)14); OPM_LogWNum(OPM_BoolSize, ((LONGINT)(4))); - OPM_LogWNum(OPM_BoolAlign, ((LONGINT)(5))); OPM_LogWLn(); OPM_LogWStr((CHAR*)"SHORTINT ", (LONGINT)14); OPM_LogWNum(OPM_SIntSize, ((LONGINT)(4))); - OPM_LogWNum(OPM_SIntAlign, ((LONGINT)(5))); OPM_LogWLn(); OPM_LogWStr((CHAR*)"INTEGER ", (LONGINT)14); OPM_LogWNum(OPM_IntSize, ((LONGINT)(4))); - OPM_LogWNum(OPM_IntAlign, ((LONGINT)(5))); OPM_LogWLn(); OPM_LogWStr((CHAR*)"LONGINT ", (LONGINT)14); OPM_LogWNum(OPM_LIntSize, ((LONGINT)(4))); - OPM_LogWNum(OPM_LIntAlign, ((LONGINT)(5))); OPM_LogWLn(); OPM_LogWStr((CHAR*)"SET ", (LONGINT)14); OPM_LogWNum(OPM_SetSize, ((LONGINT)(4))); - OPM_LogWNum(OPM_SetAlign, ((LONGINT)(5))); OPM_LogWLn(); OPM_LogWStr((CHAR*)"REAL ", (LONGINT)14); OPM_LogWNum(OPM_RealSize, ((LONGINT)(4))); - OPM_LogWNum(OPM_RealAlign, ((LONGINT)(5))); OPM_LogWLn(); OPM_LogWStr((CHAR*)"LONGREAL ", (LONGINT)14); OPM_LogWNum(OPM_LRealSize, ((LONGINT)(4))); - OPM_LogWNum(OPM_LRealAlign, ((LONGINT)(5))); OPM_LogWLn(); OPM_LogWStr((CHAR*)"PTR ", (LONGINT)14); OPM_LogWNum(OPM_PointerSize, ((LONGINT)(4))); - OPM_LogWNum(OPM_PointerAlign, ((LONGINT)(5))); OPM_LogWLn(); OPM_LogWStr((CHAR*)"PROC ", (LONGINT)14); OPM_LogWNum(OPM_ProcSize, ((LONGINT)(4))); - OPM_LogWNum(OPM_ProcAlign, ((LONGINT)(5))); OPM_LogWLn(); OPM_LogWStr((CHAR*)"RECORD ", (LONGINT)14); OPM_LogWNum(OPM_RecSize, ((LONGINT)(4))); - OPM_LogWNum(OPM_RecAlign, ((LONGINT)(5))); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Min shortint ", (LONGINT)14); - OPM_LogWNum(OPM_MinSInt, ((LONGINT)(4))); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Max shortint ", (LONGINT)14); - OPM_LogWNum(OPM_MaxSInt, ((LONGINT)(4))); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Min integer ", (LONGINT)14); - OPM_LogWNum(OPM_MinInt, ((LONGINT)(4))); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Max integer ", (LONGINT)14); - OPM_LogWNum(OPM_MaxInt, ((LONGINT)(4))); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Min longint ", (LONGINT)14); - OPM_LogWNum(OPM_MinLInt, ((LONGINT)(4))); - OPM_LogWLn(); } -static INTEGER OPM_Min (INTEGER a, INTEGER b) +LONGINT OPM_SignedMaximum (LONGINT bytecount) { - INTEGER _o_result; - if (a < b) { - _o_result = a; - return _o_result; - } else { - _o_result = b; - return _o_result; - } - __RETCHK; + LONGINT _o_result; + LONGINT result; + result = 1; + result = __LSH(result, __ASHL(bytecount, 3) - 1, LONGINT); + _o_result = result - 1; + return _o_result; +} + +LONGINT OPM_SignedMinimum (LONGINT bytecount) +{ + LONGINT _o_result; + _o_result = -OPM_SignedMaximum(bytecount) - 1; + return _o_result; } static void OPM_GetProperties (void) { - LONGINT base; OPM_ProcSize = OPM_PointerSize; OPM_LIntSize = __ASHL(OPM_IntSize, 1); OPM_SetSize = OPM_LIntSize; - OPM_CharAlign = OPM_Min(OPM_Alignment, OPM_CharSize); - OPM_BoolAlign = OPM_Min(OPM_Alignment, OPM_BoolSize); - OPM_SIntAlign = OPM_Min(OPM_Alignment, OPM_SIntSize); - OPM_RecAlign = OPM_Min(OPM_Alignment, OPM_RecSize); - OPM_RealAlign = OPM_Min(OPM_Alignment, OPM_RealSize); - OPM_LRealAlign = OPM_Min(OPM_Alignment, OPM_LRealSize); - OPM_PointerAlign = OPM_Min(OPM_Alignment, OPM_PointerSize); - OPM_ProcAlign = OPM_Min(OPM_Alignment, OPM_ProcSize); - OPM_IntAlign = OPM_Min(OPM_Alignment, OPM_IntSize); - OPM_LIntAlign = OPM_Min(OPM_Alignment, OPM_LIntSize); - OPM_SetAlign = OPM_Min(OPM_Alignment, OPM_SetSize); - base = -2; - OPM_MinSInt = __ASH(base, __ASHL(OPM_SIntSize, 3) - 2); - OPM_MaxSInt = OPM_minus(OPM_MinSInt + 1); - OPM_MinInt = __ASH(base, __ASHL(OPM_IntSize, 3) - 2); - OPM_MaxInt = OPM_minus(OPM_MinInt + 1); - OPM_MinLInt = __ASH(base, __ASHL(OPM_LIntSize, 3) - 2); - OPM_MaxLInt = OPM_minus(OPM_MinLInt + 1); if (OPM_RealSize == 4) { OPM_MaxReal = 3.40282346000000e+038; } else if (OPM_RealSize == 8) { @@ -713,7 +677,7 @@ static void OPM_GetProperties (void) OPM_MinReal = -OPM_MaxReal; OPM_MinLReal = -OPM_MaxLReal; OPM_MaxSet = __ASHL(OPM_SetSize, 3) - 1; - OPM_MaxIndex = OPM_MaxLInt; + OPM_MaxIndex = OPM_SignedMaximum(OPM_PointerSize); if (OPM_Verbose) { OPM_VerboseListSizes(); } @@ -875,7 +839,7 @@ void OPM_WriteInt (LONGINT i) { CHAR s[20]; LONGINT i1, k; - if (i == OPM_MinInt || i == OPM_MinLInt) { + if (i == OPM_SignedMinimum(OPM_IntSize) || i == OPM_SignedMinimum(OPM_LIntSize)) { OPM_Write('('); OPM_WriteInt(i + 1); OPM_WriteString((CHAR*)"-1)", (LONGINT)4); @@ -908,13 +872,13 @@ void OPM_WriteReal (LONGREAL r, CHAR suffx) CHAR s[32]; CHAR ch; INTEGER i; - if ((((r < OPM_MaxLInt && r > OPM_MinLInt)) && r == (__ENTIER(r)))) { + if ((((r < OPM_SignedMaximum(OPM_LIntSize) && r > OPM_SignedMinimum(OPM_LIntSize))) && r == ((int)__ENTIER(r)))) { if (suffx == 'f') { OPM_WriteString((CHAR*)"(REAL)", (LONGINT)7); } else { OPM_WriteString((CHAR*)"(LONGREAL)", (LONGINT)11); } - OPM_WriteInt(__ENTIER(r)); + OPM_WriteInt((int)__ENTIER(r)); } else { Texts_OpenWriter(&W, Texts_Writer__typ); if (suffx == 'f') { diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index db46c598..ed914bff 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h @@ -6,8 +6,8 @@ #include "SYSTEM.h" -import INTEGER OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_CharAlign, OPM_BoolAlign, OPM_SIntAlign, OPM_IntAlign, OPM_LIntAlign, OPM_SetAlign, OPM_RealAlign, OPM_LRealAlign, OPM_PointerAlign, OPM_ProcAlign, OPM_RecAlign, OPM_MaxSet; -import LONGINT OPM_MinSInt, OPM_MinInt, OPM_MinLInt, OPM_MaxSInt, OPM_MaxInt, OPM_MaxLInt, OPM_MaxIndex; +import INTEGER OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet; +import LONGINT OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; import LONGINT OPM_curpos, OPM_errpos, OPM_breakpc; @@ -38,6 +38,8 @@ import void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); import void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); import BOOLEAN OPM_OpenPar (void); import void OPM_RegisterNewSym (void); +import LONGINT OPM_SignedMaximum (LONGINT bytecount); +import LONGINT OPM_SignedMinimum (LONGINT bytecount); import void OPM_SymRCh (CHAR *ch); import LONGINT OPM_SymRInt (void); import void OPM_SymRLReal (LONGREAL *lr); diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index ffe3dff2..01d2144d 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPB.h" #include "OPM.h" @@ -438,10 +438,10 @@ static void OPP_TypeDecl (OPT_Struct *typ, OPT_Struct *banned) if (OPP_sym == 38) { OPP_qualident(&id); if (id->mode == 5) { - if (id->typ != *banned) { - *typ = id->typ; - } else { + if (id->typ == *banned) { OPP_err(58); + } else { + *typ = id->typ; } } else { OPP_err(52); @@ -1783,6 +1783,24 @@ void OPP_Module (OPT_Node *prog, SET opt) if (OPP_sym == 63) { OPS_Get(&OPP_sym); } else { + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Unexpected symbol found when MODULE expected:", (LONGINT)46); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" sym: ", (LONGINT)15); + OPM_LogWNum(OPP_sym, ((LONGINT)(1))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" OPS.name: ", (LONGINT)15); + OPM_LogWStr(OPS_name, ((LONGINT)(256))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" OPS.str: ", (LONGINT)15); + OPM_LogWStr(OPS_str, ((LONGINT)(256))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" OPS.numtyp: ", (LONGINT)15); + OPM_LogWNum(OPS_numtyp, ((LONGINT)(1))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" OPS.intval: ", (LONGINT)15); + OPM_LogWNum(OPS_intval, ((LONGINT)(1))); + OPM_LogWLn(); OPP_err(16); } if (OPP_sym == 38) { diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index 40e2def4..bf56b7d7 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index efed04c6..cacf9256 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "OPM.h" @@ -173,7 +173,7 @@ static void OPS_Number (void) OPS_numtyp = 1; if (n <= 2) { while (i < n) { - OPS_intval = __ASHL(OPS_intval, 4) + (LONGINT)Ord__7(dig[i], 1); + OPS_intval = __ASHL(OPS_intval, 4) + (int)Ord__7(dig[i], 1); i += 1; } } else { @@ -188,7 +188,7 @@ static void OPS_Number (void) OPS_intval = -1; } while (i < n) { - OPS_intval = __ASHL(OPS_intval, 4) + (LONGINT)Ord__7(dig[i], 1); + OPS_intval = __ASHL(OPS_intval, 4) + (int)Ord__7(dig[i], 1); i += 1; } } else { @@ -199,8 +199,8 @@ static void OPS_Number (void) while (i < n) { d = Ord__7(dig[i], 0); i += 1; - if (OPS_intval <= __DIV(2147483647 - (LONGINT)d, 10)) { - OPS_intval = OPS_intval * 10 + (LONGINT)d; + if (OPS_intval <= __DIV(2147483647 - (int)d, 10)) { + OPS_intval = OPS_intval * 10 + (int)d; } else { OPS_err(203); } @@ -325,7 +325,7 @@ void OPS_Get (SHORTINT *sym) } } switch (OPS_ch) { - case '\"': case '\'': + case '"': case '\'': OPS_Str(&s); break; case '#': diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index dae6e457..e901bcfc 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 8c943c20..b32d0ebd 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" @@ -849,7 +849,7 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval) conval->intval = 0; break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPT.InConstant(), f = ", (LONGINT)41); + OPM_LogWStr((CHAR*)"unhandled case in InConstant(), f = ", (LONGINT)37); OPM_LogWNum(f, ((LONGINT)(0))); OPM_LogWLn(); break; @@ -1072,7 +1072,7 @@ static void OPT_InStruct (OPT_Struct *typ) OPT_InSign(mno, &(*typ)->BaseTyp, &(*typ)->link); break; default: - OPM_LogWStr((CHAR*)"unhandled case at OPT.InStruct, tag = ", (LONGINT)39); + OPM_LogWStr((CHAR*)"unhandled case at InStruct, tag = ", (LONGINT)35); OPM_LogWNum(tag, ((LONGINT)(0))); OPM_LogWLn(); break; @@ -1175,7 +1175,7 @@ static OPT_Object OPT_InObj (SHORTINT mno) } break; default: - OPM_LogWStr((CHAR*)"unhandled case at OPT.InObj, tag = ", (LONGINT)36); + OPM_LogWStr((CHAR*)"unhandled case at InObj, tag = ", (LONGINT)32); OPM_LogWNum(tag, ((LONGINT)(0))); OPM_LogWLn(); break; @@ -1464,14 +1464,14 @@ static void OPT_OutStr (OPT_Struct typ) OPM_SymWInt(((LONGINT)(18))); break; default: - OPM_LogWStr((CHAR*)"unhandled case at OPT.OutStr, typ^.comp = ", (LONGINT)43); + OPM_LogWStr((CHAR*)"unhandled case at OutStr, typ^.comp = ", (LONGINT)39); OPM_LogWNum(typ->comp, ((LONGINT)(0))); OPM_LogWLn(); break; } break; default: - OPM_LogWStr((CHAR*)"unhandled case at OPT.OutStr, typ^.form = ", (LONGINT)43); + OPM_LogWStr((CHAR*)"unhandled case at OutStr, typ^.form = ", (LONGINT)39); OPM_LogWNum(typ->form, ((LONGINT)(0))); OPM_LogWLn(); break; @@ -1536,7 +1536,7 @@ static void OPT_OutObj (OPT_Object obj) OPT_FPrintErr(obj, 251); break; default: - OPM_LogWStr((CHAR*)"unhandled case at OPT.OutObj, obj^.history = ", (LONGINT)46); + OPM_LogWStr((CHAR*)"unhandled case at OutObj, obj^.history = ", (LONGINT)42); OPM_LogWNum(obj->history, ((LONGINT)(0))); OPM_LogWLn(); break; @@ -1592,7 +1592,7 @@ static void OPT_OutObj (OPT_Object obj) OPT_OutName((void*)obj->name, ((LONGINT)(256))); break; default: - OPM_LogWStr((CHAR*)"unhandled case at OPT.OutObj, obj.mode = ", (LONGINT)42); + OPM_LogWStr((CHAR*)"unhandled case at OutObj, obj.mode = ", (LONGINT)38); OPM_LogWNum(obj->mode, ((LONGINT)(0))); OPM_LogWLn(); break; @@ -1809,6 +1809,7 @@ export void *OPT__init(void) OPT_syslink = OPT_topScope->right; OPT_universe = OPT_topScope; OPT_topScope->right = NIL; + OPT_EnterTyp((CHAR*)"BOOLEAN", 2, OPM_BoolSize, &OPT_booltyp); OPT_EnterTyp((CHAR*)"CHAR", 3, OPM_CharSize, &OPT_chartyp); OPT_EnterTyp((CHAR*)"SET", 9, OPM_SetSize, &OPT_settyp); OPT_EnterTyp((CHAR*)"REAL", 7, OPM_RealSize, &OPT_realtyp); @@ -1816,7 +1817,6 @@ export void *OPT__init(void) OPT_EnterTyp((CHAR*)"LONGINT", 6, OPM_LIntSize, &OPT_linttyp); OPT_EnterTyp((CHAR*)"LONGREAL", 8, OPM_LRealSize, &OPT_lrltyp); OPT_EnterTyp((CHAR*)"SHORTINT", 4, OPM_SIntSize, &OPT_sinttyp); - OPT_EnterTyp((CHAR*)"BOOLEAN", 2, OPM_BoolSize, &OPT_booltyp); OPT_EnterBoolConst((CHAR*)"FALSE", ((LONGINT)(0))); OPT_EnterBoolConst((CHAR*)"TRUE", ((LONGINT)(1))); OPT_EnterProc((CHAR*)"HALT", 0); diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index 45816124..41b3e7ec 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h @@ -59,8 +59,7 @@ typedef INTEGER ref, sysflag; LONGINT n, size, align, txtpos; BOOLEAN allocated, pbused, pvused; - char _prvt0[8]; - LONGINT pbfp, pvfp; + char _prvt0[16]; OPT_Struct BaseTyp; OPT_Object link, strobj; } OPT_StrDesc; diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index 23bff9c0..cf646f5e 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPC.h" #include "OPM.h" @@ -23,7 +23,7 @@ export LONGINT *OPV_ExitInfo__typ; static void OPV_ActualPar (OPT_Node n, OPT_Object fp); export void OPV_AdrAndSize (OPT_Object topScope); static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc); -static void OPV_Convert (OPT_Node n, INTEGER form, INTEGER prec); +static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec); static void OPV_DefineTDescs (OPT_Node n); static void OPV_Entier (OPT_Node n, INTEGER prec); static void OPV_GetTProcNum (OPT_Object obj); @@ -38,6 +38,7 @@ static LONGINT OPV_NaturalAlignment (LONGINT size, LONGINT max); static void OPV_NewArr (OPT_Node d, OPT_Node x); static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, INTEGER comp); static BOOLEAN OPV_SideEffects (OPT_Node n); +static void OPV_SizeCast (LONGINT size); static void OPV_Stamp (OPS_Name s); static OPT_Object OPV_SuperProc (OPT_Node n); static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported); @@ -82,10 +83,10 @@ void OPV_TypSize (OPT_Struct typ) btyp = typ->BaseTyp; if (btyp == NIL) { offset = 0; - base = OPM_RecAlign; + base = OPC_SizeAlignment(OPM_RecSize); } else { OPV_TypSize(btyp); - offset = btyp->size - (LONGINT)__ASHR(btyp->sysflag, 8); + offset = btyp->size - (int)__ASHR(btyp->sysflag, 8); base = btyp->align; } fld = typ->link; @@ -93,7 +94,7 @@ void OPV_TypSize (OPT_Struct typ) btyp = fld->typ; OPV_TypSize(btyp); size = btyp->size; - fbase = OPC_Base(btyp); + fbase = OPC_BaseAlignment(btyp); OPC_Align(&offset, fbase); fld->adr = offset; offset += size; @@ -107,7 +108,7 @@ void OPV_TypSize (OPT_Struct typ) offset = 1; } if (OPM_RecSize == 0) { - base = OPV_NaturalAlignment(offset, OPM_RecAlign); + base = OPV_NaturalAlignment(offset, OPC_SizeAlignment(OPM_RecSize)); } OPC_Align(&offset, base); if ((typ->strobj == NIL && __MASK(typ->align, -65536) == 0)) { @@ -332,7 +333,7 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN return _o_result; break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence Nmop, subclass = ", (LONGINT)51); + OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Nmop, subclass = ", (LONGINT)55); OPM_LogWNum(subclass, ((LONGINT)(0))); OPM_LogWLn(); break; @@ -402,7 +403,7 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN return _o_result; break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence Ndop, subclass = ", (LONGINT)51); + OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Ndop, subclass = ", (LONGINT)55); OPM_LogWNum(subclass, ((LONGINT)(0))); OPM_LogWLn(); break; @@ -465,41 +466,26 @@ static void OPV_Entier (OPT_Node n, INTEGER prec) } } -static void OPV_Convert (OPT_Node n, INTEGER form, INTEGER prec) +static void OPV_SizeCast (LONGINT size) { - INTEGER from; + if (size <= 4) { + OPM_WriteString((CHAR*)"(int)", (LONGINT)6); + } else { + OPM_WriteString((CHAR*)"(SYSTEM_INT64)", (LONGINT)15); + } +} + +static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec) +{ + INTEGER from, to; from = n->typ->form; - if (form == 9) { + to = newtype->form; + if (to == 9) { OPM_WriteString((CHAR*)"__SETOF(", (LONGINT)9); OPV_Entier(n, -1); OPM_Write(')'); - } else if (form == 6) { - if (from < 6) { - OPM_WriteString((CHAR*)"(LONGINT)", (LONGINT)10); - } - OPV_Entier(n, 9); - } else if (form == 5) { - if (from < 5) { - OPM_WriteString((CHAR*)"(int)", (LONGINT)6); - OPV_expr(n, 9); - } else { - if (__IN(2, OPM_opt)) { - OPM_WriteString((CHAR*)"__SHORT", (LONGINT)8); - if (OPV_SideEffects(n)) { - OPM_Write('F'); - } - OPM_Write('('); - OPV_Entier(n, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); - OPM_WriteInt(OPM_MaxInt + 1); - OPM_Write(')'); - } else { - OPM_WriteString((CHAR*)"(int)", (LONGINT)6); - OPV_Entier(n, 9); - } - } - } else if (form == 4) { - if (__IN(2, OPM_opt)) { + } else if (__IN(to, 0x70)) { + if ((newtype->size < n->typ->size && __IN(2, OPM_opt))) { OPM_WriteString((CHAR*)"__SHORT", (LONGINT)8); if (OPV_SideEffects(n)) { OPM_Write('F'); @@ -507,13 +493,15 @@ static void OPV_Convert (OPT_Node n, INTEGER form, INTEGER prec) OPM_Write('('); OPV_Entier(n, -1); OPM_WriteString((CHAR*)", ", (LONGINT)3); - OPM_WriteInt(OPM_MaxSInt + 1); + OPM_WriteInt(OPM_SignedMaximum(newtype->size) + 1); OPM_Write(')'); } else { - OPM_WriteString((CHAR*)"(int)", (LONGINT)6); + if (newtype->size != n->typ->size) { + OPV_SizeCast(newtype->size); + } OPV_Entier(n, 9); } - } else if (form == 3) { + } else if (to == 3) { if (__IN(2, OPM_opt)) { OPM_WriteString((CHAR*)"__CHR", (LONGINT)6); if (OPV_SideEffects(n)) { @@ -576,7 +564,7 @@ static void OPV_design (OPT_Node n, INTEGER prec) OPT_Struct typ = NIL; INTEGER class, designPrec, comp; OPT_Node d = NIL, x = NIL; - INTEGER dims, i, _for__26; + INTEGER dims, i, _for__27; comp = n->typ->comp; obj = n->obj; class = n->class; @@ -652,15 +640,15 @@ static void OPV_design (OPT_Node n, INTEGER prec) } x = x->left; } - _for__26 = dims; + _for__27 = dims; i = 1; - while (i <= _for__26) { + while (i <= _for__27) { OPM_Write(')'); i += 1; } if (n->typ->comp == 3) { OPM_Write(')'); - while ((LONGINT)i < __ASHR(d->typ->size - 4, 2)) { + while ((int)i < __ASHR(d->typ->size - 4, 2)) { OPM_WriteString((CHAR*)" * ", (LONGINT)4); OPV_Len(d, i); i += 1; @@ -795,7 +783,7 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) } if ((((mode == 2 && n->class == 11)) && n->subcl == 29)) { OPV_expr(n->left, prec); - } else if ((((((form == 6 && n->class == 7)) && n->conval->intval <= OPM_MaxInt)) && n->conval->intval >= OPM_MinInt)) { + } else if ((((((form == 6 && n->class == 7)) && n->conval->intval <= OPM_SignedMaximum(OPM_IntSize))) && n->conval->intval >= OPM_SignedMinimum(OPM_IntSize))) { OPM_WriteString((CHAR*)"((LONGINT)(", (LONGINT)12); OPV_expr(n, prec); OPM_WriteString((CHAR*)"))", (LONGINT)3); @@ -914,7 +902,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPM_Write(')'); break; case 20: - OPV_Convert(l, form, exprPrec); + OPV_Convert(l, n->typ, exprPrec); break; case 21: if (OPV_SideEffects(l)) { @@ -943,7 +931,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPM_Write(')'); break; case 24: - OPM_WriteString((CHAR*)"(LONGINT)(uintptr_t)", (LONGINT)21); + OPM_WriteString((CHAR*)"(LONGINT)(SYSTEM_ADDRESS)", (LONGINT)26); if (l->class == 1) { OPC_CompleteIdent(l->obj); } else { @@ -954,20 +942,16 @@ static void OPV_expr (OPT_Node n, INTEGER prec) } break; case 29: - if ((((__IN(n->typ->form, 0x6240) && __IN(l->typ->form, 0x6240))) && n->typ->size == l->typ->size) || !__IN(l->class, 0x17)) { + if (!__IN(l->class, 0x17) || (((__IN(n->typ->form, 0x6240) && __IN(l->typ->form, 0x6240))) && n->typ->size == l->typ->size)) { OPM_Write('('); OPC_Ident(n->typ->strobj); OPM_Write(')'); if (__IN(n->typ->form, 0x6000) || __IN(l->typ->form, 0x6000)) { - OPM_WriteString((CHAR*)"(uintptr_t)", (LONGINT)12); + OPM_WriteString((CHAR*)"(SYSTEM_ADDRESS)", (LONGINT)17); } OPV_expr(l, exprPrec); } else { - if (__IN(n->typ->form, 0x6000) || __IN(l->typ->form, 0x6000)) { - OPM_WriteString((CHAR*)"__VALP(", (LONGINT)8); - } else { - OPM_WriteString((CHAR*)"__VAL(", (LONGINT)7); - } + OPM_WriteString((CHAR*)"__VAL(", (LONGINT)7); OPC_Ident(n->typ->strobj); OPM_WriteString((CHAR*)", ", (LONGINT)3); OPV_expr(l, -1); @@ -1326,7 +1310,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) OPM_WriteInt(base->size); OPM_WriteString((CHAR*)"))", (LONGINT)3); OPM_WriteString((CHAR*)", ", (LONGINT)3); - OPM_WriteInt(OPC_Base(base)); + OPM_WriteInt(OPC_BaseAlignment(base)); OPM_WriteString((CHAR*)", ", (LONGINT)3); OPM_WriteInt(nofdim); OPM_WriteString((CHAR*)", ", (LONGINT)3); diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index 0de9e6cc..04828b2f 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 3cce2026..74c43788 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef @@ -118,14 +118,14 @@ export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT #define Platform_EXDEV() EXDEV extern void Heap_InitHeap(); #define Platform_HeapInitHeap() Heap_InitHeap() -#define Platform_allocate(size) (LONGINT)(uintptr_t)((void*)malloc((size_t)size)) +#define Platform_allocate(size) (LONGINT)(SYSTEM_ADDRESS)((void*)malloc((size_t)size)) #define Platform_chdir(n, n__len) chdir((char*)n) #define Platform_closefile(fd) close(fd) #define Platform_err() errno #define Platform_errc(c) write(1, &c, 1) #define Platform_errstring(s, s__len) write(1, s, s__len-1) #define Platform_exit(code) exit(code) -#define Platform_free(address) free((void*)(uintptr_t)address) +#define Platform_free(address) free((void*)(SYSTEM_ADDRESS)address) #define Platform_fstat(fd) fstat(fd, &s) #define Platform_fsync(fd) fsync(fd) #define Platform_ftruncate(fd, l) ftruncate(fd, l) @@ -138,13 +138,13 @@ extern void Heap_InitHeap(); #define Platform_opennew(n, n__len) open((char*)n, O_CREAT | O_TRUNC | O_RDWR, 0664) #define Platform_openro(n, n__len) open((char*)n, O_RDONLY) #define Platform_openrw(n, n__len) open((char*)n, O_RDWR) -#define Platform_readfile(fd, p, l) read(fd, (void*)(uintptr_t)(p), l) +#define Platform_readfile(fd, p, l) read(fd, (void*)(SYSTEM_ADDRESS)(p), l) #define Platform_rename(o, o__len, n, n__len) rename((char*)o, (char*)n) #define Platform_sectotm(s) struct tm *time = localtime((time_t*)&s) #define Platform_seekcur() SEEK_CUR #define Platform_seekend() SEEK_END #define Platform_seekset() SEEK_SET -#define Platform_sethandler(s, h) SystemSetHandler(s, (uintptr_t)h) +#define Platform_sethandler(s, h) SystemSetHandler(s, (SYSTEM_ADDRESS)h) #define Platform_stat(n, n__len) stat((char*)n, &s) #define Platform_statdev() (LONGINT)s.st_dev #define Platform_statino() (LONGINT)s.st_ino @@ -161,7 +161,7 @@ extern void Heap_InitHeap(); #define Platform_tvsec() tv.tv_sec #define Platform_tvusec() tv.tv_usec #define Platform_unlink(n, n__len) unlink((char*)n) -#define Platform_writefile(fd, p, l) write(fd, (void*)(uintptr_t)(p), l) +#define Platform_writefile(fd, p, l) write(fd, (void*)(SYSTEM_ADDRESS)(p), l) BOOLEAN Platform_TooManyFiles (INTEGER e) { @@ -229,7 +229,7 @@ void Platform_Init (INTEGER argc, LONGINT argvadr) Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; Platform_ArgCount = argc; - av = (Platform_ArgVecPtr)(uintptr_t)argvadr; + av = (Platform_ArgVecPtr)(SYSTEM_ADDRESS)argvadr; Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; Platform_HeapInitHeap(); @@ -262,7 +262,7 @@ void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { - av = (Platform_ArgVec)(uintptr_t)Platform_ArgVector; + av = (Platform_ArgVec)(SYSTEM_ADDRESS)Platform_ArgVector; __COPY(*(*av)[__X(n, ((LONGINT)(1024)))], val, val__len); } } @@ -529,7 +529,7 @@ INTEGER Platform_Read (LONGINT h, LONGINT p, LONGINT l, LONGINT *n) INTEGER Platform_ReadBuf (LONGINT h, SYSTEM_BYTE *b, LONGINT b__len, LONGINT *n) { INTEGER _o_result; - *n = Platform_readfile(h, (LONGINT)(uintptr_t)b, b__len); + *n = Platform_readfile(h, (LONGINT)(SYSTEM_ADDRESS)b, b__len); if (*n < 0) { *n = 0; _o_result = Platform_err(); @@ -765,7 +765,7 @@ static void Platform_TestLittleEndian (void) { INTEGER i; i = 1; - __GET((LONGINT)(uintptr_t)&i, Platform_LittleEndian, BOOLEAN); + __GET((LONGINT)(SYSTEM_ADDRESS)&i, Platform_LittleEndian, BOOLEAN); } __TDESC(Platform_FileIdentity, 1, 0) = {__TDFLDS("FileIdentity", 12), {-4}}; diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index 581da770..dd5ce434 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 0f1c3a92..2323e34d 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -58,7 +58,7 @@ INTEGER Reals_Expo (REAL x) { INTEGER _o_result; INTEGER i; - __GET((LONGINT)(uintptr_t)&x + 2, i, INTEGER); + __GET((LONGINT)(SYSTEM_ADDRESS)&x + 2, i, INTEGER); _o_result = __MASK(__ASHR(i, 7), -256); return _o_result; } @@ -66,17 +66,17 @@ INTEGER Reals_Expo (REAL x) void Reals_SetExpo (REAL *x, INTEGER ex) { CHAR c; - __GET((LONGINT)(uintptr_t)x + 3, c, CHAR); - __PUT((LONGINT)(uintptr_t)x + 3, (CHAR)(__ASHL(__ASHR((int)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); - __GET((LONGINT)(uintptr_t)x + 2, c, CHAR); - __PUT((LONGINT)(uintptr_t)x + 2, (CHAR)(__MASK((int)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); + __GET((LONGINT)(SYSTEM_ADDRESS)x + 3, c, CHAR); + __PUT((LONGINT)(SYSTEM_ADDRESS)x + 3, (CHAR)(__ASHL(__ASHR((int)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __GET((LONGINT)(SYSTEM_ADDRESS)x + 2, c, CHAR); + __PUT((LONGINT)(SYSTEM_ADDRESS)x + 2, (CHAR)(__MASK((int)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } INTEGER Reals_ExpoL (LONGREAL x) { INTEGER _o_result; INTEGER i; - __GET((LONGINT)(uintptr_t)&x + 6, i, INTEGER); + __GET((LONGINT)(SYSTEM_ADDRESS)&x + 6, i, INTEGER); _o_result = __MASK(__ASHR(i, 4), -2048); return _o_result; } @@ -89,8 +89,8 @@ void Reals_ConvertL (LONGREAL x, INTEGER n, CHAR *d, LONGINT d__len) } k = 0; if (n > 9) { - i = __ENTIER(x / (LONGREAL)(LONGREAL)1000000000); - j = __ENTIER(x - i * (LONGREAL)1000000000); + i = (int)__ENTIER(x / (LONGREAL)(LONGREAL)1000000000); + j = (int)__ENTIER(x - i * (LONGREAL)1000000000); if (j < 0) { j = 0; } @@ -100,9 +100,9 @@ void Reals_ConvertL (LONGREAL x, INTEGER n, CHAR *d, LONGINT d__len) k += 1; } } else { - i = __ENTIER(x); + i = (int)__ENTIER(x); } - while (k < (LONGINT)n) { + while (k < (int)n) { d[__X(k, d__len)] = (CHAR)(__MOD(i, 10) + 48); i = __DIV(i, 10); k += 1; @@ -134,7 +134,7 @@ static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LO CHAR by; i = 0; l = b__len; - while ((LONGINT)i < l) { + while ((int)i < l) { by = __VAL(CHAR, b[__X(i, b__len)]); d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((int)by, 4)); d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((int)by, -16)); diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index 4a783296..7e6b534c 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/SYSTEM.c b/bootstrap/unix-48/SYSTEM.c index 50e91c6d..33511a70 100644 --- a/bootstrap/unix-48/SYSTEM.c +++ b/bootstrap/unix-48/SYSTEM.c @@ -35,7 +35,7 @@ void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0) void SYSTEM_ENUMP(void *adr, LONGINT n, void (*P)()) { while (n > 0) { - P((LONGINT)(uintptr_t)(*((void**)(adr)))); + P((LONGINT)(SYSTEM_ADDRESS)(*((void**)(adr)))); adr = ((void**)adr) + 1; n--; } @@ -106,7 +106,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, else if (typ == (LONGINT*)POINTER__typ) { /* element type is a pointer */ x = Heap_NEWBLK(size + nofelems * sizeof(LONGINT)); - p = (LONGINT*)(uintptr_t)x[-1]; + p = (LONGINT*)(SYSTEM_ADDRESS)x[-1]; p[-nofelems] = *p; /* build new type desc in situ: 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nofelems - 1; n = 1; /* n =1 for skipping the size field */ while (n <= nofelems) {*p = n*sizeof(LONGINT); p++; n++;} @@ -119,7 +119,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, while (ptab[nofptrs] >= 0) {nofptrs++;} /* number of pointers per element */ nptr = nofelems * nofptrs; /* total number of pointers */ x = Heap_NEWBLK(size + nptr * sizeof(LONGINT)); - p = (LONGINT*)(uintptr_t)x[- 1]; + p = (LONGINT*)(SYSTEM_ADDRESS)x[- 1]; p[-nptr] = *p; /* build new type desc in situ; 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nptr - 1; n = 0; off = dataoff; while (n < nofelems) {i = 0; @@ -155,7 +155,7 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler // (Ignore other signals) } - void SystemSetHandler(int s, uintptr_t h) { + void SystemSetHandler(int s, SYSTEM_ADDRESS h) { if (s >= 2 && s <= 4) { int needtosetsystemhandler = handler[s-2] == 0; handler[s-2] = (SystemSignalHandler)h; @@ -194,12 +194,12 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler } } - void SystemSetInterruptHandler(uintptr_t h) { + void SystemSetInterruptHandler(SYSTEM_ADDRESS h) { EnsureConsoleCtrlHandler(); SystemInterruptHandler = (SystemSignalHandler)h; } - void SystemSetQuitHandler(uintptr_t h) { + void SystemSetQuitHandler(SYSTEM_ADDRESS h) { EnsureConsoleCtrlHandler(); SystemQuitHandler = (SystemSignalHandler)h; } diff --git a/bootstrap/unix-48/SYSTEM.h b/bootstrap/unix-48/SYSTEM.h index 949951ac..6377745e 100644 --- a/bootstrap/unix-48/SYSTEM.h +++ b/bootstrap/unix-48/SYSTEM.h @@ -1,28 +1,38 @@ #ifndef SYSTEM__h #define SYSTEM__h -#ifndef _WIN32 - - // Building for a Unix/Linux based system - #include // For memcpy ... - #include // For uintptr_t ... - +#if defined(_WIN64) + typedef long long SYSTEM_INT64; + typedef unsigned long long SYSTEM_CARD64; #else - - // Building for Windows platform with either mingw under cygwin, or the MS C compiler - #ifdef _WIN64 - typedef unsigned long long size_t; - typedef unsigned long long uintptr_t; - #else - typedef unsigned int size_t; - typedef unsigned int uintptr_t; - #endif /* _WIN64 */ - - typedef unsigned int uint32_t; - void * __cdecl memcpy(void * dest, const void * source, size_t size); - + typedef long SYSTEM_INT64; + typedef unsigned long SYSTEM_CARD64; #endif +typedef int SYSTEM_INT32; +typedef unsigned int SYSTEM_CARD32; +typedef short int SYSTEM_INT16; +typedef unsigned short int SYSTEM_CARD16; +typedef signed char SYSTEM_INT8; +typedef unsigned char SYSTEM_CARD8; + +#if (__SIZEOF_POINTER__ == 8) || defined(_WIN64) || defined(__LP64__) + #if defined(_WIN64) + typedef unsigned long long size_t; + #else + typedef unsigned long size_t; + #endif +#else + typedef unsigned int size_t; +#endif + +#define SYSTEM_ADDRESS size_t +#define _SIZE_T_DECLARED // For FreeBSD +#define _SIZE_T_DEFINED_ // For OpenBSD + +void *memcpy(void *dest, const void *source, SYSTEM_ADDRESS size); + + // The compiler uses 'import' and 'export' which translate to 'extern' and // nothing respectively. @@ -70,6 +80,7 @@ typedef unsigned char U_SHORTINT; #endif typedef U_LONGINT SET; +typedef U_LONGINT U_SET; // OS Memory allocation interfaces are in PlatformXXX.Mod @@ -96,10 +107,10 @@ extern LONGINT SYSTEM_ENTIER (double x); // Signal handling in SYSTEM.c #ifndef _WIN32 - extern void SystemSetHandler(int s, uintptr_t h); + extern void SystemSetHandler(int s, SYSTEM_ADDRESS h); #else - extern void SystemSetInterruptHandler(uintptr_t h); - extern void SystemSetQuitHandler (uintptr_t h); + extern void SystemSetInterruptHandler(SYSTEM_ADDRESS h); + extern void SystemSetQuitHandler (SYSTEM_ADDRESS h); #endif @@ -122,20 +133,20 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __COPY(s, d, n) {char*_a=(void*)s,*_b=(void*)d; LONGINT _i=0,_t=n-1; \ while(_i<_t&&((_b[_i]=_a[_i])!=0)){_i++;};_b[_i]=0;} -#define __DUP(x, l, t) x=(void*)memcpy((void*)(uintptr_t)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) +#define __DUP(x, l, t) x=(void*)memcpy((void*)(SYSTEM_ADDRESS)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) #define __DUPARR(v, t) v=(void*)memcpy(v##__copy,v,sizeof(t)) -#define __DEL(x) Platform_OSFree((LONGINT)(uintptr_t)x) +#define __DEL(x) Platform_OSFree((LONGINT)(SYSTEM_ADDRESS)x) /* 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 + +#define __GET(a, x, t) x= *(t*)(SYSTEM_ADDRESS)(a) +#define __PUT(a, x, t) *(t*)(SYSTEM_ADDRESS)(a)=x #define __LSHL(x, n, t) ((t)((U_##t)(x)<<(n))) #define __LSHR(x, n, t) ((t)((U_##t)(x)>>(n))) @@ -150,7 +161,7 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) #define __BIT(x, n) (*(U_LONGINT*)(x)>>(n)&1) -#define __MOVE(s, d, n) memcpy((char*)(uintptr_t)(d),(char*)(uintptr_t)(s),n) +#define __MOVE(s, d, n) memcpy((char*)(SYSTEM_ADDRESS)(d),(char*)(SYSTEM_ADDRESS)(s),n) #define __ASHF(x, n) SYSTEM_ASH((LONGINT)(x), (LONGINT)(n)) #define __SHORT(x, y) ((int)((U_LONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) #define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) @@ -211,7 +222,7 @@ extern void Heap_INCREF(); extern void Platform_Init(INTEGER argc, LONGINT argv); extern void Heap_FINALL(); -#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (LONGINT)(uintptr_t)&argv); +#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (LONGINT)(SYSTEM_ADDRESS)&argv); #define __REGMAIN(name, enum) m = Heap_REGMOD((CHAR*)name,enum) #define __FINI Heap_FINALL(); return 0 @@ -232,7 +243,7 @@ extern SYSTEM_PTR Heap_NEWREC (LONGINT tag); extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __SYSNEW(p, len) p = Heap_NEWBLK((LONGINT)(len)) -#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(uintptr_t)t##__typ) +#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(SYSTEM_ADDRESS)t##__typ) #define __NEWARR SYSTEM_NEWARR @@ -263,20 +274,20 @@ extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __INITYP(t, t0, level) \ t##__typ = (LONGINT*)&t##__desc.blksz; \ memcpy(t##__desc.basep, t0##__typ - __BASEOFF, level*sizeof(LONGINT)); \ - t##__desc.basep[level] = (LONGINT)(uintptr_t)t##__typ; \ - t##__desc.module = (LONGINT)(uintptr_t)m; \ + t##__desc.basep[level] = (LONGINT)(SYSTEM_ADDRESS)t##__typ; \ + t##__desc.module = (LONGINT)(SYSTEM_ADDRESS)m; \ if(t##__desc.blksz!=sizeof(struct t)) __HALT(-15); \ t##__desc.blksz = (t##__desc.blksz+5*sizeof(LONGINT)-1)/(4*sizeof(LONGINT))*(4*sizeof(LONGINT)); \ - Heap_REGTYP(m, (LONGINT)(uintptr_t)&t##__desc.next); \ + Heap_REGTYP(m, (LONGINT)(SYSTEM_ADDRESS)&t##__desc.next); \ SYSTEM_INHERIT(t##__typ, t0##__typ) -#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(uintptr_t)typ##__typ) -#define __TYPEOF(p) ((LONGINT*)(uintptr_t)(*(((LONGINT*)(p))-1))) +#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(SYSTEM_ADDRESS)typ##__typ) +#define __TYPEOF(p) ((LONGINT*)(SYSTEM_ADDRESS)(*(((LONGINT*)(p))-1))) #define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) // Oberon-2 type bound procedures support -#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(uintptr_t)proc -#define __SEND(typ, num, funtyp, parlist) ((funtyp)((uintptr_t)*(typ-(__TPROC0OFF+num))))parlist +#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(SYSTEM_ADDRESS)proc +#define __SEND(typ, num, funtyp, parlist) ((funtyp)((SYSTEM_ADDRESS)*(typ-(__TPROC0OFF+num))))parlist diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index d2713d0f..115456ea 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -21,7 +21,7 @@ INTEGER Strings_Length (CHAR *s, LONGINT s__len) INTEGER i; __DUP(s, s__len, CHAR); i = 0; - while (((LONGINT)i < s__len && s[__X(i, s__len)] != 0x00)) { + while (((int)i < s__len && s[__X(i, s__len)] != 0x00)) { i += 1; } _o_result = i; @@ -36,11 +36,11 @@ void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__ n1 = Strings_Length(dest, dest__len); n2 = Strings_Length(extra, extra__len); i = 0; - while ((i < n2 && (LONGINT)(i + n1) < dest__len)) { + while ((i < n2 && (int)(i + n1) < dest__len)) { dest[__X(i + n1, dest__len)] = extra[__X(i, extra__len)]; i += 1; } - if ((LONGINT)(i + n1) < dest__len) { + if ((int)(i + n1) < dest__len) { dest[__X(i + n1, dest__len)] = 0x00; } __DEL(extra); @@ -59,10 +59,10 @@ void Strings_Insert (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, Strings_Append(dest, dest__len, (void*)source, source__len); return; } - if ((LONGINT)(pos + n2) < dest__len) { + if ((int)(pos + n2) < dest__len) { i = n1; while (i >= pos) { - if ((LONGINT)(i + n2) < dest__len) { + if ((int)(i + n2) < dest__len) { dest[__X(i + n2, dest__len)] = dest[__X(i, dest__len)]; } i -= 1; @@ -91,7 +91,7 @@ void Strings_Delete (CHAR *s, LONGINT s__len, INTEGER pos, INTEGER n) s[__X(i - n, s__len)] = s[__X(i, s__len)]; i += 1; } - if ((LONGINT)(i - n) < s__len) { + if ((int)(i - n) < s__len) { s[__X(i - n, s__len)] = 0x00; } } else { @@ -121,7 +121,7 @@ void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n, return; } i = 0; - while (((((LONGINT)(pos + i) <= source__len && source[__X(pos + i, source__len)] != 0x00)) && i < n)) { + while (((((int)(pos + i) <= source__len && source[__X(pos + i, source__len)] != 0x00)) && i < n)) { if (i < destLen) { dest[__X(i, dest__len)] = source[__X(pos + i, source__len)]; } diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index 5f45d8a8..96dbb01d 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index 2dab1e0f..cfe34ca7 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Files.h" #include "Modules.h" @@ -787,9 +787,9 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) (*S).s[__X(i, ((LONGINT)(64)))] = 0x00; (*S).len = i; (*S).class = 1; - } else if (ch == '\"') { + } else if (ch == '"') { Texts_Read((void*)&*S, S__typ, &ch); - while ((((ch != '\"' && ch >= ' ')) && i != 63)) { + while ((((ch != '"' && ch >= ' ')) && i != 63)) { (*S).s[__X(i, ((LONGINT)(64)))] = ch; i += 1; Texts_Read((void*)&*S, S__typ, &ch); @@ -839,7 +839,7 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) k -= 16; } while (j < i) { - k = __ASHL(k, 4) + (LONGINT)((int)d[__X(j, ((LONGINT)(32)))] - 48); + k = __ASHL(k, 4) + (int)((int)d[__X(j, ((LONGINT)(32)))] - 48); j += 1; } if (neg) { @@ -929,7 +929,7 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) (*S).class = 3; k = 0; do { - k = k * 10 + (LONGINT)((int)d[__X(j, ((LONGINT)(32)))] - 48); + k = k * 10 + (int)((int)d[__X(j, ((LONGINT)(32)))] - 48); j += 1; } while (!(j == i)); if (neg) { @@ -1067,7 +1067,7 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n) x0 = __DIV(x0, 10); i += 1; } while (!(x0 == 0)); - while (n > (LONGINT)i) { + while (n > (int)i) { Texts_Write(&*W, W__typ, ' '); n -= 1; } @@ -1319,7 +1319,7 @@ void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER } else { Texts_Write(&*W, W__typ, ' '); } - e = (int)__ASHR((LONGINT)(e - 1023) * 77, 8); + e = (int)__ASHR((int)(e - 1023) * 77, 8); if (e >= 0) { x = x / (LONGREAL)Reals_TenL(e); } else { diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index 189403c9..632b644a 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/Vishap.c b/bootstrap/unix-48/Vishap.c index 74d0e984..4c9e3b45 100644 --- a/bootstrap/unix-48/Vishap.c +++ b/bootstrap/unix-48/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkamSf */ #include "SYSTEM.h" #include "Configuration.h" #include "Heap.h" diff --git a/bootstrap/unix-48/errors.c b/bootstrap/unix-48/errors.c index f8ddb53a..68e433df 100644 --- a/bootstrap/unix-48/errors.c +++ b/bootstrap/unix-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef @@ -25,7 +25,7 @@ export void *errors__init(void) errors_errors[6][0] = 0x00; errors_errors[7][0] = 0x00; errors_errors[8][0] = 0x00; - __MOVE("\'=\' expected", errors_errors[9], 13); + __MOVE("'=' expected", errors_errors[9], 13); errors_errors[10][0] = 0x00; errors_errors[11][0] = 0x00; __MOVE("type definition starts with incorrect symbol", errors_errors[12], 45); @@ -34,28 +34,28 @@ export void *errors__init(void) __MOVE("declaration followed by incorrect symbol", errors_errors[15], 41); __MOVE("MODULE expected", errors_errors[16], 16); errors_errors[17][0] = 0x00; - __MOVE("\'.\' missing", errors_errors[18], 12); - __MOVE("\',\' missing", errors_errors[19], 12); - __MOVE("\':\' missing", errors_errors[20], 12); + __MOVE("'.' missing", errors_errors[18], 12); + __MOVE("',' missing", errors_errors[19], 12); + __MOVE("':' missing", errors_errors[20], 12); errors_errors[21][0] = 0x00; - __MOVE("\')\' missing", errors_errors[22], 12); - __MOVE("\']\' missing", errors_errors[23], 12); - __MOVE("\'}\' missing", errors_errors[24], 12); + __MOVE("')' missing", errors_errors[22], 12); + __MOVE("']' missing", errors_errors[23], 12); + __MOVE("'}' missing", errors_errors[24], 12); __MOVE("OF missing", errors_errors[25], 11); __MOVE("THEN missing", errors_errors[26], 13); __MOVE("DO missing", errors_errors[27], 11); __MOVE("TO missing", errors_errors[28], 11); errors_errors[29][0] = 0x00; - __MOVE("\'(\' missing", errors_errors[30], 12); + __MOVE("'(' missing", errors_errors[30], 12); errors_errors[31][0] = 0x00; errors_errors[32][0] = 0x00; errors_errors[33][0] = 0x00; - __MOVE("\':=\' missing", errors_errors[34], 13); - __MOVE("\',\' or OF expected", errors_errors[35], 19); + __MOVE("':=' missing", errors_errors[34], 13); + __MOVE("',' or OF expected", errors_errors[35], 19); errors_errors[36][0] = 0x00; errors_errors[37][0] = 0x00; __MOVE("identifier expected", errors_errors[38], 20); - __MOVE("\';\' missing", errors_errors[39], 12); + __MOVE("';' missing", errors_errors[39], 12); errors_errors[40][0] = 0x00; __MOVE("END missing", errors_errors[41], 12); errors_errors[42][0] = 0x00; @@ -131,10 +131,10 @@ export void *errors__init(void) __MOVE("operand is not a variable", errors_errors[112], 26); __MOVE("incompatible assignment", errors_errors[113], 24); __MOVE("string too long to be assigned", errors_errors[114], 31); - __MOVE("parameter doesn\'t match", errors_errors[115], 24); - __MOVE("number of parameters doesn\'t match", errors_errors[116], 35); - __MOVE("result type doesn\'t match", errors_errors[117], 26); - __MOVE("export mark doesn\'t match with forward declaration", errors_errors[118], 51); + __MOVE("parameter doesn't match", errors_errors[115], 24); + __MOVE("number of parameters doesn't match", errors_errors[116], 35); + __MOVE("result type doesn't match", errors_errors[117], 26); + __MOVE("export mark doesn't match with forward declaration", errors_errors[118], 51); __MOVE("redefinition textually precedes procedure bound to base type", errors_errors[119], 61); __MOVE("type of expression following IF, WHILE, UNTIL or ASSERT is not BOOLEAN", errors_errors[120], 71); __MOVE("called object is not a procedure (or is an interrupt procedure)", errors_errors[121], 64); @@ -194,5 +194,6 @@ export void *errors__init(void) __MOVE("implicit type cast", errors_errors[301], 19); __MOVE("inappropriate symbol file ignored", errors_errors[306], 34); __MOVE("no ELSE symbol after CASE statement sequence may lead to trap", errors_errors[307], 62); + __MOVE("SYSTEM.VAL result includes memory past end of source variable", errors_errors[308], 62); __ENDMOD; } diff --git a/bootstrap/unix-48/errors.h b/bootstrap/unix-48/errors.h index 5068083b..41d399ad 100644 --- a/bootstrap/unix-48/errors.h +++ b/bootstrap/unix-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index 03bd540b..4efd107a 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index 695ea164..fc4f0da1 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/vt100.c b/bootstrap/unix-48/vt100.c index c499aceb..d77b0b84 100644 --- a/bootstrap/unix-48/vt100.c +++ b/bootstrap/unix-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Strings.h" @@ -252,7 +252,7 @@ export void *vt100__init(void) __REGCMD("RCP", vt100_RCP); __REGCMD("SCP", vt100_SCP); /* BEGIN */ - __COPY("", vt100_CSI, ((LONGINT)(5))); + __COPY("\033", vt100_CSI, ((LONGINT)(5))); Strings_Append((CHAR*)"[", (LONGINT)2, (void*)vt100_CSI, ((LONGINT)(5))); __ENDMOD; } diff --git a/bootstrap/unix-48/vt100.h b/bootstrap/unix-48/vt100.h index 1aaeca77..4af04d6e 100644 --- a/bootstrap/unix-48/vt100.h +++ b/bootstrap/unix-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index 951bea6e..47f1ffc7 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -14,6 +14,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/08/24] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/08/23] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index 15594379..ba0bbd99 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Console.c b/bootstrap/unix-88/Console.c index 29555980..b39e6cf3 100644 --- a/bootstrap/unix-88/Console.c +++ b/bootstrap/unix-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Platform.h" @@ -22,7 +22,7 @@ export void Console_String (CHAR *s, LONGINT s__len); void Console_Flush (void) { INTEGER error; - error = Platform_Write(((LONGINT)(1)), (LONGINT)(uintptr_t)Console_line, Console_pos); + error = Platform_Write(((LONGINT)(1)), (LONGINT)(SYSTEM_ADDRESS)Console_line, Console_pos); Console_pos = 0; } diff --git a/bootstrap/unix-88/Console.h b/bootstrap/unix-88/Console.h index 11152de0..4606384c 100644 --- a/bootstrap/unix-88/Console.h +++ b/bootstrap/unix-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index be91d89c..1b144711 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -258,7 +258,7 @@ static void Files_Flush (Files_Buffer buf) if (buf->org != f->pos) { error = Platform_Seek(f->fd, buf->org, Platform_SeekSet); } - error = Platform_Write(f->fd, (LONGINT)(uintptr_t)buf->data, buf->size); + error = Platform_Write(f->fd, (LONGINT)(SYSTEM_ADDRESS)buf->data, buf->size); if (error != 0) { Files_Err((CHAR*)"error writing file", (LONGINT)19, f, error); } @@ -657,7 +657,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x } else { min = n; } - __MOVE((LONGINT)(uintptr_t)buf->data + offset, (LONGINT)(uintptr_t)x + xpos, min); + __MOVE((LONGINT)(SYSTEM_ADDRESS)buf->data + offset, (LONGINT)(SYSTEM_ADDRESS)x + xpos, min); offset += min; (*r).offset = offset; xpos += min; @@ -722,7 +722,7 @@ void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT } else { min = n; } - __MOVE((LONGINT)(uintptr_t)x + xpos, (LONGINT)(uintptr_t)buf->data + offset, min); + __MOVE((LONGINT)(SYSTEM_ADDRESS)x + xpos, (LONGINT)(SYSTEM_ADDRESS)buf->data + offset, min); offset += min; (*r).offset = offset; if (offset > buf->size) { @@ -773,15 +773,15 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT *res = 3; return; } - error = Platform_Read(fdold, (LONGINT)(uintptr_t)buf, ((LONGINT)(4096)), &n); + error = Platform_Read(fdold, (LONGINT)(SYSTEM_ADDRESS)buf, ((LONGINT)(4096)), &n); while (n > 0) { - error = Platform_Write(fdnew, (LONGINT)(uintptr_t)buf, n); + error = Platform_Write(fdnew, (LONGINT)(SYSTEM_ADDRESS)buf, n); if (error != 0) { ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); Files_Err((CHAR*)"cannot move file", (LONGINT)17, NIL, error); } - error = Platform_Read(fdold, (LONGINT)(uintptr_t)buf, ((LONGINT)(4096)), &n); + error = Platform_Read(fdold, (LONGINT)(SYSTEM_ADDRESS)buf, ((LONGINT)(4096)), &n); } ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); @@ -839,7 +839,7 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *de j += 1; } } else { - __MOVE((LONGINT)(uintptr_t)src, (LONGINT)(uintptr_t)dest, src__len); + __MOVE((LONGINT)(SYSTEM_ADDRESS)src, (LONGINT)(SYSTEM_ADDRESS)dest, src__len); } } @@ -865,8 +865,10 @@ void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, LONGINT *x) void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x) { CHAR b[4]; + LONGINT l; Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); - *x = (SET)((((int)b[0] + __ASHL((int)b[1], 8)) + __ASHL((int)b[2], 16)) + __ASHL((int)b[3], 24)); + l = (((int)b[0] + __ASHL((int)b[1], 8)) + __ASHL((int)b[2], 16)) + __ASHL((int)b[3], 24); + *x = (SET)l; } void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x) @@ -922,11 +924,11 @@ void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, LONGINT *x) n = 0; Files_Read(&*R, R__typ, (void*)&ch); while ((int)ch >= 128) { - n += __ASH((LONGINT)((int)ch - 128), s); + n += __ASH((SYSTEM_INT64)((int)ch - 128), s); s += 7; Files_Read(&*R, R__typ, (void*)&ch); } - n += __ASH((LONGINT)(__MASK((int)ch, -64) - __ASHL(__ASHR((int)ch, 6), 6)), s); + n += __ASH((SYSTEM_INT64)(__MASK((int)ch, -64) - __ASHL(__ASHR((int)ch, 6), 6)), s); *x = n; } @@ -1007,7 +1009,7 @@ static void Files_Finalize (SYSTEM_PTR o) { Files_File f = NIL; LONGINT res; - f = (Files_File)(uintptr_t)o; + f = (Files_File)(SYSTEM_ADDRESS)o; if (f->fd >= 0) { Files_CloseOSFile(f); if (f->tempFile) { diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 6dcba157..62487a35 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index 69ba4ffb..9873a734 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tskSfF */ #define LARGE #include "SYSTEM.h" @@ -102,7 +102,7 @@ export void Heap_Unlock (void); extern void *Heap__init(); extern LONGINT Platform_MainStackFrame; extern LONGINT Platform_OSAllocate(LONGINT size); -#define Heap_FetchAddress(pointer) (LONGINT)(uintptr_t)(*((void**)((uintptr_t)pointer))) +#define Heap_FetchAddress(pointer) (LONGINT)(SYSTEM_ADDRESS)(*((void**)((SYSTEM_ADDRESS)pointer))) #define Heap_HeapModuleInit() Heap__init() #define Heap_OSAllocate(size) Platform_OSAllocate(size) #define Heap_PlatformHalt(code) Platform_Halt(code) @@ -135,7 +135,7 @@ SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) __COPY(name, m->name, ((LONGINT)(20))); m->refcnt = 0; m->enumPtrs = enumPtrs; - m->next = (Heap_Module)(uintptr_t)Heap_modules; + m->next = (Heap_Module)(SYSTEM_ADDRESS)Heap_modules; Heap_modules = (SYSTEM_PTR)m; _o_result = (void*)m; return _o_result; @@ -316,7 +316,7 @@ SYSTEM_PTR Heap_NEWREC (LONGINT tag) __PUT(adr + 16, 0, LONGINT); Heap_allocated += blksz; Heap_Unlock(); - _o_result = (SYSTEM_PTR)(uintptr_t)(adr + 8); + _o_result = (SYSTEM_PTR)(SYSTEM_ADDRESS)(adr + 8); return _o_result; } @@ -327,12 +327,12 @@ SYSTEM_PTR Heap_NEWBLK (LONGINT size) SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 63, 5), 5); - new = Heap_NEWREC((LONGINT)(uintptr_t)&blksz); - tag = ((LONGINT)(uintptr_t)new + blksz) - 24; + new = Heap_NEWREC((LONGINT)(SYSTEM_ADDRESS)&blksz); + tag = ((LONGINT)(SYSTEM_ADDRESS)new + blksz) - 24; __PUT(tag - 8, 0, LONGINT); __PUT(tag, blksz, LONGINT); __PUT(tag + 8, -8, LONGINT); - __PUT((LONGINT)(uintptr_t)new - 8, tag, LONGINT); + __PUT((LONGINT)(SYSTEM_ADDRESS)new - 8, tag, LONGINT); Heap_Unlock(); _o_result = new; return _o_result; @@ -361,7 +361,7 @@ static void Heap_Mark (LONGINT q) __GET(tag, offset, LONGINT); fld = q + offset; p = Heap_FetchAddress(fld); - __PUT(fld, (SYSTEM_PTR)(uintptr_t)n, SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADDRESS)n, SYSTEM_PTR); } else { fld = q + offset; n = Heap_FetchAddress(fld); @@ -370,7 +370,7 @@ static void Heap_Mark (LONGINT q) if (!__ODD(tagbits)) { __PUT(n - 8, tagbits + 1, LONGINT); __PUT(q - 8, tag + 1, LONGINT); - __PUT(fld, (SYSTEM_PTR)(uintptr_t)p, SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADDRESS)p, SYSTEM_PTR); p = q; q = n; tag = tagbits; @@ -385,7 +385,7 @@ static void Heap_Mark (LONGINT q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((LONGINT)(uintptr_t)p); + Heap_Mark((LONGINT)(SYSTEM_ADDRESS)p); } static void Heap_Scan (void) @@ -554,7 +554,7 @@ static void Heap_Finalize (void) } else { prev->next = n->next; } - (*n->finalize)((SYSTEM_PTR)(uintptr_t)n->obj); + (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADDRESS)n->obj); if (prev == NIL) { n = Heap_fin; } else { @@ -573,7 +573,7 @@ void Heap_FINALL (void) while (Heap_fin != NIL) { n = Heap_fin; Heap_fin = Heap_fin->next; - (*n->finalize)((SYSTEM_PTR)(uintptr_t)n->obj); + (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADDRESS)n->obj); } } @@ -590,9 +590,9 @@ static void Heap_MarkStack (LONGINT n, LONGINT *cand, LONGINT cand__len) } if (n == 0) { nofcand = 0; - sp = (LONGINT)(uintptr_t)&frame; + sp = (LONGINT)(SYSTEM_ADDRESS)&frame; stack0 = Heap_PlatformMainStackFrame(); - inc = (LONGINT)(uintptr_t)&align.p - (LONGINT)(uintptr_t)&align; + inc = (LONGINT)(SYSTEM_ADDRESS)&align.p - (LONGINT)(SYSTEM_ADDRESS)&align; if (sp > stack0) { inc = -inc; } @@ -623,7 +623,7 @@ void Heap_GC (BOOLEAN markStack) LONGINT cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); - m = (Heap_Module)(uintptr_t)Heap_modules; + m = (Heap_Module)(SYSTEM_ADDRESS)Heap_modules; while (m != NIL) { if (m->enumPtrs != NIL) { (*m->enumPtrs)(Heap_MarkP); @@ -700,7 +700,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (LONGINT)(uintptr_t)obj; + f->obj = (LONGINT)(SYSTEM_ADDRESS)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index 40db2aca..b1ff5968 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index eaf370c4..0c836ead 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index d273cf1a..6e6ded2e 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index 2fccfe61..f4bdb1a8 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" @@ -35,7 +35,9 @@ export void OPB_In (OPT_Node *x, OPT_Node y); export void OPB_Index (OPT_Node *x, OPT_Node y); export void OPB_Inittd (OPT_Node *inittd, OPT_Node *last, OPT_Struct typ); static BOOLEAN OPB_IntToBool (LONGINT i); +static OPT_Struct OPB_IntType (LONGINT size); export void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y); +static LONGINT OPB_LongerSize (LONGINT i); export void OPB_MOp (SHORTINT op, OPT_Node *x); export OPT_Node OPB_NewBoolConst (BOOLEAN boolval); export OPT_Node OPB_NewIntConst (LONGINT intval); @@ -52,6 +54,8 @@ export void OPB_Return (OPT_Node *x, OPT_Object proc); export void OPB_SetElem (OPT_Node *x); static void OPB_SetIntType (OPT_Node node); export void OPB_SetRange (OPT_Node *x, OPT_Node y); +static LONGINT OPB_ShorterSize (LONGINT i); +static INTEGER OPB_SignedByteSize (LONGINT n); export void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno); export void OPB_StPar0 (OPT_Node *par0, INTEGER fctno); export void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno); @@ -91,8 +95,8 @@ OPT_Node OPB_NewLeaf (OPT_Object obj) node = OPT_NewNode(9); break; default: - OPB_err(127); node = OPT_NewNode(0); + OPB_err(127); break; } node->obj = obj; @@ -221,21 +225,68 @@ OPT_Node OPB_EmptySet (void) return _o_result; } +static INTEGER OPB_SignedByteSize (LONGINT n) +{ + INTEGER _o_result; + INTEGER b; + if (n < 0) { + n = -(n + 1); + } + b = 1; + while ((b < 8 && __ASH(n, -(__ASHL(b, 3) - 1)) != 0)) { + b += 1; + } + _o_result = b; + return _o_result; +} + +static LONGINT OPB_ShorterSize (LONGINT i) +{ + LONGINT _o_result; + if (i >= (SYSTEM_INT64)OPM_LIntSize) { + _o_result = OPM_IntSize; + return _o_result; + } else { + _o_result = OPM_SIntSize; + return _o_result; + } + __RETCHK; +} + +static LONGINT OPB_LongerSize (LONGINT i) +{ + LONGINT _o_result; + if (i <= (SYSTEM_INT64)OPM_SIntSize) { + _o_result = OPM_IntSize; + return _o_result; + } else { + _o_result = OPM_LIntSize; + return _o_result; + } + __RETCHK; +} + +static OPT_Struct OPB_IntType (LONGINT size) +{ + OPT_Struct _o_result; + OPT_Struct result = NIL; + if (size <= OPT_sinttyp->size) { + result = OPT_sinttyp; + } else if (size <= OPT_inttyp->size) { + result = OPT_inttyp; + } else { + result = OPT_linttyp; + } + if (size > OPT_linttyp->size) { + OPB_err(203); + } + _o_result = result; + return _o_result; +} + static void OPB_SetIntType (OPT_Node node) { - LONGINT v; - v = node->conval->intval; - if ((OPM_MinSInt <= (LONGINT)v && (LONGINT)v <= OPM_MaxSInt)) { - node->typ = OPT_sinttyp; - } else if ((OPM_MinInt <= (LONGINT)v && (LONGINT)v <= OPM_MaxInt)) { - node->typ = OPT_inttyp; - } else if ((OPM_MinLInt <= v && v <= OPM_MaxLInt)) { - node->typ = OPT_linttyp; - } else { - OPB_err(203); - node->typ = OPT_sinttyp; - node->conval->intval = 1; - } + node->typ = OPB_IntType(OPB_SignedByteSize(node->conval->intval)); } OPT_Node OPB_NewIntConst (LONGINT intval) @@ -379,16 +430,16 @@ void OPB_Field (OPT_Node *x, OPT_Object y) } } -static struct TypTest__57 { +static struct TypTest__61 { OPT_Node *x; OPT_Object *obj; BOOLEAN *guard; - struct TypTest__57 *lnk; -} *TypTest__57_s; + struct TypTest__61 *lnk; +} *TypTest__61_s; -static void GTT__58 (OPT_Struct t0, OPT_Struct t1); +static void GTT__62 (OPT_Struct t0, OPT_Struct t1); -static void GTT__58 (OPT_Struct t0, OPT_Struct t1) +static void GTT__62 (OPT_Struct t0, OPT_Struct t1) { OPT_Node node = NIL; OPT_Struct t = NIL; @@ -401,54 +452,54 @@ static void GTT__58 (OPT_Struct t0, OPT_Struct t1) t1 = t1->BaseTyp; } if (t1 == t0 || t0->form == 0) { - if (*TypTest__57_s->guard) { - OPB_BindNodes(5, NIL, &*TypTest__57_s->x, NIL); - (*TypTest__57_s->x)->readonly = (*TypTest__57_s->x)->left->readonly; + if (*TypTest__61_s->guard) { + OPB_BindNodes(5, NIL, &*TypTest__61_s->x, NIL); + (*TypTest__61_s->x)->readonly = (*TypTest__61_s->x)->left->readonly; } else { node = OPT_NewNode(11); node->subcl = 16; - node->left = *TypTest__57_s->x; - node->obj = *TypTest__57_s->obj; - *TypTest__57_s->x = node; + node->left = *TypTest__61_s->x; + node->obj = *TypTest__61_s->obj; + *TypTest__61_s->x = node; } } else { OPB_err(85); } } else if (t0 != t1) { OPB_err(85); - } else if (!*TypTest__57_s->guard) { - if ((*TypTest__57_s->x)->class == 5) { + } else if (!*TypTest__61_s->guard) { + if ((*TypTest__61_s->x)->class == 5) { node = OPT_NewNode(11); node->subcl = 16; - node->left = *TypTest__57_s->x; - node->obj = *TypTest__57_s->obj; - *TypTest__57_s->x = node; + node->left = *TypTest__61_s->x; + node->obj = *TypTest__61_s->obj; + *TypTest__61_s->x = node; } else { - *TypTest__57_s->x = OPB_NewBoolConst(1); + *TypTest__61_s->x = OPB_NewBoolConst(1); } } } void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) { - struct TypTest__57 _s; + struct TypTest__61 _s; _s.x = x; _s.obj = &obj; _s.guard = &guard; - _s.lnk = TypTest__57_s; - TypTest__57_s = &_s; + _s.lnk = TypTest__61_s; + TypTest__61_s = &_s; if (OPB_NotVar(*x)) { OPB_err(112); } else if ((*x)->typ->form == 13) { if (((*x)->typ->BaseTyp->comp != 4 && (*x)->typ != OPT_sysptrtyp)) { OPB_err(85); } else if (obj->typ->form == 13) { - GTT__58((*x)->typ->BaseTyp, obj->typ->BaseTyp); + GTT__62((*x)->typ->BaseTyp, obj->typ->BaseTyp); } else { OPB_err(86); } } else if (((((*x)->typ->comp == 4 && (*x)->class == 1)) && obj->typ->comp == 4)) { - GTT__58((*x)->typ, obj->typ); + GTT__62((*x)->typ, obj->typ); } else { OPB_err(87); } @@ -457,7 +508,7 @@ void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) } else { (*x)->typ = OPT_booltyp; } - TypTest__57_s = _s.lnk; + TypTest__61_s = _s.lnk; } void OPB_In (OPT_Node *x, OPT_Node y) @@ -470,7 +521,7 @@ void OPB_In (OPT_Node *x, OPT_Node y) } else if ((__IN(f, 0x70) && y->typ->form == 9)) { if ((*x)->class == 7) { k = (*x)->conval->intval; - if (k < 0 || k > (LONGINT)OPM_MaxSet) { + if (k < 0 || k > (SYSTEM_INT64)OPM_MaxSet) { OPB_err(202); } else if (y->class == 7) { (*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval)); @@ -523,13 +574,13 @@ static void OPB_CheckRealType (INTEGER f, INTEGER nr, OPT_Const x) x->intval = -1; } -static struct MOp__28 { - struct MOp__28 *lnk; -} *MOp__28_s; +static struct MOp__30 { + struct MOp__30 *lnk; +} *MOp__30_s; -static OPT_Node NewOp__29 (SHORTINT op, OPT_Struct typ, OPT_Node z); +static OPT_Node NewOp__31 (SHORTINT op, OPT_Struct typ, OPT_Node z); -static OPT_Node NewOp__29 (SHORTINT op, OPT_Struct typ, OPT_Node z) +static OPT_Node NewOp__31 (SHORTINT op, OPT_Struct typ, OPT_Node z) { OPT_Node _o_result; OPT_Node node = NIL; @@ -546,9 +597,9 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) INTEGER f; OPT_Struct typ = NIL; OPT_Node z = NIL; - struct MOp__28 _s; - _s.lnk = MOp__28_s; - MOp__28_s = &_s; + struct MOp__30 _s; + _s.lnk = MOp__30_s; + MOp__30_s = &_s; z = *x; if (z->class == 8 || z->class == 9) { OPB_err(126); @@ -562,7 +613,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->conval->intval = OPB_BoolToInt(!OPB_IntToBool(z->conval->intval)); z->obj = NIL; } else { - z = NewOp__29(op, typ, z); + z = NewOp__31(op, typ, z); } } else { OPB_err(98); @@ -590,7 +641,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } z->obj = NIL; } else { - z = NewOp__29(op, typ, z); + z = NewOp__31(op, typ, z); } } else { OPB_err(97); @@ -611,7 +662,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } z->obj = NIL; } else { - z = NewOp__29(op, typ, z); + z = NewOp__31(op, typ, z); } } else { OPB_err(111); @@ -623,7 +674,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->conval->intval = (int)__CAP((CHAR)z->conval->intval); z->obj = NIL; } else { - z = NewOp__29(op, typ, z); + z = NewOp__31(op, typ, z); } } else { OPB_err(111); @@ -636,7 +687,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->conval->intval = OPB_BoolToInt(__ODD(z->conval->intval)); z->obj = NIL; } else { - z = NewOp__29(op, typ, z); + z = NewOp__31(op, typ, z); } } else { OPB_err(111); @@ -649,7 +700,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) f = 10; } if (z->class < 7 || f == 10) { - z = NewOp__29(op, typ, z); + z = NewOp__31(op, typ, z); } else { OPB_err(127); } @@ -658,7 +709,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) case 25: if ((__IN(f, 0x70) && z->class == 7)) { if ((0 <= z->conval->intval && z->conval->intval <= -1)) { - z = NewOp__29(op, typ, z); + z = NewOp__31(op, typ, z); } else { OPB_err(219); } @@ -675,7 +726,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } } *x = z; - MOp__28_s = _s.lnk; + MOp__30_s = _s.lnk; } static void OPB_CheckPtr (OPT_Node x, OPT_Node y) @@ -866,41 +917,13 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) __GUARDEQP(yval, OPT_ConstDesc) = *xval; } break; - case 4: + case 4: case 5: case 6: if (__IN(g, 0x70)) { - x->typ = y->typ; - } else if (g == 7) { - x->typ = OPT_realtyp; - xval->realval = xval->intval; - } else if (g == 8) { - x->typ = OPT_lrltyp; - xval->realval = xval->intval; - } else { - OPB_err(100); - y->typ = x->typ; - __GUARDEQP(yval, OPT_ConstDesc) = *xval; - } - break; - case 5: - if (g == 4) { - y->typ = OPT_inttyp; - } else if (__IN(g, 0x70)) { - x->typ = y->typ; - } else if (g == 7) { - x->typ = OPT_realtyp; - xval->realval = xval->intval; - } else if (g == 8) { - x->typ = OPT_lrltyp; - xval->realval = xval->intval; - } else { - OPB_err(100); - y->typ = x->typ; - __GUARDEQP(yval, OPT_ConstDesc) = *xval; - } - break; - case 6: - if (__IN(g, 0x70)) { - y->typ = OPT_linttyp; + if (x->typ->size <= y->typ->size) { + x->typ = y->typ; + } else { + x->typ = OPB_IntType(x->typ->size); + } } else if (g == 7) { x->typ = OPT_realtyp; xval->realval = xval->intval; @@ -1197,15 +1220,15 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) (*x)->typ = typ; } -static struct Op__38 { +static struct Op__40 { INTEGER *f, *g; - struct Op__38 *lnk; -} *Op__38_s; + struct Op__40 *lnk; +} *Op__40_s; -static void NewOp__39 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y); -static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y); +static void NewOp__41 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y); +static BOOLEAN strings__43 (OPT_Node *x, OPT_Node *y); -static void NewOp__39 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y) +static void NewOp__41 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y) { OPT_Node node = NIL; node = OPT_NewNode(12); @@ -1216,29 +1239,29 @@ static void NewOp__39 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y) *x = node; } -static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) +static BOOLEAN strings__43 (OPT_Node *x, OPT_Node *y) { BOOLEAN _o_result; BOOLEAN ok, xCharArr, yCharArr; - xCharArr = (__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp->form == 3) || *Op__38_s->f == 10; - yCharArr = (__IN((*y)->typ->comp, 0x0c) && (*y)->typ->BaseTyp->form == 3) || *Op__38_s->g == 10; - if ((((xCharArr && *Op__38_s->g == 3)) && (*y)->class == 7)) { + xCharArr = (__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp->form == 3) || *Op__40_s->f == 10; + yCharArr = (__IN((*y)->typ->comp, 0x0c) && (*y)->typ->BaseTyp->form == 3) || *Op__40_s->g == 10; + if ((((xCharArr && *Op__40_s->g == 3)) && (*y)->class == 7)) { OPB_CharToString(*y); - *Op__38_s->g = 10; + *Op__40_s->g = 10; yCharArr = 1; } - if ((((yCharArr && *Op__38_s->f == 3)) && (*x)->class == 7)) { + if ((((yCharArr && *Op__40_s->f == 3)) && (*x)->class == 7)) { OPB_CharToString(*x); - *Op__38_s->f = 10; + *Op__40_s->f = 10; xCharArr = 1; } ok = (xCharArr && yCharArr); if (ok) { - if ((*Op__38_s->f == 10 && (*x)->conval->intval2 == 1)) { + if ((*Op__40_s->f == 10 && (*x)->conval->intval2 == 1)) { (*x)->typ = OPT_chartyp; (*x)->conval->intval = 0; OPB_Index(&*y, OPB_NewIntConst(((LONGINT)(0)))); - } else if ((*Op__38_s->g == 10 && (*y)->conval->intval2 == 1)) { + } else if ((*Op__40_s->g == 10 && (*y)->conval->intval2 == 1)) { (*y)->typ = OPT_chartyp; (*y)->conval->intval = 0; OPB_Index(&*x, OPB_NewIntConst(((LONGINT)(0)))); @@ -1255,11 +1278,11 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPT_Struct typ = NIL; BOOLEAN do_; LONGINT val; - struct Op__38 _s; + struct Op__40 _s; _s.f = &f; _s.g = &g; - _s.lnk = Op__38_s; - Op__38_s = &_s; + _s.lnk = Op__40_s; + Op__40_s = &_s; z = *x; if (((z->class == 8 || z->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); @@ -1277,15 +1300,8 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPB_err(100); } break; - case 4: - if (__IN(g, 0x01f0)) { - OPB_Convert(&z, y->typ); - } else { - OPB_err(100); - } - break; - case 5: - if (g == 4) { + case 4: case 5: case 6: + if ((__IN(g, 0x70) && y->typ->size < z->typ->size)) { OPB_Convert(&y, z->typ); } else if (__IN(g, 0x01f0)) { OPB_Convert(&z, y->typ); @@ -1293,15 +1309,6 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPB_err(100); } break; - case 6: - if (__IN(g, 0x70)) { - OPB_Convert(&y, z->typ); - } else if (__IN(g, 0x0180)) { - OPB_Convert(&z, y->typ); - } else { - OPB_err(100); - } - break; case 7: if (__IN(g, 0x70)) { OPB_Convert(&y, z->typ); @@ -1387,7 +1394,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) typ = OPT_undftyp; } if (do_) { - NewOp__39(op, typ, &z, y); + NewOp__41(op, typ, &z, y); } break; case 2: @@ -1406,7 +1413,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPB_err(102); typ = OPT_undftyp; } - NewOp__39(op, typ, &z, y); + NewOp__41(op, typ, &z, y); break; case 3: do_ = 1; @@ -1429,7 +1436,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) typ = OPT_undftyp; } if (do_) { - NewOp__39(op, typ, &z, y); + NewOp__41(op, typ, &z, y); } break; case 4: @@ -1447,7 +1454,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPB_err(104); typ = OPT_undftyp; } - NewOp__39(op, typ, &z, y); + NewOp__41(op, typ, &z, y); break; case 5: if (f == 2) { @@ -1457,7 +1464,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } } else if ((y->class == 7 && OPB_IntToBool(y->conval->intval))) { } else { - NewOp__39(op, typ, &z, y); + NewOp__41(op, typ, &z, y); } } else if (f != 0) { OPB_err(94); @@ -1480,7 +1487,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } } if (do_) { - NewOp__39(op, typ, &z, y); + NewOp__41(op, typ, &z, y); } break; case 7: @@ -1489,7 +1496,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) typ = OPT_undftyp; } if ((!__IN(f, 0x70) || y->class != 7) || y->conval->intval != 0) { - NewOp__39(op, typ, &z, y); + NewOp__41(op, typ, &z, y); } break; case 8: @@ -1500,7 +1507,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } } else if ((y->class == 7 && !OPB_IntToBool(y->conval->intval))) { } else { - NewOp__39(op, typ, &z, y); + NewOp__41(op, typ, &z, y); } } else if (f != 0) { OPB_err(95); @@ -1508,16 +1515,16 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 9: case 10: - if (__IN(f, 0x6bff) || strings__41(&z, &y)) { + if (__IN(f, 0x6bff) || strings__43(&z, &y)) { typ = OPT_booltyp; } else { OPB_err(107); typ = OPT_undftyp; } - NewOp__39(op, typ, &z, y); + NewOp__41(op, typ, &z, y); break; case 11: case 12: case 13: case 14: - if (__IN(f, 0x01f9) || strings__41(&z, &y)) { + if (__IN(f, 0x01f9) || strings__43(&z, &y)) { typ = OPT_booltyp; } else { OPM_LogWLn(); @@ -1526,7 +1533,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPB_err(108); typ = OPT_undftyp; } - NewOp__39(op, typ, &z, y); + NewOp__41(op, typ, &z, y); break; default: OPM_LogWStr((CHAR*)"unhandled case in OPB.Op, op = ", (LONGINT)32); @@ -1536,7 +1543,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } } *x = z; - Op__38_s = _s.lnk; + Op__40_s = _s.lnk; } void OPB_SetRange (OPT_Node *x, OPT_Node y) @@ -1547,13 +1554,13 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y) } else if ((__IN((*x)->typ->form, 0x70) && __IN(y->typ->form, 0x70))) { if ((*x)->class == 7) { k = (*x)->conval->intval; - if (0 > k || k > (LONGINT)OPM_MaxSet) { + if (0 > k || k > (SYSTEM_INT64)OPM_MaxSet) { OPB_err(202); } } if (y->class == 7) { l = y->conval->intval; - if (0 > l || l > (LONGINT)OPM_MaxSet) { + if (0 > l || l > (SYSTEM_INT64)OPM_MaxSet) { OPB_err(202); } } @@ -1583,7 +1590,7 @@ void OPB_SetElem (OPT_Node *x) OPB_err(93); } else if ((*x)->class == 7) { k = (*x)->conval->intval; - if ((0 <= k && k <= (LONGINT)OPM_MaxSet)) { + if ((0 <= k && k <= (SYSTEM_INT64)OPM_MaxSet)) { (*x)->conval->setval = __SETOF(k); } else { OPB_err(202); @@ -1597,8 +1604,9 @@ void OPB_SetElem (OPT_Node *x) static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) { + OPT_Struct y = NIL; INTEGER f, g; - OPT_Struct y = NIL, p = NIL, q = NIL; + OPT_Struct p = NIL, q = NIL; if (OPM_Verbose) { OPM_LogWLn(); OPM_LogWStr((CHAR*)"PROCEDURE CheckAssign", (LONGINT)22); @@ -1628,31 +1636,20 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) case 0: case 10: break; case 1: - if (!__IN(g, 0x1a)) { + if (!((__IN(g, 0x7a) && y->size == 1))) { OPB_err(113); } break; - case 2: case 3: case 4: case 9: + case 2: case 3: case 9: if (g != f) { OPB_err(113); } break; - case 5: - if (!__IN(g, 0x30)) { + case 4: case 5: case 6: + if (!__IN(g, 0x70) || x->size < y->size) { OPB_err(113); } break; - case 6: - if (OPM_LIntSize == 4) { - if (!__IN(g, 0x70)) { - OPB_err(113); - } - } else { - if (!__IN(g, 0x70)) { - OPB_err(113); - } - } - break; case 7: if (!__IN(g, 0xf0)) { OPB_err(113); @@ -1833,14 +1830,8 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) x = OPB_NewIntConst(((LONGINT)(0))); x->typ = OPT_chartyp; break; - case 4: - x = OPB_NewIntConst(OPM_MinSInt); - break; - case 5: - x = OPB_NewIntConst(OPM_MinInt); - break; - case 6: - x = OPB_NewIntConst(OPM_MinLInt); + case 4: case 5: case 6: + x = OPB_NewIntConst(OPM_SignedMinimum(x->typ->size)); break; case 9: x = OPB_NewIntConst(((LONGINT)(0))); @@ -1870,14 +1861,8 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) x = OPB_NewIntConst(((LONGINT)(255))); x->typ = OPT_chartyp; break; - case 4: - x = OPB_NewIntConst(OPM_MaxSInt); - break; - case 5: - x = OPB_NewIntConst(OPM_MaxInt); - break; - case 6: - x = OPB_NewIntConst(OPM_MaxLInt); + case 4: case 5: case 6: + x = OPB_NewIntConst(OPM_SignedMaximum(x->typ->size)); break; case 9: x = OPB_NewIntConst(OPM_MaxSet); @@ -1910,10 +1895,8 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 10: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 5) { - OPB_Convert(&x, OPT_sinttyp); - } else if (f == 6) { - OPB_Convert(&x, OPT_inttyp); + } else if ((__IN(f, 0x70) && x->typ->size > (SYSTEM_INT64)OPM_SIntSize)) { + OPB_Convert(&x, OPB_IntType(OPB_ShorterSize(x->typ->size))); } else if (f == 8) { OPB_Convert(&x, OPT_realtyp); } else { @@ -1923,10 +1906,8 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 11: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 4) { - OPB_Convert(&x, OPT_inttyp); - } else if (f == 5) { - OPB_Convert(&x, OPT_linttyp); + } else if ((__IN(f, 0x70) && x->typ->size < (SYSTEM_INT64)OPM_LIntSize)) { + OPB_Convert(&x, OPB_IntType(OPB_LongerSize(x->typ->size))); } else if (f == 7) { OPB_Convert(&x, OPT_lrltyp); } else if (f == 3) { @@ -1974,7 +1955,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (__IN(f, 0x70)) { - if (f != 6) { + if (x->typ->size != (SYSTEM_INT64)OPM_LIntSize) { OPB_Convert(&x, OPT_linttyp); } } else { @@ -2012,9 +1993,9 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 24: case 25: case 28: case 31: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((x->class == 7 && __IN(f, 0x30))) { + } else if ((((x->class == 7 && __IN(f, 0x70))) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!__IN(f, 0x2040)) { + } else if (!((__IN(x->typ->form, 0x2070) && x->typ->size == (SYSTEM_INT64)OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } @@ -2063,13 +2044,13 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) *par0 = x; } -static struct StPar1__52 { - struct StPar1__52 *lnk; -} *StPar1__52_s; +static struct StPar1__56 { + struct StPar1__56 *lnk; +} *StPar1__56_s; -static OPT_Node NewOp__53 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right); +static OPT_Node NewOp__57 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right); -static OPT_Node NewOp__53 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right) +static OPT_Node NewOp__57 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right) { OPT_Node _o_result; OPT_Node node = NIL; @@ -2086,9 +2067,9 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) INTEGER f, L; OPT_Struct typ = NIL; OPT_Node p = NIL, t = NIL; - struct StPar1__52 _s; - _s.lnk = StPar1__52_s; - StPar1__52_s = &_s; + struct StPar1__56 _s; + _s.lnk = StPar1__56_s; + StPar1__56_s = &_s; p = *par0; f = x->typ->form; switch (fctno) { @@ -2104,7 +2085,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) OPB_err(111); } } - p = NewOp__53(19, fctno, p, x); + p = NewOp__57(19, fctno, p, x); p->typ = OPT_notyp; } break; @@ -2112,10 +2093,10 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (__IN(f, 0x70)) { - if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > (LONGINT)OPM_MaxSet))) { + if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > (SYSTEM_INT64)OPM_MaxSet))) { OPB_err(202); } - p = NewOp__53(19, fctno, p, x); + p = NewOp__57(19, fctno, p, x); } else { OPB_err(111); } @@ -2124,7 +2105,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 17: if (!__IN(f, 0x70) || x->class != 7) { OPB_err(69); - } else if (f == 4) { + } else if (x->typ->size == 1) { L = (int)x->conval->intval; typ = p->typ; while ((L > 0 && __IN(typ->comp, 0x0c))) { @@ -2140,7 +2121,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) p = p->left; x->conval->intval += 1; } - p = NewOp__53(12, 19, p, x); + p = NewOp__57(12, 19, p, x); p->typ = OPT_linttyp; } else { p = x; @@ -2162,7 +2143,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) t = x; x = p; p = t; - p = NewOp__53(19, 18, p, x); + p = NewOp__57(19, 18, p, x); } else { OPB_err(111); } @@ -2188,7 +2169,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) } p->obj = NIL; } else { - p = NewOp__53(12, 17, p, x); + p = NewOp__57(12, 17, p, x); p->typ = OPT_linttyp; } } else { @@ -2219,9 +2200,9 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) OPB_err(111); } else { if (fctno == 22) { - p = NewOp__53(12, 27, p, x); + p = NewOp__57(12, 27, p, x); } else { - p = NewOp__53(12, 28, p, x); + p = NewOp__57(12, 28, p, x); } p->typ = p->left->typ; } @@ -2238,7 +2219,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) x = p; p = t; } - p = NewOp__53(19, fctno, p, x); + p = NewOp__57(19, fctno, p, x); } else { OPB_err(111); } @@ -2248,7 +2229,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (__IN(f, 0x70)) { - p = NewOp__53(12, 26, p, x); + p = NewOp__57(12, 26, p, x); } else { OPB_err(111); } @@ -2258,6 +2239,9 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (((x->class == 8 || x->class == 9) || __IN(f, 0x1401)) || x->typ->comp == 3) { OPB_err(126); } + if (x->typ->size < p->typ->size) { + OPB_err(-308); + } t = OPT_NewNode(11); t->subcl = 29; t->left = x; @@ -2269,7 +2253,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (__IN(f, 0x70)) { - p = NewOp__53(19, 30, p, x); + p = NewOp__57(19, 30, p, x); } else { OPB_err(111); } @@ -2278,9 +2262,9 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 31: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((x->class == 7 && __IN(f, 0x30))) { + } else if ((((x->class == 7 && __IN(f, 0x70))) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!__IN(f, 0x2040)) { + } else if (!((__IN(x->typ->form, 0x2070) && x->typ->size == (SYSTEM_INT64)OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } @@ -2315,7 +2299,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) break; } *par0 = p; - StPar1__52_s = _s.lnk; + StPar1__56_s = _s.lnk; } void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n) @@ -2434,7 +2418,7 @@ static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpa ftyp = ftyp->BaseTyp; atyp = atyp->BaseTyp; if ((fvarpar && ftyp == OPT_bytetyp)) { - if (!__IN(f, 0x0c) || !__IN(atyp->form, 0x1e)) { + if (!__IN(f, 0x0c) || !((__IN(atyp->form, 0x7e) && atyp->size == 1))) { if (__IN(18, OPM_opt)) { OPB_err(-301); } @@ -2517,7 +2501,7 @@ void OPB_Param (OPT_Node ap, OPT_Object fp) OPB_err(111); } } else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 13)) { - } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && __IN(ap->typ->form, 0x18))))) { + } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x7e) && ap->typ->size == 1)))))) { OPB_err(123); } else if ((fp->typ->form == 13 && ap->class == 5)) { OPB_err(123); diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index 48c946c5..af419f75 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index 40697da9..bb9b75e6 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -17,12 +17,13 @@ static CHAR OPC_BodyNameExt[13]; export void OPC_Align (LONGINT *adr, LONGINT base); export void OPC_Andent (OPT_Struct typ); static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames); -export LONGINT OPC_Base (OPT_Struct typ); +export LONGINT OPC_BaseAlignment (OPT_Struct typ); export OPT_Object OPC_BaseTProc (OPT_Object obj); export void OPC_BegBlk (void); export void OPC_BegStat (void); static void OPC_CProcDefs (OPT_Object obj, INTEGER vis); export void OPC_Case (LONGINT caseVal, INTEGER form); +static void OPC_CharacterLiteral (LONGINT c); export void OPC_Cmp (INTEGER rel); export void OPC_CompleteIdent (OPT_Object obj); export void OPC_Constant (OPT_Const con, INTEGER form); @@ -74,8 +75,10 @@ static void OPC_PutBase (OPT_Struct typ); static void OPC_PutPtrOffsets (OPT_Struct typ, LONGINT adr, LONGINT *cnt); static void OPC_RegCmds (OPT_Object obj); export void OPC_SetInclude (BOOLEAN exclude); +export LONGINT OPC_SizeAlignment (LONGINT size); static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause); static void OPC_Str1 (CHAR *s, LONGINT s__len, LONGINT x); +static void OPC_StringLiteral (CHAR *s, LONGINT s__len, LONGINT l); export void OPC_TDescDecl (OPT_Struct typ); export void OPC_TypeDefs (OPT_Object obj, INTEGER vis); export void OPC_TypeOf (OPT_Object ap); @@ -316,7 +319,7 @@ void OPC_Andent (OPT_Struct typ) static BOOLEAN OPC_Undefined (OPT_Object obj) { BOOLEAN _o_result; - _o_result = (((obj->mnolev >= 0 && obj->linkadr != (LONGINT)(3 + OPM_currFile))) && obj->linkadr != 2) || obj->name[0] == 0x00; + _o_result = obj->name[0] == 0x00 || (((obj->mnolev >= 0 && obj->linkadr != (SYSTEM_INT64)(3 + OPM_currFile))) && obj->linkadr != 2); return _o_result; } @@ -816,14 +819,15 @@ void OPC_TDescDecl (OPT_Struct typ) OPC_Andent(typ); OPC_Str1((CHAR*)", #", (LONGINT)4, typ->n + 1); OPC_Str1((CHAR*)", #) = {__TDFLDS(", (LONGINT)18, OPC_NofPtrs(typ)); - OPM_Write('\"'); + OPM_Write('"'); if (typ->strobj != NIL) { OPM_WriteStringVar((void*)typ->strobj->name, ((LONGINT)(256))); } - OPC_Str1((CHAR*)"\", #), {", (LONGINT)9, typ->size); + OPM_Write('"'); + OPC_Str1((CHAR*)", #), {", (LONGINT)8, typ->size); nofptrs = 0; OPC_PutPtrOffsets(typ, ((LONGINT)(0)), &nofptrs); - OPC_Str1((CHAR*)"#}}", (LONGINT)4, -((nofptrs + 1) * (LONGINT)OPM_LIntSize)); + OPC_Str1((CHAR*)"#}}", (LONGINT)4, -((nofptrs + 1) * (SYSTEM_INT64)OPM_LIntSize)); OPC_EndStat(); } @@ -865,70 +869,37 @@ void OPC_Align (LONGINT *adr, LONGINT base) } } -LONGINT OPC_Base (OPT_Struct typ) +LONGINT OPC_SizeAlignment (LONGINT size) { LONGINT _o_result; - switch (typ->form) { - case 1: - _o_result = 1; - return _o_result; - break; - case 3: - _o_result = OPM_CharAlign; - return _o_result; - break; - case 2: - _o_result = OPM_BoolAlign; - return _o_result; - break; - case 4: - _o_result = OPM_SIntAlign; - return _o_result; - break; - case 5: - _o_result = OPM_IntAlign; - return _o_result; - break; - case 6: - _o_result = OPM_LIntAlign; - return _o_result; - break; - case 7: - _o_result = OPM_RealAlign; - return _o_result; - break; - case 8: - _o_result = OPM_LRealAlign; - return _o_result; - break; - case 9: - _o_result = OPM_SetAlign; - return _o_result; - break; - case 13: - _o_result = OPM_PointerAlign; - return _o_result; - break; - case 14: - _o_result = OPM_ProcAlign; - return _o_result; - break; - case 15: - if (typ->comp == 4) { - _o_result = __MASK(typ->align, -65536); - return _o_result; - } else { - _o_result = OPC_Base(typ->BaseTyp); - return _o_result; - } - break; - default: - OPM_LogWStr((CHAR*)"unhandled case in OPC.Base, typ^form = ", (LONGINT)40); - OPM_LogWNum(typ->form, ((LONGINT)(0))); - OPM_LogWLn(); - break; + LONGINT alignment; + if (size < (SYSTEM_INT64)OPM_Alignment) { + alignment = 1; + while (alignment < size) { + alignment = __ASHL(alignment, 1); + } + } else { + alignment = OPM_Alignment; } - __RETCHK; + _o_result = alignment; + return _o_result; +} + +LONGINT OPC_BaseAlignment (OPT_Struct typ) +{ + LONGINT _o_result; + LONGINT alignment; + if (typ->form == 15) { + if (typ->comp == 4) { + alignment = __MASK(typ->align, -65536); + } else { + alignment = OPC_BaseAlignment(typ->BaseTyp); + } + } else { + alignment = OPC_SizeAlignment(typ->size); + } + _o_result = alignment; + return _o_result; } static void OPC_FillGap (LONGINT gap, LONGINT off, LONGINT align, LONGINT *n, LONGINT *curAlign) @@ -939,11 +910,11 @@ static void OPC_FillGap (LONGINT gap, LONGINT off, LONGINT align, LONGINT *n, LO if ((*curAlign < align && gap - (adr - off) >= align)) { gap -= (adr - off) + align; OPC_BegStat(); - if (align == (LONGINT)OPM_IntSize) { + if (align == (SYSTEM_INT64)OPM_IntSize) { OPM_WriteString((CHAR*)"INTEGER", (LONGINT)8); - } else if (align == (LONGINT)OPM_LIntSize) { + } else if (align == (SYSTEM_INT64)OPM_LIntSize) { OPM_WriteString((CHAR*)"LONGINT", (LONGINT)8); - } else if (align == (LONGINT)OPM_LRealSize) { + } else if (align == (SYSTEM_INT64)OPM_LRealSize) { OPM_WriteString((CHAR*)"LONGREAL", (LONGINT)9); } OPC_Str1((CHAR*)" _prvt#", (LONGINT)8, *n); @@ -982,7 +953,7 @@ static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, LONGINT *off, LONGINT * } } else { adr = *off; - fldAlign = OPC_Base(fld->typ); + fldAlign = OPC_BaseAlignment(fld->typ); OPC_Align(&adr, fldAlign); gap = fld->adr - adr; if (fldAlign > *curAlign) { @@ -1008,7 +979,7 @@ static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, LONGINT *off, LONGINT * } } if (last) { - adr = typ->size - (LONGINT)__ASHR(typ->sysflag, 8); + adr = typ->size - (SYSTEM_INT64)__ASHR(typ->sysflag, 8); if (adr == 0) { gap = 1; } else { @@ -1171,10 +1142,10 @@ static void OPC_Include (CHAR *name, LONGINT name__len) { __DUP(name, name__len, CHAR); OPM_WriteString((CHAR*)"#include ", (LONGINT)10); - OPM_Write('\"'); + OPM_Write('"'); OPM_WriteStringVar((void*)name, name__len); OPM_WriteString((CHAR*)".h", (LONGINT)3); - OPM_Write('\"'); + OPM_Write('"'); OPM_WriteLn(); __DEL(name); } @@ -1239,8 +1210,8 @@ void OPC_GenHdr (OPT_Node n) static void OPC_GenHeaderMsg (void) { INTEGER i; - OPM_WriteString((CHAR*)"/*", (LONGINT)3); - OPM_WriteString((CHAR*)" voc ", (LONGINT)6); + OPM_WriteString((CHAR*)"/* ", (LONGINT)4); + OPM_WriteString((CHAR*)"voc", (LONGINT)4); OPM_Write(' '); OPM_WriteString(Configuration_versionLong, ((LONGINT)(41))); OPM_Write(' '); @@ -1856,26 +1827,56 @@ void OPC_Cmp (INTEGER rel) } } +static void OPC_CharacterLiteral (LONGINT c) +{ + if (c < 32 || c > 126) { + OPM_WriteString((CHAR*)"0x", (LONGINT)3); + OPM_WriteHex(c); + } else { + OPM_Write('\''); + if ((c == 92 || c == 39) || c == 63) { + OPM_Write('\\'); + } + OPM_Write((CHAR)c); + OPM_Write('\''); + } +} + +static void OPC_StringLiteral (CHAR *s, LONGINT s__len, LONGINT l) +{ + LONGINT i; + INTEGER c; + __DUP(s, s__len, CHAR); + OPM_Write('"'); + i = 0; + while (i < l) { + c = (int)s[__X(i, s__len)]; + if (c < 32 || c > 126) { + OPM_Write('\\'); + OPM_Write((CHAR)(48 + __ASHR(c, 6))); + c = __MASK(c, -64); + OPM_Write((CHAR)(48 + __ASHR(c, 3))); + c = __MASK(c, -8); + OPM_Write((CHAR)(48 + c)); + } else { + if ((c == 92 || c == 34) || c == 63) { + OPM_Write('\\'); + } + OPM_Write((CHAR)c); + } + i += 1; + } + OPM_Write('"'); + __DEL(s); +} + void OPC_Case (LONGINT caseVal, INTEGER form) { CHAR ch; OPM_WriteString((CHAR*)"case ", (LONGINT)6); switch (form) { case 3: - ch = (CHAR)caseVal; - if ((ch >= ' ' && ch <= '~')) { - OPM_Write('\''); - if (((ch == '\\' || ch == '\?') || ch == '\'') || ch == '\"') { - OPM_Write('\\'); - OPM_Write(ch); - } else { - OPM_Write(ch); - } - OPM_Write('\''); - } else { - OPM_WriteString((CHAR*)"0x", (LONGINT)3); - OPM_WriteHex(caseVal); - } + OPC_CharacterLiteral(caseVal); break; case 4: case 5: case 6: OPM_WriteInt(caseVal); @@ -1933,8 +1934,7 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim) void OPC_Constant (OPT_Const con, INTEGER form) { - INTEGER i, len; - CHAR ch; + INTEGER i; SET s; LONGINT hex; BOOLEAN skipLeading; @@ -1946,18 +1946,7 @@ void OPC_Constant (OPT_Const con, INTEGER form) OPM_WriteInt(con->intval); break; case 3: - ch = (CHAR)con->intval; - if ((ch >= ' ' && ch <= '~')) { - OPM_Write('\''); - if (((ch == '\\' || ch == '\?') || ch == '\'') || ch == '\"') { - OPM_Write('\\'); - } - OPM_Write(ch); - OPM_Write('\''); - } else { - OPM_WriteString((CHAR*)"0x", (LONGINT)3); - OPM_WriteHex(con->intval); - } + OPC_CharacterLiteral(con->intval); break; case 4: case 5: case 6: OPM_WriteInt(con->intval); @@ -1992,18 +1981,7 @@ void OPC_Constant (OPT_Const con, INTEGER form) } break; case 10: - OPM_Write('\"'); - len = (int)con->intval2 - 1; - i = 0; - while (i < len) { - ch = (*con->ext)[__X(i, ((LONGINT)(256)))]; - if (((ch == '\\' || ch == '\?') || ch == '\'') || ch == '\"') { - OPM_Write('\\'); - } - OPM_Write(ch); - i += 1; - } - OPM_Write('\"'); + OPC_StringLiteral(*con->ext, ((LONGINT)(256)), con->intval2 - 1); break; case 11: OPM_WriteString((CHAR*)"NIL", (LONGINT)4); @@ -2016,74 +1994,74 @@ void OPC_Constant (OPT_Const con, INTEGER form) } } -static struct InitKeywords__47 { +static struct InitKeywords__48 { SHORTINT *n; - struct InitKeywords__47 *lnk; -} *InitKeywords__47_s; + struct InitKeywords__48 *lnk; +} *InitKeywords__48_s; -static void Enter__48 (CHAR *s, LONGINT s__len); +static void Enter__49 (CHAR *s, LONGINT s__len); -static void Enter__48 (CHAR *s, LONGINT s__len) +static void Enter__49 (CHAR *s, LONGINT s__len) { INTEGER h; __DUP(s, s__len, CHAR); h = OPC_PerfectHash((void*)s, s__len); - OPC_hashtab[__X(h, ((LONGINT)(105)))] = *InitKeywords__47_s->n; - __COPY(s, OPC_keytab[__X(*InitKeywords__47_s->n, ((LONGINT)(36)))], ((LONGINT)(9))); - *InitKeywords__47_s->n += 1; + OPC_hashtab[__X(h, ((LONGINT)(105)))] = *InitKeywords__48_s->n; + __COPY(s, OPC_keytab[__X(*InitKeywords__48_s->n, ((LONGINT)(36)))], ((LONGINT)(9))); + *InitKeywords__48_s->n += 1; __DEL(s); } static void OPC_InitKeywords (void) { SHORTINT n, i; - struct InitKeywords__47 _s; + struct InitKeywords__48 _s; _s.n = &n; - _s.lnk = InitKeywords__47_s; - InitKeywords__47_s = &_s; + _s.lnk = InitKeywords__48_s; + InitKeywords__48_s = &_s; n = 0; i = 0; while (i <= 104) { OPC_hashtab[__X(i, ((LONGINT)(105)))] = -1; i += 1; } - Enter__48((CHAR*)"asm", (LONGINT)4); - Enter__48((CHAR*)"auto", (LONGINT)5); - Enter__48((CHAR*)"break", (LONGINT)6); - Enter__48((CHAR*)"case", (LONGINT)5); - Enter__48((CHAR*)"char", (LONGINT)5); - Enter__48((CHAR*)"const", (LONGINT)6); - Enter__48((CHAR*)"continue", (LONGINT)9); - Enter__48((CHAR*)"default", (LONGINT)8); - Enter__48((CHAR*)"do", (LONGINT)3); - Enter__48((CHAR*)"double", (LONGINT)7); - Enter__48((CHAR*)"else", (LONGINT)5); - Enter__48((CHAR*)"enum", (LONGINT)5); - Enter__48((CHAR*)"extern", (LONGINT)7); - Enter__48((CHAR*)"export", (LONGINT)7); - Enter__48((CHAR*)"float", (LONGINT)6); - Enter__48((CHAR*)"for", (LONGINT)4); - Enter__48((CHAR*)"fortran", (LONGINT)8); - Enter__48((CHAR*)"goto", (LONGINT)5); - Enter__48((CHAR*)"if", (LONGINT)3); - Enter__48((CHAR*)"import", (LONGINT)7); - Enter__48((CHAR*)"int", (LONGINT)4); - Enter__48((CHAR*)"long", (LONGINT)5); - Enter__48((CHAR*)"register", (LONGINT)9); - Enter__48((CHAR*)"return", (LONGINT)7); - Enter__48((CHAR*)"short", (LONGINT)6); - Enter__48((CHAR*)"signed", (LONGINT)7); - Enter__48((CHAR*)"sizeof", (LONGINT)7); - Enter__48((CHAR*)"static", (LONGINT)7); - Enter__48((CHAR*)"struct", (LONGINT)7); - Enter__48((CHAR*)"switch", (LONGINT)7); - Enter__48((CHAR*)"typedef", (LONGINT)8); - Enter__48((CHAR*)"union", (LONGINT)6); - Enter__48((CHAR*)"unsigned", (LONGINT)9); - Enter__48((CHAR*)"void", (LONGINT)5); - Enter__48((CHAR*)"volatile", (LONGINT)9); - Enter__48((CHAR*)"while", (LONGINT)6); - InitKeywords__47_s = _s.lnk; + Enter__49((CHAR*)"asm", (LONGINT)4); + Enter__49((CHAR*)"auto", (LONGINT)5); + Enter__49((CHAR*)"break", (LONGINT)6); + Enter__49((CHAR*)"case", (LONGINT)5); + Enter__49((CHAR*)"char", (LONGINT)5); + Enter__49((CHAR*)"const", (LONGINT)6); + Enter__49((CHAR*)"continue", (LONGINT)9); + Enter__49((CHAR*)"default", (LONGINT)8); + Enter__49((CHAR*)"do", (LONGINT)3); + Enter__49((CHAR*)"double", (LONGINT)7); + Enter__49((CHAR*)"else", (LONGINT)5); + Enter__49((CHAR*)"enum", (LONGINT)5); + Enter__49((CHAR*)"extern", (LONGINT)7); + Enter__49((CHAR*)"export", (LONGINT)7); + Enter__49((CHAR*)"float", (LONGINT)6); + Enter__49((CHAR*)"for", (LONGINT)4); + Enter__49((CHAR*)"fortran", (LONGINT)8); + Enter__49((CHAR*)"goto", (LONGINT)5); + Enter__49((CHAR*)"if", (LONGINT)3); + Enter__49((CHAR*)"import", (LONGINT)7); + Enter__49((CHAR*)"int", (LONGINT)4); + Enter__49((CHAR*)"long", (LONGINT)5); + Enter__49((CHAR*)"register", (LONGINT)9); + Enter__49((CHAR*)"return", (LONGINT)7); + Enter__49((CHAR*)"short", (LONGINT)6); + Enter__49((CHAR*)"signed", (LONGINT)7); + Enter__49((CHAR*)"sizeof", (LONGINT)7); + Enter__49((CHAR*)"static", (LONGINT)7); + Enter__49((CHAR*)"struct", (LONGINT)7); + Enter__49((CHAR*)"switch", (LONGINT)7); + Enter__49((CHAR*)"typedef", (LONGINT)8); + Enter__49((CHAR*)"union", (LONGINT)6); + Enter__49((CHAR*)"unsigned", (LONGINT)9); + Enter__49((CHAR*)"void", (LONGINT)5); + Enter__49((CHAR*)"volatile", (LONGINT)9); + Enter__49((CHAR*)"while", (LONGINT)6); + InitKeywords__48_s = _s.lnk; } diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index 58679d74..37a86252 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h @@ -12,7 +12,7 @@ import void OPC_Align (LONGINT *adr, LONGINT base); import void OPC_Andent (OPT_Struct typ); -import LONGINT OPC_Base (OPT_Struct typ); +import LONGINT OPC_BaseAlignment (OPT_Struct typ); import OPT_Object OPC_BaseTProc (OPT_Object obj); import void OPC_BegBlk (void); import void OPC_BegStat (void); @@ -41,6 +41,7 @@ import void OPC_InitTDesc (OPT_Struct typ); import void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim); import LONGINT OPC_NofPtrs (OPT_Struct typ); import void OPC_SetInclude (BOOLEAN exclude); +import LONGINT OPC_SizeAlignment (LONGINT size); import void OPC_TDescDecl (OPT_Struct typ); import void OPC_TypeDefs (OPT_Object obj, INTEGER vis); import void OPC_TypeOf (OPT_Object ap); diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 40d53974..50047c9e 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -15,8 +15,8 @@ typedef static CHAR OPM_SourceFileName[256]; -export INTEGER OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_CharAlign, OPM_BoolAlign, OPM_SIntAlign, OPM_IntAlign, OPM_LIntAlign, OPM_SetAlign, OPM_RealAlign, OPM_LRealAlign, OPM_PointerAlign, OPM_ProcAlign, OPM_RecAlign, OPM_MaxSet; -export LONGINT OPM_MinSInt, OPM_MinInt, OPM_MinLInt, OPM_MaxSInt, OPM_MaxInt, OPM_MaxLInt, OPM_MaxIndex; +export INTEGER OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet; +export LONGINT OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; export LONGINT OPM_curpos, OPM_errpos, OPM_breakpc; @@ -58,7 +58,6 @@ export void OPM_LogWNum (LONGINT i, LONGINT len); export void OPM_LogWStr (CHAR *s, LONGINT s__len); static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len); export void OPM_Mark (INTEGER n, LONGINT pos); -static INTEGER OPM_Min (INTEGER a, INTEGER b); export void OPM_NewSym (CHAR *modName, LONGINT modName__len); export void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); export void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); @@ -66,6 +65,8 @@ export BOOLEAN OPM_OpenPar (void); export void OPM_RegisterNewSym (void); static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt); static void OPM_ShowLine (LONGINT pos); +export LONGINT OPM_SignedMaximum (LONGINT bytecount); +export LONGINT OPM_SignedMinimum (LONGINT bytecount); export void OPM_SymRCh (CHAR *ch); export LONGINT OPM_SymRInt (void); export void OPM_SymRLReal (LONGREAL *lr); @@ -86,7 +87,7 @@ export void OPM_WriteString (CHAR *s, LONGINT s__len); export void OPM_WriteStringVar (CHAR *s, LONGINT s__len); export BOOLEAN OPM_eofSF (void); export void OPM_err (INTEGER n); -static LONGINT OPM_minus (LONGINT i); +static LONGINT OPM_minusop (LONGINT i); static LONGINT OPM_power0 (LONGINT i, LONGINT j); @@ -118,50 +119,38 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) i = 1; while (s[__X(i, s__len)] != 0x00) { switch (s[__X(i, s__len)]) { - case 'e': - *opt = *opt ^ 0x0200; - break; - case 's': - *opt = *opt ^ 0x10; - break; - case 'm': - *opt = *opt ^ 0x0400; - break; - case 'x': - *opt = *opt ^ 0x01; - break; - case 'r': - *opt = *opt ^ 0x04; - break; - case 't': - *opt = *opt ^ 0x08; - break; case 'a': *opt = *opt ^ 0x80; break; - case 'k': - *opt = *opt ^ 0x40; - break; - case 'p': - *opt = *opt ^ 0x20; - break; - case 'S': - *opt = *opt ^ 0x2000; - break; case 'c': *opt = *opt ^ 0x4000; break; - case 'M': - *opt = *opt ^ 0x8000; + case 'e': + *opt = *opt ^ 0x0200; break; case 'f': *opt = *opt ^ 0x010000; break; - case 'F': - *opt = *opt ^ 0x020000; + case 'k': + *opt = *opt ^ 0x40; break; - case 'V': - *opt = *opt ^ 0x040000; + case 'm': + *opt = *opt ^ 0x0400; + break; + case 'p': + *opt = *opt ^ 0x20; + break; + case 'r': + *opt = *opt ^ 0x04; + break; + case 's': + *opt = *opt ^ 0x10; + break; + case 't': + *opt = *opt ^ 0x08; + break; + case 'x': + *opt = *opt ^ 0x01; break; case 'B': if (s[__X(i + 1, s__len)] != 0x00) { @@ -179,6 +168,19 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) __ASSERT(OPM_IntSize == 2 || OPM_IntSize == 4, 0); __ASSERT(OPM_PointerSize == 4 || OPM_PointerSize == 8, 0); __ASSERT(OPM_Alignment == 4 || OPM_Alignment == 8, 0); + Files_SetSearchPath((CHAR*)"", (LONGINT)1); + break; + case 'F': + *opt = *opt ^ 0x020000; + break; + case 'M': + *opt = *opt ^ 0x8000; + break; + case 'S': + *opt = *opt ^ 0x2000; + break; + case 'V': + *opt = *opt ^ 0x040000; break; default: OPM_LogWStr((CHAR*)" warning: option ", (LONGINT)19); @@ -228,17 +230,17 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWLn(); OPM_LogWStr((CHAR*)" x - turn off array indices check", (LONGINT)35); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" a - don\'t check ASSERTs at runtime, use this option in tested production code", (LONGINT)80); + OPM_LogWStr((CHAR*)" a - don't check ASSERTs at runtime, use this option in tested production code", (LONGINT)80); OPM_LogWLn(); OPM_LogWStr((CHAR*)" p - turn off automatic pointer initialization", (LONGINT)48); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" t - don\'t check type guards (use in rare cases such as low-level modules where every cycle counts)", (LONGINT)101); + OPM_LogWStr((CHAR*)" t - don't check type guards (use in rare cases such as low-level modules where every cycle counts)", (LONGINT)101); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" S - don\'t call external assembler/compiler, only generate C code", (LONGINT)67); + OPM_LogWStr((CHAR*)" S - don't call external assembler/compiler, only generate C code", (LONGINT)67); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" c - don\'t call linker", (LONGINT)24); + OPM_LogWStr((CHAR*)" c - don't call linker", (LONGINT)24); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" f - don\'t use color output", (LONGINT)29); + OPM_LogWStr((CHAR*)" f - don't use color output", (LONGINT)29); OPM_LogWLn(); OPM_LogWStr((CHAR*)" F - force writing new symbol file in current directory", (LONGINT)57); OPM_LogWLn(); @@ -541,16 +543,17 @@ void OPM_FPrintSet (LONGINT *fp, SET set) void OPM_FPrintReal (LONGINT *fp, REAL real) { - OPM_FPrint(&*fp, __VAL(LONGINT, real)); + INTEGER i; + LONGINT l; + __GET((LONGINT)(SYSTEM_ADDRESS)&real, i, INTEGER); + l = i; + OPM_FPrint(&*fp, l); } void OPM_FPrintLReal (LONGINT *fp, LONGREAL lr) { LONGINT l, h; - __GET((LONGINT)(uintptr_t)&lr, l, LONGINT); - __GET((LONGINT)(uintptr_t)&lr + 4, h, LONGINT); - OPM_FPrint(&*fp, l); - OPM_FPrint(&*fp, h); + OPM_FPrint(&*fp, __VAL(LONGINT, lr)); } static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONGINT name__len, INTEGER *size, INTEGER *align) @@ -576,7 +579,7 @@ static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONG __DEL(name); } -static LONGINT OPM_minus (LONGINT i) +static LONGINT OPM_minusop (LONGINT i) { LONGINT _o_result; _o_result = -i; @@ -604,103 +607,62 @@ static void OPM_VerboseListSizes (void) OPM_LogWLn(); OPM_LogWStr((CHAR*)"CHAR ", (LONGINT)14); OPM_LogWNum(OPM_CharSize, ((LONGINT)(4))); - OPM_LogWNum(OPM_CharAlign, ((LONGINT)(5))); OPM_LogWLn(); OPM_LogWStr((CHAR*)"BOOLEAN ", (LONGINT)14); OPM_LogWNum(OPM_BoolSize, ((LONGINT)(4))); - OPM_LogWNum(OPM_BoolAlign, ((LONGINT)(5))); OPM_LogWLn(); OPM_LogWStr((CHAR*)"SHORTINT ", (LONGINT)14); OPM_LogWNum(OPM_SIntSize, ((LONGINT)(4))); - OPM_LogWNum(OPM_SIntAlign, ((LONGINT)(5))); OPM_LogWLn(); OPM_LogWStr((CHAR*)"INTEGER ", (LONGINT)14); OPM_LogWNum(OPM_IntSize, ((LONGINT)(4))); - OPM_LogWNum(OPM_IntAlign, ((LONGINT)(5))); OPM_LogWLn(); OPM_LogWStr((CHAR*)"LONGINT ", (LONGINT)14); OPM_LogWNum(OPM_LIntSize, ((LONGINT)(4))); - OPM_LogWNum(OPM_LIntAlign, ((LONGINT)(5))); OPM_LogWLn(); OPM_LogWStr((CHAR*)"SET ", (LONGINT)14); OPM_LogWNum(OPM_SetSize, ((LONGINT)(4))); - OPM_LogWNum(OPM_SetAlign, ((LONGINT)(5))); OPM_LogWLn(); OPM_LogWStr((CHAR*)"REAL ", (LONGINT)14); OPM_LogWNum(OPM_RealSize, ((LONGINT)(4))); - OPM_LogWNum(OPM_RealAlign, ((LONGINT)(5))); OPM_LogWLn(); OPM_LogWStr((CHAR*)"LONGREAL ", (LONGINT)14); OPM_LogWNum(OPM_LRealSize, ((LONGINT)(4))); - OPM_LogWNum(OPM_LRealAlign, ((LONGINT)(5))); OPM_LogWLn(); OPM_LogWStr((CHAR*)"PTR ", (LONGINT)14); OPM_LogWNum(OPM_PointerSize, ((LONGINT)(4))); - OPM_LogWNum(OPM_PointerAlign, ((LONGINT)(5))); OPM_LogWLn(); OPM_LogWStr((CHAR*)"PROC ", (LONGINT)14); OPM_LogWNum(OPM_ProcSize, ((LONGINT)(4))); - OPM_LogWNum(OPM_ProcAlign, ((LONGINT)(5))); OPM_LogWLn(); OPM_LogWStr((CHAR*)"RECORD ", (LONGINT)14); OPM_LogWNum(OPM_RecSize, ((LONGINT)(4))); - OPM_LogWNum(OPM_RecAlign, ((LONGINT)(5))); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Min shortint ", (LONGINT)14); - OPM_LogWNum(OPM_MinSInt, ((LONGINT)(4))); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Max shortint ", (LONGINT)14); - OPM_LogWNum(OPM_MaxSInt, ((LONGINT)(4))); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Min integer ", (LONGINT)14); - OPM_LogWNum(OPM_MinInt, ((LONGINT)(4))); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Max integer ", (LONGINT)14); - OPM_LogWNum(OPM_MaxInt, ((LONGINT)(4))); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Min longint ", (LONGINT)14); - OPM_LogWNum(OPM_MinLInt, ((LONGINT)(4))); - OPM_LogWLn(); } -static INTEGER OPM_Min (INTEGER a, INTEGER b) +LONGINT OPM_SignedMaximum (LONGINT bytecount) { - INTEGER _o_result; - if (a < b) { - _o_result = a; - return _o_result; - } else { - _o_result = b; - return _o_result; - } - __RETCHK; + LONGINT _o_result; + LONGINT result; + result = 1; + result = __LSH(result, __ASHL(bytecount, 3) - 1, LONGINT); + _o_result = result - 1; + return _o_result; +} + +LONGINT OPM_SignedMinimum (LONGINT bytecount) +{ + LONGINT _o_result; + _o_result = -OPM_SignedMaximum(bytecount) - 1; + return _o_result; } static void OPM_GetProperties (void) { - LONGINT base; OPM_ProcSize = OPM_PointerSize; OPM_LIntSize = __ASHL(OPM_IntSize, 1); OPM_SetSize = OPM_LIntSize; - OPM_CharAlign = OPM_Min(OPM_Alignment, OPM_CharSize); - OPM_BoolAlign = OPM_Min(OPM_Alignment, OPM_BoolSize); - OPM_SIntAlign = OPM_Min(OPM_Alignment, OPM_SIntSize); - OPM_RecAlign = OPM_Min(OPM_Alignment, OPM_RecSize); - OPM_RealAlign = OPM_Min(OPM_Alignment, OPM_RealSize); - OPM_LRealAlign = OPM_Min(OPM_Alignment, OPM_LRealSize); - OPM_PointerAlign = OPM_Min(OPM_Alignment, OPM_PointerSize); - OPM_ProcAlign = OPM_Min(OPM_Alignment, OPM_ProcSize); - OPM_IntAlign = OPM_Min(OPM_Alignment, OPM_IntSize); - OPM_LIntAlign = OPM_Min(OPM_Alignment, OPM_LIntSize); - OPM_SetAlign = OPM_Min(OPM_Alignment, OPM_SetSize); - base = -2; - OPM_MinSInt = __ASH(base, __ASHL(OPM_SIntSize, 3) - 2); - OPM_MaxSInt = OPM_minus(OPM_MinSInt + 1); - OPM_MinInt = __ASH(base, __ASHL(OPM_IntSize, 3) - 2); - OPM_MaxInt = OPM_minus(OPM_MinInt + 1); - OPM_MinLInt = __ASH(base, __ASHL(OPM_LIntSize, 3) - 2); - OPM_MaxLInt = OPM_minus(OPM_MinLInt + 1); if (OPM_RealSize == 4) { OPM_MaxReal = 3.40282346000000e+038; } else if (OPM_RealSize == 8) { @@ -714,7 +676,7 @@ static void OPM_GetProperties (void) OPM_MinReal = -OPM_MaxReal; OPM_MinLReal = -OPM_MaxLReal; OPM_MaxSet = __ASHL(OPM_SetSize, 3) - 1; - OPM_MaxIndex = OPM_MaxLInt; + OPM_MaxIndex = OPM_SignedMaximum(OPM_PointerSize); if (OPM_Verbose) { OPM_VerboseListSizes(); } @@ -876,7 +838,7 @@ void OPM_WriteInt (LONGINT i) { CHAR s[20]; LONGINT i1, k; - if (i == OPM_MinInt || i == OPM_MinLInt) { + if (i == OPM_SignedMinimum(OPM_IntSize) || i == OPM_SignedMinimum(OPM_LIntSize)) { OPM_Write('('); OPM_WriteInt(i + 1); OPM_WriteString((CHAR*)"-1)", (LONGINT)4); @@ -909,7 +871,7 @@ void OPM_WriteReal (LONGREAL r, CHAR suffx) CHAR s[32]; CHAR ch; INTEGER i; - if ((((r < OPM_MaxLInt && r > OPM_MinLInt)) && r == (__ENTIER(r)))) { + if ((((r < OPM_SignedMaximum(OPM_LIntSize) && r > OPM_SignedMinimum(OPM_LIntSize))) && r == (__ENTIER(r)))) { if (suffx == 'f') { OPM_WriteString((CHAR*)"(REAL)", (LONGINT)7); } else { diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index 2e93dfcf..1706f8f1 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h @@ -7,8 +7,8 @@ #include "SYSTEM.h" -import INTEGER OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_CharAlign, OPM_BoolAlign, OPM_SIntAlign, OPM_IntAlign, OPM_LIntAlign, OPM_SetAlign, OPM_RealAlign, OPM_LRealAlign, OPM_PointerAlign, OPM_ProcAlign, OPM_RecAlign, OPM_MaxSet; -import LONGINT OPM_MinSInt, OPM_MinInt, OPM_MinLInt, OPM_MaxSInt, OPM_MaxInt, OPM_MaxLInt, OPM_MaxIndex; +import INTEGER OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet; +import LONGINT OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; import LONGINT OPM_curpos, OPM_errpos, OPM_breakpc; @@ -39,6 +39,8 @@ import void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); import void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); import BOOLEAN OPM_OpenPar (void); import void OPM_RegisterNewSym (void); +import LONGINT OPM_SignedMaximum (LONGINT bytecount); +import LONGINT OPM_SignedMinimum (LONGINT bytecount); import void OPM_SymRCh (CHAR *ch); import LONGINT OPM_SymRInt (void); import void OPM_SymRLReal (LONGREAL *lr); diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index 9ce53b1f..be7c13b5 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPB.h" @@ -439,10 +439,10 @@ static void OPP_TypeDecl (OPT_Struct *typ, OPT_Struct *banned) if (OPP_sym == 38) { OPP_qualident(&id); if (id->mode == 5) { - if (id->typ != *banned) { - *typ = id->typ; - } else { + if (id->typ == *banned) { OPP_err(58); + } else { + *typ = id->typ; } } else { OPP_err(52); @@ -1784,6 +1784,24 @@ void OPP_Module (OPT_Node *prog, SET opt) if (OPP_sym == 63) { OPS_Get(&OPP_sym); } else { + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Unexpected symbol found when MODULE expected:", (LONGINT)46); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" sym: ", (LONGINT)15); + OPM_LogWNum(OPP_sym, ((LONGINT)(1))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" OPS.name: ", (LONGINT)15); + OPM_LogWStr(OPS_name, ((LONGINT)(256))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" OPS.str: ", (LONGINT)15); + OPM_LogWStr(OPS_str, ((LONGINT)(256))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" OPS.numtyp: ", (LONGINT)15); + OPM_LogWNum(OPS_numtyp, ((LONGINT)(1))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" OPS.intval: ", (LONGINT)15); + OPM_LogWNum(OPS_intval, ((LONGINT)(1))); + OPM_LogWLn(); OPP_err(16); } if (OPP_sym == 38) { diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index 372c5f88..0b3b1b2c 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index 8276ecf9..cc04e014 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" @@ -174,7 +174,7 @@ static void OPS_Number (void) OPS_numtyp = 1; if (n <= 2) { while (i < n) { - OPS_intval = __ASHL(OPS_intval, 4) + (LONGINT)Ord__7(dig[i], 1); + OPS_intval = __ASHL(OPS_intval, 4) + (SYSTEM_INT64)Ord__7(dig[i], 1); i += 1; } } else { @@ -189,7 +189,7 @@ static void OPS_Number (void) OPS_intval = -1; } while (i < n) { - OPS_intval = __ASHL(OPS_intval, 4) + (LONGINT)Ord__7(dig[i], 1); + OPS_intval = __ASHL(OPS_intval, 4) + (SYSTEM_INT64)Ord__7(dig[i], 1); i += 1; } } else { @@ -200,8 +200,8 @@ static void OPS_Number (void) while (i < n) { d = Ord__7(dig[i], 0); i += 1; - if (OPS_intval <= __DIV(9223372036854775807 - (LONGINT)d, 10)) { - OPS_intval = OPS_intval * 10 + (LONGINT)d; + if (OPS_intval <= __DIV(9223372036854775807 - (SYSTEM_INT64)d, 10)) { + OPS_intval = OPS_intval * 10 + (SYSTEM_INT64)d; } else { OPS_err(203); } @@ -326,7 +326,7 @@ void OPS_Get (SHORTINT *sym) } } switch (OPS_ch) { - case '\"': case '\'': + case '"': case '\'': OPS_Str(&s); break; case '#': diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index 8f1581bb..32148c49 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index 7f03064b..a0d41c71 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" @@ -850,7 +850,7 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval) conval->intval = 0; break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPT.InConstant(), f = ", (LONGINT)41); + OPM_LogWStr((CHAR*)"unhandled case in InConstant(), f = ", (LONGINT)37); OPM_LogWNum(f, ((LONGINT)(0))); OPM_LogWLn(); break; @@ -1073,7 +1073,7 @@ static void OPT_InStruct (OPT_Struct *typ) OPT_InSign(mno, &(*typ)->BaseTyp, &(*typ)->link); break; default: - OPM_LogWStr((CHAR*)"unhandled case at OPT.InStruct, tag = ", (LONGINT)39); + OPM_LogWStr((CHAR*)"unhandled case at InStruct, tag = ", (LONGINT)35); OPM_LogWNum(tag, ((LONGINT)(0))); OPM_LogWLn(); break; @@ -1176,7 +1176,7 @@ static OPT_Object OPT_InObj (SHORTINT mno) } break; default: - OPM_LogWStr((CHAR*)"unhandled case at OPT.InObj, tag = ", (LONGINT)36); + OPM_LogWStr((CHAR*)"unhandled case at InObj, tag = ", (LONGINT)32); OPM_LogWNum(tag, ((LONGINT)(0))); OPM_LogWLn(); break; @@ -1465,14 +1465,14 @@ static void OPT_OutStr (OPT_Struct typ) OPM_SymWInt(((LONGINT)(18))); break; default: - OPM_LogWStr((CHAR*)"unhandled case at OPT.OutStr, typ^.comp = ", (LONGINT)43); + OPM_LogWStr((CHAR*)"unhandled case at OutStr, typ^.comp = ", (LONGINT)39); OPM_LogWNum(typ->comp, ((LONGINT)(0))); OPM_LogWLn(); break; } break; default: - OPM_LogWStr((CHAR*)"unhandled case at OPT.OutStr, typ^.form = ", (LONGINT)43); + OPM_LogWStr((CHAR*)"unhandled case at OutStr, typ^.form = ", (LONGINT)39); OPM_LogWNum(typ->form, ((LONGINT)(0))); OPM_LogWLn(); break; @@ -1537,7 +1537,7 @@ static void OPT_OutObj (OPT_Object obj) OPT_FPrintErr(obj, 251); break; default: - OPM_LogWStr((CHAR*)"unhandled case at OPT.OutObj, obj^.history = ", (LONGINT)46); + OPM_LogWStr((CHAR*)"unhandled case at OutObj, obj^.history = ", (LONGINT)42); OPM_LogWNum(obj->history, ((LONGINT)(0))); OPM_LogWLn(); break; @@ -1593,7 +1593,7 @@ static void OPT_OutObj (OPT_Object obj) OPT_OutName((void*)obj->name, ((LONGINT)(256))); break; default: - OPM_LogWStr((CHAR*)"unhandled case at OPT.OutObj, obj.mode = ", (LONGINT)42); + OPM_LogWStr((CHAR*)"unhandled case at OutObj, obj.mode = ", (LONGINT)38); OPM_LogWNum(obj->mode, ((LONGINT)(0))); OPM_LogWLn(); break; @@ -1810,6 +1810,7 @@ export void *OPT__init(void) OPT_syslink = OPT_topScope->right; OPT_universe = OPT_topScope; OPT_topScope->right = NIL; + OPT_EnterTyp((CHAR*)"BOOLEAN", 2, OPM_BoolSize, &OPT_booltyp); OPT_EnterTyp((CHAR*)"CHAR", 3, OPM_CharSize, &OPT_chartyp); OPT_EnterTyp((CHAR*)"SET", 9, OPM_SetSize, &OPT_settyp); OPT_EnterTyp((CHAR*)"REAL", 7, OPM_RealSize, &OPT_realtyp); @@ -1817,7 +1818,6 @@ export void *OPT__init(void) OPT_EnterTyp((CHAR*)"LONGINT", 6, OPM_LIntSize, &OPT_linttyp); OPT_EnterTyp((CHAR*)"LONGREAL", 8, OPM_LRealSize, &OPT_lrltyp); OPT_EnterTyp((CHAR*)"SHORTINT", 4, OPM_SIntSize, &OPT_sinttyp); - OPT_EnterTyp((CHAR*)"BOOLEAN", 2, OPM_BoolSize, &OPT_booltyp); OPT_EnterBoolConst((CHAR*)"FALSE", ((LONGINT)(0))); OPT_EnterBoolConst((CHAR*)"TRUE", ((LONGINT)(1))); OPT_EnterProc((CHAR*)"HALT", 0); diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 7e03d42c..ab2c4684 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h @@ -60,8 +60,7 @@ typedef INTEGER ref, sysflag; LONGINT n, size, align, txtpos; BOOLEAN allocated, pbused, pvused; - char _prvt0[8]; - LONGINT pbfp, pvfp; + char _prvt0[24]; OPT_Struct BaseTyp; OPT_Object link, strobj; } OPT_StrDesc; diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index c86ba15e..ae14f629 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPC.h" @@ -24,7 +24,7 @@ export LONGINT *OPV_ExitInfo__typ; static void OPV_ActualPar (OPT_Node n, OPT_Object fp); export void OPV_AdrAndSize (OPT_Object topScope); static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc); -static void OPV_Convert (OPT_Node n, INTEGER form, INTEGER prec); +static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec); static void OPV_DefineTDescs (OPT_Node n); static void OPV_Entier (OPT_Node n, INTEGER prec); static void OPV_GetTProcNum (OPT_Object obj); @@ -39,6 +39,7 @@ static LONGINT OPV_NaturalAlignment (LONGINT size, LONGINT max); static void OPV_NewArr (OPT_Node d, OPT_Node x); static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, INTEGER comp); static BOOLEAN OPV_SideEffects (OPT_Node n); +static void OPV_SizeCast (LONGINT size); static void OPV_Stamp (OPS_Name s); static OPT_Object OPV_SuperProc (OPT_Node n); static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported); @@ -83,10 +84,10 @@ void OPV_TypSize (OPT_Struct typ) btyp = typ->BaseTyp; if (btyp == NIL) { offset = 0; - base = OPM_RecAlign; + base = OPC_SizeAlignment(OPM_RecSize); } else { OPV_TypSize(btyp); - offset = btyp->size - (LONGINT)__ASHR(btyp->sysflag, 8); + offset = btyp->size - (SYSTEM_INT64)__ASHR(btyp->sysflag, 8); base = btyp->align; } fld = typ->link; @@ -94,7 +95,7 @@ void OPV_TypSize (OPT_Struct typ) btyp = fld->typ; OPV_TypSize(btyp); size = btyp->size; - fbase = OPC_Base(btyp); + fbase = OPC_BaseAlignment(btyp); OPC_Align(&offset, fbase); fld->adr = offset; offset += size; @@ -108,7 +109,7 @@ void OPV_TypSize (OPT_Struct typ) offset = 1; } if (OPM_RecSize == 0) { - base = OPV_NaturalAlignment(offset, OPM_RecAlign); + base = OPV_NaturalAlignment(offset, OPC_SizeAlignment(OPM_RecSize)); } OPC_Align(&offset, base); if ((typ->strobj == NIL && __MASK(typ->align, -65536) == 0)) { @@ -333,7 +334,7 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN return _o_result; break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence Nmop, subclass = ", (LONGINT)51); + OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Nmop, subclass = ", (LONGINT)55); OPM_LogWNum(subclass, ((LONGINT)(0))); OPM_LogWLn(); break; @@ -403,7 +404,7 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN return _o_result; break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence Ndop, subclass = ", (LONGINT)51); + OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Ndop, subclass = ", (LONGINT)55); OPM_LogWNum(subclass, ((LONGINT)(0))); OPM_LogWLn(); break; @@ -466,41 +467,26 @@ static void OPV_Entier (OPT_Node n, INTEGER prec) } } -static void OPV_Convert (OPT_Node n, INTEGER form, INTEGER prec) +static void OPV_SizeCast (LONGINT size) { - INTEGER from; + if (size <= 4) { + OPM_WriteString((CHAR*)"(int)", (LONGINT)6); + } else { + OPM_WriteString((CHAR*)"(SYSTEM_INT64)", (LONGINT)15); + } +} + +static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec) +{ + INTEGER from, to; from = n->typ->form; - if (form == 9) { + to = newtype->form; + if (to == 9) { OPM_WriteString((CHAR*)"__SETOF(", (LONGINT)9); OPV_Entier(n, -1); OPM_Write(')'); - } else if (form == 6) { - if (from < 6) { - OPM_WriteString((CHAR*)"(LONGINT)", (LONGINT)10); - } - OPV_Entier(n, 9); - } else if (form == 5) { - if (from < 5) { - OPM_WriteString((CHAR*)"(int)", (LONGINT)6); - OPV_expr(n, 9); - } else { - if (__IN(2, OPM_opt)) { - OPM_WriteString((CHAR*)"__SHORT", (LONGINT)8); - if (OPV_SideEffects(n)) { - OPM_Write('F'); - } - OPM_Write('('); - OPV_Entier(n, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); - OPM_WriteInt(OPM_MaxInt + 1); - OPM_Write(')'); - } else { - OPM_WriteString((CHAR*)"(int)", (LONGINT)6); - OPV_Entier(n, 9); - } - } - } else if (form == 4) { - if (__IN(2, OPM_opt)) { + } else if (__IN(to, 0x70)) { + if ((newtype->size < n->typ->size && __IN(2, OPM_opt))) { OPM_WriteString((CHAR*)"__SHORT", (LONGINT)8); if (OPV_SideEffects(n)) { OPM_Write('F'); @@ -508,13 +494,15 @@ static void OPV_Convert (OPT_Node n, INTEGER form, INTEGER prec) OPM_Write('('); OPV_Entier(n, -1); OPM_WriteString((CHAR*)", ", (LONGINT)3); - OPM_WriteInt(OPM_MaxSInt + 1); + OPM_WriteInt(OPM_SignedMaximum(newtype->size) + 1); OPM_Write(')'); } else { - OPM_WriteString((CHAR*)"(int)", (LONGINT)6); + if (newtype->size != n->typ->size) { + OPV_SizeCast(newtype->size); + } OPV_Entier(n, 9); } - } else if (form == 3) { + } else if (to == 3) { if (__IN(2, OPM_opt)) { OPM_WriteString((CHAR*)"__CHR", (LONGINT)6); if (OPV_SideEffects(n)) { @@ -577,7 +565,7 @@ static void OPV_design (OPT_Node n, INTEGER prec) OPT_Struct typ = NIL; INTEGER class, designPrec, comp; OPT_Node d = NIL, x = NIL; - INTEGER dims, i, _for__26; + INTEGER dims, i, _for__27; comp = n->typ->comp; obj = n->obj; class = n->class; @@ -653,15 +641,15 @@ static void OPV_design (OPT_Node n, INTEGER prec) } x = x->left; } - _for__26 = dims; + _for__27 = dims; i = 1; - while (i <= _for__26) { + while (i <= _for__27) { OPM_Write(')'); i += 1; } if (n->typ->comp == 3) { OPM_Write(')'); - while ((LONGINT)i < __ASHR(d->typ->size - 4, 2)) { + while ((SYSTEM_INT64)i < __ASHR(d->typ->size - 4, 2)) { OPM_WriteString((CHAR*)" * ", (LONGINT)4); OPV_Len(d, i); i += 1; @@ -796,7 +784,7 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) } if ((((mode == 2 && n->class == 11)) && n->subcl == 29)) { OPV_expr(n->left, prec); - } else if ((((((form == 6 && n->class == 7)) && n->conval->intval <= OPM_MaxInt)) && n->conval->intval >= OPM_MinInt)) { + } else if ((((((form == 6 && n->class == 7)) && n->conval->intval <= OPM_SignedMaximum(OPM_IntSize))) && n->conval->intval >= OPM_SignedMinimum(OPM_IntSize))) { OPM_WriteString((CHAR*)"((LONGINT)(", (LONGINT)12); OPV_expr(n, prec); OPM_WriteString((CHAR*)"))", (LONGINT)3); @@ -915,7 +903,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPM_Write(')'); break; case 20: - OPV_Convert(l, form, exprPrec); + OPV_Convert(l, n->typ, exprPrec); break; case 21: if (OPV_SideEffects(l)) { @@ -944,7 +932,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPM_Write(')'); break; case 24: - OPM_WriteString((CHAR*)"(LONGINT)(uintptr_t)", (LONGINT)21); + OPM_WriteString((CHAR*)"(LONGINT)(SYSTEM_ADDRESS)", (LONGINT)26); if (l->class == 1) { OPC_CompleteIdent(l->obj); } else { @@ -955,20 +943,16 @@ static void OPV_expr (OPT_Node n, INTEGER prec) } break; case 29: - if ((((__IN(n->typ->form, 0x6240) && __IN(l->typ->form, 0x6240))) && n->typ->size == l->typ->size) || !__IN(l->class, 0x17)) { + if (!__IN(l->class, 0x17) || (((__IN(n->typ->form, 0x6240) && __IN(l->typ->form, 0x6240))) && n->typ->size == l->typ->size)) { OPM_Write('('); OPC_Ident(n->typ->strobj); OPM_Write(')'); if (__IN(n->typ->form, 0x6000) || __IN(l->typ->form, 0x6000)) { - OPM_WriteString((CHAR*)"(uintptr_t)", (LONGINT)12); + OPM_WriteString((CHAR*)"(SYSTEM_ADDRESS)", (LONGINT)17); } OPV_expr(l, exprPrec); } else { - if (__IN(n->typ->form, 0x6000) || __IN(l->typ->form, 0x6000)) { - OPM_WriteString((CHAR*)"__VALP(", (LONGINT)8); - } else { - OPM_WriteString((CHAR*)"__VAL(", (LONGINT)7); - } + OPM_WriteString((CHAR*)"__VAL(", (LONGINT)7); OPC_Ident(n->typ->strobj); OPM_WriteString((CHAR*)", ", (LONGINT)3); OPV_expr(l, -1); @@ -1327,7 +1311,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) OPM_WriteInt(base->size); OPM_WriteString((CHAR*)"))", (LONGINT)3); OPM_WriteString((CHAR*)", ", (LONGINT)3); - OPM_WriteInt(OPC_Base(base)); + OPM_WriteInt(OPC_BaseAlignment(base)); OPM_WriteString((CHAR*)", ", (LONGINT)3); OPM_WriteInt(nofdim); OPM_WriteString((CHAR*)", ", (LONGINT)3); diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index eeb89a76..4eba5b89 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 842c232d..c1a0ea9e 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -119,14 +119,14 @@ export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT #define Platform_EXDEV() EXDEV extern void Heap_InitHeap(); #define Platform_HeapInitHeap() Heap_InitHeap() -#define Platform_allocate(size) (LONGINT)(uintptr_t)((void*)malloc((size_t)size)) +#define Platform_allocate(size) (LONGINT)(SYSTEM_ADDRESS)((void*)malloc((size_t)size)) #define Platform_chdir(n, n__len) chdir((char*)n) #define Platform_closefile(fd) close(fd) #define Platform_err() errno #define Platform_errc(c) write(1, &c, 1) #define Platform_errstring(s, s__len) write(1, s, s__len-1) #define Platform_exit(code) exit(code) -#define Platform_free(address) free((void*)(uintptr_t)address) +#define Platform_free(address) free((void*)(SYSTEM_ADDRESS)address) #define Platform_fstat(fd) fstat(fd, &s) #define Platform_fsync(fd) fsync(fd) #define Platform_ftruncate(fd, l) ftruncate(fd, l) @@ -139,13 +139,13 @@ extern void Heap_InitHeap(); #define Platform_opennew(n, n__len) open((char*)n, O_CREAT | O_TRUNC | O_RDWR, 0664) #define Platform_openro(n, n__len) open((char*)n, O_RDONLY) #define Platform_openrw(n, n__len) open((char*)n, O_RDWR) -#define Platform_readfile(fd, p, l) read(fd, (void*)(uintptr_t)(p), l) +#define Platform_readfile(fd, p, l) read(fd, (void*)(SYSTEM_ADDRESS)(p), l) #define Platform_rename(o, o__len, n, n__len) rename((char*)o, (char*)n) #define Platform_sectotm(s) struct tm *time = localtime((time_t*)&s) #define Platform_seekcur() SEEK_CUR #define Platform_seekend() SEEK_END #define Platform_seekset() SEEK_SET -#define Platform_sethandler(s, h) SystemSetHandler(s, (uintptr_t)h) +#define Platform_sethandler(s, h) SystemSetHandler(s, (SYSTEM_ADDRESS)h) #define Platform_stat(n, n__len) stat((char*)n, &s) #define Platform_statdev() (LONGINT)s.st_dev #define Platform_statino() (LONGINT)s.st_ino @@ -162,7 +162,7 @@ extern void Heap_InitHeap(); #define Platform_tvsec() tv.tv_sec #define Platform_tvusec() tv.tv_usec #define Platform_unlink(n, n__len) unlink((char*)n) -#define Platform_writefile(fd, p, l) write(fd, (void*)(uintptr_t)(p), l) +#define Platform_writefile(fd, p, l) write(fd, (void*)(SYSTEM_ADDRESS)(p), l) BOOLEAN Platform_TooManyFiles (INTEGER e) { @@ -230,7 +230,7 @@ void Platform_Init (INTEGER argc, LONGINT argvadr) Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; Platform_ArgCount = argc; - av = (Platform_ArgVecPtr)(uintptr_t)argvadr; + av = (Platform_ArgVecPtr)(SYSTEM_ADDRESS)argvadr; Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; Platform_HeapInitHeap(); @@ -263,7 +263,7 @@ void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { - av = (Platform_ArgVec)(uintptr_t)Platform_ArgVector; + av = (Platform_ArgVec)(SYSTEM_ADDRESS)Platform_ArgVector; __COPY(*(*av)[__X(n, ((LONGINT)(1024)))], val, val__len); } } @@ -530,7 +530,7 @@ INTEGER Platform_Read (LONGINT h, LONGINT p, LONGINT l, LONGINT *n) INTEGER Platform_ReadBuf (LONGINT h, SYSTEM_BYTE *b, LONGINT b__len, LONGINT *n) { INTEGER _o_result; - *n = Platform_readfile(h, (LONGINT)(uintptr_t)b, b__len); + *n = Platform_readfile(h, (LONGINT)(SYSTEM_ADDRESS)b, b__len); if (*n < 0) { *n = 0; _o_result = Platform_err(); @@ -766,7 +766,7 @@ static void Platform_TestLittleEndian (void) { INTEGER i; i = 1; - __GET((LONGINT)(uintptr_t)&i, Platform_LittleEndian, BOOLEAN); + __GET((LONGINT)(SYSTEM_ADDRESS)&i, Platform_LittleEndian, BOOLEAN); } __TDESC(Platform_FileIdentity, 1, 0) = {__TDFLDS("FileIdentity", 24), {-8}}; diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index bdb39b1d..49702e6d 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 0fb9a236..8b61d8cd 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -59,7 +59,7 @@ INTEGER Reals_Expo (REAL x) { INTEGER _o_result; INTEGER i; - __GET((LONGINT)(uintptr_t)&x + 2, i, INTEGER); + __GET((LONGINT)(SYSTEM_ADDRESS)&x + 2, i, INTEGER); _o_result = __MASK(__ASHR(i, 7), -256); return _o_result; } @@ -67,17 +67,17 @@ INTEGER Reals_Expo (REAL x) void Reals_SetExpo (REAL *x, INTEGER ex) { CHAR c; - __GET((LONGINT)(uintptr_t)x + 3, c, CHAR); - __PUT((LONGINT)(uintptr_t)x + 3, (CHAR)(__ASHL(__ASHR((int)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); - __GET((LONGINT)(uintptr_t)x + 2, c, CHAR); - __PUT((LONGINT)(uintptr_t)x + 2, (CHAR)(__MASK((int)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); + __GET((LONGINT)(SYSTEM_ADDRESS)x + 3, c, CHAR); + __PUT((LONGINT)(SYSTEM_ADDRESS)x + 3, (CHAR)(__ASHL(__ASHR((int)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __GET((LONGINT)(SYSTEM_ADDRESS)x + 2, c, CHAR); + __PUT((LONGINT)(SYSTEM_ADDRESS)x + 2, (CHAR)(__MASK((int)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } INTEGER Reals_ExpoL (LONGREAL x) { INTEGER _o_result; INTEGER i; - __GET((LONGINT)(uintptr_t)&x + 6, i, INTEGER); + __GET((LONGINT)(SYSTEM_ADDRESS)&x + 6, i, INTEGER); _o_result = __MASK(__ASHR(i, 4), -2048); return _o_result; } @@ -90,7 +90,7 @@ void Reals_ConvertL (LONGREAL x, INTEGER n, CHAR *d, LONGINT d__len) } k = 0; i = __ENTIER(x); - while (k < (LONGINT)n) { + while (k < (SYSTEM_INT64)n) { d[__X(k, d__len)] = (CHAR)(__MOD(i, 10) + 48); i = __DIV(i, 10); k += 1; @@ -122,7 +122,7 @@ static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LO CHAR by; i = 0; l = b__len; - while ((LONGINT)i < l) { + while ((SYSTEM_INT64)i < l) { by = __VAL(CHAR, b[__X(i, b__len)]); d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((int)by, 4)); d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((int)by, -16)); diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index db522698..ff21c192 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/SYSTEM.c b/bootstrap/unix-88/SYSTEM.c index 50e91c6d..33511a70 100644 --- a/bootstrap/unix-88/SYSTEM.c +++ b/bootstrap/unix-88/SYSTEM.c @@ -35,7 +35,7 @@ void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0) void SYSTEM_ENUMP(void *adr, LONGINT n, void (*P)()) { while (n > 0) { - P((LONGINT)(uintptr_t)(*((void**)(adr)))); + P((LONGINT)(SYSTEM_ADDRESS)(*((void**)(adr)))); adr = ((void**)adr) + 1; n--; } @@ -106,7 +106,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, else if (typ == (LONGINT*)POINTER__typ) { /* element type is a pointer */ x = Heap_NEWBLK(size + nofelems * sizeof(LONGINT)); - p = (LONGINT*)(uintptr_t)x[-1]; + p = (LONGINT*)(SYSTEM_ADDRESS)x[-1]; p[-nofelems] = *p; /* build new type desc in situ: 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nofelems - 1; n = 1; /* n =1 for skipping the size field */ while (n <= nofelems) {*p = n*sizeof(LONGINT); p++; n++;} @@ -119,7 +119,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, while (ptab[nofptrs] >= 0) {nofptrs++;} /* number of pointers per element */ nptr = nofelems * nofptrs; /* total number of pointers */ x = Heap_NEWBLK(size + nptr * sizeof(LONGINT)); - p = (LONGINT*)(uintptr_t)x[- 1]; + p = (LONGINT*)(SYSTEM_ADDRESS)x[- 1]; p[-nptr] = *p; /* build new type desc in situ; 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nptr - 1; n = 0; off = dataoff; while (n < nofelems) {i = 0; @@ -155,7 +155,7 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler // (Ignore other signals) } - void SystemSetHandler(int s, uintptr_t h) { + void SystemSetHandler(int s, SYSTEM_ADDRESS h) { if (s >= 2 && s <= 4) { int needtosetsystemhandler = handler[s-2] == 0; handler[s-2] = (SystemSignalHandler)h; @@ -194,12 +194,12 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler } } - void SystemSetInterruptHandler(uintptr_t h) { + void SystemSetInterruptHandler(SYSTEM_ADDRESS h) { EnsureConsoleCtrlHandler(); SystemInterruptHandler = (SystemSignalHandler)h; } - void SystemSetQuitHandler(uintptr_t h) { + void SystemSetQuitHandler(SYSTEM_ADDRESS h) { EnsureConsoleCtrlHandler(); SystemQuitHandler = (SystemSignalHandler)h; } diff --git a/bootstrap/unix-88/SYSTEM.h b/bootstrap/unix-88/SYSTEM.h index 949951ac..6377745e 100644 --- a/bootstrap/unix-88/SYSTEM.h +++ b/bootstrap/unix-88/SYSTEM.h @@ -1,28 +1,38 @@ #ifndef SYSTEM__h #define SYSTEM__h -#ifndef _WIN32 - - // Building for a Unix/Linux based system - #include // For memcpy ... - #include // For uintptr_t ... - +#if defined(_WIN64) + typedef long long SYSTEM_INT64; + typedef unsigned long long SYSTEM_CARD64; #else - - // Building for Windows platform with either mingw under cygwin, or the MS C compiler - #ifdef _WIN64 - typedef unsigned long long size_t; - typedef unsigned long long uintptr_t; - #else - typedef unsigned int size_t; - typedef unsigned int uintptr_t; - #endif /* _WIN64 */ - - typedef unsigned int uint32_t; - void * __cdecl memcpy(void * dest, const void * source, size_t size); - + typedef long SYSTEM_INT64; + typedef unsigned long SYSTEM_CARD64; #endif +typedef int SYSTEM_INT32; +typedef unsigned int SYSTEM_CARD32; +typedef short int SYSTEM_INT16; +typedef unsigned short int SYSTEM_CARD16; +typedef signed char SYSTEM_INT8; +typedef unsigned char SYSTEM_CARD8; + +#if (__SIZEOF_POINTER__ == 8) || defined(_WIN64) || defined(__LP64__) + #if defined(_WIN64) + typedef unsigned long long size_t; + #else + typedef unsigned long size_t; + #endif +#else + typedef unsigned int size_t; +#endif + +#define SYSTEM_ADDRESS size_t +#define _SIZE_T_DECLARED // For FreeBSD +#define _SIZE_T_DEFINED_ // For OpenBSD + +void *memcpy(void *dest, const void *source, SYSTEM_ADDRESS size); + + // The compiler uses 'import' and 'export' which translate to 'extern' and // nothing respectively. @@ -70,6 +80,7 @@ typedef unsigned char U_SHORTINT; #endif typedef U_LONGINT SET; +typedef U_LONGINT U_SET; // OS Memory allocation interfaces are in PlatformXXX.Mod @@ -96,10 +107,10 @@ extern LONGINT SYSTEM_ENTIER (double x); // Signal handling in SYSTEM.c #ifndef _WIN32 - extern void SystemSetHandler(int s, uintptr_t h); + extern void SystemSetHandler(int s, SYSTEM_ADDRESS h); #else - extern void SystemSetInterruptHandler(uintptr_t h); - extern void SystemSetQuitHandler (uintptr_t h); + extern void SystemSetInterruptHandler(SYSTEM_ADDRESS h); + extern void SystemSetQuitHandler (SYSTEM_ADDRESS h); #endif @@ -122,20 +133,20 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __COPY(s, d, n) {char*_a=(void*)s,*_b=(void*)d; LONGINT _i=0,_t=n-1; \ while(_i<_t&&((_b[_i]=_a[_i])!=0)){_i++;};_b[_i]=0;} -#define __DUP(x, l, t) x=(void*)memcpy((void*)(uintptr_t)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) +#define __DUP(x, l, t) x=(void*)memcpy((void*)(SYSTEM_ADDRESS)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) #define __DUPARR(v, t) v=(void*)memcpy(v##__copy,v,sizeof(t)) -#define __DEL(x) Platform_OSFree((LONGINT)(uintptr_t)x) +#define __DEL(x) Platform_OSFree((LONGINT)(SYSTEM_ADDRESS)x) /* 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 + +#define __GET(a, x, t) x= *(t*)(SYSTEM_ADDRESS)(a) +#define __PUT(a, x, t) *(t*)(SYSTEM_ADDRESS)(a)=x #define __LSHL(x, n, t) ((t)((U_##t)(x)<<(n))) #define __LSHR(x, n, t) ((t)((U_##t)(x)>>(n))) @@ -150,7 +161,7 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) #define __BIT(x, n) (*(U_LONGINT*)(x)>>(n)&1) -#define __MOVE(s, d, n) memcpy((char*)(uintptr_t)(d),(char*)(uintptr_t)(s),n) +#define __MOVE(s, d, n) memcpy((char*)(SYSTEM_ADDRESS)(d),(char*)(SYSTEM_ADDRESS)(s),n) #define __ASHF(x, n) SYSTEM_ASH((LONGINT)(x), (LONGINT)(n)) #define __SHORT(x, y) ((int)((U_LONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) #define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) @@ -211,7 +222,7 @@ extern void Heap_INCREF(); extern void Platform_Init(INTEGER argc, LONGINT argv); extern void Heap_FINALL(); -#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (LONGINT)(uintptr_t)&argv); +#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (LONGINT)(SYSTEM_ADDRESS)&argv); #define __REGMAIN(name, enum) m = Heap_REGMOD((CHAR*)name,enum) #define __FINI Heap_FINALL(); return 0 @@ -232,7 +243,7 @@ extern SYSTEM_PTR Heap_NEWREC (LONGINT tag); extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __SYSNEW(p, len) p = Heap_NEWBLK((LONGINT)(len)) -#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(uintptr_t)t##__typ) +#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(SYSTEM_ADDRESS)t##__typ) #define __NEWARR SYSTEM_NEWARR @@ -263,20 +274,20 @@ extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __INITYP(t, t0, level) \ t##__typ = (LONGINT*)&t##__desc.blksz; \ memcpy(t##__desc.basep, t0##__typ - __BASEOFF, level*sizeof(LONGINT)); \ - t##__desc.basep[level] = (LONGINT)(uintptr_t)t##__typ; \ - t##__desc.module = (LONGINT)(uintptr_t)m; \ + t##__desc.basep[level] = (LONGINT)(SYSTEM_ADDRESS)t##__typ; \ + t##__desc.module = (LONGINT)(SYSTEM_ADDRESS)m; \ if(t##__desc.blksz!=sizeof(struct t)) __HALT(-15); \ t##__desc.blksz = (t##__desc.blksz+5*sizeof(LONGINT)-1)/(4*sizeof(LONGINT))*(4*sizeof(LONGINT)); \ - Heap_REGTYP(m, (LONGINT)(uintptr_t)&t##__desc.next); \ + Heap_REGTYP(m, (LONGINT)(SYSTEM_ADDRESS)&t##__desc.next); \ SYSTEM_INHERIT(t##__typ, t0##__typ) -#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(uintptr_t)typ##__typ) -#define __TYPEOF(p) ((LONGINT*)(uintptr_t)(*(((LONGINT*)(p))-1))) +#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(SYSTEM_ADDRESS)typ##__typ) +#define __TYPEOF(p) ((LONGINT*)(SYSTEM_ADDRESS)(*(((LONGINT*)(p))-1))) #define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) // Oberon-2 type bound procedures support -#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(uintptr_t)proc -#define __SEND(typ, num, funtyp, parlist) ((funtyp)((uintptr_t)*(typ-(__TPROC0OFF+num))))parlist +#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(SYSTEM_ADDRESS)proc +#define __SEND(typ, num, funtyp, parlist) ((funtyp)((SYSTEM_ADDRESS)*(typ-(__TPROC0OFF+num))))parlist diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index 962b86a0..20a14540 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -22,7 +22,7 @@ INTEGER Strings_Length (CHAR *s, LONGINT s__len) INTEGER i; __DUP(s, s__len, CHAR); i = 0; - while (((LONGINT)i < s__len && s[__X(i, s__len)] != 0x00)) { + while (((SYSTEM_INT64)i < s__len && s[__X(i, s__len)] != 0x00)) { i += 1; } _o_result = i; @@ -37,11 +37,11 @@ void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__ n1 = Strings_Length(dest, dest__len); n2 = Strings_Length(extra, extra__len); i = 0; - while ((i < n2 && (LONGINT)(i + n1) < dest__len)) { + while ((i < n2 && (SYSTEM_INT64)(i + n1) < dest__len)) { dest[__X(i + n1, dest__len)] = extra[__X(i, extra__len)]; i += 1; } - if ((LONGINT)(i + n1) < dest__len) { + if ((SYSTEM_INT64)(i + n1) < dest__len) { dest[__X(i + n1, dest__len)] = 0x00; } __DEL(extra); @@ -60,10 +60,10 @@ void Strings_Insert (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, Strings_Append(dest, dest__len, (void*)source, source__len); return; } - if ((LONGINT)(pos + n2) < dest__len) { + if ((SYSTEM_INT64)(pos + n2) < dest__len) { i = n1; while (i >= pos) { - if ((LONGINT)(i + n2) < dest__len) { + if ((SYSTEM_INT64)(i + n2) < dest__len) { dest[__X(i + n2, dest__len)] = dest[__X(i, dest__len)]; } i -= 1; @@ -92,7 +92,7 @@ void Strings_Delete (CHAR *s, LONGINT s__len, INTEGER pos, INTEGER n) s[__X(i - n, s__len)] = s[__X(i, s__len)]; i += 1; } - if ((LONGINT)(i - n) < s__len) { + if ((SYSTEM_INT64)(i - n) < s__len) { s[__X(i - n, s__len)] = 0x00; } } else { @@ -122,7 +122,7 @@ void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n, return; } i = 0; - while (((((LONGINT)(pos + i) <= source__len && source[__X(pos + i, source__len)] != 0x00)) && i < n)) { + while (((((SYSTEM_INT64)(pos + i) <= source__len && source[__X(pos + i, source__len)] != 0x00)) && i < n)) { if (i < destLen) { dest[__X(i, dest__len)] = source[__X(pos + i, source__len)]; } diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index 549337ee..d64d3478 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index fe673ac8..a1fb81c0 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Files.h" @@ -788,9 +788,9 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) (*S).s[__X(i, ((LONGINT)(64)))] = 0x00; (*S).len = i; (*S).class = 1; - } else if (ch == '\"') { + } else if (ch == '"') { Texts_Read((void*)&*S, S__typ, &ch); - while ((((ch != '\"' && ch >= ' ')) && i != 63)) { + while ((((ch != '"' && ch >= ' ')) && i != 63)) { (*S).s[__X(i, ((LONGINT)(64)))] = ch; i += 1; Texts_Read((void*)&*S, S__typ, &ch); @@ -840,7 +840,7 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) k -= 16; } while (j < i) { - k = __ASHL(k, 4) + (LONGINT)((int)d[__X(j, ((LONGINT)(32)))] - 48); + k = __ASHL(k, 4) + (SYSTEM_INT64)((int)d[__X(j, ((LONGINT)(32)))] - 48); j += 1; } if (neg) { @@ -930,7 +930,7 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) (*S).class = 3; k = 0; do { - k = k * 10 + (LONGINT)((int)d[__X(j, ((LONGINT)(32)))] - 48); + k = k * 10 + (SYSTEM_INT64)((int)d[__X(j, ((LONGINT)(32)))] - 48); j += 1; } while (!(j == i)); if (neg) { @@ -1068,7 +1068,7 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n) x0 = __DIV(x0, 10); i += 1; } while (!(x0 == 0)); - while (n > (LONGINT)i) { + while (n > (SYSTEM_INT64)i) { Texts_Write(&*W, W__typ, ' '); n -= 1; } @@ -1320,7 +1320,7 @@ void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER } else { Texts_Write(&*W, W__typ, ' '); } - e = (int)__ASHR((LONGINT)(e - 1023) * 77, 8); + e = (int)__ASHR((SYSTEM_INT64)(e - 1023) * 77, 8); if (e >= 0) { x = x / (LONGREAL)Reals_TenL(e); } else { diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index dcee9f40..bca5665d 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/Vishap.c b/bootstrap/unix-88/Vishap.c index ccb3e59e..6eda4f2c 100644 --- a/bootstrap/unix-88/Vishap.c +++ b/bootstrap/unix-88/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkamSf */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/unix-88/errors.c b/bootstrap/unix-88/errors.c index 9b9ec275..48246ffa 100644 --- a/bootstrap/unix-88/errors.c +++ b/bootstrap/unix-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -26,7 +26,7 @@ export void *errors__init(void) errors_errors[6][0] = 0x00; errors_errors[7][0] = 0x00; errors_errors[8][0] = 0x00; - __MOVE("\'=\' expected", errors_errors[9], 13); + __MOVE("'=' expected", errors_errors[9], 13); errors_errors[10][0] = 0x00; errors_errors[11][0] = 0x00; __MOVE("type definition starts with incorrect symbol", errors_errors[12], 45); @@ -35,28 +35,28 @@ export void *errors__init(void) __MOVE("declaration followed by incorrect symbol", errors_errors[15], 41); __MOVE("MODULE expected", errors_errors[16], 16); errors_errors[17][0] = 0x00; - __MOVE("\'.\' missing", errors_errors[18], 12); - __MOVE("\',\' missing", errors_errors[19], 12); - __MOVE("\':\' missing", errors_errors[20], 12); + __MOVE("'.' missing", errors_errors[18], 12); + __MOVE("',' missing", errors_errors[19], 12); + __MOVE("':' missing", errors_errors[20], 12); errors_errors[21][0] = 0x00; - __MOVE("\')\' missing", errors_errors[22], 12); - __MOVE("\']\' missing", errors_errors[23], 12); - __MOVE("\'}\' missing", errors_errors[24], 12); + __MOVE("')' missing", errors_errors[22], 12); + __MOVE("']' missing", errors_errors[23], 12); + __MOVE("'}' missing", errors_errors[24], 12); __MOVE("OF missing", errors_errors[25], 11); __MOVE("THEN missing", errors_errors[26], 13); __MOVE("DO missing", errors_errors[27], 11); __MOVE("TO missing", errors_errors[28], 11); errors_errors[29][0] = 0x00; - __MOVE("\'(\' missing", errors_errors[30], 12); + __MOVE("'(' missing", errors_errors[30], 12); errors_errors[31][0] = 0x00; errors_errors[32][0] = 0x00; errors_errors[33][0] = 0x00; - __MOVE("\':=\' missing", errors_errors[34], 13); - __MOVE("\',\' or OF expected", errors_errors[35], 19); + __MOVE("':=' missing", errors_errors[34], 13); + __MOVE("',' or OF expected", errors_errors[35], 19); errors_errors[36][0] = 0x00; errors_errors[37][0] = 0x00; __MOVE("identifier expected", errors_errors[38], 20); - __MOVE("\';\' missing", errors_errors[39], 12); + __MOVE("';' missing", errors_errors[39], 12); errors_errors[40][0] = 0x00; __MOVE("END missing", errors_errors[41], 12); errors_errors[42][0] = 0x00; @@ -132,10 +132,10 @@ export void *errors__init(void) __MOVE("operand is not a variable", errors_errors[112], 26); __MOVE("incompatible assignment", errors_errors[113], 24); __MOVE("string too long to be assigned", errors_errors[114], 31); - __MOVE("parameter doesn\'t match", errors_errors[115], 24); - __MOVE("number of parameters doesn\'t match", errors_errors[116], 35); - __MOVE("result type doesn\'t match", errors_errors[117], 26); - __MOVE("export mark doesn\'t match with forward declaration", errors_errors[118], 51); + __MOVE("parameter doesn't match", errors_errors[115], 24); + __MOVE("number of parameters doesn't match", errors_errors[116], 35); + __MOVE("result type doesn't match", errors_errors[117], 26); + __MOVE("export mark doesn't match with forward declaration", errors_errors[118], 51); __MOVE("redefinition textually precedes procedure bound to base type", errors_errors[119], 61); __MOVE("type of expression following IF, WHILE, UNTIL or ASSERT is not BOOLEAN", errors_errors[120], 71); __MOVE("called object is not a procedure (or is an interrupt procedure)", errors_errors[121], 64); @@ -195,5 +195,6 @@ export void *errors__init(void) __MOVE("implicit type cast", errors_errors[301], 19); __MOVE("inappropriate symbol file ignored", errors_errors[306], 34); __MOVE("no ELSE symbol after CASE statement sequence may lead to trap", errors_errors[307], 62); + __MOVE("SYSTEM.VAL result includes memory past end of source variable", errors_errors[308], 62); __ENDMOD; } diff --git a/bootstrap/unix-88/errors.h b/bootstrap/unix-88/errors.h index fdf34cf1..9081238a 100644 --- a/bootstrap/unix-88/errors.h +++ b/bootstrap/unix-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index 521538ae..4005b0a6 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index de353aeb..6ac1ab91 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/vt100.c b/bootstrap/unix-88/vt100.c index 1b8568fe..a9110e8a 100644 --- a/bootstrap/unix-88/vt100.c +++ b/bootstrap/unix-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Console.h" @@ -253,7 +253,7 @@ export void *vt100__init(void) __REGCMD("RCP", vt100_RCP); __REGCMD("SCP", vt100_SCP); /* BEGIN */ - __COPY("", vt100_CSI, ((LONGINT)(5))); + __COPY("\033", vt100_CSI, ((LONGINT)(5))); Strings_Append((CHAR*)"[", (LONGINT)2, (void*)vt100_CSI, ((LONGINT)(5))); __ENDMOD; } diff --git a/bootstrap/unix-88/vt100.h b/bootstrap/unix-88/vt100.h index 2d276238..801bc8f9 100644 --- a/bootstrap/unix-88/vt100.h +++ b/bootstrap/unix-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index 1f5afbb7..821dff97 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -13,6 +13,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/08/24] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/08/23] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index eef3a15d..ec5e865a 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Console.c b/bootstrap/windows-48/Console.c index b1cc9707..ebd86b8d 100644 --- a/bootstrap/windows-48/Console.c +++ b/bootstrap/windows-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Platform.h" @@ -21,7 +21,7 @@ export void Console_String (CHAR *s, LONGINT s__len); void Console_Flush (void) { INTEGER error; - error = Platform_Write(Platform_StdOut, (LONGINT)(uintptr_t)Console_line, Console_pos); + error = Platform_Write(Platform_StdOut, (LONGINT)(SYSTEM_ADDRESS)Console_line, Console_pos); Console_pos = 0; } diff --git a/bootstrap/windows-48/Console.h b/bootstrap/windows-48/Console.h index 53dbdfa8..5fdd4e4d 100644 --- a/bootstrap/windows-48/Console.h +++ b/bootstrap/windows-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 49be5f7c..1f3a8e9c 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" @@ -257,7 +257,7 @@ static void Files_Flush (Files_Buffer buf) if (buf->org != f->pos) { error = Platform_Seek(f->fd, buf->org, Platform_SeekSet); } - error = Platform_Write(f->fd, (LONGINT)(uintptr_t)buf->data, buf->size); + error = Platform_Write(f->fd, (LONGINT)(SYSTEM_ADDRESS)buf->data, buf->size); if (error != 0) { Files_Err((CHAR*)"error writing file", (LONGINT)19, f, error); } @@ -656,7 +656,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x } else { min = n; } - __MOVE((LONGINT)(uintptr_t)buf->data + offset, (LONGINT)(uintptr_t)x + xpos, min); + __MOVE((LONGINT)(SYSTEM_ADDRESS)buf->data + offset, (LONGINT)(SYSTEM_ADDRESS)x + xpos, min); offset += min; (*r).offset = offset; xpos += min; @@ -721,7 +721,7 @@ void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT } else { min = n; } - __MOVE((LONGINT)(uintptr_t)x + xpos, (LONGINT)(uintptr_t)buf->data + offset, min); + __MOVE((LONGINT)(SYSTEM_ADDRESS)x + xpos, (LONGINT)(SYSTEM_ADDRESS)buf->data + offset, min); offset += min; (*r).offset = offset; if (offset > buf->size) { @@ -772,15 +772,15 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT *res = 3; return; } - error = Platform_Read(fdold, (LONGINT)(uintptr_t)buf, ((LONGINT)(4096)), &n); + error = Platform_Read(fdold, (LONGINT)(SYSTEM_ADDRESS)buf, ((LONGINT)(4096)), &n); while (n > 0) { - error = Platform_Write(fdnew, (LONGINT)(uintptr_t)buf, n); + error = Platform_Write(fdnew, (LONGINT)(SYSTEM_ADDRESS)buf, n); if (error != 0) { ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); Files_Err((CHAR*)"cannot move file", (LONGINT)17, NIL, error); } - error = Platform_Read(fdold, (LONGINT)(uintptr_t)buf, ((LONGINT)(4096)), &n); + error = Platform_Read(fdold, (LONGINT)(SYSTEM_ADDRESS)buf, ((LONGINT)(4096)), &n); } ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); @@ -838,7 +838,7 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *de j += 1; } } else { - __MOVE((LONGINT)(uintptr_t)src, (LONGINT)(uintptr_t)dest, src__len); + __MOVE((LONGINT)(SYSTEM_ADDRESS)src, (LONGINT)(SYSTEM_ADDRESS)dest, src__len); } } @@ -858,14 +858,16 @@ void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, LONGINT *x) { CHAR b[4]; Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); - *x = ((LONGINT)((int)b[0] + __ASHL((int)b[1], 8)) + __ASHL((LONGINT)b[2], 16)) + __ASHL((LONGINT)b[3], 24); + *x = ((int)((int)b[0] + __ASHL((int)b[1], 8)) + __ASHL((int)b[2], 16)) + __ASHL((int)b[3], 24); } void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x) { CHAR b[4]; + LONGINT l; Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); - *x = (SET)(((LONGINT)((int)b[0] + __ASHL((int)b[1], 8)) + __ASHL((LONGINT)b[2], 16)) + __ASHL((LONGINT)b[3], 24)); + l = ((int)((int)b[0] + __ASHL((int)b[1], 8)) + __ASHL((int)b[2], 16)) + __ASHL((int)b[3], 24); + *x = (SET)l; } void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x) @@ -921,11 +923,11 @@ void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, LONGINT *x) n = 0; Files_Read(&*R, R__typ, (void*)&ch); while ((int)ch >= 128) { - n += __ASH((LONGINT)((int)ch - 128), s); + n += __ASH((int)((int)ch - 128), s); s += 7; Files_Read(&*R, R__typ, (void*)&ch); } - n += __ASH((LONGINT)(__MASK((int)ch, -64) - __ASHL(__ASHR((int)ch, 6), 6)), s); + n += __ASH((int)(__MASK((int)ch, -64) - __ASHL(__ASHR((int)ch, 6), 6)), s); *x = n; } @@ -1006,7 +1008,7 @@ static void Files_Finalize (SYSTEM_PTR o) { Files_File f = NIL; LONGINT res; - f = (Files_File)(uintptr_t)o; + f = (Files_File)(SYSTEM_ADDRESS)o; if (f->fd >= 0) { Files_CloseOSFile(f); if (f->tempFile) { diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index 10a35cd2..868f24df 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index 4cabf8c6..30ec687a 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tskSfF */ #include "SYSTEM.h" struct Heap__1 { @@ -101,7 +101,7 @@ export void Heap_Unlock (void); extern void *Heap__init(); extern LONGINT Platform_MainStackFrame; extern LONGINT Platform_OSAllocate(LONGINT size); -#define Heap_FetchAddress(pointer) (LONGINT)(uintptr_t)(*((void**)((uintptr_t)pointer))) +#define Heap_FetchAddress(pointer) (LONGINT)(SYSTEM_ADDRESS)(*((void**)((SYSTEM_ADDRESS)pointer))) #define Heap_HeapModuleInit() Heap__init() #define Heap_OSAllocate(size) Platform_OSAllocate(size) #define Heap_PlatformHalt(code) Platform_Halt(code) @@ -134,7 +134,7 @@ SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) __COPY(name, m->name, ((LONGINT)(20))); m->refcnt = 0; m->enumPtrs = enumPtrs; - m->next = (Heap_Module)(uintptr_t)Heap_modules; + m->next = (Heap_Module)(SYSTEM_ADDRESS)Heap_modules; Heap_modules = (SYSTEM_PTR)m; _o_result = (void*)m; return _o_result; @@ -315,7 +315,7 @@ SYSTEM_PTR Heap_NEWREC (LONGINT tag) __PUT(adr + 8, 0, LONGINT); Heap_allocated += blksz; Heap_Unlock(); - _o_result = (SYSTEM_PTR)(uintptr_t)(adr + 4); + _o_result = (SYSTEM_PTR)(SYSTEM_ADDRESS)(adr + 4); return _o_result; } @@ -326,12 +326,12 @@ SYSTEM_PTR Heap_NEWBLK (LONGINT size) SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 31, 4), 4); - new = Heap_NEWREC((LONGINT)(uintptr_t)&blksz); - tag = ((LONGINT)(uintptr_t)new + blksz) - 12; + new = Heap_NEWREC((LONGINT)(SYSTEM_ADDRESS)&blksz); + tag = ((LONGINT)(SYSTEM_ADDRESS)new + blksz) - 12; __PUT(tag - 4, 0, LONGINT); __PUT(tag, blksz, LONGINT); __PUT(tag + 4, -4, LONGINT); - __PUT((LONGINT)(uintptr_t)new - 4, tag, LONGINT); + __PUT((LONGINT)(SYSTEM_ADDRESS)new - 4, tag, LONGINT); Heap_Unlock(); _o_result = new; return _o_result; @@ -360,7 +360,7 @@ static void Heap_Mark (LONGINT q) __GET(tag, offset, LONGINT); fld = q + offset; p = Heap_FetchAddress(fld); - __PUT(fld, (SYSTEM_PTR)(uintptr_t)n, SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADDRESS)n, SYSTEM_PTR); } else { fld = q + offset; n = Heap_FetchAddress(fld); @@ -369,7 +369,7 @@ static void Heap_Mark (LONGINT q) if (!__ODD(tagbits)) { __PUT(n - 4, tagbits + 1, LONGINT); __PUT(q - 4, tag + 1, LONGINT); - __PUT(fld, (SYSTEM_PTR)(uintptr_t)p, SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADDRESS)p, SYSTEM_PTR); p = q; q = n; tag = tagbits; @@ -384,7 +384,7 @@ static void Heap_Mark (LONGINT q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((LONGINT)(uintptr_t)p); + Heap_Mark((LONGINT)(SYSTEM_ADDRESS)p); } static void Heap_Scan (void) @@ -553,7 +553,7 @@ static void Heap_Finalize (void) } else { prev->next = n->next; } - (*n->finalize)((SYSTEM_PTR)(uintptr_t)n->obj); + (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADDRESS)n->obj); if (prev == NIL) { n = Heap_fin; } else { @@ -572,7 +572,7 @@ void Heap_FINALL (void) while (Heap_fin != NIL) { n = Heap_fin; Heap_fin = Heap_fin->next; - (*n->finalize)((SYSTEM_PTR)(uintptr_t)n->obj); + (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADDRESS)n->obj); } } @@ -589,9 +589,9 @@ static void Heap_MarkStack (LONGINT n, LONGINT *cand, LONGINT cand__len) } if (n == 0) { nofcand = 0; - sp = (LONGINT)(uintptr_t)&frame; + sp = (LONGINT)(SYSTEM_ADDRESS)&frame; stack0 = Heap_PlatformMainStackFrame(); - inc = (LONGINT)(uintptr_t)&align.p - (LONGINT)(uintptr_t)&align; + inc = (LONGINT)(SYSTEM_ADDRESS)&align.p - (LONGINT)(SYSTEM_ADDRESS)&align; if (sp > stack0) { inc = -inc; } @@ -622,7 +622,7 @@ void Heap_GC (BOOLEAN markStack) LONGINT cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); - m = (Heap_Module)(uintptr_t)Heap_modules; + m = (Heap_Module)(SYSTEM_ADDRESS)Heap_modules; while (m != NIL) { if (m->enumPtrs != NIL) { (*m->enumPtrs)(Heap_MarkP); @@ -699,7 +699,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (LONGINT)(uintptr_t)obj; + f->obj = (LONGINT)(SYSTEM_ADDRESS)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index 38e549be..a2cab30c 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index d5164a2a..330b7506 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Heap.h" diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index 5e27b653..ac8ac89e 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index d834a9e8..0f614e6a 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" @@ -34,7 +34,9 @@ export void OPB_In (OPT_Node *x, OPT_Node y); export void OPB_Index (OPT_Node *x, OPT_Node y); export void OPB_Inittd (OPT_Node *inittd, OPT_Node *last, OPT_Struct typ); static BOOLEAN OPB_IntToBool (LONGINT i); +static OPT_Struct OPB_IntType (LONGINT size); export void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y); +static LONGINT OPB_LongerSize (LONGINT i); export void OPB_MOp (SHORTINT op, OPT_Node *x); export OPT_Node OPB_NewBoolConst (BOOLEAN boolval); export OPT_Node OPB_NewIntConst (LONGINT intval); @@ -51,6 +53,8 @@ export void OPB_Return (OPT_Node *x, OPT_Object proc); export void OPB_SetElem (OPT_Node *x); static void OPB_SetIntType (OPT_Node node); export void OPB_SetRange (OPT_Node *x, OPT_Node y); +static LONGINT OPB_ShorterSize (LONGINT i); +static INTEGER OPB_SignedByteSize (LONGINT n); export void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno); export void OPB_StPar0 (OPT_Node *par0, INTEGER fctno); export void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno); @@ -90,8 +94,8 @@ OPT_Node OPB_NewLeaf (OPT_Object obj) node = OPT_NewNode(9); break; default: - OPB_err(127); node = OPT_NewNode(0); + OPB_err(127); break; } node->obj = obj; @@ -220,21 +224,68 @@ OPT_Node OPB_EmptySet (void) return _o_result; } +static INTEGER OPB_SignedByteSize (LONGINT n) +{ + INTEGER _o_result; + INTEGER b; + if (n < 0) { + n = -(n + 1); + } + b = 1; + while ((b < 8 && __ASH(n, -(__ASHL(b, 3) - 1)) != 0)) { + b += 1; + } + _o_result = b; + return _o_result; +} + +static LONGINT OPB_ShorterSize (LONGINT i) +{ + LONGINT _o_result; + if (i >= (int)OPM_LIntSize) { + _o_result = OPM_IntSize; + return _o_result; + } else { + _o_result = OPM_SIntSize; + return _o_result; + } + __RETCHK; +} + +static LONGINT OPB_LongerSize (LONGINT i) +{ + LONGINT _o_result; + if (i <= (int)OPM_SIntSize) { + _o_result = OPM_IntSize; + return _o_result; + } else { + _o_result = OPM_LIntSize; + return _o_result; + } + __RETCHK; +} + +static OPT_Struct OPB_IntType (LONGINT size) +{ + OPT_Struct _o_result; + OPT_Struct result = NIL; + if (size <= OPT_sinttyp->size) { + result = OPT_sinttyp; + } else if (size <= OPT_inttyp->size) { + result = OPT_inttyp; + } else { + result = OPT_linttyp; + } + if (size > OPT_linttyp->size) { + OPB_err(203); + } + _o_result = result; + return _o_result; +} + static void OPB_SetIntType (OPT_Node node) { - LONGINT v; - v = node->conval->intval; - if ((OPM_MinSInt <= (LONGINT)v && (LONGINT)v <= OPM_MaxSInt)) { - node->typ = OPT_sinttyp; - } else if ((OPM_MinInt <= (LONGINT)v && (LONGINT)v <= OPM_MaxInt)) { - node->typ = OPT_inttyp; - } else if ((OPM_MinLInt <= v && v <= OPM_MaxLInt)) { - node->typ = OPT_linttyp; - } else { - OPB_err(203); - node->typ = OPT_sinttyp; - node->conval->intval = 1; - } + node->typ = OPB_IntType(OPB_SignedByteSize(node->conval->intval)); } OPT_Node OPB_NewIntConst (LONGINT intval) @@ -378,16 +429,16 @@ void OPB_Field (OPT_Node *x, OPT_Object y) } } -static struct TypTest__57 { +static struct TypTest__61 { OPT_Node *x; OPT_Object *obj; BOOLEAN *guard; - struct TypTest__57 *lnk; -} *TypTest__57_s; + struct TypTest__61 *lnk; +} *TypTest__61_s; -static void GTT__58 (OPT_Struct t0, OPT_Struct t1); +static void GTT__62 (OPT_Struct t0, OPT_Struct t1); -static void GTT__58 (OPT_Struct t0, OPT_Struct t1) +static void GTT__62 (OPT_Struct t0, OPT_Struct t1) { OPT_Node node = NIL; OPT_Struct t = NIL; @@ -400,54 +451,54 @@ static void GTT__58 (OPT_Struct t0, OPT_Struct t1) t1 = t1->BaseTyp; } if (t1 == t0 || t0->form == 0) { - if (*TypTest__57_s->guard) { - OPB_BindNodes(5, NIL, &*TypTest__57_s->x, NIL); - (*TypTest__57_s->x)->readonly = (*TypTest__57_s->x)->left->readonly; + if (*TypTest__61_s->guard) { + OPB_BindNodes(5, NIL, &*TypTest__61_s->x, NIL); + (*TypTest__61_s->x)->readonly = (*TypTest__61_s->x)->left->readonly; } else { node = OPT_NewNode(11); node->subcl = 16; - node->left = *TypTest__57_s->x; - node->obj = *TypTest__57_s->obj; - *TypTest__57_s->x = node; + node->left = *TypTest__61_s->x; + node->obj = *TypTest__61_s->obj; + *TypTest__61_s->x = node; } } else { OPB_err(85); } } else if (t0 != t1) { OPB_err(85); - } else if (!*TypTest__57_s->guard) { - if ((*TypTest__57_s->x)->class == 5) { + } else if (!*TypTest__61_s->guard) { + if ((*TypTest__61_s->x)->class == 5) { node = OPT_NewNode(11); node->subcl = 16; - node->left = *TypTest__57_s->x; - node->obj = *TypTest__57_s->obj; - *TypTest__57_s->x = node; + node->left = *TypTest__61_s->x; + node->obj = *TypTest__61_s->obj; + *TypTest__61_s->x = node; } else { - *TypTest__57_s->x = OPB_NewBoolConst(1); + *TypTest__61_s->x = OPB_NewBoolConst(1); } } } void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) { - struct TypTest__57 _s; + struct TypTest__61 _s; _s.x = x; _s.obj = &obj; _s.guard = &guard; - _s.lnk = TypTest__57_s; - TypTest__57_s = &_s; + _s.lnk = TypTest__61_s; + TypTest__61_s = &_s; if (OPB_NotVar(*x)) { OPB_err(112); } else if ((*x)->typ->form == 13) { if (((*x)->typ->BaseTyp->comp != 4 && (*x)->typ != OPT_sysptrtyp)) { OPB_err(85); } else if (obj->typ->form == 13) { - GTT__58((*x)->typ->BaseTyp, obj->typ->BaseTyp); + GTT__62((*x)->typ->BaseTyp, obj->typ->BaseTyp); } else { OPB_err(86); } } else if (((((*x)->typ->comp == 4 && (*x)->class == 1)) && obj->typ->comp == 4)) { - GTT__58((*x)->typ, obj->typ); + GTT__62((*x)->typ, obj->typ); } else { OPB_err(87); } @@ -456,7 +507,7 @@ void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) } else { (*x)->typ = OPT_booltyp; } - TypTest__57_s = _s.lnk; + TypTest__61_s = _s.lnk; } void OPB_In (OPT_Node *x, OPT_Node y) @@ -469,7 +520,7 @@ void OPB_In (OPT_Node *x, OPT_Node y) } else if ((__IN(f, 0x70) && y->typ->form == 9)) { if ((*x)->class == 7) { k = (*x)->conval->intval; - if (k < 0 || k > (LONGINT)OPM_MaxSet) { + if (k < 0 || k > (int)OPM_MaxSet) { OPB_err(202); } else if (y->class == 7) { (*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval)); @@ -522,13 +573,13 @@ static void OPB_CheckRealType (INTEGER f, INTEGER nr, OPT_Const x) x->intval = -1; } -static struct MOp__28 { - struct MOp__28 *lnk; -} *MOp__28_s; +static struct MOp__30 { + struct MOp__30 *lnk; +} *MOp__30_s; -static OPT_Node NewOp__29 (SHORTINT op, OPT_Struct typ, OPT_Node z); +static OPT_Node NewOp__31 (SHORTINT op, OPT_Struct typ, OPT_Node z); -static OPT_Node NewOp__29 (SHORTINT op, OPT_Struct typ, OPT_Node z) +static OPT_Node NewOp__31 (SHORTINT op, OPT_Struct typ, OPT_Node z) { OPT_Node _o_result; OPT_Node node = NIL; @@ -545,9 +596,9 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) INTEGER f; OPT_Struct typ = NIL; OPT_Node z = NIL; - struct MOp__28 _s; - _s.lnk = MOp__28_s; - MOp__28_s = &_s; + struct MOp__30 _s; + _s.lnk = MOp__30_s; + MOp__30_s = &_s; z = *x; if (z->class == 8 || z->class == 9) { OPB_err(126); @@ -561,7 +612,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->conval->intval = OPB_BoolToInt(!OPB_IntToBool(z->conval->intval)); z->obj = NIL; } else { - z = NewOp__29(op, typ, z); + z = NewOp__31(op, typ, z); } } else { OPB_err(98); @@ -589,7 +640,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } z->obj = NIL; } else { - z = NewOp__29(op, typ, z); + z = NewOp__31(op, typ, z); } } else { OPB_err(97); @@ -610,7 +661,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } z->obj = NIL; } else { - z = NewOp__29(op, typ, z); + z = NewOp__31(op, typ, z); } } else { OPB_err(111); @@ -622,7 +673,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->conval->intval = (int)__CAP((CHAR)z->conval->intval); z->obj = NIL; } else { - z = NewOp__29(op, typ, z); + z = NewOp__31(op, typ, z); } } else { OPB_err(111); @@ -635,7 +686,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->conval->intval = OPB_BoolToInt(__ODD(z->conval->intval)); z->obj = NIL; } else { - z = NewOp__29(op, typ, z); + z = NewOp__31(op, typ, z); } } else { OPB_err(111); @@ -648,7 +699,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) f = 10; } if (z->class < 7 || f == 10) { - z = NewOp__29(op, typ, z); + z = NewOp__31(op, typ, z); } else { OPB_err(127); } @@ -657,7 +708,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) case 25: if ((__IN(f, 0x70) && z->class == 7)) { if ((0 <= z->conval->intval && z->conval->intval <= -1)) { - z = NewOp__29(op, typ, z); + z = NewOp__31(op, typ, z); } else { OPB_err(219); } @@ -674,7 +725,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } } *x = z; - MOp__28_s = _s.lnk; + MOp__30_s = _s.lnk; } static void OPB_CheckPtr (OPT_Node x, OPT_Node y) @@ -865,41 +916,13 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) __GUARDEQP(yval, OPT_ConstDesc) = *xval; } break; - case 4: + case 4: case 5: case 6: if (__IN(g, 0x70)) { - x->typ = y->typ; - } else if (g == 7) { - x->typ = OPT_realtyp; - xval->realval = xval->intval; - } else if (g == 8) { - x->typ = OPT_lrltyp; - xval->realval = xval->intval; - } else { - OPB_err(100); - y->typ = x->typ; - __GUARDEQP(yval, OPT_ConstDesc) = *xval; - } - break; - case 5: - if (g == 4) { - y->typ = OPT_inttyp; - } else if (__IN(g, 0x70)) { - x->typ = y->typ; - } else if (g == 7) { - x->typ = OPT_realtyp; - xval->realval = xval->intval; - } else if (g == 8) { - x->typ = OPT_lrltyp; - xval->realval = xval->intval; - } else { - OPB_err(100); - y->typ = x->typ; - __GUARDEQP(yval, OPT_ConstDesc) = *xval; - } - break; - case 6: - if (__IN(g, 0x70)) { - y->typ = OPT_linttyp; + if (x->typ->size <= y->typ->size) { + x->typ = y->typ; + } else { + x->typ = OPB_IntType(x->typ->size); + } } else if (g == 7) { x->typ = OPT_realtyp; xval->realval = xval->intval; @@ -1178,7 +1201,7 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) OPB_err(203); r = (LONGREAL)1; } - (*x)->conval->intval = __ENTIER(r); + (*x)->conval->intval = (int)__ENTIER(r); OPB_SetIntType(*x); } } @@ -1196,15 +1219,15 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) (*x)->typ = typ; } -static struct Op__38 { +static struct Op__40 { INTEGER *f, *g; - struct Op__38 *lnk; -} *Op__38_s; + struct Op__40 *lnk; +} *Op__40_s; -static void NewOp__39 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y); -static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y); +static void NewOp__41 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y); +static BOOLEAN strings__43 (OPT_Node *x, OPT_Node *y); -static void NewOp__39 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y) +static void NewOp__41 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y) { OPT_Node node = NIL; node = OPT_NewNode(12); @@ -1215,29 +1238,29 @@ static void NewOp__39 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y) *x = node; } -static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) +static BOOLEAN strings__43 (OPT_Node *x, OPT_Node *y) { BOOLEAN _o_result; BOOLEAN ok, xCharArr, yCharArr; - xCharArr = (__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp->form == 3) || *Op__38_s->f == 10; - yCharArr = (__IN((*y)->typ->comp, 0x0c) && (*y)->typ->BaseTyp->form == 3) || *Op__38_s->g == 10; - if ((((xCharArr && *Op__38_s->g == 3)) && (*y)->class == 7)) { + xCharArr = (__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp->form == 3) || *Op__40_s->f == 10; + yCharArr = (__IN((*y)->typ->comp, 0x0c) && (*y)->typ->BaseTyp->form == 3) || *Op__40_s->g == 10; + if ((((xCharArr && *Op__40_s->g == 3)) && (*y)->class == 7)) { OPB_CharToString(*y); - *Op__38_s->g = 10; + *Op__40_s->g = 10; yCharArr = 1; } - if ((((yCharArr && *Op__38_s->f == 3)) && (*x)->class == 7)) { + if ((((yCharArr && *Op__40_s->f == 3)) && (*x)->class == 7)) { OPB_CharToString(*x); - *Op__38_s->f = 10; + *Op__40_s->f = 10; xCharArr = 1; } ok = (xCharArr && yCharArr); if (ok) { - if ((*Op__38_s->f == 10 && (*x)->conval->intval2 == 1)) { + if ((*Op__40_s->f == 10 && (*x)->conval->intval2 == 1)) { (*x)->typ = OPT_chartyp; (*x)->conval->intval = 0; OPB_Index(&*y, OPB_NewIntConst(((LONGINT)(0)))); - } else if ((*Op__38_s->g == 10 && (*y)->conval->intval2 == 1)) { + } else if ((*Op__40_s->g == 10 && (*y)->conval->intval2 == 1)) { (*y)->typ = OPT_chartyp; (*y)->conval->intval = 0; OPB_Index(&*x, OPB_NewIntConst(((LONGINT)(0)))); @@ -1254,11 +1277,11 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPT_Struct typ = NIL; BOOLEAN do_; LONGINT val; - struct Op__38 _s; + struct Op__40 _s; _s.f = &f; _s.g = &g; - _s.lnk = Op__38_s; - Op__38_s = &_s; + _s.lnk = Op__40_s; + Op__40_s = &_s; z = *x; if (((z->class == 8 || z->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); @@ -1276,15 +1299,8 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPB_err(100); } break; - case 4: - if (__IN(g, 0x01f0)) { - OPB_Convert(&z, y->typ); - } else { - OPB_err(100); - } - break; - case 5: - if (g == 4) { + case 4: case 5: case 6: + if ((__IN(g, 0x70) && y->typ->size < z->typ->size)) { OPB_Convert(&y, z->typ); } else if (__IN(g, 0x01f0)) { OPB_Convert(&z, y->typ); @@ -1292,15 +1308,6 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPB_err(100); } break; - case 6: - if (__IN(g, 0x70)) { - OPB_Convert(&y, z->typ); - } else if (__IN(g, 0x0180)) { - OPB_Convert(&z, y->typ); - } else { - OPB_err(100); - } - break; case 7: if (__IN(g, 0x70)) { OPB_Convert(&y, z->typ); @@ -1386,7 +1393,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) typ = OPT_undftyp; } if (do_) { - NewOp__39(op, typ, &z, y); + NewOp__41(op, typ, &z, y); } break; case 2: @@ -1405,7 +1412,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPB_err(102); typ = OPT_undftyp; } - NewOp__39(op, typ, &z, y); + NewOp__41(op, typ, &z, y); break; case 3: do_ = 1; @@ -1428,7 +1435,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) typ = OPT_undftyp; } if (do_) { - NewOp__39(op, typ, &z, y); + NewOp__41(op, typ, &z, y); } break; case 4: @@ -1446,7 +1453,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPB_err(104); typ = OPT_undftyp; } - NewOp__39(op, typ, &z, y); + NewOp__41(op, typ, &z, y); break; case 5: if (f == 2) { @@ -1456,7 +1463,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } } else if ((y->class == 7 && OPB_IntToBool(y->conval->intval))) { } else { - NewOp__39(op, typ, &z, y); + NewOp__41(op, typ, &z, y); } } else if (f != 0) { OPB_err(94); @@ -1479,7 +1486,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } } if (do_) { - NewOp__39(op, typ, &z, y); + NewOp__41(op, typ, &z, y); } break; case 7: @@ -1488,7 +1495,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) typ = OPT_undftyp; } if ((!__IN(f, 0x70) || y->class != 7) || y->conval->intval != 0) { - NewOp__39(op, typ, &z, y); + NewOp__41(op, typ, &z, y); } break; case 8: @@ -1499,7 +1506,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } } else if ((y->class == 7 && !OPB_IntToBool(y->conval->intval))) { } else { - NewOp__39(op, typ, &z, y); + NewOp__41(op, typ, &z, y); } } else if (f != 0) { OPB_err(95); @@ -1507,16 +1514,16 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 9: case 10: - if (__IN(f, 0x6bff) || strings__41(&z, &y)) { + if (__IN(f, 0x6bff) || strings__43(&z, &y)) { typ = OPT_booltyp; } else { OPB_err(107); typ = OPT_undftyp; } - NewOp__39(op, typ, &z, y); + NewOp__41(op, typ, &z, y); break; case 11: case 12: case 13: case 14: - if (__IN(f, 0x01f9) || strings__41(&z, &y)) { + if (__IN(f, 0x01f9) || strings__43(&z, &y)) { typ = OPT_booltyp; } else { OPM_LogWLn(); @@ -1525,7 +1532,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPB_err(108); typ = OPT_undftyp; } - NewOp__39(op, typ, &z, y); + NewOp__41(op, typ, &z, y); break; default: OPM_LogWStr((CHAR*)"unhandled case in OPB.Op, op = ", (LONGINT)32); @@ -1535,7 +1542,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } } *x = z; - Op__38_s = _s.lnk; + Op__40_s = _s.lnk; } void OPB_SetRange (OPT_Node *x, OPT_Node y) @@ -1546,13 +1553,13 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y) } else if ((__IN((*x)->typ->form, 0x70) && __IN(y->typ->form, 0x70))) { if ((*x)->class == 7) { k = (*x)->conval->intval; - if (0 > k || k > (LONGINT)OPM_MaxSet) { + if (0 > k || k > (int)OPM_MaxSet) { OPB_err(202); } } if (y->class == 7) { l = y->conval->intval; - if (0 > l || l > (LONGINT)OPM_MaxSet) { + if (0 > l || l > (int)OPM_MaxSet) { OPB_err(202); } } @@ -1582,7 +1589,7 @@ void OPB_SetElem (OPT_Node *x) OPB_err(93); } else if ((*x)->class == 7) { k = (*x)->conval->intval; - if ((0 <= k && k <= (LONGINT)OPM_MaxSet)) { + if ((0 <= k && k <= (int)OPM_MaxSet)) { (*x)->conval->setval = __SETOF(k); } else { OPB_err(202); @@ -1596,8 +1603,9 @@ void OPB_SetElem (OPT_Node *x) static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) { + OPT_Struct y = NIL; INTEGER f, g; - OPT_Struct y = NIL, p = NIL, q = NIL; + OPT_Struct p = NIL, q = NIL; if (OPM_Verbose) { OPM_LogWLn(); OPM_LogWStr((CHAR*)"PROCEDURE CheckAssign", (LONGINT)22); @@ -1627,31 +1635,20 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) case 0: case 10: break; case 1: - if (!__IN(g, 0x1a)) { + if (!((__IN(g, 0x7a) && y->size == 1))) { OPB_err(113); } break; - case 2: case 3: case 4: case 9: + case 2: case 3: case 9: if (g != f) { OPB_err(113); } break; - case 5: - if (!__IN(g, 0x30)) { + case 4: case 5: case 6: + if (!__IN(g, 0x70) || x->size < y->size) { OPB_err(113); } break; - case 6: - if (OPM_LIntSize == 4) { - if (!__IN(g, 0x70)) { - OPB_err(113); - } - } else { - if (!__IN(g, 0x70)) { - OPB_err(113); - } - } - break; case 7: if (!__IN(g, 0xf0)) { OPB_err(113); @@ -1832,14 +1829,8 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) x = OPB_NewIntConst(((LONGINT)(0))); x->typ = OPT_chartyp; break; - case 4: - x = OPB_NewIntConst(OPM_MinSInt); - break; - case 5: - x = OPB_NewIntConst(OPM_MinInt); - break; - case 6: - x = OPB_NewIntConst(OPM_MinLInt); + case 4: case 5: case 6: + x = OPB_NewIntConst(OPM_SignedMinimum(x->typ->size)); break; case 9: x = OPB_NewIntConst(((LONGINT)(0))); @@ -1869,14 +1860,8 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) x = OPB_NewIntConst(((LONGINT)(255))); x->typ = OPT_chartyp; break; - case 4: - x = OPB_NewIntConst(OPM_MaxSInt); - break; - case 5: - x = OPB_NewIntConst(OPM_MaxInt); - break; - case 6: - x = OPB_NewIntConst(OPM_MaxLInt); + case 4: case 5: case 6: + x = OPB_NewIntConst(OPM_SignedMaximum(x->typ->size)); break; case 9: x = OPB_NewIntConst(OPM_MaxSet); @@ -1909,10 +1894,8 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 10: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 5) { - OPB_Convert(&x, OPT_sinttyp); - } else if (f == 6) { - OPB_Convert(&x, OPT_inttyp); + } else if ((__IN(f, 0x70) && x->typ->size > (int)OPM_SIntSize)) { + OPB_Convert(&x, OPB_IntType(OPB_ShorterSize(x->typ->size))); } else if (f == 8) { OPB_Convert(&x, OPT_realtyp); } else { @@ -1922,10 +1905,8 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 11: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 4) { - OPB_Convert(&x, OPT_inttyp); - } else if (f == 5) { - OPB_Convert(&x, OPT_linttyp); + } else if ((__IN(f, 0x70) && x->typ->size < (int)OPM_LIntSize)) { + OPB_Convert(&x, OPB_IntType(OPB_LongerSize(x->typ->size))); } else if (f == 7) { OPB_Convert(&x, OPT_lrltyp); } else if (f == 3) { @@ -1973,7 +1954,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (__IN(f, 0x70)) { - if (f != 6) { + if (x->typ->size != (int)OPM_LIntSize) { OPB_Convert(&x, OPT_linttyp); } } else { @@ -2011,9 +1992,9 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 24: case 25: case 28: case 31: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((x->class == 7 && __IN(f, 0x30))) { + } else if ((((x->class == 7 && __IN(f, 0x70))) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!__IN(f, 0x2040)) { + } else if (!((__IN(x->typ->form, 0x2070) && x->typ->size == (int)OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } @@ -2062,13 +2043,13 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) *par0 = x; } -static struct StPar1__52 { - struct StPar1__52 *lnk; -} *StPar1__52_s; +static struct StPar1__56 { + struct StPar1__56 *lnk; +} *StPar1__56_s; -static OPT_Node NewOp__53 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right); +static OPT_Node NewOp__57 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right); -static OPT_Node NewOp__53 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right) +static OPT_Node NewOp__57 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right) { OPT_Node _o_result; OPT_Node node = NIL; @@ -2085,9 +2066,9 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) INTEGER f, L; OPT_Struct typ = NIL; OPT_Node p = NIL, t = NIL; - struct StPar1__52 _s; - _s.lnk = StPar1__52_s; - StPar1__52_s = &_s; + struct StPar1__56 _s; + _s.lnk = StPar1__56_s; + StPar1__56_s = &_s; p = *par0; f = x->typ->form; switch (fctno) { @@ -2103,7 +2084,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) OPB_err(111); } } - p = NewOp__53(19, fctno, p, x); + p = NewOp__57(19, fctno, p, x); p->typ = OPT_notyp; } break; @@ -2111,10 +2092,10 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (__IN(f, 0x70)) { - if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > (LONGINT)OPM_MaxSet))) { + if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > (int)OPM_MaxSet))) { OPB_err(202); } - p = NewOp__53(19, fctno, p, x); + p = NewOp__57(19, fctno, p, x); } else { OPB_err(111); } @@ -2123,7 +2104,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 17: if (!__IN(f, 0x70) || x->class != 7) { OPB_err(69); - } else if (f == 4) { + } else if (x->typ->size == 1) { L = (int)x->conval->intval; typ = p->typ; while ((L > 0 && __IN(typ->comp, 0x0c))) { @@ -2139,7 +2120,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) p = p->left; x->conval->intval += 1; } - p = NewOp__53(12, 19, p, x); + p = NewOp__57(12, 19, p, x); p->typ = OPT_linttyp; } else { p = x; @@ -2161,7 +2142,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) t = x; x = p; p = t; - p = NewOp__53(19, 18, p, x); + p = NewOp__57(19, 18, p, x); } else { OPB_err(111); } @@ -2187,7 +2168,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) } p->obj = NIL; } else { - p = NewOp__53(12, 17, p, x); + p = NewOp__57(12, 17, p, x); p->typ = OPT_linttyp; } } else { @@ -2218,9 +2199,9 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) OPB_err(111); } else { if (fctno == 22) { - p = NewOp__53(12, 27, p, x); + p = NewOp__57(12, 27, p, x); } else { - p = NewOp__53(12, 28, p, x); + p = NewOp__57(12, 28, p, x); } p->typ = p->left->typ; } @@ -2237,7 +2218,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) x = p; p = t; } - p = NewOp__53(19, fctno, p, x); + p = NewOp__57(19, fctno, p, x); } else { OPB_err(111); } @@ -2247,7 +2228,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (__IN(f, 0x70)) { - p = NewOp__53(12, 26, p, x); + p = NewOp__57(12, 26, p, x); } else { OPB_err(111); } @@ -2257,6 +2238,9 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (((x->class == 8 || x->class == 9) || __IN(f, 0x1401)) || x->typ->comp == 3) { OPB_err(126); } + if (x->typ->size < p->typ->size) { + OPB_err(-308); + } t = OPT_NewNode(11); t->subcl = 29; t->left = x; @@ -2268,7 +2252,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (__IN(f, 0x70)) { - p = NewOp__53(19, 30, p, x); + p = NewOp__57(19, 30, p, x); } else { OPB_err(111); } @@ -2277,9 +2261,9 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 31: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((x->class == 7 && __IN(f, 0x30))) { + } else if ((((x->class == 7 && __IN(f, 0x70))) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!__IN(f, 0x2040)) { + } else if (!((__IN(x->typ->form, 0x2070) && x->typ->size == (int)OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } @@ -2314,7 +2298,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) break; } *par0 = p; - StPar1__52_s = _s.lnk; + StPar1__56_s = _s.lnk; } void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n) @@ -2433,7 +2417,7 @@ static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpa ftyp = ftyp->BaseTyp; atyp = atyp->BaseTyp; if ((fvarpar && ftyp == OPT_bytetyp)) { - if (!__IN(f, 0x0c) || !__IN(atyp->form, 0x1e)) { + if (!__IN(f, 0x0c) || !((__IN(atyp->form, 0x7e) && atyp->size == 1))) { if (__IN(18, OPM_opt)) { OPB_err(-301); } @@ -2516,7 +2500,7 @@ void OPB_Param (OPT_Node ap, OPT_Object fp) OPB_err(111); } } else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 13)) { - } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && __IN(ap->typ->form, 0x18))))) { + } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x7e) && ap->typ->size == 1)))))) { OPB_err(123); } else if ((fp->typ->form == 13 && ap->class == 5)) { OPB_err(123); diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index 4c37f01f..d1c88266 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 417337c0..3abccc9a 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "OPM.h" @@ -16,12 +16,13 @@ static CHAR OPC_BodyNameExt[13]; export void OPC_Align (LONGINT *adr, LONGINT base); export void OPC_Andent (OPT_Struct typ); static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames); -export LONGINT OPC_Base (OPT_Struct typ); +export LONGINT OPC_BaseAlignment (OPT_Struct typ); export OPT_Object OPC_BaseTProc (OPT_Object obj); export void OPC_BegBlk (void); export void OPC_BegStat (void); static void OPC_CProcDefs (OPT_Object obj, INTEGER vis); export void OPC_Case (LONGINT caseVal, INTEGER form); +static void OPC_CharacterLiteral (LONGINT c); export void OPC_Cmp (INTEGER rel); export void OPC_CompleteIdent (OPT_Object obj); export void OPC_Constant (OPT_Const con, INTEGER form); @@ -73,8 +74,10 @@ static void OPC_PutBase (OPT_Struct typ); static void OPC_PutPtrOffsets (OPT_Struct typ, LONGINT adr, LONGINT *cnt); static void OPC_RegCmds (OPT_Object obj); export void OPC_SetInclude (BOOLEAN exclude); +export LONGINT OPC_SizeAlignment (LONGINT size); static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause); static void OPC_Str1 (CHAR *s, LONGINT s__len, LONGINT x); +static void OPC_StringLiteral (CHAR *s, LONGINT s__len, LONGINT l); export void OPC_TDescDecl (OPT_Struct typ); export void OPC_TypeDefs (OPT_Object obj, INTEGER vis); export void OPC_TypeOf (OPT_Object ap); @@ -315,7 +318,7 @@ void OPC_Andent (OPT_Struct typ) static BOOLEAN OPC_Undefined (OPT_Object obj) { BOOLEAN _o_result; - _o_result = (((obj->mnolev >= 0 && obj->linkadr != (LONGINT)(3 + OPM_currFile))) && obj->linkadr != 2) || obj->name[0] == 0x00; + _o_result = obj->name[0] == 0x00 || (((obj->mnolev >= 0 && obj->linkadr != (int)(3 + OPM_currFile))) && obj->linkadr != 2); return _o_result; } @@ -815,14 +818,15 @@ void OPC_TDescDecl (OPT_Struct typ) OPC_Andent(typ); OPC_Str1((CHAR*)", #", (LONGINT)4, typ->n + 1); OPC_Str1((CHAR*)", #) = {__TDFLDS(", (LONGINT)18, OPC_NofPtrs(typ)); - OPM_Write('\"'); + OPM_Write('"'); if (typ->strobj != NIL) { OPM_WriteStringVar((void*)typ->strobj->name, ((LONGINT)(256))); } - OPC_Str1((CHAR*)"\", #), {", (LONGINT)9, typ->size); + OPM_Write('"'); + OPC_Str1((CHAR*)", #), {", (LONGINT)8, typ->size); nofptrs = 0; OPC_PutPtrOffsets(typ, ((LONGINT)(0)), &nofptrs); - OPC_Str1((CHAR*)"#}}", (LONGINT)4, -((nofptrs + 1) * (LONGINT)OPM_LIntSize)); + OPC_Str1((CHAR*)"#}}", (LONGINT)4, -((nofptrs + 1) * (int)OPM_LIntSize)); OPC_EndStat(); } @@ -864,70 +868,37 @@ void OPC_Align (LONGINT *adr, LONGINT base) } } -LONGINT OPC_Base (OPT_Struct typ) +LONGINT OPC_SizeAlignment (LONGINT size) { LONGINT _o_result; - switch (typ->form) { - case 1: - _o_result = 1; - return _o_result; - break; - case 3: - _o_result = OPM_CharAlign; - return _o_result; - break; - case 2: - _o_result = OPM_BoolAlign; - return _o_result; - break; - case 4: - _o_result = OPM_SIntAlign; - return _o_result; - break; - case 5: - _o_result = OPM_IntAlign; - return _o_result; - break; - case 6: - _o_result = OPM_LIntAlign; - return _o_result; - break; - case 7: - _o_result = OPM_RealAlign; - return _o_result; - break; - case 8: - _o_result = OPM_LRealAlign; - return _o_result; - break; - case 9: - _o_result = OPM_SetAlign; - return _o_result; - break; - case 13: - _o_result = OPM_PointerAlign; - return _o_result; - break; - case 14: - _o_result = OPM_ProcAlign; - return _o_result; - break; - case 15: - if (typ->comp == 4) { - _o_result = __MASK(typ->align, -65536); - return _o_result; - } else { - _o_result = OPC_Base(typ->BaseTyp); - return _o_result; - } - break; - default: - OPM_LogWStr((CHAR*)"unhandled case in OPC.Base, typ^form = ", (LONGINT)40); - OPM_LogWNum(typ->form, ((LONGINT)(0))); - OPM_LogWLn(); - break; + LONGINT alignment; + if (size < (int)OPM_Alignment) { + alignment = 1; + while (alignment < size) { + alignment = __ASHL(alignment, 1); + } + } else { + alignment = OPM_Alignment; } - __RETCHK; + _o_result = alignment; + return _o_result; +} + +LONGINT OPC_BaseAlignment (OPT_Struct typ) +{ + LONGINT _o_result; + LONGINT alignment; + if (typ->form == 15) { + if (typ->comp == 4) { + alignment = __MASK(typ->align, -65536); + } else { + alignment = OPC_BaseAlignment(typ->BaseTyp); + } + } else { + alignment = OPC_SizeAlignment(typ->size); + } + _o_result = alignment; + return _o_result; } static void OPC_FillGap (LONGINT gap, LONGINT off, LONGINT align, LONGINT *n, LONGINT *curAlign) @@ -938,11 +909,11 @@ static void OPC_FillGap (LONGINT gap, LONGINT off, LONGINT align, LONGINT *n, LO if ((*curAlign < align && gap - (adr - off) >= align)) { gap -= (adr - off) + align; OPC_BegStat(); - if (align == (LONGINT)OPM_IntSize) { + if (align == (int)OPM_IntSize) { OPM_WriteString((CHAR*)"INTEGER", (LONGINT)8); - } else if (align == (LONGINT)OPM_LIntSize) { + } else if (align == (int)OPM_LIntSize) { OPM_WriteString((CHAR*)"LONGINT", (LONGINT)8); - } else if (align == (LONGINT)OPM_LRealSize) { + } else if (align == (int)OPM_LRealSize) { OPM_WriteString((CHAR*)"LONGREAL", (LONGINT)9); } OPC_Str1((CHAR*)" _prvt#", (LONGINT)8, *n); @@ -981,7 +952,7 @@ static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, LONGINT *off, LONGINT * } } else { adr = *off; - fldAlign = OPC_Base(fld->typ); + fldAlign = OPC_BaseAlignment(fld->typ); OPC_Align(&adr, fldAlign); gap = fld->adr - adr; if (fldAlign > *curAlign) { @@ -1007,7 +978,7 @@ static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, LONGINT *off, LONGINT * } } if (last) { - adr = typ->size - (LONGINT)__ASHR(typ->sysflag, 8); + adr = typ->size - (int)__ASHR(typ->sysflag, 8); if (adr == 0) { gap = 1; } else { @@ -1170,10 +1141,10 @@ static void OPC_Include (CHAR *name, LONGINT name__len) { __DUP(name, name__len, CHAR); OPM_WriteString((CHAR*)"#include ", (LONGINT)10); - OPM_Write('\"'); + OPM_Write('"'); OPM_WriteStringVar((void*)name, name__len); OPM_WriteString((CHAR*)".h", (LONGINT)3); - OPM_Write('\"'); + OPM_Write('"'); OPM_WriteLn(); __DEL(name); } @@ -1238,8 +1209,8 @@ void OPC_GenHdr (OPT_Node n) static void OPC_GenHeaderMsg (void) { INTEGER i; - OPM_WriteString((CHAR*)"/*", (LONGINT)3); - OPM_WriteString((CHAR*)" voc ", (LONGINT)6); + OPM_WriteString((CHAR*)"/* ", (LONGINT)4); + OPM_WriteString((CHAR*)"voc", (LONGINT)4); OPM_Write(' '); OPM_WriteString(Configuration_versionLong, ((LONGINT)(41))); OPM_Write(' '); @@ -1855,26 +1826,56 @@ void OPC_Cmp (INTEGER rel) } } +static void OPC_CharacterLiteral (LONGINT c) +{ + if (c < 32 || c > 126) { + OPM_WriteString((CHAR*)"0x", (LONGINT)3); + OPM_WriteHex(c); + } else { + OPM_Write('\''); + if ((c == 92 || c == 39) || c == 63) { + OPM_Write('\\'); + } + OPM_Write((CHAR)c); + OPM_Write('\''); + } +} + +static void OPC_StringLiteral (CHAR *s, LONGINT s__len, LONGINT l) +{ + LONGINT i; + INTEGER c; + __DUP(s, s__len, CHAR); + OPM_Write('"'); + i = 0; + while (i < l) { + c = (int)s[__X(i, s__len)]; + if (c < 32 || c > 126) { + OPM_Write('\\'); + OPM_Write((CHAR)(48 + __ASHR(c, 6))); + c = __MASK(c, -64); + OPM_Write((CHAR)(48 + __ASHR(c, 3))); + c = __MASK(c, -8); + OPM_Write((CHAR)(48 + c)); + } else { + if ((c == 92 || c == 34) || c == 63) { + OPM_Write('\\'); + } + OPM_Write((CHAR)c); + } + i += 1; + } + OPM_Write('"'); + __DEL(s); +} + void OPC_Case (LONGINT caseVal, INTEGER form) { CHAR ch; OPM_WriteString((CHAR*)"case ", (LONGINT)6); switch (form) { case 3: - ch = (CHAR)caseVal; - if ((ch >= ' ' && ch <= '~')) { - OPM_Write('\''); - if (((ch == '\\' || ch == '\?') || ch == '\'') || ch == '\"') { - OPM_Write('\\'); - OPM_Write(ch); - } else { - OPM_Write(ch); - } - OPM_Write('\''); - } else { - OPM_WriteString((CHAR*)"0x", (LONGINT)3); - OPM_WriteHex(caseVal); - } + OPC_CharacterLiteral(caseVal); break; case 4: case 5: case 6: OPM_WriteInt(caseVal); @@ -1932,8 +1933,7 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim) void OPC_Constant (OPT_Const con, INTEGER form) { - INTEGER i, len; - CHAR ch; + INTEGER i; SET s; LONGINT hex; BOOLEAN skipLeading; @@ -1945,18 +1945,7 @@ void OPC_Constant (OPT_Const con, INTEGER form) OPM_WriteInt(con->intval); break; case 3: - ch = (CHAR)con->intval; - if ((ch >= ' ' && ch <= '~')) { - OPM_Write('\''); - if (((ch == '\\' || ch == '\?') || ch == '\'') || ch == '\"') { - OPM_Write('\\'); - } - OPM_Write(ch); - OPM_Write('\''); - } else { - OPM_WriteString((CHAR*)"0x", (LONGINT)3); - OPM_WriteHex(con->intval); - } + OPC_CharacterLiteral(con->intval); break; case 4: case 5: case 6: OPM_WriteInt(con->intval); @@ -1991,18 +1980,7 @@ void OPC_Constant (OPT_Const con, INTEGER form) } break; case 10: - OPM_Write('\"'); - len = (int)con->intval2 - 1; - i = 0; - while (i < len) { - ch = (*con->ext)[__X(i, ((LONGINT)(256)))]; - if (((ch == '\\' || ch == '\?') || ch == '\'') || ch == '\"') { - OPM_Write('\\'); - } - OPM_Write(ch); - i += 1; - } - OPM_Write('\"'); + OPC_StringLiteral(*con->ext, ((LONGINT)(256)), con->intval2 - 1); break; case 11: OPM_WriteString((CHAR*)"NIL", (LONGINT)4); @@ -2015,74 +1993,74 @@ void OPC_Constant (OPT_Const con, INTEGER form) } } -static struct InitKeywords__47 { +static struct InitKeywords__48 { SHORTINT *n; - struct InitKeywords__47 *lnk; -} *InitKeywords__47_s; + struct InitKeywords__48 *lnk; +} *InitKeywords__48_s; -static void Enter__48 (CHAR *s, LONGINT s__len); +static void Enter__49 (CHAR *s, LONGINT s__len); -static void Enter__48 (CHAR *s, LONGINT s__len) +static void Enter__49 (CHAR *s, LONGINT s__len) { INTEGER h; __DUP(s, s__len, CHAR); h = OPC_PerfectHash((void*)s, s__len); - OPC_hashtab[__X(h, ((LONGINT)(105)))] = *InitKeywords__47_s->n; - __COPY(s, OPC_keytab[__X(*InitKeywords__47_s->n, ((LONGINT)(36)))], ((LONGINT)(9))); - *InitKeywords__47_s->n += 1; + OPC_hashtab[__X(h, ((LONGINT)(105)))] = *InitKeywords__48_s->n; + __COPY(s, OPC_keytab[__X(*InitKeywords__48_s->n, ((LONGINT)(36)))], ((LONGINT)(9))); + *InitKeywords__48_s->n += 1; __DEL(s); } static void OPC_InitKeywords (void) { SHORTINT n, i; - struct InitKeywords__47 _s; + struct InitKeywords__48 _s; _s.n = &n; - _s.lnk = InitKeywords__47_s; - InitKeywords__47_s = &_s; + _s.lnk = InitKeywords__48_s; + InitKeywords__48_s = &_s; n = 0; i = 0; while (i <= 104) { OPC_hashtab[__X(i, ((LONGINT)(105)))] = -1; i += 1; } - Enter__48((CHAR*)"asm", (LONGINT)4); - Enter__48((CHAR*)"auto", (LONGINT)5); - Enter__48((CHAR*)"break", (LONGINT)6); - Enter__48((CHAR*)"case", (LONGINT)5); - Enter__48((CHAR*)"char", (LONGINT)5); - Enter__48((CHAR*)"const", (LONGINT)6); - Enter__48((CHAR*)"continue", (LONGINT)9); - Enter__48((CHAR*)"default", (LONGINT)8); - Enter__48((CHAR*)"do", (LONGINT)3); - Enter__48((CHAR*)"double", (LONGINT)7); - Enter__48((CHAR*)"else", (LONGINT)5); - Enter__48((CHAR*)"enum", (LONGINT)5); - Enter__48((CHAR*)"extern", (LONGINT)7); - Enter__48((CHAR*)"export", (LONGINT)7); - Enter__48((CHAR*)"float", (LONGINT)6); - Enter__48((CHAR*)"for", (LONGINT)4); - Enter__48((CHAR*)"fortran", (LONGINT)8); - Enter__48((CHAR*)"goto", (LONGINT)5); - Enter__48((CHAR*)"if", (LONGINT)3); - Enter__48((CHAR*)"import", (LONGINT)7); - Enter__48((CHAR*)"int", (LONGINT)4); - Enter__48((CHAR*)"long", (LONGINT)5); - Enter__48((CHAR*)"register", (LONGINT)9); - Enter__48((CHAR*)"return", (LONGINT)7); - Enter__48((CHAR*)"short", (LONGINT)6); - Enter__48((CHAR*)"signed", (LONGINT)7); - Enter__48((CHAR*)"sizeof", (LONGINT)7); - Enter__48((CHAR*)"static", (LONGINT)7); - Enter__48((CHAR*)"struct", (LONGINT)7); - Enter__48((CHAR*)"switch", (LONGINT)7); - Enter__48((CHAR*)"typedef", (LONGINT)8); - Enter__48((CHAR*)"union", (LONGINT)6); - Enter__48((CHAR*)"unsigned", (LONGINT)9); - Enter__48((CHAR*)"void", (LONGINT)5); - Enter__48((CHAR*)"volatile", (LONGINT)9); - Enter__48((CHAR*)"while", (LONGINT)6); - InitKeywords__47_s = _s.lnk; + Enter__49((CHAR*)"asm", (LONGINT)4); + Enter__49((CHAR*)"auto", (LONGINT)5); + Enter__49((CHAR*)"break", (LONGINT)6); + Enter__49((CHAR*)"case", (LONGINT)5); + Enter__49((CHAR*)"char", (LONGINT)5); + Enter__49((CHAR*)"const", (LONGINT)6); + Enter__49((CHAR*)"continue", (LONGINT)9); + Enter__49((CHAR*)"default", (LONGINT)8); + Enter__49((CHAR*)"do", (LONGINT)3); + Enter__49((CHAR*)"double", (LONGINT)7); + Enter__49((CHAR*)"else", (LONGINT)5); + Enter__49((CHAR*)"enum", (LONGINT)5); + Enter__49((CHAR*)"extern", (LONGINT)7); + Enter__49((CHAR*)"export", (LONGINT)7); + Enter__49((CHAR*)"float", (LONGINT)6); + Enter__49((CHAR*)"for", (LONGINT)4); + Enter__49((CHAR*)"fortran", (LONGINT)8); + Enter__49((CHAR*)"goto", (LONGINT)5); + Enter__49((CHAR*)"if", (LONGINT)3); + Enter__49((CHAR*)"import", (LONGINT)7); + Enter__49((CHAR*)"int", (LONGINT)4); + Enter__49((CHAR*)"long", (LONGINT)5); + Enter__49((CHAR*)"register", (LONGINT)9); + Enter__49((CHAR*)"return", (LONGINT)7); + Enter__49((CHAR*)"short", (LONGINT)6); + Enter__49((CHAR*)"signed", (LONGINT)7); + Enter__49((CHAR*)"sizeof", (LONGINT)7); + Enter__49((CHAR*)"static", (LONGINT)7); + Enter__49((CHAR*)"struct", (LONGINT)7); + Enter__49((CHAR*)"switch", (LONGINT)7); + Enter__49((CHAR*)"typedef", (LONGINT)8); + Enter__49((CHAR*)"union", (LONGINT)6); + Enter__49((CHAR*)"unsigned", (LONGINT)9); + Enter__49((CHAR*)"void", (LONGINT)5); + Enter__49((CHAR*)"volatile", (LONGINT)9); + Enter__49((CHAR*)"while", (LONGINT)6); + InitKeywords__48_s = _s.lnk; } diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index 52ed8dab..b7d34a07 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h @@ -11,7 +11,7 @@ import void OPC_Align (LONGINT *adr, LONGINT base); import void OPC_Andent (OPT_Struct typ); -import LONGINT OPC_Base (OPT_Struct typ); +import LONGINT OPC_BaseAlignment (OPT_Struct typ); import OPT_Object OPC_BaseTProc (OPT_Object obj); import void OPC_BegBlk (void); import void OPC_BegStat (void); @@ -40,6 +40,7 @@ import void OPC_InitTDesc (OPT_Struct typ); import void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim); import LONGINT OPC_NofPtrs (OPT_Struct typ); import void OPC_SetInclude (BOOLEAN exclude); +import LONGINT OPC_SizeAlignment (LONGINT size); import void OPC_TDescDecl (OPT_Struct typ); import void OPC_TypeDefs (OPT_Object obj, INTEGER vis); import void OPC_TypeOf (OPT_Object ap); diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 8e5add20..bf683e41 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" @@ -14,8 +14,8 @@ typedef static CHAR OPM_SourceFileName[256]; -export INTEGER OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_CharAlign, OPM_BoolAlign, OPM_SIntAlign, OPM_IntAlign, OPM_LIntAlign, OPM_SetAlign, OPM_RealAlign, OPM_LRealAlign, OPM_PointerAlign, OPM_ProcAlign, OPM_RecAlign, OPM_MaxSet; -export LONGINT OPM_MinSInt, OPM_MinInt, OPM_MinLInt, OPM_MaxSInt, OPM_MaxInt, OPM_MaxLInt, OPM_MaxIndex; +export INTEGER OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet; +export LONGINT OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; export LONGINT OPM_curpos, OPM_errpos, OPM_breakpc; @@ -57,7 +57,6 @@ export void OPM_LogWNum (LONGINT i, LONGINT len); export void OPM_LogWStr (CHAR *s, LONGINT s__len); static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len); export void OPM_Mark (INTEGER n, LONGINT pos); -static INTEGER OPM_Min (INTEGER a, INTEGER b); export void OPM_NewSym (CHAR *modName, LONGINT modName__len); export void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); export void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); @@ -65,6 +64,8 @@ export BOOLEAN OPM_OpenPar (void); export void OPM_RegisterNewSym (void); static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt); static void OPM_ShowLine (LONGINT pos); +export LONGINT OPM_SignedMaximum (LONGINT bytecount); +export LONGINT OPM_SignedMinimum (LONGINT bytecount); export void OPM_SymRCh (CHAR *ch); export LONGINT OPM_SymRInt (void); export void OPM_SymRLReal (LONGREAL *lr); @@ -85,7 +86,7 @@ export void OPM_WriteString (CHAR *s, LONGINT s__len); export void OPM_WriteStringVar (CHAR *s, LONGINT s__len); export BOOLEAN OPM_eofSF (void); export void OPM_err (INTEGER n); -static LONGINT OPM_minus (LONGINT i); +static LONGINT OPM_minusop (LONGINT i); static LONGINT OPM_power0 (LONGINT i, LONGINT j); @@ -117,50 +118,38 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) i = 1; while (s[__X(i, s__len)] != 0x00) { switch (s[__X(i, s__len)]) { - case 'e': - *opt = *opt ^ 0x0200; - break; - case 's': - *opt = *opt ^ 0x10; - break; - case 'm': - *opt = *opt ^ 0x0400; - break; - case 'x': - *opt = *opt ^ 0x01; - break; - case 'r': - *opt = *opt ^ 0x04; - break; - case 't': - *opt = *opt ^ 0x08; - break; case 'a': *opt = *opt ^ 0x80; break; - case 'k': - *opt = *opt ^ 0x40; - break; - case 'p': - *opt = *opt ^ 0x20; - break; - case 'S': - *opt = *opt ^ 0x2000; - break; case 'c': *opt = *opt ^ 0x4000; break; - case 'M': - *opt = *opt ^ 0x8000; + case 'e': + *opt = *opt ^ 0x0200; break; case 'f': *opt = *opt ^ 0x010000; break; - case 'F': - *opt = *opt ^ 0x020000; + case 'k': + *opt = *opt ^ 0x40; break; - case 'V': - *opt = *opt ^ 0x040000; + case 'm': + *opt = *opt ^ 0x0400; + break; + case 'p': + *opt = *opt ^ 0x20; + break; + case 'r': + *opt = *opt ^ 0x04; + break; + case 's': + *opt = *opt ^ 0x10; + break; + case 't': + *opt = *opt ^ 0x08; + break; + case 'x': + *opt = *opt ^ 0x01; break; case 'B': if (s[__X(i + 1, s__len)] != 0x00) { @@ -178,6 +167,19 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) __ASSERT(OPM_IntSize == 2 || OPM_IntSize == 4, 0); __ASSERT(OPM_PointerSize == 4 || OPM_PointerSize == 8, 0); __ASSERT(OPM_Alignment == 4 || OPM_Alignment == 8, 0); + Files_SetSearchPath((CHAR*)"", (LONGINT)1); + break; + case 'F': + *opt = *opt ^ 0x020000; + break; + case 'M': + *opt = *opt ^ 0x8000; + break; + case 'S': + *opt = *opt ^ 0x2000; + break; + case 'V': + *opt = *opt ^ 0x040000; break; default: OPM_LogWStr((CHAR*)" warning: option ", (LONGINT)19); @@ -227,17 +229,17 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWLn(); OPM_LogWStr((CHAR*)" x - turn off array indices check", (LONGINT)35); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" a - don\'t check ASSERTs at runtime, use this option in tested production code", (LONGINT)80); + OPM_LogWStr((CHAR*)" a - don't check ASSERTs at runtime, use this option in tested production code", (LONGINT)80); OPM_LogWLn(); OPM_LogWStr((CHAR*)" p - turn off automatic pointer initialization", (LONGINT)48); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" t - don\'t check type guards (use in rare cases such as low-level modules where every cycle counts)", (LONGINT)101); + OPM_LogWStr((CHAR*)" t - don't check type guards (use in rare cases such as low-level modules where every cycle counts)", (LONGINT)101); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" S - don\'t call external assembler/compiler, only generate C code", (LONGINT)67); + OPM_LogWStr((CHAR*)" S - don't call external assembler/compiler, only generate C code", (LONGINT)67); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" c - don\'t call linker", (LONGINT)24); + OPM_LogWStr((CHAR*)" c - don't call linker", (LONGINT)24); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" f - don\'t use color output", (LONGINT)29); + OPM_LogWStr((CHAR*)" f - don't use color output", (LONGINT)29); OPM_LogWLn(); OPM_LogWStr((CHAR*)" F - force writing new symbol file in current directory", (LONGINT)57); OPM_LogWLn(); @@ -540,14 +542,17 @@ void OPM_FPrintSet (LONGINT *fp, SET set) void OPM_FPrintReal (LONGINT *fp, REAL real) { - OPM_FPrint(&*fp, __VAL(LONGINT, real)); + INTEGER i; + LONGINT l; + __GET((LONGINT)(SYSTEM_ADDRESS)&real, l, LONGINT); + OPM_FPrint(&*fp, l); } void OPM_FPrintLReal (LONGINT *fp, LONGREAL lr) { LONGINT l, h; - __GET((LONGINT)(uintptr_t)&lr, l, LONGINT); - __GET((LONGINT)(uintptr_t)&lr + 4, h, LONGINT); + __GET((LONGINT)(SYSTEM_ADDRESS)&lr, l, LONGINT); + __GET((LONGINT)(SYSTEM_ADDRESS)&lr + 4, h, LONGINT); OPM_FPrint(&*fp, l); OPM_FPrint(&*fp, h); } @@ -575,7 +580,7 @@ static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONG __DEL(name); } -static LONGINT OPM_minus (LONGINT i) +static LONGINT OPM_minusop (LONGINT i) { LONGINT _o_result; _o_result = -i; @@ -603,103 +608,62 @@ static void OPM_VerboseListSizes (void) OPM_LogWLn(); OPM_LogWStr((CHAR*)"CHAR ", (LONGINT)14); OPM_LogWNum(OPM_CharSize, ((LONGINT)(4))); - OPM_LogWNum(OPM_CharAlign, ((LONGINT)(5))); OPM_LogWLn(); OPM_LogWStr((CHAR*)"BOOLEAN ", (LONGINT)14); OPM_LogWNum(OPM_BoolSize, ((LONGINT)(4))); - OPM_LogWNum(OPM_BoolAlign, ((LONGINT)(5))); OPM_LogWLn(); OPM_LogWStr((CHAR*)"SHORTINT ", (LONGINT)14); OPM_LogWNum(OPM_SIntSize, ((LONGINT)(4))); - OPM_LogWNum(OPM_SIntAlign, ((LONGINT)(5))); OPM_LogWLn(); OPM_LogWStr((CHAR*)"INTEGER ", (LONGINT)14); OPM_LogWNum(OPM_IntSize, ((LONGINT)(4))); - OPM_LogWNum(OPM_IntAlign, ((LONGINT)(5))); OPM_LogWLn(); OPM_LogWStr((CHAR*)"LONGINT ", (LONGINT)14); OPM_LogWNum(OPM_LIntSize, ((LONGINT)(4))); - OPM_LogWNum(OPM_LIntAlign, ((LONGINT)(5))); OPM_LogWLn(); OPM_LogWStr((CHAR*)"SET ", (LONGINT)14); OPM_LogWNum(OPM_SetSize, ((LONGINT)(4))); - OPM_LogWNum(OPM_SetAlign, ((LONGINT)(5))); OPM_LogWLn(); OPM_LogWStr((CHAR*)"REAL ", (LONGINT)14); OPM_LogWNum(OPM_RealSize, ((LONGINT)(4))); - OPM_LogWNum(OPM_RealAlign, ((LONGINT)(5))); OPM_LogWLn(); OPM_LogWStr((CHAR*)"LONGREAL ", (LONGINT)14); OPM_LogWNum(OPM_LRealSize, ((LONGINT)(4))); - OPM_LogWNum(OPM_LRealAlign, ((LONGINT)(5))); OPM_LogWLn(); OPM_LogWStr((CHAR*)"PTR ", (LONGINT)14); OPM_LogWNum(OPM_PointerSize, ((LONGINT)(4))); - OPM_LogWNum(OPM_PointerAlign, ((LONGINT)(5))); OPM_LogWLn(); OPM_LogWStr((CHAR*)"PROC ", (LONGINT)14); OPM_LogWNum(OPM_ProcSize, ((LONGINT)(4))); - OPM_LogWNum(OPM_ProcAlign, ((LONGINT)(5))); OPM_LogWLn(); OPM_LogWStr((CHAR*)"RECORD ", (LONGINT)14); OPM_LogWNum(OPM_RecSize, ((LONGINT)(4))); - OPM_LogWNum(OPM_RecAlign, ((LONGINT)(5))); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Min shortint ", (LONGINT)14); - OPM_LogWNum(OPM_MinSInt, ((LONGINT)(4))); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Max shortint ", (LONGINT)14); - OPM_LogWNum(OPM_MaxSInt, ((LONGINT)(4))); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Min integer ", (LONGINT)14); - OPM_LogWNum(OPM_MinInt, ((LONGINT)(4))); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Max integer ", (LONGINT)14); - OPM_LogWNum(OPM_MaxInt, ((LONGINT)(4))); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Min longint ", (LONGINT)14); - OPM_LogWNum(OPM_MinLInt, ((LONGINT)(4))); - OPM_LogWLn(); } -static INTEGER OPM_Min (INTEGER a, INTEGER b) +LONGINT OPM_SignedMaximum (LONGINT bytecount) { - INTEGER _o_result; - if (a < b) { - _o_result = a; - return _o_result; - } else { - _o_result = b; - return _o_result; - } - __RETCHK; + LONGINT _o_result; + LONGINT result; + result = 1; + result = __LSH(result, __ASHL(bytecount, 3) - 1, LONGINT); + _o_result = result - 1; + return _o_result; +} + +LONGINT OPM_SignedMinimum (LONGINT bytecount) +{ + LONGINT _o_result; + _o_result = -OPM_SignedMaximum(bytecount) - 1; + return _o_result; } static void OPM_GetProperties (void) { - LONGINT base; OPM_ProcSize = OPM_PointerSize; OPM_LIntSize = __ASHL(OPM_IntSize, 1); OPM_SetSize = OPM_LIntSize; - OPM_CharAlign = OPM_Min(OPM_Alignment, OPM_CharSize); - OPM_BoolAlign = OPM_Min(OPM_Alignment, OPM_BoolSize); - OPM_SIntAlign = OPM_Min(OPM_Alignment, OPM_SIntSize); - OPM_RecAlign = OPM_Min(OPM_Alignment, OPM_RecSize); - OPM_RealAlign = OPM_Min(OPM_Alignment, OPM_RealSize); - OPM_LRealAlign = OPM_Min(OPM_Alignment, OPM_LRealSize); - OPM_PointerAlign = OPM_Min(OPM_Alignment, OPM_PointerSize); - OPM_ProcAlign = OPM_Min(OPM_Alignment, OPM_ProcSize); - OPM_IntAlign = OPM_Min(OPM_Alignment, OPM_IntSize); - OPM_LIntAlign = OPM_Min(OPM_Alignment, OPM_LIntSize); - OPM_SetAlign = OPM_Min(OPM_Alignment, OPM_SetSize); - base = -2; - OPM_MinSInt = __ASH(base, __ASHL(OPM_SIntSize, 3) - 2); - OPM_MaxSInt = OPM_minus(OPM_MinSInt + 1); - OPM_MinInt = __ASH(base, __ASHL(OPM_IntSize, 3) - 2); - OPM_MaxInt = OPM_minus(OPM_MinInt + 1); - OPM_MinLInt = __ASH(base, __ASHL(OPM_LIntSize, 3) - 2); - OPM_MaxLInt = OPM_minus(OPM_MinLInt + 1); if (OPM_RealSize == 4) { OPM_MaxReal = 3.40282346000000e+038; } else if (OPM_RealSize == 8) { @@ -713,7 +677,7 @@ static void OPM_GetProperties (void) OPM_MinReal = -OPM_MaxReal; OPM_MinLReal = -OPM_MaxLReal; OPM_MaxSet = __ASHL(OPM_SetSize, 3) - 1; - OPM_MaxIndex = OPM_MaxLInt; + OPM_MaxIndex = OPM_SignedMaximum(OPM_PointerSize); if (OPM_Verbose) { OPM_VerboseListSizes(); } @@ -875,7 +839,7 @@ void OPM_WriteInt (LONGINT i) { CHAR s[20]; LONGINT i1, k; - if (i == OPM_MinInt || i == OPM_MinLInt) { + if (i == OPM_SignedMinimum(OPM_IntSize) || i == OPM_SignedMinimum(OPM_LIntSize)) { OPM_Write('('); OPM_WriteInt(i + 1); OPM_WriteString((CHAR*)"-1)", (LONGINT)4); @@ -908,13 +872,13 @@ void OPM_WriteReal (LONGREAL r, CHAR suffx) CHAR s[32]; CHAR ch; INTEGER i; - if ((((r < OPM_MaxLInt && r > OPM_MinLInt)) && r == (__ENTIER(r)))) { + if ((((r < OPM_SignedMaximum(OPM_LIntSize) && r > OPM_SignedMinimum(OPM_LIntSize))) && r == ((int)__ENTIER(r)))) { if (suffx == 'f') { OPM_WriteString((CHAR*)"(REAL)", (LONGINT)7); } else { OPM_WriteString((CHAR*)"(LONGREAL)", (LONGINT)11); } - OPM_WriteInt(__ENTIER(r)); + OPM_WriteInt((int)__ENTIER(r)); } else { Texts_OpenWriter(&W, Texts_Writer__typ); if (suffx == 'f') { diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index db46c598..ed914bff 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h @@ -6,8 +6,8 @@ #include "SYSTEM.h" -import INTEGER OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_CharAlign, OPM_BoolAlign, OPM_SIntAlign, OPM_IntAlign, OPM_LIntAlign, OPM_SetAlign, OPM_RealAlign, OPM_LRealAlign, OPM_PointerAlign, OPM_ProcAlign, OPM_RecAlign, OPM_MaxSet; -import LONGINT OPM_MinSInt, OPM_MinInt, OPM_MinLInt, OPM_MaxSInt, OPM_MaxInt, OPM_MaxLInt, OPM_MaxIndex; +import INTEGER OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet; +import LONGINT OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; import LONGINT OPM_curpos, OPM_errpos, OPM_breakpc; @@ -38,6 +38,8 @@ import void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); import void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); import BOOLEAN OPM_OpenPar (void); import void OPM_RegisterNewSym (void); +import LONGINT OPM_SignedMaximum (LONGINT bytecount); +import LONGINT OPM_SignedMinimum (LONGINT bytecount); import void OPM_SymRCh (CHAR *ch); import LONGINT OPM_SymRInt (void); import void OPM_SymRLReal (LONGREAL *lr); diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index ffe3dff2..01d2144d 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPB.h" #include "OPM.h" @@ -438,10 +438,10 @@ static void OPP_TypeDecl (OPT_Struct *typ, OPT_Struct *banned) if (OPP_sym == 38) { OPP_qualident(&id); if (id->mode == 5) { - if (id->typ != *banned) { - *typ = id->typ; - } else { + if (id->typ == *banned) { OPP_err(58); + } else { + *typ = id->typ; } } else { OPP_err(52); @@ -1783,6 +1783,24 @@ void OPP_Module (OPT_Node *prog, SET opt) if (OPP_sym == 63) { OPS_Get(&OPP_sym); } else { + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Unexpected symbol found when MODULE expected:", (LONGINT)46); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" sym: ", (LONGINT)15); + OPM_LogWNum(OPP_sym, ((LONGINT)(1))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" OPS.name: ", (LONGINT)15); + OPM_LogWStr(OPS_name, ((LONGINT)(256))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" OPS.str: ", (LONGINT)15); + OPM_LogWStr(OPS_str, ((LONGINT)(256))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" OPS.numtyp: ", (LONGINT)15); + OPM_LogWNum(OPS_numtyp, ((LONGINT)(1))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" OPS.intval: ", (LONGINT)15); + OPM_LogWNum(OPS_intval, ((LONGINT)(1))); + OPM_LogWLn(); OPP_err(16); } if (OPP_sym == 38) { diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index 40e2def4..bf56b7d7 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index efed04c6..cacf9256 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "OPM.h" @@ -173,7 +173,7 @@ static void OPS_Number (void) OPS_numtyp = 1; if (n <= 2) { while (i < n) { - OPS_intval = __ASHL(OPS_intval, 4) + (LONGINT)Ord__7(dig[i], 1); + OPS_intval = __ASHL(OPS_intval, 4) + (int)Ord__7(dig[i], 1); i += 1; } } else { @@ -188,7 +188,7 @@ static void OPS_Number (void) OPS_intval = -1; } while (i < n) { - OPS_intval = __ASHL(OPS_intval, 4) + (LONGINT)Ord__7(dig[i], 1); + OPS_intval = __ASHL(OPS_intval, 4) + (int)Ord__7(dig[i], 1); i += 1; } } else { @@ -199,8 +199,8 @@ static void OPS_Number (void) while (i < n) { d = Ord__7(dig[i], 0); i += 1; - if (OPS_intval <= __DIV(2147483647 - (LONGINT)d, 10)) { - OPS_intval = OPS_intval * 10 + (LONGINT)d; + if (OPS_intval <= __DIV(2147483647 - (int)d, 10)) { + OPS_intval = OPS_intval * 10 + (int)d; } else { OPS_err(203); } @@ -325,7 +325,7 @@ void OPS_Get (SHORTINT *sym) } } switch (OPS_ch) { - case '\"': case '\'': + case '"': case '\'': OPS_Str(&s); break; case '#': diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index dae6e457..e901bcfc 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 8c943c20..b32d0ebd 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" @@ -849,7 +849,7 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval) conval->intval = 0; break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPT.InConstant(), f = ", (LONGINT)41); + OPM_LogWStr((CHAR*)"unhandled case in InConstant(), f = ", (LONGINT)37); OPM_LogWNum(f, ((LONGINT)(0))); OPM_LogWLn(); break; @@ -1072,7 +1072,7 @@ static void OPT_InStruct (OPT_Struct *typ) OPT_InSign(mno, &(*typ)->BaseTyp, &(*typ)->link); break; default: - OPM_LogWStr((CHAR*)"unhandled case at OPT.InStruct, tag = ", (LONGINT)39); + OPM_LogWStr((CHAR*)"unhandled case at InStruct, tag = ", (LONGINT)35); OPM_LogWNum(tag, ((LONGINT)(0))); OPM_LogWLn(); break; @@ -1175,7 +1175,7 @@ static OPT_Object OPT_InObj (SHORTINT mno) } break; default: - OPM_LogWStr((CHAR*)"unhandled case at OPT.InObj, tag = ", (LONGINT)36); + OPM_LogWStr((CHAR*)"unhandled case at InObj, tag = ", (LONGINT)32); OPM_LogWNum(tag, ((LONGINT)(0))); OPM_LogWLn(); break; @@ -1464,14 +1464,14 @@ static void OPT_OutStr (OPT_Struct typ) OPM_SymWInt(((LONGINT)(18))); break; default: - OPM_LogWStr((CHAR*)"unhandled case at OPT.OutStr, typ^.comp = ", (LONGINT)43); + OPM_LogWStr((CHAR*)"unhandled case at OutStr, typ^.comp = ", (LONGINT)39); OPM_LogWNum(typ->comp, ((LONGINT)(0))); OPM_LogWLn(); break; } break; default: - OPM_LogWStr((CHAR*)"unhandled case at OPT.OutStr, typ^.form = ", (LONGINT)43); + OPM_LogWStr((CHAR*)"unhandled case at OutStr, typ^.form = ", (LONGINT)39); OPM_LogWNum(typ->form, ((LONGINT)(0))); OPM_LogWLn(); break; @@ -1536,7 +1536,7 @@ static void OPT_OutObj (OPT_Object obj) OPT_FPrintErr(obj, 251); break; default: - OPM_LogWStr((CHAR*)"unhandled case at OPT.OutObj, obj^.history = ", (LONGINT)46); + OPM_LogWStr((CHAR*)"unhandled case at OutObj, obj^.history = ", (LONGINT)42); OPM_LogWNum(obj->history, ((LONGINT)(0))); OPM_LogWLn(); break; @@ -1592,7 +1592,7 @@ static void OPT_OutObj (OPT_Object obj) OPT_OutName((void*)obj->name, ((LONGINT)(256))); break; default: - OPM_LogWStr((CHAR*)"unhandled case at OPT.OutObj, obj.mode = ", (LONGINT)42); + OPM_LogWStr((CHAR*)"unhandled case at OutObj, obj.mode = ", (LONGINT)38); OPM_LogWNum(obj->mode, ((LONGINT)(0))); OPM_LogWLn(); break; @@ -1809,6 +1809,7 @@ export void *OPT__init(void) OPT_syslink = OPT_topScope->right; OPT_universe = OPT_topScope; OPT_topScope->right = NIL; + OPT_EnterTyp((CHAR*)"BOOLEAN", 2, OPM_BoolSize, &OPT_booltyp); OPT_EnterTyp((CHAR*)"CHAR", 3, OPM_CharSize, &OPT_chartyp); OPT_EnterTyp((CHAR*)"SET", 9, OPM_SetSize, &OPT_settyp); OPT_EnterTyp((CHAR*)"REAL", 7, OPM_RealSize, &OPT_realtyp); @@ -1816,7 +1817,6 @@ export void *OPT__init(void) OPT_EnterTyp((CHAR*)"LONGINT", 6, OPM_LIntSize, &OPT_linttyp); OPT_EnterTyp((CHAR*)"LONGREAL", 8, OPM_LRealSize, &OPT_lrltyp); OPT_EnterTyp((CHAR*)"SHORTINT", 4, OPM_SIntSize, &OPT_sinttyp); - OPT_EnterTyp((CHAR*)"BOOLEAN", 2, OPM_BoolSize, &OPT_booltyp); OPT_EnterBoolConst((CHAR*)"FALSE", ((LONGINT)(0))); OPT_EnterBoolConst((CHAR*)"TRUE", ((LONGINT)(1))); OPT_EnterProc((CHAR*)"HALT", 0); diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index 45816124..41b3e7ec 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h @@ -59,8 +59,7 @@ typedef INTEGER ref, sysflag; LONGINT n, size, align, txtpos; BOOLEAN allocated, pbused, pvused; - char _prvt0[8]; - LONGINT pbfp, pvfp; + char _prvt0[16]; OPT_Struct BaseTyp; OPT_Object link, strobj; } OPT_StrDesc; diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index 23bff9c0..cf646f5e 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPC.h" #include "OPM.h" @@ -23,7 +23,7 @@ export LONGINT *OPV_ExitInfo__typ; static void OPV_ActualPar (OPT_Node n, OPT_Object fp); export void OPV_AdrAndSize (OPT_Object topScope); static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc); -static void OPV_Convert (OPT_Node n, INTEGER form, INTEGER prec); +static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec); static void OPV_DefineTDescs (OPT_Node n); static void OPV_Entier (OPT_Node n, INTEGER prec); static void OPV_GetTProcNum (OPT_Object obj); @@ -38,6 +38,7 @@ static LONGINT OPV_NaturalAlignment (LONGINT size, LONGINT max); static void OPV_NewArr (OPT_Node d, OPT_Node x); static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, INTEGER comp); static BOOLEAN OPV_SideEffects (OPT_Node n); +static void OPV_SizeCast (LONGINT size); static void OPV_Stamp (OPS_Name s); static OPT_Object OPV_SuperProc (OPT_Node n); static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported); @@ -82,10 +83,10 @@ void OPV_TypSize (OPT_Struct typ) btyp = typ->BaseTyp; if (btyp == NIL) { offset = 0; - base = OPM_RecAlign; + base = OPC_SizeAlignment(OPM_RecSize); } else { OPV_TypSize(btyp); - offset = btyp->size - (LONGINT)__ASHR(btyp->sysflag, 8); + offset = btyp->size - (int)__ASHR(btyp->sysflag, 8); base = btyp->align; } fld = typ->link; @@ -93,7 +94,7 @@ void OPV_TypSize (OPT_Struct typ) btyp = fld->typ; OPV_TypSize(btyp); size = btyp->size; - fbase = OPC_Base(btyp); + fbase = OPC_BaseAlignment(btyp); OPC_Align(&offset, fbase); fld->adr = offset; offset += size; @@ -107,7 +108,7 @@ void OPV_TypSize (OPT_Struct typ) offset = 1; } if (OPM_RecSize == 0) { - base = OPV_NaturalAlignment(offset, OPM_RecAlign); + base = OPV_NaturalAlignment(offset, OPC_SizeAlignment(OPM_RecSize)); } OPC_Align(&offset, base); if ((typ->strobj == NIL && __MASK(typ->align, -65536) == 0)) { @@ -332,7 +333,7 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN return _o_result; break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence Nmop, subclass = ", (LONGINT)51); + OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Nmop, subclass = ", (LONGINT)55); OPM_LogWNum(subclass, ((LONGINT)(0))); OPM_LogWLn(); break; @@ -402,7 +403,7 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN return _o_result; break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence Ndop, subclass = ", (LONGINT)51); + OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Ndop, subclass = ", (LONGINT)55); OPM_LogWNum(subclass, ((LONGINT)(0))); OPM_LogWLn(); break; @@ -465,41 +466,26 @@ static void OPV_Entier (OPT_Node n, INTEGER prec) } } -static void OPV_Convert (OPT_Node n, INTEGER form, INTEGER prec) +static void OPV_SizeCast (LONGINT size) { - INTEGER from; + if (size <= 4) { + OPM_WriteString((CHAR*)"(int)", (LONGINT)6); + } else { + OPM_WriteString((CHAR*)"(SYSTEM_INT64)", (LONGINT)15); + } +} + +static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec) +{ + INTEGER from, to; from = n->typ->form; - if (form == 9) { + to = newtype->form; + if (to == 9) { OPM_WriteString((CHAR*)"__SETOF(", (LONGINT)9); OPV_Entier(n, -1); OPM_Write(')'); - } else if (form == 6) { - if (from < 6) { - OPM_WriteString((CHAR*)"(LONGINT)", (LONGINT)10); - } - OPV_Entier(n, 9); - } else if (form == 5) { - if (from < 5) { - OPM_WriteString((CHAR*)"(int)", (LONGINT)6); - OPV_expr(n, 9); - } else { - if (__IN(2, OPM_opt)) { - OPM_WriteString((CHAR*)"__SHORT", (LONGINT)8); - if (OPV_SideEffects(n)) { - OPM_Write('F'); - } - OPM_Write('('); - OPV_Entier(n, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); - OPM_WriteInt(OPM_MaxInt + 1); - OPM_Write(')'); - } else { - OPM_WriteString((CHAR*)"(int)", (LONGINT)6); - OPV_Entier(n, 9); - } - } - } else if (form == 4) { - if (__IN(2, OPM_opt)) { + } else if (__IN(to, 0x70)) { + if ((newtype->size < n->typ->size && __IN(2, OPM_opt))) { OPM_WriteString((CHAR*)"__SHORT", (LONGINT)8); if (OPV_SideEffects(n)) { OPM_Write('F'); @@ -507,13 +493,15 @@ static void OPV_Convert (OPT_Node n, INTEGER form, INTEGER prec) OPM_Write('('); OPV_Entier(n, -1); OPM_WriteString((CHAR*)", ", (LONGINT)3); - OPM_WriteInt(OPM_MaxSInt + 1); + OPM_WriteInt(OPM_SignedMaximum(newtype->size) + 1); OPM_Write(')'); } else { - OPM_WriteString((CHAR*)"(int)", (LONGINT)6); + if (newtype->size != n->typ->size) { + OPV_SizeCast(newtype->size); + } OPV_Entier(n, 9); } - } else if (form == 3) { + } else if (to == 3) { if (__IN(2, OPM_opt)) { OPM_WriteString((CHAR*)"__CHR", (LONGINT)6); if (OPV_SideEffects(n)) { @@ -576,7 +564,7 @@ static void OPV_design (OPT_Node n, INTEGER prec) OPT_Struct typ = NIL; INTEGER class, designPrec, comp; OPT_Node d = NIL, x = NIL; - INTEGER dims, i, _for__26; + INTEGER dims, i, _for__27; comp = n->typ->comp; obj = n->obj; class = n->class; @@ -652,15 +640,15 @@ static void OPV_design (OPT_Node n, INTEGER prec) } x = x->left; } - _for__26 = dims; + _for__27 = dims; i = 1; - while (i <= _for__26) { + while (i <= _for__27) { OPM_Write(')'); i += 1; } if (n->typ->comp == 3) { OPM_Write(')'); - while ((LONGINT)i < __ASHR(d->typ->size - 4, 2)) { + while ((int)i < __ASHR(d->typ->size - 4, 2)) { OPM_WriteString((CHAR*)" * ", (LONGINT)4); OPV_Len(d, i); i += 1; @@ -795,7 +783,7 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) } if ((((mode == 2 && n->class == 11)) && n->subcl == 29)) { OPV_expr(n->left, prec); - } else if ((((((form == 6 && n->class == 7)) && n->conval->intval <= OPM_MaxInt)) && n->conval->intval >= OPM_MinInt)) { + } else if ((((((form == 6 && n->class == 7)) && n->conval->intval <= OPM_SignedMaximum(OPM_IntSize))) && n->conval->intval >= OPM_SignedMinimum(OPM_IntSize))) { OPM_WriteString((CHAR*)"((LONGINT)(", (LONGINT)12); OPV_expr(n, prec); OPM_WriteString((CHAR*)"))", (LONGINT)3); @@ -914,7 +902,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPM_Write(')'); break; case 20: - OPV_Convert(l, form, exprPrec); + OPV_Convert(l, n->typ, exprPrec); break; case 21: if (OPV_SideEffects(l)) { @@ -943,7 +931,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPM_Write(')'); break; case 24: - OPM_WriteString((CHAR*)"(LONGINT)(uintptr_t)", (LONGINT)21); + OPM_WriteString((CHAR*)"(LONGINT)(SYSTEM_ADDRESS)", (LONGINT)26); if (l->class == 1) { OPC_CompleteIdent(l->obj); } else { @@ -954,20 +942,16 @@ static void OPV_expr (OPT_Node n, INTEGER prec) } break; case 29: - if ((((__IN(n->typ->form, 0x6240) && __IN(l->typ->form, 0x6240))) && n->typ->size == l->typ->size) || !__IN(l->class, 0x17)) { + if (!__IN(l->class, 0x17) || (((__IN(n->typ->form, 0x6240) && __IN(l->typ->form, 0x6240))) && n->typ->size == l->typ->size)) { OPM_Write('('); OPC_Ident(n->typ->strobj); OPM_Write(')'); if (__IN(n->typ->form, 0x6000) || __IN(l->typ->form, 0x6000)) { - OPM_WriteString((CHAR*)"(uintptr_t)", (LONGINT)12); + OPM_WriteString((CHAR*)"(SYSTEM_ADDRESS)", (LONGINT)17); } OPV_expr(l, exprPrec); } else { - if (__IN(n->typ->form, 0x6000) || __IN(l->typ->form, 0x6000)) { - OPM_WriteString((CHAR*)"__VALP(", (LONGINT)8); - } else { - OPM_WriteString((CHAR*)"__VAL(", (LONGINT)7); - } + OPM_WriteString((CHAR*)"__VAL(", (LONGINT)7); OPC_Ident(n->typ->strobj); OPM_WriteString((CHAR*)", ", (LONGINT)3); OPV_expr(l, -1); @@ -1326,7 +1310,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) OPM_WriteInt(base->size); OPM_WriteString((CHAR*)"))", (LONGINT)3); OPM_WriteString((CHAR*)", ", (LONGINT)3); - OPM_WriteInt(OPC_Base(base)); + OPM_WriteInt(OPC_BaseAlignment(base)); OPM_WriteString((CHAR*)", ", (LONGINT)3); OPM_WriteInt(nofdim); OPM_WriteString((CHAR*)", ", (LONGINT)3); diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index 0de9e6cc..04828b2f 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 78bdbf70..4e8b44c8 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef @@ -109,11 +109,11 @@ export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT #define Platform_ERRORWRITEPROTECT() ERROR_WRITE_PROTECT #define Platform_ETIMEDOUT() WSAETIMEDOUT extern void Heap_InitHeap(); -#define Platform_GetTickCount() (LONGINT)(uint32_t)GetTickCount() +#define Platform_GetTickCount() (LONGINT)(SYSTEM_CARD32)GetTickCount() #define Platform_HeapInitHeap() Heap_InitHeap() -#define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((uintptr_t)h) -#define Platform_SetQuitHandler(h) SystemSetQuitHandler((uintptr_t)h) -#define Platform_allocate(size) (LONGINT)(uintptr_t)((void*)HeapAlloc(GetProcessHeap(), 0, (size_t)size)) +#define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((SYSTEM_ADDRESS)h) +#define Platform_SetQuitHandler(h) SystemSetQuitHandler((SYSTEM_ADDRESS)h) +#define Platform_allocate(size) (LONGINT)(SYSTEM_ADDRESS)((void*)HeapAlloc(GetProcessHeap(), 0, (size_t)size)) #define Platform_bhfiIndexHigh() (LONGINT)bhfi.nFileIndexHigh #define Platform_bhfiIndexLow() (LONGINT)bhfi.nFileIndexLow #define Platform_bhfiMtimeHigh() (LONGINT)bhfi.ftLastWriteTime.dwHighDateTime @@ -121,44 +121,44 @@ extern void Heap_InitHeap(); #define Platform_bhfiVsn() (LONGINT)bhfi.dwVolumeSerialNumber #define Platform_byHandleFileInformation() BY_HANDLE_FILE_INFORMATION bhfi #define Platform_cleanupProcess() CloseHandle(pi.hProcess); CloseHandle(pi.hThread); -#define Platform_closeHandle(h) (INTEGER)CloseHandle((HANDLE)(uintptr_t)h) +#define Platform_closeHandle(h) (INTEGER)CloseHandle((HANDLE)(SYSTEM_ADDRESS)h) #define Platform_createProcess(str, str__len) (INTEGER)CreateProcess(0, (char*)str, 0,0,0,0,0,0,&si,&pi) #define Platform_deleteFile(n, n__len) (INTEGER)DeleteFile((char*)n) #define Platform_err() (INTEGER)GetLastError() -#define Platform_errc(c) WriteFile((HANDLE)(uintptr_t)Platform_StdOut, &c, 1, 0,0) -#define Platform_errstring(s, s__len) WriteFile((HANDLE)(uintptr_t)Platform_StdOut, s, s__len-1, 0,0) +#define Platform_errc(c) WriteFile((HANDLE)(SYSTEM_ADDRESS)Platform_StdOut, &c, 1, 0,0) +#define Platform_errstring(s, s__len) WriteFile((HANDLE)(SYSTEM_ADDRESS)Platform_StdOut, s, s__len-1, 0,0) #define Platform_exit(code) ExitProcess((UINT)code) #define Platform_fileTimeToSysTime() SYSTEMTIME st; FileTimeToSystemTime(&ft, &st) -#define Platform_flushFileBuffers(h) (INTEGER)FlushFileBuffers((HANDLE)(uintptr_t)h) -#define Platform_free(address) HeapFree(GetProcessHeap(), 0, (void*)(uintptr_t)address) +#define Platform_flushFileBuffers(h) (INTEGER)FlushFileBuffers((HANDLE)(SYSTEM_ADDRESS)h) +#define Platform_free(address) HeapFree(GetProcessHeap(), 0, (void*)(SYSTEM_ADDRESS)address) #define Platform_ftToUli() ULARGE_INTEGER ul; ul.LowPart=ft.dwLowDateTime; ul.HighPart=ft.dwHighDateTime #define Platform_getCurrentDirectory(n, n__len) GetCurrentDirectory(n__len, (char*)n) #define Platform_getExitCodeProcess(exitcode) GetExitCodeProcess(pi.hProcess, (DWORD*)exitcode); -#define Platform_getFileInformationByHandle(h) (INTEGER)GetFileInformationByHandle((HANDLE)(uintptr_t)h, &bhfi) -#define Platform_getFilePos(h, r, rc) LARGE_INTEGER liz = {0}; *rc = (INTEGER)SetFilePointerEx((HANDLE)(uintptr_t)h, liz, &li, FILE_CURRENT); *r = (LONGINT)li.QuadPart -#define Platform_getFileSize(h) (INTEGER)GetFileSizeEx((HANDLE)(uintptr_t)h, &li) +#define Platform_getFileInformationByHandle(h) (INTEGER)GetFileInformationByHandle((HANDLE)(SYSTEM_ADDRESS)h, &bhfi) +#define Platform_getFilePos(h, r, rc) LARGE_INTEGER liz = {0}; *rc = (INTEGER)SetFilePointerEx((HANDLE)(SYSTEM_ADDRESS)h, liz, &li, FILE_CURRENT); *r = (LONGINT)li.QuadPart +#define Platform_getFileSize(h) (INTEGER)GetFileSizeEx((HANDLE)(SYSTEM_ADDRESS)h, &li) #define Platform_getLocalTime() SYSTEMTIME st; GetLocalTime(&st) #define Platform_getenv(name, name__len, buf, buf__len) (INTEGER)GetEnvironmentVariable((char*)name, (char*)buf, buf__len) #define Platform_getpid() (INTEGER)GetCurrentProcessId() -#define Platform_getstderrhandle() (uintptr_t)GetStdHandle(STD_ERROR_HANDLE) -#define Platform_getstdinhandle() (uintptr_t)GetStdHandle(STD_INPUT_HANDLE) -#define Platform_getstdouthandle() (uintptr_t)GetStdHandle(STD_OUTPUT_HANDLE) +#define Platform_getstderrhandle() (SYSTEM_ADDRESS)GetStdHandle(STD_ERROR_HANDLE) +#define Platform_getstdinhandle() (SYSTEM_ADDRESS)GetStdHandle(STD_INPUT_HANDLE) +#define Platform_getstdouthandle() (SYSTEM_ADDRESS)GetStdHandle(STD_OUTPUT_HANDLE) #define Platform_identityToFileTime(i) FILETIME ft; ft.dwHighDateTime = i.mtimehigh; ft.dwLowDateTime = i.mtimelow -#define Platform_invalidHandleValue() ((LONGINT)(uintptr_t)INVALID_HANDLE_VALUE) +#define Platform_invalidHandleValue() ((LONGINT)(SYSTEM_ADDRESS)INVALID_HANDLE_VALUE) #define Platform_largeInteger() LARGE_INTEGER li #define Platform_liLongint() (LONGINT)li.QuadPart #define Platform_moveFile(o, o__len, n, n__len) (INTEGER)MoveFileEx((char*)o, (char*)n, MOVEFILE_REPLACE_EXISTING) -#define Platform_opennew(n, n__len) (LONGINT)(uintptr_t)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0) -#define Platform_openro(n, n__len) (LONGINT)(uintptr_t)CreateFile((char*)n, GENERIC_READ , FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) -#define Platform_openrw(n, n__len) (LONGINT)(uintptr_t)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) +#define Platform_opennew(n, n__len) (LONGINT)(SYSTEM_ADDRESS)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0) +#define Platform_openro(n, n__len) (LONGINT)(SYSTEM_ADDRESS)CreateFile((char*)n, GENERIC_READ , FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) +#define Platform_openrw(n, n__len) (LONGINT)(SYSTEM_ADDRESS)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) #define Platform_processInfo() PROCESS_INFORMATION pi = {0}; -#define Platform_readfile(fd, p, l, n) (INTEGER)ReadFile ((HANDLE)(uintptr_t)fd, (void*)(uintptr_t)(p), (DWORD)l, (DWORD*)n, 0) +#define Platform_readfile(fd, p, l, n) (INTEGER)ReadFile ((HANDLE)(SYSTEM_ADDRESS)fd, (void*)(SYSTEM_ADDRESS)(p), (DWORD)l, (DWORD*)n, 0) #define Platform_seekcur() FILE_CURRENT #define Platform_seekend() FILE_END #define Platform_seekset() FILE_BEGIN #define Platform_setCurrentDirectory(n, n__len) (INTEGER)SetCurrentDirectory((char*)n) -#define Platform_setEndOfFile(h) (INTEGER)SetEndOfFile((HANDLE)(uintptr_t)h) -#define Platform_setFilePointerEx(h, o, r, rc) li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((HANDLE)(uintptr_t)h, li, 0, (DWORD)r) +#define Platform_setEndOfFile(h) (INTEGER)SetEndOfFile((HANDLE)(SYSTEM_ADDRESS)h) +#define Platform_setFilePointerEx(h, o, r, rc) li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((HANDLE)(SYSTEM_ADDRESS)h, li, 0, (DWORD)r) #define Platform_sleep(ms) Sleep((DWORD)ms) #define Platform_stToFt() FILETIME ft; SystemTimeToFileTime(&st, &ft) #define Platform_startupInfo() STARTUPINFO si = {0}; si.cb = sizeof(si); @@ -173,7 +173,7 @@ extern void Heap_InitHeap(); #define Platform_ulSec() (LONGINT)(ul.QuadPart / 1000000LL) #define Platform_uluSec() (LONGINT)(ul.QuadPart % 1000000LL) #define Platform_waitForProcess() (INTEGER)WaitForSingleObject(pi.hProcess, INFINITE) -#define Platform_writefile(fd, p, l) (INTEGER)WriteFile((HANDLE)(uintptr_t)fd, (void*)(uintptr_t)(p), (DWORD)l, 0,0) +#define Platform_writefile(fd, p, l) (INTEGER)WriteFile((HANDLE)(SYSTEM_ADDRESS)fd, (void*)(SYSTEM_ADDRESS)(p), (DWORD)l, 0,0) BOOLEAN Platform_TooManyFiles (INTEGER e) { @@ -241,7 +241,7 @@ void Platform_Init (INTEGER argc, LONGINT argvadr) Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; Platform_ArgCount = argc; - av = (Platform_ArgVecPtr)(uintptr_t)argvadr; + av = (Platform_ArgVecPtr)(SYSTEM_ADDRESS)argvadr; Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; Platform_HeapInitHeap(); @@ -280,7 +280,7 @@ void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { - av = (Platform_ArgVec)(uintptr_t)Platform_ArgVector; + av = (Platform_ArgVec)(SYSTEM_ADDRESS)Platform_ArgVector; __COPY(*(*av)[__X(n, ((LONGINT)(1024)))], val, val__len); } } @@ -334,8 +334,8 @@ void Platform_SetBadInstructionHandler (Platform_SignalHandler handler) static void Platform_YMDHMStoClock (INTEGER ye, INTEGER mo, INTEGER da, INTEGER ho, INTEGER mi, INTEGER se, LONGINT *t, LONGINT *d) { - *d = (__ASHL((LONGINT)(int)__MOD(ye, 100), 9) + __ASHL((LONGINT)(mo + 1), 5)) + (LONGINT)da; - *t = (__ASHL((LONGINT)ho, 12) + __ASHL((LONGINT)mi, 6)) + (LONGINT)se; + *d = (__ASHL((int)(int)__MOD(ye, 100), 9) + __ASHL((int)(mo + 1), 5)) + (int)da; + *t = (__ASHL((int)ho, 12) + __ASHL((int)mi, 6)) + (int)se; } void Platform_GetClock (LONGINT *t, LONGINT *d) @@ -559,7 +559,7 @@ INTEGER Platform_ReadBuf (LONGINT h, SYSTEM_BYTE *b, LONGINT b__len, LONGINT *n) INTEGER _o_result; INTEGER result; *n = 0; - result = Platform_readfile(h, (LONGINT)(uintptr_t)b, b__len, &*n); + result = Platform_readfile(h, (LONGINT)(SYSTEM_ADDRESS)b, b__len, &*n); if (result == 0) { *n = 0; _o_result = Platform_err(); @@ -795,7 +795,7 @@ static void Platform_TestLittleEndian (void) { INTEGER i; i = 1; - __GET((LONGINT)(uintptr_t)&i, Platform_LittleEndian, BOOLEAN); + __GET((LONGINT)(SYSTEM_ADDRESS)&i, Platform_LittleEndian, BOOLEAN); } __TDESC(Platform_FileIdentity, 1, 0) = {__TDFLDS("FileIdentity", 20), {-4}}; diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index aecbb66c..673b2b0b 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h @@ -78,7 +78,7 @@ import INTEGER Platform_Write (LONGINT h, LONGINT p, LONGINT l); import BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); import void *Platform__init(void); -#define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((uintptr_t)h) -#define Platform_SetQuitHandler(h) SystemSetQuitHandler((uintptr_t)h) +#define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((SYSTEM_ADDRESS)h) +#define Platform_SetQuitHandler(h) SystemSetQuitHandler((SYSTEM_ADDRESS)h) #endif diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 0f1c3a92..2323e34d 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -58,7 +58,7 @@ INTEGER Reals_Expo (REAL x) { INTEGER _o_result; INTEGER i; - __GET((LONGINT)(uintptr_t)&x + 2, i, INTEGER); + __GET((LONGINT)(SYSTEM_ADDRESS)&x + 2, i, INTEGER); _o_result = __MASK(__ASHR(i, 7), -256); return _o_result; } @@ -66,17 +66,17 @@ INTEGER Reals_Expo (REAL x) void Reals_SetExpo (REAL *x, INTEGER ex) { CHAR c; - __GET((LONGINT)(uintptr_t)x + 3, c, CHAR); - __PUT((LONGINT)(uintptr_t)x + 3, (CHAR)(__ASHL(__ASHR((int)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); - __GET((LONGINT)(uintptr_t)x + 2, c, CHAR); - __PUT((LONGINT)(uintptr_t)x + 2, (CHAR)(__MASK((int)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); + __GET((LONGINT)(SYSTEM_ADDRESS)x + 3, c, CHAR); + __PUT((LONGINT)(SYSTEM_ADDRESS)x + 3, (CHAR)(__ASHL(__ASHR((int)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __GET((LONGINT)(SYSTEM_ADDRESS)x + 2, c, CHAR); + __PUT((LONGINT)(SYSTEM_ADDRESS)x + 2, (CHAR)(__MASK((int)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } INTEGER Reals_ExpoL (LONGREAL x) { INTEGER _o_result; INTEGER i; - __GET((LONGINT)(uintptr_t)&x + 6, i, INTEGER); + __GET((LONGINT)(SYSTEM_ADDRESS)&x + 6, i, INTEGER); _o_result = __MASK(__ASHR(i, 4), -2048); return _o_result; } @@ -89,8 +89,8 @@ void Reals_ConvertL (LONGREAL x, INTEGER n, CHAR *d, LONGINT d__len) } k = 0; if (n > 9) { - i = __ENTIER(x / (LONGREAL)(LONGREAL)1000000000); - j = __ENTIER(x - i * (LONGREAL)1000000000); + i = (int)__ENTIER(x / (LONGREAL)(LONGREAL)1000000000); + j = (int)__ENTIER(x - i * (LONGREAL)1000000000); if (j < 0) { j = 0; } @@ -100,9 +100,9 @@ void Reals_ConvertL (LONGREAL x, INTEGER n, CHAR *d, LONGINT d__len) k += 1; } } else { - i = __ENTIER(x); + i = (int)__ENTIER(x); } - while (k < (LONGINT)n) { + while (k < (int)n) { d[__X(k, d__len)] = (CHAR)(__MOD(i, 10) + 48); i = __DIV(i, 10); k += 1; @@ -134,7 +134,7 @@ static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LO CHAR by; i = 0; l = b__len; - while ((LONGINT)i < l) { + while ((int)i < l) { by = __VAL(CHAR, b[__X(i, b__len)]); d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((int)by, 4)); d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((int)by, -16)); diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index 4a783296..7e6b534c 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/SYSTEM.c b/bootstrap/windows-48/SYSTEM.c index 50e91c6d..33511a70 100644 --- a/bootstrap/windows-48/SYSTEM.c +++ b/bootstrap/windows-48/SYSTEM.c @@ -35,7 +35,7 @@ void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0) void SYSTEM_ENUMP(void *adr, LONGINT n, void (*P)()) { while (n > 0) { - P((LONGINT)(uintptr_t)(*((void**)(adr)))); + P((LONGINT)(SYSTEM_ADDRESS)(*((void**)(adr)))); adr = ((void**)adr) + 1; n--; } @@ -106,7 +106,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, else if (typ == (LONGINT*)POINTER__typ) { /* element type is a pointer */ x = Heap_NEWBLK(size + nofelems * sizeof(LONGINT)); - p = (LONGINT*)(uintptr_t)x[-1]; + p = (LONGINT*)(SYSTEM_ADDRESS)x[-1]; p[-nofelems] = *p; /* build new type desc in situ: 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nofelems - 1; n = 1; /* n =1 for skipping the size field */ while (n <= nofelems) {*p = n*sizeof(LONGINT); p++; n++;} @@ -119,7 +119,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, while (ptab[nofptrs] >= 0) {nofptrs++;} /* number of pointers per element */ nptr = nofelems * nofptrs; /* total number of pointers */ x = Heap_NEWBLK(size + nptr * sizeof(LONGINT)); - p = (LONGINT*)(uintptr_t)x[- 1]; + p = (LONGINT*)(SYSTEM_ADDRESS)x[- 1]; p[-nptr] = *p; /* build new type desc in situ; 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nptr - 1; n = 0; off = dataoff; while (n < nofelems) {i = 0; @@ -155,7 +155,7 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler // (Ignore other signals) } - void SystemSetHandler(int s, uintptr_t h) { + void SystemSetHandler(int s, SYSTEM_ADDRESS h) { if (s >= 2 && s <= 4) { int needtosetsystemhandler = handler[s-2] == 0; handler[s-2] = (SystemSignalHandler)h; @@ -194,12 +194,12 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler } } - void SystemSetInterruptHandler(uintptr_t h) { + void SystemSetInterruptHandler(SYSTEM_ADDRESS h) { EnsureConsoleCtrlHandler(); SystemInterruptHandler = (SystemSignalHandler)h; } - void SystemSetQuitHandler(uintptr_t h) { + void SystemSetQuitHandler(SYSTEM_ADDRESS h) { EnsureConsoleCtrlHandler(); SystemQuitHandler = (SystemSignalHandler)h; } diff --git a/bootstrap/windows-48/SYSTEM.h b/bootstrap/windows-48/SYSTEM.h index 949951ac..6377745e 100644 --- a/bootstrap/windows-48/SYSTEM.h +++ b/bootstrap/windows-48/SYSTEM.h @@ -1,28 +1,38 @@ #ifndef SYSTEM__h #define SYSTEM__h -#ifndef _WIN32 - - // Building for a Unix/Linux based system - #include // For memcpy ... - #include // For uintptr_t ... - +#if defined(_WIN64) + typedef long long SYSTEM_INT64; + typedef unsigned long long SYSTEM_CARD64; #else - - // Building for Windows platform with either mingw under cygwin, or the MS C compiler - #ifdef _WIN64 - typedef unsigned long long size_t; - typedef unsigned long long uintptr_t; - #else - typedef unsigned int size_t; - typedef unsigned int uintptr_t; - #endif /* _WIN64 */ - - typedef unsigned int uint32_t; - void * __cdecl memcpy(void * dest, const void * source, size_t size); - + typedef long SYSTEM_INT64; + typedef unsigned long SYSTEM_CARD64; #endif +typedef int SYSTEM_INT32; +typedef unsigned int SYSTEM_CARD32; +typedef short int SYSTEM_INT16; +typedef unsigned short int SYSTEM_CARD16; +typedef signed char SYSTEM_INT8; +typedef unsigned char SYSTEM_CARD8; + +#if (__SIZEOF_POINTER__ == 8) || defined(_WIN64) || defined(__LP64__) + #if defined(_WIN64) + typedef unsigned long long size_t; + #else + typedef unsigned long size_t; + #endif +#else + typedef unsigned int size_t; +#endif + +#define SYSTEM_ADDRESS size_t +#define _SIZE_T_DECLARED // For FreeBSD +#define _SIZE_T_DEFINED_ // For OpenBSD + +void *memcpy(void *dest, const void *source, SYSTEM_ADDRESS size); + + // The compiler uses 'import' and 'export' which translate to 'extern' and // nothing respectively. @@ -70,6 +80,7 @@ typedef unsigned char U_SHORTINT; #endif typedef U_LONGINT SET; +typedef U_LONGINT U_SET; // OS Memory allocation interfaces are in PlatformXXX.Mod @@ -96,10 +107,10 @@ extern LONGINT SYSTEM_ENTIER (double x); // Signal handling in SYSTEM.c #ifndef _WIN32 - extern void SystemSetHandler(int s, uintptr_t h); + extern void SystemSetHandler(int s, SYSTEM_ADDRESS h); #else - extern void SystemSetInterruptHandler(uintptr_t h); - extern void SystemSetQuitHandler (uintptr_t h); + extern void SystemSetInterruptHandler(SYSTEM_ADDRESS h); + extern void SystemSetQuitHandler (SYSTEM_ADDRESS h); #endif @@ -122,20 +133,20 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __COPY(s, d, n) {char*_a=(void*)s,*_b=(void*)d; LONGINT _i=0,_t=n-1; \ while(_i<_t&&((_b[_i]=_a[_i])!=0)){_i++;};_b[_i]=0;} -#define __DUP(x, l, t) x=(void*)memcpy((void*)(uintptr_t)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) +#define __DUP(x, l, t) x=(void*)memcpy((void*)(SYSTEM_ADDRESS)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) #define __DUPARR(v, t) v=(void*)memcpy(v##__copy,v,sizeof(t)) -#define __DEL(x) Platform_OSFree((LONGINT)(uintptr_t)x) +#define __DEL(x) Platform_OSFree((LONGINT)(SYSTEM_ADDRESS)x) /* 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 + +#define __GET(a, x, t) x= *(t*)(SYSTEM_ADDRESS)(a) +#define __PUT(a, x, t) *(t*)(SYSTEM_ADDRESS)(a)=x #define __LSHL(x, n, t) ((t)((U_##t)(x)<<(n))) #define __LSHR(x, n, t) ((t)((U_##t)(x)>>(n))) @@ -150,7 +161,7 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) #define __BIT(x, n) (*(U_LONGINT*)(x)>>(n)&1) -#define __MOVE(s, d, n) memcpy((char*)(uintptr_t)(d),(char*)(uintptr_t)(s),n) +#define __MOVE(s, d, n) memcpy((char*)(SYSTEM_ADDRESS)(d),(char*)(SYSTEM_ADDRESS)(s),n) #define __ASHF(x, n) SYSTEM_ASH((LONGINT)(x), (LONGINT)(n)) #define __SHORT(x, y) ((int)((U_LONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) #define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) @@ -211,7 +222,7 @@ extern void Heap_INCREF(); extern void Platform_Init(INTEGER argc, LONGINT argv); extern void Heap_FINALL(); -#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (LONGINT)(uintptr_t)&argv); +#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (LONGINT)(SYSTEM_ADDRESS)&argv); #define __REGMAIN(name, enum) m = Heap_REGMOD((CHAR*)name,enum) #define __FINI Heap_FINALL(); return 0 @@ -232,7 +243,7 @@ extern SYSTEM_PTR Heap_NEWREC (LONGINT tag); extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __SYSNEW(p, len) p = Heap_NEWBLK((LONGINT)(len)) -#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(uintptr_t)t##__typ) +#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(SYSTEM_ADDRESS)t##__typ) #define __NEWARR SYSTEM_NEWARR @@ -263,20 +274,20 @@ extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __INITYP(t, t0, level) \ t##__typ = (LONGINT*)&t##__desc.blksz; \ memcpy(t##__desc.basep, t0##__typ - __BASEOFF, level*sizeof(LONGINT)); \ - t##__desc.basep[level] = (LONGINT)(uintptr_t)t##__typ; \ - t##__desc.module = (LONGINT)(uintptr_t)m; \ + t##__desc.basep[level] = (LONGINT)(SYSTEM_ADDRESS)t##__typ; \ + t##__desc.module = (LONGINT)(SYSTEM_ADDRESS)m; \ if(t##__desc.blksz!=sizeof(struct t)) __HALT(-15); \ t##__desc.blksz = (t##__desc.blksz+5*sizeof(LONGINT)-1)/(4*sizeof(LONGINT))*(4*sizeof(LONGINT)); \ - Heap_REGTYP(m, (LONGINT)(uintptr_t)&t##__desc.next); \ + Heap_REGTYP(m, (LONGINT)(SYSTEM_ADDRESS)&t##__desc.next); \ SYSTEM_INHERIT(t##__typ, t0##__typ) -#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(uintptr_t)typ##__typ) -#define __TYPEOF(p) ((LONGINT*)(uintptr_t)(*(((LONGINT*)(p))-1))) +#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(SYSTEM_ADDRESS)typ##__typ) +#define __TYPEOF(p) ((LONGINT*)(SYSTEM_ADDRESS)(*(((LONGINT*)(p))-1))) #define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) // Oberon-2 type bound procedures support -#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(uintptr_t)proc -#define __SEND(typ, num, funtyp, parlist) ((funtyp)((uintptr_t)*(typ-(__TPROC0OFF+num))))parlist +#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(SYSTEM_ADDRESS)proc +#define __SEND(typ, num, funtyp, parlist) ((funtyp)((SYSTEM_ADDRESS)*(typ-(__TPROC0OFF+num))))parlist diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index d2713d0f..115456ea 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -21,7 +21,7 @@ INTEGER Strings_Length (CHAR *s, LONGINT s__len) INTEGER i; __DUP(s, s__len, CHAR); i = 0; - while (((LONGINT)i < s__len && s[__X(i, s__len)] != 0x00)) { + while (((int)i < s__len && s[__X(i, s__len)] != 0x00)) { i += 1; } _o_result = i; @@ -36,11 +36,11 @@ void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__ n1 = Strings_Length(dest, dest__len); n2 = Strings_Length(extra, extra__len); i = 0; - while ((i < n2 && (LONGINT)(i + n1) < dest__len)) { + while ((i < n2 && (int)(i + n1) < dest__len)) { dest[__X(i + n1, dest__len)] = extra[__X(i, extra__len)]; i += 1; } - if ((LONGINT)(i + n1) < dest__len) { + if ((int)(i + n1) < dest__len) { dest[__X(i + n1, dest__len)] = 0x00; } __DEL(extra); @@ -59,10 +59,10 @@ void Strings_Insert (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, Strings_Append(dest, dest__len, (void*)source, source__len); return; } - if ((LONGINT)(pos + n2) < dest__len) { + if ((int)(pos + n2) < dest__len) { i = n1; while (i >= pos) { - if ((LONGINT)(i + n2) < dest__len) { + if ((int)(i + n2) < dest__len) { dest[__X(i + n2, dest__len)] = dest[__X(i, dest__len)]; } i -= 1; @@ -91,7 +91,7 @@ void Strings_Delete (CHAR *s, LONGINT s__len, INTEGER pos, INTEGER n) s[__X(i - n, s__len)] = s[__X(i, s__len)]; i += 1; } - if ((LONGINT)(i - n) < s__len) { + if ((int)(i - n) < s__len) { s[__X(i - n, s__len)] = 0x00; } } else { @@ -121,7 +121,7 @@ void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n, return; } i = 0; - while (((((LONGINT)(pos + i) <= source__len && source[__X(pos + i, source__len)] != 0x00)) && i < n)) { + while (((((int)(pos + i) <= source__len && source[__X(pos + i, source__len)] != 0x00)) && i < n)) { if (i < destLen) { dest[__X(i, dest__len)] = source[__X(pos + i, source__len)]; } diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index 5f45d8a8..96dbb01d 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index 2dab1e0f..cfe34ca7 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Files.h" #include "Modules.h" @@ -787,9 +787,9 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) (*S).s[__X(i, ((LONGINT)(64)))] = 0x00; (*S).len = i; (*S).class = 1; - } else if (ch == '\"') { + } else if (ch == '"') { Texts_Read((void*)&*S, S__typ, &ch); - while ((((ch != '\"' && ch >= ' ')) && i != 63)) { + while ((((ch != '"' && ch >= ' ')) && i != 63)) { (*S).s[__X(i, ((LONGINT)(64)))] = ch; i += 1; Texts_Read((void*)&*S, S__typ, &ch); @@ -839,7 +839,7 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) k -= 16; } while (j < i) { - k = __ASHL(k, 4) + (LONGINT)((int)d[__X(j, ((LONGINT)(32)))] - 48); + k = __ASHL(k, 4) + (int)((int)d[__X(j, ((LONGINT)(32)))] - 48); j += 1; } if (neg) { @@ -929,7 +929,7 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) (*S).class = 3; k = 0; do { - k = k * 10 + (LONGINT)((int)d[__X(j, ((LONGINT)(32)))] - 48); + k = k * 10 + (int)((int)d[__X(j, ((LONGINT)(32)))] - 48); j += 1; } while (!(j == i)); if (neg) { @@ -1067,7 +1067,7 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n) x0 = __DIV(x0, 10); i += 1; } while (!(x0 == 0)); - while (n > (LONGINT)i) { + while (n > (int)i) { Texts_Write(&*W, W__typ, ' '); n -= 1; } @@ -1319,7 +1319,7 @@ void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER } else { Texts_Write(&*W, W__typ, ' '); } - e = (int)__ASHR((LONGINT)(e - 1023) * 77, 8); + e = (int)__ASHR((int)(e - 1023) * 77, 8); if (e >= 0) { x = x / (LONGREAL)Reals_TenL(e); } else { diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index 189403c9..632b644a 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/Vishap.c b/bootstrap/windows-48/Vishap.c index 74d0e984..4c9e3b45 100644 --- a/bootstrap/windows-48/Vishap.c +++ b/bootstrap/windows-48/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkamSf */ #include "SYSTEM.h" #include "Configuration.h" #include "Heap.h" diff --git a/bootstrap/windows-48/errors.c b/bootstrap/windows-48/errors.c index f8ddb53a..68e433df 100644 --- a/bootstrap/windows-48/errors.c +++ b/bootstrap/windows-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef @@ -25,7 +25,7 @@ export void *errors__init(void) errors_errors[6][0] = 0x00; errors_errors[7][0] = 0x00; errors_errors[8][0] = 0x00; - __MOVE("\'=\' expected", errors_errors[9], 13); + __MOVE("'=' expected", errors_errors[9], 13); errors_errors[10][0] = 0x00; errors_errors[11][0] = 0x00; __MOVE("type definition starts with incorrect symbol", errors_errors[12], 45); @@ -34,28 +34,28 @@ export void *errors__init(void) __MOVE("declaration followed by incorrect symbol", errors_errors[15], 41); __MOVE("MODULE expected", errors_errors[16], 16); errors_errors[17][0] = 0x00; - __MOVE("\'.\' missing", errors_errors[18], 12); - __MOVE("\',\' missing", errors_errors[19], 12); - __MOVE("\':\' missing", errors_errors[20], 12); + __MOVE("'.' missing", errors_errors[18], 12); + __MOVE("',' missing", errors_errors[19], 12); + __MOVE("':' missing", errors_errors[20], 12); errors_errors[21][0] = 0x00; - __MOVE("\')\' missing", errors_errors[22], 12); - __MOVE("\']\' missing", errors_errors[23], 12); - __MOVE("\'}\' missing", errors_errors[24], 12); + __MOVE("')' missing", errors_errors[22], 12); + __MOVE("']' missing", errors_errors[23], 12); + __MOVE("'}' missing", errors_errors[24], 12); __MOVE("OF missing", errors_errors[25], 11); __MOVE("THEN missing", errors_errors[26], 13); __MOVE("DO missing", errors_errors[27], 11); __MOVE("TO missing", errors_errors[28], 11); errors_errors[29][0] = 0x00; - __MOVE("\'(\' missing", errors_errors[30], 12); + __MOVE("'(' missing", errors_errors[30], 12); errors_errors[31][0] = 0x00; errors_errors[32][0] = 0x00; errors_errors[33][0] = 0x00; - __MOVE("\':=\' missing", errors_errors[34], 13); - __MOVE("\',\' or OF expected", errors_errors[35], 19); + __MOVE("':=' missing", errors_errors[34], 13); + __MOVE("',' or OF expected", errors_errors[35], 19); errors_errors[36][0] = 0x00; errors_errors[37][0] = 0x00; __MOVE("identifier expected", errors_errors[38], 20); - __MOVE("\';\' missing", errors_errors[39], 12); + __MOVE("';' missing", errors_errors[39], 12); errors_errors[40][0] = 0x00; __MOVE("END missing", errors_errors[41], 12); errors_errors[42][0] = 0x00; @@ -131,10 +131,10 @@ export void *errors__init(void) __MOVE("operand is not a variable", errors_errors[112], 26); __MOVE("incompatible assignment", errors_errors[113], 24); __MOVE("string too long to be assigned", errors_errors[114], 31); - __MOVE("parameter doesn\'t match", errors_errors[115], 24); - __MOVE("number of parameters doesn\'t match", errors_errors[116], 35); - __MOVE("result type doesn\'t match", errors_errors[117], 26); - __MOVE("export mark doesn\'t match with forward declaration", errors_errors[118], 51); + __MOVE("parameter doesn't match", errors_errors[115], 24); + __MOVE("number of parameters doesn't match", errors_errors[116], 35); + __MOVE("result type doesn't match", errors_errors[117], 26); + __MOVE("export mark doesn't match with forward declaration", errors_errors[118], 51); __MOVE("redefinition textually precedes procedure bound to base type", errors_errors[119], 61); __MOVE("type of expression following IF, WHILE, UNTIL or ASSERT is not BOOLEAN", errors_errors[120], 71); __MOVE("called object is not a procedure (or is an interrupt procedure)", errors_errors[121], 64); @@ -194,5 +194,6 @@ export void *errors__init(void) __MOVE("implicit type cast", errors_errors[301], 19); __MOVE("inappropriate symbol file ignored", errors_errors[306], 34); __MOVE("no ELSE symbol after CASE statement sequence may lead to trap", errors_errors[307], 62); + __MOVE("SYSTEM.VAL result includes memory past end of source variable", errors_errors[308], 62); __ENDMOD; } diff --git a/bootstrap/windows-48/errors.h b/bootstrap/windows-48/errors.h index 5068083b..41d399ad 100644 --- a/bootstrap/windows-48/errors.h +++ b/bootstrap/windows-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index 03bd540b..4efd107a 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index 695ea164..fc4f0da1 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/vt100.c b/bootstrap/windows-48/vt100.c index c499aceb..d77b0b84 100644 --- a/bootstrap/windows-48/vt100.c +++ b/bootstrap/windows-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Strings.h" @@ -252,7 +252,7 @@ export void *vt100__init(void) __REGCMD("RCP", vt100_RCP); __REGCMD("SCP", vt100_SCP); /* BEGIN */ - __COPY("", vt100_CSI, ((LONGINT)(5))); + __COPY("\033", vt100_CSI, ((LONGINT)(5))); Strings_Append((CHAR*)"[", (LONGINT)2, (void*)vt100_CSI, ((LONGINT)(5))); __ENDMOD; } diff --git a/bootstrap/windows-48/vt100.h b/bootstrap/windows-48/vt100.h index 1aaeca77..4af04d6e 100644 --- a/bootstrap/windows-48/vt100.h +++ b/bootstrap/windows-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index 951bea6e..47f1ffc7 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -14,6 +14,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/08/24] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/08/23] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index 15594379..ba0bbd99 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Console.c b/bootstrap/windows-88/Console.c index 0e1c708d..5a9998a9 100644 --- a/bootstrap/windows-88/Console.c +++ b/bootstrap/windows-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Platform.h" @@ -22,7 +22,7 @@ export void Console_String (CHAR *s, LONGINT s__len); void Console_Flush (void) { INTEGER error; - error = Platform_Write(Platform_StdOut, (LONGINT)(uintptr_t)Console_line, Console_pos); + error = Platform_Write(Platform_StdOut, (LONGINT)(SYSTEM_ADDRESS)Console_line, Console_pos); Console_pos = 0; } diff --git a/bootstrap/windows-88/Console.h b/bootstrap/windows-88/Console.h index 11152de0..4606384c 100644 --- a/bootstrap/windows-88/Console.h +++ b/bootstrap/windows-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index b9b748e0..c46ffdd2 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -258,7 +258,7 @@ static void Files_Flush (Files_Buffer buf) if (buf->org != f->pos) { error = Platform_Seek(f->fd, buf->org, Platform_SeekSet); } - error = Platform_Write(f->fd, (LONGINT)(uintptr_t)buf->data, buf->size); + error = Platform_Write(f->fd, (LONGINT)(SYSTEM_ADDRESS)buf->data, buf->size); if (error != 0) { Files_Err((CHAR*)"error writing file", (LONGINT)19, f, error); } @@ -657,7 +657,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x } else { min = n; } - __MOVE((LONGINT)(uintptr_t)buf->data + offset, (LONGINT)(uintptr_t)x + xpos, min); + __MOVE((LONGINT)(SYSTEM_ADDRESS)buf->data + offset, (LONGINT)(SYSTEM_ADDRESS)x + xpos, min); offset += min; (*r).offset = offset; xpos += min; @@ -722,7 +722,7 @@ void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT } else { min = n; } - __MOVE((LONGINT)(uintptr_t)x + xpos, (LONGINT)(uintptr_t)buf->data + offset, min); + __MOVE((LONGINT)(SYSTEM_ADDRESS)x + xpos, (LONGINT)(SYSTEM_ADDRESS)buf->data + offset, min); offset += min; (*r).offset = offset; if (offset > buf->size) { @@ -773,15 +773,15 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT *res = 3; return; } - error = Platform_Read(fdold, (LONGINT)(uintptr_t)buf, ((LONGINT)(4096)), &n); + error = Platform_Read(fdold, (LONGINT)(SYSTEM_ADDRESS)buf, ((LONGINT)(4096)), &n); while (n > 0) { - error = Platform_Write(fdnew, (LONGINT)(uintptr_t)buf, n); + error = Platform_Write(fdnew, (LONGINT)(SYSTEM_ADDRESS)buf, n); if (error != 0) { ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); Files_Err((CHAR*)"cannot move file", (LONGINT)17, NIL, error); } - error = Platform_Read(fdold, (LONGINT)(uintptr_t)buf, ((LONGINT)(4096)), &n); + error = Platform_Read(fdold, (LONGINT)(SYSTEM_ADDRESS)buf, ((LONGINT)(4096)), &n); } ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); @@ -839,7 +839,7 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *de j += 1; } } else { - __MOVE((LONGINT)(uintptr_t)src, (LONGINT)(uintptr_t)dest, src__len); + __MOVE((LONGINT)(SYSTEM_ADDRESS)src, (LONGINT)(SYSTEM_ADDRESS)dest, src__len); } } @@ -865,8 +865,10 @@ void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, LONGINT *x) void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x) { CHAR b[4]; + LONGINT l; Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); - *x = (SET)((((int)b[0] + __ASHL((int)b[1], 8)) + __ASHL((int)b[2], 16)) + __ASHL((int)b[3], 24)); + l = (((int)b[0] + __ASHL((int)b[1], 8)) + __ASHL((int)b[2], 16)) + __ASHL((int)b[3], 24); + *x = (SET)l; } void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x) @@ -922,11 +924,11 @@ void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, LONGINT *x) n = 0; Files_Read(&*R, R__typ, (void*)&ch); while ((int)ch >= 128) { - n += __ASH((LONGINT)((int)ch - 128), s); + n += __ASH((SYSTEM_INT64)((int)ch - 128), s); s += 7; Files_Read(&*R, R__typ, (void*)&ch); } - n += __ASH((LONGINT)(__MASK((int)ch, -64) - __ASHL(__ASHR((int)ch, 6), 6)), s); + n += __ASH((SYSTEM_INT64)(__MASK((int)ch, -64) - __ASHL(__ASHR((int)ch, 6), 6)), s); *x = n; } @@ -1007,7 +1009,7 @@ static void Files_Finalize (SYSTEM_PTR o) { Files_File f = NIL; LONGINT res; - f = (Files_File)(uintptr_t)o; + f = (Files_File)(SYSTEM_ADDRESS)o; if (f->fd >= 0) { Files_CloseOSFile(f); if (f->tempFile) { diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index da7d6e44..eb946544 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index 69ba4ffb..9873a734 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tskSfF */ #define LARGE #include "SYSTEM.h" @@ -102,7 +102,7 @@ export void Heap_Unlock (void); extern void *Heap__init(); extern LONGINT Platform_MainStackFrame; extern LONGINT Platform_OSAllocate(LONGINT size); -#define Heap_FetchAddress(pointer) (LONGINT)(uintptr_t)(*((void**)((uintptr_t)pointer))) +#define Heap_FetchAddress(pointer) (LONGINT)(SYSTEM_ADDRESS)(*((void**)((SYSTEM_ADDRESS)pointer))) #define Heap_HeapModuleInit() Heap__init() #define Heap_OSAllocate(size) Platform_OSAllocate(size) #define Heap_PlatformHalt(code) Platform_Halt(code) @@ -135,7 +135,7 @@ SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) __COPY(name, m->name, ((LONGINT)(20))); m->refcnt = 0; m->enumPtrs = enumPtrs; - m->next = (Heap_Module)(uintptr_t)Heap_modules; + m->next = (Heap_Module)(SYSTEM_ADDRESS)Heap_modules; Heap_modules = (SYSTEM_PTR)m; _o_result = (void*)m; return _o_result; @@ -316,7 +316,7 @@ SYSTEM_PTR Heap_NEWREC (LONGINT tag) __PUT(adr + 16, 0, LONGINT); Heap_allocated += blksz; Heap_Unlock(); - _o_result = (SYSTEM_PTR)(uintptr_t)(adr + 8); + _o_result = (SYSTEM_PTR)(SYSTEM_ADDRESS)(adr + 8); return _o_result; } @@ -327,12 +327,12 @@ SYSTEM_PTR Heap_NEWBLK (LONGINT size) SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 63, 5), 5); - new = Heap_NEWREC((LONGINT)(uintptr_t)&blksz); - tag = ((LONGINT)(uintptr_t)new + blksz) - 24; + new = Heap_NEWREC((LONGINT)(SYSTEM_ADDRESS)&blksz); + tag = ((LONGINT)(SYSTEM_ADDRESS)new + blksz) - 24; __PUT(tag - 8, 0, LONGINT); __PUT(tag, blksz, LONGINT); __PUT(tag + 8, -8, LONGINT); - __PUT((LONGINT)(uintptr_t)new - 8, tag, LONGINT); + __PUT((LONGINT)(SYSTEM_ADDRESS)new - 8, tag, LONGINT); Heap_Unlock(); _o_result = new; return _o_result; @@ -361,7 +361,7 @@ static void Heap_Mark (LONGINT q) __GET(tag, offset, LONGINT); fld = q + offset; p = Heap_FetchAddress(fld); - __PUT(fld, (SYSTEM_PTR)(uintptr_t)n, SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADDRESS)n, SYSTEM_PTR); } else { fld = q + offset; n = Heap_FetchAddress(fld); @@ -370,7 +370,7 @@ static void Heap_Mark (LONGINT q) if (!__ODD(tagbits)) { __PUT(n - 8, tagbits + 1, LONGINT); __PUT(q - 8, tag + 1, LONGINT); - __PUT(fld, (SYSTEM_PTR)(uintptr_t)p, SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADDRESS)p, SYSTEM_PTR); p = q; q = n; tag = tagbits; @@ -385,7 +385,7 @@ static void Heap_Mark (LONGINT q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((LONGINT)(uintptr_t)p); + Heap_Mark((LONGINT)(SYSTEM_ADDRESS)p); } static void Heap_Scan (void) @@ -554,7 +554,7 @@ static void Heap_Finalize (void) } else { prev->next = n->next; } - (*n->finalize)((SYSTEM_PTR)(uintptr_t)n->obj); + (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADDRESS)n->obj); if (prev == NIL) { n = Heap_fin; } else { @@ -573,7 +573,7 @@ void Heap_FINALL (void) while (Heap_fin != NIL) { n = Heap_fin; Heap_fin = Heap_fin->next; - (*n->finalize)((SYSTEM_PTR)(uintptr_t)n->obj); + (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADDRESS)n->obj); } } @@ -590,9 +590,9 @@ static void Heap_MarkStack (LONGINT n, LONGINT *cand, LONGINT cand__len) } if (n == 0) { nofcand = 0; - sp = (LONGINT)(uintptr_t)&frame; + sp = (LONGINT)(SYSTEM_ADDRESS)&frame; stack0 = Heap_PlatformMainStackFrame(); - inc = (LONGINT)(uintptr_t)&align.p - (LONGINT)(uintptr_t)&align; + inc = (LONGINT)(SYSTEM_ADDRESS)&align.p - (LONGINT)(SYSTEM_ADDRESS)&align; if (sp > stack0) { inc = -inc; } @@ -623,7 +623,7 @@ void Heap_GC (BOOLEAN markStack) LONGINT cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); - m = (Heap_Module)(uintptr_t)Heap_modules; + m = (Heap_Module)(SYSTEM_ADDRESS)Heap_modules; while (m != NIL) { if (m->enumPtrs != NIL) { (*m->enumPtrs)(Heap_MarkP); @@ -700,7 +700,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (LONGINT)(uintptr_t)obj; + f->obj = (LONGINT)(SYSTEM_ADDRESS)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index 40db2aca..b1ff5968 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index eaf370c4..0c836ead 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index d273cf1a..6e6ded2e 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index 2fccfe61..f4bdb1a8 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" @@ -35,7 +35,9 @@ export void OPB_In (OPT_Node *x, OPT_Node y); export void OPB_Index (OPT_Node *x, OPT_Node y); export void OPB_Inittd (OPT_Node *inittd, OPT_Node *last, OPT_Struct typ); static BOOLEAN OPB_IntToBool (LONGINT i); +static OPT_Struct OPB_IntType (LONGINT size); export void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y); +static LONGINT OPB_LongerSize (LONGINT i); export void OPB_MOp (SHORTINT op, OPT_Node *x); export OPT_Node OPB_NewBoolConst (BOOLEAN boolval); export OPT_Node OPB_NewIntConst (LONGINT intval); @@ -52,6 +54,8 @@ export void OPB_Return (OPT_Node *x, OPT_Object proc); export void OPB_SetElem (OPT_Node *x); static void OPB_SetIntType (OPT_Node node); export void OPB_SetRange (OPT_Node *x, OPT_Node y); +static LONGINT OPB_ShorterSize (LONGINT i); +static INTEGER OPB_SignedByteSize (LONGINT n); export void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno); export void OPB_StPar0 (OPT_Node *par0, INTEGER fctno); export void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno); @@ -91,8 +95,8 @@ OPT_Node OPB_NewLeaf (OPT_Object obj) node = OPT_NewNode(9); break; default: - OPB_err(127); node = OPT_NewNode(0); + OPB_err(127); break; } node->obj = obj; @@ -221,21 +225,68 @@ OPT_Node OPB_EmptySet (void) return _o_result; } +static INTEGER OPB_SignedByteSize (LONGINT n) +{ + INTEGER _o_result; + INTEGER b; + if (n < 0) { + n = -(n + 1); + } + b = 1; + while ((b < 8 && __ASH(n, -(__ASHL(b, 3) - 1)) != 0)) { + b += 1; + } + _o_result = b; + return _o_result; +} + +static LONGINT OPB_ShorterSize (LONGINT i) +{ + LONGINT _o_result; + if (i >= (SYSTEM_INT64)OPM_LIntSize) { + _o_result = OPM_IntSize; + return _o_result; + } else { + _o_result = OPM_SIntSize; + return _o_result; + } + __RETCHK; +} + +static LONGINT OPB_LongerSize (LONGINT i) +{ + LONGINT _o_result; + if (i <= (SYSTEM_INT64)OPM_SIntSize) { + _o_result = OPM_IntSize; + return _o_result; + } else { + _o_result = OPM_LIntSize; + return _o_result; + } + __RETCHK; +} + +static OPT_Struct OPB_IntType (LONGINT size) +{ + OPT_Struct _o_result; + OPT_Struct result = NIL; + if (size <= OPT_sinttyp->size) { + result = OPT_sinttyp; + } else if (size <= OPT_inttyp->size) { + result = OPT_inttyp; + } else { + result = OPT_linttyp; + } + if (size > OPT_linttyp->size) { + OPB_err(203); + } + _o_result = result; + return _o_result; +} + static void OPB_SetIntType (OPT_Node node) { - LONGINT v; - v = node->conval->intval; - if ((OPM_MinSInt <= (LONGINT)v && (LONGINT)v <= OPM_MaxSInt)) { - node->typ = OPT_sinttyp; - } else if ((OPM_MinInt <= (LONGINT)v && (LONGINT)v <= OPM_MaxInt)) { - node->typ = OPT_inttyp; - } else if ((OPM_MinLInt <= v && v <= OPM_MaxLInt)) { - node->typ = OPT_linttyp; - } else { - OPB_err(203); - node->typ = OPT_sinttyp; - node->conval->intval = 1; - } + node->typ = OPB_IntType(OPB_SignedByteSize(node->conval->intval)); } OPT_Node OPB_NewIntConst (LONGINT intval) @@ -379,16 +430,16 @@ void OPB_Field (OPT_Node *x, OPT_Object y) } } -static struct TypTest__57 { +static struct TypTest__61 { OPT_Node *x; OPT_Object *obj; BOOLEAN *guard; - struct TypTest__57 *lnk; -} *TypTest__57_s; + struct TypTest__61 *lnk; +} *TypTest__61_s; -static void GTT__58 (OPT_Struct t0, OPT_Struct t1); +static void GTT__62 (OPT_Struct t0, OPT_Struct t1); -static void GTT__58 (OPT_Struct t0, OPT_Struct t1) +static void GTT__62 (OPT_Struct t0, OPT_Struct t1) { OPT_Node node = NIL; OPT_Struct t = NIL; @@ -401,54 +452,54 @@ static void GTT__58 (OPT_Struct t0, OPT_Struct t1) t1 = t1->BaseTyp; } if (t1 == t0 || t0->form == 0) { - if (*TypTest__57_s->guard) { - OPB_BindNodes(5, NIL, &*TypTest__57_s->x, NIL); - (*TypTest__57_s->x)->readonly = (*TypTest__57_s->x)->left->readonly; + if (*TypTest__61_s->guard) { + OPB_BindNodes(5, NIL, &*TypTest__61_s->x, NIL); + (*TypTest__61_s->x)->readonly = (*TypTest__61_s->x)->left->readonly; } else { node = OPT_NewNode(11); node->subcl = 16; - node->left = *TypTest__57_s->x; - node->obj = *TypTest__57_s->obj; - *TypTest__57_s->x = node; + node->left = *TypTest__61_s->x; + node->obj = *TypTest__61_s->obj; + *TypTest__61_s->x = node; } } else { OPB_err(85); } } else if (t0 != t1) { OPB_err(85); - } else if (!*TypTest__57_s->guard) { - if ((*TypTest__57_s->x)->class == 5) { + } else if (!*TypTest__61_s->guard) { + if ((*TypTest__61_s->x)->class == 5) { node = OPT_NewNode(11); node->subcl = 16; - node->left = *TypTest__57_s->x; - node->obj = *TypTest__57_s->obj; - *TypTest__57_s->x = node; + node->left = *TypTest__61_s->x; + node->obj = *TypTest__61_s->obj; + *TypTest__61_s->x = node; } else { - *TypTest__57_s->x = OPB_NewBoolConst(1); + *TypTest__61_s->x = OPB_NewBoolConst(1); } } } void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) { - struct TypTest__57 _s; + struct TypTest__61 _s; _s.x = x; _s.obj = &obj; _s.guard = &guard; - _s.lnk = TypTest__57_s; - TypTest__57_s = &_s; + _s.lnk = TypTest__61_s; + TypTest__61_s = &_s; if (OPB_NotVar(*x)) { OPB_err(112); } else if ((*x)->typ->form == 13) { if (((*x)->typ->BaseTyp->comp != 4 && (*x)->typ != OPT_sysptrtyp)) { OPB_err(85); } else if (obj->typ->form == 13) { - GTT__58((*x)->typ->BaseTyp, obj->typ->BaseTyp); + GTT__62((*x)->typ->BaseTyp, obj->typ->BaseTyp); } else { OPB_err(86); } } else if (((((*x)->typ->comp == 4 && (*x)->class == 1)) && obj->typ->comp == 4)) { - GTT__58((*x)->typ, obj->typ); + GTT__62((*x)->typ, obj->typ); } else { OPB_err(87); } @@ -457,7 +508,7 @@ void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) } else { (*x)->typ = OPT_booltyp; } - TypTest__57_s = _s.lnk; + TypTest__61_s = _s.lnk; } void OPB_In (OPT_Node *x, OPT_Node y) @@ -470,7 +521,7 @@ void OPB_In (OPT_Node *x, OPT_Node y) } else if ((__IN(f, 0x70) && y->typ->form == 9)) { if ((*x)->class == 7) { k = (*x)->conval->intval; - if (k < 0 || k > (LONGINT)OPM_MaxSet) { + if (k < 0 || k > (SYSTEM_INT64)OPM_MaxSet) { OPB_err(202); } else if (y->class == 7) { (*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval)); @@ -523,13 +574,13 @@ static void OPB_CheckRealType (INTEGER f, INTEGER nr, OPT_Const x) x->intval = -1; } -static struct MOp__28 { - struct MOp__28 *lnk; -} *MOp__28_s; +static struct MOp__30 { + struct MOp__30 *lnk; +} *MOp__30_s; -static OPT_Node NewOp__29 (SHORTINT op, OPT_Struct typ, OPT_Node z); +static OPT_Node NewOp__31 (SHORTINT op, OPT_Struct typ, OPT_Node z); -static OPT_Node NewOp__29 (SHORTINT op, OPT_Struct typ, OPT_Node z) +static OPT_Node NewOp__31 (SHORTINT op, OPT_Struct typ, OPT_Node z) { OPT_Node _o_result; OPT_Node node = NIL; @@ -546,9 +597,9 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) INTEGER f; OPT_Struct typ = NIL; OPT_Node z = NIL; - struct MOp__28 _s; - _s.lnk = MOp__28_s; - MOp__28_s = &_s; + struct MOp__30 _s; + _s.lnk = MOp__30_s; + MOp__30_s = &_s; z = *x; if (z->class == 8 || z->class == 9) { OPB_err(126); @@ -562,7 +613,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->conval->intval = OPB_BoolToInt(!OPB_IntToBool(z->conval->intval)); z->obj = NIL; } else { - z = NewOp__29(op, typ, z); + z = NewOp__31(op, typ, z); } } else { OPB_err(98); @@ -590,7 +641,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } z->obj = NIL; } else { - z = NewOp__29(op, typ, z); + z = NewOp__31(op, typ, z); } } else { OPB_err(97); @@ -611,7 +662,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } z->obj = NIL; } else { - z = NewOp__29(op, typ, z); + z = NewOp__31(op, typ, z); } } else { OPB_err(111); @@ -623,7 +674,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->conval->intval = (int)__CAP((CHAR)z->conval->intval); z->obj = NIL; } else { - z = NewOp__29(op, typ, z); + z = NewOp__31(op, typ, z); } } else { OPB_err(111); @@ -636,7 +687,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->conval->intval = OPB_BoolToInt(__ODD(z->conval->intval)); z->obj = NIL; } else { - z = NewOp__29(op, typ, z); + z = NewOp__31(op, typ, z); } } else { OPB_err(111); @@ -649,7 +700,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) f = 10; } if (z->class < 7 || f == 10) { - z = NewOp__29(op, typ, z); + z = NewOp__31(op, typ, z); } else { OPB_err(127); } @@ -658,7 +709,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) case 25: if ((__IN(f, 0x70) && z->class == 7)) { if ((0 <= z->conval->intval && z->conval->intval <= -1)) { - z = NewOp__29(op, typ, z); + z = NewOp__31(op, typ, z); } else { OPB_err(219); } @@ -675,7 +726,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } } *x = z; - MOp__28_s = _s.lnk; + MOp__30_s = _s.lnk; } static void OPB_CheckPtr (OPT_Node x, OPT_Node y) @@ -866,41 +917,13 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) __GUARDEQP(yval, OPT_ConstDesc) = *xval; } break; - case 4: + case 4: case 5: case 6: if (__IN(g, 0x70)) { - x->typ = y->typ; - } else if (g == 7) { - x->typ = OPT_realtyp; - xval->realval = xval->intval; - } else if (g == 8) { - x->typ = OPT_lrltyp; - xval->realval = xval->intval; - } else { - OPB_err(100); - y->typ = x->typ; - __GUARDEQP(yval, OPT_ConstDesc) = *xval; - } - break; - case 5: - if (g == 4) { - y->typ = OPT_inttyp; - } else if (__IN(g, 0x70)) { - x->typ = y->typ; - } else if (g == 7) { - x->typ = OPT_realtyp; - xval->realval = xval->intval; - } else if (g == 8) { - x->typ = OPT_lrltyp; - xval->realval = xval->intval; - } else { - OPB_err(100); - y->typ = x->typ; - __GUARDEQP(yval, OPT_ConstDesc) = *xval; - } - break; - case 6: - if (__IN(g, 0x70)) { - y->typ = OPT_linttyp; + if (x->typ->size <= y->typ->size) { + x->typ = y->typ; + } else { + x->typ = OPB_IntType(x->typ->size); + } } else if (g == 7) { x->typ = OPT_realtyp; xval->realval = xval->intval; @@ -1197,15 +1220,15 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) (*x)->typ = typ; } -static struct Op__38 { +static struct Op__40 { INTEGER *f, *g; - struct Op__38 *lnk; -} *Op__38_s; + struct Op__40 *lnk; +} *Op__40_s; -static void NewOp__39 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y); -static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y); +static void NewOp__41 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y); +static BOOLEAN strings__43 (OPT_Node *x, OPT_Node *y); -static void NewOp__39 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y) +static void NewOp__41 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y) { OPT_Node node = NIL; node = OPT_NewNode(12); @@ -1216,29 +1239,29 @@ static void NewOp__39 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y) *x = node; } -static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) +static BOOLEAN strings__43 (OPT_Node *x, OPT_Node *y) { BOOLEAN _o_result; BOOLEAN ok, xCharArr, yCharArr; - xCharArr = (__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp->form == 3) || *Op__38_s->f == 10; - yCharArr = (__IN((*y)->typ->comp, 0x0c) && (*y)->typ->BaseTyp->form == 3) || *Op__38_s->g == 10; - if ((((xCharArr && *Op__38_s->g == 3)) && (*y)->class == 7)) { + xCharArr = (__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp->form == 3) || *Op__40_s->f == 10; + yCharArr = (__IN((*y)->typ->comp, 0x0c) && (*y)->typ->BaseTyp->form == 3) || *Op__40_s->g == 10; + if ((((xCharArr && *Op__40_s->g == 3)) && (*y)->class == 7)) { OPB_CharToString(*y); - *Op__38_s->g = 10; + *Op__40_s->g = 10; yCharArr = 1; } - if ((((yCharArr && *Op__38_s->f == 3)) && (*x)->class == 7)) { + if ((((yCharArr && *Op__40_s->f == 3)) && (*x)->class == 7)) { OPB_CharToString(*x); - *Op__38_s->f = 10; + *Op__40_s->f = 10; xCharArr = 1; } ok = (xCharArr && yCharArr); if (ok) { - if ((*Op__38_s->f == 10 && (*x)->conval->intval2 == 1)) { + if ((*Op__40_s->f == 10 && (*x)->conval->intval2 == 1)) { (*x)->typ = OPT_chartyp; (*x)->conval->intval = 0; OPB_Index(&*y, OPB_NewIntConst(((LONGINT)(0)))); - } else if ((*Op__38_s->g == 10 && (*y)->conval->intval2 == 1)) { + } else if ((*Op__40_s->g == 10 && (*y)->conval->intval2 == 1)) { (*y)->typ = OPT_chartyp; (*y)->conval->intval = 0; OPB_Index(&*x, OPB_NewIntConst(((LONGINT)(0)))); @@ -1255,11 +1278,11 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPT_Struct typ = NIL; BOOLEAN do_; LONGINT val; - struct Op__38 _s; + struct Op__40 _s; _s.f = &f; _s.g = &g; - _s.lnk = Op__38_s; - Op__38_s = &_s; + _s.lnk = Op__40_s; + Op__40_s = &_s; z = *x; if (((z->class == 8 || z->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); @@ -1277,15 +1300,8 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPB_err(100); } break; - case 4: - if (__IN(g, 0x01f0)) { - OPB_Convert(&z, y->typ); - } else { - OPB_err(100); - } - break; - case 5: - if (g == 4) { + case 4: case 5: case 6: + if ((__IN(g, 0x70) && y->typ->size < z->typ->size)) { OPB_Convert(&y, z->typ); } else if (__IN(g, 0x01f0)) { OPB_Convert(&z, y->typ); @@ -1293,15 +1309,6 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPB_err(100); } break; - case 6: - if (__IN(g, 0x70)) { - OPB_Convert(&y, z->typ); - } else if (__IN(g, 0x0180)) { - OPB_Convert(&z, y->typ); - } else { - OPB_err(100); - } - break; case 7: if (__IN(g, 0x70)) { OPB_Convert(&y, z->typ); @@ -1387,7 +1394,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) typ = OPT_undftyp; } if (do_) { - NewOp__39(op, typ, &z, y); + NewOp__41(op, typ, &z, y); } break; case 2: @@ -1406,7 +1413,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPB_err(102); typ = OPT_undftyp; } - NewOp__39(op, typ, &z, y); + NewOp__41(op, typ, &z, y); break; case 3: do_ = 1; @@ -1429,7 +1436,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) typ = OPT_undftyp; } if (do_) { - NewOp__39(op, typ, &z, y); + NewOp__41(op, typ, &z, y); } break; case 4: @@ -1447,7 +1454,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPB_err(104); typ = OPT_undftyp; } - NewOp__39(op, typ, &z, y); + NewOp__41(op, typ, &z, y); break; case 5: if (f == 2) { @@ -1457,7 +1464,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } } else if ((y->class == 7 && OPB_IntToBool(y->conval->intval))) { } else { - NewOp__39(op, typ, &z, y); + NewOp__41(op, typ, &z, y); } } else if (f != 0) { OPB_err(94); @@ -1480,7 +1487,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } } if (do_) { - NewOp__39(op, typ, &z, y); + NewOp__41(op, typ, &z, y); } break; case 7: @@ -1489,7 +1496,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) typ = OPT_undftyp; } if ((!__IN(f, 0x70) || y->class != 7) || y->conval->intval != 0) { - NewOp__39(op, typ, &z, y); + NewOp__41(op, typ, &z, y); } break; case 8: @@ -1500,7 +1507,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } } else if ((y->class == 7 && !OPB_IntToBool(y->conval->intval))) { } else { - NewOp__39(op, typ, &z, y); + NewOp__41(op, typ, &z, y); } } else if (f != 0) { OPB_err(95); @@ -1508,16 +1515,16 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 9: case 10: - if (__IN(f, 0x6bff) || strings__41(&z, &y)) { + if (__IN(f, 0x6bff) || strings__43(&z, &y)) { typ = OPT_booltyp; } else { OPB_err(107); typ = OPT_undftyp; } - NewOp__39(op, typ, &z, y); + NewOp__41(op, typ, &z, y); break; case 11: case 12: case 13: case 14: - if (__IN(f, 0x01f9) || strings__41(&z, &y)) { + if (__IN(f, 0x01f9) || strings__43(&z, &y)) { typ = OPT_booltyp; } else { OPM_LogWLn(); @@ -1526,7 +1533,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPB_err(108); typ = OPT_undftyp; } - NewOp__39(op, typ, &z, y); + NewOp__41(op, typ, &z, y); break; default: OPM_LogWStr((CHAR*)"unhandled case in OPB.Op, op = ", (LONGINT)32); @@ -1536,7 +1543,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } } *x = z; - Op__38_s = _s.lnk; + Op__40_s = _s.lnk; } void OPB_SetRange (OPT_Node *x, OPT_Node y) @@ -1547,13 +1554,13 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y) } else if ((__IN((*x)->typ->form, 0x70) && __IN(y->typ->form, 0x70))) { if ((*x)->class == 7) { k = (*x)->conval->intval; - if (0 > k || k > (LONGINT)OPM_MaxSet) { + if (0 > k || k > (SYSTEM_INT64)OPM_MaxSet) { OPB_err(202); } } if (y->class == 7) { l = y->conval->intval; - if (0 > l || l > (LONGINT)OPM_MaxSet) { + if (0 > l || l > (SYSTEM_INT64)OPM_MaxSet) { OPB_err(202); } } @@ -1583,7 +1590,7 @@ void OPB_SetElem (OPT_Node *x) OPB_err(93); } else if ((*x)->class == 7) { k = (*x)->conval->intval; - if ((0 <= k && k <= (LONGINT)OPM_MaxSet)) { + if ((0 <= k && k <= (SYSTEM_INT64)OPM_MaxSet)) { (*x)->conval->setval = __SETOF(k); } else { OPB_err(202); @@ -1597,8 +1604,9 @@ void OPB_SetElem (OPT_Node *x) static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) { + OPT_Struct y = NIL; INTEGER f, g; - OPT_Struct y = NIL, p = NIL, q = NIL; + OPT_Struct p = NIL, q = NIL; if (OPM_Verbose) { OPM_LogWLn(); OPM_LogWStr((CHAR*)"PROCEDURE CheckAssign", (LONGINT)22); @@ -1628,31 +1636,20 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) case 0: case 10: break; case 1: - if (!__IN(g, 0x1a)) { + if (!((__IN(g, 0x7a) && y->size == 1))) { OPB_err(113); } break; - case 2: case 3: case 4: case 9: + case 2: case 3: case 9: if (g != f) { OPB_err(113); } break; - case 5: - if (!__IN(g, 0x30)) { + case 4: case 5: case 6: + if (!__IN(g, 0x70) || x->size < y->size) { OPB_err(113); } break; - case 6: - if (OPM_LIntSize == 4) { - if (!__IN(g, 0x70)) { - OPB_err(113); - } - } else { - if (!__IN(g, 0x70)) { - OPB_err(113); - } - } - break; case 7: if (!__IN(g, 0xf0)) { OPB_err(113); @@ -1833,14 +1830,8 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) x = OPB_NewIntConst(((LONGINT)(0))); x->typ = OPT_chartyp; break; - case 4: - x = OPB_NewIntConst(OPM_MinSInt); - break; - case 5: - x = OPB_NewIntConst(OPM_MinInt); - break; - case 6: - x = OPB_NewIntConst(OPM_MinLInt); + case 4: case 5: case 6: + x = OPB_NewIntConst(OPM_SignedMinimum(x->typ->size)); break; case 9: x = OPB_NewIntConst(((LONGINT)(0))); @@ -1870,14 +1861,8 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) x = OPB_NewIntConst(((LONGINT)(255))); x->typ = OPT_chartyp; break; - case 4: - x = OPB_NewIntConst(OPM_MaxSInt); - break; - case 5: - x = OPB_NewIntConst(OPM_MaxInt); - break; - case 6: - x = OPB_NewIntConst(OPM_MaxLInt); + case 4: case 5: case 6: + x = OPB_NewIntConst(OPM_SignedMaximum(x->typ->size)); break; case 9: x = OPB_NewIntConst(OPM_MaxSet); @@ -1910,10 +1895,8 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 10: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 5) { - OPB_Convert(&x, OPT_sinttyp); - } else if (f == 6) { - OPB_Convert(&x, OPT_inttyp); + } else if ((__IN(f, 0x70) && x->typ->size > (SYSTEM_INT64)OPM_SIntSize)) { + OPB_Convert(&x, OPB_IntType(OPB_ShorterSize(x->typ->size))); } else if (f == 8) { OPB_Convert(&x, OPT_realtyp); } else { @@ -1923,10 +1906,8 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 11: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 4) { - OPB_Convert(&x, OPT_inttyp); - } else if (f == 5) { - OPB_Convert(&x, OPT_linttyp); + } else if ((__IN(f, 0x70) && x->typ->size < (SYSTEM_INT64)OPM_LIntSize)) { + OPB_Convert(&x, OPB_IntType(OPB_LongerSize(x->typ->size))); } else if (f == 7) { OPB_Convert(&x, OPT_lrltyp); } else if (f == 3) { @@ -1974,7 +1955,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (__IN(f, 0x70)) { - if (f != 6) { + if (x->typ->size != (SYSTEM_INT64)OPM_LIntSize) { OPB_Convert(&x, OPT_linttyp); } } else { @@ -2012,9 +1993,9 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 24: case 25: case 28: case 31: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((x->class == 7 && __IN(f, 0x30))) { + } else if ((((x->class == 7 && __IN(f, 0x70))) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!__IN(f, 0x2040)) { + } else if (!((__IN(x->typ->form, 0x2070) && x->typ->size == (SYSTEM_INT64)OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } @@ -2063,13 +2044,13 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) *par0 = x; } -static struct StPar1__52 { - struct StPar1__52 *lnk; -} *StPar1__52_s; +static struct StPar1__56 { + struct StPar1__56 *lnk; +} *StPar1__56_s; -static OPT_Node NewOp__53 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right); +static OPT_Node NewOp__57 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right); -static OPT_Node NewOp__53 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right) +static OPT_Node NewOp__57 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right) { OPT_Node _o_result; OPT_Node node = NIL; @@ -2086,9 +2067,9 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) INTEGER f, L; OPT_Struct typ = NIL; OPT_Node p = NIL, t = NIL; - struct StPar1__52 _s; - _s.lnk = StPar1__52_s; - StPar1__52_s = &_s; + struct StPar1__56 _s; + _s.lnk = StPar1__56_s; + StPar1__56_s = &_s; p = *par0; f = x->typ->form; switch (fctno) { @@ -2104,7 +2085,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) OPB_err(111); } } - p = NewOp__53(19, fctno, p, x); + p = NewOp__57(19, fctno, p, x); p->typ = OPT_notyp; } break; @@ -2112,10 +2093,10 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (__IN(f, 0x70)) { - if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > (LONGINT)OPM_MaxSet))) { + if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > (SYSTEM_INT64)OPM_MaxSet))) { OPB_err(202); } - p = NewOp__53(19, fctno, p, x); + p = NewOp__57(19, fctno, p, x); } else { OPB_err(111); } @@ -2124,7 +2105,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 17: if (!__IN(f, 0x70) || x->class != 7) { OPB_err(69); - } else if (f == 4) { + } else if (x->typ->size == 1) { L = (int)x->conval->intval; typ = p->typ; while ((L > 0 && __IN(typ->comp, 0x0c))) { @@ -2140,7 +2121,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) p = p->left; x->conval->intval += 1; } - p = NewOp__53(12, 19, p, x); + p = NewOp__57(12, 19, p, x); p->typ = OPT_linttyp; } else { p = x; @@ -2162,7 +2143,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) t = x; x = p; p = t; - p = NewOp__53(19, 18, p, x); + p = NewOp__57(19, 18, p, x); } else { OPB_err(111); } @@ -2188,7 +2169,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) } p->obj = NIL; } else { - p = NewOp__53(12, 17, p, x); + p = NewOp__57(12, 17, p, x); p->typ = OPT_linttyp; } } else { @@ -2219,9 +2200,9 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) OPB_err(111); } else { if (fctno == 22) { - p = NewOp__53(12, 27, p, x); + p = NewOp__57(12, 27, p, x); } else { - p = NewOp__53(12, 28, p, x); + p = NewOp__57(12, 28, p, x); } p->typ = p->left->typ; } @@ -2238,7 +2219,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) x = p; p = t; } - p = NewOp__53(19, fctno, p, x); + p = NewOp__57(19, fctno, p, x); } else { OPB_err(111); } @@ -2248,7 +2229,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (__IN(f, 0x70)) { - p = NewOp__53(12, 26, p, x); + p = NewOp__57(12, 26, p, x); } else { OPB_err(111); } @@ -2258,6 +2239,9 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (((x->class == 8 || x->class == 9) || __IN(f, 0x1401)) || x->typ->comp == 3) { OPB_err(126); } + if (x->typ->size < p->typ->size) { + OPB_err(-308); + } t = OPT_NewNode(11); t->subcl = 29; t->left = x; @@ -2269,7 +2253,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (__IN(f, 0x70)) { - p = NewOp__53(19, 30, p, x); + p = NewOp__57(19, 30, p, x); } else { OPB_err(111); } @@ -2278,9 +2262,9 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 31: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((x->class == 7 && __IN(f, 0x30))) { + } else if ((((x->class == 7 && __IN(f, 0x70))) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!__IN(f, 0x2040)) { + } else if (!((__IN(x->typ->form, 0x2070) && x->typ->size == (SYSTEM_INT64)OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } @@ -2315,7 +2299,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) break; } *par0 = p; - StPar1__52_s = _s.lnk; + StPar1__56_s = _s.lnk; } void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n) @@ -2434,7 +2418,7 @@ static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpa ftyp = ftyp->BaseTyp; atyp = atyp->BaseTyp; if ((fvarpar && ftyp == OPT_bytetyp)) { - if (!__IN(f, 0x0c) || !__IN(atyp->form, 0x1e)) { + if (!__IN(f, 0x0c) || !((__IN(atyp->form, 0x7e) && atyp->size == 1))) { if (__IN(18, OPM_opt)) { OPB_err(-301); } @@ -2517,7 +2501,7 @@ void OPB_Param (OPT_Node ap, OPT_Object fp) OPB_err(111); } } else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 13)) { - } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && __IN(ap->typ->form, 0x18))))) { + } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x7e) && ap->typ->size == 1)))))) { OPB_err(123); } else if ((fp->typ->form == 13 && ap->class == 5)) { OPB_err(123); diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index 48c946c5..af419f75 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index 40697da9..bb9b75e6 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -17,12 +17,13 @@ static CHAR OPC_BodyNameExt[13]; export void OPC_Align (LONGINT *adr, LONGINT base); export void OPC_Andent (OPT_Struct typ); static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames); -export LONGINT OPC_Base (OPT_Struct typ); +export LONGINT OPC_BaseAlignment (OPT_Struct typ); export OPT_Object OPC_BaseTProc (OPT_Object obj); export void OPC_BegBlk (void); export void OPC_BegStat (void); static void OPC_CProcDefs (OPT_Object obj, INTEGER vis); export void OPC_Case (LONGINT caseVal, INTEGER form); +static void OPC_CharacterLiteral (LONGINT c); export void OPC_Cmp (INTEGER rel); export void OPC_CompleteIdent (OPT_Object obj); export void OPC_Constant (OPT_Const con, INTEGER form); @@ -74,8 +75,10 @@ static void OPC_PutBase (OPT_Struct typ); static void OPC_PutPtrOffsets (OPT_Struct typ, LONGINT adr, LONGINT *cnt); static void OPC_RegCmds (OPT_Object obj); export void OPC_SetInclude (BOOLEAN exclude); +export LONGINT OPC_SizeAlignment (LONGINT size); static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause); static void OPC_Str1 (CHAR *s, LONGINT s__len, LONGINT x); +static void OPC_StringLiteral (CHAR *s, LONGINT s__len, LONGINT l); export void OPC_TDescDecl (OPT_Struct typ); export void OPC_TypeDefs (OPT_Object obj, INTEGER vis); export void OPC_TypeOf (OPT_Object ap); @@ -316,7 +319,7 @@ void OPC_Andent (OPT_Struct typ) static BOOLEAN OPC_Undefined (OPT_Object obj) { BOOLEAN _o_result; - _o_result = (((obj->mnolev >= 0 && obj->linkadr != (LONGINT)(3 + OPM_currFile))) && obj->linkadr != 2) || obj->name[0] == 0x00; + _o_result = obj->name[0] == 0x00 || (((obj->mnolev >= 0 && obj->linkadr != (SYSTEM_INT64)(3 + OPM_currFile))) && obj->linkadr != 2); return _o_result; } @@ -816,14 +819,15 @@ void OPC_TDescDecl (OPT_Struct typ) OPC_Andent(typ); OPC_Str1((CHAR*)", #", (LONGINT)4, typ->n + 1); OPC_Str1((CHAR*)", #) = {__TDFLDS(", (LONGINT)18, OPC_NofPtrs(typ)); - OPM_Write('\"'); + OPM_Write('"'); if (typ->strobj != NIL) { OPM_WriteStringVar((void*)typ->strobj->name, ((LONGINT)(256))); } - OPC_Str1((CHAR*)"\", #), {", (LONGINT)9, typ->size); + OPM_Write('"'); + OPC_Str1((CHAR*)", #), {", (LONGINT)8, typ->size); nofptrs = 0; OPC_PutPtrOffsets(typ, ((LONGINT)(0)), &nofptrs); - OPC_Str1((CHAR*)"#}}", (LONGINT)4, -((nofptrs + 1) * (LONGINT)OPM_LIntSize)); + OPC_Str1((CHAR*)"#}}", (LONGINT)4, -((nofptrs + 1) * (SYSTEM_INT64)OPM_LIntSize)); OPC_EndStat(); } @@ -865,70 +869,37 @@ void OPC_Align (LONGINT *adr, LONGINT base) } } -LONGINT OPC_Base (OPT_Struct typ) +LONGINT OPC_SizeAlignment (LONGINT size) { LONGINT _o_result; - switch (typ->form) { - case 1: - _o_result = 1; - return _o_result; - break; - case 3: - _o_result = OPM_CharAlign; - return _o_result; - break; - case 2: - _o_result = OPM_BoolAlign; - return _o_result; - break; - case 4: - _o_result = OPM_SIntAlign; - return _o_result; - break; - case 5: - _o_result = OPM_IntAlign; - return _o_result; - break; - case 6: - _o_result = OPM_LIntAlign; - return _o_result; - break; - case 7: - _o_result = OPM_RealAlign; - return _o_result; - break; - case 8: - _o_result = OPM_LRealAlign; - return _o_result; - break; - case 9: - _o_result = OPM_SetAlign; - return _o_result; - break; - case 13: - _o_result = OPM_PointerAlign; - return _o_result; - break; - case 14: - _o_result = OPM_ProcAlign; - return _o_result; - break; - case 15: - if (typ->comp == 4) { - _o_result = __MASK(typ->align, -65536); - return _o_result; - } else { - _o_result = OPC_Base(typ->BaseTyp); - return _o_result; - } - break; - default: - OPM_LogWStr((CHAR*)"unhandled case in OPC.Base, typ^form = ", (LONGINT)40); - OPM_LogWNum(typ->form, ((LONGINT)(0))); - OPM_LogWLn(); - break; + LONGINT alignment; + if (size < (SYSTEM_INT64)OPM_Alignment) { + alignment = 1; + while (alignment < size) { + alignment = __ASHL(alignment, 1); + } + } else { + alignment = OPM_Alignment; } - __RETCHK; + _o_result = alignment; + return _o_result; +} + +LONGINT OPC_BaseAlignment (OPT_Struct typ) +{ + LONGINT _o_result; + LONGINT alignment; + if (typ->form == 15) { + if (typ->comp == 4) { + alignment = __MASK(typ->align, -65536); + } else { + alignment = OPC_BaseAlignment(typ->BaseTyp); + } + } else { + alignment = OPC_SizeAlignment(typ->size); + } + _o_result = alignment; + return _o_result; } static void OPC_FillGap (LONGINT gap, LONGINT off, LONGINT align, LONGINT *n, LONGINT *curAlign) @@ -939,11 +910,11 @@ static void OPC_FillGap (LONGINT gap, LONGINT off, LONGINT align, LONGINT *n, LO if ((*curAlign < align && gap - (adr - off) >= align)) { gap -= (adr - off) + align; OPC_BegStat(); - if (align == (LONGINT)OPM_IntSize) { + if (align == (SYSTEM_INT64)OPM_IntSize) { OPM_WriteString((CHAR*)"INTEGER", (LONGINT)8); - } else if (align == (LONGINT)OPM_LIntSize) { + } else if (align == (SYSTEM_INT64)OPM_LIntSize) { OPM_WriteString((CHAR*)"LONGINT", (LONGINT)8); - } else if (align == (LONGINT)OPM_LRealSize) { + } else if (align == (SYSTEM_INT64)OPM_LRealSize) { OPM_WriteString((CHAR*)"LONGREAL", (LONGINT)9); } OPC_Str1((CHAR*)" _prvt#", (LONGINT)8, *n); @@ -982,7 +953,7 @@ static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, LONGINT *off, LONGINT * } } else { adr = *off; - fldAlign = OPC_Base(fld->typ); + fldAlign = OPC_BaseAlignment(fld->typ); OPC_Align(&adr, fldAlign); gap = fld->adr - adr; if (fldAlign > *curAlign) { @@ -1008,7 +979,7 @@ static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, LONGINT *off, LONGINT * } } if (last) { - adr = typ->size - (LONGINT)__ASHR(typ->sysflag, 8); + adr = typ->size - (SYSTEM_INT64)__ASHR(typ->sysflag, 8); if (adr == 0) { gap = 1; } else { @@ -1171,10 +1142,10 @@ static void OPC_Include (CHAR *name, LONGINT name__len) { __DUP(name, name__len, CHAR); OPM_WriteString((CHAR*)"#include ", (LONGINT)10); - OPM_Write('\"'); + OPM_Write('"'); OPM_WriteStringVar((void*)name, name__len); OPM_WriteString((CHAR*)".h", (LONGINT)3); - OPM_Write('\"'); + OPM_Write('"'); OPM_WriteLn(); __DEL(name); } @@ -1239,8 +1210,8 @@ void OPC_GenHdr (OPT_Node n) static void OPC_GenHeaderMsg (void) { INTEGER i; - OPM_WriteString((CHAR*)"/*", (LONGINT)3); - OPM_WriteString((CHAR*)" voc ", (LONGINT)6); + OPM_WriteString((CHAR*)"/* ", (LONGINT)4); + OPM_WriteString((CHAR*)"voc", (LONGINT)4); OPM_Write(' '); OPM_WriteString(Configuration_versionLong, ((LONGINT)(41))); OPM_Write(' '); @@ -1856,26 +1827,56 @@ void OPC_Cmp (INTEGER rel) } } +static void OPC_CharacterLiteral (LONGINT c) +{ + if (c < 32 || c > 126) { + OPM_WriteString((CHAR*)"0x", (LONGINT)3); + OPM_WriteHex(c); + } else { + OPM_Write('\''); + if ((c == 92 || c == 39) || c == 63) { + OPM_Write('\\'); + } + OPM_Write((CHAR)c); + OPM_Write('\''); + } +} + +static void OPC_StringLiteral (CHAR *s, LONGINT s__len, LONGINT l) +{ + LONGINT i; + INTEGER c; + __DUP(s, s__len, CHAR); + OPM_Write('"'); + i = 0; + while (i < l) { + c = (int)s[__X(i, s__len)]; + if (c < 32 || c > 126) { + OPM_Write('\\'); + OPM_Write((CHAR)(48 + __ASHR(c, 6))); + c = __MASK(c, -64); + OPM_Write((CHAR)(48 + __ASHR(c, 3))); + c = __MASK(c, -8); + OPM_Write((CHAR)(48 + c)); + } else { + if ((c == 92 || c == 34) || c == 63) { + OPM_Write('\\'); + } + OPM_Write((CHAR)c); + } + i += 1; + } + OPM_Write('"'); + __DEL(s); +} + void OPC_Case (LONGINT caseVal, INTEGER form) { CHAR ch; OPM_WriteString((CHAR*)"case ", (LONGINT)6); switch (form) { case 3: - ch = (CHAR)caseVal; - if ((ch >= ' ' && ch <= '~')) { - OPM_Write('\''); - if (((ch == '\\' || ch == '\?') || ch == '\'') || ch == '\"') { - OPM_Write('\\'); - OPM_Write(ch); - } else { - OPM_Write(ch); - } - OPM_Write('\''); - } else { - OPM_WriteString((CHAR*)"0x", (LONGINT)3); - OPM_WriteHex(caseVal); - } + OPC_CharacterLiteral(caseVal); break; case 4: case 5: case 6: OPM_WriteInt(caseVal); @@ -1933,8 +1934,7 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim) void OPC_Constant (OPT_Const con, INTEGER form) { - INTEGER i, len; - CHAR ch; + INTEGER i; SET s; LONGINT hex; BOOLEAN skipLeading; @@ -1946,18 +1946,7 @@ void OPC_Constant (OPT_Const con, INTEGER form) OPM_WriteInt(con->intval); break; case 3: - ch = (CHAR)con->intval; - if ((ch >= ' ' && ch <= '~')) { - OPM_Write('\''); - if (((ch == '\\' || ch == '\?') || ch == '\'') || ch == '\"') { - OPM_Write('\\'); - } - OPM_Write(ch); - OPM_Write('\''); - } else { - OPM_WriteString((CHAR*)"0x", (LONGINT)3); - OPM_WriteHex(con->intval); - } + OPC_CharacterLiteral(con->intval); break; case 4: case 5: case 6: OPM_WriteInt(con->intval); @@ -1992,18 +1981,7 @@ void OPC_Constant (OPT_Const con, INTEGER form) } break; case 10: - OPM_Write('\"'); - len = (int)con->intval2 - 1; - i = 0; - while (i < len) { - ch = (*con->ext)[__X(i, ((LONGINT)(256)))]; - if (((ch == '\\' || ch == '\?') || ch == '\'') || ch == '\"') { - OPM_Write('\\'); - } - OPM_Write(ch); - i += 1; - } - OPM_Write('\"'); + OPC_StringLiteral(*con->ext, ((LONGINT)(256)), con->intval2 - 1); break; case 11: OPM_WriteString((CHAR*)"NIL", (LONGINT)4); @@ -2016,74 +1994,74 @@ void OPC_Constant (OPT_Const con, INTEGER form) } } -static struct InitKeywords__47 { +static struct InitKeywords__48 { SHORTINT *n; - struct InitKeywords__47 *lnk; -} *InitKeywords__47_s; + struct InitKeywords__48 *lnk; +} *InitKeywords__48_s; -static void Enter__48 (CHAR *s, LONGINT s__len); +static void Enter__49 (CHAR *s, LONGINT s__len); -static void Enter__48 (CHAR *s, LONGINT s__len) +static void Enter__49 (CHAR *s, LONGINT s__len) { INTEGER h; __DUP(s, s__len, CHAR); h = OPC_PerfectHash((void*)s, s__len); - OPC_hashtab[__X(h, ((LONGINT)(105)))] = *InitKeywords__47_s->n; - __COPY(s, OPC_keytab[__X(*InitKeywords__47_s->n, ((LONGINT)(36)))], ((LONGINT)(9))); - *InitKeywords__47_s->n += 1; + OPC_hashtab[__X(h, ((LONGINT)(105)))] = *InitKeywords__48_s->n; + __COPY(s, OPC_keytab[__X(*InitKeywords__48_s->n, ((LONGINT)(36)))], ((LONGINT)(9))); + *InitKeywords__48_s->n += 1; __DEL(s); } static void OPC_InitKeywords (void) { SHORTINT n, i; - struct InitKeywords__47 _s; + struct InitKeywords__48 _s; _s.n = &n; - _s.lnk = InitKeywords__47_s; - InitKeywords__47_s = &_s; + _s.lnk = InitKeywords__48_s; + InitKeywords__48_s = &_s; n = 0; i = 0; while (i <= 104) { OPC_hashtab[__X(i, ((LONGINT)(105)))] = -1; i += 1; } - Enter__48((CHAR*)"asm", (LONGINT)4); - Enter__48((CHAR*)"auto", (LONGINT)5); - Enter__48((CHAR*)"break", (LONGINT)6); - Enter__48((CHAR*)"case", (LONGINT)5); - Enter__48((CHAR*)"char", (LONGINT)5); - Enter__48((CHAR*)"const", (LONGINT)6); - Enter__48((CHAR*)"continue", (LONGINT)9); - Enter__48((CHAR*)"default", (LONGINT)8); - Enter__48((CHAR*)"do", (LONGINT)3); - Enter__48((CHAR*)"double", (LONGINT)7); - Enter__48((CHAR*)"else", (LONGINT)5); - Enter__48((CHAR*)"enum", (LONGINT)5); - Enter__48((CHAR*)"extern", (LONGINT)7); - Enter__48((CHAR*)"export", (LONGINT)7); - Enter__48((CHAR*)"float", (LONGINT)6); - Enter__48((CHAR*)"for", (LONGINT)4); - Enter__48((CHAR*)"fortran", (LONGINT)8); - Enter__48((CHAR*)"goto", (LONGINT)5); - Enter__48((CHAR*)"if", (LONGINT)3); - Enter__48((CHAR*)"import", (LONGINT)7); - Enter__48((CHAR*)"int", (LONGINT)4); - Enter__48((CHAR*)"long", (LONGINT)5); - Enter__48((CHAR*)"register", (LONGINT)9); - Enter__48((CHAR*)"return", (LONGINT)7); - Enter__48((CHAR*)"short", (LONGINT)6); - Enter__48((CHAR*)"signed", (LONGINT)7); - Enter__48((CHAR*)"sizeof", (LONGINT)7); - Enter__48((CHAR*)"static", (LONGINT)7); - Enter__48((CHAR*)"struct", (LONGINT)7); - Enter__48((CHAR*)"switch", (LONGINT)7); - Enter__48((CHAR*)"typedef", (LONGINT)8); - Enter__48((CHAR*)"union", (LONGINT)6); - Enter__48((CHAR*)"unsigned", (LONGINT)9); - Enter__48((CHAR*)"void", (LONGINT)5); - Enter__48((CHAR*)"volatile", (LONGINT)9); - Enter__48((CHAR*)"while", (LONGINT)6); - InitKeywords__47_s = _s.lnk; + Enter__49((CHAR*)"asm", (LONGINT)4); + Enter__49((CHAR*)"auto", (LONGINT)5); + Enter__49((CHAR*)"break", (LONGINT)6); + Enter__49((CHAR*)"case", (LONGINT)5); + Enter__49((CHAR*)"char", (LONGINT)5); + Enter__49((CHAR*)"const", (LONGINT)6); + Enter__49((CHAR*)"continue", (LONGINT)9); + Enter__49((CHAR*)"default", (LONGINT)8); + Enter__49((CHAR*)"do", (LONGINT)3); + Enter__49((CHAR*)"double", (LONGINT)7); + Enter__49((CHAR*)"else", (LONGINT)5); + Enter__49((CHAR*)"enum", (LONGINT)5); + Enter__49((CHAR*)"extern", (LONGINT)7); + Enter__49((CHAR*)"export", (LONGINT)7); + Enter__49((CHAR*)"float", (LONGINT)6); + Enter__49((CHAR*)"for", (LONGINT)4); + Enter__49((CHAR*)"fortran", (LONGINT)8); + Enter__49((CHAR*)"goto", (LONGINT)5); + Enter__49((CHAR*)"if", (LONGINT)3); + Enter__49((CHAR*)"import", (LONGINT)7); + Enter__49((CHAR*)"int", (LONGINT)4); + Enter__49((CHAR*)"long", (LONGINT)5); + Enter__49((CHAR*)"register", (LONGINT)9); + Enter__49((CHAR*)"return", (LONGINT)7); + Enter__49((CHAR*)"short", (LONGINT)6); + Enter__49((CHAR*)"signed", (LONGINT)7); + Enter__49((CHAR*)"sizeof", (LONGINT)7); + Enter__49((CHAR*)"static", (LONGINT)7); + Enter__49((CHAR*)"struct", (LONGINT)7); + Enter__49((CHAR*)"switch", (LONGINT)7); + Enter__49((CHAR*)"typedef", (LONGINT)8); + Enter__49((CHAR*)"union", (LONGINT)6); + Enter__49((CHAR*)"unsigned", (LONGINT)9); + Enter__49((CHAR*)"void", (LONGINT)5); + Enter__49((CHAR*)"volatile", (LONGINT)9); + Enter__49((CHAR*)"while", (LONGINT)6); + InitKeywords__48_s = _s.lnk; } diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index 58679d74..37a86252 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h @@ -12,7 +12,7 @@ import void OPC_Align (LONGINT *adr, LONGINT base); import void OPC_Andent (OPT_Struct typ); -import LONGINT OPC_Base (OPT_Struct typ); +import LONGINT OPC_BaseAlignment (OPT_Struct typ); import OPT_Object OPC_BaseTProc (OPT_Object obj); import void OPC_BegBlk (void); import void OPC_BegStat (void); @@ -41,6 +41,7 @@ import void OPC_InitTDesc (OPT_Struct typ); import void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim); import LONGINT OPC_NofPtrs (OPT_Struct typ); import void OPC_SetInclude (BOOLEAN exclude); +import LONGINT OPC_SizeAlignment (LONGINT size); import void OPC_TDescDecl (OPT_Struct typ); import void OPC_TypeDefs (OPT_Object obj, INTEGER vis); import void OPC_TypeOf (OPT_Object ap); diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 40d53974..50047c9e 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -15,8 +15,8 @@ typedef static CHAR OPM_SourceFileName[256]; -export INTEGER OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_CharAlign, OPM_BoolAlign, OPM_SIntAlign, OPM_IntAlign, OPM_LIntAlign, OPM_SetAlign, OPM_RealAlign, OPM_LRealAlign, OPM_PointerAlign, OPM_ProcAlign, OPM_RecAlign, OPM_MaxSet; -export LONGINT OPM_MinSInt, OPM_MinInt, OPM_MinLInt, OPM_MaxSInt, OPM_MaxInt, OPM_MaxLInt, OPM_MaxIndex; +export INTEGER OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet; +export LONGINT OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; export LONGINT OPM_curpos, OPM_errpos, OPM_breakpc; @@ -58,7 +58,6 @@ export void OPM_LogWNum (LONGINT i, LONGINT len); export void OPM_LogWStr (CHAR *s, LONGINT s__len); static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len); export void OPM_Mark (INTEGER n, LONGINT pos); -static INTEGER OPM_Min (INTEGER a, INTEGER b); export void OPM_NewSym (CHAR *modName, LONGINT modName__len); export void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); export void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); @@ -66,6 +65,8 @@ export BOOLEAN OPM_OpenPar (void); export void OPM_RegisterNewSym (void); static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt); static void OPM_ShowLine (LONGINT pos); +export LONGINT OPM_SignedMaximum (LONGINT bytecount); +export LONGINT OPM_SignedMinimum (LONGINT bytecount); export void OPM_SymRCh (CHAR *ch); export LONGINT OPM_SymRInt (void); export void OPM_SymRLReal (LONGREAL *lr); @@ -86,7 +87,7 @@ export void OPM_WriteString (CHAR *s, LONGINT s__len); export void OPM_WriteStringVar (CHAR *s, LONGINT s__len); export BOOLEAN OPM_eofSF (void); export void OPM_err (INTEGER n); -static LONGINT OPM_minus (LONGINT i); +static LONGINT OPM_minusop (LONGINT i); static LONGINT OPM_power0 (LONGINT i, LONGINT j); @@ -118,50 +119,38 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) i = 1; while (s[__X(i, s__len)] != 0x00) { switch (s[__X(i, s__len)]) { - case 'e': - *opt = *opt ^ 0x0200; - break; - case 's': - *opt = *opt ^ 0x10; - break; - case 'm': - *opt = *opt ^ 0x0400; - break; - case 'x': - *opt = *opt ^ 0x01; - break; - case 'r': - *opt = *opt ^ 0x04; - break; - case 't': - *opt = *opt ^ 0x08; - break; case 'a': *opt = *opt ^ 0x80; break; - case 'k': - *opt = *opt ^ 0x40; - break; - case 'p': - *opt = *opt ^ 0x20; - break; - case 'S': - *opt = *opt ^ 0x2000; - break; case 'c': *opt = *opt ^ 0x4000; break; - case 'M': - *opt = *opt ^ 0x8000; + case 'e': + *opt = *opt ^ 0x0200; break; case 'f': *opt = *opt ^ 0x010000; break; - case 'F': - *opt = *opt ^ 0x020000; + case 'k': + *opt = *opt ^ 0x40; break; - case 'V': - *opt = *opt ^ 0x040000; + case 'm': + *opt = *opt ^ 0x0400; + break; + case 'p': + *opt = *opt ^ 0x20; + break; + case 'r': + *opt = *opt ^ 0x04; + break; + case 's': + *opt = *opt ^ 0x10; + break; + case 't': + *opt = *opt ^ 0x08; + break; + case 'x': + *opt = *opt ^ 0x01; break; case 'B': if (s[__X(i + 1, s__len)] != 0x00) { @@ -179,6 +168,19 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) __ASSERT(OPM_IntSize == 2 || OPM_IntSize == 4, 0); __ASSERT(OPM_PointerSize == 4 || OPM_PointerSize == 8, 0); __ASSERT(OPM_Alignment == 4 || OPM_Alignment == 8, 0); + Files_SetSearchPath((CHAR*)"", (LONGINT)1); + break; + case 'F': + *opt = *opt ^ 0x020000; + break; + case 'M': + *opt = *opt ^ 0x8000; + break; + case 'S': + *opt = *opt ^ 0x2000; + break; + case 'V': + *opt = *opt ^ 0x040000; break; default: OPM_LogWStr((CHAR*)" warning: option ", (LONGINT)19); @@ -228,17 +230,17 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWLn(); OPM_LogWStr((CHAR*)" x - turn off array indices check", (LONGINT)35); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" a - don\'t check ASSERTs at runtime, use this option in tested production code", (LONGINT)80); + OPM_LogWStr((CHAR*)" a - don't check ASSERTs at runtime, use this option in tested production code", (LONGINT)80); OPM_LogWLn(); OPM_LogWStr((CHAR*)" p - turn off automatic pointer initialization", (LONGINT)48); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" t - don\'t check type guards (use in rare cases such as low-level modules where every cycle counts)", (LONGINT)101); + OPM_LogWStr((CHAR*)" t - don't check type guards (use in rare cases such as low-level modules where every cycle counts)", (LONGINT)101); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" S - don\'t call external assembler/compiler, only generate C code", (LONGINT)67); + OPM_LogWStr((CHAR*)" S - don't call external assembler/compiler, only generate C code", (LONGINT)67); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" c - don\'t call linker", (LONGINT)24); + OPM_LogWStr((CHAR*)" c - don't call linker", (LONGINT)24); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" f - don\'t use color output", (LONGINT)29); + OPM_LogWStr((CHAR*)" f - don't use color output", (LONGINT)29); OPM_LogWLn(); OPM_LogWStr((CHAR*)" F - force writing new symbol file in current directory", (LONGINT)57); OPM_LogWLn(); @@ -541,16 +543,17 @@ void OPM_FPrintSet (LONGINT *fp, SET set) void OPM_FPrintReal (LONGINT *fp, REAL real) { - OPM_FPrint(&*fp, __VAL(LONGINT, real)); + INTEGER i; + LONGINT l; + __GET((LONGINT)(SYSTEM_ADDRESS)&real, i, INTEGER); + l = i; + OPM_FPrint(&*fp, l); } void OPM_FPrintLReal (LONGINT *fp, LONGREAL lr) { LONGINT l, h; - __GET((LONGINT)(uintptr_t)&lr, l, LONGINT); - __GET((LONGINT)(uintptr_t)&lr + 4, h, LONGINT); - OPM_FPrint(&*fp, l); - OPM_FPrint(&*fp, h); + OPM_FPrint(&*fp, __VAL(LONGINT, lr)); } static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONGINT name__len, INTEGER *size, INTEGER *align) @@ -576,7 +579,7 @@ static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONG __DEL(name); } -static LONGINT OPM_minus (LONGINT i) +static LONGINT OPM_minusop (LONGINT i) { LONGINT _o_result; _o_result = -i; @@ -604,103 +607,62 @@ static void OPM_VerboseListSizes (void) OPM_LogWLn(); OPM_LogWStr((CHAR*)"CHAR ", (LONGINT)14); OPM_LogWNum(OPM_CharSize, ((LONGINT)(4))); - OPM_LogWNum(OPM_CharAlign, ((LONGINT)(5))); OPM_LogWLn(); OPM_LogWStr((CHAR*)"BOOLEAN ", (LONGINT)14); OPM_LogWNum(OPM_BoolSize, ((LONGINT)(4))); - OPM_LogWNum(OPM_BoolAlign, ((LONGINT)(5))); OPM_LogWLn(); OPM_LogWStr((CHAR*)"SHORTINT ", (LONGINT)14); OPM_LogWNum(OPM_SIntSize, ((LONGINT)(4))); - OPM_LogWNum(OPM_SIntAlign, ((LONGINT)(5))); OPM_LogWLn(); OPM_LogWStr((CHAR*)"INTEGER ", (LONGINT)14); OPM_LogWNum(OPM_IntSize, ((LONGINT)(4))); - OPM_LogWNum(OPM_IntAlign, ((LONGINT)(5))); OPM_LogWLn(); OPM_LogWStr((CHAR*)"LONGINT ", (LONGINT)14); OPM_LogWNum(OPM_LIntSize, ((LONGINT)(4))); - OPM_LogWNum(OPM_LIntAlign, ((LONGINT)(5))); OPM_LogWLn(); OPM_LogWStr((CHAR*)"SET ", (LONGINT)14); OPM_LogWNum(OPM_SetSize, ((LONGINT)(4))); - OPM_LogWNum(OPM_SetAlign, ((LONGINT)(5))); OPM_LogWLn(); OPM_LogWStr((CHAR*)"REAL ", (LONGINT)14); OPM_LogWNum(OPM_RealSize, ((LONGINT)(4))); - OPM_LogWNum(OPM_RealAlign, ((LONGINT)(5))); OPM_LogWLn(); OPM_LogWStr((CHAR*)"LONGREAL ", (LONGINT)14); OPM_LogWNum(OPM_LRealSize, ((LONGINT)(4))); - OPM_LogWNum(OPM_LRealAlign, ((LONGINT)(5))); OPM_LogWLn(); OPM_LogWStr((CHAR*)"PTR ", (LONGINT)14); OPM_LogWNum(OPM_PointerSize, ((LONGINT)(4))); - OPM_LogWNum(OPM_PointerAlign, ((LONGINT)(5))); OPM_LogWLn(); OPM_LogWStr((CHAR*)"PROC ", (LONGINT)14); OPM_LogWNum(OPM_ProcSize, ((LONGINT)(4))); - OPM_LogWNum(OPM_ProcAlign, ((LONGINT)(5))); OPM_LogWLn(); OPM_LogWStr((CHAR*)"RECORD ", (LONGINT)14); OPM_LogWNum(OPM_RecSize, ((LONGINT)(4))); - OPM_LogWNum(OPM_RecAlign, ((LONGINT)(5))); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Min shortint ", (LONGINT)14); - OPM_LogWNum(OPM_MinSInt, ((LONGINT)(4))); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Max shortint ", (LONGINT)14); - OPM_LogWNum(OPM_MaxSInt, ((LONGINT)(4))); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Min integer ", (LONGINT)14); - OPM_LogWNum(OPM_MinInt, ((LONGINT)(4))); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Max integer ", (LONGINT)14); - OPM_LogWNum(OPM_MaxInt, ((LONGINT)(4))); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Min longint ", (LONGINT)14); - OPM_LogWNum(OPM_MinLInt, ((LONGINT)(4))); - OPM_LogWLn(); } -static INTEGER OPM_Min (INTEGER a, INTEGER b) +LONGINT OPM_SignedMaximum (LONGINT bytecount) { - INTEGER _o_result; - if (a < b) { - _o_result = a; - return _o_result; - } else { - _o_result = b; - return _o_result; - } - __RETCHK; + LONGINT _o_result; + LONGINT result; + result = 1; + result = __LSH(result, __ASHL(bytecount, 3) - 1, LONGINT); + _o_result = result - 1; + return _o_result; +} + +LONGINT OPM_SignedMinimum (LONGINT bytecount) +{ + LONGINT _o_result; + _o_result = -OPM_SignedMaximum(bytecount) - 1; + return _o_result; } static void OPM_GetProperties (void) { - LONGINT base; OPM_ProcSize = OPM_PointerSize; OPM_LIntSize = __ASHL(OPM_IntSize, 1); OPM_SetSize = OPM_LIntSize; - OPM_CharAlign = OPM_Min(OPM_Alignment, OPM_CharSize); - OPM_BoolAlign = OPM_Min(OPM_Alignment, OPM_BoolSize); - OPM_SIntAlign = OPM_Min(OPM_Alignment, OPM_SIntSize); - OPM_RecAlign = OPM_Min(OPM_Alignment, OPM_RecSize); - OPM_RealAlign = OPM_Min(OPM_Alignment, OPM_RealSize); - OPM_LRealAlign = OPM_Min(OPM_Alignment, OPM_LRealSize); - OPM_PointerAlign = OPM_Min(OPM_Alignment, OPM_PointerSize); - OPM_ProcAlign = OPM_Min(OPM_Alignment, OPM_ProcSize); - OPM_IntAlign = OPM_Min(OPM_Alignment, OPM_IntSize); - OPM_LIntAlign = OPM_Min(OPM_Alignment, OPM_LIntSize); - OPM_SetAlign = OPM_Min(OPM_Alignment, OPM_SetSize); - base = -2; - OPM_MinSInt = __ASH(base, __ASHL(OPM_SIntSize, 3) - 2); - OPM_MaxSInt = OPM_minus(OPM_MinSInt + 1); - OPM_MinInt = __ASH(base, __ASHL(OPM_IntSize, 3) - 2); - OPM_MaxInt = OPM_minus(OPM_MinInt + 1); - OPM_MinLInt = __ASH(base, __ASHL(OPM_LIntSize, 3) - 2); - OPM_MaxLInt = OPM_minus(OPM_MinLInt + 1); if (OPM_RealSize == 4) { OPM_MaxReal = 3.40282346000000e+038; } else if (OPM_RealSize == 8) { @@ -714,7 +676,7 @@ static void OPM_GetProperties (void) OPM_MinReal = -OPM_MaxReal; OPM_MinLReal = -OPM_MaxLReal; OPM_MaxSet = __ASHL(OPM_SetSize, 3) - 1; - OPM_MaxIndex = OPM_MaxLInt; + OPM_MaxIndex = OPM_SignedMaximum(OPM_PointerSize); if (OPM_Verbose) { OPM_VerboseListSizes(); } @@ -876,7 +838,7 @@ void OPM_WriteInt (LONGINT i) { CHAR s[20]; LONGINT i1, k; - if (i == OPM_MinInt || i == OPM_MinLInt) { + if (i == OPM_SignedMinimum(OPM_IntSize) || i == OPM_SignedMinimum(OPM_LIntSize)) { OPM_Write('('); OPM_WriteInt(i + 1); OPM_WriteString((CHAR*)"-1)", (LONGINT)4); @@ -909,7 +871,7 @@ void OPM_WriteReal (LONGREAL r, CHAR suffx) CHAR s[32]; CHAR ch; INTEGER i; - if ((((r < OPM_MaxLInt && r > OPM_MinLInt)) && r == (__ENTIER(r)))) { + if ((((r < OPM_SignedMaximum(OPM_LIntSize) && r > OPM_SignedMinimum(OPM_LIntSize))) && r == (__ENTIER(r)))) { if (suffx == 'f') { OPM_WriteString((CHAR*)"(REAL)", (LONGINT)7); } else { diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index 2e93dfcf..1706f8f1 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h @@ -7,8 +7,8 @@ #include "SYSTEM.h" -import INTEGER OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_CharAlign, OPM_BoolAlign, OPM_SIntAlign, OPM_IntAlign, OPM_LIntAlign, OPM_SetAlign, OPM_RealAlign, OPM_LRealAlign, OPM_PointerAlign, OPM_ProcAlign, OPM_RecAlign, OPM_MaxSet; -import LONGINT OPM_MinSInt, OPM_MinInt, OPM_MinLInt, OPM_MaxSInt, OPM_MaxInt, OPM_MaxLInt, OPM_MaxIndex; +import INTEGER OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet; +import LONGINT OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; import LONGINT OPM_curpos, OPM_errpos, OPM_breakpc; @@ -39,6 +39,8 @@ import void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); import void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); import BOOLEAN OPM_OpenPar (void); import void OPM_RegisterNewSym (void); +import LONGINT OPM_SignedMaximum (LONGINT bytecount); +import LONGINT OPM_SignedMinimum (LONGINT bytecount); import void OPM_SymRCh (CHAR *ch); import LONGINT OPM_SymRInt (void); import void OPM_SymRLReal (LONGREAL *lr); diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index 9ce53b1f..be7c13b5 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPB.h" @@ -439,10 +439,10 @@ static void OPP_TypeDecl (OPT_Struct *typ, OPT_Struct *banned) if (OPP_sym == 38) { OPP_qualident(&id); if (id->mode == 5) { - if (id->typ != *banned) { - *typ = id->typ; - } else { + if (id->typ == *banned) { OPP_err(58); + } else { + *typ = id->typ; } } else { OPP_err(52); @@ -1784,6 +1784,24 @@ void OPP_Module (OPT_Node *prog, SET opt) if (OPP_sym == 63) { OPS_Get(&OPP_sym); } else { + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Unexpected symbol found when MODULE expected:", (LONGINT)46); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" sym: ", (LONGINT)15); + OPM_LogWNum(OPP_sym, ((LONGINT)(1))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" OPS.name: ", (LONGINT)15); + OPM_LogWStr(OPS_name, ((LONGINT)(256))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" OPS.str: ", (LONGINT)15); + OPM_LogWStr(OPS_str, ((LONGINT)(256))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" OPS.numtyp: ", (LONGINT)15); + OPM_LogWNum(OPS_numtyp, ((LONGINT)(1))); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" OPS.intval: ", (LONGINT)15); + OPM_LogWNum(OPS_intval, ((LONGINT)(1))); + OPM_LogWLn(); OPP_err(16); } if (OPP_sym == 38) { diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index 372c5f88..0b3b1b2c 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index 8276ecf9..cc04e014 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" @@ -174,7 +174,7 @@ static void OPS_Number (void) OPS_numtyp = 1; if (n <= 2) { while (i < n) { - OPS_intval = __ASHL(OPS_intval, 4) + (LONGINT)Ord__7(dig[i], 1); + OPS_intval = __ASHL(OPS_intval, 4) + (SYSTEM_INT64)Ord__7(dig[i], 1); i += 1; } } else { @@ -189,7 +189,7 @@ static void OPS_Number (void) OPS_intval = -1; } while (i < n) { - OPS_intval = __ASHL(OPS_intval, 4) + (LONGINT)Ord__7(dig[i], 1); + OPS_intval = __ASHL(OPS_intval, 4) + (SYSTEM_INT64)Ord__7(dig[i], 1); i += 1; } } else { @@ -200,8 +200,8 @@ static void OPS_Number (void) while (i < n) { d = Ord__7(dig[i], 0); i += 1; - if (OPS_intval <= __DIV(9223372036854775807 - (LONGINT)d, 10)) { - OPS_intval = OPS_intval * 10 + (LONGINT)d; + if (OPS_intval <= __DIV(9223372036854775807 - (SYSTEM_INT64)d, 10)) { + OPS_intval = OPS_intval * 10 + (SYSTEM_INT64)d; } else { OPS_err(203); } @@ -326,7 +326,7 @@ void OPS_Get (SHORTINT *sym) } } switch (OPS_ch) { - case '\"': case '\'': + case '"': case '\'': OPS_Str(&s); break; case '#': diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index 8f1581bb..32148c49 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index 7f03064b..a0d41c71 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" @@ -850,7 +850,7 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval) conval->intval = 0; break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPT.InConstant(), f = ", (LONGINT)41); + OPM_LogWStr((CHAR*)"unhandled case in InConstant(), f = ", (LONGINT)37); OPM_LogWNum(f, ((LONGINT)(0))); OPM_LogWLn(); break; @@ -1073,7 +1073,7 @@ static void OPT_InStruct (OPT_Struct *typ) OPT_InSign(mno, &(*typ)->BaseTyp, &(*typ)->link); break; default: - OPM_LogWStr((CHAR*)"unhandled case at OPT.InStruct, tag = ", (LONGINT)39); + OPM_LogWStr((CHAR*)"unhandled case at InStruct, tag = ", (LONGINT)35); OPM_LogWNum(tag, ((LONGINT)(0))); OPM_LogWLn(); break; @@ -1176,7 +1176,7 @@ static OPT_Object OPT_InObj (SHORTINT mno) } break; default: - OPM_LogWStr((CHAR*)"unhandled case at OPT.InObj, tag = ", (LONGINT)36); + OPM_LogWStr((CHAR*)"unhandled case at InObj, tag = ", (LONGINT)32); OPM_LogWNum(tag, ((LONGINT)(0))); OPM_LogWLn(); break; @@ -1465,14 +1465,14 @@ static void OPT_OutStr (OPT_Struct typ) OPM_SymWInt(((LONGINT)(18))); break; default: - OPM_LogWStr((CHAR*)"unhandled case at OPT.OutStr, typ^.comp = ", (LONGINT)43); + OPM_LogWStr((CHAR*)"unhandled case at OutStr, typ^.comp = ", (LONGINT)39); OPM_LogWNum(typ->comp, ((LONGINT)(0))); OPM_LogWLn(); break; } break; default: - OPM_LogWStr((CHAR*)"unhandled case at OPT.OutStr, typ^.form = ", (LONGINT)43); + OPM_LogWStr((CHAR*)"unhandled case at OutStr, typ^.form = ", (LONGINT)39); OPM_LogWNum(typ->form, ((LONGINT)(0))); OPM_LogWLn(); break; @@ -1537,7 +1537,7 @@ static void OPT_OutObj (OPT_Object obj) OPT_FPrintErr(obj, 251); break; default: - OPM_LogWStr((CHAR*)"unhandled case at OPT.OutObj, obj^.history = ", (LONGINT)46); + OPM_LogWStr((CHAR*)"unhandled case at OutObj, obj^.history = ", (LONGINT)42); OPM_LogWNum(obj->history, ((LONGINT)(0))); OPM_LogWLn(); break; @@ -1593,7 +1593,7 @@ static void OPT_OutObj (OPT_Object obj) OPT_OutName((void*)obj->name, ((LONGINT)(256))); break; default: - OPM_LogWStr((CHAR*)"unhandled case at OPT.OutObj, obj.mode = ", (LONGINT)42); + OPM_LogWStr((CHAR*)"unhandled case at OutObj, obj.mode = ", (LONGINT)38); OPM_LogWNum(obj->mode, ((LONGINT)(0))); OPM_LogWLn(); break; @@ -1810,6 +1810,7 @@ export void *OPT__init(void) OPT_syslink = OPT_topScope->right; OPT_universe = OPT_topScope; OPT_topScope->right = NIL; + OPT_EnterTyp((CHAR*)"BOOLEAN", 2, OPM_BoolSize, &OPT_booltyp); OPT_EnterTyp((CHAR*)"CHAR", 3, OPM_CharSize, &OPT_chartyp); OPT_EnterTyp((CHAR*)"SET", 9, OPM_SetSize, &OPT_settyp); OPT_EnterTyp((CHAR*)"REAL", 7, OPM_RealSize, &OPT_realtyp); @@ -1817,7 +1818,6 @@ export void *OPT__init(void) OPT_EnterTyp((CHAR*)"LONGINT", 6, OPM_LIntSize, &OPT_linttyp); OPT_EnterTyp((CHAR*)"LONGREAL", 8, OPM_LRealSize, &OPT_lrltyp); OPT_EnterTyp((CHAR*)"SHORTINT", 4, OPM_SIntSize, &OPT_sinttyp); - OPT_EnterTyp((CHAR*)"BOOLEAN", 2, OPM_BoolSize, &OPT_booltyp); OPT_EnterBoolConst((CHAR*)"FALSE", ((LONGINT)(0))); OPT_EnterBoolConst((CHAR*)"TRUE", ((LONGINT)(1))); OPT_EnterProc((CHAR*)"HALT", 0); diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 7e03d42c..ab2c4684 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h @@ -60,8 +60,7 @@ typedef INTEGER ref, sysflag; LONGINT n, size, align, txtpos; BOOLEAN allocated, pbused, pvused; - char _prvt0[8]; - LONGINT pbfp, pvfp; + char _prvt0[24]; OPT_Struct BaseTyp; OPT_Object link, strobj; } OPT_StrDesc; diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index c86ba15e..ae14f629 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPC.h" @@ -24,7 +24,7 @@ export LONGINT *OPV_ExitInfo__typ; static void OPV_ActualPar (OPT_Node n, OPT_Object fp); export void OPV_AdrAndSize (OPT_Object topScope); static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc); -static void OPV_Convert (OPT_Node n, INTEGER form, INTEGER prec); +static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec); static void OPV_DefineTDescs (OPT_Node n); static void OPV_Entier (OPT_Node n, INTEGER prec); static void OPV_GetTProcNum (OPT_Object obj); @@ -39,6 +39,7 @@ static LONGINT OPV_NaturalAlignment (LONGINT size, LONGINT max); static void OPV_NewArr (OPT_Node d, OPT_Node x); static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, INTEGER comp); static BOOLEAN OPV_SideEffects (OPT_Node n); +static void OPV_SizeCast (LONGINT size); static void OPV_Stamp (OPS_Name s); static OPT_Object OPV_SuperProc (OPT_Node n); static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported); @@ -83,10 +84,10 @@ void OPV_TypSize (OPT_Struct typ) btyp = typ->BaseTyp; if (btyp == NIL) { offset = 0; - base = OPM_RecAlign; + base = OPC_SizeAlignment(OPM_RecSize); } else { OPV_TypSize(btyp); - offset = btyp->size - (LONGINT)__ASHR(btyp->sysflag, 8); + offset = btyp->size - (SYSTEM_INT64)__ASHR(btyp->sysflag, 8); base = btyp->align; } fld = typ->link; @@ -94,7 +95,7 @@ void OPV_TypSize (OPT_Struct typ) btyp = fld->typ; OPV_TypSize(btyp); size = btyp->size; - fbase = OPC_Base(btyp); + fbase = OPC_BaseAlignment(btyp); OPC_Align(&offset, fbase); fld->adr = offset; offset += size; @@ -108,7 +109,7 @@ void OPV_TypSize (OPT_Struct typ) offset = 1; } if (OPM_RecSize == 0) { - base = OPV_NaturalAlignment(offset, OPM_RecAlign); + base = OPV_NaturalAlignment(offset, OPC_SizeAlignment(OPM_RecSize)); } OPC_Align(&offset, base); if ((typ->strobj == NIL && __MASK(typ->align, -65536) == 0)) { @@ -333,7 +334,7 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN return _o_result; break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence Nmop, subclass = ", (LONGINT)51); + OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Nmop, subclass = ", (LONGINT)55); OPM_LogWNum(subclass, ((LONGINT)(0))); OPM_LogWLn(); break; @@ -403,7 +404,7 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN return _o_result; break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence Ndop, subclass = ", (LONGINT)51); + OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Ndop, subclass = ", (LONGINT)55); OPM_LogWNum(subclass, ((LONGINT)(0))); OPM_LogWLn(); break; @@ -466,41 +467,26 @@ static void OPV_Entier (OPT_Node n, INTEGER prec) } } -static void OPV_Convert (OPT_Node n, INTEGER form, INTEGER prec) +static void OPV_SizeCast (LONGINT size) { - INTEGER from; + if (size <= 4) { + OPM_WriteString((CHAR*)"(int)", (LONGINT)6); + } else { + OPM_WriteString((CHAR*)"(SYSTEM_INT64)", (LONGINT)15); + } +} + +static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec) +{ + INTEGER from, to; from = n->typ->form; - if (form == 9) { + to = newtype->form; + if (to == 9) { OPM_WriteString((CHAR*)"__SETOF(", (LONGINT)9); OPV_Entier(n, -1); OPM_Write(')'); - } else if (form == 6) { - if (from < 6) { - OPM_WriteString((CHAR*)"(LONGINT)", (LONGINT)10); - } - OPV_Entier(n, 9); - } else if (form == 5) { - if (from < 5) { - OPM_WriteString((CHAR*)"(int)", (LONGINT)6); - OPV_expr(n, 9); - } else { - if (__IN(2, OPM_opt)) { - OPM_WriteString((CHAR*)"__SHORT", (LONGINT)8); - if (OPV_SideEffects(n)) { - OPM_Write('F'); - } - OPM_Write('('); - OPV_Entier(n, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); - OPM_WriteInt(OPM_MaxInt + 1); - OPM_Write(')'); - } else { - OPM_WriteString((CHAR*)"(int)", (LONGINT)6); - OPV_Entier(n, 9); - } - } - } else if (form == 4) { - if (__IN(2, OPM_opt)) { + } else if (__IN(to, 0x70)) { + if ((newtype->size < n->typ->size && __IN(2, OPM_opt))) { OPM_WriteString((CHAR*)"__SHORT", (LONGINT)8); if (OPV_SideEffects(n)) { OPM_Write('F'); @@ -508,13 +494,15 @@ static void OPV_Convert (OPT_Node n, INTEGER form, INTEGER prec) OPM_Write('('); OPV_Entier(n, -1); OPM_WriteString((CHAR*)", ", (LONGINT)3); - OPM_WriteInt(OPM_MaxSInt + 1); + OPM_WriteInt(OPM_SignedMaximum(newtype->size) + 1); OPM_Write(')'); } else { - OPM_WriteString((CHAR*)"(int)", (LONGINT)6); + if (newtype->size != n->typ->size) { + OPV_SizeCast(newtype->size); + } OPV_Entier(n, 9); } - } else if (form == 3) { + } else if (to == 3) { if (__IN(2, OPM_opt)) { OPM_WriteString((CHAR*)"__CHR", (LONGINT)6); if (OPV_SideEffects(n)) { @@ -577,7 +565,7 @@ static void OPV_design (OPT_Node n, INTEGER prec) OPT_Struct typ = NIL; INTEGER class, designPrec, comp; OPT_Node d = NIL, x = NIL; - INTEGER dims, i, _for__26; + INTEGER dims, i, _for__27; comp = n->typ->comp; obj = n->obj; class = n->class; @@ -653,15 +641,15 @@ static void OPV_design (OPT_Node n, INTEGER prec) } x = x->left; } - _for__26 = dims; + _for__27 = dims; i = 1; - while (i <= _for__26) { + while (i <= _for__27) { OPM_Write(')'); i += 1; } if (n->typ->comp == 3) { OPM_Write(')'); - while ((LONGINT)i < __ASHR(d->typ->size - 4, 2)) { + while ((SYSTEM_INT64)i < __ASHR(d->typ->size - 4, 2)) { OPM_WriteString((CHAR*)" * ", (LONGINT)4); OPV_Len(d, i); i += 1; @@ -796,7 +784,7 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) } if ((((mode == 2 && n->class == 11)) && n->subcl == 29)) { OPV_expr(n->left, prec); - } else if ((((((form == 6 && n->class == 7)) && n->conval->intval <= OPM_MaxInt)) && n->conval->intval >= OPM_MinInt)) { + } else if ((((((form == 6 && n->class == 7)) && n->conval->intval <= OPM_SignedMaximum(OPM_IntSize))) && n->conval->intval >= OPM_SignedMinimum(OPM_IntSize))) { OPM_WriteString((CHAR*)"((LONGINT)(", (LONGINT)12); OPV_expr(n, prec); OPM_WriteString((CHAR*)"))", (LONGINT)3); @@ -915,7 +903,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPM_Write(')'); break; case 20: - OPV_Convert(l, form, exprPrec); + OPV_Convert(l, n->typ, exprPrec); break; case 21: if (OPV_SideEffects(l)) { @@ -944,7 +932,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPM_Write(')'); break; case 24: - OPM_WriteString((CHAR*)"(LONGINT)(uintptr_t)", (LONGINT)21); + OPM_WriteString((CHAR*)"(LONGINT)(SYSTEM_ADDRESS)", (LONGINT)26); if (l->class == 1) { OPC_CompleteIdent(l->obj); } else { @@ -955,20 +943,16 @@ static void OPV_expr (OPT_Node n, INTEGER prec) } break; case 29: - if ((((__IN(n->typ->form, 0x6240) && __IN(l->typ->form, 0x6240))) && n->typ->size == l->typ->size) || !__IN(l->class, 0x17)) { + if (!__IN(l->class, 0x17) || (((__IN(n->typ->form, 0x6240) && __IN(l->typ->form, 0x6240))) && n->typ->size == l->typ->size)) { OPM_Write('('); OPC_Ident(n->typ->strobj); OPM_Write(')'); if (__IN(n->typ->form, 0x6000) || __IN(l->typ->form, 0x6000)) { - OPM_WriteString((CHAR*)"(uintptr_t)", (LONGINT)12); + OPM_WriteString((CHAR*)"(SYSTEM_ADDRESS)", (LONGINT)17); } OPV_expr(l, exprPrec); } else { - if (__IN(n->typ->form, 0x6000) || __IN(l->typ->form, 0x6000)) { - OPM_WriteString((CHAR*)"__VALP(", (LONGINT)8); - } else { - OPM_WriteString((CHAR*)"__VAL(", (LONGINT)7); - } + OPM_WriteString((CHAR*)"__VAL(", (LONGINT)7); OPC_Ident(n->typ->strobj); OPM_WriteString((CHAR*)", ", (LONGINT)3); OPV_expr(l, -1); @@ -1327,7 +1311,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) OPM_WriteInt(base->size); OPM_WriteString((CHAR*)"))", (LONGINT)3); OPM_WriteString((CHAR*)", ", (LONGINT)3); - OPM_WriteInt(OPC_Base(base)); + OPM_WriteInt(OPC_BaseAlignment(base)); OPM_WriteString((CHAR*)", ", (LONGINT)3); OPM_WriteInt(nofdim); OPM_WriteString((CHAR*)", ", (LONGINT)3); diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index eeb89a76..4eba5b89 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index ec8fb7a9..4281164c 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -110,11 +110,11 @@ export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT #define Platform_ERRORWRITEPROTECT() ERROR_WRITE_PROTECT #define Platform_ETIMEDOUT() WSAETIMEDOUT extern void Heap_InitHeap(); -#define Platform_GetTickCount() (LONGINT)(uint32_t)GetTickCount() +#define Platform_GetTickCount() (LONGINT)(SYSTEM_CARD32)GetTickCount() #define Platform_HeapInitHeap() Heap_InitHeap() -#define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((uintptr_t)h) -#define Platform_SetQuitHandler(h) SystemSetQuitHandler((uintptr_t)h) -#define Platform_allocate(size) (LONGINT)(uintptr_t)((void*)HeapAlloc(GetProcessHeap(), 0, (size_t)size)) +#define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((SYSTEM_ADDRESS)h) +#define Platform_SetQuitHandler(h) SystemSetQuitHandler((SYSTEM_ADDRESS)h) +#define Platform_allocate(size) (LONGINT)(SYSTEM_ADDRESS)((void*)HeapAlloc(GetProcessHeap(), 0, (size_t)size)) #define Platform_bhfiIndexHigh() (LONGINT)bhfi.nFileIndexHigh #define Platform_bhfiIndexLow() (LONGINT)bhfi.nFileIndexLow #define Platform_bhfiMtimeHigh() (LONGINT)bhfi.ftLastWriteTime.dwHighDateTime @@ -122,44 +122,44 @@ extern void Heap_InitHeap(); #define Platform_bhfiVsn() (LONGINT)bhfi.dwVolumeSerialNumber #define Platform_byHandleFileInformation() BY_HANDLE_FILE_INFORMATION bhfi #define Platform_cleanupProcess() CloseHandle(pi.hProcess); CloseHandle(pi.hThread); -#define Platform_closeHandle(h) (INTEGER)CloseHandle((HANDLE)(uintptr_t)h) +#define Platform_closeHandle(h) (INTEGER)CloseHandle((HANDLE)(SYSTEM_ADDRESS)h) #define Platform_createProcess(str, str__len) (INTEGER)CreateProcess(0, (char*)str, 0,0,0,0,0,0,&si,&pi) #define Platform_deleteFile(n, n__len) (INTEGER)DeleteFile((char*)n) #define Platform_err() (INTEGER)GetLastError() -#define Platform_errc(c) WriteFile((HANDLE)(uintptr_t)Platform_StdOut, &c, 1, 0,0) -#define Platform_errstring(s, s__len) WriteFile((HANDLE)(uintptr_t)Platform_StdOut, s, s__len-1, 0,0) +#define Platform_errc(c) WriteFile((HANDLE)(SYSTEM_ADDRESS)Platform_StdOut, &c, 1, 0,0) +#define Platform_errstring(s, s__len) WriteFile((HANDLE)(SYSTEM_ADDRESS)Platform_StdOut, s, s__len-1, 0,0) #define Platform_exit(code) ExitProcess((UINT)code) #define Platform_fileTimeToSysTime() SYSTEMTIME st; FileTimeToSystemTime(&ft, &st) -#define Platform_flushFileBuffers(h) (INTEGER)FlushFileBuffers((HANDLE)(uintptr_t)h) -#define Platform_free(address) HeapFree(GetProcessHeap(), 0, (void*)(uintptr_t)address) +#define Platform_flushFileBuffers(h) (INTEGER)FlushFileBuffers((HANDLE)(SYSTEM_ADDRESS)h) +#define Platform_free(address) HeapFree(GetProcessHeap(), 0, (void*)(SYSTEM_ADDRESS)address) #define Platform_ftToUli() ULARGE_INTEGER ul; ul.LowPart=ft.dwLowDateTime; ul.HighPart=ft.dwHighDateTime #define Platform_getCurrentDirectory(n, n__len) GetCurrentDirectory(n__len, (char*)n) #define Platform_getExitCodeProcess(exitcode) GetExitCodeProcess(pi.hProcess, (DWORD*)exitcode); -#define Platform_getFileInformationByHandle(h) (INTEGER)GetFileInformationByHandle((HANDLE)(uintptr_t)h, &bhfi) -#define Platform_getFilePos(h, r, rc) LARGE_INTEGER liz = {0}; *rc = (INTEGER)SetFilePointerEx((HANDLE)(uintptr_t)h, liz, &li, FILE_CURRENT); *r = (LONGINT)li.QuadPart -#define Platform_getFileSize(h) (INTEGER)GetFileSizeEx((HANDLE)(uintptr_t)h, &li) +#define Platform_getFileInformationByHandle(h) (INTEGER)GetFileInformationByHandle((HANDLE)(SYSTEM_ADDRESS)h, &bhfi) +#define Platform_getFilePos(h, r, rc) LARGE_INTEGER liz = {0}; *rc = (INTEGER)SetFilePointerEx((HANDLE)(SYSTEM_ADDRESS)h, liz, &li, FILE_CURRENT); *r = (LONGINT)li.QuadPart +#define Platform_getFileSize(h) (INTEGER)GetFileSizeEx((HANDLE)(SYSTEM_ADDRESS)h, &li) #define Platform_getLocalTime() SYSTEMTIME st; GetLocalTime(&st) #define Platform_getenv(name, name__len, buf, buf__len) (INTEGER)GetEnvironmentVariable((char*)name, (char*)buf, buf__len) #define Platform_getpid() (INTEGER)GetCurrentProcessId() -#define Platform_getstderrhandle() (uintptr_t)GetStdHandle(STD_ERROR_HANDLE) -#define Platform_getstdinhandle() (uintptr_t)GetStdHandle(STD_INPUT_HANDLE) -#define Platform_getstdouthandle() (uintptr_t)GetStdHandle(STD_OUTPUT_HANDLE) +#define Platform_getstderrhandle() (SYSTEM_ADDRESS)GetStdHandle(STD_ERROR_HANDLE) +#define Platform_getstdinhandle() (SYSTEM_ADDRESS)GetStdHandle(STD_INPUT_HANDLE) +#define Platform_getstdouthandle() (SYSTEM_ADDRESS)GetStdHandle(STD_OUTPUT_HANDLE) #define Platform_identityToFileTime(i) FILETIME ft; ft.dwHighDateTime = i.mtimehigh; ft.dwLowDateTime = i.mtimelow -#define Platform_invalidHandleValue() ((LONGINT)(uintptr_t)INVALID_HANDLE_VALUE) +#define Platform_invalidHandleValue() ((LONGINT)(SYSTEM_ADDRESS)INVALID_HANDLE_VALUE) #define Platform_largeInteger() LARGE_INTEGER li #define Platform_liLongint() (LONGINT)li.QuadPart #define Platform_moveFile(o, o__len, n, n__len) (INTEGER)MoveFileEx((char*)o, (char*)n, MOVEFILE_REPLACE_EXISTING) -#define Platform_opennew(n, n__len) (LONGINT)(uintptr_t)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0) -#define Platform_openro(n, n__len) (LONGINT)(uintptr_t)CreateFile((char*)n, GENERIC_READ , FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) -#define Platform_openrw(n, n__len) (LONGINT)(uintptr_t)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) +#define Platform_opennew(n, n__len) (LONGINT)(SYSTEM_ADDRESS)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0) +#define Platform_openro(n, n__len) (LONGINT)(SYSTEM_ADDRESS)CreateFile((char*)n, GENERIC_READ , FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) +#define Platform_openrw(n, n__len) (LONGINT)(SYSTEM_ADDRESS)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) #define Platform_processInfo() PROCESS_INFORMATION pi = {0}; -#define Platform_readfile(fd, p, l, n) (INTEGER)ReadFile ((HANDLE)(uintptr_t)fd, (void*)(uintptr_t)(p), (DWORD)l, (DWORD*)n, 0) +#define Platform_readfile(fd, p, l, n) (INTEGER)ReadFile ((HANDLE)(SYSTEM_ADDRESS)fd, (void*)(SYSTEM_ADDRESS)(p), (DWORD)l, (DWORD*)n, 0) #define Platform_seekcur() FILE_CURRENT #define Platform_seekend() FILE_END #define Platform_seekset() FILE_BEGIN #define Platform_setCurrentDirectory(n, n__len) (INTEGER)SetCurrentDirectory((char*)n) -#define Platform_setEndOfFile(h) (INTEGER)SetEndOfFile((HANDLE)(uintptr_t)h) -#define Platform_setFilePointerEx(h, o, r, rc) li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((HANDLE)(uintptr_t)h, li, 0, (DWORD)r) +#define Platform_setEndOfFile(h) (INTEGER)SetEndOfFile((HANDLE)(SYSTEM_ADDRESS)h) +#define Platform_setFilePointerEx(h, o, r, rc) li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((HANDLE)(SYSTEM_ADDRESS)h, li, 0, (DWORD)r) #define Platform_sleep(ms) Sleep((DWORD)ms) #define Platform_stToFt() FILETIME ft; SystemTimeToFileTime(&st, &ft) #define Platform_startupInfo() STARTUPINFO si = {0}; si.cb = sizeof(si); @@ -174,7 +174,7 @@ extern void Heap_InitHeap(); #define Platform_ulSec() (LONGINT)(ul.QuadPart / 1000000LL) #define Platform_uluSec() (LONGINT)(ul.QuadPart % 1000000LL) #define Platform_waitForProcess() (INTEGER)WaitForSingleObject(pi.hProcess, INFINITE) -#define Platform_writefile(fd, p, l) (INTEGER)WriteFile((HANDLE)(uintptr_t)fd, (void*)(uintptr_t)(p), (DWORD)l, 0,0) +#define Platform_writefile(fd, p, l) (INTEGER)WriteFile((HANDLE)(SYSTEM_ADDRESS)fd, (void*)(SYSTEM_ADDRESS)(p), (DWORD)l, 0,0) BOOLEAN Platform_TooManyFiles (INTEGER e) { @@ -242,7 +242,7 @@ void Platform_Init (INTEGER argc, LONGINT argvadr) Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; Platform_ArgCount = argc; - av = (Platform_ArgVecPtr)(uintptr_t)argvadr; + av = (Platform_ArgVecPtr)(SYSTEM_ADDRESS)argvadr; Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; Platform_HeapInitHeap(); @@ -281,7 +281,7 @@ void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { - av = (Platform_ArgVec)(uintptr_t)Platform_ArgVector; + av = (Platform_ArgVec)(SYSTEM_ADDRESS)Platform_ArgVector; __COPY(*(*av)[__X(n, ((LONGINT)(1024)))], val, val__len); } } @@ -335,8 +335,8 @@ void Platform_SetBadInstructionHandler (Platform_SignalHandler handler) static void Platform_YMDHMStoClock (INTEGER ye, INTEGER mo, INTEGER da, INTEGER ho, INTEGER mi, INTEGER se, LONGINT *t, LONGINT *d) { - *d = (__ASHL((LONGINT)(int)__MOD(ye, 100), 9) + __ASHL((LONGINT)(mo + 1), 5)) + (LONGINT)da; - *t = (__ASHL((LONGINT)ho, 12) + __ASHL((LONGINT)mi, 6)) + (LONGINT)se; + *d = (__ASHL((SYSTEM_INT64)(int)__MOD(ye, 100), 9) + __ASHL((SYSTEM_INT64)(mo + 1), 5)) + (SYSTEM_INT64)da; + *t = (__ASHL((SYSTEM_INT64)ho, 12) + __ASHL((SYSTEM_INT64)mi, 6)) + (SYSTEM_INT64)se; } void Platform_GetClock (LONGINT *t, LONGINT *d) @@ -560,7 +560,7 @@ INTEGER Platform_ReadBuf (LONGINT h, SYSTEM_BYTE *b, LONGINT b__len, LONGINT *n) INTEGER _o_result; INTEGER result; *n = 0; - result = Platform_readfile(h, (LONGINT)(uintptr_t)b, b__len, &*n); + result = Platform_readfile(h, (LONGINT)(SYSTEM_ADDRESS)b, b__len, &*n); if (result == 0) { *n = 0; _o_result = Platform_err(); @@ -796,7 +796,7 @@ static void Platform_TestLittleEndian (void) { INTEGER i; i = 1; - __GET((LONGINT)(uintptr_t)&i, Platform_LittleEndian, BOOLEAN); + __GET((LONGINT)(SYSTEM_ADDRESS)&i, Platform_LittleEndian, BOOLEAN); } __TDESC(Platform_FileIdentity, 1, 0) = {__TDFLDS("FileIdentity", 40), {-8}}; diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index 179bd3c3..374b6842 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h @@ -79,7 +79,7 @@ import INTEGER Platform_Write (LONGINT h, LONGINT p, LONGINT l); import BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); import void *Platform__init(void); -#define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((uintptr_t)h) -#define Platform_SetQuitHandler(h) SystemSetQuitHandler((uintptr_t)h) +#define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((SYSTEM_ADDRESS)h) +#define Platform_SetQuitHandler(h) SystemSetQuitHandler((SYSTEM_ADDRESS)h) #endif diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 0fb9a236..8b61d8cd 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -59,7 +59,7 @@ INTEGER Reals_Expo (REAL x) { INTEGER _o_result; INTEGER i; - __GET((LONGINT)(uintptr_t)&x + 2, i, INTEGER); + __GET((LONGINT)(SYSTEM_ADDRESS)&x + 2, i, INTEGER); _o_result = __MASK(__ASHR(i, 7), -256); return _o_result; } @@ -67,17 +67,17 @@ INTEGER Reals_Expo (REAL x) void Reals_SetExpo (REAL *x, INTEGER ex) { CHAR c; - __GET((LONGINT)(uintptr_t)x + 3, c, CHAR); - __PUT((LONGINT)(uintptr_t)x + 3, (CHAR)(__ASHL(__ASHR((int)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); - __GET((LONGINT)(uintptr_t)x + 2, c, CHAR); - __PUT((LONGINT)(uintptr_t)x + 2, (CHAR)(__MASK((int)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); + __GET((LONGINT)(SYSTEM_ADDRESS)x + 3, c, CHAR); + __PUT((LONGINT)(SYSTEM_ADDRESS)x + 3, (CHAR)(__ASHL(__ASHR((int)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __GET((LONGINT)(SYSTEM_ADDRESS)x + 2, c, CHAR); + __PUT((LONGINT)(SYSTEM_ADDRESS)x + 2, (CHAR)(__MASK((int)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } INTEGER Reals_ExpoL (LONGREAL x) { INTEGER _o_result; INTEGER i; - __GET((LONGINT)(uintptr_t)&x + 6, i, INTEGER); + __GET((LONGINT)(SYSTEM_ADDRESS)&x + 6, i, INTEGER); _o_result = __MASK(__ASHR(i, 4), -2048); return _o_result; } @@ -90,7 +90,7 @@ void Reals_ConvertL (LONGREAL x, INTEGER n, CHAR *d, LONGINT d__len) } k = 0; i = __ENTIER(x); - while (k < (LONGINT)n) { + while (k < (SYSTEM_INT64)n) { d[__X(k, d__len)] = (CHAR)(__MOD(i, 10) + 48); i = __DIV(i, 10); k += 1; @@ -122,7 +122,7 @@ static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LO CHAR by; i = 0; l = b__len; - while ((LONGINT)i < l) { + while ((SYSTEM_INT64)i < l) { by = __VAL(CHAR, b[__X(i, b__len)]); d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((int)by, 4)); d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((int)by, -16)); diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index db522698..ff21c192 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/SYSTEM.c b/bootstrap/windows-88/SYSTEM.c index 50e91c6d..33511a70 100644 --- a/bootstrap/windows-88/SYSTEM.c +++ b/bootstrap/windows-88/SYSTEM.c @@ -35,7 +35,7 @@ void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0) void SYSTEM_ENUMP(void *adr, LONGINT n, void (*P)()) { while (n > 0) { - P((LONGINT)(uintptr_t)(*((void**)(adr)))); + P((LONGINT)(SYSTEM_ADDRESS)(*((void**)(adr)))); adr = ((void**)adr) + 1; n--; } @@ -106,7 +106,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, else if (typ == (LONGINT*)POINTER__typ) { /* element type is a pointer */ x = Heap_NEWBLK(size + nofelems * sizeof(LONGINT)); - p = (LONGINT*)(uintptr_t)x[-1]; + p = (LONGINT*)(SYSTEM_ADDRESS)x[-1]; p[-nofelems] = *p; /* build new type desc in situ: 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nofelems - 1; n = 1; /* n =1 for skipping the size field */ while (n <= nofelems) {*p = n*sizeof(LONGINT); p++; n++;} @@ -119,7 +119,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, while (ptab[nofptrs] >= 0) {nofptrs++;} /* number of pointers per element */ nptr = nofelems * nofptrs; /* total number of pointers */ x = Heap_NEWBLK(size + nptr * sizeof(LONGINT)); - p = (LONGINT*)(uintptr_t)x[- 1]; + p = (LONGINT*)(SYSTEM_ADDRESS)x[- 1]; p[-nptr] = *p; /* build new type desc in situ; 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nptr - 1; n = 0; off = dataoff; while (n < nofelems) {i = 0; @@ -155,7 +155,7 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler // (Ignore other signals) } - void SystemSetHandler(int s, uintptr_t h) { + void SystemSetHandler(int s, SYSTEM_ADDRESS h) { if (s >= 2 && s <= 4) { int needtosetsystemhandler = handler[s-2] == 0; handler[s-2] = (SystemSignalHandler)h; @@ -194,12 +194,12 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler } } - void SystemSetInterruptHandler(uintptr_t h) { + void SystemSetInterruptHandler(SYSTEM_ADDRESS h) { EnsureConsoleCtrlHandler(); SystemInterruptHandler = (SystemSignalHandler)h; } - void SystemSetQuitHandler(uintptr_t h) { + void SystemSetQuitHandler(SYSTEM_ADDRESS h) { EnsureConsoleCtrlHandler(); SystemQuitHandler = (SystemSignalHandler)h; } diff --git a/bootstrap/windows-88/SYSTEM.h b/bootstrap/windows-88/SYSTEM.h index 949951ac..6377745e 100644 --- a/bootstrap/windows-88/SYSTEM.h +++ b/bootstrap/windows-88/SYSTEM.h @@ -1,28 +1,38 @@ #ifndef SYSTEM__h #define SYSTEM__h -#ifndef _WIN32 - - // Building for a Unix/Linux based system - #include // For memcpy ... - #include // For uintptr_t ... - +#if defined(_WIN64) + typedef long long SYSTEM_INT64; + typedef unsigned long long SYSTEM_CARD64; #else - - // Building for Windows platform with either mingw under cygwin, or the MS C compiler - #ifdef _WIN64 - typedef unsigned long long size_t; - typedef unsigned long long uintptr_t; - #else - typedef unsigned int size_t; - typedef unsigned int uintptr_t; - #endif /* _WIN64 */ - - typedef unsigned int uint32_t; - void * __cdecl memcpy(void * dest, const void * source, size_t size); - + typedef long SYSTEM_INT64; + typedef unsigned long SYSTEM_CARD64; #endif +typedef int SYSTEM_INT32; +typedef unsigned int SYSTEM_CARD32; +typedef short int SYSTEM_INT16; +typedef unsigned short int SYSTEM_CARD16; +typedef signed char SYSTEM_INT8; +typedef unsigned char SYSTEM_CARD8; + +#if (__SIZEOF_POINTER__ == 8) || defined(_WIN64) || defined(__LP64__) + #if defined(_WIN64) + typedef unsigned long long size_t; + #else + typedef unsigned long size_t; + #endif +#else + typedef unsigned int size_t; +#endif + +#define SYSTEM_ADDRESS size_t +#define _SIZE_T_DECLARED // For FreeBSD +#define _SIZE_T_DEFINED_ // For OpenBSD + +void *memcpy(void *dest, const void *source, SYSTEM_ADDRESS size); + + // The compiler uses 'import' and 'export' which translate to 'extern' and // nothing respectively. @@ -70,6 +80,7 @@ typedef unsigned char U_SHORTINT; #endif typedef U_LONGINT SET; +typedef U_LONGINT U_SET; // OS Memory allocation interfaces are in PlatformXXX.Mod @@ -96,10 +107,10 @@ extern LONGINT SYSTEM_ENTIER (double x); // Signal handling in SYSTEM.c #ifndef _WIN32 - extern void SystemSetHandler(int s, uintptr_t h); + extern void SystemSetHandler(int s, SYSTEM_ADDRESS h); #else - extern void SystemSetInterruptHandler(uintptr_t h); - extern void SystemSetQuitHandler (uintptr_t h); + extern void SystemSetInterruptHandler(SYSTEM_ADDRESS h); + extern void SystemSetQuitHandler (SYSTEM_ADDRESS h); #endif @@ -122,20 +133,20 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __COPY(s, d, n) {char*_a=(void*)s,*_b=(void*)d; LONGINT _i=0,_t=n-1; \ while(_i<_t&&((_b[_i]=_a[_i])!=0)){_i++;};_b[_i]=0;} -#define __DUP(x, l, t) x=(void*)memcpy((void*)(uintptr_t)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) +#define __DUP(x, l, t) x=(void*)memcpy((void*)(SYSTEM_ADDRESS)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) #define __DUPARR(v, t) v=(void*)memcpy(v##__copy,v,sizeof(t)) -#define __DEL(x) Platform_OSFree((LONGINT)(uintptr_t)x) +#define __DEL(x) Platform_OSFree((LONGINT)(SYSTEM_ADDRESS)x) /* 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 + +#define __GET(a, x, t) x= *(t*)(SYSTEM_ADDRESS)(a) +#define __PUT(a, x, t) *(t*)(SYSTEM_ADDRESS)(a)=x #define __LSHL(x, n, t) ((t)((U_##t)(x)<<(n))) #define __LSHR(x, n, t) ((t)((U_##t)(x)>>(n))) @@ -150,7 +161,7 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) #define __BIT(x, n) (*(U_LONGINT*)(x)>>(n)&1) -#define __MOVE(s, d, n) memcpy((char*)(uintptr_t)(d),(char*)(uintptr_t)(s),n) +#define __MOVE(s, d, n) memcpy((char*)(SYSTEM_ADDRESS)(d),(char*)(SYSTEM_ADDRESS)(s),n) #define __ASHF(x, n) SYSTEM_ASH((LONGINT)(x), (LONGINT)(n)) #define __SHORT(x, y) ((int)((U_LONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) #define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) @@ -211,7 +222,7 @@ extern void Heap_INCREF(); extern void Platform_Init(INTEGER argc, LONGINT argv); extern void Heap_FINALL(); -#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (LONGINT)(uintptr_t)&argv); +#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (LONGINT)(SYSTEM_ADDRESS)&argv); #define __REGMAIN(name, enum) m = Heap_REGMOD((CHAR*)name,enum) #define __FINI Heap_FINALL(); return 0 @@ -232,7 +243,7 @@ extern SYSTEM_PTR Heap_NEWREC (LONGINT tag); extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __SYSNEW(p, len) p = Heap_NEWBLK((LONGINT)(len)) -#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(uintptr_t)t##__typ) +#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(SYSTEM_ADDRESS)t##__typ) #define __NEWARR SYSTEM_NEWARR @@ -263,20 +274,20 @@ extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __INITYP(t, t0, level) \ t##__typ = (LONGINT*)&t##__desc.blksz; \ memcpy(t##__desc.basep, t0##__typ - __BASEOFF, level*sizeof(LONGINT)); \ - t##__desc.basep[level] = (LONGINT)(uintptr_t)t##__typ; \ - t##__desc.module = (LONGINT)(uintptr_t)m; \ + t##__desc.basep[level] = (LONGINT)(SYSTEM_ADDRESS)t##__typ; \ + t##__desc.module = (LONGINT)(SYSTEM_ADDRESS)m; \ if(t##__desc.blksz!=sizeof(struct t)) __HALT(-15); \ t##__desc.blksz = (t##__desc.blksz+5*sizeof(LONGINT)-1)/(4*sizeof(LONGINT))*(4*sizeof(LONGINT)); \ - Heap_REGTYP(m, (LONGINT)(uintptr_t)&t##__desc.next); \ + Heap_REGTYP(m, (LONGINT)(SYSTEM_ADDRESS)&t##__desc.next); \ SYSTEM_INHERIT(t##__typ, t0##__typ) -#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(uintptr_t)typ##__typ) -#define __TYPEOF(p) ((LONGINT*)(uintptr_t)(*(((LONGINT*)(p))-1))) +#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(SYSTEM_ADDRESS)typ##__typ) +#define __TYPEOF(p) ((LONGINT*)(SYSTEM_ADDRESS)(*(((LONGINT*)(p))-1))) #define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) // Oberon-2 type bound procedures support -#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(uintptr_t)proc -#define __SEND(typ, num, funtyp, parlist) ((funtyp)((uintptr_t)*(typ-(__TPROC0OFF+num))))parlist +#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(SYSTEM_ADDRESS)proc +#define __SEND(typ, num, funtyp, parlist) ((funtyp)((SYSTEM_ADDRESS)*(typ-(__TPROC0OFF+num))))parlist diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index 962b86a0..20a14540 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -22,7 +22,7 @@ INTEGER Strings_Length (CHAR *s, LONGINT s__len) INTEGER i; __DUP(s, s__len, CHAR); i = 0; - while (((LONGINT)i < s__len && s[__X(i, s__len)] != 0x00)) { + while (((SYSTEM_INT64)i < s__len && s[__X(i, s__len)] != 0x00)) { i += 1; } _o_result = i; @@ -37,11 +37,11 @@ void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__ n1 = Strings_Length(dest, dest__len); n2 = Strings_Length(extra, extra__len); i = 0; - while ((i < n2 && (LONGINT)(i + n1) < dest__len)) { + while ((i < n2 && (SYSTEM_INT64)(i + n1) < dest__len)) { dest[__X(i + n1, dest__len)] = extra[__X(i, extra__len)]; i += 1; } - if ((LONGINT)(i + n1) < dest__len) { + if ((SYSTEM_INT64)(i + n1) < dest__len) { dest[__X(i + n1, dest__len)] = 0x00; } __DEL(extra); @@ -60,10 +60,10 @@ void Strings_Insert (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, Strings_Append(dest, dest__len, (void*)source, source__len); return; } - if ((LONGINT)(pos + n2) < dest__len) { + if ((SYSTEM_INT64)(pos + n2) < dest__len) { i = n1; while (i >= pos) { - if ((LONGINT)(i + n2) < dest__len) { + if ((SYSTEM_INT64)(i + n2) < dest__len) { dest[__X(i + n2, dest__len)] = dest[__X(i, dest__len)]; } i -= 1; @@ -92,7 +92,7 @@ void Strings_Delete (CHAR *s, LONGINT s__len, INTEGER pos, INTEGER n) s[__X(i - n, s__len)] = s[__X(i, s__len)]; i += 1; } - if ((LONGINT)(i - n) < s__len) { + if ((SYSTEM_INT64)(i - n) < s__len) { s[__X(i - n, s__len)] = 0x00; } } else { @@ -122,7 +122,7 @@ void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n, return; } i = 0; - while (((((LONGINT)(pos + i) <= source__len && source[__X(pos + i, source__len)] != 0x00)) && i < n)) { + while (((((SYSTEM_INT64)(pos + i) <= source__len && source[__X(pos + i, source__len)] != 0x00)) && i < n)) { if (i < destLen) { dest[__X(i, dest__len)] = source[__X(pos + i, source__len)]; } diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index 549337ee..d64d3478 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index fe673ac8..a1fb81c0 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Files.h" @@ -788,9 +788,9 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) (*S).s[__X(i, ((LONGINT)(64)))] = 0x00; (*S).len = i; (*S).class = 1; - } else if (ch == '\"') { + } else if (ch == '"') { Texts_Read((void*)&*S, S__typ, &ch); - while ((((ch != '\"' && ch >= ' ')) && i != 63)) { + while ((((ch != '"' && ch >= ' ')) && i != 63)) { (*S).s[__X(i, ((LONGINT)(64)))] = ch; i += 1; Texts_Read((void*)&*S, S__typ, &ch); @@ -840,7 +840,7 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) k -= 16; } while (j < i) { - k = __ASHL(k, 4) + (LONGINT)((int)d[__X(j, ((LONGINT)(32)))] - 48); + k = __ASHL(k, 4) + (SYSTEM_INT64)((int)d[__X(j, ((LONGINT)(32)))] - 48); j += 1; } if (neg) { @@ -930,7 +930,7 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) (*S).class = 3; k = 0; do { - k = k * 10 + (LONGINT)((int)d[__X(j, ((LONGINT)(32)))] - 48); + k = k * 10 + (SYSTEM_INT64)((int)d[__X(j, ((LONGINT)(32)))] - 48); j += 1; } while (!(j == i)); if (neg) { @@ -1068,7 +1068,7 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n) x0 = __DIV(x0, 10); i += 1; } while (!(x0 == 0)); - while (n > (LONGINT)i) { + while (n > (SYSTEM_INT64)i) { Texts_Write(&*W, W__typ, ' '); n -= 1; } @@ -1320,7 +1320,7 @@ void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER } else { Texts_Write(&*W, W__typ, ' '); } - e = (int)__ASHR((LONGINT)(e - 1023) * 77, 8); + e = (int)__ASHR((SYSTEM_INT64)(e - 1023) * 77, 8); if (e >= 0) { x = x / (LONGREAL)Reals_TenL(e); } else { diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index dcee9f40..bca5665d 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/Vishap.c b/bootstrap/windows-88/Vishap.c index ccb3e59e..6eda4f2c 100644 --- a/bootstrap/windows-88/Vishap.c +++ b/bootstrap/windows-88/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkamSf */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/windows-88/errors.c b/bootstrap/windows-88/errors.c index 9b9ec275..48246ffa 100644 --- a/bootstrap/windows-88/errors.c +++ b/bootstrap/windows-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -26,7 +26,7 @@ export void *errors__init(void) errors_errors[6][0] = 0x00; errors_errors[7][0] = 0x00; errors_errors[8][0] = 0x00; - __MOVE("\'=\' expected", errors_errors[9], 13); + __MOVE("'=' expected", errors_errors[9], 13); errors_errors[10][0] = 0x00; errors_errors[11][0] = 0x00; __MOVE("type definition starts with incorrect symbol", errors_errors[12], 45); @@ -35,28 +35,28 @@ export void *errors__init(void) __MOVE("declaration followed by incorrect symbol", errors_errors[15], 41); __MOVE("MODULE expected", errors_errors[16], 16); errors_errors[17][0] = 0x00; - __MOVE("\'.\' missing", errors_errors[18], 12); - __MOVE("\',\' missing", errors_errors[19], 12); - __MOVE("\':\' missing", errors_errors[20], 12); + __MOVE("'.' missing", errors_errors[18], 12); + __MOVE("',' missing", errors_errors[19], 12); + __MOVE("':' missing", errors_errors[20], 12); errors_errors[21][0] = 0x00; - __MOVE("\')\' missing", errors_errors[22], 12); - __MOVE("\']\' missing", errors_errors[23], 12); - __MOVE("\'}\' missing", errors_errors[24], 12); + __MOVE("')' missing", errors_errors[22], 12); + __MOVE("']' missing", errors_errors[23], 12); + __MOVE("'}' missing", errors_errors[24], 12); __MOVE("OF missing", errors_errors[25], 11); __MOVE("THEN missing", errors_errors[26], 13); __MOVE("DO missing", errors_errors[27], 11); __MOVE("TO missing", errors_errors[28], 11); errors_errors[29][0] = 0x00; - __MOVE("\'(\' missing", errors_errors[30], 12); + __MOVE("'(' missing", errors_errors[30], 12); errors_errors[31][0] = 0x00; errors_errors[32][0] = 0x00; errors_errors[33][0] = 0x00; - __MOVE("\':=\' missing", errors_errors[34], 13); - __MOVE("\',\' or OF expected", errors_errors[35], 19); + __MOVE("':=' missing", errors_errors[34], 13); + __MOVE("',' or OF expected", errors_errors[35], 19); errors_errors[36][0] = 0x00; errors_errors[37][0] = 0x00; __MOVE("identifier expected", errors_errors[38], 20); - __MOVE("\';\' missing", errors_errors[39], 12); + __MOVE("';' missing", errors_errors[39], 12); errors_errors[40][0] = 0x00; __MOVE("END missing", errors_errors[41], 12); errors_errors[42][0] = 0x00; @@ -132,10 +132,10 @@ export void *errors__init(void) __MOVE("operand is not a variable", errors_errors[112], 26); __MOVE("incompatible assignment", errors_errors[113], 24); __MOVE("string too long to be assigned", errors_errors[114], 31); - __MOVE("parameter doesn\'t match", errors_errors[115], 24); - __MOVE("number of parameters doesn\'t match", errors_errors[116], 35); - __MOVE("result type doesn\'t match", errors_errors[117], 26); - __MOVE("export mark doesn\'t match with forward declaration", errors_errors[118], 51); + __MOVE("parameter doesn't match", errors_errors[115], 24); + __MOVE("number of parameters doesn't match", errors_errors[116], 35); + __MOVE("result type doesn't match", errors_errors[117], 26); + __MOVE("export mark doesn't match with forward declaration", errors_errors[118], 51); __MOVE("redefinition textually precedes procedure bound to base type", errors_errors[119], 61); __MOVE("type of expression following IF, WHILE, UNTIL or ASSERT is not BOOLEAN", errors_errors[120], 71); __MOVE("called object is not a procedure (or is an interrupt procedure)", errors_errors[121], 64); @@ -195,5 +195,6 @@ export void *errors__init(void) __MOVE("implicit type cast", errors_errors[301], 19); __MOVE("inappropriate symbol file ignored", errors_errors[306], 34); __MOVE("no ELSE symbol after CASE statement sequence may lead to trap", errors_errors[307], 62); + __MOVE("SYSTEM.VAL result includes memory past end of source variable", errors_errors[308], 62); __ENDMOD; } diff --git a/bootstrap/windows-88/errors.h b/bootstrap/windows-88/errors.h index fdf34cf1..9081238a 100644 --- a/bootstrap/windows-88/errors.h +++ b/bootstrap/windows-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index 521538ae..4005b0a6 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index de353aeb..6ac1ab91 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/vt100.c b/bootstrap/windows-88/vt100.c index 1b8568fe..a9110e8a 100644 --- a/bootstrap/windows-88/vt100.c +++ b/bootstrap/windows-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Console.h" @@ -253,7 +253,7 @@ export void *vt100__init(void) __REGCMD("RCP", vt100_RCP); __REGCMD("SCP", vt100_SCP); /* BEGIN */ - __COPY("", vt100_CSI, ((LONGINT)(5))); + __COPY("\033", vt100_CSI, ((LONGINT)(5))); Strings_Append((CHAR*)"[", (LONGINT)2, (void*)vt100_CSI, ((LONGINT)(5))); __ENDMOD; } diff --git a/bootstrap/windows-88/vt100.h b/bootstrap/windows-88/vt100.h index 2d276238..801bc8f9 100644 --- a/bootstrap/windows-88/vt100.h +++ b/bootstrap/windows-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/24] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/makefile b/makefile index 811ecefc..eee8238a 100644 --- a/makefile +++ b/makefile @@ -106,6 +106,7 @@ configuration: FORCE @./a.o @rm a.o @echo BRANCH=$$(git rev-parse --abbrev-ref HEAD)>>Configuration.Make + @echo Branch: $$(git rev-parse --abbrev-ref HEAD). @@ -133,6 +134,7 @@ clean: configuration # full: Full build of compiler and libarary. full: configuration @make -f src/tools/make/vishap.make -s installable + @-make -f src/tools/make/vishap.make -s uninstall @make -f src/tools/make/vishap.make -s clean # Make bootstrap compiler from source suitable for current data model @printf "\n\n--- Compiler build started ---\n\n" @@ -164,6 +166,10 @@ compiler: configuration +# Report changes to compiler source relative to bootstrap compiler +sourcechanges: + @make -f src/tools/make/vishap.make -s sourcechanges + # browsercmd: build the 'showdef' command browsercmd: configuration @@ -176,6 +182,27 @@ browsercmd: configuration library: configuration @make -f src/tools/make/vishap.make -s library +# Individual library components +v4: configuration + @make -f src/tools/make/vishap.make -s v4 + +ooc2: configuration + @make -f src/tools/make/vishap.make -s ooc2 + +ooc: configuration + @make -f src/tools/make/vishap.make -s ooc + +ulm: configuration + @make -f src/tools/make/vishap.make -s ulm + +pow32: configuration + @make -f src/tools/make/vishap.make -s pow32 + +misc: configuration + @make -f src/tools/make/vishap.make -s misc + +s3: configuration + @make -f src/tools/make/vishap.make -s s3 @@ -228,6 +255,8 @@ revertbootstrap: # --- multi-machine multi-platform build management --- +# NOTE: No longer used. Obsoleted by postpush.pl and buildall.pl. + # coordinator: Start the test machine coordinator diff --git a/src/compiler/OPB.Mod b/src/compiler/OPB.Mod index a06b1cfc..6da12c5e 100644 --- a/src/compiler/OPB.Mod +++ b/src/compiler/OPB.Mod @@ -3,93 +3,36 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) IMPORT OPT, OPS, OPM, SYSTEM; + CONST - (* symbol values or ops *) - times = 1; slash = 2; div = 3; mod = 4; - and = 5; plus = 6; minus = 7; or = 8; eql = 9; - neq = 10; lss = 11; leq = 12; gtr = 13; geq = 14; - in = 15; is = 16; ash = 17; msk = 18; len = 19; - conv = 20; abs = 21; cap = 22; odd = 23; not = 33; - (*SYSTEM*) - adr = 24; cc = 25; bit = 26; lsh = 27; rot = 28; val = 29; - - (* object modes *) - Var = 1; VarPar = 2; Con = 3; Fld = 4; Typ = 5; LProc = 6; XProc = 7; - SProc = 8; CProc = 9; IProc = 10; Mod = 11; Head = 12; TProc = 13; - - (* Structure forms *) - Undef = 0; Byte = 1; Bool = 2; Char = 3; - SInt = 4; Int = 5; LInt = 6; - Real = 7; LReal = 8; Set = 9; String = 10; NilTyp = 11; NoTyp = 12; - Pointer = 13; ProcTyp = 14; - Comp = 15; -(* Int8 = 7; Int16 = 8; Int32 = 9; Int64 = 10; - Real = 11; LReal = 12; Set = 13; String = 14; NilTyp = 15; NoTyp = 16; - Pointer = 17; ProcTyp = 18; - Comp = 19; - *) - (*Real = 7; LReal = 8; Set = 9; String = 10; NilTyp = 11; NoTyp = 12; - Pointer = 13; ProcTyp = 14; - Int8 = 15; Int16 = 16; Int32 = 17; Int64 = 18; - Comp = (*15*)19;*) - - intSet = {SInt..LInt(*, Int8..Int64*)}; realSet = {Real, LReal}; - - (* composite structure forms *) - Basic = 1; Array = 2; DynArr = 3; Record = 4; - - (* nodes classes *) - Nvar = 0; Nvarpar = 1; Nfield = 2; Nderef = 3; Nindex = 4; Nguard = 5; Neguard = 6; - Nconst = 7; Ntype = 8; Nproc = 9; Nupto = 10; Nmop = 11; Ndop = 12; Ncall = 13; - Ninittd = 14; Nif = 15; Ncaselse = 16; Ncasedo = 17; Nenter = 18; Nassign = 19; - Nifelse = 20; Ncase = 21; Nwhile = 22; Nrepeat = 23; Nloop = 24; Nexit = 25; - Nreturn = 26; Nwith = 27; Ntrap = 28; - - (*function number*) - assign = 0; - haltfn = 0; newfn = 1; absfn = 2; capfn = 3; ordfn = 4; - entierfn = 5; oddfn = 6; minfn = 7; maxfn = 8; chrfn = 9; - shortfn = 10; longfn = 11; sizefn = 12; incfn = 13; decfn = 14; - inclfn = 15; exclfn = 16; lenfn = 17; copyfn = 18; ashfn = 19; assertfn = 32; - - (*SYSTEM function number*) - adrfn = 20; ccfn = 21; lshfn = 22; rotfn = 23; - getfn = 24; putfn = 25; getrfn = 26; putrfn = 27; - bitfn = 28; valfn = 29; sysnewfn = 30; movefn = 31; - - (* module visibility of objects *) - internal = 0; external = 1; externalR = 2; - - (* procedure flags (conval^.setval) *) - hasBody = 1; isRedef = 2; slNeeded = 3; - AssertTrap = 0; (* default trap number *) + VAR typSize*: PROCEDURE(typ: OPT.Struct); - exp: INTEGER; (*side effect of log*) - maxExp: LONGINT; (* max n in ASH(1, n) on this machine *) + exp: INTEGER; (*side effect of log*) + maxExp: LONGINT; (* max n in ASH(1, n) on this machine *) + PROCEDURE err(n: INTEGER); BEGIN OPM.err(n) END err; + PROCEDURE NewLeaf*(obj: OPT.Object): OPT.Node; VAR node: OPT.Node; BEGIN CASE obj^.mode OF - Var: - node := OPT.NewNode(Nvar); node^.readonly := (obj^.vis = externalR) & (obj^.mnolev < 0) - | VarPar: - node := OPT.NewNode(Nvarpar) - | Con: - node := OPT.NewNode(Nconst); node^.conval := OPT.NewConst(); - node^.conval^ := obj^.conval^ (* string is not copied, only its ref *) - | Typ: - node := OPT.NewNode(Ntype) - | LProc..IProc: - node := OPT.NewNode(Nproc) - ELSE err(127); node := OPT.NewNode(Nvar) + | OPT.Var: node := OPT.NewNode(OPT.Nvar); + node^.readonly := (obj^.vis = OPT.externalR) & (obj^.mnolev < 0) + | OPT.VarPar: node := OPT.NewNode(OPT.Nvarpar) + | OPT.Con: node := OPT.NewNode(OPT.Nconst); + node^.conval := OPT.NewConst(); + node^.conval^ := obj^.conval^ (* string is not copied, only its ref *) + | OPT.Typ: node := OPT.NewNode(OPT.Ntype) + | OPT.LProc + ..OPT.IProc: node := OPT.NewNode(OPT.Nproc) + ELSE node := OPT.NewNode(OPT.Nvar); err(127) END ; node^.obj := obj; node^.typ := obj^.typ; RETURN node @@ -122,7 +65,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) PROCEDURE NewBoolConst*(boolval: BOOLEAN): OPT.Node; VAR x: OPT.Node; BEGIN - x := OPT.NewNode(Nconst); x^.typ := OPT.booltyp; + x := OPT.NewNode(OPT.Nconst); x^.typ := OPT.booltyp; x^.conval := OPT.NewConst(); x^.conval^.intval := BoolToInt(boolval); RETURN x END NewBoolConst; @@ -130,7 +73,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) VAR if, pred: OPT.Node; BEGIN if := x^.left; - WHILE if^.left^.class = Nconst DO + WHILE if^.left^.class = OPT.Nconst DO IF IntToBool(if^.left^.conval^.intval) THEN x := if^.right; RETURN ELSIF if^.link = NIL THEN x := x^.right; RETURN ELSE if := if^.link; x^.left := if @@ -138,7 +81,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) END ; pred := if; if := if^.link; WHILE if # NIL DO - IF if^.left^.class = Nconst THEN + IF if^.left^.class = OPT.Nconst THEN IF IntToBool(if^.left^.conval^.intval) THEN pred^.link := NIL; x^.right := if^.right; RETURN ELSE if := if^.link; pred^.link := if @@ -151,41 +94,65 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) PROCEDURE Nil*(): OPT.Node; VAR x: OPT.Node; BEGIN - x := OPT.NewNode(Nconst); x^.typ := OPT.niltyp; + x := OPT.NewNode(OPT.Nconst); x^.typ := OPT.niltyp; x^.conval := OPT.NewConst(); x^.conval^.intval := OPM.nilval; RETURN x END Nil; PROCEDURE EmptySet*(): OPT.Node; VAR x: OPT.Node; BEGIN - x := OPT.NewNode(Nconst); x^.typ := OPT.settyp; + x := OPT.NewNode(OPT.Nconst); x^.typ := OPT.settyp; x^.conval := OPT.NewConst(); x^.conval^.setval := {}; RETURN x END EmptySet; + + (* Integer size support *) + + PROCEDURE SignedByteSize(n: LONGINT): INTEGER; + (* Returns number of bytes required to represent signed value n *) + VAR b: INTEGER; + BEGIN + IF n < 0 THEN n := -(n+1) END; (* Positive value in the range 0 - 7F.. *) + b := 1; WHILE (b < 8) & (ASH(n, -(8*b-1)) # 0) DO INC(b) END; + RETURN b + END SignedByteSize; + + PROCEDURE ShorterSize(i: LONGINT): LONGINT; + BEGIN IF i >= OPM.LIntSize THEN RETURN OPM.IntSize ELSE RETURN OPM.SIntSize END + END ShorterSize; + + PROCEDURE LongerSize(i: LONGINT): LONGINT; + BEGIN IF i <= OPM.SIntSize THEN RETURN OPM.IntSize ELSE RETURN OPM.LIntSize END + END LongerSize; + + PROCEDURE IntType(size: LONGINT): OPT.Struct; + (* Selects smallest standard integer type for given size in bytes *) + VAR result: OPT.Struct; + BEGIN + IF size <= OPT.sinttyp.size THEN result := OPT.sinttyp + ELSIF size <= OPT.inttyp.size THEN result := OPT.inttyp + ELSE + result := OPT.linttyp + END; + IF size > OPT.linttyp.size THEN err(203) END; (* Number too large *) + RETURN result + END IntType; + PROCEDURE SetIntType(node: OPT.Node); - VAR v: LONGINT(*SYSTEM.INT64*); - BEGIN v := node^.conval^.intval; - IF (OPM.MinSInt <= SYSTEM.VAL(LONGINT, v)) & (SYSTEM.VAL(LONGINT, v) <= OPM.MaxSInt) THEN node^.typ := OPT.sinttyp - ELSIF (OPM.MinInt <= SYSTEM.VAL(LONGINT, v)) & (SYSTEM.VAL(LONGINT, v) <= OPM.MaxInt) THEN node^.typ := OPT.inttyp - ELSIF (OPM.MinLInt <= v) & (v <= OPM.MaxLInt) (*bootstrap or cross*) THEN - node^.typ := OPT.linttyp - (*ELSIF (OPM.MinInt64) <= v) & (v <= OPM.MaxInt64) THEN - node^.typ := OPT.int64typ*) - ELSE err(203); node^.typ := OPT.sinttyp; node^.conval^.intval := 1 - END + BEGIN node.typ := IntType(SignedByteSize(node.conval.intval)) END SetIntType; PROCEDURE NewIntConst*(intval: LONGINT): OPT.Node; VAR x: OPT.Node; BEGIN - x := OPT.NewNode(Nconst); x^.conval := OPT.NewConst(); + x := OPT.NewNode(OPT.Nconst); x^.conval := OPT.NewConst(); x^.conval^.intval := intval; SetIntType(x); RETURN x END NewIntConst; PROCEDURE NewRealConst*(realval: LONGREAL; typ: OPT.Struct): OPT.Node; VAR x: OPT.Node; BEGIN - x := OPT.NewNode(Nconst); x^.conval := OPT.NewConst(); + x := OPT.NewNode(OPT.Nconst); x^.conval := OPT.NewConst(); x^.conval^.realval := realval; x^.typ := typ; x^.conval^.intval := OPM.ConstNotAlloc; RETURN x END NewRealConst; @@ -193,7 +160,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) PROCEDURE NewString*(VAR str: OPS.String; len: LONGINT): OPT.Node; VAR x: OPT.Node; BEGIN - x := OPT.NewNode(Nconst); x^.conval := OPT.NewConst(); x^.typ := OPT.stringtyp; + x := OPT.NewNode(OPT.Nconst); x^.conval := OPT.NewConst(); x^.typ := OPT.stringtyp; x^.conval^.intval := OPM.ConstNotAlloc; x^.conval^.intval2 := len; x^.conval^.ext := OPT.NewExt(); x^.conval^.ext^ := str; RETURN x @@ -215,21 +182,21 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) END BindNodes; PROCEDURE NotVar(x: OPT.Node): BOOLEAN; - BEGIN RETURN (x^.class >= Nconst) & ((x^.class # Nmop) OR (x^.subcl # val) OR (x^.left^.class >= Nconst)) + BEGIN RETURN (x^.class >= OPT.Nconst) & ((x^.class # OPT.Nmop) OR (x^.subcl # OPT.val) OR (x^.left^.class >= OPT.Nconst)) END NotVar; PROCEDURE DeRef*(VAR x: OPT.Node); VAR strobj, bstrobj: OPT.Object; typ, btyp: OPT.Struct; BEGIN typ := x^.typ; - IF x^.class >= Nconst THEN err(78) - ELSIF typ^.form = Pointer THEN + IF x^.class >= OPT.Nconst THEN err(78) + ELSIF typ^.form = OPT.Pointer THEN IF typ = OPT.sysptrtyp THEN err(57) END ; btyp := typ^.BaseTyp; strobj := typ^.strobj; bstrobj := btyp^.strobj; IF (strobj # NIL) & (strobj^.name # "") & (bstrobj # NIL) & (bstrobj^.name # "") THEN btyp^.pbused := TRUE END ; - BindNodes(Nderef, btyp, x, NIL) + BindNodes(OPT.Nderef, btyp, x, NIL) ELSE err(84) END END DeRef; @@ -238,23 +205,23 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) VAR f: INTEGER; typ: OPT.Struct; BEGIN f := y^.typ^.form; - IF x^.class >= Nconst THEN err(79) - ELSIF ~(f IN intSet) OR (y^.class IN {Nproc, Ntype}) THEN err(80); y^.typ := OPT.inttyp END ; - IF x^.typ^.comp = Array THEN typ := x^.typ^.BaseTyp; - IF (y^.class = Nconst) & ((y^.conval^.intval < 0) OR (y^.conval^.intval >= x^.typ^.n)) THEN err(81) END - ELSIF x^.typ^.comp = DynArr THEN typ := x^.typ^.BaseTyp; - IF (y^.class = Nconst) & (y^.conval^.intval < 0) THEN err(81) END + IF x^.class >= OPT.Nconst THEN err(79) + ELSIF ~(f IN OPT.intSet) OR (y^.class IN {OPT.Nproc, OPT.Ntype}) THEN err(80); y^.typ := OPT.inttyp END ; + IF x^.typ^.comp = OPT.Array THEN typ := x^.typ^.BaseTyp; + IF (y^.class = OPT.Nconst) & ((y^.conval^.intval < 0) OR (y^.conval^.intval >= x^.typ^.n)) THEN err(81) END + ELSIF x^.typ^.comp = OPT.DynArr THEN typ := x^.typ^.BaseTyp; + IF (y^.class = OPT.Nconst) & (y^.conval^.intval < 0) THEN err(81) END ELSE err(82); typ := OPT.undftyp END ; - BindNodes(Nindex, typ, x, y); x^.readonly := x^.left^.readonly + BindNodes(OPT.Nindex, typ, x, y); x^.readonly := x^.left^.readonly END Index; PROCEDURE Field*(VAR x: OPT.Node; y: OPT.Object); - BEGIN (*x^.typ^.comp = Record*) - IF x^.class >= Nconst THEN err(77) END ; - IF (y # NIL) & (y^.mode IN {Fld, TProc}) THEN - BindNodes(Nfield, y^.typ, x, NIL); x^.obj := y; - x^.readonly := x^.left^.readonly OR ((y^.vis = externalR) & (y^.mnolev < 0)) + BEGIN (*x^.typ^.comp = OPT.Record*) + IF x^.class >= OPT.Nconst THEN err(77) END ; + IF (y # NIL) & (y^.mode IN {OPT.Fld, OPT.TProc}) THEN + BindNodes(OPT.Nfield, y^.typ, x, NIL); x^.obj := y; + x^.readonly := x^.left^.readonly OR ((y^.vis = OPT.externalR) & (y^.mnolev < 0)) ELSE err(83); x^.typ := OPT.undftyp END END Field; @@ -267,17 +234,17 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) WHILE (t # NIL) & (t # t1) & (t # OPT.undftyp) DO t := t^.BaseTyp END ; IF t # t1 THEN WHILE (t1 # NIL) & (t1 # t0) & (t1 # OPT.undftyp) DO t1 := t1^.BaseTyp END ; - IF (t1 = t0) OR (t0.form = Undef (*SYSTEM.PTR*)) THEN - IF guard THEN BindNodes(Nguard, NIL, x, NIL); x^.readonly := x^.left^.readonly - ELSE node := OPT.NewNode(Nmop); node^.subcl := is; node^.left := x; + IF (t1 = t0) OR (t0.form = OPT.Undef (*SYSTEM.PTR*)) THEN + IF guard THEN BindNodes(OPT.Nguard, NIL, x, NIL); x^.readonly := x^.left^.readonly + ELSE node := OPT.NewNode(OPT.Nmop); node^.subcl := OPS.is; node^.left := x; node^.obj := obj; x := node END ELSE err(85) END ELSIF t0 # t1 THEN err(85) (* prevent down guard *) ELSIF ~guard THEN - IF x^.class = Nguard THEN (* cannot skip guard *) - node := OPT.NewNode(Nmop); node^.subcl := is; node^.left := x; + IF x^.class = OPT.Nguard THEN (* cannot skip guard *) + node := OPT.NewNode(OPT.Nmop); node^.subcl := OPS.is; node^.left := x; node^.obj := obj; x := node ELSE x := NewBoolConst(TRUE) END @@ -286,12 +253,12 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) BEGIN IF NotVar(x) THEN err(112) - ELSIF x^.typ^.form = Pointer THEN - IF (x^.typ^.BaseTyp^.comp # Record) & (x^.typ # OPT.sysptrtyp) THEN err(85) - ELSIF obj^.typ^.form = Pointer THEN GTT(x^.typ^.BaseTyp, obj^.typ^.BaseTyp) + ELSIF x^.typ^.form = OPT.Pointer THEN + IF (x^.typ^.BaseTyp^.comp # OPT.Record) & (x^.typ # OPT.sysptrtyp) THEN err(85) + ELSIF obj^.typ^.form = OPT.Pointer THEN GTT(x^.typ^.BaseTyp, obj^.typ^.BaseTyp) ELSE err(86) END - ELSIF (x^.typ^.comp = Record) & (x^.class = Nvarpar) & (obj^.typ^.comp = Record) THEN + ELSIF (x^.typ^.comp = OPT.Record) & (x^.class = OPT.Nvarpar) & (obj^.typ^.comp = OPT.Record) THEN GTT(x^.typ, obj^.typ) ELSE err(87) END ; @@ -301,15 +268,15 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) PROCEDURE In*(VAR x: OPT.Node; y: OPT.Node); VAR f: INTEGER; k: LONGINT; BEGIN f := x^.typ^.form; - IF (x^.class = Ntype) OR (x^.class = Nproc) OR (y^.class = Ntype) OR (y^.class = Nproc) THEN err(126) - ELSIF (f IN intSet) & (y^.typ^.form = Set) THEN - IF x^.class = Nconst THEN + IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) OR (y^.class = OPT.Ntype) OR (y^.class = OPT.Nproc) THEN err(126) + ELSIF (f IN OPT.intSet) & (y^.typ^.form = OPT.Set) THEN + IF x^.class = OPT.Nconst THEN k := x^.conval^.intval; IF (k < 0) OR (k > OPM.MaxSet) THEN err(202) - ELSIF y^.class = Nconst THEN x^.conval^.intval := BoolToInt(k IN y^.conval^.setval); x^.obj := NIL - ELSE BindNodes(Ndop, OPT.booltyp, x, y); x^.subcl := in + ELSIF y^.class = OPT.Nconst THEN x^.conval^.intval := BoolToInt(k IN y^.conval^.setval); x^.obj := NIL + ELSE BindNodes(OPT.Ndop, OPT.booltyp, x, y); x^.subcl := OPS.in END - ELSE BindNodes(Ndop, OPT.booltyp, x, y); x^.subcl := in + ELSE BindNodes(OPT.Ndop, OPT.booltyp, x, y); x^.subcl := OPS.in END ELSE err(92) END ; @@ -327,13 +294,13 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) PROCEDURE CheckRealType(f, nr: INTEGER; x: OPT.Const); VAR min, max, r: LONGREAL; BEGIN - IF f = Real THEN min := OPM.MinReal; max := OPM.MaxReal + IF f = OPT.Real THEN min := OPM.MinReal; max := OPM.MaxReal ELSE min := OPM.MinLReal; max := OPM.MaxLReal END ; r := ABS(x^.realval); IF (r > max) OR (r < min) THEN err(nr); x^.realval := 1.0 - ELSIF f = Real THEN x^.realval := SHORT(x^.realval) (* single precision only *) + ELSIF f = OPT.Real THEN x^.realval := SHORT(x^.realval) (* single precision only *) END ; x^.intval := OPM.ConstNotAlloc END CheckRealType; @@ -344,86 +311,77 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) PROCEDURE NewOp(op: SHORTINT; typ: OPT.Struct; z: OPT.Node): OPT.Node; VAR node: OPT.Node; BEGIN - node := OPT.NewNode(Nmop); node^.subcl := op; node^.typ := typ; + node := OPT.NewNode(OPT.Nmop); node^.subcl := op; node^.typ := typ; node^.left := z; RETURN node END NewOp; BEGIN z := x; - IF (z^.class = Ntype) OR (z^.class = Nproc) THEN err(126) + IF (z^.class = OPT.Ntype) OR (z^.class = OPT.Nproc) THEN err(126) ELSE typ := z^.typ; f := typ^.form; CASE op OF - not: - IF f = Bool THEN - IF z^.class = Nconst THEN - z^.conval^.intval := BoolToInt(~IntToBool(z^.conval^.intval)); z^.obj := NIL - ELSE z := NewOp(op, typ, z) - END - ELSE err(98) - END - | plus: - IF ~(f IN intSet + realSet) THEN err(96) END - | minus: - IF f IN intSet + realSet +{Set}THEN - IF z^.class = Nconst THEN - IF f IN intSet THEN - IF z^.conval^.intval = MIN(LONGINT) THEN err(203) - ELSE z^.conval^.intval := -z^.conval^.intval; SetIntType(z) - END - ELSIF f IN realSet THEN z^.conval^.realval := -z^.conval^.realval - ELSE z^.conval^.setval := -z^.conval^.setval - END ; - z^.obj := NIL - ELSE z := NewOp(op, typ, z) - END - ELSE err(97) - END - | abs: - IF f IN intSet + realSet THEN - IF z^.class = Nconst THEN - IF f IN intSet THEN - IF z^.conval^.intval = MIN(LONGINT) THEN err(203) - ELSE z^.conval^.intval := ABS(z^.conval^.intval); SetIntType(z) - END - ELSE z^.conval^.realval := ABS(z^.conval^.realval) - END ; - z^.obj := NIL - ELSE z := NewOp(op, typ, z) - END - ELSE err(111) - END - | cap: - IF f = Char THEN - IF z^.class = Nconst THEN - z^.conval^.intval := ORD(CAP(CHR(z^.conval^.intval))); z^.obj := NIL - ELSE z := NewOp(op, typ, z) - END - ELSE err(111); z^.typ := OPT.chartyp - END - | odd: - IF f IN intSet THEN - IF z^.class = Nconst THEN - z^.conval^.intval := BoolToInt(ODD(z^.conval^.intval)); z^.obj := NIL - ELSE z := NewOp(op, typ, z) - END - ELSE err(111) - END ; - z^.typ := OPT.booltyp - | adr: (*SYSTEM.ADR*) - IF (z^.class = Nconst) & (f = Char) & (z^.conval^.intval >= 20H) THEN - CharToString(z); f := String - END; - IF (z^.class < Nconst) OR (f = String) THEN z := NewOp(op, typ, z) - ELSE err(127) - END ; - z^.typ := OPT.linttyp - | cc: (*SYSTEM.CC*) - IF (f IN intSet) & (z^.class = Nconst) THEN - IF (0 <= z^.conval^.intval) & (z^.conval^.intval <= OPM.MaxCC) THEN z := NewOp(op, typ, z) ELSE err(219) END - ELSE err(69) - END ; - z^.typ := OPT.booltyp - ELSE - OPM.LogWStr("unhandled case in OPB.MOp, op = "); OPM.LogWNum(op, 0); OPM.LogWLn; + |OPS.not: IF f = OPT.Bool THEN + IF z^.class = OPT.Nconst THEN + z^.conval^.intval := BoolToInt(~IntToBool(z^.conval^.intval)); z^.obj := NIL + ELSE z := NewOp(op, typ, z) + END + ELSE err(98) + END + |OPS.plus: IF ~(f IN OPT.intSet + OPT.realSet) THEN err(96) END + |OPS.minus: IF f IN OPT.intSet + OPT.realSet +{OPT.Set}THEN + IF z^.class = OPT.Nconst THEN + IF f IN OPT.intSet THEN + IF z^.conval^.intval = MIN(LONGINT) THEN err(203) + ELSE z^.conval^.intval := -z^.conval^.intval; SetIntType(z) + END + ELSIF f IN OPT.realSet THEN z^.conval^.realval := -z^.conval^.realval + ELSE z^.conval^.setval := -z^.conval^.setval + END ; + z^.obj := NIL + ELSE z := NewOp(op, typ, z) + END + ELSE err(97) + END + |OPT.abs: IF f IN OPT.intSet + OPT.realSet THEN + IF z^.class = OPT.Nconst THEN + IF f IN OPT.intSet THEN + IF z^.conval^.intval = MIN(LONGINT) THEN err(203) + ELSE z^.conval^.intval := ABS(z^.conval^.intval); SetIntType(z) + END + ELSE z^.conval^.realval := ABS(z^.conval^.realval) + END ; + z^.obj := NIL + ELSE z := NewOp(op, typ, z) + END + ELSE err(111) + END + |OPT.cap: IF f = OPT.Char THEN + IF z^.class = OPT.Nconst THEN + z^.conval^.intval := ORD(CAP(CHR(z^.conval^.intval))); z^.obj := NIL + ELSE z := NewOp(op, typ, z) + END + ELSE err(111); z^.typ := OPT.chartyp + END + |OPT.odd: IF f IN OPT.intSet THEN + IF z^.class = OPT.Nconst THEN + z^.conval^.intval := BoolToInt(ODD(z^.conval^.intval)); z^.obj := NIL + ELSE z := NewOp(op, typ, z) + END + ELSE err(111) + END ; + z^.typ := OPT.booltyp + |OPT.adr: IF (z^.class = OPT.Nconst) & (f = OPT.Char) & (z^.conval^.intval >= 20H) THEN (*SYSTEM.ADR*) + CharToString(z); f := OPT.String + END; + IF (z^.class < OPT.Nconst) OR (f = OPT.String) THEN z := NewOp(op, typ, z) + ELSE err(127) + END ; + z^.typ := OPT.linttyp + |OPT.cc: IF (f IN OPT.intSet) & (z^.class = OPT.Nconst) THEN (*SYSTEM.CC*) + IF (0 <= z^.conval^.intval) & (z^.conval^.intval <= OPM.MaxCC) THEN z := NewOp(op, typ, z) ELSE err(219) END + ELSE err(69) + END ; + z^.typ := OPT.booltyp + ELSE OPM.LogWStr("unhandled case in OPB.MOp, op = "); OPM.LogWNum(op, 0); OPM.LogWLn; END END ; x := z @@ -432,15 +390,15 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) PROCEDURE CheckPtr(x, y: OPT.Node); VAR g: INTEGER; p, q, t: OPT.Struct; BEGIN g := y^.typ^.form; - IF g = Pointer THEN + IF g = OPT.Pointer THEN p := x^.typ^.BaseTyp; q := y^.typ^.BaseTyp; - IF (p^.comp = Record) & (q^.comp = Record) THEN + IF (p^.comp = OPT.Record) & (q^.comp = OPT.Record) THEN IF p^.extlev < q^.extlev THEN t := p; p := q; q := t END ; WHILE (p # q) & (p # NIL) & (p # OPT.undftyp) DO p := p^.BaseTyp END ; IF p = NIL THEN err(100) END ELSE err(100) END - ELSIF g # NilTyp THEN err(100) + ELSIF g # OPT.NilTyp THEN err(100) END END CheckPtr; @@ -450,11 +408,11 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) WHILE fp # NIL DO IF ap # NIL THEN ft := fp^.typ; at := ap^.typ; - WHILE (ft^.comp = DynArr) & (at^.comp = DynArr) DO + WHILE (ft^.comp = OPT.DynArr) & (at^.comp = OPT.DynArr) DO ft := ft^.BaseTyp; at := at^.BaseTyp END ; IF ft # at THEN - IF (ft^.form = ProcTyp) & (at^.form = ProcTyp) THEN + IF (ft^.form = OPT.ProcTyp) & (at^.form = OPT.ProcTyp) THEN IF ft^.BaseTyp = at^.BaseTyp THEN CheckParameters(ft^.link, at^.link, FALSE) ELSE err(117) END @@ -472,9 +430,9 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) PROCEDURE CheckProc(x: OPT.Struct; y: OPT.Object); (* proc var x := proc y, check compatibility *) BEGIN - IF y^.mode IN {XProc, IProc, LProc} THEN - IF y^.mode = LProc THEN - IF y^.mnolev = 0 THEN y^.mode := XProc + IF y^.mode IN {OPT.XProc, OPT.IProc, OPT.LProc} THEN + IF y^.mode = OPT.LProc THEN + IF y^.mnolev = 0 THEN y^.mode := OPT.XProc ELSE err(73) END END ; @@ -493,210 +451,176 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) VAR res: INTEGER; BEGIN CASE f OF - Undef: - res := eql - | Byte, Char..LInt(*,Int8..Int64*): - IF xval^.intval < yval^.intval THEN res := lss - ELSIF xval^.intval > yval^.intval THEN res := gtr - ELSE res := eql - END - | Real, LReal: - IF xval^.realval < yval^.realval THEN res := lss - ELSIF xval^.realval > yval^.realval THEN res := gtr - ELSE res := eql - END - | Bool: - IF xval^.intval # yval^.intval THEN res := neq - ELSE res := eql - END - | Set: - IF xval^.setval # yval^.setval THEN res := neq - ELSE res := eql - END - | String: - IF xval^.ext^ < yval^.ext^ THEN res := lss - ELSIF xval^.ext^ > yval^.ext^ THEN res := gtr - ELSE res := eql - END - | NilTyp, Pointer, ProcTyp: - IF xval^.intval # yval^.intval THEN res := neq - ELSE res := eql - END - ELSE - OPM.LogWStr("unhandled case in OPB.ConstCmp, f = "); OPM.LogWNum(f, 0); OPM.LogWLn; + |OPT.Undef: res := OPS.eql + |OPT.Byte, + OPT.Char + ..OPT.LInt: IF xval^.intval < yval^.intval THEN res := OPS.lss + ELSIF xval^.intval > yval^.intval THEN res := OPS.gtr + ELSE res := OPS.eql + END + |OPT.Real, + OPT.LReal: IF xval^.realval < yval^.realval THEN res := OPS.lss + ELSIF xval^.realval > yval^.realval THEN res := OPS.gtr + ELSE res := OPS.eql + END + |OPT.Bool: IF xval^.intval # yval^.intval THEN res := OPS.neq + ELSE res := OPS.eql + END + |OPT.Set: IF xval^.setval # yval^.setval THEN res := OPS.neq + ELSE res := OPS.eql + END + |OPT.String: IF xval^.ext^ < yval^.ext^ THEN res := OPS.lss + ELSIF xval^.ext^ > yval^.ext^ THEN res := OPS.gtr + ELSE res := OPS.eql + END + |OPT.NilTyp, + OPT.Pointer, + OPT.ProcTyp: IF xval^.intval # yval^.intval THEN res := OPS.neq + ELSE res := OPS.eql + END + ELSE OPM.LogWStr("unhandled case in OPB.ConstCmp, f = "); OPM.LogWNum(f, 0); OPM.LogWLn; END ; x^.typ := OPT.booltyp; RETURN res END ConstCmp; BEGIN + (* f, x, xval are for left side; g, y, yval for right side. *) f := x^.typ^.form; g := y^.typ^.form; xval := x^.conval; yval := y^.conval; IF f # g THEN CASE f OF - Char: - IF g = String THEN CharToString(x) - ELSE err(100); y^.typ := x^.typ; yval^ := xval^ - END ; - | SInt(*, Int8*): - IF g IN intSet THEN x^.typ := y^.typ - ELSIF g = Real THEN x^.typ := OPT.realtyp; xval^.realval := xval^.intval - ELSIF g = LReal THEN x^.typ := OPT.lrltyp; xval^.realval := xval^.intval - ELSE err(100); y^.typ := x^.typ; yval^ := xval^ - END - | Int(*, Int16, Int32, Int64*): - IF g = SInt THEN y^.typ := OPT.inttyp - ELSIF g IN intSet THEN x^.typ := y^.typ - ELSIF g = Real THEN x^.typ := OPT.realtyp; xval^.realval := xval^.intval - ELSIF g = LReal THEN x^.typ := OPT.lrltyp; xval^.realval := xval^.intval - ELSE err(100); y^.typ := x^.typ; yval^ := xval^ - END - | LInt: - IF g IN intSet THEN y^.typ := OPT.linttyp - ELSIF g = Real THEN x^.typ := OPT.realtyp; xval^.realval := xval^.intval - ELSIF g = LReal THEN x^.typ := OPT.lrltyp; xval^.realval := xval^.intval - ELSE err(100); y^.typ := x^.typ; yval^ := xval^ - END - | Real: - IF g IN intSet THEN y^.typ := x^.typ; yval^.realval := yval^.intval - ELSIF g = LReal THEN x^.typ := OPT.lrltyp - ELSE err(100); y^.typ := x^.typ; yval^ := xval^ - END - | LReal: - IF g IN intSet THEN y^.typ := x^.typ; yval^.realval := yval^.intval - ELSIF g = Real THEN y^.typ := OPT.lrltyp - ELSE err(100); y^.typ := x^.typ; yval^ := xval^ - END - | String: - IF g = Char THEN CharToString(y); g := String - ELSE err(100); y^.typ := x^.typ; yval^ := xval^ - END ; - | NilTyp: - IF ~(g IN {Pointer, ProcTyp}) THEN err(100) END - | Pointer: - CheckPtr(x, y) - | ProcTyp: - IF g # NilTyp THEN err(100) END + |OPT.Char: IF g = OPT.String THEN CharToString(x) + ELSE err(100); y^.typ := x^.typ; yval^ := xval^ + END ; + |OPT.SInt, + OPT.Int, + OPT.LInt: IF g IN OPT.intSet THEN + IF x.typ.size <= y.typ.size THEN x.typ := y.typ ELSE x.typ := IntType(x.typ.size) END + ELSIF g = OPT.Real THEN x^.typ := OPT.realtyp; xval^.realval := xval^.intval + ELSIF g = OPT.LReal THEN x^.typ := OPT.lrltyp; xval^.realval := xval^.intval + ELSE err(100); y^.typ := x^.typ; yval^ := xval^ + END + |OPT.Real: IF g IN OPT.intSet THEN y^.typ := x^.typ; yval^.realval := yval^.intval + ELSIF g = OPT.LReal THEN x^.typ := OPT.lrltyp + ELSE err(100); y^.typ := x^.typ; yval^ := xval^ + END + |OPT.LReal: IF g IN OPT.intSet THEN y^.typ := x^.typ; yval^.realval := yval^.intval + ELSIF g = OPT.Real THEN y^.typ := OPT.lrltyp + ELSE err(100); y^.typ := x^.typ; yval^ := xval^ + END + |OPT.String: IF g = OPT.Char THEN CharToString(y); g := OPT.String + ELSE err(100); y^.typ := x^.typ; yval^ := xval^ + END ; + |OPT.NilTyp: IF ~(g IN {OPT.Pointer, OPT.ProcTyp}) THEN err(100) END + |OPT.Pointer: CheckPtr(x, y) + |OPT.ProcTyp: IF g # OPT.NilTyp THEN err(100) END ELSE err(100); y^.typ := x^.typ; yval^ := xval^ END ; f := x^.typ^.form END ; (* {x^.typ = y^.typ} *) CASE op OF - times: - IF f IN intSet THEN xv := xval^.intval; yv := yval^.intval; - IF (xv = 0) OR (yv = 0) OR (* division with negative numbers is not defined *) - (xv > 0) & (yv > 0) & (yv <= MAX(LONGINT) DIV xv) OR - (xv > 0) & (yv < 0) & (yv >= MIN(LONGINT) DIV xv) OR - (xv < 0) & (yv > 0) & (xv >= MIN(LONGINT) DIV yv) OR - (xv < 0) & (yv < 0) & (xv # MIN(LONGINT)) & (yv # MIN(LONGINT)) & (-xv <= MAX(LONGINT) DIV (-yv)) THEN - xval^.intval := xv * yv; SetIntType(x) - ELSE err(204) - END - ELSIF f IN realSet THEN - temp := ABS(yval^.realval) <= 1.0; - IF temp OR (ABS(xval^.realval) <= MAX(LONGREAL) / ABS(yval^.realval)) THEN - xval^.realval := xval^.realval * yval^.realval; CheckRealType(f, 204, xval) - ELSE err(204) - END - ELSIF f = Set THEN - xval^.setval := xval^.setval * yval^.setval - ELSIF f # Undef THEN err(101) - END - | slash: - IF f IN intSet THEN - IF yval^.intval # 0 THEN - xval^.realval := xval^.intval / yval^.intval; CheckRealType(Real, 205, xval) - ELSE err(205); xval^.realval := 1.0 - END ; - x^.typ := OPT.realtyp - ELSIF f IN realSet THEN - temp := ABS(yval^.realval) >= 1.0; - IF temp OR (ABS(xval^.realval) <= MAX(LONGREAL) * ABS(yval^.realval)) THEN - xval^.realval := xval^.realval / yval^.realval; CheckRealType(f, 205, xval) - ELSE err(205) - END - ELSIF f = Set THEN - xval^.setval := xval^.setval / yval^.setval - ELSIF f # Undef THEN err(102) - END - | div: - IF f IN intSet THEN - IF yval^.intval # 0 THEN - xval^.intval := xval^.intval DIV yval^.intval; SetIntType(x) - ELSE err(205) - END - ELSIF f # Undef THEN err(103) - END - | mod: - IF f IN intSet THEN - IF yval^.intval # 0 THEN - xval^.intval := xval^.intval MOD yval^.intval; SetIntType(x) - ELSE err(205) - END - ELSIF f # Undef THEN err(104) - END - | and: - IF f = Bool THEN - xval^.intval := BoolToInt(IntToBool(xval^.intval) & IntToBool(yval^.intval)) - ELSE err(94) - END - | plus: - IF f IN intSet THEN - temp := (yval^.intval >= 0) & (xval^.intval <= MAX(LONGINT) - yval^.intval); - IF temp OR (yval^.intval < 0) & (xval^.intval >= MIN(LONGINT) - yval^.intval) THEN - INC(xval^.intval, yval^.intval); SetIntType(x) - ELSE err(206) - END - ELSIF f IN realSet THEN - temp := (yval^.realval >= 0.0) & (xval^.realval <= MAX(LONGREAL) - yval^.realval); - IF temp OR (yval^.realval < 0.0) & (xval^.realval >= -MAX(LONGREAL) - yval^.realval) THEN - xval^.realval := xval^.realval + yval^.realval; CheckRealType(f, 206, xval) - ELSE err(206) - END - ELSIF f = Set THEN - xval^.setval := xval^.setval + yval^.setval - ELSIF f # Undef THEN err(105) - END - | minus: - IF f IN intSet THEN - IF (yval^.intval >= 0) & (xval^.intval >= MIN(LONGINT) + yval^.intval) OR - (yval^.intval < 0) & (xval^.intval <= MAX(LONGINT) + yval^.intval) THEN - DEC(xval^.intval, yval^.intval); SetIntType(x) - ELSE err(207) - END - ELSIF f IN realSet THEN - temp := (yval^.realval >= 0.0) & (xval^.realval >= -MAX(LONGREAL) + yval^.realval); - IF temp OR (yval^.realval < 0.0) & (xval^.realval <= MAX(LONGREAL) + yval^.realval) THEN - xval^.realval := xval^.realval - yval^.realval; CheckRealType(f, 207, xval) - ELSE err(207) - END - ELSIF f = Set THEN - xval^.setval := xval^.setval - yval^.setval - ELSIF f # Undef THEN err(106) - END - | or: - IF f = Bool THEN - xval^.intval := BoolToInt(IntToBool(xval^.intval) OR IntToBool(yval^.intval)) - ELSE err(95) - END - | eql: - xval^.intval := BoolToInt(ConstCmp() = eql) - | neq: - xval^.intval := BoolToInt(ConstCmp() # eql) - | lss: - IF f IN {Bool, Set, NilTyp, Pointer} THEN err(108) - ELSE xval^.intval := BoolToInt(ConstCmp() = lss) - END - | leq: - IF f IN {Bool, Set, NilTyp, Pointer} THEN err(108) - ELSE xval^.intval := BoolToInt(ConstCmp() # gtr) - END - | gtr: - IF f IN {Bool, Set, NilTyp, Pointer} THEN err(108) - ELSE xval^.intval := BoolToInt(ConstCmp() = gtr) - END - | geq: - IF f IN {Bool, Set, NilTyp, Pointer} THEN err(108) - ELSE xval^.intval := BoolToInt(ConstCmp() # lss) - END + |OPS.times: IF f IN OPT.intSet THEN xv := xval^.intval; yv := yval^.intval; + IF (xv = 0) OR (yv = 0) OR (* division with negative numbers is not defined *) + (xv > 0) & (yv > 0) & (yv <= MAX(LONGINT) DIV xv) OR + (xv > 0) & (yv < 0) & (yv >= MIN(LONGINT) DIV xv) OR + (xv < 0) & (yv > 0) & (xv >= MIN(LONGINT) DIV yv) OR + (xv < 0) & (yv < 0) & (xv # MIN(LONGINT)) & (yv # MIN(LONGINT)) & (-xv <= MAX(LONGINT) DIV (-yv)) THEN + xval^.intval := xv * yv; SetIntType(x) + ELSE err(204) + END + ELSIF f IN OPT.realSet THEN + temp := ABS(yval^.realval) <= 1.0; + IF temp OR (ABS(xval^.realval) <= MAX(LONGREAL) / ABS(yval^.realval)) THEN + xval^.realval := xval^.realval * yval^.realval; CheckRealType(f, 204, xval) + ELSE err(204) + END + ELSIF f = OPT.Set THEN + xval^.setval := xval^.setval * yval^.setval + ELSIF f # OPT.Undef THEN err(101) + END + |OPS.slash: IF f IN OPT.intSet THEN + IF yval^.intval # 0 THEN + xval^.realval := xval^.intval / yval^.intval; CheckRealType(OPT.Real, 205, xval) + ELSE err(205); xval^.realval := 1.0 + END ; + x^.typ := OPT.realtyp + ELSIF f IN OPT.realSet THEN + temp := ABS(yval^.realval) >= 1.0; + IF temp OR (ABS(xval^.realval) <= MAX(LONGREAL) * ABS(yval^.realval)) THEN + xval^.realval := xval^.realval / yval^.realval; CheckRealType(f, 205, xval) + ELSE err(205) + END + ELSIF f = OPT.Set THEN + xval^.setval := xval^.setval / yval^.setval + ELSIF f # OPT.Undef THEN err(102) + END + |OPS.div: IF f IN OPT.intSet THEN + IF yval^.intval # 0 THEN + xval^.intval := xval^.intval DIV yval^.intval; SetIntType(x) + ELSE err(205) + END + ELSIF f # OPT.Undef THEN err(103) + END + |OPS.mod: IF f IN OPT.intSet THEN + IF yval^.intval # 0 THEN + xval^.intval := xval^.intval MOD yval^.intval; SetIntType(x) + ELSE err(205) + END + ELSIF f # OPT.Undef THEN err(104) + END + |OPS.and: IF f = OPT.Bool THEN + xval^.intval := BoolToInt(IntToBool(xval^.intval) & IntToBool(yval^.intval)) + ELSE err(94) + END + |OPS.plus: IF f IN OPT.intSet THEN + temp := (yval^.intval >= 0) & (xval^.intval <= MAX(LONGINT) - yval^.intval); + IF temp OR (yval^.intval < 0) & (xval^.intval >= MIN(LONGINT) - yval^.intval) THEN + INC(xval^.intval, yval^.intval); SetIntType(x) + ELSE err(206) + END + ELSIF f IN OPT.realSet THEN + temp := (yval^.realval >= 0.0) & (xval^.realval <= MAX(LONGREAL) - yval^.realval); + IF temp OR (yval^.realval < 0.0) & (xval^.realval >= -MAX(LONGREAL) - yval^.realval) THEN + xval^.realval := xval^.realval + yval^.realval; CheckRealType(f, 206, xval) + ELSE err(206) + END + ELSIF f = OPT.Set THEN + xval^.setval := xval^.setval + yval^.setval + ELSIF f # OPT.Undef THEN err(105) + END + |OPS.minus: IF f IN OPT.intSet THEN + IF (yval^.intval >= 0) & (xval^.intval >= MIN(LONGINT) + yval^.intval) OR + (yval^.intval < 0) & (xval^.intval <= MAX(LONGINT) + yval^.intval) THEN + DEC(xval^.intval, yval^.intval); SetIntType(x) + ELSE err(207) + END + ELSIF f IN OPT.realSet THEN + temp := (yval^.realval >= 0.0) & (xval^.realval >= -MAX(LONGREAL) + yval^.realval); + IF temp OR (yval^.realval < 0.0) & (xval^.realval <= MAX(LONGREAL) + yval^.realval) THEN + xval^.realval := xval^.realval - yval^.realval; CheckRealType(f, 207, xval) + ELSE err(207) + END + ELSIF f = OPT.Set THEN + xval^.setval := xval^.setval - yval^.setval + ELSIF f # OPT.Undef THEN err(106) + END + |OPS.or: IF f = OPT.Bool THEN + xval^.intval := BoolToInt(IntToBool(xval^.intval) OR IntToBool(yval^.intval)) + ELSE err(95) + END + |OPS.eql: xval^.intval := BoolToInt(ConstCmp() = OPS.eql) + |OPS.neq: xval^.intval := BoolToInt(ConstCmp() # OPS.eql) + |OPS.lss: IF f IN {OPT.Bool, OPT.Set, OPT.NilTyp, OPT.Pointer} THEN err(108) + ELSE xval^.intval := BoolToInt(ConstCmp() = OPS.lss) + END + |OPS.leq: IF f IN {OPT.Bool, OPT.Set, OPT.NilTyp, OPT.Pointer} THEN err(108) + ELSE xval^.intval := BoolToInt(ConstCmp() # OPS.gtr) + END + |OPS.gtr: IF f IN {OPT.Bool, OPT.Set, OPT.NilTyp, OPT.Pointer} THEN err(108) + ELSE xval^.intval := BoolToInt(ConstCmp() = OPS.gtr) + END + |OPS.geq: IF f IN {OPT.Bool, OPT.Set, OPT.NilTyp, OPT.Pointer} THEN err(108) + ELSE xval^.intval := BoolToInt(ConstCmp() # OPS.lss) + END ELSE OPM.LogWStr("unhandled case in OPB.ConstOp, op = "); OPM.LogWNum(op, 0); OPM.LogWLn; END @@ -705,30 +629,30 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) PROCEDURE Convert(VAR x: OPT.Node; typ: OPT.Struct); VAR node: OPT.Node; f, g: INTEGER; k: LONGINT; r: LONGREAL; BEGIN f := x^.typ^.form; g := typ^.form; - IF x^.class = Nconst THEN - IF f IN intSet THEN - IF g IN intSet THEN + IF x^.class = OPT.Nconst THEN + IF f IN OPT.intSet THEN + IF g IN OPT.intSet THEN IF f > g THEN SetIntType(x); IF x^.typ^.form > g THEN err(203); x^.conval^.intval := 1 END END - ELSIF g IN realSet THEN x^.conval^.realval := x^.conval^.intval; x^.conval^.intval := OPM.ConstNotAlloc - ELSE (*g = Char*) k := x^.conval^.intval; + ELSIF g IN OPT.realSet THEN x^.conval^.realval := x^.conval^.intval; x^.conval^.intval := OPM.ConstNotAlloc + ELSE (*g = OPT.Char*) k := x^.conval^.intval; IF (0 > k) OR (k > 0FFH) THEN err(220) END END - ELSIF f IN realSet THEN - IF g IN realSet THEN CheckRealType(g, 203, x^.conval) - ELSE (*g = LInt*) + ELSIF f IN OPT.realSet THEN + IF g IN OPT.realSet THEN CheckRealType(g, 203, x^.conval) + ELSE (*g = OPT.LInt*) r := x^.conval^.realval; IF (r < MIN(LONGINT)) OR (r > MAX(LONGINT)) THEN err(203); r := 1 END ; x^.conval^.intval := ENTIER(r); SetIntType(x) END - ELSE (* (f IN {Char, Byte}) & (g IN {Byte} + intSet) OR (f = Undef) *) + ELSE (* (f IN {OPT.Char, OPT.Byte}) & (g IN {OPT.Byte} + OPT.intSet) OR (f = OPT.Undef) *) END ; x^.obj := NIL - ELSIF (x^.class = Nmop) & (x^.subcl = conv) & ((x^.left^.typ^.form < f) OR (f > g)) THEN + ELSIF (x^.class = OPT.Nmop) & (x^.subcl = OPT.conv) & ((x^.left^.typ^.form < f) OR (f > g)) THEN (* don't create new node *) IF x^.left^.typ = typ THEN (* and suppress existing node *) x := x^.left END - ELSE node := OPT.NewNode(Nmop); node^.subcl := conv; node^.left := x; x := node + ELSE node := OPT.NewNode(OPT.Nmop); node^.subcl := OPT.conv; node^.left := x; x := node END ; x^.typ := typ END Convert; @@ -739,23 +663,23 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) PROCEDURE NewOp(op: SHORTINT; typ: OPT.Struct; VAR x: OPT.Node; y: OPT.Node); VAR node: OPT.Node; BEGIN - node := OPT.NewNode(Ndop); node^.subcl := op; node^.typ := typ; + node := OPT.NewNode(OPT.Ndop); node^.subcl := op; node^.typ := typ; node^.left := x; node^.right := y; x := node END NewOp; PROCEDURE strings(VAR x, y: OPT.Node): BOOLEAN; VAR ok, xCharArr, yCharArr: BOOLEAN; BEGIN - xCharArr := ((x^.typ^.comp IN {Array, DynArr}) & (x^.typ^.BaseTyp^.form=Char)) OR (f=String); - yCharArr := (((y^.typ^.comp IN {Array, DynArr}) & (y^.typ^.BaseTyp^.form=Char)) OR (g=String)); - IF xCharArr & (g = Char) & (y^.class = Nconst) THEN CharToString(y); g := String; yCharArr := TRUE END ; - IF yCharArr & (f = Char) & (x^.class = Nconst) THEN CharToString(x); f := String; xCharArr := TRUE END ; + xCharArr := ((x^.typ^.comp IN {OPT.Array, OPT.DynArr}) & (x^.typ^.BaseTyp^.form=OPT.Char)) OR (f=OPT.String); + yCharArr := (((y^.typ^.comp IN {OPT.Array, OPT.DynArr}) & (y^.typ^.BaseTyp^.form=OPT.Char)) OR (g=OPT.String)); + IF xCharArr & (g = OPT.Char) & (y^.class = OPT.Nconst) THEN CharToString(y); g := OPT.String; yCharArr := TRUE END ; + IF yCharArr & (f = OPT.Char) & (x^.class = OPT.Nconst) THEN CharToString(x); f := OPT.String; xCharArr := TRUE END ; ok := xCharArr & yCharArr; IF ok THEN (* replace ""-string compare with 0X-char compare, if possible *) - IF (f=String) & (x^.conval^.intval2 = 1) THEN (* y is array of char *) + IF (f=OPT.String) & (x^.conval^.intval2 = 1) THEN (* y is array of char *) x^.typ := OPT.chartyp; x^.conval^.intval := 0; Index(y, NewIntConst(0)) - ELSIF (g=String) & (y^.conval^.intval2 = 1) THEN (* x is array of char *) + ELSIF (g=OPT.String) & (y^.conval^.intval2 = 1) THEN (* x is array of char *) y^.typ := OPT.chartyp; y^.conval^.intval := 0; Index(x, NewIntConst(0)) END @@ -765,153 +689,131 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) BEGIN z := x; - IF (z^.class = Ntype) OR (z^.class = Nproc) OR (y^.class = Ntype) OR (y^.class = Nproc) THEN err(126) - ELSIF (z^.class = Nconst) & (y^.class = Nconst) THEN ConstOp(op, z, y); z^.obj := NIL + IF (z^.class = OPT.Ntype) OR (z^.class = OPT.Nproc) OR (y^.class = OPT.Ntype) OR (y^.class = OPT.Nproc) THEN err(126) + ELSIF (z^.class = OPT.Nconst) & (y^.class = OPT.Nconst) THEN ConstOp(op, z, y); z^.obj := NIL ELSE IF z^.typ # y^.typ THEN g := y^.typ^.form; CASE z^.typ^.form OF - Char: - IF z^.class = Nconst THEN CharToString(z) ELSE err(100) END - | SInt(*, Int8*): - IF g IN intSet + realSet THEN Convert(z, y^.typ) - ELSE err(100) - END - | Int: - IF g = SInt THEN Convert(y, z^.typ) - ELSIF g IN intSet + realSet THEN Convert(z, y^.typ) - ELSE err(100) - END - | LInt(*, Int16, Int32, Int64*): - IF g IN intSet THEN Convert(y, z^.typ) - ELSIF g IN realSet THEN Convert(z, y^.typ) - ELSE err(100) - END - | Real: - IF g IN intSet THEN Convert(y, z^.typ) - ELSIF g IN realSet THEN Convert(z, y^.typ) - ELSE err(100) - END - | LReal: - IF g IN intSet + realSet THEN Convert(y, z^.typ) - ELSIF g IN realSet THEN Convert(y, z^.typ) - ELSE err(100) - END - | NilTyp: - IF ~(g IN {Pointer, ProcTyp}) THEN err(100) END - | Pointer: - CheckPtr(z, y) - | ProcTyp: - IF g # NilTyp THEN err(100) END - | String: - | Comp: - IF z^.typ^.comp = Record THEN err(100) END + |OPT.Char: IF z^.class = OPT.Nconst THEN CharToString(z) ELSE err(100) END + |OPT.SInt, + OPT.Int, + OPT.LInt: IF (g IN OPT.intSet) & (y.typ.size < z.typ.size) THEN Convert(y, z.typ) + ELSIF g IN OPT.intSet + OPT.realSet THEN Convert(z, y.typ) + ELSE err(100) + END + |OPT.Real: IF g IN OPT.intSet THEN Convert(y, z^.typ) + ELSIF g IN OPT.realSet THEN Convert(z, y^.typ) + ELSE err(100) + END + |OPT.LReal: IF g IN OPT.intSet + OPT.realSet THEN Convert(y, z^.typ) + ELSIF g IN OPT.realSet THEN Convert(y, z^.typ) (* DCWB: Surely this line does nothing. *) + ELSE err(100) + END + |OPT.NilTyp: IF ~(g IN {OPT.Pointer, OPT.ProcTyp}) THEN err(100) END + |OPT.Pointer: CheckPtr(z, y) + |OPT.ProcTyp: IF g # OPT.NilTyp THEN err(100) END + |OPT.String: + |OPT.Comp: IF z^.typ^.comp = OPT.Record THEN err(100) END ELSE err(100) END END ; (* {z^.typ = y^.typ} *) typ := z^.typ; f := typ^.form; g := y^.typ^.form; CASE op OF - times: - do := TRUE; - IF f IN intSet THEN - IF z^.class = Nconst THEN val := z^.conval^.intval; - IF val = 1 THEN do := FALSE; z := y - ELSIF val = 0 THEN do := FALSE - ELSIF log(val) = 1 THEN - t := y; y := z; z := t; - op := ash; y^.typ := OPT.sinttyp; y^.conval^.intval := exp; y^.obj := NIL - END - ELSIF y^.class = Nconst THEN val := y^.conval^.intval; - IF val = 1 THEN do := FALSE - ELSIF val = 0 THEN do := FALSE; z := y - ELSIF log(val) = 1 THEN - op := ash; y^.typ := OPT.sinttyp; y^.conval^.intval := exp; y^.obj := NIL - END - END - ELSIF ~(f IN {Undef, Real..Set}) THEN err(105); typ := OPT.undftyp - END ; - IF do THEN NewOp(op, typ, z, y) END - | slash: - IF f IN intSet THEN - IF (y^.class = Nconst) & (y^.conval^.intval = 0) THEN err(205) END ; - Convert(z, OPT.realtyp); Convert(y, OPT.realtyp); - typ := OPT.realtyp - ELSIF f IN realSet THEN - IF (y^.class = Nconst) & (y^.conval^.realval = 0.0) THEN err(205) END - ELSIF (f # Set) & (f # Undef) THEN err(102); typ := OPT.undftyp - END ; - NewOp(op, typ, z, y) - | div: - do := TRUE; - IF f IN intSet THEN - IF y^.class = Nconst THEN val := y^.conval^.intval; - IF val = 0 THEN err(205) - ELSIF val = 1 THEN do := FALSE - ELSIF log(val) = 1 THEN - op := ash; y^.typ := OPT.sinttyp; y^.conval^.intval := -exp; y^.obj := NIL - END - END - ELSIF f # Undef THEN err(103); typ := OPT.undftyp - END ; - IF do THEN NewOp(op, typ, z, y) END - | mod: - IF f IN intSet THEN - IF y^.class = Nconst THEN - IF y^.conval^.intval = 0 THEN err(205) - ELSIF log(y^.conval^.intval) = 1 THEN - op := msk; y^.conval^.intval := ASH(-1, exp); y^.obj := NIL - END - END - ELSIF f # Undef THEN err(104); typ := OPT.undftyp - END ; - NewOp(op, typ, z, y) - | and: - IF f = Bool THEN - IF z^.class = Nconst THEN - IF IntToBool(z^.conval^.intval) THEN z := y END - ELSIF (y^.class = Nconst) & IntToBool(y^.conval^.intval) THEN (* optimize z & TRUE -> z *) - (* ELSIF (y^.class = Nconst) & ~IntToBool(y^.conval^.intval) THEN - don't optimize z & FALSE -> FALSE: side effects possible *) - ELSE NewOp(op, typ, z, y) - END - ELSIF f # Undef THEN err(94); z^.typ := OPT.undftyp - END - | plus: - IF ~(f IN {Undef, SInt..Set(*, Int8..Int64*)}) THEN err(105); typ := OPT.undftyp END ; - do := TRUE; - IF f IN intSet THEN - IF (z^.class = Nconst) & (z^.conval^.intval = 0) THEN do := FALSE; z := y END ; - IF (y^.class = Nconst) & (y^.conval^.intval = 0) THEN do := FALSE END - END ; - IF do THEN NewOp(op, typ, z, y) END - | minus: - IF ~(f IN {Undef, SInt..Set(*, Int8..Int64*)}) THEN err(106); typ := OPT.undftyp END ; - IF ~(f IN intSet) OR (y^.class # Nconst) OR (y^.conval^.intval # 0) THEN NewOp(op, typ, z, y) END - | or: - IF f = Bool THEN - IF z^.class = Nconst THEN - IF ~IntToBool(z^.conval^.intval) THEN z := y END - ELSIF (y^.class = Nconst) & ~IntToBool(y^.conval^.intval) THEN (* optimize z OR FALSE -> z *) - (* ELSIF (y^.class = Nconst) & IntToBool(y^.conval^.intval) THEN - don't optimize z OR TRUE -> TRUE: side effects possible *) - ELSE NewOp(op, typ, z, y) - END - ELSIF f # Undef THEN err(95); z^.typ := OPT.undftyp - END - | eql, neq: - IF (f IN {Undef..Set, NilTyp, Pointer, ProcTyp(*, Int8..Int64*)}) OR strings(z, y) THEN typ := OPT.booltyp - ELSE err(107); typ := OPT.undftyp - END ; - NewOp(op, typ, z, y) - | lss, leq, gtr, geq: - IF (f IN {Undef, Char..LReal(*, Int8..Int64*)}) OR strings(z, y) THEN typ := OPT.booltyp - ELSE - OPM.LogWLn; OPM.LogWStr("ELSE in Op()"); OPM.LogWLn; - err(108); typ := OPT.undftyp - END ; - NewOp(op, typ, z, y) - ELSE - OPM.LogWStr("unhandled case in OPB.Op, op = "); OPM.LogWNum(op, 0); OPM.LogWLn; + |OPS.times: do := TRUE; + IF f IN OPT.intSet THEN + IF z^.class = OPT.Nconst THEN val := z^.conval^.intval; + IF val = 1 THEN do := FALSE; z := y + ELSIF val = 0 THEN do := FALSE + ELSIF log(val) = 1 THEN + t := y; y := z; z := t; + op := OPT.ash; y^.typ := OPT.sinttyp; y^.conval^.intval := exp; y^.obj := NIL + END + ELSIF y^.class = OPT.Nconst THEN val := y^.conval^.intval; + IF val = 1 THEN do := FALSE + ELSIF val = 0 THEN do := FALSE; z := y + ELSIF log(val) = 1 THEN + op := OPT.ash; y^.typ := OPT.sinttyp; y^.conval^.intval := exp; y^.obj := NIL + END + END + ELSIF ~(f IN {OPT.Undef, OPT.Real..OPT.Set}) THEN err(105); typ := OPT.undftyp + END ; + IF do THEN NewOp(op, typ, z, y) END + |OPS.slash: IF f IN OPT.intSet THEN + IF (y^.class = OPT.Nconst) & (y^.conval^.intval = 0) THEN err(205) END ; + Convert(z, OPT.realtyp); Convert(y, OPT.realtyp); + typ := OPT.realtyp + ELSIF f IN OPT.realSet THEN + IF (y^.class = OPT.Nconst) & (y^.conval^.realval = 0.0) THEN err(205) END + ELSIF (f # OPT.Set) & (f # OPT.Undef) THEN err(102); typ := OPT.undftyp + END ; + NewOp(op, typ, z, y) + |OPS.div: do := TRUE; + IF f IN OPT.intSet THEN + IF y^.class = OPT.Nconst THEN val := y^.conval^.intval; + IF val = 0 THEN err(205) + ELSIF val = 1 THEN do := FALSE + ELSIF log(val) = 1 THEN + op := OPT.ash; y^.typ := OPT.sinttyp; y^.conval^.intval := -exp; y^.obj := NIL + END + END + ELSIF f # OPT.Undef THEN err(103); typ := OPT.undftyp + END ; + IF do THEN NewOp(op, typ, z, y) END + |OPS.mod: IF f IN OPT.intSet THEN + IF y^.class = OPT.Nconst THEN + IF y^.conval^.intval = 0 THEN err(205) + ELSIF log(y^.conval^.intval) = 1 THEN + op := OPT.msk; y^.conval^.intval := ASH(-1, exp); y^.obj := NIL + END + END + ELSIF f # OPT.Undef THEN err(104); typ := OPT.undftyp + END ; + NewOp(op, typ, z, y) + |OPS.and: IF f = OPT.Bool THEN + IF z^.class = OPT.Nconst THEN + IF IntToBool(z^.conval^.intval) THEN z := y END + ELSIF (y^.class = OPT.Nconst) & IntToBool(y^.conval^.intval) THEN (* optimize z & TRUE -> z *) + (*ELSIF (y^.class = OPT.Nconst) & ~IntToBool(y^.conval^.intval) THEN + don't optimize z & FALSE -> FALSE: side effects possible *) + ELSE NewOp(op, typ, z, y) + END + ELSIF f # OPT.Undef THEN err(94); z^.typ := OPT.undftyp + END + |OPS.plus: IF ~(f IN {OPT.Undef, OPT.SInt..OPT.Set}) THEN err(105); typ := OPT.undftyp END ; + do := TRUE; + IF f IN OPT.intSet THEN + IF (z^.class = OPT.Nconst) & (z^.conval^.intval = 0) THEN do := FALSE; z := y END ; + IF (y^.class = OPT.Nconst) & (y^.conval^.intval = 0) THEN do := FALSE END + END ; + IF do THEN NewOp(op, typ, z, y) END + |OPS.minus: IF ~(f IN {OPT.Undef, OPT.SInt..OPT.Set}) THEN err(106); typ := OPT.undftyp END ; + IF ~(f IN OPT.intSet) OR (y^.class # OPT.Nconst) OR (y^.conval^.intval # 0) THEN NewOp(op, typ, z, y) END + |OPS.or: IF f = OPT.Bool THEN + IF z^.class = OPT.Nconst THEN + IF ~IntToBool(z^.conval^.intval) THEN z := y END + ELSIF (y^.class = OPT.Nconst) & ~IntToBool(y^.conval^.intval) THEN (* optimize z OR FALSE -> z *) + (*ELSIF (y^.class = OPT.Nconst) & IntToBool(y^.conval^.intval) THEN + don't optimize z OR TRUE -> TRUE: side effects possible *) + ELSE NewOp(op, typ, z, y) + END + ELSIF f # OPT.Undef THEN err(95); z^.typ := OPT.undftyp + END + |OPS.eql, + OPS.neq: IF (f IN {OPT.Undef..OPT.Set, OPT.NilTyp, OPT.Pointer, OPT.ProcTyp}) OR strings(z, y) THEN typ := OPT.booltyp + ELSE err(107); typ := OPT.undftyp + END ; + NewOp(op, typ, z, y) + |OPS.lss, + OPS.leq, + OPS.gtr, + OPS.geq: IF (f IN {OPT.Undef, OPT.Char..OPT.LReal}) OR strings(z, y) THEN typ := OPT.booltyp + ELSE + OPM.LogWLn; OPM.LogWStr("ELSE in Op()"); OPM.LogWLn; + err(108); typ := OPT.undftyp + END ; + NewOp(op, typ, z, y) + ELSE OPM.LogWStr("unhandled case in OPB.Op, op = "); OPM.LogWNum(op, 0); OPM.LogWLn; END END ; x := z @@ -920,23 +822,23 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) PROCEDURE SetRange*(VAR x: OPT.Node; y: OPT.Node); VAR k, l: LONGINT; BEGIN - IF (x^.class = Ntype) OR (x^.class = Nproc) OR (y^.class = Ntype) OR (y^.class = Nproc) THEN err(126) - ELSIF (x^.typ^.form IN intSet) & (y^.typ^.form IN intSet) THEN - IF x^.class = Nconst THEN + IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) OR (y^.class = OPT.Ntype) OR (y^.class = OPT.Nproc) THEN err(126) + ELSIF (x^.typ^.form IN OPT.intSet) & (y^.typ^.form IN OPT.intSet) THEN + IF x^.class = OPT.Nconst THEN k := x^.conval^.intval; IF (0 > k) OR (k > OPM.MaxSet) THEN err(202) END END ; - IF y^.class = Nconst THEN + IF y^.class = OPT.Nconst THEN l := y^.conval^.intval; IF (0 > l) OR (l > OPM.MaxSet) THEN err(202) END END ; - IF (x^.class = Nconst) & (y^.class = Nconst) THEN + IF (x^.class = OPT.Nconst) & (y^.class = OPT.Nconst) THEN IF k <= l THEN x^.conval^.setval := {k..l} ELSE err(201); x^.conval^.setval := {l..k} END ; x^.obj := NIL - ELSE BindNodes(Nupto, OPT.settyp, x, y) + ELSE BindNodes(OPT.Nupto, OPT.settyp, x, y) END ELSE err(93) END ; @@ -946,9 +848,9 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) PROCEDURE SetElem*(VAR x: OPT.Node); VAR k: LONGINT; BEGIN - IF (x^.class = Ntype) OR (x^.class = Nproc) THEN err(126) - ELSIF ~(x^.typ^.form IN intSet) THEN err(93) - ELSIF x^.class = Nconst THEN + IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) + ELSIF ~(x^.typ^.form IN OPT.intSet) THEN err(93) + ELSIF x^.class = OPT.Nconst THEN k := x^.conval^.intval; IF (0 <= k) & (k <= OPM.MaxSet) THEN x^.conval^.setval := {k} ELSE err(202) @@ -960,7 +862,11 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) END SetElem; PROCEDURE CheckAssign(x: OPT.Struct; ynode: OPT.Node); (* x := y *) - VAR f, g: INTEGER; y, p, q: OPT.Struct; + VAR (* x is designator (target) type *) + y: OPT.Struct; (* expression (source) type *) + f: INTEGER; (* designator (target) form *) + g: INTEGER; (* expression (source) form *) + p, q: OPT.Struct; BEGIN IF OPM.Verbose THEN OPM.LogWLn; OPM.LogWStr("PROCEDURE CheckAssign"); OPM.LogWLn; @@ -972,108 +878,76 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) OPM.LogWStr("g = "); OPM.LogWNum(g, 0); OPM.LogWLn; OPM.LogWStr("ynode.typ.syze = "); OPM.LogWNum(ynode.typ.size, 0); OPM.LogWLn; END; - IF (ynode^.class = Ntype) OR (ynode^.class = Nproc) & (f # ProcTyp) THEN err(126) END ; + IF (ynode^.class = OPT.Ntype) OR (ynode^.class = OPT.Nproc) & (f # OPT.ProcTyp) THEN err(126) END ; CASE f OF - Undef, String: - (* | Int8: - IF (ynode.typ.size > OPM.Int8Size) THEN - IF OPM.Verbose THEN OPM.LogWStr("f of int8"); OPM.LogWLn END; - err(113) - END - | Int16: - IF (ynode.typ.size > OPM.Int16Size) THEN - IF OPM.Verbose THEN OPM.LogWStr("f of int16"); OPM.LogWLn END; - err(113) - END - | Int32: - IF (ynode.typ.size > OPM.Int32Size) THEN - IF OPM.Verbose THEN OPM.LogWStr("f of int32"); OPM.LogWLn END; - err(113) - END - | Int64: - IF ynode.typ.size > OPM.Int64Size THEN - IF OPM.Verbose THEN OPM.LogWStr("f of int64"); OPM.LogWLn END; - err(113) - END*) - | Byte: - IF ~(g IN {Byte, Char, SInt}) THEN err(113) END - | Bool, Char, SInt, Set: - IF g # f THEN err(113) END - | Int: - IF ~(g IN {SInt, Int}) THEN err(113) END - | LInt: - IF OPM.LIntSize = 4 THEN - IF ~(g IN {SInt, Int, LInt(*, Int8, Int16, Int32*)}) THEN err(113) END - ELSE (* assume OPM.LIntSize = 8 *) - IF ~(g IN {SInt, Int, LInt(*, Int8, Int16, Int32, Int64*)}) THEN err(113) END - END; - | Real: - IF ~(g IN {SInt..Real}) THEN err(113) END - | LReal: - IF ~(g IN {SInt..LReal}) THEN err(113) END - | Pointer: - IF (x = y) OR (g = NilTyp) OR (x = OPT.sysptrtyp) & (g = Pointer) THEN (* ok *) - ELSIF g = Pointer THEN - p := x^.BaseTyp; q := y^.BaseTyp; - IF (p^.comp = Record) & (q^.comp = Record) THEN - WHILE (q # p) & (q # NIL) & (q # OPT.undftyp) DO q := q^.BaseTyp END ; - IF q = NIL THEN err(113) END - ELSE err(113) - END - ELSE err(113) - END - | ProcTyp: - IF ynode^.class = Nproc THEN CheckProc(x, ynode^.obj) - ELSIF (x = y) OR (g = NilTyp) THEN (* ok *) - ELSE err(113) - END - | NoTyp, NilTyp: - err(113) - | Comp: - x^.pvused := TRUE; (* idfp of y guarantees assignment compatibility with x *) - IF x^.comp = Array THEN - IF (ynode^.class = Nconst) & (g = Char) THEN CharToString(ynode); y := ynode^.typ; g := String END ; - IF x = y THEN (* ok *) - ELSIF x^.BaseTyp = OPT.chartyp THEN (* Assign to (static) ARRAY OF CHAR *) - IF g = String THEN (*check length of string*) - IF ynode^.conval^.intval2 > x^.n THEN err(114) END - ELSIF (y.comp IN {DynArr, Array}) & (y.BaseTyp = OPT.chartyp) THEN - (* Assignment from ARRAY OF CHAR is good.*) - ELSE err(113) - END - ELSE err(113) - END - ELSIF (x.comp = DynArr) & (x^.BaseTyp = OPT.chartyp) THEN (* Assign to dynamic ARRAY OF CHAR*) - IF (y.comp IN {DynArr, Array}) & (y.BaseTyp = OPT.chartyp) THEN - (* Assignment from ARRAY OF CHAR is good.*) - ELSE err(113) - END - ELSIF x^.comp = Record THEN - IF x = y THEN (* ok *) - ELSIF y^.comp = Record THEN - q := y^.BaseTyp; - WHILE (q # NIL) & (q # x) & (q # OPT.undftyp) DO q := q^.BaseTyp END ; - IF q = NIL THEN err(113) END - ELSE err(113) - END - ELSE err(113) - END - ELSE (* In case of not estimated f it would crash -- noch *) - OPM.LogWStr("unhandled case in OPB.CheckAssign, f = "); OPM.LogWNum(f, 0); OPM.LogWLn; + OPT.Undef, + OPT.String: + | OPT.Byte: IF ~((g IN ({OPT.Byte, OPT.Char} + OPT.intSet)) & (y.size = 1)) THEN err(113) END + | OPT.Bool, + OPT.Char, + OPT.Set: IF g # f THEN err(113) END + | OPT.SInt, + OPT.Int, + OPT.LInt: IF ~(g IN OPT.intSet) OR (x.size < y.size) THEN err(113) END + | OPT.Real: IF ~(g IN {OPT.SInt..OPT.Real}) THEN err(113) END + | OPT.LReal: IF ~(g IN {OPT.SInt..OPT.LReal}) THEN err(113) END + | OPT.Pointer: IF (x = y) OR (g = OPT.NilTyp) OR (x = OPT.sysptrtyp) & (g = OPT.Pointer) THEN (* ok *) + ELSIF g = OPT.Pointer THEN + p := x^.BaseTyp; q := y^.BaseTyp; + IF (p^.comp = OPT.Record) & (q^.comp = OPT.Record) THEN + WHILE (q # p) & (q # NIL) & (q # OPT.undftyp) DO q := q^.BaseTyp END ; + IF q = NIL THEN err(113) END + ELSE err(113) + END + ELSE err(113) + END + | OPT.ProcTyp: IF ynode^.class = OPT.Nproc THEN CheckProc(x, ynode^.obj) + ELSIF (x = y) OR (g = OPT.NilTyp) THEN (* ok *) + ELSE err(113) + END + | OPT.NoTyp, + OPT.NilTyp: err(113) + | OPT.Comp: x^.pvused := TRUE; (* idfp of y guarantees assignment compatibility with x *) + IF x^.comp = OPT.Array THEN + IF (ynode^.class = OPT.Nconst) & (g = OPT.Char) THEN CharToString(ynode); y := ynode^.typ; g := OPT.String END ; + IF x = y THEN (* ok *) + ELSIF x^.BaseTyp = OPT.chartyp THEN (* Assign to (static) ARRAY OF CHAR *) + IF g = OPT.String THEN (*check length of string*) + IF ynode^.conval^.intval2 > x^.n THEN err(114) END + ELSIF (y.comp IN {OPT.DynArr, OPT.Array}) & (y.BaseTyp = OPT.chartyp) THEN + (* Assignment from ARRAY OF CHAR is good.*) + ELSE err(113) + END + ELSE err(113) + END + ELSIF (x.comp = OPT.DynArr) & (x^.BaseTyp = OPT.chartyp) THEN (* Assign to dynamic ARRAY OF CHAR*) + IF (y.comp IN {OPT.DynArr, OPT.Array}) & (y.BaseTyp = OPT.chartyp) THEN + (* Assignment from ARRAY OF CHAR is good.*) + ELSE err(113) + END + ELSIF x^.comp = OPT.Record THEN + IF x = y THEN (* ok *) + ELSIF y^.comp = OPT.Record THEN + q := y^.BaseTyp; + WHILE (q # NIL) & (q # x) & (q # OPT.undftyp) DO q := q^.BaseTyp END ; + IF q = NIL THEN err(113) END + ELSE err(113) + END + ELSE err(113) + END + ELSE OPM.LogWStr("unhandled case in OPB.CheckAssign, f = "); OPM.LogWNum(f, 0); OPM.LogWLn; END ; - IF (ynode^.class = Nconst) & (g < f) & (g IN {SInt..Real}) & (f IN {Int..LReal}) THEN + IF (ynode^.class = OPT.Nconst) & (g < f) & (g IN {OPT.SInt..OPT.Real}) & (f IN {OPT.Int..OPT.LReal}) THEN Convert(ynode, x) END END CheckAssign; PROCEDURE CheckLeaf(x: OPT.Node; dynArrToo: BOOLEAN); BEGIN -(* -avoid unnecessary intermediate variables in voc - - IF (x^.class = Nmop) & (x^.subcl = val) THEN x := x^.left END ; - IF x^.class = Nguard THEN x := x^.left END ; (* skip last (and unique) guard *) - IF (x^.class = Nvar) & (dynArrToo OR (x^.typ^.comp # DynArr)) THEN x^.obj^.leaf := FALSE END +(* avoid unnecessary intermediate variables in voc + IF (x^.class = OPT.Nmop) & (x^.subcl = val) THEN x := x^.left END ; + IF x^.class = OPT.Nguard THEN x := x^.left END ; (* skip last (and unique) guard *) + IF (x^.class = OPT.Nvar) & (dynArrToo OR (x^.typ^.comp # OPT.DynArr)) THEN x^.obj^.leaf := FALSE END *) END CheckLeaf; @@ -1081,177 +955,168 @@ avoid unnecessary intermediate variables in voc VAR f: INTEGER; typ: OPT.Struct; x: OPT.Node; BEGIN x := par0; f := x^.typ^.form; CASE fctno OF - haltfn: (*HALT*) - IF (f IN intSet) & (x^.class = Nconst) THEN - IF (OPM.MinHaltNr <= x^.conval^.intval) & (x^.conval^.intval <= OPM.MaxHaltNr) THEN - BindNodes(Ntrap, OPT.notyp, x, x) - ELSE err(218) - END - ELSE err(69) - END ; - x^.typ := OPT.notyp - | newfn: (*NEW*) - typ := OPT.notyp; - IF NotVar(x) THEN err(112) - ELSIF f = Pointer THEN - IF OPM.NEWusingAdr THEN CheckLeaf(x, TRUE) END ; - IF x^.readonly THEN err(76) END ; - f := x^.typ^.BaseTyp^.comp; - IF f IN {Record, DynArr, Array} THEN - IF f = DynArr THEN typ := x^.typ^.BaseTyp END ; - BindNodes(Nassign, OPT.notyp, x, NIL); x^.subcl := newfn - ELSE err(111) - END - ELSE err(111) - END ; - x^.typ := typ - | absfn: (*ABS*) - MOp(abs, x) - | capfn: (*CAP*) - MOp(cap, x) - | ordfn: (*ORD*) - IF (x^.class = Ntype) OR (x^.class = Nproc) THEN err(126) - ELSIF f = Char THEN Convert(x, OPT.inttyp) - ELSE err(111) - END ; - x^.typ := OPT.inttyp - | entierfn: (*ENTIER*) - IF (x^.class = Ntype) OR (x^.class = Nproc) THEN err(126) - ELSIF f IN realSet THEN Convert(x, OPT.linttyp) - ELSE err(111) - END ; - x^.typ := OPT.linttyp - | oddfn: (*ODD*) - MOp(odd, x) - | minfn: (*MIN*) - IF x^.class = Ntype THEN - CASE f OF - Bool: x := NewBoolConst(FALSE) - | Char: x := NewIntConst(0); x^.typ := OPT.chartyp - | SInt: x := NewIntConst(OPM.MinSInt) - | Int: x := NewIntConst(OPM.MinInt) - | LInt: x := NewIntConst(OPM.MinLInt) - (* | Int8: x := NewIntConst(OPM.MinInt8) - | Int16: x := NewIntConst(OPM.MinInt16) - | Int32: x := NewIntConst(OPM.MinInt32) - | Int64: err(111)(*x := NewIntConst(OPM.MinInt64)*) (* int64 constants not implemented yet *)*) - | Set: x := NewIntConst(0); x^.typ := OPT.inttyp - | Real: x := NewRealConst(OPM.MinReal, OPT.realtyp) - | LReal: x := NewRealConst(OPM.MinLReal, OPT.lrltyp) - ELSE err(111) - END - ELSE err(110) - END - | maxfn: (*MAX*) - IF x^.class = Ntype THEN - CASE f OF - Bool: x := NewBoolConst(TRUE) - | Char: x := NewIntConst(0FFH); x^.typ := OPT.chartyp - | SInt: x := NewIntConst(OPM.MaxSInt) - | Int: x := NewIntConst(OPM.MaxInt) - | LInt: x := NewIntConst(OPM.MaxLInt) - (* | Int8: x := NewIntConst(OPM.MaxInt8) - | Int16: x := NewIntConst(OPM.MaxInt16) - | Int32: x := NewIntConst(OPM.MaxInt32) - | Int64: err(111); (*x := NewIntConst(OPM.MaxInt64)*) (* int64 contstants not implemented yet *)*) - | Set: x := NewIntConst(OPM.MaxSet); x^.typ := OPT.inttyp - | Real: x := NewRealConst(OPM.MaxReal, OPT.realtyp) - | LReal: x := NewRealConst(OPM.MaxLReal, OPT.lrltyp) - ELSE err(111) - END - ELSE err(110) - END - | chrfn: (*CHR*) - IF (x^.class = Ntype) OR (x^.class = Nproc) THEN err(126) - ELSIF f IN {Undef, SInt..LInt(*, Int8..Int64*)} THEN Convert(x, OPT.chartyp) - ELSE err(111); x^.typ := OPT.chartyp - END - | shortfn: (*SHORT*) - IF (x^.class = Ntype) OR (x^.class = Nproc) THEN err(126) - ELSIF f = Int THEN Convert(x, OPT.sinttyp) - ELSIF f = LInt THEN Convert(x, OPT.inttyp) - (*ELSIF f = Int64 THEN Convert(x, OPT.int32typ) - ELSIF f = Int32 THEN Convert(x, OPT.int16typ) - ELSIF f = Int16 THEN Convert(x, OPT.int8typ)*) - ELSIF f = LReal THEN Convert(x, OPT.realtyp) - ELSE err(111) - END - | longfn: (*LONG*) - IF (x^.class = Ntype) OR (x^.class = Nproc) THEN err(126) - ELSIF f = SInt THEN Convert(x, OPT.inttyp) - ELSIF f = Int THEN Convert(x, OPT.linttyp) - (*ELSIF f = Int8 THEN Convert(x, OPT.int16typ) - ELSIF f = Int16 THEN Convert(x, OPT.int32typ) - ELSIF f = Int32 THEN Convert(x, OPT.int64typ)*) - ELSIF f = Real THEN Convert(x, OPT.lrltyp) - ELSIF f = Char THEN Convert(x, OPT.linttyp) - ELSE err(111) - END - | incfn, decfn: (*INC, DEC*) - IF NotVar(x) THEN err(112) - ELSIF ~(f IN intSet) THEN err(111) - ELSIF x^.readonly THEN err(76) - END - | inclfn, exclfn: (*INCL, EXCL*) - IF NotVar(x) THEN err(112) - ELSIF x^.typ # OPT.settyp THEN err(111); x^.typ := OPT.settyp - ELSIF x^.readonly THEN err(76) - END - | lenfn: (*LEN*) - IF ~(x^.typ^.comp IN {DynArr, Array}) THEN err(131) END - | copyfn: (*COPY*) - IF (x^.class = Nconst) & (f = Char) THEN CharToString(x); f := String END ; - IF (x^.class = Ntype) OR (x^.class = Nproc) THEN err(126) - ELSIF (~(x^.typ^.comp IN {DynArr, Array}) OR (x^.typ^.BaseTyp^.form # Char)) - & (f # String) THEN err(111) - END - | ashfn: (*ASH*) - IF (x^.class = Ntype) OR (x^.class = Nproc) THEN err(126) - ELSIF f IN intSet THEN - IF f # LInt THEN Convert(x, OPT.linttyp) END - ELSE err(111); x^.typ := OPT.linttyp - END - | adrfn: (*SYSTEM.ADR*) - CheckLeaf(x, FALSE); MOp(adr, x) - | sizefn: (*SIZE*) - IF x^.class # Ntype THEN err(110); x := NewIntConst(1) - ELSIF (f IN {Byte..Set(*, Int8..Int64*), Pointer, ProcTyp}) OR (x^.typ^.comp IN {Array, Record}) THEN - typSize(x^.typ); x^.typ^.pvused := TRUE; x := NewIntConst(x^.typ^.size) - ELSE err(111); x := NewIntConst(1) - END - | ccfn: (*SYSTEM.CC*) - MOp(cc, x) - | lshfn, rotfn: (*SYSTEM.LSH, SYSTEM.ROT*) - IF (x^.class = Ntype) OR (x^.class = Nproc) THEN err(126) - ELSIF ~(f IN intSet + {Byte, Char, Set(*, Int8, Int16, Int32, Int64*)}) THEN err(111) - END - | getfn, putfn, bitfn, movefn: (*SYSTEM.GET, SYSTEM.PUT, SYSTEM.BIT, SYSTEM.MOVE*) - IF (x^.class = Ntype) OR (x^.class = Nproc) THEN err(126) - ELSIF (x^.class = Nconst) & (f IN {SInt, Int}) THEN Convert(x, OPT.linttyp) - ELSIF ~(f IN {LInt, Pointer}) THEN err(111); x^.typ := OPT.linttyp - END - | getrfn, putrfn: (*SYSTEM.GETREG, SYSTEM.PUTREG*) - IF (f IN intSet) & (x^.class = Nconst) THEN - IF (x^.conval^.intval < OPM.MinRegNr) OR (x^.conval^.intval > OPM.MaxRegNr) THEN err(220) END - ELSE err(69) - END - | valfn: (*SYSTEM.VAL*) - IF x^.class # Ntype THEN err(110) - ELSIF (f IN {Undef, String, NoTyp}) OR (x^.typ^.comp = DynArr) THEN err(111) - END - | sysnewfn: (*SYSTEM.NEW*) - IF NotVar(x) THEN err(112) - ELSIF f = Pointer THEN - IF OPM.NEWusingAdr THEN CheckLeaf(x, TRUE) END - ELSE err(111) - END - | assertfn: (*ASSERT*) - IF (x^.class = Ntype) OR (x^.class = Nproc) THEN err(126); x := NewBoolConst(FALSE) - ELSIF f # Bool THEN err(120); x := NewBoolConst(FALSE) - ELSE MOp(not, x) - END - ELSE - OPM.LogWStr("unhandled case in OPB.StPar0, fctno = "); OPM.LogWNum(fctno, 0); OPM.LogWLn; + |OPT.haltfn: (*HALT*) + IF (f IN OPT.intSet) & (x^.class = OPT.Nconst) THEN + IF (OPM.MinHaltNr <= x^.conval^.intval) & (x^.conval^.intval <= OPM.MaxHaltNr) THEN + BindNodes(OPT.Ntrap, OPT.notyp, x, x) + ELSE err(218) + END + ELSE err(69) + END ; + x^.typ := OPT.notyp + |OPT.newfn: (*NEW*) + typ := OPT.notyp; + IF NotVar(x) THEN err(112) + ELSIF f = OPT.Pointer THEN + IF OPM.NEWusingAdr THEN CheckLeaf(x, TRUE) END ; + IF x^.readonly THEN err(76) END ; + f := x^.typ^.BaseTyp^.comp; + IF f IN {OPT.Record, OPT.DynArr, OPT.Array} THEN + IF f = OPT.DynArr THEN typ := x^.typ^.BaseTyp END ; + BindNodes(OPT.Nassign, OPT.notyp, x, NIL); x^.subcl := OPT.newfn + ELSE err(111) + END + ELSE err(111) + END ; + x^.typ := typ + |OPT.absfn: (*ABS*) + MOp(OPT.abs, x) + |OPT.capfn: (*CAP*) + MOp(OPT.cap, x) + |OPT.ordfn: (*ORD*) + IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) + ELSIF f = OPT.Char THEN Convert(x, OPT.inttyp) + ELSE err(111) + END ; + x^.typ := OPT.inttyp + |OPT.entierfn: (*ENTIER*) + IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) + ELSIF f IN OPT.realSet THEN Convert(x, OPT.linttyp) + ELSE err(111) + END ; + x^.typ := OPT.linttyp + |OPT.oddfn: (*ODD*) + MOp(OPT.odd, x) + |OPT.minfn: (*MIN*) + IF x^.class = OPT.Ntype THEN + CASE f OF + OPT.Bool: x := NewBoolConst(FALSE) + | OPT.Char: x := NewIntConst(0); x^.typ := OPT.chartyp + | OPT.SInt, + OPT.Int, + OPT.LInt: x := NewIntConst(OPM.SignedMinimum(x.typ.size)) + | OPT.Set: x := NewIntConst(0); x^.typ := OPT.inttyp + | OPT.Real: x := NewRealConst(OPM.MinReal, OPT.realtyp) + | OPT.LReal: x := NewRealConst(OPM.MinLReal, OPT.lrltyp) + ELSE err(111) + END + ELSE err(110) + END + |OPT.maxfn: (*MAX*) + IF x^.class = OPT.Ntype THEN + CASE f OF + OPT.Bool: x := NewBoolConst(TRUE) + | OPT.Char: x := NewIntConst(0FFH); x^.typ := OPT.chartyp + | OPT.SInt, + OPT.Int, + OPT.LInt: x := NewIntConst(OPM.SignedMaximum(x.typ.size)) + | OPT.Set: x := NewIntConst(OPM.MaxSet); x^.typ := OPT.inttyp + | OPT.Real: x := NewRealConst(OPM.MaxReal, OPT.realtyp) + | OPT.LReal: x := NewRealConst(OPM.MaxLReal, OPT.lrltyp) + ELSE err(111) + END + ELSE err(110) + END + |OPT.chrfn: (*CHR*) + IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) + ELSIF f IN {OPT.Undef} + OPT.intSet THEN Convert(x, OPT.chartyp) + ELSE err(111); x^.typ := OPT.chartyp + END + |OPT.shortfn: (*SHORT*) + IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) + ELSIF (f IN OPT.intSet) & (x.typ.size > OPM.SIntSize) THEN Convert(x, IntType(ShorterSize(x.typ.size))) + ELSIF f = OPT.LReal THEN Convert(x, OPT.realtyp) + ELSE err(111) + END + |OPT.longfn: (*LONG*) + IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) + ELSIF (f IN OPT.intSet) & (x.typ.size < OPM.LIntSize) THEN Convert(x, IntType(LongerSize(x.typ.size))) + ELSIF f = OPT.Real THEN Convert(x, OPT.lrltyp) + ELSIF f = OPT.Char THEN Convert(x, OPT.linttyp) + ELSE err(111) + END + |OPT.incfn, + OPT.decfn: (*INC, DEC*) + IF NotVar(x) THEN err(112) + ELSIF ~(f IN OPT.intSet) THEN err(111) + ELSIF x^.readonly THEN err(76) + END + |OPT.inclfn, + OPT.exclfn: (*INCL, EXCL*) + IF NotVar(x) THEN err(112) + ELSIF x^.typ # OPT.settyp THEN err(111); x^.typ := OPT.settyp + ELSIF x^.readonly THEN err(76) + END + |OPT.lenfn: (*LEN*) + IF ~(x^.typ^.comp IN {OPT.DynArr, OPT.Array}) THEN err(131) END + |OPT.copyfn: (*COPY*) + IF (x^.class = OPT.Nconst) & (f = OPT.Char) THEN CharToString(x); f := OPT.String END ; + IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) + ELSIF (~(x^.typ^.comp IN {OPT.DynArr, OPT.Array}) OR (x^.typ^.BaseTyp^.form # OPT.Char)) + & (f # OPT.String) THEN err(111) + END + |OPT.ashfn: (*ASH*) + IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) + ELSIF f IN OPT.intSet THEN + IF x.typ.size # OPM.LIntSize THEN Convert(x, OPT.linttyp) END + ELSE err(111); x^.typ := OPT.linttyp + END + |OPT.adrfn: (*SYSTEM.ADR*) + CheckLeaf(x, FALSE); MOp(OPT.adr, x) + |OPT.sizefn: (*SIZE*) + IF x^.class # OPT.Ntype THEN err(110); x := NewIntConst(1) + ELSIF (f IN {OPT.Byte..OPT.Set, OPT.Pointer, OPT.ProcTyp}) + OR (x^.typ^.comp IN {OPT.Array, OPT.Record}) THEN + typSize(x^.typ); x^.typ^.pvused := TRUE; x := NewIntConst(x^.typ^.size) + ELSE err(111); x := NewIntConst(1) + END + |OPT.ccfn: (*SYSTEM.CC*) + MOp(OPT.cc, x) + |OPT.lshfn, + OPT.rotfn: (*SYSTEM.LSH, SYSTEM.ROT*) + IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) + ELSIF ~(f IN OPT.intSet + {OPT.Byte, OPT.Char, OPT.Set}) THEN err(111) + END + |OPT.getfn, + OPT.putfn, + OPT.bitfn, + OPT.movefn: (*SYSTEM.GET, SYSTEM.PUT, SYSTEM.BIT, SYSTEM.MOVE*) + IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) + ELSIF (x^.class = OPT.Nconst) & (f IN OPT.intSet) & (x.typ.size < OPT.linttyp.size) THEN Convert(x, OPT.linttyp) + ELSIF ~((x.typ.form IN {OPT.Pointer} + OPT.intSet) & (x.typ.size = OPM.PointerSize)) THEN err(111); x^.typ := OPT.linttyp + END + |OPT.getrfn, + OPT.putrfn: (*SYSTEM.GETREG, SYSTEM.PUTREG*) + IF (f IN OPT.intSet) & (x^.class = OPT.Nconst) THEN + IF (x^.conval^.intval < OPM.MinRegNr) OR (x^.conval^.intval > OPM.MaxRegNr) THEN err(220) END + ELSE err(69) + END + |OPT.valfn: (*SYSTEM.VAL*) + IF x^.class # OPT.Ntype THEN err(110) + ELSIF (f IN {OPT.Undef, OPT.String, OPT.NoTyp}) OR (x^.typ^.comp = OPT.DynArr) THEN err(111) + END + |OPT.sysnewfn: (*SYSTEM.NEW*) + IF NotVar(x) THEN err(112) + ELSIF f = OPT.Pointer THEN + IF OPM.NEWusingAdr THEN CheckLeaf(x, TRUE) END + ELSE err(111) + END + |OPT.assertfn: (*ASSERT*) + IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126); x := NewBoolConst(FALSE) + ELSIF f # OPT.Bool THEN err(120); x := NewBoolConst(FALSE) + ELSE MOp(OPS.not, x) + END + ELSE OPM.LogWStr("unhandled case in OPB.StPar0, fctno = "); OPM.LogWNum(fctno, 0); OPM.LogWLn; END ; par0 := x END StPar0; @@ -1268,141 +1133,152 @@ avoid unnecessary intermediate variables in voc BEGIN p := par0; f := x^.typ^.form; CASE fctno OF - incfn, decfn: (*INC DEC*) - IF (x^.class = Ntype) OR (x^.class = Nproc) THEN err(126); p^.typ := OPT.notyp - ELSE - IF x^.typ # p^.typ THEN - IF (x^.class = Nconst) & (f IN intSet) THEN Convert(x, p^.typ) - ELSE err(111) - END - END ; - p := NewOp(Nassign, fctno, p, x); - p^.typ := OPT.notyp - END - | inclfn, exclfn: (*INCL, EXCL*) - IF (x^.class = Ntype) OR (x^.class = Nproc) THEN err(126) - ELSIF f IN intSet THEN - IF (x^.class = Nconst) & ((0 > x^.conval^.intval) OR (x^.conval^.intval > OPM.MaxSet)) THEN err(202) - END ; - p := NewOp(Nassign, fctno, p, x) - ELSE err(111) - END ; - p^.typ := OPT.notyp - | lenfn: (*LEN*) - IF ~(f IN intSet) OR (x^.class # Nconst) THEN err(69) - ELSIF f = SInt THEN - L := SHORT(x^.conval^.intval); typ := p^.typ; - WHILE (L > 0) & (typ^.comp IN {DynArr, Array}) DO typ := typ^.BaseTyp; DEC(L) END ; - IF (L # 0) OR ~(typ^.comp IN {DynArr, Array}) THEN err(132) - ELSE x^.obj := NIL; - IF typ^.comp = DynArr THEN - WHILE p^.class = Nindex DO p := p^.left; INC(x^.conval^.intval) END ; (* possible side effect ignored *) - p := NewOp(Ndop, len, p, x); p^.typ := OPT.linttyp - ELSE p := x; p^.conval^.intval := typ^.n; SetIntType(p) - END - END - ELSE err(132) - END - | copyfn: (*COPY*) - IF NotVar(x) THEN err(112) - ELSIF (x^.typ^.comp IN {Array, DynArr}) & (x^.typ^.BaseTyp^.form = Char) THEN - IF x^.readonly THEN err(76) END ; - t := x; x := p; p := t; p := NewOp(Nassign, copyfn, p, x) - ELSE err(111) - END ; - p^.typ := OPT.notyp - | ashfn: (*ASH*) - IF (x^.class = Ntype) OR (x^.class = Nproc) THEN err(126) - ELSIF f IN intSet THEN - IF (p^.class = Nconst) & (x^.class = Nconst) THEN - IF (-maxExp > x^.conval^.intval) OR (x^.conval^.intval > maxExp) THEN err(208); p^.conval^.intval := 1 - ELSIF x^.conval^.intval >= 0 THEN - IF ABS(p^.conval^.intval) <= MAX(LONGINT) DIV ASH(1, x^.conval^.intval) THEN - p^.conval^.intval := p^.conval^.intval * ASH(1, x^.conval^.intval) - ELSE err(208); p^.conval^.intval := 1 - END - ELSE p^.conval^.intval := ASH(p^.conval^.intval, x^.conval^.intval) - END ; - p^.obj := NIL - ELSE p := NewOp(Ndop, ash, p, x); p^.typ := OPT.linttyp - END - ELSE err(111) - END - | newfn: (*NEW(p, x...)*) - IF (x^.class = Ntype) OR (x^.class = Nproc) THEN err(126) - ELSIF p^.typ^.comp = DynArr THEN - IF f IN intSet THEN - IF (x^.class = Nconst) & ((x^.conval^.intval <= 0) OR (x^.conval^.intval > OPM.MaxIndex)) THEN err(63) END - ELSE err(111) - END ; - p^.right := x; p^.typ := p^.typ^.BaseTyp - ELSE err(64) - END - | lshfn, rotfn: (*SYSTEM.LSH, SYSTEM.ROT*) - IF (x^.class = Ntype) OR (x^.class = Nproc) THEN err(126) - ELSIF ~(f IN intSet) THEN err(111) - ELSE - IF fctno = lshfn THEN p := NewOp(Ndop, lsh, p, x) ELSE p := NewOp(Ndop, rot, p, x) END ; - p^.typ := p^.left^.typ - END - | getfn, putfn, getrfn, putrfn: (*SYSTEM.GET, SYSTEM.PUT, SYSTEM.GETREG, SYSTEM.PUTREG*) - IF (x^.class = Ntype) OR (x^.class = Nproc) THEN err(126) - ELSIF f IN {Undef..Set, Pointer, ProcTyp} THEN - IF (fctno = getfn) OR (fctno = getrfn) THEN - IF NotVar(x) THEN err(112) END ; - t := x; x := p; p := t - END ; - p := NewOp(Nassign, fctno, p, x) - ELSE err(111) - END ; - p^.typ := OPT.notyp - | bitfn: (*SYSTEM.BIT*) - IF (x^.class = Ntype) OR (x^.class = Nproc) THEN err(126) - ELSIF f IN intSet THEN - p := NewOp(Ndop, bit, p, x) - ELSE err(111) - END ; - p^.typ := OPT.booltyp - | valfn: (*SYSTEM.VAL*) (* type is changed without considering the byte ordering on the target machine *) - IF (x^.class = Ntype) OR (x^.class = Nproc) OR - (f IN {Undef, String, NoTyp}) OR (x^.typ^.comp = DynArr) THEN err(126) - END ; - t := OPT.NewNode(Nmop); t^.subcl := val; t^.left := x; x := t; -(* - IF (x^.class >= Nconst) OR ((f IN realSet) # (p^.typ^.form IN realSet)) THEN - t := OPT.NewNode(Nmop); t^.subcl := val; t^.left := x; x := t - ELSE x^.readonly := FALSE - END ; -*) - x^.typ := p^.typ; p := x - | sysnewfn: (*SYSTEM.NEW*) - IF (x^.class = Ntype) OR (x^.class = Nproc) THEN err(126) - ELSIF f IN intSet THEN - p := NewOp(Nassign, sysnewfn, p, x) - ELSE err(111) - END ; - p^.typ := OPT.notyp - | movefn: (*SYSTEM.MOVE*) - IF (x^.class = Ntype) OR (x^.class = Nproc) THEN err(126) - ELSIF (x^.class = Nconst) & (f IN {SInt, Int}) THEN Convert(x, OPT.linttyp) - ELSIF ~(f IN {LInt, Pointer}) THEN err(111); x^.typ := OPT.linttyp - END ; - p^.link := x - | assertfn: (*ASSERT*) - IF (f IN intSet) & (x^.class = Nconst) THEN - IF (OPM.MinHaltNr <= x^.conval^.intval) & (x^.conval^.intval <= OPM.MaxHaltNr) THEN - BindNodes(Ntrap, OPT.notyp, x, x); - x^.conval := OPT.NewConst(); x^.conval^.intval := OPM.errpos; - Construct(Nif, p, x); p^.conval := OPT.NewConst(); p^.conval^.intval := OPM.errpos; - Construct(Nifelse, p, NIL); OptIf(p); - IF p = NIL THEN (* ASSERT(TRUE) *) - ELSIF p^.class = Ntrap THEN err(99) - ELSE p^.subcl := assertfn - END - ELSE err(218) - END - ELSE err(69) - END + |OPT.incfn, + OPT.decfn: (*INC DEC*) + IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126); p^.typ := OPT.notyp + ELSE + IF x^.typ # p^.typ THEN + IF (x^.class = OPT.Nconst) & (f IN OPT.intSet) THEN Convert(x, p^.typ) + ELSE err(111) + END + END ; + p := NewOp(OPT.Nassign, fctno, p, x); + p^.typ := OPT.notyp + END + |OPT.inclfn, + OPT.exclfn: (*INCL, EXCL*) + IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) + ELSIF f IN OPT.intSet THEN + IF (x^.class = OPT.Nconst) & ((0 > x^.conval^.intval) OR (x^.conval^.intval > OPM.MaxSet)) THEN err(202) + END ; + p := NewOp(OPT.Nassign, fctno, p, x) + ELSE err(111) + END ; + p^.typ := OPT.notyp + |OPT.lenfn: (*LEN*) + IF ~(f IN OPT.intSet) OR (x^.class # OPT.Nconst) THEN err(69) + ELSIF x.typ.size = 1 THEN (* Hard limit of 127 dimensions *) + L := SHORT(x^.conval^.intval); typ := p^.typ; + WHILE (L > 0) & (typ^.comp IN {OPT.DynArr, OPT.Array}) DO typ := typ^.BaseTyp; DEC(L) END ; + IF (L # 0) OR ~(typ^.comp IN {OPT.DynArr, OPT.Array}) THEN err(132) + ELSE x^.obj := NIL; + IF typ^.comp = OPT.DynArr THEN + WHILE p^.class = OPT.Nindex DO p := p^.left; INC(x^.conval^.intval) END ; (* possible side effect ignored *) + p := NewOp(OPT.Ndop, OPT.len, p, x); p^.typ := OPT.linttyp + ELSE p := x; p^.conval^.intval := typ^.n; SetIntType(p) + END + END + ELSE err(132) + END + |OPT.copyfn: (*COPY*) + IF NotVar(x) THEN err(112) + ELSIF (x^.typ^.comp IN {OPT.Array, OPT.DynArr}) & (x^.typ^.BaseTyp^.form = OPT.Char) THEN + IF x^.readonly THEN err(76) END ; + t := x; x := p; p := t; p := NewOp(OPT.Nassign, OPT.copyfn, p, x) + ELSE err(111) + END ; + p^.typ := OPT.notyp + |OPT.ashfn: (*ASH*) + IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) + ELSIF f IN OPT.intSet THEN + IF (p^.class = OPT.Nconst) & (x^.class = OPT.Nconst) THEN + IF (-maxExp > x^.conval^.intval) OR (x^.conval^.intval > maxExp) THEN err(208); p^.conval^.intval := 1 + ELSIF x^.conval^.intval >= 0 THEN + IF ABS(p^.conval^.intval) <= MAX(LONGINT) DIV ASH(1, x^.conval^.intval) THEN + p^.conval^.intval := p^.conval^.intval * ASH(1, x^.conval^.intval) + ELSE err(208); p^.conval^.intval := 1 + END + ELSE p^.conval^.intval := ASH(p^.conval^.intval, x^.conval^.intval) + END ; + p^.obj := NIL + ELSE p := NewOp(OPT.Ndop, OPT.ash, p, x); p^.typ := OPT.linttyp + END + ELSE err(111) + END + |OPT.newfn: (*NEW(p, x...)*) + IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) + ELSIF p^.typ^.comp = OPT.DynArr THEN + IF f IN OPT.intSet THEN + IF (x^.class = OPT.Nconst) & ((x^.conval^.intval <= 0) OR (x^.conval^.intval > OPM.MaxIndex)) THEN err(63) END + ELSE err(111) + END ; + p^.right := x; p^.typ := p^.typ^.BaseTyp + ELSE err(64) + END + |OPT.lshfn, + OPT.rotfn: (*SYSTEM.LSH, SYSTEM.ROT*) + IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) + ELSIF ~(f IN OPT.intSet) THEN err(111) + ELSE + IF fctno = OPT.lshfn THEN p := NewOp(OPT.Ndop, OPT.lsh, p, x) ELSE p := NewOp(OPT.Ndop, OPT.rot, p, x) END ; + p^.typ := p^.left^.typ + END + |OPT.getfn, + OPT.putfn, + OPT.getrfn, + OPT.putrfn: (*SYSTEM.GET, SYSTEM.PUT, SYSTEM.GETREG, SYSTEM.PUTREG*) + IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) + ELSIF f IN {OPT.Undef..OPT.Set, OPT.Pointer, OPT.ProcTyp} THEN + IF (fctno = OPT.getfn) OR (fctno = OPT.getrfn) THEN + IF NotVar(x) THEN err(112) END ; + t := x; x := p; p := t + END ; + p := NewOp(OPT.Nassign, fctno, p, x) + ELSE err(111) + END ; + p^.typ := OPT.notyp + |OPT.bitfn: (*SYSTEM.BIT*) + IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) + ELSIF f IN OPT.intSet THEN + p := NewOp(OPT.Ndop, OPT.bit, p, x) + ELSE err(111) + END ; + p^.typ := OPT.booltyp + |OPT.valfn: (*SYSTEM.VAL*) (* type is changed without considering the byte ordering on the target machine *) + IF (x^.class = OPT.Ntype) + OR (x^.class = OPT.Nproc) + OR (f IN {OPT.Undef, OPT.String, OPT.NoTyp}) + OR (x^.typ^.comp = OPT.DynArr) THEN + err(126) + END; + (* Warn if the result type includes memory past the end of the source variable *) + IF x.typ.size < p.typ.size THEN err(-308) END; + t := OPT.NewNode(OPT.Nmop); t^.subcl := OPT.val; t^.left := x; x := t; + (* + IF (x^.class >= OPT.Nconst) OR ((f IN OPT.realSet) # (p^.typ^.form IN OPT.realSet)) THEN + t := OPT.NewNode(OPT.Nmop); t^.subcl := val; t^.left := x; x := t + ELSE x^.readonly := FALSE + END ; + *) + x^.typ := p^.typ; p := x + |OPT.sysnewfn: (*SYSTEM.NEW*) + IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) + ELSIF f IN OPT.intSet THEN + p := NewOp(OPT.Nassign, OPT.sysnewfn, p, x) + ELSE err(111) + END ; + p^.typ := OPT.notyp + |OPT.movefn: (*SYSTEM.MOVE*) + IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) + ELSIF (x^.class = OPT.Nconst) & (f IN OPT.intSet) & (x.typ.size < OPT.linttyp.size) THEN Convert(x, OPT.linttyp) + ELSIF ~((x.typ.form IN {OPT.Pointer} + OPT.intSet) & (x.typ.size = OPM.PointerSize)) THEN err(111); x^.typ := OPT.linttyp + END; + p^.link := x + |OPT.assertfn: (*ASSERT*) + IF (f IN OPT.intSet) & (x^.class = OPT.Nconst) THEN + IF (OPM.MinHaltNr <= x^.conval^.intval) & (x^.conval^.intval <= OPM.MaxHaltNr) THEN + BindNodes(OPT.Ntrap, OPT.notyp, x, x); + x^.conval := OPT.NewConst(); x^.conval^.intval := OPM.errpos; + Construct(OPT.Nif, p, x); p^.conval := OPT.NewConst(); p^.conval^.intval := OPM.errpos; + Construct(OPT.Nifelse, p, NIL); OptIf(p); + IF p = NIL THEN (* ASSERT(TRUE) *) + ELSIF p^.class = OPT.Ntrap THEN err(99) + ELSE p^.subcl := OPT.assertfn + END + ELSE err(218) + END + ELSE err(69) + END ELSE err(64) END ; par0 := p @@ -1411,19 +1287,19 @@ avoid unnecessary intermediate variables in voc PROCEDURE StParN*(VAR par0: OPT.Node; x: OPT.Node; fctno, n: INTEGER); (* x: n+1-th param of standard proc *) VAR node: OPT.Node; f: INTEGER; p: OPT.Node; BEGIN p := par0; f := x^.typ^.form; - IF fctno = newfn THEN (*NEW(p, ..., x...*) - IF (x^.class = Ntype) OR (x^.class = Nproc) THEN err(126) - ELSIF p^.typ^.comp # DynArr THEN err(64) - ELSIF f IN intSet THEN - IF (x^.class = Nconst) & ((x^.conval^.intval <= 0) OR (x^.conval^.intval > OPM.MaxIndex)) THEN err(63) END ; + IF fctno = OPT.newfn THEN (*NEW(p, ..., x...*) + IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) + ELSIF p^.typ^.comp # OPT.DynArr THEN err(64) + ELSIF f IN OPT.intSet THEN + IF (x^.class = OPT.Nconst) & ((x^.conval^.intval <= 0) OR (x^.conval^.intval > OPM.MaxIndex)) THEN err(63) END ; node := p^.right; WHILE node^.link # NIL DO node := node^.link END; node^.link := x; p^.typ := p^.typ^.BaseTyp ELSE err(111) END - ELSIF (fctno = movefn) & (n = 2) THEN (*SYSTEM.MOVE*) - IF (x^.class = Ntype) OR (x^.class = Nproc) THEN err(126) - ELSIF f IN intSet THEN - node := OPT.NewNode(Nassign); node^.subcl := movefn; node^.right := p; + ELSIF (fctno = OPT.movefn) & (n = 2) THEN (*SYSTEM.MOVE*) + IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) + ELSIF f IN OPT.intSet THEN + node := OPT.NewNode(OPT.Nassign); node^.subcl := OPT.movefn; node^.right := p; node^.left := p^.link; p^.link := x; p := node ELSE err(111) END ; @@ -1436,41 +1312,41 @@ avoid unnecessary intermediate variables in voc PROCEDURE StFct*(VAR par0: OPT.Node; fctno: SHORTINT; parno: INTEGER); VAR dim: INTEGER; x, p: OPT.Node; BEGIN p := par0; - IF fctno <= ashfn THEN - IF (fctno = newfn) & (p^.typ # OPT.notyp) THEN - IF p^.typ^.comp = DynArr THEN err(65) END ; + IF fctno <= OPT.ashfn THEN + IF (fctno = OPT.newfn) & (p^.typ # OPT.notyp) THEN + IF p^.typ^.comp = OPT.DynArr THEN err(65) END ; p^.typ := OPT.notyp - ELSIF fctno <= sizefn THEN (* 1 param *) + ELSIF fctno <= OPT.sizefn THEN (* 1 param *) IF parno < 1 THEN err(65) END ELSE (* more than 1 param *) - IF ((fctno = incfn) OR (fctno = decfn)) & (parno = 1) THEN (*INC, DEC*) - BindNodes(Nassign, OPT.notyp, p, NewIntConst(1)); p^.subcl := fctno; p^.right^.typ := p^.left^.typ - ELSIF (fctno = lenfn) & (parno = 1) THEN (*LEN*) - IF p^.typ^.comp = DynArr THEN dim := 0; - WHILE p^.class = Nindex DO p := p^.left; INC(dim) END ; (* possible side effect ignored *) - BindNodes(Ndop, OPT.linttyp, p, NewIntConst(dim)); p^.subcl := len + IF ((fctno = OPT.incfn) OR (fctno = OPT.decfn)) & (parno = 1) THEN (*INC, DEC*) + BindNodes(OPT.Nassign, OPT.notyp, p, NewIntConst(1)); p^.subcl := fctno; p^.right^.typ := p^.left^.typ + ELSIF (fctno = OPT.lenfn) & (parno = 1) THEN (*LEN*) + IF p^.typ^.comp = OPT.DynArr THEN dim := 0; + WHILE p^.class = OPT.Nindex DO p := p^.left; INC(dim) END ; (* possible side effect ignored *) + BindNodes(OPT.Ndop, OPT.linttyp, p, NewIntConst(dim)); p^.subcl := OPT.len ELSE p := NewIntConst(p^.typ^.n) END ELSIF parno < 2 THEN err(65) END END - ELSIF fctno = assertfn THEN + ELSIF fctno = OPT.assertfn THEN IF parno = 1 THEN x := NIL; - BindNodes(Ntrap, OPT.notyp, x, NewIntConst(AssertTrap)); + BindNodes(OPT.Ntrap, OPT.notyp, x, NewIntConst(AssertTrap)); x^.conval := OPT.NewConst(); x^.conval^.intval := OPM.errpos; - Construct(Nif, p, x); p^.conval := OPT.NewConst(); p^.conval^.intval := OPM.errpos; - Construct(Nifelse, p, NIL); OptIf(p); + Construct(OPT.Nif, p, x); p^.conval := OPT.NewConst(); p^.conval^.intval := OPM.errpos; + Construct(OPT.Nifelse, p, NIL); OptIf(p); IF p = NIL THEN (* ASSERT(TRUE) *) - ELSIF p^.class = Ntrap THEN err(99) - ELSE p^.subcl := assertfn + ELSIF p^.class = OPT.Ntrap THEN err(99) + ELSE p^.subcl := OPT.assertfn END ELSIF parno < 1 THEN err(65) END ELSE (*SYSTEM*) IF (parno < 1) OR - (fctno > ccfn) & (parno < 2) OR - (fctno = movefn) & (parno < 3) THEN err(65) + (fctno > OPT.ccfn) & (parno < 2) OR + (fctno = OPT.movefn) & (parno < 3) THEN err(65) END END ; par0 := p @@ -1478,18 +1354,18 @@ avoid unnecessary intermediate variables in voc PROCEDURE DynArrParCheck(ftyp, atyp: OPT.Struct; fvarpar: BOOLEAN); VAR f: INTEGER; - BEGIN (* ftyp^.comp = DynArr *) + BEGIN (* ftyp^.comp = OPT.DynArr *) f := atyp^.comp; ftyp := ftyp^.BaseTyp; atyp := atyp^.BaseTyp; IF fvarpar & (ftyp = OPT.bytetyp) THEN (* ok, but ... *) - IF ~(f IN {Array, DynArr}) OR ~(atyp^.form IN {Byte..SInt(*, Int8..Int64*)}) THEN + IF ~(f IN {OPT.Array, OPT.DynArr}) OR ~((atyp.form IN {OPT.Byte..OPT.Char} + OPT.intSet) & (atyp.size = 1)) THEN IF OPM.verbose IN OPM.opt THEN err(-301) END END - ELSIF f IN {Array, DynArr} THEN - IF ftyp^.comp = DynArr THEN DynArrParCheck(ftyp, atyp, fvarpar) + ELSIF f IN {OPT.Array, OPT.DynArr} THEN + IF ftyp^.comp = OPT.DynArr THEN DynArrParCheck(ftyp, atyp, fvarpar) ELSIF ftyp # atyp THEN - IF ~fvarpar & (ftyp.form = Pointer) & (atyp.form = Pointer) THEN + IF ~fvarpar & (ftyp.form = OPT.Pointer) & (atyp.form = OPT.Pointer) THEN ftyp := ftyp^.BaseTyp; atyp := atyp^.BaseTyp; - IF (ftyp^.comp = Record) & (atyp^.comp = Record) THEN + IF (ftyp^.comp = OPT.Record) & (atyp^.comp = OPT.Record) THEN WHILE (ftyp # atyp) & (atyp # NIL) & (atyp # OPT.undftyp) DO atyp := atyp^.BaseTyp END ; IF atyp = NIL THEN err(113) END ELSE err(66) @@ -1503,17 +1379,17 @@ avoid unnecessary intermediate variables in voc PROCEDURE CheckReceiver(VAR x: OPT.Node; fp: OPT.Object); BEGIN - IF fp^.typ^.form = Pointer THEN - IF x^.class = Nderef THEN x := x^.left (*undo DeRef*) ELSE (*x^.typ^.comp = Record*) err(71) END + IF fp^.typ^.form = OPT.Pointer THEN + IF x^.class = OPT.Nderef THEN x := x^.left (*undo DeRef*) ELSE (*x^.typ^.comp = OPT.Record*) err(71) END END END CheckReceiver; PROCEDURE PrepCall*(VAR x: OPT.Node; VAR fpar: OPT.Object); BEGIN - IF (x^.obj # NIL) & (x^.obj^.mode IN {LProc, XProc, TProc, CProc}) THEN + IF (x^.obj # NIL) & (x^.obj^.mode IN {OPT.LProc, OPT.XProc, OPT.TProc, OPT.CProc}) THEN fpar := x^.obj^.link; - IF x^.obj^.mode = TProc THEN CheckReceiver(x^.left, fpar); fpar := fpar^.link END - ELSIF (x^.class # Ntype) & (x^.typ # NIL) & (x^.typ^.form = ProcTyp) THEN + IF x^.obj^.mode = OPT.TProc THEN CheckReceiver(x^.left, fpar); fpar := fpar^.link END + ELSIF (x^.class # OPT.Ntype) & (x^.typ # NIL) & (x^.typ^.form = OPT.ProcTyp) THEN fpar := x^.typ^.link ELSE err(121); fpar := NIL; x^.typ := OPT.undftyp END @@ -1522,25 +1398,25 @@ avoid unnecessary intermediate variables in voc PROCEDURE Param*(ap: OPT.Node; fp: OPT.Object); VAR q: OPT.Struct; BEGIN - IF fp.typ.form # Undef THEN - IF fp^.mode = VarPar THEN + IF fp.typ.form # OPT.Undef THEN + IF fp^.mode = OPT.VarPar THEN IF NotVar(ap) THEN err(122) ELSE CheckLeaf(ap, FALSE) END ; IF ap^.readonly THEN err(76) END ; - IF fp^.typ^.comp = DynArr THEN DynArrParCheck(fp^.typ, ap^.typ, TRUE) - ELSIF (fp^.typ^.comp = Record) & (ap^.typ^.comp = Record) THEN + IF fp^.typ^.comp = OPT.DynArr THEN DynArrParCheck(fp^.typ, ap^.typ, TRUE) + ELSIF (fp^.typ^.comp = OPT.Record) & (ap^.typ^.comp = OPT.Record) THEN q := ap^.typ; WHILE (q # fp^.typ) & (q # NIL) & (q # OPT.undftyp) DO q := q^.BaseTyp END ; IF q = NIL THEN err(111) END - ELSIF (fp^.typ = OPT.sysptrtyp) & (ap^.typ^.form = Pointer) THEN (* ok *) - ELSIF (ap^.typ # fp^.typ) & ~((fp^.typ^.form = Byte) & (ap^.typ^.form IN {Char, SInt})) THEN err(123) - ELSIF (fp^.typ^.form = Pointer) & (ap^.class = Nguard) THEN err(123) + ELSIF (fp^.typ = OPT.sysptrtyp) & (ap^.typ^.form = OPT.Pointer) THEN (* ok *) + ELSIF (ap^.typ # fp^.typ) & ~((fp^.typ^.form = OPT.Byte) & ((ap.typ.form IN {OPT.Byte..OPT.Char} + OPT.intSet) & (ap.typ.size = 1))) THEN err(123) + ELSIF (fp^.typ^.form = OPT.Pointer) & (ap^.class = OPT.Nguard) THEN err(123) END - ELSIF fp^.typ^.comp = DynArr THEN - IF (ap^.class = Nconst) & (ap^.typ^.form = Char) THEN CharToString(ap) END ; - IF (ap^.typ^.form = String) & (fp^.typ^.BaseTyp^.form = Char) THEN (* ok *) - ELSIF ap^.class >= Nconst THEN err(59) + ELSIF fp^.typ^.comp = OPT.DynArr THEN + IF (ap^.class = OPT.Nconst) & (ap^.typ^.form = OPT.Char) THEN CharToString(ap) END ; + IF (ap^.typ^.form = OPT.String) & (fp^.typ^.BaseTyp^.form = OPT.Char) THEN (* ok *) + ELSIF ap^.class >= OPT.Nconst THEN err(59) ELSE DynArrParCheck(fp^.typ, ap^.typ, FALSE) END ELSE CheckAssign(fp^.typ, ap) @@ -1553,7 +1429,7 @@ avoid unnecessary intermediate variables in voc BEGIN scope := OPT.topScope; WHILE dlev > 0 DO DEC(dlev); - INCL(scope^.link^.conval^.setval, slNeeded); + INCL(scope^.link^.conval^.setval, OPT.slNeeded); scope := scope^.left END END StaticLink; @@ -1561,21 +1437,21 @@ avoid unnecessary intermediate variables in voc PROCEDURE Call*(VAR x: OPT.Node; apar: OPT.Node; fp: OPT.Object); VAR typ: OPT.Struct; p: OPT.Node; lev: SHORTINT; BEGIN - IF x^.class = Nproc THEN typ := x^.typ; + IF x^.class = OPT.Nproc THEN typ := x^.typ; lev := x^.obj^.mnolev; IF lev > 0 THEN StaticLink(OPT.topScope^.mnolev-lev) END ; - IF x^.obj^.mode = IProc THEN err(121) END - ELSIF (x^.class = Nfield) & (x^.obj^.mode = TProc) THEN typ := x^.typ; - x^.class := Nproc; p := x^.left; x^.left := NIL; p^.link := apar; apar := p; fp := x^.obj^.link + IF x^.obj^.mode = OPT.IProc THEN err(121) END + ELSIF (x^.class = OPT.Nfield) & (x^.obj^.mode = OPT.TProc) THEN typ := x^.typ; + x^.class := OPT.Nproc; p := x^.left; x^.left := NIL; p^.link := apar; apar := p; fp := x^.obj^.link ELSE typ := x^.typ^.BaseTyp END ; - BindNodes(Ncall, typ, x, apar); x^.obj := fp + BindNodes(OPT.Ncall, typ, x, apar); x^.obj := fp END Call; PROCEDURE Enter*(VAR procdec: OPT.Node; stat: OPT.Node; proc: OPT.Object); VAR x: OPT.Node; BEGIN - x := OPT.NewNode(Nenter); x^.typ := OPT.notyp; x^.obj := proc; + x := OPT.NewNode(OPT.Nenter); x^.typ := OPT.notyp; x^.obj := proc; x^.left := procdec; x^.right := stat; procdec := x END Enter; @@ -1589,42 +1465,42 @@ avoid unnecessary intermediate variables in voc ELSIF proc^.typ # OPT.notyp THEN err(124) END END ; - node := OPT.NewNode(Nreturn); node^.typ := OPT.notyp; node^.obj := proc; node^.left := x; x := node + node := OPT.NewNode(OPT.Nreturn); node^.typ := OPT.notyp; node^.obj := proc; node^.left := x; x := node END Return; PROCEDURE Assign*(VAR x: OPT.Node; y: OPT.Node); VAR z: OPT.Node; subcl: SHORTINT; BEGIN - IF x^.class >= Nconst THEN err(56) END ; + IF x^.class >= OPT.Nconst THEN err(56) END ; CheckAssign(x^.typ, y); IF x^.readonly THEN err(76) END ; - IF x^.typ^.comp = Record THEN - IF x^.class = Nguard THEN z := x^.left ELSE z := x END ; - IF (z^.class = Nderef) & (z^.left^.class = Nguard) THEN + IF x^.typ^.comp = OPT.Record THEN + IF x^.class = OPT.Nguard THEN z := x^.left ELSE z := x END ; + IF (z^.class = OPT.Nderef) & (z^.left^.class = OPT.Nguard) THEN z^.left := z^.left^.left (* skip guard before dereferencing *) END ; - IF (x^.typ^.strobj # NIL) & ((z^.class = Nderef) OR (z^.class = Nvarpar)) THEN - BindNodes(Neguard, x^.typ, z, NIL); x := z + IF (x^.typ^.strobj # NIL) & ((z^.class = OPT.Nderef) OR (z^.class = OPT.Nvarpar)) THEN + BindNodes(OPT.Neguard, x^.typ, z, NIL); x := z END - ELSIF (x^.typ^.comp = Array) & (x^.typ^.BaseTyp = OPT.chartyp) & - (y^.typ^.form = String) & (y^.conval^.intval2 = 1) THEN (* replace array := "" with array[0] := 0X *) + ELSIF (x^.typ^.comp = OPT.Array) & (x^.typ^.BaseTyp = OPT.chartyp) & + (y^.typ^.form = OPT.String) & (y^.conval^.intval2 = 1) THEN (* replace array := "" with array[0] := 0X *) y^.typ := OPT.chartyp; y^.conval^.intval := 0; Index(x, NewIntConst(0)) END ; - IF (x.typ.comp IN {Array, DynArr}) & (x.typ.BaseTyp = OPT.chartyp) - & (y.typ.comp IN {Array, DynArr}) & (y.typ.BaseTyp = OPT.chartyp) THEN - subcl := copyfn + IF (x.typ.comp IN {OPT.Array, OPT.DynArr}) & (x.typ.BaseTyp = OPT.chartyp) + & (y.typ.comp IN {OPT.Array, OPT.DynArr}) & (y.typ.BaseTyp = OPT.chartyp) THEN + subcl := OPT.copyfn ELSE - subcl := assign + subcl := OPT.assign END; - BindNodes(Nassign, OPT.notyp, x, y); + BindNodes(OPT.Nassign, OPT.notyp, x, y); x^.subcl := subcl; END Assign; PROCEDURE Inittd*(VAR inittd, last: OPT.Node; typ: OPT.Struct); VAR node: OPT.Node; BEGIN - node := OPT.NewNode(Ninittd); node^.typ := typ; + node := OPT.NewNode(OPT.Ninittd); node^.typ := typ; node^.conval := OPT.NewConst(); node^.conval^.intval := typ^.txtpos; IF inittd = NIL THEN inittd := node ELSE last^.link := node END ; last := node diff --git a/src/compiler/OPC.Mod b/src/compiler/OPC.Mod index 718ba572..1076a289 100644 --- a/src/compiler/OPC.Mod +++ b/src/compiler/OPC.Mod @@ -1,1408 +1,1352 @@ -MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) +MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) (* C source code generator version - 30.4.2000 jt, synchronized with BlackBox version, in particular - various promotion rules changed (long) => (LONGINT), xxxL avoided + 30.4.2000 jt, synchronized with BlackBox version, in particular + various promotion rules changed (long) => (LONGINT), xxxL avoided *) - IMPORT OPT, OPM, Configuration; - - CONST demoVersion = FALSE; - - CONST - (* structure forms *) - Byte = 1; Bool = 2; Char = 3; - SInt = 4; Int = 5; LInt = 6; - Real = 7; LReal = 8; Set = 9; String = 10; NilTyp = 11; NoTyp = 12; - Pointer = 13; ProcTyp = 14; - Comp = 15; -(* - Int8 = 7; Int16 = 8; Int32 = 9; Int64 = 10; - Real = 11; LReal = 12; Set = 13; String = 14; NilTyp = 15; NoTyp = 16; - Pointer = 17; ProcTyp = 18; - Comp = 19; -*) - (*Real = 7; LReal = 8; Set = 9; String = 10; NilTyp = 11; NoTyp = 12; - Pointer = 13; ProcTyp = 14; - Int8 = 15; Int16 = 16; Int32 = 17; Int64 = 18; - Comp = (*15*)19;*) - - (* composite structure forms *) - Array = 2; DynArr = 3; Record = 4; - - (* object history *) - removed = 4; - - (* object modes *) - Var = 1; VarPar = 2; Fld = 4; Typ = 5; LProc = 6; XProc = 7; - CProc = 9; Mod = 11; TProc = 13; - - (* symbol values and ops *) - eql = 9; neq = 10; lss = 11; leq = 12; gtr = 13; geq = 14; - - (* nodes classes *) - Ninittd = 14; - - (* module visibility of objects *) - internal = 0; external = 1; - - UndefinedType = 0; (* named type not yet defined *) - ProcessingType = 1; (* pointer type is being processed *) - PredefinedType = 2; (* for all predefined types *) - DefinedInHdr = 3+OPM.HeaderFile; (* named type has been defined in header file *) - DefinedInBdy = 3+OPM.BodyFile; (* named type has been defined in body file *) - - - HeaderMsg = " voc "; - BasicIncludeFile = "SYSTEM"; - Static = "static "; - Export = "export "; (* particularily introduced for VC++ declspec() *) - Extern = "import "; (* particularily introduced for VC++ declspec() *) - Struct = "struct "; - LocalScope = "_s"; (* name of a local intermediate scope (variable name) *) - GlobalScope = "_s"; (* pointer to current scope extension *) - LinkName = "lnk"; (* pointer to previous scope field *) - FlagExt = "__h"; - LenExt = "__len"; - DynTypExt = "__typ"; - TagExt = "__typ"; - - OpenParen = "("; - CloseParen = ")"; - OpenBrace = "{"; - CloseBrace = "}"; - OpenBracket = "["; - CloseBracket = "]"; - Underscore = "_"; - Quotes = 22X; - SingleQuote = 27X; - Tab = 9X; - Colon = ": "; - Semicolon = ";"; - Comma = ", "; - Becomes = " = "; - Star = "*"; - Blank = " "; - Dot = "."; - - DupFunc = "__DUP("; (* duplication of dynamic arrays *) - DupArrFunc = "__DUPARR("; (* duplication of fixed size arrays *) - DelFunc = "__DEL("; (* removal of dynamic arrays *) - - NilConst = "NIL"; - - VoidType = "void"; - CaseStat = "case "; - - VAR - indentLevel: INTEGER; - ptrinit, mainprog, ansi: BOOLEAN; - hashtab: ARRAY 105 OF SHORTINT; - keytab: ARRAY 36, 9 OF CHAR; - GlbPtrs: BOOLEAN; - BodyNameExt: ARRAY 13 OF CHAR; - - PROCEDURE Init*; - BEGIN - indentLevel := 0; - ptrinit := OPM.ptrinit IN OPM.opt; - (*mainprog := OPM.mainprog IN OPM.opt;*) - mainprog := OPM.mainProg OR OPM.mainLinkStat; - ansi := OPM.ansi IN OPM.opt; - IF ansi THEN BodyNameExt := "__init(void)" ELSE BodyNameExt := "__init()" END - END Init; - - PROCEDURE Indent* (count: INTEGER); - BEGIN INC(indentLevel, count) - END Indent; - - PROCEDURE BegStat*; - VAR i: INTEGER; - BEGIN i := indentLevel; - WHILE i > 0 DO OPM.Write(Tab); DEC (i) END - END BegStat; - - PROCEDURE EndStat*; - BEGIN OPM.Write(Semicolon); OPM.WriteLn - END EndStat; - - PROCEDURE BegBlk*; - BEGIN OPM.Write(OpenBrace); OPM.WriteLn; INC(indentLevel) - END BegBlk; - - PROCEDURE EndBlk*; - BEGIN DEC(indentLevel); BegStat; OPM.Write(CloseBrace); OPM.WriteLn - END EndBlk; - - PROCEDURE EndBlk0*; - BEGIN DEC(indentLevel); BegStat; OPM.Write(CloseBrace) - END EndBlk0; - - PROCEDURE Str1(s: ARRAY OF CHAR; x: LONGINT); - VAR ch: CHAR; i: INTEGER; - BEGIN ch := s[0]; i := 0; - WHILE ch # 0X DO - IF ch = "#" THEN OPM.WriteInt(x) - ELSE OPM.Write(ch); - END ; - INC(i); ch := s[i] - END - END Str1; - - PROCEDURE Length(VAR s: ARRAY OF CHAR): INTEGER; - VAR i: INTEGER; - BEGIN i := 0; - WHILE s[i] # 0X DO INC(i) END ; - RETURN i - END Length; - - PROCEDURE PerfectHash (VAR s: ARRAY OF CHAR): INTEGER; - VAR i, h: INTEGER; - BEGIN i := 0; h := 0; - WHILE (s[i] # 0X) & (i < 5) DO h := 3*h + ORD(s[i]); INC(i) END; - RETURN h MOD 105 - END PerfectHash; - - PROCEDURE Ident* (obj: OPT.Object); - VAR mode, level, h: INTEGER; - BEGIN - mode := obj^.mode; level := obj^.mnolev; - IF (mode IN {Var, Typ, LProc}) & (level > 0) OR (mode IN {Fld, VarPar}) THEN - OPM.WriteStringVar(obj^.name); - h := PerfectHash(obj^.name); - IF hashtab[h] >= 0 THEN - IF keytab[hashtab[h]] = obj^.name THEN OPM.Write(Underscore) END - END - ELSE - IF (mode # Typ) OR (obj^.linkadr # PredefinedType) THEN - IF mode = TProc THEN Ident(obj^.link^.typ^.strobj) - ELSIF level < 0 THEN (* use unaliased module name *) - OPM.WriteStringVar(OPT.GlbMod[-level].name); - IF OPM.currFile = OPM.HeaderFile THEN OPT.GlbMod[-level].vis := 1 (*include in header file*) END ; - ELSE OPM.WriteStringVar(OPM.modName) - END ; - OPM.Write(Underscore) - ELSIF (obj = OPT.sysptrtyp^.strobj) OR (obj = OPT.bytetyp^.strobj) (*OR (obj = OPT.int8typ^.strobj) OR (obj = OPT.int16typ^.strobj) OR (obj = OPT.int32typ^.strobj) OR (obj = OPT.int64typ^.strobj)*) THEN - OPM.WriteString("SYSTEM_") - - END ; - OPM.WriteStringVar(obj^.name) - END - END Ident; - - PROCEDURE Stars (typ: OPT.Struct; VAR openClause: BOOLEAN); - VAR pointers: INTEGER; - BEGIN - openClause := FALSE; - IF ((typ^.strobj = NIL) OR (typ^.strobj^.name = "")) & (typ^.comp # Record) THEN - IF typ^.comp IN {Array, DynArr} THEN - Stars (typ^.BaseTyp, openClause); - openClause := (typ^.comp = Array) - ELSIF typ^.form = ProcTyp THEN - OPM.Write(OpenParen); OPM.Write(Star) - ELSE - pointers := 0; - (*WHILE (typ^.strobj = NIL) & (typ^.form = Pointer) DO INC (pointers); typ := typ^.BaseTyp END ; - IF (typ^.comp # DynArr) & (pointers # 0) THEN Stars (typ, openClause) END ;*) - WHILE ((typ^.strobj = NIL) OR (typ^.strobj^.name = "")) & (typ^.form = Pointer) DO - INC (pointers); typ := typ^.BaseTyp - END ; - IF pointers > 0 THEN - IF typ^.comp # DynArr THEN Stars (typ, openClause) END ; - IF openClause THEN OPM.Write(OpenParen); openClause := FALSE END ; - WHILE pointers > 0 DO OPM.Write(Star); DEC (pointers) END - END - END - END - END Stars; - - PROCEDURE ^AnsiParamList (obj: OPT.Object; showParamNames: BOOLEAN); - - PROCEDURE DeclareObj(dcl: OPT.Object; scopeDef: BOOLEAN); - VAR - typ: OPT.Struct; - varPar, openClause: BOOLEAN; form, comp: INTEGER; - BEGIN - typ := dcl^.typ; - varPar := ((dcl^.mode = VarPar) & (typ^.comp # Array)) OR (typ^.comp = DynArr) OR scopeDef; - Stars(typ, openClause); - IF varPar THEN - IF openClause THEN OPM.Write(OpenParen) END ; - OPM.Write(Star) - END ; - IF dcl.name # "" THEN Ident(dcl) END ; - IF varPar & openClause THEN OPM.Write(CloseParen) END ; - openClause := FALSE; - LOOP - form := typ^.form; - comp := typ^.comp; - IF ((typ^.strobj # NIL) & (typ^.strobj^.name # "")) OR (form = NoTyp) OR (comp = Record) THEN EXIT - ELSIF (form = Pointer) & (typ^.BaseTyp^.comp # DynArr) THEN - openClause := TRUE - ELSIF (form = ProcTyp) OR (comp IN {Array, DynArr}) THEN - IF openClause THEN OPM.Write(CloseParen); openClause := FALSE END ; - IF form = ProcTyp THEN - IF ansi THEN OPM.Write(")"); AnsiParamList(typ^.link, FALSE) - ELSE OPM.WriteString(")()") - END ; - EXIT - ELSIF comp = Array THEN - OPM.Write(OpenBracket); OPM.WriteInt(typ^.n); OPM.Write(CloseBracket) - END - ELSE - EXIT - END ; - typ := typ^.BaseTyp - END - END DeclareObj; - - PROCEDURE Andent*(typ: OPT.Struct); (* ident of possibly anonymous record type *) - BEGIN - IF (typ^.strobj = NIL) OR (typ^.align >= 10000H) THEN - OPM.WriteStringVar(OPM.modName); Str1("__#", typ^.align DIV 10000H) - ELSE Ident(typ^.strobj) - END - END Andent; - - PROCEDURE Undefined(obj: OPT.Object): BOOLEAN; - BEGIN - (* imported anonymous types have obj^.name = ""; used e.g. for repeating inherited fields *) - RETURN (obj^.mnolev >= 0) & (obj^.linkadr # 3+OPM.currFile ) & (obj^.linkadr # PredefinedType) OR (obj^.name = "") - END Undefined; - - PROCEDURE ^FieldList (typ: OPT.Struct; last: BOOLEAN; VAR off, n, curAlign: LONGINT); - - PROCEDURE DeclareBase(dcl: OPT.Object); (* declare the specifier of object dcl*) - VAR typ, prev: OPT.Struct; obj: OPT.Object; nofdims: INTEGER; off, n, dummy: LONGINT; - BEGIN - typ := dcl^.typ; prev := typ; - WHILE ((typ^.strobj = NIL) OR (typ^.comp = DynArr) OR Undefined(typ^.strobj)) & (typ^.comp # Record) & (typ^.form # NoTyp) - & ~((typ^.form = Pointer) & (typ^.BaseTyp^.comp = DynArr)) DO - prev := typ; typ := typ^.BaseTyp - END ; - obj := typ^.strobj; - IF typ^.form = NoTyp THEN (* proper procedure *) - OPM.WriteString(VoidType) - ELSIF (obj # NIL) & ~Undefined(obj) THEN (* named type, already declared *) - Ident(obj) - ELSIF typ^.comp = Record THEN - OPM.WriteString(Struct); Andent(typ); - IF (prev.form # Pointer) & ((obj # NIL) OR (dcl.name = "")) THEN - (* named record type not yet declared OR anonymous record with empty name *) - IF (typ^.BaseTyp # NIL) & (typ^.BaseTyp^.strobj.vis # internal) THEN - OPM.WriteString(" { /* "); Ident(typ^.BaseTyp^.strobj); OPM.WriteString(" */"); OPM.WriteLn; Indent(1) - ELSE OPM.Write(Blank); BegBlk - END ; - FieldList(typ, TRUE, off, n, dummy); - EndBlk0 - END - ELSIF (typ^.form = Pointer) & (typ^.BaseTyp^.comp = DynArr) THEN - typ := typ^.BaseTyp^.BaseTyp; nofdims := 1; - WHILE typ^.comp = DynArr DO INC(nofdims); typ := typ^.BaseTyp END ; - OPM.WriteString(Struct); BegBlk; - BegStat; Str1("LONGINT len[#]", nofdims); EndStat; - BegStat; NEW(obj); NEW(obj.typ); (* aux. object for easy declaration *) - obj.typ.form := Comp; obj.typ.comp := Array; obj.typ.n := 1; obj.typ.BaseTyp := typ; obj.mode := Fld; obj.name := "data"; - obj.linkadr := UndefinedType; DeclareBase(obj); OPM.Write(Blank); DeclareObj(obj, FALSE); - EndStat; EndBlk0 - END - END DeclareBase; - - PROCEDURE NofPtrs* (typ: OPT.Struct): LONGINT; - VAR fld: OPT.Object; btyp: OPT.Struct; n: LONGINT; - BEGIN - IF (typ^.form = Pointer) & (typ^.sysflag = 0) THEN RETURN 1 - ELSIF (typ^.comp = Record) & (typ^.sysflag MOD 100H = 0) THEN - btyp := typ^.BaseTyp; - IF btyp # NIL THEN n := NofPtrs(btyp) ELSE n := 0 END ; - fld := typ^.link; - WHILE (fld # NIL) & (fld^.mode = Fld) DO - IF fld^.name # OPM.HdPtrName THEN n := n + NofPtrs(fld^.typ) - ELSE INC(n) - END ; - fld := fld^.link - END ; - RETURN n - ELSIF typ^.comp = Array THEN - btyp := typ^.BaseTyp; n := typ^.n; - WHILE btyp^.comp = Array DO n := btyp^.n * n; btyp := btyp^.BaseTyp END ; - RETURN NofPtrs(btyp) * n - ELSE RETURN 0 - END - END NofPtrs; - - PROCEDURE PutPtrOffsets (typ: OPT.Struct; adr: LONGINT; VAR cnt: LONGINT); - VAR fld: OPT.Object; btyp: OPT.Struct; n, i: LONGINT; - BEGIN - IF (typ^.form = Pointer) & (typ^.sysflag = 0) THEN - OPM.WriteInt(adr); OPM.WriteString(", "); INC(cnt); - IF cnt MOD 16 = 0 THEN OPM.WriteLn; OPM.Write(Tab) END - ELSIF (typ^.comp = Record) & (typ^.sysflag MOD 100H = 0) THEN - btyp := typ^.BaseTyp; - IF btyp # NIL THEN PutPtrOffsets(btyp, adr, cnt) END ; - fld := typ^.link; - WHILE (fld # NIL) & (fld^.mode = Fld) DO - IF fld^.name # OPM.HdPtrName THEN PutPtrOffsets(fld^.typ, adr + fld^.adr, cnt) - ELSE - OPM.WriteInt(adr + fld^.adr); OPM.WriteString(", "); INC(cnt); - IF cnt MOD 16 = 0 THEN OPM.WriteLn; OPM.Write(Tab) END - END ; - fld := fld^.link - END - ELSIF typ^.comp = Array THEN - btyp := typ^.BaseTyp; n := typ^.n; - WHILE btyp^.comp = Array DO n := btyp^.n * n; btyp := btyp^.BaseTyp END ; - IF NofPtrs(btyp) > 0 THEN i := 0; - WHILE i < n DO PutPtrOffsets(btyp, adr + i * btyp^.size, cnt); INC(i) END - END - END - END PutPtrOffsets; - - PROCEDURE InitTProcs(typ, obj: OPT.Object); - BEGIN - IF obj # NIL THEN - InitTProcs(typ, obj^.left); - IF obj^.mode = TProc THEN - BegStat; - OPM.WriteString("__INITBP("); - Ident(typ); OPM.WriteString(Comma); Ident(obj); - Str1(", #)", obj^.adr DIV 10000H); - EndStat - END ; - InitTProcs(typ, obj^.right) - END - END InitTProcs; - - PROCEDURE PutBase(typ: OPT.Struct); - BEGIN - IF typ # NIL THEN - PutBase(typ^.BaseTyp); - Ident(typ^.strobj); OPM.WriteString(DynTypExt); OPM.WriteString(", ") - END - END PutBase; - - PROCEDURE LenList(par: OPT.Object; ansiDefine, showParamName: BOOLEAN); - VAR typ: OPT.Struct; dim: INTEGER; - BEGIN - IF showParamName THEN Ident(par); OPM.WriteString(LenExt) END ; - dim := 1; typ := par^.typ^.BaseTyp; - WHILE typ^.comp = DynArr DO - IF ansiDefine THEN OPM.WriteString(", LONGINT ") ELSE OPM.WriteString(Comma) END ; - IF showParamName THEN Ident(par); OPM.WriteString(LenExt); OPM.WriteInt(dim) END ; - typ := typ^.BaseTyp; INC(dim) - END - END LenList; - - PROCEDURE DeclareParams(par: OPT.Object; macro: BOOLEAN); - BEGIN - OPM.Write(OpenParen); - WHILE par # NIL DO - IF macro THEN OPM.WriteStringVar(par.name) - ELSE - IF (par^.mode = Var) & (par^.typ^.form = Real) THEN OPM.Write("_") END ; - Ident(par) - END ; - IF par^.typ^.comp = DynArr THEN - OPM.WriteString(Comma); LenList(par, FALSE, TRUE); - ELSIF (par^.mode = VarPar) & (par^.typ^.comp = Record) THEN - OPM.WriteString(Comma); OPM.WriteStringVar(par.name); OPM.WriteString(TagExt) - END ; - par := par^.link; - IF par # NIL THEN OPM.WriteString(Comma) END - END ; - OPM.Write(CloseParen) - END DeclareParams; - - PROCEDURE ^DefineType(str: OPT.Struct); - PROCEDURE ^ProcHeader(proc: OPT.Object; define: BOOLEAN); - - PROCEDURE DefineTProcTypes(obj: OPT.Object); (* define all types that are used in a TProc definition *) - VAR par: OPT.Object; - BEGIN - IF obj^.typ # OPT.notyp THEN DefineType(obj^.typ) END ; - IF ansi THEN par := obj^.link; - WHILE par # NIL DO DefineType(par^.typ); par := par^.link END - END - END DefineTProcTypes; - - PROCEDURE DeclareTProcs(obj: OPT.Object; VAR empty: BOOLEAN); - BEGIN - IF obj # NIL THEN - DeclareTProcs(obj^.left, empty); - IF obj^.mode = TProc THEN - IF obj^.typ # OPT.notyp THEN DefineType(obj^.typ) END ; - IF OPM.currFile = OPM.HeaderFile THEN - IF obj^.vis = external THEN - DefineTProcTypes(obj); - OPM.WriteString(Extern); empty := FALSE; - ProcHeader(obj, FALSE) - END - ELSE empty := FALSE; - DefineTProcTypes(obj); - IF obj^.vis = internal THEN OPM.WriteString(Static) - ELSE OPM.WriteString(Export) - END ; - ProcHeader(obj, FALSE) - END - END ; - DeclareTProcs(obj^.right, empty) - END - END DeclareTProcs; - - PROCEDURE BaseTProc*(obj: OPT.Object): OPT.Object; - VAR typ, base: OPT.Struct; mno: LONGINT; - BEGIN typ := obj^.link^.typ; (* receiver type *) - IF typ^.form = Pointer THEN typ := typ^.BaseTyp END ; - base := typ^.BaseTyp; mno := obj^.adr DIV 10000H; - WHILE (base # NIL) & (mno < base^.n) DO typ := base; base := typ^.BaseTyp END ; - OPT.FindField(obj^.name, typ, obj); - RETURN obj - END BaseTProc; - - PROCEDURE DefineTProcMacros(obj: OPT.Object; VAR empty: BOOLEAN); - BEGIN - IF obj # NIL THEN - DefineTProcMacros(obj^.left, empty); - IF (obj^.mode = TProc) & (obj = BaseTProc(obj)) & ((OPM.currFile # OPM.HeaderFile) OR (obj^.vis = external)) THEN - OPM.WriteString("#define __"); - Ident(obj); - DeclareParams(obj^.link, TRUE); - OPM.WriteString(" __SEND("); - IF obj^.link^.typ^.form = Pointer THEN - OPM.WriteString("__TYPEOF("); Ident(obj^.link); OPM.Write(")") - ELSE Ident(obj^.link); OPM.WriteString(TagExt) - END ; - Str1(", #, ", obj^.adr DIV 10000H); - IF obj^.typ = OPT.notyp THEN OPM.WriteString(VoidType) ELSE Ident(obj^.typ^.strobj) END ; - OPM.WriteString("(*)"); - IF ansi THEN - AnsiParamList(obj^.link, FALSE); - ELSE - OPM.WriteString("()"); - END ; - OPM.WriteString(", "); - DeclareParams(obj^.link, TRUE); - OPM.Write(")"); OPM.WriteLn - END ; - DefineTProcMacros(obj^.right, empty) - END - END DefineTProcMacros; - - PROCEDURE DefineType(str: OPT.Struct); (* define a type object *) - VAR obj, field, par: OPT.Object; empty: BOOLEAN; - BEGIN - IF (OPM.currFile = OPM.BodyFile) OR (str^.ref < OPM.MaxStruct (*for hidden exports*) ) THEN - obj := str^.strobj; - IF (obj = NIL) OR Undefined(obj) THEN - IF obj # NIL THEN (* check for cycles *) - IF obj^.linkadr = ProcessingType THEN - IF str^.form # Pointer THEN OPM.Mark(244, str^.txtpos); obj^.linkadr := PredefinedType END - ELSE obj^.linkadr := ProcessingType - END - END ; - IF str^.comp = Record THEN - (* the following exports the base type of an exported type even if the former is non-exported *) - IF str^.BaseTyp # NIL THEN DefineType(str^.BaseTyp) END ; - field := str^.link; - WHILE (field # NIL) & (field^.mode = Fld) DO - IF (field^.vis # internal) OR (OPM.currFile = OPM.BodyFile) THEN DefineType(field^.typ) END ; - field := field^.link - END - ELSIF str^.form = Pointer THEN - IF str^.BaseTyp^.comp # Record THEN DefineType(str^.BaseTyp) END - ELSIF str^.comp IN {Array, DynArr} THEN - DefineType(str^.BaseTyp) - ELSIF str^.form = ProcTyp THEN - IF str^.BaseTyp # OPT.notyp THEN DefineType(str^.BaseTyp) END ; - field := str^.link; - WHILE field # NIL DO DefineType(field^.typ); field := field^.link END - END - END ; - IF (obj # NIL) & Undefined(obj) THEN - OPM.WriteString("typedef"); OPM.WriteLn; OPM.Write(Tab); Indent(1); - obj^.linkadr := ProcessingType; - DeclareBase(obj); OPM.Write(Blank); - obj^.typ^.strobj := NIL; (* SG: trick to make DeclareObj declare the type *) - DeclareObj(obj, FALSE); - obj^.typ^.strobj := obj; (* SG: revert trick *) - obj^.linkadr := 3+OPM.currFile; - EndStat; Indent(-1); OPM.WriteLn; - IF obj^.typ^.comp = Record THEN empty := TRUE; - DeclareTProcs(str^.link, empty); DefineTProcMacros(str^.link, empty); - IF ~empty THEN OPM.WriteLn END - END - END - END - END DefineType; - - PROCEDURE Prefixed(x: OPT.ConstExt; y: ARRAY OF CHAR): BOOLEAN; - VAR i: INTEGER; r: BOOLEAN; - BEGIN i := 0; - WHILE x[i+1] = y[i] DO INC(i) END ; - r := y[i] = 0X; - RETURN r; - END Prefixed; - - PROCEDURE CProcDefs(obj: OPT.Object; vis: INTEGER); - VAR i: INTEGER; ext: OPT.ConstExt; - BEGIN - IF obj # NIL THEN - CProcDefs(obj^.left, vis); - (* bug: obj.history cannot be used to cover unexported and deleted CProcs; use special flag obj.adr = 1 *) - IF (obj^.mode = CProc) & (obj^.vis >= vis) & (obj^.adr = 1) THEN - ext := obj.conval.ext; i := 1; - IF (ext[1] # "#") & ~(Prefixed(ext, "extern ") OR Prefixed(ext, Extern)) THEN - OPM.WriteString("#define "); Ident(obj); - DeclareParams(obj^.link, TRUE); - OPM.Write(Tab); - END ; - FOR i := i TO ORD(obj.conval.ext[0]) DO OPM.Write(obj.conval.ext[i]) END; - OPM.WriteLn - END ; - CProcDefs(obj^.right, vis) - END - END CProcDefs; - - PROCEDURE TypeDefs* (obj: OPT.Object; vis(*replaced by test on currFile in DefineType*): INTEGER); - BEGIN - IF obj # NIL THEN - TypeDefs(obj^.left, vis); - (* test typ.txtpos to skip types that have been unexported; obj.history # removed is not enough!*) - IF (obj^.mode = Typ) & (obj^.typ^.txtpos > 0) THEN DefineType(obj^.typ) END ; - TypeDefs(obj^.right, vis) - END - END TypeDefs; - - PROCEDURE DefAnonRecs(n: OPT.Node); - VAR o: OPT.Object; typ: OPT.Struct; - BEGIN - WHILE (n # NIL) & (n^.class = Ninittd) DO - typ := n^.typ; - IF (typ^.strobj = NIL) & ((OPM.currFile = OPM.BodyFile) OR (typ.ref < OPM.MaxStruct)) THEN - DefineType(typ); (* declare base and field types, if any *) - NEW(o); o.typ := typ; o.name := ""; DeclareBase(o); EndStat; OPM.WriteLn - (* simply defines a named struct, but not a type; - o.name = "" signals field list expansion for DeclareBase in this very special case *) - END ; - n := n^.link - END - END DefAnonRecs; - - PROCEDURE TDescDecl* (typ: OPT.Struct); - VAR nofptrs: LONGINT; - o: OPT.Object; - BEGIN - BegStat; OPM.WriteString("__TDESC("); - Andent(typ); - Str1(", #", typ^.n + 1); Str1(", #) = {__TDFLDS(", NofPtrs(typ)); - OPM.Write('"'); - IF typ^.strobj # NIL THEN OPM.WriteStringVar(typ^.strobj^.name) END ; - Str1('", #), {', typ^.size); - nofptrs := 0; PutPtrOffsets(typ, 0, nofptrs); Str1("#}}", -(nofptrs + 1) * OPM.LIntSize); - EndStat - END TDescDecl; - - PROCEDURE InitTDesc*(typ: OPT.Struct); - BEGIN - BegStat; OPM.WriteString("__INITYP("); - Andent(typ); OPM.WriteString(", "); - IF typ^.BaseTyp # NIL THEN Andent(typ^.BaseTyp) ELSE Andent(typ) END ; - Str1(", #)", typ^.extlev); - EndStat; - IF typ^.strobj # NIL THEN InitTProcs(typ^.strobj, typ^.link) END - END InitTDesc; - - PROCEDURE Align*(VAR adr: LONGINT; base: LONGINT); - BEGIN - CASE base OF - | 2: INC(adr, adr MOD 2) - | 4: INC(adr, (-adr) MOD 4) - | 8: INC(adr, (-adr) MOD 8) - |16: INC(adr, (-adr) MOD 16) - ELSE (*1*) - (*OPM.LogWStr("unhandled case at OPC.Align, base = "); OPM.LogWNum(base, 0); OPM.LogWLn;*) - END - END Align; - - PROCEDURE Base*(typ: OPT.Struct): LONGINT; - BEGIN - CASE typ^.form OF - | Byte: RETURN 1 - | Char: RETURN OPM.CharAlign - | Bool: RETURN OPM.BoolAlign - | SInt: RETURN OPM.SIntAlign - | Int: RETURN OPM.IntAlign - | LInt: RETURN OPM.LIntAlign - (* | Int8: RETURN OPM.Int8Align - | Int16: RETURN OPM.Int16Align - | Int32: RETURN OPM.Int32Align - | Int64: RETURN OPM.Int64Align*) - | Real: RETURN OPM.RealAlign - | LReal: RETURN OPM.LRealAlign - | Set: RETURN OPM.SetAlign - | Pointer: RETURN OPM.PointerAlign - | ProcTyp: RETURN OPM.ProcAlign - | Comp: - IF typ^.comp = Record THEN RETURN typ^.align MOD 10000H - ELSE RETURN Base(typ^.BaseTyp) - END - ELSE OPM.LogWStr("unhandled case in OPC.Base, typ^form = "); OPM.LogWNum(typ^.form, 0); OPM.LogWLn; - END - END Base; - - PROCEDURE FillGap(gap, off, align: LONGINT; VAR n, curAlign: LONGINT); - VAR adr: LONGINT; - BEGIN - adr := off; Align(adr, align); - IF (curAlign < align) & (gap - (adr - off) >= align) THEN (* preserve alignment of the enclosing struct! *) - DEC(gap, (adr - off) + align); - BegStat; - IF align = OPM.IntSize THEN OPM.WriteString("INTEGER") - ELSIF align = OPM.LIntSize THEN OPM.WriteString("LONGINT") - ELSIF align = OPM.LRealSize THEN OPM.WriteString("LONGREAL") - END ; - Str1(" _prvt#", n); INC(n); EndStat; - curAlign := align - END ; - IF gap > 0 THEN BegStat; Str1("char _prvt#", n); INC(n); Str1("[#]", gap); EndStat END - END FillGap; - - PROCEDURE FieldList (typ: OPT.Struct; last: BOOLEAN; VAR off, n, curAlign: LONGINT); - VAR fld: OPT.Object; base: OPT.Struct; gap, adr, align, fldAlign: LONGINT; - BEGIN - fld := typ.link; align := typ^.align MOD 10000H; - IF typ.BaseTyp # NIL THEN FieldList(typ.BaseTyp, FALSE, off, n, curAlign) - ELSE off := 0; n := 0; curAlign := 1 - END ; - WHILE (fld # NIL) & (fld.mode = Fld) DO - IF (OPM.currFile = OPM.HeaderFile) & (fld.vis = internal) OR - (OPM.currFile = OPM.BodyFile) & (fld.vis = internal) & (typ^.mno # 0) THEN - fld := fld.link; - WHILE (fld # NIL) & (fld.mode = Fld) & (fld.vis = internal) DO fld := fld.link END ; - ELSE - (* mimic OPV.TypSize to detect gaps caused by private fields *) - adr := off; fldAlign := Base(fld^.typ); Align(adr, fldAlign); - gap := fld.adr - adr; - IF fldAlign > curAlign THEN curAlign := fldAlign END ; - IF gap > 0 THEN FillGap(gap, off, align, n, curAlign) END ; - BegStat; DeclareBase(fld); OPM.Write(Blank); DeclareObj(fld, FALSE); - off := fld.adr + fld.typ.size; base := fld.typ; fld := fld.link; - WHILE (fld # NIL) & (fld.mode = Fld) & (fld.typ = base) & (fld.adr = off) -(* ?? *) & ((OPM.currFile = OPM.BodyFile) OR (fld.vis # internal) OR (fld.typ.strobj = NIL)) DO - OPM.WriteString(", "); DeclareObj(fld, FALSE); off := fld.adr + fld.typ.size; fld := fld.link - END ; - EndStat - END - END ; - IF last THEN - adr := typ.size - typ^.sysflag DIV 100H; - IF adr = 0 THEN gap := 1 (* avoid empty struct *) ELSE gap := adr - off END ; - IF gap > 0 THEN FillGap(gap, off, align, n, curAlign) END - END - END FieldList; - - PROCEDURE IdentList (obj: OPT.Object; vis: INTEGER); - (* generate var and param lists; vis: 0 all global vars, local var, 1 exported(R) var, 2 par list, 3 scope var *) - VAR base: OPT.Struct; first: BOOLEAN; lastvis: INTEGER; - BEGIN - base := NIL; first := TRUE; - WHILE (obj # NIL) & (obj^.mode # TProc) DO - IF (vis IN {0, 2}) OR ((vis = 1) & (obj^.vis # 0)) OR ((vis = 3) & ~obj^.leaf) THEN - IF (obj^.typ # base) OR (obj^.vis # lastvis) THEN (* new variable base type definition required *) - IF ~first THEN EndStat END ; - first := FALSE; - base := obj^.typ; lastvis := obj^.vis; - BegStat; - IF (vis = 1) & (obj^.vis # internal) THEN OPM.WriteString(Extern) - ELSIF (obj^.mnolev = 0) & (vis = 0) THEN - IF obj^.vis = internal THEN OPM.WriteString(Static) - ELSE OPM.WriteString(Export) - END - END ; - IF (vis = 2) & (obj^.mode = Var) & (base^.form = Real) THEN OPM.WriteString("double") - ELSE DeclareBase(obj) - END - ELSE OPM.Write(","); - END ; - OPM.Write(Blank); - IF (vis = 2) & (obj^.mode = Var) & (base^.form = Real) THEN OPM.Write("_") END ; - DeclareObj(obj, vis = 3); - IF obj^.typ^.comp = DynArr THEN (* declare len parameter(s) *) - EndStat; BegStat; - base := OPT.linttyp; - OPM.WriteString("LONGINT "); LenList(obj, FALSE, TRUE) - ELSIF (obj^.mode = VarPar) & (obj^.typ^.comp = Record) THEN - EndStat; BegStat; - OPM.WriteString("LONGINT *"); Ident(obj); OPM.WriteString(TagExt); - base := NIL - ELSIF ptrinit & (vis = 0) & (obj^.mnolev > 0) & (obj^.typ^.form = Pointer) THEN - OPM.WriteString(" = NIL") - END - END ; - obj := obj^.link - END ; - IF ~first THEN EndStat END - END IdentList; - - PROCEDURE AnsiParamList (obj: OPT.Object; showParamNames: BOOLEAN); - VAR name: ARRAY 32 OF CHAR; - BEGIN - OPM.Write("("); - IF (obj = NIL) OR (obj^.mode = TProc) THEN OPM.WriteString("void") - ELSE - LOOP - DeclareBase(obj); - IF showParamNames THEN - OPM.Write(Blank); DeclareObj(obj, FALSE) - ELSE - COPY(obj^.name, name); obj^.name := ""; DeclareObj(obj, FALSE); COPY(name, obj^.name) - END ; - IF obj^.typ^.comp = DynArr THEN - OPM.WriteString(", LONGINT "); - LenList(obj, TRUE, showParamNames) - ELSIF (obj^.mode = VarPar) & (obj^.typ^.comp = Record) THEN - OPM.WriteString(", LONGINT *"); - IF showParamNames THEN Ident(obj); OPM.WriteString(TagExt) END - END ; - IF (obj^.link = NIL) OR (obj^.link.mode = TProc) THEN EXIT END ; - OPM.WriteString(", "); - obj := obj^.link - END - END ; - OPM.Write(")") - END AnsiParamList; - - PROCEDURE ProcHeader(proc: OPT.Object; define: BOOLEAN); - BEGIN - IF proc^.typ = OPT.notyp THEN OPM.WriteString(VoidType) ELSE Ident(proc^.typ^.strobj) END ; - OPM.Write(Blank); Ident(proc); OPM.Write(Blank); - IF ansi THEN - AnsiParamList(proc^.link, TRUE); - IF ~define THEN OPM.Write(";") END ; - OPM.WriteLn; - ELSIF define THEN - DeclareParams(proc^.link, FALSE); - OPM.WriteLn; - Indent(1); IdentList(proc^.link, 2(* map REAL to double *)); Indent(-1) - ELSE OPM.WriteString("();"); OPM.WriteLn - END - END ProcHeader; - - PROCEDURE ProcPredefs (obj: OPT.Object; vis: SHORTINT); (* forward declaration of procedures *) - BEGIN - IF obj # NIL THEN - ProcPredefs(obj^.left, vis); - IF (obj^.mode IN {LProc, XProc}) & (obj^.vis >= vis) & ((obj^.history # removed) OR (obj^.mode = LProc)) THEN - (* previous XProc may be deleted or become LProc after interface change*) - IF vis = external THEN OPM.WriteString(Extern) - ELSIF obj^.vis = internal THEN OPM.WriteString(Static) - ELSE OPM.WriteString(Export) - END ; - ProcHeader(obj, FALSE); - END ; - ProcPredefs(obj^.right, vis); - END; - END ProcPredefs; - - PROCEDURE Include(name: ARRAY OF CHAR); - BEGIN - OPM.WriteString("#include "); OPM.Write(Quotes); OPM.WriteStringVar(name); - OPM.WriteString(".h"); OPM.Write(Quotes); OPM.WriteLn - END Include; - - PROCEDURE IncludeImports(obj: OPT.Object; vis: INTEGER); - BEGIN - IF obj # NIL THEN - IncludeImports(obj^.left, vis); - IF (obj^.mode = Mod) & (obj^.mnolev # 0) & (OPT.GlbMod[-obj^.mnolev].vis >= vis) THEN (* @self and SYSTEM have mnolev = 0 *) - Include(OPT.GlbMod[-obj^.mnolev].name) (* use unaliased module name *) - END; - IncludeImports(obj^.right, vis); - END; - END IncludeImports; - - PROCEDURE GenDynTypes (n: OPT.Node; vis: INTEGER); - VAR typ: OPT.Struct; - BEGIN - WHILE (n # NIL) & (n^.class = Ninittd) DO - typ := n^.typ; - IF (vis = internal) OR (typ^.ref < OPM.MaxStruct (*type needed in symbol file*)) THEN - BegStat; - IF vis = external THEN OPM.WriteString(Extern) - ELSIF (typ^.strobj # NIL) & (typ^.strobj^.mnolev > 0) THEN OPM.WriteString(Static) - ELSE OPM.WriteString(Export) - END ; - OPM.WriteString("LONGINT *"); Andent(typ); OPM.WriteString(DynTypExt); - EndStat - END ; - n := n^.link - END - END GenDynTypes; - - PROCEDURE GenHdr*(n: OPT.Node); - BEGIN - (* includes are delayed until it is known which ones are needed in the header *) - OPM.currFile := OPM.HeaderFile; - DefAnonRecs(n); - TypeDefs(OPT.topScope^.right, 1); OPM.WriteLn; - IdentList(OPT.topScope^.scope, 1); OPM.WriteLn; - GenDynTypes(n, external); OPM.WriteLn; - ProcPredefs(OPT.topScope^.right, 1); - OPM.WriteString(Extern); OPM.WriteString("void *"); - OPM.WriteStringVar(OPM.modName); OPM.WriteString(BodyNameExt); - EndStat; OPM.WriteLn; - CProcDefs(OPT.topScope^.right, 1); OPM.WriteLn; - OPM.WriteString("#endif"); OPM.WriteLn - END GenHdr; - - PROCEDURE GenHeaderMsg; - VAR i: INTEGER; - BEGIN - OPM.WriteString("/*"); OPM.WriteString(HeaderMsg); - OPM.Write(" "); OPM.WriteString(Configuration.versionLong); OPM.Write (" "); (* noch *) - FOR i := 0 TO MAX(SET) DO - IF i IN OPM.glbopt THEN - CASE i OF (* c.f. ScanOptions in OPM *) - | OPM.inxchk: OPM.Write("x") - | OPM.ranchk: OPM.Write("r") - | OPM.typchk: OPM.Write("t") - | OPM.newsf: OPM.Write("s") - | OPM.ptrinit: OPM.Write("p") - | OPM.ansi: OPM.Write("k") - | OPM.assert: OPM.Write("a") - | OPM.extsf: OPM.Write("e") - | OPM.mainprog: OPM.Write("m") - | OPM.dontasm: OPM.Write("S") - | OPM.dontlink: OPM.Write("c") - | OPM.mainlinkstat: OPM.Write("M") - | OPM.notcoloroutput: OPM.Write("f") - | OPM.forcenewsym: OPM.Write("F") - | OPM.verbose: OPM.Write("v") - ELSE - (* this else is necessary cause - if someone defined a new option in OPM module - and forgot to add it here then - if option is passed this will - generate __CASECHK and cause Halt, - noch *) - OPM.LogWStr ("( more options defined in OPM than checked in OPC.GenHeaderMsg, if you are a compiler developer, add them to OPC.GenHeaderMsg"); OPM.LogWLn; - END - END - END; - OPM.WriteString(" */"); OPM.WriteLn - END GenHeaderMsg; - - PROCEDURE GenHdrIncludes*; - BEGIN - OPM.currFile := OPM.HeaderInclude; - GenHeaderMsg; - OPM.WriteLn; - OPM.WriteString("#ifndef "); OPM.WriteStringVar(OPM.modName); OPM.WriteString(FlagExt); OPM.WriteLn; - OPM.WriteString("#define "); OPM.WriteStringVar(OPM.modName); OPM.WriteString(FlagExt); OPM.WriteLn; - OPM.WriteLn; - IF OPM.LIntSize = 8 THEN OPM.WriteString("#define LARGE"); OPM.WriteLn END; - Include(BasicIncludeFile); - IncludeImports(OPT.topScope^.right, 1); OPM.WriteLn - END GenHdrIncludes; - - PROCEDURE GenBdy*(n: OPT.Node); - BEGIN - OPM.currFile := OPM.BodyFile; - GenHeaderMsg; - IF OPM.LIntSize = 8 THEN OPM.WriteString("#define LARGE"); OPM.WriteLn END; - Include(BasicIncludeFile); - IncludeImports(OPT.topScope^.right, 0); OPM.WriteLn; - DefAnonRecs(n); - TypeDefs(OPT.topScope^.right, 0); OPM.WriteLn; - IdentList(OPT.topScope^.scope, 0); OPM.WriteLn; - GenDynTypes(n, internal); OPM.WriteLn; - ProcPredefs(OPT.topScope^.right, 0); OPM.WriteLn; - CProcDefs(OPT.topScope^.right, 0); OPM.WriteLn - END GenBdy; - - PROCEDURE RegCmds(obj: OPT.Object); - BEGIN - IF obj # NIL THEN - RegCmds(obj^.left); - IF (obj^.mode = XProc) & (obj^.history # removed) THEN - IF (obj^.vis # 0) & (obj^.link = NIL) & (obj^.typ = OPT.notyp) THEN (*command*) - BegStat; OPM.WriteString('__REGCMD("'); - OPM.WriteStringVar(obj.name); OPM.WriteString('", '); Ident(obj); OPM.Write(")"); EndStat - END - END ; - RegCmds(obj^.right) - END - END RegCmds; - - PROCEDURE InitImports(obj: OPT.Object); - BEGIN - IF obj # NIL THEN - InitImports(obj^.left); - IF (obj^.mode = Mod) & (obj^.mnolev # 0) THEN - BegStat; OPM.WriteString("__MODULE_IMPORT("); - OPM.WriteStringVar(OPT.GlbMod[-obj^.mnolev].name); - OPM.Write(CloseParen); EndStat - END ; - InitImports(obj^.right) - END - END InitImports; - - PROCEDURE GenEnumPtrs* (var: OPT.Object); - VAR typ: OPT.Struct; n: LONGINT; - BEGIN GlbPtrs := FALSE; - WHILE var # NIL DO - typ := var^.typ; - IF NofPtrs(typ) > 0 THEN - IF ~GlbPtrs THEN GlbPtrs := TRUE; - OPM.WriteString(Static); - IF ansi THEN - OPM.WriteString("void EnumPtrs(void (*P)(void*))") - ELSE - OPM.WriteString("void EnumPtrs(P)"); OPM.WriteLn; - OPM.Write(Tab); OPM.WriteString("void (*P)();"); - END ; - OPM.WriteLn; - BegBlk - END ; - BegStat; - IF typ^.form = Pointer THEN - OPM.WriteString("P("); Ident(var); OPM.Write(")"); - ELSIF typ^.comp = Record THEN - OPM.WriteString("__ENUMR(&"); Ident(var); OPM.WriteString(", "); - Andent(typ); OPM.WriteString(DynTypExt); Str1(", #", typ^.size); OPM.WriteString(", 1, P)") - ELSIF typ^.comp = Array THEN - n := typ^.n; typ := typ^.BaseTyp; - WHILE typ^.comp = Array DO n := n * typ^.n; typ := typ^.BaseTyp END ; - IF typ^.form = Pointer THEN - OPM.WriteString("__ENUMP("); Ident(var); Str1(", #, P)", n) - ELSIF typ^.comp = Record THEN - OPM.WriteString("__ENUMR("); Ident(var); OPM.WriteString(", "); - Andent(typ); OPM.WriteString(DynTypExt); Str1(", #", typ^.size); Str1(", #, P)", n) - END - END ; - EndStat - END ; - var := var^.link - END ; - IF GlbPtrs THEN - EndBlk; OPM.WriteLn - END - END GenEnumPtrs; - - PROCEDURE EnterBody*; - BEGIN - OPM.WriteLn; OPM.WriteString(Export); - IF mainprog THEN - IF ansi THEN - OPM.WriteString("int main(int argc, char **argv)"); OPM.WriteLn; - ELSE - OPM.WriteString("main(argc, argv)"); OPM.WriteLn; - OPM.Write(Tab); OPM.WriteString("int argc; char **argv;"); OPM.WriteLn - END - ELSE - OPM.WriteString("void *"); - OPM.WriteString(OPM.modName); OPM.WriteString(BodyNameExt); OPM.WriteLn; - END ; - BegBlk; BegStat; - IF mainprog THEN OPM.WriteString("__INIT(argc, argv)") ELSE OPM.WriteString("__DEFMOD") END ; - EndStat; - IF mainprog & demoVersion THEN BegStat; - OPM.WriteString('/*don`t do it!*/ printf("DEMO VERSION: DO NOT USE THIS PROGRAM FOR ANY COMMERCIAL PURPOSE\n")'); - EndStat - END ; - InitImports(OPT.topScope^.right); - BegStat; - IF mainprog THEN OPM.WriteString('__REGMAIN("') ELSE OPM.WriteString('__REGMOD("') END ; - OPM.WriteString(OPM.modName); - IF GlbPtrs THEN OPM.WriteString('", EnumPtrs)') ELSE OPM.WriteString('", 0)') END ; - EndStat; - IF OPM.modName # "SYSTEM" THEN RegCmds(OPT.topScope) END - END EnterBody; - - PROCEDURE ExitBody*; - BEGIN - BegStat; - IF mainprog THEN OPM.WriteString("__FINI;") ELSE OPM.WriteString("__ENDMOD;") END ; - OPM.WriteLn; EndBlk - END ExitBody; - - PROCEDURE DefineInter* (proc: OPT.Object); (* define intermediate scope record and variable *) - VAR scope: OPT.Object; - BEGIN - scope := proc^.scope; - OPM.WriteString(Static); OPM.WriteString(Struct); OPM.WriteStringVar(scope^.name); OPM.Write(Blank); - BegBlk; - IdentList(proc^.link, 3); (* parameters *) - IdentList(scope^.scope, 3); (* local variables *) - BegStat; (* scope link field declaration *) - OPM.WriteString(Struct); OPM.WriteStringVar (scope^.name); - OPM.Write(Blank); OPM.Write(Star); OPM.WriteString(LinkName); EndStat; - EndBlk0; OPM.Write(Blank); - OPM.Write(Star); OPM.WriteStringVar (scope^.name); OPM.WriteString(GlobalScope); EndStat; OPM.WriteLn; - ProcPredefs (scope^.right, 0); - OPM.WriteLn; - END DefineInter; - - PROCEDURE EnterProc* (proc: OPT.Object); - VAR var, scope: OPT.Object; typ: OPT.Struct; dim: INTEGER; - BEGIN - IF proc^.vis # external THEN OPM.WriteString(Static) END ; - ProcHeader(proc, TRUE); - BegBlk; - - (* If there will be a result, provide a result variable. *) - IF proc^.typ # OPT.notyp THEN - BegStat; + IMPORT OPT, OPM, Configuration, SYSTEM; + + + CONST demoVersion = FALSE; + + + CONST + UndefinedType = 0; (* named type not yet defined *) + ProcessingType = 1; (* pointer type is being processed *) + PredefinedType = 2; (* for all predefined types *) + + DefinedInHdr = 3+OPM.HeaderFile; (* named type has been defined in header file *) + DefinedInBdy = 3+OPM.BodyFile; (* named type has been defined in body file *) + + BasicIncludeFile = "SYSTEM"; + + Export = "export "; (* particularily introduced for VC++ declspec() *) + Extern = "import "; (* particularily introduced for VC++ declspec() *) + LocalScope = "_s"; (* name of a local intermediate scope (variable name) *) + GlobalScope = "_s"; (* pointer to current scope extension *) + LinkName = "lnk"; (* pointer to previous scope field *) + FlagExt = "__h"; + LenExt = "__len"; + DynTypExt = "__typ"; + TagExt = "__typ"; + Tab = 9X; + + (* The following are defined as hex to avoid confusing editor syntax highlighting *) + Backslash = 5CX; + DoubleQuote = 22X; + + + VAR + indentLevel: INTEGER; + ptrinit, mainprog, ansi: BOOLEAN; + hashtab: ARRAY 105 OF SHORTINT; + keytab: ARRAY 36, 9 OF CHAR; + GlbPtrs: BOOLEAN; + BodyNameExt: ARRAY 13 OF CHAR; + + + PROCEDURE Init*; + BEGIN + indentLevel := 0; + ptrinit := OPM.ptrinit IN OPM.opt; + (*mainprog := OPM.mainprog IN OPM.opt;*) + mainprog := OPM.mainProg OR OPM.mainLinkStat; + ansi := OPM.ansi IN OPM.opt; + IF ansi THEN BodyNameExt := "__init(void)" ELSE BodyNameExt := "__init()" END + END Init; + + PROCEDURE Indent* (count: INTEGER); + BEGIN INC(indentLevel, count) + END Indent; + + PROCEDURE BegStat*; + VAR i: INTEGER; + BEGIN i := indentLevel; + WHILE i > 0 DO OPM.Write(Tab); DEC (i) END + END BegStat; + + PROCEDURE EndStat*; + BEGIN OPM.Write(';'); OPM.WriteLn + END EndStat; + + PROCEDURE BegBlk*; + BEGIN OPM.Write('{'); OPM.WriteLn; INC(indentLevel) + END BegBlk; + + PROCEDURE EndBlk*; + BEGIN DEC(indentLevel); BegStat; OPM.Write('}'); OPM.WriteLn + END EndBlk; + + PROCEDURE EndBlk0*; + BEGIN DEC(indentLevel); BegStat; OPM.Write('}') + END EndBlk0; + + PROCEDURE Str1(s: ARRAY OF CHAR; x: LONGINT); + VAR ch: CHAR; i: INTEGER; + BEGIN ch := s[0]; i := 0; + WHILE ch # 0X DO + IF ch = "#" THEN OPM.WriteInt(x) + ELSE OPM.Write(ch); + END ; + INC(i); ch := s[i] + END + END Str1; + + PROCEDURE Length(VAR s: ARRAY OF CHAR): INTEGER; + VAR i: INTEGER; + BEGIN i := 0; + WHILE s[i] # 0X DO INC(i) END ; + RETURN i + END Length; + + PROCEDURE PerfectHash (VAR s: ARRAY OF CHAR): INTEGER; + VAR i, h: INTEGER; + BEGIN i := 0; h := 0; + WHILE (s[i] # 0X) & (i < 5) DO h := 3*h + ORD(s[i]); INC(i) END; + RETURN h MOD 105 + END PerfectHash; + + PROCEDURE Ident* (obj: OPT.Object); + VAR mode, level, h: INTEGER; + BEGIN + mode := obj^.mode; level := obj^.mnolev; + IF (mode IN {OPT.Var, OPT.Typ, OPT.LProc}) & (level > 0) OR (mode IN {OPT.Fld, OPT.VarPar}) THEN + OPM.WriteStringVar(obj^.name); + h := PerfectHash(obj^.name); + IF hashtab[h] >= 0 THEN + IF keytab[hashtab[h]] = obj^.name THEN OPM.Write('_') END + END + ELSE + IF (mode # OPT.Typ) OR (obj^.linkadr # PredefinedType) THEN + IF mode = OPT.TProc THEN Ident(obj^.link^.typ^.strobj) + ELSIF level < 0 THEN (* use unaliased module name *) + OPM.WriteStringVar(OPT.GlbMod[-level].name); + IF OPM.currFile = OPM.HeaderFile THEN OPT.GlbMod[-level].vis := 1 (*include in header file*) END ; + ELSE OPM.WriteStringVar(OPM.modName) + END ; + OPM.Write('_') + ELSIF (obj = OPT.sysptrtyp^.strobj) + OR (obj = OPT.bytetyp^.strobj) THEN + OPM.WriteString("SYSTEM_") + END; + OPM.WriteStringVar(obj^.name); + END + END Ident; + + PROCEDURE Stars (typ: OPT.Struct; VAR openClause: BOOLEAN); + VAR pointers: INTEGER; + BEGIN + openClause := FALSE; + IF ((typ^.strobj = NIL) OR (typ^.strobj^.name = "")) & (typ^.comp # OPT.Record) THEN + IF typ^.comp IN {OPT.Array, OPT.DynArr} THEN + Stars (typ^.BaseTyp, openClause); + openClause := (typ^.comp = OPT.Array) + ELSIF typ^.form = OPT.ProcTyp THEN + OPM.Write('('); OPM.Write('*') + ELSE + pointers := 0; + (*WHILE (typ^.strobj = NIL) & (typ^.form = OPT.Pointer) DO INC (pointers); typ := typ^.BaseTyp END ; + IF (typ^.comp # OPT.DynArr) & (pointers # 0) THEN Stars (typ, openClause) END ;*) + WHILE ((typ^.strobj = NIL) OR (typ^.strobj^.name = "")) & (typ^.form = OPT.Pointer) DO + INC (pointers); typ := typ^.BaseTyp + END ; + IF pointers > 0 THEN + IF typ^.comp # OPT.DynArr THEN Stars (typ, openClause) END ; + IF openClause THEN OPM.Write('('); openClause := FALSE END ; + WHILE pointers > 0 DO OPM.Write('*'); DEC (pointers) END + END + END + END + END Stars; + + PROCEDURE ^AnsiParamList (obj: OPT.Object; showParamNames: BOOLEAN); + + PROCEDURE DeclareObj(dcl: OPT.Object; scopeDef: BOOLEAN); + VAR + typ: OPT.Struct; + varPar, openClause: BOOLEAN; form, comp: INTEGER; + BEGIN + typ := dcl^.typ; + varPar := ((dcl^.mode = OPT.VarPar) & (typ^.comp # OPT.Array)) OR (typ^.comp = OPT.DynArr) OR scopeDef; + Stars(typ, openClause); + IF varPar THEN + IF openClause THEN OPM.Write('(') END ; + OPM.Write('*') + END ; + IF dcl.name # "" THEN Ident(dcl) END ; + IF varPar & openClause THEN OPM.Write(')') END ; + openClause := FALSE; + LOOP + form := typ^.form; + comp := typ^.comp; + IF ((typ^.strobj # NIL) & (typ^.strobj^.name # "")) OR (form = OPT.NoTyp) OR (comp = OPT.Record) THEN EXIT + ELSIF (form = OPT.Pointer) & (typ^.BaseTyp^.comp # OPT.DynArr) THEN + openClause := TRUE + ELSIF (form = OPT.ProcTyp) OR (comp IN {OPT.Array, OPT.DynArr}) THEN + IF openClause THEN OPM.Write(')'); openClause := FALSE END ; + IF form = OPT.ProcTyp THEN + IF ansi THEN OPM.Write(")"); AnsiParamList(typ^.link, FALSE) + ELSE OPM.WriteString(")()") + END ; + EXIT + ELSIF comp = OPT.Array THEN + OPM.Write('['); OPM.WriteInt(typ^.n); OPM.Write(']') + END + ELSE + EXIT + END ; + typ := typ^.BaseTyp + END + END DeclareObj; + + PROCEDURE Andent*(typ: OPT.Struct); (* ident of possibly anonymous record type *) + BEGIN + IF (typ^.strobj = NIL) OR (typ^.align >= 10000H) THEN + OPM.WriteStringVar(OPM.modName); Str1("__#", typ^.align DIV 10000H) + ELSE Ident(typ^.strobj) + END + END Andent; + + PROCEDURE Undefined(obj: OPT.Object): BOOLEAN; + BEGIN + (* imported anonymous types have obj^.name = ""; + used e.g. for repeating inherited fields *) + RETURN (obj^.name = "") + OR (obj^.mnolev >= 0) + & (obj^.linkadr # 3+OPM.currFile ) + & (obj^.linkadr # PredefinedType) + END Undefined; + + PROCEDURE ^FieldList (typ: OPT.Struct; last: BOOLEAN; VAR off, n, curAlign: LONGINT); + + PROCEDURE DeclareBase(dcl: OPT.Object); (* declare the specifier of object dcl*) + VAR typ, prev: OPT.Struct; obj: OPT.Object; nofdims: INTEGER; off, n, dummy: LONGINT; + BEGIN + typ := dcl^.typ; prev := typ; + WHILE ((typ^.strobj = NIL) OR (typ^.comp = OPT.DynArr) OR Undefined(typ^.strobj)) + & (typ^.comp # OPT.Record) + & (typ^.form # OPT.NoTyp) + & ~((typ^.form = OPT.Pointer) & (typ^.BaseTyp^.comp = OPT.DynArr)) DO + prev := typ; typ := typ^.BaseTyp; + END ; + obj := typ^.strobj; + IF typ^.form = OPT.NoTyp THEN (* proper procedure *) + OPM.WriteString('void') + ELSIF (obj # NIL) & ~Undefined(obj) THEN (* named type, already declared *) + Ident(obj) + ELSIF typ^.comp = OPT.Record THEN + OPM.WriteString('struct '); Andent(typ); + IF (prev.form # OPT.Pointer) & ((obj # NIL) OR (dcl.name = "")) THEN + (* named record type not yet declared OR anonymous record with empty name *) + IF (typ^.BaseTyp # NIL) & (typ^.BaseTyp^.strobj.vis # OPT.internal) THEN + OPM.WriteString(" { /* "); Ident(typ^.BaseTyp^.strobj); OPM.WriteString(" */"); OPM.WriteLn; Indent(1) + ELSE OPM.Write(' '); BegBlk + END ; + FieldList(typ, TRUE, off, n, dummy); + EndBlk0 + END + ELSIF (typ^.form = OPT.Pointer) & (typ^.BaseTyp^.comp = OPT.DynArr) THEN + typ := typ^.BaseTyp^.BaseTyp; nofdims := 1; + WHILE typ^.comp = OPT.DynArr DO INC(nofdims); typ := typ^.BaseTyp END ; + OPM.WriteString('struct '); BegBlk; + BegStat; Str1("LONGINT len[#]", nofdims); EndStat; + BegStat; NEW(obj); NEW(obj.typ); (* aux. object for easy declaration *) + obj.typ.form := OPT.Comp; obj.typ.comp := OPT.Array; obj.typ.n := 1; obj.typ.BaseTyp := typ; obj.mode := OPT.Fld; obj.name := "data"; + obj.linkadr := UndefinedType; DeclareBase(obj); OPM.Write(' '); DeclareObj(obj, FALSE); + EndStat; EndBlk0 + END + END DeclareBase; + + PROCEDURE NofPtrs* (typ: OPT.Struct): LONGINT; + VAR fld: OPT.Object; btyp: OPT.Struct; n: LONGINT; + BEGIN + IF (typ^.form = OPT.Pointer) & (typ^.sysflag = 0) THEN RETURN 1 + ELSIF (typ^.comp = OPT.Record) & (typ^.sysflag MOD 100H = 0) THEN + btyp := typ^.BaseTyp; + IF btyp # NIL THEN n := NofPtrs(btyp) ELSE n := 0 END ; + fld := typ^.link; + WHILE (fld # NIL) & (fld^.mode = OPT.Fld) DO + IF fld^.name # OPM.HdPtrName THEN n := n + NofPtrs(fld^.typ) + ELSE INC(n) + END ; + fld := fld^.link + END ; + RETURN n + ELSIF typ^.comp = OPT.Array THEN + btyp := typ^.BaseTyp; n := typ^.n; + WHILE btyp^.comp = OPT.Array DO n := btyp^.n * n; btyp := btyp^.BaseTyp END ; + RETURN NofPtrs(btyp) * n + ELSE RETURN 0 + END + END NofPtrs; + + PROCEDURE PutPtrOffsets (typ: OPT.Struct; adr: LONGINT; VAR cnt: LONGINT); + VAR fld: OPT.Object; btyp: OPT.Struct; n, i: LONGINT; + BEGIN + IF (typ^.form = OPT.Pointer) & (typ^.sysflag = 0) THEN + OPM.WriteInt(adr); OPM.WriteString(", "); INC(cnt); + IF cnt MOD 16 = 0 THEN OPM.WriteLn; OPM.Write(Tab) END + ELSIF (typ^.comp = OPT.Record) & (typ^.sysflag MOD 100H = 0) THEN + btyp := typ^.BaseTyp; + IF btyp # NIL THEN PutPtrOffsets(btyp, adr, cnt) END ; + fld := typ^.link; + WHILE (fld # NIL) & (fld^.mode = OPT.Fld) DO + IF fld^.name # OPM.HdPtrName THEN PutPtrOffsets(fld^.typ, adr + fld^.adr, cnt) + ELSE + OPM.WriteInt(adr + fld^.adr); OPM.WriteString(", "); INC(cnt); + IF cnt MOD 16 = 0 THEN OPM.WriteLn; OPM.Write(Tab) END + END ; + fld := fld^.link + END + ELSIF typ^.comp = OPT.Array THEN + btyp := typ^.BaseTyp; n := typ^.n; + WHILE btyp^.comp = OPT.Array DO n := btyp^.n * n; btyp := btyp^.BaseTyp END ; + IF NofPtrs(btyp) > 0 THEN i := 0; + WHILE i < n DO PutPtrOffsets(btyp, adr + i * btyp^.size, cnt); INC(i) END + END + END + END PutPtrOffsets; + + PROCEDURE InitTProcs(typ, obj: OPT.Object); + BEGIN + IF obj # NIL THEN + InitTProcs(typ, obj^.left); + IF obj^.mode = OPT.TProc THEN + BegStat; + OPM.WriteString("__INITBP("); + Ident(typ); OPM.WriteString(', '); Ident(obj); + Str1(", #)", obj^.adr DIV 10000H); + EndStat + END ; + InitTProcs(typ, obj^.right) + END + END InitTProcs; + + PROCEDURE PutBase(typ: OPT.Struct); + BEGIN + IF typ # NIL THEN + PutBase(typ^.BaseTyp); + Ident(typ^.strobj); OPM.WriteString(DynTypExt); OPM.WriteString(", ") + END + END PutBase; + + PROCEDURE LenList(par: OPT.Object; ansiDefine, showParamName: BOOLEAN); + VAR typ: OPT.Struct; dim: INTEGER; + BEGIN + IF showParamName THEN Ident(par); OPM.WriteString(LenExt) END ; + dim := 1; typ := par^.typ^.BaseTyp; + WHILE typ^.comp = OPT.DynArr DO + IF ansiDefine THEN OPM.WriteString(", LONGINT ") ELSE OPM.WriteString(', ') END ; + IF showParamName THEN Ident(par); OPM.WriteString(LenExt); OPM.WriteInt(dim) END ; + typ := typ^.BaseTyp; INC(dim) + END + END LenList; + + PROCEDURE DeclareParams(par: OPT.Object; macro: BOOLEAN); + BEGIN + OPM.Write('('); + WHILE par # NIL DO + IF macro THEN OPM.WriteStringVar(par.name) + ELSE + IF (par^.mode = OPT.Var) & (par^.typ^.form = OPT.Real) THEN OPM.Write("_") END ; + Ident(par) + END ; + IF par^.typ^.comp = OPT.DynArr THEN + OPM.WriteString(', '); LenList(par, FALSE, TRUE); + ELSIF (par^.mode = OPT.VarPar) & (par^.typ^.comp = OPT.Record) THEN + OPM.WriteString(', '); OPM.WriteStringVar(par.name); OPM.WriteString(TagExt) + END ; + par := par^.link; + IF par # NIL THEN OPM.WriteString(', ') END + END ; + OPM.Write(')') + END DeclareParams; + + PROCEDURE ^DefineType(str: OPT.Struct); + PROCEDURE ^ProcHeader(proc: OPT.Object; define: BOOLEAN); + + PROCEDURE DefineTProcTypes(obj: OPT.Object); (* define all types that are used in a OPT.TProc definition *) + VAR par: OPT.Object; + BEGIN + IF obj^.typ # OPT.notyp THEN DefineType(obj^.typ) END ; + IF ansi THEN par := obj^.link; + WHILE par # NIL DO DefineType(par^.typ); par := par^.link END + END + END DefineTProcTypes; + + PROCEDURE DeclareTProcs(obj: OPT.Object; VAR empty: BOOLEAN); + BEGIN + IF obj # NIL THEN + DeclareTProcs(obj^.left, empty); + IF obj^.mode = OPT.TProc THEN + IF obj^.typ # OPT.notyp THEN DefineType(obj^.typ) END ; + IF OPM.currFile = OPM.HeaderFile THEN + IF obj^.vis = OPT.external THEN + DefineTProcTypes(obj); + OPM.WriteString(Extern); empty := FALSE; + ProcHeader(obj, FALSE) + END + ELSE empty := FALSE; + DefineTProcTypes(obj); + IF obj^.vis = OPT.internal THEN OPM.WriteString('static ') + ELSE OPM.WriteString(Export) + END ; + ProcHeader(obj, FALSE) + END + END ; + DeclareTProcs(obj^.right, empty) + END + END DeclareTProcs; + + PROCEDURE BaseTProc*(obj: OPT.Object): OPT.Object; + VAR typ, base: OPT.Struct; mno: LONGINT; + BEGIN typ := obj^.link^.typ; (* receiver type *) + IF typ^.form = OPT.Pointer THEN typ := typ^.BaseTyp END ; + base := typ^.BaseTyp; mno := obj^.adr DIV 10000H; + WHILE (base # NIL) & (mno < base^.n) DO typ := base; base := typ^.BaseTyp END ; + OPT.FindField(obj^.name, typ, obj); + RETURN obj + END BaseTProc; + + PROCEDURE DefineTProcMacros(obj: OPT.Object; VAR empty: BOOLEAN); + BEGIN + IF obj # NIL THEN + DefineTProcMacros(obj^.left, empty); + IF (obj^.mode = OPT.TProc) & (obj = BaseTProc(obj)) & ((OPM.currFile # OPM.HeaderFile) OR (obj^.vis = OPT.external)) THEN + OPM.WriteString("#define __"); + Ident(obj); + DeclareParams(obj^.link, TRUE); + OPM.WriteString(" __SEND("); + IF obj^.link^.typ^.form = OPT.Pointer THEN + OPM.WriteString("__TYPEOF("); Ident(obj^.link); OPM.Write(")") + ELSE Ident(obj^.link); OPM.WriteString(TagExt) + END ; + Str1(", #, ", obj^.adr DIV 10000H); + IF obj^.typ = OPT.notyp THEN OPM.WriteString('void') ELSE Ident(obj^.typ^.strobj) END ; + OPM.WriteString("(*)"); + IF ansi THEN + AnsiParamList(obj^.link, FALSE); + ELSE + OPM.WriteString("()"); + END ; + OPM.WriteString(", "); + DeclareParams(obj^.link, TRUE); + OPM.Write(")"); OPM.WriteLn + END ; + DefineTProcMacros(obj^.right, empty) + END + END DefineTProcMacros; + + PROCEDURE DefineType(str: OPT.Struct); (* define a type object *) + VAR obj, field, par: OPT.Object; empty: BOOLEAN; + BEGIN + IF (OPM.currFile = OPM.BodyFile) OR (str^.ref < OPM.MaxStruct (*for hidden exports*) ) THEN + obj := str^.strobj; + IF (obj = NIL) OR Undefined(obj) THEN + IF obj # NIL THEN (* check for cycles *) + IF obj^.linkadr = ProcessingType THEN + IF str^.form # OPT.Pointer THEN OPM.Mark(244, str^.txtpos); obj^.linkadr := PredefinedType END + ELSE obj^.linkadr := ProcessingType + END + END ; + IF str^.comp = OPT.Record THEN + (* the following exports the base type of an exported type even if the former is non-exported *) + IF str^.BaseTyp # NIL THEN DefineType(str^.BaseTyp) END ; + field := str^.link; + WHILE (field # NIL) & (field^.mode = OPT.Fld) DO + IF (field^.vis # OPT.internal) OR (OPM.currFile = OPM.BodyFile) THEN DefineType(field^.typ) END ; + field := field^.link + END + ELSIF str^.form = OPT.Pointer THEN + IF str^.BaseTyp^.comp # OPT.Record THEN DefineType(str^.BaseTyp) END + ELSIF str^.comp IN {OPT.Array, OPT.DynArr} THEN + DefineType(str^.BaseTyp) + ELSIF str^.form = OPT.ProcTyp THEN + IF str^.BaseTyp # OPT.notyp THEN DefineType(str^.BaseTyp) END ; + field := str^.link; + WHILE field # NIL DO DefineType(field^.typ); field := field^.link END + END + END ; + IF (obj # NIL) & Undefined(obj) THEN + OPM.WriteString("typedef"); OPM.WriteLn; OPM.Write(Tab); Indent(1); + obj^.linkadr := ProcessingType; + DeclareBase(obj); OPM.Write(' '); + obj^.typ^.strobj := NIL; (* SG: trick to make DeclareObj declare the type *) + DeclareObj(obj, FALSE); + obj^.typ^.strobj := obj; (* SG: revert trick *) + obj^.linkadr := 3+OPM.currFile; + EndStat; Indent(-1); OPM.WriteLn; + IF obj^.typ^.comp = OPT.Record THEN empty := TRUE; + DeclareTProcs(str^.link, empty); DefineTProcMacros(str^.link, empty); + IF ~empty THEN OPM.WriteLn END + END + END + END + END DefineType; + + PROCEDURE Prefixed(x: OPT.ConstExt; y: ARRAY OF CHAR): BOOLEAN; + VAR i: INTEGER; r: BOOLEAN; + BEGIN i := 0; + WHILE x[i+1] = y[i] DO INC(i) END ; + r := y[i] = 0X; + RETURN r; + END Prefixed; + + PROCEDURE CProcDefs(obj: OPT.Object; vis: INTEGER); + VAR i: INTEGER; ext: OPT.ConstExt; + BEGIN + IF obj # NIL THEN + CProcDefs(obj^.left, vis); + (* bug: obj.history cannot be used to cover unexported and deleted CProcs; use special flag obj.adr = 1 *) + IF (obj^.mode = OPT.CProc) & (obj^.vis >= vis) & (obj^.adr = 1) THEN + ext := obj.conval.ext; i := 1; + IF (ext[1] # "#") & ~(Prefixed(ext, "extern ") OR Prefixed(ext, Extern)) THEN + OPM.WriteString("#define "); Ident(obj); + DeclareParams(obj^.link, TRUE); + OPM.Write(Tab); + END ; + FOR i := i TO ORD(obj.conval.ext[0]) DO OPM.Write(obj.conval.ext[i]) END; + OPM.WriteLn + END ; + CProcDefs(obj^.right, vis) + END + END CProcDefs; + + PROCEDURE TypeDefs* (obj: OPT.Object; vis(*replaced by test on currFile in DefineType*): INTEGER); + BEGIN + IF obj # NIL THEN + TypeDefs(obj^.left, vis); + (* test typ.txtpos to skip types that have been unexported; obj.history # removed is not enough!*) + IF (obj^.mode = OPT.Typ) & (obj^.typ^.txtpos > 0) THEN DefineType(obj^.typ) END ; + TypeDefs(obj^.right, vis) + END + END TypeDefs; + + PROCEDURE DefAnonRecs(n: OPT.Node); + VAR o: OPT.Object; typ: OPT.Struct; + BEGIN + WHILE (n # NIL) & (n^.class = OPT.Ninittd) DO + typ := n^.typ; + IF (typ^.strobj = NIL) & ((OPM.currFile = OPM.BodyFile) OR (typ.ref < OPM.MaxStruct)) THEN + DefineType(typ); (* declare base and field types, if any *) + NEW(o); o.typ := typ; o.name := ""; DeclareBase(o); EndStat; OPM.WriteLn + (* simply defines a named struct, but not a type; + o.name = "" signals field list expansion for DeclareBase in this very special case *) + END ; + n := n^.link + END + END DefAnonRecs; + + PROCEDURE TDescDecl* (typ: OPT.Struct); + VAR nofptrs: LONGINT; + o: OPT.Object; + BEGIN + BegStat; OPM.WriteString("__TDESC("); + Andent(typ); + Str1(", #", typ^.n + 1); Str1(", #) = {__TDFLDS(", NofPtrs(typ)); + OPM.Write(DoubleQuote); + IF typ^.strobj # NIL THEN OPM.WriteStringVar(typ^.strobj^.name) END ; + OPM.Write(DoubleQuote); + Str1(', #), {', typ^.size); + nofptrs := 0; PutPtrOffsets(typ, 0, nofptrs); Str1("#}}", -(nofptrs + 1) * OPM.LIntSize); + EndStat + END TDescDecl; + + PROCEDURE InitTDesc*(typ: OPT.Struct); + BEGIN + BegStat; OPM.WriteString("__INITYP("); + Andent(typ); OPM.WriteString(", "); + IF typ^.BaseTyp # NIL THEN Andent(typ^.BaseTyp) ELSE Andent(typ) END ; + Str1(", #)", typ^.extlev); + EndStat; + IF typ^.strobj # NIL THEN InitTProcs(typ^.strobj, typ^.link) END + END InitTDesc; + + PROCEDURE Align*(VAR adr: LONGINT; base: LONGINT); + BEGIN + CASE base OF + | 2: INC(adr, adr MOD 2) + | 4: INC(adr, (-adr) MOD 4) + | 8: INC(adr, (-adr) MOD 8) + | 16: INC(adr, (-adr) MOD 16) + ELSE (*1*) (*OPM.LogWStr("unhandled case at OPC.Align, base = "); OPM.LogWNum(base, 0); OPM.LogWLn;*) + END + END Align; + + PROCEDURE SizeAlignment*(size: LONGINT): LONGINT; + VAR alignment: LONGINT; + BEGIN + IF size < OPM.Alignment THEN + (* Round up to next power of 2 *) + alignment := 1; WHILE alignment < size DO alignment := alignment * 2 END; + ELSE + alignment := OPM.Alignment + END; + RETURN alignment + END SizeAlignment; + + PROCEDURE BaseAlignment*(typ: OPT.Struct): LONGINT; + VAR alignment: LONGINT; + BEGIN + IF typ.form = OPT.Comp THEN + IF typ.comp = OPT.Record THEN + alignment := typ.align MOD 10000H + ELSE + alignment := BaseAlignment(typ.BaseTyp) + END + ELSE + alignment := SizeAlignment(typ.size) + END; + RETURN alignment + END BaseAlignment; + + + PROCEDURE FillGap(gap, off, align: LONGINT; VAR n, curAlign: LONGINT); + VAR adr: LONGINT; + BEGIN + adr := off; Align(adr, align); + IF (curAlign < align) & (gap - (adr - off) >= align) THEN (* preserve alignment of the enclosing struct! *) + DEC(gap, (adr - off) + align); + BegStat; + IF align = OPM.IntSize THEN OPM.WriteString("INTEGER") + ELSIF align = OPM.LIntSize THEN OPM.WriteString("LONGINT") + ELSIF align = OPM.LRealSize THEN OPM.WriteString("LONGREAL") + END ; + Str1(" _prvt#", n); INC(n); EndStat; + curAlign := align + END ; + IF gap > 0 THEN BegStat; Str1("char _prvt#", n); INC(n); Str1("[#]", gap); EndStat END + END FillGap; + + PROCEDURE FieldList (typ: OPT.Struct; last: BOOLEAN; VAR off, n, curAlign: LONGINT); + VAR fld: OPT.Object; base: OPT.Struct; gap, adr, align, fldAlign: LONGINT; + BEGIN + fld := typ.link; align := typ^.align MOD 10000H; + IF typ.BaseTyp # NIL THEN FieldList(typ.BaseTyp, FALSE, off, n, curAlign) + ELSE off := 0; n := 0; curAlign := 1 + END ; + WHILE (fld # NIL) & (fld.mode = OPT.Fld) DO + IF (OPM.currFile = OPM.HeaderFile) & (fld.vis = OPT.internal) OR + (OPM.currFile = OPM.BodyFile) & (fld.vis = OPT.internal) & (typ^.mno # 0) THEN + fld := fld.link; + WHILE (fld # NIL) & (fld.mode = OPT.Fld) & (fld.vis = OPT.internal) DO fld := fld.link END ; + ELSE + (* mimic OPV.TypSize to detect gaps caused by private fields *) + adr := off; fldAlign := BaseAlignment(fld^.typ); Align(adr, fldAlign); + gap := fld.adr - adr; + IF fldAlign > curAlign THEN curAlign := fldAlign END ; + IF gap > 0 THEN FillGap(gap, off, align, n, curAlign) END ; + BegStat; DeclareBase(fld); OPM.Write(' '); DeclareObj(fld, FALSE); + off := fld.adr + fld.typ.size; base := fld.typ; fld := fld.link; + WHILE (fld # NIL) & (fld.mode = OPT.Fld) & (fld.typ = base) & (fld.adr = off) +(* ?? *) & ((OPM.currFile = OPM.BodyFile) OR (fld.vis # OPT.internal) OR (fld.typ.strobj = NIL)) DO + OPM.WriteString(", "); DeclareObj(fld, FALSE); off := fld.adr + fld.typ.size; fld := fld.link + END ; + EndStat + END + END ; + IF last THEN + adr := typ.size - typ^.sysflag DIV 100H; + IF adr = 0 THEN gap := 1 (* avoid empty struct *) ELSE gap := adr - off END ; + IF gap > 0 THEN FillGap(gap, off, align, n, curAlign) END + END + END FieldList; + + PROCEDURE IdentList (obj: OPT.Object; vis: INTEGER); + (* generate var and param lists; vis: 0 all global vars, local var, 1 exported(R) var, 2 par list, 3 scope var *) + VAR base: OPT.Struct; first: BOOLEAN; lastvis: INTEGER; + BEGIN + base := NIL; first := TRUE; + WHILE (obj # NIL) & (obj^.mode # OPT.TProc) DO + IF (vis IN {0, 2}) OR ((vis = 1) & (obj^.vis # 0)) OR ((vis = 3) & ~obj^.leaf) THEN + IF (obj^.typ # base) OR (obj^.vis # lastvis) THEN (* new variable base type definition required *) + IF ~first THEN EndStat END ; + first := FALSE; + base := obj^.typ; lastvis := obj^.vis; + BegStat; + IF (vis = 1) & (obj^.vis # OPT.internal) THEN OPM.WriteString(Extern) + ELSIF (obj^.mnolev = 0) & (vis = 0) THEN + IF obj^.vis = OPT.internal THEN OPM.WriteString('static ') + ELSE OPM.WriteString(Export) + END + END ; + IF (vis = 2) & (obj^.mode = OPT.Var) & (base^.form = OPT.Real) THEN OPM.WriteString("double") + ELSE DeclareBase(obj) + END + ELSE OPM.Write(","); + END ; + OPM.Write(' '); + IF (vis = 2) & (obj^.mode = OPT.Var) & (base^.form = OPT.Real) THEN OPM.Write("_") END ; + DeclareObj(obj, vis = 3); + IF obj^.typ^.comp = OPT.DynArr THEN (* declare len parameter(s) *) + EndStat; BegStat; + base := OPT.linttyp; + OPM.WriteString("LONGINT "); LenList(obj, FALSE, TRUE) + ELSIF (obj^.mode = OPT.VarPar) & (obj^.typ^.comp = OPT.Record) THEN + EndStat; BegStat; + OPM.WriteString("LONGINT *"); Ident(obj); OPM.WriteString(TagExt); + base := NIL + ELSIF ptrinit & (vis = 0) & (obj^.mnolev > 0) & (obj^.typ^.form = OPT.Pointer) THEN + OPM.WriteString(" = NIL") + END + END ; + obj := obj^.link + END ; + IF ~first THEN EndStat END + END IdentList; + + PROCEDURE AnsiParamList (obj: OPT.Object; showParamNames: BOOLEAN); + VAR name: ARRAY 32 OF CHAR; + BEGIN + OPM.Write("("); + IF (obj = NIL) OR (obj^.mode = OPT.TProc) THEN OPM.WriteString("void") + ELSE + LOOP + DeclareBase(obj); + IF showParamNames THEN + OPM.Write(' '); DeclareObj(obj, FALSE) + ELSE + COPY(obj^.name, name); obj^.name := ""; DeclareObj(obj, FALSE); COPY(name, obj^.name) + END ; + IF obj^.typ^.comp = OPT.DynArr THEN + OPM.WriteString(", LONGINT "); + LenList(obj, TRUE, showParamNames) + ELSIF (obj^.mode = OPT.VarPar) & (obj^.typ^.comp = OPT.Record) THEN + OPM.WriteString(", LONGINT *"); + IF showParamNames THEN Ident(obj); OPM.WriteString(TagExt) END + END ; + IF (obj^.link = NIL) OR (obj^.link.mode = OPT.TProc) THEN EXIT END ; + OPM.WriteString(", "); + obj := obj^.link + END + END ; + OPM.Write(")") + END AnsiParamList; + + PROCEDURE ProcHeader(proc: OPT.Object; define: BOOLEAN); + BEGIN + IF proc^.typ = OPT.notyp THEN OPM.WriteString('void') ELSE Ident(proc^.typ^.strobj) END ; + OPM.Write(' '); Ident(proc); OPM.Write(' '); + IF ansi THEN + AnsiParamList(proc^.link, TRUE); + IF ~define THEN OPM.Write(";") END ; + OPM.WriteLn; + ELSIF define THEN + DeclareParams(proc^.link, FALSE); + OPM.WriteLn; + Indent(1); IdentList(proc^.link, 2(* map REAL to double *)); Indent(-1) + ELSE OPM.WriteString("();"); OPM.WriteLn + END + END ProcHeader; + + PROCEDURE ProcPredefs (obj: OPT.Object; vis: SHORTINT); (* forward declaration of procedures *) + BEGIN + IF obj # NIL THEN + ProcPredefs(obj^.left, vis); + IF (obj^.mode IN {OPT.LProc, OPT.XProc}) & (obj^.vis >= vis) & ((obj^.history # OPT.removed) OR (obj^.mode = OPT.LProc)) THEN + (* previous OPT.XProc may be deleted or become OPT.LProc after interface change*) + IF vis = OPT.external THEN OPM.WriteString(Extern) + ELSIF obj^.vis = OPT.internal THEN OPM.WriteString('static ') + ELSE OPM.WriteString(Export) + END ; + ProcHeader(obj, FALSE); + END ; + ProcPredefs(obj^.right, vis); + END; + END ProcPredefs; + + PROCEDURE Include(name: ARRAY OF CHAR); + BEGIN + OPM.WriteString("#include "); OPM.Write(DoubleQuote); OPM.WriteStringVar(name); + OPM.WriteString(".h"); OPM.Write(DoubleQuote); OPM.WriteLn + END Include; + + PROCEDURE IncludeImports(obj: OPT.Object; vis: INTEGER); + BEGIN + IF obj # NIL THEN + IncludeImports(obj^.left, vis); + IF (obj^.mode = OPT.Mod) & (obj^.mnolev # 0) & (OPT.GlbMod[-obj^.mnolev].vis >= vis) THEN (* @self and SYSTEM have mnolev = 0 *) + Include(OPT.GlbMod[-obj^.mnolev].name) (* use unaliased module name *) + END; + IncludeImports(obj^.right, vis); + END; + END IncludeImports; + + PROCEDURE GenDynTypes (n: OPT.Node; vis: INTEGER); + VAR typ: OPT.Struct; + BEGIN + WHILE (n # NIL) & (n^.class = OPT.Ninittd) DO + typ := n^.typ; + IF (vis = OPT.internal) OR (typ^.ref < OPM.MaxStruct (*type needed in symbol file*)) THEN + BegStat; + IF vis = OPT.external THEN OPM.WriteString(Extern) + ELSIF (typ^.strobj # NIL) & (typ^.strobj^.mnolev > 0) THEN OPM.WriteString('static ') + ELSE OPM.WriteString(Export) + END ; + OPM.WriteString("LONGINT *"); Andent(typ); OPM.WriteString(DynTypExt); + EndStat + END ; + n := n^.link + END + END GenDynTypes; + + PROCEDURE GenHdr*(n: OPT.Node); + BEGIN + (* includes are delayed until it is known which ones are needed in the header *) + OPM.currFile := OPM.HeaderFile; + DefAnonRecs(n); + TypeDefs(OPT.topScope^.right, 1); OPM.WriteLn; + IdentList(OPT.topScope^.scope, 1); OPM.WriteLn; + GenDynTypes(n, OPT.external); OPM.WriteLn; + ProcPredefs(OPT.topScope^.right, 1); + OPM.WriteString(Extern); OPM.WriteString("void *"); + OPM.WriteStringVar(OPM.modName); OPM.WriteString(BodyNameExt); + EndStat; OPM.WriteLn; + CProcDefs(OPT.topScope^.right, 1); OPM.WriteLn; + OPM.WriteString("#endif"); OPM.WriteLn + END GenHdr; + + PROCEDURE GenHeaderMsg; + VAR i: INTEGER; + BEGIN + OPM.WriteString("/* "); OPM.WriteString(Configuration.name); + OPM.Write(" "); OPM.WriteString(Configuration.versionLong); OPM.Write (" "); (* noch *) + FOR i := 0 TO MAX(SET) DO + IF i IN OPM.glbopt THEN + CASE i OF (* c.f. ScanOptions in OPM *) + | OPM.inxchk: OPM.Write("x") + | OPM.ranchk: OPM.Write("r") + | OPM.typchk: OPM.Write("t") + | OPM.newsf: OPM.Write("s") + | OPM.ptrinit: OPM.Write("p") + | OPM.ansi: OPM.Write("k") + | OPM.assert: OPM.Write("a") + | OPM.extsf: OPM.Write("e") + | OPM.mainprog: OPM.Write("m") + | OPM.dontasm: OPM.Write("S") + | OPM.dontlink: OPM.Write("c") + | OPM.mainlinkstat: OPM.Write("M") + | OPM.notcoloroutput: OPM.Write("f") + | OPM.forcenewsym: OPM.Write("F") + | OPM.verbose: OPM.Write("v") + ELSE OPM.LogWStr ("( more options defined in OPM than checked in OPC.GenHeaderMsg, if you are a compiler developer, add them to OPC.GenHeaderMsg"); OPM.LogWLn; + END + END + END; + OPM.WriteString(" */"); OPM.WriteLn + END GenHeaderMsg; + + PROCEDURE GenHdrIncludes*; + BEGIN + OPM.currFile := OPM.HeaderInclude; + GenHeaderMsg; + OPM.WriteLn; + OPM.WriteString("#ifndef "); OPM.WriteStringVar(OPM.modName); OPM.WriteString(FlagExt); OPM.WriteLn; + OPM.WriteString("#define "); OPM.WriteStringVar(OPM.modName); OPM.WriteString(FlagExt); OPM.WriteLn; + OPM.WriteLn; + IF OPM.LIntSize = 8 THEN OPM.WriteString("#define LARGE"); OPM.WriteLn END; + Include(BasicIncludeFile); + IncludeImports(OPT.topScope^.right, 1); OPM.WriteLn + END GenHdrIncludes; + + PROCEDURE GenBdy*(n: OPT.Node); + BEGIN + OPM.currFile := OPM.BodyFile; + GenHeaderMsg; + IF OPM.LIntSize = 8 THEN OPM.WriteString("#define LARGE"); OPM.WriteLn END; + Include(BasicIncludeFile); + IncludeImports(OPT.topScope^.right, 0); OPM.WriteLn; + DefAnonRecs(n); + TypeDefs(OPT.topScope^.right, 0); OPM.WriteLn; + IdentList(OPT.topScope^.scope, 0); OPM.WriteLn; + GenDynTypes(n, OPT.internal); OPM.WriteLn; + ProcPredefs(OPT.topScope^.right, 0); OPM.WriteLn; + CProcDefs(OPT.topScope^.right, 0); OPM.WriteLn + END GenBdy; + + PROCEDURE RegCmds(obj: OPT.Object); + BEGIN + IF obj # NIL THEN + RegCmds(obj^.left); + IF (obj^.mode = OPT.XProc) & (obj^.history # OPT.removed) THEN + IF (obj^.vis # 0) & (obj^.link = NIL) & (obj^.typ = OPT.notyp) THEN (*command*) + BegStat; OPM.WriteString('__REGCMD("'); + OPM.WriteStringVar(obj.name); OPM.WriteString('", '); Ident(obj); OPM.Write(")"); EndStat + END + END ; + RegCmds(obj^.right) + END + END RegCmds; + + PROCEDURE InitImports(obj: OPT.Object); + BEGIN + IF obj # NIL THEN + InitImports(obj^.left); + IF (obj^.mode = OPT.Mod) & (obj^.mnolev # 0) THEN + BegStat; OPM.WriteString("__MODULE_IMPORT("); + OPM.WriteStringVar(OPT.GlbMod[-obj^.mnolev].name); + OPM.Write(')'); EndStat + END ; + InitImports(obj^.right) + END + END InitImports; + + PROCEDURE GenEnumPtrs* (var: OPT.Object); + VAR typ: OPT.Struct; n: LONGINT; + BEGIN GlbPtrs := FALSE; + WHILE var # NIL DO + typ := var^.typ; + IF NofPtrs(typ) > 0 THEN + IF ~GlbPtrs THEN GlbPtrs := TRUE; + OPM.WriteString('static '); + IF ansi THEN + OPM.WriteString("void EnumPtrs(void (*P)(void*))") + ELSE + OPM.WriteString("void EnumPtrs(P)"); OPM.WriteLn; + OPM.Write(Tab); OPM.WriteString("void (*P)();"); + END ; + OPM.WriteLn; + BegBlk + END ; + BegStat; + IF typ^.form = OPT.Pointer THEN + OPM.WriteString("P("); Ident(var); OPM.Write(")"); + ELSIF typ^.comp = OPT.Record THEN + OPM.WriteString("__ENUMR(&"); Ident(var); OPM.WriteString(", "); + Andent(typ); OPM.WriteString(DynTypExt); Str1(", #", typ^.size); OPM.WriteString(", 1, P)") + ELSIF typ^.comp = OPT.Array THEN + n := typ^.n; typ := typ^.BaseTyp; + WHILE typ^.comp = OPT.Array DO n := n * typ^.n; typ := typ^.BaseTyp END ; + IF typ^.form = OPT.Pointer THEN + OPM.WriteString("__ENUMP("); Ident(var); Str1(", #, P)", n) + ELSIF typ^.comp = OPT.Record THEN + OPM.WriteString("__ENUMR("); Ident(var); OPM.WriteString(", "); + Andent(typ); OPM.WriteString(DynTypExt); Str1(", #", typ^.size); Str1(", #, P)", n) + END + END ; + EndStat + END ; + var := var^.link + END ; + IF GlbPtrs THEN + EndBlk; OPM.WriteLn + END + END GenEnumPtrs; + + PROCEDURE EnterBody*; + BEGIN + OPM.WriteLn; OPM.WriteString(Export); + IF mainprog THEN + IF ansi THEN + OPM.WriteString("int main(int argc, char **argv)"); OPM.WriteLn; + ELSE + OPM.WriteString("main(argc, argv)"); OPM.WriteLn; + OPM.Write(Tab); OPM.WriteString("int argc; char **argv;"); OPM.WriteLn + END + ELSE + OPM.WriteString("void *"); + OPM.WriteString(OPM.modName); OPM.WriteString(BodyNameExt); OPM.WriteLn; + END ; + BegBlk; BegStat; + IF mainprog THEN OPM.WriteString("__INIT(argc, argv)") ELSE OPM.WriteString("__DEFMOD") END ; + EndStat; + IF mainprog & demoVersion THEN BegStat; + OPM.WriteString('/*don`t do it!*/ printf("DEMO VERSION: DO NOT USE THIS PROGRAM FOR ANY COMMERCIAL PURPOSE\n")'); + EndStat + END ; + InitImports(OPT.topScope^.right); + BegStat; + IF mainprog THEN OPM.WriteString('__REGMAIN("') ELSE OPM.WriteString('__REGMOD("') END ; + OPM.WriteString(OPM.modName); + IF GlbPtrs THEN OPM.WriteString('", EnumPtrs)') ELSE OPM.WriteString('", 0)') END ; + EndStat; + IF OPM.modName # "SYSTEM" THEN RegCmds(OPT.topScope) END + END EnterBody; + + PROCEDURE ExitBody*; + BEGIN + BegStat; + IF mainprog THEN OPM.WriteString("__FINI;") ELSE OPM.WriteString("__ENDMOD;") END ; + OPM.WriteLn; EndBlk + END ExitBody; + + PROCEDURE DefineInter* (proc: OPT.Object); (* define intermediate scope record and variable *) + VAR scope: OPT.Object; + BEGIN + scope := proc^.scope; + OPM.WriteString('static '); OPM.WriteString('struct '); OPM.WriteStringVar(scope^.name); OPM.Write(' '); + BegBlk; + IdentList(proc^.link, 3); (* parameters *) + IdentList(scope^.scope, 3); (* local variables *) + BegStat; (* scope link field declaration *) + OPM.WriteString('struct '); OPM.WriteStringVar (scope^.name); + OPM.Write(' '); OPM.Write('*'); OPM.WriteString(LinkName); EndStat; + EndBlk0; OPM.Write(' '); + OPM.Write('*'); OPM.WriteStringVar (scope^.name); OPM.WriteString(GlobalScope); EndStat; OPM.WriteLn; + ProcPredefs (scope^.right, 0); + OPM.WriteLn; + END DefineInter; + + PROCEDURE EnterProc* (proc: OPT.Object); + VAR var, scope: OPT.Object; typ: OPT.Struct; dim: INTEGER; + BEGIN + IF proc^.vis # OPT.external THEN OPM.WriteString('static ') END ; + ProcHeader(proc, TRUE); + BegBlk; + + (* If there will be a result, provide a result variable. *) + IF proc^.typ # OPT.notyp THEN + BegStat; Ident(proc^.typ^.strobj); OPM.WriteString(" _o_result;"); OPM.WriteLn; END; - scope := proc^.scope; - IdentList(scope^.scope, 0); - IF ~scope^.leaf THEN (* declare intermediate procedure scope record variable*) - BegStat; OPM.WriteString(Struct); OPM.WriteStringVar (scope^.name); - OPM.Write(Blank); OPM.WriteString(LocalScope); EndStat - END ; - var := proc^.link; - WHILE var # NIL DO (* declare copy of fixed size value array parameters *) - IF (var^.typ^.comp = Array) & (var^.mode = Var) THEN - BegStat; - IF var^.typ^.strobj = NIL THEN OPM.Mark(200, var^.typ^.txtpos) ELSE Ident(var^.typ^.strobj) END ; - OPM.Write(Blank); Ident(var); OPM.WriteString("__copy"); - EndStat - END ; - var := var^.link - END ; - IF ~ansi THEN - var := proc^.link; - WHILE var # NIL DO (* "unpromote" value real parameters *) - IF (var^.typ^.form = Real) & (var^.mode = Var) THEN - BegStat; - Ident(var^.typ^.strobj); OPM.Write(Blank); Ident(var); OPM.WriteString(" = _"); Ident(var); - EndStat - END ; - var := var^.link - END - END ; - var := proc^.link; - WHILE var # NIL DO (* copy value array parameters *) - IF (var^.typ^.comp IN {Array, DynArr}) & (var^.mode = Var) & (var^.typ^.sysflag = 0) THEN - BegStat; - IF var^.typ^.comp = Array THEN - OPM.WriteString(DupArrFunc); - Ident(var); OPM.WriteString(Comma); - IF var^.typ^.strobj = NIL THEN OPM.Mark(200, var^.typ^.txtpos) ELSE Ident(var^.typ^.strobj) END - ELSE - OPM.WriteString(DupFunc); - Ident(var); OPM.WriteString(Comma); Ident(var); OPM.WriteString(LenExt); - typ := var^.typ^.BaseTyp; dim := 1; - WHILE typ^.comp = DynArr DO - OPM.WriteString(" * "); Ident(var); OPM.WriteString(LenExt); OPM.WriteInt(dim); - typ := typ^.BaseTyp; INC(dim) - END ; - OPM.WriteString(Comma); - IF (typ^.strobj = NIL) THEN OPM.Mark(200, typ^.txtpos) - ELSE Ident(typ^.strobj) - END - END ; - OPM.Write(CloseParen); EndStat - END ; - var := var^.link - END ; - IF ~scope^.leaf THEN - var := proc^.link; (* copy addresses of parameters into local scope record *) - WHILE var # NIL DO - IF ~var^.leaf THEN (* only if used by a nested procedure *) - BegStat; - OPM.WriteString(LocalScope); OPM.Write(Dot); Ident(var); - OPM.WriteString(Becomes); - IF var^.typ^.comp IN {Array, DynArr} THEN OPM.WriteString("(void*)") - (* K&R and ANSI differ in the type: array or element type*) - ELSIF var^.mode # VarPar THEN OPM.Write("&") - END ; - Ident(var); - IF var^.typ^.comp = DynArr THEN - typ := var^.typ; dim := 0; - REPEAT (* copy len(s) *) - OPM.WriteString("; "); - OPM.WriteString(LocalScope); OPM.Write(Dot); Ident(var); OPM.WriteString(LenExt); - IF dim # 0 THEN OPM.WriteInt(dim) END ; - OPM.WriteString(Becomes); Ident(var); OPM.WriteString(LenExt); - IF dim # 0 THEN OPM.WriteInt(dim) END ; - typ := typ^.BaseTyp - UNTIL typ^.comp # DynArr; - ELSIF (var^.mode = VarPar) & (var^.typ^.comp = Record) THEN - OPM.WriteString("; "); - OPM.WriteString(LocalScope); OPM.Write(Dot); Ident(var); OPM.WriteString(TagExt); - OPM.WriteString(Becomes); Ident(var); OPM.WriteString(TagExt) - END ; - EndStat - END; - var := var^.link; - END; - var := scope^.scope; (* copy addresses of local variables into scope record *) - WHILE var # NIL DO - IF ~var^.leaf THEN (* only if used by a nested procedure *) - BegStat; - OPM.WriteString(LocalScope); OPM.Write(Dot); Ident(var); OPM.WriteString(Becomes); - IF var^.typ^.comp # Array THEN OPM.Write("&") - ELSE OPM.WriteString("(void*)") (* K&R and ANSI differ in the type: array or element type*) - END ; - Ident(var); EndStat - END ; - var := var^.link - END; - (* now link new scope *) - BegStat; OPM.WriteString(LocalScope); OPM.Write(Dot); OPM.WriteString(LinkName); - OPM.WriteString(Becomes); OPM.WriteStringVar(scope^.name); OPM.WriteString(GlobalScope); EndStat; - BegStat; OPM.WriteStringVar(scope^.name); OPM.WriteString(GlobalScope); OPM.WriteString(Becomes); - OPM.Write("&"); OPM.WriteString(LocalScope); EndStat - END - END EnterProc; + scope := proc^.scope; + IdentList(scope^.scope, 0); + IF ~scope^.leaf THEN (* declare intermediate procedure scope record variable*) + BegStat; OPM.WriteString('struct '); OPM.WriteStringVar (scope^.name); + OPM.Write(' '); OPM.WriteString(LocalScope); EndStat + END ; + var := proc^.link; + WHILE var # NIL DO (* declare copy of fixed size value array parameters *) + IF (var^.typ^.comp = OPT.Array) & (var^.mode = OPT.Var) THEN + BegStat; + IF var^.typ^.strobj = NIL THEN OPM.Mark(200, var^.typ^.txtpos) ELSE Ident(var^.typ^.strobj) END ; + OPM.Write(' '); Ident(var); OPM.WriteString("__copy"); + EndStat + END ; + var := var^.link + END ; + IF ~ansi THEN + var := proc^.link; + WHILE var # NIL DO (* "unpromote" value real parameters *) + IF (var^.typ^.form = OPT.Real) & (var^.mode = OPT.Var) THEN + BegStat; + Ident(var^.typ^.strobj); OPM.Write(' '); Ident(var); OPM.WriteString(" = _"); Ident(var); + EndStat + END ; + var := var^.link + END + END ; + var := proc^.link; + WHILE var # NIL DO (* copy value array parameters *) + IF (var^.typ^.comp IN {OPT.Array, OPT.DynArr}) & (var^.mode = OPT.Var) & (var^.typ^.sysflag = 0) THEN + BegStat; + IF var^.typ^.comp = OPT.Array THEN + OPM.WriteString("__DUPARR("); + Ident(var); OPM.WriteString(', '); + IF var^.typ^.strobj = NIL THEN OPM.Mark(200, var^.typ^.txtpos) ELSE Ident(var^.typ^.strobj) END + ELSE + OPM.WriteString('__DUP('); + Ident(var); OPM.WriteString(', '); Ident(var); OPM.WriteString(LenExt); + typ := var^.typ^.BaseTyp; dim := 1; + WHILE typ^.comp = OPT.DynArr DO + OPM.WriteString(" * "); Ident(var); OPM.WriteString(LenExt); OPM.WriteInt(dim); + typ := typ^.BaseTyp; INC(dim) + END ; + OPM.WriteString(', '); + IF (typ^.strobj = NIL) THEN OPM.Mark(200, typ^.txtpos) + ELSE Ident(typ^.strobj) + END + END ; + OPM.Write(')'); EndStat + END ; + var := var^.link + END ; + IF ~scope^.leaf THEN + var := proc^.link; (* copy addresses of parameters into local scope record *) + WHILE var # NIL DO + IF ~var^.leaf THEN (* only if used by a nested procedure *) + BegStat; + OPM.WriteString(LocalScope); OPM.Write('.'); Ident(var); + OPM.WriteString(' = '); + IF var^.typ^.comp IN {OPT.Array, OPT.DynArr} THEN OPM.WriteString("(void*)") + (* K&R and ANSI differ in the type: array or element type*) + ELSIF var^.mode # OPT.VarPar THEN OPM.Write("&") + END ; + Ident(var); + IF var^.typ^.comp = OPT.DynArr THEN + typ := var^.typ; dim := 0; + REPEAT (* copy len(s) *) + OPM.WriteString("; "); + OPM.WriteString(LocalScope); OPM.Write('.'); Ident(var); OPM.WriteString(LenExt); + IF dim # 0 THEN OPM.WriteInt(dim) END ; + OPM.WriteString(' = '); Ident(var); OPM.WriteString(LenExt); + IF dim # 0 THEN OPM.WriteInt(dim) END ; + typ := typ^.BaseTyp + UNTIL typ^.comp # OPT.DynArr; + ELSIF (var^.mode = OPT.VarPar) & (var^.typ^.comp = OPT.Record) THEN + OPM.WriteString("; "); + OPM.WriteString(LocalScope); OPM.Write('.'); Ident(var); OPM.WriteString(TagExt); + OPM.WriteString(' = '); Ident(var); OPM.WriteString(TagExt) + END ; + EndStat + END; + var := var^.link; + END; + var := scope^.scope; (* copy addresses of local variables into scope record *) + WHILE var # NIL DO + IF ~var^.leaf THEN (* only if used by a nested procedure *) + BegStat; + OPM.WriteString(LocalScope); OPM.Write('.'); Ident(var); OPM.WriteString(' = '); + IF var^.typ^.comp # OPT.Array THEN OPM.Write("&") + ELSE OPM.WriteString("(void*)") (* K&R and ANSI differ in the type: array or element type*) + END ; + Ident(var); EndStat + END ; + var := var^.link + END; + (* now link new scope *) + BegStat; OPM.WriteString(LocalScope); OPM.Write('.'); OPM.WriteString(LinkName); + OPM.WriteString(' = '); OPM.WriteStringVar(scope^.name); OPM.WriteString(GlobalScope); EndStat; + BegStat; OPM.WriteStringVar(scope^.name); OPM.WriteString(GlobalScope); OPM.WriteString(' = '); + OPM.Write("&"); OPM.WriteString(LocalScope); EndStat + END + END EnterProc; - PROCEDURE ExitProc*(proc: OPT.Object; eoBlock, implicitRet: BOOLEAN); - VAR var: OPT.Object; indent: BOOLEAN; - BEGIN - indent := eoBlock; - IF implicitRet & (proc^.typ # OPT.notyp) THEN - OPM.Write(Tab); OPM.WriteString("__RETCHK;"); OPM.WriteLn - ELSIF ~eoBlock OR implicitRet THEN - IF ~proc^.scope^.leaf THEN - (* link scope pointer of nested proc back to previous scope *) - IF indent THEN BegStat ELSE indent := TRUE END ; - OPM.WriteStringVar(proc^.scope^.name); OPM.WriteString(GlobalScope); - OPM.WriteString(Becomes); OPM.WriteString(LocalScope); OPM.Write(Dot); OPM.WriteString(LinkName); - EndStat - END; - (* delete array value parameters *) - var := proc^.link; - WHILE var # NIL DO - IF (var^.typ^.comp = DynArr) & (var^.mode = Var) & (var^.typ^.sysflag = 0) THEN - IF indent THEN BegStat ELSE indent := TRUE END ; - OPM.WriteString(DelFunc); Ident(var); OPM.Write(CloseParen); EndStat - END ; - var := var^.link - END - END ; - IF eoBlock THEN EndBlk; OPM.WriteLn - ELSIF indent THEN BegStat - END - END ExitProc; + PROCEDURE ExitProc*(proc: OPT.Object; eoBlock, implicitRet: BOOLEAN); + VAR var: OPT.Object; indent: BOOLEAN; + BEGIN + indent := eoBlock; + IF implicitRet & (proc^.typ # OPT.notyp) THEN + OPM.Write(Tab); OPM.WriteString("__RETCHK;"); OPM.WriteLn + ELSIF ~eoBlock OR implicitRet THEN + IF ~proc^.scope^.leaf THEN + (* link scope pointer of nested proc back to previous scope *) + IF indent THEN BegStat ELSE indent := TRUE END ; + OPM.WriteStringVar(proc^.scope^.name); OPM.WriteString(GlobalScope); + OPM.WriteString(' = '); OPM.WriteString(LocalScope); OPM.Write('.'); OPM.WriteString(LinkName); + EndStat + END; + (* delete array value parameters *) + var := proc^.link; + WHILE var # NIL DO + IF (var^.typ^.comp = OPT.DynArr) & (var^.mode = OPT.Var) & (var^.typ^.sysflag = 0) THEN + IF indent THEN BegStat ELSE indent := TRUE END ; + OPM.WriteString('__DEL('); Ident(var); OPM.Write(')'); EndStat + END ; + var := var^.link + END + END ; + IF eoBlock THEN EndBlk; OPM.WriteLn + ELSIF indent THEN BegStat + END + END ExitProc; - PROCEDURE CompleteIdent*(obj: OPT.Object); - VAR comp, level: INTEGER; - BEGIN - (* obj^.mode IN {Var, VarPar} *) - level := obj^.mnolev; - IF obj^.adr = 1 THEN (* WITH-variable *) - IF obj^.typ^.comp = Record THEN Ident(obj); OPM.WriteString("__") - ELSE (* cast with guard pointer type *) - OPM.WriteString("(("); Ident(obj^.typ^.strobj); OPM.Write(")"); Ident(obj); OPM.Write(")") - END - ELSIF (level # OPM.level) & (level > 0) THEN (* intermediate var *) - comp := obj^.typ^.comp; - IF (obj^.mode # VarPar) & (comp # DynArr) THEN OPM.Write(Star); END; - OPM.WriteStringVar(obj^.scope^.name); OPM.WriteString(GlobalScope); - OPM.WriteString("->"); Ident(obj) - ELSE - Ident(obj) - END - END CompleteIdent; + PROCEDURE CompleteIdent*(obj: OPT.Object); + VAR comp, level: INTEGER; + BEGIN + (* obj^.mode IN {OPT.Var, OPT.VarPar} *) + level := obj^.mnolev; + IF obj^.adr = 1 THEN (* WITH-variable *) + IF obj^.typ^.comp = OPT.Record THEN Ident(obj); OPM.WriteString("__") + ELSE (* cast with guard pointer type *) + OPM.WriteString("(("); Ident(obj^.typ^.strobj); OPM.Write(")"); Ident(obj); OPM.Write(")") + END + ELSIF (level # OPM.level) & (level > 0) THEN (* intermediate var *) + comp := obj^.typ^.comp; + IF (obj^.mode # OPT.VarPar) & (comp # OPT.DynArr) THEN OPM.Write('*'); END; + OPM.WriteStringVar(obj^.scope^.name); OPM.WriteString(GlobalScope); + OPM.WriteString("->"); Ident(obj) + ELSE + Ident(obj) + END + END CompleteIdent; - PROCEDURE TypeOf*(ap: OPT.Object); - VAR i: INTEGER; - BEGIN - ASSERT(ap.typ.comp = Record); - IF ap.mode = VarPar THEN - IF ap.mnolev # OPM.level THEN (*intermediate level var-par record; possible WITH-guarded*) - OPM.WriteStringVar(ap^.scope^.name); OPM.WriteString("_s->"); Ident(ap) - ELSE (*local var-par record*) - Ident(ap) - END ; - OPM.WriteString(TagExt) - ELSIF ap^.typ^.strobj # NIL THEN - Ident(ap^.typ^.strobj); OPM.WriteString(DynTypExt) - ELSE Andent(ap.typ) (*anonymous ap type, p^ *) - END - END TypeOf; + PROCEDURE TypeOf*(ap: OPT.Object); + VAR i: INTEGER; + BEGIN + ASSERT(ap.typ.comp = OPT.Record); + IF ap.mode = OPT.VarPar THEN + IF ap.mnolev # OPM.level THEN (*intermediate level var-par record; possible WITH-guarded*) + OPM.WriteStringVar(ap^.scope^.name); OPM.WriteString("_s->"); Ident(ap) + ELSE (*local var-par record*) + Ident(ap) + END ; + OPM.WriteString(TagExt) + ELSIF ap^.typ^.strobj # NIL THEN + Ident(ap^.typ^.strobj); OPM.WriteString(DynTypExt) + ELSE Andent(ap.typ) (*anonymous ap type, p^ *) + END + END TypeOf; - PROCEDURE Cmp*(rel: INTEGER); - BEGIN - CASE rel OF - eql : - OPM.WriteString(" == "); - | neq : - OPM.WriteString(" != "); - | lss : - OPM.WriteString(" < "); - | leq : - OPM.WriteString(" <= "); - | gtr : - OPM.WriteString(" > "); - | geq : - OPM.WriteString(" >= "); - ELSE - OPM.LogWStr("unhandled case in OPC.Cmp, rel = "); OPM.LogWNum(rel, 0); OPM.LogWLn; - END; - END Cmp; + PROCEDURE Cmp*(rel: INTEGER); + BEGIN + CASE rel OF + | OPT.eql: OPM.WriteString(" == ") + | OPT.neq: OPM.WriteString(" != ") + | OPT.lss: OPM.WriteString(" < ") + | OPT.leq: OPM.WriteString(" <= ") + | OPT.gtr: OPM.WriteString(" > ") + | OPT.geq: OPM.WriteString(" >= ") + ELSE OPM.LogWStr("unhandled case in OPC.Cmp, rel = "); OPM.LogWNum(rel, 0); OPM.LogWLn; + END; + END Cmp; - PROCEDURE Case*(caseVal: LONGINT; form: INTEGER); - VAR - ch: CHAR; - BEGIN - OPM.WriteString(CaseStat); - CASE form OF - | Char : - ch := CHR (caseVal); - IF (ch >= " ") & (ch <= "~") THEN - OPM.Write(SingleQuote); - IF (ch = "\") OR (ch = "?") OR (ch = SingleQuote) OR (ch = Quotes) THEN OPM.Write("\"); OPM.Write(ch); - ELSE OPM.Write(ch); - END; - OPM.Write(SingleQuote); - ELSE - OPM.WriteString("0x"); OPM.WriteHex (caseVal); - END; - | SInt, Int, LInt : - OPM.WriteInt (caseVal); - ELSE - OPM.LogWStr("unhandled case in OPC.Case, form = "); OPM.LogWNum(form, 0); OPM.LogWLn; - END; - OPM.WriteString(Colon); - END Case; + PROCEDURE CharacterLiteral(c: LONGINT); + BEGIN + IF (c < 32) OR (c > 126) THEN + OPM.WriteString("0x"); OPM.WriteHex(c) + ELSE + OPM.Write("'"); + IF (c = ORD(Backslash)) OR (c = ORD("'")) OR (c = ORD("?")) THEN + OPM.Write(Backslash) + END; + OPM.Write(CHR(c)); + OPM.Write("'") + END + END CharacterLiteral; - PROCEDURE SetInclude* (exclude: BOOLEAN); - BEGIN - IF exclude THEN OPM.WriteString(" &= ~"); ELSE OPM.WriteString(" |= "); END; - END SetInclude; + PROCEDURE StringLiteral(s: ARRAY OF CHAR; l: LONGINT); + VAR i: LONGINT; c: INTEGER; + BEGIN + OPM.Write(DoubleQuote); + i := 0; WHILE i < l DO + c := ORD(s[i]); + IF (c < 32) OR (c > 126) THEN + (* Encode binary character value using exactly 3 octal digits. + Use octal in preference to hex as only the octal escape + syntax ensures a subsequent character will not be absorbed + into this literal. *) + OPM.Write(Backslash); + OPM.Write(CHR(ORD("0") + c DIV 64)); c := c MOD 64; + OPM.Write(CHR(ORD("0") + c DIV 8)); c := c MOD 8; + OPM.Write(CHR(ORD("0") + c)) + ELSE + IF (c = ORD(Backslash)) OR (c = ORD(DoubleQuote)) OR (c = ORD("?")) THEN + OPM.Write(Backslash) + END; + OPM.Write(CHR(c)); + END; + INC(i); + END; + OPM.Write(DoubleQuote) + END StringLiteral; - PROCEDURE Increment* (decrement: BOOLEAN); - BEGIN - IF decrement THEN OPM.WriteString(" -= "); ELSE OPM.WriteString(" += "); END; - END Increment; + PROCEDURE Case*(caseVal: LONGINT; form: INTEGER); + VAR + ch: CHAR; + BEGIN + OPM.WriteString('case '); + CASE form OF + | OPT.Char: CharacterLiteral(caseVal) + | OPT.SInt, + OPT.Int, + OPT.LInt: OPM.WriteInt(caseVal); + ELSE OPM.LogWStr("unhandled case in OPC.Case, form = "); OPM.LogWNum(form, 0); OPM.LogWLn; + END; + OPM.WriteString(': '); + END Case; - PROCEDURE Halt* (n: LONGINT); - BEGIN - Str1("__HALT(#)", n) - END Halt; + PROCEDURE SetInclude* (exclude: BOOLEAN); + BEGIN + IF exclude THEN OPM.WriteString(" &= ~"); ELSE OPM.WriteString(" |= "); END; + END SetInclude; - PROCEDURE Len* (obj: OPT.Object; array: OPT.Struct; dim: LONGINT); - BEGIN - IF array^.comp = DynArr THEN - CompleteIdent(obj); OPM.WriteString(LenExt); - IF dim # 0 THEN OPM.WriteInt(dim) END - ELSE (* array *) - WHILE dim > 0 DO array := array^.BaseTyp; DEC(dim) END ; - OPM.WriteString("((LONGINT)("); OPM.WriteInt(array^.n); OPM.WriteString("))"); - END - END Len; + PROCEDURE Increment* (decrement: BOOLEAN); + BEGIN + IF decrement THEN OPM.WriteString(" -= "); ELSE OPM.WriteString(" += "); END; + END Increment; - PROCEDURE Constant* (con: OPT.Const; form: INTEGER); - VAR i, len: INTEGER; ch: CHAR; s: SET; - hex: LONGINT; skipLeading: BOOLEAN; - BEGIN - CASE form OF - Byte: - OPM.WriteInt(con^.intval) - | Bool: - OPM.WriteInt(con^.intval) - | Char: - ch := CHR(con^.intval); - IF (ch >= " ") & (ch <= "~") THEN - OPM.Write(SingleQuote); - IF (ch = "\") OR (ch = "?") OR (ch = SingleQuote) OR (ch = Quotes) THEN OPM.Write("\") END ; - OPM.Write(ch); - OPM.Write(SingleQuote) - ELSE - OPM.WriteString("0x"); OPM.WriteHex(con^.intval) - END - | SInt, Int, LInt: - OPM.WriteInt(con^.intval) -(* | Int8, Int16, Int32, Int64: - OPM.WriteInt(con^.intval)*) - | Real: - OPM.WriteReal(con^.realval, "f") - | LReal: - OPM.WriteReal(con^.realval, 0X) - | Set: - OPM.WriteString("0x"); - skipLeading := TRUE; - s := con^.setval; i := MAX(SET) + 1; - REPEAT - hex := 0; - REPEAT - DEC(i); hex := 2 * hex; - IF i IN s THEN INC(hex) END - UNTIL i MOD 8 = 0; - IF (hex # 0) OR ~skipLeading THEN - OPM.WriteHex(hex); - skipLeading := FALSE - END - UNTIL i = 0; - IF skipLeading THEN OPM.Write("0") END - | String: - OPM.Write(Quotes); - len := SHORT(con^.intval2) - 1; i := 0; - WHILE i < len DO ch := con^.ext^[i]; - IF (ch = "\") OR (ch = "?") OR (ch = SingleQuote) OR (ch = Quotes) THEN OPM.Write("\") END ; - OPM.Write(ch); INC(i) - END ; - OPM.Write(Quotes) - | NilTyp: - OPM.WriteString(NilConst); - ELSE - OPM.LogWStr("unhandled case in OPC.Constant, form = "); OPM.LogWNum(form, 0); OPM.LogWLn; - END; - END Constant; + PROCEDURE Halt* (n: LONGINT); + BEGIN + Str1("__HALT(#)", n) + END Halt; + + PROCEDURE Len* (obj: OPT.Object; array: OPT.Struct; dim: LONGINT); + BEGIN + IF array^.comp = OPT.DynArr THEN + CompleteIdent(obj); OPM.WriteString(LenExt); + IF dim # 0 THEN OPM.WriteInt(dim) END + ELSE (* array *) + WHILE dim > 0 DO array := array^.BaseTyp; DEC(dim) END ; + OPM.WriteString("((LONGINT)("); OPM.WriteInt(array^.n); OPM.WriteString("))"); + END + END Len; + + PROCEDURE Constant* (con: OPT.Const; form: INTEGER); + VAR i: INTEGER; s: SET; + hex: LONGINT; skipLeading: BOOLEAN; + BEGIN + CASE form OF + | OPT.Byte: OPM.WriteInt(con^.intval) + | OPT.Bool: OPM.WriteInt(con^.intval) + | OPT.Char: CharacterLiteral(con.intval) + | OPT.SInt, + OPT.Int, + OPT.LInt: OPM.WriteInt(con^.intval) + | OPT.Real: OPM.WriteReal(con^.realval, "f") + | OPT.LReal: OPM.WriteReal(con^.realval, 0X) + | OPT.Set: OPM.WriteString("0x"); + skipLeading := TRUE; + s := con^.setval; i := MAX(SET) + 1; + REPEAT + hex := 0; + REPEAT + DEC(i); hex := 2 * hex; + IF i IN s THEN INC(hex) END + UNTIL i MOD 8 = 0; + IF (hex # 0) OR ~skipLeading THEN + OPM.WriteHex(hex); + skipLeading := FALSE + END + UNTIL i = 0; + IF skipLeading THEN OPM.Write("0") END + | OPT.String: StringLiteral(con.ext^, con.intval2-1) + | OPT.NilTyp: OPM.WriteString('NIL'); + ELSE OPM.LogWStr("unhandled case in OPC.Constant, form = "); OPM.LogWNum(form, 0); OPM.LogWLn; + END; + END Constant; - PROCEDURE InitKeywords; - VAR n, i: SHORTINT; + PROCEDURE InitKeywords; + VAR n, i: SHORTINT; - PROCEDURE Enter(s: ARRAY OF CHAR); - VAR h: INTEGER; - BEGIN h := PerfectHash(s); hashtab[h] := n; COPY(s, keytab[n]); INC(n) - END Enter; + PROCEDURE Enter(s: ARRAY OF CHAR); + VAR h: INTEGER; + BEGIN h := PerfectHash(s); hashtab[h] := n; COPY(s, keytab[n]); INC(n) + END Enter; - BEGIN n := 0; - FOR i := 0 TO 104 DO hashtab[i] := -1 END ; - Enter("asm"); - Enter("auto"); - Enter("break"); - Enter("case"); - Enter("char"); - Enter("const"); - Enter("continue"); - Enter("default"); - Enter("do"); - Enter("double"); - Enter("else"); - Enter("enum"); - Enter("extern"); - Enter("export"); (* pseudo keyword used by voc *) - Enter("float"); - Enter("for"); - Enter("fortran"); - Enter("goto"); - Enter("if"); - Enter("import"); (* pseudo keyword used by voc *) - Enter("int"); - Enter("long"); - Enter("register"); - Enter("return"); - Enter("short"); - Enter("signed"); - Enter("sizeof"); - Enter("static"); - Enter("struct"); - Enter("switch"); - Enter("typedef"); - Enter("union"); - Enter("unsigned"); - Enter("void"); - Enter("volatile"); - Enter("while"); + BEGIN n := 0; + FOR i := 0 TO 104 DO hashtab[i] := -1 END ; + Enter("asm"); + Enter("auto"); + Enter("break"); + Enter("case"); + Enter("char"); + Enter("const"); + Enter("continue"); + Enter("default"); + Enter("do"); + Enter("double"); + Enter("else"); + Enter("enum"); + Enter("extern"); + Enter("export"); (* pseudo keyword used by voc *) + Enter("float"); + Enter("for"); + Enter("fortran"); + Enter("goto"); + Enter("if"); + Enter("import"); (* pseudo keyword used by voc *) + Enter("int"); + Enter("long"); + Enter("register"); + Enter("return"); + Enter("short"); + Enter("signed"); + Enter("sizeof"); + Enter("static"); + Enter("struct"); + Enter("switch"); + Enter("typedef"); + Enter("union"); + Enter("unsigned"); + Enter("void"); + Enter("volatile"); + Enter("while"); (* what about common predefined names from cpp as e.g. Operating System: ibm, gcos, os, tss and unix @@ -1415,7 +1359,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) The lint(1V) command: lint *) - END InitKeywords; + END InitKeywords; BEGIN InitKeywords END OPC. diff --git a/src/compiler/OPM.cmdln.Mod b/src/compiler/OPM.cmdln.Mod index 5bd9b015..74c0f5dc 100644 --- a/src/compiler/OPM.cmdln.Mod +++ b/src/compiler/OPM.cmdln.Mod @@ -79,6 +79,9 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) HFext = ".h"; (* header file extension *) SFtag = 0F7X; (* symbol file tag *) + + + TYPE FileName = ARRAY 32 OF CHAR; @@ -89,11 +92,9 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) ByteSize*, CharSize*, BoolSize*, SIntSize*, IntSize*, LIntSize*, SetSize*, RealSize*, LRealSize*, PointerSize*, ProcSize*, RecSize*, - CharAlign*, BoolAlign*, SIntAlign*, IntAlign*, - LIntAlign*, SetAlign*, RealAlign*, LRealAlign*, PointerAlign*, ProcAlign*, RecAlign*, MaxSet*: INTEGER; - MinSInt*, MinInt*, MinLInt*, MaxSInt*, MaxInt*, MaxLInt*, MaxIndex*: LONGINT; + MaxIndex*: LONGINT; MinReal*, MaxReal*, MinLReal*, MaxLReal*: LONGREAL; @@ -142,27 +143,30 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) i := 1; (* skip - *) WHILE s[i] # 0X DO CASE s[i] OF - | "e": opt := opt / {extsf} - | "s": opt := opt / {newsf} - | "m": opt := opt / {mainprog} - | "x": opt := opt / {inxchk} - | "r": opt := opt / {ranchk} - | "t": opt := opt / {typchk} + | "a": opt := opt / {assert} - | "k": opt := opt / {ansi} (* undocumented *) - | "p": opt := opt / {ptrinit} - | "S": opt := opt / {dontasm} | "c": opt := opt / {dontlink} - | "M": opt := opt / {mainlinkstat} + | "e": opt := opt / {extsf} | "f": opt := opt / {notcoloroutput} - | "F": opt := opt / {forcenewsym} - | "V": opt := opt / {verbose} + | "k": opt := opt / {ansi} (* undocumented *) + | "m": opt := opt / {mainprog} + | "p": opt := opt / {ptrinit} + | "r": opt := opt / {ranchk} + | "s": opt := opt / {newsf} + | "t": opt := opt / {typchk} + | "x": opt := opt / {inxchk} + | "B": IF s[i+1] # 0X THEN INC(i); IntSize := ORD(s[i]) - ORD('0') END; IF s[i+1] # 0X THEN INC(i); PointerSize := ORD(s[i]) - ORD('0') END; IF s[i+1] # 0X THEN INC(i); Alignment := ORD(s[i]) - ORD('0') END; ASSERT((IntSize = 2) OR (IntSize = 4)); ASSERT((PointerSize = 4) OR (PointerSize = 8)); - ASSERT((Alignment = 4) OR (Alignment = 8)) + ASSERT((Alignment = 4) OR (Alignment = 8)); + Files.SetSearchPath("") + | "F": opt := opt / {forcenewsym} + | "M": opt := opt / {mainlinkstat} + | "S": opt := opt / {dontasm} + | "V": opt := opt / {verbose} ELSE LogWStr(" warning: option "); LogW(OptionChar); @@ -458,15 +462,28 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) PROCEDURE FPrintReal*(VAR fp: LONGINT; real: REAL); - BEGIN FPrint(fp, SYSTEM.VAL(LONGINT, real)) + VAR i: INTEGER; l: LONGINT; + BEGIN + IF SIZE(REAL) = SIZE(INTEGER) THEN + SYSTEM.GET(SYSTEM.ADR(real), i); l := i; + ELSE + SYSTEM.GET(SYSTEM.ADR(real), l); + END; + FPrint(fp, l) END FPrintReal; PROCEDURE FPrintLReal*(VAR fp: LONGINT; lr: LONGREAL); VAR l, h: LONGINT; BEGIN - SYSTEM.GET(SYSTEM.ADR(lr), l); SYSTEM.GET(SYSTEM.ADR(lr)+4, h); - FPrint(fp, l); FPrint(fp, h) + IF SIZE(LONGREAL) = SIZE(LONGINT) THEN + (* 64 bit LONGINT *) + FPrint(fp, SYSTEM.VAL(LONGINT, lr)) + ELSE + (* 32 bit LONGINT *) + SYSTEM.GET(SYSTEM.ADR(lr), l); SYSTEM.GET(SYSTEM.ADR(lr)+4, h); + FPrint(fp, l); FPrint(fp, h) + END END FPrintLReal; @@ -484,10 +501,10 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) END GetProperty; - PROCEDURE minus(i: LONGINT): LONGINT; + PROCEDURE minusop(i: LONGINT): LONGINT; BEGIN RETURN -i; - END minus; + END minusop; PROCEDURE power0(i, j : LONGINT) : LONGINT; (* we would like to calculate exact Min Max values in GetProperties, not hardcode em, noch *) @@ -508,34 +525,63 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) BEGIN LogWLn; LogWStr("Type Size Alignement"); LogWLn; - LogWStr("CHAR "); LogWNum(CharSize, 4); LogWNum(CharAlign, 5); LogWLn; - LogWStr("BOOLEAN "); LogWNum(BoolSize, 4); LogWNum(BoolAlign, 5); LogWLn; - LogWStr("SHORTINT "); LogWNum(SIntSize, 4); LogWNum(SIntAlign, 5); LogWLn; - LogWStr("INTEGER "); LogWNum(IntSize, 4); LogWNum(IntAlign, 5); LogWLn; - LogWStr("LONGINT "); LogWNum(LIntSize, 4); LogWNum(LIntAlign, 5); LogWLn; - LogWStr("SET "); LogWNum(SetSize, 4); LogWNum(SetAlign, 5); LogWLn; - LogWStr("REAL "); LogWNum(RealSize, 4); LogWNum(RealAlign, 5); LogWLn; - LogWStr("LONGREAL "); LogWNum(LRealSize, 4); LogWNum(LRealAlign, 5); LogWLn; - LogWStr("PTR "); LogWNum(PointerSize, 4); LogWNum(PointerAlign, 5); LogWLn; - LogWStr("PROC "); LogWNum(ProcSize, 4); LogWNum(ProcAlign, 5); LogWLn; - LogWStr("RECORD "); LogWNum(RecSize, 4); LogWNum(RecAlign, 5); LogWLn; + LogWStr("CHAR "); LogWNum(CharSize, 4); (* LogWNum(CharAlign, 5); *) LogWLn; + LogWStr("BOOLEAN "); LogWNum(BoolSize, 4); (* LogWNum(BoolAlign, 5); *) LogWLn; + LogWStr("SHORTINT "); LogWNum(SIntSize, 4); (* LogWNum(SIntAlign, 5); *) LogWLn; + LogWStr("INTEGER "); LogWNum(IntSize, 4); (* LogWNum(IntAlign, 5); *) LogWLn; + LogWStr("LONGINT "); LogWNum(LIntSize, 4); (* LogWNum(LIntAlign, 5); *) LogWLn; + LogWStr("SET "); LogWNum(SetSize, 4); (* LogWNum(SetAlign, 5); *) LogWLn; + LogWStr("REAL "); LogWNum(RealSize, 4); (* LogWNum(RealAlign, 5); *) LogWLn; + LogWStr("LONGREAL "); LogWNum(LRealSize, 4); (* LogWNum(LRealAlign, 5); *) LogWLn; + LogWStr("PTR "); LogWNum(PointerSize, 4); (* LogWNum(PointerAlign, 5); *) LogWLn; + LogWStr("PROC "); LogWNum(ProcSize, 4); (* LogWNum(ProcAlign, 5); *) LogWLn; + LogWStr("RECORD "); LogWNum(RecSize, 4); (* LogWNum(RecAlign, 5); *) LogWLn; (*LogWStr("ENDIAN "); LogWNum(ByteOrder, 4); LogWNum(BitOrder, 5); LogWLn;*) LogWLn; + (* LogWStr("Min shortint "); LogWNum(MinSInt, 4); LogWLn; LogWStr("Max shortint "); LogWNum(MaxSInt, 4); LogWLn; LogWStr("Min integer "); LogWNum(MinInt, 4); LogWLn; LogWStr("Max integer "); LogWNum(MaxInt, 4); LogWLn; LogWStr("Min longint "); LogWNum(MinLInt, 4); LogWLn; + *) END VerboseListSizes; - PROCEDURE Min(a,b: INTEGER): INTEGER; - BEGIN IF a 8 THEN align := 16 + ELSIF size > 4 THEN align := 8 + ELSIF size > 2 THEN align := 4 + ELSE align := SHORT(size) + END + ELSE + align := Alignment + END; + RETURN align + END AlignSize; + *) + + PROCEDURE SignedMaximum*(bytecount: LONGINT): LONGINT; + VAR result: LONGINT; + BEGIN + result := 1; + result := SYSTEM.LSH(result, bytecount*8-1); + RETURN result - 1; + END SignedMaximum; + + PROCEDURE SignedMinimum*(bytecount: LONGINT): LONGINT; + BEGIN RETURN -SignedMaximum(bytecount) - 1 + END SignedMinimum; + + + PROCEDURE GetProperties(); - VAR - base: LONGINT; + (* VAR base: LONGINT; *) BEGIN (* Fixed and Configuration.Mod based sizes have been initialised in the module startup code, and maybe overridden by the -Bnnn bootstrap @@ -546,30 +592,6 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) LIntSize := IntSize * 2; SetSize := LIntSize; - (* Calculate all type alignments *) - CharAlign := Min(Alignment, CharSize); - BoolAlign := Min(Alignment, BoolSize); - SIntAlign := Min(Alignment, SIntSize); - RecAlign := Min(Alignment, RecSize); - RealAlign := Min(Alignment, RealSize); - LRealAlign := Min(Alignment, LRealSize); - PointerAlign := Min(Alignment, PointerSize); - ProcAlign := Min(Alignment, ProcSize); - IntAlign := Min(Alignment, IntSize); - LIntAlign := Min(Alignment, LIntSize); - SetAlign := Min(Alignment, SetSize); - - (* and I'd like to calculate it, not hardcode constants *) - base := -2; - MinSInt := ASH(base, SIntSize*8-2); - MaxSInt := minus(MinSInt + 1); - - MinInt := ASH(base, IntSize*8-2); - MaxInt := minus(MinInt + 1); - - MinLInt := ASH(base, LIntSize*8-2); - MaxLInt := minus(MinLInt +1); - IF RealSize = 4 THEN MaxReal := 3.40282346D38 ELSIF RealSize = 8 THEN MaxReal := 1.7976931348623157D307 * 9.999999 (*should be 1.7976931348623157D308 *) @@ -580,20 +602,17 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) (*should be 1.7976931348623157D308 *) END ; - MinReal := -MaxReal; + MinReal := -MaxReal; MinLReal := -MaxLReal; - - MaxSet := SetSize * 8 - 1; - MaxIndex := MaxLInt; (* shouldn't it be like max(int)? so that for loop will be safe, noch *) + MaxSet := SetSize * 8 - 1; + MaxIndex := SignedMaximum(PointerSize); IF Verbose THEN VerboseListSizes END; END GetProperties; - - - (* ------------------------- Read Symbol File ------------------------- *) + PROCEDURE SymRCh*(VAR ch: CHAR); BEGIN Files.Read(oldSF, ch) END SymRCh; @@ -715,7 +734,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) PROCEDURE WriteInt* (i: LONGINT); VAR s: ARRAY 20 OF CHAR; i1, k: LONGINT; BEGIN - IF (i = MinInt) OR (i = MinLInt) THEN + IF (i = SignedMinimum(IntSize)) OR (i = SignedMinimum(LIntSize)) THEN (* abs(minint) is one more than maxint, causing problems representing the value as a minus sign followed by absoute value. Therefore represent as -maxint - 1. For INTEGER this avoids a compiler warning 'this decimal constant is unsigned only in ISO C90', for LONGINT it is the @@ -733,7 +752,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) VAR W: Texts.Writer; T: Texts.Text; R: Texts.Reader; s: ARRAY 32 OF CHAR; ch: CHAR; i: INTEGER; BEGIN (*should be improved *) - IF (r < MaxLInt) & (r > MinLInt) & (r = ENTIER(r)) THEN + IF (r < SignedMaximum(LIntSize)) & (r > SignedMinimum(LIntSize)) & (r = ENTIER(r)) THEN IF suffx = "f" THEN WriteString("(REAL)") ELSE WriteString("(LONGREAL)") END ; WriteInt(ENTIER(r)) ELSE diff --git a/src/compiler/OPP.Mod b/src/compiler/OPP.Mod index a9f30a0c..56f2a3d0 100644 --- a/src/compiler/OPP.Mod +++ b/src/compiler/OPP.Mod @@ -3,68 +3,6 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) IMPORT OPB, OPT, OPS, OPM; - CONST - (* numtyp values *) - char = 1; integer = 2; real = 3; longreal = 4; - - (* symbol values *) - null = 0; times = 1; slash = 2; div = 3; mod = 4; - and = 5; plus = 6; minus = 7; or = 8; eql = 9; - neq = 10; lss = 11; leq = 12; gtr = 13; geq = 14; - in = 15; is = 16; arrow = 17; period = 18; comma = 19; - colon = 20; upto = 21; rparen = 22; rbrak = 23; rbrace = 24; - of = 25; then = 26; do = 27; to = 28; by = 29; - lparen = 30; lbrak = 31; lbrace = 32; not = 33; becomes = 34; - number = 35; nil = 36; string = 37; ident = 38; semicolon = 39; - bar = 40; end = 41; else = 42; elsif = 43; until = 44; - if = 45; case = 46; while = 47; repeat = 48; for = 49; - loop = 50; with = 51; exit = 52; return = 53; array = 54; - record = 55; pointer = 56; begin = 57; const = 58; type = 59; - var = 60; procedure = 61; import = 62; module = 63; eof = 64; - - (* object modes *) - Var = 1; VarPar = 2; Con = 3; Fld = 4; Typ = 5; LProc = 6; XProc = 7; - SProc = 8; CProc = 9; IProc = 10; Mod = 11; Head = 12; TProc = 13; - - (* Structure forms *) - Undef = 0; Byte = 1; Bool = 2; Char = 3; - SInt = 4; Int = 5; LInt = 6; - Real = 7; LReal = 8; Set = 9; String = 10; NilTyp = 11; NoTyp = 12; - Pointer = 13; ProcTyp = 14; - Comp = 15; - (*Int8 = 7; Int16 = 8; Int32 = 9; Int64 = 10; - Real = 11; LReal = 12; Set = 13; String = 14; NilTyp = 15; NoTyp = 16; - Pointer = 17; ProcTyp = 18; - Comp = 19;*) - (*Real = 7; LReal = 8; Set = 9; String = 10; NilTyp = 11; NoTyp = 12; - Pointer = 13; ProcTyp = 14; - Int8 = 15; Int16 = 16; Int32 = 17; Int64 = 18; - Comp = (*15*)19;*) - - intSet = {SInt..LInt(*, Int8..Int64*)}; - - (* composite structure forms *) - Basic = 1; Array = 2; DynArr = 3; Record = 4; - - (*function number*) - haltfn = 0; newfn = 1; incfn = 13; sysnewfn = 30; - - (* nodes classes *) - Nvar = 0; Nvarpar = 1; Nfield = 2; Nderef = 3; Nindex = 4; Nguard = 5; Neguard = 6; - Nconst = 7; Ntype = 8; Nproc = 9; Nupto = 10; Nmop = 11; Ndop = 12; Ncall = 13; - Ninittd = 14; Nif = 15; Ncaselse = 16; Ncasedo = 17; Nenter = 18; Nassign = 19; - Nifelse = 20; Ncase = 21; Nwhile = 22; Nrepeat = 23; Nloop = 24; Nexit = 25; - Nreturn = 26; Nwith = 27; Ntrap = 28; - - (* node subclasses *) - super = 1; - - (* module visibility of objects *) - internal = 0; external = 1; externalR = 2; - - (* procedure flags (conval^.setval) *) - hasBody = 1; isRedef = 2; slNeeded = 3; - TYPE CaseTable = ARRAY OPM.MaxCases OF RECORD @@ -93,19 +31,19 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) PROCEDURE qualident(VAR id: OPT.Object); VAR obj: OPT.Object; lev: SHORTINT; - BEGIN (*sym = ident*) + BEGIN (*sym = OPS.ident*) OPT.Find(obj); OPS.Get(sym); - IF (sym = period) & (obj # NIL) & (obj^.mode = Mod) THEN + IF (sym = OPS.period) & (obj # NIL) & (obj^.mode = OPT.Mod) THEN OPS.Get(sym); - IF sym = ident THEN + IF sym = OPS.ident THEN OPT.FindImport(obj, obj); OPS.Get(sym) - ELSE err(ident); obj := NIL + ELSE err(OPS.ident); obj := NIL END END ; IF obj = NIL THEN err(0); - obj := OPT.NewObj(); obj^.mode := Var; obj^.typ := OPT.undftyp; obj^.adr := 0 + obj := OPT.NewObj(); obj^.mode := OPT.Var; obj^.typ := OPT.undftyp; obj^.adr := 0 ELSE lev := obj^.mnolev; - IF (obj^.mode IN {Var, VarPar}) & (lev # level) THEN + IF (obj^.mode IN {OPT.Var, OPT.VarPar}) & (lev # level) THEN obj^.leaf := FALSE; IF lev > 0 THEN OPB.StaticLink(level-lev) END END @@ -115,32 +53,32 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) PROCEDURE ConstExpression(VAR x: OPT.Node); BEGIN Expression(x); - IF x^.class # Nconst THEN + IF x^.class # OPT.Nconst THEN err(50); x := OPB.NewIntConst(1) END END ConstExpression; PROCEDURE CheckMark(VAR vis: SHORTINT); BEGIN OPS.Get(sym); - IF (sym = times) OR (sym = minus) THEN + IF (sym = OPS.times) OR (sym = OPS.minus) THEN IF level > 0 THEN err(47) END ; - IF sym = times THEN vis := external ELSE vis := externalR END ; + IF sym = OPS.times THEN vis := OPT.external ELSE vis := OPT.externalR END ; OPS.Get(sym) - ELSE vis := internal + ELSE vis := OPT.internal END END CheckMark; PROCEDURE CheckSysFlag(VAR sysflag: INTEGER; default: INTEGER); VAR x: OPT.Node; sf: LONGINT; BEGIN - IF sym = lbrak THEN OPS.Get(sym); + IF sym = OPS.lbrak THEN OPS.Get(sym); IF ~OPT.SYSimported THEN err(135) END; ConstExpression(x); - IF x^.typ^.form IN intSet THEN sf := x^.conval^.intval; + IF x^.typ^.form IN OPT.intSet THEN sf := x^.conval^.intval; IF (sf < 0) OR (sf > OPM.MaxSysFlag) THEN err(220); sf := 0 END ELSE err(51); sf := 0 END ; - sysflag := SHORT(sf); CheckSym(rbrak) + sysflag := SHORT(sf); CheckSym(OPS.rbrak) ELSE sysflag := default END END CheckSysFlag; @@ -148,54 +86,54 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) PROCEDURE RecordType(VAR typ, banned: OPT.Struct); VAR fld, first, last, base: OPT.Object; ftyp: OPT.Struct; sysflag: INTEGER; - BEGIN typ := OPT.NewStr(Comp, Record); typ^.BaseTyp := NIL; + BEGIN typ := OPT.NewStr(OPT.Comp, OPT.Record); typ^.BaseTyp := NIL; CheckSysFlag(sysflag, -1); - IF sym = lparen THEN + IF sym = OPS.lparen THEN OPS.Get(sym); (*record extension*) - IF sym = ident THEN + IF sym = OPS.ident THEN qualident(base); - IF (base^.mode = Typ) & (base^.typ^.comp = Record) THEN + IF (base^.mode = OPT.Typ) & (base^.typ^.comp = OPT.Record) THEN IF base^.typ = banned THEN err(58) ELSE base^.typ^.pvused := TRUE; typ^.BaseTyp := base^.typ; typ^.extlev := base^.typ^.extlev + 1; typ^.sysflag := base^.typ^.sysflag END ELSE err(52) END - ELSE err(ident) + ELSE err(OPS.ident) END ; - CheckSym(rparen) + CheckSym(OPS.rparen) END ; IF sysflag >= 0 THEN typ^.sysflag := sysflag END ; OPT.OpenScope(0, NIL); first := NIL; last := NIL; LOOP - IF sym = ident THEN + IF sym = OPS.ident THEN LOOP - IF sym = ident THEN + IF sym = OPS.ident THEN IF typ^.BaseTyp # NIL THEN OPT.FindField(OPS.name, typ^.BaseTyp, fld); IF fld # NIL THEN err(1) END END ; OPT.Insert(OPS.name, fld); CheckMark(fld^.vis); - fld^.mode := Fld; fld^.link := NIL; fld^.typ := OPT.undftyp; + fld^.mode := OPT.Fld; fld^.link := NIL; fld^.typ := OPT.undftyp; IF first = NIL THEN first := fld END ; IF last = NIL THEN typ^.link := fld ELSE last^.link := fld END ; last := fld - ELSE err(ident) + ELSE err(OPS.ident) END ; - IF sym = comma THEN OPS.Get(sym) - ELSIF sym = ident THEN err(comma) + IF sym = OPS.comma THEN OPS.Get(sym) + ELSIF sym = OPS.ident THEN err(OPS.comma) ELSE EXIT END END ; - CheckSym(colon); Type(ftyp, banned); + CheckSym(OPS.colon); Type(ftyp, banned); ftyp^.pvused := TRUE; - IF ftyp^.comp = DynArr THEN ftyp := OPT.undftyp; err(88) END ; + IF ftyp^.comp = OPT.DynArr THEN ftyp := OPT.undftyp; err(88) END ; WHILE first # NIL DO first^.typ := ftyp; first := first^.link END END ; - IF sym = semicolon THEN OPS.Get(sym) - ELSIF sym = ident THEN err(semicolon) + IF sym = OPS.semicolon THEN OPS.Get(sym) + ELSIF sym = OPS.ident THEN err(OPS.semicolon) ELSE EXIT END END ; @@ -205,36 +143,36 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) PROCEDURE ArrayType(VAR typ, banned: OPT.Struct); VAR x: OPT.Node; n: LONGINT; sysflag: INTEGER; BEGIN CheckSysFlag(sysflag, 0); - IF sym = of THEN (*dynamic array*) - typ := OPT.NewStr(Comp, DynArr); typ^.mno := 0; typ^.sysflag := sysflag; + IF sym = OPS.of THEN (*dynamic array*) + typ := OPT.NewStr(OPT.Comp, OPT.DynArr); typ^.mno := 0; typ^.sysflag := sysflag; OPS.Get(sym); Type(typ^.BaseTyp, banned); typ^.BaseTyp^.pvused := TRUE; - IF typ^.BaseTyp^.comp = DynArr THEN typ^.n := typ^.BaseTyp^.n + 1 + IF typ^.BaseTyp^.comp = OPT.DynArr THEN typ^.n := typ^.BaseTyp^.n + 1 ELSE typ^.n := 0 END ELSE - typ := OPT.NewStr(Comp, Array); typ^.sysflag := sysflag; ConstExpression(x); - IF x^.typ^.form IN intSet THEN n := x^.conval^.intval; + typ := OPT.NewStr(OPT.Comp, OPT.Array); typ^.sysflag := sysflag; ConstExpression(x); + IF x^.typ^.form IN OPT.intSet THEN n := x^.conval^.intval; IF (n <= 0) OR (n > OPM.MaxIndex) THEN err(63); n := 1 END ELSE err(51); n := 1 END ; typ^.n := n; - IF sym = of THEN + IF sym = OPS.of THEN OPS.Get(sym); Type(typ^.BaseTyp, banned); typ^.BaseTyp^.pvused := TRUE - ELSIF sym = comma THEN - OPS.Get(sym); IF sym # of THEN ArrayType(typ^.BaseTyp, banned) END + ELSIF sym = OPS.comma THEN + OPS.Get(sym); IF sym # OPS.of THEN ArrayType(typ^.BaseTyp, banned) END ELSE err(35) END ; - IF typ^.BaseTyp^.comp = DynArr THEN typ^.BaseTyp := OPT.undftyp; err(88) END + IF typ^.BaseTyp^.comp = OPT.DynArr THEN typ^.BaseTyp := OPT.undftyp; err(88) END END END ArrayType; PROCEDURE PointerType(VAR typ: OPT.Struct); VAR id: OPT.Object; - BEGIN typ := OPT.NewStr(Pointer, Basic); CheckSysFlag(typ^.sysflag, 0); - CheckSym(to); - IF sym = ident THEN OPT.Find(id); + BEGIN typ := OPT.NewStr(OPT.Pointer, OPT.Basic); CheckSysFlag(typ^.sysflag, 0); + CheckSym(OPS.to); + IF sym = OPS.ident THEN OPT.Find(id); IF id = NIL THEN IF nofFwdPtr < LEN(FwdPtr) THEN FwdPtr[nofFwdPtr] := typ; INC(nofFwdPtr) ELSE err(224) @@ -242,8 +180,8 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) typ^.link := OPT.NewObj(); COPY(OPS.name, typ^.link^.name); typ^.BaseTyp := OPT.undftyp; OPS.Get(sym) (*forward ref*) ELSE qualident(id); - IF id^.mode = Typ THEN - IF id^.typ^.comp IN {Array, DynArr, Record} THEN + IF id^.mode = OPT.Typ THEN + IF id^.typ^.comp IN {OPT.Array, OPT.DynArr, OPT.Record} THEN typ^.BaseTyp := id^.typ ELSE typ^.BaseTyp := OPT.undftyp; err(57) END @@ -251,7 +189,7 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) END END ELSE Type(typ^.BaseTyp, OPT.notyp); - IF ~(typ^.BaseTyp^.comp IN {Array, DynArr, Record}) THEN + IF ~(typ^.BaseTyp^.comp IN {OPT.Array, OPT.DynArr, OPT.Record}) THEN typ^.BaseTyp := OPT.undftyp; err(57) END END @@ -261,45 +199,45 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) VAR mode: SHORTINT; par, first, last, res: OPT.Object; typ: OPT.Struct; BEGIN first := NIL; last := firstPar; - IF (sym = ident) OR (sym = var) THEN + IF (sym = OPS.ident) OR (sym = OPS.var) THEN LOOP - IF sym = var THEN OPS.Get(sym); mode := VarPar ELSE mode := Var END ; + IF sym = OPS.var THEN OPS.Get(sym); mode := OPT.VarPar ELSE mode := OPT.Var END ; LOOP - IF sym = ident THEN + IF sym = OPS.ident THEN OPT.Insert(OPS.name, par); OPS.Get(sym); par^.mode := mode; par^.link := NIL; IF first = NIL THEN first := par END ; IF firstPar = NIL THEN firstPar := par ELSE last^.link := par END ; last := par - ELSE err(ident) + ELSE err(OPS.ident) END ; - IF sym = comma THEN OPS.Get(sym) - ELSIF sym = ident THEN err(comma) - ELSIF sym = var THEN err(comma); OPS.Get(sym) + IF sym = OPS.comma THEN OPS.Get(sym) + ELSIF sym = OPS.ident THEN err(OPS.comma) + ELSIF sym = OPS.var THEN err(OPS.comma); OPS.Get(sym) ELSE EXIT END END ; - CheckSym(colon); Type(typ, OPT.notyp); - IF mode = Var THEN typ^.pvused := TRUE END ; + CheckSym(OPS.colon); Type(typ, OPT.notyp); + IF mode = OPT.Var THEN typ^.pvused := TRUE END ; (* typ^.pbused is set when parameter type name is parsed *) WHILE first # NIL DO first^.typ := typ; first := first^.link END ; - IF sym = semicolon THEN OPS.Get(sym) - ELSIF sym = ident THEN err(semicolon) + IF sym = OPS.semicolon THEN OPS.Get(sym) + ELSIF sym = OPS.ident THEN err(OPS.semicolon) ELSE EXIT END END END ; - CheckSym(rparen); - IF sym = colon THEN + CheckSym(OPS.rparen); + IF sym = OPS.colon THEN OPS.Get(sym); resTyp := OPT.undftyp; - IF sym = ident THEN qualident(res); - IF res^.mode = Typ THEN - IF (res^.typ^.form < Comp) (*OR (res^.typ^.form >= Int8) & (res^.typ^.form <= Int64)*) THEN resTyp := res^.typ; + IF sym = OPS.ident THEN qualident(res); + IF res^.mode = OPT.Typ THEN + IF (res^.typ^.form < OPT.Comp) (*OR (res^.typ^.form >= Int8) & (res^.typ^.form <= Int64)*) THEN resTyp := res^.typ; ELSE err(54) END ELSE err(52) END - ELSE err(ident) + ELSE err(OPS.ident) END ELSE resTyp := OPT.notyp END @@ -308,24 +246,26 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) PROCEDURE TypeDecl(VAR typ, banned: OPT.Struct); VAR id: OPT.Object; BEGIN typ := OPT.undftyp; - IF sym < lparen THEN err(12); - REPEAT OPS.Get(sym) UNTIL sym >= lparen + IF sym < OPS.lparen THEN err(12); + REPEAT OPS.Get(sym) UNTIL sym >= OPS.lparen END ; - IF sym = ident THEN qualident(id); - IF id^.mode = Typ THEN - IF id^.typ # banned THEN typ := id^.typ ELSE err(58) END + IF sym = OPS.ident THEN qualident(id); + IF id^.mode = OPT.Typ THEN + IF id^.typ = banned THEN err(58) ELSE + typ := id.typ + END ELSE err(52) END - ELSIF sym = array THEN + ELSIF sym = OPS.array THEN OPS.Get(sym); ArrayType(typ, banned) - ELSIF sym = record THEN + ELSIF sym = OPS.record THEN OPS.Get(sym); RecordType(typ, banned); - OPB.Inittd(TDinit, lastTDinit, typ); CheckSym(end) - ELSIF sym = pointer THEN + OPB.Inittd(TDinit, lastTDinit, typ); CheckSym(OPS.end) + ELSIF sym = OPS.pointer THEN OPS.Get(sym); PointerType(typ) - ELSIF sym = procedure THEN - OPS.Get(sym); typ := OPT.NewStr(ProcTyp, Basic); CheckSysFlag(typ^.sysflag, 0); - IF sym = lparen THEN + ELSIF sym = OPS.procedure THEN + OPS.Get(sym); typ := OPT.NewStr(OPT.ProcTyp, OPT.Basic); CheckSysFlag(typ^.sysflag, 0); + IF sym = OPS.lparen THEN OPS.Get(sym); OPT.OpenScope(level, NIL); FormalParameters(typ^.link, typ^.BaseTyp); OPT.CloseScope ELSE typ^.BaseTyp := OPT.notyp; typ^.link := NIL @@ -333,69 +273,69 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) ELSE err(12) END ; LOOP - IF (sym >= semicolon) & (sym <= else) OR (sym = rparen) OR (sym = eof) THEN EXIT END; - err(15); IF sym = ident THEN EXIT END; + IF (sym >= OPS.semicolon) & (sym <= OPS.else) OR (sym = OPS.rparen) OR (sym = OPS.eof) THEN EXIT END; + err(15); IF sym = OPS.ident THEN EXIT END; OPS.Get(sym) END END TypeDecl; PROCEDURE Type(VAR typ, banned: OPT.Struct); BEGIN TypeDecl(typ, banned); - IF (typ^.form = Pointer) & (typ^.BaseTyp = OPT.undftyp) & (typ^.strobj = NIL) THEN err(0) END + IF (typ^.form = OPT.Pointer) & (typ^.BaseTyp = OPT.undftyp) & (typ^.strobj = NIL) THEN err(0) END END Type; PROCEDURE selector(VAR x: OPT.Node); VAR obj, proc: OPT.Object; y: OPT.Node; typ: OPT.Struct; name: OPS.Name; BEGIN LOOP - IF sym = lbrak THEN OPS.Get(sym); + IF sym = OPS.lbrak THEN OPS.Get(sym); LOOP - IF (x^.typ # NIL) & (x^.typ^.form = Pointer) THEN OPB.DeRef(x) END ; + IF (x^.typ # NIL) & (x^.typ^.form = OPT.Pointer) THEN OPB.DeRef(x) END ; Expression(y); OPB.Index(x, y); - IF sym = comma THEN OPS.Get(sym) ELSE EXIT END + IF sym = OPS.comma THEN OPS.Get(sym) ELSE EXIT END END ; - CheckSym(rbrak) - ELSIF sym = period THEN OPS.Get(sym); - IF sym = ident THEN name := OPS.name; OPS.Get(sym); + CheckSym(OPS.rbrak) + ELSIF sym = OPS.period THEN OPS.Get(sym); + IF sym = OPS.ident THEN name := OPS.name; OPS.Get(sym); IF x^.typ # NIL THEN - IF x^.typ^.form = Pointer THEN OPB.DeRef(x) END ; - IF x^.typ^.comp = Record THEN + IF x^.typ^.form = OPT.Pointer THEN OPB.DeRef(x) END ; + IF x^.typ^.comp = OPT.Record THEN OPT.FindField(name, x^.typ, obj); OPB.Field(x, obj); - IF (obj # NIL) & (obj^.mode = TProc) THEN - IF sym = arrow THEN (* super call *) OPS.Get(sym); + IF (obj # NIL) & (obj^.mode = OPT.TProc) THEN + IF sym = OPS.arrow THEN (* super call *) OPS.Get(sym); y := x^.left; - IF y^.class = Nderef THEN y := y^.left END ; (* y = record variable *) + IF y^.class = OPT.Nderef THEN y := y^.left END ; (* y = record variable *) IF y^.obj # NIL THEN - proc := OPT.topScope; (* find innermost scope which owner is a TProc *) - WHILE (proc^.link # NIL) & (proc^.link^.mode # TProc) DO proc := proc^.left END ; + proc := OPT.topScope; (* find innermost scope which owner is a OPT.TProc *) + WHILE (proc^.link # NIL) & (proc^.link^.mode # OPT.TProc) DO proc := proc^.left END ; IF (proc^.link = NIL) OR (proc^.link^.link # y^.obj) THEN err(75) END ; typ := y^.obj^.typ; - IF typ^.form = Pointer THEN typ := typ^.BaseTyp END ; + IF typ^.form = OPT.Pointer THEN typ := typ^.BaseTyp END ; OPT.FindField(x^.obj^.name, typ^.BaseTyp, proc); - IF proc # NIL THEN x^.subcl := super ELSE err(74) END + IF proc # NIL THEN x^.subcl := OPT.super ELSE err(74) END ELSE err(75) END END ; - IF (obj^.typ # OPT.notyp) & (sym # lparen) THEN err(lparen) END + IF (obj^.typ # OPT.notyp) & (sym # OPS.lparen) THEN err(OPS.lparen) END END ELSE err(53) END ELSE err(52) END - ELSE err(ident) + ELSE err(OPS.ident) END - ELSIF sym = arrow THEN OPS.Get(sym); OPB.DeRef(x) - ELSIF (sym = lparen) & (x^.class < Nconst) & (x^.typ^.form # ProcTyp) & - ((x^.obj = NIL) OR (x^.obj^.mode # TProc)) THEN + ELSIF sym = OPS.arrow THEN OPS.Get(sym); OPB.DeRef(x) + ELSIF (sym = OPS.lparen) & (x^.class < OPT.Nconst) & (x^.typ^.form # OPT.ProcTyp) & + ((x^.obj = NIL) OR (x^.obj^.mode # OPT.TProc)) THEN OPS.Get(sym); - IF sym = ident THEN + IF sym = OPS.ident THEN qualident(obj); - IF obj^.mode = Typ THEN OPB.TypTest(x, obj, TRUE) + IF obj^.mode = OPT.Typ THEN OPB.TypTest(x, obj, TRUE) ELSE err(52) END - ELSE err(ident) + ELSE err(OPS.ident) END ; - CheckSym(rparen) + CheckSym(OPS.rparen) ELSE EXIT END END @@ -404,15 +344,15 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) PROCEDURE ActualParameters(VAR aparlist: OPT.Node; fpar: OPT.Object); VAR apar, last: OPT.Node; BEGIN aparlist := NIL; last := NIL; - IF sym # rparen THEN + IF sym # OPS.rparen THEN LOOP Expression(apar); IF fpar # NIL THEN OPB.Param(apar, fpar); OPB.Link(aparlist, last, apar); fpar := fpar^.link; ELSE err(64) END ; - IF sym = comma THEN OPS.Get(sym) - ELSIF (lparen <= sym) & (sym <= ident) THEN err(comma) + IF sym = OPS.comma THEN OPS.Get(sym) + ELSIF (OPS.lparen <= sym) & (sym <= OPS.ident) THEN err(OPS.comma) ELSE EXIT END END @@ -423,31 +363,31 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) PROCEDURE StandProcCall(VAR x: OPT.Node); VAR y: OPT.Node; m: SHORTINT; n: INTEGER; BEGIN m := SHORT(SHORT(x^.obj^.adr)); n := 0; - IF sym = lparen THEN OPS.Get(sym); - IF sym # rparen THEN + IF sym = OPS.lparen THEN OPS.Get(sym); + IF sym # OPS.rparen THEN LOOP IF n = 0 THEN Expression(x); OPB.StPar0(x, m); n := 1 ELSIF n = 1 THEN Expression(y); OPB.StPar1(x, y, m); n := 2 ELSE Expression(y); OPB.StParN(x, y, m, n); INC(n) END ; - IF sym = comma THEN OPS.Get(sym) - ELSIF (lparen <= sym) & (sym <= ident) THEN err(comma) + IF sym = OPS.comma THEN OPS.Get(sym) + ELSIF (OPS.lparen <= sym) & (sym <= OPS.ident) THEN err(OPS.comma) ELSE EXIT END END ; - CheckSym(rparen) + CheckSym(OPS.rparen) ELSE OPS.Get(sym) END ; OPB.StFct(x, m, n) - ELSE err(lparen) + ELSE err(OPS.lparen) END ; - IF (level > 0) & ((m = newfn) OR (m = sysnewfn)) THEN OPT.topScope^.link^.leaf := FALSE END + IF (level > 0) & ((m = OPT.newfn) OR (m = OPT.sysnewfn)) THEN OPT.topScope^.link^.leaf := FALSE END END StandProcCall; PROCEDURE Element(VAR x: OPT.Node); VAR y: OPT.Node; BEGIN Expression(x); - IF sym = upto THEN + IF sym = OPS.upto THEN OPS.Get(sym); Expression(y); OPB.SetRange(x, y) ELSE OPB.SetElem(x) END @@ -456,57 +396,57 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) PROCEDURE Sets(VAR x: OPT.Node); VAR y: OPT.Node; BEGIN - IF sym # rbrace THEN + IF sym # OPS.rbrace THEN Element(x); LOOP - IF sym = comma THEN OPS.Get(sym) - ELSIF (lparen <= sym) & (sym <= ident) THEN err(comma) + IF sym = OPS.comma THEN OPS.Get(sym) + ELSIF (OPS.lparen <= sym) & (sym <= OPS.ident) THEN err(OPS.comma) ELSE EXIT END ; - Element(y); OPB.Op(plus, x, y) + Element(y); OPB.Op(OPS.plus, x, y) END ELSE x := OPB.EmptySet() END ; - CheckSym(rbrace) + CheckSym(OPS.rbrace) END Sets; PROCEDURE Factor(VAR x: OPT.Node); VAR fpar, id: OPT.Object; apar: OPT.Node; BEGIN - IF sym < lparen THEN err(13); - REPEAT OPS.Get(sym) UNTIL sym >= lparen + IF sym < OPS.lparen THEN err(13); + REPEAT OPS.Get(sym) UNTIL sym >= OPS.lparen END ; - IF sym = ident THEN + IF sym = OPS.ident THEN qualident(id); x := OPB.NewLeaf(id); selector(x); - IF (x^.class = Nproc) & (x^.obj^.mode = SProc) THEN StandProcCall(x) (* x may be NIL *) - ELSIF sym = lparen THEN + IF (x^.class = OPT.Nproc) & (x^.obj^.mode = OPT.SProc) THEN StandProcCall(x) (* x may be NIL *) + ELSIF sym = OPS.lparen THEN OPS.Get(sym); OPB.PrepCall(x, fpar); ActualParameters(apar, fpar); OPB.Call(x, apar, fpar); - CheckSym(rparen); + CheckSym(OPS.rparen); IF level > 0 THEN OPT.topScope^.link^.leaf := FALSE END END - ELSIF sym = number THEN + ELSIF sym = OPS.number THEN CASE OPS.numtyp OF - char: x := OPB.NewIntConst(OPS.intval); x^.typ := OPT.chartyp - | integer: x := OPB.NewIntConst(OPS.intval) - | real: x := OPB.NewRealConst(OPS.realval, OPT.realtyp) - | longreal: x := OPB.NewRealConst(OPS.lrlval, OPT.lrltyp) + | OPS.char: x := OPB.NewIntConst(OPS.intval); x^.typ := OPT.chartyp + | OPS.integer: x := OPB.NewIntConst(OPS.intval) + | OPS.real: x := OPB.NewRealConst(OPS.realval, OPT.realtyp) + | OPS.longreal: x := OPB.NewRealConst(OPS.lrlval, OPT.lrltyp) ELSE OPM.LogWStr("unhandled case in OPP.Factor, OPS.numtyp = "); OPM.LogWNum(OPS.numtyp, 0); OPM.LogWLn; END ; OPS.Get(sym) - ELSIF sym = string THEN + ELSIF sym = OPS.string THEN x := OPB.NewString(OPS.str, OPS.intval); OPS.Get(sym) - ELSIF sym = nil THEN + ELSIF sym = OPS.nil THEN x := OPB.Nil(); OPS.Get(sym) - ELSIF sym = lparen THEN - OPS.Get(sym); Expression(x); CheckSym(rparen) - ELSIF sym = lbrak THEN - OPS.Get(sym); err(lparen); Expression(x); CheckSym(rparen) - ELSIF sym = lbrace THEN OPS.Get(sym); Sets(x) - ELSIF sym = not THEN - OPS.Get(sym); Factor(x); OPB.MOp(not, x) + ELSIF sym = OPS.lparen THEN + OPS.Get(sym); Expression(x); CheckSym(OPS.rparen) + ELSIF sym = OPS.lbrak THEN + OPS.Get(sym); err(OPS.lparen); Expression(x); CheckSym(OPS.rparen) + ELSIF sym = OPS.lbrace THEN OPS.Get(sym); Sets(x) + ELSIF sym = OPS.not THEN + OPS.Get(sym); Factor(x); OPB.MOp(OPS.not, x) ELSE err(13); OPS.Get(sym); x := NIL END ; IF x = NIL THEN x := OPB.NewIntConst(1); x^.typ := OPT.undftyp END @@ -515,7 +455,7 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) PROCEDURE Term(VAR x: OPT.Node); VAR y: OPT.Node; mulop: SHORTINT; BEGIN Factor(x); - WHILE (times <= sym) & (sym <= and) DO + WHILE (OPS.times <= sym) & (sym <= OPS.and) DO mulop := sym; OPS.Get(sym); Factor(y); OPB.Op(mulop, x, y) END @@ -524,11 +464,11 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) PROCEDURE SimpleExpression(VAR x: OPT.Node); VAR y: OPT.Node; addop: SHORTINT; BEGIN - IF sym = minus THEN OPS.Get(sym); Term(x); OPB.MOp(minus, x) - ELSIF sym = plus THEN OPS.Get(sym); Term(x); OPB.MOp(plus, x) + IF sym = OPS.minus THEN OPS.Get(sym); Term(x); OPB.MOp(OPS.minus, x) + ELSIF sym = OPS.plus THEN OPS.Get(sym); Term(x); OPB.MOp(OPS.plus, x) ELSE Term(x) END ; - WHILE (plus <= sym) & (sym <= or) DO + WHILE (OPS.plus <= sym) & (sym <= OPS.or) DO addop := sym; OPS.Get(sym); Term(y); OPB.Op(addop, x, y) END @@ -537,19 +477,19 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) PROCEDURE Expression(VAR x: OPT.Node); VAR y: OPT.Node; obj: OPT.Object; relation: SHORTINT; BEGIN SimpleExpression(x); - IF (eql <= sym) & (sym <= geq) THEN + IF (OPS.eql <= sym) & (sym <= OPS.geq) THEN relation := sym; OPS.Get(sym); SimpleExpression(y); OPB.Op(relation, x, y) - ELSIF sym = in THEN + ELSIF sym = OPS.in THEN OPS.Get(sym); SimpleExpression(y); OPB.In(x, y) - ELSIF sym = is THEN + ELSIF sym = OPS.is THEN OPS.Get(sym); - IF sym = ident THEN + IF sym = OPS.ident THEN qualident(obj); - IF obj^.mode = Typ THEN OPB.TypTest(x, obj, FALSE) + IF obj^.mode = OPT.Typ THEN OPB.TypTest(x, obj, FALSE) ELSE err(52) END - ELSE err(ident) + ELSE err(OPS.ident) END END END Expression; @@ -557,27 +497,27 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) PROCEDURE Receiver(VAR mode: SHORTINT; VAR name: OPS.Name; VAR typ, rec: OPT.Struct); VAR obj: OPT.Object; BEGIN typ := OPT.undftyp; rec := NIL; - IF sym = var THEN OPS.Get(sym); mode := VarPar ELSE mode := Var END ; - name := OPS.name; CheckSym(ident); CheckSym(colon); - IF sym = ident THEN OPT.Find(obj); OPS.Get(sym); + IF sym = OPS.var THEN OPS.Get(sym); mode := OPT.VarPar ELSE mode := OPT.Var END ; + name := OPS.name; CheckSym(OPS.ident); CheckSym(OPS.colon); + IF sym = OPS.ident THEN OPT.Find(obj); OPS.Get(sym); IF obj = NIL THEN err(0) - ELSIF obj^.mode # Typ THEN err(72) + ELSIF obj^.mode # OPT.Typ THEN err(72) ELSE typ := obj^.typ; rec := typ; - IF rec^.form = Pointer THEN rec := rec^.BaseTyp END ; - IF ~((mode = Var) & (typ^.form = Pointer) & (rec^.comp = Record) OR - (mode = VarPar) & (typ^.comp = Record)) THEN err(70); rec := NIL END ; + IF rec^.form = OPT.Pointer THEN rec := rec^.BaseTyp END ; + IF ~((mode = OPT.Var) & (typ^.form = OPT.Pointer) & (rec^.comp = OPT.Record) OR + (mode = OPT.VarPar) & (typ^.comp = OPT.Record)) THEN err(70); rec := NIL END ; IF (rec # NIL) & (rec^.mno # level) THEN err(72); rec := NIL END END - ELSE err(ident) + ELSE err(OPS.ident) END ; - CheckSym(rparen); - IF rec = NIL THEN rec := OPT.NewStr(Comp, Record); rec^.BaseTyp := NIL END + CheckSym(OPS.rparen); + IF rec = NIL THEN rec := OPT.NewStr(OPT.Comp, OPT.Record); rec^.BaseTyp := NIL END END Receiver; PROCEDURE Extends(x, b: OPT.Struct): BOOLEAN; BEGIN - IF (b^.form = Pointer) & (x^.form = Pointer) THEN b := b^.BaseTyp; x := x^.BaseTyp END ; - IF (b^.comp = Record) & (x^.comp = Record) THEN + IF (b^.form = OPT.Pointer) & (x^.form = OPT.Pointer) THEN b := b^.BaseTyp; x := x^.BaseTyp END ; + IF (b^.comp = OPT.Record) & (x^.comp = OPT.Record) THEN REPEAT x := x^.BaseTyp UNTIL (x = NIL) OR (x = b) END ; RETURN x = b @@ -593,7 +533,7 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) VAR ext: OPT.ConstExt; n: INTEGER; c: LONGINT; BEGIN ext := OPT.NewExt(); proc^.conval^.ext := ext; n := 0; - IF sym = string THEN + IF sym = OPS.string THEN WHILE OPS.str[n] # 0X DO ext[n+1] := OPS.str[n]; INC(n) END ; ext^[0] := CHR(n); OPS.Get(sym); (* @@ -602,33 +542,33 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) *) ELSE LOOP - IF sym = number THEN c := OPS.intval; INC(n); + IF sym = OPS.number THEN c := OPS.intval; INC(n); IF (c < 0) OR (c > 255) OR (n = OPT.MaxConstLen) THEN err(64); c := 1; n := 1 END ; OPS.Get(sym); ext^[n] := CHR(c) END ; - IF sym = comma THEN OPS.Get(sym) - ELSIF sym = number THEN err(comma) + IF sym = OPS.comma THEN OPS.Get(sym) + ELSIF sym = OPS.number THEN err(OPS.comma) ELSE ext^[0] := CHR(n); EXIT END END END ; - INCL(proc^.conval^.setval, hasBody) + INCL(proc^.conval^.setval, OPT.hasBody) END GetCode; PROCEDURE GetParams; BEGIN proc^.vis := vis; proc^.mode := mode; proc^.typ := OPT.notyp; proc^.conval := OPT.NewConst(); proc^.conval^.setval := {}; - IF sym = lparen THEN + IF sym = OPS.lparen THEN OPS.Get(sym); FormalParameters(proc^.link, proc^.typ) END ; IF fwd # NIL THEN OPB.CheckParameters(proc^.link, fwd^.link, TRUE); IF proc^.typ # fwd^.typ THEN err(117) END ; proc := fwd; OPT.topScope := proc^.scope; - IF mode = IProc THEN proc^.mode := IProc END + IF mode = OPT.IProc THEN proc^.mode := OPT.IProc END END END GetParams; @@ -636,14 +576,14 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) VAR procdec, statseq: OPT.Node; c: LONGINT; BEGIN c := OPM.errpos; - INCL(proc^.conval^.setval, hasBody); - CheckSym(semicolon); Block(procdec, statseq); + INCL(proc^.conval^.setval, OPT.hasBody); + CheckSym(OPS.semicolon); Block(procdec, statseq); OPB.Enter(procdec, statseq, proc); x := procdec; x^.conval := OPT.NewConst(); x^.conval^.intval := c; - IF sym = ident THEN + IF sym = OPS.ident THEN IF OPS.name # proc^.name THEN err(4) END ; OPS.Get(sym) - ELSE err(ident) + ELSE err(OPS.ident) END END Body; @@ -653,17 +593,17 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) objMode: SHORTINT; objName: OPS.Name; BEGIN - OPS.Get(sym); mode := TProc; + OPS.Get(sym); mode := OPT.TProc; IF level > 0 THEN err(73) END ; Receiver(objMode, objName, objTyp, recTyp); - IF sym = ident THEN + IF sym = OPS.ident THEN name := OPS.name; CheckMark(vis); OPT.FindField(name, recTyp, fwd); OPT.FindField(name, recTyp^.BaseTyp, baseProc); - IF (baseProc # NIL) & (baseProc^.mode # TProc) THEN baseProc := NIL END ; + IF (baseProc # NIL) & (baseProc^.mode # OPT.TProc) THEN baseProc := NIL END ; IF fwd = baseProc THEN fwd := NIL END ; IF (fwd # NIL) & (fwd^.mnolev # level) THEN fwd := NIL END ; - IF (fwd # NIL) & (fwd^.mode = TProc) & ~(hasBody IN fwd^.conval^.setval) THEN + IF (fwd # NIL) & (fwd^.mode = OPT.TProc) & ~(OPT.hasBody IN fwd^.conval^.setval) THEN (* there exists a corresponding forward declaration *) proc := OPT.NewObj(); proc^.leaf := TRUE; IF fwd^.vis # vis THEN err(118) END @@ -679,34 +619,34 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) IF (objMode # baseProc^.link^.mode) OR ~Extends(objTyp, baseProc^.link^.typ) THEN err(115) END ; OPB.CheckParameters(proc^.link^.link, baseProc^.link^.link, FALSE); IF proc^.typ # baseProc^.typ THEN err(117) END ; - IF (baseProc^.vis = external) & (proc^.vis = internal) & - (recTyp^.strobj # NIL) & (recTyp^.strobj^.vis = external) THEN err(109) + IF (baseProc^.vis = OPT.external) & (proc^.vis = OPT.internal) & + (recTyp^.strobj # NIL) & (recTyp^.strobj^.vis = OPT.external) THEN err(109) END ; - INCL(proc^.conval^.setval, isRedef) + INCL(proc^.conval^.setval, OPT.isRedef) END ; IF ~forward THEN Body END ; DEC(level); OPT.CloseScope - ELSE err(ident) + ELSE err(OPS.ident) END END TProcDecl; - BEGIN proc := NIL; forward := FALSE; x := NIL; mode := LProc; - IF (sym # ident) & (sym # lparen) THEN - IF sym = times THEN (* mode set later in OPB.CheckAssign *) - ELSIF sym = arrow THEN forward := TRUE - ELSIF sym = plus THEN mode := IProc - ELSIF sym = minus THEN mode := CProc - ELSE err(ident) + BEGIN proc := NIL; forward := FALSE; x := NIL; mode := OPT.LProc; + IF (sym # OPS.ident) & (sym # OPS.lparen) THEN + IF sym = OPS.times THEN (* mode set later in OPB.CheckAssign *) + ELSIF sym = OPS.arrow THEN forward := TRUE + ELSIF sym = OPS.plus THEN mode := OPT.IProc + ELSIF sym = OPS.minus THEN mode := OPT.CProc + ELSE err(OPS.ident) END ; - IF (mode IN {IProc, CProc}) & ~OPT.SYSimported THEN err(135) END ; + IF (mode IN {OPT.IProc, OPT.CProc}) & ~OPT.SYSimported THEN err(135) END ; OPS.Get(sym) END ; - IF sym = lparen THEN TProcDecl - ELSIF sym = ident THEN OPT.Find(fwd); + IF sym = OPS.lparen THEN TProcDecl + ELSIF sym = OPS.ident THEN OPT.Find(fwd); name := OPS.name; CheckMark(vis); - IF (vis # internal) & (mode = LProc) THEN mode := XProc END ; - IF (fwd # NIL) & ((fwd^.mnolev # level) OR (fwd^.mode = SProc)) THEN fwd := NIL END ; - IF (fwd # NIL) & (fwd^.mode IN {LProc, XProc}) & ~(hasBody IN fwd^.conval^.setval) THEN + IF (vis # OPT.internal) & (mode = OPT.LProc) THEN mode := OPT.XProc END ; + IF (fwd # NIL) & ((fwd^.mnolev # level) OR (fwd^.mode = OPT.SProc)) THEN fwd := NIL END ; + IF (fwd # NIL) & (fwd^.mode IN {OPT.LProc, OPT.XProc}) & ~(OPT.hasBody IN fwd^.conval^.setval) THEN (* there exists a corresponding forward declaration *) proc := OPT.NewObj(); proc^.leaf := TRUE; IF fwd^.vis # vis THEN err(118) END @@ -714,14 +654,14 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) IF fwd # NIL THEN err(1); fwd := NIL END ; OPT.Insert(name, proc) END ; - IF (mode # LProc) & (level > 0) THEN err(73) END ; + IF (mode # OPT.LProc) & (level > 0) THEN err(73) END ; INC(level); OPT.OpenScope(level, proc); proc^.link := NIL; GetParams; - IF mode = CProc THEN GetCode + IF mode = OPT.CProc THEN GetCode ELSIF ~forward THEN Body END ; DEC(level); OPT.CloseScope - ELSE err(ident) + ELSE err(OPS.ident) END END ProcedureDeclaration; @@ -729,16 +669,16 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) VAR x, y, lastlab: OPT.Node; i, f: INTEGER; xval, yval: LONGINT; BEGIN lab := NIL; lastlab := NIL; LOOP ConstExpression(x); f := x^.typ^.form; - IF f IN intSet + {Char} THEN xval := x^.conval^.intval + IF f IN OPT.intSet + {OPT.Char} THEN xval := x^.conval^.intval ELSE err(61); xval := 1 END ; - IF f IN intSet THEN + IF f IN OPT.intSet THEN IF LabelForm < f THEN err(60) END ELSIF LabelForm # f THEN err(60) END ; - IF sym = upto THEN + IF sym = OPS.upto THEN OPS.Get(sym); ConstExpression(y); yval := y^.conval^.intval; - IF (y^.typ^.form # f) & ~((f IN intSet) & (y^.typ^.form IN intSet)) THEN err(60) END ; + IF (y^.typ^.form # f) & ~((f IN OPT.intSet) & (y^.typ^.form IN OPT.intSet)) THEN err(60) END ; IF yval < xval THEN err(63); yval := xval END ELSE yval := xval END ; @@ -757,8 +697,8 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) ELSE err(213) END ; OPB.Link(lab, lastlab, x); - IF sym = comma THEN OPS.Get(sym) - ELSIF (sym = number) OR (sym = ident) THEN err(comma) + IF sym = OPS.comma THEN OPS.Get(sym) + ELSIF (sym = OPS.number) OR (sym = OPS.ident) THEN err(OPS.comma) ELSE EXIT END END @@ -773,29 +713,29 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) tab: CaseTable; cases, lab, y, lastcase: OPT.Node; BEGIN Expression(x); pos := OPM.errpos; - IF (x^.class = Ntype) OR (x^.class = Nproc) THEN err(126) - ELSIF ~(x^.typ^.form IN {Char..LInt}) THEN err(125) + IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) + ELSIF ~(x^.typ^.form IN {OPT.Char..OPT.LInt}) THEN err(125) END ; - CheckSym(of); cases := NIL; lastcase := NIL; n := 0; + CheckSym(OPS.of); cases := NIL; lastcase := NIL; n := 0; LOOP - IF sym < bar THEN + IF sym < OPS.bar THEN CaseLabelList(lab, x^.typ^.form, n, tab); - CheckSym(colon); StatSeq(y); - OPB.Construct(Ncasedo, lab, y); OPB.Link(cases, lastcase, lab) + CheckSym(OPS.colon); StatSeq(y); + OPB.Construct(OPT.Ncasedo, lab, y); OPB.Link(cases, lastcase, lab) END ; - IF sym = bar THEN OPS.Get(sym) ELSE EXIT END + IF sym = OPS.bar THEN OPS.Get(sym) ELSE EXIT END END ; IF n > 0 THEN low := tab[0].low; high := tab[n-1].high; IF high - low > OPM.MaxCaseRange THEN err(209) END ELSE low := 1; high := 0 END ; - e := sym = else; + e := sym = OPS.else; IF e THEN OPS.Get(sym); StatSeq(y) ELSE y := NIL; - OPM.Mark(-307, OPM.curpos); (* notice about no else symbol; -- noch *) + OPM.Mark(-307, OPM.curpos); (* notice about no OPS.else symbol; -- noch *) END ; - OPB.Construct(Ncaselse, cases, y); OPB.Construct(Ncase, x, cases); + OPB.Construct(OPT.Ncaselse, cases, y); OPB.Construct(OPT.Ncase, x, cases); cases^.conval := OPT.NewConst(); cases^.conval^.intval := low; cases^.conval^.intval2 := high; IF e THEN cases^.conval^.setval := {1} ELSE cases^.conval^.setval := {} END @@ -808,29 +748,29 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) PROCEDURE CheckBool(VAR x: OPT.Node); BEGIN - IF (x^.class = Ntype) OR (x^.class = Nproc) THEN err(126); x := OPB.NewBoolConst(FALSE) - ELSIF x^.typ^.form # Bool THEN err(120); x := OPB.NewBoolConst(FALSE) + IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126); x := OPB.NewBoolConst(FALSE) + ELSIF x^.typ^.form # OPT.Bool THEN err(120); x := OPB.NewBoolConst(FALSE) END ; pos := OPM.errpos END CheckBool; BEGIN stat := NIL; last := NIL; LOOP x := NIL; - IF sym < ident THEN err(14); - REPEAT OPS.Get(sym) UNTIL sym >= ident + IF sym < OPS.ident THEN err(14); + REPEAT OPS.Get(sym) UNTIL sym >= OPS.ident END ; - IF sym = ident THEN + IF sym = OPS.ident THEN qualident(id); x := OPB.NewLeaf(id); selector(x); - IF sym = becomes THEN + IF sym = OPS.becomes THEN OPS.Get(sym); Expression(y); OPB.Assign(x, y) - ELSIF sym = eql THEN - err(becomes); OPS.Get(sym); Expression(y); OPB.Assign(x, y) - ELSIF (x^.class = Nproc) & (x^.obj^.mode = SProc) THEN + ELSIF sym = OPS.eql THEN + err(OPS.becomes); OPS.Get(sym); Expression(y); OPB.Assign(x, y) + ELSIF (x^.class = OPT.Nproc) & (x^.obj^.mode = OPT.SProc) THEN StandProcCall(x); IF (x # NIL) & (x^.typ # OPT.notyp) THEN err(55) END ELSE OPB.PrepCall(x, fpar); - IF sym = lparen THEN - OPS.Get(sym); ActualParameters(apar, fpar); CheckSym(rparen) + IF sym = OPS.lparen THEN + OPS.Get(sym); ActualParameters(apar, fpar); CheckSym(OPS.rparen) ELSE apar := NIL; IF fpar # NIL THEN err(65) END END ; @@ -839,36 +779,36 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) IF level > 0 THEN OPT.topScope^.link^.leaf := FALSE END END ; pos := OPM.errpos - ELSIF sym = if THEN - OPS.Get(sym); Expression(x); CheckBool(x); CheckSym(then); StatSeq(y); - OPB.Construct(Nif, x, y); SetPos(x); lastif := x; - WHILE sym = elsif DO - OPS.Get(sym); Expression(y); CheckBool(y); CheckSym(then); StatSeq(z); - OPB.Construct(Nif, y, z); SetPos(y); OPB.Link(x, lastif, y) + ELSIF sym = OPS.if THEN + OPS.Get(sym); Expression(x); CheckBool(x); CheckSym(OPS.then); StatSeq(y); + OPB.Construct(OPT.Nif, x, y); SetPos(x); lastif := x; + WHILE sym = OPS.elsif DO + OPS.Get(sym); Expression(y); CheckBool(y); CheckSym(OPS.then); StatSeq(z); + OPB.Construct(OPT.Nif, y, z); SetPos(y); OPB.Link(x, lastif, y) END ; - IF sym = else THEN OPS.Get(sym); StatSeq(y) ELSE y := NIL END ; - OPB.Construct(Nifelse, x, y); CheckSym(end); OPB.OptIf(x); pos := OPM.errpos - ELSIF sym = case THEN - OPS.Get(sym); CasePart(x); CheckSym(end) - ELSIF sym = while THEN - OPS.Get(sym); Expression(x); CheckBool(x); CheckSym(do); StatSeq(y); - OPB.Construct(Nwhile, x, y); CheckSym(end) - ELSIF sym = repeat THEN + IF sym = OPS.else THEN OPS.Get(sym); StatSeq(y) ELSE y := NIL END ; + OPB.Construct(OPT.Nifelse, x, y); CheckSym(OPS.end); OPB.OptIf(x); pos := OPM.errpos + ELSIF sym = OPS.case THEN + OPS.Get(sym); CasePart(x); CheckSym(OPS.end) + ELSIF sym = OPS.while THEN + OPS.Get(sym); Expression(x); CheckBool(x); CheckSym(OPS.do); StatSeq(y); + OPB.Construct(OPT.Nwhile, x, y); CheckSym(OPS.end) + ELSIF sym = OPS.repeat THEN OPS.Get(sym); StatSeq(x); - IF sym = until THEN OPS.Get(sym); Expression(y); CheckBool(y) - ELSE err(until) + IF sym = OPS.until THEN OPS.Get(sym); Expression(y); CheckBool(y) + ELSE err(OPS.until) END ; - OPB.Construct(Nrepeat, x, y) - ELSIF sym = for THEN + OPB.Construct(OPT.Nrepeat, x, y) + ELSIF sym = OPS.for THEN OPS.Get(sym); - IF sym = ident THEN qualident(id); - IF ~(id^.typ^.form IN intSet) THEN err(68) END ; - CheckSym(becomes); Expression(y); pos := OPM.errpos; + IF sym = OPS.ident THEN qualident(id); + IF ~(id^.typ^.form IN OPT.intSet) THEN err(68) END ; + CheckSym(OPS.becomes); Expression(y); pos := OPM.errpos; x := OPB.NewLeaf(id); OPB.Assign(x, y); SetPos(x); - CheckSym(to); Expression(y); pos := OPM.errpos; - IF y^.class # Nconst THEN + CheckSym(OPS.to); Expression(y); pos := OPM.errpos; + IF y^.class # OPT.Nconst THEN name := "@@"; OPT.Insert(name, t); t^.name := "@for"; (* avoid err 1 *) - t^.mode := Var; t^.typ := x^.left^.typ; + t^.mode := OPT.Var; t^.typ := x^.left^.typ; obj := OPT.topScope^.scope; IF obj = NIL THEN OPT.topScope^.scope := t ELSE @@ -877,73 +817,73 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) END ; z := OPB.NewLeaf(t); OPB.Assign(z, y); SetPos(z); OPB.Link(stat, last, z); y := OPB.NewLeaf(t) - ELSIF (y^.typ^.form < SInt) OR (y^.typ^.form > x^.left^.typ^.form) THEN err(113) + ELSIF (y^.typ^.form < OPT.SInt) OR (y^.typ^.form > x^.left^.typ^.form) THEN err(113) END ; OPB.Link(stat, last, x); - IF sym = by THEN OPS.Get(sym); ConstExpression(z) ELSE z := OPB.NewIntConst(1) END ; + IF sym = OPS.by THEN OPS.Get(sym); ConstExpression(z) ELSE z := OPB.NewIntConst(1) END ; pos := OPM.errpos; x := OPB.NewLeaf(id); - IF z^.conval^.intval > 0 THEN OPB.Op(leq, x, y) - ELSIF z^.conval^.intval < 0 THEN OPB.Op(geq, x, y) - ELSE err(63); OPB.Op(geq, x, y) + IF z^.conval^.intval > 0 THEN OPB.Op(OPS.leq, x, y) + ELSIF z^.conval^.intval < 0 THEN OPB.Op(OPS.geq, x, y) + ELSE err(63); OPB.Op(OPS.geq, x, y) END ; - CheckSym(do); StatSeq(s); - y := OPB.NewLeaf(id); OPB.StPar1(y, z, incfn); SetPos(y); + CheckSym(OPS.do); StatSeq(s); + y := OPB.NewLeaf(id); OPB.StPar1(y, z, OPT.incfn); SetPos(y); IF s = NIL THEN s := y ELSE z := s; WHILE z^.link # NIL DO z := z^.link END ; z^.link := y END ; - CheckSym(end); OPB.Construct(Nwhile, x, s) - ELSE err(ident) + CheckSym(OPS.end); OPB.Construct(OPT.Nwhile, x, s) + ELSE err(OPS.ident) END - ELSIF sym = loop THEN + ELSIF sym = OPS.loop THEN OPS.Get(sym); INC(LoopLevel); StatSeq(x); DEC(LoopLevel); - OPB.Construct(Nloop, x, NIL); CheckSym(end); pos := OPM.errpos - ELSIF sym = with THEN + OPB.Construct(OPT.Nloop, x, NIL); CheckSym(OPS.end); pos := OPM.errpos + ELSIF sym = OPS.with THEN OPS.Get(sym); idtyp := NIL; x := NIL; LOOP - IF sym = ident THEN + IF sym = OPS.ident THEN qualident(id); y := OPB.NewLeaf(id); - IF (id # NIL) & (id^.typ^.form = Pointer) & ((id^.mode = VarPar) OR ~id^.leaf) THEN + IF (id # NIL) & (id^.typ^.form = OPT.Pointer) & ((id^.mode = OPT.VarPar) OR ~id^.leaf) THEN err(245) (* jt: do not allow WITH on non-local pointers *) END ; - CheckSym(colon); - IF sym = ident THEN qualident(t); - IF t^.mode = Typ THEN + CheckSym(OPS.colon); + IF sym = OPS.ident THEN qualident(t); + IF t^.mode = OPT.Typ THEN IF id # NIL THEN idtyp := id^.typ; OPB.TypTest(y, t, FALSE); id^.typ := t^.typ ELSE err(130) END ELSE err(52) END - ELSE err(ident) + ELSE err(OPS.ident) END - ELSE err(ident) + ELSE err(OPS.ident) END ; - pos := OPM.errpos; CheckSym(do); StatSeq(s); OPB.Construct(Nif, y, s); SetPos(y); + pos := OPM.errpos; CheckSym(OPS.do); StatSeq(s); OPB.Construct(OPT.Nif, y, s); SetPos(y); IF idtyp # NIL THEN id^.typ := idtyp; idtyp := NIL END ; IF x = NIL THEN x := y; lastif := x ELSE OPB.Link(x, lastif, y) END ; - IF sym = bar THEN OPS.Get(sym) ELSE EXIT END + IF sym = OPS.bar THEN OPS.Get(sym) ELSE EXIT END END; - e := sym = else; + e := sym = OPS.else; IF e THEN OPS.Get(sym); StatSeq(s) ELSE s := NIL END ; - OPB.Construct(Nwith, x, s); CheckSym(end); + OPB.Construct(OPT.Nwith, x, s); CheckSym(OPS.end); IF e THEN x^.subcl := 1 END - ELSIF sym = exit THEN + ELSIF sym = OPS.exit THEN OPS.Get(sym); IF LoopLevel = 0 THEN err(46) END ; - OPB.Construct(Nexit, x, NIL); + OPB.Construct(OPT.Nexit, x, NIL); pos := OPM.errpos - ELSIF sym = return THEN OPS.Get(sym); - IF sym < semicolon THEN Expression(x) END ; + ELSIF sym = OPS.return THEN OPS.Get(sym); + IF sym < OPS.semicolon THEN Expression(x) END ; IF level > 0 THEN OPB.Return(x, OPT.topScope^.link) ELSE (* not standard Oberon *) OPB.Return(x, NIL) END ; pos := OPM.errpos END ; IF x # NIL THEN SetPos(x); OPB.Link(stat, last, x) END ; - IF sym = semicolon THEN OPS.Get(sym) - ELSIF (sym <= ident) OR (if <= sym) & (sym <= return) THEN err(semicolon) + IF sym = OPS.semicolon THEN OPS.Get(sym) + ELSIF (sym <= OPS.ident) OR (OPS.if <= sym) & (sym <= OPS.return) THEN err(OPS.semicolon) ELSE EXIT END END @@ -957,67 +897,67 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) BEGIN first := NIL; last := NIL; nofFwdPtr := 0; LOOP - IF sym = const THEN + IF sym = OPS.const THEN OPS.Get(sym); - WHILE sym = ident DO + WHILE sym = OPS.ident DO OPT.Insert(OPS.name, obj); CheckMark(obj^.vis); - obj^.typ := OPT.sinttyp; obj^.mode := Var; (* Var to avoid recursive definition *) - IF sym = eql THEN + obj^.typ := OPT.sinttyp; obj^.mode := OPT.Var; (* OPT.Var to avoid recursive definition *) + IF sym = OPS.eql THEN OPS.Get(sym); ConstExpression(x) - ELSIF sym = becomes THEN - err(eql); OPS.Get(sym); ConstExpression(x) - ELSE err(eql); x := OPB.NewIntConst(1) + ELSIF sym = OPS.becomes THEN + err(OPS.eql); OPS.Get(sym); ConstExpression(x) + ELSE err(OPS.eql); x := OPB.NewIntConst(1) END ; - obj^.mode := Con; obj^.typ := x^.typ; obj^.conval := x^.conval; (* ConstDesc ist not copied *) - CheckSym(semicolon) + obj^.mode := OPT.Con; obj^.typ := x^.typ; obj^.conval := x^.conval; (* ConstDesc ist not copied *) + CheckSym(OPS.semicolon) END END ; - IF sym = type THEN + IF sym = OPS.type THEN OPS.Get(sym); - WHILE sym = ident DO - OPT.Insert(OPS.name, obj); obj^.mode := Typ; obj^.typ := OPT.undftyp; + WHILE sym = OPS.ident DO + OPT.Insert(OPS.name, obj); obj^.mode := OPT.Typ; obj^.typ := OPT.undftyp; CheckMark(obj^.vis); - IF sym = eql THEN + IF sym = OPS.eql THEN OPS.Get(sym); TypeDecl(obj^.typ, obj^.typ) - ELSIF (sym = becomes) OR (sym = colon) THEN - err(eql); OPS.Get(sym); TypeDecl(obj^.typ, obj^.typ) - ELSE err(eql) + ELSIF (sym = OPS.becomes) OR (sym = OPS.colon) THEN + err(OPS.eql); OPS.Get(sym); TypeDecl(obj^.typ, obj^.typ) + ELSE err(OPS.eql) END ; IF obj^.typ^.strobj = NIL THEN obj^.typ^.strobj := obj END ; - IF obj^.typ^.comp IN {Record, Array, DynArr} THEN + IF obj^.typ^.comp IN {OPT.Record, OPT.Array, OPT.DynArr} THEN i := 0; WHILE i < nofFwdPtr DO typ := FwdPtr[i]; INC(i); IF typ^.link^.name = obj^.name THEN typ^.BaseTyp := obj^.typ; typ^.link^.name := "" END END END ; - CheckSym(semicolon) + CheckSym(OPS.semicolon) END END ; - IF sym = var THEN + IF sym = OPS.var THEN OPS.Get(sym); - WHILE sym = ident DO + WHILE sym = OPS.ident DO LOOP - IF sym = ident THEN + IF sym = OPS.ident THEN OPT.Insert(OPS.name, obj); CheckMark(obj^.vis); - obj^.mode := Var; obj^.link := NIL; obj^.leaf := obj^.vis = internal; obj^.typ := OPT.undftyp; + obj^.mode := OPT.Var; obj^.link := NIL; obj^.leaf := obj^.vis = OPT.internal; obj^.typ := OPT.undftyp; IF first = NIL THEN first := obj END ; IF last = NIL THEN OPT.topScope^.scope := obj ELSE last^.link := obj END ; last := obj - ELSE err(ident) + ELSE err(OPS.ident) END ; - IF sym = comma THEN OPS.Get(sym) - ELSIF sym = ident THEN err(comma) + IF sym = OPS.comma THEN OPS.Get(sym) + ELSIF sym = OPS.ident THEN err(OPS.comma) ELSE EXIT END END ; - CheckSym(colon); Type(typ, OPT.notyp); + CheckSym(OPS.colon); Type(typ, OPT.notyp); typ^.pvused := TRUE; - IF typ^.comp = DynArr THEN typ := OPT.undftyp; err(88) END ; + IF typ^.comp = OPT.DynArr THEN typ := OPT.undftyp; err(88) END ; WHILE first # NIL DO first^.typ := typ; first := first^.link END ; - CheckSym(semicolon) + CheckSym(OPS.semicolon) END END ; - IF (sym < const) OR (sym > var) THEN EXIT END ; + IF (sym < OPS.const) OR (sym > OPS.var) THEN EXIT END ; END ; i := 0; WHILE i < nofFwdPtr DO @@ -1027,21 +967,21 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) END ; OPT.topScope^.adr := OPM.errpos; procdec := NIL; lastdec := NIL; - WHILE sym = procedure DO + WHILE sym = OPS.procedure DO OPS.Get(sym); ProcedureDeclaration(x); IF x # NIL THEN IF lastdec = NIL THEN procdec := x ELSE lastdec^.link := x END ; lastdec := x END ; - CheckSym(semicolon) + CheckSym(OPS.semicolon) END ; - IF sym = begin THEN OPS.Get(sym); StatSeq(statseq) + IF sym = OPS.begin THEN OPS.Get(sym); StatSeq(statseq) ELSE statseq := NIL END ; IF (level = 0) & (TDinit # NIL) THEN lastTDinit^.link := statseq; statseq := TDinit END ; - CheckSym(end) + CheckSym(OPS.end) END Block; PROCEDURE Module*(VAR prog: OPT.Node; opt: SET); @@ -1050,38 +990,48 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) c: LONGINT; done: BOOLEAN; BEGIN OPS.Init; LoopLevel := 0; level := 0; OPS.Get(sym); - IF sym = module THEN OPS.Get(sym) ELSE err(16) END ; - IF sym = ident THEN + IF sym = OPS.module THEN OPS.Get(sym) ELSE + (* Debug intermittent failure only found on OpenBSD *) + OPM.LogWLn; + OPM.LogWStr("Unexpected symbol found when MODULE expected:"); OPM.LogWLn; + OPM.LogWStr(" sym: "); OPM.LogWNum(sym,1); OPM.LogWLn; + OPM.LogWStr(" OPS.name: "); OPM.LogWStr(OPS.name); OPM.LogWLn; + OPM.LogWStr(" OPS.str: "); OPM.LogWStr(OPS.str); OPM.LogWLn; + OPM.LogWStr(" OPS.numtyp: "); OPM.LogWNum(OPS.numtyp,1); OPM.LogWLn; + OPM.LogWStr(" OPS.intval: "); OPM.LogWNum(OPS.intval,1); OPM.LogWLn; + err(16) + END; + IF sym = OPS.ident THEN OPM.LogWStr("compiling "); OPM.LogWStr(OPS.name); OPM.LogW("."); - OPT.Init(OPS.name, opt); OPS.Get(sym); CheckSym(semicolon); - IF sym = import THEN OPS.Get(sym); + OPT.Init(OPS.name, opt); OPS.Get(sym); CheckSym(OPS.semicolon); + IF sym = OPS.import THEN OPS.Get(sym); LOOP - IF sym = ident THEN + IF sym = OPS.ident THEN COPY(OPS.name, aliasName); COPY(aliasName, impName); OPS.Get(sym); - IF sym = becomes THEN OPS.Get(sym); - IF sym = ident THEN COPY(OPS.name, impName); OPS.Get(sym) ELSE err(ident) END + IF sym = OPS.becomes THEN OPS.Get(sym); + IF sym = OPS.ident THEN COPY(OPS.name, impName); OPS.Get(sym) ELSE err(OPS.ident) END END ; OPT.Import(aliasName, impName, done) - ELSE err(ident) + ELSE err(OPS.ident) END ; - IF sym = comma THEN OPS.Get(sym) - ELSIF sym = ident THEN err(comma) + IF sym = OPS.comma THEN OPS.Get(sym) + ELSIF sym = OPS.ident THEN err(OPS.comma) ELSE EXIT END END ; - CheckSym(semicolon) + CheckSym(OPS.semicolon) END ; IF OPM.noerr THEN TDinit := NIL; lastTDinit := NIL; c := OPM.errpos; Block(procdec, statseq); OPB.Enter(procdec, statseq, NIL); prog := procdec; prog^.conval := OPT.NewConst(); prog^.conval^.intval := c; - IF sym = ident THEN + IF sym = OPS.ident THEN IF OPS.name # OPT.SelfName THEN err(4) END ; OPS.Get(sym) - ELSE err(ident) + ELSE err(OPS.ident) END ; - IF sym # period THEN err(period) END + IF sym # OPS.period THEN err(OPS.period) END END - ELSE err(ident) + ELSE err(OPS.ident) END ; TDinit := NIL; lastTDinit := NIL END Module; diff --git a/src/compiler/OPS.Mod b/src/compiler/OPS.Mod index 8514886c..33b325d8 100644 --- a/src/compiler/OPS.Mod +++ b/src/compiler/OPS.Mod @@ -6,13 +6,49 @@ MODULE OPS; (* NW, RC 6.3.89 / 18.10.92 *) (* object model 3.6.92 *) MaxStrLen* = 256; MaxIdLen = 256; + + (* Symbols values (also used as op values): + | 0 1 2 3 4 + ---|-------------------------------------------------------- + 0 | null * / DIV MOD + 5 | & + - OR = + 10 | # < <= > >= + 15 | IN IS ^ . , + 20 | : .. ) ] } + 25 | OF THEN DO TO BY + 30 | ( [ { ~ := + 35 | number NIL string ident ; + 40 | | END ELSE ELSIF UNTIL + 45 | IF CASE WHILE REPEAT FOR + 50 | LOOP WITH EXIT RETURN ARRAY + 55 | RECORD POINTER BEGIN CONST TYPE + 60 | VAR PROCEDURE IMPORT MODULE eof + *) + + null* = 0; times* = 1; slash* = 2; div* = 3; mod* = 4; + and* = 5; plus* = 6; minus* = 7; or* = 8; eql* = 9; + neq* = 10; lss* = 11; leq* = 12; gtr* = 13; geq* = 14; + in* = 15; is* = 16; arrow* = 17; period* = 18; comma* = 19; + colon* = 20; upto* = 21; rparen* = 22; rbrak* = 23; rbrace* = 24; + of* = 25; then* = 26; do* = 27; to* = 28; by* = 29; + lparen* = 30; lbrak* = 31; lbrace* = 32; not* = 33; becomes* = 34; + number* = 35; nil* = 36; string* = 37; ident* = 38; semicolon* = 39; + bar* = 40; end* = 41; else* = 42; elsif* = 43; until* = 44; + if* = 45; case* = 46; while* = 47; repeat* = 48; for* = 49; + loop* = 50; with* = 51; exit* = 52; return* = 53; array* = 54; + record* = 55; pointer* = 56; begin* = 57; const* = 58; type* = 59; + var* = 60; procedure* = 61; import* = 62; module* = 63; eof* = 64; + + (* Symbol numtyp values *) + char* = 1; integer* = 2; real* = 3; longreal* = 4; + + TYPE Name* = ARRAY MaxIdLen OF CHAR; String* = ARRAY MaxStrLen OF CHAR; - (* name, str, numtyp, intval, realval, lrlval are implicit results of Get *) - VAR + (* name, str, numtyp, intval, realval, lrlval are implicit results of Get *) name*: Name; str*: String; numtyp*: INTEGER; (* 1 = char, 2 = integer, 3 = real, 4 = longreal *) @@ -20,43 +56,6 @@ MODULE OPS; (* NW, RC 6.3.89 / 18.10.92 *) (* object model 3.6.92 *) realval*: REAL; lrlval*: LONGREAL; - (*symbols: - | 0 1 2 3 4 - ---|-------------------------------------------------------- - 0 | null * / DIV MOD - 5 | & + - OR = - 10 | # < <= > >= - 15 | IN IS ^ . , - 20 | : .. ) ] } - 25 | OF THEN DO TO BY - 30 | ( [ { ~ := - 35 | number NIL string ident ; - 40 | | END ELSE ELSIF UNTIL - 45 | IF CASE WHILE REPEAT FOR - 50 | LOOP WITH EXIT RETURN ARRAY - 55 | RECORD POINTER BEGIN CONST TYPE - 60 | VAR PROCEDURE IMPORT MODULE eof *) - - CONST - (* numtyp values *) - char = 1; integer = 2; real = 3; longreal = 4; - - (*symbol values*) - null = 0; times = 1; slash = 2; div = 3; mod = 4; - and = 5; plus = 6; minus = 7; or = 8; eql = 9; - neq = 10; lss = 11; leq = 12; gtr = 13; geq = 14; - in = 15; is = 16; arrow = 17; period = 18; comma = 19; - colon = 20; upto = 21; rparen = 22; rbrak = 23; rbrace = 24; - of = 25; then = 26; do = 27; to = 28; by = 29; - lparen = 30; lbrak = 31; lbrace = 32; not = 33; becomes = 34; - number = 35; nil = 36; string = 37; ident = 38; semicolon = 39; - bar = 40; end = 41; else = 42; elsif = 43; until = 44; - if = 45; case = 46; while = 47; repeat = 48; for = 49; - loop = 50; with = 51; exit = 52; return = 53; array = 54; - record = 55; pointer = 56; begin = 57; const = 58; type = 59; - var = 60; procedure = 61; import = 62; module = 63; eof = 64; - - VAR ch: CHAR; (*current character*) PROCEDURE err(n: INTEGER); @@ -214,97 +213,99 @@ MODULE OPS; (* NW, RC 6.3.89 / 18.10.92 *) (* object model 3.6.92 *) END END ; CASE ch OF (* ch > " " *) - | 22X, 27X : Str(s) - | "#" : s := neq; OPM.Get(ch) - | "&" : s := and; OPM.Get(ch) - | "(" : OPM.Get(ch); - IF ch = "*" THEN Comment; Get(s) - ELSE s := lparen - END - | ")" : s := rparen; OPM.Get(ch) - | "*" : s := times; OPM.Get(ch) - | "+" : s := plus; OPM.Get(ch) - | "," : s := comma; OPM.Get(ch) - | "-" : s := minus; OPM.Get(ch) - | "." : OPM.Get(ch); - IF ch = "." THEN OPM.Get(ch); s := upto ELSE s := period END - | "/" : s := slash; OPM.Get(ch) - | "0".."9": Number; s := number - | ":" : OPM.Get(ch); - IF ch = "=" THEN OPM.Get(ch); s := becomes ELSE s := colon END - | ";" : s := semicolon; OPM.Get(ch) - | "<" : OPM.Get(ch); - IF ch = "=" THEN OPM.Get(ch); s := leq ELSE s := lss END - | "=" : s := eql; OPM.Get(ch) - | ">" : OPM.Get(ch); - IF ch = "=" THEN OPM.Get(ch); s := geq ELSE s := gtr END - | "A": Identifier(s); IF name = "ARRAY" THEN s := array END - | "B": Identifier(s); - IF name = "BEGIN" THEN s := begin - ELSIF name = "BY" THEN s := by - END - | "C": Identifier(s); - IF name = "CASE" THEN s := case - ELSIF name = "CONST" THEN s := const - END - | "D": Identifier(s); - IF name = "DO" THEN s := do - ELSIF name = "DIV" THEN s := div - END - | "E": Identifier(s); - IF name = "END" THEN s := end - ELSIF name = "ELSE" THEN s := else - ELSIF name = "ELSIF" THEN s := elsif - ELSIF name = "EXIT" THEN s := exit - END - | "F": Identifier(s); IF name = "FOR" THEN s := for END - | "I": Identifier(s); - IF name = "IF" THEN s := if - ELSIF name = "IN" THEN s := in - ELSIF name = "IS" THEN s := is - ELSIF name = "IMPORT" THEN s := import - END - | "L": Identifier(s); IF name = "LOOP" THEN s := loop END - | "M": Identifier(s); - IF name = "MOD" THEN s := mod - ELSIF name = "MODULE" THEN s := module - END - | "N": Identifier(s); IF name = "NIL" THEN s := nil END - | "O": Identifier(s); - IF name = "OR" THEN s := or - ELSIF name = "OF" THEN s := of - END - | "P": Identifier(s); - IF name = "PROCEDURE" THEN s := procedure - ELSIF name = "POINTER" THEN s := pointer - END - | "R": Identifier(s); - IF name = "RECORD" THEN s := record - ELSIF name = "REPEAT" THEN s := repeat - ELSIF name = "RETURN" THEN s := return - END - | "T": Identifier(s); - IF name = "THEN" THEN s := then - ELSIF name = "TO" THEN s := to - ELSIF name = "TYPE" THEN s := type - END - | "U": Identifier(s); IF name = "UNTIL" THEN s := until END - | "V": Identifier(s); IF name = "VAR" THEN s := var END - | "W": Identifier(s); - IF name = "WHILE" THEN s := while - ELSIF name = "WITH" THEN s := with - END - | "G".."H", "J", "K", "Q", "S", "X".."Z": Identifier(s) - | "[" : s := lbrak; OPM.Get(ch) - | "]" : s := rbrak; OPM.Get(ch) - | "^" : s := arrow; OPM.Get(ch) - | "a".."z": Identifier(s) - | "{" : s := lbrace; OPM.Get(ch) - | "|" : s := bar; OPM.Get(ch) - | "}" : s := rbrace; OPM.Get(ch) - | "~" : s := not; OPM.Get(ch) - | 7FX : s := upto; OPM.Get(ch) - ELSE s := null; OPM.Get(ch) + | 22X, + 27X: Str(s) + | "#": s := neq; OPM.Get(ch) + | "&": s := and; OPM.Get(ch) + | "(": OPM.Get(ch); + IF ch = "*" THEN Comment; Get(s) ELSE s := lparen END + | ")": s := rparen; OPM.Get(ch) + | "*": s := times; OPM.Get(ch) + | "+": s := plus; OPM.Get(ch) + | ",": s := comma; OPM.Get(ch) + | "-": s := minus; OPM.Get(ch) + | ".": OPM.Get(ch); + IF ch = "." THEN OPM.Get(ch); s := upto ELSE s := period END + | "/": s := slash; OPM.Get(ch) + | "0".."9": Number; s := number + | ":": OPM.Get(ch); + IF ch = "=" THEN OPM.Get(ch); s := becomes ELSE s := colon END + | ";": s := semicolon; OPM.Get(ch) + | "<": OPM.Get(ch); + IF ch = "=" THEN OPM.Get(ch); s := leq ELSE s := lss END + | "=": s := eql; OPM.Get(ch) + | ">": OPM.Get(ch); + IF ch = "=" THEN OPM.Get(ch); s := geq ELSE s := gtr END + | "A": Identifier(s); IF name = "ARRAY" THEN s := array END + | "B": Identifier(s); + IF name = "BEGIN" THEN s := begin + ELSIF name = "BY" THEN s := by + END + | "C": Identifier(s); + IF name = "CASE" THEN s := case + ELSIF name = "CONST" THEN s := const + END + | "D": Identifier(s); + IF name = "DO" THEN s := do + ELSIF name = "DIV" THEN s := div + END + | "E": Identifier(s); + IF name = "END" THEN s := end + ELSIF name = "ELSE" THEN s := else + ELSIF name = "ELSIF" THEN s := elsif + ELSIF name = "EXIT" THEN s := exit + END + | "F": Identifier(s); IF name = "FOR" THEN s := for END + | "I": Identifier(s); + IF name = "IF" THEN s := if + ELSIF name = "IN" THEN s := in + ELSIF name = "IS" THEN s := is + ELSIF name = "IMPORT" THEN s := import + END + | "L": Identifier(s); IF name = "LOOP" THEN s := loop END + | "M": Identifier(s); + IF name = "MOD" THEN s := mod + ELSIF name = "MODULE" THEN s := module + END + | "N": Identifier(s); IF name = "NIL" THEN s := nil END + | "O": Identifier(s); + IF name = "OR" THEN s := or + ELSIF name = "OF" THEN s := of + END + | "P": Identifier(s); + IF name = "PROCEDURE" THEN s := procedure + ELSIF name = "POINTER" THEN s := pointer + END + | "R": Identifier(s); + IF name = "RECORD" THEN s := record + ELSIF name = "REPEAT" THEN s := repeat + ELSIF name = "RETURN" THEN s := return + END + | "T": Identifier(s); + IF name = "THEN" THEN s := then + ELSIF name = "TO" THEN s := to + ELSIF name = "TYPE" THEN s := type + END + | "U": Identifier(s); IF name = "UNTIL" THEN s := until END + | "V": Identifier(s); IF name = "VAR" THEN s := var END + | "W": Identifier(s); + IF name = "WHILE" THEN s := while + ELSIF name = "WITH" THEN s := with + END + | "G".."H", + "J".."K", + "Q", "S", + "X".."Z": Identifier(s) + | "[": s := lbrak; OPM.Get(ch) + | "]": s := rbrak; OPM.Get(ch) + | "^": s := arrow; OPM.Get(ch) + | "a".."z": Identifier(s) + | "{": s := lbrace; OPM.Get(ch) + | "|": s := bar; OPM.Get(ch) + | "}": s := rbrace; OPM.Get(ch) + | "~": s := not; OPM.Get(ch) + | 7FX: s := upto; OPM.Get(ch) + ELSE s := null; OPM.Get(ch) END ; sym := s END Get; diff --git a/src/compiler/OPT.Mod b/src/compiler/OPT.Mod index 5912149b..fb77b0ea 100644 --- a/src/compiler/OPT.Mod +++ b/src/compiler/OPT.Mod @@ -6,24 +6,32 @@ MODULE OPT; (* NW, RC 6.3.89 / 23.1.92 *) (* object model 24.2.94 *) IMPORT OPS, OPM; -CONST - MaxConstLen* = OPS.MaxStrLen; +(* Constants - value of literals *) TYPE - Const* = POINTER TO ConstDesc; - Object* = POINTER TO ObjDesc; - Struct* = POINTER TO StrDesc; - Node* = POINTER TO NodeDesc; - ConstExt* = POINTER TO OPS.String; - + Const* = POINTER TO ConstDesc; + ConstExt* = POINTER TO OPS.String; ConstDesc* = RECORD ext*: ConstExt; (* string or code for code proc *) intval*: LONGINT; (* constant value or adr, proc par size, text position or least case label *) intval2*: LONGINT; (* string length, proc var size or larger case label *) setval*: SET; (* constant value, procedure body present or "ELSE" present in case *) realval*: LONGREAL (* real or longreal constant value *) - END ; + END; +CONST + MaxConstLen* = OPS.MaxStrLen; + + (* conval^.setval procedure flags *) + hasBody* = 1; isRedef* = 2; slNeeded* = 3; + + + + +(* Objects - named items - constants, types, variables, procedures *) +TYPE + Object* = POINTER TO ObjDesc; + Struct* = POINTER TO StrDesc; ObjDesc* = RECORD left*, right*: Object; link*, scope*: Object; @@ -38,22 +46,67 @@ TYPE conval*: Const; adr*, linkadr*: LONGINT; x*: INTEGER (* linkadr and x can be freely used by the backend *) - END ; + END; +CONST + (* Object.mode values *) + Var* = 1; VarPar* = 2; Con* = 3; Fld* = 4; Typ* = 5; LProc* = 6; XProc* = 7; + SProc* = 8; CProc* = 9; IProc* = 10; Mod* = 11; Head* = 12; TProc* = 13; + + (* Object.vis - module visibility of objects *) + internal* = 0; external* = 1; externalR* = 2; + + (* Object.history - History of imported objects *) + inserted* = 0; same* = 1; pbmodified* = 2; pvmodified* = 3; removed* = 4; inconsistent* = 5; + + (* Object.adr Function numbers *) + haltfn* = 0; newfn* = 1; absfn* = 2; capfn* = 3; ordfn* = 4; + entierfn* = 5; oddfn* = 6; minfn* = 7; maxfn* = 8; chrfn* = 9; + shortfn* = 10; longfn* = 11; sizefn* = 12; incfn* = 13; decfn* = 14; + inclfn* = 15; exclfn* = 16; lenfn* = 17; copyfn* = 18; ashfn* = 19; + adrfn* = 20; ccfn* = 21; lshfn* = 22; rotfn* = 23; getfn* = 24; (* SYSTEM *) + putfn* = 25; getrfn* = 26; putrfn* = 27; bitfn* = 28; valfn* = 29; (* SYSTEM *) + sysnewfn* = 30; movefn* = 31; (* SYSTEM *) + assertfn* = 32; + + + + +(* Structures - describe types independently of their name *) +TYPE StrDesc* = RECORD - form*, comp*: SHORTINT; - mno*, extlev*: SHORTINT; - ref*, sysflag*: INTEGER; - n*, size*: LONGINT; - align*, txtpos*: LONGINT; (* align is alignment for records and len offset for dynarrs *) - allocated*: BOOLEAN; - pbused*, pvused*: BOOLEAN; - fpdone, idfpdone: BOOLEAN; - idfp, pbfp*, pvfp*: LONGINT; - BaseTyp*: Struct; - link*, strobj*: Object - END ; + form*, comp*: SHORTINT; + mno*, extlev*: SHORTINT; + ref*, sysflag*: INTEGER; + n*, size*: LONGINT; + align*, txtpos*: LONGINT; (* align is alignment for records, len is offset for dynarrs *) + allocated*: BOOLEAN; + pbused*, pvused*: BOOLEAN; + fpdone, idfpdone: BOOLEAN; + idfp, pbfp, pvfp: LONGINT; + BaseTyp*: Struct; + link*, strobj*: Object + END; +CONST + (* Struct.form values *) + Undef* = 0; Byte* = 1; Bool* = 2; Char* = 3; + SInt* = 4; Int* = 5; LInt* = 6; + Real* = 7; LReal* = 8; Set* = 9; String* = 10; + NilTyp* = 11; NoTyp* = 12; Pointer* = 13; ProcTyp* = 14; + Comp* = 15; + + intSet* = {SInt..LInt}; realSet* = {Real, LReal}; + + (* Struct.comp - Composite structure forms *) + Basic* = 1; Array* = 2; DynArr* = 3; Record* = 4; + + + + +(* Nodes - statements, expressions and sub-expressions *) +TYPE + Node* = POINTER TO NodeDesc; NodeDesc* = RECORD left*, right*, link*: Node; class*, subcl*: SHORTINT; @@ -61,70 +114,66 @@ TYPE typ*: Struct; obj*: Object; conval*: Const - END ; + END; CONST - maxImps = 64; (* must be <= MAX(SHORTINT) *) + (* Node.class values *) + Nvar* = 0; Nvarpar* = 1; Nfield* = 2; Nderef* = 3; Nindex* = 4; Nguard* = 5; Neguard* = 6; + Nconst* = 7; Ntype* = 8; Nproc* = 9; Nupto* = 10; Nmop* = 11; Ndop* = 12; Ncall* = 13; + Ninittd* = 14; Nif* = 15; Ncaselse* = 16; Ncasedo* = 17; Nenter* = 18; Nassign* = 19; + Nifelse* = 20; Ncase* = 21; Nwhile* = 22; Nrepeat* = 23; Nloop* = 24; Nexit* = 25; + Nreturn* = 26; Nwith* = 27; Ntrap* = 28; + + + (* Node.subcl values - general *) + assign* = 0; (* Pseudo function number for assignment *) + super* = 1; + + (* Node.subcl values - functions *) + ash* = 17; msk* = 18; len* = 19; + conv* = 20; abs* = 21; cap* = 22; odd* = 23; + + (* Node.subcl values - SYSTEM functions *) + adr* = 24; cc* = 25; bit* = 26; lsh* = 27; rot* = 28; val* = 29; + + (* Note: some object.adr function numbers and some symbol types are + also are used as Node.subcl function ids *) + eql* = OPS.eql; neq* = OPS.neq; lss* = OPS.lss; + leq* = OPS.leq; gtr* = OPS.gtr; geq* = OPS.geq; + + + +CONST + maxImps = 64; (* must be <= MAX(SHORTINT) *) maxStruct = OPM.MaxStruct; (* must be < MAX(INTEGER) DIV 2 *) - FirstRef = (*20*)16; (* comp + 1 *) + FirstRef = Comp + 1; VAR - typSize*: PROCEDURE(typ: Struct); + typSize*: PROCEDURE(typ: Struct); topScope*: Object; - undftyp*, bytetyp*, booltyp*, chartyp*, sinttyp*, inttyp*, linttyp*, - realtyp*, lrltyp*, settyp*, stringtyp*, niltyp*, notyp*, sysptrtyp*(*, - int8typ*, int16typ*, int32typ*, int64typ* *): Struct; + + undftyp*, + bytetyp*, booltyp*, chartyp*, + sinttyp*, inttyp*, linttyp*, + realtyp*, lrltyp*, settyp*, stringtyp*, + niltyp*, notyp*, sysptrtyp*: Struct; + nofGmod*: SHORTINT; (*nof imports*) - GlbMod*: ARRAY maxImps OF Object; (* ^.right = first object, ^.name = module import name (not alias) *) - SelfName*: OPS.Name; (* name of module being compiled *) + GlbMod*: ARRAY maxImps OF Object; (* ^.right = first object, ^.name = module import name (not alias) *) + + SelfName*: OPS.Name; (* name of module being compiled *) SYSimported*: BOOLEAN; CONST - (* object modes *) - Var = 1; VarPar = 2; Con = 3; Fld = 4; Typ = 5; LProc = 6; XProc = 7; - SProc = 8; CProc = 9; IProc = 10; Mod = 11; Head = 12; TProc = 13; - (* structure forms *) - Undef = 0; Byte = 1; Bool = 2; Char = 3; - SInt = 4; Int = 5; LInt = 6; - Real = 7; LReal = 8; Set = 9; String = 10; NilTyp = 11; NoTyp = 12; - Pointer = 13; ProcTyp = 14; - Comp = 15; - (*Int8 = 7; Int16 = 8; Int32 = 9; Int64 = 10; - Real = 11; LReal = 12; Set = 13; String = 14; NilTyp = 15; NoTyp = 16; - Pointer = 17; ProcTyp = 18; - Comp = 19;*) - (*Real = 7; LReal = 8; Set = 9; String = 10; NilTyp = 11; NoTyp = 12; - Pointer = 13; ProcTyp = 14; - Int8 = 15; Int16 = 16; Int32 = 17; Int64 = 18; - Comp = 19;*) - (* composite structure forms *) - Basic = 1; Array = 2; DynArr = 3; Record = 4; - - (*function number*) - assign = 0; - haltfn = 0; newfn = 1; absfn = 2; capfn = 3; ordfn = 4; - entierfn = 5; oddfn = 6; minfn = 7; maxfn = 8; chrfn = 9; - shortfn = 10; longfn = 11; sizefn = 12; incfn = 13; decfn = 14; - inclfn = 15; exclfn = 16; lenfn = 17; copyfn = 18; ashfn = 19; assertfn = 32; - - (*SYSTEM function number*) - adrfn = 20; ccfn = 21; lshfn = 22; rotfn = 23; - getfn = 24; putfn = 25; getrfn = 26; putrfn = 27; - bitfn = 28; valfn = 29; sysnewfn = 30; movefn = 31; - - (* module visibility of objects *) - internal = 0; external = 1; externalR = 2; - - (* history of imported objects *) - inserted = 0; same = 1; pbmodified = 2; pvmodified = 3; removed = 4; inconsistent = 5; - - (* symbol file items *) - Smname = 16; Send = 18; Stype = 19; Salias = 20; Svar = 21; Srvar = 22; - Svalpar = 23; Svarpar = 24; Sfld = 25; Srfld = 26; Shdptr = 27; Shdpro = 28; Stpro = 29; Shdtpro = 30; - Sxpro = 31; Sipro = 32; Scpro = 33; Sstruct = 34; Ssys = 35; Sptr = 36; Sarr = 37; Sdarr = 38; Srec = 39; Spro = 40; + (* Symbol file items *) + Smname* = 16; Send* = 18; Stype* = 19; Salias* = 20; Svar* = 21; + Srvar* = 22; Svalpar* = 23; Svarpar* = 24; Sfld* = 25; Srfld* = 26; + Shdptr* = 27; Shdpro* = 28; Stpro* = 29; Shdtpro* = 30; Sxpro* = 31; + Sipro* = 32; Scpro* = 33; Sstruct* = 34; Ssys* = 35; Sptr* = 36; + Sarr* = 37; Sdarr* = 38; Srec* = 39; Spro* = 40; TYPE ImpCtxt = RECORD @@ -135,14 +184,14 @@ TYPE old: ARRAY maxStruct OF Object; pvfp: ARRAY maxStruct OF LONGINT; (* set only if old # NIL *) glbmno: ARRAY maxImps OF SHORTINT (* index is local mno *) - END ; + END; ExpCtxt = RECORD reffp: LONGINT; ref: INTEGER; nofm: SHORTINT; locmno: ARRAY maxImps OF SHORTINT (* index is global mno *) - END ; + END; VAR universe, syslink: Object; @@ -158,38 +207,38 @@ BEGIN OPM.err(n) END err; PROCEDURE NewConst*(): Const; -VAR const: Const; + VAR const: Const; BEGIN NEW(const); RETURN const END NewConst; PROCEDURE NewObj*(): Object; -VAR obj: Object; + VAR obj: Object; BEGIN NEW(obj); RETURN obj END NewObj; PROCEDURE NewStr*(form, comp: SHORTINT): Struct; -VAR typ: Struct; + VAR typ: Struct; BEGIN NEW(typ); typ^.form := form; typ^.comp := comp; typ^.ref := maxStruct; (* ref >= maxStruct: not exported yet *) -IF form # Undef THEN typ^.txtpos := OPM.errpos END ; (* txtpos remains 0 for structs read from symbol file *) -typ^.size := -1; typ^.BaseTyp := undftyp; RETURN typ + IF form # Undef THEN typ^.txtpos := OPM.errpos END ; (* txtpos remains 0 for structs read from symbol file *) + typ^.size := -1; typ^.BaseTyp := undftyp; RETURN typ END NewStr; PROCEDURE NewNode*(class: SHORTINT): Node; -VAR node: Node; + VAR node: Node; BEGIN NEW(node); node^.class := class; RETURN node END NewNode; PROCEDURE NewExt*(): ConstExt; -VAR ext: ConstExt; + VAR ext: ConstExt; BEGIN NEW(ext); RETURN ext END NewExt; PROCEDURE OpenScope*(level: SHORTINT; owner: Object); -VAR head: Object; + VAR head: Object; BEGIN head := NewObj(); -head^.mode := Head; head^.mnolev := level; head^.link := owner; -IF owner # NIL THEN owner^.scope := head END ; -head^.left := topScope; head^.right := NIL; head^.scope := NIL; topScope := head + head^.mode := Head; head^.mnolev := level; head^.link := owner; + IF owner # NIL THEN owner^.scope := head END; + head^.left := topScope; head^.right := NIL; head^.scope := NIL; topScope := head END OpenScope; PROCEDURE CloseScope*; @@ -197,97 +246,100 @@ BEGIN topScope := topScope^.left END CloseScope; PROCEDURE Init*(VAR name: OPS.Name; opt: SET); -CONST nsf = 4; fpc = 8; esf = 9; + CONST nsf = 4; fpc = 8; esf = 9; BEGIN -topScope := universe; OpenScope(0, NIL); SYSimported := FALSE; -SelfName := name; topScope^.name := name; -GlbMod[0] := topScope; nofGmod := 1; -newsf := nsf IN opt; findpc := fpc IN opt; extsf := newsf OR (esf IN opt); sfpresent := TRUE + topScope := universe; OpenScope(0, NIL); SYSimported := FALSE; + SelfName := name; topScope^.name := name; + GlbMod[0] := topScope; nofGmod := 1; + newsf := nsf IN opt; findpc := fpc IN opt; extsf := newsf OR (esf IN opt); sfpresent := TRUE END Init; PROCEDURE Close*; -VAR i: INTEGER; + VAR i: INTEGER; BEGIN (* garbage collection *) -CloseScope; -i := 0; WHILE i < maxImps DO GlbMod[i] := NIL; INC(i) END ; -i := FirstRef; WHILE i < maxStruct DO impCtxt.ref[i] := NIL; impCtxt.old[i] := NIL; INC(i) END + CloseScope; + i := 0; WHILE i < maxImps DO GlbMod[i] := NIL; INC(i) END; + i := FirstRef; WHILE i < maxStruct DO impCtxt.ref[i] := NIL; impCtxt.old[i] := NIL; INC(i) END END Close; PROCEDURE FindImport*(mod: Object; VAR res: Object); -VAR obj: Object; + VAR obj: Object; BEGIN obj := mod^.scope; -LOOP -IF obj = NIL THEN EXIT END ; -IF OPS.name < obj^.name THEN obj := obj^.left -ELSIF OPS.name > obj^.name THEN obj := obj^.right -ELSE (*found*) -IF (obj^.mode = Typ) & (obj^.vis = internal) THEN obj := NIL -ELSE obj^.used := TRUE -END ; -EXIT -END -END ; -res := obj + LOOP + IF obj = NIL THEN EXIT END; + IF OPS.name < obj^.name THEN obj := obj^.left + ELSIF OPS.name > obj^.name THEN obj := obj^.right + ELSE (*found*) + IF (obj^.mode = Typ) & (obj^.vis = internal) THEN obj := NIL + ELSE obj^.used := TRUE + END; + EXIT + END + END; + res := obj END FindImport; PROCEDURE Find*(VAR res: Object); -VAR obj, head: Object; + VAR obj, head: Object; BEGIN head := topScope; -LOOP obj := head^.right; -LOOP -IF obj = NIL THEN EXIT END ; -IF OPS.name < obj^.name THEN obj := obj^.left -ELSIF OPS.name > obj^.name THEN obj := obj^.right -ELSE (* found, obj^.used not set for local objects *) EXIT -END -END ; -IF obj # NIL THEN EXIT END ; -head := head^.left; -IF head = NIL THEN EXIT END -END ; -res := obj + LOOP obj := head^.right; + LOOP + IF obj = NIL THEN EXIT END; + IF OPS.name < obj^.name THEN obj := obj^.left + ELSIF OPS.name > obj^.name THEN obj := obj^.right + ELSE (* found, obj^.used not set for local objects *) EXIT + END + END; + IF obj # NIL THEN EXIT END; + head := head^.left; + IF head = NIL THEN EXIT END + END; + res := obj END Find; PROCEDURE FindField*(VAR name: OPS.Name; typ: Struct; VAR res: Object); -VAR obj: Object; + VAR obj: Object; BEGIN -WHILE typ # NIL DO obj := typ^.link; -WHILE obj # NIL DO -IF name < obj^.name THEN obj := obj^.left -ELSIF name > obj^.name THEN obj := obj^.right -ELSE (*found*) res := obj; RETURN -END -END ; -typ := typ^.BaseTyp -END ; -res := NIL + WHILE typ # NIL DO obj := typ^.link; + WHILE obj # NIL DO + IF name < obj^.name THEN obj := obj^.left + ELSIF name > obj^.name THEN obj := obj^.right + ELSE (*found*) res := obj; RETURN + END + END; + typ := typ^.BaseTyp + END; + res := NIL END FindField; PROCEDURE Insert*(VAR name: OPS.Name; VAR obj: Object); -VAR ob0, ob1: Object; left: BOOLEAN; mnolev: SHORTINT; + VAR ob0, ob1: Object; left: BOOLEAN; mnolev: SHORTINT; BEGIN ob0 := topScope; ob1 := ob0^.right; left := FALSE; -LOOP -IF ob1 # NIL THEN -IF name < ob1^.name THEN ob0 := ob1; ob1 := ob0^.left; left := TRUE -ELSIF name > ob1^.name THEN ob0 := ob1; ob1 := ob0^.right; left := FALSE -ELSE (*double def*) err(1); ob0 := ob1; ob1 := ob0^.right -END -ELSE (*insert*) ob1 := NewObj(); ob1^.leaf := TRUE; -IF left THEN ob0^.left := ob1 ELSE ob0^.right := ob1 END ; -ob1^.left := NIL; ob1^.right := NIL; COPY(name, ob1^.name); -mnolev := topScope^.mnolev; ob1^.mnolev := mnolev; -EXIT -END -END ; -obj := ob1 + LOOP + IF ob1 # NIL THEN + IF name < ob1^.name THEN ob0 := ob1; ob1 := ob0^.left; left := TRUE + ELSIF name > ob1^.name THEN ob0 := ob1; ob1 := ob0^.right; left := FALSE + ELSE (*double def*) err(1); ob0 := ob1; ob1 := ob0^.right + END + ELSE (*insert*) ob1 := NewObj(); ob1^.leaf := TRUE; + IF left THEN ob0^.left := ob1 ELSE ob0^.right := ob1 END; + ob1^.left := NIL; ob1^.right := NIL; COPY(name, ob1^.name); + mnolev := topScope^.mnolev; ob1^.mnolev := mnolev; + EXIT + END + END; + obj := ob1 END Insert; + (*-------------------------- Fingerprinting --------------------------*) +(* Fingerprints prevent structural type equivalence. *) + PROCEDURE FPrintName(VAR fp: LONGINT; VAR name: ARRAY OF CHAR); -VAR i: INTEGER; ch: CHAR; + VAR i: INTEGER; ch: CHAR; BEGIN i := 0; -REPEAT ch := name[i]; OPM.FPrint(fp, ORD(ch)); INC(i) UNTIL ch = 0X + REPEAT ch := name[i]; OPM.FPrint(fp, ORD(ch)); INC(i) UNTIL ch = 0X END FPrintName; PROCEDURE ^IdFPrint*(typ: Struct); @@ -328,134 +380,133 @@ BEGIN btyp := typ^.BaseTyp; strobj := typ^.strobj; IF (strobj # NIL) & (strobj^.name # "") THEN FPrintName(idfp, GlbMod[typ^.mno]^.name); FPrintName(idfp, strobj^.name) - END ; + END; IF (f = Pointer) OR (c = Record) & (btyp # NIL) OR (c = DynArr) THEN IdFPrint(btyp); OPM.FPrint(idfp, btyp^.idfp) ELSIF c = Array THEN IdFPrint(btyp); OPM.FPrint(idfp, btyp^.idfp); OPM.FPrint(idfp, typ^.n) ELSIF f = ProcTyp THEN FPrintSign(idfp, btyp, typ^.link) - END ; + END; typ^.idfp := idfp END END IdFPrint; PROCEDURE FPrintStr*(typ: Struct); -VAR f, c: INTEGER; btyp: Struct; strobj, bstrobj: Object; pbfp, pvfp: LONGINT; + VAR f, c: INTEGER; btyp: Struct; strobj, bstrobj: Object; pbfp, pvfp: LONGINT; -PROCEDURE ^FPrintFlds(fld: Object; adr: LONGINT; visible: BOOLEAN); + PROCEDURE ^FPrintFlds(fld: Object; adr: LONGINT; visible: BOOLEAN); -PROCEDURE FPrintHdFld(typ: Struct; fld: Object; adr: LONGINT); (* modifies pvfp only *) -VAR i, j, n: LONGINT; btyp: Struct; -BEGIN -IF typ^.comp = Record THEN FPrintFlds(typ^.link, adr, FALSE) -ELSIF typ^.comp = Array THEN btyp := typ^.BaseTyp; n := typ^.n; -WHILE btyp^.comp = Array DO n := btyp^.n * n; btyp := btyp^.BaseTyp END ; -IF (btyp^.form = Pointer) OR (btyp^.comp = Record) THEN - j := nofhdfld; FPrintHdFld(btyp, fld, adr); - IF j # nofhdfld THEN i := 1; - WHILE (i < n) & (nofhdfld <= OPM.MaxHdFld) DO - INC(adr, btyp^.size); FPrintHdFld(btyp, fld, adr); INC(i) + PROCEDURE FPrintHdFld(typ: Struct; fld: Object; adr: LONGINT); (* modifies pvfp only *) + VAR i, j, n: LONGINT; btyp: Struct; + BEGIN + IF typ^.comp = Record THEN FPrintFlds(typ^.link, adr, FALSE) + ELSIF typ^.comp = Array THEN btyp := typ^.BaseTyp; n := typ^.n; + WHILE btyp^.comp = Array DO n := btyp^.n * n; btyp := btyp^.BaseTyp END; + IF (btyp^.form = Pointer) OR (btyp^.comp = Record) THEN + j := nofhdfld; FPrintHdFld(btyp, fld, adr); + IF j # nofhdfld THEN i := 1; + WHILE (i < n) & (nofhdfld <= OPM.MaxHdFld) DO + INC(adr, btyp^.size); FPrintHdFld(btyp, fld, adr); INC(i) + END + END + END + ELSIF OPM.ExpHdPtrFld & ((typ^.form = Pointer) OR (fld^.name = OPM.HdPtrName)) THEN + OPM.FPrint(pvfp, Pointer); OPM.FPrint(pvfp, adr); INC(nofhdfld) + ELSIF OPM.ExpHdProcFld & ((typ^.form = ProcTyp) OR (fld^.name = OPM.HdProcName)) THEN + OPM.FPrint(pvfp, ProcTyp); OPM.FPrint(pvfp, adr); INC(nofhdfld) + END + END FPrintHdFld; + + PROCEDURE FPrintFlds(fld: Object; adr: LONGINT; visible: BOOLEAN); (* modifies pbfp and pvfp *) + BEGIN + WHILE (fld # NIL) & (fld^.mode = Fld) DO + IF (fld^.vis # internal) & visible THEN + OPM.FPrint(pbfp, fld^.vis); FPrintName(pbfp, fld^.name); OPM.FPrint(pbfp, fld^.adr); + FPrintStr(fld^.typ); OPM.FPrint(pbfp, fld^.typ^.pbfp); OPM.FPrint(pvfp, fld^.typ^.pvfp) + ELSE + FPrintHdFld(fld^.typ, fld, fld^.adr + adr) + END; + fld := fld^.link END; - END -END -ELSIF OPM.ExpHdPtrFld & ((typ^.form = Pointer) OR (fld^.name = OPM.HdPtrName)) THEN -OPM.FPrint(pvfp, Pointer); OPM.FPrint(pvfp, adr); INC(nofhdfld) -ELSIF OPM.ExpHdProcFld & ((typ^.form = ProcTyp) OR (fld^.name = OPM.HdProcName)) THEN -OPM.FPrint(pvfp, ProcTyp); OPM.FPrint(pvfp, adr); INC(nofhdfld) -END -END FPrintHdFld; + END FPrintFlds; -PROCEDURE FPrintFlds(fld: Object; adr: LONGINT; visible: BOOLEAN); (* modifies pbfp and pvfp *) -BEGIN -WHILE (fld # NIL) & (fld^.mode = Fld) DO - IF (fld^.vis # internal) & visible THEN - OPM.FPrint(pbfp, fld^.vis); FPrintName(pbfp, fld^.name); OPM.FPrint(pbfp, fld^.adr); - FPrintStr(fld^.typ); OPM.FPrint(pbfp, fld^.typ^.pbfp); OPM.FPrint(pvfp, fld^.typ^.pvfp) - ELSE - FPrintHdFld(fld^.typ, fld, fld^.adr + adr) - END ; - fld := fld^.link -END; -END FPrintFlds; - -PROCEDURE FPrintTProcs(obj: Object); (* modifies pbfp and pvfp *) -BEGIN - IF obj # NIL THEN + PROCEDURE FPrintTProcs(obj: Object); (* modifies pbfp and pvfp *) + BEGIN + IF obj # NIL THEN FPrintTProcs(obj^.left); IF obj^.mode = TProc THEN - IF obj^.vis # internal THEN - OPM.FPrint(pbfp, TProc); OPM.FPrint(pbfp, obj^.adr DIV 10000H); - FPrintSign(pbfp, obj^.typ, obj^.link); FPrintName(pbfp, obj^.name) - ELSIF OPM.ExpHdTProc THEN - OPM.FPrint(pvfp, TProc); OPM.FPrint(pvfp, obj^.adr DIV 10000H) - END - END ; + IF obj^.vis # internal THEN + OPM.FPrint(pbfp, TProc); OPM.FPrint(pbfp, obj^.adr DIV 10000H); + FPrintSign(pbfp, obj^.typ, obj^.link); FPrintName(pbfp, obj^.name) + ELSIF OPM.ExpHdTProc THEN + OPM.FPrint(pvfp, TProc); OPM.FPrint(pvfp, obj^.adr DIV 10000H) + END + END; FPrintTProcs(obj^.right) - END; -END FPrintTProcs; + END; + END FPrintTProcs; BEGIN - IF ~typ^.fpdone THEN - IdFPrint(typ); pbfp := typ^.idfp; - IF typ^.sysflag # 0 THEN OPM.FPrint(pbfp, typ^.sysflag) END ; - pvfp := pbfp; typ^.pbfp := pbfp; typ^.pvfp := pvfp; (* initial fprints may be used recursively *) - typ^.fpdone := TRUE; - f := typ^.form; c := typ^.comp; btyp := typ^.BaseTyp; - IF f = Pointer THEN - strobj := typ^.strobj; bstrobj := btyp^.strobj; - IF (strobj = NIL) OR (strobj^.name = "") OR (bstrobj = NIL) OR (bstrobj^.name = "") THEN - FPrintStr(btyp); OPM.FPrint(pbfp, btyp^.pbfp); pvfp := pbfp - (* else use idfp as pbfp and as pvfp, do not call FPrintStr(btyp) here, else cycle not broken *) - END - ELSIF f = ProcTyp THEN (* use idfp as pbfp and as pvfp *) - ELSIF c IN {Array, DynArr} THEN FPrintStr(btyp); OPM.FPrint(pbfp, btyp^.pvfp); pvfp := pbfp - ELSE (* c = Record *) - IF btyp # NIL THEN FPrintStr(btyp); OPM.FPrint(pbfp, btyp^.pbfp); OPM.FPrint(pvfp, btyp^.pvfp) END ; - OPM.FPrint(pvfp, typ^.size); OPM.FPrint(pvfp, typ^.align); OPM.FPrint(pvfp, typ^.n); - nofhdfld := 0; FPrintFlds(typ^.link, 0, TRUE); - IF nofhdfld > OPM.MaxHdFld THEN OPM.Mark(225, typ^.txtpos) END ; - FPrintTProcs(typ^.link); OPM.FPrint(pvfp, pbfp); strobj := typ^.strobj; - IF (strobj = NIL) OR (strobj^.name = "") THEN pbfp := pvfp END - END ; - typ^.pbfp := pbfp; typ^.pvfp := pvfp - END; + IF ~typ^.fpdone THEN + IdFPrint(typ); pbfp := typ^.idfp; + IF typ^.sysflag # 0 THEN OPM.FPrint(pbfp, typ^.sysflag) END; + pvfp := pbfp; typ^.pbfp := pbfp; typ^.pvfp := pvfp; (* initial fprints may be used recursively *) + typ^.fpdone := TRUE; + f := typ^.form; c := typ^.comp; btyp := typ^.BaseTyp; + IF f = Pointer THEN + strobj := typ^.strobj; bstrobj := btyp^.strobj; + IF (strobj = NIL) OR (strobj^.name = "") OR (bstrobj = NIL) OR (bstrobj^.name = "") THEN + FPrintStr(btyp); OPM.FPrint(pbfp, btyp^.pbfp); pvfp := pbfp + (* else use idfp as pbfp and as pvfp, do not call FPrintStr(btyp) here, else cycle not broken *) + END + ELSIF f = ProcTyp THEN (* use idfp as pbfp and as pvfp *) + ELSIF c IN {Array, DynArr} THEN FPrintStr(btyp); OPM.FPrint(pbfp, btyp^.pvfp); pvfp := pbfp + ELSE (* c = Record *) + IF btyp # NIL THEN FPrintStr(btyp); OPM.FPrint(pbfp, btyp^.pbfp); OPM.FPrint(pvfp, btyp^.pvfp) END; + OPM.FPrint(pvfp, typ^.size); OPM.FPrint(pvfp, typ^.align); OPM.FPrint(pvfp, typ^.n); + nofhdfld := 0; FPrintFlds(typ^.link, 0, TRUE); + IF nofhdfld > OPM.MaxHdFld THEN OPM.Mark(225, typ^.txtpos) END; + FPrintTProcs(typ^.link); OPM.FPrint(pvfp, pbfp); strobj := typ^.strobj; + IF (strobj = NIL) OR (strobj^.name = "") THEN pbfp := pvfp END + END; + typ^.pbfp := pbfp; typ^.pvfp := pvfp + END END FPrintStr; PROCEDURE FPrintObj*(obj: Object); VAR fprint: LONGINT; f, m: INTEGER; rval: REAL; ext: ConstExt; BEGIN - IF ~obj^.fpdone THEN - fprint := 0; obj^.fpdone := TRUE; - OPM.FPrint(fprint, obj^.mode); - IF obj^.mode = Con THEN - f := obj^.typ^.form; OPM.FPrint(fprint, f); - CASE f OF - | Bool, Char, SInt, Int, LInt(*, Int8, Int16, Int32, Int64*): - OPM.FPrint(fprint, obj^.conval^.intval) - | Set: - OPM.FPrintSet(fprint, obj^.conval^.setval) - | Real: - rval := SHORT(obj^.conval^.realval); OPM.FPrintReal(fprint, rval) - | LReal: - OPM.FPrintLReal(fprint, obj^.conval^.realval) - | String: - FPrintName(fprint, obj^.conval^.ext^) - | NilTyp: - ELSE err(127) - END - ELSIF obj^.mode = Var THEN - OPM.FPrint(fprint, obj^.vis); FPrintStr(obj^.typ); OPM.FPrint(fprint, obj^.typ^.pbfp) - ELSIF obj^.mode IN {XProc, IProc} THEN - FPrintSign(fprint, obj^.typ, obj^.link) - ELSIF obj^.mode = CProc THEN - FPrintSign(fprint, obj^.typ, obj^.link); ext := obj^.conval^.ext; - m := ORD(ext^[0]); f := 1; OPM.FPrint(fprint, m); - WHILE f <= m DO OPM.FPrint(fprint, ORD(ext^[f])); INC(f) END; - ELSIF obj^.mode = Typ THEN - FPrintStr(obj^.typ); OPM.FPrint(fprint, obj^.typ^.pbfp) - END ; - obj^.fprint := fprint - END + IF ~obj^.fpdone THEN + fprint := 0; obj^.fpdone := TRUE; + OPM.FPrint(fprint, obj^.mode); + IF obj^.mode = Con THEN + f := obj^.typ^.form; OPM.FPrint(fprint, f); + CASE f OF + | Bool, + Char, + SInt, + Int, + LInt: OPM.FPrint(fprint, obj^.conval^.intval) + | Set: OPM.FPrintSet(fprint, obj^.conval^.setval) + | Real: rval := SHORT(obj^.conval^.realval); OPM.FPrintReal(fprint, rval) + | LReal: OPM.FPrintLReal(fprint, obj^.conval^.realval) + | String: FPrintName(fprint, obj^.conval^.ext^) + | NilTyp: + ELSE err(127) + END + ELSIF obj^.mode = Var THEN + OPM.FPrint(fprint, obj^.vis); FPrintStr(obj^.typ); OPM.FPrint(fprint, obj^.typ^.pbfp) + ELSIF obj^.mode IN {XProc, IProc} THEN + FPrintSign(fprint, obj^.typ, obj^.link) + ELSIF obj^.mode = CProc THEN + FPrintSign(fprint, obj^.typ, obj^.link); ext := obj^.conval^.ext; + m := ORD(ext^[0]); f := 1; OPM.FPrint(fprint, m); + WHILE f <= m DO OPM.FPrint(fprint, ORD(ext^[f])); INC(f) END; + ELSIF obj^.mode = Typ THEN + FPrintStr(obj^.typ); OPM.FPrint(fprint, obj^.typ^.pbfp) + END; + obj^.fprint := fprint + END END FPrintObj; PROCEDURE FPrintErr*(obj: Object; errcode: INTEGER); @@ -463,19 +514,19 @@ VAR i, j: INTEGER; ch: CHAR; BEGIN IF obj^.mnolev # 0 THEN COPY(GlbMod[-obj^.mnolev]^.name, OPM.objname); i := 0; - WHILE OPM.objname[i] # 0X DO INC(i) END ; + WHILE OPM.objname[i] # 0X DO INC(i) END; OPM.objname[i] := "."; j := 0; INC(i); REPEAT ch := obj^.name[j]; OPM.objname[i] := ch; INC(j); INC(i) UNTIL ch = 0X; ELSE COPY(obj^.name, OPM.objname) - END ; + END; IF errcode = 249 THEN IF OPM.noerr THEN err(errcode) END ELSIF errcode = 253 THEN (* extension *) - IF ~symNew & ~symExtended & ~extsf THEN err(errcode) END ; + IF ~symNew & ~symExtended & ~extsf THEN err(errcode) END; symExtended := TRUE ELSE - IF ~symNew & ~newsf THEN err(errcode) END ; + IF ~symNew & ~newsf THEN err(errcode) END; symNew := TRUE END END FPrintErr; @@ -483,372 +534,361 @@ END FPrintErr; (*-------------------------- Import --------------------------*) PROCEDURE InsertImport*(obj: Object; VAR root, old: Object); -VAR ob0, ob1: Object; left: BOOLEAN; + VAR ob0, ob1: Object; left: BOOLEAN; BEGIN -IF root = NIL THEN root := obj; old := NIL -ELSE -ob0 := root; ob1 := ob0^.right; left := FALSE; -IF obj^.name < ob0^.name THEN ob1 := ob0^.left; left := TRUE -ELSIF obj^.name > ob0^.name THEN ob1 := ob0^.right; left := FALSE -ELSE old := ob0; RETURN -END ; -LOOP -IF ob1 # NIL THEN - IF obj^.name < ob1^.name THEN ob0 := ob1; ob1 := ob1^.left; left := TRUE - ELSIF obj^.name > ob1^.name THEN ob0 := ob1; ob1 := ob1^.right; left := FALSE - ELSE old := ob1; EXIT + IF root = NIL THEN root := obj; old := NIL + ELSE + ob0 := root; ob1 := ob0^.right; left := FALSE; + IF obj^.name < ob0^.name THEN ob1 := ob0^.left; left := TRUE + ELSIF obj^.name > ob0^.name THEN ob1 := ob0^.right; left := FALSE + ELSE old := ob0; RETURN + END; + LOOP + IF ob1 # NIL THEN + IF obj^.name < ob1^.name THEN ob0 := ob1; ob1 := ob1^.left; left := TRUE + ELSIF obj^.name > ob1^.name THEN ob0 := ob1; ob1 := ob1^.right; left := FALSE + ELSE old := ob1; EXIT + END + ELSE ob1 := obj; + IF left THEN ob0^.left := ob1 ELSE ob0^.right := ob1 END; + ob1^.left := NIL; ob1^.right := NIL; old := NIL; EXIT + END + END END -ELSE ob1 := obj; - IF left THEN ob0^.left := ob1 ELSE ob0^.right := ob1 END ; - ob1^.left := NIL; ob1^.right := NIL; old := NIL; EXIT -END -END -END END InsertImport; PROCEDURE InName(VAR name: ARRAY OF CHAR); VAR i: INTEGER; ch: CHAR; BEGIN i := 0; -REPEAT -OPM.SymRCh(ch); name[i] := ch; INC(i) -UNTIL ch = 0X + REPEAT + OPM.SymRCh(ch); name[i] := ch; INC(i) + UNTIL ch = 0X END InName; PROCEDURE InMod(VAR mno: SHORTINT); (* mno is global *) -VAR head: Object; name: OPS.Name; mn: LONGINT; i: SHORTINT; + VAR head: Object; name: OPS.Name; mn: LONGINT; i: SHORTINT; BEGIN -mn := OPM.SymRInt(); -IF mn = 0 THEN mno := impCtxt.glbmno[0] -ELSE -IF mn = Smname THEN -InName(name); -IF (name = SelfName) & ~impCtxt.self THEN err(154) END ; -i := 0; -WHILE (i < nofGmod) & (name # GlbMod[i].name) DO INC(i) END ; -IF i < nofGmod THEN mno := i (*module already present*) -ELSE - head := NewObj(); head^.mode := Head; COPY(name, head^.name); - mno := nofGmod; head^.mnolev := -mno; - IF nofGmod < maxImps THEN - GlbMod[mno] := head; INC(nofGmod) - ELSE err(227) + mn := OPM.SymRInt(); + IF mn = 0 THEN mno := impCtxt.glbmno[0] + ELSE + IF mn = Smname THEN + InName(name); + IF (name = SelfName) & ~impCtxt.self THEN err(154) END; + i := 0; + WHILE (i < nofGmod) & (name # GlbMod[i].name) DO INC(i) END; + IF i < nofGmod THEN mno := i (*module already present*) + ELSE + head := NewObj(); head^.mode := Head; COPY(name, head^.name); + mno := nofGmod; head^.mnolev := -mno; + IF nofGmod < maxImps THEN + GlbMod[mno] := head; INC(nofGmod) + ELSE err(227) + END + END; + impCtxt.glbmno[impCtxt.nofm] := mno; INC(impCtxt.nofm) + ELSE + mno := impCtxt.glbmno[-mn] + END END -END ; -impCtxt.glbmno[impCtxt.nofm] := mno; INC(impCtxt.nofm) -ELSE -mno := impCtxt.glbmno[-mn] -END -END END InMod; PROCEDURE InConstant(f: LONGINT; conval: Const); -VAR ch: CHAR; i: INTEGER; ext: ConstExt; rval: REAL; + VAR ch: CHAR; i: INTEGER; ext: ConstExt; rval: REAL; BEGIN -CASE f OF -| (*Int8,*) Byte, Char, Bool: -OPM.SymRCh(ch); conval^.intval := ORD(ch) -(*| Int8, Int16, Int32, Int64: -conval^.intval := OPM.SymRInt()*) -| SInt, Int, LInt: -conval^.intval := OPM.SymRInt() -| Set: -OPM.SymRSet(conval^.setval) -| Real: -OPM.SymRReal(rval); conval^.realval := rval; -conval^.intval := OPM.ConstNotAlloc -| LReal: -OPM.SymRLReal(conval^.realval); -conval^.intval := OPM.ConstNotAlloc -| String: -ext := NewExt(); conval^.ext := ext; i := 0; -REPEAT -OPM.SymRCh(ch); ext^[i] := ch; INC(i) -UNTIL ch = 0X; -conval^.intval2 := i; -conval^.intval := OPM.ConstNotAlloc -| NilTyp: -conval^.intval := OPM.nilval -ELSE -OPM.LogWStr("unhandled case in OPT.InConstant(), f = "); OPM.LogWNum(f, 0); OPM.LogWLn; -END + CASE f OF + | Byte, + Char, + Bool: OPM.SymRCh(ch); conval^.intval := ORD(ch) + | SInt, + Int, + LInt: conval^.intval := OPM.SymRInt() + | Set: OPM.SymRSet(conval^.setval) + | Real: OPM.SymRReal(rval); conval^.realval := rval; + conval^.intval := OPM.ConstNotAlloc + | LReal: OPM.SymRLReal(conval^.realval); + conval^.intval := OPM.ConstNotAlloc + | String: ext := NewExt(); conval^.ext := ext; i := 0; + REPEAT + OPM.SymRCh(ch); ext^[i] := ch; INC(i) + UNTIL ch = 0X; + conval^.intval2 := i; + conval^.intval := OPM.ConstNotAlloc + | NilTyp: conval^.intval := OPM.nilval + ELSE OPM.LogWStr("unhandled case in InConstant(), f = "); OPM.LogWNum(f, 0); OPM.LogWLn; + END END InConstant; PROCEDURE ^InStruct(VAR typ: Struct); PROCEDURE InSign(mno: SHORTINT; VAR res: Struct; VAR par: Object); -VAR last, new: Object; tag: LONGINT; + VAR last, new: Object; tag: LONGINT; BEGIN -InStruct(res); -tag := OPM.SymRInt(); last := NIL; -WHILE tag # Send DO -new := NewObj(); new^.mnolev := -mno; -IF last = NIL THEN par := new ELSE last^.link := new END ; -IF tag = Svalpar THEN new^.mode := Var ELSE new^.mode := VarPar END ; -InStruct(new^.typ); new^.adr := OPM.SymRInt(); InName(new^.name); -last := new; tag := OPM.SymRInt() -END + InStruct(res); + tag := OPM.SymRInt(); last := NIL; + WHILE tag # Send DO + new := NewObj(); new^.mnolev := -mno; + IF last = NIL THEN par := new ELSE last^.link := new END; + IF tag = Svalpar THEN new^.mode := Var ELSE new^.mode := VarPar END; + InStruct(new^.typ); new^.adr := OPM.SymRInt(); InName(new^.name); + last := new; tag := OPM.SymRInt() + END END InSign; PROCEDURE InFld(): Object; (* first number in impCtxt.nextTag, mno set outside *) -VAR tag: LONGINT; obj: Object; + VAR tag: LONGINT; obj: Object; BEGIN -tag := impCtxt.nextTag; obj := NewObj(); -IF tag <= Srfld THEN -obj^.mode := Fld; -IF tag = Srfld THEN obj^.vis := externalR ELSE obj^.vis := external END ; -InStruct(obj^.typ); InName(obj^.name); -obj^.adr := OPM.SymRInt() -ELSE -obj^.mode := Fld; -IF tag = Shdptr THEN obj^.name := OPM.HdPtrName ELSE obj^.name := OPM.HdProcName END ; -obj^.typ := undftyp; obj^.vis := internal; -obj^.adr := OPM.SymRInt() -END ; -RETURN obj + tag := impCtxt.nextTag; obj := NewObj(); + IF tag <= Srfld THEN + obj^.mode := Fld; + IF tag = Srfld THEN obj^.vis := externalR ELSE obj^.vis := external END; + InStruct(obj^.typ); InName(obj^.name); + obj^.adr := OPM.SymRInt() + ELSE + obj^.mode := Fld; + IF tag = Shdptr THEN obj^.name := OPM.HdPtrName ELSE obj^.name := OPM.HdProcName END; + obj^.typ := undftyp; obj^.vis := internal; + obj^.adr := OPM.SymRInt() + END; + RETURN obj END InFld; PROCEDURE InTProc(mno: SHORTINT): Object; (* first number in impCtxt.nextTag *) -VAR tag: LONGINT; obj: Object; + VAR tag: LONGINT; obj: Object; BEGIN -tag := impCtxt.nextTag; -obj := NewObj(); obj^.mnolev := -mno; -IF tag = Stpro THEN -obj^.mode := TProc; obj^.conval := NewConst(); obj^.conval^.intval := -1; -InSign(mno, obj^.typ, obj^.link); obj^.vis := external; InName(obj^.name); -obj^.adr := 10000H*OPM.SymRInt() -ELSE (* tag = Shdtpro *) -obj^.mode := TProc; obj^.name := OPM.HdTProcName; -obj^.link := NewObj(); (* dummy, easier in Browser *) -obj^.typ := undftyp; obj^.vis := internal; -obj^.adr := 10000H*OPM.SymRInt() -END ; -RETURN obj + tag := impCtxt.nextTag; + obj := NewObj(); obj^.mnolev := -mno; + IF tag = Stpro THEN + obj^.mode := TProc; obj^.conval := NewConst(); obj^.conval^.intval := -1; + InSign(mno, obj^.typ, obj^.link); obj^.vis := external; InName(obj^.name); + obj^.adr := 10000H*OPM.SymRInt() + ELSE (* tag = Shdtpro *) + obj^.mode := TProc; obj^.name := OPM.HdTProcName; + obj^.link := NewObj(); (* dummy, easier in Browser *) + obj^.typ := undftyp; obj^.vis := internal; + obj^.adr := 10000H*OPM.SymRInt() + END; + RETURN obj END InTProc; PROCEDURE InStruct(VAR typ: Struct); -VAR mno: SHORTINT; ref: INTEGER; tag: LONGINT; name: OPS.Name; -t: Struct; obj, last, fld, old, dummy: Object; + VAR mno: SHORTINT; ref: INTEGER; tag: LONGINT; name: OPS.Name; + t: Struct; obj, last, fld, old, dummy: Object; BEGIN - tag := OPM.SymRInt(); - IF tag # Sstruct THEN - typ := impCtxt.ref[-tag] - ELSE - ref := impCtxt.nofr; INC(impCtxt.nofr); - IF ref < impCtxt.minr THEN impCtxt.minr := ref END ; - InMod(mno); InName(name); obj := NewObj(); - IF name = "" THEN - IF impCtxt.self THEN - old := NIL (* do not insert type desc anchor here, but in OPL *) - ELSE - obj^.name := "@"; InsertImport(obj, GlbMod[mno].right, old(*=NIL*)); obj^.name := "" - END ; - typ := NewStr(Undef, Basic) - ELSE - obj^.name := name; InsertImport(obj, GlbMod[mno].right, old); - IF old # NIL THEN (* recalculate fprints to compare with old fprints *) - FPrintObj(old); impCtxt.pvfp[ref] := old^.typ^.pvfp; - IF impCtxt.self THEN (* do not overwrite old typ *) - typ := NewStr(Undef, Basic) - ELSE (* overwrite old typ for compatibility reason *) - typ := old^.typ; typ^.link := NIL; typ^.sysflag := 0; - typ^.fpdone := FALSE; typ^.idfpdone := FALSE - END - ELSE - typ := NewStr(Undef, Basic) - END - END ; - impCtxt.ref[ref] := typ; impCtxt.old[ref] := old; - typ^.ref := ref + maxStruct; - (* ref >= maxStruct: not exported yet, ref used for err 155 *) - typ^.mno := mno; typ^.allocated := TRUE; - typ^.strobj := obj; obj^.mode := Typ; obj^.typ := typ; - obj^.mnolev := -mno; obj^.vis := internal; (* name not visible here *) - tag := OPM.SymRInt(); - IF tag = Ssys THEN typ^.sysflag := SHORT(OPM.SymRInt()); tag := OPM.SymRInt() END ; - CASE tag OF - | Sptr: - typ^.form := Pointer; typ^.size := OPM.PointerSize; - typ^.n := 0; InStruct(typ^.BaseTyp) - | Sarr: - typ^.form := Comp; typ^.comp := Array; - InStruct(typ^.BaseTyp); typ^.n := OPM.SymRInt(); - typSize(typ) (* no bounds address !! *) - | Sdarr: - typ^.form := Comp; typ^.comp := DynArr; InStruct(typ^.BaseTyp); - IF typ^.BaseTyp^.comp = DynArr THEN - typ^.n := typ^.BaseTyp^.n + 1 - ELSE - typ^.n := 0 - END ; - typSize(typ) - | Srec: - typ^.form := Comp; typ^.comp := Record; - InStruct(typ^.BaseTyp); - IF typ^.BaseTyp = notyp THEN typ^.BaseTyp := NIL END; - typ.extlev := 0; t := typ.BaseTyp; - (* do not take extlev from base type due to possible cycles! *) - WHILE (t # NIL) (*& (t^.BaseTyp # t)*)(*(t^.(*BaseTyp^.*)form # 0)*) DO INC(typ^.extlev); t := t.BaseTyp END; (* !!! *) - typ^.size := OPM.SymRInt(); typ^.align := OPM.SymRInt(); - typ^.n := OPM.SymRInt(); - impCtxt.nextTag := OPM.SymRInt(); last := NIL; - WHILE (impCtxt.nextTag >= Sfld) & (impCtxt.nextTag <= Shdpro) DO - fld := InFld(); fld^.mnolev := -mno; - IF last # NIL THEN last^.link := fld END ; - last := fld; InsertImport(fld, typ^.link, dummy); - impCtxt.nextTag := OPM.SymRInt() - END ; - WHILE impCtxt.nextTag # Send DO - fld := InTProc(mno); - InsertImport(fld, typ^.link, dummy); - impCtxt.nextTag := OPM.SymRInt() - END - | Spro: - typ^.form := ProcTyp; typ^.size := OPM.ProcSize; - InSign(mno, typ^.BaseTyp, typ^.link) - ELSE - OPM.LogWStr("unhandled case at OPT.InStruct, tag = "); OPM.LogWNum(tag, 0); OPM.LogWLn; -END ; - IF ref = impCtxt.minr THEN - WHILE (ref < impCtxt.nofr) (*OR ((ref >= Int8) & (ref <= Int64))*) DO - t := impCtxt.ref[ref]; FPrintStr(t); - obj := t^.strobj; (* obj^.typ^.strobj = obj, else obj^.fprint differs (alias) *) - IF obj^.name # "" THEN FPrintObj(obj) END ; - old := impCtxt.old[ref]; - IF old # NIL THEN - t^.strobj := old; (* restore strobj *) - IF impCtxt.self THEN - IF old^.mnolev < 0 THEN - IF old^.history # inconsistent THEN - IF old^.fprint # obj^.fprint THEN - old^.history := pbmodified - ELSIF impCtxt.pvfp[ref] # t^.pvfp THEN - old^.history := pvmodified - END - (* ELSE remain inconsistent *) - END - ELSIF old^.fprint # obj^.fprint THEN - old^.history := pbmodified - ELSIF impCtxt.pvfp[ref] # t^.pvfp THEN - old^.history := pvmodified - ELSIF old^.vis = internal THEN - old^.history := same (* may be changed to "removed" in InObj *) - ELSE - old^.history := inserted (* may be changed to "same" in InObj *) - END - ELSE - (* check private part, delay error message until really used *) - IF impCtxt.pvfp[ref] # t^.pvfp THEN - old^.history := inconsistent - END ; - IF old^.fprint # obj^.fprint THEN - FPrintErr(old, 249) - END - END - ELSIF impCtxt.self THEN - obj^.history := removed - ELSE - obj^.history := same - END ; - INC(ref) - END ; - impCtxt.minr := maxStruct - END - END -END InStruct; - - PROCEDURE InObj(mno: SHORTINT): Object; (* first number in impCtxt.nextTag *) - VAR i, s: INTEGER; ch: CHAR; obj, old: Object; typ: Struct; - tag: LONGINT; ext: ConstExt; - BEGIN - tag := impCtxt.nextTag; - IF tag = Stype THEN - InStruct(typ); obj := typ^.strobj; - IF ~impCtxt.self THEN obj^.vis := external END (* type name visible now, obj^.fprint already done *) - ELSE - obj := NewObj(); obj^.mnolev := -mno; obj^.vis := external; - IF tag <= Pointer THEN (* Constant *) - obj^.mode := Con; obj^.typ := impCtxt.ref[tag]; obj^.conval := NewConst(); InConstant(tag, obj^.conval) - ELSIF tag >= Sxpro THEN - obj^.conval := NewConst(); - obj^.conval^.intval := -1; - InSign(mno, obj^.typ, obj^.link); - CASE tag OF - | Sxpro: obj^.mode := XProc - | Sipro: obj^.mode := IProc - | Scpro: obj^.mode := CProc; - ext := NewExt(); obj^.conval^.ext := ext; - s := SHORT(OPM.SymRInt()); ext^[0] := CHR(s); i := 1; - WHILE i <= s DO OPM.SymRCh(ext^[i]); INC(i) END + tag := OPM.SymRInt(); + IF tag # Sstruct THEN + typ := impCtxt.ref[-tag] ELSE - OPM.LogWStr("unhandled case at OPT.InObj, tag = "); OPM.LogWNum(tag, 0); OPM.LogWLn; - END - ELSIF tag = Salias THEN - obj^.mode := Typ; InStruct(obj^.typ) - ELSE - obj^.mode := Var; - IF tag = Srvar THEN obj^.vis := externalR END ; - InStruct(obj^.typ) - END ; - InName(obj^.name) - END ; - FPrintObj(obj); - IF (obj^.mode = Var) & ((obj^.typ^.strobj = NIL) OR (obj^.typ^.strobj^.name = "")) THEN - (* compute a global fingerprint to avoid structural type equivalence for anonymous types *) - OPM.FPrint(impCtxt.reffp, obj^.typ^.ref - maxStruct) - END ; - IF tag # Stype THEN - InsertImport(obj, GlbMod[mno].right, old); + ref := impCtxt.nofr; INC(impCtxt.nofr); + IF ref < impCtxt.minr THEN impCtxt.minr := ref END; + InMod(mno); InName(name); obj := NewObj(); + IF name = "" THEN IF impCtxt.self THEN + old := NIL (* do not insert type desc anchor here, but in OPL *) + ELSE + obj^.name := "@"; InsertImport(obj, GlbMod[mno].right, old(*=NIL*)); obj^.name := "" + END; + typ := NewStr(Undef, Basic) + ELSE + obj^.name := name; InsertImport(obj, GlbMod[mno].right, old); + IF old # NIL THEN (* recalculate fprints to compare with old fprints *) + FPrintObj(old); impCtxt.pvfp[ref] := old^.typ^.pvfp; + IF impCtxt.self THEN (* do not overwrite old typ *) + typ := NewStr(Undef, Basic) + ELSE (* overwrite old typ for compatibility reason *) + typ := old^.typ; typ^.link := NIL; typ^.sysflag := 0; + typ^.fpdone := FALSE; typ^.idfpdone := FALSE + END + ELSE + typ := NewStr(Undef, Basic) + END + END; + impCtxt.ref[ref] := typ; impCtxt.old[ref] := old; + typ^.ref := ref + maxStruct; + (* ref >= maxStruct: not exported yet, ref used for err 155 *) + typ^.mno := mno; typ^.allocated := TRUE; + typ^.strobj := obj; obj^.mode := Typ; obj^.typ := typ; + obj^.mnolev := -mno; obj^.vis := internal; (* name not visible here *) + tag := OPM.SymRInt(); + IF tag = Ssys THEN typ^.sysflag := SHORT(OPM.SymRInt()); tag := OPM.SymRInt() END; + CASE tag OF + | Sptr: typ^.form := Pointer; typ^.size := OPM.PointerSize; + typ^.n := 0; InStruct(typ^.BaseTyp) + | Sarr: typ^.form := Comp; typ^.comp := Array; + InStruct(typ^.BaseTyp); typ^.n := OPM.SymRInt(); + typSize(typ) (* no bounds address !! *) + | Sdarr: typ^.form := Comp; typ^.comp := DynArr; InStruct(typ^.BaseTyp); + IF typ^.BaseTyp^.comp = DynArr THEN + typ^.n := typ^.BaseTyp^.n + 1 + ELSE + typ^.n := 0 + END; + typSize(typ) + | Srec: typ^.form := Comp; typ^.comp := Record; + InStruct(typ^.BaseTyp); + IF typ^.BaseTyp = notyp THEN typ^.BaseTyp := NIL END; + typ.extlev := 0; t := typ.BaseTyp; + (* do not take extlev from base type due to possible cycles! *) + WHILE (t # NIL) (*& (t^.BaseTyp # t)*)(*(t^.(*BaseTyp^.*)form # 0)*) DO + INC(typ^.extlev); t := t.BaseTyp + END; (* !!! *) + typ^.size := OPM.SymRInt(); typ^.align := OPM.SymRInt(); + typ^.n := OPM.SymRInt(); + impCtxt.nextTag := OPM.SymRInt(); last := NIL; + WHILE (impCtxt.nextTag >= Sfld) & (impCtxt.nextTag <= Shdpro) DO + fld := InFld(); fld^.mnolev := -mno; + IF last # NIL THEN last^.link := fld END; + last := fld; InsertImport(fld, typ^.link, dummy); + impCtxt.nextTag := OPM.SymRInt() + END; + WHILE impCtxt.nextTag # Send DO + fld := InTProc(mno); + InsertImport(fld, typ^.link, dummy); + impCtxt.nextTag := OPM.SymRInt() + END + | Spro: typ^.form := ProcTyp; typ^.size := OPM.ProcSize; + InSign(mno, typ^.BaseTyp, typ^.link) + ELSE OPM.LogWStr("unhandled case at InStruct, tag = "); OPM.LogWNum(tag, 0); OPM.LogWLn; + END; + IF ref = impCtxt.minr THEN + WHILE (ref < impCtxt.nofr) (*OR ((ref >= Int8) & (ref <= Int64))*) DO + t := impCtxt.ref[ref]; FPrintStr(t); + obj := t^.strobj; (* obj^.typ^.strobj = obj, else obj^.fprint differs (alias) *) + IF obj^.name # "" THEN FPrintObj(obj) END; + old := impCtxt.old[ref]; IF old # NIL THEN - (* obj is from old symbol file, old is new declaration *) - IF old^.vis = internal THEN old^.history := removed - ELSE FPrintObj(old); (* FPrint(obj) already called *) - IF obj^.fprint # old^.fprint THEN old^.history := pbmodified - ELSIF obj^.typ^.pvfp # old^.typ^.pvfp THEN old^.history := pvmodified - ELSE old^.history := same + t^.strobj := old; (* restore strobj *) + IF impCtxt.self THEN + IF old^.mnolev < 0 THEN + IF old^.history # inconsistent THEN + IF old^.fprint # obj^.fprint THEN + old^.history := pbmodified + ELSIF impCtxt.pvfp[ref] # t^.pvfp THEN + old^.history := pvmodified + END + (* ELSE remain inconsistent *) + END + ELSIF old^.fprint # obj^.fprint THEN + old^.history := pbmodified + ELSIF impCtxt.pvfp[ref] # t^.pvfp THEN + old^.history := pvmodified + ELSIF old^.vis = internal THEN + old^.history := same (* may be changed to "removed" in InObj *) + ELSE + old^.history := inserted (* may be changed to "same" in InObj *) + END + ELSE + (* check private part, delay error message until really used *) + IF impCtxt.pvfp[ref] # t^.pvfp THEN + old^.history := inconsistent + END; + IF old^.fprint # obj^.fprint THEN + FPrintErr(old, 249) END END - ELSE obj^.history := removed (* OutObj not called if mnolev < 0 *) - END - (* ELSE old = NIL, or file read twice, consistent, OutObj not called *) - END - ELSE (* obj already inserted in InStruct *) - IF impCtxt.self THEN (* obj^.mnolev = 0 *) - IF obj^.vis = internal THEN obj^.history := removed - ELSIF obj^.history = inserted THEN obj^.history := same - END - (* ELSE OutObj not called for obj with mnolev < 0 *) - END - END ; - RETURN obj - END InObj; - - PROCEDURE Import*(aliasName: OPS.Name; VAR name: OPS.Name; VAR done: BOOLEAN); - VAR obj: Object; mno: SHORTINT; (* done used in Browser *) - BEGIN - IF name = "SYSTEM" THEN SYSimported := TRUE; - Insert(aliasName, obj); obj^.mode := Mod; obj^.mnolev := 0; obj^.scope := syslink; obj^.typ := notyp - ELSE - impCtxt.nofr := FirstRef(*Comp+1*); impCtxt.minr := maxStruct; impCtxt.nofm := 0; - impCtxt.self := aliasName = "@self"; impCtxt.reffp := 0; - OPM.OldSym(name, done); - IF done THEN - InMod(mno); - impCtxt.nextTag := OPM.SymRInt(); - WHILE ~OPM.eofSF() DO - obj := InObj(mno); impCtxt.nextTag := OPM.SymRInt() - END ; - Insert(aliasName, obj); - obj^.mode := Mod; obj^.scope := GlbMod[mno].right; - GlbMod[mno].link := obj; - obj^.mnolev := -mno; obj^.typ := notyp; - OPM.CloseOldSym - ELSIF impCtxt.self THEN - newsf := TRUE; extsf := TRUE; sfpresent := FALSE - ELSE err(152) (*sym file not found*) - END + ELSIF impCtxt.self THEN + obj^.history := removed + ELSE + obj^.history := same + END; + INC(ref) + END; + impCtxt.minr := maxStruct END - END Import; + END +END InStruct; + +PROCEDURE InObj(mno: SHORTINT): Object; (* first number in impCtxt.nextTag *) + VAR i, s: INTEGER; ch: CHAR; obj, old: Object; typ: Struct; + tag: LONGINT; ext: ConstExt; +BEGIN + tag := impCtxt.nextTag; + IF tag = Stype THEN + InStruct(typ); obj := typ^.strobj; + IF ~impCtxt.self THEN obj^.vis := external END (* type name visible now, obj^.fprint already done *) + ELSE + obj := NewObj(); obj^.mnolev := -mno; obj^.vis := external; + IF tag <= Pointer THEN (* Constant *) + obj^.mode := Con; obj^.typ := impCtxt.ref[tag]; obj^.conval := NewConst(); InConstant(tag, obj^.conval) + ELSIF tag >= Sxpro THEN + obj^.conval := NewConst(); + obj^.conval^.intval := -1; + InSign(mno, obj^.typ, obj^.link); + CASE tag OF + | Sxpro: obj^.mode := XProc + | Sipro: obj^.mode := IProc + | Scpro: obj^.mode := CProc; + ext := NewExt(); obj^.conval^.ext := ext; + s := SHORT(OPM.SymRInt()); ext^[0] := CHR(s); i := 1; + WHILE i <= s DO OPM.SymRCh(ext^[i]); INC(i) END + ELSE OPM.LogWStr("unhandled case at InObj, tag = "); OPM.LogWNum(tag, 0); OPM.LogWLn; + END + ELSIF tag = Salias THEN + obj^.mode := Typ; InStruct(obj^.typ) + ELSE + obj^.mode := Var; + IF tag = Srvar THEN obj^.vis := externalR END; + InStruct(obj^.typ) + END; + InName(obj^.name) + END; + FPrintObj(obj); + IF (obj^.mode = Var) & ((obj^.typ^.strobj = NIL) OR (obj^.typ^.strobj^.name = "")) THEN + (* compute a global fingerprint to avoid structural type equivalence for anonymous types *) + OPM.FPrint(impCtxt.reffp, obj^.typ^.ref - maxStruct) + END; + IF tag # Stype THEN + InsertImport(obj, GlbMod[mno].right, old); + IF impCtxt.self THEN + IF old # NIL THEN + (* obj is from old symbol file, old is new declaration *) + IF old^.vis = internal THEN old^.history := removed + ELSE FPrintObj(old); (* FPrint(obj) already called *) + IF obj^.fprint # old^.fprint THEN old^.history := pbmodified + ELSIF obj^.typ^.pvfp # old^.typ^.pvfp THEN old^.history := pvmodified + ELSE old^.history := same + END + END + ELSE obj^.history := removed (* OutObj not called if mnolev < 0 *) + END + (* ELSE old = NIL, or file read twice, consistent, OutObj not called *) + END + ELSE (* obj already inserted in InStruct *) + IF impCtxt.self THEN (* obj^.mnolev = 0 *) + IF obj^.vis = internal THEN obj^.history := removed + ELSIF obj^.history = inserted THEN obj^.history := same + END + (* ELSE OutObj not called for obj with mnolev < 0 *) + END + END; +RETURN obj +END InObj; + +PROCEDURE Import*(aliasName: OPS.Name; VAR name: OPS.Name; VAR done: BOOLEAN); + VAR obj: Object; mno: SHORTINT; (* done used in Browser *) +BEGIN + IF name = "SYSTEM" THEN SYSimported := TRUE; + Insert(aliasName, obj); obj^.mode := Mod; obj^.mnolev := 0; obj^.scope := syslink; obj^.typ := notyp + ELSE + impCtxt.nofr := FirstRef(*Comp+1*); impCtxt.minr := maxStruct; impCtxt.nofm := 0; + impCtxt.self := aliasName = "@self"; impCtxt.reffp := 0; + OPM.OldSym(name, done); + IF done THEN + InMod(mno); + impCtxt.nextTag := OPM.SymRInt(); + WHILE ~OPM.eofSF() DO + obj := InObj(mno); impCtxt.nextTag := OPM.SymRInt() + END; + Insert(aliasName, obj); + obj^.mode := Mod; obj^.scope := GlbMod[mno].right; + GlbMod[mno].link := obj; + obj^.mnolev := -mno; obj^.typ := notyp; + OPM.CloseOldSym + ELSIF impCtxt.self THEN + newsf := TRUE; extsf := TRUE; sfpresent := FALSE + ELSE err(152) (*sym file not found*) + END + END +END Import; (*-------------------------- Export --------------------------*) @@ -876,7 +916,7 @@ END InStruct; BEGIN IF typ^.comp = Record THEN OutFlds(typ^.link, adr, FALSE) ELSIF typ^.comp = Array THEN btyp := typ^.BaseTyp; n := typ^.n; - WHILE btyp^.comp = Array DO n := btyp^.n * n; btyp := btyp^.BaseTyp END ; + WHILE btyp^.comp = Array DO n := btyp^.n * n; btyp := btyp^.BaseTyp END; IF (btyp^.form = Pointer) OR (btyp^.comp = Record) THEN j := nofhdfld; OutHdFld(btyp, fld, adr); IF j # nofhdfld THEN i := 1; @@ -896,10 +936,10 @@ END InStruct; BEGIN WHILE (fld # NIL) & (fld^.mode = Fld) DO IF (fld^.vis # internal) & visible THEN - IF fld^.vis = externalR THEN OPM.SymWInt(Srfld) ELSE OPM.SymWInt(Sfld) END ; + IF fld^.vis = externalR THEN OPM.SymWInt(Srfld) ELSE OPM.SymWInt(Sfld) END; OutStr(fld^.typ); OutName(fld^.name); OPM.SymWInt(fld^.adr) ELSE OutHdFld(fld^.typ, fld, fld^.adr + adr) - END ; + END; fld := fld^.link END END OutFlds; @@ -908,11 +948,11 @@ END InStruct; BEGIN OutStr(result); WHILE par # NIL DO - IF par^.mode = Var THEN OPM.SymWInt(Svalpar) ELSE OPM.SymWInt(Svarpar) END ; + IF par^.mode = Var THEN OPM.SymWInt(Svalpar) ELSE OPM.SymWInt(Svarpar) END; OutStr(par^.typ); OPM.SymWInt(par^.adr); OutName(par^.name); par := par^.link - END ; + END; OPM.SymWInt(Send) END OutSign; @@ -924,7 +964,7 @@ END InStruct; IF (typ^.BaseTyp # NIL) & (obj^.adr DIV 10000H < typ^.BaseTyp^.n) & (obj^.vis = internal) THEN OPM.Mark(109, typ^.txtpos) (* hidden and overriding, not detected in OPP because record exported indirectly or via aliasing *) - END ; + END; IF OPM.ExpHdTProc OR (obj^.vis # internal) THEN IF obj^.vis # internal THEN OPM.SymWInt(Stpro); OutSign(obj^.typ, obj^.link); OutName(obj^.name); @@ -934,7 +974,7 @@ END InStruct; OPM.SymWInt(obj^.adr DIV 10000H) END END - END ; + END; OutTProcs(typ, obj^.right) END END OutTProcs; @@ -946,43 +986,36 @@ END InStruct; ELSE OPM.SymWInt(Sstruct); typ^.ref := expCtxt.ref; INC(expCtxt.ref); - IF expCtxt.ref >= maxStruct THEN err(228) END ; + IF expCtxt.ref >= maxStruct THEN err(228) END; OutMod(typ^.mno); strobj := typ^.strobj; IF (strobj # NIL) & (strobj^.name # "") THEN OutName(strobj^.name); CASE strobj^.history OF - | pbmodified: FPrintErr(strobj, 252) - | pvmodified: FPrintErr(strobj, 251) + | pbmodified: FPrintErr(strobj, 252) + | pvmodified: FPrintErr(strobj, 251) | inconsistent: FPrintErr(strobj, 249) ELSE (* checked in OutObj or correct indirect export *) - (* OPM.LogWStr("unhandled case at OPT.OutStr, strobj^.history = "); OPM.LogWNum(strobj^.history, 0); OPM.LogWLn;*) + (* OPM.LogWStr("unhandled case at OutStr, strobj^.history = "); OPM.LogWNum(strobj^.history, 0); OPM.LogWLn;*) END ELSE OPM.SymWCh(0X) (* anonymous => never inconsistent, pvfp influences the client fp *) - END ; - IF typ^.sysflag # 0 THEN OPM.SymWInt(Ssys); OPM.SymWInt(typ^.sysflag) END ; + END; + IF typ^.sysflag # 0 THEN OPM.SymWInt(Ssys); OPM.SymWInt(typ^.sysflag) END; CASE typ^.form OF - | Pointer: - OPM.SymWInt(Sptr); OutStr(typ^.BaseTyp) - | ProcTyp: - OPM.SymWInt(Spro); OutSign(typ^.BaseTyp, typ^.link) - | Comp: - CASE typ^.comp OF - | Array: - OPM.SymWInt(Sarr); OutStr(typ^.BaseTyp); OPM.SymWInt(typ^.n) - | DynArr: - OPM.SymWInt(Sdarr); OutStr(typ^.BaseTyp) - | Record: - OPM.SymWInt(Srec); - IF typ^.BaseTyp = NIL THEN OutStr(notyp) ELSE OutStr(typ^.BaseTyp) END ; - (* BaseTyp should be Notyp, too late to change *) - OPM.SymWInt(typ^.size); OPM.SymWInt(typ^.align); OPM.SymWInt(typ^.n); - nofhdfld := 0; OutFlds(typ^.link, 0, TRUE); - IF nofhdfld > OPM.MaxHdFld THEN OPM.Mark(223, typ^.txtpos) END ; - OutTProcs(typ, typ^.link); OPM.SymWInt(Send) - ELSE - OPM.LogWStr("unhandled case at OPT.OutStr, typ^.comp = "); OPM.LogWNum(typ^.comp, 0); OPM.LogWLn; - END - ELSE OPM.LogWStr("unhandled case at OPT.OutStr, typ^.form = "); OPM.LogWNum(typ^.form, 0); OPM.LogWLn; + | Pointer: OPM.SymWInt(Sptr); OutStr(typ^.BaseTyp) + | ProcTyp: OPM.SymWInt(Spro); OutSign(typ^.BaseTyp, typ^.link) + | Comp: CASE typ^.comp OF + | Array: OPM.SymWInt(Sarr); OutStr(typ^.BaseTyp); OPM.SymWInt(typ^.n) + | DynArr: OPM.SymWInt(Sdarr); OutStr(typ^.BaseTyp) + | Record: OPM.SymWInt(Srec); + IF typ^.BaseTyp = NIL THEN OutStr(notyp) ELSE OutStr(typ^.BaseTyp) END; + (* BaseTyp should be Notyp, too late to change *) + OPM.SymWInt(typ^.size); OPM.SymWInt(typ^.align); OPM.SymWInt(typ^.n); + nofhdfld := 0; OutFlds(typ^.link, 0, TRUE); + IF nofhdfld > OPM.MaxHdFld THEN OPM.Mark(223, typ^.txtpos) END; + OutTProcs(typ, typ^.link); OPM.SymWInt(Send) + ELSE OPM.LogWStr("unhandled case at OutStr, typ^.comp = "); OPM.LogWNum(typ^.comp, 0); OPM.LogWLn; + END + ELSE OPM.LogWStr("unhandled case at OutStr, typ^.form = "); OPM.LogWNum(typ^.form, 0); OPM.LogWLn; END END END OutStr; @@ -992,20 +1025,17 @@ END InStruct; BEGIN f := obj^.typ^.form; OPM.SymWInt(f); CASE f OF - | Bool, Char: - OPM.SymWCh(CHR(obj^.conval^.intval)) - | SInt, Int, LInt(*, Int8, Int16, Int32, Int64*): - OPM.SymWInt(obj^.conval^.intval) - | Set: - OPM.SymWSet(obj^.conval^.setval) - | Real: - rval := SHORT(obj^.conval^.realval); OPM.SymWReal(rval) - | LReal: - OPM.SymWLReal(obj^.conval^.realval) - | String: - OutName(obj^.conval^.ext^) + | Bool, + Char: OPM.SymWCh(CHR(obj^.conval^.intval)) + | SInt, + Int, + LInt: OPM.SymWInt(obj^.conval^.intval) + | Set: OPM.SymWSet(obj^.conval^.setval) + | Real: rval := SHORT(obj^.conval^.realval); OPM.SymWReal(rval) + | LReal: OPM.SymWLReal(obj^.conval^.realval) + | String: OutName(obj^.conval^.ext^) | NilTyp: - ELSE err(127) + ELSE err(127) END END OutConstant; @@ -1018,47 +1048,39 @@ END InStruct; IF obj^.history = removed THEN FPrintErr(obj, 250) ELSIF obj^.vis # internal THEN CASE obj^.history OF - | inserted: FPrintErr(obj, 253) - | same: (* ok *) + | inserted: FPrintErr(obj, 253) + | same: (* ok *) | pbmodified: FPrintErr(obj, 252) | pvmodified: FPrintErr(obj, 251) - ELSE - OPM.LogWStr("unhandled case at OPT.OutObj, obj^.history = "); OPM.LogWNum(obj^.history, 0); OPM.LogWLn; - END ; + ELSE OPM.LogWStr("unhandled case at OutObj, obj^.history = "); OPM.LogWNum(obj^.history, 0); OPM.LogWLn; + END; CASE obj^.mode OF - | Con: - OutConstant(obj); OutName(obj^.name) - | Typ: - IF obj^.typ^.strobj = obj THEN OPM.SymWInt(Stype); OutStr(obj^.typ) - ELSE OPM.SymWInt(Salias); OutStr(obj^.typ); OutName(obj^.name) - END - | Var: - IF obj^.vis = externalR THEN OPM.SymWInt(Srvar) ELSE OPM.SymWInt(Svar) END ; - OutStr(obj^.typ); OutName(obj^.name); - IF (obj^.typ^.strobj = NIL) OR (obj^.typ^.strobj^.name = "") THEN - (* compute fingerprint to avoid structural type equivalence *) - OPM.FPrint(expCtxt.reffp, obj^.typ^.ref) - END - | XProc: - OPM.SymWInt(Sxpro); OutSign(obj^.typ, obj^.link); OutName(obj^.name) - | IProc: - OPM.SymWInt(Sipro); OutSign(obj^.typ, obj^.link); OutName(obj^.name) - | CProc: - OPM.SymWInt(Scpro); OutSign(obj^.typ, obj^.link); ext := obj^.conval^.ext; - j := ORD(ext^[0]); i := 1; OPM.SymWInt(j); - WHILE i <= j DO OPM.SymWCh(ext^[i]); INC(i) END ; - OutName(obj^.name) - ELSE - OPM.LogWStr("unhandled case at OPT.OutObj, obj.mode = "); OPM.LogWNum(obj.mode, 0); OPM.LogWLn; + | Con: OutConstant(obj); OutName(obj^.name) + | Typ: IF obj^.typ^.strobj = obj THEN OPM.SymWInt(Stype); OutStr(obj^.typ) + ELSE OPM.SymWInt(Salias); OutStr(obj^.typ); OutName(obj^.name) + END + | Var: IF obj^.vis = externalR THEN OPM.SymWInt(Srvar) ELSE OPM.SymWInt(Svar) END; + OutStr(obj^.typ); OutName(obj^.name); + IF (obj^.typ^.strobj = NIL) OR (obj^.typ^.strobj^.name = "") THEN + (* compute fingerprint to avoid structural type equivalence *) + OPM.FPrint(expCtxt.reffp, obj^.typ^.ref) + END + | XProc: OPM.SymWInt(Sxpro); OutSign(obj^.typ, obj^.link); OutName(obj^.name) + | IProc: OPM.SymWInt(Sipro); OutSign(obj^.typ, obj^.link); OutName(obj^.name) + | CProc: OPM.SymWInt(Scpro); OutSign(obj^.typ, obj^.link); ext := obj^.conval^.ext; + j := ORD(ext^[0]); i := 1; OPM.SymWInt(j); + WHILE i <= j DO OPM.SymWCh(ext^[i]); INC(i) END; + OutName(obj^.name) + ELSE OPM.LogWStr("unhandled case at OutObj, obj.mode = "); OPM.LogWNum(obj.mode, 0); OPM.LogWLn; END END - END ; + END; OutObj(obj^.right) END END OutObj; PROCEDURE Export*(VAR ext, new: BOOLEAN); - VAR i: INTEGER; nofmod: SHORTINT; done: BOOLEAN; + VAR i: INTEGER; nofmod: SHORTINT; done: BOOLEAN; BEGIN symExtended := FALSE; symNew := FALSE; nofmod := nofGmod; Import("@self", SelfName, done); nofGmod := nofmod; @@ -1068,20 +1090,20 @@ END InStruct; OPM.SymWInt(Smname); OutName(SelfName); expCtxt.reffp := 0; expCtxt.ref := FirstRef(*Comp+1*); expCtxt.nofm := 1; expCtxt.locmno[0] := 0; - i := 1; WHILE i < maxImps DO expCtxt.locmno[i] := -1; INC(i) END ; + i := 1; WHILE i < maxImps DO expCtxt.locmno[i] := -1; INC(i) END; OutObj(topScope^.right); ext := sfpresent & symExtended; new := ~sfpresent OR symNew; - IF OPM.forceNewSym THEN - new := TRUE - END; (* for bootstrapping -- noch *) + IF OPM.forceNewSym THEN + new := TRUE + END; (* for bootstrapping -- noch *) IF OPM.noerr & sfpresent & (impCtxt.reffp # expCtxt.reffp) THEN new := TRUE; IF ~extsf THEN err(155) END - END ; + END; newsf := FALSE; symNew := FALSE; (* because of call to FPrintErr from OPL *) IF ~OPM.noerr OR findpc THEN - OPM.DeleteNewSym - END + OPM.DeleteNewSym + END (* OPM.RegisterNewSym is called in OP2 after writing the object file *) END END @@ -1125,12 +1147,6 @@ BEGIN topScope := NIL; OpenScope(0, NIL); OPM.errpos := 0; (*initialization of module SYSTEM*) EnterTyp("BYTE", Byte, OPM.ByteSize, bytetyp); -(* - EnterTyp("INT8", Int8, OPM.Int8Size, int8typ); - EnterTyp("INT16", Int16, OPM.Int16Size, int16typ); - EnterTyp("INT32", Int32, OPM.Int32Size, int32typ); - EnterTyp("INT64", Int64, OPM.Int64Size, int64typ); -*) EnterTyp("PTR", Pointer, OPM.PointerSize, sysptrtyp); EnterProc("ADR", adrfn); EnterProc("CC", ccfn); @@ -1147,46 +1163,54 @@ BEGIN topScope := NIL; OpenScope(0, NIL); OPM.errpos := 0; syslink := topScope^.right; universe := topScope; topScope^.right := NIL; - EnterTyp("CHAR", Char, OPM.CharSize, chartyp); - EnterTyp("SET", Set, OPM.SetSize, settyp); - EnterTyp("REAL", Real, OPM.RealSize, realtyp); - EnterTyp("INTEGER", Int, OPM.IntSize, inttyp); - EnterTyp("LONGINT", LInt, OPM.LIntSize, linttyp); + EnterTyp("BOOLEAN", Bool, OPM.BoolSize, booltyp); + EnterTyp("CHAR", Char, OPM.CharSize, chartyp); + EnterTyp("SET", Set, OPM.SetSize, settyp); + EnterTyp("REAL", Real, OPM.RealSize, realtyp); + EnterTyp("INTEGER", Int, OPM.IntSize, inttyp); + EnterTyp("LONGINT", LInt, OPM.LIntSize, linttyp); EnterTyp("LONGREAL", LReal, OPM.LRealSize, lrltyp); - EnterTyp("SHORTINT", SInt, OPM.SIntSize, sinttyp); - EnterTyp("BOOLEAN", Bool, OPM.BoolSize, booltyp); + EnterTyp("SHORTINT", SInt, OPM.SIntSize, sinttyp); + EnterBoolConst("FALSE", 0); (* 0 and 1 are compiler internal representation only *) EnterBoolConst("TRUE", 1); - EnterProc("HALT", haltfn); - EnterProc("NEW", newfn); - EnterProc("ABS", absfn); - EnterProc("CAP", capfn); - EnterProc("ORD", ordfn); + + EnterProc("HALT", haltfn); + EnterProc("NEW", newfn); + EnterProc("ABS", absfn); + EnterProc("CAP", capfn); + EnterProc("ORD", ordfn); EnterProc("ENTIER", entierfn); - EnterProc("ODD", oddfn); - EnterProc("MIN", minfn); - EnterProc("MAX", maxfn); - EnterProc("CHR", chrfn); - EnterProc("SHORT", shortfn); - EnterProc("LONG", longfn); - EnterProc("SIZE", sizefn); - EnterProc("INC", incfn); - EnterProc("DEC", decfn); - EnterProc("INCL", inclfn); - EnterProc("EXCL", exclfn); - EnterProc("LEN", lenfn); - EnterProc("COPY", copyfn); - EnterProc("ASH", ashfn); + EnterProc("ODD", oddfn); + EnterProc("MIN", minfn); + EnterProc("MAX", maxfn); + EnterProc("CHR", chrfn); + EnterProc("SHORT", shortfn); + EnterProc("LONG", longfn); + EnterProc("SIZE", sizefn); + EnterProc("INC", incfn); + EnterProc("DEC", decfn); + EnterProc("INCL", inclfn); + EnterProc("EXCL", exclfn); + EnterProc("LEN", lenfn); + EnterProc("COPY", copyfn); + EnterProc("ASH", ashfn); EnterProc("ASSERT", assertfn); - impCtxt.ref[Undef] := undftyp; impCtxt.ref[Byte] := bytetyp; -(* impCtxt.ref[Int8] := int8typ; impCtxt.ref[Int16] := int16typ; - impCtxt.ref[Int32] := int32typ; impCtxt.ref[Int64] := int64typ;*) - impCtxt.ref[Bool] := booltyp; impCtxt.ref[Char] := chartyp; - impCtxt.ref[SInt] := sinttyp; impCtxt.ref[Int] := inttyp; - impCtxt.ref[LInt] := linttyp; impCtxt.ref[Real] := realtyp; - impCtxt.ref[LReal] := lrltyp; impCtxt.ref[Set] := settyp; - impCtxt.ref[String] := stringtyp; impCtxt.ref[NilTyp] := niltyp; - impCtxt.ref[NoTyp] := notyp; impCtxt.ref[Pointer] := sysptrtyp + + impCtxt.ref[Undef] := undftyp; + impCtxt.ref[Byte] := bytetyp; + impCtxt.ref[Bool] := booltyp; + impCtxt.ref[Char] := chartyp; + impCtxt.ref[SInt] := sinttyp; + impCtxt.ref[Int] := inttyp; + impCtxt.ref[LInt] := linttyp; + impCtxt.ref[Real] := realtyp; + impCtxt.ref[LReal] := lrltyp; + impCtxt.ref[Set] := settyp; + impCtxt.ref[String] := stringtyp; + impCtxt.ref[NilTyp] := niltyp; + impCtxt.ref[NoTyp] := notyp; + impCtxt.ref[Pointer] := sysptrtyp END OPT. Objects: @@ -1219,6 +1243,7 @@ Objects: SInt Basic | Int Basic | LInt Basic | + XInt Basic | bits Real Basic | LReal Basic | Set Basic | @@ -1332,4 +1357,3 @@ stat NIL Nreturn proc nextexpr stat (proc = NIL for mod) Nwith ifstat stat stat Ntrap expr stat - diff --git a/src/compiler/OPV.Mod b/src/compiler/OPV.Mod index 702055f9..7a59c1d3 100644 --- a/src/compiler/OPV.Mod +++ b/src/compiler/OPV.Mod @@ -1,6 +1,6 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 - 26.7.2002 jt bug fix in Len: wrong result if called for fixed Array + 26.7.2002 jt bug fix OPS.in Len: wrong result if called for fixed OPT.Array 31.1.2007 jt synchronized with BlackBox version, in particular: various promotion rules changed (long) => (LONGINT), xxxL avoided *) @@ -8,55 +8,6 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 IMPORT OPT, OPC, OPM, OPS; CONST - (* object modes *) - Var = 1; VarPar = 2; Fld = 4; Typ = 5; LProc = 6; XProc = 7; - CProc = 9; IProc = 10; Mod = 11; TProc = 13; - - (* symbol values or ops *) - times = 1; slash = 2; div = 3; mod = 4; - and = 5; plus = 6; minus = 7; or = 8; eql = 9; - neq = 10; lss = 11; leq = 12; gtr = 13; geq = 14; - in = 15; is = 16; ash = 17; msk = 18; len = 19; - conv = 20; abs = 21; cap = 22; odd = 23; not = 33; - (*SYSTEM*) - adr = 24; cc = 25; bit = 26; lsh = 27; rot = 28; val = 29; - - (* structure forms *) - Byte = 1; Bool = 2; Char = 3; - SInt = 4; Int = 5; LInt = 6; - Real = 7; LReal = 8; Set = 9; String = 10; NilTyp = 11; NoTyp = 12; - Pointer = 13; ProcTyp = 14; - Comp = 15; - (*Int8 = 7; Int16 = 8; Int32 = 9; Int64 = 10; - Real = 11; LReal = 12; Set = 13; String = 14; NilTyp = 15; NoTyp = 16; - Pointer = 17; ProcTyp = 18; - Comp = 19;*) - (*Real = 7; LReal = 8; Set = 9; String = 10; NilTyp = 11; Pointer = 13; ProcTyp = 14; - Int8 = 15; Int16 = 16; Int32 = 17; Int64 = 18; - Comp = (*15*)19;*) - - (* composite structure forms *) - Array = 2; DynArr = 3; Record = 4; - - (* nodes classes *) - Nvar = 0; Nvarpar = 1; Nfield = 2; Nderef = 3; Nindex = 4; Nguard = 5; Neguard = 6; - Nconst = 7; Ntype = 8; Nproc = 9; Nupto = 10; Nmop = 11; Ndop = 12; Ncall = 13; - Ninittd = 14; Nenter = 18; Nassign = 19; - Nifelse =20; Ncase = 21; Nwhile = 22; Nrepeat = 23; Nloop = 24; Nexit = 25; - Nreturn = 26; Nwith = 27; Ntrap = 28; - - (*function number*) - assign = 0; newfn = 1; incfn = 13; decfn = 14; - inclfn = 15; exclfn = 16; copyfn = 18; assertfn = 32; - - (*SYSTEM function number*) - getfn = 24; putfn = 25; getrfn = 26; putrfn = 27; sysnewfn = 30; movefn = 31; - - (*procedure flags*) - isRedef = 2; - - super = 1; - UndefinedType = 0; (* named type not yet defined *) ProcessingType = 1; (* pointer type is being processed *) PredefinedType = 2; (* for all predefined types *) @@ -91,7 +42,6 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 MaxPrec = 12; ProcTypeVar = 11; (* precedence number when a call is made with a proc type variable *) - internal = 0; TYPE ExitInfo = RECORD level, label: INTEGER END ; @@ -125,14 +75,14 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 IF typ = OPT.undftyp THEN OPM.err(58) ELSIF typ^.size = -1 THEN f := typ^.form; c := typ^.comp; - IF c = Record THEN btyp := typ^.BaseTyp; - IF btyp = NIL THEN offset := 0; base := OPM.RecAlign; + IF c = OPT.Record THEN btyp := typ^.BaseTyp; + IF btyp = NIL THEN offset := 0; base := (*OPM.RecAlign*)OPC.SizeAlignment(OPM.RecSize); ELSE TypSize(btyp); offset := btyp^.size - btyp^.sysflag DIV 100H; base := btyp^.align; END; fld := typ^.link; - WHILE (fld # NIL) & (fld^.mode = Fld) DO + WHILE (fld # NIL) & (fld^.mode = OPT.Fld) DO btyp := fld^.typ; TypSize(btyp); - size := btyp^.size; fbase := OPC.Base(btyp); + size := btyp^.size; fbase := OPC.BaseAlignment(btyp); OPC.Align(offset, fbase); fld^.adr := offset; INC(offset, size); IF fbase > base THEN base := fbase END ; @@ -140,25 +90,25 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 END ; off0 := offset; IF offset = 0 THEN offset := 1 END ; (* 1 byte filler to avoid empty struct *) - IF OPM.RecSize = 0 THEN base := NaturalAlignment(offset, OPM.RecAlign) END ; + IF OPM.RecSize = 0 THEN base := NaturalAlignment(offset, (*OPM.RecAlign*)OPC.SizeAlignment(OPM.RecSize)) END ; OPC.Align(offset, base); IF (typ^.strobj = NIL) & (typ^.align MOD 10000H = 0) THEN INC(recno); INC(base, recno * 10000H) END ; typ^.size := offset; typ^.align := base; (* encode the trailing gap into the symbol table to allow dense packing of extended records *) typ^.sysflag := typ^.sysflag MOD 100H + SHORT((offset - off0)*100H) - ELSIF c = Array THEN + ELSIF c = OPT.Array THEN TypSize(typ^.BaseTyp); typ^.size := typ^.n * typ^.BaseTyp^.size; - ELSIF f = Pointer THEN + ELSIF f = OPT.Pointer THEN typ^.size := OPM.PointerSize; IF typ^.BaseTyp = OPT.undftyp THEN OPM.Mark(128, typ^.n) ELSE TypSize(typ^.BaseTyp) END - ELSIF f = ProcTyp THEN + ELSIF f = OPT.ProcTyp THEN typ^.size := OPM.ProcSize; - ELSIF c = DynArr THEN + ELSIF c = OPT.DynArr THEN btyp := typ^.BaseTyp; TypSize(btyp); - IF btyp^.comp = DynArr THEN typ^.size := btyp^.size + 4 (* describes dim not size *) + IF btyp^.comp = OPT.DynArr THEN typ^.size := btyp^.size + 4 (* describes dim not size *) ELSE typ^.size := 8 END END @@ -181,10 +131,10 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 BEGIN oldPos := OPM.errpos; OPM.errpos := obj^.scope^.adr; typ := obj^.link^.typ; - IF typ^.form = Pointer THEN typ := typ^.BaseTyp END ; + IF typ^.form = OPT.Pointer THEN typ := typ^.BaseTyp END ; OPT.FindField(obj^.name, typ^.BaseTyp, redef); IF redef # NIL THEN obj^.adr := 10000H*(redef^.adr DIV 10000H) (*mthno*); - IF ~(isRedef IN obj^.conval^.setval) THEN OPM.err(119) END + IF ~(OPT.isRedef IN obj^.conval^.setval) THEN OPM.err(119) END ELSE INC(obj^.adr, 10000H*typ^.n); INC(typ^.n) END ; OPM.errpos := oldPos @@ -218,23 +168,23 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 IF obj^.name[0] = "@" THEN obj^.name[0] := "_"; Stamp(obj^.name) END ; (* translate and make unique @for, ... *) obj^.linkadr := UndefinedType; mode := obj^.mode; - IF (mode = Typ) & ((obj^.vis # internal) = exported) THEN + IF (mode = OPT.Typ) & ((obj^.vis # OPT.internal) = exported) THEN typ := obj^.typ; TypSize(obj^.typ); - IF typ^.form = Pointer THEN typ := typ^.BaseTyp END ; - IF typ^.comp = Record THEN TraverseRecord(typ) END - ELSIF mode = TProc THEN GetTProcNum(obj) - ELSIF mode = Var THEN TypSize(obj^.typ) + IF typ^.form = OPT.Pointer THEN typ := typ^.BaseTyp END ; + IF typ^.comp = OPT.Record THEN TraverseRecord(typ) END + ELSIF mode = OPT.TProc THEN GetTProcNum(obj) + ELSIF mode = OPT.Var THEN TypSize(obj^.typ) END ; IF ~exported THEN (* do this only once *) - IF (mode IN {LProc, Typ}) & (obj^.mnolev > 0) THEN Stamp(obj^.name) END ; - IF mode IN {Var, VarPar, Typ} THEN + IF (mode IN {OPT.LProc, OPT.Typ}) & (obj^.mnolev > 0) THEN Stamp(obj^.name) END ; + IF mode IN {OPT.Var, OPT.VarPar, OPT.Typ} THEN obj^.scope := outerScope - ELSIF mode IN {LProc, XProc, TProc, CProc, IProc} THEN + ELSIF mode IN {OPT.LProc, OPT.XProc, OPT.TProc, OPT.CProc, OPT.IProc} THEN IF obj^.conval^.setval = {} THEN OPM.err(129) END ; scope := obj^.scope; scope^.leaf := TRUE; scope^.name := obj^.name; Stamp(scope^.name); - IF mode = CProc THEN obj^.adr := 1 (* c.f. OPC.CProcDefs *) END ; + IF mode = OPT.CProc THEN obj^.adr := 1 (* c.f. OPC.CProcDefs *) END ; IF scope^.mnolev > 1 THEN outerScope^.leaf := FALSE END ; Traverse (obj^.scope^.right, obj^.scope, FALSE) END @@ -250,19 +200,15 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 Traverse(topScope^.right, topScope, TRUE); (* first pass only on exported types and procedures *) Traverse(topScope^.right, topScope, FALSE); (* second pass *) (* mark basic types as predefined, OPC.Ident can avoid qualification*) - OPT.chartyp^.strobj^.linkadr := PredefinedType; - OPT.settyp^.strobj^.linkadr := PredefinedType; - OPT.realtyp^.strobj^.linkadr := PredefinedType; - OPT.inttyp^.strobj^.linkadr := PredefinedType; - OPT.linttyp^.strobj^.linkadr := PredefinedType; - OPT.lrltyp^.strobj^.linkadr := PredefinedType; - OPT.sinttyp^.strobj^.linkadr := PredefinedType; - OPT.booltyp^.strobj^.linkadr := PredefinedType; - OPT.bytetyp^.strobj^.linkadr := PredefinedType; - (*OPT.int8typ^.strobj^.linkadr := PredefinedType; - OPT.int16typ^.strobj^.linkadr := PredefinedType; - OPT.int32typ^.strobj^.linkadr := PredefinedType; - OPT.int64typ^.strobj^.linkadr := PredefinedType;*) + OPT.chartyp^.strobj^.linkadr := PredefinedType; + OPT.settyp^.strobj^.linkadr := PredefinedType; + OPT.realtyp^.strobj^.linkadr := PredefinedType; + OPT.inttyp^.strobj^.linkadr := PredefinedType; + OPT.linttyp^.strobj^.linkadr := PredefinedType; + OPT.lrltyp^.strobj^.linkadr := PredefinedType; + OPT.sinttyp^.strobj^.linkadr := PredefinedType; + OPT.booltyp^.strobj^.linkadr := PredefinedType; + OPT.bytetyp^.strobj^.linkadr := PredefinedType; OPT.sysptrtyp^.strobj^.linkadr := PredefinedType; END AdrAndSize; @@ -271,53 +217,48 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 PROCEDURE Precedence (class, subclass, form, comp: INTEGER): INTEGER; BEGIN CASE class OF - Nconst, Nvar, Nfield, Nindex, Nproc, Ncall: - RETURN 10 - | Nguard: IF OPM.typchk IN OPM.opt THEN RETURN 10 ELSE RETURN 9 (*cast*) END - | Nvarpar: - IF comp IN {Array, DynArr} THEN RETURN 10 ELSE RETURN 9 END (* arrays don't need deref *) - | Nderef: - RETURN 9 - | Nmop: - CASE subclass OF - not, minus, adr, val, conv: - RETURN 9 - | is, abs, cap, odd, cc: - RETURN 10 - ELSE - OPM.LogWStr("unhandled case in OPV.Precedence Nmop, subclass = "); OPM.LogWNum(subclass, 0); OPM.LogWLn; - END - | Ndop: - CASE subclass OF - times: - IF form = Set THEN RETURN 4 ELSE RETURN 8 END - | slash: - IF form = Set THEN RETURN 3 ELSE RETURN 8 END - | div, mod: - RETURN 10 (* div/mod are replaced by functions *) - | plus: - IF form = Set THEN RETURN 2 ELSE RETURN 7 END - | minus: - IF form = Set THEN RETURN 4 ELSE RETURN 7 END - | lss, leq, gtr, geq: - RETURN 6 - | eql, neq: - RETURN 5 - | and: - RETURN 1 - | or: - RETURN 0 - | len, in, ash, msk, bit, lsh, rot: - RETURN 10 - ELSE - OPM.LogWStr("unhandled case in OPV.Precedence Ndop, subclass = "); OPM.LogWNum(subclass, 0); OPM.LogWLn; - END; - | Nupto: - RETURN 10 - | Ntype, Neguard: (* ignored anyway *) - RETURN MaxPrec - ELSE - OPM.LogWStr("unhandled case in OPV.Precedence, class = "); OPM.LogWNum(class, 0); OPM.LogWLn; + | OPT.Nconst, + OPT.Nvar, + OPT.Nfield, + OPT.Nindex, + OPT.Nproc, + OPT.Ncall: RETURN 10 + | OPT.Nguard: IF OPM.typchk IN OPM.opt THEN RETURN 10 ELSE RETURN 9 (*cast*) END + | OPT.Nvarpar: IF comp IN {OPT.Array, OPT.DynArr} THEN RETURN 10 ELSE RETURN 9 END (* arrays don't need deref *) + | OPT.Nderef: RETURN 9 + | OPT.Nmop: CASE subclass OF + | OPS.not, OPS.minus, OPT.adr, OPT.val, OPT.conv: RETURN 9 + | OPS.is, OPT.abs, OPT.cap, OPT.odd, OPT.cc: RETURN 10 + ELSE OPM.LogWStr("unhandled case in OPV.Precedence OPT.Nmop, subclass = "); OPM.LogWNum(subclass, 0); OPM.LogWLn; + END + | OPT.Ndop: CASE subclass OF + | OPS.times: IF form = OPT.Set THEN RETURN 4 ELSE RETURN 8 END + | OPS.slash: IF form = OPT.Set THEN RETURN 3 ELSE RETURN 8 END + | OPS.div, + OPS.mod: RETURN 10 (* div/mod are replaced by functions *) + | OPS.plus: IF form = OPT.Set THEN RETURN 2 ELSE RETURN 7 END + | OPS.minus: IF form = OPT.Set THEN RETURN 4 ELSE RETURN 7 END + | OPS.lss, + OPS.leq, + OPS.gtr, + OPS.geq: RETURN 6 + | OPS.eql, + OPS.neq: RETURN 5 + | OPS.and: RETURN 1 + | OPS.or: RETURN 0 + | OPT.len, + OPS.in, + OPT.ash, + OPT.msk, + OPT.bit, + OPT.lsh, + OPT.rot: RETURN 10 + ELSE OPM.LogWStr("unhandled case in OPV.Precedence OPT.Ndop, subclass = "); OPM.LogWNum(subclass, 0); OPM.LogWLn; + END; + | OPT.Nupto: RETURN 10 + | OPT.Ntype, + OPT.Neguard: (* ignored anyway *) RETURN MaxPrec + ELSE OPM.LogWStr("unhandled case in OPV.Precedence, class = "); OPM.LogWNum(class, 0); OPM.LogWLn; END; END Precedence; @@ -326,8 +267,8 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 PROCEDURE Len(n: OPT.Node; dim: LONGINT); BEGIN - WHILE (n^.class = Nindex) & (n^.typ^.comp = DynArr(*26.7.2002*)) DO INC(dim); n := n^.left END ; - IF (n^.class = Nderef) & (n^.typ^.comp = DynArr) THEN + WHILE (n^.class = OPT.Nindex) & (n^.typ^.comp = OPT.DynArr(*26.7.2002*)) DO INC(dim); n := n^.left END ; + IF (n^.class = OPT.Nderef) & (n^.typ^.comp = OPT.DynArr) THEN design(n^.left, 10); OPM.WriteString("->len["); OPM.WriteInt(dim); OPM.Write("]") ELSE OPC.Len(n^.obj, n^.typ, dim) @@ -336,47 +277,40 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 PROCEDURE SideEffects(n: OPT.Node): BOOLEAN; BEGIN - IF n # NIL THEN RETURN (n^.class = Ncall) OR SideEffects(n^.left) OR SideEffects(n^.right) + IF n # NIL THEN RETURN (n^.class = OPT.Ncall) OR SideEffects(n^.left) OR SideEffects(n^.right) ELSE RETURN FALSE END END SideEffects; PROCEDURE Entier(n: OPT.Node; prec: INTEGER); BEGIN - IF n^.typ^.form IN {Real, LReal} THEN + IF n^.typ^.form IN {OPT.Real, OPT.LReal} THEN OPM.WriteString(EntierFunc); expr(n, MinPrec); OPM.Write(CloseParen) ELSE expr(n, prec) END END Entier; - PROCEDURE Convert(n: OPT.Node; form, prec: INTEGER); - VAR from: INTEGER; - BEGIN from := n^.typ^.form; - IF form = Set THEN OPM.WriteString(SetOfFunc); Entier(n, MinPrec); OPM.Write(CloseParen) - ELSIF form = LInt THEN - IF from < LInt THEN OPM.WriteString("(LONGINT)") END ; - Entier(n, 9) - (*ELSIF form = Int64 THEN - IF (from >= SInt) & (from <= LInt) OR (from >= Int8) & (from < Int64) THEN OPM.WriteString("(SYSTEM_INT64)") END; - Entier(n, 9);*) - ELSIF form = Int THEN - IF from < Int THEN OPM.WriteString("(int)"); expr(n, 9) + PROCEDURE SizeCast(size: LONGINT); + BEGIN + IF size <= 4 THEN OPM.WriteString("(int)") + ELSE OPM.WriteString("(SYSTEM_INT64)") + END + END SizeCast; + + PROCEDURE Convert(n: OPT.Node; newtype: OPT.Struct; prec: INTEGER); + VAR from, to: INTEGER; + BEGIN from := n^.typ^.form; to := newtype.form; + IF to = OPT.Set THEN OPM.WriteString(SetOfFunc); Entier(n, MinPrec); OPM.Write(CloseParen) + ELSIF to IN OPT.intSet THEN + IF (newtype.size < n.typ.size) & (OPM.ranchk IN OPM.opt) THEN + OPM.WriteString("__SHORT"); IF SideEffects(n) THEN OPM.Write("F") END; + OPM.Write(OpenParen); Entier(n, MinPrec); OPM.WriteString(Comma); + OPM.WriteInt(OPM.SignedMaximum(newtype.size) + 1); OPM.Write(CloseParen) ELSE - IF OPM.ranchk IN OPM.opt THEN OPM.WriteString("__SHORT"); - IF SideEffects(n) THEN OPM.Write("F") END ; - OPM.Write(OpenParen); Entier(n, MinPrec); - OPM.WriteString(Comma); OPM.WriteInt(OPM.MaxInt + 1); OPM.Write(CloseParen) - ELSE OPM.WriteString("(int)"); Entier(n, 9) - END + IF newtype.size # n.typ.size THEN SizeCast(newtype.size) END; + Entier(n, 9) END - ELSIF form = SInt THEN - IF OPM.ranchk IN OPM.opt THEN OPM.WriteString("__SHORT"); - IF SideEffects(n) THEN OPM.Write("F") END ; - OPM.Write(OpenParen); Entier(n, MinPrec); - OPM.WriteString(Comma); OPM.WriteInt(OPM.MaxSInt + 1); OPM.Write(CloseParen) - ELSE OPM.WriteString("(int)"); Entier(n, 9) - END - ELSIF form = Char THEN + ELSIF to = OPT.Char THEN IF OPM.ranchk IN OPM.opt THEN OPM.WriteString("__CHR"); IF SideEffects(n) THEN OPM.Write("F") END ; OPM.Write(OpenParen); Entier(n, MinPrec); OPM.Write(CloseParen) @@ -388,15 +322,15 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 PROCEDURE TypeOf(n: OPT.Node); BEGIN - IF n^.typ^.form = Pointer THEN + IF n^.typ^.form = OPT.Pointer THEN OPM.WriteString(TypeFunc); expr(n, MinPrec); OPM.Write(")") - ELSIF n^.class IN {Nvar, Nindex, Nfield} THEN (* dyn rec type = stat rec type *) + ELSIF n^.class IN {OPT.Nvar, OPT.Nindex, OPT.Nfield} THEN (* dyn rec type = stat rec type *) OPC.Andent(n^.typ); OPM.WriteString(DynTypExt) - ELSIF n^.class = Nderef THEN (* p^ *) + ELSIF n^.class = OPT.Nderef THEN (* p^ *) OPM.WriteString(TypeFunc); expr(n^.left, MinPrec); OPM.Write(")") - ELSIF n^.class = Nguard THEN (* r(T) *) + ELSIF n^.class = OPT.Nguard THEN (* r(T) *) TypeOf(n^.left) (* skip guard *) - ELSIF (n^.class = Nmop) & (n^.subcl = val) THEN + ELSIF (n^.class = OPT.Nmop) & (n^.subcl = OPT.val) THEN (*SYSTEM.VAL(typ, var par rec)*) OPC.TypeOf(n^.left^.obj) ELSE (* var par rec *) @@ -407,7 +341,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 PROCEDURE Index(n, d: OPT.Node; prec, dim: INTEGER); BEGIN IF ~inxchk - OR (n^.right^.class = Nconst) & ((n^.right^.conval^.intval = 0) OR (n^.left^.typ^.comp # DynArr)) THEN + OR (n^.right^.class = OPT.Nconst) & ((n^.right^.conval^.intval = 0) OR (n^.left^.typ^.comp # OPT.DynArr)) THEN expr(n^.right, prec) ELSE IF SideEffects(n^.right) THEN OPM.WriteString("__XF(") ELSE OPM.WriteString("__X(") END ; @@ -422,94 +356,84 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 BEGIN comp := n^.typ^.comp; obj := n^.obj; class := n^.class; designPrec := Precedence(class, n^.subcl, n^.typ^.form, comp); - IF (class = Nvar) & (obj^.mnolev > 0) & (obj^.mnolev # OPM.level) & (prec = 10) THEN designPrec := 9 END ; + IF (class = OPT.Nvar) & (obj^.mnolev > 0) & (obj^.mnolev # OPM.level) & (prec = 10) THEN designPrec := 9 END ; IF prec > designPrec THEN OPM.Write(OpenParen) END; IF prec = ProcTypeVar THEN OPM.Write(Deref) END; (* proc var calls must be dereferenced in K&R C *) CASE class OF - Nproc: - OPC.Ident(n^.obj) - | Nvar: - OPC.CompleteIdent(n^.obj) - | Nvarpar: - IF ~(comp IN {Array, DynArr}) THEN OPM.Write(Deref) END; (* deref var parameter *) - OPC.CompleteIdent(n^.obj) - | Nfield: - IF n^.left^.class = Nderef THEN design(n^.left^.left, designPrec); OPM.WriteString("->") - ELSE design(n^.left, designPrec); OPM.Write(".") - END ; - OPC.Ident(n^.obj) - | Nderef: - IF n^.typ^.comp = DynArr THEN design(n^.left, 10); OPM.WriteString("->data") - ELSE OPM.Write(Deref); design(n^.left, designPrec) - END - | Nindex: - d := n^.left; - IF d^.typ^.comp = DynArr THEN dims := 0; - WHILE d^.class = Nindex DO d := d^.left; INC(dims) END ; - IF n^.typ^.comp = DynArr THEN OPM.Write("&") END ; - design(d, designPrec); - OPM.Write(OpenBracket); - IF n^.typ^.comp = DynArr THEN OPM.Write("(") END ; - i := dims; x := n; - WHILE x # d DO (* apply Horner schema *) - IF x^.left # d THEN Index(x, d, 7, i); OPM.WriteString(" + "); Len(d, i); OPM.WriteString(" * ("); DEC(i) - ELSE Index(x, d, MinPrec, i) - END ; - x := x^.left - END ; - FOR i := 1 TO dims DO OPM.Write(")") END ; - IF n^.typ^.comp = DynArr THEN - (* element type is DynArr; finish Horner schema with virtual indices = 0*) - OPM.Write(")"); - WHILE i < (d^.typ^.size - 4) DIV 4 DO - OPM.WriteString(" * "); Len(d, i); - INC(i) - END - END ; - OPM.Write(CloseBracket) - ELSE - design(n^.left, designPrec); - OPM.Write(OpenBracket); - Index(n, n^.left, MinPrec, 0); - OPM.Write(CloseBracket) - END - | Nguard: - typ := n^.typ; obj := n^.left^.obj; - IF OPM.typchk IN OPM.opt THEN - IF typ^.comp = Record THEN OPM.WriteString(GuardRecFunc); - IF obj^.mnolev # OPM.level THEN (*intermediate level var-par record*) - OPM.WriteStringVar(obj^.scope^.name); OPM.WriteString("__curr->"); OPC.Ident(obj) - ELSE (*local var-par record*) - OPC.Ident(obj) - END ; - ELSE (*Pointer*) - IF typ^.BaseTyp^.strobj = NIL THEN OPM.WriteString("__GUARDA(") ELSE OPM.WriteString(GuardPtrFunc) END ; - expr(n^.left, MinPrec); typ := typ^.BaseTyp - END ; - OPM.WriteString(Comma); - OPC.Andent(typ); OPM.WriteString(Comma); - OPM.WriteInt(typ^.extlev); OPM.Write(")") - ELSE - IF typ^.comp = Record THEN (* do not cast record directly, cast pointer to record *) - OPM.WriteString("*("); OPC.Ident(typ^.strobj); OPM.WriteString("*)"); OPC.CompleteIdent(obj) - ELSE (*simply cast pointer*) - OPM.Write("("); OPC.Ident(typ^.strobj); OPM.Write(")"); expr(n^.left, designPrec) - END - END - | Neguard: - IF OPM.typchk IN OPM.opt THEN - IF n^.left^.class = Nvarpar THEN OPM.WriteString("__GUARDEQR("); - OPC.CompleteIdent(n^.left^.obj); OPM.WriteString(Comma); TypeOf(n^.left); - ELSE OPM.WriteString("__GUARDEQP("); expr(n^.left^.left, MinPrec) - END ; (* __GUARDEQx includes deref *) - OPM.WriteString(Comma); OPC.Ident(n^.left^.typ^.strobj); OPM.Write(")") - ELSE - expr(n^.left, MinPrec) (* always lhs of assignment *) - END - | Nmop: - IF n^.subcl = val THEN design(n^.left, prec) END - ELSE - OPM.LogWStr("unhandled case in OPV.design, class = "); OPM.LogWNum(class, 0); OPM.LogWLn; + | OPT.Nproc: OPC.Ident(n^.obj) + | OPT.Nvar: OPC.CompleteIdent(n^.obj) + | OPT.Nvarpar: IF ~(comp IN {OPT.Array, OPT.DynArr}) THEN OPM.Write(Deref) END; (* deref var parameter *) + OPC.CompleteIdent(n^.obj) + | OPT.Nfield: IF n^.left^.class = OPT.Nderef THEN design(n^.left^.left, designPrec); OPM.WriteString("->") + ELSE design(n^.left, designPrec); OPM.Write(".") + END ; + OPC.Ident(n^.obj) + | OPT.Nderef: IF n^.typ^.comp = OPT.DynArr THEN design(n^.left, 10); OPM.WriteString("->data") + ELSE OPM.Write(Deref); design(n^.left, designPrec) + END + | OPT.Nindex: d := n^.left; + IF d^.typ^.comp = OPT.DynArr THEN dims := 0; + WHILE d^.class = OPT.Nindex DO d := d^.left; INC(dims) END ; + IF n^.typ^.comp = OPT.DynArr THEN OPM.Write("&") END ; + design(d, designPrec); + OPM.Write(OpenBracket); + IF n^.typ^.comp = OPT.DynArr THEN OPM.Write("(") END ; + i := dims; x := n; + WHILE x # d DO (* apply Horner schema *) + IF x^.left # d THEN Index(x, d, 7, i); OPM.WriteString(" + "); Len(d, i); OPM.WriteString(" * ("); DEC(i) + ELSE Index(x, d, MinPrec, i) + END ; + x := x^.left + END ; + FOR i := 1 TO dims DO OPM.Write(")") END ; + IF n^.typ^.comp = OPT.DynArr THEN + (* element type is OPT.DynArr; finish Horner schema with virtual indices = 0*) + OPM.Write(")"); + WHILE i < (d^.typ^.size - 4) DIV 4 DO + OPM.WriteString(" * "); Len(d, i); + INC(i) + END + END ; + OPM.Write(CloseBracket) + ELSE + design(n^.left, designPrec); + OPM.Write(OpenBracket); + Index(n, n^.left, MinPrec, 0); + OPM.Write(CloseBracket) + END + | OPT.Nguard: typ := n^.typ; obj := n^.left^.obj; + IF OPM.typchk IN OPM.opt THEN + IF typ^.comp = OPT.Record THEN OPM.WriteString(GuardRecFunc); + IF obj^.mnolev # OPM.level THEN (*intermediate level var-par record*) + OPM.WriteStringVar(obj^.scope^.name); OPM.WriteString("__curr->"); OPC.Ident(obj) + ELSE (*local var-par record*) + OPC.Ident(obj) + END ; + ELSE (*Pointer*) + IF typ^.BaseTyp^.strobj = NIL THEN OPM.WriteString("__GUARDA(") ELSE OPM.WriteString(GuardPtrFunc) END ; + expr(n^.left, MinPrec); typ := typ^.BaseTyp + END ; + OPM.WriteString(Comma); + OPC.Andent(typ); OPM.WriteString(Comma); + OPM.WriteInt(typ^.extlev); OPM.Write(")") + ELSE + IF typ^.comp = OPT.Record THEN (* do not cast record directly, cast pointer to record *) + OPM.WriteString("*("); OPC.Ident(typ^.strobj); OPM.WriteString("*)"); OPC.CompleteIdent(obj) + ELSE (*simply cast pointer*) + OPM.Write("("); OPC.Ident(typ^.strobj); OPM.Write(")"); expr(n^.left, designPrec) + END + END + | OPT.Neguard: IF OPM.typchk IN OPM.opt THEN + IF n^.left^.class = OPT.Nvarpar THEN OPM.WriteString("__GUARDEQR("); + OPC.CompleteIdent(n^.left^.obj); OPM.WriteString(Comma); TypeOf(n^.left); + ELSE OPM.WriteString("__GUARDEQP("); expr(n^.left^.left, MinPrec) + END ; (* __GUARDEQx includes deref *) + OPM.WriteString(Comma); OPC.Ident(n^.left^.typ^.strobj); OPM.Write(")") + ELSE + expr(n^.left, MinPrec) (* always lhs of assignment *) + END + | OPT.Nmop: IF n^.subcl = OPT.val THEN design(n^.left, prec) END + ELSE OPM.LogWStr("unhandled case in OPV.design, class = "); OPM.LogWNum(class, 0); OPM.LogWLn; END ; IF prec > designPrec THEN OPM.Write(CloseParen) END END design; @@ -520,54 +444,52 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 OPM.Write(OpenParen); WHILE n # NIL DO typ := fp^.typ; comp := typ^.comp; form := typ^.form; mode := fp^.mode; prec := MinPrec; - IF (mode = VarPar) & (n^.class = Nmop) & (n^.subcl = val) THEN (* avoid cast in lvalue *) + IF (mode = OPT.VarPar) & (n^.class = OPT.Nmop) & (n^.subcl = OPT.val) THEN (* avoid cast in lvalue *) OPM.Write(OpenParen); OPC.Ident(n^.typ^.strobj); OPM.WriteString("*)"); prec := 10 END ; - IF ~(n^.typ^.comp IN {Array, DynArr}) THEN - IF mode = VarPar THEN + IF ~(n^.typ^.comp IN {OPT.Array, OPT.DynArr}) THEN + IF mode = OPT.VarPar THEN IF ansi & (typ # n^.typ) THEN OPM.WriteString("(void*)") END ; OPM.Write("&"); prec := 9 ELSIF ansi THEN - IF (comp IN {Array, DynArr}) & (n^.class = Nconst) THEN + IF (comp IN {OPT.Array, OPT.DynArr}) & (n^.class = OPT.Nconst) THEN OPM.WriteString("(CHAR*)") (* force to unsigned char *) - ELSIF (form = Pointer) & (typ # n^.typ) & (n^.typ # OPT.niltyp) THEN + ELSIF (form = OPT.Pointer) & (typ # n^.typ) & (n^.typ # OPT.niltyp) THEN OPM.WriteString("(void*)") (* type extension *) END ELSE - IF (form IN {Real, LReal}) & (n^.typ^.form IN {SInt, Int, LInt(*, Int8, Int16, Int32, Int64*)}) THEN (* real promotion *) + IF (form IN {OPT.Real, OPT.LReal}) & (n^.typ^.form IN OPT.intSet) THEN (* real promotion *) OPM.WriteString("(double)"); prec := 9 - ELSIF (form = LInt) & (n^.typ^.form < LInt) THEN (* integral promotion *) + ELSIF (form = OPT.LInt) & (n^.typ^.form < OPT.LInt) THEN (* integral promotion *) OPM.WriteString("(LONGINT)"); prec := 9 - (*ELSIF (form = Int64) & (n^.typ^.form < Int64) THEN - OPM.WriteString("(SYSTEM_INT64)"); prec := 9;*) END END ELSIF ansi THEN (* casting of params should be simplified eventually *) - IF (mode = VarPar) & (typ # n^.typ) & (prec = MinPrec) THEN OPM.WriteString("(void*)") END + IF (mode = OPT.VarPar) & (typ # n^.typ) & (prec = MinPrec) THEN OPM.WriteString("(void*)") END END; - IF (mode = VarPar) & (n^.class = Nmop) & (n^.subcl = val) THEN + IF (mode = OPT.VarPar) & (n^.class = OPT.Nmop) & (n^.subcl = OPT.val) THEN expr(n^.left, prec) (* avoid cast in lvalue *) - ELSIF (form = LInt) & (n^.class = Nconst) - & (n^.conval^.intval <= OPM.MaxInt) & (n^.conval^.intval >= OPM.MinInt) THEN + ELSIF (form = OPT.LInt) & (n^.class = OPT.Nconst) + & (n^.conval^.intval <= OPM.SignedMaximum(OPM.IntSize)) & (n^.conval^.intval >= OPM.SignedMinimum(OPM.IntSize)) THEN OPM.WriteString("((LONGINT)("); expr(n, prec); OPM.WriteString("))"); - ELSE + ELSE expr(n, prec) END; - IF (comp = Record) & (mode = VarPar) THEN + IF (comp = OPT.Record) & (mode = OPT.VarPar) THEN OPM.WriteString(", "); TypeOf(n) - ELSIF comp = DynArr THEN - IF n^.class = Nconst THEN (* ap is string constant *) + ELSIF comp = OPT.DynArr THEN + IF n^.class = OPT.Nconst THEN (* ap is string constant *) OPM.WriteString(Comma); OPM.WriteString("(LONGINT)"); OPM.WriteInt(n^.conval^.intval2) ELSE aptyp := n^.typ; dim := 0; - WHILE (typ^.comp = DynArr) & (typ^.BaseTyp^.form # Byte) DO + WHILE (typ^.comp = OPT.DynArr) & (typ^.BaseTyp^.form # OPT.Byte) DO OPM.WriteString(Comma); Len(n, dim); typ := typ^.BaseTyp; aptyp := aptyp^.BaseTyp; INC(dim) END ; - IF (typ^.comp = DynArr) & (typ^.BaseTyp^.form = Byte) THEN + IF (typ^.comp = OPT.DynArr) & (typ^.BaseTyp^.form = OPT.Byte) THEN OPM.WriteString(Comma); - WHILE aptyp^.comp = DynArr DO + WHILE aptyp^.comp = OPT.DynArr DO Len(n, dim); OPM.WriteString(" * "); INC(dim); aptyp := aptyp^.BaseTyp END ; OPM.WriteString("((LONGINT)("); OPM.WriteInt(aptyp^.size); OPM.WriteString("))"); @@ -583,7 +505,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 PROCEDURE SuperProc(n: OPT.Node): OPT.Object; VAR obj: OPT.Object; typ: OPT.Struct; BEGIN typ := n^.right^.typ; (* receiver type *) - IF typ^.form = Pointer THEN typ := typ^.BaseTyp END ; + IF typ^.form = OPT.Pointer THEN typ := typ^.BaseTyp END ; OPT.FindField(n^.left^.obj^.name, typ^.BaseTyp, obj); RETURN obj END SuperProc; @@ -601,189 +523,163 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 class := n^.class; subclass := n^.subcl; form := n^.typ^.form; l := n^.left; r := n^.right; exprPrec := Precedence (class, subclass, form, n^.typ^.comp); - IF (exprPrec <= prec) & (class IN {Nconst, Nupto, Nmop, Ndop, Ncall, Nguard, Neguard}) THEN + IF (exprPrec <= prec) & (class IN {OPT.Nconst, OPT.Nupto, OPT.Nmop, OPT.Ndop, OPT.Ncall, OPT.Nguard, OPT.Neguard}) THEN OPM.Write(OpenParen); END; CASE class OF - Nconst: - OPC.Constant(n^.conval, form) - | Nupto: (* n^.typ = OPT.settyp *) - OPM.WriteString(SetRangeFunc); expr(l, MinPrec); OPM.WriteString(Comma); expr (r, MinPrec); - OPM.Write(CloseParen) - | Nmop: - CASE subclass OF - not: - OPM.Write("!"); expr(l, exprPrec) - | minus: - IF form = Set THEN OPM.Write("~") ELSE OPM.Write("-"); END ; - expr(l, exprPrec) - | is: - typ := n^.obj^.typ; - IF l^.typ^.comp = Record THEN OPM.WriteString(IsFunc); OPC.TypeOf(l^.obj) - ELSE OPM.WriteString(IsPFunc); expr(l, MinPrec); typ := typ^.BaseTyp - END ; - OPM.WriteString(Comma); - OPC.Andent(typ); OPM.WriteString(Comma); - OPM.WriteInt(typ^.extlev); OPM.Write(")") - | conv: - Convert(l, form, exprPrec) - | abs: - IF SideEffects(l) THEN - IF l^.typ^.form < Real THEN - IF l^.typ^.form < LInt THEN OPM.WriteString("(int)") END ; - OPM.WriteString("__ABSF(") - ELSE OPM.WriteString("__ABSFD(") + | OPT.Nconst: OPC.Constant(n^.conval, form) + | OPT.Nupto: (* n^.typ = OPT.settyp *) + OPM.WriteString(SetRangeFunc); expr(l, MinPrec); OPM.WriteString(Comma); expr (r, MinPrec); + OPM.Write(CloseParen) + | OPT.Nmop: + CASE subclass OF + | OPS.not: OPM.Write("!"); expr(l, exprPrec) + | OPS.minus: IF form = OPT.Set THEN OPM.Write("~") ELSE OPM.Write("-") END; + expr(l, exprPrec) + | OPS.is: typ := n^.obj^.typ; + IF l^.typ^.comp = OPT.Record THEN OPM.WriteString(IsFunc); OPC.TypeOf(l^.obj) + ELSE OPM.WriteString(IsPFunc); expr(l, MinPrec); typ := typ^.BaseTyp + END ; + OPM.WriteString(Comma); + OPC.Andent(typ); OPM.WriteString(Comma); + OPM.WriteInt(typ^.extlev); OPM.Write(")") + | OPT.conv: Convert(l, n.typ, exprPrec) + | OPT.abs: IF SideEffects(l) THEN + IF l^.typ^.form < OPT.Real THEN + IF l^.typ^.form < OPT.LInt THEN OPM.WriteString("(int)") END ; + OPM.WriteString("__ABSF(") + ELSE OPM.WriteString("__ABSFD(") + END + ELSE OPM.WriteString("__ABS(") + END ; + expr(l, MinPrec); OPM.Write(CloseParen) + | OPT.cap: OPM.WriteString("__CAP("); expr(l, MinPrec); OPM.Write(CloseParen) + | OPT.odd: OPM.WriteString("__ODD("); expr(l, MinPrec); OPM.Write(CloseParen) + | OPT.adr: OPM.WriteString("(LONGINT)(SYSTEM_ADDRESS)"); (*SYSTEM*) + IF l^.class = OPT.Nvarpar THEN OPC.CompleteIdent(l^.obj) + ELSE + IF (l^.typ^.form # OPT.String) & ~(l^.typ^.comp IN {OPT.Array, OPT.DynArr}) THEN OPM.Write("&") END ; + expr(l, exprPrec) + END + | OPT.val: IF ~(l^.class IN {OPT.Nvar, OPT.Nvarpar, OPT.Nfield, OPT.Nindex}) (*SYSTEM*) + OR (n^.typ^.form IN {OPT.LInt, OPT.Pointer, OPT.Set, OPT.ProcTyp}) + & (l^.typ^.form IN {OPT.LInt, OPT.Pointer, OPT.Set, OPT.ProcTyp}) + & (n^.typ^.size = l^.typ^.size) + THEN + OPM.Write(OpenParen); OPC.Ident(n^.typ^.strobj); OPM.Write(CloseParen); + IF (n^.typ^.form IN {OPT.Pointer, OPT.ProcTyp}) OR (l^.typ^.form IN {OPT.Pointer, OPT.ProcTyp}) THEN + OPM.WriteString("(SYSTEM_ADDRESS)") + END; + expr(l, exprPrec) + ELSE + OPM.WriteString("__VAL("); + OPC.Ident(n^.typ^.strobj); OPM.WriteString(Comma); + expr(l, MinPrec); OPM.Write(CloseParen) + END + ELSE OPM.err(200) END - ELSE OPM.WriteString("__ABS(") - END ; - expr(l, MinPrec); OPM.Write(CloseParen) - | cap: - OPM.WriteString("__CAP("); expr(l, MinPrec); OPM.Write(CloseParen) - | odd: - OPM.WriteString("__ODD("); expr(l, MinPrec); OPM.Write(CloseParen) - | adr: (*SYSTEM*) - OPM.WriteString("(LONGINT)(uintptr_t)"); - IF l^.class = Nvarpar THEN OPC.CompleteIdent(l^.obj) - ELSE - IF (l^.typ^.form # String) & ~(l^.typ^.comp IN {Array, DynArr}) THEN OPM.Write("&") END ; - expr(l, exprPrec) - END - | val: (*SYSTEM*) - IF (n^.typ^.form IN {LInt, Pointer, Set, ProcTyp}) & (l^.typ^.form IN {LInt, Pointer, Set, ProcTyp}) - & (n^.typ^.size = l^.typ^.size) OR ~(l^.class IN {Nvar, Nvarpar, Nfield, Nindex}) THEN - OPM.Write(OpenParen); OPC.Ident(n^.typ^.strobj); OPM.Write(CloseParen); - IF (n^.typ^.form IN {Pointer, ProcTyp}) OR (l^.typ^.form IN {Pointer, ProcTyp}) THEN - OPM.WriteString("(uintptr_t)") - END; - expr(l, exprPrec) - ELSE - IF (n^.typ^.form IN {Pointer, ProcTyp}) OR (l^.typ^.form IN {Pointer, ProcTyp}) THEN - OPM.WriteString("__VALP("); - ELSE - OPM.WriteString("__VAL("); - END; - OPC.Ident(n^.typ^.strobj); OPM.WriteString(Comma); - expr(l, MinPrec); OPM.Write(CloseParen) - END - ELSE OPM.err(200) - END - | Ndop: - CASE subclass OF - len: - Len(l, r^.conval^.intval) - | in, ash, msk, bit, lsh, rot, div, mod: - CASE subclass OF - | in: - OPM.WriteString("__IN(") - | ash: - IF r^.class = Nconst THEN - IF r^.conval^.intval >= 0 THEN OPM.WriteString("__ASHL(") - ELSE OPM.WriteString("__ASHR(") - END - ELSIF SideEffects(r) THEN OPM.WriteString("__ASHF(") - ELSE OPM.WriteString("__ASH(") - END - | msk: - OPM.WriteString("__MASK("); - | bit: - OPM.WriteString("__BIT(") - | lsh: - IF r^.class = Nconst THEN - IF r^.conval^.intval >= 0 THEN OPM.WriteString("__LSHL(") - ELSE OPM.WriteString("__LSHR(") - END - ELSE OPM.WriteString("__LSH(") - END - | rot: - IF r^.class = Nconst THEN - IF r^.conval^.intval >= 0 THEN OPM.WriteString("__ROTL(") - ELSE OPM.WriteString("__ROTR(") - END - ELSE OPM.WriteString("__ROT(") - END - | div: - IF SideEffects(n) THEN - IF form < LInt THEN OPM.WriteString("(int)") END ; - OPM.WriteString("__DIVF(") - ELSE OPM.WriteString("__DIV(") - END - | mod: - IF form < LInt THEN OPM.WriteString("(int)") END ; - IF SideEffects(n) THEN OPM.WriteString("__MODF(") - ELSE OPM.WriteString("__MOD(") - END; - ELSE - OPM.LogWStr("unhandled case in OPV.expr, subclass = "); OPM.LogWNum(subclass, 0); OPM.LogWLn; - END ; - expr(l, MinPrec); - OPM.WriteString(Comma); - IF (subclass IN {ash, lsh, rot}) & (r^.class = Nconst) & (r^.conval^.intval < 0) THEN - OPM.WriteInt(-r^.conval^.intval) - ELSE expr(r, MinPrec) - END ; - IF subclass IN {lsh, rot} THEN OPM.WriteString(Comma); OPC.Ident(l^.typ^.strobj) END ; - OPM.Write(CloseParen) - | eql .. geq: - IF l^.typ^.form IN {String, Comp} THEN - OPM.WriteString("__STRCMP("); - expr(l, MinPrec); OPM.WriteString(Comma); expr(r, MinPrec); OPM.Write(CloseParen); - OPC.Cmp(subclass); OPM.Write("0") - ELSE - expr(l, exprPrec); OPC.Cmp(subclass); - typ := l^.typ; - IF (typ^.form = Pointer) & (r^.typ.form # NilTyp) & (r^.typ # typ) & (r^.typ # OPT.sysptrtyp) THEN - OPM.WriteString("(void *) ") - END ; - expr(r, exprPrec) - END - ELSE - IF (subclass = and) OR ((form = Set) & ((subclass = times) OR (subclass = minus))) THEN OPM.Write(OpenParen); END; (* to silence clang warnings; -- noch *) - expr(l, exprPrec); - CASE subclass OF - times: - IF form = Set THEN OPM.WriteString(" & ") - ELSE OPM.WriteString(" * ") + | OPT.Ndop: CASE subclass OF + | OPT.len: Len(l, r^.conval^.intval) + | OPS.in, + OPT.ash, + OPT.msk, + OPT.bit, + OPT.lsh, + OPT.rot, + OPS.div, + OPS.mod: CASE subclass OF + | OPS.in: OPM.WriteString("__IN(") + | OPT.ash: IF r^.class = OPT.Nconst THEN + IF r^.conval^.intval >= 0 THEN OPM.WriteString("__ASHL(") + ELSE OPM.WriteString("__ASHR(") + END + ELSIF SideEffects(r) THEN OPM.WriteString("__ASHF(") + ELSE OPM.WriteString("__ASH(") + END + | OPT.msk: OPM.WriteString("__MASK("); + | OPT.bit: OPM.WriteString("__BIT(") + | OPT.lsh: IF r^.class = OPT.Nconst THEN + IF r^.conval^.intval >= 0 THEN OPM.WriteString("__LSHL(") + ELSE OPM.WriteString("__LSHR(") + END + ELSE OPM.WriteString("__LSH(") + END + | OPT.rot: IF r^.class = OPT.Nconst THEN + IF r^.conval^.intval >= 0 THEN OPM.WriteString("__ROTL(") + ELSE OPM.WriteString("__ROTR(") + END + ELSE OPM.WriteString("__ROT(") + END + | OPS.div: IF SideEffects(n) THEN + IF form < OPT.LInt THEN OPM.WriteString("(int)") END ; + OPM.WriteString("__DIVF(") + ELSE OPM.WriteString("__DIV(") + END + | OPS.mod: IF form < OPT.LInt THEN OPM.WriteString("(int)") END ; + IF SideEffects(n) THEN OPM.WriteString("__MODF(") + ELSE OPM.WriteString("__MOD(") + END; + ELSE OPM.LogWStr("unhandled case in OPV.expr, subclass = "); OPM.LogWNum(subclass, 0); OPM.LogWLn; + END ; + expr(l, MinPrec); + OPM.WriteString(Comma); + IF (subclass IN {OPT.ash, OPT.lsh, OPT.rot}) & (r^.class = OPT.Nconst) & (r^.conval^.intval < 0) THEN + OPM.WriteInt(-r^.conval^.intval) + ELSE expr(r, MinPrec) + END ; + IF subclass IN {OPT.lsh, OPT.rot} THEN OPM.WriteString(Comma); OPC.Ident(l^.typ^.strobj) END ; + OPM.Write(CloseParen) + | OPS.eql + .. OPS.geq: IF l^.typ^.form IN {OPT.String, OPT.Comp} THEN + OPM.WriteString("__STRCMP("); + expr(l, MinPrec); OPM.WriteString(Comma); expr(r, MinPrec); OPM.Write(CloseParen); + OPC.Cmp(subclass); OPM.Write("0") + ELSE + expr(l, exprPrec); OPC.Cmp(subclass); + typ := l^.typ; + IF (typ^.form = OPT.Pointer) & (r^.typ.form # OPT.NilTyp) & (r^.typ # typ) & (r^.typ # OPT.sysptrtyp) THEN + OPM.WriteString("(void *) ") + END ; + expr(r, exprPrec) + END + ELSE IF (subclass = OPS.and) OR ((form = OPT.Set) & ((subclass = OPS.times) OR (subclass = OPS.minus))) THEN OPM.Write(OpenParen); END; (* to silence clang warnings; -- noch *) + expr(l, exprPrec); + CASE subclass OF + | OPS.times: IF form = OPT.Set THEN OPM.WriteString(" & ") + ELSE OPM.WriteString(" * ") + END + | OPS.slash: IF form = OPT.Set THEN OPM.WriteString(" ^ ") + ELSE OPM.WriteString(" / "); + IF (r^.obj = NIL) OR (r^.obj^.typ^.form IN OPT.intSet) THEN + OPM.Write(OpenParen); OPC.Ident(n^.typ^.strobj); OPM.Write(CloseParen) + END + END + | OPS.and: OPM.WriteString(" && ") + | OPS.plus: IF form = OPT.Set THEN OPM.WriteString(" | ") + ELSE OPM.WriteString(" + ") + END + | OPS.minus: IF form = OPT.Set THEN OPM.WriteString(" & ~") + ELSE OPM.WriteString(" - ") + END; + | OPS.or: OPM.WriteString(" || "); + ELSE OPM.LogWStr("unhandled case in OPV.expr, subclass = "); OPM.LogWNum(subclass, 0); OPM.LogWLn; + END; + expr(r, exprPrec); + IF (subclass = OPS.and) OR ((form = OPT.Set) & ((subclass = OPS.times) OR (subclass = OPS.minus))) THEN OPM.Write(CloseParen) END; (* to silence clang warnings, -- noch*) END - | slash: - IF form = Set THEN OPM.WriteString(" ^ ") - ELSE OPM.WriteString(" / "); - IF (r^.obj = NIL) OR (r^.obj^.typ^.form IN {SInt, Int, LInt(*, Int8, Int16, Int32, Int64*)}) THEN - OPM.Write(OpenParen); OPC.Ident(n^.typ^.strobj); OPM.Write(CloseParen) - END - END - | and: - OPM.WriteString(" && ") - | plus: - IF form = Set THEN OPM.WriteString(" | ") - ELSE OPM.WriteString(" + ") - END - | minus: - IF form = Set THEN OPM.WriteString(" & ~") - ELSE OPM.WriteString(" - ") - END; - | or: - OPM.WriteString(" || "); - ELSE - OPM.LogWStr("unhandled case in OPV.expr, subclass = "); OPM.LogWNum(subclass, 0); OPM.LogWLn; - END; - expr(r, exprPrec); - IF (subclass = and) OR ((form = Set) & ((subclass = times) OR (subclass = minus))) THEN OPM.Write(CloseParen) END; (* to silence clang warnings, -- noch*) - END - | Ncall: - IF (l^.obj # NIL) & (l^.obj^.mode = TProc) THEN - IF l^.subcl = super THEN proc := SuperProc(n) - ELSE OPM.WriteString("__"); proc := OPC.BaseTProc(l^.obj) - END ; - OPC.Ident(proc); - n^.obj := proc^.link - ELSIF l^.class = Nproc THEN design(l, 10) - ELSE design(l, ProcTypeVar) - END ; - ActualPar(r, n^.obj) - ELSE - design(n, prec); (* not exprPrec! *) - END ; - IF (exprPrec <= prec) & (class IN {Nconst, Nupto, Nmop, Ndop, Ncall, Nguard}) THEN + | OPT.Ncall: IF (l^.obj # NIL) & (l^.obj^.mode = OPT.TProc) THEN + IF l^.subcl = OPT.super THEN proc := SuperProc(n) + ELSE OPM.WriteString("__"); proc := OPC.BaseTProc(l^.obj) + END ; + OPC.Ident(proc); + n^.obj := proc^.link + ELSIF l^.class = OPT.Nproc THEN design(l, 10) + ELSE design(l, ProcTypeVar) + END ; + ActualPar(r, n^.obj) + ELSE design(n, prec); (* not exprPrec! *) + END; + IF (exprPrec <= prec) & (class IN {OPT.Nconst, OPT.Nupto, OPT.Nmop, OPT.Ndop, OPT.Ncall, OPT.Nguard}) THEN OPM.Write(CloseParen) END END expr; @@ -792,14 +688,14 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 PROCEDURE IfStat(n: OPT.Node; withtrap: BOOLEAN; outerProc: OPT.Object); VAR if: OPT.Node; obj: OPT.Object; typ: OPT.Struct; adr: LONGINT; - BEGIN (* n^.class IN {Nifelse, Nwith} *) + BEGIN (* n^.class IN {OPT.Nifelse, OPT.Nwith} *) if := n^.left; (* name := ""; *) WHILE if # NIL DO OPM.WriteString("if "); expr(if^.left, MaxPrec); (* if *) OPM.Write(Blank); OPC.BegBlk; - IF (n^.class = Nwith) & (if^.left^.left # NIL) THEN (* watch out for const expr *) + IF (n^.class = OPT.Nwith) & (if^.left^.left # NIL) THEN (* watch out for const expr *) obj := if^.left^.left^.obj; typ := obj^.typ; adr := obj^.adr; - IF typ^.comp = Record THEN + IF typ^.comp = OPT.Record THEN (* introduce alias pointer for var records; T1 *name__ = rec; *) OPC.BegStat; OPC.Ident(if^.left^.obj); OPM.WriteString(" *"); OPM.WriteString(obj.name); OPM.WriteString("__ = (void*)"); @@ -865,7 +761,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 PROCEDURE ImplicitReturn(n: OPT.Node): BOOLEAN; BEGIN - WHILE (n # NIL) & (n.class # Nreturn) DO n := n^.link END ; + WHILE (n # NIL) & (n.class # OPT.Nreturn) DO n := n^.link END ; RETURN n = NIL END ImplicitReturn; @@ -873,22 +769,22 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 VAR typ, base: OPT.Struct; nofdim, nofdyn: INTEGER; BEGIN typ := d^.typ^.BaseTyp; base := typ; nofdim := 0; nofdyn := 0; - WHILE base^.comp = DynArr DO INC(nofdim); INC(nofdyn); base := base^.BaseTyp END ; + WHILE base^.comp = OPT.DynArr DO INC(nofdim); INC(nofdyn); base := base^.BaseTyp END ; design(d, MinPrec); OPM.WriteString(" = __NEWARR("); - WHILE base^.comp = Array DO INC(nofdim); base := base^.BaseTyp END ; - IF (base^.comp = Record) & (OPC.NofPtrs(base) # 0) THEN + WHILE base^.comp = OPT.Array DO INC(nofdim); base := base^.BaseTyp END ; + IF (base^.comp = OPT.Record) & (OPC.NofPtrs(base) # 0) THEN OPC.Ident(base^.strobj); OPM.WriteString(DynTypExt) - ELSIF base^.form = Pointer THEN OPM.WriteString("POINTER__typ") + ELSIF base^.form = OPT.Pointer THEN OPM.WriteString("POINTER__typ") ELSE OPM.WriteString("NIL") END ; OPM.WriteString(", "); OPM.WriteString("((LONGINT)("); OPM.WriteInt(base^.size); OPM.WriteString("))"); - OPM.WriteString(", "); OPM.WriteInt(OPC.Base(base)); (* element alignment *) + OPM.WriteString(", "); OPM.WriteInt(OPC.BaseAlignment(base)); (* element alignment *) OPM.WriteString(", "); OPM.WriteInt(nofdim); (* total number of dimensions = number of additional parameters *) OPM.WriteString(", "); OPM.WriteInt(nofdyn); (* number of dynamic dimensions *) WHILE typ # base DO OPM.WriteString(", "); - IF typ^.comp = DynArr THEN - IF x^.class = Nconst THEN OPM.WriteString("(LONGINT)("); expr(x, MinPrec); OPM.WriteString(")") + IF typ^.comp = OPT.DynArr THEN + IF x^.class = OPT.Nconst THEN OPM.WriteString("(LONGINT)("); expr(x, MinPrec); OPM.WriteString(")") ELSE OPM.WriteString("(LONGINT)"); expr(x, 10) END ; x := x^.link @@ -901,12 +797,12 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 PROCEDURE DefineTDescs(n: OPT.Node); BEGIN - WHILE (n # NIL) & (n^.class = Ninittd) DO OPC.TDescDecl(n^.typ); n := n^.link END + WHILE (n # NIL) & (n^.class = OPT.Ninittd) DO OPC.TDescDecl(n^.typ); n := n^.link END END DefineTDescs; PROCEDURE InitTDescs(n: OPT.Node); BEGIN - WHILE (n # NIL) & (n^.class = Ninittd) DO OPC.InitTDesc(n^.typ); n := n^.link END + WHILE (n # NIL) & (n^.class = OPT.Ninittd) DO OPC.InitTDesc(n^.typ); n := n^.link END END InitTDescs; PROCEDURE stat(n: OPT.Node; outerProc: OPT.Object); @@ -914,162 +810,138 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 BEGIN WHILE (n # NIL) & OPM.noerr DO OPM.errpos := n^.conval^.intval; - IF n^.class # Ninittd THEN OPC.BegStat; END; + IF n^.class # OPT.Ninittd THEN OPC.BegStat END; CASE n^.class OF - Nenter: - IF n^.obj = NIL THEN (* enter module *) - INC(OPM.level); stat(n^.left, outerProc); DEC(OPM.level); - OPC.GenEnumPtrs(OPT.topScope^.scope); - DefineTDescs(n^.right); OPC.EnterBody; InitTDescs(n^.right); - OPM.WriteString("/* BEGIN */"); OPM.WriteLn; - stat(n^.right, outerProc); OPC.ExitBody - ELSE (* enter proc *) - proc := n^.obj; - OPC.TypeDefs(proc^.scope^.right, 0); - IF ~proc^.scope^.leaf THEN OPC.DefineInter (proc) END ; (* define intermediate procedure scope *) - INC(OPM.level); stat(n^.left, proc); DEC(OPM.level); - OPC.EnterProc(proc); stat(n^.right, proc); - OPC.ExitProc(proc, TRUE, ImplicitReturn(n^.right)); - END - | Ninittd: (* done in enter module *) - | Nassign: - CASE n^.subcl OF - assign: - l := n^.left; r := n^.right; - IF l^.typ^.comp = Array THEN (* includes string assignment but not COPY *) - OPM.WriteString(MoveFunc); - expr(r, MinPrec); OPM.WriteString(Comma); expr(l, MinPrec); OPM.WriteString(Comma); - IF r^.typ = OPT.stringtyp THEN OPM.WriteInt(r^.conval^.intval2) - ELSE OPM.WriteInt(r^.typ^.size) - END ; - OPM.Write(CloseParen) - ELSE - IF (l^.typ^.form = Pointer) & (l^.obj # NIL) & (l^.obj^.adr = 1) & (l^.obj^.mode = Var) THEN - l^.obj^.adr := 0; design(l, MinPrec); l^.obj^.adr := 1; (* avoid cast of WITH-variable *) - IF r^.typ^.form # NilTyp THEN OPM.WriteString(" = (void*)") - ELSE OPM.WriteString(" = ") - END - ELSE - design(l, MinPrec); OPM.WriteString(" = ") - END ; - IF l^.typ = r^.typ THEN expr(r, MinPrec) - ELSIF (l^.typ^.form = Pointer) & (r^.typ^.form # NilTyp) & (l^.typ^.strobj # NIL) THEN - OPM.Write("("); OPC.Ident(l^.typ^.strobj); OPM.Write(")"); expr(r, MinPrec) - ELSIF l^.typ^.comp = Record THEN - OPM.WriteString("*("); OPC.Andent(l^.typ); OPM.WriteString("*)&"); expr(r, 9) - ELSE expr(r, MinPrec) - END - END - | newfn: - IF n^.left^.typ^.BaseTyp^.comp = Record THEN - OPM.WriteString("__NEW("); design(n^.left, MinPrec); OPM.WriteString(", "); - OPC.Andent(n^.left^.typ^.BaseTyp); OPM.WriteString(")") - ELSIF n^.left^.typ^.BaseTyp^.comp IN {Array, DynArr} THEN - NewArr(n^.left, n^.right) - END - | incfn, decfn: - expr(n^.left, MinPrec); OPC.Increment(n^.subcl = decfn); expr(n^.right, MinPrec) - | inclfn, exclfn: - expr(n^.left, MinPrec); OPC.SetInclude(n^.subcl = exclfn); OPM.WriteString(SetOfFunc); expr(n^.right, MinPrec); - OPM.Write(CloseParen) - | copyfn: - OPM.WriteString(CopyFunc); - expr(n^.right, MinPrec); OPM.WriteString(Comma); expr(n^.left, MinPrec); OPM.WriteString(Comma); - Len(n^.left, 0); OPM.Write(CloseParen) - | (*SYSTEM*)movefn: - OPM.WriteString(MoveFunc); - expr(n^.right, MinPrec); OPM.WriteString(Comma); expr(n^.left, MinPrec); OPM.WriteString(Comma); - expr(n^.right^.link, MinPrec); - OPM.Write(CloseParen) - | (*SYSTEM*)getfn: - OPM.WriteString(GetFunc); expr(n^.right, MinPrec); OPM.WriteString(Comma); expr(n^.left, MinPrec); - OPM.WriteString(Comma); OPC.Ident(n^.left^.typ^.strobj); OPM.Write(CloseParen) - | (*SYSTEM*)putfn: - OPM.WriteString(PutFunc); expr(n^.left, MinPrec); OPM.WriteString(Comma); expr(n^.right, MinPrec); - OPM.WriteString(Comma); OPC.Ident(n^.right^.typ^.strobj); OPM.Write(CloseParen) - | (*SYSTEM*)getrfn, putrfn: OPM.err(200) - | (*SYSTEM*)sysnewfn: - OPM.WriteString("__SYSNEW("); - design(n^.left, MinPrec); OPM.WriteString(", "); - expr(n^.right, MinPrec); - OPM.Write(")") - ELSE - OPM.LogWStr("unhandled case in OPV.expr, n^.subcl = "); OPM.LogWNum(n^.subcl, 0); OPM.LogWLn; - END - | Ncall: - IF (n^.left^.obj # NIL) & (n^.left^.obj^.mode = TProc) THEN - IF n^.left^.subcl = super THEN proc := SuperProc(n) - ELSE OPM.WriteString("__"); proc := OPC.BaseTProc(n^.left^.obj) - END ; - OPC.Ident(proc); - n^.obj := proc^.link - ELSIF n^.left^.class = Nproc THEN design(n^.left, 10) - ELSE design(n^.left, ProcTypeVar) - END ; - ActualPar(n^.right, n^.obj) - | Nifelse: - IF n^.subcl # assertfn THEN IfStat(n, FALSE, outerProc) - ELSIF assert THEN OPM.WriteString("__ASSERT("); expr(n^.left^.left^.left, MinPrec); OPM.WriteString(Comma); - OPM.WriteInt(n^.left^.right^.right^.conval^.intval); OPM.Write(CloseParen); OPC.EndStat - END - | Ncase: - INC(exit.level); CaseStat(n, outerProc); DEC(exit.level) - | Nwhile: - INC(exit.level); OPM.WriteString("while "); expr(n^.left, MaxPrec); - OPM.Write(Blank); OPC.BegBlk; stat(n^.right, outerProc); OPC.EndBlk; - DEC(exit.level) - | Nrepeat: - INC(exit.level); OPM.WriteString("do "); OPC.BegBlk; stat(n^.left, outerProc); OPC.EndBlk0; - OPM.WriteString(" while (!"); expr(n^.right, 9); OPM.Write(CloseParen); - DEC(exit.level) - | Nloop: - saved := exit; exit.level := 0; exit.label := -1; - OPM.WriteString("for (;;) "); OPC.BegBlk; stat(n^.left, outerProc); OPC.EndBlk; - IF exit.label # -1 THEN - OPC.BegStat; OPM.WriteString("exit__"); OPM.WriteInt(exit.label); OPM.Write(":"); OPC.EndStat - END ; - exit := saved - | Nexit: - IF exit.level = 0 THEN OPM.WriteString(Break) - ELSE - IF exit.label = -1 THEN exit.label := nofExitLabels; INC(nofExitLabels) END ; - OPM.WriteString("goto exit__"); OPM.WriteInt(exit.label) - END - | Nreturn: - IF OPM.level = 0 THEN - IF mainprog THEN OPM.WriteString("__FINI") ELSE OPM.WriteString("__ENDMOD") END - ELSE - IF n^.left # NIL THEN - (* Make local copy of result before ExitProc deletes dynamic vars *) - OPM.WriteString("_o_result = "); - IF (n^.left^.typ^.form = Pointer) & (n^.obj^.typ # n^.left^.typ) THEN - OPM.WriteString("(void*)"); expr(n^.left, 10) - ELSE - expr(n^.left, MinPrec) - END; - OPM.WriteString(";"); OPM.WriteLn; OPC.BegStat; - OPC.ExitProc(outerProc, FALSE, FALSE); - OPM.WriteString("return _o_result"); - ELSE - OPM.WriteString("return"); - END - END - | Nwith: - IfStat(n, n^.subcl = 0, outerProc) - | Ntrap: - OPC.Halt(n^.right^.conval^.intval) - ELSE - (* this else is necessary cause - it can happen that - n^.class is something which is not handled, - like Nconst (7) - which I actually experienced - when compiling Texts0.Mod on raspberry pi - it generates __CASECHK and cause Halt, - noch *) - OPM.LogWStr("unhandled case in OPV.expr, n^.class = "); OPM.LogWNum(n^.class, 0); OPM.LogWLn; - END ; - IF ~(n^.class IN {Nenter, Ninittd, Nifelse, Nwith, Ncase, Nwhile, Nloop}) THEN OPC.EndStat END ; + | OPT.Nenter: IF n^.obj = NIL THEN (* enter module *) + INC(OPM.level); stat(n^.left, outerProc); DEC(OPM.level); + OPC.GenEnumPtrs(OPT.topScope^.scope); + DefineTDescs(n^.right); OPC.EnterBody; InitTDescs(n^.right); + OPM.WriteString("/* BEGIN */"); OPM.WriteLn; + stat(n^.right, outerProc); OPC.ExitBody + ELSE (* enter proc *) + proc := n^.obj; + OPC.TypeDefs(proc^.scope^.right, 0); + IF ~proc^.scope^.leaf THEN OPC.DefineInter (proc) END ; (* define intermediate procedure scope *) + INC(OPM.level); stat(n^.left, proc); DEC(OPM.level); + OPC.EnterProc(proc); stat(n^.right, proc); + OPC.ExitProc(proc, TRUE, ImplicitReturn(n^.right)); + END + | OPT.Ninittd: (* done in enter module *) + | OPT.Nassign: CASE n^.subcl OF + | OPT.assign: l := n^.left; r := n^.right; + IF l^.typ^.comp = OPT.Array THEN (* includes string assignment but not COPY *) + OPM.WriteString(MoveFunc); + expr(r, MinPrec); OPM.WriteString(Comma); expr(l, MinPrec); OPM.WriteString(Comma); + IF r^.typ = OPT.stringtyp THEN OPM.WriteInt(r^.conval^.intval2) + ELSE OPM.WriteInt(r^.typ^.size) + END ; + OPM.Write(CloseParen) + ELSE + IF (l^.typ^.form = OPT.Pointer) & (l^.obj # NIL) & (l^.obj^.adr = 1) & (l^.obj^.mode = OPT.Var) THEN + l^.obj^.adr := 0; design(l, MinPrec); l^.obj^.adr := 1; (* avoid cast of WITH-variable *) + IF r^.typ^.form # OPT.NilTyp THEN OPM.WriteString(" = (void*)") + ELSE OPM.WriteString(" = ") + END + ELSE + design(l, MinPrec); OPM.WriteString(" = ") + END ; + IF l^.typ = r^.typ THEN expr(r, MinPrec) + ELSIF (l^.typ^.form = OPT.Pointer) & (r^.typ^.form # OPT.NilTyp) & (l^.typ^.strobj # NIL) THEN + OPM.Write("("); OPC.Ident(l^.typ^.strobj); OPM.Write(")"); expr(r, MinPrec) + ELSIF l^.typ^.comp = OPT.Record THEN + OPM.WriteString("*("); OPC.Andent(l^.typ); OPM.WriteString("*)&"); expr(r, 9) + ELSE expr(r, MinPrec) + END + END + | OPT.newfn: IF n^.left^.typ^.BaseTyp^.comp = OPT.Record THEN + OPM.WriteString("__NEW("); design(n^.left, MinPrec); OPM.WriteString(", "); + OPC.Andent(n^.left^.typ^.BaseTyp); OPM.WriteString(")") + ELSIF n^.left^.typ^.BaseTyp^.comp IN {OPT.Array, OPT.DynArr} THEN + NewArr(n^.left, n^.right) + END + | OPT.incfn, + OPT.decfn: expr(n^.left, MinPrec); OPC.Increment(n^.subcl = OPT.decfn); expr(n^.right, MinPrec) + | OPT.inclfn, + OPT.exclfn: expr(n^.left, MinPrec); OPC.SetInclude(n^.subcl = OPT.exclfn); OPM.WriteString(SetOfFunc); expr(n^.right, MinPrec); + OPM.Write(CloseParen) + | OPT.copyfn: OPM.WriteString(CopyFunc); + expr(n^.right, MinPrec); OPM.WriteString(Comma); expr(n^.left, MinPrec); OPM.WriteString(Comma); + Len(n^.left, 0); OPM.Write(CloseParen) + | OPT.movefn: (*SYSTEM*) + OPM.WriteString(MoveFunc); + expr(n^.right, MinPrec); OPM.WriteString(Comma); expr(n^.left, MinPrec); OPM.WriteString(Comma); + expr(n^.right^.link, MinPrec); + OPM.Write(CloseParen) + | OPT.getfn: (*SYSTEM*) + OPM.WriteString(GetFunc); expr(n^.right, MinPrec); OPM.WriteString(Comma); expr(n^.left, MinPrec); + OPM.WriteString(Comma); OPC.Ident(n^.left^.typ^.strobj); OPM.Write(CloseParen) + | OPT.putfn: (*SYSTEM*) + OPM.WriteString(PutFunc); expr(n^.left, MinPrec); OPM.WriteString(Comma); expr(n^.right, MinPrec); + OPM.WriteString(Comma); OPC.Ident(n^.right^.typ^.strobj); OPM.Write(CloseParen) + | OPT.getrfn, (*SYSTEM*) + OPT.putrfn: (*SYSTEM*) OPM.err(200) + | OPT.sysnewfn: (*SYSTEM*) + OPM.WriteString("__SYSNEW("); + design(n^.left, MinPrec); OPM.WriteString(", "); + expr(n^.right, MinPrec); + OPM.Write(")") + ELSE OPM.LogWStr("unhandled case in OPV.expr, n^.subcl = "); OPM.LogWNum(n^.subcl, 0); OPM.LogWLn; + END + | OPT.Ncall: IF (n^.left^.obj # NIL) & (n^.left^.obj^.mode = OPT.TProc) THEN + IF n^.left^.subcl = OPT.super THEN proc := SuperProc(n) + ELSE OPM.WriteString("__"); proc := OPC.BaseTProc(n^.left^.obj) + END ; + OPC.Ident(proc); + n^.obj := proc^.link + ELSIF n^.left^.class = OPT.Nproc THEN design(n^.left, 10) + ELSE design(n^.left, ProcTypeVar) + END ; + ActualPar(n^.right, n^.obj) + | OPT.Nifelse: IF n^.subcl # OPT.assertfn THEN IfStat(n, FALSE, outerProc) + ELSIF assert THEN OPM.WriteString("__ASSERT("); expr(n^.left^.left^.left, MinPrec); OPM.WriteString(Comma); + OPM.WriteInt(n^.left^.right^.right^.conval^.intval); OPM.Write(CloseParen); OPC.EndStat + END + | OPT.Ncase: INC(exit.level); CaseStat(n, outerProc); DEC(exit.level) + | OPT.Nwhile: INC(exit.level); OPM.WriteString("while "); expr(n^.left, MaxPrec); + OPM.Write(Blank); OPC.BegBlk; stat(n^.right, outerProc); OPC.EndBlk; + DEC(exit.level) + | OPT.Nrepeat: INC(exit.level); OPM.WriteString("do "); OPC.BegBlk; stat(n^.left, outerProc); OPC.EndBlk0; + OPM.WriteString(" while (!"); expr(n^.right, 9); OPM.Write(CloseParen); + DEC(exit.level) + | OPT.Nloop: saved := exit; exit.level := 0; exit.label := -1; + OPM.WriteString("for (;;) "); OPC.BegBlk; stat(n^.left, outerProc); OPC.EndBlk; + IF exit.label # -1 THEN + OPC.BegStat; OPM.WriteString("exit__"); OPM.WriteInt(exit.label); OPM.Write(":"); OPC.EndStat + END ; + exit := saved + | OPT.Nexit: IF exit.level = 0 THEN OPM.WriteString(Break) + ELSE + IF exit.label = -1 THEN exit.label := nofExitLabels; INC(nofExitLabels) END ; + OPM.WriteString("goto exit__"); OPM.WriteInt(exit.label) + END + | OPT.Nreturn: IF OPM.level = 0 THEN + IF mainprog THEN OPM.WriteString("__FINI") ELSE OPM.WriteString("__ENDMOD") END + ELSE + IF n^.left # NIL THEN + (* Make local copy of result before ExitProc deletes dynamic vars *) + OPM.WriteString("_o_result = "); + IF (n^.left^.typ^.form = OPT.Pointer) & (n^.obj^.typ # n^.left^.typ) THEN + OPM.WriteString("(void*)"); expr(n^.left, 10) + ELSE + expr(n^.left, MinPrec) + END; + OPM.WriteString(";"); OPM.WriteLn; OPC.BegStat; + OPC.ExitProc(outerProc, FALSE, FALSE); + OPM.WriteString("return _o_result"); + ELSE + OPM.WriteString("return"); + END + END + | OPT.Nwith: IfStat(n, n^.subcl = 0, outerProc) + | OPT.Ntrap: OPC.Halt(n^.right^.conval^.intval) + ELSE OPM.LogWStr("unhandled case in OPV.expr, n^.class = "); OPM.LogWNum(n^.class, 0); OPM.LogWLn; + END; + IF ~(n^.class IN {OPT.Nenter, OPT.Ninittd, OPT.Nifelse, OPT.Nwith, OPT.Ncase, OPT.Nwhile, OPT.Nloop}) THEN OPC.EndStat END ; n := n^.link END END stat; diff --git a/src/compiler/errors.Mod b/src/compiler/errors.Mod index 02d6b84a..1546aa8c 100644 --- a/src/compiler/errors.Mod +++ b/src/compiler/errors.Mod @@ -188,6 +188,7 @@ errors[245] := "guarded pointer variable may be manipulated by non-local operati errors[301] := "implicit type cast"; errors[306] := "inappropriate symbol file ignored"; errors[307] := "no ELSE symbol after CASE statement sequence may lead to trap"; (* new warning, -- noch *) +errors[308] := "SYSTEM.VAL result includes memory past end of source variable"; (* DCWB *) END errors. (* @@ -196,8 +197,8 @@ Run-time Error Messages 0 silent HALT(0) 1..255 HALT(n), cf. SYSTEM_halt -1 assertion failed, cf. SYSTEM_assert - -2 invalid array index - -3 function procedure without RETURN statement + -2 invalid array index + -3 function procedure without RETURN statement -4 invalid case in CASE statement -5 type guard failed -6 implicit type guard in record assignment failed diff --git a/src/system/Files.Mod b/src/system/Files.Mod index 02bc69fc..7aeee5ac 100644 --- a/src/system/Files.Mod +++ b/src/system/Files.Mod @@ -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); diff --git a/src/system/Heap.Mod b/src/system/Heap.Mod index 73534c46..6395c0a7 100644 --- a/src/system/Heap.Mod +++ b/src/system/Heap.Mod @@ -186,7 +186,7 @@ MODULE Heap; correctly regardless of the size of an address. Specifically on 32 bit address architectures with 64 bit LONGINT, it loads 32 bits and extends it to LONGINT rather than loading 64 bits. *) - PROCEDURE -FetchAddress(pointer: LONGINT): LONGINT "(LONGINT)(uintptr_t)(*((void**)((uintptr_t)pointer)))"; + PROCEDURE -FetchAddress(pointer: LONGINT): LONGINT "(LONGINT)(SYSTEM_ADDRESS)(*((void**)((SYSTEM_ADDRESS)pointer)))"; PROCEDURE ExtendHeap(blksz: LONGINT); VAR size, chnk, j, next: LONGINT; diff --git a/src/system/Platformunix.Mod b/src/system/Platformunix.Mod index 6da2b7d7..1c2da65d 100644 --- a/src/system/Platformunix.Mod +++ b/src/system/Platformunix.Mod @@ -106,10 +106,10 @@ BEGIN RETURN (e = ECONNREFUSED()) OR (e = ECONNABORTED()) (* OS memory allocaton *) -PROCEDURE -allocate(size: LONGINT): LONGINT "(LONGINT)(uintptr_t)((void*)malloc((size_t)size))"; +PROCEDURE -allocate(size: LONGINT): LONGINT "(LONGINT)(SYSTEM_ADDRESS)((void*)malloc((size_t)size))"; PROCEDURE OSAllocate*(size: LONGINT): LONGINT; BEGIN RETURN allocate(size) END OSAllocate; -PROCEDURE -free(address: LONGINT) "free((void*)(uintptr_t)address)"; +PROCEDURE -free(address: LONGINT) "free((void*)(SYSTEM_ADDRESS)address)"; PROCEDURE OSFree*(address: LONGINT); BEGIN free(address) END OSFree; @@ -189,7 +189,7 @@ END ArgPos; (* Signals and traps *) -PROCEDURE -sethandler(s: INTEGER; h: SignalHandler) "SystemSetHandler(s, (uintptr_t)h)"; +PROCEDURE -sethandler(s: INTEGER; h: SignalHandler) "SystemSetHandler(s, (SYSTEM_ADDRESS)h)"; PROCEDURE SetInterruptHandler*(handler: SignalHandler); BEGIN sethandler(2, handler); END SetInterruptHandler; @@ -369,7 +369,7 @@ END Size; PROCEDURE -readfile (fd: LONGINT; p: LONGINT; l: LONGINT): LONGINT -"read(fd, (void*)(uintptr_t)(p), l)"; +"read(fd, (void*)(SYSTEM_ADDRESS)(p), l)"; PROCEDURE Read*(h: FileHandle; p: LONGINT; l: LONGINT; VAR n: LONGINT): ErrorCode; BEGIN @@ -386,7 +386,7 @@ END ReadBuf; PROCEDURE -writefile(fd: LONGINT; p: LONGINT; l: LONGINT): LONGINT -"write(fd, (void*)(uintptr_t)(p), l)"; +"write(fd, (void*)(SYSTEM_ADDRESS)(p), l)"; PROCEDURE Write*(h: FileHandle; p: LONGINT; l: LONGINT): ErrorCode; VAR written: LONGINT; diff --git a/src/system/Platformwindows.Mod b/src/system/Platformwindows.Mod index 0e30e3f9..a97d7da9 100644 --- a/src/system/Platformwindows.Mod +++ b/src/system/Platformwindows.Mod @@ -104,10 +104,10 @@ BEGIN RETURN (e = ECONNREFUSED()) OR (e = ECONNABORTED()) (* OS memory allocaton *) -PROCEDURE -allocate(size: LONGINT): LONGINT "(LONGINT)(uintptr_t)((void*)HeapAlloc(GetProcessHeap(), 0, (size_t)size))"; +PROCEDURE -allocate(size: LONGINT): LONGINT "(LONGINT)(SYSTEM_ADDRESS)((void*)HeapAlloc(GetProcessHeap(), 0, (size_t)size))"; PROCEDURE OSAllocate*(size: LONGINT): LONGINT; BEGIN RETURN allocate(size) END OSAllocate; -PROCEDURE -free(address: LONGINT) "HeapFree(GetProcessHeap(), 0, (void*)(uintptr_t)address)"; +PROCEDURE -free(address: LONGINT) "HeapFree(GetProcessHeap(), 0, (void*)(SYSTEM_ADDRESS)address)"; PROCEDURE OSFree*(address: LONGINT); BEGIN free(address) END OSFree; @@ -200,8 +200,8 @@ END ArgPos; (* Ctrl/c handling *) -PROCEDURE -SetInterruptHandler*(h: SignalHandler) "SystemSetInterruptHandler((uintptr_t)h)"; -PROCEDURE -SetQuitHandler* (h: SignalHandler) "SystemSetQuitHandler((uintptr_t)h)"; +PROCEDURE -SetInterruptHandler*(h: SignalHandler) "SystemSetInterruptHandler((SYSTEM_ADDRESS)h)"; +PROCEDURE -SetQuitHandler* (h: SignalHandler) "SystemSetQuitHandler((SYSTEM_ADDRESS)h)"; PROCEDURE SetBadInstructionHandler*(handler: SignalHandler); BEGIN (* TODO *) END SetBadInstructionHandler; @@ -232,7 +232,7 @@ BEGIN YMDHMStoClock(styear(), stmon(), stmday(), sthour(), stmin(), stsec(), t, d); END GetClock; -PROCEDURE -GetTickCount(): LONGINT "(LONGINT)(uint32_t)GetTickCount()"; +PROCEDURE -GetTickCount(): LONGINT "(LONGINT)(SYSTEM_CARD32)GetTickCount()"; PROCEDURE Time*(): LONGINT; VAR ms: LONGINT; @@ -293,16 +293,16 @@ PROCEDURE Error*(): ErrorCode; BEGIN RETURN err() END Error; (* File system *) -PROCEDURE -invalidHandleValue(): LONGINT "((LONGINT)(uintptr_t)INVALID_HANDLE_VALUE)"; +PROCEDURE -invalidHandleValue(): LONGINT "((LONGINT)(SYSTEM_ADDRESS)INVALID_HANDLE_VALUE)"; PROCEDURE -openrw (n: ARRAY OF CHAR): LONGINT -"(LONGINT)(uintptr_t)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0)"; +"(LONGINT)(SYSTEM_ADDRESS)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0)"; PROCEDURE -openro (n: ARRAY OF CHAR): LONGINT -"(LONGINT)(uintptr_t)CreateFile((char*)n, GENERIC_READ , FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0)"; +"(LONGINT)(SYSTEM_ADDRESS)CreateFile((char*)n, GENERIC_READ , FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0)"; PROCEDURE -opennew(n: ARRAY OF CHAR): LONGINT -"(LONGINT)(uintptr_t)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0)"; +"(LONGINT)(SYSTEM_ADDRESS)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0)"; @@ -332,7 +332,7 @@ END New; -PROCEDURE -closeHandle(h: FileHandle): INTEGER "(INTEGER)CloseHandle((HANDLE)(uintptr_t)h)"; +PROCEDURE -closeHandle(h: FileHandle): INTEGER "(INTEGER)CloseHandle((HANDLE)(SYSTEM_ADDRESS)h)"; PROCEDURE Close*(h: FileHandle): ErrorCode; BEGIN @@ -342,7 +342,7 @@ END Close; PROCEDURE -byHandleFileInformation "BY_HANDLE_FILE_INFORMATION bhfi"; -PROCEDURE -getFileInformationByHandle(h: FileHandle): INTEGER "(INTEGER)GetFileInformationByHandle((HANDLE)(uintptr_t)h, &bhfi)"; +PROCEDURE -getFileInformationByHandle(h: FileHandle): INTEGER "(INTEGER)GetFileInformationByHandle((HANDLE)(SYSTEM_ADDRESS)h, &bhfi)"; PROCEDURE -bhfiMtimeHigh(): LONGINT "(LONGINT)bhfi.ftLastWriteTime.dwHighDateTime"; PROCEDURE -bhfiMtimeLow(): LONGINT "(LONGINT)bhfi.ftLastWriteTime.dwLowDateTime"; PROCEDURE -bhfiVsn(): LONGINT "(LONGINT)bhfi.dwVolumeSerialNumber"; @@ -401,7 +401,7 @@ END MTimeAsClock; PROCEDURE -largeInteger "LARGE_INTEGER li"; PROCEDURE -liLongint(): LONGINT "(LONGINT)li.QuadPart"; -PROCEDURE -getFileSize(h: FileHandle): INTEGER "(INTEGER)GetFileSizeEx((HANDLE)(uintptr_t)h, &li)"; +PROCEDURE -getFileSize(h: FileHandle): INTEGER "(INTEGER)GetFileSizeEx((HANDLE)(SYSTEM_ADDRESS)h, &li)"; PROCEDURE Size*(h: FileHandle; VAR l: LONGINT): ErrorCode; BEGIN @@ -413,7 +413,7 @@ END Size; PROCEDURE -readfile (fd: LONGINT; p: LONGINT; l: LONGINT; VAR n: LONGINT): INTEGER -"(INTEGER)ReadFile ((HANDLE)(uintptr_t)fd, (void*)(uintptr_t)(p), (DWORD)l, (DWORD*)n, 0)"; +"(INTEGER)ReadFile ((HANDLE)(SYSTEM_ADDRESS)fd, (void*)(SYSTEM_ADDRESS)(p), (DWORD)l, (DWORD*)n, 0)"; PROCEDURE Read*(h: FileHandle; p: LONGINT; l: LONGINT; VAR n: LONGINT): ErrorCode; VAR result: INTEGER; @@ -434,7 +434,7 @@ END ReadBuf; PROCEDURE -writefile(fd: LONGINT; p: LONGINT; l: LONGINT): INTEGER -"(INTEGER)WriteFile((HANDLE)(uintptr_t)fd, (void*)(uintptr_t)(p), (DWORD)l, 0,0)"; +"(INTEGER)WriteFile((HANDLE)(SYSTEM_ADDRESS)fd, (void*)(SYSTEM_ADDRESS)(p), (DWORD)l, 0,0)"; PROCEDURE Write*(h: FileHandle; p: LONGINT; l: LONGINT): ErrorCode; BEGIN @@ -443,7 +443,7 @@ END Write; -PROCEDURE -flushFileBuffers(h: FileHandle): INTEGER "(INTEGER)FlushFileBuffers((HANDLE)(uintptr_t)h)"; +PROCEDURE -flushFileBuffers(h: FileHandle): INTEGER "(INTEGER)FlushFileBuffers((HANDLE)(SYSTEM_ADDRESS)h)"; PROCEDURE Sync*(h: FileHandle): ErrorCode; BEGIN @@ -453,7 +453,7 @@ END Sync; PROCEDURE -setFilePointerEx(h: FileHandle; o: LONGINT; r: INTEGER; VAR rc: INTEGER) -"li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((HANDLE)(uintptr_t)h, li, 0, (DWORD)r)"; +"li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((HANDLE)(SYSTEM_ADDRESS)h, li, 0, (DWORD)r)"; PROCEDURE -seekset(): INTEGER "FILE_BEGIN"; PROCEDURE -seekcur(): INTEGER "FILE_CURRENT"; @@ -469,9 +469,9 @@ END Seek; -PROCEDURE -setEndOfFile(h: FileHandle): INTEGER "(INTEGER)SetEndOfFile((HANDLE)(uintptr_t)h)"; +PROCEDURE -setEndOfFile(h: FileHandle): INTEGER "(INTEGER)SetEndOfFile((HANDLE)(SYSTEM_ADDRESS)h)"; PROCEDURE -getFilePos(h: FileHandle; VAR r: LONGINT; VAR rc: INTEGER) -"LARGE_INTEGER liz = {0}; *rc = (INTEGER)SetFilePointerEx((HANDLE)(uintptr_t)h, liz, &li, FILE_CURRENT); *r = (LONGINT)li.QuadPart"; +"LARGE_INTEGER liz = {0}; *rc = (INTEGER)SetFilePointerEx((HANDLE)(SYSTEM_ADDRESS)h, liz, &li, FILE_CURRENT); *r = (LONGINT)li.QuadPart"; PROCEDURE Truncate*(h: FileHandle; limit: LONGINT): ErrorCode; VAR rc: INTEGER; oldpos: LONGINT; @@ -529,8 +529,8 @@ PROCEDURE Exit*(code: INTEGER); BEGIN exit(code) END Exit; -PROCEDURE -errstring(s: ARRAY OF CHAR) 'WriteFile((HANDLE)(uintptr_t)Platform_StdOut, s, s__len-1, 0,0)'; -PROCEDURE -errc (c: CHAR) 'WriteFile((HANDLE)(uintptr_t)Platform_StdOut, &c, 1, 0,0)'; +PROCEDURE -errstring(s: ARRAY OF CHAR) 'WriteFile((HANDLE)(SYSTEM_ADDRESS)Platform_StdOut, s, s__len-1, 0,0)'; +PROCEDURE -errc (c: CHAR) 'WriteFile((HANDLE)(SYSTEM_ADDRESS)Platform_StdOut, &c, 1, 0,0)'; PROCEDURE errch(c: CHAR); BEGIN errc(c) END errch; PROCEDURE errln; BEGIN errch(0DX); errch(0AX) END errln; @@ -589,9 +589,9 @@ PROCEDURE TestLittleEndian; BEGIN i := 1; SYSTEM.GET(SYSTEM.ADR(i), LittleEndian); END TestLittleEndian; -PROCEDURE -getstdinhandle(): FileHandle "(uintptr_t)GetStdHandle(STD_INPUT_HANDLE)"; -PROCEDURE -getstdouthandle(): FileHandle "(uintptr_t)GetStdHandle(STD_OUTPUT_HANDLE)"; -PROCEDURE -getstderrhandle(): FileHandle "(uintptr_t)GetStdHandle(STD_ERROR_HANDLE)"; +PROCEDURE -getstdinhandle(): FileHandle "(SYSTEM_ADDRESS)GetStdHandle(STD_INPUT_HANDLE)"; +PROCEDURE -getstdouthandle(): FileHandle "(SYSTEM_ADDRESS)GetStdHandle(STD_OUTPUT_HANDLE)"; +PROCEDURE -getstderrhandle(): FileHandle "(SYSTEM_ADDRESS)GetStdHandle(STD_ERROR_HANDLE)"; PROCEDURE -getpid(): INTEGER "(INTEGER)GetCurrentProcessId()"; BEGIN diff --git a/src/system/SYSTEM.c b/src/system/SYSTEM.c index 50e91c6d..33511a70 100644 --- a/src/system/SYSTEM.c +++ b/src/system/SYSTEM.c @@ -35,7 +35,7 @@ void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0) void SYSTEM_ENUMP(void *adr, LONGINT n, void (*P)()) { while (n > 0) { - P((LONGINT)(uintptr_t)(*((void**)(adr)))); + P((LONGINT)(SYSTEM_ADDRESS)(*((void**)(adr)))); adr = ((void**)adr) + 1; n--; } @@ -106,7 +106,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, else if (typ == (LONGINT*)POINTER__typ) { /* element type is a pointer */ x = Heap_NEWBLK(size + nofelems * sizeof(LONGINT)); - p = (LONGINT*)(uintptr_t)x[-1]; + p = (LONGINT*)(SYSTEM_ADDRESS)x[-1]; p[-nofelems] = *p; /* build new type desc in situ: 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nofelems - 1; n = 1; /* n =1 for skipping the size field */ while (n <= nofelems) {*p = n*sizeof(LONGINT); p++; n++;} @@ -119,7 +119,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, while (ptab[nofptrs] >= 0) {nofptrs++;} /* number of pointers per element */ nptr = nofelems * nofptrs; /* total number of pointers */ x = Heap_NEWBLK(size + nptr * sizeof(LONGINT)); - p = (LONGINT*)(uintptr_t)x[- 1]; + p = (LONGINT*)(SYSTEM_ADDRESS)x[- 1]; p[-nptr] = *p; /* build new type desc in situ; 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nptr - 1; n = 0; off = dataoff; while (n < nofelems) {i = 0; @@ -155,7 +155,7 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler // (Ignore other signals) } - void SystemSetHandler(int s, uintptr_t h) { + void SystemSetHandler(int s, SYSTEM_ADDRESS h) { if (s >= 2 && s <= 4) { int needtosetsystemhandler = handler[s-2] == 0; handler[s-2] = (SystemSignalHandler)h; @@ -194,12 +194,12 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler } } - void SystemSetInterruptHandler(uintptr_t h) { + void SystemSetInterruptHandler(SYSTEM_ADDRESS h) { EnsureConsoleCtrlHandler(); SystemInterruptHandler = (SystemSignalHandler)h; } - void SystemSetQuitHandler(uintptr_t h) { + void SystemSetQuitHandler(SYSTEM_ADDRESS h) { EnsureConsoleCtrlHandler(); SystemQuitHandler = (SystemSignalHandler)h; } diff --git a/src/system/SYSTEM.h b/src/system/SYSTEM.h index 949951ac..6377745e 100644 --- a/src/system/SYSTEM.h +++ b/src/system/SYSTEM.h @@ -1,28 +1,38 @@ #ifndef SYSTEM__h #define SYSTEM__h -#ifndef _WIN32 - - // Building for a Unix/Linux based system - #include // For memcpy ... - #include // For uintptr_t ... - +#if defined(_WIN64) + typedef long long SYSTEM_INT64; + typedef unsigned long long SYSTEM_CARD64; #else - - // Building for Windows platform with either mingw under cygwin, or the MS C compiler - #ifdef _WIN64 - typedef unsigned long long size_t; - typedef unsigned long long uintptr_t; - #else - typedef unsigned int size_t; - typedef unsigned int uintptr_t; - #endif /* _WIN64 */ - - typedef unsigned int uint32_t; - void * __cdecl memcpy(void * dest, const void * source, size_t size); - + typedef long SYSTEM_INT64; + typedef unsigned long SYSTEM_CARD64; #endif +typedef int SYSTEM_INT32; +typedef unsigned int SYSTEM_CARD32; +typedef short int SYSTEM_INT16; +typedef unsigned short int SYSTEM_CARD16; +typedef signed char SYSTEM_INT8; +typedef unsigned char SYSTEM_CARD8; + +#if (__SIZEOF_POINTER__ == 8) || defined(_WIN64) || defined(__LP64__) + #if defined(_WIN64) + typedef unsigned long long size_t; + #else + typedef unsigned long size_t; + #endif +#else + typedef unsigned int size_t; +#endif + +#define SYSTEM_ADDRESS size_t +#define _SIZE_T_DECLARED // For FreeBSD +#define _SIZE_T_DEFINED_ // For OpenBSD + +void *memcpy(void *dest, const void *source, SYSTEM_ADDRESS size); + + // The compiler uses 'import' and 'export' which translate to 'extern' and // nothing respectively. @@ -70,6 +80,7 @@ typedef unsigned char U_SHORTINT; #endif typedef U_LONGINT SET; +typedef U_LONGINT U_SET; // OS Memory allocation interfaces are in PlatformXXX.Mod @@ -96,10 +107,10 @@ extern LONGINT SYSTEM_ENTIER (double x); // Signal handling in SYSTEM.c #ifndef _WIN32 - extern void SystemSetHandler(int s, uintptr_t h); + extern void SystemSetHandler(int s, SYSTEM_ADDRESS h); #else - extern void SystemSetInterruptHandler(uintptr_t h); - extern void SystemSetQuitHandler (uintptr_t h); + extern void SystemSetInterruptHandler(SYSTEM_ADDRESS h); + extern void SystemSetQuitHandler (SYSTEM_ADDRESS h); #endif @@ -122,20 +133,20 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __COPY(s, d, n) {char*_a=(void*)s,*_b=(void*)d; LONGINT _i=0,_t=n-1; \ while(_i<_t&&((_b[_i]=_a[_i])!=0)){_i++;};_b[_i]=0;} -#define __DUP(x, l, t) x=(void*)memcpy((void*)(uintptr_t)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) +#define __DUP(x, l, t) x=(void*)memcpy((void*)(SYSTEM_ADDRESS)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) #define __DUPARR(v, t) v=(void*)memcpy(v##__copy,v,sizeof(t)) -#define __DEL(x) Platform_OSFree((LONGINT)(uintptr_t)x) +#define __DEL(x) Platform_OSFree((LONGINT)(SYSTEM_ADDRESS)x) /* 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 + +#define __GET(a, x, t) x= *(t*)(SYSTEM_ADDRESS)(a) +#define __PUT(a, x, t) *(t*)(SYSTEM_ADDRESS)(a)=x #define __LSHL(x, n, t) ((t)((U_##t)(x)<<(n))) #define __LSHR(x, n, t) ((t)((U_##t)(x)>>(n))) @@ -150,7 +161,7 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) #define __BIT(x, n) (*(U_LONGINT*)(x)>>(n)&1) -#define __MOVE(s, d, n) memcpy((char*)(uintptr_t)(d),(char*)(uintptr_t)(s),n) +#define __MOVE(s, d, n) memcpy((char*)(SYSTEM_ADDRESS)(d),(char*)(SYSTEM_ADDRESS)(s),n) #define __ASHF(x, n) SYSTEM_ASH((LONGINT)(x), (LONGINT)(n)) #define __SHORT(x, y) ((int)((U_LONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) #define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) @@ -211,7 +222,7 @@ extern void Heap_INCREF(); extern void Platform_Init(INTEGER argc, LONGINT argv); extern void Heap_FINALL(); -#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (LONGINT)(uintptr_t)&argv); +#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (LONGINT)(SYSTEM_ADDRESS)&argv); #define __REGMAIN(name, enum) m = Heap_REGMOD((CHAR*)name,enum) #define __FINI Heap_FINALL(); return 0 @@ -232,7 +243,7 @@ extern SYSTEM_PTR Heap_NEWREC (LONGINT tag); extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __SYSNEW(p, len) p = Heap_NEWBLK((LONGINT)(len)) -#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(uintptr_t)t##__typ) +#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(SYSTEM_ADDRESS)t##__typ) #define __NEWARR SYSTEM_NEWARR @@ -263,20 +274,20 @@ extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __INITYP(t, t0, level) \ t##__typ = (LONGINT*)&t##__desc.blksz; \ memcpy(t##__desc.basep, t0##__typ - __BASEOFF, level*sizeof(LONGINT)); \ - t##__desc.basep[level] = (LONGINT)(uintptr_t)t##__typ; \ - t##__desc.module = (LONGINT)(uintptr_t)m; \ + t##__desc.basep[level] = (LONGINT)(SYSTEM_ADDRESS)t##__typ; \ + t##__desc.module = (LONGINT)(SYSTEM_ADDRESS)m; \ if(t##__desc.blksz!=sizeof(struct t)) __HALT(-15); \ t##__desc.blksz = (t##__desc.blksz+5*sizeof(LONGINT)-1)/(4*sizeof(LONGINT))*(4*sizeof(LONGINT)); \ - Heap_REGTYP(m, (LONGINT)(uintptr_t)&t##__desc.next); \ + Heap_REGTYP(m, (LONGINT)(SYSTEM_ADDRESS)&t##__desc.next); \ SYSTEM_INHERIT(t##__typ, t0##__typ) -#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(uintptr_t)typ##__typ) -#define __TYPEOF(p) ((LONGINT*)(uintptr_t)(*(((LONGINT*)(p))-1))) +#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(SYSTEM_ADDRESS)typ##__typ) +#define __TYPEOF(p) ((LONGINT*)(SYSTEM_ADDRESS)(*(((LONGINT*)(p))-1))) #define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) // Oberon-2 type bound procedures support -#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(uintptr_t)proc -#define __SEND(typ, num, funtyp, parlist) ((funtyp)((uintptr_t)*(typ-(__TPROC0OFF+num))))parlist +#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(SYSTEM_ADDRESS)proc +#define __SEND(typ, num, funtyp, parlist) ((funtyp)((SYSTEM_ADDRESS)*(typ-(__TPROC0OFF+num))))parlist diff --git a/src/test/events/clb.Mod b/src/test/events/clb.Mod index 218b82b7..a414cc44 100644 --- a/src/test/events/clb.Mod +++ b/src/test/events/clb.Mod @@ -2,54 +2,43 @@ MODULE clb; IMPORT Console; -TYPE OnSomething = PROCEDURE (x, y : INTEGER); - -PROCEDURE ProcessEvents(x, y : INTEGER; onsomething : OnSomething); +TYPE OnSomething = PROCEDURE (x, y: INTEGER); +PROCEDURE ProcessEvents(x, y: INTEGER; onsomething: OnSomething); BEGIN - -IF onsomething # NIL THEN onsomething(x, y) -ELSE - Console.String("didn't happen"); Console.Ln -END; - + IF onsomething # NIL THEN + onsomething(x, y) + ELSE + Console.String("didn't happen"); Console.Ln + END END ProcessEvents; PROCEDURE OnEvent(x, y : INTEGER); - BEGIN - -Console.String("event happened"); Console.Ln - + Console.String("event happened"); Console.Ln END OnEvent; PROCEDURE OnEvent2(x, y : INTEGER); - BEGIN - -Console.String("happened"); Console.Ln - + Console.String("event 2 happened"); Console.Ln END OnEvent2; PROCEDURE Something; -VAR onsmth : OnSomething; - + VAR onsmth: OnSomething; BEGIN - onsmth := NIL; ProcessEvents(0, 0, onsmth); onsmth := OnEvent; ProcessEvents(0, 0, onsmth); - END Something; BEGIN - Something; -(* -ProcessEvents(0, 0, NIL); -ProcessEvents(0, 0, OnEvent); -ProcessEvents(0, 0, OnEvent2); -*) + Something; + (* + ProcessEvents(0, 0, NIL); + ProcessEvents(0, 0, OnEvent); + ProcessEvents(0, 0, OnEvent2); + *) END clb. diff --git a/src/test/files/testFiles.Mod b/src/test/files/testFiles.Mod index 236a1247..8eaaba8e 100644 --- a/src/test/files/testFiles.Mod +++ b/src/test/files/testFiles.Mod @@ -5,31 +5,24 @@ IMPORT Files, Texts, Console; CONST file="testFiles.Mod"; -VAR +VAR T : Texts.Text; R : Texts.Reader; F : Files.File; ch : CHAR; BEGIN + F := Files.Old (file); + IF F # NIL THEN + NEW(T); + Texts.Open(T, file); + Texts.OpenReader(R, T, 0); + Texts.Read (R, ch); -F := Files.Old (file); -IF F # NIL THEN - NEW(T); - Texts.Open(T, file); - Texts.OpenReader(R, T, 0); - Texts.Read (R, ch); - - WHILE ~R.eot DO - Console.Char(ch); - IF ch = 0DX THEN Console.Char(0AX) END; + WHILE ~R.eot DO + IF ch = 0DX THEN Console.Ln ELSE Console.Char(ch) END; Texts.Read (R, ch); - END; - -ELSE - - Console.String ("cannot open"); Console.Ln; - -END; - - + END; + ELSE + Console.String ("cannot open"); Console.Ln; + END; END testFiles. diff --git a/src/tools/make/configure.c b/src/tools/make/configure.c index 0ec8e6b1..312b3ca5 100644 --- a/src/tools/make/configure.c +++ b/src/tools/make/configure.c @@ -16,6 +16,7 @@ #include "SYSTEM.h" + #ifdef _WIN32 #define strncasecmp _strnicmp #else @@ -406,7 +407,7 @@ void writeConfigurationMod() { fprintf(fd, " installdir* = '%s';\n", installdir); fprintf(fd, " staticLink* = '%s';\n", staticlink); fprintf(fd, "VAR\n"); - fprintf(fd, " versionLong-: ARRAY %d OF CHAR;\n", strnlen(versionstring, 100)+1); + fprintf(fd, " versionLong-: ARRAY %d OF CHAR;\n", (int)strnlen(versionstring, 100)+1); fprintf(fd, "BEGIN\n"); fprintf(fd, " versionLong := '%s';\n", versionstring); fprintf(fd, "END Configuration.\n"); diff --git a/src/tools/make/sourcechanges.sh b/src/tools/make/sourcechanges.sh index b2460d25..08aa873b 100644 --- a/src/tools/make/sourcechanges.sh +++ b/src/tools/make/sourcechanges.sh @@ -14,8 +14,8 @@ changes="0" for f in $1/*; do fn=$(basename $f) - egrep -v "(^/\* voc )|Configuration_|__MOVE.* cmd, |OPM_(IntSize|PointerSize|Alignment) =|Strings_Append.+void\*\)(cmd|OPM_OBERON|extTools_comp)" $f >$fn.old - egrep -v "(^/\* voc )|Configuration_|__MOVE.* cmd, |OPM_(IntSize|PointerSize|Alignment) =|Strings_Append.+void\*\)(cmd|OPM_OBERON|extTools_comp)" $fn >$fn.new + egrep -v "(^/\* voc +)|Configuration_|__MOVE.* cmd, |OPM_(IntSize|PointerSize|Alignment) =|Strings_Append.+void\*\)(cmd|OPM_OBERON|extTools_comp)" $f >$fn.old + egrep -v "(^/\* voc +)|Configuration_|__MOVE.* cmd, |OPM_(IntSize|PointerSize|Alignment) =|Strings_Append.+void\*\)(cmd|OPM_OBERON|extTools_comp)" $fn >$fn.new if ! diff -U 2 -b $fn.old $fn.new >$fn.diff; then echo "" echo "" From b6385f8b8c53a9473bb9585dee9e006677dcc9de Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 26 Aug 2016 16:28:07 +0100 Subject: [PATCH 197/580] Add basic SYSTEM.ADRINT type. --- bootstrap/unix-44/Configuration.c | 4 +-- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Console.c | 4 +-- bootstrap/unix-44/Console.h | 2 +- bootstrap/unix-44/Files.c | 18 +++++----- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 32 ++++++++--------- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 4 +-- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 8 ++--- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 6 ++-- bootstrap/unix-44/OPT.h | 4 +-- bootstrap/unix-44/OPV.c | 7 ++-- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Platform.c | 20 +++++------ bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 14 ++++---- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/SYSTEM.c | 12 +++---- bootstrap/unix-44/SYSTEM.h | 39 ++++++++++---------- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/Vishap.c | 3 +- bootstrap/unix-44/errors.c | 2 +- bootstrap/unix-44/errors.h | 2 +- bootstrap/unix-44/extTools.c | 2 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-44/vt100.c | 2 +- bootstrap/unix-44/vt100.h | 2 +- bootstrap/unix-48/Configuration.c | 4 +-- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Console.c | 4 +-- bootstrap/unix-48/Console.h | 2 +- bootstrap/unix-48/Files.c | 18 +++++----- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 32 ++++++++--------- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 4 +-- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 8 ++--- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 6 ++-- bootstrap/unix-48/OPT.h | 4 +-- bootstrap/unix-48/OPV.c | 7 ++-- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Platform.c | 20 +++++------ bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 14 ++++---- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/SYSTEM.c | 12 +++---- bootstrap/unix-48/SYSTEM.h | 39 ++++++++++---------- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/Vishap.c | 3 +- bootstrap/unix-48/errors.c | 2 +- bootstrap/unix-48/errors.h | 2 +- bootstrap/unix-48/extTools.c | 2 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-48/vt100.c | 2 +- bootstrap/unix-48/vt100.h | 2 +- bootstrap/unix-88/Configuration.c | 4 +-- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Console.c | 4 +-- bootstrap/unix-88/Console.h | 2 +- bootstrap/unix-88/Files.c | 18 +++++----- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 32 ++++++++--------- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 4 +-- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 4 +-- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 6 ++-- bootstrap/unix-88/OPT.h | 4 +-- bootstrap/unix-88/OPV.c | 7 ++-- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Platform.c | 20 +++++------ bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 14 ++++---- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/SYSTEM.c | 12 +++---- bootstrap/unix-88/SYSTEM.h | 39 ++++++++++---------- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/Vishap.c | 3 +- bootstrap/unix-88/errors.c | 2 +- bootstrap/unix-88/errors.h | 2 +- bootstrap/unix-88/extTools.c | 2 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/unix-88/vt100.c | 2 +- bootstrap/unix-88/vt100.h | 2 +- bootstrap/windows-48/Configuration.c | 4 +-- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Console.c | 4 +-- bootstrap/windows-48/Console.h | 2 +- bootstrap/windows-48/Files.c | 18 +++++----- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 32 ++++++++--------- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 4 +-- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 8 ++--- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 6 ++-- bootstrap/windows-48/OPT.h | 4 +-- bootstrap/windows-48/OPV.c | 7 ++-- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Platform.c | 54 ++++++++++++++-------------- bootstrap/windows-48/Platform.h | 6 ++-- bootstrap/windows-48/Reals.c | 14 ++++---- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/SYSTEM.c | 12 +++---- bootstrap/windows-48/SYSTEM.h | 39 ++++++++++---------- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/Vishap.c | 3 +- bootstrap/windows-48/errors.c | 2 +- bootstrap/windows-48/errors.h | 2 +- bootstrap/windows-48/extTools.c | 2 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-48/vt100.c | 2 +- bootstrap/windows-48/vt100.h | 2 +- bootstrap/windows-88/Configuration.c | 4 +-- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Console.c | 4 +-- bootstrap/windows-88/Console.h | 2 +- bootstrap/windows-88/Files.c | 18 +++++----- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 32 ++++++++--------- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 4 +-- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 4 +-- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 6 ++-- bootstrap/windows-88/OPT.h | 4 +-- bootstrap/windows-88/OPV.c | 7 ++-- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Platform.c | 54 ++++++++++++++-------------- bootstrap/windows-88/Platform.h | 6 ++-- bootstrap/windows-88/Reals.c | 14 ++++---- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/SYSTEM.c | 12 +++---- bootstrap/windows-88/SYSTEM.h | 39 ++++++++++---------- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/Vishap.c | 3 +- bootstrap/windows-88/errors.c | 2 +- bootstrap/windows-88/errors.h | 2 +- bootstrap/windows-88/extTools.c | 2 +- bootstrap/windows-88/extTools.h | 2 +- bootstrap/windows-88/vt100.c | 2 +- bootstrap/windows-88/vt100.h | 2 +- src/compiler/OPC.Mod | 1 + src/compiler/OPT.Mod | 2 ++ src/compiler/OPV.Mod | 5 +-- src/compiler/Vishap.Mod | 1 + src/system/Heap.Mod | 2 +- src/system/Platformunix.Mod | 10 +++--- src/system/Platformwindows.Mod | 44 +++++++++++------------ src/system/SYSTEM.c | 12 +++---- src/system/SYSTEM.h | 39 ++++++++++---------- 214 files changed, 680 insertions(+), 649 deletions(-) diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index 821dff97..b0d48f0a 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -13,6 +13,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/08/23] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/08/26] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index ec5e865a..38a63260 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Console.c b/bootstrap/unix-44/Console.c index f9161937..cc4cc8bd 100644 --- a/bootstrap/unix-44/Console.c +++ b/bootstrap/unix-44/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Platform.h" @@ -21,7 +21,7 @@ export void Console_String (CHAR *s, LONGINT s__len); void Console_Flush (void) { INTEGER error; - error = Platform_Write(((LONGINT)(1)), (LONGINT)(SYSTEM_ADDRESS)Console_line, Console_pos); + error = Platform_Write(((LONGINT)(1)), (LONGINT)(SYSTEM_ADRINT)Console_line, Console_pos); Console_pos = 0; } diff --git a/bootstrap/unix-44/Console.h b/bootstrap/unix-44/Console.h index 5fdd4e4d..2c462da9 100644 --- a/bootstrap/unix-44/Console.h +++ b/bootstrap/unix-44/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 5a1dd875..496a4a87 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" @@ -257,7 +257,7 @@ static void Files_Flush (Files_Buffer buf) if (buf->org != f->pos) { error = Platform_Seek(f->fd, buf->org, Platform_SeekSet); } - error = Platform_Write(f->fd, (LONGINT)(SYSTEM_ADDRESS)buf->data, buf->size); + error = Platform_Write(f->fd, (LONGINT)(SYSTEM_ADRINT)buf->data, buf->size); if (error != 0) { Files_Err((CHAR*)"error writing file", (LONGINT)19, f, error); } @@ -656,7 +656,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x } else { min = n; } - __MOVE((LONGINT)(SYSTEM_ADDRESS)buf->data + offset, (LONGINT)(SYSTEM_ADDRESS)x + xpos, min); + __MOVE((LONGINT)(SYSTEM_ADRINT)buf->data + offset, (LONGINT)(SYSTEM_ADRINT)x + xpos, min); offset += min; (*r).offset = offset; xpos += min; @@ -721,7 +721,7 @@ void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT } else { min = n; } - __MOVE((LONGINT)(SYSTEM_ADDRESS)x + xpos, (LONGINT)(SYSTEM_ADDRESS)buf->data + offset, min); + __MOVE((LONGINT)(SYSTEM_ADRINT)x + xpos, (LONGINT)(SYSTEM_ADRINT)buf->data + offset, min); offset += min; (*r).offset = offset; if (offset > buf->size) { @@ -772,15 +772,15 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT *res = 3; return; } - error = Platform_Read(fdold, (LONGINT)(SYSTEM_ADDRESS)buf, ((LONGINT)(4096)), &n); + error = Platform_Read(fdold, (LONGINT)(SYSTEM_ADRINT)buf, ((LONGINT)(4096)), &n); while (n > 0) { - error = Platform_Write(fdnew, (LONGINT)(SYSTEM_ADDRESS)buf, n); + error = Platform_Write(fdnew, (LONGINT)(SYSTEM_ADRINT)buf, n); if (error != 0) { ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); Files_Err((CHAR*)"cannot move file", (LONGINT)17, NIL, error); } - error = Platform_Read(fdold, (LONGINT)(SYSTEM_ADDRESS)buf, ((LONGINT)(4096)), &n); + error = Platform_Read(fdold, (LONGINT)(SYSTEM_ADRINT)buf, ((LONGINT)(4096)), &n); } ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); @@ -838,7 +838,7 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *de j += 1; } } else { - __MOVE((LONGINT)(SYSTEM_ADDRESS)src, (LONGINT)(SYSTEM_ADDRESS)dest, src__len); + __MOVE((LONGINT)(SYSTEM_ADRINT)src, (LONGINT)(SYSTEM_ADRINT)dest, src__len); } } @@ -1008,7 +1008,7 @@ static void Files_Finalize (SYSTEM_PTR o) { Files_File f = NIL; LONGINT res; - f = (Files_File)(SYSTEM_ADDRESS)o; + f = (Files_File)(SYSTEM_ADRINT)o; if (f->fd >= 0) { Files_CloseOSFile(f); if (f->tempFile) { diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index a4a4ea8c..bc1d11eb 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index 30ec687a..cca2fc74 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tskSfF */ #include "SYSTEM.h" struct Heap__1 { @@ -101,7 +101,7 @@ export void Heap_Unlock (void); extern void *Heap__init(); extern LONGINT Platform_MainStackFrame; extern LONGINT Platform_OSAllocate(LONGINT size); -#define Heap_FetchAddress(pointer) (LONGINT)(SYSTEM_ADDRESS)(*((void**)((SYSTEM_ADDRESS)pointer))) +#define Heap_FetchAddress(pointer) (LONGINT)(SYSTEM_ADRINT)(*((void**)((SYSTEM_ADRINT)pointer))) #define Heap_HeapModuleInit() Heap__init() #define Heap_OSAllocate(size) Platform_OSAllocate(size) #define Heap_PlatformHalt(code) Platform_Halt(code) @@ -134,7 +134,7 @@ SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) __COPY(name, m->name, ((LONGINT)(20))); m->refcnt = 0; m->enumPtrs = enumPtrs; - m->next = (Heap_Module)(SYSTEM_ADDRESS)Heap_modules; + m->next = (Heap_Module)(SYSTEM_ADRINT)Heap_modules; Heap_modules = (SYSTEM_PTR)m; _o_result = (void*)m; return _o_result; @@ -315,7 +315,7 @@ SYSTEM_PTR Heap_NEWREC (LONGINT tag) __PUT(adr + 8, 0, LONGINT); Heap_allocated += blksz; Heap_Unlock(); - _o_result = (SYSTEM_PTR)(SYSTEM_ADDRESS)(adr + 4); + _o_result = (SYSTEM_PTR)(SYSTEM_ADRINT)(adr + 4); return _o_result; } @@ -326,12 +326,12 @@ SYSTEM_PTR Heap_NEWBLK (LONGINT size) SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 31, 4), 4); - new = Heap_NEWREC((LONGINT)(SYSTEM_ADDRESS)&blksz); - tag = ((LONGINT)(SYSTEM_ADDRESS)new + blksz) - 12; + new = Heap_NEWREC((LONGINT)(SYSTEM_ADRINT)&blksz); + tag = ((LONGINT)(SYSTEM_ADRINT)new + blksz) - 12; __PUT(tag - 4, 0, LONGINT); __PUT(tag, blksz, LONGINT); __PUT(tag + 4, -4, LONGINT); - __PUT((LONGINT)(SYSTEM_ADDRESS)new - 4, tag, LONGINT); + __PUT((LONGINT)(SYSTEM_ADRINT)new - 4, tag, LONGINT); Heap_Unlock(); _o_result = new; return _o_result; @@ -360,7 +360,7 @@ static void Heap_Mark (LONGINT q) __GET(tag, offset, LONGINT); fld = q + offset; p = Heap_FetchAddress(fld); - __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADDRESS)n, SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)n, SYSTEM_PTR); } else { fld = q + offset; n = Heap_FetchAddress(fld); @@ -369,7 +369,7 @@ static void Heap_Mark (LONGINT q) if (!__ODD(tagbits)) { __PUT(n - 4, tagbits + 1, LONGINT); __PUT(q - 4, tag + 1, LONGINT); - __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADDRESS)p, SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)p, SYSTEM_PTR); p = q; q = n; tag = tagbits; @@ -384,7 +384,7 @@ static void Heap_Mark (LONGINT q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((LONGINT)(SYSTEM_ADDRESS)p); + Heap_Mark((LONGINT)(SYSTEM_ADRINT)p); } static void Heap_Scan (void) @@ -553,7 +553,7 @@ static void Heap_Finalize (void) } else { prev->next = n->next; } - (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADDRESS)n->obj); + (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); if (prev == NIL) { n = Heap_fin; } else { @@ -572,7 +572,7 @@ void Heap_FINALL (void) while (Heap_fin != NIL) { n = Heap_fin; Heap_fin = Heap_fin->next; - (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADDRESS)n->obj); + (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); } } @@ -589,9 +589,9 @@ static void Heap_MarkStack (LONGINT n, LONGINT *cand, LONGINT cand__len) } if (n == 0) { nofcand = 0; - sp = (LONGINT)(SYSTEM_ADDRESS)&frame; + sp = (LONGINT)(SYSTEM_ADRINT)&frame; stack0 = Heap_PlatformMainStackFrame(); - inc = (LONGINT)(SYSTEM_ADDRESS)&align.p - (LONGINT)(SYSTEM_ADDRESS)&align; + inc = (LONGINT)(SYSTEM_ADRINT)&align.p - (LONGINT)(SYSTEM_ADRINT)&align; if (sp > stack0) { inc = -inc; } @@ -622,7 +622,7 @@ void Heap_GC (BOOLEAN markStack) LONGINT cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); - m = (Heap_Module)(SYSTEM_ADDRESS)Heap_modules; + m = (Heap_Module)(SYSTEM_ADRINT)Heap_modules; while (m != NIL) { if (m->enumPtrs != NIL) { (*m->enumPtrs)(Heap_MarkP); @@ -699,7 +699,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (LONGINT)(SYSTEM_ADDRESS)obj; + f->obj = (LONGINT)(SYSTEM_ADRINT)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index a2cab30c..d05f688c 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index 330b7506..d76a50a2 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Heap.h" diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index ac8ac89e..78c8d49e 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index 0f614e6a..60b37750 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index d1c88266..e7a96131 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 3abccc9a..fce9997f 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "OPM.h" @@ -211,7 +211,7 @@ void OPC_Ident (OPT_Object obj) OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); } OPM_Write('_'); - } else if (obj == OPT_sysptrtyp->strobj || obj == OPT_bytetyp->strobj) { + } else if ((obj == OPT_sysptrtyp->strobj || obj == OPT_ainttyp->strobj) || obj == OPT_bytetyp->strobj) { OPM_WriteString((CHAR*)"SYSTEM_", (LONGINT)8); } OPM_WriteStringVar((void*)obj->name, ((LONGINT)(256))); diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index b7d34a07..7aea7283 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index bf683e41..88c3bd4d 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" @@ -544,15 +544,15 @@ void OPM_FPrintReal (LONGINT *fp, REAL real) { INTEGER i; LONGINT l; - __GET((LONGINT)(SYSTEM_ADDRESS)&real, l, LONGINT); + __GET((LONGINT)(SYSTEM_ADRINT)&real, l, LONGINT); OPM_FPrint(&*fp, l); } void OPM_FPrintLReal (LONGINT *fp, LONGREAL lr) { LONGINT l, h; - __GET((LONGINT)(SYSTEM_ADDRESS)&lr, l, LONGINT); - __GET((LONGINT)(SYSTEM_ADDRESS)&lr + 4, h, LONGINT); + __GET((LONGINT)(SYSTEM_ADRINT)&lr, l, LONGINT); + __GET((LONGINT)(SYSTEM_ADRINT)&lr + 4, h, LONGINT); OPM_FPrint(&*fp, l); OPM_FPrint(&*fp, h); } diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index ed914bff..3c2be746 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index 01d2144d..a0c19958 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPB.h" #include "OPM.h" diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index bf56b7d7..6c24817c 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index cacf9256..85c8b275 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index e901bcfc..313c0ac7 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index b32d0ebd..4b76312b 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" @@ -83,7 +83,7 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; -export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; export SHORTINT OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; @@ -1718,6 +1718,7 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_sinttyp); P(OPT_inttyp); P(OPT_linttyp); + P(OPT_ainttyp); P(OPT_realtyp); P(OPT_lrltyp); P(OPT_settyp); @@ -1794,6 +1795,7 @@ export void *OPT__init(void) OPT_undftyp->BaseTyp = OPT_undftyp; OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp); OPT_EnterTyp((CHAR*)"PTR", 13, OPM_PointerSize, &OPT_sysptrtyp); + OPT_EnterTyp((CHAR*)"ADRINT", 5, OPM_LIntSize, &OPT_ainttyp); OPT_EnterProc((CHAR*)"ADR", 20); OPT_EnterProc((CHAR*)"CC", 21); OPT_EnterProc((CHAR*)"LSH", 22); diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index 41b3e7ec..7187f687 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h @@ -67,7 +67,7 @@ typedef import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; -import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; import SHORTINT OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index cf646f5e..8b98e5f9 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPC.h" #include "OPM.h" @@ -284,6 +284,7 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_realtyp->strobj->linkadr = 2; OPT_inttyp->strobj->linkadr = 2; OPT_linttyp->strobj->linkadr = 2; + OPT_ainttyp->strobj->linkadr = 2; OPT_lrltyp->strobj->linkadr = 2; OPT_sinttyp->strobj->linkadr = 2; OPT_booltyp->strobj->linkadr = 2; @@ -931,7 +932,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPM_Write(')'); break; case 24: - OPM_WriteString((CHAR*)"(LONGINT)(SYSTEM_ADDRESS)", (LONGINT)26); + OPM_WriteString((CHAR*)"(LONGINT)(SYSTEM_ADRINT)", (LONGINT)25); if (l->class == 1) { OPC_CompleteIdent(l->obj); } else { @@ -947,7 +948,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPC_Ident(n->typ->strobj); OPM_Write(')'); if (__IN(n->typ->form, 0x6000) || __IN(l->typ->form, 0x6000)) { - OPM_WriteString((CHAR*)"(SYSTEM_ADDRESS)", (LONGINT)17); + OPM_WriteString((CHAR*)"(SYSTEM_ADRINT)", (LONGINT)16); } OPV_expr(l, exprPrec); } else { diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index 04828b2f..122fda4a 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 74c43788..6326549f 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef @@ -118,14 +118,14 @@ export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT #define Platform_EXDEV() EXDEV extern void Heap_InitHeap(); #define Platform_HeapInitHeap() Heap_InitHeap() -#define Platform_allocate(size) (LONGINT)(SYSTEM_ADDRESS)((void*)malloc((size_t)size)) +#define Platform_allocate(size) (LONGINT)(SYSTEM_ADRINT)((void*)malloc((size_t)size)) #define Platform_chdir(n, n__len) chdir((char*)n) #define Platform_closefile(fd) close(fd) #define Platform_err() errno #define Platform_errc(c) write(1, &c, 1) #define Platform_errstring(s, s__len) write(1, s, s__len-1) #define Platform_exit(code) exit(code) -#define Platform_free(address) free((void*)(SYSTEM_ADDRESS)address) +#define Platform_free(address) free((void*)(SYSTEM_ADRINT)address) #define Platform_fstat(fd) fstat(fd, &s) #define Platform_fsync(fd) fsync(fd) #define Platform_ftruncate(fd, l) ftruncate(fd, l) @@ -138,13 +138,13 @@ extern void Heap_InitHeap(); #define Platform_opennew(n, n__len) open((char*)n, O_CREAT | O_TRUNC | O_RDWR, 0664) #define Platform_openro(n, n__len) open((char*)n, O_RDONLY) #define Platform_openrw(n, n__len) open((char*)n, O_RDWR) -#define Platform_readfile(fd, p, l) read(fd, (void*)(SYSTEM_ADDRESS)(p), l) +#define Platform_readfile(fd, p, l) read(fd, (void*)(SYSTEM_ADRINT)(p), l) #define Platform_rename(o, o__len, n, n__len) rename((char*)o, (char*)n) #define Platform_sectotm(s) struct tm *time = localtime((time_t*)&s) #define Platform_seekcur() SEEK_CUR #define Platform_seekend() SEEK_END #define Platform_seekset() SEEK_SET -#define Platform_sethandler(s, h) SystemSetHandler(s, (SYSTEM_ADDRESS)h) +#define Platform_sethandler(s, h) SystemSetHandler(s, (SYSTEM_ADRINT)h) #define Platform_stat(n, n__len) stat((char*)n, &s) #define Platform_statdev() (LONGINT)s.st_dev #define Platform_statino() (LONGINT)s.st_ino @@ -161,7 +161,7 @@ extern void Heap_InitHeap(); #define Platform_tvsec() tv.tv_sec #define Platform_tvusec() tv.tv_usec #define Platform_unlink(n, n__len) unlink((char*)n) -#define Platform_writefile(fd, p, l) write(fd, (void*)(SYSTEM_ADDRESS)(p), l) +#define Platform_writefile(fd, p, l) write(fd, (void*)(SYSTEM_ADRINT)(p), l) BOOLEAN Platform_TooManyFiles (INTEGER e) { @@ -229,7 +229,7 @@ void Platform_Init (INTEGER argc, LONGINT argvadr) Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; Platform_ArgCount = argc; - av = (Platform_ArgVecPtr)(SYSTEM_ADDRESS)argvadr; + av = (Platform_ArgVecPtr)(SYSTEM_ADRINT)argvadr; Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; Platform_HeapInitHeap(); @@ -262,7 +262,7 @@ void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { - av = (Platform_ArgVec)(SYSTEM_ADDRESS)Platform_ArgVector; + av = (Platform_ArgVec)(SYSTEM_ADRINT)Platform_ArgVector; __COPY(*(*av)[__X(n, ((LONGINT)(1024)))], val, val__len); } } @@ -529,7 +529,7 @@ INTEGER Platform_Read (LONGINT h, LONGINT p, LONGINT l, LONGINT *n) INTEGER Platform_ReadBuf (LONGINT h, SYSTEM_BYTE *b, LONGINT b__len, LONGINT *n) { INTEGER _o_result; - *n = Platform_readfile(h, (LONGINT)(SYSTEM_ADDRESS)b, b__len); + *n = Platform_readfile(h, (LONGINT)(SYSTEM_ADRINT)b, b__len); if (*n < 0) { *n = 0; _o_result = Platform_err(); @@ -765,7 +765,7 @@ static void Platform_TestLittleEndian (void) { INTEGER i; i = 1; - __GET((LONGINT)(SYSTEM_ADDRESS)&i, Platform_LittleEndian, BOOLEAN); + __GET((LONGINT)(SYSTEM_ADRINT)&i, Platform_LittleEndian, BOOLEAN); } __TDESC(Platform_FileIdentity, 1, 0) = {__TDFLDS("FileIdentity", 12), {-4}}; diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index dd5ce434..77a9b68f 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 2323e34d..11c99924 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -58,7 +58,7 @@ INTEGER Reals_Expo (REAL x) { INTEGER _o_result; INTEGER i; - __GET((LONGINT)(SYSTEM_ADDRESS)&x + 2, i, INTEGER); + __GET((LONGINT)(SYSTEM_ADRINT)&x + 2, i, INTEGER); _o_result = __MASK(__ASHR(i, 7), -256); return _o_result; } @@ -66,17 +66,17 @@ INTEGER Reals_Expo (REAL x) void Reals_SetExpo (REAL *x, INTEGER ex) { CHAR c; - __GET((LONGINT)(SYSTEM_ADDRESS)x + 3, c, CHAR); - __PUT((LONGINT)(SYSTEM_ADDRESS)x + 3, (CHAR)(__ASHL(__ASHR((int)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); - __GET((LONGINT)(SYSTEM_ADDRESS)x + 2, c, CHAR); - __PUT((LONGINT)(SYSTEM_ADDRESS)x + 2, (CHAR)(__MASK((int)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); + __GET((LONGINT)(SYSTEM_ADRINT)x + 3, c, CHAR); + __PUT((LONGINT)(SYSTEM_ADRINT)x + 3, (CHAR)(__ASHL(__ASHR((int)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __GET((LONGINT)(SYSTEM_ADRINT)x + 2, c, CHAR); + __PUT((LONGINT)(SYSTEM_ADRINT)x + 2, (CHAR)(__MASK((int)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } INTEGER Reals_ExpoL (LONGREAL x) { INTEGER _o_result; INTEGER i; - __GET((LONGINT)(SYSTEM_ADDRESS)&x + 6, i, INTEGER); + __GET((LONGINT)(SYSTEM_ADRINT)&x + 6, i, INTEGER); _o_result = __MASK(__ASHR(i, 4), -2048); return _o_result; } diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index 7e6b534c..b0497a9c 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/SYSTEM.c b/bootstrap/unix-44/SYSTEM.c index 33511a70..1077d3ce 100644 --- a/bootstrap/unix-44/SYSTEM.c +++ b/bootstrap/unix-44/SYSTEM.c @@ -35,7 +35,7 @@ void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0) void SYSTEM_ENUMP(void *adr, LONGINT n, void (*P)()) { while (n > 0) { - P((LONGINT)(SYSTEM_ADDRESS)(*((void**)(adr)))); + P((LONGINT)(SYSTEM_ADRINT)(*((void**)(adr)))); adr = ((void**)adr) + 1; n--; } @@ -106,7 +106,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, else if (typ == (LONGINT*)POINTER__typ) { /* element type is a pointer */ x = Heap_NEWBLK(size + nofelems * sizeof(LONGINT)); - p = (LONGINT*)(SYSTEM_ADDRESS)x[-1]; + p = (LONGINT*)(SYSTEM_ADRINT)x[-1]; p[-nofelems] = *p; /* build new type desc in situ: 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nofelems - 1; n = 1; /* n =1 for skipping the size field */ while (n <= nofelems) {*p = n*sizeof(LONGINT); p++; n++;} @@ -119,7 +119,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, while (ptab[nofptrs] >= 0) {nofptrs++;} /* number of pointers per element */ nptr = nofelems * nofptrs; /* total number of pointers */ x = Heap_NEWBLK(size + nptr * sizeof(LONGINT)); - p = (LONGINT*)(SYSTEM_ADDRESS)x[- 1]; + p = (LONGINT*)(SYSTEM_ADRINT)x[- 1]; p[-nptr] = *p; /* build new type desc in situ; 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nptr - 1; n = 0; off = dataoff; while (n < nofelems) {i = 0; @@ -155,7 +155,7 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler // (Ignore other signals) } - void SystemSetHandler(int s, SYSTEM_ADDRESS h) { + void SystemSetHandler(int s, SYSTEM_ADRINT h) { if (s >= 2 && s <= 4) { int needtosetsystemhandler = handler[s-2] == 0; handler[s-2] = (SystemSignalHandler)h; @@ -194,12 +194,12 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler } } - void SystemSetInterruptHandler(SYSTEM_ADDRESS h) { + void SystemSetInterruptHandler(SYSTEM_ADRINT h) { EnsureConsoleCtrlHandler(); SystemInterruptHandler = (SystemSignalHandler)h; } - void SystemSetQuitHandler(SYSTEM_ADDRESS h) { + void SystemSetQuitHandler(SYSTEM_ADRINT h) { EnsureConsoleCtrlHandler(); SystemQuitHandler = (SystemSignalHandler)h; } diff --git a/bootstrap/unix-44/SYSTEM.h b/bootstrap/unix-44/SYSTEM.h index 6377745e..35620b9b 100644 --- a/bootstrap/unix-44/SYSTEM.h +++ b/bootstrap/unix-44/SYSTEM.h @@ -26,11 +26,12 @@ typedef unsigned char SYSTEM_CARD8; typedef unsigned int size_t; #endif -#define SYSTEM_ADDRESS size_t +#define SYSTEM_ADRINT size_t +#define SYSTEM_ADDRESS size_t // Temporarily for bootstrap #define _SIZE_T_DECLARED // For FreeBSD #define _SIZE_T_DEFINED_ // For OpenBSD -void *memcpy(void *dest, const void *source, SYSTEM_ADDRESS size); +void *memcpy(void *dest, const void *source, SYSTEM_ADRINT size); @@ -107,10 +108,10 @@ extern LONGINT SYSTEM_ENTIER (double x); // Signal handling in SYSTEM.c #ifndef _WIN32 - extern void SystemSetHandler(int s, SYSTEM_ADDRESS h); + extern void SystemSetHandler(int s, SYSTEM_ADRINT h); #else - extern void SystemSetInterruptHandler(SYSTEM_ADDRESS h); - extern void SystemSetQuitHandler (SYSTEM_ADDRESS h); + extern void SystemSetInterruptHandler(SYSTEM_ADRINT h); + extern void SystemSetQuitHandler (SYSTEM_ADRINT h); #endif @@ -133,9 +134,9 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __COPY(s, d, n) {char*_a=(void*)s,*_b=(void*)d; LONGINT _i=0,_t=n-1; \ while(_i<_t&&((_b[_i]=_a[_i])!=0)){_i++;};_b[_i]=0;} -#define __DUP(x, l, t) x=(void*)memcpy((void*)(SYSTEM_ADDRESS)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) +#define __DUP(x, l, t) x=(void*)memcpy((void*)(SYSTEM_ADRINT)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) #define __DUPARR(v, t) v=(void*)memcpy(v##__copy,v,sizeof(t)) -#define __DEL(x) Platform_OSFree((LONGINT)(SYSTEM_ADDRESS)x) +#define __DEL(x) Platform_OSFree((LONGINT)(SYSTEM_ADRINT)x) @@ -145,8 +146,8 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __VAL(t, x) (*(t*)&(x)) -#define __GET(a, x, t) x= *(t*)(SYSTEM_ADDRESS)(a) -#define __PUT(a, x, t) *(t*)(SYSTEM_ADDRESS)(a)=x +#define __GET(a, x, t) x= *(t*)(SYSTEM_ADRINT)(a) +#define __PUT(a, x, t) *(t*)(SYSTEM_ADRINT)(a)=x #define __LSHL(x, n, t) ((t)((U_##t)(x)<<(n))) #define __LSHR(x, n, t) ((t)((U_##t)(x)>>(n))) @@ -161,7 +162,7 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) #define __BIT(x, n) (*(U_LONGINT*)(x)>>(n)&1) -#define __MOVE(s, d, n) memcpy((char*)(SYSTEM_ADDRESS)(d),(char*)(SYSTEM_ADDRESS)(s),n) +#define __MOVE(s, d, n) memcpy((char*)(SYSTEM_ADRINT)(d),(char*)(SYSTEM_ADRINT)(s),n) #define __ASHF(x, n) SYSTEM_ASH((LONGINT)(x), (LONGINT)(n)) #define __SHORT(x, y) ((int)((U_LONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) #define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) @@ -222,7 +223,7 @@ extern void Heap_INCREF(); extern void Platform_Init(INTEGER argc, LONGINT argv); extern void Heap_FINALL(); -#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (LONGINT)(SYSTEM_ADDRESS)&argv); +#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (LONGINT)(SYSTEM_ADRINT)&argv); #define __REGMAIN(name, enum) m = Heap_REGMOD((CHAR*)name,enum) #define __FINI Heap_FINALL(); return 0 @@ -243,7 +244,7 @@ extern SYSTEM_PTR Heap_NEWREC (LONGINT tag); extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __SYSNEW(p, len) p = Heap_NEWBLK((LONGINT)(len)) -#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(SYSTEM_ADDRESS)t##__typ) +#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(SYSTEM_ADRINT)t##__typ) #define __NEWARR SYSTEM_NEWARR @@ -274,20 +275,20 @@ extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __INITYP(t, t0, level) \ t##__typ = (LONGINT*)&t##__desc.blksz; \ memcpy(t##__desc.basep, t0##__typ - __BASEOFF, level*sizeof(LONGINT)); \ - t##__desc.basep[level] = (LONGINT)(SYSTEM_ADDRESS)t##__typ; \ - t##__desc.module = (LONGINT)(SYSTEM_ADDRESS)m; \ + t##__desc.basep[level] = (LONGINT)(SYSTEM_ADRINT)t##__typ; \ + t##__desc.module = (LONGINT)(SYSTEM_ADRINT)m; \ if(t##__desc.blksz!=sizeof(struct t)) __HALT(-15); \ t##__desc.blksz = (t##__desc.blksz+5*sizeof(LONGINT)-1)/(4*sizeof(LONGINT))*(4*sizeof(LONGINT)); \ - Heap_REGTYP(m, (LONGINT)(SYSTEM_ADDRESS)&t##__desc.next); \ + Heap_REGTYP(m, (LONGINT)(SYSTEM_ADRINT)&t##__desc.next); \ SYSTEM_INHERIT(t##__typ, t0##__typ) -#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(SYSTEM_ADDRESS)typ##__typ) -#define __TYPEOF(p) ((LONGINT*)(SYSTEM_ADDRESS)(*(((LONGINT*)(p))-1))) +#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(SYSTEM_ADRINT)typ##__typ) +#define __TYPEOF(p) ((LONGINT*)(SYSTEM_ADRINT)(*(((LONGINT*)(p))-1))) #define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) // Oberon-2 type bound procedures support -#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(SYSTEM_ADDRESS)proc -#define __SEND(typ, num, funtyp, parlist) ((funtyp)((SYSTEM_ADDRESS)*(typ-(__TPROC0OFF+num))))parlist +#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(SYSTEM_ADRINT)proc +#define __SEND(typ, num, funtyp, parlist) ((funtyp)((SYSTEM_ADRINT)*(typ-(__TPROC0OFF+num))))parlist diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index 115456ea..15aeff29 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index 96dbb01d..385096bc 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index 9ab3b430..52012a3c 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Files.h" #include "Modules.h" diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index 777a6c22..9a5617f1 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/Vishap.c b/bootstrap/unix-44/Vishap.c index 4c9e3b45..0feff79c 100644 --- a/bootstrap/unix-44/Vishap.c +++ b/bootstrap/unix-44/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkamSf */ #include "SYSTEM.h" #include "Configuration.h" #include "Heap.h" @@ -81,6 +81,7 @@ static void Vishap_PropagateElementaryTypeSizes (void) OPT_realtyp->size = OPM_RealSize; OPT_inttyp->size = OPM_IntSize; OPT_linttyp->size = OPM_LIntSize; + OPT_ainttyp->size = OPM_LIntSize; OPT_lrltyp->size = OPM_LRealSize; OPT_sinttyp->size = OPM_SIntSize; OPT_booltyp->size = OPM_BoolSize; diff --git a/bootstrap/unix-44/errors.c b/bootstrap/unix-44/errors.c index 68e433df..59b8db27 100644 --- a/bootstrap/unix-44/errors.c +++ b/bootstrap/unix-44/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/unix-44/errors.h b/bootstrap/unix-44/errors.h index 41d399ad..6ae0cd7a 100644 --- a/bootstrap/unix-44/errors.h +++ b/bootstrap/unix-44/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index 4efd107a..2ef65e7b 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index fc4f0da1..39837586 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-44/vt100.c b/bootstrap/unix-44/vt100.c index d77b0b84..e0edabd9 100644 --- a/bootstrap/unix-44/vt100.c +++ b/bootstrap/unix-44/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Strings.h" diff --git a/bootstrap/unix-44/vt100.h b/bootstrap/unix-44/vt100.h index 4af04d6e..413ae867 100644 --- a/bootstrap/unix-44/vt100.h +++ b/bootstrap/unix-44/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index 821dff97..b0d48f0a 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -13,6 +13,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/08/23] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/08/26] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index ec5e865a..38a63260 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Console.c b/bootstrap/unix-48/Console.c index f9161937..cc4cc8bd 100644 --- a/bootstrap/unix-48/Console.c +++ b/bootstrap/unix-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Platform.h" @@ -21,7 +21,7 @@ export void Console_String (CHAR *s, LONGINT s__len); void Console_Flush (void) { INTEGER error; - error = Platform_Write(((LONGINT)(1)), (LONGINT)(SYSTEM_ADDRESS)Console_line, Console_pos); + error = Platform_Write(((LONGINT)(1)), (LONGINT)(SYSTEM_ADRINT)Console_line, Console_pos); Console_pos = 0; } diff --git a/bootstrap/unix-48/Console.h b/bootstrap/unix-48/Console.h index 5fdd4e4d..2c462da9 100644 --- a/bootstrap/unix-48/Console.h +++ b/bootstrap/unix-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 5a1dd875..496a4a87 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" @@ -257,7 +257,7 @@ static void Files_Flush (Files_Buffer buf) if (buf->org != f->pos) { error = Platform_Seek(f->fd, buf->org, Platform_SeekSet); } - error = Platform_Write(f->fd, (LONGINT)(SYSTEM_ADDRESS)buf->data, buf->size); + error = Platform_Write(f->fd, (LONGINT)(SYSTEM_ADRINT)buf->data, buf->size); if (error != 0) { Files_Err((CHAR*)"error writing file", (LONGINT)19, f, error); } @@ -656,7 +656,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x } else { min = n; } - __MOVE((LONGINT)(SYSTEM_ADDRESS)buf->data + offset, (LONGINT)(SYSTEM_ADDRESS)x + xpos, min); + __MOVE((LONGINT)(SYSTEM_ADRINT)buf->data + offset, (LONGINT)(SYSTEM_ADRINT)x + xpos, min); offset += min; (*r).offset = offset; xpos += min; @@ -721,7 +721,7 @@ void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT } else { min = n; } - __MOVE((LONGINT)(SYSTEM_ADDRESS)x + xpos, (LONGINT)(SYSTEM_ADDRESS)buf->data + offset, min); + __MOVE((LONGINT)(SYSTEM_ADRINT)x + xpos, (LONGINT)(SYSTEM_ADRINT)buf->data + offset, min); offset += min; (*r).offset = offset; if (offset > buf->size) { @@ -772,15 +772,15 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT *res = 3; return; } - error = Platform_Read(fdold, (LONGINT)(SYSTEM_ADDRESS)buf, ((LONGINT)(4096)), &n); + error = Platform_Read(fdold, (LONGINT)(SYSTEM_ADRINT)buf, ((LONGINT)(4096)), &n); while (n > 0) { - error = Platform_Write(fdnew, (LONGINT)(SYSTEM_ADDRESS)buf, n); + error = Platform_Write(fdnew, (LONGINT)(SYSTEM_ADRINT)buf, n); if (error != 0) { ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); Files_Err((CHAR*)"cannot move file", (LONGINT)17, NIL, error); } - error = Platform_Read(fdold, (LONGINT)(SYSTEM_ADDRESS)buf, ((LONGINT)(4096)), &n); + error = Platform_Read(fdold, (LONGINT)(SYSTEM_ADRINT)buf, ((LONGINT)(4096)), &n); } ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); @@ -838,7 +838,7 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *de j += 1; } } else { - __MOVE((LONGINT)(SYSTEM_ADDRESS)src, (LONGINT)(SYSTEM_ADDRESS)dest, src__len); + __MOVE((LONGINT)(SYSTEM_ADRINT)src, (LONGINT)(SYSTEM_ADRINT)dest, src__len); } } @@ -1008,7 +1008,7 @@ static void Files_Finalize (SYSTEM_PTR o) { Files_File f = NIL; LONGINT res; - f = (Files_File)(SYSTEM_ADDRESS)o; + f = (Files_File)(SYSTEM_ADRINT)o; if (f->fd >= 0) { Files_CloseOSFile(f); if (f->tempFile) { diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index a4a4ea8c..bc1d11eb 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index 30ec687a..cca2fc74 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tskSfF */ #include "SYSTEM.h" struct Heap__1 { @@ -101,7 +101,7 @@ export void Heap_Unlock (void); extern void *Heap__init(); extern LONGINT Platform_MainStackFrame; extern LONGINT Platform_OSAllocate(LONGINT size); -#define Heap_FetchAddress(pointer) (LONGINT)(SYSTEM_ADDRESS)(*((void**)((SYSTEM_ADDRESS)pointer))) +#define Heap_FetchAddress(pointer) (LONGINT)(SYSTEM_ADRINT)(*((void**)((SYSTEM_ADRINT)pointer))) #define Heap_HeapModuleInit() Heap__init() #define Heap_OSAllocate(size) Platform_OSAllocate(size) #define Heap_PlatformHalt(code) Platform_Halt(code) @@ -134,7 +134,7 @@ SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) __COPY(name, m->name, ((LONGINT)(20))); m->refcnt = 0; m->enumPtrs = enumPtrs; - m->next = (Heap_Module)(SYSTEM_ADDRESS)Heap_modules; + m->next = (Heap_Module)(SYSTEM_ADRINT)Heap_modules; Heap_modules = (SYSTEM_PTR)m; _o_result = (void*)m; return _o_result; @@ -315,7 +315,7 @@ SYSTEM_PTR Heap_NEWREC (LONGINT tag) __PUT(adr + 8, 0, LONGINT); Heap_allocated += blksz; Heap_Unlock(); - _o_result = (SYSTEM_PTR)(SYSTEM_ADDRESS)(adr + 4); + _o_result = (SYSTEM_PTR)(SYSTEM_ADRINT)(adr + 4); return _o_result; } @@ -326,12 +326,12 @@ SYSTEM_PTR Heap_NEWBLK (LONGINT size) SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 31, 4), 4); - new = Heap_NEWREC((LONGINT)(SYSTEM_ADDRESS)&blksz); - tag = ((LONGINT)(SYSTEM_ADDRESS)new + blksz) - 12; + new = Heap_NEWREC((LONGINT)(SYSTEM_ADRINT)&blksz); + tag = ((LONGINT)(SYSTEM_ADRINT)new + blksz) - 12; __PUT(tag - 4, 0, LONGINT); __PUT(tag, blksz, LONGINT); __PUT(tag + 4, -4, LONGINT); - __PUT((LONGINT)(SYSTEM_ADDRESS)new - 4, tag, LONGINT); + __PUT((LONGINT)(SYSTEM_ADRINT)new - 4, tag, LONGINT); Heap_Unlock(); _o_result = new; return _o_result; @@ -360,7 +360,7 @@ static void Heap_Mark (LONGINT q) __GET(tag, offset, LONGINT); fld = q + offset; p = Heap_FetchAddress(fld); - __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADDRESS)n, SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)n, SYSTEM_PTR); } else { fld = q + offset; n = Heap_FetchAddress(fld); @@ -369,7 +369,7 @@ static void Heap_Mark (LONGINT q) if (!__ODD(tagbits)) { __PUT(n - 4, tagbits + 1, LONGINT); __PUT(q - 4, tag + 1, LONGINT); - __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADDRESS)p, SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)p, SYSTEM_PTR); p = q; q = n; tag = tagbits; @@ -384,7 +384,7 @@ static void Heap_Mark (LONGINT q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((LONGINT)(SYSTEM_ADDRESS)p); + Heap_Mark((LONGINT)(SYSTEM_ADRINT)p); } static void Heap_Scan (void) @@ -553,7 +553,7 @@ static void Heap_Finalize (void) } else { prev->next = n->next; } - (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADDRESS)n->obj); + (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); if (prev == NIL) { n = Heap_fin; } else { @@ -572,7 +572,7 @@ void Heap_FINALL (void) while (Heap_fin != NIL) { n = Heap_fin; Heap_fin = Heap_fin->next; - (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADDRESS)n->obj); + (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); } } @@ -589,9 +589,9 @@ static void Heap_MarkStack (LONGINT n, LONGINT *cand, LONGINT cand__len) } if (n == 0) { nofcand = 0; - sp = (LONGINT)(SYSTEM_ADDRESS)&frame; + sp = (LONGINT)(SYSTEM_ADRINT)&frame; stack0 = Heap_PlatformMainStackFrame(); - inc = (LONGINT)(SYSTEM_ADDRESS)&align.p - (LONGINT)(SYSTEM_ADDRESS)&align; + inc = (LONGINT)(SYSTEM_ADRINT)&align.p - (LONGINT)(SYSTEM_ADRINT)&align; if (sp > stack0) { inc = -inc; } @@ -622,7 +622,7 @@ void Heap_GC (BOOLEAN markStack) LONGINT cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); - m = (Heap_Module)(SYSTEM_ADDRESS)Heap_modules; + m = (Heap_Module)(SYSTEM_ADRINT)Heap_modules; while (m != NIL) { if (m->enumPtrs != NIL) { (*m->enumPtrs)(Heap_MarkP); @@ -699,7 +699,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (LONGINT)(SYSTEM_ADDRESS)obj; + f->obj = (LONGINT)(SYSTEM_ADRINT)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index a2cab30c..d05f688c 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index 330b7506..d76a50a2 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Heap.h" diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index ac8ac89e..78c8d49e 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index 0f614e6a..60b37750 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index d1c88266..e7a96131 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 3abccc9a..fce9997f 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "OPM.h" @@ -211,7 +211,7 @@ void OPC_Ident (OPT_Object obj) OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); } OPM_Write('_'); - } else if (obj == OPT_sysptrtyp->strobj || obj == OPT_bytetyp->strobj) { + } else if ((obj == OPT_sysptrtyp->strobj || obj == OPT_ainttyp->strobj) || obj == OPT_bytetyp->strobj) { OPM_WriteString((CHAR*)"SYSTEM_", (LONGINT)8); } OPM_WriteStringVar((void*)obj->name, ((LONGINT)(256))); diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index b7d34a07..7aea7283 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index bf683e41..88c3bd4d 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" @@ -544,15 +544,15 @@ void OPM_FPrintReal (LONGINT *fp, REAL real) { INTEGER i; LONGINT l; - __GET((LONGINT)(SYSTEM_ADDRESS)&real, l, LONGINT); + __GET((LONGINT)(SYSTEM_ADRINT)&real, l, LONGINT); OPM_FPrint(&*fp, l); } void OPM_FPrintLReal (LONGINT *fp, LONGREAL lr) { LONGINT l, h; - __GET((LONGINT)(SYSTEM_ADDRESS)&lr, l, LONGINT); - __GET((LONGINT)(SYSTEM_ADDRESS)&lr + 4, h, LONGINT); + __GET((LONGINT)(SYSTEM_ADRINT)&lr, l, LONGINT); + __GET((LONGINT)(SYSTEM_ADRINT)&lr + 4, h, LONGINT); OPM_FPrint(&*fp, l); OPM_FPrint(&*fp, h); } diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index ed914bff..3c2be746 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index 01d2144d..a0c19958 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPB.h" #include "OPM.h" diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index bf56b7d7..6c24817c 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index cacf9256..85c8b275 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index e901bcfc..313c0ac7 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index b32d0ebd..4b76312b 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" @@ -83,7 +83,7 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; -export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; export SHORTINT OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; @@ -1718,6 +1718,7 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_sinttyp); P(OPT_inttyp); P(OPT_linttyp); + P(OPT_ainttyp); P(OPT_realtyp); P(OPT_lrltyp); P(OPT_settyp); @@ -1794,6 +1795,7 @@ export void *OPT__init(void) OPT_undftyp->BaseTyp = OPT_undftyp; OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp); OPT_EnterTyp((CHAR*)"PTR", 13, OPM_PointerSize, &OPT_sysptrtyp); + OPT_EnterTyp((CHAR*)"ADRINT", 5, OPM_LIntSize, &OPT_ainttyp); OPT_EnterProc((CHAR*)"ADR", 20); OPT_EnterProc((CHAR*)"CC", 21); OPT_EnterProc((CHAR*)"LSH", 22); diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index 41b3e7ec..7187f687 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h @@ -67,7 +67,7 @@ typedef import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; -import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; import SHORTINT OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index cf646f5e..8b98e5f9 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPC.h" #include "OPM.h" @@ -284,6 +284,7 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_realtyp->strobj->linkadr = 2; OPT_inttyp->strobj->linkadr = 2; OPT_linttyp->strobj->linkadr = 2; + OPT_ainttyp->strobj->linkadr = 2; OPT_lrltyp->strobj->linkadr = 2; OPT_sinttyp->strobj->linkadr = 2; OPT_booltyp->strobj->linkadr = 2; @@ -931,7 +932,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPM_Write(')'); break; case 24: - OPM_WriteString((CHAR*)"(LONGINT)(SYSTEM_ADDRESS)", (LONGINT)26); + OPM_WriteString((CHAR*)"(LONGINT)(SYSTEM_ADRINT)", (LONGINT)25); if (l->class == 1) { OPC_CompleteIdent(l->obj); } else { @@ -947,7 +948,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPC_Ident(n->typ->strobj); OPM_Write(')'); if (__IN(n->typ->form, 0x6000) || __IN(l->typ->form, 0x6000)) { - OPM_WriteString((CHAR*)"(SYSTEM_ADDRESS)", (LONGINT)17); + OPM_WriteString((CHAR*)"(SYSTEM_ADRINT)", (LONGINT)16); } OPV_expr(l, exprPrec); } else { diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index 04828b2f..122fda4a 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 74c43788..6326549f 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef @@ -118,14 +118,14 @@ export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT #define Platform_EXDEV() EXDEV extern void Heap_InitHeap(); #define Platform_HeapInitHeap() Heap_InitHeap() -#define Platform_allocate(size) (LONGINT)(SYSTEM_ADDRESS)((void*)malloc((size_t)size)) +#define Platform_allocate(size) (LONGINT)(SYSTEM_ADRINT)((void*)malloc((size_t)size)) #define Platform_chdir(n, n__len) chdir((char*)n) #define Platform_closefile(fd) close(fd) #define Platform_err() errno #define Platform_errc(c) write(1, &c, 1) #define Platform_errstring(s, s__len) write(1, s, s__len-1) #define Platform_exit(code) exit(code) -#define Platform_free(address) free((void*)(SYSTEM_ADDRESS)address) +#define Platform_free(address) free((void*)(SYSTEM_ADRINT)address) #define Platform_fstat(fd) fstat(fd, &s) #define Platform_fsync(fd) fsync(fd) #define Platform_ftruncate(fd, l) ftruncate(fd, l) @@ -138,13 +138,13 @@ extern void Heap_InitHeap(); #define Platform_opennew(n, n__len) open((char*)n, O_CREAT | O_TRUNC | O_RDWR, 0664) #define Platform_openro(n, n__len) open((char*)n, O_RDONLY) #define Platform_openrw(n, n__len) open((char*)n, O_RDWR) -#define Platform_readfile(fd, p, l) read(fd, (void*)(SYSTEM_ADDRESS)(p), l) +#define Platform_readfile(fd, p, l) read(fd, (void*)(SYSTEM_ADRINT)(p), l) #define Platform_rename(o, o__len, n, n__len) rename((char*)o, (char*)n) #define Platform_sectotm(s) struct tm *time = localtime((time_t*)&s) #define Platform_seekcur() SEEK_CUR #define Platform_seekend() SEEK_END #define Platform_seekset() SEEK_SET -#define Platform_sethandler(s, h) SystemSetHandler(s, (SYSTEM_ADDRESS)h) +#define Platform_sethandler(s, h) SystemSetHandler(s, (SYSTEM_ADRINT)h) #define Platform_stat(n, n__len) stat((char*)n, &s) #define Platform_statdev() (LONGINT)s.st_dev #define Platform_statino() (LONGINT)s.st_ino @@ -161,7 +161,7 @@ extern void Heap_InitHeap(); #define Platform_tvsec() tv.tv_sec #define Platform_tvusec() tv.tv_usec #define Platform_unlink(n, n__len) unlink((char*)n) -#define Platform_writefile(fd, p, l) write(fd, (void*)(SYSTEM_ADDRESS)(p), l) +#define Platform_writefile(fd, p, l) write(fd, (void*)(SYSTEM_ADRINT)(p), l) BOOLEAN Platform_TooManyFiles (INTEGER e) { @@ -229,7 +229,7 @@ void Platform_Init (INTEGER argc, LONGINT argvadr) Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; Platform_ArgCount = argc; - av = (Platform_ArgVecPtr)(SYSTEM_ADDRESS)argvadr; + av = (Platform_ArgVecPtr)(SYSTEM_ADRINT)argvadr; Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; Platform_HeapInitHeap(); @@ -262,7 +262,7 @@ void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { - av = (Platform_ArgVec)(SYSTEM_ADDRESS)Platform_ArgVector; + av = (Platform_ArgVec)(SYSTEM_ADRINT)Platform_ArgVector; __COPY(*(*av)[__X(n, ((LONGINT)(1024)))], val, val__len); } } @@ -529,7 +529,7 @@ INTEGER Platform_Read (LONGINT h, LONGINT p, LONGINT l, LONGINT *n) INTEGER Platform_ReadBuf (LONGINT h, SYSTEM_BYTE *b, LONGINT b__len, LONGINT *n) { INTEGER _o_result; - *n = Platform_readfile(h, (LONGINT)(SYSTEM_ADDRESS)b, b__len); + *n = Platform_readfile(h, (LONGINT)(SYSTEM_ADRINT)b, b__len); if (*n < 0) { *n = 0; _o_result = Platform_err(); @@ -765,7 +765,7 @@ static void Platform_TestLittleEndian (void) { INTEGER i; i = 1; - __GET((LONGINT)(SYSTEM_ADDRESS)&i, Platform_LittleEndian, BOOLEAN); + __GET((LONGINT)(SYSTEM_ADRINT)&i, Platform_LittleEndian, BOOLEAN); } __TDESC(Platform_FileIdentity, 1, 0) = {__TDFLDS("FileIdentity", 12), {-4}}; diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index dd5ce434..77a9b68f 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 2323e34d..11c99924 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -58,7 +58,7 @@ INTEGER Reals_Expo (REAL x) { INTEGER _o_result; INTEGER i; - __GET((LONGINT)(SYSTEM_ADDRESS)&x + 2, i, INTEGER); + __GET((LONGINT)(SYSTEM_ADRINT)&x + 2, i, INTEGER); _o_result = __MASK(__ASHR(i, 7), -256); return _o_result; } @@ -66,17 +66,17 @@ INTEGER Reals_Expo (REAL x) void Reals_SetExpo (REAL *x, INTEGER ex) { CHAR c; - __GET((LONGINT)(SYSTEM_ADDRESS)x + 3, c, CHAR); - __PUT((LONGINT)(SYSTEM_ADDRESS)x + 3, (CHAR)(__ASHL(__ASHR((int)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); - __GET((LONGINT)(SYSTEM_ADDRESS)x + 2, c, CHAR); - __PUT((LONGINT)(SYSTEM_ADDRESS)x + 2, (CHAR)(__MASK((int)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); + __GET((LONGINT)(SYSTEM_ADRINT)x + 3, c, CHAR); + __PUT((LONGINT)(SYSTEM_ADRINT)x + 3, (CHAR)(__ASHL(__ASHR((int)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __GET((LONGINT)(SYSTEM_ADRINT)x + 2, c, CHAR); + __PUT((LONGINT)(SYSTEM_ADRINT)x + 2, (CHAR)(__MASK((int)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } INTEGER Reals_ExpoL (LONGREAL x) { INTEGER _o_result; INTEGER i; - __GET((LONGINT)(SYSTEM_ADDRESS)&x + 6, i, INTEGER); + __GET((LONGINT)(SYSTEM_ADRINT)&x + 6, i, INTEGER); _o_result = __MASK(__ASHR(i, 4), -2048); return _o_result; } diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index 7e6b534c..b0497a9c 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/SYSTEM.c b/bootstrap/unix-48/SYSTEM.c index 33511a70..1077d3ce 100644 --- a/bootstrap/unix-48/SYSTEM.c +++ b/bootstrap/unix-48/SYSTEM.c @@ -35,7 +35,7 @@ void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0) void SYSTEM_ENUMP(void *adr, LONGINT n, void (*P)()) { while (n > 0) { - P((LONGINT)(SYSTEM_ADDRESS)(*((void**)(adr)))); + P((LONGINT)(SYSTEM_ADRINT)(*((void**)(adr)))); adr = ((void**)adr) + 1; n--; } @@ -106,7 +106,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, else if (typ == (LONGINT*)POINTER__typ) { /* element type is a pointer */ x = Heap_NEWBLK(size + nofelems * sizeof(LONGINT)); - p = (LONGINT*)(SYSTEM_ADDRESS)x[-1]; + p = (LONGINT*)(SYSTEM_ADRINT)x[-1]; p[-nofelems] = *p; /* build new type desc in situ: 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nofelems - 1; n = 1; /* n =1 for skipping the size field */ while (n <= nofelems) {*p = n*sizeof(LONGINT); p++; n++;} @@ -119,7 +119,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, while (ptab[nofptrs] >= 0) {nofptrs++;} /* number of pointers per element */ nptr = nofelems * nofptrs; /* total number of pointers */ x = Heap_NEWBLK(size + nptr * sizeof(LONGINT)); - p = (LONGINT*)(SYSTEM_ADDRESS)x[- 1]; + p = (LONGINT*)(SYSTEM_ADRINT)x[- 1]; p[-nptr] = *p; /* build new type desc in situ; 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nptr - 1; n = 0; off = dataoff; while (n < nofelems) {i = 0; @@ -155,7 +155,7 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler // (Ignore other signals) } - void SystemSetHandler(int s, SYSTEM_ADDRESS h) { + void SystemSetHandler(int s, SYSTEM_ADRINT h) { if (s >= 2 && s <= 4) { int needtosetsystemhandler = handler[s-2] == 0; handler[s-2] = (SystemSignalHandler)h; @@ -194,12 +194,12 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler } } - void SystemSetInterruptHandler(SYSTEM_ADDRESS h) { + void SystemSetInterruptHandler(SYSTEM_ADRINT h) { EnsureConsoleCtrlHandler(); SystemInterruptHandler = (SystemSignalHandler)h; } - void SystemSetQuitHandler(SYSTEM_ADDRESS h) { + void SystemSetQuitHandler(SYSTEM_ADRINT h) { EnsureConsoleCtrlHandler(); SystemQuitHandler = (SystemSignalHandler)h; } diff --git a/bootstrap/unix-48/SYSTEM.h b/bootstrap/unix-48/SYSTEM.h index 6377745e..35620b9b 100644 --- a/bootstrap/unix-48/SYSTEM.h +++ b/bootstrap/unix-48/SYSTEM.h @@ -26,11 +26,12 @@ typedef unsigned char SYSTEM_CARD8; typedef unsigned int size_t; #endif -#define SYSTEM_ADDRESS size_t +#define SYSTEM_ADRINT size_t +#define SYSTEM_ADDRESS size_t // Temporarily for bootstrap #define _SIZE_T_DECLARED // For FreeBSD #define _SIZE_T_DEFINED_ // For OpenBSD -void *memcpy(void *dest, const void *source, SYSTEM_ADDRESS size); +void *memcpy(void *dest, const void *source, SYSTEM_ADRINT size); @@ -107,10 +108,10 @@ extern LONGINT SYSTEM_ENTIER (double x); // Signal handling in SYSTEM.c #ifndef _WIN32 - extern void SystemSetHandler(int s, SYSTEM_ADDRESS h); + extern void SystemSetHandler(int s, SYSTEM_ADRINT h); #else - extern void SystemSetInterruptHandler(SYSTEM_ADDRESS h); - extern void SystemSetQuitHandler (SYSTEM_ADDRESS h); + extern void SystemSetInterruptHandler(SYSTEM_ADRINT h); + extern void SystemSetQuitHandler (SYSTEM_ADRINT h); #endif @@ -133,9 +134,9 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __COPY(s, d, n) {char*_a=(void*)s,*_b=(void*)d; LONGINT _i=0,_t=n-1; \ while(_i<_t&&((_b[_i]=_a[_i])!=0)){_i++;};_b[_i]=0;} -#define __DUP(x, l, t) x=(void*)memcpy((void*)(SYSTEM_ADDRESS)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) +#define __DUP(x, l, t) x=(void*)memcpy((void*)(SYSTEM_ADRINT)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) #define __DUPARR(v, t) v=(void*)memcpy(v##__copy,v,sizeof(t)) -#define __DEL(x) Platform_OSFree((LONGINT)(SYSTEM_ADDRESS)x) +#define __DEL(x) Platform_OSFree((LONGINT)(SYSTEM_ADRINT)x) @@ -145,8 +146,8 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __VAL(t, x) (*(t*)&(x)) -#define __GET(a, x, t) x= *(t*)(SYSTEM_ADDRESS)(a) -#define __PUT(a, x, t) *(t*)(SYSTEM_ADDRESS)(a)=x +#define __GET(a, x, t) x= *(t*)(SYSTEM_ADRINT)(a) +#define __PUT(a, x, t) *(t*)(SYSTEM_ADRINT)(a)=x #define __LSHL(x, n, t) ((t)((U_##t)(x)<<(n))) #define __LSHR(x, n, t) ((t)((U_##t)(x)>>(n))) @@ -161,7 +162,7 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) #define __BIT(x, n) (*(U_LONGINT*)(x)>>(n)&1) -#define __MOVE(s, d, n) memcpy((char*)(SYSTEM_ADDRESS)(d),(char*)(SYSTEM_ADDRESS)(s),n) +#define __MOVE(s, d, n) memcpy((char*)(SYSTEM_ADRINT)(d),(char*)(SYSTEM_ADRINT)(s),n) #define __ASHF(x, n) SYSTEM_ASH((LONGINT)(x), (LONGINT)(n)) #define __SHORT(x, y) ((int)((U_LONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) #define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) @@ -222,7 +223,7 @@ extern void Heap_INCREF(); extern void Platform_Init(INTEGER argc, LONGINT argv); extern void Heap_FINALL(); -#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (LONGINT)(SYSTEM_ADDRESS)&argv); +#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (LONGINT)(SYSTEM_ADRINT)&argv); #define __REGMAIN(name, enum) m = Heap_REGMOD((CHAR*)name,enum) #define __FINI Heap_FINALL(); return 0 @@ -243,7 +244,7 @@ extern SYSTEM_PTR Heap_NEWREC (LONGINT tag); extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __SYSNEW(p, len) p = Heap_NEWBLK((LONGINT)(len)) -#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(SYSTEM_ADDRESS)t##__typ) +#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(SYSTEM_ADRINT)t##__typ) #define __NEWARR SYSTEM_NEWARR @@ -274,20 +275,20 @@ extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __INITYP(t, t0, level) \ t##__typ = (LONGINT*)&t##__desc.blksz; \ memcpy(t##__desc.basep, t0##__typ - __BASEOFF, level*sizeof(LONGINT)); \ - t##__desc.basep[level] = (LONGINT)(SYSTEM_ADDRESS)t##__typ; \ - t##__desc.module = (LONGINT)(SYSTEM_ADDRESS)m; \ + t##__desc.basep[level] = (LONGINT)(SYSTEM_ADRINT)t##__typ; \ + t##__desc.module = (LONGINT)(SYSTEM_ADRINT)m; \ if(t##__desc.blksz!=sizeof(struct t)) __HALT(-15); \ t##__desc.blksz = (t##__desc.blksz+5*sizeof(LONGINT)-1)/(4*sizeof(LONGINT))*(4*sizeof(LONGINT)); \ - Heap_REGTYP(m, (LONGINT)(SYSTEM_ADDRESS)&t##__desc.next); \ + Heap_REGTYP(m, (LONGINT)(SYSTEM_ADRINT)&t##__desc.next); \ SYSTEM_INHERIT(t##__typ, t0##__typ) -#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(SYSTEM_ADDRESS)typ##__typ) -#define __TYPEOF(p) ((LONGINT*)(SYSTEM_ADDRESS)(*(((LONGINT*)(p))-1))) +#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(SYSTEM_ADRINT)typ##__typ) +#define __TYPEOF(p) ((LONGINT*)(SYSTEM_ADRINT)(*(((LONGINT*)(p))-1))) #define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) // Oberon-2 type bound procedures support -#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(SYSTEM_ADDRESS)proc -#define __SEND(typ, num, funtyp, parlist) ((funtyp)((SYSTEM_ADDRESS)*(typ-(__TPROC0OFF+num))))parlist +#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(SYSTEM_ADRINT)proc +#define __SEND(typ, num, funtyp, parlist) ((funtyp)((SYSTEM_ADRINT)*(typ-(__TPROC0OFF+num))))parlist diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index 115456ea..15aeff29 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index 96dbb01d..385096bc 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index cfe34ca7..f7a3fdd3 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Files.h" #include "Modules.h" diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index 632b644a..d178499a 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/Vishap.c b/bootstrap/unix-48/Vishap.c index 4c9e3b45..0feff79c 100644 --- a/bootstrap/unix-48/Vishap.c +++ b/bootstrap/unix-48/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkamSf */ #include "SYSTEM.h" #include "Configuration.h" #include "Heap.h" @@ -81,6 +81,7 @@ static void Vishap_PropagateElementaryTypeSizes (void) OPT_realtyp->size = OPM_RealSize; OPT_inttyp->size = OPM_IntSize; OPT_linttyp->size = OPM_LIntSize; + OPT_ainttyp->size = OPM_LIntSize; OPT_lrltyp->size = OPM_LRealSize; OPT_sinttyp->size = OPM_SIntSize; OPT_booltyp->size = OPM_BoolSize; diff --git a/bootstrap/unix-48/errors.c b/bootstrap/unix-48/errors.c index 68e433df..59b8db27 100644 --- a/bootstrap/unix-48/errors.c +++ b/bootstrap/unix-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/unix-48/errors.h b/bootstrap/unix-48/errors.h index 41d399ad..6ae0cd7a 100644 --- a/bootstrap/unix-48/errors.h +++ b/bootstrap/unix-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index 4efd107a..2ef65e7b 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index fc4f0da1..39837586 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/vt100.c b/bootstrap/unix-48/vt100.c index d77b0b84..e0edabd9 100644 --- a/bootstrap/unix-48/vt100.c +++ b/bootstrap/unix-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Strings.h" diff --git a/bootstrap/unix-48/vt100.h b/bootstrap/unix-48/vt100.h index 4af04d6e..413ae867 100644 --- a/bootstrap/unix-48/vt100.h +++ b/bootstrap/unix-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index 47f1ffc7..8539a1e2 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -14,6 +14,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/08/23] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/08/26] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index ba0bbd99..b091f1f7 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Console.c b/bootstrap/unix-88/Console.c index b39e6cf3..6cd166ef 100644 --- a/bootstrap/unix-88/Console.c +++ b/bootstrap/unix-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Platform.h" @@ -22,7 +22,7 @@ export void Console_String (CHAR *s, LONGINT s__len); void Console_Flush (void) { INTEGER error; - error = Platform_Write(((LONGINT)(1)), (LONGINT)(SYSTEM_ADDRESS)Console_line, Console_pos); + error = Platform_Write(((LONGINT)(1)), (LONGINT)(SYSTEM_ADRINT)Console_line, Console_pos); Console_pos = 0; } diff --git a/bootstrap/unix-88/Console.h b/bootstrap/unix-88/Console.h index 4606384c..a0813c94 100644 --- a/bootstrap/unix-88/Console.h +++ b/bootstrap/unix-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 1b144711..86914f24 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -258,7 +258,7 @@ static void Files_Flush (Files_Buffer buf) if (buf->org != f->pos) { error = Platform_Seek(f->fd, buf->org, Platform_SeekSet); } - error = Platform_Write(f->fd, (LONGINT)(SYSTEM_ADDRESS)buf->data, buf->size); + error = Platform_Write(f->fd, (LONGINT)(SYSTEM_ADRINT)buf->data, buf->size); if (error != 0) { Files_Err((CHAR*)"error writing file", (LONGINT)19, f, error); } @@ -657,7 +657,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x } else { min = n; } - __MOVE((LONGINT)(SYSTEM_ADDRESS)buf->data + offset, (LONGINT)(SYSTEM_ADDRESS)x + xpos, min); + __MOVE((LONGINT)(SYSTEM_ADRINT)buf->data + offset, (LONGINT)(SYSTEM_ADRINT)x + xpos, min); offset += min; (*r).offset = offset; xpos += min; @@ -722,7 +722,7 @@ void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT } else { min = n; } - __MOVE((LONGINT)(SYSTEM_ADDRESS)x + xpos, (LONGINT)(SYSTEM_ADDRESS)buf->data + offset, min); + __MOVE((LONGINT)(SYSTEM_ADRINT)x + xpos, (LONGINT)(SYSTEM_ADRINT)buf->data + offset, min); offset += min; (*r).offset = offset; if (offset > buf->size) { @@ -773,15 +773,15 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT *res = 3; return; } - error = Platform_Read(fdold, (LONGINT)(SYSTEM_ADDRESS)buf, ((LONGINT)(4096)), &n); + error = Platform_Read(fdold, (LONGINT)(SYSTEM_ADRINT)buf, ((LONGINT)(4096)), &n); while (n > 0) { - error = Platform_Write(fdnew, (LONGINT)(SYSTEM_ADDRESS)buf, n); + error = Platform_Write(fdnew, (LONGINT)(SYSTEM_ADRINT)buf, n); if (error != 0) { ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); Files_Err((CHAR*)"cannot move file", (LONGINT)17, NIL, error); } - error = Platform_Read(fdold, (LONGINT)(SYSTEM_ADDRESS)buf, ((LONGINT)(4096)), &n); + error = Platform_Read(fdold, (LONGINT)(SYSTEM_ADRINT)buf, ((LONGINT)(4096)), &n); } ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); @@ -839,7 +839,7 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *de j += 1; } } else { - __MOVE((LONGINT)(SYSTEM_ADDRESS)src, (LONGINT)(SYSTEM_ADDRESS)dest, src__len); + __MOVE((LONGINT)(SYSTEM_ADRINT)src, (LONGINT)(SYSTEM_ADRINT)dest, src__len); } } @@ -1009,7 +1009,7 @@ static void Files_Finalize (SYSTEM_PTR o) { Files_File f = NIL; LONGINT res; - f = (Files_File)(SYSTEM_ADDRESS)o; + f = (Files_File)(SYSTEM_ADRINT)o; if (f->fd >= 0) { Files_CloseOSFile(f); if (f->tempFile) { diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 62487a35..8bcec40e 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index 9873a734..d3529141 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tskSfF */ #define LARGE #include "SYSTEM.h" @@ -102,7 +102,7 @@ export void Heap_Unlock (void); extern void *Heap__init(); extern LONGINT Platform_MainStackFrame; extern LONGINT Platform_OSAllocate(LONGINT size); -#define Heap_FetchAddress(pointer) (LONGINT)(SYSTEM_ADDRESS)(*((void**)((SYSTEM_ADDRESS)pointer))) +#define Heap_FetchAddress(pointer) (LONGINT)(SYSTEM_ADRINT)(*((void**)((SYSTEM_ADRINT)pointer))) #define Heap_HeapModuleInit() Heap__init() #define Heap_OSAllocate(size) Platform_OSAllocate(size) #define Heap_PlatformHalt(code) Platform_Halt(code) @@ -135,7 +135,7 @@ SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) __COPY(name, m->name, ((LONGINT)(20))); m->refcnt = 0; m->enumPtrs = enumPtrs; - m->next = (Heap_Module)(SYSTEM_ADDRESS)Heap_modules; + m->next = (Heap_Module)(SYSTEM_ADRINT)Heap_modules; Heap_modules = (SYSTEM_PTR)m; _o_result = (void*)m; return _o_result; @@ -316,7 +316,7 @@ SYSTEM_PTR Heap_NEWREC (LONGINT tag) __PUT(adr + 16, 0, LONGINT); Heap_allocated += blksz; Heap_Unlock(); - _o_result = (SYSTEM_PTR)(SYSTEM_ADDRESS)(adr + 8); + _o_result = (SYSTEM_PTR)(SYSTEM_ADRINT)(adr + 8); return _o_result; } @@ -327,12 +327,12 @@ SYSTEM_PTR Heap_NEWBLK (LONGINT size) SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 63, 5), 5); - new = Heap_NEWREC((LONGINT)(SYSTEM_ADDRESS)&blksz); - tag = ((LONGINT)(SYSTEM_ADDRESS)new + blksz) - 24; + new = Heap_NEWREC((LONGINT)(SYSTEM_ADRINT)&blksz); + tag = ((LONGINT)(SYSTEM_ADRINT)new + blksz) - 24; __PUT(tag - 8, 0, LONGINT); __PUT(tag, blksz, LONGINT); __PUT(tag + 8, -8, LONGINT); - __PUT((LONGINT)(SYSTEM_ADDRESS)new - 8, tag, LONGINT); + __PUT((LONGINT)(SYSTEM_ADRINT)new - 8, tag, LONGINT); Heap_Unlock(); _o_result = new; return _o_result; @@ -361,7 +361,7 @@ static void Heap_Mark (LONGINT q) __GET(tag, offset, LONGINT); fld = q + offset; p = Heap_FetchAddress(fld); - __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADDRESS)n, SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)n, SYSTEM_PTR); } else { fld = q + offset; n = Heap_FetchAddress(fld); @@ -370,7 +370,7 @@ static void Heap_Mark (LONGINT q) if (!__ODD(tagbits)) { __PUT(n - 8, tagbits + 1, LONGINT); __PUT(q - 8, tag + 1, LONGINT); - __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADDRESS)p, SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)p, SYSTEM_PTR); p = q; q = n; tag = tagbits; @@ -385,7 +385,7 @@ static void Heap_Mark (LONGINT q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((LONGINT)(SYSTEM_ADDRESS)p); + Heap_Mark((LONGINT)(SYSTEM_ADRINT)p); } static void Heap_Scan (void) @@ -554,7 +554,7 @@ static void Heap_Finalize (void) } else { prev->next = n->next; } - (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADDRESS)n->obj); + (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); if (prev == NIL) { n = Heap_fin; } else { @@ -573,7 +573,7 @@ void Heap_FINALL (void) while (Heap_fin != NIL) { n = Heap_fin; Heap_fin = Heap_fin->next; - (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADDRESS)n->obj); + (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); } } @@ -590,9 +590,9 @@ static void Heap_MarkStack (LONGINT n, LONGINT *cand, LONGINT cand__len) } if (n == 0) { nofcand = 0; - sp = (LONGINT)(SYSTEM_ADDRESS)&frame; + sp = (LONGINT)(SYSTEM_ADRINT)&frame; stack0 = Heap_PlatformMainStackFrame(); - inc = (LONGINT)(SYSTEM_ADDRESS)&align.p - (LONGINT)(SYSTEM_ADDRESS)&align; + inc = (LONGINT)(SYSTEM_ADRINT)&align.p - (LONGINT)(SYSTEM_ADRINT)&align; if (sp > stack0) { inc = -inc; } @@ -623,7 +623,7 @@ void Heap_GC (BOOLEAN markStack) LONGINT cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); - m = (Heap_Module)(SYSTEM_ADDRESS)Heap_modules; + m = (Heap_Module)(SYSTEM_ADRINT)Heap_modules; while (m != NIL) { if (m->enumPtrs != NIL) { (*m->enumPtrs)(Heap_MarkP); @@ -700,7 +700,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (LONGINT)(SYSTEM_ADDRESS)obj; + f->obj = (LONGINT)(SYSTEM_ADRINT)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index b1ff5968..7827d119 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 0c836ead..e006bde8 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index 6e6ded2e..9a0517b5 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index f4bdb1a8..cb07c606 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index af419f75..f2056569 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index bb9b75e6..7e9ddb90 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -212,7 +212,7 @@ void OPC_Ident (OPT_Object obj) OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); } OPM_Write('_'); - } else if (obj == OPT_sysptrtyp->strobj || obj == OPT_bytetyp->strobj) { + } else if ((obj == OPT_sysptrtyp->strobj || obj == OPT_ainttyp->strobj) || obj == OPT_bytetyp->strobj) { OPM_WriteString((CHAR*)"SYSTEM_", (LONGINT)8); } OPM_WriteStringVar((void*)obj->name, ((LONGINT)(256))); diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index 37a86252..aa92d405 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 50047c9e..3bc1b6d2 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -545,7 +545,7 @@ void OPM_FPrintReal (LONGINT *fp, REAL real) { INTEGER i; LONGINT l; - __GET((LONGINT)(SYSTEM_ADDRESS)&real, i, INTEGER); + __GET((LONGINT)(SYSTEM_ADRINT)&real, i, INTEGER); l = i; OPM_FPrint(&*fp, l); } diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index 1706f8f1..f11b56ba 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index be7c13b5..3a345c1f 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPB.h" diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index 0b3b1b2c..c0c9c3dd 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index cc04e014..1f9f2a46 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index 32148c49..4b760b22 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index a0d41c71..daf5051d 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" @@ -84,7 +84,7 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; -export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; export SHORTINT OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; @@ -1719,6 +1719,7 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_sinttyp); P(OPT_inttyp); P(OPT_linttyp); + P(OPT_ainttyp); P(OPT_realtyp); P(OPT_lrltyp); P(OPT_settyp); @@ -1795,6 +1796,7 @@ export void *OPT__init(void) OPT_undftyp->BaseTyp = OPT_undftyp; OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp); OPT_EnterTyp((CHAR*)"PTR", 13, OPM_PointerSize, &OPT_sysptrtyp); + OPT_EnterTyp((CHAR*)"ADRINT", 5, OPM_LIntSize, &OPT_ainttyp); OPT_EnterProc((CHAR*)"ADR", 20); OPT_EnterProc((CHAR*)"CC", 21); OPT_EnterProc((CHAR*)"LSH", 22); diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index ab2c4684..550ea673 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h @@ -68,7 +68,7 @@ typedef import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; -import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; import SHORTINT OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index ae14f629..fe8d848a 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPC.h" @@ -285,6 +285,7 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_realtyp->strobj->linkadr = 2; OPT_inttyp->strobj->linkadr = 2; OPT_linttyp->strobj->linkadr = 2; + OPT_ainttyp->strobj->linkadr = 2; OPT_lrltyp->strobj->linkadr = 2; OPT_sinttyp->strobj->linkadr = 2; OPT_booltyp->strobj->linkadr = 2; @@ -932,7 +933,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPM_Write(')'); break; case 24: - OPM_WriteString((CHAR*)"(LONGINT)(SYSTEM_ADDRESS)", (LONGINT)26); + OPM_WriteString((CHAR*)"(LONGINT)(SYSTEM_ADRINT)", (LONGINT)25); if (l->class == 1) { OPC_CompleteIdent(l->obj); } else { @@ -948,7 +949,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPC_Ident(n->typ->strobj); OPM_Write(')'); if (__IN(n->typ->form, 0x6000) || __IN(l->typ->form, 0x6000)) { - OPM_WriteString((CHAR*)"(SYSTEM_ADDRESS)", (LONGINT)17); + OPM_WriteString((CHAR*)"(SYSTEM_ADRINT)", (LONGINT)16); } OPV_expr(l, exprPrec); } else { diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index 4eba5b89..b0551679 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index c1a0ea9e..7ecd9794 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -119,14 +119,14 @@ export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT #define Platform_EXDEV() EXDEV extern void Heap_InitHeap(); #define Platform_HeapInitHeap() Heap_InitHeap() -#define Platform_allocate(size) (LONGINT)(SYSTEM_ADDRESS)((void*)malloc((size_t)size)) +#define Platform_allocate(size) (LONGINT)(SYSTEM_ADRINT)((void*)malloc((size_t)size)) #define Platform_chdir(n, n__len) chdir((char*)n) #define Platform_closefile(fd) close(fd) #define Platform_err() errno #define Platform_errc(c) write(1, &c, 1) #define Platform_errstring(s, s__len) write(1, s, s__len-1) #define Platform_exit(code) exit(code) -#define Platform_free(address) free((void*)(SYSTEM_ADDRESS)address) +#define Platform_free(address) free((void*)(SYSTEM_ADRINT)address) #define Platform_fstat(fd) fstat(fd, &s) #define Platform_fsync(fd) fsync(fd) #define Platform_ftruncate(fd, l) ftruncate(fd, l) @@ -139,13 +139,13 @@ extern void Heap_InitHeap(); #define Platform_opennew(n, n__len) open((char*)n, O_CREAT | O_TRUNC | O_RDWR, 0664) #define Platform_openro(n, n__len) open((char*)n, O_RDONLY) #define Platform_openrw(n, n__len) open((char*)n, O_RDWR) -#define Platform_readfile(fd, p, l) read(fd, (void*)(SYSTEM_ADDRESS)(p), l) +#define Platform_readfile(fd, p, l) read(fd, (void*)(SYSTEM_ADRINT)(p), l) #define Platform_rename(o, o__len, n, n__len) rename((char*)o, (char*)n) #define Platform_sectotm(s) struct tm *time = localtime((time_t*)&s) #define Platform_seekcur() SEEK_CUR #define Platform_seekend() SEEK_END #define Platform_seekset() SEEK_SET -#define Platform_sethandler(s, h) SystemSetHandler(s, (SYSTEM_ADDRESS)h) +#define Platform_sethandler(s, h) SystemSetHandler(s, (SYSTEM_ADRINT)h) #define Platform_stat(n, n__len) stat((char*)n, &s) #define Platform_statdev() (LONGINT)s.st_dev #define Platform_statino() (LONGINT)s.st_ino @@ -162,7 +162,7 @@ extern void Heap_InitHeap(); #define Platform_tvsec() tv.tv_sec #define Platform_tvusec() tv.tv_usec #define Platform_unlink(n, n__len) unlink((char*)n) -#define Platform_writefile(fd, p, l) write(fd, (void*)(SYSTEM_ADDRESS)(p), l) +#define Platform_writefile(fd, p, l) write(fd, (void*)(SYSTEM_ADRINT)(p), l) BOOLEAN Platform_TooManyFiles (INTEGER e) { @@ -230,7 +230,7 @@ void Platform_Init (INTEGER argc, LONGINT argvadr) Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; Platform_ArgCount = argc; - av = (Platform_ArgVecPtr)(SYSTEM_ADDRESS)argvadr; + av = (Platform_ArgVecPtr)(SYSTEM_ADRINT)argvadr; Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; Platform_HeapInitHeap(); @@ -263,7 +263,7 @@ void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { - av = (Platform_ArgVec)(SYSTEM_ADDRESS)Platform_ArgVector; + av = (Platform_ArgVec)(SYSTEM_ADRINT)Platform_ArgVector; __COPY(*(*av)[__X(n, ((LONGINT)(1024)))], val, val__len); } } @@ -530,7 +530,7 @@ INTEGER Platform_Read (LONGINT h, LONGINT p, LONGINT l, LONGINT *n) INTEGER Platform_ReadBuf (LONGINT h, SYSTEM_BYTE *b, LONGINT b__len, LONGINT *n) { INTEGER _o_result; - *n = Platform_readfile(h, (LONGINT)(SYSTEM_ADDRESS)b, b__len); + *n = Platform_readfile(h, (LONGINT)(SYSTEM_ADRINT)b, b__len); if (*n < 0) { *n = 0; _o_result = Platform_err(); @@ -766,7 +766,7 @@ static void Platform_TestLittleEndian (void) { INTEGER i; i = 1; - __GET((LONGINT)(SYSTEM_ADDRESS)&i, Platform_LittleEndian, BOOLEAN); + __GET((LONGINT)(SYSTEM_ADRINT)&i, Platform_LittleEndian, BOOLEAN); } __TDESC(Platform_FileIdentity, 1, 0) = {__TDFLDS("FileIdentity", 24), {-8}}; diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index 49702e6d..832aaa35 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 8b61d8cd..660cd605 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -59,7 +59,7 @@ INTEGER Reals_Expo (REAL x) { INTEGER _o_result; INTEGER i; - __GET((LONGINT)(SYSTEM_ADDRESS)&x + 2, i, INTEGER); + __GET((LONGINT)(SYSTEM_ADRINT)&x + 2, i, INTEGER); _o_result = __MASK(__ASHR(i, 7), -256); return _o_result; } @@ -67,17 +67,17 @@ INTEGER Reals_Expo (REAL x) void Reals_SetExpo (REAL *x, INTEGER ex) { CHAR c; - __GET((LONGINT)(SYSTEM_ADDRESS)x + 3, c, CHAR); - __PUT((LONGINT)(SYSTEM_ADDRESS)x + 3, (CHAR)(__ASHL(__ASHR((int)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); - __GET((LONGINT)(SYSTEM_ADDRESS)x + 2, c, CHAR); - __PUT((LONGINT)(SYSTEM_ADDRESS)x + 2, (CHAR)(__MASK((int)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); + __GET((LONGINT)(SYSTEM_ADRINT)x + 3, c, CHAR); + __PUT((LONGINT)(SYSTEM_ADRINT)x + 3, (CHAR)(__ASHL(__ASHR((int)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __GET((LONGINT)(SYSTEM_ADRINT)x + 2, c, CHAR); + __PUT((LONGINT)(SYSTEM_ADRINT)x + 2, (CHAR)(__MASK((int)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } INTEGER Reals_ExpoL (LONGREAL x) { INTEGER _o_result; INTEGER i; - __GET((LONGINT)(SYSTEM_ADDRESS)&x + 6, i, INTEGER); + __GET((LONGINT)(SYSTEM_ADRINT)&x + 6, i, INTEGER); _o_result = __MASK(__ASHR(i, 4), -2048); return _o_result; } diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index ff21c192..3102ce18 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/SYSTEM.c b/bootstrap/unix-88/SYSTEM.c index 33511a70..1077d3ce 100644 --- a/bootstrap/unix-88/SYSTEM.c +++ b/bootstrap/unix-88/SYSTEM.c @@ -35,7 +35,7 @@ void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0) void SYSTEM_ENUMP(void *adr, LONGINT n, void (*P)()) { while (n > 0) { - P((LONGINT)(SYSTEM_ADDRESS)(*((void**)(adr)))); + P((LONGINT)(SYSTEM_ADRINT)(*((void**)(adr)))); adr = ((void**)adr) + 1; n--; } @@ -106,7 +106,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, else if (typ == (LONGINT*)POINTER__typ) { /* element type is a pointer */ x = Heap_NEWBLK(size + nofelems * sizeof(LONGINT)); - p = (LONGINT*)(SYSTEM_ADDRESS)x[-1]; + p = (LONGINT*)(SYSTEM_ADRINT)x[-1]; p[-nofelems] = *p; /* build new type desc in situ: 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nofelems - 1; n = 1; /* n =1 for skipping the size field */ while (n <= nofelems) {*p = n*sizeof(LONGINT); p++; n++;} @@ -119,7 +119,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, while (ptab[nofptrs] >= 0) {nofptrs++;} /* number of pointers per element */ nptr = nofelems * nofptrs; /* total number of pointers */ x = Heap_NEWBLK(size + nptr * sizeof(LONGINT)); - p = (LONGINT*)(SYSTEM_ADDRESS)x[- 1]; + p = (LONGINT*)(SYSTEM_ADRINT)x[- 1]; p[-nptr] = *p; /* build new type desc in situ; 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nptr - 1; n = 0; off = dataoff; while (n < nofelems) {i = 0; @@ -155,7 +155,7 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler // (Ignore other signals) } - void SystemSetHandler(int s, SYSTEM_ADDRESS h) { + void SystemSetHandler(int s, SYSTEM_ADRINT h) { if (s >= 2 && s <= 4) { int needtosetsystemhandler = handler[s-2] == 0; handler[s-2] = (SystemSignalHandler)h; @@ -194,12 +194,12 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler } } - void SystemSetInterruptHandler(SYSTEM_ADDRESS h) { + void SystemSetInterruptHandler(SYSTEM_ADRINT h) { EnsureConsoleCtrlHandler(); SystemInterruptHandler = (SystemSignalHandler)h; } - void SystemSetQuitHandler(SYSTEM_ADDRESS h) { + void SystemSetQuitHandler(SYSTEM_ADRINT h) { EnsureConsoleCtrlHandler(); SystemQuitHandler = (SystemSignalHandler)h; } diff --git a/bootstrap/unix-88/SYSTEM.h b/bootstrap/unix-88/SYSTEM.h index 6377745e..35620b9b 100644 --- a/bootstrap/unix-88/SYSTEM.h +++ b/bootstrap/unix-88/SYSTEM.h @@ -26,11 +26,12 @@ typedef unsigned char SYSTEM_CARD8; typedef unsigned int size_t; #endif -#define SYSTEM_ADDRESS size_t +#define SYSTEM_ADRINT size_t +#define SYSTEM_ADDRESS size_t // Temporarily for bootstrap #define _SIZE_T_DECLARED // For FreeBSD #define _SIZE_T_DEFINED_ // For OpenBSD -void *memcpy(void *dest, const void *source, SYSTEM_ADDRESS size); +void *memcpy(void *dest, const void *source, SYSTEM_ADRINT size); @@ -107,10 +108,10 @@ extern LONGINT SYSTEM_ENTIER (double x); // Signal handling in SYSTEM.c #ifndef _WIN32 - extern void SystemSetHandler(int s, SYSTEM_ADDRESS h); + extern void SystemSetHandler(int s, SYSTEM_ADRINT h); #else - extern void SystemSetInterruptHandler(SYSTEM_ADDRESS h); - extern void SystemSetQuitHandler (SYSTEM_ADDRESS h); + extern void SystemSetInterruptHandler(SYSTEM_ADRINT h); + extern void SystemSetQuitHandler (SYSTEM_ADRINT h); #endif @@ -133,9 +134,9 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __COPY(s, d, n) {char*_a=(void*)s,*_b=(void*)d; LONGINT _i=0,_t=n-1; \ while(_i<_t&&((_b[_i]=_a[_i])!=0)){_i++;};_b[_i]=0;} -#define __DUP(x, l, t) x=(void*)memcpy((void*)(SYSTEM_ADDRESS)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) +#define __DUP(x, l, t) x=(void*)memcpy((void*)(SYSTEM_ADRINT)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) #define __DUPARR(v, t) v=(void*)memcpy(v##__copy,v,sizeof(t)) -#define __DEL(x) Platform_OSFree((LONGINT)(SYSTEM_ADDRESS)x) +#define __DEL(x) Platform_OSFree((LONGINT)(SYSTEM_ADRINT)x) @@ -145,8 +146,8 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __VAL(t, x) (*(t*)&(x)) -#define __GET(a, x, t) x= *(t*)(SYSTEM_ADDRESS)(a) -#define __PUT(a, x, t) *(t*)(SYSTEM_ADDRESS)(a)=x +#define __GET(a, x, t) x= *(t*)(SYSTEM_ADRINT)(a) +#define __PUT(a, x, t) *(t*)(SYSTEM_ADRINT)(a)=x #define __LSHL(x, n, t) ((t)((U_##t)(x)<<(n))) #define __LSHR(x, n, t) ((t)((U_##t)(x)>>(n))) @@ -161,7 +162,7 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) #define __BIT(x, n) (*(U_LONGINT*)(x)>>(n)&1) -#define __MOVE(s, d, n) memcpy((char*)(SYSTEM_ADDRESS)(d),(char*)(SYSTEM_ADDRESS)(s),n) +#define __MOVE(s, d, n) memcpy((char*)(SYSTEM_ADRINT)(d),(char*)(SYSTEM_ADRINT)(s),n) #define __ASHF(x, n) SYSTEM_ASH((LONGINT)(x), (LONGINT)(n)) #define __SHORT(x, y) ((int)((U_LONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) #define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) @@ -222,7 +223,7 @@ extern void Heap_INCREF(); extern void Platform_Init(INTEGER argc, LONGINT argv); extern void Heap_FINALL(); -#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (LONGINT)(SYSTEM_ADDRESS)&argv); +#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (LONGINT)(SYSTEM_ADRINT)&argv); #define __REGMAIN(name, enum) m = Heap_REGMOD((CHAR*)name,enum) #define __FINI Heap_FINALL(); return 0 @@ -243,7 +244,7 @@ extern SYSTEM_PTR Heap_NEWREC (LONGINT tag); extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __SYSNEW(p, len) p = Heap_NEWBLK((LONGINT)(len)) -#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(SYSTEM_ADDRESS)t##__typ) +#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(SYSTEM_ADRINT)t##__typ) #define __NEWARR SYSTEM_NEWARR @@ -274,20 +275,20 @@ extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __INITYP(t, t0, level) \ t##__typ = (LONGINT*)&t##__desc.blksz; \ memcpy(t##__desc.basep, t0##__typ - __BASEOFF, level*sizeof(LONGINT)); \ - t##__desc.basep[level] = (LONGINT)(SYSTEM_ADDRESS)t##__typ; \ - t##__desc.module = (LONGINT)(SYSTEM_ADDRESS)m; \ + t##__desc.basep[level] = (LONGINT)(SYSTEM_ADRINT)t##__typ; \ + t##__desc.module = (LONGINT)(SYSTEM_ADRINT)m; \ if(t##__desc.blksz!=sizeof(struct t)) __HALT(-15); \ t##__desc.blksz = (t##__desc.blksz+5*sizeof(LONGINT)-1)/(4*sizeof(LONGINT))*(4*sizeof(LONGINT)); \ - Heap_REGTYP(m, (LONGINT)(SYSTEM_ADDRESS)&t##__desc.next); \ + Heap_REGTYP(m, (LONGINT)(SYSTEM_ADRINT)&t##__desc.next); \ SYSTEM_INHERIT(t##__typ, t0##__typ) -#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(SYSTEM_ADDRESS)typ##__typ) -#define __TYPEOF(p) ((LONGINT*)(SYSTEM_ADDRESS)(*(((LONGINT*)(p))-1))) +#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(SYSTEM_ADRINT)typ##__typ) +#define __TYPEOF(p) ((LONGINT*)(SYSTEM_ADRINT)(*(((LONGINT*)(p))-1))) #define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) // Oberon-2 type bound procedures support -#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(SYSTEM_ADDRESS)proc -#define __SEND(typ, num, funtyp, parlist) ((funtyp)((SYSTEM_ADDRESS)*(typ-(__TPROC0OFF+num))))parlist +#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(SYSTEM_ADRINT)proc +#define __SEND(typ, num, funtyp, parlist) ((funtyp)((SYSTEM_ADRINT)*(typ-(__TPROC0OFF+num))))parlist diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index 20a14540..2df49d25 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index d64d3478..9505fe03 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index a1fb81c0..0e0b4725 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Files.h" diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index bca5665d..3086fb00 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/Vishap.c b/bootstrap/unix-88/Vishap.c index 6eda4f2c..7e1eba78 100644 --- a/bootstrap/unix-88/Vishap.c +++ b/bootstrap/unix-88/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkamSf */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -82,6 +82,7 @@ static void Vishap_PropagateElementaryTypeSizes (void) OPT_realtyp->size = OPM_RealSize; OPT_inttyp->size = OPM_IntSize; OPT_linttyp->size = OPM_LIntSize; + OPT_ainttyp->size = OPM_LIntSize; OPT_lrltyp->size = OPM_LRealSize; OPT_sinttyp->size = OPM_SIntSize; OPT_booltyp->size = OPM_BoolSize; diff --git a/bootstrap/unix-88/errors.c b/bootstrap/unix-88/errors.c index 48246ffa..8489752b 100644 --- a/bootstrap/unix-88/errors.c +++ b/bootstrap/unix-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/unix-88/errors.h b/bootstrap/unix-88/errors.h index 9081238a..a5af5a7d 100644 --- a/bootstrap/unix-88/errors.h +++ b/bootstrap/unix-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index 4005b0a6..fce52835 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index 6ac1ab91..9e5aed51 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/vt100.c b/bootstrap/unix-88/vt100.c index a9110e8a..0e0401e3 100644 --- a/bootstrap/unix-88/vt100.c +++ b/bootstrap/unix-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/unix-88/vt100.h b/bootstrap/unix-88/vt100.h index 801bc8f9..eb6374ea 100644 --- a/bootstrap/unix-88/vt100.h +++ b/bootstrap/unix-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index 821dff97..b0d48f0a 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -13,6 +13,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/08/23] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/08/26] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index ec5e865a..38a63260 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Console.c b/bootstrap/windows-48/Console.c index ebd86b8d..52a0ced0 100644 --- a/bootstrap/windows-48/Console.c +++ b/bootstrap/windows-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Platform.h" @@ -21,7 +21,7 @@ export void Console_String (CHAR *s, LONGINT s__len); void Console_Flush (void) { INTEGER error; - error = Platform_Write(Platform_StdOut, (LONGINT)(SYSTEM_ADDRESS)Console_line, Console_pos); + error = Platform_Write(Platform_StdOut, (LONGINT)(SYSTEM_ADRINT)Console_line, Console_pos); Console_pos = 0; } diff --git a/bootstrap/windows-48/Console.h b/bootstrap/windows-48/Console.h index 5fdd4e4d..2c462da9 100644 --- a/bootstrap/windows-48/Console.h +++ b/bootstrap/windows-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 1f3a8e9c..966fb2ca 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" @@ -257,7 +257,7 @@ static void Files_Flush (Files_Buffer buf) if (buf->org != f->pos) { error = Platform_Seek(f->fd, buf->org, Platform_SeekSet); } - error = Platform_Write(f->fd, (LONGINT)(SYSTEM_ADDRESS)buf->data, buf->size); + error = Platform_Write(f->fd, (LONGINT)(SYSTEM_ADRINT)buf->data, buf->size); if (error != 0) { Files_Err((CHAR*)"error writing file", (LONGINT)19, f, error); } @@ -656,7 +656,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x } else { min = n; } - __MOVE((LONGINT)(SYSTEM_ADDRESS)buf->data + offset, (LONGINT)(SYSTEM_ADDRESS)x + xpos, min); + __MOVE((LONGINT)(SYSTEM_ADRINT)buf->data + offset, (LONGINT)(SYSTEM_ADRINT)x + xpos, min); offset += min; (*r).offset = offset; xpos += min; @@ -721,7 +721,7 @@ void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT } else { min = n; } - __MOVE((LONGINT)(SYSTEM_ADDRESS)x + xpos, (LONGINT)(SYSTEM_ADDRESS)buf->data + offset, min); + __MOVE((LONGINT)(SYSTEM_ADRINT)x + xpos, (LONGINT)(SYSTEM_ADRINT)buf->data + offset, min); offset += min; (*r).offset = offset; if (offset > buf->size) { @@ -772,15 +772,15 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT *res = 3; return; } - error = Platform_Read(fdold, (LONGINT)(SYSTEM_ADDRESS)buf, ((LONGINT)(4096)), &n); + error = Platform_Read(fdold, (LONGINT)(SYSTEM_ADRINT)buf, ((LONGINT)(4096)), &n); while (n > 0) { - error = Platform_Write(fdnew, (LONGINT)(SYSTEM_ADDRESS)buf, n); + error = Platform_Write(fdnew, (LONGINT)(SYSTEM_ADRINT)buf, n); if (error != 0) { ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); Files_Err((CHAR*)"cannot move file", (LONGINT)17, NIL, error); } - error = Platform_Read(fdold, (LONGINT)(SYSTEM_ADDRESS)buf, ((LONGINT)(4096)), &n); + error = Platform_Read(fdold, (LONGINT)(SYSTEM_ADRINT)buf, ((LONGINT)(4096)), &n); } ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); @@ -838,7 +838,7 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *de j += 1; } } else { - __MOVE((LONGINT)(SYSTEM_ADDRESS)src, (LONGINT)(SYSTEM_ADDRESS)dest, src__len); + __MOVE((LONGINT)(SYSTEM_ADRINT)src, (LONGINT)(SYSTEM_ADRINT)dest, src__len); } } @@ -1008,7 +1008,7 @@ static void Files_Finalize (SYSTEM_PTR o) { Files_File f = NIL; LONGINT res; - f = (Files_File)(SYSTEM_ADDRESS)o; + f = (Files_File)(SYSTEM_ADRINT)o; if (f->fd >= 0) { Files_CloseOSFile(f); if (f->tempFile) { diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index 868f24df..7e437f34 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index 30ec687a..cca2fc74 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tskSfF */ #include "SYSTEM.h" struct Heap__1 { @@ -101,7 +101,7 @@ export void Heap_Unlock (void); extern void *Heap__init(); extern LONGINT Platform_MainStackFrame; extern LONGINT Platform_OSAllocate(LONGINT size); -#define Heap_FetchAddress(pointer) (LONGINT)(SYSTEM_ADDRESS)(*((void**)((SYSTEM_ADDRESS)pointer))) +#define Heap_FetchAddress(pointer) (LONGINT)(SYSTEM_ADRINT)(*((void**)((SYSTEM_ADRINT)pointer))) #define Heap_HeapModuleInit() Heap__init() #define Heap_OSAllocate(size) Platform_OSAllocate(size) #define Heap_PlatformHalt(code) Platform_Halt(code) @@ -134,7 +134,7 @@ SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) __COPY(name, m->name, ((LONGINT)(20))); m->refcnt = 0; m->enumPtrs = enumPtrs; - m->next = (Heap_Module)(SYSTEM_ADDRESS)Heap_modules; + m->next = (Heap_Module)(SYSTEM_ADRINT)Heap_modules; Heap_modules = (SYSTEM_PTR)m; _o_result = (void*)m; return _o_result; @@ -315,7 +315,7 @@ SYSTEM_PTR Heap_NEWREC (LONGINT tag) __PUT(adr + 8, 0, LONGINT); Heap_allocated += blksz; Heap_Unlock(); - _o_result = (SYSTEM_PTR)(SYSTEM_ADDRESS)(adr + 4); + _o_result = (SYSTEM_PTR)(SYSTEM_ADRINT)(adr + 4); return _o_result; } @@ -326,12 +326,12 @@ SYSTEM_PTR Heap_NEWBLK (LONGINT size) SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 31, 4), 4); - new = Heap_NEWREC((LONGINT)(SYSTEM_ADDRESS)&blksz); - tag = ((LONGINT)(SYSTEM_ADDRESS)new + blksz) - 12; + new = Heap_NEWREC((LONGINT)(SYSTEM_ADRINT)&blksz); + tag = ((LONGINT)(SYSTEM_ADRINT)new + blksz) - 12; __PUT(tag - 4, 0, LONGINT); __PUT(tag, blksz, LONGINT); __PUT(tag + 4, -4, LONGINT); - __PUT((LONGINT)(SYSTEM_ADDRESS)new - 4, tag, LONGINT); + __PUT((LONGINT)(SYSTEM_ADRINT)new - 4, tag, LONGINT); Heap_Unlock(); _o_result = new; return _o_result; @@ -360,7 +360,7 @@ static void Heap_Mark (LONGINT q) __GET(tag, offset, LONGINT); fld = q + offset; p = Heap_FetchAddress(fld); - __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADDRESS)n, SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)n, SYSTEM_PTR); } else { fld = q + offset; n = Heap_FetchAddress(fld); @@ -369,7 +369,7 @@ static void Heap_Mark (LONGINT q) if (!__ODD(tagbits)) { __PUT(n - 4, tagbits + 1, LONGINT); __PUT(q - 4, tag + 1, LONGINT); - __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADDRESS)p, SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)p, SYSTEM_PTR); p = q; q = n; tag = tagbits; @@ -384,7 +384,7 @@ static void Heap_Mark (LONGINT q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((LONGINT)(SYSTEM_ADDRESS)p); + Heap_Mark((LONGINT)(SYSTEM_ADRINT)p); } static void Heap_Scan (void) @@ -553,7 +553,7 @@ static void Heap_Finalize (void) } else { prev->next = n->next; } - (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADDRESS)n->obj); + (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); if (prev == NIL) { n = Heap_fin; } else { @@ -572,7 +572,7 @@ void Heap_FINALL (void) while (Heap_fin != NIL) { n = Heap_fin; Heap_fin = Heap_fin->next; - (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADDRESS)n->obj); + (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); } } @@ -589,9 +589,9 @@ static void Heap_MarkStack (LONGINT n, LONGINT *cand, LONGINT cand__len) } if (n == 0) { nofcand = 0; - sp = (LONGINT)(SYSTEM_ADDRESS)&frame; + sp = (LONGINT)(SYSTEM_ADRINT)&frame; stack0 = Heap_PlatformMainStackFrame(); - inc = (LONGINT)(SYSTEM_ADDRESS)&align.p - (LONGINT)(SYSTEM_ADDRESS)&align; + inc = (LONGINT)(SYSTEM_ADRINT)&align.p - (LONGINT)(SYSTEM_ADRINT)&align; if (sp > stack0) { inc = -inc; } @@ -622,7 +622,7 @@ void Heap_GC (BOOLEAN markStack) LONGINT cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); - m = (Heap_Module)(SYSTEM_ADDRESS)Heap_modules; + m = (Heap_Module)(SYSTEM_ADRINT)Heap_modules; while (m != NIL) { if (m->enumPtrs != NIL) { (*m->enumPtrs)(Heap_MarkP); @@ -699,7 +699,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (LONGINT)(SYSTEM_ADDRESS)obj; + f->obj = (LONGINT)(SYSTEM_ADRINT)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index a2cab30c..d05f688c 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index 330b7506..d76a50a2 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Heap.h" diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index ac8ac89e..78c8d49e 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index 0f614e6a..60b37750 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index d1c88266..e7a96131 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 3abccc9a..fce9997f 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "OPM.h" @@ -211,7 +211,7 @@ void OPC_Ident (OPT_Object obj) OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); } OPM_Write('_'); - } else if (obj == OPT_sysptrtyp->strobj || obj == OPT_bytetyp->strobj) { + } else if ((obj == OPT_sysptrtyp->strobj || obj == OPT_ainttyp->strobj) || obj == OPT_bytetyp->strobj) { OPM_WriteString((CHAR*)"SYSTEM_", (LONGINT)8); } OPM_WriteStringVar((void*)obj->name, ((LONGINT)(256))); diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index b7d34a07..7aea7283 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index bf683e41..88c3bd4d 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" @@ -544,15 +544,15 @@ void OPM_FPrintReal (LONGINT *fp, REAL real) { INTEGER i; LONGINT l; - __GET((LONGINT)(SYSTEM_ADDRESS)&real, l, LONGINT); + __GET((LONGINT)(SYSTEM_ADRINT)&real, l, LONGINT); OPM_FPrint(&*fp, l); } void OPM_FPrintLReal (LONGINT *fp, LONGREAL lr) { LONGINT l, h; - __GET((LONGINT)(SYSTEM_ADDRESS)&lr, l, LONGINT); - __GET((LONGINT)(SYSTEM_ADDRESS)&lr + 4, h, LONGINT); + __GET((LONGINT)(SYSTEM_ADRINT)&lr, l, LONGINT); + __GET((LONGINT)(SYSTEM_ADRINT)&lr + 4, h, LONGINT); OPM_FPrint(&*fp, l); OPM_FPrint(&*fp, h); } diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index ed914bff..3c2be746 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index 01d2144d..a0c19958 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPB.h" #include "OPM.h" diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index bf56b7d7..6c24817c 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index cacf9256..85c8b275 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index e901bcfc..313c0ac7 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index b32d0ebd..4b76312b 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" @@ -83,7 +83,7 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; -export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; export SHORTINT OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; @@ -1718,6 +1718,7 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_sinttyp); P(OPT_inttyp); P(OPT_linttyp); + P(OPT_ainttyp); P(OPT_realtyp); P(OPT_lrltyp); P(OPT_settyp); @@ -1794,6 +1795,7 @@ export void *OPT__init(void) OPT_undftyp->BaseTyp = OPT_undftyp; OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp); OPT_EnterTyp((CHAR*)"PTR", 13, OPM_PointerSize, &OPT_sysptrtyp); + OPT_EnterTyp((CHAR*)"ADRINT", 5, OPM_LIntSize, &OPT_ainttyp); OPT_EnterProc((CHAR*)"ADR", 20); OPT_EnterProc((CHAR*)"CC", 21); OPT_EnterProc((CHAR*)"LSH", 22); diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index 41b3e7ec..7187f687 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h @@ -67,7 +67,7 @@ typedef import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; -import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; import SHORTINT OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index cf646f5e..8b98e5f9 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPC.h" #include "OPM.h" @@ -284,6 +284,7 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_realtyp->strobj->linkadr = 2; OPT_inttyp->strobj->linkadr = 2; OPT_linttyp->strobj->linkadr = 2; + OPT_ainttyp->strobj->linkadr = 2; OPT_lrltyp->strobj->linkadr = 2; OPT_sinttyp->strobj->linkadr = 2; OPT_booltyp->strobj->linkadr = 2; @@ -931,7 +932,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPM_Write(')'); break; case 24: - OPM_WriteString((CHAR*)"(LONGINT)(SYSTEM_ADDRESS)", (LONGINT)26); + OPM_WriteString((CHAR*)"(LONGINT)(SYSTEM_ADRINT)", (LONGINT)25); if (l->class == 1) { OPC_CompleteIdent(l->obj); } else { @@ -947,7 +948,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPC_Ident(n->typ->strobj); OPM_Write(')'); if (__IN(n->typ->form, 0x6000) || __IN(l->typ->form, 0x6000)) { - OPM_WriteString((CHAR*)"(SYSTEM_ADDRESS)", (LONGINT)17); + OPM_WriteString((CHAR*)"(SYSTEM_ADRINT)", (LONGINT)16); } OPV_expr(l, exprPrec); } else { diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index 04828b2f..122fda4a 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 4e8b44c8..6204567c 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef @@ -111,9 +111,9 @@ export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT extern void Heap_InitHeap(); #define Platform_GetTickCount() (LONGINT)(SYSTEM_CARD32)GetTickCount() #define Platform_HeapInitHeap() Heap_InitHeap() -#define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((SYSTEM_ADDRESS)h) -#define Platform_SetQuitHandler(h) SystemSetQuitHandler((SYSTEM_ADDRESS)h) -#define Platform_allocate(size) (LONGINT)(SYSTEM_ADDRESS)((void*)HeapAlloc(GetProcessHeap(), 0, (size_t)size)) +#define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((SYSTEM_ADRINT)h) +#define Platform_SetQuitHandler(h) SystemSetQuitHandler((SYSTEM_ADRINT)h) +#define Platform_allocate(size) (LONGINT)(SYSTEM_ADRINT)((void*)HeapAlloc(GetProcessHeap(), 0, (size_t)size)) #define Platform_bhfiIndexHigh() (LONGINT)bhfi.nFileIndexHigh #define Platform_bhfiIndexLow() (LONGINT)bhfi.nFileIndexLow #define Platform_bhfiMtimeHigh() (LONGINT)bhfi.ftLastWriteTime.dwHighDateTime @@ -121,44 +121,44 @@ extern void Heap_InitHeap(); #define Platform_bhfiVsn() (LONGINT)bhfi.dwVolumeSerialNumber #define Platform_byHandleFileInformation() BY_HANDLE_FILE_INFORMATION bhfi #define Platform_cleanupProcess() CloseHandle(pi.hProcess); CloseHandle(pi.hThread); -#define Platform_closeHandle(h) (INTEGER)CloseHandle((HANDLE)(SYSTEM_ADDRESS)h) +#define Platform_closeHandle(h) (INTEGER)CloseHandle((HANDLE)(SYSTEM_ADRINT)h) #define Platform_createProcess(str, str__len) (INTEGER)CreateProcess(0, (char*)str, 0,0,0,0,0,0,&si,&pi) #define Platform_deleteFile(n, n__len) (INTEGER)DeleteFile((char*)n) #define Platform_err() (INTEGER)GetLastError() -#define Platform_errc(c) WriteFile((HANDLE)(SYSTEM_ADDRESS)Platform_StdOut, &c, 1, 0,0) -#define Platform_errstring(s, s__len) WriteFile((HANDLE)(SYSTEM_ADDRESS)Platform_StdOut, s, s__len-1, 0,0) +#define Platform_errc(c) WriteFile((HANDLE)(SYSTEM_ADRINT)Platform_StdOut, &c, 1, 0,0) +#define Platform_errstring(s, s__len) WriteFile((HANDLE)(SYSTEM_ADRINT)Platform_StdOut, s, s__len-1, 0,0) #define Platform_exit(code) ExitProcess((UINT)code) #define Platform_fileTimeToSysTime() SYSTEMTIME st; FileTimeToSystemTime(&ft, &st) -#define Platform_flushFileBuffers(h) (INTEGER)FlushFileBuffers((HANDLE)(SYSTEM_ADDRESS)h) -#define Platform_free(address) HeapFree(GetProcessHeap(), 0, (void*)(SYSTEM_ADDRESS)address) +#define Platform_flushFileBuffers(h) (INTEGER)FlushFileBuffers((HANDLE)(SYSTEM_ADRINT)h) +#define Platform_free(address) HeapFree(GetProcessHeap(), 0, (void*)(SYSTEM_ADRINT)address) #define Platform_ftToUli() ULARGE_INTEGER ul; ul.LowPart=ft.dwLowDateTime; ul.HighPart=ft.dwHighDateTime #define Platform_getCurrentDirectory(n, n__len) GetCurrentDirectory(n__len, (char*)n) #define Platform_getExitCodeProcess(exitcode) GetExitCodeProcess(pi.hProcess, (DWORD*)exitcode); -#define Platform_getFileInformationByHandle(h) (INTEGER)GetFileInformationByHandle((HANDLE)(SYSTEM_ADDRESS)h, &bhfi) -#define Platform_getFilePos(h, r, rc) LARGE_INTEGER liz = {0}; *rc = (INTEGER)SetFilePointerEx((HANDLE)(SYSTEM_ADDRESS)h, liz, &li, FILE_CURRENT); *r = (LONGINT)li.QuadPart -#define Platform_getFileSize(h) (INTEGER)GetFileSizeEx((HANDLE)(SYSTEM_ADDRESS)h, &li) +#define Platform_getFileInformationByHandle(h) (INTEGER)GetFileInformationByHandle((HANDLE)(SYSTEM_ADRINT)h, &bhfi) +#define Platform_getFilePos(h, r, rc) LARGE_INTEGER liz = {0}; *rc = (INTEGER)SetFilePointerEx((HANDLE)(SYSTEM_ADRINT)h, liz, &li, FILE_CURRENT); *r = (LONGINT)li.QuadPart +#define Platform_getFileSize(h) (INTEGER)GetFileSizeEx((HANDLE)(SYSTEM_ADRINT)h, &li) #define Platform_getLocalTime() SYSTEMTIME st; GetLocalTime(&st) #define Platform_getenv(name, name__len, buf, buf__len) (INTEGER)GetEnvironmentVariable((char*)name, (char*)buf, buf__len) #define Platform_getpid() (INTEGER)GetCurrentProcessId() -#define Platform_getstderrhandle() (SYSTEM_ADDRESS)GetStdHandle(STD_ERROR_HANDLE) -#define Platform_getstdinhandle() (SYSTEM_ADDRESS)GetStdHandle(STD_INPUT_HANDLE) -#define Platform_getstdouthandle() (SYSTEM_ADDRESS)GetStdHandle(STD_OUTPUT_HANDLE) +#define Platform_getstderrhandle() (SYSTEM_ADRINT)GetStdHandle(STD_ERROR_HANDLE) +#define Platform_getstdinhandle() (SYSTEM_ADRINT)GetStdHandle(STD_INPUT_HANDLE) +#define Platform_getstdouthandle() (SYSTEM_ADRINT)GetStdHandle(STD_OUTPUT_HANDLE) #define Platform_identityToFileTime(i) FILETIME ft; ft.dwHighDateTime = i.mtimehigh; ft.dwLowDateTime = i.mtimelow -#define Platform_invalidHandleValue() ((LONGINT)(SYSTEM_ADDRESS)INVALID_HANDLE_VALUE) +#define Platform_invalidHandleValue() ((LONGINT)(SYSTEM_ADRINT)INVALID_HANDLE_VALUE) #define Platform_largeInteger() LARGE_INTEGER li #define Platform_liLongint() (LONGINT)li.QuadPart #define Platform_moveFile(o, o__len, n, n__len) (INTEGER)MoveFileEx((char*)o, (char*)n, MOVEFILE_REPLACE_EXISTING) -#define Platform_opennew(n, n__len) (LONGINT)(SYSTEM_ADDRESS)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0) -#define Platform_openro(n, n__len) (LONGINT)(SYSTEM_ADDRESS)CreateFile((char*)n, GENERIC_READ , FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) -#define Platform_openrw(n, n__len) (LONGINT)(SYSTEM_ADDRESS)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) +#define Platform_opennew(n, n__len) (LONGINT)(SYSTEM_ADRINT)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0) +#define Platform_openro(n, n__len) (LONGINT)(SYSTEM_ADRINT)CreateFile((char*)n, GENERIC_READ , FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) +#define Platform_openrw(n, n__len) (LONGINT)(SYSTEM_ADRINT)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) #define Platform_processInfo() PROCESS_INFORMATION pi = {0}; -#define Platform_readfile(fd, p, l, n) (INTEGER)ReadFile ((HANDLE)(SYSTEM_ADDRESS)fd, (void*)(SYSTEM_ADDRESS)(p), (DWORD)l, (DWORD*)n, 0) +#define Platform_readfile(fd, p, l, n) (INTEGER)ReadFile ((HANDLE)(SYSTEM_ADRINT)fd, (void*)(SYSTEM_ADRINT)(p), (DWORD)l, (DWORD*)n, 0) #define Platform_seekcur() FILE_CURRENT #define Platform_seekend() FILE_END #define Platform_seekset() FILE_BEGIN #define Platform_setCurrentDirectory(n, n__len) (INTEGER)SetCurrentDirectory((char*)n) -#define Platform_setEndOfFile(h) (INTEGER)SetEndOfFile((HANDLE)(SYSTEM_ADDRESS)h) -#define Platform_setFilePointerEx(h, o, r, rc) li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((HANDLE)(SYSTEM_ADDRESS)h, li, 0, (DWORD)r) +#define Platform_setEndOfFile(h) (INTEGER)SetEndOfFile((HANDLE)(SYSTEM_ADRINT)h) +#define Platform_setFilePointerEx(h, o, r, rc) li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((HANDLE)(SYSTEM_ADRINT)h, li, 0, (DWORD)r) #define Platform_sleep(ms) Sleep((DWORD)ms) #define Platform_stToFt() FILETIME ft; SystemTimeToFileTime(&st, &ft) #define Platform_startupInfo() STARTUPINFO si = {0}; si.cb = sizeof(si); @@ -173,7 +173,7 @@ extern void Heap_InitHeap(); #define Platform_ulSec() (LONGINT)(ul.QuadPart / 1000000LL) #define Platform_uluSec() (LONGINT)(ul.QuadPart % 1000000LL) #define Platform_waitForProcess() (INTEGER)WaitForSingleObject(pi.hProcess, INFINITE) -#define Platform_writefile(fd, p, l) (INTEGER)WriteFile((HANDLE)(SYSTEM_ADDRESS)fd, (void*)(SYSTEM_ADDRESS)(p), (DWORD)l, 0,0) +#define Platform_writefile(fd, p, l) (INTEGER)WriteFile((HANDLE)(SYSTEM_ADRINT)fd, (void*)(SYSTEM_ADRINT)(p), (DWORD)l, 0,0) BOOLEAN Platform_TooManyFiles (INTEGER e) { @@ -241,7 +241,7 @@ void Platform_Init (INTEGER argc, LONGINT argvadr) Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; Platform_ArgCount = argc; - av = (Platform_ArgVecPtr)(SYSTEM_ADDRESS)argvadr; + av = (Platform_ArgVecPtr)(SYSTEM_ADRINT)argvadr; Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; Platform_HeapInitHeap(); @@ -280,7 +280,7 @@ void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { - av = (Platform_ArgVec)(SYSTEM_ADDRESS)Platform_ArgVector; + av = (Platform_ArgVec)(SYSTEM_ADRINT)Platform_ArgVector; __COPY(*(*av)[__X(n, ((LONGINT)(1024)))], val, val__len); } } @@ -559,7 +559,7 @@ INTEGER Platform_ReadBuf (LONGINT h, SYSTEM_BYTE *b, LONGINT b__len, LONGINT *n) INTEGER _o_result; INTEGER result; *n = 0; - result = Platform_readfile(h, (LONGINT)(SYSTEM_ADDRESS)b, b__len, &*n); + result = Platform_readfile(h, (LONGINT)(SYSTEM_ADRINT)b, b__len, &*n); if (result == 0) { *n = 0; _o_result = Platform_err(); @@ -795,7 +795,7 @@ static void Platform_TestLittleEndian (void) { INTEGER i; i = 1; - __GET((LONGINT)(SYSTEM_ADDRESS)&i, Platform_LittleEndian, BOOLEAN); + __GET((LONGINT)(SYSTEM_ADRINT)&i, Platform_LittleEndian, BOOLEAN); } __TDESC(Platform_FileIdentity, 1, 0) = {__TDFLDS("FileIdentity", 20), {-4}}; diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index 673b2b0b..b4e3ecf5 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h @@ -78,7 +78,7 @@ import INTEGER Platform_Write (LONGINT h, LONGINT p, LONGINT l); import BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); import void *Platform__init(void); -#define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((SYSTEM_ADDRESS)h) -#define Platform_SetQuitHandler(h) SystemSetQuitHandler((SYSTEM_ADDRESS)h) +#define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((SYSTEM_ADRINT)h) +#define Platform_SetQuitHandler(h) SystemSetQuitHandler((SYSTEM_ADRINT)h) #endif diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 2323e34d..11c99924 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -58,7 +58,7 @@ INTEGER Reals_Expo (REAL x) { INTEGER _o_result; INTEGER i; - __GET((LONGINT)(SYSTEM_ADDRESS)&x + 2, i, INTEGER); + __GET((LONGINT)(SYSTEM_ADRINT)&x + 2, i, INTEGER); _o_result = __MASK(__ASHR(i, 7), -256); return _o_result; } @@ -66,17 +66,17 @@ INTEGER Reals_Expo (REAL x) void Reals_SetExpo (REAL *x, INTEGER ex) { CHAR c; - __GET((LONGINT)(SYSTEM_ADDRESS)x + 3, c, CHAR); - __PUT((LONGINT)(SYSTEM_ADDRESS)x + 3, (CHAR)(__ASHL(__ASHR((int)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); - __GET((LONGINT)(SYSTEM_ADDRESS)x + 2, c, CHAR); - __PUT((LONGINT)(SYSTEM_ADDRESS)x + 2, (CHAR)(__MASK((int)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); + __GET((LONGINT)(SYSTEM_ADRINT)x + 3, c, CHAR); + __PUT((LONGINT)(SYSTEM_ADRINT)x + 3, (CHAR)(__ASHL(__ASHR((int)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __GET((LONGINT)(SYSTEM_ADRINT)x + 2, c, CHAR); + __PUT((LONGINT)(SYSTEM_ADRINT)x + 2, (CHAR)(__MASK((int)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } INTEGER Reals_ExpoL (LONGREAL x) { INTEGER _o_result; INTEGER i; - __GET((LONGINT)(SYSTEM_ADDRESS)&x + 6, i, INTEGER); + __GET((LONGINT)(SYSTEM_ADRINT)&x + 6, i, INTEGER); _o_result = __MASK(__ASHR(i, 4), -2048); return _o_result; } diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index 7e6b534c..b0497a9c 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/SYSTEM.c b/bootstrap/windows-48/SYSTEM.c index 33511a70..1077d3ce 100644 --- a/bootstrap/windows-48/SYSTEM.c +++ b/bootstrap/windows-48/SYSTEM.c @@ -35,7 +35,7 @@ void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0) void SYSTEM_ENUMP(void *adr, LONGINT n, void (*P)()) { while (n > 0) { - P((LONGINT)(SYSTEM_ADDRESS)(*((void**)(adr)))); + P((LONGINT)(SYSTEM_ADRINT)(*((void**)(adr)))); adr = ((void**)adr) + 1; n--; } @@ -106,7 +106,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, else if (typ == (LONGINT*)POINTER__typ) { /* element type is a pointer */ x = Heap_NEWBLK(size + nofelems * sizeof(LONGINT)); - p = (LONGINT*)(SYSTEM_ADDRESS)x[-1]; + p = (LONGINT*)(SYSTEM_ADRINT)x[-1]; p[-nofelems] = *p; /* build new type desc in situ: 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nofelems - 1; n = 1; /* n =1 for skipping the size field */ while (n <= nofelems) {*p = n*sizeof(LONGINT); p++; n++;} @@ -119,7 +119,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, while (ptab[nofptrs] >= 0) {nofptrs++;} /* number of pointers per element */ nptr = nofelems * nofptrs; /* total number of pointers */ x = Heap_NEWBLK(size + nptr * sizeof(LONGINT)); - p = (LONGINT*)(SYSTEM_ADDRESS)x[- 1]; + p = (LONGINT*)(SYSTEM_ADRINT)x[- 1]; p[-nptr] = *p; /* build new type desc in situ; 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nptr - 1; n = 0; off = dataoff; while (n < nofelems) {i = 0; @@ -155,7 +155,7 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler // (Ignore other signals) } - void SystemSetHandler(int s, SYSTEM_ADDRESS h) { + void SystemSetHandler(int s, SYSTEM_ADRINT h) { if (s >= 2 && s <= 4) { int needtosetsystemhandler = handler[s-2] == 0; handler[s-2] = (SystemSignalHandler)h; @@ -194,12 +194,12 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler } } - void SystemSetInterruptHandler(SYSTEM_ADDRESS h) { + void SystemSetInterruptHandler(SYSTEM_ADRINT h) { EnsureConsoleCtrlHandler(); SystemInterruptHandler = (SystemSignalHandler)h; } - void SystemSetQuitHandler(SYSTEM_ADDRESS h) { + void SystemSetQuitHandler(SYSTEM_ADRINT h) { EnsureConsoleCtrlHandler(); SystemQuitHandler = (SystemSignalHandler)h; } diff --git a/bootstrap/windows-48/SYSTEM.h b/bootstrap/windows-48/SYSTEM.h index 6377745e..35620b9b 100644 --- a/bootstrap/windows-48/SYSTEM.h +++ b/bootstrap/windows-48/SYSTEM.h @@ -26,11 +26,12 @@ typedef unsigned char SYSTEM_CARD8; typedef unsigned int size_t; #endif -#define SYSTEM_ADDRESS size_t +#define SYSTEM_ADRINT size_t +#define SYSTEM_ADDRESS size_t // Temporarily for bootstrap #define _SIZE_T_DECLARED // For FreeBSD #define _SIZE_T_DEFINED_ // For OpenBSD -void *memcpy(void *dest, const void *source, SYSTEM_ADDRESS size); +void *memcpy(void *dest, const void *source, SYSTEM_ADRINT size); @@ -107,10 +108,10 @@ extern LONGINT SYSTEM_ENTIER (double x); // Signal handling in SYSTEM.c #ifndef _WIN32 - extern void SystemSetHandler(int s, SYSTEM_ADDRESS h); + extern void SystemSetHandler(int s, SYSTEM_ADRINT h); #else - extern void SystemSetInterruptHandler(SYSTEM_ADDRESS h); - extern void SystemSetQuitHandler (SYSTEM_ADDRESS h); + extern void SystemSetInterruptHandler(SYSTEM_ADRINT h); + extern void SystemSetQuitHandler (SYSTEM_ADRINT h); #endif @@ -133,9 +134,9 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __COPY(s, d, n) {char*_a=(void*)s,*_b=(void*)d; LONGINT _i=0,_t=n-1; \ while(_i<_t&&((_b[_i]=_a[_i])!=0)){_i++;};_b[_i]=0;} -#define __DUP(x, l, t) x=(void*)memcpy((void*)(SYSTEM_ADDRESS)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) +#define __DUP(x, l, t) x=(void*)memcpy((void*)(SYSTEM_ADRINT)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) #define __DUPARR(v, t) v=(void*)memcpy(v##__copy,v,sizeof(t)) -#define __DEL(x) Platform_OSFree((LONGINT)(SYSTEM_ADDRESS)x) +#define __DEL(x) Platform_OSFree((LONGINT)(SYSTEM_ADRINT)x) @@ -145,8 +146,8 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __VAL(t, x) (*(t*)&(x)) -#define __GET(a, x, t) x= *(t*)(SYSTEM_ADDRESS)(a) -#define __PUT(a, x, t) *(t*)(SYSTEM_ADDRESS)(a)=x +#define __GET(a, x, t) x= *(t*)(SYSTEM_ADRINT)(a) +#define __PUT(a, x, t) *(t*)(SYSTEM_ADRINT)(a)=x #define __LSHL(x, n, t) ((t)((U_##t)(x)<<(n))) #define __LSHR(x, n, t) ((t)((U_##t)(x)>>(n))) @@ -161,7 +162,7 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) #define __BIT(x, n) (*(U_LONGINT*)(x)>>(n)&1) -#define __MOVE(s, d, n) memcpy((char*)(SYSTEM_ADDRESS)(d),(char*)(SYSTEM_ADDRESS)(s),n) +#define __MOVE(s, d, n) memcpy((char*)(SYSTEM_ADRINT)(d),(char*)(SYSTEM_ADRINT)(s),n) #define __ASHF(x, n) SYSTEM_ASH((LONGINT)(x), (LONGINT)(n)) #define __SHORT(x, y) ((int)((U_LONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) #define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) @@ -222,7 +223,7 @@ extern void Heap_INCREF(); extern void Platform_Init(INTEGER argc, LONGINT argv); extern void Heap_FINALL(); -#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (LONGINT)(SYSTEM_ADDRESS)&argv); +#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (LONGINT)(SYSTEM_ADRINT)&argv); #define __REGMAIN(name, enum) m = Heap_REGMOD((CHAR*)name,enum) #define __FINI Heap_FINALL(); return 0 @@ -243,7 +244,7 @@ extern SYSTEM_PTR Heap_NEWREC (LONGINT tag); extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __SYSNEW(p, len) p = Heap_NEWBLK((LONGINT)(len)) -#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(SYSTEM_ADDRESS)t##__typ) +#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(SYSTEM_ADRINT)t##__typ) #define __NEWARR SYSTEM_NEWARR @@ -274,20 +275,20 @@ extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __INITYP(t, t0, level) \ t##__typ = (LONGINT*)&t##__desc.blksz; \ memcpy(t##__desc.basep, t0##__typ - __BASEOFF, level*sizeof(LONGINT)); \ - t##__desc.basep[level] = (LONGINT)(SYSTEM_ADDRESS)t##__typ; \ - t##__desc.module = (LONGINT)(SYSTEM_ADDRESS)m; \ + t##__desc.basep[level] = (LONGINT)(SYSTEM_ADRINT)t##__typ; \ + t##__desc.module = (LONGINT)(SYSTEM_ADRINT)m; \ if(t##__desc.blksz!=sizeof(struct t)) __HALT(-15); \ t##__desc.blksz = (t##__desc.blksz+5*sizeof(LONGINT)-1)/(4*sizeof(LONGINT))*(4*sizeof(LONGINT)); \ - Heap_REGTYP(m, (LONGINT)(SYSTEM_ADDRESS)&t##__desc.next); \ + Heap_REGTYP(m, (LONGINT)(SYSTEM_ADRINT)&t##__desc.next); \ SYSTEM_INHERIT(t##__typ, t0##__typ) -#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(SYSTEM_ADDRESS)typ##__typ) -#define __TYPEOF(p) ((LONGINT*)(SYSTEM_ADDRESS)(*(((LONGINT*)(p))-1))) +#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(SYSTEM_ADRINT)typ##__typ) +#define __TYPEOF(p) ((LONGINT*)(SYSTEM_ADRINT)(*(((LONGINT*)(p))-1))) #define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) // Oberon-2 type bound procedures support -#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(SYSTEM_ADDRESS)proc -#define __SEND(typ, num, funtyp, parlist) ((funtyp)((SYSTEM_ADDRESS)*(typ-(__TPROC0OFF+num))))parlist +#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(SYSTEM_ADRINT)proc +#define __SEND(typ, num, funtyp, parlist) ((funtyp)((SYSTEM_ADRINT)*(typ-(__TPROC0OFF+num))))parlist diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index 115456ea..15aeff29 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index 96dbb01d..385096bc 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index cfe34ca7..f7a3fdd3 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Files.h" #include "Modules.h" diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index 632b644a..d178499a 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/Vishap.c b/bootstrap/windows-48/Vishap.c index 4c9e3b45..0feff79c 100644 --- a/bootstrap/windows-48/Vishap.c +++ b/bootstrap/windows-48/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkamSf */ #include "SYSTEM.h" #include "Configuration.h" #include "Heap.h" @@ -81,6 +81,7 @@ static void Vishap_PropagateElementaryTypeSizes (void) OPT_realtyp->size = OPM_RealSize; OPT_inttyp->size = OPM_IntSize; OPT_linttyp->size = OPM_LIntSize; + OPT_ainttyp->size = OPM_LIntSize; OPT_lrltyp->size = OPM_LRealSize; OPT_sinttyp->size = OPM_SIntSize; OPT_booltyp->size = OPM_BoolSize; diff --git a/bootstrap/windows-48/errors.c b/bootstrap/windows-48/errors.c index 68e433df..59b8db27 100644 --- a/bootstrap/windows-48/errors.c +++ b/bootstrap/windows-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/windows-48/errors.h b/bootstrap/windows-48/errors.h index 41d399ad..6ae0cd7a 100644 --- a/bootstrap/windows-48/errors.h +++ b/bootstrap/windows-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index 4efd107a..2ef65e7b 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index fc4f0da1..39837586 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/vt100.c b/bootstrap/windows-48/vt100.c index d77b0b84..e0edabd9 100644 --- a/bootstrap/windows-48/vt100.c +++ b/bootstrap/windows-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Strings.h" diff --git a/bootstrap/windows-48/vt100.h b/bootstrap/windows-48/vt100.h index 4af04d6e..413ae867 100644 --- a/bootstrap/windows-48/vt100.h +++ b/bootstrap/windows-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index 47f1ffc7..8539a1e2 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -14,6 +14,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/08/23] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/08/26] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index ba0bbd99..b091f1f7 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Console.c b/bootstrap/windows-88/Console.c index 5a9998a9..e0344732 100644 --- a/bootstrap/windows-88/Console.c +++ b/bootstrap/windows-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Platform.h" @@ -22,7 +22,7 @@ export void Console_String (CHAR *s, LONGINT s__len); void Console_Flush (void) { INTEGER error; - error = Platform_Write(Platform_StdOut, (LONGINT)(SYSTEM_ADDRESS)Console_line, Console_pos); + error = Platform_Write(Platform_StdOut, (LONGINT)(SYSTEM_ADRINT)Console_line, Console_pos); Console_pos = 0; } diff --git a/bootstrap/windows-88/Console.h b/bootstrap/windows-88/Console.h index 4606384c..a0813c94 100644 --- a/bootstrap/windows-88/Console.h +++ b/bootstrap/windows-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index c46ffdd2..db7f4cd9 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -258,7 +258,7 @@ static void Files_Flush (Files_Buffer buf) if (buf->org != f->pos) { error = Platform_Seek(f->fd, buf->org, Platform_SeekSet); } - error = Platform_Write(f->fd, (LONGINT)(SYSTEM_ADDRESS)buf->data, buf->size); + error = Platform_Write(f->fd, (LONGINT)(SYSTEM_ADRINT)buf->data, buf->size); if (error != 0) { Files_Err((CHAR*)"error writing file", (LONGINT)19, f, error); } @@ -657,7 +657,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x } else { min = n; } - __MOVE((LONGINT)(SYSTEM_ADDRESS)buf->data + offset, (LONGINT)(SYSTEM_ADDRESS)x + xpos, min); + __MOVE((LONGINT)(SYSTEM_ADRINT)buf->data + offset, (LONGINT)(SYSTEM_ADRINT)x + xpos, min); offset += min; (*r).offset = offset; xpos += min; @@ -722,7 +722,7 @@ void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT } else { min = n; } - __MOVE((LONGINT)(SYSTEM_ADDRESS)x + xpos, (LONGINT)(SYSTEM_ADDRESS)buf->data + offset, min); + __MOVE((LONGINT)(SYSTEM_ADRINT)x + xpos, (LONGINT)(SYSTEM_ADRINT)buf->data + offset, min); offset += min; (*r).offset = offset; if (offset > buf->size) { @@ -773,15 +773,15 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT *res = 3; return; } - error = Platform_Read(fdold, (LONGINT)(SYSTEM_ADDRESS)buf, ((LONGINT)(4096)), &n); + error = Platform_Read(fdold, (LONGINT)(SYSTEM_ADRINT)buf, ((LONGINT)(4096)), &n); while (n > 0) { - error = Platform_Write(fdnew, (LONGINT)(SYSTEM_ADDRESS)buf, n); + error = Platform_Write(fdnew, (LONGINT)(SYSTEM_ADRINT)buf, n); if (error != 0) { ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); Files_Err((CHAR*)"cannot move file", (LONGINT)17, NIL, error); } - error = Platform_Read(fdold, (LONGINT)(SYSTEM_ADDRESS)buf, ((LONGINT)(4096)), &n); + error = Platform_Read(fdold, (LONGINT)(SYSTEM_ADRINT)buf, ((LONGINT)(4096)), &n); } ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); @@ -839,7 +839,7 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *de j += 1; } } else { - __MOVE((LONGINT)(SYSTEM_ADDRESS)src, (LONGINT)(SYSTEM_ADDRESS)dest, src__len); + __MOVE((LONGINT)(SYSTEM_ADRINT)src, (LONGINT)(SYSTEM_ADRINT)dest, src__len); } } @@ -1009,7 +1009,7 @@ static void Files_Finalize (SYSTEM_PTR o) { Files_File f = NIL; LONGINT res; - f = (Files_File)(SYSTEM_ADDRESS)o; + f = (Files_File)(SYSTEM_ADRINT)o; if (f->fd >= 0) { Files_CloseOSFile(f); if (f->tempFile) { diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index eb946544..12178ad1 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index 9873a734..d3529141 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tskSfF */ #define LARGE #include "SYSTEM.h" @@ -102,7 +102,7 @@ export void Heap_Unlock (void); extern void *Heap__init(); extern LONGINT Platform_MainStackFrame; extern LONGINT Platform_OSAllocate(LONGINT size); -#define Heap_FetchAddress(pointer) (LONGINT)(SYSTEM_ADDRESS)(*((void**)((SYSTEM_ADDRESS)pointer))) +#define Heap_FetchAddress(pointer) (LONGINT)(SYSTEM_ADRINT)(*((void**)((SYSTEM_ADRINT)pointer))) #define Heap_HeapModuleInit() Heap__init() #define Heap_OSAllocate(size) Platform_OSAllocate(size) #define Heap_PlatformHalt(code) Platform_Halt(code) @@ -135,7 +135,7 @@ SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) __COPY(name, m->name, ((LONGINT)(20))); m->refcnt = 0; m->enumPtrs = enumPtrs; - m->next = (Heap_Module)(SYSTEM_ADDRESS)Heap_modules; + m->next = (Heap_Module)(SYSTEM_ADRINT)Heap_modules; Heap_modules = (SYSTEM_PTR)m; _o_result = (void*)m; return _o_result; @@ -316,7 +316,7 @@ SYSTEM_PTR Heap_NEWREC (LONGINT tag) __PUT(adr + 16, 0, LONGINT); Heap_allocated += blksz; Heap_Unlock(); - _o_result = (SYSTEM_PTR)(SYSTEM_ADDRESS)(adr + 8); + _o_result = (SYSTEM_PTR)(SYSTEM_ADRINT)(adr + 8); return _o_result; } @@ -327,12 +327,12 @@ SYSTEM_PTR Heap_NEWBLK (LONGINT size) SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 63, 5), 5); - new = Heap_NEWREC((LONGINT)(SYSTEM_ADDRESS)&blksz); - tag = ((LONGINT)(SYSTEM_ADDRESS)new + blksz) - 24; + new = Heap_NEWREC((LONGINT)(SYSTEM_ADRINT)&blksz); + tag = ((LONGINT)(SYSTEM_ADRINT)new + blksz) - 24; __PUT(tag - 8, 0, LONGINT); __PUT(tag, blksz, LONGINT); __PUT(tag + 8, -8, LONGINT); - __PUT((LONGINT)(SYSTEM_ADDRESS)new - 8, tag, LONGINT); + __PUT((LONGINT)(SYSTEM_ADRINT)new - 8, tag, LONGINT); Heap_Unlock(); _o_result = new; return _o_result; @@ -361,7 +361,7 @@ static void Heap_Mark (LONGINT q) __GET(tag, offset, LONGINT); fld = q + offset; p = Heap_FetchAddress(fld); - __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADDRESS)n, SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)n, SYSTEM_PTR); } else { fld = q + offset; n = Heap_FetchAddress(fld); @@ -370,7 +370,7 @@ static void Heap_Mark (LONGINT q) if (!__ODD(tagbits)) { __PUT(n - 8, tagbits + 1, LONGINT); __PUT(q - 8, tag + 1, LONGINT); - __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADDRESS)p, SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)p, SYSTEM_PTR); p = q; q = n; tag = tagbits; @@ -385,7 +385,7 @@ static void Heap_Mark (LONGINT q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((LONGINT)(SYSTEM_ADDRESS)p); + Heap_Mark((LONGINT)(SYSTEM_ADRINT)p); } static void Heap_Scan (void) @@ -554,7 +554,7 @@ static void Heap_Finalize (void) } else { prev->next = n->next; } - (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADDRESS)n->obj); + (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); if (prev == NIL) { n = Heap_fin; } else { @@ -573,7 +573,7 @@ void Heap_FINALL (void) while (Heap_fin != NIL) { n = Heap_fin; Heap_fin = Heap_fin->next; - (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADDRESS)n->obj); + (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); } } @@ -590,9 +590,9 @@ static void Heap_MarkStack (LONGINT n, LONGINT *cand, LONGINT cand__len) } if (n == 0) { nofcand = 0; - sp = (LONGINT)(SYSTEM_ADDRESS)&frame; + sp = (LONGINT)(SYSTEM_ADRINT)&frame; stack0 = Heap_PlatformMainStackFrame(); - inc = (LONGINT)(SYSTEM_ADDRESS)&align.p - (LONGINT)(SYSTEM_ADDRESS)&align; + inc = (LONGINT)(SYSTEM_ADRINT)&align.p - (LONGINT)(SYSTEM_ADRINT)&align; if (sp > stack0) { inc = -inc; } @@ -623,7 +623,7 @@ void Heap_GC (BOOLEAN markStack) LONGINT cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); - m = (Heap_Module)(SYSTEM_ADDRESS)Heap_modules; + m = (Heap_Module)(SYSTEM_ADRINT)Heap_modules; while (m != NIL) { if (m->enumPtrs != NIL) { (*m->enumPtrs)(Heap_MarkP); @@ -700,7 +700,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (LONGINT)(SYSTEM_ADDRESS)obj; + f->obj = (LONGINT)(SYSTEM_ADRINT)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index b1ff5968..7827d119 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 0c836ead..e006bde8 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index 6e6ded2e..9a0517b5 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index f4bdb1a8..cb07c606 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index af419f75..f2056569 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index bb9b75e6..7e9ddb90 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -212,7 +212,7 @@ void OPC_Ident (OPT_Object obj) OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); } OPM_Write('_'); - } else if (obj == OPT_sysptrtyp->strobj || obj == OPT_bytetyp->strobj) { + } else if ((obj == OPT_sysptrtyp->strobj || obj == OPT_ainttyp->strobj) || obj == OPT_bytetyp->strobj) { OPM_WriteString((CHAR*)"SYSTEM_", (LONGINT)8); } OPM_WriteStringVar((void*)obj->name, ((LONGINT)(256))); diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index 37a86252..aa92d405 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 50047c9e..3bc1b6d2 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -545,7 +545,7 @@ void OPM_FPrintReal (LONGINT *fp, REAL real) { INTEGER i; LONGINT l; - __GET((LONGINT)(SYSTEM_ADDRESS)&real, i, INTEGER); + __GET((LONGINT)(SYSTEM_ADRINT)&real, i, INTEGER); l = i; OPM_FPrint(&*fp, l); } diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index 1706f8f1..f11b56ba 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index be7c13b5..3a345c1f 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPB.h" diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index 0b3b1b2c..c0c9c3dd 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index cc04e014..1f9f2a46 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index 32148c49..4b760b22 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index a0d41c71..daf5051d 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" @@ -84,7 +84,7 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; -export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; export SHORTINT OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; @@ -1719,6 +1719,7 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_sinttyp); P(OPT_inttyp); P(OPT_linttyp); + P(OPT_ainttyp); P(OPT_realtyp); P(OPT_lrltyp); P(OPT_settyp); @@ -1795,6 +1796,7 @@ export void *OPT__init(void) OPT_undftyp->BaseTyp = OPT_undftyp; OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp); OPT_EnterTyp((CHAR*)"PTR", 13, OPM_PointerSize, &OPT_sysptrtyp); + OPT_EnterTyp((CHAR*)"ADRINT", 5, OPM_LIntSize, &OPT_ainttyp); OPT_EnterProc((CHAR*)"ADR", 20); OPT_EnterProc((CHAR*)"CC", 21); OPT_EnterProc((CHAR*)"LSH", 22); diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index ab2c4684..550ea673 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h @@ -68,7 +68,7 @@ typedef import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; -import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; import SHORTINT OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index ae14f629..fe8d848a 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPC.h" @@ -285,6 +285,7 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_realtyp->strobj->linkadr = 2; OPT_inttyp->strobj->linkadr = 2; OPT_linttyp->strobj->linkadr = 2; + OPT_ainttyp->strobj->linkadr = 2; OPT_lrltyp->strobj->linkadr = 2; OPT_sinttyp->strobj->linkadr = 2; OPT_booltyp->strobj->linkadr = 2; @@ -932,7 +933,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPM_Write(')'); break; case 24: - OPM_WriteString((CHAR*)"(LONGINT)(SYSTEM_ADDRESS)", (LONGINT)26); + OPM_WriteString((CHAR*)"(LONGINT)(SYSTEM_ADRINT)", (LONGINT)25); if (l->class == 1) { OPC_CompleteIdent(l->obj); } else { @@ -948,7 +949,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPC_Ident(n->typ->strobj); OPM_Write(')'); if (__IN(n->typ->form, 0x6000) || __IN(l->typ->form, 0x6000)) { - OPM_WriteString((CHAR*)"(SYSTEM_ADDRESS)", (LONGINT)17); + OPM_WriteString((CHAR*)"(SYSTEM_ADRINT)", (LONGINT)16); } OPV_expr(l, exprPrec); } else { diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index 4eba5b89..b0551679 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 4281164c..875aa4b4 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -112,9 +112,9 @@ export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT extern void Heap_InitHeap(); #define Platform_GetTickCount() (LONGINT)(SYSTEM_CARD32)GetTickCount() #define Platform_HeapInitHeap() Heap_InitHeap() -#define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((SYSTEM_ADDRESS)h) -#define Platform_SetQuitHandler(h) SystemSetQuitHandler((SYSTEM_ADDRESS)h) -#define Platform_allocate(size) (LONGINT)(SYSTEM_ADDRESS)((void*)HeapAlloc(GetProcessHeap(), 0, (size_t)size)) +#define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((SYSTEM_ADRINT)h) +#define Platform_SetQuitHandler(h) SystemSetQuitHandler((SYSTEM_ADRINT)h) +#define Platform_allocate(size) (LONGINT)(SYSTEM_ADRINT)((void*)HeapAlloc(GetProcessHeap(), 0, (size_t)size)) #define Platform_bhfiIndexHigh() (LONGINT)bhfi.nFileIndexHigh #define Platform_bhfiIndexLow() (LONGINT)bhfi.nFileIndexLow #define Platform_bhfiMtimeHigh() (LONGINT)bhfi.ftLastWriteTime.dwHighDateTime @@ -122,44 +122,44 @@ extern void Heap_InitHeap(); #define Platform_bhfiVsn() (LONGINT)bhfi.dwVolumeSerialNumber #define Platform_byHandleFileInformation() BY_HANDLE_FILE_INFORMATION bhfi #define Platform_cleanupProcess() CloseHandle(pi.hProcess); CloseHandle(pi.hThread); -#define Platform_closeHandle(h) (INTEGER)CloseHandle((HANDLE)(SYSTEM_ADDRESS)h) +#define Platform_closeHandle(h) (INTEGER)CloseHandle((HANDLE)(SYSTEM_ADRINT)h) #define Platform_createProcess(str, str__len) (INTEGER)CreateProcess(0, (char*)str, 0,0,0,0,0,0,&si,&pi) #define Platform_deleteFile(n, n__len) (INTEGER)DeleteFile((char*)n) #define Platform_err() (INTEGER)GetLastError() -#define Platform_errc(c) WriteFile((HANDLE)(SYSTEM_ADDRESS)Platform_StdOut, &c, 1, 0,0) -#define Platform_errstring(s, s__len) WriteFile((HANDLE)(SYSTEM_ADDRESS)Platform_StdOut, s, s__len-1, 0,0) +#define Platform_errc(c) WriteFile((HANDLE)(SYSTEM_ADRINT)Platform_StdOut, &c, 1, 0,0) +#define Platform_errstring(s, s__len) WriteFile((HANDLE)(SYSTEM_ADRINT)Platform_StdOut, s, s__len-1, 0,0) #define Platform_exit(code) ExitProcess((UINT)code) #define Platform_fileTimeToSysTime() SYSTEMTIME st; FileTimeToSystemTime(&ft, &st) -#define Platform_flushFileBuffers(h) (INTEGER)FlushFileBuffers((HANDLE)(SYSTEM_ADDRESS)h) -#define Platform_free(address) HeapFree(GetProcessHeap(), 0, (void*)(SYSTEM_ADDRESS)address) +#define Platform_flushFileBuffers(h) (INTEGER)FlushFileBuffers((HANDLE)(SYSTEM_ADRINT)h) +#define Platform_free(address) HeapFree(GetProcessHeap(), 0, (void*)(SYSTEM_ADRINT)address) #define Platform_ftToUli() ULARGE_INTEGER ul; ul.LowPart=ft.dwLowDateTime; ul.HighPart=ft.dwHighDateTime #define Platform_getCurrentDirectory(n, n__len) GetCurrentDirectory(n__len, (char*)n) #define Platform_getExitCodeProcess(exitcode) GetExitCodeProcess(pi.hProcess, (DWORD*)exitcode); -#define Platform_getFileInformationByHandle(h) (INTEGER)GetFileInformationByHandle((HANDLE)(SYSTEM_ADDRESS)h, &bhfi) -#define Platform_getFilePos(h, r, rc) LARGE_INTEGER liz = {0}; *rc = (INTEGER)SetFilePointerEx((HANDLE)(SYSTEM_ADDRESS)h, liz, &li, FILE_CURRENT); *r = (LONGINT)li.QuadPart -#define Platform_getFileSize(h) (INTEGER)GetFileSizeEx((HANDLE)(SYSTEM_ADDRESS)h, &li) +#define Platform_getFileInformationByHandle(h) (INTEGER)GetFileInformationByHandle((HANDLE)(SYSTEM_ADRINT)h, &bhfi) +#define Platform_getFilePos(h, r, rc) LARGE_INTEGER liz = {0}; *rc = (INTEGER)SetFilePointerEx((HANDLE)(SYSTEM_ADRINT)h, liz, &li, FILE_CURRENT); *r = (LONGINT)li.QuadPart +#define Platform_getFileSize(h) (INTEGER)GetFileSizeEx((HANDLE)(SYSTEM_ADRINT)h, &li) #define Platform_getLocalTime() SYSTEMTIME st; GetLocalTime(&st) #define Platform_getenv(name, name__len, buf, buf__len) (INTEGER)GetEnvironmentVariable((char*)name, (char*)buf, buf__len) #define Platform_getpid() (INTEGER)GetCurrentProcessId() -#define Platform_getstderrhandle() (SYSTEM_ADDRESS)GetStdHandle(STD_ERROR_HANDLE) -#define Platform_getstdinhandle() (SYSTEM_ADDRESS)GetStdHandle(STD_INPUT_HANDLE) -#define Platform_getstdouthandle() (SYSTEM_ADDRESS)GetStdHandle(STD_OUTPUT_HANDLE) +#define Platform_getstderrhandle() (SYSTEM_ADRINT)GetStdHandle(STD_ERROR_HANDLE) +#define Platform_getstdinhandle() (SYSTEM_ADRINT)GetStdHandle(STD_INPUT_HANDLE) +#define Platform_getstdouthandle() (SYSTEM_ADRINT)GetStdHandle(STD_OUTPUT_HANDLE) #define Platform_identityToFileTime(i) FILETIME ft; ft.dwHighDateTime = i.mtimehigh; ft.dwLowDateTime = i.mtimelow -#define Platform_invalidHandleValue() ((LONGINT)(SYSTEM_ADDRESS)INVALID_HANDLE_VALUE) +#define Platform_invalidHandleValue() ((LONGINT)(SYSTEM_ADRINT)INVALID_HANDLE_VALUE) #define Platform_largeInteger() LARGE_INTEGER li #define Platform_liLongint() (LONGINT)li.QuadPart #define Platform_moveFile(o, o__len, n, n__len) (INTEGER)MoveFileEx((char*)o, (char*)n, MOVEFILE_REPLACE_EXISTING) -#define Platform_opennew(n, n__len) (LONGINT)(SYSTEM_ADDRESS)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0) -#define Platform_openro(n, n__len) (LONGINT)(SYSTEM_ADDRESS)CreateFile((char*)n, GENERIC_READ , FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) -#define Platform_openrw(n, n__len) (LONGINT)(SYSTEM_ADDRESS)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) +#define Platform_opennew(n, n__len) (LONGINT)(SYSTEM_ADRINT)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0) +#define Platform_openro(n, n__len) (LONGINT)(SYSTEM_ADRINT)CreateFile((char*)n, GENERIC_READ , FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) +#define Platform_openrw(n, n__len) (LONGINT)(SYSTEM_ADRINT)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) #define Platform_processInfo() PROCESS_INFORMATION pi = {0}; -#define Platform_readfile(fd, p, l, n) (INTEGER)ReadFile ((HANDLE)(SYSTEM_ADDRESS)fd, (void*)(SYSTEM_ADDRESS)(p), (DWORD)l, (DWORD*)n, 0) +#define Platform_readfile(fd, p, l, n) (INTEGER)ReadFile ((HANDLE)(SYSTEM_ADRINT)fd, (void*)(SYSTEM_ADRINT)(p), (DWORD)l, (DWORD*)n, 0) #define Platform_seekcur() FILE_CURRENT #define Platform_seekend() FILE_END #define Platform_seekset() FILE_BEGIN #define Platform_setCurrentDirectory(n, n__len) (INTEGER)SetCurrentDirectory((char*)n) -#define Platform_setEndOfFile(h) (INTEGER)SetEndOfFile((HANDLE)(SYSTEM_ADDRESS)h) -#define Platform_setFilePointerEx(h, o, r, rc) li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((HANDLE)(SYSTEM_ADDRESS)h, li, 0, (DWORD)r) +#define Platform_setEndOfFile(h) (INTEGER)SetEndOfFile((HANDLE)(SYSTEM_ADRINT)h) +#define Platform_setFilePointerEx(h, o, r, rc) li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((HANDLE)(SYSTEM_ADRINT)h, li, 0, (DWORD)r) #define Platform_sleep(ms) Sleep((DWORD)ms) #define Platform_stToFt() FILETIME ft; SystemTimeToFileTime(&st, &ft) #define Platform_startupInfo() STARTUPINFO si = {0}; si.cb = sizeof(si); @@ -174,7 +174,7 @@ extern void Heap_InitHeap(); #define Platform_ulSec() (LONGINT)(ul.QuadPart / 1000000LL) #define Platform_uluSec() (LONGINT)(ul.QuadPart % 1000000LL) #define Platform_waitForProcess() (INTEGER)WaitForSingleObject(pi.hProcess, INFINITE) -#define Platform_writefile(fd, p, l) (INTEGER)WriteFile((HANDLE)(SYSTEM_ADDRESS)fd, (void*)(SYSTEM_ADDRESS)(p), (DWORD)l, 0,0) +#define Platform_writefile(fd, p, l) (INTEGER)WriteFile((HANDLE)(SYSTEM_ADRINT)fd, (void*)(SYSTEM_ADRINT)(p), (DWORD)l, 0,0) BOOLEAN Platform_TooManyFiles (INTEGER e) { @@ -242,7 +242,7 @@ void Platform_Init (INTEGER argc, LONGINT argvadr) Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; Platform_ArgCount = argc; - av = (Platform_ArgVecPtr)(SYSTEM_ADDRESS)argvadr; + av = (Platform_ArgVecPtr)(SYSTEM_ADRINT)argvadr; Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; Platform_HeapInitHeap(); @@ -281,7 +281,7 @@ void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { - av = (Platform_ArgVec)(SYSTEM_ADDRESS)Platform_ArgVector; + av = (Platform_ArgVec)(SYSTEM_ADRINT)Platform_ArgVector; __COPY(*(*av)[__X(n, ((LONGINT)(1024)))], val, val__len); } } @@ -560,7 +560,7 @@ INTEGER Platform_ReadBuf (LONGINT h, SYSTEM_BYTE *b, LONGINT b__len, LONGINT *n) INTEGER _o_result; INTEGER result; *n = 0; - result = Platform_readfile(h, (LONGINT)(SYSTEM_ADDRESS)b, b__len, &*n); + result = Platform_readfile(h, (LONGINT)(SYSTEM_ADRINT)b, b__len, &*n); if (result == 0) { *n = 0; _o_result = Platform_err(); @@ -796,7 +796,7 @@ static void Platform_TestLittleEndian (void) { INTEGER i; i = 1; - __GET((LONGINT)(SYSTEM_ADDRESS)&i, Platform_LittleEndian, BOOLEAN); + __GET((LONGINT)(SYSTEM_ADRINT)&i, Platform_LittleEndian, BOOLEAN); } __TDESC(Platform_FileIdentity, 1, 0) = {__TDFLDS("FileIdentity", 40), {-8}}; diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index 374b6842..1c350cbf 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h @@ -79,7 +79,7 @@ import INTEGER Platform_Write (LONGINT h, LONGINT p, LONGINT l); import BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); import void *Platform__init(void); -#define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((SYSTEM_ADDRESS)h) -#define Platform_SetQuitHandler(h) SystemSetQuitHandler((SYSTEM_ADDRESS)h) +#define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((SYSTEM_ADRINT)h) +#define Platform_SetQuitHandler(h) SystemSetQuitHandler((SYSTEM_ADRINT)h) #endif diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 8b61d8cd..660cd605 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -59,7 +59,7 @@ INTEGER Reals_Expo (REAL x) { INTEGER _o_result; INTEGER i; - __GET((LONGINT)(SYSTEM_ADDRESS)&x + 2, i, INTEGER); + __GET((LONGINT)(SYSTEM_ADRINT)&x + 2, i, INTEGER); _o_result = __MASK(__ASHR(i, 7), -256); return _o_result; } @@ -67,17 +67,17 @@ INTEGER Reals_Expo (REAL x) void Reals_SetExpo (REAL *x, INTEGER ex) { CHAR c; - __GET((LONGINT)(SYSTEM_ADDRESS)x + 3, c, CHAR); - __PUT((LONGINT)(SYSTEM_ADDRESS)x + 3, (CHAR)(__ASHL(__ASHR((int)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); - __GET((LONGINT)(SYSTEM_ADDRESS)x + 2, c, CHAR); - __PUT((LONGINT)(SYSTEM_ADDRESS)x + 2, (CHAR)(__MASK((int)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); + __GET((LONGINT)(SYSTEM_ADRINT)x + 3, c, CHAR); + __PUT((LONGINT)(SYSTEM_ADRINT)x + 3, (CHAR)(__ASHL(__ASHR((int)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __GET((LONGINT)(SYSTEM_ADRINT)x + 2, c, CHAR); + __PUT((LONGINT)(SYSTEM_ADRINT)x + 2, (CHAR)(__MASK((int)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } INTEGER Reals_ExpoL (LONGREAL x) { INTEGER _o_result; INTEGER i; - __GET((LONGINT)(SYSTEM_ADDRESS)&x + 6, i, INTEGER); + __GET((LONGINT)(SYSTEM_ADRINT)&x + 6, i, INTEGER); _o_result = __MASK(__ASHR(i, 4), -2048); return _o_result; } diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index ff21c192..3102ce18 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/SYSTEM.c b/bootstrap/windows-88/SYSTEM.c index 33511a70..1077d3ce 100644 --- a/bootstrap/windows-88/SYSTEM.c +++ b/bootstrap/windows-88/SYSTEM.c @@ -35,7 +35,7 @@ void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0) void SYSTEM_ENUMP(void *adr, LONGINT n, void (*P)()) { while (n > 0) { - P((LONGINT)(SYSTEM_ADDRESS)(*((void**)(adr)))); + P((LONGINT)(SYSTEM_ADRINT)(*((void**)(adr)))); adr = ((void**)adr) + 1; n--; } @@ -106,7 +106,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, else if (typ == (LONGINT*)POINTER__typ) { /* element type is a pointer */ x = Heap_NEWBLK(size + nofelems * sizeof(LONGINT)); - p = (LONGINT*)(SYSTEM_ADDRESS)x[-1]; + p = (LONGINT*)(SYSTEM_ADRINT)x[-1]; p[-nofelems] = *p; /* build new type desc in situ: 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nofelems - 1; n = 1; /* n =1 for skipping the size field */ while (n <= nofelems) {*p = n*sizeof(LONGINT); p++; n++;} @@ -119,7 +119,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, while (ptab[nofptrs] >= 0) {nofptrs++;} /* number of pointers per element */ nptr = nofelems * nofptrs; /* total number of pointers */ x = Heap_NEWBLK(size + nptr * sizeof(LONGINT)); - p = (LONGINT*)(SYSTEM_ADDRESS)x[- 1]; + p = (LONGINT*)(SYSTEM_ADRINT)x[- 1]; p[-nptr] = *p; /* build new type desc in situ; 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nptr - 1; n = 0; off = dataoff; while (n < nofelems) {i = 0; @@ -155,7 +155,7 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler // (Ignore other signals) } - void SystemSetHandler(int s, SYSTEM_ADDRESS h) { + void SystemSetHandler(int s, SYSTEM_ADRINT h) { if (s >= 2 && s <= 4) { int needtosetsystemhandler = handler[s-2] == 0; handler[s-2] = (SystemSignalHandler)h; @@ -194,12 +194,12 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler } } - void SystemSetInterruptHandler(SYSTEM_ADDRESS h) { + void SystemSetInterruptHandler(SYSTEM_ADRINT h) { EnsureConsoleCtrlHandler(); SystemInterruptHandler = (SystemSignalHandler)h; } - void SystemSetQuitHandler(SYSTEM_ADDRESS h) { + void SystemSetQuitHandler(SYSTEM_ADRINT h) { EnsureConsoleCtrlHandler(); SystemQuitHandler = (SystemSignalHandler)h; } diff --git a/bootstrap/windows-88/SYSTEM.h b/bootstrap/windows-88/SYSTEM.h index 6377745e..35620b9b 100644 --- a/bootstrap/windows-88/SYSTEM.h +++ b/bootstrap/windows-88/SYSTEM.h @@ -26,11 +26,12 @@ typedef unsigned char SYSTEM_CARD8; typedef unsigned int size_t; #endif -#define SYSTEM_ADDRESS size_t +#define SYSTEM_ADRINT size_t +#define SYSTEM_ADDRESS size_t // Temporarily for bootstrap #define _SIZE_T_DECLARED // For FreeBSD #define _SIZE_T_DEFINED_ // For OpenBSD -void *memcpy(void *dest, const void *source, SYSTEM_ADDRESS size); +void *memcpy(void *dest, const void *source, SYSTEM_ADRINT size); @@ -107,10 +108,10 @@ extern LONGINT SYSTEM_ENTIER (double x); // Signal handling in SYSTEM.c #ifndef _WIN32 - extern void SystemSetHandler(int s, SYSTEM_ADDRESS h); + extern void SystemSetHandler(int s, SYSTEM_ADRINT h); #else - extern void SystemSetInterruptHandler(SYSTEM_ADDRESS h); - extern void SystemSetQuitHandler (SYSTEM_ADDRESS h); + extern void SystemSetInterruptHandler(SYSTEM_ADRINT h); + extern void SystemSetQuitHandler (SYSTEM_ADRINT h); #endif @@ -133,9 +134,9 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __COPY(s, d, n) {char*_a=(void*)s,*_b=(void*)d; LONGINT _i=0,_t=n-1; \ while(_i<_t&&((_b[_i]=_a[_i])!=0)){_i++;};_b[_i]=0;} -#define __DUP(x, l, t) x=(void*)memcpy((void*)(SYSTEM_ADDRESS)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) +#define __DUP(x, l, t) x=(void*)memcpy((void*)(SYSTEM_ADRINT)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) #define __DUPARR(v, t) v=(void*)memcpy(v##__copy,v,sizeof(t)) -#define __DEL(x) Platform_OSFree((LONGINT)(SYSTEM_ADDRESS)x) +#define __DEL(x) Platform_OSFree((LONGINT)(SYSTEM_ADRINT)x) @@ -145,8 +146,8 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __VAL(t, x) (*(t*)&(x)) -#define __GET(a, x, t) x= *(t*)(SYSTEM_ADDRESS)(a) -#define __PUT(a, x, t) *(t*)(SYSTEM_ADDRESS)(a)=x +#define __GET(a, x, t) x= *(t*)(SYSTEM_ADRINT)(a) +#define __PUT(a, x, t) *(t*)(SYSTEM_ADRINT)(a)=x #define __LSHL(x, n, t) ((t)((U_##t)(x)<<(n))) #define __LSHR(x, n, t) ((t)((U_##t)(x)>>(n))) @@ -161,7 +162,7 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) #define __BIT(x, n) (*(U_LONGINT*)(x)>>(n)&1) -#define __MOVE(s, d, n) memcpy((char*)(SYSTEM_ADDRESS)(d),(char*)(SYSTEM_ADDRESS)(s),n) +#define __MOVE(s, d, n) memcpy((char*)(SYSTEM_ADRINT)(d),(char*)(SYSTEM_ADRINT)(s),n) #define __ASHF(x, n) SYSTEM_ASH((LONGINT)(x), (LONGINT)(n)) #define __SHORT(x, y) ((int)((U_LONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) #define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) @@ -222,7 +223,7 @@ extern void Heap_INCREF(); extern void Platform_Init(INTEGER argc, LONGINT argv); extern void Heap_FINALL(); -#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (LONGINT)(SYSTEM_ADDRESS)&argv); +#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (LONGINT)(SYSTEM_ADRINT)&argv); #define __REGMAIN(name, enum) m = Heap_REGMOD((CHAR*)name,enum) #define __FINI Heap_FINALL(); return 0 @@ -243,7 +244,7 @@ extern SYSTEM_PTR Heap_NEWREC (LONGINT tag); extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __SYSNEW(p, len) p = Heap_NEWBLK((LONGINT)(len)) -#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(SYSTEM_ADDRESS)t##__typ) +#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(SYSTEM_ADRINT)t##__typ) #define __NEWARR SYSTEM_NEWARR @@ -274,20 +275,20 @@ extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __INITYP(t, t0, level) \ t##__typ = (LONGINT*)&t##__desc.blksz; \ memcpy(t##__desc.basep, t0##__typ - __BASEOFF, level*sizeof(LONGINT)); \ - t##__desc.basep[level] = (LONGINT)(SYSTEM_ADDRESS)t##__typ; \ - t##__desc.module = (LONGINT)(SYSTEM_ADDRESS)m; \ + t##__desc.basep[level] = (LONGINT)(SYSTEM_ADRINT)t##__typ; \ + t##__desc.module = (LONGINT)(SYSTEM_ADRINT)m; \ if(t##__desc.blksz!=sizeof(struct t)) __HALT(-15); \ t##__desc.blksz = (t##__desc.blksz+5*sizeof(LONGINT)-1)/(4*sizeof(LONGINT))*(4*sizeof(LONGINT)); \ - Heap_REGTYP(m, (LONGINT)(SYSTEM_ADDRESS)&t##__desc.next); \ + Heap_REGTYP(m, (LONGINT)(SYSTEM_ADRINT)&t##__desc.next); \ SYSTEM_INHERIT(t##__typ, t0##__typ) -#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(SYSTEM_ADDRESS)typ##__typ) -#define __TYPEOF(p) ((LONGINT*)(SYSTEM_ADDRESS)(*(((LONGINT*)(p))-1))) +#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(SYSTEM_ADRINT)typ##__typ) +#define __TYPEOF(p) ((LONGINT*)(SYSTEM_ADRINT)(*(((LONGINT*)(p))-1))) #define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) // Oberon-2 type bound procedures support -#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(SYSTEM_ADDRESS)proc -#define __SEND(typ, num, funtyp, parlist) ((funtyp)((SYSTEM_ADDRESS)*(typ-(__TPROC0OFF+num))))parlist +#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(SYSTEM_ADRINT)proc +#define __SEND(typ, num, funtyp, parlist) ((funtyp)((SYSTEM_ADRINT)*(typ-(__TPROC0OFF+num))))parlist diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index 20a14540..2df49d25 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index d64d3478..9505fe03 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index a1fb81c0..0e0b4725 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Files.h" diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index bca5665d..3086fb00 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/Vishap.c b/bootstrap/windows-88/Vishap.c index 6eda4f2c..7e1eba78 100644 --- a/bootstrap/windows-88/Vishap.c +++ b/bootstrap/windows-88/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkamSf */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -82,6 +82,7 @@ static void Vishap_PropagateElementaryTypeSizes (void) OPT_realtyp->size = OPM_RealSize; OPT_inttyp->size = OPM_IntSize; OPT_linttyp->size = OPM_LIntSize; + OPT_ainttyp->size = OPM_LIntSize; OPT_lrltyp->size = OPM_LRealSize; OPT_sinttyp->size = OPM_SIntSize; OPT_booltyp->size = OPM_BoolSize; diff --git a/bootstrap/windows-88/errors.c b/bootstrap/windows-88/errors.c index 48246ffa..8489752b 100644 --- a/bootstrap/windows-88/errors.c +++ b/bootstrap/windows-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/windows-88/errors.h b/bootstrap/windows-88/errors.h index 9081238a..a5af5a7d 100644 --- a/bootstrap/windows-88/errors.h +++ b/bootstrap/windows-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index 4005b0a6..fce52835 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index 6ac1ab91..9e5aed51 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/vt100.c b/bootstrap/windows-88/vt100.c index a9110e8a..0e0401e3 100644 --- a/bootstrap/windows-88/vt100.c +++ b/bootstrap/windows-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/windows-88/vt100.h b/bootstrap/windows-88/vt100.h index 801bc8f9..eb6374ea 100644 --- a/bootstrap/windows-88/vt100.h +++ b/bootstrap/windows-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/src/compiler/OPC.Mod b/src/compiler/OPC.Mod index 1076a289..849c04e9 100644 --- a/src/compiler/OPC.Mod +++ b/src/compiler/OPC.Mod @@ -127,6 +127,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) END ; OPM.Write('_') ELSIF (obj = OPT.sysptrtyp^.strobj) + OR (obj = OPT.ainttyp^.strobj) OR (obj = OPT.bytetyp^.strobj) THEN OPM.WriteString("SYSTEM_") END; diff --git a/src/compiler/OPT.Mod b/src/compiler/OPT.Mod index fb77b0ea..62a0d4b7 100644 --- a/src/compiler/OPT.Mod +++ b/src/compiler/OPT.Mod @@ -155,6 +155,7 @@ VAR undftyp*, bytetyp*, booltyp*, chartyp*, sinttyp*, inttyp*, linttyp*, + ainttyp*, realtyp*, lrltyp*, settyp*, stringtyp*, niltyp*, notyp*, sysptrtyp*: Struct; @@ -1148,6 +1149,7 @@ BEGIN topScope := NIL; OpenScope(0, NIL); OPM.errpos := 0; (*initialization of module SYSTEM*) EnterTyp("BYTE", Byte, OPM.ByteSize, bytetyp); EnterTyp("PTR", Pointer, OPM.PointerSize, sysptrtyp); + EnterTyp("ADRINT", Int, OPM.LIntSize, ainttyp); EnterProc("ADR", adrfn); EnterProc("CC", ccfn); EnterProc("LSH", lshfn); diff --git a/src/compiler/OPV.Mod b/src/compiler/OPV.Mod index 7a59c1d3..529c1aa9 100644 --- a/src/compiler/OPV.Mod +++ b/src/compiler/OPV.Mod @@ -205,6 +205,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 OPT.realtyp^.strobj^.linkadr := PredefinedType; OPT.inttyp^.strobj^.linkadr := PredefinedType; OPT.linttyp^.strobj^.linkadr := PredefinedType; + OPT.ainttyp^.strobj^.linkadr := PredefinedType; OPT.lrltyp^.strobj^.linkadr := PredefinedType; OPT.sinttyp^.strobj^.linkadr := PredefinedType; OPT.booltyp^.strobj^.linkadr := PredefinedType; @@ -555,7 +556,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 expr(l, MinPrec); OPM.Write(CloseParen) | OPT.cap: OPM.WriteString("__CAP("); expr(l, MinPrec); OPM.Write(CloseParen) | OPT.odd: OPM.WriteString("__ODD("); expr(l, MinPrec); OPM.Write(CloseParen) - | OPT.adr: OPM.WriteString("(LONGINT)(SYSTEM_ADDRESS)"); (*SYSTEM*) + | OPT.adr: OPM.WriteString("(LONGINT)(SYSTEM_ADRINT)"); (*SYSTEM*) IF l^.class = OPT.Nvarpar THEN OPC.CompleteIdent(l^.obj) ELSE IF (l^.typ^.form # OPT.String) & ~(l^.typ^.comp IN {OPT.Array, OPT.DynArr}) THEN OPM.Write("&") END ; @@ -568,7 +569,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 THEN OPM.Write(OpenParen); OPC.Ident(n^.typ^.strobj); OPM.Write(CloseParen); IF (n^.typ^.form IN {OPT.Pointer, OPT.ProcTyp}) OR (l^.typ^.form IN {OPT.Pointer, OPT.ProcTyp}) THEN - OPM.WriteString("(SYSTEM_ADDRESS)") + OPM.WriteString("(SYSTEM_ADRINT)") END; expr(l, exprPrec) ELSE diff --git a/src/compiler/Vishap.Mod b/src/compiler/Vishap.Mod index 63cc4260..216533a1 100644 --- a/src/compiler/Vishap.Mod +++ b/src/compiler/Vishap.Mod @@ -58,6 +58,7 @@ MODULE Vishap; (* J. Templ 3.2.95 *) OPT.realtyp.size := OPM.RealSize; OPT.inttyp.size := OPM.IntSize; OPT.linttyp.size := OPM.LIntSize; + OPT.ainttyp.size := OPM.LIntSize; OPT.lrltyp.size := OPM.LRealSize; OPT.sinttyp.size := OPM.SIntSize; OPT.booltyp.size := OPM.BoolSize; diff --git a/src/system/Heap.Mod b/src/system/Heap.Mod index 6395c0a7..5acbb04e 100644 --- a/src/system/Heap.Mod +++ b/src/system/Heap.Mod @@ -186,7 +186,7 @@ MODULE Heap; correctly regardless of the size of an address. Specifically on 32 bit address architectures with 64 bit LONGINT, it loads 32 bits and extends it to LONGINT rather than loading 64 bits. *) - PROCEDURE -FetchAddress(pointer: LONGINT): LONGINT "(LONGINT)(SYSTEM_ADDRESS)(*((void**)((SYSTEM_ADDRESS)pointer)))"; + PROCEDURE -FetchAddress(pointer: LONGINT): LONGINT "(LONGINT)(SYSTEM_ADRINT)(*((void**)((SYSTEM_ADRINT)pointer)))"; PROCEDURE ExtendHeap(blksz: LONGINT); VAR size, chnk, j, next: LONGINT; diff --git a/src/system/Platformunix.Mod b/src/system/Platformunix.Mod index 1c2da65d..a55e1130 100644 --- a/src/system/Platformunix.Mod +++ b/src/system/Platformunix.Mod @@ -106,10 +106,10 @@ BEGIN RETURN (e = ECONNREFUSED()) OR (e = ECONNABORTED()) (* OS memory allocaton *) -PROCEDURE -allocate(size: LONGINT): LONGINT "(LONGINT)(SYSTEM_ADDRESS)((void*)malloc((size_t)size))"; +PROCEDURE -allocate(size: LONGINT): LONGINT "(LONGINT)(SYSTEM_ADRINT)((void*)malloc((size_t)size))"; PROCEDURE OSAllocate*(size: LONGINT): LONGINT; BEGIN RETURN allocate(size) END OSAllocate; -PROCEDURE -free(address: LONGINT) "free((void*)(SYSTEM_ADDRESS)address)"; +PROCEDURE -free(address: LONGINT) "free((void*)(SYSTEM_ADRINT)address)"; PROCEDURE OSFree*(address: LONGINT); BEGIN free(address) END OSFree; @@ -189,7 +189,7 @@ END ArgPos; (* Signals and traps *) -PROCEDURE -sethandler(s: INTEGER; h: SignalHandler) "SystemSetHandler(s, (SYSTEM_ADDRESS)h)"; +PROCEDURE -sethandler(s: INTEGER; h: SignalHandler) "SystemSetHandler(s, (SYSTEM_ADRINT)h)"; PROCEDURE SetInterruptHandler*(handler: SignalHandler); BEGIN sethandler(2, handler); END SetInterruptHandler; @@ -369,7 +369,7 @@ END Size; PROCEDURE -readfile (fd: LONGINT; p: LONGINT; l: LONGINT): LONGINT -"read(fd, (void*)(SYSTEM_ADDRESS)(p), l)"; +"read(fd, (void*)(SYSTEM_ADRINT)(p), l)"; PROCEDURE Read*(h: FileHandle; p: LONGINT; l: LONGINT; VAR n: LONGINT): ErrorCode; BEGIN @@ -386,7 +386,7 @@ END ReadBuf; PROCEDURE -writefile(fd: LONGINT; p: LONGINT; l: LONGINT): LONGINT -"write(fd, (void*)(SYSTEM_ADDRESS)(p), l)"; +"write(fd, (void*)(SYSTEM_ADRINT)(p), l)"; PROCEDURE Write*(h: FileHandle; p: LONGINT; l: LONGINT): ErrorCode; VAR written: LONGINT; diff --git a/src/system/Platformwindows.Mod b/src/system/Platformwindows.Mod index a97d7da9..cfd080be 100644 --- a/src/system/Platformwindows.Mod +++ b/src/system/Platformwindows.Mod @@ -104,10 +104,10 @@ BEGIN RETURN (e = ECONNREFUSED()) OR (e = ECONNABORTED()) (* OS memory allocaton *) -PROCEDURE -allocate(size: LONGINT): LONGINT "(LONGINT)(SYSTEM_ADDRESS)((void*)HeapAlloc(GetProcessHeap(), 0, (size_t)size))"; +PROCEDURE -allocate(size: LONGINT): LONGINT "(LONGINT)(SYSTEM_ADRINT)((void*)HeapAlloc(GetProcessHeap(), 0, (size_t)size))"; PROCEDURE OSAllocate*(size: LONGINT): LONGINT; BEGIN RETURN allocate(size) END OSAllocate; -PROCEDURE -free(address: LONGINT) "HeapFree(GetProcessHeap(), 0, (void*)(SYSTEM_ADDRESS)address)"; +PROCEDURE -free(address: LONGINT) "HeapFree(GetProcessHeap(), 0, (void*)(SYSTEM_ADRINT)address)"; PROCEDURE OSFree*(address: LONGINT); BEGIN free(address) END OSFree; @@ -200,8 +200,8 @@ END ArgPos; (* Ctrl/c handling *) -PROCEDURE -SetInterruptHandler*(h: SignalHandler) "SystemSetInterruptHandler((SYSTEM_ADDRESS)h)"; -PROCEDURE -SetQuitHandler* (h: SignalHandler) "SystemSetQuitHandler((SYSTEM_ADDRESS)h)"; +PROCEDURE -SetInterruptHandler*(h: SignalHandler) "SystemSetInterruptHandler((SYSTEM_ADRINT)h)"; +PROCEDURE -SetQuitHandler* (h: SignalHandler) "SystemSetQuitHandler((SYSTEM_ADRINT)h)"; PROCEDURE SetBadInstructionHandler*(handler: SignalHandler); BEGIN (* TODO *) END SetBadInstructionHandler; @@ -293,16 +293,16 @@ PROCEDURE Error*(): ErrorCode; BEGIN RETURN err() END Error; (* File system *) -PROCEDURE -invalidHandleValue(): LONGINT "((LONGINT)(SYSTEM_ADDRESS)INVALID_HANDLE_VALUE)"; +PROCEDURE -invalidHandleValue(): LONGINT "((LONGINT)(SYSTEM_ADRINT)INVALID_HANDLE_VALUE)"; PROCEDURE -openrw (n: ARRAY OF CHAR): LONGINT -"(LONGINT)(SYSTEM_ADDRESS)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0)"; +"(LONGINT)(SYSTEM_ADRINT)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0)"; PROCEDURE -openro (n: ARRAY OF CHAR): LONGINT -"(LONGINT)(SYSTEM_ADDRESS)CreateFile((char*)n, GENERIC_READ , FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0)"; +"(LONGINT)(SYSTEM_ADRINT)CreateFile((char*)n, GENERIC_READ , FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0)"; PROCEDURE -opennew(n: ARRAY OF CHAR): LONGINT -"(LONGINT)(SYSTEM_ADDRESS)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0)"; +"(LONGINT)(SYSTEM_ADRINT)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0)"; @@ -332,7 +332,7 @@ END New; -PROCEDURE -closeHandle(h: FileHandle): INTEGER "(INTEGER)CloseHandle((HANDLE)(SYSTEM_ADDRESS)h)"; +PROCEDURE -closeHandle(h: FileHandle): INTEGER "(INTEGER)CloseHandle((HANDLE)(SYSTEM_ADRINT)h)"; PROCEDURE Close*(h: FileHandle): ErrorCode; BEGIN @@ -342,7 +342,7 @@ END Close; PROCEDURE -byHandleFileInformation "BY_HANDLE_FILE_INFORMATION bhfi"; -PROCEDURE -getFileInformationByHandle(h: FileHandle): INTEGER "(INTEGER)GetFileInformationByHandle((HANDLE)(SYSTEM_ADDRESS)h, &bhfi)"; +PROCEDURE -getFileInformationByHandle(h: FileHandle): INTEGER "(INTEGER)GetFileInformationByHandle((HANDLE)(SYSTEM_ADRINT)h, &bhfi)"; PROCEDURE -bhfiMtimeHigh(): LONGINT "(LONGINT)bhfi.ftLastWriteTime.dwHighDateTime"; PROCEDURE -bhfiMtimeLow(): LONGINT "(LONGINT)bhfi.ftLastWriteTime.dwLowDateTime"; PROCEDURE -bhfiVsn(): LONGINT "(LONGINT)bhfi.dwVolumeSerialNumber"; @@ -401,7 +401,7 @@ END MTimeAsClock; PROCEDURE -largeInteger "LARGE_INTEGER li"; PROCEDURE -liLongint(): LONGINT "(LONGINT)li.QuadPart"; -PROCEDURE -getFileSize(h: FileHandle): INTEGER "(INTEGER)GetFileSizeEx((HANDLE)(SYSTEM_ADDRESS)h, &li)"; +PROCEDURE -getFileSize(h: FileHandle): INTEGER "(INTEGER)GetFileSizeEx((HANDLE)(SYSTEM_ADRINT)h, &li)"; PROCEDURE Size*(h: FileHandle; VAR l: LONGINT): ErrorCode; BEGIN @@ -413,7 +413,7 @@ END Size; PROCEDURE -readfile (fd: LONGINT; p: LONGINT; l: LONGINT; VAR n: LONGINT): INTEGER -"(INTEGER)ReadFile ((HANDLE)(SYSTEM_ADDRESS)fd, (void*)(SYSTEM_ADDRESS)(p), (DWORD)l, (DWORD*)n, 0)"; +"(INTEGER)ReadFile ((HANDLE)(SYSTEM_ADRINT)fd, (void*)(SYSTEM_ADRINT)(p), (DWORD)l, (DWORD*)n, 0)"; PROCEDURE Read*(h: FileHandle; p: LONGINT; l: LONGINT; VAR n: LONGINT): ErrorCode; VAR result: INTEGER; @@ -434,7 +434,7 @@ END ReadBuf; PROCEDURE -writefile(fd: LONGINT; p: LONGINT; l: LONGINT): INTEGER -"(INTEGER)WriteFile((HANDLE)(SYSTEM_ADDRESS)fd, (void*)(SYSTEM_ADDRESS)(p), (DWORD)l, 0,0)"; +"(INTEGER)WriteFile((HANDLE)(SYSTEM_ADRINT)fd, (void*)(SYSTEM_ADRINT)(p), (DWORD)l, 0,0)"; PROCEDURE Write*(h: FileHandle; p: LONGINT; l: LONGINT): ErrorCode; BEGIN @@ -443,7 +443,7 @@ END Write; -PROCEDURE -flushFileBuffers(h: FileHandle): INTEGER "(INTEGER)FlushFileBuffers((HANDLE)(SYSTEM_ADDRESS)h)"; +PROCEDURE -flushFileBuffers(h: FileHandle): INTEGER "(INTEGER)FlushFileBuffers((HANDLE)(SYSTEM_ADRINT)h)"; PROCEDURE Sync*(h: FileHandle): ErrorCode; BEGIN @@ -453,7 +453,7 @@ END Sync; PROCEDURE -setFilePointerEx(h: FileHandle; o: LONGINT; r: INTEGER; VAR rc: INTEGER) -"li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((HANDLE)(SYSTEM_ADDRESS)h, li, 0, (DWORD)r)"; +"li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((HANDLE)(SYSTEM_ADRINT)h, li, 0, (DWORD)r)"; PROCEDURE -seekset(): INTEGER "FILE_BEGIN"; PROCEDURE -seekcur(): INTEGER "FILE_CURRENT"; @@ -469,9 +469,9 @@ END Seek; -PROCEDURE -setEndOfFile(h: FileHandle): INTEGER "(INTEGER)SetEndOfFile((HANDLE)(SYSTEM_ADDRESS)h)"; +PROCEDURE -setEndOfFile(h: FileHandle): INTEGER "(INTEGER)SetEndOfFile((HANDLE)(SYSTEM_ADRINT)h)"; PROCEDURE -getFilePos(h: FileHandle; VAR r: LONGINT; VAR rc: INTEGER) -"LARGE_INTEGER liz = {0}; *rc = (INTEGER)SetFilePointerEx((HANDLE)(SYSTEM_ADDRESS)h, liz, &li, FILE_CURRENT); *r = (LONGINT)li.QuadPart"; +"LARGE_INTEGER liz = {0}; *rc = (INTEGER)SetFilePointerEx((HANDLE)(SYSTEM_ADRINT)h, liz, &li, FILE_CURRENT); *r = (LONGINT)li.QuadPart"; PROCEDURE Truncate*(h: FileHandle; limit: LONGINT): ErrorCode; VAR rc: INTEGER; oldpos: LONGINT; @@ -529,8 +529,8 @@ PROCEDURE Exit*(code: INTEGER); BEGIN exit(code) END Exit; -PROCEDURE -errstring(s: ARRAY OF CHAR) 'WriteFile((HANDLE)(SYSTEM_ADDRESS)Platform_StdOut, s, s__len-1, 0,0)'; -PROCEDURE -errc (c: CHAR) 'WriteFile((HANDLE)(SYSTEM_ADDRESS)Platform_StdOut, &c, 1, 0,0)'; +PROCEDURE -errstring(s: ARRAY OF CHAR) 'WriteFile((HANDLE)(SYSTEM_ADRINT)Platform_StdOut, s, s__len-1, 0,0)'; +PROCEDURE -errc (c: CHAR) 'WriteFile((HANDLE)(SYSTEM_ADRINT)Platform_StdOut, &c, 1, 0,0)'; PROCEDURE errch(c: CHAR); BEGIN errc(c) END errch; PROCEDURE errln; BEGIN errch(0DX); errch(0AX) END errln; @@ -589,9 +589,9 @@ PROCEDURE TestLittleEndian; BEGIN i := 1; SYSTEM.GET(SYSTEM.ADR(i), LittleEndian); END TestLittleEndian; -PROCEDURE -getstdinhandle(): FileHandle "(SYSTEM_ADDRESS)GetStdHandle(STD_INPUT_HANDLE)"; -PROCEDURE -getstdouthandle(): FileHandle "(SYSTEM_ADDRESS)GetStdHandle(STD_OUTPUT_HANDLE)"; -PROCEDURE -getstderrhandle(): FileHandle "(SYSTEM_ADDRESS)GetStdHandle(STD_ERROR_HANDLE)"; +PROCEDURE -getstdinhandle(): FileHandle "(SYSTEM_ADRINT)GetStdHandle(STD_INPUT_HANDLE)"; +PROCEDURE -getstdouthandle(): FileHandle "(SYSTEM_ADRINT)GetStdHandle(STD_OUTPUT_HANDLE)"; +PROCEDURE -getstderrhandle(): FileHandle "(SYSTEM_ADRINT)GetStdHandle(STD_ERROR_HANDLE)"; PROCEDURE -getpid(): INTEGER "(INTEGER)GetCurrentProcessId()"; BEGIN diff --git a/src/system/SYSTEM.c b/src/system/SYSTEM.c index 33511a70..1077d3ce 100644 --- a/src/system/SYSTEM.c +++ b/src/system/SYSTEM.c @@ -35,7 +35,7 @@ void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0) void SYSTEM_ENUMP(void *adr, LONGINT n, void (*P)()) { while (n > 0) { - P((LONGINT)(SYSTEM_ADDRESS)(*((void**)(adr)))); + P((LONGINT)(SYSTEM_ADRINT)(*((void**)(adr)))); adr = ((void**)adr) + 1; n--; } @@ -106,7 +106,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, else if (typ == (LONGINT*)POINTER__typ) { /* element type is a pointer */ x = Heap_NEWBLK(size + nofelems * sizeof(LONGINT)); - p = (LONGINT*)(SYSTEM_ADDRESS)x[-1]; + p = (LONGINT*)(SYSTEM_ADRINT)x[-1]; p[-nofelems] = *p; /* build new type desc in situ: 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nofelems - 1; n = 1; /* n =1 for skipping the size field */ while (n <= nofelems) {*p = n*sizeof(LONGINT); p++; n++;} @@ -119,7 +119,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, while (ptab[nofptrs] >= 0) {nofptrs++;} /* number of pointers per element */ nptr = nofelems * nofptrs; /* total number of pointers */ x = Heap_NEWBLK(size + nptr * sizeof(LONGINT)); - p = (LONGINT*)(SYSTEM_ADDRESS)x[- 1]; + p = (LONGINT*)(SYSTEM_ADRINT)x[- 1]; p[-nptr] = *p; /* build new type desc in situ; 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nptr - 1; n = 0; off = dataoff; while (n < nofelems) {i = 0; @@ -155,7 +155,7 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler // (Ignore other signals) } - void SystemSetHandler(int s, SYSTEM_ADDRESS h) { + void SystemSetHandler(int s, SYSTEM_ADRINT h) { if (s >= 2 && s <= 4) { int needtosetsystemhandler = handler[s-2] == 0; handler[s-2] = (SystemSignalHandler)h; @@ -194,12 +194,12 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler } } - void SystemSetInterruptHandler(SYSTEM_ADDRESS h) { + void SystemSetInterruptHandler(SYSTEM_ADRINT h) { EnsureConsoleCtrlHandler(); SystemInterruptHandler = (SystemSignalHandler)h; } - void SystemSetQuitHandler(SYSTEM_ADDRESS h) { + void SystemSetQuitHandler(SYSTEM_ADRINT h) { EnsureConsoleCtrlHandler(); SystemQuitHandler = (SystemSignalHandler)h; } diff --git a/src/system/SYSTEM.h b/src/system/SYSTEM.h index 6377745e..35620b9b 100644 --- a/src/system/SYSTEM.h +++ b/src/system/SYSTEM.h @@ -26,11 +26,12 @@ typedef unsigned char SYSTEM_CARD8; typedef unsigned int size_t; #endif -#define SYSTEM_ADDRESS size_t +#define SYSTEM_ADRINT size_t +#define SYSTEM_ADDRESS size_t // Temporarily for bootstrap #define _SIZE_T_DECLARED // For FreeBSD #define _SIZE_T_DEFINED_ // For OpenBSD -void *memcpy(void *dest, const void *source, SYSTEM_ADDRESS size); +void *memcpy(void *dest, const void *source, SYSTEM_ADRINT size); @@ -107,10 +108,10 @@ extern LONGINT SYSTEM_ENTIER (double x); // Signal handling in SYSTEM.c #ifndef _WIN32 - extern void SystemSetHandler(int s, SYSTEM_ADDRESS h); + extern void SystemSetHandler(int s, SYSTEM_ADRINT h); #else - extern void SystemSetInterruptHandler(SYSTEM_ADDRESS h); - extern void SystemSetQuitHandler (SYSTEM_ADDRESS h); + extern void SystemSetInterruptHandler(SYSTEM_ADRINT h); + extern void SystemSetQuitHandler (SYSTEM_ADRINT h); #endif @@ -133,9 +134,9 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __COPY(s, d, n) {char*_a=(void*)s,*_b=(void*)d; LONGINT _i=0,_t=n-1; \ while(_i<_t&&((_b[_i]=_a[_i])!=0)){_i++;};_b[_i]=0;} -#define __DUP(x, l, t) x=(void*)memcpy((void*)(SYSTEM_ADDRESS)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) +#define __DUP(x, l, t) x=(void*)memcpy((void*)(SYSTEM_ADRINT)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) #define __DUPARR(v, t) v=(void*)memcpy(v##__copy,v,sizeof(t)) -#define __DEL(x) Platform_OSFree((LONGINT)(SYSTEM_ADDRESS)x) +#define __DEL(x) Platform_OSFree((LONGINT)(SYSTEM_ADRINT)x) @@ -145,8 +146,8 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __VAL(t, x) (*(t*)&(x)) -#define __GET(a, x, t) x= *(t*)(SYSTEM_ADDRESS)(a) -#define __PUT(a, x, t) *(t*)(SYSTEM_ADDRESS)(a)=x +#define __GET(a, x, t) x= *(t*)(SYSTEM_ADRINT)(a) +#define __PUT(a, x, t) *(t*)(SYSTEM_ADRINT)(a)=x #define __LSHL(x, n, t) ((t)((U_##t)(x)<<(n))) #define __LSHR(x, n, t) ((t)((U_##t)(x)>>(n))) @@ -161,7 +162,7 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) #define __BIT(x, n) (*(U_LONGINT*)(x)>>(n)&1) -#define __MOVE(s, d, n) memcpy((char*)(SYSTEM_ADDRESS)(d),(char*)(SYSTEM_ADDRESS)(s),n) +#define __MOVE(s, d, n) memcpy((char*)(SYSTEM_ADRINT)(d),(char*)(SYSTEM_ADRINT)(s),n) #define __ASHF(x, n) SYSTEM_ASH((LONGINT)(x), (LONGINT)(n)) #define __SHORT(x, y) ((int)((U_LONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) #define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) @@ -222,7 +223,7 @@ extern void Heap_INCREF(); extern void Platform_Init(INTEGER argc, LONGINT argv); extern void Heap_FINALL(); -#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (LONGINT)(SYSTEM_ADDRESS)&argv); +#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (LONGINT)(SYSTEM_ADRINT)&argv); #define __REGMAIN(name, enum) m = Heap_REGMOD((CHAR*)name,enum) #define __FINI Heap_FINALL(); return 0 @@ -243,7 +244,7 @@ extern SYSTEM_PTR Heap_NEWREC (LONGINT tag); extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __SYSNEW(p, len) p = Heap_NEWBLK((LONGINT)(len)) -#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(SYSTEM_ADDRESS)t##__typ) +#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(SYSTEM_ADRINT)t##__typ) #define __NEWARR SYSTEM_NEWARR @@ -274,20 +275,20 @@ extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __INITYP(t, t0, level) \ t##__typ = (LONGINT*)&t##__desc.blksz; \ memcpy(t##__desc.basep, t0##__typ - __BASEOFF, level*sizeof(LONGINT)); \ - t##__desc.basep[level] = (LONGINT)(SYSTEM_ADDRESS)t##__typ; \ - t##__desc.module = (LONGINT)(SYSTEM_ADDRESS)m; \ + t##__desc.basep[level] = (LONGINT)(SYSTEM_ADRINT)t##__typ; \ + t##__desc.module = (LONGINT)(SYSTEM_ADRINT)m; \ if(t##__desc.blksz!=sizeof(struct t)) __HALT(-15); \ t##__desc.blksz = (t##__desc.blksz+5*sizeof(LONGINT)-1)/(4*sizeof(LONGINT))*(4*sizeof(LONGINT)); \ - Heap_REGTYP(m, (LONGINT)(SYSTEM_ADDRESS)&t##__desc.next); \ + Heap_REGTYP(m, (LONGINT)(SYSTEM_ADRINT)&t##__desc.next); \ SYSTEM_INHERIT(t##__typ, t0##__typ) -#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(SYSTEM_ADDRESS)typ##__typ) -#define __TYPEOF(p) ((LONGINT*)(SYSTEM_ADDRESS)(*(((LONGINT*)(p))-1))) +#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(SYSTEM_ADRINT)typ##__typ) +#define __TYPEOF(p) ((LONGINT*)(SYSTEM_ADRINT)(*(((LONGINT*)(p))-1))) #define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) // Oberon-2 type bound procedures support -#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(SYSTEM_ADDRESS)proc -#define __SEND(typ, num, funtyp, parlist) ((funtyp)((SYSTEM_ADDRESS)*(typ-(__TPROC0OFF+num))))parlist +#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(SYSTEM_ADRINT)proc +#define __SEND(typ, num, funtyp, parlist) ((funtyp)((SYSTEM_ADRINT)*(typ-(__TPROC0OFF+num))))parlist From 7df022d94ec3fc4d3b66582fe8c97523b556da9e Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 26 Aug 2016 18:59:50 +0100 Subject: [PATCH 198/580] Add SYSTEM types INT8 through INT64. Define LINT as derived type of SYSTEM.INT64. --- bootstrap/unix-44/OPC.c | 2 +- bootstrap/unix-44/OPT.c | 89 ++++++++++++++++++++++------------- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 4 ++ bootstrap/unix-44/Vishap.c | 2 +- bootstrap/unix-48/OPC.c | 2 +- bootstrap/unix-48/OPT.c | 89 ++++++++++++++++++++++------------- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 4 ++ bootstrap/unix-48/Vishap.c | 2 +- bootstrap/unix-88/OPC.c | 2 +- bootstrap/unix-88/OPT.c | 89 ++++++++++++++++++++++------------- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 4 ++ bootstrap/unix-88/Vishap.c | 2 +- bootstrap/windows-48/OPC.c | 2 +- bootstrap/windows-48/OPT.c | 89 ++++++++++++++++++++++------------- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 4 ++ bootstrap/windows-48/Vishap.c | 2 +- bootstrap/windows-88/OPC.c | 2 +- bootstrap/windows-88/OPT.c | 89 ++++++++++++++++++++++------------- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 4 ++ bootstrap/windows-88/Vishap.c | 2 +- src/compiler/OPC.Mod | 4 ++ src/compiler/OPT.Mod | 31 +++++++++--- src/compiler/OPV.Mod | 4 ++ src/compiler/Vishap.Mod | 2 +- 29 files changed, 344 insertions(+), 192 deletions(-) diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index fce9997f..02a24b4d 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -211,7 +211,7 @@ void OPC_Ident (OPT_Object obj) OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); } OPM_Write('_'); - } else if ((obj == OPT_sysptrtyp->strobj || obj == OPT_ainttyp->strobj) || obj == OPT_bytetyp->strobj) { + } else if ((((((obj == OPT_sysptrtyp->strobj || obj == OPT_ainttyp->strobj) || obj == OPT_int8typ->strobj) || obj == OPT_int16typ->strobj) || obj == OPT_int32typ->strobj) || obj == OPT_int64typ->strobj) || obj == OPT_bytetyp->strobj) { OPM_WriteString((CHAR*)"SYSTEM_", (LONGINT)8); } OPM_WriteStringVar((void*)obj->name, ((LONGINT)(256))); diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index 4b76312b..cbd147e6 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -83,7 +83,8 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; -export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +static OPT_Object OPT_LIntObj; export SHORTINT OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; @@ -105,6 +106,7 @@ export void OPT_Close (void); export void OPT_CloseScope (void); static void OPT_DebugStruct (OPT_Struct btyp); static void OPT_EnterBoolConst (OPS_Name name, LONGINT value); +static void OPT_EnterDerivedType (OPS_Name name, OPT_Struct typ, OPT_Object *obj); static void OPT_EnterProc (OPS_Name name, INTEGER num); static void OPT_EnterTyp (OPS_Name name, SHORTINT form, INTEGER size, OPT_Struct *res); export void OPT_Export (BOOLEAN *ext, BOOLEAN *new); @@ -465,21 +467,21 @@ void OPT_IdFPrint (OPT_Struct typ) } } -static struct FPrintStr__12 { +static struct FPrintStr__13 { LONGINT *pbfp, *pvfp; - struct FPrintStr__12 *lnk; -} *FPrintStr__12_s; + struct FPrintStr__13 *lnk; +} *FPrintStr__13_s; -static void FPrintFlds__13 (OPT_Object fld, LONGINT adr, BOOLEAN visible); -static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr); -static void FPrintTProcs__17 (OPT_Object obj); +static void FPrintFlds__14 (OPT_Object fld, LONGINT adr, BOOLEAN visible); +static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, LONGINT adr); +static void FPrintTProcs__18 (OPT_Object obj); -static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr) +static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, LONGINT adr) { LONGINT i, j, n; OPT_Struct btyp = NIL; if (typ->comp == 4) { - FPrintFlds__13(typ->link, adr, 0); + FPrintFlds__14(typ->link, adr, 0); } else if (typ->comp == 2) { btyp = typ->BaseTyp; n = typ->n; @@ -489,53 +491,53 @@ static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr) } if (btyp->form == 13 || btyp->comp == 4) { j = OPT_nofhdfld; - FPrintHdFld__15(btyp, fld, adr); + FPrintHdFld__16(btyp, fld, adr); if (j != OPT_nofhdfld) { i = 1; while ((i < n && OPT_nofhdfld <= 2048)) { adr += btyp->size; - FPrintHdFld__15(btyp, fld, adr); + FPrintHdFld__16(btyp, fld, adr); i += 1; } } } } else if (typ->form == 13 || __STRCMP(fld->name, "@ptr") == 0) { - OPM_FPrint(&*FPrintStr__12_s->pvfp, ((LONGINT)(13))); - OPM_FPrint(&*FPrintStr__12_s->pvfp, adr); + OPM_FPrint(&*FPrintStr__13_s->pvfp, ((LONGINT)(13))); + OPM_FPrint(&*FPrintStr__13_s->pvfp, adr); OPT_nofhdfld += 1; } } -static void FPrintFlds__13 (OPT_Object fld, LONGINT adr, BOOLEAN visible) +static void FPrintFlds__14 (OPT_Object fld, LONGINT adr, BOOLEAN visible) { while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { - OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->vis); - OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)fld->name, ((LONGINT)(256))); - OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->adr); + OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->vis); + OPT_FPrintName(&*FPrintStr__13_s->pbfp, (void*)fld->name, ((LONGINT)(256))); + OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->adr); OPT_FPrintStr(fld->typ); - OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->typ->pbfp); - OPM_FPrint(&*FPrintStr__12_s->pvfp, fld->typ->pvfp); + OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->typ->pbfp); + OPM_FPrint(&*FPrintStr__13_s->pvfp, fld->typ->pvfp); } else { - FPrintHdFld__15(fld->typ, fld, fld->adr + adr); + FPrintHdFld__16(fld->typ, fld, fld->adr + adr); } fld = fld->link; } } -static void FPrintTProcs__17 (OPT_Object obj) +static void FPrintTProcs__18 (OPT_Object obj) { if (obj != NIL) { - FPrintTProcs__17(obj->left); + FPrintTProcs__18(obj->left); if (obj->mode == 13) { if (obj->vis != 0) { - OPM_FPrint(&*FPrintStr__12_s->pbfp, ((LONGINT)(13))); - OPM_FPrint(&*FPrintStr__12_s->pbfp, __ASHR(obj->adr, 16)); - OPT_FPrintSign(&*FPrintStr__12_s->pbfp, obj->typ, obj->link); - OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)obj->name, ((LONGINT)(256))); + OPM_FPrint(&*FPrintStr__13_s->pbfp, ((LONGINT)(13))); + OPM_FPrint(&*FPrintStr__13_s->pbfp, __ASHR(obj->adr, 16)); + OPT_FPrintSign(&*FPrintStr__13_s->pbfp, obj->typ, obj->link); + OPT_FPrintName(&*FPrintStr__13_s->pbfp, (void*)obj->name, ((LONGINT)(256))); } } - FPrintTProcs__17(obj->right); + FPrintTProcs__18(obj->right); } } @@ -545,11 +547,11 @@ void OPT_FPrintStr (OPT_Struct typ) OPT_Struct btyp = NIL; OPT_Object strobj = NIL, bstrobj = NIL; LONGINT pbfp, pvfp; - struct FPrintStr__12 _s; + struct FPrintStr__13 _s; _s.pbfp = &pbfp; _s.pvfp = &pvfp; - _s.lnk = FPrintStr__12_s; - FPrintStr__12_s = &_s; + _s.lnk = FPrintStr__13_s; + FPrintStr__13_s = &_s; if (!typ->fpdone) { OPT_IdFPrint(typ); pbfp = typ->idfp; @@ -586,11 +588,11 @@ void OPT_FPrintStr (OPT_Struct typ) OPM_FPrint(&pvfp, typ->align); OPM_FPrint(&pvfp, typ->n); OPT_nofhdfld = 0; - FPrintFlds__13(typ->link, ((LONGINT)(0)), 1); + FPrintFlds__14(typ->link, ((LONGINT)(0)), 1); if (OPT_nofhdfld > 2048) { OPM_Mark(225, typ->txtpos); } - FPrintTProcs__17(typ->link); + FPrintTProcs__18(typ->link); OPM_FPrint(&pvfp, pbfp); strobj = typ->strobj; if (strobj == NIL || strobj->name[0] == 0x00) { @@ -600,7 +602,7 @@ void OPT_FPrintStr (OPT_Struct typ) typ->pbfp = pbfp; typ->pvfp = pvfp; } - FPrintStr__12_s = _s.lnk; + FPrintStr__13_s = _s.lnk; } void OPT_FPrintObj (OPT_Object obj) @@ -1697,6 +1699,15 @@ static void OPT_EnterTyp (OPS_Name name, SHORTINT form, INTEGER size, OPT_Struct *res = typ; } +static void OPT_EnterDerivedType (OPS_Name name, OPT_Struct typ, OPT_Object *obj) +{ + OPS_Name name__copy; + __DUPARR(name, OPS_Name); + OPT_Insert(name, &*obj); + (*obj)->mode = 5; + (*obj)->typ = typ; +} + static void OPT_EnterProc (OPS_Name name, INTEGER num) { OPT_Object obj = NIL; @@ -1719,6 +1730,10 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_inttyp); P(OPT_linttyp); P(OPT_ainttyp); + P(OPT_int8typ); + P(OPT_int16typ); + P(OPT_int32typ); + P(OPT_int64typ); P(OPT_realtyp); P(OPT_lrltyp); P(OPT_settyp); @@ -1726,6 +1741,7 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_niltyp); P(OPT_notyp); P(OPT_sysptrtyp); + P(OPT_LIntObj); __ENUMP(OPT_GlbMod, 64, P); P(OPT_universe); P(OPT_syslink); @@ -1789,13 +1805,17 @@ export void *OPT__init(void) OPT_OpenScope(0, NIL); OPM_errpos = 0; OPT_InitStruct(&OPT_undftyp, 0); + OPT_undftyp->BaseTyp = OPT_undftyp; OPT_InitStruct(&OPT_notyp, 12); OPT_InitStruct(&OPT_stringtyp, 10); OPT_InitStruct(&OPT_niltyp, 11); - OPT_undftyp->BaseTyp = OPT_undftyp; OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp); OPT_EnterTyp((CHAR*)"PTR", 13, OPM_PointerSize, &OPT_sysptrtyp); OPT_EnterTyp((CHAR*)"ADRINT", 5, OPM_LIntSize, &OPT_ainttyp); + OPT_EnterTyp((CHAR*)"INT8", 5, 1, &OPT_int8typ); + OPT_EnterTyp((CHAR*)"INT16", 5, 2, &OPT_int16typ); + OPT_EnterTyp((CHAR*)"INT32", 5, 4, &OPT_int32typ); + OPT_EnterTyp((CHAR*)"INT64", 5, 8, &OPT_int64typ); OPT_EnterProc((CHAR*)"ADR", 20); OPT_EnterProc((CHAR*)"CC", 21); OPT_EnterProc((CHAR*)"LSH", 22); @@ -1819,6 +1839,7 @@ export void *OPT__init(void) OPT_EnterTyp((CHAR*)"LONGINT", 6, OPM_LIntSize, &OPT_linttyp); OPT_EnterTyp((CHAR*)"LONGREAL", 8, OPM_LRealSize, &OPT_lrltyp); OPT_EnterTyp((CHAR*)"SHORTINT", 4, OPM_SIntSize, &OPT_sinttyp); + OPT_EnterDerivedType((CHAR*)"LINT", OPT_int64typ, &OPT_LIntObj); OPT_EnterBoolConst((CHAR*)"FALSE", ((LONGINT)(0))); OPT_EnterBoolConst((CHAR*)"TRUE", ((LONGINT)(1))); OPT_EnterProc((CHAR*)"HALT", 0); diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index 7187f687..c4975398 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -67,7 +67,7 @@ typedef import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; -import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; import SHORTINT OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index 8b98e5f9..2172dee5 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -285,6 +285,10 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_inttyp->strobj->linkadr = 2; OPT_linttyp->strobj->linkadr = 2; OPT_ainttyp->strobj->linkadr = 2; + OPT_int8typ->strobj->linkadr = 2; + OPT_int16typ->strobj->linkadr = 2; + OPT_int32typ->strobj->linkadr = 2; + OPT_int64typ->strobj->linkadr = 2; OPT_lrltyp->strobj->linkadr = 2; OPT_sinttyp->strobj->linkadr = 2; OPT_booltyp->strobj->linkadr = 2; diff --git a/bootstrap/unix-44/Vishap.c b/bootstrap/unix-44/Vishap.c index 0feff79c..66a97f5d 100644 --- a/bootstrap/unix-44/Vishap.c +++ b/bootstrap/unix-44/Vishap.c @@ -81,7 +81,7 @@ static void Vishap_PropagateElementaryTypeSizes (void) OPT_realtyp->size = OPM_RealSize; OPT_inttyp->size = OPM_IntSize; OPT_linttyp->size = OPM_LIntSize; - OPT_ainttyp->size = OPM_LIntSize; + OPT_ainttyp->size = OPM_PointerSize; OPT_lrltyp->size = OPM_LRealSize; OPT_sinttyp->size = OPM_SIntSize; OPT_booltyp->size = OPM_BoolSize; diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index fce9997f..02a24b4d 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -211,7 +211,7 @@ void OPC_Ident (OPT_Object obj) OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); } OPM_Write('_'); - } else if ((obj == OPT_sysptrtyp->strobj || obj == OPT_ainttyp->strobj) || obj == OPT_bytetyp->strobj) { + } else if ((((((obj == OPT_sysptrtyp->strobj || obj == OPT_ainttyp->strobj) || obj == OPT_int8typ->strobj) || obj == OPT_int16typ->strobj) || obj == OPT_int32typ->strobj) || obj == OPT_int64typ->strobj) || obj == OPT_bytetyp->strobj) { OPM_WriteString((CHAR*)"SYSTEM_", (LONGINT)8); } OPM_WriteStringVar((void*)obj->name, ((LONGINT)(256))); diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 4b76312b..cbd147e6 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -83,7 +83,8 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; -export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +static OPT_Object OPT_LIntObj; export SHORTINT OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; @@ -105,6 +106,7 @@ export void OPT_Close (void); export void OPT_CloseScope (void); static void OPT_DebugStruct (OPT_Struct btyp); static void OPT_EnterBoolConst (OPS_Name name, LONGINT value); +static void OPT_EnterDerivedType (OPS_Name name, OPT_Struct typ, OPT_Object *obj); static void OPT_EnterProc (OPS_Name name, INTEGER num); static void OPT_EnterTyp (OPS_Name name, SHORTINT form, INTEGER size, OPT_Struct *res); export void OPT_Export (BOOLEAN *ext, BOOLEAN *new); @@ -465,21 +467,21 @@ void OPT_IdFPrint (OPT_Struct typ) } } -static struct FPrintStr__12 { +static struct FPrintStr__13 { LONGINT *pbfp, *pvfp; - struct FPrintStr__12 *lnk; -} *FPrintStr__12_s; + struct FPrintStr__13 *lnk; +} *FPrintStr__13_s; -static void FPrintFlds__13 (OPT_Object fld, LONGINT adr, BOOLEAN visible); -static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr); -static void FPrintTProcs__17 (OPT_Object obj); +static void FPrintFlds__14 (OPT_Object fld, LONGINT adr, BOOLEAN visible); +static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, LONGINT adr); +static void FPrintTProcs__18 (OPT_Object obj); -static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr) +static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, LONGINT adr) { LONGINT i, j, n; OPT_Struct btyp = NIL; if (typ->comp == 4) { - FPrintFlds__13(typ->link, adr, 0); + FPrintFlds__14(typ->link, adr, 0); } else if (typ->comp == 2) { btyp = typ->BaseTyp; n = typ->n; @@ -489,53 +491,53 @@ static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr) } if (btyp->form == 13 || btyp->comp == 4) { j = OPT_nofhdfld; - FPrintHdFld__15(btyp, fld, adr); + FPrintHdFld__16(btyp, fld, adr); if (j != OPT_nofhdfld) { i = 1; while ((i < n && OPT_nofhdfld <= 2048)) { adr += btyp->size; - FPrintHdFld__15(btyp, fld, adr); + FPrintHdFld__16(btyp, fld, adr); i += 1; } } } } else if (typ->form == 13 || __STRCMP(fld->name, "@ptr") == 0) { - OPM_FPrint(&*FPrintStr__12_s->pvfp, ((LONGINT)(13))); - OPM_FPrint(&*FPrintStr__12_s->pvfp, adr); + OPM_FPrint(&*FPrintStr__13_s->pvfp, ((LONGINT)(13))); + OPM_FPrint(&*FPrintStr__13_s->pvfp, adr); OPT_nofhdfld += 1; } } -static void FPrintFlds__13 (OPT_Object fld, LONGINT adr, BOOLEAN visible) +static void FPrintFlds__14 (OPT_Object fld, LONGINT adr, BOOLEAN visible) { while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { - OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->vis); - OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)fld->name, ((LONGINT)(256))); - OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->adr); + OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->vis); + OPT_FPrintName(&*FPrintStr__13_s->pbfp, (void*)fld->name, ((LONGINT)(256))); + OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->adr); OPT_FPrintStr(fld->typ); - OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->typ->pbfp); - OPM_FPrint(&*FPrintStr__12_s->pvfp, fld->typ->pvfp); + OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->typ->pbfp); + OPM_FPrint(&*FPrintStr__13_s->pvfp, fld->typ->pvfp); } else { - FPrintHdFld__15(fld->typ, fld, fld->adr + adr); + FPrintHdFld__16(fld->typ, fld, fld->adr + adr); } fld = fld->link; } } -static void FPrintTProcs__17 (OPT_Object obj) +static void FPrintTProcs__18 (OPT_Object obj) { if (obj != NIL) { - FPrintTProcs__17(obj->left); + FPrintTProcs__18(obj->left); if (obj->mode == 13) { if (obj->vis != 0) { - OPM_FPrint(&*FPrintStr__12_s->pbfp, ((LONGINT)(13))); - OPM_FPrint(&*FPrintStr__12_s->pbfp, __ASHR(obj->adr, 16)); - OPT_FPrintSign(&*FPrintStr__12_s->pbfp, obj->typ, obj->link); - OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)obj->name, ((LONGINT)(256))); + OPM_FPrint(&*FPrintStr__13_s->pbfp, ((LONGINT)(13))); + OPM_FPrint(&*FPrintStr__13_s->pbfp, __ASHR(obj->adr, 16)); + OPT_FPrintSign(&*FPrintStr__13_s->pbfp, obj->typ, obj->link); + OPT_FPrintName(&*FPrintStr__13_s->pbfp, (void*)obj->name, ((LONGINT)(256))); } } - FPrintTProcs__17(obj->right); + FPrintTProcs__18(obj->right); } } @@ -545,11 +547,11 @@ void OPT_FPrintStr (OPT_Struct typ) OPT_Struct btyp = NIL; OPT_Object strobj = NIL, bstrobj = NIL; LONGINT pbfp, pvfp; - struct FPrintStr__12 _s; + struct FPrintStr__13 _s; _s.pbfp = &pbfp; _s.pvfp = &pvfp; - _s.lnk = FPrintStr__12_s; - FPrintStr__12_s = &_s; + _s.lnk = FPrintStr__13_s; + FPrintStr__13_s = &_s; if (!typ->fpdone) { OPT_IdFPrint(typ); pbfp = typ->idfp; @@ -586,11 +588,11 @@ void OPT_FPrintStr (OPT_Struct typ) OPM_FPrint(&pvfp, typ->align); OPM_FPrint(&pvfp, typ->n); OPT_nofhdfld = 0; - FPrintFlds__13(typ->link, ((LONGINT)(0)), 1); + FPrintFlds__14(typ->link, ((LONGINT)(0)), 1); if (OPT_nofhdfld > 2048) { OPM_Mark(225, typ->txtpos); } - FPrintTProcs__17(typ->link); + FPrintTProcs__18(typ->link); OPM_FPrint(&pvfp, pbfp); strobj = typ->strobj; if (strobj == NIL || strobj->name[0] == 0x00) { @@ -600,7 +602,7 @@ void OPT_FPrintStr (OPT_Struct typ) typ->pbfp = pbfp; typ->pvfp = pvfp; } - FPrintStr__12_s = _s.lnk; + FPrintStr__13_s = _s.lnk; } void OPT_FPrintObj (OPT_Object obj) @@ -1697,6 +1699,15 @@ static void OPT_EnterTyp (OPS_Name name, SHORTINT form, INTEGER size, OPT_Struct *res = typ; } +static void OPT_EnterDerivedType (OPS_Name name, OPT_Struct typ, OPT_Object *obj) +{ + OPS_Name name__copy; + __DUPARR(name, OPS_Name); + OPT_Insert(name, &*obj); + (*obj)->mode = 5; + (*obj)->typ = typ; +} + static void OPT_EnterProc (OPS_Name name, INTEGER num) { OPT_Object obj = NIL; @@ -1719,6 +1730,10 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_inttyp); P(OPT_linttyp); P(OPT_ainttyp); + P(OPT_int8typ); + P(OPT_int16typ); + P(OPT_int32typ); + P(OPT_int64typ); P(OPT_realtyp); P(OPT_lrltyp); P(OPT_settyp); @@ -1726,6 +1741,7 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_niltyp); P(OPT_notyp); P(OPT_sysptrtyp); + P(OPT_LIntObj); __ENUMP(OPT_GlbMod, 64, P); P(OPT_universe); P(OPT_syslink); @@ -1789,13 +1805,17 @@ export void *OPT__init(void) OPT_OpenScope(0, NIL); OPM_errpos = 0; OPT_InitStruct(&OPT_undftyp, 0); + OPT_undftyp->BaseTyp = OPT_undftyp; OPT_InitStruct(&OPT_notyp, 12); OPT_InitStruct(&OPT_stringtyp, 10); OPT_InitStruct(&OPT_niltyp, 11); - OPT_undftyp->BaseTyp = OPT_undftyp; OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp); OPT_EnterTyp((CHAR*)"PTR", 13, OPM_PointerSize, &OPT_sysptrtyp); OPT_EnterTyp((CHAR*)"ADRINT", 5, OPM_LIntSize, &OPT_ainttyp); + OPT_EnterTyp((CHAR*)"INT8", 5, 1, &OPT_int8typ); + OPT_EnterTyp((CHAR*)"INT16", 5, 2, &OPT_int16typ); + OPT_EnterTyp((CHAR*)"INT32", 5, 4, &OPT_int32typ); + OPT_EnterTyp((CHAR*)"INT64", 5, 8, &OPT_int64typ); OPT_EnterProc((CHAR*)"ADR", 20); OPT_EnterProc((CHAR*)"CC", 21); OPT_EnterProc((CHAR*)"LSH", 22); @@ -1819,6 +1839,7 @@ export void *OPT__init(void) OPT_EnterTyp((CHAR*)"LONGINT", 6, OPM_LIntSize, &OPT_linttyp); OPT_EnterTyp((CHAR*)"LONGREAL", 8, OPM_LRealSize, &OPT_lrltyp); OPT_EnterTyp((CHAR*)"SHORTINT", 4, OPM_SIntSize, &OPT_sinttyp); + OPT_EnterDerivedType((CHAR*)"LINT", OPT_int64typ, &OPT_LIntObj); OPT_EnterBoolConst((CHAR*)"FALSE", ((LONGINT)(0))); OPT_EnterBoolConst((CHAR*)"TRUE", ((LONGINT)(1))); OPT_EnterProc((CHAR*)"HALT", 0); diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index 7187f687..c4975398 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -67,7 +67,7 @@ typedef import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; -import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; import SHORTINT OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index 8b98e5f9..2172dee5 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -285,6 +285,10 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_inttyp->strobj->linkadr = 2; OPT_linttyp->strobj->linkadr = 2; OPT_ainttyp->strobj->linkadr = 2; + OPT_int8typ->strobj->linkadr = 2; + OPT_int16typ->strobj->linkadr = 2; + OPT_int32typ->strobj->linkadr = 2; + OPT_int64typ->strobj->linkadr = 2; OPT_lrltyp->strobj->linkadr = 2; OPT_sinttyp->strobj->linkadr = 2; OPT_booltyp->strobj->linkadr = 2; diff --git a/bootstrap/unix-48/Vishap.c b/bootstrap/unix-48/Vishap.c index 0feff79c..66a97f5d 100644 --- a/bootstrap/unix-48/Vishap.c +++ b/bootstrap/unix-48/Vishap.c @@ -81,7 +81,7 @@ static void Vishap_PropagateElementaryTypeSizes (void) OPT_realtyp->size = OPM_RealSize; OPT_inttyp->size = OPM_IntSize; OPT_linttyp->size = OPM_LIntSize; - OPT_ainttyp->size = OPM_LIntSize; + OPT_ainttyp->size = OPM_PointerSize; OPT_lrltyp->size = OPM_LRealSize; OPT_sinttyp->size = OPM_SIntSize; OPT_booltyp->size = OPM_BoolSize; diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index 7e9ddb90..0813dca9 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -212,7 +212,7 @@ void OPC_Ident (OPT_Object obj) OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); } OPM_Write('_'); - } else if ((obj == OPT_sysptrtyp->strobj || obj == OPT_ainttyp->strobj) || obj == OPT_bytetyp->strobj) { + } else if ((((((obj == OPT_sysptrtyp->strobj || obj == OPT_ainttyp->strobj) || obj == OPT_int8typ->strobj) || obj == OPT_int16typ->strobj) || obj == OPT_int32typ->strobj) || obj == OPT_int64typ->strobj) || obj == OPT_bytetyp->strobj) { OPM_WriteString((CHAR*)"SYSTEM_", (LONGINT)8); } OPM_WriteStringVar((void*)obj->name, ((LONGINT)(256))); diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index daf5051d..20234e22 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -84,7 +84,8 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; -export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +static OPT_Object OPT_LIntObj; export SHORTINT OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; @@ -106,6 +107,7 @@ export void OPT_Close (void); export void OPT_CloseScope (void); static void OPT_DebugStruct (OPT_Struct btyp); static void OPT_EnterBoolConst (OPS_Name name, LONGINT value); +static void OPT_EnterDerivedType (OPS_Name name, OPT_Struct typ, OPT_Object *obj); static void OPT_EnterProc (OPS_Name name, INTEGER num); static void OPT_EnterTyp (OPS_Name name, SHORTINT form, INTEGER size, OPT_Struct *res); export void OPT_Export (BOOLEAN *ext, BOOLEAN *new); @@ -466,21 +468,21 @@ void OPT_IdFPrint (OPT_Struct typ) } } -static struct FPrintStr__12 { +static struct FPrintStr__13 { LONGINT *pbfp, *pvfp; - struct FPrintStr__12 *lnk; -} *FPrintStr__12_s; + struct FPrintStr__13 *lnk; +} *FPrintStr__13_s; -static void FPrintFlds__13 (OPT_Object fld, LONGINT adr, BOOLEAN visible); -static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr); -static void FPrintTProcs__17 (OPT_Object obj); +static void FPrintFlds__14 (OPT_Object fld, LONGINT adr, BOOLEAN visible); +static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, LONGINT adr); +static void FPrintTProcs__18 (OPT_Object obj); -static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr) +static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, LONGINT adr) { LONGINT i, j, n; OPT_Struct btyp = NIL; if (typ->comp == 4) { - FPrintFlds__13(typ->link, adr, 0); + FPrintFlds__14(typ->link, adr, 0); } else if (typ->comp == 2) { btyp = typ->BaseTyp; n = typ->n; @@ -490,53 +492,53 @@ static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr) } if (btyp->form == 13 || btyp->comp == 4) { j = OPT_nofhdfld; - FPrintHdFld__15(btyp, fld, adr); + FPrintHdFld__16(btyp, fld, adr); if (j != OPT_nofhdfld) { i = 1; while ((i < n && OPT_nofhdfld <= 2048)) { adr += btyp->size; - FPrintHdFld__15(btyp, fld, adr); + FPrintHdFld__16(btyp, fld, adr); i += 1; } } } } else if (typ->form == 13 || __STRCMP(fld->name, "@ptr") == 0) { - OPM_FPrint(&*FPrintStr__12_s->pvfp, ((LONGINT)(13))); - OPM_FPrint(&*FPrintStr__12_s->pvfp, adr); + OPM_FPrint(&*FPrintStr__13_s->pvfp, ((LONGINT)(13))); + OPM_FPrint(&*FPrintStr__13_s->pvfp, adr); OPT_nofhdfld += 1; } } -static void FPrintFlds__13 (OPT_Object fld, LONGINT adr, BOOLEAN visible) +static void FPrintFlds__14 (OPT_Object fld, LONGINT adr, BOOLEAN visible) { while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { - OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->vis); - OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)fld->name, ((LONGINT)(256))); - OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->adr); + OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->vis); + OPT_FPrintName(&*FPrintStr__13_s->pbfp, (void*)fld->name, ((LONGINT)(256))); + OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->adr); OPT_FPrintStr(fld->typ); - OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->typ->pbfp); - OPM_FPrint(&*FPrintStr__12_s->pvfp, fld->typ->pvfp); + OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->typ->pbfp); + OPM_FPrint(&*FPrintStr__13_s->pvfp, fld->typ->pvfp); } else { - FPrintHdFld__15(fld->typ, fld, fld->adr + adr); + FPrintHdFld__16(fld->typ, fld, fld->adr + adr); } fld = fld->link; } } -static void FPrintTProcs__17 (OPT_Object obj) +static void FPrintTProcs__18 (OPT_Object obj) { if (obj != NIL) { - FPrintTProcs__17(obj->left); + FPrintTProcs__18(obj->left); if (obj->mode == 13) { if (obj->vis != 0) { - OPM_FPrint(&*FPrintStr__12_s->pbfp, ((LONGINT)(13))); - OPM_FPrint(&*FPrintStr__12_s->pbfp, __ASHR(obj->adr, 16)); - OPT_FPrintSign(&*FPrintStr__12_s->pbfp, obj->typ, obj->link); - OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)obj->name, ((LONGINT)(256))); + OPM_FPrint(&*FPrintStr__13_s->pbfp, ((LONGINT)(13))); + OPM_FPrint(&*FPrintStr__13_s->pbfp, __ASHR(obj->adr, 16)); + OPT_FPrintSign(&*FPrintStr__13_s->pbfp, obj->typ, obj->link); + OPT_FPrintName(&*FPrintStr__13_s->pbfp, (void*)obj->name, ((LONGINT)(256))); } } - FPrintTProcs__17(obj->right); + FPrintTProcs__18(obj->right); } } @@ -546,11 +548,11 @@ void OPT_FPrintStr (OPT_Struct typ) OPT_Struct btyp = NIL; OPT_Object strobj = NIL, bstrobj = NIL; LONGINT pbfp, pvfp; - struct FPrintStr__12 _s; + struct FPrintStr__13 _s; _s.pbfp = &pbfp; _s.pvfp = &pvfp; - _s.lnk = FPrintStr__12_s; - FPrintStr__12_s = &_s; + _s.lnk = FPrintStr__13_s; + FPrintStr__13_s = &_s; if (!typ->fpdone) { OPT_IdFPrint(typ); pbfp = typ->idfp; @@ -587,11 +589,11 @@ void OPT_FPrintStr (OPT_Struct typ) OPM_FPrint(&pvfp, typ->align); OPM_FPrint(&pvfp, typ->n); OPT_nofhdfld = 0; - FPrintFlds__13(typ->link, ((LONGINT)(0)), 1); + FPrintFlds__14(typ->link, ((LONGINT)(0)), 1); if (OPT_nofhdfld > 2048) { OPM_Mark(225, typ->txtpos); } - FPrintTProcs__17(typ->link); + FPrintTProcs__18(typ->link); OPM_FPrint(&pvfp, pbfp); strobj = typ->strobj; if (strobj == NIL || strobj->name[0] == 0x00) { @@ -601,7 +603,7 @@ void OPT_FPrintStr (OPT_Struct typ) typ->pbfp = pbfp; typ->pvfp = pvfp; } - FPrintStr__12_s = _s.lnk; + FPrintStr__13_s = _s.lnk; } void OPT_FPrintObj (OPT_Object obj) @@ -1698,6 +1700,15 @@ static void OPT_EnterTyp (OPS_Name name, SHORTINT form, INTEGER size, OPT_Struct *res = typ; } +static void OPT_EnterDerivedType (OPS_Name name, OPT_Struct typ, OPT_Object *obj) +{ + OPS_Name name__copy; + __DUPARR(name, OPS_Name); + OPT_Insert(name, &*obj); + (*obj)->mode = 5; + (*obj)->typ = typ; +} + static void OPT_EnterProc (OPS_Name name, INTEGER num) { OPT_Object obj = NIL; @@ -1720,6 +1731,10 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_inttyp); P(OPT_linttyp); P(OPT_ainttyp); + P(OPT_int8typ); + P(OPT_int16typ); + P(OPT_int32typ); + P(OPT_int64typ); P(OPT_realtyp); P(OPT_lrltyp); P(OPT_settyp); @@ -1727,6 +1742,7 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_niltyp); P(OPT_notyp); P(OPT_sysptrtyp); + P(OPT_LIntObj); __ENUMP(OPT_GlbMod, 64, P); P(OPT_universe); P(OPT_syslink); @@ -1790,13 +1806,17 @@ export void *OPT__init(void) OPT_OpenScope(0, NIL); OPM_errpos = 0; OPT_InitStruct(&OPT_undftyp, 0); + OPT_undftyp->BaseTyp = OPT_undftyp; OPT_InitStruct(&OPT_notyp, 12); OPT_InitStruct(&OPT_stringtyp, 10); OPT_InitStruct(&OPT_niltyp, 11); - OPT_undftyp->BaseTyp = OPT_undftyp; OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp); OPT_EnterTyp((CHAR*)"PTR", 13, OPM_PointerSize, &OPT_sysptrtyp); OPT_EnterTyp((CHAR*)"ADRINT", 5, OPM_LIntSize, &OPT_ainttyp); + OPT_EnterTyp((CHAR*)"INT8", 5, 1, &OPT_int8typ); + OPT_EnterTyp((CHAR*)"INT16", 5, 2, &OPT_int16typ); + OPT_EnterTyp((CHAR*)"INT32", 5, 4, &OPT_int32typ); + OPT_EnterTyp((CHAR*)"INT64", 5, 8, &OPT_int64typ); OPT_EnterProc((CHAR*)"ADR", 20); OPT_EnterProc((CHAR*)"CC", 21); OPT_EnterProc((CHAR*)"LSH", 22); @@ -1820,6 +1840,7 @@ export void *OPT__init(void) OPT_EnterTyp((CHAR*)"LONGINT", 6, OPM_LIntSize, &OPT_linttyp); OPT_EnterTyp((CHAR*)"LONGREAL", 8, OPM_LRealSize, &OPT_lrltyp); OPT_EnterTyp((CHAR*)"SHORTINT", 4, OPM_SIntSize, &OPT_sinttyp); + OPT_EnterDerivedType((CHAR*)"LINT", OPT_int64typ, &OPT_LIntObj); OPT_EnterBoolConst((CHAR*)"FALSE", ((LONGINT)(0))); OPT_EnterBoolConst((CHAR*)"TRUE", ((LONGINT)(1))); OPT_EnterProc((CHAR*)"HALT", 0); diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 550ea673..f1865573 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -68,7 +68,7 @@ typedef import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; -import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; import SHORTINT OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index fe8d848a..638891f1 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -286,6 +286,10 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_inttyp->strobj->linkadr = 2; OPT_linttyp->strobj->linkadr = 2; OPT_ainttyp->strobj->linkadr = 2; + OPT_int8typ->strobj->linkadr = 2; + OPT_int16typ->strobj->linkadr = 2; + OPT_int32typ->strobj->linkadr = 2; + OPT_int64typ->strobj->linkadr = 2; OPT_lrltyp->strobj->linkadr = 2; OPT_sinttyp->strobj->linkadr = 2; OPT_booltyp->strobj->linkadr = 2; diff --git a/bootstrap/unix-88/Vishap.c b/bootstrap/unix-88/Vishap.c index 7e1eba78..a487fe66 100644 --- a/bootstrap/unix-88/Vishap.c +++ b/bootstrap/unix-88/Vishap.c @@ -82,7 +82,7 @@ static void Vishap_PropagateElementaryTypeSizes (void) OPT_realtyp->size = OPM_RealSize; OPT_inttyp->size = OPM_IntSize; OPT_linttyp->size = OPM_LIntSize; - OPT_ainttyp->size = OPM_LIntSize; + OPT_ainttyp->size = OPM_PointerSize; OPT_lrltyp->size = OPM_LRealSize; OPT_sinttyp->size = OPM_SIntSize; OPT_booltyp->size = OPM_BoolSize; diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index fce9997f..02a24b4d 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -211,7 +211,7 @@ void OPC_Ident (OPT_Object obj) OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); } OPM_Write('_'); - } else if ((obj == OPT_sysptrtyp->strobj || obj == OPT_ainttyp->strobj) || obj == OPT_bytetyp->strobj) { + } else if ((((((obj == OPT_sysptrtyp->strobj || obj == OPT_ainttyp->strobj) || obj == OPT_int8typ->strobj) || obj == OPT_int16typ->strobj) || obj == OPT_int32typ->strobj) || obj == OPT_int64typ->strobj) || obj == OPT_bytetyp->strobj) { OPM_WriteString((CHAR*)"SYSTEM_", (LONGINT)8); } OPM_WriteStringVar((void*)obj->name, ((LONGINT)(256))); diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 4b76312b..cbd147e6 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -83,7 +83,8 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; -export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +static OPT_Object OPT_LIntObj; export SHORTINT OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; @@ -105,6 +106,7 @@ export void OPT_Close (void); export void OPT_CloseScope (void); static void OPT_DebugStruct (OPT_Struct btyp); static void OPT_EnterBoolConst (OPS_Name name, LONGINT value); +static void OPT_EnterDerivedType (OPS_Name name, OPT_Struct typ, OPT_Object *obj); static void OPT_EnterProc (OPS_Name name, INTEGER num); static void OPT_EnterTyp (OPS_Name name, SHORTINT form, INTEGER size, OPT_Struct *res); export void OPT_Export (BOOLEAN *ext, BOOLEAN *new); @@ -465,21 +467,21 @@ void OPT_IdFPrint (OPT_Struct typ) } } -static struct FPrintStr__12 { +static struct FPrintStr__13 { LONGINT *pbfp, *pvfp; - struct FPrintStr__12 *lnk; -} *FPrintStr__12_s; + struct FPrintStr__13 *lnk; +} *FPrintStr__13_s; -static void FPrintFlds__13 (OPT_Object fld, LONGINT adr, BOOLEAN visible); -static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr); -static void FPrintTProcs__17 (OPT_Object obj); +static void FPrintFlds__14 (OPT_Object fld, LONGINT adr, BOOLEAN visible); +static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, LONGINT adr); +static void FPrintTProcs__18 (OPT_Object obj); -static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr) +static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, LONGINT adr) { LONGINT i, j, n; OPT_Struct btyp = NIL; if (typ->comp == 4) { - FPrintFlds__13(typ->link, adr, 0); + FPrintFlds__14(typ->link, adr, 0); } else if (typ->comp == 2) { btyp = typ->BaseTyp; n = typ->n; @@ -489,53 +491,53 @@ static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr) } if (btyp->form == 13 || btyp->comp == 4) { j = OPT_nofhdfld; - FPrintHdFld__15(btyp, fld, adr); + FPrintHdFld__16(btyp, fld, adr); if (j != OPT_nofhdfld) { i = 1; while ((i < n && OPT_nofhdfld <= 2048)) { adr += btyp->size; - FPrintHdFld__15(btyp, fld, adr); + FPrintHdFld__16(btyp, fld, adr); i += 1; } } } } else if (typ->form == 13 || __STRCMP(fld->name, "@ptr") == 0) { - OPM_FPrint(&*FPrintStr__12_s->pvfp, ((LONGINT)(13))); - OPM_FPrint(&*FPrintStr__12_s->pvfp, adr); + OPM_FPrint(&*FPrintStr__13_s->pvfp, ((LONGINT)(13))); + OPM_FPrint(&*FPrintStr__13_s->pvfp, adr); OPT_nofhdfld += 1; } } -static void FPrintFlds__13 (OPT_Object fld, LONGINT adr, BOOLEAN visible) +static void FPrintFlds__14 (OPT_Object fld, LONGINT adr, BOOLEAN visible) { while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { - OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->vis); - OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)fld->name, ((LONGINT)(256))); - OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->adr); + OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->vis); + OPT_FPrintName(&*FPrintStr__13_s->pbfp, (void*)fld->name, ((LONGINT)(256))); + OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->adr); OPT_FPrintStr(fld->typ); - OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->typ->pbfp); - OPM_FPrint(&*FPrintStr__12_s->pvfp, fld->typ->pvfp); + OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->typ->pbfp); + OPM_FPrint(&*FPrintStr__13_s->pvfp, fld->typ->pvfp); } else { - FPrintHdFld__15(fld->typ, fld, fld->adr + adr); + FPrintHdFld__16(fld->typ, fld, fld->adr + adr); } fld = fld->link; } } -static void FPrintTProcs__17 (OPT_Object obj) +static void FPrintTProcs__18 (OPT_Object obj) { if (obj != NIL) { - FPrintTProcs__17(obj->left); + FPrintTProcs__18(obj->left); if (obj->mode == 13) { if (obj->vis != 0) { - OPM_FPrint(&*FPrintStr__12_s->pbfp, ((LONGINT)(13))); - OPM_FPrint(&*FPrintStr__12_s->pbfp, __ASHR(obj->adr, 16)); - OPT_FPrintSign(&*FPrintStr__12_s->pbfp, obj->typ, obj->link); - OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)obj->name, ((LONGINT)(256))); + OPM_FPrint(&*FPrintStr__13_s->pbfp, ((LONGINT)(13))); + OPM_FPrint(&*FPrintStr__13_s->pbfp, __ASHR(obj->adr, 16)); + OPT_FPrintSign(&*FPrintStr__13_s->pbfp, obj->typ, obj->link); + OPT_FPrintName(&*FPrintStr__13_s->pbfp, (void*)obj->name, ((LONGINT)(256))); } } - FPrintTProcs__17(obj->right); + FPrintTProcs__18(obj->right); } } @@ -545,11 +547,11 @@ void OPT_FPrintStr (OPT_Struct typ) OPT_Struct btyp = NIL; OPT_Object strobj = NIL, bstrobj = NIL; LONGINT pbfp, pvfp; - struct FPrintStr__12 _s; + struct FPrintStr__13 _s; _s.pbfp = &pbfp; _s.pvfp = &pvfp; - _s.lnk = FPrintStr__12_s; - FPrintStr__12_s = &_s; + _s.lnk = FPrintStr__13_s; + FPrintStr__13_s = &_s; if (!typ->fpdone) { OPT_IdFPrint(typ); pbfp = typ->idfp; @@ -586,11 +588,11 @@ void OPT_FPrintStr (OPT_Struct typ) OPM_FPrint(&pvfp, typ->align); OPM_FPrint(&pvfp, typ->n); OPT_nofhdfld = 0; - FPrintFlds__13(typ->link, ((LONGINT)(0)), 1); + FPrintFlds__14(typ->link, ((LONGINT)(0)), 1); if (OPT_nofhdfld > 2048) { OPM_Mark(225, typ->txtpos); } - FPrintTProcs__17(typ->link); + FPrintTProcs__18(typ->link); OPM_FPrint(&pvfp, pbfp); strobj = typ->strobj; if (strobj == NIL || strobj->name[0] == 0x00) { @@ -600,7 +602,7 @@ void OPT_FPrintStr (OPT_Struct typ) typ->pbfp = pbfp; typ->pvfp = pvfp; } - FPrintStr__12_s = _s.lnk; + FPrintStr__13_s = _s.lnk; } void OPT_FPrintObj (OPT_Object obj) @@ -1697,6 +1699,15 @@ static void OPT_EnterTyp (OPS_Name name, SHORTINT form, INTEGER size, OPT_Struct *res = typ; } +static void OPT_EnterDerivedType (OPS_Name name, OPT_Struct typ, OPT_Object *obj) +{ + OPS_Name name__copy; + __DUPARR(name, OPS_Name); + OPT_Insert(name, &*obj); + (*obj)->mode = 5; + (*obj)->typ = typ; +} + static void OPT_EnterProc (OPS_Name name, INTEGER num) { OPT_Object obj = NIL; @@ -1719,6 +1730,10 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_inttyp); P(OPT_linttyp); P(OPT_ainttyp); + P(OPT_int8typ); + P(OPT_int16typ); + P(OPT_int32typ); + P(OPT_int64typ); P(OPT_realtyp); P(OPT_lrltyp); P(OPT_settyp); @@ -1726,6 +1741,7 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_niltyp); P(OPT_notyp); P(OPT_sysptrtyp); + P(OPT_LIntObj); __ENUMP(OPT_GlbMod, 64, P); P(OPT_universe); P(OPT_syslink); @@ -1789,13 +1805,17 @@ export void *OPT__init(void) OPT_OpenScope(0, NIL); OPM_errpos = 0; OPT_InitStruct(&OPT_undftyp, 0); + OPT_undftyp->BaseTyp = OPT_undftyp; OPT_InitStruct(&OPT_notyp, 12); OPT_InitStruct(&OPT_stringtyp, 10); OPT_InitStruct(&OPT_niltyp, 11); - OPT_undftyp->BaseTyp = OPT_undftyp; OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp); OPT_EnterTyp((CHAR*)"PTR", 13, OPM_PointerSize, &OPT_sysptrtyp); OPT_EnterTyp((CHAR*)"ADRINT", 5, OPM_LIntSize, &OPT_ainttyp); + OPT_EnterTyp((CHAR*)"INT8", 5, 1, &OPT_int8typ); + OPT_EnterTyp((CHAR*)"INT16", 5, 2, &OPT_int16typ); + OPT_EnterTyp((CHAR*)"INT32", 5, 4, &OPT_int32typ); + OPT_EnterTyp((CHAR*)"INT64", 5, 8, &OPT_int64typ); OPT_EnterProc((CHAR*)"ADR", 20); OPT_EnterProc((CHAR*)"CC", 21); OPT_EnterProc((CHAR*)"LSH", 22); @@ -1819,6 +1839,7 @@ export void *OPT__init(void) OPT_EnterTyp((CHAR*)"LONGINT", 6, OPM_LIntSize, &OPT_linttyp); OPT_EnterTyp((CHAR*)"LONGREAL", 8, OPM_LRealSize, &OPT_lrltyp); OPT_EnterTyp((CHAR*)"SHORTINT", 4, OPM_SIntSize, &OPT_sinttyp); + OPT_EnterDerivedType((CHAR*)"LINT", OPT_int64typ, &OPT_LIntObj); OPT_EnterBoolConst((CHAR*)"FALSE", ((LONGINT)(0))); OPT_EnterBoolConst((CHAR*)"TRUE", ((LONGINT)(1))); OPT_EnterProc((CHAR*)"HALT", 0); diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index 7187f687..c4975398 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -67,7 +67,7 @@ typedef import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; -import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; import SHORTINT OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index 8b98e5f9..2172dee5 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -285,6 +285,10 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_inttyp->strobj->linkadr = 2; OPT_linttyp->strobj->linkadr = 2; OPT_ainttyp->strobj->linkadr = 2; + OPT_int8typ->strobj->linkadr = 2; + OPT_int16typ->strobj->linkadr = 2; + OPT_int32typ->strobj->linkadr = 2; + OPT_int64typ->strobj->linkadr = 2; OPT_lrltyp->strobj->linkadr = 2; OPT_sinttyp->strobj->linkadr = 2; OPT_booltyp->strobj->linkadr = 2; diff --git a/bootstrap/windows-48/Vishap.c b/bootstrap/windows-48/Vishap.c index 0feff79c..66a97f5d 100644 --- a/bootstrap/windows-48/Vishap.c +++ b/bootstrap/windows-48/Vishap.c @@ -81,7 +81,7 @@ static void Vishap_PropagateElementaryTypeSizes (void) OPT_realtyp->size = OPM_RealSize; OPT_inttyp->size = OPM_IntSize; OPT_linttyp->size = OPM_LIntSize; - OPT_ainttyp->size = OPM_LIntSize; + OPT_ainttyp->size = OPM_PointerSize; OPT_lrltyp->size = OPM_LRealSize; OPT_sinttyp->size = OPM_SIntSize; OPT_booltyp->size = OPM_BoolSize; diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index 7e9ddb90..0813dca9 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -212,7 +212,7 @@ void OPC_Ident (OPT_Object obj) OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); } OPM_Write('_'); - } else if ((obj == OPT_sysptrtyp->strobj || obj == OPT_ainttyp->strobj) || obj == OPT_bytetyp->strobj) { + } else if ((((((obj == OPT_sysptrtyp->strobj || obj == OPT_ainttyp->strobj) || obj == OPT_int8typ->strobj) || obj == OPT_int16typ->strobj) || obj == OPT_int32typ->strobj) || obj == OPT_int64typ->strobj) || obj == OPT_bytetyp->strobj) { OPM_WriteString((CHAR*)"SYSTEM_", (LONGINT)8); } OPM_WriteStringVar((void*)obj->name, ((LONGINT)(256))); diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index daf5051d..20234e22 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -84,7 +84,8 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; -export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +static OPT_Object OPT_LIntObj; export SHORTINT OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; @@ -106,6 +107,7 @@ export void OPT_Close (void); export void OPT_CloseScope (void); static void OPT_DebugStruct (OPT_Struct btyp); static void OPT_EnterBoolConst (OPS_Name name, LONGINT value); +static void OPT_EnterDerivedType (OPS_Name name, OPT_Struct typ, OPT_Object *obj); static void OPT_EnterProc (OPS_Name name, INTEGER num); static void OPT_EnterTyp (OPS_Name name, SHORTINT form, INTEGER size, OPT_Struct *res); export void OPT_Export (BOOLEAN *ext, BOOLEAN *new); @@ -466,21 +468,21 @@ void OPT_IdFPrint (OPT_Struct typ) } } -static struct FPrintStr__12 { +static struct FPrintStr__13 { LONGINT *pbfp, *pvfp; - struct FPrintStr__12 *lnk; -} *FPrintStr__12_s; + struct FPrintStr__13 *lnk; +} *FPrintStr__13_s; -static void FPrintFlds__13 (OPT_Object fld, LONGINT adr, BOOLEAN visible); -static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr); -static void FPrintTProcs__17 (OPT_Object obj); +static void FPrintFlds__14 (OPT_Object fld, LONGINT adr, BOOLEAN visible); +static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, LONGINT adr); +static void FPrintTProcs__18 (OPT_Object obj); -static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr) +static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, LONGINT adr) { LONGINT i, j, n; OPT_Struct btyp = NIL; if (typ->comp == 4) { - FPrintFlds__13(typ->link, adr, 0); + FPrintFlds__14(typ->link, adr, 0); } else if (typ->comp == 2) { btyp = typ->BaseTyp; n = typ->n; @@ -490,53 +492,53 @@ static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr) } if (btyp->form == 13 || btyp->comp == 4) { j = OPT_nofhdfld; - FPrintHdFld__15(btyp, fld, adr); + FPrintHdFld__16(btyp, fld, adr); if (j != OPT_nofhdfld) { i = 1; while ((i < n && OPT_nofhdfld <= 2048)) { adr += btyp->size; - FPrintHdFld__15(btyp, fld, adr); + FPrintHdFld__16(btyp, fld, adr); i += 1; } } } } else if (typ->form == 13 || __STRCMP(fld->name, "@ptr") == 0) { - OPM_FPrint(&*FPrintStr__12_s->pvfp, ((LONGINT)(13))); - OPM_FPrint(&*FPrintStr__12_s->pvfp, adr); + OPM_FPrint(&*FPrintStr__13_s->pvfp, ((LONGINT)(13))); + OPM_FPrint(&*FPrintStr__13_s->pvfp, adr); OPT_nofhdfld += 1; } } -static void FPrintFlds__13 (OPT_Object fld, LONGINT adr, BOOLEAN visible) +static void FPrintFlds__14 (OPT_Object fld, LONGINT adr, BOOLEAN visible) { while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { - OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->vis); - OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)fld->name, ((LONGINT)(256))); - OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->adr); + OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->vis); + OPT_FPrintName(&*FPrintStr__13_s->pbfp, (void*)fld->name, ((LONGINT)(256))); + OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->adr); OPT_FPrintStr(fld->typ); - OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->typ->pbfp); - OPM_FPrint(&*FPrintStr__12_s->pvfp, fld->typ->pvfp); + OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->typ->pbfp); + OPM_FPrint(&*FPrintStr__13_s->pvfp, fld->typ->pvfp); } else { - FPrintHdFld__15(fld->typ, fld, fld->adr + adr); + FPrintHdFld__16(fld->typ, fld, fld->adr + adr); } fld = fld->link; } } -static void FPrintTProcs__17 (OPT_Object obj) +static void FPrintTProcs__18 (OPT_Object obj) { if (obj != NIL) { - FPrintTProcs__17(obj->left); + FPrintTProcs__18(obj->left); if (obj->mode == 13) { if (obj->vis != 0) { - OPM_FPrint(&*FPrintStr__12_s->pbfp, ((LONGINT)(13))); - OPM_FPrint(&*FPrintStr__12_s->pbfp, __ASHR(obj->adr, 16)); - OPT_FPrintSign(&*FPrintStr__12_s->pbfp, obj->typ, obj->link); - OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)obj->name, ((LONGINT)(256))); + OPM_FPrint(&*FPrintStr__13_s->pbfp, ((LONGINT)(13))); + OPM_FPrint(&*FPrintStr__13_s->pbfp, __ASHR(obj->adr, 16)); + OPT_FPrintSign(&*FPrintStr__13_s->pbfp, obj->typ, obj->link); + OPT_FPrintName(&*FPrintStr__13_s->pbfp, (void*)obj->name, ((LONGINT)(256))); } } - FPrintTProcs__17(obj->right); + FPrintTProcs__18(obj->right); } } @@ -546,11 +548,11 @@ void OPT_FPrintStr (OPT_Struct typ) OPT_Struct btyp = NIL; OPT_Object strobj = NIL, bstrobj = NIL; LONGINT pbfp, pvfp; - struct FPrintStr__12 _s; + struct FPrintStr__13 _s; _s.pbfp = &pbfp; _s.pvfp = &pvfp; - _s.lnk = FPrintStr__12_s; - FPrintStr__12_s = &_s; + _s.lnk = FPrintStr__13_s; + FPrintStr__13_s = &_s; if (!typ->fpdone) { OPT_IdFPrint(typ); pbfp = typ->idfp; @@ -587,11 +589,11 @@ void OPT_FPrintStr (OPT_Struct typ) OPM_FPrint(&pvfp, typ->align); OPM_FPrint(&pvfp, typ->n); OPT_nofhdfld = 0; - FPrintFlds__13(typ->link, ((LONGINT)(0)), 1); + FPrintFlds__14(typ->link, ((LONGINT)(0)), 1); if (OPT_nofhdfld > 2048) { OPM_Mark(225, typ->txtpos); } - FPrintTProcs__17(typ->link); + FPrintTProcs__18(typ->link); OPM_FPrint(&pvfp, pbfp); strobj = typ->strobj; if (strobj == NIL || strobj->name[0] == 0x00) { @@ -601,7 +603,7 @@ void OPT_FPrintStr (OPT_Struct typ) typ->pbfp = pbfp; typ->pvfp = pvfp; } - FPrintStr__12_s = _s.lnk; + FPrintStr__13_s = _s.lnk; } void OPT_FPrintObj (OPT_Object obj) @@ -1698,6 +1700,15 @@ static void OPT_EnterTyp (OPS_Name name, SHORTINT form, INTEGER size, OPT_Struct *res = typ; } +static void OPT_EnterDerivedType (OPS_Name name, OPT_Struct typ, OPT_Object *obj) +{ + OPS_Name name__copy; + __DUPARR(name, OPS_Name); + OPT_Insert(name, &*obj); + (*obj)->mode = 5; + (*obj)->typ = typ; +} + static void OPT_EnterProc (OPS_Name name, INTEGER num) { OPT_Object obj = NIL; @@ -1720,6 +1731,10 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_inttyp); P(OPT_linttyp); P(OPT_ainttyp); + P(OPT_int8typ); + P(OPT_int16typ); + P(OPT_int32typ); + P(OPT_int64typ); P(OPT_realtyp); P(OPT_lrltyp); P(OPT_settyp); @@ -1727,6 +1742,7 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_niltyp); P(OPT_notyp); P(OPT_sysptrtyp); + P(OPT_LIntObj); __ENUMP(OPT_GlbMod, 64, P); P(OPT_universe); P(OPT_syslink); @@ -1790,13 +1806,17 @@ export void *OPT__init(void) OPT_OpenScope(0, NIL); OPM_errpos = 0; OPT_InitStruct(&OPT_undftyp, 0); + OPT_undftyp->BaseTyp = OPT_undftyp; OPT_InitStruct(&OPT_notyp, 12); OPT_InitStruct(&OPT_stringtyp, 10); OPT_InitStruct(&OPT_niltyp, 11); - OPT_undftyp->BaseTyp = OPT_undftyp; OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp); OPT_EnterTyp((CHAR*)"PTR", 13, OPM_PointerSize, &OPT_sysptrtyp); OPT_EnterTyp((CHAR*)"ADRINT", 5, OPM_LIntSize, &OPT_ainttyp); + OPT_EnterTyp((CHAR*)"INT8", 5, 1, &OPT_int8typ); + OPT_EnterTyp((CHAR*)"INT16", 5, 2, &OPT_int16typ); + OPT_EnterTyp((CHAR*)"INT32", 5, 4, &OPT_int32typ); + OPT_EnterTyp((CHAR*)"INT64", 5, 8, &OPT_int64typ); OPT_EnterProc((CHAR*)"ADR", 20); OPT_EnterProc((CHAR*)"CC", 21); OPT_EnterProc((CHAR*)"LSH", 22); @@ -1820,6 +1840,7 @@ export void *OPT__init(void) OPT_EnterTyp((CHAR*)"LONGINT", 6, OPM_LIntSize, &OPT_linttyp); OPT_EnterTyp((CHAR*)"LONGREAL", 8, OPM_LRealSize, &OPT_lrltyp); OPT_EnterTyp((CHAR*)"SHORTINT", 4, OPM_SIntSize, &OPT_sinttyp); + OPT_EnterDerivedType((CHAR*)"LINT", OPT_int64typ, &OPT_LIntObj); OPT_EnterBoolConst((CHAR*)"FALSE", ((LONGINT)(0))); OPT_EnterBoolConst((CHAR*)"TRUE", ((LONGINT)(1))); OPT_EnterProc((CHAR*)"HALT", 0); diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 550ea673..f1865573 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -68,7 +68,7 @@ typedef import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; -import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; import SHORTINT OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index fe8d848a..638891f1 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -286,6 +286,10 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_inttyp->strobj->linkadr = 2; OPT_linttyp->strobj->linkadr = 2; OPT_ainttyp->strobj->linkadr = 2; + OPT_int8typ->strobj->linkadr = 2; + OPT_int16typ->strobj->linkadr = 2; + OPT_int32typ->strobj->linkadr = 2; + OPT_int64typ->strobj->linkadr = 2; OPT_lrltyp->strobj->linkadr = 2; OPT_sinttyp->strobj->linkadr = 2; OPT_booltyp->strobj->linkadr = 2; diff --git a/bootstrap/windows-88/Vishap.c b/bootstrap/windows-88/Vishap.c index 7e1eba78..a487fe66 100644 --- a/bootstrap/windows-88/Vishap.c +++ b/bootstrap/windows-88/Vishap.c @@ -82,7 +82,7 @@ static void Vishap_PropagateElementaryTypeSizes (void) OPT_realtyp->size = OPM_RealSize; OPT_inttyp->size = OPM_IntSize; OPT_linttyp->size = OPM_LIntSize; - OPT_ainttyp->size = OPM_LIntSize; + OPT_ainttyp->size = OPM_PointerSize; OPT_lrltyp->size = OPM_LRealSize; OPT_sinttyp->size = OPM_SIntSize; OPT_booltyp->size = OPM_BoolSize; diff --git a/src/compiler/OPC.Mod b/src/compiler/OPC.Mod index 849c04e9..b8244fd3 100644 --- a/src/compiler/OPC.Mod +++ b/src/compiler/OPC.Mod @@ -128,6 +128,10 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) OPM.Write('_') ELSIF (obj = OPT.sysptrtyp^.strobj) OR (obj = OPT.ainttyp^.strobj) + OR (obj = OPT.int8typ^.strobj) + OR (obj = OPT.int16typ^.strobj) + OR (obj = OPT.int32typ^.strobj) + OR (obj = OPT.int64typ^.strobj) OR (obj = OPT.bytetyp^.strobj) THEN OPM.WriteString("SYSTEM_") END; diff --git a/src/compiler/OPT.Mod b/src/compiler/OPT.Mod index 62a0d4b7..cf4c39ac 100644 --- a/src/compiler/OPT.Mod +++ b/src/compiler/OPT.Mod @@ -156,9 +156,12 @@ VAR bytetyp*, booltyp*, chartyp*, sinttyp*, inttyp*, linttyp*, ainttyp*, + int8typ*, int16typ*, int32typ*, int64typ*, realtyp*, lrltyp*, settyp*, stringtyp*, niltyp*, notyp*, sysptrtyp*: Struct; + LIntObj: Object; + nofGmod*: SHORTINT; (*nof imports*) GlbMod*: ARRAY maxImps OF Object; (* ^.right = first object, ^.name = module import name (not alias) *) @@ -1135,6 +1138,13 @@ END Import; typ^.idfp := form; typ^.idfpdone := TRUE; res := typ END EnterTyp; + PROCEDURE EnterDerivedType(name: OPS.Name; typ: Struct; VAR obj: Object); + BEGIN + Insert(name, obj); + obj.mode := Typ; + obj.typ := typ; + END EnterDerivedType; + PROCEDURE EnterProc(name: OPS.Name; num: INTEGER); VAR obj: Object; BEGIN Insert(name, obj); @@ -1142,14 +1152,19 @@ END Import; END EnterProc; BEGIN topScope := NIL; OpenScope(0, NIL); OPM.errpos := 0; - InitStruct(undftyp, Undef); InitStruct(notyp, NoTyp); - InitStruct(stringtyp, String); InitStruct(niltyp, NilTyp); - undftyp^.BaseTyp := undftyp; + InitStruct(undftyp, Undef); undftyp^.BaseTyp := undftyp; + InitStruct(notyp, NoTyp); + InitStruct(stringtyp, String); + InitStruct(niltyp, NilTyp); (*initialization of module SYSTEM*) - EnterTyp("BYTE", Byte, OPM.ByteSize, bytetyp); - EnterTyp("PTR", Pointer, OPM.PointerSize, sysptrtyp); - EnterTyp("ADRINT", Int, OPM.LIntSize, ainttyp); + EnterTyp("BYTE", Byte, OPM.ByteSize, bytetyp); + EnterTyp("PTR", Pointer, OPM.PointerSize, sysptrtyp); + EnterTyp("ADRINT", Int, OPM.LIntSize, ainttyp); + EnterTyp("INT8", Int, 1, int8typ); + EnterTyp("INT16", Int, 2, int16typ); + EnterTyp("INT32", Int, 4, int32typ); + EnterTyp("INT64", Int, 8, int64typ); EnterProc("ADR", adrfn); EnterProc("CC", ccfn); EnterProc("LSH", lshfn); @@ -1174,6 +1189,10 @@ BEGIN topScope := NIL; OpenScope(0, NIL); OPM.errpos := 0; EnterTyp("LONGREAL", LReal, OPM.LRealSize, lrltyp); EnterTyp("SHORTINT", SInt, OPM.SIntSize, sinttyp); + (* Create LINT type as TYPE LINT = SYSTEM.INT64 *) + EnterDerivedType("LINT", int64typ, LIntObj); + + EnterBoolConst("FALSE", 0); (* 0 and 1 are compiler internal representation only *) EnterBoolConst("TRUE", 1); diff --git a/src/compiler/OPV.Mod b/src/compiler/OPV.Mod index 529c1aa9..7518f811 100644 --- a/src/compiler/OPV.Mod +++ b/src/compiler/OPV.Mod @@ -206,6 +206,10 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 OPT.inttyp^.strobj^.linkadr := PredefinedType; OPT.linttyp^.strobj^.linkadr := PredefinedType; OPT.ainttyp^.strobj^.linkadr := PredefinedType; + OPT.int8typ^.strobj^.linkadr := PredefinedType; + OPT.int16typ^.strobj^.linkadr := PredefinedType; + OPT.int32typ^.strobj^.linkadr := PredefinedType; + OPT.int64typ^.strobj^.linkadr := PredefinedType; OPT.lrltyp^.strobj^.linkadr := PredefinedType; OPT.sinttyp^.strobj^.linkadr := PredefinedType; OPT.booltyp^.strobj^.linkadr := PredefinedType; diff --git a/src/compiler/Vishap.Mod b/src/compiler/Vishap.Mod index 216533a1..25f0aa59 100644 --- a/src/compiler/Vishap.Mod +++ b/src/compiler/Vishap.Mod @@ -58,7 +58,7 @@ MODULE Vishap; (* J. Templ 3.2.95 *) OPT.realtyp.size := OPM.RealSize; OPT.inttyp.size := OPM.IntSize; OPT.linttyp.size := OPM.LIntSize; - OPT.ainttyp.size := OPM.LIntSize; + OPT.ainttyp.size := OPM.PointerSize; OPT.lrltyp.size := OPM.LRealSize; OPT.sinttyp.size := OPM.SIntSize; OPT.booltyp.size := OPM.BoolSize; From 5033d09f3216b6211ac26cbd3d34f2581abd445b Mon Sep 17 00:00:00 2001 From: David Brown Date: Sat, 27 Aug 2016 18:49:52 +0100 Subject: [PATCH 199/580] Record constant size in symbol tables, make full is now successful. --- src/compiler/OPB.Mod | 52 ++++++++---------------------- src/compiler/OPM.cmdln.Mod | 8 +++++ src/compiler/OPP.Mod | 12 +++---- src/compiler/OPT.Mod | 65 ++++++++++++++++++++++++++++---------- src/compiler/Vishap.Mod | 8 +++-- src/system/SYSTEM.h | 17 ++++++---- 6 files changed, 92 insertions(+), 70 deletions(-) diff --git a/src/compiler/OPB.Mod b/src/compiler/OPB.Mod index 6da12c5e..cfb983b5 100644 --- a/src/compiler/OPB.Mod +++ b/src/compiler/OPB.Mod @@ -105,41 +105,13 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) x^.conval := OPT.NewConst(); x^.conval^.setval := {}; RETURN x END EmptySet; - - (* Integer size support *) - - PROCEDURE SignedByteSize(n: LONGINT): INTEGER; - (* Returns number of bytes required to represent signed value n *) - VAR b: INTEGER; - BEGIN - IF n < 0 THEN n := -(n+1) END; (* Positive value in the range 0 - 7F.. *) - b := 1; WHILE (b < 8) & (ASH(n, -(8*b-1)) # 0) DO INC(b) END; - RETURN b - END SignedByteSize; - - PROCEDURE ShorterSize(i: LONGINT): LONGINT; - BEGIN IF i >= OPM.LIntSize THEN RETURN OPM.IntSize ELSE RETURN OPM.SIntSize END - END ShorterSize; - - PROCEDURE LongerSize(i: LONGINT): LONGINT; - BEGIN IF i <= OPM.SIntSize THEN RETURN OPM.IntSize ELSE RETURN OPM.LIntSize END - END LongerSize; - - PROCEDURE IntType(size: LONGINT): OPT.Struct; - (* Selects smallest standard integer type for given size in bytes *) - VAR result: OPT.Struct; - BEGIN - IF size <= OPT.sinttyp.size THEN result := OPT.sinttyp - ELSIF size <= OPT.inttyp.size THEN result := OPT.inttyp - ELSE - result := OPT.linttyp - END; - IF size > OPT.linttyp.size THEN err(203) END; (* Number too large *) - RETURN result - END IntType; - PROCEDURE SetIntType(node: OPT.Node); - BEGIN node.typ := IntType(SignedByteSize(node.conval.intval)) + VAR b: INTEGER; n: LONGINT; + BEGIN + (* Determine number of bytes required to represent constant value *) + IF node.conval.intval >= 0 THEN n := node.conval.intval ELSE n := -(node.conval.intval+1) END; + b := 1; WHILE (b < 8) & (ASH(n, -(8*b-1)) # 0) DO INC(b) END; + node.typ := OPT.IntType(b) END SetIntType; PROCEDURE NewIntConst*(intval: LONGINT): OPT.Node; @@ -494,7 +466,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) |OPT.SInt, OPT.Int, OPT.LInt: IF g IN OPT.intSet THEN - IF x.typ.size <= y.typ.size THEN x.typ := y.typ ELSE x.typ := IntType(x.typ.size) END + IF x.typ.size <= y.typ.size THEN x.typ := y.typ ELSE x.typ := OPT.IntType(x.typ.size) END ELSIF g = OPT.Real THEN x^.typ := OPT.realtyp; xval^.realval := xval^.intval ELSIF g = OPT.LReal THEN x^.typ := OPT.lrltyp; xval^.realval := xval^.intval ELSE err(100); y^.typ := x^.typ; yval^ := xval^ @@ -633,7 +605,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) IF f IN OPT.intSet THEN IF g IN OPT.intSet THEN IF f > g THEN SetIntType(x); - IF x^.typ^.form > g THEN err(203); x^.conval^.intval := 1 END + IF x.typ.size > typ.size THEN err(203); x^.conval^.intval := 1 END END ELSIF g IN OPT.realSet THEN x^.conval^.realval := x^.conval^.intval; x^.conval^.intval := OPM.ConstNotAlloc ELSE (*g = OPT.Char*) k := x^.conval^.intval; @@ -1034,13 +1006,17 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) END |OPT.shortfn: (*SHORT*) IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) - ELSIF (f IN OPT.intSet) & (x.typ.size > OPM.SIntSize) THEN Convert(x, IntType(ShorterSize(x.typ.size))) + ELSIF f IN OPT.intSet THEN + typ := OPT.NextType(x.typ, -1); + IF typ = NIL THEN err(111) ELSE Convert(x, typ) END ELSIF f = OPT.LReal THEN Convert(x, OPT.realtyp) ELSE err(111) END |OPT.longfn: (*LONG*) IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) - ELSIF (f IN OPT.intSet) & (x.typ.size < OPM.LIntSize) THEN Convert(x, IntType(LongerSize(x.typ.size))) + ELSIF f IN OPT.intSet THEN + typ := OPT.NextType(x.typ, 1); + IF typ = NIL THEN err(111) ELSE Convert(x, typ) END ELSIF f = OPT.Real THEN Convert(x, OPT.lrltyp) ELSIF f = OPT.Char THEN Convert(x, OPT.linttyp) ELSE err(111) diff --git a/src/compiler/OPM.cmdln.Mod b/src/compiler/OPM.cmdln.Mod index 74c0f5dc..d7cb5c29 100644 --- a/src/compiler/OPM.cmdln.Mod +++ b/src/compiler/OPM.cmdln.Mod @@ -565,6 +565,11 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) END AlignSize; *) + + + + (* Integer size support *) + PROCEDURE SignedMaximum*(bytecount: LONGINT): LONGINT; VAR result: LONGINT; BEGIN @@ -580,6 +585,9 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) + + + PROCEDURE GetProperties(); (* VAR base: LONGINT; *) BEGIN diff --git a/src/compiler/OPP.Mod b/src/compiler/OPP.Mod index 56f2a3d0..4e53ad05 100644 --- a/src/compiler/OPP.Mod +++ b/src/compiler/OPP.Mod @@ -665,16 +665,16 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) END END ProcedureDeclaration; - PROCEDURE CaseLabelList(VAR lab: OPT.Node; LabelForm: INTEGER; VAR n: INTEGER; VAR tab: CaseTable); + PROCEDURE CaseLabelList(VAR lab: OPT.Node; LabelTyp: OPT.Struct; VAR n: INTEGER; VAR tab: CaseTable); VAR x, y, lastlab: OPT.Node; i, f: INTEGER; xval, yval: LONGINT; BEGIN lab := NIL; lastlab := NIL; LOOP ConstExpression(x); f := x^.typ^.form; IF f IN OPT.intSet + {OPT.Char} THEN xval := x^.conval^.intval ELSE err(61); xval := 1 - END ; + END; IF f IN OPT.intSet THEN - IF LabelForm < f THEN err(60) END - ELSIF LabelForm # f THEN err(60) + IF ~(LabelTyp.form IN OPT.intSet) OR (LabelTyp.size < x.typ.size) THEN err(60) END + ELSIF LabelTyp.form # f THEN err(60) END ; IF sym = OPS.upto THEN OPS.Get(sym); ConstExpression(y); yval := y^.conval^.intval; @@ -719,7 +719,7 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) CheckSym(OPS.of); cases := NIL; lastcase := NIL; n := 0; LOOP IF sym < OPS.bar THEN - CaseLabelList(lab, x^.typ^.form, n, tab); + CaseLabelList(lab, x^.typ, n, tab); CheckSym(OPS.colon); StatSeq(y); OPB.Construct(OPT.Ncasedo, lab, y); OPB.Link(cases, lastcase, lab) END ; @@ -817,7 +817,7 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) END ; z := OPB.NewLeaf(t); OPB.Assign(z, y); SetPos(z); OPB.Link(stat, last, z); y := OPB.NewLeaf(t) - ELSIF (y^.typ^.form < OPT.SInt) OR (y^.typ^.form > x^.left^.typ^.form) THEN err(113) + ELSIF ~(y^.typ^.form IN OPT.intSet) OR (y.typ.size > x.left.typ.size) THEN err(113) END ; OPB.Link(stat, last, x); IF sym = OPS.by THEN OPS.Get(sym); ConstExpression(z) ELSE z := OPB.NewIntConst(1) END ; diff --git a/src/compiler/OPT.Mod b/src/compiler/OPT.Mod index cf4c39ac..65f51dd2 100644 --- a/src/compiler/OPT.Mod +++ b/src/compiler/OPT.Mod @@ -160,14 +160,14 @@ VAR realtyp*, lrltyp*, settyp*, stringtyp*, niltyp*, notyp*, sysptrtyp*: Struct; - LIntObj: Object; - nofGmod*: SHORTINT; (*nof imports*) GlbMod*: ARRAY maxImps OF Object; (* ^.right = first object, ^.name = module import name (not alias) *) SelfName*: OPS.Name; (* name of module being compiled *) SYSimported*: BOOLEAN; + NextSize: ARRAY 20 OF Struct; (* Lists integer types in SHORT/LONG ordering *) + CONST @@ -206,10 +206,37 @@ VAR extsf, sfpresent: BOOLEAN; symExtended, symNew: BOOLEAN; + + + PROCEDURE err(n: INTEGER); BEGIN OPM.err(n) END err; +PROCEDURE IntType*(size: LONGINT): Struct; +(* Selects smallest standard integer type for given size in bytes *) + VAR i: INTEGER; +BEGIN + i := 1; WHILE (NextSize[i].size < size) & (NextSize[i+1] # NIL) DO INC(i) END; + RETURN NextSize[i]; +END IntType; + +PROCEDURE NextType*(x: Struct; dir: INTEGER): Struct; + VAR i: INTEGER; +BEGIN + ASSERT(x.form IN intSet); + ASSERT((dir = 1) OR (dir = -1)); + (* Not sure if StPar0 (which calls this) always gets the baseiest type. This + ASSERT will tell me. *) + ASSERT(x.BaseTyp = undftyp); + WHILE x.BaseTyp # undftyp DO ASSERT(x # x.BaseTyp); ASSERT(x.BaseTyp # NIL); x := x.BaseTyp END; + i := 0; WHILE (NextSize[i] # x) & (i < LEN(NextSize)) DO INC(i) END; + ASSERT(i < LEN(NextSize)-1); + RETURN NextSize[i+dir] +END NextType; + + + PROCEDURE NewConst*(): Const; VAR const: Const; BEGIN NEW(const); RETURN const @@ -812,7 +839,12 @@ BEGIN ELSE obj := NewObj(); obj^.mnolev := -mno; obj^.vis := external; IF tag <= Pointer THEN (* Constant *) - obj^.mode := Con; obj^.typ := impCtxt.ref[tag]; obj^.conval := NewConst(); InConstant(tag, obj^.conval) + obj^.mode := Con; obj^.conval := NewConst(); InConstant(tag, obj^.conval); + IF tag IN intSet THEN + obj.typ := IntType(OPM.SymRInt()) + ELSE + obj^.typ := impCtxt.ref[tag]; + END ELSIF tag >= Sxpro THEN obj^.conval := NewConst(); obj^.conval^.intval := -1; @@ -1033,7 +1065,7 @@ END Import; Char: OPM.SymWCh(CHR(obj^.conval^.intval)) | SInt, Int, - LInt: OPM.SymWInt(obj^.conval^.intval) + LInt: OPM.SymWInt(obj^.conval^.intval); OPM.SymWInt(obj.typ.size) | Set: OPM.SymWSet(obj^.conval^.setval) | Real: rval := SHORT(obj^.conval^.realval); OPM.SymWReal(rval) | LReal: OPM.SymWLReal(obj^.conval^.realval) @@ -1138,13 +1170,6 @@ END Import; typ^.idfp := form; typ^.idfpdone := TRUE; res := typ END EnterTyp; - PROCEDURE EnterDerivedType(name: OPS.Name; typ: Struct; VAR obj: Object); - BEGIN - Insert(name, obj); - obj.mode := Typ; - obj.typ := typ; - END EnterDerivedType; - PROCEDURE EnterProc(name: OPS.Name; num: INTEGER); VAR obj: Object; BEGIN Insert(name, obj); @@ -1160,7 +1185,7 @@ BEGIN topScope := NIL; OpenScope(0, NIL); OPM.errpos := 0; (*initialization of module SYSTEM*) EnterTyp("BYTE", Byte, OPM.ByteSize, bytetyp); EnterTyp("PTR", Pointer, OPM.PointerSize, sysptrtyp); - EnterTyp("ADRINT", Int, OPM.LIntSize, ainttyp); + EnterTyp("ADRINT", Int, OPM.PointerSize, ainttyp); EnterTyp("INT8", Int, 1, int8typ); EnterTyp("INT16", Int, 2, int16typ); EnterTyp("INT32", Int, 4, int32typ); @@ -1189,10 +1214,6 @@ BEGIN topScope := NIL; OpenScope(0, NIL); OPM.errpos := 0; EnterTyp("LONGREAL", LReal, OPM.LRealSize, lrltyp); EnterTyp("SHORTINT", SInt, OPM.SIntSize, sinttyp); - (* Create LINT type as TYPE LINT = SYSTEM.INT64 *) - EnterDerivedType("LINT", int64typ, LIntObj); - - EnterBoolConst("FALSE", 0); (* 0 and 1 are compiler internal representation only *) EnterBoolConst("TRUE", 1); @@ -1231,7 +1252,17 @@ BEGIN topScope := NIL; OpenScope(0, NIL); OPM.errpos := 0; impCtxt.ref[String] := stringtyp; impCtxt.ref[NilTyp] := niltyp; impCtxt.ref[NoTyp] := notyp; - impCtxt.ref[Pointer] := sysptrtyp + impCtxt.ref[Pointer] := sysptrtyp; + + NextSize[1] := sinttyp; + NextSize[2] := inttyp; + NextSize[3] := linttyp; + + NextSize[5] := int8typ; + NextSize[6] := int16typ; + NextSize[7] := int32typ; + NextSize[8] := int64typ + END OPT. Objects: diff --git a/src/compiler/Vishap.Mod b/src/compiler/Vishap.Mod index 25f0aa59..6d306e5e 100644 --- a/src/compiler/Vishap.Mod +++ b/src/compiler/Vishap.Mod @@ -6,7 +6,7 @@ MODULE Vishap; (* J. Templ 3.2.95 *) OPV, OPC, OPM, extTools, Strings, vt100; - VAR mname : ARRAY 256 OF CHAR; (* noch *) + VAR mname: ARRAY 256 OF CHAR; (* noch *) PROCEDURE Module*(VAR done: BOOLEAN); @@ -61,7 +61,7 @@ MODULE Vishap; (* J. Templ 3.2.95 *) OPT.ainttyp.size := OPM.PointerSize; OPT.lrltyp.size := OPM.LRealSize; OPT.sinttyp.size := OPM.SIntSize; - OPT.booltyp.size := OPM.BoolSize; + OPT.booltyp.size := OPM.BoolSize END PropagateElementaryTypeSizes; @@ -129,5 +129,7 @@ BEGIN Platform.SetInterruptHandler(Trap); Platform.SetQuitHandler(Trap); Platform.SetBadInstructionHandler(Trap); - OPB.typSize := OPV.TypSize; OPT.typSize := OPV.TypSize; Translate + OPB.typSize := OPV.TypSize; + OPT.typSize := OPV.TypSize; + Translate END Vishap. diff --git a/src/system/SYSTEM.h b/src/system/SYSTEM.h index 35620b9b..216af910 100644 --- a/src/system/SYSTEM.h +++ b/src/system/SYSTEM.h @@ -60,12 +60,6 @@ typedef float REAL; typedef double LONGREAL; typedef void* SYSTEM_PTR; -// Unsigned variants are for use by shift and rotate macros. - -typedef unsigned char U_SYSTEM_BYTE; -typedef unsigned char U_CHAR; -typedef unsigned char U_SHORTINT; - // For 32 bit builds, the size of LONGINT depends on a make option: #if (__SIZEOF_POINTER__ == 8) || defined(LARGE) || defined(_WIN64) @@ -80,9 +74,20 @@ typedef unsigned char U_SHORTINT; typedef unsigned long U_LONGINT; #endif +// Unsigned variants are for use by shift and rotate macros. + +typedef unsigned char U_SYSTEM_BYTE; +typedef unsigned char U_CHAR; +typedef unsigned char U_SHORTINT; + typedef U_LONGINT SET; typedef U_LONGINT U_SET; +typedef SYSTEM_CARD8 U_SYSTEM_INT8; +typedef SYSTEM_CARD16 U_SYSTEM_INT16; +typedef SYSTEM_CARD32 U_SYSTEM_INT32; +typedef SYSTEM_CARD64 U_SYSTEM_INT64; + // OS Memory allocation interfaces are in PlatformXXX.Mod From 7d7579a36d5100945d7ff646522831749d73612a Mon Sep 17 00:00:00 2001 From: David Brown Date: Mon, 29 Aug 2016 17:47:54 +0100 Subject: [PATCH 200/580] Remove unused AlignSize proc, and clean sym files before compiler build. --- src/compiler/OPM.cmdln.Mod | 18 ------------------ src/tools/make/vishap.make | 1 + 2 files changed, 1 insertion(+), 18 deletions(-) diff --git a/src/compiler/OPM.cmdln.Mod b/src/compiler/OPM.cmdln.Mod index d7cb5c29..07b5b89f 100644 --- a/src/compiler/OPM.cmdln.Mod +++ b/src/compiler/OPM.cmdln.Mod @@ -548,24 +548,6 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) END VerboseListSizes; - (* - PROCEDURE AlignSize*(size: LONGINT): INTEGER; - VAR align: INTEGER; - BEGIN - IF size < Alignment THEN - IF size > 8 THEN align := 16 - ELSIF size > 4 THEN align := 8 - ELSIF size > 2 THEN align := 4 - ELSE align := SHORT(size) - END - ELSE - align := Alignment - END; - RETURN align - END AlignSize; - *) - - (* Integer size support *) diff --git a/src/tools/make/vishap.make b/src/tools/make/vishap.make index 17bb1b95..838b5ef7 100644 --- a/src/tools/make/vishap.make +++ b/src/tools/make/vishap.make @@ -96,6 +96,7 @@ translate: @printf " ADRSIZE: %s\n" $(ADRSIZE) @printf " ALIGNMENT: %s\n" $(ALIGNMENT) @mkdir -p $(BUILDDIR) + @rm -f $(BUILDDIR)/*.sym cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -B$(INTSIZE)$(ADRSIZE)$(ALIGNMENT) ../../Configuration.Mod cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -B$(INTSIZE)$(ADRSIZE)$(ALIGNMENT) ../../src/system/Platform$(PLATFORM).Mod From a33e38cf6c1a018696413480eebe8ae5eaf0911e Mon Sep 17 00:00:00 2001 From: David Brown Date: Mon, 29 Aug 2016 18:34:46 +0100 Subject: [PATCH 201/580] Add OutSize and InTyp procedures for integer symbol handling. --- src/compiler/OPT.Mod | 42 ++++++++++++++++++++++++++++++++++-------- 1 file changed, 34 insertions(+), 8 deletions(-) diff --git a/src/compiler/OPT.Mod b/src/compiler/OPT.Mod index 65f51dd2..e1b33ac3 100644 --- a/src/compiler/OPT.Mod +++ b/src/compiler/OPT.Mod @@ -229,7 +229,9 @@ BEGIN (* Not sure if StPar0 (which calls this) always gets the baseiest type. This ASSERT will tell me. *) ASSERT(x.BaseTyp = undftyp); + (* WHILE x.BaseTyp # undftyp DO ASSERT(x # x.BaseTyp); ASSERT(x.BaseTyp # NIL); x := x.BaseTyp END; + *) i := 0; WHILE (NextSize[i] # x) & (i < LEN(NextSize)) DO INC(i) END; ASSERT(i < LEN(NextSize)-1); RETURN NextSize[i+dir] @@ -701,6 +703,26 @@ BEGIN RETURN obj END InTProc; + +PROCEDURE InTyp(tag: LONGINT): Struct; + VAR size: LONGINT; +BEGIN + IF tag IN intSet THEN + size := OPM.SymRInt(); + (* + IF size = 123456789 THEN (* Expected magic number while testing *) + size := OPM.SymRInt(); + ELSE + OPM.LogWLn; OPM.LogWStr("Missing constant magic number. size = "); OPM.LogWNum(size,1); + END; + *) + RETURN IntType(size) + ELSE + RETURN impCtxt.ref[tag] + END +END InTyp; + + PROCEDURE InStruct(VAR typ: Struct); VAR mno: SHORTINT; ref: INTEGER; tag: LONGINT; name: OPS.Name; t: Struct; obj, last, fld, old, dummy: Object; @@ -781,7 +803,7 @@ BEGIN ELSE OPM.LogWStr("unhandled case at InStruct, tag = "); OPM.LogWNum(tag, 0); OPM.LogWLn; END; IF ref = impCtxt.minr THEN - WHILE (ref < impCtxt.nofr) (*OR ((ref >= Int8) & (ref <= Int64))*) DO + WHILE (ref < impCtxt.nofr) DO t := impCtxt.ref[ref]; FPrintStr(t); obj := t^.strobj; (* obj^.typ^.strobj = obj, else obj^.fprint differs (alias) *) IF obj^.name # "" THEN FPrintObj(obj) END; @@ -840,11 +862,7 @@ BEGIN obj := NewObj(); obj^.mnolev := -mno; obj^.vis := external; IF tag <= Pointer THEN (* Constant *) obj^.mode := Con; obj^.conval := NewConst(); InConstant(tag, obj^.conval); - IF tag IN intSet THEN - obj.typ := IntType(OPM.SymRInt()) - ELSE - obj^.typ := impCtxt.ref[tag]; - END + obj^.typ := InTyp(tag) ELSIF tag >= Sxpro THEN obj^.conval := NewConst(); obj^.conval^.intval := -1; @@ -1015,10 +1033,18 @@ END Import; END END OutTProcs; + + PROCEDURE OutSize(size: LONGINT); + BEGIN + (* OPM.SymWInt(123456789); *) + OPM.SymWInt(size) + END OutSize; + + PROCEDURE OutStr(typ: Struct); (* OPV.TypeAlloc already applied *) VAR strobj: Object; BEGIN - IF (typ^.ref < expCtxt.ref) (*OR (typ^.ref >= Int8) & (typ^.ref <= Int64)*) THEN OPM.SymWInt(-typ^.ref) + IF (typ^.ref < expCtxt.ref) THEN OPM.SymWInt(-typ^.ref); ELSE OPM.SymWInt(Sstruct); typ^.ref := expCtxt.ref; INC(expCtxt.ref); @@ -1065,7 +1091,7 @@ END Import; Char: OPM.SymWCh(CHR(obj^.conval^.intval)) | SInt, Int, - LInt: OPM.SymWInt(obj^.conval^.intval); OPM.SymWInt(obj.typ.size) + LInt: OPM.SymWInt(obj^.conval^.intval); OutSize(obj.typ.size) | Set: OPM.SymWSet(obj^.conval^.setval) | Real: rval := SHORT(obj^.conval^.realval); OPM.SymWReal(rval) | LReal: OPM.SymWLReal(obj^.conval^.realval) From b3c71fb2f0b78403b72ae499125cc348b4456250 Mon Sep 17 00:00:00 2001 From: David Brown Date: Tue, 30 Aug 2016 19:01:24 +0100 Subject: [PATCH 202/580] Include int size in .sym files, fix __IN for out of range values, better naming. --- bootstrap/unix-44/Configuration.c | 4 +- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Console.c | 2 +- bootstrap/unix-44/Console.h | 2 +- bootstrap/unix-44/Files.c | 2 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 2 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 268 +++++++++++---------------- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 2 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 2 +- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 14 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 144 +++++++++----- bootstrap/unix-44/OPT.h | 4 +- bootstrap/unix-44/OPV.c | 2 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/SYSTEM.h | 19 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/Vishap.c | 2 +- bootstrap/unix-44/errors.c | 2 +- bootstrap/unix-44/errors.h | 2 +- bootstrap/unix-44/extTools.c | 2 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-44/vt100.c | 2 +- bootstrap/unix-44/vt100.h | 2 +- bootstrap/unix-48/Configuration.c | 4 +- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Console.c | 2 +- bootstrap/unix-48/Console.h | 2 +- bootstrap/unix-48/Files.c | 2 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 2 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 268 +++++++++++---------------- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 2 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 2 +- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 14 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 144 +++++++++----- bootstrap/unix-48/OPT.h | 4 +- bootstrap/unix-48/OPV.c | 2 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/SYSTEM.h | 19 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/Vishap.c | 2 +- bootstrap/unix-48/errors.c | 2 +- bootstrap/unix-48/errors.h | 2 +- bootstrap/unix-48/extTools.c | 2 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-48/vt100.c | 2 +- bootstrap/unix-48/vt100.h | 2 +- bootstrap/unix-88/Configuration.c | 4 +- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Console.c | 2 +- bootstrap/unix-88/Console.h | 2 +- bootstrap/unix-88/Files.c | 2 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 2 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 268 +++++++++++---------------- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 2 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 2 +- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 14 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 144 +++++++++----- bootstrap/unix-88/OPT.h | 4 +- bootstrap/unix-88/OPV.c | 2 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/SYSTEM.h | 19 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/Vishap.c | 2 +- bootstrap/unix-88/errors.c | 2 +- bootstrap/unix-88/errors.h | 2 +- bootstrap/unix-88/extTools.c | 2 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/unix-88/vt100.c | 2 +- bootstrap/unix-88/vt100.h | 2 +- bootstrap/windows-48/Configuration.c | 4 +- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Console.c | 2 +- bootstrap/windows-48/Console.h | 2 +- bootstrap/windows-48/Files.c | 2 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 2 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 268 +++++++++++---------------- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 2 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 2 +- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 14 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 144 +++++++++----- bootstrap/windows-48/OPT.h | 4 +- bootstrap/windows-48/OPV.c | 2 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/SYSTEM.h | 19 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/Vishap.c | 2 +- bootstrap/windows-48/errors.c | 2 +- bootstrap/windows-48/errors.h | 2 +- bootstrap/windows-48/extTools.c | 2 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-48/vt100.c | 2 +- bootstrap/windows-48/vt100.h | 2 +- bootstrap/windows-88/Configuration.c | 4 +- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Console.c | 2 +- bootstrap/windows-88/Console.h | 2 +- bootstrap/windows-88/Files.c | 2 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 2 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 268 +++++++++++---------------- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 2 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 2 +- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 14 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 144 +++++++++----- bootstrap/windows-88/OPT.h | 4 +- bootstrap/windows-88/OPV.c | 2 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Platform.c | 2 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/SYSTEM.h | 19 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/Vishap.c | 2 +- bootstrap/windows-88/errors.c | 2 +- bootstrap/windows-88/errors.h | 2 +- bootstrap/windows-88/extTools.c | 2 +- bootstrap/windows-88/extTools.h | 2 +- bootstrap/windows-88/vt100.c | 2 +- bootstrap/windows-88/vt100.h | 2 +- src/compiler/OPB.Mod | 4 +- src/compiler/OPT.Mod | 61 +++--- src/compiler/OPV.Mod | 2 +- src/system/SYSTEM.h | 2 +- src/test/confidence/testresult.sh | 4 +- 205 files changed, 1353 insertions(+), 1325 deletions(-) diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index b0d48f0a..947863a2 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -13,6 +13,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/08/26] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/08/30] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index 38a63260..33303334 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Console.c b/bootstrap/unix-44/Console.c index cc4cc8bd..375896e6 100644 --- a/bootstrap/unix-44/Console.c +++ b/bootstrap/unix-44/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Platform.h" diff --git a/bootstrap/unix-44/Console.h b/bootstrap/unix-44/Console.h index 2c462da9..0e7cb823 100644 --- a/bootstrap/unix-44/Console.h +++ b/bootstrap/unix-44/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 496a4a87..069b901c 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index bc1d11eb..7241c31a 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index cca2fc74..5fcaf193 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tskSfF */ #include "SYSTEM.h" struct Heap__1 { diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index d05f688c..4247d33d 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index d76a50a2..148c062a 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Heap.h" diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index 78c8d49e..85b1ec59 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index 60b37750..9a06ac24 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" @@ -34,9 +34,7 @@ export void OPB_In (OPT_Node *x, OPT_Node y); export void OPB_Index (OPT_Node *x, OPT_Node y); export void OPB_Inittd (OPT_Node *inittd, OPT_Node *last, OPT_Struct typ); static BOOLEAN OPB_IntToBool (LONGINT i); -static OPT_Struct OPB_IntType (LONGINT size); export void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y); -static LONGINT OPB_LongerSize (LONGINT i); export void OPB_MOp (SHORTINT op, OPT_Node *x); export OPT_Node OPB_NewBoolConst (BOOLEAN boolval); export OPT_Node OPB_NewIntConst (LONGINT intval); @@ -53,8 +51,6 @@ export void OPB_Return (OPT_Node *x, OPT_Object proc); export void OPB_SetElem (OPT_Node *x); static void OPB_SetIntType (OPT_Node node); export void OPB_SetRange (OPT_Node *x, OPT_Node y); -static LONGINT OPB_ShorterSize (LONGINT i); -static INTEGER OPB_SignedByteSize (LONGINT n); export void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno); export void OPB_StPar0 (OPT_Node *par0, INTEGER fctno); export void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno); @@ -224,68 +220,20 @@ OPT_Node OPB_EmptySet (void) return _o_result; } -static INTEGER OPB_SignedByteSize (LONGINT n) +static void OPB_SetIntType (OPT_Node node) { - INTEGER _o_result; INTEGER b; - if (n < 0) { - n = -(n + 1); + LONGINT n; + if (node->conval->intval >= 0) { + n = node->conval->intval; + } else { + n = -(node->conval->intval + 1); } b = 1; while ((b < 8 && __ASH(n, -(__ASHL(b, 3) - 1)) != 0)) { b += 1; } - _o_result = b; - return _o_result; -} - -static LONGINT OPB_ShorterSize (LONGINT i) -{ - LONGINT _o_result; - if (i >= (int)OPM_LIntSize) { - _o_result = OPM_IntSize; - return _o_result; - } else { - _o_result = OPM_SIntSize; - return _o_result; - } - __RETCHK; -} - -static LONGINT OPB_LongerSize (LONGINT i) -{ - LONGINT _o_result; - if (i <= (int)OPM_SIntSize) { - _o_result = OPM_IntSize; - return _o_result; - } else { - _o_result = OPM_LIntSize; - return _o_result; - } - __RETCHK; -} - -static OPT_Struct OPB_IntType (LONGINT size) -{ - OPT_Struct _o_result; - OPT_Struct result = NIL; - if (size <= OPT_sinttyp->size) { - result = OPT_sinttyp; - } else if (size <= OPT_inttyp->size) { - result = OPT_inttyp; - } else { - result = OPT_linttyp; - } - if (size > OPT_linttyp->size) { - OPB_err(203); - } - _o_result = result; - return _o_result; -} - -static void OPB_SetIntType (OPT_Node node) -{ - node->typ = OPB_IntType(OPB_SignedByteSize(node->conval->intval)); + node->typ = OPT_IntType(b); } OPT_Node OPB_NewIntConst (LONGINT intval) @@ -429,16 +377,16 @@ void OPB_Field (OPT_Node *x, OPT_Object y) } } -static struct TypTest__61 { +static struct TypTest__57 { OPT_Node *x; OPT_Object *obj; BOOLEAN *guard; - struct TypTest__61 *lnk; -} *TypTest__61_s; + struct TypTest__57 *lnk; +} *TypTest__57_s; -static void GTT__62 (OPT_Struct t0, OPT_Struct t1); +static void GTT__58 (OPT_Struct t0, OPT_Struct t1); -static void GTT__62 (OPT_Struct t0, OPT_Struct t1) +static void GTT__58 (OPT_Struct t0, OPT_Struct t1) { OPT_Node node = NIL; OPT_Struct t = NIL; @@ -451,54 +399,54 @@ static void GTT__62 (OPT_Struct t0, OPT_Struct t1) t1 = t1->BaseTyp; } if (t1 == t0 || t0->form == 0) { - if (*TypTest__61_s->guard) { - OPB_BindNodes(5, NIL, &*TypTest__61_s->x, NIL); - (*TypTest__61_s->x)->readonly = (*TypTest__61_s->x)->left->readonly; + if (*TypTest__57_s->guard) { + OPB_BindNodes(5, NIL, &*TypTest__57_s->x, NIL); + (*TypTest__57_s->x)->readonly = (*TypTest__57_s->x)->left->readonly; } else { node = OPT_NewNode(11); node->subcl = 16; - node->left = *TypTest__61_s->x; - node->obj = *TypTest__61_s->obj; - *TypTest__61_s->x = node; + node->left = *TypTest__57_s->x; + node->obj = *TypTest__57_s->obj; + *TypTest__57_s->x = node; } } else { OPB_err(85); } } else if (t0 != t1) { OPB_err(85); - } else if (!*TypTest__61_s->guard) { - if ((*TypTest__61_s->x)->class == 5) { + } else if (!*TypTest__57_s->guard) { + if ((*TypTest__57_s->x)->class == 5) { node = OPT_NewNode(11); node->subcl = 16; - node->left = *TypTest__61_s->x; - node->obj = *TypTest__61_s->obj; - *TypTest__61_s->x = node; + node->left = *TypTest__57_s->x; + node->obj = *TypTest__57_s->obj; + *TypTest__57_s->x = node; } else { - *TypTest__61_s->x = OPB_NewBoolConst(1); + *TypTest__57_s->x = OPB_NewBoolConst(1); } } } void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) { - struct TypTest__61 _s; + struct TypTest__57 _s; _s.x = x; _s.obj = &obj; _s.guard = &guard; - _s.lnk = TypTest__61_s; - TypTest__61_s = &_s; + _s.lnk = TypTest__57_s; + TypTest__57_s = &_s; if (OPB_NotVar(*x)) { OPB_err(112); } else if ((*x)->typ->form == 13) { if (((*x)->typ->BaseTyp->comp != 4 && (*x)->typ != OPT_sysptrtyp)) { OPB_err(85); } else if (obj->typ->form == 13) { - GTT__62((*x)->typ->BaseTyp, obj->typ->BaseTyp); + GTT__58((*x)->typ->BaseTyp, obj->typ->BaseTyp); } else { OPB_err(86); } } else if (((((*x)->typ->comp == 4 && (*x)->class == 1)) && obj->typ->comp == 4)) { - GTT__62((*x)->typ, obj->typ); + GTT__58((*x)->typ, obj->typ); } else { OPB_err(87); } @@ -507,7 +455,7 @@ void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) } else { (*x)->typ = OPT_booltyp; } - TypTest__61_s = _s.lnk; + TypTest__57_s = _s.lnk; } void OPB_In (OPT_Node *x, OPT_Node y) @@ -573,13 +521,13 @@ static void OPB_CheckRealType (INTEGER f, INTEGER nr, OPT_Const x) x->intval = -1; } -static struct MOp__30 { - struct MOp__30 *lnk; -} *MOp__30_s; +static struct MOp__28 { + struct MOp__28 *lnk; +} *MOp__28_s; -static OPT_Node NewOp__31 (SHORTINT op, OPT_Struct typ, OPT_Node z); +static OPT_Node NewOp__29 (SHORTINT op, OPT_Struct typ, OPT_Node z); -static OPT_Node NewOp__31 (SHORTINT op, OPT_Struct typ, OPT_Node z) +static OPT_Node NewOp__29 (SHORTINT op, OPT_Struct typ, OPT_Node z) { OPT_Node _o_result; OPT_Node node = NIL; @@ -596,9 +544,9 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) INTEGER f; OPT_Struct typ = NIL; OPT_Node z = NIL; - struct MOp__30 _s; - _s.lnk = MOp__30_s; - MOp__30_s = &_s; + struct MOp__28 _s; + _s.lnk = MOp__28_s; + MOp__28_s = &_s; z = *x; if (z->class == 8 || z->class == 9) { OPB_err(126); @@ -612,7 +560,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->conval->intval = OPB_BoolToInt(!OPB_IntToBool(z->conval->intval)); z->obj = NIL; } else { - z = NewOp__31(op, typ, z); + z = NewOp__29(op, typ, z); } } else { OPB_err(98); @@ -640,7 +588,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } z->obj = NIL; } else { - z = NewOp__31(op, typ, z); + z = NewOp__29(op, typ, z); } } else { OPB_err(97); @@ -661,7 +609,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } z->obj = NIL; } else { - z = NewOp__31(op, typ, z); + z = NewOp__29(op, typ, z); } } else { OPB_err(111); @@ -673,7 +621,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->conval->intval = (int)__CAP((CHAR)z->conval->intval); z->obj = NIL; } else { - z = NewOp__31(op, typ, z); + z = NewOp__29(op, typ, z); } } else { OPB_err(111); @@ -686,7 +634,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->conval->intval = OPB_BoolToInt(__ODD(z->conval->intval)); z->obj = NIL; } else { - z = NewOp__31(op, typ, z); + z = NewOp__29(op, typ, z); } } else { OPB_err(111); @@ -699,7 +647,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) f = 10; } if (z->class < 7 || f == 10) { - z = NewOp__31(op, typ, z); + z = NewOp__29(op, typ, z); } else { OPB_err(127); } @@ -708,7 +656,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) case 25: if ((__IN(f, 0x70) && z->class == 7)) { if ((0 <= z->conval->intval && z->conval->intval <= -1)) { - z = NewOp__31(op, typ, z); + z = NewOp__29(op, typ, z); } else { OPB_err(219); } @@ -725,7 +673,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } } *x = z; - MOp__30_s = _s.lnk; + MOp__28_s = _s.lnk; } static void OPB_CheckPtr (OPT_Node x, OPT_Node y) @@ -921,7 +869,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) if (x->typ->size <= y->typ->size) { x->typ = y->typ; } else { - x->typ = OPB_IntType(x->typ->size); + x->typ = OPT_IntType(x->typ->size); } } else if (g == 7) { x->typ = OPT_realtyp; @@ -1178,7 +1126,7 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) if (__IN(g, 0x70)) { if (f > g) { OPB_SetIntType(*x); - if ((int)(*x)->typ->form > g) { + if ((*x)->typ->size > typ->size) { OPB_err(203); (*x)->conval->intval = 1; } @@ -1219,15 +1167,15 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) (*x)->typ = typ; } -static struct Op__40 { +static struct Op__38 { INTEGER *f, *g; - struct Op__40 *lnk; -} *Op__40_s; + struct Op__38 *lnk; +} *Op__38_s; -static void NewOp__41 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y); -static BOOLEAN strings__43 (OPT_Node *x, OPT_Node *y); +static void NewOp__39 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y); +static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y); -static void NewOp__41 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y) +static void NewOp__39 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y) { OPT_Node node = NIL; node = OPT_NewNode(12); @@ -1238,29 +1186,29 @@ static void NewOp__41 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y) *x = node; } -static BOOLEAN strings__43 (OPT_Node *x, OPT_Node *y) +static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) { BOOLEAN _o_result; BOOLEAN ok, xCharArr, yCharArr; - xCharArr = (__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp->form == 3) || *Op__40_s->f == 10; - yCharArr = (__IN((*y)->typ->comp, 0x0c) && (*y)->typ->BaseTyp->form == 3) || *Op__40_s->g == 10; - if ((((xCharArr && *Op__40_s->g == 3)) && (*y)->class == 7)) { + xCharArr = (__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp->form == 3) || *Op__38_s->f == 10; + yCharArr = (__IN((*y)->typ->comp, 0x0c) && (*y)->typ->BaseTyp->form == 3) || *Op__38_s->g == 10; + if ((((xCharArr && *Op__38_s->g == 3)) && (*y)->class == 7)) { OPB_CharToString(*y); - *Op__40_s->g = 10; + *Op__38_s->g = 10; yCharArr = 1; } - if ((((yCharArr && *Op__40_s->f == 3)) && (*x)->class == 7)) { + if ((((yCharArr && *Op__38_s->f == 3)) && (*x)->class == 7)) { OPB_CharToString(*x); - *Op__40_s->f = 10; + *Op__38_s->f = 10; xCharArr = 1; } ok = (xCharArr && yCharArr); if (ok) { - if ((*Op__40_s->f == 10 && (*x)->conval->intval2 == 1)) { + if ((*Op__38_s->f == 10 && (*x)->conval->intval2 == 1)) { (*x)->typ = OPT_chartyp; (*x)->conval->intval = 0; OPB_Index(&*y, OPB_NewIntConst(((LONGINT)(0)))); - } else if ((*Op__40_s->g == 10 && (*y)->conval->intval2 == 1)) { + } else if ((*Op__38_s->g == 10 && (*y)->conval->intval2 == 1)) { (*y)->typ = OPT_chartyp; (*y)->conval->intval = 0; OPB_Index(&*x, OPB_NewIntConst(((LONGINT)(0)))); @@ -1277,11 +1225,11 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPT_Struct typ = NIL; BOOLEAN do_; LONGINT val; - struct Op__40 _s; + struct Op__38 _s; _s.f = &f; _s.g = &g; - _s.lnk = Op__40_s; - Op__40_s = &_s; + _s.lnk = Op__38_s; + Op__38_s = &_s; z = *x; if (((z->class == 8 || z->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); @@ -1393,7 +1341,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) typ = OPT_undftyp; } if (do_) { - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); } break; case 2: @@ -1412,7 +1360,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPB_err(102); typ = OPT_undftyp; } - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); break; case 3: do_ = 1; @@ -1435,7 +1383,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) typ = OPT_undftyp; } if (do_) { - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); } break; case 4: @@ -1453,7 +1401,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPB_err(104); typ = OPT_undftyp; } - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); break; case 5: if (f == 2) { @@ -1463,7 +1411,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } } else if ((y->class == 7 && OPB_IntToBool(y->conval->intval))) { } else { - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); } } else if (f != 0) { OPB_err(94); @@ -1486,7 +1434,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } } if (do_) { - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); } break; case 7: @@ -1495,7 +1443,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) typ = OPT_undftyp; } if ((!__IN(f, 0x70) || y->class != 7) || y->conval->intval != 0) { - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); } break; case 8: @@ -1506,7 +1454,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } } else if ((y->class == 7 && !OPB_IntToBool(y->conval->intval))) { } else { - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); } } else if (f != 0) { OPB_err(95); @@ -1514,16 +1462,16 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 9: case 10: - if (__IN(f, 0x6bff) || strings__43(&z, &y)) { + if (__IN(f, 0x6bff) || strings__41(&z, &y)) { typ = OPT_booltyp; } else { OPB_err(107); typ = OPT_undftyp; } - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); break; case 11: case 12: case 13: case 14: - if (__IN(f, 0x01f9) || strings__43(&z, &y)) { + if (__IN(f, 0x01f9) || strings__41(&z, &y)) { typ = OPT_booltyp; } else { OPM_LogWLn(); @@ -1532,7 +1480,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPB_err(108); typ = OPT_undftyp; } - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); break; default: OPM_LogWStr((CHAR*)"unhandled case in OPB.Op, op = ", (LONGINT)32); @@ -1542,7 +1490,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } } *x = z; - Op__40_s = _s.lnk; + Op__38_s = _s.lnk; } void OPB_SetRange (OPT_Node *x, OPT_Node y) @@ -1894,8 +1842,13 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 10: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((__IN(f, 0x70) && x->typ->size > (int)OPM_SIntSize)) { - OPB_Convert(&x, OPB_IntType(OPB_ShorterSize(x->typ->size))); + } else if (__IN(f, 0x70)) { + typ = OPT_ShorterOrLongerType(x->typ, -1); + if (typ == NIL) { + OPB_err(111); + } else { + OPB_Convert(&x, typ); + } } else if (f == 8) { OPB_Convert(&x, OPT_realtyp); } else { @@ -1905,8 +1858,13 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 11: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((__IN(f, 0x70) && x->typ->size < (int)OPM_LIntSize)) { - OPB_Convert(&x, OPB_IntType(OPB_LongerSize(x->typ->size))); + } else if (__IN(f, 0x70)) { + typ = OPT_ShorterOrLongerType(x->typ, 1); + if (typ == NIL) { + OPB_err(111); + } else { + OPB_Convert(&x, typ); + } } else if (f == 7) { OPB_Convert(&x, OPT_lrltyp); } else if (f == 3) { @@ -2043,13 +2001,13 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) *par0 = x; } -static struct StPar1__56 { - struct StPar1__56 *lnk; -} *StPar1__56_s; +static struct StPar1__52 { + struct StPar1__52 *lnk; +} *StPar1__52_s; -static OPT_Node NewOp__57 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right); +static OPT_Node NewOp__53 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right); -static OPT_Node NewOp__57 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right) +static OPT_Node NewOp__53 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right) { OPT_Node _o_result; OPT_Node node = NIL; @@ -2066,9 +2024,9 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) INTEGER f, L; OPT_Struct typ = NIL; OPT_Node p = NIL, t = NIL; - struct StPar1__56 _s; - _s.lnk = StPar1__56_s; - StPar1__56_s = &_s; + struct StPar1__52 _s; + _s.lnk = StPar1__52_s; + StPar1__52_s = &_s; p = *par0; f = x->typ->form; switch (fctno) { @@ -2084,7 +2042,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) OPB_err(111); } } - p = NewOp__57(19, fctno, p, x); + p = NewOp__53(19, fctno, p, x); p->typ = OPT_notyp; } break; @@ -2095,7 +2053,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > (int)OPM_MaxSet))) { OPB_err(202); } - p = NewOp__57(19, fctno, p, x); + p = NewOp__53(19, fctno, p, x); } else { OPB_err(111); } @@ -2120,7 +2078,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) p = p->left; x->conval->intval += 1; } - p = NewOp__57(12, 19, p, x); + p = NewOp__53(12, 19, p, x); p->typ = OPT_linttyp; } else { p = x; @@ -2142,7 +2100,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) t = x; x = p; p = t; - p = NewOp__57(19, 18, p, x); + p = NewOp__53(19, 18, p, x); } else { OPB_err(111); } @@ -2168,7 +2126,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) } p->obj = NIL; } else { - p = NewOp__57(12, 17, p, x); + p = NewOp__53(12, 17, p, x); p->typ = OPT_linttyp; } } else { @@ -2199,9 +2157,9 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) OPB_err(111); } else { if (fctno == 22) { - p = NewOp__57(12, 27, p, x); + p = NewOp__53(12, 27, p, x); } else { - p = NewOp__57(12, 28, p, x); + p = NewOp__53(12, 28, p, x); } p->typ = p->left->typ; } @@ -2218,7 +2176,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) x = p; p = t; } - p = NewOp__57(19, fctno, p, x); + p = NewOp__53(19, fctno, p, x); } else { OPB_err(111); } @@ -2228,7 +2186,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (__IN(f, 0x70)) { - p = NewOp__57(12, 26, p, x); + p = NewOp__53(12, 26, p, x); } else { OPB_err(111); } @@ -2252,7 +2210,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (__IN(f, 0x70)) { - p = NewOp__57(19, 30, p, x); + p = NewOp__53(19, 30, p, x); } else { OPB_err(111); } @@ -2298,7 +2256,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) break; } *par0 = p; - StPar1__56_s = _s.lnk; + StPar1__52_s = _s.lnk; } void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n) diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index e7a96131..81b3745b 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 02a24b4d..8a3a54cf 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "OPM.h" diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index 7aea7283..dcd53d63 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 88c3bd4d..65ebb8b0 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index 3c2be746..a61c632e 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index a0c19958..5620c5ec 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPB.h" #include "OPM.h" @@ -24,7 +24,7 @@ export LONGINT *OPP__1__typ; static void OPP_ActualParameters (OPT_Node *aparlist, OPT_Object fpar); static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned); static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq); -static void OPP_CaseLabelList (OPT_Node *lab, INTEGER LabelForm, INTEGER *n, OPP_CaseTable tab); +static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, OPP_CaseTable tab); static void OPP_CheckMark (SHORTINT *vis); static void OPP_CheckSym (INTEGER s); static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_); @@ -1163,7 +1163,7 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) ProcedureDeclaration__16_s = _s.lnk; } -static void OPP_CaseLabelList (OPT_Node *lab, INTEGER LabelForm, INTEGER *n, OPP_CaseTable tab) +static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, OPP_CaseTable tab) { OPT_Node x = NIL, y = NIL, lastlab = NIL; INTEGER i, f; @@ -1180,10 +1180,10 @@ static void OPP_CaseLabelList (OPT_Node *lab, INTEGER LabelForm, INTEGER *n, OPP xval = 1; } if (__IN(f, 0x70)) { - if (LabelForm < f) { + if (!__IN(LabelTyp->form, 0x70) || LabelTyp->size < x->typ->size) { OPP_err(60); } - } else if (LabelForm != f) { + } else if ((int)LabelTyp->form != f) { OPP_err(60); } if (OPP_sym == 21) { @@ -1262,7 +1262,7 @@ static void CasePart__31 (OPT_Node *x) n = 0; for (;;) { if (OPP_sym < 40) { - OPP_CaseLabelList(&lab, (*x)->typ->form, &n, tab); + OPP_CaseLabelList(&lab, (*x)->typ, &n, tab); OPP_CheckSym(20); OPP_StatSeq(&y); OPB_Construct(17, &lab, y); @@ -1471,7 +1471,7 @@ static void OPP_StatSeq (OPT_Node *stat) SetPos__35(z); OPB_Link(&*stat, &last, z); y = OPB_NewLeaf(t); - } else if (y->typ->form < 4 || y->typ->form > x->left->typ->form) { + } else if (!__IN(y->typ->form, 0x70) || y->typ->size > x->left->typ->size) { OPP_err(113); } OPB_Link(&*stat, &last, x); diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index 6c24817c..be6b6252 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index 85c8b275..1f721944 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index 313c0ac7..ecd93034 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index cbd147e6..8efa4803 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" @@ -84,11 +84,11 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; -static OPT_Object OPT_LIntObj; export SHORTINT OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; export BOOLEAN OPT_SYSimported; +static OPT_Struct OPT_IntTypes[20]; static OPT_Object OPT_universe, OPT_syslink; static OPT_ImpCtxt OPT_impCtxt; static OPT_ExpCtxt OPT_expCtxt; @@ -106,7 +106,6 @@ export void OPT_Close (void); export void OPT_CloseScope (void); static void OPT_DebugStruct (OPT_Struct btyp); static void OPT_EnterBoolConst (OPS_Name name, LONGINT value); -static void OPT_EnterDerivedType (OPS_Name name, OPT_Struct typ, OPT_Object *obj); static void OPT_EnterProc (OPS_Name name, INTEGER num); static void OPT_EnterTyp (OPS_Name name, SHORTINT form, INTEGER size, OPT_Struct *res); export void OPT_Export (BOOLEAN *ext, BOOLEAN *new); @@ -128,10 +127,12 @@ static OPT_Object OPT_InObj (SHORTINT mno); static void OPT_InSign (SHORTINT mno, OPT_Struct *res, OPT_Object *par); static void OPT_InStruct (OPT_Struct *typ); static OPT_Object OPT_InTProc (SHORTINT mno); +static OPT_Struct OPT_InTyp (LONGINT tag); export void OPT_Init (OPS_Name name, SET opt); static void OPT_InitStruct (OPT_Struct *typ, SHORTINT form); export void OPT_Insert (OPS_Name name, OPT_Object *obj); export void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); +export OPT_Struct OPT_IntType (LONGINT size); export OPT_Const OPT_NewConst (void); export OPT_ConstExt OPT_NewExt (void); export OPT_Node OPT_NewNode (SHORTINT class); @@ -147,6 +148,7 @@ static void OPT_OutObj (OPT_Object obj); static void OPT_OutSign (OPT_Struct result, OPT_Object par); static void OPT_OutStr (OPT_Struct typ); static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj); +export OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir); static void OPT_err (INTEGER n); @@ -155,6 +157,34 @@ static void OPT_err (INTEGER n) OPM_err(n); } +OPT_Struct OPT_IntType (LONGINT size) +{ + OPT_Struct _o_result; + INTEGER i; + i = 1; + while ((OPT_IntTypes[__X(i, ((LONGINT)(20)))]->size < size && OPT_IntTypes[__X(i + 1, ((LONGINT)(20)))] != NIL)) { + i += 1; + } + _o_result = OPT_IntTypes[__X(i, ((LONGINT)(20)))]; + return _o_result; +} + +OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir) +{ + OPT_Struct _o_result; + INTEGER i; + __ASSERT(__IN(x->form, 0x70), 0); + __ASSERT(dir == 1 || dir == -1, 0); + __ASSERT(x->BaseTyp == OPT_undftyp, 0); + i = 0; + while ((OPT_IntTypes[__X(i, ((LONGINT)(20)))] != x && i < 20)) { + i += 1; + } + __ASSERT(i < 19, 0); + _o_result = OPT_IntTypes[__X(i + dir, ((LONGINT)(20)))]; + return _o_result; +} + OPT_Const OPT_NewConst (void) { OPT_Const _o_result; @@ -467,21 +497,21 @@ void OPT_IdFPrint (OPT_Struct typ) } } -static struct FPrintStr__13 { +static struct FPrintStr__12 { LONGINT *pbfp, *pvfp; - struct FPrintStr__13 *lnk; -} *FPrintStr__13_s; + struct FPrintStr__12 *lnk; +} *FPrintStr__12_s; -static void FPrintFlds__14 (OPT_Object fld, LONGINT adr, BOOLEAN visible); -static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, LONGINT adr); -static void FPrintTProcs__18 (OPT_Object obj); +static void FPrintFlds__13 (OPT_Object fld, LONGINT adr, BOOLEAN visible); +static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr); +static void FPrintTProcs__17 (OPT_Object obj); -static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, LONGINT adr) +static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr) { LONGINT i, j, n; OPT_Struct btyp = NIL; if (typ->comp == 4) { - FPrintFlds__14(typ->link, adr, 0); + FPrintFlds__13(typ->link, adr, 0); } else if (typ->comp == 2) { btyp = typ->BaseTyp; n = typ->n; @@ -491,53 +521,53 @@ static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, LONGINT adr) } if (btyp->form == 13 || btyp->comp == 4) { j = OPT_nofhdfld; - FPrintHdFld__16(btyp, fld, adr); + FPrintHdFld__15(btyp, fld, adr); if (j != OPT_nofhdfld) { i = 1; while ((i < n && OPT_nofhdfld <= 2048)) { adr += btyp->size; - FPrintHdFld__16(btyp, fld, adr); + FPrintHdFld__15(btyp, fld, adr); i += 1; } } } } else if (typ->form == 13 || __STRCMP(fld->name, "@ptr") == 0) { - OPM_FPrint(&*FPrintStr__13_s->pvfp, ((LONGINT)(13))); - OPM_FPrint(&*FPrintStr__13_s->pvfp, adr); + OPM_FPrint(&*FPrintStr__12_s->pvfp, ((LONGINT)(13))); + OPM_FPrint(&*FPrintStr__12_s->pvfp, adr); OPT_nofhdfld += 1; } } -static void FPrintFlds__14 (OPT_Object fld, LONGINT adr, BOOLEAN visible) +static void FPrintFlds__13 (OPT_Object fld, LONGINT adr, BOOLEAN visible) { while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { - OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->vis); - OPT_FPrintName(&*FPrintStr__13_s->pbfp, (void*)fld->name, ((LONGINT)(256))); - OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->adr); + OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->vis); + OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)fld->name, ((LONGINT)(256))); + OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->adr); OPT_FPrintStr(fld->typ); - OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->typ->pbfp); - OPM_FPrint(&*FPrintStr__13_s->pvfp, fld->typ->pvfp); + OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->typ->pbfp); + OPM_FPrint(&*FPrintStr__12_s->pvfp, fld->typ->pvfp); } else { - FPrintHdFld__16(fld->typ, fld, fld->adr + adr); + FPrintHdFld__15(fld->typ, fld, fld->adr + adr); } fld = fld->link; } } -static void FPrintTProcs__18 (OPT_Object obj) +static void FPrintTProcs__17 (OPT_Object obj) { if (obj != NIL) { - FPrintTProcs__18(obj->left); + FPrintTProcs__17(obj->left); if (obj->mode == 13) { if (obj->vis != 0) { - OPM_FPrint(&*FPrintStr__13_s->pbfp, ((LONGINT)(13))); - OPM_FPrint(&*FPrintStr__13_s->pbfp, __ASHR(obj->adr, 16)); - OPT_FPrintSign(&*FPrintStr__13_s->pbfp, obj->typ, obj->link); - OPT_FPrintName(&*FPrintStr__13_s->pbfp, (void*)obj->name, ((LONGINT)(256))); + OPM_FPrint(&*FPrintStr__12_s->pbfp, ((LONGINT)(13))); + OPM_FPrint(&*FPrintStr__12_s->pbfp, __ASHR(obj->adr, 16)); + OPT_FPrintSign(&*FPrintStr__12_s->pbfp, obj->typ, obj->link); + OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)obj->name, ((LONGINT)(256))); } } - FPrintTProcs__18(obj->right); + FPrintTProcs__17(obj->right); } } @@ -547,11 +577,11 @@ void OPT_FPrintStr (OPT_Struct typ) OPT_Struct btyp = NIL; OPT_Object strobj = NIL, bstrobj = NIL; LONGINT pbfp, pvfp; - struct FPrintStr__13 _s; + struct FPrintStr__12 _s; _s.pbfp = &pbfp; _s.pvfp = &pvfp; - _s.lnk = FPrintStr__13_s; - FPrintStr__13_s = &_s; + _s.lnk = FPrintStr__12_s; + FPrintStr__12_s = &_s; if (!typ->fpdone) { OPT_IdFPrint(typ); pbfp = typ->idfp; @@ -588,11 +618,11 @@ void OPT_FPrintStr (OPT_Struct typ) OPM_FPrint(&pvfp, typ->align); OPM_FPrint(&pvfp, typ->n); OPT_nofhdfld = 0; - FPrintFlds__14(typ->link, ((LONGINT)(0)), 1); + FPrintFlds__13(typ->link, ((LONGINT)(0)), 1); if (OPT_nofhdfld > 2048) { OPM_Mark(225, typ->txtpos); } - FPrintTProcs__18(typ->link); + FPrintTProcs__17(typ->link); OPM_FPrint(&pvfp, pbfp); strobj = typ->strobj; if (strobj == NIL || strobj->name[0] == 0x00) { @@ -602,7 +632,7 @@ void OPT_FPrintStr (OPT_Struct typ) typ->pbfp = pbfp; typ->pvfp = pvfp; } - FPrintStr__13_s = _s.lnk; + FPrintStr__12_s = _s.lnk; } void OPT_FPrintObj (OPT_Object obj) @@ -946,6 +976,19 @@ static OPT_Object OPT_InTProc (SHORTINT mno) return _o_result; } +static OPT_Struct OPT_InTyp (LONGINT tag) +{ + OPT_Struct _o_result; + if (__IN(tag, 0x70)) { + _o_result = OPT_IntType(OPM_SymRInt()); + return _o_result; + } else { + _o_result = OPT_impCtxt.ref[__X(tag, ((LONGINT)(255)))]; + return _o_result; + } + __RETCHK; +} + static void OPT_InStruct (OPT_Struct *typ) { SHORTINT mno; @@ -956,7 +999,7 @@ static void OPT_InStruct (OPT_Struct *typ) OPT_Object obj = NIL, last = NIL, fld = NIL, old = NIL, dummy = NIL; tag = OPM_SymRInt(); if (tag != 34) { - *typ = OPT_impCtxt.ref[__X(-tag, ((LONGINT)(255)))]; + *typ = OPT_InTyp(-tag); } else { ref = OPT_impCtxt.nofr; OPT_impCtxt.nofr += 1; @@ -1081,7 +1124,7 @@ static void OPT_InStruct (OPT_Struct *typ) } if (ref == OPT_impCtxt.minr) { while (ref < OPT_impCtxt.nofr) { - t = OPT_impCtxt.ref[__X(ref, ((LONGINT)(255)))]; + t = OPT_InTyp(ref); OPT_FPrintStr(t); obj = t->strobj; if (obj->name[0] != 0x00) { @@ -1150,9 +1193,9 @@ static OPT_Object OPT_InObj (SHORTINT mno) obj->vis = 1; if (tag <= 13) { obj->mode = 3; - obj->typ = OPT_impCtxt.ref[__X(tag, ((LONGINT)(255)))]; obj->conval = OPT_NewConst(); OPT_InConstant(tag, obj->conval); + obj->typ = OPT_InTyp(tag); } else if (tag >= 31) { obj->conval = OPT_NewConst(); obj->conval->intval = -1; @@ -1396,6 +1439,9 @@ static void OPT_OutStr (OPT_Struct typ) OPT_Object strobj = NIL; if (typ->ref < OPT_expCtxt.ref) { OPM_SymWInt(-typ->ref); + if (__IN(typ->ref, 0x70)) { + OPM_SymWInt(typ->size); + } } else { OPM_SymWInt(((LONGINT)(34))); typ->ref = OPT_expCtxt.ref; @@ -1493,6 +1539,7 @@ static void OPT_OutConstant (OPT_Object obj) break; case 4: case 5: case 6: OPM_SymWInt(obj->conval->intval); + OPM_SymWInt(obj->typ->size); break; case 9: OPM_SymWSet(obj->conval->setval); @@ -1699,15 +1746,6 @@ static void OPT_EnterTyp (OPS_Name name, SHORTINT form, INTEGER size, OPT_Struct *res = typ; } -static void OPT_EnterDerivedType (OPS_Name name, OPT_Struct typ, OPT_Object *obj) -{ - OPS_Name name__copy; - __DUPARR(name, OPS_Name); - OPT_Insert(name, &*obj); - (*obj)->mode = 5; - (*obj)->typ = typ; -} - static void OPT_EnterProc (OPS_Name name, INTEGER num) { OPT_Object obj = NIL; @@ -1741,8 +1779,8 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_niltyp); P(OPT_notyp); P(OPT_sysptrtyp); - P(OPT_LIntObj); __ENUMP(OPT_GlbMod, 64, P); + __ENUMP(OPT_IntTypes, 20, P); P(OPT_universe); P(OPT_syslink); __ENUMR(&OPT_impCtxt, OPT_ImpCtxt__typ, 3140, 1, P); @@ -1811,7 +1849,7 @@ export void *OPT__init(void) OPT_InitStruct(&OPT_niltyp, 11); OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp); OPT_EnterTyp((CHAR*)"PTR", 13, OPM_PointerSize, &OPT_sysptrtyp); - OPT_EnterTyp((CHAR*)"ADRINT", 5, OPM_LIntSize, &OPT_ainttyp); + OPT_EnterTyp((CHAR*)"ADRINT", 5, OPM_PointerSize, &OPT_ainttyp); OPT_EnterTyp((CHAR*)"INT8", 5, 1, &OPT_int8typ); OPT_EnterTyp((CHAR*)"INT16", 5, 2, &OPT_int16typ); OPT_EnterTyp((CHAR*)"INT32", 5, 4, &OPT_int32typ); @@ -1839,7 +1877,6 @@ export void *OPT__init(void) OPT_EnterTyp((CHAR*)"LONGINT", 6, OPM_LIntSize, &OPT_linttyp); OPT_EnterTyp((CHAR*)"LONGREAL", 8, OPM_LRealSize, &OPT_lrltyp); OPT_EnterTyp((CHAR*)"SHORTINT", 4, OPM_SIntSize, &OPT_sinttyp); - OPT_EnterDerivedType((CHAR*)"LINT", OPT_int64typ, &OPT_LIntObj); OPT_EnterBoolConst((CHAR*)"FALSE", ((LONGINT)(0))); OPT_EnterBoolConst((CHAR*)"TRUE", ((LONGINT)(1))); OPT_EnterProc((CHAR*)"HALT", 0); @@ -1877,5 +1914,12 @@ export void *OPT__init(void) OPT_impCtxt.ref[11] = OPT_niltyp; OPT_impCtxt.ref[12] = OPT_notyp; OPT_impCtxt.ref[13] = OPT_sysptrtyp; + OPT_IntTypes[1] = OPT_sinttyp; + OPT_IntTypes[2] = OPT_inttyp; + OPT_IntTypes[3] = OPT_linttyp; + OPT_IntTypes[5] = OPT_int8typ; + OPT_IntTypes[6] = OPT_int16typ; + OPT_IntTypes[7] = OPT_int32typ; + OPT_IntTypes[8] = OPT_int64typ; __ENDMOD; } diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index c4975398..f6206e42 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h @@ -92,12 +92,14 @@ import void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); import void OPT_Init (OPS_Name name, SET opt); import void OPT_Insert (OPS_Name name, OPT_Object *obj); import void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); +import OPT_Struct OPT_IntType (LONGINT size); import OPT_Const OPT_NewConst (void); import OPT_ConstExt OPT_NewExt (void); import OPT_Node OPT_NewNode (SHORTINT class); import OPT_Object OPT_NewObj (void); import OPT_Struct OPT_NewStr (SHORTINT form, SHORTINT comp); import void OPT_OpenScope (SHORTINT level, OPT_Object owner); +import OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir); import void *OPT__init(void); diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index 2172dee5..03b675a9 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPC.h" #include "OPM.h" diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index 122fda4a..6926d6ac 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 6326549f..9e1c6dfd 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index 77a9b68f..b890523b 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 11c99924..4ee29f7d 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index b0497a9c..0a81ebf4 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/SYSTEM.h b/bootstrap/unix-44/SYSTEM.h index 35620b9b..343404a4 100644 --- a/bootstrap/unix-44/SYSTEM.h +++ b/bootstrap/unix-44/SYSTEM.h @@ -60,12 +60,6 @@ typedef float REAL; typedef double LONGREAL; typedef void* SYSTEM_PTR; -// Unsigned variants are for use by shift and rotate macros. - -typedef unsigned char U_SYSTEM_BYTE; -typedef unsigned char U_CHAR; -typedef unsigned char U_SHORTINT; - // For 32 bit builds, the size of LONGINT depends on a make option: #if (__SIZEOF_POINTER__ == 8) || defined(LARGE) || defined(_WIN64) @@ -80,9 +74,20 @@ typedef unsigned char U_SHORTINT; typedef unsigned long U_LONGINT; #endif +// Unsigned variants are for use by shift and rotate macros. + +typedef unsigned char U_SYSTEM_BYTE; +typedef unsigned char U_CHAR; +typedef unsigned char U_SHORTINT; + typedef U_LONGINT SET; typedef U_LONGINT U_SET; +typedef SYSTEM_CARD8 U_SYSTEM_INT8; +typedef SYSTEM_CARD16 U_SYSTEM_INT16; +typedef SYSTEM_CARD32 U_SYSTEM_INT32; +typedef SYSTEM_CARD64 U_SYSTEM_INT64; + // OS Memory allocation interfaces are in PlatformXXX.Mod @@ -178,7 +183,7 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __ABSFD(x) SYSTEM_ABSD((double)(x)) #define __CAP(ch) ((CHAR)((ch)&0x5f)) #define __ODD(x) ((x)&1) -#define __IN(x, s) (((s)>>(x))&1) +#define __IN(x, s) ((x)>=0 && (x)<(8*sizeof(SET)) && ((((U_SET)(s))>>(x))&1)) #define __SETOF(x) ((SET)1<<(x)) #define __SETRNG(l, h) ((~(SET)0<<(l))&~(SET)0>>(8*sizeof(SET)-1-(h))) #define __MASK(x, m) ((x)&~(m)) diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index 15aeff29..0c372b8b 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index 385096bc..0dbfdb8e 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index 52012a3c..41ad5883 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Files.h" #include "Modules.h" diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index 9a5617f1..f5aabe8a 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/Vishap.c b/bootstrap/unix-44/Vishap.c index 66a97f5d..e8b1e4d1 100644 --- a/bootstrap/unix-44/Vishap.c +++ b/bootstrap/unix-44/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkamSf */ #include "SYSTEM.h" #include "Configuration.h" #include "Heap.h" diff --git a/bootstrap/unix-44/errors.c b/bootstrap/unix-44/errors.c index 59b8db27..a8573f9a 100644 --- a/bootstrap/unix-44/errors.c +++ b/bootstrap/unix-44/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/unix-44/errors.h b/bootstrap/unix-44/errors.h index 6ae0cd7a..6dfe7b1d 100644 --- a/bootstrap/unix-44/errors.h +++ b/bootstrap/unix-44/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index 2ef65e7b..d2141803 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index 39837586..38d2da7b 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-44/vt100.c b/bootstrap/unix-44/vt100.c index e0edabd9..5eb4f70e 100644 --- a/bootstrap/unix-44/vt100.c +++ b/bootstrap/unix-44/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Strings.h" diff --git a/bootstrap/unix-44/vt100.h b/bootstrap/unix-44/vt100.h index 413ae867..770cf66d 100644 --- a/bootstrap/unix-44/vt100.h +++ b/bootstrap/unix-44/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index b0d48f0a..947863a2 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -13,6 +13,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/08/26] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/08/30] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index 38a63260..33303334 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Console.c b/bootstrap/unix-48/Console.c index cc4cc8bd..375896e6 100644 --- a/bootstrap/unix-48/Console.c +++ b/bootstrap/unix-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Platform.h" diff --git a/bootstrap/unix-48/Console.h b/bootstrap/unix-48/Console.h index 2c462da9..0e7cb823 100644 --- a/bootstrap/unix-48/Console.h +++ b/bootstrap/unix-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 496a4a87..069b901c 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index bc1d11eb..7241c31a 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index cca2fc74..5fcaf193 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tskSfF */ #include "SYSTEM.h" struct Heap__1 { diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index d05f688c..4247d33d 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index d76a50a2..148c062a 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Heap.h" diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index 78c8d49e..85b1ec59 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index 60b37750..9a06ac24 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" @@ -34,9 +34,7 @@ export void OPB_In (OPT_Node *x, OPT_Node y); export void OPB_Index (OPT_Node *x, OPT_Node y); export void OPB_Inittd (OPT_Node *inittd, OPT_Node *last, OPT_Struct typ); static BOOLEAN OPB_IntToBool (LONGINT i); -static OPT_Struct OPB_IntType (LONGINT size); export void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y); -static LONGINT OPB_LongerSize (LONGINT i); export void OPB_MOp (SHORTINT op, OPT_Node *x); export OPT_Node OPB_NewBoolConst (BOOLEAN boolval); export OPT_Node OPB_NewIntConst (LONGINT intval); @@ -53,8 +51,6 @@ export void OPB_Return (OPT_Node *x, OPT_Object proc); export void OPB_SetElem (OPT_Node *x); static void OPB_SetIntType (OPT_Node node); export void OPB_SetRange (OPT_Node *x, OPT_Node y); -static LONGINT OPB_ShorterSize (LONGINT i); -static INTEGER OPB_SignedByteSize (LONGINT n); export void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno); export void OPB_StPar0 (OPT_Node *par0, INTEGER fctno); export void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno); @@ -224,68 +220,20 @@ OPT_Node OPB_EmptySet (void) return _o_result; } -static INTEGER OPB_SignedByteSize (LONGINT n) +static void OPB_SetIntType (OPT_Node node) { - INTEGER _o_result; INTEGER b; - if (n < 0) { - n = -(n + 1); + LONGINT n; + if (node->conval->intval >= 0) { + n = node->conval->intval; + } else { + n = -(node->conval->intval + 1); } b = 1; while ((b < 8 && __ASH(n, -(__ASHL(b, 3) - 1)) != 0)) { b += 1; } - _o_result = b; - return _o_result; -} - -static LONGINT OPB_ShorterSize (LONGINT i) -{ - LONGINT _o_result; - if (i >= (int)OPM_LIntSize) { - _o_result = OPM_IntSize; - return _o_result; - } else { - _o_result = OPM_SIntSize; - return _o_result; - } - __RETCHK; -} - -static LONGINT OPB_LongerSize (LONGINT i) -{ - LONGINT _o_result; - if (i <= (int)OPM_SIntSize) { - _o_result = OPM_IntSize; - return _o_result; - } else { - _o_result = OPM_LIntSize; - return _o_result; - } - __RETCHK; -} - -static OPT_Struct OPB_IntType (LONGINT size) -{ - OPT_Struct _o_result; - OPT_Struct result = NIL; - if (size <= OPT_sinttyp->size) { - result = OPT_sinttyp; - } else if (size <= OPT_inttyp->size) { - result = OPT_inttyp; - } else { - result = OPT_linttyp; - } - if (size > OPT_linttyp->size) { - OPB_err(203); - } - _o_result = result; - return _o_result; -} - -static void OPB_SetIntType (OPT_Node node) -{ - node->typ = OPB_IntType(OPB_SignedByteSize(node->conval->intval)); + node->typ = OPT_IntType(b); } OPT_Node OPB_NewIntConst (LONGINT intval) @@ -429,16 +377,16 @@ void OPB_Field (OPT_Node *x, OPT_Object y) } } -static struct TypTest__61 { +static struct TypTest__57 { OPT_Node *x; OPT_Object *obj; BOOLEAN *guard; - struct TypTest__61 *lnk; -} *TypTest__61_s; + struct TypTest__57 *lnk; +} *TypTest__57_s; -static void GTT__62 (OPT_Struct t0, OPT_Struct t1); +static void GTT__58 (OPT_Struct t0, OPT_Struct t1); -static void GTT__62 (OPT_Struct t0, OPT_Struct t1) +static void GTT__58 (OPT_Struct t0, OPT_Struct t1) { OPT_Node node = NIL; OPT_Struct t = NIL; @@ -451,54 +399,54 @@ static void GTT__62 (OPT_Struct t0, OPT_Struct t1) t1 = t1->BaseTyp; } if (t1 == t0 || t0->form == 0) { - if (*TypTest__61_s->guard) { - OPB_BindNodes(5, NIL, &*TypTest__61_s->x, NIL); - (*TypTest__61_s->x)->readonly = (*TypTest__61_s->x)->left->readonly; + if (*TypTest__57_s->guard) { + OPB_BindNodes(5, NIL, &*TypTest__57_s->x, NIL); + (*TypTest__57_s->x)->readonly = (*TypTest__57_s->x)->left->readonly; } else { node = OPT_NewNode(11); node->subcl = 16; - node->left = *TypTest__61_s->x; - node->obj = *TypTest__61_s->obj; - *TypTest__61_s->x = node; + node->left = *TypTest__57_s->x; + node->obj = *TypTest__57_s->obj; + *TypTest__57_s->x = node; } } else { OPB_err(85); } } else if (t0 != t1) { OPB_err(85); - } else if (!*TypTest__61_s->guard) { - if ((*TypTest__61_s->x)->class == 5) { + } else if (!*TypTest__57_s->guard) { + if ((*TypTest__57_s->x)->class == 5) { node = OPT_NewNode(11); node->subcl = 16; - node->left = *TypTest__61_s->x; - node->obj = *TypTest__61_s->obj; - *TypTest__61_s->x = node; + node->left = *TypTest__57_s->x; + node->obj = *TypTest__57_s->obj; + *TypTest__57_s->x = node; } else { - *TypTest__61_s->x = OPB_NewBoolConst(1); + *TypTest__57_s->x = OPB_NewBoolConst(1); } } } void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) { - struct TypTest__61 _s; + struct TypTest__57 _s; _s.x = x; _s.obj = &obj; _s.guard = &guard; - _s.lnk = TypTest__61_s; - TypTest__61_s = &_s; + _s.lnk = TypTest__57_s; + TypTest__57_s = &_s; if (OPB_NotVar(*x)) { OPB_err(112); } else if ((*x)->typ->form == 13) { if (((*x)->typ->BaseTyp->comp != 4 && (*x)->typ != OPT_sysptrtyp)) { OPB_err(85); } else if (obj->typ->form == 13) { - GTT__62((*x)->typ->BaseTyp, obj->typ->BaseTyp); + GTT__58((*x)->typ->BaseTyp, obj->typ->BaseTyp); } else { OPB_err(86); } } else if (((((*x)->typ->comp == 4 && (*x)->class == 1)) && obj->typ->comp == 4)) { - GTT__62((*x)->typ, obj->typ); + GTT__58((*x)->typ, obj->typ); } else { OPB_err(87); } @@ -507,7 +455,7 @@ void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) } else { (*x)->typ = OPT_booltyp; } - TypTest__61_s = _s.lnk; + TypTest__57_s = _s.lnk; } void OPB_In (OPT_Node *x, OPT_Node y) @@ -573,13 +521,13 @@ static void OPB_CheckRealType (INTEGER f, INTEGER nr, OPT_Const x) x->intval = -1; } -static struct MOp__30 { - struct MOp__30 *lnk; -} *MOp__30_s; +static struct MOp__28 { + struct MOp__28 *lnk; +} *MOp__28_s; -static OPT_Node NewOp__31 (SHORTINT op, OPT_Struct typ, OPT_Node z); +static OPT_Node NewOp__29 (SHORTINT op, OPT_Struct typ, OPT_Node z); -static OPT_Node NewOp__31 (SHORTINT op, OPT_Struct typ, OPT_Node z) +static OPT_Node NewOp__29 (SHORTINT op, OPT_Struct typ, OPT_Node z) { OPT_Node _o_result; OPT_Node node = NIL; @@ -596,9 +544,9 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) INTEGER f; OPT_Struct typ = NIL; OPT_Node z = NIL; - struct MOp__30 _s; - _s.lnk = MOp__30_s; - MOp__30_s = &_s; + struct MOp__28 _s; + _s.lnk = MOp__28_s; + MOp__28_s = &_s; z = *x; if (z->class == 8 || z->class == 9) { OPB_err(126); @@ -612,7 +560,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->conval->intval = OPB_BoolToInt(!OPB_IntToBool(z->conval->intval)); z->obj = NIL; } else { - z = NewOp__31(op, typ, z); + z = NewOp__29(op, typ, z); } } else { OPB_err(98); @@ -640,7 +588,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } z->obj = NIL; } else { - z = NewOp__31(op, typ, z); + z = NewOp__29(op, typ, z); } } else { OPB_err(97); @@ -661,7 +609,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } z->obj = NIL; } else { - z = NewOp__31(op, typ, z); + z = NewOp__29(op, typ, z); } } else { OPB_err(111); @@ -673,7 +621,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->conval->intval = (int)__CAP((CHAR)z->conval->intval); z->obj = NIL; } else { - z = NewOp__31(op, typ, z); + z = NewOp__29(op, typ, z); } } else { OPB_err(111); @@ -686,7 +634,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->conval->intval = OPB_BoolToInt(__ODD(z->conval->intval)); z->obj = NIL; } else { - z = NewOp__31(op, typ, z); + z = NewOp__29(op, typ, z); } } else { OPB_err(111); @@ -699,7 +647,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) f = 10; } if (z->class < 7 || f == 10) { - z = NewOp__31(op, typ, z); + z = NewOp__29(op, typ, z); } else { OPB_err(127); } @@ -708,7 +656,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) case 25: if ((__IN(f, 0x70) && z->class == 7)) { if ((0 <= z->conval->intval && z->conval->intval <= -1)) { - z = NewOp__31(op, typ, z); + z = NewOp__29(op, typ, z); } else { OPB_err(219); } @@ -725,7 +673,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } } *x = z; - MOp__30_s = _s.lnk; + MOp__28_s = _s.lnk; } static void OPB_CheckPtr (OPT_Node x, OPT_Node y) @@ -921,7 +869,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) if (x->typ->size <= y->typ->size) { x->typ = y->typ; } else { - x->typ = OPB_IntType(x->typ->size); + x->typ = OPT_IntType(x->typ->size); } } else if (g == 7) { x->typ = OPT_realtyp; @@ -1178,7 +1126,7 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) if (__IN(g, 0x70)) { if (f > g) { OPB_SetIntType(*x); - if ((int)(*x)->typ->form > g) { + if ((*x)->typ->size > typ->size) { OPB_err(203); (*x)->conval->intval = 1; } @@ -1219,15 +1167,15 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) (*x)->typ = typ; } -static struct Op__40 { +static struct Op__38 { INTEGER *f, *g; - struct Op__40 *lnk; -} *Op__40_s; + struct Op__38 *lnk; +} *Op__38_s; -static void NewOp__41 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y); -static BOOLEAN strings__43 (OPT_Node *x, OPT_Node *y); +static void NewOp__39 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y); +static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y); -static void NewOp__41 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y) +static void NewOp__39 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y) { OPT_Node node = NIL; node = OPT_NewNode(12); @@ -1238,29 +1186,29 @@ static void NewOp__41 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y) *x = node; } -static BOOLEAN strings__43 (OPT_Node *x, OPT_Node *y) +static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) { BOOLEAN _o_result; BOOLEAN ok, xCharArr, yCharArr; - xCharArr = (__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp->form == 3) || *Op__40_s->f == 10; - yCharArr = (__IN((*y)->typ->comp, 0x0c) && (*y)->typ->BaseTyp->form == 3) || *Op__40_s->g == 10; - if ((((xCharArr && *Op__40_s->g == 3)) && (*y)->class == 7)) { + xCharArr = (__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp->form == 3) || *Op__38_s->f == 10; + yCharArr = (__IN((*y)->typ->comp, 0x0c) && (*y)->typ->BaseTyp->form == 3) || *Op__38_s->g == 10; + if ((((xCharArr && *Op__38_s->g == 3)) && (*y)->class == 7)) { OPB_CharToString(*y); - *Op__40_s->g = 10; + *Op__38_s->g = 10; yCharArr = 1; } - if ((((yCharArr && *Op__40_s->f == 3)) && (*x)->class == 7)) { + if ((((yCharArr && *Op__38_s->f == 3)) && (*x)->class == 7)) { OPB_CharToString(*x); - *Op__40_s->f = 10; + *Op__38_s->f = 10; xCharArr = 1; } ok = (xCharArr && yCharArr); if (ok) { - if ((*Op__40_s->f == 10 && (*x)->conval->intval2 == 1)) { + if ((*Op__38_s->f == 10 && (*x)->conval->intval2 == 1)) { (*x)->typ = OPT_chartyp; (*x)->conval->intval = 0; OPB_Index(&*y, OPB_NewIntConst(((LONGINT)(0)))); - } else if ((*Op__40_s->g == 10 && (*y)->conval->intval2 == 1)) { + } else if ((*Op__38_s->g == 10 && (*y)->conval->intval2 == 1)) { (*y)->typ = OPT_chartyp; (*y)->conval->intval = 0; OPB_Index(&*x, OPB_NewIntConst(((LONGINT)(0)))); @@ -1277,11 +1225,11 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPT_Struct typ = NIL; BOOLEAN do_; LONGINT val; - struct Op__40 _s; + struct Op__38 _s; _s.f = &f; _s.g = &g; - _s.lnk = Op__40_s; - Op__40_s = &_s; + _s.lnk = Op__38_s; + Op__38_s = &_s; z = *x; if (((z->class == 8 || z->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); @@ -1393,7 +1341,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) typ = OPT_undftyp; } if (do_) { - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); } break; case 2: @@ -1412,7 +1360,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPB_err(102); typ = OPT_undftyp; } - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); break; case 3: do_ = 1; @@ -1435,7 +1383,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) typ = OPT_undftyp; } if (do_) { - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); } break; case 4: @@ -1453,7 +1401,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPB_err(104); typ = OPT_undftyp; } - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); break; case 5: if (f == 2) { @@ -1463,7 +1411,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } } else if ((y->class == 7 && OPB_IntToBool(y->conval->intval))) { } else { - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); } } else if (f != 0) { OPB_err(94); @@ -1486,7 +1434,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } } if (do_) { - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); } break; case 7: @@ -1495,7 +1443,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) typ = OPT_undftyp; } if ((!__IN(f, 0x70) || y->class != 7) || y->conval->intval != 0) { - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); } break; case 8: @@ -1506,7 +1454,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } } else if ((y->class == 7 && !OPB_IntToBool(y->conval->intval))) { } else { - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); } } else if (f != 0) { OPB_err(95); @@ -1514,16 +1462,16 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 9: case 10: - if (__IN(f, 0x6bff) || strings__43(&z, &y)) { + if (__IN(f, 0x6bff) || strings__41(&z, &y)) { typ = OPT_booltyp; } else { OPB_err(107); typ = OPT_undftyp; } - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); break; case 11: case 12: case 13: case 14: - if (__IN(f, 0x01f9) || strings__43(&z, &y)) { + if (__IN(f, 0x01f9) || strings__41(&z, &y)) { typ = OPT_booltyp; } else { OPM_LogWLn(); @@ -1532,7 +1480,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPB_err(108); typ = OPT_undftyp; } - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); break; default: OPM_LogWStr((CHAR*)"unhandled case in OPB.Op, op = ", (LONGINT)32); @@ -1542,7 +1490,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } } *x = z; - Op__40_s = _s.lnk; + Op__38_s = _s.lnk; } void OPB_SetRange (OPT_Node *x, OPT_Node y) @@ -1894,8 +1842,13 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 10: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((__IN(f, 0x70) && x->typ->size > (int)OPM_SIntSize)) { - OPB_Convert(&x, OPB_IntType(OPB_ShorterSize(x->typ->size))); + } else if (__IN(f, 0x70)) { + typ = OPT_ShorterOrLongerType(x->typ, -1); + if (typ == NIL) { + OPB_err(111); + } else { + OPB_Convert(&x, typ); + } } else if (f == 8) { OPB_Convert(&x, OPT_realtyp); } else { @@ -1905,8 +1858,13 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 11: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((__IN(f, 0x70) && x->typ->size < (int)OPM_LIntSize)) { - OPB_Convert(&x, OPB_IntType(OPB_LongerSize(x->typ->size))); + } else if (__IN(f, 0x70)) { + typ = OPT_ShorterOrLongerType(x->typ, 1); + if (typ == NIL) { + OPB_err(111); + } else { + OPB_Convert(&x, typ); + } } else if (f == 7) { OPB_Convert(&x, OPT_lrltyp); } else if (f == 3) { @@ -2043,13 +2001,13 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) *par0 = x; } -static struct StPar1__56 { - struct StPar1__56 *lnk; -} *StPar1__56_s; +static struct StPar1__52 { + struct StPar1__52 *lnk; +} *StPar1__52_s; -static OPT_Node NewOp__57 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right); +static OPT_Node NewOp__53 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right); -static OPT_Node NewOp__57 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right) +static OPT_Node NewOp__53 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right) { OPT_Node _o_result; OPT_Node node = NIL; @@ -2066,9 +2024,9 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) INTEGER f, L; OPT_Struct typ = NIL; OPT_Node p = NIL, t = NIL; - struct StPar1__56 _s; - _s.lnk = StPar1__56_s; - StPar1__56_s = &_s; + struct StPar1__52 _s; + _s.lnk = StPar1__52_s; + StPar1__52_s = &_s; p = *par0; f = x->typ->form; switch (fctno) { @@ -2084,7 +2042,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) OPB_err(111); } } - p = NewOp__57(19, fctno, p, x); + p = NewOp__53(19, fctno, p, x); p->typ = OPT_notyp; } break; @@ -2095,7 +2053,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > (int)OPM_MaxSet))) { OPB_err(202); } - p = NewOp__57(19, fctno, p, x); + p = NewOp__53(19, fctno, p, x); } else { OPB_err(111); } @@ -2120,7 +2078,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) p = p->left; x->conval->intval += 1; } - p = NewOp__57(12, 19, p, x); + p = NewOp__53(12, 19, p, x); p->typ = OPT_linttyp; } else { p = x; @@ -2142,7 +2100,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) t = x; x = p; p = t; - p = NewOp__57(19, 18, p, x); + p = NewOp__53(19, 18, p, x); } else { OPB_err(111); } @@ -2168,7 +2126,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) } p->obj = NIL; } else { - p = NewOp__57(12, 17, p, x); + p = NewOp__53(12, 17, p, x); p->typ = OPT_linttyp; } } else { @@ -2199,9 +2157,9 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) OPB_err(111); } else { if (fctno == 22) { - p = NewOp__57(12, 27, p, x); + p = NewOp__53(12, 27, p, x); } else { - p = NewOp__57(12, 28, p, x); + p = NewOp__53(12, 28, p, x); } p->typ = p->left->typ; } @@ -2218,7 +2176,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) x = p; p = t; } - p = NewOp__57(19, fctno, p, x); + p = NewOp__53(19, fctno, p, x); } else { OPB_err(111); } @@ -2228,7 +2186,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (__IN(f, 0x70)) { - p = NewOp__57(12, 26, p, x); + p = NewOp__53(12, 26, p, x); } else { OPB_err(111); } @@ -2252,7 +2210,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (__IN(f, 0x70)) { - p = NewOp__57(19, 30, p, x); + p = NewOp__53(19, 30, p, x); } else { OPB_err(111); } @@ -2298,7 +2256,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) break; } *par0 = p; - StPar1__56_s = _s.lnk; + StPar1__52_s = _s.lnk; } void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n) diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index e7a96131..81b3745b 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 02a24b4d..8a3a54cf 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "OPM.h" diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index 7aea7283..dcd53d63 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 88c3bd4d..65ebb8b0 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index 3c2be746..a61c632e 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index a0c19958..5620c5ec 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPB.h" #include "OPM.h" @@ -24,7 +24,7 @@ export LONGINT *OPP__1__typ; static void OPP_ActualParameters (OPT_Node *aparlist, OPT_Object fpar); static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned); static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq); -static void OPP_CaseLabelList (OPT_Node *lab, INTEGER LabelForm, INTEGER *n, OPP_CaseTable tab); +static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, OPP_CaseTable tab); static void OPP_CheckMark (SHORTINT *vis); static void OPP_CheckSym (INTEGER s); static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_); @@ -1163,7 +1163,7 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) ProcedureDeclaration__16_s = _s.lnk; } -static void OPP_CaseLabelList (OPT_Node *lab, INTEGER LabelForm, INTEGER *n, OPP_CaseTable tab) +static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, OPP_CaseTable tab) { OPT_Node x = NIL, y = NIL, lastlab = NIL; INTEGER i, f; @@ -1180,10 +1180,10 @@ static void OPP_CaseLabelList (OPT_Node *lab, INTEGER LabelForm, INTEGER *n, OPP xval = 1; } if (__IN(f, 0x70)) { - if (LabelForm < f) { + if (!__IN(LabelTyp->form, 0x70) || LabelTyp->size < x->typ->size) { OPP_err(60); } - } else if (LabelForm != f) { + } else if ((int)LabelTyp->form != f) { OPP_err(60); } if (OPP_sym == 21) { @@ -1262,7 +1262,7 @@ static void CasePart__31 (OPT_Node *x) n = 0; for (;;) { if (OPP_sym < 40) { - OPP_CaseLabelList(&lab, (*x)->typ->form, &n, tab); + OPP_CaseLabelList(&lab, (*x)->typ, &n, tab); OPP_CheckSym(20); OPP_StatSeq(&y); OPB_Construct(17, &lab, y); @@ -1471,7 +1471,7 @@ static void OPP_StatSeq (OPT_Node *stat) SetPos__35(z); OPB_Link(&*stat, &last, z); y = OPB_NewLeaf(t); - } else if (y->typ->form < 4 || y->typ->form > x->left->typ->form) { + } else if (!__IN(y->typ->form, 0x70) || y->typ->size > x->left->typ->size) { OPP_err(113); } OPB_Link(&*stat, &last, x); diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index 6c24817c..be6b6252 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index 85c8b275..1f721944 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index 313c0ac7..ecd93034 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index cbd147e6..8efa4803 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" @@ -84,11 +84,11 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; -static OPT_Object OPT_LIntObj; export SHORTINT OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; export BOOLEAN OPT_SYSimported; +static OPT_Struct OPT_IntTypes[20]; static OPT_Object OPT_universe, OPT_syslink; static OPT_ImpCtxt OPT_impCtxt; static OPT_ExpCtxt OPT_expCtxt; @@ -106,7 +106,6 @@ export void OPT_Close (void); export void OPT_CloseScope (void); static void OPT_DebugStruct (OPT_Struct btyp); static void OPT_EnterBoolConst (OPS_Name name, LONGINT value); -static void OPT_EnterDerivedType (OPS_Name name, OPT_Struct typ, OPT_Object *obj); static void OPT_EnterProc (OPS_Name name, INTEGER num); static void OPT_EnterTyp (OPS_Name name, SHORTINT form, INTEGER size, OPT_Struct *res); export void OPT_Export (BOOLEAN *ext, BOOLEAN *new); @@ -128,10 +127,12 @@ static OPT_Object OPT_InObj (SHORTINT mno); static void OPT_InSign (SHORTINT mno, OPT_Struct *res, OPT_Object *par); static void OPT_InStruct (OPT_Struct *typ); static OPT_Object OPT_InTProc (SHORTINT mno); +static OPT_Struct OPT_InTyp (LONGINT tag); export void OPT_Init (OPS_Name name, SET opt); static void OPT_InitStruct (OPT_Struct *typ, SHORTINT form); export void OPT_Insert (OPS_Name name, OPT_Object *obj); export void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); +export OPT_Struct OPT_IntType (LONGINT size); export OPT_Const OPT_NewConst (void); export OPT_ConstExt OPT_NewExt (void); export OPT_Node OPT_NewNode (SHORTINT class); @@ -147,6 +148,7 @@ static void OPT_OutObj (OPT_Object obj); static void OPT_OutSign (OPT_Struct result, OPT_Object par); static void OPT_OutStr (OPT_Struct typ); static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj); +export OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir); static void OPT_err (INTEGER n); @@ -155,6 +157,34 @@ static void OPT_err (INTEGER n) OPM_err(n); } +OPT_Struct OPT_IntType (LONGINT size) +{ + OPT_Struct _o_result; + INTEGER i; + i = 1; + while ((OPT_IntTypes[__X(i, ((LONGINT)(20)))]->size < size && OPT_IntTypes[__X(i + 1, ((LONGINT)(20)))] != NIL)) { + i += 1; + } + _o_result = OPT_IntTypes[__X(i, ((LONGINT)(20)))]; + return _o_result; +} + +OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir) +{ + OPT_Struct _o_result; + INTEGER i; + __ASSERT(__IN(x->form, 0x70), 0); + __ASSERT(dir == 1 || dir == -1, 0); + __ASSERT(x->BaseTyp == OPT_undftyp, 0); + i = 0; + while ((OPT_IntTypes[__X(i, ((LONGINT)(20)))] != x && i < 20)) { + i += 1; + } + __ASSERT(i < 19, 0); + _o_result = OPT_IntTypes[__X(i + dir, ((LONGINT)(20)))]; + return _o_result; +} + OPT_Const OPT_NewConst (void) { OPT_Const _o_result; @@ -467,21 +497,21 @@ void OPT_IdFPrint (OPT_Struct typ) } } -static struct FPrintStr__13 { +static struct FPrintStr__12 { LONGINT *pbfp, *pvfp; - struct FPrintStr__13 *lnk; -} *FPrintStr__13_s; + struct FPrintStr__12 *lnk; +} *FPrintStr__12_s; -static void FPrintFlds__14 (OPT_Object fld, LONGINT adr, BOOLEAN visible); -static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, LONGINT adr); -static void FPrintTProcs__18 (OPT_Object obj); +static void FPrintFlds__13 (OPT_Object fld, LONGINT adr, BOOLEAN visible); +static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr); +static void FPrintTProcs__17 (OPT_Object obj); -static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, LONGINT adr) +static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr) { LONGINT i, j, n; OPT_Struct btyp = NIL; if (typ->comp == 4) { - FPrintFlds__14(typ->link, adr, 0); + FPrintFlds__13(typ->link, adr, 0); } else if (typ->comp == 2) { btyp = typ->BaseTyp; n = typ->n; @@ -491,53 +521,53 @@ static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, LONGINT adr) } if (btyp->form == 13 || btyp->comp == 4) { j = OPT_nofhdfld; - FPrintHdFld__16(btyp, fld, adr); + FPrintHdFld__15(btyp, fld, adr); if (j != OPT_nofhdfld) { i = 1; while ((i < n && OPT_nofhdfld <= 2048)) { adr += btyp->size; - FPrintHdFld__16(btyp, fld, adr); + FPrintHdFld__15(btyp, fld, adr); i += 1; } } } } else if (typ->form == 13 || __STRCMP(fld->name, "@ptr") == 0) { - OPM_FPrint(&*FPrintStr__13_s->pvfp, ((LONGINT)(13))); - OPM_FPrint(&*FPrintStr__13_s->pvfp, adr); + OPM_FPrint(&*FPrintStr__12_s->pvfp, ((LONGINT)(13))); + OPM_FPrint(&*FPrintStr__12_s->pvfp, adr); OPT_nofhdfld += 1; } } -static void FPrintFlds__14 (OPT_Object fld, LONGINT adr, BOOLEAN visible) +static void FPrintFlds__13 (OPT_Object fld, LONGINT adr, BOOLEAN visible) { while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { - OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->vis); - OPT_FPrintName(&*FPrintStr__13_s->pbfp, (void*)fld->name, ((LONGINT)(256))); - OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->adr); + OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->vis); + OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)fld->name, ((LONGINT)(256))); + OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->adr); OPT_FPrintStr(fld->typ); - OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->typ->pbfp); - OPM_FPrint(&*FPrintStr__13_s->pvfp, fld->typ->pvfp); + OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->typ->pbfp); + OPM_FPrint(&*FPrintStr__12_s->pvfp, fld->typ->pvfp); } else { - FPrintHdFld__16(fld->typ, fld, fld->adr + adr); + FPrintHdFld__15(fld->typ, fld, fld->adr + adr); } fld = fld->link; } } -static void FPrintTProcs__18 (OPT_Object obj) +static void FPrintTProcs__17 (OPT_Object obj) { if (obj != NIL) { - FPrintTProcs__18(obj->left); + FPrintTProcs__17(obj->left); if (obj->mode == 13) { if (obj->vis != 0) { - OPM_FPrint(&*FPrintStr__13_s->pbfp, ((LONGINT)(13))); - OPM_FPrint(&*FPrintStr__13_s->pbfp, __ASHR(obj->adr, 16)); - OPT_FPrintSign(&*FPrintStr__13_s->pbfp, obj->typ, obj->link); - OPT_FPrintName(&*FPrintStr__13_s->pbfp, (void*)obj->name, ((LONGINT)(256))); + OPM_FPrint(&*FPrintStr__12_s->pbfp, ((LONGINT)(13))); + OPM_FPrint(&*FPrintStr__12_s->pbfp, __ASHR(obj->adr, 16)); + OPT_FPrintSign(&*FPrintStr__12_s->pbfp, obj->typ, obj->link); + OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)obj->name, ((LONGINT)(256))); } } - FPrintTProcs__18(obj->right); + FPrintTProcs__17(obj->right); } } @@ -547,11 +577,11 @@ void OPT_FPrintStr (OPT_Struct typ) OPT_Struct btyp = NIL; OPT_Object strobj = NIL, bstrobj = NIL; LONGINT pbfp, pvfp; - struct FPrintStr__13 _s; + struct FPrintStr__12 _s; _s.pbfp = &pbfp; _s.pvfp = &pvfp; - _s.lnk = FPrintStr__13_s; - FPrintStr__13_s = &_s; + _s.lnk = FPrintStr__12_s; + FPrintStr__12_s = &_s; if (!typ->fpdone) { OPT_IdFPrint(typ); pbfp = typ->idfp; @@ -588,11 +618,11 @@ void OPT_FPrintStr (OPT_Struct typ) OPM_FPrint(&pvfp, typ->align); OPM_FPrint(&pvfp, typ->n); OPT_nofhdfld = 0; - FPrintFlds__14(typ->link, ((LONGINT)(0)), 1); + FPrintFlds__13(typ->link, ((LONGINT)(0)), 1); if (OPT_nofhdfld > 2048) { OPM_Mark(225, typ->txtpos); } - FPrintTProcs__18(typ->link); + FPrintTProcs__17(typ->link); OPM_FPrint(&pvfp, pbfp); strobj = typ->strobj; if (strobj == NIL || strobj->name[0] == 0x00) { @@ -602,7 +632,7 @@ void OPT_FPrintStr (OPT_Struct typ) typ->pbfp = pbfp; typ->pvfp = pvfp; } - FPrintStr__13_s = _s.lnk; + FPrintStr__12_s = _s.lnk; } void OPT_FPrintObj (OPT_Object obj) @@ -946,6 +976,19 @@ static OPT_Object OPT_InTProc (SHORTINT mno) return _o_result; } +static OPT_Struct OPT_InTyp (LONGINT tag) +{ + OPT_Struct _o_result; + if (__IN(tag, 0x70)) { + _o_result = OPT_IntType(OPM_SymRInt()); + return _o_result; + } else { + _o_result = OPT_impCtxt.ref[__X(tag, ((LONGINT)(255)))]; + return _o_result; + } + __RETCHK; +} + static void OPT_InStruct (OPT_Struct *typ) { SHORTINT mno; @@ -956,7 +999,7 @@ static void OPT_InStruct (OPT_Struct *typ) OPT_Object obj = NIL, last = NIL, fld = NIL, old = NIL, dummy = NIL; tag = OPM_SymRInt(); if (tag != 34) { - *typ = OPT_impCtxt.ref[__X(-tag, ((LONGINT)(255)))]; + *typ = OPT_InTyp(-tag); } else { ref = OPT_impCtxt.nofr; OPT_impCtxt.nofr += 1; @@ -1081,7 +1124,7 @@ static void OPT_InStruct (OPT_Struct *typ) } if (ref == OPT_impCtxt.minr) { while (ref < OPT_impCtxt.nofr) { - t = OPT_impCtxt.ref[__X(ref, ((LONGINT)(255)))]; + t = OPT_InTyp(ref); OPT_FPrintStr(t); obj = t->strobj; if (obj->name[0] != 0x00) { @@ -1150,9 +1193,9 @@ static OPT_Object OPT_InObj (SHORTINT mno) obj->vis = 1; if (tag <= 13) { obj->mode = 3; - obj->typ = OPT_impCtxt.ref[__X(tag, ((LONGINT)(255)))]; obj->conval = OPT_NewConst(); OPT_InConstant(tag, obj->conval); + obj->typ = OPT_InTyp(tag); } else if (tag >= 31) { obj->conval = OPT_NewConst(); obj->conval->intval = -1; @@ -1396,6 +1439,9 @@ static void OPT_OutStr (OPT_Struct typ) OPT_Object strobj = NIL; if (typ->ref < OPT_expCtxt.ref) { OPM_SymWInt(-typ->ref); + if (__IN(typ->ref, 0x70)) { + OPM_SymWInt(typ->size); + } } else { OPM_SymWInt(((LONGINT)(34))); typ->ref = OPT_expCtxt.ref; @@ -1493,6 +1539,7 @@ static void OPT_OutConstant (OPT_Object obj) break; case 4: case 5: case 6: OPM_SymWInt(obj->conval->intval); + OPM_SymWInt(obj->typ->size); break; case 9: OPM_SymWSet(obj->conval->setval); @@ -1699,15 +1746,6 @@ static void OPT_EnterTyp (OPS_Name name, SHORTINT form, INTEGER size, OPT_Struct *res = typ; } -static void OPT_EnterDerivedType (OPS_Name name, OPT_Struct typ, OPT_Object *obj) -{ - OPS_Name name__copy; - __DUPARR(name, OPS_Name); - OPT_Insert(name, &*obj); - (*obj)->mode = 5; - (*obj)->typ = typ; -} - static void OPT_EnterProc (OPS_Name name, INTEGER num) { OPT_Object obj = NIL; @@ -1741,8 +1779,8 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_niltyp); P(OPT_notyp); P(OPT_sysptrtyp); - P(OPT_LIntObj); __ENUMP(OPT_GlbMod, 64, P); + __ENUMP(OPT_IntTypes, 20, P); P(OPT_universe); P(OPT_syslink); __ENUMR(&OPT_impCtxt, OPT_ImpCtxt__typ, 3140, 1, P); @@ -1811,7 +1849,7 @@ export void *OPT__init(void) OPT_InitStruct(&OPT_niltyp, 11); OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp); OPT_EnterTyp((CHAR*)"PTR", 13, OPM_PointerSize, &OPT_sysptrtyp); - OPT_EnterTyp((CHAR*)"ADRINT", 5, OPM_LIntSize, &OPT_ainttyp); + OPT_EnterTyp((CHAR*)"ADRINT", 5, OPM_PointerSize, &OPT_ainttyp); OPT_EnterTyp((CHAR*)"INT8", 5, 1, &OPT_int8typ); OPT_EnterTyp((CHAR*)"INT16", 5, 2, &OPT_int16typ); OPT_EnterTyp((CHAR*)"INT32", 5, 4, &OPT_int32typ); @@ -1839,7 +1877,6 @@ export void *OPT__init(void) OPT_EnterTyp((CHAR*)"LONGINT", 6, OPM_LIntSize, &OPT_linttyp); OPT_EnterTyp((CHAR*)"LONGREAL", 8, OPM_LRealSize, &OPT_lrltyp); OPT_EnterTyp((CHAR*)"SHORTINT", 4, OPM_SIntSize, &OPT_sinttyp); - OPT_EnterDerivedType((CHAR*)"LINT", OPT_int64typ, &OPT_LIntObj); OPT_EnterBoolConst((CHAR*)"FALSE", ((LONGINT)(0))); OPT_EnterBoolConst((CHAR*)"TRUE", ((LONGINT)(1))); OPT_EnterProc((CHAR*)"HALT", 0); @@ -1877,5 +1914,12 @@ export void *OPT__init(void) OPT_impCtxt.ref[11] = OPT_niltyp; OPT_impCtxt.ref[12] = OPT_notyp; OPT_impCtxt.ref[13] = OPT_sysptrtyp; + OPT_IntTypes[1] = OPT_sinttyp; + OPT_IntTypes[2] = OPT_inttyp; + OPT_IntTypes[3] = OPT_linttyp; + OPT_IntTypes[5] = OPT_int8typ; + OPT_IntTypes[6] = OPT_int16typ; + OPT_IntTypes[7] = OPT_int32typ; + OPT_IntTypes[8] = OPT_int64typ; __ENDMOD; } diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index c4975398..f6206e42 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h @@ -92,12 +92,14 @@ import void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); import void OPT_Init (OPS_Name name, SET opt); import void OPT_Insert (OPS_Name name, OPT_Object *obj); import void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); +import OPT_Struct OPT_IntType (LONGINT size); import OPT_Const OPT_NewConst (void); import OPT_ConstExt OPT_NewExt (void); import OPT_Node OPT_NewNode (SHORTINT class); import OPT_Object OPT_NewObj (void); import OPT_Struct OPT_NewStr (SHORTINT form, SHORTINT comp); import void OPT_OpenScope (SHORTINT level, OPT_Object owner); +import OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir); import void *OPT__init(void); diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index 2172dee5..03b675a9 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPC.h" #include "OPM.h" diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index 122fda4a..6926d6ac 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 6326549f..9e1c6dfd 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index 77a9b68f..b890523b 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 11c99924..4ee29f7d 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index b0497a9c..0a81ebf4 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/SYSTEM.h b/bootstrap/unix-48/SYSTEM.h index 35620b9b..343404a4 100644 --- a/bootstrap/unix-48/SYSTEM.h +++ b/bootstrap/unix-48/SYSTEM.h @@ -60,12 +60,6 @@ typedef float REAL; typedef double LONGREAL; typedef void* SYSTEM_PTR; -// Unsigned variants are for use by shift and rotate macros. - -typedef unsigned char U_SYSTEM_BYTE; -typedef unsigned char U_CHAR; -typedef unsigned char U_SHORTINT; - // For 32 bit builds, the size of LONGINT depends on a make option: #if (__SIZEOF_POINTER__ == 8) || defined(LARGE) || defined(_WIN64) @@ -80,9 +74,20 @@ typedef unsigned char U_SHORTINT; typedef unsigned long U_LONGINT; #endif +// Unsigned variants are for use by shift and rotate macros. + +typedef unsigned char U_SYSTEM_BYTE; +typedef unsigned char U_CHAR; +typedef unsigned char U_SHORTINT; + typedef U_LONGINT SET; typedef U_LONGINT U_SET; +typedef SYSTEM_CARD8 U_SYSTEM_INT8; +typedef SYSTEM_CARD16 U_SYSTEM_INT16; +typedef SYSTEM_CARD32 U_SYSTEM_INT32; +typedef SYSTEM_CARD64 U_SYSTEM_INT64; + // OS Memory allocation interfaces are in PlatformXXX.Mod @@ -178,7 +183,7 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __ABSFD(x) SYSTEM_ABSD((double)(x)) #define __CAP(ch) ((CHAR)((ch)&0x5f)) #define __ODD(x) ((x)&1) -#define __IN(x, s) (((s)>>(x))&1) +#define __IN(x, s) ((x)>=0 && (x)<(8*sizeof(SET)) && ((((U_SET)(s))>>(x))&1)) #define __SETOF(x) ((SET)1<<(x)) #define __SETRNG(l, h) ((~(SET)0<<(l))&~(SET)0>>(8*sizeof(SET)-1-(h))) #define __MASK(x, m) ((x)&~(m)) diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index 15aeff29..0c372b8b 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index 385096bc..0dbfdb8e 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index f7a3fdd3..c40f0930 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Files.h" #include "Modules.h" diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index d178499a..99931953 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/Vishap.c b/bootstrap/unix-48/Vishap.c index 66a97f5d..e8b1e4d1 100644 --- a/bootstrap/unix-48/Vishap.c +++ b/bootstrap/unix-48/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkamSf */ #include "SYSTEM.h" #include "Configuration.h" #include "Heap.h" diff --git a/bootstrap/unix-48/errors.c b/bootstrap/unix-48/errors.c index 59b8db27..a8573f9a 100644 --- a/bootstrap/unix-48/errors.c +++ b/bootstrap/unix-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/unix-48/errors.h b/bootstrap/unix-48/errors.h index 6ae0cd7a..6dfe7b1d 100644 --- a/bootstrap/unix-48/errors.h +++ b/bootstrap/unix-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index 2ef65e7b..d2141803 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index 39837586..38d2da7b 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/vt100.c b/bootstrap/unix-48/vt100.c index e0edabd9..5eb4f70e 100644 --- a/bootstrap/unix-48/vt100.c +++ b/bootstrap/unix-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Strings.h" diff --git a/bootstrap/unix-48/vt100.h b/bootstrap/unix-48/vt100.h index 413ae867..770cf66d 100644 --- a/bootstrap/unix-48/vt100.h +++ b/bootstrap/unix-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index 8539a1e2..166df1dc 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -14,6 +14,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/08/26] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/08/30] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index b091f1f7..e30e1366 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Console.c b/bootstrap/unix-88/Console.c index 6cd166ef..70e9a7e2 100644 --- a/bootstrap/unix-88/Console.c +++ b/bootstrap/unix-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Platform.h" diff --git a/bootstrap/unix-88/Console.h b/bootstrap/unix-88/Console.h index a0813c94..6c86c19c 100644 --- a/bootstrap/unix-88/Console.h +++ b/bootstrap/unix-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 86914f24..3a575916 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 8bcec40e..4135c1d4 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index d3529141..1eb56133 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tskSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index 7827d119..7e4094a1 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index e006bde8..51f3204d 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index 9a0517b5..8431e4a2 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index cb07c606..ce3f00ec 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" @@ -35,9 +35,7 @@ export void OPB_In (OPT_Node *x, OPT_Node y); export void OPB_Index (OPT_Node *x, OPT_Node y); export void OPB_Inittd (OPT_Node *inittd, OPT_Node *last, OPT_Struct typ); static BOOLEAN OPB_IntToBool (LONGINT i); -static OPT_Struct OPB_IntType (LONGINT size); export void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y); -static LONGINT OPB_LongerSize (LONGINT i); export void OPB_MOp (SHORTINT op, OPT_Node *x); export OPT_Node OPB_NewBoolConst (BOOLEAN boolval); export OPT_Node OPB_NewIntConst (LONGINT intval); @@ -54,8 +52,6 @@ export void OPB_Return (OPT_Node *x, OPT_Object proc); export void OPB_SetElem (OPT_Node *x); static void OPB_SetIntType (OPT_Node node); export void OPB_SetRange (OPT_Node *x, OPT_Node y); -static LONGINT OPB_ShorterSize (LONGINT i); -static INTEGER OPB_SignedByteSize (LONGINT n); export void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno); export void OPB_StPar0 (OPT_Node *par0, INTEGER fctno); export void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno); @@ -225,68 +221,20 @@ OPT_Node OPB_EmptySet (void) return _o_result; } -static INTEGER OPB_SignedByteSize (LONGINT n) +static void OPB_SetIntType (OPT_Node node) { - INTEGER _o_result; INTEGER b; - if (n < 0) { - n = -(n + 1); + LONGINT n; + if (node->conval->intval >= 0) { + n = node->conval->intval; + } else { + n = -(node->conval->intval + 1); } b = 1; while ((b < 8 && __ASH(n, -(__ASHL(b, 3) - 1)) != 0)) { b += 1; } - _o_result = b; - return _o_result; -} - -static LONGINT OPB_ShorterSize (LONGINT i) -{ - LONGINT _o_result; - if (i >= (SYSTEM_INT64)OPM_LIntSize) { - _o_result = OPM_IntSize; - return _o_result; - } else { - _o_result = OPM_SIntSize; - return _o_result; - } - __RETCHK; -} - -static LONGINT OPB_LongerSize (LONGINT i) -{ - LONGINT _o_result; - if (i <= (SYSTEM_INT64)OPM_SIntSize) { - _o_result = OPM_IntSize; - return _o_result; - } else { - _o_result = OPM_LIntSize; - return _o_result; - } - __RETCHK; -} - -static OPT_Struct OPB_IntType (LONGINT size) -{ - OPT_Struct _o_result; - OPT_Struct result = NIL; - if (size <= OPT_sinttyp->size) { - result = OPT_sinttyp; - } else if (size <= OPT_inttyp->size) { - result = OPT_inttyp; - } else { - result = OPT_linttyp; - } - if (size > OPT_linttyp->size) { - OPB_err(203); - } - _o_result = result; - return _o_result; -} - -static void OPB_SetIntType (OPT_Node node) -{ - node->typ = OPB_IntType(OPB_SignedByteSize(node->conval->intval)); + node->typ = OPT_IntType(b); } OPT_Node OPB_NewIntConst (LONGINT intval) @@ -430,16 +378,16 @@ void OPB_Field (OPT_Node *x, OPT_Object y) } } -static struct TypTest__61 { +static struct TypTest__57 { OPT_Node *x; OPT_Object *obj; BOOLEAN *guard; - struct TypTest__61 *lnk; -} *TypTest__61_s; + struct TypTest__57 *lnk; +} *TypTest__57_s; -static void GTT__62 (OPT_Struct t0, OPT_Struct t1); +static void GTT__58 (OPT_Struct t0, OPT_Struct t1); -static void GTT__62 (OPT_Struct t0, OPT_Struct t1) +static void GTT__58 (OPT_Struct t0, OPT_Struct t1) { OPT_Node node = NIL; OPT_Struct t = NIL; @@ -452,54 +400,54 @@ static void GTT__62 (OPT_Struct t0, OPT_Struct t1) t1 = t1->BaseTyp; } if (t1 == t0 || t0->form == 0) { - if (*TypTest__61_s->guard) { - OPB_BindNodes(5, NIL, &*TypTest__61_s->x, NIL); - (*TypTest__61_s->x)->readonly = (*TypTest__61_s->x)->left->readonly; + if (*TypTest__57_s->guard) { + OPB_BindNodes(5, NIL, &*TypTest__57_s->x, NIL); + (*TypTest__57_s->x)->readonly = (*TypTest__57_s->x)->left->readonly; } else { node = OPT_NewNode(11); node->subcl = 16; - node->left = *TypTest__61_s->x; - node->obj = *TypTest__61_s->obj; - *TypTest__61_s->x = node; + node->left = *TypTest__57_s->x; + node->obj = *TypTest__57_s->obj; + *TypTest__57_s->x = node; } } else { OPB_err(85); } } else if (t0 != t1) { OPB_err(85); - } else if (!*TypTest__61_s->guard) { - if ((*TypTest__61_s->x)->class == 5) { + } else if (!*TypTest__57_s->guard) { + if ((*TypTest__57_s->x)->class == 5) { node = OPT_NewNode(11); node->subcl = 16; - node->left = *TypTest__61_s->x; - node->obj = *TypTest__61_s->obj; - *TypTest__61_s->x = node; + node->left = *TypTest__57_s->x; + node->obj = *TypTest__57_s->obj; + *TypTest__57_s->x = node; } else { - *TypTest__61_s->x = OPB_NewBoolConst(1); + *TypTest__57_s->x = OPB_NewBoolConst(1); } } } void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) { - struct TypTest__61 _s; + struct TypTest__57 _s; _s.x = x; _s.obj = &obj; _s.guard = &guard; - _s.lnk = TypTest__61_s; - TypTest__61_s = &_s; + _s.lnk = TypTest__57_s; + TypTest__57_s = &_s; if (OPB_NotVar(*x)) { OPB_err(112); } else if ((*x)->typ->form == 13) { if (((*x)->typ->BaseTyp->comp != 4 && (*x)->typ != OPT_sysptrtyp)) { OPB_err(85); } else if (obj->typ->form == 13) { - GTT__62((*x)->typ->BaseTyp, obj->typ->BaseTyp); + GTT__58((*x)->typ->BaseTyp, obj->typ->BaseTyp); } else { OPB_err(86); } } else if (((((*x)->typ->comp == 4 && (*x)->class == 1)) && obj->typ->comp == 4)) { - GTT__62((*x)->typ, obj->typ); + GTT__58((*x)->typ, obj->typ); } else { OPB_err(87); } @@ -508,7 +456,7 @@ void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) } else { (*x)->typ = OPT_booltyp; } - TypTest__61_s = _s.lnk; + TypTest__57_s = _s.lnk; } void OPB_In (OPT_Node *x, OPT_Node y) @@ -574,13 +522,13 @@ static void OPB_CheckRealType (INTEGER f, INTEGER nr, OPT_Const x) x->intval = -1; } -static struct MOp__30 { - struct MOp__30 *lnk; -} *MOp__30_s; +static struct MOp__28 { + struct MOp__28 *lnk; +} *MOp__28_s; -static OPT_Node NewOp__31 (SHORTINT op, OPT_Struct typ, OPT_Node z); +static OPT_Node NewOp__29 (SHORTINT op, OPT_Struct typ, OPT_Node z); -static OPT_Node NewOp__31 (SHORTINT op, OPT_Struct typ, OPT_Node z) +static OPT_Node NewOp__29 (SHORTINT op, OPT_Struct typ, OPT_Node z) { OPT_Node _o_result; OPT_Node node = NIL; @@ -597,9 +545,9 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) INTEGER f; OPT_Struct typ = NIL; OPT_Node z = NIL; - struct MOp__30 _s; - _s.lnk = MOp__30_s; - MOp__30_s = &_s; + struct MOp__28 _s; + _s.lnk = MOp__28_s; + MOp__28_s = &_s; z = *x; if (z->class == 8 || z->class == 9) { OPB_err(126); @@ -613,7 +561,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->conval->intval = OPB_BoolToInt(!OPB_IntToBool(z->conval->intval)); z->obj = NIL; } else { - z = NewOp__31(op, typ, z); + z = NewOp__29(op, typ, z); } } else { OPB_err(98); @@ -641,7 +589,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } z->obj = NIL; } else { - z = NewOp__31(op, typ, z); + z = NewOp__29(op, typ, z); } } else { OPB_err(97); @@ -662,7 +610,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } z->obj = NIL; } else { - z = NewOp__31(op, typ, z); + z = NewOp__29(op, typ, z); } } else { OPB_err(111); @@ -674,7 +622,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->conval->intval = (int)__CAP((CHAR)z->conval->intval); z->obj = NIL; } else { - z = NewOp__31(op, typ, z); + z = NewOp__29(op, typ, z); } } else { OPB_err(111); @@ -687,7 +635,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->conval->intval = OPB_BoolToInt(__ODD(z->conval->intval)); z->obj = NIL; } else { - z = NewOp__31(op, typ, z); + z = NewOp__29(op, typ, z); } } else { OPB_err(111); @@ -700,7 +648,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) f = 10; } if (z->class < 7 || f == 10) { - z = NewOp__31(op, typ, z); + z = NewOp__29(op, typ, z); } else { OPB_err(127); } @@ -709,7 +657,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) case 25: if ((__IN(f, 0x70) && z->class == 7)) { if ((0 <= z->conval->intval && z->conval->intval <= -1)) { - z = NewOp__31(op, typ, z); + z = NewOp__29(op, typ, z); } else { OPB_err(219); } @@ -726,7 +674,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } } *x = z; - MOp__30_s = _s.lnk; + MOp__28_s = _s.lnk; } static void OPB_CheckPtr (OPT_Node x, OPT_Node y) @@ -922,7 +870,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) if (x->typ->size <= y->typ->size) { x->typ = y->typ; } else { - x->typ = OPB_IntType(x->typ->size); + x->typ = OPT_IntType(x->typ->size); } } else if (g == 7) { x->typ = OPT_realtyp; @@ -1179,7 +1127,7 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) if (__IN(g, 0x70)) { if (f > g) { OPB_SetIntType(*x); - if ((int)(*x)->typ->form > g) { + if ((*x)->typ->size > typ->size) { OPB_err(203); (*x)->conval->intval = 1; } @@ -1220,15 +1168,15 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) (*x)->typ = typ; } -static struct Op__40 { +static struct Op__38 { INTEGER *f, *g; - struct Op__40 *lnk; -} *Op__40_s; + struct Op__38 *lnk; +} *Op__38_s; -static void NewOp__41 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y); -static BOOLEAN strings__43 (OPT_Node *x, OPT_Node *y); +static void NewOp__39 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y); +static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y); -static void NewOp__41 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y) +static void NewOp__39 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y) { OPT_Node node = NIL; node = OPT_NewNode(12); @@ -1239,29 +1187,29 @@ static void NewOp__41 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y) *x = node; } -static BOOLEAN strings__43 (OPT_Node *x, OPT_Node *y) +static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) { BOOLEAN _o_result; BOOLEAN ok, xCharArr, yCharArr; - xCharArr = (__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp->form == 3) || *Op__40_s->f == 10; - yCharArr = (__IN((*y)->typ->comp, 0x0c) && (*y)->typ->BaseTyp->form == 3) || *Op__40_s->g == 10; - if ((((xCharArr && *Op__40_s->g == 3)) && (*y)->class == 7)) { + xCharArr = (__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp->form == 3) || *Op__38_s->f == 10; + yCharArr = (__IN((*y)->typ->comp, 0x0c) && (*y)->typ->BaseTyp->form == 3) || *Op__38_s->g == 10; + if ((((xCharArr && *Op__38_s->g == 3)) && (*y)->class == 7)) { OPB_CharToString(*y); - *Op__40_s->g = 10; + *Op__38_s->g = 10; yCharArr = 1; } - if ((((yCharArr && *Op__40_s->f == 3)) && (*x)->class == 7)) { + if ((((yCharArr && *Op__38_s->f == 3)) && (*x)->class == 7)) { OPB_CharToString(*x); - *Op__40_s->f = 10; + *Op__38_s->f = 10; xCharArr = 1; } ok = (xCharArr && yCharArr); if (ok) { - if ((*Op__40_s->f == 10 && (*x)->conval->intval2 == 1)) { + if ((*Op__38_s->f == 10 && (*x)->conval->intval2 == 1)) { (*x)->typ = OPT_chartyp; (*x)->conval->intval = 0; OPB_Index(&*y, OPB_NewIntConst(((LONGINT)(0)))); - } else if ((*Op__40_s->g == 10 && (*y)->conval->intval2 == 1)) { + } else if ((*Op__38_s->g == 10 && (*y)->conval->intval2 == 1)) { (*y)->typ = OPT_chartyp; (*y)->conval->intval = 0; OPB_Index(&*x, OPB_NewIntConst(((LONGINT)(0)))); @@ -1278,11 +1226,11 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPT_Struct typ = NIL; BOOLEAN do_; LONGINT val; - struct Op__40 _s; + struct Op__38 _s; _s.f = &f; _s.g = &g; - _s.lnk = Op__40_s; - Op__40_s = &_s; + _s.lnk = Op__38_s; + Op__38_s = &_s; z = *x; if (((z->class == 8 || z->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); @@ -1394,7 +1342,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) typ = OPT_undftyp; } if (do_) { - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); } break; case 2: @@ -1413,7 +1361,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPB_err(102); typ = OPT_undftyp; } - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); break; case 3: do_ = 1; @@ -1436,7 +1384,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) typ = OPT_undftyp; } if (do_) { - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); } break; case 4: @@ -1454,7 +1402,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPB_err(104); typ = OPT_undftyp; } - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); break; case 5: if (f == 2) { @@ -1464,7 +1412,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } } else if ((y->class == 7 && OPB_IntToBool(y->conval->intval))) { } else { - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); } } else if (f != 0) { OPB_err(94); @@ -1487,7 +1435,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } } if (do_) { - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); } break; case 7: @@ -1496,7 +1444,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) typ = OPT_undftyp; } if ((!__IN(f, 0x70) || y->class != 7) || y->conval->intval != 0) { - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); } break; case 8: @@ -1507,7 +1455,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } } else if ((y->class == 7 && !OPB_IntToBool(y->conval->intval))) { } else { - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); } } else if (f != 0) { OPB_err(95); @@ -1515,16 +1463,16 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 9: case 10: - if (__IN(f, 0x6bff) || strings__43(&z, &y)) { + if (__IN(f, 0x6bff) || strings__41(&z, &y)) { typ = OPT_booltyp; } else { OPB_err(107); typ = OPT_undftyp; } - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); break; case 11: case 12: case 13: case 14: - if (__IN(f, 0x01f9) || strings__43(&z, &y)) { + if (__IN(f, 0x01f9) || strings__41(&z, &y)) { typ = OPT_booltyp; } else { OPM_LogWLn(); @@ -1533,7 +1481,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPB_err(108); typ = OPT_undftyp; } - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); break; default: OPM_LogWStr((CHAR*)"unhandled case in OPB.Op, op = ", (LONGINT)32); @@ -1543,7 +1491,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } } *x = z; - Op__40_s = _s.lnk; + Op__38_s = _s.lnk; } void OPB_SetRange (OPT_Node *x, OPT_Node y) @@ -1895,8 +1843,13 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 10: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((__IN(f, 0x70) && x->typ->size > (SYSTEM_INT64)OPM_SIntSize)) { - OPB_Convert(&x, OPB_IntType(OPB_ShorterSize(x->typ->size))); + } else if (__IN(f, 0x70)) { + typ = OPT_ShorterOrLongerType(x->typ, -1); + if (typ == NIL) { + OPB_err(111); + } else { + OPB_Convert(&x, typ); + } } else if (f == 8) { OPB_Convert(&x, OPT_realtyp); } else { @@ -1906,8 +1859,13 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 11: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((__IN(f, 0x70) && x->typ->size < (SYSTEM_INT64)OPM_LIntSize)) { - OPB_Convert(&x, OPB_IntType(OPB_LongerSize(x->typ->size))); + } else if (__IN(f, 0x70)) { + typ = OPT_ShorterOrLongerType(x->typ, 1); + if (typ == NIL) { + OPB_err(111); + } else { + OPB_Convert(&x, typ); + } } else if (f == 7) { OPB_Convert(&x, OPT_lrltyp); } else if (f == 3) { @@ -2044,13 +2002,13 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) *par0 = x; } -static struct StPar1__56 { - struct StPar1__56 *lnk; -} *StPar1__56_s; +static struct StPar1__52 { + struct StPar1__52 *lnk; +} *StPar1__52_s; -static OPT_Node NewOp__57 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right); +static OPT_Node NewOp__53 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right); -static OPT_Node NewOp__57 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right) +static OPT_Node NewOp__53 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right) { OPT_Node _o_result; OPT_Node node = NIL; @@ -2067,9 +2025,9 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) INTEGER f, L; OPT_Struct typ = NIL; OPT_Node p = NIL, t = NIL; - struct StPar1__56 _s; - _s.lnk = StPar1__56_s; - StPar1__56_s = &_s; + struct StPar1__52 _s; + _s.lnk = StPar1__52_s; + StPar1__52_s = &_s; p = *par0; f = x->typ->form; switch (fctno) { @@ -2085,7 +2043,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) OPB_err(111); } } - p = NewOp__57(19, fctno, p, x); + p = NewOp__53(19, fctno, p, x); p->typ = OPT_notyp; } break; @@ -2096,7 +2054,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > (SYSTEM_INT64)OPM_MaxSet))) { OPB_err(202); } - p = NewOp__57(19, fctno, p, x); + p = NewOp__53(19, fctno, p, x); } else { OPB_err(111); } @@ -2121,7 +2079,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) p = p->left; x->conval->intval += 1; } - p = NewOp__57(12, 19, p, x); + p = NewOp__53(12, 19, p, x); p->typ = OPT_linttyp; } else { p = x; @@ -2143,7 +2101,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) t = x; x = p; p = t; - p = NewOp__57(19, 18, p, x); + p = NewOp__53(19, 18, p, x); } else { OPB_err(111); } @@ -2169,7 +2127,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) } p->obj = NIL; } else { - p = NewOp__57(12, 17, p, x); + p = NewOp__53(12, 17, p, x); p->typ = OPT_linttyp; } } else { @@ -2200,9 +2158,9 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) OPB_err(111); } else { if (fctno == 22) { - p = NewOp__57(12, 27, p, x); + p = NewOp__53(12, 27, p, x); } else { - p = NewOp__57(12, 28, p, x); + p = NewOp__53(12, 28, p, x); } p->typ = p->left->typ; } @@ -2219,7 +2177,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) x = p; p = t; } - p = NewOp__57(19, fctno, p, x); + p = NewOp__53(19, fctno, p, x); } else { OPB_err(111); } @@ -2229,7 +2187,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (__IN(f, 0x70)) { - p = NewOp__57(12, 26, p, x); + p = NewOp__53(12, 26, p, x); } else { OPB_err(111); } @@ -2253,7 +2211,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (__IN(f, 0x70)) { - p = NewOp__57(19, 30, p, x); + p = NewOp__53(19, 30, p, x); } else { OPB_err(111); } @@ -2299,7 +2257,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) break; } *par0 = p; - StPar1__56_s = _s.lnk; + StPar1__52_s = _s.lnk; } void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n) diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index f2056569..ccef7627 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index 0813dca9..a5276b17 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index aa92d405..de932c60 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 3bc1b6d2..0e43a013 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index f11b56ba..e94f0303 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index 3a345c1f..63b71ce5 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPB.h" @@ -25,7 +25,7 @@ export LONGINT *OPP__1__typ; static void OPP_ActualParameters (OPT_Node *aparlist, OPT_Object fpar); static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned); static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq); -static void OPP_CaseLabelList (OPT_Node *lab, INTEGER LabelForm, INTEGER *n, OPP_CaseTable tab); +static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, OPP_CaseTable tab); static void OPP_CheckMark (SHORTINT *vis); static void OPP_CheckSym (INTEGER s); static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_); @@ -1164,7 +1164,7 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) ProcedureDeclaration__16_s = _s.lnk; } -static void OPP_CaseLabelList (OPT_Node *lab, INTEGER LabelForm, INTEGER *n, OPP_CaseTable tab) +static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, OPP_CaseTable tab) { OPT_Node x = NIL, y = NIL, lastlab = NIL; INTEGER i, f; @@ -1181,10 +1181,10 @@ static void OPP_CaseLabelList (OPT_Node *lab, INTEGER LabelForm, INTEGER *n, OPP xval = 1; } if (__IN(f, 0x70)) { - if (LabelForm < f) { + if (!__IN(LabelTyp->form, 0x70) || LabelTyp->size < x->typ->size) { OPP_err(60); } - } else if (LabelForm != f) { + } else if ((int)LabelTyp->form != f) { OPP_err(60); } if (OPP_sym == 21) { @@ -1263,7 +1263,7 @@ static void CasePart__31 (OPT_Node *x) n = 0; for (;;) { if (OPP_sym < 40) { - OPP_CaseLabelList(&lab, (*x)->typ->form, &n, tab); + OPP_CaseLabelList(&lab, (*x)->typ, &n, tab); OPP_CheckSym(20); OPP_StatSeq(&y); OPB_Construct(17, &lab, y); @@ -1472,7 +1472,7 @@ static void OPP_StatSeq (OPT_Node *stat) SetPos__35(z); OPB_Link(&*stat, &last, z); y = OPB_NewLeaf(t); - } else if (y->typ->form < 4 || y->typ->form > x->left->typ->form) { + } else if (!__IN(y->typ->form, 0x70) || y->typ->size > x->left->typ->size) { OPP_err(113); } OPB_Link(&*stat, &last, x); diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index c0c9c3dd..fb0cf655 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index 1f9f2a46..e2d48c61 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index 4b760b22..ea28a764 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index 20234e22..b028d164 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" @@ -85,11 +85,11 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; -static OPT_Object OPT_LIntObj; export SHORTINT OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; export BOOLEAN OPT_SYSimported; +static OPT_Struct OPT_IntTypes[20]; static OPT_Object OPT_universe, OPT_syslink; static OPT_ImpCtxt OPT_impCtxt; static OPT_ExpCtxt OPT_expCtxt; @@ -107,7 +107,6 @@ export void OPT_Close (void); export void OPT_CloseScope (void); static void OPT_DebugStruct (OPT_Struct btyp); static void OPT_EnterBoolConst (OPS_Name name, LONGINT value); -static void OPT_EnterDerivedType (OPS_Name name, OPT_Struct typ, OPT_Object *obj); static void OPT_EnterProc (OPS_Name name, INTEGER num); static void OPT_EnterTyp (OPS_Name name, SHORTINT form, INTEGER size, OPT_Struct *res); export void OPT_Export (BOOLEAN *ext, BOOLEAN *new); @@ -129,10 +128,12 @@ static OPT_Object OPT_InObj (SHORTINT mno); static void OPT_InSign (SHORTINT mno, OPT_Struct *res, OPT_Object *par); static void OPT_InStruct (OPT_Struct *typ); static OPT_Object OPT_InTProc (SHORTINT mno); +static OPT_Struct OPT_InTyp (LONGINT tag); export void OPT_Init (OPS_Name name, SET opt); static void OPT_InitStruct (OPT_Struct *typ, SHORTINT form); export void OPT_Insert (OPS_Name name, OPT_Object *obj); export void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); +export OPT_Struct OPT_IntType (LONGINT size); export OPT_Const OPT_NewConst (void); export OPT_ConstExt OPT_NewExt (void); export OPT_Node OPT_NewNode (SHORTINT class); @@ -148,6 +149,7 @@ static void OPT_OutObj (OPT_Object obj); static void OPT_OutSign (OPT_Struct result, OPT_Object par); static void OPT_OutStr (OPT_Struct typ); static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj); +export OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir); static void OPT_err (INTEGER n); @@ -156,6 +158,34 @@ static void OPT_err (INTEGER n) OPM_err(n); } +OPT_Struct OPT_IntType (LONGINT size) +{ + OPT_Struct _o_result; + INTEGER i; + i = 1; + while ((OPT_IntTypes[__X(i, ((LONGINT)(20)))]->size < size && OPT_IntTypes[__X(i + 1, ((LONGINT)(20)))] != NIL)) { + i += 1; + } + _o_result = OPT_IntTypes[__X(i, ((LONGINT)(20)))]; + return _o_result; +} + +OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir) +{ + OPT_Struct _o_result; + INTEGER i; + __ASSERT(__IN(x->form, 0x70), 0); + __ASSERT(dir == 1 || dir == -1, 0); + __ASSERT(x->BaseTyp == OPT_undftyp, 0); + i = 0; + while ((OPT_IntTypes[__X(i, ((LONGINT)(20)))] != x && i < 20)) { + i += 1; + } + __ASSERT(i < 19, 0); + _o_result = OPT_IntTypes[__X(i + dir, ((LONGINT)(20)))]; + return _o_result; +} + OPT_Const OPT_NewConst (void) { OPT_Const _o_result; @@ -468,21 +498,21 @@ void OPT_IdFPrint (OPT_Struct typ) } } -static struct FPrintStr__13 { +static struct FPrintStr__12 { LONGINT *pbfp, *pvfp; - struct FPrintStr__13 *lnk; -} *FPrintStr__13_s; + struct FPrintStr__12 *lnk; +} *FPrintStr__12_s; -static void FPrintFlds__14 (OPT_Object fld, LONGINT adr, BOOLEAN visible); -static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, LONGINT adr); -static void FPrintTProcs__18 (OPT_Object obj); +static void FPrintFlds__13 (OPT_Object fld, LONGINT adr, BOOLEAN visible); +static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr); +static void FPrintTProcs__17 (OPT_Object obj); -static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, LONGINT adr) +static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr) { LONGINT i, j, n; OPT_Struct btyp = NIL; if (typ->comp == 4) { - FPrintFlds__14(typ->link, adr, 0); + FPrintFlds__13(typ->link, adr, 0); } else if (typ->comp == 2) { btyp = typ->BaseTyp; n = typ->n; @@ -492,53 +522,53 @@ static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, LONGINT adr) } if (btyp->form == 13 || btyp->comp == 4) { j = OPT_nofhdfld; - FPrintHdFld__16(btyp, fld, adr); + FPrintHdFld__15(btyp, fld, adr); if (j != OPT_nofhdfld) { i = 1; while ((i < n && OPT_nofhdfld <= 2048)) { adr += btyp->size; - FPrintHdFld__16(btyp, fld, adr); + FPrintHdFld__15(btyp, fld, adr); i += 1; } } } } else if (typ->form == 13 || __STRCMP(fld->name, "@ptr") == 0) { - OPM_FPrint(&*FPrintStr__13_s->pvfp, ((LONGINT)(13))); - OPM_FPrint(&*FPrintStr__13_s->pvfp, adr); + OPM_FPrint(&*FPrintStr__12_s->pvfp, ((LONGINT)(13))); + OPM_FPrint(&*FPrintStr__12_s->pvfp, adr); OPT_nofhdfld += 1; } } -static void FPrintFlds__14 (OPT_Object fld, LONGINT adr, BOOLEAN visible) +static void FPrintFlds__13 (OPT_Object fld, LONGINT adr, BOOLEAN visible) { while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { - OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->vis); - OPT_FPrintName(&*FPrintStr__13_s->pbfp, (void*)fld->name, ((LONGINT)(256))); - OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->adr); + OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->vis); + OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)fld->name, ((LONGINT)(256))); + OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->adr); OPT_FPrintStr(fld->typ); - OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->typ->pbfp); - OPM_FPrint(&*FPrintStr__13_s->pvfp, fld->typ->pvfp); + OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->typ->pbfp); + OPM_FPrint(&*FPrintStr__12_s->pvfp, fld->typ->pvfp); } else { - FPrintHdFld__16(fld->typ, fld, fld->adr + adr); + FPrintHdFld__15(fld->typ, fld, fld->adr + adr); } fld = fld->link; } } -static void FPrintTProcs__18 (OPT_Object obj) +static void FPrintTProcs__17 (OPT_Object obj) { if (obj != NIL) { - FPrintTProcs__18(obj->left); + FPrintTProcs__17(obj->left); if (obj->mode == 13) { if (obj->vis != 0) { - OPM_FPrint(&*FPrintStr__13_s->pbfp, ((LONGINT)(13))); - OPM_FPrint(&*FPrintStr__13_s->pbfp, __ASHR(obj->adr, 16)); - OPT_FPrintSign(&*FPrintStr__13_s->pbfp, obj->typ, obj->link); - OPT_FPrintName(&*FPrintStr__13_s->pbfp, (void*)obj->name, ((LONGINT)(256))); + OPM_FPrint(&*FPrintStr__12_s->pbfp, ((LONGINT)(13))); + OPM_FPrint(&*FPrintStr__12_s->pbfp, __ASHR(obj->adr, 16)); + OPT_FPrintSign(&*FPrintStr__12_s->pbfp, obj->typ, obj->link); + OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)obj->name, ((LONGINT)(256))); } } - FPrintTProcs__18(obj->right); + FPrintTProcs__17(obj->right); } } @@ -548,11 +578,11 @@ void OPT_FPrintStr (OPT_Struct typ) OPT_Struct btyp = NIL; OPT_Object strobj = NIL, bstrobj = NIL; LONGINT pbfp, pvfp; - struct FPrintStr__13 _s; + struct FPrintStr__12 _s; _s.pbfp = &pbfp; _s.pvfp = &pvfp; - _s.lnk = FPrintStr__13_s; - FPrintStr__13_s = &_s; + _s.lnk = FPrintStr__12_s; + FPrintStr__12_s = &_s; if (!typ->fpdone) { OPT_IdFPrint(typ); pbfp = typ->idfp; @@ -589,11 +619,11 @@ void OPT_FPrintStr (OPT_Struct typ) OPM_FPrint(&pvfp, typ->align); OPM_FPrint(&pvfp, typ->n); OPT_nofhdfld = 0; - FPrintFlds__14(typ->link, ((LONGINT)(0)), 1); + FPrintFlds__13(typ->link, ((LONGINT)(0)), 1); if (OPT_nofhdfld > 2048) { OPM_Mark(225, typ->txtpos); } - FPrintTProcs__18(typ->link); + FPrintTProcs__17(typ->link); OPM_FPrint(&pvfp, pbfp); strobj = typ->strobj; if (strobj == NIL || strobj->name[0] == 0x00) { @@ -603,7 +633,7 @@ void OPT_FPrintStr (OPT_Struct typ) typ->pbfp = pbfp; typ->pvfp = pvfp; } - FPrintStr__13_s = _s.lnk; + FPrintStr__12_s = _s.lnk; } void OPT_FPrintObj (OPT_Object obj) @@ -947,6 +977,19 @@ static OPT_Object OPT_InTProc (SHORTINT mno) return _o_result; } +static OPT_Struct OPT_InTyp (LONGINT tag) +{ + OPT_Struct _o_result; + if (__IN(tag, 0x70)) { + _o_result = OPT_IntType(OPM_SymRInt()); + return _o_result; + } else { + _o_result = OPT_impCtxt.ref[__X(tag, ((LONGINT)(255)))]; + return _o_result; + } + __RETCHK; +} + static void OPT_InStruct (OPT_Struct *typ) { SHORTINT mno; @@ -957,7 +1000,7 @@ static void OPT_InStruct (OPT_Struct *typ) OPT_Object obj = NIL, last = NIL, fld = NIL, old = NIL, dummy = NIL; tag = OPM_SymRInt(); if (tag != 34) { - *typ = OPT_impCtxt.ref[__X(-tag, ((LONGINT)(255)))]; + *typ = OPT_InTyp(-tag); } else { ref = OPT_impCtxt.nofr; OPT_impCtxt.nofr += 1; @@ -1082,7 +1125,7 @@ static void OPT_InStruct (OPT_Struct *typ) } if (ref == OPT_impCtxt.minr) { while (ref < OPT_impCtxt.nofr) { - t = OPT_impCtxt.ref[__X(ref, ((LONGINT)(255)))]; + t = OPT_InTyp(ref); OPT_FPrintStr(t); obj = t->strobj; if (obj->name[0] != 0x00) { @@ -1151,9 +1194,9 @@ static OPT_Object OPT_InObj (SHORTINT mno) obj->vis = 1; if (tag <= 13) { obj->mode = 3; - obj->typ = OPT_impCtxt.ref[__X(tag, ((LONGINT)(255)))]; obj->conval = OPT_NewConst(); OPT_InConstant(tag, obj->conval); + obj->typ = OPT_InTyp(tag); } else if (tag >= 31) { obj->conval = OPT_NewConst(); obj->conval->intval = -1; @@ -1397,6 +1440,9 @@ static void OPT_OutStr (OPT_Struct typ) OPT_Object strobj = NIL; if (typ->ref < OPT_expCtxt.ref) { OPM_SymWInt(-typ->ref); + if (__IN(typ->ref, 0x70)) { + OPM_SymWInt(typ->size); + } } else { OPM_SymWInt(((LONGINT)(34))); typ->ref = OPT_expCtxt.ref; @@ -1494,6 +1540,7 @@ static void OPT_OutConstant (OPT_Object obj) break; case 4: case 5: case 6: OPM_SymWInt(obj->conval->intval); + OPM_SymWInt(obj->typ->size); break; case 9: OPM_SymWSet(obj->conval->setval); @@ -1700,15 +1747,6 @@ static void OPT_EnterTyp (OPS_Name name, SHORTINT form, INTEGER size, OPT_Struct *res = typ; } -static void OPT_EnterDerivedType (OPS_Name name, OPT_Struct typ, OPT_Object *obj) -{ - OPS_Name name__copy; - __DUPARR(name, OPS_Name); - OPT_Insert(name, &*obj); - (*obj)->mode = 5; - (*obj)->typ = typ; -} - static void OPT_EnterProc (OPS_Name name, INTEGER num) { OPT_Object obj = NIL; @@ -1742,8 +1780,8 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_niltyp); P(OPT_notyp); P(OPT_sysptrtyp); - P(OPT_LIntObj); __ENUMP(OPT_GlbMod, 64, P); + __ENUMP(OPT_IntTypes, 20, P); P(OPT_universe); P(OPT_syslink); __ENUMR(&OPT_impCtxt, OPT_ImpCtxt__typ, 6216, 1, P); @@ -1812,7 +1850,7 @@ export void *OPT__init(void) OPT_InitStruct(&OPT_niltyp, 11); OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp); OPT_EnterTyp((CHAR*)"PTR", 13, OPM_PointerSize, &OPT_sysptrtyp); - OPT_EnterTyp((CHAR*)"ADRINT", 5, OPM_LIntSize, &OPT_ainttyp); + OPT_EnterTyp((CHAR*)"ADRINT", 5, OPM_PointerSize, &OPT_ainttyp); OPT_EnterTyp((CHAR*)"INT8", 5, 1, &OPT_int8typ); OPT_EnterTyp((CHAR*)"INT16", 5, 2, &OPT_int16typ); OPT_EnterTyp((CHAR*)"INT32", 5, 4, &OPT_int32typ); @@ -1840,7 +1878,6 @@ export void *OPT__init(void) OPT_EnterTyp((CHAR*)"LONGINT", 6, OPM_LIntSize, &OPT_linttyp); OPT_EnterTyp((CHAR*)"LONGREAL", 8, OPM_LRealSize, &OPT_lrltyp); OPT_EnterTyp((CHAR*)"SHORTINT", 4, OPM_SIntSize, &OPT_sinttyp); - OPT_EnterDerivedType((CHAR*)"LINT", OPT_int64typ, &OPT_LIntObj); OPT_EnterBoolConst((CHAR*)"FALSE", ((LONGINT)(0))); OPT_EnterBoolConst((CHAR*)"TRUE", ((LONGINT)(1))); OPT_EnterProc((CHAR*)"HALT", 0); @@ -1878,5 +1915,12 @@ export void *OPT__init(void) OPT_impCtxt.ref[11] = OPT_niltyp; OPT_impCtxt.ref[12] = OPT_notyp; OPT_impCtxt.ref[13] = OPT_sysptrtyp; + OPT_IntTypes[1] = OPT_sinttyp; + OPT_IntTypes[2] = OPT_inttyp; + OPT_IntTypes[3] = OPT_linttyp; + OPT_IntTypes[5] = OPT_int8typ; + OPT_IntTypes[6] = OPT_int16typ; + OPT_IntTypes[7] = OPT_int32typ; + OPT_IntTypes[8] = OPT_int64typ; __ENDMOD; } diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index f1865573..9878e30b 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h @@ -93,12 +93,14 @@ import void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); import void OPT_Init (OPS_Name name, SET opt); import void OPT_Insert (OPS_Name name, OPT_Object *obj); import void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); +import OPT_Struct OPT_IntType (LONGINT size); import OPT_Const OPT_NewConst (void); import OPT_ConstExt OPT_NewExt (void); import OPT_Node OPT_NewNode (SHORTINT class); import OPT_Object OPT_NewObj (void); import OPT_Struct OPT_NewStr (SHORTINT form, SHORTINT comp); import void OPT_OpenScope (SHORTINT level, OPT_Object owner); +import OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir); import void *OPT__init(void); diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 638891f1..f74e0890 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPC.h" diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index b0551679..43ab4681 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 7ecd9794..7637b515 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index 832aaa35..0fee3539 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 660cd605..a5a93902 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index 3102ce18..76bda39d 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/SYSTEM.h b/bootstrap/unix-88/SYSTEM.h index 35620b9b..343404a4 100644 --- a/bootstrap/unix-88/SYSTEM.h +++ b/bootstrap/unix-88/SYSTEM.h @@ -60,12 +60,6 @@ typedef float REAL; typedef double LONGREAL; typedef void* SYSTEM_PTR; -// Unsigned variants are for use by shift and rotate macros. - -typedef unsigned char U_SYSTEM_BYTE; -typedef unsigned char U_CHAR; -typedef unsigned char U_SHORTINT; - // For 32 bit builds, the size of LONGINT depends on a make option: #if (__SIZEOF_POINTER__ == 8) || defined(LARGE) || defined(_WIN64) @@ -80,9 +74,20 @@ typedef unsigned char U_SHORTINT; typedef unsigned long U_LONGINT; #endif +// Unsigned variants are for use by shift and rotate macros. + +typedef unsigned char U_SYSTEM_BYTE; +typedef unsigned char U_CHAR; +typedef unsigned char U_SHORTINT; + typedef U_LONGINT SET; typedef U_LONGINT U_SET; +typedef SYSTEM_CARD8 U_SYSTEM_INT8; +typedef SYSTEM_CARD16 U_SYSTEM_INT16; +typedef SYSTEM_CARD32 U_SYSTEM_INT32; +typedef SYSTEM_CARD64 U_SYSTEM_INT64; + // OS Memory allocation interfaces are in PlatformXXX.Mod @@ -178,7 +183,7 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __ABSFD(x) SYSTEM_ABSD((double)(x)) #define __CAP(ch) ((CHAR)((ch)&0x5f)) #define __ODD(x) ((x)&1) -#define __IN(x, s) (((s)>>(x))&1) +#define __IN(x, s) ((x)>=0 && (x)<(8*sizeof(SET)) && ((((U_SET)(s))>>(x))&1)) #define __SETOF(x) ((SET)1<<(x)) #define __SETRNG(l, h) ((~(SET)0<<(l))&~(SET)0>>(8*sizeof(SET)-1-(h))) #define __MASK(x, m) ((x)&~(m)) diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index 2df49d25..bd57ef4e 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index 9505fe03..aa97eeac 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index 0e0b4725..cd9388a6 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Files.h" diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index 3086fb00..b591e699 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/Vishap.c b/bootstrap/unix-88/Vishap.c index a487fe66..19624204 100644 --- a/bootstrap/unix-88/Vishap.c +++ b/bootstrap/unix-88/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkamSf */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/unix-88/errors.c b/bootstrap/unix-88/errors.c index 8489752b..5493978e 100644 --- a/bootstrap/unix-88/errors.c +++ b/bootstrap/unix-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/unix-88/errors.h b/bootstrap/unix-88/errors.h index a5af5a7d..8ce5a106 100644 --- a/bootstrap/unix-88/errors.h +++ b/bootstrap/unix-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index fce52835..72df4f99 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index 9e5aed51..4523936a 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/vt100.c b/bootstrap/unix-88/vt100.c index 0e0401e3..efcf43ab 100644 --- a/bootstrap/unix-88/vt100.c +++ b/bootstrap/unix-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/unix-88/vt100.h b/bootstrap/unix-88/vt100.h index eb6374ea..65ae6d58 100644 --- a/bootstrap/unix-88/vt100.h +++ b/bootstrap/unix-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index b0d48f0a..947863a2 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -13,6 +13,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/08/26] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/08/30] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index 38a63260..33303334 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Console.c b/bootstrap/windows-48/Console.c index 52a0ced0..3d09ab84 100644 --- a/bootstrap/windows-48/Console.c +++ b/bootstrap/windows-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Platform.h" diff --git a/bootstrap/windows-48/Console.h b/bootstrap/windows-48/Console.h index 2c462da9..0e7cb823 100644 --- a/bootstrap/windows-48/Console.h +++ b/bootstrap/windows-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 966fb2ca..5b20dd10 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index 7e437f34..85814163 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index cca2fc74..5fcaf193 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tskSfF */ #include "SYSTEM.h" struct Heap__1 { diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index d05f688c..4247d33d 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index d76a50a2..148c062a 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Heap.h" diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index 78c8d49e..85b1ec59 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index 60b37750..9a06ac24 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" @@ -34,9 +34,7 @@ export void OPB_In (OPT_Node *x, OPT_Node y); export void OPB_Index (OPT_Node *x, OPT_Node y); export void OPB_Inittd (OPT_Node *inittd, OPT_Node *last, OPT_Struct typ); static BOOLEAN OPB_IntToBool (LONGINT i); -static OPT_Struct OPB_IntType (LONGINT size); export void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y); -static LONGINT OPB_LongerSize (LONGINT i); export void OPB_MOp (SHORTINT op, OPT_Node *x); export OPT_Node OPB_NewBoolConst (BOOLEAN boolval); export OPT_Node OPB_NewIntConst (LONGINT intval); @@ -53,8 +51,6 @@ export void OPB_Return (OPT_Node *x, OPT_Object proc); export void OPB_SetElem (OPT_Node *x); static void OPB_SetIntType (OPT_Node node); export void OPB_SetRange (OPT_Node *x, OPT_Node y); -static LONGINT OPB_ShorterSize (LONGINT i); -static INTEGER OPB_SignedByteSize (LONGINT n); export void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno); export void OPB_StPar0 (OPT_Node *par0, INTEGER fctno); export void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno); @@ -224,68 +220,20 @@ OPT_Node OPB_EmptySet (void) return _o_result; } -static INTEGER OPB_SignedByteSize (LONGINT n) +static void OPB_SetIntType (OPT_Node node) { - INTEGER _o_result; INTEGER b; - if (n < 0) { - n = -(n + 1); + LONGINT n; + if (node->conval->intval >= 0) { + n = node->conval->intval; + } else { + n = -(node->conval->intval + 1); } b = 1; while ((b < 8 && __ASH(n, -(__ASHL(b, 3) - 1)) != 0)) { b += 1; } - _o_result = b; - return _o_result; -} - -static LONGINT OPB_ShorterSize (LONGINT i) -{ - LONGINT _o_result; - if (i >= (int)OPM_LIntSize) { - _o_result = OPM_IntSize; - return _o_result; - } else { - _o_result = OPM_SIntSize; - return _o_result; - } - __RETCHK; -} - -static LONGINT OPB_LongerSize (LONGINT i) -{ - LONGINT _o_result; - if (i <= (int)OPM_SIntSize) { - _o_result = OPM_IntSize; - return _o_result; - } else { - _o_result = OPM_LIntSize; - return _o_result; - } - __RETCHK; -} - -static OPT_Struct OPB_IntType (LONGINT size) -{ - OPT_Struct _o_result; - OPT_Struct result = NIL; - if (size <= OPT_sinttyp->size) { - result = OPT_sinttyp; - } else if (size <= OPT_inttyp->size) { - result = OPT_inttyp; - } else { - result = OPT_linttyp; - } - if (size > OPT_linttyp->size) { - OPB_err(203); - } - _o_result = result; - return _o_result; -} - -static void OPB_SetIntType (OPT_Node node) -{ - node->typ = OPB_IntType(OPB_SignedByteSize(node->conval->intval)); + node->typ = OPT_IntType(b); } OPT_Node OPB_NewIntConst (LONGINT intval) @@ -429,16 +377,16 @@ void OPB_Field (OPT_Node *x, OPT_Object y) } } -static struct TypTest__61 { +static struct TypTest__57 { OPT_Node *x; OPT_Object *obj; BOOLEAN *guard; - struct TypTest__61 *lnk; -} *TypTest__61_s; + struct TypTest__57 *lnk; +} *TypTest__57_s; -static void GTT__62 (OPT_Struct t0, OPT_Struct t1); +static void GTT__58 (OPT_Struct t0, OPT_Struct t1); -static void GTT__62 (OPT_Struct t0, OPT_Struct t1) +static void GTT__58 (OPT_Struct t0, OPT_Struct t1) { OPT_Node node = NIL; OPT_Struct t = NIL; @@ -451,54 +399,54 @@ static void GTT__62 (OPT_Struct t0, OPT_Struct t1) t1 = t1->BaseTyp; } if (t1 == t0 || t0->form == 0) { - if (*TypTest__61_s->guard) { - OPB_BindNodes(5, NIL, &*TypTest__61_s->x, NIL); - (*TypTest__61_s->x)->readonly = (*TypTest__61_s->x)->left->readonly; + if (*TypTest__57_s->guard) { + OPB_BindNodes(5, NIL, &*TypTest__57_s->x, NIL); + (*TypTest__57_s->x)->readonly = (*TypTest__57_s->x)->left->readonly; } else { node = OPT_NewNode(11); node->subcl = 16; - node->left = *TypTest__61_s->x; - node->obj = *TypTest__61_s->obj; - *TypTest__61_s->x = node; + node->left = *TypTest__57_s->x; + node->obj = *TypTest__57_s->obj; + *TypTest__57_s->x = node; } } else { OPB_err(85); } } else if (t0 != t1) { OPB_err(85); - } else if (!*TypTest__61_s->guard) { - if ((*TypTest__61_s->x)->class == 5) { + } else if (!*TypTest__57_s->guard) { + if ((*TypTest__57_s->x)->class == 5) { node = OPT_NewNode(11); node->subcl = 16; - node->left = *TypTest__61_s->x; - node->obj = *TypTest__61_s->obj; - *TypTest__61_s->x = node; + node->left = *TypTest__57_s->x; + node->obj = *TypTest__57_s->obj; + *TypTest__57_s->x = node; } else { - *TypTest__61_s->x = OPB_NewBoolConst(1); + *TypTest__57_s->x = OPB_NewBoolConst(1); } } } void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) { - struct TypTest__61 _s; + struct TypTest__57 _s; _s.x = x; _s.obj = &obj; _s.guard = &guard; - _s.lnk = TypTest__61_s; - TypTest__61_s = &_s; + _s.lnk = TypTest__57_s; + TypTest__57_s = &_s; if (OPB_NotVar(*x)) { OPB_err(112); } else if ((*x)->typ->form == 13) { if (((*x)->typ->BaseTyp->comp != 4 && (*x)->typ != OPT_sysptrtyp)) { OPB_err(85); } else if (obj->typ->form == 13) { - GTT__62((*x)->typ->BaseTyp, obj->typ->BaseTyp); + GTT__58((*x)->typ->BaseTyp, obj->typ->BaseTyp); } else { OPB_err(86); } } else if (((((*x)->typ->comp == 4 && (*x)->class == 1)) && obj->typ->comp == 4)) { - GTT__62((*x)->typ, obj->typ); + GTT__58((*x)->typ, obj->typ); } else { OPB_err(87); } @@ -507,7 +455,7 @@ void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) } else { (*x)->typ = OPT_booltyp; } - TypTest__61_s = _s.lnk; + TypTest__57_s = _s.lnk; } void OPB_In (OPT_Node *x, OPT_Node y) @@ -573,13 +521,13 @@ static void OPB_CheckRealType (INTEGER f, INTEGER nr, OPT_Const x) x->intval = -1; } -static struct MOp__30 { - struct MOp__30 *lnk; -} *MOp__30_s; +static struct MOp__28 { + struct MOp__28 *lnk; +} *MOp__28_s; -static OPT_Node NewOp__31 (SHORTINT op, OPT_Struct typ, OPT_Node z); +static OPT_Node NewOp__29 (SHORTINT op, OPT_Struct typ, OPT_Node z); -static OPT_Node NewOp__31 (SHORTINT op, OPT_Struct typ, OPT_Node z) +static OPT_Node NewOp__29 (SHORTINT op, OPT_Struct typ, OPT_Node z) { OPT_Node _o_result; OPT_Node node = NIL; @@ -596,9 +544,9 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) INTEGER f; OPT_Struct typ = NIL; OPT_Node z = NIL; - struct MOp__30 _s; - _s.lnk = MOp__30_s; - MOp__30_s = &_s; + struct MOp__28 _s; + _s.lnk = MOp__28_s; + MOp__28_s = &_s; z = *x; if (z->class == 8 || z->class == 9) { OPB_err(126); @@ -612,7 +560,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->conval->intval = OPB_BoolToInt(!OPB_IntToBool(z->conval->intval)); z->obj = NIL; } else { - z = NewOp__31(op, typ, z); + z = NewOp__29(op, typ, z); } } else { OPB_err(98); @@ -640,7 +588,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } z->obj = NIL; } else { - z = NewOp__31(op, typ, z); + z = NewOp__29(op, typ, z); } } else { OPB_err(97); @@ -661,7 +609,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } z->obj = NIL; } else { - z = NewOp__31(op, typ, z); + z = NewOp__29(op, typ, z); } } else { OPB_err(111); @@ -673,7 +621,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->conval->intval = (int)__CAP((CHAR)z->conval->intval); z->obj = NIL; } else { - z = NewOp__31(op, typ, z); + z = NewOp__29(op, typ, z); } } else { OPB_err(111); @@ -686,7 +634,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->conval->intval = OPB_BoolToInt(__ODD(z->conval->intval)); z->obj = NIL; } else { - z = NewOp__31(op, typ, z); + z = NewOp__29(op, typ, z); } } else { OPB_err(111); @@ -699,7 +647,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) f = 10; } if (z->class < 7 || f == 10) { - z = NewOp__31(op, typ, z); + z = NewOp__29(op, typ, z); } else { OPB_err(127); } @@ -708,7 +656,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) case 25: if ((__IN(f, 0x70) && z->class == 7)) { if ((0 <= z->conval->intval && z->conval->intval <= -1)) { - z = NewOp__31(op, typ, z); + z = NewOp__29(op, typ, z); } else { OPB_err(219); } @@ -725,7 +673,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } } *x = z; - MOp__30_s = _s.lnk; + MOp__28_s = _s.lnk; } static void OPB_CheckPtr (OPT_Node x, OPT_Node y) @@ -921,7 +869,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) if (x->typ->size <= y->typ->size) { x->typ = y->typ; } else { - x->typ = OPB_IntType(x->typ->size); + x->typ = OPT_IntType(x->typ->size); } } else if (g == 7) { x->typ = OPT_realtyp; @@ -1178,7 +1126,7 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) if (__IN(g, 0x70)) { if (f > g) { OPB_SetIntType(*x); - if ((int)(*x)->typ->form > g) { + if ((*x)->typ->size > typ->size) { OPB_err(203); (*x)->conval->intval = 1; } @@ -1219,15 +1167,15 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) (*x)->typ = typ; } -static struct Op__40 { +static struct Op__38 { INTEGER *f, *g; - struct Op__40 *lnk; -} *Op__40_s; + struct Op__38 *lnk; +} *Op__38_s; -static void NewOp__41 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y); -static BOOLEAN strings__43 (OPT_Node *x, OPT_Node *y); +static void NewOp__39 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y); +static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y); -static void NewOp__41 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y) +static void NewOp__39 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y) { OPT_Node node = NIL; node = OPT_NewNode(12); @@ -1238,29 +1186,29 @@ static void NewOp__41 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y) *x = node; } -static BOOLEAN strings__43 (OPT_Node *x, OPT_Node *y) +static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) { BOOLEAN _o_result; BOOLEAN ok, xCharArr, yCharArr; - xCharArr = (__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp->form == 3) || *Op__40_s->f == 10; - yCharArr = (__IN((*y)->typ->comp, 0x0c) && (*y)->typ->BaseTyp->form == 3) || *Op__40_s->g == 10; - if ((((xCharArr && *Op__40_s->g == 3)) && (*y)->class == 7)) { + xCharArr = (__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp->form == 3) || *Op__38_s->f == 10; + yCharArr = (__IN((*y)->typ->comp, 0x0c) && (*y)->typ->BaseTyp->form == 3) || *Op__38_s->g == 10; + if ((((xCharArr && *Op__38_s->g == 3)) && (*y)->class == 7)) { OPB_CharToString(*y); - *Op__40_s->g = 10; + *Op__38_s->g = 10; yCharArr = 1; } - if ((((yCharArr && *Op__40_s->f == 3)) && (*x)->class == 7)) { + if ((((yCharArr && *Op__38_s->f == 3)) && (*x)->class == 7)) { OPB_CharToString(*x); - *Op__40_s->f = 10; + *Op__38_s->f = 10; xCharArr = 1; } ok = (xCharArr && yCharArr); if (ok) { - if ((*Op__40_s->f == 10 && (*x)->conval->intval2 == 1)) { + if ((*Op__38_s->f == 10 && (*x)->conval->intval2 == 1)) { (*x)->typ = OPT_chartyp; (*x)->conval->intval = 0; OPB_Index(&*y, OPB_NewIntConst(((LONGINT)(0)))); - } else if ((*Op__40_s->g == 10 && (*y)->conval->intval2 == 1)) { + } else if ((*Op__38_s->g == 10 && (*y)->conval->intval2 == 1)) { (*y)->typ = OPT_chartyp; (*y)->conval->intval = 0; OPB_Index(&*x, OPB_NewIntConst(((LONGINT)(0)))); @@ -1277,11 +1225,11 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPT_Struct typ = NIL; BOOLEAN do_; LONGINT val; - struct Op__40 _s; + struct Op__38 _s; _s.f = &f; _s.g = &g; - _s.lnk = Op__40_s; - Op__40_s = &_s; + _s.lnk = Op__38_s; + Op__38_s = &_s; z = *x; if (((z->class == 8 || z->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); @@ -1393,7 +1341,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) typ = OPT_undftyp; } if (do_) { - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); } break; case 2: @@ -1412,7 +1360,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPB_err(102); typ = OPT_undftyp; } - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); break; case 3: do_ = 1; @@ -1435,7 +1383,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) typ = OPT_undftyp; } if (do_) { - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); } break; case 4: @@ -1453,7 +1401,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPB_err(104); typ = OPT_undftyp; } - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); break; case 5: if (f == 2) { @@ -1463,7 +1411,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } } else if ((y->class == 7 && OPB_IntToBool(y->conval->intval))) { } else { - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); } } else if (f != 0) { OPB_err(94); @@ -1486,7 +1434,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } } if (do_) { - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); } break; case 7: @@ -1495,7 +1443,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) typ = OPT_undftyp; } if ((!__IN(f, 0x70) || y->class != 7) || y->conval->intval != 0) { - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); } break; case 8: @@ -1506,7 +1454,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } } else if ((y->class == 7 && !OPB_IntToBool(y->conval->intval))) { } else { - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); } } else if (f != 0) { OPB_err(95); @@ -1514,16 +1462,16 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 9: case 10: - if (__IN(f, 0x6bff) || strings__43(&z, &y)) { + if (__IN(f, 0x6bff) || strings__41(&z, &y)) { typ = OPT_booltyp; } else { OPB_err(107); typ = OPT_undftyp; } - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); break; case 11: case 12: case 13: case 14: - if (__IN(f, 0x01f9) || strings__43(&z, &y)) { + if (__IN(f, 0x01f9) || strings__41(&z, &y)) { typ = OPT_booltyp; } else { OPM_LogWLn(); @@ -1532,7 +1480,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPB_err(108); typ = OPT_undftyp; } - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); break; default: OPM_LogWStr((CHAR*)"unhandled case in OPB.Op, op = ", (LONGINT)32); @@ -1542,7 +1490,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } } *x = z; - Op__40_s = _s.lnk; + Op__38_s = _s.lnk; } void OPB_SetRange (OPT_Node *x, OPT_Node y) @@ -1894,8 +1842,13 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 10: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((__IN(f, 0x70) && x->typ->size > (int)OPM_SIntSize)) { - OPB_Convert(&x, OPB_IntType(OPB_ShorterSize(x->typ->size))); + } else if (__IN(f, 0x70)) { + typ = OPT_ShorterOrLongerType(x->typ, -1); + if (typ == NIL) { + OPB_err(111); + } else { + OPB_Convert(&x, typ); + } } else if (f == 8) { OPB_Convert(&x, OPT_realtyp); } else { @@ -1905,8 +1858,13 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 11: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((__IN(f, 0x70) && x->typ->size < (int)OPM_LIntSize)) { - OPB_Convert(&x, OPB_IntType(OPB_LongerSize(x->typ->size))); + } else if (__IN(f, 0x70)) { + typ = OPT_ShorterOrLongerType(x->typ, 1); + if (typ == NIL) { + OPB_err(111); + } else { + OPB_Convert(&x, typ); + } } else if (f == 7) { OPB_Convert(&x, OPT_lrltyp); } else if (f == 3) { @@ -2043,13 +2001,13 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) *par0 = x; } -static struct StPar1__56 { - struct StPar1__56 *lnk; -} *StPar1__56_s; +static struct StPar1__52 { + struct StPar1__52 *lnk; +} *StPar1__52_s; -static OPT_Node NewOp__57 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right); +static OPT_Node NewOp__53 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right); -static OPT_Node NewOp__57 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right) +static OPT_Node NewOp__53 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right) { OPT_Node _o_result; OPT_Node node = NIL; @@ -2066,9 +2024,9 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) INTEGER f, L; OPT_Struct typ = NIL; OPT_Node p = NIL, t = NIL; - struct StPar1__56 _s; - _s.lnk = StPar1__56_s; - StPar1__56_s = &_s; + struct StPar1__52 _s; + _s.lnk = StPar1__52_s; + StPar1__52_s = &_s; p = *par0; f = x->typ->form; switch (fctno) { @@ -2084,7 +2042,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) OPB_err(111); } } - p = NewOp__57(19, fctno, p, x); + p = NewOp__53(19, fctno, p, x); p->typ = OPT_notyp; } break; @@ -2095,7 +2053,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > (int)OPM_MaxSet))) { OPB_err(202); } - p = NewOp__57(19, fctno, p, x); + p = NewOp__53(19, fctno, p, x); } else { OPB_err(111); } @@ -2120,7 +2078,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) p = p->left; x->conval->intval += 1; } - p = NewOp__57(12, 19, p, x); + p = NewOp__53(12, 19, p, x); p->typ = OPT_linttyp; } else { p = x; @@ -2142,7 +2100,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) t = x; x = p; p = t; - p = NewOp__57(19, 18, p, x); + p = NewOp__53(19, 18, p, x); } else { OPB_err(111); } @@ -2168,7 +2126,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) } p->obj = NIL; } else { - p = NewOp__57(12, 17, p, x); + p = NewOp__53(12, 17, p, x); p->typ = OPT_linttyp; } } else { @@ -2199,9 +2157,9 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) OPB_err(111); } else { if (fctno == 22) { - p = NewOp__57(12, 27, p, x); + p = NewOp__53(12, 27, p, x); } else { - p = NewOp__57(12, 28, p, x); + p = NewOp__53(12, 28, p, x); } p->typ = p->left->typ; } @@ -2218,7 +2176,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) x = p; p = t; } - p = NewOp__57(19, fctno, p, x); + p = NewOp__53(19, fctno, p, x); } else { OPB_err(111); } @@ -2228,7 +2186,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (__IN(f, 0x70)) { - p = NewOp__57(12, 26, p, x); + p = NewOp__53(12, 26, p, x); } else { OPB_err(111); } @@ -2252,7 +2210,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (__IN(f, 0x70)) { - p = NewOp__57(19, 30, p, x); + p = NewOp__53(19, 30, p, x); } else { OPB_err(111); } @@ -2298,7 +2256,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) break; } *par0 = p; - StPar1__56_s = _s.lnk; + StPar1__52_s = _s.lnk; } void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n) diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index e7a96131..81b3745b 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 02a24b4d..8a3a54cf 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "OPM.h" diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index 7aea7283..dcd53d63 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 88c3bd4d..65ebb8b0 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index 3c2be746..a61c632e 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index a0c19958..5620c5ec 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPB.h" #include "OPM.h" @@ -24,7 +24,7 @@ export LONGINT *OPP__1__typ; static void OPP_ActualParameters (OPT_Node *aparlist, OPT_Object fpar); static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned); static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq); -static void OPP_CaseLabelList (OPT_Node *lab, INTEGER LabelForm, INTEGER *n, OPP_CaseTable tab); +static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, OPP_CaseTable tab); static void OPP_CheckMark (SHORTINT *vis); static void OPP_CheckSym (INTEGER s); static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_); @@ -1163,7 +1163,7 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) ProcedureDeclaration__16_s = _s.lnk; } -static void OPP_CaseLabelList (OPT_Node *lab, INTEGER LabelForm, INTEGER *n, OPP_CaseTable tab) +static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, OPP_CaseTable tab) { OPT_Node x = NIL, y = NIL, lastlab = NIL; INTEGER i, f; @@ -1180,10 +1180,10 @@ static void OPP_CaseLabelList (OPT_Node *lab, INTEGER LabelForm, INTEGER *n, OPP xval = 1; } if (__IN(f, 0x70)) { - if (LabelForm < f) { + if (!__IN(LabelTyp->form, 0x70) || LabelTyp->size < x->typ->size) { OPP_err(60); } - } else if (LabelForm != f) { + } else if ((int)LabelTyp->form != f) { OPP_err(60); } if (OPP_sym == 21) { @@ -1262,7 +1262,7 @@ static void CasePart__31 (OPT_Node *x) n = 0; for (;;) { if (OPP_sym < 40) { - OPP_CaseLabelList(&lab, (*x)->typ->form, &n, tab); + OPP_CaseLabelList(&lab, (*x)->typ, &n, tab); OPP_CheckSym(20); OPP_StatSeq(&y); OPB_Construct(17, &lab, y); @@ -1471,7 +1471,7 @@ static void OPP_StatSeq (OPT_Node *stat) SetPos__35(z); OPB_Link(&*stat, &last, z); y = OPB_NewLeaf(t); - } else if (y->typ->form < 4 || y->typ->form > x->left->typ->form) { + } else if (!__IN(y->typ->form, 0x70) || y->typ->size > x->left->typ->size) { OPP_err(113); } OPB_Link(&*stat, &last, x); diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index 6c24817c..be6b6252 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index 85c8b275..1f721944 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index 313c0ac7..ecd93034 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index cbd147e6..8efa4803 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" @@ -84,11 +84,11 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; -static OPT_Object OPT_LIntObj; export SHORTINT OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; export BOOLEAN OPT_SYSimported; +static OPT_Struct OPT_IntTypes[20]; static OPT_Object OPT_universe, OPT_syslink; static OPT_ImpCtxt OPT_impCtxt; static OPT_ExpCtxt OPT_expCtxt; @@ -106,7 +106,6 @@ export void OPT_Close (void); export void OPT_CloseScope (void); static void OPT_DebugStruct (OPT_Struct btyp); static void OPT_EnterBoolConst (OPS_Name name, LONGINT value); -static void OPT_EnterDerivedType (OPS_Name name, OPT_Struct typ, OPT_Object *obj); static void OPT_EnterProc (OPS_Name name, INTEGER num); static void OPT_EnterTyp (OPS_Name name, SHORTINT form, INTEGER size, OPT_Struct *res); export void OPT_Export (BOOLEAN *ext, BOOLEAN *new); @@ -128,10 +127,12 @@ static OPT_Object OPT_InObj (SHORTINT mno); static void OPT_InSign (SHORTINT mno, OPT_Struct *res, OPT_Object *par); static void OPT_InStruct (OPT_Struct *typ); static OPT_Object OPT_InTProc (SHORTINT mno); +static OPT_Struct OPT_InTyp (LONGINT tag); export void OPT_Init (OPS_Name name, SET opt); static void OPT_InitStruct (OPT_Struct *typ, SHORTINT form); export void OPT_Insert (OPS_Name name, OPT_Object *obj); export void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); +export OPT_Struct OPT_IntType (LONGINT size); export OPT_Const OPT_NewConst (void); export OPT_ConstExt OPT_NewExt (void); export OPT_Node OPT_NewNode (SHORTINT class); @@ -147,6 +148,7 @@ static void OPT_OutObj (OPT_Object obj); static void OPT_OutSign (OPT_Struct result, OPT_Object par); static void OPT_OutStr (OPT_Struct typ); static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj); +export OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir); static void OPT_err (INTEGER n); @@ -155,6 +157,34 @@ static void OPT_err (INTEGER n) OPM_err(n); } +OPT_Struct OPT_IntType (LONGINT size) +{ + OPT_Struct _o_result; + INTEGER i; + i = 1; + while ((OPT_IntTypes[__X(i, ((LONGINT)(20)))]->size < size && OPT_IntTypes[__X(i + 1, ((LONGINT)(20)))] != NIL)) { + i += 1; + } + _o_result = OPT_IntTypes[__X(i, ((LONGINT)(20)))]; + return _o_result; +} + +OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir) +{ + OPT_Struct _o_result; + INTEGER i; + __ASSERT(__IN(x->form, 0x70), 0); + __ASSERT(dir == 1 || dir == -1, 0); + __ASSERT(x->BaseTyp == OPT_undftyp, 0); + i = 0; + while ((OPT_IntTypes[__X(i, ((LONGINT)(20)))] != x && i < 20)) { + i += 1; + } + __ASSERT(i < 19, 0); + _o_result = OPT_IntTypes[__X(i + dir, ((LONGINT)(20)))]; + return _o_result; +} + OPT_Const OPT_NewConst (void) { OPT_Const _o_result; @@ -467,21 +497,21 @@ void OPT_IdFPrint (OPT_Struct typ) } } -static struct FPrintStr__13 { +static struct FPrintStr__12 { LONGINT *pbfp, *pvfp; - struct FPrintStr__13 *lnk; -} *FPrintStr__13_s; + struct FPrintStr__12 *lnk; +} *FPrintStr__12_s; -static void FPrintFlds__14 (OPT_Object fld, LONGINT adr, BOOLEAN visible); -static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, LONGINT adr); -static void FPrintTProcs__18 (OPT_Object obj); +static void FPrintFlds__13 (OPT_Object fld, LONGINT adr, BOOLEAN visible); +static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr); +static void FPrintTProcs__17 (OPT_Object obj); -static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, LONGINT adr) +static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr) { LONGINT i, j, n; OPT_Struct btyp = NIL; if (typ->comp == 4) { - FPrintFlds__14(typ->link, adr, 0); + FPrintFlds__13(typ->link, adr, 0); } else if (typ->comp == 2) { btyp = typ->BaseTyp; n = typ->n; @@ -491,53 +521,53 @@ static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, LONGINT adr) } if (btyp->form == 13 || btyp->comp == 4) { j = OPT_nofhdfld; - FPrintHdFld__16(btyp, fld, adr); + FPrintHdFld__15(btyp, fld, adr); if (j != OPT_nofhdfld) { i = 1; while ((i < n && OPT_nofhdfld <= 2048)) { adr += btyp->size; - FPrintHdFld__16(btyp, fld, adr); + FPrintHdFld__15(btyp, fld, adr); i += 1; } } } } else if (typ->form == 13 || __STRCMP(fld->name, "@ptr") == 0) { - OPM_FPrint(&*FPrintStr__13_s->pvfp, ((LONGINT)(13))); - OPM_FPrint(&*FPrintStr__13_s->pvfp, adr); + OPM_FPrint(&*FPrintStr__12_s->pvfp, ((LONGINT)(13))); + OPM_FPrint(&*FPrintStr__12_s->pvfp, adr); OPT_nofhdfld += 1; } } -static void FPrintFlds__14 (OPT_Object fld, LONGINT adr, BOOLEAN visible) +static void FPrintFlds__13 (OPT_Object fld, LONGINT adr, BOOLEAN visible) { while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { - OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->vis); - OPT_FPrintName(&*FPrintStr__13_s->pbfp, (void*)fld->name, ((LONGINT)(256))); - OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->adr); + OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->vis); + OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)fld->name, ((LONGINT)(256))); + OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->adr); OPT_FPrintStr(fld->typ); - OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->typ->pbfp); - OPM_FPrint(&*FPrintStr__13_s->pvfp, fld->typ->pvfp); + OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->typ->pbfp); + OPM_FPrint(&*FPrintStr__12_s->pvfp, fld->typ->pvfp); } else { - FPrintHdFld__16(fld->typ, fld, fld->adr + adr); + FPrintHdFld__15(fld->typ, fld, fld->adr + adr); } fld = fld->link; } } -static void FPrintTProcs__18 (OPT_Object obj) +static void FPrintTProcs__17 (OPT_Object obj) { if (obj != NIL) { - FPrintTProcs__18(obj->left); + FPrintTProcs__17(obj->left); if (obj->mode == 13) { if (obj->vis != 0) { - OPM_FPrint(&*FPrintStr__13_s->pbfp, ((LONGINT)(13))); - OPM_FPrint(&*FPrintStr__13_s->pbfp, __ASHR(obj->adr, 16)); - OPT_FPrintSign(&*FPrintStr__13_s->pbfp, obj->typ, obj->link); - OPT_FPrintName(&*FPrintStr__13_s->pbfp, (void*)obj->name, ((LONGINT)(256))); + OPM_FPrint(&*FPrintStr__12_s->pbfp, ((LONGINT)(13))); + OPM_FPrint(&*FPrintStr__12_s->pbfp, __ASHR(obj->adr, 16)); + OPT_FPrintSign(&*FPrintStr__12_s->pbfp, obj->typ, obj->link); + OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)obj->name, ((LONGINT)(256))); } } - FPrintTProcs__18(obj->right); + FPrintTProcs__17(obj->right); } } @@ -547,11 +577,11 @@ void OPT_FPrintStr (OPT_Struct typ) OPT_Struct btyp = NIL; OPT_Object strobj = NIL, bstrobj = NIL; LONGINT pbfp, pvfp; - struct FPrintStr__13 _s; + struct FPrintStr__12 _s; _s.pbfp = &pbfp; _s.pvfp = &pvfp; - _s.lnk = FPrintStr__13_s; - FPrintStr__13_s = &_s; + _s.lnk = FPrintStr__12_s; + FPrintStr__12_s = &_s; if (!typ->fpdone) { OPT_IdFPrint(typ); pbfp = typ->idfp; @@ -588,11 +618,11 @@ void OPT_FPrintStr (OPT_Struct typ) OPM_FPrint(&pvfp, typ->align); OPM_FPrint(&pvfp, typ->n); OPT_nofhdfld = 0; - FPrintFlds__14(typ->link, ((LONGINT)(0)), 1); + FPrintFlds__13(typ->link, ((LONGINT)(0)), 1); if (OPT_nofhdfld > 2048) { OPM_Mark(225, typ->txtpos); } - FPrintTProcs__18(typ->link); + FPrintTProcs__17(typ->link); OPM_FPrint(&pvfp, pbfp); strobj = typ->strobj; if (strobj == NIL || strobj->name[0] == 0x00) { @@ -602,7 +632,7 @@ void OPT_FPrintStr (OPT_Struct typ) typ->pbfp = pbfp; typ->pvfp = pvfp; } - FPrintStr__13_s = _s.lnk; + FPrintStr__12_s = _s.lnk; } void OPT_FPrintObj (OPT_Object obj) @@ -946,6 +976,19 @@ static OPT_Object OPT_InTProc (SHORTINT mno) return _o_result; } +static OPT_Struct OPT_InTyp (LONGINT tag) +{ + OPT_Struct _o_result; + if (__IN(tag, 0x70)) { + _o_result = OPT_IntType(OPM_SymRInt()); + return _o_result; + } else { + _o_result = OPT_impCtxt.ref[__X(tag, ((LONGINT)(255)))]; + return _o_result; + } + __RETCHK; +} + static void OPT_InStruct (OPT_Struct *typ) { SHORTINT mno; @@ -956,7 +999,7 @@ static void OPT_InStruct (OPT_Struct *typ) OPT_Object obj = NIL, last = NIL, fld = NIL, old = NIL, dummy = NIL; tag = OPM_SymRInt(); if (tag != 34) { - *typ = OPT_impCtxt.ref[__X(-tag, ((LONGINT)(255)))]; + *typ = OPT_InTyp(-tag); } else { ref = OPT_impCtxt.nofr; OPT_impCtxt.nofr += 1; @@ -1081,7 +1124,7 @@ static void OPT_InStruct (OPT_Struct *typ) } if (ref == OPT_impCtxt.minr) { while (ref < OPT_impCtxt.nofr) { - t = OPT_impCtxt.ref[__X(ref, ((LONGINT)(255)))]; + t = OPT_InTyp(ref); OPT_FPrintStr(t); obj = t->strobj; if (obj->name[0] != 0x00) { @@ -1150,9 +1193,9 @@ static OPT_Object OPT_InObj (SHORTINT mno) obj->vis = 1; if (tag <= 13) { obj->mode = 3; - obj->typ = OPT_impCtxt.ref[__X(tag, ((LONGINT)(255)))]; obj->conval = OPT_NewConst(); OPT_InConstant(tag, obj->conval); + obj->typ = OPT_InTyp(tag); } else if (tag >= 31) { obj->conval = OPT_NewConst(); obj->conval->intval = -1; @@ -1396,6 +1439,9 @@ static void OPT_OutStr (OPT_Struct typ) OPT_Object strobj = NIL; if (typ->ref < OPT_expCtxt.ref) { OPM_SymWInt(-typ->ref); + if (__IN(typ->ref, 0x70)) { + OPM_SymWInt(typ->size); + } } else { OPM_SymWInt(((LONGINT)(34))); typ->ref = OPT_expCtxt.ref; @@ -1493,6 +1539,7 @@ static void OPT_OutConstant (OPT_Object obj) break; case 4: case 5: case 6: OPM_SymWInt(obj->conval->intval); + OPM_SymWInt(obj->typ->size); break; case 9: OPM_SymWSet(obj->conval->setval); @@ -1699,15 +1746,6 @@ static void OPT_EnterTyp (OPS_Name name, SHORTINT form, INTEGER size, OPT_Struct *res = typ; } -static void OPT_EnterDerivedType (OPS_Name name, OPT_Struct typ, OPT_Object *obj) -{ - OPS_Name name__copy; - __DUPARR(name, OPS_Name); - OPT_Insert(name, &*obj); - (*obj)->mode = 5; - (*obj)->typ = typ; -} - static void OPT_EnterProc (OPS_Name name, INTEGER num) { OPT_Object obj = NIL; @@ -1741,8 +1779,8 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_niltyp); P(OPT_notyp); P(OPT_sysptrtyp); - P(OPT_LIntObj); __ENUMP(OPT_GlbMod, 64, P); + __ENUMP(OPT_IntTypes, 20, P); P(OPT_universe); P(OPT_syslink); __ENUMR(&OPT_impCtxt, OPT_ImpCtxt__typ, 3140, 1, P); @@ -1811,7 +1849,7 @@ export void *OPT__init(void) OPT_InitStruct(&OPT_niltyp, 11); OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp); OPT_EnterTyp((CHAR*)"PTR", 13, OPM_PointerSize, &OPT_sysptrtyp); - OPT_EnterTyp((CHAR*)"ADRINT", 5, OPM_LIntSize, &OPT_ainttyp); + OPT_EnterTyp((CHAR*)"ADRINT", 5, OPM_PointerSize, &OPT_ainttyp); OPT_EnterTyp((CHAR*)"INT8", 5, 1, &OPT_int8typ); OPT_EnterTyp((CHAR*)"INT16", 5, 2, &OPT_int16typ); OPT_EnterTyp((CHAR*)"INT32", 5, 4, &OPT_int32typ); @@ -1839,7 +1877,6 @@ export void *OPT__init(void) OPT_EnterTyp((CHAR*)"LONGINT", 6, OPM_LIntSize, &OPT_linttyp); OPT_EnterTyp((CHAR*)"LONGREAL", 8, OPM_LRealSize, &OPT_lrltyp); OPT_EnterTyp((CHAR*)"SHORTINT", 4, OPM_SIntSize, &OPT_sinttyp); - OPT_EnterDerivedType((CHAR*)"LINT", OPT_int64typ, &OPT_LIntObj); OPT_EnterBoolConst((CHAR*)"FALSE", ((LONGINT)(0))); OPT_EnterBoolConst((CHAR*)"TRUE", ((LONGINT)(1))); OPT_EnterProc((CHAR*)"HALT", 0); @@ -1877,5 +1914,12 @@ export void *OPT__init(void) OPT_impCtxt.ref[11] = OPT_niltyp; OPT_impCtxt.ref[12] = OPT_notyp; OPT_impCtxt.ref[13] = OPT_sysptrtyp; + OPT_IntTypes[1] = OPT_sinttyp; + OPT_IntTypes[2] = OPT_inttyp; + OPT_IntTypes[3] = OPT_linttyp; + OPT_IntTypes[5] = OPT_int8typ; + OPT_IntTypes[6] = OPT_int16typ; + OPT_IntTypes[7] = OPT_int32typ; + OPT_IntTypes[8] = OPT_int64typ; __ENDMOD; } diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index c4975398..f6206e42 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h @@ -92,12 +92,14 @@ import void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); import void OPT_Init (OPS_Name name, SET opt); import void OPT_Insert (OPS_Name name, OPT_Object *obj); import void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); +import OPT_Struct OPT_IntType (LONGINT size); import OPT_Const OPT_NewConst (void); import OPT_ConstExt OPT_NewExt (void); import OPT_Node OPT_NewNode (SHORTINT class); import OPT_Object OPT_NewObj (void); import OPT_Struct OPT_NewStr (SHORTINT form, SHORTINT comp); import void OPT_OpenScope (SHORTINT level, OPT_Object owner); +import OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir); import void *OPT__init(void); diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index 2172dee5..03b675a9 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPC.h" #include "OPM.h" diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index 122fda4a..6926d6ac 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 6204567c..13bb2453 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index b4e3ecf5..8bb15073 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 11c99924..4ee29f7d 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index b0497a9c..0a81ebf4 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/SYSTEM.h b/bootstrap/windows-48/SYSTEM.h index 35620b9b..343404a4 100644 --- a/bootstrap/windows-48/SYSTEM.h +++ b/bootstrap/windows-48/SYSTEM.h @@ -60,12 +60,6 @@ typedef float REAL; typedef double LONGREAL; typedef void* SYSTEM_PTR; -// Unsigned variants are for use by shift and rotate macros. - -typedef unsigned char U_SYSTEM_BYTE; -typedef unsigned char U_CHAR; -typedef unsigned char U_SHORTINT; - // For 32 bit builds, the size of LONGINT depends on a make option: #if (__SIZEOF_POINTER__ == 8) || defined(LARGE) || defined(_WIN64) @@ -80,9 +74,20 @@ typedef unsigned char U_SHORTINT; typedef unsigned long U_LONGINT; #endif +// Unsigned variants are for use by shift and rotate macros. + +typedef unsigned char U_SYSTEM_BYTE; +typedef unsigned char U_CHAR; +typedef unsigned char U_SHORTINT; + typedef U_LONGINT SET; typedef U_LONGINT U_SET; +typedef SYSTEM_CARD8 U_SYSTEM_INT8; +typedef SYSTEM_CARD16 U_SYSTEM_INT16; +typedef SYSTEM_CARD32 U_SYSTEM_INT32; +typedef SYSTEM_CARD64 U_SYSTEM_INT64; + // OS Memory allocation interfaces are in PlatformXXX.Mod @@ -178,7 +183,7 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __ABSFD(x) SYSTEM_ABSD((double)(x)) #define __CAP(ch) ((CHAR)((ch)&0x5f)) #define __ODD(x) ((x)&1) -#define __IN(x, s) (((s)>>(x))&1) +#define __IN(x, s) ((x)>=0 && (x)<(8*sizeof(SET)) && ((((U_SET)(s))>>(x))&1)) #define __SETOF(x) ((SET)1<<(x)) #define __SETRNG(l, h) ((~(SET)0<<(l))&~(SET)0>>(8*sizeof(SET)-1-(h))) #define __MASK(x, m) ((x)&~(m)) diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index 15aeff29..0c372b8b 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index 385096bc..0dbfdb8e 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index f7a3fdd3..c40f0930 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Files.h" #include "Modules.h" diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index d178499a..99931953 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/Vishap.c b/bootstrap/windows-48/Vishap.c index 66a97f5d..e8b1e4d1 100644 --- a/bootstrap/windows-48/Vishap.c +++ b/bootstrap/windows-48/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkamSf */ #include "SYSTEM.h" #include "Configuration.h" #include "Heap.h" diff --git a/bootstrap/windows-48/errors.c b/bootstrap/windows-48/errors.c index 59b8db27..a8573f9a 100644 --- a/bootstrap/windows-48/errors.c +++ b/bootstrap/windows-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/windows-48/errors.h b/bootstrap/windows-48/errors.h index 6ae0cd7a..6dfe7b1d 100644 --- a/bootstrap/windows-48/errors.h +++ b/bootstrap/windows-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index 2ef65e7b..d2141803 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index 39837586..38d2da7b 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/vt100.c b/bootstrap/windows-48/vt100.c index e0edabd9..5eb4f70e 100644 --- a/bootstrap/windows-48/vt100.c +++ b/bootstrap/windows-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Strings.h" diff --git a/bootstrap/windows-48/vt100.h b/bootstrap/windows-48/vt100.h index 413ae867..770cf66d 100644 --- a/bootstrap/windows-48/vt100.h +++ b/bootstrap/windows-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index 8539a1e2..166df1dc 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -14,6 +14,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/08/26] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/08/30] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index b091f1f7..e30e1366 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Console.c b/bootstrap/windows-88/Console.c index e0344732..332ebd52 100644 --- a/bootstrap/windows-88/Console.c +++ b/bootstrap/windows-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Platform.h" diff --git a/bootstrap/windows-88/Console.h b/bootstrap/windows-88/Console.h index a0813c94..6c86c19c 100644 --- a/bootstrap/windows-88/Console.h +++ b/bootstrap/windows-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index db7f4cd9..4fa9852c 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 12178ad1..a0a4c4f3 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index d3529141..1eb56133 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tskSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index 7827d119..7e4094a1 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index e006bde8..51f3204d 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index 9a0517b5..8431e4a2 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index cb07c606..ce3f00ec 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" @@ -35,9 +35,7 @@ export void OPB_In (OPT_Node *x, OPT_Node y); export void OPB_Index (OPT_Node *x, OPT_Node y); export void OPB_Inittd (OPT_Node *inittd, OPT_Node *last, OPT_Struct typ); static BOOLEAN OPB_IntToBool (LONGINT i); -static OPT_Struct OPB_IntType (LONGINT size); export void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y); -static LONGINT OPB_LongerSize (LONGINT i); export void OPB_MOp (SHORTINT op, OPT_Node *x); export OPT_Node OPB_NewBoolConst (BOOLEAN boolval); export OPT_Node OPB_NewIntConst (LONGINT intval); @@ -54,8 +52,6 @@ export void OPB_Return (OPT_Node *x, OPT_Object proc); export void OPB_SetElem (OPT_Node *x); static void OPB_SetIntType (OPT_Node node); export void OPB_SetRange (OPT_Node *x, OPT_Node y); -static LONGINT OPB_ShorterSize (LONGINT i); -static INTEGER OPB_SignedByteSize (LONGINT n); export void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno); export void OPB_StPar0 (OPT_Node *par0, INTEGER fctno); export void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno); @@ -225,68 +221,20 @@ OPT_Node OPB_EmptySet (void) return _o_result; } -static INTEGER OPB_SignedByteSize (LONGINT n) +static void OPB_SetIntType (OPT_Node node) { - INTEGER _o_result; INTEGER b; - if (n < 0) { - n = -(n + 1); + LONGINT n; + if (node->conval->intval >= 0) { + n = node->conval->intval; + } else { + n = -(node->conval->intval + 1); } b = 1; while ((b < 8 && __ASH(n, -(__ASHL(b, 3) - 1)) != 0)) { b += 1; } - _o_result = b; - return _o_result; -} - -static LONGINT OPB_ShorterSize (LONGINT i) -{ - LONGINT _o_result; - if (i >= (SYSTEM_INT64)OPM_LIntSize) { - _o_result = OPM_IntSize; - return _o_result; - } else { - _o_result = OPM_SIntSize; - return _o_result; - } - __RETCHK; -} - -static LONGINT OPB_LongerSize (LONGINT i) -{ - LONGINT _o_result; - if (i <= (SYSTEM_INT64)OPM_SIntSize) { - _o_result = OPM_IntSize; - return _o_result; - } else { - _o_result = OPM_LIntSize; - return _o_result; - } - __RETCHK; -} - -static OPT_Struct OPB_IntType (LONGINT size) -{ - OPT_Struct _o_result; - OPT_Struct result = NIL; - if (size <= OPT_sinttyp->size) { - result = OPT_sinttyp; - } else if (size <= OPT_inttyp->size) { - result = OPT_inttyp; - } else { - result = OPT_linttyp; - } - if (size > OPT_linttyp->size) { - OPB_err(203); - } - _o_result = result; - return _o_result; -} - -static void OPB_SetIntType (OPT_Node node) -{ - node->typ = OPB_IntType(OPB_SignedByteSize(node->conval->intval)); + node->typ = OPT_IntType(b); } OPT_Node OPB_NewIntConst (LONGINT intval) @@ -430,16 +378,16 @@ void OPB_Field (OPT_Node *x, OPT_Object y) } } -static struct TypTest__61 { +static struct TypTest__57 { OPT_Node *x; OPT_Object *obj; BOOLEAN *guard; - struct TypTest__61 *lnk; -} *TypTest__61_s; + struct TypTest__57 *lnk; +} *TypTest__57_s; -static void GTT__62 (OPT_Struct t0, OPT_Struct t1); +static void GTT__58 (OPT_Struct t0, OPT_Struct t1); -static void GTT__62 (OPT_Struct t0, OPT_Struct t1) +static void GTT__58 (OPT_Struct t0, OPT_Struct t1) { OPT_Node node = NIL; OPT_Struct t = NIL; @@ -452,54 +400,54 @@ static void GTT__62 (OPT_Struct t0, OPT_Struct t1) t1 = t1->BaseTyp; } if (t1 == t0 || t0->form == 0) { - if (*TypTest__61_s->guard) { - OPB_BindNodes(5, NIL, &*TypTest__61_s->x, NIL); - (*TypTest__61_s->x)->readonly = (*TypTest__61_s->x)->left->readonly; + if (*TypTest__57_s->guard) { + OPB_BindNodes(5, NIL, &*TypTest__57_s->x, NIL); + (*TypTest__57_s->x)->readonly = (*TypTest__57_s->x)->left->readonly; } else { node = OPT_NewNode(11); node->subcl = 16; - node->left = *TypTest__61_s->x; - node->obj = *TypTest__61_s->obj; - *TypTest__61_s->x = node; + node->left = *TypTest__57_s->x; + node->obj = *TypTest__57_s->obj; + *TypTest__57_s->x = node; } } else { OPB_err(85); } } else if (t0 != t1) { OPB_err(85); - } else if (!*TypTest__61_s->guard) { - if ((*TypTest__61_s->x)->class == 5) { + } else if (!*TypTest__57_s->guard) { + if ((*TypTest__57_s->x)->class == 5) { node = OPT_NewNode(11); node->subcl = 16; - node->left = *TypTest__61_s->x; - node->obj = *TypTest__61_s->obj; - *TypTest__61_s->x = node; + node->left = *TypTest__57_s->x; + node->obj = *TypTest__57_s->obj; + *TypTest__57_s->x = node; } else { - *TypTest__61_s->x = OPB_NewBoolConst(1); + *TypTest__57_s->x = OPB_NewBoolConst(1); } } } void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) { - struct TypTest__61 _s; + struct TypTest__57 _s; _s.x = x; _s.obj = &obj; _s.guard = &guard; - _s.lnk = TypTest__61_s; - TypTest__61_s = &_s; + _s.lnk = TypTest__57_s; + TypTest__57_s = &_s; if (OPB_NotVar(*x)) { OPB_err(112); } else if ((*x)->typ->form == 13) { if (((*x)->typ->BaseTyp->comp != 4 && (*x)->typ != OPT_sysptrtyp)) { OPB_err(85); } else if (obj->typ->form == 13) { - GTT__62((*x)->typ->BaseTyp, obj->typ->BaseTyp); + GTT__58((*x)->typ->BaseTyp, obj->typ->BaseTyp); } else { OPB_err(86); } } else if (((((*x)->typ->comp == 4 && (*x)->class == 1)) && obj->typ->comp == 4)) { - GTT__62((*x)->typ, obj->typ); + GTT__58((*x)->typ, obj->typ); } else { OPB_err(87); } @@ -508,7 +456,7 @@ void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) } else { (*x)->typ = OPT_booltyp; } - TypTest__61_s = _s.lnk; + TypTest__57_s = _s.lnk; } void OPB_In (OPT_Node *x, OPT_Node y) @@ -574,13 +522,13 @@ static void OPB_CheckRealType (INTEGER f, INTEGER nr, OPT_Const x) x->intval = -1; } -static struct MOp__30 { - struct MOp__30 *lnk; -} *MOp__30_s; +static struct MOp__28 { + struct MOp__28 *lnk; +} *MOp__28_s; -static OPT_Node NewOp__31 (SHORTINT op, OPT_Struct typ, OPT_Node z); +static OPT_Node NewOp__29 (SHORTINT op, OPT_Struct typ, OPT_Node z); -static OPT_Node NewOp__31 (SHORTINT op, OPT_Struct typ, OPT_Node z) +static OPT_Node NewOp__29 (SHORTINT op, OPT_Struct typ, OPT_Node z) { OPT_Node _o_result; OPT_Node node = NIL; @@ -597,9 +545,9 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) INTEGER f; OPT_Struct typ = NIL; OPT_Node z = NIL; - struct MOp__30 _s; - _s.lnk = MOp__30_s; - MOp__30_s = &_s; + struct MOp__28 _s; + _s.lnk = MOp__28_s; + MOp__28_s = &_s; z = *x; if (z->class == 8 || z->class == 9) { OPB_err(126); @@ -613,7 +561,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->conval->intval = OPB_BoolToInt(!OPB_IntToBool(z->conval->intval)); z->obj = NIL; } else { - z = NewOp__31(op, typ, z); + z = NewOp__29(op, typ, z); } } else { OPB_err(98); @@ -641,7 +589,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } z->obj = NIL; } else { - z = NewOp__31(op, typ, z); + z = NewOp__29(op, typ, z); } } else { OPB_err(97); @@ -662,7 +610,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } z->obj = NIL; } else { - z = NewOp__31(op, typ, z); + z = NewOp__29(op, typ, z); } } else { OPB_err(111); @@ -674,7 +622,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->conval->intval = (int)__CAP((CHAR)z->conval->intval); z->obj = NIL; } else { - z = NewOp__31(op, typ, z); + z = NewOp__29(op, typ, z); } } else { OPB_err(111); @@ -687,7 +635,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->conval->intval = OPB_BoolToInt(__ODD(z->conval->intval)); z->obj = NIL; } else { - z = NewOp__31(op, typ, z); + z = NewOp__29(op, typ, z); } } else { OPB_err(111); @@ -700,7 +648,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) f = 10; } if (z->class < 7 || f == 10) { - z = NewOp__31(op, typ, z); + z = NewOp__29(op, typ, z); } else { OPB_err(127); } @@ -709,7 +657,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) case 25: if ((__IN(f, 0x70) && z->class == 7)) { if ((0 <= z->conval->intval && z->conval->intval <= -1)) { - z = NewOp__31(op, typ, z); + z = NewOp__29(op, typ, z); } else { OPB_err(219); } @@ -726,7 +674,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } } *x = z; - MOp__30_s = _s.lnk; + MOp__28_s = _s.lnk; } static void OPB_CheckPtr (OPT_Node x, OPT_Node y) @@ -922,7 +870,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) if (x->typ->size <= y->typ->size) { x->typ = y->typ; } else { - x->typ = OPB_IntType(x->typ->size); + x->typ = OPT_IntType(x->typ->size); } } else if (g == 7) { x->typ = OPT_realtyp; @@ -1179,7 +1127,7 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) if (__IN(g, 0x70)) { if (f > g) { OPB_SetIntType(*x); - if ((int)(*x)->typ->form > g) { + if ((*x)->typ->size > typ->size) { OPB_err(203); (*x)->conval->intval = 1; } @@ -1220,15 +1168,15 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) (*x)->typ = typ; } -static struct Op__40 { +static struct Op__38 { INTEGER *f, *g; - struct Op__40 *lnk; -} *Op__40_s; + struct Op__38 *lnk; +} *Op__38_s; -static void NewOp__41 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y); -static BOOLEAN strings__43 (OPT_Node *x, OPT_Node *y); +static void NewOp__39 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y); +static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y); -static void NewOp__41 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y) +static void NewOp__39 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y) { OPT_Node node = NIL; node = OPT_NewNode(12); @@ -1239,29 +1187,29 @@ static void NewOp__41 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y) *x = node; } -static BOOLEAN strings__43 (OPT_Node *x, OPT_Node *y) +static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) { BOOLEAN _o_result; BOOLEAN ok, xCharArr, yCharArr; - xCharArr = (__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp->form == 3) || *Op__40_s->f == 10; - yCharArr = (__IN((*y)->typ->comp, 0x0c) && (*y)->typ->BaseTyp->form == 3) || *Op__40_s->g == 10; - if ((((xCharArr && *Op__40_s->g == 3)) && (*y)->class == 7)) { + xCharArr = (__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp->form == 3) || *Op__38_s->f == 10; + yCharArr = (__IN((*y)->typ->comp, 0x0c) && (*y)->typ->BaseTyp->form == 3) || *Op__38_s->g == 10; + if ((((xCharArr && *Op__38_s->g == 3)) && (*y)->class == 7)) { OPB_CharToString(*y); - *Op__40_s->g = 10; + *Op__38_s->g = 10; yCharArr = 1; } - if ((((yCharArr && *Op__40_s->f == 3)) && (*x)->class == 7)) { + if ((((yCharArr && *Op__38_s->f == 3)) && (*x)->class == 7)) { OPB_CharToString(*x); - *Op__40_s->f = 10; + *Op__38_s->f = 10; xCharArr = 1; } ok = (xCharArr && yCharArr); if (ok) { - if ((*Op__40_s->f == 10 && (*x)->conval->intval2 == 1)) { + if ((*Op__38_s->f == 10 && (*x)->conval->intval2 == 1)) { (*x)->typ = OPT_chartyp; (*x)->conval->intval = 0; OPB_Index(&*y, OPB_NewIntConst(((LONGINT)(0)))); - } else if ((*Op__40_s->g == 10 && (*y)->conval->intval2 == 1)) { + } else if ((*Op__38_s->g == 10 && (*y)->conval->intval2 == 1)) { (*y)->typ = OPT_chartyp; (*y)->conval->intval = 0; OPB_Index(&*x, OPB_NewIntConst(((LONGINT)(0)))); @@ -1278,11 +1226,11 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPT_Struct typ = NIL; BOOLEAN do_; LONGINT val; - struct Op__40 _s; + struct Op__38 _s; _s.f = &f; _s.g = &g; - _s.lnk = Op__40_s; - Op__40_s = &_s; + _s.lnk = Op__38_s; + Op__38_s = &_s; z = *x; if (((z->class == 8 || z->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); @@ -1394,7 +1342,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) typ = OPT_undftyp; } if (do_) { - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); } break; case 2: @@ -1413,7 +1361,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPB_err(102); typ = OPT_undftyp; } - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); break; case 3: do_ = 1; @@ -1436,7 +1384,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) typ = OPT_undftyp; } if (do_) { - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); } break; case 4: @@ -1454,7 +1402,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPB_err(104); typ = OPT_undftyp; } - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); break; case 5: if (f == 2) { @@ -1464,7 +1412,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } } else if ((y->class == 7 && OPB_IntToBool(y->conval->intval))) { } else { - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); } } else if (f != 0) { OPB_err(94); @@ -1487,7 +1435,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } } if (do_) { - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); } break; case 7: @@ -1496,7 +1444,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) typ = OPT_undftyp; } if ((!__IN(f, 0x70) || y->class != 7) || y->conval->intval != 0) { - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); } break; case 8: @@ -1507,7 +1455,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } } else if ((y->class == 7 && !OPB_IntToBool(y->conval->intval))) { } else { - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); } } else if (f != 0) { OPB_err(95); @@ -1515,16 +1463,16 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 9: case 10: - if (__IN(f, 0x6bff) || strings__43(&z, &y)) { + if (__IN(f, 0x6bff) || strings__41(&z, &y)) { typ = OPT_booltyp; } else { OPB_err(107); typ = OPT_undftyp; } - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); break; case 11: case 12: case 13: case 14: - if (__IN(f, 0x01f9) || strings__43(&z, &y)) { + if (__IN(f, 0x01f9) || strings__41(&z, &y)) { typ = OPT_booltyp; } else { OPM_LogWLn(); @@ -1533,7 +1481,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPB_err(108); typ = OPT_undftyp; } - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); break; default: OPM_LogWStr((CHAR*)"unhandled case in OPB.Op, op = ", (LONGINT)32); @@ -1543,7 +1491,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } } *x = z; - Op__40_s = _s.lnk; + Op__38_s = _s.lnk; } void OPB_SetRange (OPT_Node *x, OPT_Node y) @@ -1895,8 +1843,13 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 10: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((__IN(f, 0x70) && x->typ->size > (SYSTEM_INT64)OPM_SIntSize)) { - OPB_Convert(&x, OPB_IntType(OPB_ShorterSize(x->typ->size))); + } else if (__IN(f, 0x70)) { + typ = OPT_ShorterOrLongerType(x->typ, -1); + if (typ == NIL) { + OPB_err(111); + } else { + OPB_Convert(&x, typ); + } } else if (f == 8) { OPB_Convert(&x, OPT_realtyp); } else { @@ -1906,8 +1859,13 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 11: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((__IN(f, 0x70) && x->typ->size < (SYSTEM_INT64)OPM_LIntSize)) { - OPB_Convert(&x, OPB_IntType(OPB_LongerSize(x->typ->size))); + } else if (__IN(f, 0x70)) { + typ = OPT_ShorterOrLongerType(x->typ, 1); + if (typ == NIL) { + OPB_err(111); + } else { + OPB_Convert(&x, typ); + } } else if (f == 7) { OPB_Convert(&x, OPT_lrltyp); } else if (f == 3) { @@ -2044,13 +2002,13 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) *par0 = x; } -static struct StPar1__56 { - struct StPar1__56 *lnk; -} *StPar1__56_s; +static struct StPar1__52 { + struct StPar1__52 *lnk; +} *StPar1__52_s; -static OPT_Node NewOp__57 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right); +static OPT_Node NewOp__53 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right); -static OPT_Node NewOp__57 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right) +static OPT_Node NewOp__53 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right) { OPT_Node _o_result; OPT_Node node = NIL; @@ -2067,9 +2025,9 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) INTEGER f, L; OPT_Struct typ = NIL; OPT_Node p = NIL, t = NIL; - struct StPar1__56 _s; - _s.lnk = StPar1__56_s; - StPar1__56_s = &_s; + struct StPar1__52 _s; + _s.lnk = StPar1__52_s; + StPar1__52_s = &_s; p = *par0; f = x->typ->form; switch (fctno) { @@ -2085,7 +2043,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) OPB_err(111); } } - p = NewOp__57(19, fctno, p, x); + p = NewOp__53(19, fctno, p, x); p->typ = OPT_notyp; } break; @@ -2096,7 +2054,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > (SYSTEM_INT64)OPM_MaxSet))) { OPB_err(202); } - p = NewOp__57(19, fctno, p, x); + p = NewOp__53(19, fctno, p, x); } else { OPB_err(111); } @@ -2121,7 +2079,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) p = p->left; x->conval->intval += 1; } - p = NewOp__57(12, 19, p, x); + p = NewOp__53(12, 19, p, x); p->typ = OPT_linttyp; } else { p = x; @@ -2143,7 +2101,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) t = x; x = p; p = t; - p = NewOp__57(19, 18, p, x); + p = NewOp__53(19, 18, p, x); } else { OPB_err(111); } @@ -2169,7 +2127,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) } p->obj = NIL; } else { - p = NewOp__57(12, 17, p, x); + p = NewOp__53(12, 17, p, x); p->typ = OPT_linttyp; } } else { @@ -2200,9 +2158,9 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) OPB_err(111); } else { if (fctno == 22) { - p = NewOp__57(12, 27, p, x); + p = NewOp__53(12, 27, p, x); } else { - p = NewOp__57(12, 28, p, x); + p = NewOp__53(12, 28, p, x); } p->typ = p->left->typ; } @@ -2219,7 +2177,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) x = p; p = t; } - p = NewOp__57(19, fctno, p, x); + p = NewOp__53(19, fctno, p, x); } else { OPB_err(111); } @@ -2229,7 +2187,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (__IN(f, 0x70)) { - p = NewOp__57(12, 26, p, x); + p = NewOp__53(12, 26, p, x); } else { OPB_err(111); } @@ -2253,7 +2211,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (__IN(f, 0x70)) { - p = NewOp__57(19, 30, p, x); + p = NewOp__53(19, 30, p, x); } else { OPB_err(111); } @@ -2299,7 +2257,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) break; } *par0 = p; - StPar1__56_s = _s.lnk; + StPar1__52_s = _s.lnk; } void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n) diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index f2056569..ccef7627 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index 0813dca9..a5276b17 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index aa92d405..de932c60 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 3bc1b6d2..0e43a013 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index f11b56ba..e94f0303 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index 3a345c1f..63b71ce5 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPB.h" @@ -25,7 +25,7 @@ export LONGINT *OPP__1__typ; static void OPP_ActualParameters (OPT_Node *aparlist, OPT_Object fpar); static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned); static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq); -static void OPP_CaseLabelList (OPT_Node *lab, INTEGER LabelForm, INTEGER *n, OPP_CaseTable tab); +static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, OPP_CaseTable tab); static void OPP_CheckMark (SHORTINT *vis); static void OPP_CheckSym (INTEGER s); static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_); @@ -1164,7 +1164,7 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) ProcedureDeclaration__16_s = _s.lnk; } -static void OPP_CaseLabelList (OPT_Node *lab, INTEGER LabelForm, INTEGER *n, OPP_CaseTable tab) +static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, OPP_CaseTable tab) { OPT_Node x = NIL, y = NIL, lastlab = NIL; INTEGER i, f; @@ -1181,10 +1181,10 @@ static void OPP_CaseLabelList (OPT_Node *lab, INTEGER LabelForm, INTEGER *n, OPP xval = 1; } if (__IN(f, 0x70)) { - if (LabelForm < f) { + if (!__IN(LabelTyp->form, 0x70) || LabelTyp->size < x->typ->size) { OPP_err(60); } - } else if (LabelForm != f) { + } else if ((int)LabelTyp->form != f) { OPP_err(60); } if (OPP_sym == 21) { @@ -1263,7 +1263,7 @@ static void CasePart__31 (OPT_Node *x) n = 0; for (;;) { if (OPP_sym < 40) { - OPP_CaseLabelList(&lab, (*x)->typ->form, &n, tab); + OPP_CaseLabelList(&lab, (*x)->typ, &n, tab); OPP_CheckSym(20); OPP_StatSeq(&y); OPB_Construct(17, &lab, y); @@ -1472,7 +1472,7 @@ static void OPP_StatSeq (OPT_Node *stat) SetPos__35(z); OPB_Link(&*stat, &last, z); y = OPB_NewLeaf(t); - } else if (y->typ->form < 4 || y->typ->form > x->left->typ->form) { + } else if (!__IN(y->typ->form, 0x70) || y->typ->size > x->left->typ->size) { OPP_err(113); } OPB_Link(&*stat, &last, x); diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index c0c9c3dd..fb0cf655 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index 1f9f2a46..e2d48c61 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index 4b760b22..ea28a764 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index 20234e22..b028d164 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" @@ -85,11 +85,11 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; -static OPT_Object OPT_LIntObj; export SHORTINT OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; export BOOLEAN OPT_SYSimported; +static OPT_Struct OPT_IntTypes[20]; static OPT_Object OPT_universe, OPT_syslink; static OPT_ImpCtxt OPT_impCtxt; static OPT_ExpCtxt OPT_expCtxt; @@ -107,7 +107,6 @@ export void OPT_Close (void); export void OPT_CloseScope (void); static void OPT_DebugStruct (OPT_Struct btyp); static void OPT_EnterBoolConst (OPS_Name name, LONGINT value); -static void OPT_EnterDerivedType (OPS_Name name, OPT_Struct typ, OPT_Object *obj); static void OPT_EnterProc (OPS_Name name, INTEGER num); static void OPT_EnterTyp (OPS_Name name, SHORTINT form, INTEGER size, OPT_Struct *res); export void OPT_Export (BOOLEAN *ext, BOOLEAN *new); @@ -129,10 +128,12 @@ static OPT_Object OPT_InObj (SHORTINT mno); static void OPT_InSign (SHORTINT mno, OPT_Struct *res, OPT_Object *par); static void OPT_InStruct (OPT_Struct *typ); static OPT_Object OPT_InTProc (SHORTINT mno); +static OPT_Struct OPT_InTyp (LONGINT tag); export void OPT_Init (OPS_Name name, SET opt); static void OPT_InitStruct (OPT_Struct *typ, SHORTINT form); export void OPT_Insert (OPS_Name name, OPT_Object *obj); export void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); +export OPT_Struct OPT_IntType (LONGINT size); export OPT_Const OPT_NewConst (void); export OPT_ConstExt OPT_NewExt (void); export OPT_Node OPT_NewNode (SHORTINT class); @@ -148,6 +149,7 @@ static void OPT_OutObj (OPT_Object obj); static void OPT_OutSign (OPT_Struct result, OPT_Object par); static void OPT_OutStr (OPT_Struct typ); static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj); +export OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir); static void OPT_err (INTEGER n); @@ -156,6 +158,34 @@ static void OPT_err (INTEGER n) OPM_err(n); } +OPT_Struct OPT_IntType (LONGINT size) +{ + OPT_Struct _o_result; + INTEGER i; + i = 1; + while ((OPT_IntTypes[__X(i, ((LONGINT)(20)))]->size < size && OPT_IntTypes[__X(i + 1, ((LONGINT)(20)))] != NIL)) { + i += 1; + } + _o_result = OPT_IntTypes[__X(i, ((LONGINT)(20)))]; + return _o_result; +} + +OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir) +{ + OPT_Struct _o_result; + INTEGER i; + __ASSERT(__IN(x->form, 0x70), 0); + __ASSERT(dir == 1 || dir == -1, 0); + __ASSERT(x->BaseTyp == OPT_undftyp, 0); + i = 0; + while ((OPT_IntTypes[__X(i, ((LONGINT)(20)))] != x && i < 20)) { + i += 1; + } + __ASSERT(i < 19, 0); + _o_result = OPT_IntTypes[__X(i + dir, ((LONGINT)(20)))]; + return _o_result; +} + OPT_Const OPT_NewConst (void) { OPT_Const _o_result; @@ -468,21 +498,21 @@ void OPT_IdFPrint (OPT_Struct typ) } } -static struct FPrintStr__13 { +static struct FPrintStr__12 { LONGINT *pbfp, *pvfp; - struct FPrintStr__13 *lnk; -} *FPrintStr__13_s; + struct FPrintStr__12 *lnk; +} *FPrintStr__12_s; -static void FPrintFlds__14 (OPT_Object fld, LONGINT adr, BOOLEAN visible); -static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, LONGINT adr); -static void FPrintTProcs__18 (OPT_Object obj); +static void FPrintFlds__13 (OPT_Object fld, LONGINT adr, BOOLEAN visible); +static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr); +static void FPrintTProcs__17 (OPT_Object obj); -static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, LONGINT adr) +static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr) { LONGINT i, j, n; OPT_Struct btyp = NIL; if (typ->comp == 4) { - FPrintFlds__14(typ->link, adr, 0); + FPrintFlds__13(typ->link, adr, 0); } else if (typ->comp == 2) { btyp = typ->BaseTyp; n = typ->n; @@ -492,53 +522,53 @@ static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, LONGINT adr) } if (btyp->form == 13 || btyp->comp == 4) { j = OPT_nofhdfld; - FPrintHdFld__16(btyp, fld, adr); + FPrintHdFld__15(btyp, fld, adr); if (j != OPT_nofhdfld) { i = 1; while ((i < n && OPT_nofhdfld <= 2048)) { adr += btyp->size; - FPrintHdFld__16(btyp, fld, adr); + FPrintHdFld__15(btyp, fld, adr); i += 1; } } } } else if (typ->form == 13 || __STRCMP(fld->name, "@ptr") == 0) { - OPM_FPrint(&*FPrintStr__13_s->pvfp, ((LONGINT)(13))); - OPM_FPrint(&*FPrintStr__13_s->pvfp, adr); + OPM_FPrint(&*FPrintStr__12_s->pvfp, ((LONGINT)(13))); + OPM_FPrint(&*FPrintStr__12_s->pvfp, adr); OPT_nofhdfld += 1; } } -static void FPrintFlds__14 (OPT_Object fld, LONGINT adr, BOOLEAN visible) +static void FPrintFlds__13 (OPT_Object fld, LONGINT adr, BOOLEAN visible) { while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { - OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->vis); - OPT_FPrintName(&*FPrintStr__13_s->pbfp, (void*)fld->name, ((LONGINT)(256))); - OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->adr); + OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->vis); + OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)fld->name, ((LONGINT)(256))); + OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->adr); OPT_FPrintStr(fld->typ); - OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->typ->pbfp); - OPM_FPrint(&*FPrintStr__13_s->pvfp, fld->typ->pvfp); + OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->typ->pbfp); + OPM_FPrint(&*FPrintStr__12_s->pvfp, fld->typ->pvfp); } else { - FPrintHdFld__16(fld->typ, fld, fld->adr + adr); + FPrintHdFld__15(fld->typ, fld, fld->adr + adr); } fld = fld->link; } } -static void FPrintTProcs__18 (OPT_Object obj) +static void FPrintTProcs__17 (OPT_Object obj) { if (obj != NIL) { - FPrintTProcs__18(obj->left); + FPrintTProcs__17(obj->left); if (obj->mode == 13) { if (obj->vis != 0) { - OPM_FPrint(&*FPrintStr__13_s->pbfp, ((LONGINT)(13))); - OPM_FPrint(&*FPrintStr__13_s->pbfp, __ASHR(obj->adr, 16)); - OPT_FPrintSign(&*FPrintStr__13_s->pbfp, obj->typ, obj->link); - OPT_FPrintName(&*FPrintStr__13_s->pbfp, (void*)obj->name, ((LONGINT)(256))); + OPM_FPrint(&*FPrintStr__12_s->pbfp, ((LONGINT)(13))); + OPM_FPrint(&*FPrintStr__12_s->pbfp, __ASHR(obj->adr, 16)); + OPT_FPrintSign(&*FPrintStr__12_s->pbfp, obj->typ, obj->link); + OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)obj->name, ((LONGINT)(256))); } } - FPrintTProcs__18(obj->right); + FPrintTProcs__17(obj->right); } } @@ -548,11 +578,11 @@ void OPT_FPrintStr (OPT_Struct typ) OPT_Struct btyp = NIL; OPT_Object strobj = NIL, bstrobj = NIL; LONGINT pbfp, pvfp; - struct FPrintStr__13 _s; + struct FPrintStr__12 _s; _s.pbfp = &pbfp; _s.pvfp = &pvfp; - _s.lnk = FPrintStr__13_s; - FPrintStr__13_s = &_s; + _s.lnk = FPrintStr__12_s; + FPrintStr__12_s = &_s; if (!typ->fpdone) { OPT_IdFPrint(typ); pbfp = typ->idfp; @@ -589,11 +619,11 @@ void OPT_FPrintStr (OPT_Struct typ) OPM_FPrint(&pvfp, typ->align); OPM_FPrint(&pvfp, typ->n); OPT_nofhdfld = 0; - FPrintFlds__14(typ->link, ((LONGINT)(0)), 1); + FPrintFlds__13(typ->link, ((LONGINT)(0)), 1); if (OPT_nofhdfld > 2048) { OPM_Mark(225, typ->txtpos); } - FPrintTProcs__18(typ->link); + FPrintTProcs__17(typ->link); OPM_FPrint(&pvfp, pbfp); strobj = typ->strobj; if (strobj == NIL || strobj->name[0] == 0x00) { @@ -603,7 +633,7 @@ void OPT_FPrintStr (OPT_Struct typ) typ->pbfp = pbfp; typ->pvfp = pvfp; } - FPrintStr__13_s = _s.lnk; + FPrintStr__12_s = _s.lnk; } void OPT_FPrintObj (OPT_Object obj) @@ -947,6 +977,19 @@ static OPT_Object OPT_InTProc (SHORTINT mno) return _o_result; } +static OPT_Struct OPT_InTyp (LONGINT tag) +{ + OPT_Struct _o_result; + if (__IN(tag, 0x70)) { + _o_result = OPT_IntType(OPM_SymRInt()); + return _o_result; + } else { + _o_result = OPT_impCtxt.ref[__X(tag, ((LONGINT)(255)))]; + return _o_result; + } + __RETCHK; +} + static void OPT_InStruct (OPT_Struct *typ) { SHORTINT mno; @@ -957,7 +1000,7 @@ static void OPT_InStruct (OPT_Struct *typ) OPT_Object obj = NIL, last = NIL, fld = NIL, old = NIL, dummy = NIL; tag = OPM_SymRInt(); if (tag != 34) { - *typ = OPT_impCtxt.ref[__X(-tag, ((LONGINT)(255)))]; + *typ = OPT_InTyp(-tag); } else { ref = OPT_impCtxt.nofr; OPT_impCtxt.nofr += 1; @@ -1082,7 +1125,7 @@ static void OPT_InStruct (OPT_Struct *typ) } if (ref == OPT_impCtxt.minr) { while (ref < OPT_impCtxt.nofr) { - t = OPT_impCtxt.ref[__X(ref, ((LONGINT)(255)))]; + t = OPT_InTyp(ref); OPT_FPrintStr(t); obj = t->strobj; if (obj->name[0] != 0x00) { @@ -1151,9 +1194,9 @@ static OPT_Object OPT_InObj (SHORTINT mno) obj->vis = 1; if (tag <= 13) { obj->mode = 3; - obj->typ = OPT_impCtxt.ref[__X(tag, ((LONGINT)(255)))]; obj->conval = OPT_NewConst(); OPT_InConstant(tag, obj->conval); + obj->typ = OPT_InTyp(tag); } else if (tag >= 31) { obj->conval = OPT_NewConst(); obj->conval->intval = -1; @@ -1397,6 +1440,9 @@ static void OPT_OutStr (OPT_Struct typ) OPT_Object strobj = NIL; if (typ->ref < OPT_expCtxt.ref) { OPM_SymWInt(-typ->ref); + if (__IN(typ->ref, 0x70)) { + OPM_SymWInt(typ->size); + } } else { OPM_SymWInt(((LONGINT)(34))); typ->ref = OPT_expCtxt.ref; @@ -1494,6 +1540,7 @@ static void OPT_OutConstant (OPT_Object obj) break; case 4: case 5: case 6: OPM_SymWInt(obj->conval->intval); + OPM_SymWInt(obj->typ->size); break; case 9: OPM_SymWSet(obj->conval->setval); @@ -1700,15 +1747,6 @@ static void OPT_EnterTyp (OPS_Name name, SHORTINT form, INTEGER size, OPT_Struct *res = typ; } -static void OPT_EnterDerivedType (OPS_Name name, OPT_Struct typ, OPT_Object *obj) -{ - OPS_Name name__copy; - __DUPARR(name, OPS_Name); - OPT_Insert(name, &*obj); - (*obj)->mode = 5; - (*obj)->typ = typ; -} - static void OPT_EnterProc (OPS_Name name, INTEGER num) { OPT_Object obj = NIL; @@ -1742,8 +1780,8 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_niltyp); P(OPT_notyp); P(OPT_sysptrtyp); - P(OPT_LIntObj); __ENUMP(OPT_GlbMod, 64, P); + __ENUMP(OPT_IntTypes, 20, P); P(OPT_universe); P(OPT_syslink); __ENUMR(&OPT_impCtxt, OPT_ImpCtxt__typ, 6216, 1, P); @@ -1812,7 +1850,7 @@ export void *OPT__init(void) OPT_InitStruct(&OPT_niltyp, 11); OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp); OPT_EnterTyp((CHAR*)"PTR", 13, OPM_PointerSize, &OPT_sysptrtyp); - OPT_EnterTyp((CHAR*)"ADRINT", 5, OPM_LIntSize, &OPT_ainttyp); + OPT_EnterTyp((CHAR*)"ADRINT", 5, OPM_PointerSize, &OPT_ainttyp); OPT_EnterTyp((CHAR*)"INT8", 5, 1, &OPT_int8typ); OPT_EnterTyp((CHAR*)"INT16", 5, 2, &OPT_int16typ); OPT_EnterTyp((CHAR*)"INT32", 5, 4, &OPT_int32typ); @@ -1840,7 +1878,6 @@ export void *OPT__init(void) OPT_EnterTyp((CHAR*)"LONGINT", 6, OPM_LIntSize, &OPT_linttyp); OPT_EnterTyp((CHAR*)"LONGREAL", 8, OPM_LRealSize, &OPT_lrltyp); OPT_EnterTyp((CHAR*)"SHORTINT", 4, OPM_SIntSize, &OPT_sinttyp); - OPT_EnterDerivedType((CHAR*)"LINT", OPT_int64typ, &OPT_LIntObj); OPT_EnterBoolConst((CHAR*)"FALSE", ((LONGINT)(0))); OPT_EnterBoolConst((CHAR*)"TRUE", ((LONGINT)(1))); OPT_EnterProc((CHAR*)"HALT", 0); @@ -1878,5 +1915,12 @@ export void *OPT__init(void) OPT_impCtxt.ref[11] = OPT_niltyp; OPT_impCtxt.ref[12] = OPT_notyp; OPT_impCtxt.ref[13] = OPT_sysptrtyp; + OPT_IntTypes[1] = OPT_sinttyp; + OPT_IntTypes[2] = OPT_inttyp; + OPT_IntTypes[3] = OPT_linttyp; + OPT_IntTypes[5] = OPT_int8typ; + OPT_IntTypes[6] = OPT_int16typ; + OPT_IntTypes[7] = OPT_int32typ; + OPT_IntTypes[8] = OPT_int64typ; __ENDMOD; } diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index f1865573..9878e30b 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h @@ -93,12 +93,14 @@ import void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); import void OPT_Init (OPS_Name name, SET opt); import void OPT_Insert (OPS_Name name, OPT_Object *obj); import void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); +import OPT_Struct OPT_IntType (LONGINT size); import OPT_Const OPT_NewConst (void); import OPT_ConstExt OPT_NewExt (void); import OPT_Node OPT_NewNode (SHORTINT class); import OPT_Object OPT_NewObj (void); import OPT_Struct OPT_NewStr (SHORTINT form, SHORTINT comp); import void OPT_OpenScope (SHORTINT level, OPT_Object owner); +import OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir); import void *OPT__init(void); diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 638891f1..f74e0890 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPC.h" diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index b0551679..43ab4681 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 875aa4b4..679e8b8d 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index 1c350cbf..aa08a76c 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 660cd605..a5a93902 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index 3102ce18..76bda39d 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/SYSTEM.h b/bootstrap/windows-88/SYSTEM.h index 35620b9b..343404a4 100644 --- a/bootstrap/windows-88/SYSTEM.h +++ b/bootstrap/windows-88/SYSTEM.h @@ -60,12 +60,6 @@ typedef float REAL; typedef double LONGREAL; typedef void* SYSTEM_PTR; -// Unsigned variants are for use by shift and rotate macros. - -typedef unsigned char U_SYSTEM_BYTE; -typedef unsigned char U_CHAR; -typedef unsigned char U_SHORTINT; - // For 32 bit builds, the size of LONGINT depends on a make option: #if (__SIZEOF_POINTER__ == 8) || defined(LARGE) || defined(_WIN64) @@ -80,9 +74,20 @@ typedef unsigned char U_SHORTINT; typedef unsigned long U_LONGINT; #endif +// Unsigned variants are for use by shift and rotate macros. + +typedef unsigned char U_SYSTEM_BYTE; +typedef unsigned char U_CHAR; +typedef unsigned char U_SHORTINT; + typedef U_LONGINT SET; typedef U_LONGINT U_SET; +typedef SYSTEM_CARD8 U_SYSTEM_INT8; +typedef SYSTEM_CARD16 U_SYSTEM_INT16; +typedef SYSTEM_CARD32 U_SYSTEM_INT32; +typedef SYSTEM_CARD64 U_SYSTEM_INT64; + // OS Memory allocation interfaces are in PlatformXXX.Mod @@ -178,7 +183,7 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __ABSFD(x) SYSTEM_ABSD((double)(x)) #define __CAP(ch) ((CHAR)((ch)&0x5f)) #define __ODD(x) ((x)&1) -#define __IN(x, s) (((s)>>(x))&1) +#define __IN(x, s) ((x)>=0 && (x)<(8*sizeof(SET)) && ((((U_SET)(s))>>(x))&1)) #define __SETOF(x) ((SET)1<<(x)) #define __SETRNG(l, h) ((~(SET)0<<(l))&~(SET)0>>(8*sizeof(SET)-1-(h))) #define __MASK(x, m) ((x)&~(m)) diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index 2df49d25..bd57ef4e 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index 9505fe03..aa97eeac 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index 0e0b4725..cd9388a6 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Files.h" diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index 3086fb00..b591e699 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/Vishap.c b/bootstrap/windows-88/Vishap.c index a487fe66..19624204 100644 --- a/bootstrap/windows-88/Vishap.c +++ b/bootstrap/windows-88/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkamSf */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/windows-88/errors.c b/bootstrap/windows-88/errors.c index 8489752b..5493978e 100644 --- a/bootstrap/windows-88/errors.c +++ b/bootstrap/windows-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/windows-88/errors.h b/bootstrap/windows-88/errors.h index a5af5a7d..8ce5a106 100644 --- a/bootstrap/windows-88/errors.h +++ b/bootstrap/windows-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index fce52835..72df4f99 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index 9e5aed51..4523936a 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/vt100.c b/bootstrap/windows-88/vt100.c index 0e0401e3..efcf43ab 100644 --- a/bootstrap/windows-88/vt100.c +++ b/bootstrap/windows-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/windows-88/vt100.h b/bootstrap/windows-88/vt100.h index eb6374ea..65ae6d58 100644 --- a/bootstrap/windows-88/vt100.h +++ b/bootstrap/windows-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/src/compiler/OPB.Mod b/src/compiler/OPB.Mod index cfb983b5..000e1aef 100644 --- a/src/compiler/OPB.Mod +++ b/src/compiler/OPB.Mod @@ -1007,7 +1007,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) |OPT.shortfn: (*SHORT*) IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) ELSIF f IN OPT.intSet THEN - typ := OPT.NextType(x.typ, -1); + typ := OPT.ShorterOrLongerType(x.typ, -1); IF typ = NIL THEN err(111) ELSE Convert(x, typ) END ELSIF f = OPT.LReal THEN Convert(x, OPT.realtyp) ELSE err(111) @@ -1015,7 +1015,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) |OPT.longfn: (*LONG*) IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) ELSIF f IN OPT.intSet THEN - typ := OPT.NextType(x.typ, 1); + typ := OPT.ShorterOrLongerType(x.typ, 1); IF typ = NIL THEN err(111) ELSE Convert(x, typ) END ELSIF f = OPT.Real THEN Convert(x, OPT.lrltyp) ELSIF f = OPT.Char THEN Convert(x, OPT.linttyp) diff --git a/src/compiler/OPT.Mod b/src/compiler/OPT.Mod index e1b33ac3..efaac954 100644 --- a/src/compiler/OPT.Mod +++ b/src/compiler/OPT.Mod @@ -166,7 +166,7 @@ VAR SelfName*: OPS.Name; (* name of module being compiled *) SYSimported*: BOOLEAN; - NextSize: ARRAY 20 OF Struct; (* Lists integer types in SHORT/LONG ordering *) + IntTypes: ARRAY 20 OF Struct; (* Lists integer types in SHORT/LONG ordering *) CONST @@ -217,11 +217,11 @@ PROCEDURE IntType*(size: LONGINT): Struct; (* Selects smallest standard integer type for given size in bytes *) VAR i: INTEGER; BEGIN - i := 1; WHILE (NextSize[i].size < size) & (NextSize[i+1] # NIL) DO INC(i) END; - RETURN NextSize[i]; + i := 1; WHILE (IntTypes[i].size < size) & (IntTypes[i+1] # NIL) DO INC(i) END; + RETURN IntTypes[i]; END IntType; -PROCEDURE NextType*(x: Struct; dir: INTEGER): Struct; +PROCEDURE ShorterOrLongerType*(x: Struct; dir: INTEGER): Struct; VAR i: INTEGER; BEGIN ASSERT(x.form IN intSet); @@ -232,10 +232,10 @@ BEGIN (* WHILE x.BaseTyp # undftyp DO ASSERT(x # x.BaseTyp); ASSERT(x.BaseTyp # NIL); x := x.BaseTyp END; *) - i := 0; WHILE (NextSize[i] # x) & (i < LEN(NextSize)) DO INC(i) END; - ASSERT(i < LEN(NextSize)-1); - RETURN NextSize[i+dir] -END NextType; + i := 0; WHILE (IntTypes[i] # x) & (i < LEN(IntTypes)) DO INC(i) END; + ASSERT(i < LEN(IntTypes)-1); + RETURN IntTypes[i+dir] +END ShorterOrLongerType; @@ -705,18 +705,9 @@ END InTProc; PROCEDURE InTyp(tag: LONGINT): Struct; - VAR size: LONGINT; BEGIN IF tag IN intSet THEN - size := OPM.SymRInt(); - (* - IF size = 123456789 THEN (* Expected magic number while testing *) - size := OPM.SymRInt(); - ELSE - OPM.LogWLn; OPM.LogWStr("Missing constant magic number. size = "); OPM.LogWNum(size,1); - END; - *) - RETURN IntType(size) + RETURN IntType(OPM.SymRInt()) ELSE RETURN impCtxt.ref[tag] END @@ -728,8 +719,7 @@ PROCEDURE InStruct(VAR typ: Struct); t: Struct; obj, last, fld, old, dummy: Object; BEGIN tag := OPM.SymRInt(); - IF tag # Sstruct THEN - typ := impCtxt.ref[-tag] + IF tag # Sstruct THEN typ := InTyp(-tag) ELSE ref := impCtxt.nofr; INC(impCtxt.nofr); IF ref < impCtxt.minr THEN impCtxt.minr := ref END; @@ -804,7 +794,7 @@ BEGIN END; IF ref = impCtxt.minr THEN WHILE (ref < impCtxt.nofr) DO - t := impCtxt.ref[ref]; FPrintStr(t); + t := InTyp(ref); FPrintStr(t); obj := t^.strobj; (* obj^.typ^.strobj = obj, else obj^.fprint differs (alias) *) IF obj^.name # "" THEN FPrintObj(obj) END; old := impCtxt.old[ref]; @@ -998,7 +988,7 @@ END Import; END END OutFlds; - PROCEDURE OutSign(result: Struct; par: Object); + PROCEDURE OutSign(result: Struct; par: Object); (* Procedure signature *) BEGIN OutStr(result); WHILE par # NIL DO @@ -1010,7 +1000,7 @@ END Import; OPM.SymWInt(Send) END OutSign; - PROCEDURE OutTProcs(typ: Struct; obj: Object); + PROCEDURE OutTProcs(typ: Struct; obj: Object); (* Type bound procedures *) BEGIN IF obj # NIL THEN OutTProcs(typ, obj^.left); @@ -1033,18 +1023,11 @@ END Import; END END OutTProcs; - - PROCEDURE OutSize(size: LONGINT); - BEGIN - (* OPM.SymWInt(123456789); *) - OPM.SymWInt(size) - END OutSize; - - PROCEDURE OutStr(typ: Struct); (* OPV.TypeAlloc already applied *) VAR strobj: Object; BEGIN IF (typ^.ref < expCtxt.ref) THEN OPM.SymWInt(-typ^.ref); + IF typ.ref IN intSet THEN OPM.SymWInt(typ.size) END ELSE OPM.SymWInt(Sstruct); typ^.ref := expCtxt.ref; INC(expCtxt.ref); @@ -1091,7 +1074,7 @@ END Import; Char: OPM.SymWCh(CHR(obj^.conval^.intval)) | SInt, Int, - LInt: OPM.SymWInt(obj^.conval^.intval); OutSize(obj.typ.size) + LInt: OPM.SymWInt(obj^.conval^.intval); OPM.SymWInt(obj.typ.size) | Set: OPM.SymWSet(obj^.conval^.setval) | Real: rval := SHORT(obj^.conval^.realval); OPM.SymWReal(rval) | LReal: OPM.SymWLReal(obj^.conval^.realval) @@ -1280,14 +1263,14 @@ BEGIN topScope := NIL; OpenScope(0, NIL); OPM.errpos := 0; impCtxt.ref[NoTyp] := notyp; impCtxt.ref[Pointer] := sysptrtyp; - NextSize[1] := sinttyp; - NextSize[2] := inttyp; - NextSize[3] := linttyp; + IntTypes[1] := sinttyp; + IntTypes[2] := inttyp; + IntTypes[3] := linttyp; - NextSize[5] := int8typ; - NextSize[6] := int16typ; - NextSize[7] := int32typ; - NextSize[8] := int64typ + IntTypes[5] := int8typ; + IntTypes[6] := int16typ; + IntTypes[7] := int32typ; + IntTypes[8] := int64typ END OPT. diff --git a/src/compiler/OPV.Mod b/src/compiler/OPV.Mod index 7518f811..a3e2272d 100644 --- a/src/compiler/OPV.Mod +++ b/src/compiler/OPV.Mod @@ -624,7 +624,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 IF SideEffects(n) THEN OPM.WriteString("__MODF(") ELSE OPM.WriteString("__MOD(") END; - ELSE OPM.LogWStr("unhandled case in OPV.expr, subclass = "); OPM.LogWNum(subclass, 0); OPM.LogWLn; + ELSE OPM.LogWStr("unhandled case in OPV.expr, subclass = "); OPM.LogWNum(subclass, 0); OPM.LogWLn; END ; expr(l, MinPrec); OPM.WriteString(Comma); diff --git a/src/system/SYSTEM.h b/src/system/SYSTEM.h index 216af910..343404a4 100644 --- a/src/system/SYSTEM.h +++ b/src/system/SYSTEM.h @@ -183,7 +183,7 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __ABSFD(x) SYSTEM_ABSD((double)(x)) #define __CAP(ch) ((CHAR)((ch)&0x5f)) #define __ODD(x) ((x)&1) -#define __IN(x, s) (((s)>>(x))&1) +#define __IN(x, s) ((x)>=0 && (x)<(8*sizeof(SET)) && ((((U_SET)(s))>>(x))&1)) #define __SETOF(x) ((SET)1<<(x)) #define __SETRNG(l, h) ((~(SET)0<<(l))&~(SET)0>>(8*sizeof(SET)-1-(h))) #define __MASK(x, m) ((x)&~(m)) diff --git a/src/test/confidence/testresult.sh b/src/test/confidence/testresult.sh index bdfcccfe..2dfd8a34 100755 --- a/src/test/confidence/testresult.sh +++ b/src/test/confidence/testresult.sh @@ -7,8 +7,8 @@ fi # Compare generated code if [ -f new.asm ] -#then egrep '^[0-9 ]{4} ([0-9a-f]{4}| ) [0-9A-F]{2}[0-9A-F ]{6}' new.asm|cut -c 11- >new.$FLAVOUR.$BRANCH.s -then sed -n '/^ *[0-9]\+ \([0-9a-f]\{4\}\| \) [0-9A-F]\{2\}[0-9A-F ]\{6\}/s/^ *[0-9]\+ ....//p' new.asm>new.$FLAVOUR.$BRANCH.s +#then sed -n '/^ *[0-9]\+ \([0-9a-f]\{4\}\| \) [0-9A-F]\{2\}[0-9A-F ]\{6\}/s/^ *[0-9]\+ ....//p' new.asm>new.$FLAVOUR.$BRANCH.s +then sed -n '/^ *[0-9]\+ \([0-9a-f]\{4\}\| \) [0-9A-F]\{2\}[0-9A-F ]\{6\}/s/^ *[0-9]\+ ....//p' new.asm | sed 's/_m.[0-9]\+/_m.xxx/' >new.$FLAVOUR.$BRANCH.s if [ -f old.$FLAVOUR.$BRANCH.s -a old.$FLAVOUR.$BRANCH.s -nt ../planned-binary-change ] then From 0508097ffe00338444ba0a28f50cc5fc43910e0d Mon Sep 17 00:00:00 2001 From: David Brown Date: Wed, 31 Aug 2016 17:15:44 +0100 Subject: [PATCH 203/580] Base expression casting on C int size, remove dependencies on form=LInt. --- bootstrap/unix-44/Configuration.c | 4 +- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Console.c | 20 +- bootstrap/unix-44/Console.h | 2 +- bootstrap/unix-44/Files.c | 152 +++---- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 32 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 18 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 94 ++-- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 629 ++++++++++++++------------- bootstrap/unix-44/OPC.h | 3 +- bootstrap/unix-44/OPM.c | 354 +++++++-------- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 92 ++-- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 16 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 280 ++++++------ bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 460 ++++++++++---------- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Platform.c | 78 ++-- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 36 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 18 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 172 ++++---- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/Vishap.c | 36 +- bootstrap/unix-44/errors.c | 2 +- bootstrap/unix-44/errors.h | 2 +- bootstrap/unix-44/extTools.c | 62 +-- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-44/vt100.c | 100 ++--- bootstrap/unix-44/vt100.h | 2 +- bootstrap/unix-48/Configuration.c | 4 +- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Console.c | 20 +- bootstrap/unix-48/Console.h | 2 +- bootstrap/unix-48/Files.c | 152 +++---- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 32 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 18 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 94 ++-- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 629 ++++++++++++++------------- bootstrap/unix-48/OPC.h | 3 +- bootstrap/unix-48/OPM.c | 354 +++++++-------- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 92 ++-- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 16 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 280 ++++++------ bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 460 ++++++++++---------- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Platform.c | 78 ++-- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 36 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 18 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 172 ++++---- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/Vishap.c | 36 +- bootstrap/unix-48/errors.c | 2 +- bootstrap/unix-48/errors.h | 2 +- bootstrap/unix-48/extTools.c | 62 +-- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-48/vt100.c | 100 ++--- bootstrap/unix-48/vt100.h | 2 +- bootstrap/unix-88/Configuration.c | 4 +- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Console.c | 18 +- bootstrap/unix-88/Console.h | 2 +- bootstrap/unix-88/Files.c | 148 +++---- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 34 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 18 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 74 ++-- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 617 +++++++++++++------------- bootstrap/unix-88/OPC.h | 3 +- bootstrap/unix-88/OPM.c | 344 +++++++-------- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 92 ++-- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 8 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 280 ++++++------ bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 456 +++++++++---------- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Platform.c | 68 +-- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 22 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 4 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 168 +++---- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/Vishap.c | 36 +- bootstrap/unix-88/errors.c | 2 +- bootstrap/unix-88/errors.h | 2 +- bootstrap/unix-88/extTools.c | 62 +-- bootstrap/unix-88/extTools.h | 2 +- bootstrap/unix-88/vt100.c | 100 ++--- bootstrap/unix-88/vt100.h | 2 +- bootstrap/windows-48/Configuration.c | 4 +- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Console.c | 20 +- bootstrap/windows-48/Console.h | 2 +- bootstrap/windows-48/Files.c | 152 +++---- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 32 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 18 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 94 ++-- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 629 ++++++++++++++------------- bootstrap/windows-48/OPC.h | 3 +- bootstrap/windows-48/OPM.c | 354 +++++++-------- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 92 ++-- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 16 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 280 ++++++------ bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 460 ++++++++++---------- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Platform.c | 70 +-- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 36 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 18 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 172 ++++---- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/Vishap.c | 36 +- bootstrap/windows-48/errors.c | 2 +- bootstrap/windows-48/errors.h | 2 +- bootstrap/windows-48/extTools.c | 62 +-- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-48/vt100.c | 100 ++--- bootstrap/windows-48/vt100.h | 2 +- bootstrap/windows-88/Configuration.c | 4 +- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Console.c | 18 +- bootstrap/windows-88/Console.h | 2 +- bootstrap/windows-88/Files.c | 148 +++---- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 34 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 18 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 74 ++-- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 617 +++++++++++++------------- bootstrap/windows-88/OPC.h | 3 +- bootstrap/windows-88/OPM.c | 344 +++++++-------- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 92 ++-- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 8 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 280 ++++++------ bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 456 +++++++++---------- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Platform.c | 62 +-- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 22 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 4 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 168 +++---- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/Vishap.c | 36 +- bootstrap/windows-88/errors.c | 2 +- bootstrap/windows-88/errors.h | 2 +- bootstrap/windows-88/extTools.c | 62 +-- bootstrap/windows-88/extTools.h | 2 +- bootstrap/windows-88/vt100.c | 100 ++--- bootstrap/windows-88/vt100.h | 2 +- src/compiler/OPC.Mod | 20 +- src/compiler/OPM.cmdln.Mod | 6 + src/compiler/OPT.Mod | 3 +- src/compiler/OPV.Mod | 55 ++- 199 files changed, 6800 insertions(+), 6540 deletions(-) diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index 947863a2..eed3c4f0 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -13,6 +13,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/08/30] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/08/31] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index 33303334..90696149 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Console.c b/bootstrap/unix-44/Console.c index 375896e6..124f7163 100644 --- a/bootstrap/unix-44/Console.c +++ b/bootstrap/unix-44/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Platform.h" @@ -21,7 +21,7 @@ export void Console_String (CHAR *s, LONGINT s__len); void Console_Flush (void) { INTEGER error; - error = Platform_Write(((LONGINT)(1)), (LONGINT)(SYSTEM_ADRINT)Console_line, Console_pos); + error = Platform_Write(1, (SYSTEM_ADRINT)Console_line, Console_pos); Console_pos = 0; } @@ -30,7 +30,7 @@ void Console_Char (CHAR ch) if (Console_pos == 128) { Console_Flush(); } - Console_line[__X(Console_pos, ((LONGINT)(128)))] = ch; + Console_line[__X(Console_pos, 128)] = ch; Console_pos += 1; if (ch == 0x0a) { Console_Flush(); @@ -58,17 +58,17 @@ void Console_Int (LONGINT i, LONGINT n) k = 10; } else { i1 = __ABS(i); - s[0] = (CHAR)(__MOD(i1, 10) + 48); + s[0] = (CHAR)((int)__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k = 1; while (i1 > 0) { - s[__X(k, ((LONGINT)(32)))] = (CHAR)(__MOD(i1, 10) + 48); + s[__X(k, 32)] = (CHAR)((int)__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k += 1; } } if (i < 0) { - s[__X(k, ((LONGINT)(32)))] = '-'; + s[__X(k, 32)] = '-'; k += 1; } while (n > k) { @@ -77,7 +77,7 @@ void Console_Int (LONGINT i, LONGINT n) } while (k > 0) { k -= 1; - Console_Char(s[__X(k, ((LONGINT)(32)))]); + Console_Char(s[__X(k, 32)]); } } @@ -89,9 +89,9 @@ void Console_Ln (void) void Console_Bool (BOOLEAN b) { if (b) { - Console_String((CHAR*)"TRUE", (LONGINT)5); + Console_String((CHAR*)"TRUE", 5); } else { - Console_String((CHAR*)"FALSE", (LONGINT)6); + Console_String((CHAR*)"FALSE", 6); } } @@ -115,7 +115,7 @@ void Console_Read (CHAR *ch) LONGINT n; INTEGER error; Console_Flush(); - error = Platform_ReadBuf(((LONGINT)(0)), (void*)&*ch, ((LONGINT)(1)), &n); + error = Platform_ReadBuf(0, (void*)&*ch, 1, &n); if (n != 1) { *ch = 0x00; } diff --git a/bootstrap/unix-44/Console.h b/bootstrap/unix-44/Console.h index 0e7cb823..fad0f676 100644 --- a/bootstrap/unix-44/Console.h +++ b/bootstrap/unix-44/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 069b901c..05991786 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" @@ -110,23 +110,23 @@ static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INTEGER errcode) { __DUP(s, s__len, CHAR); Console_Ln(); - Console_String((CHAR*)"-- ", (LONGINT)4); + Console_String((CHAR*)"-- ", 4); Console_String(s, s__len); - Console_String((CHAR*)": ", (LONGINT)3); + Console_String((CHAR*)": ", 3); if (f != NIL) { if (f->registerName[0] != 0x00) { - Console_String(f->registerName, ((LONGINT)(101))); + Console_String(f->registerName, 101); } else { - Console_String(f->workName, ((LONGINT)(101))); + Console_String(f->workName, 101); } if (f->fd != 0) { - Console_String((CHAR*)"f.fd = ", (LONGINT)8); - Console_Int(f->fd, ((LONGINT)(1))); + Console_String((CHAR*)"f.fd = ", 8); + Console_Int(f->fd, 1); } } if (errcode != 0) { - Console_String((CHAR*)" errcode = ", (LONGINT)12); - Console_Int(errcode, ((LONGINT)(1))); + Console_String((CHAR*)" errcode = ", 12); + Console_Int(errcode, 1); } Console_Ln(); __HALT(99); @@ -192,7 +192,7 @@ static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *na name[i + 5] = '.'; i += 6; while (n > 0) { - name[i] = (CHAR)(__MOD(n, 10) + 48); + name[i] = (CHAR)((int)__MOD(n, 10) + 48); n = __DIV(n, 10); i += 1; } @@ -200,7 +200,7 @@ static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *na i += 1; n = Platform_PID; while (n > 0) { - name[i] = (CHAR)(__MOD(n, 10) + 48); + name[i] = (CHAR)((int)__MOD(n, 10) + 48); n = __DIV(n, 10); i += 1; } @@ -216,15 +216,15 @@ static void Files_Create (Files_File f) CHAR err[32]; if (f->fd == -1) { if (f->state == 1) { - Files_GetTempName(f->registerName, ((LONGINT)(101)), (void*)f->workName, ((LONGINT)(101))); + Files_GetTempName(f->registerName, 101, (void*)f->workName, 101); f->tempFile = 1; } else if (f->state == 2) { - __COPY(f->registerName, f->workName, ((LONGINT)(101))); + __COPY(f->registerName, f->workName, 101); f->registerName[0] = 0x00; f->tempFile = 0; } - error = Platform_Unlink((void*)f->workName, ((LONGINT)(101))); - error = Platform_New((void*)f->workName, ((LONGINT)(101)), &f->fd); + error = Platform_Unlink((void*)f->workName, 101); + error = Platform_New((void*)f->workName, 101, &f->fd); done = error == 0; if (done) { f->next = Files_files; @@ -242,7 +242,7 @@ static void Files_Create (Files_File f) } else { __MOVE("file not created", err, 17); } - Files_Err(err, ((LONGINT)(32)), f, error); + Files_Err(err, 32, f, error); } } } @@ -257,15 +257,15 @@ static void Files_Flush (Files_Buffer buf) if (buf->org != f->pos) { error = Platform_Seek(f->fd, buf->org, Platform_SeekSet); } - error = Platform_Write(f->fd, (LONGINT)(SYSTEM_ADRINT)buf->data, buf->size); + error = Platform_Write(f->fd, (SYSTEM_ADRINT)buf->data, buf->size); if (error != 0) { - Files_Err((CHAR*)"error writing file", (LONGINT)19, f, error); + Files_Err((CHAR*)"error writing file", 19, f, error); } f->pos = buf->org + buf->size; buf->chg = 0; error = Platform_Identify(f->fd, &f->identity, Platform_FileIdentity__typ); if (error != 0) { - Files_Err((CHAR*)"error identifying file", (LONGINT)23, f, error); + Files_Err((CHAR*)"error identifying file", 23, f, error); } } } @@ -304,7 +304,7 @@ void Files_Close (Files_File f) } error = Platform_Sync(f->fd); if (error != 0) { - Files_Err((CHAR*)"error writing file", (LONGINT)19, f, error); + Files_Err((CHAR*)"error writing file", 19, f, error); } Files_CloseOSFile(f); } @@ -324,7 +324,7 @@ Files_File Files_New (CHAR *name, LONGINT name__len) __DUP(name, name__len, CHAR); __NEW(f, Files_FileDesc); f->workName[0] = 0x00; - __COPY(name, f->registerName, ((LONGINT)(101))); + __COPY(name, f->registerName, 101); f->fd = -1; f->state = 1; f->len = 0; @@ -437,28 +437,28 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) if (name[0] != 0x00) { if (Files_HasDir((void*)name, name__len)) { dir[0] = 0x00; - __COPY(name, path, ((LONGINT)(256))); + __COPY(name, path, 256); } else { pos = 0; - Files_ScanPath(&pos, (void*)dir, ((LONGINT)(256))); - Files_MakeFileName(dir, ((LONGINT)(256)), name, name__len, (void*)path, ((LONGINT)(256))); - Files_ScanPath(&pos, (void*)dir, ((LONGINT)(256))); + Files_ScanPath(&pos, (void*)dir, 256); + Files_MakeFileName(dir, 256, name, name__len, (void*)path, 256); + Files_ScanPath(&pos, (void*)dir, 256); } for (;;) { - error = Platform_OldRW((void*)path, ((LONGINT)(256)), &fd); + error = Platform_OldRW((void*)path, 256, &fd); done = error == 0; if ((!done && Platform_TooManyFiles(error))) { - Files_Err((CHAR*)"too many files open", (LONGINT)20, f, error); + Files_Err((CHAR*)"too many files open", 20, f, error); } if ((!done && Platform_Inaccessible(error))) { - error = Platform_OldRO((void*)path, ((LONGINT)(256)), &fd); + error = Platform_OldRO((void*)path, 256, &fd); done = error == 0; } if ((!done && !Platform_Absent(error))) { - Console_String((CHAR*)"Warning: Files.Old ", (LONGINT)20); + Console_String((CHAR*)"Warning: Files.Old ", 20); Console_String(name, name__len); - Console_String((CHAR*)" error = ", (LONGINT)10); - Console_Int(error, ((LONGINT)(0))); + Console_String((CHAR*)" error = ", 10); + Console_Int(error, 0); Console_Ln(); } if (done) { @@ -476,7 +476,7 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) f->pos = 0; f->swapper = -1; error = Platform_Size(fd, &f->len); - __COPY(name, f->workName, ((LONGINT)(101))); + __COPY(name, f->workName, 101); f->registerName[0] = 0x00; f->tempFile = 0; f->identity = identity; @@ -492,8 +492,8 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) __DEL(name); return _o_result; } else { - Files_MakeFileName(dir, ((LONGINT)(256)), name, name__len, (void*)path, ((LONGINT)(256))); - Files_ScanPath(&pos, (void*)dir, ((LONGINT)(256))); + Files_MakeFileName(dir, 256, name, name__len, (void*)path, 256); + Files_ScanPath(&pos, (void*)dir, 256); } } } else { @@ -518,8 +518,8 @@ void Files_Purge (Files_File f) i += 1; } if (f->fd != -1) { - error = Platform_Truncate(f->fd, ((LONGINT)(0))); - error = Platform_Seek(f->fd, ((LONGINT)(0)), Platform_SeekSet); + error = Platform_Truncate(f->fd, 0); + error = Platform_Seek(f->fd, 0, Platform_SeekSet); } f->pos = 0; f->len = 0; @@ -584,9 +584,9 @@ void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, LONGINT pos) if (f->pos != org) { error = Platform_Seek(f->fd, org, Platform_SeekSet); } - error = Platform_ReadBuf(f->fd, (void*)buf->data, ((LONGINT)(4096)), &n); + error = Platform_ReadBuf(f->fd, (void*)buf->data, 4096, &n); if (error != 0) { - Files_Err((CHAR*)"read from file not done", (LONGINT)24, f, error); + Files_Err((CHAR*)"read from file not done", 24, f, error); } f->pos = org + n; buf->size = n; @@ -656,7 +656,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x } else { min = n; } - __MOVE((LONGINT)(SYSTEM_ADRINT)buf->data + offset, (LONGINT)(SYSTEM_ADRINT)x + xpos, min); + __MOVE((SYSTEM_ADRINT)buf->data + offset, (SYSTEM_ADRINT)x + xpos, min); offset += min; (*r).offset = offset; xpos += min; @@ -668,7 +668,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x void Files_ReadByte (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len) { - Files_ReadBytes(&*r, r__typ, (void*)x, x__len * ((LONGINT)(1)), ((LONGINT)(1))); + Files_ReadBytes(&*r, r__typ, (void*)x, x__len * 1, 1); } Files_File Files_Base (Files_Rider *r, LONGINT *r__typ) @@ -721,7 +721,7 @@ void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT } else { min = n; } - __MOVE((LONGINT)(SYSTEM_ADRINT)x + xpos, (LONGINT)(SYSTEM_ADRINT)buf->data + offset, min); + __MOVE((SYSTEM_ADRINT)x + xpos, (SYSTEM_ADRINT)buf->data + offset, min); offset += min; (*r).offset = offset; if (offset > buf->size) { @@ -772,15 +772,15 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT *res = 3; return; } - error = Platform_Read(fdold, (LONGINT)(SYSTEM_ADRINT)buf, ((LONGINT)(4096)), &n); + error = Platform_Read(fdold, (SYSTEM_ADRINT)buf, 4096, &n); while (n > 0) { - error = Platform_Write(fdnew, (LONGINT)(SYSTEM_ADRINT)buf, n); + error = Platform_Write(fdnew, (SYSTEM_ADRINT)buf, n); if (error != 0) { ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); - Files_Err((CHAR*)"cannot move file", (LONGINT)17, NIL, error); + Files_Err((CHAR*)"cannot move file", 17, NIL, error); } - error = Platform_Read(fdold, (LONGINT)(SYSTEM_ADRINT)buf, ((LONGINT)(4096)), &n); + error = Platform_Read(fdold, (SYSTEM_ADRINT)buf, 4096, &n); } ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); @@ -788,7 +788,7 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT error = Platform_Unlink((void*)old, old__len); *res = 0; } else { - Files_Err((CHAR*)"cannot move file", (LONGINT)17, NIL, error); + Files_Err((CHAR*)"cannot move file", 17, NIL, error); } } } else { @@ -808,12 +808,12 @@ void Files_Register (Files_File f) } Files_Close(f); if (f->registerName[0] != 0x00) { - Files_Rename(f->workName, ((LONGINT)(101)), f->registerName, ((LONGINT)(101)), &errcode); + Files_Rename(f->workName, 101, f->registerName, 101, &errcode); if (errcode != 0) { - __COPY(f->registerName, file, ((LONGINT)(104))); + __COPY(f->registerName, file, 104); __HALT(99); } - __COPY(f->registerName, f->workName, ((LONGINT)(101))); + __COPY(f->registerName, f->workName, 101); f->registerName[0] = 0x00; f->tempFile = 0; } @@ -838,7 +838,7 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *de j += 1; } } else { - __MOVE((LONGINT)(SYSTEM_ADRINT)src, (LONGINT)(SYSTEM_ADRINT)dest, src__len); + __MOVE((SYSTEM_ADRINT)src, (SYSTEM_ADRINT)dest, src__len); } } @@ -850,38 +850,38 @@ void Files_ReadBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN *x) void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, INTEGER *x) { CHAR b[2]; - Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(2)), ((LONGINT)(2))); - *x = (int)b[0] + __ASHL((int)b[1], 8); + Files_ReadBytes(&*R, R__typ, (void*)b, 2, 2); + *x = b[0] + __ASHL(b[1], 8); } void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, LONGINT *x) { CHAR b[4]; - Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); - *x = ((int)((int)b[0] + __ASHL((int)b[1], 8)) + __ASHL((int)b[2], 16)) + __ASHL((int)b[3], 24); + Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); + *x = ((b[0] + __ASHL(b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); } void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x) { CHAR b[4]; LONGINT l; - Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); - l = ((int)((int)b[0] + __ASHL((int)b[1], 8)) + __ASHL((int)b[2], 16)) + __ASHL((int)b[3], 24); - *x = (SET)l; + Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); + l = ((b[0] + __ASHL(b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); + *x = __VAL(SET, l); } void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x) { CHAR b[4]; - Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); - Files_FlipBytes((void*)b, ((LONGINT)(4)), (void*)&*x, ((LONGINT)(4))); + Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); + Files_FlipBytes((void*)b, 4, (void*)&*x, 4); } void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x) { CHAR b[8]; - Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(8)), ((LONGINT)(8))); - Files_FlipBytes((void*)b, ((LONGINT)(8)), (void*)&*x, ((LONGINT)(8))); + Files_ReadBytes(&*R, R__typ, (void*)b, 8, 8); + Files_FlipBytes((void*)b, 8, (void*)&*x, 8); } void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) @@ -922,12 +922,12 @@ void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, LONGINT *x) s = 0; n = 0; Files_Read(&*R, R__typ, (void*)&ch); - while ((int)ch >= 128) { - n += __ASH((int)((int)ch - 128), s); + while (ch >= 128) { + n += __ASH((ch - 128), s); s += 7; Files_Read(&*R, R__typ, (void*)&ch); } - n += __ASH((int)(__MASK((int)ch, -64) - __ASHL(__ASHR((int)ch, 6), 6)), s); + n += __ASH((__MASK(ch, -64) - __ASHL(__ASHR(ch, 6), 6)), s); *x = n; } @@ -941,7 +941,7 @@ void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, INTEGER x) CHAR b[2]; b[0] = (CHAR)x; b[1] = (CHAR)__ASHR(x, 8); - Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(2)), ((LONGINT)(2))); + Files_WriteBytes(&*R, R__typ, (void*)b, 2, 2); } void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, LONGINT x) @@ -951,33 +951,33 @@ void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, LONGINT x) b[1] = (CHAR)__ASHR(x, 8); b[2] = (CHAR)__ASHR(x, 16); b[3] = (CHAR)__ASHR(x, 24); - Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); + Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x) { CHAR b[4]; LONGINT i; - i = (LONGINT)x; + i = __VAL(LONGINT, x); b[0] = (CHAR)i; b[1] = (CHAR)__ASHR(i, 8); b[2] = (CHAR)__ASHR(i, 16); b[3] = (CHAR)__ASHR(i, 24); - Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); + Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x) { CHAR b[4]; - Files_FlipBytes((void*)&x, ((LONGINT)(4)), (void*)b, ((LONGINT)(4))); - Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); + Files_FlipBytes((void*)&x, 4, (void*)b, 4); + Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x) { CHAR b[8]; - Files_FlipBytes((void*)&x, ((LONGINT)(8)), (void*)b, ((LONGINT)(8))); - Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(8)), ((LONGINT)(8))); + Files_FlipBytes((void*)&x, 8, (void*)b, 8); + Files_WriteBytes(&*R, R__typ, (void*)b, 8, 8); } void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) @@ -987,7 +987,7 @@ void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len while (x[i] != 0x00) { i += 1; } - Files_WriteBytes(&*R, R__typ, (void*)x, x__len * ((LONGINT)(1)), i + 1); + Files_WriteBytes(&*R, R__typ, (void*)x, x__len * 1, i + 1); } void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, LONGINT x) @@ -1012,7 +1012,7 @@ static void Files_Finalize (SYSTEM_PTR o) if (f->fd >= 0) { Files_CloseOSFile(f); if (f->tempFile) { - res = Platform_Unlink((void*)f->workName, ((LONGINT)(101))); + res = Platform_Unlink((void*)f->workName, 101); } } } @@ -1021,7 +1021,7 @@ void Files_SetSearchPath (CHAR *path, LONGINT path__len) { __DUP(path, path__len, CHAR); if (Strings_Length(path, path__len) != 0) { - Files_SearchPath = __NEWARR(NIL, ((LONGINT)(1)), 1, 1, 1, (LONGINT)(Strings_Length(path, path__len) + 1)); + Files_SearchPath = __NEWARR(NIL, 1, 1, 1, 1, ((SYSTEM_ADRINT)((Strings_Length(path, path__len) + 1)))); __COPY(path, Files_SearchPath->data, Files_SearchPath->len[0]); } else { Files_SearchPath = NIL; @@ -1055,6 +1055,6 @@ export void *Files__init(void) Files_tempno = -1; Heap_FileCount = 0; Files_HOME[0] = 0x00; - Platform_GetEnv((CHAR*)"HOME", (LONGINT)5, (void*)Files_HOME, ((LONGINT)(1024))); + Platform_GetEnv((CHAR*)"HOME", 5, (void*)Files_HOME, 1024); __ENDMOD; } diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index 7241c31a..61089cbd 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index 5fcaf193..e42a752c 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tskSfF */ #include "SYSTEM.h" struct Heap__1 { @@ -116,7 +116,7 @@ void Heap_Unlock (void) { Heap_lockdepth -= 1; if ((Heap_interrupted && Heap_lockdepth == 0)) { - Heap_PlatformHalt(((LONGINT)(-9))); + Heap_PlatformHalt(-9); } } @@ -131,7 +131,7 @@ SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) } m->types = 0; m->cmds = NIL; - __COPY(name, m->name, ((LONGINT)(20))); + __COPY(name, m->name, 20); m->refcnt = 0; m->enumPtrs = enumPtrs; m->next = (Heap_Module)(SYSTEM_ADRINT)Heap_modules; @@ -148,7 +148,7 @@ void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) } else { __NEW(c, Heap_CmdDesc); } - __COPY(name, c->name, ((LONGINT)(24))); + __COPY(name, c->name, 24); c->cmd = cmd; c->next = m->cmds; m->cmds = c; @@ -326,12 +326,12 @@ SYSTEM_PTR Heap_NEWBLK (LONGINT size) SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 31, 4), 4); - new = Heap_NEWREC((LONGINT)(SYSTEM_ADRINT)&blksz); - tag = ((LONGINT)(SYSTEM_ADRINT)new + blksz) - 12; + new = Heap_NEWREC((SYSTEM_ADRINT)&blksz); + tag = (__VAL(LONGINT, new) + blksz) - 12; __PUT(tag - 4, 0, LONGINT); __PUT(tag, blksz, LONGINT); __PUT(tag + 4, -4, LONGINT); - __PUT((LONGINT)(SYSTEM_ADRINT)new - 4, tag, LONGINT); + __PUT(__VAL(LONGINT, new) - 4, tag, LONGINT); Heap_Unlock(); _o_result = new; return _o_result; @@ -360,7 +360,7 @@ static void Heap_Mark (LONGINT q) __GET(tag, offset, LONGINT); fld = q + offset; p = Heap_FetchAddress(fld); - __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)n, SYSTEM_PTR); + __PUT(fld, __VAL(SYSTEM_PTR, n), SYSTEM_PTR); } else { fld = q + offset; n = Heap_FetchAddress(fld); @@ -369,7 +369,7 @@ static void Heap_Mark (LONGINT q) if (!__ODD(tagbits)) { __PUT(n - 4, tagbits + 1, LONGINT); __PUT(q - 4, tag + 1, LONGINT); - __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)p, SYSTEM_PTR); + __PUT(fld, __VAL(SYSTEM_PTR, p), SYSTEM_PTR); p = q; q = n; tag = tagbits; @@ -384,7 +384,7 @@ static void Heap_Mark (LONGINT q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((LONGINT)(SYSTEM_ADRINT)p); + Heap_Mark(__VAL(LONGINT, p)); } static void Heap_Scan (void) @@ -553,7 +553,7 @@ static void Heap_Finalize (void) } else { prev->next = n->next; } - (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); + (*n->finalize)(__VAL(SYSTEM_PTR, n->obj)); if (prev == NIL) { n = Heap_fin; } else { @@ -572,7 +572,7 @@ void Heap_FINALL (void) while (Heap_fin != NIL) { n = Heap_fin; Heap_fin = Heap_fin->next; - (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); + (*n->finalize)(__VAL(SYSTEM_PTR, n->obj)); } } @@ -589,9 +589,9 @@ static void Heap_MarkStack (LONGINT n, LONGINT *cand, LONGINT cand__len) } if (n == 0) { nofcand = 0; - sp = (LONGINT)(SYSTEM_ADRINT)&frame; + sp = (SYSTEM_ADRINT)&frame; stack0 = Heap_PlatformMainStackFrame(); - inc = (LONGINT)(SYSTEM_ADRINT)&align.p - (LONGINT)(SYSTEM_ADRINT)&align; + inc = (SYSTEM_ADRINT)&align.p - (SYSTEM_ADRINT)&align; if (sp > stack0) { inc = -inc; } @@ -680,7 +680,7 @@ void Heap_GC (BOOLEAN markStack) i22 += 23; i23 += 24; if ((i0 == -99 && i15 == 24)) { - Heap_MarkStack(((LONGINT)(32)), (void*)cand, ((LONGINT)(10000))); + Heap_MarkStack(32, (void*)cand, 10000); break; } } @@ -699,7 +699,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (LONGINT)(SYSTEM_ADRINT)obj; + f->obj = __VAL(LONGINT, obj); f->finalize = finalize; f->marked = 1; f->next = Heap_fin; diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index 4247d33d..4d5c5b4e 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index 148c062a..9f39f448 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Heap.h" @@ -83,10 +83,10 @@ Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len) Modules_resMsg[0] = 0x00; } else { Modules_res = 1; - __COPY(name, Modules_importing, ((LONGINT)(20))); + __COPY(name, Modules_importing, 20); __MOVE(" module \"", Modules_resMsg, 10); - Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), name, name__len); - Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), (CHAR*)"\" not found", (LONGINT)12); + Modules_Append((void*)Modules_resMsg, 256, name, name__len); + Modules_Append((void*)Modules_resMsg, 256, (CHAR*)"\" not found", 12); } _o_result = m; __DEL(name); @@ -111,11 +111,11 @@ Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT nam } else { Modules_res = 2; __MOVE(" command \"", Modules_resMsg, 11); - __COPY(name, Modules_importing, ((LONGINT)(20))); - Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), mod->name, ((LONGINT)(20))); - Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), (CHAR*)".", (LONGINT)2); - Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), name, name__len); - Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), (CHAR*)"\" not found", (LONGINT)12); + __COPY(name, Modules_importing, 20); + Modules_Append((void*)Modules_resMsg, 256, mod->name, 20); + Modules_Append((void*)Modules_resMsg, 256, (CHAR*)".", 2); + Modules_Append((void*)Modules_resMsg, 256, name, name__len); + Modules_Append((void*)Modules_resMsg, 256, (CHAR*)"\" not found", 12); _o_result = NIL; __DEL(name); return _o_result; diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index 85b1ec59..1707868f 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index 9a06ac24..73416071 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" @@ -271,7 +271,7 @@ OPT_Node OPB_NewString (OPS_String str, LONGINT len) x->conval->intval = -1; x->conval->intval2 = len; x->conval->ext = OPT_NewExt(); - __COPY(str, *x->conval->ext, ((LONGINT)(256))); + __COPY(str, *x->conval->ext, 256); _o_result = x; return _o_result; } @@ -468,7 +468,7 @@ void OPB_In (OPT_Node *x, OPT_Node y) } else if ((__IN(f, 0x70) && y->typ->form == 9)) { if ((*x)->class == 7) { k = (*x)->conval->intval; - if (k < 0 || k > (int)OPM_MaxSet) { + if (k < 0 || k > OPM_MaxSet) { OPB_err(202); } else if (y->class == 7) { (*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval)); @@ -618,7 +618,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) case 22: if (f == 3) { if (z->class == 7) { - z->conval->intval = (int)__CAP((CHAR)z->conval->intval); + z->conval->intval = __CAP((CHAR)z->conval->intval); z->obj = NIL; } else { z = NewOp__29(op, typ, z); @@ -666,8 +666,8 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->typ = OPT_booltyp; break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPB.MOp, op = ", (LONGINT)33); - OPM_LogWNum(op, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPB.MOp, op = ", 33); + OPM_LogWNum(op, 0); OPM_LogWLn(); break; } @@ -826,8 +826,8 @@ static INTEGER ConstCmp__14 (void) } break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPB.ConstCmp, f = ", (LONGINT)37); - OPM_LogWNum(*ConstOp__13_s->f, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPB.ConstCmp, f = ", 37); + OPM_LogWNum(*ConstOp__13_s->f, 0); OPM_LogWLn(); break; } @@ -1002,7 +1002,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) case 4: if (__IN(f, 0x70)) { if (yval->intval != 0) { - xval->intval = __MOD(xval->intval, yval->intval); + xval->intval = (int)__MOD(xval->intval, yval->intval); OPB_SetIntType(x); } else { OPB_err(205); @@ -1105,8 +1105,8 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPB.ConstOp, op = ", (LONGINT)37); - OPM_LogWNum(op, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPB.ConstOp, op = ", 37); + OPM_LogWNum(op, 0); OPM_LogWLn(); break; } @@ -1149,12 +1149,12 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) OPB_err(203); r = (LONGREAL)1; } - (*x)->conval->intval = (int)__ENTIER(r); + (*x)->conval->intval = (SYSTEM_INT32)__ENTIER(r); OPB_SetIntType(*x); } } (*x)->obj = NIL; - } else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((int)(*x)->left->typ->form < f || f > g))) { + } else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((*x)->left->typ->form < f || f > g))) { if ((*x)->left->typ == typ) { *x = (*x)->left; } @@ -1207,11 +1207,11 @@ static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) if ((*Op__38_s->f == 10 && (*x)->conval->intval2 == 1)) { (*x)->typ = OPT_chartyp; (*x)->conval->intval = 0; - OPB_Index(&*y, OPB_NewIntConst(((LONGINT)(0)))); + OPB_Index(&*y, OPB_NewIntConst(0)); } else if ((*Op__38_s->g == 10 && (*y)->conval->intval2 == 1)) { (*y)->typ = OPT_chartyp; (*y)->conval->intval = 0; - OPB_Index(&*x, OPB_NewIntConst(((LONGINT)(0)))); + OPB_Index(&*x, OPB_NewIntConst(0)); } } _o_result = ok; @@ -1475,7 +1475,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) typ = OPT_booltyp; } else { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"ELSE in Op()", (LONGINT)13); + OPM_LogWStr((CHAR*)"ELSE in Op()", 13); OPM_LogWLn(); OPB_err(108); typ = OPT_undftyp; @@ -1483,8 +1483,8 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) NewOp__39(op, typ, &z, y); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPB.Op, op = ", (LONGINT)32); - OPM_LogWNum(op, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPB.Op, op = ", 32); + OPM_LogWNum(op, 0); OPM_LogWLn(); break; } @@ -1501,13 +1501,13 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y) } else if ((__IN((*x)->typ->form, 0x70) && __IN(y->typ->form, 0x70))) { if ((*x)->class == 7) { k = (*x)->conval->intval; - if (0 > k || k > (int)OPM_MaxSet) { + if (0 > k || k > OPM_MaxSet) { OPB_err(202); } } if (y->class == 7) { l = y->conval->intval; - if (0 > l || l > (int)OPM_MaxSet) { + if (0 > l || l > OPM_MaxSet) { OPB_err(202); } } @@ -1537,7 +1537,7 @@ void OPB_SetElem (OPT_Node *x) OPB_err(93); } else if ((*x)->class == 7) { k = (*x)->conval->intval; - if ((0 <= k && k <= (int)OPM_MaxSet)) { + if ((0 <= k && k <= OPM_MaxSet)) { (*x)->conval->setval = __SETOF(k); } else { OPB_err(202); @@ -1556,24 +1556,24 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPT_Struct p = NIL, q = NIL; if (OPM_Verbose) { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"PROCEDURE CheckAssign", (LONGINT)22); + OPM_LogWStr((CHAR*)"PROCEDURE CheckAssign", 22); OPM_LogWLn(); } y = ynode->typ; f = x->form; g = y->form; if (OPM_Verbose) { - OPM_LogWStr((CHAR*)"y.form = ", (LONGINT)10); - OPM_LogWNum(y->form, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"y.form = ", 10); + OPM_LogWNum(y->form, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"f = ", (LONGINT)5); - OPM_LogWNum(f, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"f = ", 5); + OPM_LogWNum(f, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"g = ", (LONGINT)5); - OPM_LogWNum(g, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"g = ", 5); + OPM_LogWNum(g, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"ynode.typ.syze = ", (LONGINT)18); - OPM_LogWNum(ynode->typ->size, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"ynode.typ.syze = ", 18); + OPM_LogWNum(ynode->typ->size, 0); OPM_LogWLn(); } if (ynode->class == 8 || (ynode->class == 9 && f != 14)) { @@ -1681,8 +1681,8 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) } break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPB.CheckAssign, f = ", (LONGINT)40); - OPM_LogWNum(f, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPB.CheckAssign, f = ", 40); + OPM_LogWNum(f, 0); OPM_LogWLn(); break; } @@ -1774,14 +1774,14 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) x = OPB_NewBoolConst(0); break; case 3: - x = OPB_NewIntConst(((LONGINT)(0))); + x = OPB_NewIntConst(0); x->typ = OPT_chartyp; break; case 4: case 5: case 6: x = OPB_NewIntConst(OPM_SignedMinimum(x->typ->size)); break; case 9: - x = OPB_NewIntConst(((LONGINT)(0))); + x = OPB_NewIntConst(0); x->typ = OPT_inttyp; break; case 7: @@ -1805,7 +1805,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) x = OPB_NewBoolConst(1); break; case 3: - x = OPB_NewIntConst(((LONGINT)(255))); + x = OPB_NewIntConst(255); x->typ = OPT_chartyp; break; case 4: case 5: case 6: @@ -1912,7 +1912,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (__IN(f, 0x70)) { - if (x->typ->size != (int)OPM_LIntSize) { + if (x->typ->size != OPM_LIntSize) { OPB_Convert(&x, OPT_linttyp); } } else { @@ -1927,14 +1927,14 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 12: if (x->class != 8) { OPB_err(110); - x = OPB_NewIntConst(((LONGINT)(1))); + x = OPB_NewIntConst(1); } else if (__IN(f, 0x63fe) || __IN(x->typ->comp, 0x14)) { (*OPB_typSize)(x->typ); x->typ->pvused = 1; x = OPB_NewIntConst(x->typ->size); } else { OPB_err(111); - x = OPB_NewIntConst(((LONGINT)(1))); + x = OPB_NewIntConst(1); } break; case 21: @@ -1952,7 +1952,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) OPB_err(126); } else if ((((x->class == 7 && __IN(f, 0x70))) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x2070) && x->typ->size == (int)OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x2070) && x->typ->size == OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } @@ -1993,8 +1993,8 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) } break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPB.StPar0, fctno = ", (LONGINT)39); - OPM_LogWNum(fctno, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPB.StPar0, fctno = ", 39); + OPM_LogWNum(fctno, 0); OPM_LogWLn(); break; } @@ -2050,7 +2050,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (__IN(f, 0x70)) { - if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > (int)OPM_MaxSet))) { + if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > OPM_MaxSet))) { OPB_err(202); } p = NewOp__53(19, fctno, p, x); @@ -2063,7 +2063,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (!__IN(f, 0x70) || x->class != 7) { OPB_err(69); } else if (x->typ->size == 1) { - L = (int)x->conval->intval; + L = x->conval->intval; typ = p->typ; while ((L > 0 && __IN(typ->comp, 0x0c))) { typ = typ->BaseTyp; @@ -2221,7 +2221,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) OPB_err(126); } else if ((((x->class == 7 && __IN(f, 0x70))) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x2070) && x->typ->size == (int)OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x2070) && x->typ->size == OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } @@ -2321,7 +2321,7 @@ void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno) } } else { if (((fctno == 13 || fctno == 14) && parno == 1)) { - OPB_BindNodes(19, OPT_notyp, &p, OPB_NewIntConst(((LONGINT)(1)))); + OPB_BindNodes(19, OPT_notyp, &p, OPB_NewIntConst(1)); p->subcl = fctno; p->right->typ = p->left->typ; } else if ((fctno == 17 && parno == 1)) { @@ -2343,7 +2343,7 @@ void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno) } else if (fctno == 32) { if (parno == 1) { x = NIL; - OPB_BindNodes(28, OPT_notyp, &x, OPB_NewIntConst(((LONGINT)(0)))); + OPB_BindNodes(28, OPT_notyp, &x, OPB_NewIntConst(0)); x->conval = OPT_NewConst(); x->conval->intval = OPM_errpos; OPB_Construct(15, &p, x); @@ -2578,7 +2578,7 @@ void OPB_Assign (OPT_Node *x, OPT_Node y) } else if (((((((*x)->typ->comp == 2 && (*x)->typ->BaseTyp == OPT_chartyp)) && y->typ->form == 10)) && y->conval->intval2 == 1)) { y->typ = OPT_chartyp; y->conval->intval = 0; - OPB_Index(&*x, OPB_NewIntConst(((LONGINT)(0)))); + OPB_Index(&*x, OPB_NewIntConst(0)); } if ((((((__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp == OPT_chartyp)) && __IN(y->typ->comp, 0x0c))) && y->typ->BaseTyp == OPT_chartyp)) { subcl = 18; diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index 81b3745b..385a9146 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 8a3a54cf..494d985f 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "OPM.h" @@ -62,6 +62,7 @@ static void OPC_InitImports (OPT_Object obj); static void OPC_InitKeywords (void); export void OPC_InitTDesc (OPT_Struct typ); static void OPC_InitTProcs (OPT_Object typ, OPT_Object obj); +export void OPC_IntLiteral (LONGINT n, LONGINT size); export void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim); static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName); static INTEGER OPC_Length (CHAR *s, LONGINT s__len); @@ -178,7 +179,7 @@ static INTEGER OPC_PerfectHash (CHAR *s, LONGINT s__len) i = 0; h = 0; while ((s[__X(i, s__len)] != 0x00 && i < 5)) { - h = 3 * h + (int)s[__X(i, s__len)]; + h = 3 * h + s[__X(i, s__len)]; i += 1; } _o_result = (int)__MOD(h, 105); @@ -191,10 +192,10 @@ void OPC_Ident (OPT_Object obj) mode = obj->mode; level = obj->mnolev; if ((__IN(mode, 0x62) && level > 0) || __IN(mode, 0x14)) { - OPM_WriteStringVar((void*)obj->name, ((LONGINT)(256))); - h = OPC_PerfectHash((void*)obj->name, ((LONGINT)(256))); - if (OPC_hashtab[__X(h, ((LONGINT)(105)))] >= 0) { - if (__STRCMP(OPC_keytab[__X(OPC_hashtab[__X(h, ((LONGINT)(105)))], ((LONGINT)(36)))], obj->name) == 0) { + OPM_WriteStringVar((void*)obj->name, 256); + h = OPC_PerfectHash((void*)obj->name, 256); + if (OPC_hashtab[__X(h, 105)] >= 0) { + if (__STRCMP(OPC_keytab[__X(OPC_hashtab[__X(h, 105)], 36)], obj->name) == 0) { OPM_Write('_'); } } @@ -203,18 +204,18 @@ void OPC_Ident (OPT_Object obj) if (mode == 13) { OPC_Ident(obj->link->typ->strobj); } else if (level < 0) { - OPM_WriteStringVar((void*)OPT_GlbMod[__X(-level, ((LONGINT)(64)))]->name, ((LONGINT)(256))); + OPM_WriteStringVar((void*)OPT_GlbMod[__X(-level, 64)]->name, 256); if (OPM_currFile == 0) { - OPT_GlbMod[__X(-level, ((LONGINT)(64)))]->vis = 1; + OPT_GlbMod[__X(-level, 64)]->vis = 1; } } else { - OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); + OPM_WriteStringVar((void*)OPM_modName, 32); } OPM_Write('_'); } else if ((((((obj == OPT_sysptrtyp->strobj || obj == OPT_ainttyp->strobj) || obj == OPT_int8typ->strobj) || obj == OPT_int16typ->strobj) || obj == OPT_int32typ->strobj) || obj == OPT_int64typ->strobj) || obj == OPT_bytetyp->strobj) { - OPM_WriteString((CHAR*)"SYSTEM_", (LONGINT)8); + OPM_WriteString((CHAR*)"SYSTEM_", 8); } - OPM_WriteStringVar((void*)obj->name, ((LONGINT)(256))); + OPM_WriteStringVar((void*)obj->name, 256); } } @@ -290,7 +291,7 @@ static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef) OPM_Write(')'); OPC_AnsiParamList(typ->link, 0); } else { - OPM_WriteString((CHAR*)")()", (LONGINT)4); + OPM_WriteString((CHAR*)")()", 4); } break; } else if (comp == 2) { @@ -308,8 +309,8 @@ static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef) void OPC_Andent (OPT_Struct typ) { if (typ->strobj == NIL || typ->align >= 65536) { - OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); - OPC_Str1((CHAR*)"__#", (LONGINT)4, __ASHR(typ->align, 16)); + OPM_WriteStringVar((void*)OPM_modName, 32); + OPC_Str1((CHAR*)"__#", 4, __ASHR(typ->align, 16)); } else { OPC_Ident(typ->strobj); } @@ -318,7 +319,7 @@ void OPC_Andent (OPT_Struct typ) static BOOLEAN OPC_Undefined (OPT_Object obj) { BOOLEAN _o_result; - _o_result = obj->name[0] == 0x00 || (((obj->mnolev >= 0 && obj->linkadr != (int)(3 + OPM_currFile))) && obj->linkadr != 2); + _o_result = obj->name[0] == 0x00 || (((obj->mnolev >= 0 && obj->linkadr != (3 + OPM_currFile))) && obj->linkadr != 2); return _o_result; } @@ -336,17 +337,17 @@ static void OPC_DeclareBase (OPT_Object dcl) } obj = typ->strobj; if (typ->form == 12) { - OPM_WriteString((CHAR*)"void", (LONGINT)5); + OPM_WriteString((CHAR*)"void", 5); } else if ((obj != NIL && !OPC_Undefined(obj))) { OPC_Ident(obj); } else if (typ->comp == 4) { - OPM_WriteString((CHAR*)"struct ", (LONGINT)8); + OPM_WriteString((CHAR*)"struct ", 8); OPC_Andent(typ); if ((prev->form != 13 && (obj != NIL || dcl->name[0] == 0x00))) { if ((typ->BaseTyp != NIL && typ->BaseTyp->strobj->vis != 0)) { - OPM_WriteString((CHAR*)" { /* ", (LONGINT)7); + OPM_WriteString((CHAR*)" { /* ", 7); OPC_Ident(typ->BaseTyp->strobj); - OPM_WriteString((CHAR*)" */", (LONGINT)4); + OPM_WriteString((CHAR*)" */", 4); OPM_WriteLn(); OPC_Indent(1); } else { @@ -363,10 +364,10 @@ static void OPC_DeclareBase (OPT_Object dcl) nofdims += 1; typ = typ->BaseTyp; } - OPM_WriteString((CHAR*)"struct ", (LONGINT)8); + OPM_WriteString((CHAR*)"struct ", 8); OPC_BegBlk(); OPC_BegStat(); - OPC_Str1((CHAR*)"LONGINT len[#]", (LONGINT)15, nofdims); + OPC_Str1((CHAR*)"LONGINT len[#]", 15, nofdims); OPC_EndStat(); OPC_BegStat(); __NEW(obj, OPT_ObjDesc); @@ -436,7 +437,7 @@ static void OPC_PutPtrOffsets (OPT_Struct typ, LONGINT adr, LONGINT *cnt) LONGINT n, i; if ((typ->form == 13 && typ->sysflag == 0)) { OPM_WriteInt(adr); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); *cnt += 1; if (__MASK(*cnt, -16) == 0) { OPM_WriteLn(); @@ -453,7 +454,7 @@ static void OPC_PutPtrOffsets (OPT_Struct typ, LONGINT adr, LONGINT *cnt) OPC_PutPtrOffsets(fld->typ, adr + fld->adr, &*cnt); } else { OPM_WriteInt(adr + fld->adr); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); *cnt += 1; if (__MASK(*cnt, -16) == 0) { OPM_WriteLn(); @@ -485,11 +486,11 @@ static void OPC_InitTProcs (OPT_Object typ, OPT_Object obj) OPC_InitTProcs(typ, obj->left); if (obj->mode == 13) { OPC_BegStat(); - OPM_WriteString((CHAR*)"__INITBP(", (LONGINT)10); + OPM_WriteString((CHAR*)"__INITBP(", 10); OPC_Ident(typ); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Ident(obj); - OPC_Str1((CHAR*)", #)", (LONGINT)5, __ASHR(obj->adr, 16)); + OPC_Str1((CHAR*)", #)", 5, __ASHR(obj->adr, 16)); OPC_EndStat(); } OPC_InitTProcs(typ, obj->right); @@ -501,8 +502,8 @@ static void OPC_PutBase (OPT_Struct typ) if (typ != NIL) { OPC_PutBase(typ->BaseTyp); OPC_Ident(typ->strobj); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)"__typ", 6); + OPM_WriteString((CHAR*)", ", 3); } } @@ -512,19 +513,19 @@ static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamNa INTEGER dim; if (showParamName) { OPC_Ident(par); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); } dim = 1; typ = par->typ->BaseTyp; while (typ->comp == 3) { if (ansiDefine) { - OPM_WriteString((CHAR*)", LONGINT ", (LONGINT)11); + OPM_WriteString((CHAR*)", LONGINT ", 11); } else { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); } if (showParamName) { OPC_Ident(par); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); OPM_WriteInt(dim); } typ = typ->BaseTyp; @@ -537,7 +538,7 @@ static void OPC_DeclareParams (OPT_Object par, BOOLEAN macro) OPM_Write('('); while (par != NIL) { if (macro) { - OPM_WriteStringVar((void*)par->name, ((LONGINT)(256))); + OPM_WriteStringVar((void*)par->name, 256); } else { if ((par->mode == 1 && par->typ->form == 7)) { OPM_Write('_'); @@ -545,16 +546,16 @@ static void OPC_DeclareParams (OPT_Object par, BOOLEAN macro) OPC_Ident(par); } if (par->typ->comp == 3) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_LenList(par, 0, 1); } else if ((par->mode == 2 && par->typ->comp == 4)) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); - OPM_WriteStringVar((void*)par->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)", ", 3); + OPM_WriteStringVar((void*)par->name, 256); + OPM_WriteString((CHAR*)"__typ", 6); } par = par->link; if (par != NIL) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); } } OPM_Write(')'); @@ -586,7 +587,7 @@ static void OPC_DeclareTProcs (OPT_Object obj, BOOLEAN *empty) if (OPM_currFile == 0) { if (obj->vis == 1) { OPC_DefineTProcTypes(obj); - OPM_WriteString((CHAR*)"import ", (LONGINT)8); + OPM_WriteString((CHAR*)"import ", 8); *empty = 0; OPC_ProcHeader(obj, 0); } @@ -594,9 +595,9 @@ static void OPC_DeclareTProcs (OPT_Object obj, BOOLEAN *empty) *empty = 0; OPC_DefineTProcTypes(obj); if (obj->vis == 0) { - OPM_WriteString((CHAR*)"static ", (LONGINT)8); + OPM_WriteString((CHAR*)"static ", 8); } else { - OPM_WriteString((CHAR*)"export ", (LONGINT)8); + OPM_WriteString((CHAR*)"export ", 8); } OPC_ProcHeader(obj, 0); } @@ -630,31 +631,31 @@ static void OPC_DefineTProcMacros (OPT_Object obj, BOOLEAN *empty) if (obj != NIL) { OPC_DefineTProcMacros(obj->left, &*empty); if ((((obj->mode == 13 && obj == OPC_BaseTProc(obj))) && (OPM_currFile != 0 || obj->vis == 1))) { - OPM_WriteString((CHAR*)"#define __", (LONGINT)11); + OPM_WriteString((CHAR*)"#define __", 11); OPC_Ident(obj); OPC_DeclareParams(obj->link, 1); - OPM_WriteString((CHAR*)" __SEND(", (LONGINT)9); + OPM_WriteString((CHAR*)" __SEND(", 9); if (obj->link->typ->form == 13) { - OPM_WriteString((CHAR*)"__TYPEOF(", (LONGINT)10); + OPM_WriteString((CHAR*)"__TYPEOF(", 10); OPC_Ident(obj->link); OPM_Write(')'); } else { OPC_Ident(obj->link); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } - OPC_Str1((CHAR*)", #, ", (LONGINT)6, __ASHR(obj->adr, 16)); + OPC_Str1((CHAR*)", #, ", 6, __ASHR(obj->adr, 16)); if (obj->typ == OPT_notyp) { - OPM_WriteString((CHAR*)"void", (LONGINT)5); + OPM_WriteString((CHAR*)"void", 5); } else { OPC_Ident(obj->typ->strobj); } - OPM_WriteString((CHAR*)"(*)", (LONGINT)4); + OPM_WriteString((CHAR*)"(*)", 4); if (OPC_ansi) { OPC_AnsiParamList(obj->link, 0); } else { - OPM_WriteString((CHAR*)"()", (LONGINT)3); + OPM_WriteString((CHAR*)"()", 3); } - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_DeclareParams(obj->link, 1); OPM_Write(')'); OPM_WriteLn(); @@ -709,7 +710,7 @@ static void OPC_DefineType (OPT_Struct str) } } if ((obj != NIL && OPC_Undefined(obj))) { - OPM_WriteString((CHAR*)"typedef", (LONGINT)8); + OPM_WriteString((CHAR*)"typedef", 8); OPM_WriteLn(); OPM_Write(0x09); OPC_Indent(1); @@ -742,7 +743,7 @@ static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len) BOOLEAN r; __DUP(y, y__len, CHAR); i = 0; - while ((*x)[__X(i + 1, ((LONGINT)(256)))] == y[__X(i, y__len)]) { + while ((*x)[__X(i + 1, 256)] == y[__X(i, y__len)]) { i += 1; } r = y[__X(i, y__len)] == 0x00; @@ -758,19 +759,19 @@ static void OPC_CProcDefs (OPT_Object obj, INTEGER vis) INTEGER _for__9; if (obj != NIL) { OPC_CProcDefs(obj->left, vis); - if ((((obj->mode == 9 && (int)obj->vis >= vis)) && obj->adr == 1)) { + if ((((obj->mode == 9 && obj->vis >= vis)) && obj->adr == 1)) { ext = obj->conval->ext; i = 1; - if (((*ext)[1] != '#' && !(OPC_Prefixed(ext, (CHAR*)"extern ", (LONGINT)8) || OPC_Prefixed(ext, (CHAR*)"import ", (LONGINT)8)))) { - OPM_WriteString((CHAR*)"#define ", (LONGINT)9); + if (((*ext)[1] != '#' && !(OPC_Prefixed(ext, (CHAR*)"extern ", 8) || OPC_Prefixed(ext, (CHAR*)"import ", 8)))) { + OPM_WriteString((CHAR*)"#define ", 9); OPC_Ident(obj); OPC_DeclareParams(obj->link, 1); OPM_Write(0x09); } - _for__9 = (int)(*obj->conval->ext)[0]; + _for__9 = (*obj->conval->ext)[0]; i = i; while (i <= _for__9) { - OPM_Write((*obj->conval->ext)[__X(i, ((LONGINT)(256)))]); + OPM_Write((*obj->conval->ext)[__X(i, 256)]); i += 1; } OPM_WriteLn(); @@ -814,34 +815,34 @@ void OPC_TDescDecl (OPT_Struct typ) LONGINT nofptrs; OPT_Object o = NIL; OPC_BegStat(); - OPM_WriteString((CHAR*)"__TDESC(", (LONGINT)9); + OPM_WriteString((CHAR*)"__TDESC(", 9); OPC_Andent(typ); - OPC_Str1((CHAR*)", #", (LONGINT)4, typ->n + 1); - OPC_Str1((CHAR*)", #) = {__TDFLDS(", (LONGINT)18, OPC_NofPtrs(typ)); + OPC_Str1((CHAR*)", #", 4, typ->n + 1); + OPC_Str1((CHAR*)", #) = {__TDFLDS(", 18, OPC_NofPtrs(typ)); OPM_Write('"'); if (typ->strobj != NIL) { - OPM_WriteStringVar((void*)typ->strobj->name, ((LONGINT)(256))); + OPM_WriteStringVar((void*)typ->strobj->name, 256); } OPM_Write('"'); - OPC_Str1((CHAR*)", #), {", (LONGINT)8, typ->size); + OPC_Str1((CHAR*)", #), {", 8, typ->size); nofptrs = 0; - OPC_PutPtrOffsets(typ, ((LONGINT)(0)), &nofptrs); - OPC_Str1((CHAR*)"#}}", (LONGINT)4, -((nofptrs + 1) * (int)OPM_LIntSize)); + OPC_PutPtrOffsets(typ, 0, &nofptrs); + OPC_Str1((CHAR*)"#}}", 4, -((nofptrs + 1) * OPM_LIntSize)); OPC_EndStat(); } void OPC_InitTDesc (OPT_Struct typ) { OPC_BegStat(); - OPM_WriteString((CHAR*)"__INITYP(", (LONGINT)10); + OPM_WriteString((CHAR*)"__INITYP(", 10); OPC_Andent(typ); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); if (typ->BaseTyp != NIL) { OPC_Andent(typ->BaseTyp); } else { OPC_Andent(typ); } - OPC_Str1((CHAR*)", #)", (LONGINT)5, typ->extlev); + OPC_Str1((CHAR*)", #)", 5, typ->extlev); OPC_EndStat(); if (typ->strobj != NIL) { OPC_InitTProcs(typ->strobj, typ->link); @@ -872,7 +873,7 @@ LONGINT OPC_SizeAlignment (LONGINT size) { LONGINT _o_result; LONGINT alignment; - if (size < (int)OPM_Alignment) { + if (size < OPM_Alignment) { alignment = 1; while (alignment < size) { alignment = __ASHL(alignment, 1); @@ -909,23 +910,23 @@ static void OPC_FillGap (LONGINT gap, LONGINT off, LONGINT align, LONGINT *n, LO if ((*curAlign < align && gap - (adr - off) >= align)) { gap -= (adr - off) + align; OPC_BegStat(); - if (align == (int)OPM_IntSize) { - OPM_WriteString((CHAR*)"INTEGER", (LONGINT)8); - } else if (align == (int)OPM_LIntSize) { - OPM_WriteString((CHAR*)"LONGINT", (LONGINT)8); - } else if (align == (int)OPM_LRealSize) { - OPM_WriteString((CHAR*)"LONGREAL", (LONGINT)9); + if (align == OPM_IntSize) { + OPM_WriteString((CHAR*)"INTEGER", 8); + } else if (align == OPM_LIntSize) { + OPM_WriteString((CHAR*)"LONGINT", 8); + } else if (align == OPM_LRealSize) { + OPM_WriteString((CHAR*)"LONGREAL", 9); } - OPC_Str1((CHAR*)" _prvt#", (LONGINT)8, *n); + OPC_Str1((CHAR*)" _prvt#", 8, *n); *n += 1; OPC_EndStat(); *curAlign = align; } if (gap > 0) { OPC_BegStat(); - OPC_Str1((CHAR*)"char _prvt#", (LONGINT)12, *n); + OPC_Str1((CHAR*)"char _prvt#", 12, *n); *n += 1; - OPC_Str1((CHAR*)"[#]", (LONGINT)4, gap); + OPC_Str1((CHAR*)"[#]", 4, gap); OPC_EndStat(); } } @@ -969,7 +970,7 @@ static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, LONGINT *off, LONGINT * base = fld->typ; fld = fld->link; while ((((((((fld != NIL && fld->mode == 4)) && fld->typ == base)) && fld->adr == *off)) && ((OPM_currFile == 1 || fld->vis != 0) || fld->typ->strobj == NIL))) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_DeclareObj(fld, 0); *off = fld->adr + fld->typ->size; fld = fld->link; @@ -978,7 +979,7 @@ static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, LONGINT *off, LONGINT * } } if (last) { - adr = typ->size - (int)__ASHR(typ->sysflag, 8); + adr = typ->size - __ASHR(typ->sysflag, 8); if (adr == 0) { gap = 1; } else { @@ -999,7 +1000,7 @@ static void OPC_IdentList (OPT_Object obj, INTEGER vis) first = 1; while ((obj != NIL && obj->mode != 13)) { if ((__IN(vis, 0x05) || (vis == 1 && obj->vis != 0)) || (vis == 3 && !obj->leaf)) { - if (obj->typ != base || (int)obj->vis != lastvis) { + if (obj->typ != base || obj->vis != lastvis) { if (!first) { OPC_EndStat(); } @@ -1008,16 +1009,16 @@ static void OPC_IdentList (OPT_Object obj, INTEGER vis) lastvis = obj->vis; OPC_BegStat(); if ((vis == 1 && obj->vis != 0)) { - OPM_WriteString((CHAR*)"import ", (LONGINT)8); + OPM_WriteString((CHAR*)"import ", 8); } else if ((obj->mnolev == 0 && vis == 0)) { if (obj->vis == 0) { - OPM_WriteString((CHAR*)"static ", (LONGINT)8); + OPM_WriteString((CHAR*)"static ", 8); } else { - OPM_WriteString((CHAR*)"export ", (LONGINT)8); + OPM_WriteString((CHAR*)"export ", 8); } } if ((((vis == 2 && obj->mode == 1)) && base->form == 7)) { - OPM_WriteString((CHAR*)"double", (LONGINT)7); + OPM_WriteString((CHAR*)"double", 7); } else { OPC_DeclareBase(obj); } @@ -1033,17 +1034,17 @@ static void OPC_IdentList (OPT_Object obj, INTEGER vis) OPC_EndStat(); OPC_BegStat(); base = OPT_linttyp; - OPM_WriteString((CHAR*)"LONGINT ", (LONGINT)9); + OPM_WriteString((CHAR*)"LONGINT ", 9); OPC_LenList(obj, 0, 1); } else if ((obj->mode == 2 && obj->typ->comp == 4)) { OPC_EndStat(); OPC_BegStat(); - OPM_WriteString((CHAR*)"LONGINT *", (LONGINT)10); + OPM_WriteString((CHAR*)"LONGINT *", 10); OPC_Ident(obj); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); base = NIL; } else if ((((((OPC_ptrinit && vis == 0)) && obj->mnolev > 0)) && obj->typ->form == 13)) { - OPM_WriteString((CHAR*)" = NIL", (LONGINT)7); + OPM_WriteString((CHAR*)" = NIL", 7); } } obj = obj->link; @@ -1058,7 +1059,7 @@ static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames) CHAR name[32]; OPM_Write('('); if (obj == NIL || obj->mode == 13) { - OPM_WriteString((CHAR*)"void", (LONGINT)5); + OPM_WriteString((CHAR*)"void", 5); } else { for (;;) { OPC_DeclareBase(obj); @@ -1066,25 +1067,25 @@ static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames) OPM_Write(' '); OPC_DeclareObj(obj, 0); } else { - __COPY(obj->name, name, ((LONGINT)(32))); + __COPY(obj->name, name, 32); obj->name[0] = 0x00; OPC_DeclareObj(obj, 0); - __COPY(name, obj->name, ((LONGINT)(256))); + __COPY(name, obj->name, 256); } if (obj->typ->comp == 3) { - OPM_WriteString((CHAR*)", LONGINT ", (LONGINT)11); + OPM_WriteString((CHAR*)", LONGINT ", 11); OPC_LenList(obj, 1, showParamNames); } else if ((obj->mode == 2 && obj->typ->comp == 4)) { - OPM_WriteString((CHAR*)", LONGINT *", (LONGINT)12); + OPM_WriteString((CHAR*)", LONGINT *", 12); if (showParamNames) { OPC_Ident(obj); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } } if (obj->link == NIL || obj->link->mode == 13) { break; } - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); obj = obj->link; } } @@ -1094,7 +1095,7 @@ static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames) static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define) { if (proc->typ == OPT_notyp) { - OPM_WriteString((CHAR*)"void", (LONGINT)5); + OPM_WriteString((CHAR*)"void", 5); } else { OPC_Ident(proc->typ->strobj); } @@ -1114,7 +1115,7 @@ static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define) OPC_IdentList(proc->link, 2); OPC_Indent(-1); } else { - OPM_WriteString((CHAR*)"();", (LONGINT)4); + OPM_WriteString((CHAR*)"();", 4); OPM_WriteLn(); } } @@ -1125,11 +1126,11 @@ static void OPC_ProcPredefs (OPT_Object obj, SHORTINT vis) OPC_ProcPredefs(obj->left, vis); if ((((__IN(obj->mode, 0xc0) && obj->vis >= vis)) && (obj->history != 4 || obj->mode == 6))) { if (vis == 1) { - OPM_WriteString((CHAR*)"import ", (LONGINT)8); + OPM_WriteString((CHAR*)"import ", 8); } else if (obj->vis == 0) { - OPM_WriteString((CHAR*)"static ", (LONGINT)8); + OPM_WriteString((CHAR*)"static ", 8); } else { - OPM_WriteString((CHAR*)"export ", (LONGINT)8); + OPM_WriteString((CHAR*)"export ", 8); } OPC_ProcHeader(obj, 0); } @@ -1140,10 +1141,10 @@ static void OPC_ProcPredefs (OPT_Object obj, SHORTINT vis) static void OPC_Include (CHAR *name, LONGINT name__len) { __DUP(name, name__len, CHAR); - OPM_WriteString((CHAR*)"#include ", (LONGINT)10); + OPM_WriteString((CHAR*)"#include ", 10); OPM_Write('"'); OPM_WriteStringVar((void*)name, name__len); - OPM_WriteString((CHAR*)".h", (LONGINT)3); + OPM_WriteString((CHAR*)".h", 3); OPM_Write('"'); OPM_WriteLn(); __DEL(name); @@ -1153,8 +1154,8 @@ static void OPC_IncludeImports (OPT_Object obj, INTEGER vis) { if (obj != NIL) { OPC_IncludeImports(obj->left, vis); - if ((((obj->mode == 11 && obj->mnolev != 0)) && (int)OPT_GlbMod[__X(-obj->mnolev, ((LONGINT)(64)))]->vis >= vis)) { - OPC_Include(OPT_GlbMod[__X(-obj->mnolev, ((LONGINT)(64)))]->name, ((LONGINT)(256))); + if ((((obj->mode == 11 && obj->mnolev != 0)) && OPT_GlbMod[__X(-obj->mnolev, 64)]->vis >= vis)) { + OPC_Include(OPT_GlbMod[__X(-obj->mnolev, 64)]->name, 256); } OPC_IncludeImports(obj->right, vis); } @@ -1168,15 +1169,15 @@ static void OPC_GenDynTypes (OPT_Node n, INTEGER vis) if (vis == 0 || typ->ref < 255) { OPC_BegStat(); if (vis == 1) { - OPM_WriteString((CHAR*)"import ", (LONGINT)8); + OPM_WriteString((CHAR*)"import ", 8); } else if ((typ->strobj != NIL && typ->strobj->mnolev > 0)) { - OPM_WriteString((CHAR*)"static ", (LONGINT)8); + OPM_WriteString((CHAR*)"static ", 8); } else { - OPM_WriteString((CHAR*)"export ", (LONGINT)8); + OPM_WriteString((CHAR*)"export ", 8); } - OPM_WriteString((CHAR*)"LONGINT *", (LONGINT)10); + OPM_WriteString((CHAR*)"LONGINT *", 10); OPC_Andent(typ); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); OPC_EndStat(); } n = n->link; @@ -1194,25 +1195,25 @@ void OPC_GenHdr (OPT_Node n) OPC_GenDynTypes(n, 1); OPM_WriteLn(); OPC_ProcPredefs(OPT_topScope->right, 1); - OPM_WriteString((CHAR*)"import ", (LONGINT)8); - OPM_WriteString((CHAR*)"void *", (LONGINT)7); - OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); - OPM_WriteString(OPC_BodyNameExt, ((LONGINT)(13))); + OPM_WriteString((CHAR*)"import ", 8); + OPM_WriteString((CHAR*)"void *", 7); + OPM_WriteStringVar((void*)OPM_modName, 32); + OPM_WriteString(OPC_BodyNameExt, 13); OPC_EndStat(); OPM_WriteLn(); OPC_CProcDefs(OPT_topScope->right, 1); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#endif", (LONGINT)7); + OPM_WriteString((CHAR*)"#endif", 7); OPM_WriteLn(); } static void OPC_GenHeaderMsg (void) { INTEGER i; - OPM_WriteString((CHAR*)"/* ", (LONGINT)4); - OPM_WriteString((CHAR*)"voc", (LONGINT)4); + OPM_WriteString((CHAR*)"/* ", 4); + OPM_WriteString((CHAR*)"voc", 4); OPM_Write(' '); - OPM_WriteString(Configuration_versionLong, ((LONGINT)(41))); + OPM_WriteString(Configuration_versionLong, 41); OPM_Write(' '); i = 0; while (i <= 31) { @@ -1264,14 +1265,14 @@ static void OPC_GenHeaderMsg (void) OPM_Write('v'); break; default: - OPM_LogWStr((CHAR*)"( more options defined in OPM than checked in OPC.GenHeaderMsg, if you are a compiler developer, add them to OPC.GenHeaderMsg", (LONGINT)126); + OPM_LogWStr((CHAR*)"( more options defined in OPM than checked in OPC.GenHeaderMsg, if you are a compiler developer, add them to OPC.GenHeaderMsg", 126); OPM_LogWLn(); break; } } i += 1; } - OPM_WriteString((CHAR*)" */", (LONGINT)4); + OPM_WriteString((CHAR*)" */", 4); OPM_WriteLn(); } @@ -1280,20 +1281,20 @@ void OPC_GenHdrIncludes (void) OPM_currFile = 2; OPC_GenHeaderMsg(); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#ifndef ", (LONGINT)9); - OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); - OPM_WriteString((CHAR*)"__h", (LONGINT)4); + OPM_WriteString((CHAR*)"#ifndef ", 9); + OPM_WriteStringVar((void*)OPM_modName, 32); + OPM_WriteString((CHAR*)"__h", 4); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#define ", (LONGINT)9); - OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); - OPM_WriteString((CHAR*)"__h", (LONGINT)4); + OPM_WriteString((CHAR*)"#define ", 9); + OPM_WriteStringVar((void*)OPM_modName, 32); + OPM_WriteString((CHAR*)"__h", 4); OPM_WriteLn(); OPM_WriteLn(); if (OPM_LIntSize == 8) { - OPM_WriteString((CHAR*)"#define LARGE", (LONGINT)14); + OPM_WriteString((CHAR*)"#define LARGE", 14); OPM_WriteLn(); } - OPC_Include((CHAR*)"SYSTEM", (LONGINT)7); + OPC_Include((CHAR*)"SYSTEM", 7); OPC_IncludeImports(OPT_topScope->right, 1); OPM_WriteLn(); } @@ -1303,10 +1304,10 @@ void OPC_GenBdy (OPT_Node n) OPM_currFile = 1; OPC_GenHeaderMsg(); if (OPM_LIntSize == 8) { - OPM_WriteString((CHAR*)"#define LARGE", (LONGINT)14); + OPM_WriteString((CHAR*)"#define LARGE", 14); OPM_WriteLn(); } - OPC_Include((CHAR*)"SYSTEM", (LONGINT)7); + OPC_Include((CHAR*)"SYSTEM", 7); OPC_IncludeImports(OPT_topScope->right, 0); OPM_WriteLn(); OPC_DefAnonRecs(n); @@ -1329,9 +1330,9 @@ static void OPC_RegCmds (OPT_Object obj) if ((obj->mode == 7 && obj->history != 4)) { if ((((obj->vis != 0 && obj->link == NIL)) && obj->typ == OPT_notyp)) { OPC_BegStat(); - OPM_WriteString((CHAR*)"__REGCMD(\"", (LONGINT)11); - OPM_WriteStringVar((void*)obj->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"\", ", (LONGINT)4); + OPM_WriteString((CHAR*)"__REGCMD(\"", 11); + OPM_WriteStringVar((void*)obj->name, 256); + OPM_WriteString((CHAR*)"\", ", 4); OPC_Ident(obj); OPM_Write(')'); OPC_EndStat(); @@ -1347,8 +1348,8 @@ static void OPC_InitImports (OPT_Object obj) OPC_InitImports(obj->left); if ((obj->mode == 11 && obj->mnolev != 0)) { OPC_BegStat(); - OPM_WriteString((CHAR*)"__MODULE_IMPORT(", (LONGINT)17); - OPM_WriteStringVar((void*)OPT_GlbMod[__X(-obj->mnolev, ((LONGINT)(64)))]->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"__MODULE_IMPORT(", 17); + OPM_WriteStringVar((void*)OPT_GlbMod[__X(-obj->mnolev, 64)]->name, 256); OPM_Write(')'); OPC_EndStat(); } @@ -1366,31 +1367,31 @@ void OPC_GenEnumPtrs (OPT_Object var) if (OPC_NofPtrs(typ) > 0) { if (!OPC_GlbPtrs) { OPC_GlbPtrs = 1; - OPM_WriteString((CHAR*)"static ", (LONGINT)8); + OPM_WriteString((CHAR*)"static ", 8); if (OPC_ansi) { - OPM_WriteString((CHAR*)"void EnumPtrs(void (*P)(void*))", (LONGINT)32); + OPM_WriteString((CHAR*)"void EnumPtrs(void (*P)(void*))", 32); } else { - OPM_WriteString((CHAR*)"void EnumPtrs(P)", (LONGINT)17); + OPM_WriteString((CHAR*)"void EnumPtrs(P)", 17); OPM_WriteLn(); OPM_Write(0x09); - OPM_WriteString((CHAR*)"void (*P)();", (LONGINT)13); + OPM_WriteString((CHAR*)"void (*P)();", 13); } OPM_WriteLn(); OPC_BegBlk(); } OPC_BegStat(); if (typ->form == 13) { - OPM_WriteString((CHAR*)"P(", (LONGINT)3); + OPM_WriteString((CHAR*)"P(", 3); OPC_Ident(var); OPM_Write(')'); } else if (typ->comp == 4) { - OPM_WriteString((CHAR*)"__ENUMR(&", (LONGINT)10); + OPM_WriteString((CHAR*)"__ENUMR(&", 10); OPC_Ident(var); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Andent(typ); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); - OPC_Str1((CHAR*)", #", (LONGINT)4, typ->size); - OPM_WriteString((CHAR*)", 1, P)", (LONGINT)8); + OPM_WriteString((CHAR*)"__typ", 6); + OPC_Str1((CHAR*)", #", 4, typ->size); + OPM_WriteString((CHAR*)", 1, P)", 8); } else if (typ->comp == 2) { n = typ->n; typ = typ->BaseTyp; @@ -1399,17 +1400,17 @@ void OPC_GenEnumPtrs (OPT_Object var) typ = typ->BaseTyp; } if (typ->form == 13) { - OPM_WriteString((CHAR*)"__ENUMP(", (LONGINT)9); + OPM_WriteString((CHAR*)"__ENUMP(", 9); OPC_Ident(var); - OPC_Str1((CHAR*)", #, P)", (LONGINT)8, n); + OPC_Str1((CHAR*)", #, P)", 8, n); } else if (typ->comp == 4) { - OPM_WriteString((CHAR*)"__ENUMR(", (LONGINT)9); + OPM_WriteString((CHAR*)"__ENUMR(", 9); OPC_Ident(var); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Andent(typ); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); - OPC_Str1((CHAR*)", #", (LONGINT)4, typ->size); - OPC_Str1((CHAR*)", #, P)", (LONGINT)8, n); + OPM_WriteString((CHAR*)"__typ", 6); + OPC_Str1((CHAR*)", #", 4, typ->size); + OPC_Str1((CHAR*)", #, P)", 8, n); } } OPC_EndStat(); @@ -1425,49 +1426,49 @@ void OPC_GenEnumPtrs (OPT_Object var) void OPC_EnterBody (void) { OPM_WriteLn(); - OPM_WriteString((CHAR*)"export ", (LONGINT)8); + OPM_WriteString((CHAR*)"export ", 8); if (OPC_mainprog) { if (OPC_ansi) { - OPM_WriteString((CHAR*)"int main(int argc, char **argv)", (LONGINT)32); + OPM_WriteString((CHAR*)"int main(int argc, char **argv)", 32); OPM_WriteLn(); } else { - OPM_WriteString((CHAR*)"main(argc, argv)", (LONGINT)17); + OPM_WriteString((CHAR*)"main(argc, argv)", 17); OPM_WriteLn(); OPM_Write(0x09); - OPM_WriteString((CHAR*)"int argc; char **argv;", (LONGINT)23); + OPM_WriteString((CHAR*)"int argc; char **argv;", 23); OPM_WriteLn(); } } else { - OPM_WriteString((CHAR*)"void *", (LONGINT)7); - OPM_WriteString(OPM_modName, ((LONGINT)(32))); - OPM_WriteString(OPC_BodyNameExt, ((LONGINT)(13))); + OPM_WriteString((CHAR*)"void *", 7); + OPM_WriteString(OPM_modName, 32); + OPM_WriteString(OPC_BodyNameExt, 13); OPM_WriteLn(); } OPC_BegBlk(); OPC_BegStat(); if (OPC_mainprog) { - OPM_WriteString((CHAR*)"__INIT(argc, argv)", (LONGINT)19); + OPM_WriteString((CHAR*)"__INIT(argc, argv)", 19); } else { - OPM_WriteString((CHAR*)"__DEFMOD", (LONGINT)9); + OPM_WriteString((CHAR*)"__DEFMOD", 9); } OPC_EndStat(); if ((OPC_mainprog && 0)) { OPC_BegStat(); - OPM_WriteString((CHAR*)"/*don`t do it!*/ printf(\"DEMO VERSION: DO NOT USE THIS PROGRAM FOR ANY COMMERCIAL PURPOSE\\n\")", (LONGINT)94); + OPM_WriteString((CHAR*)"/*don`t do it!*/ printf(\"DEMO VERSION: DO NOT USE THIS PROGRAM FOR ANY COMMERCIAL PURPOSE\\n\")", 94); OPC_EndStat(); } OPC_InitImports(OPT_topScope->right); OPC_BegStat(); if (OPC_mainprog) { - OPM_WriteString((CHAR*)"__REGMAIN(\"", (LONGINT)12); + OPM_WriteString((CHAR*)"__REGMAIN(\"", 12); } else { - OPM_WriteString((CHAR*)"__REGMOD(\"", (LONGINT)11); + OPM_WriteString((CHAR*)"__REGMOD(\"", 11); } - OPM_WriteString(OPM_modName, ((LONGINT)(32))); + OPM_WriteString(OPM_modName, 32); if (OPC_GlbPtrs) { - OPM_WriteString((CHAR*)"\", EnumPtrs)", (LONGINT)13); + OPM_WriteString((CHAR*)"\", EnumPtrs)", 13); } else { - OPM_WriteString((CHAR*)"\", 0)", (LONGINT)6); + OPM_WriteString((CHAR*)"\", 0)", 6); } OPC_EndStat(); if (__STRCMP(OPM_modName, "SYSTEM") != 0) { @@ -1479,9 +1480,9 @@ void OPC_ExitBody (void) { OPC_BegStat(); if (OPC_mainprog) { - OPM_WriteString((CHAR*)"__FINI;", (LONGINT)8); + OPM_WriteString((CHAR*)"__FINI;", 8); } else { - OPM_WriteString((CHAR*)"__ENDMOD;", (LONGINT)10); + OPM_WriteString((CHAR*)"__ENDMOD;", 10); } OPM_WriteLn(); OPC_EndBlk(); @@ -1491,25 +1492,25 @@ void OPC_DefineInter (OPT_Object proc) { OPT_Object scope = NIL; scope = proc->scope; - OPM_WriteString((CHAR*)"static ", (LONGINT)8); - OPM_WriteString((CHAR*)"struct ", (LONGINT)8); - OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"static ", 8); + OPM_WriteString((CHAR*)"struct ", 8); + OPM_WriteStringVar((void*)scope->name, 256); OPM_Write(' '); OPC_BegBlk(); OPC_IdentList(proc->link, 3); OPC_IdentList(scope->scope, 3); OPC_BegStat(); - OPM_WriteString((CHAR*)"struct ", (LONGINT)8); - OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"struct ", 8); + OPM_WriteStringVar((void*)scope->name, 256); OPM_Write(' '); OPM_Write('*'); - OPM_WriteString((CHAR*)"lnk", (LONGINT)4); + OPM_WriteString((CHAR*)"lnk", 4); OPC_EndStat(); OPC_EndBlk0(); OPM_Write(' '); OPM_Write('*'); - OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteStringVar((void*)scope->name, 256); + OPM_WriteString((CHAR*)"_s", 3); OPC_EndStat(); OPM_WriteLn(); OPC_ProcPredefs(scope->right, 0); @@ -1522,24 +1523,24 @@ void OPC_EnterProc (OPT_Object proc) OPT_Struct typ = NIL; INTEGER dim; if (proc->vis != 1) { - OPM_WriteString((CHAR*)"static ", (LONGINT)8); + OPM_WriteString((CHAR*)"static ", 8); } OPC_ProcHeader(proc, 1); OPC_BegBlk(); if (proc->typ != OPT_notyp) { OPC_BegStat(); OPC_Ident(proc->typ->strobj); - OPM_WriteString((CHAR*)" _o_result;", (LONGINT)12); + OPM_WriteString((CHAR*)" _o_result;", 12); OPM_WriteLn(); } scope = proc->scope; OPC_IdentList(scope->scope, 0); if (!scope->leaf) { OPC_BegStat(); - OPM_WriteString((CHAR*)"struct ", (LONGINT)8); - OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"struct ", 8); + OPM_WriteStringVar((void*)scope->name, 256); OPM_Write(' '); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"_s", 3); OPC_EndStat(); } var = proc->link; @@ -1553,7 +1554,7 @@ void OPC_EnterProc (OPT_Object proc) } OPM_Write(' '); OPC_Ident(var); - OPM_WriteString((CHAR*)"__copy", (LONGINT)7); + OPM_WriteString((CHAR*)"__copy", 7); OPC_EndStat(); } var = var->link; @@ -1566,7 +1567,7 @@ void OPC_EnterProc (OPT_Object proc) OPC_Ident(var->typ->strobj); OPM_Write(' '); OPC_Ident(var); - OPM_WriteString((CHAR*)" = _", (LONGINT)5); + OPM_WriteString((CHAR*)" = _", 5); OPC_Ident(var); OPC_EndStat(); } @@ -1578,31 +1579,31 @@ void OPC_EnterProc (OPT_Object proc) if ((((__IN(var->typ->comp, 0x0c) && var->mode == 1)) && var->typ->sysflag == 0)) { OPC_BegStat(); if (var->typ->comp == 2) { - OPM_WriteString((CHAR*)"__DUPARR(", (LONGINT)10); + OPM_WriteString((CHAR*)"__DUPARR(", 10); OPC_Ident(var); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); if (var->typ->strobj == NIL) { OPM_Mark(200, var->typ->txtpos); } else { OPC_Ident(var->typ->strobj); } } else { - OPM_WriteString((CHAR*)"__DUP(", (LONGINT)7); + OPM_WriteString((CHAR*)"__DUP(", 7); OPC_Ident(var); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Ident(var); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); typ = var->typ->BaseTyp; dim = 1; while (typ->comp == 3) { - OPM_WriteString((CHAR*)" * ", (LONGINT)4); + OPM_WriteString((CHAR*)" * ", 4); OPC_Ident(var); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); OPM_WriteInt(dim); typ = typ->BaseTyp; dim += 1; } - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); if (typ->strobj == NIL) { OPM_Mark(200, typ->txtpos); } else { @@ -1619,12 +1620,12 @@ void OPC_EnterProc (OPT_Object proc) while (var != NIL) { if (!var->leaf) { OPC_BegStat(); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"_s", 3); OPM_Write('.'); OPC_Ident(var); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteString((CHAR*)" = ", 4); if (__IN(var->typ->comp, 0x0c)) { - OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(void*)", 8); } else if (var->mode != 2) { OPM_Write('&'); } @@ -1633,31 +1634,31 @@ void OPC_EnterProc (OPT_Object proc) typ = var->typ; dim = 0; do { - OPM_WriteString((CHAR*)"; ", (LONGINT)3); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"; ", 3); + OPM_WriteString((CHAR*)"_s", 3); OPM_Write('.'); OPC_Ident(var); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); if (dim != 0) { OPM_WriteInt(dim); } - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteString((CHAR*)" = ", 4); OPC_Ident(var); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); if (dim != 0) { OPM_WriteInt(dim); } typ = typ->BaseTyp; } while (!(typ->comp != 3)); } else if ((var->mode == 2 && var->typ->comp == 4)) { - OPM_WriteString((CHAR*)"; ", (LONGINT)3); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"; ", 3); + OPM_WriteString((CHAR*)"_s", 3); OPM_Write('.'); OPC_Ident(var); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteString((CHAR*)"__typ", 6); + OPM_WriteString((CHAR*)" = ", 4); OPC_Ident(var); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } OPC_EndStat(); } @@ -1667,14 +1668,14 @@ void OPC_EnterProc (OPT_Object proc) while (var != NIL) { if (!var->leaf) { OPC_BegStat(); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"_s", 3); OPM_Write('.'); OPC_Ident(var); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteString((CHAR*)" = ", 4); if (var->typ->comp != 2) { OPM_Write('&'); } else { - OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(void*)", 8); } OPC_Ident(var); OPC_EndStat(); @@ -1682,19 +1683,19 @@ void OPC_EnterProc (OPT_Object proc) var = var->link; } OPC_BegStat(); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"_s", 3); OPM_Write('.'); - OPM_WriteString((CHAR*)"lnk", (LONGINT)4); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); - OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"lnk", 4); + OPM_WriteString((CHAR*)" = ", 4); + OPM_WriteStringVar((void*)scope->name, 256); + OPM_WriteString((CHAR*)"_s", 3); OPC_EndStat(); OPC_BegStat(); - OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteStringVar((void*)scope->name, 256); + OPM_WriteString((CHAR*)"_s", 3); + OPM_WriteString((CHAR*)" = ", 4); OPM_Write('&'); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"_s", 3); OPC_EndStat(); } } @@ -1706,7 +1707,7 @@ void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet) indent = eoBlock; if ((implicitRet && proc->typ != OPT_notyp)) { OPM_Write(0x09); - OPM_WriteString((CHAR*)"__RETCHK;", (LONGINT)10); + OPM_WriteString((CHAR*)"__RETCHK;", 10); OPM_WriteLn(); } else if (!eoBlock || implicitRet) { if (!proc->scope->leaf) { @@ -1715,12 +1716,12 @@ void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet) } else { indent = 1; } - OPM_WriteStringVar((void*)proc->scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteStringVar((void*)proc->scope->name, 256); + OPM_WriteString((CHAR*)"_s", 3); + OPM_WriteString((CHAR*)" = ", 4); + OPM_WriteString((CHAR*)"_s", 3); OPM_Write('.'); - OPM_WriteString((CHAR*)"lnk", (LONGINT)4); + OPM_WriteString((CHAR*)"lnk", 4); OPC_EndStat(); } var = proc->link; @@ -1731,7 +1732,7 @@ void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet) } else { indent = 1; } - OPM_WriteString((CHAR*)"__DEL(", (LONGINT)7); + OPM_WriteString((CHAR*)"__DEL(", 7); OPC_Ident(var); OPM_Write(')'); OPC_EndStat(); @@ -1754,9 +1755,9 @@ void OPC_CompleteIdent (OPT_Object obj) if (obj->adr == 1) { if (obj->typ->comp == 4) { OPC_Ident(obj); - OPM_WriteString((CHAR*)"__", (LONGINT)3); + OPM_WriteString((CHAR*)"__", 3); } else { - OPM_WriteString((CHAR*)"((", (LONGINT)3); + OPM_WriteString((CHAR*)"((", 3); OPC_Ident(obj->typ->strobj); OPM_Write(')'); OPC_Ident(obj); @@ -1767,9 +1768,9 @@ void OPC_CompleteIdent (OPT_Object obj) if ((obj->mode != 2 && comp != 3)) { OPM_Write('*'); } - OPM_WriteStringVar((void*)obj->scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); - OPM_WriteString((CHAR*)"->", (LONGINT)3); + OPM_WriteStringVar((void*)obj->scope->name, 256); + OPM_WriteString((CHAR*)"_s", 3); + OPM_WriteString((CHAR*)"->", 3); OPC_Ident(obj); } else { OPC_Ident(obj); @@ -1781,17 +1782,17 @@ void OPC_TypeOf (OPT_Object ap) INTEGER i; __ASSERT(ap->typ->comp == 4, 0); if (ap->mode == 2) { - if ((int)ap->mnolev != OPM_level) { - OPM_WriteStringVar((void*)ap->scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"_s->", (LONGINT)5); + if (ap->mnolev != OPM_level) { + OPM_WriteStringVar((void*)ap->scope->name, 256); + OPM_WriteString((CHAR*)"_s->", 5); OPC_Ident(ap); } else { OPC_Ident(ap); } - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } else if (ap->typ->strobj != NIL) { OPC_Ident(ap->typ->strobj); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } else { OPC_Andent(ap->typ); } @@ -1801,26 +1802,26 @@ void OPC_Cmp (INTEGER rel) { switch (rel) { case 9: - OPM_WriteString((CHAR*)" == ", (LONGINT)5); + OPM_WriteString((CHAR*)" == ", 5); break; case 10: - OPM_WriteString((CHAR*)" != ", (LONGINT)5); + OPM_WriteString((CHAR*)" != ", 5); break; case 11: - OPM_WriteString((CHAR*)" < ", (LONGINT)4); + OPM_WriteString((CHAR*)" < ", 4); break; case 12: - OPM_WriteString((CHAR*)" <= ", (LONGINT)5); + OPM_WriteString((CHAR*)" <= ", 5); break; case 13: - OPM_WriteString((CHAR*)" > ", (LONGINT)4); + OPM_WriteString((CHAR*)" > ", 4); break; case 14: - OPM_WriteString((CHAR*)" >= ", (LONGINT)5); + OPM_WriteString((CHAR*)" >= ", 5); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPC.Cmp, rel = ", (LONGINT)34); - OPM_LogWNum(rel, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPC.Cmp, rel = ", 34); + OPM_LogWNum(rel, 0); OPM_LogWLn(); break; } @@ -1829,7 +1830,7 @@ void OPC_Cmp (INTEGER rel) static void OPC_CharacterLiteral (LONGINT c) { if (c < 32 || c > 126) { - OPM_WriteString((CHAR*)"0x", (LONGINT)3); + OPM_WriteString((CHAR*)"0x", 3); OPM_WriteHex(c); } else { OPM_Write('\''); @@ -1849,7 +1850,7 @@ static void OPC_StringLiteral (CHAR *s, LONGINT s__len, LONGINT l) OPM_Write('"'); i = 0; while (i < l) { - c = (int)s[__X(i, s__len)]; + c = s[__X(i, s__len)]; if (c < 32 || c > 126) { OPM_Write('\\'); OPM_Write((CHAR)(48 + __ASHR(c, 6))); @@ -1872,7 +1873,7 @@ static void OPC_StringLiteral (CHAR *s, LONGINT s__len, LONGINT l) void OPC_Case (LONGINT caseVal, INTEGER form) { CHAR ch; - OPM_WriteString((CHAR*)"case ", (LONGINT)6); + OPM_WriteString((CHAR*)"case ", 6); switch (form) { case 3: OPC_CharacterLiteral(caseVal); @@ -1881,42 +1882,68 @@ void OPC_Case (LONGINT caseVal, INTEGER form) OPM_WriteInt(caseVal); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPC.Case, form = ", (LONGINT)36); - OPM_LogWNum(form, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPC.Case, form = ", 36); + OPM_LogWNum(form, 0); OPM_LogWLn(); break; } - OPM_WriteString((CHAR*)": ", (LONGINT)3); + OPM_WriteString((CHAR*)": ", 3); } void OPC_SetInclude (BOOLEAN exclude) { if (exclude) { - OPM_WriteString((CHAR*)" &= ~", (LONGINT)6); + OPM_WriteString((CHAR*)" &= ~", 6); } else { - OPM_WriteString((CHAR*)" |= ", (LONGINT)5); + OPM_WriteString((CHAR*)" |= ", 5); } } void OPC_Increment (BOOLEAN decrement) { if (decrement) { - OPM_WriteString((CHAR*)" -= ", (LONGINT)5); + OPM_WriteString((CHAR*)" -= ", 5); } else { - OPM_WriteString((CHAR*)" += ", (LONGINT)5); + OPM_WriteString((CHAR*)" += ", 5); } } void OPC_Halt (LONGINT n) { - OPC_Str1((CHAR*)"__HALT(#)", (LONGINT)10, n); + OPC_Str1((CHAR*)"__HALT(#)", 10, n); +} + +void OPC_IntLiteral (LONGINT n, LONGINT size) +{ + if ((((size > 4 && n <= 2147483647)) && n > (-2147483647-1))) { + switch (size) { + case 2: + OPM_WriteString((CHAR*)"((SYSTEM_INT16)(", 17); + break; + case 4: + OPM_WriteString((CHAR*)"((SYSTEM_INT32)(", 17); + break; + case 8: + OPM_WriteString((CHAR*)"((SYSTEM_INT64)(", 17); + break; + default: + OPM_LogWStr((CHAR*)"Unhandled case in OPC.IntLiteral, size = ", 42); + OPM_LogWNum(size, 1); + OPM_LogWLn(); + break; + } + OPM_WriteInt(n); + OPM_WriteString((CHAR*)"))", 3); + } else { + OPM_WriteInt(n); + } } void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim) { if (array->comp == 3) { OPC_CompleteIdent(obj); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); if (dim != 0) { OPM_WriteInt(dim); } @@ -1925,9 +1952,11 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim) array = array->BaseTyp; dim -= 1; } - OPM_WriteString((CHAR*)"((LONGINT)(", (LONGINT)12); - OPM_WriteInt(array->n); - OPM_WriteString((CHAR*)"))", (LONGINT)3); + if (OPC_ansi) { + OPM_WriteInt(array->n); + } else { + OPC_IntLiteral(array->n, OPM_PointerSize); + } } } @@ -1957,7 +1986,7 @@ void OPC_Constant (OPT_Const con, INTEGER form) OPM_WriteReal(con->realval, 0x00); break; case 9: - OPM_WriteString((CHAR*)"0x", (LONGINT)3); + OPM_WriteString((CHAR*)"0x", 3); skipLeading = 1; s = con->setval; i = 32; @@ -1980,14 +2009,14 @@ void OPC_Constant (OPT_Const con, INTEGER form) } break; case 10: - OPC_StringLiteral(*con->ext, ((LONGINT)(256)), con->intval2 - 1); + OPC_StringLiteral(*con->ext, 256, con->intval2 - 1); break; case 11: - OPM_WriteString((CHAR*)"NIL", (LONGINT)4); + OPM_WriteString((CHAR*)"NIL", 4); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPC.Constant, form = ", (LONGINT)40); - OPM_LogWNum(form, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPC.Constant, form = ", 40); + OPM_LogWNum(form, 0); OPM_LogWLn(); break; } @@ -2005,8 +2034,8 @@ static void Enter__49 (CHAR *s, LONGINT s__len) INTEGER h; __DUP(s, s__len, CHAR); h = OPC_PerfectHash((void*)s, s__len); - OPC_hashtab[__X(h, ((LONGINT)(105)))] = *InitKeywords__48_s->n; - __COPY(s, OPC_keytab[__X(*InitKeywords__48_s->n, ((LONGINT)(36)))], ((LONGINT)(9))); + OPC_hashtab[__X(h, 105)] = *InitKeywords__48_s->n; + __COPY(s, OPC_keytab[__X(*InitKeywords__48_s->n, 36)], 9); *InitKeywords__48_s->n += 1; __DEL(s); } @@ -2021,45 +2050,45 @@ static void OPC_InitKeywords (void) n = 0; i = 0; while (i <= 104) { - OPC_hashtab[__X(i, ((LONGINT)(105)))] = -1; + OPC_hashtab[__X(i, 105)] = -1; i += 1; } - Enter__49((CHAR*)"asm", (LONGINT)4); - Enter__49((CHAR*)"auto", (LONGINT)5); - Enter__49((CHAR*)"break", (LONGINT)6); - Enter__49((CHAR*)"case", (LONGINT)5); - Enter__49((CHAR*)"char", (LONGINT)5); - Enter__49((CHAR*)"const", (LONGINT)6); - Enter__49((CHAR*)"continue", (LONGINT)9); - Enter__49((CHAR*)"default", (LONGINT)8); - Enter__49((CHAR*)"do", (LONGINT)3); - Enter__49((CHAR*)"double", (LONGINT)7); - Enter__49((CHAR*)"else", (LONGINT)5); - Enter__49((CHAR*)"enum", (LONGINT)5); - Enter__49((CHAR*)"extern", (LONGINT)7); - Enter__49((CHAR*)"export", (LONGINT)7); - Enter__49((CHAR*)"float", (LONGINT)6); - Enter__49((CHAR*)"for", (LONGINT)4); - Enter__49((CHAR*)"fortran", (LONGINT)8); - Enter__49((CHAR*)"goto", (LONGINT)5); - Enter__49((CHAR*)"if", (LONGINT)3); - Enter__49((CHAR*)"import", (LONGINT)7); - Enter__49((CHAR*)"int", (LONGINT)4); - Enter__49((CHAR*)"long", (LONGINT)5); - Enter__49((CHAR*)"register", (LONGINT)9); - Enter__49((CHAR*)"return", (LONGINT)7); - Enter__49((CHAR*)"short", (LONGINT)6); - Enter__49((CHAR*)"signed", (LONGINT)7); - Enter__49((CHAR*)"sizeof", (LONGINT)7); - Enter__49((CHAR*)"static", (LONGINT)7); - Enter__49((CHAR*)"struct", (LONGINT)7); - Enter__49((CHAR*)"switch", (LONGINT)7); - Enter__49((CHAR*)"typedef", (LONGINT)8); - Enter__49((CHAR*)"union", (LONGINT)6); - Enter__49((CHAR*)"unsigned", (LONGINT)9); - Enter__49((CHAR*)"void", (LONGINT)5); - Enter__49((CHAR*)"volatile", (LONGINT)9); - Enter__49((CHAR*)"while", (LONGINT)6); + Enter__49((CHAR*)"asm", 4); + Enter__49((CHAR*)"auto", 5); + Enter__49((CHAR*)"break", 6); + Enter__49((CHAR*)"case", 5); + Enter__49((CHAR*)"char", 5); + Enter__49((CHAR*)"const", 6); + Enter__49((CHAR*)"continue", 9); + Enter__49((CHAR*)"default", 8); + Enter__49((CHAR*)"do", 3); + Enter__49((CHAR*)"double", 7); + Enter__49((CHAR*)"else", 5); + Enter__49((CHAR*)"enum", 5); + Enter__49((CHAR*)"extern", 7); + Enter__49((CHAR*)"export", 7); + Enter__49((CHAR*)"float", 6); + Enter__49((CHAR*)"for", 4); + Enter__49((CHAR*)"fortran", 8); + Enter__49((CHAR*)"goto", 5); + Enter__49((CHAR*)"if", 3); + Enter__49((CHAR*)"import", 7); + Enter__49((CHAR*)"int", 4); + Enter__49((CHAR*)"long", 5); + Enter__49((CHAR*)"register", 9); + Enter__49((CHAR*)"return", 7); + Enter__49((CHAR*)"short", 6); + Enter__49((CHAR*)"signed", 7); + Enter__49((CHAR*)"sizeof", 7); + Enter__49((CHAR*)"static", 7); + Enter__49((CHAR*)"struct", 7); + Enter__49((CHAR*)"switch", 7); + Enter__49((CHAR*)"typedef", 8); + Enter__49((CHAR*)"union", 6); + Enter__49((CHAR*)"unsigned", 9); + Enter__49((CHAR*)"void", 5); + Enter__49((CHAR*)"volatile", 9); + Enter__49((CHAR*)"while", 6); InitKeywords__48_s = _s.lnk; } diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index dcd53d63..4243328e 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h @@ -37,6 +37,7 @@ import void OPC_Increment (BOOLEAN decrement); import void OPC_Indent (INTEGER count); import void OPC_Init (void); import void OPC_InitTDesc (OPT_Struct typ); +import void OPC_IntLiteral (LONGINT n, LONGINT size); import void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim); import LONGINT OPC_NofPtrs (OPT_Struct typ); import void OPC_SetInclude (BOOLEAN exclude); diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 65ebb8b0..c3bece55 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" @@ -154,20 +154,20 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) case 'B': if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_IntSize = (int)s[__X(i, s__len)] - 48; + OPM_IntSize = s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_PointerSize = (int)s[__X(i, s__len)] - 48; + OPM_PointerSize = s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_Alignment = (int)s[__X(i, s__len)] - 48; + OPM_Alignment = s[__X(i, s__len)] - 48; } __ASSERT(OPM_IntSize == 2 || OPM_IntSize == 4, 0); __ASSERT(OPM_PointerSize == 4 || OPM_PointerSize == 8, 0); __ASSERT(OPM_Alignment == 4 || OPM_Alignment == 8, 0); - Files_SetSearchPath((CHAR*)"", (LONGINT)1); + Files_SetSearchPath((CHAR*)"", 1); break; case 'F': *opt = *opt ^ 0x020000; @@ -182,10 +182,10 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) *opt = *opt ^ 0x040000; break; default: - OPM_LogWStr((CHAR*)" warning: option ", (LONGINT)19); + OPM_LogWStr((CHAR*)" warning: option ", 19); OPM_LogW('-'); OPM_LogW(s[__X(i, s__len)]); - OPM_LogWStr((CHAR*)" ignored", (LONGINT)9); + OPM_LogWStr((CHAR*)" ignored", 9); OPM_LogWLn(); break; } @@ -199,71 +199,71 @@ BOOLEAN OPM_OpenPar (void) CHAR s[256]; if (Platform_ArgCount == 1) { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Vishap Oberon-2 compiler v", (LONGINT)27); - OPM_LogWStr(Configuration_versionLong, ((LONGINT)(41))); + OPM_LogWStr((CHAR*)"Vishap Oberon-2 compiler v", 27); + OPM_LogWStr(Configuration_versionLong, 41); OPM_LogW('.'); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Based on Ofront by Software Templ OEG, continued by Norayr Chilingarian and others.", (LONGINT)84); + OPM_LogWStr((CHAR*)"Based on Ofront by Software Templ OEG, continued by Norayr Chilingarian and others.", 84); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Usage:", (LONGINT)7); + OPM_LogWStr((CHAR*)"Usage:", 7); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" ", (LONGINT)3); - OPM_LogWStr((CHAR*)"voc", (LONGINT)4); - OPM_LogWStr((CHAR*)" options {files {options}}.", (LONGINT)28); + OPM_LogWStr((CHAR*)" ", 3); + OPM_LogWStr((CHAR*)"voc", 4); + OPM_LogWStr((CHAR*)" options {files {options}}.", 28); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Where options = [\"-\" {option} ].", (LONGINT)33); + OPM_LogWStr((CHAR*)"Where options = [\"-\" {option} ].", 33); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" m - generate code for main module", (LONGINT)36); + OPM_LogWStr((CHAR*)" m - generate code for main module", 36); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" M - generate code for main module and link object statically", (LONGINT)63); + OPM_LogWStr((CHAR*)" M - generate code for main module and link object statically", 63); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" s - generate new symbol file", (LONGINT)31); + OPM_LogWStr((CHAR*)" s - generate new symbol file", 31); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" e - allow extending the module interface", (LONGINT)43); + OPM_LogWStr((CHAR*)" e - allow extending the module interface", 43); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" r - check value ranges", (LONGINT)25); + OPM_LogWStr((CHAR*)" r - check value ranges", 25); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" x - turn off array indices check", (LONGINT)35); + OPM_LogWStr((CHAR*)" x - turn off array indices check", 35); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" a - don't check ASSERTs at runtime, use this option in tested production code", (LONGINT)80); + OPM_LogWStr((CHAR*)" a - don't check ASSERTs at runtime, use this option in tested production code", 80); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" p - turn off automatic pointer initialization", (LONGINT)48); + OPM_LogWStr((CHAR*)" p - turn off automatic pointer initialization", 48); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" t - don't check type guards (use in rare cases such as low-level modules where every cycle counts)", (LONGINT)101); + OPM_LogWStr((CHAR*)" t - don't check type guards (use in rare cases such as low-level modules where every cycle counts)", 101); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" S - don't call external assembler/compiler, only generate C code", (LONGINT)67); + OPM_LogWStr((CHAR*)" S - don't call external assembler/compiler, only generate C code", 67); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" c - don't call linker", (LONGINT)24); + OPM_LogWStr((CHAR*)" c - don't call linker", 24); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" f - don't use color output", (LONGINT)29); + OPM_LogWStr((CHAR*)" f - don't use color output", 29); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" F - force writing new symbol file in current directory", (LONGINT)57); + OPM_LogWStr((CHAR*)" F - force writing new symbol file in current directory", 57); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" V - verbose output", (LONGINT)21); + OPM_LogWStr((CHAR*)" V - verbose output", 21); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Initial options specify defaults for all files.", (LONGINT)48); + OPM_LogWStr((CHAR*)"Initial options specify defaults for all files.", 48); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Options following a filename are specific to that file.", (LONGINT)56); + OPM_LogWStr((CHAR*)"Options following a filename are specific to that file.", 56); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Repeating an option toggles its value.", (LONGINT)39); + OPM_LogWStr((CHAR*)"Repeating an option toggles its value.", 39); OPM_LogWLn(); _o_result = 0; return _o_result; } else { OPM_S = 1; s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + Platform_GetArg(OPM_S, (void*)s, 256); OPM_glbopt = 0xe9; while (s[0] == '-') { - OPM_ScanOptions((void*)s, ((LONGINT)(256)), &OPM_glbopt); + OPM_ScanOptions((void*)s, 256, &OPM_glbopt); OPM_S += 1; s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + Platform_GetArg(OPM_S, (void*)s, 256); } _o_result = 1; return _o_result; @@ -276,12 +276,12 @@ void OPM_InitOptions (void) CHAR s[256]; OPM_opt = OPM_glbopt; s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + Platform_GetArg(OPM_S, (void*)s, 256); while (s[0] == '-') { - OPM_ScanOptions((void*)s, ((LONGINT)(256)), &OPM_opt); + OPM_ScanOptions((void*)s, 256, &OPM_opt); OPM_S += 1; s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + Platform_GetArg(OPM_S, (void*)s, 256); } OPM_dontAsm = __IN(13, OPM_opt); OPM_dontLink = __IN(14, OPM_opt); @@ -307,19 +307,19 @@ void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len) return; } s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + Platform_GetArg(OPM_S, (void*)s, 256); __NEW(T, Texts_TextDesc); - Texts_Open(T, s, ((LONGINT)(256))); - OPM_LogWStr(s, ((LONGINT)(256))); - OPM_LogWStr((CHAR*)" ", (LONGINT)3); + Texts_Open(T, s, 256); + OPM_LogWStr(s, 256); + OPM_LogWStr((CHAR*)" ", 3); __COPY(s, mname, mname__len); - __COPY(s, OPM_SourceFileName, ((LONGINT)(256))); + __COPY(s, OPM_SourceFileName, 256); if (T->len == 0) { - OPM_LogWStr(s, ((LONGINT)(256))); - OPM_LogWStr((CHAR*)" not found.", (LONGINT)12); + OPM_LogWStr(s, 256); + OPM_LogWStr((CHAR*)" not found.", 12); OPM_LogWLn(); } else { - Texts_OpenReader(&OPM_inR, Texts_Reader__typ, T, ((LONGINT)(0))); + Texts_OpenReader(&OPM_inR, Texts_Reader__typ, T, 0); *done = 1; } OPM_S += 1; @@ -378,25 +378,25 @@ static void OPM_LogErrMsg (INTEGER n) CHAR buf[1024]; if (n >= 0) { if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"31m", (LONGINT)4); + vt100_SetAttr((CHAR*)"31m", 4); } - OPM_LogWStr((CHAR*)" err ", (LONGINT)7); + OPM_LogWStr((CHAR*)" err ", 7); if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + vt100_SetAttr((CHAR*)"0m", 3); } } else { if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"35m", (LONGINT)4); + vt100_SetAttr((CHAR*)"35m", 4); } - OPM_LogWStr((CHAR*)" warning ", (LONGINT)11); + OPM_LogWStr((CHAR*)" warning ", 11); n = -n; if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + vt100_SetAttr((CHAR*)"0m", 3); } } - OPM_LogWNum(n, ((LONGINT)(1))); - OPM_LogWStr((CHAR*)" ", (LONGINT)3); - OPM_LogWStr(errors_errors[__X(n, ((LONGINT)(350)))], ((LONGINT)(128))); + OPM_LogWNum(n, 1); + OPM_LogWStr((CHAR*)" ", 3); + OPM_LogWStr(errors_errors[__X(n, 350)], 128); } static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, LONGINT pos) @@ -438,37 +438,37 @@ static void OPM_ShowLine (LONGINT pos) CHAR line[1023]; INTEGER i; CHAR ch; - f = Files_Old(OPM_SourceFileName, ((LONGINT)(256))); + f = Files_Old(OPM_SourceFileName, 256); OPM_FindLine(f, &r, Files_Rider__typ, pos); i = 0; Files_Read(&r, Files_Rider__typ, (void*)&ch); while ((((((ch != 0x00 && ch != 0x0d)) && ch != 0x0a)) && i < 1022)) { - line[__X(i, ((LONGINT)(1023)))] = ch; + line[__X(i, 1023)] = ch; i += 1; Files_Read(&r, Files_Rider__typ, (void*)&ch); } - line[__X(i, ((LONGINT)(1023)))] = 0x00; + line[__X(i, 1023)] = 0x00; OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWNum(OPM_ErrorLineNumber, ((LONGINT)(4))); - OPM_LogWStr((CHAR*)": ", (LONGINT)3); - OPM_LogWStr(line, ((LONGINT)(1023))); + OPM_LogWNum(OPM_ErrorLineNumber, 4); + OPM_LogWStr((CHAR*)": ", 3); + OPM_LogWStr(line, 1023); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" ", (LONGINT)7); + OPM_LogWStr((CHAR*)" ", 7); if (pos >= OPM_ErrorLineLimitPos) { pos = OPM_ErrorLineLimitPos - 1; } - i = (int)(pos - OPM_ErrorLineStartPos); + i = (pos - OPM_ErrorLineStartPos); while (i > 0) { OPM_LogW(' '); i -= 1; } if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"32m", (LONGINT)4); + vt100_SetAttr((CHAR*)"32m", 4); } OPM_LogW('^'); if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + vt100_SetAttr((CHAR*)"0m", 3); } Files_Close(f); } @@ -484,30 +484,30 @@ void OPM_Mark (INTEGER n, LONGINT pos) OPM_lasterrpos = pos; OPM_ShowLine(pos); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" ", (LONGINT)3); + OPM_LogWStr((CHAR*)" ", 3); if (n < 249) { - OPM_LogWStr((CHAR*)" pos", (LONGINT)6); - OPM_LogWNum(pos, ((LONGINT)(6))); + OPM_LogWStr((CHAR*)" pos", 6); + OPM_LogWNum(pos, 6); OPM_LogErrMsg(n); } else if (n == 255) { - OPM_LogWStr((CHAR*)"pos", (LONGINT)4); - OPM_LogWNum(pos, ((LONGINT)(6))); - OPM_LogWStr((CHAR*)" pc ", (LONGINT)6); - OPM_LogWNum(OPM_breakpc, ((LONGINT)(1))); + OPM_LogWStr((CHAR*)"pos", 4); + OPM_LogWNum(pos, 6); + OPM_LogWStr((CHAR*)" pc ", 6); + OPM_LogWNum(OPM_breakpc, 1); } else if (n == 254) { - OPM_LogWStr((CHAR*)"pc not found", (LONGINT)13); + OPM_LogWStr((CHAR*)"pc not found", 13); } else { - OPM_LogWStr(OPM_objname, ((LONGINT)(64))); + OPM_LogWStr(OPM_objname, 64); if (n == 253) { - OPM_LogWStr((CHAR*)" is new, compile with option e", (LONGINT)31); + OPM_LogWStr((CHAR*)" is new, compile with option e", 31); } else if (n == 252) { - OPM_LogWStr((CHAR*)" is redefined, compile with option s", (LONGINT)37); + OPM_LogWStr((CHAR*)" is redefined, compile with option s", 37); } else if (n == 251) { - OPM_LogWStr((CHAR*)" is redefined (private part only), compile with option s", (LONGINT)57); + OPM_LogWStr((CHAR*)" is redefined (private part only), compile with option s", 57); } else if (n == 250) { - OPM_LogWStr((CHAR*)" is no longer visible, compile with option s", (LONGINT)45); + OPM_LogWStr((CHAR*)" is no longer visible, compile with option s", 45); } else if (n == 249) { - OPM_LogWStr((CHAR*)" is not consistently imported, recompile imports", (LONGINT)49); + OPM_LogWStr((CHAR*)" is not consistently imported, recompile imports", 49); } } } @@ -515,8 +515,8 @@ void OPM_Mark (INTEGER n, LONGINT pos) if (pos >= 0) { OPM_ShowLine(pos); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" pos", (LONGINT)6); - OPM_LogWNum(pos, ((LONGINT)(6))); + OPM_LogWStr((CHAR*)" pos", 6); + OPM_LogWNum(pos, 6); } OPM_LogErrMsg(n); if (pos < 0) { @@ -532,27 +532,27 @@ void OPM_err (INTEGER n) void OPM_FPrint (LONGINT *fp, LONGINT val) { - *fp = __ROTL((LONGINT)((SET)*fp ^ (SET)val), 1, LONGINT); + *fp = __ROTL((LONGINT)(__VAL(SET, *fp) ^ __VAL(SET, val)), 1, LONGINT); } void OPM_FPrintSet (LONGINT *fp, SET set) { - OPM_FPrint(&*fp, (LONGINT)set); + OPM_FPrint(&*fp, __VAL(LONGINT, set)); } void OPM_FPrintReal (LONGINT *fp, REAL real) { INTEGER i; LONGINT l; - __GET((LONGINT)(SYSTEM_ADRINT)&real, l, LONGINT); + __GET((SYSTEM_ADRINT)&real, l, LONGINT); OPM_FPrint(&*fp, l); } void OPM_FPrintLReal (LONGINT *fp, LONGREAL lr) { LONGINT l, h; - __GET((LONGINT)(SYSTEM_ADRINT)&lr, l, LONGINT); - __GET((LONGINT)(SYSTEM_ADRINT)&lr + 4, h, LONGINT); + __GET((SYSTEM_ADRINT)&lr, l, LONGINT); + __GET((SYSTEM_ADRINT)&lr + 4, h, LONGINT); OPM_FPrint(&*fp, l); OPM_FPrint(&*fp, h); } @@ -563,19 +563,19 @@ static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONG if (((*S).class == 1 && __STRCMP((*S).s, name) == 0)) { Texts_Scan(&*S, S__typ); if ((*S).class == 3) { - *size = (int)(*S).i; + *size = (*S).i; Texts_Scan(&*S, S__typ); } else { - OPM_Mark(-157, ((LONGINT)(-1))); + OPM_Mark(-157, -1); } if ((*S).class == 3) { - *align = (int)(*S).i; + *align = (*S).i; Texts_Scan(&*S, S__typ); } else { - OPM_Mark(-157, ((LONGINT)(-1))); + OPM_Mark(-157, -1); } } else { - OPM_Mark(-157, ((LONGINT)(-1))); + OPM_Mark(-157, -1); } __DEL(name); } @@ -604,40 +604,40 @@ static LONGINT OPM_power0 (LONGINT i, LONGINT j) static void OPM_VerboseListSizes (void) { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Type Size Alignement", (LONGINT)29); + OPM_LogWStr((CHAR*)"Type Size Alignement", 29); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"CHAR ", (LONGINT)14); - OPM_LogWNum(OPM_CharSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"CHAR ", 14); + OPM_LogWNum(OPM_CharSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"BOOLEAN ", (LONGINT)14); - OPM_LogWNum(OPM_BoolSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"BOOLEAN ", 14); + OPM_LogWNum(OPM_BoolSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"SHORTINT ", (LONGINT)14); - OPM_LogWNum(OPM_SIntSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"SHORTINT ", 14); + OPM_LogWNum(OPM_SIntSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"INTEGER ", (LONGINT)14); - OPM_LogWNum(OPM_IntSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"INTEGER ", 14); + OPM_LogWNum(OPM_IntSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"LONGINT ", (LONGINT)14); - OPM_LogWNum(OPM_LIntSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"LONGINT ", 14); + OPM_LogWNum(OPM_LIntSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"SET ", (LONGINT)14); - OPM_LogWNum(OPM_SetSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"SET ", 14); + OPM_LogWNum(OPM_SetSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"REAL ", (LONGINT)14); - OPM_LogWNum(OPM_RealSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"REAL ", 14); + OPM_LogWNum(OPM_RealSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"LONGREAL ", (LONGINT)14); - OPM_LogWNum(OPM_LRealSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"LONGREAL ", 14); + OPM_LogWNum(OPM_LRealSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"PTR ", (LONGINT)14); - OPM_LogWNum(OPM_PointerSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"PTR ", 14); + OPM_LogWNum(OPM_PointerSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"PROC ", (LONGINT)14); - OPM_LogWNum(OPM_ProcSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"PROC ", 14); + OPM_LogWNum(OPM_ProcSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"RECORD ", (LONGINT)14); - OPM_LogWNum(OPM_RecSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"RECORD ", 14); + OPM_LogWNum(OPM_RecSize, 4); OPM_LogWLn(); OPM_LogWLn(); } @@ -720,11 +720,11 @@ void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done) { CHAR ch; OPM_FileName fileName; - OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, ((LONGINT)(32)), (CHAR*)".sym", (LONGINT)5); - OPM_oldSFile = Files_Old(fileName, ((LONGINT)(32))); + OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, 32, (CHAR*)".sym", 5); + OPM_oldSFile = Files_Old(fileName, 32); *done = OPM_oldSFile != NIL; if (*done) { - Files_Set(&OPM_oldSF, Files_Rider__typ, OPM_oldSFile, ((LONGINT)(0))); + Files_Set(&OPM_oldSF, Files_Rider__typ, OPM_oldSFile, 0); Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&ch); if (ch != 0xf7) { OPM_err(-306); @@ -753,7 +753,7 @@ void OPM_SymWInt (LONGINT i) void OPM_SymWSet (SET s) { - Files_WriteNum(&OPM_newSF, Files_Rider__typ, (LONGINT)s); + Files_WriteNum(&OPM_newSF, Files_Rider__typ, __VAL(LONGINT, s)); } void OPM_SymWReal (REAL r) @@ -780,10 +780,10 @@ void OPM_DeleteNewSym (void) void OPM_NewSym (CHAR *modName, LONGINT modName__len) { OPM_FileName fileName; - OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, ((LONGINT)(32)), (CHAR*)".sym", (LONGINT)5); - OPM_newSFile = Files_New(fileName, ((LONGINT)(32))); + OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, 32, (CHAR*)".sym", 5); + OPM_newSFile = Files_New(fileName, 32); if (OPM_newSFile != NIL) { - Files_Set(&OPM_newSF, Files_Rider__typ, OPM_newSFile, ((LONGINT)(0))); + Files_Set(&OPM_newSF, Files_Rider__typ, OPM_newSFile, 0); Files_Write(&OPM_newSF, Files_Rider__typ, 0xf7); } else { OPM_err(153); @@ -792,7 +792,7 @@ void OPM_NewSym (CHAR *modName, LONGINT modName__len) void OPM_Write (CHAR ch) { - Files_Write(&OPM_R[__X(OPM_currFile, ((LONGINT)(3)))], Files_Rider__typ, ch); + Files_Write(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, ch); } void OPM_WriteString (CHAR *s, LONGINT s__len) @@ -802,7 +802,7 @@ void OPM_WriteString (CHAR *s, LONGINT s__len) while (s[__X(i, s__len)] != 0x00) { i += 1; } - Files_WriteBytes(&OPM_R[__X(OPM_currFile, ((LONGINT)(3)))], Files_Rider__typ, (void*)s, s__len * ((LONGINT)(1)), i); + Files_WriteBytes(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, (void*)s, s__len * 1, i); } void OPM_WriteStringVar (CHAR *s, LONGINT s__len) @@ -812,27 +812,27 @@ void OPM_WriteStringVar (CHAR *s, LONGINT s__len) while (s[__X(i, s__len)] != 0x00) { i += 1; } - Files_WriteBytes(&OPM_R[__X(OPM_currFile, ((LONGINT)(3)))], Files_Rider__typ, (void*)s, s__len * ((LONGINT)(1)), i); + Files_WriteBytes(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, (void*)s, s__len * 1, i); } void OPM_WriteHex (LONGINT i) { CHAR s[3]; INTEGER digit; - digit = __ASHR((int)i, 4); + digit = __ASHR(i, 4); if (digit < 10) { s[0] = (CHAR)(48 + digit); } else { s[0] = (CHAR)(87 + digit); } - digit = __MASK((int)i, -16); + digit = __MASK(i, -16); if (digit < 10) { s[1] = (CHAR)(48 + digit); } else { s[1] = (CHAR)(87 + digit); } s[2] = 0x00; - OPM_WriteString(s, ((LONGINT)(3))); + OPM_WriteString(s, 3); } void OPM_WriteInt (LONGINT i) @@ -842,24 +842,24 @@ void OPM_WriteInt (LONGINT i) if (i == OPM_SignedMinimum(OPM_IntSize) || i == OPM_SignedMinimum(OPM_LIntSize)) { OPM_Write('('); OPM_WriteInt(i + 1); - OPM_WriteString((CHAR*)"-1)", (LONGINT)4); + OPM_WriteString((CHAR*)"-1)", 4); } else { i1 = __ABS(i); - s[0] = (CHAR)(__MOD(i1, 10) + 48); + s[0] = (CHAR)((int)__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k = 1; while (i1 > 0) { - s[__X(k, ((LONGINT)(20)))] = (CHAR)(__MOD(i1, 10) + 48); + s[__X(k, 20)] = (CHAR)((int)__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k += 1; } if (i < 0) { - s[__X(k, ((LONGINT)(20)))] = '-'; + s[__X(k, 20)] = '-'; k += 1; } while (k > 0) { k -= 1; - OPM_Write(s[__X(k, ((LONGINT)(20)))]); + OPM_Write(s[__X(k, 20)]); } } } @@ -872,13 +872,13 @@ void OPM_WriteReal (LONGREAL r, CHAR suffx) CHAR s[32]; CHAR ch; INTEGER i; - if ((((r < OPM_SignedMaximum(OPM_LIntSize) && r > OPM_SignedMinimum(OPM_LIntSize))) && r == ((int)__ENTIER(r)))) { + if ((((r < OPM_SignedMaximum(OPM_LIntSize) && r > OPM_SignedMinimum(OPM_LIntSize))) && r == ((SYSTEM_INT32)__ENTIER(r)))) { if (suffx == 'f') { - OPM_WriteString((CHAR*)"(REAL)", (LONGINT)7); + OPM_WriteString((CHAR*)"(REAL)", 7); } else { - OPM_WriteString((CHAR*)"(LONGREAL)", (LONGINT)11); + OPM_WriteString((CHAR*)"(LONGREAL)", 11); } - OPM_WriteInt((int)__ENTIER(r)); + OPM_WriteInt((SYSTEM_INT32)__ENTIER(r)); } else { Texts_OpenWriter(&W, Texts_Writer__typ); if (suffx == 'f') { @@ -887,33 +887,33 @@ void OPM_WriteReal (LONGREAL r, CHAR suffx) Texts_WriteLongReal(&W, Texts_Writer__typ, r, 23); } __NEW(T, Texts_TextDesc); - Texts_Open(T, (CHAR*)"", (LONGINT)1); + Texts_Open(T, (CHAR*)"", 1); Texts_Append(T, W.buf); - Texts_OpenReader(&R, Texts_Reader__typ, T, ((LONGINT)(0))); + Texts_OpenReader(&R, Texts_Reader__typ, T, 0); i = 0; Texts_Read(&R, Texts_Reader__typ, &ch); while (ch != 0x00) { - s[__X(i, ((LONGINT)(32)))] = ch; + s[__X(i, 32)] = ch; i += 1; Texts_Read(&R, Texts_Reader__typ, &ch); } - s[__X(i, ((LONGINT)(32)))] = 0x00; + s[__X(i, 32)] = 0x00; i = 0; ch = s[0]; while ((ch != 'D' && ch != 0x00)) { i += 1; - ch = s[__X(i, ((LONGINT)(32)))]; + ch = s[__X(i, 32)]; } if (ch == 'D') { - s[__X(i, ((LONGINT)(32)))] = 'e'; + s[__X(i, 32)] = 'e'; } - OPM_WriteString(s, ((LONGINT)(32))); + OPM_WriteString(s, 32); } } void OPM_WriteLn (void) { - Files_Write(&OPM_R[__X(OPM_currFile, ((LONGINT)(3)))], Files_Rider__typ, 0x0a); + Files_Write(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, 0x0a); } static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F) @@ -921,11 +921,11 @@ static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F) Files_Rider R1; CHAR buffer[4096]; if (F != NIL) { - Files_Set(&R1, Files_Rider__typ, F, ((LONGINT)(0))); - Files_ReadBytes(&R1, Files_Rider__typ, (void*)buffer, ((LONGINT)(4096)), ((LONGINT)(4096))); + Files_Set(&R1, Files_Rider__typ, F, 0); + Files_ReadBytes(&R1, Files_Rider__typ, (void*)buffer, 4096, 4096); while (4096 - R1.res > 0) { - Files_WriteBytes(&*R, R__typ, (void*)buffer, ((LONGINT)(4096)), 4096 - R1.res); - Files_ReadBytes(&R1, Files_Rider__typ, (void*)buffer, ((LONGINT)(4096)), ((LONGINT)(4096))); + Files_WriteBytes(&*R, R__typ, (void*)buffer, 4096, 4096 - R1.res); + Files_ReadBytes(&R1, Files_Rider__typ, (void*)buffer, 4096, 4096); } } } @@ -933,24 +933,24 @@ static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F) void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len) { CHAR FName[32]; - __COPY(moduleName, OPM_modName, ((LONGINT)(32))); - OPM_HFile = Files_New((CHAR*)"", (LONGINT)1); + __COPY(moduleName, OPM_modName, 32); + OPM_HFile = Files_New((CHAR*)"", 1); if (OPM_HFile != NIL) { - Files_Set(&OPM_R[0], Files_Rider__typ, OPM_HFile, ((LONGINT)(0))); + Files_Set(&OPM_R[0], Files_Rider__typ, OPM_HFile, 0); } else { OPM_err(153); } - OPM_MakeFileName((void*)moduleName, moduleName__len, (void*)FName, ((LONGINT)(32)), (CHAR*)".c", (LONGINT)3); - OPM_BFile = Files_New(FName, ((LONGINT)(32))); + OPM_MakeFileName((void*)moduleName, moduleName__len, (void*)FName, 32, (CHAR*)".c", 3); + OPM_BFile = Files_New(FName, 32); if (OPM_BFile != NIL) { - Files_Set(&OPM_R[1], Files_Rider__typ, OPM_BFile, ((LONGINT)(0))); + Files_Set(&OPM_R[1], Files_Rider__typ, OPM_BFile, 0); } else { OPM_err(153); } - OPM_MakeFileName((void*)moduleName, moduleName__len, (void*)FName, ((LONGINT)(32)), (CHAR*)".h", (LONGINT)3); - OPM_HIFile = Files_New(FName, ((LONGINT)(32))); + OPM_MakeFileName((void*)moduleName, moduleName__len, (void*)FName, 32, (CHAR*)".h", 3); + OPM_HIFile = Files_New(FName, 32); if (OPM_HIFile != NIL) { - Files_Set(&OPM_R[2], Files_Rider__typ, OPM_HIFile, ((LONGINT)(0))); + Files_Set(&OPM_R[2], Files_Rider__typ, OPM_HIFile, 0); } else { OPM_err(153); } @@ -961,9 +961,9 @@ void OPM_CloseFiles (void) CHAR FName[32]; INTEGER res; if (OPM_noerr) { - OPM_LogWStr((CHAR*)" ", (LONGINT)3); - OPM_LogWNum(Files_Pos(&OPM_R[1], Files_Rider__typ), ((LONGINT)(0))); - OPM_LogWStr((CHAR*)" chars.", (LONGINT)8); + OPM_LogWStr((CHAR*)" ", 3); + OPM_LogWNum(Files_Pos(&OPM_R[1], Files_Rider__typ), 0); + OPM_LogWStr((CHAR*)" chars.", 8); } if (OPM_noerr) { if (__STRCMP(OPM_modName, "SYSTEM") == 0) { @@ -975,10 +975,10 @@ void OPM_CloseFiles (void) Files_Register(OPM_HIFile); Files_Register(OPM_BFile); } else { - OPM_MakeFileName((void*)OPM_modName, ((LONGINT)(32)), (void*)FName, ((LONGINT)(32)), (CHAR*)".h", (LONGINT)3); - Files_Delete(FName, ((LONGINT)(32)), &res); - OPM_MakeFileName((void*)OPM_modName, ((LONGINT)(32)), (void*)FName, ((LONGINT)(32)), (CHAR*)".sym", (LONGINT)5); - Files_Delete(FName, ((LONGINT)(32)), &res); + OPM_MakeFileName((void*)OPM_modName, 32, (void*)FName, 32, (CHAR*)".h", 3); + Files_Delete(FName, 32, &res); + OPM_MakeFileName((void*)OPM_modName, 32, (void*)FName, 32, (CHAR*)".sym", 5); + Files_Delete(FName, 32, &res); Files_Register(OPM_BFile); } } @@ -987,11 +987,11 @@ void OPM_CloseFiles (void) OPM_HIFile = NIL; OPM_newSFile = NIL; OPM_oldSFile = NIL; - Files_Set(&OPM_R[0], Files_Rider__typ, NIL, ((LONGINT)(0))); - Files_Set(&OPM_R[1], Files_Rider__typ, NIL, ((LONGINT)(0))); - Files_Set(&OPM_R[2], Files_Rider__typ, NIL, ((LONGINT)(0))); - Files_Set(&OPM_newSF, Files_Rider__typ, NIL, ((LONGINT)(0))); - Files_Set(&OPM_oldSF, Files_Rider__typ, NIL, ((LONGINT)(0))); + Files_Set(&OPM_R[0], Files_Rider__typ, NIL, 0); + Files_Set(&OPM_R[1], Files_Rider__typ, NIL, 0); + Files_Set(&OPM_R[2], Files_Rider__typ, NIL, 0); + Files_Set(&OPM_newSF, Files_Rider__typ, NIL, 0); + Files_Set(&OPM_oldSF, Files_Rider__typ, NIL, 0); } static void EnumPtrs(void (*P)(void*)) @@ -1032,15 +1032,15 @@ export void *OPM__init(void) /* BEGIN */ Texts_OpenWriter(&OPM_W, Texts_Writer__typ); OPM_MODULES[0] = 0x00; - Platform_GetEnv((CHAR*)"MODULES", (LONGINT)8, (void*)OPM_MODULES, ((LONGINT)(1024))); + Platform_GetEnv((CHAR*)"MODULES", 8, (void*)OPM_MODULES, 1024); __MOVE(".", OPM_OBERON, 2); - Platform_GetEnv((CHAR*)"OBERON", (LONGINT)7, (void*)OPM_OBERON, ((LONGINT)(1024))); - Strings_Append((CHAR*)";.;", (LONGINT)4, (void*)OPM_OBERON, ((LONGINT)(1024))); - Strings_Append(OPM_MODULES, ((LONGINT)(1024)), (void*)OPM_OBERON, ((LONGINT)(1024))); - Strings_Append((CHAR*)";", (LONGINT)2, (void*)OPM_OBERON, ((LONGINT)(1024))); - Strings_Append((CHAR*)"/opt/voc", (LONGINT)9, (void*)OPM_OBERON, ((LONGINT)(1024))); - Strings_Append((CHAR*)"/sym;", (LONGINT)6, (void*)OPM_OBERON, ((LONGINT)(1024))); - Files_SetSearchPath(OPM_OBERON, ((LONGINT)(1024))); + Platform_GetEnv((CHAR*)"OBERON", 7, (void*)OPM_OBERON, 1024); + Strings_Append((CHAR*)";.;", 4, (void*)OPM_OBERON, 1024); + Strings_Append(OPM_MODULES, 1024, (void*)OPM_OBERON, 1024); + Strings_Append((CHAR*)";", 2, (void*)OPM_OBERON, 1024); + Strings_Append((CHAR*)"/opt/voc", 9, (void*)OPM_OBERON, 1024); + Strings_Append((CHAR*)"/sym;", 6, (void*)OPM_OBERON, 1024); + Files_SetSearchPath(OPM_OBERON, 1024); OPM_CharSize = 1; OPM_BoolSize = 1; OPM_SIntSize = 1; diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index a61c632e..f93bcd98 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index 5620c5ec..f44a2167 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPB.h" #include "OPM.h" @@ -58,7 +58,7 @@ static void OPP_err (INTEGER n) static void OPP_CheckSym (INTEGER s) { - if ((int)OPP_sym == s) { + if (OPP_sym == s) { OPS_Get(&OPP_sym); } else { OPM_err(s); @@ -104,7 +104,7 @@ static void OPP_ConstExpression (OPT_Node *x) OPP_Expression(&*x); if ((*x)->class != 7) { OPP_err(50); - *x = OPB_NewIntConst(((LONGINT)(1))); + *x = OPB_NewIntConst(1); } } @@ -146,7 +146,7 @@ static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_) OPP_err(51); sf = 0; } - *sysflag = (int)sf; + *sysflag = sf; OPP_CheckSym(23); } else { *sysflag = default_; @@ -308,13 +308,13 @@ static void OPP_PointerType (OPT_Struct *typ) OPT_Find(&id); if (id == NIL) { if (OPP_nofFwdPtr < 64) { - OPP_FwdPtr[__X(OPP_nofFwdPtr, ((LONGINT)(64)))] = *typ; + OPP_FwdPtr[__X(OPP_nofFwdPtr, 64)] = *typ; OPP_nofFwdPtr += 1; } else { OPP_err(224); } (*typ)->link = OPT_NewObj(); - __COPY(OPS_name, (*typ)->link->name, ((LONGINT)(256))); + __COPY(OPS_name, (*typ)->link->name, 256); (*typ)->BaseTyp = OPT_undftyp; OPS_Get(&OPP_sym); } else { @@ -518,7 +518,7 @@ static void OPP_selector (OPT_Node *x) } else if (OPP_sym == 18) { OPS_Get(&OPP_sym); if (OPP_sym == 38) { - __COPY(OPS_name, name, ((LONGINT)(256))); + __COPY(OPS_name, name, 256); OPS_Get(&OPP_sym); if ((*x)->typ != NIL) { if ((*x)->typ->form == 13) { @@ -625,7 +625,7 @@ static void OPP_StandProcCall (OPT_Node *x) OPT_Node y = NIL; SHORTINT m; INTEGER n; - m = (int)(*x)->obj->adr; + m = (*x)->obj->adr; n = 0; if (OPP_sym == 30) { OPS_Get(&OPP_sym); @@ -742,8 +742,8 @@ static void OPP_Factor (OPT_Node *x) *x = OPB_NewRealConst(OPS_lrlval, OPT_lrltyp); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPP.Factor, OPS.numtyp = ", (LONGINT)44); - OPM_LogWNum(OPS_numtyp, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPP.Factor, OPS.numtyp = ", 44); + OPM_LogWNum(OPS_numtyp, 0); OPM_LogWLn(); break; } @@ -776,7 +776,7 @@ static void OPP_Factor (OPT_Node *x) *x = NIL; } if (*x == NIL) { - *x = OPB_NewIntConst(((LONGINT)(1))); + *x = OPB_NewIntConst(1); (*x)->typ = OPT_undftyp; } } @@ -858,7 +858,7 @@ static void OPP_Receiver (SHORTINT *mode, OPS_Name name, OPT_Struct *typ, OPT_St } else { *mode = 1; } - __COPY(OPS_name, name, ((LONGINT)(256))); + __COPY(OPS_name, name, 256); OPP_CheckSym(38); OPP_CheckSym(20); if (OPP_sym == 38) { @@ -932,8 +932,8 @@ static void GetCode__19 (void) (*ProcedureDeclaration__16_s->proc)->conval->ext = ext; n = 0; if (OPP_sym == 37) { - while (OPS_str[__X(n, ((LONGINT)(256)))] != 0x00) { - (*ext)[__X(n + 1, ((LONGINT)(256)))] = OPS_str[__X(n, ((LONGINT)(256)))]; + while (OPS_str[__X(n, 256)] != 0x00) { + (*ext)[__X(n + 1, 256)] = OPS_str[__X(n, 256)]; n += 1; } (*ext)[0] = (CHAR)n; @@ -949,7 +949,7 @@ static void GetCode__19 (void) n = 1; } OPS_Get(&OPP_sym); - (*ext)[__X(n, ((LONGINT)(256)))] = (CHAR)c; + (*ext)[__X(n, 256)] = (CHAR)c; } if (OPP_sym == 19) { OPS_Get(&OPP_sym); @@ -1023,7 +1023,7 @@ static void TProcDecl__23 (void) } OPP_Receiver(&objMode, objName, &objTyp, &recTyp); if (OPP_sym == 38) { - __COPY(OPS_name, *ProcedureDeclaration__16_s->name, ((LONGINT)(256))); + __COPY(OPS_name, *ProcedureDeclaration__16_s->name, 256); OPP_CheckMark(&*ProcedureDeclaration__16_s->vis); OPT_FindField(*ProcedureDeclaration__16_s->name, recTyp, &*ProcedureDeclaration__16_s->fwd); OPT_FindField(*ProcedureDeclaration__16_s->name, recTyp->BaseTyp, &baseProc); @@ -1122,7 +1122,7 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) TProcDecl__23(); } else if (OPP_sym == 38) { OPT_Find(&fwd); - __COPY(OPS_name, name, ((LONGINT)(256))); + __COPY(OPS_name, name, 256); OPP_CheckMark(&vis); if ((vis != 0 && mode == 6)) { mode = 7; @@ -1183,14 +1183,14 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, O if (!__IN(LabelTyp->form, 0x70) || LabelTyp->size < x->typ->size) { OPP_err(60); } - } else if ((int)LabelTyp->form != f) { + } else if (LabelTyp->form != f) { OPP_err(60); } if (OPP_sym == 21) { OPS_Get(&OPP_sym); OPP_ConstExpression(&y); yval = y->conval->intval; - if (((int)y->typ->form != f && !((__IN(f, 0x70) && __IN(y->typ->form, 0x70))))) { + if ((y->typ->form != f && !((__IN(f, 0x70) && __IN(y->typ->form, 0x70))))) { OPP_err(60); } if (yval < xval) { @@ -1207,17 +1207,17 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, O if (i == 0) { break; } - if (tab[__X(i - 1, ((LONGINT)(128)))].low <= yval) { - if (tab[__X(i - 1, ((LONGINT)(128)))].high >= xval) { + if (tab[__X(i - 1, 128)].low <= yval) { + if (tab[__X(i - 1, 128)].high >= xval) { OPP_err(62); } break; } - tab[__X(i, ((LONGINT)(128)))] = tab[__X(i - 1, ((LONGINT)(128)))]; + tab[__X(i, 128)] = tab[__X(i - 1, 128)]; i -= 1; } - tab[__X(i, ((LONGINT)(128)))].low = xval; - tab[__X(i, ((LONGINT)(128)))].high = yval; + tab[__X(i, 128)].low = xval; + tab[__X(i, 128)].high = yval; *n += 1; } else { OPP_err(213); @@ -1276,7 +1276,7 @@ static void CasePart__31 (OPT_Node *x) } if (n > 0) { low = tab[0].low; - high = tab[__X(n - 1, ((LONGINT)(128)))].high; + high = tab[__X(n - 1, 128)].high; if (high - low > 512) { OPP_err(209); } @@ -1479,7 +1479,7 @@ static void OPP_StatSeq (OPT_Node *stat) OPS_Get(&OPP_sym); OPP_ConstExpression(&z); } else { - z = OPB_NewIntConst(((LONGINT)(1))); + z = OPB_NewIntConst(1); } pos = OPM_errpos; x = OPB_NewLeaf(id); @@ -1642,7 +1642,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) OPP_ConstExpression(&x); } else { OPP_err(9); - x = OPB_NewIntConst(((LONGINT)(1))); + x = OPB_NewIntConst(1); } obj->mode = 3; obj->typ = x->typ; @@ -1673,7 +1673,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) if (__IN(obj->typ->comp, 0x1c)) { i = 0; while (i < OPP_nofFwdPtr) { - typ = OPP_FwdPtr[__X(i, ((LONGINT)(64)))]; + typ = OPP_FwdPtr[__X(i, 64)]; i += 1; if (__STRCMP(typ->link->name, obj->name) == 0) { typ->BaseTyp = obj->typ; @@ -1735,10 +1735,10 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) } i = 0; while (i < OPP_nofFwdPtr) { - if (OPP_FwdPtr[__X(i, ((LONGINT)(64)))]->link->name[0] != 0x00) { + if (OPP_FwdPtr[__X(i, 64)]->link->name[0] != 0x00) { OPP_err(128); } - OPP_FwdPtr[__X(i, ((LONGINT)(64)))] = NIL; + OPP_FwdPtr[__X(i, 64)] = NIL; i += 1; } OPT_topScope->adr = OPM_errpos; @@ -1784,28 +1784,28 @@ void OPP_Module (OPT_Node *prog, SET opt) OPS_Get(&OPP_sym); } else { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Unexpected symbol found when MODULE expected:", (LONGINT)46); + OPM_LogWStr((CHAR*)"Unexpected symbol found when MODULE expected:", 46); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" sym: ", (LONGINT)15); - OPM_LogWNum(OPP_sym, ((LONGINT)(1))); + OPM_LogWStr((CHAR*)" sym: ", 15); + OPM_LogWNum(OPP_sym, 1); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" OPS.name: ", (LONGINT)15); - OPM_LogWStr(OPS_name, ((LONGINT)(256))); + OPM_LogWStr((CHAR*)" OPS.name: ", 15); + OPM_LogWStr(OPS_name, 256); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" OPS.str: ", (LONGINT)15); - OPM_LogWStr(OPS_str, ((LONGINT)(256))); + OPM_LogWStr((CHAR*)" OPS.str: ", 15); + OPM_LogWStr(OPS_str, 256); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" OPS.numtyp: ", (LONGINT)15); - OPM_LogWNum(OPS_numtyp, ((LONGINT)(1))); + OPM_LogWStr((CHAR*)" OPS.numtyp: ", 15); + OPM_LogWNum(OPS_numtyp, 1); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" OPS.intval: ", (LONGINT)15); - OPM_LogWNum(OPS_intval, ((LONGINT)(1))); + OPM_LogWStr((CHAR*)" OPS.intval: ", 15); + OPM_LogWNum(OPS_intval, 1); OPM_LogWLn(); OPP_err(16); } if (OPP_sym == 38) { - OPM_LogWStr((CHAR*)"compiling ", (LONGINT)11); - OPM_LogWStr(OPS_name, ((LONGINT)(256))); + OPM_LogWStr((CHAR*)"compiling ", 11); + OPM_LogWStr(OPS_name, 256); OPM_LogW('.'); OPT_Init(OPS_name, opt); OPS_Get(&OPP_sym); @@ -1814,13 +1814,13 @@ void OPP_Module (OPT_Node *prog, SET opt) OPS_Get(&OPP_sym); for (;;) { if (OPP_sym == 38) { - __COPY(OPS_name, aliasName, ((LONGINT)(256))); - __COPY(aliasName, impName, ((LONGINT)(256))); + __COPY(OPS_name, aliasName, 256); + __COPY(aliasName, impName, 256); OPS_Get(&OPP_sym); if (OPP_sym == 34) { OPS_Get(&OPP_sym); if (OPP_sym == 38) { - __COPY(OPS_name, impName, ((LONGINT)(256))); + __COPY(OPS_name, impName, 256); OPS_Get(&OPP_sym); } else { OPP_err(38); diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index be6b6252..0ddbe4c3 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index 1f721944..2a093f8e 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "OPM.h" @@ -59,7 +59,7 @@ static void OPS_Str (SHORTINT *sym) if (OPS_intval == 2) { *sym = 35; OPS_numtyp = 1; - OPS_intval = (int)OPS_str[0]; + OPS_intval = OPS_str[0]; } else { *sym = 37; } @@ -112,10 +112,10 @@ static INTEGER Ord__7 (CHAR ch, BOOLEAN hex) { INTEGER _o_result; if (ch <= '9') { - _o_result = (int)ch - 48; + _o_result = ch - 48; return _o_result; } else if (hex) { - _o_result = ((int)ch - 65) + 10; + _o_result = (ch - 65) + 10; return _o_result; } else { OPS_err(2); @@ -173,7 +173,7 @@ static void OPS_Number (void) OPS_numtyp = 1; if (n <= 2) { while (i < n) { - OPS_intval = __ASHL(OPS_intval, 4) + (int)Ord__7(dig[i], 1); + OPS_intval = __ASHL(OPS_intval, 4) + Ord__7(dig[i], 1); i += 1; } } else { @@ -188,7 +188,7 @@ static void OPS_Number (void) OPS_intval = -1; } while (i < n) { - OPS_intval = __ASHL(OPS_intval, 4) + (int)Ord__7(dig[i], 1); + OPS_intval = __ASHL(OPS_intval, 4) + Ord__7(dig[i], 1); i += 1; } } else { @@ -199,8 +199,8 @@ static void OPS_Number (void) while (i < n) { d = Ord__7(dig[i], 0); i += 1; - if (OPS_intval <= __DIV(2147483647 - (int)d, 10)) { - OPS_intval = OPS_intval * 10 + (int)d; + if (OPS_intval <= __DIV(2147483647 - d, 10)) { + OPS_intval = OPS_intval * 10 + d; } else { OPS_err(203); } diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index ecd93034..46e05201 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index 8efa4803..c81989cb 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" @@ -162,10 +162,10 @@ OPT_Struct OPT_IntType (LONGINT size) OPT_Struct _o_result; INTEGER i; i = 1; - while ((OPT_IntTypes[__X(i, ((LONGINT)(20)))]->size < size && OPT_IntTypes[__X(i + 1, ((LONGINT)(20)))] != NIL)) { + while ((OPT_IntTypes[__X(i, 20)]->size < size && OPT_IntTypes[__X(i + 1, 20)] != NIL)) { i += 1; } - _o_result = OPT_IntTypes[__X(i, ((LONGINT)(20)))]; + _o_result = OPT_IntTypes[__X(i, 20)]; return _o_result; } @@ -177,11 +177,11 @@ OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir) __ASSERT(dir == 1 || dir == -1, 0); __ASSERT(x->BaseTyp == OPT_undftyp, 0); i = 0; - while ((OPT_IntTypes[__X(i, ((LONGINT)(20)))] != x && i < 20)) { + while ((OPT_IntTypes[__X(i, 20)] != x && i < 20)) { i += 1; } __ASSERT(i < 19, 0); - _o_result = OPT_IntTypes[__X(i + dir, ((LONGINT)(20)))]; + _o_result = OPT_IntTypes[__X(i + dir, 20)]; return _o_result; } @@ -234,7 +234,7 @@ OPT_ConstExt OPT_NewExt (void) { OPT_ConstExt _o_result; OPT_ConstExt ext = NIL; - ext = __NEWARR(NIL, ((LONGINT)(1)), 1, 1, 0, (LONGINT)256); + ext = __NEWARR(NIL, 1, 1, 1, 0, 256); _o_result = ext; return _o_result; } @@ -265,8 +265,8 @@ void OPT_Init (OPS_Name name, SET opt) OPT_topScope = OPT_universe; OPT_OpenScope(0, NIL); OPT_SYSimported = 0; - __COPY(name, OPT_SelfName, ((LONGINT)(256))); - __COPY(name, OPT_topScope->name, ((LONGINT)(256))); + __COPY(name, OPT_SelfName, 256); + __COPY(name, OPT_topScope->name, 256); OPT_GlbMod[0] = OPT_topScope; OPT_nofGmod = 1; OPT_newsf = __IN(4, opt); @@ -281,13 +281,13 @@ void OPT_Close (void) OPT_CloseScope(); i = 0; while (i < 64) { - OPT_GlbMod[__X(i, ((LONGINT)(64)))] = NIL; + OPT_GlbMod[__X(i, 64)] = NIL; i += 1; } i = 16; while (i < 255) { - OPT_impCtxt.ref[__X(i, ((LONGINT)(255)))] = NIL; - OPT_impCtxt.old[__X(i, ((LONGINT)(255)))] = NIL; + OPT_impCtxt.ref[__X(i, 255)] = NIL; + OPT_impCtxt.old[__X(i, 255)] = NIL; i += 1; } } @@ -398,7 +398,7 @@ void OPT_Insert (OPS_Name name, OPT_Object *obj) } ob1->left = NIL; ob1->right = NIL; - __COPY(name, ob1->name, ((LONGINT)(256))); + __COPY(name, ob1->name, 256); mnolev = OPT_topScope->mnolev; ob1->mnolev = mnolev; break; @@ -414,7 +414,7 @@ static void OPT_FPrintName (LONGINT *fp, CHAR *name, LONGINT name__len) i = 0; do { ch = name[__X(i, name__len)]; - OPM_FPrint(&*fp, (int)ch); + OPM_FPrint(&*fp, ch); i += 1; } while (!(ch == 0x00)); } @@ -423,32 +423,32 @@ static void OPT_DebugStruct (OPT_Struct btyp) { OPM_LogWLn(); if (btyp == NIL) { - OPM_LogWStr((CHAR*)"btyp is nil", (LONGINT)12); + OPM_LogWStr((CHAR*)"btyp is nil", 12); OPM_LogWLn(); } - OPM_LogWStr((CHAR*)"btyp^.strobji^.name = ", (LONGINT)23); - OPM_LogWStr(btyp->strobj->name, ((LONGINT)(256))); + OPM_LogWStr((CHAR*)"btyp^.strobji^.name = ", 23); + OPM_LogWStr(btyp->strobj->name, 256); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.form = ", (LONGINT)14); - OPM_LogWNum(btyp->form, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.form = ", 14); + OPM_LogWNum(btyp->form, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.comp = ", (LONGINT)14); - OPM_LogWNum(btyp->comp, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.comp = ", 14); + OPM_LogWNum(btyp->comp, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.mno = ", (LONGINT)13); - OPM_LogWNum(btyp->mno, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.mno = ", 13); + OPM_LogWNum(btyp->mno, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.extlev = ", (LONGINT)16); - OPM_LogWNum(btyp->extlev, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.extlev = ", 16); + OPM_LogWNum(btyp->extlev, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.size = ", (LONGINT)14); - OPM_LogWNum(btyp->size, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.size = ", 14); + OPM_LogWNum(btyp->size, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.align = ", (LONGINT)15); - OPM_LogWNum(btyp->align, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.align = ", 15); + OPM_LogWNum(btyp->align, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.txtpos = ", (LONGINT)16); - OPM_LogWNum(btyp->txtpos, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.txtpos = ", 16); + OPM_LogWNum(btyp->txtpos, 0); OPM_LogWLn(); } @@ -480,8 +480,8 @@ void OPT_IdFPrint (OPT_Struct typ) btyp = typ->BaseTyp; strobj = typ->strobj; if ((strobj != NIL && strobj->name[0] != 0x00)) { - OPT_FPrintName(&idfp, (void*)OPT_GlbMod[__X(typ->mno, ((LONGINT)(64)))]->name, ((LONGINT)(256))); - OPT_FPrintName(&idfp, (void*)strobj->name, ((LONGINT)(256))); + OPT_FPrintName(&idfp, (void*)OPT_GlbMod[__X(typ->mno, 64)]->name, 256); + OPT_FPrintName(&idfp, (void*)strobj->name, 256); } if ((f == 13 || (c == 4 && btyp != NIL)) || c == 3) { OPT_IdFPrint(btyp); @@ -532,7 +532,7 @@ static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr) } } } else if (typ->form == 13 || __STRCMP(fld->name, "@ptr") == 0) { - OPM_FPrint(&*FPrintStr__12_s->pvfp, ((LONGINT)(13))); + OPM_FPrint(&*FPrintStr__12_s->pvfp, 13); OPM_FPrint(&*FPrintStr__12_s->pvfp, adr); OPT_nofhdfld += 1; } @@ -543,7 +543,7 @@ static void FPrintFlds__13 (OPT_Object fld, LONGINT adr, BOOLEAN visible) while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->vis); - OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)fld->name, ((LONGINT)(256))); + OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)fld->name, 256); OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->adr); OPT_FPrintStr(fld->typ); OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->typ->pbfp); @@ -561,10 +561,10 @@ static void FPrintTProcs__17 (OPT_Object obj) FPrintTProcs__17(obj->left); if (obj->mode == 13) { if (obj->vis != 0) { - OPM_FPrint(&*FPrintStr__12_s->pbfp, ((LONGINT)(13))); + OPM_FPrint(&*FPrintStr__12_s->pbfp, 13); OPM_FPrint(&*FPrintStr__12_s->pbfp, __ASHR(obj->adr, 16)); OPT_FPrintSign(&*FPrintStr__12_s->pbfp, obj->typ, obj->link); - OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)obj->name, ((LONGINT)(256))); + OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)obj->name, 256); } } FPrintTProcs__17(obj->right); @@ -618,7 +618,7 @@ void OPT_FPrintStr (OPT_Struct typ) OPM_FPrint(&pvfp, typ->align); OPM_FPrint(&pvfp, typ->n); OPT_nofhdfld = 0; - FPrintFlds__13(typ->link, ((LONGINT)(0)), 1); + FPrintFlds__13(typ->link, 0, 1); if (OPT_nofhdfld > 2048) { OPM_Mark(225, typ->txtpos); } @@ -663,7 +663,7 @@ void OPT_FPrintObj (OPT_Object obj) OPM_FPrintLReal(&fprint, obj->conval->realval); break; case 10: - OPT_FPrintName(&fprint, (void*)*obj->conval->ext, ((LONGINT)(256))); + OPT_FPrintName(&fprint, (void*)*obj->conval->ext, 256); break; case 11: break; @@ -680,11 +680,11 @@ void OPT_FPrintObj (OPT_Object obj) } else if (obj->mode == 9) { OPT_FPrintSign(&fprint, obj->typ, obj->link); ext = obj->conval->ext; - m = (int)(*ext)[0]; + m = (*ext)[0]; f = 1; OPM_FPrint(&fprint, m); while (f <= m) { - OPM_FPrint(&fprint, (int)(*ext)[__X(f, ((LONGINT)(256)))]); + OPM_FPrint(&fprint, (*ext)[__X(f, 256)]); f += 1; } } else if (obj->mode == 5) { @@ -700,22 +700,22 @@ void OPT_FPrintErr (OPT_Object obj, INTEGER errcode) INTEGER i, j; CHAR ch; if (obj->mnolev != 0) { - __COPY(OPT_GlbMod[__X(-obj->mnolev, ((LONGINT)(64)))]->name, OPM_objname, ((LONGINT)(64))); + __COPY(OPT_GlbMod[__X(-obj->mnolev, 64)]->name, OPM_objname, 64); i = 0; - while (OPM_objname[__X(i, ((LONGINT)(64)))] != 0x00) { + while (OPM_objname[__X(i, 64)] != 0x00) { i += 1; } - OPM_objname[__X(i, ((LONGINT)(64)))] = '.'; + OPM_objname[__X(i, 64)] = '.'; j = 0; i += 1; do { - ch = obj->name[__X(j, ((LONGINT)(256)))]; - OPM_objname[__X(i, ((LONGINT)(64)))] = ch; + ch = obj->name[__X(j, 256)]; + OPM_objname[__X(i, 64)] = ch; j += 1; i += 1; } while (!(ch == 0x00)); } else { - __COPY(obj->name, OPM_objname, ((LONGINT)(64))); + __COPY(obj->name, OPM_objname, 64); } if (errcode == 249) { if (OPM_noerr) { @@ -808,12 +808,12 @@ static void OPT_InMod (SHORTINT *mno) *mno = OPT_impCtxt.glbmno[0]; } else { if (mn == 16) { - OPT_InName((void*)name, ((LONGINT)(256))); + OPT_InName((void*)name, 256); if ((__STRCMP(name, OPT_SelfName) == 0 && !OPT_impCtxt.self)) { OPT_err(154); } i = 0; - while ((i < OPT_nofGmod && __STRCMP(name, OPT_GlbMod[__X(i, ((LONGINT)(64)))]->name) != 0)) { + while ((i < OPT_nofGmod && __STRCMP(name, OPT_GlbMod[__X(i, 64)]->name) != 0)) { i += 1; } if (i < OPT_nofGmod) { @@ -821,20 +821,20 @@ static void OPT_InMod (SHORTINT *mno) } else { head = OPT_NewObj(); head->mode = 12; - __COPY(name, head->name, ((LONGINT)(256))); + __COPY(name, head->name, 256); *mno = OPT_nofGmod; head->mnolev = -*mno; if (OPT_nofGmod < 64) { - OPT_GlbMod[__X(*mno, ((LONGINT)(64)))] = head; + OPT_GlbMod[__X(*mno, 64)] = head; OPT_nofGmod += 1; } else { OPT_err(227); } } - OPT_impCtxt.glbmno[__X(OPT_impCtxt.nofm, ((LONGINT)(64)))] = *mno; + OPT_impCtxt.glbmno[__X(OPT_impCtxt.nofm, 64)] = *mno; OPT_impCtxt.nofm += 1; } else { - *mno = OPT_impCtxt.glbmno[__X(-mn, ((LONGINT)(64)))]; + *mno = OPT_impCtxt.glbmno[__X(-mn, 64)]; } } } @@ -848,7 +848,7 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval) switch (f) { case 1: case 3: case 2: OPM_SymRCh(&ch); - conval->intval = (int)ch; + conval->intval = ch; break; case 4: case 5: case 6: conval->intval = OPM_SymRInt(); @@ -871,7 +871,7 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval) i = 0; do { OPM_SymRCh(&ch); - (*ext)[__X(i, ((LONGINT)(256)))] = ch; + (*ext)[__X(i, 256)] = ch; i += 1; } while (!(ch == 0x00)); conval->intval2 = i; @@ -881,8 +881,8 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval) conval->intval = 0; break; default: - OPM_LogWStr((CHAR*)"unhandled case in InConstant(), f = ", (LONGINT)37); - OPM_LogWNum(f, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in InConstant(), f = ", 37); + OPM_LogWNum(f, 0); OPM_LogWLn(); break; } @@ -910,7 +910,7 @@ static void OPT_InSign (SHORTINT mno, OPT_Struct *res, OPT_Object *par) } OPT_InStruct(&new->typ); new->adr = OPM_SymRInt(); - OPT_InName((void*)new->name, ((LONGINT)(256))); + OPT_InName((void*)new->name, 256); last = new; tag = OPM_SymRInt(); } @@ -931,7 +931,7 @@ static OPT_Object OPT_InFld (void) obj->vis = 1; } OPT_InStruct(&obj->typ); - OPT_InName((void*)obj->name, ((LONGINT)(256))); + OPT_InName((void*)obj->name, 256); obj->adr = OPM_SymRInt(); } else { obj->mode = 4; @@ -962,7 +962,7 @@ static OPT_Object OPT_InTProc (SHORTINT mno) obj->conval->intval = -1; OPT_InSign(mno, &obj->typ, &obj->link); obj->vis = 1; - OPT_InName((void*)obj->name, ((LONGINT)(256))); + OPT_InName((void*)obj->name, 256); obj->adr = __ASHL(OPM_SymRInt(), 16); } else { obj->mode = 13; @@ -983,7 +983,7 @@ static OPT_Struct OPT_InTyp (LONGINT tag) _o_result = OPT_IntType(OPM_SymRInt()); return _o_result; } else { - _o_result = OPT_impCtxt.ref[__X(tag, ((LONGINT)(255)))]; + _o_result = OPT_impCtxt.ref[__X(tag, 255)]; return _o_result; } __RETCHK; @@ -1007,23 +1007,23 @@ static void OPT_InStruct (OPT_Struct *typ) OPT_impCtxt.minr = ref; } OPT_InMod(&mno); - OPT_InName((void*)name, ((LONGINT)(256))); + OPT_InName((void*)name, 256); obj = OPT_NewObj(); if (name[0] == 0x00) { if (OPT_impCtxt.self) { old = NIL; } else { __MOVE("@", obj->name, 2); - OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->right, &old); + OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, 64)]->right, &old); obj->name[0] = 0x00; } *typ = OPT_NewStr(0, 1); } else { - __COPY(name, obj->name, ((LONGINT)(256))); - OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->right, &old); + __COPY(name, obj->name, 256); + OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, 64)]->right, &old); if (old != NIL) { OPT_FPrintObj(old); - OPT_impCtxt.pvfp[__X(ref, ((LONGINT)(255)))] = old->typ->pvfp; + OPT_impCtxt.pvfp[__X(ref, 255)] = old->typ->pvfp; if (OPT_impCtxt.self) { *typ = OPT_NewStr(0, 1); } else { @@ -1037,8 +1037,8 @@ static void OPT_InStruct (OPT_Struct *typ) *typ = OPT_NewStr(0, 1); } } - OPT_impCtxt.ref[__X(ref, ((LONGINT)(255)))] = *typ; - OPT_impCtxt.old[__X(ref, ((LONGINT)(255)))] = old; + OPT_impCtxt.ref[__X(ref, 255)] = *typ; + OPT_impCtxt.old[__X(ref, 255)] = old; (*typ)->ref = ref + 255; (*typ)->mno = mno; (*typ)->allocated = 1; @@ -1049,7 +1049,7 @@ static void OPT_InStruct (OPT_Struct *typ) obj->vis = 0; tag = OPM_SymRInt(); if (tag == 35) { - (*typ)->sysflag = (int)OPM_SymRInt(); + (*typ)->sysflag = OPM_SymRInt(); tag = OPM_SymRInt(); } switch (tag) { @@ -1117,8 +1117,8 @@ static void OPT_InStruct (OPT_Struct *typ) OPT_InSign(mno, &(*typ)->BaseTyp, &(*typ)->link); break; default: - OPM_LogWStr((CHAR*)"unhandled case at InStruct, tag = ", (LONGINT)35); - OPM_LogWNum(tag, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case at InStruct, tag = ", 35); + OPM_LogWNum(tag, 0); OPM_LogWLn(); break; } @@ -1130,7 +1130,7 @@ static void OPT_InStruct (OPT_Struct *typ) if (obj->name[0] != 0x00) { OPT_FPrintObj(obj); } - old = OPT_impCtxt.old[__X(ref, ((LONGINT)(255)))]; + old = OPT_impCtxt.old[__X(ref, 255)]; if (old != NIL) { t->strobj = old; if (OPT_impCtxt.self) { @@ -1138,13 +1138,13 @@ static void OPT_InStruct (OPT_Struct *typ) if (old->history != 5) { if (old->fprint != obj->fprint) { old->history = 2; - } else if (OPT_impCtxt.pvfp[__X(ref, ((LONGINT)(255)))] != t->pvfp) { + } else if (OPT_impCtxt.pvfp[__X(ref, 255)] != t->pvfp) { old->history = 3; } } } else if (old->fprint != obj->fprint) { old->history = 2; - } else if (OPT_impCtxt.pvfp[__X(ref, ((LONGINT)(255)))] != t->pvfp) { + } else if (OPT_impCtxt.pvfp[__X(ref, 255)] != t->pvfp) { old->history = 3; } else if (old->vis == 0) { old->history = 1; @@ -1152,7 +1152,7 @@ static void OPT_InStruct (OPT_Struct *typ) old->history = 0; } } else { - if (OPT_impCtxt.pvfp[__X(ref, ((LONGINT)(255)))] != t->pvfp) { + if (OPT_impCtxt.pvfp[__X(ref, 255)] != t->pvfp) { old->history = 5; } if (old->fprint != obj->fprint) { @@ -1211,17 +1211,17 @@ static OPT_Object OPT_InObj (SHORTINT mno) obj->mode = 9; ext = OPT_NewExt(); obj->conval->ext = ext; - s = (int)OPM_SymRInt(); + s = OPM_SymRInt(); (*ext)[0] = (CHAR)s; i = 1; while (i <= s) { - OPM_SymRCh(&(*ext)[__X(i, ((LONGINT)(256)))]); + OPM_SymRCh(&(*ext)[__X(i, 256)]); i += 1; } break; default: - OPM_LogWStr((CHAR*)"unhandled case at InObj, tag = ", (LONGINT)32); - OPM_LogWNum(tag, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case at InObj, tag = ", 32); + OPM_LogWNum(tag, 0); OPM_LogWLn(); break; } @@ -1235,14 +1235,14 @@ static OPT_Object OPT_InObj (SHORTINT mno) } OPT_InStruct(&obj->typ); } - OPT_InName((void*)obj->name, ((LONGINT)(256))); + OPT_InName((void*)obj->name, 256); } OPT_FPrintObj(obj); if ((obj->mode == 1 && (obj->typ->strobj == NIL || obj->typ->strobj->name[0] == 0x00))) { OPM_FPrint(&OPT_impCtxt.reffp, obj->typ->ref - 255); } if (tag != 19) { - OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->right, &old); + OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, 64)]->right, &old); if (OPT_impCtxt.self) { if (old != NIL) { if (old->vis == 0) { @@ -1293,7 +1293,7 @@ void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) OPT_impCtxt.nofm = 0; OPT_impCtxt.self = __STRCMP(aliasName, "@self") == 0; OPT_impCtxt.reffp = 0; - OPM_OldSym((void*)name, ((LONGINT)(256)), &*done); + OPM_OldSym((void*)name, 256, &*done); if (*done) { OPT_InMod(&mno); OPT_impCtxt.nextTag = OPM_SymRInt(); @@ -1303,8 +1303,8 @@ void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) } OPT_Insert(aliasName, &obj); obj->mode = 11; - obj->scope = OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->right; - OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->link = obj; + obj->scope = OPT_GlbMod[__X(mno, 64)]->right; + OPT_GlbMod[__X(mno, 64)]->link = obj; obj->mnolev = -mno; obj->typ = OPT_notyp; OPM_CloseOldSym(); @@ -1332,13 +1332,13 @@ static void OPT_OutName (CHAR *name, LONGINT name__len) static void OPT_OutMod (INTEGER mno) { - if (OPT_expCtxt.locmno[__X(mno, ((LONGINT)(64)))] < 0) { - OPM_SymWInt(((LONGINT)(16))); - OPT_expCtxt.locmno[__X(mno, ((LONGINT)(64)))] = OPT_expCtxt.nofm; + if (OPT_expCtxt.locmno[__X(mno, 64)] < 0) { + OPM_SymWInt(16); + OPT_expCtxt.locmno[__X(mno, 64)] = OPT_expCtxt.nofm; OPT_expCtxt.nofm += 1; - OPT_OutName((void*)OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->name, ((LONGINT)(256))); + OPT_OutName((void*)OPT_GlbMod[__X(mno, 64)]->name, 256); } else { - OPM_SymWInt(-OPT_expCtxt.locmno[__X(mno, ((LONGINT)(64)))]); + OPM_SymWInt(-OPT_expCtxt.locmno[__X(mno, 64)]); } } @@ -1368,7 +1368,7 @@ static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, LONGINT adr) } } } else if (typ->form == 13 || __STRCMP(fld->name, "@ptr") == 0) { - OPM_SymWInt(((LONGINT)(27))); + OPM_SymWInt(27); OPM_SymWInt(adr); OPT_nofhdfld += 1; } @@ -1379,12 +1379,12 @@ static void OPT_OutFlds (OPT_Object fld, LONGINT adr, BOOLEAN visible) while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { if (fld->vis == 2) { - OPM_SymWInt(((LONGINT)(26))); + OPM_SymWInt(26); } else { - OPM_SymWInt(((LONGINT)(25))); + OPM_SymWInt(25); } OPT_OutStr(fld->typ); - OPT_OutName((void*)fld->name, ((LONGINT)(256))); + OPT_OutName((void*)fld->name, 256); OPM_SymWInt(fld->adr); } else { OPT_OutHdFld(fld->typ, fld, fld->adr + adr); @@ -1398,16 +1398,16 @@ static void OPT_OutSign (OPT_Struct result, OPT_Object par) OPT_OutStr(result); while (par != NIL) { if (par->mode == 1) { - OPM_SymWInt(((LONGINT)(23))); + OPM_SymWInt(23); } else { - OPM_SymWInt(((LONGINT)(24))); + OPM_SymWInt(24); } OPT_OutStr(par->typ); OPM_SymWInt(par->adr); - OPT_OutName((void*)par->name, ((LONGINT)(256))); + OPT_OutName((void*)par->name, 256); par = par->link; } - OPM_SymWInt(((LONGINT)(18))); + OPM_SymWInt(18); } static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj) @@ -1420,12 +1420,12 @@ static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj) } if (obj->vis != 0) { if (obj->vis != 0) { - OPM_SymWInt(((LONGINT)(29))); + OPM_SymWInt(29); OPT_OutSign(obj->typ, obj->link); - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); OPM_SymWInt(__ASHR(obj->adr, 16)); } else { - OPM_SymWInt(((LONGINT)(30))); + OPM_SymWInt(30); OPM_SymWInt(__ASHR(obj->adr, 16)); } } @@ -1443,7 +1443,7 @@ static void OPT_OutStr (OPT_Struct typ) OPM_SymWInt(typ->size); } } else { - OPM_SymWInt(((LONGINT)(34))); + OPM_SymWInt(34); typ->ref = OPT_expCtxt.ref; OPT_expCtxt.ref += 1; if (OPT_expCtxt.ref >= 255) { @@ -1452,7 +1452,7 @@ static void OPT_OutStr (OPT_Struct typ) OPT_OutMod(typ->mno); strobj = typ->strobj; if ((strobj != NIL && strobj->name[0] != 0x00)) { - OPT_OutName((void*)strobj->name, ((LONGINT)(256))); + OPT_OutName((void*)strobj->name, 256); switch (strobj->history) { case 2: OPT_FPrintErr(strobj, 252); @@ -1470,31 +1470,31 @@ static void OPT_OutStr (OPT_Struct typ) OPM_SymWCh(0x00); } if (typ->sysflag != 0) { - OPM_SymWInt(((LONGINT)(35))); + OPM_SymWInt(35); OPM_SymWInt(typ->sysflag); } switch (typ->form) { case 13: - OPM_SymWInt(((LONGINT)(36))); + OPM_SymWInt(36); OPT_OutStr(typ->BaseTyp); break; case 14: - OPM_SymWInt(((LONGINT)(40))); + OPM_SymWInt(40); OPT_OutSign(typ->BaseTyp, typ->link); break; case 15: switch (typ->comp) { case 2: - OPM_SymWInt(((LONGINT)(37))); + OPM_SymWInt(37); OPT_OutStr(typ->BaseTyp); OPM_SymWInt(typ->n); break; case 3: - OPM_SymWInt(((LONGINT)(38))); + OPM_SymWInt(38); OPT_OutStr(typ->BaseTyp); break; case 4: - OPM_SymWInt(((LONGINT)(39))); + OPM_SymWInt(39); if (typ->BaseTyp == NIL) { OPT_OutStr(OPT_notyp); } else { @@ -1504,23 +1504,23 @@ static void OPT_OutStr (OPT_Struct typ) OPM_SymWInt(typ->align); OPM_SymWInt(typ->n); OPT_nofhdfld = 0; - OPT_OutFlds(typ->link, ((LONGINT)(0)), 1); + OPT_OutFlds(typ->link, 0, 1); if (OPT_nofhdfld > 2048) { OPM_Mark(223, typ->txtpos); } OPT_OutTProcs(typ, typ->link); - OPM_SymWInt(((LONGINT)(18))); + OPM_SymWInt(18); break; default: - OPM_LogWStr((CHAR*)"unhandled case at OutStr, typ^.comp = ", (LONGINT)39); - OPM_LogWNum(typ->comp, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case at OutStr, typ^.comp = ", 39); + OPM_LogWNum(typ->comp, 0); OPM_LogWLn(); break; } break; default: - OPM_LogWStr((CHAR*)"unhandled case at OutStr, typ^.form = ", (LONGINT)39); - OPM_LogWNum(typ->form, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case at OutStr, typ^.form = ", 39); + OPM_LogWNum(typ->form, 0); OPM_LogWLn(); break; } @@ -1552,7 +1552,7 @@ static void OPT_OutConstant (OPT_Object obj) OPM_SymWLReal(obj->conval->realval); break; case 10: - OPT_OutName((void*)*obj->conval->ext, ((LONGINT)(256))); + OPT_OutName((void*)*obj->conval->ext, 256); break; case 11: break; @@ -1585,64 +1585,64 @@ static void OPT_OutObj (OPT_Object obj) OPT_FPrintErr(obj, 251); break; default: - OPM_LogWStr((CHAR*)"unhandled case at OutObj, obj^.history = ", (LONGINT)42); - OPM_LogWNum(obj->history, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case at OutObj, obj^.history = ", 42); + OPM_LogWNum(obj->history, 0); OPM_LogWLn(); break; } switch (obj->mode) { case 3: OPT_OutConstant(obj); - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); break; case 5: if (obj->typ->strobj == obj) { - OPM_SymWInt(((LONGINT)(19))); + OPM_SymWInt(19); OPT_OutStr(obj->typ); } else { - OPM_SymWInt(((LONGINT)(20))); + OPM_SymWInt(20); OPT_OutStr(obj->typ); - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); } break; case 1: if (obj->vis == 2) { - OPM_SymWInt(((LONGINT)(22))); + OPM_SymWInt(22); } else { - OPM_SymWInt(((LONGINT)(21))); + OPM_SymWInt(21); } OPT_OutStr(obj->typ); - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); if (obj->typ->strobj == NIL || obj->typ->strobj->name[0] == 0x00) { OPM_FPrint(&OPT_expCtxt.reffp, obj->typ->ref); } break; case 7: - OPM_SymWInt(((LONGINT)(31))); + OPM_SymWInt(31); OPT_OutSign(obj->typ, obj->link); - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); break; case 10: - OPM_SymWInt(((LONGINT)(32))); + OPM_SymWInt(32); OPT_OutSign(obj->typ, obj->link); - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); break; case 9: - OPM_SymWInt(((LONGINT)(33))); + OPM_SymWInt(33); OPT_OutSign(obj->typ, obj->link); ext = obj->conval->ext; - j = (int)(*ext)[0]; + j = (*ext)[0]; i = 1; OPM_SymWInt(j); while (i <= j) { - OPM_SymWCh((*ext)[__X(i, ((LONGINT)(256)))]); + OPM_SymWCh((*ext)[__X(i, 256)]); i += 1; } - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); break; default: - OPM_LogWStr((CHAR*)"unhandled case at OutObj, obj.mode = ", (LONGINT)38); - OPM_LogWNum(obj->mode, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case at OutObj, obj.mode = ", 38); + OPM_LogWNum(obj->mode, 0); OPM_LogWLn(); break; } @@ -1663,17 +1663,17 @@ void OPT_Export (BOOLEAN *ext, BOOLEAN *new) OPT_Import((CHAR*)"@self", OPT_SelfName, &done); OPT_nofGmod = nofmod; if (OPM_noerr) { - OPM_NewSym((void*)OPT_SelfName, ((LONGINT)(256))); + OPM_NewSym((void*)OPT_SelfName, 256); if (OPM_noerr) { - OPM_SymWInt(((LONGINT)(16))); - OPT_OutName((void*)OPT_SelfName, ((LONGINT)(256))); + OPM_SymWInt(16); + OPT_OutName((void*)OPT_SelfName, 256); OPT_expCtxt.reffp = 0; OPT_expCtxt.ref = 16; OPT_expCtxt.nofm = 1; OPT_expCtxt.locmno[0] = 0; i = 1; while (i < 64) { - OPT_expCtxt.locmno[__X(i, ((LONGINT)(64)))] = -1; + OPT_expCtxt.locmno[__X(i, 64)] = -1; i += 1; } OPT_OutObj(OPT_topScope->right); @@ -1874,11 +1874,11 @@ export void *OPT__init(void) OPT_EnterTyp((CHAR*)"SET", 9, OPM_SetSize, &OPT_settyp); OPT_EnterTyp((CHAR*)"REAL", 7, OPM_RealSize, &OPT_realtyp); OPT_EnterTyp((CHAR*)"INTEGER", 5, OPM_IntSize, &OPT_inttyp); - OPT_EnterTyp((CHAR*)"LONGINT", 6, OPM_LIntSize, &OPT_linttyp); + OPT_EnterTyp((CHAR*)"LONGINT", 5, OPM_LIntSize, &OPT_linttyp); OPT_EnterTyp((CHAR*)"LONGREAL", 8, OPM_LRealSize, &OPT_lrltyp); OPT_EnterTyp((CHAR*)"SHORTINT", 4, OPM_SIntSize, &OPT_sinttyp); - OPT_EnterBoolConst((CHAR*)"FALSE", ((LONGINT)(0))); - OPT_EnterBoolConst((CHAR*)"TRUE", ((LONGINT)(1))); + OPT_EnterBoolConst((CHAR*)"FALSE", 0); + OPT_EnterBoolConst((CHAR*)"TRUE", 1); OPT_EnterProc((CHAR*)"HALT", 0); OPT_EnterProc((CHAR*)"NEW", 1); OPT_EnterProc((CHAR*)"ABS", 2); diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index f6206e42..3e352ca3 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index 03b675a9..75adb37c 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPC.h" #include "OPM.h" @@ -36,9 +36,10 @@ static void OPV_Len (OPT_Node n, LONGINT dim); export void OPV_Module (OPT_Node prog); static LONGINT OPV_NaturalAlignment (LONGINT size, LONGINT max); static void OPV_NewArr (OPT_Node d, OPT_Node x); +static void OPV_ParIntLiteral (LONGINT n, LONGINT size); static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, INTEGER comp); static BOOLEAN OPV_SideEffects (OPT_Node n); -static void OPV_SizeCast (LONGINT size); +static void OPV_SizeCast (LONGINT from, LONGINT to); static void OPV_Stamp (OPS_Name s); static OPT_Object OPV_SuperProc (OPT_Node n); static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported); @@ -86,7 +87,7 @@ void OPV_TypSize (OPT_Struct typ) base = OPC_SizeAlignment(OPM_RecSize); } else { OPV_TypSize(btyp); - offset = btyp->size - (int)__ASHR(btyp->sysflag, 8); + offset = btyp->size - __ASHR(btyp->sysflag, 8); base = btyp->align; } fld = typ->link; @@ -117,7 +118,7 @@ void OPV_TypSize (OPT_Struct typ) } typ->size = offset; typ->align = base; - typ->sysflag = __MASK(typ->sysflag, -256) + (int)__ASHL(offset - off0, 8); + typ->sysflag = __MASK(typ->sysflag, -256) + __ASHL(offset - off0, 8); } else if (c == 2) { OPV_TypSize(typ->BaseTyp); typ->size = typ->n * typ->BaseTyp->size; @@ -196,27 +197,27 @@ static void OPV_Stamp (OPS_Name s) OPV_stamp += 1; i = 0; j = OPV_stamp; - while (s[__X(i, ((LONGINT)(256)))] != 0x00) { + while (s[__X(i, 256)] != 0x00) { i += 1; } if (i > 25) { i = 25; } - s[__X(i, ((LONGINT)(256)))] = '_'; - s[__X(i + 1, ((LONGINT)(256)))] = '_'; + s[__X(i, 256)] = '_'; + s[__X(i + 1, 256)] = '_'; i += 2; k = 0; do { - n[__X(k, ((LONGINT)(10)))] = (CHAR)((int)__MOD(j, 10) + 48); + n[__X(k, 10)] = (CHAR)((int)__MOD(j, 10) + 48); j = __DIV(j, 10); k += 1; } while (!(j == 0)); do { k -= 1; - s[__X(i, ((LONGINT)(256)))] = n[__X(k, ((LONGINT)(10)))]; + s[__X(i, 256)] = n[__X(k, 10)]; i += 1; } while (!(k == 0)); - s[__X(i, ((LONGINT)(256)))] = 0x00; + s[__X(i, 256)] = 0x00; } static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported) @@ -258,7 +259,7 @@ static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exporte } scope = obj->scope; scope->leaf = 1; - __COPY(obj->name, scope->name, ((LONGINT)(256))); + __COPY(obj->name, scope->name, 256); OPV_Stamp(scope->name); if (mode == 9) { obj->adr = 1; @@ -338,8 +339,8 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN return _o_result; break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Nmop, subclass = ", (LONGINT)55); - OPM_LogWNum(subclass, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Nmop, subclass = ", 55); + OPM_LogWNum(subclass, 0); OPM_LogWLn(); break; } @@ -408,8 +409,8 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN return _o_result; break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Ndop, subclass = ", (LONGINT)55); - OPM_LogWNum(subclass, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Ndop, subclass = ", 55); + OPM_LogWNum(subclass, 0); OPM_LogWLn(); break; } @@ -423,8 +424,8 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN return _o_result; break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence, class = ", (LONGINT)43); - OPM_LogWNum(class, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence, class = ", 43); + OPM_LogWNum(class, 0); OPM_LogWLn(); break; } @@ -439,7 +440,7 @@ static void OPV_Len (OPT_Node n, LONGINT dim) } if ((n->class == 3 && n->typ->comp == 3)) { OPV_design(n->left, 10); - OPM_WriteString((CHAR*)"->len[", (LONGINT)7); + OPM_WriteString((CHAR*)"->len[", 7); OPM_WriteInt(dim); OPM_Write(']'); } else { @@ -463,7 +464,7 @@ static BOOLEAN OPV_SideEffects (OPT_Node n) static void OPV_Entier (OPT_Node n, INTEGER prec) { if (__IN(n->typ->form, 0x0180)) { - OPM_WriteString((CHAR*)"__ENTIER(", (LONGINT)10); + OPM_WriteString((CHAR*)"__ENTIER(", 10); OPV_expr(n, -1); OPM_Write(')'); } else { @@ -471,12 +472,28 @@ static void OPV_Entier (OPT_Node n, INTEGER prec) } } -static void OPV_SizeCast (LONGINT size) +static void OPV_SizeCast (LONGINT from, LONGINT to) { - if (size <= 4) { - OPM_WriteString((CHAR*)"(int)", (LONGINT)6); - } else { - OPM_WriteString((CHAR*)"(SYSTEM_INT64)", (LONGINT)15); + if ((from != to && (from > 4 || to > 4))) { + switch (to) { + case 1: + OPM_WriteString((CHAR*)"(SYSTEM_INT8)", 14); + break; + case 2: + OPM_WriteString((CHAR*)"(SYSTEM_INT16)", 15); + break; + case 4: + OPM_WriteString((CHAR*)"(SYSTEM_INT32)", 15); + break; + case 8: + OPM_WriteString((CHAR*)"(SYSTEM_INT64)", 15); + break; + default: + OPM_LogWStr((CHAR*)"Unhandled case in OPC.SizeCast, to = ", 38); + OPM_LogWNum(to, 1); + OPM_LogWLn(); + break; + } } } @@ -486,29 +503,27 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec) from = n->typ->form; to = newtype->form; if (to == 9) { - OPM_WriteString((CHAR*)"__SETOF(", (LONGINT)9); + OPM_WriteString((CHAR*)"__SETOF(", 9); OPV_Entier(n, -1); OPM_Write(')'); } else if (__IN(to, 0x70)) { if ((newtype->size < n->typ->size && __IN(2, OPM_opt))) { - OPM_WriteString((CHAR*)"__SHORT", (LONGINT)8); + OPM_WriteString((CHAR*)"__SHORT", 8); if (OPV_SideEffects(n)) { OPM_Write('F'); } OPM_Write('('); OPV_Entier(n, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(OPM_SignedMaximum(newtype->size) + 1); OPM_Write(')'); } else { - if (newtype->size != n->typ->size) { - OPV_SizeCast(newtype->size); - } + OPV_SizeCast(n->typ->size, newtype->size); OPV_Entier(n, 9); } } else if (to == 3) { if (__IN(2, OPM_opt)) { - OPM_WriteString((CHAR*)"__CHR", (LONGINT)6); + OPM_WriteString((CHAR*)"__CHR", 6); if (OPV_SideEffects(n)) { OPM_Write('F'); } @@ -516,7 +531,7 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec) OPV_Entier(n, -1); OPM_Write(')'); } else { - OPM_WriteString((CHAR*)"(CHAR)", (LONGINT)7); + OPM_WriteString((CHAR*)"(CHAR)", 7); OPV_Entier(n, 9); } } else { @@ -527,14 +542,14 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec) static void OPV_TypeOf (OPT_Node n) { if (n->typ->form == 13) { - OPM_WriteString((CHAR*)"__TYPEOF(", (LONGINT)10); + OPM_WriteString((CHAR*)"__TYPEOF(", 10); OPV_expr(n, -1); OPM_Write(')'); } else if (__IN(n->class, 0x15)) { OPC_Andent(n->typ); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } else if (n->class == 3) { - OPM_WriteString((CHAR*)"__TYPEOF(", (LONGINT)10); + OPM_WriteString((CHAR*)"__TYPEOF(", 10); OPV_expr(n->left, -1); OPM_Write(')'); } else if (n->class == 5) { @@ -552,12 +567,12 @@ static void OPV_Index (OPT_Node n, OPT_Node d, INTEGER prec, INTEGER dim) OPV_expr(n->right, prec); } else { if (OPV_SideEffects(n->right)) { - OPM_WriteString((CHAR*)"__XF(", (LONGINT)6); + OPM_WriteString((CHAR*)"__XF(", 6); } else { - OPM_WriteString((CHAR*)"__X(", (LONGINT)5); + OPM_WriteString((CHAR*)"__X(", 5); } OPV_expr(n->right, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_Len(d, dim); OPM_Write(')'); } @@ -569,12 +584,12 @@ static void OPV_design (OPT_Node n, INTEGER prec) OPT_Struct typ = NIL; INTEGER class, designPrec, comp; OPT_Node d = NIL, x = NIL; - INTEGER dims, i, _for__27; + INTEGER dims, i, _for__28; comp = n->typ->comp; obj = n->obj; class = n->class; designPrec = OPV_Precedence(class, n->subcl, n->typ->form, comp); - if ((((((class == 0 && obj->mnolev > 0)) && (int)obj->mnolev != OPM_level)) && prec == 10)) { + if ((((((class == 0 && obj->mnolev > 0)) && obj->mnolev != OPM_level)) && prec == 10)) { designPrec = 9; } if (prec > designPrec) { @@ -599,7 +614,7 @@ static void OPV_design (OPT_Node n, INTEGER prec) case 2: if (n->left->class == 3) { OPV_design(n->left->left, designPrec); - OPM_WriteString((CHAR*)"->", (LONGINT)3); + OPM_WriteString((CHAR*)"->", 3); } else { OPV_design(n->left, designPrec); OPM_Write('.'); @@ -609,7 +624,7 @@ static void OPV_design (OPT_Node n, INTEGER prec) case 3: if (n->typ->comp == 3) { OPV_design(n->left, 10); - OPM_WriteString((CHAR*)"->data", (LONGINT)7); + OPM_WriteString((CHAR*)"->data", 7); } else { OPM_Write('*'); OPV_design(n->left, designPrec); @@ -636,25 +651,25 @@ static void OPV_design (OPT_Node n, INTEGER prec) while (x != d) { if (x->left != d) { OPV_Index(x, d, 7, i); - OPM_WriteString((CHAR*)" + ", (LONGINT)4); + OPM_WriteString((CHAR*)" + ", 4); OPV_Len(d, i); - OPM_WriteString((CHAR*)" * (", (LONGINT)5); + OPM_WriteString((CHAR*)" * (", 5); i -= 1; } else { OPV_Index(x, d, -1, i); } x = x->left; } - _for__27 = dims; + _for__28 = dims; i = 1; - while (i <= _for__27) { + while (i <= _for__28) { OPM_Write(')'); i += 1; } if (n->typ->comp == 3) { OPM_Write(')'); - while ((int)i < __ASHR(d->typ->size - 4, 2)) { - OPM_WriteString((CHAR*)" * ", (LONGINT)4); + while (i < __ASHR(d->typ->size - 4, 2)) { + OPM_WriteString((CHAR*)" * ", 4); OPV_Len(d, i); i += 1; } @@ -672,33 +687,33 @@ static void OPV_design (OPT_Node n, INTEGER prec) obj = n->left->obj; if (__IN(3, OPM_opt)) { if (typ->comp == 4) { - OPM_WriteString((CHAR*)"__GUARDR(", (LONGINT)10); - if ((int)obj->mnolev != OPM_level) { - OPM_WriteStringVar((void*)obj->scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"__curr->", (LONGINT)9); + OPM_WriteString((CHAR*)"__GUARDR(", 10); + if (obj->mnolev != OPM_level) { + OPM_WriteStringVar((void*)obj->scope->name, 256); + OPM_WriteString((CHAR*)"__curr->", 9); OPC_Ident(obj); } else { OPC_Ident(obj); } } else { if (typ->BaseTyp->strobj == NIL) { - OPM_WriteString((CHAR*)"__GUARDA(", (LONGINT)10); + OPM_WriteString((CHAR*)"__GUARDA(", 10); } else { - OPM_WriteString((CHAR*)"__GUARDP(", (LONGINT)10); + OPM_WriteString((CHAR*)"__GUARDP(", 10); } OPV_expr(n->left, -1); typ = typ->BaseTyp; } - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Andent(typ); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(typ->extlev); OPM_Write(')'); } else { if (typ->comp == 4) { - OPM_WriteString((CHAR*)"*(", (LONGINT)3); + OPM_WriteString((CHAR*)"*(", 3); OPC_Ident(typ->strobj); - OPM_WriteString((CHAR*)"*)", (LONGINT)3); + OPM_WriteString((CHAR*)"*)", 3); OPC_CompleteIdent(obj); } else { OPM_Write('('); @@ -711,15 +726,15 @@ static void OPV_design (OPT_Node n, INTEGER prec) case 6: if (__IN(3, OPM_opt)) { if (n->left->class == 1) { - OPM_WriteString((CHAR*)"__GUARDEQR(", (LONGINT)12); + OPM_WriteString((CHAR*)"__GUARDEQR(", 12); OPC_CompleteIdent(n->left->obj); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_TypeOf(n->left); } else { - OPM_WriteString((CHAR*)"__GUARDEQP(", (LONGINT)12); + OPM_WriteString((CHAR*)"__GUARDEQP(", 12); OPV_expr(n->left->left, -1); } - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Ident(n->left->typ->strobj); OPM_Write(')'); } else { @@ -732,8 +747,8 @@ static void OPV_design (OPT_Node n, INTEGER prec) } break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.design, class = ", (LONGINT)39); - OPM_LogWNum(class, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.design, class = ", 39); + OPM_LogWNum(class, 0); OPM_LogWLn(); break; } @@ -742,6 +757,15 @@ static void OPV_design (OPT_Node n, INTEGER prec) } } +static void OPV_ParIntLiteral (LONGINT n, LONGINT size) +{ + if (OPV_ansi) { + OPM_WriteInt(n); + } else { + OPC_IntLiteral(n, size); + } +} + static void OPV_ActualPar (OPT_Node n, OPT_Object fp) { OPT_Struct typ = NIL, aptyp = NIL; @@ -756,81 +780,75 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) if ((((mode == 2 && n->class == 11)) && n->subcl == 29)) { OPM_Write('('); OPC_Ident(n->typ->strobj); - OPM_WriteString((CHAR*)"*)", (LONGINT)3); + OPM_WriteString((CHAR*)"*)", 3); prec = 10; } if (!__IN(n->typ->comp, 0x0c)) { if (mode == 2) { if ((OPV_ansi && typ != n->typ)) { - OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(void*)", 8); } OPM_Write('&'); prec = 9; } else if (OPV_ansi) { if ((__IN(comp, 0x0c) && n->class == 7)) { - OPM_WriteString((CHAR*)"(CHAR*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(CHAR*)", 8); } else if ((((form == 13 && typ != n->typ)) && n->typ != OPT_niltyp)) { - OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(void*)", 8); } } else { if ((__IN(form, 0x0180) && __IN(n->typ->form, 0x70))) { - OPM_WriteString((CHAR*)"(double)", (LONGINT)9); - prec = 9; - } else if ((form == 6 && n->typ->form < 6)) { - OPM_WriteString((CHAR*)"(LONGINT)", (LONGINT)10); + OPM_WriteString((CHAR*)"(double)", 9); prec = 9; + } else if (__IN(form, 0x70)) { + OPV_SizeCast(n->typ->size, typ->size); } } } else if (OPV_ansi) { if ((((mode == 2 && typ != n->typ)) && prec == -1)) { - OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(void*)", 8); } } if ((((mode == 2 && n->class == 11)) && n->subcl == 29)) { OPV_expr(n->left, prec); - } else if ((((((form == 6 && n->class == 7)) && n->conval->intval <= OPM_SignedMaximum(OPM_IntSize))) && n->conval->intval >= OPM_SignedMinimum(OPM_IntSize))) { - OPM_WriteString((CHAR*)"((LONGINT)(", (LONGINT)12); - OPV_expr(n, prec); - OPM_WriteString((CHAR*)"))", (LONGINT)3); + } else if ((__IN(form, 0x70) && n->class == 7)) { + OPV_ParIntLiteral(n->conval->intval, n->typ->size); } else { OPV_expr(n, prec); } if ((comp == 4 && mode == 2)) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_TypeOf(n); } else if (comp == 3) { if (n->class == 7) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); - OPM_WriteString((CHAR*)"(LONGINT)", (LONGINT)10); - OPM_WriteInt(n->conval->intval2); + OPM_WriteString((CHAR*)", ", 3); + OPV_ParIntLiteral(n->conval->intval2, OPM_PointerSize); } else { aptyp = n->typ; dim = 0; while ((typ->comp == 3 && typ->BaseTyp->form != 1)) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_Len(n, dim); typ = typ->BaseTyp; aptyp = aptyp->BaseTyp; dim += 1; } if ((typ->comp == 3 && typ->BaseTyp->form == 1)) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); while (aptyp->comp == 3) { OPV_Len(n, dim); - OPM_WriteString((CHAR*)" * ", (LONGINT)4); + OPM_WriteString((CHAR*)" * ", 4); dim += 1; aptyp = aptyp->BaseTyp; } - OPM_WriteString((CHAR*)"((LONGINT)(", (LONGINT)12); - OPM_WriteInt(aptyp->size); - OPM_WriteString((CHAR*)"))", (LONGINT)3); + OPV_ParIntLiteral(aptyp->size, OPM_PointerSize); } } } n = n->link; fp = fp->link; if (n != NIL) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); } } OPM_Write(')'); @@ -870,9 +888,9 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPC_Constant(n->conval, form); break; case 10: - OPM_WriteString((CHAR*)"__SETRNG(", (LONGINT)10); + OPM_WriteString((CHAR*)"__SETRNG(", 10); OPV_expr(l, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(r, -1); OPM_Write(')'); break; @@ -893,16 +911,16 @@ static void OPV_expr (OPT_Node n, INTEGER prec) case 16: typ = n->obj->typ; if (l->typ->comp == 4) { - OPM_WriteString((CHAR*)"__IS(", (LONGINT)6); + OPM_WriteString((CHAR*)"__IS(", 6); OPC_TypeOf(l->obj); } else { - OPM_WriteString((CHAR*)"__ISP(", (LONGINT)7); + OPM_WriteString((CHAR*)"__ISP(", 7); OPV_expr(l, -1); typ = typ->BaseTyp; } - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Andent(typ); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(typ->extlev); OPM_Write(')'); break; @@ -912,31 +930,31 @@ static void OPV_expr (OPT_Node n, INTEGER prec) case 21: if (OPV_SideEffects(l)) { if (l->typ->form < 7) { - if (l->typ->form < 6) { - OPM_WriteString((CHAR*)"(int)", (LONGINT)6); + if (l->typ->size <= 4) { + OPM_WriteString((CHAR*)"(int)", 6); } - OPM_WriteString((CHAR*)"__ABSF(", (LONGINT)8); + OPM_WriteString((CHAR*)"__ABSF(", 8); } else { - OPM_WriteString((CHAR*)"__ABSFD(", (LONGINT)9); + OPM_WriteString((CHAR*)"__ABSFD(", 9); } } else { - OPM_WriteString((CHAR*)"__ABS(", (LONGINT)7); + OPM_WriteString((CHAR*)"__ABS(", 7); } OPV_expr(l, -1); OPM_Write(')'); break; case 22: - OPM_WriteString((CHAR*)"__CAP(", (LONGINT)7); + OPM_WriteString((CHAR*)"__CAP(", 7); OPV_expr(l, -1); OPM_Write(')'); break; case 23: - OPM_WriteString((CHAR*)"__ODD(", (LONGINT)7); + OPM_WriteString((CHAR*)"__ODD(", 7); OPV_expr(l, -1); OPM_Write(')'); break; case 24: - OPM_WriteString((CHAR*)"(LONGINT)(SYSTEM_ADRINT)", (LONGINT)25); + OPM_WriteString((CHAR*)"(SYSTEM_ADRINT)", 16); if (l->class == 1) { OPC_CompleteIdent(l->obj); } else { @@ -952,13 +970,13 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPC_Ident(n->typ->strobj); OPM_Write(')'); if (__IN(n->typ->form, 0x6000) || __IN(l->typ->form, 0x6000)) { - OPM_WriteString((CHAR*)"(SYSTEM_ADRINT)", (LONGINT)16); + OPM_WriteString((CHAR*)"(SYSTEM_ADRINT)", 16); } OPV_expr(l, exprPrec); } else { - OPM_WriteString((CHAR*)"__VAL(", (LONGINT)7); + OPM_WriteString((CHAR*)"__VAL(", 7); OPC_Ident(n->typ->strobj); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(l, -1); OPM_Write(')'); } @@ -977,84 +995,84 @@ static void OPV_expr (OPT_Node n, INTEGER prec) case 28: case 3: case 4: switch (subclass) { case 15: - OPM_WriteString((CHAR*)"__IN(", (LONGINT)6); + OPM_WriteString((CHAR*)"__IN(", 6); break; case 17: if (r->class == 7) { if (r->conval->intval >= 0) { - OPM_WriteString((CHAR*)"__ASHL(", (LONGINT)8); + OPM_WriteString((CHAR*)"__ASHL(", 8); } else { - OPM_WriteString((CHAR*)"__ASHR(", (LONGINT)8); + OPM_WriteString((CHAR*)"__ASHR(", 8); } } else if (OPV_SideEffects(r)) { - OPM_WriteString((CHAR*)"__ASHF(", (LONGINT)8); + OPM_WriteString((CHAR*)"__ASHF(", 8); } else { - OPM_WriteString((CHAR*)"__ASH(", (LONGINT)7); + OPM_WriteString((CHAR*)"__ASH(", 7); } break; case 18: - OPM_WriteString((CHAR*)"__MASK(", (LONGINT)8); + OPM_WriteString((CHAR*)"__MASK(", 8); break; case 26: - OPM_WriteString((CHAR*)"__BIT(", (LONGINT)7); + OPM_WriteString((CHAR*)"__BIT(", 7); break; case 27: if (r->class == 7) { if (r->conval->intval >= 0) { - OPM_WriteString((CHAR*)"__LSHL(", (LONGINT)8); + OPM_WriteString((CHAR*)"__LSHL(", 8); } else { - OPM_WriteString((CHAR*)"__LSHR(", (LONGINT)8); + OPM_WriteString((CHAR*)"__LSHR(", 8); } } else { - OPM_WriteString((CHAR*)"__LSH(", (LONGINT)7); + OPM_WriteString((CHAR*)"__LSH(", 7); } break; case 28: if (r->class == 7) { if (r->conval->intval >= 0) { - OPM_WriteString((CHAR*)"__ROTL(", (LONGINT)8); + OPM_WriteString((CHAR*)"__ROTL(", 8); } else { - OPM_WriteString((CHAR*)"__ROTR(", (LONGINT)8); + OPM_WriteString((CHAR*)"__ROTR(", 8); } } else { - OPM_WriteString((CHAR*)"__ROT(", (LONGINT)7); + OPM_WriteString((CHAR*)"__ROT(", 7); } break; case 3: if (OPV_SideEffects(n)) { - if (form < 6) { - OPM_WriteString((CHAR*)"(int)", (LONGINT)6); + if (n->typ->size <= 4) { + OPM_WriteString((CHAR*)"(int)", 6); } - OPM_WriteString((CHAR*)"__DIVF(", (LONGINT)8); + OPM_WriteString((CHAR*)"__DIVF(", 8); } else { - OPM_WriteString((CHAR*)"__DIV(", (LONGINT)7); + OPM_WriteString((CHAR*)"__DIV(", 7); } break; case 4: - if (form < 6) { - OPM_WriteString((CHAR*)"(int)", (LONGINT)6); + if (n->typ->size <= 4) { + OPM_WriteString((CHAR*)"(int)", 6); } if (OPV_SideEffects(n)) { - OPM_WriteString((CHAR*)"__MODF(", (LONGINT)8); + OPM_WriteString((CHAR*)"__MODF(", 8); } else { - OPM_WriteString((CHAR*)"__MOD(", (LONGINT)7); + OPM_WriteString((CHAR*)"__MOD(", 7); } break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, subclass = ", (LONGINT)40); - OPM_LogWNum(subclass, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, subclass = ", 40); + OPM_LogWNum(subclass, 0); OPM_LogWLn(); break; } OPV_expr(l, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); if ((((__IN(subclass, 0x18020000) && r->class == 7)) && r->conval->intval < 0)) { OPM_WriteInt(-r->conval->intval); } else { OPV_expr(r, -1); } if (__IN(subclass, 0x18000000)) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Ident(l->typ->strobj); } OPM_Write(')'); @@ -1062,9 +1080,9 @@ static void OPV_expr (OPT_Node n, INTEGER prec) case 9: case 10: case 11: case 12: case 13: case 14: if (__IN(l->typ->form, 0x8400)) { - OPM_WriteString((CHAR*)"__STRCMP(", (LONGINT)10); + OPM_WriteString((CHAR*)"__STRCMP(", 10); OPV_expr(l, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(r, -1); OPM_Write(')'); OPC_Cmp(subclass); @@ -1074,7 +1092,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPC_Cmp(subclass); typ = l->typ; if ((((((typ->form == 13 && r->typ->form != 11)) && r->typ != typ)) && r->typ != OPT_sysptrtyp)) { - OPM_WriteString((CHAR*)"(void *) ", (LONGINT)10); + OPM_WriteString((CHAR*)"(void *) ", 10); } OPV_expr(r, exprPrec); } @@ -1087,16 +1105,16 @@ static void OPV_expr (OPT_Node n, INTEGER prec) switch (subclass) { case 1: if (form == 9) { - OPM_WriteString((CHAR*)" & ", (LONGINT)4); + OPM_WriteString((CHAR*)" & ", 4); } else { - OPM_WriteString((CHAR*)" * ", (LONGINT)4); + OPM_WriteString((CHAR*)" * ", 4); } break; case 2: if (form == 9) { - OPM_WriteString((CHAR*)" ^ ", (LONGINT)4); + OPM_WriteString((CHAR*)" ^ ", 4); } else { - OPM_WriteString((CHAR*)" / ", (LONGINT)4); + OPM_WriteString((CHAR*)" / ", 4); if (r->obj == NIL || __IN(r->obj->typ->form, 0x70)) { OPM_Write('('); OPC_Ident(n->typ->strobj); @@ -1105,28 +1123,28 @@ static void OPV_expr (OPT_Node n, INTEGER prec) } break; case 5: - OPM_WriteString((CHAR*)" && ", (LONGINT)5); + OPM_WriteString((CHAR*)" && ", 5); break; case 6: if (form == 9) { - OPM_WriteString((CHAR*)" | ", (LONGINT)4); + OPM_WriteString((CHAR*)" | ", 4); } else { - OPM_WriteString((CHAR*)" + ", (LONGINT)4); + OPM_WriteString((CHAR*)" + ", 4); } break; case 7: if (form == 9) { - OPM_WriteString((CHAR*)" & ~", (LONGINT)5); + OPM_WriteString((CHAR*)" & ~", 5); } else { - OPM_WriteString((CHAR*)" - ", (LONGINT)4); + OPM_WriteString((CHAR*)" - ", 4); } break; case 8: - OPM_WriteString((CHAR*)" || ", (LONGINT)5); + OPM_WriteString((CHAR*)" || ", 5); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, subclass = ", (LONGINT)40); - OPM_LogWNum(subclass, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, subclass = ", 40); + OPM_LogWNum(subclass, 0); OPM_LogWLn(); break; } @@ -1142,7 +1160,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) if (l->subcl == 1) { proc = OPV_SuperProc(n); } else { - OPM_WriteString((CHAR*)"__", (LONGINT)3); + OPM_WriteString((CHAR*)"__", 3); proc = OPC_BaseTProc(l->obj); } OPC_Ident(proc); @@ -1171,7 +1189,7 @@ static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) LONGINT adr; if_ = n->left; while (if_ != NIL) { - OPM_WriteString((CHAR*)"if ", (LONGINT)4); + OPM_WriteString((CHAR*)"if ", 4); OPV_expr(if_->left, 12); OPM_Write(' '); OPC_BegBlk(); @@ -1182,9 +1200,9 @@ static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) if (typ->comp == 4) { OPC_BegStat(); OPC_Ident(if_->left->obj); - OPM_WriteString((CHAR*)" *", (LONGINT)3); - OPM_WriteString(obj->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"__ = (void*)", (LONGINT)13); + OPM_WriteString((CHAR*)" *", 3); + OPM_WriteString(obj->name, 256); + OPM_WriteString((CHAR*)"__ = (void*)", 13); obj->adr = 0; OPC_CompleteIdent(obj); OPC_EndStat(); @@ -1200,13 +1218,13 @@ static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) if_ = if_->link; if ((if_ != NIL || n->right != NIL) || withtrap) { OPC_EndBlk0(); - OPM_WriteString((CHAR*)" else ", (LONGINT)7); + OPM_WriteString((CHAR*)" else ", 7); } else { OPC_EndBlk(); } } if (withtrap) { - OPM_WriteString((CHAR*)"__WITHCHK", (LONGINT)10); + OPM_WriteString((CHAR*)"__WITHCHK", 10); OPC_EndStat(); } else if (n->right != NIL) { OPC_BegBlk(); @@ -1220,7 +1238,7 @@ static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc) OPT_Node switchCase = NIL, label = NIL; LONGINT low, high; INTEGER form, i; - OPM_WriteString((CHAR*)"switch ", (LONGINT)8); + OPM_WriteString((CHAR*)"switch ", 8); OPV_expr(n->left, 12); OPM_Write(' '); OPC_BegBlk(); @@ -1252,22 +1270,22 @@ static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc) OPC_Indent(1); OPV_stat(switchCase->right, outerProc); OPC_BegStat(); - OPM_WriteString((CHAR*)"break", (LONGINT)6); + OPM_WriteString((CHAR*)"break", 6); OPC_EndStat(); OPC_Indent(-1); switchCase = switchCase->link; } OPC_BegStat(); - OPM_WriteString((CHAR*)"default: ", (LONGINT)10); + OPM_WriteString((CHAR*)"default: ", 10); if (n->right->conval->setval != 0x0) { OPC_Indent(1); OPM_WriteLn(); OPV_stat(n->right->right, outerProc); OPC_BegStat(); - OPM_WriteString((CHAR*)"break", (LONGINT)6); + OPM_WriteString((CHAR*)"break", 6); OPC_Indent(-1); } else { - OPM_WriteString((CHAR*)"__CASECHK", (LONGINT)10); + OPM_WriteString((CHAR*)"__CASECHK", 10); } OPC_EndStat(); OPC_EndBlk(); @@ -1297,44 +1315,40 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) base = base->BaseTyp; } OPV_design(d, -1); - OPM_WriteString((CHAR*)" = __NEWARR(", (LONGINT)13); + OPM_WriteString((CHAR*)" = __NEWARR(", 13); while (base->comp == 2) { nofdim += 1; base = base->BaseTyp; } if ((base->comp == 4 && OPC_NofPtrs(base) != 0)) { OPC_Ident(base->strobj); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } else if (base->form == 13) { - OPM_WriteString((CHAR*)"POINTER__typ", (LONGINT)13); + OPM_WriteString((CHAR*)"POINTER__typ", 13); } else { - OPM_WriteString((CHAR*)"NIL", (LONGINT)4); + OPM_WriteString((CHAR*)"NIL", 4); } - OPM_WriteString((CHAR*)", ", (LONGINT)3); - OPM_WriteString((CHAR*)"((LONGINT)(", (LONGINT)12); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(base->size); - OPM_WriteString((CHAR*)"))", (LONGINT)3); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(OPC_BaseAlignment(base)); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(nofdim); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(nofdyn); while (typ != base) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); if (typ->comp == 3) { if (x->class == 7) { - OPM_WriteString((CHAR*)"(LONGINT)(", (LONGINT)11); - OPV_expr(x, -1); - OPM_WriteString((CHAR*)")", (LONGINT)2); + OPC_IntLiteral(x->conval->intval, OPM_PointerSize); } else { - OPM_WriteString((CHAR*)"(LONGINT)", (LONGINT)10); + OPM_WriteString((CHAR*)"((SYSTEM_ADRINT)(", 18); OPV_expr(x, 10); + OPM_WriteString((CHAR*)"))", 3); } x = x->link; } else { - OPM_WriteString((CHAR*)"(LONGINT)", (LONGINT)10); - OPM_WriteInt(typ->n); + OPC_IntLiteral(typ->n, OPM_PointerSize); } typ = typ->BaseTyp; } @@ -1377,7 +1391,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPV_DefineTDescs(n->right); OPC_EnterBody(); OPV_InitTDescs(n->right); - OPM_WriteString((CHAR*)"/* BEGIN */", (LONGINT)12); + OPM_WriteString((CHAR*)"/* BEGIN */", 12); OPM_WriteLn(); OPV_stat(n->right, outerProc); OPC_ExitBody(); @@ -1403,11 +1417,11 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) l = n->left; r = n->right; if (l->typ->comp == 2) { - OPM_WriteString((CHAR*)"__MOVE(", (LONGINT)8); + OPM_WriteString((CHAR*)"__MOVE(", 8); OPV_expr(r, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(l, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); if (r->typ == OPT_stringtyp) { OPM_WriteInt(r->conval->intval2); } else { @@ -1420,13 +1434,13 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPV_design(l, -1); l->obj->adr = 1; if (r->typ->form != 11) { - OPM_WriteString((CHAR*)" = (void*)", (LONGINT)11); + OPM_WriteString((CHAR*)" = (void*)", 11); } else { - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteString((CHAR*)" = ", 4); } } else { OPV_design(l, -1); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteString((CHAR*)" = ", 4); } if (l->typ == r->typ) { OPV_expr(r, -1); @@ -1436,9 +1450,9 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPM_Write(')'); OPV_expr(r, -1); } else if (l->typ->comp == 4) { - OPM_WriteString((CHAR*)"*(", (LONGINT)3); + OPM_WriteString((CHAR*)"*(", 3); OPC_Andent(l->typ); - OPM_WriteString((CHAR*)"*)&", (LONGINT)4); + OPM_WriteString((CHAR*)"*)&", 4); OPV_expr(r, 9); } else { OPV_expr(r, -1); @@ -1447,11 +1461,11 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) break; case 1: if (n->left->typ->BaseTyp->comp == 4) { - OPM_WriteString((CHAR*)"__NEW(", (LONGINT)7); + OPM_WriteString((CHAR*)"__NEW(", 7); OPV_design(n->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Andent(n->left->typ->BaseTyp); - OPM_WriteString((CHAR*)")", (LONGINT)2); + OPM_WriteString((CHAR*)")", 2); } else if (__IN(n->left->typ->BaseTyp->comp, 0x0c)) { OPV_NewArr(n->left, n->right); } @@ -1464,43 +1478,43 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) case 15: case 16: OPV_expr(n->left, -1); OPC_SetInclude(n->subcl == 16); - OPM_WriteString((CHAR*)"__SETOF(", (LONGINT)9); + OPM_WriteString((CHAR*)"__SETOF(", 9); OPV_expr(n->right, -1); OPM_Write(')'); break; case 18: - OPM_WriteString((CHAR*)"__COPY(", (LONGINT)8); + OPM_WriteString((CHAR*)"__COPY(", 8); OPV_expr(n->right, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(n->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); - OPV_Len(n->left, ((LONGINT)(0))); + OPM_WriteString((CHAR*)", ", 3); + OPV_Len(n->left, 0); OPM_Write(')'); break; case 31: - OPM_WriteString((CHAR*)"__MOVE(", (LONGINT)8); + OPM_WriteString((CHAR*)"__MOVE(", 8); OPV_expr(n->right, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(n->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(n->right->link, -1); OPM_Write(')'); break; case 24: - OPM_WriteString((CHAR*)"__GET(", (LONGINT)7); + OPM_WriteString((CHAR*)"__GET(", 7); OPV_expr(n->right, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(n->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Ident(n->left->typ->strobj); OPM_Write(')'); break; case 25: - OPM_WriteString((CHAR*)"__PUT(", (LONGINT)7); + OPM_WriteString((CHAR*)"__PUT(", 7); OPV_expr(n->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(n->right, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Ident(n->right->typ->strobj); OPM_Write(')'); break; @@ -1508,15 +1522,15 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPM_err(200); break; case 30: - OPM_WriteString((CHAR*)"__SYSNEW(", (LONGINT)10); + OPM_WriteString((CHAR*)"__SYSNEW(", 10); OPV_design(n->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(n->right, -1); OPM_Write(')'); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, n^.subcl = ", (LONGINT)40); - OPM_LogWNum(n->subcl, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, n^.subcl = ", 40); + OPM_LogWNum(n->subcl, 0); OPM_LogWLn(); break; } @@ -1526,7 +1540,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) if (n->left->subcl == 1) { proc = OPV_SuperProc(n); } else { - OPM_WriteString((CHAR*)"__", (LONGINT)3); + OPM_WriteString((CHAR*)"__", 3); proc = OPC_BaseTProc(n->left->obj); } OPC_Ident(proc); @@ -1542,9 +1556,9 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) if (n->subcl != 32) { OPV_IfStat(n, 0, outerProc); } else if (OPV_assert) { - OPM_WriteString((CHAR*)"__ASSERT(", (LONGINT)10); + OPM_WriteString((CHAR*)"__ASSERT(", 10); OPV_expr(n->left->left->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(n->left->right->right->conval->intval); OPM_Write(')'); OPC_EndStat(); @@ -1557,7 +1571,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) break; case 22: OPV_exit.level += 1; - OPM_WriteString((CHAR*)"while ", (LONGINT)7); + OPM_WriteString((CHAR*)"while ", 7); OPV_expr(n->left, 12); OPM_Write(' '); OPC_BegBlk(); @@ -1567,11 +1581,11 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) break; case 23: OPV_exit.level += 1; - OPM_WriteString((CHAR*)"do ", (LONGINT)4); + OPM_WriteString((CHAR*)"do ", 4); OPC_BegBlk(); OPV_stat(n->left, outerProc); OPC_EndBlk0(); - OPM_WriteString((CHAR*)" while (!", (LONGINT)10); + OPM_WriteString((CHAR*)" while (!", 10); OPV_expr(n->right, 9); OPM_Write(')'); OPV_exit.level -= 1; @@ -1580,13 +1594,13 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) saved = OPV_exit; OPV_exit.level = 0; OPV_exit.label = -1; - OPM_WriteString((CHAR*)"for (;;) ", (LONGINT)10); + OPM_WriteString((CHAR*)"for (;;) ", 10); OPC_BegBlk(); OPV_stat(n->left, outerProc); OPC_EndBlk(); if (OPV_exit.label != -1) { OPC_BegStat(); - OPM_WriteString((CHAR*)"exit__", (LONGINT)7); + OPM_WriteString((CHAR*)"exit__", 7); OPM_WriteInt(OPV_exit.label); OPM_Write(':'); OPC_EndStat(); @@ -1595,39 +1609,39 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) break; case 25: if (OPV_exit.level == 0) { - OPM_WriteString((CHAR*)"break", (LONGINT)6); + OPM_WriteString((CHAR*)"break", 6); } else { if (OPV_exit.label == -1) { OPV_exit.label = OPV_nofExitLabels; OPV_nofExitLabels += 1; } - OPM_WriteString((CHAR*)"goto exit__", (LONGINT)12); + OPM_WriteString((CHAR*)"goto exit__", 12); OPM_WriteInt(OPV_exit.label); } break; case 26: if (OPM_level == 0) { if (OPV_mainprog) { - OPM_WriteString((CHAR*)"__FINI", (LONGINT)7); + OPM_WriteString((CHAR*)"__FINI", 7); } else { - OPM_WriteString((CHAR*)"__ENDMOD", (LONGINT)9); + OPM_WriteString((CHAR*)"__ENDMOD", 9); } } else { if (n->left != NIL) { - OPM_WriteString((CHAR*)"_o_result = ", (LONGINT)13); + OPM_WriteString((CHAR*)"_o_result = ", 13); if ((n->left->typ->form == 13 && n->obj->typ != n->left->typ)) { - OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(void*)", 8); OPV_expr(n->left, 10); } else { OPV_expr(n->left, -1); } - OPM_WriteString((CHAR*)";", (LONGINT)2); + OPM_WriteString((CHAR*)";", 2); OPM_WriteLn(); OPC_BegStat(); OPC_ExitProc(outerProc, 0, 0); - OPM_WriteString((CHAR*)"return _o_result", (LONGINT)17); + OPM_WriteString((CHAR*)"return _o_result", 17); } else { - OPM_WriteString((CHAR*)"return", (LONGINT)7); + OPM_WriteString((CHAR*)"return", 7); } } break; @@ -1638,8 +1652,8 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPC_Halt(n->right->conval->intval); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, n^.class = ", (LONGINT)40); - OPM_LogWNum(n->class, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, n^.class = ", 40); + OPM_LogWNum(n->class, 0); OPM_LogWLn(); break; } diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index 6926d6ac..0299d34b 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 9e1c6dfd..6ff2920b 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef @@ -229,7 +229,7 @@ void Platform_Init (INTEGER argc, LONGINT argvadr) Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; Platform_ArgCount = argc; - av = (Platform_ArgVecPtr)(SYSTEM_ADRINT)argvadr; + av = __VAL(Platform_ArgVecPtr, argvadr); Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; Platform_HeapInitHeap(); @@ -262,8 +262,8 @@ void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { - av = (Platform_ArgVec)(SYSTEM_ADRINT)Platform_ArgVector; - __COPY(*(*av)[__X(n, ((LONGINT)(1024)))], val, val__len); + av = __VAL(Platform_ArgVec, Platform_ArgVector); + __COPY(*(*av)[__X(n, 1024)], val, val__len); } } @@ -272,17 +272,17 @@ void Platform_GetIntArg (INTEGER n, LONGINT *val) CHAR s[64]; LONGINT k, d, i; s[0] = 0x00; - Platform_GetArg(n, (void*)s, ((LONGINT)(64))); + Platform_GetArg(n, (void*)s, 64); i = 0; if (s[0] == '-') { i = 1; } k = 0; - d = (int)s[__X(i, ((LONGINT)(64)))] - 48; + d = s[__X(i, 64)] - 48; while ((d >= 0 && d <= 9)) { k = k * 10 + d; i += 1; - d = (int)s[__X(i, ((LONGINT)(64)))] - 48; + d = s[__X(i, 64)] - 48; } if (s[0] == '-') { k = -k; @@ -300,10 +300,10 @@ INTEGER Platform_ArgPos (CHAR *s, LONGINT s__len) CHAR arg[256]; __DUP(s, s__len, CHAR); i = 0; - Platform_GetArg(i, (void*)arg, ((LONGINT)(256))); + Platform_GetArg(i, (void*)arg, 256); while ((i < Platform_ArgCount && __STRCMP(s, arg) != 0)) { i += 1; - Platform_GetArg(i, (void*)arg, ((LONGINT)(256))); + Platform_GetArg(i, (void*)arg, 256); } _o_result = i; __DEL(s); @@ -327,7 +327,7 @@ void Platform_SetBadInstructionHandler (Platform_SignalHandler handler) static void Platform_YMDHMStoClock (LONGINT ye, LONGINT mo, LONGINT da, LONGINT ho, LONGINT mi, LONGINT se, LONGINT *t, LONGINT *d) { - *d = (__ASHL(__MOD(ye, 100), 9) + __ASHL(mo + 1, 5)) + da; + *d = (__ASHL((int)__MOD(ye, 100), 9) + __ASHL(mo + 1, 5)) + da; *t = (__ASHL(ho, 12) + __ASHL(mi, 6)) + se; } @@ -350,8 +350,8 @@ LONGINT Platform_Time (void) LONGINT _o_result; LONGINT ms; Platform_gettimeval(); - ms = __DIVF(Platform_tvusec(), 1000) + Platform_tvsec() * 1000; - _o_result = __MOD(ms - Platform_TimeStart, 2147483647); + ms = (int)__DIVF(Platform_tvusec(), 1000) + Platform_tvsec() * 1000; + _o_result = (int)__MOD(ms - Platform_TimeStart, 2147483647); return _o_result; } @@ -359,7 +359,7 @@ void Platform_Delay (LONGINT ms) { LONGINT s, ns; s = __DIV(ms, 1000); - ns = __MOD(ms, 1000) * 1000000; + ns = (int)__MOD(ms, 1000) * 1000000; Platform_nanosleep(s, ns); } @@ -529,7 +529,7 @@ INTEGER Platform_Read (LONGINT h, LONGINT p, LONGINT l, LONGINT *n) INTEGER Platform_ReadBuf (LONGINT h, SYSTEM_BYTE *b, LONGINT b__len, LONGINT *n) { INTEGER _o_result; - *n = Platform_readfile(h, (LONGINT)(SYSTEM_ADRINT)b, b__len); + *n = Platform_readfile(h, (SYSTEM_ADRINT)b, b__len); if (*n < 0) { *n = 0; _o_result = Platform_err(); @@ -613,7 +613,7 @@ INTEGER Platform_Chdir (CHAR *n, LONGINT n__len) INTEGER _o_result; INTEGER r; r = Platform_chdir(n, n__len); - Platform_getcwd((void*)Platform_CWD, ((LONGINT)(256))); + Platform_getcwd((void*)Platform_CWD, 256); if (r < 0) { _o_result = Platform_err(); return _o_result; @@ -658,7 +658,7 @@ static void Platform_errposint (LONGINT l) if (l > 10) { Platform_errposint(__DIV(l, 10)); } - Platform_errch((CHAR)(48 + __MOD(l, 10))); + Platform_errch((CHAR)(48 + (int)__MOD(l, 10))); } static void Platform_errint (LONGINT l) @@ -674,52 +674,52 @@ static void Platform_DisplayHaltCode (LONGINT code) { switch (code) { case -1: - Platform_errstring((CHAR*)"Assertion failure.", (LONGINT)19); + Platform_errstring((CHAR*)"Assertion failure.", 19); break; case -2: - Platform_errstring((CHAR*)"Index out of range.", (LONGINT)20); + Platform_errstring((CHAR*)"Index out of range.", 20); break; case -3: - Platform_errstring((CHAR*)"Reached end of function without reaching RETURN.", (LONGINT)49); + Platform_errstring((CHAR*)"Reached end of function without reaching RETURN.", 49); break; case -4: - Platform_errstring((CHAR*)"CASE statement: no matching label and no ELSE.", (LONGINT)47); + Platform_errstring((CHAR*)"CASE statement: no matching label and no ELSE.", 47); break; case -5: - Platform_errstring((CHAR*)"Type guard failed.", (LONGINT)19); + Platform_errstring((CHAR*)"Type guard failed.", 19); break; case -6: - Platform_errstring((CHAR*)"Implicit type guard in record assignment failed.", (LONGINT)49); + Platform_errstring((CHAR*)"Implicit type guard in record assignment failed.", 49); break; case -7: - Platform_errstring((CHAR*)"Invalid case in WITH statement.", (LONGINT)32); + Platform_errstring((CHAR*)"Invalid case in WITH statement.", 32); break; case -8: - Platform_errstring((CHAR*)"Value out of range.", (LONGINT)20); + Platform_errstring((CHAR*)"Value out of range.", 20); break; case -9: - Platform_errstring((CHAR*)"Heap interrupted while locked, but lockdepth = 0 at unlock.", (LONGINT)60); + Platform_errstring((CHAR*)"Heap interrupted while locked, but lockdepth = 0 at unlock.", 60); break; case -10: - Platform_errstring((CHAR*)"NIL access.", (LONGINT)12); + Platform_errstring((CHAR*)"NIL access.", 12); break; case -11: - Platform_errstring((CHAR*)"Alignment error.", (LONGINT)17); + Platform_errstring((CHAR*)"Alignment error.", 17); break; case -12: - Platform_errstring((CHAR*)"Divide by zero.", (LONGINT)16); + Platform_errstring((CHAR*)"Divide by zero.", 16); break; case -13: - Platform_errstring((CHAR*)"Arithmetic overflow/underflow.", (LONGINT)31); + Platform_errstring((CHAR*)"Arithmetic overflow/underflow.", 31); break; case -14: - Platform_errstring((CHAR*)"Invalid function argument.", (LONGINT)27); + Platform_errstring((CHAR*)"Invalid function argument.", 27); break; case -15: - Platform_errstring((CHAR*)"Internal error, e.g. Type descriptor size mismatch.", (LONGINT)52); + Platform_errstring((CHAR*)"Internal error, e.g. Type descriptor size mismatch.", 52); break; case -20: - Platform_errstring((CHAR*)"Too many, or negative number of, elements in dynamic array.", (LONGINT)60); + Platform_errstring((CHAR*)"Too many, or negative number of, elements in dynamic array.", 60); break; default: break; @@ -733,9 +733,9 @@ void Platform_Halt (LONGINT code) if (Platform_HaltHandler != NIL) { (*Platform_HaltHandler)(code); } - Platform_errstring((CHAR*)"Terminated by Halt(", (LONGINT)20); + Platform_errstring((CHAR*)"Terminated by Halt(", 20); Platform_errint(code); - Platform_errstring((CHAR*)"). ", (LONGINT)4); + Platform_errstring((CHAR*)"). ", 4); if (code < 0) { Platform_DisplayHaltCode(code); } @@ -746,11 +746,11 @@ void Platform_Halt (LONGINT code) void Platform_AssertFail (LONGINT code) { INTEGER e; - Platform_errstring((CHAR*)"Assertion failure.", (LONGINT)19); + Platform_errstring((CHAR*)"Assertion failure.", 19); if (code != 0) { - Platform_errstring((CHAR*)" ASSERT code ", (LONGINT)14); + Platform_errstring((CHAR*)" ASSERT code ", 14); Platform_errint(code); - Platform_errstring((CHAR*)".", (LONGINT)2); + Platform_errstring((CHAR*)".", 2); } Platform_errln(); Platform_exit(__VAL(INTEGER, code)); @@ -765,7 +765,7 @@ static void Platform_TestLittleEndian (void) { INTEGER i; i = 1; - __GET((LONGINT)(SYSTEM_ADRINT)&i, Platform_LittleEndian, BOOLEAN); + __GET((SYSTEM_ADRINT)&i, Platform_LittleEndian, BOOLEAN); } __TDESC(Platform_FileIdentity, 1, 0) = {__TDFLDS("FileIdentity", 12), {-4}}; @@ -782,7 +782,7 @@ export void *Platform__init(void) Platform_TimeStart = 0; Platform_TimeStart = Platform_Time(); Platform_CWD[0] = 0x00; - Platform_getcwd((void*)Platform_CWD, ((LONGINT)(256))); + Platform_getcwd((void*)Platform_CWD, 256); Platform_PID = Platform_getpid(); Platform_SeekSet = Platform_seekset(); Platform_SeekCur = Platform_seekcur(); diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index b890523b..4c7f2849 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 4ee29f7d..f2a4b1e4 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -58,7 +58,7 @@ INTEGER Reals_Expo (REAL x) { INTEGER _o_result; INTEGER i; - __GET((LONGINT)(SYSTEM_ADRINT)&x + 2, i, INTEGER); + __GET((SYSTEM_ADRINT)&x + 2, i, INTEGER); _o_result = __MASK(__ASHR(i, 7), -256); return _o_result; } @@ -66,17 +66,17 @@ INTEGER Reals_Expo (REAL x) void Reals_SetExpo (REAL *x, INTEGER ex) { CHAR c; - __GET((LONGINT)(SYSTEM_ADRINT)x + 3, c, CHAR); - __PUT((LONGINT)(SYSTEM_ADRINT)x + 3, (CHAR)(__ASHL(__ASHR((int)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); - __GET((LONGINT)(SYSTEM_ADRINT)x + 2, c, CHAR); - __PUT((LONGINT)(SYSTEM_ADRINT)x + 2, (CHAR)(__MASK((int)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); + __GET((SYSTEM_ADRINT)x + 3, c, CHAR); + __PUT((SYSTEM_ADRINT)x + 3, (CHAR)(__ASHL(__ASHR(c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __GET((SYSTEM_ADRINT)x + 2, c, CHAR); + __PUT((SYSTEM_ADRINT)x + 2, (CHAR)(__MASK(c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } INTEGER Reals_ExpoL (LONGREAL x) { INTEGER _o_result; INTEGER i; - __GET((LONGINT)(SYSTEM_ADRINT)&x + 6, i, INTEGER); + __GET((SYSTEM_ADRINT)&x + 6, i, INTEGER); _o_result = __MASK(__ASHR(i, 4), -2048); return _o_result; } @@ -89,21 +89,21 @@ void Reals_ConvertL (LONGREAL x, INTEGER n, CHAR *d, LONGINT d__len) } k = 0; if (n > 9) { - i = (int)__ENTIER(x / (LONGREAL)(LONGREAL)1000000000); - j = (int)__ENTIER(x - i * (LONGREAL)1000000000); + i = (SYSTEM_INT32)__ENTIER(x / (LONGREAL)(LONGREAL)1000000000); + j = (SYSTEM_INT32)__ENTIER(x - i * (LONGREAL)1000000000); if (j < 0) { j = 0; } while (k < 9) { - d[__X(k, d__len)] = (CHAR)(__MOD(j, 10) + 48); + d[__X(k, d__len)] = (CHAR)((int)__MOD(j, 10) + 48); j = __DIV(j, 10); k += 1; } } else { - i = (int)__ENTIER(x); + i = (SYSTEM_INT32)__ENTIER(x); } - while (k < (int)n) { - d[__X(k, d__len)] = (CHAR)(__MOD(i, 10) + 48); + while (k < n) { + d[__X(k, d__len)] = (CHAR)((int)__MOD(i, 10) + 48); i = __DIV(i, 10); k += 1; } @@ -134,22 +134,22 @@ static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LO CHAR by; i = 0; l = b__len; - while ((int)i < l) { + while (i < l) { by = __VAL(CHAR, b[__X(i, b__len)]); - d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((int)by, 4)); - d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((int)by, -16)); + d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR(by, 4)); + d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK(by, -16)); i += 1; } } void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len) { - Reals_BytesToHex((void*)&y, ((LONGINT)(4)), (void*)d, d__len * ((LONGINT)(1))); + Reals_BytesToHex((void*)&y, 4, (void*)d, d__len * 1); } void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len) { - Reals_BytesToHex((void*)&x, ((LONGINT)(8)), (void*)d, d__len * ((LONGINT)(1))); + Reals_BytesToHex((void*)&x, 8, (void*)d, d__len * 1); } diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index 0a81ebf4..6eeb5a87 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index 0c372b8b..ec6697bf 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -21,7 +21,7 @@ INTEGER Strings_Length (CHAR *s, LONGINT s__len) INTEGER i; __DUP(s, s__len, CHAR); i = 0; - while (((int)i < s__len && s[__X(i, s__len)] != 0x00)) { + while ((i < s__len && s[__X(i, s__len)] != 0x00)) { i += 1; } _o_result = i; @@ -36,11 +36,11 @@ void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__ n1 = Strings_Length(dest, dest__len); n2 = Strings_Length(extra, extra__len); i = 0; - while ((i < n2 && (int)(i + n1) < dest__len)) { + while ((i < n2 && (i + n1) < dest__len)) { dest[__X(i + n1, dest__len)] = extra[__X(i, extra__len)]; i += 1; } - if ((int)(i + n1) < dest__len) { + if ((i + n1) < dest__len) { dest[__X(i + n1, dest__len)] = 0x00; } __DEL(extra); @@ -59,10 +59,10 @@ void Strings_Insert (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, Strings_Append(dest, dest__len, (void*)source, source__len); return; } - if ((int)(pos + n2) < dest__len) { + if ((pos + n2) < dest__len) { i = n1; while (i >= pos) { - if ((int)(i + n2) < dest__len) { + if ((i + n2) < dest__len) { dest[__X(i + n2, dest__len)] = dest[__X(i, dest__len)]; } i -= 1; @@ -91,7 +91,7 @@ void Strings_Delete (CHAR *s, LONGINT s__len, INTEGER pos, INTEGER n) s[__X(i - n, s__len)] = s[__X(i, s__len)]; i += 1; } - if ((int)(i - n) < s__len) { + if ((i - n) < s__len) { s[__X(i - n, s__len)] = 0x00; } } else { @@ -112,7 +112,7 @@ void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n, INTEGER len, destLen, i; __DUP(source, source__len, CHAR); len = Strings_Length(source, source__len); - destLen = (int)dest__len - 1; + destLen = dest__len - 1; if (pos < 0) { pos = 0; } @@ -121,7 +121,7 @@ void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n, return; } i = 0; - while (((((int)(pos + i) <= source__len && source[__X(pos + i, source__len)] != 0x00)) && i < n)) { + while (((((pos + i) <= source__len && source[__X(pos + i, source__len)] != 0x00)) && i < n)) { if (i < destLen) { dest[__X(i, dest__len)] = source[__X(pos + i, source__len)]; } diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index 0dbfdb8e..43656e74 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index 41ad5883..58a4ec95 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Files.h" #include "Modules.h" @@ -231,7 +231,7 @@ static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len) Texts_FontsFont _o_result; Texts_FontsFont F = NIL; __NEW(F, Texts_FontDesc); - __COPY(name, F->name, ((LONGINT)(32))); + __COPY(name, F->name, 32); _o_result = F; return _o_result; } @@ -398,15 +398,15 @@ static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, LONGINT *msg__t e->file = ((Texts_Alien)E)->file; e->org = ((Texts_Alien)E)->org; e->span = ((Texts_Alien)E)->span; - __COPY(((Texts_Alien)E)->mod, e->mod, ((LONGINT)(32))); - __COPY(((Texts_Alien)E)->proc, e->proc, ((LONGINT)(32))); + __COPY(((Texts_Alien)E)->mod, e->mod, 32); + __COPY(((Texts_Alien)E)->proc, e->proc, 32); (*msg__).e = (Texts_Elem)e; } else __WITHCHK; } else if (__IS(msg__typ, Texts_IdentifyMsg, 1)) { if (__IS(msg__typ, Texts_IdentifyMsg, 1)) { Texts_IdentifyMsg *msg__ = (void*)msg; - __COPY(((Texts_Alien)E)->mod, (*msg__).mod, ((LONGINT)(32))); - __COPY(((Texts_Alien)E)->proc, (*msg__).proc, ((LONGINT)(32))); + __COPY(((Texts_Alien)E)->mod, (*msg__).mod, 32); + __COPY(((Texts_Alien)E)->proc, (*msg__).proc, 32); (*msg__).mod[31] = 0x01; } else __WITHCHK; } else if (__IS(msg__typ, Texts_FileMsg, 1)) { @@ -746,7 +746,7 @@ static void ReadScaleFactor__32 (void) } } while (('0' <= *Scan__31_s->ch && *Scan__31_s->ch <= '9')) { - *Scan__31_s->e = (*Scan__31_s->e * 10 + (int)*Scan__31_s->ch) - 48; + *Scan__31_s->e = (*Scan__31_s->e * 10 + *Scan__31_s->ch) - 48; Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); } } @@ -780,21 +780,21 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) } if ((('A' <= __CAP(ch) && __CAP(ch) <= 'Z') || ch == '/') || ch == '.') { do { - (*S).s[__X(i, ((LONGINT)(64)))] = ch; + (*S).s[__X(i, 64)] = ch; i += 1; Texts_Read((void*)&*S, S__typ, &ch); } while (!((((__CAP(ch) > 'Z' && ch != '_') || ('A' > __CAP(ch) && ch > '9')) || ((('0' > ch && ch != '.')) && ch != '/')) || i == 63)); - (*S).s[__X(i, ((LONGINT)(64)))] = 0x00; + (*S).s[__X(i, 64)] = 0x00; (*S).len = i; (*S).class = 1; } else if (ch == '"') { Texts_Read((void*)&*S, S__typ, &ch); while ((((ch != '"' && ch >= ' ')) && i != 63)) { - (*S).s[__X(i, ((LONGINT)(64)))] = ch; + (*S).s[__X(i, 64)] = ch; i += 1; Texts_Read((void*)&*S, S__typ, &ch); } - (*S).s[__X(i, ((LONGINT)(64)))] = 0x00; + (*S).s[__X(i, 64)] = 0x00; (*S).len = i + 1; Texts_Read((void*)&*S, S__typ, &ch); (*S).class = 2; @@ -809,7 +809,7 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) hex = 0; j = 0; for (;;) { - d[__X(i, ((LONGINT)(32)))] = ch; + d[__X(i, 32)] = ch; i += 1; Texts_Read((void*)&*S, S__typ, &ch); if (ch < '0') { @@ -818,10 +818,10 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) if ('9' < ch) { if (('A' <= ch && ch <= 'F')) { hex = 1; - ch = (CHAR)((int)ch - 7); + ch = (CHAR)(ch - 7); } else if (('a' <= ch && ch <= 'f')) { hex = 1; - ch = (CHAR)((int)ch - 39); + ch = (CHAR)(ch - 39); } else { break; } @@ -833,13 +833,13 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) if (i - j > 8) { j = i - 8; } - k = (int)d[__X(j, ((LONGINT)(32)))] - 48; + k = d[__X(j, 32)] - 48; j += 1; if ((i - j == 7 && k >= 8)) { k -= 16; } while (j < i) { - k = __ASHL(k, 4) + (int)((int)d[__X(j, ((LONGINT)(32)))] - 48); + k = __ASHL(k, 4) + (d[__X(j, 32)] - 48); j += 1; } if (neg) { @@ -851,7 +851,7 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) Texts_Read((void*)&*S, S__typ, &ch); h = i; while (('0' <= ch && ch <= '9')) { - d[__X(i, ((LONGINT)(32)))] = ch; + d[__X(i, 32)] = ch; i += 1; Texts_Read((void*)&*S, S__typ, &ch); } @@ -860,12 +860,12 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) y = (LONGREAL)0; g = (LONGREAL)1; do { - y = y * (LONGREAL)10 + ((int)d[__X(j, ((LONGINT)(32)))] - 48); + y = y * (LONGREAL)10 + (d[__X(j, 32)] - 48); j += 1; } while (!(j == h)); while (j < i) { g = g / (LONGREAL)(LONGREAL)10; - y = ((int)d[__X(j, ((LONGINT)(32)))] - 48) * g + y; + y = (d[__X(j, 32)] - 48) * g + y; j += 1; } ReadScaleFactor__32(); @@ -892,12 +892,12 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) x = (REAL)0; f = (REAL)1; do { - x = x * (REAL)10 + ((int)d[__X(j, ((LONGINT)(32)))] - 48); + x = x * (REAL)10 + (d[__X(j, 32)] - 48); j += 1; } while (!(j == h)); while (j < i) { f = f / (REAL)(REAL)10; - x = ((int)d[__X(j, ((LONGINT)(32)))] - 48) * f + x; + x = (d[__X(j, 32)] - 48) * f + x; j += 1; } if (ch == 'E') { @@ -929,7 +929,7 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) (*S).class = 3; k = 0; do { - k = k * 10 + (int)((int)d[__X(j, ((LONGINT)(32)))] - 48); + k = k * 10 + (d[__X(j, 32)] - 48); j += 1; } while (!(j == i)); if (neg) { @@ -964,8 +964,8 @@ void Texts_OpenWriter (Texts_Writer *W, LONGINT *W__typ) (*W).fnt = Texts_FontsDefault; (*W).col = 15; (*W).voff = 0; - (*W).file = Files_New((CHAR*)"", (LONGINT)1); - Files_Set(&(*W).rider, Files_Rider__typ, (*W).file, ((LONGINT)(0))); + (*W).file = Files_New((CHAR*)"", 1); + Files_Set(&(*W).rider, Files_Rider__typ, (*W).file, 0); } void Texts_SetFont (Texts_Writer *W, LONGINT *W__typ, Texts_FontsFont fnt) @@ -1053,7 +1053,7 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n) i = 0; if (x < 0) { if (x == (-2147483647-1)) { - Texts_WriteString(&*W, W__typ, (CHAR*)" -2147483648", (LONGINT)13); + Texts_WriteString(&*W, W__typ, (CHAR*)" -2147483648", 13); return; } else { n -= 1; @@ -1063,11 +1063,11 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n) x0 = x; } do { - a[__X(i, ((LONGINT)(22)))] = (CHAR)(__MOD(x0, 10) + 48); + a[__X(i, 22)] = (CHAR)((int)__MOD(x0, 10) + 48); x0 = __DIV(x0, 10); i += 1; } while (!(x0 == 0)); - while (n > (int)i) { + while (n > i) { Texts_Write(&*W, W__typ, ' '); n -= 1; } @@ -1076,7 +1076,7 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n) } do { i -= 1; - Texts_Write(&*W, W__typ, a[__X(i, ((LONGINT)(22)))]); + Texts_Write(&*W, W__typ, a[__X(i, 22)]); } while (!(i == 0)); } @@ -1090,16 +1090,16 @@ void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, LONGINT x) do { y = __MASK(x, -16); if (y < 10) { - a[__X(i, ((LONGINT)(20)))] = (CHAR)(y + 48); + a[__X(i, 20)] = (CHAR)(y + 48); } else { - a[__X(i, ((LONGINT)(20)))] = (CHAR)(y + 55); + a[__X(i, 20)] = (CHAR)(y + 55); } x = __ASHR(x, 4); i += 1; } while (!(i == 8)); do { i -= 1; - Texts_Write(&*W, W__typ, a[__X(i, ((LONGINT)(20)))]); + Texts_Write(&*W, W__typ, a[__X(i, 20)]); } while (!(i == 0)); } @@ -1110,13 +1110,13 @@ void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n) CHAR d[9]; e = Reals_Expo(x); if (e == 0) { - Texts_WriteString(&*W, W__typ, (CHAR*)" 0", (LONGINT)4); + Texts_WriteString(&*W, W__typ, (CHAR*)" 0", 4); do { Texts_Write(&*W, W__typ, ' '); n -= 1; } while (!(n <= 3)); } else if (e == 255) { - Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", (LONGINT)5); + Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", 5); while (n > 4) { Texts_Write(&*W, W__typ, ' '); n -= 1; @@ -1153,13 +1153,13 @@ void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n) x = x * 1.0000000e-001; e += 1; } - Reals_Convert(x, n, (void*)d, ((LONGINT)(9))); + Reals_Convert(x, n, (void*)d, 9); n -= 1; - Texts_Write(&*W, W__typ, d[__X(n, ((LONGINT)(9)))]); + Texts_Write(&*W, W__typ, d[__X(n, 9)]); Texts_Write(&*W, W__typ, '.'); do { n -= 1; - Texts_Write(&*W, W__typ, d[__X(n, ((LONGINT)(9)))]); + Texts_Write(&*W, W__typ, d[__X(n, 9)]); } while (!(n == 0)); Texts_Write(&*W, W__typ, 'E'); if (e < 0) { @@ -1196,7 +1196,7 @@ static void dig__54 (INTEGER n) { while (n > 0) { *WriteRealFix__53_s->i -= 1; - Texts_Write(&*WriteRealFix__53_s->W, WriteRealFix__53_s->W__typ, (*WriteRealFix__53_s->d)[__X(*WriteRealFix__53_s->i, ((LONGINT)(9)))]); + Texts_Write(&*WriteRealFix__53_s->W, WriteRealFix__53_s->W__typ, (*WriteRealFix__53_s->d)[__X(*WriteRealFix__53_s->i, 9)]); n -= 1; } } @@ -1222,7 +1222,7 @@ void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n, IN Texts_Write(&*W, W__typ, '0'); seq__56(' ', k + 1); } else if (e == 255) { - Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", (LONGINT)5); + Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", 5); seq__56(' ', n - 4); } else { e = __ASHR((e - 127) * 77, 8); @@ -1254,7 +1254,7 @@ void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n, IN } e += 1; i = k + e; - Reals_Convert(x, i, (void*)d, ((LONGINT)(9))); + Reals_Convert(x, i, (void*)d, 9); if (e > 0) { seq__56(' ', ((n - e) - k) - 2); Texts_Write(&*W, W__typ, sign); @@ -1277,10 +1277,10 @@ void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x) { INTEGER i; CHAR d[8]; - Reals_ConvertH(x, (void*)d, ((LONGINT)(8))); + Reals_ConvertH(x, (void*)d, 8); i = 0; do { - Texts_Write(&*W, W__typ, d[__X(i, ((LONGINT)(8)))]); + Texts_Write(&*W, W__typ, d[__X(i, 8)]); i += 1; } while (!(i == 8)); } @@ -1292,13 +1292,13 @@ void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER CHAR d[16]; e = Reals_ExpoL(x); if (e == 0) { - Texts_WriteString(&*W, W__typ, (CHAR*)" 0", (LONGINT)4); + Texts_WriteString(&*W, W__typ, (CHAR*)" 0", 4); do { Texts_Write(&*W, W__typ, ' '); n -= 1; } while (!(n <= 3)); } else if (e == 2047) { - Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", (LONGINT)5); + Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", 5); while (n > 4) { Texts_Write(&*W, W__typ, ' '); n -= 1; @@ -1319,7 +1319,7 @@ void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER } else { Texts_Write(&*W, W__typ, ' '); } - e = (int)__ASHR((int)(e - 1023) * 77, 8); + e = __ASHR((e - 1023) * 77, 8); if (e >= 0) { x = x / (LONGREAL)Reals_TenL(e); } else { @@ -1335,13 +1335,13 @@ void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER x = 1.00000000000000e-001 * x; e += 1; } - Reals_ConvertL(x, n, (void*)d, ((LONGINT)(16))); + Reals_ConvertL(x, n, (void*)d, 16); n -= 1; - Texts_Write(&*W, W__typ, d[__X(n, ((LONGINT)(16)))]); + Texts_Write(&*W, W__typ, d[__X(n, 16)]); Texts_Write(&*W, W__typ, '.'); do { n -= 1; - Texts_Write(&*W, W__typ, d[__X(n, ((LONGINT)(16)))]); + Texts_Write(&*W, W__typ, d[__X(n, 16)]); } while (!(n == 0)); Texts_Write(&*W, W__typ, 'D'); if (e < 0) { @@ -1361,10 +1361,10 @@ void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x) { INTEGER i; CHAR d[16]; - Reals_ConvertHL(x, (void*)d, ((LONGINT)(16))); + Reals_ConvertHL(x, (void*)d, 16); i = 0; do { - Texts_Write(&*W, W__typ, d[__X(i, ((LONGINT)(16)))]); + Texts_Write(&*W, W__typ, d[__X(i, 16)]); i += 1; } while (!(i == 16)); } @@ -1381,7 +1381,7 @@ static void WritePair__44 (CHAR ch, LONGINT x) { Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, ch); Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)(__DIV(x, 10) + 48)); - Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)(__MOD(x, 10) + 48)); + Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)((int)__MOD(x, 10) + 48)); } void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, LONGINT t, LONGINT d) @@ -1423,13 +1423,13 @@ static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, LONGINT Files_Read(&*r, r__typ, (void*)&eno); if (eno > *Load0__16_s->ecnt) { *Load0__16_s->ecnt = eno; - Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->mods)[__X(eno, ((LONGINT)(64)))], ((LONGINT)(32))); - Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->procs)[__X(eno, ((LONGINT)(64)))], ((LONGINT)(32))); + Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->mods)[__X(eno, 64)], 32); + Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->procs)[__X(eno, 64)], 32); } org = Files_Pos(&*r, r__typ); - M = Modules_ThisMod((*Load0__16_s->mods)[__X(eno, ((LONGINT)(64)))], ((LONGINT)(32))); + M = Modules_ThisMod((*Load0__16_s->mods)[__X(eno, 64)], 32); if (M != NIL) { - Cmd = Modules_ThisCommand(M, (*Load0__16_s->procs)[__X(eno, ((LONGINT)(64)))], ((LONGINT)(32))); + Cmd = Modules_ThisCommand(M, (*Load0__16_s->procs)[__X(eno, 64)], 32); if (Cmd != NIL) { (*Cmd)(); } @@ -1455,8 +1455,8 @@ static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, LONGINT a->file = *Load0__16_s->f; a->org = org; a->span = span; - __COPY((*Load0__16_s->mods)[__X(eno, ((LONGINT)(64)))], a->mod, ((LONGINT)(32))); - __COPY((*Load0__16_s->procs)[__X(eno, ((LONGINT)(64)))], a->proc, ((LONGINT)(32))); + __COPY((*Load0__16_s->mods)[__X(eno, 64)], a->mod, 32); + __COPY((*Load0__16_s->procs)[__X(eno, 64)], a->proc, 32); *e = (Texts_Elem)a; } } @@ -1500,8 +1500,8 @@ static void Texts_Load0 (Files_Rider *r, LONGINT *r__typ, Texts_Text T) while (fno != 0) { if (fno > fcnt) { fcnt = fno; - Files_ReadString(&msg.r, Files_Rider__typ, (void*)name, ((LONGINT)(32))); - fnts[__X(fno, ((LONGINT)(32)))] = Texts_FontsThis((void*)name, ((LONGINT)(32))); + Files_ReadString(&msg.r, Files_Rider__typ, (void*)name, 32); + fnts[__X(fno, 32)] = Texts_FontsThis((void*)name, 32); } Files_Read(&msg.r, Files_Rider__typ, (void*)&col); Files_Read(&msg.r, Files_Rider__typ, (void*)&voff); @@ -1556,9 +1556,9 @@ void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len) __DUP(name, name__len, CHAR); f = Files_Old(name, name__len); if (f == NIL) { - f = Files_New((CHAR*)"", (LONGINT)1); + f = Files_New((CHAR*)"", 1); } - Files_Set(&r, Files_Rider__typ, f, ((LONGINT)(0))); + Files_Set(&r, Files_Rider__typ, f, 0); Files_Read(&r, Files_Rider__typ, (void*)&tag); Files_Read(&r, Files_Rider__typ, (void*)&version); if (tag == 0xf0 || (tag == 0x01 && version == 0xf0)) { @@ -1570,7 +1570,7 @@ void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len) u->col = 15; __NEW(p, Texts_PieceDesc); if ((tag == 0xf7 && version == 0x07)) { - Files_Set(&r, Files_Rider__typ, f, ((LONGINT)(28))); + Files_Set(&r, Files_Rider__typ, f, 28); Files_ReadLInt(&r, Files_Rider__typ, &hlen); Files_Set(&r, Files_Rider__typ, f, 22 + hlen); Files_ReadLInt(&r, Files_Rider__typ, &T->len); @@ -1616,21 +1616,21 @@ static void StoreElem__40 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, Texts_E Files_Rider r1; LONGINT org, span; SHORTINT eno; - __COPY((*Store__39_s->iden).mod, (*Store__39_s->mods)[__X(*Store__39_s->ecnt, ((LONGINT)(64)))], ((LONGINT)(32))); - __COPY((*Store__39_s->iden).proc, (*Store__39_s->procs)[__X(*Store__39_s->ecnt, ((LONGINT)(64)))], ((LONGINT)(32))); + __COPY((*Store__39_s->iden).mod, (*Store__39_s->mods)[__X(*Store__39_s->ecnt, 64)], 32); + __COPY((*Store__39_s->iden).proc, (*Store__39_s->procs)[__X(*Store__39_s->ecnt, 64)], 32); eno = 1; - while (__STRCMP((*Store__39_s->mods)[__X(eno, ((LONGINT)(64)))], (*Store__39_s->iden).mod) != 0 || __STRCMP((*Store__39_s->procs)[__X(eno, ((LONGINT)(64)))], (*Store__39_s->iden).proc) != 0) { + while (__STRCMP((*Store__39_s->mods)[__X(eno, 64)], (*Store__39_s->iden).mod) != 0 || __STRCMP((*Store__39_s->procs)[__X(eno, 64)], (*Store__39_s->iden).proc) != 0) { eno += 1; } Files_Set(&r1, Files_Rider__typ, Files_Base(&*r, r__typ), Files_Pos(&*r, r__typ)); - Files_WriteLInt(&*r, r__typ, ((LONGINT)(0))); - Files_WriteLInt(&*r, r__typ, ((LONGINT)(0))); - Files_WriteLInt(&*r, r__typ, ((LONGINT)(0))); + Files_WriteLInt(&*r, r__typ, 0); + Files_WriteLInt(&*r, r__typ, 0); + Files_WriteLInt(&*r, r__typ, 0); Files_Write(&*r, r__typ, eno); if (eno == *Store__39_s->ecnt) { *Store__39_s->ecnt += 1; - Files_WriteString(&*r, r__typ, (*Store__39_s->iden).mod, ((LONGINT)(32))); - Files_WriteString(&*r, r__typ, (*Store__39_s->iden).proc, ((LONGINT)(32))); + Files_WriteString(&*r, r__typ, (*Store__39_s->iden).mod, 32); + Files_WriteString(&*r, r__typ, (*Store__39_s->iden).proc, 32); } (*Store__39_s->msg).pos = pos; org = Files_Pos(&*r, r__typ); @@ -1665,7 +1665,7 @@ void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T) org = Files_Pos(&*r, r__typ); msg.id = 1; msg.r = *r; - Files_WriteLInt(&msg.r, Files_Rider__typ, ((LONGINT)(0))); + Files_WriteLInt(&msg.r, Files_Rider__typ, 0); u = T->head->next; pos = 0; delta = 0; @@ -1679,15 +1679,15 @@ void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T) iden.mod[0] = 0x01; } if (iden.mod[0] != 0x00) { - fnts[__X(fcnt, ((LONGINT)(32)))] = u->fnt; + fnts[__X(fcnt, 32)] = u->fnt; fno = 1; - while (__STRCMP(fnts[__X(fno, ((LONGINT)(32)))]->name, u->fnt->name) != 0) { + while (__STRCMP(fnts[__X(fno, 32)]->name, u->fnt->name) != 0) { fno += 1; } Files_Write(&msg.r, Files_Rider__typ, fno); if (fno == fcnt) { fcnt += 1; - Files_WriteString(&msg.r, Files_Rider__typ, u->fnt->name, ((LONGINT)(32))); + Files_WriteString(&msg.r, Files_Rider__typ, u->fnt->name, 32); } Files_Write(&msg.r, Files_Rider__typ, u->col); Files_Write(&msg.r, Files_Rider__typ, u->voff); @@ -1736,12 +1736,12 @@ void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T) Files_Set(&r1, Files_Rider__typ, ((Texts_Piece)u)->file, ((Texts_Piece)u)->org); delta = ((Texts_Piece)u)->len; while (delta > 1024) { - Files_ReadBytes(&r1, Files_Rider__typ, (void*)block, ((LONGINT)(1024)), ((LONGINT)(1024))); - Files_WriteBytes(&msg.r, Files_Rider__typ, (void*)block, ((LONGINT)(1024)), ((LONGINT)(1024))); + Files_ReadBytes(&r1, Files_Rider__typ, (void*)block, 1024, 1024); + Files_WriteBytes(&msg.r, Files_Rider__typ, (void*)block, 1024, 1024); delta -= 1024; } - Files_ReadBytes(&r1, Files_Rider__typ, (void*)block, ((LONGINT)(1024)), delta); - Files_WriteBytes(&msg.r, Files_Rider__typ, (void*)block, ((LONGINT)(1024)), delta); + Files_ReadBytes(&r1, Files_Rider__typ, (void*)block, 1024, delta); + Files_WriteBytes(&msg.r, Files_Rider__typ, (void*)block, 1024, delta); } } else __WITHCHK; } else { @@ -1755,7 +1755,7 @@ void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T) } __GUARDEQR(r, r__typ, Files_Rider) = msg.r; if (T->notify != NIL) { - (*T->notify)(T, 3, ((LONGINT)(0)), ((LONGINT)(0))); + (*T->notify)(T, 3, 0, 0); } Store__39_s = _s.lnk; } @@ -1768,7 +1768,7 @@ void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len) CHAR bak[64]; __DUP(name, name__len, CHAR); f = Files_New(name, name__len); - Files_Set(&r, Files_Rider__typ, f, ((LONGINT)(0))); + Files_Set(&r, Files_Rider__typ, f, 0); Files_Write(&r, Files_Rider__typ, 0xf0); Files_Write(&r, Files_Rider__typ, 0x01); Texts_Store(&r, Files_Rider__typ, T); @@ -1776,13 +1776,13 @@ void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len) while (name[__X(i, name__len)] != 0x00) { i += 1; } - __COPY(name, bak, ((LONGINT)(64))); - bak[__X(i, ((LONGINT)(64)))] = '.'; - bak[__X(i + 1, ((LONGINT)(64)))] = 'B'; - bak[__X(i + 2, ((LONGINT)(64)))] = 'a'; - bak[__X(i + 3, ((LONGINT)(64)))] = 'k'; - bak[__X(i + 4, ((LONGINT)(64)))] = 0x00; - Files_Rename(name, name__len, bak, ((LONGINT)(64)), &res); + __COPY(name, bak, 64); + bak[__X(i, 64)] = '.'; + bak[__X(i + 1, 64)] = 'B'; + bak[__X(i + 2, 64)] = 'a'; + bak[__X(i + 3, 64)] = 'k'; + bak[__X(i + 4, 64)] = 0x00; + Files_Rename(name, name__len, bak, 64, &res); Files_Register(f); __DEL(name); } diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index f5aabe8a..34a403f2 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/Vishap.c b/bootstrap/unix-44/Vishap.c index e8b1e4d1..7c16c24d 100644 --- a/bootstrap/unix-44/Vishap.c +++ b/bootstrap/unix-44/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkamSf */ #include "SYSTEM.h" #include "Configuration.h" #include "Heap.h" @@ -33,31 +33,31 @@ void Vishap_Module (BOOLEAN *done) OPV_AdrAndSize(OPT_topScope); OPT_Export(&ext, &new); if (OPM_noerr) { - OPM_OpenFiles((void*)OPT_SelfName, ((LONGINT)(256))); + OPM_OpenFiles((void*)OPT_SelfName, 256); OPC_Init(); OPV_Module(p); if (OPM_noerr) { if (((OPM_mainProg || OPM_mainLinkStat) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { OPM_DeleteNewSym(); if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"32m", (LONGINT)4); + vt100_SetAttr((CHAR*)"32m", 4); } - OPM_LogWStr((CHAR*)" Main program.", (LONGINT)16); + OPM_LogWStr((CHAR*)" Main program.", 16); if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + vt100_SetAttr((CHAR*)"0m", 3); } } else { if (new) { if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"32m", (LONGINT)4); + vt100_SetAttr((CHAR*)"32m", 4); } - OPM_LogWStr((CHAR*)" New symbol file.", (LONGINT)19); + OPM_LogWStr((CHAR*)" New symbol file.", 19); if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + vt100_SetAttr((CHAR*)"0m", 3); } OPM_RegisterNewSym(); } else if (ext) { - OPM_LogWStr((CHAR*)" Extended symbol file.", (LONGINT)24); + OPM_LogWStr((CHAR*)" Extended symbol file.", 24); OPM_RegisterNewSym(); } } @@ -94,7 +94,7 @@ void Vishap_Translate (void) modulesobj[0] = 0x00; if (OPM_OpenPar()) { for (;;) { - OPM_Init(&done, (void*)Vishap_mname, ((LONGINT)(256))); + OPM_Init(&done, (void*)Vishap_mname, 256); if (!done) { return; } @@ -104,21 +104,21 @@ void Vishap_Translate (void) Vishap_Module(&done); if (!done) { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Module compilation failed.", (LONGINT)27); + OPM_LogWStr((CHAR*)"Module compilation failed.", 27); OPM_LogWLn(); Platform_Exit(1); } if (!OPM_dontAsm) { if (OPM_dontLink) { - extTools_Assemble(OPM_modName, ((LONGINT)(32))); + extTools_Assemble(OPM_modName, 32); } else { if (!(OPM_mainProg || OPM_mainLinkStat)) { - extTools_Assemble(OPM_modName, ((LONGINT)(32))); - Strings_Append((CHAR*)" ", (LONGINT)2, (void*)modulesobj, ((LONGINT)(2048))); - Strings_Append(OPM_modName, ((LONGINT)(32)), (void*)modulesobj, ((LONGINT)(2048))); - Strings_Append((CHAR*)".o", (LONGINT)3, (void*)modulesobj, ((LONGINT)(2048))); + extTools_Assemble(OPM_modName, 32); + Strings_Append((CHAR*)" ", 2, (void*)modulesobj, 2048); + Strings_Append(OPM_modName, 32, (void*)modulesobj, 2048); + Strings_Append((CHAR*)".o", 3, (void*)modulesobj, 2048); } else { - extTools_LinkMain((void*)OPM_modName, ((LONGINT)(32)), OPM_mainLinkStat, modulesobj, ((LONGINT)(2048))); + extTools_LinkMain((void*)OPM_modName, 32, OPM_mainLinkStat, modulesobj, 2048); } } } @@ -133,7 +133,7 @@ static void Vishap_Trap (INTEGER sig) Platform_Exit(0); } else { if ((sig == 4 && Platform_HaltCode == -15)) { - OPM_LogWStr((CHAR*)" --- Vishap Oberon: internal error", (LONGINT)35); + OPM_LogWStr((CHAR*)" --- Vishap Oberon: internal error", 35); OPM_LogWLn(); } Platform_Exit(2); diff --git a/bootstrap/unix-44/errors.c b/bootstrap/unix-44/errors.c index a8573f9a..7a91fc31 100644 --- a/bootstrap/unix-44/errors.c +++ b/bootstrap/unix-44/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/unix-44/errors.h b/bootstrap/unix-44/errors.h index 6dfe7b1d..4a787a17 100644 --- a/bootstrap/unix-44/errors.h +++ b/bootstrap/unix-44/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index d2141803..cfb79ac9 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" @@ -35,14 +35,14 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN Console_String(title, title__len); Console_String(cmd, cmd__len); Console_Ln(); - Console_String((CHAR*)"-- failed: status ", (LONGINT)19); - Console_Int(status, ((LONGINT)(1))); - Console_String((CHAR*)", exitcode ", (LONGINT)12); - Console_Int(exitcode, ((LONGINT)(1))); - Console_String((CHAR*)".", (LONGINT)2); + Console_String((CHAR*)"-- failed: status ", 19); + Console_Int(status, 1); + Console_String((CHAR*)", exitcode ", 12); + Console_Int(exitcode, 1); + Console_String((CHAR*)".", 2); Console_Ln(); if ((status == 0 && exitcode == 127)) { - Console_String((CHAR*)"Is the C compiler in the current command path\?", (LONGINT)47); + Console_String((CHAR*)"Is the C compiler in the current command path\?", 47); Console_Ln(); } if (status != 0) { @@ -60,11 +60,11 @@ void extTools_Assemble (CHAR *moduleName, LONGINT moduleName__len) CHAR cmd[1023]; __DUP(moduleName, moduleName__len, CHAR); __MOVE("gcc -g", cmd, 7); - Strings_Append(extTools_compilationOptions, ((LONGINT)(1023)), (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)"-c ", (LONGINT)4, (void*)cmd, ((LONGINT)(1023))); - Strings_Append(moduleName, moduleName__len, (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)".c", (LONGINT)3, (void*)cmd, ((LONGINT)(1023))); - extTools_execute((CHAR*)"Assemble: ", (LONGINT)11, cmd, ((LONGINT)(1023))); + Strings_Append(extTools_compilationOptions, 1023, (void*)cmd, 1023); + Strings_Append((CHAR*)"-c ", 4, (void*)cmd, 1023); + Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); + Strings_Append((CHAR*)".c", 3, (void*)cmd, 1023); + extTools_execute((CHAR*)"Assemble: ", 11, cmd, 1023); __DEL(moduleName); } @@ -73,21 +73,21 @@ void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN stati CHAR cmd[1023]; __DUP(additionalopts, additionalopts__len, CHAR); __MOVE("gcc -g", cmd, 7); - Strings_Append((CHAR*)" ", (LONGINT)2, (void*)cmd, ((LONGINT)(1023))); - Strings_Append(extTools_compilationOptions, ((LONGINT)(1023)), (void*)cmd, ((LONGINT)(1023))); - Strings_Append(moduleName, moduleName__len, (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)".c ", (LONGINT)4, (void*)cmd, ((LONGINT)(1023))); - Strings_Append(additionalopts, additionalopts__len, (void*)cmd, ((LONGINT)(1023))); + Strings_Append((CHAR*)" ", 2, (void*)cmd, 1023); + Strings_Append(extTools_compilationOptions, 1023, (void*)cmd, 1023); + Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); + Strings_Append((CHAR*)".c ", 4, (void*)cmd, 1023); + Strings_Append(additionalopts, additionalopts__len, (void*)cmd, 1023); if (statically) { - Strings_Append((CHAR*)"-static", (LONGINT)8, (void*)cmd, ((LONGINT)(1023))); + Strings_Append((CHAR*)"-static", 8, (void*)cmd, 1023); } - Strings_Append((CHAR*)" -o ", (LONGINT)5, (void*)cmd, ((LONGINT)(1023))); - Strings_Append(moduleName, moduleName__len, (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)" -L\"", (LONGINT)5, (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)"/opt/voc", (LONGINT)9, (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)"/lib\"", (LONGINT)6, (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)" -l voc", (LONGINT)8, (void*)cmd, ((LONGINT)(1023))); - extTools_execute((CHAR*)"Assemble and link: ", (LONGINT)20, cmd, ((LONGINT)(1023))); + Strings_Append((CHAR*)" -o ", 5, (void*)cmd, 1023); + Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); + Strings_Append((CHAR*)" -L\"", 5, (void*)cmd, 1023); + Strings_Append((CHAR*)"/opt/voc", 9, (void*)cmd, 1023); + Strings_Append((CHAR*)"/lib\"", 6, (void*)cmd, 1023); + Strings_Append((CHAR*)" -l voc", 8, (void*)cmd, 1023); + extTools_execute((CHAR*)"Assemble and link: ", 20, cmd, 1023); __DEL(additionalopts); } @@ -102,11 +102,11 @@ export void *extTools__init(void) __MODULE_IMPORT(Strings); __REGMOD("extTools", 0); /* BEGIN */ - Strings_Append((CHAR*)" -I \"", (LONGINT)6, (void*)extTools_compilationOptions, ((LONGINT)(1023))); - Strings_Append((CHAR*)"/opt/voc", (LONGINT)9, (void*)extTools_compilationOptions, ((LONGINT)(1023))); - Strings_Append((CHAR*)"/include\" ", (LONGINT)11, (void*)extTools_compilationOptions, ((LONGINT)(1023))); - Platform_GetEnv((CHAR*)"CFLAGS", (LONGINT)7, (void*)extTools_CFLAGS, ((LONGINT)(1023))); - Strings_Append(extTools_CFLAGS, ((LONGINT)(1023)), (void*)extTools_compilationOptions, ((LONGINT)(1023))); - Strings_Append((CHAR*)" ", (LONGINT)2, (void*)extTools_compilationOptions, ((LONGINT)(1023))); + Strings_Append((CHAR*)" -I \"", 6, (void*)extTools_compilationOptions, 1023); + Strings_Append((CHAR*)"/opt/voc", 9, (void*)extTools_compilationOptions, 1023); + Strings_Append((CHAR*)"/include\" ", 11, (void*)extTools_compilationOptions, 1023); + Platform_GetEnv((CHAR*)"CFLAGS", 7, (void*)extTools_CFLAGS, 1023); + Strings_Append(extTools_CFLAGS, 1023, (void*)extTools_compilationOptions, 1023); + Strings_Append((CHAR*)" ", 2, (void*)extTools_compilationOptions, 1023); __ENDMOD; } diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index 38d2da7b..fb0797f3 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-44/vt100.c b/bootstrap/unix-44/vt100.c index 5eb4f70e..dfe62efa 100644 --- a/bootstrap/unix-44/vt100.c +++ b/bootstrap/unix-44/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Strings.h" @@ -68,12 +68,12 @@ void vt100_IntToStr (LONGINT int_, CHAR *str, LONGINT str__len) } e = s; do { - b[__X(e, ((LONGINT)(21)))] = (CHAR)(__MOD(int_, 10) + 48); + b[__X(e, 21)] = (CHAR)((int)__MOD(int_, 10) + 48); int_ = __DIV(int_, 10); e += 1; } while (!(int_ == 0)); - b[__X(e, ((LONGINT)(21)))] = 0x00; - vt100_Reverse0((void*)b, ((LONGINT)(21)), s, e - 1); + b[__X(e, 21)] = 0x00; + vt100_Reverse0((void*)b, 21, s, e - 1); } __COPY(b, str, str__len); } @@ -82,9 +82,9 @@ static void vt100_EscSeq0 (CHAR *letter, LONGINT letter__len) { CHAR cmd[9]; __DUP(letter, letter__len, CHAR); - __COPY(vt100_CSI, cmd, ((LONGINT)(9))); - Strings_Append(letter, letter__len, (void*)cmd, ((LONGINT)(9))); - Console_String(cmd, ((LONGINT)(9))); + __COPY(vt100_CSI, cmd, 9); + Strings_Append(letter, letter__len, (void*)cmd, 9); + Console_String(cmd, 9); __DEL(letter); } @@ -93,11 +93,11 @@ static void vt100_EscSeq (INTEGER n, CHAR *letter, LONGINT letter__len) CHAR nstr[2]; CHAR cmd[7]; __DUP(letter, letter__len, CHAR); - vt100_IntToStr(n, (void*)nstr, ((LONGINT)(2))); - __COPY(vt100_CSI, cmd, ((LONGINT)(7))); - Strings_Append(nstr, ((LONGINT)(2)), (void*)cmd, ((LONGINT)(7))); - Strings_Append(letter, letter__len, (void*)cmd, ((LONGINT)(7))); - Console_String(cmd, ((LONGINT)(7))); + vt100_IntToStr(n, (void*)nstr, 2); + __COPY(vt100_CSI, cmd, 7); + Strings_Append(nstr, 2, (void*)cmd, 7); + Strings_Append(letter, letter__len, (void*)cmd, 7); + Console_String(cmd, 7); __DEL(letter); } @@ -106,11 +106,11 @@ static void vt100_EscSeqSwapped (INTEGER n, CHAR *letter, LONGINT letter__len) CHAR nstr[2]; CHAR cmd[7]; __DUP(letter, letter__len, CHAR); - vt100_IntToStr(n, (void*)nstr, ((LONGINT)(2))); - __COPY(vt100_CSI, cmd, ((LONGINT)(7))); - Strings_Append(letter, letter__len, (void*)cmd, ((LONGINT)(7))); - Strings_Append(nstr, ((LONGINT)(2)), (void*)cmd, ((LONGINT)(7))); - Console_String(cmd, ((LONGINT)(7))); + vt100_IntToStr(n, (void*)nstr, 2); + __COPY(vt100_CSI, cmd, 7); + Strings_Append(letter, letter__len, (void*)cmd, 7); + Strings_Append(nstr, 2, (void*)cmd, 7); + Console_String(cmd, 7); __DEL(letter); } @@ -119,124 +119,124 @@ static void vt100_EscSeq2 (INTEGER n, INTEGER m, CHAR *letter, LONGINT letter__l CHAR nstr[5], mstr[5]; CHAR cmd[12]; __DUP(letter, letter__len, CHAR); - vt100_IntToStr(n, (void*)nstr, ((LONGINT)(5))); - vt100_IntToStr(m, (void*)mstr, ((LONGINT)(5))); - __COPY(vt100_CSI, cmd, ((LONGINT)(12))); - Strings_Append(nstr, ((LONGINT)(5)), (void*)cmd, ((LONGINT)(12))); - Strings_Append((CHAR*)";", (LONGINT)2, (void*)cmd, ((LONGINT)(12))); - Strings_Append(mstr, ((LONGINT)(5)), (void*)cmd, ((LONGINT)(12))); - Strings_Append(letter, letter__len, (void*)cmd, ((LONGINT)(12))); - Console_String(cmd, ((LONGINT)(12))); + vt100_IntToStr(n, (void*)nstr, 5); + vt100_IntToStr(m, (void*)mstr, 5); + __COPY(vt100_CSI, cmd, 12); + Strings_Append(nstr, 5, (void*)cmd, 12); + Strings_Append((CHAR*)";", 2, (void*)cmd, 12); + Strings_Append(mstr, 5, (void*)cmd, 12); + Strings_Append(letter, letter__len, (void*)cmd, 12); + Console_String(cmd, 12); __DEL(letter); } void vt100_CUU (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"A", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"A", 2); } void vt100_CUD (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"B", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"B", 2); } void vt100_CUF (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"C", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"C", 2); } void vt100_CUB (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"D", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"D", 2); } void vt100_CNL (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"E", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"E", 2); } void vt100_CPL (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"F", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"F", 2); } void vt100_CHA (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"G", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"G", 2); } void vt100_CUP (INTEGER n, INTEGER m) { - vt100_EscSeq2(n, m, (CHAR*)"H", (LONGINT)2); + vt100_EscSeq2(n, m, (CHAR*)"H", 2); } void vt100_ED (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"J", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"J", 2); } void vt100_EL (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"K", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"K", 2); } void vt100_SU (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"S", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"S", 2); } void vt100_SD (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"T", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"T", 2); } void vt100_HVP (INTEGER n, INTEGER m) { - vt100_EscSeq2(n, m, (CHAR*)"f", (LONGINT)2); + vt100_EscSeq2(n, m, (CHAR*)"f", 2); } void vt100_SGR (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"m", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"m", 2); } void vt100_SGR2 (INTEGER n, INTEGER m) { - vt100_EscSeq2(n, m, (CHAR*)"m", (LONGINT)2); + vt100_EscSeq2(n, m, (CHAR*)"m", 2); } void vt100_DSR (INTEGER n) { - vt100_EscSeq(6, (CHAR*)"n", (LONGINT)2); + vt100_EscSeq(6, (CHAR*)"n", 2); } void vt100_SCP (void) { - vt100_EscSeq0((CHAR*)"s", (LONGINT)2); + vt100_EscSeq0((CHAR*)"s", 2); } void vt100_RCP (void) { - vt100_EscSeq0((CHAR*)"u", (LONGINT)2); + vt100_EscSeq0((CHAR*)"u", 2); } void vt100_DECTCEMl (void) { - vt100_EscSeq0((CHAR*)"\?25l", (LONGINT)5); + vt100_EscSeq0((CHAR*)"\?25l", 5); } void vt100_DECTCEMh (void) { - vt100_EscSeq0((CHAR*)"\?25h", (LONGINT)5); + vt100_EscSeq0((CHAR*)"\?25h", 5); } void vt100_SetAttr (CHAR *attr, LONGINT attr__len) { CHAR tmpstr[16]; __DUP(attr, attr__len, CHAR); - __COPY(vt100_CSI, tmpstr, ((LONGINT)(16))); - Strings_Append(attr, attr__len, (void*)tmpstr, ((LONGINT)(16))); - Console_String(tmpstr, ((LONGINT)(16))); + __COPY(vt100_CSI, tmpstr, 16); + Strings_Append(attr, attr__len, (void*)tmpstr, 16); + Console_String(tmpstr, 16); __DEL(attr); } @@ -252,7 +252,7 @@ export void *vt100__init(void) __REGCMD("RCP", vt100_RCP); __REGCMD("SCP", vt100_SCP); /* BEGIN */ - __COPY("\033", vt100_CSI, ((LONGINT)(5))); - Strings_Append((CHAR*)"[", (LONGINT)2, (void*)vt100_CSI, ((LONGINT)(5))); + __COPY("\033", vt100_CSI, 5); + Strings_Append((CHAR*)"[", 2, (void*)vt100_CSI, 5); __ENDMOD; } diff --git a/bootstrap/unix-44/vt100.h b/bootstrap/unix-44/vt100.h index 770cf66d..73d985c9 100644 --- a/bootstrap/unix-44/vt100.h +++ b/bootstrap/unix-44/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index 947863a2..eed3c4f0 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -13,6 +13,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/08/30] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/08/31] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index 33303334..90696149 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Console.c b/bootstrap/unix-48/Console.c index 375896e6..124f7163 100644 --- a/bootstrap/unix-48/Console.c +++ b/bootstrap/unix-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Platform.h" @@ -21,7 +21,7 @@ export void Console_String (CHAR *s, LONGINT s__len); void Console_Flush (void) { INTEGER error; - error = Platform_Write(((LONGINT)(1)), (LONGINT)(SYSTEM_ADRINT)Console_line, Console_pos); + error = Platform_Write(1, (SYSTEM_ADRINT)Console_line, Console_pos); Console_pos = 0; } @@ -30,7 +30,7 @@ void Console_Char (CHAR ch) if (Console_pos == 128) { Console_Flush(); } - Console_line[__X(Console_pos, ((LONGINT)(128)))] = ch; + Console_line[__X(Console_pos, 128)] = ch; Console_pos += 1; if (ch == 0x0a) { Console_Flush(); @@ -58,17 +58,17 @@ void Console_Int (LONGINT i, LONGINT n) k = 10; } else { i1 = __ABS(i); - s[0] = (CHAR)(__MOD(i1, 10) + 48); + s[0] = (CHAR)((int)__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k = 1; while (i1 > 0) { - s[__X(k, ((LONGINT)(32)))] = (CHAR)(__MOD(i1, 10) + 48); + s[__X(k, 32)] = (CHAR)((int)__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k += 1; } } if (i < 0) { - s[__X(k, ((LONGINT)(32)))] = '-'; + s[__X(k, 32)] = '-'; k += 1; } while (n > k) { @@ -77,7 +77,7 @@ void Console_Int (LONGINT i, LONGINT n) } while (k > 0) { k -= 1; - Console_Char(s[__X(k, ((LONGINT)(32)))]); + Console_Char(s[__X(k, 32)]); } } @@ -89,9 +89,9 @@ void Console_Ln (void) void Console_Bool (BOOLEAN b) { if (b) { - Console_String((CHAR*)"TRUE", (LONGINT)5); + Console_String((CHAR*)"TRUE", 5); } else { - Console_String((CHAR*)"FALSE", (LONGINT)6); + Console_String((CHAR*)"FALSE", 6); } } @@ -115,7 +115,7 @@ void Console_Read (CHAR *ch) LONGINT n; INTEGER error; Console_Flush(); - error = Platform_ReadBuf(((LONGINT)(0)), (void*)&*ch, ((LONGINT)(1)), &n); + error = Platform_ReadBuf(0, (void*)&*ch, 1, &n); if (n != 1) { *ch = 0x00; } diff --git a/bootstrap/unix-48/Console.h b/bootstrap/unix-48/Console.h index 0e7cb823..fad0f676 100644 --- a/bootstrap/unix-48/Console.h +++ b/bootstrap/unix-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 069b901c..05991786 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" @@ -110,23 +110,23 @@ static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INTEGER errcode) { __DUP(s, s__len, CHAR); Console_Ln(); - Console_String((CHAR*)"-- ", (LONGINT)4); + Console_String((CHAR*)"-- ", 4); Console_String(s, s__len); - Console_String((CHAR*)": ", (LONGINT)3); + Console_String((CHAR*)": ", 3); if (f != NIL) { if (f->registerName[0] != 0x00) { - Console_String(f->registerName, ((LONGINT)(101))); + Console_String(f->registerName, 101); } else { - Console_String(f->workName, ((LONGINT)(101))); + Console_String(f->workName, 101); } if (f->fd != 0) { - Console_String((CHAR*)"f.fd = ", (LONGINT)8); - Console_Int(f->fd, ((LONGINT)(1))); + Console_String((CHAR*)"f.fd = ", 8); + Console_Int(f->fd, 1); } } if (errcode != 0) { - Console_String((CHAR*)" errcode = ", (LONGINT)12); - Console_Int(errcode, ((LONGINT)(1))); + Console_String((CHAR*)" errcode = ", 12); + Console_Int(errcode, 1); } Console_Ln(); __HALT(99); @@ -192,7 +192,7 @@ static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *na name[i + 5] = '.'; i += 6; while (n > 0) { - name[i] = (CHAR)(__MOD(n, 10) + 48); + name[i] = (CHAR)((int)__MOD(n, 10) + 48); n = __DIV(n, 10); i += 1; } @@ -200,7 +200,7 @@ static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *na i += 1; n = Platform_PID; while (n > 0) { - name[i] = (CHAR)(__MOD(n, 10) + 48); + name[i] = (CHAR)((int)__MOD(n, 10) + 48); n = __DIV(n, 10); i += 1; } @@ -216,15 +216,15 @@ static void Files_Create (Files_File f) CHAR err[32]; if (f->fd == -1) { if (f->state == 1) { - Files_GetTempName(f->registerName, ((LONGINT)(101)), (void*)f->workName, ((LONGINT)(101))); + Files_GetTempName(f->registerName, 101, (void*)f->workName, 101); f->tempFile = 1; } else if (f->state == 2) { - __COPY(f->registerName, f->workName, ((LONGINT)(101))); + __COPY(f->registerName, f->workName, 101); f->registerName[0] = 0x00; f->tempFile = 0; } - error = Platform_Unlink((void*)f->workName, ((LONGINT)(101))); - error = Platform_New((void*)f->workName, ((LONGINT)(101)), &f->fd); + error = Platform_Unlink((void*)f->workName, 101); + error = Platform_New((void*)f->workName, 101, &f->fd); done = error == 0; if (done) { f->next = Files_files; @@ -242,7 +242,7 @@ static void Files_Create (Files_File f) } else { __MOVE("file not created", err, 17); } - Files_Err(err, ((LONGINT)(32)), f, error); + Files_Err(err, 32, f, error); } } } @@ -257,15 +257,15 @@ static void Files_Flush (Files_Buffer buf) if (buf->org != f->pos) { error = Platform_Seek(f->fd, buf->org, Platform_SeekSet); } - error = Platform_Write(f->fd, (LONGINT)(SYSTEM_ADRINT)buf->data, buf->size); + error = Platform_Write(f->fd, (SYSTEM_ADRINT)buf->data, buf->size); if (error != 0) { - Files_Err((CHAR*)"error writing file", (LONGINT)19, f, error); + Files_Err((CHAR*)"error writing file", 19, f, error); } f->pos = buf->org + buf->size; buf->chg = 0; error = Platform_Identify(f->fd, &f->identity, Platform_FileIdentity__typ); if (error != 0) { - Files_Err((CHAR*)"error identifying file", (LONGINT)23, f, error); + Files_Err((CHAR*)"error identifying file", 23, f, error); } } } @@ -304,7 +304,7 @@ void Files_Close (Files_File f) } error = Platform_Sync(f->fd); if (error != 0) { - Files_Err((CHAR*)"error writing file", (LONGINT)19, f, error); + Files_Err((CHAR*)"error writing file", 19, f, error); } Files_CloseOSFile(f); } @@ -324,7 +324,7 @@ Files_File Files_New (CHAR *name, LONGINT name__len) __DUP(name, name__len, CHAR); __NEW(f, Files_FileDesc); f->workName[0] = 0x00; - __COPY(name, f->registerName, ((LONGINT)(101))); + __COPY(name, f->registerName, 101); f->fd = -1; f->state = 1; f->len = 0; @@ -437,28 +437,28 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) if (name[0] != 0x00) { if (Files_HasDir((void*)name, name__len)) { dir[0] = 0x00; - __COPY(name, path, ((LONGINT)(256))); + __COPY(name, path, 256); } else { pos = 0; - Files_ScanPath(&pos, (void*)dir, ((LONGINT)(256))); - Files_MakeFileName(dir, ((LONGINT)(256)), name, name__len, (void*)path, ((LONGINT)(256))); - Files_ScanPath(&pos, (void*)dir, ((LONGINT)(256))); + Files_ScanPath(&pos, (void*)dir, 256); + Files_MakeFileName(dir, 256, name, name__len, (void*)path, 256); + Files_ScanPath(&pos, (void*)dir, 256); } for (;;) { - error = Platform_OldRW((void*)path, ((LONGINT)(256)), &fd); + error = Platform_OldRW((void*)path, 256, &fd); done = error == 0; if ((!done && Platform_TooManyFiles(error))) { - Files_Err((CHAR*)"too many files open", (LONGINT)20, f, error); + Files_Err((CHAR*)"too many files open", 20, f, error); } if ((!done && Platform_Inaccessible(error))) { - error = Platform_OldRO((void*)path, ((LONGINT)(256)), &fd); + error = Platform_OldRO((void*)path, 256, &fd); done = error == 0; } if ((!done && !Platform_Absent(error))) { - Console_String((CHAR*)"Warning: Files.Old ", (LONGINT)20); + Console_String((CHAR*)"Warning: Files.Old ", 20); Console_String(name, name__len); - Console_String((CHAR*)" error = ", (LONGINT)10); - Console_Int(error, ((LONGINT)(0))); + Console_String((CHAR*)" error = ", 10); + Console_Int(error, 0); Console_Ln(); } if (done) { @@ -476,7 +476,7 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) f->pos = 0; f->swapper = -1; error = Platform_Size(fd, &f->len); - __COPY(name, f->workName, ((LONGINT)(101))); + __COPY(name, f->workName, 101); f->registerName[0] = 0x00; f->tempFile = 0; f->identity = identity; @@ -492,8 +492,8 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) __DEL(name); return _o_result; } else { - Files_MakeFileName(dir, ((LONGINT)(256)), name, name__len, (void*)path, ((LONGINT)(256))); - Files_ScanPath(&pos, (void*)dir, ((LONGINT)(256))); + Files_MakeFileName(dir, 256, name, name__len, (void*)path, 256); + Files_ScanPath(&pos, (void*)dir, 256); } } } else { @@ -518,8 +518,8 @@ void Files_Purge (Files_File f) i += 1; } if (f->fd != -1) { - error = Platform_Truncate(f->fd, ((LONGINT)(0))); - error = Platform_Seek(f->fd, ((LONGINT)(0)), Platform_SeekSet); + error = Platform_Truncate(f->fd, 0); + error = Platform_Seek(f->fd, 0, Platform_SeekSet); } f->pos = 0; f->len = 0; @@ -584,9 +584,9 @@ void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, LONGINT pos) if (f->pos != org) { error = Platform_Seek(f->fd, org, Platform_SeekSet); } - error = Platform_ReadBuf(f->fd, (void*)buf->data, ((LONGINT)(4096)), &n); + error = Platform_ReadBuf(f->fd, (void*)buf->data, 4096, &n); if (error != 0) { - Files_Err((CHAR*)"read from file not done", (LONGINT)24, f, error); + Files_Err((CHAR*)"read from file not done", 24, f, error); } f->pos = org + n; buf->size = n; @@ -656,7 +656,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x } else { min = n; } - __MOVE((LONGINT)(SYSTEM_ADRINT)buf->data + offset, (LONGINT)(SYSTEM_ADRINT)x + xpos, min); + __MOVE((SYSTEM_ADRINT)buf->data + offset, (SYSTEM_ADRINT)x + xpos, min); offset += min; (*r).offset = offset; xpos += min; @@ -668,7 +668,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x void Files_ReadByte (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len) { - Files_ReadBytes(&*r, r__typ, (void*)x, x__len * ((LONGINT)(1)), ((LONGINT)(1))); + Files_ReadBytes(&*r, r__typ, (void*)x, x__len * 1, 1); } Files_File Files_Base (Files_Rider *r, LONGINT *r__typ) @@ -721,7 +721,7 @@ void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT } else { min = n; } - __MOVE((LONGINT)(SYSTEM_ADRINT)x + xpos, (LONGINT)(SYSTEM_ADRINT)buf->data + offset, min); + __MOVE((SYSTEM_ADRINT)x + xpos, (SYSTEM_ADRINT)buf->data + offset, min); offset += min; (*r).offset = offset; if (offset > buf->size) { @@ -772,15 +772,15 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT *res = 3; return; } - error = Platform_Read(fdold, (LONGINT)(SYSTEM_ADRINT)buf, ((LONGINT)(4096)), &n); + error = Platform_Read(fdold, (SYSTEM_ADRINT)buf, 4096, &n); while (n > 0) { - error = Platform_Write(fdnew, (LONGINT)(SYSTEM_ADRINT)buf, n); + error = Platform_Write(fdnew, (SYSTEM_ADRINT)buf, n); if (error != 0) { ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); - Files_Err((CHAR*)"cannot move file", (LONGINT)17, NIL, error); + Files_Err((CHAR*)"cannot move file", 17, NIL, error); } - error = Platform_Read(fdold, (LONGINT)(SYSTEM_ADRINT)buf, ((LONGINT)(4096)), &n); + error = Platform_Read(fdold, (SYSTEM_ADRINT)buf, 4096, &n); } ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); @@ -788,7 +788,7 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT error = Platform_Unlink((void*)old, old__len); *res = 0; } else { - Files_Err((CHAR*)"cannot move file", (LONGINT)17, NIL, error); + Files_Err((CHAR*)"cannot move file", 17, NIL, error); } } } else { @@ -808,12 +808,12 @@ void Files_Register (Files_File f) } Files_Close(f); if (f->registerName[0] != 0x00) { - Files_Rename(f->workName, ((LONGINT)(101)), f->registerName, ((LONGINT)(101)), &errcode); + Files_Rename(f->workName, 101, f->registerName, 101, &errcode); if (errcode != 0) { - __COPY(f->registerName, file, ((LONGINT)(104))); + __COPY(f->registerName, file, 104); __HALT(99); } - __COPY(f->registerName, f->workName, ((LONGINT)(101))); + __COPY(f->registerName, f->workName, 101); f->registerName[0] = 0x00; f->tempFile = 0; } @@ -838,7 +838,7 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *de j += 1; } } else { - __MOVE((LONGINT)(SYSTEM_ADRINT)src, (LONGINT)(SYSTEM_ADRINT)dest, src__len); + __MOVE((SYSTEM_ADRINT)src, (SYSTEM_ADRINT)dest, src__len); } } @@ -850,38 +850,38 @@ void Files_ReadBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN *x) void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, INTEGER *x) { CHAR b[2]; - Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(2)), ((LONGINT)(2))); - *x = (int)b[0] + __ASHL((int)b[1], 8); + Files_ReadBytes(&*R, R__typ, (void*)b, 2, 2); + *x = b[0] + __ASHL(b[1], 8); } void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, LONGINT *x) { CHAR b[4]; - Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); - *x = ((int)((int)b[0] + __ASHL((int)b[1], 8)) + __ASHL((int)b[2], 16)) + __ASHL((int)b[3], 24); + Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); + *x = ((b[0] + __ASHL(b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); } void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x) { CHAR b[4]; LONGINT l; - Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); - l = ((int)((int)b[0] + __ASHL((int)b[1], 8)) + __ASHL((int)b[2], 16)) + __ASHL((int)b[3], 24); - *x = (SET)l; + Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); + l = ((b[0] + __ASHL(b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); + *x = __VAL(SET, l); } void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x) { CHAR b[4]; - Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); - Files_FlipBytes((void*)b, ((LONGINT)(4)), (void*)&*x, ((LONGINT)(4))); + Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); + Files_FlipBytes((void*)b, 4, (void*)&*x, 4); } void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x) { CHAR b[8]; - Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(8)), ((LONGINT)(8))); - Files_FlipBytes((void*)b, ((LONGINT)(8)), (void*)&*x, ((LONGINT)(8))); + Files_ReadBytes(&*R, R__typ, (void*)b, 8, 8); + Files_FlipBytes((void*)b, 8, (void*)&*x, 8); } void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) @@ -922,12 +922,12 @@ void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, LONGINT *x) s = 0; n = 0; Files_Read(&*R, R__typ, (void*)&ch); - while ((int)ch >= 128) { - n += __ASH((int)((int)ch - 128), s); + while (ch >= 128) { + n += __ASH((ch - 128), s); s += 7; Files_Read(&*R, R__typ, (void*)&ch); } - n += __ASH((int)(__MASK((int)ch, -64) - __ASHL(__ASHR((int)ch, 6), 6)), s); + n += __ASH((__MASK(ch, -64) - __ASHL(__ASHR(ch, 6), 6)), s); *x = n; } @@ -941,7 +941,7 @@ void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, INTEGER x) CHAR b[2]; b[0] = (CHAR)x; b[1] = (CHAR)__ASHR(x, 8); - Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(2)), ((LONGINT)(2))); + Files_WriteBytes(&*R, R__typ, (void*)b, 2, 2); } void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, LONGINT x) @@ -951,33 +951,33 @@ void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, LONGINT x) b[1] = (CHAR)__ASHR(x, 8); b[2] = (CHAR)__ASHR(x, 16); b[3] = (CHAR)__ASHR(x, 24); - Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); + Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x) { CHAR b[4]; LONGINT i; - i = (LONGINT)x; + i = __VAL(LONGINT, x); b[0] = (CHAR)i; b[1] = (CHAR)__ASHR(i, 8); b[2] = (CHAR)__ASHR(i, 16); b[3] = (CHAR)__ASHR(i, 24); - Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); + Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x) { CHAR b[4]; - Files_FlipBytes((void*)&x, ((LONGINT)(4)), (void*)b, ((LONGINT)(4))); - Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); + Files_FlipBytes((void*)&x, 4, (void*)b, 4); + Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x) { CHAR b[8]; - Files_FlipBytes((void*)&x, ((LONGINT)(8)), (void*)b, ((LONGINT)(8))); - Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(8)), ((LONGINT)(8))); + Files_FlipBytes((void*)&x, 8, (void*)b, 8); + Files_WriteBytes(&*R, R__typ, (void*)b, 8, 8); } void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) @@ -987,7 +987,7 @@ void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len while (x[i] != 0x00) { i += 1; } - Files_WriteBytes(&*R, R__typ, (void*)x, x__len * ((LONGINT)(1)), i + 1); + Files_WriteBytes(&*R, R__typ, (void*)x, x__len * 1, i + 1); } void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, LONGINT x) @@ -1012,7 +1012,7 @@ static void Files_Finalize (SYSTEM_PTR o) if (f->fd >= 0) { Files_CloseOSFile(f); if (f->tempFile) { - res = Platform_Unlink((void*)f->workName, ((LONGINT)(101))); + res = Platform_Unlink((void*)f->workName, 101); } } } @@ -1021,7 +1021,7 @@ void Files_SetSearchPath (CHAR *path, LONGINT path__len) { __DUP(path, path__len, CHAR); if (Strings_Length(path, path__len) != 0) { - Files_SearchPath = __NEWARR(NIL, ((LONGINT)(1)), 1, 1, 1, (LONGINT)(Strings_Length(path, path__len) + 1)); + Files_SearchPath = __NEWARR(NIL, 1, 1, 1, 1, ((SYSTEM_ADRINT)((Strings_Length(path, path__len) + 1)))); __COPY(path, Files_SearchPath->data, Files_SearchPath->len[0]); } else { Files_SearchPath = NIL; @@ -1055,6 +1055,6 @@ export void *Files__init(void) Files_tempno = -1; Heap_FileCount = 0; Files_HOME[0] = 0x00; - Platform_GetEnv((CHAR*)"HOME", (LONGINT)5, (void*)Files_HOME, ((LONGINT)(1024))); + Platform_GetEnv((CHAR*)"HOME", 5, (void*)Files_HOME, 1024); __ENDMOD; } diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index 7241c31a..61089cbd 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index 5fcaf193..e42a752c 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tskSfF */ #include "SYSTEM.h" struct Heap__1 { @@ -116,7 +116,7 @@ void Heap_Unlock (void) { Heap_lockdepth -= 1; if ((Heap_interrupted && Heap_lockdepth == 0)) { - Heap_PlatformHalt(((LONGINT)(-9))); + Heap_PlatformHalt(-9); } } @@ -131,7 +131,7 @@ SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) } m->types = 0; m->cmds = NIL; - __COPY(name, m->name, ((LONGINT)(20))); + __COPY(name, m->name, 20); m->refcnt = 0; m->enumPtrs = enumPtrs; m->next = (Heap_Module)(SYSTEM_ADRINT)Heap_modules; @@ -148,7 +148,7 @@ void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) } else { __NEW(c, Heap_CmdDesc); } - __COPY(name, c->name, ((LONGINT)(24))); + __COPY(name, c->name, 24); c->cmd = cmd; c->next = m->cmds; m->cmds = c; @@ -326,12 +326,12 @@ SYSTEM_PTR Heap_NEWBLK (LONGINT size) SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 31, 4), 4); - new = Heap_NEWREC((LONGINT)(SYSTEM_ADRINT)&blksz); - tag = ((LONGINT)(SYSTEM_ADRINT)new + blksz) - 12; + new = Heap_NEWREC((SYSTEM_ADRINT)&blksz); + tag = (__VAL(LONGINT, new) + blksz) - 12; __PUT(tag - 4, 0, LONGINT); __PUT(tag, blksz, LONGINT); __PUT(tag + 4, -4, LONGINT); - __PUT((LONGINT)(SYSTEM_ADRINT)new - 4, tag, LONGINT); + __PUT(__VAL(LONGINT, new) - 4, tag, LONGINT); Heap_Unlock(); _o_result = new; return _o_result; @@ -360,7 +360,7 @@ static void Heap_Mark (LONGINT q) __GET(tag, offset, LONGINT); fld = q + offset; p = Heap_FetchAddress(fld); - __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)n, SYSTEM_PTR); + __PUT(fld, __VAL(SYSTEM_PTR, n), SYSTEM_PTR); } else { fld = q + offset; n = Heap_FetchAddress(fld); @@ -369,7 +369,7 @@ static void Heap_Mark (LONGINT q) if (!__ODD(tagbits)) { __PUT(n - 4, tagbits + 1, LONGINT); __PUT(q - 4, tag + 1, LONGINT); - __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)p, SYSTEM_PTR); + __PUT(fld, __VAL(SYSTEM_PTR, p), SYSTEM_PTR); p = q; q = n; tag = tagbits; @@ -384,7 +384,7 @@ static void Heap_Mark (LONGINT q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((LONGINT)(SYSTEM_ADRINT)p); + Heap_Mark(__VAL(LONGINT, p)); } static void Heap_Scan (void) @@ -553,7 +553,7 @@ static void Heap_Finalize (void) } else { prev->next = n->next; } - (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); + (*n->finalize)(__VAL(SYSTEM_PTR, n->obj)); if (prev == NIL) { n = Heap_fin; } else { @@ -572,7 +572,7 @@ void Heap_FINALL (void) while (Heap_fin != NIL) { n = Heap_fin; Heap_fin = Heap_fin->next; - (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); + (*n->finalize)(__VAL(SYSTEM_PTR, n->obj)); } } @@ -589,9 +589,9 @@ static void Heap_MarkStack (LONGINT n, LONGINT *cand, LONGINT cand__len) } if (n == 0) { nofcand = 0; - sp = (LONGINT)(SYSTEM_ADRINT)&frame; + sp = (SYSTEM_ADRINT)&frame; stack0 = Heap_PlatformMainStackFrame(); - inc = (LONGINT)(SYSTEM_ADRINT)&align.p - (LONGINT)(SYSTEM_ADRINT)&align; + inc = (SYSTEM_ADRINT)&align.p - (SYSTEM_ADRINT)&align; if (sp > stack0) { inc = -inc; } @@ -680,7 +680,7 @@ void Heap_GC (BOOLEAN markStack) i22 += 23; i23 += 24; if ((i0 == -99 && i15 == 24)) { - Heap_MarkStack(((LONGINT)(32)), (void*)cand, ((LONGINT)(10000))); + Heap_MarkStack(32, (void*)cand, 10000); break; } } @@ -699,7 +699,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (LONGINT)(SYSTEM_ADRINT)obj; + f->obj = __VAL(LONGINT, obj); f->finalize = finalize; f->marked = 1; f->next = Heap_fin; diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index 4247d33d..4d5c5b4e 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index 148c062a..9f39f448 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Heap.h" @@ -83,10 +83,10 @@ Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len) Modules_resMsg[0] = 0x00; } else { Modules_res = 1; - __COPY(name, Modules_importing, ((LONGINT)(20))); + __COPY(name, Modules_importing, 20); __MOVE(" module \"", Modules_resMsg, 10); - Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), name, name__len); - Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), (CHAR*)"\" not found", (LONGINT)12); + Modules_Append((void*)Modules_resMsg, 256, name, name__len); + Modules_Append((void*)Modules_resMsg, 256, (CHAR*)"\" not found", 12); } _o_result = m; __DEL(name); @@ -111,11 +111,11 @@ Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT nam } else { Modules_res = 2; __MOVE(" command \"", Modules_resMsg, 11); - __COPY(name, Modules_importing, ((LONGINT)(20))); - Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), mod->name, ((LONGINT)(20))); - Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), (CHAR*)".", (LONGINT)2); - Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), name, name__len); - Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), (CHAR*)"\" not found", (LONGINT)12); + __COPY(name, Modules_importing, 20); + Modules_Append((void*)Modules_resMsg, 256, mod->name, 20); + Modules_Append((void*)Modules_resMsg, 256, (CHAR*)".", 2); + Modules_Append((void*)Modules_resMsg, 256, name, name__len); + Modules_Append((void*)Modules_resMsg, 256, (CHAR*)"\" not found", 12); _o_result = NIL; __DEL(name); return _o_result; diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index 85b1ec59..1707868f 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index 9a06ac24..73416071 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" @@ -271,7 +271,7 @@ OPT_Node OPB_NewString (OPS_String str, LONGINT len) x->conval->intval = -1; x->conval->intval2 = len; x->conval->ext = OPT_NewExt(); - __COPY(str, *x->conval->ext, ((LONGINT)(256))); + __COPY(str, *x->conval->ext, 256); _o_result = x; return _o_result; } @@ -468,7 +468,7 @@ void OPB_In (OPT_Node *x, OPT_Node y) } else if ((__IN(f, 0x70) && y->typ->form == 9)) { if ((*x)->class == 7) { k = (*x)->conval->intval; - if (k < 0 || k > (int)OPM_MaxSet) { + if (k < 0 || k > OPM_MaxSet) { OPB_err(202); } else if (y->class == 7) { (*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval)); @@ -618,7 +618,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) case 22: if (f == 3) { if (z->class == 7) { - z->conval->intval = (int)__CAP((CHAR)z->conval->intval); + z->conval->intval = __CAP((CHAR)z->conval->intval); z->obj = NIL; } else { z = NewOp__29(op, typ, z); @@ -666,8 +666,8 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->typ = OPT_booltyp; break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPB.MOp, op = ", (LONGINT)33); - OPM_LogWNum(op, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPB.MOp, op = ", 33); + OPM_LogWNum(op, 0); OPM_LogWLn(); break; } @@ -826,8 +826,8 @@ static INTEGER ConstCmp__14 (void) } break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPB.ConstCmp, f = ", (LONGINT)37); - OPM_LogWNum(*ConstOp__13_s->f, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPB.ConstCmp, f = ", 37); + OPM_LogWNum(*ConstOp__13_s->f, 0); OPM_LogWLn(); break; } @@ -1002,7 +1002,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) case 4: if (__IN(f, 0x70)) { if (yval->intval != 0) { - xval->intval = __MOD(xval->intval, yval->intval); + xval->intval = (int)__MOD(xval->intval, yval->intval); OPB_SetIntType(x); } else { OPB_err(205); @@ -1105,8 +1105,8 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPB.ConstOp, op = ", (LONGINT)37); - OPM_LogWNum(op, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPB.ConstOp, op = ", 37); + OPM_LogWNum(op, 0); OPM_LogWLn(); break; } @@ -1149,12 +1149,12 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) OPB_err(203); r = (LONGREAL)1; } - (*x)->conval->intval = (int)__ENTIER(r); + (*x)->conval->intval = (SYSTEM_INT32)__ENTIER(r); OPB_SetIntType(*x); } } (*x)->obj = NIL; - } else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((int)(*x)->left->typ->form < f || f > g))) { + } else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((*x)->left->typ->form < f || f > g))) { if ((*x)->left->typ == typ) { *x = (*x)->left; } @@ -1207,11 +1207,11 @@ static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) if ((*Op__38_s->f == 10 && (*x)->conval->intval2 == 1)) { (*x)->typ = OPT_chartyp; (*x)->conval->intval = 0; - OPB_Index(&*y, OPB_NewIntConst(((LONGINT)(0)))); + OPB_Index(&*y, OPB_NewIntConst(0)); } else if ((*Op__38_s->g == 10 && (*y)->conval->intval2 == 1)) { (*y)->typ = OPT_chartyp; (*y)->conval->intval = 0; - OPB_Index(&*x, OPB_NewIntConst(((LONGINT)(0)))); + OPB_Index(&*x, OPB_NewIntConst(0)); } } _o_result = ok; @@ -1475,7 +1475,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) typ = OPT_booltyp; } else { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"ELSE in Op()", (LONGINT)13); + OPM_LogWStr((CHAR*)"ELSE in Op()", 13); OPM_LogWLn(); OPB_err(108); typ = OPT_undftyp; @@ -1483,8 +1483,8 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) NewOp__39(op, typ, &z, y); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPB.Op, op = ", (LONGINT)32); - OPM_LogWNum(op, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPB.Op, op = ", 32); + OPM_LogWNum(op, 0); OPM_LogWLn(); break; } @@ -1501,13 +1501,13 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y) } else if ((__IN((*x)->typ->form, 0x70) && __IN(y->typ->form, 0x70))) { if ((*x)->class == 7) { k = (*x)->conval->intval; - if (0 > k || k > (int)OPM_MaxSet) { + if (0 > k || k > OPM_MaxSet) { OPB_err(202); } } if (y->class == 7) { l = y->conval->intval; - if (0 > l || l > (int)OPM_MaxSet) { + if (0 > l || l > OPM_MaxSet) { OPB_err(202); } } @@ -1537,7 +1537,7 @@ void OPB_SetElem (OPT_Node *x) OPB_err(93); } else if ((*x)->class == 7) { k = (*x)->conval->intval; - if ((0 <= k && k <= (int)OPM_MaxSet)) { + if ((0 <= k && k <= OPM_MaxSet)) { (*x)->conval->setval = __SETOF(k); } else { OPB_err(202); @@ -1556,24 +1556,24 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPT_Struct p = NIL, q = NIL; if (OPM_Verbose) { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"PROCEDURE CheckAssign", (LONGINT)22); + OPM_LogWStr((CHAR*)"PROCEDURE CheckAssign", 22); OPM_LogWLn(); } y = ynode->typ; f = x->form; g = y->form; if (OPM_Verbose) { - OPM_LogWStr((CHAR*)"y.form = ", (LONGINT)10); - OPM_LogWNum(y->form, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"y.form = ", 10); + OPM_LogWNum(y->form, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"f = ", (LONGINT)5); - OPM_LogWNum(f, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"f = ", 5); + OPM_LogWNum(f, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"g = ", (LONGINT)5); - OPM_LogWNum(g, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"g = ", 5); + OPM_LogWNum(g, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"ynode.typ.syze = ", (LONGINT)18); - OPM_LogWNum(ynode->typ->size, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"ynode.typ.syze = ", 18); + OPM_LogWNum(ynode->typ->size, 0); OPM_LogWLn(); } if (ynode->class == 8 || (ynode->class == 9 && f != 14)) { @@ -1681,8 +1681,8 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) } break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPB.CheckAssign, f = ", (LONGINT)40); - OPM_LogWNum(f, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPB.CheckAssign, f = ", 40); + OPM_LogWNum(f, 0); OPM_LogWLn(); break; } @@ -1774,14 +1774,14 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) x = OPB_NewBoolConst(0); break; case 3: - x = OPB_NewIntConst(((LONGINT)(0))); + x = OPB_NewIntConst(0); x->typ = OPT_chartyp; break; case 4: case 5: case 6: x = OPB_NewIntConst(OPM_SignedMinimum(x->typ->size)); break; case 9: - x = OPB_NewIntConst(((LONGINT)(0))); + x = OPB_NewIntConst(0); x->typ = OPT_inttyp; break; case 7: @@ -1805,7 +1805,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) x = OPB_NewBoolConst(1); break; case 3: - x = OPB_NewIntConst(((LONGINT)(255))); + x = OPB_NewIntConst(255); x->typ = OPT_chartyp; break; case 4: case 5: case 6: @@ -1912,7 +1912,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (__IN(f, 0x70)) { - if (x->typ->size != (int)OPM_LIntSize) { + if (x->typ->size != OPM_LIntSize) { OPB_Convert(&x, OPT_linttyp); } } else { @@ -1927,14 +1927,14 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 12: if (x->class != 8) { OPB_err(110); - x = OPB_NewIntConst(((LONGINT)(1))); + x = OPB_NewIntConst(1); } else if (__IN(f, 0x63fe) || __IN(x->typ->comp, 0x14)) { (*OPB_typSize)(x->typ); x->typ->pvused = 1; x = OPB_NewIntConst(x->typ->size); } else { OPB_err(111); - x = OPB_NewIntConst(((LONGINT)(1))); + x = OPB_NewIntConst(1); } break; case 21: @@ -1952,7 +1952,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) OPB_err(126); } else if ((((x->class == 7 && __IN(f, 0x70))) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x2070) && x->typ->size == (int)OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x2070) && x->typ->size == OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } @@ -1993,8 +1993,8 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) } break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPB.StPar0, fctno = ", (LONGINT)39); - OPM_LogWNum(fctno, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPB.StPar0, fctno = ", 39); + OPM_LogWNum(fctno, 0); OPM_LogWLn(); break; } @@ -2050,7 +2050,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (__IN(f, 0x70)) { - if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > (int)OPM_MaxSet))) { + if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > OPM_MaxSet))) { OPB_err(202); } p = NewOp__53(19, fctno, p, x); @@ -2063,7 +2063,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (!__IN(f, 0x70) || x->class != 7) { OPB_err(69); } else if (x->typ->size == 1) { - L = (int)x->conval->intval; + L = x->conval->intval; typ = p->typ; while ((L > 0 && __IN(typ->comp, 0x0c))) { typ = typ->BaseTyp; @@ -2221,7 +2221,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) OPB_err(126); } else if ((((x->class == 7 && __IN(f, 0x70))) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x2070) && x->typ->size == (int)OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x2070) && x->typ->size == OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } @@ -2321,7 +2321,7 @@ void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno) } } else { if (((fctno == 13 || fctno == 14) && parno == 1)) { - OPB_BindNodes(19, OPT_notyp, &p, OPB_NewIntConst(((LONGINT)(1)))); + OPB_BindNodes(19, OPT_notyp, &p, OPB_NewIntConst(1)); p->subcl = fctno; p->right->typ = p->left->typ; } else if ((fctno == 17 && parno == 1)) { @@ -2343,7 +2343,7 @@ void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno) } else if (fctno == 32) { if (parno == 1) { x = NIL; - OPB_BindNodes(28, OPT_notyp, &x, OPB_NewIntConst(((LONGINT)(0)))); + OPB_BindNodes(28, OPT_notyp, &x, OPB_NewIntConst(0)); x->conval = OPT_NewConst(); x->conval->intval = OPM_errpos; OPB_Construct(15, &p, x); @@ -2578,7 +2578,7 @@ void OPB_Assign (OPT_Node *x, OPT_Node y) } else if (((((((*x)->typ->comp == 2 && (*x)->typ->BaseTyp == OPT_chartyp)) && y->typ->form == 10)) && y->conval->intval2 == 1)) { y->typ = OPT_chartyp; y->conval->intval = 0; - OPB_Index(&*x, OPB_NewIntConst(((LONGINT)(0)))); + OPB_Index(&*x, OPB_NewIntConst(0)); } if ((((((__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp == OPT_chartyp)) && __IN(y->typ->comp, 0x0c))) && y->typ->BaseTyp == OPT_chartyp)) { subcl = 18; diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index 81b3745b..385a9146 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 8a3a54cf..494d985f 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "OPM.h" @@ -62,6 +62,7 @@ static void OPC_InitImports (OPT_Object obj); static void OPC_InitKeywords (void); export void OPC_InitTDesc (OPT_Struct typ); static void OPC_InitTProcs (OPT_Object typ, OPT_Object obj); +export void OPC_IntLiteral (LONGINT n, LONGINT size); export void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim); static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName); static INTEGER OPC_Length (CHAR *s, LONGINT s__len); @@ -178,7 +179,7 @@ static INTEGER OPC_PerfectHash (CHAR *s, LONGINT s__len) i = 0; h = 0; while ((s[__X(i, s__len)] != 0x00 && i < 5)) { - h = 3 * h + (int)s[__X(i, s__len)]; + h = 3 * h + s[__X(i, s__len)]; i += 1; } _o_result = (int)__MOD(h, 105); @@ -191,10 +192,10 @@ void OPC_Ident (OPT_Object obj) mode = obj->mode; level = obj->mnolev; if ((__IN(mode, 0x62) && level > 0) || __IN(mode, 0x14)) { - OPM_WriteStringVar((void*)obj->name, ((LONGINT)(256))); - h = OPC_PerfectHash((void*)obj->name, ((LONGINT)(256))); - if (OPC_hashtab[__X(h, ((LONGINT)(105)))] >= 0) { - if (__STRCMP(OPC_keytab[__X(OPC_hashtab[__X(h, ((LONGINT)(105)))], ((LONGINT)(36)))], obj->name) == 0) { + OPM_WriteStringVar((void*)obj->name, 256); + h = OPC_PerfectHash((void*)obj->name, 256); + if (OPC_hashtab[__X(h, 105)] >= 0) { + if (__STRCMP(OPC_keytab[__X(OPC_hashtab[__X(h, 105)], 36)], obj->name) == 0) { OPM_Write('_'); } } @@ -203,18 +204,18 @@ void OPC_Ident (OPT_Object obj) if (mode == 13) { OPC_Ident(obj->link->typ->strobj); } else if (level < 0) { - OPM_WriteStringVar((void*)OPT_GlbMod[__X(-level, ((LONGINT)(64)))]->name, ((LONGINT)(256))); + OPM_WriteStringVar((void*)OPT_GlbMod[__X(-level, 64)]->name, 256); if (OPM_currFile == 0) { - OPT_GlbMod[__X(-level, ((LONGINT)(64)))]->vis = 1; + OPT_GlbMod[__X(-level, 64)]->vis = 1; } } else { - OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); + OPM_WriteStringVar((void*)OPM_modName, 32); } OPM_Write('_'); } else if ((((((obj == OPT_sysptrtyp->strobj || obj == OPT_ainttyp->strobj) || obj == OPT_int8typ->strobj) || obj == OPT_int16typ->strobj) || obj == OPT_int32typ->strobj) || obj == OPT_int64typ->strobj) || obj == OPT_bytetyp->strobj) { - OPM_WriteString((CHAR*)"SYSTEM_", (LONGINT)8); + OPM_WriteString((CHAR*)"SYSTEM_", 8); } - OPM_WriteStringVar((void*)obj->name, ((LONGINT)(256))); + OPM_WriteStringVar((void*)obj->name, 256); } } @@ -290,7 +291,7 @@ static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef) OPM_Write(')'); OPC_AnsiParamList(typ->link, 0); } else { - OPM_WriteString((CHAR*)")()", (LONGINT)4); + OPM_WriteString((CHAR*)")()", 4); } break; } else if (comp == 2) { @@ -308,8 +309,8 @@ static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef) void OPC_Andent (OPT_Struct typ) { if (typ->strobj == NIL || typ->align >= 65536) { - OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); - OPC_Str1((CHAR*)"__#", (LONGINT)4, __ASHR(typ->align, 16)); + OPM_WriteStringVar((void*)OPM_modName, 32); + OPC_Str1((CHAR*)"__#", 4, __ASHR(typ->align, 16)); } else { OPC_Ident(typ->strobj); } @@ -318,7 +319,7 @@ void OPC_Andent (OPT_Struct typ) static BOOLEAN OPC_Undefined (OPT_Object obj) { BOOLEAN _o_result; - _o_result = obj->name[0] == 0x00 || (((obj->mnolev >= 0 && obj->linkadr != (int)(3 + OPM_currFile))) && obj->linkadr != 2); + _o_result = obj->name[0] == 0x00 || (((obj->mnolev >= 0 && obj->linkadr != (3 + OPM_currFile))) && obj->linkadr != 2); return _o_result; } @@ -336,17 +337,17 @@ static void OPC_DeclareBase (OPT_Object dcl) } obj = typ->strobj; if (typ->form == 12) { - OPM_WriteString((CHAR*)"void", (LONGINT)5); + OPM_WriteString((CHAR*)"void", 5); } else if ((obj != NIL && !OPC_Undefined(obj))) { OPC_Ident(obj); } else if (typ->comp == 4) { - OPM_WriteString((CHAR*)"struct ", (LONGINT)8); + OPM_WriteString((CHAR*)"struct ", 8); OPC_Andent(typ); if ((prev->form != 13 && (obj != NIL || dcl->name[0] == 0x00))) { if ((typ->BaseTyp != NIL && typ->BaseTyp->strobj->vis != 0)) { - OPM_WriteString((CHAR*)" { /* ", (LONGINT)7); + OPM_WriteString((CHAR*)" { /* ", 7); OPC_Ident(typ->BaseTyp->strobj); - OPM_WriteString((CHAR*)" */", (LONGINT)4); + OPM_WriteString((CHAR*)" */", 4); OPM_WriteLn(); OPC_Indent(1); } else { @@ -363,10 +364,10 @@ static void OPC_DeclareBase (OPT_Object dcl) nofdims += 1; typ = typ->BaseTyp; } - OPM_WriteString((CHAR*)"struct ", (LONGINT)8); + OPM_WriteString((CHAR*)"struct ", 8); OPC_BegBlk(); OPC_BegStat(); - OPC_Str1((CHAR*)"LONGINT len[#]", (LONGINT)15, nofdims); + OPC_Str1((CHAR*)"LONGINT len[#]", 15, nofdims); OPC_EndStat(); OPC_BegStat(); __NEW(obj, OPT_ObjDesc); @@ -436,7 +437,7 @@ static void OPC_PutPtrOffsets (OPT_Struct typ, LONGINT adr, LONGINT *cnt) LONGINT n, i; if ((typ->form == 13 && typ->sysflag == 0)) { OPM_WriteInt(adr); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); *cnt += 1; if (__MASK(*cnt, -16) == 0) { OPM_WriteLn(); @@ -453,7 +454,7 @@ static void OPC_PutPtrOffsets (OPT_Struct typ, LONGINT adr, LONGINT *cnt) OPC_PutPtrOffsets(fld->typ, adr + fld->adr, &*cnt); } else { OPM_WriteInt(adr + fld->adr); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); *cnt += 1; if (__MASK(*cnt, -16) == 0) { OPM_WriteLn(); @@ -485,11 +486,11 @@ static void OPC_InitTProcs (OPT_Object typ, OPT_Object obj) OPC_InitTProcs(typ, obj->left); if (obj->mode == 13) { OPC_BegStat(); - OPM_WriteString((CHAR*)"__INITBP(", (LONGINT)10); + OPM_WriteString((CHAR*)"__INITBP(", 10); OPC_Ident(typ); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Ident(obj); - OPC_Str1((CHAR*)", #)", (LONGINT)5, __ASHR(obj->adr, 16)); + OPC_Str1((CHAR*)", #)", 5, __ASHR(obj->adr, 16)); OPC_EndStat(); } OPC_InitTProcs(typ, obj->right); @@ -501,8 +502,8 @@ static void OPC_PutBase (OPT_Struct typ) if (typ != NIL) { OPC_PutBase(typ->BaseTyp); OPC_Ident(typ->strobj); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)"__typ", 6); + OPM_WriteString((CHAR*)", ", 3); } } @@ -512,19 +513,19 @@ static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamNa INTEGER dim; if (showParamName) { OPC_Ident(par); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); } dim = 1; typ = par->typ->BaseTyp; while (typ->comp == 3) { if (ansiDefine) { - OPM_WriteString((CHAR*)", LONGINT ", (LONGINT)11); + OPM_WriteString((CHAR*)", LONGINT ", 11); } else { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); } if (showParamName) { OPC_Ident(par); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); OPM_WriteInt(dim); } typ = typ->BaseTyp; @@ -537,7 +538,7 @@ static void OPC_DeclareParams (OPT_Object par, BOOLEAN macro) OPM_Write('('); while (par != NIL) { if (macro) { - OPM_WriteStringVar((void*)par->name, ((LONGINT)(256))); + OPM_WriteStringVar((void*)par->name, 256); } else { if ((par->mode == 1 && par->typ->form == 7)) { OPM_Write('_'); @@ -545,16 +546,16 @@ static void OPC_DeclareParams (OPT_Object par, BOOLEAN macro) OPC_Ident(par); } if (par->typ->comp == 3) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_LenList(par, 0, 1); } else if ((par->mode == 2 && par->typ->comp == 4)) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); - OPM_WriteStringVar((void*)par->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)", ", 3); + OPM_WriteStringVar((void*)par->name, 256); + OPM_WriteString((CHAR*)"__typ", 6); } par = par->link; if (par != NIL) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); } } OPM_Write(')'); @@ -586,7 +587,7 @@ static void OPC_DeclareTProcs (OPT_Object obj, BOOLEAN *empty) if (OPM_currFile == 0) { if (obj->vis == 1) { OPC_DefineTProcTypes(obj); - OPM_WriteString((CHAR*)"import ", (LONGINT)8); + OPM_WriteString((CHAR*)"import ", 8); *empty = 0; OPC_ProcHeader(obj, 0); } @@ -594,9 +595,9 @@ static void OPC_DeclareTProcs (OPT_Object obj, BOOLEAN *empty) *empty = 0; OPC_DefineTProcTypes(obj); if (obj->vis == 0) { - OPM_WriteString((CHAR*)"static ", (LONGINT)8); + OPM_WriteString((CHAR*)"static ", 8); } else { - OPM_WriteString((CHAR*)"export ", (LONGINT)8); + OPM_WriteString((CHAR*)"export ", 8); } OPC_ProcHeader(obj, 0); } @@ -630,31 +631,31 @@ static void OPC_DefineTProcMacros (OPT_Object obj, BOOLEAN *empty) if (obj != NIL) { OPC_DefineTProcMacros(obj->left, &*empty); if ((((obj->mode == 13 && obj == OPC_BaseTProc(obj))) && (OPM_currFile != 0 || obj->vis == 1))) { - OPM_WriteString((CHAR*)"#define __", (LONGINT)11); + OPM_WriteString((CHAR*)"#define __", 11); OPC_Ident(obj); OPC_DeclareParams(obj->link, 1); - OPM_WriteString((CHAR*)" __SEND(", (LONGINT)9); + OPM_WriteString((CHAR*)" __SEND(", 9); if (obj->link->typ->form == 13) { - OPM_WriteString((CHAR*)"__TYPEOF(", (LONGINT)10); + OPM_WriteString((CHAR*)"__TYPEOF(", 10); OPC_Ident(obj->link); OPM_Write(')'); } else { OPC_Ident(obj->link); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } - OPC_Str1((CHAR*)", #, ", (LONGINT)6, __ASHR(obj->adr, 16)); + OPC_Str1((CHAR*)", #, ", 6, __ASHR(obj->adr, 16)); if (obj->typ == OPT_notyp) { - OPM_WriteString((CHAR*)"void", (LONGINT)5); + OPM_WriteString((CHAR*)"void", 5); } else { OPC_Ident(obj->typ->strobj); } - OPM_WriteString((CHAR*)"(*)", (LONGINT)4); + OPM_WriteString((CHAR*)"(*)", 4); if (OPC_ansi) { OPC_AnsiParamList(obj->link, 0); } else { - OPM_WriteString((CHAR*)"()", (LONGINT)3); + OPM_WriteString((CHAR*)"()", 3); } - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_DeclareParams(obj->link, 1); OPM_Write(')'); OPM_WriteLn(); @@ -709,7 +710,7 @@ static void OPC_DefineType (OPT_Struct str) } } if ((obj != NIL && OPC_Undefined(obj))) { - OPM_WriteString((CHAR*)"typedef", (LONGINT)8); + OPM_WriteString((CHAR*)"typedef", 8); OPM_WriteLn(); OPM_Write(0x09); OPC_Indent(1); @@ -742,7 +743,7 @@ static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len) BOOLEAN r; __DUP(y, y__len, CHAR); i = 0; - while ((*x)[__X(i + 1, ((LONGINT)(256)))] == y[__X(i, y__len)]) { + while ((*x)[__X(i + 1, 256)] == y[__X(i, y__len)]) { i += 1; } r = y[__X(i, y__len)] == 0x00; @@ -758,19 +759,19 @@ static void OPC_CProcDefs (OPT_Object obj, INTEGER vis) INTEGER _for__9; if (obj != NIL) { OPC_CProcDefs(obj->left, vis); - if ((((obj->mode == 9 && (int)obj->vis >= vis)) && obj->adr == 1)) { + if ((((obj->mode == 9 && obj->vis >= vis)) && obj->adr == 1)) { ext = obj->conval->ext; i = 1; - if (((*ext)[1] != '#' && !(OPC_Prefixed(ext, (CHAR*)"extern ", (LONGINT)8) || OPC_Prefixed(ext, (CHAR*)"import ", (LONGINT)8)))) { - OPM_WriteString((CHAR*)"#define ", (LONGINT)9); + if (((*ext)[1] != '#' && !(OPC_Prefixed(ext, (CHAR*)"extern ", 8) || OPC_Prefixed(ext, (CHAR*)"import ", 8)))) { + OPM_WriteString((CHAR*)"#define ", 9); OPC_Ident(obj); OPC_DeclareParams(obj->link, 1); OPM_Write(0x09); } - _for__9 = (int)(*obj->conval->ext)[0]; + _for__9 = (*obj->conval->ext)[0]; i = i; while (i <= _for__9) { - OPM_Write((*obj->conval->ext)[__X(i, ((LONGINT)(256)))]); + OPM_Write((*obj->conval->ext)[__X(i, 256)]); i += 1; } OPM_WriteLn(); @@ -814,34 +815,34 @@ void OPC_TDescDecl (OPT_Struct typ) LONGINT nofptrs; OPT_Object o = NIL; OPC_BegStat(); - OPM_WriteString((CHAR*)"__TDESC(", (LONGINT)9); + OPM_WriteString((CHAR*)"__TDESC(", 9); OPC_Andent(typ); - OPC_Str1((CHAR*)", #", (LONGINT)4, typ->n + 1); - OPC_Str1((CHAR*)", #) = {__TDFLDS(", (LONGINT)18, OPC_NofPtrs(typ)); + OPC_Str1((CHAR*)", #", 4, typ->n + 1); + OPC_Str1((CHAR*)", #) = {__TDFLDS(", 18, OPC_NofPtrs(typ)); OPM_Write('"'); if (typ->strobj != NIL) { - OPM_WriteStringVar((void*)typ->strobj->name, ((LONGINT)(256))); + OPM_WriteStringVar((void*)typ->strobj->name, 256); } OPM_Write('"'); - OPC_Str1((CHAR*)", #), {", (LONGINT)8, typ->size); + OPC_Str1((CHAR*)", #), {", 8, typ->size); nofptrs = 0; - OPC_PutPtrOffsets(typ, ((LONGINT)(0)), &nofptrs); - OPC_Str1((CHAR*)"#}}", (LONGINT)4, -((nofptrs + 1) * (int)OPM_LIntSize)); + OPC_PutPtrOffsets(typ, 0, &nofptrs); + OPC_Str1((CHAR*)"#}}", 4, -((nofptrs + 1) * OPM_LIntSize)); OPC_EndStat(); } void OPC_InitTDesc (OPT_Struct typ) { OPC_BegStat(); - OPM_WriteString((CHAR*)"__INITYP(", (LONGINT)10); + OPM_WriteString((CHAR*)"__INITYP(", 10); OPC_Andent(typ); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); if (typ->BaseTyp != NIL) { OPC_Andent(typ->BaseTyp); } else { OPC_Andent(typ); } - OPC_Str1((CHAR*)", #)", (LONGINT)5, typ->extlev); + OPC_Str1((CHAR*)", #)", 5, typ->extlev); OPC_EndStat(); if (typ->strobj != NIL) { OPC_InitTProcs(typ->strobj, typ->link); @@ -872,7 +873,7 @@ LONGINT OPC_SizeAlignment (LONGINT size) { LONGINT _o_result; LONGINT alignment; - if (size < (int)OPM_Alignment) { + if (size < OPM_Alignment) { alignment = 1; while (alignment < size) { alignment = __ASHL(alignment, 1); @@ -909,23 +910,23 @@ static void OPC_FillGap (LONGINT gap, LONGINT off, LONGINT align, LONGINT *n, LO if ((*curAlign < align && gap - (adr - off) >= align)) { gap -= (adr - off) + align; OPC_BegStat(); - if (align == (int)OPM_IntSize) { - OPM_WriteString((CHAR*)"INTEGER", (LONGINT)8); - } else if (align == (int)OPM_LIntSize) { - OPM_WriteString((CHAR*)"LONGINT", (LONGINT)8); - } else if (align == (int)OPM_LRealSize) { - OPM_WriteString((CHAR*)"LONGREAL", (LONGINT)9); + if (align == OPM_IntSize) { + OPM_WriteString((CHAR*)"INTEGER", 8); + } else if (align == OPM_LIntSize) { + OPM_WriteString((CHAR*)"LONGINT", 8); + } else if (align == OPM_LRealSize) { + OPM_WriteString((CHAR*)"LONGREAL", 9); } - OPC_Str1((CHAR*)" _prvt#", (LONGINT)8, *n); + OPC_Str1((CHAR*)" _prvt#", 8, *n); *n += 1; OPC_EndStat(); *curAlign = align; } if (gap > 0) { OPC_BegStat(); - OPC_Str1((CHAR*)"char _prvt#", (LONGINT)12, *n); + OPC_Str1((CHAR*)"char _prvt#", 12, *n); *n += 1; - OPC_Str1((CHAR*)"[#]", (LONGINT)4, gap); + OPC_Str1((CHAR*)"[#]", 4, gap); OPC_EndStat(); } } @@ -969,7 +970,7 @@ static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, LONGINT *off, LONGINT * base = fld->typ; fld = fld->link; while ((((((((fld != NIL && fld->mode == 4)) && fld->typ == base)) && fld->adr == *off)) && ((OPM_currFile == 1 || fld->vis != 0) || fld->typ->strobj == NIL))) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_DeclareObj(fld, 0); *off = fld->adr + fld->typ->size; fld = fld->link; @@ -978,7 +979,7 @@ static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, LONGINT *off, LONGINT * } } if (last) { - adr = typ->size - (int)__ASHR(typ->sysflag, 8); + adr = typ->size - __ASHR(typ->sysflag, 8); if (adr == 0) { gap = 1; } else { @@ -999,7 +1000,7 @@ static void OPC_IdentList (OPT_Object obj, INTEGER vis) first = 1; while ((obj != NIL && obj->mode != 13)) { if ((__IN(vis, 0x05) || (vis == 1 && obj->vis != 0)) || (vis == 3 && !obj->leaf)) { - if (obj->typ != base || (int)obj->vis != lastvis) { + if (obj->typ != base || obj->vis != lastvis) { if (!first) { OPC_EndStat(); } @@ -1008,16 +1009,16 @@ static void OPC_IdentList (OPT_Object obj, INTEGER vis) lastvis = obj->vis; OPC_BegStat(); if ((vis == 1 && obj->vis != 0)) { - OPM_WriteString((CHAR*)"import ", (LONGINT)8); + OPM_WriteString((CHAR*)"import ", 8); } else if ((obj->mnolev == 0 && vis == 0)) { if (obj->vis == 0) { - OPM_WriteString((CHAR*)"static ", (LONGINT)8); + OPM_WriteString((CHAR*)"static ", 8); } else { - OPM_WriteString((CHAR*)"export ", (LONGINT)8); + OPM_WriteString((CHAR*)"export ", 8); } } if ((((vis == 2 && obj->mode == 1)) && base->form == 7)) { - OPM_WriteString((CHAR*)"double", (LONGINT)7); + OPM_WriteString((CHAR*)"double", 7); } else { OPC_DeclareBase(obj); } @@ -1033,17 +1034,17 @@ static void OPC_IdentList (OPT_Object obj, INTEGER vis) OPC_EndStat(); OPC_BegStat(); base = OPT_linttyp; - OPM_WriteString((CHAR*)"LONGINT ", (LONGINT)9); + OPM_WriteString((CHAR*)"LONGINT ", 9); OPC_LenList(obj, 0, 1); } else if ((obj->mode == 2 && obj->typ->comp == 4)) { OPC_EndStat(); OPC_BegStat(); - OPM_WriteString((CHAR*)"LONGINT *", (LONGINT)10); + OPM_WriteString((CHAR*)"LONGINT *", 10); OPC_Ident(obj); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); base = NIL; } else if ((((((OPC_ptrinit && vis == 0)) && obj->mnolev > 0)) && obj->typ->form == 13)) { - OPM_WriteString((CHAR*)" = NIL", (LONGINT)7); + OPM_WriteString((CHAR*)" = NIL", 7); } } obj = obj->link; @@ -1058,7 +1059,7 @@ static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames) CHAR name[32]; OPM_Write('('); if (obj == NIL || obj->mode == 13) { - OPM_WriteString((CHAR*)"void", (LONGINT)5); + OPM_WriteString((CHAR*)"void", 5); } else { for (;;) { OPC_DeclareBase(obj); @@ -1066,25 +1067,25 @@ static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames) OPM_Write(' '); OPC_DeclareObj(obj, 0); } else { - __COPY(obj->name, name, ((LONGINT)(32))); + __COPY(obj->name, name, 32); obj->name[0] = 0x00; OPC_DeclareObj(obj, 0); - __COPY(name, obj->name, ((LONGINT)(256))); + __COPY(name, obj->name, 256); } if (obj->typ->comp == 3) { - OPM_WriteString((CHAR*)", LONGINT ", (LONGINT)11); + OPM_WriteString((CHAR*)", LONGINT ", 11); OPC_LenList(obj, 1, showParamNames); } else if ((obj->mode == 2 && obj->typ->comp == 4)) { - OPM_WriteString((CHAR*)", LONGINT *", (LONGINT)12); + OPM_WriteString((CHAR*)", LONGINT *", 12); if (showParamNames) { OPC_Ident(obj); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } } if (obj->link == NIL || obj->link->mode == 13) { break; } - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); obj = obj->link; } } @@ -1094,7 +1095,7 @@ static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames) static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define) { if (proc->typ == OPT_notyp) { - OPM_WriteString((CHAR*)"void", (LONGINT)5); + OPM_WriteString((CHAR*)"void", 5); } else { OPC_Ident(proc->typ->strobj); } @@ -1114,7 +1115,7 @@ static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define) OPC_IdentList(proc->link, 2); OPC_Indent(-1); } else { - OPM_WriteString((CHAR*)"();", (LONGINT)4); + OPM_WriteString((CHAR*)"();", 4); OPM_WriteLn(); } } @@ -1125,11 +1126,11 @@ static void OPC_ProcPredefs (OPT_Object obj, SHORTINT vis) OPC_ProcPredefs(obj->left, vis); if ((((__IN(obj->mode, 0xc0) && obj->vis >= vis)) && (obj->history != 4 || obj->mode == 6))) { if (vis == 1) { - OPM_WriteString((CHAR*)"import ", (LONGINT)8); + OPM_WriteString((CHAR*)"import ", 8); } else if (obj->vis == 0) { - OPM_WriteString((CHAR*)"static ", (LONGINT)8); + OPM_WriteString((CHAR*)"static ", 8); } else { - OPM_WriteString((CHAR*)"export ", (LONGINT)8); + OPM_WriteString((CHAR*)"export ", 8); } OPC_ProcHeader(obj, 0); } @@ -1140,10 +1141,10 @@ static void OPC_ProcPredefs (OPT_Object obj, SHORTINT vis) static void OPC_Include (CHAR *name, LONGINT name__len) { __DUP(name, name__len, CHAR); - OPM_WriteString((CHAR*)"#include ", (LONGINT)10); + OPM_WriteString((CHAR*)"#include ", 10); OPM_Write('"'); OPM_WriteStringVar((void*)name, name__len); - OPM_WriteString((CHAR*)".h", (LONGINT)3); + OPM_WriteString((CHAR*)".h", 3); OPM_Write('"'); OPM_WriteLn(); __DEL(name); @@ -1153,8 +1154,8 @@ static void OPC_IncludeImports (OPT_Object obj, INTEGER vis) { if (obj != NIL) { OPC_IncludeImports(obj->left, vis); - if ((((obj->mode == 11 && obj->mnolev != 0)) && (int)OPT_GlbMod[__X(-obj->mnolev, ((LONGINT)(64)))]->vis >= vis)) { - OPC_Include(OPT_GlbMod[__X(-obj->mnolev, ((LONGINT)(64)))]->name, ((LONGINT)(256))); + if ((((obj->mode == 11 && obj->mnolev != 0)) && OPT_GlbMod[__X(-obj->mnolev, 64)]->vis >= vis)) { + OPC_Include(OPT_GlbMod[__X(-obj->mnolev, 64)]->name, 256); } OPC_IncludeImports(obj->right, vis); } @@ -1168,15 +1169,15 @@ static void OPC_GenDynTypes (OPT_Node n, INTEGER vis) if (vis == 0 || typ->ref < 255) { OPC_BegStat(); if (vis == 1) { - OPM_WriteString((CHAR*)"import ", (LONGINT)8); + OPM_WriteString((CHAR*)"import ", 8); } else if ((typ->strobj != NIL && typ->strobj->mnolev > 0)) { - OPM_WriteString((CHAR*)"static ", (LONGINT)8); + OPM_WriteString((CHAR*)"static ", 8); } else { - OPM_WriteString((CHAR*)"export ", (LONGINT)8); + OPM_WriteString((CHAR*)"export ", 8); } - OPM_WriteString((CHAR*)"LONGINT *", (LONGINT)10); + OPM_WriteString((CHAR*)"LONGINT *", 10); OPC_Andent(typ); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); OPC_EndStat(); } n = n->link; @@ -1194,25 +1195,25 @@ void OPC_GenHdr (OPT_Node n) OPC_GenDynTypes(n, 1); OPM_WriteLn(); OPC_ProcPredefs(OPT_topScope->right, 1); - OPM_WriteString((CHAR*)"import ", (LONGINT)8); - OPM_WriteString((CHAR*)"void *", (LONGINT)7); - OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); - OPM_WriteString(OPC_BodyNameExt, ((LONGINT)(13))); + OPM_WriteString((CHAR*)"import ", 8); + OPM_WriteString((CHAR*)"void *", 7); + OPM_WriteStringVar((void*)OPM_modName, 32); + OPM_WriteString(OPC_BodyNameExt, 13); OPC_EndStat(); OPM_WriteLn(); OPC_CProcDefs(OPT_topScope->right, 1); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#endif", (LONGINT)7); + OPM_WriteString((CHAR*)"#endif", 7); OPM_WriteLn(); } static void OPC_GenHeaderMsg (void) { INTEGER i; - OPM_WriteString((CHAR*)"/* ", (LONGINT)4); - OPM_WriteString((CHAR*)"voc", (LONGINT)4); + OPM_WriteString((CHAR*)"/* ", 4); + OPM_WriteString((CHAR*)"voc", 4); OPM_Write(' '); - OPM_WriteString(Configuration_versionLong, ((LONGINT)(41))); + OPM_WriteString(Configuration_versionLong, 41); OPM_Write(' '); i = 0; while (i <= 31) { @@ -1264,14 +1265,14 @@ static void OPC_GenHeaderMsg (void) OPM_Write('v'); break; default: - OPM_LogWStr((CHAR*)"( more options defined in OPM than checked in OPC.GenHeaderMsg, if you are a compiler developer, add them to OPC.GenHeaderMsg", (LONGINT)126); + OPM_LogWStr((CHAR*)"( more options defined in OPM than checked in OPC.GenHeaderMsg, if you are a compiler developer, add them to OPC.GenHeaderMsg", 126); OPM_LogWLn(); break; } } i += 1; } - OPM_WriteString((CHAR*)" */", (LONGINT)4); + OPM_WriteString((CHAR*)" */", 4); OPM_WriteLn(); } @@ -1280,20 +1281,20 @@ void OPC_GenHdrIncludes (void) OPM_currFile = 2; OPC_GenHeaderMsg(); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#ifndef ", (LONGINT)9); - OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); - OPM_WriteString((CHAR*)"__h", (LONGINT)4); + OPM_WriteString((CHAR*)"#ifndef ", 9); + OPM_WriteStringVar((void*)OPM_modName, 32); + OPM_WriteString((CHAR*)"__h", 4); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#define ", (LONGINT)9); - OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); - OPM_WriteString((CHAR*)"__h", (LONGINT)4); + OPM_WriteString((CHAR*)"#define ", 9); + OPM_WriteStringVar((void*)OPM_modName, 32); + OPM_WriteString((CHAR*)"__h", 4); OPM_WriteLn(); OPM_WriteLn(); if (OPM_LIntSize == 8) { - OPM_WriteString((CHAR*)"#define LARGE", (LONGINT)14); + OPM_WriteString((CHAR*)"#define LARGE", 14); OPM_WriteLn(); } - OPC_Include((CHAR*)"SYSTEM", (LONGINT)7); + OPC_Include((CHAR*)"SYSTEM", 7); OPC_IncludeImports(OPT_topScope->right, 1); OPM_WriteLn(); } @@ -1303,10 +1304,10 @@ void OPC_GenBdy (OPT_Node n) OPM_currFile = 1; OPC_GenHeaderMsg(); if (OPM_LIntSize == 8) { - OPM_WriteString((CHAR*)"#define LARGE", (LONGINT)14); + OPM_WriteString((CHAR*)"#define LARGE", 14); OPM_WriteLn(); } - OPC_Include((CHAR*)"SYSTEM", (LONGINT)7); + OPC_Include((CHAR*)"SYSTEM", 7); OPC_IncludeImports(OPT_topScope->right, 0); OPM_WriteLn(); OPC_DefAnonRecs(n); @@ -1329,9 +1330,9 @@ static void OPC_RegCmds (OPT_Object obj) if ((obj->mode == 7 && obj->history != 4)) { if ((((obj->vis != 0 && obj->link == NIL)) && obj->typ == OPT_notyp)) { OPC_BegStat(); - OPM_WriteString((CHAR*)"__REGCMD(\"", (LONGINT)11); - OPM_WriteStringVar((void*)obj->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"\", ", (LONGINT)4); + OPM_WriteString((CHAR*)"__REGCMD(\"", 11); + OPM_WriteStringVar((void*)obj->name, 256); + OPM_WriteString((CHAR*)"\", ", 4); OPC_Ident(obj); OPM_Write(')'); OPC_EndStat(); @@ -1347,8 +1348,8 @@ static void OPC_InitImports (OPT_Object obj) OPC_InitImports(obj->left); if ((obj->mode == 11 && obj->mnolev != 0)) { OPC_BegStat(); - OPM_WriteString((CHAR*)"__MODULE_IMPORT(", (LONGINT)17); - OPM_WriteStringVar((void*)OPT_GlbMod[__X(-obj->mnolev, ((LONGINT)(64)))]->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"__MODULE_IMPORT(", 17); + OPM_WriteStringVar((void*)OPT_GlbMod[__X(-obj->mnolev, 64)]->name, 256); OPM_Write(')'); OPC_EndStat(); } @@ -1366,31 +1367,31 @@ void OPC_GenEnumPtrs (OPT_Object var) if (OPC_NofPtrs(typ) > 0) { if (!OPC_GlbPtrs) { OPC_GlbPtrs = 1; - OPM_WriteString((CHAR*)"static ", (LONGINT)8); + OPM_WriteString((CHAR*)"static ", 8); if (OPC_ansi) { - OPM_WriteString((CHAR*)"void EnumPtrs(void (*P)(void*))", (LONGINT)32); + OPM_WriteString((CHAR*)"void EnumPtrs(void (*P)(void*))", 32); } else { - OPM_WriteString((CHAR*)"void EnumPtrs(P)", (LONGINT)17); + OPM_WriteString((CHAR*)"void EnumPtrs(P)", 17); OPM_WriteLn(); OPM_Write(0x09); - OPM_WriteString((CHAR*)"void (*P)();", (LONGINT)13); + OPM_WriteString((CHAR*)"void (*P)();", 13); } OPM_WriteLn(); OPC_BegBlk(); } OPC_BegStat(); if (typ->form == 13) { - OPM_WriteString((CHAR*)"P(", (LONGINT)3); + OPM_WriteString((CHAR*)"P(", 3); OPC_Ident(var); OPM_Write(')'); } else if (typ->comp == 4) { - OPM_WriteString((CHAR*)"__ENUMR(&", (LONGINT)10); + OPM_WriteString((CHAR*)"__ENUMR(&", 10); OPC_Ident(var); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Andent(typ); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); - OPC_Str1((CHAR*)", #", (LONGINT)4, typ->size); - OPM_WriteString((CHAR*)", 1, P)", (LONGINT)8); + OPM_WriteString((CHAR*)"__typ", 6); + OPC_Str1((CHAR*)", #", 4, typ->size); + OPM_WriteString((CHAR*)", 1, P)", 8); } else if (typ->comp == 2) { n = typ->n; typ = typ->BaseTyp; @@ -1399,17 +1400,17 @@ void OPC_GenEnumPtrs (OPT_Object var) typ = typ->BaseTyp; } if (typ->form == 13) { - OPM_WriteString((CHAR*)"__ENUMP(", (LONGINT)9); + OPM_WriteString((CHAR*)"__ENUMP(", 9); OPC_Ident(var); - OPC_Str1((CHAR*)", #, P)", (LONGINT)8, n); + OPC_Str1((CHAR*)", #, P)", 8, n); } else if (typ->comp == 4) { - OPM_WriteString((CHAR*)"__ENUMR(", (LONGINT)9); + OPM_WriteString((CHAR*)"__ENUMR(", 9); OPC_Ident(var); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Andent(typ); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); - OPC_Str1((CHAR*)", #", (LONGINT)4, typ->size); - OPC_Str1((CHAR*)", #, P)", (LONGINT)8, n); + OPM_WriteString((CHAR*)"__typ", 6); + OPC_Str1((CHAR*)", #", 4, typ->size); + OPC_Str1((CHAR*)", #, P)", 8, n); } } OPC_EndStat(); @@ -1425,49 +1426,49 @@ void OPC_GenEnumPtrs (OPT_Object var) void OPC_EnterBody (void) { OPM_WriteLn(); - OPM_WriteString((CHAR*)"export ", (LONGINT)8); + OPM_WriteString((CHAR*)"export ", 8); if (OPC_mainprog) { if (OPC_ansi) { - OPM_WriteString((CHAR*)"int main(int argc, char **argv)", (LONGINT)32); + OPM_WriteString((CHAR*)"int main(int argc, char **argv)", 32); OPM_WriteLn(); } else { - OPM_WriteString((CHAR*)"main(argc, argv)", (LONGINT)17); + OPM_WriteString((CHAR*)"main(argc, argv)", 17); OPM_WriteLn(); OPM_Write(0x09); - OPM_WriteString((CHAR*)"int argc; char **argv;", (LONGINT)23); + OPM_WriteString((CHAR*)"int argc; char **argv;", 23); OPM_WriteLn(); } } else { - OPM_WriteString((CHAR*)"void *", (LONGINT)7); - OPM_WriteString(OPM_modName, ((LONGINT)(32))); - OPM_WriteString(OPC_BodyNameExt, ((LONGINT)(13))); + OPM_WriteString((CHAR*)"void *", 7); + OPM_WriteString(OPM_modName, 32); + OPM_WriteString(OPC_BodyNameExt, 13); OPM_WriteLn(); } OPC_BegBlk(); OPC_BegStat(); if (OPC_mainprog) { - OPM_WriteString((CHAR*)"__INIT(argc, argv)", (LONGINT)19); + OPM_WriteString((CHAR*)"__INIT(argc, argv)", 19); } else { - OPM_WriteString((CHAR*)"__DEFMOD", (LONGINT)9); + OPM_WriteString((CHAR*)"__DEFMOD", 9); } OPC_EndStat(); if ((OPC_mainprog && 0)) { OPC_BegStat(); - OPM_WriteString((CHAR*)"/*don`t do it!*/ printf(\"DEMO VERSION: DO NOT USE THIS PROGRAM FOR ANY COMMERCIAL PURPOSE\\n\")", (LONGINT)94); + OPM_WriteString((CHAR*)"/*don`t do it!*/ printf(\"DEMO VERSION: DO NOT USE THIS PROGRAM FOR ANY COMMERCIAL PURPOSE\\n\")", 94); OPC_EndStat(); } OPC_InitImports(OPT_topScope->right); OPC_BegStat(); if (OPC_mainprog) { - OPM_WriteString((CHAR*)"__REGMAIN(\"", (LONGINT)12); + OPM_WriteString((CHAR*)"__REGMAIN(\"", 12); } else { - OPM_WriteString((CHAR*)"__REGMOD(\"", (LONGINT)11); + OPM_WriteString((CHAR*)"__REGMOD(\"", 11); } - OPM_WriteString(OPM_modName, ((LONGINT)(32))); + OPM_WriteString(OPM_modName, 32); if (OPC_GlbPtrs) { - OPM_WriteString((CHAR*)"\", EnumPtrs)", (LONGINT)13); + OPM_WriteString((CHAR*)"\", EnumPtrs)", 13); } else { - OPM_WriteString((CHAR*)"\", 0)", (LONGINT)6); + OPM_WriteString((CHAR*)"\", 0)", 6); } OPC_EndStat(); if (__STRCMP(OPM_modName, "SYSTEM") != 0) { @@ -1479,9 +1480,9 @@ void OPC_ExitBody (void) { OPC_BegStat(); if (OPC_mainprog) { - OPM_WriteString((CHAR*)"__FINI;", (LONGINT)8); + OPM_WriteString((CHAR*)"__FINI;", 8); } else { - OPM_WriteString((CHAR*)"__ENDMOD;", (LONGINT)10); + OPM_WriteString((CHAR*)"__ENDMOD;", 10); } OPM_WriteLn(); OPC_EndBlk(); @@ -1491,25 +1492,25 @@ void OPC_DefineInter (OPT_Object proc) { OPT_Object scope = NIL; scope = proc->scope; - OPM_WriteString((CHAR*)"static ", (LONGINT)8); - OPM_WriteString((CHAR*)"struct ", (LONGINT)8); - OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"static ", 8); + OPM_WriteString((CHAR*)"struct ", 8); + OPM_WriteStringVar((void*)scope->name, 256); OPM_Write(' '); OPC_BegBlk(); OPC_IdentList(proc->link, 3); OPC_IdentList(scope->scope, 3); OPC_BegStat(); - OPM_WriteString((CHAR*)"struct ", (LONGINT)8); - OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"struct ", 8); + OPM_WriteStringVar((void*)scope->name, 256); OPM_Write(' '); OPM_Write('*'); - OPM_WriteString((CHAR*)"lnk", (LONGINT)4); + OPM_WriteString((CHAR*)"lnk", 4); OPC_EndStat(); OPC_EndBlk0(); OPM_Write(' '); OPM_Write('*'); - OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteStringVar((void*)scope->name, 256); + OPM_WriteString((CHAR*)"_s", 3); OPC_EndStat(); OPM_WriteLn(); OPC_ProcPredefs(scope->right, 0); @@ -1522,24 +1523,24 @@ void OPC_EnterProc (OPT_Object proc) OPT_Struct typ = NIL; INTEGER dim; if (proc->vis != 1) { - OPM_WriteString((CHAR*)"static ", (LONGINT)8); + OPM_WriteString((CHAR*)"static ", 8); } OPC_ProcHeader(proc, 1); OPC_BegBlk(); if (proc->typ != OPT_notyp) { OPC_BegStat(); OPC_Ident(proc->typ->strobj); - OPM_WriteString((CHAR*)" _o_result;", (LONGINT)12); + OPM_WriteString((CHAR*)" _o_result;", 12); OPM_WriteLn(); } scope = proc->scope; OPC_IdentList(scope->scope, 0); if (!scope->leaf) { OPC_BegStat(); - OPM_WriteString((CHAR*)"struct ", (LONGINT)8); - OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"struct ", 8); + OPM_WriteStringVar((void*)scope->name, 256); OPM_Write(' '); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"_s", 3); OPC_EndStat(); } var = proc->link; @@ -1553,7 +1554,7 @@ void OPC_EnterProc (OPT_Object proc) } OPM_Write(' '); OPC_Ident(var); - OPM_WriteString((CHAR*)"__copy", (LONGINT)7); + OPM_WriteString((CHAR*)"__copy", 7); OPC_EndStat(); } var = var->link; @@ -1566,7 +1567,7 @@ void OPC_EnterProc (OPT_Object proc) OPC_Ident(var->typ->strobj); OPM_Write(' '); OPC_Ident(var); - OPM_WriteString((CHAR*)" = _", (LONGINT)5); + OPM_WriteString((CHAR*)" = _", 5); OPC_Ident(var); OPC_EndStat(); } @@ -1578,31 +1579,31 @@ void OPC_EnterProc (OPT_Object proc) if ((((__IN(var->typ->comp, 0x0c) && var->mode == 1)) && var->typ->sysflag == 0)) { OPC_BegStat(); if (var->typ->comp == 2) { - OPM_WriteString((CHAR*)"__DUPARR(", (LONGINT)10); + OPM_WriteString((CHAR*)"__DUPARR(", 10); OPC_Ident(var); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); if (var->typ->strobj == NIL) { OPM_Mark(200, var->typ->txtpos); } else { OPC_Ident(var->typ->strobj); } } else { - OPM_WriteString((CHAR*)"__DUP(", (LONGINT)7); + OPM_WriteString((CHAR*)"__DUP(", 7); OPC_Ident(var); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Ident(var); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); typ = var->typ->BaseTyp; dim = 1; while (typ->comp == 3) { - OPM_WriteString((CHAR*)" * ", (LONGINT)4); + OPM_WriteString((CHAR*)" * ", 4); OPC_Ident(var); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); OPM_WriteInt(dim); typ = typ->BaseTyp; dim += 1; } - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); if (typ->strobj == NIL) { OPM_Mark(200, typ->txtpos); } else { @@ -1619,12 +1620,12 @@ void OPC_EnterProc (OPT_Object proc) while (var != NIL) { if (!var->leaf) { OPC_BegStat(); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"_s", 3); OPM_Write('.'); OPC_Ident(var); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteString((CHAR*)" = ", 4); if (__IN(var->typ->comp, 0x0c)) { - OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(void*)", 8); } else if (var->mode != 2) { OPM_Write('&'); } @@ -1633,31 +1634,31 @@ void OPC_EnterProc (OPT_Object proc) typ = var->typ; dim = 0; do { - OPM_WriteString((CHAR*)"; ", (LONGINT)3); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"; ", 3); + OPM_WriteString((CHAR*)"_s", 3); OPM_Write('.'); OPC_Ident(var); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); if (dim != 0) { OPM_WriteInt(dim); } - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteString((CHAR*)" = ", 4); OPC_Ident(var); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); if (dim != 0) { OPM_WriteInt(dim); } typ = typ->BaseTyp; } while (!(typ->comp != 3)); } else if ((var->mode == 2 && var->typ->comp == 4)) { - OPM_WriteString((CHAR*)"; ", (LONGINT)3); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"; ", 3); + OPM_WriteString((CHAR*)"_s", 3); OPM_Write('.'); OPC_Ident(var); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteString((CHAR*)"__typ", 6); + OPM_WriteString((CHAR*)" = ", 4); OPC_Ident(var); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } OPC_EndStat(); } @@ -1667,14 +1668,14 @@ void OPC_EnterProc (OPT_Object proc) while (var != NIL) { if (!var->leaf) { OPC_BegStat(); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"_s", 3); OPM_Write('.'); OPC_Ident(var); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteString((CHAR*)" = ", 4); if (var->typ->comp != 2) { OPM_Write('&'); } else { - OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(void*)", 8); } OPC_Ident(var); OPC_EndStat(); @@ -1682,19 +1683,19 @@ void OPC_EnterProc (OPT_Object proc) var = var->link; } OPC_BegStat(); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"_s", 3); OPM_Write('.'); - OPM_WriteString((CHAR*)"lnk", (LONGINT)4); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); - OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"lnk", 4); + OPM_WriteString((CHAR*)" = ", 4); + OPM_WriteStringVar((void*)scope->name, 256); + OPM_WriteString((CHAR*)"_s", 3); OPC_EndStat(); OPC_BegStat(); - OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteStringVar((void*)scope->name, 256); + OPM_WriteString((CHAR*)"_s", 3); + OPM_WriteString((CHAR*)" = ", 4); OPM_Write('&'); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"_s", 3); OPC_EndStat(); } } @@ -1706,7 +1707,7 @@ void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet) indent = eoBlock; if ((implicitRet && proc->typ != OPT_notyp)) { OPM_Write(0x09); - OPM_WriteString((CHAR*)"__RETCHK;", (LONGINT)10); + OPM_WriteString((CHAR*)"__RETCHK;", 10); OPM_WriteLn(); } else if (!eoBlock || implicitRet) { if (!proc->scope->leaf) { @@ -1715,12 +1716,12 @@ void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet) } else { indent = 1; } - OPM_WriteStringVar((void*)proc->scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteStringVar((void*)proc->scope->name, 256); + OPM_WriteString((CHAR*)"_s", 3); + OPM_WriteString((CHAR*)" = ", 4); + OPM_WriteString((CHAR*)"_s", 3); OPM_Write('.'); - OPM_WriteString((CHAR*)"lnk", (LONGINT)4); + OPM_WriteString((CHAR*)"lnk", 4); OPC_EndStat(); } var = proc->link; @@ -1731,7 +1732,7 @@ void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet) } else { indent = 1; } - OPM_WriteString((CHAR*)"__DEL(", (LONGINT)7); + OPM_WriteString((CHAR*)"__DEL(", 7); OPC_Ident(var); OPM_Write(')'); OPC_EndStat(); @@ -1754,9 +1755,9 @@ void OPC_CompleteIdent (OPT_Object obj) if (obj->adr == 1) { if (obj->typ->comp == 4) { OPC_Ident(obj); - OPM_WriteString((CHAR*)"__", (LONGINT)3); + OPM_WriteString((CHAR*)"__", 3); } else { - OPM_WriteString((CHAR*)"((", (LONGINT)3); + OPM_WriteString((CHAR*)"((", 3); OPC_Ident(obj->typ->strobj); OPM_Write(')'); OPC_Ident(obj); @@ -1767,9 +1768,9 @@ void OPC_CompleteIdent (OPT_Object obj) if ((obj->mode != 2 && comp != 3)) { OPM_Write('*'); } - OPM_WriteStringVar((void*)obj->scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); - OPM_WriteString((CHAR*)"->", (LONGINT)3); + OPM_WriteStringVar((void*)obj->scope->name, 256); + OPM_WriteString((CHAR*)"_s", 3); + OPM_WriteString((CHAR*)"->", 3); OPC_Ident(obj); } else { OPC_Ident(obj); @@ -1781,17 +1782,17 @@ void OPC_TypeOf (OPT_Object ap) INTEGER i; __ASSERT(ap->typ->comp == 4, 0); if (ap->mode == 2) { - if ((int)ap->mnolev != OPM_level) { - OPM_WriteStringVar((void*)ap->scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"_s->", (LONGINT)5); + if (ap->mnolev != OPM_level) { + OPM_WriteStringVar((void*)ap->scope->name, 256); + OPM_WriteString((CHAR*)"_s->", 5); OPC_Ident(ap); } else { OPC_Ident(ap); } - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } else if (ap->typ->strobj != NIL) { OPC_Ident(ap->typ->strobj); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } else { OPC_Andent(ap->typ); } @@ -1801,26 +1802,26 @@ void OPC_Cmp (INTEGER rel) { switch (rel) { case 9: - OPM_WriteString((CHAR*)" == ", (LONGINT)5); + OPM_WriteString((CHAR*)" == ", 5); break; case 10: - OPM_WriteString((CHAR*)" != ", (LONGINT)5); + OPM_WriteString((CHAR*)" != ", 5); break; case 11: - OPM_WriteString((CHAR*)" < ", (LONGINT)4); + OPM_WriteString((CHAR*)" < ", 4); break; case 12: - OPM_WriteString((CHAR*)" <= ", (LONGINT)5); + OPM_WriteString((CHAR*)" <= ", 5); break; case 13: - OPM_WriteString((CHAR*)" > ", (LONGINT)4); + OPM_WriteString((CHAR*)" > ", 4); break; case 14: - OPM_WriteString((CHAR*)" >= ", (LONGINT)5); + OPM_WriteString((CHAR*)" >= ", 5); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPC.Cmp, rel = ", (LONGINT)34); - OPM_LogWNum(rel, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPC.Cmp, rel = ", 34); + OPM_LogWNum(rel, 0); OPM_LogWLn(); break; } @@ -1829,7 +1830,7 @@ void OPC_Cmp (INTEGER rel) static void OPC_CharacterLiteral (LONGINT c) { if (c < 32 || c > 126) { - OPM_WriteString((CHAR*)"0x", (LONGINT)3); + OPM_WriteString((CHAR*)"0x", 3); OPM_WriteHex(c); } else { OPM_Write('\''); @@ -1849,7 +1850,7 @@ static void OPC_StringLiteral (CHAR *s, LONGINT s__len, LONGINT l) OPM_Write('"'); i = 0; while (i < l) { - c = (int)s[__X(i, s__len)]; + c = s[__X(i, s__len)]; if (c < 32 || c > 126) { OPM_Write('\\'); OPM_Write((CHAR)(48 + __ASHR(c, 6))); @@ -1872,7 +1873,7 @@ static void OPC_StringLiteral (CHAR *s, LONGINT s__len, LONGINT l) void OPC_Case (LONGINT caseVal, INTEGER form) { CHAR ch; - OPM_WriteString((CHAR*)"case ", (LONGINT)6); + OPM_WriteString((CHAR*)"case ", 6); switch (form) { case 3: OPC_CharacterLiteral(caseVal); @@ -1881,42 +1882,68 @@ void OPC_Case (LONGINT caseVal, INTEGER form) OPM_WriteInt(caseVal); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPC.Case, form = ", (LONGINT)36); - OPM_LogWNum(form, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPC.Case, form = ", 36); + OPM_LogWNum(form, 0); OPM_LogWLn(); break; } - OPM_WriteString((CHAR*)": ", (LONGINT)3); + OPM_WriteString((CHAR*)": ", 3); } void OPC_SetInclude (BOOLEAN exclude) { if (exclude) { - OPM_WriteString((CHAR*)" &= ~", (LONGINT)6); + OPM_WriteString((CHAR*)" &= ~", 6); } else { - OPM_WriteString((CHAR*)" |= ", (LONGINT)5); + OPM_WriteString((CHAR*)" |= ", 5); } } void OPC_Increment (BOOLEAN decrement) { if (decrement) { - OPM_WriteString((CHAR*)" -= ", (LONGINT)5); + OPM_WriteString((CHAR*)" -= ", 5); } else { - OPM_WriteString((CHAR*)" += ", (LONGINT)5); + OPM_WriteString((CHAR*)" += ", 5); } } void OPC_Halt (LONGINT n) { - OPC_Str1((CHAR*)"__HALT(#)", (LONGINT)10, n); + OPC_Str1((CHAR*)"__HALT(#)", 10, n); +} + +void OPC_IntLiteral (LONGINT n, LONGINT size) +{ + if ((((size > 4 && n <= 2147483647)) && n > (-2147483647-1))) { + switch (size) { + case 2: + OPM_WriteString((CHAR*)"((SYSTEM_INT16)(", 17); + break; + case 4: + OPM_WriteString((CHAR*)"((SYSTEM_INT32)(", 17); + break; + case 8: + OPM_WriteString((CHAR*)"((SYSTEM_INT64)(", 17); + break; + default: + OPM_LogWStr((CHAR*)"Unhandled case in OPC.IntLiteral, size = ", 42); + OPM_LogWNum(size, 1); + OPM_LogWLn(); + break; + } + OPM_WriteInt(n); + OPM_WriteString((CHAR*)"))", 3); + } else { + OPM_WriteInt(n); + } } void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim) { if (array->comp == 3) { OPC_CompleteIdent(obj); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); if (dim != 0) { OPM_WriteInt(dim); } @@ -1925,9 +1952,11 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim) array = array->BaseTyp; dim -= 1; } - OPM_WriteString((CHAR*)"((LONGINT)(", (LONGINT)12); - OPM_WriteInt(array->n); - OPM_WriteString((CHAR*)"))", (LONGINT)3); + if (OPC_ansi) { + OPM_WriteInt(array->n); + } else { + OPC_IntLiteral(array->n, OPM_PointerSize); + } } } @@ -1957,7 +1986,7 @@ void OPC_Constant (OPT_Const con, INTEGER form) OPM_WriteReal(con->realval, 0x00); break; case 9: - OPM_WriteString((CHAR*)"0x", (LONGINT)3); + OPM_WriteString((CHAR*)"0x", 3); skipLeading = 1; s = con->setval; i = 32; @@ -1980,14 +2009,14 @@ void OPC_Constant (OPT_Const con, INTEGER form) } break; case 10: - OPC_StringLiteral(*con->ext, ((LONGINT)(256)), con->intval2 - 1); + OPC_StringLiteral(*con->ext, 256, con->intval2 - 1); break; case 11: - OPM_WriteString((CHAR*)"NIL", (LONGINT)4); + OPM_WriteString((CHAR*)"NIL", 4); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPC.Constant, form = ", (LONGINT)40); - OPM_LogWNum(form, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPC.Constant, form = ", 40); + OPM_LogWNum(form, 0); OPM_LogWLn(); break; } @@ -2005,8 +2034,8 @@ static void Enter__49 (CHAR *s, LONGINT s__len) INTEGER h; __DUP(s, s__len, CHAR); h = OPC_PerfectHash((void*)s, s__len); - OPC_hashtab[__X(h, ((LONGINT)(105)))] = *InitKeywords__48_s->n; - __COPY(s, OPC_keytab[__X(*InitKeywords__48_s->n, ((LONGINT)(36)))], ((LONGINT)(9))); + OPC_hashtab[__X(h, 105)] = *InitKeywords__48_s->n; + __COPY(s, OPC_keytab[__X(*InitKeywords__48_s->n, 36)], 9); *InitKeywords__48_s->n += 1; __DEL(s); } @@ -2021,45 +2050,45 @@ static void OPC_InitKeywords (void) n = 0; i = 0; while (i <= 104) { - OPC_hashtab[__X(i, ((LONGINT)(105)))] = -1; + OPC_hashtab[__X(i, 105)] = -1; i += 1; } - Enter__49((CHAR*)"asm", (LONGINT)4); - Enter__49((CHAR*)"auto", (LONGINT)5); - Enter__49((CHAR*)"break", (LONGINT)6); - Enter__49((CHAR*)"case", (LONGINT)5); - Enter__49((CHAR*)"char", (LONGINT)5); - Enter__49((CHAR*)"const", (LONGINT)6); - Enter__49((CHAR*)"continue", (LONGINT)9); - Enter__49((CHAR*)"default", (LONGINT)8); - Enter__49((CHAR*)"do", (LONGINT)3); - Enter__49((CHAR*)"double", (LONGINT)7); - Enter__49((CHAR*)"else", (LONGINT)5); - Enter__49((CHAR*)"enum", (LONGINT)5); - Enter__49((CHAR*)"extern", (LONGINT)7); - Enter__49((CHAR*)"export", (LONGINT)7); - Enter__49((CHAR*)"float", (LONGINT)6); - Enter__49((CHAR*)"for", (LONGINT)4); - Enter__49((CHAR*)"fortran", (LONGINT)8); - Enter__49((CHAR*)"goto", (LONGINT)5); - Enter__49((CHAR*)"if", (LONGINT)3); - Enter__49((CHAR*)"import", (LONGINT)7); - Enter__49((CHAR*)"int", (LONGINT)4); - Enter__49((CHAR*)"long", (LONGINT)5); - Enter__49((CHAR*)"register", (LONGINT)9); - Enter__49((CHAR*)"return", (LONGINT)7); - Enter__49((CHAR*)"short", (LONGINT)6); - Enter__49((CHAR*)"signed", (LONGINT)7); - Enter__49((CHAR*)"sizeof", (LONGINT)7); - Enter__49((CHAR*)"static", (LONGINT)7); - Enter__49((CHAR*)"struct", (LONGINT)7); - Enter__49((CHAR*)"switch", (LONGINT)7); - Enter__49((CHAR*)"typedef", (LONGINT)8); - Enter__49((CHAR*)"union", (LONGINT)6); - Enter__49((CHAR*)"unsigned", (LONGINT)9); - Enter__49((CHAR*)"void", (LONGINT)5); - Enter__49((CHAR*)"volatile", (LONGINT)9); - Enter__49((CHAR*)"while", (LONGINT)6); + Enter__49((CHAR*)"asm", 4); + Enter__49((CHAR*)"auto", 5); + Enter__49((CHAR*)"break", 6); + Enter__49((CHAR*)"case", 5); + Enter__49((CHAR*)"char", 5); + Enter__49((CHAR*)"const", 6); + Enter__49((CHAR*)"continue", 9); + Enter__49((CHAR*)"default", 8); + Enter__49((CHAR*)"do", 3); + Enter__49((CHAR*)"double", 7); + Enter__49((CHAR*)"else", 5); + Enter__49((CHAR*)"enum", 5); + Enter__49((CHAR*)"extern", 7); + Enter__49((CHAR*)"export", 7); + Enter__49((CHAR*)"float", 6); + Enter__49((CHAR*)"for", 4); + Enter__49((CHAR*)"fortran", 8); + Enter__49((CHAR*)"goto", 5); + Enter__49((CHAR*)"if", 3); + Enter__49((CHAR*)"import", 7); + Enter__49((CHAR*)"int", 4); + Enter__49((CHAR*)"long", 5); + Enter__49((CHAR*)"register", 9); + Enter__49((CHAR*)"return", 7); + Enter__49((CHAR*)"short", 6); + Enter__49((CHAR*)"signed", 7); + Enter__49((CHAR*)"sizeof", 7); + Enter__49((CHAR*)"static", 7); + Enter__49((CHAR*)"struct", 7); + Enter__49((CHAR*)"switch", 7); + Enter__49((CHAR*)"typedef", 8); + Enter__49((CHAR*)"union", 6); + Enter__49((CHAR*)"unsigned", 9); + Enter__49((CHAR*)"void", 5); + Enter__49((CHAR*)"volatile", 9); + Enter__49((CHAR*)"while", 6); InitKeywords__48_s = _s.lnk; } diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index dcd53d63..4243328e 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h @@ -37,6 +37,7 @@ import void OPC_Increment (BOOLEAN decrement); import void OPC_Indent (INTEGER count); import void OPC_Init (void); import void OPC_InitTDesc (OPT_Struct typ); +import void OPC_IntLiteral (LONGINT n, LONGINT size); import void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim); import LONGINT OPC_NofPtrs (OPT_Struct typ); import void OPC_SetInclude (BOOLEAN exclude); diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 65ebb8b0..c3bece55 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" @@ -154,20 +154,20 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) case 'B': if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_IntSize = (int)s[__X(i, s__len)] - 48; + OPM_IntSize = s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_PointerSize = (int)s[__X(i, s__len)] - 48; + OPM_PointerSize = s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_Alignment = (int)s[__X(i, s__len)] - 48; + OPM_Alignment = s[__X(i, s__len)] - 48; } __ASSERT(OPM_IntSize == 2 || OPM_IntSize == 4, 0); __ASSERT(OPM_PointerSize == 4 || OPM_PointerSize == 8, 0); __ASSERT(OPM_Alignment == 4 || OPM_Alignment == 8, 0); - Files_SetSearchPath((CHAR*)"", (LONGINT)1); + Files_SetSearchPath((CHAR*)"", 1); break; case 'F': *opt = *opt ^ 0x020000; @@ -182,10 +182,10 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) *opt = *opt ^ 0x040000; break; default: - OPM_LogWStr((CHAR*)" warning: option ", (LONGINT)19); + OPM_LogWStr((CHAR*)" warning: option ", 19); OPM_LogW('-'); OPM_LogW(s[__X(i, s__len)]); - OPM_LogWStr((CHAR*)" ignored", (LONGINT)9); + OPM_LogWStr((CHAR*)" ignored", 9); OPM_LogWLn(); break; } @@ -199,71 +199,71 @@ BOOLEAN OPM_OpenPar (void) CHAR s[256]; if (Platform_ArgCount == 1) { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Vishap Oberon-2 compiler v", (LONGINT)27); - OPM_LogWStr(Configuration_versionLong, ((LONGINT)(41))); + OPM_LogWStr((CHAR*)"Vishap Oberon-2 compiler v", 27); + OPM_LogWStr(Configuration_versionLong, 41); OPM_LogW('.'); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Based on Ofront by Software Templ OEG, continued by Norayr Chilingarian and others.", (LONGINT)84); + OPM_LogWStr((CHAR*)"Based on Ofront by Software Templ OEG, continued by Norayr Chilingarian and others.", 84); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Usage:", (LONGINT)7); + OPM_LogWStr((CHAR*)"Usage:", 7); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" ", (LONGINT)3); - OPM_LogWStr((CHAR*)"voc", (LONGINT)4); - OPM_LogWStr((CHAR*)" options {files {options}}.", (LONGINT)28); + OPM_LogWStr((CHAR*)" ", 3); + OPM_LogWStr((CHAR*)"voc", 4); + OPM_LogWStr((CHAR*)" options {files {options}}.", 28); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Where options = [\"-\" {option} ].", (LONGINT)33); + OPM_LogWStr((CHAR*)"Where options = [\"-\" {option} ].", 33); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" m - generate code for main module", (LONGINT)36); + OPM_LogWStr((CHAR*)" m - generate code for main module", 36); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" M - generate code for main module and link object statically", (LONGINT)63); + OPM_LogWStr((CHAR*)" M - generate code for main module and link object statically", 63); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" s - generate new symbol file", (LONGINT)31); + OPM_LogWStr((CHAR*)" s - generate new symbol file", 31); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" e - allow extending the module interface", (LONGINT)43); + OPM_LogWStr((CHAR*)" e - allow extending the module interface", 43); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" r - check value ranges", (LONGINT)25); + OPM_LogWStr((CHAR*)" r - check value ranges", 25); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" x - turn off array indices check", (LONGINT)35); + OPM_LogWStr((CHAR*)" x - turn off array indices check", 35); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" a - don't check ASSERTs at runtime, use this option in tested production code", (LONGINT)80); + OPM_LogWStr((CHAR*)" a - don't check ASSERTs at runtime, use this option in tested production code", 80); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" p - turn off automatic pointer initialization", (LONGINT)48); + OPM_LogWStr((CHAR*)" p - turn off automatic pointer initialization", 48); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" t - don't check type guards (use in rare cases such as low-level modules where every cycle counts)", (LONGINT)101); + OPM_LogWStr((CHAR*)" t - don't check type guards (use in rare cases such as low-level modules where every cycle counts)", 101); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" S - don't call external assembler/compiler, only generate C code", (LONGINT)67); + OPM_LogWStr((CHAR*)" S - don't call external assembler/compiler, only generate C code", 67); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" c - don't call linker", (LONGINT)24); + OPM_LogWStr((CHAR*)" c - don't call linker", 24); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" f - don't use color output", (LONGINT)29); + OPM_LogWStr((CHAR*)" f - don't use color output", 29); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" F - force writing new symbol file in current directory", (LONGINT)57); + OPM_LogWStr((CHAR*)" F - force writing new symbol file in current directory", 57); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" V - verbose output", (LONGINT)21); + OPM_LogWStr((CHAR*)" V - verbose output", 21); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Initial options specify defaults for all files.", (LONGINT)48); + OPM_LogWStr((CHAR*)"Initial options specify defaults for all files.", 48); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Options following a filename are specific to that file.", (LONGINT)56); + OPM_LogWStr((CHAR*)"Options following a filename are specific to that file.", 56); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Repeating an option toggles its value.", (LONGINT)39); + OPM_LogWStr((CHAR*)"Repeating an option toggles its value.", 39); OPM_LogWLn(); _o_result = 0; return _o_result; } else { OPM_S = 1; s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + Platform_GetArg(OPM_S, (void*)s, 256); OPM_glbopt = 0xe9; while (s[0] == '-') { - OPM_ScanOptions((void*)s, ((LONGINT)(256)), &OPM_glbopt); + OPM_ScanOptions((void*)s, 256, &OPM_glbopt); OPM_S += 1; s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + Platform_GetArg(OPM_S, (void*)s, 256); } _o_result = 1; return _o_result; @@ -276,12 +276,12 @@ void OPM_InitOptions (void) CHAR s[256]; OPM_opt = OPM_glbopt; s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + Platform_GetArg(OPM_S, (void*)s, 256); while (s[0] == '-') { - OPM_ScanOptions((void*)s, ((LONGINT)(256)), &OPM_opt); + OPM_ScanOptions((void*)s, 256, &OPM_opt); OPM_S += 1; s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + Platform_GetArg(OPM_S, (void*)s, 256); } OPM_dontAsm = __IN(13, OPM_opt); OPM_dontLink = __IN(14, OPM_opt); @@ -307,19 +307,19 @@ void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len) return; } s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + Platform_GetArg(OPM_S, (void*)s, 256); __NEW(T, Texts_TextDesc); - Texts_Open(T, s, ((LONGINT)(256))); - OPM_LogWStr(s, ((LONGINT)(256))); - OPM_LogWStr((CHAR*)" ", (LONGINT)3); + Texts_Open(T, s, 256); + OPM_LogWStr(s, 256); + OPM_LogWStr((CHAR*)" ", 3); __COPY(s, mname, mname__len); - __COPY(s, OPM_SourceFileName, ((LONGINT)(256))); + __COPY(s, OPM_SourceFileName, 256); if (T->len == 0) { - OPM_LogWStr(s, ((LONGINT)(256))); - OPM_LogWStr((CHAR*)" not found.", (LONGINT)12); + OPM_LogWStr(s, 256); + OPM_LogWStr((CHAR*)" not found.", 12); OPM_LogWLn(); } else { - Texts_OpenReader(&OPM_inR, Texts_Reader__typ, T, ((LONGINT)(0))); + Texts_OpenReader(&OPM_inR, Texts_Reader__typ, T, 0); *done = 1; } OPM_S += 1; @@ -378,25 +378,25 @@ static void OPM_LogErrMsg (INTEGER n) CHAR buf[1024]; if (n >= 0) { if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"31m", (LONGINT)4); + vt100_SetAttr((CHAR*)"31m", 4); } - OPM_LogWStr((CHAR*)" err ", (LONGINT)7); + OPM_LogWStr((CHAR*)" err ", 7); if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + vt100_SetAttr((CHAR*)"0m", 3); } } else { if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"35m", (LONGINT)4); + vt100_SetAttr((CHAR*)"35m", 4); } - OPM_LogWStr((CHAR*)" warning ", (LONGINT)11); + OPM_LogWStr((CHAR*)" warning ", 11); n = -n; if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + vt100_SetAttr((CHAR*)"0m", 3); } } - OPM_LogWNum(n, ((LONGINT)(1))); - OPM_LogWStr((CHAR*)" ", (LONGINT)3); - OPM_LogWStr(errors_errors[__X(n, ((LONGINT)(350)))], ((LONGINT)(128))); + OPM_LogWNum(n, 1); + OPM_LogWStr((CHAR*)" ", 3); + OPM_LogWStr(errors_errors[__X(n, 350)], 128); } static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, LONGINT pos) @@ -438,37 +438,37 @@ static void OPM_ShowLine (LONGINT pos) CHAR line[1023]; INTEGER i; CHAR ch; - f = Files_Old(OPM_SourceFileName, ((LONGINT)(256))); + f = Files_Old(OPM_SourceFileName, 256); OPM_FindLine(f, &r, Files_Rider__typ, pos); i = 0; Files_Read(&r, Files_Rider__typ, (void*)&ch); while ((((((ch != 0x00 && ch != 0x0d)) && ch != 0x0a)) && i < 1022)) { - line[__X(i, ((LONGINT)(1023)))] = ch; + line[__X(i, 1023)] = ch; i += 1; Files_Read(&r, Files_Rider__typ, (void*)&ch); } - line[__X(i, ((LONGINT)(1023)))] = 0x00; + line[__X(i, 1023)] = 0x00; OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWNum(OPM_ErrorLineNumber, ((LONGINT)(4))); - OPM_LogWStr((CHAR*)": ", (LONGINT)3); - OPM_LogWStr(line, ((LONGINT)(1023))); + OPM_LogWNum(OPM_ErrorLineNumber, 4); + OPM_LogWStr((CHAR*)": ", 3); + OPM_LogWStr(line, 1023); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" ", (LONGINT)7); + OPM_LogWStr((CHAR*)" ", 7); if (pos >= OPM_ErrorLineLimitPos) { pos = OPM_ErrorLineLimitPos - 1; } - i = (int)(pos - OPM_ErrorLineStartPos); + i = (pos - OPM_ErrorLineStartPos); while (i > 0) { OPM_LogW(' '); i -= 1; } if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"32m", (LONGINT)4); + vt100_SetAttr((CHAR*)"32m", 4); } OPM_LogW('^'); if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + vt100_SetAttr((CHAR*)"0m", 3); } Files_Close(f); } @@ -484,30 +484,30 @@ void OPM_Mark (INTEGER n, LONGINT pos) OPM_lasterrpos = pos; OPM_ShowLine(pos); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" ", (LONGINT)3); + OPM_LogWStr((CHAR*)" ", 3); if (n < 249) { - OPM_LogWStr((CHAR*)" pos", (LONGINT)6); - OPM_LogWNum(pos, ((LONGINT)(6))); + OPM_LogWStr((CHAR*)" pos", 6); + OPM_LogWNum(pos, 6); OPM_LogErrMsg(n); } else if (n == 255) { - OPM_LogWStr((CHAR*)"pos", (LONGINT)4); - OPM_LogWNum(pos, ((LONGINT)(6))); - OPM_LogWStr((CHAR*)" pc ", (LONGINT)6); - OPM_LogWNum(OPM_breakpc, ((LONGINT)(1))); + OPM_LogWStr((CHAR*)"pos", 4); + OPM_LogWNum(pos, 6); + OPM_LogWStr((CHAR*)" pc ", 6); + OPM_LogWNum(OPM_breakpc, 1); } else if (n == 254) { - OPM_LogWStr((CHAR*)"pc not found", (LONGINT)13); + OPM_LogWStr((CHAR*)"pc not found", 13); } else { - OPM_LogWStr(OPM_objname, ((LONGINT)(64))); + OPM_LogWStr(OPM_objname, 64); if (n == 253) { - OPM_LogWStr((CHAR*)" is new, compile with option e", (LONGINT)31); + OPM_LogWStr((CHAR*)" is new, compile with option e", 31); } else if (n == 252) { - OPM_LogWStr((CHAR*)" is redefined, compile with option s", (LONGINT)37); + OPM_LogWStr((CHAR*)" is redefined, compile with option s", 37); } else if (n == 251) { - OPM_LogWStr((CHAR*)" is redefined (private part only), compile with option s", (LONGINT)57); + OPM_LogWStr((CHAR*)" is redefined (private part only), compile with option s", 57); } else if (n == 250) { - OPM_LogWStr((CHAR*)" is no longer visible, compile with option s", (LONGINT)45); + OPM_LogWStr((CHAR*)" is no longer visible, compile with option s", 45); } else if (n == 249) { - OPM_LogWStr((CHAR*)" is not consistently imported, recompile imports", (LONGINT)49); + OPM_LogWStr((CHAR*)" is not consistently imported, recompile imports", 49); } } } @@ -515,8 +515,8 @@ void OPM_Mark (INTEGER n, LONGINT pos) if (pos >= 0) { OPM_ShowLine(pos); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" pos", (LONGINT)6); - OPM_LogWNum(pos, ((LONGINT)(6))); + OPM_LogWStr((CHAR*)" pos", 6); + OPM_LogWNum(pos, 6); } OPM_LogErrMsg(n); if (pos < 0) { @@ -532,27 +532,27 @@ void OPM_err (INTEGER n) void OPM_FPrint (LONGINT *fp, LONGINT val) { - *fp = __ROTL((LONGINT)((SET)*fp ^ (SET)val), 1, LONGINT); + *fp = __ROTL((LONGINT)(__VAL(SET, *fp) ^ __VAL(SET, val)), 1, LONGINT); } void OPM_FPrintSet (LONGINT *fp, SET set) { - OPM_FPrint(&*fp, (LONGINT)set); + OPM_FPrint(&*fp, __VAL(LONGINT, set)); } void OPM_FPrintReal (LONGINT *fp, REAL real) { INTEGER i; LONGINT l; - __GET((LONGINT)(SYSTEM_ADRINT)&real, l, LONGINT); + __GET((SYSTEM_ADRINT)&real, l, LONGINT); OPM_FPrint(&*fp, l); } void OPM_FPrintLReal (LONGINT *fp, LONGREAL lr) { LONGINT l, h; - __GET((LONGINT)(SYSTEM_ADRINT)&lr, l, LONGINT); - __GET((LONGINT)(SYSTEM_ADRINT)&lr + 4, h, LONGINT); + __GET((SYSTEM_ADRINT)&lr, l, LONGINT); + __GET((SYSTEM_ADRINT)&lr + 4, h, LONGINT); OPM_FPrint(&*fp, l); OPM_FPrint(&*fp, h); } @@ -563,19 +563,19 @@ static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONG if (((*S).class == 1 && __STRCMP((*S).s, name) == 0)) { Texts_Scan(&*S, S__typ); if ((*S).class == 3) { - *size = (int)(*S).i; + *size = (*S).i; Texts_Scan(&*S, S__typ); } else { - OPM_Mark(-157, ((LONGINT)(-1))); + OPM_Mark(-157, -1); } if ((*S).class == 3) { - *align = (int)(*S).i; + *align = (*S).i; Texts_Scan(&*S, S__typ); } else { - OPM_Mark(-157, ((LONGINT)(-1))); + OPM_Mark(-157, -1); } } else { - OPM_Mark(-157, ((LONGINT)(-1))); + OPM_Mark(-157, -1); } __DEL(name); } @@ -604,40 +604,40 @@ static LONGINT OPM_power0 (LONGINT i, LONGINT j) static void OPM_VerboseListSizes (void) { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Type Size Alignement", (LONGINT)29); + OPM_LogWStr((CHAR*)"Type Size Alignement", 29); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"CHAR ", (LONGINT)14); - OPM_LogWNum(OPM_CharSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"CHAR ", 14); + OPM_LogWNum(OPM_CharSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"BOOLEAN ", (LONGINT)14); - OPM_LogWNum(OPM_BoolSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"BOOLEAN ", 14); + OPM_LogWNum(OPM_BoolSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"SHORTINT ", (LONGINT)14); - OPM_LogWNum(OPM_SIntSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"SHORTINT ", 14); + OPM_LogWNum(OPM_SIntSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"INTEGER ", (LONGINT)14); - OPM_LogWNum(OPM_IntSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"INTEGER ", 14); + OPM_LogWNum(OPM_IntSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"LONGINT ", (LONGINT)14); - OPM_LogWNum(OPM_LIntSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"LONGINT ", 14); + OPM_LogWNum(OPM_LIntSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"SET ", (LONGINT)14); - OPM_LogWNum(OPM_SetSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"SET ", 14); + OPM_LogWNum(OPM_SetSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"REAL ", (LONGINT)14); - OPM_LogWNum(OPM_RealSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"REAL ", 14); + OPM_LogWNum(OPM_RealSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"LONGREAL ", (LONGINT)14); - OPM_LogWNum(OPM_LRealSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"LONGREAL ", 14); + OPM_LogWNum(OPM_LRealSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"PTR ", (LONGINT)14); - OPM_LogWNum(OPM_PointerSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"PTR ", 14); + OPM_LogWNum(OPM_PointerSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"PROC ", (LONGINT)14); - OPM_LogWNum(OPM_ProcSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"PROC ", 14); + OPM_LogWNum(OPM_ProcSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"RECORD ", (LONGINT)14); - OPM_LogWNum(OPM_RecSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"RECORD ", 14); + OPM_LogWNum(OPM_RecSize, 4); OPM_LogWLn(); OPM_LogWLn(); } @@ -720,11 +720,11 @@ void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done) { CHAR ch; OPM_FileName fileName; - OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, ((LONGINT)(32)), (CHAR*)".sym", (LONGINT)5); - OPM_oldSFile = Files_Old(fileName, ((LONGINT)(32))); + OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, 32, (CHAR*)".sym", 5); + OPM_oldSFile = Files_Old(fileName, 32); *done = OPM_oldSFile != NIL; if (*done) { - Files_Set(&OPM_oldSF, Files_Rider__typ, OPM_oldSFile, ((LONGINT)(0))); + Files_Set(&OPM_oldSF, Files_Rider__typ, OPM_oldSFile, 0); Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&ch); if (ch != 0xf7) { OPM_err(-306); @@ -753,7 +753,7 @@ void OPM_SymWInt (LONGINT i) void OPM_SymWSet (SET s) { - Files_WriteNum(&OPM_newSF, Files_Rider__typ, (LONGINT)s); + Files_WriteNum(&OPM_newSF, Files_Rider__typ, __VAL(LONGINT, s)); } void OPM_SymWReal (REAL r) @@ -780,10 +780,10 @@ void OPM_DeleteNewSym (void) void OPM_NewSym (CHAR *modName, LONGINT modName__len) { OPM_FileName fileName; - OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, ((LONGINT)(32)), (CHAR*)".sym", (LONGINT)5); - OPM_newSFile = Files_New(fileName, ((LONGINT)(32))); + OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, 32, (CHAR*)".sym", 5); + OPM_newSFile = Files_New(fileName, 32); if (OPM_newSFile != NIL) { - Files_Set(&OPM_newSF, Files_Rider__typ, OPM_newSFile, ((LONGINT)(0))); + Files_Set(&OPM_newSF, Files_Rider__typ, OPM_newSFile, 0); Files_Write(&OPM_newSF, Files_Rider__typ, 0xf7); } else { OPM_err(153); @@ -792,7 +792,7 @@ void OPM_NewSym (CHAR *modName, LONGINT modName__len) void OPM_Write (CHAR ch) { - Files_Write(&OPM_R[__X(OPM_currFile, ((LONGINT)(3)))], Files_Rider__typ, ch); + Files_Write(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, ch); } void OPM_WriteString (CHAR *s, LONGINT s__len) @@ -802,7 +802,7 @@ void OPM_WriteString (CHAR *s, LONGINT s__len) while (s[__X(i, s__len)] != 0x00) { i += 1; } - Files_WriteBytes(&OPM_R[__X(OPM_currFile, ((LONGINT)(3)))], Files_Rider__typ, (void*)s, s__len * ((LONGINT)(1)), i); + Files_WriteBytes(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, (void*)s, s__len * 1, i); } void OPM_WriteStringVar (CHAR *s, LONGINT s__len) @@ -812,27 +812,27 @@ void OPM_WriteStringVar (CHAR *s, LONGINT s__len) while (s[__X(i, s__len)] != 0x00) { i += 1; } - Files_WriteBytes(&OPM_R[__X(OPM_currFile, ((LONGINT)(3)))], Files_Rider__typ, (void*)s, s__len * ((LONGINT)(1)), i); + Files_WriteBytes(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, (void*)s, s__len * 1, i); } void OPM_WriteHex (LONGINT i) { CHAR s[3]; INTEGER digit; - digit = __ASHR((int)i, 4); + digit = __ASHR(i, 4); if (digit < 10) { s[0] = (CHAR)(48 + digit); } else { s[0] = (CHAR)(87 + digit); } - digit = __MASK((int)i, -16); + digit = __MASK(i, -16); if (digit < 10) { s[1] = (CHAR)(48 + digit); } else { s[1] = (CHAR)(87 + digit); } s[2] = 0x00; - OPM_WriteString(s, ((LONGINT)(3))); + OPM_WriteString(s, 3); } void OPM_WriteInt (LONGINT i) @@ -842,24 +842,24 @@ void OPM_WriteInt (LONGINT i) if (i == OPM_SignedMinimum(OPM_IntSize) || i == OPM_SignedMinimum(OPM_LIntSize)) { OPM_Write('('); OPM_WriteInt(i + 1); - OPM_WriteString((CHAR*)"-1)", (LONGINT)4); + OPM_WriteString((CHAR*)"-1)", 4); } else { i1 = __ABS(i); - s[0] = (CHAR)(__MOD(i1, 10) + 48); + s[0] = (CHAR)((int)__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k = 1; while (i1 > 0) { - s[__X(k, ((LONGINT)(20)))] = (CHAR)(__MOD(i1, 10) + 48); + s[__X(k, 20)] = (CHAR)((int)__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k += 1; } if (i < 0) { - s[__X(k, ((LONGINT)(20)))] = '-'; + s[__X(k, 20)] = '-'; k += 1; } while (k > 0) { k -= 1; - OPM_Write(s[__X(k, ((LONGINT)(20)))]); + OPM_Write(s[__X(k, 20)]); } } } @@ -872,13 +872,13 @@ void OPM_WriteReal (LONGREAL r, CHAR suffx) CHAR s[32]; CHAR ch; INTEGER i; - if ((((r < OPM_SignedMaximum(OPM_LIntSize) && r > OPM_SignedMinimum(OPM_LIntSize))) && r == ((int)__ENTIER(r)))) { + if ((((r < OPM_SignedMaximum(OPM_LIntSize) && r > OPM_SignedMinimum(OPM_LIntSize))) && r == ((SYSTEM_INT32)__ENTIER(r)))) { if (suffx == 'f') { - OPM_WriteString((CHAR*)"(REAL)", (LONGINT)7); + OPM_WriteString((CHAR*)"(REAL)", 7); } else { - OPM_WriteString((CHAR*)"(LONGREAL)", (LONGINT)11); + OPM_WriteString((CHAR*)"(LONGREAL)", 11); } - OPM_WriteInt((int)__ENTIER(r)); + OPM_WriteInt((SYSTEM_INT32)__ENTIER(r)); } else { Texts_OpenWriter(&W, Texts_Writer__typ); if (suffx == 'f') { @@ -887,33 +887,33 @@ void OPM_WriteReal (LONGREAL r, CHAR suffx) Texts_WriteLongReal(&W, Texts_Writer__typ, r, 23); } __NEW(T, Texts_TextDesc); - Texts_Open(T, (CHAR*)"", (LONGINT)1); + Texts_Open(T, (CHAR*)"", 1); Texts_Append(T, W.buf); - Texts_OpenReader(&R, Texts_Reader__typ, T, ((LONGINT)(0))); + Texts_OpenReader(&R, Texts_Reader__typ, T, 0); i = 0; Texts_Read(&R, Texts_Reader__typ, &ch); while (ch != 0x00) { - s[__X(i, ((LONGINT)(32)))] = ch; + s[__X(i, 32)] = ch; i += 1; Texts_Read(&R, Texts_Reader__typ, &ch); } - s[__X(i, ((LONGINT)(32)))] = 0x00; + s[__X(i, 32)] = 0x00; i = 0; ch = s[0]; while ((ch != 'D' && ch != 0x00)) { i += 1; - ch = s[__X(i, ((LONGINT)(32)))]; + ch = s[__X(i, 32)]; } if (ch == 'D') { - s[__X(i, ((LONGINT)(32)))] = 'e'; + s[__X(i, 32)] = 'e'; } - OPM_WriteString(s, ((LONGINT)(32))); + OPM_WriteString(s, 32); } } void OPM_WriteLn (void) { - Files_Write(&OPM_R[__X(OPM_currFile, ((LONGINT)(3)))], Files_Rider__typ, 0x0a); + Files_Write(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, 0x0a); } static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F) @@ -921,11 +921,11 @@ static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F) Files_Rider R1; CHAR buffer[4096]; if (F != NIL) { - Files_Set(&R1, Files_Rider__typ, F, ((LONGINT)(0))); - Files_ReadBytes(&R1, Files_Rider__typ, (void*)buffer, ((LONGINT)(4096)), ((LONGINT)(4096))); + Files_Set(&R1, Files_Rider__typ, F, 0); + Files_ReadBytes(&R1, Files_Rider__typ, (void*)buffer, 4096, 4096); while (4096 - R1.res > 0) { - Files_WriteBytes(&*R, R__typ, (void*)buffer, ((LONGINT)(4096)), 4096 - R1.res); - Files_ReadBytes(&R1, Files_Rider__typ, (void*)buffer, ((LONGINT)(4096)), ((LONGINT)(4096))); + Files_WriteBytes(&*R, R__typ, (void*)buffer, 4096, 4096 - R1.res); + Files_ReadBytes(&R1, Files_Rider__typ, (void*)buffer, 4096, 4096); } } } @@ -933,24 +933,24 @@ static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F) void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len) { CHAR FName[32]; - __COPY(moduleName, OPM_modName, ((LONGINT)(32))); - OPM_HFile = Files_New((CHAR*)"", (LONGINT)1); + __COPY(moduleName, OPM_modName, 32); + OPM_HFile = Files_New((CHAR*)"", 1); if (OPM_HFile != NIL) { - Files_Set(&OPM_R[0], Files_Rider__typ, OPM_HFile, ((LONGINT)(0))); + Files_Set(&OPM_R[0], Files_Rider__typ, OPM_HFile, 0); } else { OPM_err(153); } - OPM_MakeFileName((void*)moduleName, moduleName__len, (void*)FName, ((LONGINT)(32)), (CHAR*)".c", (LONGINT)3); - OPM_BFile = Files_New(FName, ((LONGINT)(32))); + OPM_MakeFileName((void*)moduleName, moduleName__len, (void*)FName, 32, (CHAR*)".c", 3); + OPM_BFile = Files_New(FName, 32); if (OPM_BFile != NIL) { - Files_Set(&OPM_R[1], Files_Rider__typ, OPM_BFile, ((LONGINT)(0))); + Files_Set(&OPM_R[1], Files_Rider__typ, OPM_BFile, 0); } else { OPM_err(153); } - OPM_MakeFileName((void*)moduleName, moduleName__len, (void*)FName, ((LONGINT)(32)), (CHAR*)".h", (LONGINT)3); - OPM_HIFile = Files_New(FName, ((LONGINT)(32))); + OPM_MakeFileName((void*)moduleName, moduleName__len, (void*)FName, 32, (CHAR*)".h", 3); + OPM_HIFile = Files_New(FName, 32); if (OPM_HIFile != NIL) { - Files_Set(&OPM_R[2], Files_Rider__typ, OPM_HIFile, ((LONGINT)(0))); + Files_Set(&OPM_R[2], Files_Rider__typ, OPM_HIFile, 0); } else { OPM_err(153); } @@ -961,9 +961,9 @@ void OPM_CloseFiles (void) CHAR FName[32]; INTEGER res; if (OPM_noerr) { - OPM_LogWStr((CHAR*)" ", (LONGINT)3); - OPM_LogWNum(Files_Pos(&OPM_R[1], Files_Rider__typ), ((LONGINT)(0))); - OPM_LogWStr((CHAR*)" chars.", (LONGINT)8); + OPM_LogWStr((CHAR*)" ", 3); + OPM_LogWNum(Files_Pos(&OPM_R[1], Files_Rider__typ), 0); + OPM_LogWStr((CHAR*)" chars.", 8); } if (OPM_noerr) { if (__STRCMP(OPM_modName, "SYSTEM") == 0) { @@ -975,10 +975,10 @@ void OPM_CloseFiles (void) Files_Register(OPM_HIFile); Files_Register(OPM_BFile); } else { - OPM_MakeFileName((void*)OPM_modName, ((LONGINT)(32)), (void*)FName, ((LONGINT)(32)), (CHAR*)".h", (LONGINT)3); - Files_Delete(FName, ((LONGINT)(32)), &res); - OPM_MakeFileName((void*)OPM_modName, ((LONGINT)(32)), (void*)FName, ((LONGINT)(32)), (CHAR*)".sym", (LONGINT)5); - Files_Delete(FName, ((LONGINT)(32)), &res); + OPM_MakeFileName((void*)OPM_modName, 32, (void*)FName, 32, (CHAR*)".h", 3); + Files_Delete(FName, 32, &res); + OPM_MakeFileName((void*)OPM_modName, 32, (void*)FName, 32, (CHAR*)".sym", 5); + Files_Delete(FName, 32, &res); Files_Register(OPM_BFile); } } @@ -987,11 +987,11 @@ void OPM_CloseFiles (void) OPM_HIFile = NIL; OPM_newSFile = NIL; OPM_oldSFile = NIL; - Files_Set(&OPM_R[0], Files_Rider__typ, NIL, ((LONGINT)(0))); - Files_Set(&OPM_R[1], Files_Rider__typ, NIL, ((LONGINT)(0))); - Files_Set(&OPM_R[2], Files_Rider__typ, NIL, ((LONGINT)(0))); - Files_Set(&OPM_newSF, Files_Rider__typ, NIL, ((LONGINT)(0))); - Files_Set(&OPM_oldSF, Files_Rider__typ, NIL, ((LONGINT)(0))); + Files_Set(&OPM_R[0], Files_Rider__typ, NIL, 0); + Files_Set(&OPM_R[1], Files_Rider__typ, NIL, 0); + Files_Set(&OPM_R[2], Files_Rider__typ, NIL, 0); + Files_Set(&OPM_newSF, Files_Rider__typ, NIL, 0); + Files_Set(&OPM_oldSF, Files_Rider__typ, NIL, 0); } static void EnumPtrs(void (*P)(void*)) @@ -1032,15 +1032,15 @@ export void *OPM__init(void) /* BEGIN */ Texts_OpenWriter(&OPM_W, Texts_Writer__typ); OPM_MODULES[0] = 0x00; - Platform_GetEnv((CHAR*)"MODULES", (LONGINT)8, (void*)OPM_MODULES, ((LONGINT)(1024))); + Platform_GetEnv((CHAR*)"MODULES", 8, (void*)OPM_MODULES, 1024); __MOVE(".", OPM_OBERON, 2); - Platform_GetEnv((CHAR*)"OBERON", (LONGINT)7, (void*)OPM_OBERON, ((LONGINT)(1024))); - Strings_Append((CHAR*)";.;", (LONGINT)4, (void*)OPM_OBERON, ((LONGINT)(1024))); - Strings_Append(OPM_MODULES, ((LONGINT)(1024)), (void*)OPM_OBERON, ((LONGINT)(1024))); - Strings_Append((CHAR*)";", (LONGINT)2, (void*)OPM_OBERON, ((LONGINT)(1024))); - Strings_Append((CHAR*)"/opt/voc", (LONGINT)9, (void*)OPM_OBERON, ((LONGINT)(1024))); - Strings_Append((CHAR*)"/sym;", (LONGINT)6, (void*)OPM_OBERON, ((LONGINT)(1024))); - Files_SetSearchPath(OPM_OBERON, ((LONGINT)(1024))); + Platform_GetEnv((CHAR*)"OBERON", 7, (void*)OPM_OBERON, 1024); + Strings_Append((CHAR*)";.;", 4, (void*)OPM_OBERON, 1024); + Strings_Append(OPM_MODULES, 1024, (void*)OPM_OBERON, 1024); + Strings_Append((CHAR*)";", 2, (void*)OPM_OBERON, 1024); + Strings_Append((CHAR*)"/opt/voc", 9, (void*)OPM_OBERON, 1024); + Strings_Append((CHAR*)"/sym;", 6, (void*)OPM_OBERON, 1024); + Files_SetSearchPath(OPM_OBERON, 1024); OPM_CharSize = 1; OPM_BoolSize = 1; OPM_SIntSize = 1; diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index a61c632e..f93bcd98 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index 5620c5ec..f44a2167 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPB.h" #include "OPM.h" @@ -58,7 +58,7 @@ static void OPP_err (INTEGER n) static void OPP_CheckSym (INTEGER s) { - if ((int)OPP_sym == s) { + if (OPP_sym == s) { OPS_Get(&OPP_sym); } else { OPM_err(s); @@ -104,7 +104,7 @@ static void OPP_ConstExpression (OPT_Node *x) OPP_Expression(&*x); if ((*x)->class != 7) { OPP_err(50); - *x = OPB_NewIntConst(((LONGINT)(1))); + *x = OPB_NewIntConst(1); } } @@ -146,7 +146,7 @@ static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_) OPP_err(51); sf = 0; } - *sysflag = (int)sf; + *sysflag = sf; OPP_CheckSym(23); } else { *sysflag = default_; @@ -308,13 +308,13 @@ static void OPP_PointerType (OPT_Struct *typ) OPT_Find(&id); if (id == NIL) { if (OPP_nofFwdPtr < 64) { - OPP_FwdPtr[__X(OPP_nofFwdPtr, ((LONGINT)(64)))] = *typ; + OPP_FwdPtr[__X(OPP_nofFwdPtr, 64)] = *typ; OPP_nofFwdPtr += 1; } else { OPP_err(224); } (*typ)->link = OPT_NewObj(); - __COPY(OPS_name, (*typ)->link->name, ((LONGINT)(256))); + __COPY(OPS_name, (*typ)->link->name, 256); (*typ)->BaseTyp = OPT_undftyp; OPS_Get(&OPP_sym); } else { @@ -518,7 +518,7 @@ static void OPP_selector (OPT_Node *x) } else if (OPP_sym == 18) { OPS_Get(&OPP_sym); if (OPP_sym == 38) { - __COPY(OPS_name, name, ((LONGINT)(256))); + __COPY(OPS_name, name, 256); OPS_Get(&OPP_sym); if ((*x)->typ != NIL) { if ((*x)->typ->form == 13) { @@ -625,7 +625,7 @@ static void OPP_StandProcCall (OPT_Node *x) OPT_Node y = NIL; SHORTINT m; INTEGER n; - m = (int)(*x)->obj->adr; + m = (*x)->obj->adr; n = 0; if (OPP_sym == 30) { OPS_Get(&OPP_sym); @@ -742,8 +742,8 @@ static void OPP_Factor (OPT_Node *x) *x = OPB_NewRealConst(OPS_lrlval, OPT_lrltyp); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPP.Factor, OPS.numtyp = ", (LONGINT)44); - OPM_LogWNum(OPS_numtyp, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPP.Factor, OPS.numtyp = ", 44); + OPM_LogWNum(OPS_numtyp, 0); OPM_LogWLn(); break; } @@ -776,7 +776,7 @@ static void OPP_Factor (OPT_Node *x) *x = NIL; } if (*x == NIL) { - *x = OPB_NewIntConst(((LONGINT)(1))); + *x = OPB_NewIntConst(1); (*x)->typ = OPT_undftyp; } } @@ -858,7 +858,7 @@ static void OPP_Receiver (SHORTINT *mode, OPS_Name name, OPT_Struct *typ, OPT_St } else { *mode = 1; } - __COPY(OPS_name, name, ((LONGINT)(256))); + __COPY(OPS_name, name, 256); OPP_CheckSym(38); OPP_CheckSym(20); if (OPP_sym == 38) { @@ -932,8 +932,8 @@ static void GetCode__19 (void) (*ProcedureDeclaration__16_s->proc)->conval->ext = ext; n = 0; if (OPP_sym == 37) { - while (OPS_str[__X(n, ((LONGINT)(256)))] != 0x00) { - (*ext)[__X(n + 1, ((LONGINT)(256)))] = OPS_str[__X(n, ((LONGINT)(256)))]; + while (OPS_str[__X(n, 256)] != 0x00) { + (*ext)[__X(n + 1, 256)] = OPS_str[__X(n, 256)]; n += 1; } (*ext)[0] = (CHAR)n; @@ -949,7 +949,7 @@ static void GetCode__19 (void) n = 1; } OPS_Get(&OPP_sym); - (*ext)[__X(n, ((LONGINT)(256)))] = (CHAR)c; + (*ext)[__X(n, 256)] = (CHAR)c; } if (OPP_sym == 19) { OPS_Get(&OPP_sym); @@ -1023,7 +1023,7 @@ static void TProcDecl__23 (void) } OPP_Receiver(&objMode, objName, &objTyp, &recTyp); if (OPP_sym == 38) { - __COPY(OPS_name, *ProcedureDeclaration__16_s->name, ((LONGINT)(256))); + __COPY(OPS_name, *ProcedureDeclaration__16_s->name, 256); OPP_CheckMark(&*ProcedureDeclaration__16_s->vis); OPT_FindField(*ProcedureDeclaration__16_s->name, recTyp, &*ProcedureDeclaration__16_s->fwd); OPT_FindField(*ProcedureDeclaration__16_s->name, recTyp->BaseTyp, &baseProc); @@ -1122,7 +1122,7 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) TProcDecl__23(); } else if (OPP_sym == 38) { OPT_Find(&fwd); - __COPY(OPS_name, name, ((LONGINT)(256))); + __COPY(OPS_name, name, 256); OPP_CheckMark(&vis); if ((vis != 0 && mode == 6)) { mode = 7; @@ -1183,14 +1183,14 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, O if (!__IN(LabelTyp->form, 0x70) || LabelTyp->size < x->typ->size) { OPP_err(60); } - } else if ((int)LabelTyp->form != f) { + } else if (LabelTyp->form != f) { OPP_err(60); } if (OPP_sym == 21) { OPS_Get(&OPP_sym); OPP_ConstExpression(&y); yval = y->conval->intval; - if (((int)y->typ->form != f && !((__IN(f, 0x70) && __IN(y->typ->form, 0x70))))) { + if ((y->typ->form != f && !((__IN(f, 0x70) && __IN(y->typ->form, 0x70))))) { OPP_err(60); } if (yval < xval) { @@ -1207,17 +1207,17 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, O if (i == 0) { break; } - if (tab[__X(i - 1, ((LONGINT)(128)))].low <= yval) { - if (tab[__X(i - 1, ((LONGINT)(128)))].high >= xval) { + if (tab[__X(i - 1, 128)].low <= yval) { + if (tab[__X(i - 1, 128)].high >= xval) { OPP_err(62); } break; } - tab[__X(i, ((LONGINT)(128)))] = tab[__X(i - 1, ((LONGINT)(128)))]; + tab[__X(i, 128)] = tab[__X(i - 1, 128)]; i -= 1; } - tab[__X(i, ((LONGINT)(128)))].low = xval; - tab[__X(i, ((LONGINT)(128)))].high = yval; + tab[__X(i, 128)].low = xval; + tab[__X(i, 128)].high = yval; *n += 1; } else { OPP_err(213); @@ -1276,7 +1276,7 @@ static void CasePart__31 (OPT_Node *x) } if (n > 0) { low = tab[0].low; - high = tab[__X(n - 1, ((LONGINT)(128)))].high; + high = tab[__X(n - 1, 128)].high; if (high - low > 512) { OPP_err(209); } @@ -1479,7 +1479,7 @@ static void OPP_StatSeq (OPT_Node *stat) OPS_Get(&OPP_sym); OPP_ConstExpression(&z); } else { - z = OPB_NewIntConst(((LONGINT)(1))); + z = OPB_NewIntConst(1); } pos = OPM_errpos; x = OPB_NewLeaf(id); @@ -1642,7 +1642,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) OPP_ConstExpression(&x); } else { OPP_err(9); - x = OPB_NewIntConst(((LONGINT)(1))); + x = OPB_NewIntConst(1); } obj->mode = 3; obj->typ = x->typ; @@ -1673,7 +1673,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) if (__IN(obj->typ->comp, 0x1c)) { i = 0; while (i < OPP_nofFwdPtr) { - typ = OPP_FwdPtr[__X(i, ((LONGINT)(64)))]; + typ = OPP_FwdPtr[__X(i, 64)]; i += 1; if (__STRCMP(typ->link->name, obj->name) == 0) { typ->BaseTyp = obj->typ; @@ -1735,10 +1735,10 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) } i = 0; while (i < OPP_nofFwdPtr) { - if (OPP_FwdPtr[__X(i, ((LONGINT)(64)))]->link->name[0] != 0x00) { + if (OPP_FwdPtr[__X(i, 64)]->link->name[0] != 0x00) { OPP_err(128); } - OPP_FwdPtr[__X(i, ((LONGINT)(64)))] = NIL; + OPP_FwdPtr[__X(i, 64)] = NIL; i += 1; } OPT_topScope->adr = OPM_errpos; @@ -1784,28 +1784,28 @@ void OPP_Module (OPT_Node *prog, SET opt) OPS_Get(&OPP_sym); } else { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Unexpected symbol found when MODULE expected:", (LONGINT)46); + OPM_LogWStr((CHAR*)"Unexpected symbol found when MODULE expected:", 46); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" sym: ", (LONGINT)15); - OPM_LogWNum(OPP_sym, ((LONGINT)(1))); + OPM_LogWStr((CHAR*)" sym: ", 15); + OPM_LogWNum(OPP_sym, 1); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" OPS.name: ", (LONGINT)15); - OPM_LogWStr(OPS_name, ((LONGINT)(256))); + OPM_LogWStr((CHAR*)" OPS.name: ", 15); + OPM_LogWStr(OPS_name, 256); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" OPS.str: ", (LONGINT)15); - OPM_LogWStr(OPS_str, ((LONGINT)(256))); + OPM_LogWStr((CHAR*)" OPS.str: ", 15); + OPM_LogWStr(OPS_str, 256); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" OPS.numtyp: ", (LONGINT)15); - OPM_LogWNum(OPS_numtyp, ((LONGINT)(1))); + OPM_LogWStr((CHAR*)" OPS.numtyp: ", 15); + OPM_LogWNum(OPS_numtyp, 1); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" OPS.intval: ", (LONGINT)15); - OPM_LogWNum(OPS_intval, ((LONGINT)(1))); + OPM_LogWStr((CHAR*)" OPS.intval: ", 15); + OPM_LogWNum(OPS_intval, 1); OPM_LogWLn(); OPP_err(16); } if (OPP_sym == 38) { - OPM_LogWStr((CHAR*)"compiling ", (LONGINT)11); - OPM_LogWStr(OPS_name, ((LONGINT)(256))); + OPM_LogWStr((CHAR*)"compiling ", 11); + OPM_LogWStr(OPS_name, 256); OPM_LogW('.'); OPT_Init(OPS_name, opt); OPS_Get(&OPP_sym); @@ -1814,13 +1814,13 @@ void OPP_Module (OPT_Node *prog, SET opt) OPS_Get(&OPP_sym); for (;;) { if (OPP_sym == 38) { - __COPY(OPS_name, aliasName, ((LONGINT)(256))); - __COPY(aliasName, impName, ((LONGINT)(256))); + __COPY(OPS_name, aliasName, 256); + __COPY(aliasName, impName, 256); OPS_Get(&OPP_sym); if (OPP_sym == 34) { OPS_Get(&OPP_sym); if (OPP_sym == 38) { - __COPY(OPS_name, impName, ((LONGINT)(256))); + __COPY(OPS_name, impName, 256); OPS_Get(&OPP_sym); } else { OPP_err(38); diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index be6b6252..0ddbe4c3 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index 1f721944..2a093f8e 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "OPM.h" @@ -59,7 +59,7 @@ static void OPS_Str (SHORTINT *sym) if (OPS_intval == 2) { *sym = 35; OPS_numtyp = 1; - OPS_intval = (int)OPS_str[0]; + OPS_intval = OPS_str[0]; } else { *sym = 37; } @@ -112,10 +112,10 @@ static INTEGER Ord__7 (CHAR ch, BOOLEAN hex) { INTEGER _o_result; if (ch <= '9') { - _o_result = (int)ch - 48; + _o_result = ch - 48; return _o_result; } else if (hex) { - _o_result = ((int)ch - 65) + 10; + _o_result = (ch - 65) + 10; return _o_result; } else { OPS_err(2); @@ -173,7 +173,7 @@ static void OPS_Number (void) OPS_numtyp = 1; if (n <= 2) { while (i < n) { - OPS_intval = __ASHL(OPS_intval, 4) + (int)Ord__7(dig[i], 1); + OPS_intval = __ASHL(OPS_intval, 4) + Ord__7(dig[i], 1); i += 1; } } else { @@ -188,7 +188,7 @@ static void OPS_Number (void) OPS_intval = -1; } while (i < n) { - OPS_intval = __ASHL(OPS_intval, 4) + (int)Ord__7(dig[i], 1); + OPS_intval = __ASHL(OPS_intval, 4) + Ord__7(dig[i], 1); i += 1; } } else { @@ -199,8 +199,8 @@ static void OPS_Number (void) while (i < n) { d = Ord__7(dig[i], 0); i += 1; - if (OPS_intval <= __DIV(2147483647 - (int)d, 10)) { - OPS_intval = OPS_intval * 10 + (int)d; + if (OPS_intval <= __DIV(2147483647 - d, 10)) { + OPS_intval = OPS_intval * 10 + d; } else { OPS_err(203); } diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index ecd93034..46e05201 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 8efa4803..c81989cb 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" @@ -162,10 +162,10 @@ OPT_Struct OPT_IntType (LONGINT size) OPT_Struct _o_result; INTEGER i; i = 1; - while ((OPT_IntTypes[__X(i, ((LONGINT)(20)))]->size < size && OPT_IntTypes[__X(i + 1, ((LONGINT)(20)))] != NIL)) { + while ((OPT_IntTypes[__X(i, 20)]->size < size && OPT_IntTypes[__X(i + 1, 20)] != NIL)) { i += 1; } - _o_result = OPT_IntTypes[__X(i, ((LONGINT)(20)))]; + _o_result = OPT_IntTypes[__X(i, 20)]; return _o_result; } @@ -177,11 +177,11 @@ OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir) __ASSERT(dir == 1 || dir == -1, 0); __ASSERT(x->BaseTyp == OPT_undftyp, 0); i = 0; - while ((OPT_IntTypes[__X(i, ((LONGINT)(20)))] != x && i < 20)) { + while ((OPT_IntTypes[__X(i, 20)] != x && i < 20)) { i += 1; } __ASSERT(i < 19, 0); - _o_result = OPT_IntTypes[__X(i + dir, ((LONGINT)(20)))]; + _o_result = OPT_IntTypes[__X(i + dir, 20)]; return _o_result; } @@ -234,7 +234,7 @@ OPT_ConstExt OPT_NewExt (void) { OPT_ConstExt _o_result; OPT_ConstExt ext = NIL; - ext = __NEWARR(NIL, ((LONGINT)(1)), 1, 1, 0, (LONGINT)256); + ext = __NEWARR(NIL, 1, 1, 1, 0, 256); _o_result = ext; return _o_result; } @@ -265,8 +265,8 @@ void OPT_Init (OPS_Name name, SET opt) OPT_topScope = OPT_universe; OPT_OpenScope(0, NIL); OPT_SYSimported = 0; - __COPY(name, OPT_SelfName, ((LONGINT)(256))); - __COPY(name, OPT_topScope->name, ((LONGINT)(256))); + __COPY(name, OPT_SelfName, 256); + __COPY(name, OPT_topScope->name, 256); OPT_GlbMod[0] = OPT_topScope; OPT_nofGmod = 1; OPT_newsf = __IN(4, opt); @@ -281,13 +281,13 @@ void OPT_Close (void) OPT_CloseScope(); i = 0; while (i < 64) { - OPT_GlbMod[__X(i, ((LONGINT)(64)))] = NIL; + OPT_GlbMod[__X(i, 64)] = NIL; i += 1; } i = 16; while (i < 255) { - OPT_impCtxt.ref[__X(i, ((LONGINT)(255)))] = NIL; - OPT_impCtxt.old[__X(i, ((LONGINT)(255)))] = NIL; + OPT_impCtxt.ref[__X(i, 255)] = NIL; + OPT_impCtxt.old[__X(i, 255)] = NIL; i += 1; } } @@ -398,7 +398,7 @@ void OPT_Insert (OPS_Name name, OPT_Object *obj) } ob1->left = NIL; ob1->right = NIL; - __COPY(name, ob1->name, ((LONGINT)(256))); + __COPY(name, ob1->name, 256); mnolev = OPT_topScope->mnolev; ob1->mnolev = mnolev; break; @@ -414,7 +414,7 @@ static void OPT_FPrintName (LONGINT *fp, CHAR *name, LONGINT name__len) i = 0; do { ch = name[__X(i, name__len)]; - OPM_FPrint(&*fp, (int)ch); + OPM_FPrint(&*fp, ch); i += 1; } while (!(ch == 0x00)); } @@ -423,32 +423,32 @@ static void OPT_DebugStruct (OPT_Struct btyp) { OPM_LogWLn(); if (btyp == NIL) { - OPM_LogWStr((CHAR*)"btyp is nil", (LONGINT)12); + OPM_LogWStr((CHAR*)"btyp is nil", 12); OPM_LogWLn(); } - OPM_LogWStr((CHAR*)"btyp^.strobji^.name = ", (LONGINT)23); - OPM_LogWStr(btyp->strobj->name, ((LONGINT)(256))); + OPM_LogWStr((CHAR*)"btyp^.strobji^.name = ", 23); + OPM_LogWStr(btyp->strobj->name, 256); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.form = ", (LONGINT)14); - OPM_LogWNum(btyp->form, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.form = ", 14); + OPM_LogWNum(btyp->form, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.comp = ", (LONGINT)14); - OPM_LogWNum(btyp->comp, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.comp = ", 14); + OPM_LogWNum(btyp->comp, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.mno = ", (LONGINT)13); - OPM_LogWNum(btyp->mno, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.mno = ", 13); + OPM_LogWNum(btyp->mno, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.extlev = ", (LONGINT)16); - OPM_LogWNum(btyp->extlev, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.extlev = ", 16); + OPM_LogWNum(btyp->extlev, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.size = ", (LONGINT)14); - OPM_LogWNum(btyp->size, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.size = ", 14); + OPM_LogWNum(btyp->size, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.align = ", (LONGINT)15); - OPM_LogWNum(btyp->align, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.align = ", 15); + OPM_LogWNum(btyp->align, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.txtpos = ", (LONGINT)16); - OPM_LogWNum(btyp->txtpos, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.txtpos = ", 16); + OPM_LogWNum(btyp->txtpos, 0); OPM_LogWLn(); } @@ -480,8 +480,8 @@ void OPT_IdFPrint (OPT_Struct typ) btyp = typ->BaseTyp; strobj = typ->strobj; if ((strobj != NIL && strobj->name[0] != 0x00)) { - OPT_FPrintName(&idfp, (void*)OPT_GlbMod[__X(typ->mno, ((LONGINT)(64)))]->name, ((LONGINT)(256))); - OPT_FPrintName(&idfp, (void*)strobj->name, ((LONGINT)(256))); + OPT_FPrintName(&idfp, (void*)OPT_GlbMod[__X(typ->mno, 64)]->name, 256); + OPT_FPrintName(&idfp, (void*)strobj->name, 256); } if ((f == 13 || (c == 4 && btyp != NIL)) || c == 3) { OPT_IdFPrint(btyp); @@ -532,7 +532,7 @@ static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr) } } } else if (typ->form == 13 || __STRCMP(fld->name, "@ptr") == 0) { - OPM_FPrint(&*FPrintStr__12_s->pvfp, ((LONGINT)(13))); + OPM_FPrint(&*FPrintStr__12_s->pvfp, 13); OPM_FPrint(&*FPrintStr__12_s->pvfp, adr); OPT_nofhdfld += 1; } @@ -543,7 +543,7 @@ static void FPrintFlds__13 (OPT_Object fld, LONGINT adr, BOOLEAN visible) while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->vis); - OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)fld->name, ((LONGINT)(256))); + OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)fld->name, 256); OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->adr); OPT_FPrintStr(fld->typ); OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->typ->pbfp); @@ -561,10 +561,10 @@ static void FPrintTProcs__17 (OPT_Object obj) FPrintTProcs__17(obj->left); if (obj->mode == 13) { if (obj->vis != 0) { - OPM_FPrint(&*FPrintStr__12_s->pbfp, ((LONGINT)(13))); + OPM_FPrint(&*FPrintStr__12_s->pbfp, 13); OPM_FPrint(&*FPrintStr__12_s->pbfp, __ASHR(obj->adr, 16)); OPT_FPrintSign(&*FPrintStr__12_s->pbfp, obj->typ, obj->link); - OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)obj->name, ((LONGINT)(256))); + OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)obj->name, 256); } } FPrintTProcs__17(obj->right); @@ -618,7 +618,7 @@ void OPT_FPrintStr (OPT_Struct typ) OPM_FPrint(&pvfp, typ->align); OPM_FPrint(&pvfp, typ->n); OPT_nofhdfld = 0; - FPrintFlds__13(typ->link, ((LONGINT)(0)), 1); + FPrintFlds__13(typ->link, 0, 1); if (OPT_nofhdfld > 2048) { OPM_Mark(225, typ->txtpos); } @@ -663,7 +663,7 @@ void OPT_FPrintObj (OPT_Object obj) OPM_FPrintLReal(&fprint, obj->conval->realval); break; case 10: - OPT_FPrintName(&fprint, (void*)*obj->conval->ext, ((LONGINT)(256))); + OPT_FPrintName(&fprint, (void*)*obj->conval->ext, 256); break; case 11: break; @@ -680,11 +680,11 @@ void OPT_FPrintObj (OPT_Object obj) } else if (obj->mode == 9) { OPT_FPrintSign(&fprint, obj->typ, obj->link); ext = obj->conval->ext; - m = (int)(*ext)[0]; + m = (*ext)[0]; f = 1; OPM_FPrint(&fprint, m); while (f <= m) { - OPM_FPrint(&fprint, (int)(*ext)[__X(f, ((LONGINT)(256)))]); + OPM_FPrint(&fprint, (*ext)[__X(f, 256)]); f += 1; } } else if (obj->mode == 5) { @@ -700,22 +700,22 @@ void OPT_FPrintErr (OPT_Object obj, INTEGER errcode) INTEGER i, j; CHAR ch; if (obj->mnolev != 0) { - __COPY(OPT_GlbMod[__X(-obj->mnolev, ((LONGINT)(64)))]->name, OPM_objname, ((LONGINT)(64))); + __COPY(OPT_GlbMod[__X(-obj->mnolev, 64)]->name, OPM_objname, 64); i = 0; - while (OPM_objname[__X(i, ((LONGINT)(64)))] != 0x00) { + while (OPM_objname[__X(i, 64)] != 0x00) { i += 1; } - OPM_objname[__X(i, ((LONGINT)(64)))] = '.'; + OPM_objname[__X(i, 64)] = '.'; j = 0; i += 1; do { - ch = obj->name[__X(j, ((LONGINT)(256)))]; - OPM_objname[__X(i, ((LONGINT)(64)))] = ch; + ch = obj->name[__X(j, 256)]; + OPM_objname[__X(i, 64)] = ch; j += 1; i += 1; } while (!(ch == 0x00)); } else { - __COPY(obj->name, OPM_objname, ((LONGINT)(64))); + __COPY(obj->name, OPM_objname, 64); } if (errcode == 249) { if (OPM_noerr) { @@ -808,12 +808,12 @@ static void OPT_InMod (SHORTINT *mno) *mno = OPT_impCtxt.glbmno[0]; } else { if (mn == 16) { - OPT_InName((void*)name, ((LONGINT)(256))); + OPT_InName((void*)name, 256); if ((__STRCMP(name, OPT_SelfName) == 0 && !OPT_impCtxt.self)) { OPT_err(154); } i = 0; - while ((i < OPT_nofGmod && __STRCMP(name, OPT_GlbMod[__X(i, ((LONGINT)(64)))]->name) != 0)) { + while ((i < OPT_nofGmod && __STRCMP(name, OPT_GlbMod[__X(i, 64)]->name) != 0)) { i += 1; } if (i < OPT_nofGmod) { @@ -821,20 +821,20 @@ static void OPT_InMod (SHORTINT *mno) } else { head = OPT_NewObj(); head->mode = 12; - __COPY(name, head->name, ((LONGINT)(256))); + __COPY(name, head->name, 256); *mno = OPT_nofGmod; head->mnolev = -*mno; if (OPT_nofGmod < 64) { - OPT_GlbMod[__X(*mno, ((LONGINT)(64)))] = head; + OPT_GlbMod[__X(*mno, 64)] = head; OPT_nofGmod += 1; } else { OPT_err(227); } } - OPT_impCtxt.glbmno[__X(OPT_impCtxt.nofm, ((LONGINT)(64)))] = *mno; + OPT_impCtxt.glbmno[__X(OPT_impCtxt.nofm, 64)] = *mno; OPT_impCtxt.nofm += 1; } else { - *mno = OPT_impCtxt.glbmno[__X(-mn, ((LONGINT)(64)))]; + *mno = OPT_impCtxt.glbmno[__X(-mn, 64)]; } } } @@ -848,7 +848,7 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval) switch (f) { case 1: case 3: case 2: OPM_SymRCh(&ch); - conval->intval = (int)ch; + conval->intval = ch; break; case 4: case 5: case 6: conval->intval = OPM_SymRInt(); @@ -871,7 +871,7 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval) i = 0; do { OPM_SymRCh(&ch); - (*ext)[__X(i, ((LONGINT)(256)))] = ch; + (*ext)[__X(i, 256)] = ch; i += 1; } while (!(ch == 0x00)); conval->intval2 = i; @@ -881,8 +881,8 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval) conval->intval = 0; break; default: - OPM_LogWStr((CHAR*)"unhandled case in InConstant(), f = ", (LONGINT)37); - OPM_LogWNum(f, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in InConstant(), f = ", 37); + OPM_LogWNum(f, 0); OPM_LogWLn(); break; } @@ -910,7 +910,7 @@ static void OPT_InSign (SHORTINT mno, OPT_Struct *res, OPT_Object *par) } OPT_InStruct(&new->typ); new->adr = OPM_SymRInt(); - OPT_InName((void*)new->name, ((LONGINT)(256))); + OPT_InName((void*)new->name, 256); last = new; tag = OPM_SymRInt(); } @@ -931,7 +931,7 @@ static OPT_Object OPT_InFld (void) obj->vis = 1; } OPT_InStruct(&obj->typ); - OPT_InName((void*)obj->name, ((LONGINT)(256))); + OPT_InName((void*)obj->name, 256); obj->adr = OPM_SymRInt(); } else { obj->mode = 4; @@ -962,7 +962,7 @@ static OPT_Object OPT_InTProc (SHORTINT mno) obj->conval->intval = -1; OPT_InSign(mno, &obj->typ, &obj->link); obj->vis = 1; - OPT_InName((void*)obj->name, ((LONGINT)(256))); + OPT_InName((void*)obj->name, 256); obj->adr = __ASHL(OPM_SymRInt(), 16); } else { obj->mode = 13; @@ -983,7 +983,7 @@ static OPT_Struct OPT_InTyp (LONGINT tag) _o_result = OPT_IntType(OPM_SymRInt()); return _o_result; } else { - _o_result = OPT_impCtxt.ref[__X(tag, ((LONGINT)(255)))]; + _o_result = OPT_impCtxt.ref[__X(tag, 255)]; return _o_result; } __RETCHK; @@ -1007,23 +1007,23 @@ static void OPT_InStruct (OPT_Struct *typ) OPT_impCtxt.minr = ref; } OPT_InMod(&mno); - OPT_InName((void*)name, ((LONGINT)(256))); + OPT_InName((void*)name, 256); obj = OPT_NewObj(); if (name[0] == 0x00) { if (OPT_impCtxt.self) { old = NIL; } else { __MOVE("@", obj->name, 2); - OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->right, &old); + OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, 64)]->right, &old); obj->name[0] = 0x00; } *typ = OPT_NewStr(0, 1); } else { - __COPY(name, obj->name, ((LONGINT)(256))); - OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->right, &old); + __COPY(name, obj->name, 256); + OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, 64)]->right, &old); if (old != NIL) { OPT_FPrintObj(old); - OPT_impCtxt.pvfp[__X(ref, ((LONGINT)(255)))] = old->typ->pvfp; + OPT_impCtxt.pvfp[__X(ref, 255)] = old->typ->pvfp; if (OPT_impCtxt.self) { *typ = OPT_NewStr(0, 1); } else { @@ -1037,8 +1037,8 @@ static void OPT_InStruct (OPT_Struct *typ) *typ = OPT_NewStr(0, 1); } } - OPT_impCtxt.ref[__X(ref, ((LONGINT)(255)))] = *typ; - OPT_impCtxt.old[__X(ref, ((LONGINT)(255)))] = old; + OPT_impCtxt.ref[__X(ref, 255)] = *typ; + OPT_impCtxt.old[__X(ref, 255)] = old; (*typ)->ref = ref + 255; (*typ)->mno = mno; (*typ)->allocated = 1; @@ -1049,7 +1049,7 @@ static void OPT_InStruct (OPT_Struct *typ) obj->vis = 0; tag = OPM_SymRInt(); if (tag == 35) { - (*typ)->sysflag = (int)OPM_SymRInt(); + (*typ)->sysflag = OPM_SymRInt(); tag = OPM_SymRInt(); } switch (tag) { @@ -1117,8 +1117,8 @@ static void OPT_InStruct (OPT_Struct *typ) OPT_InSign(mno, &(*typ)->BaseTyp, &(*typ)->link); break; default: - OPM_LogWStr((CHAR*)"unhandled case at InStruct, tag = ", (LONGINT)35); - OPM_LogWNum(tag, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case at InStruct, tag = ", 35); + OPM_LogWNum(tag, 0); OPM_LogWLn(); break; } @@ -1130,7 +1130,7 @@ static void OPT_InStruct (OPT_Struct *typ) if (obj->name[0] != 0x00) { OPT_FPrintObj(obj); } - old = OPT_impCtxt.old[__X(ref, ((LONGINT)(255)))]; + old = OPT_impCtxt.old[__X(ref, 255)]; if (old != NIL) { t->strobj = old; if (OPT_impCtxt.self) { @@ -1138,13 +1138,13 @@ static void OPT_InStruct (OPT_Struct *typ) if (old->history != 5) { if (old->fprint != obj->fprint) { old->history = 2; - } else if (OPT_impCtxt.pvfp[__X(ref, ((LONGINT)(255)))] != t->pvfp) { + } else if (OPT_impCtxt.pvfp[__X(ref, 255)] != t->pvfp) { old->history = 3; } } } else if (old->fprint != obj->fprint) { old->history = 2; - } else if (OPT_impCtxt.pvfp[__X(ref, ((LONGINT)(255)))] != t->pvfp) { + } else if (OPT_impCtxt.pvfp[__X(ref, 255)] != t->pvfp) { old->history = 3; } else if (old->vis == 0) { old->history = 1; @@ -1152,7 +1152,7 @@ static void OPT_InStruct (OPT_Struct *typ) old->history = 0; } } else { - if (OPT_impCtxt.pvfp[__X(ref, ((LONGINT)(255)))] != t->pvfp) { + if (OPT_impCtxt.pvfp[__X(ref, 255)] != t->pvfp) { old->history = 5; } if (old->fprint != obj->fprint) { @@ -1211,17 +1211,17 @@ static OPT_Object OPT_InObj (SHORTINT mno) obj->mode = 9; ext = OPT_NewExt(); obj->conval->ext = ext; - s = (int)OPM_SymRInt(); + s = OPM_SymRInt(); (*ext)[0] = (CHAR)s; i = 1; while (i <= s) { - OPM_SymRCh(&(*ext)[__X(i, ((LONGINT)(256)))]); + OPM_SymRCh(&(*ext)[__X(i, 256)]); i += 1; } break; default: - OPM_LogWStr((CHAR*)"unhandled case at InObj, tag = ", (LONGINT)32); - OPM_LogWNum(tag, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case at InObj, tag = ", 32); + OPM_LogWNum(tag, 0); OPM_LogWLn(); break; } @@ -1235,14 +1235,14 @@ static OPT_Object OPT_InObj (SHORTINT mno) } OPT_InStruct(&obj->typ); } - OPT_InName((void*)obj->name, ((LONGINT)(256))); + OPT_InName((void*)obj->name, 256); } OPT_FPrintObj(obj); if ((obj->mode == 1 && (obj->typ->strobj == NIL || obj->typ->strobj->name[0] == 0x00))) { OPM_FPrint(&OPT_impCtxt.reffp, obj->typ->ref - 255); } if (tag != 19) { - OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->right, &old); + OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, 64)]->right, &old); if (OPT_impCtxt.self) { if (old != NIL) { if (old->vis == 0) { @@ -1293,7 +1293,7 @@ void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) OPT_impCtxt.nofm = 0; OPT_impCtxt.self = __STRCMP(aliasName, "@self") == 0; OPT_impCtxt.reffp = 0; - OPM_OldSym((void*)name, ((LONGINT)(256)), &*done); + OPM_OldSym((void*)name, 256, &*done); if (*done) { OPT_InMod(&mno); OPT_impCtxt.nextTag = OPM_SymRInt(); @@ -1303,8 +1303,8 @@ void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) } OPT_Insert(aliasName, &obj); obj->mode = 11; - obj->scope = OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->right; - OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->link = obj; + obj->scope = OPT_GlbMod[__X(mno, 64)]->right; + OPT_GlbMod[__X(mno, 64)]->link = obj; obj->mnolev = -mno; obj->typ = OPT_notyp; OPM_CloseOldSym(); @@ -1332,13 +1332,13 @@ static void OPT_OutName (CHAR *name, LONGINT name__len) static void OPT_OutMod (INTEGER mno) { - if (OPT_expCtxt.locmno[__X(mno, ((LONGINT)(64)))] < 0) { - OPM_SymWInt(((LONGINT)(16))); - OPT_expCtxt.locmno[__X(mno, ((LONGINT)(64)))] = OPT_expCtxt.nofm; + if (OPT_expCtxt.locmno[__X(mno, 64)] < 0) { + OPM_SymWInt(16); + OPT_expCtxt.locmno[__X(mno, 64)] = OPT_expCtxt.nofm; OPT_expCtxt.nofm += 1; - OPT_OutName((void*)OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->name, ((LONGINT)(256))); + OPT_OutName((void*)OPT_GlbMod[__X(mno, 64)]->name, 256); } else { - OPM_SymWInt(-OPT_expCtxt.locmno[__X(mno, ((LONGINT)(64)))]); + OPM_SymWInt(-OPT_expCtxt.locmno[__X(mno, 64)]); } } @@ -1368,7 +1368,7 @@ static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, LONGINT adr) } } } else if (typ->form == 13 || __STRCMP(fld->name, "@ptr") == 0) { - OPM_SymWInt(((LONGINT)(27))); + OPM_SymWInt(27); OPM_SymWInt(adr); OPT_nofhdfld += 1; } @@ -1379,12 +1379,12 @@ static void OPT_OutFlds (OPT_Object fld, LONGINT adr, BOOLEAN visible) while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { if (fld->vis == 2) { - OPM_SymWInt(((LONGINT)(26))); + OPM_SymWInt(26); } else { - OPM_SymWInt(((LONGINT)(25))); + OPM_SymWInt(25); } OPT_OutStr(fld->typ); - OPT_OutName((void*)fld->name, ((LONGINT)(256))); + OPT_OutName((void*)fld->name, 256); OPM_SymWInt(fld->adr); } else { OPT_OutHdFld(fld->typ, fld, fld->adr + adr); @@ -1398,16 +1398,16 @@ static void OPT_OutSign (OPT_Struct result, OPT_Object par) OPT_OutStr(result); while (par != NIL) { if (par->mode == 1) { - OPM_SymWInt(((LONGINT)(23))); + OPM_SymWInt(23); } else { - OPM_SymWInt(((LONGINT)(24))); + OPM_SymWInt(24); } OPT_OutStr(par->typ); OPM_SymWInt(par->adr); - OPT_OutName((void*)par->name, ((LONGINT)(256))); + OPT_OutName((void*)par->name, 256); par = par->link; } - OPM_SymWInt(((LONGINT)(18))); + OPM_SymWInt(18); } static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj) @@ -1420,12 +1420,12 @@ static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj) } if (obj->vis != 0) { if (obj->vis != 0) { - OPM_SymWInt(((LONGINT)(29))); + OPM_SymWInt(29); OPT_OutSign(obj->typ, obj->link); - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); OPM_SymWInt(__ASHR(obj->adr, 16)); } else { - OPM_SymWInt(((LONGINT)(30))); + OPM_SymWInt(30); OPM_SymWInt(__ASHR(obj->adr, 16)); } } @@ -1443,7 +1443,7 @@ static void OPT_OutStr (OPT_Struct typ) OPM_SymWInt(typ->size); } } else { - OPM_SymWInt(((LONGINT)(34))); + OPM_SymWInt(34); typ->ref = OPT_expCtxt.ref; OPT_expCtxt.ref += 1; if (OPT_expCtxt.ref >= 255) { @@ -1452,7 +1452,7 @@ static void OPT_OutStr (OPT_Struct typ) OPT_OutMod(typ->mno); strobj = typ->strobj; if ((strobj != NIL && strobj->name[0] != 0x00)) { - OPT_OutName((void*)strobj->name, ((LONGINT)(256))); + OPT_OutName((void*)strobj->name, 256); switch (strobj->history) { case 2: OPT_FPrintErr(strobj, 252); @@ -1470,31 +1470,31 @@ static void OPT_OutStr (OPT_Struct typ) OPM_SymWCh(0x00); } if (typ->sysflag != 0) { - OPM_SymWInt(((LONGINT)(35))); + OPM_SymWInt(35); OPM_SymWInt(typ->sysflag); } switch (typ->form) { case 13: - OPM_SymWInt(((LONGINT)(36))); + OPM_SymWInt(36); OPT_OutStr(typ->BaseTyp); break; case 14: - OPM_SymWInt(((LONGINT)(40))); + OPM_SymWInt(40); OPT_OutSign(typ->BaseTyp, typ->link); break; case 15: switch (typ->comp) { case 2: - OPM_SymWInt(((LONGINT)(37))); + OPM_SymWInt(37); OPT_OutStr(typ->BaseTyp); OPM_SymWInt(typ->n); break; case 3: - OPM_SymWInt(((LONGINT)(38))); + OPM_SymWInt(38); OPT_OutStr(typ->BaseTyp); break; case 4: - OPM_SymWInt(((LONGINT)(39))); + OPM_SymWInt(39); if (typ->BaseTyp == NIL) { OPT_OutStr(OPT_notyp); } else { @@ -1504,23 +1504,23 @@ static void OPT_OutStr (OPT_Struct typ) OPM_SymWInt(typ->align); OPM_SymWInt(typ->n); OPT_nofhdfld = 0; - OPT_OutFlds(typ->link, ((LONGINT)(0)), 1); + OPT_OutFlds(typ->link, 0, 1); if (OPT_nofhdfld > 2048) { OPM_Mark(223, typ->txtpos); } OPT_OutTProcs(typ, typ->link); - OPM_SymWInt(((LONGINT)(18))); + OPM_SymWInt(18); break; default: - OPM_LogWStr((CHAR*)"unhandled case at OutStr, typ^.comp = ", (LONGINT)39); - OPM_LogWNum(typ->comp, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case at OutStr, typ^.comp = ", 39); + OPM_LogWNum(typ->comp, 0); OPM_LogWLn(); break; } break; default: - OPM_LogWStr((CHAR*)"unhandled case at OutStr, typ^.form = ", (LONGINT)39); - OPM_LogWNum(typ->form, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case at OutStr, typ^.form = ", 39); + OPM_LogWNum(typ->form, 0); OPM_LogWLn(); break; } @@ -1552,7 +1552,7 @@ static void OPT_OutConstant (OPT_Object obj) OPM_SymWLReal(obj->conval->realval); break; case 10: - OPT_OutName((void*)*obj->conval->ext, ((LONGINT)(256))); + OPT_OutName((void*)*obj->conval->ext, 256); break; case 11: break; @@ -1585,64 +1585,64 @@ static void OPT_OutObj (OPT_Object obj) OPT_FPrintErr(obj, 251); break; default: - OPM_LogWStr((CHAR*)"unhandled case at OutObj, obj^.history = ", (LONGINT)42); - OPM_LogWNum(obj->history, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case at OutObj, obj^.history = ", 42); + OPM_LogWNum(obj->history, 0); OPM_LogWLn(); break; } switch (obj->mode) { case 3: OPT_OutConstant(obj); - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); break; case 5: if (obj->typ->strobj == obj) { - OPM_SymWInt(((LONGINT)(19))); + OPM_SymWInt(19); OPT_OutStr(obj->typ); } else { - OPM_SymWInt(((LONGINT)(20))); + OPM_SymWInt(20); OPT_OutStr(obj->typ); - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); } break; case 1: if (obj->vis == 2) { - OPM_SymWInt(((LONGINT)(22))); + OPM_SymWInt(22); } else { - OPM_SymWInt(((LONGINT)(21))); + OPM_SymWInt(21); } OPT_OutStr(obj->typ); - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); if (obj->typ->strobj == NIL || obj->typ->strobj->name[0] == 0x00) { OPM_FPrint(&OPT_expCtxt.reffp, obj->typ->ref); } break; case 7: - OPM_SymWInt(((LONGINT)(31))); + OPM_SymWInt(31); OPT_OutSign(obj->typ, obj->link); - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); break; case 10: - OPM_SymWInt(((LONGINT)(32))); + OPM_SymWInt(32); OPT_OutSign(obj->typ, obj->link); - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); break; case 9: - OPM_SymWInt(((LONGINT)(33))); + OPM_SymWInt(33); OPT_OutSign(obj->typ, obj->link); ext = obj->conval->ext; - j = (int)(*ext)[0]; + j = (*ext)[0]; i = 1; OPM_SymWInt(j); while (i <= j) { - OPM_SymWCh((*ext)[__X(i, ((LONGINT)(256)))]); + OPM_SymWCh((*ext)[__X(i, 256)]); i += 1; } - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); break; default: - OPM_LogWStr((CHAR*)"unhandled case at OutObj, obj.mode = ", (LONGINT)38); - OPM_LogWNum(obj->mode, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case at OutObj, obj.mode = ", 38); + OPM_LogWNum(obj->mode, 0); OPM_LogWLn(); break; } @@ -1663,17 +1663,17 @@ void OPT_Export (BOOLEAN *ext, BOOLEAN *new) OPT_Import((CHAR*)"@self", OPT_SelfName, &done); OPT_nofGmod = nofmod; if (OPM_noerr) { - OPM_NewSym((void*)OPT_SelfName, ((LONGINT)(256))); + OPM_NewSym((void*)OPT_SelfName, 256); if (OPM_noerr) { - OPM_SymWInt(((LONGINT)(16))); - OPT_OutName((void*)OPT_SelfName, ((LONGINT)(256))); + OPM_SymWInt(16); + OPT_OutName((void*)OPT_SelfName, 256); OPT_expCtxt.reffp = 0; OPT_expCtxt.ref = 16; OPT_expCtxt.nofm = 1; OPT_expCtxt.locmno[0] = 0; i = 1; while (i < 64) { - OPT_expCtxt.locmno[__X(i, ((LONGINT)(64)))] = -1; + OPT_expCtxt.locmno[__X(i, 64)] = -1; i += 1; } OPT_OutObj(OPT_topScope->right); @@ -1874,11 +1874,11 @@ export void *OPT__init(void) OPT_EnterTyp((CHAR*)"SET", 9, OPM_SetSize, &OPT_settyp); OPT_EnterTyp((CHAR*)"REAL", 7, OPM_RealSize, &OPT_realtyp); OPT_EnterTyp((CHAR*)"INTEGER", 5, OPM_IntSize, &OPT_inttyp); - OPT_EnterTyp((CHAR*)"LONGINT", 6, OPM_LIntSize, &OPT_linttyp); + OPT_EnterTyp((CHAR*)"LONGINT", 5, OPM_LIntSize, &OPT_linttyp); OPT_EnterTyp((CHAR*)"LONGREAL", 8, OPM_LRealSize, &OPT_lrltyp); OPT_EnterTyp((CHAR*)"SHORTINT", 4, OPM_SIntSize, &OPT_sinttyp); - OPT_EnterBoolConst((CHAR*)"FALSE", ((LONGINT)(0))); - OPT_EnterBoolConst((CHAR*)"TRUE", ((LONGINT)(1))); + OPT_EnterBoolConst((CHAR*)"FALSE", 0); + OPT_EnterBoolConst((CHAR*)"TRUE", 1); OPT_EnterProc((CHAR*)"HALT", 0); OPT_EnterProc((CHAR*)"NEW", 1); OPT_EnterProc((CHAR*)"ABS", 2); diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index f6206e42..3e352ca3 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index 03b675a9..75adb37c 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPC.h" #include "OPM.h" @@ -36,9 +36,10 @@ static void OPV_Len (OPT_Node n, LONGINT dim); export void OPV_Module (OPT_Node prog); static LONGINT OPV_NaturalAlignment (LONGINT size, LONGINT max); static void OPV_NewArr (OPT_Node d, OPT_Node x); +static void OPV_ParIntLiteral (LONGINT n, LONGINT size); static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, INTEGER comp); static BOOLEAN OPV_SideEffects (OPT_Node n); -static void OPV_SizeCast (LONGINT size); +static void OPV_SizeCast (LONGINT from, LONGINT to); static void OPV_Stamp (OPS_Name s); static OPT_Object OPV_SuperProc (OPT_Node n); static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported); @@ -86,7 +87,7 @@ void OPV_TypSize (OPT_Struct typ) base = OPC_SizeAlignment(OPM_RecSize); } else { OPV_TypSize(btyp); - offset = btyp->size - (int)__ASHR(btyp->sysflag, 8); + offset = btyp->size - __ASHR(btyp->sysflag, 8); base = btyp->align; } fld = typ->link; @@ -117,7 +118,7 @@ void OPV_TypSize (OPT_Struct typ) } typ->size = offset; typ->align = base; - typ->sysflag = __MASK(typ->sysflag, -256) + (int)__ASHL(offset - off0, 8); + typ->sysflag = __MASK(typ->sysflag, -256) + __ASHL(offset - off0, 8); } else if (c == 2) { OPV_TypSize(typ->BaseTyp); typ->size = typ->n * typ->BaseTyp->size; @@ -196,27 +197,27 @@ static void OPV_Stamp (OPS_Name s) OPV_stamp += 1; i = 0; j = OPV_stamp; - while (s[__X(i, ((LONGINT)(256)))] != 0x00) { + while (s[__X(i, 256)] != 0x00) { i += 1; } if (i > 25) { i = 25; } - s[__X(i, ((LONGINT)(256)))] = '_'; - s[__X(i + 1, ((LONGINT)(256)))] = '_'; + s[__X(i, 256)] = '_'; + s[__X(i + 1, 256)] = '_'; i += 2; k = 0; do { - n[__X(k, ((LONGINT)(10)))] = (CHAR)((int)__MOD(j, 10) + 48); + n[__X(k, 10)] = (CHAR)((int)__MOD(j, 10) + 48); j = __DIV(j, 10); k += 1; } while (!(j == 0)); do { k -= 1; - s[__X(i, ((LONGINT)(256)))] = n[__X(k, ((LONGINT)(10)))]; + s[__X(i, 256)] = n[__X(k, 10)]; i += 1; } while (!(k == 0)); - s[__X(i, ((LONGINT)(256)))] = 0x00; + s[__X(i, 256)] = 0x00; } static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported) @@ -258,7 +259,7 @@ static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exporte } scope = obj->scope; scope->leaf = 1; - __COPY(obj->name, scope->name, ((LONGINT)(256))); + __COPY(obj->name, scope->name, 256); OPV_Stamp(scope->name); if (mode == 9) { obj->adr = 1; @@ -338,8 +339,8 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN return _o_result; break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Nmop, subclass = ", (LONGINT)55); - OPM_LogWNum(subclass, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Nmop, subclass = ", 55); + OPM_LogWNum(subclass, 0); OPM_LogWLn(); break; } @@ -408,8 +409,8 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN return _o_result; break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Ndop, subclass = ", (LONGINT)55); - OPM_LogWNum(subclass, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Ndop, subclass = ", 55); + OPM_LogWNum(subclass, 0); OPM_LogWLn(); break; } @@ -423,8 +424,8 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN return _o_result; break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence, class = ", (LONGINT)43); - OPM_LogWNum(class, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence, class = ", 43); + OPM_LogWNum(class, 0); OPM_LogWLn(); break; } @@ -439,7 +440,7 @@ static void OPV_Len (OPT_Node n, LONGINT dim) } if ((n->class == 3 && n->typ->comp == 3)) { OPV_design(n->left, 10); - OPM_WriteString((CHAR*)"->len[", (LONGINT)7); + OPM_WriteString((CHAR*)"->len[", 7); OPM_WriteInt(dim); OPM_Write(']'); } else { @@ -463,7 +464,7 @@ static BOOLEAN OPV_SideEffects (OPT_Node n) static void OPV_Entier (OPT_Node n, INTEGER prec) { if (__IN(n->typ->form, 0x0180)) { - OPM_WriteString((CHAR*)"__ENTIER(", (LONGINT)10); + OPM_WriteString((CHAR*)"__ENTIER(", 10); OPV_expr(n, -1); OPM_Write(')'); } else { @@ -471,12 +472,28 @@ static void OPV_Entier (OPT_Node n, INTEGER prec) } } -static void OPV_SizeCast (LONGINT size) +static void OPV_SizeCast (LONGINT from, LONGINT to) { - if (size <= 4) { - OPM_WriteString((CHAR*)"(int)", (LONGINT)6); - } else { - OPM_WriteString((CHAR*)"(SYSTEM_INT64)", (LONGINT)15); + if ((from != to && (from > 4 || to > 4))) { + switch (to) { + case 1: + OPM_WriteString((CHAR*)"(SYSTEM_INT8)", 14); + break; + case 2: + OPM_WriteString((CHAR*)"(SYSTEM_INT16)", 15); + break; + case 4: + OPM_WriteString((CHAR*)"(SYSTEM_INT32)", 15); + break; + case 8: + OPM_WriteString((CHAR*)"(SYSTEM_INT64)", 15); + break; + default: + OPM_LogWStr((CHAR*)"Unhandled case in OPC.SizeCast, to = ", 38); + OPM_LogWNum(to, 1); + OPM_LogWLn(); + break; + } } } @@ -486,29 +503,27 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec) from = n->typ->form; to = newtype->form; if (to == 9) { - OPM_WriteString((CHAR*)"__SETOF(", (LONGINT)9); + OPM_WriteString((CHAR*)"__SETOF(", 9); OPV_Entier(n, -1); OPM_Write(')'); } else if (__IN(to, 0x70)) { if ((newtype->size < n->typ->size && __IN(2, OPM_opt))) { - OPM_WriteString((CHAR*)"__SHORT", (LONGINT)8); + OPM_WriteString((CHAR*)"__SHORT", 8); if (OPV_SideEffects(n)) { OPM_Write('F'); } OPM_Write('('); OPV_Entier(n, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(OPM_SignedMaximum(newtype->size) + 1); OPM_Write(')'); } else { - if (newtype->size != n->typ->size) { - OPV_SizeCast(newtype->size); - } + OPV_SizeCast(n->typ->size, newtype->size); OPV_Entier(n, 9); } } else if (to == 3) { if (__IN(2, OPM_opt)) { - OPM_WriteString((CHAR*)"__CHR", (LONGINT)6); + OPM_WriteString((CHAR*)"__CHR", 6); if (OPV_SideEffects(n)) { OPM_Write('F'); } @@ -516,7 +531,7 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec) OPV_Entier(n, -1); OPM_Write(')'); } else { - OPM_WriteString((CHAR*)"(CHAR)", (LONGINT)7); + OPM_WriteString((CHAR*)"(CHAR)", 7); OPV_Entier(n, 9); } } else { @@ -527,14 +542,14 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec) static void OPV_TypeOf (OPT_Node n) { if (n->typ->form == 13) { - OPM_WriteString((CHAR*)"__TYPEOF(", (LONGINT)10); + OPM_WriteString((CHAR*)"__TYPEOF(", 10); OPV_expr(n, -1); OPM_Write(')'); } else if (__IN(n->class, 0x15)) { OPC_Andent(n->typ); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } else if (n->class == 3) { - OPM_WriteString((CHAR*)"__TYPEOF(", (LONGINT)10); + OPM_WriteString((CHAR*)"__TYPEOF(", 10); OPV_expr(n->left, -1); OPM_Write(')'); } else if (n->class == 5) { @@ -552,12 +567,12 @@ static void OPV_Index (OPT_Node n, OPT_Node d, INTEGER prec, INTEGER dim) OPV_expr(n->right, prec); } else { if (OPV_SideEffects(n->right)) { - OPM_WriteString((CHAR*)"__XF(", (LONGINT)6); + OPM_WriteString((CHAR*)"__XF(", 6); } else { - OPM_WriteString((CHAR*)"__X(", (LONGINT)5); + OPM_WriteString((CHAR*)"__X(", 5); } OPV_expr(n->right, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_Len(d, dim); OPM_Write(')'); } @@ -569,12 +584,12 @@ static void OPV_design (OPT_Node n, INTEGER prec) OPT_Struct typ = NIL; INTEGER class, designPrec, comp; OPT_Node d = NIL, x = NIL; - INTEGER dims, i, _for__27; + INTEGER dims, i, _for__28; comp = n->typ->comp; obj = n->obj; class = n->class; designPrec = OPV_Precedence(class, n->subcl, n->typ->form, comp); - if ((((((class == 0 && obj->mnolev > 0)) && (int)obj->mnolev != OPM_level)) && prec == 10)) { + if ((((((class == 0 && obj->mnolev > 0)) && obj->mnolev != OPM_level)) && prec == 10)) { designPrec = 9; } if (prec > designPrec) { @@ -599,7 +614,7 @@ static void OPV_design (OPT_Node n, INTEGER prec) case 2: if (n->left->class == 3) { OPV_design(n->left->left, designPrec); - OPM_WriteString((CHAR*)"->", (LONGINT)3); + OPM_WriteString((CHAR*)"->", 3); } else { OPV_design(n->left, designPrec); OPM_Write('.'); @@ -609,7 +624,7 @@ static void OPV_design (OPT_Node n, INTEGER prec) case 3: if (n->typ->comp == 3) { OPV_design(n->left, 10); - OPM_WriteString((CHAR*)"->data", (LONGINT)7); + OPM_WriteString((CHAR*)"->data", 7); } else { OPM_Write('*'); OPV_design(n->left, designPrec); @@ -636,25 +651,25 @@ static void OPV_design (OPT_Node n, INTEGER prec) while (x != d) { if (x->left != d) { OPV_Index(x, d, 7, i); - OPM_WriteString((CHAR*)" + ", (LONGINT)4); + OPM_WriteString((CHAR*)" + ", 4); OPV_Len(d, i); - OPM_WriteString((CHAR*)" * (", (LONGINT)5); + OPM_WriteString((CHAR*)" * (", 5); i -= 1; } else { OPV_Index(x, d, -1, i); } x = x->left; } - _for__27 = dims; + _for__28 = dims; i = 1; - while (i <= _for__27) { + while (i <= _for__28) { OPM_Write(')'); i += 1; } if (n->typ->comp == 3) { OPM_Write(')'); - while ((int)i < __ASHR(d->typ->size - 4, 2)) { - OPM_WriteString((CHAR*)" * ", (LONGINT)4); + while (i < __ASHR(d->typ->size - 4, 2)) { + OPM_WriteString((CHAR*)" * ", 4); OPV_Len(d, i); i += 1; } @@ -672,33 +687,33 @@ static void OPV_design (OPT_Node n, INTEGER prec) obj = n->left->obj; if (__IN(3, OPM_opt)) { if (typ->comp == 4) { - OPM_WriteString((CHAR*)"__GUARDR(", (LONGINT)10); - if ((int)obj->mnolev != OPM_level) { - OPM_WriteStringVar((void*)obj->scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"__curr->", (LONGINT)9); + OPM_WriteString((CHAR*)"__GUARDR(", 10); + if (obj->mnolev != OPM_level) { + OPM_WriteStringVar((void*)obj->scope->name, 256); + OPM_WriteString((CHAR*)"__curr->", 9); OPC_Ident(obj); } else { OPC_Ident(obj); } } else { if (typ->BaseTyp->strobj == NIL) { - OPM_WriteString((CHAR*)"__GUARDA(", (LONGINT)10); + OPM_WriteString((CHAR*)"__GUARDA(", 10); } else { - OPM_WriteString((CHAR*)"__GUARDP(", (LONGINT)10); + OPM_WriteString((CHAR*)"__GUARDP(", 10); } OPV_expr(n->left, -1); typ = typ->BaseTyp; } - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Andent(typ); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(typ->extlev); OPM_Write(')'); } else { if (typ->comp == 4) { - OPM_WriteString((CHAR*)"*(", (LONGINT)3); + OPM_WriteString((CHAR*)"*(", 3); OPC_Ident(typ->strobj); - OPM_WriteString((CHAR*)"*)", (LONGINT)3); + OPM_WriteString((CHAR*)"*)", 3); OPC_CompleteIdent(obj); } else { OPM_Write('('); @@ -711,15 +726,15 @@ static void OPV_design (OPT_Node n, INTEGER prec) case 6: if (__IN(3, OPM_opt)) { if (n->left->class == 1) { - OPM_WriteString((CHAR*)"__GUARDEQR(", (LONGINT)12); + OPM_WriteString((CHAR*)"__GUARDEQR(", 12); OPC_CompleteIdent(n->left->obj); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_TypeOf(n->left); } else { - OPM_WriteString((CHAR*)"__GUARDEQP(", (LONGINT)12); + OPM_WriteString((CHAR*)"__GUARDEQP(", 12); OPV_expr(n->left->left, -1); } - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Ident(n->left->typ->strobj); OPM_Write(')'); } else { @@ -732,8 +747,8 @@ static void OPV_design (OPT_Node n, INTEGER prec) } break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.design, class = ", (LONGINT)39); - OPM_LogWNum(class, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.design, class = ", 39); + OPM_LogWNum(class, 0); OPM_LogWLn(); break; } @@ -742,6 +757,15 @@ static void OPV_design (OPT_Node n, INTEGER prec) } } +static void OPV_ParIntLiteral (LONGINT n, LONGINT size) +{ + if (OPV_ansi) { + OPM_WriteInt(n); + } else { + OPC_IntLiteral(n, size); + } +} + static void OPV_ActualPar (OPT_Node n, OPT_Object fp) { OPT_Struct typ = NIL, aptyp = NIL; @@ -756,81 +780,75 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) if ((((mode == 2 && n->class == 11)) && n->subcl == 29)) { OPM_Write('('); OPC_Ident(n->typ->strobj); - OPM_WriteString((CHAR*)"*)", (LONGINT)3); + OPM_WriteString((CHAR*)"*)", 3); prec = 10; } if (!__IN(n->typ->comp, 0x0c)) { if (mode == 2) { if ((OPV_ansi && typ != n->typ)) { - OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(void*)", 8); } OPM_Write('&'); prec = 9; } else if (OPV_ansi) { if ((__IN(comp, 0x0c) && n->class == 7)) { - OPM_WriteString((CHAR*)"(CHAR*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(CHAR*)", 8); } else if ((((form == 13 && typ != n->typ)) && n->typ != OPT_niltyp)) { - OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(void*)", 8); } } else { if ((__IN(form, 0x0180) && __IN(n->typ->form, 0x70))) { - OPM_WriteString((CHAR*)"(double)", (LONGINT)9); - prec = 9; - } else if ((form == 6 && n->typ->form < 6)) { - OPM_WriteString((CHAR*)"(LONGINT)", (LONGINT)10); + OPM_WriteString((CHAR*)"(double)", 9); prec = 9; + } else if (__IN(form, 0x70)) { + OPV_SizeCast(n->typ->size, typ->size); } } } else if (OPV_ansi) { if ((((mode == 2 && typ != n->typ)) && prec == -1)) { - OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(void*)", 8); } } if ((((mode == 2 && n->class == 11)) && n->subcl == 29)) { OPV_expr(n->left, prec); - } else if ((((((form == 6 && n->class == 7)) && n->conval->intval <= OPM_SignedMaximum(OPM_IntSize))) && n->conval->intval >= OPM_SignedMinimum(OPM_IntSize))) { - OPM_WriteString((CHAR*)"((LONGINT)(", (LONGINT)12); - OPV_expr(n, prec); - OPM_WriteString((CHAR*)"))", (LONGINT)3); + } else if ((__IN(form, 0x70) && n->class == 7)) { + OPV_ParIntLiteral(n->conval->intval, n->typ->size); } else { OPV_expr(n, prec); } if ((comp == 4 && mode == 2)) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_TypeOf(n); } else if (comp == 3) { if (n->class == 7) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); - OPM_WriteString((CHAR*)"(LONGINT)", (LONGINT)10); - OPM_WriteInt(n->conval->intval2); + OPM_WriteString((CHAR*)", ", 3); + OPV_ParIntLiteral(n->conval->intval2, OPM_PointerSize); } else { aptyp = n->typ; dim = 0; while ((typ->comp == 3 && typ->BaseTyp->form != 1)) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_Len(n, dim); typ = typ->BaseTyp; aptyp = aptyp->BaseTyp; dim += 1; } if ((typ->comp == 3 && typ->BaseTyp->form == 1)) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); while (aptyp->comp == 3) { OPV_Len(n, dim); - OPM_WriteString((CHAR*)" * ", (LONGINT)4); + OPM_WriteString((CHAR*)" * ", 4); dim += 1; aptyp = aptyp->BaseTyp; } - OPM_WriteString((CHAR*)"((LONGINT)(", (LONGINT)12); - OPM_WriteInt(aptyp->size); - OPM_WriteString((CHAR*)"))", (LONGINT)3); + OPV_ParIntLiteral(aptyp->size, OPM_PointerSize); } } } n = n->link; fp = fp->link; if (n != NIL) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); } } OPM_Write(')'); @@ -870,9 +888,9 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPC_Constant(n->conval, form); break; case 10: - OPM_WriteString((CHAR*)"__SETRNG(", (LONGINT)10); + OPM_WriteString((CHAR*)"__SETRNG(", 10); OPV_expr(l, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(r, -1); OPM_Write(')'); break; @@ -893,16 +911,16 @@ static void OPV_expr (OPT_Node n, INTEGER prec) case 16: typ = n->obj->typ; if (l->typ->comp == 4) { - OPM_WriteString((CHAR*)"__IS(", (LONGINT)6); + OPM_WriteString((CHAR*)"__IS(", 6); OPC_TypeOf(l->obj); } else { - OPM_WriteString((CHAR*)"__ISP(", (LONGINT)7); + OPM_WriteString((CHAR*)"__ISP(", 7); OPV_expr(l, -1); typ = typ->BaseTyp; } - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Andent(typ); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(typ->extlev); OPM_Write(')'); break; @@ -912,31 +930,31 @@ static void OPV_expr (OPT_Node n, INTEGER prec) case 21: if (OPV_SideEffects(l)) { if (l->typ->form < 7) { - if (l->typ->form < 6) { - OPM_WriteString((CHAR*)"(int)", (LONGINT)6); + if (l->typ->size <= 4) { + OPM_WriteString((CHAR*)"(int)", 6); } - OPM_WriteString((CHAR*)"__ABSF(", (LONGINT)8); + OPM_WriteString((CHAR*)"__ABSF(", 8); } else { - OPM_WriteString((CHAR*)"__ABSFD(", (LONGINT)9); + OPM_WriteString((CHAR*)"__ABSFD(", 9); } } else { - OPM_WriteString((CHAR*)"__ABS(", (LONGINT)7); + OPM_WriteString((CHAR*)"__ABS(", 7); } OPV_expr(l, -1); OPM_Write(')'); break; case 22: - OPM_WriteString((CHAR*)"__CAP(", (LONGINT)7); + OPM_WriteString((CHAR*)"__CAP(", 7); OPV_expr(l, -1); OPM_Write(')'); break; case 23: - OPM_WriteString((CHAR*)"__ODD(", (LONGINT)7); + OPM_WriteString((CHAR*)"__ODD(", 7); OPV_expr(l, -1); OPM_Write(')'); break; case 24: - OPM_WriteString((CHAR*)"(LONGINT)(SYSTEM_ADRINT)", (LONGINT)25); + OPM_WriteString((CHAR*)"(SYSTEM_ADRINT)", 16); if (l->class == 1) { OPC_CompleteIdent(l->obj); } else { @@ -952,13 +970,13 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPC_Ident(n->typ->strobj); OPM_Write(')'); if (__IN(n->typ->form, 0x6000) || __IN(l->typ->form, 0x6000)) { - OPM_WriteString((CHAR*)"(SYSTEM_ADRINT)", (LONGINT)16); + OPM_WriteString((CHAR*)"(SYSTEM_ADRINT)", 16); } OPV_expr(l, exprPrec); } else { - OPM_WriteString((CHAR*)"__VAL(", (LONGINT)7); + OPM_WriteString((CHAR*)"__VAL(", 7); OPC_Ident(n->typ->strobj); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(l, -1); OPM_Write(')'); } @@ -977,84 +995,84 @@ static void OPV_expr (OPT_Node n, INTEGER prec) case 28: case 3: case 4: switch (subclass) { case 15: - OPM_WriteString((CHAR*)"__IN(", (LONGINT)6); + OPM_WriteString((CHAR*)"__IN(", 6); break; case 17: if (r->class == 7) { if (r->conval->intval >= 0) { - OPM_WriteString((CHAR*)"__ASHL(", (LONGINT)8); + OPM_WriteString((CHAR*)"__ASHL(", 8); } else { - OPM_WriteString((CHAR*)"__ASHR(", (LONGINT)8); + OPM_WriteString((CHAR*)"__ASHR(", 8); } } else if (OPV_SideEffects(r)) { - OPM_WriteString((CHAR*)"__ASHF(", (LONGINT)8); + OPM_WriteString((CHAR*)"__ASHF(", 8); } else { - OPM_WriteString((CHAR*)"__ASH(", (LONGINT)7); + OPM_WriteString((CHAR*)"__ASH(", 7); } break; case 18: - OPM_WriteString((CHAR*)"__MASK(", (LONGINT)8); + OPM_WriteString((CHAR*)"__MASK(", 8); break; case 26: - OPM_WriteString((CHAR*)"__BIT(", (LONGINT)7); + OPM_WriteString((CHAR*)"__BIT(", 7); break; case 27: if (r->class == 7) { if (r->conval->intval >= 0) { - OPM_WriteString((CHAR*)"__LSHL(", (LONGINT)8); + OPM_WriteString((CHAR*)"__LSHL(", 8); } else { - OPM_WriteString((CHAR*)"__LSHR(", (LONGINT)8); + OPM_WriteString((CHAR*)"__LSHR(", 8); } } else { - OPM_WriteString((CHAR*)"__LSH(", (LONGINT)7); + OPM_WriteString((CHAR*)"__LSH(", 7); } break; case 28: if (r->class == 7) { if (r->conval->intval >= 0) { - OPM_WriteString((CHAR*)"__ROTL(", (LONGINT)8); + OPM_WriteString((CHAR*)"__ROTL(", 8); } else { - OPM_WriteString((CHAR*)"__ROTR(", (LONGINT)8); + OPM_WriteString((CHAR*)"__ROTR(", 8); } } else { - OPM_WriteString((CHAR*)"__ROT(", (LONGINT)7); + OPM_WriteString((CHAR*)"__ROT(", 7); } break; case 3: if (OPV_SideEffects(n)) { - if (form < 6) { - OPM_WriteString((CHAR*)"(int)", (LONGINT)6); + if (n->typ->size <= 4) { + OPM_WriteString((CHAR*)"(int)", 6); } - OPM_WriteString((CHAR*)"__DIVF(", (LONGINT)8); + OPM_WriteString((CHAR*)"__DIVF(", 8); } else { - OPM_WriteString((CHAR*)"__DIV(", (LONGINT)7); + OPM_WriteString((CHAR*)"__DIV(", 7); } break; case 4: - if (form < 6) { - OPM_WriteString((CHAR*)"(int)", (LONGINT)6); + if (n->typ->size <= 4) { + OPM_WriteString((CHAR*)"(int)", 6); } if (OPV_SideEffects(n)) { - OPM_WriteString((CHAR*)"__MODF(", (LONGINT)8); + OPM_WriteString((CHAR*)"__MODF(", 8); } else { - OPM_WriteString((CHAR*)"__MOD(", (LONGINT)7); + OPM_WriteString((CHAR*)"__MOD(", 7); } break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, subclass = ", (LONGINT)40); - OPM_LogWNum(subclass, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, subclass = ", 40); + OPM_LogWNum(subclass, 0); OPM_LogWLn(); break; } OPV_expr(l, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); if ((((__IN(subclass, 0x18020000) && r->class == 7)) && r->conval->intval < 0)) { OPM_WriteInt(-r->conval->intval); } else { OPV_expr(r, -1); } if (__IN(subclass, 0x18000000)) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Ident(l->typ->strobj); } OPM_Write(')'); @@ -1062,9 +1080,9 @@ static void OPV_expr (OPT_Node n, INTEGER prec) case 9: case 10: case 11: case 12: case 13: case 14: if (__IN(l->typ->form, 0x8400)) { - OPM_WriteString((CHAR*)"__STRCMP(", (LONGINT)10); + OPM_WriteString((CHAR*)"__STRCMP(", 10); OPV_expr(l, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(r, -1); OPM_Write(')'); OPC_Cmp(subclass); @@ -1074,7 +1092,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPC_Cmp(subclass); typ = l->typ; if ((((((typ->form == 13 && r->typ->form != 11)) && r->typ != typ)) && r->typ != OPT_sysptrtyp)) { - OPM_WriteString((CHAR*)"(void *) ", (LONGINT)10); + OPM_WriteString((CHAR*)"(void *) ", 10); } OPV_expr(r, exprPrec); } @@ -1087,16 +1105,16 @@ static void OPV_expr (OPT_Node n, INTEGER prec) switch (subclass) { case 1: if (form == 9) { - OPM_WriteString((CHAR*)" & ", (LONGINT)4); + OPM_WriteString((CHAR*)" & ", 4); } else { - OPM_WriteString((CHAR*)" * ", (LONGINT)4); + OPM_WriteString((CHAR*)" * ", 4); } break; case 2: if (form == 9) { - OPM_WriteString((CHAR*)" ^ ", (LONGINT)4); + OPM_WriteString((CHAR*)" ^ ", 4); } else { - OPM_WriteString((CHAR*)" / ", (LONGINT)4); + OPM_WriteString((CHAR*)" / ", 4); if (r->obj == NIL || __IN(r->obj->typ->form, 0x70)) { OPM_Write('('); OPC_Ident(n->typ->strobj); @@ -1105,28 +1123,28 @@ static void OPV_expr (OPT_Node n, INTEGER prec) } break; case 5: - OPM_WriteString((CHAR*)" && ", (LONGINT)5); + OPM_WriteString((CHAR*)" && ", 5); break; case 6: if (form == 9) { - OPM_WriteString((CHAR*)" | ", (LONGINT)4); + OPM_WriteString((CHAR*)" | ", 4); } else { - OPM_WriteString((CHAR*)" + ", (LONGINT)4); + OPM_WriteString((CHAR*)" + ", 4); } break; case 7: if (form == 9) { - OPM_WriteString((CHAR*)" & ~", (LONGINT)5); + OPM_WriteString((CHAR*)" & ~", 5); } else { - OPM_WriteString((CHAR*)" - ", (LONGINT)4); + OPM_WriteString((CHAR*)" - ", 4); } break; case 8: - OPM_WriteString((CHAR*)" || ", (LONGINT)5); + OPM_WriteString((CHAR*)" || ", 5); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, subclass = ", (LONGINT)40); - OPM_LogWNum(subclass, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, subclass = ", 40); + OPM_LogWNum(subclass, 0); OPM_LogWLn(); break; } @@ -1142,7 +1160,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) if (l->subcl == 1) { proc = OPV_SuperProc(n); } else { - OPM_WriteString((CHAR*)"__", (LONGINT)3); + OPM_WriteString((CHAR*)"__", 3); proc = OPC_BaseTProc(l->obj); } OPC_Ident(proc); @@ -1171,7 +1189,7 @@ static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) LONGINT adr; if_ = n->left; while (if_ != NIL) { - OPM_WriteString((CHAR*)"if ", (LONGINT)4); + OPM_WriteString((CHAR*)"if ", 4); OPV_expr(if_->left, 12); OPM_Write(' '); OPC_BegBlk(); @@ -1182,9 +1200,9 @@ static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) if (typ->comp == 4) { OPC_BegStat(); OPC_Ident(if_->left->obj); - OPM_WriteString((CHAR*)" *", (LONGINT)3); - OPM_WriteString(obj->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"__ = (void*)", (LONGINT)13); + OPM_WriteString((CHAR*)" *", 3); + OPM_WriteString(obj->name, 256); + OPM_WriteString((CHAR*)"__ = (void*)", 13); obj->adr = 0; OPC_CompleteIdent(obj); OPC_EndStat(); @@ -1200,13 +1218,13 @@ static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) if_ = if_->link; if ((if_ != NIL || n->right != NIL) || withtrap) { OPC_EndBlk0(); - OPM_WriteString((CHAR*)" else ", (LONGINT)7); + OPM_WriteString((CHAR*)" else ", 7); } else { OPC_EndBlk(); } } if (withtrap) { - OPM_WriteString((CHAR*)"__WITHCHK", (LONGINT)10); + OPM_WriteString((CHAR*)"__WITHCHK", 10); OPC_EndStat(); } else if (n->right != NIL) { OPC_BegBlk(); @@ -1220,7 +1238,7 @@ static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc) OPT_Node switchCase = NIL, label = NIL; LONGINT low, high; INTEGER form, i; - OPM_WriteString((CHAR*)"switch ", (LONGINT)8); + OPM_WriteString((CHAR*)"switch ", 8); OPV_expr(n->left, 12); OPM_Write(' '); OPC_BegBlk(); @@ -1252,22 +1270,22 @@ static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc) OPC_Indent(1); OPV_stat(switchCase->right, outerProc); OPC_BegStat(); - OPM_WriteString((CHAR*)"break", (LONGINT)6); + OPM_WriteString((CHAR*)"break", 6); OPC_EndStat(); OPC_Indent(-1); switchCase = switchCase->link; } OPC_BegStat(); - OPM_WriteString((CHAR*)"default: ", (LONGINT)10); + OPM_WriteString((CHAR*)"default: ", 10); if (n->right->conval->setval != 0x0) { OPC_Indent(1); OPM_WriteLn(); OPV_stat(n->right->right, outerProc); OPC_BegStat(); - OPM_WriteString((CHAR*)"break", (LONGINT)6); + OPM_WriteString((CHAR*)"break", 6); OPC_Indent(-1); } else { - OPM_WriteString((CHAR*)"__CASECHK", (LONGINT)10); + OPM_WriteString((CHAR*)"__CASECHK", 10); } OPC_EndStat(); OPC_EndBlk(); @@ -1297,44 +1315,40 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) base = base->BaseTyp; } OPV_design(d, -1); - OPM_WriteString((CHAR*)" = __NEWARR(", (LONGINT)13); + OPM_WriteString((CHAR*)" = __NEWARR(", 13); while (base->comp == 2) { nofdim += 1; base = base->BaseTyp; } if ((base->comp == 4 && OPC_NofPtrs(base) != 0)) { OPC_Ident(base->strobj); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } else if (base->form == 13) { - OPM_WriteString((CHAR*)"POINTER__typ", (LONGINT)13); + OPM_WriteString((CHAR*)"POINTER__typ", 13); } else { - OPM_WriteString((CHAR*)"NIL", (LONGINT)4); + OPM_WriteString((CHAR*)"NIL", 4); } - OPM_WriteString((CHAR*)", ", (LONGINT)3); - OPM_WriteString((CHAR*)"((LONGINT)(", (LONGINT)12); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(base->size); - OPM_WriteString((CHAR*)"))", (LONGINT)3); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(OPC_BaseAlignment(base)); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(nofdim); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(nofdyn); while (typ != base) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); if (typ->comp == 3) { if (x->class == 7) { - OPM_WriteString((CHAR*)"(LONGINT)(", (LONGINT)11); - OPV_expr(x, -1); - OPM_WriteString((CHAR*)")", (LONGINT)2); + OPC_IntLiteral(x->conval->intval, OPM_PointerSize); } else { - OPM_WriteString((CHAR*)"(LONGINT)", (LONGINT)10); + OPM_WriteString((CHAR*)"((SYSTEM_ADRINT)(", 18); OPV_expr(x, 10); + OPM_WriteString((CHAR*)"))", 3); } x = x->link; } else { - OPM_WriteString((CHAR*)"(LONGINT)", (LONGINT)10); - OPM_WriteInt(typ->n); + OPC_IntLiteral(typ->n, OPM_PointerSize); } typ = typ->BaseTyp; } @@ -1377,7 +1391,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPV_DefineTDescs(n->right); OPC_EnterBody(); OPV_InitTDescs(n->right); - OPM_WriteString((CHAR*)"/* BEGIN */", (LONGINT)12); + OPM_WriteString((CHAR*)"/* BEGIN */", 12); OPM_WriteLn(); OPV_stat(n->right, outerProc); OPC_ExitBody(); @@ -1403,11 +1417,11 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) l = n->left; r = n->right; if (l->typ->comp == 2) { - OPM_WriteString((CHAR*)"__MOVE(", (LONGINT)8); + OPM_WriteString((CHAR*)"__MOVE(", 8); OPV_expr(r, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(l, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); if (r->typ == OPT_stringtyp) { OPM_WriteInt(r->conval->intval2); } else { @@ -1420,13 +1434,13 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPV_design(l, -1); l->obj->adr = 1; if (r->typ->form != 11) { - OPM_WriteString((CHAR*)" = (void*)", (LONGINT)11); + OPM_WriteString((CHAR*)" = (void*)", 11); } else { - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteString((CHAR*)" = ", 4); } } else { OPV_design(l, -1); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteString((CHAR*)" = ", 4); } if (l->typ == r->typ) { OPV_expr(r, -1); @@ -1436,9 +1450,9 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPM_Write(')'); OPV_expr(r, -1); } else if (l->typ->comp == 4) { - OPM_WriteString((CHAR*)"*(", (LONGINT)3); + OPM_WriteString((CHAR*)"*(", 3); OPC_Andent(l->typ); - OPM_WriteString((CHAR*)"*)&", (LONGINT)4); + OPM_WriteString((CHAR*)"*)&", 4); OPV_expr(r, 9); } else { OPV_expr(r, -1); @@ -1447,11 +1461,11 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) break; case 1: if (n->left->typ->BaseTyp->comp == 4) { - OPM_WriteString((CHAR*)"__NEW(", (LONGINT)7); + OPM_WriteString((CHAR*)"__NEW(", 7); OPV_design(n->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Andent(n->left->typ->BaseTyp); - OPM_WriteString((CHAR*)")", (LONGINT)2); + OPM_WriteString((CHAR*)")", 2); } else if (__IN(n->left->typ->BaseTyp->comp, 0x0c)) { OPV_NewArr(n->left, n->right); } @@ -1464,43 +1478,43 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) case 15: case 16: OPV_expr(n->left, -1); OPC_SetInclude(n->subcl == 16); - OPM_WriteString((CHAR*)"__SETOF(", (LONGINT)9); + OPM_WriteString((CHAR*)"__SETOF(", 9); OPV_expr(n->right, -1); OPM_Write(')'); break; case 18: - OPM_WriteString((CHAR*)"__COPY(", (LONGINT)8); + OPM_WriteString((CHAR*)"__COPY(", 8); OPV_expr(n->right, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(n->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); - OPV_Len(n->left, ((LONGINT)(0))); + OPM_WriteString((CHAR*)", ", 3); + OPV_Len(n->left, 0); OPM_Write(')'); break; case 31: - OPM_WriteString((CHAR*)"__MOVE(", (LONGINT)8); + OPM_WriteString((CHAR*)"__MOVE(", 8); OPV_expr(n->right, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(n->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(n->right->link, -1); OPM_Write(')'); break; case 24: - OPM_WriteString((CHAR*)"__GET(", (LONGINT)7); + OPM_WriteString((CHAR*)"__GET(", 7); OPV_expr(n->right, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(n->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Ident(n->left->typ->strobj); OPM_Write(')'); break; case 25: - OPM_WriteString((CHAR*)"__PUT(", (LONGINT)7); + OPM_WriteString((CHAR*)"__PUT(", 7); OPV_expr(n->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(n->right, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Ident(n->right->typ->strobj); OPM_Write(')'); break; @@ -1508,15 +1522,15 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPM_err(200); break; case 30: - OPM_WriteString((CHAR*)"__SYSNEW(", (LONGINT)10); + OPM_WriteString((CHAR*)"__SYSNEW(", 10); OPV_design(n->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(n->right, -1); OPM_Write(')'); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, n^.subcl = ", (LONGINT)40); - OPM_LogWNum(n->subcl, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, n^.subcl = ", 40); + OPM_LogWNum(n->subcl, 0); OPM_LogWLn(); break; } @@ -1526,7 +1540,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) if (n->left->subcl == 1) { proc = OPV_SuperProc(n); } else { - OPM_WriteString((CHAR*)"__", (LONGINT)3); + OPM_WriteString((CHAR*)"__", 3); proc = OPC_BaseTProc(n->left->obj); } OPC_Ident(proc); @@ -1542,9 +1556,9 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) if (n->subcl != 32) { OPV_IfStat(n, 0, outerProc); } else if (OPV_assert) { - OPM_WriteString((CHAR*)"__ASSERT(", (LONGINT)10); + OPM_WriteString((CHAR*)"__ASSERT(", 10); OPV_expr(n->left->left->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(n->left->right->right->conval->intval); OPM_Write(')'); OPC_EndStat(); @@ -1557,7 +1571,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) break; case 22: OPV_exit.level += 1; - OPM_WriteString((CHAR*)"while ", (LONGINT)7); + OPM_WriteString((CHAR*)"while ", 7); OPV_expr(n->left, 12); OPM_Write(' '); OPC_BegBlk(); @@ -1567,11 +1581,11 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) break; case 23: OPV_exit.level += 1; - OPM_WriteString((CHAR*)"do ", (LONGINT)4); + OPM_WriteString((CHAR*)"do ", 4); OPC_BegBlk(); OPV_stat(n->left, outerProc); OPC_EndBlk0(); - OPM_WriteString((CHAR*)" while (!", (LONGINT)10); + OPM_WriteString((CHAR*)" while (!", 10); OPV_expr(n->right, 9); OPM_Write(')'); OPV_exit.level -= 1; @@ -1580,13 +1594,13 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) saved = OPV_exit; OPV_exit.level = 0; OPV_exit.label = -1; - OPM_WriteString((CHAR*)"for (;;) ", (LONGINT)10); + OPM_WriteString((CHAR*)"for (;;) ", 10); OPC_BegBlk(); OPV_stat(n->left, outerProc); OPC_EndBlk(); if (OPV_exit.label != -1) { OPC_BegStat(); - OPM_WriteString((CHAR*)"exit__", (LONGINT)7); + OPM_WriteString((CHAR*)"exit__", 7); OPM_WriteInt(OPV_exit.label); OPM_Write(':'); OPC_EndStat(); @@ -1595,39 +1609,39 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) break; case 25: if (OPV_exit.level == 0) { - OPM_WriteString((CHAR*)"break", (LONGINT)6); + OPM_WriteString((CHAR*)"break", 6); } else { if (OPV_exit.label == -1) { OPV_exit.label = OPV_nofExitLabels; OPV_nofExitLabels += 1; } - OPM_WriteString((CHAR*)"goto exit__", (LONGINT)12); + OPM_WriteString((CHAR*)"goto exit__", 12); OPM_WriteInt(OPV_exit.label); } break; case 26: if (OPM_level == 0) { if (OPV_mainprog) { - OPM_WriteString((CHAR*)"__FINI", (LONGINT)7); + OPM_WriteString((CHAR*)"__FINI", 7); } else { - OPM_WriteString((CHAR*)"__ENDMOD", (LONGINT)9); + OPM_WriteString((CHAR*)"__ENDMOD", 9); } } else { if (n->left != NIL) { - OPM_WriteString((CHAR*)"_o_result = ", (LONGINT)13); + OPM_WriteString((CHAR*)"_o_result = ", 13); if ((n->left->typ->form == 13 && n->obj->typ != n->left->typ)) { - OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(void*)", 8); OPV_expr(n->left, 10); } else { OPV_expr(n->left, -1); } - OPM_WriteString((CHAR*)";", (LONGINT)2); + OPM_WriteString((CHAR*)";", 2); OPM_WriteLn(); OPC_BegStat(); OPC_ExitProc(outerProc, 0, 0); - OPM_WriteString((CHAR*)"return _o_result", (LONGINT)17); + OPM_WriteString((CHAR*)"return _o_result", 17); } else { - OPM_WriteString((CHAR*)"return", (LONGINT)7); + OPM_WriteString((CHAR*)"return", 7); } } break; @@ -1638,8 +1652,8 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPC_Halt(n->right->conval->intval); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, n^.class = ", (LONGINT)40); - OPM_LogWNum(n->class, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, n^.class = ", 40); + OPM_LogWNum(n->class, 0); OPM_LogWLn(); break; } diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index 6926d6ac..0299d34b 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 9e1c6dfd..6ff2920b 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef @@ -229,7 +229,7 @@ void Platform_Init (INTEGER argc, LONGINT argvadr) Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; Platform_ArgCount = argc; - av = (Platform_ArgVecPtr)(SYSTEM_ADRINT)argvadr; + av = __VAL(Platform_ArgVecPtr, argvadr); Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; Platform_HeapInitHeap(); @@ -262,8 +262,8 @@ void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { - av = (Platform_ArgVec)(SYSTEM_ADRINT)Platform_ArgVector; - __COPY(*(*av)[__X(n, ((LONGINT)(1024)))], val, val__len); + av = __VAL(Platform_ArgVec, Platform_ArgVector); + __COPY(*(*av)[__X(n, 1024)], val, val__len); } } @@ -272,17 +272,17 @@ void Platform_GetIntArg (INTEGER n, LONGINT *val) CHAR s[64]; LONGINT k, d, i; s[0] = 0x00; - Platform_GetArg(n, (void*)s, ((LONGINT)(64))); + Platform_GetArg(n, (void*)s, 64); i = 0; if (s[0] == '-') { i = 1; } k = 0; - d = (int)s[__X(i, ((LONGINT)(64)))] - 48; + d = s[__X(i, 64)] - 48; while ((d >= 0 && d <= 9)) { k = k * 10 + d; i += 1; - d = (int)s[__X(i, ((LONGINT)(64)))] - 48; + d = s[__X(i, 64)] - 48; } if (s[0] == '-') { k = -k; @@ -300,10 +300,10 @@ INTEGER Platform_ArgPos (CHAR *s, LONGINT s__len) CHAR arg[256]; __DUP(s, s__len, CHAR); i = 0; - Platform_GetArg(i, (void*)arg, ((LONGINT)(256))); + Platform_GetArg(i, (void*)arg, 256); while ((i < Platform_ArgCount && __STRCMP(s, arg) != 0)) { i += 1; - Platform_GetArg(i, (void*)arg, ((LONGINT)(256))); + Platform_GetArg(i, (void*)arg, 256); } _o_result = i; __DEL(s); @@ -327,7 +327,7 @@ void Platform_SetBadInstructionHandler (Platform_SignalHandler handler) static void Platform_YMDHMStoClock (LONGINT ye, LONGINT mo, LONGINT da, LONGINT ho, LONGINT mi, LONGINT se, LONGINT *t, LONGINT *d) { - *d = (__ASHL(__MOD(ye, 100), 9) + __ASHL(mo + 1, 5)) + da; + *d = (__ASHL((int)__MOD(ye, 100), 9) + __ASHL(mo + 1, 5)) + da; *t = (__ASHL(ho, 12) + __ASHL(mi, 6)) + se; } @@ -350,8 +350,8 @@ LONGINT Platform_Time (void) LONGINT _o_result; LONGINT ms; Platform_gettimeval(); - ms = __DIVF(Platform_tvusec(), 1000) + Platform_tvsec() * 1000; - _o_result = __MOD(ms - Platform_TimeStart, 2147483647); + ms = (int)__DIVF(Platform_tvusec(), 1000) + Platform_tvsec() * 1000; + _o_result = (int)__MOD(ms - Platform_TimeStart, 2147483647); return _o_result; } @@ -359,7 +359,7 @@ void Platform_Delay (LONGINT ms) { LONGINT s, ns; s = __DIV(ms, 1000); - ns = __MOD(ms, 1000) * 1000000; + ns = (int)__MOD(ms, 1000) * 1000000; Platform_nanosleep(s, ns); } @@ -529,7 +529,7 @@ INTEGER Platform_Read (LONGINT h, LONGINT p, LONGINT l, LONGINT *n) INTEGER Platform_ReadBuf (LONGINT h, SYSTEM_BYTE *b, LONGINT b__len, LONGINT *n) { INTEGER _o_result; - *n = Platform_readfile(h, (LONGINT)(SYSTEM_ADRINT)b, b__len); + *n = Platform_readfile(h, (SYSTEM_ADRINT)b, b__len); if (*n < 0) { *n = 0; _o_result = Platform_err(); @@ -613,7 +613,7 @@ INTEGER Platform_Chdir (CHAR *n, LONGINT n__len) INTEGER _o_result; INTEGER r; r = Platform_chdir(n, n__len); - Platform_getcwd((void*)Platform_CWD, ((LONGINT)(256))); + Platform_getcwd((void*)Platform_CWD, 256); if (r < 0) { _o_result = Platform_err(); return _o_result; @@ -658,7 +658,7 @@ static void Platform_errposint (LONGINT l) if (l > 10) { Platform_errposint(__DIV(l, 10)); } - Platform_errch((CHAR)(48 + __MOD(l, 10))); + Platform_errch((CHAR)(48 + (int)__MOD(l, 10))); } static void Platform_errint (LONGINT l) @@ -674,52 +674,52 @@ static void Platform_DisplayHaltCode (LONGINT code) { switch (code) { case -1: - Platform_errstring((CHAR*)"Assertion failure.", (LONGINT)19); + Platform_errstring((CHAR*)"Assertion failure.", 19); break; case -2: - Platform_errstring((CHAR*)"Index out of range.", (LONGINT)20); + Platform_errstring((CHAR*)"Index out of range.", 20); break; case -3: - Platform_errstring((CHAR*)"Reached end of function without reaching RETURN.", (LONGINT)49); + Platform_errstring((CHAR*)"Reached end of function without reaching RETURN.", 49); break; case -4: - Platform_errstring((CHAR*)"CASE statement: no matching label and no ELSE.", (LONGINT)47); + Platform_errstring((CHAR*)"CASE statement: no matching label and no ELSE.", 47); break; case -5: - Platform_errstring((CHAR*)"Type guard failed.", (LONGINT)19); + Platform_errstring((CHAR*)"Type guard failed.", 19); break; case -6: - Platform_errstring((CHAR*)"Implicit type guard in record assignment failed.", (LONGINT)49); + Platform_errstring((CHAR*)"Implicit type guard in record assignment failed.", 49); break; case -7: - Platform_errstring((CHAR*)"Invalid case in WITH statement.", (LONGINT)32); + Platform_errstring((CHAR*)"Invalid case in WITH statement.", 32); break; case -8: - Platform_errstring((CHAR*)"Value out of range.", (LONGINT)20); + Platform_errstring((CHAR*)"Value out of range.", 20); break; case -9: - Platform_errstring((CHAR*)"Heap interrupted while locked, but lockdepth = 0 at unlock.", (LONGINT)60); + Platform_errstring((CHAR*)"Heap interrupted while locked, but lockdepth = 0 at unlock.", 60); break; case -10: - Platform_errstring((CHAR*)"NIL access.", (LONGINT)12); + Platform_errstring((CHAR*)"NIL access.", 12); break; case -11: - Platform_errstring((CHAR*)"Alignment error.", (LONGINT)17); + Platform_errstring((CHAR*)"Alignment error.", 17); break; case -12: - Platform_errstring((CHAR*)"Divide by zero.", (LONGINT)16); + Platform_errstring((CHAR*)"Divide by zero.", 16); break; case -13: - Platform_errstring((CHAR*)"Arithmetic overflow/underflow.", (LONGINT)31); + Platform_errstring((CHAR*)"Arithmetic overflow/underflow.", 31); break; case -14: - Platform_errstring((CHAR*)"Invalid function argument.", (LONGINT)27); + Platform_errstring((CHAR*)"Invalid function argument.", 27); break; case -15: - Platform_errstring((CHAR*)"Internal error, e.g. Type descriptor size mismatch.", (LONGINT)52); + Platform_errstring((CHAR*)"Internal error, e.g. Type descriptor size mismatch.", 52); break; case -20: - Platform_errstring((CHAR*)"Too many, or negative number of, elements in dynamic array.", (LONGINT)60); + Platform_errstring((CHAR*)"Too many, or negative number of, elements in dynamic array.", 60); break; default: break; @@ -733,9 +733,9 @@ void Platform_Halt (LONGINT code) if (Platform_HaltHandler != NIL) { (*Platform_HaltHandler)(code); } - Platform_errstring((CHAR*)"Terminated by Halt(", (LONGINT)20); + Platform_errstring((CHAR*)"Terminated by Halt(", 20); Platform_errint(code); - Platform_errstring((CHAR*)"). ", (LONGINT)4); + Platform_errstring((CHAR*)"). ", 4); if (code < 0) { Platform_DisplayHaltCode(code); } @@ -746,11 +746,11 @@ void Platform_Halt (LONGINT code) void Platform_AssertFail (LONGINT code) { INTEGER e; - Platform_errstring((CHAR*)"Assertion failure.", (LONGINT)19); + Platform_errstring((CHAR*)"Assertion failure.", 19); if (code != 0) { - Platform_errstring((CHAR*)" ASSERT code ", (LONGINT)14); + Platform_errstring((CHAR*)" ASSERT code ", 14); Platform_errint(code); - Platform_errstring((CHAR*)".", (LONGINT)2); + Platform_errstring((CHAR*)".", 2); } Platform_errln(); Platform_exit(__VAL(INTEGER, code)); @@ -765,7 +765,7 @@ static void Platform_TestLittleEndian (void) { INTEGER i; i = 1; - __GET((LONGINT)(SYSTEM_ADRINT)&i, Platform_LittleEndian, BOOLEAN); + __GET((SYSTEM_ADRINT)&i, Platform_LittleEndian, BOOLEAN); } __TDESC(Platform_FileIdentity, 1, 0) = {__TDFLDS("FileIdentity", 12), {-4}}; @@ -782,7 +782,7 @@ export void *Platform__init(void) Platform_TimeStart = 0; Platform_TimeStart = Platform_Time(); Platform_CWD[0] = 0x00; - Platform_getcwd((void*)Platform_CWD, ((LONGINT)(256))); + Platform_getcwd((void*)Platform_CWD, 256); Platform_PID = Platform_getpid(); Platform_SeekSet = Platform_seekset(); Platform_SeekCur = Platform_seekcur(); diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index b890523b..4c7f2849 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 4ee29f7d..f2a4b1e4 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -58,7 +58,7 @@ INTEGER Reals_Expo (REAL x) { INTEGER _o_result; INTEGER i; - __GET((LONGINT)(SYSTEM_ADRINT)&x + 2, i, INTEGER); + __GET((SYSTEM_ADRINT)&x + 2, i, INTEGER); _o_result = __MASK(__ASHR(i, 7), -256); return _o_result; } @@ -66,17 +66,17 @@ INTEGER Reals_Expo (REAL x) void Reals_SetExpo (REAL *x, INTEGER ex) { CHAR c; - __GET((LONGINT)(SYSTEM_ADRINT)x + 3, c, CHAR); - __PUT((LONGINT)(SYSTEM_ADRINT)x + 3, (CHAR)(__ASHL(__ASHR((int)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); - __GET((LONGINT)(SYSTEM_ADRINT)x + 2, c, CHAR); - __PUT((LONGINT)(SYSTEM_ADRINT)x + 2, (CHAR)(__MASK((int)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); + __GET((SYSTEM_ADRINT)x + 3, c, CHAR); + __PUT((SYSTEM_ADRINT)x + 3, (CHAR)(__ASHL(__ASHR(c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __GET((SYSTEM_ADRINT)x + 2, c, CHAR); + __PUT((SYSTEM_ADRINT)x + 2, (CHAR)(__MASK(c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } INTEGER Reals_ExpoL (LONGREAL x) { INTEGER _o_result; INTEGER i; - __GET((LONGINT)(SYSTEM_ADRINT)&x + 6, i, INTEGER); + __GET((SYSTEM_ADRINT)&x + 6, i, INTEGER); _o_result = __MASK(__ASHR(i, 4), -2048); return _o_result; } @@ -89,21 +89,21 @@ void Reals_ConvertL (LONGREAL x, INTEGER n, CHAR *d, LONGINT d__len) } k = 0; if (n > 9) { - i = (int)__ENTIER(x / (LONGREAL)(LONGREAL)1000000000); - j = (int)__ENTIER(x - i * (LONGREAL)1000000000); + i = (SYSTEM_INT32)__ENTIER(x / (LONGREAL)(LONGREAL)1000000000); + j = (SYSTEM_INT32)__ENTIER(x - i * (LONGREAL)1000000000); if (j < 0) { j = 0; } while (k < 9) { - d[__X(k, d__len)] = (CHAR)(__MOD(j, 10) + 48); + d[__X(k, d__len)] = (CHAR)((int)__MOD(j, 10) + 48); j = __DIV(j, 10); k += 1; } } else { - i = (int)__ENTIER(x); + i = (SYSTEM_INT32)__ENTIER(x); } - while (k < (int)n) { - d[__X(k, d__len)] = (CHAR)(__MOD(i, 10) + 48); + while (k < n) { + d[__X(k, d__len)] = (CHAR)((int)__MOD(i, 10) + 48); i = __DIV(i, 10); k += 1; } @@ -134,22 +134,22 @@ static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LO CHAR by; i = 0; l = b__len; - while ((int)i < l) { + while (i < l) { by = __VAL(CHAR, b[__X(i, b__len)]); - d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((int)by, 4)); - d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((int)by, -16)); + d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR(by, 4)); + d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK(by, -16)); i += 1; } } void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len) { - Reals_BytesToHex((void*)&y, ((LONGINT)(4)), (void*)d, d__len * ((LONGINT)(1))); + Reals_BytesToHex((void*)&y, 4, (void*)d, d__len * 1); } void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len) { - Reals_BytesToHex((void*)&x, ((LONGINT)(8)), (void*)d, d__len * ((LONGINT)(1))); + Reals_BytesToHex((void*)&x, 8, (void*)d, d__len * 1); } diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index 0a81ebf4..6eeb5a87 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index 0c372b8b..ec6697bf 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -21,7 +21,7 @@ INTEGER Strings_Length (CHAR *s, LONGINT s__len) INTEGER i; __DUP(s, s__len, CHAR); i = 0; - while (((int)i < s__len && s[__X(i, s__len)] != 0x00)) { + while ((i < s__len && s[__X(i, s__len)] != 0x00)) { i += 1; } _o_result = i; @@ -36,11 +36,11 @@ void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__ n1 = Strings_Length(dest, dest__len); n2 = Strings_Length(extra, extra__len); i = 0; - while ((i < n2 && (int)(i + n1) < dest__len)) { + while ((i < n2 && (i + n1) < dest__len)) { dest[__X(i + n1, dest__len)] = extra[__X(i, extra__len)]; i += 1; } - if ((int)(i + n1) < dest__len) { + if ((i + n1) < dest__len) { dest[__X(i + n1, dest__len)] = 0x00; } __DEL(extra); @@ -59,10 +59,10 @@ void Strings_Insert (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, Strings_Append(dest, dest__len, (void*)source, source__len); return; } - if ((int)(pos + n2) < dest__len) { + if ((pos + n2) < dest__len) { i = n1; while (i >= pos) { - if ((int)(i + n2) < dest__len) { + if ((i + n2) < dest__len) { dest[__X(i + n2, dest__len)] = dest[__X(i, dest__len)]; } i -= 1; @@ -91,7 +91,7 @@ void Strings_Delete (CHAR *s, LONGINT s__len, INTEGER pos, INTEGER n) s[__X(i - n, s__len)] = s[__X(i, s__len)]; i += 1; } - if ((int)(i - n) < s__len) { + if ((i - n) < s__len) { s[__X(i - n, s__len)] = 0x00; } } else { @@ -112,7 +112,7 @@ void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n, INTEGER len, destLen, i; __DUP(source, source__len, CHAR); len = Strings_Length(source, source__len); - destLen = (int)dest__len - 1; + destLen = dest__len - 1; if (pos < 0) { pos = 0; } @@ -121,7 +121,7 @@ void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n, return; } i = 0; - while (((((int)(pos + i) <= source__len && source[__X(pos + i, source__len)] != 0x00)) && i < n)) { + while (((((pos + i) <= source__len && source[__X(pos + i, source__len)] != 0x00)) && i < n)) { if (i < destLen) { dest[__X(i, dest__len)] = source[__X(pos + i, source__len)]; } diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index 0dbfdb8e..43656e74 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index c40f0930..129aa156 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Files.h" #include "Modules.h" @@ -231,7 +231,7 @@ static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len) Texts_FontsFont _o_result; Texts_FontsFont F = NIL; __NEW(F, Texts_FontDesc); - __COPY(name, F->name, ((LONGINT)(32))); + __COPY(name, F->name, 32); _o_result = F; return _o_result; } @@ -398,15 +398,15 @@ static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, LONGINT *msg__t e->file = ((Texts_Alien)E)->file; e->org = ((Texts_Alien)E)->org; e->span = ((Texts_Alien)E)->span; - __COPY(((Texts_Alien)E)->mod, e->mod, ((LONGINT)(32))); - __COPY(((Texts_Alien)E)->proc, e->proc, ((LONGINT)(32))); + __COPY(((Texts_Alien)E)->mod, e->mod, 32); + __COPY(((Texts_Alien)E)->proc, e->proc, 32); (*msg__).e = (Texts_Elem)e; } else __WITHCHK; } else if (__IS(msg__typ, Texts_IdentifyMsg, 1)) { if (__IS(msg__typ, Texts_IdentifyMsg, 1)) { Texts_IdentifyMsg *msg__ = (void*)msg; - __COPY(((Texts_Alien)E)->mod, (*msg__).mod, ((LONGINT)(32))); - __COPY(((Texts_Alien)E)->proc, (*msg__).proc, ((LONGINT)(32))); + __COPY(((Texts_Alien)E)->mod, (*msg__).mod, 32); + __COPY(((Texts_Alien)E)->proc, (*msg__).proc, 32); (*msg__).mod[31] = 0x01; } else __WITHCHK; } else if (__IS(msg__typ, Texts_FileMsg, 1)) { @@ -746,7 +746,7 @@ static void ReadScaleFactor__32 (void) } } while (('0' <= *Scan__31_s->ch && *Scan__31_s->ch <= '9')) { - *Scan__31_s->e = (*Scan__31_s->e * 10 + (int)*Scan__31_s->ch) - 48; + *Scan__31_s->e = (*Scan__31_s->e * 10 + *Scan__31_s->ch) - 48; Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); } } @@ -780,21 +780,21 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) } if ((('A' <= __CAP(ch) && __CAP(ch) <= 'Z') || ch == '/') || ch == '.') { do { - (*S).s[__X(i, ((LONGINT)(64)))] = ch; + (*S).s[__X(i, 64)] = ch; i += 1; Texts_Read((void*)&*S, S__typ, &ch); } while (!((((__CAP(ch) > 'Z' && ch != '_') || ('A' > __CAP(ch) && ch > '9')) || ((('0' > ch && ch != '.')) && ch != '/')) || i == 63)); - (*S).s[__X(i, ((LONGINT)(64)))] = 0x00; + (*S).s[__X(i, 64)] = 0x00; (*S).len = i; (*S).class = 1; } else if (ch == '"') { Texts_Read((void*)&*S, S__typ, &ch); while ((((ch != '"' && ch >= ' ')) && i != 63)) { - (*S).s[__X(i, ((LONGINT)(64)))] = ch; + (*S).s[__X(i, 64)] = ch; i += 1; Texts_Read((void*)&*S, S__typ, &ch); } - (*S).s[__X(i, ((LONGINT)(64)))] = 0x00; + (*S).s[__X(i, 64)] = 0x00; (*S).len = i + 1; Texts_Read((void*)&*S, S__typ, &ch); (*S).class = 2; @@ -809,7 +809,7 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) hex = 0; j = 0; for (;;) { - d[__X(i, ((LONGINT)(32)))] = ch; + d[__X(i, 32)] = ch; i += 1; Texts_Read((void*)&*S, S__typ, &ch); if (ch < '0') { @@ -818,10 +818,10 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) if ('9' < ch) { if (('A' <= ch && ch <= 'F')) { hex = 1; - ch = (CHAR)((int)ch - 7); + ch = (CHAR)(ch - 7); } else if (('a' <= ch && ch <= 'f')) { hex = 1; - ch = (CHAR)((int)ch - 39); + ch = (CHAR)(ch - 39); } else { break; } @@ -833,13 +833,13 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) if (i - j > 8) { j = i - 8; } - k = (int)d[__X(j, ((LONGINT)(32)))] - 48; + k = d[__X(j, 32)] - 48; j += 1; if ((i - j == 7 && k >= 8)) { k -= 16; } while (j < i) { - k = __ASHL(k, 4) + (int)((int)d[__X(j, ((LONGINT)(32)))] - 48); + k = __ASHL(k, 4) + (d[__X(j, 32)] - 48); j += 1; } if (neg) { @@ -851,7 +851,7 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) Texts_Read((void*)&*S, S__typ, &ch); h = i; while (('0' <= ch && ch <= '9')) { - d[__X(i, ((LONGINT)(32)))] = ch; + d[__X(i, 32)] = ch; i += 1; Texts_Read((void*)&*S, S__typ, &ch); } @@ -860,12 +860,12 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) y = (LONGREAL)0; g = (LONGREAL)1; do { - y = y * (LONGREAL)10 + ((int)d[__X(j, ((LONGINT)(32)))] - 48); + y = y * (LONGREAL)10 + (d[__X(j, 32)] - 48); j += 1; } while (!(j == h)); while (j < i) { g = g / (LONGREAL)(LONGREAL)10; - y = ((int)d[__X(j, ((LONGINT)(32)))] - 48) * g + y; + y = (d[__X(j, 32)] - 48) * g + y; j += 1; } ReadScaleFactor__32(); @@ -892,12 +892,12 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) x = (REAL)0; f = (REAL)1; do { - x = x * (REAL)10 + ((int)d[__X(j, ((LONGINT)(32)))] - 48); + x = x * (REAL)10 + (d[__X(j, 32)] - 48); j += 1; } while (!(j == h)); while (j < i) { f = f / (REAL)(REAL)10; - x = ((int)d[__X(j, ((LONGINT)(32)))] - 48) * f + x; + x = (d[__X(j, 32)] - 48) * f + x; j += 1; } if (ch == 'E') { @@ -929,7 +929,7 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) (*S).class = 3; k = 0; do { - k = k * 10 + (int)((int)d[__X(j, ((LONGINT)(32)))] - 48); + k = k * 10 + (d[__X(j, 32)] - 48); j += 1; } while (!(j == i)); if (neg) { @@ -964,8 +964,8 @@ void Texts_OpenWriter (Texts_Writer *W, LONGINT *W__typ) (*W).fnt = Texts_FontsDefault; (*W).col = 15; (*W).voff = 0; - (*W).file = Files_New((CHAR*)"", (LONGINT)1); - Files_Set(&(*W).rider, Files_Rider__typ, (*W).file, ((LONGINT)(0))); + (*W).file = Files_New((CHAR*)"", 1); + Files_Set(&(*W).rider, Files_Rider__typ, (*W).file, 0); } void Texts_SetFont (Texts_Writer *W, LONGINT *W__typ, Texts_FontsFont fnt) @@ -1053,7 +1053,7 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n) i = 0; if (x < 0) { if (x == (-2147483647-1)) { - Texts_WriteString(&*W, W__typ, (CHAR*)" -2147483648", (LONGINT)13); + Texts_WriteString(&*W, W__typ, (CHAR*)" -2147483648", 13); return; } else { n -= 1; @@ -1063,11 +1063,11 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n) x0 = x; } do { - a[__X(i, ((LONGINT)(22)))] = (CHAR)(__MOD(x0, 10) + 48); + a[__X(i, 22)] = (CHAR)((int)__MOD(x0, 10) + 48); x0 = __DIV(x0, 10); i += 1; } while (!(x0 == 0)); - while (n > (int)i) { + while (n > i) { Texts_Write(&*W, W__typ, ' '); n -= 1; } @@ -1076,7 +1076,7 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n) } do { i -= 1; - Texts_Write(&*W, W__typ, a[__X(i, ((LONGINT)(22)))]); + Texts_Write(&*W, W__typ, a[__X(i, 22)]); } while (!(i == 0)); } @@ -1090,16 +1090,16 @@ void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, LONGINT x) do { y = __MASK(x, -16); if (y < 10) { - a[__X(i, ((LONGINT)(20)))] = (CHAR)(y + 48); + a[__X(i, 20)] = (CHAR)(y + 48); } else { - a[__X(i, ((LONGINT)(20)))] = (CHAR)(y + 55); + a[__X(i, 20)] = (CHAR)(y + 55); } x = __ASHR(x, 4); i += 1; } while (!(i == 8)); do { i -= 1; - Texts_Write(&*W, W__typ, a[__X(i, ((LONGINT)(20)))]); + Texts_Write(&*W, W__typ, a[__X(i, 20)]); } while (!(i == 0)); } @@ -1110,13 +1110,13 @@ void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n) CHAR d[9]; e = Reals_Expo(x); if (e == 0) { - Texts_WriteString(&*W, W__typ, (CHAR*)" 0", (LONGINT)4); + Texts_WriteString(&*W, W__typ, (CHAR*)" 0", 4); do { Texts_Write(&*W, W__typ, ' '); n -= 1; } while (!(n <= 3)); } else if (e == 255) { - Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", (LONGINT)5); + Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", 5); while (n > 4) { Texts_Write(&*W, W__typ, ' '); n -= 1; @@ -1153,13 +1153,13 @@ void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n) x = x * 1.0000000e-001; e += 1; } - Reals_Convert(x, n, (void*)d, ((LONGINT)(9))); + Reals_Convert(x, n, (void*)d, 9); n -= 1; - Texts_Write(&*W, W__typ, d[__X(n, ((LONGINT)(9)))]); + Texts_Write(&*W, W__typ, d[__X(n, 9)]); Texts_Write(&*W, W__typ, '.'); do { n -= 1; - Texts_Write(&*W, W__typ, d[__X(n, ((LONGINT)(9)))]); + Texts_Write(&*W, W__typ, d[__X(n, 9)]); } while (!(n == 0)); Texts_Write(&*W, W__typ, 'E'); if (e < 0) { @@ -1196,7 +1196,7 @@ static void dig__54 (INTEGER n) { while (n > 0) { *WriteRealFix__53_s->i -= 1; - Texts_Write(&*WriteRealFix__53_s->W, WriteRealFix__53_s->W__typ, (*WriteRealFix__53_s->d)[__X(*WriteRealFix__53_s->i, ((LONGINT)(9)))]); + Texts_Write(&*WriteRealFix__53_s->W, WriteRealFix__53_s->W__typ, (*WriteRealFix__53_s->d)[__X(*WriteRealFix__53_s->i, 9)]); n -= 1; } } @@ -1222,7 +1222,7 @@ void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n, IN Texts_Write(&*W, W__typ, '0'); seq__56(' ', k + 1); } else if (e == 255) { - Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", (LONGINT)5); + Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", 5); seq__56(' ', n - 4); } else { e = __ASHR((e - 127) * 77, 8); @@ -1254,7 +1254,7 @@ void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n, IN } e += 1; i = k + e; - Reals_Convert(x, i, (void*)d, ((LONGINT)(9))); + Reals_Convert(x, i, (void*)d, 9); if (e > 0) { seq__56(' ', ((n - e) - k) - 2); Texts_Write(&*W, W__typ, sign); @@ -1277,10 +1277,10 @@ void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x) { INTEGER i; CHAR d[8]; - Reals_ConvertH(x, (void*)d, ((LONGINT)(8))); + Reals_ConvertH(x, (void*)d, 8); i = 0; do { - Texts_Write(&*W, W__typ, d[__X(i, ((LONGINT)(8)))]); + Texts_Write(&*W, W__typ, d[__X(i, 8)]); i += 1; } while (!(i == 8)); } @@ -1292,13 +1292,13 @@ void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER CHAR d[16]; e = Reals_ExpoL(x); if (e == 0) { - Texts_WriteString(&*W, W__typ, (CHAR*)" 0", (LONGINT)4); + Texts_WriteString(&*W, W__typ, (CHAR*)" 0", 4); do { Texts_Write(&*W, W__typ, ' '); n -= 1; } while (!(n <= 3)); } else if (e == 2047) { - Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", (LONGINT)5); + Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", 5); while (n > 4) { Texts_Write(&*W, W__typ, ' '); n -= 1; @@ -1319,7 +1319,7 @@ void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER } else { Texts_Write(&*W, W__typ, ' '); } - e = (int)__ASHR((int)(e - 1023) * 77, 8); + e = __ASHR((e - 1023) * 77, 8); if (e >= 0) { x = x / (LONGREAL)Reals_TenL(e); } else { @@ -1335,13 +1335,13 @@ void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER x = 1.00000000000000e-001 * x; e += 1; } - Reals_ConvertL(x, n, (void*)d, ((LONGINT)(16))); + Reals_ConvertL(x, n, (void*)d, 16); n -= 1; - Texts_Write(&*W, W__typ, d[__X(n, ((LONGINT)(16)))]); + Texts_Write(&*W, W__typ, d[__X(n, 16)]); Texts_Write(&*W, W__typ, '.'); do { n -= 1; - Texts_Write(&*W, W__typ, d[__X(n, ((LONGINT)(16)))]); + Texts_Write(&*W, W__typ, d[__X(n, 16)]); } while (!(n == 0)); Texts_Write(&*W, W__typ, 'D'); if (e < 0) { @@ -1361,10 +1361,10 @@ void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x) { INTEGER i; CHAR d[16]; - Reals_ConvertHL(x, (void*)d, ((LONGINT)(16))); + Reals_ConvertHL(x, (void*)d, 16); i = 0; do { - Texts_Write(&*W, W__typ, d[__X(i, ((LONGINT)(16)))]); + Texts_Write(&*W, W__typ, d[__X(i, 16)]); i += 1; } while (!(i == 16)); } @@ -1381,7 +1381,7 @@ static void WritePair__44 (CHAR ch, LONGINT x) { Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, ch); Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)(__DIV(x, 10) + 48)); - Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)(__MOD(x, 10) + 48)); + Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)((int)__MOD(x, 10) + 48)); } void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, LONGINT t, LONGINT d) @@ -1423,13 +1423,13 @@ static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, LONGINT Files_Read(&*r, r__typ, (void*)&eno); if (eno > *Load0__16_s->ecnt) { *Load0__16_s->ecnt = eno; - Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->mods)[__X(eno, ((LONGINT)(64)))], ((LONGINT)(32))); - Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->procs)[__X(eno, ((LONGINT)(64)))], ((LONGINT)(32))); + Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->mods)[__X(eno, 64)], 32); + Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->procs)[__X(eno, 64)], 32); } org = Files_Pos(&*r, r__typ); - M = Modules_ThisMod((*Load0__16_s->mods)[__X(eno, ((LONGINT)(64)))], ((LONGINT)(32))); + M = Modules_ThisMod((*Load0__16_s->mods)[__X(eno, 64)], 32); if (M != NIL) { - Cmd = Modules_ThisCommand(M, (*Load0__16_s->procs)[__X(eno, ((LONGINT)(64)))], ((LONGINT)(32))); + Cmd = Modules_ThisCommand(M, (*Load0__16_s->procs)[__X(eno, 64)], 32); if (Cmd != NIL) { (*Cmd)(); } @@ -1455,8 +1455,8 @@ static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, LONGINT a->file = *Load0__16_s->f; a->org = org; a->span = span; - __COPY((*Load0__16_s->mods)[__X(eno, ((LONGINT)(64)))], a->mod, ((LONGINT)(32))); - __COPY((*Load0__16_s->procs)[__X(eno, ((LONGINT)(64)))], a->proc, ((LONGINT)(32))); + __COPY((*Load0__16_s->mods)[__X(eno, 64)], a->mod, 32); + __COPY((*Load0__16_s->procs)[__X(eno, 64)], a->proc, 32); *e = (Texts_Elem)a; } } @@ -1500,8 +1500,8 @@ static void Texts_Load0 (Files_Rider *r, LONGINT *r__typ, Texts_Text T) while (fno != 0) { if (fno > fcnt) { fcnt = fno; - Files_ReadString(&msg.r, Files_Rider__typ, (void*)name, ((LONGINT)(32))); - fnts[__X(fno, ((LONGINT)(32)))] = Texts_FontsThis((void*)name, ((LONGINT)(32))); + Files_ReadString(&msg.r, Files_Rider__typ, (void*)name, 32); + fnts[__X(fno, 32)] = Texts_FontsThis((void*)name, 32); } Files_Read(&msg.r, Files_Rider__typ, (void*)&col); Files_Read(&msg.r, Files_Rider__typ, (void*)&voff); @@ -1556,9 +1556,9 @@ void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len) __DUP(name, name__len, CHAR); f = Files_Old(name, name__len); if (f == NIL) { - f = Files_New((CHAR*)"", (LONGINT)1); + f = Files_New((CHAR*)"", 1); } - Files_Set(&r, Files_Rider__typ, f, ((LONGINT)(0))); + Files_Set(&r, Files_Rider__typ, f, 0); Files_Read(&r, Files_Rider__typ, (void*)&tag); Files_Read(&r, Files_Rider__typ, (void*)&version); if (tag == 0xf0 || (tag == 0x01 && version == 0xf0)) { @@ -1570,7 +1570,7 @@ void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len) u->col = 15; __NEW(p, Texts_PieceDesc); if ((tag == 0xf7 && version == 0x07)) { - Files_Set(&r, Files_Rider__typ, f, ((LONGINT)(28))); + Files_Set(&r, Files_Rider__typ, f, 28); Files_ReadLInt(&r, Files_Rider__typ, &hlen); Files_Set(&r, Files_Rider__typ, f, 22 + hlen); Files_ReadLInt(&r, Files_Rider__typ, &T->len); @@ -1616,21 +1616,21 @@ static void StoreElem__40 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, Texts_E Files_Rider r1; LONGINT org, span; SHORTINT eno; - __COPY((*Store__39_s->iden).mod, (*Store__39_s->mods)[__X(*Store__39_s->ecnt, ((LONGINT)(64)))], ((LONGINT)(32))); - __COPY((*Store__39_s->iden).proc, (*Store__39_s->procs)[__X(*Store__39_s->ecnt, ((LONGINT)(64)))], ((LONGINT)(32))); + __COPY((*Store__39_s->iden).mod, (*Store__39_s->mods)[__X(*Store__39_s->ecnt, 64)], 32); + __COPY((*Store__39_s->iden).proc, (*Store__39_s->procs)[__X(*Store__39_s->ecnt, 64)], 32); eno = 1; - while (__STRCMP((*Store__39_s->mods)[__X(eno, ((LONGINT)(64)))], (*Store__39_s->iden).mod) != 0 || __STRCMP((*Store__39_s->procs)[__X(eno, ((LONGINT)(64)))], (*Store__39_s->iden).proc) != 0) { + while (__STRCMP((*Store__39_s->mods)[__X(eno, 64)], (*Store__39_s->iden).mod) != 0 || __STRCMP((*Store__39_s->procs)[__X(eno, 64)], (*Store__39_s->iden).proc) != 0) { eno += 1; } Files_Set(&r1, Files_Rider__typ, Files_Base(&*r, r__typ), Files_Pos(&*r, r__typ)); - Files_WriteLInt(&*r, r__typ, ((LONGINT)(0))); - Files_WriteLInt(&*r, r__typ, ((LONGINT)(0))); - Files_WriteLInt(&*r, r__typ, ((LONGINT)(0))); + Files_WriteLInt(&*r, r__typ, 0); + Files_WriteLInt(&*r, r__typ, 0); + Files_WriteLInt(&*r, r__typ, 0); Files_Write(&*r, r__typ, eno); if (eno == *Store__39_s->ecnt) { *Store__39_s->ecnt += 1; - Files_WriteString(&*r, r__typ, (*Store__39_s->iden).mod, ((LONGINT)(32))); - Files_WriteString(&*r, r__typ, (*Store__39_s->iden).proc, ((LONGINT)(32))); + Files_WriteString(&*r, r__typ, (*Store__39_s->iden).mod, 32); + Files_WriteString(&*r, r__typ, (*Store__39_s->iden).proc, 32); } (*Store__39_s->msg).pos = pos; org = Files_Pos(&*r, r__typ); @@ -1665,7 +1665,7 @@ void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T) org = Files_Pos(&*r, r__typ); msg.id = 1; msg.r = *r; - Files_WriteLInt(&msg.r, Files_Rider__typ, ((LONGINT)(0))); + Files_WriteLInt(&msg.r, Files_Rider__typ, 0); u = T->head->next; pos = 0; delta = 0; @@ -1679,15 +1679,15 @@ void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T) iden.mod[0] = 0x01; } if (iden.mod[0] != 0x00) { - fnts[__X(fcnt, ((LONGINT)(32)))] = u->fnt; + fnts[__X(fcnt, 32)] = u->fnt; fno = 1; - while (__STRCMP(fnts[__X(fno, ((LONGINT)(32)))]->name, u->fnt->name) != 0) { + while (__STRCMP(fnts[__X(fno, 32)]->name, u->fnt->name) != 0) { fno += 1; } Files_Write(&msg.r, Files_Rider__typ, fno); if (fno == fcnt) { fcnt += 1; - Files_WriteString(&msg.r, Files_Rider__typ, u->fnt->name, ((LONGINT)(32))); + Files_WriteString(&msg.r, Files_Rider__typ, u->fnt->name, 32); } Files_Write(&msg.r, Files_Rider__typ, u->col); Files_Write(&msg.r, Files_Rider__typ, u->voff); @@ -1736,12 +1736,12 @@ void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T) Files_Set(&r1, Files_Rider__typ, ((Texts_Piece)u)->file, ((Texts_Piece)u)->org); delta = ((Texts_Piece)u)->len; while (delta > 1024) { - Files_ReadBytes(&r1, Files_Rider__typ, (void*)block, ((LONGINT)(1024)), ((LONGINT)(1024))); - Files_WriteBytes(&msg.r, Files_Rider__typ, (void*)block, ((LONGINT)(1024)), ((LONGINT)(1024))); + Files_ReadBytes(&r1, Files_Rider__typ, (void*)block, 1024, 1024); + Files_WriteBytes(&msg.r, Files_Rider__typ, (void*)block, 1024, 1024); delta -= 1024; } - Files_ReadBytes(&r1, Files_Rider__typ, (void*)block, ((LONGINT)(1024)), delta); - Files_WriteBytes(&msg.r, Files_Rider__typ, (void*)block, ((LONGINT)(1024)), delta); + Files_ReadBytes(&r1, Files_Rider__typ, (void*)block, 1024, delta); + Files_WriteBytes(&msg.r, Files_Rider__typ, (void*)block, 1024, delta); } } else __WITHCHK; } else { @@ -1755,7 +1755,7 @@ void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T) } __GUARDEQR(r, r__typ, Files_Rider) = msg.r; if (T->notify != NIL) { - (*T->notify)(T, 3, ((LONGINT)(0)), ((LONGINT)(0))); + (*T->notify)(T, 3, 0, 0); } Store__39_s = _s.lnk; } @@ -1768,7 +1768,7 @@ void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len) CHAR bak[64]; __DUP(name, name__len, CHAR); f = Files_New(name, name__len); - Files_Set(&r, Files_Rider__typ, f, ((LONGINT)(0))); + Files_Set(&r, Files_Rider__typ, f, 0); Files_Write(&r, Files_Rider__typ, 0xf0); Files_Write(&r, Files_Rider__typ, 0x01); Texts_Store(&r, Files_Rider__typ, T); @@ -1776,13 +1776,13 @@ void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len) while (name[__X(i, name__len)] != 0x00) { i += 1; } - __COPY(name, bak, ((LONGINT)(64))); - bak[__X(i, ((LONGINT)(64)))] = '.'; - bak[__X(i + 1, ((LONGINT)(64)))] = 'B'; - bak[__X(i + 2, ((LONGINT)(64)))] = 'a'; - bak[__X(i + 3, ((LONGINT)(64)))] = 'k'; - bak[__X(i + 4, ((LONGINT)(64)))] = 0x00; - Files_Rename(name, name__len, bak, ((LONGINT)(64)), &res); + __COPY(name, bak, 64); + bak[__X(i, 64)] = '.'; + bak[__X(i + 1, 64)] = 'B'; + bak[__X(i + 2, 64)] = 'a'; + bak[__X(i + 3, 64)] = 'k'; + bak[__X(i + 4, 64)] = 0x00; + Files_Rename(name, name__len, bak, 64, &res); Files_Register(f); __DEL(name); } diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index 99931953..be79016b 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/Vishap.c b/bootstrap/unix-48/Vishap.c index e8b1e4d1..7c16c24d 100644 --- a/bootstrap/unix-48/Vishap.c +++ b/bootstrap/unix-48/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkamSf */ #include "SYSTEM.h" #include "Configuration.h" #include "Heap.h" @@ -33,31 +33,31 @@ void Vishap_Module (BOOLEAN *done) OPV_AdrAndSize(OPT_topScope); OPT_Export(&ext, &new); if (OPM_noerr) { - OPM_OpenFiles((void*)OPT_SelfName, ((LONGINT)(256))); + OPM_OpenFiles((void*)OPT_SelfName, 256); OPC_Init(); OPV_Module(p); if (OPM_noerr) { if (((OPM_mainProg || OPM_mainLinkStat) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { OPM_DeleteNewSym(); if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"32m", (LONGINT)4); + vt100_SetAttr((CHAR*)"32m", 4); } - OPM_LogWStr((CHAR*)" Main program.", (LONGINT)16); + OPM_LogWStr((CHAR*)" Main program.", 16); if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + vt100_SetAttr((CHAR*)"0m", 3); } } else { if (new) { if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"32m", (LONGINT)4); + vt100_SetAttr((CHAR*)"32m", 4); } - OPM_LogWStr((CHAR*)" New symbol file.", (LONGINT)19); + OPM_LogWStr((CHAR*)" New symbol file.", 19); if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + vt100_SetAttr((CHAR*)"0m", 3); } OPM_RegisterNewSym(); } else if (ext) { - OPM_LogWStr((CHAR*)" Extended symbol file.", (LONGINT)24); + OPM_LogWStr((CHAR*)" Extended symbol file.", 24); OPM_RegisterNewSym(); } } @@ -94,7 +94,7 @@ void Vishap_Translate (void) modulesobj[0] = 0x00; if (OPM_OpenPar()) { for (;;) { - OPM_Init(&done, (void*)Vishap_mname, ((LONGINT)(256))); + OPM_Init(&done, (void*)Vishap_mname, 256); if (!done) { return; } @@ -104,21 +104,21 @@ void Vishap_Translate (void) Vishap_Module(&done); if (!done) { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Module compilation failed.", (LONGINT)27); + OPM_LogWStr((CHAR*)"Module compilation failed.", 27); OPM_LogWLn(); Platform_Exit(1); } if (!OPM_dontAsm) { if (OPM_dontLink) { - extTools_Assemble(OPM_modName, ((LONGINT)(32))); + extTools_Assemble(OPM_modName, 32); } else { if (!(OPM_mainProg || OPM_mainLinkStat)) { - extTools_Assemble(OPM_modName, ((LONGINT)(32))); - Strings_Append((CHAR*)" ", (LONGINT)2, (void*)modulesobj, ((LONGINT)(2048))); - Strings_Append(OPM_modName, ((LONGINT)(32)), (void*)modulesobj, ((LONGINT)(2048))); - Strings_Append((CHAR*)".o", (LONGINT)3, (void*)modulesobj, ((LONGINT)(2048))); + extTools_Assemble(OPM_modName, 32); + Strings_Append((CHAR*)" ", 2, (void*)modulesobj, 2048); + Strings_Append(OPM_modName, 32, (void*)modulesobj, 2048); + Strings_Append((CHAR*)".o", 3, (void*)modulesobj, 2048); } else { - extTools_LinkMain((void*)OPM_modName, ((LONGINT)(32)), OPM_mainLinkStat, modulesobj, ((LONGINT)(2048))); + extTools_LinkMain((void*)OPM_modName, 32, OPM_mainLinkStat, modulesobj, 2048); } } } @@ -133,7 +133,7 @@ static void Vishap_Trap (INTEGER sig) Platform_Exit(0); } else { if ((sig == 4 && Platform_HaltCode == -15)) { - OPM_LogWStr((CHAR*)" --- Vishap Oberon: internal error", (LONGINT)35); + OPM_LogWStr((CHAR*)" --- Vishap Oberon: internal error", 35); OPM_LogWLn(); } Platform_Exit(2); diff --git a/bootstrap/unix-48/errors.c b/bootstrap/unix-48/errors.c index a8573f9a..7a91fc31 100644 --- a/bootstrap/unix-48/errors.c +++ b/bootstrap/unix-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/unix-48/errors.h b/bootstrap/unix-48/errors.h index 6dfe7b1d..4a787a17 100644 --- a/bootstrap/unix-48/errors.h +++ b/bootstrap/unix-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index d2141803..cfb79ac9 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" @@ -35,14 +35,14 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN Console_String(title, title__len); Console_String(cmd, cmd__len); Console_Ln(); - Console_String((CHAR*)"-- failed: status ", (LONGINT)19); - Console_Int(status, ((LONGINT)(1))); - Console_String((CHAR*)", exitcode ", (LONGINT)12); - Console_Int(exitcode, ((LONGINT)(1))); - Console_String((CHAR*)".", (LONGINT)2); + Console_String((CHAR*)"-- failed: status ", 19); + Console_Int(status, 1); + Console_String((CHAR*)", exitcode ", 12); + Console_Int(exitcode, 1); + Console_String((CHAR*)".", 2); Console_Ln(); if ((status == 0 && exitcode == 127)) { - Console_String((CHAR*)"Is the C compiler in the current command path\?", (LONGINT)47); + Console_String((CHAR*)"Is the C compiler in the current command path\?", 47); Console_Ln(); } if (status != 0) { @@ -60,11 +60,11 @@ void extTools_Assemble (CHAR *moduleName, LONGINT moduleName__len) CHAR cmd[1023]; __DUP(moduleName, moduleName__len, CHAR); __MOVE("gcc -g", cmd, 7); - Strings_Append(extTools_compilationOptions, ((LONGINT)(1023)), (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)"-c ", (LONGINT)4, (void*)cmd, ((LONGINT)(1023))); - Strings_Append(moduleName, moduleName__len, (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)".c", (LONGINT)3, (void*)cmd, ((LONGINT)(1023))); - extTools_execute((CHAR*)"Assemble: ", (LONGINT)11, cmd, ((LONGINT)(1023))); + Strings_Append(extTools_compilationOptions, 1023, (void*)cmd, 1023); + Strings_Append((CHAR*)"-c ", 4, (void*)cmd, 1023); + Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); + Strings_Append((CHAR*)".c", 3, (void*)cmd, 1023); + extTools_execute((CHAR*)"Assemble: ", 11, cmd, 1023); __DEL(moduleName); } @@ -73,21 +73,21 @@ void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN stati CHAR cmd[1023]; __DUP(additionalopts, additionalopts__len, CHAR); __MOVE("gcc -g", cmd, 7); - Strings_Append((CHAR*)" ", (LONGINT)2, (void*)cmd, ((LONGINT)(1023))); - Strings_Append(extTools_compilationOptions, ((LONGINT)(1023)), (void*)cmd, ((LONGINT)(1023))); - Strings_Append(moduleName, moduleName__len, (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)".c ", (LONGINT)4, (void*)cmd, ((LONGINT)(1023))); - Strings_Append(additionalopts, additionalopts__len, (void*)cmd, ((LONGINT)(1023))); + Strings_Append((CHAR*)" ", 2, (void*)cmd, 1023); + Strings_Append(extTools_compilationOptions, 1023, (void*)cmd, 1023); + Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); + Strings_Append((CHAR*)".c ", 4, (void*)cmd, 1023); + Strings_Append(additionalopts, additionalopts__len, (void*)cmd, 1023); if (statically) { - Strings_Append((CHAR*)"-static", (LONGINT)8, (void*)cmd, ((LONGINT)(1023))); + Strings_Append((CHAR*)"-static", 8, (void*)cmd, 1023); } - Strings_Append((CHAR*)" -o ", (LONGINT)5, (void*)cmd, ((LONGINT)(1023))); - Strings_Append(moduleName, moduleName__len, (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)" -L\"", (LONGINT)5, (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)"/opt/voc", (LONGINT)9, (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)"/lib\"", (LONGINT)6, (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)" -l voc", (LONGINT)8, (void*)cmd, ((LONGINT)(1023))); - extTools_execute((CHAR*)"Assemble and link: ", (LONGINT)20, cmd, ((LONGINT)(1023))); + Strings_Append((CHAR*)" -o ", 5, (void*)cmd, 1023); + Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); + Strings_Append((CHAR*)" -L\"", 5, (void*)cmd, 1023); + Strings_Append((CHAR*)"/opt/voc", 9, (void*)cmd, 1023); + Strings_Append((CHAR*)"/lib\"", 6, (void*)cmd, 1023); + Strings_Append((CHAR*)" -l voc", 8, (void*)cmd, 1023); + extTools_execute((CHAR*)"Assemble and link: ", 20, cmd, 1023); __DEL(additionalopts); } @@ -102,11 +102,11 @@ export void *extTools__init(void) __MODULE_IMPORT(Strings); __REGMOD("extTools", 0); /* BEGIN */ - Strings_Append((CHAR*)" -I \"", (LONGINT)6, (void*)extTools_compilationOptions, ((LONGINT)(1023))); - Strings_Append((CHAR*)"/opt/voc", (LONGINT)9, (void*)extTools_compilationOptions, ((LONGINT)(1023))); - Strings_Append((CHAR*)"/include\" ", (LONGINT)11, (void*)extTools_compilationOptions, ((LONGINT)(1023))); - Platform_GetEnv((CHAR*)"CFLAGS", (LONGINT)7, (void*)extTools_CFLAGS, ((LONGINT)(1023))); - Strings_Append(extTools_CFLAGS, ((LONGINT)(1023)), (void*)extTools_compilationOptions, ((LONGINT)(1023))); - Strings_Append((CHAR*)" ", (LONGINT)2, (void*)extTools_compilationOptions, ((LONGINT)(1023))); + Strings_Append((CHAR*)" -I \"", 6, (void*)extTools_compilationOptions, 1023); + Strings_Append((CHAR*)"/opt/voc", 9, (void*)extTools_compilationOptions, 1023); + Strings_Append((CHAR*)"/include\" ", 11, (void*)extTools_compilationOptions, 1023); + Platform_GetEnv((CHAR*)"CFLAGS", 7, (void*)extTools_CFLAGS, 1023); + Strings_Append(extTools_CFLAGS, 1023, (void*)extTools_compilationOptions, 1023); + Strings_Append((CHAR*)" ", 2, (void*)extTools_compilationOptions, 1023); __ENDMOD; } diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index 38d2da7b..fb0797f3 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/vt100.c b/bootstrap/unix-48/vt100.c index 5eb4f70e..dfe62efa 100644 --- a/bootstrap/unix-48/vt100.c +++ b/bootstrap/unix-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Strings.h" @@ -68,12 +68,12 @@ void vt100_IntToStr (LONGINT int_, CHAR *str, LONGINT str__len) } e = s; do { - b[__X(e, ((LONGINT)(21)))] = (CHAR)(__MOD(int_, 10) + 48); + b[__X(e, 21)] = (CHAR)((int)__MOD(int_, 10) + 48); int_ = __DIV(int_, 10); e += 1; } while (!(int_ == 0)); - b[__X(e, ((LONGINT)(21)))] = 0x00; - vt100_Reverse0((void*)b, ((LONGINT)(21)), s, e - 1); + b[__X(e, 21)] = 0x00; + vt100_Reverse0((void*)b, 21, s, e - 1); } __COPY(b, str, str__len); } @@ -82,9 +82,9 @@ static void vt100_EscSeq0 (CHAR *letter, LONGINT letter__len) { CHAR cmd[9]; __DUP(letter, letter__len, CHAR); - __COPY(vt100_CSI, cmd, ((LONGINT)(9))); - Strings_Append(letter, letter__len, (void*)cmd, ((LONGINT)(9))); - Console_String(cmd, ((LONGINT)(9))); + __COPY(vt100_CSI, cmd, 9); + Strings_Append(letter, letter__len, (void*)cmd, 9); + Console_String(cmd, 9); __DEL(letter); } @@ -93,11 +93,11 @@ static void vt100_EscSeq (INTEGER n, CHAR *letter, LONGINT letter__len) CHAR nstr[2]; CHAR cmd[7]; __DUP(letter, letter__len, CHAR); - vt100_IntToStr(n, (void*)nstr, ((LONGINT)(2))); - __COPY(vt100_CSI, cmd, ((LONGINT)(7))); - Strings_Append(nstr, ((LONGINT)(2)), (void*)cmd, ((LONGINT)(7))); - Strings_Append(letter, letter__len, (void*)cmd, ((LONGINT)(7))); - Console_String(cmd, ((LONGINT)(7))); + vt100_IntToStr(n, (void*)nstr, 2); + __COPY(vt100_CSI, cmd, 7); + Strings_Append(nstr, 2, (void*)cmd, 7); + Strings_Append(letter, letter__len, (void*)cmd, 7); + Console_String(cmd, 7); __DEL(letter); } @@ -106,11 +106,11 @@ static void vt100_EscSeqSwapped (INTEGER n, CHAR *letter, LONGINT letter__len) CHAR nstr[2]; CHAR cmd[7]; __DUP(letter, letter__len, CHAR); - vt100_IntToStr(n, (void*)nstr, ((LONGINT)(2))); - __COPY(vt100_CSI, cmd, ((LONGINT)(7))); - Strings_Append(letter, letter__len, (void*)cmd, ((LONGINT)(7))); - Strings_Append(nstr, ((LONGINT)(2)), (void*)cmd, ((LONGINT)(7))); - Console_String(cmd, ((LONGINT)(7))); + vt100_IntToStr(n, (void*)nstr, 2); + __COPY(vt100_CSI, cmd, 7); + Strings_Append(letter, letter__len, (void*)cmd, 7); + Strings_Append(nstr, 2, (void*)cmd, 7); + Console_String(cmd, 7); __DEL(letter); } @@ -119,124 +119,124 @@ static void vt100_EscSeq2 (INTEGER n, INTEGER m, CHAR *letter, LONGINT letter__l CHAR nstr[5], mstr[5]; CHAR cmd[12]; __DUP(letter, letter__len, CHAR); - vt100_IntToStr(n, (void*)nstr, ((LONGINT)(5))); - vt100_IntToStr(m, (void*)mstr, ((LONGINT)(5))); - __COPY(vt100_CSI, cmd, ((LONGINT)(12))); - Strings_Append(nstr, ((LONGINT)(5)), (void*)cmd, ((LONGINT)(12))); - Strings_Append((CHAR*)";", (LONGINT)2, (void*)cmd, ((LONGINT)(12))); - Strings_Append(mstr, ((LONGINT)(5)), (void*)cmd, ((LONGINT)(12))); - Strings_Append(letter, letter__len, (void*)cmd, ((LONGINT)(12))); - Console_String(cmd, ((LONGINT)(12))); + vt100_IntToStr(n, (void*)nstr, 5); + vt100_IntToStr(m, (void*)mstr, 5); + __COPY(vt100_CSI, cmd, 12); + Strings_Append(nstr, 5, (void*)cmd, 12); + Strings_Append((CHAR*)";", 2, (void*)cmd, 12); + Strings_Append(mstr, 5, (void*)cmd, 12); + Strings_Append(letter, letter__len, (void*)cmd, 12); + Console_String(cmd, 12); __DEL(letter); } void vt100_CUU (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"A", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"A", 2); } void vt100_CUD (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"B", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"B", 2); } void vt100_CUF (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"C", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"C", 2); } void vt100_CUB (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"D", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"D", 2); } void vt100_CNL (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"E", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"E", 2); } void vt100_CPL (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"F", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"F", 2); } void vt100_CHA (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"G", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"G", 2); } void vt100_CUP (INTEGER n, INTEGER m) { - vt100_EscSeq2(n, m, (CHAR*)"H", (LONGINT)2); + vt100_EscSeq2(n, m, (CHAR*)"H", 2); } void vt100_ED (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"J", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"J", 2); } void vt100_EL (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"K", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"K", 2); } void vt100_SU (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"S", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"S", 2); } void vt100_SD (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"T", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"T", 2); } void vt100_HVP (INTEGER n, INTEGER m) { - vt100_EscSeq2(n, m, (CHAR*)"f", (LONGINT)2); + vt100_EscSeq2(n, m, (CHAR*)"f", 2); } void vt100_SGR (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"m", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"m", 2); } void vt100_SGR2 (INTEGER n, INTEGER m) { - vt100_EscSeq2(n, m, (CHAR*)"m", (LONGINT)2); + vt100_EscSeq2(n, m, (CHAR*)"m", 2); } void vt100_DSR (INTEGER n) { - vt100_EscSeq(6, (CHAR*)"n", (LONGINT)2); + vt100_EscSeq(6, (CHAR*)"n", 2); } void vt100_SCP (void) { - vt100_EscSeq0((CHAR*)"s", (LONGINT)2); + vt100_EscSeq0((CHAR*)"s", 2); } void vt100_RCP (void) { - vt100_EscSeq0((CHAR*)"u", (LONGINT)2); + vt100_EscSeq0((CHAR*)"u", 2); } void vt100_DECTCEMl (void) { - vt100_EscSeq0((CHAR*)"\?25l", (LONGINT)5); + vt100_EscSeq0((CHAR*)"\?25l", 5); } void vt100_DECTCEMh (void) { - vt100_EscSeq0((CHAR*)"\?25h", (LONGINT)5); + vt100_EscSeq0((CHAR*)"\?25h", 5); } void vt100_SetAttr (CHAR *attr, LONGINT attr__len) { CHAR tmpstr[16]; __DUP(attr, attr__len, CHAR); - __COPY(vt100_CSI, tmpstr, ((LONGINT)(16))); - Strings_Append(attr, attr__len, (void*)tmpstr, ((LONGINT)(16))); - Console_String(tmpstr, ((LONGINT)(16))); + __COPY(vt100_CSI, tmpstr, 16); + Strings_Append(attr, attr__len, (void*)tmpstr, 16); + Console_String(tmpstr, 16); __DEL(attr); } @@ -252,7 +252,7 @@ export void *vt100__init(void) __REGCMD("RCP", vt100_RCP); __REGCMD("SCP", vt100_SCP); /* BEGIN */ - __COPY("\033", vt100_CSI, ((LONGINT)(5))); - Strings_Append((CHAR*)"[", (LONGINT)2, (void*)vt100_CSI, ((LONGINT)(5))); + __COPY("\033", vt100_CSI, 5); + Strings_Append((CHAR*)"[", 2, (void*)vt100_CSI, 5); __ENDMOD; } diff --git a/bootstrap/unix-48/vt100.h b/bootstrap/unix-48/vt100.h index 770cf66d..73d985c9 100644 --- a/bootstrap/unix-48/vt100.h +++ b/bootstrap/unix-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index 166df1dc..5a7e6896 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -14,6 +14,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/08/30] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/08/31] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index e30e1366..b38a0aa6 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Console.c b/bootstrap/unix-88/Console.c index 70e9a7e2..bb971366 100644 --- a/bootstrap/unix-88/Console.c +++ b/bootstrap/unix-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Platform.h" @@ -22,7 +22,7 @@ export void Console_String (CHAR *s, LONGINT s__len); void Console_Flush (void) { INTEGER error; - error = Platform_Write(((LONGINT)(1)), (LONGINT)(SYSTEM_ADRINT)Console_line, Console_pos); + error = Platform_Write(1, (SYSTEM_ADRINT)Console_line, Console_pos); Console_pos = 0; } @@ -31,7 +31,7 @@ void Console_Char (CHAR ch) if (Console_pos == 128) { Console_Flush(); } - Console_line[__X(Console_pos, ((LONGINT)(128)))] = ch; + Console_line[__X(Console_pos, 128)] = ch; Console_pos += 1; if (ch == 0x0a) { Console_Flush(); @@ -63,13 +63,13 @@ void Console_Int (LONGINT i, LONGINT n) i1 = __DIV(i1, 10); k = 1; while (i1 > 0) { - s[__X(k, ((LONGINT)(32)))] = (CHAR)(__MOD(i1, 10) + 48); + s[__X(k, 32)] = (CHAR)(__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k += 1; } } if (i < 0) { - s[__X(k, ((LONGINT)(32)))] = '-'; + s[__X(k, 32)] = '-'; k += 1; } while (n > k) { @@ -78,7 +78,7 @@ void Console_Int (LONGINT i, LONGINT n) } while (k > 0) { k -= 1; - Console_Char(s[__X(k, ((LONGINT)(32)))]); + Console_Char(s[__X(k, 32)]); } } @@ -90,9 +90,9 @@ void Console_Ln (void) void Console_Bool (BOOLEAN b) { if (b) { - Console_String((CHAR*)"TRUE", (LONGINT)5); + Console_String((CHAR*)"TRUE", 5); } else { - Console_String((CHAR*)"FALSE", (LONGINT)6); + Console_String((CHAR*)"FALSE", 6); } } @@ -116,7 +116,7 @@ void Console_Read (CHAR *ch) LONGINT n; INTEGER error; Console_Flush(); - error = Platform_ReadBuf(((LONGINT)(0)), (void*)&*ch, ((LONGINT)(1)), &n); + error = Platform_ReadBuf(0, (void*)&*ch, 1, &n); if (n != 1) { *ch = 0x00; } diff --git a/bootstrap/unix-88/Console.h b/bootstrap/unix-88/Console.h index 6c86c19c..22d598fb 100644 --- a/bootstrap/unix-88/Console.h +++ b/bootstrap/unix-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 3a575916..01a8d9ef 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -111,23 +111,23 @@ static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INTEGER errcode) { __DUP(s, s__len, CHAR); Console_Ln(); - Console_String((CHAR*)"-- ", (LONGINT)4); + Console_String((CHAR*)"-- ", 4); Console_String(s, s__len); - Console_String((CHAR*)": ", (LONGINT)3); + Console_String((CHAR*)": ", 3); if (f != NIL) { if (f->registerName[0] != 0x00) { - Console_String(f->registerName, ((LONGINT)(101))); + Console_String(f->registerName, 101); } else { - Console_String(f->workName, ((LONGINT)(101))); + Console_String(f->workName, 101); } if (f->fd != 0) { - Console_String((CHAR*)"f.fd = ", (LONGINT)8); - Console_Int(f->fd, ((LONGINT)(1))); + Console_String((CHAR*)"f.fd = ", 8); + Console_Int(f->fd, 1); } } if (errcode != 0) { - Console_String((CHAR*)" errcode = ", (LONGINT)12); - Console_Int(errcode, ((LONGINT)(1))); + Console_String((CHAR*)" errcode = ", 12); + Console_Int(errcode, 1); } Console_Ln(); __HALT(99); @@ -217,15 +217,15 @@ static void Files_Create (Files_File f) CHAR err[32]; if (f->fd == -1) { if (f->state == 1) { - Files_GetTempName(f->registerName, ((LONGINT)(101)), (void*)f->workName, ((LONGINT)(101))); + Files_GetTempName(f->registerName, 101, (void*)f->workName, 101); f->tempFile = 1; } else if (f->state == 2) { - __COPY(f->registerName, f->workName, ((LONGINT)(101))); + __COPY(f->registerName, f->workName, 101); f->registerName[0] = 0x00; f->tempFile = 0; } - error = Platform_Unlink((void*)f->workName, ((LONGINT)(101))); - error = Platform_New((void*)f->workName, ((LONGINT)(101)), &f->fd); + error = Platform_Unlink((void*)f->workName, 101); + error = Platform_New((void*)f->workName, 101, &f->fd); done = error == 0; if (done) { f->next = Files_files; @@ -243,7 +243,7 @@ static void Files_Create (Files_File f) } else { __MOVE("file not created", err, 17); } - Files_Err(err, ((LONGINT)(32)), f, error); + Files_Err(err, 32, f, error); } } } @@ -258,15 +258,15 @@ static void Files_Flush (Files_Buffer buf) if (buf->org != f->pos) { error = Platform_Seek(f->fd, buf->org, Platform_SeekSet); } - error = Platform_Write(f->fd, (LONGINT)(SYSTEM_ADRINT)buf->data, buf->size); + error = Platform_Write(f->fd, (SYSTEM_ADRINT)buf->data, buf->size); if (error != 0) { - Files_Err((CHAR*)"error writing file", (LONGINT)19, f, error); + Files_Err((CHAR*)"error writing file", 19, f, error); } f->pos = buf->org + buf->size; buf->chg = 0; error = Platform_Identify(f->fd, &f->identity, Platform_FileIdentity__typ); if (error != 0) { - Files_Err((CHAR*)"error identifying file", (LONGINT)23, f, error); + Files_Err((CHAR*)"error identifying file", 23, f, error); } } } @@ -305,7 +305,7 @@ void Files_Close (Files_File f) } error = Platform_Sync(f->fd); if (error != 0) { - Files_Err((CHAR*)"error writing file", (LONGINT)19, f, error); + Files_Err((CHAR*)"error writing file", 19, f, error); } Files_CloseOSFile(f); } @@ -325,7 +325,7 @@ Files_File Files_New (CHAR *name, LONGINT name__len) __DUP(name, name__len, CHAR); __NEW(f, Files_FileDesc); f->workName[0] = 0x00; - __COPY(name, f->registerName, ((LONGINT)(101))); + __COPY(name, f->registerName, 101); f->fd = -1; f->state = 1; f->len = 0; @@ -438,28 +438,28 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) if (name[0] != 0x00) { if (Files_HasDir((void*)name, name__len)) { dir[0] = 0x00; - __COPY(name, path, ((LONGINT)(256))); + __COPY(name, path, 256); } else { pos = 0; - Files_ScanPath(&pos, (void*)dir, ((LONGINT)(256))); - Files_MakeFileName(dir, ((LONGINT)(256)), name, name__len, (void*)path, ((LONGINT)(256))); - Files_ScanPath(&pos, (void*)dir, ((LONGINT)(256))); + Files_ScanPath(&pos, (void*)dir, 256); + Files_MakeFileName(dir, 256, name, name__len, (void*)path, 256); + Files_ScanPath(&pos, (void*)dir, 256); } for (;;) { - error = Platform_OldRW((void*)path, ((LONGINT)(256)), &fd); + error = Platform_OldRW((void*)path, 256, &fd); done = error == 0; if ((!done && Platform_TooManyFiles(error))) { - Files_Err((CHAR*)"too many files open", (LONGINT)20, f, error); + Files_Err((CHAR*)"too many files open", 20, f, error); } if ((!done && Platform_Inaccessible(error))) { - error = Platform_OldRO((void*)path, ((LONGINT)(256)), &fd); + error = Platform_OldRO((void*)path, 256, &fd); done = error == 0; } if ((!done && !Platform_Absent(error))) { - Console_String((CHAR*)"Warning: Files.Old ", (LONGINT)20); + Console_String((CHAR*)"Warning: Files.Old ", 20); Console_String(name, name__len); - Console_String((CHAR*)" error = ", (LONGINT)10); - Console_Int(error, ((LONGINT)(0))); + Console_String((CHAR*)" error = ", 10); + Console_Int(error, 0); Console_Ln(); } if (done) { @@ -477,7 +477,7 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) f->pos = 0; f->swapper = -1; error = Platform_Size(fd, &f->len); - __COPY(name, f->workName, ((LONGINT)(101))); + __COPY(name, f->workName, 101); f->registerName[0] = 0x00; f->tempFile = 0; f->identity = identity; @@ -493,8 +493,8 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) __DEL(name); return _o_result; } else { - Files_MakeFileName(dir, ((LONGINT)(256)), name, name__len, (void*)path, ((LONGINT)(256))); - Files_ScanPath(&pos, (void*)dir, ((LONGINT)(256))); + Files_MakeFileName(dir, 256, name, name__len, (void*)path, 256); + Files_ScanPath(&pos, (void*)dir, 256); } } } else { @@ -519,8 +519,8 @@ void Files_Purge (Files_File f) i += 1; } if (f->fd != -1) { - error = Platform_Truncate(f->fd, ((LONGINT)(0))); - error = Platform_Seek(f->fd, ((LONGINT)(0)), Platform_SeekSet); + error = Platform_Truncate(f->fd, 0); + error = Platform_Seek(f->fd, 0, Platform_SeekSet); } f->pos = 0; f->len = 0; @@ -585,9 +585,9 @@ void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, LONGINT pos) if (f->pos != org) { error = Platform_Seek(f->fd, org, Platform_SeekSet); } - error = Platform_ReadBuf(f->fd, (void*)buf->data, ((LONGINT)(4096)), &n); + error = Platform_ReadBuf(f->fd, (void*)buf->data, 4096, &n); if (error != 0) { - Files_Err((CHAR*)"read from file not done", (LONGINT)24, f, error); + Files_Err((CHAR*)"read from file not done", 24, f, error); } f->pos = org + n; buf->size = n; @@ -657,7 +657,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x } else { min = n; } - __MOVE((LONGINT)(SYSTEM_ADRINT)buf->data + offset, (LONGINT)(SYSTEM_ADRINT)x + xpos, min); + __MOVE((SYSTEM_ADRINT)buf->data + offset, (SYSTEM_ADRINT)x + xpos, min); offset += min; (*r).offset = offset; xpos += min; @@ -669,7 +669,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x void Files_ReadByte (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len) { - Files_ReadBytes(&*r, r__typ, (void*)x, x__len * ((LONGINT)(1)), ((LONGINT)(1))); + Files_ReadBytes(&*r, r__typ, (void*)x, x__len * 1, 1); } Files_File Files_Base (Files_Rider *r, LONGINT *r__typ) @@ -722,7 +722,7 @@ void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT } else { min = n; } - __MOVE((LONGINT)(SYSTEM_ADRINT)x + xpos, (LONGINT)(SYSTEM_ADRINT)buf->data + offset, min); + __MOVE((SYSTEM_ADRINT)x + xpos, (SYSTEM_ADRINT)buf->data + offset, min); offset += min; (*r).offset = offset; if (offset > buf->size) { @@ -773,15 +773,15 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT *res = 3; return; } - error = Platform_Read(fdold, (LONGINT)(SYSTEM_ADRINT)buf, ((LONGINT)(4096)), &n); + error = Platform_Read(fdold, (SYSTEM_ADRINT)buf, 4096, &n); while (n > 0) { - error = Platform_Write(fdnew, (LONGINT)(SYSTEM_ADRINT)buf, n); + error = Platform_Write(fdnew, (SYSTEM_ADRINT)buf, n); if (error != 0) { ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); - Files_Err((CHAR*)"cannot move file", (LONGINT)17, NIL, error); + Files_Err((CHAR*)"cannot move file", 17, NIL, error); } - error = Platform_Read(fdold, (LONGINT)(SYSTEM_ADRINT)buf, ((LONGINT)(4096)), &n); + error = Platform_Read(fdold, (SYSTEM_ADRINT)buf, 4096, &n); } ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); @@ -789,7 +789,7 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT error = Platform_Unlink((void*)old, old__len); *res = 0; } else { - Files_Err((CHAR*)"cannot move file", (LONGINT)17, NIL, error); + Files_Err((CHAR*)"cannot move file", 17, NIL, error); } } } else { @@ -809,12 +809,12 @@ void Files_Register (Files_File f) } Files_Close(f); if (f->registerName[0] != 0x00) { - Files_Rename(f->workName, ((LONGINT)(101)), f->registerName, ((LONGINT)(101)), &errcode); + Files_Rename(f->workName, 101, f->registerName, 101, &errcode); if (errcode != 0) { - __COPY(f->registerName, file, ((LONGINT)(104))); + __COPY(f->registerName, file, 104); __HALT(99); } - __COPY(f->registerName, f->workName, ((LONGINT)(101))); + __COPY(f->registerName, f->workName, 101); f->registerName[0] = 0x00; f->tempFile = 0; } @@ -839,7 +839,7 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *de j += 1; } } else { - __MOVE((LONGINT)(SYSTEM_ADRINT)src, (LONGINT)(SYSTEM_ADRINT)dest, src__len); + __MOVE((SYSTEM_ADRINT)src, (SYSTEM_ADRINT)dest, src__len); } } @@ -851,38 +851,38 @@ void Files_ReadBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN *x) void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, INTEGER *x) { CHAR b[2]; - Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(2)), ((LONGINT)(2))); - *x = (int)b[0] + __ASHL((int)b[1], 8); + Files_ReadBytes(&*R, R__typ, (void*)b, 2, 2); + *x = b[0] + __ASHL(b[1], 8); } void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, LONGINT *x) { CHAR b[4]; - Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); - *x = (((int)b[0] + __ASHL((int)b[1], 8)) + __ASHL((int)b[2], 16)) + __ASHL((int)b[3], 24); + Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); + *x = ((b[0] + __ASHL(b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); } void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x) { CHAR b[4]; LONGINT l; - Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); - l = (((int)b[0] + __ASHL((int)b[1], 8)) + __ASHL((int)b[2], 16)) + __ASHL((int)b[3], 24); - *x = (SET)l; + Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); + l = ((b[0] + __ASHL(b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); + *x = __VAL(SET, l); } void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x) { CHAR b[4]; - Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); - Files_FlipBytes((void*)b, ((LONGINT)(4)), (void*)&*x, ((LONGINT)(4))); + Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); + Files_FlipBytes((void*)b, 4, (void*)&*x, 4); } void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x) { CHAR b[8]; - Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(8)), ((LONGINT)(8))); - Files_FlipBytes((void*)b, ((LONGINT)(8)), (void*)&*x, ((LONGINT)(8))); + Files_ReadBytes(&*R, R__typ, (void*)b, 8, 8); + Files_FlipBytes((void*)b, 8, (void*)&*x, 8); } void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) @@ -923,12 +923,12 @@ void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, LONGINT *x) s = 0; n = 0; Files_Read(&*R, R__typ, (void*)&ch); - while ((int)ch >= 128) { - n += __ASH((SYSTEM_INT64)((int)ch - 128), s); + while (ch >= 128) { + n += __ASH((SYSTEM_INT64)(ch - 128), s); s += 7; Files_Read(&*R, R__typ, (void*)&ch); } - n += __ASH((SYSTEM_INT64)(__MASK((int)ch, -64) - __ASHL(__ASHR((int)ch, 6), 6)), s); + n += __ASH((SYSTEM_INT64)(__MASK(ch, -64) - __ASHL(__ASHR(ch, 6), 6)), s); *x = n; } @@ -942,7 +942,7 @@ void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, INTEGER x) CHAR b[2]; b[0] = (CHAR)x; b[1] = (CHAR)__ASHR(x, 8); - Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(2)), ((LONGINT)(2))); + Files_WriteBytes(&*R, R__typ, (void*)b, 2, 2); } void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, LONGINT x) @@ -952,33 +952,33 @@ void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, LONGINT x) b[1] = (CHAR)__ASHR(x, 8); b[2] = (CHAR)__ASHR(x, 16); b[3] = (CHAR)__ASHR(x, 24); - Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); + Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x) { CHAR b[4]; LONGINT i; - i = (LONGINT)x; + i = __VAL(LONGINT, x); b[0] = (CHAR)i; b[1] = (CHAR)__ASHR(i, 8); b[2] = (CHAR)__ASHR(i, 16); b[3] = (CHAR)__ASHR(i, 24); - Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); + Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x) { CHAR b[4]; - Files_FlipBytes((void*)&x, ((LONGINT)(4)), (void*)b, ((LONGINT)(4))); - Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); + Files_FlipBytes((void*)&x, 4, (void*)b, 4); + Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x) { CHAR b[8]; - Files_FlipBytes((void*)&x, ((LONGINT)(8)), (void*)b, ((LONGINT)(8))); - Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(8)), ((LONGINT)(8))); + Files_FlipBytes((void*)&x, 8, (void*)b, 8); + Files_WriteBytes(&*R, R__typ, (void*)b, 8, 8); } void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) @@ -988,7 +988,7 @@ void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len while (x[i] != 0x00) { i += 1; } - Files_WriteBytes(&*R, R__typ, (void*)x, x__len * ((LONGINT)(1)), i + 1); + Files_WriteBytes(&*R, R__typ, (void*)x, x__len * 1, i + 1); } void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, LONGINT x) @@ -1013,7 +1013,7 @@ static void Files_Finalize (SYSTEM_PTR o) if (f->fd >= 0) { Files_CloseOSFile(f); if (f->tempFile) { - res = Platform_Unlink((void*)f->workName, ((LONGINT)(101))); + res = Platform_Unlink((void*)f->workName, 101); } } } @@ -1022,7 +1022,7 @@ void Files_SetSearchPath (CHAR *path, LONGINT path__len) { __DUP(path, path__len, CHAR); if (Strings_Length(path, path__len) != 0) { - Files_SearchPath = __NEWARR(NIL, ((LONGINT)(1)), 1, 1, 1, (LONGINT)(Strings_Length(path, path__len) + 1)); + Files_SearchPath = __NEWARR(NIL, 1, 1, 1, 1, ((SYSTEM_ADRINT)((Strings_Length(path, path__len) + 1)))); __COPY(path, Files_SearchPath->data, Files_SearchPath->len[0]); } else { Files_SearchPath = NIL; @@ -1056,6 +1056,6 @@ export void *Files__init(void) Files_tempno = -1; Heap_FileCount = 0; Files_HOME[0] = 0x00; - Platform_GetEnv((CHAR*)"HOME", (LONGINT)5, (void*)Files_HOME, ((LONGINT)(1024))); + Platform_GetEnv((CHAR*)"HOME", 5, (void*)Files_HOME, 1024); __ENDMOD; } diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 4135c1d4..17323792 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index 1eb56133..a8a51e7c 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tskSfF */ #define LARGE #include "SYSTEM.h" @@ -117,7 +117,7 @@ void Heap_Unlock (void) { Heap_lockdepth -= 1; if ((Heap_interrupted && Heap_lockdepth == 0)) { - Heap_PlatformHalt(((LONGINT)(-9))); + Heap_PlatformHalt(-9); } } @@ -132,7 +132,7 @@ SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) } m->types = 0; m->cmds = NIL; - __COPY(name, m->name, ((LONGINT)(20))); + __COPY(name, m->name, 20); m->refcnt = 0; m->enumPtrs = enumPtrs; m->next = (Heap_Module)(SYSTEM_ADRINT)Heap_modules; @@ -149,7 +149,7 @@ void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) } else { __NEW(c, Heap_CmdDesc); } - __COPY(name, c->name, ((LONGINT)(24))); + __COPY(name, c->name, 24); c->cmd = cmd; c->next = m->cmds; m->cmds = c; @@ -327,12 +327,12 @@ SYSTEM_PTR Heap_NEWBLK (LONGINT size) SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 63, 5), 5); - new = Heap_NEWREC((LONGINT)(SYSTEM_ADRINT)&blksz); - tag = ((LONGINT)(SYSTEM_ADRINT)new + blksz) - 24; + new = Heap_NEWREC((SYSTEM_ADRINT)&blksz); + tag = (__VAL(LONGINT, new) + blksz) - 24; __PUT(tag - 8, 0, LONGINT); __PUT(tag, blksz, LONGINT); __PUT(tag + 8, -8, LONGINT); - __PUT((LONGINT)(SYSTEM_ADRINT)new - 8, tag, LONGINT); + __PUT(__VAL(LONGINT, new) - 8, tag, LONGINT); Heap_Unlock(); _o_result = new; return _o_result; @@ -361,7 +361,7 @@ static void Heap_Mark (LONGINT q) __GET(tag, offset, LONGINT); fld = q + offset; p = Heap_FetchAddress(fld); - __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)n, SYSTEM_PTR); + __PUT(fld, __VAL(SYSTEM_PTR, n), SYSTEM_PTR); } else { fld = q + offset; n = Heap_FetchAddress(fld); @@ -370,7 +370,7 @@ static void Heap_Mark (LONGINT q) if (!__ODD(tagbits)) { __PUT(n - 8, tagbits + 1, LONGINT); __PUT(q - 8, tag + 1, LONGINT); - __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)p, SYSTEM_PTR); + __PUT(fld, __VAL(SYSTEM_PTR, p), SYSTEM_PTR); p = q; q = n; tag = tagbits; @@ -385,7 +385,7 @@ static void Heap_Mark (LONGINT q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((LONGINT)(SYSTEM_ADRINT)p); + Heap_Mark(__VAL(LONGINT, p)); } static void Heap_Scan (void) @@ -554,7 +554,7 @@ static void Heap_Finalize (void) } else { prev->next = n->next; } - (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); + (*n->finalize)(__VAL(SYSTEM_PTR, n->obj)); if (prev == NIL) { n = Heap_fin; } else { @@ -573,7 +573,7 @@ void Heap_FINALL (void) while (Heap_fin != NIL) { n = Heap_fin; Heap_fin = Heap_fin->next; - (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); + (*n->finalize)(__VAL(SYSTEM_PTR, n->obj)); } } @@ -590,9 +590,9 @@ static void Heap_MarkStack (LONGINT n, LONGINT *cand, LONGINT cand__len) } if (n == 0) { nofcand = 0; - sp = (LONGINT)(SYSTEM_ADRINT)&frame; + sp = (SYSTEM_ADRINT)&frame; stack0 = Heap_PlatformMainStackFrame(); - inc = (LONGINT)(SYSTEM_ADRINT)&align.p - (LONGINT)(SYSTEM_ADRINT)&align; + inc = (SYSTEM_ADRINT)&align.p - (SYSTEM_ADRINT)&align; if (sp > stack0) { inc = -inc; } @@ -681,7 +681,7 @@ void Heap_GC (BOOLEAN markStack) i22 += 23; i23 += 24; if ((i0 == -99 && i15 == 24)) { - Heap_MarkStack(((LONGINT)(32)), (void*)cand, ((LONGINT)(10000))); + Heap_MarkStack(32, (void*)cand, 10000); break; } } @@ -700,7 +700,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (LONGINT)(SYSTEM_ADRINT)obj; + f->obj = __VAL(LONGINT, obj); f->finalize = finalize; f->marked = 1; f->next = Heap_fin; @@ -709,7 +709,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) void Heap_InitHeap (void) { - Heap_heap = Heap_NewChunk(((LONGINT)(256000))); + Heap_heap = Heap_NewChunk(256000); Heap_heapend = Heap_FetchAddress(Heap_heap + 8); __PUT(Heap_heap, 0, LONGINT); Heap_allocated = 0; diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index 7e4094a1..eebee23c 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 51f3204d..5929cd57 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Console.h" @@ -84,10 +84,10 @@ Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len) Modules_resMsg[0] = 0x00; } else { Modules_res = 1; - __COPY(name, Modules_importing, ((LONGINT)(20))); + __COPY(name, Modules_importing, 20); __MOVE(" module \"", Modules_resMsg, 10); - Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), name, name__len); - Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), (CHAR*)"\" not found", (LONGINT)12); + Modules_Append((void*)Modules_resMsg, 256, name, name__len); + Modules_Append((void*)Modules_resMsg, 256, (CHAR*)"\" not found", 12); } _o_result = m; __DEL(name); @@ -112,11 +112,11 @@ Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT nam } else { Modules_res = 2; __MOVE(" command \"", Modules_resMsg, 11); - __COPY(name, Modules_importing, ((LONGINT)(20))); - Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), mod->name, ((LONGINT)(20))); - Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), (CHAR*)".", (LONGINT)2); - Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), name, name__len); - Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), (CHAR*)"\" not found", (LONGINT)12); + __COPY(name, Modules_importing, 20); + Modules_Append((void*)Modules_resMsg, 256, mod->name, 20); + Modules_Append((void*)Modules_resMsg, 256, (CHAR*)".", 2); + Modules_Append((void*)Modules_resMsg, 256, name, name__len); + Modules_Append((void*)Modules_resMsg, 256, (CHAR*)"\" not found", 12); _o_result = NIL; __DEL(name); return _o_result; diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index 8431e4a2..03458258 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index ce3f00ec..c3322a77 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" @@ -272,7 +272,7 @@ OPT_Node OPB_NewString (OPS_String str, LONGINT len) x->conval->intval = -1; x->conval->intval2 = len; x->conval->ext = OPT_NewExt(); - __COPY(str, *x->conval->ext, ((LONGINT)(256))); + __COPY(str, *x->conval->ext, 256); _o_result = x; return _o_result; } @@ -619,7 +619,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) case 22: if (f == 3) { if (z->class == 7) { - z->conval->intval = (int)__CAP((CHAR)z->conval->intval); + z->conval->intval = __CAP((CHAR)z->conval->intval); z->obj = NIL; } else { z = NewOp__29(op, typ, z); @@ -667,8 +667,8 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->typ = OPT_booltyp; break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPB.MOp, op = ", (LONGINT)33); - OPM_LogWNum(op, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPB.MOp, op = ", 33); + OPM_LogWNum(op, 0); OPM_LogWLn(); break; } @@ -827,8 +827,8 @@ static INTEGER ConstCmp__14 (void) } break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPB.ConstCmp, f = ", (LONGINT)37); - OPM_LogWNum(*ConstOp__13_s->f, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPB.ConstCmp, f = ", 37); + OPM_LogWNum(*ConstOp__13_s->f, 0); OPM_LogWLn(); break; } @@ -1106,8 +1106,8 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPB.ConstOp, op = ", (LONGINT)37); - OPM_LogWNum(op, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPB.ConstOp, op = ", 37); + OPM_LogWNum(op, 0); OPM_LogWLn(); break; } @@ -1155,7 +1155,7 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) } } (*x)->obj = NIL; - } else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((int)(*x)->left->typ->form < f || f > g))) { + } else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((*x)->left->typ->form < f || f > g))) { if ((*x)->left->typ == typ) { *x = (*x)->left; } @@ -1208,11 +1208,11 @@ static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) if ((*Op__38_s->f == 10 && (*x)->conval->intval2 == 1)) { (*x)->typ = OPT_chartyp; (*x)->conval->intval = 0; - OPB_Index(&*y, OPB_NewIntConst(((LONGINT)(0)))); + OPB_Index(&*y, OPB_NewIntConst(0)); } else if ((*Op__38_s->g == 10 && (*y)->conval->intval2 == 1)) { (*y)->typ = OPT_chartyp; (*y)->conval->intval = 0; - OPB_Index(&*x, OPB_NewIntConst(((LONGINT)(0)))); + OPB_Index(&*x, OPB_NewIntConst(0)); } } _o_result = ok; @@ -1476,7 +1476,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) typ = OPT_booltyp; } else { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"ELSE in Op()", (LONGINT)13); + OPM_LogWStr((CHAR*)"ELSE in Op()", 13); OPM_LogWLn(); OPB_err(108); typ = OPT_undftyp; @@ -1484,8 +1484,8 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) NewOp__39(op, typ, &z, y); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPB.Op, op = ", (LONGINT)32); - OPM_LogWNum(op, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPB.Op, op = ", 32); + OPM_LogWNum(op, 0); OPM_LogWLn(); break; } @@ -1557,24 +1557,24 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPT_Struct p = NIL, q = NIL; if (OPM_Verbose) { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"PROCEDURE CheckAssign", (LONGINT)22); + OPM_LogWStr((CHAR*)"PROCEDURE CheckAssign", 22); OPM_LogWLn(); } y = ynode->typ; f = x->form; g = y->form; if (OPM_Verbose) { - OPM_LogWStr((CHAR*)"y.form = ", (LONGINT)10); - OPM_LogWNum(y->form, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"y.form = ", 10); + OPM_LogWNum(y->form, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"f = ", (LONGINT)5); - OPM_LogWNum(f, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"f = ", 5); + OPM_LogWNum(f, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"g = ", (LONGINT)5); - OPM_LogWNum(g, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"g = ", 5); + OPM_LogWNum(g, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"ynode.typ.syze = ", (LONGINT)18); - OPM_LogWNum(ynode->typ->size, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"ynode.typ.syze = ", 18); + OPM_LogWNum(ynode->typ->size, 0); OPM_LogWLn(); } if (ynode->class == 8 || (ynode->class == 9 && f != 14)) { @@ -1682,8 +1682,8 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) } break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPB.CheckAssign, f = ", (LONGINT)40); - OPM_LogWNum(f, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPB.CheckAssign, f = ", 40); + OPM_LogWNum(f, 0); OPM_LogWLn(); break; } @@ -1775,14 +1775,14 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) x = OPB_NewBoolConst(0); break; case 3: - x = OPB_NewIntConst(((LONGINT)(0))); + x = OPB_NewIntConst(0); x->typ = OPT_chartyp; break; case 4: case 5: case 6: x = OPB_NewIntConst(OPM_SignedMinimum(x->typ->size)); break; case 9: - x = OPB_NewIntConst(((LONGINT)(0))); + x = OPB_NewIntConst(0); x->typ = OPT_inttyp; break; case 7: @@ -1806,7 +1806,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) x = OPB_NewBoolConst(1); break; case 3: - x = OPB_NewIntConst(((LONGINT)(255))); + x = OPB_NewIntConst(255); x->typ = OPT_chartyp; break; case 4: case 5: case 6: @@ -1928,14 +1928,14 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 12: if (x->class != 8) { OPB_err(110); - x = OPB_NewIntConst(((LONGINT)(1))); + x = OPB_NewIntConst(1); } else if (__IN(f, 0x63fe) || __IN(x->typ->comp, 0x14)) { (*OPB_typSize)(x->typ); x->typ->pvused = 1; x = OPB_NewIntConst(x->typ->size); } else { OPB_err(111); - x = OPB_NewIntConst(((LONGINT)(1))); + x = OPB_NewIntConst(1); } break; case 21: @@ -1994,8 +1994,8 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) } break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPB.StPar0, fctno = ", (LONGINT)39); - OPM_LogWNum(fctno, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPB.StPar0, fctno = ", 39); + OPM_LogWNum(fctno, 0); OPM_LogWLn(); break; } @@ -2064,7 +2064,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (!__IN(f, 0x70) || x->class != 7) { OPB_err(69); } else if (x->typ->size == 1) { - L = (int)x->conval->intval; + L = (SYSTEM_INT32)x->conval->intval; typ = p->typ; while ((L > 0 && __IN(typ->comp, 0x0c))) { typ = typ->BaseTyp; @@ -2322,7 +2322,7 @@ void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno) } } else { if (((fctno == 13 || fctno == 14) && parno == 1)) { - OPB_BindNodes(19, OPT_notyp, &p, OPB_NewIntConst(((LONGINT)(1)))); + OPB_BindNodes(19, OPT_notyp, &p, OPB_NewIntConst(1)); p->subcl = fctno; p->right->typ = p->left->typ; } else if ((fctno == 17 && parno == 1)) { @@ -2344,7 +2344,7 @@ void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno) } else if (fctno == 32) { if (parno == 1) { x = NIL; - OPB_BindNodes(28, OPT_notyp, &x, OPB_NewIntConst(((LONGINT)(0)))); + OPB_BindNodes(28, OPT_notyp, &x, OPB_NewIntConst(0)); x->conval = OPT_NewConst(); x->conval->intval = OPM_errpos; OPB_Construct(15, &p, x); @@ -2579,7 +2579,7 @@ void OPB_Assign (OPT_Node *x, OPT_Node y) } else if (((((((*x)->typ->comp == 2 && (*x)->typ->BaseTyp == OPT_chartyp)) && y->typ->form == 10)) && y->conval->intval2 == 1)) { y->typ = OPT_chartyp; y->conval->intval = 0; - OPB_Index(&*x, OPB_NewIntConst(((LONGINT)(0)))); + OPB_Index(&*x, OPB_NewIntConst(0)); } if ((((((__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp == OPT_chartyp)) && __IN(y->typ->comp, 0x0c))) && y->typ->BaseTyp == OPT_chartyp)) { subcl = 18; diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index ccef7627..0b71f987 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index a5276b17..57fdcb05 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -63,6 +63,7 @@ static void OPC_InitImports (OPT_Object obj); static void OPC_InitKeywords (void); export void OPC_InitTDesc (OPT_Struct typ); static void OPC_InitTProcs (OPT_Object typ, OPT_Object obj); +export void OPC_IntLiteral (LONGINT n, LONGINT size); export void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim); static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName); static INTEGER OPC_Length (CHAR *s, LONGINT s__len); @@ -179,7 +180,7 @@ static INTEGER OPC_PerfectHash (CHAR *s, LONGINT s__len) i = 0; h = 0; while ((s[__X(i, s__len)] != 0x00 && i < 5)) { - h = 3 * h + (int)s[__X(i, s__len)]; + h = 3 * h + s[__X(i, s__len)]; i += 1; } _o_result = (int)__MOD(h, 105); @@ -192,10 +193,10 @@ void OPC_Ident (OPT_Object obj) mode = obj->mode; level = obj->mnolev; if ((__IN(mode, 0x62) && level > 0) || __IN(mode, 0x14)) { - OPM_WriteStringVar((void*)obj->name, ((LONGINT)(256))); - h = OPC_PerfectHash((void*)obj->name, ((LONGINT)(256))); - if (OPC_hashtab[__X(h, ((LONGINT)(105)))] >= 0) { - if (__STRCMP(OPC_keytab[__X(OPC_hashtab[__X(h, ((LONGINT)(105)))], ((LONGINT)(36)))], obj->name) == 0) { + OPM_WriteStringVar((void*)obj->name, 256); + h = OPC_PerfectHash((void*)obj->name, 256); + if (OPC_hashtab[__X(h, 105)] >= 0) { + if (__STRCMP(OPC_keytab[__X(OPC_hashtab[__X(h, 105)], 36)], obj->name) == 0) { OPM_Write('_'); } } @@ -204,18 +205,18 @@ void OPC_Ident (OPT_Object obj) if (mode == 13) { OPC_Ident(obj->link->typ->strobj); } else if (level < 0) { - OPM_WriteStringVar((void*)OPT_GlbMod[__X(-level, ((LONGINT)(64)))]->name, ((LONGINT)(256))); + OPM_WriteStringVar((void*)OPT_GlbMod[__X(-level, 64)]->name, 256); if (OPM_currFile == 0) { - OPT_GlbMod[__X(-level, ((LONGINT)(64)))]->vis = 1; + OPT_GlbMod[__X(-level, 64)]->vis = 1; } } else { - OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); + OPM_WriteStringVar((void*)OPM_modName, 32); } OPM_Write('_'); } else if ((((((obj == OPT_sysptrtyp->strobj || obj == OPT_ainttyp->strobj) || obj == OPT_int8typ->strobj) || obj == OPT_int16typ->strobj) || obj == OPT_int32typ->strobj) || obj == OPT_int64typ->strobj) || obj == OPT_bytetyp->strobj) { - OPM_WriteString((CHAR*)"SYSTEM_", (LONGINT)8); + OPM_WriteString((CHAR*)"SYSTEM_", 8); } - OPM_WriteStringVar((void*)obj->name, ((LONGINT)(256))); + OPM_WriteStringVar((void*)obj->name, 256); } } @@ -291,7 +292,7 @@ static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef) OPM_Write(')'); OPC_AnsiParamList(typ->link, 0); } else { - OPM_WriteString((CHAR*)")()", (LONGINT)4); + OPM_WriteString((CHAR*)")()", 4); } break; } else if (comp == 2) { @@ -309,8 +310,8 @@ static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef) void OPC_Andent (OPT_Struct typ) { if (typ->strobj == NIL || typ->align >= 65536) { - OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); - OPC_Str1((CHAR*)"__#", (LONGINT)4, __ASHR(typ->align, 16)); + OPM_WriteStringVar((void*)OPM_modName, 32); + OPC_Str1((CHAR*)"__#", 4, __ASHR(typ->align, 16)); } else { OPC_Ident(typ->strobj); } @@ -337,17 +338,17 @@ static void OPC_DeclareBase (OPT_Object dcl) } obj = typ->strobj; if (typ->form == 12) { - OPM_WriteString((CHAR*)"void", (LONGINT)5); + OPM_WriteString((CHAR*)"void", 5); } else if ((obj != NIL && !OPC_Undefined(obj))) { OPC_Ident(obj); } else if (typ->comp == 4) { - OPM_WriteString((CHAR*)"struct ", (LONGINT)8); + OPM_WriteString((CHAR*)"struct ", 8); OPC_Andent(typ); if ((prev->form != 13 && (obj != NIL || dcl->name[0] == 0x00))) { if ((typ->BaseTyp != NIL && typ->BaseTyp->strobj->vis != 0)) { - OPM_WriteString((CHAR*)" { /* ", (LONGINT)7); + OPM_WriteString((CHAR*)" { /* ", 7); OPC_Ident(typ->BaseTyp->strobj); - OPM_WriteString((CHAR*)" */", (LONGINT)4); + OPM_WriteString((CHAR*)" */", 4); OPM_WriteLn(); OPC_Indent(1); } else { @@ -364,10 +365,10 @@ static void OPC_DeclareBase (OPT_Object dcl) nofdims += 1; typ = typ->BaseTyp; } - OPM_WriteString((CHAR*)"struct ", (LONGINT)8); + OPM_WriteString((CHAR*)"struct ", 8); OPC_BegBlk(); OPC_BegStat(); - OPC_Str1((CHAR*)"LONGINT len[#]", (LONGINT)15, nofdims); + OPC_Str1((CHAR*)"LONGINT len[#]", 15, nofdims); OPC_EndStat(); OPC_BegStat(); __NEW(obj, OPT_ObjDesc); @@ -437,7 +438,7 @@ static void OPC_PutPtrOffsets (OPT_Struct typ, LONGINT adr, LONGINT *cnt) LONGINT n, i; if ((typ->form == 13 && typ->sysflag == 0)) { OPM_WriteInt(adr); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); *cnt += 1; if (__MASK(*cnt, -16) == 0) { OPM_WriteLn(); @@ -454,7 +455,7 @@ static void OPC_PutPtrOffsets (OPT_Struct typ, LONGINT adr, LONGINT *cnt) OPC_PutPtrOffsets(fld->typ, adr + fld->adr, &*cnt); } else { OPM_WriteInt(adr + fld->adr); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); *cnt += 1; if (__MASK(*cnt, -16) == 0) { OPM_WriteLn(); @@ -486,11 +487,11 @@ static void OPC_InitTProcs (OPT_Object typ, OPT_Object obj) OPC_InitTProcs(typ, obj->left); if (obj->mode == 13) { OPC_BegStat(); - OPM_WriteString((CHAR*)"__INITBP(", (LONGINT)10); + OPM_WriteString((CHAR*)"__INITBP(", 10); OPC_Ident(typ); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Ident(obj); - OPC_Str1((CHAR*)", #)", (LONGINT)5, __ASHR(obj->adr, 16)); + OPC_Str1((CHAR*)", #)", 5, __ASHR(obj->adr, 16)); OPC_EndStat(); } OPC_InitTProcs(typ, obj->right); @@ -502,8 +503,8 @@ static void OPC_PutBase (OPT_Struct typ) if (typ != NIL) { OPC_PutBase(typ->BaseTyp); OPC_Ident(typ->strobj); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)"__typ", 6); + OPM_WriteString((CHAR*)", ", 3); } } @@ -513,19 +514,19 @@ static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamNa INTEGER dim; if (showParamName) { OPC_Ident(par); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); } dim = 1; typ = par->typ->BaseTyp; while (typ->comp == 3) { if (ansiDefine) { - OPM_WriteString((CHAR*)", LONGINT ", (LONGINT)11); + OPM_WriteString((CHAR*)", LONGINT ", 11); } else { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); } if (showParamName) { OPC_Ident(par); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); OPM_WriteInt(dim); } typ = typ->BaseTyp; @@ -538,7 +539,7 @@ static void OPC_DeclareParams (OPT_Object par, BOOLEAN macro) OPM_Write('('); while (par != NIL) { if (macro) { - OPM_WriteStringVar((void*)par->name, ((LONGINT)(256))); + OPM_WriteStringVar((void*)par->name, 256); } else { if ((par->mode == 1 && par->typ->form == 7)) { OPM_Write('_'); @@ -546,16 +547,16 @@ static void OPC_DeclareParams (OPT_Object par, BOOLEAN macro) OPC_Ident(par); } if (par->typ->comp == 3) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_LenList(par, 0, 1); } else if ((par->mode == 2 && par->typ->comp == 4)) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); - OPM_WriteStringVar((void*)par->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)", ", 3); + OPM_WriteStringVar((void*)par->name, 256); + OPM_WriteString((CHAR*)"__typ", 6); } par = par->link; if (par != NIL) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); } } OPM_Write(')'); @@ -587,7 +588,7 @@ static void OPC_DeclareTProcs (OPT_Object obj, BOOLEAN *empty) if (OPM_currFile == 0) { if (obj->vis == 1) { OPC_DefineTProcTypes(obj); - OPM_WriteString((CHAR*)"import ", (LONGINT)8); + OPM_WriteString((CHAR*)"import ", 8); *empty = 0; OPC_ProcHeader(obj, 0); } @@ -595,9 +596,9 @@ static void OPC_DeclareTProcs (OPT_Object obj, BOOLEAN *empty) *empty = 0; OPC_DefineTProcTypes(obj); if (obj->vis == 0) { - OPM_WriteString((CHAR*)"static ", (LONGINT)8); + OPM_WriteString((CHAR*)"static ", 8); } else { - OPM_WriteString((CHAR*)"export ", (LONGINT)8); + OPM_WriteString((CHAR*)"export ", 8); } OPC_ProcHeader(obj, 0); } @@ -631,31 +632,31 @@ static void OPC_DefineTProcMacros (OPT_Object obj, BOOLEAN *empty) if (obj != NIL) { OPC_DefineTProcMacros(obj->left, &*empty); if ((((obj->mode == 13 && obj == OPC_BaseTProc(obj))) && (OPM_currFile != 0 || obj->vis == 1))) { - OPM_WriteString((CHAR*)"#define __", (LONGINT)11); + OPM_WriteString((CHAR*)"#define __", 11); OPC_Ident(obj); OPC_DeclareParams(obj->link, 1); - OPM_WriteString((CHAR*)" __SEND(", (LONGINT)9); + OPM_WriteString((CHAR*)" __SEND(", 9); if (obj->link->typ->form == 13) { - OPM_WriteString((CHAR*)"__TYPEOF(", (LONGINT)10); + OPM_WriteString((CHAR*)"__TYPEOF(", 10); OPC_Ident(obj->link); OPM_Write(')'); } else { OPC_Ident(obj->link); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } - OPC_Str1((CHAR*)", #, ", (LONGINT)6, __ASHR(obj->adr, 16)); + OPC_Str1((CHAR*)", #, ", 6, __ASHR(obj->adr, 16)); if (obj->typ == OPT_notyp) { - OPM_WriteString((CHAR*)"void", (LONGINT)5); + OPM_WriteString((CHAR*)"void", 5); } else { OPC_Ident(obj->typ->strobj); } - OPM_WriteString((CHAR*)"(*)", (LONGINT)4); + OPM_WriteString((CHAR*)"(*)", 4); if (OPC_ansi) { OPC_AnsiParamList(obj->link, 0); } else { - OPM_WriteString((CHAR*)"()", (LONGINT)3); + OPM_WriteString((CHAR*)"()", 3); } - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_DeclareParams(obj->link, 1); OPM_Write(')'); OPM_WriteLn(); @@ -710,7 +711,7 @@ static void OPC_DefineType (OPT_Struct str) } } if ((obj != NIL && OPC_Undefined(obj))) { - OPM_WriteString((CHAR*)"typedef", (LONGINT)8); + OPM_WriteString((CHAR*)"typedef", 8); OPM_WriteLn(); OPM_Write(0x09); OPC_Indent(1); @@ -743,7 +744,7 @@ static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len) BOOLEAN r; __DUP(y, y__len, CHAR); i = 0; - while ((*x)[__X(i + 1, ((LONGINT)(256)))] == y[__X(i, y__len)]) { + while ((*x)[__X(i + 1, 256)] == y[__X(i, y__len)]) { i += 1; } r = y[__X(i, y__len)] == 0x00; @@ -759,19 +760,19 @@ static void OPC_CProcDefs (OPT_Object obj, INTEGER vis) INTEGER _for__9; if (obj != NIL) { OPC_CProcDefs(obj->left, vis); - if ((((obj->mode == 9 && (int)obj->vis >= vis)) && obj->adr == 1)) { + if ((((obj->mode == 9 && obj->vis >= vis)) && obj->adr == 1)) { ext = obj->conval->ext; i = 1; - if (((*ext)[1] != '#' && !(OPC_Prefixed(ext, (CHAR*)"extern ", (LONGINT)8) || OPC_Prefixed(ext, (CHAR*)"import ", (LONGINT)8)))) { - OPM_WriteString((CHAR*)"#define ", (LONGINT)9); + if (((*ext)[1] != '#' && !(OPC_Prefixed(ext, (CHAR*)"extern ", 8) || OPC_Prefixed(ext, (CHAR*)"import ", 8)))) { + OPM_WriteString((CHAR*)"#define ", 9); OPC_Ident(obj); OPC_DeclareParams(obj->link, 1); OPM_Write(0x09); } - _for__9 = (int)(*obj->conval->ext)[0]; + _for__9 = (*obj->conval->ext)[0]; i = i; while (i <= _for__9) { - OPM_Write((*obj->conval->ext)[__X(i, ((LONGINT)(256)))]); + OPM_Write((*obj->conval->ext)[__X(i, 256)]); i += 1; } OPM_WriteLn(); @@ -815,34 +816,34 @@ void OPC_TDescDecl (OPT_Struct typ) LONGINT nofptrs; OPT_Object o = NIL; OPC_BegStat(); - OPM_WriteString((CHAR*)"__TDESC(", (LONGINT)9); + OPM_WriteString((CHAR*)"__TDESC(", 9); OPC_Andent(typ); - OPC_Str1((CHAR*)", #", (LONGINT)4, typ->n + 1); - OPC_Str1((CHAR*)", #) = {__TDFLDS(", (LONGINT)18, OPC_NofPtrs(typ)); + OPC_Str1((CHAR*)", #", 4, typ->n + 1); + OPC_Str1((CHAR*)", #) = {__TDFLDS(", 18, OPC_NofPtrs(typ)); OPM_Write('"'); if (typ->strobj != NIL) { - OPM_WriteStringVar((void*)typ->strobj->name, ((LONGINT)(256))); + OPM_WriteStringVar((void*)typ->strobj->name, 256); } OPM_Write('"'); - OPC_Str1((CHAR*)", #), {", (LONGINT)8, typ->size); + OPC_Str1((CHAR*)", #), {", 8, typ->size); nofptrs = 0; - OPC_PutPtrOffsets(typ, ((LONGINT)(0)), &nofptrs); - OPC_Str1((CHAR*)"#}}", (LONGINT)4, -((nofptrs + 1) * (SYSTEM_INT64)OPM_LIntSize)); + OPC_PutPtrOffsets(typ, 0, &nofptrs); + OPC_Str1((CHAR*)"#}}", 4, -((nofptrs + 1) * (SYSTEM_INT64)OPM_LIntSize)); OPC_EndStat(); } void OPC_InitTDesc (OPT_Struct typ) { OPC_BegStat(); - OPM_WriteString((CHAR*)"__INITYP(", (LONGINT)10); + OPM_WriteString((CHAR*)"__INITYP(", 10); OPC_Andent(typ); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); if (typ->BaseTyp != NIL) { OPC_Andent(typ->BaseTyp); } else { OPC_Andent(typ); } - OPC_Str1((CHAR*)", #)", (LONGINT)5, typ->extlev); + OPC_Str1((CHAR*)", #)", 5, typ->extlev); OPC_EndStat(); if (typ->strobj != NIL) { OPC_InitTProcs(typ->strobj, typ->link); @@ -911,22 +912,22 @@ static void OPC_FillGap (LONGINT gap, LONGINT off, LONGINT align, LONGINT *n, LO gap -= (adr - off) + align; OPC_BegStat(); if (align == (SYSTEM_INT64)OPM_IntSize) { - OPM_WriteString((CHAR*)"INTEGER", (LONGINT)8); + OPM_WriteString((CHAR*)"INTEGER", 8); } else if (align == (SYSTEM_INT64)OPM_LIntSize) { - OPM_WriteString((CHAR*)"LONGINT", (LONGINT)8); + OPM_WriteString((CHAR*)"LONGINT", 8); } else if (align == (SYSTEM_INT64)OPM_LRealSize) { - OPM_WriteString((CHAR*)"LONGREAL", (LONGINT)9); + OPM_WriteString((CHAR*)"LONGREAL", 9); } - OPC_Str1((CHAR*)" _prvt#", (LONGINT)8, *n); + OPC_Str1((CHAR*)" _prvt#", 8, *n); *n += 1; OPC_EndStat(); *curAlign = align; } if (gap > 0) { OPC_BegStat(); - OPC_Str1((CHAR*)"char _prvt#", (LONGINT)12, *n); + OPC_Str1((CHAR*)"char _prvt#", 12, *n); *n += 1; - OPC_Str1((CHAR*)"[#]", (LONGINT)4, gap); + OPC_Str1((CHAR*)"[#]", 4, gap); OPC_EndStat(); } } @@ -970,7 +971,7 @@ static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, LONGINT *off, LONGINT * base = fld->typ; fld = fld->link; while ((((((((fld != NIL && fld->mode == 4)) && fld->typ == base)) && fld->adr == *off)) && ((OPM_currFile == 1 || fld->vis != 0) || fld->typ->strobj == NIL))) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_DeclareObj(fld, 0); *off = fld->adr + fld->typ->size; fld = fld->link; @@ -1000,7 +1001,7 @@ static void OPC_IdentList (OPT_Object obj, INTEGER vis) first = 1; while ((obj != NIL && obj->mode != 13)) { if ((__IN(vis, 0x05) || (vis == 1 && obj->vis != 0)) || (vis == 3 && !obj->leaf)) { - if (obj->typ != base || (int)obj->vis != lastvis) { + if (obj->typ != base || obj->vis != lastvis) { if (!first) { OPC_EndStat(); } @@ -1009,16 +1010,16 @@ static void OPC_IdentList (OPT_Object obj, INTEGER vis) lastvis = obj->vis; OPC_BegStat(); if ((vis == 1 && obj->vis != 0)) { - OPM_WriteString((CHAR*)"import ", (LONGINT)8); + OPM_WriteString((CHAR*)"import ", 8); } else if ((obj->mnolev == 0 && vis == 0)) { if (obj->vis == 0) { - OPM_WriteString((CHAR*)"static ", (LONGINT)8); + OPM_WriteString((CHAR*)"static ", 8); } else { - OPM_WriteString((CHAR*)"export ", (LONGINT)8); + OPM_WriteString((CHAR*)"export ", 8); } } if ((((vis == 2 && obj->mode == 1)) && base->form == 7)) { - OPM_WriteString((CHAR*)"double", (LONGINT)7); + OPM_WriteString((CHAR*)"double", 7); } else { OPC_DeclareBase(obj); } @@ -1034,17 +1035,17 @@ static void OPC_IdentList (OPT_Object obj, INTEGER vis) OPC_EndStat(); OPC_BegStat(); base = OPT_linttyp; - OPM_WriteString((CHAR*)"LONGINT ", (LONGINT)9); + OPM_WriteString((CHAR*)"LONGINT ", 9); OPC_LenList(obj, 0, 1); } else if ((obj->mode == 2 && obj->typ->comp == 4)) { OPC_EndStat(); OPC_BegStat(); - OPM_WriteString((CHAR*)"LONGINT *", (LONGINT)10); + OPM_WriteString((CHAR*)"LONGINT *", 10); OPC_Ident(obj); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); base = NIL; } else if ((((((OPC_ptrinit && vis == 0)) && obj->mnolev > 0)) && obj->typ->form == 13)) { - OPM_WriteString((CHAR*)" = NIL", (LONGINT)7); + OPM_WriteString((CHAR*)" = NIL", 7); } } obj = obj->link; @@ -1059,7 +1060,7 @@ static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames) CHAR name[32]; OPM_Write('('); if (obj == NIL || obj->mode == 13) { - OPM_WriteString((CHAR*)"void", (LONGINT)5); + OPM_WriteString((CHAR*)"void", 5); } else { for (;;) { OPC_DeclareBase(obj); @@ -1067,25 +1068,25 @@ static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames) OPM_Write(' '); OPC_DeclareObj(obj, 0); } else { - __COPY(obj->name, name, ((LONGINT)(32))); + __COPY(obj->name, name, 32); obj->name[0] = 0x00; OPC_DeclareObj(obj, 0); - __COPY(name, obj->name, ((LONGINT)(256))); + __COPY(name, obj->name, 256); } if (obj->typ->comp == 3) { - OPM_WriteString((CHAR*)", LONGINT ", (LONGINT)11); + OPM_WriteString((CHAR*)", LONGINT ", 11); OPC_LenList(obj, 1, showParamNames); } else if ((obj->mode == 2 && obj->typ->comp == 4)) { - OPM_WriteString((CHAR*)", LONGINT *", (LONGINT)12); + OPM_WriteString((CHAR*)", LONGINT *", 12); if (showParamNames) { OPC_Ident(obj); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } } if (obj->link == NIL || obj->link->mode == 13) { break; } - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); obj = obj->link; } } @@ -1095,7 +1096,7 @@ static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames) static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define) { if (proc->typ == OPT_notyp) { - OPM_WriteString((CHAR*)"void", (LONGINT)5); + OPM_WriteString((CHAR*)"void", 5); } else { OPC_Ident(proc->typ->strobj); } @@ -1115,7 +1116,7 @@ static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define) OPC_IdentList(proc->link, 2); OPC_Indent(-1); } else { - OPM_WriteString((CHAR*)"();", (LONGINT)4); + OPM_WriteString((CHAR*)"();", 4); OPM_WriteLn(); } } @@ -1126,11 +1127,11 @@ static void OPC_ProcPredefs (OPT_Object obj, SHORTINT vis) OPC_ProcPredefs(obj->left, vis); if ((((__IN(obj->mode, 0xc0) && obj->vis >= vis)) && (obj->history != 4 || obj->mode == 6))) { if (vis == 1) { - OPM_WriteString((CHAR*)"import ", (LONGINT)8); + OPM_WriteString((CHAR*)"import ", 8); } else if (obj->vis == 0) { - OPM_WriteString((CHAR*)"static ", (LONGINT)8); + OPM_WriteString((CHAR*)"static ", 8); } else { - OPM_WriteString((CHAR*)"export ", (LONGINT)8); + OPM_WriteString((CHAR*)"export ", 8); } OPC_ProcHeader(obj, 0); } @@ -1141,10 +1142,10 @@ static void OPC_ProcPredefs (OPT_Object obj, SHORTINT vis) static void OPC_Include (CHAR *name, LONGINT name__len) { __DUP(name, name__len, CHAR); - OPM_WriteString((CHAR*)"#include ", (LONGINT)10); + OPM_WriteString((CHAR*)"#include ", 10); OPM_Write('"'); OPM_WriteStringVar((void*)name, name__len); - OPM_WriteString((CHAR*)".h", (LONGINT)3); + OPM_WriteString((CHAR*)".h", 3); OPM_Write('"'); OPM_WriteLn(); __DEL(name); @@ -1154,8 +1155,8 @@ static void OPC_IncludeImports (OPT_Object obj, INTEGER vis) { if (obj != NIL) { OPC_IncludeImports(obj->left, vis); - if ((((obj->mode == 11 && obj->mnolev != 0)) && (int)OPT_GlbMod[__X(-obj->mnolev, ((LONGINT)(64)))]->vis >= vis)) { - OPC_Include(OPT_GlbMod[__X(-obj->mnolev, ((LONGINT)(64)))]->name, ((LONGINT)(256))); + if ((((obj->mode == 11 && obj->mnolev != 0)) && OPT_GlbMod[__X(-obj->mnolev, 64)]->vis >= vis)) { + OPC_Include(OPT_GlbMod[__X(-obj->mnolev, 64)]->name, 256); } OPC_IncludeImports(obj->right, vis); } @@ -1169,15 +1170,15 @@ static void OPC_GenDynTypes (OPT_Node n, INTEGER vis) if (vis == 0 || typ->ref < 255) { OPC_BegStat(); if (vis == 1) { - OPM_WriteString((CHAR*)"import ", (LONGINT)8); + OPM_WriteString((CHAR*)"import ", 8); } else if ((typ->strobj != NIL && typ->strobj->mnolev > 0)) { - OPM_WriteString((CHAR*)"static ", (LONGINT)8); + OPM_WriteString((CHAR*)"static ", 8); } else { - OPM_WriteString((CHAR*)"export ", (LONGINT)8); + OPM_WriteString((CHAR*)"export ", 8); } - OPM_WriteString((CHAR*)"LONGINT *", (LONGINT)10); + OPM_WriteString((CHAR*)"LONGINT *", 10); OPC_Andent(typ); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); OPC_EndStat(); } n = n->link; @@ -1195,25 +1196,25 @@ void OPC_GenHdr (OPT_Node n) OPC_GenDynTypes(n, 1); OPM_WriteLn(); OPC_ProcPredefs(OPT_topScope->right, 1); - OPM_WriteString((CHAR*)"import ", (LONGINT)8); - OPM_WriteString((CHAR*)"void *", (LONGINT)7); - OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); - OPM_WriteString(OPC_BodyNameExt, ((LONGINT)(13))); + OPM_WriteString((CHAR*)"import ", 8); + OPM_WriteString((CHAR*)"void *", 7); + OPM_WriteStringVar((void*)OPM_modName, 32); + OPM_WriteString(OPC_BodyNameExt, 13); OPC_EndStat(); OPM_WriteLn(); OPC_CProcDefs(OPT_topScope->right, 1); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#endif", (LONGINT)7); + OPM_WriteString((CHAR*)"#endif", 7); OPM_WriteLn(); } static void OPC_GenHeaderMsg (void) { INTEGER i; - OPM_WriteString((CHAR*)"/* ", (LONGINT)4); - OPM_WriteString((CHAR*)"voc", (LONGINT)4); + OPM_WriteString((CHAR*)"/* ", 4); + OPM_WriteString((CHAR*)"voc", 4); OPM_Write(' '); - OPM_WriteString(Configuration_versionLong, ((LONGINT)(41))); + OPM_WriteString(Configuration_versionLong, 41); OPM_Write(' '); i = 0; while (i <= 63) { @@ -1265,14 +1266,14 @@ static void OPC_GenHeaderMsg (void) OPM_Write('v'); break; default: - OPM_LogWStr((CHAR*)"( more options defined in OPM than checked in OPC.GenHeaderMsg, if you are a compiler developer, add them to OPC.GenHeaderMsg", (LONGINT)126); + OPM_LogWStr((CHAR*)"( more options defined in OPM than checked in OPC.GenHeaderMsg, if you are a compiler developer, add them to OPC.GenHeaderMsg", 126); OPM_LogWLn(); break; } } i += 1; } - OPM_WriteString((CHAR*)" */", (LONGINT)4); + OPM_WriteString((CHAR*)" */", 4); OPM_WriteLn(); } @@ -1281,20 +1282,20 @@ void OPC_GenHdrIncludes (void) OPM_currFile = 2; OPC_GenHeaderMsg(); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#ifndef ", (LONGINT)9); - OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); - OPM_WriteString((CHAR*)"__h", (LONGINT)4); + OPM_WriteString((CHAR*)"#ifndef ", 9); + OPM_WriteStringVar((void*)OPM_modName, 32); + OPM_WriteString((CHAR*)"__h", 4); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#define ", (LONGINT)9); - OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); - OPM_WriteString((CHAR*)"__h", (LONGINT)4); + OPM_WriteString((CHAR*)"#define ", 9); + OPM_WriteStringVar((void*)OPM_modName, 32); + OPM_WriteString((CHAR*)"__h", 4); OPM_WriteLn(); OPM_WriteLn(); if (OPM_LIntSize == 8) { - OPM_WriteString((CHAR*)"#define LARGE", (LONGINT)14); + OPM_WriteString((CHAR*)"#define LARGE", 14); OPM_WriteLn(); } - OPC_Include((CHAR*)"SYSTEM", (LONGINT)7); + OPC_Include((CHAR*)"SYSTEM", 7); OPC_IncludeImports(OPT_topScope->right, 1); OPM_WriteLn(); } @@ -1304,10 +1305,10 @@ void OPC_GenBdy (OPT_Node n) OPM_currFile = 1; OPC_GenHeaderMsg(); if (OPM_LIntSize == 8) { - OPM_WriteString((CHAR*)"#define LARGE", (LONGINT)14); + OPM_WriteString((CHAR*)"#define LARGE", 14); OPM_WriteLn(); } - OPC_Include((CHAR*)"SYSTEM", (LONGINT)7); + OPC_Include((CHAR*)"SYSTEM", 7); OPC_IncludeImports(OPT_topScope->right, 0); OPM_WriteLn(); OPC_DefAnonRecs(n); @@ -1330,9 +1331,9 @@ static void OPC_RegCmds (OPT_Object obj) if ((obj->mode == 7 && obj->history != 4)) { if ((((obj->vis != 0 && obj->link == NIL)) && obj->typ == OPT_notyp)) { OPC_BegStat(); - OPM_WriteString((CHAR*)"__REGCMD(\"", (LONGINT)11); - OPM_WriteStringVar((void*)obj->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"\", ", (LONGINT)4); + OPM_WriteString((CHAR*)"__REGCMD(\"", 11); + OPM_WriteStringVar((void*)obj->name, 256); + OPM_WriteString((CHAR*)"\", ", 4); OPC_Ident(obj); OPM_Write(')'); OPC_EndStat(); @@ -1348,8 +1349,8 @@ static void OPC_InitImports (OPT_Object obj) OPC_InitImports(obj->left); if ((obj->mode == 11 && obj->mnolev != 0)) { OPC_BegStat(); - OPM_WriteString((CHAR*)"__MODULE_IMPORT(", (LONGINT)17); - OPM_WriteStringVar((void*)OPT_GlbMod[__X(-obj->mnolev, ((LONGINT)(64)))]->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"__MODULE_IMPORT(", 17); + OPM_WriteStringVar((void*)OPT_GlbMod[__X(-obj->mnolev, 64)]->name, 256); OPM_Write(')'); OPC_EndStat(); } @@ -1367,31 +1368,31 @@ void OPC_GenEnumPtrs (OPT_Object var) if (OPC_NofPtrs(typ) > 0) { if (!OPC_GlbPtrs) { OPC_GlbPtrs = 1; - OPM_WriteString((CHAR*)"static ", (LONGINT)8); + OPM_WriteString((CHAR*)"static ", 8); if (OPC_ansi) { - OPM_WriteString((CHAR*)"void EnumPtrs(void (*P)(void*))", (LONGINT)32); + OPM_WriteString((CHAR*)"void EnumPtrs(void (*P)(void*))", 32); } else { - OPM_WriteString((CHAR*)"void EnumPtrs(P)", (LONGINT)17); + OPM_WriteString((CHAR*)"void EnumPtrs(P)", 17); OPM_WriteLn(); OPM_Write(0x09); - OPM_WriteString((CHAR*)"void (*P)();", (LONGINT)13); + OPM_WriteString((CHAR*)"void (*P)();", 13); } OPM_WriteLn(); OPC_BegBlk(); } OPC_BegStat(); if (typ->form == 13) { - OPM_WriteString((CHAR*)"P(", (LONGINT)3); + OPM_WriteString((CHAR*)"P(", 3); OPC_Ident(var); OPM_Write(')'); } else if (typ->comp == 4) { - OPM_WriteString((CHAR*)"__ENUMR(&", (LONGINT)10); + OPM_WriteString((CHAR*)"__ENUMR(&", 10); OPC_Ident(var); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Andent(typ); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); - OPC_Str1((CHAR*)", #", (LONGINT)4, typ->size); - OPM_WriteString((CHAR*)", 1, P)", (LONGINT)8); + OPM_WriteString((CHAR*)"__typ", 6); + OPC_Str1((CHAR*)", #", 4, typ->size); + OPM_WriteString((CHAR*)", 1, P)", 8); } else if (typ->comp == 2) { n = typ->n; typ = typ->BaseTyp; @@ -1400,17 +1401,17 @@ void OPC_GenEnumPtrs (OPT_Object var) typ = typ->BaseTyp; } if (typ->form == 13) { - OPM_WriteString((CHAR*)"__ENUMP(", (LONGINT)9); + OPM_WriteString((CHAR*)"__ENUMP(", 9); OPC_Ident(var); - OPC_Str1((CHAR*)", #, P)", (LONGINT)8, n); + OPC_Str1((CHAR*)", #, P)", 8, n); } else if (typ->comp == 4) { - OPM_WriteString((CHAR*)"__ENUMR(", (LONGINT)9); + OPM_WriteString((CHAR*)"__ENUMR(", 9); OPC_Ident(var); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Andent(typ); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); - OPC_Str1((CHAR*)", #", (LONGINT)4, typ->size); - OPC_Str1((CHAR*)", #, P)", (LONGINT)8, n); + OPM_WriteString((CHAR*)"__typ", 6); + OPC_Str1((CHAR*)", #", 4, typ->size); + OPC_Str1((CHAR*)", #, P)", 8, n); } } OPC_EndStat(); @@ -1426,49 +1427,49 @@ void OPC_GenEnumPtrs (OPT_Object var) void OPC_EnterBody (void) { OPM_WriteLn(); - OPM_WriteString((CHAR*)"export ", (LONGINT)8); + OPM_WriteString((CHAR*)"export ", 8); if (OPC_mainprog) { if (OPC_ansi) { - OPM_WriteString((CHAR*)"int main(int argc, char **argv)", (LONGINT)32); + OPM_WriteString((CHAR*)"int main(int argc, char **argv)", 32); OPM_WriteLn(); } else { - OPM_WriteString((CHAR*)"main(argc, argv)", (LONGINT)17); + OPM_WriteString((CHAR*)"main(argc, argv)", 17); OPM_WriteLn(); OPM_Write(0x09); - OPM_WriteString((CHAR*)"int argc; char **argv;", (LONGINT)23); + OPM_WriteString((CHAR*)"int argc; char **argv;", 23); OPM_WriteLn(); } } else { - OPM_WriteString((CHAR*)"void *", (LONGINT)7); - OPM_WriteString(OPM_modName, ((LONGINT)(32))); - OPM_WriteString(OPC_BodyNameExt, ((LONGINT)(13))); + OPM_WriteString((CHAR*)"void *", 7); + OPM_WriteString(OPM_modName, 32); + OPM_WriteString(OPC_BodyNameExt, 13); OPM_WriteLn(); } OPC_BegBlk(); OPC_BegStat(); if (OPC_mainprog) { - OPM_WriteString((CHAR*)"__INIT(argc, argv)", (LONGINT)19); + OPM_WriteString((CHAR*)"__INIT(argc, argv)", 19); } else { - OPM_WriteString((CHAR*)"__DEFMOD", (LONGINT)9); + OPM_WriteString((CHAR*)"__DEFMOD", 9); } OPC_EndStat(); if ((OPC_mainprog && 0)) { OPC_BegStat(); - OPM_WriteString((CHAR*)"/*don`t do it!*/ printf(\"DEMO VERSION: DO NOT USE THIS PROGRAM FOR ANY COMMERCIAL PURPOSE\\n\")", (LONGINT)94); + OPM_WriteString((CHAR*)"/*don`t do it!*/ printf(\"DEMO VERSION: DO NOT USE THIS PROGRAM FOR ANY COMMERCIAL PURPOSE\\n\")", 94); OPC_EndStat(); } OPC_InitImports(OPT_topScope->right); OPC_BegStat(); if (OPC_mainprog) { - OPM_WriteString((CHAR*)"__REGMAIN(\"", (LONGINT)12); + OPM_WriteString((CHAR*)"__REGMAIN(\"", 12); } else { - OPM_WriteString((CHAR*)"__REGMOD(\"", (LONGINT)11); + OPM_WriteString((CHAR*)"__REGMOD(\"", 11); } - OPM_WriteString(OPM_modName, ((LONGINT)(32))); + OPM_WriteString(OPM_modName, 32); if (OPC_GlbPtrs) { - OPM_WriteString((CHAR*)"\", EnumPtrs)", (LONGINT)13); + OPM_WriteString((CHAR*)"\", EnumPtrs)", 13); } else { - OPM_WriteString((CHAR*)"\", 0)", (LONGINT)6); + OPM_WriteString((CHAR*)"\", 0)", 6); } OPC_EndStat(); if (__STRCMP(OPM_modName, "SYSTEM") != 0) { @@ -1480,9 +1481,9 @@ void OPC_ExitBody (void) { OPC_BegStat(); if (OPC_mainprog) { - OPM_WriteString((CHAR*)"__FINI;", (LONGINT)8); + OPM_WriteString((CHAR*)"__FINI;", 8); } else { - OPM_WriteString((CHAR*)"__ENDMOD;", (LONGINT)10); + OPM_WriteString((CHAR*)"__ENDMOD;", 10); } OPM_WriteLn(); OPC_EndBlk(); @@ -1492,25 +1493,25 @@ void OPC_DefineInter (OPT_Object proc) { OPT_Object scope = NIL; scope = proc->scope; - OPM_WriteString((CHAR*)"static ", (LONGINT)8); - OPM_WriteString((CHAR*)"struct ", (LONGINT)8); - OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"static ", 8); + OPM_WriteString((CHAR*)"struct ", 8); + OPM_WriteStringVar((void*)scope->name, 256); OPM_Write(' '); OPC_BegBlk(); OPC_IdentList(proc->link, 3); OPC_IdentList(scope->scope, 3); OPC_BegStat(); - OPM_WriteString((CHAR*)"struct ", (LONGINT)8); - OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"struct ", 8); + OPM_WriteStringVar((void*)scope->name, 256); OPM_Write(' '); OPM_Write('*'); - OPM_WriteString((CHAR*)"lnk", (LONGINT)4); + OPM_WriteString((CHAR*)"lnk", 4); OPC_EndStat(); OPC_EndBlk0(); OPM_Write(' '); OPM_Write('*'); - OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteStringVar((void*)scope->name, 256); + OPM_WriteString((CHAR*)"_s", 3); OPC_EndStat(); OPM_WriteLn(); OPC_ProcPredefs(scope->right, 0); @@ -1523,24 +1524,24 @@ void OPC_EnterProc (OPT_Object proc) OPT_Struct typ = NIL; INTEGER dim; if (proc->vis != 1) { - OPM_WriteString((CHAR*)"static ", (LONGINT)8); + OPM_WriteString((CHAR*)"static ", 8); } OPC_ProcHeader(proc, 1); OPC_BegBlk(); if (proc->typ != OPT_notyp) { OPC_BegStat(); OPC_Ident(proc->typ->strobj); - OPM_WriteString((CHAR*)" _o_result;", (LONGINT)12); + OPM_WriteString((CHAR*)" _o_result;", 12); OPM_WriteLn(); } scope = proc->scope; OPC_IdentList(scope->scope, 0); if (!scope->leaf) { OPC_BegStat(); - OPM_WriteString((CHAR*)"struct ", (LONGINT)8); - OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"struct ", 8); + OPM_WriteStringVar((void*)scope->name, 256); OPM_Write(' '); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"_s", 3); OPC_EndStat(); } var = proc->link; @@ -1554,7 +1555,7 @@ void OPC_EnterProc (OPT_Object proc) } OPM_Write(' '); OPC_Ident(var); - OPM_WriteString((CHAR*)"__copy", (LONGINT)7); + OPM_WriteString((CHAR*)"__copy", 7); OPC_EndStat(); } var = var->link; @@ -1567,7 +1568,7 @@ void OPC_EnterProc (OPT_Object proc) OPC_Ident(var->typ->strobj); OPM_Write(' '); OPC_Ident(var); - OPM_WriteString((CHAR*)" = _", (LONGINT)5); + OPM_WriteString((CHAR*)" = _", 5); OPC_Ident(var); OPC_EndStat(); } @@ -1579,31 +1580,31 @@ void OPC_EnterProc (OPT_Object proc) if ((((__IN(var->typ->comp, 0x0c) && var->mode == 1)) && var->typ->sysflag == 0)) { OPC_BegStat(); if (var->typ->comp == 2) { - OPM_WriteString((CHAR*)"__DUPARR(", (LONGINT)10); + OPM_WriteString((CHAR*)"__DUPARR(", 10); OPC_Ident(var); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); if (var->typ->strobj == NIL) { OPM_Mark(200, var->typ->txtpos); } else { OPC_Ident(var->typ->strobj); } } else { - OPM_WriteString((CHAR*)"__DUP(", (LONGINT)7); + OPM_WriteString((CHAR*)"__DUP(", 7); OPC_Ident(var); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Ident(var); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); typ = var->typ->BaseTyp; dim = 1; while (typ->comp == 3) { - OPM_WriteString((CHAR*)" * ", (LONGINT)4); + OPM_WriteString((CHAR*)" * ", 4); OPC_Ident(var); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); OPM_WriteInt(dim); typ = typ->BaseTyp; dim += 1; } - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); if (typ->strobj == NIL) { OPM_Mark(200, typ->txtpos); } else { @@ -1620,12 +1621,12 @@ void OPC_EnterProc (OPT_Object proc) while (var != NIL) { if (!var->leaf) { OPC_BegStat(); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"_s", 3); OPM_Write('.'); OPC_Ident(var); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteString((CHAR*)" = ", 4); if (__IN(var->typ->comp, 0x0c)) { - OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(void*)", 8); } else if (var->mode != 2) { OPM_Write('&'); } @@ -1634,31 +1635,31 @@ void OPC_EnterProc (OPT_Object proc) typ = var->typ; dim = 0; do { - OPM_WriteString((CHAR*)"; ", (LONGINT)3); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"; ", 3); + OPM_WriteString((CHAR*)"_s", 3); OPM_Write('.'); OPC_Ident(var); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); if (dim != 0) { OPM_WriteInt(dim); } - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteString((CHAR*)" = ", 4); OPC_Ident(var); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); if (dim != 0) { OPM_WriteInt(dim); } typ = typ->BaseTyp; } while (!(typ->comp != 3)); } else if ((var->mode == 2 && var->typ->comp == 4)) { - OPM_WriteString((CHAR*)"; ", (LONGINT)3); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"; ", 3); + OPM_WriteString((CHAR*)"_s", 3); OPM_Write('.'); OPC_Ident(var); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteString((CHAR*)"__typ", 6); + OPM_WriteString((CHAR*)" = ", 4); OPC_Ident(var); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } OPC_EndStat(); } @@ -1668,14 +1669,14 @@ void OPC_EnterProc (OPT_Object proc) while (var != NIL) { if (!var->leaf) { OPC_BegStat(); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"_s", 3); OPM_Write('.'); OPC_Ident(var); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteString((CHAR*)" = ", 4); if (var->typ->comp != 2) { OPM_Write('&'); } else { - OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(void*)", 8); } OPC_Ident(var); OPC_EndStat(); @@ -1683,19 +1684,19 @@ void OPC_EnterProc (OPT_Object proc) var = var->link; } OPC_BegStat(); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"_s", 3); OPM_Write('.'); - OPM_WriteString((CHAR*)"lnk", (LONGINT)4); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); - OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"lnk", 4); + OPM_WriteString((CHAR*)" = ", 4); + OPM_WriteStringVar((void*)scope->name, 256); + OPM_WriteString((CHAR*)"_s", 3); OPC_EndStat(); OPC_BegStat(); - OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteStringVar((void*)scope->name, 256); + OPM_WriteString((CHAR*)"_s", 3); + OPM_WriteString((CHAR*)" = ", 4); OPM_Write('&'); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"_s", 3); OPC_EndStat(); } } @@ -1707,7 +1708,7 @@ void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet) indent = eoBlock; if ((implicitRet && proc->typ != OPT_notyp)) { OPM_Write(0x09); - OPM_WriteString((CHAR*)"__RETCHK;", (LONGINT)10); + OPM_WriteString((CHAR*)"__RETCHK;", 10); OPM_WriteLn(); } else if (!eoBlock || implicitRet) { if (!proc->scope->leaf) { @@ -1716,12 +1717,12 @@ void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet) } else { indent = 1; } - OPM_WriteStringVar((void*)proc->scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteStringVar((void*)proc->scope->name, 256); + OPM_WriteString((CHAR*)"_s", 3); + OPM_WriteString((CHAR*)" = ", 4); + OPM_WriteString((CHAR*)"_s", 3); OPM_Write('.'); - OPM_WriteString((CHAR*)"lnk", (LONGINT)4); + OPM_WriteString((CHAR*)"lnk", 4); OPC_EndStat(); } var = proc->link; @@ -1732,7 +1733,7 @@ void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet) } else { indent = 1; } - OPM_WriteString((CHAR*)"__DEL(", (LONGINT)7); + OPM_WriteString((CHAR*)"__DEL(", 7); OPC_Ident(var); OPM_Write(')'); OPC_EndStat(); @@ -1755,9 +1756,9 @@ void OPC_CompleteIdent (OPT_Object obj) if (obj->adr == 1) { if (obj->typ->comp == 4) { OPC_Ident(obj); - OPM_WriteString((CHAR*)"__", (LONGINT)3); + OPM_WriteString((CHAR*)"__", 3); } else { - OPM_WriteString((CHAR*)"((", (LONGINT)3); + OPM_WriteString((CHAR*)"((", 3); OPC_Ident(obj->typ->strobj); OPM_Write(')'); OPC_Ident(obj); @@ -1768,9 +1769,9 @@ void OPC_CompleteIdent (OPT_Object obj) if ((obj->mode != 2 && comp != 3)) { OPM_Write('*'); } - OPM_WriteStringVar((void*)obj->scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); - OPM_WriteString((CHAR*)"->", (LONGINT)3); + OPM_WriteStringVar((void*)obj->scope->name, 256); + OPM_WriteString((CHAR*)"_s", 3); + OPM_WriteString((CHAR*)"->", 3); OPC_Ident(obj); } else { OPC_Ident(obj); @@ -1782,17 +1783,17 @@ void OPC_TypeOf (OPT_Object ap) INTEGER i; __ASSERT(ap->typ->comp == 4, 0); if (ap->mode == 2) { - if ((int)ap->mnolev != OPM_level) { - OPM_WriteStringVar((void*)ap->scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"_s->", (LONGINT)5); + if (ap->mnolev != OPM_level) { + OPM_WriteStringVar((void*)ap->scope->name, 256); + OPM_WriteString((CHAR*)"_s->", 5); OPC_Ident(ap); } else { OPC_Ident(ap); } - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } else if (ap->typ->strobj != NIL) { OPC_Ident(ap->typ->strobj); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } else { OPC_Andent(ap->typ); } @@ -1802,26 +1803,26 @@ void OPC_Cmp (INTEGER rel) { switch (rel) { case 9: - OPM_WriteString((CHAR*)" == ", (LONGINT)5); + OPM_WriteString((CHAR*)" == ", 5); break; case 10: - OPM_WriteString((CHAR*)" != ", (LONGINT)5); + OPM_WriteString((CHAR*)" != ", 5); break; case 11: - OPM_WriteString((CHAR*)" < ", (LONGINT)4); + OPM_WriteString((CHAR*)" < ", 4); break; case 12: - OPM_WriteString((CHAR*)" <= ", (LONGINT)5); + OPM_WriteString((CHAR*)" <= ", 5); break; case 13: - OPM_WriteString((CHAR*)" > ", (LONGINT)4); + OPM_WriteString((CHAR*)" > ", 4); break; case 14: - OPM_WriteString((CHAR*)" >= ", (LONGINT)5); + OPM_WriteString((CHAR*)" >= ", 5); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPC.Cmp, rel = ", (LONGINT)34); - OPM_LogWNum(rel, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPC.Cmp, rel = ", 34); + OPM_LogWNum(rel, 0); OPM_LogWLn(); break; } @@ -1830,7 +1831,7 @@ void OPC_Cmp (INTEGER rel) static void OPC_CharacterLiteral (LONGINT c) { if (c < 32 || c > 126) { - OPM_WriteString((CHAR*)"0x", (LONGINT)3); + OPM_WriteString((CHAR*)"0x", 3); OPM_WriteHex(c); } else { OPM_Write('\''); @@ -1850,7 +1851,7 @@ static void OPC_StringLiteral (CHAR *s, LONGINT s__len, LONGINT l) OPM_Write('"'); i = 0; while (i < l) { - c = (int)s[__X(i, s__len)]; + c = s[__X(i, s__len)]; if (c < 32 || c > 126) { OPM_Write('\\'); OPM_Write((CHAR)(48 + __ASHR(c, 6))); @@ -1873,7 +1874,7 @@ static void OPC_StringLiteral (CHAR *s, LONGINT s__len, LONGINT l) void OPC_Case (LONGINT caseVal, INTEGER form) { CHAR ch; - OPM_WriteString((CHAR*)"case ", (LONGINT)6); + OPM_WriteString((CHAR*)"case ", 6); switch (form) { case 3: OPC_CharacterLiteral(caseVal); @@ -1882,42 +1883,68 @@ void OPC_Case (LONGINT caseVal, INTEGER form) OPM_WriteInt(caseVal); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPC.Case, form = ", (LONGINT)36); - OPM_LogWNum(form, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPC.Case, form = ", 36); + OPM_LogWNum(form, 0); OPM_LogWLn(); break; } - OPM_WriteString((CHAR*)": ", (LONGINT)3); + OPM_WriteString((CHAR*)": ", 3); } void OPC_SetInclude (BOOLEAN exclude) { if (exclude) { - OPM_WriteString((CHAR*)" &= ~", (LONGINT)6); + OPM_WriteString((CHAR*)" &= ~", 6); } else { - OPM_WriteString((CHAR*)" |= ", (LONGINT)5); + OPM_WriteString((CHAR*)" |= ", 5); } } void OPC_Increment (BOOLEAN decrement) { if (decrement) { - OPM_WriteString((CHAR*)" -= ", (LONGINT)5); + OPM_WriteString((CHAR*)" -= ", 5); } else { - OPM_WriteString((CHAR*)" += ", (LONGINT)5); + OPM_WriteString((CHAR*)" += ", 5); } } void OPC_Halt (LONGINT n) { - OPC_Str1((CHAR*)"__HALT(#)", (LONGINT)10, n); + OPC_Str1((CHAR*)"__HALT(#)", 10, n); +} + +void OPC_IntLiteral (LONGINT n, LONGINT size) +{ + if ((((size > 4 && n <= 2147483647)) && n > (-2147483647-1))) { + switch (size) { + case 2: + OPM_WriteString((CHAR*)"((SYSTEM_INT16)(", 17); + break; + case 4: + OPM_WriteString((CHAR*)"((SYSTEM_INT32)(", 17); + break; + case 8: + OPM_WriteString((CHAR*)"((SYSTEM_INT64)(", 17); + break; + default: + OPM_LogWStr((CHAR*)"Unhandled case in OPC.IntLiteral, size = ", 42); + OPM_LogWNum(size, 1); + OPM_LogWLn(); + break; + } + OPM_WriteInt(n); + OPM_WriteString((CHAR*)"))", 3); + } else { + OPM_WriteInt(n); + } } void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim) { if (array->comp == 3) { OPC_CompleteIdent(obj); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); if (dim != 0) { OPM_WriteInt(dim); } @@ -1926,9 +1953,11 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim) array = array->BaseTyp; dim -= 1; } - OPM_WriteString((CHAR*)"((LONGINT)(", (LONGINT)12); - OPM_WriteInt(array->n); - OPM_WriteString((CHAR*)"))", (LONGINT)3); + if (OPC_ansi) { + OPM_WriteInt(array->n); + } else { + OPC_IntLiteral(array->n, OPM_PointerSize); + } } } @@ -1958,7 +1987,7 @@ void OPC_Constant (OPT_Const con, INTEGER form) OPM_WriteReal(con->realval, 0x00); break; case 9: - OPM_WriteString((CHAR*)"0x", (LONGINT)3); + OPM_WriteString((CHAR*)"0x", 3); skipLeading = 1; s = con->setval; i = 64; @@ -1981,14 +2010,14 @@ void OPC_Constant (OPT_Const con, INTEGER form) } break; case 10: - OPC_StringLiteral(*con->ext, ((LONGINT)(256)), con->intval2 - 1); + OPC_StringLiteral(*con->ext, 256, con->intval2 - 1); break; case 11: - OPM_WriteString((CHAR*)"NIL", (LONGINT)4); + OPM_WriteString((CHAR*)"NIL", 4); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPC.Constant, form = ", (LONGINT)40); - OPM_LogWNum(form, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPC.Constant, form = ", 40); + OPM_LogWNum(form, 0); OPM_LogWLn(); break; } @@ -2006,8 +2035,8 @@ static void Enter__49 (CHAR *s, LONGINT s__len) INTEGER h; __DUP(s, s__len, CHAR); h = OPC_PerfectHash((void*)s, s__len); - OPC_hashtab[__X(h, ((LONGINT)(105)))] = *InitKeywords__48_s->n; - __COPY(s, OPC_keytab[__X(*InitKeywords__48_s->n, ((LONGINT)(36)))], ((LONGINT)(9))); + OPC_hashtab[__X(h, 105)] = *InitKeywords__48_s->n; + __COPY(s, OPC_keytab[__X(*InitKeywords__48_s->n, 36)], 9); *InitKeywords__48_s->n += 1; __DEL(s); } @@ -2022,45 +2051,45 @@ static void OPC_InitKeywords (void) n = 0; i = 0; while (i <= 104) { - OPC_hashtab[__X(i, ((LONGINT)(105)))] = -1; + OPC_hashtab[__X(i, 105)] = -1; i += 1; } - Enter__49((CHAR*)"asm", (LONGINT)4); - Enter__49((CHAR*)"auto", (LONGINT)5); - Enter__49((CHAR*)"break", (LONGINT)6); - Enter__49((CHAR*)"case", (LONGINT)5); - Enter__49((CHAR*)"char", (LONGINT)5); - Enter__49((CHAR*)"const", (LONGINT)6); - Enter__49((CHAR*)"continue", (LONGINT)9); - Enter__49((CHAR*)"default", (LONGINT)8); - Enter__49((CHAR*)"do", (LONGINT)3); - Enter__49((CHAR*)"double", (LONGINT)7); - Enter__49((CHAR*)"else", (LONGINT)5); - Enter__49((CHAR*)"enum", (LONGINT)5); - Enter__49((CHAR*)"extern", (LONGINT)7); - Enter__49((CHAR*)"export", (LONGINT)7); - Enter__49((CHAR*)"float", (LONGINT)6); - Enter__49((CHAR*)"for", (LONGINT)4); - Enter__49((CHAR*)"fortran", (LONGINT)8); - Enter__49((CHAR*)"goto", (LONGINT)5); - Enter__49((CHAR*)"if", (LONGINT)3); - Enter__49((CHAR*)"import", (LONGINT)7); - Enter__49((CHAR*)"int", (LONGINT)4); - Enter__49((CHAR*)"long", (LONGINT)5); - Enter__49((CHAR*)"register", (LONGINT)9); - Enter__49((CHAR*)"return", (LONGINT)7); - Enter__49((CHAR*)"short", (LONGINT)6); - Enter__49((CHAR*)"signed", (LONGINT)7); - Enter__49((CHAR*)"sizeof", (LONGINT)7); - Enter__49((CHAR*)"static", (LONGINT)7); - Enter__49((CHAR*)"struct", (LONGINT)7); - Enter__49((CHAR*)"switch", (LONGINT)7); - Enter__49((CHAR*)"typedef", (LONGINT)8); - Enter__49((CHAR*)"union", (LONGINT)6); - Enter__49((CHAR*)"unsigned", (LONGINT)9); - Enter__49((CHAR*)"void", (LONGINT)5); - Enter__49((CHAR*)"volatile", (LONGINT)9); - Enter__49((CHAR*)"while", (LONGINT)6); + Enter__49((CHAR*)"asm", 4); + Enter__49((CHAR*)"auto", 5); + Enter__49((CHAR*)"break", 6); + Enter__49((CHAR*)"case", 5); + Enter__49((CHAR*)"char", 5); + Enter__49((CHAR*)"const", 6); + Enter__49((CHAR*)"continue", 9); + Enter__49((CHAR*)"default", 8); + Enter__49((CHAR*)"do", 3); + Enter__49((CHAR*)"double", 7); + Enter__49((CHAR*)"else", 5); + Enter__49((CHAR*)"enum", 5); + Enter__49((CHAR*)"extern", 7); + Enter__49((CHAR*)"export", 7); + Enter__49((CHAR*)"float", 6); + Enter__49((CHAR*)"for", 4); + Enter__49((CHAR*)"fortran", 8); + Enter__49((CHAR*)"goto", 5); + Enter__49((CHAR*)"if", 3); + Enter__49((CHAR*)"import", 7); + Enter__49((CHAR*)"int", 4); + Enter__49((CHAR*)"long", 5); + Enter__49((CHAR*)"register", 9); + Enter__49((CHAR*)"return", 7); + Enter__49((CHAR*)"short", 6); + Enter__49((CHAR*)"signed", 7); + Enter__49((CHAR*)"sizeof", 7); + Enter__49((CHAR*)"static", 7); + Enter__49((CHAR*)"struct", 7); + Enter__49((CHAR*)"switch", 7); + Enter__49((CHAR*)"typedef", 8); + Enter__49((CHAR*)"union", 6); + Enter__49((CHAR*)"unsigned", 9); + Enter__49((CHAR*)"void", 5); + Enter__49((CHAR*)"volatile", 9); + Enter__49((CHAR*)"while", 6); InitKeywords__48_s = _s.lnk; } diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index de932c60..21b48db8 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h @@ -38,6 +38,7 @@ import void OPC_Increment (BOOLEAN decrement); import void OPC_Indent (INTEGER count); import void OPC_Init (void); import void OPC_InitTDesc (OPT_Struct typ); +import void OPC_IntLiteral (LONGINT n, LONGINT size); import void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim); import LONGINT OPC_NofPtrs (OPT_Struct typ); import void OPC_SetInclude (BOOLEAN exclude); diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 0e43a013..edc81f01 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -155,20 +155,20 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) case 'B': if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_IntSize = (int)s[__X(i, s__len)] - 48; + OPM_IntSize = s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_PointerSize = (int)s[__X(i, s__len)] - 48; + OPM_PointerSize = s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_Alignment = (int)s[__X(i, s__len)] - 48; + OPM_Alignment = s[__X(i, s__len)] - 48; } __ASSERT(OPM_IntSize == 2 || OPM_IntSize == 4, 0); __ASSERT(OPM_PointerSize == 4 || OPM_PointerSize == 8, 0); __ASSERT(OPM_Alignment == 4 || OPM_Alignment == 8, 0); - Files_SetSearchPath((CHAR*)"", (LONGINT)1); + Files_SetSearchPath((CHAR*)"", 1); break; case 'F': *opt = *opt ^ 0x020000; @@ -183,10 +183,10 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) *opt = *opt ^ 0x040000; break; default: - OPM_LogWStr((CHAR*)" warning: option ", (LONGINT)19); + OPM_LogWStr((CHAR*)" warning: option ", 19); OPM_LogW('-'); OPM_LogW(s[__X(i, s__len)]); - OPM_LogWStr((CHAR*)" ignored", (LONGINT)9); + OPM_LogWStr((CHAR*)" ignored", 9); OPM_LogWLn(); break; } @@ -200,71 +200,71 @@ BOOLEAN OPM_OpenPar (void) CHAR s[256]; if (Platform_ArgCount == 1) { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Vishap Oberon-2 compiler v", (LONGINT)27); - OPM_LogWStr(Configuration_versionLong, ((LONGINT)(41))); + OPM_LogWStr((CHAR*)"Vishap Oberon-2 compiler v", 27); + OPM_LogWStr(Configuration_versionLong, 41); OPM_LogW('.'); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Based on Ofront by Software Templ OEG, continued by Norayr Chilingarian and others.", (LONGINT)84); + OPM_LogWStr((CHAR*)"Based on Ofront by Software Templ OEG, continued by Norayr Chilingarian and others.", 84); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Usage:", (LONGINT)7); + OPM_LogWStr((CHAR*)"Usage:", 7); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" ", (LONGINT)3); - OPM_LogWStr((CHAR*)"voc", (LONGINT)4); - OPM_LogWStr((CHAR*)" options {files {options}}.", (LONGINT)28); + OPM_LogWStr((CHAR*)" ", 3); + OPM_LogWStr((CHAR*)"voc", 4); + OPM_LogWStr((CHAR*)" options {files {options}}.", 28); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Where options = [\"-\" {option} ].", (LONGINT)33); + OPM_LogWStr((CHAR*)"Where options = [\"-\" {option} ].", 33); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" m - generate code for main module", (LONGINT)36); + OPM_LogWStr((CHAR*)" m - generate code for main module", 36); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" M - generate code for main module and link object statically", (LONGINT)63); + OPM_LogWStr((CHAR*)" M - generate code for main module and link object statically", 63); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" s - generate new symbol file", (LONGINT)31); + OPM_LogWStr((CHAR*)" s - generate new symbol file", 31); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" e - allow extending the module interface", (LONGINT)43); + OPM_LogWStr((CHAR*)" e - allow extending the module interface", 43); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" r - check value ranges", (LONGINT)25); + OPM_LogWStr((CHAR*)" r - check value ranges", 25); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" x - turn off array indices check", (LONGINT)35); + OPM_LogWStr((CHAR*)" x - turn off array indices check", 35); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" a - don't check ASSERTs at runtime, use this option in tested production code", (LONGINT)80); + OPM_LogWStr((CHAR*)" a - don't check ASSERTs at runtime, use this option in tested production code", 80); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" p - turn off automatic pointer initialization", (LONGINT)48); + OPM_LogWStr((CHAR*)" p - turn off automatic pointer initialization", 48); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" t - don't check type guards (use in rare cases such as low-level modules where every cycle counts)", (LONGINT)101); + OPM_LogWStr((CHAR*)" t - don't check type guards (use in rare cases such as low-level modules where every cycle counts)", 101); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" S - don't call external assembler/compiler, only generate C code", (LONGINT)67); + OPM_LogWStr((CHAR*)" S - don't call external assembler/compiler, only generate C code", 67); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" c - don't call linker", (LONGINT)24); + OPM_LogWStr((CHAR*)" c - don't call linker", 24); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" f - don't use color output", (LONGINT)29); + OPM_LogWStr((CHAR*)" f - don't use color output", 29); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" F - force writing new symbol file in current directory", (LONGINT)57); + OPM_LogWStr((CHAR*)" F - force writing new symbol file in current directory", 57); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" V - verbose output", (LONGINT)21); + OPM_LogWStr((CHAR*)" V - verbose output", 21); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Initial options specify defaults for all files.", (LONGINT)48); + OPM_LogWStr((CHAR*)"Initial options specify defaults for all files.", 48); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Options following a filename are specific to that file.", (LONGINT)56); + OPM_LogWStr((CHAR*)"Options following a filename are specific to that file.", 56); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Repeating an option toggles its value.", (LONGINT)39); + OPM_LogWStr((CHAR*)"Repeating an option toggles its value.", 39); OPM_LogWLn(); _o_result = 0; return _o_result; } else { OPM_S = 1; s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + Platform_GetArg(OPM_S, (void*)s, 256); OPM_glbopt = 0xe9; while (s[0] == '-') { - OPM_ScanOptions((void*)s, ((LONGINT)(256)), &OPM_glbopt); + OPM_ScanOptions((void*)s, 256, &OPM_glbopt); OPM_S += 1; s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + Platform_GetArg(OPM_S, (void*)s, 256); } _o_result = 1; return _o_result; @@ -277,12 +277,12 @@ void OPM_InitOptions (void) CHAR s[256]; OPM_opt = OPM_glbopt; s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + Platform_GetArg(OPM_S, (void*)s, 256); while (s[0] == '-') { - OPM_ScanOptions((void*)s, ((LONGINT)(256)), &OPM_opt); + OPM_ScanOptions((void*)s, 256, &OPM_opt); OPM_S += 1; s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + Platform_GetArg(OPM_S, (void*)s, 256); } OPM_dontAsm = __IN(13, OPM_opt); OPM_dontLink = __IN(14, OPM_opt); @@ -308,19 +308,19 @@ void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len) return; } s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + Platform_GetArg(OPM_S, (void*)s, 256); __NEW(T, Texts_TextDesc); - Texts_Open(T, s, ((LONGINT)(256))); - OPM_LogWStr(s, ((LONGINT)(256))); - OPM_LogWStr((CHAR*)" ", (LONGINT)3); + Texts_Open(T, s, 256); + OPM_LogWStr(s, 256); + OPM_LogWStr((CHAR*)" ", 3); __COPY(s, mname, mname__len); - __COPY(s, OPM_SourceFileName, ((LONGINT)(256))); + __COPY(s, OPM_SourceFileName, 256); if (T->len == 0) { - OPM_LogWStr(s, ((LONGINT)(256))); - OPM_LogWStr((CHAR*)" not found.", (LONGINT)12); + OPM_LogWStr(s, 256); + OPM_LogWStr((CHAR*)" not found.", 12); OPM_LogWLn(); } else { - Texts_OpenReader(&OPM_inR, Texts_Reader__typ, T, ((LONGINT)(0))); + Texts_OpenReader(&OPM_inR, Texts_Reader__typ, T, 0); *done = 1; } OPM_S += 1; @@ -379,25 +379,25 @@ static void OPM_LogErrMsg (INTEGER n) CHAR buf[1024]; if (n >= 0) { if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"31m", (LONGINT)4); + vt100_SetAttr((CHAR*)"31m", 4); } - OPM_LogWStr((CHAR*)" err ", (LONGINT)7); + OPM_LogWStr((CHAR*)" err ", 7); if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + vt100_SetAttr((CHAR*)"0m", 3); } } else { if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"35m", (LONGINT)4); + vt100_SetAttr((CHAR*)"35m", 4); } - OPM_LogWStr((CHAR*)" warning ", (LONGINT)11); + OPM_LogWStr((CHAR*)" warning ", 11); n = -n; if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + vt100_SetAttr((CHAR*)"0m", 3); } } - OPM_LogWNum(n, ((LONGINT)(1))); - OPM_LogWStr((CHAR*)" ", (LONGINT)3); - OPM_LogWStr(errors_errors[__X(n, ((LONGINT)(350)))], ((LONGINT)(128))); + OPM_LogWNum(n, 1); + OPM_LogWStr((CHAR*)" ", 3); + OPM_LogWStr(errors_errors[__X(n, 350)], 128); } static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, LONGINT pos) @@ -439,37 +439,37 @@ static void OPM_ShowLine (LONGINT pos) CHAR line[1023]; INTEGER i; CHAR ch; - f = Files_Old(OPM_SourceFileName, ((LONGINT)(256))); + f = Files_Old(OPM_SourceFileName, 256); OPM_FindLine(f, &r, Files_Rider__typ, pos); i = 0; Files_Read(&r, Files_Rider__typ, (void*)&ch); while ((((((ch != 0x00 && ch != 0x0d)) && ch != 0x0a)) && i < 1022)) { - line[__X(i, ((LONGINT)(1023)))] = ch; + line[__X(i, 1023)] = ch; i += 1; Files_Read(&r, Files_Rider__typ, (void*)&ch); } - line[__X(i, ((LONGINT)(1023)))] = 0x00; + line[__X(i, 1023)] = 0x00; OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWNum(OPM_ErrorLineNumber, ((LONGINT)(4))); - OPM_LogWStr((CHAR*)": ", (LONGINT)3); - OPM_LogWStr(line, ((LONGINT)(1023))); + OPM_LogWNum(OPM_ErrorLineNumber, 4); + OPM_LogWStr((CHAR*)": ", 3); + OPM_LogWStr(line, 1023); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" ", (LONGINT)7); + OPM_LogWStr((CHAR*)" ", 7); if (pos >= OPM_ErrorLineLimitPos) { pos = OPM_ErrorLineLimitPos - 1; } - i = (int)(pos - OPM_ErrorLineStartPos); + i = (SYSTEM_INT32)(pos - OPM_ErrorLineStartPos); while (i > 0) { OPM_LogW(' '); i -= 1; } if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"32m", (LONGINT)4); + vt100_SetAttr((CHAR*)"32m", 4); } OPM_LogW('^'); if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + vt100_SetAttr((CHAR*)"0m", 3); } Files_Close(f); } @@ -485,30 +485,30 @@ void OPM_Mark (INTEGER n, LONGINT pos) OPM_lasterrpos = pos; OPM_ShowLine(pos); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" ", (LONGINT)3); + OPM_LogWStr((CHAR*)" ", 3); if (n < 249) { - OPM_LogWStr((CHAR*)" pos", (LONGINT)6); - OPM_LogWNum(pos, ((LONGINT)(6))); + OPM_LogWStr((CHAR*)" pos", 6); + OPM_LogWNum(pos, 6); OPM_LogErrMsg(n); } else if (n == 255) { - OPM_LogWStr((CHAR*)"pos", (LONGINT)4); - OPM_LogWNum(pos, ((LONGINT)(6))); - OPM_LogWStr((CHAR*)" pc ", (LONGINT)6); - OPM_LogWNum(OPM_breakpc, ((LONGINT)(1))); + OPM_LogWStr((CHAR*)"pos", 4); + OPM_LogWNum(pos, 6); + OPM_LogWStr((CHAR*)" pc ", 6); + OPM_LogWNum(OPM_breakpc, 1); } else if (n == 254) { - OPM_LogWStr((CHAR*)"pc not found", (LONGINT)13); + OPM_LogWStr((CHAR*)"pc not found", 13); } else { - OPM_LogWStr(OPM_objname, ((LONGINT)(64))); + OPM_LogWStr(OPM_objname, 64); if (n == 253) { - OPM_LogWStr((CHAR*)" is new, compile with option e", (LONGINT)31); + OPM_LogWStr((CHAR*)" is new, compile with option e", 31); } else if (n == 252) { - OPM_LogWStr((CHAR*)" is redefined, compile with option s", (LONGINT)37); + OPM_LogWStr((CHAR*)" is redefined, compile with option s", 37); } else if (n == 251) { - OPM_LogWStr((CHAR*)" is redefined (private part only), compile with option s", (LONGINT)57); + OPM_LogWStr((CHAR*)" is redefined (private part only), compile with option s", 57); } else if (n == 250) { - OPM_LogWStr((CHAR*)" is no longer visible, compile with option s", (LONGINT)45); + OPM_LogWStr((CHAR*)" is no longer visible, compile with option s", 45); } else if (n == 249) { - OPM_LogWStr((CHAR*)" is not consistently imported, recompile imports", (LONGINT)49); + OPM_LogWStr((CHAR*)" is not consistently imported, recompile imports", 49); } } } @@ -516,8 +516,8 @@ void OPM_Mark (INTEGER n, LONGINT pos) if (pos >= 0) { OPM_ShowLine(pos); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" pos", (LONGINT)6); - OPM_LogWNum(pos, ((LONGINT)(6))); + OPM_LogWStr((CHAR*)" pos", 6); + OPM_LogWNum(pos, 6); } OPM_LogErrMsg(n); if (pos < 0) { @@ -533,19 +533,19 @@ void OPM_err (INTEGER n) void OPM_FPrint (LONGINT *fp, LONGINT val) { - *fp = __ROTL((LONGINT)((SET)*fp ^ (SET)val), 1, LONGINT); + *fp = __ROTL((LONGINT)(__VAL(SET, *fp) ^ __VAL(SET, val)), 1, LONGINT); } void OPM_FPrintSet (LONGINT *fp, SET set) { - OPM_FPrint(&*fp, (LONGINT)set); + OPM_FPrint(&*fp, __VAL(LONGINT, set)); } void OPM_FPrintReal (LONGINT *fp, REAL real) { INTEGER i; LONGINT l; - __GET((LONGINT)(SYSTEM_ADRINT)&real, i, INTEGER); + __GET((SYSTEM_ADRINT)&real, i, INTEGER); l = i; OPM_FPrint(&*fp, l); } @@ -562,19 +562,19 @@ static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONG if (((*S).class == 1 && __STRCMP((*S).s, name) == 0)) { Texts_Scan(&*S, S__typ); if ((*S).class == 3) { - *size = (int)(*S).i; + *size = (SYSTEM_INT32)(*S).i; Texts_Scan(&*S, S__typ); } else { - OPM_Mark(-157, ((LONGINT)(-1))); + OPM_Mark(-157, -1); } if ((*S).class == 3) { - *align = (int)(*S).i; + *align = (SYSTEM_INT32)(*S).i; Texts_Scan(&*S, S__typ); } else { - OPM_Mark(-157, ((LONGINT)(-1))); + OPM_Mark(-157, -1); } } else { - OPM_Mark(-157, ((LONGINT)(-1))); + OPM_Mark(-157, -1); } __DEL(name); } @@ -603,40 +603,40 @@ static LONGINT OPM_power0 (LONGINT i, LONGINT j) static void OPM_VerboseListSizes (void) { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Type Size Alignement", (LONGINT)29); + OPM_LogWStr((CHAR*)"Type Size Alignement", 29); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"CHAR ", (LONGINT)14); - OPM_LogWNum(OPM_CharSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"CHAR ", 14); + OPM_LogWNum(OPM_CharSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"BOOLEAN ", (LONGINT)14); - OPM_LogWNum(OPM_BoolSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"BOOLEAN ", 14); + OPM_LogWNum(OPM_BoolSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"SHORTINT ", (LONGINT)14); - OPM_LogWNum(OPM_SIntSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"SHORTINT ", 14); + OPM_LogWNum(OPM_SIntSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"INTEGER ", (LONGINT)14); - OPM_LogWNum(OPM_IntSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"INTEGER ", 14); + OPM_LogWNum(OPM_IntSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"LONGINT ", (LONGINT)14); - OPM_LogWNum(OPM_LIntSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"LONGINT ", 14); + OPM_LogWNum(OPM_LIntSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"SET ", (LONGINT)14); - OPM_LogWNum(OPM_SetSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"SET ", 14); + OPM_LogWNum(OPM_SetSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"REAL ", (LONGINT)14); - OPM_LogWNum(OPM_RealSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"REAL ", 14); + OPM_LogWNum(OPM_RealSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"LONGREAL ", (LONGINT)14); - OPM_LogWNum(OPM_LRealSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"LONGREAL ", 14); + OPM_LogWNum(OPM_LRealSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"PTR ", (LONGINT)14); - OPM_LogWNum(OPM_PointerSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"PTR ", 14); + OPM_LogWNum(OPM_PointerSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"PROC ", (LONGINT)14); - OPM_LogWNum(OPM_ProcSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"PROC ", 14); + OPM_LogWNum(OPM_ProcSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"RECORD ", (LONGINT)14); - OPM_LogWNum(OPM_RecSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"RECORD ", 14); + OPM_LogWNum(OPM_RecSize, 4); OPM_LogWLn(); OPM_LogWLn(); } @@ -719,11 +719,11 @@ void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done) { CHAR ch; OPM_FileName fileName; - OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, ((LONGINT)(32)), (CHAR*)".sym", (LONGINT)5); - OPM_oldSFile = Files_Old(fileName, ((LONGINT)(32))); + OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, 32, (CHAR*)".sym", 5); + OPM_oldSFile = Files_Old(fileName, 32); *done = OPM_oldSFile != NIL; if (*done) { - Files_Set(&OPM_oldSF, Files_Rider__typ, OPM_oldSFile, ((LONGINT)(0))); + Files_Set(&OPM_oldSF, Files_Rider__typ, OPM_oldSFile, 0); Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&ch); if (ch != 0xf7) { OPM_err(-306); @@ -752,7 +752,7 @@ void OPM_SymWInt (LONGINT i) void OPM_SymWSet (SET s) { - Files_WriteNum(&OPM_newSF, Files_Rider__typ, (LONGINT)s); + Files_WriteNum(&OPM_newSF, Files_Rider__typ, __VAL(LONGINT, s)); } void OPM_SymWReal (REAL r) @@ -779,10 +779,10 @@ void OPM_DeleteNewSym (void) void OPM_NewSym (CHAR *modName, LONGINT modName__len) { OPM_FileName fileName; - OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, ((LONGINT)(32)), (CHAR*)".sym", (LONGINT)5); - OPM_newSFile = Files_New(fileName, ((LONGINT)(32))); + OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, 32, (CHAR*)".sym", 5); + OPM_newSFile = Files_New(fileName, 32); if (OPM_newSFile != NIL) { - Files_Set(&OPM_newSF, Files_Rider__typ, OPM_newSFile, ((LONGINT)(0))); + Files_Set(&OPM_newSF, Files_Rider__typ, OPM_newSFile, 0); Files_Write(&OPM_newSF, Files_Rider__typ, 0xf7); } else { OPM_err(153); @@ -791,7 +791,7 @@ void OPM_NewSym (CHAR *modName, LONGINT modName__len) void OPM_Write (CHAR ch) { - Files_Write(&OPM_R[__X(OPM_currFile, ((LONGINT)(3)))], Files_Rider__typ, ch); + Files_Write(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, ch); } void OPM_WriteString (CHAR *s, LONGINT s__len) @@ -801,7 +801,7 @@ void OPM_WriteString (CHAR *s, LONGINT s__len) while (s[__X(i, s__len)] != 0x00) { i += 1; } - Files_WriteBytes(&OPM_R[__X(OPM_currFile, ((LONGINT)(3)))], Files_Rider__typ, (void*)s, s__len * ((LONGINT)(1)), i); + Files_WriteBytes(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, (void*)s, s__len * 1, i); } void OPM_WriteStringVar (CHAR *s, LONGINT s__len) @@ -811,27 +811,27 @@ void OPM_WriteStringVar (CHAR *s, LONGINT s__len) while (s[__X(i, s__len)] != 0x00) { i += 1; } - Files_WriteBytes(&OPM_R[__X(OPM_currFile, ((LONGINT)(3)))], Files_Rider__typ, (void*)s, s__len * ((LONGINT)(1)), i); + Files_WriteBytes(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, (void*)s, s__len * 1, i); } void OPM_WriteHex (LONGINT i) { CHAR s[3]; INTEGER digit; - digit = __ASHR((int)i, 4); + digit = __ASHR((SYSTEM_INT32)i, 4); if (digit < 10) { s[0] = (CHAR)(48 + digit); } else { s[0] = (CHAR)(87 + digit); } - digit = __MASK((int)i, -16); + digit = __MASK((SYSTEM_INT32)i, -16); if (digit < 10) { s[1] = (CHAR)(48 + digit); } else { s[1] = (CHAR)(87 + digit); } s[2] = 0x00; - OPM_WriteString(s, ((LONGINT)(3))); + OPM_WriteString(s, 3); } void OPM_WriteInt (LONGINT i) @@ -841,24 +841,24 @@ void OPM_WriteInt (LONGINT i) if (i == OPM_SignedMinimum(OPM_IntSize) || i == OPM_SignedMinimum(OPM_LIntSize)) { OPM_Write('('); OPM_WriteInt(i + 1); - OPM_WriteString((CHAR*)"-1)", (LONGINT)4); + OPM_WriteString((CHAR*)"-1)", 4); } else { i1 = __ABS(i); s[0] = (CHAR)(__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k = 1; while (i1 > 0) { - s[__X(k, ((LONGINT)(20)))] = (CHAR)(__MOD(i1, 10) + 48); + s[__X(k, 20)] = (CHAR)(__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k += 1; } if (i < 0) { - s[__X(k, ((LONGINT)(20)))] = '-'; + s[__X(k, 20)] = '-'; k += 1; } while (k > 0) { k -= 1; - OPM_Write(s[__X(k, ((LONGINT)(20)))]); + OPM_Write(s[__X(k, 20)]); } } } @@ -873,9 +873,9 @@ void OPM_WriteReal (LONGREAL r, CHAR suffx) INTEGER i; if ((((r < OPM_SignedMaximum(OPM_LIntSize) && r > OPM_SignedMinimum(OPM_LIntSize))) && r == (__ENTIER(r)))) { if (suffx == 'f') { - OPM_WriteString((CHAR*)"(REAL)", (LONGINT)7); + OPM_WriteString((CHAR*)"(REAL)", 7); } else { - OPM_WriteString((CHAR*)"(LONGREAL)", (LONGINT)11); + OPM_WriteString((CHAR*)"(LONGREAL)", 11); } OPM_WriteInt(__ENTIER(r)); } else { @@ -886,33 +886,33 @@ void OPM_WriteReal (LONGREAL r, CHAR suffx) Texts_WriteLongReal(&W, Texts_Writer__typ, r, 23); } __NEW(T, Texts_TextDesc); - Texts_Open(T, (CHAR*)"", (LONGINT)1); + Texts_Open(T, (CHAR*)"", 1); Texts_Append(T, W.buf); - Texts_OpenReader(&R, Texts_Reader__typ, T, ((LONGINT)(0))); + Texts_OpenReader(&R, Texts_Reader__typ, T, 0); i = 0; Texts_Read(&R, Texts_Reader__typ, &ch); while (ch != 0x00) { - s[__X(i, ((LONGINT)(32)))] = ch; + s[__X(i, 32)] = ch; i += 1; Texts_Read(&R, Texts_Reader__typ, &ch); } - s[__X(i, ((LONGINT)(32)))] = 0x00; + s[__X(i, 32)] = 0x00; i = 0; ch = s[0]; while ((ch != 'D' && ch != 0x00)) { i += 1; - ch = s[__X(i, ((LONGINT)(32)))]; + ch = s[__X(i, 32)]; } if (ch == 'D') { - s[__X(i, ((LONGINT)(32)))] = 'e'; + s[__X(i, 32)] = 'e'; } - OPM_WriteString(s, ((LONGINT)(32))); + OPM_WriteString(s, 32); } } void OPM_WriteLn (void) { - Files_Write(&OPM_R[__X(OPM_currFile, ((LONGINT)(3)))], Files_Rider__typ, 0x0a); + Files_Write(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, 0x0a); } static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F) @@ -920,11 +920,11 @@ static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F) Files_Rider R1; CHAR buffer[4096]; if (F != NIL) { - Files_Set(&R1, Files_Rider__typ, F, ((LONGINT)(0))); - Files_ReadBytes(&R1, Files_Rider__typ, (void*)buffer, ((LONGINT)(4096)), ((LONGINT)(4096))); + Files_Set(&R1, Files_Rider__typ, F, 0); + Files_ReadBytes(&R1, Files_Rider__typ, (void*)buffer, 4096, 4096); while (4096 - R1.res > 0) { - Files_WriteBytes(&*R, R__typ, (void*)buffer, ((LONGINT)(4096)), 4096 - R1.res); - Files_ReadBytes(&R1, Files_Rider__typ, (void*)buffer, ((LONGINT)(4096)), ((LONGINT)(4096))); + Files_WriteBytes(&*R, R__typ, (void*)buffer, 4096, 4096 - R1.res); + Files_ReadBytes(&R1, Files_Rider__typ, (void*)buffer, 4096, 4096); } } } @@ -932,24 +932,24 @@ static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F) void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len) { CHAR FName[32]; - __COPY(moduleName, OPM_modName, ((LONGINT)(32))); - OPM_HFile = Files_New((CHAR*)"", (LONGINT)1); + __COPY(moduleName, OPM_modName, 32); + OPM_HFile = Files_New((CHAR*)"", 1); if (OPM_HFile != NIL) { - Files_Set(&OPM_R[0], Files_Rider__typ, OPM_HFile, ((LONGINT)(0))); + Files_Set(&OPM_R[0], Files_Rider__typ, OPM_HFile, 0); } else { OPM_err(153); } - OPM_MakeFileName((void*)moduleName, moduleName__len, (void*)FName, ((LONGINT)(32)), (CHAR*)".c", (LONGINT)3); - OPM_BFile = Files_New(FName, ((LONGINT)(32))); + OPM_MakeFileName((void*)moduleName, moduleName__len, (void*)FName, 32, (CHAR*)".c", 3); + OPM_BFile = Files_New(FName, 32); if (OPM_BFile != NIL) { - Files_Set(&OPM_R[1], Files_Rider__typ, OPM_BFile, ((LONGINT)(0))); + Files_Set(&OPM_R[1], Files_Rider__typ, OPM_BFile, 0); } else { OPM_err(153); } - OPM_MakeFileName((void*)moduleName, moduleName__len, (void*)FName, ((LONGINT)(32)), (CHAR*)".h", (LONGINT)3); - OPM_HIFile = Files_New(FName, ((LONGINT)(32))); + OPM_MakeFileName((void*)moduleName, moduleName__len, (void*)FName, 32, (CHAR*)".h", 3); + OPM_HIFile = Files_New(FName, 32); if (OPM_HIFile != NIL) { - Files_Set(&OPM_R[2], Files_Rider__typ, OPM_HIFile, ((LONGINT)(0))); + Files_Set(&OPM_R[2], Files_Rider__typ, OPM_HIFile, 0); } else { OPM_err(153); } @@ -960,9 +960,9 @@ void OPM_CloseFiles (void) CHAR FName[32]; INTEGER res; if (OPM_noerr) { - OPM_LogWStr((CHAR*)" ", (LONGINT)3); - OPM_LogWNum(Files_Pos(&OPM_R[1], Files_Rider__typ), ((LONGINT)(0))); - OPM_LogWStr((CHAR*)" chars.", (LONGINT)8); + OPM_LogWStr((CHAR*)" ", 3); + OPM_LogWNum(Files_Pos(&OPM_R[1], Files_Rider__typ), 0); + OPM_LogWStr((CHAR*)" chars.", 8); } if (OPM_noerr) { if (__STRCMP(OPM_modName, "SYSTEM") == 0) { @@ -974,10 +974,10 @@ void OPM_CloseFiles (void) Files_Register(OPM_HIFile); Files_Register(OPM_BFile); } else { - OPM_MakeFileName((void*)OPM_modName, ((LONGINT)(32)), (void*)FName, ((LONGINT)(32)), (CHAR*)".h", (LONGINT)3); - Files_Delete(FName, ((LONGINT)(32)), &res); - OPM_MakeFileName((void*)OPM_modName, ((LONGINT)(32)), (void*)FName, ((LONGINT)(32)), (CHAR*)".sym", (LONGINT)5); - Files_Delete(FName, ((LONGINT)(32)), &res); + OPM_MakeFileName((void*)OPM_modName, 32, (void*)FName, 32, (CHAR*)".h", 3); + Files_Delete(FName, 32, &res); + OPM_MakeFileName((void*)OPM_modName, 32, (void*)FName, 32, (CHAR*)".sym", 5); + Files_Delete(FName, 32, &res); Files_Register(OPM_BFile); } } @@ -986,11 +986,11 @@ void OPM_CloseFiles (void) OPM_HIFile = NIL; OPM_newSFile = NIL; OPM_oldSFile = NIL; - Files_Set(&OPM_R[0], Files_Rider__typ, NIL, ((LONGINT)(0))); - Files_Set(&OPM_R[1], Files_Rider__typ, NIL, ((LONGINT)(0))); - Files_Set(&OPM_R[2], Files_Rider__typ, NIL, ((LONGINT)(0))); - Files_Set(&OPM_newSF, Files_Rider__typ, NIL, ((LONGINT)(0))); - Files_Set(&OPM_oldSF, Files_Rider__typ, NIL, ((LONGINT)(0))); + Files_Set(&OPM_R[0], Files_Rider__typ, NIL, 0); + Files_Set(&OPM_R[1], Files_Rider__typ, NIL, 0); + Files_Set(&OPM_R[2], Files_Rider__typ, NIL, 0); + Files_Set(&OPM_newSF, Files_Rider__typ, NIL, 0); + Files_Set(&OPM_oldSF, Files_Rider__typ, NIL, 0); } static void EnumPtrs(void (*P)(void*)) @@ -1031,15 +1031,15 @@ export void *OPM__init(void) /* BEGIN */ Texts_OpenWriter(&OPM_W, Texts_Writer__typ); OPM_MODULES[0] = 0x00; - Platform_GetEnv((CHAR*)"MODULES", (LONGINT)8, (void*)OPM_MODULES, ((LONGINT)(1024))); + Platform_GetEnv((CHAR*)"MODULES", 8, (void*)OPM_MODULES, 1024); __MOVE(".", OPM_OBERON, 2); - Platform_GetEnv((CHAR*)"OBERON", (LONGINT)7, (void*)OPM_OBERON, ((LONGINT)(1024))); - Strings_Append((CHAR*)";.;", (LONGINT)4, (void*)OPM_OBERON, ((LONGINT)(1024))); - Strings_Append(OPM_MODULES, ((LONGINT)(1024)), (void*)OPM_OBERON, ((LONGINT)(1024))); - Strings_Append((CHAR*)";", (LONGINT)2, (void*)OPM_OBERON, ((LONGINT)(1024))); - Strings_Append((CHAR*)"/opt/voc", (LONGINT)9, (void*)OPM_OBERON, ((LONGINT)(1024))); - Strings_Append((CHAR*)"/sym;", (LONGINT)6, (void*)OPM_OBERON, ((LONGINT)(1024))); - Files_SetSearchPath(OPM_OBERON, ((LONGINT)(1024))); + Platform_GetEnv((CHAR*)"OBERON", 7, (void*)OPM_OBERON, 1024); + Strings_Append((CHAR*)";.;", 4, (void*)OPM_OBERON, 1024); + Strings_Append(OPM_MODULES, 1024, (void*)OPM_OBERON, 1024); + Strings_Append((CHAR*)";", 2, (void*)OPM_OBERON, 1024); + Strings_Append((CHAR*)"/opt/voc", 9, (void*)OPM_OBERON, 1024); + Strings_Append((CHAR*)"/sym;", 6, (void*)OPM_OBERON, 1024); + Files_SetSearchPath(OPM_OBERON, 1024); OPM_CharSize = 1; OPM_BoolSize = 1; OPM_SIntSize = 1; diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index e94f0303..5363c227 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index 63b71ce5..c525c696 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPB.h" @@ -59,7 +59,7 @@ static void OPP_err (INTEGER n) static void OPP_CheckSym (INTEGER s) { - if ((int)OPP_sym == s) { + if (OPP_sym == s) { OPS_Get(&OPP_sym); } else { OPM_err(s); @@ -105,7 +105,7 @@ static void OPP_ConstExpression (OPT_Node *x) OPP_Expression(&*x); if ((*x)->class != 7) { OPP_err(50); - *x = OPB_NewIntConst(((LONGINT)(1))); + *x = OPB_NewIntConst(1); } } @@ -147,7 +147,7 @@ static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_) OPP_err(51); sf = 0; } - *sysflag = (int)sf; + *sysflag = (SYSTEM_INT32)sf; OPP_CheckSym(23); } else { *sysflag = default_; @@ -309,13 +309,13 @@ static void OPP_PointerType (OPT_Struct *typ) OPT_Find(&id); if (id == NIL) { if (OPP_nofFwdPtr < 64) { - OPP_FwdPtr[__X(OPP_nofFwdPtr, ((LONGINT)(64)))] = *typ; + OPP_FwdPtr[__X(OPP_nofFwdPtr, 64)] = *typ; OPP_nofFwdPtr += 1; } else { OPP_err(224); } (*typ)->link = OPT_NewObj(); - __COPY(OPS_name, (*typ)->link->name, ((LONGINT)(256))); + __COPY(OPS_name, (*typ)->link->name, 256); (*typ)->BaseTyp = OPT_undftyp; OPS_Get(&OPP_sym); } else { @@ -519,7 +519,7 @@ static void OPP_selector (OPT_Node *x) } else if (OPP_sym == 18) { OPS_Get(&OPP_sym); if (OPP_sym == 38) { - __COPY(OPS_name, name, ((LONGINT)(256))); + __COPY(OPS_name, name, 256); OPS_Get(&OPP_sym); if ((*x)->typ != NIL) { if ((*x)->typ->form == 13) { @@ -626,7 +626,7 @@ static void OPP_StandProcCall (OPT_Node *x) OPT_Node y = NIL; SHORTINT m; INTEGER n; - m = (int)(*x)->obj->adr; + m = (SYSTEM_INT8)(*x)->obj->adr; n = 0; if (OPP_sym == 30) { OPS_Get(&OPP_sym); @@ -743,8 +743,8 @@ static void OPP_Factor (OPT_Node *x) *x = OPB_NewRealConst(OPS_lrlval, OPT_lrltyp); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPP.Factor, OPS.numtyp = ", (LONGINT)44); - OPM_LogWNum(OPS_numtyp, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPP.Factor, OPS.numtyp = ", 44); + OPM_LogWNum(OPS_numtyp, 0); OPM_LogWLn(); break; } @@ -777,7 +777,7 @@ static void OPP_Factor (OPT_Node *x) *x = NIL; } if (*x == NIL) { - *x = OPB_NewIntConst(((LONGINT)(1))); + *x = OPB_NewIntConst(1); (*x)->typ = OPT_undftyp; } } @@ -859,7 +859,7 @@ static void OPP_Receiver (SHORTINT *mode, OPS_Name name, OPT_Struct *typ, OPT_St } else { *mode = 1; } - __COPY(OPS_name, name, ((LONGINT)(256))); + __COPY(OPS_name, name, 256); OPP_CheckSym(38); OPP_CheckSym(20); if (OPP_sym == 38) { @@ -933,8 +933,8 @@ static void GetCode__19 (void) (*ProcedureDeclaration__16_s->proc)->conval->ext = ext; n = 0; if (OPP_sym == 37) { - while (OPS_str[__X(n, ((LONGINT)(256)))] != 0x00) { - (*ext)[__X(n + 1, ((LONGINT)(256)))] = OPS_str[__X(n, ((LONGINT)(256)))]; + while (OPS_str[__X(n, 256)] != 0x00) { + (*ext)[__X(n + 1, 256)] = OPS_str[__X(n, 256)]; n += 1; } (*ext)[0] = (CHAR)n; @@ -950,7 +950,7 @@ static void GetCode__19 (void) n = 1; } OPS_Get(&OPP_sym); - (*ext)[__X(n, ((LONGINT)(256)))] = (CHAR)c; + (*ext)[__X(n, 256)] = (CHAR)c; } if (OPP_sym == 19) { OPS_Get(&OPP_sym); @@ -1024,7 +1024,7 @@ static void TProcDecl__23 (void) } OPP_Receiver(&objMode, objName, &objTyp, &recTyp); if (OPP_sym == 38) { - __COPY(OPS_name, *ProcedureDeclaration__16_s->name, ((LONGINT)(256))); + __COPY(OPS_name, *ProcedureDeclaration__16_s->name, 256); OPP_CheckMark(&*ProcedureDeclaration__16_s->vis); OPT_FindField(*ProcedureDeclaration__16_s->name, recTyp, &*ProcedureDeclaration__16_s->fwd); OPT_FindField(*ProcedureDeclaration__16_s->name, recTyp->BaseTyp, &baseProc); @@ -1123,7 +1123,7 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) TProcDecl__23(); } else if (OPP_sym == 38) { OPT_Find(&fwd); - __COPY(OPS_name, name, ((LONGINT)(256))); + __COPY(OPS_name, name, 256); OPP_CheckMark(&vis); if ((vis != 0 && mode == 6)) { mode = 7; @@ -1184,14 +1184,14 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, O if (!__IN(LabelTyp->form, 0x70) || LabelTyp->size < x->typ->size) { OPP_err(60); } - } else if ((int)LabelTyp->form != f) { + } else if (LabelTyp->form != f) { OPP_err(60); } if (OPP_sym == 21) { OPS_Get(&OPP_sym); OPP_ConstExpression(&y); yval = y->conval->intval; - if (((int)y->typ->form != f && !((__IN(f, 0x70) && __IN(y->typ->form, 0x70))))) { + if ((y->typ->form != f && !((__IN(f, 0x70) && __IN(y->typ->form, 0x70))))) { OPP_err(60); } if (yval < xval) { @@ -1208,17 +1208,17 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, O if (i == 0) { break; } - if (tab[__X(i - 1, ((LONGINT)(128)))].low <= yval) { - if (tab[__X(i - 1, ((LONGINT)(128)))].high >= xval) { + if (tab[__X(i - 1, 128)].low <= yval) { + if (tab[__X(i - 1, 128)].high >= xval) { OPP_err(62); } break; } - tab[__X(i, ((LONGINT)(128)))] = tab[__X(i - 1, ((LONGINT)(128)))]; + tab[__X(i, 128)] = tab[__X(i - 1, 128)]; i -= 1; } - tab[__X(i, ((LONGINT)(128)))].low = xval; - tab[__X(i, ((LONGINT)(128)))].high = yval; + tab[__X(i, 128)].low = xval; + tab[__X(i, 128)].high = yval; *n += 1; } else { OPP_err(213); @@ -1277,7 +1277,7 @@ static void CasePart__31 (OPT_Node *x) } if (n > 0) { low = tab[0].low; - high = tab[__X(n - 1, ((LONGINT)(128)))].high; + high = tab[__X(n - 1, 128)].high; if (high - low > 512) { OPP_err(209); } @@ -1480,7 +1480,7 @@ static void OPP_StatSeq (OPT_Node *stat) OPS_Get(&OPP_sym); OPP_ConstExpression(&z); } else { - z = OPB_NewIntConst(((LONGINT)(1))); + z = OPB_NewIntConst(1); } pos = OPM_errpos; x = OPB_NewLeaf(id); @@ -1643,7 +1643,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) OPP_ConstExpression(&x); } else { OPP_err(9); - x = OPB_NewIntConst(((LONGINT)(1))); + x = OPB_NewIntConst(1); } obj->mode = 3; obj->typ = x->typ; @@ -1674,7 +1674,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) if (__IN(obj->typ->comp, 0x1c)) { i = 0; while (i < OPP_nofFwdPtr) { - typ = OPP_FwdPtr[__X(i, ((LONGINT)(64)))]; + typ = OPP_FwdPtr[__X(i, 64)]; i += 1; if (__STRCMP(typ->link->name, obj->name) == 0) { typ->BaseTyp = obj->typ; @@ -1736,10 +1736,10 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) } i = 0; while (i < OPP_nofFwdPtr) { - if (OPP_FwdPtr[__X(i, ((LONGINT)(64)))]->link->name[0] != 0x00) { + if (OPP_FwdPtr[__X(i, 64)]->link->name[0] != 0x00) { OPP_err(128); } - OPP_FwdPtr[__X(i, ((LONGINT)(64)))] = NIL; + OPP_FwdPtr[__X(i, 64)] = NIL; i += 1; } OPT_topScope->adr = OPM_errpos; @@ -1785,28 +1785,28 @@ void OPP_Module (OPT_Node *prog, SET opt) OPS_Get(&OPP_sym); } else { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Unexpected symbol found when MODULE expected:", (LONGINT)46); + OPM_LogWStr((CHAR*)"Unexpected symbol found when MODULE expected:", 46); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" sym: ", (LONGINT)15); - OPM_LogWNum(OPP_sym, ((LONGINT)(1))); + OPM_LogWStr((CHAR*)" sym: ", 15); + OPM_LogWNum(OPP_sym, 1); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" OPS.name: ", (LONGINT)15); - OPM_LogWStr(OPS_name, ((LONGINT)(256))); + OPM_LogWStr((CHAR*)" OPS.name: ", 15); + OPM_LogWStr(OPS_name, 256); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" OPS.str: ", (LONGINT)15); - OPM_LogWStr(OPS_str, ((LONGINT)(256))); + OPM_LogWStr((CHAR*)" OPS.str: ", 15); + OPM_LogWStr(OPS_str, 256); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" OPS.numtyp: ", (LONGINT)15); - OPM_LogWNum(OPS_numtyp, ((LONGINT)(1))); + OPM_LogWStr((CHAR*)" OPS.numtyp: ", 15); + OPM_LogWNum(OPS_numtyp, 1); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" OPS.intval: ", (LONGINT)15); - OPM_LogWNum(OPS_intval, ((LONGINT)(1))); + OPM_LogWStr((CHAR*)" OPS.intval: ", 15); + OPM_LogWNum(OPS_intval, 1); OPM_LogWLn(); OPP_err(16); } if (OPP_sym == 38) { - OPM_LogWStr((CHAR*)"compiling ", (LONGINT)11); - OPM_LogWStr(OPS_name, ((LONGINT)(256))); + OPM_LogWStr((CHAR*)"compiling ", 11); + OPM_LogWStr(OPS_name, 256); OPM_LogW('.'); OPT_Init(OPS_name, opt); OPS_Get(&OPP_sym); @@ -1815,13 +1815,13 @@ void OPP_Module (OPT_Node *prog, SET opt) OPS_Get(&OPP_sym); for (;;) { if (OPP_sym == 38) { - __COPY(OPS_name, aliasName, ((LONGINT)(256))); - __COPY(aliasName, impName, ((LONGINT)(256))); + __COPY(OPS_name, aliasName, 256); + __COPY(aliasName, impName, 256); OPS_Get(&OPP_sym); if (OPP_sym == 34) { OPS_Get(&OPP_sym); if (OPP_sym == 38) { - __COPY(OPS_name, impName, ((LONGINT)(256))); + __COPY(OPS_name, impName, 256); OPS_Get(&OPP_sym); } else { OPP_err(38); diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index fb0cf655..7a12f897 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index e2d48c61..2ee978f2 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" @@ -60,7 +60,7 @@ static void OPS_Str (SHORTINT *sym) if (OPS_intval == 2) { *sym = 35; OPS_numtyp = 1; - OPS_intval = (int)OPS_str[0]; + OPS_intval = OPS_str[0]; } else { *sym = 37; } @@ -113,10 +113,10 @@ static INTEGER Ord__7 (CHAR ch, BOOLEAN hex) { INTEGER _o_result; if (ch <= '9') { - _o_result = (int)ch - 48; + _o_result = ch - 48; return _o_result; } else if (hex) { - _o_result = ((int)ch - 65) + 10; + _o_result = (ch - 65) + 10; return _o_result; } else { OPS_err(2); diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index ea28a764..a8dccfed 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index b028d164..5861f882 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" @@ -163,10 +163,10 @@ OPT_Struct OPT_IntType (LONGINT size) OPT_Struct _o_result; INTEGER i; i = 1; - while ((OPT_IntTypes[__X(i, ((LONGINT)(20)))]->size < size && OPT_IntTypes[__X(i + 1, ((LONGINT)(20)))] != NIL)) { + while ((OPT_IntTypes[__X(i, 20)]->size < size && OPT_IntTypes[__X(i + 1, 20)] != NIL)) { i += 1; } - _o_result = OPT_IntTypes[__X(i, ((LONGINT)(20)))]; + _o_result = OPT_IntTypes[__X(i, 20)]; return _o_result; } @@ -178,11 +178,11 @@ OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir) __ASSERT(dir == 1 || dir == -1, 0); __ASSERT(x->BaseTyp == OPT_undftyp, 0); i = 0; - while ((OPT_IntTypes[__X(i, ((LONGINT)(20)))] != x && i < 20)) { + while ((OPT_IntTypes[__X(i, 20)] != x && i < 20)) { i += 1; } __ASSERT(i < 19, 0); - _o_result = OPT_IntTypes[__X(i + dir, ((LONGINT)(20)))]; + _o_result = OPT_IntTypes[__X(i + dir, 20)]; return _o_result; } @@ -235,7 +235,7 @@ OPT_ConstExt OPT_NewExt (void) { OPT_ConstExt _o_result; OPT_ConstExt ext = NIL; - ext = __NEWARR(NIL, ((LONGINT)(1)), 1, 1, 0, (LONGINT)256); + ext = __NEWARR(NIL, 1, 1, 1, 0, ((SYSTEM_INT64)(256))); _o_result = ext; return _o_result; } @@ -266,8 +266,8 @@ void OPT_Init (OPS_Name name, SET opt) OPT_topScope = OPT_universe; OPT_OpenScope(0, NIL); OPT_SYSimported = 0; - __COPY(name, OPT_SelfName, ((LONGINT)(256))); - __COPY(name, OPT_topScope->name, ((LONGINT)(256))); + __COPY(name, OPT_SelfName, 256); + __COPY(name, OPT_topScope->name, 256); OPT_GlbMod[0] = OPT_topScope; OPT_nofGmod = 1; OPT_newsf = __IN(4, opt); @@ -282,13 +282,13 @@ void OPT_Close (void) OPT_CloseScope(); i = 0; while (i < 64) { - OPT_GlbMod[__X(i, ((LONGINT)(64)))] = NIL; + OPT_GlbMod[__X(i, 64)] = NIL; i += 1; } i = 16; while (i < 255) { - OPT_impCtxt.ref[__X(i, ((LONGINT)(255)))] = NIL; - OPT_impCtxt.old[__X(i, ((LONGINT)(255)))] = NIL; + OPT_impCtxt.ref[__X(i, 255)] = NIL; + OPT_impCtxt.old[__X(i, 255)] = NIL; i += 1; } } @@ -399,7 +399,7 @@ void OPT_Insert (OPS_Name name, OPT_Object *obj) } ob1->left = NIL; ob1->right = NIL; - __COPY(name, ob1->name, ((LONGINT)(256))); + __COPY(name, ob1->name, 256); mnolev = OPT_topScope->mnolev; ob1->mnolev = mnolev; break; @@ -415,7 +415,7 @@ static void OPT_FPrintName (LONGINT *fp, CHAR *name, LONGINT name__len) i = 0; do { ch = name[__X(i, name__len)]; - OPM_FPrint(&*fp, (int)ch); + OPM_FPrint(&*fp, ch); i += 1; } while (!(ch == 0x00)); } @@ -424,32 +424,32 @@ static void OPT_DebugStruct (OPT_Struct btyp) { OPM_LogWLn(); if (btyp == NIL) { - OPM_LogWStr((CHAR*)"btyp is nil", (LONGINT)12); + OPM_LogWStr((CHAR*)"btyp is nil", 12); OPM_LogWLn(); } - OPM_LogWStr((CHAR*)"btyp^.strobji^.name = ", (LONGINT)23); - OPM_LogWStr(btyp->strobj->name, ((LONGINT)(256))); + OPM_LogWStr((CHAR*)"btyp^.strobji^.name = ", 23); + OPM_LogWStr(btyp->strobj->name, 256); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.form = ", (LONGINT)14); - OPM_LogWNum(btyp->form, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.form = ", 14); + OPM_LogWNum(btyp->form, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.comp = ", (LONGINT)14); - OPM_LogWNum(btyp->comp, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.comp = ", 14); + OPM_LogWNum(btyp->comp, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.mno = ", (LONGINT)13); - OPM_LogWNum(btyp->mno, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.mno = ", 13); + OPM_LogWNum(btyp->mno, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.extlev = ", (LONGINT)16); - OPM_LogWNum(btyp->extlev, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.extlev = ", 16); + OPM_LogWNum(btyp->extlev, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.size = ", (LONGINT)14); - OPM_LogWNum(btyp->size, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.size = ", 14); + OPM_LogWNum(btyp->size, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.align = ", (LONGINT)15); - OPM_LogWNum(btyp->align, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.align = ", 15); + OPM_LogWNum(btyp->align, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.txtpos = ", (LONGINT)16); - OPM_LogWNum(btyp->txtpos, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.txtpos = ", 16); + OPM_LogWNum(btyp->txtpos, 0); OPM_LogWLn(); } @@ -481,8 +481,8 @@ void OPT_IdFPrint (OPT_Struct typ) btyp = typ->BaseTyp; strobj = typ->strobj; if ((strobj != NIL && strobj->name[0] != 0x00)) { - OPT_FPrintName(&idfp, (void*)OPT_GlbMod[__X(typ->mno, ((LONGINT)(64)))]->name, ((LONGINT)(256))); - OPT_FPrintName(&idfp, (void*)strobj->name, ((LONGINT)(256))); + OPT_FPrintName(&idfp, (void*)OPT_GlbMod[__X(typ->mno, 64)]->name, 256); + OPT_FPrintName(&idfp, (void*)strobj->name, 256); } if ((f == 13 || (c == 4 && btyp != NIL)) || c == 3) { OPT_IdFPrint(btyp); @@ -533,7 +533,7 @@ static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr) } } } else if (typ->form == 13 || __STRCMP(fld->name, "@ptr") == 0) { - OPM_FPrint(&*FPrintStr__12_s->pvfp, ((LONGINT)(13))); + OPM_FPrint(&*FPrintStr__12_s->pvfp, 13); OPM_FPrint(&*FPrintStr__12_s->pvfp, adr); OPT_nofhdfld += 1; } @@ -544,7 +544,7 @@ static void FPrintFlds__13 (OPT_Object fld, LONGINT adr, BOOLEAN visible) while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->vis); - OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)fld->name, ((LONGINT)(256))); + OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)fld->name, 256); OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->adr); OPT_FPrintStr(fld->typ); OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->typ->pbfp); @@ -562,10 +562,10 @@ static void FPrintTProcs__17 (OPT_Object obj) FPrintTProcs__17(obj->left); if (obj->mode == 13) { if (obj->vis != 0) { - OPM_FPrint(&*FPrintStr__12_s->pbfp, ((LONGINT)(13))); + OPM_FPrint(&*FPrintStr__12_s->pbfp, 13); OPM_FPrint(&*FPrintStr__12_s->pbfp, __ASHR(obj->adr, 16)); OPT_FPrintSign(&*FPrintStr__12_s->pbfp, obj->typ, obj->link); - OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)obj->name, ((LONGINT)(256))); + OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)obj->name, 256); } } FPrintTProcs__17(obj->right); @@ -619,7 +619,7 @@ void OPT_FPrintStr (OPT_Struct typ) OPM_FPrint(&pvfp, typ->align); OPM_FPrint(&pvfp, typ->n); OPT_nofhdfld = 0; - FPrintFlds__13(typ->link, ((LONGINT)(0)), 1); + FPrintFlds__13(typ->link, 0, 1); if (OPT_nofhdfld > 2048) { OPM_Mark(225, typ->txtpos); } @@ -664,7 +664,7 @@ void OPT_FPrintObj (OPT_Object obj) OPM_FPrintLReal(&fprint, obj->conval->realval); break; case 10: - OPT_FPrintName(&fprint, (void*)*obj->conval->ext, ((LONGINT)(256))); + OPT_FPrintName(&fprint, (void*)*obj->conval->ext, 256); break; case 11: break; @@ -681,11 +681,11 @@ void OPT_FPrintObj (OPT_Object obj) } else if (obj->mode == 9) { OPT_FPrintSign(&fprint, obj->typ, obj->link); ext = obj->conval->ext; - m = (int)(*ext)[0]; + m = (*ext)[0]; f = 1; OPM_FPrint(&fprint, m); while (f <= m) { - OPM_FPrint(&fprint, (int)(*ext)[__X(f, ((LONGINT)(256)))]); + OPM_FPrint(&fprint, (*ext)[__X(f, 256)]); f += 1; } } else if (obj->mode == 5) { @@ -701,22 +701,22 @@ void OPT_FPrintErr (OPT_Object obj, INTEGER errcode) INTEGER i, j; CHAR ch; if (obj->mnolev != 0) { - __COPY(OPT_GlbMod[__X(-obj->mnolev, ((LONGINT)(64)))]->name, OPM_objname, ((LONGINT)(64))); + __COPY(OPT_GlbMod[__X(-obj->mnolev, 64)]->name, OPM_objname, 64); i = 0; - while (OPM_objname[__X(i, ((LONGINT)(64)))] != 0x00) { + while (OPM_objname[__X(i, 64)] != 0x00) { i += 1; } - OPM_objname[__X(i, ((LONGINT)(64)))] = '.'; + OPM_objname[__X(i, 64)] = '.'; j = 0; i += 1; do { - ch = obj->name[__X(j, ((LONGINT)(256)))]; - OPM_objname[__X(i, ((LONGINT)(64)))] = ch; + ch = obj->name[__X(j, 256)]; + OPM_objname[__X(i, 64)] = ch; j += 1; i += 1; } while (!(ch == 0x00)); } else { - __COPY(obj->name, OPM_objname, ((LONGINT)(64))); + __COPY(obj->name, OPM_objname, 64); } if (errcode == 249) { if (OPM_noerr) { @@ -809,12 +809,12 @@ static void OPT_InMod (SHORTINT *mno) *mno = OPT_impCtxt.glbmno[0]; } else { if (mn == 16) { - OPT_InName((void*)name, ((LONGINT)(256))); + OPT_InName((void*)name, 256); if ((__STRCMP(name, OPT_SelfName) == 0 && !OPT_impCtxt.self)) { OPT_err(154); } i = 0; - while ((i < OPT_nofGmod && __STRCMP(name, OPT_GlbMod[__X(i, ((LONGINT)(64)))]->name) != 0)) { + while ((i < OPT_nofGmod && __STRCMP(name, OPT_GlbMod[__X(i, 64)]->name) != 0)) { i += 1; } if (i < OPT_nofGmod) { @@ -822,20 +822,20 @@ static void OPT_InMod (SHORTINT *mno) } else { head = OPT_NewObj(); head->mode = 12; - __COPY(name, head->name, ((LONGINT)(256))); + __COPY(name, head->name, 256); *mno = OPT_nofGmod; head->mnolev = -*mno; if (OPT_nofGmod < 64) { - OPT_GlbMod[__X(*mno, ((LONGINT)(64)))] = head; + OPT_GlbMod[__X(*mno, 64)] = head; OPT_nofGmod += 1; } else { OPT_err(227); } } - OPT_impCtxt.glbmno[__X(OPT_impCtxt.nofm, ((LONGINT)(64)))] = *mno; + OPT_impCtxt.glbmno[__X(OPT_impCtxt.nofm, 64)] = *mno; OPT_impCtxt.nofm += 1; } else { - *mno = OPT_impCtxt.glbmno[__X(-mn, ((LONGINT)(64)))]; + *mno = OPT_impCtxt.glbmno[__X(-mn, 64)]; } } } @@ -849,7 +849,7 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval) switch (f) { case 1: case 3: case 2: OPM_SymRCh(&ch); - conval->intval = (int)ch; + conval->intval = ch; break; case 4: case 5: case 6: conval->intval = OPM_SymRInt(); @@ -872,7 +872,7 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval) i = 0; do { OPM_SymRCh(&ch); - (*ext)[__X(i, ((LONGINT)(256)))] = ch; + (*ext)[__X(i, 256)] = ch; i += 1; } while (!(ch == 0x00)); conval->intval2 = i; @@ -882,8 +882,8 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval) conval->intval = 0; break; default: - OPM_LogWStr((CHAR*)"unhandled case in InConstant(), f = ", (LONGINT)37); - OPM_LogWNum(f, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in InConstant(), f = ", 37); + OPM_LogWNum(f, 0); OPM_LogWLn(); break; } @@ -911,7 +911,7 @@ static void OPT_InSign (SHORTINT mno, OPT_Struct *res, OPT_Object *par) } OPT_InStruct(&new->typ); new->adr = OPM_SymRInt(); - OPT_InName((void*)new->name, ((LONGINT)(256))); + OPT_InName((void*)new->name, 256); last = new; tag = OPM_SymRInt(); } @@ -932,7 +932,7 @@ static OPT_Object OPT_InFld (void) obj->vis = 1; } OPT_InStruct(&obj->typ); - OPT_InName((void*)obj->name, ((LONGINT)(256))); + OPT_InName((void*)obj->name, 256); obj->adr = OPM_SymRInt(); } else { obj->mode = 4; @@ -963,7 +963,7 @@ static OPT_Object OPT_InTProc (SHORTINT mno) obj->conval->intval = -1; OPT_InSign(mno, &obj->typ, &obj->link); obj->vis = 1; - OPT_InName((void*)obj->name, ((LONGINT)(256))); + OPT_InName((void*)obj->name, 256); obj->adr = __ASHL(OPM_SymRInt(), 16); } else { obj->mode = 13; @@ -984,7 +984,7 @@ static OPT_Struct OPT_InTyp (LONGINT tag) _o_result = OPT_IntType(OPM_SymRInt()); return _o_result; } else { - _o_result = OPT_impCtxt.ref[__X(tag, ((LONGINT)(255)))]; + _o_result = OPT_impCtxt.ref[__X(tag, 255)]; return _o_result; } __RETCHK; @@ -1008,23 +1008,23 @@ static void OPT_InStruct (OPT_Struct *typ) OPT_impCtxt.minr = ref; } OPT_InMod(&mno); - OPT_InName((void*)name, ((LONGINT)(256))); + OPT_InName((void*)name, 256); obj = OPT_NewObj(); if (name[0] == 0x00) { if (OPT_impCtxt.self) { old = NIL; } else { __MOVE("@", obj->name, 2); - OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->right, &old); + OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, 64)]->right, &old); obj->name[0] = 0x00; } *typ = OPT_NewStr(0, 1); } else { - __COPY(name, obj->name, ((LONGINT)(256))); - OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->right, &old); + __COPY(name, obj->name, 256); + OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, 64)]->right, &old); if (old != NIL) { OPT_FPrintObj(old); - OPT_impCtxt.pvfp[__X(ref, ((LONGINT)(255)))] = old->typ->pvfp; + OPT_impCtxt.pvfp[__X(ref, 255)] = old->typ->pvfp; if (OPT_impCtxt.self) { *typ = OPT_NewStr(0, 1); } else { @@ -1038,8 +1038,8 @@ static void OPT_InStruct (OPT_Struct *typ) *typ = OPT_NewStr(0, 1); } } - OPT_impCtxt.ref[__X(ref, ((LONGINT)(255)))] = *typ; - OPT_impCtxt.old[__X(ref, ((LONGINT)(255)))] = old; + OPT_impCtxt.ref[__X(ref, 255)] = *typ; + OPT_impCtxt.old[__X(ref, 255)] = old; (*typ)->ref = ref + 255; (*typ)->mno = mno; (*typ)->allocated = 1; @@ -1050,7 +1050,7 @@ static void OPT_InStruct (OPT_Struct *typ) obj->vis = 0; tag = OPM_SymRInt(); if (tag == 35) { - (*typ)->sysflag = (int)OPM_SymRInt(); + (*typ)->sysflag = (SYSTEM_INT32)OPM_SymRInt(); tag = OPM_SymRInt(); } switch (tag) { @@ -1118,8 +1118,8 @@ static void OPT_InStruct (OPT_Struct *typ) OPT_InSign(mno, &(*typ)->BaseTyp, &(*typ)->link); break; default: - OPM_LogWStr((CHAR*)"unhandled case at InStruct, tag = ", (LONGINT)35); - OPM_LogWNum(tag, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case at InStruct, tag = ", 35); + OPM_LogWNum(tag, 0); OPM_LogWLn(); break; } @@ -1131,7 +1131,7 @@ static void OPT_InStruct (OPT_Struct *typ) if (obj->name[0] != 0x00) { OPT_FPrintObj(obj); } - old = OPT_impCtxt.old[__X(ref, ((LONGINT)(255)))]; + old = OPT_impCtxt.old[__X(ref, 255)]; if (old != NIL) { t->strobj = old; if (OPT_impCtxt.self) { @@ -1139,13 +1139,13 @@ static void OPT_InStruct (OPT_Struct *typ) if (old->history != 5) { if (old->fprint != obj->fprint) { old->history = 2; - } else if (OPT_impCtxt.pvfp[__X(ref, ((LONGINT)(255)))] != t->pvfp) { + } else if (OPT_impCtxt.pvfp[__X(ref, 255)] != t->pvfp) { old->history = 3; } } } else if (old->fprint != obj->fprint) { old->history = 2; - } else if (OPT_impCtxt.pvfp[__X(ref, ((LONGINT)(255)))] != t->pvfp) { + } else if (OPT_impCtxt.pvfp[__X(ref, 255)] != t->pvfp) { old->history = 3; } else if (old->vis == 0) { old->history = 1; @@ -1153,7 +1153,7 @@ static void OPT_InStruct (OPT_Struct *typ) old->history = 0; } } else { - if (OPT_impCtxt.pvfp[__X(ref, ((LONGINT)(255)))] != t->pvfp) { + if (OPT_impCtxt.pvfp[__X(ref, 255)] != t->pvfp) { old->history = 5; } if (old->fprint != obj->fprint) { @@ -1212,17 +1212,17 @@ static OPT_Object OPT_InObj (SHORTINT mno) obj->mode = 9; ext = OPT_NewExt(); obj->conval->ext = ext; - s = (int)OPM_SymRInt(); + s = (SYSTEM_INT32)OPM_SymRInt(); (*ext)[0] = (CHAR)s; i = 1; while (i <= s) { - OPM_SymRCh(&(*ext)[__X(i, ((LONGINT)(256)))]); + OPM_SymRCh(&(*ext)[__X(i, 256)]); i += 1; } break; default: - OPM_LogWStr((CHAR*)"unhandled case at InObj, tag = ", (LONGINT)32); - OPM_LogWNum(tag, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case at InObj, tag = ", 32); + OPM_LogWNum(tag, 0); OPM_LogWLn(); break; } @@ -1236,14 +1236,14 @@ static OPT_Object OPT_InObj (SHORTINT mno) } OPT_InStruct(&obj->typ); } - OPT_InName((void*)obj->name, ((LONGINT)(256))); + OPT_InName((void*)obj->name, 256); } OPT_FPrintObj(obj); if ((obj->mode == 1 && (obj->typ->strobj == NIL || obj->typ->strobj->name[0] == 0x00))) { OPM_FPrint(&OPT_impCtxt.reffp, obj->typ->ref - 255); } if (tag != 19) { - OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->right, &old); + OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, 64)]->right, &old); if (OPT_impCtxt.self) { if (old != NIL) { if (old->vis == 0) { @@ -1294,7 +1294,7 @@ void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) OPT_impCtxt.nofm = 0; OPT_impCtxt.self = __STRCMP(aliasName, "@self") == 0; OPT_impCtxt.reffp = 0; - OPM_OldSym((void*)name, ((LONGINT)(256)), &*done); + OPM_OldSym((void*)name, 256, &*done); if (*done) { OPT_InMod(&mno); OPT_impCtxt.nextTag = OPM_SymRInt(); @@ -1304,8 +1304,8 @@ void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) } OPT_Insert(aliasName, &obj); obj->mode = 11; - obj->scope = OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->right; - OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->link = obj; + obj->scope = OPT_GlbMod[__X(mno, 64)]->right; + OPT_GlbMod[__X(mno, 64)]->link = obj; obj->mnolev = -mno; obj->typ = OPT_notyp; OPM_CloseOldSym(); @@ -1333,13 +1333,13 @@ static void OPT_OutName (CHAR *name, LONGINT name__len) static void OPT_OutMod (INTEGER mno) { - if (OPT_expCtxt.locmno[__X(mno, ((LONGINT)(64)))] < 0) { - OPM_SymWInt(((LONGINT)(16))); - OPT_expCtxt.locmno[__X(mno, ((LONGINT)(64)))] = OPT_expCtxt.nofm; + if (OPT_expCtxt.locmno[__X(mno, 64)] < 0) { + OPM_SymWInt(16); + OPT_expCtxt.locmno[__X(mno, 64)] = OPT_expCtxt.nofm; OPT_expCtxt.nofm += 1; - OPT_OutName((void*)OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->name, ((LONGINT)(256))); + OPT_OutName((void*)OPT_GlbMod[__X(mno, 64)]->name, 256); } else { - OPM_SymWInt(-OPT_expCtxt.locmno[__X(mno, ((LONGINT)(64)))]); + OPM_SymWInt(-OPT_expCtxt.locmno[__X(mno, 64)]); } } @@ -1369,7 +1369,7 @@ static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, LONGINT adr) } } } else if (typ->form == 13 || __STRCMP(fld->name, "@ptr") == 0) { - OPM_SymWInt(((LONGINT)(27))); + OPM_SymWInt(27); OPM_SymWInt(adr); OPT_nofhdfld += 1; } @@ -1380,12 +1380,12 @@ static void OPT_OutFlds (OPT_Object fld, LONGINT adr, BOOLEAN visible) while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { if (fld->vis == 2) { - OPM_SymWInt(((LONGINT)(26))); + OPM_SymWInt(26); } else { - OPM_SymWInt(((LONGINT)(25))); + OPM_SymWInt(25); } OPT_OutStr(fld->typ); - OPT_OutName((void*)fld->name, ((LONGINT)(256))); + OPT_OutName((void*)fld->name, 256); OPM_SymWInt(fld->adr); } else { OPT_OutHdFld(fld->typ, fld, fld->adr + adr); @@ -1399,16 +1399,16 @@ static void OPT_OutSign (OPT_Struct result, OPT_Object par) OPT_OutStr(result); while (par != NIL) { if (par->mode == 1) { - OPM_SymWInt(((LONGINT)(23))); + OPM_SymWInt(23); } else { - OPM_SymWInt(((LONGINT)(24))); + OPM_SymWInt(24); } OPT_OutStr(par->typ); OPM_SymWInt(par->adr); - OPT_OutName((void*)par->name, ((LONGINT)(256))); + OPT_OutName((void*)par->name, 256); par = par->link; } - OPM_SymWInt(((LONGINT)(18))); + OPM_SymWInt(18); } static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj) @@ -1421,12 +1421,12 @@ static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj) } if (obj->vis != 0) { if (obj->vis != 0) { - OPM_SymWInt(((LONGINT)(29))); + OPM_SymWInt(29); OPT_OutSign(obj->typ, obj->link); - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); OPM_SymWInt(__ASHR(obj->adr, 16)); } else { - OPM_SymWInt(((LONGINT)(30))); + OPM_SymWInt(30); OPM_SymWInt(__ASHR(obj->adr, 16)); } } @@ -1444,7 +1444,7 @@ static void OPT_OutStr (OPT_Struct typ) OPM_SymWInt(typ->size); } } else { - OPM_SymWInt(((LONGINT)(34))); + OPM_SymWInt(34); typ->ref = OPT_expCtxt.ref; OPT_expCtxt.ref += 1; if (OPT_expCtxt.ref >= 255) { @@ -1453,7 +1453,7 @@ static void OPT_OutStr (OPT_Struct typ) OPT_OutMod(typ->mno); strobj = typ->strobj; if ((strobj != NIL && strobj->name[0] != 0x00)) { - OPT_OutName((void*)strobj->name, ((LONGINT)(256))); + OPT_OutName((void*)strobj->name, 256); switch (strobj->history) { case 2: OPT_FPrintErr(strobj, 252); @@ -1471,31 +1471,31 @@ static void OPT_OutStr (OPT_Struct typ) OPM_SymWCh(0x00); } if (typ->sysflag != 0) { - OPM_SymWInt(((LONGINT)(35))); + OPM_SymWInt(35); OPM_SymWInt(typ->sysflag); } switch (typ->form) { case 13: - OPM_SymWInt(((LONGINT)(36))); + OPM_SymWInt(36); OPT_OutStr(typ->BaseTyp); break; case 14: - OPM_SymWInt(((LONGINT)(40))); + OPM_SymWInt(40); OPT_OutSign(typ->BaseTyp, typ->link); break; case 15: switch (typ->comp) { case 2: - OPM_SymWInt(((LONGINT)(37))); + OPM_SymWInt(37); OPT_OutStr(typ->BaseTyp); OPM_SymWInt(typ->n); break; case 3: - OPM_SymWInt(((LONGINT)(38))); + OPM_SymWInt(38); OPT_OutStr(typ->BaseTyp); break; case 4: - OPM_SymWInt(((LONGINT)(39))); + OPM_SymWInt(39); if (typ->BaseTyp == NIL) { OPT_OutStr(OPT_notyp); } else { @@ -1505,23 +1505,23 @@ static void OPT_OutStr (OPT_Struct typ) OPM_SymWInt(typ->align); OPM_SymWInt(typ->n); OPT_nofhdfld = 0; - OPT_OutFlds(typ->link, ((LONGINT)(0)), 1); + OPT_OutFlds(typ->link, 0, 1); if (OPT_nofhdfld > 2048) { OPM_Mark(223, typ->txtpos); } OPT_OutTProcs(typ, typ->link); - OPM_SymWInt(((LONGINT)(18))); + OPM_SymWInt(18); break; default: - OPM_LogWStr((CHAR*)"unhandled case at OutStr, typ^.comp = ", (LONGINT)39); - OPM_LogWNum(typ->comp, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case at OutStr, typ^.comp = ", 39); + OPM_LogWNum(typ->comp, 0); OPM_LogWLn(); break; } break; default: - OPM_LogWStr((CHAR*)"unhandled case at OutStr, typ^.form = ", (LONGINT)39); - OPM_LogWNum(typ->form, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case at OutStr, typ^.form = ", 39); + OPM_LogWNum(typ->form, 0); OPM_LogWLn(); break; } @@ -1553,7 +1553,7 @@ static void OPT_OutConstant (OPT_Object obj) OPM_SymWLReal(obj->conval->realval); break; case 10: - OPT_OutName((void*)*obj->conval->ext, ((LONGINT)(256))); + OPT_OutName((void*)*obj->conval->ext, 256); break; case 11: break; @@ -1586,64 +1586,64 @@ static void OPT_OutObj (OPT_Object obj) OPT_FPrintErr(obj, 251); break; default: - OPM_LogWStr((CHAR*)"unhandled case at OutObj, obj^.history = ", (LONGINT)42); - OPM_LogWNum(obj->history, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case at OutObj, obj^.history = ", 42); + OPM_LogWNum(obj->history, 0); OPM_LogWLn(); break; } switch (obj->mode) { case 3: OPT_OutConstant(obj); - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); break; case 5: if (obj->typ->strobj == obj) { - OPM_SymWInt(((LONGINT)(19))); + OPM_SymWInt(19); OPT_OutStr(obj->typ); } else { - OPM_SymWInt(((LONGINT)(20))); + OPM_SymWInt(20); OPT_OutStr(obj->typ); - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); } break; case 1: if (obj->vis == 2) { - OPM_SymWInt(((LONGINT)(22))); + OPM_SymWInt(22); } else { - OPM_SymWInt(((LONGINT)(21))); + OPM_SymWInt(21); } OPT_OutStr(obj->typ); - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); if (obj->typ->strobj == NIL || obj->typ->strobj->name[0] == 0x00) { OPM_FPrint(&OPT_expCtxt.reffp, obj->typ->ref); } break; case 7: - OPM_SymWInt(((LONGINT)(31))); + OPM_SymWInt(31); OPT_OutSign(obj->typ, obj->link); - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); break; case 10: - OPM_SymWInt(((LONGINT)(32))); + OPM_SymWInt(32); OPT_OutSign(obj->typ, obj->link); - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); break; case 9: - OPM_SymWInt(((LONGINT)(33))); + OPM_SymWInt(33); OPT_OutSign(obj->typ, obj->link); ext = obj->conval->ext; - j = (int)(*ext)[0]; + j = (*ext)[0]; i = 1; OPM_SymWInt(j); while (i <= j) { - OPM_SymWCh((*ext)[__X(i, ((LONGINT)(256)))]); + OPM_SymWCh((*ext)[__X(i, 256)]); i += 1; } - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); break; default: - OPM_LogWStr((CHAR*)"unhandled case at OutObj, obj.mode = ", (LONGINT)38); - OPM_LogWNum(obj->mode, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case at OutObj, obj.mode = ", 38); + OPM_LogWNum(obj->mode, 0); OPM_LogWLn(); break; } @@ -1664,17 +1664,17 @@ void OPT_Export (BOOLEAN *ext, BOOLEAN *new) OPT_Import((CHAR*)"@self", OPT_SelfName, &done); OPT_nofGmod = nofmod; if (OPM_noerr) { - OPM_NewSym((void*)OPT_SelfName, ((LONGINT)(256))); + OPM_NewSym((void*)OPT_SelfName, 256); if (OPM_noerr) { - OPM_SymWInt(((LONGINT)(16))); - OPT_OutName((void*)OPT_SelfName, ((LONGINT)(256))); + OPM_SymWInt(16); + OPT_OutName((void*)OPT_SelfName, 256); OPT_expCtxt.reffp = 0; OPT_expCtxt.ref = 16; OPT_expCtxt.nofm = 1; OPT_expCtxt.locmno[0] = 0; i = 1; while (i < 64) { - OPT_expCtxt.locmno[__X(i, ((LONGINT)(64)))] = -1; + OPT_expCtxt.locmno[__X(i, 64)] = -1; i += 1; } OPT_OutObj(OPT_topScope->right); @@ -1875,11 +1875,11 @@ export void *OPT__init(void) OPT_EnterTyp((CHAR*)"SET", 9, OPM_SetSize, &OPT_settyp); OPT_EnterTyp((CHAR*)"REAL", 7, OPM_RealSize, &OPT_realtyp); OPT_EnterTyp((CHAR*)"INTEGER", 5, OPM_IntSize, &OPT_inttyp); - OPT_EnterTyp((CHAR*)"LONGINT", 6, OPM_LIntSize, &OPT_linttyp); + OPT_EnterTyp((CHAR*)"LONGINT", 5, OPM_LIntSize, &OPT_linttyp); OPT_EnterTyp((CHAR*)"LONGREAL", 8, OPM_LRealSize, &OPT_lrltyp); OPT_EnterTyp((CHAR*)"SHORTINT", 4, OPM_SIntSize, &OPT_sinttyp); - OPT_EnterBoolConst((CHAR*)"FALSE", ((LONGINT)(0))); - OPT_EnterBoolConst((CHAR*)"TRUE", ((LONGINT)(1))); + OPT_EnterBoolConst((CHAR*)"FALSE", 0); + OPT_EnterBoolConst((CHAR*)"TRUE", 1); OPT_EnterProc((CHAR*)"HALT", 0); OPT_EnterProc((CHAR*)"NEW", 1); OPT_EnterProc((CHAR*)"ABS", 2); diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 9878e30b..acf2e9e9 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index f74e0890..49956ac6 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPC.h" @@ -37,9 +37,10 @@ static void OPV_Len (OPT_Node n, LONGINT dim); export void OPV_Module (OPT_Node prog); static LONGINT OPV_NaturalAlignment (LONGINT size, LONGINT max); static void OPV_NewArr (OPT_Node d, OPT_Node x); +static void OPV_ParIntLiteral (LONGINT n, LONGINT size); static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, INTEGER comp); static BOOLEAN OPV_SideEffects (OPT_Node n); -static void OPV_SizeCast (LONGINT size); +static void OPV_SizeCast (LONGINT from, LONGINT to); static void OPV_Stamp (OPS_Name s); static OPT_Object OPV_SuperProc (OPT_Node n); static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported); @@ -118,7 +119,7 @@ void OPV_TypSize (OPT_Struct typ) } typ->size = offset; typ->align = base; - typ->sysflag = __MASK(typ->sysflag, -256) + (int)__ASHL(offset - off0, 8); + typ->sysflag = __MASK(typ->sysflag, -256) + (SYSTEM_INT32)__ASHL(offset - off0, 8); } else if (c == 2) { OPV_TypSize(typ->BaseTyp); typ->size = typ->n * typ->BaseTyp->size; @@ -197,27 +198,27 @@ static void OPV_Stamp (OPS_Name s) OPV_stamp += 1; i = 0; j = OPV_stamp; - while (s[__X(i, ((LONGINT)(256)))] != 0x00) { + while (s[__X(i, 256)] != 0x00) { i += 1; } if (i > 25) { i = 25; } - s[__X(i, ((LONGINT)(256)))] = '_'; - s[__X(i + 1, ((LONGINT)(256)))] = '_'; + s[__X(i, 256)] = '_'; + s[__X(i + 1, 256)] = '_'; i += 2; k = 0; do { - n[__X(k, ((LONGINT)(10)))] = (CHAR)((int)__MOD(j, 10) + 48); + n[__X(k, 10)] = (CHAR)((int)__MOD(j, 10) + 48); j = __DIV(j, 10); k += 1; } while (!(j == 0)); do { k -= 1; - s[__X(i, ((LONGINT)(256)))] = n[__X(k, ((LONGINT)(10)))]; + s[__X(i, 256)] = n[__X(k, 10)]; i += 1; } while (!(k == 0)); - s[__X(i, ((LONGINT)(256)))] = 0x00; + s[__X(i, 256)] = 0x00; } static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported) @@ -259,7 +260,7 @@ static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exporte } scope = obj->scope; scope->leaf = 1; - __COPY(obj->name, scope->name, ((LONGINT)(256))); + __COPY(obj->name, scope->name, 256); OPV_Stamp(scope->name); if (mode == 9) { obj->adr = 1; @@ -339,8 +340,8 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN return _o_result; break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Nmop, subclass = ", (LONGINT)55); - OPM_LogWNum(subclass, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Nmop, subclass = ", 55); + OPM_LogWNum(subclass, 0); OPM_LogWLn(); break; } @@ -409,8 +410,8 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN return _o_result; break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Ndop, subclass = ", (LONGINT)55); - OPM_LogWNum(subclass, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Ndop, subclass = ", 55); + OPM_LogWNum(subclass, 0); OPM_LogWLn(); break; } @@ -424,8 +425,8 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN return _o_result; break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence, class = ", (LONGINT)43); - OPM_LogWNum(class, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence, class = ", 43); + OPM_LogWNum(class, 0); OPM_LogWLn(); break; } @@ -440,7 +441,7 @@ static void OPV_Len (OPT_Node n, LONGINT dim) } if ((n->class == 3 && n->typ->comp == 3)) { OPV_design(n->left, 10); - OPM_WriteString((CHAR*)"->len[", (LONGINT)7); + OPM_WriteString((CHAR*)"->len[", 7); OPM_WriteInt(dim); OPM_Write(']'); } else { @@ -464,7 +465,7 @@ static BOOLEAN OPV_SideEffects (OPT_Node n) static void OPV_Entier (OPT_Node n, INTEGER prec) { if (__IN(n->typ->form, 0x0180)) { - OPM_WriteString((CHAR*)"__ENTIER(", (LONGINT)10); + OPM_WriteString((CHAR*)"__ENTIER(", 10); OPV_expr(n, -1); OPM_Write(')'); } else { @@ -472,12 +473,28 @@ static void OPV_Entier (OPT_Node n, INTEGER prec) } } -static void OPV_SizeCast (LONGINT size) +static void OPV_SizeCast (LONGINT from, LONGINT to) { - if (size <= 4) { - OPM_WriteString((CHAR*)"(int)", (LONGINT)6); - } else { - OPM_WriteString((CHAR*)"(SYSTEM_INT64)", (LONGINT)15); + if ((from != to && (from > 4 || to > 4))) { + switch (to) { + case 1: + OPM_WriteString((CHAR*)"(SYSTEM_INT8)", 14); + break; + case 2: + OPM_WriteString((CHAR*)"(SYSTEM_INT16)", 15); + break; + case 4: + OPM_WriteString((CHAR*)"(SYSTEM_INT32)", 15); + break; + case 8: + OPM_WriteString((CHAR*)"(SYSTEM_INT64)", 15); + break; + default: + OPM_LogWStr((CHAR*)"Unhandled case in OPC.SizeCast, to = ", 38); + OPM_LogWNum(to, 1); + OPM_LogWLn(); + break; + } } } @@ -487,29 +504,27 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec) from = n->typ->form; to = newtype->form; if (to == 9) { - OPM_WriteString((CHAR*)"__SETOF(", (LONGINT)9); + OPM_WriteString((CHAR*)"__SETOF(", 9); OPV_Entier(n, -1); OPM_Write(')'); } else if (__IN(to, 0x70)) { if ((newtype->size < n->typ->size && __IN(2, OPM_opt))) { - OPM_WriteString((CHAR*)"__SHORT", (LONGINT)8); + OPM_WriteString((CHAR*)"__SHORT", 8); if (OPV_SideEffects(n)) { OPM_Write('F'); } OPM_Write('('); OPV_Entier(n, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(OPM_SignedMaximum(newtype->size) + 1); OPM_Write(')'); } else { - if (newtype->size != n->typ->size) { - OPV_SizeCast(newtype->size); - } + OPV_SizeCast(n->typ->size, newtype->size); OPV_Entier(n, 9); } } else if (to == 3) { if (__IN(2, OPM_opt)) { - OPM_WriteString((CHAR*)"__CHR", (LONGINT)6); + OPM_WriteString((CHAR*)"__CHR", 6); if (OPV_SideEffects(n)) { OPM_Write('F'); } @@ -517,7 +532,7 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec) OPV_Entier(n, -1); OPM_Write(')'); } else { - OPM_WriteString((CHAR*)"(CHAR)", (LONGINT)7); + OPM_WriteString((CHAR*)"(CHAR)", 7); OPV_Entier(n, 9); } } else { @@ -528,14 +543,14 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec) static void OPV_TypeOf (OPT_Node n) { if (n->typ->form == 13) { - OPM_WriteString((CHAR*)"__TYPEOF(", (LONGINT)10); + OPM_WriteString((CHAR*)"__TYPEOF(", 10); OPV_expr(n, -1); OPM_Write(')'); } else if (__IN(n->class, 0x15)) { OPC_Andent(n->typ); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } else if (n->class == 3) { - OPM_WriteString((CHAR*)"__TYPEOF(", (LONGINT)10); + OPM_WriteString((CHAR*)"__TYPEOF(", 10); OPV_expr(n->left, -1); OPM_Write(')'); } else if (n->class == 5) { @@ -553,12 +568,12 @@ static void OPV_Index (OPT_Node n, OPT_Node d, INTEGER prec, INTEGER dim) OPV_expr(n->right, prec); } else { if (OPV_SideEffects(n->right)) { - OPM_WriteString((CHAR*)"__XF(", (LONGINT)6); + OPM_WriteString((CHAR*)"__XF(", 6); } else { - OPM_WriteString((CHAR*)"__X(", (LONGINT)5); + OPM_WriteString((CHAR*)"__X(", 5); } OPV_expr(n->right, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_Len(d, dim); OPM_Write(')'); } @@ -570,12 +585,12 @@ static void OPV_design (OPT_Node n, INTEGER prec) OPT_Struct typ = NIL; INTEGER class, designPrec, comp; OPT_Node d = NIL, x = NIL; - INTEGER dims, i, _for__27; + INTEGER dims, i, _for__28; comp = n->typ->comp; obj = n->obj; class = n->class; designPrec = OPV_Precedence(class, n->subcl, n->typ->form, comp); - if ((((((class == 0 && obj->mnolev > 0)) && (int)obj->mnolev != OPM_level)) && prec == 10)) { + if ((((((class == 0 && obj->mnolev > 0)) && obj->mnolev != OPM_level)) && prec == 10)) { designPrec = 9; } if (prec > designPrec) { @@ -600,7 +615,7 @@ static void OPV_design (OPT_Node n, INTEGER prec) case 2: if (n->left->class == 3) { OPV_design(n->left->left, designPrec); - OPM_WriteString((CHAR*)"->", (LONGINT)3); + OPM_WriteString((CHAR*)"->", 3); } else { OPV_design(n->left, designPrec); OPM_Write('.'); @@ -610,7 +625,7 @@ static void OPV_design (OPT_Node n, INTEGER prec) case 3: if (n->typ->comp == 3) { OPV_design(n->left, 10); - OPM_WriteString((CHAR*)"->data", (LONGINT)7); + OPM_WriteString((CHAR*)"->data", 7); } else { OPM_Write('*'); OPV_design(n->left, designPrec); @@ -637,25 +652,25 @@ static void OPV_design (OPT_Node n, INTEGER prec) while (x != d) { if (x->left != d) { OPV_Index(x, d, 7, i); - OPM_WriteString((CHAR*)" + ", (LONGINT)4); + OPM_WriteString((CHAR*)" + ", 4); OPV_Len(d, i); - OPM_WriteString((CHAR*)" * (", (LONGINT)5); + OPM_WriteString((CHAR*)" * (", 5); i -= 1; } else { OPV_Index(x, d, -1, i); } x = x->left; } - _for__27 = dims; + _for__28 = dims; i = 1; - while (i <= _for__27) { + while (i <= _for__28) { OPM_Write(')'); i += 1; } if (n->typ->comp == 3) { OPM_Write(')'); while ((SYSTEM_INT64)i < __ASHR(d->typ->size - 4, 2)) { - OPM_WriteString((CHAR*)" * ", (LONGINT)4); + OPM_WriteString((CHAR*)" * ", 4); OPV_Len(d, i); i += 1; } @@ -673,33 +688,33 @@ static void OPV_design (OPT_Node n, INTEGER prec) obj = n->left->obj; if (__IN(3, OPM_opt)) { if (typ->comp == 4) { - OPM_WriteString((CHAR*)"__GUARDR(", (LONGINT)10); - if ((int)obj->mnolev != OPM_level) { - OPM_WriteStringVar((void*)obj->scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"__curr->", (LONGINT)9); + OPM_WriteString((CHAR*)"__GUARDR(", 10); + if (obj->mnolev != OPM_level) { + OPM_WriteStringVar((void*)obj->scope->name, 256); + OPM_WriteString((CHAR*)"__curr->", 9); OPC_Ident(obj); } else { OPC_Ident(obj); } } else { if (typ->BaseTyp->strobj == NIL) { - OPM_WriteString((CHAR*)"__GUARDA(", (LONGINT)10); + OPM_WriteString((CHAR*)"__GUARDA(", 10); } else { - OPM_WriteString((CHAR*)"__GUARDP(", (LONGINT)10); + OPM_WriteString((CHAR*)"__GUARDP(", 10); } OPV_expr(n->left, -1); typ = typ->BaseTyp; } - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Andent(typ); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(typ->extlev); OPM_Write(')'); } else { if (typ->comp == 4) { - OPM_WriteString((CHAR*)"*(", (LONGINT)3); + OPM_WriteString((CHAR*)"*(", 3); OPC_Ident(typ->strobj); - OPM_WriteString((CHAR*)"*)", (LONGINT)3); + OPM_WriteString((CHAR*)"*)", 3); OPC_CompleteIdent(obj); } else { OPM_Write('('); @@ -712,15 +727,15 @@ static void OPV_design (OPT_Node n, INTEGER prec) case 6: if (__IN(3, OPM_opt)) { if (n->left->class == 1) { - OPM_WriteString((CHAR*)"__GUARDEQR(", (LONGINT)12); + OPM_WriteString((CHAR*)"__GUARDEQR(", 12); OPC_CompleteIdent(n->left->obj); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_TypeOf(n->left); } else { - OPM_WriteString((CHAR*)"__GUARDEQP(", (LONGINT)12); + OPM_WriteString((CHAR*)"__GUARDEQP(", 12); OPV_expr(n->left->left, -1); } - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Ident(n->left->typ->strobj); OPM_Write(')'); } else { @@ -733,8 +748,8 @@ static void OPV_design (OPT_Node n, INTEGER prec) } break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.design, class = ", (LONGINT)39); - OPM_LogWNum(class, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.design, class = ", 39); + OPM_LogWNum(class, 0); OPM_LogWLn(); break; } @@ -743,6 +758,15 @@ static void OPV_design (OPT_Node n, INTEGER prec) } } +static void OPV_ParIntLiteral (LONGINT n, LONGINT size) +{ + if (OPV_ansi) { + OPM_WriteInt(n); + } else { + OPC_IntLiteral(n, size); + } +} + static void OPV_ActualPar (OPT_Node n, OPT_Object fp) { OPT_Struct typ = NIL, aptyp = NIL; @@ -757,81 +781,75 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) if ((((mode == 2 && n->class == 11)) && n->subcl == 29)) { OPM_Write('('); OPC_Ident(n->typ->strobj); - OPM_WriteString((CHAR*)"*)", (LONGINT)3); + OPM_WriteString((CHAR*)"*)", 3); prec = 10; } if (!__IN(n->typ->comp, 0x0c)) { if (mode == 2) { if ((OPV_ansi && typ != n->typ)) { - OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(void*)", 8); } OPM_Write('&'); prec = 9; } else if (OPV_ansi) { if ((__IN(comp, 0x0c) && n->class == 7)) { - OPM_WriteString((CHAR*)"(CHAR*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(CHAR*)", 8); } else if ((((form == 13 && typ != n->typ)) && n->typ != OPT_niltyp)) { - OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(void*)", 8); } } else { if ((__IN(form, 0x0180) && __IN(n->typ->form, 0x70))) { - OPM_WriteString((CHAR*)"(double)", (LONGINT)9); - prec = 9; - } else if ((form == 6 && n->typ->form < 6)) { - OPM_WriteString((CHAR*)"(LONGINT)", (LONGINT)10); + OPM_WriteString((CHAR*)"(double)", 9); prec = 9; + } else if (__IN(form, 0x70)) { + OPV_SizeCast(n->typ->size, typ->size); } } } else if (OPV_ansi) { if ((((mode == 2 && typ != n->typ)) && prec == -1)) { - OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(void*)", 8); } } if ((((mode == 2 && n->class == 11)) && n->subcl == 29)) { OPV_expr(n->left, prec); - } else if ((((((form == 6 && n->class == 7)) && n->conval->intval <= OPM_SignedMaximum(OPM_IntSize))) && n->conval->intval >= OPM_SignedMinimum(OPM_IntSize))) { - OPM_WriteString((CHAR*)"((LONGINT)(", (LONGINT)12); - OPV_expr(n, prec); - OPM_WriteString((CHAR*)"))", (LONGINT)3); + } else if ((__IN(form, 0x70) && n->class == 7)) { + OPV_ParIntLiteral(n->conval->intval, n->typ->size); } else { OPV_expr(n, prec); } if ((comp == 4 && mode == 2)) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_TypeOf(n); } else if (comp == 3) { if (n->class == 7) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); - OPM_WriteString((CHAR*)"(LONGINT)", (LONGINT)10); - OPM_WriteInt(n->conval->intval2); + OPM_WriteString((CHAR*)", ", 3); + OPV_ParIntLiteral(n->conval->intval2, OPM_PointerSize); } else { aptyp = n->typ; dim = 0; while ((typ->comp == 3 && typ->BaseTyp->form != 1)) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_Len(n, dim); typ = typ->BaseTyp; aptyp = aptyp->BaseTyp; dim += 1; } if ((typ->comp == 3 && typ->BaseTyp->form == 1)) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); while (aptyp->comp == 3) { OPV_Len(n, dim); - OPM_WriteString((CHAR*)" * ", (LONGINT)4); + OPM_WriteString((CHAR*)" * ", 4); dim += 1; aptyp = aptyp->BaseTyp; } - OPM_WriteString((CHAR*)"((LONGINT)(", (LONGINT)12); - OPM_WriteInt(aptyp->size); - OPM_WriteString((CHAR*)"))", (LONGINT)3); + OPV_ParIntLiteral(aptyp->size, OPM_PointerSize); } } } n = n->link; fp = fp->link; if (n != NIL) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); } } OPM_Write(')'); @@ -871,9 +889,9 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPC_Constant(n->conval, form); break; case 10: - OPM_WriteString((CHAR*)"__SETRNG(", (LONGINT)10); + OPM_WriteString((CHAR*)"__SETRNG(", 10); OPV_expr(l, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(r, -1); OPM_Write(')'); break; @@ -894,16 +912,16 @@ static void OPV_expr (OPT_Node n, INTEGER prec) case 16: typ = n->obj->typ; if (l->typ->comp == 4) { - OPM_WriteString((CHAR*)"__IS(", (LONGINT)6); + OPM_WriteString((CHAR*)"__IS(", 6); OPC_TypeOf(l->obj); } else { - OPM_WriteString((CHAR*)"__ISP(", (LONGINT)7); + OPM_WriteString((CHAR*)"__ISP(", 7); OPV_expr(l, -1); typ = typ->BaseTyp; } - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Andent(typ); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(typ->extlev); OPM_Write(')'); break; @@ -913,31 +931,31 @@ static void OPV_expr (OPT_Node n, INTEGER prec) case 21: if (OPV_SideEffects(l)) { if (l->typ->form < 7) { - if (l->typ->form < 6) { - OPM_WriteString((CHAR*)"(int)", (LONGINT)6); + if (l->typ->size <= 4) { + OPM_WriteString((CHAR*)"(int)", 6); } - OPM_WriteString((CHAR*)"__ABSF(", (LONGINT)8); + OPM_WriteString((CHAR*)"__ABSF(", 8); } else { - OPM_WriteString((CHAR*)"__ABSFD(", (LONGINT)9); + OPM_WriteString((CHAR*)"__ABSFD(", 9); } } else { - OPM_WriteString((CHAR*)"__ABS(", (LONGINT)7); + OPM_WriteString((CHAR*)"__ABS(", 7); } OPV_expr(l, -1); OPM_Write(')'); break; case 22: - OPM_WriteString((CHAR*)"__CAP(", (LONGINT)7); + OPM_WriteString((CHAR*)"__CAP(", 7); OPV_expr(l, -1); OPM_Write(')'); break; case 23: - OPM_WriteString((CHAR*)"__ODD(", (LONGINT)7); + OPM_WriteString((CHAR*)"__ODD(", 7); OPV_expr(l, -1); OPM_Write(')'); break; case 24: - OPM_WriteString((CHAR*)"(LONGINT)(SYSTEM_ADRINT)", (LONGINT)25); + OPM_WriteString((CHAR*)"(SYSTEM_ADRINT)", 16); if (l->class == 1) { OPC_CompleteIdent(l->obj); } else { @@ -953,13 +971,13 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPC_Ident(n->typ->strobj); OPM_Write(')'); if (__IN(n->typ->form, 0x6000) || __IN(l->typ->form, 0x6000)) { - OPM_WriteString((CHAR*)"(SYSTEM_ADRINT)", (LONGINT)16); + OPM_WriteString((CHAR*)"(SYSTEM_ADRINT)", 16); } OPV_expr(l, exprPrec); } else { - OPM_WriteString((CHAR*)"__VAL(", (LONGINT)7); + OPM_WriteString((CHAR*)"__VAL(", 7); OPC_Ident(n->typ->strobj); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(l, -1); OPM_Write(')'); } @@ -978,84 +996,84 @@ static void OPV_expr (OPT_Node n, INTEGER prec) case 28: case 3: case 4: switch (subclass) { case 15: - OPM_WriteString((CHAR*)"__IN(", (LONGINT)6); + OPM_WriteString((CHAR*)"__IN(", 6); break; case 17: if (r->class == 7) { if (r->conval->intval >= 0) { - OPM_WriteString((CHAR*)"__ASHL(", (LONGINT)8); + OPM_WriteString((CHAR*)"__ASHL(", 8); } else { - OPM_WriteString((CHAR*)"__ASHR(", (LONGINT)8); + OPM_WriteString((CHAR*)"__ASHR(", 8); } } else if (OPV_SideEffects(r)) { - OPM_WriteString((CHAR*)"__ASHF(", (LONGINT)8); + OPM_WriteString((CHAR*)"__ASHF(", 8); } else { - OPM_WriteString((CHAR*)"__ASH(", (LONGINT)7); + OPM_WriteString((CHAR*)"__ASH(", 7); } break; case 18: - OPM_WriteString((CHAR*)"__MASK(", (LONGINT)8); + OPM_WriteString((CHAR*)"__MASK(", 8); break; case 26: - OPM_WriteString((CHAR*)"__BIT(", (LONGINT)7); + OPM_WriteString((CHAR*)"__BIT(", 7); break; case 27: if (r->class == 7) { if (r->conval->intval >= 0) { - OPM_WriteString((CHAR*)"__LSHL(", (LONGINT)8); + OPM_WriteString((CHAR*)"__LSHL(", 8); } else { - OPM_WriteString((CHAR*)"__LSHR(", (LONGINT)8); + OPM_WriteString((CHAR*)"__LSHR(", 8); } } else { - OPM_WriteString((CHAR*)"__LSH(", (LONGINT)7); + OPM_WriteString((CHAR*)"__LSH(", 7); } break; case 28: if (r->class == 7) { if (r->conval->intval >= 0) { - OPM_WriteString((CHAR*)"__ROTL(", (LONGINT)8); + OPM_WriteString((CHAR*)"__ROTL(", 8); } else { - OPM_WriteString((CHAR*)"__ROTR(", (LONGINT)8); + OPM_WriteString((CHAR*)"__ROTR(", 8); } } else { - OPM_WriteString((CHAR*)"__ROT(", (LONGINT)7); + OPM_WriteString((CHAR*)"__ROT(", 7); } break; case 3: if (OPV_SideEffects(n)) { - if (form < 6) { - OPM_WriteString((CHAR*)"(int)", (LONGINT)6); + if (n->typ->size <= 4) { + OPM_WriteString((CHAR*)"(int)", 6); } - OPM_WriteString((CHAR*)"__DIVF(", (LONGINT)8); + OPM_WriteString((CHAR*)"__DIVF(", 8); } else { - OPM_WriteString((CHAR*)"__DIV(", (LONGINT)7); + OPM_WriteString((CHAR*)"__DIV(", 7); } break; case 4: - if (form < 6) { - OPM_WriteString((CHAR*)"(int)", (LONGINT)6); + if (n->typ->size <= 4) { + OPM_WriteString((CHAR*)"(int)", 6); } if (OPV_SideEffects(n)) { - OPM_WriteString((CHAR*)"__MODF(", (LONGINT)8); + OPM_WriteString((CHAR*)"__MODF(", 8); } else { - OPM_WriteString((CHAR*)"__MOD(", (LONGINT)7); + OPM_WriteString((CHAR*)"__MOD(", 7); } break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, subclass = ", (LONGINT)40); - OPM_LogWNum(subclass, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, subclass = ", 40); + OPM_LogWNum(subclass, 0); OPM_LogWLn(); break; } OPV_expr(l, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); if ((((__IN(subclass, 0x18020000) && r->class == 7)) && r->conval->intval < 0)) { OPM_WriteInt(-r->conval->intval); } else { OPV_expr(r, -1); } if (__IN(subclass, 0x18000000)) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Ident(l->typ->strobj); } OPM_Write(')'); @@ -1063,9 +1081,9 @@ static void OPV_expr (OPT_Node n, INTEGER prec) case 9: case 10: case 11: case 12: case 13: case 14: if (__IN(l->typ->form, 0x8400)) { - OPM_WriteString((CHAR*)"__STRCMP(", (LONGINT)10); + OPM_WriteString((CHAR*)"__STRCMP(", 10); OPV_expr(l, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(r, -1); OPM_Write(')'); OPC_Cmp(subclass); @@ -1075,7 +1093,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPC_Cmp(subclass); typ = l->typ; if ((((((typ->form == 13 && r->typ->form != 11)) && r->typ != typ)) && r->typ != OPT_sysptrtyp)) { - OPM_WriteString((CHAR*)"(void *) ", (LONGINT)10); + OPM_WriteString((CHAR*)"(void *) ", 10); } OPV_expr(r, exprPrec); } @@ -1088,16 +1106,16 @@ static void OPV_expr (OPT_Node n, INTEGER prec) switch (subclass) { case 1: if (form == 9) { - OPM_WriteString((CHAR*)" & ", (LONGINT)4); + OPM_WriteString((CHAR*)" & ", 4); } else { - OPM_WriteString((CHAR*)" * ", (LONGINT)4); + OPM_WriteString((CHAR*)" * ", 4); } break; case 2: if (form == 9) { - OPM_WriteString((CHAR*)" ^ ", (LONGINT)4); + OPM_WriteString((CHAR*)" ^ ", 4); } else { - OPM_WriteString((CHAR*)" / ", (LONGINT)4); + OPM_WriteString((CHAR*)" / ", 4); if (r->obj == NIL || __IN(r->obj->typ->form, 0x70)) { OPM_Write('('); OPC_Ident(n->typ->strobj); @@ -1106,28 +1124,28 @@ static void OPV_expr (OPT_Node n, INTEGER prec) } break; case 5: - OPM_WriteString((CHAR*)" && ", (LONGINT)5); + OPM_WriteString((CHAR*)" && ", 5); break; case 6: if (form == 9) { - OPM_WriteString((CHAR*)" | ", (LONGINT)4); + OPM_WriteString((CHAR*)" | ", 4); } else { - OPM_WriteString((CHAR*)" + ", (LONGINT)4); + OPM_WriteString((CHAR*)" + ", 4); } break; case 7: if (form == 9) { - OPM_WriteString((CHAR*)" & ~", (LONGINT)5); + OPM_WriteString((CHAR*)" & ~", 5); } else { - OPM_WriteString((CHAR*)" - ", (LONGINT)4); + OPM_WriteString((CHAR*)" - ", 4); } break; case 8: - OPM_WriteString((CHAR*)" || ", (LONGINT)5); + OPM_WriteString((CHAR*)" || ", 5); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, subclass = ", (LONGINT)40); - OPM_LogWNum(subclass, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, subclass = ", 40); + OPM_LogWNum(subclass, 0); OPM_LogWLn(); break; } @@ -1143,7 +1161,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) if (l->subcl == 1) { proc = OPV_SuperProc(n); } else { - OPM_WriteString((CHAR*)"__", (LONGINT)3); + OPM_WriteString((CHAR*)"__", 3); proc = OPC_BaseTProc(l->obj); } OPC_Ident(proc); @@ -1172,7 +1190,7 @@ static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) LONGINT adr; if_ = n->left; while (if_ != NIL) { - OPM_WriteString((CHAR*)"if ", (LONGINT)4); + OPM_WriteString((CHAR*)"if ", 4); OPV_expr(if_->left, 12); OPM_Write(' '); OPC_BegBlk(); @@ -1183,9 +1201,9 @@ static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) if (typ->comp == 4) { OPC_BegStat(); OPC_Ident(if_->left->obj); - OPM_WriteString((CHAR*)" *", (LONGINT)3); - OPM_WriteString(obj->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"__ = (void*)", (LONGINT)13); + OPM_WriteString((CHAR*)" *", 3); + OPM_WriteString(obj->name, 256); + OPM_WriteString((CHAR*)"__ = (void*)", 13); obj->adr = 0; OPC_CompleteIdent(obj); OPC_EndStat(); @@ -1201,13 +1219,13 @@ static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) if_ = if_->link; if ((if_ != NIL || n->right != NIL) || withtrap) { OPC_EndBlk0(); - OPM_WriteString((CHAR*)" else ", (LONGINT)7); + OPM_WriteString((CHAR*)" else ", 7); } else { OPC_EndBlk(); } } if (withtrap) { - OPM_WriteString((CHAR*)"__WITHCHK", (LONGINT)10); + OPM_WriteString((CHAR*)"__WITHCHK", 10); OPC_EndStat(); } else if (n->right != NIL) { OPC_BegBlk(); @@ -1221,7 +1239,7 @@ static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc) OPT_Node switchCase = NIL, label = NIL; LONGINT low, high; INTEGER form, i; - OPM_WriteString((CHAR*)"switch ", (LONGINT)8); + OPM_WriteString((CHAR*)"switch ", 8); OPV_expr(n->left, 12); OPM_Write(' '); OPC_BegBlk(); @@ -1253,22 +1271,22 @@ static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc) OPC_Indent(1); OPV_stat(switchCase->right, outerProc); OPC_BegStat(); - OPM_WriteString((CHAR*)"break", (LONGINT)6); + OPM_WriteString((CHAR*)"break", 6); OPC_EndStat(); OPC_Indent(-1); switchCase = switchCase->link; } OPC_BegStat(); - OPM_WriteString((CHAR*)"default: ", (LONGINT)10); + OPM_WriteString((CHAR*)"default: ", 10); if (n->right->conval->setval != 0x0) { OPC_Indent(1); OPM_WriteLn(); OPV_stat(n->right->right, outerProc); OPC_BegStat(); - OPM_WriteString((CHAR*)"break", (LONGINT)6); + OPM_WriteString((CHAR*)"break", 6); OPC_Indent(-1); } else { - OPM_WriteString((CHAR*)"__CASECHK", (LONGINT)10); + OPM_WriteString((CHAR*)"__CASECHK", 10); } OPC_EndStat(); OPC_EndBlk(); @@ -1298,44 +1316,40 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) base = base->BaseTyp; } OPV_design(d, -1); - OPM_WriteString((CHAR*)" = __NEWARR(", (LONGINT)13); + OPM_WriteString((CHAR*)" = __NEWARR(", 13); while (base->comp == 2) { nofdim += 1; base = base->BaseTyp; } if ((base->comp == 4 && OPC_NofPtrs(base) != 0)) { OPC_Ident(base->strobj); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } else if (base->form == 13) { - OPM_WriteString((CHAR*)"POINTER__typ", (LONGINT)13); + OPM_WriteString((CHAR*)"POINTER__typ", 13); } else { - OPM_WriteString((CHAR*)"NIL", (LONGINT)4); + OPM_WriteString((CHAR*)"NIL", 4); } - OPM_WriteString((CHAR*)", ", (LONGINT)3); - OPM_WriteString((CHAR*)"((LONGINT)(", (LONGINT)12); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(base->size); - OPM_WriteString((CHAR*)"))", (LONGINT)3); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(OPC_BaseAlignment(base)); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(nofdim); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(nofdyn); while (typ != base) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); if (typ->comp == 3) { if (x->class == 7) { - OPM_WriteString((CHAR*)"(LONGINT)(", (LONGINT)11); - OPV_expr(x, -1); - OPM_WriteString((CHAR*)")", (LONGINT)2); + OPC_IntLiteral(x->conval->intval, OPM_PointerSize); } else { - OPM_WriteString((CHAR*)"(LONGINT)", (LONGINT)10); + OPM_WriteString((CHAR*)"((SYSTEM_ADRINT)(", 18); OPV_expr(x, 10); + OPM_WriteString((CHAR*)"))", 3); } x = x->link; } else { - OPM_WriteString((CHAR*)"(LONGINT)", (LONGINT)10); - OPM_WriteInt(typ->n); + OPC_IntLiteral(typ->n, OPM_PointerSize); } typ = typ->BaseTyp; } @@ -1378,7 +1392,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPV_DefineTDescs(n->right); OPC_EnterBody(); OPV_InitTDescs(n->right); - OPM_WriteString((CHAR*)"/* BEGIN */", (LONGINT)12); + OPM_WriteString((CHAR*)"/* BEGIN */", 12); OPM_WriteLn(); OPV_stat(n->right, outerProc); OPC_ExitBody(); @@ -1404,11 +1418,11 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) l = n->left; r = n->right; if (l->typ->comp == 2) { - OPM_WriteString((CHAR*)"__MOVE(", (LONGINT)8); + OPM_WriteString((CHAR*)"__MOVE(", 8); OPV_expr(r, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(l, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); if (r->typ == OPT_stringtyp) { OPM_WriteInt(r->conval->intval2); } else { @@ -1421,13 +1435,13 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPV_design(l, -1); l->obj->adr = 1; if (r->typ->form != 11) { - OPM_WriteString((CHAR*)" = (void*)", (LONGINT)11); + OPM_WriteString((CHAR*)" = (void*)", 11); } else { - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteString((CHAR*)" = ", 4); } } else { OPV_design(l, -1); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteString((CHAR*)" = ", 4); } if (l->typ == r->typ) { OPV_expr(r, -1); @@ -1437,9 +1451,9 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPM_Write(')'); OPV_expr(r, -1); } else if (l->typ->comp == 4) { - OPM_WriteString((CHAR*)"*(", (LONGINT)3); + OPM_WriteString((CHAR*)"*(", 3); OPC_Andent(l->typ); - OPM_WriteString((CHAR*)"*)&", (LONGINT)4); + OPM_WriteString((CHAR*)"*)&", 4); OPV_expr(r, 9); } else { OPV_expr(r, -1); @@ -1448,11 +1462,11 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) break; case 1: if (n->left->typ->BaseTyp->comp == 4) { - OPM_WriteString((CHAR*)"__NEW(", (LONGINT)7); + OPM_WriteString((CHAR*)"__NEW(", 7); OPV_design(n->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Andent(n->left->typ->BaseTyp); - OPM_WriteString((CHAR*)")", (LONGINT)2); + OPM_WriteString((CHAR*)")", 2); } else if (__IN(n->left->typ->BaseTyp->comp, 0x0c)) { OPV_NewArr(n->left, n->right); } @@ -1465,43 +1479,43 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) case 15: case 16: OPV_expr(n->left, -1); OPC_SetInclude(n->subcl == 16); - OPM_WriteString((CHAR*)"__SETOF(", (LONGINT)9); + OPM_WriteString((CHAR*)"__SETOF(", 9); OPV_expr(n->right, -1); OPM_Write(')'); break; case 18: - OPM_WriteString((CHAR*)"__COPY(", (LONGINT)8); + OPM_WriteString((CHAR*)"__COPY(", 8); OPV_expr(n->right, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(n->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); - OPV_Len(n->left, ((LONGINT)(0))); + OPM_WriteString((CHAR*)", ", 3); + OPV_Len(n->left, 0); OPM_Write(')'); break; case 31: - OPM_WriteString((CHAR*)"__MOVE(", (LONGINT)8); + OPM_WriteString((CHAR*)"__MOVE(", 8); OPV_expr(n->right, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(n->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(n->right->link, -1); OPM_Write(')'); break; case 24: - OPM_WriteString((CHAR*)"__GET(", (LONGINT)7); + OPM_WriteString((CHAR*)"__GET(", 7); OPV_expr(n->right, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(n->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Ident(n->left->typ->strobj); OPM_Write(')'); break; case 25: - OPM_WriteString((CHAR*)"__PUT(", (LONGINT)7); + OPM_WriteString((CHAR*)"__PUT(", 7); OPV_expr(n->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(n->right, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Ident(n->right->typ->strobj); OPM_Write(')'); break; @@ -1509,15 +1523,15 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPM_err(200); break; case 30: - OPM_WriteString((CHAR*)"__SYSNEW(", (LONGINT)10); + OPM_WriteString((CHAR*)"__SYSNEW(", 10); OPV_design(n->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(n->right, -1); OPM_Write(')'); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, n^.subcl = ", (LONGINT)40); - OPM_LogWNum(n->subcl, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, n^.subcl = ", 40); + OPM_LogWNum(n->subcl, 0); OPM_LogWLn(); break; } @@ -1527,7 +1541,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) if (n->left->subcl == 1) { proc = OPV_SuperProc(n); } else { - OPM_WriteString((CHAR*)"__", (LONGINT)3); + OPM_WriteString((CHAR*)"__", 3); proc = OPC_BaseTProc(n->left->obj); } OPC_Ident(proc); @@ -1543,9 +1557,9 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) if (n->subcl != 32) { OPV_IfStat(n, 0, outerProc); } else if (OPV_assert) { - OPM_WriteString((CHAR*)"__ASSERT(", (LONGINT)10); + OPM_WriteString((CHAR*)"__ASSERT(", 10); OPV_expr(n->left->left->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(n->left->right->right->conval->intval); OPM_Write(')'); OPC_EndStat(); @@ -1558,7 +1572,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) break; case 22: OPV_exit.level += 1; - OPM_WriteString((CHAR*)"while ", (LONGINT)7); + OPM_WriteString((CHAR*)"while ", 7); OPV_expr(n->left, 12); OPM_Write(' '); OPC_BegBlk(); @@ -1568,11 +1582,11 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) break; case 23: OPV_exit.level += 1; - OPM_WriteString((CHAR*)"do ", (LONGINT)4); + OPM_WriteString((CHAR*)"do ", 4); OPC_BegBlk(); OPV_stat(n->left, outerProc); OPC_EndBlk0(); - OPM_WriteString((CHAR*)" while (!", (LONGINT)10); + OPM_WriteString((CHAR*)" while (!", 10); OPV_expr(n->right, 9); OPM_Write(')'); OPV_exit.level -= 1; @@ -1581,13 +1595,13 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) saved = OPV_exit; OPV_exit.level = 0; OPV_exit.label = -1; - OPM_WriteString((CHAR*)"for (;;) ", (LONGINT)10); + OPM_WriteString((CHAR*)"for (;;) ", 10); OPC_BegBlk(); OPV_stat(n->left, outerProc); OPC_EndBlk(); if (OPV_exit.label != -1) { OPC_BegStat(); - OPM_WriteString((CHAR*)"exit__", (LONGINT)7); + OPM_WriteString((CHAR*)"exit__", 7); OPM_WriteInt(OPV_exit.label); OPM_Write(':'); OPC_EndStat(); @@ -1596,39 +1610,39 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) break; case 25: if (OPV_exit.level == 0) { - OPM_WriteString((CHAR*)"break", (LONGINT)6); + OPM_WriteString((CHAR*)"break", 6); } else { if (OPV_exit.label == -1) { OPV_exit.label = OPV_nofExitLabels; OPV_nofExitLabels += 1; } - OPM_WriteString((CHAR*)"goto exit__", (LONGINT)12); + OPM_WriteString((CHAR*)"goto exit__", 12); OPM_WriteInt(OPV_exit.label); } break; case 26: if (OPM_level == 0) { if (OPV_mainprog) { - OPM_WriteString((CHAR*)"__FINI", (LONGINT)7); + OPM_WriteString((CHAR*)"__FINI", 7); } else { - OPM_WriteString((CHAR*)"__ENDMOD", (LONGINT)9); + OPM_WriteString((CHAR*)"__ENDMOD", 9); } } else { if (n->left != NIL) { - OPM_WriteString((CHAR*)"_o_result = ", (LONGINT)13); + OPM_WriteString((CHAR*)"_o_result = ", 13); if ((n->left->typ->form == 13 && n->obj->typ != n->left->typ)) { - OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(void*)", 8); OPV_expr(n->left, 10); } else { OPV_expr(n->left, -1); } - OPM_WriteString((CHAR*)";", (LONGINT)2); + OPM_WriteString((CHAR*)";", 2); OPM_WriteLn(); OPC_BegStat(); OPC_ExitProc(outerProc, 0, 0); - OPM_WriteString((CHAR*)"return _o_result", (LONGINT)17); + OPM_WriteString((CHAR*)"return _o_result", 17); } else { - OPM_WriteString((CHAR*)"return", (LONGINT)7); + OPM_WriteString((CHAR*)"return", 7); } } break; @@ -1639,8 +1653,8 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPC_Halt(n->right->conval->intval); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, n^.class = ", (LONGINT)40); - OPM_LogWNum(n->class, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, n^.class = ", 40); + OPM_LogWNum(n->class, 0); OPM_LogWLn(); break; } diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index 43ab4681..351ef416 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 7637b515..6e34dddd 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -230,7 +230,7 @@ void Platform_Init (INTEGER argc, LONGINT argvadr) Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; Platform_ArgCount = argc; - av = (Platform_ArgVecPtr)(SYSTEM_ADRINT)argvadr; + av = __VAL(Platform_ArgVecPtr, argvadr); Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; Platform_HeapInitHeap(); @@ -263,8 +263,8 @@ void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { - av = (Platform_ArgVec)(SYSTEM_ADRINT)Platform_ArgVector; - __COPY(*(*av)[__X(n, ((LONGINT)(1024)))], val, val__len); + av = __VAL(Platform_ArgVec, Platform_ArgVector); + __COPY(*(*av)[__X(n, 1024)], val, val__len); } } @@ -273,17 +273,17 @@ void Platform_GetIntArg (INTEGER n, LONGINT *val) CHAR s[64]; LONGINT k, d, i; s[0] = 0x00; - Platform_GetArg(n, (void*)s, ((LONGINT)(64))); + Platform_GetArg(n, (void*)s, 64); i = 0; if (s[0] == '-') { i = 1; } k = 0; - d = (int)s[__X(i, ((LONGINT)(64)))] - 48; + d = s[__X(i, 64)] - 48; while ((d >= 0 && d <= 9)) { k = k * 10 + d; i += 1; - d = (int)s[__X(i, ((LONGINT)(64)))] - 48; + d = s[__X(i, 64)] - 48; } if (s[0] == '-') { k = -k; @@ -301,10 +301,10 @@ INTEGER Platform_ArgPos (CHAR *s, LONGINT s__len) CHAR arg[256]; __DUP(s, s__len, CHAR); i = 0; - Platform_GetArg(i, (void*)arg, ((LONGINT)(256))); + Platform_GetArg(i, (void*)arg, 256); while ((i < Platform_ArgCount && __STRCMP(s, arg) != 0)) { i += 1; - Platform_GetArg(i, (void*)arg, ((LONGINT)(256))); + Platform_GetArg(i, (void*)arg, 256); } _o_result = i; __DEL(s); @@ -530,7 +530,7 @@ INTEGER Platform_Read (LONGINT h, LONGINT p, LONGINT l, LONGINT *n) INTEGER Platform_ReadBuf (LONGINT h, SYSTEM_BYTE *b, LONGINT b__len, LONGINT *n) { INTEGER _o_result; - *n = Platform_readfile(h, (LONGINT)(SYSTEM_ADRINT)b, b__len); + *n = Platform_readfile(h, (SYSTEM_ADRINT)b, b__len); if (*n < 0) { *n = 0; _o_result = Platform_err(); @@ -614,7 +614,7 @@ INTEGER Platform_Chdir (CHAR *n, LONGINT n__len) INTEGER _o_result; INTEGER r; r = Platform_chdir(n, n__len); - Platform_getcwd((void*)Platform_CWD, ((LONGINT)(256))); + Platform_getcwd((void*)Platform_CWD, 256); if (r < 0) { _o_result = Platform_err(); return _o_result; @@ -675,52 +675,52 @@ static void Platform_DisplayHaltCode (LONGINT code) { switch (code) { case -1: - Platform_errstring((CHAR*)"Assertion failure.", (LONGINT)19); + Platform_errstring((CHAR*)"Assertion failure.", 19); break; case -2: - Platform_errstring((CHAR*)"Index out of range.", (LONGINT)20); + Platform_errstring((CHAR*)"Index out of range.", 20); break; case -3: - Platform_errstring((CHAR*)"Reached end of function without reaching RETURN.", (LONGINT)49); + Platform_errstring((CHAR*)"Reached end of function without reaching RETURN.", 49); break; case -4: - Platform_errstring((CHAR*)"CASE statement: no matching label and no ELSE.", (LONGINT)47); + Platform_errstring((CHAR*)"CASE statement: no matching label and no ELSE.", 47); break; case -5: - Platform_errstring((CHAR*)"Type guard failed.", (LONGINT)19); + Platform_errstring((CHAR*)"Type guard failed.", 19); break; case -6: - Platform_errstring((CHAR*)"Implicit type guard in record assignment failed.", (LONGINT)49); + Platform_errstring((CHAR*)"Implicit type guard in record assignment failed.", 49); break; case -7: - Platform_errstring((CHAR*)"Invalid case in WITH statement.", (LONGINT)32); + Platform_errstring((CHAR*)"Invalid case in WITH statement.", 32); break; case -8: - Platform_errstring((CHAR*)"Value out of range.", (LONGINT)20); + Platform_errstring((CHAR*)"Value out of range.", 20); break; case -9: - Platform_errstring((CHAR*)"Heap interrupted while locked, but lockdepth = 0 at unlock.", (LONGINT)60); + Platform_errstring((CHAR*)"Heap interrupted while locked, but lockdepth = 0 at unlock.", 60); break; case -10: - Platform_errstring((CHAR*)"NIL access.", (LONGINT)12); + Platform_errstring((CHAR*)"NIL access.", 12); break; case -11: - Platform_errstring((CHAR*)"Alignment error.", (LONGINT)17); + Platform_errstring((CHAR*)"Alignment error.", 17); break; case -12: - Platform_errstring((CHAR*)"Divide by zero.", (LONGINT)16); + Platform_errstring((CHAR*)"Divide by zero.", 16); break; case -13: - Platform_errstring((CHAR*)"Arithmetic overflow/underflow.", (LONGINT)31); + Platform_errstring((CHAR*)"Arithmetic overflow/underflow.", 31); break; case -14: - Platform_errstring((CHAR*)"Invalid function argument.", (LONGINT)27); + Platform_errstring((CHAR*)"Invalid function argument.", 27); break; case -15: - Platform_errstring((CHAR*)"Internal error, e.g. Type descriptor size mismatch.", (LONGINT)52); + Platform_errstring((CHAR*)"Internal error, e.g. Type descriptor size mismatch.", 52); break; case -20: - Platform_errstring((CHAR*)"Too many, or negative number of, elements in dynamic array.", (LONGINT)60); + Platform_errstring((CHAR*)"Too many, or negative number of, elements in dynamic array.", 60); break; default: break; @@ -734,9 +734,9 @@ void Platform_Halt (LONGINT code) if (Platform_HaltHandler != NIL) { (*Platform_HaltHandler)(code); } - Platform_errstring((CHAR*)"Terminated by Halt(", (LONGINT)20); + Platform_errstring((CHAR*)"Terminated by Halt(", 20); Platform_errint(code); - Platform_errstring((CHAR*)"). ", (LONGINT)4); + Platform_errstring((CHAR*)"). ", 4); if (code < 0) { Platform_DisplayHaltCode(code); } @@ -747,11 +747,11 @@ void Platform_Halt (LONGINT code) void Platform_AssertFail (LONGINT code) { INTEGER e; - Platform_errstring((CHAR*)"Assertion failure.", (LONGINT)19); + Platform_errstring((CHAR*)"Assertion failure.", 19); if (code != 0) { - Platform_errstring((CHAR*)" ASSERT code ", (LONGINT)14); + Platform_errstring((CHAR*)" ASSERT code ", 14); Platform_errint(code); - Platform_errstring((CHAR*)".", (LONGINT)2); + Platform_errstring((CHAR*)".", 2); } Platform_errln(); Platform_exit(__VAL(INTEGER, code)); @@ -766,7 +766,7 @@ static void Platform_TestLittleEndian (void) { INTEGER i; i = 1; - __GET((LONGINT)(SYSTEM_ADRINT)&i, Platform_LittleEndian, BOOLEAN); + __GET((SYSTEM_ADRINT)&i, Platform_LittleEndian, BOOLEAN); } __TDESC(Platform_FileIdentity, 1, 0) = {__TDFLDS("FileIdentity", 24), {-8}}; @@ -783,7 +783,7 @@ export void *Platform__init(void) Platform_TimeStart = 0; Platform_TimeStart = Platform_Time(); Platform_CWD[0] = 0x00; - Platform_getcwd((void*)Platform_CWD, ((LONGINT)(256))); + Platform_getcwd((void*)Platform_CWD, 256); Platform_PID = Platform_getpid(); Platform_SeekSet = Platform_seekset(); Platform_SeekCur = Platform_seekcur(); diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index 0fee3539..ca58fbe8 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index a5a93902..0652d6b4 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -59,7 +59,7 @@ INTEGER Reals_Expo (REAL x) { INTEGER _o_result; INTEGER i; - __GET((LONGINT)(SYSTEM_ADRINT)&x + 2, i, INTEGER); + __GET((SYSTEM_ADRINT)&x + 2, i, INTEGER); _o_result = __MASK(__ASHR(i, 7), -256); return _o_result; } @@ -67,17 +67,17 @@ INTEGER Reals_Expo (REAL x) void Reals_SetExpo (REAL *x, INTEGER ex) { CHAR c; - __GET((LONGINT)(SYSTEM_ADRINT)x + 3, c, CHAR); - __PUT((LONGINT)(SYSTEM_ADRINT)x + 3, (CHAR)(__ASHL(__ASHR((int)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); - __GET((LONGINT)(SYSTEM_ADRINT)x + 2, c, CHAR); - __PUT((LONGINT)(SYSTEM_ADRINT)x + 2, (CHAR)(__MASK((int)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); + __GET((SYSTEM_ADRINT)x + 3, c, CHAR); + __PUT((SYSTEM_ADRINT)x + 3, (CHAR)(__ASHL(__ASHR(c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __GET((SYSTEM_ADRINT)x + 2, c, CHAR); + __PUT((SYSTEM_ADRINT)x + 2, (CHAR)(__MASK(c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } INTEGER Reals_ExpoL (LONGREAL x) { INTEGER _o_result; INTEGER i; - __GET((LONGINT)(SYSTEM_ADRINT)&x + 6, i, INTEGER); + __GET((SYSTEM_ADRINT)&x + 6, i, INTEGER); _o_result = __MASK(__ASHR(i, 4), -2048); return _o_result; } @@ -124,20 +124,20 @@ static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LO l = b__len; while ((SYSTEM_INT64)i < l) { by = __VAL(CHAR, b[__X(i, b__len)]); - d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((int)by, 4)); - d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((int)by, -16)); + d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR(by, 4)); + d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK(by, -16)); i += 1; } } void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len) { - Reals_BytesToHex((void*)&y, ((LONGINT)(4)), (void*)d, d__len * ((LONGINT)(1))); + Reals_BytesToHex((void*)&y, 4, (void*)d, d__len * 1); } void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len) { - Reals_BytesToHex((void*)&x, ((LONGINT)(8)), (void*)d, d__len * ((LONGINT)(1))); + Reals_BytesToHex((void*)&x, 8, (void*)d, d__len * 1); } diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index 76bda39d..9836b502 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index bd57ef4e..ad6ecbeb 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -113,7 +113,7 @@ void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n, INTEGER len, destLen, i; __DUP(source, source__len, CHAR); len = Strings_Length(source, source__len); - destLen = (int)dest__len - 1; + destLen = (SYSTEM_INT32)dest__len - 1; if (pos < 0) { pos = 0; } diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index aa97eeac..f836f9f9 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index cd9388a6..01c67abc 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Files.h" @@ -232,7 +232,7 @@ static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len) Texts_FontsFont _o_result; Texts_FontsFont F = NIL; __NEW(F, Texts_FontDesc); - __COPY(name, F->name, ((LONGINT)(32))); + __COPY(name, F->name, 32); _o_result = F; return _o_result; } @@ -399,15 +399,15 @@ static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, LONGINT *msg__t e->file = ((Texts_Alien)E)->file; e->org = ((Texts_Alien)E)->org; e->span = ((Texts_Alien)E)->span; - __COPY(((Texts_Alien)E)->mod, e->mod, ((LONGINT)(32))); - __COPY(((Texts_Alien)E)->proc, e->proc, ((LONGINT)(32))); + __COPY(((Texts_Alien)E)->mod, e->mod, 32); + __COPY(((Texts_Alien)E)->proc, e->proc, 32); (*msg__).e = (Texts_Elem)e; } else __WITHCHK; } else if (__IS(msg__typ, Texts_IdentifyMsg, 1)) { if (__IS(msg__typ, Texts_IdentifyMsg, 1)) { Texts_IdentifyMsg *msg__ = (void*)msg; - __COPY(((Texts_Alien)E)->mod, (*msg__).mod, ((LONGINT)(32))); - __COPY(((Texts_Alien)E)->proc, (*msg__).proc, ((LONGINT)(32))); + __COPY(((Texts_Alien)E)->mod, (*msg__).mod, 32); + __COPY(((Texts_Alien)E)->proc, (*msg__).proc, 32); (*msg__).mod[31] = 0x01; } else __WITHCHK; } else if (__IS(msg__typ, Texts_FileMsg, 1)) { @@ -747,7 +747,7 @@ static void ReadScaleFactor__32 (void) } } while (('0' <= *Scan__31_s->ch && *Scan__31_s->ch <= '9')) { - *Scan__31_s->e = (*Scan__31_s->e * 10 + (int)*Scan__31_s->ch) - 48; + *Scan__31_s->e = (*Scan__31_s->e * 10 + *Scan__31_s->ch) - 48; Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); } } @@ -781,21 +781,21 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) } if ((('A' <= __CAP(ch) && __CAP(ch) <= 'Z') || ch == '/') || ch == '.') { do { - (*S).s[__X(i, ((LONGINT)(64)))] = ch; + (*S).s[__X(i, 64)] = ch; i += 1; Texts_Read((void*)&*S, S__typ, &ch); } while (!((((__CAP(ch) > 'Z' && ch != '_') || ('A' > __CAP(ch) && ch > '9')) || ((('0' > ch && ch != '.')) && ch != '/')) || i == 63)); - (*S).s[__X(i, ((LONGINT)(64)))] = 0x00; + (*S).s[__X(i, 64)] = 0x00; (*S).len = i; (*S).class = 1; } else if (ch == '"') { Texts_Read((void*)&*S, S__typ, &ch); while ((((ch != '"' && ch >= ' ')) && i != 63)) { - (*S).s[__X(i, ((LONGINT)(64)))] = ch; + (*S).s[__X(i, 64)] = ch; i += 1; Texts_Read((void*)&*S, S__typ, &ch); } - (*S).s[__X(i, ((LONGINT)(64)))] = 0x00; + (*S).s[__X(i, 64)] = 0x00; (*S).len = i + 1; Texts_Read((void*)&*S, S__typ, &ch); (*S).class = 2; @@ -810,7 +810,7 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) hex = 0; j = 0; for (;;) { - d[__X(i, ((LONGINT)(32)))] = ch; + d[__X(i, 32)] = ch; i += 1; Texts_Read((void*)&*S, S__typ, &ch); if (ch < '0') { @@ -819,10 +819,10 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) if ('9' < ch) { if (('A' <= ch && ch <= 'F')) { hex = 1; - ch = (CHAR)((int)ch - 7); + ch = (CHAR)(ch - 7); } else if (('a' <= ch && ch <= 'f')) { hex = 1; - ch = (CHAR)((int)ch - 39); + ch = (CHAR)(ch - 39); } else { break; } @@ -834,13 +834,13 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) if (i - j > 8) { j = i - 8; } - k = (int)d[__X(j, ((LONGINT)(32)))] - 48; + k = d[__X(j, 32)] - 48; j += 1; if ((i - j == 7 && k >= 8)) { k -= 16; } while (j < i) { - k = __ASHL(k, 4) + (SYSTEM_INT64)((int)d[__X(j, ((LONGINT)(32)))] - 48); + k = __ASHL(k, 4) + (SYSTEM_INT64)(d[__X(j, 32)] - 48); j += 1; } if (neg) { @@ -852,7 +852,7 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) Texts_Read((void*)&*S, S__typ, &ch); h = i; while (('0' <= ch && ch <= '9')) { - d[__X(i, ((LONGINT)(32)))] = ch; + d[__X(i, 32)] = ch; i += 1; Texts_Read((void*)&*S, S__typ, &ch); } @@ -861,12 +861,12 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) y = (LONGREAL)0; g = (LONGREAL)1; do { - y = y * (LONGREAL)10 + ((int)d[__X(j, ((LONGINT)(32)))] - 48); + y = y * (LONGREAL)10 + (d[__X(j, 32)] - 48); j += 1; } while (!(j == h)); while (j < i) { g = g / (LONGREAL)(LONGREAL)10; - y = ((int)d[__X(j, ((LONGINT)(32)))] - 48) * g + y; + y = (d[__X(j, 32)] - 48) * g + y; j += 1; } ReadScaleFactor__32(); @@ -893,12 +893,12 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) x = (REAL)0; f = (REAL)1; do { - x = x * (REAL)10 + ((int)d[__X(j, ((LONGINT)(32)))] - 48); + x = x * (REAL)10 + (d[__X(j, 32)] - 48); j += 1; } while (!(j == h)); while (j < i) { f = f / (REAL)(REAL)10; - x = ((int)d[__X(j, ((LONGINT)(32)))] - 48) * f + x; + x = (d[__X(j, 32)] - 48) * f + x; j += 1; } if (ch == 'E') { @@ -930,7 +930,7 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) (*S).class = 3; k = 0; do { - k = k * 10 + (SYSTEM_INT64)((int)d[__X(j, ((LONGINT)(32)))] - 48); + k = k * 10 + (SYSTEM_INT64)(d[__X(j, 32)] - 48); j += 1; } while (!(j == i)); if (neg) { @@ -965,8 +965,8 @@ void Texts_OpenWriter (Texts_Writer *W, LONGINT *W__typ) (*W).fnt = Texts_FontsDefault; (*W).col = 15; (*W).voff = 0; - (*W).file = Files_New((CHAR*)"", (LONGINT)1); - Files_Set(&(*W).rider, Files_Rider__typ, (*W).file, ((LONGINT)(0))); + (*W).file = Files_New((CHAR*)"", 1); + Files_Set(&(*W).rider, Files_Rider__typ, (*W).file, 0); } void Texts_SetFont (Texts_Writer *W, LONGINT *W__typ, Texts_FontsFont fnt) @@ -1054,7 +1054,7 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n) i = 0; if (x < 0) { if (x == (-9223372036854775807-1)) { - Texts_WriteString(&*W, W__typ, (CHAR*)" -9223372036854775808", (LONGINT)22); + Texts_WriteString(&*W, W__typ, (CHAR*)" -9223372036854775808", 22); return; } else { n -= 1; @@ -1064,7 +1064,7 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n) x0 = x; } do { - a[__X(i, ((LONGINT)(22)))] = (CHAR)(__MOD(x0, 10) + 48); + a[__X(i, 22)] = (CHAR)(__MOD(x0, 10) + 48); x0 = __DIV(x0, 10); i += 1; } while (!(x0 == 0)); @@ -1077,7 +1077,7 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n) } do { i -= 1; - Texts_Write(&*W, W__typ, a[__X(i, ((LONGINT)(22)))]); + Texts_Write(&*W, W__typ, a[__X(i, 22)]); } while (!(i == 0)); } @@ -1091,16 +1091,16 @@ void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, LONGINT x) do { y = __MASK(x, -16); if (y < 10) { - a[__X(i, ((LONGINT)(20)))] = (CHAR)(y + 48); + a[__X(i, 20)] = (CHAR)(y + 48); } else { - a[__X(i, ((LONGINT)(20)))] = (CHAR)(y + 55); + a[__X(i, 20)] = (CHAR)(y + 55); } x = __ASHR(x, 4); i += 1; } while (!(i == 8)); do { i -= 1; - Texts_Write(&*W, W__typ, a[__X(i, ((LONGINT)(20)))]); + Texts_Write(&*W, W__typ, a[__X(i, 20)]); } while (!(i == 0)); } @@ -1111,13 +1111,13 @@ void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n) CHAR d[9]; e = Reals_Expo(x); if (e == 0) { - Texts_WriteString(&*W, W__typ, (CHAR*)" 0", (LONGINT)4); + Texts_WriteString(&*W, W__typ, (CHAR*)" 0", 4); do { Texts_Write(&*W, W__typ, ' '); n -= 1; } while (!(n <= 3)); } else if (e == 255) { - Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", (LONGINT)5); + Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", 5); while (n > 4) { Texts_Write(&*W, W__typ, ' '); n -= 1; @@ -1154,13 +1154,13 @@ void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n) x = x * 1.0000000e-001; e += 1; } - Reals_Convert(x, n, (void*)d, ((LONGINT)(9))); + Reals_Convert(x, n, (void*)d, 9); n -= 1; - Texts_Write(&*W, W__typ, d[__X(n, ((LONGINT)(9)))]); + Texts_Write(&*W, W__typ, d[__X(n, 9)]); Texts_Write(&*W, W__typ, '.'); do { n -= 1; - Texts_Write(&*W, W__typ, d[__X(n, ((LONGINT)(9)))]); + Texts_Write(&*W, W__typ, d[__X(n, 9)]); } while (!(n == 0)); Texts_Write(&*W, W__typ, 'E'); if (e < 0) { @@ -1197,7 +1197,7 @@ static void dig__54 (INTEGER n) { while (n > 0) { *WriteRealFix__53_s->i -= 1; - Texts_Write(&*WriteRealFix__53_s->W, WriteRealFix__53_s->W__typ, (*WriteRealFix__53_s->d)[__X(*WriteRealFix__53_s->i, ((LONGINT)(9)))]); + Texts_Write(&*WriteRealFix__53_s->W, WriteRealFix__53_s->W__typ, (*WriteRealFix__53_s->d)[__X(*WriteRealFix__53_s->i, 9)]); n -= 1; } } @@ -1223,7 +1223,7 @@ void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n, IN Texts_Write(&*W, W__typ, '0'); seq__56(' ', k + 1); } else if (e == 255) { - Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", (LONGINT)5); + Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", 5); seq__56(' ', n - 4); } else { e = __ASHR((e - 127) * 77, 8); @@ -1255,7 +1255,7 @@ void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n, IN } e += 1; i = k + e; - Reals_Convert(x, i, (void*)d, ((LONGINT)(9))); + Reals_Convert(x, i, (void*)d, 9); if (e > 0) { seq__56(' ', ((n - e) - k) - 2); Texts_Write(&*W, W__typ, sign); @@ -1278,10 +1278,10 @@ void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x) { INTEGER i; CHAR d[8]; - Reals_ConvertH(x, (void*)d, ((LONGINT)(8))); + Reals_ConvertH(x, (void*)d, 8); i = 0; do { - Texts_Write(&*W, W__typ, d[__X(i, ((LONGINT)(8)))]); + Texts_Write(&*W, W__typ, d[__X(i, 8)]); i += 1; } while (!(i == 8)); } @@ -1293,13 +1293,13 @@ void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER CHAR d[16]; e = Reals_ExpoL(x); if (e == 0) { - Texts_WriteString(&*W, W__typ, (CHAR*)" 0", (LONGINT)4); + Texts_WriteString(&*W, W__typ, (CHAR*)" 0", 4); do { Texts_Write(&*W, W__typ, ' '); n -= 1; } while (!(n <= 3)); } else if (e == 2047) { - Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", (LONGINT)5); + Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", 5); while (n > 4) { Texts_Write(&*W, W__typ, ' '); n -= 1; @@ -1320,7 +1320,7 @@ void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER } else { Texts_Write(&*W, W__typ, ' '); } - e = (int)__ASHR((SYSTEM_INT64)(e - 1023) * 77, 8); + e = (SYSTEM_INT32)__ASHR((SYSTEM_INT64)(e - 1023) * 77, 8); if (e >= 0) { x = x / (LONGREAL)Reals_TenL(e); } else { @@ -1336,13 +1336,13 @@ void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER x = 1.00000000000000e-001 * x; e += 1; } - Reals_ConvertL(x, n, (void*)d, ((LONGINT)(16))); + Reals_ConvertL(x, n, (void*)d, 16); n -= 1; - Texts_Write(&*W, W__typ, d[__X(n, ((LONGINT)(16)))]); + Texts_Write(&*W, W__typ, d[__X(n, 16)]); Texts_Write(&*W, W__typ, '.'); do { n -= 1; - Texts_Write(&*W, W__typ, d[__X(n, ((LONGINT)(16)))]); + Texts_Write(&*W, W__typ, d[__X(n, 16)]); } while (!(n == 0)); Texts_Write(&*W, W__typ, 'D'); if (e < 0) { @@ -1362,10 +1362,10 @@ void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x) { INTEGER i; CHAR d[16]; - Reals_ConvertHL(x, (void*)d, ((LONGINT)(16))); + Reals_ConvertHL(x, (void*)d, 16); i = 0; do { - Texts_Write(&*W, W__typ, d[__X(i, ((LONGINT)(16)))]); + Texts_Write(&*W, W__typ, d[__X(i, 16)]); i += 1; } while (!(i == 16)); } @@ -1424,13 +1424,13 @@ static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, LONGINT Files_Read(&*r, r__typ, (void*)&eno); if (eno > *Load0__16_s->ecnt) { *Load0__16_s->ecnt = eno; - Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->mods)[__X(eno, ((LONGINT)(64)))], ((LONGINT)(32))); - Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->procs)[__X(eno, ((LONGINT)(64)))], ((LONGINT)(32))); + Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->mods)[__X(eno, 64)], 32); + Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->procs)[__X(eno, 64)], 32); } org = Files_Pos(&*r, r__typ); - M = Modules_ThisMod((*Load0__16_s->mods)[__X(eno, ((LONGINT)(64)))], ((LONGINT)(32))); + M = Modules_ThisMod((*Load0__16_s->mods)[__X(eno, 64)], 32); if (M != NIL) { - Cmd = Modules_ThisCommand(M, (*Load0__16_s->procs)[__X(eno, ((LONGINT)(64)))], ((LONGINT)(32))); + Cmd = Modules_ThisCommand(M, (*Load0__16_s->procs)[__X(eno, 64)], 32); if (Cmd != NIL) { (*Cmd)(); } @@ -1456,8 +1456,8 @@ static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, LONGINT a->file = *Load0__16_s->f; a->org = org; a->span = span; - __COPY((*Load0__16_s->mods)[__X(eno, ((LONGINT)(64)))], a->mod, ((LONGINT)(32))); - __COPY((*Load0__16_s->procs)[__X(eno, ((LONGINT)(64)))], a->proc, ((LONGINT)(32))); + __COPY((*Load0__16_s->mods)[__X(eno, 64)], a->mod, 32); + __COPY((*Load0__16_s->procs)[__X(eno, 64)], a->proc, 32); *e = (Texts_Elem)a; } } @@ -1501,8 +1501,8 @@ static void Texts_Load0 (Files_Rider *r, LONGINT *r__typ, Texts_Text T) while (fno != 0) { if (fno > fcnt) { fcnt = fno; - Files_ReadString(&msg.r, Files_Rider__typ, (void*)name, ((LONGINT)(32))); - fnts[__X(fno, ((LONGINT)(32)))] = Texts_FontsThis((void*)name, ((LONGINT)(32))); + Files_ReadString(&msg.r, Files_Rider__typ, (void*)name, 32); + fnts[__X(fno, 32)] = Texts_FontsThis((void*)name, 32); } Files_Read(&msg.r, Files_Rider__typ, (void*)&col); Files_Read(&msg.r, Files_Rider__typ, (void*)&voff); @@ -1557,9 +1557,9 @@ void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len) __DUP(name, name__len, CHAR); f = Files_Old(name, name__len); if (f == NIL) { - f = Files_New((CHAR*)"", (LONGINT)1); + f = Files_New((CHAR*)"", 1); } - Files_Set(&r, Files_Rider__typ, f, ((LONGINT)(0))); + Files_Set(&r, Files_Rider__typ, f, 0); Files_Read(&r, Files_Rider__typ, (void*)&tag); Files_Read(&r, Files_Rider__typ, (void*)&version); if (tag == 0xf0 || (tag == 0x01 && version == 0xf0)) { @@ -1571,7 +1571,7 @@ void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len) u->col = 15; __NEW(p, Texts_PieceDesc); if ((tag == 0xf7 && version == 0x07)) { - Files_Set(&r, Files_Rider__typ, f, ((LONGINT)(28))); + Files_Set(&r, Files_Rider__typ, f, 28); Files_ReadLInt(&r, Files_Rider__typ, &hlen); Files_Set(&r, Files_Rider__typ, f, 22 + hlen); Files_ReadLInt(&r, Files_Rider__typ, &T->len); @@ -1617,21 +1617,21 @@ static void StoreElem__40 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, Texts_E Files_Rider r1; LONGINT org, span; SHORTINT eno; - __COPY((*Store__39_s->iden).mod, (*Store__39_s->mods)[__X(*Store__39_s->ecnt, ((LONGINT)(64)))], ((LONGINT)(32))); - __COPY((*Store__39_s->iden).proc, (*Store__39_s->procs)[__X(*Store__39_s->ecnt, ((LONGINT)(64)))], ((LONGINT)(32))); + __COPY((*Store__39_s->iden).mod, (*Store__39_s->mods)[__X(*Store__39_s->ecnt, 64)], 32); + __COPY((*Store__39_s->iden).proc, (*Store__39_s->procs)[__X(*Store__39_s->ecnt, 64)], 32); eno = 1; - while (__STRCMP((*Store__39_s->mods)[__X(eno, ((LONGINT)(64)))], (*Store__39_s->iden).mod) != 0 || __STRCMP((*Store__39_s->procs)[__X(eno, ((LONGINT)(64)))], (*Store__39_s->iden).proc) != 0) { + while (__STRCMP((*Store__39_s->mods)[__X(eno, 64)], (*Store__39_s->iden).mod) != 0 || __STRCMP((*Store__39_s->procs)[__X(eno, 64)], (*Store__39_s->iden).proc) != 0) { eno += 1; } Files_Set(&r1, Files_Rider__typ, Files_Base(&*r, r__typ), Files_Pos(&*r, r__typ)); - Files_WriteLInt(&*r, r__typ, ((LONGINT)(0))); - Files_WriteLInt(&*r, r__typ, ((LONGINT)(0))); - Files_WriteLInt(&*r, r__typ, ((LONGINT)(0))); + Files_WriteLInt(&*r, r__typ, 0); + Files_WriteLInt(&*r, r__typ, 0); + Files_WriteLInt(&*r, r__typ, 0); Files_Write(&*r, r__typ, eno); if (eno == *Store__39_s->ecnt) { *Store__39_s->ecnt += 1; - Files_WriteString(&*r, r__typ, (*Store__39_s->iden).mod, ((LONGINT)(32))); - Files_WriteString(&*r, r__typ, (*Store__39_s->iden).proc, ((LONGINT)(32))); + Files_WriteString(&*r, r__typ, (*Store__39_s->iden).mod, 32); + Files_WriteString(&*r, r__typ, (*Store__39_s->iden).proc, 32); } (*Store__39_s->msg).pos = pos; org = Files_Pos(&*r, r__typ); @@ -1666,7 +1666,7 @@ void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T) org = Files_Pos(&*r, r__typ); msg.id = 1; msg.r = *r; - Files_WriteLInt(&msg.r, Files_Rider__typ, ((LONGINT)(0))); + Files_WriteLInt(&msg.r, Files_Rider__typ, 0); u = T->head->next; pos = 0; delta = 0; @@ -1680,15 +1680,15 @@ void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T) iden.mod[0] = 0x01; } if (iden.mod[0] != 0x00) { - fnts[__X(fcnt, ((LONGINT)(32)))] = u->fnt; + fnts[__X(fcnt, 32)] = u->fnt; fno = 1; - while (__STRCMP(fnts[__X(fno, ((LONGINT)(32)))]->name, u->fnt->name) != 0) { + while (__STRCMP(fnts[__X(fno, 32)]->name, u->fnt->name) != 0) { fno += 1; } Files_Write(&msg.r, Files_Rider__typ, fno); if (fno == fcnt) { fcnt += 1; - Files_WriteString(&msg.r, Files_Rider__typ, u->fnt->name, ((LONGINT)(32))); + Files_WriteString(&msg.r, Files_Rider__typ, u->fnt->name, 32); } Files_Write(&msg.r, Files_Rider__typ, u->col); Files_Write(&msg.r, Files_Rider__typ, u->voff); @@ -1737,12 +1737,12 @@ void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T) Files_Set(&r1, Files_Rider__typ, ((Texts_Piece)u)->file, ((Texts_Piece)u)->org); delta = ((Texts_Piece)u)->len; while (delta > 1024) { - Files_ReadBytes(&r1, Files_Rider__typ, (void*)block, ((LONGINT)(1024)), ((LONGINT)(1024))); - Files_WriteBytes(&msg.r, Files_Rider__typ, (void*)block, ((LONGINT)(1024)), ((LONGINT)(1024))); + Files_ReadBytes(&r1, Files_Rider__typ, (void*)block, 1024, 1024); + Files_WriteBytes(&msg.r, Files_Rider__typ, (void*)block, 1024, 1024); delta -= 1024; } - Files_ReadBytes(&r1, Files_Rider__typ, (void*)block, ((LONGINT)(1024)), delta); - Files_WriteBytes(&msg.r, Files_Rider__typ, (void*)block, ((LONGINT)(1024)), delta); + Files_ReadBytes(&r1, Files_Rider__typ, (void*)block, 1024, delta); + Files_WriteBytes(&msg.r, Files_Rider__typ, (void*)block, 1024, delta); } } else __WITHCHK; } else { @@ -1756,7 +1756,7 @@ void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T) } __GUARDEQR(r, r__typ, Files_Rider) = msg.r; if (T->notify != NIL) { - (*T->notify)(T, 3, ((LONGINT)(0)), ((LONGINT)(0))); + (*T->notify)(T, 3, 0, 0); } Store__39_s = _s.lnk; } @@ -1769,7 +1769,7 @@ void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len) CHAR bak[64]; __DUP(name, name__len, CHAR); f = Files_New(name, name__len); - Files_Set(&r, Files_Rider__typ, f, ((LONGINT)(0))); + Files_Set(&r, Files_Rider__typ, f, 0); Files_Write(&r, Files_Rider__typ, 0xf0); Files_Write(&r, Files_Rider__typ, 0x01); Texts_Store(&r, Files_Rider__typ, T); @@ -1777,13 +1777,13 @@ void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len) while (name[__X(i, name__len)] != 0x00) { i += 1; } - __COPY(name, bak, ((LONGINT)(64))); - bak[__X(i, ((LONGINT)(64)))] = '.'; - bak[__X(i + 1, ((LONGINT)(64)))] = 'B'; - bak[__X(i + 2, ((LONGINT)(64)))] = 'a'; - bak[__X(i + 3, ((LONGINT)(64)))] = 'k'; - bak[__X(i + 4, ((LONGINT)(64)))] = 0x00; - Files_Rename(name, name__len, bak, ((LONGINT)(64)), &res); + __COPY(name, bak, 64); + bak[__X(i, 64)] = '.'; + bak[__X(i + 1, 64)] = 'B'; + bak[__X(i + 2, 64)] = 'a'; + bak[__X(i + 3, 64)] = 'k'; + bak[__X(i + 4, 64)] = 0x00; + Files_Rename(name, name__len, bak, 64, &res); Files_Register(f); __DEL(name); } diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index b591e699..699c0323 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/Vishap.c b/bootstrap/unix-88/Vishap.c index 19624204..ffe27b0f 100644 --- a/bootstrap/unix-88/Vishap.c +++ b/bootstrap/unix-88/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkamSf */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -34,31 +34,31 @@ void Vishap_Module (BOOLEAN *done) OPV_AdrAndSize(OPT_topScope); OPT_Export(&ext, &new); if (OPM_noerr) { - OPM_OpenFiles((void*)OPT_SelfName, ((LONGINT)(256))); + OPM_OpenFiles((void*)OPT_SelfName, 256); OPC_Init(); OPV_Module(p); if (OPM_noerr) { if (((OPM_mainProg || OPM_mainLinkStat) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { OPM_DeleteNewSym(); if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"32m", (LONGINT)4); + vt100_SetAttr((CHAR*)"32m", 4); } - OPM_LogWStr((CHAR*)" Main program.", (LONGINT)16); + OPM_LogWStr((CHAR*)" Main program.", 16); if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + vt100_SetAttr((CHAR*)"0m", 3); } } else { if (new) { if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"32m", (LONGINT)4); + vt100_SetAttr((CHAR*)"32m", 4); } - OPM_LogWStr((CHAR*)" New symbol file.", (LONGINT)19); + OPM_LogWStr((CHAR*)" New symbol file.", 19); if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + vt100_SetAttr((CHAR*)"0m", 3); } OPM_RegisterNewSym(); } else if (ext) { - OPM_LogWStr((CHAR*)" Extended symbol file.", (LONGINT)24); + OPM_LogWStr((CHAR*)" Extended symbol file.", 24); OPM_RegisterNewSym(); } } @@ -95,7 +95,7 @@ void Vishap_Translate (void) modulesobj[0] = 0x00; if (OPM_OpenPar()) { for (;;) { - OPM_Init(&done, (void*)Vishap_mname, ((LONGINT)(256))); + OPM_Init(&done, (void*)Vishap_mname, 256); if (!done) { return; } @@ -105,21 +105,21 @@ void Vishap_Translate (void) Vishap_Module(&done); if (!done) { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Module compilation failed.", (LONGINT)27); + OPM_LogWStr((CHAR*)"Module compilation failed.", 27); OPM_LogWLn(); Platform_Exit(1); } if (!OPM_dontAsm) { if (OPM_dontLink) { - extTools_Assemble(OPM_modName, ((LONGINT)(32))); + extTools_Assemble(OPM_modName, 32); } else { if (!(OPM_mainProg || OPM_mainLinkStat)) { - extTools_Assemble(OPM_modName, ((LONGINT)(32))); - Strings_Append((CHAR*)" ", (LONGINT)2, (void*)modulesobj, ((LONGINT)(2048))); - Strings_Append(OPM_modName, ((LONGINT)(32)), (void*)modulesobj, ((LONGINT)(2048))); - Strings_Append((CHAR*)".o", (LONGINT)3, (void*)modulesobj, ((LONGINT)(2048))); + extTools_Assemble(OPM_modName, 32); + Strings_Append((CHAR*)" ", 2, (void*)modulesobj, 2048); + Strings_Append(OPM_modName, 32, (void*)modulesobj, 2048); + Strings_Append((CHAR*)".o", 3, (void*)modulesobj, 2048); } else { - extTools_LinkMain((void*)OPM_modName, ((LONGINT)(32)), OPM_mainLinkStat, modulesobj, ((LONGINT)(2048))); + extTools_LinkMain((void*)OPM_modName, 32, OPM_mainLinkStat, modulesobj, 2048); } } } @@ -134,7 +134,7 @@ static void Vishap_Trap (INTEGER sig) Platform_Exit(0); } else { if ((sig == 4 && Platform_HaltCode == -15)) { - OPM_LogWStr((CHAR*)" --- Vishap Oberon: internal error", (LONGINT)35); + OPM_LogWStr((CHAR*)" --- Vishap Oberon: internal error", 35); OPM_LogWLn(); } Platform_Exit(2); diff --git a/bootstrap/unix-88/errors.c b/bootstrap/unix-88/errors.c index 5493978e..57e3252c 100644 --- a/bootstrap/unix-88/errors.c +++ b/bootstrap/unix-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/unix-88/errors.h b/bootstrap/unix-88/errors.h index 8ce5a106..abc550ac 100644 --- a/bootstrap/unix-88/errors.h +++ b/bootstrap/unix-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index 72df4f99..4e7d428f 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -36,14 +36,14 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN Console_String(title, title__len); Console_String(cmd, cmd__len); Console_Ln(); - Console_String((CHAR*)"-- failed: status ", (LONGINT)19); - Console_Int(status, ((LONGINT)(1))); - Console_String((CHAR*)", exitcode ", (LONGINT)12); - Console_Int(exitcode, ((LONGINT)(1))); - Console_String((CHAR*)".", (LONGINT)2); + Console_String((CHAR*)"-- failed: status ", 19); + Console_Int(status, 1); + Console_String((CHAR*)", exitcode ", 12); + Console_Int(exitcode, 1); + Console_String((CHAR*)".", 2); Console_Ln(); if ((status == 0 && exitcode == 127)) { - Console_String((CHAR*)"Is the C compiler in the current command path\?", (LONGINT)47); + Console_String((CHAR*)"Is the C compiler in the current command path\?", 47); Console_Ln(); } if (status != 0) { @@ -61,11 +61,11 @@ void extTools_Assemble (CHAR *moduleName, LONGINT moduleName__len) CHAR cmd[1023]; __DUP(moduleName, moduleName__len, CHAR); __MOVE("gcc -g", cmd, 7); - Strings_Append(extTools_compilationOptions, ((LONGINT)(1023)), (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)"-c ", (LONGINT)4, (void*)cmd, ((LONGINT)(1023))); - Strings_Append(moduleName, moduleName__len, (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)".c", (LONGINT)3, (void*)cmd, ((LONGINT)(1023))); - extTools_execute((CHAR*)"Assemble: ", (LONGINT)11, cmd, ((LONGINT)(1023))); + Strings_Append(extTools_compilationOptions, 1023, (void*)cmd, 1023); + Strings_Append((CHAR*)"-c ", 4, (void*)cmd, 1023); + Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); + Strings_Append((CHAR*)".c", 3, (void*)cmd, 1023); + extTools_execute((CHAR*)"Assemble: ", 11, cmd, 1023); __DEL(moduleName); } @@ -74,21 +74,21 @@ void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN stati CHAR cmd[1023]; __DUP(additionalopts, additionalopts__len, CHAR); __MOVE("gcc -g", cmd, 7); - Strings_Append((CHAR*)" ", (LONGINT)2, (void*)cmd, ((LONGINT)(1023))); - Strings_Append(extTools_compilationOptions, ((LONGINT)(1023)), (void*)cmd, ((LONGINT)(1023))); - Strings_Append(moduleName, moduleName__len, (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)".c ", (LONGINT)4, (void*)cmd, ((LONGINT)(1023))); - Strings_Append(additionalopts, additionalopts__len, (void*)cmd, ((LONGINT)(1023))); + Strings_Append((CHAR*)" ", 2, (void*)cmd, 1023); + Strings_Append(extTools_compilationOptions, 1023, (void*)cmd, 1023); + Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); + Strings_Append((CHAR*)".c ", 4, (void*)cmd, 1023); + Strings_Append(additionalopts, additionalopts__len, (void*)cmd, 1023); if (statically) { - Strings_Append((CHAR*)"-static", (LONGINT)8, (void*)cmd, ((LONGINT)(1023))); + Strings_Append((CHAR*)"-static", 8, (void*)cmd, 1023); } - Strings_Append((CHAR*)" -o ", (LONGINT)5, (void*)cmd, ((LONGINT)(1023))); - Strings_Append(moduleName, moduleName__len, (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)" -L\"", (LONGINT)5, (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)"/opt/voc", (LONGINT)9, (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)"/lib\"", (LONGINT)6, (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)" -l voc", (LONGINT)8, (void*)cmd, ((LONGINT)(1023))); - extTools_execute((CHAR*)"Assemble and link: ", (LONGINT)20, cmd, ((LONGINT)(1023))); + Strings_Append((CHAR*)" -o ", 5, (void*)cmd, 1023); + Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); + Strings_Append((CHAR*)" -L\"", 5, (void*)cmd, 1023); + Strings_Append((CHAR*)"/opt/voc", 9, (void*)cmd, 1023); + Strings_Append((CHAR*)"/lib\"", 6, (void*)cmd, 1023); + Strings_Append((CHAR*)" -l voc", 8, (void*)cmd, 1023); + extTools_execute((CHAR*)"Assemble and link: ", 20, cmd, 1023); __DEL(additionalopts); } @@ -103,11 +103,11 @@ export void *extTools__init(void) __MODULE_IMPORT(Strings); __REGMOD("extTools", 0); /* BEGIN */ - Strings_Append((CHAR*)" -I \"", (LONGINT)6, (void*)extTools_compilationOptions, ((LONGINT)(1023))); - Strings_Append((CHAR*)"/opt/voc", (LONGINT)9, (void*)extTools_compilationOptions, ((LONGINT)(1023))); - Strings_Append((CHAR*)"/include\" ", (LONGINT)11, (void*)extTools_compilationOptions, ((LONGINT)(1023))); - Platform_GetEnv((CHAR*)"CFLAGS", (LONGINT)7, (void*)extTools_CFLAGS, ((LONGINT)(1023))); - Strings_Append(extTools_CFLAGS, ((LONGINT)(1023)), (void*)extTools_compilationOptions, ((LONGINT)(1023))); - Strings_Append((CHAR*)" ", (LONGINT)2, (void*)extTools_compilationOptions, ((LONGINT)(1023))); + Strings_Append((CHAR*)" -I \"", 6, (void*)extTools_compilationOptions, 1023); + Strings_Append((CHAR*)"/opt/voc", 9, (void*)extTools_compilationOptions, 1023); + Strings_Append((CHAR*)"/include\" ", 11, (void*)extTools_compilationOptions, 1023); + Platform_GetEnv((CHAR*)"CFLAGS", 7, (void*)extTools_CFLAGS, 1023); + Strings_Append(extTools_CFLAGS, 1023, (void*)extTools_compilationOptions, 1023); + Strings_Append((CHAR*)" ", 2, (void*)extTools_compilationOptions, 1023); __ENDMOD; } diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index 4523936a..b5b2af96 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/vt100.c b/bootstrap/unix-88/vt100.c index efcf43ab..037caf04 100644 --- a/bootstrap/unix-88/vt100.c +++ b/bootstrap/unix-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Console.h" @@ -69,12 +69,12 @@ void vt100_IntToStr (LONGINT int_, CHAR *str, LONGINT str__len) } e = s; do { - b[__X(e, ((LONGINT)(21)))] = (CHAR)(__MOD(int_, 10) + 48); + b[__X(e, 21)] = (CHAR)(__MOD(int_, 10) + 48); int_ = __DIV(int_, 10); e += 1; } while (!(int_ == 0)); - b[__X(e, ((LONGINT)(21)))] = 0x00; - vt100_Reverse0((void*)b, ((LONGINT)(21)), s, e - 1); + b[__X(e, 21)] = 0x00; + vt100_Reverse0((void*)b, 21, s, e - 1); } __COPY(b, str, str__len); } @@ -83,9 +83,9 @@ static void vt100_EscSeq0 (CHAR *letter, LONGINT letter__len) { CHAR cmd[9]; __DUP(letter, letter__len, CHAR); - __COPY(vt100_CSI, cmd, ((LONGINT)(9))); - Strings_Append(letter, letter__len, (void*)cmd, ((LONGINT)(9))); - Console_String(cmd, ((LONGINT)(9))); + __COPY(vt100_CSI, cmd, 9); + Strings_Append(letter, letter__len, (void*)cmd, 9); + Console_String(cmd, 9); __DEL(letter); } @@ -94,11 +94,11 @@ static void vt100_EscSeq (INTEGER n, CHAR *letter, LONGINT letter__len) CHAR nstr[2]; CHAR cmd[7]; __DUP(letter, letter__len, CHAR); - vt100_IntToStr(n, (void*)nstr, ((LONGINT)(2))); - __COPY(vt100_CSI, cmd, ((LONGINT)(7))); - Strings_Append(nstr, ((LONGINT)(2)), (void*)cmd, ((LONGINT)(7))); - Strings_Append(letter, letter__len, (void*)cmd, ((LONGINT)(7))); - Console_String(cmd, ((LONGINT)(7))); + vt100_IntToStr(n, (void*)nstr, 2); + __COPY(vt100_CSI, cmd, 7); + Strings_Append(nstr, 2, (void*)cmd, 7); + Strings_Append(letter, letter__len, (void*)cmd, 7); + Console_String(cmd, 7); __DEL(letter); } @@ -107,11 +107,11 @@ static void vt100_EscSeqSwapped (INTEGER n, CHAR *letter, LONGINT letter__len) CHAR nstr[2]; CHAR cmd[7]; __DUP(letter, letter__len, CHAR); - vt100_IntToStr(n, (void*)nstr, ((LONGINT)(2))); - __COPY(vt100_CSI, cmd, ((LONGINT)(7))); - Strings_Append(letter, letter__len, (void*)cmd, ((LONGINT)(7))); - Strings_Append(nstr, ((LONGINT)(2)), (void*)cmd, ((LONGINT)(7))); - Console_String(cmd, ((LONGINT)(7))); + vt100_IntToStr(n, (void*)nstr, 2); + __COPY(vt100_CSI, cmd, 7); + Strings_Append(letter, letter__len, (void*)cmd, 7); + Strings_Append(nstr, 2, (void*)cmd, 7); + Console_String(cmd, 7); __DEL(letter); } @@ -120,124 +120,124 @@ static void vt100_EscSeq2 (INTEGER n, INTEGER m, CHAR *letter, LONGINT letter__l CHAR nstr[5], mstr[5]; CHAR cmd[12]; __DUP(letter, letter__len, CHAR); - vt100_IntToStr(n, (void*)nstr, ((LONGINT)(5))); - vt100_IntToStr(m, (void*)mstr, ((LONGINT)(5))); - __COPY(vt100_CSI, cmd, ((LONGINT)(12))); - Strings_Append(nstr, ((LONGINT)(5)), (void*)cmd, ((LONGINT)(12))); - Strings_Append((CHAR*)";", (LONGINT)2, (void*)cmd, ((LONGINT)(12))); - Strings_Append(mstr, ((LONGINT)(5)), (void*)cmd, ((LONGINT)(12))); - Strings_Append(letter, letter__len, (void*)cmd, ((LONGINT)(12))); - Console_String(cmd, ((LONGINT)(12))); + vt100_IntToStr(n, (void*)nstr, 5); + vt100_IntToStr(m, (void*)mstr, 5); + __COPY(vt100_CSI, cmd, 12); + Strings_Append(nstr, 5, (void*)cmd, 12); + Strings_Append((CHAR*)";", 2, (void*)cmd, 12); + Strings_Append(mstr, 5, (void*)cmd, 12); + Strings_Append(letter, letter__len, (void*)cmd, 12); + Console_String(cmd, 12); __DEL(letter); } void vt100_CUU (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"A", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"A", 2); } void vt100_CUD (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"B", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"B", 2); } void vt100_CUF (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"C", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"C", 2); } void vt100_CUB (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"D", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"D", 2); } void vt100_CNL (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"E", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"E", 2); } void vt100_CPL (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"F", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"F", 2); } void vt100_CHA (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"G", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"G", 2); } void vt100_CUP (INTEGER n, INTEGER m) { - vt100_EscSeq2(n, m, (CHAR*)"H", (LONGINT)2); + vt100_EscSeq2(n, m, (CHAR*)"H", 2); } void vt100_ED (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"J", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"J", 2); } void vt100_EL (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"K", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"K", 2); } void vt100_SU (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"S", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"S", 2); } void vt100_SD (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"T", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"T", 2); } void vt100_HVP (INTEGER n, INTEGER m) { - vt100_EscSeq2(n, m, (CHAR*)"f", (LONGINT)2); + vt100_EscSeq2(n, m, (CHAR*)"f", 2); } void vt100_SGR (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"m", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"m", 2); } void vt100_SGR2 (INTEGER n, INTEGER m) { - vt100_EscSeq2(n, m, (CHAR*)"m", (LONGINT)2); + vt100_EscSeq2(n, m, (CHAR*)"m", 2); } void vt100_DSR (INTEGER n) { - vt100_EscSeq(6, (CHAR*)"n", (LONGINT)2); + vt100_EscSeq(6, (CHAR*)"n", 2); } void vt100_SCP (void) { - vt100_EscSeq0((CHAR*)"s", (LONGINT)2); + vt100_EscSeq0((CHAR*)"s", 2); } void vt100_RCP (void) { - vt100_EscSeq0((CHAR*)"u", (LONGINT)2); + vt100_EscSeq0((CHAR*)"u", 2); } void vt100_DECTCEMl (void) { - vt100_EscSeq0((CHAR*)"\?25l", (LONGINT)5); + vt100_EscSeq0((CHAR*)"\?25l", 5); } void vt100_DECTCEMh (void) { - vt100_EscSeq0((CHAR*)"\?25h", (LONGINT)5); + vt100_EscSeq0((CHAR*)"\?25h", 5); } void vt100_SetAttr (CHAR *attr, LONGINT attr__len) { CHAR tmpstr[16]; __DUP(attr, attr__len, CHAR); - __COPY(vt100_CSI, tmpstr, ((LONGINT)(16))); - Strings_Append(attr, attr__len, (void*)tmpstr, ((LONGINT)(16))); - Console_String(tmpstr, ((LONGINT)(16))); + __COPY(vt100_CSI, tmpstr, 16); + Strings_Append(attr, attr__len, (void*)tmpstr, 16); + Console_String(tmpstr, 16); __DEL(attr); } @@ -253,7 +253,7 @@ export void *vt100__init(void) __REGCMD("RCP", vt100_RCP); __REGCMD("SCP", vt100_SCP); /* BEGIN */ - __COPY("\033", vt100_CSI, ((LONGINT)(5))); - Strings_Append((CHAR*)"[", (LONGINT)2, (void*)vt100_CSI, ((LONGINT)(5))); + __COPY("\033", vt100_CSI, 5); + Strings_Append((CHAR*)"[", 2, (void*)vt100_CSI, 5); __ENDMOD; } diff --git a/bootstrap/unix-88/vt100.h b/bootstrap/unix-88/vt100.h index 65ae6d58..0b63640a 100644 --- a/bootstrap/unix-88/vt100.h +++ b/bootstrap/unix-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index 947863a2..eed3c4f0 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -13,6 +13,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/08/30] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/08/31] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index 33303334..90696149 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Console.c b/bootstrap/windows-48/Console.c index 3d09ab84..01806847 100644 --- a/bootstrap/windows-48/Console.c +++ b/bootstrap/windows-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Platform.h" @@ -21,7 +21,7 @@ export void Console_String (CHAR *s, LONGINT s__len); void Console_Flush (void) { INTEGER error; - error = Platform_Write(Platform_StdOut, (LONGINT)(SYSTEM_ADRINT)Console_line, Console_pos); + error = Platform_Write(Platform_StdOut, (SYSTEM_ADRINT)Console_line, Console_pos); Console_pos = 0; } @@ -30,7 +30,7 @@ void Console_Char (CHAR ch) if (Console_pos == 128) { Console_Flush(); } - Console_line[__X(Console_pos, ((LONGINT)(128)))] = ch; + Console_line[__X(Console_pos, 128)] = ch; Console_pos += 1; if (ch == 0x0a) { Console_Flush(); @@ -58,17 +58,17 @@ void Console_Int (LONGINT i, LONGINT n) k = 10; } else { i1 = __ABS(i); - s[0] = (CHAR)(__MOD(i1, 10) + 48); + s[0] = (CHAR)((int)__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k = 1; while (i1 > 0) { - s[__X(k, ((LONGINT)(32)))] = (CHAR)(__MOD(i1, 10) + 48); + s[__X(k, 32)] = (CHAR)((int)__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k += 1; } } if (i < 0) { - s[__X(k, ((LONGINT)(32)))] = '-'; + s[__X(k, 32)] = '-'; k += 1; } while (n > k) { @@ -77,7 +77,7 @@ void Console_Int (LONGINT i, LONGINT n) } while (k > 0) { k -= 1; - Console_Char(s[__X(k, ((LONGINT)(32)))]); + Console_Char(s[__X(k, 32)]); } } @@ -89,9 +89,9 @@ void Console_Ln (void) void Console_Bool (BOOLEAN b) { if (b) { - Console_String((CHAR*)"TRUE", (LONGINT)5); + Console_String((CHAR*)"TRUE", 5); } else { - Console_String((CHAR*)"FALSE", (LONGINT)6); + Console_String((CHAR*)"FALSE", 6); } } @@ -115,7 +115,7 @@ void Console_Read (CHAR *ch) LONGINT n; INTEGER error; Console_Flush(); - error = Platform_ReadBuf(Platform_StdIn, (void*)&*ch, ((LONGINT)(1)), &n); + error = Platform_ReadBuf(Platform_StdIn, (void*)&*ch, 1, &n); if (n != 1) { *ch = 0x00; } diff --git a/bootstrap/windows-48/Console.h b/bootstrap/windows-48/Console.h index 0e7cb823..fad0f676 100644 --- a/bootstrap/windows-48/Console.h +++ b/bootstrap/windows-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 5b20dd10..a0e79aca 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" @@ -110,23 +110,23 @@ static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INTEGER errcode) { __DUP(s, s__len, CHAR); Console_Ln(); - Console_String((CHAR*)"-- ", (LONGINT)4); + Console_String((CHAR*)"-- ", 4); Console_String(s, s__len); - Console_String((CHAR*)": ", (LONGINT)3); + Console_String((CHAR*)": ", 3); if (f != NIL) { if (f->registerName[0] != 0x00) { - Console_String(f->registerName, ((LONGINT)(101))); + Console_String(f->registerName, 101); } else { - Console_String(f->workName, ((LONGINT)(101))); + Console_String(f->workName, 101); } if (f->fd != 0) { - Console_String((CHAR*)"f.fd = ", (LONGINT)8); - Console_Int(f->fd, ((LONGINT)(1))); + Console_String((CHAR*)"f.fd = ", 8); + Console_Int(f->fd, 1); } } if (errcode != 0) { - Console_String((CHAR*)" errcode = ", (LONGINT)12); - Console_Int(errcode, ((LONGINT)(1))); + Console_String((CHAR*)" errcode = ", 12); + Console_Int(errcode, 1); } Console_Ln(); __HALT(99); @@ -192,7 +192,7 @@ static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *na name[i + 5] = '.'; i += 6; while (n > 0) { - name[i] = (CHAR)(__MOD(n, 10) + 48); + name[i] = (CHAR)((int)__MOD(n, 10) + 48); n = __DIV(n, 10); i += 1; } @@ -200,7 +200,7 @@ static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *na i += 1; n = Platform_PID; while (n > 0) { - name[i] = (CHAR)(__MOD(n, 10) + 48); + name[i] = (CHAR)((int)__MOD(n, 10) + 48); n = __DIV(n, 10); i += 1; } @@ -216,15 +216,15 @@ static void Files_Create (Files_File f) CHAR err[32]; if (f->fd == -1) { if (f->state == 1) { - Files_GetTempName(f->registerName, ((LONGINT)(101)), (void*)f->workName, ((LONGINT)(101))); + Files_GetTempName(f->registerName, 101, (void*)f->workName, 101); f->tempFile = 1; } else if (f->state == 2) { - __COPY(f->registerName, f->workName, ((LONGINT)(101))); + __COPY(f->registerName, f->workName, 101); f->registerName[0] = 0x00; f->tempFile = 0; } - error = Platform_Unlink((void*)f->workName, ((LONGINT)(101))); - error = Platform_New((void*)f->workName, ((LONGINT)(101)), &f->fd); + error = Platform_Unlink((void*)f->workName, 101); + error = Platform_New((void*)f->workName, 101, &f->fd); done = error == 0; if (done) { f->next = Files_files; @@ -242,7 +242,7 @@ static void Files_Create (Files_File f) } else { __MOVE("file not created", err, 17); } - Files_Err(err, ((LONGINT)(32)), f, error); + Files_Err(err, 32, f, error); } } } @@ -257,15 +257,15 @@ static void Files_Flush (Files_Buffer buf) if (buf->org != f->pos) { error = Platform_Seek(f->fd, buf->org, Platform_SeekSet); } - error = Platform_Write(f->fd, (LONGINT)(SYSTEM_ADRINT)buf->data, buf->size); + error = Platform_Write(f->fd, (SYSTEM_ADRINT)buf->data, buf->size); if (error != 0) { - Files_Err((CHAR*)"error writing file", (LONGINT)19, f, error); + Files_Err((CHAR*)"error writing file", 19, f, error); } f->pos = buf->org + buf->size; buf->chg = 0; error = Platform_Identify(f->fd, &f->identity, Platform_FileIdentity__typ); if (error != 0) { - Files_Err((CHAR*)"error identifying file", (LONGINT)23, f, error); + Files_Err((CHAR*)"error identifying file", 23, f, error); } } } @@ -304,7 +304,7 @@ void Files_Close (Files_File f) } error = Platform_Sync(f->fd); if (error != 0) { - Files_Err((CHAR*)"error writing file", (LONGINT)19, f, error); + Files_Err((CHAR*)"error writing file", 19, f, error); } Files_CloseOSFile(f); } @@ -324,7 +324,7 @@ Files_File Files_New (CHAR *name, LONGINT name__len) __DUP(name, name__len, CHAR); __NEW(f, Files_FileDesc); f->workName[0] = 0x00; - __COPY(name, f->registerName, ((LONGINT)(101))); + __COPY(name, f->registerName, 101); f->fd = -1; f->state = 1; f->len = 0; @@ -437,28 +437,28 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) if (name[0] != 0x00) { if (Files_HasDir((void*)name, name__len)) { dir[0] = 0x00; - __COPY(name, path, ((LONGINT)(256))); + __COPY(name, path, 256); } else { pos = 0; - Files_ScanPath(&pos, (void*)dir, ((LONGINT)(256))); - Files_MakeFileName(dir, ((LONGINT)(256)), name, name__len, (void*)path, ((LONGINT)(256))); - Files_ScanPath(&pos, (void*)dir, ((LONGINT)(256))); + Files_ScanPath(&pos, (void*)dir, 256); + Files_MakeFileName(dir, 256, name, name__len, (void*)path, 256); + Files_ScanPath(&pos, (void*)dir, 256); } for (;;) { - error = Platform_OldRW((void*)path, ((LONGINT)(256)), &fd); + error = Platform_OldRW((void*)path, 256, &fd); done = error == 0; if ((!done && Platform_TooManyFiles(error))) { - Files_Err((CHAR*)"too many files open", (LONGINT)20, f, error); + Files_Err((CHAR*)"too many files open", 20, f, error); } if ((!done && Platform_Inaccessible(error))) { - error = Platform_OldRO((void*)path, ((LONGINT)(256)), &fd); + error = Platform_OldRO((void*)path, 256, &fd); done = error == 0; } if ((!done && !Platform_Absent(error))) { - Console_String((CHAR*)"Warning: Files.Old ", (LONGINT)20); + Console_String((CHAR*)"Warning: Files.Old ", 20); Console_String(name, name__len); - Console_String((CHAR*)" error = ", (LONGINT)10); - Console_Int(error, ((LONGINT)(0))); + Console_String((CHAR*)" error = ", 10); + Console_Int(error, 0); Console_Ln(); } if (done) { @@ -476,7 +476,7 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) f->pos = 0; f->swapper = -1; error = Platform_Size(fd, &f->len); - __COPY(name, f->workName, ((LONGINT)(101))); + __COPY(name, f->workName, 101); f->registerName[0] = 0x00; f->tempFile = 0; f->identity = identity; @@ -492,8 +492,8 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) __DEL(name); return _o_result; } else { - Files_MakeFileName(dir, ((LONGINT)(256)), name, name__len, (void*)path, ((LONGINT)(256))); - Files_ScanPath(&pos, (void*)dir, ((LONGINT)(256))); + Files_MakeFileName(dir, 256, name, name__len, (void*)path, 256); + Files_ScanPath(&pos, (void*)dir, 256); } } } else { @@ -518,8 +518,8 @@ void Files_Purge (Files_File f) i += 1; } if (f->fd != -1) { - error = Platform_Truncate(f->fd, ((LONGINT)(0))); - error = Platform_Seek(f->fd, ((LONGINT)(0)), Platform_SeekSet); + error = Platform_Truncate(f->fd, 0); + error = Platform_Seek(f->fd, 0, Platform_SeekSet); } f->pos = 0; f->len = 0; @@ -584,9 +584,9 @@ void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, LONGINT pos) if (f->pos != org) { error = Platform_Seek(f->fd, org, Platform_SeekSet); } - error = Platform_ReadBuf(f->fd, (void*)buf->data, ((LONGINT)(4096)), &n); + error = Platform_ReadBuf(f->fd, (void*)buf->data, 4096, &n); if (error != 0) { - Files_Err((CHAR*)"read from file not done", (LONGINT)24, f, error); + Files_Err((CHAR*)"read from file not done", 24, f, error); } f->pos = org + n; buf->size = n; @@ -656,7 +656,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x } else { min = n; } - __MOVE((LONGINT)(SYSTEM_ADRINT)buf->data + offset, (LONGINT)(SYSTEM_ADRINT)x + xpos, min); + __MOVE((SYSTEM_ADRINT)buf->data + offset, (SYSTEM_ADRINT)x + xpos, min); offset += min; (*r).offset = offset; xpos += min; @@ -668,7 +668,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x void Files_ReadByte (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len) { - Files_ReadBytes(&*r, r__typ, (void*)x, x__len * ((LONGINT)(1)), ((LONGINT)(1))); + Files_ReadBytes(&*r, r__typ, (void*)x, x__len * 1, 1); } Files_File Files_Base (Files_Rider *r, LONGINT *r__typ) @@ -721,7 +721,7 @@ void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT } else { min = n; } - __MOVE((LONGINT)(SYSTEM_ADRINT)x + xpos, (LONGINT)(SYSTEM_ADRINT)buf->data + offset, min); + __MOVE((SYSTEM_ADRINT)x + xpos, (SYSTEM_ADRINT)buf->data + offset, min); offset += min; (*r).offset = offset; if (offset > buf->size) { @@ -772,15 +772,15 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT *res = 3; return; } - error = Platform_Read(fdold, (LONGINT)(SYSTEM_ADRINT)buf, ((LONGINT)(4096)), &n); + error = Platform_Read(fdold, (SYSTEM_ADRINT)buf, 4096, &n); while (n > 0) { - error = Platform_Write(fdnew, (LONGINT)(SYSTEM_ADRINT)buf, n); + error = Platform_Write(fdnew, (SYSTEM_ADRINT)buf, n); if (error != 0) { ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); - Files_Err((CHAR*)"cannot move file", (LONGINT)17, NIL, error); + Files_Err((CHAR*)"cannot move file", 17, NIL, error); } - error = Platform_Read(fdold, (LONGINT)(SYSTEM_ADRINT)buf, ((LONGINT)(4096)), &n); + error = Platform_Read(fdold, (SYSTEM_ADRINT)buf, 4096, &n); } ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); @@ -788,7 +788,7 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT error = Platform_Unlink((void*)old, old__len); *res = 0; } else { - Files_Err((CHAR*)"cannot move file", (LONGINT)17, NIL, error); + Files_Err((CHAR*)"cannot move file", 17, NIL, error); } } } else { @@ -808,12 +808,12 @@ void Files_Register (Files_File f) } Files_Close(f); if (f->registerName[0] != 0x00) { - Files_Rename(f->workName, ((LONGINT)(101)), f->registerName, ((LONGINT)(101)), &errcode); + Files_Rename(f->workName, 101, f->registerName, 101, &errcode); if (errcode != 0) { - __COPY(f->registerName, file, ((LONGINT)(104))); + __COPY(f->registerName, file, 104); __HALT(99); } - __COPY(f->registerName, f->workName, ((LONGINT)(101))); + __COPY(f->registerName, f->workName, 101); f->registerName[0] = 0x00; f->tempFile = 0; } @@ -838,7 +838,7 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *de j += 1; } } else { - __MOVE((LONGINT)(SYSTEM_ADRINT)src, (LONGINT)(SYSTEM_ADRINT)dest, src__len); + __MOVE((SYSTEM_ADRINT)src, (SYSTEM_ADRINT)dest, src__len); } } @@ -850,38 +850,38 @@ void Files_ReadBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN *x) void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, INTEGER *x) { CHAR b[2]; - Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(2)), ((LONGINT)(2))); - *x = (int)b[0] + __ASHL((int)b[1], 8); + Files_ReadBytes(&*R, R__typ, (void*)b, 2, 2); + *x = b[0] + __ASHL(b[1], 8); } void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, LONGINT *x) { CHAR b[4]; - Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); - *x = ((int)((int)b[0] + __ASHL((int)b[1], 8)) + __ASHL((int)b[2], 16)) + __ASHL((int)b[3], 24); + Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); + *x = ((b[0] + __ASHL(b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); } void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x) { CHAR b[4]; LONGINT l; - Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); - l = ((int)((int)b[0] + __ASHL((int)b[1], 8)) + __ASHL((int)b[2], 16)) + __ASHL((int)b[3], 24); - *x = (SET)l; + Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); + l = ((b[0] + __ASHL(b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); + *x = __VAL(SET, l); } void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x) { CHAR b[4]; - Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); - Files_FlipBytes((void*)b, ((LONGINT)(4)), (void*)&*x, ((LONGINT)(4))); + Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); + Files_FlipBytes((void*)b, 4, (void*)&*x, 4); } void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x) { CHAR b[8]; - Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(8)), ((LONGINT)(8))); - Files_FlipBytes((void*)b, ((LONGINT)(8)), (void*)&*x, ((LONGINT)(8))); + Files_ReadBytes(&*R, R__typ, (void*)b, 8, 8); + Files_FlipBytes((void*)b, 8, (void*)&*x, 8); } void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) @@ -922,12 +922,12 @@ void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, LONGINT *x) s = 0; n = 0; Files_Read(&*R, R__typ, (void*)&ch); - while ((int)ch >= 128) { - n += __ASH((int)((int)ch - 128), s); + while (ch >= 128) { + n += __ASH((ch - 128), s); s += 7; Files_Read(&*R, R__typ, (void*)&ch); } - n += __ASH((int)(__MASK((int)ch, -64) - __ASHL(__ASHR((int)ch, 6), 6)), s); + n += __ASH((__MASK(ch, -64) - __ASHL(__ASHR(ch, 6), 6)), s); *x = n; } @@ -941,7 +941,7 @@ void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, INTEGER x) CHAR b[2]; b[0] = (CHAR)x; b[1] = (CHAR)__ASHR(x, 8); - Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(2)), ((LONGINT)(2))); + Files_WriteBytes(&*R, R__typ, (void*)b, 2, 2); } void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, LONGINT x) @@ -951,33 +951,33 @@ void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, LONGINT x) b[1] = (CHAR)__ASHR(x, 8); b[2] = (CHAR)__ASHR(x, 16); b[3] = (CHAR)__ASHR(x, 24); - Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); + Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x) { CHAR b[4]; LONGINT i; - i = (LONGINT)x; + i = __VAL(LONGINT, x); b[0] = (CHAR)i; b[1] = (CHAR)__ASHR(i, 8); b[2] = (CHAR)__ASHR(i, 16); b[3] = (CHAR)__ASHR(i, 24); - Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); + Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x) { CHAR b[4]; - Files_FlipBytes((void*)&x, ((LONGINT)(4)), (void*)b, ((LONGINT)(4))); - Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); + Files_FlipBytes((void*)&x, 4, (void*)b, 4); + Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x) { CHAR b[8]; - Files_FlipBytes((void*)&x, ((LONGINT)(8)), (void*)b, ((LONGINT)(8))); - Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(8)), ((LONGINT)(8))); + Files_FlipBytes((void*)&x, 8, (void*)b, 8); + Files_WriteBytes(&*R, R__typ, (void*)b, 8, 8); } void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) @@ -987,7 +987,7 @@ void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len while (x[i] != 0x00) { i += 1; } - Files_WriteBytes(&*R, R__typ, (void*)x, x__len * ((LONGINT)(1)), i + 1); + Files_WriteBytes(&*R, R__typ, (void*)x, x__len * 1, i + 1); } void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, LONGINT x) @@ -1012,7 +1012,7 @@ static void Files_Finalize (SYSTEM_PTR o) if (f->fd >= 0) { Files_CloseOSFile(f); if (f->tempFile) { - res = Platform_Unlink((void*)f->workName, ((LONGINT)(101))); + res = Platform_Unlink((void*)f->workName, 101); } } } @@ -1021,7 +1021,7 @@ void Files_SetSearchPath (CHAR *path, LONGINT path__len) { __DUP(path, path__len, CHAR); if (Strings_Length(path, path__len) != 0) { - Files_SearchPath = __NEWARR(NIL, ((LONGINT)(1)), 1, 1, 1, (LONGINT)(Strings_Length(path, path__len) + 1)); + Files_SearchPath = __NEWARR(NIL, 1, 1, 1, 1, ((SYSTEM_ADRINT)((Strings_Length(path, path__len) + 1)))); __COPY(path, Files_SearchPath->data, Files_SearchPath->len[0]); } else { Files_SearchPath = NIL; @@ -1055,6 +1055,6 @@ export void *Files__init(void) Files_tempno = -1; Heap_FileCount = 0; Files_HOME[0] = 0x00; - Platform_GetEnv((CHAR*)"HOME", (LONGINT)5, (void*)Files_HOME, ((LONGINT)(1024))); + Platform_GetEnv((CHAR*)"HOME", 5, (void*)Files_HOME, 1024); __ENDMOD; } diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index 85814163..fdaec6b0 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index 5fcaf193..e42a752c 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tskSfF */ #include "SYSTEM.h" struct Heap__1 { @@ -116,7 +116,7 @@ void Heap_Unlock (void) { Heap_lockdepth -= 1; if ((Heap_interrupted && Heap_lockdepth == 0)) { - Heap_PlatformHalt(((LONGINT)(-9))); + Heap_PlatformHalt(-9); } } @@ -131,7 +131,7 @@ SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) } m->types = 0; m->cmds = NIL; - __COPY(name, m->name, ((LONGINT)(20))); + __COPY(name, m->name, 20); m->refcnt = 0; m->enumPtrs = enumPtrs; m->next = (Heap_Module)(SYSTEM_ADRINT)Heap_modules; @@ -148,7 +148,7 @@ void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) } else { __NEW(c, Heap_CmdDesc); } - __COPY(name, c->name, ((LONGINT)(24))); + __COPY(name, c->name, 24); c->cmd = cmd; c->next = m->cmds; m->cmds = c; @@ -326,12 +326,12 @@ SYSTEM_PTR Heap_NEWBLK (LONGINT size) SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 31, 4), 4); - new = Heap_NEWREC((LONGINT)(SYSTEM_ADRINT)&blksz); - tag = ((LONGINT)(SYSTEM_ADRINT)new + blksz) - 12; + new = Heap_NEWREC((SYSTEM_ADRINT)&blksz); + tag = (__VAL(LONGINT, new) + blksz) - 12; __PUT(tag - 4, 0, LONGINT); __PUT(tag, blksz, LONGINT); __PUT(tag + 4, -4, LONGINT); - __PUT((LONGINT)(SYSTEM_ADRINT)new - 4, tag, LONGINT); + __PUT(__VAL(LONGINT, new) - 4, tag, LONGINT); Heap_Unlock(); _o_result = new; return _o_result; @@ -360,7 +360,7 @@ static void Heap_Mark (LONGINT q) __GET(tag, offset, LONGINT); fld = q + offset; p = Heap_FetchAddress(fld); - __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)n, SYSTEM_PTR); + __PUT(fld, __VAL(SYSTEM_PTR, n), SYSTEM_PTR); } else { fld = q + offset; n = Heap_FetchAddress(fld); @@ -369,7 +369,7 @@ static void Heap_Mark (LONGINT q) if (!__ODD(tagbits)) { __PUT(n - 4, tagbits + 1, LONGINT); __PUT(q - 4, tag + 1, LONGINT); - __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)p, SYSTEM_PTR); + __PUT(fld, __VAL(SYSTEM_PTR, p), SYSTEM_PTR); p = q; q = n; tag = tagbits; @@ -384,7 +384,7 @@ static void Heap_Mark (LONGINT q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((LONGINT)(SYSTEM_ADRINT)p); + Heap_Mark(__VAL(LONGINT, p)); } static void Heap_Scan (void) @@ -553,7 +553,7 @@ static void Heap_Finalize (void) } else { prev->next = n->next; } - (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); + (*n->finalize)(__VAL(SYSTEM_PTR, n->obj)); if (prev == NIL) { n = Heap_fin; } else { @@ -572,7 +572,7 @@ void Heap_FINALL (void) while (Heap_fin != NIL) { n = Heap_fin; Heap_fin = Heap_fin->next; - (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); + (*n->finalize)(__VAL(SYSTEM_PTR, n->obj)); } } @@ -589,9 +589,9 @@ static void Heap_MarkStack (LONGINT n, LONGINT *cand, LONGINT cand__len) } if (n == 0) { nofcand = 0; - sp = (LONGINT)(SYSTEM_ADRINT)&frame; + sp = (SYSTEM_ADRINT)&frame; stack0 = Heap_PlatformMainStackFrame(); - inc = (LONGINT)(SYSTEM_ADRINT)&align.p - (LONGINT)(SYSTEM_ADRINT)&align; + inc = (SYSTEM_ADRINT)&align.p - (SYSTEM_ADRINT)&align; if (sp > stack0) { inc = -inc; } @@ -680,7 +680,7 @@ void Heap_GC (BOOLEAN markStack) i22 += 23; i23 += 24; if ((i0 == -99 && i15 == 24)) { - Heap_MarkStack(((LONGINT)(32)), (void*)cand, ((LONGINT)(10000))); + Heap_MarkStack(32, (void*)cand, 10000); break; } } @@ -699,7 +699,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (LONGINT)(SYSTEM_ADRINT)obj; + f->obj = __VAL(LONGINT, obj); f->finalize = finalize; f->marked = 1; f->next = Heap_fin; diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index 4247d33d..4d5c5b4e 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index 148c062a..9f39f448 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Heap.h" @@ -83,10 +83,10 @@ Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len) Modules_resMsg[0] = 0x00; } else { Modules_res = 1; - __COPY(name, Modules_importing, ((LONGINT)(20))); + __COPY(name, Modules_importing, 20); __MOVE(" module \"", Modules_resMsg, 10); - Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), name, name__len); - Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), (CHAR*)"\" not found", (LONGINT)12); + Modules_Append((void*)Modules_resMsg, 256, name, name__len); + Modules_Append((void*)Modules_resMsg, 256, (CHAR*)"\" not found", 12); } _o_result = m; __DEL(name); @@ -111,11 +111,11 @@ Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT nam } else { Modules_res = 2; __MOVE(" command \"", Modules_resMsg, 11); - __COPY(name, Modules_importing, ((LONGINT)(20))); - Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), mod->name, ((LONGINT)(20))); - Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), (CHAR*)".", (LONGINT)2); - Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), name, name__len); - Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), (CHAR*)"\" not found", (LONGINT)12); + __COPY(name, Modules_importing, 20); + Modules_Append((void*)Modules_resMsg, 256, mod->name, 20); + Modules_Append((void*)Modules_resMsg, 256, (CHAR*)".", 2); + Modules_Append((void*)Modules_resMsg, 256, name, name__len); + Modules_Append((void*)Modules_resMsg, 256, (CHAR*)"\" not found", 12); _o_result = NIL; __DEL(name); return _o_result; diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index 85b1ec59..1707868f 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index 9a06ac24..73416071 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" @@ -271,7 +271,7 @@ OPT_Node OPB_NewString (OPS_String str, LONGINT len) x->conval->intval = -1; x->conval->intval2 = len; x->conval->ext = OPT_NewExt(); - __COPY(str, *x->conval->ext, ((LONGINT)(256))); + __COPY(str, *x->conval->ext, 256); _o_result = x; return _o_result; } @@ -468,7 +468,7 @@ void OPB_In (OPT_Node *x, OPT_Node y) } else if ((__IN(f, 0x70) && y->typ->form == 9)) { if ((*x)->class == 7) { k = (*x)->conval->intval; - if (k < 0 || k > (int)OPM_MaxSet) { + if (k < 0 || k > OPM_MaxSet) { OPB_err(202); } else if (y->class == 7) { (*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval)); @@ -618,7 +618,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) case 22: if (f == 3) { if (z->class == 7) { - z->conval->intval = (int)__CAP((CHAR)z->conval->intval); + z->conval->intval = __CAP((CHAR)z->conval->intval); z->obj = NIL; } else { z = NewOp__29(op, typ, z); @@ -666,8 +666,8 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->typ = OPT_booltyp; break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPB.MOp, op = ", (LONGINT)33); - OPM_LogWNum(op, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPB.MOp, op = ", 33); + OPM_LogWNum(op, 0); OPM_LogWLn(); break; } @@ -826,8 +826,8 @@ static INTEGER ConstCmp__14 (void) } break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPB.ConstCmp, f = ", (LONGINT)37); - OPM_LogWNum(*ConstOp__13_s->f, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPB.ConstCmp, f = ", 37); + OPM_LogWNum(*ConstOp__13_s->f, 0); OPM_LogWLn(); break; } @@ -1002,7 +1002,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) case 4: if (__IN(f, 0x70)) { if (yval->intval != 0) { - xval->intval = __MOD(xval->intval, yval->intval); + xval->intval = (int)__MOD(xval->intval, yval->intval); OPB_SetIntType(x); } else { OPB_err(205); @@ -1105,8 +1105,8 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPB.ConstOp, op = ", (LONGINT)37); - OPM_LogWNum(op, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPB.ConstOp, op = ", 37); + OPM_LogWNum(op, 0); OPM_LogWLn(); break; } @@ -1149,12 +1149,12 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) OPB_err(203); r = (LONGREAL)1; } - (*x)->conval->intval = (int)__ENTIER(r); + (*x)->conval->intval = (SYSTEM_INT32)__ENTIER(r); OPB_SetIntType(*x); } } (*x)->obj = NIL; - } else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((int)(*x)->left->typ->form < f || f > g))) { + } else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((*x)->left->typ->form < f || f > g))) { if ((*x)->left->typ == typ) { *x = (*x)->left; } @@ -1207,11 +1207,11 @@ static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) if ((*Op__38_s->f == 10 && (*x)->conval->intval2 == 1)) { (*x)->typ = OPT_chartyp; (*x)->conval->intval = 0; - OPB_Index(&*y, OPB_NewIntConst(((LONGINT)(0)))); + OPB_Index(&*y, OPB_NewIntConst(0)); } else if ((*Op__38_s->g == 10 && (*y)->conval->intval2 == 1)) { (*y)->typ = OPT_chartyp; (*y)->conval->intval = 0; - OPB_Index(&*x, OPB_NewIntConst(((LONGINT)(0)))); + OPB_Index(&*x, OPB_NewIntConst(0)); } } _o_result = ok; @@ -1475,7 +1475,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) typ = OPT_booltyp; } else { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"ELSE in Op()", (LONGINT)13); + OPM_LogWStr((CHAR*)"ELSE in Op()", 13); OPM_LogWLn(); OPB_err(108); typ = OPT_undftyp; @@ -1483,8 +1483,8 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) NewOp__39(op, typ, &z, y); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPB.Op, op = ", (LONGINT)32); - OPM_LogWNum(op, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPB.Op, op = ", 32); + OPM_LogWNum(op, 0); OPM_LogWLn(); break; } @@ -1501,13 +1501,13 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y) } else if ((__IN((*x)->typ->form, 0x70) && __IN(y->typ->form, 0x70))) { if ((*x)->class == 7) { k = (*x)->conval->intval; - if (0 > k || k > (int)OPM_MaxSet) { + if (0 > k || k > OPM_MaxSet) { OPB_err(202); } } if (y->class == 7) { l = y->conval->intval; - if (0 > l || l > (int)OPM_MaxSet) { + if (0 > l || l > OPM_MaxSet) { OPB_err(202); } } @@ -1537,7 +1537,7 @@ void OPB_SetElem (OPT_Node *x) OPB_err(93); } else if ((*x)->class == 7) { k = (*x)->conval->intval; - if ((0 <= k && k <= (int)OPM_MaxSet)) { + if ((0 <= k && k <= OPM_MaxSet)) { (*x)->conval->setval = __SETOF(k); } else { OPB_err(202); @@ -1556,24 +1556,24 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPT_Struct p = NIL, q = NIL; if (OPM_Verbose) { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"PROCEDURE CheckAssign", (LONGINT)22); + OPM_LogWStr((CHAR*)"PROCEDURE CheckAssign", 22); OPM_LogWLn(); } y = ynode->typ; f = x->form; g = y->form; if (OPM_Verbose) { - OPM_LogWStr((CHAR*)"y.form = ", (LONGINT)10); - OPM_LogWNum(y->form, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"y.form = ", 10); + OPM_LogWNum(y->form, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"f = ", (LONGINT)5); - OPM_LogWNum(f, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"f = ", 5); + OPM_LogWNum(f, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"g = ", (LONGINT)5); - OPM_LogWNum(g, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"g = ", 5); + OPM_LogWNum(g, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"ynode.typ.syze = ", (LONGINT)18); - OPM_LogWNum(ynode->typ->size, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"ynode.typ.syze = ", 18); + OPM_LogWNum(ynode->typ->size, 0); OPM_LogWLn(); } if (ynode->class == 8 || (ynode->class == 9 && f != 14)) { @@ -1681,8 +1681,8 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) } break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPB.CheckAssign, f = ", (LONGINT)40); - OPM_LogWNum(f, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPB.CheckAssign, f = ", 40); + OPM_LogWNum(f, 0); OPM_LogWLn(); break; } @@ -1774,14 +1774,14 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) x = OPB_NewBoolConst(0); break; case 3: - x = OPB_NewIntConst(((LONGINT)(0))); + x = OPB_NewIntConst(0); x->typ = OPT_chartyp; break; case 4: case 5: case 6: x = OPB_NewIntConst(OPM_SignedMinimum(x->typ->size)); break; case 9: - x = OPB_NewIntConst(((LONGINT)(0))); + x = OPB_NewIntConst(0); x->typ = OPT_inttyp; break; case 7: @@ -1805,7 +1805,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) x = OPB_NewBoolConst(1); break; case 3: - x = OPB_NewIntConst(((LONGINT)(255))); + x = OPB_NewIntConst(255); x->typ = OPT_chartyp; break; case 4: case 5: case 6: @@ -1912,7 +1912,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (__IN(f, 0x70)) { - if (x->typ->size != (int)OPM_LIntSize) { + if (x->typ->size != OPM_LIntSize) { OPB_Convert(&x, OPT_linttyp); } } else { @@ -1927,14 +1927,14 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 12: if (x->class != 8) { OPB_err(110); - x = OPB_NewIntConst(((LONGINT)(1))); + x = OPB_NewIntConst(1); } else if (__IN(f, 0x63fe) || __IN(x->typ->comp, 0x14)) { (*OPB_typSize)(x->typ); x->typ->pvused = 1; x = OPB_NewIntConst(x->typ->size); } else { OPB_err(111); - x = OPB_NewIntConst(((LONGINT)(1))); + x = OPB_NewIntConst(1); } break; case 21: @@ -1952,7 +1952,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) OPB_err(126); } else if ((((x->class == 7 && __IN(f, 0x70))) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x2070) && x->typ->size == (int)OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x2070) && x->typ->size == OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } @@ -1993,8 +1993,8 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) } break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPB.StPar0, fctno = ", (LONGINT)39); - OPM_LogWNum(fctno, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPB.StPar0, fctno = ", 39); + OPM_LogWNum(fctno, 0); OPM_LogWLn(); break; } @@ -2050,7 +2050,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (__IN(f, 0x70)) { - if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > (int)OPM_MaxSet))) { + if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > OPM_MaxSet))) { OPB_err(202); } p = NewOp__53(19, fctno, p, x); @@ -2063,7 +2063,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (!__IN(f, 0x70) || x->class != 7) { OPB_err(69); } else if (x->typ->size == 1) { - L = (int)x->conval->intval; + L = x->conval->intval; typ = p->typ; while ((L > 0 && __IN(typ->comp, 0x0c))) { typ = typ->BaseTyp; @@ -2221,7 +2221,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) OPB_err(126); } else if ((((x->class == 7 && __IN(f, 0x70))) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x2070) && x->typ->size == (int)OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x2070) && x->typ->size == OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } @@ -2321,7 +2321,7 @@ void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno) } } else { if (((fctno == 13 || fctno == 14) && parno == 1)) { - OPB_BindNodes(19, OPT_notyp, &p, OPB_NewIntConst(((LONGINT)(1)))); + OPB_BindNodes(19, OPT_notyp, &p, OPB_NewIntConst(1)); p->subcl = fctno; p->right->typ = p->left->typ; } else if ((fctno == 17 && parno == 1)) { @@ -2343,7 +2343,7 @@ void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno) } else if (fctno == 32) { if (parno == 1) { x = NIL; - OPB_BindNodes(28, OPT_notyp, &x, OPB_NewIntConst(((LONGINT)(0)))); + OPB_BindNodes(28, OPT_notyp, &x, OPB_NewIntConst(0)); x->conval = OPT_NewConst(); x->conval->intval = OPM_errpos; OPB_Construct(15, &p, x); @@ -2578,7 +2578,7 @@ void OPB_Assign (OPT_Node *x, OPT_Node y) } else if (((((((*x)->typ->comp == 2 && (*x)->typ->BaseTyp == OPT_chartyp)) && y->typ->form == 10)) && y->conval->intval2 == 1)) { y->typ = OPT_chartyp; y->conval->intval = 0; - OPB_Index(&*x, OPB_NewIntConst(((LONGINT)(0)))); + OPB_Index(&*x, OPB_NewIntConst(0)); } if ((((((__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp == OPT_chartyp)) && __IN(y->typ->comp, 0x0c))) && y->typ->BaseTyp == OPT_chartyp)) { subcl = 18; diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index 81b3745b..385a9146 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 8a3a54cf..494d985f 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "OPM.h" @@ -62,6 +62,7 @@ static void OPC_InitImports (OPT_Object obj); static void OPC_InitKeywords (void); export void OPC_InitTDesc (OPT_Struct typ); static void OPC_InitTProcs (OPT_Object typ, OPT_Object obj); +export void OPC_IntLiteral (LONGINT n, LONGINT size); export void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim); static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName); static INTEGER OPC_Length (CHAR *s, LONGINT s__len); @@ -178,7 +179,7 @@ static INTEGER OPC_PerfectHash (CHAR *s, LONGINT s__len) i = 0; h = 0; while ((s[__X(i, s__len)] != 0x00 && i < 5)) { - h = 3 * h + (int)s[__X(i, s__len)]; + h = 3 * h + s[__X(i, s__len)]; i += 1; } _o_result = (int)__MOD(h, 105); @@ -191,10 +192,10 @@ void OPC_Ident (OPT_Object obj) mode = obj->mode; level = obj->mnolev; if ((__IN(mode, 0x62) && level > 0) || __IN(mode, 0x14)) { - OPM_WriteStringVar((void*)obj->name, ((LONGINT)(256))); - h = OPC_PerfectHash((void*)obj->name, ((LONGINT)(256))); - if (OPC_hashtab[__X(h, ((LONGINT)(105)))] >= 0) { - if (__STRCMP(OPC_keytab[__X(OPC_hashtab[__X(h, ((LONGINT)(105)))], ((LONGINT)(36)))], obj->name) == 0) { + OPM_WriteStringVar((void*)obj->name, 256); + h = OPC_PerfectHash((void*)obj->name, 256); + if (OPC_hashtab[__X(h, 105)] >= 0) { + if (__STRCMP(OPC_keytab[__X(OPC_hashtab[__X(h, 105)], 36)], obj->name) == 0) { OPM_Write('_'); } } @@ -203,18 +204,18 @@ void OPC_Ident (OPT_Object obj) if (mode == 13) { OPC_Ident(obj->link->typ->strobj); } else if (level < 0) { - OPM_WriteStringVar((void*)OPT_GlbMod[__X(-level, ((LONGINT)(64)))]->name, ((LONGINT)(256))); + OPM_WriteStringVar((void*)OPT_GlbMod[__X(-level, 64)]->name, 256); if (OPM_currFile == 0) { - OPT_GlbMod[__X(-level, ((LONGINT)(64)))]->vis = 1; + OPT_GlbMod[__X(-level, 64)]->vis = 1; } } else { - OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); + OPM_WriteStringVar((void*)OPM_modName, 32); } OPM_Write('_'); } else if ((((((obj == OPT_sysptrtyp->strobj || obj == OPT_ainttyp->strobj) || obj == OPT_int8typ->strobj) || obj == OPT_int16typ->strobj) || obj == OPT_int32typ->strobj) || obj == OPT_int64typ->strobj) || obj == OPT_bytetyp->strobj) { - OPM_WriteString((CHAR*)"SYSTEM_", (LONGINT)8); + OPM_WriteString((CHAR*)"SYSTEM_", 8); } - OPM_WriteStringVar((void*)obj->name, ((LONGINT)(256))); + OPM_WriteStringVar((void*)obj->name, 256); } } @@ -290,7 +291,7 @@ static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef) OPM_Write(')'); OPC_AnsiParamList(typ->link, 0); } else { - OPM_WriteString((CHAR*)")()", (LONGINT)4); + OPM_WriteString((CHAR*)")()", 4); } break; } else if (comp == 2) { @@ -308,8 +309,8 @@ static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef) void OPC_Andent (OPT_Struct typ) { if (typ->strobj == NIL || typ->align >= 65536) { - OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); - OPC_Str1((CHAR*)"__#", (LONGINT)4, __ASHR(typ->align, 16)); + OPM_WriteStringVar((void*)OPM_modName, 32); + OPC_Str1((CHAR*)"__#", 4, __ASHR(typ->align, 16)); } else { OPC_Ident(typ->strobj); } @@ -318,7 +319,7 @@ void OPC_Andent (OPT_Struct typ) static BOOLEAN OPC_Undefined (OPT_Object obj) { BOOLEAN _o_result; - _o_result = obj->name[0] == 0x00 || (((obj->mnolev >= 0 && obj->linkadr != (int)(3 + OPM_currFile))) && obj->linkadr != 2); + _o_result = obj->name[0] == 0x00 || (((obj->mnolev >= 0 && obj->linkadr != (3 + OPM_currFile))) && obj->linkadr != 2); return _o_result; } @@ -336,17 +337,17 @@ static void OPC_DeclareBase (OPT_Object dcl) } obj = typ->strobj; if (typ->form == 12) { - OPM_WriteString((CHAR*)"void", (LONGINT)5); + OPM_WriteString((CHAR*)"void", 5); } else if ((obj != NIL && !OPC_Undefined(obj))) { OPC_Ident(obj); } else if (typ->comp == 4) { - OPM_WriteString((CHAR*)"struct ", (LONGINT)8); + OPM_WriteString((CHAR*)"struct ", 8); OPC_Andent(typ); if ((prev->form != 13 && (obj != NIL || dcl->name[0] == 0x00))) { if ((typ->BaseTyp != NIL && typ->BaseTyp->strobj->vis != 0)) { - OPM_WriteString((CHAR*)" { /* ", (LONGINT)7); + OPM_WriteString((CHAR*)" { /* ", 7); OPC_Ident(typ->BaseTyp->strobj); - OPM_WriteString((CHAR*)" */", (LONGINT)4); + OPM_WriteString((CHAR*)" */", 4); OPM_WriteLn(); OPC_Indent(1); } else { @@ -363,10 +364,10 @@ static void OPC_DeclareBase (OPT_Object dcl) nofdims += 1; typ = typ->BaseTyp; } - OPM_WriteString((CHAR*)"struct ", (LONGINT)8); + OPM_WriteString((CHAR*)"struct ", 8); OPC_BegBlk(); OPC_BegStat(); - OPC_Str1((CHAR*)"LONGINT len[#]", (LONGINT)15, nofdims); + OPC_Str1((CHAR*)"LONGINT len[#]", 15, nofdims); OPC_EndStat(); OPC_BegStat(); __NEW(obj, OPT_ObjDesc); @@ -436,7 +437,7 @@ static void OPC_PutPtrOffsets (OPT_Struct typ, LONGINT adr, LONGINT *cnt) LONGINT n, i; if ((typ->form == 13 && typ->sysflag == 0)) { OPM_WriteInt(adr); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); *cnt += 1; if (__MASK(*cnt, -16) == 0) { OPM_WriteLn(); @@ -453,7 +454,7 @@ static void OPC_PutPtrOffsets (OPT_Struct typ, LONGINT adr, LONGINT *cnt) OPC_PutPtrOffsets(fld->typ, adr + fld->adr, &*cnt); } else { OPM_WriteInt(adr + fld->adr); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); *cnt += 1; if (__MASK(*cnt, -16) == 0) { OPM_WriteLn(); @@ -485,11 +486,11 @@ static void OPC_InitTProcs (OPT_Object typ, OPT_Object obj) OPC_InitTProcs(typ, obj->left); if (obj->mode == 13) { OPC_BegStat(); - OPM_WriteString((CHAR*)"__INITBP(", (LONGINT)10); + OPM_WriteString((CHAR*)"__INITBP(", 10); OPC_Ident(typ); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Ident(obj); - OPC_Str1((CHAR*)", #)", (LONGINT)5, __ASHR(obj->adr, 16)); + OPC_Str1((CHAR*)", #)", 5, __ASHR(obj->adr, 16)); OPC_EndStat(); } OPC_InitTProcs(typ, obj->right); @@ -501,8 +502,8 @@ static void OPC_PutBase (OPT_Struct typ) if (typ != NIL) { OPC_PutBase(typ->BaseTyp); OPC_Ident(typ->strobj); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)"__typ", 6); + OPM_WriteString((CHAR*)", ", 3); } } @@ -512,19 +513,19 @@ static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamNa INTEGER dim; if (showParamName) { OPC_Ident(par); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); } dim = 1; typ = par->typ->BaseTyp; while (typ->comp == 3) { if (ansiDefine) { - OPM_WriteString((CHAR*)", LONGINT ", (LONGINT)11); + OPM_WriteString((CHAR*)", LONGINT ", 11); } else { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); } if (showParamName) { OPC_Ident(par); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); OPM_WriteInt(dim); } typ = typ->BaseTyp; @@ -537,7 +538,7 @@ static void OPC_DeclareParams (OPT_Object par, BOOLEAN macro) OPM_Write('('); while (par != NIL) { if (macro) { - OPM_WriteStringVar((void*)par->name, ((LONGINT)(256))); + OPM_WriteStringVar((void*)par->name, 256); } else { if ((par->mode == 1 && par->typ->form == 7)) { OPM_Write('_'); @@ -545,16 +546,16 @@ static void OPC_DeclareParams (OPT_Object par, BOOLEAN macro) OPC_Ident(par); } if (par->typ->comp == 3) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_LenList(par, 0, 1); } else if ((par->mode == 2 && par->typ->comp == 4)) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); - OPM_WriteStringVar((void*)par->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)", ", 3); + OPM_WriteStringVar((void*)par->name, 256); + OPM_WriteString((CHAR*)"__typ", 6); } par = par->link; if (par != NIL) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); } } OPM_Write(')'); @@ -586,7 +587,7 @@ static void OPC_DeclareTProcs (OPT_Object obj, BOOLEAN *empty) if (OPM_currFile == 0) { if (obj->vis == 1) { OPC_DefineTProcTypes(obj); - OPM_WriteString((CHAR*)"import ", (LONGINT)8); + OPM_WriteString((CHAR*)"import ", 8); *empty = 0; OPC_ProcHeader(obj, 0); } @@ -594,9 +595,9 @@ static void OPC_DeclareTProcs (OPT_Object obj, BOOLEAN *empty) *empty = 0; OPC_DefineTProcTypes(obj); if (obj->vis == 0) { - OPM_WriteString((CHAR*)"static ", (LONGINT)8); + OPM_WriteString((CHAR*)"static ", 8); } else { - OPM_WriteString((CHAR*)"export ", (LONGINT)8); + OPM_WriteString((CHAR*)"export ", 8); } OPC_ProcHeader(obj, 0); } @@ -630,31 +631,31 @@ static void OPC_DefineTProcMacros (OPT_Object obj, BOOLEAN *empty) if (obj != NIL) { OPC_DefineTProcMacros(obj->left, &*empty); if ((((obj->mode == 13 && obj == OPC_BaseTProc(obj))) && (OPM_currFile != 0 || obj->vis == 1))) { - OPM_WriteString((CHAR*)"#define __", (LONGINT)11); + OPM_WriteString((CHAR*)"#define __", 11); OPC_Ident(obj); OPC_DeclareParams(obj->link, 1); - OPM_WriteString((CHAR*)" __SEND(", (LONGINT)9); + OPM_WriteString((CHAR*)" __SEND(", 9); if (obj->link->typ->form == 13) { - OPM_WriteString((CHAR*)"__TYPEOF(", (LONGINT)10); + OPM_WriteString((CHAR*)"__TYPEOF(", 10); OPC_Ident(obj->link); OPM_Write(')'); } else { OPC_Ident(obj->link); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } - OPC_Str1((CHAR*)", #, ", (LONGINT)6, __ASHR(obj->adr, 16)); + OPC_Str1((CHAR*)", #, ", 6, __ASHR(obj->adr, 16)); if (obj->typ == OPT_notyp) { - OPM_WriteString((CHAR*)"void", (LONGINT)5); + OPM_WriteString((CHAR*)"void", 5); } else { OPC_Ident(obj->typ->strobj); } - OPM_WriteString((CHAR*)"(*)", (LONGINT)4); + OPM_WriteString((CHAR*)"(*)", 4); if (OPC_ansi) { OPC_AnsiParamList(obj->link, 0); } else { - OPM_WriteString((CHAR*)"()", (LONGINT)3); + OPM_WriteString((CHAR*)"()", 3); } - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_DeclareParams(obj->link, 1); OPM_Write(')'); OPM_WriteLn(); @@ -709,7 +710,7 @@ static void OPC_DefineType (OPT_Struct str) } } if ((obj != NIL && OPC_Undefined(obj))) { - OPM_WriteString((CHAR*)"typedef", (LONGINT)8); + OPM_WriteString((CHAR*)"typedef", 8); OPM_WriteLn(); OPM_Write(0x09); OPC_Indent(1); @@ -742,7 +743,7 @@ static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len) BOOLEAN r; __DUP(y, y__len, CHAR); i = 0; - while ((*x)[__X(i + 1, ((LONGINT)(256)))] == y[__X(i, y__len)]) { + while ((*x)[__X(i + 1, 256)] == y[__X(i, y__len)]) { i += 1; } r = y[__X(i, y__len)] == 0x00; @@ -758,19 +759,19 @@ static void OPC_CProcDefs (OPT_Object obj, INTEGER vis) INTEGER _for__9; if (obj != NIL) { OPC_CProcDefs(obj->left, vis); - if ((((obj->mode == 9 && (int)obj->vis >= vis)) && obj->adr == 1)) { + if ((((obj->mode == 9 && obj->vis >= vis)) && obj->adr == 1)) { ext = obj->conval->ext; i = 1; - if (((*ext)[1] != '#' && !(OPC_Prefixed(ext, (CHAR*)"extern ", (LONGINT)8) || OPC_Prefixed(ext, (CHAR*)"import ", (LONGINT)8)))) { - OPM_WriteString((CHAR*)"#define ", (LONGINT)9); + if (((*ext)[1] != '#' && !(OPC_Prefixed(ext, (CHAR*)"extern ", 8) || OPC_Prefixed(ext, (CHAR*)"import ", 8)))) { + OPM_WriteString((CHAR*)"#define ", 9); OPC_Ident(obj); OPC_DeclareParams(obj->link, 1); OPM_Write(0x09); } - _for__9 = (int)(*obj->conval->ext)[0]; + _for__9 = (*obj->conval->ext)[0]; i = i; while (i <= _for__9) { - OPM_Write((*obj->conval->ext)[__X(i, ((LONGINT)(256)))]); + OPM_Write((*obj->conval->ext)[__X(i, 256)]); i += 1; } OPM_WriteLn(); @@ -814,34 +815,34 @@ void OPC_TDescDecl (OPT_Struct typ) LONGINT nofptrs; OPT_Object o = NIL; OPC_BegStat(); - OPM_WriteString((CHAR*)"__TDESC(", (LONGINT)9); + OPM_WriteString((CHAR*)"__TDESC(", 9); OPC_Andent(typ); - OPC_Str1((CHAR*)", #", (LONGINT)4, typ->n + 1); - OPC_Str1((CHAR*)", #) = {__TDFLDS(", (LONGINT)18, OPC_NofPtrs(typ)); + OPC_Str1((CHAR*)", #", 4, typ->n + 1); + OPC_Str1((CHAR*)", #) = {__TDFLDS(", 18, OPC_NofPtrs(typ)); OPM_Write('"'); if (typ->strobj != NIL) { - OPM_WriteStringVar((void*)typ->strobj->name, ((LONGINT)(256))); + OPM_WriteStringVar((void*)typ->strobj->name, 256); } OPM_Write('"'); - OPC_Str1((CHAR*)", #), {", (LONGINT)8, typ->size); + OPC_Str1((CHAR*)", #), {", 8, typ->size); nofptrs = 0; - OPC_PutPtrOffsets(typ, ((LONGINT)(0)), &nofptrs); - OPC_Str1((CHAR*)"#}}", (LONGINT)4, -((nofptrs + 1) * (int)OPM_LIntSize)); + OPC_PutPtrOffsets(typ, 0, &nofptrs); + OPC_Str1((CHAR*)"#}}", 4, -((nofptrs + 1) * OPM_LIntSize)); OPC_EndStat(); } void OPC_InitTDesc (OPT_Struct typ) { OPC_BegStat(); - OPM_WriteString((CHAR*)"__INITYP(", (LONGINT)10); + OPM_WriteString((CHAR*)"__INITYP(", 10); OPC_Andent(typ); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); if (typ->BaseTyp != NIL) { OPC_Andent(typ->BaseTyp); } else { OPC_Andent(typ); } - OPC_Str1((CHAR*)", #)", (LONGINT)5, typ->extlev); + OPC_Str1((CHAR*)", #)", 5, typ->extlev); OPC_EndStat(); if (typ->strobj != NIL) { OPC_InitTProcs(typ->strobj, typ->link); @@ -872,7 +873,7 @@ LONGINT OPC_SizeAlignment (LONGINT size) { LONGINT _o_result; LONGINT alignment; - if (size < (int)OPM_Alignment) { + if (size < OPM_Alignment) { alignment = 1; while (alignment < size) { alignment = __ASHL(alignment, 1); @@ -909,23 +910,23 @@ static void OPC_FillGap (LONGINT gap, LONGINT off, LONGINT align, LONGINT *n, LO if ((*curAlign < align && gap - (adr - off) >= align)) { gap -= (adr - off) + align; OPC_BegStat(); - if (align == (int)OPM_IntSize) { - OPM_WriteString((CHAR*)"INTEGER", (LONGINT)8); - } else if (align == (int)OPM_LIntSize) { - OPM_WriteString((CHAR*)"LONGINT", (LONGINT)8); - } else if (align == (int)OPM_LRealSize) { - OPM_WriteString((CHAR*)"LONGREAL", (LONGINT)9); + if (align == OPM_IntSize) { + OPM_WriteString((CHAR*)"INTEGER", 8); + } else if (align == OPM_LIntSize) { + OPM_WriteString((CHAR*)"LONGINT", 8); + } else if (align == OPM_LRealSize) { + OPM_WriteString((CHAR*)"LONGREAL", 9); } - OPC_Str1((CHAR*)" _prvt#", (LONGINT)8, *n); + OPC_Str1((CHAR*)" _prvt#", 8, *n); *n += 1; OPC_EndStat(); *curAlign = align; } if (gap > 0) { OPC_BegStat(); - OPC_Str1((CHAR*)"char _prvt#", (LONGINT)12, *n); + OPC_Str1((CHAR*)"char _prvt#", 12, *n); *n += 1; - OPC_Str1((CHAR*)"[#]", (LONGINT)4, gap); + OPC_Str1((CHAR*)"[#]", 4, gap); OPC_EndStat(); } } @@ -969,7 +970,7 @@ static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, LONGINT *off, LONGINT * base = fld->typ; fld = fld->link; while ((((((((fld != NIL && fld->mode == 4)) && fld->typ == base)) && fld->adr == *off)) && ((OPM_currFile == 1 || fld->vis != 0) || fld->typ->strobj == NIL))) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_DeclareObj(fld, 0); *off = fld->adr + fld->typ->size; fld = fld->link; @@ -978,7 +979,7 @@ static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, LONGINT *off, LONGINT * } } if (last) { - adr = typ->size - (int)__ASHR(typ->sysflag, 8); + adr = typ->size - __ASHR(typ->sysflag, 8); if (adr == 0) { gap = 1; } else { @@ -999,7 +1000,7 @@ static void OPC_IdentList (OPT_Object obj, INTEGER vis) first = 1; while ((obj != NIL && obj->mode != 13)) { if ((__IN(vis, 0x05) || (vis == 1 && obj->vis != 0)) || (vis == 3 && !obj->leaf)) { - if (obj->typ != base || (int)obj->vis != lastvis) { + if (obj->typ != base || obj->vis != lastvis) { if (!first) { OPC_EndStat(); } @@ -1008,16 +1009,16 @@ static void OPC_IdentList (OPT_Object obj, INTEGER vis) lastvis = obj->vis; OPC_BegStat(); if ((vis == 1 && obj->vis != 0)) { - OPM_WriteString((CHAR*)"import ", (LONGINT)8); + OPM_WriteString((CHAR*)"import ", 8); } else if ((obj->mnolev == 0 && vis == 0)) { if (obj->vis == 0) { - OPM_WriteString((CHAR*)"static ", (LONGINT)8); + OPM_WriteString((CHAR*)"static ", 8); } else { - OPM_WriteString((CHAR*)"export ", (LONGINT)8); + OPM_WriteString((CHAR*)"export ", 8); } } if ((((vis == 2 && obj->mode == 1)) && base->form == 7)) { - OPM_WriteString((CHAR*)"double", (LONGINT)7); + OPM_WriteString((CHAR*)"double", 7); } else { OPC_DeclareBase(obj); } @@ -1033,17 +1034,17 @@ static void OPC_IdentList (OPT_Object obj, INTEGER vis) OPC_EndStat(); OPC_BegStat(); base = OPT_linttyp; - OPM_WriteString((CHAR*)"LONGINT ", (LONGINT)9); + OPM_WriteString((CHAR*)"LONGINT ", 9); OPC_LenList(obj, 0, 1); } else if ((obj->mode == 2 && obj->typ->comp == 4)) { OPC_EndStat(); OPC_BegStat(); - OPM_WriteString((CHAR*)"LONGINT *", (LONGINT)10); + OPM_WriteString((CHAR*)"LONGINT *", 10); OPC_Ident(obj); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); base = NIL; } else if ((((((OPC_ptrinit && vis == 0)) && obj->mnolev > 0)) && obj->typ->form == 13)) { - OPM_WriteString((CHAR*)" = NIL", (LONGINT)7); + OPM_WriteString((CHAR*)" = NIL", 7); } } obj = obj->link; @@ -1058,7 +1059,7 @@ static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames) CHAR name[32]; OPM_Write('('); if (obj == NIL || obj->mode == 13) { - OPM_WriteString((CHAR*)"void", (LONGINT)5); + OPM_WriteString((CHAR*)"void", 5); } else { for (;;) { OPC_DeclareBase(obj); @@ -1066,25 +1067,25 @@ static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames) OPM_Write(' '); OPC_DeclareObj(obj, 0); } else { - __COPY(obj->name, name, ((LONGINT)(32))); + __COPY(obj->name, name, 32); obj->name[0] = 0x00; OPC_DeclareObj(obj, 0); - __COPY(name, obj->name, ((LONGINT)(256))); + __COPY(name, obj->name, 256); } if (obj->typ->comp == 3) { - OPM_WriteString((CHAR*)", LONGINT ", (LONGINT)11); + OPM_WriteString((CHAR*)", LONGINT ", 11); OPC_LenList(obj, 1, showParamNames); } else if ((obj->mode == 2 && obj->typ->comp == 4)) { - OPM_WriteString((CHAR*)", LONGINT *", (LONGINT)12); + OPM_WriteString((CHAR*)", LONGINT *", 12); if (showParamNames) { OPC_Ident(obj); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } } if (obj->link == NIL || obj->link->mode == 13) { break; } - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); obj = obj->link; } } @@ -1094,7 +1095,7 @@ static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames) static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define) { if (proc->typ == OPT_notyp) { - OPM_WriteString((CHAR*)"void", (LONGINT)5); + OPM_WriteString((CHAR*)"void", 5); } else { OPC_Ident(proc->typ->strobj); } @@ -1114,7 +1115,7 @@ static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define) OPC_IdentList(proc->link, 2); OPC_Indent(-1); } else { - OPM_WriteString((CHAR*)"();", (LONGINT)4); + OPM_WriteString((CHAR*)"();", 4); OPM_WriteLn(); } } @@ -1125,11 +1126,11 @@ static void OPC_ProcPredefs (OPT_Object obj, SHORTINT vis) OPC_ProcPredefs(obj->left, vis); if ((((__IN(obj->mode, 0xc0) && obj->vis >= vis)) && (obj->history != 4 || obj->mode == 6))) { if (vis == 1) { - OPM_WriteString((CHAR*)"import ", (LONGINT)8); + OPM_WriteString((CHAR*)"import ", 8); } else if (obj->vis == 0) { - OPM_WriteString((CHAR*)"static ", (LONGINT)8); + OPM_WriteString((CHAR*)"static ", 8); } else { - OPM_WriteString((CHAR*)"export ", (LONGINT)8); + OPM_WriteString((CHAR*)"export ", 8); } OPC_ProcHeader(obj, 0); } @@ -1140,10 +1141,10 @@ static void OPC_ProcPredefs (OPT_Object obj, SHORTINT vis) static void OPC_Include (CHAR *name, LONGINT name__len) { __DUP(name, name__len, CHAR); - OPM_WriteString((CHAR*)"#include ", (LONGINT)10); + OPM_WriteString((CHAR*)"#include ", 10); OPM_Write('"'); OPM_WriteStringVar((void*)name, name__len); - OPM_WriteString((CHAR*)".h", (LONGINT)3); + OPM_WriteString((CHAR*)".h", 3); OPM_Write('"'); OPM_WriteLn(); __DEL(name); @@ -1153,8 +1154,8 @@ static void OPC_IncludeImports (OPT_Object obj, INTEGER vis) { if (obj != NIL) { OPC_IncludeImports(obj->left, vis); - if ((((obj->mode == 11 && obj->mnolev != 0)) && (int)OPT_GlbMod[__X(-obj->mnolev, ((LONGINT)(64)))]->vis >= vis)) { - OPC_Include(OPT_GlbMod[__X(-obj->mnolev, ((LONGINT)(64)))]->name, ((LONGINT)(256))); + if ((((obj->mode == 11 && obj->mnolev != 0)) && OPT_GlbMod[__X(-obj->mnolev, 64)]->vis >= vis)) { + OPC_Include(OPT_GlbMod[__X(-obj->mnolev, 64)]->name, 256); } OPC_IncludeImports(obj->right, vis); } @@ -1168,15 +1169,15 @@ static void OPC_GenDynTypes (OPT_Node n, INTEGER vis) if (vis == 0 || typ->ref < 255) { OPC_BegStat(); if (vis == 1) { - OPM_WriteString((CHAR*)"import ", (LONGINT)8); + OPM_WriteString((CHAR*)"import ", 8); } else if ((typ->strobj != NIL && typ->strobj->mnolev > 0)) { - OPM_WriteString((CHAR*)"static ", (LONGINT)8); + OPM_WriteString((CHAR*)"static ", 8); } else { - OPM_WriteString((CHAR*)"export ", (LONGINT)8); + OPM_WriteString((CHAR*)"export ", 8); } - OPM_WriteString((CHAR*)"LONGINT *", (LONGINT)10); + OPM_WriteString((CHAR*)"LONGINT *", 10); OPC_Andent(typ); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); OPC_EndStat(); } n = n->link; @@ -1194,25 +1195,25 @@ void OPC_GenHdr (OPT_Node n) OPC_GenDynTypes(n, 1); OPM_WriteLn(); OPC_ProcPredefs(OPT_topScope->right, 1); - OPM_WriteString((CHAR*)"import ", (LONGINT)8); - OPM_WriteString((CHAR*)"void *", (LONGINT)7); - OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); - OPM_WriteString(OPC_BodyNameExt, ((LONGINT)(13))); + OPM_WriteString((CHAR*)"import ", 8); + OPM_WriteString((CHAR*)"void *", 7); + OPM_WriteStringVar((void*)OPM_modName, 32); + OPM_WriteString(OPC_BodyNameExt, 13); OPC_EndStat(); OPM_WriteLn(); OPC_CProcDefs(OPT_topScope->right, 1); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#endif", (LONGINT)7); + OPM_WriteString((CHAR*)"#endif", 7); OPM_WriteLn(); } static void OPC_GenHeaderMsg (void) { INTEGER i; - OPM_WriteString((CHAR*)"/* ", (LONGINT)4); - OPM_WriteString((CHAR*)"voc", (LONGINT)4); + OPM_WriteString((CHAR*)"/* ", 4); + OPM_WriteString((CHAR*)"voc", 4); OPM_Write(' '); - OPM_WriteString(Configuration_versionLong, ((LONGINT)(41))); + OPM_WriteString(Configuration_versionLong, 41); OPM_Write(' '); i = 0; while (i <= 31) { @@ -1264,14 +1265,14 @@ static void OPC_GenHeaderMsg (void) OPM_Write('v'); break; default: - OPM_LogWStr((CHAR*)"( more options defined in OPM than checked in OPC.GenHeaderMsg, if you are a compiler developer, add them to OPC.GenHeaderMsg", (LONGINT)126); + OPM_LogWStr((CHAR*)"( more options defined in OPM than checked in OPC.GenHeaderMsg, if you are a compiler developer, add them to OPC.GenHeaderMsg", 126); OPM_LogWLn(); break; } } i += 1; } - OPM_WriteString((CHAR*)" */", (LONGINT)4); + OPM_WriteString((CHAR*)" */", 4); OPM_WriteLn(); } @@ -1280,20 +1281,20 @@ void OPC_GenHdrIncludes (void) OPM_currFile = 2; OPC_GenHeaderMsg(); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#ifndef ", (LONGINT)9); - OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); - OPM_WriteString((CHAR*)"__h", (LONGINT)4); + OPM_WriteString((CHAR*)"#ifndef ", 9); + OPM_WriteStringVar((void*)OPM_modName, 32); + OPM_WriteString((CHAR*)"__h", 4); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#define ", (LONGINT)9); - OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); - OPM_WriteString((CHAR*)"__h", (LONGINT)4); + OPM_WriteString((CHAR*)"#define ", 9); + OPM_WriteStringVar((void*)OPM_modName, 32); + OPM_WriteString((CHAR*)"__h", 4); OPM_WriteLn(); OPM_WriteLn(); if (OPM_LIntSize == 8) { - OPM_WriteString((CHAR*)"#define LARGE", (LONGINT)14); + OPM_WriteString((CHAR*)"#define LARGE", 14); OPM_WriteLn(); } - OPC_Include((CHAR*)"SYSTEM", (LONGINT)7); + OPC_Include((CHAR*)"SYSTEM", 7); OPC_IncludeImports(OPT_topScope->right, 1); OPM_WriteLn(); } @@ -1303,10 +1304,10 @@ void OPC_GenBdy (OPT_Node n) OPM_currFile = 1; OPC_GenHeaderMsg(); if (OPM_LIntSize == 8) { - OPM_WriteString((CHAR*)"#define LARGE", (LONGINT)14); + OPM_WriteString((CHAR*)"#define LARGE", 14); OPM_WriteLn(); } - OPC_Include((CHAR*)"SYSTEM", (LONGINT)7); + OPC_Include((CHAR*)"SYSTEM", 7); OPC_IncludeImports(OPT_topScope->right, 0); OPM_WriteLn(); OPC_DefAnonRecs(n); @@ -1329,9 +1330,9 @@ static void OPC_RegCmds (OPT_Object obj) if ((obj->mode == 7 && obj->history != 4)) { if ((((obj->vis != 0 && obj->link == NIL)) && obj->typ == OPT_notyp)) { OPC_BegStat(); - OPM_WriteString((CHAR*)"__REGCMD(\"", (LONGINT)11); - OPM_WriteStringVar((void*)obj->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"\", ", (LONGINT)4); + OPM_WriteString((CHAR*)"__REGCMD(\"", 11); + OPM_WriteStringVar((void*)obj->name, 256); + OPM_WriteString((CHAR*)"\", ", 4); OPC_Ident(obj); OPM_Write(')'); OPC_EndStat(); @@ -1347,8 +1348,8 @@ static void OPC_InitImports (OPT_Object obj) OPC_InitImports(obj->left); if ((obj->mode == 11 && obj->mnolev != 0)) { OPC_BegStat(); - OPM_WriteString((CHAR*)"__MODULE_IMPORT(", (LONGINT)17); - OPM_WriteStringVar((void*)OPT_GlbMod[__X(-obj->mnolev, ((LONGINT)(64)))]->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"__MODULE_IMPORT(", 17); + OPM_WriteStringVar((void*)OPT_GlbMod[__X(-obj->mnolev, 64)]->name, 256); OPM_Write(')'); OPC_EndStat(); } @@ -1366,31 +1367,31 @@ void OPC_GenEnumPtrs (OPT_Object var) if (OPC_NofPtrs(typ) > 0) { if (!OPC_GlbPtrs) { OPC_GlbPtrs = 1; - OPM_WriteString((CHAR*)"static ", (LONGINT)8); + OPM_WriteString((CHAR*)"static ", 8); if (OPC_ansi) { - OPM_WriteString((CHAR*)"void EnumPtrs(void (*P)(void*))", (LONGINT)32); + OPM_WriteString((CHAR*)"void EnumPtrs(void (*P)(void*))", 32); } else { - OPM_WriteString((CHAR*)"void EnumPtrs(P)", (LONGINT)17); + OPM_WriteString((CHAR*)"void EnumPtrs(P)", 17); OPM_WriteLn(); OPM_Write(0x09); - OPM_WriteString((CHAR*)"void (*P)();", (LONGINT)13); + OPM_WriteString((CHAR*)"void (*P)();", 13); } OPM_WriteLn(); OPC_BegBlk(); } OPC_BegStat(); if (typ->form == 13) { - OPM_WriteString((CHAR*)"P(", (LONGINT)3); + OPM_WriteString((CHAR*)"P(", 3); OPC_Ident(var); OPM_Write(')'); } else if (typ->comp == 4) { - OPM_WriteString((CHAR*)"__ENUMR(&", (LONGINT)10); + OPM_WriteString((CHAR*)"__ENUMR(&", 10); OPC_Ident(var); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Andent(typ); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); - OPC_Str1((CHAR*)", #", (LONGINT)4, typ->size); - OPM_WriteString((CHAR*)", 1, P)", (LONGINT)8); + OPM_WriteString((CHAR*)"__typ", 6); + OPC_Str1((CHAR*)", #", 4, typ->size); + OPM_WriteString((CHAR*)", 1, P)", 8); } else if (typ->comp == 2) { n = typ->n; typ = typ->BaseTyp; @@ -1399,17 +1400,17 @@ void OPC_GenEnumPtrs (OPT_Object var) typ = typ->BaseTyp; } if (typ->form == 13) { - OPM_WriteString((CHAR*)"__ENUMP(", (LONGINT)9); + OPM_WriteString((CHAR*)"__ENUMP(", 9); OPC_Ident(var); - OPC_Str1((CHAR*)", #, P)", (LONGINT)8, n); + OPC_Str1((CHAR*)", #, P)", 8, n); } else if (typ->comp == 4) { - OPM_WriteString((CHAR*)"__ENUMR(", (LONGINT)9); + OPM_WriteString((CHAR*)"__ENUMR(", 9); OPC_Ident(var); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Andent(typ); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); - OPC_Str1((CHAR*)", #", (LONGINT)4, typ->size); - OPC_Str1((CHAR*)", #, P)", (LONGINT)8, n); + OPM_WriteString((CHAR*)"__typ", 6); + OPC_Str1((CHAR*)", #", 4, typ->size); + OPC_Str1((CHAR*)", #, P)", 8, n); } } OPC_EndStat(); @@ -1425,49 +1426,49 @@ void OPC_GenEnumPtrs (OPT_Object var) void OPC_EnterBody (void) { OPM_WriteLn(); - OPM_WriteString((CHAR*)"export ", (LONGINT)8); + OPM_WriteString((CHAR*)"export ", 8); if (OPC_mainprog) { if (OPC_ansi) { - OPM_WriteString((CHAR*)"int main(int argc, char **argv)", (LONGINT)32); + OPM_WriteString((CHAR*)"int main(int argc, char **argv)", 32); OPM_WriteLn(); } else { - OPM_WriteString((CHAR*)"main(argc, argv)", (LONGINT)17); + OPM_WriteString((CHAR*)"main(argc, argv)", 17); OPM_WriteLn(); OPM_Write(0x09); - OPM_WriteString((CHAR*)"int argc; char **argv;", (LONGINT)23); + OPM_WriteString((CHAR*)"int argc; char **argv;", 23); OPM_WriteLn(); } } else { - OPM_WriteString((CHAR*)"void *", (LONGINT)7); - OPM_WriteString(OPM_modName, ((LONGINT)(32))); - OPM_WriteString(OPC_BodyNameExt, ((LONGINT)(13))); + OPM_WriteString((CHAR*)"void *", 7); + OPM_WriteString(OPM_modName, 32); + OPM_WriteString(OPC_BodyNameExt, 13); OPM_WriteLn(); } OPC_BegBlk(); OPC_BegStat(); if (OPC_mainprog) { - OPM_WriteString((CHAR*)"__INIT(argc, argv)", (LONGINT)19); + OPM_WriteString((CHAR*)"__INIT(argc, argv)", 19); } else { - OPM_WriteString((CHAR*)"__DEFMOD", (LONGINT)9); + OPM_WriteString((CHAR*)"__DEFMOD", 9); } OPC_EndStat(); if ((OPC_mainprog && 0)) { OPC_BegStat(); - OPM_WriteString((CHAR*)"/*don`t do it!*/ printf(\"DEMO VERSION: DO NOT USE THIS PROGRAM FOR ANY COMMERCIAL PURPOSE\\n\")", (LONGINT)94); + OPM_WriteString((CHAR*)"/*don`t do it!*/ printf(\"DEMO VERSION: DO NOT USE THIS PROGRAM FOR ANY COMMERCIAL PURPOSE\\n\")", 94); OPC_EndStat(); } OPC_InitImports(OPT_topScope->right); OPC_BegStat(); if (OPC_mainprog) { - OPM_WriteString((CHAR*)"__REGMAIN(\"", (LONGINT)12); + OPM_WriteString((CHAR*)"__REGMAIN(\"", 12); } else { - OPM_WriteString((CHAR*)"__REGMOD(\"", (LONGINT)11); + OPM_WriteString((CHAR*)"__REGMOD(\"", 11); } - OPM_WriteString(OPM_modName, ((LONGINT)(32))); + OPM_WriteString(OPM_modName, 32); if (OPC_GlbPtrs) { - OPM_WriteString((CHAR*)"\", EnumPtrs)", (LONGINT)13); + OPM_WriteString((CHAR*)"\", EnumPtrs)", 13); } else { - OPM_WriteString((CHAR*)"\", 0)", (LONGINT)6); + OPM_WriteString((CHAR*)"\", 0)", 6); } OPC_EndStat(); if (__STRCMP(OPM_modName, "SYSTEM") != 0) { @@ -1479,9 +1480,9 @@ void OPC_ExitBody (void) { OPC_BegStat(); if (OPC_mainprog) { - OPM_WriteString((CHAR*)"__FINI;", (LONGINT)8); + OPM_WriteString((CHAR*)"__FINI;", 8); } else { - OPM_WriteString((CHAR*)"__ENDMOD;", (LONGINT)10); + OPM_WriteString((CHAR*)"__ENDMOD;", 10); } OPM_WriteLn(); OPC_EndBlk(); @@ -1491,25 +1492,25 @@ void OPC_DefineInter (OPT_Object proc) { OPT_Object scope = NIL; scope = proc->scope; - OPM_WriteString((CHAR*)"static ", (LONGINT)8); - OPM_WriteString((CHAR*)"struct ", (LONGINT)8); - OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"static ", 8); + OPM_WriteString((CHAR*)"struct ", 8); + OPM_WriteStringVar((void*)scope->name, 256); OPM_Write(' '); OPC_BegBlk(); OPC_IdentList(proc->link, 3); OPC_IdentList(scope->scope, 3); OPC_BegStat(); - OPM_WriteString((CHAR*)"struct ", (LONGINT)8); - OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"struct ", 8); + OPM_WriteStringVar((void*)scope->name, 256); OPM_Write(' '); OPM_Write('*'); - OPM_WriteString((CHAR*)"lnk", (LONGINT)4); + OPM_WriteString((CHAR*)"lnk", 4); OPC_EndStat(); OPC_EndBlk0(); OPM_Write(' '); OPM_Write('*'); - OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteStringVar((void*)scope->name, 256); + OPM_WriteString((CHAR*)"_s", 3); OPC_EndStat(); OPM_WriteLn(); OPC_ProcPredefs(scope->right, 0); @@ -1522,24 +1523,24 @@ void OPC_EnterProc (OPT_Object proc) OPT_Struct typ = NIL; INTEGER dim; if (proc->vis != 1) { - OPM_WriteString((CHAR*)"static ", (LONGINT)8); + OPM_WriteString((CHAR*)"static ", 8); } OPC_ProcHeader(proc, 1); OPC_BegBlk(); if (proc->typ != OPT_notyp) { OPC_BegStat(); OPC_Ident(proc->typ->strobj); - OPM_WriteString((CHAR*)" _o_result;", (LONGINT)12); + OPM_WriteString((CHAR*)" _o_result;", 12); OPM_WriteLn(); } scope = proc->scope; OPC_IdentList(scope->scope, 0); if (!scope->leaf) { OPC_BegStat(); - OPM_WriteString((CHAR*)"struct ", (LONGINT)8); - OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"struct ", 8); + OPM_WriteStringVar((void*)scope->name, 256); OPM_Write(' '); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"_s", 3); OPC_EndStat(); } var = proc->link; @@ -1553,7 +1554,7 @@ void OPC_EnterProc (OPT_Object proc) } OPM_Write(' '); OPC_Ident(var); - OPM_WriteString((CHAR*)"__copy", (LONGINT)7); + OPM_WriteString((CHAR*)"__copy", 7); OPC_EndStat(); } var = var->link; @@ -1566,7 +1567,7 @@ void OPC_EnterProc (OPT_Object proc) OPC_Ident(var->typ->strobj); OPM_Write(' '); OPC_Ident(var); - OPM_WriteString((CHAR*)" = _", (LONGINT)5); + OPM_WriteString((CHAR*)" = _", 5); OPC_Ident(var); OPC_EndStat(); } @@ -1578,31 +1579,31 @@ void OPC_EnterProc (OPT_Object proc) if ((((__IN(var->typ->comp, 0x0c) && var->mode == 1)) && var->typ->sysflag == 0)) { OPC_BegStat(); if (var->typ->comp == 2) { - OPM_WriteString((CHAR*)"__DUPARR(", (LONGINT)10); + OPM_WriteString((CHAR*)"__DUPARR(", 10); OPC_Ident(var); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); if (var->typ->strobj == NIL) { OPM_Mark(200, var->typ->txtpos); } else { OPC_Ident(var->typ->strobj); } } else { - OPM_WriteString((CHAR*)"__DUP(", (LONGINT)7); + OPM_WriteString((CHAR*)"__DUP(", 7); OPC_Ident(var); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Ident(var); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); typ = var->typ->BaseTyp; dim = 1; while (typ->comp == 3) { - OPM_WriteString((CHAR*)" * ", (LONGINT)4); + OPM_WriteString((CHAR*)" * ", 4); OPC_Ident(var); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); OPM_WriteInt(dim); typ = typ->BaseTyp; dim += 1; } - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); if (typ->strobj == NIL) { OPM_Mark(200, typ->txtpos); } else { @@ -1619,12 +1620,12 @@ void OPC_EnterProc (OPT_Object proc) while (var != NIL) { if (!var->leaf) { OPC_BegStat(); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"_s", 3); OPM_Write('.'); OPC_Ident(var); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteString((CHAR*)" = ", 4); if (__IN(var->typ->comp, 0x0c)) { - OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(void*)", 8); } else if (var->mode != 2) { OPM_Write('&'); } @@ -1633,31 +1634,31 @@ void OPC_EnterProc (OPT_Object proc) typ = var->typ; dim = 0; do { - OPM_WriteString((CHAR*)"; ", (LONGINT)3); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"; ", 3); + OPM_WriteString((CHAR*)"_s", 3); OPM_Write('.'); OPC_Ident(var); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); if (dim != 0) { OPM_WriteInt(dim); } - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteString((CHAR*)" = ", 4); OPC_Ident(var); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); if (dim != 0) { OPM_WriteInt(dim); } typ = typ->BaseTyp; } while (!(typ->comp != 3)); } else if ((var->mode == 2 && var->typ->comp == 4)) { - OPM_WriteString((CHAR*)"; ", (LONGINT)3); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"; ", 3); + OPM_WriteString((CHAR*)"_s", 3); OPM_Write('.'); OPC_Ident(var); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteString((CHAR*)"__typ", 6); + OPM_WriteString((CHAR*)" = ", 4); OPC_Ident(var); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } OPC_EndStat(); } @@ -1667,14 +1668,14 @@ void OPC_EnterProc (OPT_Object proc) while (var != NIL) { if (!var->leaf) { OPC_BegStat(); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"_s", 3); OPM_Write('.'); OPC_Ident(var); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteString((CHAR*)" = ", 4); if (var->typ->comp != 2) { OPM_Write('&'); } else { - OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(void*)", 8); } OPC_Ident(var); OPC_EndStat(); @@ -1682,19 +1683,19 @@ void OPC_EnterProc (OPT_Object proc) var = var->link; } OPC_BegStat(); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"_s", 3); OPM_Write('.'); - OPM_WriteString((CHAR*)"lnk", (LONGINT)4); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); - OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"lnk", 4); + OPM_WriteString((CHAR*)" = ", 4); + OPM_WriteStringVar((void*)scope->name, 256); + OPM_WriteString((CHAR*)"_s", 3); OPC_EndStat(); OPC_BegStat(); - OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteStringVar((void*)scope->name, 256); + OPM_WriteString((CHAR*)"_s", 3); + OPM_WriteString((CHAR*)" = ", 4); OPM_Write('&'); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"_s", 3); OPC_EndStat(); } } @@ -1706,7 +1707,7 @@ void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet) indent = eoBlock; if ((implicitRet && proc->typ != OPT_notyp)) { OPM_Write(0x09); - OPM_WriteString((CHAR*)"__RETCHK;", (LONGINT)10); + OPM_WriteString((CHAR*)"__RETCHK;", 10); OPM_WriteLn(); } else if (!eoBlock || implicitRet) { if (!proc->scope->leaf) { @@ -1715,12 +1716,12 @@ void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet) } else { indent = 1; } - OPM_WriteStringVar((void*)proc->scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteStringVar((void*)proc->scope->name, 256); + OPM_WriteString((CHAR*)"_s", 3); + OPM_WriteString((CHAR*)" = ", 4); + OPM_WriteString((CHAR*)"_s", 3); OPM_Write('.'); - OPM_WriteString((CHAR*)"lnk", (LONGINT)4); + OPM_WriteString((CHAR*)"lnk", 4); OPC_EndStat(); } var = proc->link; @@ -1731,7 +1732,7 @@ void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet) } else { indent = 1; } - OPM_WriteString((CHAR*)"__DEL(", (LONGINT)7); + OPM_WriteString((CHAR*)"__DEL(", 7); OPC_Ident(var); OPM_Write(')'); OPC_EndStat(); @@ -1754,9 +1755,9 @@ void OPC_CompleteIdent (OPT_Object obj) if (obj->adr == 1) { if (obj->typ->comp == 4) { OPC_Ident(obj); - OPM_WriteString((CHAR*)"__", (LONGINT)3); + OPM_WriteString((CHAR*)"__", 3); } else { - OPM_WriteString((CHAR*)"((", (LONGINT)3); + OPM_WriteString((CHAR*)"((", 3); OPC_Ident(obj->typ->strobj); OPM_Write(')'); OPC_Ident(obj); @@ -1767,9 +1768,9 @@ void OPC_CompleteIdent (OPT_Object obj) if ((obj->mode != 2 && comp != 3)) { OPM_Write('*'); } - OPM_WriteStringVar((void*)obj->scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); - OPM_WriteString((CHAR*)"->", (LONGINT)3); + OPM_WriteStringVar((void*)obj->scope->name, 256); + OPM_WriteString((CHAR*)"_s", 3); + OPM_WriteString((CHAR*)"->", 3); OPC_Ident(obj); } else { OPC_Ident(obj); @@ -1781,17 +1782,17 @@ void OPC_TypeOf (OPT_Object ap) INTEGER i; __ASSERT(ap->typ->comp == 4, 0); if (ap->mode == 2) { - if ((int)ap->mnolev != OPM_level) { - OPM_WriteStringVar((void*)ap->scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"_s->", (LONGINT)5); + if (ap->mnolev != OPM_level) { + OPM_WriteStringVar((void*)ap->scope->name, 256); + OPM_WriteString((CHAR*)"_s->", 5); OPC_Ident(ap); } else { OPC_Ident(ap); } - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } else if (ap->typ->strobj != NIL) { OPC_Ident(ap->typ->strobj); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } else { OPC_Andent(ap->typ); } @@ -1801,26 +1802,26 @@ void OPC_Cmp (INTEGER rel) { switch (rel) { case 9: - OPM_WriteString((CHAR*)" == ", (LONGINT)5); + OPM_WriteString((CHAR*)" == ", 5); break; case 10: - OPM_WriteString((CHAR*)" != ", (LONGINT)5); + OPM_WriteString((CHAR*)" != ", 5); break; case 11: - OPM_WriteString((CHAR*)" < ", (LONGINT)4); + OPM_WriteString((CHAR*)" < ", 4); break; case 12: - OPM_WriteString((CHAR*)" <= ", (LONGINT)5); + OPM_WriteString((CHAR*)" <= ", 5); break; case 13: - OPM_WriteString((CHAR*)" > ", (LONGINT)4); + OPM_WriteString((CHAR*)" > ", 4); break; case 14: - OPM_WriteString((CHAR*)" >= ", (LONGINT)5); + OPM_WriteString((CHAR*)" >= ", 5); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPC.Cmp, rel = ", (LONGINT)34); - OPM_LogWNum(rel, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPC.Cmp, rel = ", 34); + OPM_LogWNum(rel, 0); OPM_LogWLn(); break; } @@ -1829,7 +1830,7 @@ void OPC_Cmp (INTEGER rel) static void OPC_CharacterLiteral (LONGINT c) { if (c < 32 || c > 126) { - OPM_WriteString((CHAR*)"0x", (LONGINT)3); + OPM_WriteString((CHAR*)"0x", 3); OPM_WriteHex(c); } else { OPM_Write('\''); @@ -1849,7 +1850,7 @@ static void OPC_StringLiteral (CHAR *s, LONGINT s__len, LONGINT l) OPM_Write('"'); i = 0; while (i < l) { - c = (int)s[__X(i, s__len)]; + c = s[__X(i, s__len)]; if (c < 32 || c > 126) { OPM_Write('\\'); OPM_Write((CHAR)(48 + __ASHR(c, 6))); @@ -1872,7 +1873,7 @@ static void OPC_StringLiteral (CHAR *s, LONGINT s__len, LONGINT l) void OPC_Case (LONGINT caseVal, INTEGER form) { CHAR ch; - OPM_WriteString((CHAR*)"case ", (LONGINT)6); + OPM_WriteString((CHAR*)"case ", 6); switch (form) { case 3: OPC_CharacterLiteral(caseVal); @@ -1881,42 +1882,68 @@ void OPC_Case (LONGINT caseVal, INTEGER form) OPM_WriteInt(caseVal); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPC.Case, form = ", (LONGINT)36); - OPM_LogWNum(form, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPC.Case, form = ", 36); + OPM_LogWNum(form, 0); OPM_LogWLn(); break; } - OPM_WriteString((CHAR*)": ", (LONGINT)3); + OPM_WriteString((CHAR*)": ", 3); } void OPC_SetInclude (BOOLEAN exclude) { if (exclude) { - OPM_WriteString((CHAR*)" &= ~", (LONGINT)6); + OPM_WriteString((CHAR*)" &= ~", 6); } else { - OPM_WriteString((CHAR*)" |= ", (LONGINT)5); + OPM_WriteString((CHAR*)" |= ", 5); } } void OPC_Increment (BOOLEAN decrement) { if (decrement) { - OPM_WriteString((CHAR*)" -= ", (LONGINT)5); + OPM_WriteString((CHAR*)" -= ", 5); } else { - OPM_WriteString((CHAR*)" += ", (LONGINT)5); + OPM_WriteString((CHAR*)" += ", 5); } } void OPC_Halt (LONGINT n) { - OPC_Str1((CHAR*)"__HALT(#)", (LONGINT)10, n); + OPC_Str1((CHAR*)"__HALT(#)", 10, n); +} + +void OPC_IntLiteral (LONGINT n, LONGINT size) +{ + if ((((size > 4 && n <= 2147483647)) && n > (-2147483647-1))) { + switch (size) { + case 2: + OPM_WriteString((CHAR*)"((SYSTEM_INT16)(", 17); + break; + case 4: + OPM_WriteString((CHAR*)"((SYSTEM_INT32)(", 17); + break; + case 8: + OPM_WriteString((CHAR*)"((SYSTEM_INT64)(", 17); + break; + default: + OPM_LogWStr((CHAR*)"Unhandled case in OPC.IntLiteral, size = ", 42); + OPM_LogWNum(size, 1); + OPM_LogWLn(); + break; + } + OPM_WriteInt(n); + OPM_WriteString((CHAR*)"))", 3); + } else { + OPM_WriteInt(n); + } } void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim) { if (array->comp == 3) { OPC_CompleteIdent(obj); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); if (dim != 0) { OPM_WriteInt(dim); } @@ -1925,9 +1952,11 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim) array = array->BaseTyp; dim -= 1; } - OPM_WriteString((CHAR*)"((LONGINT)(", (LONGINT)12); - OPM_WriteInt(array->n); - OPM_WriteString((CHAR*)"))", (LONGINT)3); + if (OPC_ansi) { + OPM_WriteInt(array->n); + } else { + OPC_IntLiteral(array->n, OPM_PointerSize); + } } } @@ -1957,7 +1986,7 @@ void OPC_Constant (OPT_Const con, INTEGER form) OPM_WriteReal(con->realval, 0x00); break; case 9: - OPM_WriteString((CHAR*)"0x", (LONGINT)3); + OPM_WriteString((CHAR*)"0x", 3); skipLeading = 1; s = con->setval; i = 32; @@ -1980,14 +2009,14 @@ void OPC_Constant (OPT_Const con, INTEGER form) } break; case 10: - OPC_StringLiteral(*con->ext, ((LONGINT)(256)), con->intval2 - 1); + OPC_StringLiteral(*con->ext, 256, con->intval2 - 1); break; case 11: - OPM_WriteString((CHAR*)"NIL", (LONGINT)4); + OPM_WriteString((CHAR*)"NIL", 4); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPC.Constant, form = ", (LONGINT)40); - OPM_LogWNum(form, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPC.Constant, form = ", 40); + OPM_LogWNum(form, 0); OPM_LogWLn(); break; } @@ -2005,8 +2034,8 @@ static void Enter__49 (CHAR *s, LONGINT s__len) INTEGER h; __DUP(s, s__len, CHAR); h = OPC_PerfectHash((void*)s, s__len); - OPC_hashtab[__X(h, ((LONGINT)(105)))] = *InitKeywords__48_s->n; - __COPY(s, OPC_keytab[__X(*InitKeywords__48_s->n, ((LONGINT)(36)))], ((LONGINT)(9))); + OPC_hashtab[__X(h, 105)] = *InitKeywords__48_s->n; + __COPY(s, OPC_keytab[__X(*InitKeywords__48_s->n, 36)], 9); *InitKeywords__48_s->n += 1; __DEL(s); } @@ -2021,45 +2050,45 @@ static void OPC_InitKeywords (void) n = 0; i = 0; while (i <= 104) { - OPC_hashtab[__X(i, ((LONGINT)(105)))] = -1; + OPC_hashtab[__X(i, 105)] = -1; i += 1; } - Enter__49((CHAR*)"asm", (LONGINT)4); - Enter__49((CHAR*)"auto", (LONGINT)5); - Enter__49((CHAR*)"break", (LONGINT)6); - Enter__49((CHAR*)"case", (LONGINT)5); - Enter__49((CHAR*)"char", (LONGINT)5); - Enter__49((CHAR*)"const", (LONGINT)6); - Enter__49((CHAR*)"continue", (LONGINT)9); - Enter__49((CHAR*)"default", (LONGINT)8); - Enter__49((CHAR*)"do", (LONGINT)3); - Enter__49((CHAR*)"double", (LONGINT)7); - Enter__49((CHAR*)"else", (LONGINT)5); - Enter__49((CHAR*)"enum", (LONGINT)5); - Enter__49((CHAR*)"extern", (LONGINT)7); - Enter__49((CHAR*)"export", (LONGINT)7); - Enter__49((CHAR*)"float", (LONGINT)6); - Enter__49((CHAR*)"for", (LONGINT)4); - Enter__49((CHAR*)"fortran", (LONGINT)8); - Enter__49((CHAR*)"goto", (LONGINT)5); - Enter__49((CHAR*)"if", (LONGINT)3); - Enter__49((CHAR*)"import", (LONGINT)7); - Enter__49((CHAR*)"int", (LONGINT)4); - Enter__49((CHAR*)"long", (LONGINT)5); - Enter__49((CHAR*)"register", (LONGINT)9); - Enter__49((CHAR*)"return", (LONGINT)7); - Enter__49((CHAR*)"short", (LONGINT)6); - Enter__49((CHAR*)"signed", (LONGINT)7); - Enter__49((CHAR*)"sizeof", (LONGINT)7); - Enter__49((CHAR*)"static", (LONGINT)7); - Enter__49((CHAR*)"struct", (LONGINT)7); - Enter__49((CHAR*)"switch", (LONGINT)7); - Enter__49((CHAR*)"typedef", (LONGINT)8); - Enter__49((CHAR*)"union", (LONGINT)6); - Enter__49((CHAR*)"unsigned", (LONGINT)9); - Enter__49((CHAR*)"void", (LONGINT)5); - Enter__49((CHAR*)"volatile", (LONGINT)9); - Enter__49((CHAR*)"while", (LONGINT)6); + Enter__49((CHAR*)"asm", 4); + Enter__49((CHAR*)"auto", 5); + Enter__49((CHAR*)"break", 6); + Enter__49((CHAR*)"case", 5); + Enter__49((CHAR*)"char", 5); + Enter__49((CHAR*)"const", 6); + Enter__49((CHAR*)"continue", 9); + Enter__49((CHAR*)"default", 8); + Enter__49((CHAR*)"do", 3); + Enter__49((CHAR*)"double", 7); + Enter__49((CHAR*)"else", 5); + Enter__49((CHAR*)"enum", 5); + Enter__49((CHAR*)"extern", 7); + Enter__49((CHAR*)"export", 7); + Enter__49((CHAR*)"float", 6); + Enter__49((CHAR*)"for", 4); + Enter__49((CHAR*)"fortran", 8); + Enter__49((CHAR*)"goto", 5); + Enter__49((CHAR*)"if", 3); + Enter__49((CHAR*)"import", 7); + Enter__49((CHAR*)"int", 4); + Enter__49((CHAR*)"long", 5); + Enter__49((CHAR*)"register", 9); + Enter__49((CHAR*)"return", 7); + Enter__49((CHAR*)"short", 6); + Enter__49((CHAR*)"signed", 7); + Enter__49((CHAR*)"sizeof", 7); + Enter__49((CHAR*)"static", 7); + Enter__49((CHAR*)"struct", 7); + Enter__49((CHAR*)"switch", 7); + Enter__49((CHAR*)"typedef", 8); + Enter__49((CHAR*)"union", 6); + Enter__49((CHAR*)"unsigned", 9); + Enter__49((CHAR*)"void", 5); + Enter__49((CHAR*)"volatile", 9); + Enter__49((CHAR*)"while", 6); InitKeywords__48_s = _s.lnk; } diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index dcd53d63..4243328e 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h @@ -37,6 +37,7 @@ import void OPC_Increment (BOOLEAN decrement); import void OPC_Indent (INTEGER count); import void OPC_Init (void); import void OPC_InitTDesc (OPT_Struct typ); +import void OPC_IntLiteral (LONGINT n, LONGINT size); import void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim); import LONGINT OPC_NofPtrs (OPT_Struct typ); import void OPC_SetInclude (BOOLEAN exclude); diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 65ebb8b0..c3bece55 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" @@ -154,20 +154,20 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) case 'B': if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_IntSize = (int)s[__X(i, s__len)] - 48; + OPM_IntSize = s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_PointerSize = (int)s[__X(i, s__len)] - 48; + OPM_PointerSize = s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_Alignment = (int)s[__X(i, s__len)] - 48; + OPM_Alignment = s[__X(i, s__len)] - 48; } __ASSERT(OPM_IntSize == 2 || OPM_IntSize == 4, 0); __ASSERT(OPM_PointerSize == 4 || OPM_PointerSize == 8, 0); __ASSERT(OPM_Alignment == 4 || OPM_Alignment == 8, 0); - Files_SetSearchPath((CHAR*)"", (LONGINT)1); + Files_SetSearchPath((CHAR*)"", 1); break; case 'F': *opt = *opt ^ 0x020000; @@ -182,10 +182,10 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) *opt = *opt ^ 0x040000; break; default: - OPM_LogWStr((CHAR*)" warning: option ", (LONGINT)19); + OPM_LogWStr((CHAR*)" warning: option ", 19); OPM_LogW('-'); OPM_LogW(s[__X(i, s__len)]); - OPM_LogWStr((CHAR*)" ignored", (LONGINT)9); + OPM_LogWStr((CHAR*)" ignored", 9); OPM_LogWLn(); break; } @@ -199,71 +199,71 @@ BOOLEAN OPM_OpenPar (void) CHAR s[256]; if (Platform_ArgCount == 1) { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Vishap Oberon-2 compiler v", (LONGINT)27); - OPM_LogWStr(Configuration_versionLong, ((LONGINT)(41))); + OPM_LogWStr((CHAR*)"Vishap Oberon-2 compiler v", 27); + OPM_LogWStr(Configuration_versionLong, 41); OPM_LogW('.'); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Based on Ofront by Software Templ OEG, continued by Norayr Chilingarian and others.", (LONGINT)84); + OPM_LogWStr((CHAR*)"Based on Ofront by Software Templ OEG, continued by Norayr Chilingarian and others.", 84); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Usage:", (LONGINT)7); + OPM_LogWStr((CHAR*)"Usage:", 7); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" ", (LONGINT)3); - OPM_LogWStr((CHAR*)"voc", (LONGINT)4); - OPM_LogWStr((CHAR*)" options {files {options}}.", (LONGINT)28); + OPM_LogWStr((CHAR*)" ", 3); + OPM_LogWStr((CHAR*)"voc", 4); + OPM_LogWStr((CHAR*)" options {files {options}}.", 28); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Where options = [\"-\" {option} ].", (LONGINT)33); + OPM_LogWStr((CHAR*)"Where options = [\"-\" {option} ].", 33); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" m - generate code for main module", (LONGINT)36); + OPM_LogWStr((CHAR*)" m - generate code for main module", 36); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" M - generate code for main module and link object statically", (LONGINT)63); + OPM_LogWStr((CHAR*)" M - generate code for main module and link object statically", 63); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" s - generate new symbol file", (LONGINT)31); + OPM_LogWStr((CHAR*)" s - generate new symbol file", 31); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" e - allow extending the module interface", (LONGINT)43); + OPM_LogWStr((CHAR*)" e - allow extending the module interface", 43); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" r - check value ranges", (LONGINT)25); + OPM_LogWStr((CHAR*)" r - check value ranges", 25); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" x - turn off array indices check", (LONGINT)35); + OPM_LogWStr((CHAR*)" x - turn off array indices check", 35); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" a - don't check ASSERTs at runtime, use this option in tested production code", (LONGINT)80); + OPM_LogWStr((CHAR*)" a - don't check ASSERTs at runtime, use this option in tested production code", 80); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" p - turn off automatic pointer initialization", (LONGINT)48); + OPM_LogWStr((CHAR*)" p - turn off automatic pointer initialization", 48); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" t - don't check type guards (use in rare cases such as low-level modules where every cycle counts)", (LONGINT)101); + OPM_LogWStr((CHAR*)" t - don't check type guards (use in rare cases such as low-level modules where every cycle counts)", 101); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" S - don't call external assembler/compiler, only generate C code", (LONGINT)67); + OPM_LogWStr((CHAR*)" S - don't call external assembler/compiler, only generate C code", 67); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" c - don't call linker", (LONGINT)24); + OPM_LogWStr((CHAR*)" c - don't call linker", 24); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" f - don't use color output", (LONGINT)29); + OPM_LogWStr((CHAR*)" f - don't use color output", 29); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" F - force writing new symbol file in current directory", (LONGINT)57); + OPM_LogWStr((CHAR*)" F - force writing new symbol file in current directory", 57); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" V - verbose output", (LONGINT)21); + OPM_LogWStr((CHAR*)" V - verbose output", 21); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Initial options specify defaults for all files.", (LONGINT)48); + OPM_LogWStr((CHAR*)"Initial options specify defaults for all files.", 48); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Options following a filename are specific to that file.", (LONGINT)56); + OPM_LogWStr((CHAR*)"Options following a filename are specific to that file.", 56); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Repeating an option toggles its value.", (LONGINT)39); + OPM_LogWStr((CHAR*)"Repeating an option toggles its value.", 39); OPM_LogWLn(); _o_result = 0; return _o_result; } else { OPM_S = 1; s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + Platform_GetArg(OPM_S, (void*)s, 256); OPM_glbopt = 0xe9; while (s[0] == '-') { - OPM_ScanOptions((void*)s, ((LONGINT)(256)), &OPM_glbopt); + OPM_ScanOptions((void*)s, 256, &OPM_glbopt); OPM_S += 1; s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + Platform_GetArg(OPM_S, (void*)s, 256); } _o_result = 1; return _o_result; @@ -276,12 +276,12 @@ void OPM_InitOptions (void) CHAR s[256]; OPM_opt = OPM_glbopt; s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + Platform_GetArg(OPM_S, (void*)s, 256); while (s[0] == '-') { - OPM_ScanOptions((void*)s, ((LONGINT)(256)), &OPM_opt); + OPM_ScanOptions((void*)s, 256, &OPM_opt); OPM_S += 1; s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + Platform_GetArg(OPM_S, (void*)s, 256); } OPM_dontAsm = __IN(13, OPM_opt); OPM_dontLink = __IN(14, OPM_opt); @@ -307,19 +307,19 @@ void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len) return; } s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + Platform_GetArg(OPM_S, (void*)s, 256); __NEW(T, Texts_TextDesc); - Texts_Open(T, s, ((LONGINT)(256))); - OPM_LogWStr(s, ((LONGINT)(256))); - OPM_LogWStr((CHAR*)" ", (LONGINT)3); + Texts_Open(T, s, 256); + OPM_LogWStr(s, 256); + OPM_LogWStr((CHAR*)" ", 3); __COPY(s, mname, mname__len); - __COPY(s, OPM_SourceFileName, ((LONGINT)(256))); + __COPY(s, OPM_SourceFileName, 256); if (T->len == 0) { - OPM_LogWStr(s, ((LONGINT)(256))); - OPM_LogWStr((CHAR*)" not found.", (LONGINT)12); + OPM_LogWStr(s, 256); + OPM_LogWStr((CHAR*)" not found.", 12); OPM_LogWLn(); } else { - Texts_OpenReader(&OPM_inR, Texts_Reader__typ, T, ((LONGINT)(0))); + Texts_OpenReader(&OPM_inR, Texts_Reader__typ, T, 0); *done = 1; } OPM_S += 1; @@ -378,25 +378,25 @@ static void OPM_LogErrMsg (INTEGER n) CHAR buf[1024]; if (n >= 0) { if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"31m", (LONGINT)4); + vt100_SetAttr((CHAR*)"31m", 4); } - OPM_LogWStr((CHAR*)" err ", (LONGINT)7); + OPM_LogWStr((CHAR*)" err ", 7); if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + vt100_SetAttr((CHAR*)"0m", 3); } } else { if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"35m", (LONGINT)4); + vt100_SetAttr((CHAR*)"35m", 4); } - OPM_LogWStr((CHAR*)" warning ", (LONGINT)11); + OPM_LogWStr((CHAR*)" warning ", 11); n = -n; if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + vt100_SetAttr((CHAR*)"0m", 3); } } - OPM_LogWNum(n, ((LONGINT)(1))); - OPM_LogWStr((CHAR*)" ", (LONGINT)3); - OPM_LogWStr(errors_errors[__X(n, ((LONGINT)(350)))], ((LONGINT)(128))); + OPM_LogWNum(n, 1); + OPM_LogWStr((CHAR*)" ", 3); + OPM_LogWStr(errors_errors[__X(n, 350)], 128); } static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, LONGINT pos) @@ -438,37 +438,37 @@ static void OPM_ShowLine (LONGINT pos) CHAR line[1023]; INTEGER i; CHAR ch; - f = Files_Old(OPM_SourceFileName, ((LONGINT)(256))); + f = Files_Old(OPM_SourceFileName, 256); OPM_FindLine(f, &r, Files_Rider__typ, pos); i = 0; Files_Read(&r, Files_Rider__typ, (void*)&ch); while ((((((ch != 0x00 && ch != 0x0d)) && ch != 0x0a)) && i < 1022)) { - line[__X(i, ((LONGINT)(1023)))] = ch; + line[__X(i, 1023)] = ch; i += 1; Files_Read(&r, Files_Rider__typ, (void*)&ch); } - line[__X(i, ((LONGINT)(1023)))] = 0x00; + line[__X(i, 1023)] = 0x00; OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWNum(OPM_ErrorLineNumber, ((LONGINT)(4))); - OPM_LogWStr((CHAR*)": ", (LONGINT)3); - OPM_LogWStr(line, ((LONGINT)(1023))); + OPM_LogWNum(OPM_ErrorLineNumber, 4); + OPM_LogWStr((CHAR*)": ", 3); + OPM_LogWStr(line, 1023); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" ", (LONGINT)7); + OPM_LogWStr((CHAR*)" ", 7); if (pos >= OPM_ErrorLineLimitPos) { pos = OPM_ErrorLineLimitPos - 1; } - i = (int)(pos - OPM_ErrorLineStartPos); + i = (pos - OPM_ErrorLineStartPos); while (i > 0) { OPM_LogW(' '); i -= 1; } if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"32m", (LONGINT)4); + vt100_SetAttr((CHAR*)"32m", 4); } OPM_LogW('^'); if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + vt100_SetAttr((CHAR*)"0m", 3); } Files_Close(f); } @@ -484,30 +484,30 @@ void OPM_Mark (INTEGER n, LONGINT pos) OPM_lasterrpos = pos; OPM_ShowLine(pos); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" ", (LONGINT)3); + OPM_LogWStr((CHAR*)" ", 3); if (n < 249) { - OPM_LogWStr((CHAR*)" pos", (LONGINT)6); - OPM_LogWNum(pos, ((LONGINT)(6))); + OPM_LogWStr((CHAR*)" pos", 6); + OPM_LogWNum(pos, 6); OPM_LogErrMsg(n); } else if (n == 255) { - OPM_LogWStr((CHAR*)"pos", (LONGINT)4); - OPM_LogWNum(pos, ((LONGINT)(6))); - OPM_LogWStr((CHAR*)" pc ", (LONGINT)6); - OPM_LogWNum(OPM_breakpc, ((LONGINT)(1))); + OPM_LogWStr((CHAR*)"pos", 4); + OPM_LogWNum(pos, 6); + OPM_LogWStr((CHAR*)" pc ", 6); + OPM_LogWNum(OPM_breakpc, 1); } else if (n == 254) { - OPM_LogWStr((CHAR*)"pc not found", (LONGINT)13); + OPM_LogWStr((CHAR*)"pc not found", 13); } else { - OPM_LogWStr(OPM_objname, ((LONGINT)(64))); + OPM_LogWStr(OPM_objname, 64); if (n == 253) { - OPM_LogWStr((CHAR*)" is new, compile with option e", (LONGINT)31); + OPM_LogWStr((CHAR*)" is new, compile with option e", 31); } else if (n == 252) { - OPM_LogWStr((CHAR*)" is redefined, compile with option s", (LONGINT)37); + OPM_LogWStr((CHAR*)" is redefined, compile with option s", 37); } else if (n == 251) { - OPM_LogWStr((CHAR*)" is redefined (private part only), compile with option s", (LONGINT)57); + OPM_LogWStr((CHAR*)" is redefined (private part only), compile with option s", 57); } else if (n == 250) { - OPM_LogWStr((CHAR*)" is no longer visible, compile with option s", (LONGINT)45); + OPM_LogWStr((CHAR*)" is no longer visible, compile with option s", 45); } else if (n == 249) { - OPM_LogWStr((CHAR*)" is not consistently imported, recompile imports", (LONGINT)49); + OPM_LogWStr((CHAR*)" is not consistently imported, recompile imports", 49); } } } @@ -515,8 +515,8 @@ void OPM_Mark (INTEGER n, LONGINT pos) if (pos >= 0) { OPM_ShowLine(pos); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" pos", (LONGINT)6); - OPM_LogWNum(pos, ((LONGINT)(6))); + OPM_LogWStr((CHAR*)" pos", 6); + OPM_LogWNum(pos, 6); } OPM_LogErrMsg(n); if (pos < 0) { @@ -532,27 +532,27 @@ void OPM_err (INTEGER n) void OPM_FPrint (LONGINT *fp, LONGINT val) { - *fp = __ROTL((LONGINT)((SET)*fp ^ (SET)val), 1, LONGINT); + *fp = __ROTL((LONGINT)(__VAL(SET, *fp) ^ __VAL(SET, val)), 1, LONGINT); } void OPM_FPrintSet (LONGINT *fp, SET set) { - OPM_FPrint(&*fp, (LONGINT)set); + OPM_FPrint(&*fp, __VAL(LONGINT, set)); } void OPM_FPrintReal (LONGINT *fp, REAL real) { INTEGER i; LONGINT l; - __GET((LONGINT)(SYSTEM_ADRINT)&real, l, LONGINT); + __GET((SYSTEM_ADRINT)&real, l, LONGINT); OPM_FPrint(&*fp, l); } void OPM_FPrintLReal (LONGINT *fp, LONGREAL lr) { LONGINT l, h; - __GET((LONGINT)(SYSTEM_ADRINT)&lr, l, LONGINT); - __GET((LONGINT)(SYSTEM_ADRINT)&lr + 4, h, LONGINT); + __GET((SYSTEM_ADRINT)&lr, l, LONGINT); + __GET((SYSTEM_ADRINT)&lr + 4, h, LONGINT); OPM_FPrint(&*fp, l); OPM_FPrint(&*fp, h); } @@ -563,19 +563,19 @@ static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONG if (((*S).class == 1 && __STRCMP((*S).s, name) == 0)) { Texts_Scan(&*S, S__typ); if ((*S).class == 3) { - *size = (int)(*S).i; + *size = (*S).i; Texts_Scan(&*S, S__typ); } else { - OPM_Mark(-157, ((LONGINT)(-1))); + OPM_Mark(-157, -1); } if ((*S).class == 3) { - *align = (int)(*S).i; + *align = (*S).i; Texts_Scan(&*S, S__typ); } else { - OPM_Mark(-157, ((LONGINT)(-1))); + OPM_Mark(-157, -1); } } else { - OPM_Mark(-157, ((LONGINT)(-1))); + OPM_Mark(-157, -1); } __DEL(name); } @@ -604,40 +604,40 @@ static LONGINT OPM_power0 (LONGINT i, LONGINT j) static void OPM_VerboseListSizes (void) { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Type Size Alignement", (LONGINT)29); + OPM_LogWStr((CHAR*)"Type Size Alignement", 29); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"CHAR ", (LONGINT)14); - OPM_LogWNum(OPM_CharSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"CHAR ", 14); + OPM_LogWNum(OPM_CharSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"BOOLEAN ", (LONGINT)14); - OPM_LogWNum(OPM_BoolSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"BOOLEAN ", 14); + OPM_LogWNum(OPM_BoolSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"SHORTINT ", (LONGINT)14); - OPM_LogWNum(OPM_SIntSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"SHORTINT ", 14); + OPM_LogWNum(OPM_SIntSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"INTEGER ", (LONGINT)14); - OPM_LogWNum(OPM_IntSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"INTEGER ", 14); + OPM_LogWNum(OPM_IntSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"LONGINT ", (LONGINT)14); - OPM_LogWNum(OPM_LIntSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"LONGINT ", 14); + OPM_LogWNum(OPM_LIntSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"SET ", (LONGINT)14); - OPM_LogWNum(OPM_SetSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"SET ", 14); + OPM_LogWNum(OPM_SetSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"REAL ", (LONGINT)14); - OPM_LogWNum(OPM_RealSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"REAL ", 14); + OPM_LogWNum(OPM_RealSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"LONGREAL ", (LONGINT)14); - OPM_LogWNum(OPM_LRealSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"LONGREAL ", 14); + OPM_LogWNum(OPM_LRealSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"PTR ", (LONGINT)14); - OPM_LogWNum(OPM_PointerSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"PTR ", 14); + OPM_LogWNum(OPM_PointerSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"PROC ", (LONGINT)14); - OPM_LogWNum(OPM_ProcSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"PROC ", 14); + OPM_LogWNum(OPM_ProcSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"RECORD ", (LONGINT)14); - OPM_LogWNum(OPM_RecSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"RECORD ", 14); + OPM_LogWNum(OPM_RecSize, 4); OPM_LogWLn(); OPM_LogWLn(); } @@ -720,11 +720,11 @@ void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done) { CHAR ch; OPM_FileName fileName; - OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, ((LONGINT)(32)), (CHAR*)".sym", (LONGINT)5); - OPM_oldSFile = Files_Old(fileName, ((LONGINT)(32))); + OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, 32, (CHAR*)".sym", 5); + OPM_oldSFile = Files_Old(fileName, 32); *done = OPM_oldSFile != NIL; if (*done) { - Files_Set(&OPM_oldSF, Files_Rider__typ, OPM_oldSFile, ((LONGINT)(0))); + Files_Set(&OPM_oldSF, Files_Rider__typ, OPM_oldSFile, 0); Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&ch); if (ch != 0xf7) { OPM_err(-306); @@ -753,7 +753,7 @@ void OPM_SymWInt (LONGINT i) void OPM_SymWSet (SET s) { - Files_WriteNum(&OPM_newSF, Files_Rider__typ, (LONGINT)s); + Files_WriteNum(&OPM_newSF, Files_Rider__typ, __VAL(LONGINT, s)); } void OPM_SymWReal (REAL r) @@ -780,10 +780,10 @@ void OPM_DeleteNewSym (void) void OPM_NewSym (CHAR *modName, LONGINT modName__len) { OPM_FileName fileName; - OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, ((LONGINT)(32)), (CHAR*)".sym", (LONGINT)5); - OPM_newSFile = Files_New(fileName, ((LONGINT)(32))); + OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, 32, (CHAR*)".sym", 5); + OPM_newSFile = Files_New(fileName, 32); if (OPM_newSFile != NIL) { - Files_Set(&OPM_newSF, Files_Rider__typ, OPM_newSFile, ((LONGINT)(0))); + Files_Set(&OPM_newSF, Files_Rider__typ, OPM_newSFile, 0); Files_Write(&OPM_newSF, Files_Rider__typ, 0xf7); } else { OPM_err(153); @@ -792,7 +792,7 @@ void OPM_NewSym (CHAR *modName, LONGINT modName__len) void OPM_Write (CHAR ch) { - Files_Write(&OPM_R[__X(OPM_currFile, ((LONGINT)(3)))], Files_Rider__typ, ch); + Files_Write(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, ch); } void OPM_WriteString (CHAR *s, LONGINT s__len) @@ -802,7 +802,7 @@ void OPM_WriteString (CHAR *s, LONGINT s__len) while (s[__X(i, s__len)] != 0x00) { i += 1; } - Files_WriteBytes(&OPM_R[__X(OPM_currFile, ((LONGINT)(3)))], Files_Rider__typ, (void*)s, s__len * ((LONGINT)(1)), i); + Files_WriteBytes(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, (void*)s, s__len * 1, i); } void OPM_WriteStringVar (CHAR *s, LONGINT s__len) @@ -812,27 +812,27 @@ void OPM_WriteStringVar (CHAR *s, LONGINT s__len) while (s[__X(i, s__len)] != 0x00) { i += 1; } - Files_WriteBytes(&OPM_R[__X(OPM_currFile, ((LONGINT)(3)))], Files_Rider__typ, (void*)s, s__len * ((LONGINT)(1)), i); + Files_WriteBytes(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, (void*)s, s__len * 1, i); } void OPM_WriteHex (LONGINT i) { CHAR s[3]; INTEGER digit; - digit = __ASHR((int)i, 4); + digit = __ASHR(i, 4); if (digit < 10) { s[0] = (CHAR)(48 + digit); } else { s[0] = (CHAR)(87 + digit); } - digit = __MASK((int)i, -16); + digit = __MASK(i, -16); if (digit < 10) { s[1] = (CHAR)(48 + digit); } else { s[1] = (CHAR)(87 + digit); } s[2] = 0x00; - OPM_WriteString(s, ((LONGINT)(3))); + OPM_WriteString(s, 3); } void OPM_WriteInt (LONGINT i) @@ -842,24 +842,24 @@ void OPM_WriteInt (LONGINT i) if (i == OPM_SignedMinimum(OPM_IntSize) || i == OPM_SignedMinimum(OPM_LIntSize)) { OPM_Write('('); OPM_WriteInt(i + 1); - OPM_WriteString((CHAR*)"-1)", (LONGINT)4); + OPM_WriteString((CHAR*)"-1)", 4); } else { i1 = __ABS(i); - s[0] = (CHAR)(__MOD(i1, 10) + 48); + s[0] = (CHAR)((int)__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k = 1; while (i1 > 0) { - s[__X(k, ((LONGINT)(20)))] = (CHAR)(__MOD(i1, 10) + 48); + s[__X(k, 20)] = (CHAR)((int)__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k += 1; } if (i < 0) { - s[__X(k, ((LONGINT)(20)))] = '-'; + s[__X(k, 20)] = '-'; k += 1; } while (k > 0) { k -= 1; - OPM_Write(s[__X(k, ((LONGINT)(20)))]); + OPM_Write(s[__X(k, 20)]); } } } @@ -872,13 +872,13 @@ void OPM_WriteReal (LONGREAL r, CHAR suffx) CHAR s[32]; CHAR ch; INTEGER i; - if ((((r < OPM_SignedMaximum(OPM_LIntSize) && r > OPM_SignedMinimum(OPM_LIntSize))) && r == ((int)__ENTIER(r)))) { + if ((((r < OPM_SignedMaximum(OPM_LIntSize) && r > OPM_SignedMinimum(OPM_LIntSize))) && r == ((SYSTEM_INT32)__ENTIER(r)))) { if (suffx == 'f') { - OPM_WriteString((CHAR*)"(REAL)", (LONGINT)7); + OPM_WriteString((CHAR*)"(REAL)", 7); } else { - OPM_WriteString((CHAR*)"(LONGREAL)", (LONGINT)11); + OPM_WriteString((CHAR*)"(LONGREAL)", 11); } - OPM_WriteInt((int)__ENTIER(r)); + OPM_WriteInt((SYSTEM_INT32)__ENTIER(r)); } else { Texts_OpenWriter(&W, Texts_Writer__typ); if (suffx == 'f') { @@ -887,33 +887,33 @@ void OPM_WriteReal (LONGREAL r, CHAR suffx) Texts_WriteLongReal(&W, Texts_Writer__typ, r, 23); } __NEW(T, Texts_TextDesc); - Texts_Open(T, (CHAR*)"", (LONGINT)1); + Texts_Open(T, (CHAR*)"", 1); Texts_Append(T, W.buf); - Texts_OpenReader(&R, Texts_Reader__typ, T, ((LONGINT)(0))); + Texts_OpenReader(&R, Texts_Reader__typ, T, 0); i = 0; Texts_Read(&R, Texts_Reader__typ, &ch); while (ch != 0x00) { - s[__X(i, ((LONGINT)(32)))] = ch; + s[__X(i, 32)] = ch; i += 1; Texts_Read(&R, Texts_Reader__typ, &ch); } - s[__X(i, ((LONGINT)(32)))] = 0x00; + s[__X(i, 32)] = 0x00; i = 0; ch = s[0]; while ((ch != 'D' && ch != 0x00)) { i += 1; - ch = s[__X(i, ((LONGINT)(32)))]; + ch = s[__X(i, 32)]; } if (ch == 'D') { - s[__X(i, ((LONGINT)(32)))] = 'e'; + s[__X(i, 32)] = 'e'; } - OPM_WriteString(s, ((LONGINT)(32))); + OPM_WriteString(s, 32); } } void OPM_WriteLn (void) { - Files_Write(&OPM_R[__X(OPM_currFile, ((LONGINT)(3)))], Files_Rider__typ, 0x0a); + Files_Write(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, 0x0a); } static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F) @@ -921,11 +921,11 @@ static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F) Files_Rider R1; CHAR buffer[4096]; if (F != NIL) { - Files_Set(&R1, Files_Rider__typ, F, ((LONGINT)(0))); - Files_ReadBytes(&R1, Files_Rider__typ, (void*)buffer, ((LONGINT)(4096)), ((LONGINT)(4096))); + Files_Set(&R1, Files_Rider__typ, F, 0); + Files_ReadBytes(&R1, Files_Rider__typ, (void*)buffer, 4096, 4096); while (4096 - R1.res > 0) { - Files_WriteBytes(&*R, R__typ, (void*)buffer, ((LONGINT)(4096)), 4096 - R1.res); - Files_ReadBytes(&R1, Files_Rider__typ, (void*)buffer, ((LONGINT)(4096)), ((LONGINT)(4096))); + Files_WriteBytes(&*R, R__typ, (void*)buffer, 4096, 4096 - R1.res); + Files_ReadBytes(&R1, Files_Rider__typ, (void*)buffer, 4096, 4096); } } } @@ -933,24 +933,24 @@ static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F) void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len) { CHAR FName[32]; - __COPY(moduleName, OPM_modName, ((LONGINT)(32))); - OPM_HFile = Files_New((CHAR*)"", (LONGINT)1); + __COPY(moduleName, OPM_modName, 32); + OPM_HFile = Files_New((CHAR*)"", 1); if (OPM_HFile != NIL) { - Files_Set(&OPM_R[0], Files_Rider__typ, OPM_HFile, ((LONGINT)(0))); + Files_Set(&OPM_R[0], Files_Rider__typ, OPM_HFile, 0); } else { OPM_err(153); } - OPM_MakeFileName((void*)moduleName, moduleName__len, (void*)FName, ((LONGINT)(32)), (CHAR*)".c", (LONGINT)3); - OPM_BFile = Files_New(FName, ((LONGINT)(32))); + OPM_MakeFileName((void*)moduleName, moduleName__len, (void*)FName, 32, (CHAR*)".c", 3); + OPM_BFile = Files_New(FName, 32); if (OPM_BFile != NIL) { - Files_Set(&OPM_R[1], Files_Rider__typ, OPM_BFile, ((LONGINT)(0))); + Files_Set(&OPM_R[1], Files_Rider__typ, OPM_BFile, 0); } else { OPM_err(153); } - OPM_MakeFileName((void*)moduleName, moduleName__len, (void*)FName, ((LONGINT)(32)), (CHAR*)".h", (LONGINT)3); - OPM_HIFile = Files_New(FName, ((LONGINT)(32))); + OPM_MakeFileName((void*)moduleName, moduleName__len, (void*)FName, 32, (CHAR*)".h", 3); + OPM_HIFile = Files_New(FName, 32); if (OPM_HIFile != NIL) { - Files_Set(&OPM_R[2], Files_Rider__typ, OPM_HIFile, ((LONGINT)(0))); + Files_Set(&OPM_R[2], Files_Rider__typ, OPM_HIFile, 0); } else { OPM_err(153); } @@ -961,9 +961,9 @@ void OPM_CloseFiles (void) CHAR FName[32]; INTEGER res; if (OPM_noerr) { - OPM_LogWStr((CHAR*)" ", (LONGINT)3); - OPM_LogWNum(Files_Pos(&OPM_R[1], Files_Rider__typ), ((LONGINT)(0))); - OPM_LogWStr((CHAR*)" chars.", (LONGINT)8); + OPM_LogWStr((CHAR*)" ", 3); + OPM_LogWNum(Files_Pos(&OPM_R[1], Files_Rider__typ), 0); + OPM_LogWStr((CHAR*)" chars.", 8); } if (OPM_noerr) { if (__STRCMP(OPM_modName, "SYSTEM") == 0) { @@ -975,10 +975,10 @@ void OPM_CloseFiles (void) Files_Register(OPM_HIFile); Files_Register(OPM_BFile); } else { - OPM_MakeFileName((void*)OPM_modName, ((LONGINT)(32)), (void*)FName, ((LONGINT)(32)), (CHAR*)".h", (LONGINT)3); - Files_Delete(FName, ((LONGINT)(32)), &res); - OPM_MakeFileName((void*)OPM_modName, ((LONGINT)(32)), (void*)FName, ((LONGINT)(32)), (CHAR*)".sym", (LONGINT)5); - Files_Delete(FName, ((LONGINT)(32)), &res); + OPM_MakeFileName((void*)OPM_modName, 32, (void*)FName, 32, (CHAR*)".h", 3); + Files_Delete(FName, 32, &res); + OPM_MakeFileName((void*)OPM_modName, 32, (void*)FName, 32, (CHAR*)".sym", 5); + Files_Delete(FName, 32, &res); Files_Register(OPM_BFile); } } @@ -987,11 +987,11 @@ void OPM_CloseFiles (void) OPM_HIFile = NIL; OPM_newSFile = NIL; OPM_oldSFile = NIL; - Files_Set(&OPM_R[0], Files_Rider__typ, NIL, ((LONGINT)(0))); - Files_Set(&OPM_R[1], Files_Rider__typ, NIL, ((LONGINT)(0))); - Files_Set(&OPM_R[2], Files_Rider__typ, NIL, ((LONGINT)(0))); - Files_Set(&OPM_newSF, Files_Rider__typ, NIL, ((LONGINT)(0))); - Files_Set(&OPM_oldSF, Files_Rider__typ, NIL, ((LONGINT)(0))); + Files_Set(&OPM_R[0], Files_Rider__typ, NIL, 0); + Files_Set(&OPM_R[1], Files_Rider__typ, NIL, 0); + Files_Set(&OPM_R[2], Files_Rider__typ, NIL, 0); + Files_Set(&OPM_newSF, Files_Rider__typ, NIL, 0); + Files_Set(&OPM_oldSF, Files_Rider__typ, NIL, 0); } static void EnumPtrs(void (*P)(void*)) @@ -1032,15 +1032,15 @@ export void *OPM__init(void) /* BEGIN */ Texts_OpenWriter(&OPM_W, Texts_Writer__typ); OPM_MODULES[0] = 0x00; - Platform_GetEnv((CHAR*)"MODULES", (LONGINT)8, (void*)OPM_MODULES, ((LONGINT)(1024))); + Platform_GetEnv((CHAR*)"MODULES", 8, (void*)OPM_MODULES, 1024); __MOVE(".", OPM_OBERON, 2); - Platform_GetEnv((CHAR*)"OBERON", (LONGINT)7, (void*)OPM_OBERON, ((LONGINT)(1024))); - Strings_Append((CHAR*)";.;", (LONGINT)4, (void*)OPM_OBERON, ((LONGINT)(1024))); - Strings_Append(OPM_MODULES, ((LONGINT)(1024)), (void*)OPM_OBERON, ((LONGINT)(1024))); - Strings_Append((CHAR*)";", (LONGINT)2, (void*)OPM_OBERON, ((LONGINT)(1024))); - Strings_Append((CHAR*)"/opt/voc", (LONGINT)9, (void*)OPM_OBERON, ((LONGINT)(1024))); - Strings_Append((CHAR*)"/sym;", (LONGINT)6, (void*)OPM_OBERON, ((LONGINT)(1024))); - Files_SetSearchPath(OPM_OBERON, ((LONGINT)(1024))); + Platform_GetEnv((CHAR*)"OBERON", 7, (void*)OPM_OBERON, 1024); + Strings_Append((CHAR*)";.;", 4, (void*)OPM_OBERON, 1024); + Strings_Append(OPM_MODULES, 1024, (void*)OPM_OBERON, 1024); + Strings_Append((CHAR*)";", 2, (void*)OPM_OBERON, 1024); + Strings_Append((CHAR*)"/opt/voc", 9, (void*)OPM_OBERON, 1024); + Strings_Append((CHAR*)"/sym;", 6, (void*)OPM_OBERON, 1024); + Files_SetSearchPath(OPM_OBERON, 1024); OPM_CharSize = 1; OPM_BoolSize = 1; OPM_SIntSize = 1; diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index a61c632e..f93bcd98 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index 5620c5ec..f44a2167 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPB.h" #include "OPM.h" @@ -58,7 +58,7 @@ static void OPP_err (INTEGER n) static void OPP_CheckSym (INTEGER s) { - if ((int)OPP_sym == s) { + if (OPP_sym == s) { OPS_Get(&OPP_sym); } else { OPM_err(s); @@ -104,7 +104,7 @@ static void OPP_ConstExpression (OPT_Node *x) OPP_Expression(&*x); if ((*x)->class != 7) { OPP_err(50); - *x = OPB_NewIntConst(((LONGINT)(1))); + *x = OPB_NewIntConst(1); } } @@ -146,7 +146,7 @@ static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_) OPP_err(51); sf = 0; } - *sysflag = (int)sf; + *sysflag = sf; OPP_CheckSym(23); } else { *sysflag = default_; @@ -308,13 +308,13 @@ static void OPP_PointerType (OPT_Struct *typ) OPT_Find(&id); if (id == NIL) { if (OPP_nofFwdPtr < 64) { - OPP_FwdPtr[__X(OPP_nofFwdPtr, ((LONGINT)(64)))] = *typ; + OPP_FwdPtr[__X(OPP_nofFwdPtr, 64)] = *typ; OPP_nofFwdPtr += 1; } else { OPP_err(224); } (*typ)->link = OPT_NewObj(); - __COPY(OPS_name, (*typ)->link->name, ((LONGINT)(256))); + __COPY(OPS_name, (*typ)->link->name, 256); (*typ)->BaseTyp = OPT_undftyp; OPS_Get(&OPP_sym); } else { @@ -518,7 +518,7 @@ static void OPP_selector (OPT_Node *x) } else if (OPP_sym == 18) { OPS_Get(&OPP_sym); if (OPP_sym == 38) { - __COPY(OPS_name, name, ((LONGINT)(256))); + __COPY(OPS_name, name, 256); OPS_Get(&OPP_sym); if ((*x)->typ != NIL) { if ((*x)->typ->form == 13) { @@ -625,7 +625,7 @@ static void OPP_StandProcCall (OPT_Node *x) OPT_Node y = NIL; SHORTINT m; INTEGER n; - m = (int)(*x)->obj->adr; + m = (*x)->obj->adr; n = 0; if (OPP_sym == 30) { OPS_Get(&OPP_sym); @@ -742,8 +742,8 @@ static void OPP_Factor (OPT_Node *x) *x = OPB_NewRealConst(OPS_lrlval, OPT_lrltyp); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPP.Factor, OPS.numtyp = ", (LONGINT)44); - OPM_LogWNum(OPS_numtyp, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPP.Factor, OPS.numtyp = ", 44); + OPM_LogWNum(OPS_numtyp, 0); OPM_LogWLn(); break; } @@ -776,7 +776,7 @@ static void OPP_Factor (OPT_Node *x) *x = NIL; } if (*x == NIL) { - *x = OPB_NewIntConst(((LONGINT)(1))); + *x = OPB_NewIntConst(1); (*x)->typ = OPT_undftyp; } } @@ -858,7 +858,7 @@ static void OPP_Receiver (SHORTINT *mode, OPS_Name name, OPT_Struct *typ, OPT_St } else { *mode = 1; } - __COPY(OPS_name, name, ((LONGINT)(256))); + __COPY(OPS_name, name, 256); OPP_CheckSym(38); OPP_CheckSym(20); if (OPP_sym == 38) { @@ -932,8 +932,8 @@ static void GetCode__19 (void) (*ProcedureDeclaration__16_s->proc)->conval->ext = ext; n = 0; if (OPP_sym == 37) { - while (OPS_str[__X(n, ((LONGINT)(256)))] != 0x00) { - (*ext)[__X(n + 1, ((LONGINT)(256)))] = OPS_str[__X(n, ((LONGINT)(256)))]; + while (OPS_str[__X(n, 256)] != 0x00) { + (*ext)[__X(n + 1, 256)] = OPS_str[__X(n, 256)]; n += 1; } (*ext)[0] = (CHAR)n; @@ -949,7 +949,7 @@ static void GetCode__19 (void) n = 1; } OPS_Get(&OPP_sym); - (*ext)[__X(n, ((LONGINT)(256)))] = (CHAR)c; + (*ext)[__X(n, 256)] = (CHAR)c; } if (OPP_sym == 19) { OPS_Get(&OPP_sym); @@ -1023,7 +1023,7 @@ static void TProcDecl__23 (void) } OPP_Receiver(&objMode, objName, &objTyp, &recTyp); if (OPP_sym == 38) { - __COPY(OPS_name, *ProcedureDeclaration__16_s->name, ((LONGINT)(256))); + __COPY(OPS_name, *ProcedureDeclaration__16_s->name, 256); OPP_CheckMark(&*ProcedureDeclaration__16_s->vis); OPT_FindField(*ProcedureDeclaration__16_s->name, recTyp, &*ProcedureDeclaration__16_s->fwd); OPT_FindField(*ProcedureDeclaration__16_s->name, recTyp->BaseTyp, &baseProc); @@ -1122,7 +1122,7 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) TProcDecl__23(); } else if (OPP_sym == 38) { OPT_Find(&fwd); - __COPY(OPS_name, name, ((LONGINT)(256))); + __COPY(OPS_name, name, 256); OPP_CheckMark(&vis); if ((vis != 0 && mode == 6)) { mode = 7; @@ -1183,14 +1183,14 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, O if (!__IN(LabelTyp->form, 0x70) || LabelTyp->size < x->typ->size) { OPP_err(60); } - } else if ((int)LabelTyp->form != f) { + } else if (LabelTyp->form != f) { OPP_err(60); } if (OPP_sym == 21) { OPS_Get(&OPP_sym); OPP_ConstExpression(&y); yval = y->conval->intval; - if (((int)y->typ->form != f && !((__IN(f, 0x70) && __IN(y->typ->form, 0x70))))) { + if ((y->typ->form != f && !((__IN(f, 0x70) && __IN(y->typ->form, 0x70))))) { OPP_err(60); } if (yval < xval) { @@ -1207,17 +1207,17 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, O if (i == 0) { break; } - if (tab[__X(i - 1, ((LONGINT)(128)))].low <= yval) { - if (tab[__X(i - 1, ((LONGINT)(128)))].high >= xval) { + if (tab[__X(i - 1, 128)].low <= yval) { + if (tab[__X(i - 1, 128)].high >= xval) { OPP_err(62); } break; } - tab[__X(i, ((LONGINT)(128)))] = tab[__X(i - 1, ((LONGINT)(128)))]; + tab[__X(i, 128)] = tab[__X(i - 1, 128)]; i -= 1; } - tab[__X(i, ((LONGINT)(128)))].low = xval; - tab[__X(i, ((LONGINT)(128)))].high = yval; + tab[__X(i, 128)].low = xval; + tab[__X(i, 128)].high = yval; *n += 1; } else { OPP_err(213); @@ -1276,7 +1276,7 @@ static void CasePart__31 (OPT_Node *x) } if (n > 0) { low = tab[0].low; - high = tab[__X(n - 1, ((LONGINT)(128)))].high; + high = tab[__X(n - 1, 128)].high; if (high - low > 512) { OPP_err(209); } @@ -1479,7 +1479,7 @@ static void OPP_StatSeq (OPT_Node *stat) OPS_Get(&OPP_sym); OPP_ConstExpression(&z); } else { - z = OPB_NewIntConst(((LONGINT)(1))); + z = OPB_NewIntConst(1); } pos = OPM_errpos; x = OPB_NewLeaf(id); @@ -1642,7 +1642,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) OPP_ConstExpression(&x); } else { OPP_err(9); - x = OPB_NewIntConst(((LONGINT)(1))); + x = OPB_NewIntConst(1); } obj->mode = 3; obj->typ = x->typ; @@ -1673,7 +1673,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) if (__IN(obj->typ->comp, 0x1c)) { i = 0; while (i < OPP_nofFwdPtr) { - typ = OPP_FwdPtr[__X(i, ((LONGINT)(64)))]; + typ = OPP_FwdPtr[__X(i, 64)]; i += 1; if (__STRCMP(typ->link->name, obj->name) == 0) { typ->BaseTyp = obj->typ; @@ -1735,10 +1735,10 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) } i = 0; while (i < OPP_nofFwdPtr) { - if (OPP_FwdPtr[__X(i, ((LONGINT)(64)))]->link->name[0] != 0x00) { + if (OPP_FwdPtr[__X(i, 64)]->link->name[0] != 0x00) { OPP_err(128); } - OPP_FwdPtr[__X(i, ((LONGINT)(64)))] = NIL; + OPP_FwdPtr[__X(i, 64)] = NIL; i += 1; } OPT_topScope->adr = OPM_errpos; @@ -1784,28 +1784,28 @@ void OPP_Module (OPT_Node *prog, SET opt) OPS_Get(&OPP_sym); } else { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Unexpected symbol found when MODULE expected:", (LONGINT)46); + OPM_LogWStr((CHAR*)"Unexpected symbol found when MODULE expected:", 46); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" sym: ", (LONGINT)15); - OPM_LogWNum(OPP_sym, ((LONGINT)(1))); + OPM_LogWStr((CHAR*)" sym: ", 15); + OPM_LogWNum(OPP_sym, 1); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" OPS.name: ", (LONGINT)15); - OPM_LogWStr(OPS_name, ((LONGINT)(256))); + OPM_LogWStr((CHAR*)" OPS.name: ", 15); + OPM_LogWStr(OPS_name, 256); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" OPS.str: ", (LONGINT)15); - OPM_LogWStr(OPS_str, ((LONGINT)(256))); + OPM_LogWStr((CHAR*)" OPS.str: ", 15); + OPM_LogWStr(OPS_str, 256); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" OPS.numtyp: ", (LONGINT)15); - OPM_LogWNum(OPS_numtyp, ((LONGINT)(1))); + OPM_LogWStr((CHAR*)" OPS.numtyp: ", 15); + OPM_LogWNum(OPS_numtyp, 1); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" OPS.intval: ", (LONGINT)15); - OPM_LogWNum(OPS_intval, ((LONGINT)(1))); + OPM_LogWStr((CHAR*)" OPS.intval: ", 15); + OPM_LogWNum(OPS_intval, 1); OPM_LogWLn(); OPP_err(16); } if (OPP_sym == 38) { - OPM_LogWStr((CHAR*)"compiling ", (LONGINT)11); - OPM_LogWStr(OPS_name, ((LONGINT)(256))); + OPM_LogWStr((CHAR*)"compiling ", 11); + OPM_LogWStr(OPS_name, 256); OPM_LogW('.'); OPT_Init(OPS_name, opt); OPS_Get(&OPP_sym); @@ -1814,13 +1814,13 @@ void OPP_Module (OPT_Node *prog, SET opt) OPS_Get(&OPP_sym); for (;;) { if (OPP_sym == 38) { - __COPY(OPS_name, aliasName, ((LONGINT)(256))); - __COPY(aliasName, impName, ((LONGINT)(256))); + __COPY(OPS_name, aliasName, 256); + __COPY(aliasName, impName, 256); OPS_Get(&OPP_sym); if (OPP_sym == 34) { OPS_Get(&OPP_sym); if (OPP_sym == 38) { - __COPY(OPS_name, impName, ((LONGINT)(256))); + __COPY(OPS_name, impName, 256); OPS_Get(&OPP_sym); } else { OPP_err(38); diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index be6b6252..0ddbe4c3 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index 1f721944..2a093f8e 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "OPM.h" @@ -59,7 +59,7 @@ static void OPS_Str (SHORTINT *sym) if (OPS_intval == 2) { *sym = 35; OPS_numtyp = 1; - OPS_intval = (int)OPS_str[0]; + OPS_intval = OPS_str[0]; } else { *sym = 37; } @@ -112,10 +112,10 @@ static INTEGER Ord__7 (CHAR ch, BOOLEAN hex) { INTEGER _o_result; if (ch <= '9') { - _o_result = (int)ch - 48; + _o_result = ch - 48; return _o_result; } else if (hex) { - _o_result = ((int)ch - 65) + 10; + _o_result = (ch - 65) + 10; return _o_result; } else { OPS_err(2); @@ -173,7 +173,7 @@ static void OPS_Number (void) OPS_numtyp = 1; if (n <= 2) { while (i < n) { - OPS_intval = __ASHL(OPS_intval, 4) + (int)Ord__7(dig[i], 1); + OPS_intval = __ASHL(OPS_intval, 4) + Ord__7(dig[i], 1); i += 1; } } else { @@ -188,7 +188,7 @@ static void OPS_Number (void) OPS_intval = -1; } while (i < n) { - OPS_intval = __ASHL(OPS_intval, 4) + (int)Ord__7(dig[i], 1); + OPS_intval = __ASHL(OPS_intval, 4) + Ord__7(dig[i], 1); i += 1; } } else { @@ -199,8 +199,8 @@ static void OPS_Number (void) while (i < n) { d = Ord__7(dig[i], 0); i += 1; - if (OPS_intval <= __DIV(2147483647 - (int)d, 10)) { - OPS_intval = OPS_intval * 10 + (int)d; + if (OPS_intval <= __DIV(2147483647 - d, 10)) { + OPS_intval = OPS_intval * 10 + d; } else { OPS_err(203); } diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index ecd93034..46e05201 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 8efa4803..c81989cb 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" @@ -162,10 +162,10 @@ OPT_Struct OPT_IntType (LONGINT size) OPT_Struct _o_result; INTEGER i; i = 1; - while ((OPT_IntTypes[__X(i, ((LONGINT)(20)))]->size < size && OPT_IntTypes[__X(i + 1, ((LONGINT)(20)))] != NIL)) { + while ((OPT_IntTypes[__X(i, 20)]->size < size && OPT_IntTypes[__X(i + 1, 20)] != NIL)) { i += 1; } - _o_result = OPT_IntTypes[__X(i, ((LONGINT)(20)))]; + _o_result = OPT_IntTypes[__X(i, 20)]; return _o_result; } @@ -177,11 +177,11 @@ OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir) __ASSERT(dir == 1 || dir == -1, 0); __ASSERT(x->BaseTyp == OPT_undftyp, 0); i = 0; - while ((OPT_IntTypes[__X(i, ((LONGINT)(20)))] != x && i < 20)) { + while ((OPT_IntTypes[__X(i, 20)] != x && i < 20)) { i += 1; } __ASSERT(i < 19, 0); - _o_result = OPT_IntTypes[__X(i + dir, ((LONGINT)(20)))]; + _o_result = OPT_IntTypes[__X(i + dir, 20)]; return _o_result; } @@ -234,7 +234,7 @@ OPT_ConstExt OPT_NewExt (void) { OPT_ConstExt _o_result; OPT_ConstExt ext = NIL; - ext = __NEWARR(NIL, ((LONGINT)(1)), 1, 1, 0, (LONGINT)256); + ext = __NEWARR(NIL, 1, 1, 1, 0, 256); _o_result = ext; return _o_result; } @@ -265,8 +265,8 @@ void OPT_Init (OPS_Name name, SET opt) OPT_topScope = OPT_universe; OPT_OpenScope(0, NIL); OPT_SYSimported = 0; - __COPY(name, OPT_SelfName, ((LONGINT)(256))); - __COPY(name, OPT_topScope->name, ((LONGINT)(256))); + __COPY(name, OPT_SelfName, 256); + __COPY(name, OPT_topScope->name, 256); OPT_GlbMod[0] = OPT_topScope; OPT_nofGmod = 1; OPT_newsf = __IN(4, opt); @@ -281,13 +281,13 @@ void OPT_Close (void) OPT_CloseScope(); i = 0; while (i < 64) { - OPT_GlbMod[__X(i, ((LONGINT)(64)))] = NIL; + OPT_GlbMod[__X(i, 64)] = NIL; i += 1; } i = 16; while (i < 255) { - OPT_impCtxt.ref[__X(i, ((LONGINT)(255)))] = NIL; - OPT_impCtxt.old[__X(i, ((LONGINT)(255)))] = NIL; + OPT_impCtxt.ref[__X(i, 255)] = NIL; + OPT_impCtxt.old[__X(i, 255)] = NIL; i += 1; } } @@ -398,7 +398,7 @@ void OPT_Insert (OPS_Name name, OPT_Object *obj) } ob1->left = NIL; ob1->right = NIL; - __COPY(name, ob1->name, ((LONGINT)(256))); + __COPY(name, ob1->name, 256); mnolev = OPT_topScope->mnolev; ob1->mnolev = mnolev; break; @@ -414,7 +414,7 @@ static void OPT_FPrintName (LONGINT *fp, CHAR *name, LONGINT name__len) i = 0; do { ch = name[__X(i, name__len)]; - OPM_FPrint(&*fp, (int)ch); + OPM_FPrint(&*fp, ch); i += 1; } while (!(ch == 0x00)); } @@ -423,32 +423,32 @@ static void OPT_DebugStruct (OPT_Struct btyp) { OPM_LogWLn(); if (btyp == NIL) { - OPM_LogWStr((CHAR*)"btyp is nil", (LONGINT)12); + OPM_LogWStr((CHAR*)"btyp is nil", 12); OPM_LogWLn(); } - OPM_LogWStr((CHAR*)"btyp^.strobji^.name = ", (LONGINT)23); - OPM_LogWStr(btyp->strobj->name, ((LONGINT)(256))); + OPM_LogWStr((CHAR*)"btyp^.strobji^.name = ", 23); + OPM_LogWStr(btyp->strobj->name, 256); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.form = ", (LONGINT)14); - OPM_LogWNum(btyp->form, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.form = ", 14); + OPM_LogWNum(btyp->form, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.comp = ", (LONGINT)14); - OPM_LogWNum(btyp->comp, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.comp = ", 14); + OPM_LogWNum(btyp->comp, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.mno = ", (LONGINT)13); - OPM_LogWNum(btyp->mno, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.mno = ", 13); + OPM_LogWNum(btyp->mno, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.extlev = ", (LONGINT)16); - OPM_LogWNum(btyp->extlev, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.extlev = ", 16); + OPM_LogWNum(btyp->extlev, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.size = ", (LONGINT)14); - OPM_LogWNum(btyp->size, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.size = ", 14); + OPM_LogWNum(btyp->size, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.align = ", (LONGINT)15); - OPM_LogWNum(btyp->align, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.align = ", 15); + OPM_LogWNum(btyp->align, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.txtpos = ", (LONGINT)16); - OPM_LogWNum(btyp->txtpos, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.txtpos = ", 16); + OPM_LogWNum(btyp->txtpos, 0); OPM_LogWLn(); } @@ -480,8 +480,8 @@ void OPT_IdFPrint (OPT_Struct typ) btyp = typ->BaseTyp; strobj = typ->strobj; if ((strobj != NIL && strobj->name[0] != 0x00)) { - OPT_FPrintName(&idfp, (void*)OPT_GlbMod[__X(typ->mno, ((LONGINT)(64)))]->name, ((LONGINT)(256))); - OPT_FPrintName(&idfp, (void*)strobj->name, ((LONGINT)(256))); + OPT_FPrintName(&idfp, (void*)OPT_GlbMod[__X(typ->mno, 64)]->name, 256); + OPT_FPrintName(&idfp, (void*)strobj->name, 256); } if ((f == 13 || (c == 4 && btyp != NIL)) || c == 3) { OPT_IdFPrint(btyp); @@ -532,7 +532,7 @@ static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr) } } } else if (typ->form == 13 || __STRCMP(fld->name, "@ptr") == 0) { - OPM_FPrint(&*FPrintStr__12_s->pvfp, ((LONGINT)(13))); + OPM_FPrint(&*FPrintStr__12_s->pvfp, 13); OPM_FPrint(&*FPrintStr__12_s->pvfp, adr); OPT_nofhdfld += 1; } @@ -543,7 +543,7 @@ static void FPrintFlds__13 (OPT_Object fld, LONGINT adr, BOOLEAN visible) while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->vis); - OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)fld->name, ((LONGINT)(256))); + OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)fld->name, 256); OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->adr); OPT_FPrintStr(fld->typ); OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->typ->pbfp); @@ -561,10 +561,10 @@ static void FPrintTProcs__17 (OPT_Object obj) FPrintTProcs__17(obj->left); if (obj->mode == 13) { if (obj->vis != 0) { - OPM_FPrint(&*FPrintStr__12_s->pbfp, ((LONGINT)(13))); + OPM_FPrint(&*FPrintStr__12_s->pbfp, 13); OPM_FPrint(&*FPrintStr__12_s->pbfp, __ASHR(obj->adr, 16)); OPT_FPrintSign(&*FPrintStr__12_s->pbfp, obj->typ, obj->link); - OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)obj->name, ((LONGINT)(256))); + OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)obj->name, 256); } } FPrintTProcs__17(obj->right); @@ -618,7 +618,7 @@ void OPT_FPrintStr (OPT_Struct typ) OPM_FPrint(&pvfp, typ->align); OPM_FPrint(&pvfp, typ->n); OPT_nofhdfld = 0; - FPrintFlds__13(typ->link, ((LONGINT)(0)), 1); + FPrintFlds__13(typ->link, 0, 1); if (OPT_nofhdfld > 2048) { OPM_Mark(225, typ->txtpos); } @@ -663,7 +663,7 @@ void OPT_FPrintObj (OPT_Object obj) OPM_FPrintLReal(&fprint, obj->conval->realval); break; case 10: - OPT_FPrintName(&fprint, (void*)*obj->conval->ext, ((LONGINT)(256))); + OPT_FPrintName(&fprint, (void*)*obj->conval->ext, 256); break; case 11: break; @@ -680,11 +680,11 @@ void OPT_FPrintObj (OPT_Object obj) } else if (obj->mode == 9) { OPT_FPrintSign(&fprint, obj->typ, obj->link); ext = obj->conval->ext; - m = (int)(*ext)[0]; + m = (*ext)[0]; f = 1; OPM_FPrint(&fprint, m); while (f <= m) { - OPM_FPrint(&fprint, (int)(*ext)[__X(f, ((LONGINT)(256)))]); + OPM_FPrint(&fprint, (*ext)[__X(f, 256)]); f += 1; } } else if (obj->mode == 5) { @@ -700,22 +700,22 @@ void OPT_FPrintErr (OPT_Object obj, INTEGER errcode) INTEGER i, j; CHAR ch; if (obj->mnolev != 0) { - __COPY(OPT_GlbMod[__X(-obj->mnolev, ((LONGINT)(64)))]->name, OPM_objname, ((LONGINT)(64))); + __COPY(OPT_GlbMod[__X(-obj->mnolev, 64)]->name, OPM_objname, 64); i = 0; - while (OPM_objname[__X(i, ((LONGINT)(64)))] != 0x00) { + while (OPM_objname[__X(i, 64)] != 0x00) { i += 1; } - OPM_objname[__X(i, ((LONGINT)(64)))] = '.'; + OPM_objname[__X(i, 64)] = '.'; j = 0; i += 1; do { - ch = obj->name[__X(j, ((LONGINT)(256)))]; - OPM_objname[__X(i, ((LONGINT)(64)))] = ch; + ch = obj->name[__X(j, 256)]; + OPM_objname[__X(i, 64)] = ch; j += 1; i += 1; } while (!(ch == 0x00)); } else { - __COPY(obj->name, OPM_objname, ((LONGINT)(64))); + __COPY(obj->name, OPM_objname, 64); } if (errcode == 249) { if (OPM_noerr) { @@ -808,12 +808,12 @@ static void OPT_InMod (SHORTINT *mno) *mno = OPT_impCtxt.glbmno[0]; } else { if (mn == 16) { - OPT_InName((void*)name, ((LONGINT)(256))); + OPT_InName((void*)name, 256); if ((__STRCMP(name, OPT_SelfName) == 0 && !OPT_impCtxt.self)) { OPT_err(154); } i = 0; - while ((i < OPT_nofGmod && __STRCMP(name, OPT_GlbMod[__X(i, ((LONGINT)(64)))]->name) != 0)) { + while ((i < OPT_nofGmod && __STRCMP(name, OPT_GlbMod[__X(i, 64)]->name) != 0)) { i += 1; } if (i < OPT_nofGmod) { @@ -821,20 +821,20 @@ static void OPT_InMod (SHORTINT *mno) } else { head = OPT_NewObj(); head->mode = 12; - __COPY(name, head->name, ((LONGINT)(256))); + __COPY(name, head->name, 256); *mno = OPT_nofGmod; head->mnolev = -*mno; if (OPT_nofGmod < 64) { - OPT_GlbMod[__X(*mno, ((LONGINT)(64)))] = head; + OPT_GlbMod[__X(*mno, 64)] = head; OPT_nofGmod += 1; } else { OPT_err(227); } } - OPT_impCtxt.glbmno[__X(OPT_impCtxt.nofm, ((LONGINT)(64)))] = *mno; + OPT_impCtxt.glbmno[__X(OPT_impCtxt.nofm, 64)] = *mno; OPT_impCtxt.nofm += 1; } else { - *mno = OPT_impCtxt.glbmno[__X(-mn, ((LONGINT)(64)))]; + *mno = OPT_impCtxt.glbmno[__X(-mn, 64)]; } } } @@ -848,7 +848,7 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval) switch (f) { case 1: case 3: case 2: OPM_SymRCh(&ch); - conval->intval = (int)ch; + conval->intval = ch; break; case 4: case 5: case 6: conval->intval = OPM_SymRInt(); @@ -871,7 +871,7 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval) i = 0; do { OPM_SymRCh(&ch); - (*ext)[__X(i, ((LONGINT)(256)))] = ch; + (*ext)[__X(i, 256)] = ch; i += 1; } while (!(ch == 0x00)); conval->intval2 = i; @@ -881,8 +881,8 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval) conval->intval = 0; break; default: - OPM_LogWStr((CHAR*)"unhandled case in InConstant(), f = ", (LONGINT)37); - OPM_LogWNum(f, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in InConstant(), f = ", 37); + OPM_LogWNum(f, 0); OPM_LogWLn(); break; } @@ -910,7 +910,7 @@ static void OPT_InSign (SHORTINT mno, OPT_Struct *res, OPT_Object *par) } OPT_InStruct(&new->typ); new->adr = OPM_SymRInt(); - OPT_InName((void*)new->name, ((LONGINT)(256))); + OPT_InName((void*)new->name, 256); last = new; tag = OPM_SymRInt(); } @@ -931,7 +931,7 @@ static OPT_Object OPT_InFld (void) obj->vis = 1; } OPT_InStruct(&obj->typ); - OPT_InName((void*)obj->name, ((LONGINT)(256))); + OPT_InName((void*)obj->name, 256); obj->adr = OPM_SymRInt(); } else { obj->mode = 4; @@ -962,7 +962,7 @@ static OPT_Object OPT_InTProc (SHORTINT mno) obj->conval->intval = -1; OPT_InSign(mno, &obj->typ, &obj->link); obj->vis = 1; - OPT_InName((void*)obj->name, ((LONGINT)(256))); + OPT_InName((void*)obj->name, 256); obj->adr = __ASHL(OPM_SymRInt(), 16); } else { obj->mode = 13; @@ -983,7 +983,7 @@ static OPT_Struct OPT_InTyp (LONGINT tag) _o_result = OPT_IntType(OPM_SymRInt()); return _o_result; } else { - _o_result = OPT_impCtxt.ref[__X(tag, ((LONGINT)(255)))]; + _o_result = OPT_impCtxt.ref[__X(tag, 255)]; return _o_result; } __RETCHK; @@ -1007,23 +1007,23 @@ static void OPT_InStruct (OPT_Struct *typ) OPT_impCtxt.minr = ref; } OPT_InMod(&mno); - OPT_InName((void*)name, ((LONGINT)(256))); + OPT_InName((void*)name, 256); obj = OPT_NewObj(); if (name[0] == 0x00) { if (OPT_impCtxt.self) { old = NIL; } else { __MOVE("@", obj->name, 2); - OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->right, &old); + OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, 64)]->right, &old); obj->name[0] = 0x00; } *typ = OPT_NewStr(0, 1); } else { - __COPY(name, obj->name, ((LONGINT)(256))); - OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->right, &old); + __COPY(name, obj->name, 256); + OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, 64)]->right, &old); if (old != NIL) { OPT_FPrintObj(old); - OPT_impCtxt.pvfp[__X(ref, ((LONGINT)(255)))] = old->typ->pvfp; + OPT_impCtxt.pvfp[__X(ref, 255)] = old->typ->pvfp; if (OPT_impCtxt.self) { *typ = OPT_NewStr(0, 1); } else { @@ -1037,8 +1037,8 @@ static void OPT_InStruct (OPT_Struct *typ) *typ = OPT_NewStr(0, 1); } } - OPT_impCtxt.ref[__X(ref, ((LONGINT)(255)))] = *typ; - OPT_impCtxt.old[__X(ref, ((LONGINT)(255)))] = old; + OPT_impCtxt.ref[__X(ref, 255)] = *typ; + OPT_impCtxt.old[__X(ref, 255)] = old; (*typ)->ref = ref + 255; (*typ)->mno = mno; (*typ)->allocated = 1; @@ -1049,7 +1049,7 @@ static void OPT_InStruct (OPT_Struct *typ) obj->vis = 0; tag = OPM_SymRInt(); if (tag == 35) { - (*typ)->sysflag = (int)OPM_SymRInt(); + (*typ)->sysflag = OPM_SymRInt(); tag = OPM_SymRInt(); } switch (tag) { @@ -1117,8 +1117,8 @@ static void OPT_InStruct (OPT_Struct *typ) OPT_InSign(mno, &(*typ)->BaseTyp, &(*typ)->link); break; default: - OPM_LogWStr((CHAR*)"unhandled case at InStruct, tag = ", (LONGINT)35); - OPM_LogWNum(tag, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case at InStruct, tag = ", 35); + OPM_LogWNum(tag, 0); OPM_LogWLn(); break; } @@ -1130,7 +1130,7 @@ static void OPT_InStruct (OPT_Struct *typ) if (obj->name[0] != 0x00) { OPT_FPrintObj(obj); } - old = OPT_impCtxt.old[__X(ref, ((LONGINT)(255)))]; + old = OPT_impCtxt.old[__X(ref, 255)]; if (old != NIL) { t->strobj = old; if (OPT_impCtxt.self) { @@ -1138,13 +1138,13 @@ static void OPT_InStruct (OPT_Struct *typ) if (old->history != 5) { if (old->fprint != obj->fprint) { old->history = 2; - } else if (OPT_impCtxt.pvfp[__X(ref, ((LONGINT)(255)))] != t->pvfp) { + } else if (OPT_impCtxt.pvfp[__X(ref, 255)] != t->pvfp) { old->history = 3; } } } else if (old->fprint != obj->fprint) { old->history = 2; - } else if (OPT_impCtxt.pvfp[__X(ref, ((LONGINT)(255)))] != t->pvfp) { + } else if (OPT_impCtxt.pvfp[__X(ref, 255)] != t->pvfp) { old->history = 3; } else if (old->vis == 0) { old->history = 1; @@ -1152,7 +1152,7 @@ static void OPT_InStruct (OPT_Struct *typ) old->history = 0; } } else { - if (OPT_impCtxt.pvfp[__X(ref, ((LONGINT)(255)))] != t->pvfp) { + if (OPT_impCtxt.pvfp[__X(ref, 255)] != t->pvfp) { old->history = 5; } if (old->fprint != obj->fprint) { @@ -1211,17 +1211,17 @@ static OPT_Object OPT_InObj (SHORTINT mno) obj->mode = 9; ext = OPT_NewExt(); obj->conval->ext = ext; - s = (int)OPM_SymRInt(); + s = OPM_SymRInt(); (*ext)[0] = (CHAR)s; i = 1; while (i <= s) { - OPM_SymRCh(&(*ext)[__X(i, ((LONGINT)(256)))]); + OPM_SymRCh(&(*ext)[__X(i, 256)]); i += 1; } break; default: - OPM_LogWStr((CHAR*)"unhandled case at InObj, tag = ", (LONGINT)32); - OPM_LogWNum(tag, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case at InObj, tag = ", 32); + OPM_LogWNum(tag, 0); OPM_LogWLn(); break; } @@ -1235,14 +1235,14 @@ static OPT_Object OPT_InObj (SHORTINT mno) } OPT_InStruct(&obj->typ); } - OPT_InName((void*)obj->name, ((LONGINT)(256))); + OPT_InName((void*)obj->name, 256); } OPT_FPrintObj(obj); if ((obj->mode == 1 && (obj->typ->strobj == NIL || obj->typ->strobj->name[0] == 0x00))) { OPM_FPrint(&OPT_impCtxt.reffp, obj->typ->ref - 255); } if (tag != 19) { - OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->right, &old); + OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, 64)]->right, &old); if (OPT_impCtxt.self) { if (old != NIL) { if (old->vis == 0) { @@ -1293,7 +1293,7 @@ void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) OPT_impCtxt.nofm = 0; OPT_impCtxt.self = __STRCMP(aliasName, "@self") == 0; OPT_impCtxt.reffp = 0; - OPM_OldSym((void*)name, ((LONGINT)(256)), &*done); + OPM_OldSym((void*)name, 256, &*done); if (*done) { OPT_InMod(&mno); OPT_impCtxt.nextTag = OPM_SymRInt(); @@ -1303,8 +1303,8 @@ void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) } OPT_Insert(aliasName, &obj); obj->mode = 11; - obj->scope = OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->right; - OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->link = obj; + obj->scope = OPT_GlbMod[__X(mno, 64)]->right; + OPT_GlbMod[__X(mno, 64)]->link = obj; obj->mnolev = -mno; obj->typ = OPT_notyp; OPM_CloseOldSym(); @@ -1332,13 +1332,13 @@ static void OPT_OutName (CHAR *name, LONGINT name__len) static void OPT_OutMod (INTEGER mno) { - if (OPT_expCtxt.locmno[__X(mno, ((LONGINT)(64)))] < 0) { - OPM_SymWInt(((LONGINT)(16))); - OPT_expCtxt.locmno[__X(mno, ((LONGINT)(64)))] = OPT_expCtxt.nofm; + if (OPT_expCtxt.locmno[__X(mno, 64)] < 0) { + OPM_SymWInt(16); + OPT_expCtxt.locmno[__X(mno, 64)] = OPT_expCtxt.nofm; OPT_expCtxt.nofm += 1; - OPT_OutName((void*)OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->name, ((LONGINT)(256))); + OPT_OutName((void*)OPT_GlbMod[__X(mno, 64)]->name, 256); } else { - OPM_SymWInt(-OPT_expCtxt.locmno[__X(mno, ((LONGINT)(64)))]); + OPM_SymWInt(-OPT_expCtxt.locmno[__X(mno, 64)]); } } @@ -1368,7 +1368,7 @@ static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, LONGINT adr) } } } else if (typ->form == 13 || __STRCMP(fld->name, "@ptr") == 0) { - OPM_SymWInt(((LONGINT)(27))); + OPM_SymWInt(27); OPM_SymWInt(adr); OPT_nofhdfld += 1; } @@ -1379,12 +1379,12 @@ static void OPT_OutFlds (OPT_Object fld, LONGINT adr, BOOLEAN visible) while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { if (fld->vis == 2) { - OPM_SymWInt(((LONGINT)(26))); + OPM_SymWInt(26); } else { - OPM_SymWInt(((LONGINT)(25))); + OPM_SymWInt(25); } OPT_OutStr(fld->typ); - OPT_OutName((void*)fld->name, ((LONGINT)(256))); + OPT_OutName((void*)fld->name, 256); OPM_SymWInt(fld->adr); } else { OPT_OutHdFld(fld->typ, fld, fld->adr + adr); @@ -1398,16 +1398,16 @@ static void OPT_OutSign (OPT_Struct result, OPT_Object par) OPT_OutStr(result); while (par != NIL) { if (par->mode == 1) { - OPM_SymWInt(((LONGINT)(23))); + OPM_SymWInt(23); } else { - OPM_SymWInt(((LONGINT)(24))); + OPM_SymWInt(24); } OPT_OutStr(par->typ); OPM_SymWInt(par->adr); - OPT_OutName((void*)par->name, ((LONGINT)(256))); + OPT_OutName((void*)par->name, 256); par = par->link; } - OPM_SymWInt(((LONGINT)(18))); + OPM_SymWInt(18); } static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj) @@ -1420,12 +1420,12 @@ static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj) } if (obj->vis != 0) { if (obj->vis != 0) { - OPM_SymWInt(((LONGINT)(29))); + OPM_SymWInt(29); OPT_OutSign(obj->typ, obj->link); - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); OPM_SymWInt(__ASHR(obj->adr, 16)); } else { - OPM_SymWInt(((LONGINT)(30))); + OPM_SymWInt(30); OPM_SymWInt(__ASHR(obj->adr, 16)); } } @@ -1443,7 +1443,7 @@ static void OPT_OutStr (OPT_Struct typ) OPM_SymWInt(typ->size); } } else { - OPM_SymWInt(((LONGINT)(34))); + OPM_SymWInt(34); typ->ref = OPT_expCtxt.ref; OPT_expCtxt.ref += 1; if (OPT_expCtxt.ref >= 255) { @@ -1452,7 +1452,7 @@ static void OPT_OutStr (OPT_Struct typ) OPT_OutMod(typ->mno); strobj = typ->strobj; if ((strobj != NIL && strobj->name[0] != 0x00)) { - OPT_OutName((void*)strobj->name, ((LONGINT)(256))); + OPT_OutName((void*)strobj->name, 256); switch (strobj->history) { case 2: OPT_FPrintErr(strobj, 252); @@ -1470,31 +1470,31 @@ static void OPT_OutStr (OPT_Struct typ) OPM_SymWCh(0x00); } if (typ->sysflag != 0) { - OPM_SymWInt(((LONGINT)(35))); + OPM_SymWInt(35); OPM_SymWInt(typ->sysflag); } switch (typ->form) { case 13: - OPM_SymWInt(((LONGINT)(36))); + OPM_SymWInt(36); OPT_OutStr(typ->BaseTyp); break; case 14: - OPM_SymWInt(((LONGINT)(40))); + OPM_SymWInt(40); OPT_OutSign(typ->BaseTyp, typ->link); break; case 15: switch (typ->comp) { case 2: - OPM_SymWInt(((LONGINT)(37))); + OPM_SymWInt(37); OPT_OutStr(typ->BaseTyp); OPM_SymWInt(typ->n); break; case 3: - OPM_SymWInt(((LONGINT)(38))); + OPM_SymWInt(38); OPT_OutStr(typ->BaseTyp); break; case 4: - OPM_SymWInt(((LONGINT)(39))); + OPM_SymWInt(39); if (typ->BaseTyp == NIL) { OPT_OutStr(OPT_notyp); } else { @@ -1504,23 +1504,23 @@ static void OPT_OutStr (OPT_Struct typ) OPM_SymWInt(typ->align); OPM_SymWInt(typ->n); OPT_nofhdfld = 0; - OPT_OutFlds(typ->link, ((LONGINT)(0)), 1); + OPT_OutFlds(typ->link, 0, 1); if (OPT_nofhdfld > 2048) { OPM_Mark(223, typ->txtpos); } OPT_OutTProcs(typ, typ->link); - OPM_SymWInt(((LONGINT)(18))); + OPM_SymWInt(18); break; default: - OPM_LogWStr((CHAR*)"unhandled case at OutStr, typ^.comp = ", (LONGINT)39); - OPM_LogWNum(typ->comp, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case at OutStr, typ^.comp = ", 39); + OPM_LogWNum(typ->comp, 0); OPM_LogWLn(); break; } break; default: - OPM_LogWStr((CHAR*)"unhandled case at OutStr, typ^.form = ", (LONGINT)39); - OPM_LogWNum(typ->form, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case at OutStr, typ^.form = ", 39); + OPM_LogWNum(typ->form, 0); OPM_LogWLn(); break; } @@ -1552,7 +1552,7 @@ static void OPT_OutConstant (OPT_Object obj) OPM_SymWLReal(obj->conval->realval); break; case 10: - OPT_OutName((void*)*obj->conval->ext, ((LONGINT)(256))); + OPT_OutName((void*)*obj->conval->ext, 256); break; case 11: break; @@ -1585,64 +1585,64 @@ static void OPT_OutObj (OPT_Object obj) OPT_FPrintErr(obj, 251); break; default: - OPM_LogWStr((CHAR*)"unhandled case at OutObj, obj^.history = ", (LONGINT)42); - OPM_LogWNum(obj->history, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case at OutObj, obj^.history = ", 42); + OPM_LogWNum(obj->history, 0); OPM_LogWLn(); break; } switch (obj->mode) { case 3: OPT_OutConstant(obj); - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); break; case 5: if (obj->typ->strobj == obj) { - OPM_SymWInt(((LONGINT)(19))); + OPM_SymWInt(19); OPT_OutStr(obj->typ); } else { - OPM_SymWInt(((LONGINT)(20))); + OPM_SymWInt(20); OPT_OutStr(obj->typ); - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); } break; case 1: if (obj->vis == 2) { - OPM_SymWInt(((LONGINT)(22))); + OPM_SymWInt(22); } else { - OPM_SymWInt(((LONGINT)(21))); + OPM_SymWInt(21); } OPT_OutStr(obj->typ); - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); if (obj->typ->strobj == NIL || obj->typ->strobj->name[0] == 0x00) { OPM_FPrint(&OPT_expCtxt.reffp, obj->typ->ref); } break; case 7: - OPM_SymWInt(((LONGINT)(31))); + OPM_SymWInt(31); OPT_OutSign(obj->typ, obj->link); - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); break; case 10: - OPM_SymWInt(((LONGINT)(32))); + OPM_SymWInt(32); OPT_OutSign(obj->typ, obj->link); - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); break; case 9: - OPM_SymWInt(((LONGINT)(33))); + OPM_SymWInt(33); OPT_OutSign(obj->typ, obj->link); ext = obj->conval->ext; - j = (int)(*ext)[0]; + j = (*ext)[0]; i = 1; OPM_SymWInt(j); while (i <= j) { - OPM_SymWCh((*ext)[__X(i, ((LONGINT)(256)))]); + OPM_SymWCh((*ext)[__X(i, 256)]); i += 1; } - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); break; default: - OPM_LogWStr((CHAR*)"unhandled case at OutObj, obj.mode = ", (LONGINT)38); - OPM_LogWNum(obj->mode, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case at OutObj, obj.mode = ", 38); + OPM_LogWNum(obj->mode, 0); OPM_LogWLn(); break; } @@ -1663,17 +1663,17 @@ void OPT_Export (BOOLEAN *ext, BOOLEAN *new) OPT_Import((CHAR*)"@self", OPT_SelfName, &done); OPT_nofGmod = nofmod; if (OPM_noerr) { - OPM_NewSym((void*)OPT_SelfName, ((LONGINT)(256))); + OPM_NewSym((void*)OPT_SelfName, 256); if (OPM_noerr) { - OPM_SymWInt(((LONGINT)(16))); - OPT_OutName((void*)OPT_SelfName, ((LONGINT)(256))); + OPM_SymWInt(16); + OPT_OutName((void*)OPT_SelfName, 256); OPT_expCtxt.reffp = 0; OPT_expCtxt.ref = 16; OPT_expCtxt.nofm = 1; OPT_expCtxt.locmno[0] = 0; i = 1; while (i < 64) { - OPT_expCtxt.locmno[__X(i, ((LONGINT)(64)))] = -1; + OPT_expCtxt.locmno[__X(i, 64)] = -1; i += 1; } OPT_OutObj(OPT_topScope->right); @@ -1874,11 +1874,11 @@ export void *OPT__init(void) OPT_EnterTyp((CHAR*)"SET", 9, OPM_SetSize, &OPT_settyp); OPT_EnterTyp((CHAR*)"REAL", 7, OPM_RealSize, &OPT_realtyp); OPT_EnterTyp((CHAR*)"INTEGER", 5, OPM_IntSize, &OPT_inttyp); - OPT_EnterTyp((CHAR*)"LONGINT", 6, OPM_LIntSize, &OPT_linttyp); + OPT_EnterTyp((CHAR*)"LONGINT", 5, OPM_LIntSize, &OPT_linttyp); OPT_EnterTyp((CHAR*)"LONGREAL", 8, OPM_LRealSize, &OPT_lrltyp); OPT_EnterTyp((CHAR*)"SHORTINT", 4, OPM_SIntSize, &OPT_sinttyp); - OPT_EnterBoolConst((CHAR*)"FALSE", ((LONGINT)(0))); - OPT_EnterBoolConst((CHAR*)"TRUE", ((LONGINT)(1))); + OPT_EnterBoolConst((CHAR*)"FALSE", 0); + OPT_EnterBoolConst((CHAR*)"TRUE", 1); OPT_EnterProc((CHAR*)"HALT", 0); OPT_EnterProc((CHAR*)"NEW", 1); OPT_EnterProc((CHAR*)"ABS", 2); diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index f6206e42..3e352ca3 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index 03b675a9..75adb37c 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPC.h" #include "OPM.h" @@ -36,9 +36,10 @@ static void OPV_Len (OPT_Node n, LONGINT dim); export void OPV_Module (OPT_Node prog); static LONGINT OPV_NaturalAlignment (LONGINT size, LONGINT max); static void OPV_NewArr (OPT_Node d, OPT_Node x); +static void OPV_ParIntLiteral (LONGINT n, LONGINT size); static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, INTEGER comp); static BOOLEAN OPV_SideEffects (OPT_Node n); -static void OPV_SizeCast (LONGINT size); +static void OPV_SizeCast (LONGINT from, LONGINT to); static void OPV_Stamp (OPS_Name s); static OPT_Object OPV_SuperProc (OPT_Node n); static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported); @@ -86,7 +87,7 @@ void OPV_TypSize (OPT_Struct typ) base = OPC_SizeAlignment(OPM_RecSize); } else { OPV_TypSize(btyp); - offset = btyp->size - (int)__ASHR(btyp->sysflag, 8); + offset = btyp->size - __ASHR(btyp->sysflag, 8); base = btyp->align; } fld = typ->link; @@ -117,7 +118,7 @@ void OPV_TypSize (OPT_Struct typ) } typ->size = offset; typ->align = base; - typ->sysflag = __MASK(typ->sysflag, -256) + (int)__ASHL(offset - off0, 8); + typ->sysflag = __MASK(typ->sysflag, -256) + __ASHL(offset - off0, 8); } else if (c == 2) { OPV_TypSize(typ->BaseTyp); typ->size = typ->n * typ->BaseTyp->size; @@ -196,27 +197,27 @@ static void OPV_Stamp (OPS_Name s) OPV_stamp += 1; i = 0; j = OPV_stamp; - while (s[__X(i, ((LONGINT)(256)))] != 0x00) { + while (s[__X(i, 256)] != 0x00) { i += 1; } if (i > 25) { i = 25; } - s[__X(i, ((LONGINT)(256)))] = '_'; - s[__X(i + 1, ((LONGINT)(256)))] = '_'; + s[__X(i, 256)] = '_'; + s[__X(i + 1, 256)] = '_'; i += 2; k = 0; do { - n[__X(k, ((LONGINT)(10)))] = (CHAR)((int)__MOD(j, 10) + 48); + n[__X(k, 10)] = (CHAR)((int)__MOD(j, 10) + 48); j = __DIV(j, 10); k += 1; } while (!(j == 0)); do { k -= 1; - s[__X(i, ((LONGINT)(256)))] = n[__X(k, ((LONGINT)(10)))]; + s[__X(i, 256)] = n[__X(k, 10)]; i += 1; } while (!(k == 0)); - s[__X(i, ((LONGINT)(256)))] = 0x00; + s[__X(i, 256)] = 0x00; } static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported) @@ -258,7 +259,7 @@ static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exporte } scope = obj->scope; scope->leaf = 1; - __COPY(obj->name, scope->name, ((LONGINT)(256))); + __COPY(obj->name, scope->name, 256); OPV_Stamp(scope->name); if (mode == 9) { obj->adr = 1; @@ -338,8 +339,8 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN return _o_result; break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Nmop, subclass = ", (LONGINT)55); - OPM_LogWNum(subclass, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Nmop, subclass = ", 55); + OPM_LogWNum(subclass, 0); OPM_LogWLn(); break; } @@ -408,8 +409,8 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN return _o_result; break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Ndop, subclass = ", (LONGINT)55); - OPM_LogWNum(subclass, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Ndop, subclass = ", 55); + OPM_LogWNum(subclass, 0); OPM_LogWLn(); break; } @@ -423,8 +424,8 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN return _o_result; break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence, class = ", (LONGINT)43); - OPM_LogWNum(class, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence, class = ", 43); + OPM_LogWNum(class, 0); OPM_LogWLn(); break; } @@ -439,7 +440,7 @@ static void OPV_Len (OPT_Node n, LONGINT dim) } if ((n->class == 3 && n->typ->comp == 3)) { OPV_design(n->left, 10); - OPM_WriteString((CHAR*)"->len[", (LONGINT)7); + OPM_WriteString((CHAR*)"->len[", 7); OPM_WriteInt(dim); OPM_Write(']'); } else { @@ -463,7 +464,7 @@ static BOOLEAN OPV_SideEffects (OPT_Node n) static void OPV_Entier (OPT_Node n, INTEGER prec) { if (__IN(n->typ->form, 0x0180)) { - OPM_WriteString((CHAR*)"__ENTIER(", (LONGINT)10); + OPM_WriteString((CHAR*)"__ENTIER(", 10); OPV_expr(n, -1); OPM_Write(')'); } else { @@ -471,12 +472,28 @@ static void OPV_Entier (OPT_Node n, INTEGER prec) } } -static void OPV_SizeCast (LONGINT size) +static void OPV_SizeCast (LONGINT from, LONGINT to) { - if (size <= 4) { - OPM_WriteString((CHAR*)"(int)", (LONGINT)6); - } else { - OPM_WriteString((CHAR*)"(SYSTEM_INT64)", (LONGINT)15); + if ((from != to && (from > 4 || to > 4))) { + switch (to) { + case 1: + OPM_WriteString((CHAR*)"(SYSTEM_INT8)", 14); + break; + case 2: + OPM_WriteString((CHAR*)"(SYSTEM_INT16)", 15); + break; + case 4: + OPM_WriteString((CHAR*)"(SYSTEM_INT32)", 15); + break; + case 8: + OPM_WriteString((CHAR*)"(SYSTEM_INT64)", 15); + break; + default: + OPM_LogWStr((CHAR*)"Unhandled case in OPC.SizeCast, to = ", 38); + OPM_LogWNum(to, 1); + OPM_LogWLn(); + break; + } } } @@ -486,29 +503,27 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec) from = n->typ->form; to = newtype->form; if (to == 9) { - OPM_WriteString((CHAR*)"__SETOF(", (LONGINT)9); + OPM_WriteString((CHAR*)"__SETOF(", 9); OPV_Entier(n, -1); OPM_Write(')'); } else if (__IN(to, 0x70)) { if ((newtype->size < n->typ->size && __IN(2, OPM_opt))) { - OPM_WriteString((CHAR*)"__SHORT", (LONGINT)8); + OPM_WriteString((CHAR*)"__SHORT", 8); if (OPV_SideEffects(n)) { OPM_Write('F'); } OPM_Write('('); OPV_Entier(n, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(OPM_SignedMaximum(newtype->size) + 1); OPM_Write(')'); } else { - if (newtype->size != n->typ->size) { - OPV_SizeCast(newtype->size); - } + OPV_SizeCast(n->typ->size, newtype->size); OPV_Entier(n, 9); } } else if (to == 3) { if (__IN(2, OPM_opt)) { - OPM_WriteString((CHAR*)"__CHR", (LONGINT)6); + OPM_WriteString((CHAR*)"__CHR", 6); if (OPV_SideEffects(n)) { OPM_Write('F'); } @@ -516,7 +531,7 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec) OPV_Entier(n, -1); OPM_Write(')'); } else { - OPM_WriteString((CHAR*)"(CHAR)", (LONGINT)7); + OPM_WriteString((CHAR*)"(CHAR)", 7); OPV_Entier(n, 9); } } else { @@ -527,14 +542,14 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec) static void OPV_TypeOf (OPT_Node n) { if (n->typ->form == 13) { - OPM_WriteString((CHAR*)"__TYPEOF(", (LONGINT)10); + OPM_WriteString((CHAR*)"__TYPEOF(", 10); OPV_expr(n, -1); OPM_Write(')'); } else if (__IN(n->class, 0x15)) { OPC_Andent(n->typ); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } else if (n->class == 3) { - OPM_WriteString((CHAR*)"__TYPEOF(", (LONGINT)10); + OPM_WriteString((CHAR*)"__TYPEOF(", 10); OPV_expr(n->left, -1); OPM_Write(')'); } else if (n->class == 5) { @@ -552,12 +567,12 @@ static void OPV_Index (OPT_Node n, OPT_Node d, INTEGER prec, INTEGER dim) OPV_expr(n->right, prec); } else { if (OPV_SideEffects(n->right)) { - OPM_WriteString((CHAR*)"__XF(", (LONGINT)6); + OPM_WriteString((CHAR*)"__XF(", 6); } else { - OPM_WriteString((CHAR*)"__X(", (LONGINT)5); + OPM_WriteString((CHAR*)"__X(", 5); } OPV_expr(n->right, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_Len(d, dim); OPM_Write(')'); } @@ -569,12 +584,12 @@ static void OPV_design (OPT_Node n, INTEGER prec) OPT_Struct typ = NIL; INTEGER class, designPrec, comp; OPT_Node d = NIL, x = NIL; - INTEGER dims, i, _for__27; + INTEGER dims, i, _for__28; comp = n->typ->comp; obj = n->obj; class = n->class; designPrec = OPV_Precedence(class, n->subcl, n->typ->form, comp); - if ((((((class == 0 && obj->mnolev > 0)) && (int)obj->mnolev != OPM_level)) && prec == 10)) { + if ((((((class == 0 && obj->mnolev > 0)) && obj->mnolev != OPM_level)) && prec == 10)) { designPrec = 9; } if (prec > designPrec) { @@ -599,7 +614,7 @@ static void OPV_design (OPT_Node n, INTEGER prec) case 2: if (n->left->class == 3) { OPV_design(n->left->left, designPrec); - OPM_WriteString((CHAR*)"->", (LONGINT)3); + OPM_WriteString((CHAR*)"->", 3); } else { OPV_design(n->left, designPrec); OPM_Write('.'); @@ -609,7 +624,7 @@ static void OPV_design (OPT_Node n, INTEGER prec) case 3: if (n->typ->comp == 3) { OPV_design(n->left, 10); - OPM_WriteString((CHAR*)"->data", (LONGINT)7); + OPM_WriteString((CHAR*)"->data", 7); } else { OPM_Write('*'); OPV_design(n->left, designPrec); @@ -636,25 +651,25 @@ static void OPV_design (OPT_Node n, INTEGER prec) while (x != d) { if (x->left != d) { OPV_Index(x, d, 7, i); - OPM_WriteString((CHAR*)" + ", (LONGINT)4); + OPM_WriteString((CHAR*)" + ", 4); OPV_Len(d, i); - OPM_WriteString((CHAR*)" * (", (LONGINT)5); + OPM_WriteString((CHAR*)" * (", 5); i -= 1; } else { OPV_Index(x, d, -1, i); } x = x->left; } - _for__27 = dims; + _for__28 = dims; i = 1; - while (i <= _for__27) { + while (i <= _for__28) { OPM_Write(')'); i += 1; } if (n->typ->comp == 3) { OPM_Write(')'); - while ((int)i < __ASHR(d->typ->size - 4, 2)) { - OPM_WriteString((CHAR*)" * ", (LONGINT)4); + while (i < __ASHR(d->typ->size - 4, 2)) { + OPM_WriteString((CHAR*)" * ", 4); OPV_Len(d, i); i += 1; } @@ -672,33 +687,33 @@ static void OPV_design (OPT_Node n, INTEGER prec) obj = n->left->obj; if (__IN(3, OPM_opt)) { if (typ->comp == 4) { - OPM_WriteString((CHAR*)"__GUARDR(", (LONGINT)10); - if ((int)obj->mnolev != OPM_level) { - OPM_WriteStringVar((void*)obj->scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"__curr->", (LONGINT)9); + OPM_WriteString((CHAR*)"__GUARDR(", 10); + if (obj->mnolev != OPM_level) { + OPM_WriteStringVar((void*)obj->scope->name, 256); + OPM_WriteString((CHAR*)"__curr->", 9); OPC_Ident(obj); } else { OPC_Ident(obj); } } else { if (typ->BaseTyp->strobj == NIL) { - OPM_WriteString((CHAR*)"__GUARDA(", (LONGINT)10); + OPM_WriteString((CHAR*)"__GUARDA(", 10); } else { - OPM_WriteString((CHAR*)"__GUARDP(", (LONGINT)10); + OPM_WriteString((CHAR*)"__GUARDP(", 10); } OPV_expr(n->left, -1); typ = typ->BaseTyp; } - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Andent(typ); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(typ->extlev); OPM_Write(')'); } else { if (typ->comp == 4) { - OPM_WriteString((CHAR*)"*(", (LONGINT)3); + OPM_WriteString((CHAR*)"*(", 3); OPC_Ident(typ->strobj); - OPM_WriteString((CHAR*)"*)", (LONGINT)3); + OPM_WriteString((CHAR*)"*)", 3); OPC_CompleteIdent(obj); } else { OPM_Write('('); @@ -711,15 +726,15 @@ static void OPV_design (OPT_Node n, INTEGER prec) case 6: if (__IN(3, OPM_opt)) { if (n->left->class == 1) { - OPM_WriteString((CHAR*)"__GUARDEQR(", (LONGINT)12); + OPM_WriteString((CHAR*)"__GUARDEQR(", 12); OPC_CompleteIdent(n->left->obj); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_TypeOf(n->left); } else { - OPM_WriteString((CHAR*)"__GUARDEQP(", (LONGINT)12); + OPM_WriteString((CHAR*)"__GUARDEQP(", 12); OPV_expr(n->left->left, -1); } - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Ident(n->left->typ->strobj); OPM_Write(')'); } else { @@ -732,8 +747,8 @@ static void OPV_design (OPT_Node n, INTEGER prec) } break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.design, class = ", (LONGINT)39); - OPM_LogWNum(class, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.design, class = ", 39); + OPM_LogWNum(class, 0); OPM_LogWLn(); break; } @@ -742,6 +757,15 @@ static void OPV_design (OPT_Node n, INTEGER prec) } } +static void OPV_ParIntLiteral (LONGINT n, LONGINT size) +{ + if (OPV_ansi) { + OPM_WriteInt(n); + } else { + OPC_IntLiteral(n, size); + } +} + static void OPV_ActualPar (OPT_Node n, OPT_Object fp) { OPT_Struct typ = NIL, aptyp = NIL; @@ -756,81 +780,75 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) if ((((mode == 2 && n->class == 11)) && n->subcl == 29)) { OPM_Write('('); OPC_Ident(n->typ->strobj); - OPM_WriteString((CHAR*)"*)", (LONGINT)3); + OPM_WriteString((CHAR*)"*)", 3); prec = 10; } if (!__IN(n->typ->comp, 0x0c)) { if (mode == 2) { if ((OPV_ansi && typ != n->typ)) { - OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(void*)", 8); } OPM_Write('&'); prec = 9; } else if (OPV_ansi) { if ((__IN(comp, 0x0c) && n->class == 7)) { - OPM_WriteString((CHAR*)"(CHAR*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(CHAR*)", 8); } else if ((((form == 13 && typ != n->typ)) && n->typ != OPT_niltyp)) { - OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(void*)", 8); } } else { if ((__IN(form, 0x0180) && __IN(n->typ->form, 0x70))) { - OPM_WriteString((CHAR*)"(double)", (LONGINT)9); - prec = 9; - } else if ((form == 6 && n->typ->form < 6)) { - OPM_WriteString((CHAR*)"(LONGINT)", (LONGINT)10); + OPM_WriteString((CHAR*)"(double)", 9); prec = 9; + } else if (__IN(form, 0x70)) { + OPV_SizeCast(n->typ->size, typ->size); } } } else if (OPV_ansi) { if ((((mode == 2 && typ != n->typ)) && prec == -1)) { - OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(void*)", 8); } } if ((((mode == 2 && n->class == 11)) && n->subcl == 29)) { OPV_expr(n->left, prec); - } else if ((((((form == 6 && n->class == 7)) && n->conval->intval <= OPM_SignedMaximum(OPM_IntSize))) && n->conval->intval >= OPM_SignedMinimum(OPM_IntSize))) { - OPM_WriteString((CHAR*)"((LONGINT)(", (LONGINT)12); - OPV_expr(n, prec); - OPM_WriteString((CHAR*)"))", (LONGINT)3); + } else if ((__IN(form, 0x70) && n->class == 7)) { + OPV_ParIntLiteral(n->conval->intval, n->typ->size); } else { OPV_expr(n, prec); } if ((comp == 4 && mode == 2)) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_TypeOf(n); } else if (comp == 3) { if (n->class == 7) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); - OPM_WriteString((CHAR*)"(LONGINT)", (LONGINT)10); - OPM_WriteInt(n->conval->intval2); + OPM_WriteString((CHAR*)", ", 3); + OPV_ParIntLiteral(n->conval->intval2, OPM_PointerSize); } else { aptyp = n->typ; dim = 0; while ((typ->comp == 3 && typ->BaseTyp->form != 1)) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_Len(n, dim); typ = typ->BaseTyp; aptyp = aptyp->BaseTyp; dim += 1; } if ((typ->comp == 3 && typ->BaseTyp->form == 1)) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); while (aptyp->comp == 3) { OPV_Len(n, dim); - OPM_WriteString((CHAR*)" * ", (LONGINT)4); + OPM_WriteString((CHAR*)" * ", 4); dim += 1; aptyp = aptyp->BaseTyp; } - OPM_WriteString((CHAR*)"((LONGINT)(", (LONGINT)12); - OPM_WriteInt(aptyp->size); - OPM_WriteString((CHAR*)"))", (LONGINT)3); + OPV_ParIntLiteral(aptyp->size, OPM_PointerSize); } } } n = n->link; fp = fp->link; if (n != NIL) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); } } OPM_Write(')'); @@ -870,9 +888,9 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPC_Constant(n->conval, form); break; case 10: - OPM_WriteString((CHAR*)"__SETRNG(", (LONGINT)10); + OPM_WriteString((CHAR*)"__SETRNG(", 10); OPV_expr(l, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(r, -1); OPM_Write(')'); break; @@ -893,16 +911,16 @@ static void OPV_expr (OPT_Node n, INTEGER prec) case 16: typ = n->obj->typ; if (l->typ->comp == 4) { - OPM_WriteString((CHAR*)"__IS(", (LONGINT)6); + OPM_WriteString((CHAR*)"__IS(", 6); OPC_TypeOf(l->obj); } else { - OPM_WriteString((CHAR*)"__ISP(", (LONGINT)7); + OPM_WriteString((CHAR*)"__ISP(", 7); OPV_expr(l, -1); typ = typ->BaseTyp; } - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Andent(typ); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(typ->extlev); OPM_Write(')'); break; @@ -912,31 +930,31 @@ static void OPV_expr (OPT_Node n, INTEGER prec) case 21: if (OPV_SideEffects(l)) { if (l->typ->form < 7) { - if (l->typ->form < 6) { - OPM_WriteString((CHAR*)"(int)", (LONGINT)6); + if (l->typ->size <= 4) { + OPM_WriteString((CHAR*)"(int)", 6); } - OPM_WriteString((CHAR*)"__ABSF(", (LONGINT)8); + OPM_WriteString((CHAR*)"__ABSF(", 8); } else { - OPM_WriteString((CHAR*)"__ABSFD(", (LONGINT)9); + OPM_WriteString((CHAR*)"__ABSFD(", 9); } } else { - OPM_WriteString((CHAR*)"__ABS(", (LONGINT)7); + OPM_WriteString((CHAR*)"__ABS(", 7); } OPV_expr(l, -1); OPM_Write(')'); break; case 22: - OPM_WriteString((CHAR*)"__CAP(", (LONGINT)7); + OPM_WriteString((CHAR*)"__CAP(", 7); OPV_expr(l, -1); OPM_Write(')'); break; case 23: - OPM_WriteString((CHAR*)"__ODD(", (LONGINT)7); + OPM_WriteString((CHAR*)"__ODD(", 7); OPV_expr(l, -1); OPM_Write(')'); break; case 24: - OPM_WriteString((CHAR*)"(LONGINT)(SYSTEM_ADRINT)", (LONGINT)25); + OPM_WriteString((CHAR*)"(SYSTEM_ADRINT)", 16); if (l->class == 1) { OPC_CompleteIdent(l->obj); } else { @@ -952,13 +970,13 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPC_Ident(n->typ->strobj); OPM_Write(')'); if (__IN(n->typ->form, 0x6000) || __IN(l->typ->form, 0x6000)) { - OPM_WriteString((CHAR*)"(SYSTEM_ADRINT)", (LONGINT)16); + OPM_WriteString((CHAR*)"(SYSTEM_ADRINT)", 16); } OPV_expr(l, exprPrec); } else { - OPM_WriteString((CHAR*)"__VAL(", (LONGINT)7); + OPM_WriteString((CHAR*)"__VAL(", 7); OPC_Ident(n->typ->strobj); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(l, -1); OPM_Write(')'); } @@ -977,84 +995,84 @@ static void OPV_expr (OPT_Node n, INTEGER prec) case 28: case 3: case 4: switch (subclass) { case 15: - OPM_WriteString((CHAR*)"__IN(", (LONGINT)6); + OPM_WriteString((CHAR*)"__IN(", 6); break; case 17: if (r->class == 7) { if (r->conval->intval >= 0) { - OPM_WriteString((CHAR*)"__ASHL(", (LONGINT)8); + OPM_WriteString((CHAR*)"__ASHL(", 8); } else { - OPM_WriteString((CHAR*)"__ASHR(", (LONGINT)8); + OPM_WriteString((CHAR*)"__ASHR(", 8); } } else if (OPV_SideEffects(r)) { - OPM_WriteString((CHAR*)"__ASHF(", (LONGINT)8); + OPM_WriteString((CHAR*)"__ASHF(", 8); } else { - OPM_WriteString((CHAR*)"__ASH(", (LONGINT)7); + OPM_WriteString((CHAR*)"__ASH(", 7); } break; case 18: - OPM_WriteString((CHAR*)"__MASK(", (LONGINT)8); + OPM_WriteString((CHAR*)"__MASK(", 8); break; case 26: - OPM_WriteString((CHAR*)"__BIT(", (LONGINT)7); + OPM_WriteString((CHAR*)"__BIT(", 7); break; case 27: if (r->class == 7) { if (r->conval->intval >= 0) { - OPM_WriteString((CHAR*)"__LSHL(", (LONGINT)8); + OPM_WriteString((CHAR*)"__LSHL(", 8); } else { - OPM_WriteString((CHAR*)"__LSHR(", (LONGINT)8); + OPM_WriteString((CHAR*)"__LSHR(", 8); } } else { - OPM_WriteString((CHAR*)"__LSH(", (LONGINT)7); + OPM_WriteString((CHAR*)"__LSH(", 7); } break; case 28: if (r->class == 7) { if (r->conval->intval >= 0) { - OPM_WriteString((CHAR*)"__ROTL(", (LONGINT)8); + OPM_WriteString((CHAR*)"__ROTL(", 8); } else { - OPM_WriteString((CHAR*)"__ROTR(", (LONGINT)8); + OPM_WriteString((CHAR*)"__ROTR(", 8); } } else { - OPM_WriteString((CHAR*)"__ROT(", (LONGINT)7); + OPM_WriteString((CHAR*)"__ROT(", 7); } break; case 3: if (OPV_SideEffects(n)) { - if (form < 6) { - OPM_WriteString((CHAR*)"(int)", (LONGINT)6); + if (n->typ->size <= 4) { + OPM_WriteString((CHAR*)"(int)", 6); } - OPM_WriteString((CHAR*)"__DIVF(", (LONGINT)8); + OPM_WriteString((CHAR*)"__DIVF(", 8); } else { - OPM_WriteString((CHAR*)"__DIV(", (LONGINT)7); + OPM_WriteString((CHAR*)"__DIV(", 7); } break; case 4: - if (form < 6) { - OPM_WriteString((CHAR*)"(int)", (LONGINT)6); + if (n->typ->size <= 4) { + OPM_WriteString((CHAR*)"(int)", 6); } if (OPV_SideEffects(n)) { - OPM_WriteString((CHAR*)"__MODF(", (LONGINT)8); + OPM_WriteString((CHAR*)"__MODF(", 8); } else { - OPM_WriteString((CHAR*)"__MOD(", (LONGINT)7); + OPM_WriteString((CHAR*)"__MOD(", 7); } break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, subclass = ", (LONGINT)40); - OPM_LogWNum(subclass, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, subclass = ", 40); + OPM_LogWNum(subclass, 0); OPM_LogWLn(); break; } OPV_expr(l, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); if ((((__IN(subclass, 0x18020000) && r->class == 7)) && r->conval->intval < 0)) { OPM_WriteInt(-r->conval->intval); } else { OPV_expr(r, -1); } if (__IN(subclass, 0x18000000)) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Ident(l->typ->strobj); } OPM_Write(')'); @@ -1062,9 +1080,9 @@ static void OPV_expr (OPT_Node n, INTEGER prec) case 9: case 10: case 11: case 12: case 13: case 14: if (__IN(l->typ->form, 0x8400)) { - OPM_WriteString((CHAR*)"__STRCMP(", (LONGINT)10); + OPM_WriteString((CHAR*)"__STRCMP(", 10); OPV_expr(l, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(r, -1); OPM_Write(')'); OPC_Cmp(subclass); @@ -1074,7 +1092,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPC_Cmp(subclass); typ = l->typ; if ((((((typ->form == 13 && r->typ->form != 11)) && r->typ != typ)) && r->typ != OPT_sysptrtyp)) { - OPM_WriteString((CHAR*)"(void *) ", (LONGINT)10); + OPM_WriteString((CHAR*)"(void *) ", 10); } OPV_expr(r, exprPrec); } @@ -1087,16 +1105,16 @@ static void OPV_expr (OPT_Node n, INTEGER prec) switch (subclass) { case 1: if (form == 9) { - OPM_WriteString((CHAR*)" & ", (LONGINT)4); + OPM_WriteString((CHAR*)" & ", 4); } else { - OPM_WriteString((CHAR*)" * ", (LONGINT)4); + OPM_WriteString((CHAR*)" * ", 4); } break; case 2: if (form == 9) { - OPM_WriteString((CHAR*)" ^ ", (LONGINT)4); + OPM_WriteString((CHAR*)" ^ ", 4); } else { - OPM_WriteString((CHAR*)" / ", (LONGINT)4); + OPM_WriteString((CHAR*)" / ", 4); if (r->obj == NIL || __IN(r->obj->typ->form, 0x70)) { OPM_Write('('); OPC_Ident(n->typ->strobj); @@ -1105,28 +1123,28 @@ static void OPV_expr (OPT_Node n, INTEGER prec) } break; case 5: - OPM_WriteString((CHAR*)" && ", (LONGINT)5); + OPM_WriteString((CHAR*)" && ", 5); break; case 6: if (form == 9) { - OPM_WriteString((CHAR*)" | ", (LONGINT)4); + OPM_WriteString((CHAR*)" | ", 4); } else { - OPM_WriteString((CHAR*)" + ", (LONGINT)4); + OPM_WriteString((CHAR*)" + ", 4); } break; case 7: if (form == 9) { - OPM_WriteString((CHAR*)" & ~", (LONGINT)5); + OPM_WriteString((CHAR*)" & ~", 5); } else { - OPM_WriteString((CHAR*)" - ", (LONGINT)4); + OPM_WriteString((CHAR*)" - ", 4); } break; case 8: - OPM_WriteString((CHAR*)" || ", (LONGINT)5); + OPM_WriteString((CHAR*)" || ", 5); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, subclass = ", (LONGINT)40); - OPM_LogWNum(subclass, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, subclass = ", 40); + OPM_LogWNum(subclass, 0); OPM_LogWLn(); break; } @@ -1142,7 +1160,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) if (l->subcl == 1) { proc = OPV_SuperProc(n); } else { - OPM_WriteString((CHAR*)"__", (LONGINT)3); + OPM_WriteString((CHAR*)"__", 3); proc = OPC_BaseTProc(l->obj); } OPC_Ident(proc); @@ -1171,7 +1189,7 @@ static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) LONGINT adr; if_ = n->left; while (if_ != NIL) { - OPM_WriteString((CHAR*)"if ", (LONGINT)4); + OPM_WriteString((CHAR*)"if ", 4); OPV_expr(if_->left, 12); OPM_Write(' '); OPC_BegBlk(); @@ -1182,9 +1200,9 @@ static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) if (typ->comp == 4) { OPC_BegStat(); OPC_Ident(if_->left->obj); - OPM_WriteString((CHAR*)" *", (LONGINT)3); - OPM_WriteString(obj->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"__ = (void*)", (LONGINT)13); + OPM_WriteString((CHAR*)" *", 3); + OPM_WriteString(obj->name, 256); + OPM_WriteString((CHAR*)"__ = (void*)", 13); obj->adr = 0; OPC_CompleteIdent(obj); OPC_EndStat(); @@ -1200,13 +1218,13 @@ static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) if_ = if_->link; if ((if_ != NIL || n->right != NIL) || withtrap) { OPC_EndBlk0(); - OPM_WriteString((CHAR*)" else ", (LONGINT)7); + OPM_WriteString((CHAR*)" else ", 7); } else { OPC_EndBlk(); } } if (withtrap) { - OPM_WriteString((CHAR*)"__WITHCHK", (LONGINT)10); + OPM_WriteString((CHAR*)"__WITHCHK", 10); OPC_EndStat(); } else if (n->right != NIL) { OPC_BegBlk(); @@ -1220,7 +1238,7 @@ static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc) OPT_Node switchCase = NIL, label = NIL; LONGINT low, high; INTEGER form, i; - OPM_WriteString((CHAR*)"switch ", (LONGINT)8); + OPM_WriteString((CHAR*)"switch ", 8); OPV_expr(n->left, 12); OPM_Write(' '); OPC_BegBlk(); @@ -1252,22 +1270,22 @@ static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc) OPC_Indent(1); OPV_stat(switchCase->right, outerProc); OPC_BegStat(); - OPM_WriteString((CHAR*)"break", (LONGINT)6); + OPM_WriteString((CHAR*)"break", 6); OPC_EndStat(); OPC_Indent(-1); switchCase = switchCase->link; } OPC_BegStat(); - OPM_WriteString((CHAR*)"default: ", (LONGINT)10); + OPM_WriteString((CHAR*)"default: ", 10); if (n->right->conval->setval != 0x0) { OPC_Indent(1); OPM_WriteLn(); OPV_stat(n->right->right, outerProc); OPC_BegStat(); - OPM_WriteString((CHAR*)"break", (LONGINT)6); + OPM_WriteString((CHAR*)"break", 6); OPC_Indent(-1); } else { - OPM_WriteString((CHAR*)"__CASECHK", (LONGINT)10); + OPM_WriteString((CHAR*)"__CASECHK", 10); } OPC_EndStat(); OPC_EndBlk(); @@ -1297,44 +1315,40 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) base = base->BaseTyp; } OPV_design(d, -1); - OPM_WriteString((CHAR*)" = __NEWARR(", (LONGINT)13); + OPM_WriteString((CHAR*)" = __NEWARR(", 13); while (base->comp == 2) { nofdim += 1; base = base->BaseTyp; } if ((base->comp == 4 && OPC_NofPtrs(base) != 0)) { OPC_Ident(base->strobj); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } else if (base->form == 13) { - OPM_WriteString((CHAR*)"POINTER__typ", (LONGINT)13); + OPM_WriteString((CHAR*)"POINTER__typ", 13); } else { - OPM_WriteString((CHAR*)"NIL", (LONGINT)4); + OPM_WriteString((CHAR*)"NIL", 4); } - OPM_WriteString((CHAR*)", ", (LONGINT)3); - OPM_WriteString((CHAR*)"((LONGINT)(", (LONGINT)12); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(base->size); - OPM_WriteString((CHAR*)"))", (LONGINT)3); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(OPC_BaseAlignment(base)); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(nofdim); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(nofdyn); while (typ != base) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); if (typ->comp == 3) { if (x->class == 7) { - OPM_WriteString((CHAR*)"(LONGINT)(", (LONGINT)11); - OPV_expr(x, -1); - OPM_WriteString((CHAR*)")", (LONGINT)2); + OPC_IntLiteral(x->conval->intval, OPM_PointerSize); } else { - OPM_WriteString((CHAR*)"(LONGINT)", (LONGINT)10); + OPM_WriteString((CHAR*)"((SYSTEM_ADRINT)(", 18); OPV_expr(x, 10); + OPM_WriteString((CHAR*)"))", 3); } x = x->link; } else { - OPM_WriteString((CHAR*)"(LONGINT)", (LONGINT)10); - OPM_WriteInt(typ->n); + OPC_IntLiteral(typ->n, OPM_PointerSize); } typ = typ->BaseTyp; } @@ -1377,7 +1391,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPV_DefineTDescs(n->right); OPC_EnterBody(); OPV_InitTDescs(n->right); - OPM_WriteString((CHAR*)"/* BEGIN */", (LONGINT)12); + OPM_WriteString((CHAR*)"/* BEGIN */", 12); OPM_WriteLn(); OPV_stat(n->right, outerProc); OPC_ExitBody(); @@ -1403,11 +1417,11 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) l = n->left; r = n->right; if (l->typ->comp == 2) { - OPM_WriteString((CHAR*)"__MOVE(", (LONGINT)8); + OPM_WriteString((CHAR*)"__MOVE(", 8); OPV_expr(r, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(l, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); if (r->typ == OPT_stringtyp) { OPM_WriteInt(r->conval->intval2); } else { @@ -1420,13 +1434,13 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPV_design(l, -1); l->obj->adr = 1; if (r->typ->form != 11) { - OPM_WriteString((CHAR*)" = (void*)", (LONGINT)11); + OPM_WriteString((CHAR*)" = (void*)", 11); } else { - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteString((CHAR*)" = ", 4); } } else { OPV_design(l, -1); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteString((CHAR*)" = ", 4); } if (l->typ == r->typ) { OPV_expr(r, -1); @@ -1436,9 +1450,9 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPM_Write(')'); OPV_expr(r, -1); } else if (l->typ->comp == 4) { - OPM_WriteString((CHAR*)"*(", (LONGINT)3); + OPM_WriteString((CHAR*)"*(", 3); OPC_Andent(l->typ); - OPM_WriteString((CHAR*)"*)&", (LONGINT)4); + OPM_WriteString((CHAR*)"*)&", 4); OPV_expr(r, 9); } else { OPV_expr(r, -1); @@ -1447,11 +1461,11 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) break; case 1: if (n->left->typ->BaseTyp->comp == 4) { - OPM_WriteString((CHAR*)"__NEW(", (LONGINT)7); + OPM_WriteString((CHAR*)"__NEW(", 7); OPV_design(n->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Andent(n->left->typ->BaseTyp); - OPM_WriteString((CHAR*)")", (LONGINT)2); + OPM_WriteString((CHAR*)")", 2); } else if (__IN(n->left->typ->BaseTyp->comp, 0x0c)) { OPV_NewArr(n->left, n->right); } @@ -1464,43 +1478,43 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) case 15: case 16: OPV_expr(n->left, -1); OPC_SetInclude(n->subcl == 16); - OPM_WriteString((CHAR*)"__SETOF(", (LONGINT)9); + OPM_WriteString((CHAR*)"__SETOF(", 9); OPV_expr(n->right, -1); OPM_Write(')'); break; case 18: - OPM_WriteString((CHAR*)"__COPY(", (LONGINT)8); + OPM_WriteString((CHAR*)"__COPY(", 8); OPV_expr(n->right, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(n->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); - OPV_Len(n->left, ((LONGINT)(0))); + OPM_WriteString((CHAR*)", ", 3); + OPV_Len(n->left, 0); OPM_Write(')'); break; case 31: - OPM_WriteString((CHAR*)"__MOVE(", (LONGINT)8); + OPM_WriteString((CHAR*)"__MOVE(", 8); OPV_expr(n->right, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(n->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(n->right->link, -1); OPM_Write(')'); break; case 24: - OPM_WriteString((CHAR*)"__GET(", (LONGINT)7); + OPM_WriteString((CHAR*)"__GET(", 7); OPV_expr(n->right, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(n->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Ident(n->left->typ->strobj); OPM_Write(')'); break; case 25: - OPM_WriteString((CHAR*)"__PUT(", (LONGINT)7); + OPM_WriteString((CHAR*)"__PUT(", 7); OPV_expr(n->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(n->right, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Ident(n->right->typ->strobj); OPM_Write(')'); break; @@ -1508,15 +1522,15 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPM_err(200); break; case 30: - OPM_WriteString((CHAR*)"__SYSNEW(", (LONGINT)10); + OPM_WriteString((CHAR*)"__SYSNEW(", 10); OPV_design(n->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(n->right, -1); OPM_Write(')'); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, n^.subcl = ", (LONGINT)40); - OPM_LogWNum(n->subcl, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, n^.subcl = ", 40); + OPM_LogWNum(n->subcl, 0); OPM_LogWLn(); break; } @@ -1526,7 +1540,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) if (n->left->subcl == 1) { proc = OPV_SuperProc(n); } else { - OPM_WriteString((CHAR*)"__", (LONGINT)3); + OPM_WriteString((CHAR*)"__", 3); proc = OPC_BaseTProc(n->left->obj); } OPC_Ident(proc); @@ -1542,9 +1556,9 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) if (n->subcl != 32) { OPV_IfStat(n, 0, outerProc); } else if (OPV_assert) { - OPM_WriteString((CHAR*)"__ASSERT(", (LONGINT)10); + OPM_WriteString((CHAR*)"__ASSERT(", 10); OPV_expr(n->left->left->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(n->left->right->right->conval->intval); OPM_Write(')'); OPC_EndStat(); @@ -1557,7 +1571,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) break; case 22: OPV_exit.level += 1; - OPM_WriteString((CHAR*)"while ", (LONGINT)7); + OPM_WriteString((CHAR*)"while ", 7); OPV_expr(n->left, 12); OPM_Write(' '); OPC_BegBlk(); @@ -1567,11 +1581,11 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) break; case 23: OPV_exit.level += 1; - OPM_WriteString((CHAR*)"do ", (LONGINT)4); + OPM_WriteString((CHAR*)"do ", 4); OPC_BegBlk(); OPV_stat(n->left, outerProc); OPC_EndBlk0(); - OPM_WriteString((CHAR*)" while (!", (LONGINT)10); + OPM_WriteString((CHAR*)" while (!", 10); OPV_expr(n->right, 9); OPM_Write(')'); OPV_exit.level -= 1; @@ -1580,13 +1594,13 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) saved = OPV_exit; OPV_exit.level = 0; OPV_exit.label = -1; - OPM_WriteString((CHAR*)"for (;;) ", (LONGINT)10); + OPM_WriteString((CHAR*)"for (;;) ", 10); OPC_BegBlk(); OPV_stat(n->left, outerProc); OPC_EndBlk(); if (OPV_exit.label != -1) { OPC_BegStat(); - OPM_WriteString((CHAR*)"exit__", (LONGINT)7); + OPM_WriteString((CHAR*)"exit__", 7); OPM_WriteInt(OPV_exit.label); OPM_Write(':'); OPC_EndStat(); @@ -1595,39 +1609,39 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) break; case 25: if (OPV_exit.level == 0) { - OPM_WriteString((CHAR*)"break", (LONGINT)6); + OPM_WriteString((CHAR*)"break", 6); } else { if (OPV_exit.label == -1) { OPV_exit.label = OPV_nofExitLabels; OPV_nofExitLabels += 1; } - OPM_WriteString((CHAR*)"goto exit__", (LONGINT)12); + OPM_WriteString((CHAR*)"goto exit__", 12); OPM_WriteInt(OPV_exit.label); } break; case 26: if (OPM_level == 0) { if (OPV_mainprog) { - OPM_WriteString((CHAR*)"__FINI", (LONGINT)7); + OPM_WriteString((CHAR*)"__FINI", 7); } else { - OPM_WriteString((CHAR*)"__ENDMOD", (LONGINT)9); + OPM_WriteString((CHAR*)"__ENDMOD", 9); } } else { if (n->left != NIL) { - OPM_WriteString((CHAR*)"_o_result = ", (LONGINT)13); + OPM_WriteString((CHAR*)"_o_result = ", 13); if ((n->left->typ->form == 13 && n->obj->typ != n->left->typ)) { - OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(void*)", 8); OPV_expr(n->left, 10); } else { OPV_expr(n->left, -1); } - OPM_WriteString((CHAR*)";", (LONGINT)2); + OPM_WriteString((CHAR*)";", 2); OPM_WriteLn(); OPC_BegStat(); OPC_ExitProc(outerProc, 0, 0); - OPM_WriteString((CHAR*)"return _o_result", (LONGINT)17); + OPM_WriteString((CHAR*)"return _o_result", 17); } else { - OPM_WriteString((CHAR*)"return", (LONGINT)7); + OPM_WriteString((CHAR*)"return", 7); } } break; @@ -1638,8 +1652,8 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPC_Halt(n->right->conval->intval); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, n^.class = ", (LONGINT)40); - OPM_LogWNum(n->class, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, n^.class = ", 40); + OPM_LogWNum(n->class, 0); OPM_LogWLn(); break; } diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index 6926d6ac..0299d34b 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 13bb2453..273d1182 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef @@ -241,7 +241,7 @@ void Platform_Init (INTEGER argc, LONGINT argvadr) Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; Platform_ArgCount = argc; - av = (Platform_ArgVecPtr)(SYSTEM_ADRINT)argvadr; + av = __VAL(Platform_ArgVecPtr, argvadr); Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; Platform_HeapInitHeap(); @@ -253,7 +253,7 @@ BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__le CHAR buf[4096]; INTEGER res; __DUP(var, var__len, CHAR); - res = Platform_getenv(var, var__len, (void*)buf, ((LONGINT)(4096))); + res = Platform_getenv(var, var__len, (void*)buf, 4096); if ((res > 0 && res < 4096)) { __COPY(buf, val, val__len); _o_result = 1; @@ -280,8 +280,8 @@ void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { - av = (Platform_ArgVec)(SYSTEM_ADRINT)Platform_ArgVector; - __COPY(*(*av)[__X(n, ((LONGINT)(1024)))], val, val__len); + av = __VAL(Platform_ArgVec, Platform_ArgVector); + __COPY(*(*av)[__X(n, 1024)], val, val__len); } } @@ -290,17 +290,17 @@ void Platform_GetIntArg (INTEGER n, LONGINT *val) CHAR s[64]; LONGINT k, d, i; s[0] = 0x00; - Platform_GetArg(n, (void*)s, ((LONGINT)(64))); + Platform_GetArg(n, (void*)s, 64); i = 0; if (s[0] == '-') { i = 1; } k = 0; - d = (int)s[__X(i, ((LONGINT)(64)))] - 48; + d = s[__X(i, 64)] - 48; while ((d >= 0 && d <= 9)) { k = k * 10 + d; i += 1; - d = (int)s[__X(i, ((LONGINT)(64)))] - 48; + d = s[__X(i, 64)] - 48; } if (s[0] == '-') { k = -k; @@ -318,10 +318,10 @@ INTEGER Platform_ArgPos (CHAR *s, LONGINT s__len) CHAR arg[256]; __DUP(s, s__len, CHAR); i = 0; - Platform_GetArg(i, (void*)arg, ((LONGINT)(256))); + Platform_GetArg(i, (void*)arg, 256); while ((i < Platform_ArgCount && __STRCMP(s, arg) != 0)) { i += 1; - Platform_GetArg(i, (void*)arg, ((LONGINT)(256))); + Platform_GetArg(i, (void*)arg, 256); } _o_result = i; __DEL(s); @@ -334,8 +334,8 @@ void Platform_SetBadInstructionHandler (Platform_SignalHandler handler) static void Platform_YMDHMStoClock (INTEGER ye, INTEGER mo, INTEGER da, INTEGER ho, INTEGER mi, INTEGER se, LONGINT *t, LONGINT *d) { - *d = (__ASHL((int)(int)__MOD(ye, 100), 9) + __ASHL((int)(mo + 1), 5)) + (int)da; - *t = (__ASHL((int)ho, 12) + __ASHL((int)mi, 6)) + (int)se; + *d = (__ASHL((int)__MOD(ye, 100), 9) + __ASHL((mo + 1), 5)) + da; + *t = (__ASHL(ho, 12) + __ASHL(mi, 6)) + se; } void Platform_GetClock (LONGINT *t, LONGINT *d) @@ -349,14 +349,14 @@ LONGINT Platform_Time (void) LONGINT _o_result; LONGINT ms; ms = Platform_GetTickCount(); - _o_result = __MOD(ms - Platform_TimeStart, 2147483647); + _o_result = (int)__MOD(ms - Platform_TimeStart, 2147483647); return _o_result; } void Platform_Delay (LONGINT ms) { while (ms > 30000) { - Platform_sleep(((LONGINT)(30000))); + Platform_sleep(30000); ms = ms - 30000; } if (ms > 0) { @@ -559,7 +559,7 @@ INTEGER Platform_ReadBuf (LONGINT h, SYSTEM_BYTE *b, LONGINT b__len, LONGINT *n) INTEGER _o_result; INTEGER result; *n = 0; - result = Platform_readfile(h, (LONGINT)(SYSTEM_ADRINT)b, b__len, &*n); + result = Platform_readfile(h, (SYSTEM_ADRINT)b, b__len, &*n); if (result == 0) { *n = 0; _o_result = Platform_err(); @@ -664,7 +664,7 @@ INTEGER Platform_Chdir (CHAR *n, LONGINT n__len) _o_result = Platform_err(); return _o_result; } - Platform_getCurrentDirectory((void*)Platform_CWD, ((LONGINT)(4096))); + Platform_getCurrentDirectory((void*)Platform_CWD, 4096); _o_result = 0; return _o_result; } @@ -703,7 +703,7 @@ static void Platform_errposint (LONGINT l) if (l > 10) { Platform_errposint(__DIV(l, 10)); } - Platform_errch((CHAR)(48 + __MOD(l, 10))); + Platform_errch((CHAR)(48 + (int)__MOD(l, 10))); } static void Platform_errint (LONGINT l) @@ -719,37 +719,37 @@ static void Platform_DisplayHaltCode (LONGINT code) { switch (code) { case -1: - Platform_errstring((CHAR*)"Rider ReadBuf/WriteBuf transfer size longer than buffer.", (LONGINT)57); + Platform_errstring((CHAR*)"Rider ReadBuf/WriteBuf transfer size longer than buffer.", 57); break; case -2: - Platform_errstring((CHAR*)"Index out of range.", (LONGINT)20); + Platform_errstring((CHAR*)"Index out of range.", 20); break; case -3: - Platform_errstring((CHAR*)"Reached end of function without reaching RETURN.", (LONGINT)49); + Platform_errstring((CHAR*)"Reached end of function without reaching RETURN.", 49); break; case -4: - Platform_errstring((CHAR*)"CASE statement: no matching label and no ELSE.", (LONGINT)47); + Platform_errstring((CHAR*)"CASE statement: no matching label and no ELSE.", 47); break; case -5: - Platform_errstring((CHAR*)"Type guard failed.", (LONGINT)19); + Platform_errstring((CHAR*)"Type guard failed.", 19); break; case -6: - Platform_errstring((CHAR*)"Type equality failed.", (LONGINT)22); + Platform_errstring((CHAR*)"Type equality failed.", 22); break; case -7: - Platform_errstring((CHAR*)"WITH statement type guard failed.", (LONGINT)34); + Platform_errstring((CHAR*)"WITH statement type guard failed.", 34); break; case -8: - Platform_errstring((CHAR*)"SHORT: Value too large for shorter type.", (LONGINT)41); + Platform_errstring((CHAR*)"SHORT: Value too large for shorter type.", 41); break; case -9: - Platform_errstring((CHAR*)"Heap interrupted while locked, but lockdepth = 0 at unlock.", (LONGINT)60); + Platform_errstring((CHAR*)"Heap interrupted while locked, but lockdepth = 0 at unlock.", 60); break; case -15: - Platform_errstring((CHAR*)"Type descriptor size mismatch.", (LONGINT)31); + Platform_errstring((CHAR*)"Type descriptor size mismatch.", 31); break; case -20: - Platform_errstring((CHAR*)"Too many, or negative number of, elements in dynamic array.", (LONGINT)60); + Platform_errstring((CHAR*)"Too many, or negative number of, elements in dynamic array.", 60); break; default: break; @@ -763,9 +763,9 @@ void Platform_Halt (LONGINT code) if (Platform_HaltHandler != NIL) { (*Platform_HaltHandler)(code); } - Platform_errstring((CHAR*)"Terminated by Halt(", (LONGINT)20); + Platform_errstring((CHAR*)"Terminated by Halt(", 20); Platform_errint(code); - Platform_errstring((CHAR*)"). ", (LONGINT)4); + Platform_errstring((CHAR*)"). ", 4); if (code < 0) { Platform_DisplayHaltCode(code); } @@ -776,11 +776,11 @@ void Platform_Halt (LONGINT code) void Platform_AssertFail (LONGINT code) { INTEGER e; - Platform_errstring((CHAR*)"Assertion failure.", (LONGINT)19); + Platform_errstring((CHAR*)"Assertion failure.", 19); if (code != 0) { - Platform_errstring((CHAR*)" ASSERT code ", (LONGINT)14); + Platform_errstring((CHAR*)" ASSERT code ", 14); Platform_errint(code); - Platform_errstring((CHAR*)".", (LONGINT)2); + Platform_errstring((CHAR*)".", 2); } Platform_errln(); Platform_exit(__VAL(INTEGER, code)); @@ -795,7 +795,7 @@ static void Platform_TestLittleEndian (void) { INTEGER i; i = 1; - __GET((LONGINT)(SYSTEM_ADRINT)&i, Platform_LittleEndian, BOOLEAN); + __GET((SYSTEM_ADRINT)&i, Platform_LittleEndian, BOOLEAN); } __TDESC(Platform_FileIdentity, 1, 0) = {__TDFLDS("FileIdentity", 20), {-4}}; @@ -812,7 +812,7 @@ export void *Platform__init(void) Platform_TimeStart = 0; Platform_TimeStart = Platform_Time(); Platform_CWD[0] = 0x00; - Platform_getCurrentDirectory((void*)Platform_CWD, ((LONGINT)(4096))); + Platform_getCurrentDirectory((void*)Platform_CWD, 4096); Platform_PID = Platform_getpid(); Platform_SeekSet = Platform_seekset(); Platform_SeekCur = Platform_seekcur(); diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index 8bb15073..d0a62b87 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 4ee29f7d..f2a4b1e4 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -58,7 +58,7 @@ INTEGER Reals_Expo (REAL x) { INTEGER _o_result; INTEGER i; - __GET((LONGINT)(SYSTEM_ADRINT)&x + 2, i, INTEGER); + __GET((SYSTEM_ADRINT)&x + 2, i, INTEGER); _o_result = __MASK(__ASHR(i, 7), -256); return _o_result; } @@ -66,17 +66,17 @@ INTEGER Reals_Expo (REAL x) void Reals_SetExpo (REAL *x, INTEGER ex) { CHAR c; - __GET((LONGINT)(SYSTEM_ADRINT)x + 3, c, CHAR); - __PUT((LONGINT)(SYSTEM_ADRINT)x + 3, (CHAR)(__ASHL(__ASHR((int)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); - __GET((LONGINT)(SYSTEM_ADRINT)x + 2, c, CHAR); - __PUT((LONGINT)(SYSTEM_ADRINT)x + 2, (CHAR)(__MASK((int)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); + __GET((SYSTEM_ADRINT)x + 3, c, CHAR); + __PUT((SYSTEM_ADRINT)x + 3, (CHAR)(__ASHL(__ASHR(c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __GET((SYSTEM_ADRINT)x + 2, c, CHAR); + __PUT((SYSTEM_ADRINT)x + 2, (CHAR)(__MASK(c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } INTEGER Reals_ExpoL (LONGREAL x) { INTEGER _o_result; INTEGER i; - __GET((LONGINT)(SYSTEM_ADRINT)&x + 6, i, INTEGER); + __GET((SYSTEM_ADRINT)&x + 6, i, INTEGER); _o_result = __MASK(__ASHR(i, 4), -2048); return _o_result; } @@ -89,21 +89,21 @@ void Reals_ConvertL (LONGREAL x, INTEGER n, CHAR *d, LONGINT d__len) } k = 0; if (n > 9) { - i = (int)__ENTIER(x / (LONGREAL)(LONGREAL)1000000000); - j = (int)__ENTIER(x - i * (LONGREAL)1000000000); + i = (SYSTEM_INT32)__ENTIER(x / (LONGREAL)(LONGREAL)1000000000); + j = (SYSTEM_INT32)__ENTIER(x - i * (LONGREAL)1000000000); if (j < 0) { j = 0; } while (k < 9) { - d[__X(k, d__len)] = (CHAR)(__MOD(j, 10) + 48); + d[__X(k, d__len)] = (CHAR)((int)__MOD(j, 10) + 48); j = __DIV(j, 10); k += 1; } } else { - i = (int)__ENTIER(x); + i = (SYSTEM_INT32)__ENTIER(x); } - while (k < (int)n) { - d[__X(k, d__len)] = (CHAR)(__MOD(i, 10) + 48); + while (k < n) { + d[__X(k, d__len)] = (CHAR)((int)__MOD(i, 10) + 48); i = __DIV(i, 10); k += 1; } @@ -134,22 +134,22 @@ static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LO CHAR by; i = 0; l = b__len; - while ((int)i < l) { + while (i < l) { by = __VAL(CHAR, b[__X(i, b__len)]); - d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((int)by, 4)); - d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((int)by, -16)); + d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR(by, 4)); + d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK(by, -16)); i += 1; } } void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len) { - Reals_BytesToHex((void*)&y, ((LONGINT)(4)), (void*)d, d__len * ((LONGINT)(1))); + Reals_BytesToHex((void*)&y, 4, (void*)d, d__len * 1); } void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len) { - Reals_BytesToHex((void*)&x, ((LONGINT)(8)), (void*)d, d__len * ((LONGINT)(1))); + Reals_BytesToHex((void*)&x, 8, (void*)d, d__len * 1); } diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index 0a81ebf4..6eeb5a87 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index 0c372b8b..ec6697bf 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -21,7 +21,7 @@ INTEGER Strings_Length (CHAR *s, LONGINT s__len) INTEGER i; __DUP(s, s__len, CHAR); i = 0; - while (((int)i < s__len && s[__X(i, s__len)] != 0x00)) { + while ((i < s__len && s[__X(i, s__len)] != 0x00)) { i += 1; } _o_result = i; @@ -36,11 +36,11 @@ void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__ n1 = Strings_Length(dest, dest__len); n2 = Strings_Length(extra, extra__len); i = 0; - while ((i < n2 && (int)(i + n1) < dest__len)) { + while ((i < n2 && (i + n1) < dest__len)) { dest[__X(i + n1, dest__len)] = extra[__X(i, extra__len)]; i += 1; } - if ((int)(i + n1) < dest__len) { + if ((i + n1) < dest__len) { dest[__X(i + n1, dest__len)] = 0x00; } __DEL(extra); @@ -59,10 +59,10 @@ void Strings_Insert (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, Strings_Append(dest, dest__len, (void*)source, source__len); return; } - if ((int)(pos + n2) < dest__len) { + if ((pos + n2) < dest__len) { i = n1; while (i >= pos) { - if ((int)(i + n2) < dest__len) { + if ((i + n2) < dest__len) { dest[__X(i + n2, dest__len)] = dest[__X(i, dest__len)]; } i -= 1; @@ -91,7 +91,7 @@ void Strings_Delete (CHAR *s, LONGINT s__len, INTEGER pos, INTEGER n) s[__X(i - n, s__len)] = s[__X(i, s__len)]; i += 1; } - if ((int)(i - n) < s__len) { + if ((i - n) < s__len) { s[__X(i - n, s__len)] = 0x00; } } else { @@ -112,7 +112,7 @@ void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n, INTEGER len, destLen, i; __DUP(source, source__len, CHAR); len = Strings_Length(source, source__len); - destLen = (int)dest__len - 1; + destLen = dest__len - 1; if (pos < 0) { pos = 0; } @@ -121,7 +121,7 @@ void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n, return; } i = 0; - while (((((int)(pos + i) <= source__len && source[__X(pos + i, source__len)] != 0x00)) && i < n)) { + while (((((pos + i) <= source__len && source[__X(pos + i, source__len)] != 0x00)) && i < n)) { if (i < destLen) { dest[__X(i, dest__len)] = source[__X(pos + i, source__len)]; } diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index 0dbfdb8e..43656e74 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index c40f0930..129aa156 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Files.h" #include "Modules.h" @@ -231,7 +231,7 @@ static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len) Texts_FontsFont _o_result; Texts_FontsFont F = NIL; __NEW(F, Texts_FontDesc); - __COPY(name, F->name, ((LONGINT)(32))); + __COPY(name, F->name, 32); _o_result = F; return _o_result; } @@ -398,15 +398,15 @@ static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, LONGINT *msg__t e->file = ((Texts_Alien)E)->file; e->org = ((Texts_Alien)E)->org; e->span = ((Texts_Alien)E)->span; - __COPY(((Texts_Alien)E)->mod, e->mod, ((LONGINT)(32))); - __COPY(((Texts_Alien)E)->proc, e->proc, ((LONGINT)(32))); + __COPY(((Texts_Alien)E)->mod, e->mod, 32); + __COPY(((Texts_Alien)E)->proc, e->proc, 32); (*msg__).e = (Texts_Elem)e; } else __WITHCHK; } else if (__IS(msg__typ, Texts_IdentifyMsg, 1)) { if (__IS(msg__typ, Texts_IdentifyMsg, 1)) { Texts_IdentifyMsg *msg__ = (void*)msg; - __COPY(((Texts_Alien)E)->mod, (*msg__).mod, ((LONGINT)(32))); - __COPY(((Texts_Alien)E)->proc, (*msg__).proc, ((LONGINT)(32))); + __COPY(((Texts_Alien)E)->mod, (*msg__).mod, 32); + __COPY(((Texts_Alien)E)->proc, (*msg__).proc, 32); (*msg__).mod[31] = 0x01; } else __WITHCHK; } else if (__IS(msg__typ, Texts_FileMsg, 1)) { @@ -746,7 +746,7 @@ static void ReadScaleFactor__32 (void) } } while (('0' <= *Scan__31_s->ch && *Scan__31_s->ch <= '9')) { - *Scan__31_s->e = (*Scan__31_s->e * 10 + (int)*Scan__31_s->ch) - 48; + *Scan__31_s->e = (*Scan__31_s->e * 10 + *Scan__31_s->ch) - 48; Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); } } @@ -780,21 +780,21 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) } if ((('A' <= __CAP(ch) && __CAP(ch) <= 'Z') || ch == '/') || ch == '.') { do { - (*S).s[__X(i, ((LONGINT)(64)))] = ch; + (*S).s[__X(i, 64)] = ch; i += 1; Texts_Read((void*)&*S, S__typ, &ch); } while (!((((__CAP(ch) > 'Z' && ch != '_') || ('A' > __CAP(ch) && ch > '9')) || ((('0' > ch && ch != '.')) && ch != '/')) || i == 63)); - (*S).s[__X(i, ((LONGINT)(64)))] = 0x00; + (*S).s[__X(i, 64)] = 0x00; (*S).len = i; (*S).class = 1; } else if (ch == '"') { Texts_Read((void*)&*S, S__typ, &ch); while ((((ch != '"' && ch >= ' ')) && i != 63)) { - (*S).s[__X(i, ((LONGINT)(64)))] = ch; + (*S).s[__X(i, 64)] = ch; i += 1; Texts_Read((void*)&*S, S__typ, &ch); } - (*S).s[__X(i, ((LONGINT)(64)))] = 0x00; + (*S).s[__X(i, 64)] = 0x00; (*S).len = i + 1; Texts_Read((void*)&*S, S__typ, &ch); (*S).class = 2; @@ -809,7 +809,7 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) hex = 0; j = 0; for (;;) { - d[__X(i, ((LONGINT)(32)))] = ch; + d[__X(i, 32)] = ch; i += 1; Texts_Read((void*)&*S, S__typ, &ch); if (ch < '0') { @@ -818,10 +818,10 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) if ('9' < ch) { if (('A' <= ch && ch <= 'F')) { hex = 1; - ch = (CHAR)((int)ch - 7); + ch = (CHAR)(ch - 7); } else if (('a' <= ch && ch <= 'f')) { hex = 1; - ch = (CHAR)((int)ch - 39); + ch = (CHAR)(ch - 39); } else { break; } @@ -833,13 +833,13 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) if (i - j > 8) { j = i - 8; } - k = (int)d[__X(j, ((LONGINT)(32)))] - 48; + k = d[__X(j, 32)] - 48; j += 1; if ((i - j == 7 && k >= 8)) { k -= 16; } while (j < i) { - k = __ASHL(k, 4) + (int)((int)d[__X(j, ((LONGINT)(32)))] - 48); + k = __ASHL(k, 4) + (d[__X(j, 32)] - 48); j += 1; } if (neg) { @@ -851,7 +851,7 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) Texts_Read((void*)&*S, S__typ, &ch); h = i; while (('0' <= ch && ch <= '9')) { - d[__X(i, ((LONGINT)(32)))] = ch; + d[__X(i, 32)] = ch; i += 1; Texts_Read((void*)&*S, S__typ, &ch); } @@ -860,12 +860,12 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) y = (LONGREAL)0; g = (LONGREAL)1; do { - y = y * (LONGREAL)10 + ((int)d[__X(j, ((LONGINT)(32)))] - 48); + y = y * (LONGREAL)10 + (d[__X(j, 32)] - 48); j += 1; } while (!(j == h)); while (j < i) { g = g / (LONGREAL)(LONGREAL)10; - y = ((int)d[__X(j, ((LONGINT)(32)))] - 48) * g + y; + y = (d[__X(j, 32)] - 48) * g + y; j += 1; } ReadScaleFactor__32(); @@ -892,12 +892,12 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) x = (REAL)0; f = (REAL)1; do { - x = x * (REAL)10 + ((int)d[__X(j, ((LONGINT)(32)))] - 48); + x = x * (REAL)10 + (d[__X(j, 32)] - 48); j += 1; } while (!(j == h)); while (j < i) { f = f / (REAL)(REAL)10; - x = ((int)d[__X(j, ((LONGINT)(32)))] - 48) * f + x; + x = (d[__X(j, 32)] - 48) * f + x; j += 1; } if (ch == 'E') { @@ -929,7 +929,7 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) (*S).class = 3; k = 0; do { - k = k * 10 + (int)((int)d[__X(j, ((LONGINT)(32)))] - 48); + k = k * 10 + (d[__X(j, 32)] - 48); j += 1; } while (!(j == i)); if (neg) { @@ -964,8 +964,8 @@ void Texts_OpenWriter (Texts_Writer *W, LONGINT *W__typ) (*W).fnt = Texts_FontsDefault; (*W).col = 15; (*W).voff = 0; - (*W).file = Files_New((CHAR*)"", (LONGINT)1); - Files_Set(&(*W).rider, Files_Rider__typ, (*W).file, ((LONGINT)(0))); + (*W).file = Files_New((CHAR*)"", 1); + Files_Set(&(*W).rider, Files_Rider__typ, (*W).file, 0); } void Texts_SetFont (Texts_Writer *W, LONGINT *W__typ, Texts_FontsFont fnt) @@ -1053,7 +1053,7 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n) i = 0; if (x < 0) { if (x == (-2147483647-1)) { - Texts_WriteString(&*W, W__typ, (CHAR*)" -2147483648", (LONGINT)13); + Texts_WriteString(&*W, W__typ, (CHAR*)" -2147483648", 13); return; } else { n -= 1; @@ -1063,11 +1063,11 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n) x0 = x; } do { - a[__X(i, ((LONGINT)(22)))] = (CHAR)(__MOD(x0, 10) + 48); + a[__X(i, 22)] = (CHAR)((int)__MOD(x0, 10) + 48); x0 = __DIV(x0, 10); i += 1; } while (!(x0 == 0)); - while (n > (int)i) { + while (n > i) { Texts_Write(&*W, W__typ, ' '); n -= 1; } @@ -1076,7 +1076,7 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n) } do { i -= 1; - Texts_Write(&*W, W__typ, a[__X(i, ((LONGINT)(22)))]); + Texts_Write(&*W, W__typ, a[__X(i, 22)]); } while (!(i == 0)); } @@ -1090,16 +1090,16 @@ void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, LONGINT x) do { y = __MASK(x, -16); if (y < 10) { - a[__X(i, ((LONGINT)(20)))] = (CHAR)(y + 48); + a[__X(i, 20)] = (CHAR)(y + 48); } else { - a[__X(i, ((LONGINT)(20)))] = (CHAR)(y + 55); + a[__X(i, 20)] = (CHAR)(y + 55); } x = __ASHR(x, 4); i += 1; } while (!(i == 8)); do { i -= 1; - Texts_Write(&*W, W__typ, a[__X(i, ((LONGINT)(20)))]); + Texts_Write(&*W, W__typ, a[__X(i, 20)]); } while (!(i == 0)); } @@ -1110,13 +1110,13 @@ void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n) CHAR d[9]; e = Reals_Expo(x); if (e == 0) { - Texts_WriteString(&*W, W__typ, (CHAR*)" 0", (LONGINT)4); + Texts_WriteString(&*W, W__typ, (CHAR*)" 0", 4); do { Texts_Write(&*W, W__typ, ' '); n -= 1; } while (!(n <= 3)); } else if (e == 255) { - Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", (LONGINT)5); + Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", 5); while (n > 4) { Texts_Write(&*W, W__typ, ' '); n -= 1; @@ -1153,13 +1153,13 @@ void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n) x = x * 1.0000000e-001; e += 1; } - Reals_Convert(x, n, (void*)d, ((LONGINT)(9))); + Reals_Convert(x, n, (void*)d, 9); n -= 1; - Texts_Write(&*W, W__typ, d[__X(n, ((LONGINT)(9)))]); + Texts_Write(&*W, W__typ, d[__X(n, 9)]); Texts_Write(&*W, W__typ, '.'); do { n -= 1; - Texts_Write(&*W, W__typ, d[__X(n, ((LONGINT)(9)))]); + Texts_Write(&*W, W__typ, d[__X(n, 9)]); } while (!(n == 0)); Texts_Write(&*W, W__typ, 'E'); if (e < 0) { @@ -1196,7 +1196,7 @@ static void dig__54 (INTEGER n) { while (n > 0) { *WriteRealFix__53_s->i -= 1; - Texts_Write(&*WriteRealFix__53_s->W, WriteRealFix__53_s->W__typ, (*WriteRealFix__53_s->d)[__X(*WriteRealFix__53_s->i, ((LONGINT)(9)))]); + Texts_Write(&*WriteRealFix__53_s->W, WriteRealFix__53_s->W__typ, (*WriteRealFix__53_s->d)[__X(*WriteRealFix__53_s->i, 9)]); n -= 1; } } @@ -1222,7 +1222,7 @@ void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n, IN Texts_Write(&*W, W__typ, '0'); seq__56(' ', k + 1); } else if (e == 255) { - Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", (LONGINT)5); + Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", 5); seq__56(' ', n - 4); } else { e = __ASHR((e - 127) * 77, 8); @@ -1254,7 +1254,7 @@ void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n, IN } e += 1; i = k + e; - Reals_Convert(x, i, (void*)d, ((LONGINT)(9))); + Reals_Convert(x, i, (void*)d, 9); if (e > 0) { seq__56(' ', ((n - e) - k) - 2); Texts_Write(&*W, W__typ, sign); @@ -1277,10 +1277,10 @@ void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x) { INTEGER i; CHAR d[8]; - Reals_ConvertH(x, (void*)d, ((LONGINT)(8))); + Reals_ConvertH(x, (void*)d, 8); i = 0; do { - Texts_Write(&*W, W__typ, d[__X(i, ((LONGINT)(8)))]); + Texts_Write(&*W, W__typ, d[__X(i, 8)]); i += 1; } while (!(i == 8)); } @@ -1292,13 +1292,13 @@ void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER CHAR d[16]; e = Reals_ExpoL(x); if (e == 0) { - Texts_WriteString(&*W, W__typ, (CHAR*)" 0", (LONGINT)4); + Texts_WriteString(&*W, W__typ, (CHAR*)" 0", 4); do { Texts_Write(&*W, W__typ, ' '); n -= 1; } while (!(n <= 3)); } else if (e == 2047) { - Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", (LONGINT)5); + Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", 5); while (n > 4) { Texts_Write(&*W, W__typ, ' '); n -= 1; @@ -1319,7 +1319,7 @@ void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER } else { Texts_Write(&*W, W__typ, ' '); } - e = (int)__ASHR((int)(e - 1023) * 77, 8); + e = __ASHR((e - 1023) * 77, 8); if (e >= 0) { x = x / (LONGREAL)Reals_TenL(e); } else { @@ -1335,13 +1335,13 @@ void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER x = 1.00000000000000e-001 * x; e += 1; } - Reals_ConvertL(x, n, (void*)d, ((LONGINT)(16))); + Reals_ConvertL(x, n, (void*)d, 16); n -= 1; - Texts_Write(&*W, W__typ, d[__X(n, ((LONGINT)(16)))]); + Texts_Write(&*W, W__typ, d[__X(n, 16)]); Texts_Write(&*W, W__typ, '.'); do { n -= 1; - Texts_Write(&*W, W__typ, d[__X(n, ((LONGINT)(16)))]); + Texts_Write(&*W, W__typ, d[__X(n, 16)]); } while (!(n == 0)); Texts_Write(&*W, W__typ, 'D'); if (e < 0) { @@ -1361,10 +1361,10 @@ void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x) { INTEGER i; CHAR d[16]; - Reals_ConvertHL(x, (void*)d, ((LONGINT)(16))); + Reals_ConvertHL(x, (void*)d, 16); i = 0; do { - Texts_Write(&*W, W__typ, d[__X(i, ((LONGINT)(16)))]); + Texts_Write(&*W, W__typ, d[__X(i, 16)]); i += 1; } while (!(i == 16)); } @@ -1381,7 +1381,7 @@ static void WritePair__44 (CHAR ch, LONGINT x) { Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, ch); Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)(__DIV(x, 10) + 48)); - Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)(__MOD(x, 10) + 48)); + Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)((int)__MOD(x, 10) + 48)); } void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, LONGINT t, LONGINT d) @@ -1423,13 +1423,13 @@ static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, LONGINT Files_Read(&*r, r__typ, (void*)&eno); if (eno > *Load0__16_s->ecnt) { *Load0__16_s->ecnt = eno; - Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->mods)[__X(eno, ((LONGINT)(64)))], ((LONGINT)(32))); - Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->procs)[__X(eno, ((LONGINT)(64)))], ((LONGINT)(32))); + Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->mods)[__X(eno, 64)], 32); + Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->procs)[__X(eno, 64)], 32); } org = Files_Pos(&*r, r__typ); - M = Modules_ThisMod((*Load0__16_s->mods)[__X(eno, ((LONGINT)(64)))], ((LONGINT)(32))); + M = Modules_ThisMod((*Load0__16_s->mods)[__X(eno, 64)], 32); if (M != NIL) { - Cmd = Modules_ThisCommand(M, (*Load0__16_s->procs)[__X(eno, ((LONGINT)(64)))], ((LONGINT)(32))); + Cmd = Modules_ThisCommand(M, (*Load0__16_s->procs)[__X(eno, 64)], 32); if (Cmd != NIL) { (*Cmd)(); } @@ -1455,8 +1455,8 @@ static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, LONGINT a->file = *Load0__16_s->f; a->org = org; a->span = span; - __COPY((*Load0__16_s->mods)[__X(eno, ((LONGINT)(64)))], a->mod, ((LONGINT)(32))); - __COPY((*Load0__16_s->procs)[__X(eno, ((LONGINT)(64)))], a->proc, ((LONGINT)(32))); + __COPY((*Load0__16_s->mods)[__X(eno, 64)], a->mod, 32); + __COPY((*Load0__16_s->procs)[__X(eno, 64)], a->proc, 32); *e = (Texts_Elem)a; } } @@ -1500,8 +1500,8 @@ static void Texts_Load0 (Files_Rider *r, LONGINT *r__typ, Texts_Text T) while (fno != 0) { if (fno > fcnt) { fcnt = fno; - Files_ReadString(&msg.r, Files_Rider__typ, (void*)name, ((LONGINT)(32))); - fnts[__X(fno, ((LONGINT)(32)))] = Texts_FontsThis((void*)name, ((LONGINT)(32))); + Files_ReadString(&msg.r, Files_Rider__typ, (void*)name, 32); + fnts[__X(fno, 32)] = Texts_FontsThis((void*)name, 32); } Files_Read(&msg.r, Files_Rider__typ, (void*)&col); Files_Read(&msg.r, Files_Rider__typ, (void*)&voff); @@ -1556,9 +1556,9 @@ void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len) __DUP(name, name__len, CHAR); f = Files_Old(name, name__len); if (f == NIL) { - f = Files_New((CHAR*)"", (LONGINT)1); + f = Files_New((CHAR*)"", 1); } - Files_Set(&r, Files_Rider__typ, f, ((LONGINT)(0))); + Files_Set(&r, Files_Rider__typ, f, 0); Files_Read(&r, Files_Rider__typ, (void*)&tag); Files_Read(&r, Files_Rider__typ, (void*)&version); if (tag == 0xf0 || (tag == 0x01 && version == 0xf0)) { @@ -1570,7 +1570,7 @@ void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len) u->col = 15; __NEW(p, Texts_PieceDesc); if ((tag == 0xf7 && version == 0x07)) { - Files_Set(&r, Files_Rider__typ, f, ((LONGINT)(28))); + Files_Set(&r, Files_Rider__typ, f, 28); Files_ReadLInt(&r, Files_Rider__typ, &hlen); Files_Set(&r, Files_Rider__typ, f, 22 + hlen); Files_ReadLInt(&r, Files_Rider__typ, &T->len); @@ -1616,21 +1616,21 @@ static void StoreElem__40 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, Texts_E Files_Rider r1; LONGINT org, span; SHORTINT eno; - __COPY((*Store__39_s->iden).mod, (*Store__39_s->mods)[__X(*Store__39_s->ecnt, ((LONGINT)(64)))], ((LONGINT)(32))); - __COPY((*Store__39_s->iden).proc, (*Store__39_s->procs)[__X(*Store__39_s->ecnt, ((LONGINT)(64)))], ((LONGINT)(32))); + __COPY((*Store__39_s->iden).mod, (*Store__39_s->mods)[__X(*Store__39_s->ecnt, 64)], 32); + __COPY((*Store__39_s->iden).proc, (*Store__39_s->procs)[__X(*Store__39_s->ecnt, 64)], 32); eno = 1; - while (__STRCMP((*Store__39_s->mods)[__X(eno, ((LONGINT)(64)))], (*Store__39_s->iden).mod) != 0 || __STRCMP((*Store__39_s->procs)[__X(eno, ((LONGINT)(64)))], (*Store__39_s->iden).proc) != 0) { + while (__STRCMP((*Store__39_s->mods)[__X(eno, 64)], (*Store__39_s->iden).mod) != 0 || __STRCMP((*Store__39_s->procs)[__X(eno, 64)], (*Store__39_s->iden).proc) != 0) { eno += 1; } Files_Set(&r1, Files_Rider__typ, Files_Base(&*r, r__typ), Files_Pos(&*r, r__typ)); - Files_WriteLInt(&*r, r__typ, ((LONGINT)(0))); - Files_WriteLInt(&*r, r__typ, ((LONGINT)(0))); - Files_WriteLInt(&*r, r__typ, ((LONGINT)(0))); + Files_WriteLInt(&*r, r__typ, 0); + Files_WriteLInt(&*r, r__typ, 0); + Files_WriteLInt(&*r, r__typ, 0); Files_Write(&*r, r__typ, eno); if (eno == *Store__39_s->ecnt) { *Store__39_s->ecnt += 1; - Files_WriteString(&*r, r__typ, (*Store__39_s->iden).mod, ((LONGINT)(32))); - Files_WriteString(&*r, r__typ, (*Store__39_s->iden).proc, ((LONGINT)(32))); + Files_WriteString(&*r, r__typ, (*Store__39_s->iden).mod, 32); + Files_WriteString(&*r, r__typ, (*Store__39_s->iden).proc, 32); } (*Store__39_s->msg).pos = pos; org = Files_Pos(&*r, r__typ); @@ -1665,7 +1665,7 @@ void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T) org = Files_Pos(&*r, r__typ); msg.id = 1; msg.r = *r; - Files_WriteLInt(&msg.r, Files_Rider__typ, ((LONGINT)(0))); + Files_WriteLInt(&msg.r, Files_Rider__typ, 0); u = T->head->next; pos = 0; delta = 0; @@ -1679,15 +1679,15 @@ void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T) iden.mod[0] = 0x01; } if (iden.mod[0] != 0x00) { - fnts[__X(fcnt, ((LONGINT)(32)))] = u->fnt; + fnts[__X(fcnt, 32)] = u->fnt; fno = 1; - while (__STRCMP(fnts[__X(fno, ((LONGINT)(32)))]->name, u->fnt->name) != 0) { + while (__STRCMP(fnts[__X(fno, 32)]->name, u->fnt->name) != 0) { fno += 1; } Files_Write(&msg.r, Files_Rider__typ, fno); if (fno == fcnt) { fcnt += 1; - Files_WriteString(&msg.r, Files_Rider__typ, u->fnt->name, ((LONGINT)(32))); + Files_WriteString(&msg.r, Files_Rider__typ, u->fnt->name, 32); } Files_Write(&msg.r, Files_Rider__typ, u->col); Files_Write(&msg.r, Files_Rider__typ, u->voff); @@ -1736,12 +1736,12 @@ void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T) Files_Set(&r1, Files_Rider__typ, ((Texts_Piece)u)->file, ((Texts_Piece)u)->org); delta = ((Texts_Piece)u)->len; while (delta > 1024) { - Files_ReadBytes(&r1, Files_Rider__typ, (void*)block, ((LONGINT)(1024)), ((LONGINT)(1024))); - Files_WriteBytes(&msg.r, Files_Rider__typ, (void*)block, ((LONGINT)(1024)), ((LONGINT)(1024))); + Files_ReadBytes(&r1, Files_Rider__typ, (void*)block, 1024, 1024); + Files_WriteBytes(&msg.r, Files_Rider__typ, (void*)block, 1024, 1024); delta -= 1024; } - Files_ReadBytes(&r1, Files_Rider__typ, (void*)block, ((LONGINT)(1024)), delta); - Files_WriteBytes(&msg.r, Files_Rider__typ, (void*)block, ((LONGINT)(1024)), delta); + Files_ReadBytes(&r1, Files_Rider__typ, (void*)block, 1024, delta); + Files_WriteBytes(&msg.r, Files_Rider__typ, (void*)block, 1024, delta); } } else __WITHCHK; } else { @@ -1755,7 +1755,7 @@ void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T) } __GUARDEQR(r, r__typ, Files_Rider) = msg.r; if (T->notify != NIL) { - (*T->notify)(T, 3, ((LONGINT)(0)), ((LONGINT)(0))); + (*T->notify)(T, 3, 0, 0); } Store__39_s = _s.lnk; } @@ -1768,7 +1768,7 @@ void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len) CHAR bak[64]; __DUP(name, name__len, CHAR); f = Files_New(name, name__len); - Files_Set(&r, Files_Rider__typ, f, ((LONGINT)(0))); + Files_Set(&r, Files_Rider__typ, f, 0); Files_Write(&r, Files_Rider__typ, 0xf0); Files_Write(&r, Files_Rider__typ, 0x01); Texts_Store(&r, Files_Rider__typ, T); @@ -1776,13 +1776,13 @@ void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len) while (name[__X(i, name__len)] != 0x00) { i += 1; } - __COPY(name, bak, ((LONGINT)(64))); - bak[__X(i, ((LONGINT)(64)))] = '.'; - bak[__X(i + 1, ((LONGINT)(64)))] = 'B'; - bak[__X(i + 2, ((LONGINT)(64)))] = 'a'; - bak[__X(i + 3, ((LONGINT)(64)))] = 'k'; - bak[__X(i + 4, ((LONGINT)(64)))] = 0x00; - Files_Rename(name, name__len, bak, ((LONGINT)(64)), &res); + __COPY(name, bak, 64); + bak[__X(i, 64)] = '.'; + bak[__X(i + 1, 64)] = 'B'; + bak[__X(i + 2, 64)] = 'a'; + bak[__X(i + 3, 64)] = 'k'; + bak[__X(i + 4, 64)] = 0x00; + Files_Rename(name, name__len, bak, 64, &res); Files_Register(f); __DEL(name); } diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index 99931953..be79016b 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/Vishap.c b/bootstrap/windows-48/Vishap.c index e8b1e4d1..7c16c24d 100644 --- a/bootstrap/windows-48/Vishap.c +++ b/bootstrap/windows-48/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkamSf */ #include "SYSTEM.h" #include "Configuration.h" #include "Heap.h" @@ -33,31 +33,31 @@ void Vishap_Module (BOOLEAN *done) OPV_AdrAndSize(OPT_topScope); OPT_Export(&ext, &new); if (OPM_noerr) { - OPM_OpenFiles((void*)OPT_SelfName, ((LONGINT)(256))); + OPM_OpenFiles((void*)OPT_SelfName, 256); OPC_Init(); OPV_Module(p); if (OPM_noerr) { if (((OPM_mainProg || OPM_mainLinkStat) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { OPM_DeleteNewSym(); if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"32m", (LONGINT)4); + vt100_SetAttr((CHAR*)"32m", 4); } - OPM_LogWStr((CHAR*)" Main program.", (LONGINT)16); + OPM_LogWStr((CHAR*)" Main program.", 16); if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + vt100_SetAttr((CHAR*)"0m", 3); } } else { if (new) { if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"32m", (LONGINT)4); + vt100_SetAttr((CHAR*)"32m", 4); } - OPM_LogWStr((CHAR*)" New symbol file.", (LONGINT)19); + OPM_LogWStr((CHAR*)" New symbol file.", 19); if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + vt100_SetAttr((CHAR*)"0m", 3); } OPM_RegisterNewSym(); } else if (ext) { - OPM_LogWStr((CHAR*)" Extended symbol file.", (LONGINT)24); + OPM_LogWStr((CHAR*)" Extended symbol file.", 24); OPM_RegisterNewSym(); } } @@ -94,7 +94,7 @@ void Vishap_Translate (void) modulesobj[0] = 0x00; if (OPM_OpenPar()) { for (;;) { - OPM_Init(&done, (void*)Vishap_mname, ((LONGINT)(256))); + OPM_Init(&done, (void*)Vishap_mname, 256); if (!done) { return; } @@ -104,21 +104,21 @@ void Vishap_Translate (void) Vishap_Module(&done); if (!done) { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Module compilation failed.", (LONGINT)27); + OPM_LogWStr((CHAR*)"Module compilation failed.", 27); OPM_LogWLn(); Platform_Exit(1); } if (!OPM_dontAsm) { if (OPM_dontLink) { - extTools_Assemble(OPM_modName, ((LONGINT)(32))); + extTools_Assemble(OPM_modName, 32); } else { if (!(OPM_mainProg || OPM_mainLinkStat)) { - extTools_Assemble(OPM_modName, ((LONGINT)(32))); - Strings_Append((CHAR*)" ", (LONGINT)2, (void*)modulesobj, ((LONGINT)(2048))); - Strings_Append(OPM_modName, ((LONGINT)(32)), (void*)modulesobj, ((LONGINT)(2048))); - Strings_Append((CHAR*)".o", (LONGINT)3, (void*)modulesobj, ((LONGINT)(2048))); + extTools_Assemble(OPM_modName, 32); + Strings_Append((CHAR*)" ", 2, (void*)modulesobj, 2048); + Strings_Append(OPM_modName, 32, (void*)modulesobj, 2048); + Strings_Append((CHAR*)".o", 3, (void*)modulesobj, 2048); } else { - extTools_LinkMain((void*)OPM_modName, ((LONGINT)(32)), OPM_mainLinkStat, modulesobj, ((LONGINT)(2048))); + extTools_LinkMain((void*)OPM_modName, 32, OPM_mainLinkStat, modulesobj, 2048); } } } @@ -133,7 +133,7 @@ static void Vishap_Trap (INTEGER sig) Platform_Exit(0); } else { if ((sig == 4 && Platform_HaltCode == -15)) { - OPM_LogWStr((CHAR*)" --- Vishap Oberon: internal error", (LONGINT)35); + OPM_LogWStr((CHAR*)" --- Vishap Oberon: internal error", 35); OPM_LogWLn(); } Platform_Exit(2); diff --git a/bootstrap/windows-48/errors.c b/bootstrap/windows-48/errors.c index a8573f9a..7a91fc31 100644 --- a/bootstrap/windows-48/errors.c +++ b/bootstrap/windows-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/windows-48/errors.h b/bootstrap/windows-48/errors.h index 6dfe7b1d..4a787a17 100644 --- a/bootstrap/windows-48/errors.h +++ b/bootstrap/windows-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index d2141803..cfb79ac9 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" @@ -35,14 +35,14 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN Console_String(title, title__len); Console_String(cmd, cmd__len); Console_Ln(); - Console_String((CHAR*)"-- failed: status ", (LONGINT)19); - Console_Int(status, ((LONGINT)(1))); - Console_String((CHAR*)", exitcode ", (LONGINT)12); - Console_Int(exitcode, ((LONGINT)(1))); - Console_String((CHAR*)".", (LONGINT)2); + Console_String((CHAR*)"-- failed: status ", 19); + Console_Int(status, 1); + Console_String((CHAR*)", exitcode ", 12); + Console_Int(exitcode, 1); + Console_String((CHAR*)".", 2); Console_Ln(); if ((status == 0 && exitcode == 127)) { - Console_String((CHAR*)"Is the C compiler in the current command path\?", (LONGINT)47); + Console_String((CHAR*)"Is the C compiler in the current command path\?", 47); Console_Ln(); } if (status != 0) { @@ -60,11 +60,11 @@ void extTools_Assemble (CHAR *moduleName, LONGINT moduleName__len) CHAR cmd[1023]; __DUP(moduleName, moduleName__len, CHAR); __MOVE("gcc -g", cmd, 7); - Strings_Append(extTools_compilationOptions, ((LONGINT)(1023)), (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)"-c ", (LONGINT)4, (void*)cmd, ((LONGINT)(1023))); - Strings_Append(moduleName, moduleName__len, (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)".c", (LONGINT)3, (void*)cmd, ((LONGINT)(1023))); - extTools_execute((CHAR*)"Assemble: ", (LONGINT)11, cmd, ((LONGINT)(1023))); + Strings_Append(extTools_compilationOptions, 1023, (void*)cmd, 1023); + Strings_Append((CHAR*)"-c ", 4, (void*)cmd, 1023); + Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); + Strings_Append((CHAR*)".c", 3, (void*)cmd, 1023); + extTools_execute((CHAR*)"Assemble: ", 11, cmd, 1023); __DEL(moduleName); } @@ -73,21 +73,21 @@ void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN stati CHAR cmd[1023]; __DUP(additionalopts, additionalopts__len, CHAR); __MOVE("gcc -g", cmd, 7); - Strings_Append((CHAR*)" ", (LONGINT)2, (void*)cmd, ((LONGINT)(1023))); - Strings_Append(extTools_compilationOptions, ((LONGINT)(1023)), (void*)cmd, ((LONGINT)(1023))); - Strings_Append(moduleName, moduleName__len, (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)".c ", (LONGINT)4, (void*)cmd, ((LONGINT)(1023))); - Strings_Append(additionalopts, additionalopts__len, (void*)cmd, ((LONGINT)(1023))); + Strings_Append((CHAR*)" ", 2, (void*)cmd, 1023); + Strings_Append(extTools_compilationOptions, 1023, (void*)cmd, 1023); + Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); + Strings_Append((CHAR*)".c ", 4, (void*)cmd, 1023); + Strings_Append(additionalopts, additionalopts__len, (void*)cmd, 1023); if (statically) { - Strings_Append((CHAR*)"-static", (LONGINT)8, (void*)cmd, ((LONGINT)(1023))); + Strings_Append((CHAR*)"-static", 8, (void*)cmd, 1023); } - Strings_Append((CHAR*)" -o ", (LONGINT)5, (void*)cmd, ((LONGINT)(1023))); - Strings_Append(moduleName, moduleName__len, (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)" -L\"", (LONGINT)5, (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)"/opt/voc", (LONGINT)9, (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)"/lib\"", (LONGINT)6, (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)" -l voc", (LONGINT)8, (void*)cmd, ((LONGINT)(1023))); - extTools_execute((CHAR*)"Assemble and link: ", (LONGINT)20, cmd, ((LONGINT)(1023))); + Strings_Append((CHAR*)" -o ", 5, (void*)cmd, 1023); + Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); + Strings_Append((CHAR*)" -L\"", 5, (void*)cmd, 1023); + Strings_Append((CHAR*)"/opt/voc", 9, (void*)cmd, 1023); + Strings_Append((CHAR*)"/lib\"", 6, (void*)cmd, 1023); + Strings_Append((CHAR*)" -l voc", 8, (void*)cmd, 1023); + extTools_execute((CHAR*)"Assemble and link: ", 20, cmd, 1023); __DEL(additionalopts); } @@ -102,11 +102,11 @@ export void *extTools__init(void) __MODULE_IMPORT(Strings); __REGMOD("extTools", 0); /* BEGIN */ - Strings_Append((CHAR*)" -I \"", (LONGINT)6, (void*)extTools_compilationOptions, ((LONGINT)(1023))); - Strings_Append((CHAR*)"/opt/voc", (LONGINT)9, (void*)extTools_compilationOptions, ((LONGINT)(1023))); - Strings_Append((CHAR*)"/include\" ", (LONGINT)11, (void*)extTools_compilationOptions, ((LONGINT)(1023))); - Platform_GetEnv((CHAR*)"CFLAGS", (LONGINT)7, (void*)extTools_CFLAGS, ((LONGINT)(1023))); - Strings_Append(extTools_CFLAGS, ((LONGINT)(1023)), (void*)extTools_compilationOptions, ((LONGINT)(1023))); - Strings_Append((CHAR*)" ", (LONGINT)2, (void*)extTools_compilationOptions, ((LONGINT)(1023))); + Strings_Append((CHAR*)" -I \"", 6, (void*)extTools_compilationOptions, 1023); + Strings_Append((CHAR*)"/opt/voc", 9, (void*)extTools_compilationOptions, 1023); + Strings_Append((CHAR*)"/include\" ", 11, (void*)extTools_compilationOptions, 1023); + Platform_GetEnv((CHAR*)"CFLAGS", 7, (void*)extTools_CFLAGS, 1023); + Strings_Append(extTools_CFLAGS, 1023, (void*)extTools_compilationOptions, 1023); + Strings_Append((CHAR*)" ", 2, (void*)extTools_compilationOptions, 1023); __ENDMOD; } diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index 38d2da7b..fb0797f3 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/vt100.c b/bootstrap/windows-48/vt100.c index 5eb4f70e..dfe62efa 100644 --- a/bootstrap/windows-48/vt100.c +++ b/bootstrap/windows-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Strings.h" @@ -68,12 +68,12 @@ void vt100_IntToStr (LONGINT int_, CHAR *str, LONGINT str__len) } e = s; do { - b[__X(e, ((LONGINT)(21)))] = (CHAR)(__MOD(int_, 10) + 48); + b[__X(e, 21)] = (CHAR)((int)__MOD(int_, 10) + 48); int_ = __DIV(int_, 10); e += 1; } while (!(int_ == 0)); - b[__X(e, ((LONGINT)(21)))] = 0x00; - vt100_Reverse0((void*)b, ((LONGINT)(21)), s, e - 1); + b[__X(e, 21)] = 0x00; + vt100_Reverse0((void*)b, 21, s, e - 1); } __COPY(b, str, str__len); } @@ -82,9 +82,9 @@ static void vt100_EscSeq0 (CHAR *letter, LONGINT letter__len) { CHAR cmd[9]; __DUP(letter, letter__len, CHAR); - __COPY(vt100_CSI, cmd, ((LONGINT)(9))); - Strings_Append(letter, letter__len, (void*)cmd, ((LONGINT)(9))); - Console_String(cmd, ((LONGINT)(9))); + __COPY(vt100_CSI, cmd, 9); + Strings_Append(letter, letter__len, (void*)cmd, 9); + Console_String(cmd, 9); __DEL(letter); } @@ -93,11 +93,11 @@ static void vt100_EscSeq (INTEGER n, CHAR *letter, LONGINT letter__len) CHAR nstr[2]; CHAR cmd[7]; __DUP(letter, letter__len, CHAR); - vt100_IntToStr(n, (void*)nstr, ((LONGINT)(2))); - __COPY(vt100_CSI, cmd, ((LONGINT)(7))); - Strings_Append(nstr, ((LONGINT)(2)), (void*)cmd, ((LONGINT)(7))); - Strings_Append(letter, letter__len, (void*)cmd, ((LONGINT)(7))); - Console_String(cmd, ((LONGINT)(7))); + vt100_IntToStr(n, (void*)nstr, 2); + __COPY(vt100_CSI, cmd, 7); + Strings_Append(nstr, 2, (void*)cmd, 7); + Strings_Append(letter, letter__len, (void*)cmd, 7); + Console_String(cmd, 7); __DEL(letter); } @@ -106,11 +106,11 @@ static void vt100_EscSeqSwapped (INTEGER n, CHAR *letter, LONGINT letter__len) CHAR nstr[2]; CHAR cmd[7]; __DUP(letter, letter__len, CHAR); - vt100_IntToStr(n, (void*)nstr, ((LONGINT)(2))); - __COPY(vt100_CSI, cmd, ((LONGINT)(7))); - Strings_Append(letter, letter__len, (void*)cmd, ((LONGINT)(7))); - Strings_Append(nstr, ((LONGINT)(2)), (void*)cmd, ((LONGINT)(7))); - Console_String(cmd, ((LONGINT)(7))); + vt100_IntToStr(n, (void*)nstr, 2); + __COPY(vt100_CSI, cmd, 7); + Strings_Append(letter, letter__len, (void*)cmd, 7); + Strings_Append(nstr, 2, (void*)cmd, 7); + Console_String(cmd, 7); __DEL(letter); } @@ -119,124 +119,124 @@ static void vt100_EscSeq2 (INTEGER n, INTEGER m, CHAR *letter, LONGINT letter__l CHAR nstr[5], mstr[5]; CHAR cmd[12]; __DUP(letter, letter__len, CHAR); - vt100_IntToStr(n, (void*)nstr, ((LONGINT)(5))); - vt100_IntToStr(m, (void*)mstr, ((LONGINT)(5))); - __COPY(vt100_CSI, cmd, ((LONGINT)(12))); - Strings_Append(nstr, ((LONGINT)(5)), (void*)cmd, ((LONGINT)(12))); - Strings_Append((CHAR*)";", (LONGINT)2, (void*)cmd, ((LONGINT)(12))); - Strings_Append(mstr, ((LONGINT)(5)), (void*)cmd, ((LONGINT)(12))); - Strings_Append(letter, letter__len, (void*)cmd, ((LONGINT)(12))); - Console_String(cmd, ((LONGINT)(12))); + vt100_IntToStr(n, (void*)nstr, 5); + vt100_IntToStr(m, (void*)mstr, 5); + __COPY(vt100_CSI, cmd, 12); + Strings_Append(nstr, 5, (void*)cmd, 12); + Strings_Append((CHAR*)";", 2, (void*)cmd, 12); + Strings_Append(mstr, 5, (void*)cmd, 12); + Strings_Append(letter, letter__len, (void*)cmd, 12); + Console_String(cmd, 12); __DEL(letter); } void vt100_CUU (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"A", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"A", 2); } void vt100_CUD (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"B", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"B", 2); } void vt100_CUF (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"C", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"C", 2); } void vt100_CUB (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"D", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"D", 2); } void vt100_CNL (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"E", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"E", 2); } void vt100_CPL (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"F", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"F", 2); } void vt100_CHA (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"G", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"G", 2); } void vt100_CUP (INTEGER n, INTEGER m) { - vt100_EscSeq2(n, m, (CHAR*)"H", (LONGINT)2); + vt100_EscSeq2(n, m, (CHAR*)"H", 2); } void vt100_ED (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"J", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"J", 2); } void vt100_EL (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"K", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"K", 2); } void vt100_SU (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"S", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"S", 2); } void vt100_SD (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"T", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"T", 2); } void vt100_HVP (INTEGER n, INTEGER m) { - vt100_EscSeq2(n, m, (CHAR*)"f", (LONGINT)2); + vt100_EscSeq2(n, m, (CHAR*)"f", 2); } void vt100_SGR (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"m", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"m", 2); } void vt100_SGR2 (INTEGER n, INTEGER m) { - vt100_EscSeq2(n, m, (CHAR*)"m", (LONGINT)2); + vt100_EscSeq2(n, m, (CHAR*)"m", 2); } void vt100_DSR (INTEGER n) { - vt100_EscSeq(6, (CHAR*)"n", (LONGINT)2); + vt100_EscSeq(6, (CHAR*)"n", 2); } void vt100_SCP (void) { - vt100_EscSeq0((CHAR*)"s", (LONGINT)2); + vt100_EscSeq0((CHAR*)"s", 2); } void vt100_RCP (void) { - vt100_EscSeq0((CHAR*)"u", (LONGINT)2); + vt100_EscSeq0((CHAR*)"u", 2); } void vt100_DECTCEMl (void) { - vt100_EscSeq0((CHAR*)"\?25l", (LONGINT)5); + vt100_EscSeq0((CHAR*)"\?25l", 5); } void vt100_DECTCEMh (void) { - vt100_EscSeq0((CHAR*)"\?25h", (LONGINT)5); + vt100_EscSeq0((CHAR*)"\?25h", 5); } void vt100_SetAttr (CHAR *attr, LONGINT attr__len) { CHAR tmpstr[16]; __DUP(attr, attr__len, CHAR); - __COPY(vt100_CSI, tmpstr, ((LONGINT)(16))); - Strings_Append(attr, attr__len, (void*)tmpstr, ((LONGINT)(16))); - Console_String(tmpstr, ((LONGINT)(16))); + __COPY(vt100_CSI, tmpstr, 16); + Strings_Append(attr, attr__len, (void*)tmpstr, 16); + Console_String(tmpstr, 16); __DEL(attr); } @@ -252,7 +252,7 @@ export void *vt100__init(void) __REGCMD("RCP", vt100_RCP); __REGCMD("SCP", vt100_SCP); /* BEGIN */ - __COPY("\033", vt100_CSI, ((LONGINT)(5))); - Strings_Append((CHAR*)"[", (LONGINT)2, (void*)vt100_CSI, ((LONGINT)(5))); + __COPY("\033", vt100_CSI, 5); + Strings_Append((CHAR*)"[", 2, (void*)vt100_CSI, 5); __ENDMOD; } diff --git a/bootstrap/windows-48/vt100.h b/bootstrap/windows-48/vt100.h index 770cf66d..73d985c9 100644 --- a/bootstrap/windows-48/vt100.h +++ b/bootstrap/windows-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index 166df1dc..5a7e6896 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -14,6 +14,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/08/30] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/08/31] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index e30e1366..b38a0aa6 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Console.c b/bootstrap/windows-88/Console.c index 332ebd52..af2ecbd7 100644 --- a/bootstrap/windows-88/Console.c +++ b/bootstrap/windows-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Platform.h" @@ -22,7 +22,7 @@ export void Console_String (CHAR *s, LONGINT s__len); void Console_Flush (void) { INTEGER error; - error = Platform_Write(Platform_StdOut, (LONGINT)(SYSTEM_ADRINT)Console_line, Console_pos); + error = Platform_Write(Platform_StdOut, (SYSTEM_ADRINT)Console_line, Console_pos); Console_pos = 0; } @@ -31,7 +31,7 @@ void Console_Char (CHAR ch) if (Console_pos == 128) { Console_Flush(); } - Console_line[__X(Console_pos, ((LONGINT)(128)))] = ch; + Console_line[__X(Console_pos, 128)] = ch; Console_pos += 1; if (ch == 0x0a) { Console_Flush(); @@ -63,13 +63,13 @@ void Console_Int (LONGINT i, LONGINT n) i1 = __DIV(i1, 10); k = 1; while (i1 > 0) { - s[__X(k, ((LONGINT)(32)))] = (CHAR)(__MOD(i1, 10) + 48); + s[__X(k, 32)] = (CHAR)(__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k += 1; } } if (i < 0) { - s[__X(k, ((LONGINT)(32)))] = '-'; + s[__X(k, 32)] = '-'; k += 1; } while (n > k) { @@ -78,7 +78,7 @@ void Console_Int (LONGINT i, LONGINT n) } while (k > 0) { k -= 1; - Console_Char(s[__X(k, ((LONGINT)(32)))]); + Console_Char(s[__X(k, 32)]); } } @@ -90,9 +90,9 @@ void Console_Ln (void) void Console_Bool (BOOLEAN b) { if (b) { - Console_String((CHAR*)"TRUE", (LONGINT)5); + Console_String((CHAR*)"TRUE", 5); } else { - Console_String((CHAR*)"FALSE", (LONGINT)6); + Console_String((CHAR*)"FALSE", 6); } } @@ -116,7 +116,7 @@ void Console_Read (CHAR *ch) LONGINT n; INTEGER error; Console_Flush(); - error = Platform_ReadBuf(Platform_StdIn, (void*)&*ch, ((LONGINT)(1)), &n); + error = Platform_ReadBuf(Platform_StdIn, (void*)&*ch, 1, &n); if (n != 1) { *ch = 0x00; } diff --git a/bootstrap/windows-88/Console.h b/bootstrap/windows-88/Console.h index 6c86c19c..22d598fb 100644 --- a/bootstrap/windows-88/Console.h +++ b/bootstrap/windows-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 4fa9852c..5f7d65a2 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -111,23 +111,23 @@ static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INTEGER errcode) { __DUP(s, s__len, CHAR); Console_Ln(); - Console_String((CHAR*)"-- ", (LONGINT)4); + Console_String((CHAR*)"-- ", 4); Console_String(s, s__len); - Console_String((CHAR*)": ", (LONGINT)3); + Console_String((CHAR*)": ", 3); if (f != NIL) { if (f->registerName[0] != 0x00) { - Console_String(f->registerName, ((LONGINT)(101))); + Console_String(f->registerName, 101); } else { - Console_String(f->workName, ((LONGINT)(101))); + Console_String(f->workName, 101); } if (f->fd != 0) { - Console_String((CHAR*)"f.fd = ", (LONGINT)8); - Console_Int(f->fd, ((LONGINT)(1))); + Console_String((CHAR*)"f.fd = ", 8); + Console_Int(f->fd, 1); } } if (errcode != 0) { - Console_String((CHAR*)" errcode = ", (LONGINT)12); - Console_Int(errcode, ((LONGINT)(1))); + Console_String((CHAR*)" errcode = ", 12); + Console_Int(errcode, 1); } Console_Ln(); __HALT(99); @@ -217,15 +217,15 @@ static void Files_Create (Files_File f) CHAR err[32]; if (f->fd == -1) { if (f->state == 1) { - Files_GetTempName(f->registerName, ((LONGINT)(101)), (void*)f->workName, ((LONGINT)(101))); + Files_GetTempName(f->registerName, 101, (void*)f->workName, 101); f->tempFile = 1; } else if (f->state == 2) { - __COPY(f->registerName, f->workName, ((LONGINT)(101))); + __COPY(f->registerName, f->workName, 101); f->registerName[0] = 0x00; f->tempFile = 0; } - error = Platform_Unlink((void*)f->workName, ((LONGINT)(101))); - error = Platform_New((void*)f->workName, ((LONGINT)(101)), &f->fd); + error = Platform_Unlink((void*)f->workName, 101); + error = Platform_New((void*)f->workName, 101, &f->fd); done = error == 0; if (done) { f->next = Files_files; @@ -243,7 +243,7 @@ static void Files_Create (Files_File f) } else { __MOVE("file not created", err, 17); } - Files_Err(err, ((LONGINT)(32)), f, error); + Files_Err(err, 32, f, error); } } } @@ -258,15 +258,15 @@ static void Files_Flush (Files_Buffer buf) if (buf->org != f->pos) { error = Platform_Seek(f->fd, buf->org, Platform_SeekSet); } - error = Platform_Write(f->fd, (LONGINT)(SYSTEM_ADRINT)buf->data, buf->size); + error = Platform_Write(f->fd, (SYSTEM_ADRINT)buf->data, buf->size); if (error != 0) { - Files_Err((CHAR*)"error writing file", (LONGINT)19, f, error); + Files_Err((CHAR*)"error writing file", 19, f, error); } f->pos = buf->org + buf->size; buf->chg = 0; error = Platform_Identify(f->fd, &f->identity, Platform_FileIdentity__typ); if (error != 0) { - Files_Err((CHAR*)"error identifying file", (LONGINT)23, f, error); + Files_Err((CHAR*)"error identifying file", 23, f, error); } } } @@ -305,7 +305,7 @@ void Files_Close (Files_File f) } error = Platform_Sync(f->fd); if (error != 0) { - Files_Err((CHAR*)"error writing file", (LONGINT)19, f, error); + Files_Err((CHAR*)"error writing file", 19, f, error); } Files_CloseOSFile(f); } @@ -325,7 +325,7 @@ Files_File Files_New (CHAR *name, LONGINT name__len) __DUP(name, name__len, CHAR); __NEW(f, Files_FileDesc); f->workName[0] = 0x00; - __COPY(name, f->registerName, ((LONGINT)(101))); + __COPY(name, f->registerName, 101); f->fd = -1; f->state = 1; f->len = 0; @@ -438,28 +438,28 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) if (name[0] != 0x00) { if (Files_HasDir((void*)name, name__len)) { dir[0] = 0x00; - __COPY(name, path, ((LONGINT)(256))); + __COPY(name, path, 256); } else { pos = 0; - Files_ScanPath(&pos, (void*)dir, ((LONGINT)(256))); - Files_MakeFileName(dir, ((LONGINT)(256)), name, name__len, (void*)path, ((LONGINT)(256))); - Files_ScanPath(&pos, (void*)dir, ((LONGINT)(256))); + Files_ScanPath(&pos, (void*)dir, 256); + Files_MakeFileName(dir, 256, name, name__len, (void*)path, 256); + Files_ScanPath(&pos, (void*)dir, 256); } for (;;) { - error = Platform_OldRW((void*)path, ((LONGINT)(256)), &fd); + error = Platform_OldRW((void*)path, 256, &fd); done = error == 0; if ((!done && Platform_TooManyFiles(error))) { - Files_Err((CHAR*)"too many files open", (LONGINT)20, f, error); + Files_Err((CHAR*)"too many files open", 20, f, error); } if ((!done && Platform_Inaccessible(error))) { - error = Platform_OldRO((void*)path, ((LONGINT)(256)), &fd); + error = Platform_OldRO((void*)path, 256, &fd); done = error == 0; } if ((!done && !Platform_Absent(error))) { - Console_String((CHAR*)"Warning: Files.Old ", (LONGINT)20); + Console_String((CHAR*)"Warning: Files.Old ", 20); Console_String(name, name__len); - Console_String((CHAR*)" error = ", (LONGINT)10); - Console_Int(error, ((LONGINT)(0))); + Console_String((CHAR*)" error = ", 10); + Console_Int(error, 0); Console_Ln(); } if (done) { @@ -477,7 +477,7 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) f->pos = 0; f->swapper = -1; error = Platform_Size(fd, &f->len); - __COPY(name, f->workName, ((LONGINT)(101))); + __COPY(name, f->workName, 101); f->registerName[0] = 0x00; f->tempFile = 0; f->identity = identity; @@ -493,8 +493,8 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) __DEL(name); return _o_result; } else { - Files_MakeFileName(dir, ((LONGINT)(256)), name, name__len, (void*)path, ((LONGINT)(256))); - Files_ScanPath(&pos, (void*)dir, ((LONGINT)(256))); + Files_MakeFileName(dir, 256, name, name__len, (void*)path, 256); + Files_ScanPath(&pos, (void*)dir, 256); } } } else { @@ -519,8 +519,8 @@ void Files_Purge (Files_File f) i += 1; } if (f->fd != -1) { - error = Platform_Truncate(f->fd, ((LONGINT)(0))); - error = Platform_Seek(f->fd, ((LONGINT)(0)), Platform_SeekSet); + error = Platform_Truncate(f->fd, 0); + error = Platform_Seek(f->fd, 0, Platform_SeekSet); } f->pos = 0; f->len = 0; @@ -585,9 +585,9 @@ void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, LONGINT pos) if (f->pos != org) { error = Platform_Seek(f->fd, org, Platform_SeekSet); } - error = Platform_ReadBuf(f->fd, (void*)buf->data, ((LONGINT)(4096)), &n); + error = Platform_ReadBuf(f->fd, (void*)buf->data, 4096, &n); if (error != 0) { - Files_Err((CHAR*)"read from file not done", (LONGINT)24, f, error); + Files_Err((CHAR*)"read from file not done", 24, f, error); } f->pos = org + n; buf->size = n; @@ -657,7 +657,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x } else { min = n; } - __MOVE((LONGINT)(SYSTEM_ADRINT)buf->data + offset, (LONGINT)(SYSTEM_ADRINT)x + xpos, min); + __MOVE((SYSTEM_ADRINT)buf->data + offset, (SYSTEM_ADRINT)x + xpos, min); offset += min; (*r).offset = offset; xpos += min; @@ -669,7 +669,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x void Files_ReadByte (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len) { - Files_ReadBytes(&*r, r__typ, (void*)x, x__len * ((LONGINT)(1)), ((LONGINT)(1))); + Files_ReadBytes(&*r, r__typ, (void*)x, x__len * 1, 1); } Files_File Files_Base (Files_Rider *r, LONGINT *r__typ) @@ -722,7 +722,7 @@ void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT } else { min = n; } - __MOVE((LONGINT)(SYSTEM_ADRINT)x + xpos, (LONGINT)(SYSTEM_ADRINT)buf->data + offset, min); + __MOVE((SYSTEM_ADRINT)x + xpos, (SYSTEM_ADRINT)buf->data + offset, min); offset += min; (*r).offset = offset; if (offset > buf->size) { @@ -773,15 +773,15 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT *res = 3; return; } - error = Platform_Read(fdold, (LONGINT)(SYSTEM_ADRINT)buf, ((LONGINT)(4096)), &n); + error = Platform_Read(fdold, (SYSTEM_ADRINT)buf, 4096, &n); while (n > 0) { - error = Platform_Write(fdnew, (LONGINT)(SYSTEM_ADRINT)buf, n); + error = Platform_Write(fdnew, (SYSTEM_ADRINT)buf, n); if (error != 0) { ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); - Files_Err((CHAR*)"cannot move file", (LONGINT)17, NIL, error); + Files_Err((CHAR*)"cannot move file", 17, NIL, error); } - error = Platform_Read(fdold, (LONGINT)(SYSTEM_ADRINT)buf, ((LONGINT)(4096)), &n); + error = Platform_Read(fdold, (SYSTEM_ADRINT)buf, 4096, &n); } ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); @@ -789,7 +789,7 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT error = Platform_Unlink((void*)old, old__len); *res = 0; } else { - Files_Err((CHAR*)"cannot move file", (LONGINT)17, NIL, error); + Files_Err((CHAR*)"cannot move file", 17, NIL, error); } } } else { @@ -809,12 +809,12 @@ void Files_Register (Files_File f) } Files_Close(f); if (f->registerName[0] != 0x00) { - Files_Rename(f->workName, ((LONGINT)(101)), f->registerName, ((LONGINT)(101)), &errcode); + Files_Rename(f->workName, 101, f->registerName, 101, &errcode); if (errcode != 0) { - __COPY(f->registerName, file, ((LONGINT)(104))); + __COPY(f->registerName, file, 104); __HALT(99); } - __COPY(f->registerName, f->workName, ((LONGINT)(101))); + __COPY(f->registerName, f->workName, 101); f->registerName[0] = 0x00; f->tempFile = 0; } @@ -839,7 +839,7 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *de j += 1; } } else { - __MOVE((LONGINT)(SYSTEM_ADRINT)src, (LONGINT)(SYSTEM_ADRINT)dest, src__len); + __MOVE((SYSTEM_ADRINT)src, (SYSTEM_ADRINT)dest, src__len); } } @@ -851,38 +851,38 @@ void Files_ReadBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN *x) void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, INTEGER *x) { CHAR b[2]; - Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(2)), ((LONGINT)(2))); - *x = (int)b[0] + __ASHL((int)b[1], 8); + Files_ReadBytes(&*R, R__typ, (void*)b, 2, 2); + *x = b[0] + __ASHL(b[1], 8); } void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, LONGINT *x) { CHAR b[4]; - Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); - *x = (((int)b[0] + __ASHL((int)b[1], 8)) + __ASHL((int)b[2], 16)) + __ASHL((int)b[3], 24); + Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); + *x = ((b[0] + __ASHL(b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); } void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x) { CHAR b[4]; LONGINT l; - Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); - l = (((int)b[0] + __ASHL((int)b[1], 8)) + __ASHL((int)b[2], 16)) + __ASHL((int)b[3], 24); - *x = (SET)l; + Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); + l = ((b[0] + __ASHL(b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); + *x = __VAL(SET, l); } void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x) { CHAR b[4]; - Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); - Files_FlipBytes((void*)b, ((LONGINT)(4)), (void*)&*x, ((LONGINT)(4))); + Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); + Files_FlipBytes((void*)b, 4, (void*)&*x, 4); } void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x) { CHAR b[8]; - Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(8)), ((LONGINT)(8))); - Files_FlipBytes((void*)b, ((LONGINT)(8)), (void*)&*x, ((LONGINT)(8))); + Files_ReadBytes(&*R, R__typ, (void*)b, 8, 8); + Files_FlipBytes((void*)b, 8, (void*)&*x, 8); } void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) @@ -923,12 +923,12 @@ void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, LONGINT *x) s = 0; n = 0; Files_Read(&*R, R__typ, (void*)&ch); - while ((int)ch >= 128) { - n += __ASH((SYSTEM_INT64)((int)ch - 128), s); + while (ch >= 128) { + n += __ASH((SYSTEM_INT64)(ch - 128), s); s += 7; Files_Read(&*R, R__typ, (void*)&ch); } - n += __ASH((SYSTEM_INT64)(__MASK((int)ch, -64) - __ASHL(__ASHR((int)ch, 6), 6)), s); + n += __ASH((SYSTEM_INT64)(__MASK(ch, -64) - __ASHL(__ASHR(ch, 6), 6)), s); *x = n; } @@ -942,7 +942,7 @@ void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, INTEGER x) CHAR b[2]; b[0] = (CHAR)x; b[1] = (CHAR)__ASHR(x, 8); - Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(2)), ((LONGINT)(2))); + Files_WriteBytes(&*R, R__typ, (void*)b, 2, 2); } void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, LONGINT x) @@ -952,33 +952,33 @@ void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, LONGINT x) b[1] = (CHAR)__ASHR(x, 8); b[2] = (CHAR)__ASHR(x, 16); b[3] = (CHAR)__ASHR(x, 24); - Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); + Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x) { CHAR b[4]; LONGINT i; - i = (LONGINT)x; + i = __VAL(LONGINT, x); b[0] = (CHAR)i; b[1] = (CHAR)__ASHR(i, 8); b[2] = (CHAR)__ASHR(i, 16); b[3] = (CHAR)__ASHR(i, 24); - Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); + Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x) { CHAR b[4]; - Files_FlipBytes((void*)&x, ((LONGINT)(4)), (void*)b, ((LONGINT)(4))); - Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); + Files_FlipBytes((void*)&x, 4, (void*)b, 4); + Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x) { CHAR b[8]; - Files_FlipBytes((void*)&x, ((LONGINT)(8)), (void*)b, ((LONGINT)(8))); - Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(8)), ((LONGINT)(8))); + Files_FlipBytes((void*)&x, 8, (void*)b, 8); + Files_WriteBytes(&*R, R__typ, (void*)b, 8, 8); } void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) @@ -988,7 +988,7 @@ void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len while (x[i] != 0x00) { i += 1; } - Files_WriteBytes(&*R, R__typ, (void*)x, x__len * ((LONGINT)(1)), i + 1); + Files_WriteBytes(&*R, R__typ, (void*)x, x__len * 1, i + 1); } void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, LONGINT x) @@ -1013,7 +1013,7 @@ static void Files_Finalize (SYSTEM_PTR o) if (f->fd >= 0) { Files_CloseOSFile(f); if (f->tempFile) { - res = Platform_Unlink((void*)f->workName, ((LONGINT)(101))); + res = Platform_Unlink((void*)f->workName, 101); } } } @@ -1022,7 +1022,7 @@ void Files_SetSearchPath (CHAR *path, LONGINT path__len) { __DUP(path, path__len, CHAR); if (Strings_Length(path, path__len) != 0) { - Files_SearchPath = __NEWARR(NIL, ((LONGINT)(1)), 1, 1, 1, (LONGINT)(Strings_Length(path, path__len) + 1)); + Files_SearchPath = __NEWARR(NIL, 1, 1, 1, 1, ((SYSTEM_ADRINT)((Strings_Length(path, path__len) + 1)))); __COPY(path, Files_SearchPath->data, Files_SearchPath->len[0]); } else { Files_SearchPath = NIL; @@ -1056,6 +1056,6 @@ export void *Files__init(void) Files_tempno = -1; Heap_FileCount = 0; Files_HOME[0] = 0x00; - Platform_GetEnv((CHAR*)"HOME", (LONGINT)5, (void*)Files_HOME, ((LONGINT)(1024))); + Platform_GetEnv((CHAR*)"HOME", 5, (void*)Files_HOME, 1024); __ENDMOD; } diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index a0a4c4f3..fa7db0e9 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index 1eb56133..a8a51e7c 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tskSfF */ #define LARGE #include "SYSTEM.h" @@ -117,7 +117,7 @@ void Heap_Unlock (void) { Heap_lockdepth -= 1; if ((Heap_interrupted && Heap_lockdepth == 0)) { - Heap_PlatformHalt(((LONGINT)(-9))); + Heap_PlatformHalt(-9); } } @@ -132,7 +132,7 @@ SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) } m->types = 0; m->cmds = NIL; - __COPY(name, m->name, ((LONGINT)(20))); + __COPY(name, m->name, 20); m->refcnt = 0; m->enumPtrs = enumPtrs; m->next = (Heap_Module)(SYSTEM_ADRINT)Heap_modules; @@ -149,7 +149,7 @@ void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) } else { __NEW(c, Heap_CmdDesc); } - __COPY(name, c->name, ((LONGINT)(24))); + __COPY(name, c->name, 24); c->cmd = cmd; c->next = m->cmds; m->cmds = c; @@ -327,12 +327,12 @@ SYSTEM_PTR Heap_NEWBLK (LONGINT size) SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 63, 5), 5); - new = Heap_NEWREC((LONGINT)(SYSTEM_ADRINT)&blksz); - tag = ((LONGINT)(SYSTEM_ADRINT)new + blksz) - 24; + new = Heap_NEWREC((SYSTEM_ADRINT)&blksz); + tag = (__VAL(LONGINT, new) + blksz) - 24; __PUT(tag - 8, 0, LONGINT); __PUT(tag, blksz, LONGINT); __PUT(tag + 8, -8, LONGINT); - __PUT((LONGINT)(SYSTEM_ADRINT)new - 8, tag, LONGINT); + __PUT(__VAL(LONGINT, new) - 8, tag, LONGINT); Heap_Unlock(); _o_result = new; return _o_result; @@ -361,7 +361,7 @@ static void Heap_Mark (LONGINT q) __GET(tag, offset, LONGINT); fld = q + offset; p = Heap_FetchAddress(fld); - __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)n, SYSTEM_PTR); + __PUT(fld, __VAL(SYSTEM_PTR, n), SYSTEM_PTR); } else { fld = q + offset; n = Heap_FetchAddress(fld); @@ -370,7 +370,7 @@ static void Heap_Mark (LONGINT q) if (!__ODD(tagbits)) { __PUT(n - 8, tagbits + 1, LONGINT); __PUT(q - 8, tag + 1, LONGINT); - __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)p, SYSTEM_PTR); + __PUT(fld, __VAL(SYSTEM_PTR, p), SYSTEM_PTR); p = q; q = n; tag = tagbits; @@ -385,7 +385,7 @@ static void Heap_Mark (LONGINT q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((LONGINT)(SYSTEM_ADRINT)p); + Heap_Mark(__VAL(LONGINT, p)); } static void Heap_Scan (void) @@ -554,7 +554,7 @@ static void Heap_Finalize (void) } else { prev->next = n->next; } - (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); + (*n->finalize)(__VAL(SYSTEM_PTR, n->obj)); if (prev == NIL) { n = Heap_fin; } else { @@ -573,7 +573,7 @@ void Heap_FINALL (void) while (Heap_fin != NIL) { n = Heap_fin; Heap_fin = Heap_fin->next; - (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); + (*n->finalize)(__VAL(SYSTEM_PTR, n->obj)); } } @@ -590,9 +590,9 @@ static void Heap_MarkStack (LONGINT n, LONGINT *cand, LONGINT cand__len) } if (n == 0) { nofcand = 0; - sp = (LONGINT)(SYSTEM_ADRINT)&frame; + sp = (SYSTEM_ADRINT)&frame; stack0 = Heap_PlatformMainStackFrame(); - inc = (LONGINT)(SYSTEM_ADRINT)&align.p - (LONGINT)(SYSTEM_ADRINT)&align; + inc = (SYSTEM_ADRINT)&align.p - (SYSTEM_ADRINT)&align; if (sp > stack0) { inc = -inc; } @@ -681,7 +681,7 @@ void Heap_GC (BOOLEAN markStack) i22 += 23; i23 += 24; if ((i0 == -99 && i15 == 24)) { - Heap_MarkStack(((LONGINT)(32)), (void*)cand, ((LONGINT)(10000))); + Heap_MarkStack(32, (void*)cand, 10000); break; } } @@ -700,7 +700,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (LONGINT)(SYSTEM_ADRINT)obj; + f->obj = __VAL(LONGINT, obj); f->finalize = finalize; f->marked = 1; f->next = Heap_fin; @@ -709,7 +709,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) void Heap_InitHeap (void) { - Heap_heap = Heap_NewChunk(((LONGINT)(256000))); + Heap_heap = Heap_NewChunk(256000); Heap_heapend = Heap_FetchAddress(Heap_heap + 8); __PUT(Heap_heap, 0, LONGINT); Heap_allocated = 0; diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index 7e4094a1..eebee23c 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 51f3204d..5929cd57 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Console.h" @@ -84,10 +84,10 @@ Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len) Modules_resMsg[0] = 0x00; } else { Modules_res = 1; - __COPY(name, Modules_importing, ((LONGINT)(20))); + __COPY(name, Modules_importing, 20); __MOVE(" module \"", Modules_resMsg, 10); - Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), name, name__len); - Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), (CHAR*)"\" not found", (LONGINT)12); + Modules_Append((void*)Modules_resMsg, 256, name, name__len); + Modules_Append((void*)Modules_resMsg, 256, (CHAR*)"\" not found", 12); } _o_result = m; __DEL(name); @@ -112,11 +112,11 @@ Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT nam } else { Modules_res = 2; __MOVE(" command \"", Modules_resMsg, 11); - __COPY(name, Modules_importing, ((LONGINT)(20))); - Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), mod->name, ((LONGINT)(20))); - Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), (CHAR*)".", (LONGINT)2); - Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), name, name__len); - Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), (CHAR*)"\" not found", (LONGINT)12); + __COPY(name, Modules_importing, 20); + Modules_Append((void*)Modules_resMsg, 256, mod->name, 20); + Modules_Append((void*)Modules_resMsg, 256, (CHAR*)".", 2); + Modules_Append((void*)Modules_resMsg, 256, name, name__len); + Modules_Append((void*)Modules_resMsg, 256, (CHAR*)"\" not found", 12); _o_result = NIL; __DEL(name); return _o_result; diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index 8431e4a2..03458258 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index ce3f00ec..c3322a77 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" @@ -272,7 +272,7 @@ OPT_Node OPB_NewString (OPS_String str, LONGINT len) x->conval->intval = -1; x->conval->intval2 = len; x->conval->ext = OPT_NewExt(); - __COPY(str, *x->conval->ext, ((LONGINT)(256))); + __COPY(str, *x->conval->ext, 256); _o_result = x; return _o_result; } @@ -619,7 +619,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) case 22: if (f == 3) { if (z->class == 7) { - z->conval->intval = (int)__CAP((CHAR)z->conval->intval); + z->conval->intval = __CAP((CHAR)z->conval->intval); z->obj = NIL; } else { z = NewOp__29(op, typ, z); @@ -667,8 +667,8 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->typ = OPT_booltyp; break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPB.MOp, op = ", (LONGINT)33); - OPM_LogWNum(op, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPB.MOp, op = ", 33); + OPM_LogWNum(op, 0); OPM_LogWLn(); break; } @@ -827,8 +827,8 @@ static INTEGER ConstCmp__14 (void) } break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPB.ConstCmp, f = ", (LONGINT)37); - OPM_LogWNum(*ConstOp__13_s->f, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPB.ConstCmp, f = ", 37); + OPM_LogWNum(*ConstOp__13_s->f, 0); OPM_LogWLn(); break; } @@ -1106,8 +1106,8 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPB.ConstOp, op = ", (LONGINT)37); - OPM_LogWNum(op, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPB.ConstOp, op = ", 37); + OPM_LogWNum(op, 0); OPM_LogWLn(); break; } @@ -1155,7 +1155,7 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) } } (*x)->obj = NIL; - } else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((int)(*x)->left->typ->form < f || f > g))) { + } else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((*x)->left->typ->form < f || f > g))) { if ((*x)->left->typ == typ) { *x = (*x)->left; } @@ -1208,11 +1208,11 @@ static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) if ((*Op__38_s->f == 10 && (*x)->conval->intval2 == 1)) { (*x)->typ = OPT_chartyp; (*x)->conval->intval = 0; - OPB_Index(&*y, OPB_NewIntConst(((LONGINT)(0)))); + OPB_Index(&*y, OPB_NewIntConst(0)); } else if ((*Op__38_s->g == 10 && (*y)->conval->intval2 == 1)) { (*y)->typ = OPT_chartyp; (*y)->conval->intval = 0; - OPB_Index(&*x, OPB_NewIntConst(((LONGINT)(0)))); + OPB_Index(&*x, OPB_NewIntConst(0)); } } _o_result = ok; @@ -1476,7 +1476,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) typ = OPT_booltyp; } else { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"ELSE in Op()", (LONGINT)13); + OPM_LogWStr((CHAR*)"ELSE in Op()", 13); OPM_LogWLn(); OPB_err(108); typ = OPT_undftyp; @@ -1484,8 +1484,8 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) NewOp__39(op, typ, &z, y); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPB.Op, op = ", (LONGINT)32); - OPM_LogWNum(op, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPB.Op, op = ", 32); + OPM_LogWNum(op, 0); OPM_LogWLn(); break; } @@ -1557,24 +1557,24 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPT_Struct p = NIL, q = NIL; if (OPM_Verbose) { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"PROCEDURE CheckAssign", (LONGINT)22); + OPM_LogWStr((CHAR*)"PROCEDURE CheckAssign", 22); OPM_LogWLn(); } y = ynode->typ; f = x->form; g = y->form; if (OPM_Verbose) { - OPM_LogWStr((CHAR*)"y.form = ", (LONGINT)10); - OPM_LogWNum(y->form, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"y.form = ", 10); + OPM_LogWNum(y->form, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"f = ", (LONGINT)5); - OPM_LogWNum(f, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"f = ", 5); + OPM_LogWNum(f, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"g = ", (LONGINT)5); - OPM_LogWNum(g, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"g = ", 5); + OPM_LogWNum(g, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"ynode.typ.syze = ", (LONGINT)18); - OPM_LogWNum(ynode->typ->size, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"ynode.typ.syze = ", 18); + OPM_LogWNum(ynode->typ->size, 0); OPM_LogWLn(); } if (ynode->class == 8 || (ynode->class == 9 && f != 14)) { @@ -1682,8 +1682,8 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) } break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPB.CheckAssign, f = ", (LONGINT)40); - OPM_LogWNum(f, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPB.CheckAssign, f = ", 40); + OPM_LogWNum(f, 0); OPM_LogWLn(); break; } @@ -1775,14 +1775,14 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) x = OPB_NewBoolConst(0); break; case 3: - x = OPB_NewIntConst(((LONGINT)(0))); + x = OPB_NewIntConst(0); x->typ = OPT_chartyp; break; case 4: case 5: case 6: x = OPB_NewIntConst(OPM_SignedMinimum(x->typ->size)); break; case 9: - x = OPB_NewIntConst(((LONGINT)(0))); + x = OPB_NewIntConst(0); x->typ = OPT_inttyp; break; case 7: @@ -1806,7 +1806,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) x = OPB_NewBoolConst(1); break; case 3: - x = OPB_NewIntConst(((LONGINT)(255))); + x = OPB_NewIntConst(255); x->typ = OPT_chartyp; break; case 4: case 5: case 6: @@ -1928,14 +1928,14 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 12: if (x->class != 8) { OPB_err(110); - x = OPB_NewIntConst(((LONGINT)(1))); + x = OPB_NewIntConst(1); } else if (__IN(f, 0x63fe) || __IN(x->typ->comp, 0x14)) { (*OPB_typSize)(x->typ); x->typ->pvused = 1; x = OPB_NewIntConst(x->typ->size); } else { OPB_err(111); - x = OPB_NewIntConst(((LONGINT)(1))); + x = OPB_NewIntConst(1); } break; case 21: @@ -1994,8 +1994,8 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) } break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPB.StPar0, fctno = ", (LONGINT)39); - OPM_LogWNum(fctno, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPB.StPar0, fctno = ", 39); + OPM_LogWNum(fctno, 0); OPM_LogWLn(); break; } @@ -2064,7 +2064,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (!__IN(f, 0x70) || x->class != 7) { OPB_err(69); } else if (x->typ->size == 1) { - L = (int)x->conval->intval; + L = (SYSTEM_INT32)x->conval->intval; typ = p->typ; while ((L > 0 && __IN(typ->comp, 0x0c))) { typ = typ->BaseTyp; @@ -2322,7 +2322,7 @@ void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno) } } else { if (((fctno == 13 || fctno == 14) && parno == 1)) { - OPB_BindNodes(19, OPT_notyp, &p, OPB_NewIntConst(((LONGINT)(1)))); + OPB_BindNodes(19, OPT_notyp, &p, OPB_NewIntConst(1)); p->subcl = fctno; p->right->typ = p->left->typ; } else if ((fctno == 17 && parno == 1)) { @@ -2344,7 +2344,7 @@ void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno) } else if (fctno == 32) { if (parno == 1) { x = NIL; - OPB_BindNodes(28, OPT_notyp, &x, OPB_NewIntConst(((LONGINT)(0)))); + OPB_BindNodes(28, OPT_notyp, &x, OPB_NewIntConst(0)); x->conval = OPT_NewConst(); x->conval->intval = OPM_errpos; OPB_Construct(15, &p, x); @@ -2579,7 +2579,7 @@ void OPB_Assign (OPT_Node *x, OPT_Node y) } else if (((((((*x)->typ->comp == 2 && (*x)->typ->BaseTyp == OPT_chartyp)) && y->typ->form == 10)) && y->conval->intval2 == 1)) { y->typ = OPT_chartyp; y->conval->intval = 0; - OPB_Index(&*x, OPB_NewIntConst(((LONGINT)(0)))); + OPB_Index(&*x, OPB_NewIntConst(0)); } if ((((((__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp == OPT_chartyp)) && __IN(y->typ->comp, 0x0c))) && y->typ->BaseTyp == OPT_chartyp)) { subcl = 18; diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index ccef7627..0b71f987 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index a5276b17..57fdcb05 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -63,6 +63,7 @@ static void OPC_InitImports (OPT_Object obj); static void OPC_InitKeywords (void); export void OPC_InitTDesc (OPT_Struct typ); static void OPC_InitTProcs (OPT_Object typ, OPT_Object obj); +export void OPC_IntLiteral (LONGINT n, LONGINT size); export void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim); static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName); static INTEGER OPC_Length (CHAR *s, LONGINT s__len); @@ -179,7 +180,7 @@ static INTEGER OPC_PerfectHash (CHAR *s, LONGINT s__len) i = 0; h = 0; while ((s[__X(i, s__len)] != 0x00 && i < 5)) { - h = 3 * h + (int)s[__X(i, s__len)]; + h = 3 * h + s[__X(i, s__len)]; i += 1; } _o_result = (int)__MOD(h, 105); @@ -192,10 +193,10 @@ void OPC_Ident (OPT_Object obj) mode = obj->mode; level = obj->mnolev; if ((__IN(mode, 0x62) && level > 0) || __IN(mode, 0x14)) { - OPM_WriteStringVar((void*)obj->name, ((LONGINT)(256))); - h = OPC_PerfectHash((void*)obj->name, ((LONGINT)(256))); - if (OPC_hashtab[__X(h, ((LONGINT)(105)))] >= 0) { - if (__STRCMP(OPC_keytab[__X(OPC_hashtab[__X(h, ((LONGINT)(105)))], ((LONGINT)(36)))], obj->name) == 0) { + OPM_WriteStringVar((void*)obj->name, 256); + h = OPC_PerfectHash((void*)obj->name, 256); + if (OPC_hashtab[__X(h, 105)] >= 0) { + if (__STRCMP(OPC_keytab[__X(OPC_hashtab[__X(h, 105)], 36)], obj->name) == 0) { OPM_Write('_'); } } @@ -204,18 +205,18 @@ void OPC_Ident (OPT_Object obj) if (mode == 13) { OPC_Ident(obj->link->typ->strobj); } else if (level < 0) { - OPM_WriteStringVar((void*)OPT_GlbMod[__X(-level, ((LONGINT)(64)))]->name, ((LONGINT)(256))); + OPM_WriteStringVar((void*)OPT_GlbMod[__X(-level, 64)]->name, 256); if (OPM_currFile == 0) { - OPT_GlbMod[__X(-level, ((LONGINT)(64)))]->vis = 1; + OPT_GlbMod[__X(-level, 64)]->vis = 1; } } else { - OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); + OPM_WriteStringVar((void*)OPM_modName, 32); } OPM_Write('_'); } else if ((((((obj == OPT_sysptrtyp->strobj || obj == OPT_ainttyp->strobj) || obj == OPT_int8typ->strobj) || obj == OPT_int16typ->strobj) || obj == OPT_int32typ->strobj) || obj == OPT_int64typ->strobj) || obj == OPT_bytetyp->strobj) { - OPM_WriteString((CHAR*)"SYSTEM_", (LONGINT)8); + OPM_WriteString((CHAR*)"SYSTEM_", 8); } - OPM_WriteStringVar((void*)obj->name, ((LONGINT)(256))); + OPM_WriteStringVar((void*)obj->name, 256); } } @@ -291,7 +292,7 @@ static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef) OPM_Write(')'); OPC_AnsiParamList(typ->link, 0); } else { - OPM_WriteString((CHAR*)")()", (LONGINT)4); + OPM_WriteString((CHAR*)")()", 4); } break; } else if (comp == 2) { @@ -309,8 +310,8 @@ static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef) void OPC_Andent (OPT_Struct typ) { if (typ->strobj == NIL || typ->align >= 65536) { - OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); - OPC_Str1((CHAR*)"__#", (LONGINT)4, __ASHR(typ->align, 16)); + OPM_WriteStringVar((void*)OPM_modName, 32); + OPC_Str1((CHAR*)"__#", 4, __ASHR(typ->align, 16)); } else { OPC_Ident(typ->strobj); } @@ -337,17 +338,17 @@ static void OPC_DeclareBase (OPT_Object dcl) } obj = typ->strobj; if (typ->form == 12) { - OPM_WriteString((CHAR*)"void", (LONGINT)5); + OPM_WriteString((CHAR*)"void", 5); } else if ((obj != NIL && !OPC_Undefined(obj))) { OPC_Ident(obj); } else if (typ->comp == 4) { - OPM_WriteString((CHAR*)"struct ", (LONGINT)8); + OPM_WriteString((CHAR*)"struct ", 8); OPC_Andent(typ); if ((prev->form != 13 && (obj != NIL || dcl->name[0] == 0x00))) { if ((typ->BaseTyp != NIL && typ->BaseTyp->strobj->vis != 0)) { - OPM_WriteString((CHAR*)" { /* ", (LONGINT)7); + OPM_WriteString((CHAR*)" { /* ", 7); OPC_Ident(typ->BaseTyp->strobj); - OPM_WriteString((CHAR*)" */", (LONGINT)4); + OPM_WriteString((CHAR*)" */", 4); OPM_WriteLn(); OPC_Indent(1); } else { @@ -364,10 +365,10 @@ static void OPC_DeclareBase (OPT_Object dcl) nofdims += 1; typ = typ->BaseTyp; } - OPM_WriteString((CHAR*)"struct ", (LONGINT)8); + OPM_WriteString((CHAR*)"struct ", 8); OPC_BegBlk(); OPC_BegStat(); - OPC_Str1((CHAR*)"LONGINT len[#]", (LONGINT)15, nofdims); + OPC_Str1((CHAR*)"LONGINT len[#]", 15, nofdims); OPC_EndStat(); OPC_BegStat(); __NEW(obj, OPT_ObjDesc); @@ -437,7 +438,7 @@ static void OPC_PutPtrOffsets (OPT_Struct typ, LONGINT adr, LONGINT *cnt) LONGINT n, i; if ((typ->form == 13 && typ->sysflag == 0)) { OPM_WriteInt(adr); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); *cnt += 1; if (__MASK(*cnt, -16) == 0) { OPM_WriteLn(); @@ -454,7 +455,7 @@ static void OPC_PutPtrOffsets (OPT_Struct typ, LONGINT adr, LONGINT *cnt) OPC_PutPtrOffsets(fld->typ, adr + fld->adr, &*cnt); } else { OPM_WriteInt(adr + fld->adr); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); *cnt += 1; if (__MASK(*cnt, -16) == 0) { OPM_WriteLn(); @@ -486,11 +487,11 @@ static void OPC_InitTProcs (OPT_Object typ, OPT_Object obj) OPC_InitTProcs(typ, obj->left); if (obj->mode == 13) { OPC_BegStat(); - OPM_WriteString((CHAR*)"__INITBP(", (LONGINT)10); + OPM_WriteString((CHAR*)"__INITBP(", 10); OPC_Ident(typ); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Ident(obj); - OPC_Str1((CHAR*)", #)", (LONGINT)5, __ASHR(obj->adr, 16)); + OPC_Str1((CHAR*)", #)", 5, __ASHR(obj->adr, 16)); OPC_EndStat(); } OPC_InitTProcs(typ, obj->right); @@ -502,8 +503,8 @@ static void OPC_PutBase (OPT_Struct typ) if (typ != NIL) { OPC_PutBase(typ->BaseTyp); OPC_Ident(typ->strobj); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)"__typ", 6); + OPM_WriteString((CHAR*)", ", 3); } } @@ -513,19 +514,19 @@ static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamNa INTEGER dim; if (showParamName) { OPC_Ident(par); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); } dim = 1; typ = par->typ->BaseTyp; while (typ->comp == 3) { if (ansiDefine) { - OPM_WriteString((CHAR*)", LONGINT ", (LONGINT)11); + OPM_WriteString((CHAR*)", LONGINT ", 11); } else { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); } if (showParamName) { OPC_Ident(par); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); OPM_WriteInt(dim); } typ = typ->BaseTyp; @@ -538,7 +539,7 @@ static void OPC_DeclareParams (OPT_Object par, BOOLEAN macro) OPM_Write('('); while (par != NIL) { if (macro) { - OPM_WriteStringVar((void*)par->name, ((LONGINT)(256))); + OPM_WriteStringVar((void*)par->name, 256); } else { if ((par->mode == 1 && par->typ->form == 7)) { OPM_Write('_'); @@ -546,16 +547,16 @@ static void OPC_DeclareParams (OPT_Object par, BOOLEAN macro) OPC_Ident(par); } if (par->typ->comp == 3) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_LenList(par, 0, 1); } else if ((par->mode == 2 && par->typ->comp == 4)) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); - OPM_WriteStringVar((void*)par->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)", ", 3); + OPM_WriteStringVar((void*)par->name, 256); + OPM_WriteString((CHAR*)"__typ", 6); } par = par->link; if (par != NIL) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); } } OPM_Write(')'); @@ -587,7 +588,7 @@ static void OPC_DeclareTProcs (OPT_Object obj, BOOLEAN *empty) if (OPM_currFile == 0) { if (obj->vis == 1) { OPC_DefineTProcTypes(obj); - OPM_WriteString((CHAR*)"import ", (LONGINT)8); + OPM_WriteString((CHAR*)"import ", 8); *empty = 0; OPC_ProcHeader(obj, 0); } @@ -595,9 +596,9 @@ static void OPC_DeclareTProcs (OPT_Object obj, BOOLEAN *empty) *empty = 0; OPC_DefineTProcTypes(obj); if (obj->vis == 0) { - OPM_WriteString((CHAR*)"static ", (LONGINT)8); + OPM_WriteString((CHAR*)"static ", 8); } else { - OPM_WriteString((CHAR*)"export ", (LONGINT)8); + OPM_WriteString((CHAR*)"export ", 8); } OPC_ProcHeader(obj, 0); } @@ -631,31 +632,31 @@ static void OPC_DefineTProcMacros (OPT_Object obj, BOOLEAN *empty) if (obj != NIL) { OPC_DefineTProcMacros(obj->left, &*empty); if ((((obj->mode == 13 && obj == OPC_BaseTProc(obj))) && (OPM_currFile != 0 || obj->vis == 1))) { - OPM_WriteString((CHAR*)"#define __", (LONGINT)11); + OPM_WriteString((CHAR*)"#define __", 11); OPC_Ident(obj); OPC_DeclareParams(obj->link, 1); - OPM_WriteString((CHAR*)" __SEND(", (LONGINT)9); + OPM_WriteString((CHAR*)" __SEND(", 9); if (obj->link->typ->form == 13) { - OPM_WriteString((CHAR*)"__TYPEOF(", (LONGINT)10); + OPM_WriteString((CHAR*)"__TYPEOF(", 10); OPC_Ident(obj->link); OPM_Write(')'); } else { OPC_Ident(obj->link); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } - OPC_Str1((CHAR*)", #, ", (LONGINT)6, __ASHR(obj->adr, 16)); + OPC_Str1((CHAR*)", #, ", 6, __ASHR(obj->adr, 16)); if (obj->typ == OPT_notyp) { - OPM_WriteString((CHAR*)"void", (LONGINT)5); + OPM_WriteString((CHAR*)"void", 5); } else { OPC_Ident(obj->typ->strobj); } - OPM_WriteString((CHAR*)"(*)", (LONGINT)4); + OPM_WriteString((CHAR*)"(*)", 4); if (OPC_ansi) { OPC_AnsiParamList(obj->link, 0); } else { - OPM_WriteString((CHAR*)"()", (LONGINT)3); + OPM_WriteString((CHAR*)"()", 3); } - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_DeclareParams(obj->link, 1); OPM_Write(')'); OPM_WriteLn(); @@ -710,7 +711,7 @@ static void OPC_DefineType (OPT_Struct str) } } if ((obj != NIL && OPC_Undefined(obj))) { - OPM_WriteString((CHAR*)"typedef", (LONGINT)8); + OPM_WriteString((CHAR*)"typedef", 8); OPM_WriteLn(); OPM_Write(0x09); OPC_Indent(1); @@ -743,7 +744,7 @@ static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len) BOOLEAN r; __DUP(y, y__len, CHAR); i = 0; - while ((*x)[__X(i + 1, ((LONGINT)(256)))] == y[__X(i, y__len)]) { + while ((*x)[__X(i + 1, 256)] == y[__X(i, y__len)]) { i += 1; } r = y[__X(i, y__len)] == 0x00; @@ -759,19 +760,19 @@ static void OPC_CProcDefs (OPT_Object obj, INTEGER vis) INTEGER _for__9; if (obj != NIL) { OPC_CProcDefs(obj->left, vis); - if ((((obj->mode == 9 && (int)obj->vis >= vis)) && obj->adr == 1)) { + if ((((obj->mode == 9 && obj->vis >= vis)) && obj->adr == 1)) { ext = obj->conval->ext; i = 1; - if (((*ext)[1] != '#' && !(OPC_Prefixed(ext, (CHAR*)"extern ", (LONGINT)8) || OPC_Prefixed(ext, (CHAR*)"import ", (LONGINT)8)))) { - OPM_WriteString((CHAR*)"#define ", (LONGINT)9); + if (((*ext)[1] != '#' && !(OPC_Prefixed(ext, (CHAR*)"extern ", 8) || OPC_Prefixed(ext, (CHAR*)"import ", 8)))) { + OPM_WriteString((CHAR*)"#define ", 9); OPC_Ident(obj); OPC_DeclareParams(obj->link, 1); OPM_Write(0x09); } - _for__9 = (int)(*obj->conval->ext)[0]; + _for__9 = (*obj->conval->ext)[0]; i = i; while (i <= _for__9) { - OPM_Write((*obj->conval->ext)[__X(i, ((LONGINT)(256)))]); + OPM_Write((*obj->conval->ext)[__X(i, 256)]); i += 1; } OPM_WriteLn(); @@ -815,34 +816,34 @@ void OPC_TDescDecl (OPT_Struct typ) LONGINT nofptrs; OPT_Object o = NIL; OPC_BegStat(); - OPM_WriteString((CHAR*)"__TDESC(", (LONGINT)9); + OPM_WriteString((CHAR*)"__TDESC(", 9); OPC_Andent(typ); - OPC_Str1((CHAR*)", #", (LONGINT)4, typ->n + 1); - OPC_Str1((CHAR*)", #) = {__TDFLDS(", (LONGINT)18, OPC_NofPtrs(typ)); + OPC_Str1((CHAR*)", #", 4, typ->n + 1); + OPC_Str1((CHAR*)", #) = {__TDFLDS(", 18, OPC_NofPtrs(typ)); OPM_Write('"'); if (typ->strobj != NIL) { - OPM_WriteStringVar((void*)typ->strobj->name, ((LONGINT)(256))); + OPM_WriteStringVar((void*)typ->strobj->name, 256); } OPM_Write('"'); - OPC_Str1((CHAR*)", #), {", (LONGINT)8, typ->size); + OPC_Str1((CHAR*)", #), {", 8, typ->size); nofptrs = 0; - OPC_PutPtrOffsets(typ, ((LONGINT)(0)), &nofptrs); - OPC_Str1((CHAR*)"#}}", (LONGINT)4, -((nofptrs + 1) * (SYSTEM_INT64)OPM_LIntSize)); + OPC_PutPtrOffsets(typ, 0, &nofptrs); + OPC_Str1((CHAR*)"#}}", 4, -((nofptrs + 1) * (SYSTEM_INT64)OPM_LIntSize)); OPC_EndStat(); } void OPC_InitTDesc (OPT_Struct typ) { OPC_BegStat(); - OPM_WriteString((CHAR*)"__INITYP(", (LONGINT)10); + OPM_WriteString((CHAR*)"__INITYP(", 10); OPC_Andent(typ); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); if (typ->BaseTyp != NIL) { OPC_Andent(typ->BaseTyp); } else { OPC_Andent(typ); } - OPC_Str1((CHAR*)", #)", (LONGINT)5, typ->extlev); + OPC_Str1((CHAR*)", #)", 5, typ->extlev); OPC_EndStat(); if (typ->strobj != NIL) { OPC_InitTProcs(typ->strobj, typ->link); @@ -911,22 +912,22 @@ static void OPC_FillGap (LONGINT gap, LONGINT off, LONGINT align, LONGINT *n, LO gap -= (adr - off) + align; OPC_BegStat(); if (align == (SYSTEM_INT64)OPM_IntSize) { - OPM_WriteString((CHAR*)"INTEGER", (LONGINT)8); + OPM_WriteString((CHAR*)"INTEGER", 8); } else if (align == (SYSTEM_INT64)OPM_LIntSize) { - OPM_WriteString((CHAR*)"LONGINT", (LONGINT)8); + OPM_WriteString((CHAR*)"LONGINT", 8); } else if (align == (SYSTEM_INT64)OPM_LRealSize) { - OPM_WriteString((CHAR*)"LONGREAL", (LONGINT)9); + OPM_WriteString((CHAR*)"LONGREAL", 9); } - OPC_Str1((CHAR*)" _prvt#", (LONGINT)8, *n); + OPC_Str1((CHAR*)" _prvt#", 8, *n); *n += 1; OPC_EndStat(); *curAlign = align; } if (gap > 0) { OPC_BegStat(); - OPC_Str1((CHAR*)"char _prvt#", (LONGINT)12, *n); + OPC_Str1((CHAR*)"char _prvt#", 12, *n); *n += 1; - OPC_Str1((CHAR*)"[#]", (LONGINT)4, gap); + OPC_Str1((CHAR*)"[#]", 4, gap); OPC_EndStat(); } } @@ -970,7 +971,7 @@ static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, LONGINT *off, LONGINT * base = fld->typ; fld = fld->link; while ((((((((fld != NIL && fld->mode == 4)) && fld->typ == base)) && fld->adr == *off)) && ((OPM_currFile == 1 || fld->vis != 0) || fld->typ->strobj == NIL))) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_DeclareObj(fld, 0); *off = fld->adr + fld->typ->size; fld = fld->link; @@ -1000,7 +1001,7 @@ static void OPC_IdentList (OPT_Object obj, INTEGER vis) first = 1; while ((obj != NIL && obj->mode != 13)) { if ((__IN(vis, 0x05) || (vis == 1 && obj->vis != 0)) || (vis == 3 && !obj->leaf)) { - if (obj->typ != base || (int)obj->vis != lastvis) { + if (obj->typ != base || obj->vis != lastvis) { if (!first) { OPC_EndStat(); } @@ -1009,16 +1010,16 @@ static void OPC_IdentList (OPT_Object obj, INTEGER vis) lastvis = obj->vis; OPC_BegStat(); if ((vis == 1 && obj->vis != 0)) { - OPM_WriteString((CHAR*)"import ", (LONGINT)8); + OPM_WriteString((CHAR*)"import ", 8); } else if ((obj->mnolev == 0 && vis == 0)) { if (obj->vis == 0) { - OPM_WriteString((CHAR*)"static ", (LONGINT)8); + OPM_WriteString((CHAR*)"static ", 8); } else { - OPM_WriteString((CHAR*)"export ", (LONGINT)8); + OPM_WriteString((CHAR*)"export ", 8); } } if ((((vis == 2 && obj->mode == 1)) && base->form == 7)) { - OPM_WriteString((CHAR*)"double", (LONGINT)7); + OPM_WriteString((CHAR*)"double", 7); } else { OPC_DeclareBase(obj); } @@ -1034,17 +1035,17 @@ static void OPC_IdentList (OPT_Object obj, INTEGER vis) OPC_EndStat(); OPC_BegStat(); base = OPT_linttyp; - OPM_WriteString((CHAR*)"LONGINT ", (LONGINT)9); + OPM_WriteString((CHAR*)"LONGINT ", 9); OPC_LenList(obj, 0, 1); } else if ((obj->mode == 2 && obj->typ->comp == 4)) { OPC_EndStat(); OPC_BegStat(); - OPM_WriteString((CHAR*)"LONGINT *", (LONGINT)10); + OPM_WriteString((CHAR*)"LONGINT *", 10); OPC_Ident(obj); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); base = NIL; } else if ((((((OPC_ptrinit && vis == 0)) && obj->mnolev > 0)) && obj->typ->form == 13)) { - OPM_WriteString((CHAR*)" = NIL", (LONGINT)7); + OPM_WriteString((CHAR*)" = NIL", 7); } } obj = obj->link; @@ -1059,7 +1060,7 @@ static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames) CHAR name[32]; OPM_Write('('); if (obj == NIL || obj->mode == 13) { - OPM_WriteString((CHAR*)"void", (LONGINT)5); + OPM_WriteString((CHAR*)"void", 5); } else { for (;;) { OPC_DeclareBase(obj); @@ -1067,25 +1068,25 @@ static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames) OPM_Write(' '); OPC_DeclareObj(obj, 0); } else { - __COPY(obj->name, name, ((LONGINT)(32))); + __COPY(obj->name, name, 32); obj->name[0] = 0x00; OPC_DeclareObj(obj, 0); - __COPY(name, obj->name, ((LONGINT)(256))); + __COPY(name, obj->name, 256); } if (obj->typ->comp == 3) { - OPM_WriteString((CHAR*)", LONGINT ", (LONGINT)11); + OPM_WriteString((CHAR*)", LONGINT ", 11); OPC_LenList(obj, 1, showParamNames); } else if ((obj->mode == 2 && obj->typ->comp == 4)) { - OPM_WriteString((CHAR*)", LONGINT *", (LONGINT)12); + OPM_WriteString((CHAR*)", LONGINT *", 12); if (showParamNames) { OPC_Ident(obj); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } } if (obj->link == NIL || obj->link->mode == 13) { break; } - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); obj = obj->link; } } @@ -1095,7 +1096,7 @@ static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames) static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define) { if (proc->typ == OPT_notyp) { - OPM_WriteString((CHAR*)"void", (LONGINT)5); + OPM_WriteString((CHAR*)"void", 5); } else { OPC_Ident(proc->typ->strobj); } @@ -1115,7 +1116,7 @@ static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define) OPC_IdentList(proc->link, 2); OPC_Indent(-1); } else { - OPM_WriteString((CHAR*)"();", (LONGINT)4); + OPM_WriteString((CHAR*)"();", 4); OPM_WriteLn(); } } @@ -1126,11 +1127,11 @@ static void OPC_ProcPredefs (OPT_Object obj, SHORTINT vis) OPC_ProcPredefs(obj->left, vis); if ((((__IN(obj->mode, 0xc0) && obj->vis >= vis)) && (obj->history != 4 || obj->mode == 6))) { if (vis == 1) { - OPM_WriteString((CHAR*)"import ", (LONGINT)8); + OPM_WriteString((CHAR*)"import ", 8); } else if (obj->vis == 0) { - OPM_WriteString((CHAR*)"static ", (LONGINT)8); + OPM_WriteString((CHAR*)"static ", 8); } else { - OPM_WriteString((CHAR*)"export ", (LONGINT)8); + OPM_WriteString((CHAR*)"export ", 8); } OPC_ProcHeader(obj, 0); } @@ -1141,10 +1142,10 @@ static void OPC_ProcPredefs (OPT_Object obj, SHORTINT vis) static void OPC_Include (CHAR *name, LONGINT name__len) { __DUP(name, name__len, CHAR); - OPM_WriteString((CHAR*)"#include ", (LONGINT)10); + OPM_WriteString((CHAR*)"#include ", 10); OPM_Write('"'); OPM_WriteStringVar((void*)name, name__len); - OPM_WriteString((CHAR*)".h", (LONGINT)3); + OPM_WriteString((CHAR*)".h", 3); OPM_Write('"'); OPM_WriteLn(); __DEL(name); @@ -1154,8 +1155,8 @@ static void OPC_IncludeImports (OPT_Object obj, INTEGER vis) { if (obj != NIL) { OPC_IncludeImports(obj->left, vis); - if ((((obj->mode == 11 && obj->mnolev != 0)) && (int)OPT_GlbMod[__X(-obj->mnolev, ((LONGINT)(64)))]->vis >= vis)) { - OPC_Include(OPT_GlbMod[__X(-obj->mnolev, ((LONGINT)(64)))]->name, ((LONGINT)(256))); + if ((((obj->mode == 11 && obj->mnolev != 0)) && OPT_GlbMod[__X(-obj->mnolev, 64)]->vis >= vis)) { + OPC_Include(OPT_GlbMod[__X(-obj->mnolev, 64)]->name, 256); } OPC_IncludeImports(obj->right, vis); } @@ -1169,15 +1170,15 @@ static void OPC_GenDynTypes (OPT_Node n, INTEGER vis) if (vis == 0 || typ->ref < 255) { OPC_BegStat(); if (vis == 1) { - OPM_WriteString((CHAR*)"import ", (LONGINT)8); + OPM_WriteString((CHAR*)"import ", 8); } else if ((typ->strobj != NIL && typ->strobj->mnolev > 0)) { - OPM_WriteString((CHAR*)"static ", (LONGINT)8); + OPM_WriteString((CHAR*)"static ", 8); } else { - OPM_WriteString((CHAR*)"export ", (LONGINT)8); + OPM_WriteString((CHAR*)"export ", 8); } - OPM_WriteString((CHAR*)"LONGINT *", (LONGINT)10); + OPM_WriteString((CHAR*)"LONGINT *", 10); OPC_Andent(typ); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); OPC_EndStat(); } n = n->link; @@ -1195,25 +1196,25 @@ void OPC_GenHdr (OPT_Node n) OPC_GenDynTypes(n, 1); OPM_WriteLn(); OPC_ProcPredefs(OPT_topScope->right, 1); - OPM_WriteString((CHAR*)"import ", (LONGINT)8); - OPM_WriteString((CHAR*)"void *", (LONGINT)7); - OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); - OPM_WriteString(OPC_BodyNameExt, ((LONGINT)(13))); + OPM_WriteString((CHAR*)"import ", 8); + OPM_WriteString((CHAR*)"void *", 7); + OPM_WriteStringVar((void*)OPM_modName, 32); + OPM_WriteString(OPC_BodyNameExt, 13); OPC_EndStat(); OPM_WriteLn(); OPC_CProcDefs(OPT_topScope->right, 1); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#endif", (LONGINT)7); + OPM_WriteString((CHAR*)"#endif", 7); OPM_WriteLn(); } static void OPC_GenHeaderMsg (void) { INTEGER i; - OPM_WriteString((CHAR*)"/* ", (LONGINT)4); - OPM_WriteString((CHAR*)"voc", (LONGINT)4); + OPM_WriteString((CHAR*)"/* ", 4); + OPM_WriteString((CHAR*)"voc", 4); OPM_Write(' '); - OPM_WriteString(Configuration_versionLong, ((LONGINT)(41))); + OPM_WriteString(Configuration_versionLong, 41); OPM_Write(' '); i = 0; while (i <= 63) { @@ -1265,14 +1266,14 @@ static void OPC_GenHeaderMsg (void) OPM_Write('v'); break; default: - OPM_LogWStr((CHAR*)"( more options defined in OPM than checked in OPC.GenHeaderMsg, if you are a compiler developer, add them to OPC.GenHeaderMsg", (LONGINT)126); + OPM_LogWStr((CHAR*)"( more options defined in OPM than checked in OPC.GenHeaderMsg, if you are a compiler developer, add them to OPC.GenHeaderMsg", 126); OPM_LogWLn(); break; } } i += 1; } - OPM_WriteString((CHAR*)" */", (LONGINT)4); + OPM_WriteString((CHAR*)" */", 4); OPM_WriteLn(); } @@ -1281,20 +1282,20 @@ void OPC_GenHdrIncludes (void) OPM_currFile = 2; OPC_GenHeaderMsg(); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#ifndef ", (LONGINT)9); - OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); - OPM_WriteString((CHAR*)"__h", (LONGINT)4); + OPM_WriteString((CHAR*)"#ifndef ", 9); + OPM_WriteStringVar((void*)OPM_modName, 32); + OPM_WriteString((CHAR*)"__h", 4); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#define ", (LONGINT)9); - OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); - OPM_WriteString((CHAR*)"__h", (LONGINT)4); + OPM_WriteString((CHAR*)"#define ", 9); + OPM_WriteStringVar((void*)OPM_modName, 32); + OPM_WriteString((CHAR*)"__h", 4); OPM_WriteLn(); OPM_WriteLn(); if (OPM_LIntSize == 8) { - OPM_WriteString((CHAR*)"#define LARGE", (LONGINT)14); + OPM_WriteString((CHAR*)"#define LARGE", 14); OPM_WriteLn(); } - OPC_Include((CHAR*)"SYSTEM", (LONGINT)7); + OPC_Include((CHAR*)"SYSTEM", 7); OPC_IncludeImports(OPT_topScope->right, 1); OPM_WriteLn(); } @@ -1304,10 +1305,10 @@ void OPC_GenBdy (OPT_Node n) OPM_currFile = 1; OPC_GenHeaderMsg(); if (OPM_LIntSize == 8) { - OPM_WriteString((CHAR*)"#define LARGE", (LONGINT)14); + OPM_WriteString((CHAR*)"#define LARGE", 14); OPM_WriteLn(); } - OPC_Include((CHAR*)"SYSTEM", (LONGINT)7); + OPC_Include((CHAR*)"SYSTEM", 7); OPC_IncludeImports(OPT_topScope->right, 0); OPM_WriteLn(); OPC_DefAnonRecs(n); @@ -1330,9 +1331,9 @@ static void OPC_RegCmds (OPT_Object obj) if ((obj->mode == 7 && obj->history != 4)) { if ((((obj->vis != 0 && obj->link == NIL)) && obj->typ == OPT_notyp)) { OPC_BegStat(); - OPM_WriteString((CHAR*)"__REGCMD(\"", (LONGINT)11); - OPM_WriteStringVar((void*)obj->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"\", ", (LONGINT)4); + OPM_WriteString((CHAR*)"__REGCMD(\"", 11); + OPM_WriteStringVar((void*)obj->name, 256); + OPM_WriteString((CHAR*)"\", ", 4); OPC_Ident(obj); OPM_Write(')'); OPC_EndStat(); @@ -1348,8 +1349,8 @@ static void OPC_InitImports (OPT_Object obj) OPC_InitImports(obj->left); if ((obj->mode == 11 && obj->mnolev != 0)) { OPC_BegStat(); - OPM_WriteString((CHAR*)"__MODULE_IMPORT(", (LONGINT)17); - OPM_WriteStringVar((void*)OPT_GlbMod[__X(-obj->mnolev, ((LONGINT)(64)))]->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"__MODULE_IMPORT(", 17); + OPM_WriteStringVar((void*)OPT_GlbMod[__X(-obj->mnolev, 64)]->name, 256); OPM_Write(')'); OPC_EndStat(); } @@ -1367,31 +1368,31 @@ void OPC_GenEnumPtrs (OPT_Object var) if (OPC_NofPtrs(typ) > 0) { if (!OPC_GlbPtrs) { OPC_GlbPtrs = 1; - OPM_WriteString((CHAR*)"static ", (LONGINT)8); + OPM_WriteString((CHAR*)"static ", 8); if (OPC_ansi) { - OPM_WriteString((CHAR*)"void EnumPtrs(void (*P)(void*))", (LONGINT)32); + OPM_WriteString((CHAR*)"void EnumPtrs(void (*P)(void*))", 32); } else { - OPM_WriteString((CHAR*)"void EnumPtrs(P)", (LONGINT)17); + OPM_WriteString((CHAR*)"void EnumPtrs(P)", 17); OPM_WriteLn(); OPM_Write(0x09); - OPM_WriteString((CHAR*)"void (*P)();", (LONGINT)13); + OPM_WriteString((CHAR*)"void (*P)();", 13); } OPM_WriteLn(); OPC_BegBlk(); } OPC_BegStat(); if (typ->form == 13) { - OPM_WriteString((CHAR*)"P(", (LONGINT)3); + OPM_WriteString((CHAR*)"P(", 3); OPC_Ident(var); OPM_Write(')'); } else if (typ->comp == 4) { - OPM_WriteString((CHAR*)"__ENUMR(&", (LONGINT)10); + OPM_WriteString((CHAR*)"__ENUMR(&", 10); OPC_Ident(var); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Andent(typ); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); - OPC_Str1((CHAR*)", #", (LONGINT)4, typ->size); - OPM_WriteString((CHAR*)", 1, P)", (LONGINT)8); + OPM_WriteString((CHAR*)"__typ", 6); + OPC_Str1((CHAR*)", #", 4, typ->size); + OPM_WriteString((CHAR*)", 1, P)", 8); } else if (typ->comp == 2) { n = typ->n; typ = typ->BaseTyp; @@ -1400,17 +1401,17 @@ void OPC_GenEnumPtrs (OPT_Object var) typ = typ->BaseTyp; } if (typ->form == 13) { - OPM_WriteString((CHAR*)"__ENUMP(", (LONGINT)9); + OPM_WriteString((CHAR*)"__ENUMP(", 9); OPC_Ident(var); - OPC_Str1((CHAR*)", #, P)", (LONGINT)8, n); + OPC_Str1((CHAR*)", #, P)", 8, n); } else if (typ->comp == 4) { - OPM_WriteString((CHAR*)"__ENUMR(", (LONGINT)9); + OPM_WriteString((CHAR*)"__ENUMR(", 9); OPC_Ident(var); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Andent(typ); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); - OPC_Str1((CHAR*)", #", (LONGINT)4, typ->size); - OPC_Str1((CHAR*)", #, P)", (LONGINT)8, n); + OPM_WriteString((CHAR*)"__typ", 6); + OPC_Str1((CHAR*)", #", 4, typ->size); + OPC_Str1((CHAR*)", #, P)", 8, n); } } OPC_EndStat(); @@ -1426,49 +1427,49 @@ void OPC_GenEnumPtrs (OPT_Object var) void OPC_EnterBody (void) { OPM_WriteLn(); - OPM_WriteString((CHAR*)"export ", (LONGINT)8); + OPM_WriteString((CHAR*)"export ", 8); if (OPC_mainprog) { if (OPC_ansi) { - OPM_WriteString((CHAR*)"int main(int argc, char **argv)", (LONGINT)32); + OPM_WriteString((CHAR*)"int main(int argc, char **argv)", 32); OPM_WriteLn(); } else { - OPM_WriteString((CHAR*)"main(argc, argv)", (LONGINT)17); + OPM_WriteString((CHAR*)"main(argc, argv)", 17); OPM_WriteLn(); OPM_Write(0x09); - OPM_WriteString((CHAR*)"int argc; char **argv;", (LONGINT)23); + OPM_WriteString((CHAR*)"int argc; char **argv;", 23); OPM_WriteLn(); } } else { - OPM_WriteString((CHAR*)"void *", (LONGINT)7); - OPM_WriteString(OPM_modName, ((LONGINT)(32))); - OPM_WriteString(OPC_BodyNameExt, ((LONGINT)(13))); + OPM_WriteString((CHAR*)"void *", 7); + OPM_WriteString(OPM_modName, 32); + OPM_WriteString(OPC_BodyNameExt, 13); OPM_WriteLn(); } OPC_BegBlk(); OPC_BegStat(); if (OPC_mainprog) { - OPM_WriteString((CHAR*)"__INIT(argc, argv)", (LONGINT)19); + OPM_WriteString((CHAR*)"__INIT(argc, argv)", 19); } else { - OPM_WriteString((CHAR*)"__DEFMOD", (LONGINT)9); + OPM_WriteString((CHAR*)"__DEFMOD", 9); } OPC_EndStat(); if ((OPC_mainprog && 0)) { OPC_BegStat(); - OPM_WriteString((CHAR*)"/*don`t do it!*/ printf(\"DEMO VERSION: DO NOT USE THIS PROGRAM FOR ANY COMMERCIAL PURPOSE\\n\")", (LONGINT)94); + OPM_WriteString((CHAR*)"/*don`t do it!*/ printf(\"DEMO VERSION: DO NOT USE THIS PROGRAM FOR ANY COMMERCIAL PURPOSE\\n\")", 94); OPC_EndStat(); } OPC_InitImports(OPT_topScope->right); OPC_BegStat(); if (OPC_mainprog) { - OPM_WriteString((CHAR*)"__REGMAIN(\"", (LONGINT)12); + OPM_WriteString((CHAR*)"__REGMAIN(\"", 12); } else { - OPM_WriteString((CHAR*)"__REGMOD(\"", (LONGINT)11); + OPM_WriteString((CHAR*)"__REGMOD(\"", 11); } - OPM_WriteString(OPM_modName, ((LONGINT)(32))); + OPM_WriteString(OPM_modName, 32); if (OPC_GlbPtrs) { - OPM_WriteString((CHAR*)"\", EnumPtrs)", (LONGINT)13); + OPM_WriteString((CHAR*)"\", EnumPtrs)", 13); } else { - OPM_WriteString((CHAR*)"\", 0)", (LONGINT)6); + OPM_WriteString((CHAR*)"\", 0)", 6); } OPC_EndStat(); if (__STRCMP(OPM_modName, "SYSTEM") != 0) { @@ -1480,9 +1481,9 @@ void OPC_ExitBody (void) { OPC_BegStat(); if (OPC_mainprog) { - OPM_WriteString((CHAR*)"__FINI;", (LONGINT)8); + OPM_WriteString((CHAR*)"__FINI;", 8); } else { - OPM_WriteString((CHAR*)"__ENDMOD;", (LONGINT)10); + OPM_WriteString((CHAR*)"__ENDMOD;", 10); } OPM_WriteLn(); OPC_EndBlk(); @@ -1492,25 +1493,25 @@ void OPC_DefineInter (OPT_Object proc) { OPT_Object scope = NIL; scope = proc->scope; - OPM_WriteString((CHAR*)"static ", (LONGINT)8); - OPM_WriteString((CHAR*)"struct ", (LONGINT)8); - OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"static ", 8); + OPM_WriteString((CHAR*)"struct ", 8); + OPM_WriteStringVar((void*)scope->name, 256); OPM_Write(' '); OPC_BegBlk(); OPC_IdentList(proc->link, 3); OPC_IdentList(scope->scope, 3); OPC_BegStat(); - OPM_WriteString((CHAR*)"struct ", (LONGINT)8); - OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"struct ", 8); + OPM_WriteStringVar((void*)scope->name, 256); OPM_Write(' '); OPM_Write('*'); - OPM_WriteString((CHAR*)"lnk", (LONGINT)4); + OPM_WriteString((CHAR*)"lnk", 4); OPC_EndStat(); OPC_EndBlk0(); OPM_Write(' '); OPM_Write('*'); - OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteStringVar((void*)scope->name, 256); + OPM_WriteString((CHAR*)"_s", 3); OPC_EndStat(); OPM_WriteLn(); OPC_ProcPredefs(scope->right, 0); @@ -1523,24 +1524,24 @@ void OPC_EnterProc (OPT_Object proc) OPT_Struct typ = NIL; INTEGER dim; if (proc->vis != 1) { - OPM_WriteString((CHAR*)"static ", (LONGINT)8); + OPM_WriteString((CHAR*)"static ", 8); } OPC_ProcHeader(proc, 1); OPC_BegBlk(); if (proc->typ != OPT_notyp) { OPC_BegStat(); OPC_Ident(proc->typ->strobj); - OPM_WriteString((CHAR*)" _o_result;", (LONGINT)12); + OPM_WriteString((CHAR*)" _o_result;", 12); OPM_WriteLn(); } scope = proc->scope; OPC_IdentList(scope->scope, 0); if (!scope->leaf) { OPC_BegStat(); - OPM_WriteString((CHAR*)"struct ", (LONGINT)8); - OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"struct ", 8); + OPM_WriteStringVar((void*)scope->name, 256); OPM_Write(' '); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"_s", 3); OPC_EndStat(); } var = proc->link; @@ -1554,7 +1555,7 @@ void OPC_EnterProc (OPT_Object proc) } OPM_Write(' '); OPC_Ident(var); - OPM_WriteString((CHAR*)"__copy", (LONGINT)7); + OPM_WriteString((CHAR*)"__copy", 7); OPC_EndStat(); } var = var->link; @@ -1567,7 +1568,7 @@ void OPC_EnterProc (OPT_Object proc) OPC_Ident(var->typ->strobj); OPM_Write(' '); OPC_Ident(var); - OPM_WriteString((CHAR*)" = _", (LONGINT)5); + OPM_WriteString((CHAR*)" = _", 5); OPC_Ident(var); OPC_EndStat(); } @@ -1579,31 +1580,31 @@ void OPC_EnterProc (OPT_Object proc) if ((((__IN(var->typ->comp, 0x0c) && var->mode == 1)) && var->typ->sysflag == 0)) { OPC_BegStat(); if (var->typ->comp == 2) { - OPM_WriteString((CHAR*)"__DUPARR(", (LONGINT)10); + OPM_WriteString((CHAR*)"__DUPARR(", 10); OPC_Ident(var); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); if (var->typ->strobj == NIL) { OPM_Mark(200, var->typ->txtpos); } else { OPC_Ident(var->typ->strobj); } } else { - OPM_WriteString((CHAR*)"__DUP(", (LONGINT)7); + OPM_WriteString((CHAR*)"__DUP(", 7); OPC_Ident(var); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Ident(var); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); typ = var->typ->BaseTyp; dim = 1; while (typ->comp == 3) { - OPM_WriteString((CHAR*)" * ", (LONGINT)4); + OPM_WriteString((CHAR*)" * ", 4); OPC_Ident(var); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); OPM_WriteInt(dim); typ = typ->BaseTyp; dim += 1; } - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); if (typ->strobj == NIL) { OPM_Mark(200, typ->txtpos); } else { @@ -1620,12 +1621,12 @@ void OPC_EnterProc (OPT_Object proc) while (var != NIL) { if (!var->leaf) { OPC_BegStat(); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"_s", 3); OPM_Write('.'); OPC_Ident(var); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteString((CHAR*)" = ", 4); if (__IN(var->typ->comp, 0x0c)) { - OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(void*)", 8); } else if (var->mode != 2) { OPM_Write('&'); } @@ -1634,31 +1635,31 @@ void OPC_EnterProc (OPT_Object proc) typ = var->typ; dim = 0; do { - OPM_WriteString((CHAR*)"; ", (LONGINT)3); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"; ", 3); + OPM_WriteString((CHAR*)"_s", 3); OPM_Write('.'); OPC_Ident(var); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); if (dim != 0) { OPM_WriteInt(dim); } - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteString((CHAR*)" = ", 4); OPC_Ident(var); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); if (dim != 0) { OPM_WriteInt(dim); } typ = typ->BaseTyp; } while (!(typ->comp != 3)); } else if ((var->mode == 2 && var->typ->comp == 4)) { - OPM_WriteString((CHAR*)"; ", (LONGINT)3); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"; ", 3); + OPM_WriteString((CHAR*)"_s", 3); OPM_Write('.'); OPC_Ident(var); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteString((CHAR*)"__typ", 6); + OPM_WriteString((CHAR*)" = ", 4); OPC_Ident(var); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } OPC_EndStat(); } @@ -1668,14 +1669,14 @@ void OPC_EnterProc (OPT_Object proc) while (var != NIL) { if (!var->leaf) { OPC_BegStat(); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"_s", 3); OPM_Write('.'); OPC_Ident(var); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteString((CHAR*)" = ", 4); if (var->typ->comp != 2) { OPM_Write('&'); } else { - OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(void*)", 8); } OPC_Ident(var); OPC_EndStat(); @@ -1683,19 +1684,19 @@ void OPC_EnterProc (OPT_Object proc) var = var->link; } OPC_BegStat(); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"_s", 3); OPM_Write('.'); - OPM_WriteString((CHAR*)"lnk", (LONGINT)4); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); - OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"lnk", 4); + OPM_WriteString((CHAR*)" = ", 4); + OPM_WriteStringVar((void*)scope->name, 256); + OPM_WriteString((CHAR*)"_s", 3); OPC_EndStat(); OPC_BegStat(); - OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteStringVar((void*)scope->name, 256); + OPM_WriteString((CHAR*)"_s", 3); + OPM_WriteString((CHAR*)" = ", 4); OPM_Write('&'); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"_s", 3); OPC_EndStat(); } } @@ -1707,7 +1708,7 @@ void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet) indent = eoBlock; if ((implicitRet && proc->typ != OPT_notyp)) { OPM_Write(0x09); - OPM_WriteString((CHAR*)"__RETCHK;", (LONGINT)10); + OPM_WriteString((CHAR*)"__RETCHK;", 10); OPM_WriteLn(); } else if (!eoBlock || implicitRet) { if (!proc->scope->leaf) { @@ -1716,12 +1717,12 @@ void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet) } else { indent = 1; } - OPM_WriteStringVar((void*)proc->scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteStringVar((void*)proc->scope->name, 256); + OPM_WriteString((CHAR*)"_s", 3); + OPM_WriteString((CHAR*)" = ", 4); + OPM_WriteString((CHAR*)"_s", 3); OPM_Write('.'); - OPM_WriteString((CHAR*)"lnk", (LONGINT)4); + OPM_WriteString((CHAR*)"lnk", 4); OPC_EndStat(); } var = proc->link; @@ -1732,7 +1733,7 @@ void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet) } else { indent = 1; } - OPM_WriteString((CHAR*)"__DEL(", (LONGINT)7); + OPM_WriteString((CHAR*)"__DEL(", 7); OPC_Ident(var); OPM_Write(')'); OPC_EndStat(); @@ -1755,9 +1756,9 @@ void OPC_CompleteIdent (OPT_Object obj) if (obj->adr == 1) { if (obj->typ->comp == 4) { OPC_Ident(obj); - OPM_WriteString((CHAR*)"__", (LONGINT)3); + OPM_WriteString((CHAR*)"__", 3); } else { - OPM_WriteString((CHAR*)"((", (LONGINT)3); + OPM_WriteString((CHAR*)"((", 3); OPC_Ident(obj->typ->strobj); OPM_Write(')'); OPC_Ident(obj); @@ -1768,9 +1769,9 @@ void OPC_CompleteIdent (OPT_Object obj) if ((obj->mode != 2 && comp != 3)) { OPM_Write('*'); } - OPM_WriteStringVar((void*)obj->scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); - OPM_WriteString((CHAR*)"->", (LONGINT)3); + OPM_WriteStringVar((void*)obj->scope->name, 256); + OPM_WriteString((CHAR*)"_s", 3); + OPM_WriteString((CHAR*)"->", 3); OPC_Ident(obj); } else { OPC_Ident(obj); @@ -1782,17 +1783,17 @@ void OPC_TypeOf (OPT_Object ap) INTEGER i; __ASSERT(ap->typ->comp == 4, 0); if (ap->mode == 2) { - if ((int)ap->mnolev != OPM_level) { - OPM_WriteStringVar((void*)ap->scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"_s->", (LONGINT)5); + if (ap->mnolev != OPM_level) { + OPM_WriteStringVar((void*)ap->scope->name, 256); + OPM_WriteString((CHAR*)"_s->", 5); OPC_Ident(ap); } else { OPC_Ident(ap); } - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } else if (ap->typ->strobj != NIL) { OPC_Ident(ap->typ->strobj); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } else { OPC_Andent(ap->typ); } @@ -1802,26 +1803,26 @@ void OPC_Cmp (INTEGER rel) { switch (rel) { case 9: - OPM_WriteString((CHAR*)" == ", (LONGINT)5); + OPM_WriteString((CHAR*)" == ", 5); break; case 10: - OPM_WriteString((CHAR*)" != ", (LONGINT)5); + OPM_WriteString((CHAR*)" != ", 5); break; case 11: - OPM_WriteString((CHAR*)" < ", (LONGINT)4); + OPM_WriteString((CHAR*)" < ", 4); break; case 12: - OPM_WriteString((CHAR*)" <= ", (LONGINT)5); + OPM_WriteString((CHAR*)" <= ", 5); break; case 13: - OPM_WriteString((CHAR*)" > ", (LONGINT)4); + OPM_WriteString((CHAR*)" > ", 4); break; case 14: - OPM_WriteString((CHAR*)" >= ", (LONGINT)5); + OPM_WriteString((CHAR*)" >= ", 5); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPC.Cmp, rel = ", (LONGINT)34); - OPM_LogWNum(rel, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPC.Cmp, rel = ", 34); + OPM_LogWNum(rel, 0); OPM_LogWLn(); break; } @@ -1830,7 +1831,7 @@ void OPC_Cmp (INTEGER rel) static void OPC_CharacterLiteral (LONGINT c) { if (c < 32 || c > 126) { - OPM_WriteString((CHAR*)"0x", (LONGINT)3); + OPM_WriteString((CHAR*)"0x", 3); OPM_WriteHex(c); } else { OPM_Write('\''); @@ -1850,7 +1851,7 @@ static void OPC_StringLiteral (CHAR *s, LONGINT s__len, LONGINT l) OPM_Write('"'); i = 0; while (i < l) { - c = (int)s[__X(i, s__len)]; + c = s[__X(i, s__len)]; if (c < 32 || c > 126) { OPM_Write('\\'); OPM_Write((CHAR)(48 + __ASHR(c, 6))); @@ -1873,7 +1874,7 @@ static void OPC_StringLiteral (CHAR *s, LONGINT s__len, LONGINT l) void OPC_Case (LONGINT caseVal, INTEGER form) { CHAR ch; - OPM_WriteString((CHAR*)"case ", (LONGINT)6); + OPM_WriteString((CHAR*)"case ", 6); switch (form) { case 3: OPC_CharacterLiteral(caseVal); @@ -1882,42 +1883,68 @@ void OPC_Case (LONGINT caseVal, INTEGER form) OPM_WriteInt(caseVal); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPC.Case, form = ", (LONGINT)36); - OPM_LogWNum(form, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPC.Case, form = ", 36); + OPM_LogWNum(form, 0); OPM_LogWLn(); break; } - OPM_WriteString((CHAR*)": ", (LONGINT)3); + OPM_WriteString((CHAR*)": ", 3); } void OPC_SetInclude (BOOLEAN exclude) { if (exclude) { - OPM_WriteString((CHAR*)" &= ~", (LONGINT)6); + OPM_WriteString((CHAR*)" &= ~", 6); } else { - OPM_WriteString((CHAR*)" |= ", (LONGINT)5); + OPM_WriteString((CHAR*)" |= ", 5); } } void OPC_Increment (BOOLEAN decrement) { if (decrement) { - OPM_WriteString((CHAR*)" -= ", (LONGINT)5); + OPM_WriteString((CHAR*)" -= ", 5); } else { - OPM_WriteString((CHAR*)" += ", (LONGINT)5); + OPM_WriteString((CHAR*)" += ", 5); } } void OPC_Halt (LONGINT n) { - OPC_Str1((CHAR*)"__HALT(#)", (LONGINT)10, n); + OPC_Str1((CHAR*)"__HALT(#)", 10, n); +} + +void OPC_IntLiteral (LONGINT n, LONGINT size) +{ + if ((((size > 4 && n <= 2147483647)) && n > (-2147483647-1))) { + switch (size) { + case 2: + OPM_WriteString((CHAR*)"((SYSTEM_INT16)(", 17); + break; + case 4: + OPM_WriteString((CHAR*)"((SYSTEM_INT32)(", 17); + break; + case 8: + OPM_WriteString((CHAR*)"((SYSTEM_INT64)(", 17); + break; + default: + OPM_LogWStr((CHAR*)"Unhandled case in OPC.IntLiteral, size = ", 42); + OPM_LogWNum(size, 1); + OPM_LogWLn(); + break; + } + OPM_WriteInt(n); + OPM_WriteString((CHAR*)"))", 3); + } else { + OPM_WriteInt(n); + } } void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim) { if (array->comp == 3) { OPC_CompleteIdent(obj); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); if (dim != 0) { OPM_WriteInt(dim); } @@ -1926,9 +1953,11 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim) array = array->BaseTyp; dim -= 1; } - OPM_WriteString((CHAR*)"((LONGINT)(", (LONGINT)12); - OPM_WriteInt(array->n); - OPM_WriteString((CHAR*)"))", (LONGINT)3); + if (OPC_ansi) { + OPM_WriteInt(array->n); + } else { + OPC_IntLiteral(array->n, OPM_PointerSize); + } } } @@ -1958,7 +1987,7 @@ void OPC_Constant (OPT_Const con, INTEGER form) OPM_WriteReal(con->realval, 0x00); break; case 9: - OPM_WriteString((CHAR*)"0x", (LONGINT)3); + OPM_WriteString((CHAR*)"0x", 3); skipLeading = 1; s = con->setval; i = 64; @@ -1981,14 +2010,14 @@ void OPC_Constant (OPT_Const con, INTEGER form) } break; case 10: - OPC_StringLiteral(*con->ext, ((LONGINT)(256)), con->intval2 - 1); + OPC_StringLiteral(*con->ext, 256, con->intval2 - 1); break; case 11: - OPM_WriteString((CHAR*)"NIL", (LONGINT)4); + OPM_WriteString((CHAR*)"NIL", 4); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPC.Constant, form = ", (LONGINT)40); - OPM_LogWNum(form, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPC.Constant, form = ", 40); + OPM_LogWNum(form, 0); OPM_LogWLn(); break; } @@ -2006,8 +2035,8 @@ static void Enter__49 (CHAR *s, LONGINT s__len) INTEGER h; __DUP(s, s__len, CHAR); h = OPC_PerfectHash((void*)s, s__len); - OPC_hashtab[__X(h, ((LONGINT)(105)))] = *InitKeywords__48_s->n; - __COPY(s, OPC_keytab[__X(*InitKeywords__48_s->n, ((LONGINT)(36)))], ((LONGINT)(9))); + OPC_hashtab[__X(h, 105)] = *InitKeywords__48_s->n; + __COPY(s, OPC_keytab[__X(*InitKeywords__48_s->n, 36)], 9); *InitKeywords__48_s->n += 1; __DEL(s); } @@ -2022,45 +2051,45 @@ static void OPC_InitKeywords (void) n = 0; i = 0; while (i <= 104) { - OPC_hashtab[__X(i, ((LONGINT)(105)))] = -1; + OPC_hashtab[__X(i, 105)] = -1; i += 1; } - Enter__49((CHAR*)"asm", (LONGINT)4); - Enter__49((CHAR*)"auto", (LONGINT)5); - Enter__49((CHAR*)"break", (LONGINT)6); - Enter__49((CHAR*)"case", (LONGINT)5); - Enter__49((CHAR*)"char", (LONGINT)5); - Enter__49((CHAR*)"const", (LONGINT)6); - Enter__49((CHAR*)"continue", (LONGINT)9); - Enter__49((CHAR*)"default", (LONGINT)8); - Enter__49((CHAR*)"do", (LONGINT)3); - Enter__49((CHAR*)"double", (LONGINT)7); - Enter__49((CHAR*)"else", (LONGINT)5); - Enter__49((CHAR*)"enum", (LONGINT)5); - Enter__49((CHAR*)"extern", (LONGINT)7); - Enter__49((CHAR*)"export", (LONGINT)7); - Enter__49((CHAR*)"float", (LONGINT)6); - Enter__49((CHAR*)"for", (LONGINT)4); - Enter__49((CHAR*)"fortran", (LONGINT)8); - Enter__49((CHAR*)"goto", (LONGINT)5); - Enter__49((CHAR*)"if", (LONGINT)3); - Enter__49((CHAR*)"import", (LONGINT)7); - Enter__49((CHAR*)"int", (LONGINT)4); - Enter__49((CHAR*)"long", (LONGINT)5); - Enter__49((CHAR*)"register", (LONGINT)9); - Enter__49((CHAR*)"return", (LONGINT)7); - Enter__49((CHAR*)"short", (LONGINT)6); - Enter__49((CHAR*)"signed", (LONGINT)7); - Enter__49((CHAR*)"sizeof", (LONGINT)7); - Enter__49((CHAR*)"static", (LONGINT)7); - Enter__49((CHAR*)"struct", (LONGINT)7); - Enter__49((CHAR*)"switch", (LONGINT)7); - Enter__49((CHAR*)"typedef", (LONGINT)8); - Enter__49((CHAR*)"union", (LONGINT)6); - Enter__49((CHAR*)"unsigned", (LONGINT)9); - Enter__49((CHAR*)"void", (LONGINT)5); - Enter__49((CHAR*)"volatile", (LONGINT)9); - Enter__49((CHAR*)"while", (LONGINT)6); + Enter__49((CHAR*)"asm", 4); + Enter__49((CHAR*)"auto", 5); + Enter__49((CHAR*)"break", 6); + Enter__49((CHAR*)"case", 5); + Enter__49((CHAR*)"char", 5); + Enter__49((CHAR*)"const", 6); + Enter__49((CHAR*)"continue", 9); + Enter__49((CHAR*)"default", 8); + Enter__49((CHAR*)"do", 3); + Enter__49((CHAR*)"double", 7); + Enter__49((CHAR*)"else", 5); + Enter__49((CHAR*)"enum", 5); + Enter__49((CHAR*)"extern", 7); + Enter__49((CHAR*)"export", 7); + Enter__49((CHAR*)"float", 6); + Enter__49((CHAR*)"for", 4); + Enter__49((CHAR*)"fortran", 8); + Enter__49((CHAR*)"goto", 5); + Enter__49((CHAR*)"if", 3); + Enter__49((CHAR*)"import", 7); + Enter__49((CHAR*)"int", 4); + Enter__49((CHAR*)"long", 5); + Enter__49((CHAR*)"register", 9); + Enter__49((CHAR*)"return", 7); + Enter__49((CHAR*)"short", 6); + Enter__49((CHAR*)"signed", 7); + Enter__49((CHAR*)"sizeof", 7); + Enter__49((CHAR*)"static", 7); + Enter__49((CHAR*)"struct", 7); + Enter__49((CHAR*)"switch", 7); + Enter__49((CHAR*)"typedef", 8); + Enter__49((CHAR*)"union", 6); + Enter__49((CHAR*)"unsigned", 9); + Enter__49((CHAR*)"void", 5); + Enter__49((CHAR*)"volatile", 9); + Enter__49((CHAR*)"while", 6); InitKeywords__48_s = _s.lnk; } diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index de932c60..21b48db8 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h @@ -38,6 +38,7 @@ import void OPC_Increment (BOOLEAN decrement); import void OPC_Indent (INTEGER count); import void OPC_Init (void); import void OPC_InitTDesc (OPT_Struct typ); +import void OPC_IntLiteral (LONGINT n, LONGINT size); import void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim); import LONGINT OPC_NofPtrs (OPT_Struct typ); import void OPC_SetInclude (BOOLEAN exclude); diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 0e43a013..edc81f01 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -155,20 +155,20 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) case 'B': if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_IntSize = (int)s[__X(i, s__len)] - 48; + OPM_IntSize = s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_PointerSize = (int)s[__X(i, s__len)] - 48; + OPM_PointerSize = s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_Alignment = (int)s[__X(i, s__len)] - 48; + OPM_Alignment = s[__X(i, s__len)] - 48; } __ASSERT(OPM_IntSize == 2 || OPM_IntSize == 4, 0); __ASSERT(OPM_PointerSize == 4 || OPM_PointerSize == 8, 0); __ASSERT(OPM_Alignment == 4 || OPM_Alignment == 8, 0); - Files_SetSearchPath((CHAR*)"", (LONGINT)1); + Files_SetSearchPath((CHAR*)"", 1); break; case 'F': *opt = *opt ^ 0x020000; @@ -183,10 +183,10 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) *opt = *opt ^ 0x040000; break; default: - OPM_LogWStr((CHAR*)" warning: option ", (LONGINT)19); + OPM_LogWStr((CHAR*)" warning: option ", 19); OPM_LogW('-'); OPM_LogW(s[__X(i, s__len)]); - OPM_LogWStr((CHAR*)" ignored", (LONGINT)9); + OPM_LogWStr((CHAR*)" ignored", 9); OPM_LogWLn(); break; } @@ -200,71 +200,71 @@ BOOLEAN OPM_OpenPar (void) CHAR s[256]; if (Platform_ArgCount == 1) { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Vishap Oberon-2 compiler v", (LONGINT)27); - OPM_LogWStr(Configuration_versionLong, ((LONGINT)(41))); + OPM_LogWStr((CHAR*)"Vishap Oberon-2 compiler v", 27); + OPM_LogWStr(Configuration_versionLong, 41); OPM_LogW('.'); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Based on Ofront by Software Templ OEG, continued by Norayr Chilingarian and others.", (LONGINT)84); + OPM_LogWStr((CHAR*)"Based on Ofront by Software Templ OEG, continued by Norayr Chilingarian and others.", 84); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Usage:", (LONGINT)7); + OPM_LogWStr((CHAR*)"Usage:", 7); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" ", (LONGINT)3); - OPM_LogWStr((CHAR*)"voc", (LONGINT)4); - OPM_LogWStr((CHAR*)" options {files {options}}.", (LONGINT)28); + OPM_LogWStr((CHAR*)" ", 3); + OPM_LogWStr((CHAR*)"voc", 4); + OPM_LogWStr((CHAR*)" options {files {options}}.", 28); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Where options = [\"-\" {option} ].", (LONGINT)33); + OPM_LogWStr((CHAR*)"Where options = [\"-\" {option} ].", 33); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" m - generate code for main module", (LONGINT)36); + OPM_LogWStr((CHAR*)" m - generate code for main module", 36); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" M - generate code for main module and link object statically", (LONGINT)63); + OPM_LogWStr((CHAR*)" M - generate code for main module and link object statically", 63); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" s - generate new symbol file", (LONGINT)31); + OPM_LogWStr((CHAR*)" s - generate new symbol file", 31); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" e - allow extending the module interface", (LONGINT)43); + OPM_LogWStr((CHAR*)" e - allow extending the module interface", 43); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" r - check value ranges", (LONGINT)25); + OPM_LogWStr((CHAR*)" r - check value ranges", 25); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" x - turn off array indices check", (LONGINT)35); + OPM_LogWStr((CHAR*)" x - turn off array indices check", 35); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" a - don't check ASSERTs at runtime, use this option in tested production code", (LONGINT)80); + OPM_LogWStr((CHAR*)" a - don't check ASSERTs at runtime, use this option in tested production code", 80); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" p - turn off automatic pointer initialization", (LONGINT)48); + OPM_LogWStr((CHAR*)" p - turn off automatic pointer initialization", 48); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" t - don't check type guards (use in rare cases such as low-level modules where every cycle counts)", (LONGINT)101); + OPM_LogWStr((CHAR*)" t - don't check type guards (use in rare cases such as low-level modules where every cycle counts)", 101); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" S - don't call external assembler/compiler, only generate C code", (LONGINT)67); + OPM_LogWStr((CHAR*)" S - don't call external assembler/compiler, only generate C code", 67); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" c - don't call linker", (LONGINT)24); + OPM_LogWStr((CHAR*)" c - don't call linker", 24); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" f - don't use color output", (LONGINT)29); + OPM_LogWStr((CHAR*)" f - don't use color output", 29); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" F - force writing new symbol file in current directory", (LONGINT)57); + OPM_LogWStr((CHAR*)" F - force writing new symbol file in current directory", 57); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" V - verbose output", (LONGINT)21); + OPM_LogWStr((CHAR*)" V - verbose output", 21); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Initial options specify defaults for all files.", (LONGINT)48); + OPM_LogWStr((CHAR*)"Initial options specify defaults for all files.", 48); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Options following a filename are specific to that file.", (LONGINT)56); + OPM_LogWStr((CHAR*)"Options following a filename are specific to that file.", 56); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Repeating an option toggles its value.", (LONGINT)39); + OPM_LogWStr((CHAR*)"Repeating an option toggles its value.", 39); OPM_LogWLn(); _o_result = 0; return _o_result; } else { OPM_S = 1; s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + Platform_GetArg(OPM_S, (void*)s, 256); OPM_glbopt = 0xe9; while (s[0] == '-') { - OPM_ScanOptions((void*)s, ((LONGINT)(256)), &OPM_glbopt); + OPM_ScanOptions((void*)s, 256, &OPM_glbopt); OPM_S += 1; s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + Platform_GetArg(OPM_S, (void*)s, 256); } _o_result = 1; return _o_result; @@ -277,12 +277,12 @@ void OPM_InitOptions (void) CHAR s[256]; OPM_opt = OPM_glbopt; s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + Platform_GetArg(OPM_S, (void*)s, 256); while (s[0] == '-') { - OPM_ScanOptions((void*)s, ((LONGINT)(256)), &OPM_opt); + OPM_ScanOptions((void*)s, 256, &OPM_opt); OPM_S += 1; s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + Platform_GetArg(OPM_S, (void*)s, 256); } OPM_dontAsm = __IN(13, OPM_opt); OPM_dontLink = __IN(14, OPM_opt); @@ -308,19 +308,19 @@ void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len) return; } s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + Platform_GetArg(OPM_S, (void*)s, 256); __NEW(T, Texts_TextDesc); - Texts_Open(T, s, ((LONGINT)(256))); - OPM_LogWStr(s, ((LONGINT)(256))); - OPM_LogWStr((CHAR*)" ", (LONGINT)3); + Texts_Open(T, s, 256); + OPM_LogWStr(s, 256); + OPM_LogWStr((CHAR*)" ", 3); __COPY(s, mname, mname__len); - __COPY(s, OPM_SourceFileName, ((LONGINT)(256))); + __COPY(s, OPM_SourceFileName, 256); if (T->len == 0) { - OPM_LogWStr(s, ((LONGINT)(256))); - OPM_LogWStr((CHAR*)" not found.", (LONGINT)12); + OPM_LogWStr(s, 256); + OPM_LogWStr((CHAR*)" not found.", 12); OPM_LogWLn(); } else { - Texts_OpenReader(&OPM_inR, Texts_Reader__typ, T, ((LONGINT)(0))); + Texts_OpenReader(&OPM_inR, Texts_Reader__typ, T, 0); *done = 1; } OPM_S += 1; @@ -379,25 +379,25 @@ static void OPM_LogErrMsg (INTEGER n) CHAR buf[1024]; if (n >= 0) { if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"31m", (LONGINT)4); + vt100_SetAttr((CHAR*)"31m", 4); } - OPM_LogWStr((CHAR*)" err ", (LONGINT)7); + OPM_LogWStr((CHAR*)" err ", 7); if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + vt100_SetAttr((CHAR*)"0m", 3); } } else { if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"35m", (LONGINT)4); + vt100_SetAttr((CHAR*)"35m", 4); } - OPM_LogWStr((CHAR*)" warning ", (LONGINT)11); + OPM_LogWStr((CHAR*)" warning ", 11); n = -n; if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + vt100_SetAttr((CHAR*)"0m", 3); } } - OPM_LogWNum(n, ((LONGINT)(1))); - OPM_LogWStr((CHAR*)" ", (LONGINT)3); - OPM_LogWStr(errors_errors[__X(n, ((LONGINT)(350)))], ((LONGINT)(128))); + OPM_LogWNum(n, 1); + OPM_LogWStr((CHAR*)" ", 3); + OPM_LogWStr(errors_errors[__X(n, 350)], 128); } static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, LONGINT pos) @@ -439,37 +439,37 @@ static void OPM_ShowLine (LONGINT pos) CHAR line[1023]; INTEGER i; CHAR ch; - f = Files_Old(OPM_SourceFileName, ((LONGINT)(256))); + f = Files_Old(OPM_SourceFileName, 256); OPM_FindLine(f, &r, Files_Rider__typ, pos); i = 0; Files_Read(&r, Files_Rider__typ, (void*)&ch); while ((((((ch != 0x00 && ch != 0x0d)) && ch != 0x0a)) && i < 1022)) { - line[__X(i, ((LONGINT)(1023)))] = ch; + line[__X(i, 1023)] = ch; i += 1; Files_Read(&r, Files_Rider__typ, (void*)&ch); } - line[__X(i, ((LONGINT)(1023)))] = 0x00; + line[__X(i, 1023)] = 0x00; OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWNum(OPM_ErrorLineNumber, ((LONGINT)(4))); - OPM_LogWStr((CHAR*)": ", (LONGINT)3); - OPM_LogWStr(line, ((LONGINT)(1023))); + OPM_LogWNum(OPM_ErrorLineNumber, 4); + OPM_LogWStr((CHAR*)": ", 3); + OPM_LogWStr(line, 1023); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" ", (LONGINT)7); + OPM_LogWStr((CHAR*)" ", 7); if (pos >= OPM_ErrorLineLimitPos) { pos = OPM_ErrorLineLimitPos - 1; } - i = (int)(pos - OPM_ErrorLineStartPos); + i = (SYSTEM_INT32)(pos - OPM_ErrorLineStartPos); while (i > 0) { OPM_LogW(' '); i -= 1; } if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"32m", (LONGINT)4); + vt100_SetAttr((CHAR*)"32m", 4); } OPM_LogW('^'); if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + vt100_SetAttr((CHAR*)"0m", 3); } Files_Close(f); } @@ -485,30 +485,30 @@ void OPM_Mark (INTEGER n, LONGINT pos) OPM_lasterrpos = pos; OPM_ShowLine(pos); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" ", (LONGINT)3); + OPM_LogWStr((CHAR*)" ", 3); if (n < 249) { - OPM_LogWStr((CHAR*)" pos", (LONGINT)6); - OPM_LogWNum(pos, ((LONGINT)(6))); + OPM_LogWStr((CHAR*)" pos", 6); + OPM_LogWNum(pos, 6); OPM_LogErrMsg(n); } else if (n == 255) { - OPM_LogWStr((CHAR*)"pos", (LONGINT)4); - OPM_LogWNum(pos, ((LONGINT)(6))); - OPM_LogWStr((CHAR*)" pc ", (LONGINT)6); - OPM_LogWNum(OPM_breakpc, ((LONGINT)(1))); + OPM_LogWStr((CHAR*)"pos", 4); + OPM_LogWNum(pos, 6); + OPM_LogWStr((CHAR*)" pc ", 6); + OPM_LogWNum(OPM_breakpc, 1); } else if (n == 254) { - OPM_LogWStr((CHAR*)"pc not found", (LONGINT)13); + OPM_LogWStr((CHAR*)"pc not found", 13); } else { - OPM_LogWStr(OPM_objname, ((LONGINT)(64))); + OPM_LogWStr(OPM_objname, 64); if (n == 253) { - OPM_LogWStr((CHAR*)" is new, compile with option e", (LONGINT)31); + OPM_LogWStr((CHAR*)" is new, compile with option e", 31); } else if (n == 252) { - OPM_LogWStr((CHAR*)" is redefined, compile with option s", (LONGINT)37); + OPM_LogWStr((CHAR*)" is redefined, compile with option s", 37); } else if (n == 251) { - OPM_LogWStr((CHAR*)" is redefined (private part only), compile with option s", (LONGINT)57); + OPM_LogWStr((CHAR*)" is redefined (private part only), compile with option s", 57); } else if (n == 250) { - OPM_LogWStr((CHAR*)" is no longer visible, compile with option s", (LONGINT)45); + OPM_LogWStr((CHAR*)" is no longer visible, compile with option s", 45); } else if (n == 249) { - OPM_LogWStr((CHAR*)" is not consistently imported, recompile imports", (LONGINT)49); + OPM_LogWStr((CHAR*)" is not consistently imported, recompile imports", 49); } } } @@ -516,8 +516,8 @@ void OPM_Mark (INTEGER n, LONGINT pos) if (pos >= 0) { OPM_ShowLine(pos); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" pos", (LONGINT)6); - OPM_LogWNum(pos, ((LONGINT)(6))); + OPM_LogWStr((CHAR*)" pos", 6); + OPM_LogWNum(pos, 6); } OPM_LogErrMsg(n); if (pos < 0) { @@ -533,19 +533,19 @@ void OPM_err (INTEGER n) void OPM_FPrint (LONGINT *fp, LONGINT val) { - *fp = __ROTL((LONGINT)((SET)*fp ^ (SET)val), 1, LONGINT); + *fp = __ROTL((LONGINT)(__VAL(SET, *fp) ^ __VAL(SET, val)), 1, LONGINT); } void OPM_FPrintSet (LONGINT *fp, SET set) { - OPM_FPrint(&*fp, (LONGINT)set); + OPM_FPrint(&*fp, __VAL(LONGINT, set)); } void OPM_FPrintReal (LONGINT *fp, REAL real) { INTEGER i; LONGINT l; - __GET((LONGINT)(SYSTEM_ADRINT)&real, i, INTEGER); + __GET((SYSTEM_ADRINT)&real, i, INTEGER); l = i; OPM_FPrint(&*fp, l); } @@ -562,19 +562,19 @@ static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONG if (((*S).class == 1 && __STRCMP((*S).s, name) == 0)) { Texts_Scan(&*S, S__typ); if ((*S).class == 3) { - *size = (int)(*S).i; + *size = (SYSTEM_INT32)(*S).i; Texts_Scan(&*S, S__typ); } else { - OPM_Mark(-157, ((LONGINT)(-1))); + OPM_Mark(-157, -1); } if ((*S).class == 3) { - *align = (int)(*S).i; + *align = (SYSTEM_INT32)(*S).i; Texts_Scan(&*S, S__typ); } else { - OPM_Mark(-157, ((LONGINT)(-1))); + OPM_Mark(-157, -1); } } else { - OPM_Mark(-157, ((LONGINT)(-1))); + OPM_Mark(-157, -1); } __DEL(name); } @@ -603,40 +603,40 @@ static LONGINT OPM_power0 (LONGINT i, LONGINT j) static void OPM_VerboseListSizes (void) { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Type Size Alignement", (LONGINT)29); + OPM_LogWStr((CHAR*)"Type Size Alignement", 29); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"CHAR ", (LONGINT)14); - OPM_LogWNum(OPM_CharSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"CHAR ", 14); + OPM_LogWNum(OPM_CharSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"BOOLEAN ", (LONGINT)14); - OPM_LogWNum(OPM_BoolSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"BOOLEAN ", 14); + OPM_LogWNum(OPM_BoolSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"SHORTINT ", (LONGINT)14); - OPM_LogWNum(OPM_SIntSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"SHORTINT ", 14); + OPM_LogWNum(OPM_SIntSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"INTEGER ", (LONGINT)14); - OPM_LogWNum(OPM_IntSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"INTEGER ", 14); + OPM_LogWNum(OPM_IntSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"LONGINT ", (LONGINT)14); - OPM_LogWNum(OPM_LIntSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"LONGINT ", 14); + OPM_LogWNum(OPM_LIntSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"SET ", (LONGINT)14); - OPM_LogWNum(OPM_SetSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"SET ", 14); + OPM_LogWNum(OPM_SetSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"REAL ", (LONGINT)14); - OPM_LogWNum(OPM_RealSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"REAL ", 14); + OPM_LogWNum(OPM_RealSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"LONGREAL ", (LONGINT)14); - OPM_LogWNum(OPM_LRealSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"LONGREAL ", 14); + OPM_LogWNum(OPM_LRealSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"PTR ", (LONGINT)14); - OPM_LogWNum(OPM_PointerSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"PTR ", 14); + OPM_LogWNum(OPM_PointerSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"PROC ", (LONGINT)14); - OPM_LogWNum(OPM_ProcSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"PROC ", 14); + OPM_LogWNum(OPM_ProcSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"RECORD ", (LONGINT)14); - OPM_LogWNum(OPM_RecSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"RECORD ", 14); + OPM_LogWNum(OPM_RecSize, 4); OPM_LogWLn(); OPM_LogWLn(); } @@ -719,11 +719,11 @@ void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done) { CHAR ch; OPM_FileName fileName; - OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, ((LONGINT)(32)), (CHAR*)".sym", (LONGINT)5); - OPM_oldSFile = Files_Old(fileName, ((LONGINT)(32))); + OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, 32, (CHAR*)".sym", 5); + OPM_oldSFile = Files_Old(fileName, 32); *done = OPM_oldSFile != NIL; if (*done) { - Files_Set(&OPM_oldSF, Files_Rider__typ, OPM_oldSFile, ((LONGINT)(0))); + Files_Set(&OPM_oldSF, Files_Rider__typ, OPM_oldSFile, 0); Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&ch); if (ch != 0xf7) { OPM_err(-306); @@ -752,7 +752,7 @@ void OPM_SymWInt (LONGINT i) void OPM_SymWSet (SET s) { - Files_WriteNum(&OPM_newSF, Files_Rider__typ, (LONGINT)s); + Files_WriteNum(&OPM_newSF, Files_Rider__typ, __VAL(LONGINT, s)); } void OPM_SymWReal (REAL r) @@ -779,10 +779,10 @@ void OPM_DeleteNewSym (void) void OPM_NewSym (CHAR *modName, LONGINT modName__len) { OPM_FileName fileName; - OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, ((LONGINT)(32)), (CHAR*)".sym", (LONGINT)5); - OPM_newSFile = Files_New(fileName, ((LONGINT)(32))); + OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, 32, (CHAR*)".sym", 5); + OPM_newSFile = Files_New(fileName, 32); if (OPM_newSFile != NIL) { - Files_Set(&OPM_newSF, Files_Rider__typ, OPM_newSFile, ((LONGINT)(0))); + Files_Set(&OPM_newSF, Files_Rider__typ, OPM_newSFile, 0); Files_Write(&OPM_newSF, Files_Rider__typ, 0xf7); } else { OPM_err(153); @@ -791,7 +791,7 @@ void OPM_NewSym (CHAR *modName, LONGINT modName__len) void OPM_Write (CHAR ch) { - Files_Write(&OPM_R[__X(OPM_currFile, ((LONGINT)(3)))], Files_Rider__typ, ch); + Files_Write(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, ch); } void OPM_WriteString (CHAR *s, LONGINT s__len) @@ -801,7 +801,7 @@ void OPM_WriteString (CHAR *s, LONGINT s__len) while (s[__X(i, s__len)] != 0x00) { i += 1; } - Files_WriteBytes(&OPM_R[__X(OPM_currFile, ((LONGINT)(3)))], Files_Rider__typ, (void*)s, s__len * ((LONGINT)(1)), i); + Files_WriteBytes(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, (void*)s, s__len * 1, i); } void OPM_WriteStringVar (CHAR *s, LONGINT s__len) @@ -811,27 +811,27 @@ void OPM_WriteStringVar (CHAR *s, LONGINT s__len) while (s[__X(i, s__len)] != 0x00) { i += 1; } - Files_WriteBytes(&OPM_R[__X(OPM_currFile, ((LONGINT)(3)))], Files_Rider__typ, (void*)s, s__len * ((LONGINT)(1)), i); + Files_WriteBytes(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, (void*)s, s__len * 1, i); } void OPM_WriteHex (LONGINT i) { CHAR s[3]; INTEGER digit; - digit = __ASHR((int)i, 4); + digit = __ASHR((SYSTEM_INT32)i, 4); if (digit < 10) { s[0] = (CHAR)(48 + digit); } else { s[0] = (CHAR)(87 + digit); } - digit = __MASK((int)i, -16); + digit = __MASK((SYSTEM_INT32)i, -16); if (digit < 10) { s[1] = (CHAR)(48 + digit); } else { s[1] = (CHAR)(87 + digit); } s[2] = 0x00; - OPM_WriteString(s, ((LONGINT)(3))); + OPM_WriteString(s, 3); } void OPM_WriteInt (LONGINT i) @@ -841,24 +841,24 @@ void OPM_WriteInt (LONGINT i) if (i == OPM_SignedMinimum(OPM_IntSize) || i == OPM_SignedMinimum(OPM_LIntSize)) { OPM_Write('('); OPM_WriteInt(i + 1); - OPM_WriteString((CHAR*)"-1)", (LONGINT)4); + OPM_WriteString((CHAR*)"-1)", 4); } else { i1 = __ABS(i); s[0] = (CHAR)(__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k = 1; while (i1 > 0) { - s[__X(k, ((LONGINT)(20)))] = (CHAR)(__MOD(i1, 10) + 48); + s[__X(k, 20)] = (CHAR)(__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k += 1; } if (i < 0) { - s[__X(k, ((LONGINT)(20)))] = '-'; + s[__X(k, 20)] = '-'; k += 1; } while (k > 0) { k -= 1; - OPM_Write(s[__X(k, ((LONGINT)(20)))]); + OPM_Write(s[__X(k, 20)]); } } } @@ -873,9 +873,9 @@ void OPM_WriteReal (LONGREAL r, CHAR suffx) INTEGER i; if ((((r < OPM_SignedMaximum(OPM_LIntSize) && r > OPM_SignedMinimum(OPM_LIntSize))) && r == (__ENTIER(r)))) { if (suffx == 'f') { - OPM_WriteString((CHAR*)"(REAL)", (LONGINT)7); + OPM_WriteString((CHAR*)"(REAL)", 7); } else { - OPM_WriteString((CHAR*)"(LONGREAL)", (LONGINT)11); + OPM_WriteString((CHAR*)"(LONGREAL)", 11); } OPM_WriteInt(__ENTIER(r)); } else { @@ -886,33 +886,33 @@ void OPM_WriteReal (LONGREAL r, CHAR suffx) Texts_WriteLongReal(&W, Texts_Writer__typ, r, 23); } __NEW(T, Texts_TextDesc); - Texts_Open(T, (CHAR*)"", (LONGINT)1); + Texts_Open(T, (CHAR*)"", 1); Texts_Append(T, W.buf); - Texts_OpenReader(&R, Texts_Reader__typ, T, ((LONGINT)(0))); + Texts_OpenReader(&R, Texts_Reader__typ, T, 0); i = 0; Texts_Read(&R, Texts_Reader__typ, &ch); while (ch != 0x00) { - s[__X(i, ((LONGINT)(32)))] = ch; + s[__X(i, 32)] = ch; i += 1; Texts_Read(&R, Texts_Reader__typ, &ch); } - s[__X(i, ((LONGINT)(32)))] = 0x00; + s[__X(i, 32)] = 0x00; i = 0; ch = s[0]; while ((ch != 'D' && ch != 0x00)) { i += 1; - ch = s[__X(i, ((LONGINT)(32)))]; + ch = s[__X(i, 32)]; } if (ch == 'D') { - s[__X(i, ((LONGINT)(32)))] = 'e'; + s[__X(i, 32)] = 'e'; } - OPM_WriteString(s, ((LONGINT)(32))); + OPM_WriteString(s, 32); } } void OPM_WriteLn (void) { - Files_Write(&OPM_R[__X(OPM_currFile, ((LONGINT)(3)))], Files_Rider__typ, 0x0a); + Files_Write(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, 0x0a); } static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F) @@ -920,11 +920,11 @@ static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F) Files_Rider R1; CHAR buffer[4096]; if (F != NIL) { - Files_Set(&R1, Files_Rider__typ, F, ((LONGINT)(0))); - Files_ReadBytes(&R1, Files_Rider__typ, (void*)buffer, ((LONGINT)(4096)), ((LONGINT)(4096))); + Files_Set(&R1, Files_Rider__typ, F, 0); + Files_ReadBytes(&R1, Files_Rider__typ, (void*)buffer, 4096, 4096); while (4096 - R1.res > 0) { - Files_WriteBytes(&*R, R__typ, (void*)buffer, ((LONGINT)(4096)), 4096 - R1.res); - Files_ReadBytes(&R1, Files_Rider__typ, (void*)buffer, ((LONGINT)(4096)), ((LONGINT)(4096))); + Files_WriteBytes(&*R, R__typ, (void*)buffer, 4096, 4096 - R1.res); + Files_ReadBytes(&R1, Files_Rider__typ, (void*)buffer, 4096, 4096); } } } @@ -932,24 +932,24 @@ static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F) void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len) { CHAR FName[32]; - __COPY(moduleName, OPM_modName, ((LONGINT)(32))); - OPM_HFile = Files_New((CHAR*)"", (LONGINT)1); + __COPY(moduleName, OPM_modName, 32); + OPM_HFile = Files_New((CHAR*)"", 1); if (OPM_HFile != NIL) { - Files_Set(&OPM_R[0], Files_Rider__typ, OPM_HFile, ((LONGINT)(0))); + Files_Set(&OPM_R[0], Files_Rider__typ, OPM_HFile, 0); } else { OPM_err(153); } - OPM_MakeFileName((void*)moduleName, moduleName__len, (void*)FName, ((LONGINT)(32)), (CHAR*)".c", (LONGINT)3); - OPM_BFile = Files_New(FName, ((LONGINT)(32))); + OPM_MakeFileName((void*)moduleName, moduleName__len, (void*)FName, 32, (CHAR*)".c", 3); + OPM_BFile = Files_New(FName, 32); if (OPM_BFile != NIL) { - Files_Set(&OPM_R[1], Files_Rider__typ, OPM_BFile, ((LONGINT)(0))); + Files_Set(&OPM_R[1], Files_Rider__typ, OPM_BFile, 0); } else { OPM_err(153); } - OPM_MakeFileName((void*)moduleName, moduleName__len, (void*)FName, ((LONGINT)(32)), (CHAR*)".h", (LONGINT)3); - OPM_HIFile = Files_New(FName, ((LONGINT)(32))); + OPM_MakeFileName((void*)moduleName, moduleName__len, (void*)FName, 32, (CHAR*)".h", 3); + OPM_HIFile = Files_New(FName, 32); if (OPM_HIFile != NIL) { - Files_Set(&OPM_R[2], Files_Rider__typ, OPM_HIFile, ((LONGINT)(0))); + Files_Set(&OPM_R[2], Files_Rider__typ, OPM_HIFile, 0); } else { OPM_err(153); } @@ -960,9 +960,9 @@ void OPM_CloseFiles (void) CHAR FName[32]; INTEGER res; if (OPM_noerr) { - OPM_LogWStr((CHAR*)" ", (LONGINT)3); - OPM_LogWNum(Files_Pos(&OPM_R[1], Files_Rider__typ), ((LONGINT)(0))); - OPM_LogWStr((CHAR*)" chars.", (LONGINT)8); + OPM_LogWStr((CHAR*)" ", 3); + OPM_LogWNum(Files_Pos(&OPM_R[1], Files_Rider__typ), 0); + OPM_LogWStr((CHAR*)" chars.", 8); } if (OPM_noerr) { if (__STRCMP(OPM_modName, "SYSTEM") == 0) { @@ -974,10 +974,10 @@ void OPM_CloseFiles (void) Files_Register(OPM_HIFile); Files_Register(OPM_BFile); } else { - OPM_MakeFileName((void*)OPM_modName, ((LONGINT)(32)), (void*)FName, ((LONGINT)(32)), (CHAR*)".h", (LONGINT)3); - Files_Delete(FName, ((LONGINT)(32)), &res); - OPM_MakeFileName((void*)OPM_modName, ((LONGINT)(32)), (void*)FName, ((LONGINT)(32)), (CHAR*)".sym", (LONGINT)5); - Files_Delete(FName, ((LONGINT)(32)), &res); + OPM_MakeFileName((void*)OPM_modName, 32, (void*)FName, 32, (CHAR*)".h", 3); + Files_Delete(FName, 32, &res); + OPM_MakeFileName((void*)OPM_modName, 32, (void*)FName, 32, (CHAR*)".sym", 5); + Files_Delete(FName, 32, &res); Files_Register(OPM_BFile); } } @@ -986,11 +986,11 @@ void OPM_CloseFiles (void) OPM_HIFile = NIL; OPM_newSFile = NIL; OPM_oldSFile = NIL; - Files_Set(&OPM_R[0], Files_Rider__typ, NIL, ((LONGINT)(0))); - Files_Set(&OPM_R[1], Files_Rider__typ, NIL, ((LONGINT)(0))); - Files_Set(&OPM_R[2], Files_Rider__typ, NIL, ((LONGINT)(0))); - Files_Set(&OPM_newSF, Files_Rider__typ, NIL, ((LONGINT)(0))); - Files_Set(&OPM_oldSF, Files_Rider__typ, NIL, ((LONGINT)(0))); + Files_Set(&OPM_R[0], Files_Rider__typ, NIL, 0); + Files_Set(&OPM_R[1], Files_Rider__typ, NIL, 0); + Files_Set(&OPM_R[2], Files_Rider__typ, NIL, 0); + Files_Set(&OPM_newSF, Files_Rider__typ, NIL, 0); + Files_Set(&OPM_oldSF, Files_Rider__typ, NIL, 0); } static void EnumPtrs(void (*P)(void*)) @@ -1031,15 +1031,15 @@ export void *OPM__init(void) /* BEGIN */ Texts_OpenWriter(&OPM_W, Texts_Writer__typ); OPM_MODULES[0] = 0x00; - Platform_GetEnv((CHAR*)"MODULES", (LONGINT)8, (void*)OPM_MODULES, ((LONGINT)(1024))); + Platform_GetEnv((CHAR*)"MODULES", 8, (void*)OPM_MODULES, 1024); __MOVE(".", OPM_OBERON, 2); - Platform_GetEnv((CHAR*)"OBERON", (LONGINT)7, (void*)OPM_OBERON, ((LONGINT)(1024))); - Strings_Append((CHAR*)";.;", (LONGINT)4, (void*)OPM_OBERON, ((LONGINT)(1024))); - Strings_Append(OPM_MODULES, ((LONGINT)(1024)), (void*)OPM_OBERON, ((LONGINT)(1024))); - Strings_Append((CHAR*)";", (LONGINT)2, (void*)OPM_OBERON, ((LONGINT)(1024))); - Strings_Append((CHAR*)"/opt/voc", (LONGINT)9, (void*)OPM_OBERON, ((LONGINT)(1024))); - Strings_Append((CHAR*)"/sym;", (LONGINT)6, (void*)OPM_OBERON, ((LONGINT)(1024))); - Files_SetSearchPath(OPM_OBERON, ((LONGINT)(1024))); + Platform_GetEnv((CHAR*)"OBERON", 7, (void*)OPM_OBERON, 1024); + Strings_Append((CHAR*)";.;", 4, (void*)OPM_OBERON, 1024); + Strings_Append(OPM_MODULES, 1024, (void*)OPM_OBERON, 1024); + Strings_Append((CHAR*)";", 2, (void*)OPM_OBERON, 1024); + Strings_Append((CHAR*)"/opt/voc", 9, (void*)OPM_OBERON, 1024); + Strings_Append((CHAR*)"/sym;", 6, (void*)OPM_OBERON, 1024); + Files_SetSearchPath(OPM_OBERON, 1024); OPM_CharSize = 1; OPM_BoolSize = 1; OPM_SIntSize = 1; diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index e94f0303..5363c227 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index 63b71ce5..c525c696 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPB.h" @@ -59,7 +59,7 @@ static void OPP_err (INTEGER n) static void OPP_CheckSym (INTEGER s) { - if ((int)OPP_sym == s) { + if (OPP_sym == s) { OPS_Get(&OPP_sym); } else { OPM_err(s); @@ -105,7 +105,7 @@ static void OPP_ConstExpression (OPT_Node *x) OPP_Expression(&*x); if ((*x)->class != 7) { OPP_err(50); - *x = OPB_NewIntConst(((LONGINT)(1))); + *x = OPB_NewIntConst(1); } } @@ -147,7 +147,7 @@ static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_) OPP_err(51); sf = 0; } - *sysflag = (int)sf; + *sysflag = (SYSTEM_INT32)sf; OPP_CheckSym(23); } else { *sysflag = default_; @@ -309,13 +309,13 @@ static void OPP_PointerType (OPT_Struct *typ) OPT_Find(&id); if (id == NIL) { if (OPP_nofFwdPtr < 64) { - OPP_FwdPtr[__X(OPP_nofFwdPtr, ((LONGINT)(64)))] = *typ; + OPP_FwdPtr[__X(OPP_nofFwdPtr, 64)] = *typ; OPP_nofFwdPtr += 1; } else { OPP_err(224); } (*typ)->link = OPT_NewObj(); - __COPY(OPS_name, (*typ)->link->name, ((LONGINT)(256))); + __COPY(OPS_name, (*typ)->link->name, 256); (*typ)->BaseTyp = OPT_undftyp; OPS_Get(&OPP_sym); } else { @@ -519,7 +519,7 @@ static void OPP_selector (OPT_Node *x) } else if (OPP_sym == 18) { OPS_Get(&OPP_sym); if (OPP_sym == 38) { - __COPY(OPS_name, name, ((LONGINT)(256))); + __COPY(OPS_name, name, 256); OPS_Get(&OPP_sym); if ((*x)->typ != NIL) { if ((*x)->typ->form == 13) { @@ -626,7 +626,7 @@ static void OPP_StandProcCall (OPT_Node *x) OPT_Node y = NIL; SHORTINT m; INTEGER n; - m = (int)(*x)->obj->adr; + m = (SYSTEM_INT8)(*x)->obj->adr; n = 0; if (OPP_sym == 30) { OPS_Get(&OPP_sym); @@ -743,8 +743,8 @@ static void OPP_Factor (OPT_Node *x) *x = OPB_NewRealConst(OPS_lrlval, OPT_lrltyp); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPP.Factor, OPS.numtyp = ", (LONGINT)44); - OPM_LogWNum(OPS_numtyp, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPP.Factor, OPS.numtyp = ", 44); + OPM_LogWNum(OPS_numtyp, 0); OPM_LogWLn(); break; } @@ -777,7 +777,7 @@ static void OPP_Factor (OPT_Node *x) *x = NIL; } if (*x == NIL) { - *x = OPB_NewIntConst(((LONGINT)(1))); + *x = OPB_NewIntConst(1); (*x)->typ = OPT_undftyp; } } @@ -859,7 +859,7 @@ static void OPP_Receiver (SHORTINT *mode, OPS_Name name, OPT_Struct *typ, OPT_St } else { *mode = 1; } - __COPY(OPS_name, name, ((LONGINT)(256))); + __COPY(OPS_name, name, 256); OPP_CheckSym(38); OPP_CheckSym(20); if (OPP_sym == 38) { @@ -933,8 +933,8 @@ static void GetCode__19 (void) (*ProcedureDeclaration__16_s->proc)->conval->ext = ext; n = 0; if (OPP_sym == 37) { - while (OPS_str[__X(n, ((LONGINT)(256)))] != 0x00) { - (*ext)[__X(n + 1, ((LONGINT)(256)))] = OPS_str[__X(n, ((LONGINT)(256)))]; + while (OPS_str[__X(n, 256)] != 0x00) { + (*ext)[__X(n + 1, 256)] = OPS_str[__X(n, 256)]; n += 1; } (*ext)[0] = (CHAR)n; @@ -950,7 +950,7 @@ static void GetCode__19 (void) n = 1; } OPS_Get(&OPP_sym); - (*ext)[__X(n, ((LONGINT)(256)))] = (CHAR)c; + (*ext)[__X(n, 256)] = (CHAR)c; } if (OPP_sym == 19) { OPS_Get(&OPP_sym); @@ -1024,7 +1024,7 @@ static void TProcDecl__23 (void) } OPP_Receiver(&objMode, objName, &objTyp, &recTyp); if (OPP_sym == 38) { - __COPY(OPS_name, *ProcedureDeclaration__16_s->name, ((LONGINT)(256))); + __COPY(OPS_name, *ProcedureDeclaration__16_s->name, 256); OPP_CheckMark(&*ProcedureDeclaration__16_s->vis); OPT_FindField(*ProcedureDeclaration__16_s->name, recTyp, &*ProcedureDeclaration__16_s->fwd); OPT_FindField(*ProcedureDeclaration__16_s->name, recTyp->BaseTyp, &baseProc); @@ -1123,7 +1123,7 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) TProcDecl__23(); } else if (OPP_sym == 38) { OPT_Find(&fwd); - __COPY(OPS_name, name, ((LONGINT)(256))); + __COPY(OPS_name, name, 256); OPP_CheckMark(&vis); if ((vis != 0 && mode == 6)) { mode = 7; @@ -1184,14 +1184,14 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, O if (!__IN(LabelTyp->form, 0x70) || LabelTyp->size < x->typ->size) { OPP_err(60); } - } else if ((int)LabelTyp->form != f) { + } else if (LabelTyp->form != f) { OPP_err(60); } if (OPP_sym == 21) { OPS_Get(&OPP_sym); OPP_ConstExpression(&y); yval = y->conval->intval; - if (((int)y->typ->form != f && !((__IN(f, 0x70) && __IN(y->typ->form, 0x70))))) { + if ((y->typ->form != f && !((__IN(f, 0x70) && __IN(y->typ->form, 0x70))))) { OPP_err(60); } if (yval < xval) { @@ -1208,17 +1208,17 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, O if (i == 0) { break; } - if (tab[__X(i - 1, ((LONGINT)(128)))].low <= yval) { - if (tab[__X(i - 1, ((LONGINT)(128)))].high >= xval) { + if (tab[__X(i - 1, 128)].low <= yval) { + if (tab[__X(i - 1, 128)].high >= xval) { OPP_err(62); } break; } - tab[__X(i, ((LONGINT)(128)))] = tab[__X(i - 1, ((LONGINT)(128)))]; + tab[__X(i, 128)] = tab[__X(i - 1, 128)]; i -= 1; } - tab[__X(i, ((LONGINT)(128)))].low = xval; - tab[__X(i, ((LONGINT)(128)))].high = yval; + tab[__X(i, 128)].low = xval; + tab[__X(i, 128)].high = yval; *n += 1; } else { OPP_err(213); @@ -1277,7 +1277,7 @@ static void CasePart__31 (OPT_Node *x) } if (n > 0) { low = tab[0].low; - high = tab[__X(n - 1, ((LONGINT)(128)))].high; + high = tab[__X(n - 1, 128)].high; if (high - low > 512) { OPP_err(209); } @@ -1480,7 +1480,7 @@ static void OPP_StatSeq (OPT_Node *stat) OPS_Get(&OPP_sym); OPP_ConstExpression(&z); } else { - z = OPB_NewIntConst(((LONGINT)(1))); + z = OPB_NewIntConst(1); } pos = OPM_errpos; x = OPB_NewLeaf(id); @@ -1643,7 +1643,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) OPP_ConstExpression(&x); } else { OPP_err(9); - x = OPB_NewIntConst(((LONGINT)(1))); + x = OPB_NewIntConst(1); } obj->mode = 3; obj->typ = x->typ; @@ -1674,7 +1674,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) if (__IN(obj->typ->comp, 0x1c)) { i = 0; while (i < OPP_nofFwdPtr) { - typ = OPP_FwdPtr[__X(i, ((LONGINT)(64)))]; + typ = OPP_FwdPtr[__X(i, 64)]; i += 1; if (__STRCMP(typ->link->name, obj->name) == 0) { typ->BaseTyp = obj->typ; @@ -1736,10 +1736,10 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) } i = 0; while (i < OPP_nofFwdPtr) { - if (OPP_FwdPtr[__X(i, ((LONGINT)(64)))]->link->name[0] != 0x00) { + if (OPP_FwdPtr[__X(i, 64)]->link->name[0] != 0x00) { OPP_err(128); } - OPP_FwdPtr[__X(i, ((LONGINT)(64)))] = NIL; + OPP_FwdPtr[__X(i, 64)] = NIL; i += 1; } OPT_topScope->adr = OPM_errpos; @@ -1785,28 +1785,28 @@ void OPP_Module (OPT_Node *prog, SET opt) OPS_Get(&OPP_sym); } else { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Unexpected symbol found when MODULE expected:", (LONGINT)46); + OPM_LogWStr((CHAR*)"Unexpected symbol found when MODULE expected:", 46); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" sym: ", (LONGINT)15); - OPM_LogWNum(OPP_sym, ((LONGINT)(1))); + OPM_LogWStr((CHAR*)" sym: ", 15); + OPM_LogWNum(OPP_sym, 1); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" OPS.name: ", (LONGINT)15); - OPM_LogWStr(OPS_name, ((LONGINT)(256))); + OPM_LogWStr((CHAR*)" OPS.name: ", 15); + OPM_LogWStr(OPS_name, 256); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" OPS.str: ", (LONGINT)15); - OPM_LogWStr(OPS_str, ((LONGINT)(256))); + OPM_LogWStr((CHAR*)" OPS.str: ", 15); + OPM_LogWStr(OPS_str, 256); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" OPS.numtyp: ", (LONGINT)15); - OPM_LogWNum(OPS_numtyp, ((LONGINT)(1))); + OPM_LogWStr((CHAR*)" OPS.numtyp: ", 15); + OPM_LogWNum(OPS_numtyp, 1); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" OPS.intval: ", (LONGINT)15); - OPM_LogWNum(OPS_intval, ((LONGINT)(1))); + OPM_LogWStr((CHAR*)" OPS.intval: ", 15); + OPM_LogWNum(OPS_intval, 1); OPM_LogWLn(); OPP_err(16); } if (OPP_sym == 38) { - OPM_LogWStr((CHAR*)"compiling ", (LONGINT)11); - OPM_LogWStr(OPS_name, ((LONGINT)(256))); + OPM_LogWStr((CHAR*)"compiling ", 11); + OPM_LogWStr(OPS_name, 256); OPM_LogW('.'); OPT_Init(OPS_name, opt); OPS_Get(&OPP_sym); @@ -1815,13 +1815,13 @@ void OPP_Module (OPT_Node *prog, SET opt) OPS_Get(&OPP_sym); for (;;) { if (OPP_sym == 38) { - __COPY(OPS_name, aliasName, ((LONGINT)(256))); - __COPY(aliasName, impName, ((LONGINT)(256))); + __COPY(OPS_name, aliasName, 256); + __COPY(aliasName, impName, 256); OPS_Get(&OPP_sym); if (OPP_sym == 34) { OPS_Get(&OPP_sym); if (OPP_sym == 38) { - __COPY(OPS_name, impName, ((LONGINT)(256))); + __COPY(OPS_name, impName, 256); OPS_Get(&OPP_sym); } else { OPP_err(38); diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index fb0cf655..7a12f897 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index e2d48c61..2ee978f2 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" @@ -60,7 +60,7 @@ static void OPS_Str (SHORTINT *sym) if (OPS_intval == 2) { *sym = 35; OPS_numtyp = 1; - OPS_intval = (int)OPS_str[0]; + OPS_intval = OPS_str[0]; } else { *sym = 37; } @@ -113,10 +113,10 @@ static INTEGER Ord__7 (CHAR ch, BOOLEAN hex) { INTEGER _o_result; if (ch <= '9') { - _o_result = (int)ch - 48; + _o_result = ch - 48; return _o_result; } else if (hex) { - _o_result = ((int)ch - 65) + 10; + _o_result = (ch - 65) + 10; return _o_result; } else { OPS_err(2); diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index ea28a764..a8dccfed 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index b028d164..5861f882 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" @@ -163,10 +163,10 @@ OPT_Struct OPT_IntType (LONGINT size) OPT_Struct _o_result; INTEGER i; i = 1; - while ((OPT_IntTypes[__X(i, ((LONGINT)(20)))]->size < size && OPT_IntTypes[__X(i + 1, ((LONGINT)(20)))] != NIL)) { + while ((OPT_IntTypes[__X(i, 20)]->size < size && OPT_IntTypes[__X(i + 1, 20)] != NIL)) { i += 1; } - _o_result = OPT_IntTypes[__X(i, ((LONGINT)(20)))]; + _o_result = OPT_IntTypes[__X(i, 20)]; return _o_result; } @@ -178,11 +178,11 @@ OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir) __ASSERT(dir == 1 || dir == -1, 0); __ASSERT(x->BaseTyp == OPT_undftyp, 0); i = 0; - while ((OPT_IntTypes[__X(i, ((LONGINT)(20)))] != x && i < 20)) { + while ((OPT_IntTypes[__X(i, 20)] != x && i < 20)) { i += 1; } __ASSERT(i < 19, 0); - _o_result = OPT_IntTypes[__X(i + dir, ((LONGINT)(20)))]; + _o_result = OPT_IntTypes[__X(i + dir, 20)]; return _o_result; } @@ -235,7 +235,7 @@ OPT_ConstExt OPT_NewExt (void) { OPT_ConstExt _o_result; OPT_ConstExt ext = NIL; - ext = __NEWARR(NIL, ((LONGINT)(1)), 1, 1, 0, (LONGINT)256); + ext = __NEWARR(NIL, 1, 1, 1, 0, ((SYSTEM_INT64)(256))); _o_result = ext; return _o_result; } @@ -266,8 +266,8 @@ void OPT_Init (OPS_Name name, SET opt) OPT_topScope = OPT_universe; OPT_OpenScope(0, NIL); OPT_SYSimported = 0; - __COPY(name, OPT_SelfName, ((LONGINT)(256))); - __COPY(name, OPT_topScope->name, ((LONGINT)(256))); + __COPY(name, OPT_SelfName, 256); + __COPY(name, OPT_topScope->name, 256); OPT_GlbMod[0] = OPT_topScope; OPT_nofGmod = 1; OPT_newsf = __IN(4, opt); @@ -282,13 +282,13 @@ void OPT_Close (void) OPT_CloseScope(); i = 0; while (i < 64) { - OPT_GlbMod[__X(i, ((LONGINT)(64)))] = NIL; + OPT_GlbMod[__X(i, 64)] = NIL; i += 1; } i = 16; while (i < 255) { - OPT_impCtxt.ref[__X(i, ((LONGINT)(255)))] = NIL; - OPT_impCtxt.old[__X(i, ((LONGINT)(255)))] = NIL; + OPT_impCtxt.ref[__X(i, 255)] = NIL; + OPT_impCtxt.old[__X(i, 255)] = NIL; i += 1; } } @@ -399,7 +399,7 @@ void OPT_Insert (OPS_Name name, OPT_Object *obj) } ob1->left = NIL; ob1->right = NIL; - __COPY(name, ob1->name, ((LONGINT)(256))); + __COPY(name, ob1->name, 256); mnolev = OPT_topScope->mnolev; ob1->mnolev = mnolev; break; @@ -415,7 +415,7 @@ static void OPT_FPrintName (LONGINT *fp, CHAR *name, LONGINT name__len) i = 0; do { ch = name[__X(i, name__len)]; - OPM_FPrint(&*fp, (int)ch); + OPM_FPrint(&*fp, ch); i += 1; } while (!(ch == 0x00)); } @@ -424,32 +424,32 @@ static void OPT_DebugStruct (OPT_Struct btyp) { OPM_LogWLn(); if (btyp == NIL) { - OPM_LogWStr((CHAR*)"btyp is nil", (LONGINT)12); + OPM_LogWStr((CHAR*)"btyp is nil", 12); OPM_LogWLn(); } - OPM_LogWStr((CHAR*)"btyp^.strobji^.name = ", (LONGINT)23); - OPM_LogWStr(btyp->strobj->name, ((LONGINT)(256))); + OPM_LogWStr((CHAR*)"btyp^.strobji^.name = ", 23); + OPM_LogWStr(btyp->strobj->name, 256); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.form = ", (LONGINT)14); - OPM_LogWNum(btyp->form, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.form = ", 14); + OPM_LogWNum(btyp->form, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.comp = ", (LONGINT)14); - OPM_LogWNum(btyp->comp, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.comp = ", 14); + OPM_LogWNum(btyp->comp, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.mno = ", (LONGINT)13); - OPM_LogWNum(btyp->mno, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.mno = ", 13); + OPM_LogWNum(btyp->mno, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.extlev = ", (LONGINT)16); - OPM_LogWNum(btyp->extlev, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.extlev = ", 16); + OPM_LogWNum(btyp->extlev, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.size = ", (LONGINT)14); - OPM_LogWNum(btyp->size, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.size = ", 14); + OPM_LogWNum(btyp->size, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.align = ", (LONGINT)15); - OPM_LogWNum(btyp->align, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.align = ", 15); + OPM_LogWNum(btyp->align, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.txtpos = ", (LONGINT)16); - OPM_LogWNum(btyp->txtpos, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.txtpos = ", 16); + OPM_LogWNum(btyp->txtpos, 0); OPM_LogWLn(); } @@ -481,8 +481,8 @@ void OPT_IdFPrint (OPT_Struct typ) btyp = typ->BaseTyp; strobj = typ->strobj; if ((strobj != NIL && strobj->name[0] != 0x00)) { - OPT_FPrintName(&idfp, (void*)OPT_GlbMod[__X(typ->mno, ((LONGINT)(64)))]->name, ((LONGINT)(256))); - OPT_FPrintName(&idfp, (void*)strobj->name, ((LONGINT)(256))); + OPT_FPrintName(&idfp, (void*)OPT_GlbMod[__X(typ->mno, 64)]->name, 256); + OPT_FPrintName(&idfp, (void*)strobj->name, 256); } if ((f == 13 || (c == 4 && btyp != NIL)) || c == 3) { OPT_IdFPrint(btyp); @@ -533,7 +533,7 @@ static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr) } } } else if (typ->form == 13 || __STRCMP(fld->name, "@ptr") == 0) { - OPM_FPrint(&*FPrintStr__12_s->pvfp, ((LONGINT)(13))); + OPM_FPrint(&*FPrintStr__12_s->pvfp, 13); OPM_FPrint(&*FPrintStr__12_s->pvfp, adr); OPT_nofhdfld += 1; } @@ -544,7 +544,7 @@ static void FPrintFlds__13 (OPT_Object fld, LONGINT adr, BOOLEAN visible) while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->vis); - OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)fld->name, ((LONGINT)(256))); + OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)fld->name, 256); OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->adr); OPT_FPrintStr(fld->typ); OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->typ->pbfp); @@ -562,10 +562,10 @@ static void FPrintTProcs__17 (OPT_Object obj) FPrintTProcs__17(obj->left); if (obj->mode == 13) { if (obj->vis != 0) { - OPM_FPrint(&*FPrintStr__12_s->pbfp, ((LONGINT)(13))); + OPM_FPrint(&*FPrintStr__12_s->pbfp, 13); OPM_FPrint(&*FPrintStr__12_s->pbfp, __ASHR(obj->adr, 16)); OPT_FPrintSign(&*FPrintStr__12_s->pbfp, obj->typ, obj->link); - OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)obj->name, ((LONGINT)(256))); + OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)obj->name, 256); } } FPrintTProcs__17(obj->right); @@ -619,7 +619,7 @@ void OPT_FPrintStr (OPT_Struct typ) OPM_FPrint(&pvfp, typ->align); OPM_FPrint(&pvfp, typ->n); OPT_nofhdfld = 0; - FPrintFlds__13(typ->link, ((LONGINT)(0)), 1); + FPrintFlds__13(typ->link, 0, 1); if (OPT_nofhdfld > 2048) { OPM_Mark(225, typ->txtpos); } @@ -664,7 +664,7 @@ void OPT_FPrintObj (OPT_Object obj) OPM_FPrintLReal(&fprint, obj->conval->realval); break; case 10: - OPT_FPrintName(&fprint, (void*)*obj->conval->ext, ((LONGINT)(256))); + OPT_FPrintName(&fprint, (void*)*obj->conval->ext, 256); break; case 11: break; @@ -681,11 +681,11 @@ void OPT_FPrintObj (OPT_Object obj) } else if (obj->mode == 9) { OPT_FPrintSign(&fprint, obj->typ, obj->link); ext = obj->conval->ext; - m = (int)(*ext)[0]; + m = (*ext)[0]; f = 1; OPM_FPrint(&fprint, m); while (f <= m) { - OPM_FPrint(&fprint, (int)(*ext)[__X(f, ((LONGINT)(256)))]); + OPM_FPrint(&fprint, (*ext)[__X(f, 256)]); f += 1; } } else if (obj->mode == 5) { @@ -701,22 +701,22 @@ void OPT_FPrintErr (OPT_Object obj, INTEGER errcode) INTEGER i, j; CHAR ch; if (obj->mnolev != 0) { - __COPY(OPT_GlbMod[__X(-obj->mnolev, ((LONGINT)(64)))]->name, OPM_objname, ((LONGINT)(64))); + __COPY(OPT_GlbMod[__X(-obj->mnolev, 64)]->name, OPM_objname, 64); i = 0; - while (OPM_objname[__X(i, ((LONGINT)(64)))] != 0x00) { + while (OPM_objname[__X(i, 64)] != 0x00) { i += 1; } - OPM_objname[__X(i, ((LONGINT)(64)))] = '.'; + OPM_objname[__X(i, 64)] = '.'; j = 0; i += 1; do { - ch = obj->name[__X(j, ((LONGINT)(256)))]; - OPM_objname[__X(i, ((LONGINT)(64)))] = ch; + ch = obj->name[__X(j, 256)]; + OPM_objname[__X(i, 64)] = ch; j += 1; i += 1; } while (!(ch == 0x00)); } else { - __COPY(obj->name, OPM_objname, ((LONGINT)(64))); + __COPY(obj->name, OPM_objname, 64); } if (errcode == 249) { if (OPM_noerr) { @@ -809,12 +809,12 @@ static void OPT_InMod (SHORTINT *mno) *mno = OPT_impCtxt.glbmno[0]; } else { if (mn == 16) { - OPT_InName((void*)name, ((LONGINT)(256))); + OPT_InName((void*)name, 256); if ((__STRCMP(name, OPT_SelfName) == 0 && !OPT_impCtxt.self)) { OPT_err(154); } i = 0; - while ((i < OPT_nofGmod && __STRCMP(name, OPT_GlbMod[__X(i, ((LONGINT)(64)))]->name) != 0)) { + while ((i < OPT_nofGmod && __STRCMP(name, OPT_GlbMod[__X(i, 64)]->name) != 0)) { i += 1; } if (i < OPT_nofGmod) { @@ -822,20 +822,20 @@ static void OPT_InMod (SHORTINT *mno) } else { head = OPT_NewObj(); head->mode = 12; - __COPY(name, head->name, ((LONGINT)(256))); + __COPY(name, head->name, 256); *mno = OPT_nofGmod; head->mnolev = -*mno; if (OPT_nofGmod < 64) { - OPT_GlbMod[__X(*mno, ((LONGINT)(64)))] = head; + OPT_GlbMod[__X(*mno, 64)] = head; OPT_nofGmod += 1; } else { OPT_err(227); } } - OPT_impCtxt.glbmno[__X(OPT_impCtxt.nofm, ((LONGINT)(64)))] = *mno; + OPT_impCtxt.glbmno[__X(OPT_impCtxt.nofm, 64)] = *mno; OPT_impCtxt.nofm += 1; } else { - *mno = OPT_impCtxt.glbmno[__X(-mn, ((LONGINT)(64)))]; + *mno = OPT_impCtxt.glbmno[__X(-mn, 64)]; } } } @@ -849,7 +849,7 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval) switch (f) { case 1: case 3: case 2: OPM_SymRCh(&ch); - conval->intval = (int)ch; + conval->intval = ch; break; case 4: case 5: case 6: conval->intval = OPM_SymRInt(); @@ -872,7 +872,7 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval) i = 0; do { OPM_SymRCh(&ch); - (*ext)[__X(i, ((LONGINT)(256)))] = ch; + (*ext)[__X(i, 256)] = ch; i += 1; } while (!(ch == 0x00)); conval->intval2 = i; @@ -882,8 +882,8 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval) conval->intval = 0; break; default: - OPM_LogWStr((CHAR*)"unhandled case in InConstant(), f = ", (LONGINT)37); - OPM_LogWNum(f, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in InConstant(), f = ", 37); + OPM_LogWNum(f, 0); OPM_LogWLn(); break; } @@ -911,7 +911,7 @@ static void OPT_InSign (SHORTINT mno, OPT_Struct *res, OPT_Object *par) } OPT_InStruct(&new->typ); new->adr = OPM_SymRInt(); - OPT_InName((void*)new->name, ((LONGINT)(256))); + OPT_InName((void*)new->name, 256); last = new; tag = OPM_SymRInt(); } @@ -932,7 +932,7 @@ static OPT_Object OPT_InFld (void) obj->vis = 1; } OPT_InStruct(&obj->typ); - OPT_InName((void*)obj->name, ((LONGINT)(256))); + OPT_InName((void*)obj->name, 256); obj->adr = OPM_SymRInt(); } else { obj->mode = 4; @@ -963,7 +963,7 @@ static OPT_Object OPT_InTProc (SHORTINT mno) obj->conval->intval = -1; OPT_InSign(mno, &obj->typ, &obj->link); obj->vis = 1; - OPT_InName((void*)obj->name, ((LONGINT)(256))); + OPT_InName((void*)obj->name, 256); obj->adr = __ASHL(OPM_SymRInt(), 16); } else { obj->mode = 13; @@ -984,7 +984,7 @@ static OPT_Struct OPT_InTyp (LONGINT tag) _o_result = OPT_IntType(OPM_SymRInt()); return _o_result; } else { - _o_result = OPT_impCtxt.ref[__X(tag, ((LONGINT)(255)))]; + _o_result = OPT_impCtxt.ref[__X(tag, 255)]; return _o_result; } __RETCHK; @@ -1008,23 +1008,23 @@ static void OPT_InStruct (OPT_Struct *typ) OPT_impCtxt.minr = ref; } OPT_InMod(&mno); - OPT_InName((void*)name, ((LONGINT)(256))); + OPT_InName((void*)name, 256); obj = OPT_NewObj(); if (name[0] == 0x00) { if (OPT_impCtxt.self) { old = NIL; } else { __MOVE("@", obj->name, 2); - OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->right, &old); + OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, 64)]->right, &old); obj->name[0] = 0x00; } *typ = OPT_NewStr(0, 1); } else { - __COPY(name, obj->name, ((LONGINT)(256))); - OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->right, &old); + __COPY(name, obj->name, 256); + OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, 64)]->right, &old); if (old != NIL) { OPT_FPrintObj(old); - OPT_impCtxt.pvfp[__X(ref, ((LONGINT)(255)))] = old->typ->pvfp; + OPT_impCtxt.pvfp[__X(ref, 255)] = old->typ->pvfp; if (OPT_impCtxt.self) { *typ = OPT_NewStr(0, 1); } else { @@ -1038,8 +1038,8 @@ static void OPT_InStruct (OPT_Struct *typ) *typ = OPT_NewStr(0, 1); } } - OPT_impCtxt.ref[__X(ref, ((LONGINT)(255)))] = *typ; - OPT_impCtxt.old[__X(ref, ((LONGINT)(255)))] = old; + OPT_impCtxt.ref[__X(ref, 255)] = *typ; + OPT_impCtxt.old[__X(ref, 255)] = old; (*typ)->ref = ref + 255; (*typ)->mno = mno; (*typ)->allocated = 1; @@ -1050,7 +1050,7 @@ static void OPT_InStruct (OPT_Struct *typ) obj->vis = 0; tag = OPM_SymRInt(); if (tag == 35) { - (*typ)->sysflag = (int)OPM_SymRInt(); + (*typ)->sysflag = (SYSTEM_INT32)OPM_SymRInt(); tag = OPM_SymRInt(); } switch (tag) { @@ -1118,8 +1118,8 @@ static void OPT_InStruct (OPT_Struct *typ) OPT_InSign(mno, &(*typ)->BaseTyp, &(*typ)->link); break; default: - OPM_LogWStr((CHAR*)"unhandled case at InStruct, tag = ", (LONGINT)35); - OPM_LogWNum(tag, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case at InStruct, tag = ", 35); + OPM_LogWNum(tag, 0); OPM_LogWLn(); break; } @@ -1131,7 +1131,7 @@ static void OPT_InStruct (OPT_Struct *typ) if (obj->name[0] != 0x00) { OPT_FPrintObj(obj); } - old = OPT_impCtxt.old[__X(ref, ((LONGINT)(255)))]; + old = OPT_impCtxt.old[__X(ref, 255)]; if (old != NIL) { t->strobj = old; if (OPT_impCtxt.self) { @@ -1139,13 +1139,13 @@ static void OPT_InStruct (OPT_Struct *typ) if (old->history != 5) { if (old->fprint != obj->fprint) { old->history = 2; - } else if (OPT_impCtxt.pvfp[__X(ref, ((LONGINT)(255)))] != t->pvfp) { + } else if (OPT_impCtxt.pvfp[__X(ref, 255)] != t->pvfp) { old->history = 3; } } } else if (old->fprint != obj->fprint) { old->history = 2; - } else if (OPT_impCtxt.pvfp[__X(ref, ((LONGINT)(255)))] != t->pvfp) { + } else if (OPT_impCtxt.pvfp[__X(ref, 255)] != t->pvfp) { old->history = 3; } else if (old->vis == 0) { old->history = 1; @@ -1153,7 +1153,7 @@ static void OPT_InStruct (OPT_Struct *typ) old->history = 0; } } else { - if (OPT_impCtxt.pvfp[__X(ref, ((LONGINT)(255)))] != t->pvfp) { + if (OPT_impCtxt.pvfp[__X(ref, 255)] != t->pvfp) { old->history = 5; } if (old->fprint != obj->fprint) { @@ -1212,17 +1212,17 @@ static OPT_Object OPT_InObj (SHORTINT mno) obj->mode = 9; ext = OPT_NewExt(); obj->conval->ext = ext; - s = (int)OPM_SymRInt(); + s = (SYSTEM_INT32)OPM_SymRInt(); (*ext)[0] = (CHAR)s; i = 1; while (i <= s) { - OPM_SymRCh(&(*ext)[__X(i, ((LONGINT)(256)))]); + OPM_SymRCh(&(*ext)[__X(i, 256)]); i += 1; } break; default: - OPM_LogWStr((CHAR*)"unhandled case at InObj, tag = ", (LONGINT)32); - OPM_LogWNum(tag, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case at InObj, tag = ", 32); + OPM_LogWNum(tag, 0); OPM_LogWLn(); break; } @@ -1236,14 +1236,14 @@ static OPT_Object OPT_InObj (SHORTINT mno) } OPT_InStruct(&obj->typ); } - OPT_InName((void*)obj->name, ((LONGINT)(256))); + OPT_InName((void*)obj->name, 256); } OPT_FPrintObj(obj); if ((obj->mode == 1 && (obj->typ->strobj == NIL || obj->typ->strobj->name[0] == 0x00))) { OPM_FPrint(&OPT_impCtxt.reffp, obj->typ->ref - 255); } if (tag != 19) { - OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->right, &old); + OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, 64)]->right, &old); if (OPT_impCtxt.self) { if (old != NIL) { if (old->vis == 0) { @@ -1294,7 +1294,7 @@ void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) OPT_impCtxt.nofm = 0; OPT_impCtxt.self = __STRCMP(aliasName, "@self") == 0; OPT_impCtxt.reffp = 0; - OPM_OldSym((void*)name, ((LONGINT)(256)), &*done); + OPM_OldSym((void*)name, 256, &*done); if (*done) { OPT_InMod(&mno); OPT_impCtxt.nextTag = OPM_SymRInt(); @@ -1304,8 +1304,8 @@ void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) } OPT_Insert(aliasName, &obj); obj->mode = 11; - obj->scope = OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->right; - OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->link = obj; + obj->scope = OPT_GlbMod[__X(mno, 64)]->right; + OPT_GlbMod[__X(mno, 64)]->link = obj; obj->mnolev = -mno; obj->typ = OPT_notyp; OPM_CloseOldSym(); @@ -1333,13 +1333,13 @@ static void OPT_OutName (CHAR *name, LONGINT name__len) static void OPT_OutMod (INTEGER mno) { - if (OPT_expCtxt.locmno[__X(mno, ((LONGINT)(64)))] < 0) { - OPM_SymWInt(((LONGINT)(16))); - OPT_expCtxt.locmno[__X(mno, ((LONGINT)(64)))] = OPT_expCtxt.nofm; + if (OPT_expCtxt.locmno[__X(mno, 64)] < 0) { + OPM_SymWInt(16); + OPT_expCtxt.locmno[__X(mno, 64)] = OPT_expCtxt.nofm; OPT_expCtxt.nofm += 1; - OPT_OutName((void*)OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->name, ((LONGINT)(256))); + OPT_OutName((void*)OPT_GlbMod[__X(mno, 64)]->name, 256); } else { - OPM_SymWInt(-OPT_expCtxt.locmno[__X(mno, ((LONGINT)(64)))]); + OPM_SymWInt(-OPT_expCtxt.locmno[__X(mno, 64)]); } } @@ -1369,7 +1369,7 @@ static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, LONGINT adr) } } } else if (typ->form == 13 || __STRCMP(fld->name, "@ptr") == 0) { - OPM_SymWInt(((LONGINT)(27))); + OPM_SymWInt(27); OPM_SymWInt(adr); OPT_nofhdfld += 1; } @@ -1380,12 +1380,12 @@ static void OPT_OutFlds (OPT_Object fld, LONGINT adr, BOOLEAN visible) while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { if (fld->vis == 2) { - OPM_SymWInt(((LONGINT)(26))); + OPM_SymWInt(26); } else { - OPM_SymWInt(((LONGINT)(25))); + OPM_SymWInt(25); } OPT_OutStr(fld->typ); - OPT_OutName((void*)fld->name, ((LONGINT)(256))); + OPT_OutName((void*)fld->name, 256); OPM_SymWInt(fld->adr); } else { OPT_OutHdFld(fld->typ, fld, fld->adr + adr); @@ -1399,16 +1399,16 @@ static void OPT_OutSign (OPT_Struct result, OPT_Object par) OPT_OutStr(result); while (par != NIL) { if (par->mode == 1) { - OPM_SymWInt(((LONGINT)(23))); + OPM_SymWInt(23); } else { - OPM_SymWInt(((LONGINT)(24))); + OPM_SymWInt(24); } OPT_OutStr(par->typ); OPM_SymWInt(par->adr); - OPT_OutName((void*)par->name, ((LONGINT)(256))); + OPT_OutName((void*)par->name, 256); par = par->link; } - OPM_SymWInt(((LONGINT)(18))); + OPM_SymWInt(18); } static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj) @@ -1421,12 +1421,12 @@ static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj) } if (obj->vis != 0) { if (obj->vis != 0) { - OPM_SymWInt(((LONGINT)(29))); + OPM_SymWInt(29); OPT_OutSign(obj->typ, obj->link); - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); OPM_SymWInt(__ASHR(obj->adr, 16)); } else { - OPM_SymWInt(((LONGINT)(30))); + OPM_SymWInt(30); OPM_SymWInt(__ASHR(obj->adr, 16)); } } @@ -1444,7 +1444,7 @@ static void OPT_OutStr (OPT_Struct typ) OPM_SymWInt(typ->size); } } else { - OPM_SymWInt(((LONGINT)(34))); + OPM_SymWInt(34); typ->ref = OPT_expCtxt.ref; OPT_expCtxt.ref += 1; if (OPT_expCtxt.ref >= 255) { @@ -1453,7 +1453,7 @@ static void OPT_OutStr (OPT_Struct typ) OPT_OutMod(typ->mno); strobj = typ->strobj; if ((strobj != NIL && strobj->name[0] != 0x00)) { - OPT_OutName((void*)strobj->name, ((LONGINT)(256))); + OPT_OutName((void*)strobj->name, 256); switch (strobj->history) { case 2: OPT_FPrintErr(strobj, 252); @@ -1471,31 +1471,31 @@ static void OPT_OutStr (OPT_Struct typ) OPM_SymWCh(0x00); } if (typ->sysflag != 0) { - OPM_SymWInt(((LONGINT)(35))); + OPM_SymWInt(35); OPM_SymWInt(typ->sysflag); } switch (typ->form) { case 13: - OPM_SymWInt(((LONGINT)(36))); + OPM_SymWInt(36); OPT_OutStr(typ->BaseTyp); break; case 14: - OPM_SymWInt(((LONGINT)(40))); + OPM_SymWInt(40); OPT_OutSign(typ->BaseTyp, typ->link); break; case 15: switch (typ->comp) { case 2: - OPM_SymWInt(((LONGINT)(37))); + OPM_SymWInt(37); OPT_OutStr(typ->BaseTyp); OPM_SymWInt(typ->n); break; case 3: - OPM_SymWInt(((LONGINT)(38))); + OPM_SymWInt(38); OPT_OutStr(typ->BaseTyp); break; case 4: - OPM_SymWInt(((LONGINT)(39))); + OPM_SymWInt(39); if (typ->BaseTyp == NIL) { OPT_OutStr(OPT_notyp); } else { @@ -1505,23 +1505,23 @@ static void OPT_OutStr (OPT_Struct typ) OPM_SymWInt(typ->align); OPM_SymWInt(typ->n); OPT_nofhdfld = 0; - OPT_OutFlds(typ->link, ((LONGINT)(0)), 1); + OPT_OutFlds(typ->link, 0, 1); if (OPT_nofhdfld > 2048) { OPM_Mark(223, typ->txtpos); } OPT_OutTProcs(typ, typ->link); - OPM_SymWInt(((LONGINT)(18))); + OPM_SymWInt(18); break; default: - OPM_LogWStr((CHAR*)"unhandled case at OutStr, typ^.comp = ", (LONGINT)39); - OPM_LogWNum(typ->comp, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case at OutStr, typ^.comp = ", 39); + OPM_LogWNum(typ->comp, 0); OPM_LogWLn(); break; } break; default: - OPM_LogWStr((CHAR*)"unhandled case at OutStr, typ^.form = ", (LONGINT)39); - OPM_LogWNum(typ->form, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case at OutStr, typ^.form = ", 39); + OPM_LogWNum(typ->form, 0); OPM_LogWLn(); break; } @@ -1553,7 +1553,7 @@ static void OPT_OutConstant (OPT_Object obj) OPM_SymWLReal(obj->conval->realval); break; case 10: - OPT_OutName((void*)*obj->conval->ext, ((LONGINT)(256))); + OPT_OutName((void*)*obj->conval->ext, 256); break; case 11: break; @@ -1586,64 +1586,64 @@ static void OPT_OutObj (OPT_Object obj) OPT_FPrintErr(obj, 251); break; default: - OPM_LogWStr((CHAR*)"unhandled case at OutObj, obj^.history = ", (LONGINT)42); - OPM_LogWNum(obj->history, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case at OutObj, obj^.history = ", 42); + OPM_LogWNum(obj->history, 0); OPM_LogWLn(); break; } switch (obj->mode) { case 3: OPT_OutConstant(obj); - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); break; case 5: if (obj->typ->strobj == obj) { - OPM_SymWInt(((LONGINT)(19))); + OPM_SymWInt(19); OPT_OutStr(obj->typ); } else { - OPM_SymWInt(((LONGINT)(20))); + OPM_SymWInt(20); OPT_OutStr(obj->typ); - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); } break; case 1: if (obj->vis == 2) { - OPM_SymWInt(((LONGINT)(22))); + OPM_SymWInt(22); } else { - OPM_SymWInt(((LONGINT)(21))); + OPM_SymWInt(21); } OPT_OutStr(obj->typ); - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); if (obj->typ->strobj == NIL || obj->typ->strobj->name[0] == 0x00) { OPM_FPrint(&OPT_expCtxt.reffp, obj->typ->ref); } break; case 7: - OPM_SymWInt(((LONGINT)(31))); + OPM_SymWInt(31); OPT_OutSign(obj->typ, obj->link); - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); break; case 10: - OPM_SymWInt(((LONGINT)(32))); + OPM_SymWInt(32); OPT_OutSign(obj->typ, obj->link); - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); break; case 9: - OPM_SymWInt(((LONGINT)(33))); + OPM_SymWInt(33); OPT_OutSign(obj->typ, obj->link); ext = obj->conval->ext; - j = (int)(*ext)[0]; + j = (*ext)[0]; i = 1; OPM_SymWInt(j); while (i <= j) { - OPM_SymWCh((*ext)[__X(i, ((LONGINT)(256)))]); + OPM_SymWCh((*ext)[__X(i, 256)]); i += 1; } - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); break; default: - OPM_LogWStr((CHAR*)"unhandled case at OutObj, obj.mode = ", (LONGINT)38); - OPM_LogWNum(obj->mode, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case at OutObj, obj.mode = ", 38); + OPM_LogWNum(obj->mode, 0); OPM_LogWLn(); break; } @@ -1664,17 +1664,17 @@ void OPT_Export (BOOLEAN *ext, BOOLEAN *new) OPT_Import((CHAR*)"@self", OPT_SelfName, &done); OPT_nofGmod = nofmod; if (OPM_noerr) { - OPM_NewSym((void*)OPT_SelfName, ((LONGINT)(256))); + OPM_NewSym((void*)OPT_SelfName, 256); if (OPM_noerr) { - OPM_SymWInt(((LONGINT)(16))); - OPT_OutName((void*)OPT_SelfName, ((LONGINT)(256))); + OPM_SymWInt(16); + OPT_OutName((void*)OPT_SelfName, 256); OPT_expCtxt.reffp = 0; OPT_expCtxt.ref = 16; OPT_expCtxt.nofm = 1; OPT_expCtxt.locmno[0] = 0; i = 1; while (i < 64) { - OPT_expCtxt.locmno[__X(i, ((LONGINT)(64)))] = -1; + OPT_expCtxt.locmno[__X(i, 64)] = -1; i += 1; } OPT_OutObj(OPT_topScope->right); @@ -1875,11 +1875,11 @@ export void *OPT__init(void) OPT_EnterTyp((CHAR*)"SET", 9, OPM_SetSize, &OPT_settyp); OPT_EnterTyp((CHAR*)"REAL", 7, OPM_RealSize, &OPT_realtyp); OPT_EnterTyp((CHAR*)"INTEGER", 5, OPM_IntSize, &OPT_inttyp); - OPT_EnterTyp((CHAR*)"LONGINT", 6, OPM_LIntSize, &OPT_linttyp); + OPT_EnterTyp((CHAR*)"LONGINT", 5, OPM_LIntSize, &OPT_linttyp); OPT_EnterTyp((CHAR*)"LONGREAL", 8, OPM_LRealSize, &OPT_lrltyp); OPT_EnterTyp((CHAR*)"SHORTINT", 4, OPM_SIntSize, &OPT_sinttyp); - OPT_EnterBoolConst((CHAR*)"FALSE", ((LONGINT)(0))); - OPT_EnterBoolConst((CHAR*)"TRUE", ((LONGINT)(1))); + OPT_EnterBoolConst((CHAR*)"FALSE", 0); + OPT_EnterBoolConst((CHAR*)"TRUE", 1); OPT_EnterProc((CHAR*)"HALT", 0); OPT_EnterProc((CHAR*)"NEW", 1); OPT_EnterProc((CHAR*)"ABS", 2); diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 9878e30b..acf2e9e9 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index f74e0890..49956ac6 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPC.h" @@ -37,9 +37,10 @@ static void OPV_Len (OPT_Node n, LONGINT dim); export void OPV_Module (OPT_Node prog); static LONGINT OPV_NaturalAlignment (LONGINT size, LONGINT max); static void OPV_NewArr (OPT_Node d, OPT_Node x); +static void OPV_ParIntLiteral (LONGINT n, LONGINT size); static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, INTEGER comp); static BOOLEAN OPV_SideEffects (OPT_Node n); -static void OPV_SizeCast (LONGINT size); +static void OPV_SizeCast (LONGINT from, LONGINT to); static void OPV_Stamp (OPS_Name s); static OPT_Object OPV_SuperProc (OPT_Node n); static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported); @@ -118,7 +119,7 @@ void OPV_TypSize (OPT_Struct typ) } typ->size = offset; typ->align = base; - typ->sysflag = __MASK(typ->sysflag, -256) + (int)__ASHL(offset - off0, 8); + typ->sysflag = __MASK(typ->sysflag, -256) + (SYSTEM_INT32)__ASHL(offset - off0, 8); } else if (c == 2) { OPV_TypSize(typ->BaseTyp); typ->size = typ->n * typ->BaseTyp->size; @@ -197,27 +198,27 @@ static void OPV_Stamp (OPS_Name s) OPV_stamp += 1; i = 0; j = OPV_stamp; - while (s[__X(i, ((LONGINT)(256)))] != 0x00) { + while (s[__X(i, 256)] != 0x00) { i += 1; } if (i > 25) { i = 25; } - s[__X(i, ((LONGINT)(256)))] = '_'; - s[__X(i + 1, ((LONGINT)(256)))] = '_'; + s[__X(i, 256)] = '_'; + s[__X(i + 1, 256)] = '_'; i += 2; k = 0; do { - n[__X(k, ((LONGINT)(10)))] = (CHAR)((int)__MOD(j, 10) + 48); + n[__X(k, 10)] = (CHAR)((int)__MOD(j, 10) + 48); j = __DIV(j, 10); k += 1; } while (!(j == 0)); do { k -= 1; - s[__X(i, ((LONGINT)(256)))] = n[__X(k, ((LONGINT)(10)))]; + s[__X(i, 256)] = n[__X(k, 10)]; i += 1; } while (!(k == 0)); - s[__X(i, ((LONGINT)(256)))] = 0x00; + s[__X(i, 256)] = 0x00; } static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported) @@ -259,7 +260,7 @@ static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exporte } scope = obj->scope; scope->leaf = 1; - __COPY(obj->name, scope->name, ((LONGINT)(256))); + __COPY(obj->name, scope->name, 256); OPV_Stamp(scope->name); if (mode == 9) { obj->adr = 1; @@ -339,8 +340,8 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN return _o_result; break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Nmop, subclass = ", (LONGINT)55); - OPM_LogWNum(subclass, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Nmop, subclass = ", 55); + OPM_LogWNum(subclass, 0); OPM_LogWLn(); break; } @@ -409,8 +410,8 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN return _o_result; break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Ndop, subclass = ", (LONGINT)55); - OPM_LogWNum(subclass, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Ndop, subclass = ", 55); + OPM_LogWNum(subclass, 0); OPM_LogWLn(); break; } @@ -424,8 +425,8 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN return _o_result; break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence, class = ", (LONGINT)43); - OPM_LogWNum(class, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence, class = ", 43); + OPM_LogWNum(class, 0); OPM_LogWLn(); break; } @@ -440,7 +441,7 @@ static void OPV_Len (OPT_Node n, LONGINT dim) } if ((n->class == 3 && n->typ->comp == 3)) { OPV_design(n->left, 10); - OPM_WriteString((CHAR*)"->len[", (LONGINT)7); + OPM_WriteString((CHAR*)"->len[", 7); OPM_WriteInt(dim); OPM_Write(']'); } else { @@ -464,7 +465,7 @@ static BOOLEAN OPV_SideEffects (OPT_Node n) static void OPV_Entier (OPT_Node n, INTEGER prec) { if (__IN(n->typ->form, 0x0180)) { - OPM_WriteString((CHAR*)"__ENTIER(", (LONGINT)10); + OPM_WriteString((CHAR*)"__ENTIER(", 10); OPV_expr(n, -1); OPM_Write(')'); } else { @@ -472,12 +473,28 @@ static void OPV_Entier (OPT_Node n, INTEGER prec) } } -static void OPV_SizeCast (LONGINT size) +static void OPV_SizeCast (LONGINT from, LONGINT to) { - if (size <= 4) { - OPM_WriteString((CHAR*)"(int)", (LONGINT)6); - } else { - OPM_WriteString((CHAR*)"(SYSTEM_INT64)", (LONGINT)15); + if ((from != to && (from > 4 || to > 4))) { + switch (to) { + case 1: + OPM_WriteString((CHAR*)"(SYSTEM_INT8)", 14); + break; + case 2: + OPM_WriteString((CHAR*)"(SYSTEM_INT16)", 15); + break; + case 4: + OPM_WriteString((CHAR*)"(SYSTEM_INT32)", 15); + break; + case 8: + OPM_WriteString((CHAR*)"(SYSTEM_INT64)", 15); + break; + default: + OPM_LogWStr((CHAR*)"Unhandled case in OPC.SizeCast, to = ", 38); + OPM_LogWNum(to, 1); + OPM_LogWLn(); + break; + } } } @@ -487,29 +504,27 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec) from = n->typ->form; to = newtype->form; if (to == 9) { - OPM_WriteString((CHAR*)"__SETOF(", (LONGINT)9); + OPM_WriteString((CHAR*)"__SETOF(", 9); OPV_Entier(n, -1); OPM_Write(')'); } else if (__IN(to, 0x70)) { if ((newtype->size < n->typ->size && __IN(2, OPM_opt))) { - OPM_WriteString((CHAR*)"__SHORT", (LONGINT)8); + OPM_WriteString((CHAR*)"__SHORT", 8); if (OPV_SideEffects(n)) { OPM_Write('F'); } OPM_Write('('); OPV_Entier(n, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(OPM_SignedMaximum(newtype->size) + 1); OPM_Write(')'); } else { - if (newtype->size != n->typ->size) { - OPV_SizeCast(newtype->size); - } + OPV_SizeCast(n->typ->size, newtype->size); OPV_Entier(n, 9); } } else if (to == 3) { if (__IN(2, OPM_opt)) { - OPM_WriteString((CHAR*)"__CHR", (LONGINT)6); + OPM_WriteString((CHAR*)"__CHR", 6); if (OPV_SideEffects(n)) { OPM_Write('F'); } @@ -517,7 +532,7 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec) OPV_Entier(n, -1); OPM_Write(')'); } else { - OPM_WriteString((CHAR*)"(CHAR)", (LONGINT)7); + OPM_WriteString((CHAR*)"(CHAR)", 7); OPV_Entier(n, 9); } } else { @@ -528,14 +543,14 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec) static void OPV_TypeOf (OPT_Node n) { if (n->typ->form == 13) { - OPM_WriteString((CHAR*)"__TYPEOF(", (LONGINT)10); + OPM_WriteString((CHAR*)"__TYPEOF(", 10); OPV_expr(n, -1); OPM_Write(')'); } else if (__IN(n->class, 0x15)) { OPC_Andent(n->typ); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } else if (n->class == 3) { - OPM_WriteString((CHAR*)"__TYPEOF(", (LONGINT)10); + OPM_WriteString((CHAR*)"__TYPEOF(", 10); OPV_expr(n->left, -1); OPM_Write(')'); } else if (n->class == 5) { @@ -553,12 +568,12 @@ static void OPV_Index (OPT_Node n, OPT_Node d, INTEGER prec, INTEGER dim) OPV_expr(n->right, prec); } else { if (OPV_SideEffects(n->right)) { - OPM_WriteString((CHAR*)"__XF(", (LONGINT)6); + OPM_WriteString((CHAR*)"__XF(", 6); } else { - OPM_WriteString((CHAR*)"__X(", (LONGINT)5); + OPM_WriteString((CHAR*)"__X(", 5); } OPV_expr(n->right, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_Len(d, dim); OPM_Write(')'); } @@ -570,12 +585,12 @@ static void OPV_design (OPT_Node n, INTEGER prec) OPT_Struct typ = NIL; INTEGER class, designPrec, comp; OPT_Node d = NIL, x = NIL; - INTEGER dims, i, _for__27; + INTEGER dims, i, _for__28; comp = n->typ->comp; obj = n->obj; class = n->class; designPrec = OPV_Precedence(class, n->subcl, n->typ->form, comp); - if ((((((class == 0 && obj->mnolev > 0)) && (int)obj->mnolev != OPM_level)) && prec == 10)) { + if ((((((class == 0 && obj->mnolev > 0)) && obj->mnolev != OPM_level)) && prec == 10)) { designPrec = 9; } if (prec > designPrec) { @@ -600,7 +615,7 @@ static void OPV_design (OPT_Node n, INTEGER prec) case 2: if (n->left->class == 3) { OPV_design(n->left->left, designPrec); - OPM_WriteString((CHAR*)"->", (LONGINT)3); + OPM_WriteString((CHAR*)"->", 3); } else { OPV_design(n->left, designPrec); OPM_Write('.'); @@ -610,7 +625,7 @@ static void OPV_design (OPT_Node n, INTEGER prec) case 3: if (n->typ->comp == 3) { OPV_design(n->left, 10); - OPM_WriteString((CHAR*)"->data", (LONGINT)7); + OPM_WriteString((CHAR*)"->data", 7); } else { OPM_Write('*'); OPV_design(n->left, designPrec); @@ -637,25 +652,25 @@ static void OPV_design (OPT_Node n, INTEGER prec) while (x != d) { if (x->left != d) { OPV_Index(x, d, 7, i); - OPM_WriteString((CHAR*)" + ", (LONGINT)4); + OPM_WriteString((CHAR*)" + ", 4); OPV_Len(d, i); - OPM_WriteString((CHAR*)" * (", (LONGINT)5); + OPM_WriteString((CHAR*)" * (", 5); i -= 1; } else { OPV_Index(x, d, -1, i); } x = x->left; } - _for__27 = dims; + _for__28 = dims; i = 1; - while (i <= _for__27) { + while (i <= _for__28) { OPM_Write(')'); i += 1; } if (n->typ->comp == 3) { OPM_Write(')'); while ((SYSTEM_INT64)i < __ASHR(d->typ->size - 4, 2)) { - OPM_WriteString((CHAR*)" * ", (LONGINT)4); + OPM_WriteString((CHAR*)" * ", 4); OPV_Len(d, i); i += 1; } @@ -673,33 +688,33 @@ static void OPV_design (OPT_Node n, INTEGER prec) obj = n->left->obj; if (__IN(3, OPM_opt)) { if (typ->comp == 4) { - OPM_WriteString((CHAR*)"__GUARDR(", (LONGINT)10); - if ((int)obj->mnolev != OPM_level) { - OPM_WriteStringVar((void*)obj->scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"__curr->", (LONGINT)9); + OPM_WriteString((CHAR*)"__GUARDR(", 10); + if (obj->mnolev != OPM_level) { + OPM_WriteStringVar((void*)obj->scope->name, 256); + OPM_WriteString((CHAR*)"__curr->", 9); OPC_Ident(obj); } else { OPC_Ident(obj); } } else { if (typ->BaseTyp->strobj == NIL) { - OPM_WriteString((CHAR*)"__GUARDA(", (LONGINT)10); + OPM_WriteString((CHAR*)"__GUARDA(", 10); } else { - OPM_WriteString((CHAR*)"__GUARDP(", (LONGINT)10); + OPM_WriteString((CHAR*)"__GUARDP(", 10); } OPV_expr(n->left, -1); typ = typ->BaseTyp; } - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Andent(typ); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(typ->extlev); OPM_Write(')'); } else { if (typ->comp == 4) { - OPM_WriteString((CHAR*)"*(", (LONGINT)3); + OPM_WriteString((CHAR*)"*(", 3); OPC_Ident(typ->strobj); - OPM_WriteString((CHAR*)"*)", (LONGINT)3); + OPM_WriteString((CHAR*)"*)", 3); OPC_CompleteIdent(obj); } else { OPM_Write('('); @@ -712,15 +727,15 @@ static void OPV_design (OPT_Node n, INTEGER prec) case 6: if (__IN(3, OPM_opt)) { if (n->left->class == 1) { - OPM_WriteString((CHAR*)"__GUARDEQR(", (LONGINT)12); + OPM_WriteString((CHAR*)"__GUARDEQR(", 12); OPC_CompleteIdent(n->left->obj); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_TypeOf(n->left); } else { - OPM_WriteString((CHAR*)"__GUARDEQP(", (LONGINT)12); + OPM_WriteString((CHAR*)"__GUARDEQP(", 12); OPV_expr(n->left->left, -1); } - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Ident(n->left->typ->strobj); OPM_Write(')'); } else { @@ -733,8 +748,8 @@ static void OPV_design (OPT_Node n, INTEGER prec) } break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.design, class = ", (LONGINT)39); - OPM_LogWNum(class, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.design, class = ", 39); + OPM_LogWNum(class, 0); OPM_LogWLn(); break; } @@ -743,6 +758,15 @@ static void OPV_design (OPT_Node n, INTEGER prec) } } +static void OPV_ParIntLiteral (LONGINT n, LONGINT size) +{ + if (OPV_ansi) { + OPM_WriteInt(n); + } else { + OPC_IntLiteral(n, size); + } +} + static void OPV_ActualPar (OPT_Node n, OPT_Object fp) { OPT_Struct typ = NIL, aptyp = NIL; @@ -757,81 +781,75 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) if ((((mode == 2 && n->class == 11)) && n->subcl == 29)) { OPM_Write('('); OPC_Ident(n->typ->strobj); - OPM_WriteString((CHAR*)"*)", (LONGINT)3); + OPM_WriteString((CHAR*)"*)", 3); prec = 10; } if (!__IN(n->typ->comp, 0x0c)) { if (mode == 2) { if ((OPV_ansi && typ != n->typ)) { - OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(void*)", 8); } OPM_Write('&'); prec = 9; } else if (OPV_ansi) { if ((__IN(comp, 0x0c) && n->class == 7)) { - OPM_WriteString((CHAR*)"(CHAR*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(CHAR*)", 8); } else if ((((form == 13 && typ != n->typ)) && n->typ != OPT_niltyp)) { - OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(void*)", 8); } } else { if ((__IN(form, 0x0180) && __IN(n->typ->form, 0x70))) { - OPM_WriteString((CHAR*)"(double)", (LONGINT)9); - prec = 9; - } else if ((form == 6 && n->typ->form < 6)) { - OPM_WriteString((CHAR*)"(LONGINT)", (LONGINT)10); + OPM_WriteString((CHAR*)"(double)", 9); prec = 9; + } else if (__IN(form, 0x70)) { + OPV_SizeCast(n->typ->size, typ->size); } } } else if (OPV_ansi) { if ((((mode == 2 && typ != n->typ)) && prec == -1)) { - OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(void*)", 8); } } if ((((mode == 2 && n->class == 11)) && n->subcl == 29)) { OPV_expr(n->left, prec); - } else if ((((((form == 6 && n->class == 7)) && n->conval->intval <= OPM_SignedMaximum(OPM_IntSize))) && n->conval->intval >= OPM_SignedMinimum(OPM_IntSize))) { - OPM_WriteString((CHAR*)"((LONGINT)(", (LONGINT)12); - OPV_expr(n, prec); - OPM_WriteString((CHAR*)"))", (LONGINT)3); + } else if ((__IN(form, 0x70) && n->class == 7)) { + OPV_ParIntLiteral(n->conval->intval, n->typ->size); } else { OPV_expr(n, prec); } if ((comp == 4 && mode == 2)) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_TypeOf(n); } else if (comp == 3) { if (n->class == 7) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); - OPM_WriteString((CHAR*)"(LONGINT)", (LONGINT)10); - OPM_WriteInt(n->conval->intval2); + OPM_WriteString((CHAR*)", ", 3); + OPV_ParIntLiteral(n->conval->intval2, OPM_PointerSize); } else { aptyp = n->typ; dim = 0; while ((typ->comp == 3 && typ->BaseTyp->form != 1)) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_Len(n, dim); typ = typ->BaseTyp; aptyp = aptyp->BaseTyp; dim += 1; } if ((typ->comp == 3 && typ->BaseTyp->form == 1)) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); while (aptyp->comp == 3) { OPV_Len(n, dim); - OPM_WriteString((CHAR*)" * ", (LONGINT)4); + OPM_WriteString((CHAR*)" * ", 4); dim += 1; aptyp = aptyp->BaseTyp; } - OPM_WriteString((CHAR*)"((LONGINT)(", (LONGINT)12); - OPM_WriteInt(aptyp->size); - OPM_WriteString((CHAR*)"))", (LONGINT)3); + OPV_ParIntLiteral(aptyp->size, OPM_PointerSize); } } } n = n->link; fp = fp->link; if (n != NIL) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); } } OPM_Write(')'); @@ -871,9 +889,9 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPC_Constant(n->conval, form); break; case 10: - OPM_WriteString((CHAR*)"__SETRNG(", (LONGINT)10); + OPM_WriteString((CHAR*)"__SETRNG(", 10); OPV_expr(l, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(r, -1); OPM_Write(')'); break; @@ -894,16 +912,16 @@ static void OPV_expr (OPT_Node n, INTEGER prec) case 16: typ = n->obj->typ; if (l->typ->comp == 4) { - OPM_WriteString((CHAR*)"__IS(", (LONGINT)6); + OPM_WriteString((CHAR*)"__IS(", 6); OPC_TypeOf(l->obj); } else { - OPM_WriteString((CHAR*)"__ISP(", (LONGINT)7); + OPM_WriteString((CHAR*)"__ISP(", 7); OPV_expr(l, -1); typ = typ->BaseTyp; } - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Andent(typ); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(typ->extlev); OPM_Write(')'); break; @@ -913,31 +931,31 @@ static void OPV_expr (OPT_Node n, INTEGER prec) case 21: if (OPV_SideEffects(l)) { if (l->typ->form < 7) { - if (l->typ->form < 6) { - OPM_WriteString((CHAR*)"(int)", (LONGINT)6); + if (l->typ->size <= 4) { + OPM_WriteString((CHAR*)"(int)", 6); } - OPM_WriteString((CHAR*)"__ABSF(", (LONGINT)8); + OPM_WriteString((CHAR*)"__ABSF(", 8); } else { - OPM_WriteString((CHAR*)"__ABSFD(", (LONGINT)9); + OPM_WriteString((CHAR*)"__ABSFD(", 9); } } else { - OPM_WriteString((CHAR*)"__ABS(", (LONGINT)7); + OPM_WriteString((CHAR*)"__ABS(", 7); } OPV_expr(l, -1); OPM_Write(')'); break; case 22: - OPM_WriteString((CHAR*)"__CAP(", (LONGINT)7); + OPM_WriteString((CHAR*)"__CAP(", 7); OPV_expr(l, -1); OPM_Write(')'); break; case 23: - OPM_WriteString((CHAR*)"__ODD(", (LONGINT)7); + OPM_WriteString((CHAR*)"__ODD(", 7); OPV_expr(l, -1); OPM_Write(')'); break; case 24: - OPM_WriteString((CHAR*)"(LONGINT)(SYSTEM_ADRINT)", (LONGINT)25); + OPM_WriteString((CHAR*)"(SYSTEM_ADRINT)", 16); if (l->class == 1) { OPC_CompleteIdent(l->obj); } else { @@ -953,13 +971,13 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPC_Ident(n->typ->strobj); OPM_Write(')'); if (__IN(n->typ->form, 0x6000) || __IN(l->typ->form, 0x6000)) { - OPM_WriteString((CHAR*)"(SYSTEM_ADRINT)", (LONGINT)16); + OPM_WriteString((CHAR*)"(SYSTEM_ADRINT)", 16); } OPV_expr(l, exprPrec); } else { - OPM_WriteString((CHAR*)"__VAL(", (LONGINT)7); + OPM_WriteString((CHAR*)"__VAL(", 7); OPC_Ident(n->typ->strobj); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(l, -1); OPM_Write(')'); } @@ -978,84 +996,84 @@ static void OPV_expr (OPT_Node n, INTEGER prec) case 28: case 3: case 4: switch (subclass) { case 15: - OPM_WriteString((CHAR*)"__IN(", (LONGINT)6); + OPM_WriteString((CHAR*)"__IN(", 6); break; case 17: if (r->class == 7) { if (r->conval->intval >= 0) { - OPM_WriteString((CHAR*)"__ASHL(", (LONGINT)8); + OPM_WriteString((CHAR*)"__ASHL(", 8); } else { - OPM_WriteString((CHAR*)"__ASHR(", (LONGINT)8); + OPM_WriteString((CHAR*)"__ASHR(", 8); } } else if (OPV_SideEffects(r)) { - OPM_WriteString((CHAR*)"__ASHF(", (LONGINT)8); + OPM_WriteString((CHAR*)"__ASHF(", 8); } else { - OPM_WriteString((CHAR*)"__ASH(", (LONGINT)7); + OPM_WriteString((CHAR*)"__ASH(", 7); } break; case 18: - OPM_WriteString((CHAR*)"__MASK(", (LONGINT)8); + OPM_WriteString((CHAR*)"__MASK(", 8); break; case 26: - OPM_WriteString((CHAR*)"__BIT(", (LONGINT)7); + OPM_WriteString((CHAR*)"__BIT(", 7); break; case 27: if (r->class == 7) { if (r->conval->intval >= 0) { - OPM_WriteString((CHAR*)"__LSHL(", (LONGINT)8); + OPM_WriteString((CHAR*)"__LSHL(", 8); } else { - OPM_WriteString((CHAR*)"__LSHR(", (LONGINT)8); + OPM_WriteString((CHAR*)"__LSHR(", 8); } } else { - OPM_WriteString((CHAR*)"__LSH(", (LONGINT)7); + OPM_WriteString((CHAR*)"__LSH(", 7); } break; case 28: if (r->class == 7) { if (r->conval->intval >= 0) { - OPM_WriteString((CHAR*)"__ROTL(", (LONGINT)8); + OPM_WriteString((CHAR*)"__ROTL(", 8); } else { - OPM_WriteString((CHAR*)"__ROTR(", (LONGINT)8); + OPM_WriteString((CHAR*)"__ROTR(", 8); } } else { - OPM_WriteString((CHAR*)"__ROT(", (LONGINT)7); + OPM_WriteString((CHAR*)"__ROT(", 7); } break; case 3: if (OPV_SideEffects(n)) { - if (form < 6) { - OPM_WriteString((CHAR*)"(int)", (LONGINT)6); + if (n->typ->size <= 4) { + OPM_WriteString((CHAR*)"(int)", 6); } - OPM_WriteString((CHAR*)"__DIVF(", (LONGINT)8); + OPM_WriteString((CHAR*)"__DIVF(", 8); } else { - OPM_WriteString((CHAR*)"__DIV(", (LONGINT)7); + OPM_WriteString((CHAR*)"__DIV(", 7); } break; case 4: - if (form < 6) { - OPM_WriteString((CHAR*)"(int)", (LONGINT)6); + if (n->typ->size <= 4) { + OPM_WriteString((CHAR*)"(int)", 6); } if (OPV_SideEffects(n)) { - OPM_WriteString((CHAR*)"__MODF(", (LONGINT)8); + OPM_WriteString((CHAR*)"__MODF(", 8); } else { - OPM_WriteString((CHAR*)"__MOD(", (LONGINT)7); + OPM_WriteString((CHAR*)"__MOD(", 7); } break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, subclass = ", (LONGINT)40); - OPM_LogWNum(subclass, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, subclass = ", 40); + OPM_LogWNum(subclass, 0); OPM_LogWLn(); break; } OPV_expr(l, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); if ((((__IN(subclass, 0x18020000) && r->class == 7)) && r->conval->intval < 0)) { OPM_WriteInt(-r->conval->intval); } else { OPV_expr(r, -1); } if (__IN(subclass, 0x18000000)) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Ident(l->typ->strobj); } OPM_Write(')'); @@ -1063,9 +1081,9 @@ static void OPV_expr (OPT_Node n, INTEGER prec) case 9: case 10: case 11: case 12: case 13: case 14: if (__IN(l->typ->form, 0x8400)) { - OPM_WriteString((CHAR*)"__STRCMP(", (LONGINT)10); + OPM_WriteString((CHAR*)"__STRCMP(", 10); OPV_expr(l, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(r, -1); OPM_Write(')'); OPC_Cmp(subclass); @@ -1075,7 +1093,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPC_Cmp(subclass); typ = l->typ; if ((((((typ->form == 13 && r->typ->form != 11)) && r->typ != typ)) && r->typ != OPT_sysptrtyp)) { - OPM_WriteString((CHAR*)"(void *) ", (LONGINT)10); + OPM_WriteString((CHAR*)"(void *) ", 10); } OPV_expr(r, exprPrec); } @@ -1088,16 +1106,16 @@ static void OPV_expr (OPT_Node n, INTEGER prec) switch (subclass) { case 1: if (form == 9) { - OPM_WriteString((CHAR*)" & ", (LONGINT)4); + OPM_WriteString((CHAR*)" & ", 4); } else { - OPM_WriteString((CHAR*)" * ", (LONGINT)4); + OPM_WriteString((CHAR*)" * ", 4); } break; case 2: if (form == 9) { - OPM_WriteString((CHAR*)" ^ ", (LONGINT)4); + OPM_WriteString((CHAR*)" ^ ", 4); } else { - OPM_WriteString((CHAR*)" / ", (LONGINT)4); + OPM_WriteString((CHAR*)" / ", 4); if (r->obj == NIL || __IN(r->obj->typ->form, 0x70)) { OPM_Write('('); OPC_Ident(n->typ->strobj); @@ -1106,28 +1124,28 @@ static void OPV_expr (OPT_Node n, INTEGER prec) } break; case 5: - OPM_WriteString((CHAR*)" && ", (LONGINT)5); + OPM_WriteString((CHAR*)" && ", 5); break; case 6: if (form == 9) { - OPM_WriteString((CHAR*)" | ", (LONGINT)4); + OPM_WriteString((CHAR*)" | ", 4); } else { - OPM_WriteString((CHAR*)" + ", (LONGINT)4); + OPM_WriteString((CHAR*)" + ", 4); } break; case 7: if (form == 9) { - OPM_WriteString((CHAR*)" & ~", (LONGINT)5); + OPM_WriteString((CHAR*)" & ~", 5); } else { - OPM_WriteString((CHAR*)" - ", (LONGINT)4); + OPM_WriteString((CHAR*)" - ", 4); } break; case 8: - OPM_WriteString((CHAR*)" || ", (LONGINT)5); + OPM_WriteString((CHAR*)" || ", 5); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, subclass = ", (LONGINT)40); - OPM_LogWNum(subclass, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, subclass = ", 40); + OPM_LogWNum(subclass, 0); OPM_LogWLn(); break; } @@ -1143,7 +1161,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) if (l->subcl == 1) { proc = OPV_SuperProc(n); } else { - OPM_WriteString((CHAR*)"__", (LONGINT)3); + OPM_WriteString((CHAR*)"__", 3); proc = OPC_BaseTProc(l->obj); } OPC_Ident(proc); @@ -1172,7 +1190,7 @@ static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) LONGINT adr; if_ = n->left; while (if_ != NIL) { - OPM_WriteString((CHAR*)"if ", (LONGINT)4); + OPM_WriteString((CHAR*)"if ", 4); OPV_expr(if_->left, 12); OPM_Write(' '); OPC_BegBlk(); @@ -1183,9 +1201,9 @@ static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) if (typ->comp == 4) { OPC_BegStat(); OPC_Ident(if_->left->obj); - OPM_WriteString((CHAR*)" *", (LONGINT)3); - OPM_WriteString(obj->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"__ = (void*)", (LONGINT)13); + OPM_WriteString((CHAR*)" *", 3); + OPM_WriteString(obj->name, 256); + OPM_WriteString((CHAR*)"__ = (void*)", 13); obj->adr = 0; OPC_CompleteIdent(obj); OPC_EndStat(); @@ -1201,13 +1219,13 @@ static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) if_ = if_->link; if ((if_ != NIL || n->right != NIL) || withtrap) { OPC_EndBlk0(); - OPM_WriteString((CHAR*)" else ", (LONGINT)7); + OPM_WriteString((CHAR*)" else ", 7); } else { OPC_EndBlk(); } } if (withtrap) { - OPM_WriteString((CHAR*)"__WITHCHK", (LONGINT)10); + OPM_WriteString((CHAR*)"__WITHCHK", 10); OPC_EndStat(); } else if (n->right != NIL) { OPC_BegBlk(); @@ -1221,7 +1239,7 @@ static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc) OPT_Node switchCase = NIL, label = NIL; LONGINT low, high; INTEGER form, i; - OPM_WriteString((CHAR*)"switch ", (LONGINT)8); + OPM_WriteString((CHAR*)"switch ", 8); OPV_expr(n->left, 12); OPM_Write(' '); OPC_BegBlk(); @@ -1253,22 +1271,22 @@ static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc) OPC_Indent(1); OPV_stat(switchCase->right, outerProc); OPC_BegStat(); - OPM_WriteString((CHAR*)"break", (LONGINT)6); + OPM_WriteString((CHAR*)"break", 6); OPC_EndStat(); OPC_Indent(-1); switchCase = switchCase->link; } OPC_BegStat(); - OPM_WriteString((CHAR*)"default: ", (LONGINT)10); + OPM_WriteString((CHAR*)"default: ", 10); if (n->right->conval->setval != 0x0) { OPC_Indent(1); OPM_WriteLn(); OPV_stat(n->right->right, outerProc); OPC_BegStat(); - OPM_WriteString((CHAR*)"break", (LONGINT)6); + OPM_WriteString((CHAR*)"break", 6); OPC_Indent(-1); } else { - OPM_WriteString((CHAR*)"__CASECHK", (LONGINT)10); + OPM_WriteString((CHAR*)"__CASECHK", 10); } OPC_EndStat(); OPC_EndBlk(); @@ -1298,44 +1316,40 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) base = base->BaseTyp; } OPV_design(d, -1); - OPM_WriteString((CHAR*)" = __NEWARR(", (LONGINT)13); + OPM_WriteString((CHAR*)" = __NEWARR(", 13); while (base->comp == 2) { nofdim += 1; base = base->BaseTyp; } if ((base->comp == 4 && OPC_NofPtrs(base) != 0)) { OPC_Ident(base->strobj); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } else if (base->form == 13) { - OPM_WriteString((CHAR*)"POINTER__typ", (LONGINT)13); + OPM_WriteString((CHAR*)"POINTER__typ", 13); } else { - OPM_WriteString((CHAR*)"NIL", (LONGINT)4); + OPM_WriteString((CHAR*)"NIL", 4); } - OPM_WriteString((CHAR*)", ", (LONGINT)3); - OPM_WriteString((CHAR*)"((LONGINT)(", (LONGINT)12); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(base->size); - OPM_WriteString((CHAR*)"))", (LONGINT)3); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(OPC_BaseAlignment(base)); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(nofdim); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(nofdyn); while (typ != base) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); if (typ->comp == 3) { if (x->class == 7) { - OPM_WriteString((CHAR*)"(LONGINT)(", (LONGINT)11); - OPV_expr(x, -1); - OPM_WriteString((CHAR*)")", (LONGINT)2); + OPC_IntLiteral(x->conval->intval, OPM_PointerSize); } else { - OPM_WriteString((CHAR*)"(LONGINT)", (LONGINT)10); + OPM_WriteString((CHAR*)"((SYSTEM_ADRINT)(", 18); OPV_expr(x, 10); + OPM_WriteString((CHAR*)"))", 3); } x = x->link; } else { - OPM_WriteString((CHAR*)"(LONGINT)", (LONGINT)10); - OPM_WriteInt(typ->n); + OPC_IntLiteral(typ->n, OPM_PointerSize); } typ = typ->BaseTyp; } @@ -1378,7 +1392,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPV_DefineTDescs(n->right); OPC_EnterBody(); OPV_InitTDescs(n->right); - OPM_WriteString((CHAR*)"/* BEGIN */", (LONGINT)12); + OPM_WriteString((CHAR*)"/* BEGIN */", 12); OPM_WriteLn(); OPV_stat(n->right, outerProc); OPC_ExitBody(); @@ -1404,11 +1418,11 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) l = n->left; r = n->right; if (l->typ->comp == 2) { - OPM_WriteString((CHAR*)"__MOVE(", (LONGINT)8); + OPM_WriteString((CHAR*)"__MOVE(", 8); OPV_expr(r, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(l, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); if (r->typ == OPT_stringtyp) { OPM_WriteInt(r->conval->intval2); } else { @@ -1421,13 +1435,13 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPV_design(l, -1); l->obj->adr = 1; if (r->typ->form != 11) { - OPM_WriteString((CHAR*)" = (void*)", (LONGINT)11); + OPM_WriteString((CHAR*)" = (void*)", 11); } else { - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteString((CHAR*)" = ", 4); } } else { OPV_design(l, -1); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteString((CHAR*)" = ", 4); } if (l->typ == r->typ) { OPV_expr(r, -1); @@ -1437,9 +1451,9 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPM_Write(')'); OPV_expr(r, -1); } else if (l->typ->comp == 4) { - OPM_WriteString((CHAR*)"*(", (LONGINT)3); + OPM_WriteString((CHAR*)"*(", 3); OPC_Andent(l->typ); - OPM_WriteString((CHAR*)"*)&", (LONGINT)4); + OPM_WriteString((CHAR*)"*)&", 4); OPV_expr(r, 9); } else { OPV_expr(r, -1); @@ -1448,11 +1462,11 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) break; case 1: if (n->left->typ->BaseTyp->comp == 4) { - OPM_WriteString((CHAR*)"__NEW(", (LONGINT)7); + OPM_WriteString((CHAR*)"__NEW(", 7); OPV_design(n->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Andent(n->left->typ->BaseTyp); - OPM_WriteString((CHAR*)")", (LONGINT)2); + OPM_WriteString((CHAR*)")", 2); } else if (__IN(n->left->typ->BaseTyp->comp, 0x0c)) { OPV_NewArr(n->left, n->right); } @@ -1465,43 +1479,43 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) case 15: case 16: OPV_expr(n->left, -1); OPC_SetInclude(n->subcl == 16); - OPM_WriteString((CHAR*)"__SETOF(", (LONGINT)9); + OPM_WriteString((CHAR*)"__SETOF(", 9); OPV_expr(n->right, -1); OPM_Write(')'); break; case 18: - OPM_WriteString((CHAR*)"__COPY(", (LONGINT)8); + OPM_WriteString((CHAR*)"__COPY(", 8); OPV_expr(n->right, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(n->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); - OPV_Len(n->left, ((LONGINT)(0))); + OPM_WriteString((CHAR*)", ", 3); + OPV_Len(n->left, 0); OPM_Write(')'); break; case 31: - OPM_WriteString((CHAR*)"__MOVE(", (LONGINT)8); + OPM_WriteString((CHAR*)"__MOVE(", 8); OPV_expr(n->right, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(n->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(n->right->link, -1); OPM_Write(')'); break; case 24: - OPM_WriteString((CHAR*)"__GET(", (LONGINT)7); + OPM_WriteString((CHAR*)"__GET(", 7); OPV_expr(n->right, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(n->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Ident(n->left->typ->strobj); OPM_Write(')'); break; case 25: - OPM_WriteString((CHAR*)"__PUT(", (LONGINT)7); + OPM_WriteString((CHAR*)"__PUT(", 7); OPV_expr(n->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(n->right, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Ident(n->right->typ->strobj); OPM_Write(')'); break; @@ -1509,15 +1523,15 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPM_err(200); break; case 30: - OPM_WriteString((CHAR*)"__SYSNEW(", (LONGINT)10); + OPM_WriteString((CHAR*)"__SYSNEW(", 10); OPV_design(n->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(n->right, -1); OPM_Write(')'); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, n^.subcl = ", (LONGINT)40); - OPM_LogWNum(n->subcl, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, n^.subcl = ", 40); + OPM_LogWNum(n->subcl, 0); OPM_LogWLn(); break; } @@ -1527,7 +1541,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) if (n->left->subcl == 1) { proc = OPV_SuperProc(n); } else { - OPM_WriteString((CHAR*)"__", (LONGINT)3); + OPM_WriteString((CHAR*)"__", 3); proc = OPC_BaseTProc(n->left->obj); } OPC_Ident(proc); @@ -1543,9 +1557,9 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) if (n->subcl != 32) { OPV_IfStat(n, 0, outerProc); } else if (OPV_assert) { - OPM_WriteString((CHAR*)"__ASSERT(", (LONGINT)10); + OPM_WriteString((CHAR*)"__ASSERT(", 10); OPV_expr(n->left->left->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(n->left->right->right->conval->intval); OPM_Write(')'); OPC_EndStat(); @@ -1558,7 +1572,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) break; case 22: OPV_exit.level += 1; - OPM_WriteString((CHAR*)"while ", (LONGINT)7); + OPM_WriteString((CHAR*)"while ", 7); OPV_expr(n->left, 12); OPM_Write(' '); OPC_BegBlk(); @@ -1568,11 +1582,11 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) break; case 23: OPV_exit.level += 1; - OPM_WriteString((CHAR*)"do ", (LONGINT)4); + OPM_WriteString((CHAR*)"do ", 4); OPC_BegBlk(); OPV_stat(n->left, outerProc); OPC_EndBlk0(); - OPM_WriteString((CHAR*)" while (!", (LONGINT)10); + OPM_WriteString((CHAR*)" while (!", 10); OPV_expr(n->right, 9); OPM_Write(')'); OPV_exit.level -= 1; @@ -1581,13 +1595,13 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) saved = OPV_exit; OPV_exit.level = 0; OPV_exit.label = -1; - OPM_WriteString((CHAR*)"for (;;) ", (LONGINT)10); + OPM_WriteString((CHAR*)"for (;;) ", 10); OPC_BegBlk(); OPV_stat(n->left, outerProc); OPC_EndBlk(); if (OPV_exit.label != -1) { OPC_BegStat(); - OPM_WriteString((CHAR*)"exit__", (LONGINT)7); + OPM_WriteString((CHAR*)"exit__", 7); OPM_WriteInt(OPV_exit.label); OPM_Write(':'); OPC_EndStat(); @@ -1596,39 +1610,39 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) break; case 25: if (OPV_exit.level == 0) { - OPM_WriteString((CHAR*)"break", (LONGINT)6); + OPM_WriteString((CHAR*)"break", 6); } else { if (OPV_exit.label == -1) { OPV_exit.label = OPV_nofExitLabels; OPV_nofExitLabels += 1; } - OPM_WriteString((CHAR*)"goto exit__", (LONGINT)12); + OPM_WriteString((CHAR*)"goto exit__", 12); OPM_WriteInt(OPV_exit.label); } break; case 26: if (OPM_level == 0) { if (OPV_mainprog) { - OPM_WriteString((CHAR*)"__FINI", (LONGINT)7); + OPM_WriteString((CHAR*)"__FINI", 7); } else { - OPM_WriteString((CHAR*)"__ENDMOD", (LONGINT)9); + OPM_WriteString((CHAR*)"__ENDMOD", 9); } } else { if (n->left != NIL) { - OPM_WriteString((CHAR*)"_o_result = ", (LONGINT)13); + OPM_WriteString((CHAR*)"_o_result = ", 13); if ((n->left->typ->form == 13 && n->obj->typ != n->left->typ)) { - OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(void*)", 8); OPV_expr(n->left, 10); } else { OPV_expr(n->left, -1); } - OPM_WriteString((CHAR*)";", (LONGINT)2); + OPM_WriteString((CHAR*)";", 2); OPM_WriteLn(); OPC_BegStat(); OPC_ExitProc(outerProc, 0, 0); - OPM_WriteString((CHAR*)"return _o_result", (LONGINT)17); + OPM_WriteString((CHAR*)"return _o_result", 17); } else { - OPM_WriteString((CHAR*)"return", (LONGINT)7); + OPM_WriteString((CHAR*)"return", 7); } } break; @@ -1639,8 +1653,8 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPC_Halt(n->right->conval->intval); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, n^.class = ", (LONGINT)40); - OPM_LogWNum(n->class, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, n^.class = ", 40); + OPM_LogWNum(n->class, 0); OPM_LogWLn(); break; } diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index 43ab4681..351ef416 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 679e8b8d..f66fdf2c 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -242,7 +242,7 @@ void Platform_Init (INTEGER argc, LONGINT argvadr) Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; Platform_ArgCount = argc; - av = (Platform_ArgVecPtr)(SYSTEM_ADRINT)argvadr; + av = __VAL(Platform_ArgVecPtr, argvadr); Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; Platform_HeapInitHeap(); @@ -254,7 +254,7 @@ BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__le CHAR buf[4096]; INTEGER res; __DUP(var, var__len, CHAR); - res = Platform_getenv(var, var__len, (void*)buf, ((LONGINT)(4096))); + res = Platform_getenv(var, var__len, (void*)buf, 4096); if ((res > 0 && res < 4096)) { __COPY(buf, val, val__len); _o_result = 1; @@ -281,8 +281,8 @@ void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { - av = (Platform_ArgVec)(SYSTEM_ADRINT)Platform_ArgVector; - __COPY(*(*av)[__X(n, ((LONGINT)(1024)))], val, val__len); + av = __VAL(Platform_ArgVec, Platform_ArgVector); + __COPY(*(*av)[__X(n, 1024)], val, val__len); } } @@ -291,17 +291,17 @@ void Platform_GetIntArg (INTEGER n, LONGINT *val) CHAR s[64]; LONGINT k, d, i; s[0] = 0x00; - Platform_GetArg(n, (void*)s, ((LONGINT)(64))); + Platform_GetArg(n, (void*)s, 64); i = 0; if (s[0] == '-') { i = 1; } k = 0; - d = (int)s[__X(i, ((LONGINT)(64)))] - 48; + d = s[__X(i, 64)] - 48; while ((d >= 0 && d <= 9)) { k = k * 10 + d; i += 1; - d = (int)s[__X(i, ((LONGINT)(64)))] - 48; + d = s[__X(i, 64)] - 48; } if (s[0] == '-') { k = -k; @@ -319,10 +319,10 @@ INTEGER Platform_ArgPos (CHAR *s, LONGINT s__len) CHAR arg[256]; __DUP(s, s__len, CHAR); i = 0; - Platform_GetArg(i, (void*)arg, ((LONGINT)(256))); + Platform_GetArg(i, (void*)arg, 256); while ((i < Platform_ArgCount && __STRCMP(s, arg) != 0)) { i += 1; - Platform_GetArg(i, (void*)arg, ((LONGINT)(256))); + Platform_GetArg(i, (void*)arg, 256); } _o_result = i; __DEL(s); @@ -357,7 +357,7 @@ LONGINT Platform_Time (void) void Platform_Delay (LONGINT ms) { while (ms > 30000) { - Platform_sleep(((LONGINT)(30000))); + Platform_sleep(30000); ms = ms - 30000; } if (ms > 0) { @@ -560,7 +560,7 @@ INTEGER Platform_ReadBuf (LONGINT h, SYSTEM_BYTE *b, LONGINT b__len, LONGINT *n) INTEGER _o_result; INTEGER result; *n = 0; - result = Platform_readfile(h, (LONGINT)(SYSTEM_ADRINT)b, b__len, &*n); + result = Platform_readfile(h, (SYSTEM_ADRINT)b, b__len, &*n); if (result == 0) { *n = 0; _o_result = Platform_err(); @@ -665,7 +665,7 @@ INTEGER Platform_Chdir (CHAR *n, LONGINT n__len) _o_result = Platform_err(); return _o_result; } - Platform_getCurrentDirectory((void*)Platform_CWD, ((LONGINT)(4096))); + Platform_getCurrentDirectory((void*)Platform_CWD, 4096); _o_result = 0; return _o_result; } @@ -720,37 +720,37 @@ static void Platform_DisplayHaltCode (LONGINT code) { switch (code) { case -1: - Platform_errstring((CHAR*)"Rider ReadBuf/WriteBuf transfer size longer than buffer.", (LONGINT)57); + Platform_errstring((CHAR*)"Rider ReadBuf/WriteBuf transfer size longer than buffer.", 57); break; case -2: - Platform_errstring((CHAR*)"Index out of range.", (LONGINT)20); + Platform_errstring((CHAR*)"Index out of range.", 20); break; case -3: - Platform_errstring((CHAR*)"Reached end of function without reaching RETURN.", (LONGINT)49); + Platform_errstring((CHAR*)"Reached end of function without reaching RETURN.", 49); break; case -4: - Platform_errstring((CHAR*)"CASE statement: no matching label and no ELSE.", (LONGINT)47); + Platform_errstring((CHAR*)"CASE statement: no matching label and no ELSE.", 47); break; case -5: - Platform_errstring((CHAR*)"Type guard failed.", (LONGINT)19); + Platform_errstring((CHAR*)"Type guard failed.", 19); break; case -6: - Platform_errstring((CHAR*)"Type equality failed.", (LONGINT)22); + Platform_errstring((CHAR*)"Type equality failed.", 22); break; case -7: - Platform_errstring((CHAR*)"WITH statement type guard failed.", (LONGINT)34); + Platform_errstring((CHAR*)"WITH statement type guard failed.", 34); break; case -8: - Platform_errstring((CHAR*)"SHORT: Value too large for shorter type.", (LONGINT)41); + Platform_errstring((CHAR*)"SHORT: Value too large for shorter type.", 41); break; case -9: - Platform_errstring((CHAR*)"Heap interrupted while locked, but lockdepth = 0 at unlock.", (LONGINT)60); + Platform_errstring((CHAR*)"Heap interrupted while locked, but lockdepth = 0 at unlock.", 60); break; case -15: - Platform_errstring((CHAR*)"Type descriptor size mismatch.", (LONGINT)31); + Platform_errstring((CHAR*)"Type descriptor size mismatch.", 31); break; case -20: - Platform_errstring((CHAR*)"Too many, or negative number of, elements in dynamic array.", (LONGINT)60); + Platform_errstring((CHAR*)"Too many, or negative number of, elements in dynamic array.", 60); break; default: break; @@ -764,9 +764,9 @@ void Platform_Halt (LONGINT code) if (Platform_HaltHandler != NIL) { (*Platform_HaltHandler)(code); } - Platform_errstring((CHAR*)"Terminated by Halt(", (LONGINT)20); + Platform_errstring((CHAR*)"Terminated by Halt(", 20); Platform_errint(code); - Platform_errstring((CHAR*)"). ", (LONGINT)4); + Platform_errstring((CHAR*)"). ", 4); if (code < 0) { Platform_DisplayHaltCode(code); } @@ -777,11 +777,11 @@ void Platform_Halt (LONGINT code) void Platform_AssertFail (LONGINT code) { INTEGER e; - Platform_errstring((CHAR*)"Assertion failure.", (LONGINT)19); + Platform_errstring((CHAR*)"Assertion failure.", 19); if (code != 0) { - Platform_errstring((CHAR*)" ASSERT code ", (LONGINT)14); + Platform_errstring((CHAR*)" ASSERT code ", 14); Platform_errint(code); - Platform_errstring((CHAR*)".", (LONGINT)2); + Platform_errstring((CHAR*)".", 2); } Platform_errln(); Platform_exit(__VAL(INTEGER, code)); @@ -796,7 +796,7 @@ static void Platform_TestLittleEndian (void) { INTEGER i; i = 1; - __GET((LONGINT)(SYSTEM_ADRINT)&i, Platform_LittleEndian, BOOLEAN); + __GET((SYSTEM_ADRINT)&i, Platform_LittleEndian, BOOLEAN); } __TDESC(Platform_FileIdentity, 1, 0) = {__TDFLDS("FileIdentity", 40), {-8}}; @@ -813,7 +813,7 @@ export void *Platform__init(void) Platform_TimeStart = 0; Platform_TimeStart = Platform_Time(); Platform_CWD[0] = 0x00; - Platform_getCurrentDirectory((void*)Platform_CWD, ((LONGINT)(4096))); + Platform_getCurrentDirectory((void*)Platform_CWD, 4096); Platform_PID = Platform_getpid(); Platform_SeekSet = Platform_seekset(); Platform_SeekCur = Platform_seekcur(); diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index aa08a76c..45566c5d 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index a5a93902..0652d6b4 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -59,7 +59,7 @@ INTEGER Reals_Expo (REAL x) { INTEGER _o_result; INTEGER i; - __GET((LONGINT)(SYSTEM_ADRINT)&x + 2, i, INTEGER); + __GET((SYSTEM_ADRINT)&x + 2, i, INTEGER); _o_result = __MASK(__ASHR(i, 7), -256); return _o_result; } @@ -67,17 +67,17 @@ INTEGER Reals_Expo (REAL x) void Reals_SetExpo (REAL *x, INTEGER ex) { CHAR c; - __GET((LONGINT)(SYSTEM_ADRINT)x + 3, c, CHAR); - __PUT((LONGINT)(SYSTEM_ADRINT)x + 3, (CHAR)(__ASHL(__ASHR((int)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); - __GET((LONGINT)(SYSTEM_ADRINT)x + 2, c, CHAR); - __PUT((LONGINT)(SYSTEM_ADRINT)x + 2, (CHAR)(__MASK((int)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); + __GET((SYSTEM_ADRINT)x + 3, c, CHAR); + __PUT((SYSTEM_ADRINT)x + 3, (CHAR)(__ASHL(__ASHR(c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __GET((SYSTEM_ADRINT)x + 2, c, CHAR); + __PUT((SYSTEM_ADRINT)x + 2, (CHAR)(__MASK(c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } INTEGER Reals_ExpoL (LONGREAL x) { INTEGER _o_result; INTEGER i; - __GET((LONGINT)(SYSTEM_ADRINT)&x + 6, i, INTEGER); + __GET((SYSTEM_ADRINT)&x + 6, i, INTEGER); _o_result = __MASK(__ASHR(i, 4), -2048); return _o_result; } @@ -124,20 +124,20 @@ static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LO l = b__len; while ((SYSTEM_INT64)i < l) { by = __VAL(CHAR, b[__X(i, b__len)]); - d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((int)by, 4)); - d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((int)by, -16)); + d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR(by, 4)); + d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK(by, -16)); i += 1; } } void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len) { - Reals_BytesToHex((void*)&y, ((LONGINT)(4)), (void*)d, d__len * ((LONGINT)(1))); + Reals_BytesToHex((void*)&y, 4, (void*)d, d__len * 1); } void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len) { - Reals_BytesToHex((void*)&x, ((LONGINT)(8)), (void*)d, d__len * ((LONGINT)(1))); + Reals_BytesToHex((void*)&x, 8, (void*)d, d__len * 1); } diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index 76bda39d..9836b502 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index bd57ef4e..ad6ecbeb 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -113,7 +113,7 @@ void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n, INTEGER len, destLen, i; __DUP(source, source__len, CHAR); len = Strings_Length(source, source__len); - destLen = (int)dest__len - 1; + destLen = (SYSTEM_INT32)dest__len - 1; if (pos < 0) { pos = 0; } diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index aa97eeac..f836f9f9 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index cd9388a6..01c67abc 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Files.h" @@ -232,7 +232,7 @@ static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len) Texts_FontsFont _o_result; Texts_FontsFont F = NIL; __NEW(F, Texts_FontDesc); - __COPY(name, F->name, ((LONGINT)(32))); + __COPY(name, F->name, 32); _o_result = F; return _o_result; } @@ -399,15 +399,15 @@ static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, LONGINT *msg__t e->file = ((Texts_Alien)E)->file; e->org = ((Texts_Alien)E)->org; e->span = ((Texts_Alien)E)->span; - __COPY(((Texts_Alien)E)->mod, e->mod, ((LONGINT)(32))); - __COPY(((Texts_Alien)E)->proc, e->proc, ((LONGINT)(32))); + __COPY(((Texts_Alien)E)->mod, e->mod, 32); + __COPY(((Texts_Alien)E)->proc, e->proc, 32); (*msg__).e = (Texts_Elem)e; } else __WITHCHK; } else if (__IS(msg__typ, Texts_IdentifyMsg, 1)) { if (__IS(msg__typ, Texts_IdentifyMsg, 1)) { Texts_IdentifyMsg *msg__ = (void*)msg; - __COPY(((Texts_Alien)E)->mod, (*msg__).mod, ((LONGINT)(32))); - __COPY(((Texts_Alien)E)->proc, (*msg__).proc, ((LONGINT)(32))); + __COPY(((Texts_Alien)E)->mod, (*msg__).mod, 32); + __COPY(((Texts_Alien)E)->proc, (*msg__).proc, 32); (*msg__).mod[31] = 0x01; } else __WITHCHK; } else if (__IS(msg__typ, Texts_FileMsg, 1)) { @@ -747,7 +747,7 @@ static void ReadScaleFactor__32 (void) } } while (('0' <= *Scan__31_s->ch && *Scan__31_s->ch <= '9')) { - *Scan__31_s->e = (*Scan__31_s->e * 10 + (int)*Scan__31_s->ch) - 48; + *Scan__31_s->e = (*Scan__31_s->e * 10 + *Scan__31_s->ch) - 48; Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); } } @@ -781,21 +781,21 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) } if ((('A' <= __CAP(ch) && __CAP(ch) <= 'Z') || ch == '/') || ch == '.') { do { - (*S).s[__X(i, ((LONGINT)(64)))] = ch; + (*S).s[__X(i, 64)] = ch; i += 1; Texts_Read((void*)&*S, S__typ, &ch); } while (!((((__CAP(ch) > 'Z' && ch != '_') || ('A' > __CAP(ch) && ch > '9')) || ((('0' > ch && ch != '.')) && ch != '/')) || i == 63)); - (*S).s[__X(i, ((LONGINT)(64)))] = 0x00; + (*S).s[__X(i, 64)] = 0x00; (*S).len = i; (*S).class = 1; } else if (ch == '"') { Texts_Read((void*)&*S, S__typ, &ch); while ((((ch != '"' && ch >= ' ')) && i != 63)) { - (*S).s[__X(i, ((LONGINT)(64)))] = ch; + (*S).s[__X(i, 64)] = ch; i += 1; Texts_Read((void*)&*S, S__typ, &ch); } - (*S).s[__X(i, ((LONGINT)(64)))] = 0x00; + (*S).s[__X(i, 64)] = 0x00; (*S).len = i + 1; Texts_Read((void*)&*S, S__typ, &ch); (*S).class = 2; @@ -810,7 +810,7 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) hex = 0; j = 0; for (;;) { - d[__X(i, ((LONGINT)(32)))] = ch; + d[__X(i, 32)] = ch; i += 1; Texts_Read((void*)&*S, S__typ, &ch); if (ch < '0') { @@ -819,10 +819,10 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) if ('9' < ch) { if (('A' <= ch && ch <= 'F')) { hex = 1; - ch = (CHAR)((int)ch - 7); + ch = (CHAR)(ch - 7); } else if (('a' <= ch && ch <= 'f')) { hex = 1; - ch = (CHAR)((int)ch - 39); + ch = (CHAR)(ch - 39); } else { break; } @@ -834,13 +834,13 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) if (i - j > 8) { j = i - 8; } - k = (int)d[__X(j, ((LONGINT)(32)))] - 48; + k = d[__X(j, 32)] - 48; j += 1; if ((i - j == 7 && k >= 8)) { k -= 16; } while (j < i) { - k = __ASHL(k, 4) + (SYSTEM_INT64)((int)d[__X(j, ((LONGINT)(32)))] - 48); + k = __ASHL(k, 4) + (SYSTEM_INT64)(d[__X(j, 32)] - 48); j += 1; } if (neg) { @@ -852,7 +852,7 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) Texts_Read((void*)&*S, S__typ, &ch); h = i; while (('0' <= ch && ch <= '9')) { - d[__X(i, ((LONGINT)(32)))] = ch; + d[__X(i, 32)] = ch; i += 1; Texts_Read((void*)&*S, S__typ, &ch); } @@ -861,12 +861,12 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) y = (LONGREAL)0; g = (LONGREAL)1; do { - y = y * (LONGREAL)10 + ((int)d[__X(j, ((LONGINT)(32)))] - 48); + y = y * (LONGREAL)10 + (d[__X(j, 32)] - 48); j += 1; } while (!(j == h)); while (j < i) { g = g / (LONGREAL)(LONGREAL)10; - y = ((int)d[__X(j, ((LONGINT)(32)))] - 48) * g + y; + y = (d[__X(j, 32)] - 48) * g + y; j += 1; } ReadScaleFactor__32(); @@ -893,12 +893,12 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) x = (REAL)0; f = (REAL)1; do { - x = x * (REAL)10 + ((int)d[__X(j, ((LONGINT)(32)))] - 48); + x = x * (REAL)10 + (d[__X(j, 32)] - 48); j += 1; } while (!(j == h)); while (j < i) { f = f / (REAL)(REAL)10; - x = ((int)d[__X(j, ((LONGINT)(32)))] - 48) * f + x; + x = (d[__X(j, 32)] - 48) * f + x; j += 1; } if (ch == 'E') { @@ -930,7 +930,7 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) (*S).class = 3; k = 0; do { - k = k * 10 + (SYSTEM_INT64)((int)d[__X(j, ((LONGINT)(32)))] - 48); + k = k * 10 + (SYSTEM_INT64)(d[__X(j, 32)] - 48); j += 1; } while (!(j == i)); if (neg) { @@ -965,8 +965,8 @@ void Texts_OpenWriter (Texts_Writer *W, LONGINT *W__typ) (*W).fnt = Texts_FontsDefault; (*W).col = 15; (*W).voff = 0; - (*W).file = Files_New((CHAR*)"", (LONGINT)1); - Files_Set(&(*W).rider, Files_Rider__typ, (*W).file, ((LONGINT)(0))); + (*W).file = Files_New((CHAR*)"", 1); + Files_Set(&(*W).rider, Files_Rider__typ, (*W).file, 0); } void Texts_SetFont (Texts_Writer *W, LONGINT *W__typ, Texts_FontsFont fnt) @@ -1054,7 +1054,7 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n) i = 0; if (x < 0) { if (x == (-9223372036854775807-1)) { - Texts_WriteString(&*W, W__typ, (CHAR*)" -9223372036854775808", (LONGINT)22); + Texts_WriteString(&*W, W__typ, (CHAR*)" -9223372036854775808", 22); return; } else { n -= 1; @@ -1064,7 +1064,7 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n) x0 = x; } do { - a[__X(i, ((LONGINT)(22)))] = (CHAR)(__MOD(x0, 10) + 48); + a[__X(i, 22)] = (CHAR)(__MOD(x0, 10) + 48); x0 = __DIV(x0, 10); i += 1; } while (!(x0 == 0)); @@ -1077,7 +1077,7 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n) } do { i -= 1; - Texts_Write(&*W, W__typ, a[__X(i, ((LONGINT)(22)))]); + Texts_Write(&*W, W__typ, a[__X(i, 22)]); } while (!(i == 0)); } @@ -1091,16 +1091,16 @@ void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, LONGINT x) do { y = __MASK(x, -16); if (y < 10) { - a[__X(i, ((LONGINT)(20)))] = (CHAR)(y + 48); + a[__X(i, 20)] = (CHAR)(y + 48); } else { - a[__X(i, ((LONGINT)(20)))] = (CHAR)(y + 55); + a[__X(i, 20)] = (CHAR)(y + 55); } x = __ASHR(x, 4); i += 1; } while (!(i == 8)); do { i -= 1; - Texts_Write(&*W, W__typ, a[__X(i, ((LONGINT)(20)))]); + Texts_Write(&*W, W__typ, a[__X(i, 20)]); } while (!(i == 0)); } @@ -1111,13 +1111,13 @@ void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n) CHAR d[9]; e = Reals_Expo(x); if (e == 0) { - Texts_WriteString(&*W, W__typ, (CHAR*)" 0", (LONGINT)4); + Texts_WriteString(&*W, W__typ, (CHAR*)" 0", 4); do { Texts_Write(&*W, W__typ, ' '); n -= 1; } while (!(n <= 3)); } else if (e == 255) { - Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", (LONGINT)5); + Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", 5); while (n > 4) { Texts_Write(&*W, W__typ, ' '); n -= 1; @@ -1154,13 +1154,13 @@ void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n) x = x * 1.0000000e-001; e += 1; } - Reals_Convert(x, n, (void*)d, ((LONGINT)(9))); + Reals_Convert(x, n, (void*)d, 9); n -= 1; - Texts_Write(&*W, W__typ, d[__X(n, ((LONGINT)(9)))]); + Texts_Write(&*W, W__typ, d[__X(n, 9)]); Texts_Write(&*W, W__typ, '.'); do { n -= 1; - Texts_Write(&*W, W__typ, d[__X(n, ((LONGINT)(9)))]); + Texts_Write(&*W, W__typ, d[__X(n, 9)]); } while (!(n == 0)); Texts_Write(&*W, W__typ, 'E'); if (e < 0) { @@ -1197,7 +1197,7 @@ static void dig__54 (INTEGER n) { while (n > 0) { *WriteRealFix__53_s->i -= 1; - Texts_Write(&*WriteRealFix__53_s->W, WriteRealFix__53_s->W__typ, (*WriteRealFix__53_s->d)[__X(*WriteRealFix__53_s->i, ((LONGINT)(9)))]); + Texts_Write(&*WriteRealFix__53_s->W, WriteRealFix__53_s->W__typ, (*WriteRealFix__53_s->d)[__X(*WriteRealFix__53_s->i, 9)]); n -= 1; } } @@ -1223,7 +1223,7 @@ void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n, IN Texts_Write(&*W, W__typ, '0'); seq__56(' ', k + 1); } else if (e == 255) { - Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", (LONGINT)5); + Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", 5); seq__56(' ', n - 4); } else { e = __ASHR((e - 127) * 77, 8); @@ -1255,7 +1255,7 @@ void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n, IN } e += 1; i = k + e; - Reals_Convert(x, i, (void*)d, ((LONGINT)(9))); + Reals_Convert(x, i, (void*)d, 9); if (e > 0) { seq__56(' ', ((n - e) - k) - 2); Texts_Write(&*W, W__typ, sign); @@ -1278,10 +1278,10 @@ void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x) { INTEGER i; CHAR d[8]; - Reals_ConvertH(x, (void*)d, ((LONGINT)(8))); + Reals_ConvertH(x, (void*)d, 8); i = 0; do { - Texts_Write(&*W, W__typ, d[__X(i, ((LONGINT)(8)))]); + Texts_Write(&*W, W__typ, d[__X(i, 8)]); i += 1; } while (!(i == 8)); } @@ -1293,13 +1293,13 @@ void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER CHAR d[16]; e = Reals_ExpoL(x); if (e == 0) { - Texts_WriteString(&*W, W__typ, (CHAR*)" 0", (LONGINT)4); + Texts_WriteString(&*W, W__typ, (CHAR*)" 0", 4); do { Texts_Write(&*W, W__typ, ' '); n -= 1; } while (!(n <= 3)); } else if (e == 2047) { - Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", (LONGINT)5); + Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", 5); while (n > 4) { Texts_Write(&*W, W__typ, ' '); n -= 1; @@ -1320,7 +1320,7 @@ void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER } else { Texts_Write(&*W, W__typ, ' '); } - e = (int)__ASHR((SYSTEM_INT64)(e - 1023) * 77, 8); + e = (SYSTEM_INT32)__ASHR((SYSTEM_INT64)(e - 1023) * 77, 8); if (e >= 0) { x = x / (LONGREAL)Reals_TenL(e); } else { @@ -1336,13 +1336,13 @@ void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER x = 1.00000000000000e-001 * x; e += 1; } - Reals_ConvertL(x, n, (void*)d, ((LONGINT)(16))); + Reals_ConvertL(x, n, (void*)d, 16); n -= 1; - Texts_Write(&*W, W__typ, d[__X(n, ((LONGINT)(16)))]); + Texts_Write(&*W, W__typ, d[__X(n, 16)]); Texts_Write(&*W, W__typ, '.'); do { n -= 1; - Texts_Write(&*W, W__typ, d[__X(n, ((LONGINT)(16)))]); + Texts_Write(&*W, W__typ, d[__X(n, 16)]); } while (!(n == 0)); Texts_Write(&*W, W__typ, 'D'); if (e < 0) { @@ -1362,10 +1362,10 @@ void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x) { INTEGER i; CHAR d[16]; - Reals_ConvertHL(x, (void*)d, ((LONGINT)(16))); + Reals_ConvertHL(x, (void*)d, 16); i = 0; do { - Texts_Write(&*W, W__typ, d[__X(i, ((LONGINT)(16)))]); + Texts_Write(&*W, W__typ, d[__X(i, 16)]); i += 1; } while (!(i == 16)); } @@ -1424,13 +1424,13 @@ static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, LONGINT Files_Read(&*r, r__typ, (void*)&eno); if (eno > *Load0__16_s->ecnt) { *Load0__16_s->ecnt = eno; - Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->mods)[__X(eno, ((LONGINT)(64)))], ((LONGINT)(32))); - Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->procs)[__X(eno, ((LONGINT)(64)))], ((LONGINT)(32))); + Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->mods)[__X(eno, 64)], 32); + Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->procs)[__X(eno, 64)], 32); } org = Files_Pos(&*r, r__typ); - M = Modules_ThisMod((*Load0__16_s->mods)[__X(eno, ((LONGINT)(64)))], ((LONGINT)(32))); + M = Modules_ThisMod((*Load0__16_s->mods)[__X(eno, 64)], 32); if (M != NIL) { - Cmd = Modules_ThisCommand(M, (*Load0__16_s->procs)[__X(eno, ((LONGINT)(64)))], ((LONGINT)(32))); + Cmd = Modules_ThisCommand(M, (*Load0__16_s->procs)[__X(eno, 64)], 32); if (Cmd != NIL) { (*Cmd)(); } @@ -1456,8 +1456,8 @@ static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, LONGINT a->file = *Load0__16_s->f; a->org = org; a->span = span; - __COPY((*Load0__16_s->mods)[__X(eno, ((LONGINT)(64)))], a->mod, ((LONGINT)(32))); - __COPY((*Load0__16_s->procs)[__X(eno, ((LONGINT)(64)))], a->proc, ((LONGINT)(32))); + __COPY((*Load0__16_s->mods)[__X(eno, 64)], a->mod, 32); + __COPY((*Load0__16_s->procs)[__X(eno, 64)], a->proc, 32); *e = (Texts_Elem)a; } } @@ -1501,8 +1501,8 @@ static void Texts_Load0 (Files_Rider *r, LONGINT *r__typ, Texts_Text T) while (fno != 0) { if (fno > fcnt) { fcnt = fno; - Files_ReadString(&msg.r, Files_Rider__typ, (void*)name, ((LONGINT)(32))); - fnts[__X(fno, ((LONGINT)(32)))] = Texts_FontsThis((void*)name, ((LONGINT)(32))); + Files_ReadString(&msg.r, Files_Rider__typ, (void*)name, 32); + fnts[__X(fno, 32)] = Texts_FontsThis((void*)name, 32); } Files_Read(&msg.r, Files_Rider__typ, (void*)&col); Files_Read(&msg.r, Files_Rider__typ, (void*)&voff); @@ -1557,9 +1557,9 @@ void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len) __DUP(name, name__len, CHAR); f = Files_Old(name, name__len); if (f == NIL) { - f = Files_New((CHAR*)"", (LONGINT)1); + f = Files_New((CHAR*)"", 1); } - Files_Set(&r, Files_Rider__typ, f, ((LONGINT)(0))); + Files_Set(&r, Files_Rider__typ, f, 0); Files_Read(&r, Files_Rider__typ, (void*)&tag); Files_Read(&r, Files_Rider__typ, (void*)&version); if (tag == 0xf0 || (tag == 0x01 && version == 0xf0)) { @@ -1571,7 +1571,7 @@ void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len) u->col = 15; __NEW(p, Texts_PieceDesc); if ((tag == 0xf7 && version == 0x07)) { - Files_Set(&r, Files_Rider__typ, f, ((LONGINT)(28))); + Files_Set(&r, Files_Rider__typ, f, 28); Files_ReadLInt(&r, Files_Rider__typ, &hlen); Files_Set(&r, Files_Rider__typ, f, 22 + hlen); Files_ReadLInt(&r, Files_Rider__typ, &T->len); @@ -1617,21 +1617,21 @@ static void StoreElem__40 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, Texts_E Files_Rider r1; LONGINT org, span; SHORTINT eno; - __COPY((*Store__39_s->iden).mod, (*Store__39_s->mods)[__X(*Store__39_s->ecnt, ((LONGINT)(64)))], ((LONGINT)(32))); - __COPY((*Store__39_s->iden).proc, (*Store__39_s->procs)[__X(*Store__39_s->ecnt, ((LONGINT)(64)))], ((LONGINT)(32))); + __COPY((*Store__39_s->iden).mod, (*Store__39_s->mods)[__X(*Store__39_s->ecnt, 64)], 32); + __COPY((*Store__39_s->iden).proc, (*Store__39_s->procs)[__X(*Store__39_s->ecnt, 64)], 32); eno = 1; - while (__STRCMP((*Store__39_s->mods)[__X(eno, ((LONGINT)(64)))], (*Store__39_s->iden).mod) != 0 || __STRCMP((*Store__39_s->procs)[__X(eno, ((LONGINT)(64)))], (*Store__39_s->iden).proc) != 0) { + while (__STRCMP((*Store__39_s->mods)[__X(eno, 64)], (*Store__39_s->iden).mod) != 0 || __STRCMP((*Store__39_s->procs)[__X(eno, 64)], (*Store__39_s->iden).proc) != 0) { eno += 1; } Files_Set(&r1, Files_Rider__typ, Files_Base(&*r, r__typ), Files_Pos(&*r, r__typ)); - Files_WriteLInt(&*r, r__typ, ((LONGINT)(0))); - Files_WriteLInt(&*r, r__typ, ((LONGINT)(0))); - Files_WriteLInt(&*r, r__typ, ((LONGINT)(0))); + Files_WriteLInt(&*r, r__typ, 0); + Files_WriteLInt(&*r, r__typ, 0); + Files_WriteLInt(&*r, r__typ, 0); Files_Write(&*r, r__typ, eno); if (eno == *Store__39_s->ecnt) { *Store__39_s->ecnt += 1; - Files_WriteString(&*r, r__typ, (*Store__39_s->iden).mod, ((LONGINT)(32))); - Files_WriteString(&*r, r__typ, (*Store__39_s->iden).proc, ((LONGINT)(32))); + Files_WriteString(&*r, r__typ, (*Store__39_s->iden).mod, 32); + Files_WriteString(&*r, r__typ, (*Store__39_s->iden).proc, 32); } (*Store__39_s->msg).pos = pos; org = Files_Pos(&*r, r__typ); @@ -1666,7 +1666,7 @@ void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T) org = Files_Pos(&*r, r__typ); msg.id = 1; msg.r = *r; - Files_WriteLInt(&msg.r, Files_Rider__typ, ((LONGINT)(0))); + Files_WriteLInt(&msg.r, Files_Rider__typ, 0); u = T->head->next; pos = 0; delta = 0; @@ -1680,15 +1680,15 @@ void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T) iden.mod[0] = 0x01; } if (iden.mod[0] != 0x00) { - fnts[__X(fcnt, ((LONGINT)(32)))] = u->fnt; + fnts[__X(fcnt, 32)] = u->fnt; fno = 1; - while (__STRCMP(fnts[__X(fno, ((LONGINT)(32)))]->name, u->fnt->name) != 0) { + while (__STRCMP(fnts[__X(fno, 32)]->name, u->fnt->name) != 0) { fno += 1; } Files_Write(&msg.r, Files_Rider__typ, fno); if (fno == fcnt) { fcnt += 1; - Files_WriteString(&msg.r, Files_Rider__typ, u->fnt->name, ((LONGINT)(32))); + Files_WriteString(&msg.r, Files_Rider__typ, u->fnt->name, 32); } Files_Write(&msg.r, Files_Rider__typ, u->col); Files_Write(&msg.r, Files_Rider__typ, u->voff); @@ -1737,12 +1737,12 @@ void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T) Files_Set(&r1, Files_Rider__typ, ((Texts_Piece)u)->file, ((Texts_Piece)u)->org); delta = ((Texts_Piece)u)->len; while (delta > 1024) { - Files_ReadBytes(&r1, Files_Rider__typ, (void*)block, ((LONGINT)(1024)), ((LONGINT)(1024))); - Files_WriteBytes(&msg.r, Files_Rider__typ, (void*)block, ((LONGINT)(1024)), ((LONGINT)(1024))); + Files_ReadBytes(&r1, Files_Rider__typ, (void*)block, 1024, 1024); + Files_WriteBytes(&msg.r, Files_Rider__typ, (void*)block, 1024, 1024); delta -= 1024; } - Files_ReadBytes(&r1, Files_Rider__typ, (void*)block, ((LONGINT)(1024)), delta); - Files_WriteBytes(&msg.r, Files_Rider__typ, (void*)block, ((LONGINT)(1024)), delta); + Files_ReadBytes(&r1, Files_Rider__typ, (void*)block, 1024, delta); + Files_WriteBytes(&msg.r, Files_Rider__typ, (void*)block, 1024, delta); } } else __WITHCHK; } else { @@ -1756,7 +1756,7 @@ void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T) } __GUARDEQR(r, r__typ, Files_Rider) = msg.r; if (T->notify != NIL) { - (*T->notify)(T, 3, ((LONGINT)(0)), ((LONGINT)(0))); + (*T->notify)(T, 3, 0, 0); } Store__39_s = _s.lnk; } @@ -1769,7 +1769,7 @@ void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len) CHAR bak[64]; __DUP(name, name__len, CHAR); f = Files_New(name, name__len); - Files_Set(&r, Files_Rider__typ, f, ((LONGINT)(0))); + Files_Set(&r, Files_Rider__typ, f, 0); Files_Write(&r, Files_Rider__typ, 0xf0); Files_Write(&r, Files_Rider__typ, 0x01); Texts_Store(&r, Files_Rider__typ, T); @@ -1777,13 +1777,13 @@ void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len) while (name[__X(i, name__len)] != 0x00) { i += 1; } - __COPY(name, bak, ((LONGINT)(64))); - bak[__X(i, ((LONGINT)(64)))] = '.'; - bak[__X(i + 1, ((LONGINT)(64)))] = 'B'; - bak[__X(i + 2, ((LONGINT)(64)))] = 'a'; - bak[__X(i + 3, ((LONGINT)(64)))] = 'k'; - bak[__X(i + 4, ((LONGINT)(64)))] = 0x00; - Files_Rename(name, name__len, bak, ((LONGINT)(64)), &res); + __COPY(name, bak, 64); + bak[__X(i, 64)] = '.'; + bak[__X(i + 1, 64)] = 'B'; + bak[__X(i + 2, 64)] = 'a'; + bak[__X(i + 3, 64)] = 'k'; + bak[__X(i + 4, 64)] = 0x00; + Files_Rename(name, name__len, bak, 64, &res); Files_Register(f); __DEL(name); } diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index b591e699..699c0323 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/Vishap.c b/bootstrap/windows-88/Vishap.c index 19624204..ffe27b0f 100644 --- a/bootstrap/windows-88/Vishap.c +++ b/bootstrap/windows-88/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkamSf */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -34,31 +34,31 @@ void Vishap_Module (BOOLEAN *done) OPV_AdrAndSize(OPT_topScope); OPT_Export(&ext, &new); if (OPM_noerr) { - OPM_OpenFiles((void*)OPT_SelfName, ((LONGINT)(256))); + OPM_OpenFiles((void*)OPT_SelfName, 256); OPC_Init(); OPV_Module(p); if (OPM_noerr) { if (((OPM_mainProg || OPM_mainLinkStat) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { OPM_DeleteNewSym(); if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"32m", (LONGINT)4); + vt100_SetAttr((CHAR*)"32m", 4); } - OPM_LogWStr((CHAR*)" Main program.", (LONGINT)16); + OPM_LogWStr((CHAR*)" Main program.", 16); if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + vt100_SetAttr((CHAR*)"0m", 3); } } else { if (new) { if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"32m", (LONGINT)4); + vt100_SetAttr((CHAR*)"32m", 4); } - OPM_LogWStr((CHAR*)" New symbol file.", (LONGINT)19); + OPM_LogWStr((CHAR*)" New symbol file.", 19); if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + vt100_SetAttr((CHAR*)"0m", 3); } OPM_RegisterNewSym(); } else if (ext) { - OPM_LogWStr((CHAR*)" Extended symbol file.", (LONGINT)24); + OPM_LogWStr((CHAR*)" Extended symbol file.", 24); OPM_RegisterNewSym(); } } @@ -95,7 +95,7 @@ void Vishap_Translate (void) modulesobj[0] = 0x00; if (OPM_OpenPar()) { for (;;) { - OPM_Init(&done, (void*)Vishap_mname, ((LONGINT)(256))); + OPM_Init(&done, (void*)Vishap_mname, 256); if (!done) { return; } @@ -105,21 +105,21 @@ void Vishap_Translate (void) Vishap_Module(&done); if (!done) { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Module compilation failed.", (LONGINT)27); + OPM_LogWStr((CHAR*)"Module compilation failed.", 27); OPM_LogWLn(); Platform_Exit(1); } if (!OPM_dontAsm) { if (OPM_dontLink) { - extTools_Assemble(OPM_modName, ((LONGINT)(32))); + extTools_Assemble(OPM_modName, 32); } else { if (!(OPM_mainProg || OPM_mainLinkStat)) { - extTools_Assemble(OPM_modName, ((LONGINT)(32))); - Strings_Append((CHAR*)" ", (LONGINT)2, (void*)modulesobj, ((LONGINT)(2048))); - Strings_Append(OPM_modName, ((LONGINT)(32)), (void*)modulesobj, ((LONGINT)(2048))); - Strings_Append((CHAR*)".o", (LONGINT)3, (void*)modulesobj, ((LONGINT)(2048))); + extTools_Assemble(OPM_modName, 32); + Strings_Append((CHAR*)" ", 2, (void*)modulesobj, 2048); + Strings_Append(OPM_modName, 32, (void*)modulesobj, 2048); + Strings_Append((CHAR*)".o", 3, (void*)modulesobj, 2048); } else { - extTools_LinkMain((void*)OPM_modName, ((LONGINT)(32)), OPM_mainLinkStat, modulesobj, ((LONGINT)(2048))); + extTools_LinkMain((void*)OPM_modName, 32, OPM_mainLinkStat, modulesobj, 2048); } } } @@ -134,7 +134,7 @@ static void Vishap_Trap (INTEGER sig) Platform_Exit(0); } else { if ((sig == 4 && Platform_HaltCode == -15)) { - OPM_LogWStr((CHAR*)" --- Vishap Oberon: internal error", (LONGINT)35); + OPM_LogWStr((CHAR*)" --- Vishap Oberon: internal error", 35); OPM_LogWLn(); } Platform_Exit(2); diff --git a/bootstrap/windows-88/errors.c b/bootstrap/windows-88/errors.c index 5493978e..57e3252c 100644 --- a/bootstrap/windows-88/errors.c +++ b/bootstrap/windows-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/windows-88/errors.h b/bootstrap/windows-88/errors.h index 8ce5a106..abc550ac 100644 --- a/bootstrap/windows-88/errors.h +++ b/bootstrap/windows-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index 72df4f99..4e7d428f 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -36,14 +36,14 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN Console_String(title, title__len); Console_String(cmd, cmd__len); Console_Ln(); - Console_String((CHAR*)"-- failed: status ", (LONGINT)19); - Console_Int(status, ((LONGINT)(1))); - Console_String((CHAR*)", exitcode ", (LONGINT)12); - Console_Int(exitcode, ((LONGINT)(1))); - Console_String((CHAR*)".", (LONGINT)2); + Console_String((CHAR*)"-- failed: status ", 19); + Console_Int(status, 1); + Console_String((CHAR*)", exitcode ", 12); + Console_Int(exitcode, 1); + Console_String((CHAR*)".", 2); Console_Ln(); if ((status == 0 && exitcode == 127)) { - Console_String((CHAR*)"Is the C compiler in the current command path\?", (LONGINT)47); + Console_String((CHAR*)"Is the C compiler in the current command path\?", 47); Console_Ln(); } if (status != 0) { @@ -61,11 +61,11 @@ void extTools_Assemble (CHAR *moduleName, LONGINT moduleName__len) CHAR cmd[1023]; __DUP(moduleName, moduleName__len, CHAR); __MOVE("gcc -g", cmd, 7); - Strings_Append(extTools_compilationOptions, ((LONGINT)(1023)), (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)"-c ", (LONGINT)4, (void*)cmd, ((LONGINT)(1023))); - Strings_Append(moduleName, moduleName__len, (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)".c", (LONGINT)3, (void*)cmd, ((LONGINT)(1023))); - extTools_execute((CHAR*)"Assemble: ", (LONGINT)11, cmd, ((LONGINT)(1023))); + Strings_Append(extTools_compilationOptions, 1023, (void*)cmd, 1023); + Strings_Append((CHAR*)"-c ", 4, (void*)cmd, 1023); + Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); + Strings_Append((CHAR*)".c", 3, (void*)cmd, 1023); + extTools_execute((CHAR*)"Assemble: ", 11, cmd, 1023); __DEL(moduleName); } @@ -74,21 +74,21 @@ void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN stati CHAR cmd[1023]; __DUP(additionalopts, additionalopts__len, CHAR); __MOVE("gcc -g", cmd, 7); - Strings_Append((CHAR*)" ", (LONGINT)2, (void*)cmd, ((LONGINT)(1023))); - Strings_Append(extTools_compilationOptions, ((LONGINT)(1023)), (void*)cmd, ((LONGINT)(1023))); - Strings_Append(moduleName, moduleName__len, (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)".c ", (LONGINT)4, (void*)cmd, ((LONGINT)(1023))); - Strings_Append(additionalopts, additionalopts__len, (void*)cmd, ((LONGINT)(1023))); + Strings_Append((CHAR*)" ", 2, (void*)cmd, 1023); + Strings_Append(extTools_compilationOptions, 1023, (void*)cmd, 1023); + Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); + Strings_Append((CHAR*)".c ", 4, (void*)cmd, 1023); + Strings_Append(additionalopts, additionalopts__len, (void*)cmd, 1023); if (statically) { - Strings_Append((CHAR*)"-static", (LONGINT)8, (void*)cmd, ((LONGINT)(1023))); + Strings_Append((CHAR*)"-static", 8, (void*)cmd, 1023); } - Strings_Append((CHAR*)" -o ", (LONGINT)5, (void*)cmd, ((LONGINT)(1023))); - Strings_Append(moduleName, moduleName__len, (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)" -L\"", (LONGINT)5, (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)"/opt/voc", (LONGINT)9, (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)"/lib\"", (LONGINT)6, (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)" -l voc", (LONGINT)8, (void*)cmd, ((LONGINT)(1023))); - extTools_execute((CHAR*)"Assemble and link: ", (LONGINT)20, cmd, ((LONGINT)(1023))); + Strings_Append((CHAR*)" -o ", 5, (void*)cmd, 1023); + Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); + Strings_Append((CHAR*)" -L\"", 5, (void*)cmd, 1023); + Strings_Append((CHAR*)"/opt/voc", 9, (void*)cmd, 1023); + Strings_Append((CHAR*)"/lib\"", 6, (void*)cmd, 1023); + Strings_Append((CHAR*)" -l voc", 8, (void*)cmd, 1023); + extTools_execute((CHAR*)"Assemble and link: ", 20, cmd, 1023); __DEL(additionalopts); } @@ -103,11 +103,11 @@ export void *extTools__init(void) __MODULE_IMPORT(Strings); __REGMOD("extTools", 0); /* BEGIN */ - Strings_Append((CHAR*)" -I \"", (LONGINT)6, (void*)extTools_compilationOptions, ((LONGINT)(1023))); - Strings_Append((CHAR*)"/opt/voc", (LONGINT)9, (void*)extTools_compilationOptions, ((LONGINT)(1023))); - Strings_Append((CHAR*)"/include\" ", (LONGINT)11, (void*)extTools_compilationOptions, ((LONGINT)(1023))); - Platform_GetEnv((CHAR*)"CFLAGS", (LONGINT)7, (void*)extTools_CFLAGS, ((LONGINT)(1023))); - Strings_Append(extTools_CFLAGS, ((LONGINT)(1023)), (void*)extTools_compilationOptions, ((LONGINT)(1023))); - Strings_Append((CHAR*)" ", (LONGINT)2, (void*)extTools_compilationOptions, ((LONGINT)(1023))); + Strings_Append((CHAR*)" -I \"", 6, (void*)extTools_compilationOptions, 1023); + Strings_Append((CHAR*)"/opt/voc", 9, (void*)extTools_compilationOptions, 1023); + Strings_Append((CHAR*)"/include\" ", 11, (void*)extTools_compilationOptions, 1023); + Platform_GetEnv((CHAR*)"CFLAGS", 7, (void*)extTools_CFLAGS, 1023); + Strings_Append(extTools_CFLAGS, 1023, (void*)extTools_compilationOptions, 1023); + Strings_Append((CHAR*)" ", 2, (void*)extTools_compilationOptions, 1023); __ENDMOD; } diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index 4523936a..b5b2af96 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/vt100.c b/bootstrap/windows-88/vt100.c index efcf43ab..037caf04 100644 --- a/bootstrap/windows-88/vt100.c +++ b/bootstrap/windows-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Console.h" @@ -69,12 +69,12 @@ void vt100_IntToStr (LONGINT int_, CHAR *str, LONGINT str__len) } e = s; do { - b[__X(e, ((LONGINT)(21)))] = (CHAR)(__MOD(int_, 10) + 48); + b[__X(e, 21)] = (CHAR)(__MOD(int_, 10) + 48); int_ = __DIV(int_, 10); e += 1; } while (!(int_ == 0)); - b[__X(e, ((LONGINT)(21)))] = 0x00; - vt100_Reverse0((void*)b, ((LONGINT)(21)), s, e - 1); + b[__X(e, 21)] = 0x00; + vt100_Reverse0((void*)b, 21, s, e - 1); } __COPY(b, str, str__len); } @@ -83,9 +83,9 @@ static void vt100_EscSeq0 (CHAR *letter, LONGINT letter__len) { CHAR cmd[9]; __DUP(letter, letter__len, CHAR); - __COPY(vt100_CSI, cmd, ((LONGINT)(9))); - Strings_Append(letter, letter__len, (void*)cmd, ((LONGINT)(9))); - Console_String(cmd, ((LONGINT)(9))); + __COPY(vt100_CSI, cmd, 9); + Strings_Append(letter, letter__len, (void*)cmd, 9); + Console_String(cmd, 9); __DEL(letter); } @@ -94,11 +94,11 @@ static void vt100_EscSeq (INTEGER n, CHAR *letter, LONGINT letter__len) CHAR nstr[2]; CHAR cmd[7]; __DUP(letter, letter__len, CHAR); - vt100_IntToStr(n, (void*)nstr, ((LONGINT)(2))); - __COPY(vt100_CSI, cmd, ((LONGINT)(7))); - Strings_Append(nstr, ((LONGINT)(2)), (void*)cmd, ((LONGINT)(7))); - Strings_Append(letter, letter__len, (void*)cmd, ((LONGINT)(7))); - Console_String(cmd, ((LONGINT)(7))); + vt100_IntToStr(n, (void*)nstr, 2); + __COPY(vt100_CSI, cmd, 7); + Strings_Append(nstr, 2, (void*)cmd, 7); + Strings_Append(letter, letter__len, (void*)cmd, 7); + Console_String(cmd, 7); __DEL(letter); } @@ -107,11 +107,11 @@ static void vt100_EscSeqSwapped (INTEGER n, CHAR *letter, LONGINT letter__len) CHAR nstr[2]; CHAR cmd[7]; __DUP(letter, letter__len, CHAR); - vt100_IntToStr(n, (void*)nstr, ((LONGINT)(2))); - __COPY(vt100_CSI, cmd, ((LONGINT)(7))); - Strings_Append(letter, letter__len, (void*)cmd, ((LONGINT)(7))); - Strings_Append(nstr, ((LONGINT)(2)), (void*)cmd, ((LONGINT)(7))); - Console_String(cmd, ((LONGINT)(7))); + vt100_IntToStr(n, (void*)nstr, 2); + __COPY(vt100_CSI, cmd, 7); + Strings_Append(letter, letter__len, (void*)cmd, 7); + Strings_Append(nstr, 2, (void*)cmd, 7); + Console_String(cmd, 7); __DEL(letter); } @@ -120,124 +120,124 @@ static void vt100_EscSeq2 (INTEGER n, INTEGER m, CHAR *letter, LONGINT letter__l CHAR nstr[5], mstr[5]; CHAR cmd[12]; __DUP(letter, letter__len, CHAR); - vt100_IntToStr(n, (void*)nstr, ((LONGINT)(5))); - vt100_IntToStr(m, (void*)mstr, ((LONGINT)(5))); - __COPY(vt100_CSI, cmd, ((LONGINT)(12))); - Strings_Append(nstr, ((LONGINT)(5)), (void*)cmd, ((LONGINT)(12))); - Strings_Append((CHAR*)";", (LONGINT)2, (void*)cmd, ((LONGINT)(12))); - Strings_Append(mstr, ((LONGINT)(5)), (void*)cmd, ((LONGINT)(12))); - Strings_Append(letter, letter__len, (void*)cmd, ((LONGINT)(12))); - Console_String(cmd, ((LONGINT)(12))); + vt100_IntToStr(n, (void*)nstr, 5); + vt100_IntToStr(m, (void*)mstr, 5); + __COPY(vt100_CSI, cmd, 12); + Strings_Append(nstr, 5, (void*)cmd, 12); + Strings_Append((CHAR*)";", 2, (void*)cmd, 12); + Strings_Append(mstr, 5, (void*)cmd, 12); + Strings_Append(letter, letter__len, (void*)cmd, 12); + Console_String(cmd, 12); __DEL(letter); } void vt100_CUU (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"A", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"A", 2); } void vt100_CUD (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"B", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"B", 2); } void vt100_CUF (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"C", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"C", 2); } void vt100_CUB (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"D", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"D", 2); } void vt100_CNL (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"E", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"E", 2); } void vt100_CPL (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"F", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"F", 2); } void vt100_CHA (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"G", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"G", 2); } void vt100_CUP (INTEGER n, INTEGER m) { - vt100_EscSeq2(n, m, (CHAR*)"H", (LONGINT)2); + vt100_EscSeq2(n, m, (CHAR*)"H", 2); } void vt100_ED (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"J", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"J", 2); } void vt100_EL (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"K", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"K", 2); } void vt100_SU (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"S", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"S", 2); } void vt100_SD (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"T", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"T", 2); } void vt100_HVP (INTEGER n, INTEGER m) { - vt100_EscSeq2(n, m, (CHAR*)"f", (LONGINT)2); + vt100_EscSeq2(n, m, (CHAR*)"f", 2); } void vt100_SGR (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"m", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"m", 2); } void vt100_SGR2 (INTEGER n, INTEGER m) { - vt100_EscSeq2(n, m, (CHAR*)"m", (LONGINT)2); + vt100_EscSeq2(n, m, (CHAR*)"m", 2); } void vt100_DSR (INTEGER n) { - vt100_EscSeq(6, (CHAR*)"n", (LONGINT)2); + vt100_EscSeq(6, (CHAR*)"n", 2); } void vt100_SCP (void) { - vt100_EscSeq0((CHAR*)"s", (LONGINT)2); + vt100_EscSeq0((CHAR*)"s", 2); } void vt100_RCP (void) { - vt100_EscSeq0((CHAR*)"u", (LONGINT)2); + vt100_EscSeq0((CHAR*)"u", 2); } void vt100_DECTCEMl (void) { - vt100_EscSeq0((CHAR*)"\?25l", (LONGINT)5); + vt100_EscSeq0((CHAR*)"\?25l", 5); } void vt100_DECTCEMh (void) { - vt100_EscSeq0((CHAR*)"\?25h", (LONGINT)5); + vt100_EscSeq0((CHAR*)"\?25h", 5); } void vt100_SetAttr (CHAR *attr, LONGINT attr__len) { CHAR tmpstr[16]; __DUP(attr, attr__len, CHAR); - __COPY(vt100_CSI, tmpstr, ((LONGINT)(16))); - Strings_Append(attr, attr__len, (void*)tmpstr, ((LONGINT)(16))); - Console_String(tmpstr, ((LONGINT)(16))); + __COPY(vt100_CSI, tmpstr, 16); + Strings_Append(attr, attr__len, (void*)tmpstr, 16); + Console_String(tmpstr, 16); __DEL(attr); } @@ -253,7 +253,7 @@ export void *vt100__init(void) __REGCMD("RCP", vt100_RCP); __REGCMD("SCP", vt100_SCP); /* BEGIN */ - __COPY("\033", vt100_CSI, ((LONGINT)(5))); - Strings_Append((CHAR*)"[", (LONGINT)2, (void*)vt100_CSI, ((LONGINT)(5))); + __COPY("\033", vt100_CSI, 5); + Strings_Append((CHAR*)"[", 2, (void*)vt100_CSI, 5); __ENDMOD; } diff --git a/bootstrap/windows-88/vt100.h b/bootstrap/windows-88/vt100.h index 65ae6d58..0b63640a 100644 --- a/bootstrap/windows-88/vt100.h +++ b/bootstrap/windows-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/src/compiler/OPC.Mod b/src/compiler/OPC.Mod index b8244fd3..ea629ba1 100644 --- a/src/compiler/OPC.Mod +++ b/src/compiler/OPC.Mod @@ -1260,14 +1260,30 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) Str1("__HALT(#)", n) END Halt; + PROCEDURE IntLiteral*(n, size: LONGINT); + BEGIN + IF (size > OPM.CIntSize) & (n <= OPM.CIntMax) & (n > OPM.CIntMin) THEN + CASE size OF + |2: OPM.WriteString("((SYSTEM_INT16)("); + |4: OPM.WriteString("((SYSTEM_INT32)("); + |8: OPM.WriteString("((SYSTEM_INT64)("); + ELSE OPM.LogWStr("Unhandled case in OPC.IntLiteral, size = "); OPM.LogWNum(size,1); OPM.LogWLn; + END; + OPM.WriteInt(n); + OPM.WriteString("))") + ELSE + OPM.WriteInt(n) + END + END IntLiteral; + PROCEDURE Len* (obj: OPT.Object; array: OPT.Struct; dim: LONGINT); BEGIN IF array^.comp = OPT.DynArr THEN CompleteIdent(obj); OPM.WriteString(LenExt); IF dim # 0 THEN OPM.WriteInt(dim) END ELSE (* array *) - WHILE dim > 0 DO array := array^.BaseTyp; DEC(dim) END ; - OPM.WriteString("((LONGINT)("); OPM.WriteInt(array^.n); OPM.WriteString("))"); + WHILE dim > 0 DO array := array^.BaseTyp; DEC(dim) END; + IF ansi THEN OPM.WriteInt(array.n) ELSE IntLiteral(array.n, OPM.PointerSize) END END END Len; diff --git a/src/compiler/OPM.cmdln.Mod b/src/compiler/OPM.cmdln.Mod index 07b5b89f..10ee8ebb 100644 --- a/src/compiler/OPM.cmdln.Mod +++ b/src/compiler/OPM.cmdln.Mod @@ -74,6 +74,12 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) BodyFile* = 1; HeaderInclude* = 2; + (* C default expression integral size details. Const for now, will be var with avr_gcc/sdcc support *) + CIntSize* = 4; + CIntMax* = 7FFFFFFFH; + CIntMin* = -CIntMax - 1; + + SFext = ".sym"; (* symbol file extension *) BFext = ".c"; (* body file extension *) HFext = ".h"; (* header file extension *) diff --git a/src/compiler/OPT.Mod b/src/compiler/OPT.Mod index efaac954..4b1eda69 100644 --- a/src/compiler/OPT.Mod +++ b/src/compiler/OPT.Mod @@ -1219,7 +1219,8 @@ BEGIN topScope := NIL; OpenScope(0, NIL); OPM.errpos := 0; EnterTyp("SET", Set, OPM.SetSize, settyp); EnterTyp("REAL", Real, OPM.RealSize, realtyp); EnterTyp("INTEGER", Int, OPM.IntSize, inttyp); - EnterTyp("LONGINT", LInt, OPM.LIntSize, linttyp); +(*EnterTyp("LONGINT", LInt, OPM.LIntSize, linttyp);*) + EnterTyp("LONGINT", Int, OPM.LIntSize, linttyp); EnterTyp("LONGREAL", LReal, OPM.LRealSize, lrltyp); EnterTyp("SHORTINT", SInt, OPM.SIntSize, sinttyp); diff --git a/src/compiler/OPV.Mod b/src/compiler/OPV.Mod index a3e2272d..997fdccb 100644 --- a/src/compiler/OPV.Mod +++ b/src/compiler/OPV.Mod @@ -295,10 +295,16 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 END END Entier; - PROCEDURE SizeCast(size: LONGINT); + PROCEDURE SizeCast(from, to: LONGINT); BEGIN - IF size <= 4 THEN OPM.WriteString("(int)") - ELSE OPM.WriteString("(SYSTEM_INT64)") + IF (from # to) & ((from > OPM.CIntSize) OR (to > OPM.CIntSize)) THEN + CASE to OF + |1: OPM.WriteString("(SYSTEM_INT8)"); + |2: OPM.WriteString("(SYSTEM_INT16)"); + |4: OPM.WriteString("(SYSTEM_INT32)"); + |8: OPM.WriteString("(SYSTEM_INT64)"); + ELSE OPM.LogWStr("Unhandled case in OPC.SizeCast, to = "); OPM.LogWNum(to,1); OPM.LogWLn; + END END END SizeCast; @@ -312,8 +318,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 OPM.Write(OpenParen); Entier(n, MinPrec); OPM.WriteString(Comma); OPM.WriteInt(OPM.SignedMaximum(newtype.size) + 1); OPM.Write(CloseParen) ELSE - IF newtype.size # n.typ.size THEN SizeCast(newtype.size) END; - Entier(n, 9) + SizeCast(n.typ.size, newtype.size); Entier(n, 9) END ELSIF to = OPT.Char THEN IF OPM.ranchk IN OPM.opt THEN OPM.WriteString("__CHR"); @@ -443,6 +448,12 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 IF prec > designPrec THEN OPM.Write(CloseParen) END END design; + PROCEDURE ParIntLiteral(n, size: LONGINT); + BEGIN + (* Literal parameters (other than varargs) do not need an explicit size cast on ansi C compilers. *) + IF ansi THEN OPM.WriteInt(n) ELSE OPC.IntLiteral(n, size) END + END ParIntLiteral; + PROCEDURE ActualPar(n: OPT.Node; fp: OPT.Object); VAR typ, aptyp: OPT.Struct; comp, form, mode, prec, dim: INTEGER; BEGIN @@ -465,8 +476,12 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 ELSE IF (form IN {OPT.Real, OPT.LReal}) & (n^.typ^.form IN OPT.intSet) THEN (* real promotion *) OPM.WriteString("(double)"); prec := 9 - ELSIF (form = OPT.LInt) & (n^.typ^.form < OPT.LInt) THEN (* integral promotion *) + (* + ELSIF (form IN OPT.intSet) & (typ.size = OPM.LIntSize) & (n.typ.form <= OPT.LInt) & (n.typ.size < OPM.LIntSize) THEN (* integral promotion *) OPM.WriteString("(LONGINT)"); prec := 9 + *) + ELSIF form IN OPT.intSet THEN + SizeCast(n.typ.size, typ.size) END END ELSIF ansi THEN @@ -475,9 +490,8 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 END; IF (mode = OPT.VarPar) & (n^.class = OPT.Nmop) & (n^.subcl = OPT.val) THEN expr(n^.left, prec) (* avoid cast in lvalue *) - ELSIF (form = OPT.LInt) & (n^.class = OPT.Nconst) - & (n^.conval^.intval <= OPM.SignedMaximum(OPM.IntSize)) & (n^.conval^.intval >= OPM.SignedMinimum(OPM.IntSize)) THEN - OPM.WriteString("((LONGINT)("); expr(n, prec); OPM.WriteString("))"); + ELSIF (form IN OPT.intSet) & (n^.class = OPT.Nconst) THEN + ParIntLiteral(n.conval.intval, n.typ.size) ELSE expr(n, prec) END; @@ -485,7 +499,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 OPM.WriteString(", "); TypeOf(n) ELSIF comp = OPT.DynArr THEN IF n^.class = OPT.Nconst THEN (* ap is string constant *) - OPM.WriteString(Comma); OPM.WriteString("(LONGINT)"); OPM.WriteInt(n^.conval^.intval2) + OPM.WriteString(Comma); ParIntLiteral(n.conval.intval2, OPM.PointerSize) ELSE aptyp := n^.typ; dim := 0; WHILE (typ^.comp = OPT.DynArr) & (typ^.BaseTyp^.form # OPT.Byte) DO @@ -497,7 +511,8 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 WHILE aptyp^.comp = OPT.DynArr DO Len(n, dim); OPM.WriteString(" * "); INC(dim); aptyp := aptyp^.BaseTyp END ; - OPM.WriteString("((LONGINT)("); OPM.WriteInt(aptyp^.size); OPM.WriteString("))"); + (*OPM.WriteString("((LONGINT)("); OPM.WriteInt(aptyp^.size); OPM.WriteString("))");*) + ParIntLiteral(aptyp.size, OPM.PointerSize) END END END ; @@ -551,7 +566,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 | OPT.conv: Convert(l, n.typ, exprPrec) | OPT.abs: IF SideEffects(l) THEN IF l^.typ^.form < OPT.Real THEN - IF l^.typ^.form < OPT.LInt THEN OPM.WriteString("(int)") END ; + IF l.typ.size <= OPM.CIntSize THEN OPM.WriteString("(int)") END ; OPM.WriteString("__ABSF(") ELSE OPM.WriteString("__ABSFD(") END @@ -560,7 +575,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 expr(l, MinPrec); OPM.Write(CloseParen) | OPT.cap: OPM.WriteString("__CAP("); expr(l, MinPrec); OPM.Write(CloseParen) | OPT.odd: OPM.WriteString("__ODD("); expr(l, MinPrec); OPM.Write(CloseParen) - | OPT.adr: OPM.WriteString("(LONGINT)(SYSTEM_ADRINT)"); (*SYSTEM*) + | OPT.adr: OPM.WriteString("(SYSTEM_ADRINT)"); (*SYSTEM*) IF l^.class = OPT.Nvarpar THEN OPC.CompleteIdent(l^.obj) ELSE IF (l^.typ^.form # OPT.String) & ~(l^.typ^.comp IN {OPT.Array, OPT.DynArr}) THEN OPM.Write("&") END ; @@ -616,11 +631,11 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 ELSE OPM.WriteString("__ROT(") END | OPS.div: IF SideEffects(n) THEN - IF form < OPT.LInt THEN OPM.WriteString("(int)") END ; + IF n.typ.size <= OPM.CIntSize THEN OPM.WriteString("(int)") END; OPM.WriteString("__DIVF(") ELSE OPM.WriteString("__DIV(") END - | OPS.mod: IF form < OPT.LInt THEN OPM.WriteString("(int)") END ; + | OPS.mod: IF n.typ.size <= OPM.CIntSize THEN OPM.WriteString("(int)") END; IF SideEffects(n) THEN OPM.WriteString("__MODF(") ELSE OPM.WriteString("__MOD(") END; @@ -782,18 +797,20 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 ELSIF base^.form = OPT.Pointer THEN OPM.WriteString("POINTER__typ") ELSE OPM.WriteString("NIL") END ; - OPM.WriteString(", "); OPM.WriteString("((LONGINT)("); OPM.WriteInt(base^.size); OPM.WriteString("))"); + OPM.WriteString(", "); OPM.WriteInt(base.size); OPM.WriteString(", "); OPM.WriteInt(OPC.BaseAlignment(base)); (* element alignment *) OPM.WriteString(", "); OPM.WriteInt(nofdim); (* total number of dimensions = number of additional parameters *) OPM.WriteString(", "); OPM.WriteInt(nofdyn); (* number of dynamic dimensions *) WHILE typ # base DO OPM.WriteString(", "); IF typ^.comp = OPT.DynArr THEN - IF x^.class = OPT.Nconst THEN OPM.WriteString("(LONGINT)("); expr(x, MinPrec); OPM.WriteString(")") - ELSE OPM.WriteString("(LONGINT)"); expr(x, 10) + IF x^.class = OPT.Nconst THEN + OPC.IntLiteral(x.conval.intval, OPM.PointerSize) + ELSE OPM.WriteString("((SYSTEM_ADRINT)("); expr(x, 10); OPM.WriteString("))") END ; x := x^.link - ELSE OPM.WriteString("(LONGINT)"); OPM.WriteInt(typ^.n) + ELSE + OPC.IntLiteral(typ.n, OPM.PointerSize) END ; typ := typ^.BaseTyp END ; From a1fd798f6d63622063833360e19ed5be8e082217 Mon Sep 17 00:00:00 2001 From: David Brown Date: Wed, 31 Aug 2016 18:33:53 +0100 Subject: [PATCH 204/580] Remove all use of forms SInt and LInt and remove intSet using just Int instead. --- bootstrap/unix-44/Files.c | 16 ++-- bootstrap/unix-44/Heap.c | 16 ++-- bootstrap/unix-44/OPB.c | 146 ++++++++++++++++---------------- bootstrap/unix-44/OPC.c | 18 ++-- bootstrap/unix-44/OPM.c | 22 ++--- bootstrap/unix-44/OPP.c | 26 +++--- bootstrap/unix-44/OPS.c | 6 +- bootstrap/unix-44/OPT.c | 30 +++---- bootstrap/unix-44/OPV.c | 20 ++--- bootstrap/unix-44/Platform.c | 8 +- bootstrap/unix-44/Reals.c | 8 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Texts.c | 22 ++--- bootstrap/unix-48/Files.c | 16 ++-- bootstrap/unix-48/Heap.c | 16 ++-- bootstrap/unix-48/OPB.c | 146 ++++++++++++++++---------------- bootstrap/unix-48/OPC.c | 18 ++-- bootstrap/unix-48/OPM.c | 22 ++--- bootstrap/unix-48/OPP.c | 26 +++--- bootstrap/unix-48/OPS.c | 6 +- bootstrap/unix-48/OPT.c | 30 +++---- bootstrap/unix-48/OPV.c | 20 ++--- bootstrap/unix-48/Platform.c | 8 +- bootstrap/unix-48/Reals.c | 8 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Texts.c | 22 ++--- bootstrap/unix-88/Files.c | 4 +- bootstrap/unix-88/Heap.c | 16 ++-- bootstrap/unix-88/OPB.c | 140 +++++++++++++++--------------- bootstrap/unix-88/OPC.c | 4 +- bootstrap/unix-88/OPM.c | 6 +- bootstrap/unix-88/OPP.c | 20 ++--- bootstrap/unix-88/OPT.c | 16 ++-- bootstrap/unix-88/OPV.c | 14 +-- bootstrap/unix-88/Platform.c | 4 +- bootstrap/windows-48/Files.c | 16 ++-- bootstrap/windows-48/Heap.c | 16 ++-- bootstrap/windows-48/OPB.c | 146 ++++++++++++++++---------------- bootstrap/windows-48/OPC.c | 18 ++-- bootstrap/windows-48/OPM.c | 22 ++--- bootstrap/windows-48/OPP.c | 26 +++--- bootstrap/windows-48/OPS.c | 6 +- bootstrap/windows-48/OPT.c | 30 +++---- bootstrap/windows-48/OPV.c | 20 ++--- bootstrap/windows-48/Platform.c | 8 +- bootstrap/windows-48/Reals.c | 8 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Texts.c | 22 ++--- bootstrap/windows-88/Files.c | 4 +- bootstrap/windows-88/Heap.c | 16 ++-- bootstrap/windows-88/OPB.c | 140 +++++++++++++++--------------- bootstrap/windows-88/OPC.c | 4 +- bootstrap/windows-88/OPM.c | 6 +- bootstrap/windows-88/OPP.c | 20 ++--- bootstrap/windows-88/OPT.c | 16 ++-- bootstrap/windows-88/OPV.c | 14 +-- bootstrap/windows-88/Platform.c | 4 +- src/compiler/OPB.Mod | 146 +++++++++++++++----------------- src/compiler/OPC.Mod | 8 +- src/compiler/OPP.Mod | 18 ++-- src/compiler/OPT.Mod | 29 +++---- src/compiler/OPV.Mod | 20 ++--- 62 files changed, 828 insertions(+), 861 deletions(-) diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 05991786..a6db1a11 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -851,14 +851,14 @@ void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, INTEGER *x) { CHAR b[2]; Files_ReadBytes(&*R, R__typ, (void*)b, 2, 2); - *x = b[0] + __ASHL(b[1], 8); + *x = (SYSTEM_INT16)b[0] + __ASHL((SYSTEM_INT16)b[1], 8); } void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, LONGINT *x) { CHAR b[4]; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); - *x = ((b[0] + __ASHL(b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); + *x = (((SYSTEM_INT16)b[0] + __ASHL((SYSTEM_INT16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); } void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x) @@ -866,8 +866,8 @@ void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x) CHAR b[4]; LONGINT l; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); - l = ((b[0] + __ASHL(b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); - *x = __VAL(SET, l); + l = (((SYSTEM_INT16)b[0] + __ASHL((SYSTEM_INT16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); + *x = (SET)l; } void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x) @@ -922,12 +922,12 @@ void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, LONGINT *x) s = 0; n = 0; Files_Read(&*R, R__typ, (void*)&ch); - while (ch >= 128) { - n += __ASH((ch - 128), s); + while ((SYSTEM_INT16)ch >= 128) { + n += __ASH(((SYSTEM_INT16)ch - 128), s); s += 7; Files_Read(&*R, R__typ, (void*)&ch); } - n += __ASH((__MASK(ch, -64) - __ASHL(__ASHR(ch, 6), 6)), s); + n += __ASH((__MASK((SYSTEM_INT16)ch, -64) - __ASHL(__ASHR((SYSTEM_INT16)ch, 6), 6)), s); *x = n; } @@ -958,7 +958,7 @@ void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x) { CHAR b[4]; LONGINT i; - i = __VAL(LONGINT, x); + i = (LONGINT)x; b[0] = (CHAR)i; b[1] = (CHAR)__ASHR(i, 8); b[2] = (CHAR)__ASHR(i, 16); diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index e42a752c..f35765c6 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -327,11 +327,11 @@ SYSTEM_PTR Heap_NEWBLK (LONGINT size) Heap_Lock(); blksz = __ASHL(__ASHR(size + 31, 4), 4); new = Heap_NEWREC((SYSTEM_ADRINT)&blksz); - tag = (__VAL(LONGINT, new) + blksz) - 12; + tag = ((LONGINT)(SYSTEM_ADRINT)new + blksz) - 12; __PUT(tag - 4, 0, LONGINT); __PUT(tag, blksz, LONGINT); __PUT(tag + 4, -4, LONGINT); - __PUT(__VAL(LONGINT, new) - 4, tag, LONGINT); + __PUT((LONGINT)(SYSTEM_ADRINT)new - 4, tag, LONGINT); Heap_Unlock(); _o_result = new; return _o_result; @@ -360,7 +360,7 @@ static void Heap_Mark (LONGINT q) __GET(tag, offset, LONGINT); fld = q + offset; p = Heap_FetchAddress(fld); - __PUT(fld, __VAL(SYSTEM_PTR, n), SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)n, SYSTEM_PTR); } else { fld = q + offset; n = Heap_FetchAddress(fld); @@ -369,7 +369,7 @@ static void Heap_Mark (LONGINT q) if (!__ODD(tagbits)) { __PUT(n - 4, tagbits + 1, LONGINT); __PUT(q - 4, tag + 1, LONGINT); - __PUT(fld, __VAL(SYSTEM_PTR, p), SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)p, SYSTEM_PTR); p = q; q = n; tag = tagbits; @@ -384,7 +384,7 @@ static void Heap_Mark (LONGINT q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark(__VAL(LONGINT, p)); + Heap_Mark((LONGINT)(SYSTEM_ADRINT)p); } static void Heap_Scan (void) @@ -553,7 +553,7 @@ static void Heap_Finalize (void) } else { prev->next = n->next; } - (*n->finalize)(__VAL(SYSTEM_PTR, n->obj)); + (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); if (prev == NIL) { n = Heap_fin; } else { @@ -572,7 +572,7 @@ void Heap_FINALL (void) while (Heap_fin != NIL) { n = Heap_fin; Heap_fin = Heap_fin->next; - (*n->finalize)(__VAL(SYSTEM_PTR, n->obj)); + (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); } } @@ -699,7 +699,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = __VAL(LONGINT, obj); + f->obj = (LONGINT)(SYSTEM_ADRINT)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index 73416071..e6e966a6 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -340,7 +340,7 @@ void OPB_Index (OPT_Node *x, OPT_Node y) f = y->typ->form; if ((*x)->class >= 7) { OPB_err(79); - } else if (!__IN(f, 0x70) || __IN(y->class, 0x0300)) { + } else if (f != 5 || __IN(y->class, 0x0300)) { OPB_err(80); y->typ = OPT_inttyp; } @@ -465,7 +465,7 @@ void OPB_In (OPT_Node *x, OPT_Node y) f = (*x)->typ->form; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); - } else if ((__IN(f, 0x70) && y->typ->form == 9)) { + } else if ((f == 5 && y->typ->form == 9)) { if ((*x)->class == 7) { k = (*x)->conval->intval; if (k < 0 || k > OPM_MaxSet) { @@ -567,14 +567,14 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } break; case 6: - if (!__IN(f, 0x01f0)) { + if (!__IN(f, 0x01a0)) { OPB_err(96); } break; case 7: - if (__IN(f, 0x03f0)) { + if (__IN(f, 0x03a0)) { if (z->class == 7) { - if (__IN(f, 0x70)) { + if (f == 5) { if (z->conval->intval == (-2147483647-1)) { OPB_err(203); } else { @@ -595,9 +595,9 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } break; case 21: - if (__IN(f, 0x01f0)) { + if (__IN(f, 0x01a0)) { if (z->class == 7) { - if (__IN(f, 0x70)) { + if (f == 5) { if (z->conval->intval == (-2147483647-1)) { OPB_err(203); } else { @@ -618,7 +618,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) case 22: if (f == 3) { if (z->class == 7) { - z->conval->intval = __CAP((CHAR)z->conval->intval); + z->conval->intval = (SYSTEM_INT16)__CAP((CHAR)z->conval->intval); z->obj = NIL; } else { z = NewOp__29(op, typ, z); @@ -629,7 +629,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } break; case 23: - if (__IN(f, 0x70)) { + if (f == 5) { if (z->class == 7) { z->conval->intval = OPB_BoolToInt(__ODD(z->conval->intval)); z->obj = NIL; @@ -654,7 +654,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->typ = OPT_linttyp; break; case 25: - if ((__IN(f, 0x70) && z->class == 7)) { + if ((f == 5 && z->class == 7)) { if ((0 <= z->conval->intval && z->conval->intval <= -1)) { z = NewOp__29(op, typ, z); } else { @@ -777,7 +777,7 @@ static INTEGER ConstCmp__14 (void) case 0: res = 9; break; - case 1: case 3: case 4: case 5: case 6: + case 1: case 3: case 4: case 5: if ((*ConstOp__13_s->xval)->intval < (*ConstOp__13_s->yval)->intval) { res = 11; } else if ((*ConstOp__13_s->xval)->intval > (*ConstOp__13_s->yval)->intval) { @@ -864,8 +864,8 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) __GUARDEQP(yval, OPT_ConstDesc) = *xval; } break; - case 4: case 5: case 6: - if (__IN(g, 0x70)) { + case 5: + if (g == 5) { if (x->typ->size <= y->typ->size) { x->typ = y->typ; } else { @@ -884,7 +884,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 7: - if (__IN(g, 0x70)) { + if (g == 5) { y->typ = x->typ; yval->realval = yval->intval; } else if (g == 8) { @@ -896,7 +896,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 8: - if (__IN(g, 0x70)) { + if (g == 5) { y->typ = x->typ; yval->realval = yval->intval; } else if (g == 7) { @@ -940,7 +940,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } switch (op) { case 1: - if (__IN(f, 0x70)) { + if (f == 5) { xv = xval->intval; yv = yval->intval; if (((((xv == 0 || yv == 0) || (((xv > 0 && yv > 0)) && yv <= __DIV(2147483647, xv))) || (((xv > 0 && yv < 0)) && yv >= __DIV((-2147483647-1), xv))) || (((xv < 0 && yv > 0)) && xv >= __DIV((-2147483647-1), yv))) || (((((((xv < 0 && yv < 0)) && xv != (-2147483647-1))) && yv != (-2147483647-1))) && -xv <= __DIV(2147483647, -yv))) { @@ -964,7 +964,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 2: - if (__IN(f, 0x70)) { + if (f == 5) { if (yval->intval != 0) { xval->realval = xval->intval / (REAL)yval->intval; OPB_CheckRealType(7, 205, xval); @@ -988,7 +988,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 3: - if (__IN(f, 0x70)) { + if (f == 5) { if (yval->intval != 0) { xval->intval = __DIV(xval->intval, yval->intval); OPB_SetIntType(x); @@ -1000,7 +1000,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 4: - if (__IN(f, 0x70)) { + if (f == 5) { if (yval->intval != 0) { xval->intval = (int)__MOD(xval->intval, yval->intval); OPB_SetIntType(x); @@ -1019,7 +1019,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 6: - if (__IN(f, 0x70)) { + if (f == 5) { temp = (yval->intval >= 0 && xval->intval <= 2147483647 - yval->intval); if (temp || (yval->intval < 0 && xval->intval >= (-2147483647-1) - yval->intval)) { xval->intval += yval->intval; @@ -1042,7 +1042,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 7: - if (__IN(f, 0x70)) { + if (f == 5) { if ((yval->intval >= 0 && xval->intval >= (-2147483647-1) + yval->intval) || (yval->intval < 0 && xval->intval <= 2147483647 + yval->intval)) { xval->intval -= yval->intval; OPB_SetIntType(x); @@ -1122,8 +1122,8 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) f = (*x)->typ->form; g = typ->form; if ((*x)->class == 7) { - if (__IN(f, 0x70)) { - if (__IN(g, 0x70)) { + if (f == 5) { + if (g == 5) { if (f > g) { OPB_SetIntType(*x); if ((*x)->typ->size > typ->size) { @@ -1154,7 +1154,7 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) } } (*x)->obj = NIL; - } else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((*x)->left->typ->form < f || f > g))) { + } else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((SYSTEM_INT16)(*x)->left->typ->form < f || f > g))) { if ((*x)->left->typ == typ) { *x = (*x)->left; } @@ -1247,17 +1247,17 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPB_err(100); } break; - case 4: case 5: case 6: - if ((__IN(g, 0x70) && y->typ->size < z->typ->size)) { + case 5: + if ((g == 5 && y->typ->size < z->typ->size)) { OPB_Convert(&y, z->typ); - } else if (__IN(g, 0x01f0)) { + } else if (__IN(g, 0x01a0)) { OPB_Convert(&z, y->typ); } else { OPB_err(100); } break; case 7: - if (__IN(g, 0x70)) { + if (g == 5) { OPB_Convert(&y, z->typ); } else if (__IN(g, 0x0180)) { OPB_Convert(&z, y->typ); @@ -1266,7 +1266,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 8: - if (__IN(g, 0x01f0)) { + if (__IN(g, 0x01a0)) { OPB_Convert(&y, z->typ); } else if (__IN(g, 0x0180)) { OPB_Convert(&y, z->typ); @@ -1305,7 +1305,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) switch (op) { case 1: do_ = 1; - if (__IN(f, 0x70)) { + if (f == 5) { if (z->class == 7) { val = z->conval->intval; if (val == 1) { @@ -1345,7 +1345,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 2: - if (__IN(f, 0x70)) { + if (f == 5) { if ((y->class == 7 && y->conval->intval == 0)) { OPB_err(205); } @@ -1364,7 +1364,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) break; case 3: do_ = 1; - if (__IN(f, 0x70)) { + if (f == 5) { if (y->class == 7) { val = y->conval->intval; if (val == 0) { @@ -1387,7 +1387,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 4: - if (__IN(f, 0x70)) { + if (f == 5) { if (y->class == 7) { if (y->conval->intval == 0) { OPB_err(205); @@ -1419,12 +1419,12 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 6: - if (!__IN(f, 0x03f1)) { + if (!__IN(f, 0x03e1)) { OPB_err(105); typ = OPT_undftyp; } do_ = 1; - if (__IN(f, 0x70)) { + if (f == 5) { if ((z->class == 7 && z->conval->intval == 0)) { do_ = 0; z = y; @@ -1438,11 +1438,11 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 7: - if (!__IN(f, 0x03f1)) { + if (!__IN(f, 0x03e1)) { OPB_err(106); typ = OPT_undftyp; } - if ((!__IN(f, 0x70) || y->class != 7) || y->conval->intval != 0) { + if ((f != 5 || y->class != 7) || y->conval->intval != 0) { NewOp__39(op, typ, &z, y); } break; @@ -1498,7 +1498,7 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y) LONGINT k, l; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); - } else if ((__IN((*x)->typ->form, 0x70) && __IN(y->typ->form, 0x70))) { + } else if (((*x)->typ->form == 5 && y->typ->form == 5)) { if ((*x)->class == 7) { k = (*x)->conval->intval; if (0 > k || k > OPM_MaxSet) { @@ -1533,7 +1533,7 @@ void OPB_SetElem (OPT_Node *x) LONGINT k; if ((*x)->class == 8 || (*x)->class == 9) { OPB_err(126); - } else if (!__IN((*x)->typ->form, 0x70)) { + } else if ((*x)->typ->form != 5) { OPB_err(93); } else if ((*x)->class == 7) { k = (*x)->conval->intval; @@ -1583,7 +1583,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) case 0: case 10: break; case 1: - if (!((__IN(g, 0x7a) && y->size == 1))) { + if (!((__IN(g, 0x2a) && y->size == 1))) { OPB_err(113); } break; @@ -1592,18 +1592,18 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPB_err(113); } break; - case 4: case 5: case 6: - if (!__IN(g, 0x70) || x->size < y->size) { + case 5: + if (g != 5 || x->size < y->size) { OPB_err(113); } break; case 7: - if (!__IN(g, 0xf0)) { + if (!__IN(g, 0xe0)) { OPB_err(113); } break; case 8: - if (!__IN(g, 0x01f0)) { + if (!__IN(g, 0x01e0)) { OPB_err(113); } break; @@ -1686,7 +1686,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPM_LogWLn(); break; } - if ((((((ynode->class == 7 && g < f)) && __IN(g, 0xf0))) && __IN(f, 0x01e0))) { + if ((((((ynode->class == 7 && g < f)) && __IN(g, 0xe0))) && __IN(f, 0x01e0))) { OPB_Convert(&ynode, x); } } @@ -1704,7 +1704,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) f = x->typ->form; switch (fctno) { case 0: - if ((__IN(f, 0x70) && x->class == 7)) { + if ((f == 5 && x->class == 7)) { if ((0 <= x->conval->intval && x->conval->intval <= 255)) { OPB_BindNodes(28, OPT_notyp, &x, x); } else { @@ -1777,7 +1777,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) x = OPB_NewIntConst(0); x->typ = OPT_chartyp; break; - case 4: case 5: case 6: + case 5: x = OPB_NewIntConst(OPM_SignedMinimum(x->typ->size)); break; case 9: @@ -1808,7 +1808,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) x = OPB_NewIntConst(255); x->typ = OPT_chartyp; break; - case 4: case 5: case 6: + case 5: x = OPB_NewIntConst(OPM_SignedMaximum(x->typ->size)); break; case 9: @@ -1832,7 +1832,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 9: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x71)) { + } else if (__IN(f, 0x21)) { OPB_Convert(&x, OPT_chartyp); } else { OPB_err(111); @@ -1842,7 +1842,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 10: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { typ = OPT_ShorterOrLongerType(x->typ, -1); if (typ == NIL) { OPB_err(111); @@ -1858,7 +1858,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 11: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { typ = OPT_ShorterOrLongerType(x->typ, 1); if (typ == NIL) { OPB_err(111); @@ -1876,7 +1876,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 13: case 14: if (OPB_NotVar(x)) { OPB_err(112); - } else if (!__IN(f, 0x70)) { + } else if (f != 5) { OPB_err(111); } else if (x->readonly) { OPB_err(76); @@ -1911,7 +1911,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 19: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { if (x->typ->size != OPM_LIntSize) { OPB_Convert(&x, OPT_linttyp); } @@ -1943,22 +1943,22 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 22: case 23: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (!__IN(f, 0x027a)) { + } else if (!__IN(f, 0x022a)) { OPB_err(111); } break; case 24: case 25: case 28: case 31: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((((x->class == 7 && __IN(f, 0x70))) && x->typ->size < OPT_linttyp->size)) { + } else if ((((x->class == 7 && f == 5)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x2070) && x->typ->size == OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x2020) && x->typ->size == OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } break; case 26: case 27: - if ((__IN(f, 0x70) && x->class == 7)) { + if ((f == 5 && x->class == 7)) { if (x->conval->intval < 0 || x->conval->intval > -1) { OPB_err(220); } @@ -2036,7 +2036,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) p->typ = OPT_notyp; } else { if (x->typ != p->typ) { - if ((x->class == 7 && __IN(f, 0x70))) { + if ((x->class == 7 && f == 5)) { OPB_Convert(&x, p->typ); } else { OPB_err(111); @@ -2049,7 +2049,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 15: case 16: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > OPM_MaxSet))) { OPB_err(202); } @@ -2060,10 +2060,10 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) p->typ = OPT_notyp; break; case 17: - if (!__IN(f, 0x70) || x->class != 7) { + if (!(f == 5) || x->class != 7) { OPB_err(69); } else if (x->typ->size == 1) { - L = x->conval->intval; + L = (SYSTEM_INT16)x->conval->intval; typ = p->typ; while ((L > 0 && __IN(typ->comp, 0x0c))) { typ = typ->BaseTyp; @@ -2109,7 +2109,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 19: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { if ((p->class == 7 && x->class == 7)) { if (-OPB_maxExp > x->conval->intval || x->conval->intval > OPB_maxExp) { OPB_err(208); @@ -2137,7 +2137,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (p->typ->comp == 3) { - if (__IN(f, 0x70)) { + if (f == 5) { if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > OPM_MaxIndex))) { OPB_err(63); } @@ -2153,7 +2153,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 22: case 23: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (!__IN(f, 0x70)) { + } else if (f != 5) { OPB_err(111); } else { if (fctno == 22) { @@ -2185,7 +2185,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 28: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { p = NewOp__53(12, 26, p, x); } else { OPB_err(111); @@ -2209,7 +2209,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 30: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { p = NewOp__53(19, 30, p, x); } else { OPB_err(111); @@ -2219,16 +2219,16 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 31: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((((x->class == 7 && __IN(f, 0x70))) && x->typ->size < OPT_linttyp->size)) { + } else if ((((x->class == 7 && f == 5)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x2070) && x->typ->size == OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x2020) && x->typ->size == OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } p->link = x; break; case 32: - if ((__IN(f, 0x70) && x->class == 7)) { + if ((f == 5 && x->class == 7)) { if ((0 <= x->conval->intval && x->conval->intval <= 255)) { OPB_BindNodes(28, OPT_notyp, &x, x); x->conval = OPT_NewConst(); @@ -2271,7 +2271,7 @@ void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n) OPB_err(126); } else if (p->typ->comp != 3) { OPB_err(64); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > OPM_MaxIndex))) { OPB_err(63); } @@ -2287,7 +2287,7 @@ void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n) } else if ((fctno == 31 && n == 2)) { if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { node = OPT_NewNode(19); node->subcl = 31; node->right = p; @@ -2375,7 +2375,7 @@ static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpa ftyp = ftyp->BaseTyp; atyp = atyp->BaseTyp; if ((fvarpar && ftyp == OPT_bytetyp)) { - if (!__IN(f, 0x0c) || !((__IN(atyp->form, 0x7e) && atyp->size == 1))) { + if (!__IN(f, 0x0c) || !((__IN(atyp->form, 0x2e) && atyp->size == 1))) { if (__IN(18, OPM_opt)) { OPB_err(-301); } @@ -2458,7 +2458,7 @@ void OPB_Param (OPT_Node ap, OPT_Object fp) OPB_err(111); } } else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 13)) { - } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x7e) && ap->typ->size == 1)))))) { + } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x2e) && ap->typ->size == 1)))))) { OPB_err(123); } else if ((fp->typ->form == 13 && ap->class == 5)) { OPB_err(123); diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 494d985f..45784a13 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -179,7 +179,7 @@ static INTEGER OPC_PerfectHash (CHAR *s, LONGINT s__len) i = 0; h = 0; while ((s[__X(i, s__len)] != 0x00 && i < 5)) { - h = 3 * h + s[__X(i, s__len)]; + h = 3 * h + (SYSTEM_INT16)s[__X(i, s__len)]; i += 1; } _o_result = (int)__MOD(h, 105); @@ -759,7 +759,7 @@ static void OPC_CProcDefs (OPT_Object obj, INTEGER vis) INTEGER _for__9; if (obj != NIL) { OPC_CProcDefs(obj->left, vis); - if ((((obj->mode == 9 && obj->vis >= vis)) && obj->adr == 1)) { + if ((((obj->mode == 9 && (SYSTEM_INT16)obj->vis >= vis)) && obj->adr == 1)) { ext = obj->conval->ext; i = 1; if (((*ext)[1] != '#' && !(OPC_Prefixed(ext, (CHAR*)"extern ", 8) || OPC_Prefixed(ext, (CHAR*)"import ", 8)))) { @@ -768,7 +768,7 @@ static void OPC_CProcDefs (OPT_Object obj, INTEGER vis) OPC_DeclareParams(obj->link, 1); OPM_Write(0x09); } - _for__9 = (*obj->conval->ext)[0]; + _for__9 = (SYSTEM_INT16)(*obj->conval->ext)[0]; i = i; while (i <= _for__9) { OPM_Write((*obj->conval->ext)[__X(i, 256)]); @@ -1000,7 +1000,7 @@ static void OPC_IdentList (OPT_Object obj, INTEGER vis) first = 1; while ((obj != NIL && obj->mode != 13)) { if ((__IN(vis, 0x05) || (vis == 1 && obj->vis != 0)) || (vis == 3 && !obj->leaf)) { - if (obj->typ != base || obj->vis != lastvis) { + if (obj->typ != base || (SYSTEM_INT16)obj->vis != lastvis) { if (!first) { OPC_EndStat(); } @@ -1154,7 +1154,7 @@ static void OPC_IncludeImports (OPT_Object obj, INTEGER vis) { if (obj != NIL) { OPC_IncludeImports(obj->left, vis); - if ((((obj->mode == 11 && obj->mnolev != 0)) && OPT_GlbMod[__X(-obj->mnolev, 64)]->vis >= vis)) { + if ((((obj->mode == 11 && obj->mnolev != 0)) && (SYSTEM_INT16)OPT_GlbMod[__X(-obj->mnolev, 64)]->vis >= vis)) { OPC_Include(OPT_GlbMod[__X(-obj->mnolev, 64)]->name, 256); } OPC_IncludeImports(obj->right, vis); @@ -1782,7 +1782,7 @@ void OPC_TypeOf (OPT_Object ap) INTEGER i; __ASSERT(ap->typ->comp == 4, 0); if (ap->mode == 2) { - if (ap->mnolev != OPM_level) { + if ((SYSTEM_INT16)ap->mnolev != OPM_level) { OPM_WriteStringVar((void*)ap->scope->name, 256); OPM_WriteString((CHAR*)"_s->", 5); OPC_Ident(ap); @@ -1850,7 +1850,7 @@ static void OPC_StringLiteral (CHAR *s, LONGINT s__len, LONGINT l) OPM_Write('"'); i = 0; while (i < l) { - c = s[__X(i, s__len)]; + c = (SYSTEM_INT16)s[__X(i, s__len)]; if (c < 32 || c > 126) { OPM_Write('\\'); OPM_Write((CHAR)(48 + __ASHR(c, 6))); @@ -1878,7 +1878,7 @@ void OPC_Case (LONGINT caseVal, INTEGER form) case 3: OPC_CharacterLiteral(caseVal); break; - case 4: case 5: case 6: + case 5: OPM_WriteInt(caseVal); break; default: @@ -1976,7 +1976,7 @@ void OPC_Constant (OPT_Const con, INTEGER form) case 3: OPC_CharacterLiteral(con->intval); break; - case 4: case 5: case 6: + case 5: OPM_WriteInt(con->intval); break; case 7: diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index c3bece55..979d9598 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -154,15 +154,15 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) case 'B': if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_IntSize = s[__X(i, s__len)] - 48; + OPM_IntSize = (SYSTEM_INT16)s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_PointerSize = s[__X(i, s__len)] - 48; + OPM_PointerSize = (SYSTEM_INT16)s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_Alignment = s[__X(i, s__len)] - 48; + OPM_Alignment = (SYSTEM_INT16)s[__X(i, s__len)] - 48; } __ASSERT(OPM_IntSize == 2 || OPM_IntSize == 4, 0); __ASSERT(OPM_PointerSize == 4 || OPM_PointerSize == 8, 0); @@ -458,7 +458,7 @@ static void OPM_ShowLine (LONGINT pos) if (pos >= OPM_ErrorLineLimitPos) { pos = OPM_ErrorLineLimitPos - 1; } - i = (pos - OPM_ErrorLineStartPos); + i = (SYSTEM_INT16)(pos - OPM_ErrorLineStartPos); while (i > 0) { OPM_LogW(' '); i -= 1; @@ -532,12 +532,12 @@ void OPM_err (INTEGER n) void OPM_FPrint (LONGINT *fp, LONGINT val) { - *fp = __ROTL((LONGINT)(__VAL(SET, *fp) ^ __VAL(SET, val)), 1, LONGINT); + *fp = __ROTL((LONGINT)((SET)*fp ^ (SET)val), 1, LONGINT); } void OPM_FPrintSet (LONGINT *fp, SET set) { - OPM_FPrint(&*fp, __VAL(LONGINT, set)); + OPM_FPrint(&*fp, (LONGINT)set); } void OPM_FPrintReal (LONGINT *fp, REAL real) @@ -563,13 +563,13 @@ static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONG if (((*S).class == 1 && __STRCMP((*S).s, name) == 0)) { Texts_Scan(&*S, S__typ); if ((*S).class == 3) { - *size = (*S).i; + *size = (SYSTEM_INT16)(*S).i; Texts_Scan(&*S, S__typ); } else { OPM_Mark(-157, -1); } if ((*S).class == 3) { - *align = (*S).i; + *align = (SYSTEM_INT16)(*S).i; Texts_Scan(&*S, S__typ); } else { OPM_Mark(-157, -1); @@ -753,7 +753,7 @@ void OPM_SymWInt (LONGINT i) void OPM_SymWSet (SET s) { - Files_WriteNum(&OPM_newSF, Files_Rider__typ, __VAL(LONGINT, s)); + Files_WriteNum(&OPM_newSF, Files_Rider__typ, (LONGINT)s); } void OPM_SymWReal (REAL r) @@ -819,13 +819,13 @@ void OPM_WriteHex (LONGINT i) { CHAR s[3]; INTEGER digit; - digit = __ASHR(i, 4); + digit = __ASHR((SYSTEM_INT16)i, 4); if (digit < 10) { s[0] = (CHAR)(48 + digit); } else { s[0] = (CHAR)(87 + digit); } - digit = __MASK(i, -16); + digit = __MASK((SYSTEM_INT16)i, -16); if (digit < 10) { s[1] = (CHAR)(48 + digit); } else { diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index f44a2167..b0e235d3 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -58,7 +58,7 @@ static void OPP_err (INTEGER n) static void OPP_CheckSym (INTEGER s) { - if (OPP_sym == s) { + if ((SYSTEM_INT16)OPP_sym == s) { OPS_Get(&OPP_sym); } else { OPM_err(s); @@ -136,7 +136,7 @@ static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_) OPP_err(135); } OPP_ConstExpression(&x); - if (__IN(x->typ->form, 0x70)) { + if (x->typ->form == 5) { sf = x->conval->intval; if (sf < 0 || sf > 1) { OPP_err(220); @@ -146,7 +146,7 @@ static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_) OPP_err(51); sf = 0; } - *sysflag = sf; + *sysflag = (SYSTEM_INT16)sf; OPP_CheckSym(23); } else { *sysflag = default_; @@ -268,7 +268,7 @@ static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) *typ = OPT_NewStr(15, 2); (*typ)->sysflag = sysflag; OPP_ConstExpression(&x); - if (__IN(x->typ->form, 0x70)) { + if (x->typ->form == 5) { n = x->conval->intval; if (n <= 0 || n > OPM_MaxIndex) { OPP_err(63); @@ -625,7 +625,7 @@ static void OPP_StandProcCall (OPT_Node *x) OPT_Node y = NIL; SHORTINT m; INTEGER n; - m = (*x)->obj->adr; + m = (SYSTEM_INT8)((SYSTEM_INT16)(*x)->obj->adr); n = 0; if (OPP_sym == 30) { OPS_Get(&OPP_sym); @@ -1173,24 +1173,24 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, O for (;;) { OPP_ConstExpression(&x); f = x->typ->form; - if (__IN(f, 0x78)) { + if (__IN(f, 0x28)) { xval = x->conval->intval; } else { OPP_err(61); xval = 1; } - if (__IN(f, 0x70)) { - if (!__IN(LabelTyp->form, 0x70) || LabelTyp->size < x->typ->size) { + if (f == 5) { + if (!(LabelTyp->form == 5) || LabelTyp->size < x->typ->size) { OPP_err(60); } - } else if (LabelTyp->form != f) { + } else if ((SYSTEM_INT16)LabelTyp->form != f) { OPP_err(60); } if (OPP_sym == 21) { OPS_Get(&OPP_sym); OPP_ConstExpression(&y); yval = y->conval->intval; - if ((y->typ->form != f && !((__IN(f, 0x70) && __IN(y->typ->form, 0x70))))) { + if (((SYSTEM_INT16)y->typ->form != f && !((f == 5 && y->typ->form == 5)))) { OPP_err(60); } if (yval < xval) { @@ -1253,7 +1253,7 @@ static void CasePart__31 (OPT_Node *x) *StatSeq__30_s->pos = OPM_errpos; if ((*x)->class == 8 || (*x)->class == 9) { OPP_err(126); - } else if (!__IN((*x)->typ->form, 0x78)) { + } else if (!__IN((*x)->typ->form, 0x38)) { OPP_err(125); } OPP_CheckSym(25); @@ -1439,7 +1439,7 @@ static void OPP_StatSeq (OPT_Node *stat) OPS_Get(&OPP_sym); if (OPP_sym == 38) { OPP_qualident(&id); - if (!__IN(id->typ->form, 0x70)) { + if (!(id->typ->form == 5)) { OPP_err(68); } OPP_CheckSym(34); @@ -1471,7 +1471,7 @@ static void OPP_StatSeq (OPT_Node *stat) SetPos__35(z); OPB_Link(&*stat, &last, z); y = OPB_NewLeaf(t); - } else if (!__IN(y->typ->form, 0x70) || y->typ->size > x->left->typ->size) { + } else if (!(y->typ->form == 5) || y->typ->size > x->left->typ->size) { OPP_err(113); } OPB_Link(&*stat, &last, x); diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index 2a093f8e..89c8242e 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -59,7 +59,7 @@ static void OPS_Str (SHORTINT *sym) if (OPS_intval == 2) { *sym = 35; OPS_numtyp = 1; - OPS_intval = OPS_str[0]; + OPS_intval = (SYSTEM_INT16)OPS_str[0]; } else { *sym = 37; } @@ -112,10 +112,10 @@ static INTEGER Ord__7 (CHAR ch, BOOLEAN hex) { INTEGER _o_result; if (ch <= '9') { - _o_result = ch - 48; + _o_result = (SYSTEM_INT16)ch - 48; return _o_result; } else if (hex) { - _o_result = (ch - 65) + 10; + _o_result = ((SYSTEM_INT16)ch - 65) + 10; return _o_result; } else { OPS_err(2); diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index c81989cb..7398b44a 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -173,7 +173,7 @@ OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir) { OPT_Struct _o_result; INTEGER i; - __ASSERT(__IN(x->form, 0x70), 0); + __ASSERT(x->form == 5, 0); __ASSERT(dir == 1 || dir == -1, 0); __ASSERT(x->BaseTyp == OPT_undftyp, 0); i = 0; @@ -414,7 +414,7 @@ static void OPT_FPrintName (LONGINT *fp, CHAR *name, LONGINT name__len) i = 0; do { ch = name[__X(i, name__len)]; - OPM_FPrint(&*fp, ch); + OPM_FPrint(&*fp, (SYSTEM_INT16)ch); i += 1; } while (!(ch == 0x00)); } @@ -649,7 +649,7 @@ void OPT_FPrintObj (OPT_Object obj) f = obj->typ->form; OPM_FPrint(&fprint, f); switch (f) { - case 2: case 3: case 4: case 5: case 6: + case 2: case 3: case 5: OPM_FPrint(&fprint, obj->conval->intval); break; case 9: @@ -680,11 +680,11 @@ void OPT_FPrintObj (OPT_Object obj) } else if (obj->mode == 9) { OPT_FPrintSign(&fprint, obj->typ, obj->link); ext = obj->conval->ext; - m = (*ext)[0]; + m = (SYSTEM_INT16)(*ext)[0]; f = 1; OPM_FPrint(&fprint, m); while (f <= m) { - OPM_FPrint(&fprint, (*ext)[__X(f, 256)]); + OPM_FPrint(&fprint, (SYSTEM_INT16)(*ext)[__X(f, 256)]); f += 1; } } else if (obj->mode == 5) { @@ -848,9 +848,9 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval) switch (f) { case 1: case 3: case 2: OPM_SymRCh(&ch); - conval->intval = ch; + conval->intval = (SYSTEM_INT16)ch; break; - case 4: case 5: case 6: + case 5: conval->intval = OPM_SymRInt(); break; case 9: @@ -979,7 +979,7 @@ static OPT_Object OPT_InTProc (SHORTINT mno) static OPT_Struct OPT_InTyp (LONGINT tag) { OPT_Struct _o_result; - if (__IN(tag, 0x70)) { + if (tag == 5) { _o_result = OPT_IntType(OPM_SymRInt()); return _o_result; } else { @@ -1049,7 +1049,7 @@ static void OPT_InStruct (OPT_Struct *typ) obj->vis = 0; tag = OPM_SymRInt(); if (tag == 35) { - (*typ)->sysflag = OPM_SymRInt(); + (*typ)->sysflag = (SYSTEM_INT16)OPM_SymRInt(); tag = OPM_SymRInt(); } switch (tag) { @@ -1211,7 +1211,7 @@ static OPT_Object OPT_InObj (SHORTINT mno) obj->mode = 9; ext = OPT_NewExt(); obj->conval->ext = ext; - s = OPM_SymRInt(); + s = (SYSTEM_INT16)OPM_SymRInt(); (*ext)[0] = (CHAR)s; i = 1; while (i <= s) { @@ -1439,7 +1439,7 @@ static void OPT_OutStr (OPT_Struct typ) OPT_Object strobj = NIL; if (typ->ref < OPT_expCtxt.ref) { OPM_SymWInt(-typ->ref); - if (__IN(typ->ref, 0x70)) { + if (typ->ref == 5) { OPM_SymWInt(typ->size); } } else { @@ -1537,7 +1537,7 @@ static void OPT_OutConstant (OPT_Object obj) case 2: case 3: OPM_SymWCh((CHAR)obj->conval->intval); break; - case 4: case 5: case 6: + case 5: OPM_SymWInt(obj->conval->intval); OPM_SymWInt(obj->typ->size); break; @@ -1631,7 +1631,7 @@ static void OPT_OutObj (OPT_Object obj) OPM_SymWInt(33); OPT_OutSign(obj->typ, obj->link); ext = obj->conval->ext; - j = (*ext)[0]; + j = (SYSTEM_INT16)(*ext)[0]; i = 1; OPM_SymWInt(j); while (i <= j) { @@ -1876,7 +1876,7 @@ export void *OPT__init(void) OPT_EnterTyp((CHAR*)"INTEGER", 5, OPM_IntSize, &OPT_inttyp); OPT_EnterTyp((CHAR*)"LONGINT", 5, OPM_LIntSize, &OPT_linttyp); OPT_EnterTyp((CHAR*)"LONGREAL", 8, OPM_LRealSize, &OPT_lrltyp); - OPT_EnterTyp((CHAR*)"SHORTINT", 4, OPM_SIntSize, &OPT_sinttyp); + OPT_EnterTyp((CHAR*)"SHORTINT", 5, OPM_SIntSize, &OPT_sinttyp); OPT_EnterBoolConst((CHAR*)"FALSE", 0); OPT_EnterBoolConst((CHAR*)"TRUE", 1); OPT_EnterProc((CHAR*)"HALT", 0); @@ -1904,9 +1904,7 @@ export void *OPT__init(void) OPT_impCtxt.ref[1] = OPT_bytetyp; OPT_impCtxt.ref[2] = OPT_booltyp; OPT_impCtxt.ref[3] = OPT_chartyp; - OPT_impCtxt.ref[4] = OPT_sinttyp; OPT_impCtxt.ref[5] = OPT_inttyp; - OPT_impCtxt.ref[6] = OPT_linttyp; OPT_impCtxt.ref[7] = OPT_realtyp; OPT_impCtxt.ref[8] = OPT_lrltyp; OPT_impCtxt.ref[9] = OPT_settyp; diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index 75adb37c..7538f014 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -118,7 +118,7 @@ void OPV_TypSize (OPT_Struct typ) } typ->size = offset; typ->align = base; - typ->sysflag = __MASK(typ->sysflag, -256) + __ASHL(offset - off0, 8); + typ->sysflag = __MASK(typ->sysflag, -256) + (SYSTEM_INT16)__ASHL(offset - off0, 8); } else if (c == 2) { OPV_TypSize(typ->BaseTyp); typ->size = typ->n * typ->BaseTyp->size; @@ -474,7 +474,7 @@ static void OPV_Entier (OPT_Node n, INTEGER prec) static void OPV_SizeCast (LONGINT from, LONGINT to) { - if ((from != to && (from > 4 || to > 4))) { + if ((from != to && (from > 4 || to != 4))) { switch (to) { case 1: OPM_WriteString((CHAR*)"(SYSTEM_INT8)", 14); @@ -506,7 +506,7 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec) OPM_WriteString((CHAR*)"__SETOF(", 9); OPV_Entier(n, -1); OPM_Write(')'); - } else if (__IN(to, 0x70)) { + } else if (to == 5) { if ((newtype->size < n->typ->size && __IN(2, OPM_opt))) { OPM_WriteString((CHAR*)"__SHORT", 8); if (OPV_SideEffects(n)) { @@ -589,7 +589,7 @@ static void OPV_design (OPT_Node n, INTEGER prec) obj = n->obj; class = n->class; designPrec = OPV_Precedence(class, n->subcl, n->typ->form, comp); - if ((((((class == 0 && obj->mnolev > 0)) && obj->mnolev != OPM_level)) && prec == 10)) { + if ((((((class == 0 && obj->mnolev > 0)) && (SYSTEM_INT16)obj->mnolev != OPM_level)) && prec == 10)) { designPrec = 9; } if (prec > designPrec) { @@ -688,7 +688,7 @@ static void OPV_design (OPT_Node n, INTEGER prec) if (__IN(3, OPM_opt)) { if (typ->comp == 4) { OPM_WriteString((CHAR*)"__GUARDR(", 10); - if (obj->mnolev != OPM_level) { + if ((SYSTEM_INT16)obj->mnolev != OPM_level) { OPM_WriteStringVar((void*)obj->scope->name, 256); OPM_WriteString((CHAR*)"__curr->", 9); OPC_Ident(obj); @@ -797,10 +797,10 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) OPM_WriteString((CHAR*)"(void*)", 8); } } else { - if ((__IN(form, 0x0180) && __IN(n->typ->form, 0x70))) { + if ((__IN(form, 0x0180) && n->typ->form == 5)) { OPM_WriteString((CHAR*)"(double)", 9); prec = 9; - } else if (__IN(form, 0x70)) { + } else if (form == 5) { OPV_SizeCast(n->typ->size, typ->size); } } @@ -811,7 +811,7 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) } if ((((mode == 2 && n->class == 11)) && n->subcl == 29)) { OPV_expr(n->left, prec); - } else if ((__IN(form, 0x70) && n->class == 7)) { + } else if ((form == 5 && n->class == 7)) { OPV_ParIntLiteral(n->conval->intval, n->typ->size); } else { OPV_expr(n, prec); @@ -965,7 +965,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) } break; case 29: - if (!__IN(l->class, 0x17) || (((__IN(n->typ->form, 0x6240) && __IN(l->typ->form, 0x6240))) && n->typ->size == l->typ->size)) { + if (!__IN(l->class, 0x17) || (((__IN(n->typ->form, 0x6220) && __IN(l->typ->form, 0x6220))) && n->typ->size == l->typ->size)) { OPM_Write('('); OPC_Ident(n->typ->strobj); OPM_Write(')'); @@ -1115,7 +1115,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPM_WriteString((CHAR*)" ^ ", 4); } else { OPM_WriteString((CHAR*)" / ", 4); - if (r->obj == NIL || __IN(r->obj->typ->form, 0x70)) { + if (r->obj == NIL || r->obj->typ->form == 5) { OPM_Write('('); OPC_Ident(n->typ->strobj); OPM_Write(')'); diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 6ff2920b..2508f6f7 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -229,7 +229,7 @@ void Platform_Init (INTEGER argc, LONGINT argvadr) Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; Platform_ArgCount = argc; - av = __VAL(Platform_ArgVecPtr, argvadr); + av = (Platform_ArgVecPtr)(SYSTEM_ADRINT)argvadr; Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; Platform_HeapInitHeap(); @@ -262,7 +262,7 @@ void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { - av = __VAL(Platform_ArgVec, Platform_ArgVector); + av = (Platform_ArgVec)(SYSTEM_ADRINT)Platform_ArgVector; __COPY(*(*av)[__X(n, 1024)], val, val__len); } } @@ -278,11 +278,11 @@ void Platform_GetIntArg (INTEGER n, LONGINT *val) i = 1; } k = 0; - d = s[__X(i, 64)] - 48; + d = (SYSTEM_INT16)s[__X(i, 64)] - 48; while ((d >= 0 && d <= 9)) { k = k * 10 + d; i += 1; - d = s[__X(i, 64)] - 48; + d = (SYSTEM_INT16)s[__X(i, 64)] - 48; } if (s[0] == '-') { k = -k; diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index f2a4b1e4..bea1f4aa 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -67,9 +67,9 @@ void Reals_SetExpo (REAL *x, INTEGER ex) { CHAR c; __GET((SYSTEM_ADRINT)x + 3, c, CHAR); - __PUT((SYSTEM_ADRINT)x + 3, (CHAR)(__ASHL(__ASHR(c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __PUT((SYSTEM_ADRINT)x + 3, (CHAR)(__ASHL(__ASHR((SYSTEM_INT16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); __GET((SYSTEM_ADRINT)x + 2, c, CHAR); - __PUT((SYSTEM_ADRINT)x + 2, (CHAR)(__MASK(c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); + __PUT((SYSTEM_ADRINT)x + 2, (CHAR)(__MASK((SYSTEM_INT16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } INTEGER Reals_ExpoL (LONGREAL x) @@ -136,8 +136,8 @@ static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LO l = b__len; while (i < l) { by = __VAL(CHAR, b[__X(i, b__len)]); - d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR(by, 4)); - d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK(by, -16)); + d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((SYSTEM_INT16)by, 4)); + d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((SYSTEM_INT16)by, -16)); i += 1; } } diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index ec6697bf..f1d4f53d 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -112,7 +112,7 @@ void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n, INTEGER len, destLen, i; __DUP(source, source__len, CHAR); len = Strings_Length(source, source__len); - destLen = dest__len - 1; + destLen = (SYSTEM_INT16)dest__len - 1; if (pos < 0) { pos = 0; } diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index 58a4ec95..e473e702 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -746,7 +746,7 @@ static void ReadScaleFactor__32 (void) } } while (('0' <= *Scan__31_s->ch && *Scan__31_s->ch <= '9')) { - *Scan__31_s->e = (*Scan__31_s->e * 10 + *Scan__31_s->ch) - 48; + *Scan__31_s->e = (*Scan__31_s->e * 10 + (SYSTEM_INT16)*Scan__31_s->ch) - 48; Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); } } @@ -818,10 +818,10 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) if ('9' < ch) { if (('A' <= ch && ch <= 'F')) { hex = 1; - ch = (CHAR)(ch - 7); + ch = (CHAR)((SYSTEM_INT16)ch - 7); } else if (('a' <= ch && ch <= 'f')) { hex = 1; - ch = (CHAR)(ch - 39); + ch = (CHAR)((SYSTEM_INT16)ch - 39); } else { break; } @@ -833,13 +833,13 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) if (i - j > 8) { j = i - 8; } - k = d[__X(j, 32)] - 48; + k = (SYSTEM_INT16)d[__X(j, 32)] - 48; j += 1; if ((i - j == 7 && k >= 8)) { k -= 16; } while (j < i) { - k = __ASHL(k, 4) + (d[__X(j, 32)] - 48); + k = __ASHL(k, 4) + ((SYSTEM_INT16)d[__X(j, 32)] - 48); j += 1; } if (neg) { @@ -860,12 +860,12 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) y = (LONGREAL)0; g = (LONGREAL)1; do { - y = y * (LONGREAL)10 + (d[__X(j, 32)] - 48); + y = y * (LONGREAL)10 + ((SYSTEM_INT16)d[__X(j, 32)] - 48); j += 1; } while (!(j == h)); while (j < i) { g = g / (LONGREAL)(LONGREAL)10; - y = (d[__X(j, 32)] - 48) * g + y; + y = ((SYSTEM_INT16)d[__X(j, 32)] - 48) * g + y; j += 1; } ReadScaleFactor__32(); @@ -892,12 +892,12 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) x = (REAL)0; f = (REAL)1; do { - x = x * (REAL)10 + (d[__X(j, 32)] - 48); + x = x * (REAL)10 + ((SYSTEM_INT16)d[__X(j, 32)] - 48); j += 1; } while (!(j == h)); while (j < i) { f = f / (REAL)(REAL)10; - x = (d[__X(j, 32)] - 48) * f + x; + x = ((SYSTEM_INT16)d[__X(j, 32)] - 48) * f + x; j += 1; } if (ch == 'E') { @@ -929,7 +929,7 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) (*S).class = 3; k = 0; do { - k = k * 10 + (d[__X(j, 32)] - 48); + k = k * 10 + ((SYSTEM_INT16)d[__X(j, 32)] - 48); j += 1; } while (!(j == i)); if (neg) { @@ -1319,7 +1319,7 @@ void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER } else { Texts_Write(&*W, W__typ, ' '); } - e = __ASHR((e - 1023) * 77, 8); + e = (SYSTEM_INT16)__ASHR((e - 1023) * 77, 8); if (e >= 0) { x = x / (LONGREAL)Reals_TenL(e); } else { diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 05991786..a6db1a11 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -851,14 +851,14 @@ void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, INTEGER *x) { CHAR b[2]; Files_ReadBytes(&*R, R__typ, (void*)b, 2, 2); - *x = b[0] + __ASHL(b[1], 8); + *x = (SYSTEM_INT16)b[0] + __ASHL((SYSTEM_INT16)b[1], 8); } void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, LONGINT *x) { CHAR b[4]; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); - *x = ((b[0] + __ASHL(b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); + *x = (((SYSTEM_INT16)b[0] + __ASHL((SYSTEM_INT16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); } void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x) @@ -866,8 +866,8 @@ void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x) CHAR b[4]; LONGINT l; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); - l = ((b[0] + __ASHL(b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); - *x = __VAL(SET, l); + l = (((SYSTEM_INT16)b[0] + __ASHL((SYSTEM_INT16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); + *x = (SET)l; } void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x) @@ -922,12 +922,12 @@ void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, LONGINT *x) s = 0; n = 0; Files_Read(&*R, R__typ, (void*)&ch); - while (ch >= 128) { - n += __ASH((ch - 128), s); + while ((SYSTEM_INT16)ch >= 128) { + n += __ASH(((SYSTEM_INT16)ch - 128), s); s += 7; Files_Read(&*R, R__typ, (void*)&ch); } - n += __ASH((__MASK(ch, -64) - __ASHL(__ASHR(ch, 6), 6)), s); + n += __ASH((__MASK((SYSTEM_INT16)ch, -64) - __ASHL(__ASHR((SYSTEM_INT16)ch, 6), 6)), s); *x = n; } @@ -958,7 +958,7 @@ void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x) { CHAR b[4]; LONGINT i; - i = __VAL(LONGINT, x); + i = (LONGINT)x; b[0] = (CHAR)i; b[1] = (CHAR)__ASHR(i, 8); b[2] = (CHAR)__ASHR(i, 16); diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index e42a752c..f35765c6 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -327,11 +327,11 @@ SYSTEM_PTR Heap_NEWBLK (LONGINT size) Heap_Lock(); blksz = __ASHL(__ASHR(size + 31, 4), 4); new = Heap_NEWREC((SYSTEM_ADRINT)&blksz); - tag = (__VAL(LONGINT, new) + blksz) - 12; + tag = ((LONGINT)(SYSTEM_ADRINT)new + blksz) - 12; __PUT(tag - 4, 0, LONGINT); __PUT(tag, blksz, LONGINT); __PUT(tag + 4, -4, LONGINT); - __PUT(__VAL(LONGINT, new) - 4, tag, LONGINT); + __PUT((LONGINT)(SYSTEM_ADRINT)new - 4, tag, LONGINT); Heap_Unlock(); _o_result = new; return _o_result; @@ -360,7 +360,7 @@ static void Heap_Mark (LONGINT q) __GET(tag, offset, LONGINT); fld = q + offset; p = Heap_FetchAddress(fld); - __PUT(fld, __VAL(SYSTEM_PTR, n), SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)n, SYSTEM_PTR); } else { fld = q + offset; n = Heap_FetchAddress(fld); @@ -369,7 +369,7 @@ static void Heap_Mark (LONGINT q) if (!__ODD(tagbits)) { __PUT(n - 4, tagbits + 1, LONGINT); __PUT(q - 4, tag + 1, LONGINT); - __PUT(fld, __VAL(SYSTEM_PTR, p), SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)p, SYSTEM_PTR); p = q; q = n; tag = tagbits; @@ -384,7 +384,7 @@ static void Heap_Mark (LONGINT q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark(__VAL(LONGINT, p)); + Heap_Mark((LONGINT)(SYSTEM_ADRINT)p); } static void Heap_Scan (void) @@ -553,7 +553,7 @@ static void Heap_Finalize (void) } else { prev->next = n->next; } - (*n->finalize)(__VAL(SYSTEM_PTR, n->obj)); + (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); if (prev == NIL) { n = Heap_fin; } else { @@ -572,7 +572,7 @@ void Heap_FINALL (void) while (Heap_fin != NIL) { n = Heap_fin; Heap_fin = Heap_fin->next; - (*n->finalize)(__VAL(SYSTEM_PTR, n->obj)); + (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); } } @@ -699,7 +699,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = __VAL(LONGINT, obj); + f->obj = (LONGINT)(SYSTEM_ADRINT)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index 73416071..e6e966a6 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -340,7 +340,7 @@ void OPB_Index (OPT_Node *x, OPT_Node y) f = y->typ->form; if ((*x)->class >= 7) { OPB_err(79); - } else if (!__IN(f, 0x70) || __IN(y->class, 0x0300)) { + } else if (f != 5 || __IN(y->class, 0x0300)) { OPB_err(80); y->typ = OPT_inttyp; } @@ -465,7 +465,7 @@ void OPB_In (OPT_Node *x, OPT_Node y) f = (*x)->typ->form; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); - } else if ((__IN(f, 0x70) && y->typ->form == 9)) { + } else if ((f == 5 && y->typ->form == 9)) { if ((*x)->class == 7) { k = (*x)->conval->intval; if (k < 0 || k > OPM_MaxSet) { @@ -567,14 +567,14 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } break; case 6: - if (!__IN(f, 0x01f0)) { + if (!__IN(f, 0x01a0)) { OPB_err(96); } break; case 7: - if (__IN(f, 0x03f0)) { + if (__IN(f, 0x03a0)) { if (z->class == 7) { - if (__IN(f, 0x70)) { + if (f == 5) { if (z->conval->intval == (-2147483647-1)) { OPB_err(203); } else { @@ -595,9 +595,9 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } break; case 21: - if (__IN(f, 0x01f0)) { + if (__IN(f, 0x01a0)) { if (z->class == 7) { - if (__IN(f, 0x70)) { + if (f == 5) { if (z->conval->intval == (-2147483647-1)) { OPB_err(203); } else { @@ -618,7 +618,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) case 22: if (f == 3) { if (z->class == 7) { - z->conval->intval = __CAP((CHAR)z->conval->intval); + z->conval->intval = (SYSTEM_INT16)__CAP((CHAR)z->conval->intval); z->obj = NIL; } else { z = NewOp__29(op, typ, z); @@ -629,7 +629,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } break; case 23: - if (__IN(f, 0x70)) { + if (f == 5) { if (z->class == 7) { z->conval->intval = OPB_BoolToInt(__ODD(z->conval->intval)); z->obj = NIL; @@ -654,7 +654,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->typ = OPT_linttyp; break; case 25: - if ((__IN(f, 0x70) && z->class == 7)) { + if ((f == 5 && z->class == 7)) { if ((0 <= z->conval->intval && z->conval->intval <= -1)) { z = NewOp__29(op, typ, z); } else { @@ -777,7 +777,7 @@ static INTEGER ConstCmp__14 (void) case 0: res = 9; break; - case 1: case 3: case 4: case 5: case 6: + case 1: case 3: case 4: case 5: if ((*ConstOp__13_s->xval)->intval < (*ConstOp__13_s->yval)->intval) { res = 11; } else if ((*ConstOp__13_s->xval)->intval > (*ConstOp__13_s->yval)->intval) { @@ -864,8 +864,8 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) __GUARDEQP(yval, OPT_ConstDesc) = *xval; } break; - case 4: case 5: case 6: - if (__IN(g, 0x70)) { + case 5: + if (g == 5) { if (x->typ->size <= y->typ->size) { x->typ = y->typ; } else { @@ -884,7 +884,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 7: - if (__IN(g, 0x70)) { + if (g == 5) { y->typ = x->typ; yval->realval = yval->intval; } else if (g == 8) { @@ -896,7 +896,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 8: - if (__IN(g, 0x70)) { + if (g == 5) { y->typ = x->typ; yval->realval = yval->intval; } else if (g == 7) { @@ -940,7 +940,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } switch (op) { case 1: - if (__IN(f, 0x70)) { + if (f == 5) { xv = xval->intval; yv = yval->intval; if (((((xv == 0 || yv == 0) || (((xv > 0 && yv > 0)) && yv <= __DIV(2147483647, xv))) || (((xv > 0 && yv < 0)) && yv >= __DIV((-2147483647-1), xv))) || (((xv < 0 && yv > 0)) && xv >= __DIV((-2147483647-1), yv))) || (((((((xv < 0 && yv < 0)) && xv != (-2147483647-1))) && yv != (-2147483647-1))) && -xv <= __DIV(2147483647, -yv))) { @@ -964,7 +964,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 2: - if (__IN(f, 0x70)) { + if (f == 5) { if (yval->intval != 0) { xval->realval = xval->intval / (REAL)yval->intval; OPB_CheckRealType(7, 205, xval); @@ -988,7 +988,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 3: - if (__IN(f, 0x70)) { + if (f == 5) { if (yval->intval != 0) { xval->intval = __DIV(xval->intval, yval->intval); OPB_SetIntType(x); @@ -1000,7 +1000,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 4: - if (__IN(f, 0x70)) { + if (f == 5) { if (yval->intval != 0) { xval->intval = (int)__MOD(xval->intval, yval->intval); OPB_SetIntType(x); @@ -1019,7 +1019,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 6: - if (__IN(f, 0x70)) { + if (f == 5) { temp = (yval->intval >= 0 && xval->intval <= 2147483647 - yval->intval); if (temp || (yval->intval < 0 && xval->intval >= (-2147483647-1) - yval->intval)) { xval->intval += yval->intval; @@ -1042,7 +1042,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 7: - if (__IN(f, 0x70)) { + if (f == 5) { if ((yval->intval >= 0 && xval->intval >= (-2147483647-1) + yval->intval) || (yval->intval < 0 && xval->intval <= 2147483647 + yval->intval)) { xval->intval -= yval->intval; OPB_SetIntType(x); @@ -1122,8 +1122,8 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) f = (*x)->typ->form; g = typ->form; if ((*x)->class == 7) { - if (__IN(f, 0x70)) { - if (__IN(g, 0x70)) { + if (f == 5) { + if (g == 5) { if (f > g) { OPB_SetIntType(*x); if ((*x)->typ->size > typ->size) { @@ -1154,7 +1154,7 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) } } (*x)->obj = NIL; - } else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((*x)->left->typ->form < f || f > g))) { + } else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((SYSTEM_INT16)(*x)->left->typ->form < f || f > g))) { if ((*x)->left->typ == typ) { *x = (*x)->left; } @@ -1247,17 +1247,17 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPB_err(100); } break; - case 4: case 5: case 6: - if ((__IN(g, 0x70) && y->typ->size < z->typ->size)) { + case 5: + if ((g == 5 && y->typ->size < z->typ->size)) { OPB_Convert(&y, z->typ); - } else if (__IN(g, 0x01f0)) { + } else if (__IN(g, 0x01a0)) { OPB_Convert(&z, y->typ); } else { OPB_err(100); } break; case 7: - if (__IN(g, 0x70)) { + if (g == 5) { OPB_Convert(&y, z->typ); } else if (__IN(g, 0x0180)) { OPB_Convert(&z, y->typ); @@ -1266,7 +1266,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 8: - if (__IN(g, 0x01f0)) { + if (__IN(g, 0x01a0)) { OPB_Convert(&y, z->typ); } else if (__IN(g, 0x0180)) { OPB_Convert(&y, z->typ); @@ -1305,7 +1305,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) switch (op) { case 1: do_ = 1; - if (__IN(f, 0x70)) { + if (f == 5) { if (z->class == 7) { val = z->conval->intval; if (val == 1) { @@ -1345,7 +1345,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 2: - if (__IN(f, 0x70)) { + if (f == 5) { if ((y->class == 7 && y->conval->intval == 0)) { OPB_err(205); } @@ -1364,7 +1364,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) break; case 3: do_ = 1; - if (__IN(f, 0x70)) { + if (f == 5) { if (y->class == 7) { val = y->conval->intval; if (val == 0) { @@ -1387,7 +1387,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 4: - if (__IN(f, 0x70)) { + if (f == 5) { if (y->class == 7) { if (y->conval->intval == 0) { OPB_err(205); @@ -1419,12 +1419,12 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 6: - if (!__IN(f, 0x03f1)) { + if (!__IN(f, 0x03e1)) { OPB_err(105); typ = OPT_undftyp; } do_ = 1; - if (__IN(f, 0x70)) { + if (f == 5) { if ((z->class == 7 && z->conval->intval == 0)) { do_ = 0; z = y; @@ -1438,11 +1438,11 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 7: - if (!__IN(f, 0x03f1)) { + if (!__IN(f, 0x03e1)) { OPB_err(106); typ = OPT_undftyp; } - if ((!__IN(f, 0x70) || y->class != 7) || y->conval->intval != 0) { + if ((f != 5 || y->class != 7) || y->conval->intval != 0) { NewOp__39(op, typ, &z, y); } break; @@ -1498,7 +1498,7 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y) LONGINT k, l; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); - } else if ((__IN((*x)->typ->form, 0x70) && __IN(y->typ->form, 0x70))) { + } else if (((*x)->typ->form == 5 && y->typ->form == 5)) { if ((*x)->class == 7) { k = (*x)->conval->intval; if (0 > k || k > OPM_MaxSet) { @@ -1533,7 +1533,7 @@ void OPB_SetElem (OPT_Node *x) LONGINT k; if ((*x)->class == 8 || (*x)->class == 9) { OPB_err(126); - } else if (!__IN((*x)->typ->form, 0x70)) { + } else if ((*x)->typ->form != 5) { OPB_err(93); } else if ((*x)->class == 7) { k = (*x)->conval->intval; @@ -1583,7 +1583,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) case 0: case 10: break; case 1: - if (!((__IN(g, 0x7a) && y->size == 1))) { + if (!((__IN(g, 0x2a) && y->size == 1))) { OPB_err(113); } break; @@ -1592,18 +1592,18 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPB_err(113); } break; - case 4: case 5: case 6: - if (!__IN(g, 0x70) || x->size < y->size) { + case 5: + if (g != 5 || x->size < y->size) { OPB_err(113); } break; case 7: - if (!__IN(g, 0xf0)) { + if (!__IN(g, 0xe0)) { OPB_err(113); } break; case 8: - if (!__IN(g, 0x01f0)) { + if (!__IN(g, 0x01e0)) { OPB_err(113); } break; @@ -1686,7 +1686,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPM_LogWLn(); break; } - if ((((((ynode->class == 7 && g < f)) && __IN(g, 0xf0))) && __IN(f, 0x01e0))) { + if ((((((ynode->class == 7 && g < f)) && __IN(g, 0xe0))) && __IN(f, 0x01e0))) { OPB_Convert(&ynode, x); } } @@ -1704,7 +1704,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) f = x->typ->form; switch (fctno) { case 0: - if ((__IN(f, 0x70) && x->class == 7)) { + if ((f == 5 && x->class == 7)) { if ((0 <= x->conval->intval && x->conval->intval <= 255)) { OPB_BindNodes(28, OPT_notyp, &x, x); } else { @@ -1777,7 +1777,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) x = OPB_NewIntConst(0); x->typ = OPT_chartyp; break; - case 4: case 5: case 6: + case 5: x = OPB_NewIntConst(OPM_SignedMinimum(x->typ->size)); break; case 9: @@ -1808,7 +1808,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) x = OPB_NewIntConst(255); x->typ = OPT_chartyp; break; - case 4: case 5: case 6: + case 5: x = OPB_NewIntConst(OPM_SignedMaximum(x->typ->size)); break; case 9: @@ -1832,7 +1832,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 9: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x71)) { + } else if (__IN(f, 0x21)) { OPB_Convert(&x, OPT_chartyp); } else { OPB_err(111); @@ -1842,7 +1842,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 10: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { typ = OPT_ShorterOrLongerType(x->typ, -1); if (typ == NIL) { OPB_err(111); @@ -1858,7 +1858,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 11: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { typ = OPT_ShorterOrLongerType(x->typ, 1); if (typ == NIL) { OPB_err(111); @@ -1876,7 +1876,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 13: case 14: if (OPB_NotVar(x)) { OPB_err(112); - } else if (!__IN(f, 0x70)) { + } else if (f != 5) { OPB_err(111); } else if (x->readonly) { OPB_err(76); @@ -1911,7 +1911,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 19: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { if (x->typ->size != OPM_LIntSize) { OPB_Convert(&x, OPT_linttyp); } @@ -1943,22 +1943,22 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 22: case 23: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (!__IN(f, 0x027a)) { + } else if (!__IN(f, 0x022a)) { OPB_err(111); } break; case 24: case 25: case 28: case 31: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((((x->class == 7 && __IN(f, 0x70))) && x->typ->size < OPT_linttyp->size)) { + } else if ((((x->class == 7 && f == 5)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x2070) && x->typ->size == OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x2020) && x->typ->size == OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } break; case 26: case 27: - if ((__IN(f, 0x70) && x->class == 7)) { + if ((f == 5 && x->class == 7)) { if (x->conval->intval < 0 || x->conval->intval > -1) { OPB_err(220); } @@ -2036,7 +2036,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) p->typ = OPT_notyp; } else { if (x->typ != p->typ) { - if ((x->class == 7 && __IN(f, 0x70))) { + if ((x->class == 7 && f == 5)) { OPB_Convert(&x, p->typ); } else { OPB_err(111); @@ -2049,7 +2049,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 15: case 16: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > OPM_MaxSet))) { OPB_err(202); } @@ -2060,10 +2060,10 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) p->typ = OPT_notyp; break; case 17: - if (!__IN(f, 0x70) || x->class != 7) { + if (!(f == 5) || x->class != 7) { OPB_err(69); } else if (x->typ->size == 1) { - L = x->conval->intval; + L = (SYSTEM_INT16)x->conval->intval; typ = p->typ; while ((L > 0 && __IN(typ->comp, 0x0c))) { typ = typ->BaseTyp; @@ -2109,7 +2109,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 19: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { if ((p->class == 7 && x->class == 7)) { if (-OPB_maxExp > x->conval->intval || x->conval->intval > OPB_maxExp) { OPB_err(208); @@ -2137,7 +2137,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (p->typ->comp == 3) { - if (__IN(f, 0x70)) { + if (f == 5) { if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > OPM_MaxIndex))) { OPB_err(63); } @@ -2153,7 +2153,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 22: case 23: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (!__IN(f, 0x70)) { + } else if (f != 5) { OPB_err(111); } else { if (fctno == 22) { @@ -2185,7 +2185,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 28: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { p = NewOp__53(12, 26, p, x); } else { OPB_err(111); @@ -2209,7 +2209,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 30: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { p = NewOp__53(19, 30, p, x); } else { OPB_err(111); @@ -2219,16 +2219,16 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 31: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((((x->class == 7 && __IN(f, 0x70))) && x->typ->size < OPT_linttyp->size)) { + } else if ((((x->class == 7 && f == 5)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x2070) && x->typ->size == OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x2020) && x->typ->size == OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } p->link = x; break; case 32: - if ((__IN(f, 0x70) && x->class == 7)) { + if ((f == 5 && x->class == 7)) { if ((0 <= x->conval->intval && x->conval->intval <= 255)) { OPB_BindNodes(28, OPT_notyp, &x, x); x->conval = OPT_NewConst(); @@ -2271,7 +2271,7 @@ void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n) OPB_err(126); } else if (p->typ->comp != 3) { OPB_err(64); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > OPM_MaxIndex))) { OPB_err(63); } @@ -2287,7 +2287,7 @@ void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n) } else if ((fctno == 31 && n == 2)) { if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { node = OPT_NewNode(19); node->subcl = 31; node->right = p; @@ -2375,7 +2375,7 @@ static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpa ftyp = ftyp->BaseTyp; atyp = atyp->BaseTyp; if ((fvarpar && ftyp == OPT_bytetyp)) { - if (!__IN(f, 0x0c) || !((__IN(atyp->form, 0x7e) && atyp->size == 1))) { + if (!__IN(f, 0x0c) || !((__IN(atyp->form, 0x2e) && atyp->size == 1))) { if (__IN(18, OPM_opt)) { OPB_err(-301); } @@ -2458,7 +2458,7 @@ void OPB_Param (OPT_Node ap, OPT_Object fp) OPB_err(111); } } else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 13)) { - } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x7e) && ap->typ->size == 1)))))) { + } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x2e) && ap->typ->size == 1)))))) { OPB_err(123); } else if ((fp->typ->form == 13 && ap->class == 5)) { OPB_err(123); diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 494d985f..45784a13 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -179,7 +179,7 @@ static INTEGER OPC_PerfectHash (CHAR *s, LONGINT s__len) i = 0; h = 0; while ((s[__X(i, s__len)] != 0x00 && i < 5)) { - h = 3 * h + s[__X(i, s__len)]; + h = 3 * h + (SYSTEM_INT16)s[__X(i, s__len)]; i += 1; } _o_result = (int)__MOD(h, 105); @@ -759,7 +759,7 @@ static void OPC_CProcDefs (OPT_Object obj, INTEGER vis) INTEGER _for__9; if (obj != NIL) { OPC_CProcDefs(obj->left, vis); - if ((((obj->mode == 9 && obj->vis >= vis)) && obj->adr == 1)) { + if ((((obj->mode == 9 && (SYSTEM_INT16)obj->vis >= vis)) && obj->adr == 1)) { ext = obj->conval->ext; i = 1; if (((*ext)[1] != '#' && !(OPC_Prefixed(ext, (CHAR*)"extern ", 8) || OPC_Prefixed(ext, (CHAR*)"import ", 8)))) { @@ -768,7 +768,7 @@ static void OPC_CProcDefs (OPT_Object obj, INTEGER vis) OPC_DeclareParams(obj->link, 1); OPM_Write(0x09); } - _for__9 = (*obj->conval->ext)[0]; + _for__9 = (SYSTEM_INT16)(*obj->conval->ext)[0]; i = i; while (i <= _for__9) { OPM_Write((*obj->conval->ext)[__X(i, 256)]); @@ -1000,7 +1000,7 @@ static void OPC_IdentList (OPT_Object obj, INTEGER vis) first = 1; while ((obj != NIL && obj->mode != 13)) { if ((__IN(vis, 0x05) || (vis == 1 && obj->vis != 0)) || (vis == 3 && !obj->leaf)) { - if (obj->typ != base || obj->vis != lastvis) { + if (obj->typ != base || (SYSTEM_INT16)obj->vis != lastvis) { if (!first) { OPC_EndStat(); } @@ -1154,7 +1154,7 @@ static void OPC_IncludeImports (OPT_Object obj, INTEGER vis) { if (obj != NIL) { OPC_IncludeImports(obj->left, vis); - if ((((obj->mode == 11 && obj->mnolev != 0)) && OPT_GlbMod[__X(-obj->mnolev, 64)]->vis >= vis)) { + if ((((obj->mode == 11 && obj->mnolev != 0)) && (SYSTEM_INT16)OPT_GlbMod[__X(-obj->mnolev, 64)]->vis >= vis)) { OPC_Include(OPT_GlbMod[__X(-obj->mnolev, 64)]->name, 256); } OPC_IncludeImports(obj->right, vis); @@ -1782,7 +1782,7 @@ void OPC_TypeOf (OPT_Object ap) INTEGER i; __ASSERT(ap->typ->comp == 4, 0); if (ap->mode == 2) { - if (ap->mnolev != OPM_level) { + if ((SYSTEM_INT16)ap->mnolev != OPM_level) { OPM_WriteStringVar((void*)ap->scope->name, 256); OPM_WriteString((CHAR*)"_s->", 5); OPC_Ident(ap); @@ -1850,7 +1850,7 @@ static void OPC_StringLiteral (CHAR *s, LONGINT s__len, LONGINT l) OPM_Write('"'); i = 0; while (i < l) { - c = s[__X(i, s__len)]; + c = (SYSTEM_INT16)s[__X(i, s__len)]; if (c < 32 || c > 126) { OPM_Write('\\'); OPM_Write((CHAR)(48 + __ASHR(c, 6))); @@ -1878,7 +1878,7 @@ void OPC_Case (LONGINT caseVal, INTEGER form) case 3: OPC_CharacterLiteral(caseVal); break; - case 4: case 5: case 6: + case 5: OPM_WriteInt(caseVal); break; default: @@ -1976,7 +1976,7 @@ void OPC_Constant (OPT_Const con, INTEGER form) case 3: OPC_CharacterLiteral(con->intval); break; - case 4: case 5: case 6: + case 5: OPM_WriteInt(con->intval); break; case 7: diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index c3bece55..979d9598 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -154,15 +154,15 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) case 'B': if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_IntSize = s[__X(i, s__len)] - 48; + OPM_IntSize = (SYSTEM_INT16)s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_PointerSize = s[__X(i, s__len)] - 48; + OPM_PointerSize = (SYSTEM_INT16)s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_Alignment = s[__X(i, s__len)] - 48; + OPM_Alignment = (SYSTEM_INT16)s[__X(i, s__len)] - 48; } __ASSERT(OPM_IntSize == 2 || OPM_IntSize == 4, 0); __ASSERT(OPM_PointerSize == 4 || OPM_PointerSize == 8, 0); @@ -458,7 +458,7 @@ static void OPM_ShowLine (LONGINT pos) if (pos >= OPM_ErrorLineLimitPos) { pos = OPM_ErrorLineLimitPos - 1; } - i = (pos - OPM_ErrorLineStartPos); + i = (SYSTEM_INT16)(pos - OPM_ErrorLineStartPos); while (i > 0) { OPM_LogW(' '); i -= 1; @@ -532,12 +532,12 @@ void OPM_err (INTEGER n) void OPM_FPrint (LONGINT *fp, LONGINT val) { - *fp = __ROTL((LONGINT)(__VAL(SET, *fp) ^ __VAL(SET, val)), 1, LONGINT); + *fp = __ROTL((LONGINT)((SET)*fp ^ (SET)val), 1, LONGINT); } void OPM_FPrintSet (LONGINT *fp, SET set) { - OPM_FPrint(&*fp, __VAL(LONGINT, set)); + OPM_FPrint(&*fp, (LONGINT)set); } void OPM_FPrintReal (LONGINT *fp, REAL real) @@ -563,13 +563,13 @@ static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONG if (((*S).class == 1 && __STRCMP((*S).s, name) == 0)) { Texts_Scan(&*S, S__typ); if ((*S).class == 3) { - *size = (*S).i; + *size = (SYSTEM_INT16)(*S).i; Texts_Scan(&*S, S__typ); } else { OPM_Mark(-157, -1); } if ((*S).class == 3) { - *align = (*S).i; + *align = (SYSTEM_INT16)(*S).i; Texts_Scan(&*S, S__typ); } else { OPM_Mark(-157, -1); @@ -753,7 +753,7 @@ void OPM_SymWInt (LONGINT i) void OPM_SymWSet (SET s) { - Files_WriteNum(&OPM_newSF, Files_Rider__typ, __VAL(LONGINT, s)); + Files_WriteNum(&OPM_newSF, Files_Rider__typ, (LONGINT)s); } void OPM_SymWReal (REAL r) @@ -819,13 +819,13 @@ void OPM_WriteHex (LONGINT i) { CHAR s[3]; INTEGER digit; - digit = __ASHR(i, 4); + digit = __ASHR((SYSTEM_INT16)i, 4); if (digit < 10) { s[0] = (CHAR)(48 + digit); } else { s[0] = (CHAR)(87 + digit); } - digit = __MASK(i, -16); + digit = __MASK((SYSTEM_INT16)i, -16); if (digit < 10) { s[1] = (CHAR)(48 + digit); } else { diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index f44a2167..b0e235d3 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -58,7 +58,7 @@ static void OPP_err (INTEGER n) static void OPP_CheckSym (INTEGER s) { - if (OPP_sym == s) { + if ((SYSTEM_INT16)OPP_sym == s) { OPS_Get(&OPP_sym); } else { OPM_err(s); @@ -136,7 +136,7 @@ static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_) OPP_err(135); } OPP_ConstExpression(&x); - if (__IN(x->typ->form, 0x70)) { + if (x->typ->form == 5) { sf = x->conval->intval; if (sf < 0 || sf > 1) { OPP_err(220); @@ -146,7 +146,7 @@ static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_) OPP_err(51); sf = 0; } - *sysflag = sf; + *sysflag = (SYSTEM_INT16)sf; OPP_CheckSym(23); } else { *sysflag = default_; @@ -268,7 +268,7 @@ static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) *typ = OPT_NewStr(15, 2); (*typ)->sysflag = sysflag; OPP_ConstExpression(&x); - if (__IN(x->typ->form, 0x70)) { + if (x->typ->form == 5) { n = x->conval->intval; if (n <= 0 || n > OPM_MaxIndex) { OPP_err(63); @@ -625,7 +625,7 @@ static void OPP_StandProcCall (OPT_Node *x) OPT_Node y = NIL; SHORTINT m; INTEGER n; - m = (*x)->obj->adr; + m = (SYSTEM_INT8)((SYSTEM_INT16)(*x)->obj->adr); n = 0; if (OPP_sym == 30) { OPS_Get(&OPP_sym); @@ -1173,24 +1173,24 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, O for (;;) { OPP_ConstExpression(&x); f = x->typ->form; - if (__IN(f, 0x78)) { + if (__IN(f, 0x28)) { xval = x->conval->intval; } else { OPP_err(61); xval = 1; } - if (__IN(f, 0x70)) { - if (!__IN(LabelTyp->form, 0x70) || LabelTyp->size < x->typ->size) { + if (f == 5) { + if (!(LabelTyp->form == 5) || LabelTyp->size < x->typ->size) { OPP_err(60); } - } else if (LabelTyp->form != f) { + } else if ((SYSTEM_INT16)LabelTyp->form != f) { OPP_err(60); } if (OPP_sym == 21) { OPS_Get(&OPP_sym); OPP_ConstExpression(&y); yval = y->conval->intval; - if ((y->typ->form != f && !((__IN(f, 0x70) && __IN(y->typ->form, 0x70))))) { + if (((SYSTEM_INT16)y->typ->form != f && !((f == 5 && y->typ->form == 5)))) { OPP_err(60); } if (yval < xval) { @@ -1253,7 +1253,7 @@ static void CasePart__31 (OPT_Node *x) *StatSeq__30_s->pos = OPM_errpos; if ((*x)->class == 8 || (*x)->class == 9) { OPP_err(126); - } else if (!__IN((*x)->typ->form, 0x78)) { + } else if (!__IN((*x)->typ->form, 0x38)) { OPP_err(125); } OPP_CheckSym(25); @@ -1439,7 +1439,7 @@ static void OPP_StatSeq (OPT_Node *stat) OPS_Get(&OPP_sym); if (OPP_sym == 38) { OPP_qualident(&id); - if (!__IN(id->typ->form, 0x70)) { + if (!(id->typ->form == 5)) { OPP_err(68); } OPP_CheckSym(34); @@ -1471,7 +1471,7 @@ static void OPP_StatSeq (OPT_Node *stat) SetPos__35(z); OPB_Link(&*stat, &last, z); y = OPB_NewLeaf(t); - } else if (!__IN(y->typ->form, 0x70) || y->typ->size > x->left->typ->size) { + } else if (!(y->typ->form == 5) || y->typ->size > x->left->typ->size) { OPP_err(113); } OPB_Link(&*stat, &last, x); diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index 2a093f8e..89c8242e 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -59,7 +59,7 @@ static void OPS_Str (SHORTINT *sym) if (OPS_intval == 2) { *sym = 35; OPS_numtyp = 1; - OPS_intval = OPS_str[0]; + OPS_intval = (SYSTEM_INT16)OPS_str[0]; } else { *sym = 37; } @@ -112,10 +112,10 @@ static INTEGER Ord__7 (CHAR ch, BOOLEAN hex) { INTEGER _o_result; if (ch <= '9') { - _o_result = ch - 48; + _o_result = (SYSTEM_INT16)ch - 48; return _o_result; } else if (hex) { - _o_result = (ch - 65) + 10; + _o_result = ((SYSTEM_INT16)ch - 65) + 10; return _o_result; } else { OPS_err(2); diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index c81989cb..7398b44a 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -173,7 +173,7 @@ OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir) { OPT_Struct _o_result; INTEGER i; - __ASSERT(__IN(x->form, 0x70), 0); + __ASSERT(x->form == 5, 0); __ASSERT(dir == 1 || dir == -1, 0); __ASSERT(x->BaseTyp == OPT_undftyp, 0); i = 0; @@ -414,7 +414,7 @@ static void OPT_FPrintName (LONGINT *fp, CHAR *name, LONGINT name__len) i = 0; do { ch = name[__X(i, name__len)]; - OPM_FPrint(&*fp, ch); + OPM_FPrint(&*fp, (SYSTEM_INT16)ch); i += 1; } while (!(ch == 0x00)); } @@ -649,7 +649,7 @@ void OPT_FPrintObj (OPT_Object obj) f = obj->typ->form; OPM_FPrint(&fprint, f); switch (f) { - case 2: case 3: case 4: case 5: case 6: + case 2: case 3: case 5: OPM_FPrint(&fprint, obj->conval->intval); break; case 9: @@ -680,11 +680,11 @@ void OPT_FPrintObj (OPT_Object obj) } else if (obj->mode == 9) { OPT_FPrintSign(&fprint, obj->typ, obj->link); ext = obj->conval->ext; - m = (*ext)[0]; + m = (SYSTEM_INT16)(*ext)[0]; f = 1; OPM_FPrint(&fprint, m); while (f <= m) { - OPM_FPrint(&fprint, (*ext)[__X(f, 256)]); + OPM_FPrint(&fprint, (SYSTEM_INT16)(*ext)[__X(f, 256)]); f += 1; } } else if (obj->mode == 5) { @@ -848,9 +848,9 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval) switch (f) { case 1: case 3: case 2: OPM_SymRCh(&ch); - conval->intval = ch; + conval->intval = (SYSTEM_INT16)ch; break; - case 4: case 5: case 6: + case 5: conval->intval = OPM_SymRInt(); break; case 9: @@ -979,7 +979,7 @@ static OPT_Object OPT_InTProc (SHORTINT mno) static OPT_Struct OPT_InTyp (LONGINT tag) { OPT_Struct _o_result; - if (__IN(tag, 0x70)) { + if (tag == 5) { _o_result = OPT_IntType(OPM_SymRInt()); return _o_result; } else { @@ -1049,7 +1049,7 @@ static void OPT_InStruct (OPT_Struct *typ) obj->vis = 0; tag = OPM_SymRInt(); if (tag == 35) { - (*typ)->sysflag = OPM_SymRInt(); + (*typ)->sysflag = (SYSTEM_INT16)OPM_SymRInt(); tag = OPM_SymRInt(); } switch (tag) { @@ -1211,7 +1211,7 @@ static OPT_Object OPT_InObj (SHORTINT mno) obj->mode = 9; ext = OPT_NewExt(); obj->conval->ext = ext; - s = OPM_SymRInt(); + s = (SYSTEM_INT16)OPM_SymRInt(); (*ext)[0] = (CHAR)s; i = 1; while (i <= s) { @@ -1439,7 +1439,7 @@ static void OPT_OutStr (OPT_Struct typ) OPT_Object strobj = NIL; if (typ->ref < OPT_expCtxt.ref) { OPM_SymWInt(-typ->ref); - if (__IN(typ->ref, 0x70)) { + if (typ->ref == 5) { OPM_SymWInt(typ->size); } } else { @@ -1537,7 +1537,7 @@ static void OPT_OutConstant (OPT_Object obj) case 2: case 3: OPM_SymWCh((CHAR)obj->conval->intval); break; - case 4: case 5: case 6: + case 5: OPM_SymWInt(obj->conval->intval); OPM_SymWInt(obj->typ->size); break; @@ -1631,7 +1631,7 @@ static void OPT_OutObj (OPT_Object obj) OPM_SymWInt(33); OPT_OutSign(obj->typ, obj->link); ext = obj->conval->ext; - j = (*ext)[0]; + j = (SYSTEM_INT16)(*ext)[0]; i = 1; OPM_SymWInt(j); while (i <= j) { @@ -1876,7 +1876,7 @@ export void *OPT__init(void) OPT_EnterTyp((CHAR*)"INTEGER", 5, OPM_IntSize, &OPT_inttyp); OPT_EnterTyp((CHAR*)"LONGINT", 5, OPM_LIntSize, &OPT_linttyp); OPT_EnterTyp((CHAR*)"LONGREAL", 8, OPM_LRealSize, &OPT_lrltyp); - OPT_EnterTyp((CHAR*)"SHORTINT", 4, OPM_SIntSize, &OPT_sinttyp); + OPT_EnterTyp((CHAR*)"SHORTINT", 5, OPM_SIntSize, &OPT_sinttyp); OPT_EnterBoolConst((CHAR*)"FALSE", 0); OPT_EnterBoolConst((CHAR*)"TRUE", 1); OPT_EnterProc((CHAR*)"HALT", 0); @@ -1904,9 +1904,7 @@ export void *OPT__init(void) OPT_impCtxt.ref[1] = OPT_bytetyp; OPT_impCtxt.ref[2] = OPT_booltyp; OPT_impCtxt.ref[3] = OPT_chartyp; - OPT_impCtxt.ref[4] = OPT_sinttyp; OPT_impCtxt.ref[5] = OPT_inttyp; - OPT_impCtxt.ref[6] = OPT_linttyp; OPT_impCtxt.ref[7] = OPT_realtyp; OPT_impCtxt.ref[8] = OPT_lrltyp; OPT_impCtxt.ref[9] = OPT_settyp; diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index 75adb37c..7538f014 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -118,7 +118,7 @@ void OPV_TypSize (OPT_Struct typ) } typ->size = offset; typ->align = base; - typ->sysflag = __MASK(typ->sysflag, -256) + __ASHL(offset - off0, 8); + typ->sysflag = __MASK(typ->sysflag, -256) + (SYSTEM_INT16)__ASHL(offset - off0, 8); } else if (c == 2) { OPV_TypSize(typ->BaseTyp); typ->size = typ->n * typ->BaseTyp->size; @@ -474,7 +474,7 @@ static void OPV_Entier (OPT_Node n, INTEGER prec) static void OPV_SizeCast (LONGINT from, LONGINT to) { - if ((from != to && (from > 4 || to > 4))) { + if ((from != to && (from > 4 || to != 4))) { switch (to) { case 1: OPM_WriteString((CHAR*)"(SYSTEM_INT8)", 14); @@ -506,7 +506,7 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec) OPM_WriteString((CHAR*)"__SETOF(", 9); OPV_Entier(n, -1); OPM_Write(')'); - } else if (__IN(to, 0x70)) { + } else if (to == 5) { if ((newtype->size < n->typ->size && __IN(2, OPM_opt))) { OPM_WriteString((CHAR*)"__SHORT", 8); if (OPV_SideEffects(n)) { @@ -589,7 +589,7 @@ static void OPV_design (OPT_Node n, INTEGER prec) obj = n->obj; class = n->class; designPrec = OPV_Precedence(class, n->subcl, n->typ->form, comp); - if ((((((class == 0 && obj->mnolev > 0)) && obj->mnolev != OPM_level)) && prec == 10)) { + if ((((((class == 0 && obj->mnolev > 0)) && (SYSTEM_INT16)obj->mnolev != OPM_level)) && prec == 10)) { designPrec = 9; } if (prec > designPrec) { @@ -688,7 +688,7 @@ static void OPV_design (OPT_Node n, INTEGER prec) if (__IN(3, OPM_opt)) { if (typ->comp == 4) { OPM_WriteString((CHAR*)"__GUARDR(", 10); - if (obj->mnolev != OPM_level) { + if ((SYSTEM_INT16)obj->mnolev != OPM_level) { OPM_WriteStringVar((void*)obj->scope->name, 256); OPM_WriteString((CHAR*)"__curr->", 9); OPC_Ident(obj); @@ -797,10 +797,10 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) OPM_WriteString((CHAR*)"(void*)", 8); } } else { - if ((__IN(form, 0x0180) && __IN(n->typ->form, 0x70))) { + if ((__IN(form, 0x0180) && n->typ->form == 5)) { OPM_WriteString((CHAR*)"(double)", 9); prec = 9; - } else if (__IN(form, 0x70)) { + } else if (form == 5) { OPV_SizeCast(n->typ->size, typ->size); } } @@ -811,7 +811,7 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) } if ((((mode == 2 && n->class == 11)) && n->subcl == 29)) { OPV_expr(n->left, prec); - } else if ((__IN(form, 0x70) && n->class == 7)) { + } else if ((form == 5 && n->class == 7)) { OPV_ParIntLiteral(n->conval->intval, n->typ->size); } else { OPV_expr(n, prec); @@ -965,7 +965,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) } break; case 29: - if (!__IN(l->class, 0x17) || (((__IN(n->typ->form, 0x6240) && __IN(l->typ->form, 0x6240))) && n->typ->size == l->typ->size)) { + if (!__IN(l->class, 0x17) || (((__IN(n->typ->form, 0x6220) && __IN(l->typ->form, 0x6220))) && n->typ->size == l->typ->size)) { OPM_Write('('); OPC_Ident(n->typ->strobj); OPM_Write(')'); @@ -1115,7 +1115,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPM_WriteString((CHAR*)" ^ ", 4); } else { OPM_WriteString((CHAR*)" / ", 4); - if (r->obj == NIL || __IN(r->obj->typ->form, 0x70)) { + if (r->obj == NIL || r->obj->typ->form == 5) { OPM_Write('('); OPC_Ident(n->typ->strobj); OPM_Write(')'); diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 6ff2920b..2508f6f7 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -229,7 +229,7 @@ void Platform_Init (INTEGER argc, LONGINT argvadr) Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; Platform_ArgCount = argc; - av = __VAL(Platform_ArgVecPtr, argvadr); + av = (Platform_ArgVecPtr)(SYSTEM_ADRINT)argvadr; Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; Platform_HeapInitHeap(); @@ -262,7 +262,7 @@ void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { - av = __VAL(Platform_ArgVec, Platform_ArgVector); + av = (Platform_ArgVec)(SYSTEM_ADRINT)Platform_ArgVector; __COPY(*(*av)[__X(n, 1024)], val, val__len); } } @@ -278,11 +278,11 @@ void Platform_GetIntArg (INTEGER n, LONGINT *val) i = 1; } k = 0; - d = s[__X(i, 64)] - 48; + d = (SYSTEM_INT16)s[__X(i, 64)] - 48; while ((d >= 0 && d <= 9)) { k = k * 10 + d; i += 1; - d = s[__X(i, 64)] - 48; + d = (SYSTEM_INT16)s[__X(i, 64)] - 48; } if (s[0] == '-') { k = -k; diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index f2a4b1e4..bea1f4aa 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -67,9 +67,9 @@ void Reals_SetExpo (REAL *x, INTEGER ex) { CHAR c; __GET((SYSTEM_ADRINT)x + 3, c, CHAR); - __PUT((SYSTEM_ADRINT)x + 3, (CHAR)(__ASHL(__ASHR(c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __PUT((SYSTEM_ADRINT)x + 3, (CHAR)(__ASHL(__ASHR((SYSTEM_INT16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); __GET((SYSTEM_ADRINT)x + 2, c, CHAR); - __PUT((SYSTEM_ADRINT)x + 2, (CHAR)(__MASK(c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); + __PUT((SYSTEM_ADRINT)x + 2, (CHAR)(__MASK((SYSTEM_INT16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } INTEGER Reals_ExpoL (LONGREAL x) @@ -136,8 +136,8 @@ static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LO l = b__len; while (i < l) { by = __VAL(CHAR, b[__X(i, b__len)]); - d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR(by, 4)); - d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK(by, -16)); + d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((SYSTEM_INT16)by, 4)); + d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((SYSTEM_INT16)by, -16)); i += 1; } } diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index ec6697bf..f1d4f53d 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -112,7 +112,7 @@ void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n, INTEGER len, destLen, i; __DUP(source, source__len, CHAR); len = Strings_Length(source, source__len); - destLen = dest__len - 1; + destLen = (SYSTEM_INT16)dest__len - 1; if (pos < 0) { pos = 0; } diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index 129aa156..bd5d1115 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -746,7 +746,7 @@ static void ReadScaleFactor__32 (void) } } while (('0' <= *Scan__31_s->ch && *Scan__31_s->ch <= '9')) { - *Scan__31_s->e = (*Scan__31_s->e * 10 + *Scan__31_s->ch) - 48; + *Scan__31_s->e = (*Scan__31_s->e * 10 + (SYSTEM_INT16)*Scan__31_s->ch) - 48; Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); } } @@ -818,10 +818,10 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) if ('9' < ch) { if (('A' <= ch && ch <= 'F')) { hex = 1; - ch = (CHAR)(ch - 7); + ch = (CHAR)((SYSTEM_INT16)ch - 7); } else if (('a' <= ch && ch <= 'f')) { hex = 1; - ch = (CHAR)(ch - 39); + ch = (CHAR)((SYSTEM_INT16)ch - 39); } else { break; } @@ -833,13 +833,13 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) if (i - j > 8) { j = i - 8; } - k = d[__X(j, 32)] - 48; + k = (SYSTEM_INT16)d[__X(j, 32)] - 48; j += 1; if ((i - j == 7 && k >= 8)) { k -= 16; } while (j < i) { - k = __ASHL(k, 4) + (d[__X(j, 32)] - 48); + k = __ASHL(k, 4) + ((SYSTEM_INT16)d[__X(j, 32)] - 48); j += 1; } if (neg) { @@ -860,12 +860,12 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) y = (LONGREAL)0; g = (LONGREAL)1; do { - y = y * (LONGREAL)10 + (d[__X(j, 32)] - 48); + y = y * (LONGREAL)10 + ((SYSTEM_INT16)d[__X(j, 32)] - 48); j += 1; } while (!(j == h)); while (j < i) { g = g / (LONGREAL)(LONGREAL)10; - y = (d[__X(j, 32)] - 48) * g + y; + y = ((SYSTEM_INT16)d[__X(j, 32)] - 48) * g + y; j += 1; } ReadScaleFactor__32(); @@ -892,12 +892,12 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) x = (REAL)0; f = (REAL)1; do { - x = x * (REAL)10 + (d[__X(j, 32)] - 48); + x = x * (REAL)10 + ((SYSTEM_INT16)d[__X(j, 32)] - 48); j += 1; } while (!(j == h)); while (j < i) { f = f / (REAL)(REAL)10; - x = (d[__X(j, 32)] - 48) * f + x; + x = ((SYSTEM_INT16)d[__X(j, 32)] - 48) * f + x; j += 1; } if (ch == 'E') { @@ -929,7 +929,7 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) (*S).class = 3; k = 0; do { - k = k * 10 + (d[__X(j, 32)] - 48); + k = k * 10 + ((SYSTEM_INT16)d[__X(j, 32)] - 48); j += 1; } while (!(j == i)); if (neg) { @@ -1319,7 +1319,7 @@ void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER } else { Texts_Write(&*W, W__typ, ' '); } - e = __ASHR((e - 1023) * 77, 8); + e = (SYSTEM_INT16)__ASHR((e - 1023) * 77, 8); if (e >= 0) { x = x / (LONGREAL)Reals_TenL(e); } else { diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 01a8d9ef..5ae22903 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -868,7 +868,7 @@ void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x) LONGINT l; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); l = ((b[0] + __ASHL(b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); - *x = __VAL(SET, l); + *x = (SET)l; } void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x) @@ -959,7 +959,7 @@ void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x) { CHAR b[4]; LONGINT i; - i = __VAL(LONGINT, x); + i = (LONGINT)x; b[0] = (CHAR)i; b[1] = (CHAR)__ASHR(i, 8); b[2] = (CHAR)__ASHR(i, 16); diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index a8a51e7c..a5063871 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -328,11 +328,11 @@ SYSTEM_PTR Heap_NEWBLK (LONGINT size) Heap_Lock(); blksz = __ASHL(__ASHR(size + 63, 5), 5); new = Heap_NEWREC((SYSTEM_ADRINT)&blksz); - tag = (__VAL(LONGINT, new) + blksz) - 24; + tag = ((LONGINT)(SYSTEM_ADRINT)new + blksz) - 24; __PUT(tag - 8, 0, LONGINT); __PUT(tag, blksz, LONGINT); __PUT(tag + 8, -8, LONGINT); - __PUT(__VAL(LONGINT, new) - 8, tag, LONGINT); + __PUT((LONGINT)(SYSTEM_ADRINT)new - 8, tag, LONGINT); Heap_Unlock(); _o_result = new; return _o_result; @@ -361,7 +361,7 @@ static void Heap_Mark (LONGINT q) __GET(tag, offset, LONGINT); fld = q + offset; p = Heap_FetchAddress(fld); - __PUT(fld, __VAL(SYSTEM_PTR, n), SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)n, SYSTEM_PTR); } else { fld = q + offset; n = Heap_FetchAddress(fld); @@ -370,7 +370,7 @@ static void Heap_Mark (LONGINT q) if (!__ODD(tagbits)) { __PUT(n - 8, tagbits + 1, LONGINT); __PUT(q - 8, tag + 1, LONGINT); - __PUT(fld, __VAL(SYSTEM_PTR, p), SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)p, SYSTEM_PTR); p = q; q = n; tag = tagbits; @@ -385,7 +385,7 @@ static void Heap_Mark (LONGINT q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark(__VAL(LONGINT, p)); + Heap_Mark((LONGINT)(SYSTEM_ADRINT)p); } static void Heap_Scan (void) @@ -554,7 +554,7 @@ static void Heap_Finalize (void) } else { prev->next = n->next; } - (*n->finalize)(__VAL(SYSTEM_PTR, n->obj)); + (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); if (prev == NIL) { n = Heap_fin; } else { @@ -573,7 +573,7 @@ void Heap_FINALL (void) while (Heap_fin != NIL) { n = Heap_fin; Heap_fin = Heap_fin->next; - (*n->finalize)(__VAL(SYSTEM_PTR, n->obj)); + (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); } } @@ -700,7 +700,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = __VAL(LONGINT, obj); + f->obj = (LONGINT)(SYSTEM_ADRINT)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index c3322a77..fef28dff 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -341,7 +341,7 @@ void OPB_Index (OPT_Node *x, OPT_Node y) f = y->typ->form; if ((*x)->class >= 7) { OPB_err(79); - } else if (!__IN(f, 0x70) || __IN(y->class, 0x0300)) { + } else if (f != 5 || __IN(y->class, 0x0300)) { OPB_err(80); y->typ = OPT_inttyp; } @@ -466,7 +466,7 @@ void OPB_In (OPT_Node *x, OPT_Node y) f = (*x)->typ->form; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); - } else if ((__IN(f, 0x70) && y->typ->form == 9)) { + } else if ((f == 5 && y->typ->form == 9)) { if ((*x)->class == 7) { k = (*x)->conval->intval; if (k < 0 || k > (SYSTEM_INT64)OPM_MaxSet) { @@ -568,14 +568,14 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } break; case 6: - if (!__IN(f, 0x01f0)) { + if (!__IN(f, 0x01a0)) { OPB_err(96); } break; case 7: - if (__IN(f, 0x03f0)) { + if (__IN(f, 0x03a0)) { if (z->class == 7) { - if (__IN(f, 0x70)) { + if (f == 5) { if (z->conval->intval == (-9223372036854775807-1)) { OPB_err(203); } else { @@ -596,9 +596,9 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } break; case 21: - if (__IN(f, 0x01f0)) { + if (__IN(f, 0x01a0)) { if (z->class == 7) { - if (__IN(f, 0x70)) { + if (f == 5) { if (z->conval->intval == (-9223372036854775807-1)) { OPB_err(203); } else { @@ -630,7 +630,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } break; case 23: - if (__IN(f, 0x70)) { + if (f == 5) { if (z->class == 7) { z->conval->intval = OPB_BoolToInt(__ODD(z->conval->intval)); z->obj = NIL; @@ -655,7 +655,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->typ = OPT_linttyp; break; case 25: - if ((__IN(f, 0x70) && z->class == 7)) { + if ((f == 5 && z->class == 7)) { if ((0 <= z->conval->intval && z->conval->intval <= -1)) { z = NewOp__29(op, typ, z); } else { @@ -778,7 +778,7 @@ static INTEGER ConstCmp__14 (void) case 0: res = 9; break; - case 1: case 3: case 4: case 5: case 6: + case 1: case 3: case 4: case 5: if ((*ConstOp__13_s->xval)->intval < (*ConstOp__13_s->yval)->intval) { res = 11; } else if ((*ConstOp__13_s->xval)->intval > (*ConstOp__13_s->yval)->intval) { @@ -865,8 +865,8 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) __GUARDEQP(yval, OPT_ConstDesc) = *xval; } break; - case 4: case 5: case 6: - if (__IN(g, 0x70)) { + case 5: + if (g == 5) { if (x->typ->size <= y->typ->size) { x->typ = y->typ; } else { @@ -885,7 +885,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 7: - if (__IN(g, 0x70)) { + if (g == 5) { y->typ = x->typ; yval->realval = yval->intval; } else if (g == 8) { @@ -897,7 +897,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 8: - if (__IN(g, 0x70)) { + if (g == 5) { y->typ = x->typ; yval->realval = yval->intval; } else if (g == 7) { @@ -941,7 +941,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } switch (op) { case 1: - if (__IN(f, 0x70)) { + if (f == 5) { xv = xval->intval; yv = yval->intval; if (((((xv == 0 || yv == 0) || (((xv > 0 && yv > 0)) && yv <= __DIV(9223372036854775807, xv))) || (((xv > 0 && yv < 0)) && yv >= __DIV((-9223372036854775807-1), xv))) || (((xv < 0 && yv > 0)) && xv >= __DIV((-9223372036854775807-1), yv))) || (((((((xv < 0 && yv < 0)) && xv != (-9223372036854775807-1))) && yv != (-9223372036854775807-1))) && -xv <= __DIV(9223372036854775807, -yv))) { @@ -965,7 +965,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 2: - if (__IN(f, 0x70)) { + if (f == 5) { if (yval->intval != 0) { xval->realval = xval->intval / (REAL)yval->intval; OPB_CheckRealType(7, 205, xval); @@ -989,7 +989,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 3: - if (__IN(f, 0x70)) { + if (f == 5) { if (yval->intval != 0) { xval->intval = __DIV(xval->intval, yval->intval); OPB_SetIntType(x); @@ -1001,7 +1001,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 4: - if (__IN(f, 0x70)) { + if (f == 5) { if (yval->intval != 0) { xval->intval = __MOD(xval->intval, yval->intval); OPB_SetIntType(x); @@ -1020,7 +1020,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 6: - if (__IN(f, 0x70)) { + if (f == 5) { temp = (yval->intval >= 0 && xval->intval <= 9223372036854775807 - yval->intval); if (temp || (yval->intval < 0 && xval->intval >= (-9223372036854775807-1) - yval->intval)) { xval->intval += yval->intval; @@ -1043,7 +1043,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 7: - if (__IN(f, 0x70)) { + if (f == 5) { if ((yval->intval >= 0 && xval->intval >= (-9223372036854775807-1) + yval->intval) || (yval->intval < 0 && xval->intval <= 9223372036854775807 + yval->intval)) { xval->intval -= yval->intval; OPB_SetIntType(x); @@ -1123,8 +1123,8 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) f = (*x)->typ->form; g = typ->form; if ((*x)->class == 7) { - if (__IN(f, 0x70)) { - if (__IN(g, 0x70)) { + if (f == 5) { + if (g == 5) { if (f > g) { OPB_SetIntType(*x); if ((*x)->typ->size > typ->size) { @@ -1248,17 +1248,17 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPB_err(100); } break; - case 4: case 5: case 6: - if ((__IN(g, 0x70) && y->typ->size < z->typ->size)) { + case 5: + if ((g == 5 && y->typ->size < z->typ->size)) { OPB_Convert(&y, z->typ); - } else if (__IN(g, 0x01f0)) { + } else if (__IN(g, 0x01a0)) { OPB_Convert(&z, y->typ); } else { OPB_err(100); } break; case 7: - if (__IN(g, 0x70)) { + if (g == 5) { OPB_Convert(&y, z->typ); } else if (__IN(g, 0x0180)) { OPB_Convert(&z, y->typ); @@ -1267,7 +1267,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 8: - if (__IN(g, 0x01f0)) { + if (__IN(g, 0x01a0)) { OPB_Convert(&y, z->typ); } else if (__IN(g, 0x0180)) { OPB_Convert(&y, z->typ); @@ -1306,7 +1306,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) switch (op) { case 1: do_ = 1; - if (__IN(f, 0x70)) { + if (f == 5) { if (z->class == 7) { val = z->conval->intval; if (val == 1) { @@ -1346,7 +1346,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 2: - if (__IN(f, 0x70)) { + if (f == 5) { if ((y->class == 7 && y->conval->intval == 0)) { OPB_err(205); } @@ -1365,7 +1365,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) break; case 3: do_ = 1; - if (__IN(f, 0x70)) { + if (f == 5) { if (y->class == 7) { val = y->conval->intval; if (val == 0) { @@ -1388,7 +1388,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 4: - if (__IN(f, 0x70)) { + if (f == 5) { if (y->class == 7) { if (y->conval->intval == 0) { OPB_err(205); @@ -1420,12 +1420,12 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 6: - if (!__IN(f, 0x03f1)) { + if (!__IN(f, 0x03e1)) { OPB_err(105); typ = OPT_undftyp; } do_ = 1; - if (__IN(f, 0x70)) { + if (f == 5) { if ((z->class == 7 && z->conval->intval == 0)) { do_ = 0; z = y; @@ -1439,11 +1439,11 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 7: - if (!__IN(f, 0x03f1)) { + if (!__IN(f, 0x03e1)) { OPB_err(106); typ = OPT_undftyp; } - if ((!__IN(f, 0x70) || y->class != 7) || y->conval->intval != 0) { + if ((f != 5 || y->class != 7) || y->conval->intval != 0) { NewOp__39(op, typ, &z, y); } break; @@ -1499,7 +1499,7 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y) LONGINT k, l; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); - } else if ((__IN((*x)->typ->form, 0x70) && __IN(y->typ->form, 0x70))) { + } else if (((*x)->typ->form == 5 && y->typ->form == 5)) { if ((*x)->class == 7) { k = (*x)->conval->intval; if (0 > k || k > (SYSTEM_INT64)OPM_MaxSet) { @@ -1534,7 +1534,7 @@ void OPB_SetElem (OPT_Node *x) LONGINT k; if ((*x)->class == 8 || (*x)->class == 9) { OPB_err(126); - } else if (!__IN((*x)->typ->form, 0x70)) { + } else if ((*x)->typ->form != 5) { OPB_err(93); } else if ((*x)->class == 7) { k = (*x)->conval->intval; @@ -1584,7 +1584,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) case 0: case 10: break; case 1: - if (!((__IN(g, 0x7a) && y->size == 1))) { + if (!((__IN(g, 0x2a) && y->size == 1))) { OPB_err(113); } break; @@ -1593,18 +1593,18 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPB_err(113); } break; - case 4: case 5: case 6: - if (!__IN(g, 0x70) || x->size < y->size) { + case 5: + if (g != 5 || x->size < y->size) { OPB_err(113); } break; case 7: - if (!__IN(g, 0xf0)) { + if (!__IN(g, 0xe0)) { OPB_err(113); } break; case 8: - if (!__IN(g, 0x01f0)) { + if (!__IN(g, 0x01e0)) { OPB_err(113); } break; @@ -1687,7 +1687,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPM_LogWLn(); break; } - if ((((((ynode->class == 7 && g < f)) && __IN(g, 0xf0))) && __IN(f, 0x01e0))) { + if ((((((ynode->class == 7 && g < f)) && __IN(g, 0xe0))) && __IN(f, 0x01e0))) { OPB_Convert(&ynode, x); } } @@ -1705,7 +1705,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) f = x->typ->form; switch (fctno) { case 0: - if ((__IN(f, 0x70) && x->class == 7)) { + if ((f == 5 && x->class == 7)) { if ((0 <= x->conval->intval && x->conval->intval <= 255)) { OPB_BindNodes(28, OPT_notyp, &x, x); } else { @@ -1778,7 +1778,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) x = OPB_NewIntConst(0); x->typ = OPT_chartyp; break; - case 4: case 5: case 6: + case 5: x = OPB_NewIntConst(OPM_SignedMinimum(x->typ->size)); break; case 9: @@ -1809,7 +1809,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) x = OPB_NewIntConst(255); x->typ = OPT_chartyp; break; - case 4: case 5: case 6: + case 5: x = OPB_NewIntConst(OPM_SignedMaximum(x->typ->size)); break; case 9: @@ -1833,7 +1833,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 9: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x71)) { + } else if (__IN(f, 0x21)) { OPB_Convert(&x, OPT_chartyp); } else { OPB_err(111); @@ -1843,7 +1843,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 10: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { typ = OPT_ShorterOrLongerType(x->typ, -1); if (typ == NIL) { OPB_err(111); @@ -1859,7 +1859,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 11: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { typ = OPT_ShorterOrLongerType(x->typ, 1); if (typ == NIL) { OPB_err(111); @@ -1877,7 +1877,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 13: case 14: if (OPB_NotVar(x)) { OPB_err(112); - } else if (!__IN(f, 0x70)) { + } else if (f != 5) { OPB_err(111); } else if (x->readonly) { OPB_err(76); @@ -1912,7 +1912,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 19: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { if (x->typ->size != (SYSTEM_INT64)OPM_LIntSize) { OPB_Convert(&x, OPT_linttyp); } @@ -1944,22 +1944,22 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 22: case 23: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (!__IN(f, 0x027a)) { + } else if (!__IN(f, 0x022a)) { OPB_err(111); } break; case 24: case 25: case 28: case 31: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((((x->class == 7 && __IN(f, 0x70))) && x->typ->size < OPT_linttyp->size)) { + } else if ((((x->class == 7 && f == 5)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x2070) && x->typ->size == (SYSTEM_INT64)OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x2020) && x->typ->size == (SYSTEM_INT64)OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } break; case 26: case 27: - if ((__IN(f, 0x70) && x->class == 7)) { + if ((f == 5 && x->class == 7)) { if (x->conval->intval < 0 || x->conval->intval > -1) { OPB_err(220); } @@ -2037,7 +2037,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) p->typ = OPT_notyp; } else { if (x->typ != p->typ) { - if ((x->class == 7 && __IN(f, 0x70))) { + if ((x->class == 7 && f == 5)) { OPB_Convert(&x, p->typ); } else { OPB_err(111); @@ -2050,7 +2050,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 15: case 16: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > (SYSTEM_INT64)OPM_MaxSet))) { OPB_err(202); } @@ -2061,7 +2061,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) p->typ = OPT_notyp; break; case 17: - if (!__IN(f, 0x70) || x->class != 7) { + if (!(f == 5) || x->class != 7) { OPB_err(69); } else if (x->typ->size == 1) { L = (SYSTEM_INT32)x->conval->intval; @@ -2110,7 +2110,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 19: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { if ((p->class == 7 && x->class == 7)) { if (-OPB_maxExp > x->conval->intval || x->conval->intval > OPB_maxExp) { OPB_err(208); @@ -2138,7 +2138,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (p->typ->comp == 3) { - if (__IN(f, 0x70)) { + if (f == 5) { if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > OPM_MaxIndex))) { OPB_err(63); } @@ -2154,7 +2154,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 22: case 23: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (!__IN(f, 0x70)) { + } else if (f != 5) { OPB_err(111); } else { if (fctno == 22) { @@ -2186,7 +2186,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 28: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { p = NewOp__53(12, 26, p, x); } else { OPB_err(111); @@ -2210,7 +2210,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 30: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { p = NewOp__53(19, 30, p, x); } else { OPB_err(111); @@ -2220,16 +2220,16 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 31: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((((x->class == 7 && __IN(f, 0x70))) && x->typ->size < OPT_linttyp->size)) { + } else if ((((x->class == 7 && f == 5)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x2070) && x->typ->size == (SYSTEM_INT64)OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x2020) && x->typ->size == (SYSTEM_INT64)OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } p->link = x; break; case 32: - if ((__IN(f, 0x70) && x->class == 7)) { + if ((f == 5 && x->class == 7)) { if ((0 <= x->conval->intval && x->conval->intval <= 255)) { OPB_BindNodes(28, OPT_notyp, &x, x); x->conval = OPT_NewConst(); @@ -2272,7 +2272,7 @@ void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n) OPB_err(126); } else if (p->typ->comp != 3) { OPB_err(64); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > OPM_MaxIndex))) { OPB_err(63); } @@ -2288,7 +2288,7 @@ void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n) } else if ((fctno == 31 && n == 2)) { if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { node = OPT_NewNode(19); node->subcl = 31; node->right = p; @@ -2376,7 +2376,7 @@ static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpa ftyp = ftyp->BaseTyp; atyp = atyp->BaseTyp; if ((fvarpar && ftyp == OPT_bytetyp)) { - if (!__IN(f, 0x0c) || !((__IN(atyp->form, 0x7e) && atyp->size == 1))) { + if (!__IN(f, 0x0c) || !((__IN(atyp->form, 0x2e) && atyp->size == 1))) { if (__IN(18, OPM_opt)) { OPB_err(-301); } @@ -2459,7 +2459,7 @@ void OPB_Param (OPT_Node ap, OPT_Object fp) OPB_err(111); } } else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 13)) { - } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x7e) && ap->typ->size == 1)))))) { + } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x2e) && ap->typ->size == 1)))))) { OPB_err(123); } else if ((fp->typ->form == 13 && ap->class == 5)) { OPB_err(123); diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index 57fdcb05..b8a0608e 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1879,7 +1879,7 @@ void OPC_Case (LONGINT caseVal, INTEGER form) case 3: OPC_CharacterLiteral(caseVal); break; - case 4: case 5: case 6: + case 5: OPM_WriteInt(caseVal); break; default: @@ -1977,7 +1977,7 @@ void OPC_Constant (OPT_Const con, INTEGER form) case 3: OPC_CharacterLiteral(con->intval); break; - case 4: case 5: case 6: + case 5: OPM_WriteInt(con->intval); break; case 7: diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index edc81f01..450ed83d 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -533,12 +533,12 @@ void OPM_err (INTEGER n) void OPM_FPrint (LONGINT *fp, LONGINT val) { - *fp = __ROTL((LONGINT)(__VAL(SET, *fp) ^ __VAL(SET, val)), 1, LONGINT); + *fp = __ROTL((LONGINT)((SET)*fp ^ (SET)val), 1, LONGINT); } void OPM_FPrintSet (LONGINT *fp, SET set) { - OPM_FPrint(&*fp, __VAL(LONGINT, set)); + OPM_FPrint(&*fp, (LONGINT)set); } void OPM_FPrintReal (LONGINT *fp, REAL real) @@ -752,7 +752,7 @@ void OPM_SymWInt (LONGINT i) void OPM_SymWSet (SET s) { - Files_WriteNum(&OPM_newSF, Files_Rider__typ, __VAL(LONGINT, s)); + Files_WriteNum(&OPM_newSF, Files_Rider__typ, (LONGINT)s); } void OPM_SymWReal (REAL r) diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index c525c696..becc2507 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -137,7 +137,7 @@ static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_) OPP_err(135); } OPP_ConstExpression(&x); - if (__IN(x->typ->form, 0x70)) { + if (x->typ->form == 5) { sf = x->conval->intval; if (sf < 0 || sf > 1) { OPP_err(220); @@ -269,7 +269,7 @@ static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) *typ = OPT_NewStr(15, 2); (*typ)->sysflag = sysflag; OPP_ConstExpression(&x); - if (__IN(x->typ->form, 0x70)) { + if (x->typ->form == 5) { n = x->conval->intval; if (n <= 0 || n > OPM_MaxIndex) { OPP_err(63); @@ -626,7 +626,7 @@ static void OPP_StandProcCall (OPT_Node *x) OPT_Node y = NIL; SHORTINT m; INTEGER n; - m = (SYSTEM_INT8)(*x)->obj->adr; + m = (SYSTEM_INT8)((SYSTEM_INT32)(*x)->obj->adr); n = 0; if (OPP_sym == 30) { OPS_Get(&OPP_sym); @@ -1174,14 +1174,14 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, O for (;;) { OPP_ConstExpression(&x); f = x->typ->form; - if (__IN(f, 0x78)) { + if (__IN(f, 0x28)) { xval = x->conval->intval; } else { OPP_err(61); xval = 1; } - if (__IN(f, 0x70)) { - if (!__IN(LabelTyp->form, 0x70) || LabelTyp->size < x->typ->size) { + if (f == 5) { + if (!(LabelTyp->form == 5) || LabelTyp->size < x->typ->size) { OPP_err(60); } } else if (LabelTyp->form != f) { @@ -1191,7 +1191,7 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, O OPS_Get(&OPP_sym); OPP_ConstExpression(&y); yval = y->conval->intval; - if ((y->typ->form != f && !((__IN(f, 0x70) && __IN(y->typ->form, 0x70))))) { + if ((y->typ->form != f && !((f == 5 && y->typ->form == 5)))) { OPP_err(60); } if (yval < xval) { @@ -1254,7 +1254,7 @@ static void CasePart__31 (OPT_Node *x) *StatSeq__30_s->pos = OPM_errpos; if ((*x)->class == 8 || (*x)->class == 9) { OPP_err(126); - } else if (!__IN((*x)->typ->form, 0x78)) { + } else if (!__IN((*x)->typ->form, 0x38)) { OPP_err(125); } OPP_CheckSym(25); @@ -1440,7 +1440,7 @@ static void OPP_StatSeq (OPT_Node *stat) OPS_Get(&OPP_sym); if (OPP_sym == 38) { OPP_qualident(&id); - if (!__IN(id->typ->form, 0x70)) { + if (!(id->typ->form == 5)) { OPP_err(68); } OPP_CheckSym(34); @@ -1472,7 +1472,7 @@ static void OPP_StatSeq (OPT_Node *stat) SetPos__35(z); OPB_Link(&*stat, &last, z); y = OPB_NewLeaf(t); - } else if (!__IN(y->typ->form, 0x70) || y->typ->size > x->left->typ->size) { + } else if (!(y->typ->form == 5) || y->typ->size > x->left->typ->size) { OPP_err(113); } OPB_Link(&*stat, &last, x); diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index 5861f882..f8762935 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -174,7 +174,7 @@ OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir) { OPT_Struct _o_result; INTEGER i; - __ASSERT(__IN(x->form, 0x70), 0); + __ASSERT(x->form == 5, 0); __ASSERT(dir == 1 || dir == -1, 0); __ASSERT(x->BaseTyp == OPT_undftyp, 0); i = 0; @@ -650,7 +650,7 @@ void OPT_FPrintObj (OPT_Object obj) f = obj->typ->form; OPM_FPrint(&fprint, f); switch (f) { - case 2: case 3: case 4: case 5: case 6: + case 2: case 3: case 5: OPM_FPrint(&fprint, obj->conval->intval); break; case 9: @@ -851,7 +851,7 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval) OPM_SymRCh(&ch); conval->intval = ch; break; - case 4: case 5: case 6: + case 5: conval->intval = OPM_SymRInt(); break; case 9: @@ -980,7 +980,7 @@ static OPT_Object OPT_InTProc (SHORTINT mno) static OPT_Struct OPT_InTyp (LONGINT tag) { OPT_Struct _o_result; - if (__IN(tag, 0x70)) { + if (tag == 5) { _o_result = OPT_IntType(OPM_SymRInt()); return _o_result; } else { @@ -1440,7 +1440,7 @@ static void OPT_OutStr (OPT_Struct typ) OPT_Object strobj = NIL; if (typ->ref < OPT_expCtxt.ref) { OPM_SymWInt(-typ->ref); - if (__IN(typ->ref, 0x70)) { + if (typ->ref == 5) { OPM_SymWInt(typ->size); } } else { @@ -1538,7 +1538,7 @@ static void OPT_OutConstant (OPT_Object obj) case 2: case 3: OPM_SymWCh((CHAR)obj->conval->intval); break; - case 4: case 5: case 6: + case 5: OPM_SymWInt(obj->conval->intval); OPM_SymWInt(obj->typ->size); break; @@ -1877,7 +1877,7 @@ export void *OPT__init(void) OPT_EnterTyp((CHAR*)"INTEGER", 5, OPM_IntSize, &OPT_inttyp); OPT_EnterTyp((CHAR*)"LONGINT", 5, OPM_LIntSize, &OPT_linttyp); OPT_EnterTyp((CHAR*)"LONGREAL", 8, OPM_LRealSize, &OPT_lrltyp); - OPT_EnterTyp((CHAR*)"SHORTINT", 4, OPM_SIntSize, &OPT_sinttyp); + OPT_EnterTyp((CHAR*)"SHORTINT", 5, OPM_SIntSize, &OPT_sinttyp); OPT_EnterBoolConst((CHAR*)"FALSE", 0); OPT_EnterBoolConst((CHAR*)"TRUE", 1); OPT_EnterProc((CHAR*)"HALT", 0); @@ -1905,9 +1905,7 @@ export void *OPT__init(void) OPT_impCtxt.ref[1] = OPT_bytetyp; OPT_impCtxt.ref[2] = OPT_booltyp; OPT_impCtxt.ref[3] = OPT_chartyp; - OPT_impCtxt.ref[4] = OPT_sinttyp; OPT_impCtxt.ref[5] = OPT_inttyp; - OPT_impCtxt.ref[6] = OPT_linttyp; OPT_impCtxt.ref[7] = OPT_realtyp; OPT_impCtxt.ref[8] = OPT_lrltyp; OPT_impCtxt.ref[9] = OPT_settyp; diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 49956ac6..b5cebda5 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -475,7 +475,7 @@ static void OPV_Entier (OPT_Node n, INTEGER prec) static void OPV_SizeCast (LONGINT from, LONGINT to) { - if ((from != to && (from > 4 || to > 4))) { + if ((from != to && (from > 4 || to != 4))) { switch (to) { case 1: OPM_WriteString((CHAR*)"(SYSTEM_INT8)", 14); @@ -507,7 +507,7 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec) OPM_WriteString((CHAR*)"__SETOF(", 9); OPV_Entier(n, -1); OPM_Write(')'); - } else if (__IN(to, 0x70)) { + } else if (to == 5) { if ((newtype->size < n->typ->size && __IN(2, OPM_opt))) { OPM_WriteString((CHAR*)"__SHORT", 8); if (OPV_SideEffects(n)) { @@ -798,10 +798,10 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) OPM_WriteString((CHAR*)"(void*)", 8); } } else { - if ((__IN(form, 0x0180) && __IN(n->typ->form, 0x70))) { + if ((__IN(form, 0x0180) && n->typ->form == 5)) { OPM_WriteString((CHAR*)"(double)", 9); prec = 9; - } else if (__IN(form, 0x70)) { + } else if (form == 5) { OPV_SizeCast(n->typ->size, typ->size); } } @@ -812,7 +812,7 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) } if ((((mode == 2 && n->class == 11)) && n->subcl == 29)) { OPV_expr(n->left, prec); - } else if ((__IN(form, 0x70) && n->class == 7)) { + } else if ((form == 5 && n->class == 7)) { OPV_ParIntLiteral(n->conval->intval, n->typ->size); } else { OPV_expr(n, prec); @@ -966,7 +966,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) } break; case 29: - if (!__IN(l->class, 0x17) || (((__IN(n->typ->form, 0x6240) && __IN(l->typ->form, 0x6240))) && n->typ->size == l->typ->size)) { + if (!__IN(l->class, 0x17) || (((__IN(n->typ->form, 0x6220) && __IN(l->typ->form, 0x6220))) && n->typ->size == l->typ->size)) { OPM_Write('('); OPC_Ident(n->typ->strobj); OPM_Write(')'); @@ -1116,7 +1116,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPM_WriteString((CHAR*)" ^ ", 4); } else { OPM_WriteString((CHAR*)" / ", 4); - if (r->obj == NIL || __IN(r->obj->typ->form, 0x70)) { + if (r->obj == NIL || r->obj->typ->form == 5) { OPM_Write('('); OPC_Ident(n->typ->strobj); OPM_Write(')'); diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 6e34dddd..9801d5f9 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -230,7 +230,7 @@ void Platform_Init (INTEGER argc, LONGINT argvadr) Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; Platform_ArgCount = argc; - av = __VAL(Platform_ArgVecPtr, argvadr); + av = (Platform_ArgVecPtr)(SYSTEM_ADRINT)argvadr; Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; Platform_HeapInitHeap(); @@ -263,7 +263,7 @@ void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { - av = __VAL(Platform_ArgVec, Platform_ArgVector); + av = (Platform_ArgVec)(SYSTEM_ADRINT)Platform_ArgVector; __COPY(*(*av)[__X(n, 1024)], val, val__len); } } diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index a0e79aca..08d1739f 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -851,14 +851,14 @@ void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, INTEGER *x) { CHAR b[2]; Files_ReadBytes(&*R, R__typ, (void*)b, 2, 2); - *x = b[0] + __ASHL(b[1], 8); + *x = (SYSTEM_INT16)b[0] + __ASHL((SYSTEM_INT16)b[1], 8); } void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, LONGINT *x) { CHAR b[4]; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); - *x = ((b[0] + __ASHL(b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); + *x = (((SYSTEM_INT16)b[0] + __ASHL((SYSTEM_INT16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); } void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x) @@ -866,8 +866,8 @@ void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x) CHAR b[4]; LONGINT l; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); - l = ((b[0] + __ASHL(b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); - *x = __VAL(SET, l); + l = (((SYSTEM_INT16)b[0] + __ASHL((SYSTEM_INT16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); + *x = (SET)l; } void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x) @@ -922,12 +922,12 @@ void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, LONGINT *x) s = 0; n = 0; Files_Read(&*R, R__typ, (void*)&ch); - while (ch >= 128) { - n += __ASH((ch - 128), s); + while ((SYSTEM_INT16)ch >= 128) { + n += __ASH(((SYSTEM_INT16)ch - 128), s); s += 7; Files_Read(&*R, R__typ, (void*)&ch); } - n += __ASH((__MASK(ch, -64) - __ASHL(__ASHR(ch, 6), 6)), s); + n += __ASH((__MASK((SYSTEM_INT16)ch, -64) - __ASHL(__ASHR((SYSTEM_INT16)ch, 6), 6)), s); *x = n; } @@ -958,7 +958,7 @@ void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x) { CHAR b[4]; LONGINT i; - i = __VAL(LONGINT, x); + i = (LONGINT)x; b[0] = (CHAR)i; b[1] = (CHAR)__ASHR(i, 8); b[2] = (CHAR)__ASHR(i, 16); diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index e42a752c..f35765c6 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -327,11 +327,11 @@ SYSTEM_PTR Heap_NEWBLK (LONGINT size) Heap_Lock(); blksz = __ASHL(__ASHR(size + 31, 4), 4); new = Heap_NEWREC((SYSTEM_ADRINT)&blksz); - tag = (__VAL(LONGINT, new) + blksz) - 12; + tag = ((LONGINT)(SYSTEM_ADRINT)new + blksz) - 12; __PUT(tag - 4, 0, LONGINT); __PUT(tag, blksz, LONGINT); __PUT(tag + 4, -4, LONGINT); - __PUT(__VAL(LONGINT, new) - 4, tag, LONGINT); + __PUT((LONGINT)(SYSTEM_ADRINT)new - 4, tag, LONGINT); Heap_Unlock(); _o_result = new; return _o_result; @@ -360,7 +360,7 @@ static void Heap_Mark (LONGINT q) __GET(tag, offset, LONGINT); fld = q + offset; p = Heap_FetchAddress(fld); - __PUT(fld, __VAL(SYSTEM_PTR, n), SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)n, SYSTEM_PTR); } else { fld = q + offset; n = Heap_FetchAddress(fld); @@ -369,7 +369,7 @@ static void Heap_Mark (LONGINT q) if (!__ODD(tagbits)) { __PUT(n - 4, tagbits + 1, LONGINT); __PUT(q - 4, tag + 1, LONGINT); - __PUT(fld, __VAL(SYSTEM_PTR, p), SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)p, SYSTEM_PTR); p = q; q = n; tag = tagbits; @@ -384,7 +384,7 @@ static void Heap_Mark (LONGINT q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark(__VAL(LONGINT, p)); + Heap_Mark((LONGINT)(SYSTEM_ADRINT)p); } static void Heap_Scan (void) @@ -553,7 +553,7 @@ static void Heap_Finalize (void) } else { prev->next = n->next; } - (*n->finalize)(__VAL(SYSTEM_PTR, n->obj)); + (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); if (prev == NIL) { n = Heap_fin; } else { @@ -572,7 +572,7 @@ void Heap_FINALL (void) while (Heap_fin != NIL) { n = Heap_fin; Heap_fin = Heap_fin->next; - (*n->finalize)(__VAL(SYSTEM_PTR, n->obj)); + (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); } } @@ -699,7 +699,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = __VAL(LONGINT, obj); + f->obj = (LONGINT)(SYSTEM_ADRINT)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index 73416071..e6e966a6 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -340,7 +340,7 @@ void OPB_Index (OPT_Node *x, OPT_Node y) f = y->typ->form; if ((*x)->class >= 7) { OPB_err(79); - } else if (!__IN(f, 0x70) || __IN(y->class, 0x0300)) { + } else if (f != 5 || __IN(y->class, 0x0300)) { OPB_err(80); y->typ = OPT_inttyp; } @@ -465,7 +465,7 @@ void OPB_In (OPT_Node *x, OPT_Node y) f = (*x)->typ->form; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); - } else if ((__IN(f, 0x70) && y->typ->form == 9)) { + } else if ((f == 5 && y->typ->form == 9)) { if ((*x)->class == 7) { k = (*x)->conval->intval; if (k < 0 || k > OPM_MaxSet) { @@ -567,14 +567,14 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } break; case 6: - if (!__IN(f, 0x01f0)) { + if (!__IN(f, 0x01a0)) { OPB_err(96); } break; case 7: - if (__IN(f, 0x03f0)) { + if (__IN(f, 0x03a0)) { if (z->class == 7) { - if (__IN(f, 0x70)) { + if (f == 5) { if (z->conval->intval == (-2147483647-1)) { OPB_err(203); } else { @@ -595,9 +595,9 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } break; case 21: - if (__IN(f, 0x01f0)) { + if (__IN(f, 0x01a0)) { if (z->class == 7) { - if (__IN(f, 0x70)) { + if (f == 5) { if (z->conval->intval == (-2147483647-1)) { OPB_err(203); } else { @@ -618,7 +618,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) case 22: if (f == 3) { if (z->class == 7) { - z->conval->intval = __CAP((CHAR)z->conval->intval); + z->conval->intval = (SYSTEM_INT16)__CAP((CHAR)z->conval->intval); z->obj = NIL; } else { z = NewOp__29(op, typ, z); @@ -629,7 +629,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } break; case 23: - if (__IN(f, 0x70)) { + if (f == 5) { if (z->class == 7) { z->conval->intval = OPB_BoolToInt(__ODD(z->conval->intval)); z->obj = NIL; @@ -654,7 +654,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->typ = OPT_linttyp; break; case 25: - if ((__IN(f, 0x70) && z->class == 7)) { + if ((f == 5 && z->class == 7)) { if ((0 <= z->conval->intval && z->conval->intval <= -1)) { z = NewOp__29(op, typ, z); } else { @@ -777,7 +777,7 @@ static INTEGER ConstCmp__14 (void) case 0: res = 9; break; - case 1: case 3: case 4: case 5: case 6: + case 1: case 3: case 4: case 5: if ((*ConstOp__13_s->xval)->intval < (*ConstOp__13_s->yval)->intval) { res = 11; } else if ((*ConstOp__13_s->xval)->intval > (*ConstOp__13_s->yval)->intval) { @@ -864,8 +864,8 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) __GUARDEQP(yval, OPT_ConstDesc) = *xval; } break; - case 4: case 5: case 6: - if (__IN(g, 0x70)) { + case 5: + if (g == 5) { if (x->typ->size <= y->typ->size) { x->typ = y->typ; } else { @@ -884,7 +884,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 7: - if (__IN(g, 0x70)) { + if (g == 5) { y->typ = x->typ; yval->realval = yval->intval; } else if (g == 8) { @@ -896,7 +896,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 8: - if (__IN(g, 0x70)) { + if (g == 5) { y->typ = x->typ; yval->realval = yval->intval; } else if (g == 7) { @@ -940,7 +940,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } switch (op) { case 1: - if (__IN(f, 0x70)) { + if (f == 5) { xv = xval->intval; yv = yval->intval; if (((((xv == 0 || yv == 0) || (((xv > 0 && yv > 0)) && yv <= __DIV(2147483647, xv))) || (((xv > 0 && yv < 0)) && yv >= __DIV((-2147483647-1), xv))) || (((xv < 0 && yv > 0)) && xv >= __DIV((-2147483647-1), yv))) || (((((((xv < 0 && yv < 0)) && xv != (-2147483647-1))) && yv != (-2147483647-1))) && -xv <= __DIV(2147483647, -yv))) { @@ -964,7 +964,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 2: - if (__IN(f, 0x70)) { + if (f == 5) { if (yval->intval != 0) { xval->realval = xval->intval / (REAL)yval->intval; OPB_CheckRealType(7, 205, xval); @@ -988,7 +988,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 3: - if (__IN(f, 0x70)) { + if (f == 5) { if (yval->intval != 0) { xval->intval = __DIV(xval->intval, yval->intval); OPB_SetIntType(x); @@ -1000,7 +1000,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 4: - if (__IN(f, 0x70)) { + if (f == 5) { if (yval->intval != 0) { xval->intval = (int)__MOD(xval->intval, yval->intval); OPB_SetIntType(x); @@ -1019,7 +1019,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 6: - if (__IN(f, 0x70)) { + if (f == 5) { temp = (yval->intval >= 0 && xval->intval <= 2147483647 - yval->intval); if (temp || (yval->intval < 0 && xval->intval >= (-2147483647-1) - yval->intval)) { xval->intval += yval->intval; @@ -1042,7 +1042,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 7: - if (__IN(f, 0x70)) { + if (f == 5) { if ((yval->intval >= 0 && xval->intval >= (-2147483647-1) + yval->intval) || (yval->intval < 0 && xval->intval <= 2147483647 + yval->intval)) { xval->intval -= yval->intval; OPB_SetIntType(x); @@ -1122,8 +1122,8 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) f = (*x)->typ->form; g = typ->form; if ((*x)->class == 7) { - if (__IN(f, 0x70)) { - if (__IN(g, 0x70)) { + if (f == 5) { + if (g == 5) { if (f > g) { OPB_SetIntType(*x); if ((*x)->typ->size > typ->size) { @@ -1154,7 +1154,7 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) } } (*x)->obj = NIL; - } else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((*x)->left->typ->form < f || f > g))) { + } else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((SYSTEM_INT16)(*x)->left->typ->form < f || f > g))) { if ((*x)->left->typ == typ) { *x = (*x)->left; } @@ -1247,17 +1247,17 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPB_err(100); } break; - case 4: case 5: case 6: - if ((__IN(g, 0x70) && y->typ->size < z->typ->size)) { + case 5: + if ((g == 5 && y->typ->size < z->typ->size)) { OPB_Convert(&y, z->typ); - } else if (__IN(g, 0x01f0)) { + } else if (__IN(g, 0x01a0)) { OPB_Convert(&z, y->typ); } else { OPB_err(100); } break; case 7: - if (__IN(g, 0x70)) { + if (g == 5) { OPB_Convert(&y, z->typ); } else if (__IN(g, 0x0180)) { OPB_Convert(&z, y->typ); @@ -1266,7 +1266,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 8: - if (__IN(g, 0x01f0)) { + if (__IN(g, 0x01a0)) { OPB_Convert(&y, z->typ); } else if (__IN(g, 0x0180)) { OPB_Convert(&y, z->typ); @@ -1305,7 +1305,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) switch (op) { case 1: do_ = 1; - if (__IN(f, 0x70)) { + if (f == 5) { if (z->class == 7) { val = z->conval->intval; if (val == 1) { @@ -1345,7 +1345,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 2: - if (__IN(f, 0x70)) { + if (f == 5) { if ((y->class == 7 && y->conval->intval == 0)) { OPB_err(205); } @@ -1364,7 +1364,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) break; case 3: do_ = 1; - if (__IN(f, 0x70)) { + if (f == 5) { if (y->class == 7) { val = y->conval->intval; if (val == 0) { @@ -1387,7 +1387,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 4: - if (__IN(f, 0x70)) { + if (f == 5) { if (y->class == 7) { if (y->conval->intval == 0) { OPB_err(205); @@ -1419,12 +1419,12 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 6: - if (!__IN(f, 0x03f1)) { + if (!__IN(f, 0x03e1)) { OPB_err(105); typ = OPT_undftyp; } do_ = 1; - if (__IN(f, 0x70)) { + if (f == 5) { if ((z->class == 7 && z->conval->intval == 0)) { do_ = 0; z = y; @@ -1438,11 +1438,11 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 7: - if (!__IN(f, 0x03f1)) { + if (!__IN(f, 0x03e1)) { OPB_err(106); typ = OPT_undftyp; } - if ((!__IN(f, 0x70) || y->class != 7) || y->conval->intval != 0) { + if ((f != 5 || y->class != 7) || y->conval->intval != 0) { NewOp__39(op, typ, &z, y); } break; @@ -1498,7 +1498,7 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y) LONGINT k, l; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); - } else if ((__IN((*x)->typ->form, 0x70) && __IN(y->typ->form, 0x70))) { + } else if (((*x)->typ->form == 5 && y->typ->form == 5)) { if ((*x)->class == 7) { k = (*x)->conval->intval; if (0 > k || k > OPM_MaxSet) { @@ -1533,7 +1533,7 @@ void OPB_SetElem (OPT_Node *x) LONGINT k; if ((*x)->class == 8 || (*x)->class == 9) { OPB_err(126); - } else if (!__IN((*x)->typ->form, 0x70)) { + } else if ((*x)->typ->form != 5) { OPB_err(93); } else if ((*x)->class == 7) { k = (*x)->conval->intval; @@ -1583,7 +1583,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) case 0: case 10: break; case 1: - if (!((__IN(g, 0x7a) && y->size == 1))) { + if (!((__IN(g, 0x2a) && y->size == 1))) { OPB_err(113); } break; @@ -1592,18 +1592,18 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPB_err(113); } break; - case 4: case 5: case 6: - if (!__IN(g, 0x70) || x->size < y->size) { + case 5: + if (g != 5 || x->size < y->size) { OPB_err(113); } break; case 7: - if (!__IN(g, 0xf0)) { + if (!__IN(g, 0xe0)) { OPB_err(113); } break; case 8: - if (!__IN(g, 0x01f0)) { + if (!__IN(g, 0x01e0)) { OPB_err(113); } break; @@ -1686,7 +1686,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPM_LogWLn(); break; } - if ((((((ynode->class == 7 && g < f)) && __IN(g, 0xf0))) && __IN(f, 0x01e0))) { + if ((((((ynode->class == 7 && g < f)) && __IN(g, 0xe0))) && __IN(f, 0x01e0))) { OPB_Convert(&ynode, x); } } @@ -1704,7 +1704,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) f = x->typ->form; switch (fctno) { case 0: - if ((__IN(f, 0x70) && x->class == 7)) { + if ((f == 5 && x->class == 7)) { if ((0 <= x->conval->intval && x->conval->intval <= 255)) { OPB_BindNodes(28, OPT_notyp, &x, x); } else { @@ -1777,7 +1777,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) x = OPB_NewIntConst(0); x->typ = OPT_chartyp; break; - case 4: case 5: case 6: + case 5: x = OPB_NewIntConst(OPM_SignedMinimum(x->typ->size)); break; case 9: @@ -1808,7 +1808,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) x = OPB_NewIntConst(255); x->typ = OPT_chartyp; break; - case 4: case 5: case 6: + case 5: x = OPB_NewIntConst(OPM_SignedMaximum(x->typ->size)); break; case 9: @@ -1832,7 +1832,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 9: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x71)) { + } else if (__IN(f, 0x21)) { OPB_Convert(&x, OPT_chartyp); } else { OPB_err(111); @@ -1842,7 +1842,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 10: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { typ = OPT_ShorterOrLongerType(x->typ, -1); if (typ == NIL) { OPB_err(111); @@ -1858,7 +1858,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 11: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { typ = OPT_ShorterOrLongerType(x->typ, 1); if (typ == NIL) { OPB_err(111); @@ -1876,7 +1876,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 13: case 14: if (OPB_NotVar(x)) { OPB_err(112); - } else if (!__IN(f, 0x70)) { + } else if (f != 5) { OPB_err(111); } else if (x->readonly) { OPB_err(76); @@ -1911,7 +1911,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 19: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { if (x->typ->size != OPM_LIntSize) { OPB_Convert(&x, OPT_linttyp); } @@ -1943,22 +1943,22 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 22: case 23: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (!__IN(f, 0x027a)) { + } else if (!__IN(f, 0x022a)) { OPB_err(111); } break; case 24: case 25: case 28: case 31: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((((x->class == 7 && __IN(f, 0x70))) && x->typ->size < OPT_linttyp->size)) { + } else if ((((x->class == 7 && f == 5)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x2070) && x->typ->size == OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x2020) && x->typ->size == OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } break; case 26: case 27: - if ((__IN(f, 0x70) && x->class == 7)) { + if ((f == 5 && x->class == 7)) { if (x->conval->intval < 0 || x->conval->intval > -1) { OPB_err(220); } @@ -2036,7 +2036,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) p->typ = OPT_notyp; } else { if (x->typ != p->typ) { - if ((x->class == 7 && __IN(f, 0x70))) { + if ((x->class == 7 && f == 5)) { OPB_Convert(&x, p->typ); } else { OPB_err(111); @@ -2049,7 +2049,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 15: case 16: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > OPM_MaxSet))) { OPB_err(202); } @@ -2060,10 +2060,10 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) p->typ = OPT_notyp; break; case 17: - if (!__IN(f, 0x70) || x->class != 7) { + if (!(f == 5) || x->class != 7) { OPB_err(69); } else if (x->typ->size == 1) { - L = x->conval->intval; + L = (SYSTEM_INT16)x->conval->intval; typ = p->typ; while ((L > 0 && __IN(typ->comp, 0x0c))) { typ = typ->BaseTyp; @@ -2109,7 +2109,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 19: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { if ((p->class == 7 && x->class == 7)) { if (-OPB_maxExp > x->conval->intval || x->conval->intval > OPB_maxExp) { OPB_err(208); @@ -2137,7 +2137,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (p->typ->comp == 3) { - if (__IN(f, 0x70)) { + if (f == 5) { if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > OPM_MaxIndex))) { OPB_err(63); } @@ -2153,7 +2153,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 22: case 23: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (!__IN(f, 0x70)) { + } else if (f != 5) { OPB_err(111); } else { if (fctno == 22) { @@ -2185,7 +2185,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 28: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { p = NewOp__53(12, 26, p, x); } else { OPB_err(111); @@ -2209,7 +2209,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 30: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { p = NewOp__53(19, 30, p, x); } else { OPB_err(111); @@ -2219,16 +2219,16 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 31: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((((x->class == 7 && __IN(f, 0x70))) && x->typ->size < OPT_linttyp->size)) { + } else if ((((x->class == 7 && f == 5)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x2070) && x->typ->size == OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x2020) && x->typ->size == OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } p->link = x; break; case 32: - if ((__IN(f, 0x70) && x->class == 7)) { + if ((f == 5 && x->class == 7)) { if ((0 <= x->conval->intval && x->conval->intval <= 255)) { OPB_BindNodes(28, OPT_notyp, &x, x); x->conval = OPT_NewConst(); @@ -2271,7 +2271,7 @@ void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n) OPB_err(126); } else if (p->typ->comp != 3) { OPB_err(64); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > OPM_MaxIndex))) { OPB_err(63); } @@ -2287,7 +2287,7 @@ void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n) } else if ((fctno == 31 && n == 2)) { if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { node = OPT_NewNode(19); node->subcl = 31; node->right = p; @@ -2375,7 +2375,7 @@ static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpa ftyp = ftyp->BaseTyp; atyp = atyp->BaseTyp; if ((fvarpar && ftyp == OPT_bytetyp)) { - if (!__IN(f, 0x0c) || !((__IN(atyp->form, 0x7e) && atyp->size == 1))) { + if (!__IN(f, 0x0c) || !((__IN(atyp->form, 0x2e) && atyp->size == 1))) { if (__IN(18, OPM_opt)) { OPB_err(-301); } @@ -2458,7 +2458,7 @@ void OPB_Param (OPT_Node ap, OPT_Object fp) OPB_err(111); } } else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 13)) { - } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x7e) && ap->typ->size == 1)))))) { + } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x2e) && ap->typ->size == 1)))))) { OPB_err(123); } else if ((fp->typ->form == 13 && ap->class == 5)) { OPB_err(123); diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 494d985f..45784a13 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -179,7 +179,7 @@ static INTEGER OPC_PerfectHash (CHAR *s, LONGINT s__len) i = 0; h = 0; while ((s[__X(i, s__len)] != 0x00 && i < 5)) { - h = 3 * h + s[__X(i, s__len)]; + h = 3 * h + (SYSTEM_INT16)s[__X(i, s__len)]; i += 1; } _o_result = (int)__MOD(h, 105); @@ -759,7 +759,7 @@ static void OPC_CProcDefs (OPT_Object obj, INTEGER vis) INTEGER _for__9; if (obj != NIL) { OPC_CProcDefs(obj->left, vis); - if ((((obj->mode == 9 && obj->vis >= vis)) && obj->adr == 1)) { + if ((((obj->mode == 9 && (SYSTEM_INT16)obj->vis >= vis)) && obj->adr == 1)) { ext = obj->conval->ext; i = 1; if (((*ext)[1] != '#' && !(OPC_Prefixed(ext, (CHAR*)"extern ", 8) || OPC_Prefixed(ext, (CHAR*)"import ", 8)))) { @@ -768,7 +768,7 @@ static void OPC_CProcDefs (OPT_Object obj, INTEGER vis) OPC_DeclareParams(obj->link, 1); OPM_Write(0x09); } - _for__9 = (*obj->conval->ext)[0]; + _for__9 = (SYSTEM_INT16)(*obj->conval->ext)[0]; i = i; while (i <= _for__9) { OPM_Write((*obj->conval->ext)[__X(i, 256)]); @@ -1000,7 +1000,7 @@ static void OPC_IdentList (OPT_Object obj, INTEGER vis) first = 1; while ((obj != NIL && obj->mode != 13)) { if ((__IN(vis, 0x05) || (vis == 1 && obj->vis != 0)) || (vis == 3 && !obj->leaf)) { - if (obj->typ != base || obj->vis != lastvis) { + if (obj->typ != base || (SYSTEM_INT16)obj->vis != lastvis) { if (!first) { OPC_EndStat(); } @@ -1154,7 +1154,7 @@ static void OPC_IncludeImports (OPT_Object obj, INTEGER vis) { if (obj != NIL) { OPC_IncludeImports(obj->left, vis); - if ((((obj->mode == 11 && obj->mnolev != 0)) && OPT_GlbMod[__X(-obj->mnolev, 64)]->vis >= vis)) { + if ((((obj->mode == 11 && obj->mnolev != 0)) && (SYSTEM_INT16)OPT_GlbMod[__X(-obj->mnolev, 64)]->vis >= vis)) { OPC_Include(OPT_GlbMod[__X(-obj->mnolev, 64)]->name, 256); } OPC_IncludeImports(obj->right, vis); @@ -1782,7 +1782,7 @@ void OPC_TypeOf (OPT_Object ap) INTEGER i; __ASSERT(ap->typ->comp == 4, 0); if (ap->mode == 2) { - if (ap->mnolev != OPM_level) { + if ((SYSTEM_INT16)ap->mnolev != OPM_level) { OPM_WriteStringVar((void*)ap->scope->name, 256); OPM_WriteString((CHAR*)"_s->", 5); OPC_Ident(ap); @@ -1850,7 +1850,7 @@ static void OPC_StringLiteral (CHAR *s, LONGINT s__len, LONGINT l) OPM_Write('"'); i = 0; while (i < l) { - c = s[__X(i, s__len)]; + c = (SYSTEM_INT16)s[__X(i, s__len)]; if (c < 32 || c > 126) { OPM_Write('\\'); OPM_Write((CHAR)(48 + __ASHR(c, 6))); @@ -1878,7 +1878,7 @@ void OPC_Case (LONGINT caseVal, INTEGER form) case 3: OPC_CharacterLiteral(caseVal); break; - case 4: case 5: case 6: + case 5: OPM_WriteInt(caseVal); break; default: @@ -1976,7 +1976,7 @@ void OPC_Constant (OPT_Const con, INTEGER form) case 3: OPC_CharacterLiteral(con->intval); break; - case 4: case 5: case 6: + case 5: OPM_WriteInt(con->intval); break; case 7: diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index c3bece55..979d9598 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -154,15 +154,15 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) case 'B': if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_IntSize = s[__X(i, s__len)] - 48; + OPM_IntSize = (SYSTEM_INT16)s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_PointerSize = s[__X(i, s__len)] - 48; + OPM_PointerSize = (SYSTEM_INT16)s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_Alignment = s[__X(i, s__len)] - 48; + OPM_Alignment = (SYSTEM_INT16)s[__X(i, s__len)] - 48; } __ASSERT(OPM_IntSize == 2 || OPM_IntSize == 4, 0); __ASSERT(OPM_PointerSize == 4 || OPM_PointerSize == 8, 0); @@ -458,7 +458,7 @@ static void OPM_ShowLine (LONGINT pos) if (pos >= OPM_ErrorLineLimitPos) { pos = OPM_ErrorLineLimitPos - 1; } - i = (pos - OPM_ErrorLineStartPos); + i = (SYSTEM_INT16)(pos - OPM_ErrorLineStartPos); while (i > 0) { OPM_LogW(' '); i -= 1; @@ -532,12 +532,12 @@ void OPM_err (INTEGER n) void OPM_FPrint (LONGINT *fp, LONGINT val) { - *fp = __ROTL((LONGINT)(__VAL(SET, *fp) ^ __VAL(SET, val)), 1, LONGINT); + *fp = __ROTL((LONGINT)((SET)*fp ^ (SET)val), 1, LONGINT); } void OPM_FPrintSet (LONGINT *fp, SET set) { - OPM_FPrint(&*fp, __VAL(LONGINT, set)); + OPM_FPrint(&*fp, (LONGINT)set); } void OPM_FPrintReal (LONGINT *fp, REAL real) @@ -563,13 +563,13 @@ static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONG if (((*S).class == 1 && __STRCMP((*S).s, name) == 0)) { Texts_Scan(&*S, S__typ); if ((*S).class == 3) { - *size = (*S).i; + *size = (SYSTEM_INT16)(*S).i; Texts_Scan(&*S, S__typ); } else { OPM_Mark(-157, -1); } if ((*S).class == 3) { - *align = (*S).i; + *align = (SYSTEM_INT16)(*S).i; Texts_Scan(&*S, S__typ); } else { OPM_Mark(-157, -1); @@ -753,7 +753,7 @@ void OPM_SymWInt (LONGINT i) void OPM_SymWSet (SET s) { - Files_WriteNum(&OPM_newSF, Files_Rider__typ, __VAL(LONGINT, s)); + Files_WriteNum(&OPM_newSF, Files_Rider__typ, (LONGINT)s); } void OPM_SymWReal (REAL r) @@ -819,13 +819,13 @@ void OPM_WriteHex (LONGINT i) { CHAR s[3]; INTEGER digit; - digit = __ASHR(i, 4); + digit = __ASHR((SYSTEM_INT16)i, 4); if (digit < 10) { s[0] = (CHAR)(48 + digit); } else { s[0] = (CHAR)(87 + digit); } - digit = __MASK(i, -16); + digit = __MASK((SYSTEM_INT16)i, -16); if (digit < 10) { s[1] = (CHAR)(48 + digit); } else { diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index f44a2167..b0e235d3 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -58,7 +58,7 @@ static void OPP_err (INTEGER n) static void OPP_CheckSym (INTEGER s) { - if (OPP_sym == s) { + if ((SYSTEM_INT16)OPP_sym == s) { OPS_Get(&OPP_sym); } else { OPM_err(s); @@ -136,7 +136,7 @@ static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_) OPP_err(135); } OPP_ConstExpression(&x); - if (__IN(x->typ->form, 0x70)) { + if (x->typ->form == 5) { sf = x->conval->intval; if (sf < 0 || sf > 1) { OPP_err(220); @@ -146,7 +146,7 @@ static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_) OPP_err(51); sf = 0; } - *sysflag = sf; + *sysflag = (SYSTEM_INT16)sf; OPP_CheckSym(23); } else { *sysflag = default_; @@ -268,7 +268,7 @@ static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) *typ = OPT_NewStr(15, 2); (*typ)->sysflag = sysflag; OPP_ConstExpression(&x); - if (__IN(x->typ->form, 0x70)) { + if (x->typ->form == 5) { n = x->conval->intval; if (n <= 0 || n > OPM_MaxIndex) { OPP_err(63); @@ -625,7 +625,7 @@ static void OPP_StandProcCall (OPT_Node *x) OPT_Node y = NIL; SHORTINT m; INTEGER n; - m = (*x)->obj->adr; + m = (SYSTEM_INT8)((SYSTEM_INT16)(*x)->obj->adr); n = 0; if (OPP_sym == 30) { OPS_Get(&OPP_sym); @@ -1173,24 +1173,24 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, O for (;;) { OPP_ConstExpression(&x); f = x->typ->form; - if (__IN(f, 0x78)) { + if (__IN(f, 0x28)) { xval = x->conval->intval; } else { OPP_err(61); xval = 1; } - if (__IN(f, 0x70)) { - if (!__IN(LabelTyp->form, 0x70) || LabelTyp->size < x->typ->size) { + if (f == 5) { + if (!(LabelTyp->form == 5) || LabelTyp->size < x->typ->size) { OPP_err(60); } - } else if (LabelTyp->form != f) { + } else if ((SYSTEM_INT16)LabelTyp->form != f) { OPP_err(60); } if (OPP_sym == 21) { OPS_Get(&OPP_sym); OPP_ConstExpression(&y); yval = y->conval->intval; - if ((y->typ->form != f && !((__IN(f, 0x70) && __IN(y->typ->form, 0x70))))) { + if (((SYSTEM_INT16)y->typ->form != f && !((f == 5 && y->typ->form == 5)))) { OPP_err(60); } if (yval < xval) { @@ -1253,7 +1253,7 @@ static void CasePart__31 (OPT_Node *x) *StatSeq__30_s->pos = OPM_errpos; if ((*x)->class == 8 || (*x)->class == 9) { OPP_err(126); - } else if (!__IN((*x)->typ->form, 0x78)) { + } else if (!__IN((*x)->typ->form, 0x38)) { OPP_err(125); } OPP_CheckSym(25); @@ -1439,7 +1439,7 @@ static void OPP_StatSeq (OPT_Node *stat) OPS_Get(&OPP_sym); if (OPP_sym == 38) { OPP_qualident(&id); - if (!__IN(id->typ->form, 0x70)) { + if (!(id->typ->form == 5)) { OPP_err(68); } OPP_CheckSym(34); @@ -1471,7 +1471,7 @@ static void OPP_StatSeq (OPT_Node *stat) SetPos__35(z); OPB_Link(&*stat, &last, z); y = OPB_NewLeaf(t); - } else if (!__IN(y->typ->form, 0x70) || y->typ->size > x->left->typ->size) { + } else if (!(y->typ->form == 5) || y->typ->size > x->left->typ->size) { OPP_err(113); } OPB_Link(&*stat, &last, x); diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index 2a093f8e..89c8242e 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -59,7 +59,7 @@ static void OPS_Str (SHORTINT *sym) if (OPS_intval == 2) { *sym = 35; OPS_numtyp = 1; - OPS_intval = OPS_str[0]; + OPS_intval = (SYSTEM_INT16)OPS_str[0]; } else { *sym = 37; } @@ -112,10 +112,10 @@ static INTEGER Ord__7 (CHAR ch, BOOLEAN hex) { INTEGER _o_result; if (ch <= '9') { - _o_result = ch - 48; + _o_result = (SYSTEM_INT16)ch - 48; return _o_result; } else if (hex) { - _o_result = (ch - 65) + 10; + _o_result = ((SYSTEM_INT16)ch - 65) + 10; return _o_result; } else { OPS_err(2); diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index c81989cb..7398b44a 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -173,7 +173,7 @@ OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir) { OPT_Struct _o_result; INTEGER i; - __ASSERT(__IN(x->form, 0x70), 0); + __ASSERT(x->form == 5, 0); __ASSERT(dir == 1 || dir == -1, 0); __ASSERT(x->BaseTyp == OPT_undftyp, 0); i = 0; @@ -414,7 +414,7 @@ static void OPT_FPrintName (LONGINT *fp, CHAR *name, LONGINT name__len) i = 0; do { ch = name[__X(i, name__len)]; - OPM_FPrint(&*fp, ch); + OPM_FPrint(&*fp, (SYSTEM_INT16)ch); i += 1; } while (!(ch == 0x00)); } @@ -649,7 +649,7 @@ void OPT_FPrintObj (OPT_Object obj) f = obj->typ->form; OPM_FPrint(&fprint, f); switch (f) { - case 2: case 3: case 4: case 5: case 6: + case 2: case 3: case 5: OPM_FPrint(&fprint, obj->conval->intval); break; case 9: @@ -680,11 +680,11 @@ void OPT_FPrintObj (OPT_Object obj) } else if (obj->mode == 9) { OPT_FPrintSign(&fprint, obj->typ, obj->link); ext = obj->conval->ext; - m = (*ext)[0]; + m = (SYSTEM_INT16)(*ext)[0]; f = 1; OPM_FPrint(&fprint, m); while (f <= m) { - OPM_FPrint(&fprint, (*ext)[__X(f, 256)]); + OPM_FPrint(&fprint, (SYSTEM_INT16)(*ext)[__X(f, 256)]); f += 1; } } else if (obj->mode == 5) { @@ -848,9 +848,9 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval) switch (f) { case 1: case 3: case 2: OPM_SymRCh(&ch); - conval->intval = ch; + conval->intval = (SYSTEM_INT16)ch; break; - case 4: case 5: case 6: + case 5: conval->intval = OPM_SymRInt(); break; case 9: @@ -979,7 +979,7 @@ static OPT_Object OPT_InTProc (SHORTINT mno) static OPT_Struct OPT_InTyp (LONGINT tag) { OPT_Struct _o_result; - if (__IN(tag, 0x70)) { + if (tag == 5) { _o_result = OPT_IntType(OPM_SymRInt()); return _o_result; } else { @@ -1049,7 +1049,7 @@ static void OPT_InStruct (OPT_Struct *typ) obj->vis = 0; tag = OPM_SymRInt(); if (tag == 35) { - (*typ)->sysflag = OPM_SymRInt(); + (*typ)->sysflag = (SYSTEM_INT16)OPM_SymRInt(); tag = OPM_SymRInt(); } switch (tag) { @@ -1211,7 +1211,7 @@ static OPT_Object OPT_InObj (SHORTINT mno) obj->mode = 9; ext = OPT_NewExt(); obj->conval->ext = ext; - s = OPM_SymRInt(); + s = (SYSTEM_INT16)OPM_SymRInt(); (*ext)[0] = (CHAR)s; i = 1; while (i <= s) { @@ -1439,7 +1439,7 @@ static void OPT_OutStr (OPT_Struct typ) OPT_Object strobj = NIL; if (typ->ref < OPT_expCtxt.ref) { OPM_SymWInt(-typ->ref); - if (__IN(typ->ref, 0x70)) { + if (typ->ref == 5) { OPM_SymWInt(typ->size); } } else { @@ -1537,7 +1537,7 @@ static void OPT_OutConstant (OPT_Object obj) case 2: case 3: OPM_SymWCh((CHAR)obj->conval->intval); break; - case 4: case 5: case 6: + case 5: OPM_SymWInt(obj->conval->intval); OPM_SymWInt(obj->typ->size); break; @@ -1631,7 +1631,7 @@ static void OPT_OutObj (OPT_Object obj) OPM_SymWInt(33); OPT_OutSign(obj->typ, obj->link); ext = obj->conval->ext; - j = (*ext)[0]; + j = (SYSTEM_INT16)(*ext)[0]; i = 1; OPM_SymWInt(j); while (i <= j) { @@ -1876,7 +1876,7 @@ export void *OPT__init(void) OPT_EnterTyp((CHAR*)"INTEGER", 5, OPM_IntSize, &OPT_inttyp); OPT_EnterTyp((CHAR*)"LONGINT", 5, OPM_LIntSize, &OPT_linttyp); OPT_EnterTyp((CHAR*)"LONGREAL", 8, OPM_LRealSize, &OPT_lrltyp); - OPT_EnterTyp((CHAR*)"SHORTINT", 4, OPM_SIntSize, &OPT_sinttyp); + OPT_EnterTyp((CHAR*)"SHORTINT", 5, OPM_SIntSize, &OPT_sinttyp); OPT_EnterBoolConst((CHAR*)"FALSE", 0); OPT_EnterBoolConst((CHAR*)"TRUE", 1); OPT_EnterProc((CHAR*)"HALT", 0); @@ -1904,9 +1904,7 @@ export void *OPT__init(void) OPT_impCtxt.ref[1] = OPT_bytetyp; OPT_impCtxt.ref[2] = OPT_booltyp; OPT_impCtxt.ref[3] = OPT_chartyp; - OPT_impCtxt.ref[4] = OPT_sinttyp; OPT_impCtxt.ref[5] = OPT_inttyp; - OPT_impCtxt.ref[6] = OPT_linttyp; OPT_impCtxt.ref[7] = OPT_realtyp; OPT_impCtxt.ref[8] = OPT_lrltyp; OPT_impCtxt.ref[9] = OPT_settyp; diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index 75adb37c..7538f014 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -118,7 +118,7 @@ void OPV_TypSize (OPT_Struct typ) } typ->size = offset; typ->align = base; - typ->sysflag = __MASK(typ->sysflag, -256) + __ASHL(offset - off0, 8); + typ->sysflag = __MASK(typ->sysflag, -256) + (SYSTEM_INT16)__ASHL(offset - off0, 8); } else if (c == 2) { OPV_TypSize(typ->BaseTyp); typ->size = typ->n * typ->BaseTyp->size; @@ -474,7 +474,7 @@ static void OPV_Entier (OPT_Node n, INTEGER prec) static void OPV_SizeCast (LONGINT from, LONGINT to) { - if ((from != to && (from > 4 || to > 4))) { + if ((from != to && (from > 4 || to != 4))) { switch (to) { case 1: OPM_WriteString((CHAR*)"(SYSTEM_INT8)", 14); @@ -506,7 +506,7 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec) OPM_WriteString((CHAR*)"__SETOF(", 9); OPV_Entier(n, -1); OPM_Write(')'); - } else if (__IN(to, 0x70)) { + } else if (to == 5) { if ((newtype->size < n->typ->size && __IN(2, OPM_opt))) { OPM_WriteString((CHAR*)"__SHORT", 8); if (OPV_SideEffects(n)) { @@ -589,7 +589,7 @@ static void OPV_design (OPT_Node n, INTEGER prec) obj = n->obj; class = n->class; designPrec = OPV_Precedence(class, n->subcl, n->typ->form, comp); - if ((((((class == 0 && obj->mnolev > 0)) && obj->mnolev != OPM_level)) && prec == 10)) { + if ((((((class == 0 && obj->mnolev > 0)) && (SYSTEM_INT16)obj->mnolev != OPM_level)) && prec == 10)) { designPrec = 9; } if (prec > designPrec) { @@ -688,7 +688,7 @@ static void OPV_design (OPT_Node n, INTEGER prec) if (__IN(3, OPM_opt)) { if (typ->comp == 4) { OPM_WriteString((CHAR*)"__GUARDR(", 10); - if (obj->mnolev != OPM_level) { + if ((SYSTEM_INT16)obj->mnolev != OPM_level) { OPM_WriteStringVar((void*)obj->scope->name, 256); OPM_WriteString((CHAR*)"__curr->", 9); OPC_Ident(obj); @@ -797,10 +797,10 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) OPM_WriteString((CHAR*)"(void*)", 8); } } else { - if ((__IN(form, 0x0180) && __IN(n->typ->form, 0x70))) { + if ((__IN(form, 0x0180) && n->typ->form == 5)) { OPM_WriteString((CHAR*)"(double)", 9); prec = 9; - } else if (__IN(form, 0x70)) { + } else if (form == 5) { OPV_SizeCast(n->typ->size, typ->size); } } @@ -811,7 +811,7 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) } if ((((mode == 2 && n->class == 11)) && n->subcl == 29)) { OPV_expr(n->left, prec); - } else if ((__IN(form, 0x70) && n->class == 7)) { + } else if ((form == 5 && n->class == 7)) { OPV_ParIntLiteral(n->conval->intval, n->typ->size); } else { OPV_expr(n, prec); @@ -965,7 +965,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) } break; case 29: - if (!__IN(l->class, 0x17) || (((__IN(n->typ->form, 0x6240) && __IN(l->typ->form, 0x6240))) && n->typ->size == l->typ->size)) { + if (!__IN(l->class, 0x17) || (((__IN(n->typ->form, 0x6220) && __IN(l->typ->form, 0x6220))) && n->typ->size == l->typ->size)) { OPM_Write('('); OPC_Ident(n->typ->strobj); OPM_Write(')'); @@ -1115,7 +1115,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPM_WriteString((CHAR*)" ^ ", 4); } else { OPM_WriteString((CHAR*)" / ", 4); - if (r->obj == NIL || __IN(r->obj->typ->form, 0x70)) { + if (r->obj == NIL || r->obj->typ->form == 5) { OPM_Write('('); OPC_Ident(n->typ->strobj); OPM_Write(')'); diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 273d1182..60cb401c 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -241,7 +241,7 @@ void Platform_Init (INTEGER argc, LONGINT argvadr) Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; Platform_ArgCount = argc; - av = __VAL(Platform_ArgVecPtr, argvadr); + av = (Platform_ArgVecPtr)(SYSTEM_ADRINT)argvadr; Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; Platform_HeapInitHeap(); @@ -280,7 +280,7 @@ void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { - av = __VAL(Platform_ArgVec, Platform_ArgVector); + av = (Platform_ArgVec)(SYSTEM_ADRINT)Platform_ArgVector; __COPY(*(*av)[__X(n, 1024)], val, val__len); } } @@ -296,11 +296,11 @@ void Platform_GetIntArg (INTEGER n, LONGINT *val) i = 1; } k = 0; - d = s[__X(i, 64)] - 48; + d = (SYSTEM_INT16)s[__X(i, 64)] - 48; while ((d >= 0 && d <= 9)) { k = k * 10 + d; i += 1; - d = s[__X(i, 64)] - 48; + d = (SYSTEM_INT16)s[__X(i, 64)] - 48; } if (s[0] == '-') { k = -k; diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index f2a4b1e4..bea1f4aa 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -67,9 +67,9 @@ void Reals_SetExpo (REAL *x, INTEGER ex) { CHAR c; __GET((SYSTEM_ADRINT)x + 3, c, CHAR); - __PUT((SYSTEM_ADRINT)x + 3, (CHAR)(__ASHL(__ASHR(c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __PUT((SYSTEM_ADRINT)x + 3, (CHAR)(__ASHL(__ASHR((SYSTEM_INT16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); __GET((SYSTEM_ADRINT)x + 2, c, CHAR); - __PUT((SYSTEM_ADRINT)x + 2, (CHAR)(__MASK(c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); + __PUT((SYSTEM_ADRINT)x + 2, (CHAR)(__MASK((SYSTEM_INT16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } INTEGER Reals_ExpoL (LONGREAL x) @@ -136,8 +136,8 @@ static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LO l = b__len; while (i < l) { by = __VAL(CHAR, b[__X(i, b__len)]); - d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR(by, 4)); - d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK(by, -16)); + d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((SYSTEM_INT16)by, 4)); + d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((SYSTEM_INT16)by, -16)); i += 1; } } diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index ec6697bf..f1d4f53d 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -112,7 +112,7 @@ void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n, INTEGER len, destLen, i; __DUP(source, source__len, CHAR); len = Strings_Length(source, source__len); - destLen = dest__len - 1; + destLen = (SYSTEM_INT16)dest__len - 1; if (pos < 0) { pos = 0; } diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index 129aa156..bd5d1115 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -746,7 +746,7 @@ static void ReadScaleFactor__32 (void) } } while (('0' <= *Scan__31_s->ch && *Scan__31_s->ch <= '9')) { - *Scan__31_s->e = (*Scan__31_s->e * 10 + *Scan__31_s->ch) - 48; + *Scan__31_s->e = (*Scan__31_s->e * 10 + (SYSTEM_INT16)*Scan__31_s->ch) - 48; Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); } } @@ -818,10 +818,10 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) if ('9' < ch) { if (('A' <= ch && ch <= 'F')) { hex = 1; - ch = (CHAR)(ch - 7); + ch = (CHAR)((SYSTEM_INT16)ch - 7); } else if (('a' <= ch && ch <= 'f')) { hex = 1; - ch = (CHAR)(ch - 39); + ch = (CHAR)((SYSTEM_INT16)ch - 39); } else { break; } @@ -833,13 +833,13 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) if (i - j > 8) { j = i - 8; } - k = d[__X(j, 32)] - 48; + k = (SYSTEM_INT16)d[__X(j, 32)] - 48; j += 1; if ((i - j == 7 && k >= 8)) { k -= 16; } while (j < i) { - k = __ASHL(k, 4) + (d[__X(j, 32)] - 48); + k = __ASHL(k, 4) + ((SYSTEM_INT16)d[__X(j, 32)] - 48); j += 1; } if (neg) { @@ -860,12 +860,12 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) y = (LONGREAL)0; g = (LONGREAL)1; do { - y = y * (LONGREAL)10 + (d[__X(j, 32)] - 48); + y = y * (LONGREAL)10 + ((SYSTEM_INT16)d[__X(j, 32)] - 48); j += 1; } while (!(j == h)); while (j < i) { g = g / (LONGREAL)(LONGREAL)10; - y = (d[__X(j, 32)] - 48) * g + y; + y = ((SYSTEM_INT16)d[__X(j, 32)] - 48) * g + y; j += 1; } ReadScaleFactor__32(); @@ -892,12 +892,12 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) x = (REAL)0; f = (REAL)1; do { - x = x * (REAL)10 + (d[__X(j, 32)] - 48); + x = x * (REAL)10 + ((SYSTEM_INT16)d[__X(j, 32)] - 48); j += 1; } while (!(j == h)); while (j < i) { f = f / (REAL)(REAL)10; - x = (d[__X(j, 32)] - 48) * f + x; + x = ((SYSTEM_INT16)d[__X(j, 32)] - 48) * f + x; j += 1; } if (ch == 'E') { @@ -929,7 +929,7 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) (*S).class = 3; k = 0; do { - k = k * 10 + (d[__X(j, 32)] - 48); + k = k * 10 + ((SYSTEM_INT16)d[__X(j, 32)] - 48); j += 1; } while (!(j == i)); if (neg) { @@ -1319,7 +1319,7 @@ void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER } else { Texts_Write(&*W, W__typ, ' '); } - e = __ASHR((e - 1023) * 77, 8); + e = (SYSTEM_INT16)__ASHR((e - 1023) * 77, 8); if (e >= 0) { x = x / (LONGREAL)Reals_TenL(e); } else { diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 5f7d65a2..4d32ed53 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -868,7 +868,7 @@ void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x) LONGINT l; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); l = ((b[0] + __ASHL(b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); - *x = __VAL(SET, l); + *x = (SET)l; } void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x) @@ -959,7 +959,7 @@ void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x) { CHAR b[4]; LONGINT i; - i = __VAL(LONGINT, x); + i = (LONGINT)x; b[0] = (CHAR)i; b[1] = (CHAR)__ASHR(i, 8); b[2] = (CHAR)__ASHR(i, 16); diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index a8a51e7c..a5063871 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -328,11 +328,11 @@ SYSTEM_PTR Heap_NEWBLK (LONGINT size) Heap_Lock(); blksz = __ASHL(__ASHR(size + 63, 5), 5); new = Heap_NEWREC((SYSTEM_ADRINT)&blksz); - tag = (__VAL(LONGINT, new) + blksz) - 24; + tag = ((LONGINT)(SYSTEM_ADRINT)new + blksz) - 24; __PUT(tag - 8, 0, LONGINT); __PUT(tag, blksz, LONGINT); __PUT(tag + 8, -8, LONGINT); - __PUT(__VAL(LONGINT, new) - 8, tag, LONGINT); + __PUT((LONGINT)(SYSTEM_ADRINT)new - 8, tag, LONGINT); Heap_Unlock(); _o_result = new; return _o_result; @@ -361,7 +361,7 @@ static void Heap_Mark (LONGINT q) __GET(tag, offset, LONGINT); fld = q + offset; p = Heap_FetchAddress(fld); - __PUT(fld, __VAL(SYSTEM_PTR, n), SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)n, SYSTEM_PTR); } else { fld = q + offset; n = Heap_FetchAddress(fld); @@ -370,7 +370,7 @@ static void Heap_Mark (LONGINT q) if (!__ODD(tagbits)) { __PUT(n - 8, tagbits + 1, LONGINT); __PUT(q - 8, tag + 1, LONGINT); - __PUT(fld, __VAL(SYSTEM_PTR, p), SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)p, SYSTEM_PTR); p = q; q = n; tag = tagbits; @@ -385,7 +385,7 @@ static void Heap_Mark (LONGINT q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark(__VAL(LONGINT, p)); + Heap_Mark((LONGINT)(SYSTEM_ADRINT)p); } static void Heap_Scan (void) @@ -554,7 +554,7 @@ static void Heap_Finalize (void) } else { prev->next = n->next; } - (*n->finalize)(__VAL(SYSTEM_PTR, n->obj)); + (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); if (prev == NIL) { n = Heap_fin; } else { @@ -573,7 +573,7 @@ void Heap_FINALL (void) while (Heap_fin != NIL) { n = Heap_fin; Heap_fin = Heap_fin->next; - (*n->finalize)(__VAL(SYSTEM_PTR, n->obj)); + (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); } } @@ -700,7 +700,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = __VAL(LONGINT, obj); + f->obj = (LONGINT)(SYSTEM_ADRINT)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index c3322a77..fef28dff 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -341,7 +341,7 @@ void OPB_Index (OPT_Node *x, OPT_Node y) f = y->typ->form; if ((*x)->class >= 7) { OPB_err(79); - } else if (!__IN(f, 0x70) || __IN(y->class, 0x0300)) { + } else if (f != 5 || __IN(y->class, 0x0300)) { OPB_err(80); y->typ = OPT_inttyp; } @@ -466,7 +466,7 @@ void OPB_In (OPT_Node *x, OPT_Node y) f = (*x)->typ->form; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); - } else if ((__IN(f, 0x70) && y->typ->form == 9)) { + } else if ((f == 5 && y->typ->form == 9)) { if ((*x)->class == 7) { k = (*x)->conval->intval; if (k < 0 || k > (SYSTEM_INT64)OPM_MaxSet) { @@ -568,14 +568,14 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } break; case 6: - if (!__IN(f, 0x01f0)) { + if (!__IN(f, 0x01a0)) { OPB_err(96); } break; case 7: - if (__IN(f, 0x03f0)) { + if (__IN(f, 0x03a0)) { if (z->class == 7) { - if (__IN(f, 0x70)) { + if (f == 5) { if (z->conval->intval == (-9223372036854775807-1)) { OPB_err(203); } else { @@ -596,9 +596,9 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } break; case 21: - if (__IN(f, 0x01f0)) { + if (__IN(f, 0x01a0)) { if (z->class == 7) { - if (__IN(f, 0x70)) { + if (f == 5) { if (z->conval->intval == (-9223372036854775807-1)) { OPB_err(203); } else { @@ -630,7 +630,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } break; case 23: - if (__IN(f, 0x70)) { + if (f == 5) { if (z->class == 7) { z->conval->intval = OPB_BoolToInt(__ODD(z->conval->intval)); z->obj = NIL; @@ -655,7 +655,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->typ = OPT_linttyp; break; case 25: - if ((__IN(f, 0x70) && z->class == 7)) { + if ((f == 5 && z->class == 7)) { if ((0 <= z->conval->intval && z->conval->intval <= -1)) { z = NewOp__29(op, typ, z); } else { @@ -778,7 +778,7 @@ static INTEGER ConstCmp__14 (void) case 0: res = 9; break; - case 1: case 3: case 4: case 5: case 6: + case 1: case 3: case 4: case 5: if ((*ConstOp__13_s->xval)->intval < (*ConstOp__13_s->yval)->intval) { res = 11; } else if ((*ConstOp__13_s->xval)->intval > (*ConstOp__13_s->yval)->intval) { @@ -865,8 +865,8 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) __GUARDEQP(yval, OPT_ConstDesc) = *xval; } break; - case 4: case 5: case 6: - if (__IN(g, 0x70)) { + case 5: + if (g == 5) { if (x->typ->size <= y->typ->size) { x->typ = y->typ; } else { @@ -885,7 +885,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 7: - if (__IN(g, 0x70)) { + if (g == 5) { y->typ = x->typ; yval->realval = yval->intval; } else if (g == 8) { @@ -897,7 +897,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 8: - if (__IN(g, 0x70)) { + if (g == 5) { y->typ = x->typ; yval->realval = yval->intval; } else if (g == 7) { @@ -941,7 +941,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } switch (op) { case 1: - if (__IN(f, 0x70)) { + if (f == 5) { xv = xval->intval; yv = yval->intval; if (((((xv == 0 || yv == 0) || (((xv > 0 && yv > 0)) && yv <= __DIV(9223372036854775807, xv))) || (((xv > 0 && yv < 0)) && yv >= __DIV((-9223372036854775807-1), xv))) || (((xv < 0 && yv > 0)) && xv >= __DIV((-9223372036854775807-1), yv))) || (((((((xv < 0 && yv < 0)) && xv != (-9223372036854775807-1))) && yv != (-9223372036854775807-1))) && -xv <= __DIV(9223372036854775807, -yv))) { @@ -965,7 +965,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 2: - if (__IN(f, 0x70)) { + if (f == 5) { if (yval->intval != 0) { xval->realval = xval->intval / (REAL)yval->intval; OPB_CheckRealType(7, 205, xval); @@ -989,7 +989,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 3: - if (__IN(f, 0x70)) { + if (f == 5) { if (yval->intval != 0) { xval->intval = __DIV(xval->intval, yval->intval); OPB_SetIntType(x); @@ -1001,7 +1001,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 4: - if (__IN(f, 0x70)) { + if (f == 5) { if (yval->intval != 0) { xval->intval = __MOD(xval->intval, yval->intval); OPB_SetIntType(x); @@ -1020,7 +1020,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 6: - if (__IN(f, 0x70)) { + if (f == 5) { temp = (yval->intval >= 0 && xval->intval <= 9223372036854775807 - yval->intval); if (temp || (yval->intval < 0 && xval->intval >= (-9223372036854775807-1) - yval->intval)) { xval->intval += yval->intval; @@ -1043,7 +1043,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 7: - if (__IN(f, 0x70)) { + if (f == 5) { if ((yval->intval >= 0 && xval->intval >= (-9223372036854775807-1) + yval->intval) || (yval->intval < 0 && xval->intval <= 9223372036854775807 + yval->intval)) { xval->intval -= yval->intval; OPB_SetIntType(x); @@ -1123,8 +1123,8 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) f = (*x)->typ->form; g = typ->form; if ((*x)->class == 7) { - if (__IN(f, 0x70)) { - if (__IN(g, 0x70)) { + if (f == 5) { + if (g == 5) { if (f > g) { OPB_SetIntType(*x); if ((*x)->typ->size > typ->size) { @@ -1248,17 +1248,17 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPB_err(100); } break; - case 4: case 5: case 6: - if ((__IN(g, 0x70) && y->typ->size < z->typ->size)) { + case 5: + if ((g == 5 && y->typ->size < z->typ->size)) { OPB_Convert(&y, z->typ); - } else if (__IN(g, 0x01f0)) { + } else if (__IN(g, 0x01a0)) { OPB_Convert(&z, y->typ); } else { OPB_err(100); } break; case 7: - if (__IN(g, 0x70)) { + if (g == 5) { OPB_Convert(&y, z->typ); } else if (__IN(g, 0x0180)) { OPB_Convert(&z, y->typ); @@ -1267,7 +1267,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 8: - if (__IN(g, 0x01f0)) { + if (__IN(g, 0x01a0)) { OPB_Convert(&y, z->typ); } else if (__IN(g, 0x0180)) { OPB_Convert(&y, z->typ); @@ -1306,7 +1306,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) switch (op) { case 1: do_ = 1; - if (__IN(f, 0x70)) { + if (f == 5) { if (z->class == 7) { val = z->conval->intval; if (val == 1) { @@ -1346,7 +1346,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 2: - if (__IN(f, 0x70)) { + if (f == 5) { if ((y->class == 7 && y->conval->intval == 0)) { OPB_err(205); } @@ -1365,7 +1365,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) break; case 3: do_ = 1; - if (__IN(f, 0x70)) { + if (f == 5) { if (y->class == 7) { val = y->conval->intval; if (val == 0) { @@ -1388,7 +1388,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 4: - if (__IN(f, 0x70)) { + if (f == 5) { if (y->class == 7) { if (y->conval->intval == 0) { OPB_err(205); @@ -1420,12 +1420,12 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 6: - if (!__IN(f, 0x03f1)) { + if (!__IN(f, 0x03e1)) { OPB_err(105); typ = OPT_undftyp; } do_ = 1; - if (__IN(f, 0x70)) { + if (f == 5) { if ((z->class == 7 && z->conval->intval == 0)) { do_ = 0; z = y; @@ -1439,11 +1439,11 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 7: - if (!__IN(f, 0x03f1)) { + if (!__IN(f, 0x03e1)) { OPB_err(106); typ = OPT_undftyp; } - if ((!__IN(f, 0x70) || y->class != 7) || y->conval->intval != 0) { + if ((f != 5 || y->class != 7) || y->conval->intval != 0) { NewOp__39(op, typ, &z, y); } break; @@ -1499,7 +1499,7 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y) LONGINT k, l; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); - } else if ((__IN((*x)->typ->form, 0x70) && __IN(y->typ->form, 0x70))) { + } else if (((*x)->typ->form == 5 && y->typ->form == 5)) { if ((*x)->class == 7) { k = (*x)->conval->intval; if (0 > k || k > (SYSTEM_INT64)OPM_MaxSet) { @@ -1534,7 +1534,7 @@ void OPB_SetElem (OPT_Node *x) LONGINT k; if ((*x)->class == 8 || (*x)->class == 9) { OPB_err(126); - } else if (!__IN((*x)->typ->form, 0x70)) { + } else if ((*x)->typ->form != 5) { OPB_err(93); } else if ((*x)->class == 7) { k = (*x)->conval->intval; @@ -1584,7 +1584,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) case 0: case 10: break; case 1: - if (!((__IN(g, 0x7a) && y->size == 1))) { + if (!((__IN(g, 0x2a) && y->size == 1))) { OPB_err(113); } break; @@ -1593,18 +1593,18 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPB_err(113); } break; - case 4: case 5: case 6: - if (!__IN(g, 0x70) || x->size < y->size) { + case 5: + if (g != 5 || x->size < y->size) { OPB_err(113); } break; case 7: - if (!__IN(g, 0xf0)) { + if (!__IN(g, 0xe0)) { OPB_err(113); } break; case 8: - if (!__IN(g, 0x01f0)) { + if (!__IN(g, 0x01e0)) { OPB_err(113); } break; @@ -1687,7 +1687,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPM_LogWLn(); break; } - if ((((((ynode->class == 7 && g < f)) && __IN(g, 0xf0))) && __IN(f, 0x01e0))) { + if ((((((ynode->class == 7 && g < f)) && __IN(g, 0xe0))) && __IN(f, 0x01e0))) { OPB_Convert(&ynode, x); } } @@ -1705,7 +1705,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) f = x->typ->form; switch (fctno) { case 0: - if ((__IN(f, 0x70) && x->class == 7)) { + if ((f == 5 && x->class == 7)) { if ((0 <= x->conval->intval && x->conval->intval <= 255)) { OPB_BindNodes(28, OPT_notyp, &x, x); } else { @@ -1778,7 +1778,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) x = OPB_NewIntConst(0); x->typ = OPT_chartyp; break; - case 4: case 5: case 6: + case 5: x = OPB_NewIntConst(OPM_SignedMinimum(x->typ->size)); break; case 9: @@ -1809,7 +1809,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) x = OPB_NewIntConst(255); x->typ = OPT_chartyp; break; - case 4: case 5: case 6: + case 5: x = OPB_NewIntConst(OPM_SignedMaximum(x->typ->size)); break; case 9: @@ -1833,7 +1833,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 9: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x71)) { + } else if (__IN(f, 0x21)) { OPB_Convert(&x, OPT_chartyp); } else { OPB_err(111); @@ -1843,7 +1843,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 10: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { typ = OPT_ShorterOrLongerType(x->typ, -1); if (typ == NIL) { OPB_err(111); @@ -1859,7 +1859,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 11: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { typ = OPT_ShorterOrLongerType(x->typ, 1); if (typ == NIL) { OPB_err(111); @@ -1877,7 +1877,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 13: case 14: if (OPB_NotVar(x)) { OPB_err(112); - } else if (!__IN(f, 0x70)) { + } else if (f != 5) { OPB_err(111); } else if (x->readonly) { OPB_err(76); @@ -1912,7 +1912,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 19: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { if (x->typ->size != (SYSTEM_INT64)OPM_LIntSize) { OPB_Convert(&x, OPT_linttyp); } @@ -1944,22 +1944,22 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 22: case 23: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (!__IN(f, 0x027a)) { + } else if (!__IN(f, 0x022a)) { OPB_err(111); } break; case 24: case 25: case 28: case 31: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((((x->class == 7 && __IN(f, 0x70))) && x->typ->size < OPT_linttyp->size)) { + } else if ((((x->class == 7 && f == 5)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x2070) && x->typ->size == (SYSTEM_INT64)OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x2020) && x->typ->size == (SYSTEM_INT64)OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } break; case 26: case 27: - if ((__IN(f, 0x70) && x->class == 7)) { + if ((f == 5 && x->class == 7)) { if (x->conval->intval < 0 || x->conval->intval > -1) { OPB_err(220); } @@ -2037,7 +2037,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) p->typ = OPT_notyp; } else { if (x->typ != p->typ) { - if ((x->class == 7 && __IN(f, 0x70))) { + if ((x->class == 7 && f == 5)) { OPB_Convert(&x, p->typ); } else { OPB_err(111); @@ -2050,7 +2050,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 15: case 16: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > (SYSTEM_INT64)OPM_MaxSet))) { OPB_err(202); } @@ -2061,7 +2061,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) p->typ = OPT_notyp; break; case 17: - if (!__IN(f, 0x70) || x->class != 7) { + if (!(f == 5) || x->class != 7) { OPB_err(69); } else if (x->typ->size == 1) { L = (SYSTEM_INT32)x->conval->intval; @@ -2110,7 +2110,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 19: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { if ((p->class == 7 && x->class == 7)) { if (-OPB_maxExp > x->conval->intval || x->conval->intval > OPB_maxExp) { OPB_err(208); @@ -2138,7 +2138,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (p->typ->comp == 3) { - if (__IN(f, 0x70)) { + if (f == 5) { if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > OPM_MaxIndex))) { OPB_err(63); } @@ -2154,7 +2154,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 22: case 23: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (!__IN(f, 0x70)) { + } else if (f != 5) { OPB_err(111); } else { if (fctno == 22) { @@ -2186,7 +2186,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 28: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { p = NewOp__53(12, 26, p, x); } else { OPB_err(111); @@ -2210,7 +2210,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 30: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { p = NewOp__53(19, 30, p, x); } else { OPB_err(111); @@ -2220,16 +2220,16 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 31: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((((x->class == 7 && __IN(f, 0x70))) && x->typ->size < OPT_linttyp->size)) { + } else if ((((x->class == 7 && f == 5)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x2070) && x->typ->size == (SYSTEM_INT64)OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x2020) && x->typ->size == (SYSTEM_INT64)OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } p->link = x; break; case 32: - if ((__IN(f, 0x70) && x->class == 7)) { + if ((f == 5 && x->class == 7)) { if ((0 <= x->conval->intval && x->conval->intval <= 255)) { OPB_BindNodes(28, OPT_notyp, &x, x); x->conval = OPT_NewConst(); @@ -2272,7 +2272,7 @@ void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n) OPB_err(126); } else if (p->typ->comp != 3) { OPB_err(64); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > OPM_MaxIndex))) { OPB_err(63); } @@ -2288,7 +2288,7 @@ void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n) } else if ((fctno == 31 && n == 2)) { if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { node = OPT_NewNode(19); node->subcl = 31; node->right = p; @@ -2376,7 +2376,7 @@ static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpa ftyp = ftyp->BaseTyp; atyp = atyp->BaseTyp; if ((fvarpar && ftyp == OPT_bytetyp)) { - if (!__IN(f, 0x0c) || !((__IN(atyp->form, 0x7e) && atyp->size == 1))) { + if (!__IN(f, 0x0c) || !((__IN(atyp->form, 0x2e) && atyp->size == 1))) { if (__IN(18, OPM_opt)) { OPB_err(-301); } @@ -2459,7 +2459,7 @@ void OPB_Param (OPT_Node ap, OPT_Object fp) OPB_err(111); } } else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 13)) { - } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x7e) && ap->typ->size == 1)))))) { + } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x2e) && ap->typ->size == 1)))))) { OPB_err(123); } else if ((fp->typ->form == 13 && ap->class == 5)) { OPB_err(123); diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index 57fdcb05..b8a0608e 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1879,7 +1879,7 @@ void OPC_Case (LONGINT caseVal, INTEGER form) case 3: OPC_CharacterLiteral(caseVal); break; - case 4: case 5: case 6: + case 5: OPM_WriteInt(caseVal); break; default: @@ -1977,7 +1977,7 @@ void OPC_Constant (OPT_Const con, INTEGER form) case 3: OPC_CharacterLiteral(con->intval); break; - case 4: case 5: case 6: + case 5: OPM_WriteInt(con->intval); break; case 7: diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index edc81f01..450ed83d 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -533,12 +533,12 @@ void OPM_err (INTEGER n) void OPM_FPrint (LONGINT *fp, LONGINT val) { - *fp = __ROTL((LONGINT)(__VAL(SET, *fp) ^ __VAL(SET, val)), 1, LONGINT); + *fp = __ROTL((LONGINT)((SET)*fp ^ (SET)val), 1, LONGINT); } void OPM_FPrintSet (LONGINT *fp, SET set) { - OPM_FPrint(&*fp, __VAL(LONGINT, set)); + OPM_FPrint(&*fp, (LONGINT)set); } void OPM_FPrintReal (LONGINT *fp, REAL real) @@ -752,7 +752,7 @@ void OPM_SymWInt (LONGINT i) void OPM_SymWSet (SET s) { - Files_WriteNum(&OPM_newSF, Files_Rider__typ, __VAL(LONGINT, s)); + Files_WriteNum(&OPM_newSF, Files_Rider__typ, (LONGINT)s); } void OPM_SymWReal (REAL r) diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index c525c696..becc2507 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -137,7 +137,7 @@ static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_) OPP_err(135); } OPP_ConstExpression(&x); - if (__IN(x->typ->form, 0x70)) { + if (x->typ->form == 5) { sf = x->conval->intval; if (sf < 0 || sf > 1) { OPP_err(220); @@ -269,7 +269,7 @@ static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) *typ = OPT_NewStr(15, 2); (*typ)->sysflag = sysflag; OPP_ConstExpression(&x); - if (__IN(x->typ->form, 0x70)) { + if (x->typ->form == 5) { n = x->conval->intval; if (n <= 0 || n > OPM_MaxIndex) { OPP_err(63); @@ -626,7 +626,7 @@ static void OPP_StandProcCall (OPT_Node *x) OPT_Node y = NIL; SHORTINT m; INTEGER n; - m = (SYSTEM_INT8)(*x)->obj->adr; + m = (SYSTEM_INT8)((SYSTEM_INT32)(*x)->obj->adr); n = 0; if (OPP_sym == 30) { OPS_Get(&OPP_sym); @@ -1174,14 +1174,14 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, O for (;;) { OPP_ConstExpression(&x); f = x->typ->form; - if (__IN(f, 0x78)) { + if (__IN(f, 0x28)) { xval = x->conval->intval; } else { OPP_err(61); xval = 1; } - if (__IN(f, 0x70)) { - if (!__IN(LabelTyp->form, 0x70) || LabelTyp->size < x->typ->size) { + if (f == 5) { + if (!(LabelTyp->form == 5) || LabelTyp->size < x->typ->size) { OPP_err(60); } } else if (LabelTyp->form != f) { @@ -1191,7 +1191,7 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, O OPS_Get(&OPP_sym); OPP_ConstExpression(&y); yval = y->conval->intval; - if ((y->typ->form != f && !((__IN(f, 0x70) && __IN(y->typ->form, 0x70))))) { + if ((y->typ->form != f && !((f == 5 && y->typ->form == 5)))) { OPP_err(60); } if (yval < xval) { @@ -1254,7 +1254,7 @@ static void CasePart__31 (OPT_Node *x) *StatSeq__30_s->pos = OPM_errpos; if ((*x)->class == 8 || (*x)->class == 9) { OPP_err(126); - } else if (!__IN((*x)->typ->form, 0x78)) { + } else if (!__IN((*x)->typ->form, 0x38)) { OPP_err(125); } OPP_CheckSym(25); @@ -1440,7 +1440,7 @@ static void OPP_StatSeq (OPT_Node *stat) OPS_Get(&OPP_sym); if (OPP_sym == 38) { OPP_qualident(&id); - if (!__IN(id->typ->form, 0x70)) { + if (!(id->typ->form == 5)) { OPP_err(68); } OPP_CheckSym(34); @@ -1472,7 +1472,7 @@ static void OPP_StatSeq (OPT_Node *stat) SetPos__35(z); OPB_Link(&*stat, &last, z); y = OPB_NewLeaf(t); - } else if (!__IN(y->typ->form, 0x70) || y->typ->size > x->left->typ->size) { + } else if (!(y->typ->form == 5) || y->typ->size > x->left->typ->size) { OPP_err(113); } OPB_Link(&*stat, &last, x); diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index 5861f882..f8762935 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -174,7 +174,7 @@ OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir) { OPT_Struct _o_result; INTEGER i; - __ASSERT(__IN(x->form, 0x70), 0); + __ASSERT(x->form == 5, 0); __ASSERT(dir == 1 || dir == -1, 0); __ASSERT(x->BaseTyp == OPT_undftyp, 0); i = 0; @@ -650,7 +650,7 @@ void OPT_FPrintObj (OPT_Object obj) f = obj->typ->form; OPM_FPrint(&fprint, f); switch (f) { - case 2: case 3: case 4: case 5: case 6: + case 2: case 3: case 5: OPM_FPrint(&fprint, obj->conval->intval); break; case 9: @@ -851,7 +851,7 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval) OPM_SymRCh(&ch); conval->intval = ch; break; - case 4: case 5: case 6: + case 5: conval->intval = OPM_SymRInt(); break; case 9: @@ -980,7 +980,7 @@ static OPT_Object OPT_InTProc (SHORTINT mno) static OPT_Struct OPT_InTyp (LONGINT tag) { OPT_Struct _o_result; - if (__IN(tag, 0x70)) { + if (tag == 5) { _o_result = OPT_IntType(OPM_SymRInt()); return _o_result; } else { @@ -1440,7 +1440,7 @@ static void OPT_OutStr (OPT_Struct typ) OPT_Object strobj = NIL; if (typ->ref < OPT_expCtxt.ref) { OPM_SymWInt(-typ->ref); - if (__IN(typ->ref, 0x70)) { + if (typ->ref == 5) { OPM_SymWInt(typ->size); } } else { @@ -1538,7 +1538,7 @@ static void OPT_OutConstant (OPT_Object obj) case 2: case 3: OPM_SymWCh((CHAR)obj->conval->intval); break; - case 4: case 5: case 6: + case 5: OPM_SymWInt(obj->conval->intval); OPM_SymWInt(obj->typ->size); break; @@ -1877,7 +1877,7 @@ export void *OPT__init(void) OPT_EnterTyp((CHAR*)"INTEGER", 5, OPM_IntSize, &OPT_inttyp); OPT_EnterTyp((CHAR*)"LONGINT", 5, OPM_LIntSize, &OPT_linttyp); OPT_EnterTyp((CHAR*)"LONGREAL", 8, OPM_LRealSize, &OPT_lrltyp); - OPT_EnterTyp((CHAR*)"SHORTINT", 4, OPM_SIntSize, &OPT_sinttyp); + OPT_EnterTyp((CHAR*)"SHORTINT", 5, OPM_SIntSize, &OPT_sinttyp); OPT_EnterBoolConst((CHAR*)"FALSE", 0); OPT_EnterBoolConst((CHAR*)"TRUE", 1); OPT_EnterProc((CHAR*)"HALT", 0); @@ -1905,9 +1905,7 @@ export void *OPT__init(void) OPT_impCtxt.ref[1] = OPT_bytetyp; OPT_impCtxt.ref[2] = OPT_booltyp; OPT_impCtxt.ref[3] = OPT_chartyp; - OPT_impCtxt.ref[4] = OPT_sinttyp; OPT_impCtxt.ref[5] = OPT_inttyp; - OPT_impCtxt.ref[6] = OPT_linttyp; OPT_impCtxt.ref[7] = OPT_realtyp; OPT_impCtxt.ref[8] = OPT_lrltyp; OPT_impCtxt.ref[9] = OPT_settyp; diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 49956ac6..b5cebda5 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -475,7 +475,7 @@ static void OPV_Entier (OPT_Node n, INTEGER prec) static void OPV_SizeCast (LONGINT from, LONGINT to) { - if ((from != to && (from > 4 || to > 4))) { + if ((from != to && (from > 4 || to != 4))) { switch (to) { case 1: OPM_WriteString((CHAR*)"(SYSTEM_INT8)", 14); @@ -507,7 +507,7 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec) OPM_WriteString((CHAR*)"__SETOF(", 9); OPV_Entier(n, -1); OPM_Write(')'); - } else if (__IN(to, 0x70)) { + } else if (to == 5) { if ((newtype->size < n->typ->size && __IN(2, OPM_opt))) { OPM_WriteString((CHAR*)"__SHORT", 8); if (OPV_SideEffects(n)) { @@ -798,10 +798,10 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) OPM_WriteString((CHAR*)"(void*)", 8); } } else { - if ((__IN(form, 0x0180) && __IN(n->typ->form, 0x70))) { + if ((__IN(form, 0x0180) && n->typ->form == 5)) { OPM_WriteString((CHAR*)"(double)", 9); prec = 9; - } else if (__IN(form, 0x70)) { + } else if (form == 5) { OPV_SizeCast(n->typ->size, typ->size); } } @@ -812,7 +812,7 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) } if ((((mode == 2 && n->class == 11)) && n->subcl == 29)) { OPV_expr(n->left, prec); - } else if ((__IN(form, 0x70) && n->class == 7)) { + } else if ((form == 5 && n->class == 7)) { OPV_ParIntLiteral(n->conval->intval, n->typ->size); } else { OPV_expr(n, prec); @@ -966,7 +966,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) } break; case 29: - if (!__IN(l->class, 0x17) || (((__IN(n->typ->form, 0x6240) && __IN(l->typ->form, 0x6240))) && n->typ->size == l->typ->size)) { + if (!__IN(l->class, 0x17) || (((__IN(n->typ->form, 0x6220) && __IN(l->typ->form, 0x6220))) && n->typ->size == l->typ->size)) { OPM_Write('('); OPC_Ident(n->typ->strobj); OPM_Write(')'); @@ -1116,7 +1116,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPM_WriteString((CHAR*)" ^ ", 4); } else { OPM_WriteString((CHAR*)" / ", 4); - if (r->obj == NIL || __IN(r->obj->typ->form, 0x70)) { + if (r->obj == NIL || r->obj->typ->form == 5) { OPM_Write('('); OPC_Ident(n->typ->strobj); OPM_Write(')'); diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index f66fdf2c..efbe5376 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -242,7 +242,7 @@ void Platform_Init (INTEGER argc, LONGINT argvadr) Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; Platform_ArgCount = argc; - av = __VAL(Platform_ArgVecPtr, argvadr); + av = (Platform_ArgVecPtr)(SYSTEM_ADRINT)argvadr; Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; Platform_HeapInitHeap(); @@ -281,7 +281,7 @@ void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { - av = __VAL(Platform_ArgVec, Platform_ArgVector); + av = (Platform_ArgVec)(SYSTEM_ADRINT)Platform_ArgVector; __COPY(*(*av)[__X(n, 1024)], val, val__len); } } diff --git a/src/compiler/OPB.Mod b/src/compiler/OPB.Mod index 000e1aef..9f696edc 100644 --- a/src/compiler/OPB.Mod +++ b/src/compiler/OPB.Mod @@ -178,7 +178,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) BEGIN f := y^.typ^.form; IF x^.class >= OPT.Nconst THEN err(79) - ELSIF ~(f IN OPT.intSet) OR (y^.class IN {OPT.Nproc, OPT.Ntype}) THEN err(80); y^.typ := OPT.inttyp END ; + ELSIF (f # OPT.Int) OR (y^.class IN {OPT.Nproc, OPT.Ntype}) THEN err(80); y^.typ := OPT.inttyp END ; IF x^.typ^.comp = OPT.Array THEN typ := x^.typ^.BaseTyp; IF (y^.class = OPT.Nconst) & ((y^.conval^.intval < 0) OR (y^.conval^.intval >= x^.typ^.n)) THEN err(81) END ELSIF x^.typ^.comp = OPT.DynArr THEN typ := x^.typ^.BaseTyp; @@ -241,7 +241,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) VAR f: INTEGER; k: LONGINT; BEGIN f := x^.typ^.form; IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) OR (y^.class = OPT.Ntype) OR (y^.class = OPT.Nproc) THEN err(126) - ELSIF (f IN OPT.intSet) & (y^.typ^.form = OPT.Set) THEN + ELSIF (f = OPT.Int) & (y^.typ^.form = OPT.Set) THEN IF x^.class = OPT.Nconst THEN k := x^.conval^.intval; IF (k < 0) OR (k > OPM.MaxSet) THEN err(202) @@ -298,10 +298,10 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) END ELSE err(98) END - |OPS.plus: IF ~(f IN OPT.intSet + OPT.realSet) THEN err(96) END - |OPS.minus: IF f IN OPT.intSet + OPT.realSet +{OPT.Set}THEN + |OPS.plus: IF ~(f IN {OPT.Int} + OPT.realSet) THEN err(96) END + |OPS.minus: IF f IN {OPT.Int, OPT.Set} + OPT.realSet THEN IF z^.class = OPT.Nconst THEN - IF f IN OPT.intSet THEN + IF f = OPT.Int THEN IF z^.conval^.intval = MIN(LONGINT) THEN err(203) ELSE z^.conval^.intval := -z^.conval^.intval; SetIntType(z) END @@ -313,9 +313,9 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) END ELSE err(97) END - |OPT.abs: IF f IN OPT.intSet + OPT.realSet THEN + |OPT.abs: IF f IN {OPT.Int} + OPT.realSet THEN IF z^.class = OPT.Nconst THEN - IF f IN OPT.intSet THEN + IF f = OPT.Int THEN IF z^.conval^.intval = MIN(LONGINT) THEN err(203) ELSE z^.conval^.intval := ABS(z^.conval^.intval); SetIntType(z) END @@ -333,7 +333,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) END ELSE err(111); z^.typ := OPT.chartyp END - |OPT.odd: IF f IN OPT.intSet THEN + |OPT.odd: IF f = OPT.Int THEN IF z^.class = OPT.Nconst THEN z^.conval^.intval := BoolToInt(ODD(z^.conval^.intval)); z^.obj := NIL ELSE z := NewOp(op, typ, z) @@ -348,7 +348,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) ELSE err(127) END ; z^.typ := OPT.linttyp - |OPT.cc: IF (f IN OPT.intSet) & (z^.class = OPT.Nconst) THEN (*SYSTEM.CC*) + |OPT.cc: IF (f = OPT.Int) & (z^.class = OPT.Nconst) THEN (*SYSTEM.CC*) IF (0 <= z^.conval^.intval) & (z^.conval^.intval <= OPM.MaxCC) THEN z := NewOp(op, typ, z) ELSE err(219) END ELSE err(69) END ; @@ -426,7 +426,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) |OPT.Undef: res := OPS.eql |OPT.Byte, OPT.Char - ..OPT.LInt: IF xval^.intval < yval^.intval THEN res := OPS.lss + ..OPT.Int: IF xval^.intval < yval^.intval THEN res := OPS.lss ELSIF xval^.intval > yval^.intval THEN res := OPS.gtr ELSE res := OPS.eql END @@ -463,19 +463,17 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) |OPT.Char: IF g = OPT.String THEN CharToString(x) ELSE err(100); y^.typ := x^.typ; yval^ := xval^ END ; - |OPT.SInt, - OPT.Int, - OPT.LInt: IF g IN OPT.intSet THEN + |OPT.Int: IF g = OPT.Int THEN IF x.typ.size <= y.typ.size THEN x.typ := y.typ ELSE x.typ := OPT.IntType(x.typ.size) END ELSIF g = OPT.Real THEN x^.typ := OPT.realtyp; xval^.realval := xval^.intval ELSIF g = OPT.LReal THEN x^.typ := OPT.lrltyp; xval^.realval := xval^.intval ELSE err(100); y^.typ := x^.typ; yval^ := xval^ END - |OPT.Real: IF g IN OPT.intSet THEN y^.typ := x^.typ; yval^.realval := yval^.intval + |OPT.Real: IF g = OPT.Int THEN y^.typ := x^.typ; yval^.realval := yval^.intval ELSIF g = OPT.LReal THEN x^.typ := OPT.lrltyp ELSE err(100); y^.typ := x^.typ; yval^ := xval^ END - |OPT.LReal: IF g IN OPT.intSet THEN y^.typ := x^.typ; yval^.realval := yval^.intval + |OPT.LReal: IF g = OPT.Int THEN y^.typ := x^.typ; yval^.realval := yval^.intval ELSIF g = OPT.Real THEN y^.typ := OPT.lrltyp ELSE err(100); y^.typ := x^.typ; yval^ := xval^ END @@ -490,7 +488,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) f := x^.typ^.form END ; (* {x^.typ = y^.typ} *) CASE op OF - |OPS.times: IF f IN OPT.intSet THEN xv := xval^.intval; yv := yval^.intval; + |OPS.times: IF f = OPT.Int THEN xv := xval^.intval; yv := yval^.intval; IF (xv = 0) OR (yv = 0) OR (* division with negative numbers is not defined *) (xv > 0) & (yv > 0) & (yv <= MAX(LONGINT) DIV xv) OR (xv > 0) & (yv < 0) & (yv >= MIN(LONGINT) DIV xv) OR @@ -509,7 +507,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) xval^.setval := xval^.setval * yval^.setval ELSIF f # OPT.Undef THEN err(101) END - |OPS.slash: IF f IN OPT.intSet THEN + |OPS.slash: IF f = OPT.Int THEN IF yval^.intval # 0 THEN xval^.realval := xval^.intval / yval^.intval; CheckRealType(OPT.Real, 205, xval) ELSE err(205); xval^.realval := 1.0 @@ -525,14 +523,14 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) xval^.setval := xval^.setval / yval^.setval ELSIF f # OPT.Undef THEN err(102) END - |OPS.div: IF f IN OPT.intSet THEN + |OPS.div: IF f = OPT.Int THEN IF yval^.intval # 0 THEN xval^.intval := xval^.intval DIV yval^.intval; SetIntType(x) ELSE err(205) END ELSIF f # OPT.Undef THEN err(103) END - |OPS.mod: IF f IN OPT.intSet THEN + |OPS.mod: IF f = OPT.Int THEN IF yval^.intval # 0 THEN xval^.intval := xval^.intval MOD yval^.intval; SetIntType(x) ELSE err(205) @@ -543,7 +541,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) xval^.intval := BoolToInt(IntToBool(xval^.intval) & IntToBool(yval^.intval)) ELSE err(94) END - |OPS.plus: IF f IN OPT.intSet THEN + |OPS.plus: IF f = OPT.Int THEN temp := (yval^.intval >= 0) & (xval^.intval <= MAX(LONGINT) - yval^.intval); IF temp OR (yval^.intval < 0) & (xval^.intval >= MIN(LONGINT) - yval^.intval) THEN INC(xval^.intval, yval^.intval); SetIntType(x) @@ -559,7 +557,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) xval^.setval := xval^.setval + yval^.setval ELSIF f # OPT.Undef THEN err(105) END - |OPS.minus: IF f IN OPT.intSet THEN + |OPS.minus: IF f = OPT.Int THEN IF (yval^.intval >= 0) & (xval^.intval >= MIN(LONGINT) + yval^.intval) OR (yval^.intval < 0) & (xval^.intval <= MAX(LONGINT) + yval^.intval) THEN DEC(xval^.intval, yval^.intval); SetIntType(x) @@ -598,12 +596,12 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) END END ConstOp; - PROCEDURE Convert(VAR x: OPT.Node; typ: OPT.Struct); + PROCEDURE Convert(VAR x: OPT.Node; typ: OPT.Struct); (* Convert node x to new type typ *) VAR node: OPT.Node; f, g: INTEGER; k: LONGINT; r: LONGREAL; BEGIN f := x^.typ^.form; g := typ^.form; IF x^.class = OPT.Nconst THEN - IF f IN OPT.intSet THEN - IF g IN OPT.intSet THEN + IF f = OPT.Int THEN + IF g = OPT.Int THEN IF f > g THEN SetIntType(x); IF x.typ.size > typ.size THEN err(203); x^.conval^.intval := 1 END END @@ -668,17 +666,15 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) g := y^.typ^.form; CASE z^.typ^.form OF |OPT.Char: IF z^.class = OPT.Nconst THEN CharToString(z) ELSE err(100) END - |OPT.SInt, - OPT.Int, - OPT.LInt: IF (g IN OPT.intSet) & (y.typ.size < z.typ.size) THEN Convert(y, z.typ) - ELSIF g IN OPT.intSet + OPT.realSet THEN Convert(z, y.typ) + |OPT.Int: IF (g = OPT.Int) & (y.typ.size < z.typ.size) THEN Convert(y, z.typ) + ELSIF g IN {OPT.Int} + OPT.realSet THEN Convert(z, y.typ) ELSE err(100) END - |OPT.Real: IF g IN OPT.intSet THEN Convert(y, z^.typ) + |OPT.Real: IF g = OPT.Int THEN Convert(y, z^.typ) ELSIF g IN OPT.realSet THEN Convert(z, y^.typ) ELSE err(100) END - |OPT.LReal: IF g IN OPT.intSet + OPT.realSet THEN Convert(y, z^.typ) + |OPT.LReal: IF g IN {OPT.Int} + OPT.realSet THEN Convert(y, z^.typ) ELSIF g IN OPT.realSet THEN Convert(y, z^.typ) (* DCWB: Surely this line does nothing. *) ELSE err(100) END @@ -693,7 +689,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) typ := z^.typ; f := typ^.form; g := y^.typ^.form; CASE op OF |OPS.times: do := TRUE; - IF f IN OPT.intSet THEN + IF f = OPT.Int THEN IF z^.class = OPT.Nconst THEN val := z^.conval^.intval; IF val = 1 THEN do := FALSE; z := y ELSIF val = 0 THEN do := FALSE @@ -711,7 +707,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) ELSIF ~(f IN {OPT.Undef, OPT.Real..OPT.Set}) THEN err(105); typ := OPT.undftyp END ; IF do THEN NewOp(op, typ, z, y) END - |OPS.slash: IF f IN OPT.intSet THEN + |OPS.slash: IF f = OPT.Int THEN IF (y^.class = OPT.Nconst) & (y^.conval^.intval = 0) THEN err(205) END ; Convert(z, OPT.realtyp); Convert(y, OPT.realtyp); typ := OPT.realtyp @@ -721,7 +717,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) END ; NewOp(op, typ, z, y) |OPS.div: do := TRUE; - IF f IN OPT.intSet THEN + IF f = OPT.Int THEN IF y^.class = OPT.Nconst THEN val := y^.conval^.intval; IF val = 0 THEN err(205) ELSIF val = 1 THEN do := FALSE @@ -732,7 +728,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) ELSIF f # OPT.Undef THEN err(103); typ := OPT.undftyp END ; IF do THEN NewOp(op, typ, z, y) END - |OPS.mod: IF f IN OPT.intSet THEN + |OPS.mod: IF f = OPT.Int THEN IF y^.class = OPT.Nconst THEN IF y^.conval^.intval = 0 THEN err(205) ELSIF log(y^.conval^.intval) = 1 THEN @@ -752,15 +748,15 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) END ELSIF f # OPT.Undef THEN err(94); z^.typ := OPT.undftyp END - |OPS.plus: IF ~(f IN {OPT.Undef, OPT.SInt..OPT.Set}) THEN err(105); typ := OPT.undftyp END ; + |OPS.plus: IF ~(f IN {OPT.Undef, OPT.Int..OPT.Set}) THEN err(105); typ := OPT.undftyp END ; do := TRUE; - IF f IN OPT.intSet THEN + IF f = OPT.Int THEN IF (z^.class = OPT.Nconst) & (z^.conval^.intval = 0) THEN do := FALSE; z := y END ; IF (y^.class = OPT.Nconst) & (y^.conval^.intval = 0) THEN do := FALSE END END ; IF do THEN NewOp(op, typ, z, y) END - |OPS.minus: IF ~(f IN {OPT.Undef, OPT.SInt..OPT.Set}) THEN err(106); typ := OPT.undftyp END ; - IF ~(f IN OPT.intSet) OR (y^.class # OPT.Nconst) OR (y^.conval^.intval # 0) THEN NewOp(op, typ, z, y) END + |OPS.minus: IF ~(f IN {OPT.Undef, OPT.Int..OPT.Set}) THEN err(106); typ := OPT.undftyp END ; + IF (f # OPT.Int) OR (y^.class # OPT.Nconst) OR (y^.conval^.intval # 0) THEN NewOp(op, typ, z, y) END |OPS.or: IF f = OPT.Bool THEN IF z^.class = OPT.Nconst THEN IF ~IntToBool(z^.conval^.intval) THEN z := y END @@ -795,7 +791,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) VAR k, l: LONGINT; BEGIN IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) OR (y^.class = OPT.Ntype) OR (y^.class = OPT.Nproc) THEN err(126) - ELSIF (x^.typ^.form IN OPT.intSet) & (y^.typ^.form IN OPT.intSet) THEN + ELSIF (x^.typ^.form = OPT.Int) & (y^.typ^.form = OPT.Int) THEN IF x^.class = OPT.Nconst THEN k := x^.conval^.intval; IF (0 > k) OR (k > OPM.MaxSet) THEN err(202) END @@ -821,7 +817,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) VAR k: LONGINT; BEGIN IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) - ELSIF ~(x^.typ^.form IN OPT.intSet) THEN err(93) + ELSIF x^.typ^.form # OPT.Int THEN err(93) ELSIF x^.class = OPT.Nconst THEN k := x^.conval^.intval; IF (0 <= k) & (k <= OPM.MaxSet) THEN x^.conval^.setval := {k} @@ -854,15 +850,13 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) CASE f OF OPT.Undef, OPT.String: - | OPT.Byte: IF ~((g IN ({OPT.Byte, OPT.Char} + OPT.intSet)) & (y.size = 1)) THEN err(113) END + | OPT.Byte: IF ~((g IN {OPT.Byte, OPT.Char, OPT.Int}) & (y.size = 1)) THEN err(113) END | OPT.Bool, OPT.Char, OPT.Set: IF g # f THEN err(113) END - | OPT.SInt, - OPT.Int, - OPT.LInt: IF ~(g IN OPT.intSet) OR (x.size < y.size) THEN err(113) END - | OPT.Real: IF ~(g IN {OPT.SInt..OPT.Real}) THEN err(113) END - | OPT.LReal: IF ~(g IN {OPT.SInt..OPT.LReal}) THEN err(113) END + | OPT.Int: IF (g # OPT.Int) OR (x.size < y.size) THEN err(113) END + | OPT.Real: IF ~(g IN {OPT.Int..OPT.Real}) THEN err(113) END + | OPT.LReal: IF ~(g IN {OPT.Int..OPT.LReal}) THEN err(113) END | OPT.Pointer: IF (x = y) OR (g = OPT.NilTyp) OR (x = OPT.sysptrtyp) & (g = OPT.Pointer) THEN (* ok *) ELSIF g = OPT.Pointer THEN p := x^.BaseTyp; q := y^.BaseTyp; @@ -909,7 +903,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) END ELSE OPM.LogWStr("unhandled case in OPB.CheckAssign, f = "); OPM.LogWNum(f, 0); OPM.LogWLn; END ; - IF (ynode^.class = OPT.Nconst) & (g < f) & (g IN {OPT.SInt..OPT.Real}) & (f IN {OPT.Int..OPT.LReal}) THEN + IF (ynode^.class = OPT.Nconst) & (g < f) & (g IN {OPT.Int..OPT.Real}) & (f IN {OPT.Int..OPT.LReal}) THEN Convert(ynode, x) END END CheckAssign; @@ -928,7 +922,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) BEGIN x := par0; f := x^.typ^.form; CASE fctno OF |OPT.haltfn: (*HALT*) - IF (f IN OPT.intSet) & (x^.class = OPT.Nconst) THEN + IF (f = OPT.Int) & (x^.class = OPT.Nconst) THEN IF (OPM.MinHaltNr <= x^.conval^.intval) & (x^.conval^.intval <= OPM.MaxHaltNr) THEN BindNodes(OPT.Ntrap, OPT.notyp, x, x) ELSE err(218) @@ -974,9 +968,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) CASE f OF OPT.Bool: x := NewBoolConst(FALSE) | OPT.Char: x := NewIntConst(0); x^.typ := OPT.chartyp - | OPT.SInt, - OPT.Int, - OPT.LInt: x := NewIntConst(OPM.SignedMinimum(x.typ.size)) + | OPT.Int: x := NewIntConst(OPM.SignedMinimum(x.typ.size)) | OPT.Set: x := NewIntConst(0); x^.typ := OPT.inttyp | OPT.Real: x := NewRealConst(OPM.MinReal, OPT.realtyp) | OPT.LReal: x := NewRealConst(OPM.MinLReal, OPT.lrltyp) @@ -989,9 +981,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) CASE f OF OPT.Bool: x := NewBoolConst(TRUE) | OPT.Char: x := NewIntConst(0FFH); x^.typ := OPT.chartyp - | OPT.SInt, - OPT.Int, - OPT.LInt: x := NewIntConst(OPM.SignedMaximum(x.typ.size)) + | OPT.Int: x := NewIntConst(OPM.SignedMaximum(x.typ.size)) | OPT.Set: x := NewIntConst(OPM.MaxSet); x^.typ := OPT.inttyp | OPT.Real: x := NewRealConst(OPM.MaxReal, OPT.realtyp) | OPT.LReal: x := NewRealConst(OPM.MaxLReal, OPT.lrltyp) @@ -1001,12 +991,12 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) END |OPT.chrfn: (*CHR*) IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) - ELSIF f IN {OPT.Undef} + OPT.intSet THEN Convert(x, OPT.chartyp) + ELSIF f IN {OPT.Undef, OPT.Int} THEN Convert(x, OPT.chartyp) ELSE err(111); x^.typ := OPT.chartyp END |OPT.shortfn: (*SHORT*) IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) - ELSIF f IN OPT.intSet THEN + ELSIF f = OPT.Int THEN typ := OPT.ShorterOrLongerType(x.typ, -1); IF typ = NIL THEN err(111) ELSE Convert(x, typ) END ELSIF f = OPT.LReal THEN Convert(x, OPT.realtyp) @@ -1014,7 +1004,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) END |OPT.longfn: (*LONG*) IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) - ELSIF f IN OPT.intSet THEN + ELSIF f = OPT.Int THEN typ := OPT.ShorterOrLongerType(x.typ, 1); IF typ = NIL THEN err(111) ELSE Convert(x, typ) END ELSIF f = OPT.Real THEN Convert(x, OPT.lrltyp) @@ -1024,7 +1014,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) |OPT.incfn, OPT.decfn: (*INC, DEC*) IF NotVar(x) THEN err(112) - ELSIF ~(f IN OPT.intSet) THEN err(111) + ELSIF f # OPT.Int THEN err(111) ELSIF x^.readonly THEN err(76) END |OPT.inclfn, @@ -1043,7 +1033,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) END |OPT.ashfn: (*ASH*) IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) - ELSIF f IN OPT.intSet THEN + ELSIF f = OPT.Int THEN IF x.typ.size # OPM.LIntSize THEN Convert(x, OPT.linttyp) END ELSE err(111); x^.typ := OPT.linttyp END @@ -1061,19 +1051,19 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) |OPT.lshfn, OPT.rotfn: (*SYSTEM.LSH, SYSTEM.ROT*) IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) - ELSIF ~(f IN OPT.intSet + {OPT.Byte, OPT.Char, OPT.Set}) THEN err(111) + ELSIF ~(f IN {OPT.Int, OPT.Byte, OPT.Char, OPT.Set}) THEN err(111) END |OPT.getfn, OPT.putfn, OPT.bitfn, OPT.movefn: (*SYSTEM.GET, SYSTEM.PUT, SYSTEM.BIT, SYSTEM.MOVE*) IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) - ELSIF (x^.class = OPT.Nconst) & (f IN OPT.intSet) & (x.typ.size < OPT.linttyp.size) THEN Convert(x, OPT.linttyp) - ELSIF ~((x.typ.form IN {OPT.Pointer} + OPT.intSet) & (x.typ.size = OPM.PointerSize)) THEN err(111); x^.typ := OPT.linttyp + ELSIF (x^.class = OPT.Nconst) & (f = OPT.Int) & (x.typ.size < OPT.linttyp.size) THEN Convert(x, OPT.linttyp) + ELSIF ~((x.typ.form IN {OPT.Pointer, OPT.Int}) & (x.typ.size = OPM.PointerSize)) THEN err(111); x^.typ := OPT.linttyp END |OPT.getrfn, OPT.putrfn: (*SYSTEM.GETREG, SYSTEM.PUTREG*) - IF (f IN OPT.intSet) & (x^.class = OPT.Nconst) THEN + IF (f = OPT.Int) & (x^.class = OPT.Nconst) THEN IF (x^.conval^.intval < OPM.MinRegNr) OR (x^.conval^.intval > OPM.MaxRegNr) THEN err(220) END ELSE err(69) END @@ -1114,7 +1104,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126); p^.typ := OPT.notyp ELSE IF x^.typ # p^.typ THEN - IF (x^.class = OPT.Nconst) & (f IN OPT.intSet) THEN Convert(x, p^.typ) + IF (x^.class = OPT.Nconst) & (f = OPT.Int) THEN Convert(x, p^.typ) ELSE err(111) END END ; @@ -1124,7 +1114,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) |OPT.inclfn, OPT.exclfn: (*INCL, EXCL*) IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) - ELSIF f IN OPT.intSet THEN + ELSIF f = OPT.Int THEN IF (x^.class = OPT.Nconst) & ((0 > x^.conval^.intval) OR (x^.conval^.intval > OPM.MaxSet)) THEN err(202) END ; p := NewOp(OPT.Nassign, fctno, p, x) @@ -1132,7 +1122,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) END ; p^.typ := OPT.notyp |OPT.lenfn: (*LEN*) - IF ~(f IN OPT.intSet) OR (x^.class # OPT.Nconst) THEN err(69) + IF ~(f = OPT.Int) OR (x^.class # OPT.Nconst) THEN err(69) ELSIF x.typ.size = 1 THEN (* Hard limit of 127 dimensions *) L := SHORT(x^.conval^.intval); typ := p^.typ; WHILE (L > 0) & (typ^.comp IN {OPT.DynArr, OPT.Array}) DO typ := typ^.BaseTyp; DEC(L) END ; @@ -1156,7 +1146,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) p^.typ := OPT.notyp |OPT.ashfn: (*ASH*) IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) - ELSIF f IN OPT.intSet THEN + ELSIF f = OPT.Int THEN IF (p^.class = OPT.Nconst) & (x^.class = OPT.Nconst) THEN IF (-maxExp > x^.conval^.intval) OR (x^.conval^.intval > maxExp) THEN err(208); p^.conval^.intval := 1 ELSIF x^.conval^.intval >= 0 THEN @@ -1174,7 +1164,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) |OPT.newfn: (*NEW(p, x...)*) IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) ELSIF p^.typ^.comp = OPT.DynArr THEN - IF f IN OPT.intSet THEN + IF f = OPT.Int THEN IF (x^.class = OPT.Nconst) & ((x^.conval^.intval <= 0) OR (x^.conval^.intval > OPM.MaxIndex)) THEN err(63) END ELSE err(111) END ; @@ -1184,7 +1174,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) |OPT.lshfn, OPT.rotfn: (*SYSTEM.LSH, SYSTEM.ROT*) IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) - ELSIF ~(f IN OPT.intSet) THEN err(111) + ELSIF f # OPT.Int THEN err(111) ELSE IF fctno = OPT.lshfn THEN p := NewOp(OPT.Ndop, OPT.lsh, p, x) ELSE p := NewOp(OPT.Ndop, OPT.rot, p, x) END ; p^.typ := p^.left^.typ @@ -1205,7 +1195,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) p^.typ := OPT.notyp |OPT.bitfn: (*SYSTEM.BIT*) IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) - ELSIF f IN OPT.intSet THEN + ELSIF f = OPT.Int THEN p := NewOp(OPT.Ndop, OPT.bit, p, x) ELSE err(111) END ; @@ -1229,19 +1219,19 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) x^.typ := p^.typ; p := x |OPT.sysnewfn: (*SYSTEM.NEW*) IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) - ELSIF f IN OPT.intSet THEN + ELSIF f = OPT.Int THEN p := NewOp(OPT.Nassign, OPT.sysnewfn, p, x) ELSE err(111) END ; p^.typ := OPT.notyp |OPT.movefn: (*SYSTEM.MOVE*) IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) - ELSIF (x^.class = OPT.Nconst) & (f IN OPT.intSet) & (x.typ.size < OPT.linttyp.size) THEN Convert(x, OPT.linttyp) - ELSIF ~((x.typ.form IN {OPT.Pointer} + OPT.intSet) & (x.typ.size = OPM.PointerSize)) THEN err(111); x^.typ := OPT.linttyp + ELSIF (x^.class = OPT.Nconst) & (f = OPT.Int) & (x.typ.size < OPT.linttyp.size) THEN Convert(x, OPT.linttyp) + ELSIF ~((x.typ.form IN {OPT.Pointer, OPT.Int}) & (x.typ.size = OPM.PointerSize)) THEN err(111); x^.typ := OPT.linttyp END; p^.link := x |OPT.assertfn: (*ASSERT*) - IF (f IN OPT.intSet) & (x^.class = OPT.Nconst) THEN + IF (f = OPT.Int) & (x^.class = OPT.Nconst) THEN IF (OPM.MinHaltNr <= x^.conval^.intval) & (x^.conval^.intval <= OPM.MaxHaltNr) THEN BindNodes(OPT.Ntrap, OPT.notyp, x, x); x^.conval := OPT.NewConst(); x^.conval^.intval := OPM.errpos; @@ -1266,7 +1256,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) IF fctno = OPT.newfn THEN (*NEW(p, ..., x...*) IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) ELSIF p^.typ^.comp # OPT.DynArr THEN err(64) - ELSIF f IN OPT.intSet THEN + ELSIF f = OPT.Int THEN IF (x^.class = OPT.Nconst) & ((x^.conval^.intval <= 0) OR (x^.conval^.intval > OPM.MaxIndex)) THEN err(63) END ; node := p^.right; WHILE node^.link # NIL DO node := node^.link END; node^.link := x; p^.typ := p^.typ^.BaseTyp @@ -1274,7 +1264,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) END ELSIF (fctno = OPT.movefn) & (n = 2) THEN (*SYSTEM.MOVE*) IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) - ELSIF f IN OPT.intSet THEN + ELSIF f = OPT.Int THEN node := OPT.NewNode(OPT.Nassign); node^.subcl := OPT.movefn; node^.right := p; node^.left := p^.link; p^.link := x; p := node ELSE err(111) @@ -1333,7 +1323,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) BEGIN (* ftyp^.comp = OPT.DynArr *) f := atyp^.comp; ftyp := ftyp^.BaseTyp; atyp := atyp^.BaseTyp; IF fvarpar & (ftyp = OPT.bytetyp) THEN (* ok, but ... *) - IF ~(f IN {OPT.Array, OPT.DynArr}) OR ~((atyp.form IN {OPT.Byte..OPT.Char} + OPT.intSet) & (atyp.size = 1)) THEN + IF ~(f IN {OPT.Array, OPT.DynArr}) OR ~((atyp.form IN {OPT.Byte..OPT.Char, OPT.Int}) & (atyp.size = 1)) THEN IF OPM.verbose IN OPM.opt THEN err(-301) END END ELSIF f IN {OPT.Array, OPT.DynArr} THEN @@ -1386,7 +1376,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) WHILE (q # fp^.typ) & (q # NIL) & (q # OPT.undftyp) DO q := q^.BaseTyp END ; IF q = NIL THEN err(111) END ELSIF (fp^.typ = OPT.sysptrtyp) & (ap^.typ^.form = OPT.Pointer) THEN (* ok *) - ELSIF (ap^.typ # fp^.typ) & ~((fp^.typ^.form = OPT.Byte) & ((ap.typ.form IN {OPT.Byte..OPT.Char} + OPT.intSet) & (ap.typ.size = 1))) THEN err(123) + ELSIF (ap^.typ # fp^.typ) & ~((fp^.typ^.form = OPT.Byte) & ((ap.typ.form IN {OPT.Byte..OPT.Char, OPT.Int}) & (ap.typ.size = 1))) THEN err(123) ELSIF (fp^.typ^.form = OPT.Pointer) & (ap^.class = OPT.Nguard) THEN err(123) END ELSIF fp^.typ^.comp = OPT.DynArr THEN diff --git a/src/compiler/OPC.Mod b/src/compiler/OPC.Mod index ea629ba1..50ba59a0 100644 --- a/src/compiler/OPC.Mod +++ b/src/compiler/OPC.Mod @@ -1237,9 +1237,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) OPM.WriteString('case '); CASE form OF | OPT.Char: CharacterLiteral(caseVal) - | OPT.SInt, - OPT.Int, - OPT.LInt: OPM.WriteInt(caseVal); + | OPT.Int: OPM.WriteInt(caseVal); ELSE OPM.LogWStr("unhandled case in OPC.Case, form = "); OPM.LogWNum(form, 0); OPM.LogWLn; END; OPM.WriteString(': '); @@ -1295,9 +1293,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) | OPT.Byte: OPM.WriteInt(con^.intval) | OPT.Bool: OPM.WriteInt(con^.intval) | OPT.Char: CharacterLiteral(con.intval) - | OPT.SInt, - OPT.Int, - OPT.LInt: OPM.WriteInt(con^.intval) + | OPT.Int: OPM.WriteInt(con^.intval) | OPT.Real: OPM.WriteReal(con^.realval, "f") | OPT.LReal: OPM.WriteReal(con^.realval, 0X) | OPT.Set: OPM.WriteString("0x"); diff --git a/src/compiler/OPP.Mod b/src/compiler/OPP.Mod index 4e53ad05..84966442 100644 --- a/src/compiler/OPP.Mod +++ b/src/compiler/OPP.Mod @@ -74,7 +74,7 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) IF sym = OPS.lbrak THEN OPS.Get(sym); IF ~OPT.SYSimported THEN err(135) END; ConstExpression(x); - IF x^.typ^.form IN OPT.intSet THEN sf := x^.conval^.intval; + IF x^.typ^.form = OPT.Int THEN sf := x^.conval^.intval; IF (sf < 0) OR (sf > OPM.MaxSysFlag) THEN err(220); sf := 0 END ELSE err(51); sf := 0 END ; @@ -152,7 +152,7 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) END ELSE typ := OPT.NewStr(OPT.Comp, OPT.Array); typ^.sysflag := sysflag; ConstExpression(x); - IF x^.typ^.form IN OPT.intSet THEN n := x^.conval^.intval; + IF x^.typ^.form = OPT.Int THEN n := x^.conval^.intval; IF (n <= 0) OR (n > OPM.MaxIndex) THEN err(63); n := 1 END ELSE err(51); n := 1 END ; @@ -669,16 +669,16 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) VAR x, y, lastlab: OPT.Node; i, f: INTEGER; xval, yval: LONGINT; BEGIN lab := NIL; lastlab := NIL; LOOP ConstExpression(x); f := x^.typ^.form; - IF f IN OPT.intSet + {OPT.Char} THEN xval := x^.conval^.intval + IF f IN {OPT.Int, OPT.Char} THEN xval := x^.conval^.intval ELSE err(61); xval := 1 END; - IF f IN OPT.intSet THEN - IF ~(LabelTyp.form IN OPT.intSet) OR (LabelTyp.size < x.typ.size) THEN err(60) END + IF f = OPT.Int THEN + IF ~(LabelTyp.form = OPT.Int) OR (LabelTyp.size < x.typ.size) THEN err(60) END ELSIF LabelTyp.form # f THEN err(60) END ; IF sym = OPS.upto THEN OPS.Get(sym); ConstExpression(y); yval := y^.conval^.intval; - IF (y^.typ^.form # f) & ~((f IN OPT.intSet) & (y^.typ^.form IN OPT.intSet)) THEN err(60) END ; + IF (y^.typ^.form # f) & ~((f = OPT.Int) & (y^.typ^.form = OPT.Int)) THEN err(60) END ; IF yval < xval THEN err(63); yval := xval END ELSE yval := xval END ; @@ -714,7 +714,7 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) BEGIN Expression(x); pos := OPM.errpos; IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) - ELSIF ~(x^.typ^.form IN {OPT.Char..OPT.LInt}) THEN err(125) + ELSIF ~(x^.typ^.form IN {OPT.Char..OPT.Int}) THEN err(125) END ; CheckSym(OPS.of); cases := NIL; lastcase := NIL; n := 0; LOOP @@ -802,7 +802,7 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) ELSIF sym = OPS.for THEN OPS.Get(sym); IF sym = OPS.ident THEN qualident(id); - IF ~(id^.typ^.form IN OPT.intSet) THEN err(68) END ; + IF ~(id^.typ^.form = OPT.Int) THEN err(68) END ; CheckSym(OPS.becomes); Expression(y); pos := OPM.errpos; x := OPB.NewLeaf(id); OPB.Assign(x, y); SetPos(x); CheckSym(OPS.to); Expression(y); pos := OPM.errpos; @@ -817,7 +817,7 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) END ; z := OPB.NewLeaf(t); OPB.Assign(z, y); SetPos(z); OPB.Link(stat, last, z); y := OPB.NewLeaf(t) - ELSIF ~(y^.typ^.form IN OPT.intSet) OR (y.typ.size > x.left.typ.size) THEN err(113) + ELSIF ~(y^.typ^.form = OPT.Int) OR (y.typ.size > x.left.typ.size) THEN err(113) END ; OPB.Link(stat, last, x); IF sym = OPS.by THEN OPS.Get(sym); ConstExpression(z) ELSE z := OPB.NewIntConst(1) END ; diff --git a/src/compiler/OPT.Mod b/src/compiler/OPT.Mod index 4b1eda69..82c1b477 100644 --- a/src/compiler/OPT.Mod +++ b/src/compiler/OPT.Mod @@ -91,12 +91,12 @@ TYPE CONST (* Struct.form values *) Undef* = 0; Byte* = 1; Bool* = 2; Char* = 3; - SInt* = 4; Int* = 5; LInt* = 6; + Int* = 5; Real* = 7; LReal* = 8; Set* = 9; String* = 10; NilTyp* = 11; NoTyp* = 12; Pointer* = 13; ProcTyp* = 14; Comp* = 15; - intSet* = {SInt..LInt}; realSet* = {Real, LReal}; + realSet* = {Real, LReal}; (* Struct.comp - Composite structure forms *) Basic* = 1; Array* = 2; DynArr* = 3; Record* = 4; @@ -224,7 +224,7 @@ END IntType; PROCEDURE ShorterOrLongerType*(x: Struct; dir: INTEGER): Struct; VAR i: INTEGER; BEGIN - ASSERT(x.form IN intSet); + ASSERT(x.form = Int); ASSERT((dir = 1) OR (dir = -1)); (* Not sure if StPar0 (which calls this) always gets the baseiest type. This ASSERT will tell me. *) @@ -517,9 +517,7 @@ BEGIN CASE f OF | Bool, Char, - SInt, - Int, - LInt: OPM.FPrint(fprint, obj^.conval^.intval) + Int: OPM.FPrint(fprint, obj^.conval^.intval) | Set: OPM.FPrintSet(fprint, obj^.conval^.setval) | Real: rval := SHORT(obj^.conval^.realval); OPM.FPrintReal(fprint, rval) | LReal: OPM.FPrintLReal(fprint, obj^.conval^.realval) @@ -632,9 +630,7 @@ BEGIN | Byte, Char, Bool: OPM.SymRCh(ch); conval^.intval := ORD(ch) - | SInt, - Int, - LInt: conval^.intval := OPM.SymRInt() + | Int: conval^.intval := OPM.SymRInt() | Set: OPM.SymRSet(conval^.setval) | Real: OPM.SymRReal(rval); conval^.realval := rval; conval^.intval := OPM.ConstNotAlloc @@ -706,7 +702,7 @@ END InTProc; PROCEDURE InTyp(tag: LONGINT): Struct; BEGIN - IF tag IN intSet THEN + IF tag = Int THEN RETURN IntType(OPM.SymRInt()) ELSE RETURN impCtxt.ref[tag] @@ -1027,7 +1023,7 @@ END Import; VAR strobj: Object; BEGIN IF (typ^.ref < expCtxt.ref) THEN OPM.SymWInt(-typ^.ref); - IF typ.ref IN intSet THEN OPM.SymWInt(typ.size) END + IF typ.ref = Int THEN OPM.SymWInt(typ.size) END ELSE OPM.SymWInt(Sstruct); typ^.ref := expCtxt.ref; INC(expCtxt.ref); @@ -1072,9 +1068,7 @@ END Import; CASE f OF | Bool, Char: OPM.SymWCh(CHR(obj^.conval^.intval)) - | SInt, - Int, - LInt: OPM.SymWInt(obj^.conval^.intval); OPM.SymWInt(obj.typ.size) + | Int: OPM.SymWInt(obj^.conval^.intval); OPM.SymWInt(obj.typ.size) | Set: OPM.SymWSet(obj^.conval^.setval) | Real: rval := SHORT(obj^.conval^.realval); OPM.SymWReal(rval) | LReal: OPM.SymWLReal(obj^.conval^.realval) @@ -1222,7 +1216,8 @@ BEGIN topScope := NIL; OpenScope(0, NIL); OPM.errpos := 0; (*EnterTyp("LONGINT", LInt, OPM.LIntSize, linttyp);*) EnterTyp("LONGINT", Int, OPM.LIntSize, linttyp); EnterTyp("LONGREAL", LReal, OPM.LRealSize, lrltyp); - EnterTyp("SHORTINT", SInt, OPM.SIntSize, sinttyp); +(*EnterTyp("SHORTINT", SInt, OPM.SIntSize, sinttyp);*) + EnterTyp("SHORTINT", Int, OPM.SIntSize, sinttyp); EnterBoolConst("FALSE", 0); (* 0 and 1 are compiler internal representation only *) EnterBoolConst("TRUE", 1); @@ -1253,9 +1248,9 @@ BEGIN topScope := NIL; OpenScope(0, NIL); OPM.errpos := 0; impCtxt.ref[Byte] := bytetyp; impCtxt.ref[Bool] := booltyp; impCtxt.ref[Char] := chartyp; - impCtxt.ref[SInt] := sinttyp; +(*impCtxt.ref[SInt] := sinttyp;*) impCtxt.ref[Int] := inttyp; - impCtxt.ref[LInt] := linttyp; +(*impCtxt.ref[LInt] := linttyp;*) impCtxt.ref[Real] := realtyp; impCtxt.ref[LReal] := lrltyp; impCtxt.ref[Set] := settyp; diff --git a/src/compiler/OPV.Mod b/src/compiler/OPV.Mod index 997fdccb..6eb2ffb0 100644 --- a/src/compiler/OPV.Mod +++ b/src/compiler/OPV.Mod @@ -297,7 +297,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 PROCEDURE SizeCast(from, to: LONGINT); BEGIN - IF (from # to) & ((from > OPM.CIntSize) OR (to > OPM.CIntSize)) THEN + IF (from # to) & ((from > OPM.CIntSize) OR (to # OPM.CIntSize)) THEN CASE to OF |1: OPM.WriteString("(SYSTEM_INT8)"); |2: OPM.WriteString("(SYSTEM_INT16)"); @@ -312,7 +312,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 VAR from, to: INTEGER; BEGIN from := n^.typ^.form; to := newtype.form; IF to = OPT.Set THEN OPM.WriteString(SetOfFunc); Entier(n, MinPrec); OPM.Write(CloseParen) - ELSIF to IN OPT.intSet THEN + ELSIF to = OPT.Int THEN IF (newtype.size < n.typ.size) & (OPM.ranchk IN OPM.opt) THEN OPM.WriteString("__SHORT"); IF SideEffects(n) THEN OPM.Write("F") END; OPM.Write(OpenParen); Entier(n, MinPrec); OPM.WriteString(Comma); @@ -474,13 +474,9 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 OPM.WriteString("(void*)") (* type extension *) END ELSE - IF (form IN {OPT.Real, OPT.LReal}) & (n^.typ^.form IN OPT.intSet) THEN (* real promotion *) + IF (form IN {OPT.Real, OPT.LReal}) & (n^.typ^.form = OPT.Int) THEN (* real promotion *) OPM.WriteString("(double)"); prec := 9 - (* - ELSIF (form IN OPT.intSet) & (typ.size = OPM.LIntSize) & (n.typ.form <= OPT.LInt) & (n.typ.size < OPM.LIntSize) THEN (* integral promotion *) - OPM.WriteString("(LONGINT)"); prec := 9 - *) - ELSIF form IN OPT.intSet THEN + ELSIF form = OPT.Int THEN SizeCast(n.typ.size, typ.size) END END @@ -490,7 +486,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 END; IF (mode = OPT.VarPar) & (n^.class = OPT.Nmop) & (n^.subcl = OPT.val) THEN expr(n^.left, prec) (* avoid cast in lvalue *) - ELSIF (form IN OPT.intSet) & (n^.class = OPT.Nconst) THEN + ELSIF (form = OPT.Int) & (n^.class = OPT.Nconst) THEN ParIntLiteral(n.conval.intval, n.typ.size) ELSE expr(n, prec) @@ -582,8 +578,8 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 expr(l, exprPrec) END | OPT.val: IF ~(l^.class IN {OPT.Nvar, OPT.Nvarpar, OPT.Nfield, OPT.Nindex}) (*SYSTEM*) - OR (n^.typ^.form IN {OPT.LInt, OPT.Pointer, OPT.Set, OPT.ProcTyp}) - & (l^.typ^.form IN {OPT.LInt, OPT.Pointer, OPT.Set, OPT.ProcTyp}) + OR (n^.typ^.form IN {OPT.Int, OPT.Pointer, OPT.Set, OPT.ProcTyp}) + & (l^.typ^.form IN {OPT.Int, OPT.Pointer, OPT.Set, OPT.ProcTyp}) & (n^.typ^.size = l^.typ^.size) THEN OPM.Write(OpenParen); OPC.Ident(n^.typ^.strobj); OPM.Write(CloseParen); @@ -670,7 +666,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 END | OPS.slash: IF form = OPT.Set THEN OPM.WriteString(" ^ ") ELSE OPM.WriteString(" / "); - IF (r^.obj = NIL) OR (r^.obj^.typ^.form IN OPT.intSet) THEN + IF (r^.obj = NIL) OR (r^.obj^.typ^.form = OPT.Int) THEN OPM.Write(OpenParen); OPC.Ident(n^.typ^.strobj); OPM.Write(CloseParen) END END From 68cf60c4011c5dc4f7c58b35a680ce9f4eb57b81 Mon Sep 17 00:00:00 2001 From: David Brown Date: Wed, 31 Aug 2016 18:46:03 +0100 Subject: [PATCH 205/580] Renumber forms removing gaps for SInt and LInt. --- src/compiler/OPT.Mod | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/src/compiler/OPT.Mod b/src/compiler/OPT.Mod index 82c1b477..a60f30f8 100644 --- a/src/compiler/OPT.Mod +++ b/src/compiler/OPT.Mod @@ -91,10 +91,10 @@ TYPE CONST (* Struct.form values *) Undef* = 0; Byte* = 1; Bool* = 2; Char* = 3; - Int* = 5; - Real* = 7; LReal* = 8; Set* = 9; String* = 10; - NilTyp* = 11; NoTyp* = 12; Pointer* = 13; ProcTyp* = 14; - Comp* = 15; + Int* = 4; + Real* = 5; LReal* = 6; Set* = 7; String* = 8; + NilTyp* = 9; NoTyp* = 10; Pointer* = 11; ProcTyp* = 12; + Comp* = 13; realSet* = {Real, LReal}; @@ -1213,10 +1213,8 @@ BEGIN topScope := NIL; OpenScope(0, NIL); OPM.errpos := 0; EnterTyp("SET", Set, OPM.SetSize, settyp); EnterTyp("REAL", Real, OPM.RealSize, realtyp); EnterTyp("INTEGER", Int, OPM.IntSize, inttyp); -(*EnterTyp("LONGINT", LInt, OPM.LIntSize, linttyp);*) EnterTyp("LONGINT", Int, OPM.LIntSize, linttyp); EnterTyp("LONGREAL", LReal, OPM.LRealSize, lrltyp); -(*EnterTyp("SHORTINT", SInt, OPM.SIntSize, sinttyp);*) EnterTyp("SHORTINT", Int, OPM.SIntSize, sinttyp); EnterBoolConst("FALSE", 0); (* 0 and 1 are compiler internal representation only *) @@ -1248,9 +1246,7 @@ BEGIN topScope := NIL; OpenScope(0, NIL); OPM.errpos := 0; impCtxt.ref[Byte] := bytetyp; impCtxt.ref[Bool] := booltyp; impCtxt.ref[Char] := chartyp; -(*impCtxt.ref[SInt] := sinttyp;*) impCtxt.ref[Int] := inttyp; -(*impCtxt.ref[LInt] := linttyp;*) impCtxt.ref[Real] := realtyp; impCtxt.ref[LReal] := lrltyp; impCtxt.ref[Set] := settyp; @@ -1297,9 +1293,7 @@ Objects: Byte Basic | Bool Basic | Char Basic | - SInt Basic | - Int Basic | - LInt Basic | + Int Basic | size determine SHORT vs LONG XInt Basic | bits Real Basic | LReal Basic | From 159f5a3d80d05fdc68aee23ff2fffb2d51661a65 Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 1 Sep 2016 12:04:17 +0100 Subject: [PATCH 206/580] Update bootstrap source and snapshot binaries --- bootstrap/unix-44/Configuration.c | 4 +- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Console.c | 2 +- bootstrap/unix-44/Console.h | 2 +- bootstrap/unix-44/Files.c | 2 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 2 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 366 +++++++++++----------- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 68 ++-- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 2 +- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 52 +-- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 132 ++++---- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 74 ++--- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/Vishap.c | 2 +- bootstrap/unix-44/errors.c | 2 +- bootstrap/unix-44/errors.h | 2 +- bootstrap/unix-44/extTools.c | 2 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-44/vt100.c | 2 +- bootstrap/unix-44/vt100.h | 2 +- bootstrap/unix-48/Configuration.c | 4 +- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Console.c | 2 +- bootstrap/unix-48/Console.h | 2 +- bootstrap/unix-48/Files.c | 2 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 2 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 366 +++++++++++----------- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 68 ++-- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 2 +- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 52 +-- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 132 ++++---- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 74 ++--- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/Vishap.c | 2 +- bootstrap/unix-48/errors.c | 2 +- bootstrap/unix-48/errors.h | 2 +- bootstrap/unix-48/extTools.c | 2 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-48/vt100.c | 2 +- bootstrap/unix-48/vt100.h | 2 +- bootstrap/unix-88/Configuration.c | 4 +- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Console.c | 2 +- bootstrap/unix-88/Console.h | 2 +- bootstrap/unix-88/Files.c | 2 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 2 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 366 +++++++++++----------- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 68 ++-- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 2 +- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 52 +-- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 132 ++++---- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 74 ++--- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/Vishap.c | 2 +- bootstrap/unix-88/errors.c | 2 +- bootstrap/unix-88/errors.h | 2 +- bootstrap/unix-88/extTools.c | 2 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/unix-88/vt100.c | 2 +- bootstrap/unix-88/vt100.h | 2 +- bootstrap/windows-48/Configuration.c | 4 +- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Console.c | 2 +- bootstrap/windows-48/Console.h | 2 +- bootstrap/windows-48/Files.c | 2 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 2 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 366 +++++++++++----------- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 68 ++-- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 2 +- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 52 +-- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 132 ++++---- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 74 ++--- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/Vishap.c | 2 +- bootstrap/windows-48/errors.c | 2 +- bootstrap/windows-48/errors.h | 2 +- bootstrap/windows-48/extTools.c | 2 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-48/vt100.c | 2 +- bootstrap/windows-48/vt100.h | 2 +- bootstrap/windows-88/Configuration.c | 4 +- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Console.c | 2 +- bootstrap/windows-88/Console.h | 2 +- bootstrap/windows-88/Files.c | 2 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 2 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 366 +++++++++++----------- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 68 ++-- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 2 +- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 52 +-- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 132 ++++---- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 74 ++--- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Platform.c | 2 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/Vishap.c | 2 +- bootstrap/windows-88/errors.c | 2 +- bootstrap/windows-88/errors.h | 2 +- bootstrap/windows-88/extTools.c | 2 +- bootstrap/windows-88/extTools.h | 2 +- bootstrap/windows-88/vt100.c | 2 +- bootstrap/windows-88/vt100.h | 2 +- src/test/confidence/planned-binary-change | 2 +- 196 files changed, 1906 insertions(+), 1906 deletions(-) diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index eed3c4f0..fb7df026 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -13,6 +13,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/08/31] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/01] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index 90696149..61b33bc5 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Console.c b/bootstrap/unix-44/Console.c index 124f7163..816df1b9 100644 --- a/bootstrap/unix-44/Console.c +++ b/bootstrap/unix-44/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Platform.h" diff --git a/bootstrap/unix-44/Console.h b/bootstrap/unix-44/Console.h index fad0f676..2c01265d 100644 --- a/bootstrap/unix-44/Console.h +++ b/bootstrap/unix-44/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index a6db1a11..bd3e3fd5 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index 61089cbd..985572ec 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index f35765c6..50d17d87 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tskSfF */ #include "SYSTEM.h" struct Heap__1 { diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index 4d5c5b4e..a4e30a5e 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index 9f39f448..52abc5b8 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Heap.h" diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index 1707868f..6bee52c7 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index e6e966a6..a3322969 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" @@ -317,7 +317,7 @@ void OPB_DeRef (OPT_Node *x) typ = (*x)->typ; if ((*x)->class >= 7) { OPB_err(78); - } else if (typ->form == 13) { + } else if (typ->form == 11) { if (typ == OPT_sysptrtyp) { OPB_err(57); } @@ -340,7 +340,7 @@ void OPB_Index (OPT_Node *x, OPT_Node y) f = y->typ->form; if ((*x)->class >= 7) { OPB_err(79); - } else if (f != 5 || __IN(y->class, 0x0300)) { + } else if (f != 4 || __IN(y->class, 0x0300)) { OPB_err(80); y->typ = OPT_inttyp; } @@ -437,10 +437,10 @@ void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) TypTest__57_s = &_s; if (OPB_NotVar(*x)) { OPB_err(112); - } else if ((*x)->typ->form == 13) { + } else if ((*x)->typ->form == 11) { if (((*x)->typ->BaseTyp->comp != 4 && (*x)->typ != OPT_sysptrtyp)) { OPB_err(85); - } else if (obj->typ->form == 13) { + } else if (obj->typ->form == 11) { GTT__58((*x)->typ->BaseTyp, obj->typ->BaseTyp); } else { OPB_err(86); @@ -465,7 +465,7 @@ void OPB_In (OPT_Node *x, OPT_Node y) f = (*x)->typ->form; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); - } else if ((f == 5 && y->typ->form == 9)) { + } else if ((f == 4 && y->typ->form == 7)) { if ((*x)->class == 7) { k = (*x)->conval->intval; if (k < 0 || k > OPM_MaxSet) { @@ -504,7 +504,7 @@ static LONGINT OPB_log (LONGINT x) static void OPB_CheckRealType (INTEGER f, INTEGER nr, OPT_Const x) { LONGREAL min, max, r; - if (f == 7) { + if (f == 5) { min = OPM_MinReal; max = OPM_MaxReal; } else { @@ -515,7 +515,7 @@ static void OPB_CheckRealType (INTEGER f, INTEGER nr, OPT_Const x) if (r > max || r < min) { OPB_err(nr); x->realval = (LONGREAL)1; - } else if (f == 7) { + } else if (f == 5) { x->realval = x->realval; } x->intval = -1; @@ -567,21 +567,21 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } break; case 6: - if (!__IN(f, 0x01a0)) { + if (!__IN(f, 0x70)) { OPB_err(96); } break; case 7: - if (__IN(f, 0x03a0)) { + if (__IN(f, 0xf0)) { if (z->class == 7) { - if (f == 5) { + if (f == 4) { if (z->conval->intval == (-2147483647-1)) { OPB_err(203); } else { z->conval->intval = -z->conval->intval; OPB_SetIntType(z); } - } else if (__IN(f, 0x0180)) { + } else if (__IN(f, 0x60)) { z->conval->realval = -z->conval->realval; } else { z->conval->setval = ~z->conval->setval; @@ -595,9 +595,9 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } break; case 21: - if (__IN(f, 0x01a0)) { + if (__IN(f, 0x70)) { if (z->class == 7) { - if (f == 5) { + if (f == 4) { if (z->conval->intval == (-2147483647-1)) { OPB_err(203); } else { @@ -629,7 +629,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } break; case 23: - if (f == 5) { + if (f == 4) { if (z->class == 7) { z->conval->intval = OPB_BoolToInt(__ODD(z->conval->intval)); z->obj = NIL; @@ -644,9 +644,9 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) case 24: if ((((z->class == 7 && f == 3)) && z->conval->intval >= 32)) { OPB_CharToString(z); - f = 10; + f = 8; } - if (z->class < 7 || f == 10) { + if (z->class < 7 || f == 8) { z = NewOp__29(op, typ, z); } else { OPB_err(127); @@ -654,7 +654,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->typ = OPT_linttyp; break; case 25: - if ((f == 5 && z->class == 7)) { + if ((f == 4 && z->class == 7)) { if ((0 <= z->conval->intval && z->conval->intval <= -1)) { z = NewOp__29(op, typ, z); } else { @@ -681,7 +681,7 @@ static void OPB_CheckPtr (OPT_Node x, OPT_Node y) INTEGER g; OPT_Struct p = NIL, q = NIL, t = NIL; g = y->typ->form; - if (g == 13) { + if (g == 11) { p = x->typ->BaseTyp; q = y->typ->BaseTyp; if ((p->comp == 4 && q->comp == 4)) { @@ -699,7 +699,7 @@ static void OPB_CheckPtr (OPT_Node x, OPT_Node y) } else { OPB_err(100); } - } else if (g != 11) { + } else if (g != 9) { OPB_err(100); } } @@ -716,7 +716,7 @@ void OPB_CheckParameters (OPT_Object fp, OPT_Object ap, BOOLEAN checkNames) at = at->BaseTyp; } if (ft != at) { - if ((ft->form == 14 && at->form == 14)) { + if ((ft->form == 12 && at->form == 12)) { if (ft->BaseTyp == at->BaseTyp) { OPB_CheckParameters(ft->link, at->link, 0); } else { @@ -777,7 +777,7 @@ static INTEGER ConstCmp__14 (void) case 0: res = 9; break; - case 1: case 3: case 4: case 5: + case 1: case 3: case 4: if ((*ConstOp__13_s->xval)->intval < (*ConstOp__13_s->yval)->intval) { res = 11; } else if ((*ConstOp__13_s->xval)->intval > (*ConstOp__13_s->yval)->intval) { @@ -786,7 +786,7 @@ static INTEGER ConstCmp__14 (void) res = 9; } break; - case 7: case 8: + case 5: case 6: if ((*ConstOp__13_s->xval)->realval < (*ConstOp__13_s->yval)->realval) { res = 11; } else if ((*ConstOp__13_s->xval)->realval > (*ConstOp__13_s->yval)->realval) { @@ -802,14 +802,14 @@ static INTEGER ConstCmp__14 (void) res = 9; } break; - case 9: + case 7: if ((*ConstOp__13_s->xval)->setval != (*ConstOp__13_s->yval)->setval) { res = 10; } else { res = 9; } break; - case 10: + case 8: if (__STRCMP(*(*ConstOp__13_s->xval)->ext, *(*ConstOp__13_s->yval)->ext) < 0) { res = 11; } else if (__STRCMP(*(*ConstOp__13_s->xval)->ext, *(*ConstOp__13_s->yval)->ext) > 0) { @@ -818,7 +818,7 @@ static INTEGER ConstCmp__14 (void) res = 9; } break; - case 11: case 13: case 14: + case 9: case 11: case 12: if ((*ConstOp__13_s->xval)->intval != (*ConstOp__13_s->yval)->intval) { res = 10; } else { @@ -856,7 +856,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) if (f != g) { switch (f) { case 3: - if (g == 10) { + if (g == 8) { OPB_CharToString(x); } else { OPB_err(100); @@ -864,17 +864,17 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) __GUARDEQP(yval, OPT_ConstDesc) = *xval; } break; - case 5: - if (g == 5) { + case 4: + if (g == 4) { if (x->typ->size <= y->typ->size) { x->typ = y->typ; } else { x->typ = OPT_IntType(x->typ->size); } - } else if (g == 7) { + } else if (g == 5) { x->typ = OPT_realtyp; xval->realval = xval->intval; - } else if (g == 8) { + } else if (g == 6) { x->typ = OPT_lrltyp; xval->realval = xval->intval; } else { @@ -883,11 +883,11 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) __GUARDEQP(yval, OPT_ConstDesc) = *xval; } break; - case 7: - if (g == 5) { + case 5: + if (g == 4) { y->typ = x->typ; yval->realval = yval->intval; - } else if (g == 8) { + } else if (g == 6) { x->typ = OPT_lrltyp; } else { OPB_err(100); @@ -895,11 +895,11 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) __GUARDEQP(yval, OPT_ConstDesc) = *xval; } break; - case 8: - if (g == 5) { + case 6: + if (g == 4) { y->typ = x->typ; yval->realval = yval->intval; - } else if (g == 7) { + } else if (g == 5) { y->typ = OPT_lrltyp; } else { OPB_err(100); @@ -907,26 +907,26 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) __GUARDEQP(yval, OPT_ConstDesc) = *xval; } break; - case 10: + case 8: if (g == 3) { OPB_CharToString(y); - g = 10; + g = 8; } else { OPB_err(100); y->typ = x->typ; __GUARDEQP(yval, OPT_ConstDesc) = *xval; } break; - case 11: - if (!__IN(g, 0x6000)) { + case 9: + if (!__IN(g, 0x1800)) { OPB_err(100); } break; - case 13: + case 11: OPB_CheckPtr(x, y); break; - case 14: - if (g != 11) { + case 12: + if (g != 9) { OPB_err(100); } break; @@ -940,7 +940,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } switch (op) { case 1: - if (f == 5) { + if (f == 4) { xv = xval->intval; yv = yval->intval; if (((((xv == 0 || yv == 0) || (((xv > 0 && yv > 0)) && yv <= __DIV(2147483647, xv))) || (((xv > 0 && yv < 0)) && yv >= __DIV((-2147483647-1), xv))) || (((xv < 0 && yv > 0)) && xv >= __DIV((-2147483647-1), yv))) || (((((((xv < 0 && yv < 0)) && xv != (-2147483647-1))) && yv != (-2147483647-1))) && -xv <= __DIV(2147483647, -yv))) { @@ -949,7 +949,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } else { OPB_err(204); } - } else if (__IN(f, 0x0180)) { + } else if (__IN(f, 0x60)) { temp = __ABS(yval->realval) <= (LONGREAL)1; if (temp || __ABS(xval->realval) <= 1.79769296342094e+308 / (LONGREAL)__ABS(yval->realval)) { xval->realval = xval->realval * yval->realval; @@ -957,23 +957,23 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } else { OPB_err(204); } - } else if (f == 9) { + } else if (f == 7) { xval->setval = (xval->setval & yval->setval); } else if (f != 0) { OPB_err(101); } break; case 2: - if (f == 5) { + if (f == 4) { if (yval->intval != 0) { xval->realval = xval->intval / (REAL)yval->intval; - OPB_CheckRealType(7, 205, xval); + OPB_CheckRealType(5, 205, xval); } else { OPB_err(205); xval->realval = (LONGREAL)1; } x->typ = OPT_realtyp; - } else if (__IN(f, 0x0180)) { + } else if (__IN(f, 0x60)) { temp = __ABS(yval->realval) >= (LONGREAL)1; if (temp || __ABS(xval->realval) <= 1.79769296342094e+308 * __ABS(yval->realval)) { xval->realval = xval->realval / yval->realval; @@ -981,14 +981,14 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } else { OPB_err(205); } - } else if (f == 9) { + } else if (f == 7) { xval->setval = xval->setval ^ yval->setval; } else if (f != 0) { OPB_err(102); } break; case 3: - if (f == 5) { + if (f == 4) { if (yval->intval != 0) { xval->intval = __DIV(xval->intval, yval->intval); OPB_SetIntType(x); @@ -1000,7 +1000,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 4: - if (f == 5) { + if (f == 4) { if (yval->intval != 0) { xval->intval = (int)__MOD(xval->intval, yval->intval); OPB_SetIntType(x); @@ -1019,7 +1019,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 6: - if (f == 5) { + if (f == 4) { temp = (yval->intval >= 0 && xval->intval <= 2147483647 - yval->intval); if (temp || (yval->intval < 0 && xval->intval >= (-2147483647-1) - yval->intval)) { xval->intval += yval->intval; @@ -1027,7 +1027,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } else { OPB_err(206); } - } else if (__IN(f, 0x0180)) { + } else if (__IN(f, 0x60)) { temp = (yval->realval >= (LONGREAL)0 && xval->realval <= 1.79769296342094e+308 - yval->realval); if (temp || (yval->realval < (LONGREAL)0 && xval->realval >= -1.79769296342094e+308 - yval->realval)) { xval->realval = xval->realval + yval->realval; @@ -1035,21 +1035,21 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } else { OPB_err(206); } - } else if (f == 9) { + } else if (f == 7) { xval->setval = xval->setval | yval->setval; } else if (f != 0) { OPB_err(105); } break; case 7: - if (f == 5) { + if (f == 4) { if ((yval->intval >= 0 && xval->intval >= (-2147483647-1) + yval->intval) || (yval->intval < 0 && xval->intval <= 2147483647 + yval->intval)) { xval->intval -= yval->intval; OPB_SetIntType(x); } else { OPB_err(207); } - } else if (__IN(f, 0x0180)) { + } else if (__IN(f, 0x60)) { temp = (yval->realval >= (LONGREAL)0 && xval->realval >= -1.79769296342094e+308 + yval->realval); if (temp || (yval->realval < (LONGREAL)0 && xval->realval <= 1.79769296342094e+308 + yval->realval)) { xval->realval = xval->realval - yval->realval; @@ -1057,7 +1057,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } else { OPB_err(207); } - } else if (f == 9) { + } else if (f == 7) { xval->setval = (xval->setval & ~yval->setval); } else if (f != 0) { OPB_err(106); @@ -1077,28 +1077,28 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) xval->intval = OPB_BoolToInt(ConstCmp__14() != 9); break; case 11: - if (__IN(f, 0x2a04)) { + if (__IN(f, 0x0a84)) { OPB_err(108); } else { xval->intval = OPB_BoolToInt(ConstCmp__14() == 11); } break; case 12: - if (__IN(f, 0x2a04)) { + if (__IN(f, 0x0a84)) { OPB_err(108); } else { xval->intval = OPB_BoolToInt(ConstCmp__14() != 13); } break; case 13: - if (__IN(f, 0x2a04)) { + if (__IN(f, 0x0a84)) { OPB_err(108); } else { xval->intval = OPB_BoolToInt(ConstCmp__14() == 13); } break; case 14: - if (__IN(f, 0x2a04)) { + if (__IN(f, 0x0a84)) { OPB_err(108); } else { xval->intval = OPB_BoolToInt(ConstCmp__14() != 11); @@ -1122,8 +1122,8 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) f = (*x)->typ->form; g = typ->form; if ((*x)->class == 7) { - if (f == 5) { - if (g == 5) { + if (f == 4) { + if (g == 4) { if (f > g) { OPB_SetIntType(*x); if ((*x)->typ->size > typ->size) { @@ -1131,7 +1131,7 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) (*x)->conval->intval = 1; } } - } else if (__IN(g, 0x0180)) { + } else if (__IN(g, 0x60)) { (*x)->conval->realval = (*x)->conval->intval; (*x)->conval->intval = -1; } else { @@ -1140,8 +1140,8 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) OPB_err(220); } } - } else if (__IN(f, 0x0180)) { - if (__IN(g, 0x0180)) { + } else if (__IN(f, 0x60)) { + if (__IN(g, 0x60)) { OPB_CheckRealType(g, 203, (*x)->conval); } else { r = (*x)->conval->realval; @@ -1190,25 +1190,25 @@ static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) { BOOLEAN _o_result; BOOLEAN ok, xCharArr, yCharArr; - xCharArr = (__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp->form == 3) || *Op__38_s->f == 10; - yCharArr = (__IN((*y)->typ->comp, 0x0c) && (*y)->typ->BaseTyp->form == 3) || *Op__38_s->g == 10; + xCharArr = (__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp->form == 3) || *Op__38_s->f == 8; + yCharArr = (__IN((*y)->typ->comp, 0x0c) && (*y)->typ->BaseTyp->form == 3) || *Op__38_s->g == 8; if ((((xCharArr && *Op__38_s->g == 3)) && (*y)->class == 7)) { OPB_CharToString(*y); - *Op__38_s->g = 10; + *Op__38_s->g = 8; yCharArr = 1; } if ((((yCharArr && *Op__38_s->f == 3)) && (*x)->class == 7)) { OPB_CharToString(*x); - *Op__38_s->f = 10; + *Op__38_s->f = 8; xCharArr = 1; } ok = (xCharArr && yCharArr); if (ok) { - if ((*Op__38_s->f == 10 && (*x)->conval->intval2 == 1)) { + if ((*Op__38_s->f == 8 && (*x)->conval->intval2 == 1)) { (*x)->typ = OPT_chartyp; (*x)->conval->intval = 0; OPB_Index(&*y, OPB_NewIntConst(0)); - } else if ((*Op__38_s->g == 10 && (*y)->conval->intval2 == 1)) { + } else if ((*Op__38_s->g == 8 && (*y)->conval->intval2 == 1)) { (*y)->typ = OPT_chartyp; (*y)->conval->intval = 0; OPB_Index(&*x, OPB_NewIntConst(0)); @@ -1247,49 +1247,49 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPB_err(100); } break; + case 4: + if ((g == 4 && y->typ->size < z->typ->size)) { + OPB_Convert(&y, z->typ); + } else if (__IN(g, 0x70)) { + OPB_Convert(&z, y->typ); + } else { + OPB_err(100); + } + break; case 5: - if ((g == 5 && y->typ->size < z->typ->size)) { + if (g == 4) { OPB_Convert(&y, z->typ); - } else if (__IN(g, 0x01a0)) { + } else if (__IN(g, 0x60)) { OPB_Convert(&z, y->typ); } else { OPB_err(100); } break; - case 7: - if (g == 5) { + case 6: + if (__IN(g, 0x70)) { + OPB_Convert(&y, z->typ); + } else if (__IN(g, 0x60)) { OPB_Convert(&y, z->typ); - } else if (__IN(g, 0x0180)) { - OPB_Convert(&z, y->typ); } else { OPB_err(100); } break; - case 8: - if (__IN(g, 0x01a0)) { - OPB_Convert(&y, z->typ); - } else if (__IN(g, 0x0180)) { - OPB_Convert(&y, z->typ); - } else { + case 9: + if (!__IN(g, 0x1800)) { OPB_err(100); } break; case 11: - if (!__IN(g, 0x6000)) { - OPB_err(100); - } - break; - case 13: OPB_CheckPtr(z, y); break; - case 14: - if (g != 11) { + case 12: + if (g != 9) { OPB_err(100); } break; - case 10: + case 8: break; - case 15: + case 13: if (z->typ->comp == 4) { OPB_err(100); } @@ -1305,7 +1305,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) switch (op) { case 1: do_ = 1; - if (f == 5) { + if (f == 4) { if (z->class == 7) { val = z->conval->intval; if (val == 1) { @@ -1336,7 +1336,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) y->obj = NIL; } } - } else if (!__IN(f, 0x0381)) { + } else if (!__IN(f, 0xe1)) { OPB_err(105); typ = OPT_undftyp; } @@ -1345,18 +1345,18 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 2: - if (f == 5) { + if (f == 4) { if ((y->class == 7 && y->conval->intval == 0)) { OPB_err(205); } OPB_Convert(&z, OPT_realtyp); OPB_Convert(&y, OPT_realtyp); typ = OPT_realtyp; - } else if (__IN(f, 0x0180)) { + } else if (__IN(f, 0x60)) { if ((y->class == 7 && y->conval->realval == (LONGREAL)0)) { OPB_err(205); } - } else if ((f != 9 && f != 0)) { + } else if ((f != 7 && f != 0)) { OPB_err(102); typ = OPT_undftyp; } @@ -1364,7 +1364,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) break; case 3: do_ = 1; - if (f == 5) { + if (f == 4) { if (y->class == 7) { val = y->conval->intval; if (val == 0) { @@ -1387,7 +1387,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 4: - if (f == 5) { + if (f == 4) { if (y->class == 7) { if (y->conval->intval == 0) { OPB_err(205); @@ -1419,12 +1419,12 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 6: - if (!__IN(f, 0x03e1)) { + if (!__IN(f, 0xf1)) { OPB_err(105); typ = OPT_undftyp; } do_ = 1; - if (f == 5) { + if (f == 4) { if ((z->class == 7 && z->conval->intval == 0)) { do_ = 0; z = y; @@ -1438,11 +1438,11 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 7: - if (!__IN(f, 0x03e1)) { + if (!__IN(f, 0xf1)) { OPB_err(106); typ = OPT_undftyp; } - if ((f != 5 || y->class != 7) || y->conval->intval != 0) { + if ((f != 4 || y->class != 7) || y->conval->intval != 0) { NewOp__39(op, typ, &z, y); } break; @@ -1462,7 +1462,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 9: case 10: - if (__IN(f, 0x6bff) || strings__41(&z, &y)) { + if (__IN(f, 0x1aff) || strings__41(&z, &y)) { typ = OPT_booltyp; } else { OPB_err(107); @@ -1471,7 +1471,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) NewOp__39(op, typ, &z, y); break; case 11: case 12: case 13: case 14: - if (__IN(f, 0x01f9) || strings__41(&z, &y)) { + if (__IN(f, 0x79) || strings__41(&z, &y)) { typ = OPT_booltyp; } else { OPM_LogWLn(); @@ -1498,7 +1498,7 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y) LONGINT k, l; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); - } else if (((*x)->typ->form == 5 && y->typ->form == 5)) { + } else if (((*x)->typ->form == 4 && y->typ->form == 4)) { if ((*x)->class == 7) { k = (*x)->conval->intval; if (0 > k || k > OPM_MaxSet) { @@ -1533,7 +1533,7 @@ void OPB_SetElem (OPT_Node *x) LONGINT k; if ((*x)->class == 8 || (*x)->class == 9) { OPB_err(126); - } else if ((*x)->typ->form != 5) { + } else if ((*x)->typ->form != 4) { OPB_err(93); } else if ((*x)->class == 7) { k = (*x)->conval->intval; @@ -1576,40 +1576,40 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPM_LogWNum(ynode->typ->size, 0); OPM_LogWLn(); } - if (ynode->class == 8 || (ynode->class == 9 && f != 14)) { + if (ynode->class == 8 || (ynode->class == 9 && f != 12)) { OPB_err(126); } switch (f) { - case 0: case 10: + case 0: case 8: break; case 1: - if (!((__IN(g, 0x2a) && y->size == 1))) { + if (!((__IN(g, 0x1a) && y->size == 1))) { OPB_err(113); } break; - case 2: case 3: case 9: + case 2: case 3: case 7: if (g != f) { OPB_err(113); } break; + case 4: + if (g != 4 || x->size < y->size) { + OPB_err(113); + } + break; case 5: - if (g != 5 || x->size < y->size) { + if (!__IN(g, 0x30)) { OPB_err(113); } break; - case 7: - if (!__IN(g, 0xe0)) { + case 6: + if (!__IN(g, 0x70)) { OPB_err(113); } break; - case 8: - if (!__IN(g, 0x01e0)) { - OPB_err(113); - } - break; - case 13: - if ((x == y || g == 11) || (x == OPT_sysptrtyp && g == 13)) { - } else if (g == 13) { + case 11: + if ((x == y || g == 9) || (x == OPT_sysptrtyp && g == 11)) { + } else if (g == 11) { p = x->BaseTyp; q = y->BaseTyp; if ((p->comp == 4 && q->comp == 4)) { @@ -1626,28 +1626,28 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPB_err(113); } break; - case 14: + case 12: if (ynode->class == 9) { OPB_CheckProc(x, ynode->obj); - } else if (x == y || g == 11) { + } else if (x == y || g == 9) { } else { OPB_err(113); } break; - case 12: case 11: + case 10: case 9: OPB_err(113); break; - case 15: + case 13: x->pvused = 1; if (x->comp == 2) { if ((ynode->class == 7 && g == 3)) { OPB_CharToString(ynode); y = ynode->typ; - g = 10; + g = 8; } if (x == y) { } else if (x->BaseTyp == OPT_chartyp) { - if (g == 10) { + if (g == 8) { if (ynode->conval->intval2 > x->n) { OPB_err(114); } @@ -1686,7 +1686,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPM_LogWLn(); break; } - if ((((((ynode->class == 7 && g < f)) && __IN(g, 0xe0))) && __IN(f, 0x01e0))) { + if ((((((ynode->class == 7 && g < f)) && __IN(g, 0x30))) && __IN(f, 0x70))) { OPB_Convert(&ynode, x); } } @@ -1704,7 +1704,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) f = x->typ->form; switch (fctno) { case 0: - if ((f == 5 && x->class == 7)) { + if ((f == 4 && x->class == 7)) { if ((0 <= x->conval->intval && x->conval->intval <= 255)) { OPB_BindNodes(28, OPT_notyp, &x, x); } else { @@ -1719,7 +1719,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) typ = OPT_notyp; if (OPB_NotVar(x)) { OPB_err(112); - } else if (f == 13) { + } else if (f == 11) { if (x->readonly) { OPB_err(76); } @@ -1757,7 +1757,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 5: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x0180)) { + } else if (__IN(f, 0x60)) { OPB_Convert(&x, OPT_linttyp); } else { OPB_err(111); @@ -1777,17 +1777,17 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) x = OPB_NewIntConst(0); x->typ = OPT_chartyp; break; - case 5: + case 4: x = OPB_NewIntConst(OPM_SignedMinimum(x->typ->size)); break; - case 9: + case 7: x = OPB_NewIntConst(0); x->typ = OPT_inttyp; break; - case 7: + case 5: x = OPB_NewRealConst(OPM_MinReal, OPT_realtyp); break; - case 8: + case 6: x = OPB_NewRealConst(OPM_MinLReal, OPT_lrltyp); break; default: @@ -1808,17 +1808,17 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) x = OPB_NewIntConst(255); x->typ = OPT_chartyp; break; - case 5: + case 4: x = OPB_NewIntConst(OPM_SignedMaximum(x->typ->size)); break; - case 9: + case 7: x = OPB_NewIntConst(OPM_MaxSet); x->typ = OPT_inttyp; break; - case 7: + case 5: x = OPB_NewRealConst(OPM_MaxReal, OPT_realtyp); break; - case 8: + case 6: x = OPB_NewRealConst(OPM_MaxLReal, OPT_lrltyp); break; default: @@ -1832,7 +1832,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 9: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x21)) { + } else if (__IN(f, 0x11)) { OPB_Convert(&x, OPT_chartyp); } else { OPB_err(111); @@ -1842,14 +1842,14 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 10: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 5) { + } else if (f == 4) { typ = OPT_ShorterOrLongerType(x->typ, -1); if (typ == NIL) { OPB_err(111); } else { OPB_Convert(&x, typ); } - } else if (f == 8) { + } else if (f == 6) { OPB_Convert(&x, OPT_realtyp); } else { OPB_err(111); @@ -1858,14 +1858,14 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 11: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 5) { + } else if (f == 4) { typ = OPT_ShorterOrLongerType(x->typ, 1); if (typ == NIL) { OPB_err(111); } else { OPB_Convert(&x, typ); } - } else if (f == 7) { + } else if (f == 5) { OPB_Convert(&x, OPT_lrltyp); } else if (f == 3) { OPB_Convert(&x, OPT_linttyp); @@ -1876,7 +1876,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 13: case 14: if (OPB_NotVar(x)) { OPB_err(112); - } else if (f != 5) { + } else if (f != 4) { OPB_err(111); } else if (x->readonly) { OPB_err(76); @@ -1900,18 +1900,18 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 18: if ((x->class == 7 && f == 3)) { OPB_CharToString(x); - f = 10; + f = 8; } if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (((!__IN(x->typ->comp, 0x0c) || x->typ->BaseTyp->form != 3) && f != 10)) { + } else if (((!__IN(x->typ->comp, 0x0c) || x->typ->BaseTyp->form != 3) && f != 8)) { OPB_err(111); } break; case 19: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 5) { + } else if (f == 4) { if (x->typ->size != OPM_LIntSize) { OPB_Convert(&x, OPT_linttyp); } @@ -1928,7 +1928,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) if (x->class != 8) { OPB_err(110); x = OPB_NewIntConst(1); - } else if (__IN(f, 0x63fe) || __IN(x->typ->comp, 0x14)) { + } else if (__IN(f, 0x18fe) || __IN(x->typ->comp, 0x14)) { (*OPB_typSize)(x->typ); x->typ->pvused = 1; x = OPB_NewIntConst(x->typ->size); @@ -1943,22 +1943,22 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 22: case 23: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (!__IN(f, 0x022a)) { + } else if (!__IN(f, 0x9a)) { OPB_err(111); } break; case 24: case 25: case 28: case 31: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((((x->class == 7 && f == 5)) && x->typ->size < OPT_linttyp->size)) { + } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x2020) && x->typ->size == OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x0810) && x->typ->size == OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } break; case 26: case 27: - if ((f == 5 && x->class == 7)) { + if ((f == 4 && x->class == 7)) { if (x->conval->intval < 0 || x->conval->intval > -1) { OPB_err(220); } @@ -1969,14 +1969,14 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 29: if (x->class != 8) { OPB_err(110); - } else if (__IN(f, 0x1401) || x->typ->comp == 3) { + } else if (__IN(f, 0x0501) || x->typ->comp == 3) { OPB_err(111); } break; case 30: if (OPB_NotVar(x)) { OPB_err(112); - } else if (f == 13) { + } else if (f == 11) { } else { OPB_err(111); } @@ -2036,7 +2036,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) p->typ = OPT_notyp; } else { if (x->typ != p->typ) { - if ((x->class == 7 && f == 5)) { + if ((x->class == 7 && f == 4)) { OPB_Convert(&x, p->typ); } else { OPB_err(111); @@ -2049,7 +2049,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 15: case 16: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 5) { + } else if (f == 4) { if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > OPM_MaxSet))) { OPB_err(202); } @@ -2060,7 +2060,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) p->typ = OPT_notyp; break; case 17: - if (!(f == 5) || x->class != 7) { + if (!(f == 4) || x->class != 7) { OPB_err(69); } else if (x->typ->size == 1) { L = (SYSTEM_INT16)x->conval->intval; @@ -2109,7 +2109,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 19: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 5) { + } else if (f == 4) { if ((p->class == 7 && x->class == 7)) { if (-OPB_maxExp > x->conval->intval || x->conval->intval > OPB_maxExp) { OPB_err(208); @@ -2137,7 +2137,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (p->typ->comp == 3) { - if (f == 5) { + if (f == 4) { if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > OPM_MaxIndex))) { OPB_err(63); } @@ -2153,7 +2153,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 22: case 23: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f != 5) { + } else if (f != 4) { OPB_err(111); } else { if (fctno == 22) { @@ -2167,7 +2167,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 24: case 25: case 26: case 27: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x63ff)) { + } else if (__IN(f, 0x18ff)) { if (fctno == 24 || fctno == 26) { if (OPB_NotVar(x)) { OPB_err(112); @@ -2185,7 +2185,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 28: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 5) { + } else if (f == 4) { p = NewOp__53(12, 26, p, x); } else { OPB_err(111); @@ -2193,7 +2193,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) p->typ = OPT_booltyp; break; case 29: - if (((x->class == 8 || x->class == 9) || __IN(f, 0x1401)) || x->typ->comp == 3) { + if (((x->class == 8 || x->class == 9) || __IN(f, 0x0501)) || x->typ->comp == 3) { OPB_err(126); } if (x->typ->size < p->typ->size) { @@ -2209,7 +2209,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 30: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 5) { + } else if (f == 4) { p = NewOp__53(19, 30, p, x); } else { OPB_err(111); @@ -2219,16 +2219,16 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 31: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((((x->class == 7 && f == 5)) && x->typ->size < OPT_linttyp->size)) { + } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x2020) && x->typ->size == OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x0810) && x->typ->size == OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } p->link = x; break; case 32: - if ((f == 5 && x->class == 7)) { + if ((f == 4 && x->class == 7)) { if ((0 <= x->conval->intval && x->conval->intval <= 255)) { OPB_BindNodes(28, OPT_notyp, &x, x); x->conval = OPT_NewConst(); @@ -2271,7 +2271,7 @@ void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n) OPB_err(126); } else if (p->typ->comp != 3) { OPB_err(64); - } else if (f == 5) { + } else if (f == 4) { if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > OPM_MaxIndex))) { OPB_err(63); } @@ -2287,7 +2287,7 @@ void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n) } else if ((fctno == 31 && n == 2)) { if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 5) { + } else if (f == 4) { node = OPT_NewNode(19); node->subcl = 31; node->right = p; @@ -2375,7 +2375,7 @@ static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpa ftyp = ftyp->BaseTyp; atyp = atyp->BaseTyp; if ((fvarpar && ftyp == OPT_bytetyp)) { - if (!__IN(f, 0x0c) || !((__IN(atyp->form, 0x2e) && atyp->size == 1))) { + if (!__IN(f, 0x0c) || !((__IN(atyp->form, 0x1e) && atyp->size == 1))) { if (__IN(18, OPM_opt)) { OPB_err(-301); } @@ -2384,7 +2384,7 @@ static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpa if (ftyp->comp == 3) { OPB_DynArrParCheck(ftyp, atyp, fvarpar); } else if (ftyp != atyp) { - if ((((!fvarpar && ftyp->form == 13)) && atyp->form == 13)) { + if ((((!fvarpar && ftyp->form == 11)) && atyp->form == 11)) { ftyp = ftyp->BaseTyp; atyp = atyp->BaseTyp; if ((ftyp->comp == 4 && atyp->comp == 4)) { @@ -2408,7 +2408,7 @@ static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpa static void OPB_CheckReceiver (OPT_Node *x, OPT_Object fp) { - if (fp->typ->form == 13) { + if (fp->typ->form == 11) { if ((*x)->class == 3) { *x = (*x)->left; } else { @@ -2425,7 +2425,7 @@ void OPB_PrepCall (OPT_Node *x, OPT_Object *fpar) OPB_CheckReceiver(&(*x)->left, *fpar); *fpar = (*fpar)->link; } - } else if (((((*x)->class != 8 && (*x)->typ != NIL)) && (*x)->typ->form == 14)) { + } else if (((((*x)->class != 8 && (*x)->typ != NIL)) && (*x)->typ->form == 12)) { *fpar = (*x)->typ->link; } else { OPB_err(121); @@ -2457,17 +2457,17 @@ void OPB_Param (OPT_Node ap, OPT_Object fp) if (q == NIL) { OPB_err(111); } - } else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 13)) { - } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x2e) && ap->typ->size == 1)))))) { + } else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 11)) { + } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x1e) && ap->typ->size == 1)))))) { OPB_err(123); - } else if ((fp->typ->form == 13 && ap->class == 5)) { + } else if ((fp->typ->form == 11 && ap->class == 5)) { OPB_err(123); } } else if (fp->typ->comp == 3) { if ((ap->class == 7 && ap->typ->form == 3)) { OPB_CharToString(ap); } - if ((ap->typ->form == 10 && fp->typ->BaseTyp->form == 3)) { + if ((ap->typ->form == 8 && fp->typ->BaseTyp->form == 3)) { } else if (ap->class >= 7) { OPB_err(59); } else { @@ -2575,7 +2575,7 @@ void OPB_Assign (OPT_Node *x, OPT_Node y) OPB_BindNodes(6, (*x)->typ, &z, NIL); *x = z; } - } else if (((((((*x)->typ->comp == 2 && (*x)->typ->BaseTyp == OPT_chartyp)) && y->typ->form == 10)) && y->conval->intval2 == 1)) { + } else if (((((((*x)->typ->comp == 2 && (*x)->typ->BaseTyp == OPT_chartyp)) && y->typ->form == 8)) && y->conval->intval2 == 1)) { y->typ = OPT_chartyp; y->conval->intval = 0; OPB_Index(&*x, OPB_NewIntConst(0)); diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index 385a9146..97c4485c 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 45784a13..9f818a4a 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "OPM.h" @@ -227,12 +227,12 @@ static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause) if (__IN(typ->comp, 0x0c)) { OPC_Stars(typ->BaseTyp, &*openClause); *openClause = typ->comp == 2; - } else if (typ->form == 14) { + } else if (typ->form == 12) { OPM_Write('('); OPM_Write('*'); } else { pointers = 0; - while (((typ->strobj == NIL || typ->strobj->name[0] == 0x00) && typ->form == 13)) { + while (((typ->strobj == NIL || typ->strobj->name[0] == 0x00) && typ->form == 11)) { pointers += 1; typ = typ->BaseTyp; } @@ -277,16 +277,16 @@ static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef) for (;;) { form = typ->form; comp = typ->comp; - if (((typ->strobj != NIL && typ->strobj->name[0] != 0x00) || form == 12) || comp == 4) { + if (((typ->strobj != NIL && typ->strobj->name[0] != 0x00) || form == 10) || comp == 4) { break; - } else if ((form == 13 && typ->BaseTyp->comp != 3)) { + } else if ((form == 11 && typ->BaseTyp->comp != 3)) { openClause = 1; - } else if (form == 14 || __IN(comp, 0x0c)) { + } else if (form == 12 || __IN(comp, 0x0c)) { if (openClause) { OPM_Write(')'); openClause = 0; } - if (form == 14) { + if (form == 12) { if (OPC_ansi) { OPM_Write(')'); OPC_AnsiParamList(typ->link, 0); @@ -331,19 +331,19 @@ static void OPC_DeclareBase (OPT_Object dcl) LONGINT off, n, dummy; typ = dcl->typ; prev = typ; - while ((((((((typ->strobj == NIL || typ->comp == 3) || OPC_Undefined(typ->strobj)) && typ->comp != 4)) && typ->form != 12)) && !((typ->form == 13 && typ->BaseTyp->comp == 3)))) { + while ((((((((typ->strobj == NIL || typ->comp == 3) || OPC_Undefined(typ->strobj)) && typ->comp != 4)) && typ->form != 10)) && !((typ->form == 11 && typ->BaseTyp->comp == 3)))) { prev = typ; typ = typ->BaseTyp; } obj = typ->strobj; - if (typ->form == 12) { + if (typ->form == 10) { OPM_WriteString((CHAR*)"void", 5); } else if ((obj != NIL && !OPC_Undefined(obj))) { OPC_Ident(obj); } else if (typ->comp == 4) { OPM_WriteString((CHAR*)"struct ", 8); OPC_Andent(typ); - if ((prev->form != 13 && (obj != NIL || dcl->name[0] == 0x00))) { + if ((prev->form != 11 && (obj != NIL || dcl->name[0] == 0x00))) { if ((typ->BaseTyp != NIL && typ->BaseTyp->strobj->vis != 0)) { OPM_WriteString((CHAR*)" { /* ", 7); OPC_Ident(typ->BaseTyp->strobj); @@ -357,7 +357,7 @@ static void OPC_DeclareBase (OPT_Object dcl) OPC_FieldList(typ, 1, &off, &n, &dummy); OPC_EndBlk0(); } - } else if ((typ->form == 13 && typ->BaseTyp->comp == 3)) { + } else if ((typ->form == 11 && typ->BaseTyp->comp == 3)) { typ = typ->BaseTyp->BaseTyp; nofdims = 1; while (typ->comp == 3) { @@ -372,7 +372,7 @@ static void OPC_DeclareBase (OPT_Object dcl) OPC_BegStat(); __NEW(obj, OPT_ObjDesc); __NEW(obj->typ, OPT_StrDesc); - obj->typ->form = 15; + obj->typ->form = 13; obj->typ->comp = 2; obj->typ->n = 1; obj->typ->BaseTyp = typ; @@ -393,7 +393,7 @@ LONGINT OPC_NofPtrs (OPT_Struct typ) OPT_Object fld = NIL; OPT_Struct btyp = NIL; LONGINT n; - if ((typ->form == 13 && typ->sysflag == 0)) { + if ((typ->form == 11 && typ->sysflag == 0)) { _o_result = 1; return _o_result; } else if ((typ->comp == 4 && __MASK(typ->sysflag, -256) == 0)) { @@ -435,7 +435,7 @@ static void OPC_PutPtrOffsets (OPT_Struct typ, LONGINT adr, LONGINT *cnt) OPT_Object fld = NIL; OPT_Struct btyp = NIL; LONGINT n, i; - if ((typ->form == 13 && typ->sysflag == 0)) { + if ((typ->form == 11 && typ->sysflag == 0)) { OPM_WriteInt(adr); OPM_WriteString((CHAR*)", ", 3); *cnt += 1; @@ -540,7 +540,7 @@ static void OPC_DeclareParams (OPT_Object par, BOOLEAN macro) if (macro) { OPM_WriteStringVar((void*)par->name, 256); } else { - if ((par->mode == 1 && par->typ->form == 7)) { + if ((par->mode == 1 && par->typ->form == 5)) { OPM_Write('_'); } OPC_Ident(par); @@ -612,7 +612,7 @@ OPT_Object OPC_BaseTProc (OPT_Object obj) OPT_Struct typ = NIL, base = NIL; LONGINT mno; typ = obj->link->typ; - if (typ->form == 13) { + if (typ->form == 11) { typ = typ->BaseTyp; } base = typ->BaseTyp; @@ -635,7 +635,7 @@ static void OPC_DefineTProcMacros (OPT_Object obj, BOOLEAN *empty) OPC_Ident(obj); OPC_DeclareParams(obj->link, 1); OPM_WriteString((CHAR*)" __SEND(", 9); - if (obj->link->typ->form == 13) { + if (obj->link->typ->form == 11) { OPM_WriteString((CHAR*)"__TYPEOF(", 10); OPC_Ident(obj->link); OPM_Write(')'); @@ -673,7 +673,7 @@ static void OPC_DefineType (OPT_Struct str) if (obj == NIL || OPC_Undefined(obj)) { if (obj != NIL) { if (obj->linkadr == 1) { - if (str->form != 13) { + if (str->form != 11) { OPM_Mark(244, str->txtpos); obj->linkadr = 2; } @@ -692,13 +692,13 @@ static void OPC_DefineType (OPT_Struct str) } field = field->link; } - } else if (str->form == 13) { + } else if (str->form == 11) { if (str->BaseTyp->comp != 4) { OPC_DefineType(str->BaseTyp); } } else if (__IN(str->comp, 0x0c)) { OPC_DefineType(str->BaseTyp); - } else if (str->form == 14) { + } else if (str->form == 12) { if (str->BaseTyp != OPT_notyp) { OPC_DefineType(str->BaseTyp); } @@ -889,7 +889,7 @@ LONGINT OPC_BaseAlignment (OPT_Struct typ) { LONGINT _o_result; LONGINT alignment; - if (typ->form == 15) { + if (typ->form == 13) { if (typ->comp == 4) { alignment = __MASK(typ->align, -65536); } else { @@ -1017,7 +1017,7 @@ static void OPC_IdentList (OPT_Object obj, INTEGER vis) OPM_WriteString((CHAR*)"export ", 8); } } - if ((((vis == 2 && obj->mode == 1)) && base->form == 7)) { + if ((((vis == 2 && obj->mode == 1)) && base->form == 5)) { OPM_WriteString((CHAR*)"double", 7); } else { OPC_DeclareBase(obj); @@ -1026,7 +1026,7 @@ static void OPC_IdentList (OPT_Object obj, INTEGER vis) OPM_Write(','); } OPM_Write(' '); - if ((((vis == 2 && obj->mode == 1)) && base->form == 7)) { + if ((((vis == 2 && obj->mode == 1)) && base->form == 5)) { OPM_Write('_'); } OPC_DeclareObj(obj, vis == 3); @@ -1043,7 +1043,7 @@ static void OPC_IdentList (OPT_Object obj, INTEGER vis) OPC_Ident(obj); OPM_WriteString((CHAR*)"__typ", 6); base = NIL; - } else if ((((((OPC_ptrinit && vis == 0)) && obj->mnolev > 0)) && obj->typ->form == 13)) { + } else if ((((((OPC_ptrinit && vis == 0)) && obj->mnolev > 0)) && obj->typ->form == 11)) { OPM_WriteString((CHAR*)" = NIL", 7); } } @@ -1380,7 +1380,7 @@ void OPC_GenEnumPtrs (OPT_Object var) OPC_BegBlk(); } OPC_BegStat(); - if (typ->form == 13) { + if (typ->form == 11) { OPM_WriteString((CHAR*)"P(", 3); OPC_Ident(var); OPM_Write(')'); @@ -1399,7 +1399,7 @@ void OPC_GenEnumPtrs (OPT_Object var) n = n * typ->n; typ = typ->BaseTyp; } - if (typ->form == 13) { + if (typ->form == 11) { OPM_WriteString((CHAR*)"__ENUMP(", 9); OPC_Ident(var); OPC_Str1((CHAR*)", #, P)", 8, n); @@ -1562,7 +1562,7 @@ void OPC_EnterProc (OPT_Object proc) if (!OPC_ansi) { var = proc->link; while (var != NIL) { - if ((var->typ->form == 7 && var->mode == 1)) { + if ((var->typ->form == 5 && var->mode == 1)) { OPC_BegStat(); OPC_Ident(var->typ->strobj); OPM_Write(' '); @@ -1878,7 +1878,7 @@ void OPC_Case (LONGINT caseVal, INTEGER form) case 3: OPC_CharacterLiteral(caseVal); break; - case 5: + case 4: OPM_WriteInt(caseVal); break; default: @@ -1976,16 +1976,16 @@ void OPC_Constant (OPT_Const con, INTEGER form) case 3: OPC_CharacterLiteral(con->intval); break; - case 5: + case 4: OPM_WriteInt(con->intval); break; - case 7: + case 5: OPM_WriteReal(con->realval, 'f'); break; - case 8: + case 6: OPM_WriteReal(con->realval, 0x00); break; - case 9: + case 7: OPM_WriteString((CHAR*)"0x", 3); skipLeading = 1; s = con->setval; @@ -2008,10 +2008,10 @@ void OPC_Constant (OPT_Const con, INTEGER form) OPM_Write('0'); } break; - case 10: + case 8: OPC_StringLiteral(*con->ext, 256, con->intval2 - 1); break; - case 11: + case 9: OPM_WriteString((CHAR*)"NIL", 4); break; default: diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index 4243328e..38f95afe 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 979d9598..f2da0fed 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index f93bcd98..15a980a6 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index b0e235d3..21c21350 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPB.h" #include "OPM.h" @@ -136,7 +136,7 @@ static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_) OPP_err(135); } OPP_ConstExpression(&x); - if (x->typ->form == 5) { + if (x->typ->form == 4) { sf = x->conval->intval; if (sf < 0 || sf > 1) { OPP_err(220); @@ -158,7 +158,7 @@ static void OPP_RecordType (OPT_Struct *typ, OPT_Struct *banned) OPT_Object fld = NIL, first = NIL, last = NIL, base = NIL; OPT_Struct ftyp = NIL; INTEGER sysflag; - *typ = OPT_NewStr(15, 4); + *typ = OPT_NewStr(13, 4); (*typ)->BaseTyp = NIL; OPP_CheckSysFlag(&sysflag, -1); if (OPP_sym == 30) { @@ -253,7 +253,7 @@ static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) INTEGER sysflag; OPP_CheckSysFlag(&sysflag, 0); if (OPP_sym == 25) { - *typ = OPT_NewStr(15, 3); + *typ = OPT_NewStr(13, 3); (*typ)->mno = 0; (*typ)->sysflag = sysflag; OPS_Get(&OPP_sym); @@ -265,10 +265,10 @@ static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) (*typ)->n = 0; } } else { - *typ = OPT_NewStr(15, 2); + *typ = OPT_NewStr(13, 2); (*typ)->sysflag = sysflag; OPP_ConstExpression(&x); - if (x->typ->form == 5) { + if (x->typ->form == 4) { n = x->conval->intval; if (n <= 0 || n > OPM_MaxIndex) { OPP_err(63); @@ -301,7 +301,7 @@ static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) static void OPP_PointerType (OPT_Struct *typ) { OPT_Object id = NIL; - *typ = OPT_NewStr(13, 1); + *typ = OPT_NewStr(11, 1); OPP_CheckSysFlag(&(*typ)->sysflag, 0); OPP_CheckSym(28); if (OPP_sym == 38) { @@ -409,7 +409,7 @@ static void OPP_FormalParameters (OPT_Object *firstPar, OPT_Struct *resTyp) if (OPP_sym == 38) { OPP_qualident(&res); if (res->mode == 5) { - if (res->typ->form < 15) { + if (res->typ->form < 13) { *resTyp = res->typ; } else { OPP_err(54); @@ -459,7 +459,7 @@ static void OPP_TypeDecl (OPT_Struct *typ, OPT_Struct *banned) OPP_PointerType(&*typ); } else if (OPP_sym == 61) { OPS_Get(&OPP_sym); - *typ = OPT_NewStr(14, 1); + *typ = OPT_NewStr(12, 1); OPP_CheckSysFlag(&(*typ)->sysflag, 0); if (OPP_sym == 30) { OPS_Get(&OPP_sym); @@ -488,7 +488,7 @@ static void OPP_TypeDecl (OPT_Struct *typ, OPT_Struct *banned) static void OPP_Type (OPT_Struct *typ, OPT_Struct *banned) { OPP_TypeDecl(&*typ, &*banned); - if (((((*typ)->form == 13 && (*typ)->BaseTyp == OPT_undftyp)) && (*typ)->strobj == NIL)) { + if (((((*typ)->form == 11 && (*typ)->BaseTyp == OPT_undftyp)) && (*typ)->strobj == NIL)) { OPP_err(0); } } @@ -503,7 +503,7 @@ static void OPP_selector (OPT_Node *x) if (OPP_sym == 31) { OPS_Get(&OPP_sym); for (;;) { - if (((*x)->typ != NIL && (*x)->typ->form == 13)) { + if (((*x)->typ != NIL && (*x)->typ->form == 11)) { OPB_DeRef(&*x); } OPP_Expression(&y); @@ -521,7 +521,7 @@ static void OPP_selector (OPT_Node *x) __COPY(OPS_name, name, 256); OPS_Get(&OPP_sym); if ((*x)->typ != NIL) { - if ((*x)->typ->form == 13) { + if ((*x)->typ->form == 11) { OPB_DeRef(&*x); } if ((*x)->typ->comp == 4) { @@ -543,7 +543,7 @@ static void OPP_selector (OPT_Node *x) OPP_err(75); } typ = y->obj->typ; - if (typ->form == 13) { + if (typ->form == 11) { typ = typ->BaseTyp; } OPT_FindField((*x)->obj->name, typ->BaseTyp, &proc); @@ -572,7 +572,7 @@ static void OPP_selector (OPT_Node *x) } else if (OPP_sym == 17) { OPS_Get(&OPP_sym); OPB_DeRef(&*x); - } else if ((((((OPP_sym == 30 && (*x)->class < 7)) && (*x)->typ->form != 14)) && ((*x)->obj == NIL || (*x)->obj->mode != 13))) { + } else if ((((((OPP_sym == 30 && (*x)->class < 7)) && (*x)->typ->form != 12)) && ((*x)->obj == NIL || (*x)->obj->mode != 13))) { OPS_Get(&OPP_sym); if (OPP_sym == 38) { OPP_qualident(&obj); @@ -871,10 +871,10 @@ static void OPP_Receiver (SHORTINT *mode, OPS_Name name, OPT_Struct *typ, OPT_St } else { *typ = obj->typ; *rec = *typ; - if ((*rec)->form == 13) { + if ((*rec)->form == 11) { *rec = (*rec)->BaseTyp; } - if (!((((*mode == 1 && (*typ)->form == 13)) && (*rec)->comp == 4) || (*mode == 2 && (*typ)->comp == 4))) { + if (!((((*mode == 1 && (*typ)->form == 11)) && (*rec)->comp == 4) || (*mode == 2 && (*typ)->comp == 4))) { OPP_err(70); *rec = NIL; } @@ -888,7 +888,7 @@ static void OPP_Receiver (SHORTINT *mode, OPS_Name name, OPT_Struct *typ, OPT_St } OPP_CheckSym(22); if (*rec == NIL) { - *rec = OPT_NewStr(15, 4); + *rec = OPT_NewStr(13, 4); (*rec)->BaseTyp = NIL; } } @@ -896,7 +896,7 @@ static void OPP_Receiver (SHORTINT *mode, OPS_Name name, OPT_Struct *typ, OPT_St static BOOLEAN OPP_Extends (OPT_Struct x, OPT_Struct b) { BOOLEAN _o_result; - if ((b->form == 13 && x->form == 13)) { + if ((b->form == 11 && x->form == 11)) { b = b->BaseTyp; x = x->BaseTyp; } @@ -1173,14 +1173,14 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, O for (;;) { OPP_ConstExpression(&x); f = x->typ->form; - if (__IN(f, 0x28)) { + if (__IN(f, 0x18)) { xval = x->conval->intval; } else { OPP_err(61); xval = 1; } - if (f == 5) { - if (!(LabelTyp->form == 5) || LabelTyp->size < x->typ->size) { + if (f == 4) { + if (!(LabelTyp->form == 4) || LabelTyp->size < x->typ->size) { OPP_err(60); } } else if ((SYSTEM_INT16)LabelTyp->form != f) { @@ -1190,7 +1190,7 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, O OPS_Get(&OPP_sym); OPP_ConstExpression(&y); yval = y->conval->intval; - if (((SYSTEM_INT16)y->typ->form != f && !((f == 5 && y->typ->form == 5)))) { + if (((SYSTEM_INT16)y->typ->form != f && !((f == 4 && y->typ->form == 4)))) { OPP_err(60); } if (yval < xval) { @@ -1253,7 +1253,7 @@ static void CasePart__31 (OPT_Node *x) *StatSeq__30_s->pos = OPM_errpos; if ((*x)->class == 8 || (*x)->class == 9) { OPP_err(126); - } else if (!__IN((*x)->typ->form, 0x38)) { + } else if (!__IN((*x)->typ->form, 0x18)) { OPP_err(125); } OPP_CheckSym(25); @@ -1439,7 +1439,7 @@ static void OPP_StatSeq (OPT_Node *stat) OPS_Get(&OPP_sym); if (OPP_sym == 38) { OPP_qualident(&id); - if (!(id->typ->form == 5)) { + if (!(id->typ->form == 4)) { OPP_err(68); } OPP_CheckSym(34); @@ -1471,7 +1471,7 @@ static void OPP_StatSeq (OPT_Node *stat) SetPos__35(z); OPB_Link(&*stat, &last, z); y = OPB_NewLeaf(t); - } else if (!(y->typ->form == 5) || y->typ->size > x->left->typ->size) { + } else if (!(y->typ->form == 4) || y->typ->size > x->left->typ->size) { OPP_err(113); } OPB_Link(&*stat, &last, x); @@ -1526,7 +1526,7 @@ static void OPP_StatSeq (OPT_Node *stat) if (OPP_sym == 38) { OPP_qualident(&id); y = OPB_NewLeaf(id); - if ((((id != NIL && id->typ->form == 13)) && (id->mode == 2 || !id->leaf))) { + if ((((id != NIL && id->typ->form == 11)) && (id->mode == 2 || !id->leaf))) { OPP_err(245); } OPP_CheckSym(20); diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index 0ddbe4c3..8bed9493 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index 89c8242e..f197a5c6 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index 46e05201..1e99f5e9 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index 7398b44a..5b495ad5 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" @@ -173,7 +173,7 @@ OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir) { OPT_Struct _o_result; INTEGER i; - __ASSERT(x->form == 5, 0); + __ASSERT(x->form == 4, 0); __ASSERT(dir == 1 || dir == -1, 0); __ASSERT(x->BaseTyp == OPT_undftyp, 0); i = 0; @@ -284,7 +284,7 @@ void OPT_Close (void) OPT_GlbMod[__X(i, 64)] = NIL; i += 1; } - i = 16; + i = 14; while (i < 255) { OPT_impCtxt.ref[__X(i, 255)] = NIL; OPT_impCtxt.old[__X(i, 255)] = NIL; @@ -483,14 +483,14 @@ void OPT_IdFPrint (OPT_Struct typ) OPT_FPrintName(&idfp, (void*)OPT_GlbMod[__X(typ->mno, 64)]->name, 256); OPT_FPrintName(&idfp, (void*)strobj->name, 256); } - if ((f == 13 || (c == 4 && btyp != NIL)) || c == 3) { + if ((f == 11 || (c == 4 && btyp != NIL)) || c == 3) { OPT_IdFPrint(btyp); OPM_FPrint(&idfp, btyp->idfp); } else if (c == 2) { OPT_IdFPrint(btyp); OPM_FPrint(&idfp, btyp->idfp); OPM_FPrint(&idfp, typ->n); - } else if (f == 14) { + } else if (f == 12) { OPT_FPrintSign(&idfp, btyp, typ->link); } typ->idfp = idfp; @@ -519,7 +519,7 @@ static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr) n = btyp->n * n; btyp = btyp->BaseTyp; } - if (btyp->form == 13 || btyp->comp == 4) { + if (btyp->form == 11 || btyp->comp == 4) { j = OPT_nofhdfld; FPrintHdFld__15(btyp, fld, adr); if (j != OPT_nofhdfld) { @@ -531,8 +531,8 @@ static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr) } } } - } else if (typ->form == 13 || __STRCMP(fld->name, "@ptr") == 0) { - OPM_FPrint(&*FPrintStr__12_s->pvfp, 13); + } else if (typ->form == 11 || __STRCMP(fld->name, "@ptr") == 0) { + OPM_FPrint(&*FPrintStr__12_s->pvfp, 11); OPM_FPrint(&*FPrintStr__12_s->pvfp, adr); OPT_nofhdfld += 1; } @@ -595,7 +595,7 @@ void OPT_FPrintStr (OPT_Struct typ) f = typ->form; c = typ->comp; btyp = typ->BaseTyp; - if (f == 13) { + if (f == 11) { strobj = typ->strobj; bstrobj = btyp->strobj; if (((strobj == NIL || strobj->name[0] == 0x00) || bstrobj == NIL) || bstrobj->name[0] == 0x00) { @@ -603,7 +603,7 @@ void OPT_FPrintStr (OPT_Struct typ) OPM_FPrint(&pbfp, btyp->pbfp); pvfp = pbfp; } - } else if (f == 14) { + } else if (f == 12) { } else if (__IN(c, 0x0c)) { OPT_FPrintStr(btyp); OPM_FPrint(&pbfp, btyp->pvfp); @@ -649,23 +649,23 @@ void OPT_FPrintObj (OPT_Object obj) f = obj->typ->form; OPM_FPrint(&fprint, f); switch (f) { - case 2: case 3: case 5: + case 2: case 3: case 4: OPM_FPrint(&fprint, obj->conval->intval); break; - case 9: + case 7: OPM_FPrintSet(&fprint, obj->conval->setval); break; - case 7: + case 5: rval = obj->conval->realval; OPM_FPrintReal(&fprint, rval); break; - case 8: + case 6: OPM_FPrintLReal(&fprint, obj->conval->realval); break; - case 10: + case 8: OPT_FPrintName(&fprint, (void*)*obj->conval->ext, 256); break; - case 11: + case 9: break; default: OPT_err(127); @@ -850,22 +850,22 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval) OPM_SymRCh(&ch); conval->intval = (SYSTEM_INT16)ch; break; - case 5: + case 4: conval->intval = OPM_SymRInt(); break; - case 9: + case 7: OPM_SymRSet(&conval->setval); break; - case 7: + case 5: OPM_SymRReal(&rval); conval->realval = rval; conval->intval = -1; break; - case 8: + case 6: OPM_SymRLReal(&conval->realval); conval->intval = -1; break; - case 10: + case 8: ext = OPT_NewExt(); conval->ext = ext; i = 0; @@ -877,7 +877,7 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval) conval->intval2 = i; conval->intval = -1; break; - case 11: + case 9: conval->intval = 0; break; default: @@ -979,7 +979,7 @@ static OPT_Object OPT_InTProc (SHORTINT mno) static OPT_Struct OPT_InTyp (LONGINT tag) { OPT_Struct _o_result; - if (tag == 5) { + if (tag == 4) { _o_result = OPT_IntType(OPM_SymRInt()); return _o_result; } else { @@ -1054,20 +1054,20 @@ static void OPT_InStruct (OPT_Struct *typ) } switch (tag) { case 36: - (*typ)->form = 13; + (*typ)->form = 11; (*typ)->size = OPM_PointerSize; (*typ)->n = 0; OPT_InStruct(&(*typ)->BaseTyp); break; case 37: - (*typ)->form = 15; + (*typ)->form = 13; (*typ)->comp = 2; OPT_InStruct(&(*typ)->BaseTyp); (*typ)->n = OPM_SymRInt(); (*OPT_typSize)(*typ); break; case 38: - (*typ)->form = 15; + (*typ)->form = 13; (*typ)->comp = 3; OPT_InStruct(&(*typ)->BaseTyp); if ((*typ)->BaseTyp->comp == 3) { @@ -1078,7 +1078,7 @@ static void OPT_InStruct (OPT_Struct *typ) (*OPT_typSize)(*typ); break; case 39: - (*typ)->form = 15; + (*typ)->form = 13; (*typ)->comp = 4; OPT_InStruct(&(*typ)->BaseTyp); if ((*typ)->BaseTyp == OPT_notyp) { @@ -1112,7 +1112,7 @@ static void OPT_InStruct (OPT_Struct *typ) } break; case 40: - (*typ)->form = 14; + (*typ)->form = 12; (*typ)->size = OPM_ProcSize; OPT_InSign(mno, &(*typ)->BaseTyp, &(*typ)->link); break; @@ -1191,7 +1191,7 @@ static OPT_Object OPT_InObj (SHORTINT mno) obj = OPT_NewObj(); obj->mnolev = -mno; obj->vis = 1; - if (tag <= 13) { + if (tag <= 11) { obj->mode = 3; obj->conval = OPT_NewConst(); OPT_InConstant(tag, obj->conval); @@ -1288,7 +1288,7 @@ void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) obj->scope = OPT_syslink; obj->typ = OPT_notyp; } else { - OPT_impCtxt.nofr = 16; + OPT_impCtxt.nofr = 14; OPT_impCtxt.minr = 255; OPT_impCtxt.nofm = 0; OPT_impCtxt.self = __STRCMP(aliasName, "@self") == 0; @@ -1355,7 +1355,7 @@ static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, LONGINT adr) n = btyp->n * n; btyp = btyp->BaseTyp; } - if (btyp->form == 13 || btyp->comp == 4) { + if (btyp->form == 11 || btyp->comp == 4) { j = OPT_nofhdfld; OPT_OutHdFld(btyp, fld, adr); if (j != OPT_nofhdfld) { @@ -1367,7 +1367,7 @@ static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, LONGINT adr) } } } - } else if (typ->form == 13 || __STRCMP(fld->name, "@ptr") == 0) { + } else if (typ->form == 11 || __STRCMP(fld->name, "@ptr") == 0) { OPM_SymWInt(27); OPM_SymWInt(adr); OPT_nofhdfld += 1; @@ -1439,7 +1439,7 @@ static void OPT_OutStr (OPT_Struct typ) OPT_Object strobj = NIL; if (typ->ref < OPT_expCtxt.ref) { OPM_SymWInt(-typ->ref); - if (typ->ref == 5) { + if (typ->ref == 4) { OPM_SymWInt(typ->size); } } else { @@ -1474,15 +1474,15 @@ static void OPT_OutStr (OPT_Struct typ) OPM_SymWInt(typ->sysflag); } switch (typ->form) { - case 13: + case 11: OPM_SymWInt(36); OPT_OutStr(typ->BaseTyp); break; - case 14: + case 12: OPM_SymWInt(40); OPT_OutSign(typ->BaseTyp, typ->link); break; - case 15: + case 13: switch (typ->comp) { case 2: OPM_SymWInt(37); @@ -1537,24 +1537,24 @@ static void OPT_OutConstant (OPT_Object obj) case 2: case 3: OPM_SymWCh((CHAR)obj->conval->intval); break; - case 5: + case 4: OPM_SymWInt(obj->conval->intval); OPM_SymWInt(obj->typ->size); break; - case 9: + case 7: OPM_SymWSet(obj->conval->setval); break; - case 7: + case 5: rval = obj->conval->realval; OPM_SymWReal(rval); break; - case 8: + case 6: OPM_SymWLReal(obj->conval->realval); break; - case 10: + case 8: OPT_OutName((void*)*obj->conval->ext, 256); break; - case 11: + case 9: break; default: OPT_err(127); @@ -1668,7 +1668,7 @@ void OPT_Export (BOOLEAN *ext, BOOLEAN *new) OPM_SymWInt(16); OPT_OutName((void*)OPT_SelfName, 256); OPT_expCtxt.reffp = 0; - OPT_expCtxt.ref = 16; + OPT_expCtxt.ref = 14; OPT_expCtxt.nofm = 1; OPT_expCtxt.locmno[0] = 0; i = 1; @@ -1844,16 +1844,16 @@ export void *OPT__init(void) OPM_errpos = 0; OPT_InitStruct(&OPT_undftyp, 0); OPT_undftyp->BaseTyp = OPT_undftyp; - OPT_InitStruct(&OPT_notyp, 12); - OPT_InitStruct(&OPT_stringtyp, 10); - OPT_InitStruct(&OPT_niltyp, 11); + OPT_InitStruct(&OPT_notyp, 10); + OPT_InitStruct(&OPT_stringtyp, 8); + OPT_InitStruct(&OPT_niltyp, 9); OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp); - OPT_EnterTyp((CHAR*)"PTR", 13, OPM_PointerSize, &OPT_sysptrtyp); - OPT_EnterTyp((CHAR*)"ADRINT", 5, OPM_PointerSize, &OPT_ainttyp); - OPT_EnterTyp((CHAR*)"INT8", 5, 1, &OPT_int8typ); - OPT_EnterTyp((CHAR*)"INT16", 5, 2, &OPT_int16typ); - OPT_EnterTyp((CHAR*)"INT32", 5, 4, &OPT_int32typ); - OPT_EnterTyp((CHAR*)"INT64", 5, 8, &OPT_int64typ); + OPT_EnterTyp((CHAR*)"PTR", 11, OPM_PointerSize, &OPT_sysptrtyp); + OPT_EnterTyp((CHAR*)"ADRINT", 4, OPM_PointerSize, &OPT_ainttyp); + OPT_EnterTyp((CHAR*)"INT8", 4, 1, &OPT_int8typ); + OPT_EnterTyp((CHAR*)"INT16", 4, 2, &OPT_int16typ); + OPT_EnterTyp((CHAR*)"INT32", 4, 4, &OPT_int32typ); + OPT_EnterTyp((CHAR*)"INT64", 4, 8, &OPT_int64typ); OPT_EnterProc((CHAR*)"ADR", 20); OPT_EnterProc((CHAR*)"CC", 21); OPT_EnterProc((CHAR*)"LSH", 22); @@ -1871,12 +1871,12 @@ export void *OPT__init(void) OPT_topScope->right = NIL; OPT_EnterTyp((CHAR*)"BOOLEAN", 2, OPM_BoolSize, &OPT_booltyp); OPT_EnterTyp((CHAR*)"CHAR", 3, OPM_CharSize, &OPT_chartyp); - OPT_EnterTyp((CHAR*)"SET", 9, OPM_SetSize, &OPT_settyp); - OPT_EnterTyp((CHAR*)"REAL", 7, OPM_RealSize, &OPT_realtyp); - OPT_EnterTyp((CHAR*)"INTEGER", 5, OPM_IntSize, &OPT_inttyp); - OPT_EnterTyp((CHAR*)"LONGINT", 5, OPM_LIntSize, &OPT_linttyp); - OPT_EnterTyp((CHAR*)"LONGREAL", 8, OPM_LRealSize, &OPT_lrltyp); - OPT_EnterTyp((CHAR*)"SHORTINT", 5, OPM_SIntSize, &OPT_sinttyp); + OPT_EnterTyp((CHAR*)"SET", 7, OPM_SetSize, &OPT_settyp); + OPT_EnterTyp((CHAR*)"REAL", 5, OPM_RealSize, &OPT_realtyp); + OPT_EnterTyp((CHAR*)"INTEGER", 4, OPM_IntSize, &OPT_inttyp); + OPT_EnterTyp((CHAR*)"LONGINT", 4, OPM_LIntSize, &OPT_linttyp); + OPT_EnterTyp((CHAR*)"LONGREAL", 6, OPM_LRealSize, &OPT_lrltyp); + OPT_EnterTyp((CHAR*)"SHORTINT", 4, OPM_SIntSize, &OPT_sinttyp); OPT_EnterBoolConst((CHAR*)"FALSE", 0); OPT_EnterBoolConst((CHAR*)"TRUE", 1); OPT_EnterProc((CHAR*)"HALT", 0); @@ -1904,14 +1904,14 @@ export void *OPT__init(void) OPT_impCtxt.ref[1] = OPT_bytetyp; OPT_impCtxt.ref[2] = OPT_booltyp; OPT_impCtxt.ref[3] = OPT_chartyp; - OPT_impCtxt.ref[5] = OPT_inttyp; - OPT_impCtxt.ref[7] = OPT_realtyp; - OPT_impCtxt.ref[8] = OPT_lrltyp; - OPT_impCtxt.ref[9] = OPT_settyp; - OPT_impCtxt.ref[10] = OPT_stringtyp; - OPT_impCtxt.ref[11] = OPT_niltyp; - OPT_impCtxt.ref[12] = OPT_notyp; - OPT_impCtxt.ref[13] = OPT_sysptrtyp; + OPT_impCtxt.ref[4] = OPT_inttyp; + OPT_impCtxt.ref[5] = OPT_realtyp; + OPT_impCtxt.ref[6] = OPT_lrltyp; + OPT_impCtxt.ref[7] = OPT_settyp; + OPT_impCtxt.ref[8] = OPT_stringtyp; + OPT_impCtxt.ref[9] = OPT_niltyp; + OPT_impCtxt.ref[10] = OPT_notyp; + OPT_impCtxt.ref[11] = OPT_sysptrtyp; OPT_IntTypes[1] = OPT_sinttyp; OPT_IntTypes[2] = OPT_inttyp; OPT_IntTypes[3] = OPT_linttyp; diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index 3e352ca3..307b94e2 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index 7538f014..df62e985 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPC.h" #include "OPM.h" @@ -122,14 +122,14 @@ void OPV_TypSize (OPT_Struct typ) } else if (c == 2) { OPV_TypSize(typ->BaseTyp); typ->size = typ->n * typ->BaseTyp->size; - } else if (f == 13) { + } else if (f == 11) { typ->size = OPM_PointerSize; if (typ->BaseTyp == OPT_undftyp) { OPM_Mark(128, typ->n); } else { OPV_TypSize(typ->BaseTyp); } - } else if (f == 14) { + } else if (f == 12) { typ->size = OPM_ProcSize; } else if (c == 3) { btyp = typ->BaseTyp; @@ -162,7 +162,7 @@ static void OPV_GetTProcNum (OPT_Object obj) oldPos = OPM_errpos; OPM_errpos = obj->scope->adr; typ = obj->link->typ; - if (typ->form == 13) { + if (typ->form == 11) { typ = typ->BaseTyp; } OPT_FindField(obj->name, typ->BaseTyp, &redef); @@ -236,7 +236,7 @@ static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exporte if ((mode == 5 && (obj->vis != 0) == exported)) { typ = obj->typ; OPV_TypSize(obj->typ); - if (typ->form == 13) { + if (typ->form == 11) { typ = typ->BaseTyp; } if (typ->comp == 4) { @@ -348,7 +348,7 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN case 12: switch (subclass) { case 1: - if (form == 9) { + if (form == 7) { _o_result = 4; return _o_result; } else { @@ -357,7 +357,7 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN } break; case 2: - if (form == 9) { + if (form == 7) { _o_result = 3; return _o_result; } else { @@ -370,7 +370,7 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN return _o_result; break; case 6: - if (form == 9) { + if (form == 7) { _o_result = 2; return _o_result; } else { @@ -379,7 +379,7 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN } break; case 7: - if (form == 9) { + if (form == 7) { _o_result = 4; return _o_result; } else { @@ -463,7 +463,7 @@ static BOOLEAN OPV_SideEffects (OPT_Node n) static void OPV_Entier (OPT_Node n, INTEGER prec) { - if (__IN(n->typ->form, 0x0180)) { + if (__IN(n->typ->form, 0x60)) { OPM_WriteString((CHAR*)"__ENTIER(", 10); OPV_expr(n, -1); OPM_Write(')'); @@ -502,11 +502,11 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec) INTEGER from, to; from = n->typ->form; to = newtype->form; - if (to == 9) { + if (to == 7) { OPM_WriteString((CHAR*)"__SETOF(", 9); OPV_Entier(n, -1); OPM_Write(')'); - } else if (to == 5) { + } else if (to == 4) { if ((newtype->size < n->typ->size && __IN(2, OPM_opt))) { OPM_WriteString((CHAR*)"__SHORT", 8); if (OPV_SideEffects(n)) { @@ -541,7 +541,7 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec) static void OPV_TypeOf (OPT_Node n) { - if (n->typ->form == 13) { + if (n->typ->form == 11) { OPM_WriteString((CHAR*)"__TYPEOF(", 10); OPV_expr(n, -1); OPM_Write(')'); @@ -793,14 +793,14 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) } else if (OPV_ansi) { if ((__IN(comp, 0x0c) && n->class == 7)) { OPM_WriteString((CHAR*)"(CHAR*)", 8); - } else if ((((form == 13 && typ != n->typ)) && n->typ != OPT_niltyp)) { + } else if ((((form == 11 && typ != n->typ)) && n->typ != OPT_niltyp)) { OPM_WriteString((CHAR*)"(void*)", 8); } } else { - if ((__IN(form, 0x0180) && n->typ->form == 5)) { + if ((__IN(form, 0x60) && n->typ->form == 4)) { OPM_WriteString((CHAR*)"(double)", 9); prec = 9; - } else if (form == 5) { + } else if (form == 4) { OPV_SizeCast(n->typ->size, typ->size); } } @@ -811,7 +811,7 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) } if ((((mode == 2 && n->class == 11)) && n->subcl == 29)) { OPV_expr(n->left, prec); - } else if ((form == 5 && n->class == 7)) { + } else if ((form == 4 && n->class == 7)) { OPV_ParIntLiteral(n->conval->intval, n->typ->size); } else { OPV_expr(n, prec); @@ -860,7 +860,7 @@ static OPT_Object OPV_SuperProc (OPT_Node n) OPT_Object obj = NIL; OPT_Struct typ = NIL; typ = n->right->typ; - if (typ->form == 13) { + if (typ->form == 11) { typ = typ->BaseTyp; } OPT_FindField(n->left->obj->name, typ->BaseTyp, &obj); @@ -901,7 +901,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPV_expr(l, exprPrec); break; case 7: - if (form == 9) { + if (form == 7) { OPM_Write('~'); } else { OPM_Write('-'); @@ -929,7 +929,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) break; case 21: if (OPV_SideEffects(l)) { - if (l->typ->form < 7) { + if (l->typ->form < 5) { if (l->typ->size <= 4) { OPM_WriteString((CHAR*)"(int)", 6); } @@ -958,18 +958,18 @@ static void OPV_expr (OPT_Node n, INTEGER prec) if (l->class == 1) { OPC_CompleteIdent(l->obj); } else { - if ((l->typ->form != 10 && !__IN(l->typ->comp, 0x0c))) { + if ((l->typ->form != 8 && !__IN(l->typ->comp, 0x0c))) { OPM_Write('&'); } OPV_expr(l, exprPrec); } break; case 29: - if (!__IN(l->class, 0x17) || (((__IN(n->typ->form, 0x6220) && __IN(l->typ->form, 0x6220))) && n->typ->size == l->typ->size)) { + if (!__IN(l->class, 0x17) || (((__IN(n->typ->form, 0x1890) && __IN(l->typ->form, 0x1890))) && n->typ->size == l->typ->size)) { OPM_Write('('); OPC_Ident(n->typ->strobj); OPM_Write(')'); - if (__IN(n->typ->form, 0x6000) || __IN(l->typ->form, 0x6000)) { + if (__IN(n->typ->form, 0x1800) || __IN(l->typ->form, 0x1800)) { OPM_WriteString((CHAR*)"(SYSTEM_ADRINT)", 16); } OPV_expr(l, exprPrec); @@ -1079,7 +1079,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) break; case 9: case 10: case 11: case 12: case 13: case 14: - if (__IN(l->typ->form, 0x8400)) { + if (__IN(l->typ->form, 0x2100)) { OPM_WriteString((CHAR*)"__STRCMP(", 10); OPV_expr(l, -1); OPM_WriteString((CHAR*)", ", 3); @@ -1091,31 +1091,31 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPV_expr(l, exprPrec); OPC_Cmp(subclass); typ = l->typ; - if ((((((typ->form == 13 && r->typ->form != 11)) && r->typ != typ)) && r->typ != OPT_sysptrtyp)) { + if ((((((typ->form == 11 && r->typ->form != 9)) && r->typ != typ)) && r->typ != OPT_sysptrtyp)) { OPM_WriteString((CHAR*)"(void *) ", 10); } OPV_expr(r, exprPrec); } break; default: - if (subclass == 5 || (form == 9 && (subclass == 1 || subclass == 7))) { + if (subclass == 5 || (form == 7 && (subclass == 1 || subclass == 7))) { OPM_Write('('); } OPV_expr(l, exprPrec); switch (subclass) { case 1: - if (form == 9) { + if (form == 7) { OPM_WriteString((CHAR*)" & ", 4); } else { OPM_WriteString((CHAR*)" * ", 4); } break; case 2: - if (form == 9) { + if (form == 7) { OPM_WriteString((CHAR*)" ^ ", 4); } else { OPM_WriteString((CHAR*)" / ", 4); - if (r->obj == NIL || r->obj->typ->form == 5) { + if (r->obj == NIL || r->obj->typ->form == 4) { OPM_Write('('); OPC_Ident(n->typ->strobj); OPM_Write(')'); @@ -1126,14 +1126,14 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPM_WriteString((CHAR*)" && ", 5); break; case 6: - if (form == 9) { + if (form == 7) { OPM_WriteString((CHAR*)" | ", 4); } else { OPM_WriteString((CHAR*)" + ", 4); } break; case 7: - if (form == 9) { + if (form == 7) { OPM_WriteString((CHAR*)" & ~", 5); } else { OPM_WriteString((CHAR*)" - ", 4); @@ -1149,7 +1149,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) break; } OPV_expr(r, exprPrec); - if (subclass == 5 || (form == 9 && (subclass == 1 || subclass == 7))) { + if (subclass == 5 || (form == 7 && (subclass == 1 || subclass == 7))) { OPM_Write(')'); } break; @@ -1323,7 +1323,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) if ((base->comp == 4 && OPC_NofPtrs(base) != 0)) { OPC_Ident(base->strobj); OPM_WriteString((CHAR*)"__typ", 6); - } else if (base->form == 13) { + } else if (base->form == 11) { OPM_WriteString((CHAR*)"POINTER__typ", 13); } else { OPM_WriteString((CHAR*)"NIL", 4); @@ -1429,11 +1429,11 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) } OPM_Write(')'); } else { - if ((((((l->typ->form == 13 && l->obj != NIL)) && l->obj->adr == 1)) && l->obj->mode == 1)) { + if ((((((l->typ->form == 11 && l->obj != NIL)) && l->obj->adr == 1)) && l->obj->mode == 1)) { l->obj->adr = 0; OPV_design(l, -1); l->obj->adr = 1; - if (r->typ->form != 11) { + if (r->typ->form != 9) { OPM_WriteString((CHAR*)" = (void*)", 11); } else { OPM_WriteString((CHAR*)" = ", 4); @@ -1444,7 +1444,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) } if (l->typ == r->typ) { OPV_expr(r, -1); - } else if ((((l->typ->form == 13 && r->typ->form != 11)) && l->typ->strobj != NIL)) { + } else if ((((l->typ->form == 11 && r->typ->form != 9)) && l->typ->strobj != NIL)) { OPM_Write('('); OPC_Ident(l->typ->strobj); OPM_Write(')'); @@ -1629,7 +1629,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) } else { if (n->left != NIL) { OPM_WriteString((CHAR*)"_o_result = ", 13); - if ((n->left->typ->form == 13 && n->obj->typ != n->left->typ)) { + if ((n->left->typ->form == 11 && n->obj->typ != n->left->typ)) { OPM_WriteString((CHAR*)"(void*)", 8); OPV_expr(n->left, 10); } else { diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index 0299d34b..06bc39f1 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 2508f6f7..033e03cf 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index 4c7f2849..34d088bf 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index bea1f4aa..28a855aa 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index 6eeb5a87..65543fac 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index f1d4f53d..834c1fb1 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index 43656e74..2edcc736 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index e473e702..df4278f7 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Files.h" #include "Modules.h" diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index 34a403f2..c878ff62 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/Vishap.c b/bootstrap/unix-44/Vishap.c index 7c16c24d..030b94f6 100644 --- a/bootstrap/unix-44/Vishap.c +++ b/bootstrap/unix-44/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkamSf */ #include "SYSTEM.h" #include "Configuration.h" #include "Heap.h" diff --git a/bootstrap/unix-44/errors.c b/bootstrap/unix-44/errors.c index 7a91fc31..3f916fe9 100644 --- a/bootstrap/unix-44/errors.c +++ b/bootstrap/unix-44/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/unix-44/errors.h b/bootstrap/unix-44/errors.h index 4a787a17..2afac320 100644 --- a/bootstrap/unix-44/errors.h +++ b/bootstrap/unix-44/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index cfb79ac9..bfab2dc6 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index fb0797f3..ca635519 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-44/vt100.c b/bootstrap/unix-44/vt100.c index dfe62efa..84707926 100644 --- a/bootstrap/unix-44/vt100.c +++ b/bootstrap/unix-44/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Strings.h" diff --git a/bootstrap/unix-44/vt100.h b/bootstrap/unix-44/vt100.h index 73d985c9..6266a678 100644 --- a/bootstrap/unix-44/vt100.h +++ b/bootstrap/unix-44/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index eed3c4f0..fb7df026 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -13,6 +13,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/08/31] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/01] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index 90696149..61b33bc5 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Console.c b/bootstrap/unix-48/Console.c index 124f7163..816df1b9 100644 --- a/bootstrap/unix-48/Console.c +++ b/bootstrap/unix-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Platform.h" diff --git a/bootstrap/unix-48/Console.h b/bootstrap/unix-48/Console.h index fad0f676..2c01265d 100644 --- a/bootstrap/unix-48/Console.h +++ b/bootstrap/unix-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index a6db1a11..bd3e3fd5 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index 61089cbd..985572ec 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index f35765c6..50d17d87 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tskSfF */ #include "SYSTEM.h" struct Heap__1 { diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index 4d5c5b4e..a4e30a5e 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index 9f39f448..52abc5b8 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Heap.h" diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index 1707868f..6bee52c7 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index e6e966a6..a3322969 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" @@ -317,7 +317,7 @@ void OPB_DeRef (OPT_Node *x) typ = (*x)->typ; if ((*x)->class >= 7) { OPB_err(78); - } else if (typ->form == 13) { + } else if (typ->form == 11) { if (typ == OPT_sysptrtyp) { OPB_err(57); } @@ -340,7 +340,7 @@ void OPB_Index (OPT_Node *x, OPT_Node y) f = y->typ->form; if ((*x)->class >= 7) { OPB_err(79); - } else if (f != 5 || __IN(y->class, 0x0300)) { + } else if (f != 4 || __IN(y->class, 0x0300)) { OPB_err(80); y->typ = OPT_inttyp; } @@ -437,10 +437,10 @@ void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) TypTest__57_s = &_s; if (OPB_NotVar(*x)) { OPB_err(112); - } else if ((*x)->typ->form == 13) { + } else if ((*x)->typ->form == 11) { if (((*x)->typ->BaseTyp->comp != 4 && (*x)->typ != OPT_sysptrtyp)) { OPB_err(85); - } else if (obj->typ->form == 13) { + } else if (obj->typ->form == 11) { GTT__58((*x)->typ->BaseTyp, obj->typ->BaseTyp); } else { OPB_err(86); @@ -465,7 +465,7 @@ void OPB_In (OPT_Node *x, OPT_Node y) f = (*x)->typ->form; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); - } else if ((f == 5 && y->typ->form == 9)) { + } else if ((f == 4 && y->typ->form == 7)) { if ((*x)->class == 7) { k = (*x)->conval->intval; if (k < 0 || k > OPM_MaxSet) { @@ -504,7 +504,7 @@ static LONGINT OPB_log (LONGINT x) static void OPB_CheckRealType (INTEGER f, INTEGER nr, OPT_Const x) { LONGREAL min, max, r; - if (f == 7) { + if (f == 5) { min = OPM_MinReal; max = OPM_MaxReal; } else { @@ -515,7 +515,7 @@ static void OPB_CheckRealType (INTEGER f, INTEGER nr, OPT_Const x) if (r > max || r < min) { OPB_err(nr); x->realval = (LONGREAL)1; - } else if (f == 7) { + } else if (f == 5) { x->realval = x->realval; } x->intval = -1; @@ -567,21 +567,21 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } break; case 6: - if (!__IN(f, 0x01a0)) { + if (!__IN(f, 0x70)) { OPB_err(96); } break; case 7: - if (__IN(f, 0x03a0)) { + if (__IN(f, 0xf0)) { if (z->class == 7) { - if (f == 5) { + if (f == 4) { if (z->conval->intval == (-2147483647-1)) { OPB_err(203); } else { z->conval->intval = -z->conval->intval; OPB_SetIntType(z); } - } else if (__IN(f, 0x0180)) { + } else if (__IN(f, 0x60)) { z->conval->realval = -z->conval->realval; } else { z->conval->setval = ~z->conval->setval; @@ -595,9 +595,9 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } break; case 21: - if (__IN(f, 0x01a0)) { + if (__IN(f, 0x70)) { if (z->class == 7) { - if (f == 5) { + if (f == 4) { if (z->conval->intval == (-2147483647-1)) { OPB_err(203); } else { @@ -629,7 +629,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } break; case 23: - if (f == 5) { + if (f == 4) { if (z->class == 7) { z->conval->intval = OPB_BoolToInt(__ODD(z->conval->intval)); z->obj = NIL; @@ -644,9 +644,9 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) case 24: if ((((z->class == 7 && f == 3)) && z->conval->intval >= 32)) { OPB_CharToString(z); - f = 10; + f = 8; } - if (z->class < 7 || f == 10) { + if (z->class < 7 || f == 8) { z = NewOp__29(op, typ, z); } else { OPB_err(127); @@ -654,7 +654,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->typ = OPT_linttyp; break; case 25: - if ((f == 5 && z->class == 7)) { + if ((f == 4 && z->class == 7)) { if ((0 <= z->conval->intval && z->conval->intval <= -1)) { z = NewOp__29(op, typ, z); } else { @@ -681,7 +681,7 @@ static void OPB_CheckPtr (OPT_Node x, OPT_Node y) INTEGER g; OPT_Struct p = NIL, q = NIL, t = NIL; g = y->typ->form; - if (g == 13) { + if (g == 11) { p = x->typ->BaseTyp; q = y->typ->BaseTyp; if ((p->comp == 4 && q->comp == 4)) { @@ -699,7 +699,7 @@ static void OPB_CheckPtr (OPT_Node x, OPT_Node y) } else { OPB_err(100); } - } else if (g != 11) { + } else if (g != 9) { OPB_err(100); } } @@ -716,7 +716,7 @@ void OPB_CheckParameters (OPT_Object fp, OPT_Object ap, BOOLEAN checkNames) at = at->BaseTyp; } if (ft != at) { - if ((ft->form == 14 && at->form == 14)) { + if ((ft->form == 12 && at->form == 12)) { if (ft->BaseTyp == at->BaseTyp) { OPB_CheckParameters(ft->link, at->link, 0); } else { @@ -777,7 +777,7 @@ static INTEGER ConstCmp__14 (void) case 0: res = 9; break; - case 1: case 3: case 4: case 5: + case 1: case 3: case 4: if ((*ConstOp__13_s->xval)->intval < (*ConstOp__13_s->yval)->intval) { res = 11; } else if ((*ConstOp__13_s->xval)->intval > (*ConstOp__13_s->yval)->intval) { @@ -786,7 +786,7 @@ static INTEGER ConstCmp__14 (void) res = 9; } break; - case 7: case 8: + case 5: case 6: if ((*ConstOp__13_s->xval)->realval < (*ConstOp__13_s->yval)->realval) { res = 11; } else if ((*ConstOp__13_s->xval)->realval > (*ConstOp__13_s->yval)->realval) { @@ -802,14 +802,14 @@ static INTEGER ConstCmp__14 (void) res = 9; } break; - case 9: + case 7: if ((*ConstOp__13_s->xval)->setval != (*ConstOp__13_s->yval)->setval) { res = 10; } else { res = 9; } break; - case 10: + case 8: if (__STRCMP(*(*ConstOp__13_s->xval)->ext, *(*ConstOp__13_s->yval)->ext) < 0) { res = 11; } else if (__STRCMP(*(*ConstOp__13_s->xval)->ext, *(*ConstOp__13_s->yval)->ext) > 0) { @@ -818,7 +818,7 @@ static INTEGER ConstCmp__14 (void) res = 9; } break; - case 11: case 13: case 14: + case 9: case 11: case 12: if ((*ConstOp__13_s->xval)->intval != (*ConstOp__13_s->yval)->intval) { res = 10; } else { @@ -856,7 +856,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) if (f != g) { switch (f) { case 3: - if (g == 10) { + if (g == 8) { OPB_CharToString(x); } else { OPB_err(100); @@ -864,17 +864,17 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) __GUARDEQP(yval, OPT_ConstDesc) = *xval; } break; - case 5: - if (g == 5) { + case 4: + if (g == 4) { if (x->typ->size <= y->typ->size) { x->typ = y->typ; } else { x->typ = OPT_IntType(x->typ->size); } - } else if (g == 7) { + } else if (g == 5) { x->typ = OPT_realtyp; xval->realval = xval->intval; - } else if (g == 8) { + } else if (g == 6) { x->typ = OPT_lrltyp; xval->realval = xval->intval; } else { @@ -883,11 +883,11 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) __GUARDEQP(yval, OPT_ConstDesc) = *xval; } break; - case 7: - if (g == 5) { + case 5: + if (g == 4) { y->typ = x->typ; yval->realval = yval->intval; - } else if (g == 8) { + } else if (g == 6) { x->typ = OPT_lrltyp; } else { OPB_err(100); @@ -895,11 +895,11 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) __GUARDEQP(yval, OPT_ConstDesc) = *xval; } break; - case 8: - if (g == 5) { + case 6: + if (g == 4) { y->typ = x->typ; yval->realval = yval->intval; - } else if (g == 7) { + } else if (g == 5) { y->typ = OPT_lrltyp; } else { OPB_err(100); @@ -907,26 +907,26 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) __GUARDEQP(yval, OPT_ConstDesc) = *xval; } break; - case 10: + case 8: if (g == 3) { OPB_CharToString(y); - g = 10; + g = 8; } else { OPB_err(100); y->typ = x->typ; __GUARDEQP(yval, OPT_ConstDesc) = *xval; } break; - case 11: - if (!__IN(g, 0x6000)) { + case 9: + if (!__IN(g, 0x1800)) { OPB_err(100); } break; - case 13: + case 11: OPB_CheckPtr(x, y); break; - case 14: - if (g != 11) { + case 12: + if (g != 9) { OPB_err(100); } break; @@ -940,7 +940,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } switch (op) { case 1: - if (f == 5) { + if (f == 4) { xv = xval->intval; yv = yval->intval; if (((((xv == 0 || yv == 0) || (((xv > 0 && yv > 0)) && yv <= __DIV(2147483647, xv))) || (((xv > 0 && yv < 0)) && yv >= __DIV((-2147483647-1), xv))) || (((xv < 0 && yv > 0)) && xv >= __DIV((-2147483647-1), yv))) || (((((((xv < 0 && yv < 0)) && xv != (-2147483647-1))) && yv != (-2147483647-1))) && -xv <= __DIV(2147483647, -yv))) { @@ -949,7 +949,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } else { OPB_err(204); } - } else if (__IN(f, 0x0180)) { + } else if (__IN(f, 0x60)) { temp = __ABS(yval->realval) <= (LONGREAL)1; if (temp || __ABS(xval->realval) <= 1.79769296342094e+308 / (LONGREAL)__ABS(yval->realval)) { xval->realval = xval->realval * yval->realval; @@ -957,23 +957,23 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } else { OPB_err(204); } - } else if (f == 9) { + } else if (f == 7) { xval->setval = (xval->setval & yval->setval); } else if (f != 0) { OPB_err(101); } break; case 2: - if (f == 5) { + if (f == 4) { if (yval->intval != 0) { xval->realval = xval->intval / (REAL)yval->intval; - OPB_CheckRealType(7, 205, xval); + OPB_CheckRealType(5, 205, xval); } else { OPB_err(205); xval->realval = (LONGREAL)1; } x->typ = OPT_realtyp; - } else if (__IN(f, 0x0180)) { + } else if (__IN(f, 0x60)) { temp = __ABS(yval->realval) >= (LONGREAL)1; if (temp || __ABS(xval->realval) <= 1.79769296342094e+308 * __ABS(yval->realval)) { xval->realval = xval->realval / yval->realval; @@ -981,14 +981,14 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } else { OPB_err(205); } - } else if (f == 9) { + } else if (f == 7) { xval->setval = xval->setval ^ yval->setval; } else if (f != 0) { OPB_err(102); } break; case 3: - if (f == 5) { + if (f == 4) { if (yval->intval != 0) { xval->intval = __DIV(xval->intval, yval->intval); OPB_SetIntType(x); @@ -1000,7 +1000,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 4: - if (f == 5) { + if (f == 4) { if (yval->intval != 0) { xval->intval = (int)__MOD(xval->intval, yval->intval); OPB_SetIntType(x); @@ -1019,7 +1019,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 6: - if (f == 5) { + if (f == 4) { temp = (yval->intval >= 0 && xval->intval <= 2147483647 - yval->intval); if (temp || (yval->intval < 0 && xval->intval >= (-2147483647-1) - yval->intval)) { xval->intval += yval->intval; @@ -1027,7 +1027,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } else { OPB_err(206); } - } else if (__IN(f, 0x0180)) { + } else if (__IN(f, 0x60)) { temp = (yval->realval >= (LONGREAL)0 && xval->realval <= 1.79769296342094e+308 - yval->realval); if (temp || (yval->realval < (LONGREAL)0 && xval->realval >= -1.79769296342094e+308 - yval->realval)) { xval->realval = xval->realval + yval->realval; @@ -1035,21 +1035,21 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } else { OPB_err(206); } - } else if (f == 9) { + } else if (f == 7) { xval->setval = xval->setval | yval->setval; } else if (f != 0) { OPB_err(105); } break; case 7: - if (f == 5) { + if (f == 4) { if ((yval->intval >= 0 && xval->intval >= (-2147483647-1) + yval->intval) || (yval->intval < 0 && xval->intval <= 2147483647 + yval->intval)) { xval->intval -= yval->intval; OPB_SetIntType(x); } else { OPB_err(207); } - } else if (__IN(f, 0x0180)) { + } else if (__IN(f, 0x60)) { temp = (yval->realval >= (LONGREAL)0 && xval->realval >= -1.79769296342094e+308 + yval->realval); if (temp || (yval->realval < (LONGREAL)0 && xval->realval <= 1.79769296342094e+308 + yval->realval)) { xval->realval = xval->realval - yval->realval; @@ -1057,7 +1057,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } else { OPB_err(207); } - } else if (f == 9) { + } else if (f == 7) { xval->setval = (xval->setval & ~yval->setval); } else if (f != 0) { OPB_err(106); @@ -1077,28 +1077,28 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) xval->intval = OPB_BoolToInt(ConstCmp__14() != 9); break; case 11: - if (__IN(f, 0x2a04)) { + if (__IN(f, 0x0a84)) { OPB_err(108); } else { xval->intval = OPB_BoolToInt(ConstCmp__14() == 11); } break; case 12: - if (__IN(f, 0x2a04)) { + if (__IN(f, 0x0a84)) { OPB_err(108); } else { xval->intval = OPB_BoolToInt(ConstCmp__14() != 13); } break; case 13: - if (__IN(f, 0x2a04)) { + if (__IN(f, 0x0a84)) { OPB_err(108); } else { xval->intval = OPB_BoolToInt(ConstCmp__14() == 13); } break; case 14: - if (__IN(f, 0x2a04)) { + if (__IN(f, 0x0a84)) { OPB_err(108); } else { xval->intval = OPB_BoolToInt(ConstCmp__14() != 11); @@ -1122,8 +1122,8 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) f = (*x)->typ->form; g = typ->form; if ((*x)->class == 7) { - if (f == 5) { - if (g == 5) { + if (f == 4) { + if (g == 4) { if (f > g) { OPB_SetIntType(*x); if ((*x)->typ->size > typ->size) { @@ -1131,7 +1131,7 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) (*x)->conval->intval = 1; } } - } else if (__IN(g, 0x0180)) { + } else if (__IN(g, 0x60)) { (*x)->conval->realval = (*x)->conval->intval; (*x)->conval->intval = -1; } else { @@ -1140,8 +1140,8 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) OPB_err(220); } } - } else if (__IN(f, 0x0180)) { - if (__IN(g, 0x0180)) { + } else if (__IN(f, 0x60)) { + if (__IN(g, 0x60)) { OPB_CheckRealType(g, 203, (*x)->conval); } else { r = (*x)->conval->realval; @@ -1190,25 +1190,25 @@ static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) { BOOLEAN _o_result; BOOLEAN ok, xCharArr, yCharArr; - xCharArr = (__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp->form == 3) || *Op__38_s->f == 10; - yCharArr = (__IN((*y)->typ->comp, 0x0c) && (*y)->typ->BaseTyp->form == 3) || *Op__38_s->g == 10; + xCharArr = (__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp->form == 3) || *Op__38_s->f == 8; + yCharArr = (__IN((*y)->typ->comp, 0x0c) && (*y)->typ->BaseTyp->form == 3) || *Op__38_s->g == 8; if ((((xCharArr && *Op__38_s->g == 3)) && (*y)->class == 7)) { OPB_CharToString(*y); - *Op__38_s->g = 10; + *Op__38_s->g = 8; yCharArr = 1; } if ((((yCharArr && *Op__38_s->f == 3)) && (*x)->class == 7)) { OPB_CharToString(*x); - *Op__38_s->f = 10; + *Op__38_s->f = 8; xCharArr = 1; } ok = (xCharArr && yCharArr); if (ok) { - if ((*Op__38_s->f == 10 && (*x)->conval->intval2 == 1)) { + if ((*Op__38_s->f == 8 && (*x)->conval->intval2 == 1)) { (*x)->typ = OPT_chartyp; (*x)->conval->intval = 0; OPB_Index(&*y, OPB_NewIntConst(0)); - } else if ((*Op__38_s->g == 10 && (*y)->conval->intval2 == 1)) { + } else if ((*Op__38_s->g == 8 && (*y)->conval->intval2 == 1)) { (*y)->typ = OPT_chartyp; (*y)->conval->intval = 0; OPB_Index(&*x, OPB_NewIntConst(0)); @@ -1247,49 +1247,49 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPB_err(100); } break; + case 4: + if ((g == 4 && y->typ->size < z->typ->size)) { + OPB_Convert(&y, z->typ); + } else if (__IN(g, 0x70)) { + OPB_Convert(&z, y->typ); + } else { + OPB_err(100); + } + break; case 5: - if ((g == 5 && y->typ->size < z->typ->size)) { + if (g == 4) { OPB_Convert(&y, z->typ); - } else if (__IN(g, 0x01a0)) { + } else if (__IN(g, 0x60)) { OPB_Convert(&z, y->typ); } else { OPB_err(100); } break; - case 7: - if (g == 5) { + case 6: + if (__IN(g, 0x70)) { + OPB_Convert(&y, z->typ); + } else if (__IN(g, 0x60)) { OPB_Convert(&y, z->typ); - } else if (__IN(g, 0x0180)) { - OPB_Convert(&z, y->typ); } else { OPB_err(100); } break; - case 8: - if (__IN(g, 0x01a0)) { - OPB_Convert(&y, z->typ); - } else if (__IN(g, 0x0180)) { - OPB_Convert(&y, z->typ); - } else { + case 9: + if (!__IN(g, 0x1800)) { OPB_err(100); } break; case 11: - if (!__IN(g, 0x6000)) { - OPB_err(100); - } - break; - case 13: OPB_CheckPtr(z, y); break; - case 14: - if (g != 11) { + case 12: + if (g != 9) { OPB_err(100); } break; - case 10: + case 8: break; - case 15: + case 13: if (z->typ->comp == 4) { OPB_err(100); } @@ -1305,7 +1305,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) switch (op) { case 1: do_ = 1; - if (f == 5) { + if (f == 4) { if (z->class == 7) { val = z->conval->intval; if (val == 1) { @@ -1336,7 +1336,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) y->obj = NIL; } } - } else if (!__IN(f, 0x0381)) { + } else if (!__IN(f, 0xe1)) { OPB_err(105); typ = OPT_undftyp; } @@ -1345,18 +1345,18 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 2: - if (f == 5) { + if (f == 4) { if ((y->class == 7 && y->conval->intval == 0)) { OPB_err(205); } OPB_Convert(&z, OPT_realtyp); OPB_Convert(&y, OPT_realtyp); typ = OPT_realtyp; - } else if (__IN(f, 0x0180)) { + } else if (__IN(f, 0x60)) { if ((y->class == 7 && y->conval->realval == (LONGREAL)0)) { OPB_err(205); } - } else if ((f != 9 && f != 0)) { + } else if ((f != 7 && f != 0)) { OPB_err(102); typ = OPT_undftyp; } @@ -1364,7 +1364,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) break; case 3: do_ = 1; - if (f == 5) { + if (f == 4) { if (y->class == 7) { val = y->conval->intval; if (val == 0) { @@ -1387,7 +1387,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 4: - if (f == 5) { + if (f == 4) { if (y->class == 7) { if (y->conval->intval == 0) { OPB_err(205); @@ -1419,12 +1419,12 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 6: - if (!__IN(f, 0x03e1)) { + if (!__IN(f, 0xf1)) { OPB_err(105); typ = OPT_undftyp; } do_ = 1; - if (f == 5) { + if (f == 4) { if ((z->class == 7 && z->conval->intval == 0)) { do_ = 0; z = y; @@ -1438,11 +1438,11 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 7: - if (!__IN(f, 0x03e1)) { + if (!__IN(f, 0xf1)) { OPB_err(106); typ = OPT_undftyp; } - if ((f != 5 || y->class != 7) || y->conval->intval != 0) { + if ((f != 4 || y->class != 7) || y->conval->intval != 0) { NewOp__39(op, typ, &z, y); } break; @@ -1462,7 +1462,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 9: case 10: - if (__IN(f, 0x6bff) || strings__41(&z, &y)) { + if (__IN(f, 0x1aff) || strings__41(&z, &y)) { typ = OPT_booltyp; } else { OPB_err(107); @@ -1471,7 +1471,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) NewOp__39(op, typ, &z, y); break; case 11: case 12: case 13: case 14: - if (__IN(f, 0x01f9) || strings__41(&z, &y)) { + if (__IN(f, 0x79) || strings__41(&z, &y)) { typ = OPT_booltyp; } else { OPM_LogWLn(); @@ -1498,7 +1498,7 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y) LONGINT k, l; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); - } else if (((*x)->typ->form == 5 && y->typ->form == 5)) { + } else if (((*x)->typ->form == 4 && y->typ->form == 4)) { if ((*x)->class == 7) { k = (*x)->conval->intval; if (0 > k || k > OPM_MaxSet) { @@ -1533,7 +1533,7 @@ void OPB_SetElem (OPT_Node *x) LONGINT k; if ((*x)->class == 8 || (*x)->class == 9) { OPB_err(126); - } else if ((*x)->typ->form != 5) { + } else if ((*x)->typ->form != 4) { OPB_err(93); } else if ((*x)->class == 7) { k = (*x)->conval->intval; @@ -1576,40 +1576,40 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPM_LogWNum(ynode->typ->size, 0); OPM_LogWLn(); } - if (ynode->class == 8 || (ynode->class == 9 && f != 14)) { + if (ynode->class == 8 || (ynode->class == 9 && f != 12)) { OPB_err(126); } switch (f) { - case 0: case 10: + case 0: case 8: break; case 1: - if (!((__IN(g, 0x2a) && y->size == 1))) { + if (!((__IN(g, 0x1a) && y->size == 1))) { OPB_err(113); } break; - case 2: case 3: case 9: + case 2: case 3: case 7: if (g != f) { OPB_err(113); } break; + case 4: + if (g != 4 || x->size < y->size) { + OPB_err(113); + } + break; case 5: - if (g != 5 || x->size < y->size) { + if (!__IN(g, 0x30)) { OPB_err(113); } break; - case 7: - if (!__IN(g, 0xe0)) { + case 6: + if (!__IN(g, 0x70)) { OPB_err(113); } break; - case 8: - if (!__IN(g, 0x01e0)) { - OPB_err(113); - } - break; - case 13: - if ((x == y || g == 11) || (x == OPT_sysptrtyp && g == 13)) { - } else if (g == 13) { + case 11: + if ((x == y || g == 9) || (x == OPT_sysptrtyp && g == 11)) { + } else if (g == 11) { p = x->BaseTyp; q = y->BaseTyp; if ((p->comp == 4 && q->comp == 4)) { @@ -1626,28 +1626,28 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPB_err(113); } break; - case 14: + case 12: if (ynode->class == 9) { OPB_CheckProc(x, ynode->obj); - } else if (x == y || g == 11) { + } else if (x == y || g == 9) { } else { OPB_err(113); } break; - case 12: case 11: + case 10: case 9: OPB_err(113); break; - case 15: + case 13: x->pvused = 1; if (x->comp == 2) { if ((ynode->class == 7 && g == 3)) { OPB_CharToString(ynode); y = ynode->typ; - g = 10; + g = 8; } if (x == y) { } else if (x->BaseTyp == OPT_chartyp) { - if (g == 10) { + if (g == 8) { if (ynode->conval->intval2 > x->n) { OPB_err(114); } @@ -1686,7 +1686,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPM_LogWLn(); break; } - if ((((((ynode->class == 7 && g < f)) && __IN(g, 0xe0))) && __IN(f, 0x01e0))) { + if ((((((ynode->class == 7 && g < f)) && __IN(g, 0x30))) && __IN(f, 0x70))) { OPB_Convert(&ynode, x); } } @@ -1704,7 +1704,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) f = x->typ->form; switch (fctno) { case 0: - if ((f == 5 && x->class == 7)) { + if ((f == 4 && x->class == 7)) { if ((0 <= x->conval->intval && x->conval->intval <= 255)) { OPB_BindNodes(28, OPT_notyp, &x, x); } else { @@ -1719,7 +1719,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) typ = OPT_notyp; if (OPB_NotVar(x)) { OPB_err(112); - } else if (f == 13) { + } else if (f == 11) { if (x->readonly) { OPB_err(76); } @@ -1757,7 +1757,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 5: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x0180)) { + } else if (__IN(f, 0x60)) { OPB_Convert(&x, OPT_linttyp); } else { OPB_err(111); @@ -1777,17 +1777,17 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) x = OPB_NewIntConst(0); x->typ = OPT_chartyp; break; - case 5: + case 4: x = OPB_NewIntConst(OPM_SignedMinimum(x->typ->size)); break; - case 9: + case 7: x = OPB_NewIntConst(0); x->typ = OPT_inttyp; break; - case 7: + case 5: x = OPB_NewRealConst(OPM_MinReal, OPT_realtyp); break; - case 8: + case 6: x = OPB_NewRealConst(OPM_MinLReal, OPT_lrltyp); break; default: @@ -1808,17 +1808,17 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) x = OPB_NewIntConst(255); x->typ = OPT_chartyp; break; - case 5: + case 4: x = OPB_NewIntConst(OPM_SignedMaximum(x->typ->size)); break; - case 9: + case 7: x = OPB_NewIntConst(OPM_MaxSet); x->typ = OPT_inttyp; break; - case 7: + case 5: x = OPB_NewRealConst(OPM_MaxReal, OPT_realtyp); break; - case 8: + case 6: x = OPB_NewRealConst(OPM_MaxLReal, OPT_lrltyp); break; default: @@ -1832,7 +1832,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 9: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x21)) { + } else if (__IN(f, 0x11)) { OPB_Convert(&x, OPT_chartyp); } else { OPB_err(111); @@ -1842,14 +1842,14 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 10: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 5) { + } else if (f == 4) { typ = OPT_ShorterOrLongerType(x->typ, -1); if (typ == NIL) { OPB_err(111); } else { OPB_Convert(&x, typ); } - } else if (f == 8) { + } else if (f == 6) { OPB_Convert(&x, OPT_realtyp); } else { OPB_err(111); @@ -1858,14 +1858,14 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 11: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 5) { + } else if (f == 4) { typ = OPT_ShorterOrLongerType(x->typ, 1); if (typ == NIL) { OPB_err(111); } else { OPB_Convert(&x, typ); } - } else if (f == 7) { + } else if (f == 5) { OPB_Convert(&x, OPT_lrltyp); } else if (f == 3) { OPB_Convert(&x, OPT_linttyp); @@ -1876,7 +1876,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 13: case 14: if (OPB_NotVar(x)) { OPB_err(112); - } else if (f != 5) { + } else if (f != 4) { OPB_err(111); } else if (x->readonly) { OPB_err(76); @@ -1900,18 +1900,18 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 18: if ((x->class == 7 && f == 3)) { OPB_CharToString(x); - f = 10; + f = 8; } if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (((!__IN(x->typ->comp, 0x0c) || x->typ->BaseTyp->form != 3) && f != 10)) { + } else if (((!__IN(x->typ->comp, 0x0c) || x->typ->BaseTyp->form != 3) && f != 8)) { OPB_err(111); } break; case 19: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 5) { + } else if (f == 4) { if (x->typ->size != OPM_LIntSize) { OPB_Convert(&x, OPT_linttyp); } @@ -1928,7 +1928,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) if (x->class != 8) { OPB_err(110); x = OPB_NewIntConst(1); - } else if (__IN(f, 0x63fe) || __IN(x->typ->comp, 0x14)) { + } else if (__IN(f, 0x18fe) || __IN(x->typ->comp, 0x14)) { (*OPB_typSize)(x->typ); x->typ->pvused = 1; x = OPB_NewIntConst(x->typ->size); @@ -1943,22 +1943,22 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 22: case 23: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (!__IN(f, 0x022a)) { + } else if (!__IN(f, 0x9a)) { OPB_err(111); } break; case 24: case 25: case 28: case 31: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((((x->class == 7 && f == 5)) && x->typ->size < OPT_linttyp->size)) { + } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x2020) && x->typ->size == OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x0810) && x->typ->size == OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } break; case 26: case 27: - if ((f == 5 && x->class == 7)) { + if ((f == 4 && x->class == 7)) { if (x->conval->intval < 0 || x->conval->intval > -1) { OPB_err(220); } @@ -1969,14 +1969,14 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 29: if (x->class != 8) { OPB_err(110); - } else if (__IN(f, 0x1401) || x->typ->comp == 3) { + } else if (__IN(f, 0x0501) || x->typ->comp == 3) { OPB_err(111); } break; case 30: if (OPB_NotVar(x)) { OPB_err(112); - } else if (f == 13) { + } else if (f == 11) { } else { OPB_err(111); } @@ -2036,7 +2036,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) p->typ = OPT_notyp; } else { if (x->typ != p->typ) { - if ((x->class == 7 && f == 5)) { + if ((x->class == 7 && f == 4)) { OPB_Convert(&x, p->typ); } else { OPB_err(111); @@ -2049,7 +2049,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 15: case 16: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 5) { + } else if (f == 4) { if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > OPM_MaxSet))) { OPB_err(202); } @@ -2060,7 +2060,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) p->typ = OPT_notyp; break; case 17: - if (!(f == 5) || x->class != 7) { + if (!(f == 4) || x->class != 7) { OPB_err(69); } else if (x->typ->size == 1) { L = (SYSTEM_INT16)x->conval->intval; @@ -2109,7 +2109,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 19: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 5) { + } else if (f == 4) { if ((p->class == 7 && x->class == 7)) { if (-OPB_maxExp > x->conval->intval || x->conval->intval > OPB_maxExp) { OPB_err(208); @@ -2137,7 +2137,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (p->typ->comp == 3) { - if (f == 5) { + if (f == 4) { if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > OPM_MaxIndex))) { OPB_err(63); } @@ -2153,7 +2153,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 22: case 23: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f != 5) { + } else if (f != 4) { OPB_err(111); } else { if (fctno == 22) { @@ -2167,7 +2167,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 24: case 25: case 26: case 27: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x63ff)) { + } else if (__IN(f, 0x18ff)) { if (fctno == 24 || fctno == 26) { if (OPB_NotVar(x)) { OPB_err(112); @@ -2185,7 +2185,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 28: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 5) { + } else if (f == 4) { p = NewOp__53(12, 26, p, x); } else { OPB_err(111); @@ -2193,7 +2193,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) p->typ = OPT_booltyp; break; case 29: - if (((x->class == 8 || x->class == 9) || __IN(f, 0x1401)) || x->typ->comp == 3) { + if (((x->class == 8 || x->class == 9) || __IN(f, 0x0501)) || x->typ->comp == 3) { OPB_err(126); } if (x->typ->size < p->typ->size) { @@ -2209,7 +2209,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 30: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 5) { + } else if (f == 4) { p = NewOp__53(19, 30, p, x); } else { OPB_err(111); @@ -2219,16 +2219,16 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 31: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((((x->class == 7 && f == 5)) && x->typ->size < OPT_linttyp->size)) { + } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x2020) && x->typ->size == OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x0810) && x->typ->size == OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } p->link = x; break; case 32: - if ((f == 5 && x->class == 7)) { + if ((f == 4 && x->class == 7)) { if ((0 <= x->conval->intval && x->conval->intval <= 255)) { OPB_BindNodes(28, OPT_notyp, &x, x); x->conval = OPT_NewConst(); @@ -2271,7 +2271,7 @@ void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n) OPB_err(126); } else if (p->typ->comp != 3) { OPB_err(64); - } else if (f == 5) { + } else if (f == 4) { if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > OPM_MaxIndex))) { OPB_err(63); } @@ -2287,7 +2287,7 @@ void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n) } else if ((fctno == 31 && n == 2)) { if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 5) { + } else if (f == 4) { node = OPT_NewNode(19); node->subcl = 31; node->right = p; @@ -2375,7 +2375,7 @@ static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpa ftyp = ftyp->BaseTyp; atyp = atyp->BaseTyp; if ((fvarpar && ftyp == OPT_bytetyp)) { - if (!__IN(f, 0x0c) || !((__IN(atyp->form, 0x2e) && atyp->size == 1))) { + if (!__IN(f, 0x0c) || !((__IN(atyp->form, 0x1e) && atyp->size == 1))) { if (__IN(18, OPM_opt)) { OPB_err(-301); } @@ -2384,7 +2384,7 @@ static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpa if (ftyp->comp == 3) { OPB_DynArrParCheck(ftyp, atyp, fvarpar); } else if (ftyp != atyp) { - if ((((!fvarpar && ftyp->form == 13)) && atyp->form == 13)) { + if ((((!fvarpar && ftyp->form == 11)) && atyp->form == 11)) { ftyp = ftyp->BaseTyp; atyp = atyp->BaseTyp; if ((ftyp->comp == 4 && atyp->comp == 4)) { @@ -2408,7 +2408,7 @@ static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpa static void OPB_CheckReceiver (OPT_Node *x, OPT_Object fp) { - if (fp->typ->form == 13) { + if (fp->typ->form == 11) { if ((*x)->class == 3) { *x = (*x)->left; } else { @@ -2425,7 +2425,7 @@ void OPB_PrepCall (OPT_Node *x, OPT_Object *fpar) OPB_CheckReceiver(&(*x)->left, *fpar); *fpar = (*fpar)->link; } - } else if (((((*x)->class != 8 && (*x)->typ != NIL)) && (*x)->typ->form == 14)) { + } else if (((((*x)->class != 8 && (*x)->typ != NIL)) && (*x)->typ->form == 12)) { *fpar = (*x)->typ->link; } else { OPB_err(121); @@ -2457,17 +2457,17 @@ void OPB_Param (OPT_Node ap, OPT_Object fp) if (q == NIL) { OPB_err(111); } - } else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 13)) { - } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x2e) && ap->typ->size == 1)))))) { + } else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 11)) { + } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x1e) && ap->typ->size == 1)))))) { OPB_err(123); - } else if ((fp->typ->form == 13 && ap->class == 5)) { + } else if ((fp->typ->form == 11 && ap->class == 5)) { OPB_err(123); } } else if (fp->typ->comp == 3) { if ((ap->class == 7 && ap->typ->form == 3)) { OPB_CharToString(ap); } - if ((ap->typ->form == 10 && fp->typ->BaseTyp->form == 3)) { + if ((ap->typ->form == 8 && fp->typ->BaseTyp->form == 3)) { } else if (ap->class >= 7) { OPB_err(59); } else { @@ -2575,7 +2575,7 @@ void OPB_Assign (OPT_Node *x, OPT_Node y) OPB_BindNodes(6, (*x)->typ, &z, NIL); *x = z; } - } else if (((((((*x)->typ->comp == 2 && (*x)->typ->BaseTyp == OPT_chartyp)) && y->typ->form == 10)) && y->conval->intval2 == 1)) { + } else if (((((((*x)->typ->comp == 2 && (*x)->typ->BaseTyp == OPT_chartyp)) && y->typ->form == 8)) && y->conval->intval2 == 1)) { y->typ = OPT_chartyp; y->conval->intval = 0; OPB_Index(&*x, OPB_NewIntConst(0)); diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index 385a9146..97c4485c 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 45784a13..9f818a4a 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "OPM.h" @@ -227,12 +227,12 @@ static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause) if (__IN(typ->comp, 0x0c)) { OPC_Stars(typ->BaseTyp, &*openClause); *openClause = typ->comp == 2; - } else if (typ->form == 14) { + } else if (typ->form == 12) { OPM_Write('('); OPM_Write('*'); } else { pointers = 0; - while (((typ->strobj == NIL || typ->strobj->name[0] == 0x00) && typ->form == 13)) { + while (((typ->strobj == NIL || typ->strobj->name[0] == 0x00) && typ->form == 11)) { pointers += 1; typ = typ->BaseTyp; } @@ -277,16 +277,16 @@ static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef) for (;;) { form = typ->form; comp = typ->comp; - if (((typ->strobj != NIL && typ->strobj->name[0] != 0x00) || form == 12) || comp == 4) { + if (((typ->strobj != NIL && typ->strobj->name[0] != 0x00) || form == 10) || comp == 4) { break; - } else if ((form == 13 && typ->BaseTyp->comp != 3)) { + } else if ((form == 11 && typ->BaseTyp->comp != 3)) { openClause = 1; - } else if (form == 14 || __IN(comp, 0x0c)) { + } else if (form == 12 || __IN(comp, 0x0c)) { if (openClause) { OPM_Write(')'); openClause = 0; } - if (form == 14) { + if (form == 12) { if (OPC_ansi) { OPM_Write(')'); OPC_AnsiParamList(typ->link, 0); @@ -331,19 +331,19 @@ static void OPC_DeclareBase (OPT_Object dcl) LONGINT off, n, dummy; typ = dcl->typ; prev = typ; - while ((((((((typ->strobj == NIL || typ->comp == 3) || OPC_Undefined(typ->strobj)) && typ->comp != 4)) && typ->form != 12)) && !((typ->form == 13 && typ->BaseTyp->comp == 3)))) { + while ((((((((typ->strobj == NIL || typ->comp == 3) || OPC_Undefined(typ->strobj)) && typ->comp != 4)) && typ->form != 10)) && !((typ->form == 11 && typ->BaseTyp->comp == 3)))) { prev = typ; typ = typ->BaseTyp; } obj = typ->strobj; - if (typ->form == 12) { + if (typ->form == 10) { OPM_WriteString((CHAR*)"void", 5); } else if ((obj != NIL && !OPC_Undefined(obj))) { OPC_Ident(obj); } else if (typ->comp == 4) { OPM_WriteString((CHAR*)"struct ", 8); OPC_Andent(typ); - if ((prev->form != 13 && (obj != NIL || dcl->name[0] == 0x00))) { + if ((prev->form != 11 && (obj != NIL || dcl->name[0] == 0x00))) { if ((typ->BaseTyp != NIL && typ->BaseTyp->strobj->vis != 0)) { OPM_WriteString((CHAR*)" { /* ", 7); OPC_Ident(typ->BaseTyp->strobj); @@ -357,7 +357,7 @@ static void OPC_DeclareBase (OPT_Object dcl) OPC_FieldList(typ, 1, &off, &n, &dummy); OPC_EndBlk0(); } - } else if ((typ->form == 13 && typ->BaseTyp->comp == 3)) { + } else if ((typ->form == 11 && typ->BaseTyp->comp == 3)) { typ = typ->BaseTyp->BaseTyp; nofdims = 1; while (typ->comp == 3) { @@ -372,7 +372,7 @@ static void OPC_DeclareBase (OPT_Object dcl) OPC_BegStat(); __NEW(obj, OPT_ObjDesc); __NEW(obj->typ, OPT_StrDesc); - obj->typ->form = 15; + obj->typ->form = 13; obj->typ->comp = 2; obj->typ->n = 1; obj->typ->BaseTyp = typ; @@ -393,7 +393,7 @@ LONGINT OPC_NofPtrs (OPT_Struct typ) OPT_Object fld = NIL; OPT_Struct btyp = NIL; LONGINT n; - if ((typ->form == 13 && typ->sysflag == 0)) { + if ((typ->form == 11 && typ->sysflag == 0)) { _o_result = 1; return _o_result; } else if ((typ->comp == 4 && __MASK(typ->sysflag, -256) == 0)) { @@ -435,7 +435,7 @@ static void OPC_PutPtrOffsets (OPT_Struct typ, LONGINT adr, LONGINT *cnt) OPT_Object fld = NIL; OPT_Struct btyp = NIL; LONGINT n, i; - if ((typ->form == 13 && typ->sysflag == 0)) { + if ((typ->form == 11 && typ->sysflag == 0)) { OPM_WriteInt(adr); OPM_WriteString((CHAR*)", ", 3); *cnt += 1; @@ -540,7 +540,7 @@ static void OPC_DeclareParams (OPT_Object par, BOOLEAN macro) if (macro) { OPM_WriteStringVar((void*)par->name, 256); } else { - if ((par->mode == 1 && par->typ->form == 7)) { + if ((par->mode == 1 && par->typ->form == 5)) { OPM_Write('_'); } OPC_Ident(par); @@ -612,7 +612,7 @@ OPT_Object OPC_BaseTProc (OPT_Object obj) OPT_Struct typ = NIL, base = NIL; LONGINT mno; typ = obj->link->typ; - if (typ->form == 13) { + if (typ->form == 11) { typ = typ->BaseTyp; } base = typ->BaseTyp; @@ -635,7 +635,7 @@ static void OPC_DefineTProcMacros (OPT_Object obj, BOOLEAN *empty) OPC_Ident(obj); OPC_DeclareParams(obj->link, 1); OPM_WriteString((CHAR*)" __SEND(", 9); - if (obj->link->typ->form == 13) { + if (obj->link->typ->form == 11) { OPM_WriteString((CHAR*)"__TYPEOF(", 10); OPC_Ident(obj->link); OPM_Write(')'); @@ -673,7 +673,7 @@ static void OPC_DefineType (OPT_Struct str) if (obj == NIL || OPC_Undefined(obj)) { if (obj != NIL) { if (obj->linkadr == 1) { - if (str->form != 13) { + if (str->form != 11) { OPM_Mark(244, str->txtpos); obj->linkadr = 2; } @@ -692,13 +692,13 @@ static void OPC_DefineType (OPT_Struct str) } field = field->link; } - } else if (str->form == 13) { + } else if (str->form == 11) { if (str->BaseTyp->comp != 4) { OPC_DefineType(str->BaseTyp); } } else if (__IN(str->comp, 0x0c)) { OPC_DefineType(str->BaseTyp); - } else if (str->form == 14) { + } else if (str->form == 12) { if (str->BaseTyp != OPT_notyp) { OPC_DefineType(str->BaseTyp); } @@ -889,7 +889,7 @@ LONGINT OPC_BaseAlignment (OPT_Struct typ) { LONGINT _o_result; LONGINT alignment; - if (typ->form == 15) { + if (typ->form == 13) { if (typ->comp == 4) { alignment = __MASK(typ->align, -65536); } else { @@ -1017,7 +1017,7 @@ static void OPC_IdentList (OPT_Object obj, INTEGER vis) OPM_WriteString((CHAR*)"export ", 8); } } - if ((((vis == 2 && obj->mode == 1)) && base->form == 7)) { + if ((((vis == 2 && obj->mode == 1)) && base->form == 5)) { OPM_WriteString((CHAR*)"double", 7); } else { OPC_DeclareBase(obj); @@ -1026,7 +1026,7 @@ static void OPC_IdentList (OPT_Object obj, INTEGER vis) OPM_Write(','); } OPM_Write(' '); - if ((((vis == 2 && obj->mode == 1)) && base->form == 7)) { + if ((((vis == 2 && obj->mode == 1)) && base->form == 5)) { OPM_Write('_'); } OPC_DeclareObj(obj, vis == 3); @@ -1043,7 +1043,7 @@ static void OPC_IdentList (OPT_Object obj, INTEGER vis) OPC_Ident(obj); OPM_WriteString((CHAR*)"__typ", 6); base = NIL; - } else if ((((((OPC_ptrinit && vis == 0)) && obj->mnolev > 0)) && obj->typ->form == 13)) { + } else if ((((((OPC_ptrinit && vis == 0)) && obj->mnolev > 0)) && obj->typ->form == 11)) { OPM_WriteString((CHAR*)" = NIL", 7); } } @@ -1380,7 +1380,7 @@ void OPC_GenEnumPtrs (OPT_Object var) OPC_BegBlk(); } OPC_BegStat(); - if (typ->form == 13) { + if (typ->form == 11) { OPM_WriteString((CHAR*)"P(", 3); OPC_Ident(var); OPM_Write(')'); @@ -1399,7 +1399,7 @@ void OPC_GenEnumPtrs (OPT_Object var) n = n * typ->n; typ = typ->BaseTyp; } - if (typ->form == 13) { + if (typ->form == 11) { OPM_WriteString((CHAR*)"__ENUMP(", 9); OPC_Ident(var); OPC_Str1((CHAR*)", #, P)", 8, n); @@ -1562,7 +1562,7 @@ void OPC_EnterProc (OPT_Object proc) if (!OPC_ansi) { var = proc->link; while (var != NIL) { - if ((var->typ->form == 7 && var->mode == 1)) { + if ((var->typ->form == 5 && var->mode == 1)) { OPC_BegStat(); OPC_Ident(var->typ->strobj); OPM_Write(' '); @@ -1878,7 +1878,7 @@ void OPC_Case (LONGINT caseVal, INTEGER form) case 3: OPC_CharacterLiteral(caseVal); break; - case 5: + case 4: OPM_WriteInt(caseVal); break; default: @@ -1976,16 +1976,16 @@ void OPC_Constant (OPT_Const con, INTEGER form) case 3: OPC_CharacterLiteral(con->intval); break; - case 5: + case 4: OPM_WriteInt(con->intval); break; - case 7: + case 5: OPM_WriteReal(con->realval, 'f'); break; - case 8: + case 6: OPM_WriteReal(con->realval, 0x00); break; - case 9: + case 7: OPM_WriteString((CHAR*)"0x", 3); skipLeading = 1; s = con->setval; @@ -2008,10 +2008,10 @@ void OPC_Constant (OPT_Const con, INTEGER form) OPM_Write('0'); } break; - case 10: + case 8: OPC_StringLiteral(*con->ext, 256, con->intval2 - 1); break; - case 11: + case 9: OPM_WriteString((CHAR*)"NIL", 4); break; default: diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index 4243328e..38f95afe 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 979d9598..f2da0fed 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index f93bcd98..15a980a6 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index b0e235d3..21c21350 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPB.h" #include "OPM.h" @@ -136,7 +136,7 @@ static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_) OPP_err(135); } OPP_ConstExpression(&x); - if (x->typ->form == 5) { + if (x->typ->form == 4) { sf = x->conval->intval; if (sf < 0 || sf > 1) { OPP_err(220); @@ -158,7 +158,7 @@ static void OPP_RecordType (OPT_Struct *typ, OPT_Struct *banned) OPT_Object fld = NIL, first = NIL, last = NIL, base = NIL; OPT_Struct ftyp = NIL; INTEGER sysflag; - *typ = OPT_NewStr(15, 4); + *typ = OPT_NewStr(13, 4); (*typ)->BaseTyp = NIL; OPP_CheckSysFlag(&sysflag, -1); if (OPP_sym == 30) { @@ -253,7 +253,7 @@ static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) INTEGER sysflag; OPP_CheckSysFlag(&sysflag, 0); if (OPP_sym == 25) { - *typ = OPT_NewStr(15, 3); + *typ = OPT_NewStr(13, 3); (*typ)->mno = 0; (*typ)->sysflag = sysflag; OPS_Get(&OPP_sym); @@ -265,10 +265,10 @@ static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) (*typ)->n = 0; } } else { - *typ = OPT_NewStr(15, 2); + *typ = OPT_NewStr(13, 2); (*typ)->sysflag = sysflag; OPP_ConstExpression(&x); - if (x->typ->form == 5) { + if (x->typ->form == 4) { n = x->conval->intval; if (n <= 0 || n > OPM_MaxIndex) { OPP_err(63); @@ -301,7 +301,7 @@ static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) static void OPP_PointerType (OPT_Struct *typ) { OPT_Object id = NIL; - *typ = OPT_NewStr(13, 1); + *typ = OPT_NewStr(11, 1); OPP_CheckSysFlag(&(*typ)->sysflag, 0); OPP_CheckSym(28); if (OPP_sym == 38) { @@ -409,7 +409,7 @@ static void OPP_FormalParameters (OPT_Object *firstPar, OPT_Struct *resTyp) if (OPP_sym == 38) { OPP_qualident(&res); if (res->mode == 5) { - if (res->typ->form < 15) { + if (res->typ->form < 13) { *resTyp = res->typ; } else { OPP_err(54); @@ -459,7 +459,7 @@ static void OPP_TypeDecl (OPT_Struct *typ, OPT_Struct *banned) OPP_PointerType(&*typ); } else if (OPP_sym == 61) { OPS_Get(&OPP_sym); - *typ = OPT_NewStr(14, 1); + *typ = OPT_NewStr(12, 1); OPP_CheckSysFlag(&(*typ)->sysflag, 0); if (OPP_sym == 30) { OPS_Get(&OPP_sym); @@ -488,7 +488,7 @@ static void OPP_TypeDecl (OPT_Struct *typ, OPT_Struct *banned) static void OPP_Type (OPT_Struct *typ, OPT_Struct *banned) { OPP_TypeDecl(&*typ, &*banned); - if (((((*typ)->form == 13 && (*typ)->BaseTyp == OPT_undftyp)) && (*typ)->strobj == NIL)) { + if (((((*typ)->form == 11 && (*typ)->BaseTyp == OPT_undftyp)) && (*typ)->strobj == NIL)) { OPP_err(0); } } @@ -503,7 +503,7 @@ static void OPP_selector (OPT_Node *x) if (OPP_sym == 31) { OPS_Get(&OPP_sym); for (;;) { - if (((*x)->typ != NIL && (*x)->typ->form == 13)) { + if (((*x)->typ != NIL && (*x)->typ->form == 11)) { OPB_DeRef(&*x); } OPP_Expression(&y); @@ -521,7 +521,7 @@ static void OPP_selector (OPT_Node *x) __COPY(OPS_name, name, 256); OPS_Get(&OPP_sym); if ((*x)->typ != NIL) { - if ((*x)->typ->form == 13) { + if ((*x)->typ->form == 11) { OPB_DeRef(&*x); } if ((*x)->typ->comp == 4) { @@ -543,7 +543,7 @@ static void OPP_selector (OPT_Node *x) OPP_err(75); } typ = y->obj->typ; - if (typ->form == 13) { + if (typ->form == 11) { typ = typ->BaseTyp; } OPT_FindField((*x)->obj->name, typ->BaseTyp, &proc); @@ -572,7 +572,7 @@ static void OPP_selector (OPT_Node *x) } else if (OPP_sym == 17) { OPS_Get(&OPP_sym); OPB_DeRef(&*x); - } else if ((((((OPP_sym == 30 && (*x)->class < 7)) && (*x)->typ->form != 14)) && ((*x)->obj == NIL || (*x)->obj->mode != 13))) { + } else if ((((((OPP_sym == 30 && (*x)->class < 7)) && (*x)->typ->form != 12)) && ((*x)->obj == NIL || (*x)->obj->mode != 13))) { OPS_Get(&OPP_sym); if (OPP_sym == 38) { OPP_qualident(&obj); @@ -871,10 +871,10 @@ static void OPP_Receiver (SHORTINT *mode, OPS_Name name, OPT_Struct *typ, OPT_St } else { *typ = obj->typ; *rec = *typ; - if ((*rec)->form == 13) { + if ((*rec)->form == 11) { *rec = (*rec)->BaseTyp; } - if (!((((*mode == 1 && (*typ)->form == 13)) && (*rec)->comp == 4) || (*mode == 2 && (*typ)->comp == 4))) { + if (!((((*mode == 1 && (*typ)->form == 11)) && (*rec)->comp == 4) || (*mode == 2 && (*typ)->comp == 4))) { OPP_err(70); *rec = NIL; } @@ -888,7 +888,7 @@ static void OPP_Receiver (SHORTINT *mode, OPS_Name name, OPT_Struct *typ, OPT_St } OPP_CheckSym(22); if (*rec == NIL) { - *rec = OPT_NewStr(15, 4); + *rec = OPT_NewStr(13, 4); (*rec)->BaseTyp = NIL; } } @@ -896,7 +896,7 @@ static void OPP_Receiver (SHORTINT *mode, OPS_Name name, OPT_Struct *typ, OPT_St static BOOLEAN OPP_Extends (OPT_Struct x, OPT_Struct b) { BOOLEAN _o_result; - if ((b->form == 13 && x->form == 13)) { + if ((b->form == 11 && x->form == 11)) { b = b->BaseTyp; x = x->BaseTyp; } @@ -1173,14 +1173,14 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, O for (;;) { OPP_ConstExpression(&x); f = x->typ->form; - if (__IN(f, 0x28)) { + if (__IN(f, 0x18)) { xval = x->conval->intval; } else { OPP_err(61); xval = 1; } - if (f == 5) { - if (!(LabelTyp->form == 5) || LabelTyp->size < x->typ->size) { + if (f == 4) { + if (!(LabelTyp->form == 4) || LabelTyp->size < x->typ->size) { OPP_err(60); } } else if ((SYSTEM_INT16)LabelTyp->form != f) { @@ -1190,7 +1190,7 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, O OPS_Get(&OPP_sym); OPP_ConstExpression(&y); yval = y->conval->intval; - if (((SYSTEM_INT16)y->typ->form != f && !((f == 5 && y->typ->form == 5)))) { + if (((SYSTEM_INT16)y->typ->form != f && !((f == 4 && y->typ->form == 4)))) { OPP_err(60); } if (yval < xval) { @@ -1253,7 +1253,7 @@ static void CasePart__31 (OPT_Node *x) *StatSeq__30_s->pos = OPM_errpos; if ((*x)->class == 8 || (*x)->class == 9) { OPP_err(126); - } else if (!__IN((*x)->typ->form, 0x38)) { + } else if (!__IN((*x)->typ->form, 0x18)) { OPP_err(125); } OPP_CheckSym(25); @@ -1439,7 +1439,7 @@ static void OPP_StatSeq (OPT_Node *stat) OPS_Get(&OPP_sym); if (OPP_sym == 38) { OPP_qualident(&id); - if (!(id->typ->form == 5)) { + if (!(id->typ->form == 4)) { OPP_err(68); } OPP_CheckSym(34); @@ -1471,7 +1471,7 @@ static void OPP_StatSeq (OPT_Node *stat) SetPos__35(z); OPB_Link(&*stat, &last, z); y = OPB_NewLeaf(t); - } else if (!(y->typ->form == 5) || y->typ->size > x->left->typ->size) { + } else if (!(y->typ->form == 4) || y->typ->size > x->left->typ->size) { OPP_err(113); } OPB_Link(&*stat, &last, x); @@ -1526,7 +1526,7 @@ static void OPP_StatSeq (OPT_Node *stat) if (OPP_sym == 38) { OPP_qualident(&id); y = OPB_NewLeaf(id); - if ((((id != NIL && id->typ->form == 13)) && (id->mode == 2 || !id->leaf))) { + if ((((id != NIL && id->typ->form == 11)) && (id->mode == 2 || !id->leaf))) { OPP_err(245); } OPP_CheckSym(20); diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index 0ddbe4c3..8bed9493 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index 89c8242e..f197a5c6 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index 46e05201..1e99f5e9 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 7398b44a..5b495ad5 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" @@ -173,7 +173,7 @@ OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir) { OPT_Struct _o_result; INTEGER i; - __ASSERT(x->form == 5, 0); + __ASSERT(x->form == 4, 0); __ASSERT(dir == 1 || dir == -1, 0); __ASSERT(x->BaseTyp == OPT_undftyp, 0); i = 0; @@ -284,7 +284,7 @@ void OPT_Close (void) OPT_GlbMod[__X(i, 64)] = NIL; i += 1; } - i = 16; + i = 14; while (i < 255) { OPT_impCtxt.ref[__X(i, 255)] = NIL; OPT_impCtxt.old[__X(i, 255)] = NIL; @@ -483,14 +483,14 @@ void OPT_IdFPrint (OPT_Struct typ) OPT_FPrintName(&idfp, (void*)OPT_GlbMod[__X(typ->mno, 64)]->name, 256); OPT_FPrintName(&idfp, (void*)strobj->name, 256); } - if ((f == 13 || (c == 4 && btyp != NIL)) || c == 3) { + if ((f == 11 || (c == 4 && btyp != NIL)) || c == 3) { OPT_IdFPrint(btyp); OPM_FPrint(&idfp, btyp->idfp); } else if (c == 2) { OPT_IdFPrint(btyp); OPM_FPrint(&idfp, btyp->idfp); OPM_FPrint(&idfp, typ->n); - } else if (f == 14) { + } else if (f == 12) { OPT_FPrintSign(&idfp, btyp, typ->link); } typ->idfp = idfp; @@ -519,7 +519,7 @@ static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr) n = btyp->n * n; btyp = btyp->BaseTyp; } - if (btyp->form == 13 || btyp->comp == 4) { + if (btyp->form == 11 || btyp->comp == 4) { j = OPT_nofhdfld; FPrintHdFld__15(btyp, fld, adr); if (j != OPT_nofhdfld) { @@ -531,8 +531,8 @@ static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr) } } } - } else if (typ->form == 13 || __STRCMP(fld->name, "@ptr") == 0) { - OPM_FPrint(&*FPrintStr__12_s->pvfp, 13); + } else if (typ->form == 11 || __STRCMP(fld->name, "@ptr") == 0) { + OPM_FPrint(&*FPrintStr__12_s->pvfp, 11); OPM_FPrint(&*FPrintStr__12_s->pvfp, adr); OPT_nofhdfld += 1; } @@ -595,7 +595,7 @@ void OPT_FPrintStr (OPT_Struct typ) f = typ->form; c = typ->comp; btyp = typ->BaseTyp; - if (f == 13) { + if (f == 11) { strobj = typ->strobj; bstrobj = btyp->strobj; if (((strobj == NIL || strobj->name[0] == 0x00) || bstrobj == NIL) || bstrobj->name[0] == 0x00) { @@ -603,7 +603,7 @@ void OPT_FPrintStr (OPT_Struct typ) OPM_FPrint(&pbfp, btyp->pbfp); pvfp = pbfp; } - } else if (f == 14) { + } else if (f == 12) { } else if (__IN(c, 0x0c)) { OPT_FPrintStr(btyp); OPM_FPrint(&pbfp, btyp->pvfp); @@ -649,23 +649,23 @@ void OPT_FPrintObj (OPT_Object obj) f = obj->typ->form; OPM_FPrint(&fprint, f); switch (f) { - case 2: case 3: case 5: + case 2: case 3: case 4: OPM_FPrint(&fprint, obj->conval->intval); break; - case 9: + case 7: OPM_FPrintSet(&fprint, obj->conval->setval); break; - case 7: + case 5: rval = obj->conval->realval; OPM_FPrintReal(&fprint, rval); break; - case 8: + case 6: OPM_FPrintLReal(&fprint, obj->conval->realval); break; - case 10: + case 8: OPT_FPrintName(&fprint, (void*)*obj->conval->ext, 256); break; - case 11: + case 9: break; default: OPT_err(127); @@ -850,22 +850,22 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval) OPM_SymRCh(&ch); conval->intval = (SYSTEM_INT16)ch; break; - case 5: + case 4: conval->intval = OPM_SymRInt(); break; - case 9: + case 7: OPM_SymRSet(&conval->setval); break; - case 7: + case 5: OPM_SymRReal(&rval); conval->realval = rval; conval->intval = -1; break; - case 8: + case 6: OPM_SymRLReal(&conval->realval); conval->intval = -1; break; - case 10: + case 8: ext = OPT_NewExt(); conval->ext = ext; i = 0; @@ -877,7 +877,7 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval) conval->intval2 = i; conval->intval = -1; break; - case 11: + case 9: conval->intval = 0; break; default: @@ -979,7 +979,7 @@ static OPT_Object OPT_InTProc (SHORTINT mno) static OPT_Struct OPT_InTyp (LONGINT tag) { OPT_Struct _o_result; - if (tag == 5) { + if (tag == 4) { _o_result = OPT_IntType(OPM_SymRInt()); return _o_result; } else { @@ -1054,20 +1054,20 @@ static void OPT_InStruct (OPT_Struct *typ) } switch (tag) { case 36: - (*typ)->form = 13; + (*typ)->form = 11; (*typ)->size = OPM_PointerSize; (*typ)->n = 0; OPT_InStruct(&(*typ)->BaseTyp); break; case 37: - (*typ)->form = 15; + (*typ)->form = 13; (*typ)->comp = 2; OPT_InStruct(&(*typ)->BaseTyp); (*typ)->n = OPM_SymRInt(); (*OPT_typSize)(*typ); break; case 38: - (*typ)->form = 15; + (*typ)->form = 13; (*typ)->comp = 3; OPT_InStruct(&(*typ)->BaseTyp); if ((*typ)->BaseTyp->comp == 3) { @@ -1078,7 +1078,7 @@ static void OPT_InStruct (OPT_Struct *typ) (*OPT_typSize)(*typ); break; case 39: - (*typ)->form = 15; + (*typ)->form = 13; (*typ)->comp = 4; OPT_InStruct(&(*typ)->BaseTyp); if ((*typ)->BaseTyp == OPT_notyp) { @@ -1112,7 +1112,7 @@ static void OPT_InStruct (OPT_Struct *typ) } break; case 40: - (*typ)->form = 14; + (*typ)->form = 12; (*typ)->size = OPM_ProcSize; OPT_InSign(mno, &(*typ)->BaseTyp, &(*typ)->link); break; @@ -1191,7 +1191,7 @@ static OPT_Object OPT_InObj (SHORTINT mno) obj = OPT_NewObj(); obj->mnolev = -mno; obj->vis = 1; - if (tag <= 13) { + if (tag <= 11) { obj->mode = 3; obj->conval = OPT_NewConst(); OPT_InConstant(tag, obj->conval); @@ -1288,7 +1288,7 @@ void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) obj->scope = OPT_syslink; obj->typ = OPT_notyp; } else { - OPT_impCtxt.nofr = 16; + OPT_impCtxt.nofr = 14; OPT_impCtxt.minr = 255; OPT_impCtxt.nofm = 0; OPT_impCtxt.self = __STRCMP(aliasName, "@self") == 0; @@ -1355,7 +1355,7 @@ static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, LONGINT adr) n = btyp->n * n; btyp = btyp->BaseTyp; } - if (btyp->form == 13 || btyp->comp == 4) { + if (btyp->form == 11 || btyp->comp == 4) { j = OPT_nofhdfld; OPT_OutHdFld(btyp, fld, adr); if (j != OPT_nofhdfld) { @@ -1367,7 +1367,7 @@ static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, LONGINT adr) } } } - } else if (typ->form == 13 || __STRCMP(fld->name, "@ptr") == 0) { + } else if (typ->form == 11 || __STRCMP(fld->name, "@ptr") == 0) { OPM_SymWInt(27); OPM_SymWInt(adr); OPT_nofhdfld += 1; @@ -1439,7 +1439,7 @@ static void OPT_OutStr (OPT_Struct typ) OPT_Object strobj = NIL; if (typ->ref < OPT_expCtxt.ref) { OPM_SymWInt(-typ->ref); - if (typ->ref == 5) { + if (typ->ref == 4) { OPM_SymWInt(typ->size); } } else { @@ -1474,15 +1474,15 @@ static void OPT_OutStr (OPT_Struct typ) OPM_SymWInt(typ->sysflag); } switch (typ->form) { - case 13: + case 11: OPM_SymWInt(36); OPT_OutStr(typ->BaseTyp); break; - case 14: + case 12: OPM_SymWInt(40); OPT_OutSign(typ->BaseTyp, typ->link); break; - case 15: + case 13: switch (typ->comp) { case 2: OPM_SymWInt(37); @@ -1537,24 +1537,24 @@ static void OPT_OutConstant (OPT_Object obj) case 2: case 3: OPM_SymWCh((CHAR)obj->conval->intval); break; - case 5: + case 4: OPM_SymWInt(obj->conval->intval); OPM_SymWInt(obj->typ->size); break; - case 9: + case 7: OPM_SymWSet(obj->conval->setval); break; - case 7: + case 5: rval = obj->conval->realval; OPM_SymWReal(rval); break; - case 8: + case 6: OPM_SymWLReal(obj->conval->realval); break; - case 10: + case 8: OPT_OutName((void*)*obj->conval->ext, 256); break; - case 11: + case 9: break; default: OPT_err(127); @@ -1668,7 +1668,7 @@ void OPT_Export (BOOLEAN *ext, BOOLEAN *new) OPM_SymWInt(16); OPT_OutName((void*)OPT_SelfName, 256); OPT_expCtxt.reffp = 0; - OPT_expCtxt.ref = 16; + OPT_expCtxt.ref = 14; OPT_expCtxt.nofm = 1; OPT_expCtxt.locmno[0] = 0; i = 1; @@ -1844,16 +1844,16 @@ export void *OPT__init(void) OPM_errpos = 0; OPT_InitStruct(&OPT_undftyp, 0); OPT_undftyp->BaseTyp = OPT_undftyp; - OPT_InitStruct(&OPT_notyp, 12); - OPT_InitStruct(&OPT_stringtyp, 10); - OPT_InitStruct(&OPT_niltyp, 11); + OPT_InitStruct(&OPT_notyp, 10); + OPT_InitStruct(&OPT_stringtyp, 8); + OPT_InitStruct(&OPT_niltyp, 9); OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp); - OPT_EnterTyp((CHAR*)"PTR", 13, OPM_PointerSize, &OPT_sysptrtyp); - OPT_EnterTyp((CHAR*)"ADRINT", 5, OPM_PointerSize, &OPT_ainttyp); - OPT_EnterTyp((CHAR*)"INT8", 5, 1, &OPT_int8typ); - OPT_EnterTyp((CHAR*)"INT16", 5, 2, &OPT_int16typ); - OPT_EnterTyp((CHAR*)"INT32", 5, 4, &OPT_int32typ); - OPT_EnterTyp((CHAR*)"INT64", 5, 8, &OPT_int64typ); + OPT_EnterTyp((CHAR*)"PTR", 11, OPM_PointerSize, &OPT_sysptrtyp); + OPT_EnterTyp((CHAR*)"ADRINT", 4, OPM_PointerSize, &OPT_ainttyp); + OPT_EnterTyp((CHAR*)"INT8", 4, 1, &OPT_int8typ); + OPT_EnterTyp((CHAR*)"INT16", 4, 2, &OPT_int16typ); + OPT_EnterTyp((CHAR*)"INT32", 4, 4, &OPT_int32typ); + OPT_EnterTyp((CHAR*)"INT64", 4, 8, &OPT_int64typ); OPT_EnterProc((CHAR*)"ADR", 20); OPT_EnterProc((CHAR*)"CC", 21); OPT_EnterProc((CHAR*)"LSH", 22); @@ -1871,12 +1871,12 @@ export void *OPT__init(void) OPT_topScope->right = NIL; OPT_EnterTyp((CHAR*)"BOOLEAN", 2, OPM_BoolSize, &OPT_booltyp); OPT_EnterTyp((CHAR*)"CHAR", 3, OPM_CharSize, &OPT_chartyp); - OPT_EnterTyp((CHAR*)"SET", 9, OPM_SetSize, &OPT_settyp); - OPT_EnterTyp((CHAR*)"REAL", 7, OPM_RealSize, &OPT_realtyp); - OPT_EnterTyp((CHAR*)"INTEGER", 5, OPM_IntSize, &OPT_inttyp); - OPT_EnterTyp((CHAR*)"LONGINT", 5, OPM_LIntSize, &OPT_linttyp); - OPT_EnterTyp((CHAR*)"LONGREAL", 8, OPM_LRealSize, &OPT_lrltyp); - OPT_EnterTyp((CHAR*)"SHORTINT", 5, OPM_SIntSize, &OPT_sinttyp); + OPT_EnterTyp((CHAR*)"SET", 7, OPM_SetSize, &OPT_settyp); + OPT_EnterTyp((CHAR*)"REAL", 5, OPM_RealSize, &OPT_realtyp); + OPT_EnterTyp((CHAR*)"INTEGER", 4, OPM_IntSize, &OPT_inttyp); + OPT_EnterTyp((CHAR*)"LONGINT", 4, OPM_LIntSize, &OPT_linttyp); + OPT_EnterTyp((CHAR*)"LONGREAL", 6, OPM_LRealSize, &OPT_lrltyp); + OPT_EnterTyp((CHAR*)"SHORTINT", 4, OPM_SIntSize, &OPT_sinttyp); OPT_EnterBoolConst((CHAR*)"FALSE", 0); OPT_EnterBoolConst((CHAR*)"TRUE", 1); OPT_EnterProc((CHAR*)"HALT", 0); @@ -1904,14 +1904,14 @@ export void *OPT__init(void) OPT_impCtxt.ref[1] = OPT_bytetyp; OPT_impCtxt.ref[2] = OPT_booltyp; OPT_impCtxt.ref[3] = OPT_chartyp; - OPT_impCtxt.ref[5] = OPT_inttyp; - OPT_impCtxt.ref[7] = OPT_realtyp; - OPT_impCtxt.ref[8] = OPT_lrltyp; - OPT_impCtxt.ref[9] = OPT_settyp; - OPT_impCtxt.ref[10] = OPT_stringtyp; - OPT_impCtxt.ref[11] = OPT_niltyp; - OPT_impCtxt.ref[12] = OPT_notyp; - OPT_impCtxt.ref[13] = OPT_sysptrtyp; + OPT_impCtxt.ref[4] = OPT_inttyp; + OPT_impCtxt.ref[5] = OPT_realtyp; + OPT_impCtxt.ref[6] = OPT_lrltyp; + OPT_impCtxt.ref[7] = OPT_settyp; + OPT_impCtxt.ref[8] = OPT_stringtyp; + OPT_impCtxt.ref[9] = OPT_niltyp; + OPT_impCtxt.ref[10] = OPT_notyp; + OPT_impCtxt.ref[11] = OPT_sysptrtyp; OPT_IntTypes[1] = OPT_sinttyp; OPT_IntTypes[2] = OPT_inttyp; OPT_IntTypes[3] = OPT_linttyp; diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index 3e352ca3..307b94e2 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index 7538f014..df62e985 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPC.h" #include "OPM.h" @@ -122,14 +122,14 @@ void OPV_TypSize (OPT_Struct typ) } else if (c == 2) { OPV_TypSize(typ->BaseTyp); typ->size = typ->n * typ->BaseTyp->size; - } else if (f == 13) { + } else if (f == 11) { typ->size = OPM_PointerSize; if (typ->BaseTyp == OPT_undftyp) { OPM_Mark(128, typ->n); } else { OPV_TypSize(typ->BaseTyp); } - } else if (f == 14) { + } else if (f == 12) { typ->size = OPM_ProcSize; } else if (c == 3) { btyp = typ->BaseTyp; @@ -162,7 +162,7 @@ static void OPV_GetTProcNum (OPT_Object obj) oldPos = OPM_errpos; OPM_errpos = obj->scope->adr; typ = obj->link->typ; - if (typ->form == 13) { + if (typ->form == 11) { typ = typ->BaseTyp; } OPT_FindField(obj->name, typ->BaseTyp, &redef); @@ -236,7 +236,7 @@ static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exporte if ((mode == 5 && (obj->vis != 0) == exported)) { typ = obj->typ; OPV_TypSize(obj->typ); - if (typ->form == 13) { + if (typ->form == 11) { typ = typ->BaseTyp; } if (typ->comp == 4) { @@ -348,7 +348,7 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN case 12: switch (subclass) { case 1: - if (form == 9) { + if (form == 7) { _o_result = 4; return _o_result; } else { @@ -357,7 +357,7 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN } break; case 2: - if (form == 9) { + if (form == 7) { _o_result = 3; return _o_result; } else { @@ -370,7 +370,7 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN return _o_result; break; case 6: - if (form == 9) { + if (form == 7) { _o_result = 2; return _o_result; } else { @@ -379,7 +379,7 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN } break; case 7: - if (form == 9) { + if (form == 7) { _o_result = 4; return _o_result; } else { @@ -463,7 +463,7 @@ static BOOLEAN OPV_SideEffects (OPT_Node n) static void OPV_Entier (OPT_Node n, INTEGER prec) { - if (__IN(n->typ->form, 0x0180)) { + if (__IN(n->typ->form, 0x60)) { OPM_WriteString((CHAR*)"__ENTIER(", 10); OPV_expr(n, -1); OPM_Write(')'); @@ -502,11 +502,11 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec) INTEGER from, to; from = n->typ->form; to = newtype->form; - if (to == 9) { + if (to == 7) { OPM_WriteString((CHAR*)"__SETOF(", 9); OPV_Entier(n, -1); OPM_Write(')'); - } else if (to == 5) { + } else if (to == 4) { if ((newtype->size < n->typ->size && __IN(2, OPM_opt))) { OPM_WriteString((CHAR*)"__SHORT", 8); if (OPV_SideEffects(n)) { @@ -541,7 +541,7 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec) static void OPV_TypeOf (OPT_Node n) { - if (n->typ->form == 13) { + if (n->typ->form == 11) { OPM_WriteString((CHAR*)"__TYPEOF(", 10); OPV_expr(n, -1); OPM_Write(')'); @@ -793,14 +793,14 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) } else if (OPV_ansi) { if ((__IN(comp, 0x0c) && n->class == 7)) { OPM_WriteString((CHAR*)"(CHAR*)", 8); - } else if ((((form == 13 && typ != n->typ)) && n->typ != OPT_niltyp)) { + } else if ((((form == 11 && typ != n->typ)) && n->typ != OPT_niltyp)) { OPM_WriteString((CHAR*)"(void*)", 8); } } else { - if ((__IN(form, 0x0180) && n->typ->form == 5)) { + if ((__IN(form, 0x60) && n->typ->form == 4)) { OPM_WriteString((CHAR*)"(double)", 9); prec = 9; - } else if (form == 5) { + } else if (form == 4) { OPV_SizeCast(n->typ->size, typ->size); } } @@ -811,7 +811,7 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) } if ((((mode == 2 && n->class == 11)) && n->subcl == 29)) { OPV_expr(n->left, prec); - } else if ((form == 5 && n->class == 7)) { + } else if ((form == 4 && n->class == 7)) { OPV_ParIntLiteral(n->conval->intval, n->typ->size); } else { OPV_expr(n, prec); @@ -860,7 +860,7 @@ static OPT_Object OPV_SuperProc (OPT_Node n) OPT_Object obj = NIL; OPT_Struct typ = NIL; typ = n->right->typ; - if (typ->form == 13) { + if (typ->form == 11) { typ = typ->BaseTyp; } OPT_FindField(n->left->obj->name, typ->BaseTyp, &obj); @@ -901,7 +901,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPV_expr(l, exprPrec); break; case 7: - if (form == 9) { + if (form == 7) { OPM_Write('~'); } else { OPM_Write('-'); @@ -929,7 +929,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) break; case 21: if (OPV_SideEffects(l)) { - if (l->typ->form < 7) { + if (l->typ->form < 5) { if (l->typ->size <= 4) { OPM_WriteString((CHAR*)"(int)", 6); } @@ -958,18 +958,18 @@ static void OPV_expr (OPT_Node n, INTEGER prec) if (l->class == 1) { OPC_CompleteIdent(l->obj); } else { - if ((l->typ->form != 10 && !__IN(l->typ->comp, 0x0c))) { + if ((l->typ->form != 8 && !__IN(l->typ->comp, 0x0c))) { OPM_Write('&'); } OPV_expr(l, exprPrec); } break; case 29: - if (!__IN(l->class, 0x17) || (((__IN(n->typ->form, 0x6220) && __IN(l->typ->form, 0x6220))) && n->typ->size == l->typ->size)) { + if (!__IN(l->class, 0x17) || (((__IN(n->typ->form, 0x1890) && __IN(l->typ->form, 0x1890))) && n->typ->size == l->typ->size)) { OPM_Write('('); OPC_Ident(n->typ->strobj); OPM_Write(')'); - if (__IN(n->typ->form, 0x6000) || __IN(l->typ->form, 0x6000)) { + if (__IN(n->typ->form, 0x1800) || __IN(l->typ->form, 0x1800)) { OPM_WriteString((CHAR*)"(SYSTEM_ADRINT)", 16); } OPV_expr(l, exprPrec); @@ -1079,7 +1079,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) break; case 9: case 10: case 11: case 12: case 13: case 14: - if (__IN(l->typ->form, 0x8400)) { + if (__IN(l->typ->form, 0x2100)) { OPM_WriteString((CHAR*)"__STRCMP(", 10); OPV_expr(l, -1); OPM_WriteString((CHAR*)", ", 3); @@ -1091,31 +1091,31 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPV_expr(l, exprPrec); OPC_Cmp(subclass); typ = l->typ; - if ((((((typ->form == 13 && r->typ->form != 11)) && r->typ != typ)) && r->typ != OPT_sysptrtyp)) { + if ((((((typ->form == 11 && r->typ->form != 9)) && r->typ != typ)) && r->typ != OPT_sysptrtyp)) { OPM_WriteString((CHAR*)"(void *) ", 10); } OPV_expr(r, exprPrec); } break; default: - if (subclass == 5 || (form == 9 && (subclass == 1 || subclass == 7))) { + if (subclass == 5 || (form == 7 && (subclass == 1 || subclass == 7))) { OPM_Write('('); } OPV_expr(l, exprPrec); switch (subclass) { case 1: - if (form == 9) { + if (form == 7) { OPM_WriteString((CHAR*)" & ", 4); } else { OPM_WriteString((CHAR*)" * ", 4); } break; case 2: - if (form == 9) { + if (form == 7) { OPM_WriteString((CHAR*)" ^ ", 4); } else { OPM_WriteString((CHAR*)" / ", 4); - if (r->obj == NIL || r->obj->typ->form == 5) { + if (r->obj == NIL || r->obj->typ->form == 4) { OPM_Write('('); OPC_Ident(n->typ->strobj); OPM_Write(')'); @@ -1126,14 +1126,14 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPM_WriteString((CHAR*)" && ", 5); break; case 6: - if (form == 9) { + if (form == 7) { OPM_WriteString((CHAR*)" | ", 4); } else { OPM_WriteString((CHAR*)" + ", 4); } break; case 7: - if (form == 9) { + if (form == 7) { OPM_WriteString((CHAR*)" & ~", 5); } else { OPM_WriteString((CHAR*)" - ", 4); @@ -1149,7 +1149,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) break; } OPV_expr(r, exprPrec); - if (subclass == 5 || (form == 9 && (subclass == 1 || subclass == 7))) { + if (subclass == 5 || (form == 7 && (subclass == 1 || subclass == 7))) { OPM_Write(')'); } break; @@ -1323,7 +1323,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) if ((base->comp == 4 && OPC_NofPtrs(base) != 0)) { OPC_Ident(base->strobj); OPM_WriteString((CHAR*)"__typ", 6); - } else if (base->form == 13) { + } else if (base->form == 11) { OPM_WriteString((CHAR*)"POINTER__typ", 13); } else { OPM_WriteString((CHAR*)"NIL", 4); @@ -1429,11 +1429,11 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) } OPM_Write(')'); } else { - if ((((((l->typ->form == 13 && l->obj != NIL)) && l->obj->adr == 1)) && l->obj->mode == 1)) { + if ((((((l->typ->form == 11 && l->obj != NIL)) && l->obj->adr == 1)) && l->obj->mode == 1)) { l->obj->adr = 0; OPV_design(l, -1); l->obj->adr = 1; - if (r->typ->form != 11) { + if (r->typ->form != 9) { OPM_WriteString((CHAR*)" = (void*)", 11); } else { OPM_WriteString((CHAR*)" = ", 4); @@ -1444,7 +1444,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) } if (l->typ == r->typ) { OPV_expr(r, -1); - } else if ((((l->typ->form == 13 && r->typ->form != 11)) && l->typ->strobj != NIL)) { + } else if ((((l->typ->form == 11 && r->typ->form != 9)) && l->typ->strobj != NIL)) { OPM_Write('('); OPC_Ident(l->typ->strobj); OPM_Write(')'); @@ -1629,7 +1629,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) } else { if (n->left != NIL) { OPM_WriteString((CHAR*)"_o_result = ", 13); - if ((n->left->typ->form == 13 && n->obj->typ != n->left->typ)) { + if ((n->left->typ->form == 11 && n->obj->typ != n->left->typ)) { OPM_WriteString((CHAR*)"(void*)", 8); OPV_expr(n->left, 10); } else { diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index 0299d34b..06bc39f1 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 2508f6f7..033e03cf 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index 4c7f2849..34d088bf 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index bea1f4aa..28a855aa 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index 6eeb5a87..65543fac 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index f1d4f53d..834c1fb1 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index 43656e74..2edcc736 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index bd5d1115..dddea925 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Files.h" #include "Modules.h" diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index be79016b..5499c3d0 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/Vishap.c b/bootstrap/unix-48/Vishap.c index 7c16c24d..030b94f6 100644 --- a/bootstrap/unix-48/Vishap.c +++ b/bootstrap/unix-48/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkamSf */ #include "SYSTEM.h" #include "Configuration.h" #include "Heap.h" diff --git a/bootstrap/unix-48/errors.c b/bootstrap/unix-48/errors.c index 7a91fc31..3f916fe9 100644 --- a/bootstrap/unix-48/errors.c +++ b/bootstrap/unix-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/unix-48/errors.h b/bootstrap/unix-48/errors.h index 4a787a17..2afac320 100644 --- a/bootstrap/unix-48/errors.h +++ b/bootstrap/unix-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index cfb79ac9..bfab2dc6 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index fb0797f3..ca635519 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/vt100.c b/bootstrap/unix-48/vt100.c index dfe62efa..84707926 100644 --- a/bootstrap/unix-48/vt100.c +++ b/bootstrap/unix-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Strings.h" diff --git a/bootstrap/unix-48/vt100.h b/bootstrap/unix-48/vt100.h index 73d985c9..6266a678 100644 --- a/bootstrap/unix-48/vt100.h +++ b/bootstrap/unix-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index 5a7e6896..f4abd052 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -14,6 +14,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/08/31] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/01] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index b38a0aa6..c756e930 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Console.c b/bootstrap/unix-88/Console.c index bb971366..d884a64a 100644 --- a/bootstrap/unix-88/Console.c +++ b/bootstrap/unix-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Platform.h" diff --git a/bootstrap/unix-88/Console.h b/bootstrap/unix-88/Console.h index 22d598fb..8d9e2fb5 100644 --- a/bootstrap/unix-88/Console.h +++ b/bootstrap/unix-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 5ae22903..67a7a958 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 17323792..3be486fe 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index a5063871..5822f690 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tskSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index eebee23c..5e7c01fb 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 5929cd57..004f1f8b 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index 03458258..6f5e4cad 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index fef28dff..eacff2d0 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" @@ -318,7 +318,7 @@ void OPB_DeRef (OPT_Node *x) typ = (*x)->typ; if ((*x)->class >= 7) { OPB_err(78); - } else if (typ->form == 13) { + } else if (typ->form == 11) { if (typ == OPT_sysptrtyp) { OPB_err(57); } @@ -341,7 +341,7 @@ void OPB_Index (OPT_Node *x, OPT_Node y) f = y->typ->form; if ((*x)->class >= 7) { OPB_err(79); - } else if (f != 5 || __IN(y->class, 0x0300)) { + } else if (f != 4 || __IN(y->class, 0x0300)) { OPB_err(80); y->typ = OPT_inttyp; } @@ -438,10 +438,10 @@ void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) TypTest__57_s = &_s; if (OPB_NotVar(*x)) { OPB_err(112); - } else if ((*x)->typ->form == 13) { + } else if ((*x)->typ->form == 11) { if (((*x)->typ->BaseTyp->comp != 4 && (*x)->typ != OPT_sysptrtyp)) { OPB_err(85); - } else if (obj->typ->form == 13) { + } else if (obj->typ->form == 11) { GTT__58((*x)->typ->BaseTyp, obj->typ->BaseTyp); } else { OPB_err(86); @@ -466,7 +466,7 @@ void OPB_In (OPT_Node *x, OPT_Node y) f = (*x)->typ->form; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); - } else if ((f == 5 && y->typ->form == 9)) { + } else if ((f == 4 && y->typ->form == 7)) { if ((*x)->class == 7) { k = (*x)->conval->intval; if (k < 0 || k > (SYSTEM_INT64)OPM_MaxSet) { @@ -505,7 +505,7 @@ static LONGINT OPB_log (LONGINT x) static void OPB_CheckRealType (INTEGER f, INTEGER nr, OPT_Const x) { LONGREAL min, max, r; - if (f == 7) { + if (f == 5) { min = OPM_MinReal; max = OPM_MaxReal; } else { @@ -516,7 +516,7 @@ static void OPB_CheckRealType (INTEGER f, INTEGER nr, OPT_Const x) if (r > max || r < min) { OPB_err(nr); x->realval = (LONGREAL)1; - } else if (f == 7) { + } else if (f == 5) { x->realval = x->realval; } x->intval = -1; @@ -568,21 +568,21 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } break; case 6: - if (!__IN(f, 0x01a0)) { + if (!__IN(f, 0x70)) { OPB_err(96); } break; case 7: - if (__IN(f, 0x03a0)) { + if (__IN(f, 0xf0)) { if (z->class == 7) { - if (f == 5) { + if (f == 4) { if (z->conval->intval == (-9223372036854775807-1)) { OPB_err(203); } else { z->conval->intval = -z->conval->intval; OPB_SetIntType(z); } - } else if (__IN(f, 0x0180)) { + } else if (__IN(f, 0x60)) { z->conval->realval = -z->conval->realval; } else { z->conval->setval = ~z->conval->setval; @@ -596,9 +596,9 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } break; case 21: - if (__IN(f, 0x01a0)) { + if (__IN(f, 0x70)) { if (z->class == 7) { - if (f == 5) { + if (f == 4) { if (z->conval->intval == (-9223372036854775807-1)) { OPB_err(203); } else { @@ -630,7 +630,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } break; case 23: - if (f == 5) { + if (f == 4) { if (z->class == 7) { z->conval->intval = OPB_BoolToInt(__ODD(z->conval->intval)); z->obj = NIL; @@ -645,9 +645,9 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) case 24: if ((((z->class == 7 && f == 3)) && z->conval->intval >= 32)) { OPB_CharToString(z); - f = 10; + f = 8; } - if (z->class < 7 || f == 10) { + if (z->class < 7 || f == 8) { z = NewOp__29(op, typ, z); } else { OPB_err(127); @@ -655,7 +655,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->typ = OPT_linttyp; break; case 25: - if ((f == 5 && z->class == 7)) { + if ((f == 4 && z->class == 7)) { if ((0 <= z->conval->intval && z->conval->intval <= -1)) { z = NewOp__29(op, typ, z); } else { @@ -682,7 +682,7 @@ static void OPB_CheckPtr (OPT_Node x, OPT_Node y) INTEGER g; OPT_Struct p = NIL, q = NIL, t = NIL; g = y->typ->form; - if (g == 13) { + if (g == 11) { p = x->typ->BaseTyp; q = y->typ->BaseTyp; if ((p->comp == 4 && q->comp == 4)) { @@ -700,7 +700,7 @@ static void OPB_CheckPtr (OPT_Node x, OPT_Node y) } else { OPB_err(100); } - } else if (g != 11) { + } else if (g != 9) { OPB_err(100); } } @@ -717,7 +717,7 @@ void OPB_CheckParameters (OPT_Object fp, OPT_Object ap, BOOLEAN checkNames) at = at->BaseTyp; } if (ft != at) { - if ((ft->form == 14 && at->form == 14)) { + if ((ft->form == 12 && at->form == 12)) { if (ft->BaseTyp == at->BaseTyp) { OPB_CheckParameters(ft->link, at->link, 0); } else { @@ -778,7 +778,7 @@ static INTEGER ConstCmp__14 (void) case 0: res = 9; break; - case 1: case 3: case 4: case 5: + case 1: case 3: case 4: if ((*ConstOp__13_s->xval)->intval < (*ConstOp__13_s->yval)->intval) { res = 11; } else if ((*ConstOp__13_s->xval)->intval > (*ConstOp__13_s->yval)->intval) { @@ -787,7 +787,7 @@ static INTEGER ConstCmp__14 (void) res = 9; } break; - case 7: case 8: + case 5: case 6: if ((*ConstOp__13_s->xval)->realval < (*ConstOp__13_s->yval)->realval) { res = 11; } else if ((*ConstOp__13_s->xval)->realval > (*ConstOp__13_s->yval)->realval) { @@ -803,14 +803,14 @@ static INTEGER ConstCmp__14 (void) res = 9; } break; - case 9: + case 7: if ((*ConstOp__13_s->xval)->setval != (*ConstOp__13_s->yval)->setval) { res = 10; } else { res = 9; } break; - case 10: + case 8: if (__STRCMP(*(*ConstOp__13_s->xval)->ext, *(*ConstOp__13_s->yval)->ext) < 0) { res = 11; } else if (__STRCMP(*(*ConstOp__13_s->xval)->ext, *(*ConstOp__13_s->yval)->ext) > 0) { @@ -819,7 +819,7 @@ static INTEGER ConstCmp__14 (void) res = 9; } break; - case 11: case 13: case 14: + case 9: case 11: case 12: if ((*ConstOp__13_s->xval)->intval != (*ConstOp__13_s->yval)->intval) { res = 10; } else { @@ -857,7 +857,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) if (f != g) { switch (f) { case 3: - if (g == 10) { + if (g == 8) { OPB_CharToString(x); } else { OPB_err(100); @@ -865,17 +865,17 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) __GUARDEQP(yval, OPT_ConstDesc) = *xval; } break; - case 5: - if (g == 5) { + case 4: + if (g == 4) { if (x->typ->size <= y->typ->size) { x->typ = y->typ; } else { x->typ = OPT_IntType(x->typ->size); } - } else if (g == 7) { + } else if (g == 5) { x->typ = OPT_realtyp; xval->realval = xval->intval; - } else if (g == 8) { + } else if (g == 6) { x->typ = OPT_lrltyp; xval->realval = xval->intval; } else { @@ -884,11 +884,11 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) __GUARDEQP(yval, OPT_ConstDesc) = *xval; } break; - case 7: - if (g == 5) { + case 5: + if (g == 4) { y->typ = x->typ; yval->realval = yval->intval; - } else if (g == 8) { + } else if (g == 6) { x->typ = OPT_lrltyp; } else { OPB_err(100); @@ -896,11 +896,11 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) __GUARDEQP(yval, OPT_ConstDesc) = *xval; } break; - case 8: - if (g == 5) { + case 6: + if (g == 4) { y->typ = x->typ; yval->realval = yval->intval; - } else if (g == 7) { + } else if (g == 5) { y->typ = OPT_lrltyp; } else { OPB_err(100); @@ -908,26 +908,26 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) __GUARDEQP(yval, OPT_ConstDesc) = *xval; } break; - case 10: + case 8: if (g == 3) { OPB_CharToString(y); - g = 10; + g = 8; } else { OPB_err(100); y->typ = x->typ; __GUARDEQP(yval, OPT_ConstDesc) = *xval; } break; - case 11: - if (!__IN(g, 0x6000)) { + case 9: + if (!__IN(g, 0x1800)) { OPB_err(100); } break; - case 13: + case 11: OPB_CheckPtr(x, y); break; - case 14: - if (g != 11) { + case 12: + if (g != 9) { OPB_err(100); } break; @@ -941,7 +941,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } switch (op) { case 1: - if (f == 5) { + if (f == 4) { xv = xval->intval; yv = yval->intval; if (((((xv == 0 || yv == 0) || (((xv > 0 && yv > 0)) && yv <= __DIV(9223372036854775807, xv))) || (((xv > 0 && yv < 0)) && yv >= __DIV((-9223372036854775807-1), xv))) || (((xv < 0 && yv > 0)) && xv >= __DIV((-9223372036854775807-1), yv))) || (((((((xv < 0 && yv < 0)) && xv != (-9223372036854775807-1))) && yv != (-9223372036854775807-1))) && -xv <= __DIV(9223372036854775807, -yv))) { @@ -950,7 +950,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } else { OPB_err(204); } - } else if (__IN(f, 0x0180)) { + } else if (__IN(f, 0x60)) { temp = __ABS(yval->realval) <= (LONGREAL)1; if (temp || __ABS(xval->realval) <= 1.79769296342094e+308 / (LONGREAL)__ABS(yval->realval)) { xval->realval = xval->realval * yval->realval; @@ -958,23 +958,23 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } else { OPB_err(204); } - } else if (f == 9) { + } else if (f == 7) { xval->setval = (xval->setval & yval->setval); } else if (f != 0) { OPB_err(101); } break; case 2: - if (f == 5) { + if (f == 4) { if (yval->intval != 0) { xval->realval = xval->intval / (REAL)yval->intval; - OPB_CheckRealType(7, 205, xval); + OPB_CheckRealType(5, 205, xval); } else { OPB_err(205); xval->realval = (LONGREAL)1; } x->typ = OPT_realtyp; - } else if (__IN(f, 0x0180)) { + } else if (__IN(f, 0x60)) { temp = __ABS(yval->realval) >= (LONGREAL)1; if (temp || __ABS(xval->realval) <= 1.79769296342094e+308 * __ABS(yval->realval)) { xval->realval = xval->realval / yval->realval; @@ -982,14 +982,14 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } else { OPB_err(205); } - } else if (f == 9) { + } else if (f == 7) { xval->setval = xval->setval ^ yval->setval; } else if (f != 0) { OPB_err(102); } break; case 3: - if (f == 5) { + if (f == 4) { if (yval->intval != 0) { xval->intval = __DIV(xval->intval, yval->intval); OPB_SetIntType(x); @@ -1001,7 +1001,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 4: - if (f == 5) { + if (f == 4) { if (yval->intval != 0) { xval->intval = __MOD(xval->intval, yval->intval); OPB_SetIntType(x); @@ -1020,7 +1020,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 6: - if (f == 5) { + if (f == 4) { temp = (yval->intval >= 0 && xval->intval <= 9223372036854775807 - yval->intval); if (temp || (yval->intval < 0 && xval->intval >= (-9223372036854775807-1) - yval->intval)) { xval->intval += yval->intval; @@ -1028,7 +1028,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } else { OPB_err(206); } - } else if (__IN(f, 0x0180)) { + } else if (__IN(f, 0x60)) { temp = (yval->realval >= (LONGREAL)0 && xval->realval <= 1.79769296342094e+308 - yval->realval); if (temp || (yval->realval < (LONGREAL)0 && xval->realval >= -1.79769296342094e+308 - yval->realval)) { xval->realval = xval->realval + yval->realval; @@ -1036,21 +1036,21 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } else { OPB_err(206); } - } else if (f == 9) { + } else if (f == 7) { xval->setval = xval->setval | yval->setval; } else if (f != 0) { OPB_err(105); } break; case 7: - if (f == 5) { + if (f == 4) { if ((yval->intval >= 0 && xval->intval >= (-9223372036854775807-1) + yval->intval) || (yval->intval < 0 && xval->intval <= 9223372036854775807 + yval->intval)) { xval->intval -= yval->intval; OPB_SetIntType(x); } else { OPB_err(207); } - } else if (__IN(f, 0x0180)) { + } else if (__IN(f, 0x60)) { temp = (yval->realval >= (LONGREAL)0 && xval->realval >= -1.79769296342094e+308 + yval->realval); if (temp || (yval->realval < (LONGREAL)0 && xval->realval <= 1.79769296342094e+308 + yval->realval)) { xval->realval = xval->realval - yval->realval; @@ -1058,7 +1058,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } else { OPB_err(207); } - } else if (f == 9) { + } else if (f == 7) { xval->setval = (xval->setval & ~yval->setval); } else if (f != 0) { OPB_err(106); @@ -1078,28 +1078,28 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) xval->intval = OPB_BoolToInt(ConstCmp__14() != 9); break; case 11: - if (__IN(f, 0x2a04)) { + if (__IN(f, 0x0a84)) { OPB_err(108); } else { xval->intval = OPB_BoolToInt(ConstCmp__14() == 11); } break; case 12: - if (__IN(f, 0x2a04)) { + if (__IN(f, 0x0a84)) { OPB_err(108); } else { xval->intval = OPB_BoolToInt(ConstCmp__14() != 13); } break; case 13: - if (__IN(f, 0x2a04)) { + if (__IN(f, 0x0a84)) { OPB_err(108); } else { xval->intval = OPB_BoolToInt(ConstCmp__14() == 13); } break; case 14: - if (__IN(f, 0x2a04)) { + if (__IN(f, 0x0a84)) { OPB_err(108); } else { xval->intval = OPB_BoolToInt(ConstCmp__14() != 11); @@ -1123,8 +1123,8 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) f = (*x)->typ->form; g = typ->form; if ((*x)->class == 7) { - if (f == 5) { - if (g == 5) { + if (f == 4) { + if (g == 4) { if (f > g) { OPB_SetIntType(*x); if ((*x)->typ->size > typ->size) { @@ -1132,7 +1132,7 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) (*x)->conval->intval = 1; } } - } else if (__IN(g, 0x0180)) { + } else if (__IN(g, 0x60)) { (*x)->conval->realval = (*x)->conval->intval; (*x)->conval->intval = -1; } else { @@ -1141,8 +1141,8 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) OPB_err(220); } } - } else if (__IN(f, 0x0180)) { - if (__IN(g, 0x0180)) { + } else if (__IN(f, 0x60)) { + if (__IN(g, 0x60)) { OPB_CheckRealType(g, 203, (*x)->conval); } else { r = (*x)->conval->realval; @@ -1191,25 +1191,25 @@ static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) { BOOLEAN _o_result; BOOLEAN ok, xCharArr, yCharArr; - xCharArr = (__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp->form == 3) || *Op__38_s->f == 10; - yCharArr = (__IN((*y)->typ->comp, 0x0c) && (*y)->typ->BaseTyp->form == 3) || *Op__38_s->g == 10; + xCharArr = (__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp->form == 3) || *Op__38_s->f == 8; + yCharArr = (__IN((*y)->typ->comp, 0x0c) && (*y)->typ->BaseTyp->form == 3) || *Op__38_s->g == 8; if ((((xCharArr && *Op__38_s->g == 3)) && (*y)->class == 7)) { OPB_CharToString(*y); - *Op__38_s->g = 10; + *Op__38_s->g = 8; yCharArr = 1; } if ((((yCharArr && *Op__38_s->f == 3)) && (*x)->class == 7)) { OPB_CharToString(*x); - *Op__38_s->f = 10; + *Op__38_s->f = 8; xCharArr = 1; } ok = (xCharArr && yCharArr); if (ok) { - if ((*Op__38_s->f == 10 && (*x)->conval->intval2 == 1)) { + if ((*Op__38_s->f == 8 && (*x)->conval->intval2 == 1)) { (*x)->typ = OPT_chartyp; (*x)->conval->intval = 0; OPB_Index(&*y, OPB_NewIntConst(0)); - } else if ((*Op__38_s->g == 10 && (*y)->conval->intval2 == 1)) { + } else if ((*Op__38_s->g == 8 && (*y)->conval->intval2 == 1)) { (*y)->typ = OPT_chartyp; (*y)->conval->intval = 0; OPB_Index(&*x, OPB_NewIntConst(0)); @@ -1248,49 +1248,49 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPB_err(100); } break; + case 4: + if ((g == 4 && y->typ->size < z->typ->size)) { + OPB_Convert(&y, z->typ); + } else if (__IN(g, 0x70)) { + OPB_Convert(&z, y->typ); + } else { + OPB_err(100); + } + break; case 5: - if ((g == 5 && y->typ->size < z->typ->size)) { + if (g == 4) { OPB_Convert(&y, z->typ); - } else if (__IN(g, 0x01a0)) { + } else if (__IN(g, 0x60)) { OPB_Convert(&z, y->typ); } else { OPB_err(100); } break; - case 7: - if (g == 5) { + case 6: + if (__IN(g, 0x70)) { + OPB_Convert(&y, z->typ); + } else if (__IN(g, 0x60)) { OPB_Convert(&y, z->typ); - } else if (__IN(g, 0x0180)) { - OPB_Convert(&z, y->typ); } else { OPB_err(100); } break; - case 8: - if (__IN(g, 0x01a0)) { - OPB_Convert(&y, z->typ); - } else if (__IN(g, 0x0180)) { - OPB_Convert(&y, z->typ); - } else { + case 9: + if (!__IN(g, 0x1800)) { OPB_err(100); } break; case 11: - if (!__IN(g, 0x6000)) { - OPB_err(100); - } - break; - case 13: OPB_CheckPtr(z, y); break; - case 14: - if (g != 11) { + case 12: + if (g != 9) { OPB_err(100); } break; - case 10: + case 8: break; - case 15: + case 13: if (z->typ->comp == 4) { OPB_err(100); } @@ -1306,7 +1306,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) switch (op) { case 1: do_ = 1; - if (f == 5) { + if (f == 4) { if (z->class == 7) { val = z->conval->intval; if (val == 1) { @@ -1337,7 +1337,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) y->obj = NIL; } } - } else if (!__IN(f, 0x0381)) { + } else if (!__IN(f, 0xe1)) { OPB_err(105); typ = OPT_undftyp; } @@ -1346,18 +1346,18 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 2: - if (f == 5) { + if (f == 4) { if ((y->class == 7 && y->conval->intval == 0)) { OPB_err(205); } OPB_Convert(&z, OPT_realtyp); OPB_Convert(&y, OPT_realtyp); typ = OPT_realtyp; - } else if (__IN(f, 0x0180)) { + } else if (__IN(f, 0x60)) { if ((y->class == 7 && y->conval->realval == (LONGREAL)0)) { OPB_err(205); } - } else if ((f != 9 && f != 0)) { + } else if ((f != 7 && f != 0)) { OPB_err(102); typ = OPT_undftyp; } @@ -1365,7 +1365,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) break; case 3: do_ = 1; - if (f == 5) { + if (f == 4) { if (y->class == 7) { val = y->conval->intval; if (val == 0) { @@ -1388,7 +1388,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 4: - if (f == 5) { + if (f == 4) { if (y->class == 7) { if (y->conval->intval == 0) { OPB_err(205); @@ -1420,12 +1420,12 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 6: - if (!__IN(f, 0x03e1)) { + if (!__IN(f, 0xf1)) { OPB_err(105); typ = OPT_undftyp; } do_ = 1; - if (f == 5) { + if (f == 4) { if ((z->class == 7 && z->conval->intval == 0)) { do_ = 0; z = y; @@ -1439,11 +1439,11 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 7: - if (!__IN(f, 0x03e1)) { + if (!__IN(f, 0xf1)) { OPB_err(106); typ = OPT_undftyp; } - if ((f != 5 || y->class != 7) || y->conval->intval != 0) { + if ((f != 4 || y->class != 7) || y->conval->intval != 0) { NewOp__39(op, typ, &z, y); } break; @@ -1463,7 +1463,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 9: case 10: - if (__IN(f, 0x6bff) || strings__41(&z, &y)) { + if (__IN(f, 0x1aff) || strings__41(&z, &y)) { typ = OPT_booltyp; } else { OPB_err(107); @@ -1472,7 +1472,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) NewOp__39(op, typ, &z, y); break; case 11: case 12: case 13: case 14: - if (__IN(f, 0x01f9) || strings__41(&z, &y)) { + if (__IN(f, 0x79) || strings__41(&z, &y)) { typ = OPT_booltyp; } else { OPM_LogWLn(); @@ -1499,7 +1499,7 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y) LONGINT k, l; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); - } else if (((*x)->typ->form == 5 && y->typ->form == 5)) { + } else if (((*x)->typ->form == 4 && y->typ->form == 4)) { if ((*x)->class == 7) { k = (*x)->conval->intval; if (0 > k || k > (SYSTEM_INT64)OPM_MaxSet) { @@ -1534,7 +1534,7 @@ void OPB_SetElem (OPT_Node *x) LONGINT k; if ((*x)->class == 8 || (*x)->class == 9) { OPB_err(126); - } else if ((*x)->typ->form != 5) { + } else if ((*x)->typ->form != 4) { OPB_err(93); } else if ((*x)->class == 7) { k = (*x)->conval->intval; @@ -1577,40 +1577,40 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPM_LogWNum(ynode->typ->size, 0); OPM_LogWLn(); } - if (ynode->class == 8 || (ynode->class == 9 && f != 14)) { + if (ynode->class == 8 || (ynode->class == 9 && f != 12)) { OPB_err(126); } switch (f) { - case 0: case 10: + case 0: case 8: break; case 1: - if (!((__IN(g, 0x2a) && y->size == 1))) { + if (!((__IN(g, 0x1a) && y->size == 1))) { OPB_err(113); } break; - case 2: case 3: case 9: + case 2: case 3: case 7: if (g != f) { OPB_err(113); } break; + case 4: + if (g != 4 || x->size < y->size) { + OPB_err(113); + } + break; case 5: - if (g != 5 || x->size < y->size) { + if (!__IN(g, 0x30)) { OPB_err(113); } break; - case 7: - if (!__IN(g, 0xe0)) { + case 6: + if (!__IN(g, 0x70)) { OPB_err(113); } break; - case 8: - if (!__IN(g, 0x01e0)) { - OPB_err(113); - } - break; - case 13: - if ((x == y || g == 11) || (x == OPT_sysptrtyp && g == 13)) { - } else if (g == 13) { + case 11: + if ((x == y || g == 9) || (x == OPT_sysptrtyp && g == 11)) { + } else if (g == 11) { p = x->BaseTyp; q = y->BaseTyp; if ((p->comp == 4 && q->comp == 4)) { @@ -1627,28 +1627,28 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPB_err(113); } break; - case 14: + case 12: if (ynode->class == 9) { OPB_CheckProc(x, ynode->obj); - } else if (x == y || g == 11) { + } else if (x == y || g == 9) { } else { OPB_err(113); } break; - case 12: case 11: + case 10: case 9: OPB_err(113); break; - case 15: + case 13: x->pvused = 1; if (x->comp == 2) { if ((ynode->class == 7 && g == 3)) { OPB_CharToString(ynode); y = ynode->typ; - g = 10; + g = 8; } if (x == y) { } else if (x->BaseTyp == OPT_chartyp) { - if (g == 10) { + if (g == 8) { if (ynode->conval->intval2 > x->n) { OPB_err(114); } @@ -1687,7 +1687,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPM_LogWLn(); break; } - if ((((((ynode->class == 7 && g < f)) && __IN(g, 0xe0))) && __IN(f, 0x01e0))) { + if ((((((ynode->class == 7 && g < f)) && __IN(g, 0x30))) && __IN(f, 0x70))) { OPB_Convert(&ynode, x); } } @@ -1705,7 +1705,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) f = x->typ->form; switch (fctno) { case 0: - if ((f == 5 && x->class == 7)) { + if ((f == 4 && x->class == 7)) { if ((0 <= x->conval->intval && x->conval->intval <= 255)) { OPB_BindNodes(28, OPT_notyp, &x, x); } else { @@ -1720,7 +1720,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) typ = OPT_notyp; if (OPB_NotVar(x)) { OPB_err(112); - } else if (f == 13) { + } else if (f == 11) { if (x->readonly) { OPB_err(76); } @@ -1758,7 +1758,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 5: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x0180)) { + } else if (__IN(f, 0x60)) { OPB_Convert(&x, OPT_linttyp); } else { OPB_err(111); @@ -1778,17 +1778,17 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) x = OPB_NewIntConst(0); x->typ = OPT_chartyp; break; - case 5: + case 4: x = OPB_NewIntConst(OPM_SignedMinimum(x->typ->size)); break; - case 9: + case 7: x = OPB_NewIntConst(0); x->typ = OPT_inttyp; break; - case 7: + case 5: x = OPB_NewRealConst(OPM_MinReal, OPT_realtyp); break; - case 8: + case 6: x = OPB_NewRealConst(OPM_MinLReal, OPT_lrltyp); break; default: @@ -1809,17 +1809,17 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) x = OPB_NewIntConst(255); x->typ = OPT_chartyp; break; - case 5: + case 4: x = OPB_NewIntConst(OPM_SignedMaximum(x->typ->size)); break; - case 9: + case 7: x = OPB_NewIntConst(OPM_MaxSet); x->typ = OPT_inttyp; break; - case 7: + case 5: x = OPB_NewRealConst(OPM_MaxReal, OPT_realtyp); break; - case 8: + case 6: x = OPB_NewRealConst(OPM_MaxLReal, OPT_lrltyp); break; default: @@ -1833,7 +1833,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 9: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x21)) { + } else if (__IN(f, 0x11)) { OPB_Convert(&x, OPT_chartyp); } else { OPB_err(111); @@ -1843,14 +1843,14 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 10: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 5) { + } else if (f == 4) { typ = OPT_ShorterOrLongerType(x->typ, -1); if (typ == NIL) { OPB_err(111); } else { OPB_Convert(&x, typ); } - } else if (f == 8) { + } else if (f == 6) { OPB_Convert(&x, OPT_realtyp); } else { OPB_err(111); @@ -1859,14 +1859,14 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 11: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 5) { + } else if (f == 4) { typ = OPT_ShorterOrLongerType(x->typ, 1); if (typ == NIL) { OPB_err(111); } else { OPB_Convert(&x, typ); } - } else if (f == 7) { + } else if (f == 5) { OPB_Convert(&x, OPT_lrltyp); } else if (f == 3) { OPB_Convert(&x, OPT_linttyp); @@ -1877,7 +1877,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 13: case 14: if (OPB_NotVar(x)) { OPB_err(112); - } else if (f != 5) { + } else if (f != 4) { OPB_err(111); } else if (x->readonly) { OPB_err(76); @@ -1901,18 +1901,18 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 18: if ((x->class == 7 && f == 3)) { OPB_CharToString(x); - f = 10; + f = 8; } if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (((!__IN(x->typ->comp, 0x0c) || x->typ->BaseTyp->form != 3) && f != 10)) { + } else if (((!__IN(x->typ->comp, 0x0c) || x->typ->BaseTyp->form != 3) && f != 8)) { OPB_err(111); } break; case 19: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 5) { + } else if (f == 4) { if (x->typ->size != (SYSTEM_INT64)OPM_LIntSize) { OPB_Convert(&x, OPT_linttyp); } @@ -1929,7 +1929,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) if (x->class != 8) { OPB_err(110); x = OPB_NewIntConst(1); - } else if (__IN(f, 0x63fe) || __IN(x->typ->comp, 0x14)) { + } else if (__IN(f, 0x18fe) || __IN(x->typ->comp, 0x14)) { (*OPB_typSize)(x->typ); x->typ->pvused = 1; x = OPB_NewIntConst(x->typ->size); @@ -1944,22 +1944,22 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 22: case 23: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (!__IN(f, 0x022a)) { + } else if (!__IN(f, 0x9a)) { OPB_err(111); } break; case 24: case 25: case 28: case 31: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((((x->class == 7 && f == 5)) && x->typ->size < OPT_linttyp->size)) { + } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x2020) && x->typ->size == (SYSTEM_INT64)OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x0810) && x->typ->size == (SYSTEM_INT64)OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } break; case 26: case 27: - if ((f == 5 && x->class == 7)) { + if ((f == 4 && x->class == 7)) { if (x->conval->intval < 0 || x->conval->intval > -1) { OPB_err(220); } @@ -1970,14 +1970,14 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 29: if (x->class != 8) { OPB_err(110); - } else if (__IN(f, 0x1401) || x->typ->comp == 3) { + } else if (__IN(f, 0x0501) || x->typ->comp == 3) { OPB_err(111); } break; case 30: if (OPB_NotVar(x)) { OPB_err(112); - } else if (f == 13) { + } else if (f == 11) { } else { OPB_err(111); } @@ -2037,7 +2037,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) p->typ = OPT_notyp; } else { if (x->typ != p->typ) { - if ((x->class == 7 && f == 5)) { + if ((x->class == 7 && f == 4)) { OPB_Convert(&x, p->typ); } else { OPB_err(111); @@ -2050,7 +2050,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 15: case 16: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 5) { + } else if (f == 4) { if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > (SYSTEM_INT64)OPM_MaxSet))) { OPB_err(202); } @@ -2061,7 +2061,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) p->typ = OPT_notyp; break; case 17: - if (!(f == 5) || x->class != 7) { + if (!(f == 4) || x->class != 7) { OPB_err(69); } else if (x->typ->size == 1) { L = (SYSTEM_INT32)x->conval->intval; @@ -2110,7 +2110,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 19: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 5) { + } else if (f == 4) { if ((p->class == 7 && x->class == 7)) { if (-OPB_maxExp > x->conval->intval || x->conval->intval > OPB_maxExp) { OPB_err(208); @@ -2138,7 +2138,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (p->typ->comp == 3) { - if (f == 5) { + if (f == 4) { if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > OPM_MaxIndex))) { OPB_err(63); } @@ -2154,7 +2154,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 22: case 23: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f != 5) { + } else if (f != 4) { OPB_err(111); } else { if (fctno == 22) { @@ -2168,7 +2168,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 24: case 25: case 26: case 27: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x63ff)) { + } else if (__IN(f, 0x18ff)) { if (fctno == 24 || fctno == 26) { if (OPB_NotVar(x)) { OPB_err(112); @@ -2186,7 +2186,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 28: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 5) { + } else if (f == 4) { p = NewOp__53(12, 26, p, x); } else { OPB_err(111); @@ -2194,7 +2194,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) p->typ = OPT_booltyp; break; case 29: - if (((x->class == 8 || x->class == 9) || __IN(f, 0x1401)) || x->typ->comp == 3) { + if (((x->class == 8 || x->class == 9) || __IN(f, 0x0501)) || x->typ->comp == 3) { OPB_err(126); } if (x->typ->size < p->typ->size) { @@ -2210,7 +2210,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 30: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 5) { + } else if (f == 4) { p = NewOp__53(19, 30, p, x); } else { OPB_err(111); @@ -2220,16 +2220,16 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 31: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((((x->class == 7 && f == 5)) && x->typ->size < OPT_linttyp->size)) { + } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x2020) && x->typ->size == (SYSTEM_INT64)OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x0810) && x->typ->size == (SYSTEM_INT64)OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } p->link = x; break; case 32: - if ((f == 5 && x->class == 7)) { + if ((f == 4 && x->class == 7)) { if ((0 <= x->conval->intval && x->conval->intval <= 255)) { OPB_BindNodes(28, OPT_notyp, &x, x); x->conval = OPT_NewConst(); @@ -2272,7 +2272,7 @@ void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n) OPB_err(126); } else if (p->typ->comp != 3) { OPB_err(64); - } else if (f == 5) { + } else if (f == 4) { if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > OPM_MaxIndex))) { OPB_err(63); } @@ -2288,7 +2288,7 @@ void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n) } else if ((fctno == 31 && n == 2)) { if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 5) { + } else if (f == 4) { node = OPT_NewNode(19); node->subcl = 31; node->right = p; @@ -2376,7 +2376,7 @@ static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpa ftyp = ftyp->BaseTyp; atyp = atyp->BaseTyp; if ((fvarpar && ftyp == OPT_bytetyp)) { - if (!__IN(f, 0x0c) || !((__IN(atyp->form, 0x2e) && atyp->size == 1))) { + if (!__IN(f, 0x0c) || !((__IN(atyp->form, 0x1e) && atyp->size == 1))) { if (__IN(18, OPM_opt)) { OPB_err(-301); } @@ -2385,7 +2385,7 @@ static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpa if (ftyp->comp == 3) { OPB_DynArrParCheck(ftyp, atyp, fvarpar); } else if (ftyp != atyp) { - if ((((!fvarpar && ftyp->form == 13)) && atyp->form == 13)) { + if ((((!fvarpar && ftyp->form == 11)) && atyp->form == 11)) { ftyp = ftyp->BaseTyp; atyp = atyp->BaseTyp; if ((ftyp->comp == 4 && atyp->comp == 4)) { @@ -2409,7 +2409,7 @@ static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpa static void OPB_CheckReceiver (OPT_Node *x, OPT_Object fp) { - if (fp->typ->form == 13) { + if (fp->typ->form == 11) { if ((*x)->class == 3) { *x = (*x)->left; } else { @@ -2426,7 +2426,7 @@ void OPB_PrepCall (OPT_Node *x, OPT_Object *fpar) OPB_CheckReceiver(&(*x)->left, *fpar); *fpar = (*fpar)->link; } - } else if (((((*x)->class != 8 && (*x)->typ != NIL)) && (*x)->typ->form == 14)) { + } else if (((((*x)->class != 8 && (*x)->typ != NIL)) && (*x)->typ->form == 12)) { *fpar = (*x)->typ->link; } else { OPB_err(121); @@ -2458,17 +2458,17 @@ void OPB_Param (OPT_Node ap, OPT_Object fp) if (q == NIL) { OPB_err(111); } - } else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 13)) { - } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x2e) && ap->typ->size == 1)))))) { + } else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 11)) { + } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x1e) && ap->typ->size == 1)))))) { OPB_err(123); - } else if ((fp->typ->form == 13 && ap->class == 5)) { + } else if ((fp->typ->form == 11 && ap->class == 5)) { OPB_err(123); } } else if (fp->typ->comp == 3) { if ((ap->class == 7 && ap->typ->form == 3)) { OPB_CharToString(ap); } - if ((ap->typ->form == 10 && fp->typ->BaseTyp->form == 3)) { + if ((ap->typ->form == 8 && fp->typ->BaseTyp->form == 3)) { } else if (ap->class >= 7) { OPB_err(59); } else { @@ -2576,7 +2576,7 @@ void OPB_Assign (OPT_Node *x, OPT_Node y) OPB_BindNodes(6, (*x)->typ, &z, NIL); *x = z; } - } else if (((((((*x)->typ->comp == 2 && (*x)->typ->BaseTyp == OPT_chartyp)) && y->typ->form == 10)) && y->conval->intval2 == 1)) { + } else if (((((((*x)->typ->comp == 2 && (*x)->typ->BaseTyp == OPT_chartyp)) && y->typ->form == 8)) && y->conval->intval2 == 1)) { y->typ = OPT_chartyp; y->conval->intval = 0; OPB_Index(&*x, OPB_NewIntConst(0)); diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index 0b71f987..7b980a10 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index b8a0608e..ad70616c 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -228,12 +228,12 @@ static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause) if (__IN(typ->comp, 0x0c)) { OPC_Stars(typ->BaseTyp, &*openClause); *openClause = typ->comp == 2; - } else if (typ->form == 14) { + } else if (typ->form == 12) { OPM_Write('('); OPM_Write('*'); } else { pointers = 0; - while (((typ->strobj == NIL || typ->strobj->name[0] == 0x00) && typ->form == 13)) { + while (((typ->strobj == NIL || typ->strobj->name[0] == 0x00) && typ->form == 11)) { pointers += 1; typ = typ->BaseTyp; } @@ -278,16 +278,16 @@ static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef) for (;;) { form = typ->form; comp = typ->comp; - if (((typ->strobj != NIL && typ->strobj->name[0] != 0x00) || form == 12) || comp == 4) { + if (((typ->strobj != NIL && typ->strobj->name[0] != 0x00) || form == 10) || comp == 4) { break; - } else if ((form == 13 && typ->BaseTyp->comp != 3)) { + } else if ((form == 11 && typ->BaseTyp->comp != 3)) { openClause = 1; - } else if (form == 14 || __IN(comp, 0x0c)) { + } else if (form == 12 || __IN(comp, 0x0c)) { if (openClause) { OPM_Write(')'); openClause = 0; } - if (form == 14) { + if (form == 12) { if (OPC_ansi) { OPM_Write(')'); OPC_AnsiParamList(typ->link, 0); @@ -332,19 +332,19 @@ static void OPC_DeclareBase (OPT_Object dcl) LONGINT off, n, dummy; typ = dcl->typ; prev = typ; - while ((((((((typ->strobj == NIL || typ->comp == 3) || OPC_Undefined(typ->strobj)) && typ->comp != 4)) && typ->form != 12)) && !((typ->form == 13 && typ->BaseTyp->comp == 3)))) { + while ((((((((typ->strobj == NIL || typ->comp == 3) || OPC_Undefined(typ->strobj)) && typ->comp != 4)) && typ->form != 10)) && !((typ->form == 11 && typ->BaseTyp->comp == 3)))) { prev = typ; typ = typ->BaseTyp; } obj = typ->strobj; - if (typ->form == 12) { + if (typ->form == 10) { OPM_WriteString((CHAR*)"void", 5); } else if ((obj != NIL && !OPC_Undefined(obj))) { OPC_Ident(obj); } else if (typ->comp == 4) { OPM_WriteString((CHAR*)"struct ", 8); OPC_Andent(typ); - if ((prev->form != 13 && (obj != NIL || dcl->name[0] == 0x00))) { + if ((prev->form != 11 && (obj != NIL || dcl->name[0] == 0x00))) { if ((typ->BaseTyp != NIL && typ->BaseTyp->strobj->vis != 0)) { OPM_WriteString((CHAR*)" { /* ", 7); OPC_Ident(typ->BaseTyp->strobj); @@ -358,7 +358,7 @@ static void OPC_DeclareBase (OPT_Object dcl) OPC_FieldList(typ, 1, &off, &n, &dummy); OPC_EndBlk0(); } - } else if ((typ->form == 13 && typ->BaseTyp->comp == 3)) { + } else if ((typ->form == 11 && typ->BaseTyp->comp == 3)) { typ = typ->BaseTyp->BaseTyp; nofdims = 1; while (typ->comp == 3) { @@ -373,7 +373,7 @@ static void OPC_DeclareBase (OPT_Object dcl) OPC_BegStat(); __NEW(obj, OPT_ObjDesc); __NEW(obj->typ, OPT_StrDesc); - obj->typ->form = 15; + obj->typ->form = 13; obj->typ->comp = 2; obj->typ->n = 1; obj->typ->BaseTyp = typ; @@ -394,7 +394,7 @@ LONGINT OPC_NofPtrs (OPT_Struct typ) OPT_Object fld = NIL; OPT_Struct btyp = NIL; LONGINT n; - if ((typ->form == 13 && typ->sysflag == 0)) { + if ((typ->form == 11 && typ->sysflag == 0)) { _o_result = 1; return _o_result; } else if ((typ->comp == 4 && __MASK(typ->sysflag, -256) == 0)) { @@ -436,7 +436,7 @@ static void OPC_PutPtrOffsets (OPT_Struct typ, LONGINT adr, LONGINT *cnt) OPT_Object fld = NIL; OPT_Struct btyp = NIL; LONGINT n, i; - if ((typ->form == 13 && typ->sysflag == 0)) { + if ((typ->form == 11 && typ->sysflag == 0)) { OPM_WriteInt(adr); OPM_WriteString((CHAR*)", ", 3); *cnt += 1; @@ -541,7 +541,7 @@ static void OPC_DeclareParams (OPT_Object par, BOOLEAN macro) if (macro) { OPM_WriteStringVar((void*)par->name, 256); } else { - if ((par->mode == 1 && par->typ->form == 7)) { + if ((par->mode == 1 && par->typ->form == 5)) { OPM_Write('_'); } OPC_Ident(par); @@ -613,7 +613,7 @@ OPT_Object OPC_BaseTProc (OPT_Object obj) OPT_Struct typ = NIL, base = NIL; LONGINT mno; typ = obj->link->typ; - if (typ->form == 13) { + if (typ->form == 11) { typ = typ->BaseTyp; } base = typ->BaseTyp; @@ -636,7 +636,7 @@ static void OPC_DefineTProcMacros (OPT_Object obj, BOOLEAN *empty) OPC_Ident(obj); OPC_DeclareParams(obj->link, 1); OPM_WriteString((CHAR*)" __SEND(", 9); - if (obj->link->typ->form == 13) { + if (obj->link->typ->form == 11) { OPM_WriteString((CHAR*)"__TYPEOF(", 10); OPC_Ident(obj->link); OPM_Write(')'); @@ -674,7 +674,7 @@ static void OPC_DefineType (OPT_Struct str) if (obj == NIL || OPC_Undefined(obj)) { if (obj != NIL) { if (obj->linkadr == 1) { - if (str->form != 13) { + if (str->form != 11) { OPM_Mark(244, str->txtpos); obj->linkadr = 2; } @@ -693,13 +693,13 @@ static void OPC_DefineType (OPT_Struct str) } field = field->link; } - } else if (str->form == 13) { + } else if (str->form == 11) { if (str->BaseTyp->comp != 4) { OPC_DefineType(str->BaseTyp); } } else if (__IN(str->comp, 0x0c)) { OPC_DefineType(str->BaseTyp); - } else if (str->form == 14) { + } else if (str->form == 12) { if (str->BaseTyp != OPT_notyp) { OPC_DefineType(str->BaseTyp); } @@ -890,7 +890,7 @@ LONGINT OPC_BaseAlignment (OPT_Struct typ) { LONGINT _o_result; LONGINT alignment; - if (typ->form == 15) { + if (typ->form == 13) { if (typ->comp == 4) { alignment = __MASK(typ->align, -65536); } else { @@ -1018,7 +1018,7 @@ static void OPC_IdentList (OPT_Object obj, INTEGER vis) OPM_WriteString((CHAR*)"export ", 8); } } - if ((((vis == 2 && obj->mode == 1)) && base->form == 7)) { + if ((((vis == 2 && obj->mode == 1)) && base->form == 5)) { OPM_WriteString((CHAR*)"double", 7); } else { OPC_DeclareBase(obj); @@ -1027,7 +1027,7 @@ static void OPC_IdentList (OPT_Object obj, INTEGER vis) OPM_Write(','); } OPM_Write(' '); - if ((((vis == 2 && obj->mode == 1)) && base->form == 7)) { + if ((((vis == 2 && obj->mode == 1)) && base->form == 5)) { OPM_Write('_'); } OPC_DeclareObj(obj, vis == 3); @@ -1044,7 +1044,7 @@ static void OPC_IdentList (OPT_Object obj, INTEGER vis) OPC_Ident(obj); OPM_WriteString((CHAR*)"__typ", 6); base = NIL; - } else if ((((((OPC_ptrinit && vis == 0)) && obj->mnolev > 0)) && obj->typ->form == 13)) { + } else if ((((((OPC_ptrinit && vis == 0)) && obj->mnolev > 0)) && obj->typ->form == 11)) { OPM_WriteString((CHAR*)" = NIL", 7); } } @@ -1381,7 +1381,7 @@ void OPC_GenEnumPtrs (OPT_Object var) OPC_BegBlk(); } OPC_BegStat(); - if (typ->form == 13) { + if (typ->form == 11) { OPM_WriteString((CHAR*)"P(", 3); OPC_Ident(var); OPM_Write(')'); @@ -1400,7 +1400,7 @@ void OPC_GenEnumPtrs (OPT_Object var) n = n * typ->n; typ = typ->BaseTyp; } - if (typ->form == 13) { + if (typ->form == 11) { OPM_WriteString((CHAR*)"__ENUMP(", 9); OPC_Ident(var); OPC_Str1((CHAR*)", #, P)", 8, n); @@ -1563,7 +1563,7 @@ void OPC_EnterProc (OPT_Object proc) if (!OPC_ansi) { var = proc->link; while (var != NIL) { - if ((var->typ->form == 7 && var->mode == 1)) { + if ((var->typ->form == 5 && var->mode == 1)) { OPC_BegStat(); OPC_Ident(var->typ->strobj); OPM_Write(' '); @@ -1879,7 +1879,7 @@ void OPC_Case (LONGINT caseVal, INTEGER form) case 3: OPC_CharacterLiteral(caseVal); break; - case 5: + case 4: OPM_WriteInt(caseVal); break; default: @@ -1977,16 +1977,16 @@ void OPC_Constant (OPT_Const con, INTEGER form) case 3: OPC_CharacterLiteral(con->intval); break; - case 5: + case 4: OPM_WriteInt(con->intval); break; - case 7: + case 5: OPM_WriteReal(con->realval, 'f'); break; - case 8: + case 6: OPM_WriteReal(con->realval, 0x00); break; - case 9: + case 7: OPM_WriteString((CHAR*)"0x", 3); skipLeading = 1; s = con->setval; @@ -2009,10 +2009,10 @@ void OPC_Constant (OPT_Const con, INTEGER form) OPM_Write('0'); } break; - case 10: + case 8: OPC_StringLiteral(*con->ext, 256, con->intval2 - 1); break; - case 11: + case 9: OPM_WriteString((CHAR*)"NIL", 4); break; default: diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index 21b48db8..bb250e9a 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 450ed83d..228e7978 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index 5363c227..6bbab25d 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index becc2507..9337c539 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPB.h" @@ -137,7 +137,7 @@ static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_) OPP_err(135); } OPP_ConstExpression(&x); - if (x->typ->form == 5) { + if (x->typ->form == 4) { sf = x->conval->intval; if (sf < 0 || sf > 1) { OPP_err(220); @@ -159,7 +159,7 @@ static void OPP_RecordType (OPT_Struct *typ, OPT_Struct *banned) OPT_Object fld = NIL, first = NIL, last = NIL, base = NIL; OPT_Struct ftyp = NIL; INTEGER sysflag; - *typ = OPT_NewStr(15, 4); + *typ = OPT_NewStr(13, 4); (*typ)->BaseTyp = NIL; OPP_CheckSysFlag(&sysflag, -1); if (OPP_sym == 30) { @@ -254,7 +254,7 @@ static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) INTEGER sysflag; OPP_CheckSysFlag(&sysflag, 0); if (OPP_sym == 25) { - *typ = OPT_NewStr(15, 3); + *typ = OPT_NewStr(13, 3); (*typ)->mno = 0; (*typ)->sysflag = sysflag; OPS_Get(&OPP_sym); @@ -266,10 +266,10 @@ static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) (*typ)->n = 0; } } else { - *typ = OPT_NewStr(15, 2); + *typ = OPT_NewStr(13, 2); (*typ)->sysflag = sysflag; OPP_ConstExpression(&x); - if (x->typ->form == 5) { + if (x->typ->form == 4) { n = x->conval->intval; if (n <= 0 || n > OPM_MaxIndex) { OPP_err(63); @@ -302,7 +302,7 @@ static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) static void OPP_PointerType (OPT_Struct *typ) { OPT_Object id = NIL; - *typ = OPT_NewStr(13, 1); + *typ = OPT_NewStr(11, 1); OPP_CheckSysFlag(&(*typ)->sysflag, 0); OPP_CheckSym(28); if (OPP_sym == 38) { @@ -410,7 +410,7 @@ static void OPP_FormalParameters (OPT_Object *firstPar, OPT_Struct *resTyp) if (OPP_sym == 38) { OPP_qualident(&res); if (res->mode == 5) { - if (res->typ->form < 15) { + if (res->typ->form < 13) { *resTyp = res->typ; } else { OPP_err(54); @@ -460,7 +460,7 @@ static void OPP_TypeDecl (OPT_Struct *typ, OPT_Struct *banned) OPP_PointerType(&*typ); } else if (OPP_sym == 61) { OPS_Get(&OPP_sym); - *typ = OPT_NewStr(14, 1); + *typ = OPT_NewStr(12, 1); OPP_CheckSysFlag(&(*typ)->sysflag, 0); if (OPP_sym == 30) { OPS_Get(&OPP_sym); @@ -489,7 +489,7 @@ static void OPP_TypeDecl (OPT_Struct *typ, OPT_Struct *banned) static void OPP_Type (OPT_Struct *typ, OPT_Struct *banned) { OPP_TypeDecl(&*typ, &*banned); - if (((((*typ)->form == 13 && (*typ)->BaseTyp == OPT_undftyp)) && (*typ)->strobj == NIL)) { + if (((((*typ)->form == 11 && (*typ)->BaseTyp == OPT_undftyp)) && (*typ)->strobj == NIL)) { OPP_err(0); } } @@ -504,7 +504,7 @@ static void OPP_selector (OPT_Node *x) if (OPP_sym == 31) { OPS_Get(&OPP_sym); for (;;) { - if (((*x)->typ != NIL && (*x)->typ->form == 13)) { + if (((*x)->typ != NIL && (*x)->typ->form == 11)) { OPB_DeRef(&*x); } OPP_Expression(&y); @@ -522,7 +522,7 @@ static void OPP_selector (OPT_Node *x) __COPY(OPS_name, name, 256); OPS_Get(&OPP_sym); if ((*x)->typ != NIL) { - if ((*x)->typ->form == 13) { + if ((*x)->typ->form == 11) { OPB_DeRef(&*x); } if ((*x)->typ->comp == 4) { @@ -544,7 +544,7 @@ static void OPP_selector (OPT_Node *x) OPP_err(75); } typ = y->obj->typ; - if (typ->form == 13) { + if (typ->form == 11) { typ = typ->BaseTyp; } OPT_FindField((*x)->obj->name, typ->BaseTyp, &proc); @@ -573,7 +573,7 @@ static void OPP_selector (OPT_Node *x) } else if (OPP_sym == 17) { OPS_Get(&OPP_sym); OPB_DeRef(&*x); - } else if ((((((OPP_sym == 30 && (*x)->class < 7)) && (*x)->typ->form != 14)) && ((*x)->obj == NIL || (*x)->obj->mode != 13))) { + } else if ((((((OPP_sym == 30 && (*x)->class < 7)) && (*x)->typ->form != 12)) && ((*x)->obj == NIL || (*x)->obj->mode != 13))) { OPS_Get(&OPP_sym); if (OPP_sym == 38) { OPP_qualident(&obj); @@ -872,10 +872,10 @@ static void OPP_Receiver (SHORTINT *mode, OPS_Name name, OPT_Struct *typ, OPT_St } else { *typ = obj->typ; *rec = *typ; - if ((*rec)->form == 13) { + if ((*rec)->form == 11) { *rec = (*rec)->BaseTyp; } - if (!((((*mode == 1 && (*typ)->form == 13)) && (*rec)->comp == 4) || (*mode == 2 && (*typ)->comp == 4))) { + if (!((((*mode == 1 && (*typ)->form == 11)) && (*rec)->comp == 4) || (*mode == 2 && (*typ)->comp == 4))) { OPP_err(70); *rec = NIL; } @@ -889,7 +889,7 @@ static void OPP_Receiver (SHORTINT *mode, OPS_Name name, OPT_Struct *typ, OPT_St } OPP_CheckSym(22); if (*rec == NIL) { - *rec = OPT_NewStr(15, 4); + *rec = OPT_NewStr(13, 4); (*rec)->BaseTyp = NIL; } } @@ -897,7 +897,7 @@ static void OPP_Receiver (SHORTINT *mode, OPS_Name name, OPT_Struct *typ, OPT_St static BOOLEAN OPP_Extends (OPT_Struct x, OPT_Struct b) { BOOLEAN _o_result; - if ((b->form == 13 && x->form == 13)) { + if ((b->form == 11 && x->form == 11)) { b = b->BaseTyp; x = x->BaseTyp; } @@ -1174,14 +1174,14 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, O for (;;) { OPP_ConstExpression(&x); f = x->typ->form; - if (__IN(f, 0x28)) { + if (__IN(f, 0x18)) { xval = x->conval->intval; } else { OPP_err(61); xval = 1; } - if (f == 5) { - if (!(LabelTyp->form == 5) || LabelTyp->size < x->typ->size) { + if (f == 4) { + if (!(LabelTyp->form == 4) || LabelTyp->size < x->typ->size) { OPP_err(60); } } else if (LabelTyp->form != f) { @@ -1191,7 +1191,7 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, O OPS_Get(&OPP_sym); OPP_ConstExpression(&y); yval = y->conval->intval; - if ((y->typ->form != f && !((f == 5 && y->typ->form == 5)))) { + if ((y->typ->form != f && !((f == 4 && y->typ->form == 4)))) { OPP_err(60); } if (yval < xval) { @@ -1254,7 +1254,7 @@ static void CasePart__31 (OPT_Node *x) *StatSeq__30_s->pos = OPM_errpos; if ((*x)->class == 8 || (*x)->class == 9) { OPP_err(126); - } else if (!__IN((*x)->typ->form, 0x38)) { + } else if (!__IN((*x)->typ->form, 0x18)) { OPP_err(125); } OPP_CheckSym(25); @@ -1440,7 +1440,7 @@ static void OPP_StatSeq (OPT_Node *stat) OPS_Get(&OPP_sym); if (OPP_sym == 38) { OPP_qualident(&id); - if (!(id->typ->form == 5)) { + if (!(id->typ->form == 4)) { OPP_err(68); } OPP_CheckSym(34); @@ -1472,7 +1472,7 @@ static void OPP_StatSeq (OPT_Node *stat) SetPos__35(z); OPB_Link(&*stat, &last, z); y = OPB_NewLeaf(t); - } else if (!(y->typ->form == 5) || y->typ->size > x->left->typ->size) { + } else if (!(y->typ->form == 4) || y->typ->size > x->left->typ->size) { OPP_err(113); } OPB_Link(&*stat, &last, x); @@ -1527,7 +1527,7 @@ static void OPP_StatSeq (OPT_Node *stat) if (OPP_sym == 38) { OPP_qualident(&id); y = OPB_NewLeaf(id); - if ((((id != NIL && id->typ->form == 13)) && (id->mode == 2 || !id->leaf))) { + if ((((id != NIL && id->typ->form == 11)) && (id->mode == 2 || !id->leaf))) { OPP_err(245); } OPP_CheckSym(20); diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index 7a12f897..863db6d6 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index 2ee978f2..e575dfe6 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index a8dccfed..a60ffe74 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index f8762935..35088301 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" @@ -174,7 +174,7 @@ OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir) { OPT_Struct _o_result; INTEGER i; - __ASSERT(x->form == 5, 0); + __ASSERT(x->form == 4, 0); __ASSERT(dir == 1 || dir == -1, 0); __ASSERT(x->BaseTyp == OPT_undftyp, 0); i = 0; @@ -285,7 +285,7 @@ void OPT_Close (void) OPT_GlbMod[__X(i, 64)] = NIL; i += 1; } - i = 16; + i = 14; while (i < 255) { OPT_impCtxt.ref[__X(i, 255)] = NIL; OPT_impCtxt.old[__X(i, 255)] = NIL; @@ -484,14 +484,14 @@ void OPT_IdFPrint (OPT_Struct typ) OPT_FPrintName(&idfp, (void*)OPT_GlbMod[__X(typ->mno, 64)]->name, 256); OPT_FPrintName(&idfp, (void*)strobj->name, 256); } - if ((f == 13 || (c == 4 && btyp != NIL)) || c == 3) { + if ((f == 11 || (c == 4 && btyp != NIL)) || c == 3) { OPT_IdFPrint(btyp); OPM_FPrint(&idfp, btyp->idfp); } else if (c == 2) { OPT_IdFPrint(btyp); OPM_FPrint(&idfp, btyp->idfp); OPM_FPrint(&idfp, typ->n); - } else if (f == 14) { + } else if (f == 12) { OPT_FPrintSign(&idfp, btyp, typ->link); } typ->idfp = idfp; @@ -520,7 +520,7 @@ static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr) n = btyp->n * n; btyp = btyp->BaseTyp; } - if (btyp->form == 13 || btyp->comp == 4) { + if (btyp->form == 11 || btyp->comp == 4) { j = OPT_nofhdfld; FPrintHdFld__15(btyp, fld, adr); if (j != OPT_nofhdfld) { @@ -532,8 +532,8 @@ static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr) } } } - } else if (typ->form == 13 || __STRCMP(fld->name, "@ptr") == 0) { - OPM_FPrint(&*FPrintStr__12_s->pvfp, 13); + } else if (typ->form == 11 || __STRCMP(fld->name, "@ptr") == 0) { + OPM_FPrint(&*FPrintStr__12_s->pvfp, 11); OPM_FPrint(&*FPrintStr__12_s->pvfp, adr); OPT_nofhdfld += 1; } @@ -596,7 +596,7 @@ void OPT_FPrintStr (OPT_Struct typ) f = typ->form; c = typ->comp; btyp = typ->BaseTyp; - if (f == 13) { + if (f == 11) { strobj = typ->strobj; bstrobj = btyp->strobj; if (((strobj == NIL || strobj->name[0] == 0x00) || bstrobj == NIL) || bstrobj->name[0] == 0x00) { @@ -604,7 +604,7 @@ void OPT_FPrintStr (OPT_Struct typ) OPM_FPrint(&pbfp, btyp->pbfp); pvfp = pbfp; } - } else if (f == 14) { + } else if (f == 12) { } else if (__IN(c, 0x0c)) { OPT_FPrintStr(btyp); OPM_FPrint(&pbfp, btyp->pvfp); @@ -650,23 +650,23 @@ void OPT_FPrintObj (OPT_Object obj) f = obj->typ->form; OPM_FPrint(&fprint, f); switch (f) { - case 2: case 3: case 5: + case 2: case 3: case 4: OPM_FPrint(&fprint, obj->conval->intval); break; - case 9: + case 7: OPM_FPrintSet(&fprint, obj->conval->setval); break; - case 7: + case 5: rval = obj->conval->realval; OPM_FPrintReal(&fprint, rval); break; - case 8: + case 6: OPM_FPrintLReal(&fprint, obj->conval->realval); break; - case 10: + case 8: OPT_FPrintName(&fprint, (void*)*obj->conval->ext, 256); break; - case 11: + case 9: break; default: OPT_err(127); @@ -851,22 +851,22 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval) OPM_SymRCh(&ch); conval->intval = ch; break; - case 5: + case 4: conval->intval = OPM_SymRInt(); break; - case 9: + case 7: OPM_SymRSet(&conval->setval); break; - case 7: + case 5: OPM_SymRReal(&rval); conval->realval = rval; conval->intval = -1; break; - case 8: + case 6: OPM_SymRLReal(&conval->realval); conval->intval = -1; break; - case 10: + case 8: ext = OPT_NewExt(); conval->ext = ext; i = 0; @@ -878,7 +878,7 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval) conval->intval2 = i; conval->intval = -1; break; - case 11: + case 9: conval->intval = 0; break; default: @@ -980,7 +980,7 @@ static OPT_Object OPT_InTProc (SHORTINT mno) static OPT_Struct OPT_InTyp (LONGINT tag) { OPT_Struct _o_result; - if (tag == 5) { + if (tag == 4) { _o_result = OPT_IntType(OPM_SymRInt()); return _o_result; } else { @@ -1055,20 +1055,20 @@ static void OPT_InStruct (OPT_Struct *typ) } switch (tag) { case 36: - (*typ)->form = 13; + (*typ)->form = 11; (*typ)->size = OPM_PointerSize; (*typ)->n = 0; OPT_InStruct(&(*typ)->BaseTyp); break; case 37: - (*typ)->form = 15; + (*typ)->form = 13; (*typ)->comp = 2; OPT_InStruct(&(*typ)->BaseTyp); (*typ)->n = OPM_SymRInt(); (*OPT_typSize)(*typ); break; case 38: - (*typ)->form = 15; + (*typ)->form = 13; (*typ)->comp = 3; OPT_InStruct(&(*typ)->BaseTyp); if ((*typ)->BaseTyp->comp == 3) { @@ -1079,7 +1079,7 @@ static void OPT_InStruct (OPT_Struct *typ) (*OPT_typSize)(*typ); break; case 39: - (*typ)->form = 15; + (*typ)->form = 13; (*typ)->comp = 4; OPT_InStruct(&(*typ)->BaseTyp); if ((*typ)->BaseTyp == OPT_notyp) { @@ -1113,7 +1113,7 @@ static void OPT_InStruct (OPT_Struct *typ) } break; case 40: - (*typ)->form = 14; + (*typ)->form = 12; (*typ)->size = OPM_ProcSize; OPT_InSign(mno, &(*typ)->BaseTyp, &(*typ)->link); break; @@ -1192,7 +1192,7 @@ static OPT_Object OPT_InObj (SHORTINT mno) obj = OPT_NewObj(); obj->mnolev = -mno; obj->vis = 1; - if (tag <= 13) { + if (tag <= 11) { obj->mode = 3; obj->conval = OPT_NewConst(); OPT_InConstant(tag, obj->conval); @@ -1289,7 +1289,7 @@ void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) obj->scope = OPT_syslink; obj->typ = OPT_notyp; } else { - OPT_impCtxt.nofr = 16; + OPT_impCtxt.nofr = 14; OPT_impCtxt.minr = 255; OPT_impCtxt.nofm = 0; OPT_impCtxt.self = __STRCMP(aliasName, "@self") == 0; @@ -1356,7 +1356,7 @@ static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, LONGINT adr) n = btyp->n * n; btyp = btyp->BaseTyp; } - if (btyp->form == 13 || btyp->comp == 4) { + if (btyp->form == 11 || btyp->comp == 4) { j = OPT_nofhdfld; OPT_OutHdFld(btyp, fld, adr); if (j != OPT_nofhdfld) { @@ -1368,7 +1368,7 @@ static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, LONGINT adr) } } } - } else if (typ->form == 13 || __STRCMP(fld->name, "@ptr") == 0) { + } else if (typ->form == 11 || __STRCMP(fld->name, "@ptr") == 0) { OPM_SymWInt(27); OPM_SymWInt(adr); OPT_nofhdfld += 1; @@ -1440,7 +1440,7 @@ static void OPT_OutStr (OPT_Struct typ) OPT_Object strobj = NIL; if (typ->ref < OPT_expCtxt.ref) { OPM_SymWInt(-typ->ref); - if (typ->ref == 5) { + if (typ->ref == 4) { OPM_SymWInt(typ->size); } } else { @@ -1475,15 +1475,15 @@ static void OPT_OutStr (OPT_Struct typ) OPM_SymWInt(typ->sysflag); } switch (typ->form) { - case 13: + case 11: OPM_SymWInt(36); OPT_OutStr(typ->BaseTyp); break; - case 14: + case 12: OPM_SymWInt(40); OPT_OutSign(typ->BaseTyp, typ->link); break; - case 15: + case 13: switch (typ->comp) { case 2: OPM_SymWInt(37); @@ -1538,24 +1538,24 @@ static void OPT_OutConstant (OPT_Object obj) case 2: case 3: OPM_SymWCh((CHAR)obj->conval->intval); break; - case 5: + case 4: OPM_SymWInt(obj->conval->intval); OPM_SymWInt(obj->typ->size); break; - case 9: + case 7: OPM_SymWSet(obj->conval->setval); break; - case 7: + case 5: rval = obj->conval->realval; OPM_SymWReal(rval); break; - case 8: + case 6: OPM_SymWLReal(obj->conval->realval); break; - case 10: + case 8: OPT_OutName((void*)*obj->conval->ext, 256); break; - case 11: + case 9: break; default: OPT_err(127); @@ -1669,7 +1669,7 @@ void OPT_Export (BOOLEAN *ext, BOOLEAN *new) OPM_SymWInt(16); OPT_OutName((void*)OPT_SelfName, 256); OPT_expCtxt.reffp = 0; - OPT_expCtxt.ref = 16; + OPT_expCtxt.ref = 14; OPT_expCtxt.nofm = 1; OPT_expCtxt.locmno[0] = 0; i = 1; @@ -1845,16 +1845,16 @@ export void *OPT__init(void) OPM_errpos = 0; OPT_InitStruct(&OPT_undftyp, 0); OPT_undftyp->BaseTyp = OPT_undftyp; - OPT_InitStruct(&OPT_notyp, 12); - OPT_InitStruct(&OPT_stringtyp, 10); - OPT_InitStruct(&OPT_niltyp, 11); + OPT_InitStruct(&OPT_notyp, 10); + OPT_InitStruct(&OPT_stringtyp, 8); + OPT_InitStruct(&OPT_niltyp, 9); OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp); - OPT_EnterTyp((CHAR*)"PTR", 13, OPM_PointerSize, &OPT_sysptrtyp); - OPT_EnterTyp((CHAR*)"ADRINT", 5, OPM_PointerSize, &OPT_ainttyp); - OPT_EnterTyp((CHAR*)"INT8", 5, 1, &OPT_int8typ); - OPT_EnterTyp((CHAR*)"INT16", 5, 2, &OPT_int16typ); - OPT_EnterTyp((CHAR*)"INT32", 5, 4, &OPT_int32typ); - OPT_EnterTyp((CHAR*)"INT64", 5, 8, &OPT_int64typ); + OPT_EnterTyp((CHAR*)"PTR", 11, OPM_PointerSize, &OPT_sysptrtyp); + OPT_EnterTyp((CHAR*)"ADRINT", 4, OPM_PointerSize, &OPT_ainttyp); + OPT_EnterTyp((CHAR*)"INT8", 4, 1, &OPT_int8typ); + OPT_EnterTyp((CHAR*)"INT16", 4, 2, &OPT_int16typ); + OPT_EnterTyp((CHAR*)"INT32", 4, 4, &OPT_int32typ); + OPT_EnterTyp((CHAR*)"INT64", 4, 8, &OPT_int64typ); OPT_EnterProc((CHAR*)"ADR", 20); OPT_EnterProc((CHAR*)"CC", 21); OPT_EnterProc((CHAR*)"LSH", 22); @@ -1872,12 +1872,12 @@ export void *OPT__init(void) OPT_topScope->right = NIL; OPT_EnterTyp((CHAR*)"BOOLEAN", 2, OPM_BoolSize, &OPT_booltyp); OPT_EnterTyp((CHAR*)"CHAR", 3, OPM_CharSize, &OPT_chartyp); - OPT_EnterTyp((CHAR*)"SET", 9, OPM_SetSize, &OPT_settyp); - OPT_EnterTyp((CHAR*)"REAL", 7, OPM_RealSize, &OPT_realtyp); - OPT_EnterTyp((CHAR*)"INTEGER", 5, OPM_IntSize, &OPT_inttyp); - OPT_EnterTyp((CHAR*)"LONGINT", 5, OPM_LIntSize, &OPT_linttyp); - OPT_EnterTyp((CHAR*)"LONGREAL", 8, OPM_LRealSize, &OPT_lrltyp); - OPT_EnterTyp((CHAR*)"SHORTINT", 5, OPM_SIntSize, &OPT_sinttyp); + OPT_EnterTyp((CHAR*)"SET", 7, OPM_SetSize, &OPT_settyp); + OPT_EnterTyp((CHAR*)"REAL", 5, OPM_RealSize, &OPT_realtyp); + OPT_EnterTyp((CHAR*)"INTEGER", 4, OPM_IntSize, &OPT_inttyp); + OPT_EnterTyp((CHAR*)"LONGINT", 4, OPM_LIntSize, &OPT_linttyp); + OPT_EnterTyp((CHAR*)"LONGREAL", 6, OPM_LRealSize, &OPT_lrltyp); + OPT_EnterTyp((CHAR*)"SHORTINT", 4, OPM_SIntSize, &OPT_sinttyp); OPT_EnterBoolConst((CHAR*)"FALSE", 0); OPT_EnterBoolConst((CHAR*)"TRUE", 1); OPT_EnterProc((CHAR*)"HALT", 0); @@ -1905,14 +1905,14 @@ export void *OPT__init(void) OPT_impCtxt.ref[1] = OPT_bytetyp; OPT_impCtxt.ref[2] = OPT_booltyp; OPT_impCtxt.ref[3] = OPT_chartyp; - OPT_impCtxt.ref[5] = OPT_inttyp; - OPT_impCtxt.ref[7] = OPT_realtyp; - OPT_impCtxt.ref[8] = OPT_lrltyp; - OPT_impCtxt.ref[9] = OPT_settyp; - OPT_impCtxt.ref[10] = OPT_stringtyp; - OPT_impCtxt.ref[11] = OPT_niltyp; - OPT_impCtxt.ref[12] = OPT_notyp; - OPT_impCtxt.ref[13] = OPT_sysptrtyp; + OPT_impCtxt.ref[4] = OPT_inttyp; + OPT_impCtxt.ref[5] = OPT_realtyp; + OPT_impCtxt.ref[6] = OPT_lrltyp; + OPT_impCtxt.ref[7] = OPT_settyp; + OPT_impCtxt.ref[8] = OPT_stringtyp; + OPT_impCtxt.ref[9] = OPT_niltyp; + OPT_impCtxt.ref[10] = OPT_notyp; + OPT_impCtxt.ref[11] = OPT_sysptrtyp; OPT_IntTypes[1] = OPT_sinttyp; OPT_IntTypes[2] = OPT_inttyp; OPT_IntTypes[3] = OPT_linttyp; diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index acf2e9e9..c3fdc0cf 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index b5cebda5..c769935e 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPC.h" @@ -123,14 +123,14 @@ void OPV_TypSize (OPT_Struct typ) } else if (c == 2) { OPV_TypSize(typ->BaseTyp); typ->size = typ->n * typ->BaseTyp->size; - } else if (f == 13) { + } else if (f == 11) { typ->size = OPM_PointerSize; if (typ->BaseTyp == OPT_undftyp) { OPM_Mark(128, typ->n); } else { OPV_TypSize(typ->BaseTyp); } - } else if (f == 14) { + } else if (f == 12) { typ->size = OPM_ProcSize; } else if (c == 3) { btyp = typ->BaseTyp; @@ -163,7 +163,7 @@ static void OPV_GetTProcNum (OPT_Object obj) oldPos = OPM_errpos; OPM_errpos = obj->scope->adr; typ = obj->link->typ; - if (typ->form == 13) { + if (typ->form == 11) { typ = typ->BaseTyp; } OPT_FindField(obj->name, typ->BaseTyp, &redef); @@ -237,7 +237,7 @@ static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exporte if ((mode == 5 && (obj->vis != 0) == exported)) { typ = obj->typ; OPV_TypSize(obj->typ); - if (typ->form == 13) { + if (typ->form == 11) { typ = typ->BaseTyp; } if (typ->comp == 4) { @@ -349,7 +349,7 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN case 12: switch (subclass) { case 1: - if (form == 9) { + if (form == 7) { _o_result = 4; return _o_result; } else { @@ -358,7 +358,7 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN } break; case 2: - if (form == 9) { + if (form == 7) { _o_result = 3; return _o_result; } else { @@ -371,7 +371,7 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN return _o_result; break; case 6: - if (form == 9) { + if (form == 7) { _o_result = 2; return _o_result; } else { @@ -380,7 +380,7 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN } break; case 7: - if (form == 9) { + if (form == 7) { _o_result = 4; return _o_result; } else { @@ -464,7 +464,7 @@ static BOOLEAN OPV_SideEffects (OPT_Node n) static void OPV_Entier (OPT_Node n, INTEGER prec) { - if (__IN(n->typ->form, 0x0180)) { + if (__IN(n->typ->form, 0x60)) { OPM_WriteString((CHAR*)"__ENTIER(", 10); OPV_expr(n, -1); OPM_Write(')'); @@ -503,11 +503,11 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec) INTEGER from, to; from = n->typ->form; to = newtype->form; - if (to == 9) { + if (to == 7) { OPM_WriteString((CHAR*)"__SETOF(", 9); OPV_Entier(n, -1); OPM_Write(')'); - } else if (to == 5) { + } else if (to == 4) { if ((newtype->size < n->typ->size && __IN(2, OPM_opt))) { OPM_WriteString((CHAR*)"__SHORT", 8); if (OPV_SideEffects(n)) { @@ -542,7 +542,7 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec) static void OPV_TypeOf (OPT_Node n) { - if (n->typ->form == 13) { + if (n->typ->form == 11) { OPM_WriteString((CHAR*)"__TYPEOF(", 10); OPV_expr(n, -1); OPM_Write(')'); @@ -794,14 +794,14 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) } else if (OPV_ansi) { if ((__IN(comp, 0x0c) && n->class == 7)) { OPM_WriteString((CHAR*)"(CHAR*)", 8); - } else if ((((form == 13 && typ != n->typ)) && n->typ != OPT_niltyp)) { + } else if ((((form == 11 && typ != n->typ)) && n->typ != OPT_niltyp)) { OPM_WriteString((CHAR*)"(void*)", 8); } } else { - if ((__IN(form, 0x0180) && n->typ->form == 5)) { + if ((__IN(form, 0x60) && n->typ->form == 4)) { OPM_WriteString((CHAR*)"(double)", 9); prec = 9; - } else if (form == 5) { + } else if (form == 4) { OPV_SizeCast(n->typ->size, typ->size); } } @@ -812,7 +812,7 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) } if ((((mode == 2 && n->class == 11)) && n->subcl == 29)) { OPV_expr(n->left, prec); - } else if ((form == 5 && n->class == 7)) { + } else if ((form == 4 && n->class == 7)) { OPV_ParIntLiteral(n->conval->intval, n->typ->size); } else { OPV_expr(n, prec); @@ -861,7 +861,7 @@ static OPT_Object OPV_SuperProc (OPT_Node n) OPT_Object obj = NIL; OPT_Struct typ = NIL; typ = n->right->typ; - if (typ->form == 13) { + if (typ->form == 11) { typ = typ->BaseTyp; } OPT_FindField(n->left->obj->name, typ->BaseTyp, &obj); @@ -902,7 +902,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPV_expr(l, exprPrec); break; case 7: - if (form == 9) { + if (form == 7) { OPM_Write('~'); } else { OPM_Write('-'); @@ -930,7 +930,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) break; case 21: if (OPV_SideEffects(l)) { - if (l->typ->form < 7) { + if (l->typ->form < 5) { if (l->typ->size <= 4) { OPM_WriteString((CHAR*)"(int)", 6); } @@ -959,18 +959,18 @@ static void OPV_expr (OPT_Node n, INTEGER prec) if (l->class == 1) { OPC_CompleteIdent(l->obj); } else { - if ((l->typ->form != 10 && !__IN(l->typ->comp, 0x0c))) { + if ((l->typ->form != 8 && !__IN(l->typ->comp, 0x0c))) { OPM_Write('&'); } OPV_expr(l, exprPrec); } break; case 29: - if (!__IN(l->class, 0x17) || (((__IN(n->typ->form, 0x6220) && __IN(l->typ->form, 0x6220))) && n->typ->size == l->typ->size)) { + if (!__IN(l->class, 0x17) || (((__IN(n->typ->form, 0x1890) && __IN(l->typ->form, 0x1890))) && n->typ->size == l->typ->size)) { OPM_Write('('); OPC_Ident(n->typ->strobj); OPM_Write(')'); - if (__IN(n->typ->form, 0x6000) || __IN(l->typ->form, 0x6000)) { + if (__IN(n->typ->form, 0x1800) || __IN(l->typ->form, 0x1800)) { OPM_WriteString((CHAR*)"(SYSTEM_ADRINT)", 16); } OPV_expr(l, exprPrec); @@ -1080,7 +1080,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) break; case 9: case 10: case 11: case 12: case 13: case 14: - if (__IN(l->typ->form, 0x8400)) { + if (__IN(l->typ->form, 0x2100)) { OPM_WriteString((CHAR*)"__STRCMP(", 10); OPV_expr(l, -1); OPM_WriteString((CHAR*)", ", 3); @@ -1092,31 +1092,31 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPV_expr(l, exprPrec); OPC_Cmp(subclass); typ = l->typ; - if ((((((typ->form == 13 && r->typ->form != 11)) && r->typ != typ)) && r->typ != OPT_sysptrtyp)) { + if ((((((typ->form == 11 && r->typ->form != 9)) && r->typ != typ)) && r->typ != OPT_sysptrtyp)) { OPM_WriteString((CHAR*)"(void *) ", 10); } OPV_expr(r, exprPrec); } break; default: - if (subclass == 5 || (form == 9 && (subclass == 1 || subclass == 7))) { + if (subclass == 5 || (form == 7 && (subclass == 1 || subclass == 7))) { OPM_Write('('); } OPV_expr(l, exprPrec); switch (subclass) { case 1: - if (form == 9) { + if (form == 7) { OPM_WriteString((CHAR*)" & ", 4); } else { OPM_WriteString((CHAR*)" * ", 4); } break; case 2: - if (form == 9) { + if (form == 7) { OPM_WriteString((CHAR*)" ^ ", 4); } else { OPM_WriteString((CHAR*)" / ", 4); - if (r->obj == NIL || r->obj->typ->form == 5) { + if (r->obj == NIL || r->obj->typ->form == 4) { OPM_Write('('); OPC_Ident(n->typ->strobj); OPM_Write(')'); @@ -1127,14 +1127,14 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPM_WriteString((CHAR*)" && ", 5); break; case 6: - if (form == 9) { + if (form == 7) { OPM_WriteString((CHAR*)" | ", 4); } else { OPM_WriteString((CHAR*)" + ", 4); } break; case 7: - if (form == 9) { + if (form == 7) { OPM_WriteString((CHAR*)" & ~", 5); } else { OPM_WriteString((CHAR*)" - ", 4); @@ -1150,7 +1150,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) break; } OPV_expr(r, exprPrec); - if (subclass == 5 || (form == 9 && (subclass == 1 || subclass == 7))) { + if (subclass == 5 || (form == 7 && (subclass == 1 || subclass == 7))) { OPM_Write(')'); } break; @@ -1324,7 +1324,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) if ((base->comp == 4 && OPC_NofPtrs(base) != 0)) { OPC_Ident(base->strobj); OPM_WriteString((CHAR*)"__typ", 6); - } else if (base->form == 13) { + } else if (base->form == 11) { OPM_WriteString((CHAR*)"POINTER__typ", 13); } else { OPM_WriteString((CHAR*)"NIL", 4); @@ -1430,11 +1430,11 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) } OPM_Write(')'); } else { - if ((((((l->typ->form == 13 && l->obj != NIL)) && l->obj->adr == 1)) && l->obj->mode == 1)) { + if ((((((l->typ->form == 11 && l->obj != NIL)) && l->obj->adr == 1)) && l->obj->mode == 1)) { l->obj->adr = 0; OPV_design(l, -1); l->obj->adr = 1; - if (r->typ->form != 11) { + if (r->typ->form != 9) { OPM_WriteString((CHAR*)" = (void*)", 11); } else { OPM_WriteString((CHAR*)" = ", 4); @@ -1445,7 +1445,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) } if (l->typ == r->typ) { OPV_expr(r, -1); - } else if ((((l->typ->form == 13 && r->typ->form != 11)) && l->typ->strobj != NIL)) { + } else if ((((l->typ->form == 11 && r->typ->form != 9)) && l->typ->strobj != NIL)) { OPM_Write('('); OPC_Ident(l->typ->strobj); OPM_Write(')'); @@ -1630,7 +1630,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) } else { if (n->left != NIL) { OPM_WriteString((CHAR*)"_o_result = ", 13); - if ((n->left->typ->form == 13 && n->obj->typ != n->left->typ)) { + if ((n->left->typ->form == 11 && n->obj->typ != n->left->typ)) { OPM_WriteString((CHAR*)"(void*)", 8); OPV_expr(n->left, 10); } else { diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index 351ef416..914ff060 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 9801d5f9..84e4aba7 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index ca58fbe8..906f09cb 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 0652d6b4..98719812 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index 9836b502..87c9aa45 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index ad6ecbeb..24999430 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index f836f9f9..9c2bad27 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index 01c67abc..ff526cbc 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Files.h" diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index 699c0323..f36b27cf 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/Vishap.c b/bootstrap/unix-88/Vishap.c index ffe27b0f..65dd2639 100644 --- a/bootstrap/unix-88/Vishap.c +++ b/bootstrap/unix-88/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkamSf */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/unix-88/errors.c b/bootstrap/unix-88/errors.c index 57e3252c..dc5320bb 100644 --- a/bootstrap/unix-88/errors.c +++ b/bootstrap/unix-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/unix-88/errors.h b/bootstrap/unix-88/errors.h index abc550ac..d15a472c 100644 --- a/bootstrap/unix-88/errors.h +++ b/bootstrap/unix-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index 4e7d428f..566e2b5c 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index b5b2af96..161e273a 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/vt100.c b/bootstrap/unix-88/vt100.c index 037caf04..b9fb5373 100644 --- a/bootstrap/unix-88/vt100.c +++ b/bootstrap/unix-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/unix-88/vt100.h b/bootstrap/unix-88/vt100.h index 0b63640a..745ff709 100644 --- a/bootstrap/unix-88/vt100.h +++ b/bootstrap/unix-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index eed3c4f0..fb7df026 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -13,6 +13,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/08/31] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/01] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index 90696149..61b33bc5 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Console.c b/bootstrap/windows-48/Console.c index 01806847..bd7a7d85 100644 --- a/bootstrap/windows-48/Console.c +++ b/bootstrap/windows-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Platform.h" diff --git a/bootstrap/windows-48/Console.h b/bootstrap/windows-48/Console.h index fad0f676..2c01265d 100644 --- a/bootstrap/windows-48/Console.h +++ b/bootstrap/windows-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 08d1739f..459e292f 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index fdaec6b0..3de5b022 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index f35765c6..50d17d87 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tskSfF */ #include "SYSTEM.h" struct Heap__1 { diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index 4d5c5b4e..a4e30a5e 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index 9f39f448..52abc5b8 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Heap.h" diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index 1707868f..6bee52c7 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index e6e966a6..a3322969 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" @@ -317,7 +317,7 @@ void OPB_DeRef (OPT_Node *x) typ = (*x)->typ; if ((*x)->class >= 7) { OPB_err(78); - } else if (typ->form == 13) { + } else if (typ->form == 11) { if (typ == OPT_sysptrtyp) { OPB_err(57); } @@ -340,7 +340,7 @@ void OPB_Index (OPT_Node *x, OPT_Node y) f = y->typ->form; if ((*x)->class >= 7) { OPB_err(79); - } else if (f != 5 || __IN(y->class, 0x0300)) { + } else if (f != 4 || __IN(y->class, 0x0300)) { OPB_err(80); y->typ = OPT_inttyp; } @@ -437,10 +437,10 @@ void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) TypTest__57_s = &_s; if (OPB_NotVar(*x)) { OPB_err(112); - } else if ((*x)->typ->form == 13) { + } else if ((*x)->typ->form == 11) { if (((*x)->typ->BaseTyp->comp != 4 && (*x)->typ != OPT_sysptrtyp)) { OPB_err(85); - } else if (obj->typ->form == 13) { + } else if (obj->typ->form == 11) { GTT__58((*x)->typ->BaseTyp, obj->typ->BaseTyp); } else { OPB_err(86); @@ -465,7 +465,7 @@ void OPB_In (OPT_Node *x, OPT_Node y) f = (*x)->typ->form; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); - } else if ((f == 5 && y->typ->form == 9)) { + } else if ((f == 4 && y->typ->form == 7)) { if ((*x)->class == 7) { k = (*x)->conval->intval; if (k < 0 || k > OPM_MaxSet) { @@ -504,7 +504,7 @@ static LONGINT OPB_log (LONGINT x) static void OPB_CheckRealType (INTEGER f, INTEGER nr, OPT_Const x) { LONGREAL min, max, r; - if (f == 7) { + if (f == 5) { min = OPM_MinReal; max = OPM_MaxReal; } else { @@ -515,7 +515,7 @@ static void OPB_CheckRealType (INTEGER f, INTEGER nr, OPT_Const x) if (r > max || r < min) { OPB_err(nr); x->realval = (LONGREAL)1; - } else if (f == 7) { + } else if (f == 5) { x->realval = x->realval; } x->intval = -1; @@ -567,21 +567,21 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } break; case 6: - if (!__IN(f, 0x01a0)) { + if (!__IN(f, 0x70)) { OPB_err(96); } break; case 7: - if (__IN(f, 0x03a0)) { + if (__IN(f, 0xf0)) { if (z->class == 7) { - if (f == 5) { + if (f == 4) { if (z->conval->intval == (-2147483647-1)) { OPB_err(203); } else { z->conval->intval = -z->conval->intval; OPB_SetIntType(z); } - } else if (__IN(f, 0x0180)) { + } else if (__IN(f, 0x60)) { z->conval->realval = -z->conval->realval; } else { z->conval->setval = ~z->conval->setval; @@ -595,9 +595,9 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } break; case 21: - if (__IN(f, 0x01a0)) { + if (__IN(f, 0x70)) { if (z->class == 7) { - if (f == 5) { + if (f == 4) { if (z->conval->intval == (-2147483647-1)) { OPB_err(203); } else { @@ -629,7 +629,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } break; case 23: - if (f == 5) { + if (f == 4) { if (z->class == 7) { z->conval->intval = OPB_BoolToInt(__ODD(z->conval->intval)); z->obj = NIL; @@ -644,9 +644,9 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) case 24: if ((((z->class == 7 && f == 3)) && z->conval->intval >= 32)) { OPB_CharToString(z); - f = 10; + f = 8; } - if (z->class < 7 || f == 10) { + if (z->class < 7 || f == 8) { z = NewOp__29(op, typ, z); } else { OPB_err(127); @@ -654,7 +654,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->typ = OPT_linttyp; break; case 25: - if ((f == 5 && z->class == 7)) { + if ((f == 4 && z->class == 7)) { if ((0 <= z->conval->intval && z->conval->intval <= -1)) { z = NewOp__29(op, typ, z); } else { @@ -681,7 +681,7 @@ static void OPB_CheckPtr (OPT_Node x, OPT_Node y) INTEGER g; OPT_Struct p = NIL, q = NIL, t = NIL; g = y->typ->form; - if (g == 13) { + if (g == 11) { p = x->typ->BaseTyp; q = y->typ->BaseTyp; if ((p->comp == 4 && q->comp == 4)) { @@ -699,7 +699,7 @@ static void OPB_CheckPtr (OPT_Node x, OPT_Node y) } else { OPB_err(100); } - } else if (g != 11) { + } else if (g != 9) { OPB_err(100); } } @@ -716,7 +716,7 @@ void OPB_CheckParameters (OPT_Object fp, OPT_Object ap, BOOLEAN checkNames) at = at->BaseTyp; } if (ft != at) { - if ((ft->form == 14 && at->form == 14)) { + if ((ft->form == 12 && at->form == 12)) { if (ft->BaseTyp == at->BaseTyp) { OPB_CheckParameters(ft->link, at->link, 0); } else { @@ -777,7 +777,7 @@ static INTEGER ConstCmp__14 (void) case 0: res = 9; break; - case 1: case 3: case 4: case 5: + case 1: case 3: case 4: if ((*ConstOp__13_s->xval)->intval < (*ConstOp__13_s->yval)->intval) { res = 11; } else if ((*ConstOp__13_s->xval)->intval > (*ConstOp__13_s->yval)->intval) { @@ -786,7 +786,7 @@ static INTEGER ConstCmp__14 (void) res = 9; } break; - case 7: case 8: + case 5: case 6: if ((*ConstOp__13_s->xval)->realval < (*ConstOp__13_s->yval)->realval) { res = 11; } else if ((*ConstOp__13_s->xval)->realval > (*ConstOp__13_s->yval)->realval) { @@ -802,14 +802,14 @@ static INTEGER ConstCmp__14 (void) res = 9; } break; - case 9: + case 7: if ((*ConstOp__13_s->xval)->setval != (*ConstOp__13_s->yval)->setval) { res = 10; } else { res = 9; } break; - case 10: + case 8: if (__STRCMP(*(*ConstOp__13_s->xval)->ext, *(*ConstOp__13_s->yval)->ext) < 0) { res = 11; } else if (__STRCMP(*(*ConstOp__13_s->xval)->ext, *(*ConstOp__13_s->yval)->ext) > 0) { @@ -818,7 +818,7 @@ static INTEGER ConstCmp__14 (void) res = 9; } break; - case 11: case 13: case 14: + case 9: case 11: case 12: if ((*ConstOp__13_s->xval)->intval != (*ConstOp__13_s->yval)->intval) { res = 10; } else { @@ -856,7 +856,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) if (f != g) { switch (f) { case 3: - if (g == 10) { + if (g == 8) { OPB_CharToString(x); } else { OPB_err(100); @@ -864,17 +864,17 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) __GUARDEQP(yval, OPT_ConstDesc) = *xval; } break; - case 5: - if (g == 5) { + case 4: + if (g == 4) { if (x->typ->size <= y->typ->size) { x->typ = y->typ; } else { x->typ = OPT_IntType(x->typ->size); } - } else if (g == 7) { + } else if (g == 5) { x->typ = OPT_realtyp; xval->realval = xval->intval; - } else if (g == 8) { + } else if (g == 6) { x->typ = OPT_lrltyp; xval->realval = xval->intval; } else { @@ -883,11 +883,11 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) __GUARDEQP(yval, OPT_ConstDesc) = *xval; } break; - case 7: - if (g == 5) { + case 5: + if (g == 4) { y->typ = x->typ; yval->realval = yval->intval; - } else if (g == 8) { + } else if (g == 6) { x->typ = OPT_lrltyp; } else { OPB_err(100); @@ -895,11 +895,11 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) __GUARDEQP(yval, OPT_ConstDesc) = *xval; } break; - case 8: - if (g == 5) { + case 6: + if (g == 4) { y->typ = x->typ; yval->realval = yval->intval; - } else if (g == 7) { + } else if (g == 5) { y->typ = OPT_lrltyp; } else { OPB_err(100); @@ -907,26 +907,26 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) __GUARDEQP(yval, OPT_ConstDesc) = *xval; } break; - case 10: + case 8: if (g == 3) { OPB_CharToString(y); - g = 10; + g = 8; } else { OPB_err(100); y->typ = x->typ; __GUARDEQP(yval, OPT_ConstDesc) = *xval; } break; - case 11: - if (!__IN(g, 0x6000)) { + case 9: + if (!__IN(g, 0x1800)) { OPB_err(100); } break; - case 13: + case 11: OPB_CheckPtr(x, y); break; - case 14: - if (g != 11) { + case 12: + if (g != 9) { OPB_err(100); } break; @@ -940,7 +940,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } switch (op) { case 1: - if (f == 5) { + if (f == 4) { xv = xval->intval; yv = yval->intval; if (((((xv == 0 || yv == 0) || (((xv > 0 && yv > 0)) && yv <= __DIV(2147483647, xv))) || (((xv > 0 && yv < 0)) && yv >= __DIV((-2147483647-1), xv))) || (((xv < 0 && yv > 0)) && xv >= __DIV((-2147483647-1), yv))) || (((((((xv < 0 && yv < 0)) && xv != (-2147483647-1))) && yv != (-2147483647-1))) && -xv <= __DIV(2147483647, -yv))) { @@ -949,7 +949,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } else { OPB_err(204); } - } else if (__IN(f, 0x0180)) { + } else if (__IN(f, 0x60)) { temp = __ABS(yval->realval) <= (LONGREAL)1; if (temp || __ABS(xval->realval) <= 1.79769296342094e+308 / (LONGREAL)__ABS(yval->realval)) { xval->realval = xval->realval * yval->realval; @@ -957,23 +957,23 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } else { OPB_err(204); } - } else if (f == 9) { + } else if (f == 7) { xval->setval = (xval->setval & yval->setval); } else if (f != 0) { OPB_err(101); } break; case 2: - if (f == 5) { + if (f == 4) { if (yval->intval != 0) { xval->realval = xval->intval / (REAL)yval->intval; - OPB_CheckRealType(7, 205, xval); + OPB_CheckRealType(5, 205, xval); } else { OPB_err(205); xval->realval = (LONGREAL)1; } x->typ = OPT_realtyp; - } else if (__IN(f, 0x0180)) { + } else if (__IN(f, 0x60)) { temp = __ABS(yval->realval) >= (LONGREAL)1; if (temp || __ABS(xval->realval) <= 1.79769296342094e+308 * __ABS(yval->realval)) { xval->realval = xval->realval / yval->realval; @@ -981,14 +981,14 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } else { OPB_err(205); } - } else if (f == 9) { + } else if (f == 7) { xval->setval = xval->setval ^ yval->setval; } else if (f != 0) { OPB_err(102); } break; case 3: - if (f == 5) { + if (f == 4) { if (yval->intval != 0) { xval->intval = __DIV(xval->intval, yval->intval); OPB_SetIntType(x); @@ -1000,7 +1000,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 4: - if (f == 5) { + if (f == 4) { if (yval->intval != 0) { xval->intval = (int)__MOD(xval->intval, yval->intval); OPB_SetIntType(x); @@ -1019,7 +1019,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 6: - if (f == 5) { + if (f == 4) { temp = (yval->intval >= 0 && xval->intval <= 2147483647 - yval->intval); if (temp || (yval->intval < 0 && xval->intval >= (-2147483647-1) - yval->intval)) { xval->intval += yval->intval; @@ -1027,7 +1027,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } else { OPB_err(206); } - } else if (__IN(f, 0x0180)) { + } else if (__IN(f, 0x60)) { temp = (yval->realval >= (LONGREAL)0 && xval->realval <= 1.79769296342094e+308 - yval->realval); if (temp || (yval->realval < (LONGREAL)0 && xval->realval >= -1.79769296342094e+308 - yval->realval)) { xval->realval = xval->realval + yval->realval; @@ -1035,21 +1035,21 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } else { OPB_err(206); } - } else if (f == 9) { + } else if (f == 7) { xval->setval = xval->setval | yval->setval; } else if (f != 0) { OPB_err(105); } break; case 7: - if (f == 5) { + if (f == 4) { if ((yval->intval >= 0 && xval->intval >= (-2147483647-1) + yval->intval) || (yval->intval < 0 && xval->intval <= 2147483647 + yval->intval)) { xval->intval -= yval->intval; OPB_SetIntType(x); } else { OPB_err(207); } - } else if (__IN(f, 0x0180)) { + } else if (__IN(f, 0x60)) { temp = (yval->realval >= (LONGREAL)0 && xval->realval >= -1.79769296342094e+308 + yval->realval); if (temp || (yval->realval < (LONGREAL)0 && xval->realval <= 1.79769296342094e+308 + yval->realval)) { xval->realval = xval->realval - yval->realval; @@ -1057,7 +1057,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } else { OPB_err(207); } - } else if (f == 9) { + } else if (f == 7) { xval->setval = (xval->setval & ~yval->setval); } else if (f != 0) { OPB_err(106); @@ -1077,28 +1077,28 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) xval->intval = OPB_BoolToInt(ConstCmp__14() != 9); break; case 11: - if (__IN(f, 0x2a04)) { + if (__IN(f, 0x0a84)) { OPB_err(108); } else { xval->intval = OPB_BoolToInt(ConstCmp__14() == 11); } break; case 12: - if (__IN(f, 0x2a04)) { + if (__IN(f, 0x0a84)) { OPB_err(108); } else { xval->intval = OPB_BoolToInt(ConstCmp__14() != 13); } break; case 13: - if (__IN(f, 0x2a04)) { + if (__IN(f, 0x0a84)) { OPB_err(108); } else { xval->intval = OPB_BoolToInt(ConstCmp__14() == 13); } break; case 14: - if (__IN(f, 0x2a04)) { + if (__IN(f, 0x0a84)) { OPB_err(108); } else { xval->intval = OPB_BoolToInt(ConstCmp__14() != 11); @@ -1122,8 +1122,8 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) f = (*x)->typ->form; g = typ->form; if ((*x)->class == 7) { - if (f == 5) { - if (g == 5) { + if (f == 4) { + if (g == 4) { if (f > g) { OPB_SetIntType(*x); if ((*x)->typ->size > typ->size) { @@ -1131,7 +1131,7 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) (*x)->conval->intval = 1; } } - } else if (__IN(g, 0x0180)) { + } else if (__IN(g, 0x60)) { (*x)->conval->realval = (*x)->conval->intval; (*x)->conval->intval = -1; } else { @@ -1140,8 +1140,8 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) OPB_err(220); } } - } else if (__IN(f, 0x0180)) { - if (__IN(g, 0x0180)) { + } else if (__IN(f, 0x60)) { + if (__IN(g, 0x60)) { OPB_CheckRealType(g, 203, (*x)->conval); } else { r = (*x)->conval->realval; @@ -1190,25 +1190,25 @@ static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) { BOOLEAN _o_result; BOOLEAN ok, xCharArr, yCharArr; - xCharArr = (__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp->form == 3) || *Op__38_s->f == 10; - yCharArr = (__IN((*y)->typ->comp, 0x0c) && (*y)->typ->BaseTyp->form == 3) || *Op__38_s->g == 10; + xCharArr = (__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp->form == 3) || *Op__38_s->f == 8; + yCharArr = (__IN((*y)->typ->comp, 0x0c) && (*y)->typ->BaseTyp->form == 3) || *Op__38_s->g == 8; if ((((xCharArr && *Op__38_s->g == 3)) && (*y)->class == 7)) { OPB_CharToString(*y); - *Op__38_s->g = 10; + *Op__38_s->g = 8; yCharArr = 1; } if ((((yCharArr && *Op__38_s->f == 3)) && (*x)->class == 7)) { OPB_CharToString(*x); - *Op__38_s->f = 10; + *Op__38_s->f = 8; xCharArr = 1; } ok = (xCharArr && yCharArr); if (ok) { - if ((*Op__38_s->f == 10 && (*x)->conval->intval2 == 1)) { + if ((*Op__38_s->f == 8 && (*x)->conval->intval2 == 1)) { (*x)->typ = OPT_chartyp; (*x)->conval->intval = 0; OPB_Index(&*y, OPB_NewIntConst(0)); - } else if ((*Op__38_s->g == 10 && (*y)->conval->intval2 == 1)) { + } else if ((*Op__38_s->g == 8 && (*y)->conval->intval2 == 1)) { (*y)->typ = OPT_chartyp; (*y)->conval->intval = 0; OPB_Index(&*x, OPB_NewIntConst(0)); @@ -1247,49 +1247,49 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPB_err(100); } break; + case 4: + if ((g == 4 && y->typ->size < z->typ->size)) { + OPB_Convert(&y, z->typ); + } else if (__IN(g, 0x70)) { + OPB_Convert(&z, y->typ); + } else { + OPB_err(100); + } + break; case 5: - if ((g == 5 && y->typ->size < z->typ->size)) { + if (g == 4) { OPB_Convert(&y, z->typ); - } else if (__IN(g, 0x01a0)) { + } else if (__IN(g, 0x60)) { OPB_Convert(&z, y->typ); } else { OPB_err(100); } break; - case 7: - if (g == 5) { + case 6: + if (__IN(g, 0x70)) { + OPB_Convert(&y, z->typ); + } else if (__IN(g, 0x60)) { OPB_Convert(&y, z->typ); - } else if (__IN(g, 0x0180)) { - OPB_Convert(&z, y->typ); } else { OPB_err(100); } break; - case 8: - if (__IN(g, 0x01a0)) { - OPB_Convert(&y, z->typ); - } else if (__IN(g, 0x0180)) { - OPB_Convert(&y, z->typ); - } else { + case 9: + if (!__IN(g, 0x1800)) { OPB_err(100); } break; case 11: - if (!__IN(g, 0x6000)) { - OPB_err(100); - } - break; - case 13: OPB_CheckPtr(z, y); break; - case 14: - if (g != 11) { + case 12: + if (g != 9) { OPB_err(100); } break; - case 10: + case 8: break; - case 15: + case 13: if (z->typ->comp == 4) { OPB_err(100); } @@ -1305,7 +1305,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) switch (op) { case 1: do_ = 1; - if (f == 5) { + if (f == 4) { if (z->class == 7) { val = z->conval->intval; if (val == 1) { @@ -1336,7 +1336,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) y->obj = NIL; } } - } else if (!__IN(f, 0x0381)) { + } else if (!__IN(f, 0xe1)) { OPB_err(105); typ = OPT_undftyp; } @@ -1345,18 +1345,18 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 2: - if (f == 5) { + if (f == 4) { if ((y->class == 7 && y->conval->intval == 0)) { OPB_err(205); } OPB_Convert(&z, OPT_realtyp); OPB_Convert(&y, OPT_realtyp); typ = OPT_realtyp; - } else if (__IN(f, 0x0180)) { + } else if (__IN(f, 0x60)) { if ((y->class == 7 && y->conval->realval == (LONGREAL)0)) { OPB_err(205); } - } else if ((f != 9 && f != 0)) { + } else if ((f != 7 && f != 0)) { OPB_err(102); typ = OPT_undftyp; } @@ -1364,7 +1364,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) break; case 3: do_ = 1; - if (f == 5) { + if (f == 4) { if (y->class == 7) { val = y->conval->intval; if (val == 0) { @@ -1387,7 +1387,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 4: - if (f == 5) { + if (f == 4) { if (y->class == 7) { if (y->conval->intval == 0) { OPB_err(205); @@ -1419,12 +1419,12 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 6: - if (!__IN(f, 0x03e1)) { + if (!__IN(f, 0xf1)) { OPB_err(105); typ = OPT_undftyp; } do_ = 1; - if (f == 5) { + if (f == 4) { if ((z->class == 7 && z->conval->intval == 0)) { do_ = 0; z = y; @@ -1438,11 +1438,11 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 7: - if (!__IN(f, 0x03e1)) { + if (!__IN(f, 0xf1)) { OPB_err(106); typ = OPT_undftyp; } - if ((f != 5 || y->class != 7) || y->conval->intval != 0) { + if ((f != 4 || y->class != 7) || y->conval->intval != 0) { NewOp__39(op, typ, &z, y); } break; @@ -1462,7 +1462,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 9: case 10: - if (__IN(f, 0x6bff) || strings__41(&z, &y)) { + if (__IN(f, 0x1aff) || strings__41(&z, &y)) { typ = OPT_booltyp; } else { OPB_err(107); @@ -1471,7 +1471,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) NewOp__39(op, typ, &z, y); break; case 11: case 12: case 13: case 14: - if (__IN(f, 0x01f9) || strings__41(&z, &y)) { + if (__IN(f, 0x79) || strings__41(&z, &y)) { typ = OPT_booltyp; } else { OPM_LogWLn(); @@ -1498,7 +1498,7 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y) LONGINT k, l; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); - } else if (((*x)->typ->form == 5 && y->typ->form == 5)) { + } else if (((*x)->typ->form == 4 && y->typ->form == 4)) { if ((*x)->class == 7) { k = (*x)->conval->intval; if (0 > k || k > OPM_MaxSet) { @@ -1533,7 +1533,7 @@ void OPB_SetElem (OPT_Node *x) LONGINT k; if ((*x)->class == 8 || (*x)->class == 9) { OPB_err(126); - } else if ((*x)->typ->form != 5) { + } else if ((*x)->typ->form != 4) { OPB_err(93); } else if ((*x)->class == 7) { k = (*x)->conval->intval; @@ -1576,40 +1576,40 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPM_LogWNum(ynode->typ->size, 0); OPM_LogWLn(); } - if (ynode->class == 8 || (ynode->class == 9 && f != 14)) { + if (ynode->class == 8 || (ynode->class == 9 && f != 12)) { OPB_err(126); } switch (f) { - case 0: case 10: + case 0: case 8: break; case 1: - if (!((__IN(g, 0x2a) && y->size == 1))) { + if (!((__IN(g, 0x1a) && y->size == 1))) { OPB_err(113); } break; - case 2: case 3: case 9: + case 2: case 3: case 7: if (g != f) { OPB_err(113); } break; + case 4: + if (g != 4 || x->size < y->size) { + OPB_err(113); + } + break; case 5: - if (g != 5 || x->size < y->size) { + if (!__IN(g, 0x30)) { OPB_err(113); } break; - case 7: - if (!__IN(g, 0xe0)) { + case 6: + if (!__IN(g, 0x70)) { OPB_err(113); } break; - case 8: - if (!__IN(g, 0x01e0)) { - OPB_err(113); - } - break; - case 13: - if ((x == y || g == 11) || (x == OPT_sysptrtyp && g == 13)) { - } else if (g == 13) { + case 11: + if ((x == y || g == 9) || (x == OPT_sysptrtyp && g == 11)) { + } else if (g == 11) { p = x->BaseTyp; q = y->BaseTyp; if ((p->comp == 4 && q->comp == 4)) { @@ -1626,28 +1626,28 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPB_err(113); } break; - case 14: + case 12: if (ynode->class == 9) { OPB_CheckProc(x, ynode->obj); - } else if (x == y || g == 11) { + } else if (x == y || g == 9) { } else { OPB_err(113); } break; - case 12: case 11: + case 10: case 9: OPB_err(113); break; - case 15: + case 13: x->pvused = 1; if (x->comp == 2) { if ((ynode->class == 7 && g == 3)) { OPB_CharToString(ynode); y = ynode->typ; - g = 10; + g = 8; } if (x == y) { } else if (x->BaseTyp == OPT_chartyp) { - if (g == 10) { + if (g == 8) { if (ynode->conval->intval2 > x->n) { OPB_err(114); } @@ -1686,7 +1686,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPM_LogWLn(); break; } - if ((((((ynode->class == 7 && g < f)) && __IN(g, 0xe0))) && __IN(f, 0x01e0))) { + if ((((((ynode->class == 7 && g < f)) && __IN(g, 0x30))) && __IN(f, 0x70))) { OPB_Convert(&ynode, x); } } @@ -1704,7 +1704,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) f = x->typ->form; switch (fctno) { case 0: - if ((f == 5 && x->class == 7)) { + if ((f == 4 && x->class == 7)) { if ((0 <= x->conval->intval && x->conval->intval <= 255)) { OPB_BindNodes(28, OPT_notyp, &x, x); } else { @@ -1719,7 +1719,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) typ = OPT_notyp; if (OPB_NotVar(x)) { OPB_err(112); - } else if (f == 13) { + } else if (f == 11) { if (x->readonly) { OPB_err(76); } @@ -1757,7 +1757,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 5: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x0180)) { + } else if (__IN(f, 0x60)) { OPB_Convert(&x, OPT_linttyp); } else { OPB_err(111); @@ -1777,17 +1777,17 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) x = OPB_NewIntConst(0); x->typ = OPT_chartyp; break; - case 5: + case 4: x = OPB_NewIntConst(OPM_SignedMinimum(x->typ->size)); break; - case 9: + case 7: x = OPB_NewIntConst(0); x->typ = OPT_inttyp; break; - case 7: + case 5: x = OPB_NewRealConst(OPM_MinReal, OPT_realtyp); break; - case 8: + case 6: x = OPB_NewRealConst(OPM_MinLReal, OPT_lrltyp); break; default: @@ -1808,17 +1808,17 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) x = OPB_NewIntConst(255); x->typ = OPT_chartyp; break; - case 5: + case 4: x = OPB_NewIntConst(OPM_SignedMaximum(x->typ->size)); break; - case 9: + case 7: x = OPB_NewIntConst(OPM_MaxSet); x->typ = OPT_inttyp; break; - case 7: + case 5: x = OPB_NewRealConst(OPM_MaxReal, OPT_realtyp); break; - case 8: + case 6: x = OPB_NewRealConst(OPM_MaxLReal, OPT_lrltyp); break; default: @@ -1832,7 +1832,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 9: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x21)) { + } else if (__IN(f, 0x11)) { OPB_Convert(&x, OPT_chartyp); } else { OPB_err(111); @@ -1842,14 +1842,14 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 10: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 5) { + } else if (f == 4) { typ = OPT_ShorterOrLongerType(x->typ, -1); if (typ == NIL) { OPB_err(111); } else { OPB_Convert(&x, typ); } - } else if (f == 8) { + } else if (f == 6) { OPB_Convert(&x, OPT_realtyp); } else { OPB_err(111); @@ -1858,14 +1858,14 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 11: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 5) { + } else if (f == 4) { typ = OPT_ShorterOrLongerType(x->typ, 1); if (typ == NIL) { OPB_err(111); } else { OPB_Convert(&x, typ); } - } else if (f == 7) { + } else if (f == 5) { OPB_Convert(&x, OPT_lrltyp); } else if (f == 3) { OPB_Convert(&x, OPT_linttyp); @@ -1876,7 +1876,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 13: case 14: if (OPB_NotVar(x)) { OPB_err(112); - } else if (f != 5) { + } else if (f != 4) { OPB_err(111); } else if (x->readonly) { OPB_err(76); @@ -1900,18 +1900,18 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 18: if ((x->class == 7 && f == 3)) { OPB_CharToString(x); - f = 10; + f = 8; } if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (((!__IN(x->typ->comp, 0x0c) || x->typ->BaseTyp->form != 3) && f != 10)) { + } else if (((!__IN(x->typ->comp, 0x0c) || x->typ->BaseTyp->form != 3) && f != 8)) { OPB_err(111); } break; case 19: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 5) { + } else if (f == 4) { if (x->typ->size != OPM_LIntSize) { OPB_Convert(&x, OPT_linttyp); } @@ -1928,7 +1928,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) if (x->class != 8) { OPB_err(110); x = OPB_NewIntConst(1); - } else if (__IN(f, 0x63fe) || __IN(x->typ->comp, 0x14)) { + } else if (__IN(f, 0x18fe) || __IN(x->typ->comp, 0x14)) { (*OPB_typSize)(x->typ); x->typ->pvused = 1; x = OPB_NewIntConst(x->typ->size); @@ -1943,22 +1943,22 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 22: case 23: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (!__IN(f, 0x022a)) { + } else if (!__IN(f, 0x9a)) { OPB_err(111); } break; case 24: case 25: case 28: case 31: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((((x->class == 7 && f == 5)) && x->typ->size < OPT_linttyp->size)) { + } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x2020) && x->typ->size == OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x0810) && x->typ->size == OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } break; case 26: case 27: - if ((f == 5 && x->class == 7)) { + if ((f == 4 && x->class == 7)) { if (x->conval->intval < 0 || x->conval->intval > -1) { OPB_err(220); } @@ -1969,14 +1969,14 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 29: if (x->class != 8) { OPB_err(110); - } else if (__IN(f, 0x1401) || x->typ->comp == 3) { + } else if (__IN(f, 0x0501) || x->typ->comp == 3) { OPB_err(111); } break; case 30: if (OPB_NotVar(x)) { OPB_err(112); - } else if (f == 13) { + } else if (f == 11) { } else { OPB_err(111); } @@ -2036,7 +2036,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) p->typ = OPT_notyp; } else { if (x->typ != p->typ) { - if ((x->class == 7 && f == 5)) { + if ((x->class == 7 && f == 4)) { OPB_Convert(&x, p->typ); } else { OPB_err(111); @@ -2049,7 +2049,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 15: case 16: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 5) { + } else if (f == 4) { if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > OPM_MaxSet))) { OPB_err(202); } @@ -2060,7 +2060,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) p->typ = OPT_notyp; break; case 17: - if (!(f == 5) || x->class != 7) { + if (!(f == 4) || x->class != 7) { OPB_err(69); } else if (x->typ->size == 1) { L = (SYSTEM_INT16)x->conval->intval; @@ -2109,7 +2109,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 19: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 5) { + } else if (f == 4) { if ((p->class == 7 && x->class == 7)) { if (-OPB_maxExp > x->conval->intval || x->conval->intval > OPB_maxExp) { OPB_err(208); @@ -2137,7 +2137,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (p->typ->comp == 3) { - if (f == 5) { + if (f == 4) { if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > OPM_MaxIndex))) { OPB_err(63); } @@ -2153,7 +2153,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 22: case 23: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f != 5) { + } else if (f != 4) { OPB_err(111); } else { if (fctno == 22) { @@ -2167,7 +2167,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 24: case 25: case 26: case 27: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x63ff)) { + } else if (__IN(f, 0x18ff)) { if (fctno == 24 || fctno == 26) { if (OPB_NotVar(x)) { OPB_err(112); @@ -2185,7 +2185,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 28: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 5) { + } else if (f == 4) { p = NewOp__53(12, 26, p, x); } else { OPB_err(111); @@ -2193,7 +2193,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) p->typ = OPT_booltyp; break; case 29: - if (((x->class == 8 || x->class == 9) || __IN(f, 0x1401)) || x->typ->comp == 3) { + if (((x->class == 8 || x->class == 9) || __IN(f, 0x0501)) || x->typ->comp == 3) { OPB_err(126); } if (x->typ->size < p->typ->size) { @@ -2209,7 +2209,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 30: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 5) { + } else if (f == 4) { p = NewOp__53(19, 30, p, x); } else { OPB_err(111); @@ -2219,16 +2219,16 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 31: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((((x->class == 7 && f == 5)) && x->typ->size < OPT_linttyp->size)) { + } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x2020) && x->typ->size == OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x0810) && x->typ->size == OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } p->link = x; break; case 32: - if ((f == 5 && x->class == 7)) { + if ((f == 4 && x->class == 7)) { if ((0 <= x->conval->intval && x->conval->intval <= 255)) { OPB_BindNodes(28, OPT_notyp, &x, x); x->conval = OPT_NewConst(); @@ -2271,7 +2271,7 @@ void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n) OPB_err(126); } else if (p->typ->comp != 3) { OPB_err(64); - } else if (f == 5) { + } else if (f == 4) { if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > OPM_MaxIndex))) { OPB_err(63); } @@ -2287,7 +2287,7 @@ void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n) } else if ((fctno == 31 && n == 2)) { if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 5) { + } else if (f == 4) { node = OPT_NewNode(19); node->subcl = 31; node->right = p; @@ -2375,7 +2375,7 @@ static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpa ftyp = ftyp->BaseTyp; atyp = atyp->BaseTyp; if ((fvarpar && ftyp == OPT_bytetyp)) { - if (!__IN(f, 0x0c) || !((__IN(atyp->form, 0x2e) && atyp->size == 1))) { + if (!__IN(f, 0x0c) || !((__IN(atyp->form, 0x1e) && atyp->size == 1))) { if (__IN(18, OPM_opt)) { OPB_err(-301); } @@ -2384,7 +2384,7 @@ static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpa if (ftyp->comp == 3) { OPB_DynArrParCheck(ftyp, atyp, fvarpar); } else if (ftyp != atyp) { - if ((((!fvarpar && ftyp->form == 13)) && atyp->form == 13)) { + if ((((!fvarpar && ftyp->form == 11)) && atyp->form == 11)) { ftyp = ftyp->BaseTyp; atyp = atyp->BaseTyp; if ((ftyp->comp == 4 && atyp->comp == 4)) { @@ -2408,7 +2408,7 @@ static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpa static void OPB_CheckReceiver (OPT_Node *x, OPT_Object fp) { - if (fp->typ->form == 13) { + if (fp->typ->form == 11) { if ((*x)->class == 3) { *x = (*x)->left; } else { @@ -2425,7 +2425,7 @@ void OPB_PrepCall (OPT_Node *x, OPT_Object *fpar) OPB_CheckReceiver(&(*x)->left, *fpar); *fpar = (*fpar)->link; } - } else if (((((*x)->class != 8 && (*x)->typ != NIL)) && (*x)->typ->form == 14)) { + } else if (((((*x)->class != 8 && (*x)->typ != NIL)) && (*x)->typ->form == 12)) { *fpar = (*x)->typ->link; } else { OPB_err(121); @@ -2457,17 +2457,17 @@ void OPB_Param (OPT_Node ap, OPT_Object fp) if (q == NIL) { OPB_err(111); } - } else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 13)) { - } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x2e) && ap->typ->size == 1)))))) { + } else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 11)) { + } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x1e) && ap->typ->size == 1)))))) { OPB_err(123); - } else if ((fp->typ->form == 13 && ap->class == 5)) { + } else if ((fp->typ->form == 11 && ap->class == 5)) { OPB_err(123); } } else if (fp->typ->comp == 3) { if ((ap->class == 7 && ap->typ->form == 3)) { OPB_CharToString(ap); } - if ((ap->typ->form == 10 && fp->typ->BaseTyp->form == 3)) { + if ((ap->typ->form == 8 && fp->typ->BaseTyp->form == 3)) { } else if (ap->class >= 7) { OPB_err(59); } else { @@ -2575,7 +2575,7 @@ void OPB_Assign (OPT_Node *x, OPT_Node y) OPB_BindNodes(6, (*x)->typ, &z, NIL); *x = z; } - } else if (((((((*x)->typ->comp == 2 && (*x)->typ->BaseTyp == OPT_chartyp)) && y->typ->form == 10)) && y->conval->intval2 == 1)) { + } else if (((((((*x)->typ->comp == 2 && (*x)->typ->BaseTyp == OPT_chartyp)) && y->typ->form == 8)) && y->conval->intval2 == 1)) { y->typ = OPT_chartyp; y->conval->intval = 0; OPB_Index(&*x, OPB_NewIntConst(0)); diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index 385a9146..97c4485c 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 45784a13..9f818a4a 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "OPM.h" @@ -227,12 +227,12 @@ static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause) if (__IN(typ->comp, 0x0c)) { OPC_Stars(typ->BaseTyp, &*openClause); *openClause = typ->comp == 2; - } else if (typ->form == 14) { + } else if (typ->form == 12) { OPM_Write('('); OPM_Write('*'); } else { pointers = 0; - while (((typ->strobj == NIL || typ->strobj->name[0] == 0x00) && typ->form == 13)) { + while (((typ->strobj == NIL || typ->strobj->name[0] == 0x00) && typ->form == 11)) { pointers += 1; typ = typ->BaseTyp; } @@ -277,16 +277,16 @@ static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef) for (;;) { form = typ->form; comp = typ->comp; - if (((typ->strobj != NIL && typ->strobj->name[0] != 0x00) || form == 12) || comp == 4) { + if (((typ->strobj != NIL && typ->strobj->name[0] != 0x00) || form == 10) || comp == 4) { break; - } else if ((form == 13 && typ->BaseTyp->comp != 3)) { + } else if ((form == 11 && typ->BaseTyp->comp != 3)) { openClause = 1; - } else if (form == 14 || __IN(comp, 0x0c)) { + } else if (form == 12 || __IN(comp, 0x0c)) { if (openClause) { OPM_Write(')'); openClause = 0; } - if (form == 14) { + if (form == 12) { if (OPC_ansi) { OPM_Write(')'); OPC_AnsiParamList(typ->link, 0); @@ -331,19 +331,19 @@ static void OPC_DeclareBase (OPT_Object dcl) LONGINT off, n, dummy; typ = dcl->typ; prev = typ; - while ((((((((typ->strobj == NIL || typ->comp == 3) || OPC_Undefined(typ->strobj)) && typ->comp != 4)) && typ->form != 12)) && !((typ->form == 13 && typ->BaseTyp->comp == 3)))) { + while ((((((((typ->strobj == NIL || typ->comp == 3) || OPC_Undefined(typ->strobj)) && typ->comp != 4)) && typ->form != 10)) && !((typ->form == 11 && typ->BaseTyp->comp == 3)))) { prev = typ; typ = typ->BaseTyp; } obj = typ->strobj; - if (typ->form == 12) { + if (typ->form == 10) { OPM_WriteString((CHAR*)"void", 5); } else if ((obj != NIL && !OPC_Undefined(obj))) { OPC_Ident(obj); } else if (typ->comp == 4) { OPM_WriteString((CHAR*)"struct ", 8); OPC_Andent(typ); - if ((prev->form != 13 && (obj != NIL || dcl->name[0] == 0x00))) { + if ((prev->form != 11 && (obj != NIL || dcl->name[0] == 0x00))) { if ((typ->BaseTyp != NIL && typ->BaseTyp->strobj->vis != 0)) { OPM_WriteString((CHAR*)" { /* ", 7); OPC_Ident(typ->BaseTyp->strobj); @@ -357,7 +357,7 @@ static void OPC_DeclareBase (OPT_Object dcl) OPC_FieldList(typ, 1, &off, &n, &dummy); OPC_EndBlk0(); } - } else if ((typ->form == 13 && typ->BaseTyp->comp == 3)) { + } else if ((typ->form == 11 && typ->BaseTyp->comp == 3)) { typ = typ->BaseTyp->BaseTyp; nofdims = 1; while (typ->comp == 3) { @@ -372,7 +372,7 @@ static void OPC_DeclareBase (OPT_Object dcl) OPC_BegStat(); __NEW(obj, OPT_ObjDesc); __NEW(obj->typ, OPT_StrDesc); - obj->typ->form = 15; + obj->typ->form = 13; obj->typ->comp = 2; obj->typ->n = 1; obj->typ->BaseTyp = typ; @@ -393,7 +393,7 @@ LONGINT OPC_NofPtrs (OPT_Struct typ) OPT_Object fld = NIL; OPT_Struct btyp = NIL; LONGINT n; - if ((typ->form == 13 && typ->sysflag == 0)) { + if ((typ->form == 11 && typ->sysflag == 0)) { _o_result = 1; return _o_result; } else if ((typ->comp == 4 && __MASK(typ->sysflag, -256) == 0)) { @@ -435,7 +435,7 @@ static void OPC_PutPtrOffsets (OPT_Struct typ, LONGINT adr, LONGINT *cnt) OPT_Object fld = NIL; OPT_Struct btyp = NIL; LONGINT n, i; - if ((typ->form == 13 && typ->sysflag == 0)) { + if ((typ->form == 11 && typ->sysflag == 0)) { OPM_WriteInt(adr); OPM_WriteString((CHAR*)", ", 3); *cnt += 1; @@ -540,7 +540,7 @@ static void OPC_DeclareParams (OPT_Object par, BOOLEAN macro) if (macro) { OPM_WriteStringVar((void*)par->name, 256); } else { - if ((par->mode == 1 && par->typ->form == 7)) { + if ((par->mode == 1 && par->typ->form == 5)) { OPM_Write('_'); } OPC_Ident(par); @@ -612,7 +612,7 @@ OPT_Object OPC_BaseTProc (OPT_Object obj) OPT_Struct typ = NIL, base = NIL; LONGINT mno; typ = obj->link->typ; - if (typ->form == 13) { + if (typ->form == 11) { typ = typ->BaseTyp; } base = typ->BaseTyp; @@ -635,7 +635,7 @@ static void OPC_DefineTProcMacros (OPT_Object obj, BOOLEAN *empty) OPC_Ident(obj); OPC_DeclareParams(obj->link, 1); OPM_WriteString((CHAR*)" __SEND(", 9); - if (obj->link->typ->form == 13) { + if (obj->link->typ->form == 11) { OPM_WriteString((CHAR*)"__TYPEOF(", 10); OPC_Ident(obj->link); OPM_Write(')'); @@ -673,7 +673,7 @@ static void OPC_DefineType (OPT_Struct str) if (obj == NIL || OPC_Undefined(obj)) { if (obj != NIL) { if (obj->linkadr == 1) { - if (str->form != 13) { + if (str->form != 11) { OPM_Mark(244, str->txtpos); obj->linkadr = 2; } @@ -692,13 +692,13 @@ static void OPC_DefineType (OPT_Struct str) } field = field->link; } - } else if (str->form == 13) { + } else if (str->form == 11) { if (str->BaseTyp->comp != 4) { OPC_DefineType(str->BaseTyp); } } else if (__IN(str->comp, 0x0c)) { OPC_DefineType(str->BaseTyp); - } else if (str->form == 14) { + } else if (str->form == 12) { if (str->BaseTyp != OPT_notyp) { OPC_DefineType(str->BaseTyp); } @@ -889,7 +889,7 @@ LONGINT OPC_BaseAlignment (OPT_Struct typ) { LONGINT _o_result; LONGINT alignment; - if (typ->form == 15) { + if (typ->form == 13) { if (typ->comp == 4) { alignment = __MASK(typ->align, -65536); } else { @@ -1017,7 +1017,7 @@ static void OPC_IdentList (OPT_Object obj, INTEGER vis) OPM_WriteString((CHAR*)"export ", 8); } } - if ((((vis == 2 && obj->mode == 1)) && base->form == 7)) { + if ((((vis == 2 && obj->mode == 1)) && base->form == 5)) { OPM_WriteString((CHAR*)"double", 7); } else { OPC_DeclareBase(obj); @@ -1026,7 +1026,7 @@ static void OPC_IdentList (OPT_Object obj, INTEGER vis) OPM_Write(','); } OPM_Write(' '); - if ((((vis == 2 && obj->mode == 1)) && base->form == 7)) { + if ((((vis == 2 && obj->mode == 1)) && base->form == 5)) { OPM_Write('_'); } OPC_DeclareObj(obj, vis == 3); @@ -1043,7 +1043,7 @@ static void OPC_IdentList (OPT_Object obj, INTEGER vis) OPC_Ident(obj); OPM_WriteString((CHAR*)"__typ", 6); base = NIL; - } else if ((((((OPC_ptrinit && vis == 0)) && obj->mnolev > 0)) && obj->typ->form == 13)) { + } else if ((((((OPC_ptrinit && vis == 0)) && obj->mnolev > 0)) && obj->typ->form == 11)) { OPM_WriteString((CHAR*)" = NIL", 7); } } @@ -1380,7 +1380,7 @@ void OPC_GenEnumPtrs (OPT_Object var) OPC_BegBlk(); } OPC_BegStat(); - if (typ->form == 13) { + if (typ->form == 11) { OPM_WriteString((CHAR*)"P(", 3); OPC_Ident(var); OPM_Write(')'); @@ -1399,7 +1399,7 @@ void OPC_GenEnumPtrs (OPT_Object var) n = n * typ->n; typ = typ->BaseTyp; } - if (typ->form == 13) { + if (typ->form == 11) { OPM_WriteString((CHAR*)"__ENUMP(", 9); OPC_Ident(var); OPC_Str1((CHAR*)", #, P)", 8, n); @@ -1562,7 +1562,7 @@ void OPC_EnterProc (OPT_Object proc) if (!OPC_ansi) { var = proc->link; while (var != NIL) { - if ((var->typ->form == 7 && var->mode == 1)) { + if ((var->typ->form == 5 && var->mode == 1)) { OPC_BegStat(); OPC_Ident(var->typ->strobj); OPM_Write(' '); @@ -1878,7 +1878,7 @@ void OPC_Case (LONGINT caseVal, INTEGER form) case 3: OPC_CharacterLiteral(caseVal); break; - case 5: + case 4: OPM_WriteInt(caseVal); break; default: @@ -1976,16 +1976,16 @@ void OPC_Constant (OPT_Const con, INTEGER form) case 3: OPC_CharacterLiteral(con->intval); break; - case 5: + case 4: OPM_WriteInt(con->intval); break; - case 7: + case 5: OPM_WriteReal(con->realval, 'f'); break; - case 8: + case 6: OPM_WriteReal(con->realval, 0x00); break; - case 9: + case 7: OPM_WriteString((CHAR*)"0x", 3); skipLeading = 1; s = con->setval; @@ -2008,10 +2008,10 @@ void OPC_Constant (OPT_Const con, INTEGER form) OPM_Write('0'); } break; - case 10: + case 8: OPC_StringLiteral(*con->ext, 256, con->intval2 - 1); break; - case 11: + case 9: OPM_WriteString((CHAR*)"NIL", 4); break; default: diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index 4243328e..38f95afe 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 979d9598..f2da0fed 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index f93bcd98..15a980a6 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index b0e235d3..21c21350 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPB.h" #include "OPM.h" @@ -136,7 +136,7 @@ static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_) OPP_err(135); } OPP_ConstExpression(&x); - if (x->typ->form == 5) { + if (x->typ->form == 4) { sf = x->conval->intval; if (sf < 0 || sf > 1) { OPP_err(220); @@ -158,7 +158,7 @@ static void OPP_RecordType (OPT_Struct *typ, OPT_Struct *banned) OPT_Object fld = NIL, first = NIL, last = NIL, base = NIL; OPT_Struct ftyp = NIL; INTEGER sysflag; - *typ = OPT_NewStr(15, 4); + *typ = OPT_NewStr(13, 4); (*typ)->BaseTyp = NIL; OPP_CheckSysFlag(&sysflag, -1); if (OPP_sym == 30) { @@ -253,7 +253,7 @@ static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) INTEGER sysflag; OPP_CheckSysFlag(&sysflag, 0); if (OPP_sym == 25) { - *typ = OPT_NewStr(15, 3); + *typ = OPT_NewStr(13, 3); (*typ)->mno = 0; (*typ)->sysflag = sysflag; OPS_Get(&OPP_sym); @@ -265,10 +265,10 @@ static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) (*typ)->n = 0; } } else { - *typ = OPT_NewStr(15, 2); + *typ = OPT_NewStr(13, 2); (*typ)->sysflag = sysflag; OPP_ConstExpression(&x); - if (x->typ->form == 5) { + if (x->typ->form == 4) { n = x->conval->intval; if (n <= 0 || n > OPM_MaxIndex) { OPP_err(63); @@ -301,7 +301,7 @@ static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) static void OPP_PointerType (OPT_Struct *typ) { OPT_Object id = NIL; - *typ = OPT_NewStr(13, 1); + *typ = OPT_NewStr(11, 1); OPP_CheckSysFlag(&(*typ)->sysflag, 0); OPP_CheckSym(28); if (OPP_sym == 38) { @@ -409,7 +409,7 @@ static void OPP_FormalParameters (OPT_Object *firstPar, OPT_Struct *resTyp) if (OPP_sym == 38) { OPP_qualident(&res); if (res->mode == 5) { - if (res->typ->form < 15) { + if (res->typ->form < 13) { *resTyp = res->typ; } else { OPP_err(54); @@ -459,7 +459,7 @@ static void OPP_TypeDecl (OPT_Struct *typ, OPT_Struct *banned) OPP_PointerType(&*typ); } else if (OPP_sym == 61) { OPS_Get(&OPP_sym); - *typ = OPT_NewStr(14, 1); + *typ = OPT_NewStr(12, 1); OPP_CheckSysFlag(&(*typ)->sysflag, 0); if (OPP_sym == 30) { OPS_Get(&OPP_sym); @@ -488,7 +488,7 @@ static void OPP_TypeDecl (OPT_Struct *typ, OPT_Struct *banned) static void OPP_Type (OPT_Struct *typ, OPT_Struct *banned) { OPP_TypeDecl(&*typ, &*banned); - if (((((*typ)->form == 13 && (*typ)->BaseTyp == OPT_undftyp)) && (*typ)->strobj == NIL)) { + if (((((*typ)->form == 11 && (*typ)->BaseTyp == OPT_undftyp)) && (*typ)->strobj == NIL)) { OPP_err(0); } } @@ -503,7 +503,7 @@ static void OPP_selector (OPT_Node *x) if (OPP_sym == 31) { OPS_Get(&OPP_sym); for (;;) { - if (((*x)->typ != NIL && (*x)->typ->form == 13)) { + if (((*x)->typ != NIL && (*x)->typ->form == 11)) { OPB_DeRef(&*x); } OPP_Expression(&y); @@ -521,7 +521,7 @@ static void OPP_selector (OPT_Node *x) __COPY(OPS_name, name, 256); OPS_Get(&OPP_sym); if ((*x)->typ != NIL) { - if ((*x)->typ->form == 13) { + if ((*x)->typ->form == 11) { OPB_DeRef(&*x); } if ((*x)->typ->comp == 4) { @@ -543,7 +543,7 @@ static void OPP_selector (OPT_Node *x) OPP_err(75); } typ = y->obj->typ; - if (typ->form == 13) { + if (typ->form == 11) { typ = typ->BaseTyp; } OPT_FindField((*x)->obj->name, typ->BaseTyp, &proc); @@ -572,7 +572,7 @@ static void OPP_selector (OPT_Node *x) } else if (OPP_sym == 17) { OPS_Get(&OPP_sym); OPB_DeRef(&*x); - } else if ((((((OPP_sym == 30 && (*x)->class < 7)) && (*x)->typ->form != 14)) && ((*x)->obj == NIL || (*x)->obj->mode != 13))) { + } else if ((((((OPP_sym == 30 && (*x)->class < 7)) && (*x)->typ->form != 12)) && ((*x)->obj == NIL || (*x)->obj->mode != 13))) { OPS_Get(&OPP_sym); if (OPP_sym == 38) { OPP_qualident(&obj); @@ -871,10 +871,10 @@ static void OPP_Receiver (SHORTINT *mode, OPS_Name name, OPT_Struct *typ, OPT_St } else { *typ = obj->typ; *rec = *typ; - if ((*rec)->form == 13) { + if ((*rec)->form == 11) { *rec = (*rec)->BaseTyp; } - if (!((((*mode == 1 && (*typ)->form == 13)) && (*rec)->comp == 4) || (*mode == 2 && (*typ)->comp == 4))) { + if (!((((*mode == 1 && (*typ)->form == 11)) && (*rec)->comp == 4) || (*mode == 2 && (*typ)->comp == 4))) { OPP_err(70); *rec = NIL; } @@ -888,7 +888,7 @@ static void OPP_Receiver (SHORTINT *mode, OPS_Name name, OPT_Struct *typ, OPT_St } OPP_CheckSym(22); if (*rec == NIL) { - *rec = OPT_NewStr(15, 4); + *rec = OPT_NewStr(13, 4); (*rec)->BaseTyp = NIL; } } @@ -896,7 +896,7 @@ static void OPP_Receiver (SHORTINT *mode, OPS_Name name, OPT_Struct *typ, OPT_St static BOOLEAN OPP_Extends (OPT_Struct x, OPT_Struct b) { BOOLEAN _o_result; - if ((b->form == 13 && x->form == 13)) { + if ((b->form == 11 && x->form == 11)) { b = b->BaseTyp; x = x->BaseTyp; } @@ -1173,14 +1173,14 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, O for (;;) { OPP_ConstExpression(&x); f = x->typ->form; - if (__IN(f, 0x28)) { + if (__IN(f, 0x18)) { xval = x->conval->intval; } else { OPP_err(61); xval = 1; } - if (f == 5) { - if (!(LabelTyp->form == 5) || LabelTyp->size < x->typ->size) { + if (f == 4) { + if (!(LabelTyp->form == 4) || LabelTyp->size < x->typ->size) { OPP_err(60); } } else if ((SYSTEM_INT16)LabelTyp->form != f) { @@ -1190,7 +1190,7 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, O OPS_Get(&OPP_sym); OPP_ConstExpression(&y); yval = y->conval->intval; - if (((SYSTEM_INT16)y->typ->form != f && !((f == 5 && y->typ->form == 5)))) { + if (((SYSTEM_INT16)y->typ->form != f && !((f == 4 && y->typ->form == 4)))) { OPP_err(60); } if (yval < xval) { @@ -1253,7 +1253,7 @@ static void CasePart__31 (OPT_Node *x) *StatSeq__30_s->pos = OPM_errpos; if ((*x)->class == 8 || (*x)->class == 9) { OPP_err(126); - } else if (!__IN((*x)->typ->form, 0x38)) { + } else if (!__IN((*x)->typ->form, 0x18)) { OPP_err(125); } OPP_CheckSym(25); @@ -1439,7 +1439,7 @@ static void OPP_StatSeq (OPT_Node *stat) OPS_Get(&OPP_sym); if (OPP_sym == 38) { OPP_qualident(&id); - if (!(id->typ->form == 5)) { + if (!(id->typ->form == 4)) { OPP_err(68); } OPP_CheckSym(34); @@ -1471,7 +1471,7 @@ static void OPP_StatSeq (OPT_Node *stat) SetPos__35(z); OPB_Link(&*stat, &last, z); y = OPB_NewLeaf(t); - } else if (!(y->typ->form == 5) || y->typ->size > x->left->typ->size) { + } else if (!(y->typ->form == 4) || y->typ->size > x->left->typ->size) { OPP_err(113); } OPB_Link(&*stat, &last, x); @@ -1526,7 +1526,7 @@ static void OPP_StatSeq (OPT_Node *stat) if (OPP_sym == 38) { OPP_qualident(&id); y = OPB_NewLeaf(id); - if ((((id != NIL && id->typ->form == 13)) && (id->mode == 2 || !id->leaf))) { + if ((((id != NIL && id->typ->form == 11)) && (id->mode == 2 || !id->leaf))) { OPP_err(245); } OPP_CheckSym(20); diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index 0ddbe4c3..8bed9493 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index 89c8242e..f197a5c6 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index 46e05201..1e99f5e9 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 7398b44a..5b495ad5 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" @@ -173,7 +173,7 @@ OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir) { OPT_Struct _o_result; INTEGER i; - __ASSERT(x->form == 5, 0); + __ASSERT(x->form == 4, 0); __ASSERT(dir == 1 || dir == -1, 0); __ASSERT(x->BaseTyp == OPT_undftyp, 0); i = 0; @@ -284,7 +284,7 @@ void OPT_Close (void) OPT_GlbMod[__X(i, 64)] = NIL; i += 1; } - i = 16; + i = 14; while (i < 255) { OPT_impCtxt.ref[__X(i, 255)] = NIL; OPT_impCtxt.old[__X(i, 255)] = NIL; @@ -483,14 +483,14 @@ void OPT_IdFPrint (OPT_Struct typ) OPT_FPrintName(&idfp, (void*)OPT_GlbMod[__X(typ->mno, 64)]->name, 256); OPT_FPrintName(&idfp, (void*)strobj->name, 256); } - if ((f == 13 || (c == 4 && btyp != NIL)) || c == 3) { + if ((f == 11 || (c == 4 && btyp != NIL)) || c == 3) { OPT_IdFPrint(btyp); OPM_FPrint(&idfp, btyp->idfp); } else if (c == 2) { OPT_IdFPrint(btyp); OPM_FPrint(&idfp, btyp->idfp); OPM_FPrint(&idfp, typ->n); - } else if (f == 14) { + } else if (f == 12) { OPT_FPrintSign(&idfp, btyp, typ->link); } typ->idfp = idfp; @@ -519,7 +519,7 @@ static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr) n = btyp->n * n; btyp = btyp->BaseTyp; } - if (btyp->form == 13 || btyp->comp == 4) { + if (btyp->form == 11 || btyp->comp == 4) { j = OPT_nofhdfld; FPrintHdFld__15(btyp, fld, adr); if (j != OPT_nofhdfld) { @@ -531,8 +531,8 @@ static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr) } } } - } else if (typ->form == 13 || __STRCMP(fld->name, "@ptr") == 0) { - OPM_FPrint(&*FPrintStr__12_s->pvfp, 13); + } else if (typ->form == 11 || __STRCMP(fld->name, "@ptr") == 0) { + OPM_FPrint(&*FPrintStr__12_s->pvfp, 11); OPM_FPrint(&*FPrintStr__12_s->pvfp, adr); OPT_nofhdfld += 1; } @@ -595,7 +595,7 @@ void OPT_FPrintStr (OPT_Struct typ) f = typ->form; c = typ->comp; btyp = typ->BaseTyp; - if (f == 13) { + if (f == 11) { strobj = typ->strobj; bstrobj = btyp->strobj; if (((strobj == NIL || strobj->name[0] == 0x00) || bstrobj == NIL) || bstrobj->name[0] == 0x00) { @@ -603,7 +603,7 @@ void OPT_FPrintStr (OPT_Struct typ) OPM_FPrint(&pbfp, btyp->pbfp); pvfp = pbfp; } - } else if (f == 14) { + } else if (f == 12) { } else if (__IN(c, 0x0c)) { OPT_FPrintStr(btyp); OPM_FPrint(&pbfp, btyp->pvfp); @@ -649,23 +649,23 @@ void OPT_FPrintObj (OPT_Object obj) f = obj->typ->form; OPM_FPrint(&fprint, f); switch (f) { - case 2: case 3: case 5: + case 2: case 3: case 4: OPM_FPrint(&fprint, obj->conval->intval); break; - case 9: + case 7: OPM_FPrintSet(&fprint, obj->conval->setval); break; - case 7: + case 5: rval = obj->conval->realval; OPM_FPrintReal(&fprint, rval); break; - case 8: + case 6: OPM_FPrintLReal(&fprint, obj->conval->realval); break; - case 10: + case 8: OPT_FPrintName(&fprint, (void*)*obj->conval->ext, 256); break; - case 11: + case 9: break; default: OPT_err(127); @@ -850,22 +850,22 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval) OPM_SymRCh(&ch); conval->intval = (SYSTEM_INT16)ch; break; - case 5: + case 4: conval->intval = OPM_SymRInt(); break; - case 9: + case 7: OPM_SymRSet(&conval->setval); break; - case 7: + case 5: OPM_SymRReal(&rval); conval->realval = rval; conval->intval = -1; break; - case 8: + case 6: OPM_SymRLReal(&conval->realval); conval->intval = -1; break; - case 10: + case 8: ext = OPT_NewExt(); conval->ext = ext; i = 0; @@ -877,7 +877,7 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval) conval->intval2 = i; conval->intval = -1; break; - case 11: + case 9: conval->intval = 0; break; default: @@ -979,7 +979,7 @@ static OPT_Object OPT_InTProc (SHORTINT mno) static OPT_Struct OPT_InTyp (LONGINT tag) { OPT_Struct _o_result; - if (tag == 5) { + if (tag == 4) { _o_result = OPT_IntType(OPM_SymRInt()); return _o_result; } else { @@ -1054,20 +1054,20 @@ static void OPT_InStruct (OPT_Struct *typ) } switch (tag) { case 36: - (*typ)->form = 13; + (*typ)->form = 11; (*typ)->size = OPM_PointerSize; (*typ)->n = 0; OPT_InStruct(&(*typ)->BaseTyp); break; case 37: - (*typ)->form = 15; + (*typ)->form = 13; (*typ)->comp = 2; OPT_InStruct(&(*typ)->BaseTyp); (*typ)->n = OPM_SymRInt(); (*OPT_typSize)(*typ); break; case 38: - (*typ)->form = 15; + (*typ)->form = 13; (*typ)->comp = 3; OPT_InStruct(&(*typ)->BaseTyp); if ((*typ)->BaseTyp->comp == 3) { @@ -1078,7 +1078,7 @@ static void OPT_InStruct (OPT_Struct *typ) (*OPT_typSize)(*typ); break; case 39: - (*typ)->form = 15; + (*typ)->form = 13; (*typ)->comp = 4; OPT_InStruct(&(*typ)->BaseTyp); if ((*typ)->BaseTyp == OPT_notyp) { @@ -1112,7 +1112,7 @@ static void OPT_InStruct (OPT_Struct *typ) } break; case 40: - (*typ)->form = 14; + (*typ)->form = 12; (*typ)->size = OPM_ProcSize; OPT_InSign(mno, &(*typ)->BaseTyp, &(*typ)->link); break; @@ -1191,7 +1191,7 @@ static OPT_Object OPT_InObj (SHORTINT mno) obj = OPT_NewObj(); obj->mnolev = -mno; obj->vis = 1; - if (tag <= 13) { + if (tag <= 11) { obj->mode = 3; obj->conval = OPT_NewConst(); OPT_InConstant(tag, obj->conval); @@ -1288,7 +1288,7 @@ void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) obj->scope = OPT_syslink; obj->typ = OPT_notyp; } else { - OPT_impCtxt.nofr = 16; + OPT_impCtxt.nofr = 14; OPT_impCtxt.minr = 255; OPT_impCtxt.nofm = 0; OPT_impCtxt.self = __STRCMP(aliasName, "@self") == 0; @@ -1355,7 +1355,7 @@ static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, LONGINT adr) n = btyp->n * n; btyp = btyp->BaseTyp; } - if (btyp->form == 13 || btyp->comp == 4) { + if (btyp->form == 11 || btyp->comp == 4) { j = OPT_nofhdfld; OPT_OutHdFld(btyp, fld, adr); if (j != OPT_nofhdfld) { @@ -1367,7 +1367,7 @@ static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, LONGINT adr) } } } - } else if (typ->form == 13 || __STRCMP(fld->name, "@ptr") == 0) { + } else if (typ->form == 11 || __STRCMP(fld->name, "@ptr") == 0) { OPM_SymWInt(27); OPM_SymWInt(adr); OPT_nofhdfld += 1; @@ -1439,7 +1439,7 @@ static void OPT_OutStr (OPT_Struct typ) OPT_Object strobj = NIL; if (typ->ref < OPT_expCtxt.ref) { OPM_SymWInt(-typ->ref); - if (typ->ref == 5) { + if (typ->ref == 4) { OPM_SymWInt(typ->size); } } else { @@ -1474,15 +1474,15 @@ static void OPT_OutStr (OPT_Struct typ) OPM_SymWInt(typ->sysflag); } switch (typ->form) { - case 13: + case 11: OPM_SymWInt(36); OPT_OutStr(typ->BaseTyp); break; - case 14: + case 12: OPM_SymWInt(40); OPT_OutSign(typ->BaseTyp, typ->link); break; - case 15: + case 13: switch (typ->comp) { case 2: OPM_SymWInt(37); @@ -1537,24 +1537,24 @@ static void OPT_OutConstant (OPT_Object obj) case 2: case 3: OPM_SymWCh((CHAR)obj->conval->intval); break; - case 5: + case 4: OPM_SymWInt(obj->conval->intval); OPM_SymWInt(obj->typ->size); break; - case 9: + case 7: OPM_SymWSet(obj->conval->setval); break; - case 7: + case 5: rval = obj->conval->realval; OPM_SymWReal(rval); break; - case 8: + case 6: OPM_SymWLReal(obj->conval->realval); break; - case 10: + case 8: OPT_OutName((void*)*obj->conval->ext, 256); break; - case 11: + case 9: break; default: OPT_err(127); @@ -1668,7 +1668,7 @@ void OPT_Export (BOOLEAN *ext, BOOLEAN *new) OPM_SymWInt(16); OPT_OutName((void*)OPT_SelfName, 256); OPT_expCtxt.reffp = 0; - OPT_expCtxt.ref = 16; + OPT_expCtxt.ref = 14; OPT_expCtxt.nofm = 1; OPT_expCtxt.locmno[0] = 0; i = 1; @@ -1844,16 +1844,16 @@ export void *OPT__init(void) OPM_errpos = 0; OPT_InitStruct(&OPT_undftyp, 0); OPT_undftyp->BaseTyp = OPT_undftyp; - OPT_InitStruct(&OPT_notyp, 12); - OPT_InitStruct(&OPT_stringtyp, 10); - OPT_InitStruct(&OPT_niltyp, 11); + OPT_InitStruct(&OPT_notyp, 10); + OPT_InitStruct(&OPT_stringtyp, 8); + OPT_InitStruct(&OPT_niltyp, 9); OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp); - OPT_EnterTyp((CHAR*)"PTR", 13, OPM_PointerSize, &OPT_sysptrtyp); - OPT_EnterTyp((CHAR*)"ADRINT", 5, OPM_PointerSize, &OPT_ainttyp); - OPT_EnterTyp((CHAR*)"INT8", 5, 1, &OPT_int8typ); - OPT_EnterTyp((CHAR*)"INT16", 5, 2, &OPT_int16typ); - OPT_EnterTyp((CHAR*)"INT32", 5, 4, &OPT_int32typ); - OPT_EnterTyp((CHAR*)"INT64", 5, 8, &OPT_int64typ); + OPT_EnterTyp((CHAR*)"PTR", 11, OPM_PointerSize, &OPT_sysptrtyp); + OPT_EnterTyp((CHAR*)"ADRINT", 4, OPM_PointerSize, &OPT_ainttyp); + OPT_EnterTyp((CHAR*)"INT8", 4, 1, &OPT_int8typ); + OPT_EnterTyp((CHAR*)"INT16", 4, 2, &OPT_int16typ); + OPT_EnterTyp((CHAR*)"INT32", 4, 4, &OPT_int32typ); + OPT_EnterTyp((CHAR*)"INT64", 4, 8, &OPT_int64typ); OPT_EnterProc((CHAR*)"ADR", 20); OPT_EnterProc((CHAR*)"CC", 21); OPT_EnterProc((CHAR*)"LSH", 22); @@ -1871,12 +1871,12 @@ export void *OPT__init(void) OPT_topScope->right = NIL; OPT_EnterTyp((CHAR*)"BOOLEAN", 2, OPM_BoolSize, &OPT_booltyp); OPT_EnterTyp((CHAR*)"CHAR", 3, OPM_CharSize, &OPT_chartyp); - OPT_EnterTyp((CHAR*)"SET", 9, OPM_SetSize, &OPT_settyp); - OPT_EnterTyp((CHAR*)"REAL", 7, OPM_RealSize, &OPT_realtyp); - OPT_EnterTyp((CHAR*)"INTEGER", 5, OPM_IntSize, &OPT_inttyp); - OPT_EnterTyp((CHAR*)"LONGINT", 5, OPM_LIntSize, &OPT_linttyp); - OPT_EnterTyp((CHAR*)"LONGREAL", 8, OPM_LRealSize, &OPT_lrltyp); - OPT_EnterTyp((CHAR*)"SHORTINT", 5, OPM_SIntSize, &OPT_sinttyp); + OPT_EnterTyp((CHAR*)"SET", 7, OPM_SetSize, &OPT_settyp); + OPT_EnterTyp((CHAR*)"REAL", 5, OPM_RealSize, &OPT_realtyp); + OPT_EnterTyp((CHAR*)"INTEGER", 4, OPM_IntSize, &OPT_inttyp); + OPT_EnterTyp((CHAR*)"LONGINT", 4, OPM_LIntSize, &OPT_linttyp); + OPT_EnterTyp((CHAR*)"LONGREAL", 6, OPM_LRealSize, &OPT_lrltyp); + OPT_EnterTyp((CHAR*)"SHORTINT", 4, OPM_SIntSize, &OPT_sinttyp); OPT_EnterBoolConst((CHAR*)"FALSE", 0); OPT_EnterBoolConst((CHAR*)"TRUE", 1); OPT_EnterProc((CHAR*)"HALT", 0); @@ -1904,14 +1904,14 @@ export void *OPT__init(void) OPT_impCtxt.ref[1] = OPT_bytetyp; OPT_impCtxt.ref[2] = OPT_booltyp; OPT_impCtxt.ref[3] = OPT_chartyp; - OPT_impCtxt.ref[5] = OPT_inttyp; - OPT_impCtxt.ref[7] = OPT_realtyp; - OPT_impCtxt.ref[8] = OPT_lrltyp; - OPT_impCtxt.ref[9] = OPT_settyp; - OPT_impCtxt.ref[10] = OPT_stringtyp; - OPT_impCtxt.ref[11] = OPT_niltyp; - OPT_impCtxt.ref[12] = OPT_notyp; - OPT_impCtxt.ref[13] = OPT_sysptrtyp; + OPT_impCtxt.ref[4] = OPT_inttyp; + OPT_impCtxt.ref[5] = OPT_realtyp; + OPT_impCtxt.ref[6] = OPT_lrltyp; + OPT_impCtxt.ref[7] = OPT_settyp; + OPT_impCtxt.ref[8] = OPT_stringtyp; + OPT_impCtxt.ref[9] = OPT_niltyp; + OPT_impCtxt.ref[10] = OPT_notyp; + OPT_impCtxt.ref[11] = OPT_sysptrtyp; OPT_IntTypes[1] = OPT_sinttyp; OPT_IntTypes[2] = OPT_inttyp; OPT_IntTypes[3] = OPT_linttyp; diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index 3e352ca3..307b94e2 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index 7538f014..df62e985 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPC.h" #include "OPM.h" @@ -122,14 +122,14 @@ void OPV_TypSize (OPT_Struct typ) } else if (c == 2) { OPV_TypSize(typ->BaseTyp); typ->size = typ->n * typ->BaseTyp->size; - } else if (f == 13) { + } else if (f == 11) { typ->size = OPM_PointerSize; if (typ->BaseTyp == OPT_undftyp) { OPM_Mark(128, typ->n); } else { OPV_TypSize(typ->BaseTyp); } - } else if (f == 14) { + } else if (f == 12) { typ->size = OPM_ProcSize; } else if (c == 3) { btyp = typ->BaseTyp; @@ -162,7 +162,7 @@ static void OPV_GetTProcNum (OPT_Object obj) oldPos = OPM_errpos; OPM_errpos = obj->scope->adr; typ = obj->link->typ; - if (typ->form == 13) { + if (typ->form == 11) { typ = typ->BaseTyp; } OPT_FindField(obj->name, typ->BaseTyp, &redef); @@ -236,7 +236,7 @@ static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exporte if ((mode == 5 && (obj->vis != 0) == exported)) { typ = obj->typ; OPV_TypSize(obj->typ); - if (typ->form == 13) { + if (typ->form == 11) { typ = typ->BaseTyp; } if (typ->comp == 4) { @@ -348,7 +348,7 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN case 12: switch (subclass) { case 1: - if (form == 9) { + if (form == 7) { _o_result = 4; return _o_result; } else { @@ -357,7 +357,7 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN } break; case 2: - if (form == 9) { + if (form == 7) { _o_result = 3; return _o_result; } else { @@ -370,7 +370,7 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN return _o_result; break; case 6: - if (form == 9) { + if (form == 7) { _o_result = 2; return _o_result; } else { @@ -379,7 +379,7 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN } break; case 7: - if (form == 9) { + if (form == 7) { _o_result = 4; return _o_result; } else { @@ -463,7 +463,7 @@ static BOOLEAN OPV_SideEffects (OPT_Node n) static void OPV_Entier (OPT_Node n, INTEGER prec) { - if (__IN(n->typ->form, 0x0180)) { + if (__IN(n->typ->form, 0x60)) { OPM_WriteString((CHAR*)"__ENTIER(", 10); OPV_expr(n, -1); OPM_Write(')'); @@ -502,11 +502,11 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec) INTEGER from, to; from = n->typ->form; to = newtype->form; - if (to == 9) { + if (to == 7) { OPM_WriteString((CHAR*)"__SETOF(", 9); OPV_Entier(n, -1); OPM_Write(')'); - } else if (to == 5) { + } else if (to == 4) { if ((newtype->size < n->typ->size && __IN(2, OPM_opt))) { OPM_WriteString((CHAR*)"__SHORT", 8); if (OPV_SideEffects(n)) { @@ -541,7 +541,7 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec) static void OPV_TypeOf (OPT_Node n) { - if (n->typ->form == 13) { + if (n->typ->form == 11) { OPM_WriteString((CHAR*)"__TYPEOF(", 10); OPV_expr(n, -1); OPM_Write(')'); @@ -793,14 +793,14 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) } else if (OPV_ansi) { if ((__IN(comp, 0x0c) && n->class == 7)) { OPM_WriteString((CHAR*)"(CHAR*)", 8); - } else if ((((form == 13 && typ != n->typ)) && n->typ != OPT_niltyp)) { + } else if ((((form == 11 && typ != n->typ)) && n->typ != OPT_niltyp)) { OPM_WriteString((CHAR*)"(void*)", 8); } } else { - if ((__IN(form, 0x0180) && n->typ->form == 5)) { + if ((__IN(form, 0x60) && n->typ->form == 4)) { OPM_WriteString((CHAR*)"(double)", 9); prec = 9; - } else if (form == 5) { + } else if (form == 4) { OPV_SizeCast(n->typ->size, typ->size); } } @@ -811,7 +811,7 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) } if ((((mode == 2 && n->class == 11)) && n->subcl == 29)) { OPV_expr(n->left, prec); - } else if ((form == 5 && n->class == 7)) { + } else if ((form == 4 && n->class == 7)) { OPV_ParIntLiteral(n->conval->intval, n->typ->size); } else { OPV_expr(n, prec); @@ -860,7 +860,7 @@ static OPT_Object OPV_SuperProc (OPT_Node n) OPT_Object obj = NIL; OPT_Struct typ = NIL; typ = n->right->typ; - if (typ->form == 13) { + if (typ->form == 11) { typ = typ->BaseTyp; } OPT_FindField(n->left->obj->name, typ->BaseTyp, &obj); @@ -901,7 +901,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPV_expr(l, exprPrec); break; case 7: - if (form == 9) { + if (form == 7) { OPM_Write('~'); } else { OPM_Write('-'); @@ -929,7 +929,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) break; case 21: if (OPV_SideEffects(l)) { - if (l->typ->form < 7) { + if (l->typ->form < 5) { if (l->typ->size <= 4) { OPM_WriteString((CHAR*)"(int)", 6); } @@ -958,18 +958,18 @@ static void OPV_expr (OPT_Node n, INTEGER prec) if (l->class == 1) { OPC_CompleteIdent(l->obj); } else { - if ((l->typ->form != 10 && !__IN(l->typ->comp, 0x0c))) { + if ((l->typ->form != 8 && !__IN(l->typ->comp, 0x0c))) { OPM_Write('&'); } OPV_expr(l, exprPrec); } break; case 29: - if (!__IN(l->class, 0x17) || (((__IN(n->typ->form, 0x6220) && __IN(l->typ->form, 0x6220))) && n->typ->size == l->typ->size)) { + if (!__IN(l->class, 0x17) || (((__IN(n->typ->form, 0x1890) && __IN(l->typ->form, 0x1890))) && n->typ->size == l->typ->size)) { OPM_Write('('); OPC_Ident(n->typ->strobj); OPM_Write(')'); - if (__IN(n->typ->form, 0x6000) || __IN(l->typ->form, 0x6000)) { + if (__IN(n->typ->form, 0x1800) || __IN(l->typ->form, 0x1800)) { OPM_WriteString((CHAR*)"(SYSTEM_ADRINT)", 16); } OPV_expr(l, exprPrec); @@ -1079,7 +1079,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) break; case 9: case 10: case 11: case 12: case 13: case 14: - if (__IN(l->typ->form, 0x8400)) { + if (__IN(l->typ->form, 0x2100)) { OPM_WriteString((CHAR*)"__STRCMP(", 10); OPV_expr(l, -1); OPM_WriteString((CHAR*)", ", 3); @@ -1091,31 +1091,31 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPV_expr(l, exprPrec); OPC_Cmp(subclass); typ = l->typ; - if ((((((typ->form == 13 && r->typ->form != 11)) && r->typ != typ)) && r->typ != OPT_sysptrtyp)) { + if ((((((typ->form == 11 && r->typ->form != 9)) && r->typ != typ)) && r->typ != OPT_sysptrtyp)) { OPM_WriteString((CHAR*)"(void *) ", 10); } OPV_expr(r, exprPrec); } break; default: - if (subclass == 5 || (form == 9 && (subclass == 1 || subclass == 7))) { + if (subclass == 5 || (form == 7 && (subclass == 1 || subclass == 7))) { OPM_Write('('); } OPV_expr(l, exprPrec); switch (subclass) { case 1: - if (form == 9) { + if (form == 7) { OPM_WriteString((CHAR*)" & ", 4); } else { OPM_WriteString((CHAR*)" * ", 4); } break; case 2: - if (form == 9) { + if (form == 7) { OPM_WriteString((CHAR*)" ^ ", 4); } else { OPM_WriteString((CHAR*)" / ", 4); - if (r->obj == NIL || r->obj->typ->form == 5) { + if (r->obj == NIL || r->obj->typ->form == 4) { OPM_Write('('); OPC_Ident(n->typ->strobj); OPM_Write(')'); @@ -1126,14 +1126,14 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPM_WriteString((CHAR*)" && ", 5); break; case 6: - if (form == 9) { + if (form == 7) { OPM_WriteString((CHAR*)" | ", 4); } else { OPM_WriteString((CHAR*)" + ", 4); } break; case 7: - if (form == 9) { + if (form == 7) { OPM_WriteString((CHAR*)" & ~", 5); } else { OPM_WriteString((CHAR*)" - ", 4); @@ -1149,7 +1149,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) break; } OPV_expr(r, exprPrec); - if (subclass == 5 || (form == 9 && (subclass == 1 || subclass == 7))) { + if (subclass == 5 || (form == 7 && (subclass == 1 || subclass == 7))) { OPM_Write(')'); } break; @@ -1323,7 +1323,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) if ((base->comp == 4 && OPC_NofPtrs(base) != 0)) { OPC_Ident(base->strobj); OPM_WriteString((CHAR*)"__typ", 6); - } else if (base->form == 13) { + } else if (base->form == 11) { OPM_WriteString((CHAR*)"POINTER__typ", 13); } else { OPM_WriteString((CHAR*)"NIL", 4); @@ -1429,11 +1429,11 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) } OPM_Write(')'); } else { - if ((((((l->typ->form == 13 && l->obj != NIL)) && l->obj->adr == 1)) && l->obj->mode == 1)) { + if ((((((l->typ->form == 11 && l->obj != NIL)) && l->obj->adr == 1)) && l->obj->mode == 1)) { l->obj->adr = 0; OPV_design(l, -1); l->obj->adr = 1; - if (r->typ->form != 11) { + if (r->typ->form != 9) { OPM_WriteString((CHAR*)" = (void*)", 11); } else { OPM_WriteString((CHAR*)" = ", 4); @@ -1444,7 +1444,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) } if (l->typ == r->typ) { OPV_expr(r, -1); - } else if ((((l->typ->form == 13 && r->typ->form != 11)) && l->typ->strobj != NIL)) { + } else if ((((l->typ->form == 11 && r->typ->form != 9)) && l->typ->strobj != NIL)) { OPM_Write('('); OPC_Ident(l->typ->strobj); OPM_Write(')'); @@ -1629,7 +1629,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) } else { if (n->left != NIL) { OPM_WriteString((CHAR*)"_o_result = ", 13); - if ((n->left->typ->form == 13 && n->obj->typ != n->left->typ)) { + if ((n->left->typ->form == 11 && n->obj->typ != n->left->typ)) { OPM_WriteString((CHAR*)"(void*)", 8); OPV_expr(n->left, 10); } else { diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index 0299d34b..06bc39f1 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 60cb401c..c1158d0f 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index d0a62b87..7deb4830 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index bea1f4aa..28a855aa 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index 6eeb5a87..65543fac 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index f1d4f53d..834c1fb1 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index 43656e74..2edcc736 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index bd5d1115..dddea925 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Files.h" #include "Modules.h" diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index be79016b..5499c3d0 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/Vishap.c b/bootstrap/windows-48/Vishap.c index 7c16c24d..030b94f6 100644 --- a/bootstrap/windows-48/Vishap.c +++ b/bootstrap/windows-48/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkamSf */ #include "SYSTEM.h" #include "Configuration.h" #include "Heap.h" diff --git a/bootstrap/windows-48/errors.c b/bootstrap/windows-48/errors.c index 7a91fc31..3f916fe9 100644 --- a/bootstrap/windows-48/errors.c +++ b/bootstrap/windows-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/windows-48/errors.h b/bootstrap/windows-48/errors.h index 4a787a17..2afac320 100644 --- a/bootstrap/windows-48/errors.h +++ b/bootstrap/windows-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index cfb79ac9..bfab2dc6 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index fb0797f3..ca635519 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/vt100.c b/bootstrap/windows-48/vt100.c index dfe62efa..84707926 100644 --- a/bootstrap/windows-48/vt100.c +++ b/bootstrap/windows-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Strings.h" diff --git a/bootstrap/windows-48/vt100.h b/bootstrap/windows-48/vt100.h index 73d985c9..6266a678 100644 --- a/bootstrap/windows-48/vt100.h +++ b/bootstrap/windows-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index 5a7e6896..f4abd052 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -14,6 +14,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/08/31] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/01] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index b38a0aa6..c756e930 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Console.c b/bootstrap/windows-88/Console.c index af2ecbd7..7269d448 100644 --- a/bootstrap/windows-88/Console.c +++ b/bootstrap/windows-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Platform.h" diff --git a/bootstrap/windows-88/Console.h b/bootstrap/windows-88/Console.h index 22d598fb..8d9e2fb5 100644 --- a/bootstrap/windows-88/Console.h +++ b/bootstrap/windows-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 4d32ed53..5ec9a8a2 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index fa7db0e9..c2853bea 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index a5063871..5822f690 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tskSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index eebee23c..5e7c01fb 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 5929cd57..004f1f8b 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index 03458258..6f5e4cad 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index fef28dff..eacff2d0 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" @@ -318,7 +318,7 @@ void OPB_DeRef (OPT_Node *x) typ = (*x)->typ; if ((*x)->class >= 7) { OPB_err(78); - } else if (typ->form == 13) { + } else if (typ->form == 11) { if (typ == OPT_sysptrtyp) { OPB_err(57); } @@ -341,7 +341,7 @@ void OPB_Index (OPT_Node *x, OPT_Node y) f = y->typ->form; if ((*x)->class >= 7) { OPB_err(79); - } else if (f != 5 || __IN(y->class, 0x0300)) { + } else if (f != 4 || __IN(y->class, 0x0300)) { OPB_err(80); y->typ = OPT_inttyp; } @@ -438,10 +438,10 @@ void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) TypTest__57_s = &_s; if (OPB_NotVar(*x)) { OPB_err(112); - } else if ((*x)->typ->form == 13) { + } else if ((*x)->typ->form == 11) { if (((*x)->typ->BaseTyp->comp != 4 && (*x)->typ != OPT_sysptrtyp)) { OPB_err(85); - } else if (obj->typ->form == 13) { + } else if (obj->typ->form == 11) { GTT__58((*x)->typ->BaseTyp, obj->typ->BaseTyp); } else { OPB_err(86); @@ -466,7 +466,7 @@ void OPB_In (OPT_Node *x, OPT_Node y) f = (*x)->typ->form; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); - } else if ((f == 5 && y->typ->form == 9)) { + } else if ((f == 4 && y->typ->form == 7)) { if ((*x)->class == 7) { k = (*x)->conval->intval; if (k < 0 || k > (SYSTEM_INT64)OPM_MaxSet) { @@ -505,7 +505,7 @@ static LONGINT OPB_log (LONGINT x) static void OPB_CheckRealType (INTEGER f, INTEGER nr, OPT_Const x) { LONGREAL min, max, r; - if (f == 7) { + if (f == 5) { min = OPM_MinReal; max = OPM_MaxReal; } else { @@ -516,7 +516,7 @@ static void OPB_CheckRealType (INTEGER f, INTEGER nr, OPT_Const x) if (r > max || r < min) { OPB_err(nr); x->realval = (LONGREAL)1; - } else if (f == 7) { + } else if (f == 5) { x->realval = x->realval; } x->intval = -1; @@ -568,21 +568,21 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } break; case 6: - if (!__IN(f, 0x01a0)) { + if (!__IN(f, 0x70)) { OPB_err(96); } break; case 7: - if (__IN(f, 0x03a0)) { + if (__IN(f, 0xf0)) { if (z->class == 7) { - if (f == 5) { + if (f == 4) { if (z->conval->intval == (-9223372036854775807-1)) { OPB_err(203); } else { z->conval->intval = -z->conval->intval; OPB_SetIntType(z); } - } else if (__IN(f, 0x0180)) { + } else if (__IN(f, 0x60)) { z->conval->realval = -z->conval->realval; } else { z->conval->setval = ~z->conval->setval; @@ -596,9 +596,9 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } break; case 21: - if (__IN(f, 0x01a0)) { + if (__IN(f, 0x70)) { if (z->class == 7) { - if (f == 5) { + if (f == 4) { if (z->conval->intval == (-9223372036854775807-1)) { OPB_err(203); } else { @@ -630,7 +630,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } break; case 23: - if (f == 5) { + if (f == 4) { if (z->class == 7) { z->conval->intval = OPB_BoolToInt(__ODD(z->conval->intval)); z->obj = NIL; @@ -645,9 +645,9 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) case 24: if ((((z->class == 7 && f == 3)) && z->conval->intval >= 32)) { OPB_CharToString(z); - f = 10; + f = 8; } - if (z->class < 7 || f == 10) { + if (z->class < 7 || f == 8) { z = NewOp__29(op, typ, z); } else { OPB_err(127); @@ -655,7 +655,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->typ = OPT_linttyp; break; case 25: - if ((f == 5 && z->class == 7)) { + if ((f == 4 && z->class == 7)) { if ((0 <= z->conval->intval && z->conval->intval <= -1)) { z = NewOp__29(op, typ, z); } else { @@ -682,7 +682,7 @@ static void OPB_CheckPtr (OPT_Node x, OPT_Node y) INTEGER g; OPT_Struct p = NIL, q = NIL, t = NIL; g = y->typ->form; - if (g == 13) { + if (g == 11) { p = x->typ->BaseTyp; q = y->typ->BaseTyp; if ((p->comp == 4 && q->comp == 4)) { @@ -700,7 +700,7 @@ static void OPB_CheckPtr (OPT_Node x, OPT_Node y) } else { OPB_err(100); } - } else if (g != 11) { + } else if (g != 9) { OPB_err(100); } } @@ -717,7 +717,7 @@ void OPB_CheckParameters (OPT_Object fp, OPT_Object ap, BOOLEAN checkNames) at = at->BaseTyp; } if (ft != at) { - if ((ft->form == 14 && at->form == 14)) { + if ((ft->form == 12 && at->form == 12)) { if (ft->BaseTyp == at->BaseTyp) { OPB_CheckParameters(ft->link, at->link, 0); } else { @@ -778,7 +778,7 @@ static INTEGER ConstCmp__14 (void) case 0: res = 9; break; - case 1: case 3: case 4: case 5: + case 1: case 3: case 4: if ((*ConstOp__13_s->xval)->intval < (*ConstOp__13_s->yval)->intval) { res = 11; } else if ((*ConstOp__13_s->xval)->intval > (*ConstOp__13_s->yval)->intval) { @@ -787,7 +787,7 @@ static INTEGER ConstCmp__14 (void) res = 9; } break; - case 7: case 8: + case 5: case 6: if ((*ConstOp__13_s->xval)->realval < (*ConstOp__13_s->yval)->realval) { res = 11; } else if ((*ConstOp__13_s->xval)->realval > (*ConstOp__13_s->yval)->realval) { @@ -803,14 +803,14 @@ static INTEGER ConstCmp__14 (void) res = 9; } break; - case 9: + case 7: if ((*ConstOp__13_s->xval)->setval != (*ConstOp__13_s->yval)->setval) { res = 10; } else { res = 9; } break; - case 10: + case 8: if (__STRCMP(*(*ConstOp__13_s->xval)->ext, *(*ConstOp__13_s->yval)->ext) < 0) { res = 11; } else if (__STRCMP(*(*ConstOp__13_s->xval)->ext, *(*ConstOp__13_s->yval)->ext) > 0) { @@ -819,7 +819,7 @@ static INTEGER ConstCmp__14 (void) res = 9; } break; - case 11: case 13: case 14: + case 9: case 11: case 12: if ((*ConstOp__13_s->xval)->intval != (*ConstOp__13_s->yval)->intval) { res = 10; } else { @@ -857,7 +857,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) if (f != g) { switch (f) { case 3: - if (g == 10) { + if (g == 8) { OPB_CharToString(x); } else { OPB_err(100); @@ -865,17 +865,17 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) __GUARDEQP(yval, OPT_ConstDesc) = *xval; } break; - case 5: - if (g == 5) { + case 4: + if (g == 4) { if (x->typ->size <= y->typ->size) { x->typ = y->typ; } else { x->typ = OPT_IntType(x->typ->size); } - } else if (g == 7) { + } else if (g == 5) { x->typ = OPT_realtyp; xval->realval = xval->intval; - } else if (g == 8) { + } else if (g == 6) { x->typ = OPT_lrltyp; xval->realval = xval->intval; } else { @@ -884,11 +884,11 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) __GUARDEQP(yval, OPT_ConstDesc) = *xval; } break; - case 7: - if (g == 5) { + case 5: + if (g == 4) { y->typ = x->typ; yval->realval = yval->intval; - } else if (g == 8) { + } else if (g == 6) { x->typ = OPT_lrltyp; } else { OPB_err(100); @@ -896,11 +896,11 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) __GUARDEQP(yval, OPT_ConstDesc) = *xval; } break; - case 8: - if (g == 5) { + case 6: + if (g == 4) { y->typ = x->typ; yval->realval = yval->intval; - } else if (g == 7) { + } else if (g == 5) { y->typ = OPT_lrltyp; } else { OPB_err(100); @@ -908,26 +908,26 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) __GUARDEQP(yval, OPT_ConstDesc) = *xval; } break; - case 10: + case 8: if (g == 3) { OPB_CharToString(y); - g = 10; + g = 8; } else { OPB_err(100); y->typ = x->typ; __GUARDEQP(yval, OPT_ConstDesc) = *xval; } break; - case 11: - if (!__IN(g, 0x6000)) { + case 9: + if (!__IN(g, 0x1800)) { OPB_err(100); } break; - case 13: + case 11: OPB_CheckPtr(x, y); break; - case 14: - if (g != 11) { + case 12: + if (g != 9) { OPB_err(100); } break; @@ -941,7 +941,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } switch (op) { case 1: - if (f == 5) { + if (f == 4) { xv = xval->intval; yv = yval->intval; if (((((xv == 0 || yv == 0) || (((xv > 0 && yv > 0)) && yv <= __DIV(9223372036854775807, xv))) || (((xv > 0 && yv < 0)) && yv >= __DIV((-9223372036854775807-1), xv))) || (((xv < 0 && yv > 0)) && xv >= __DIV((-9223372036854775807-1), yv))) || (((((((xv < 0 && yv < 0)) && xv != (-9223372036854775807-1))) && yv != (-9223372036854775807-1))) && -xv <= __DIV(9223372036854775807, -yv))) { @@ -950,7 +950,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } else { OPB_err(204); } - } else if (__IN(f, 0x0180)) { + } else if (__IN(f, 0x60)) { temp = __ABS(yval->realval) <= (LONGREAL)1; if (temp || __ABS(xval->realval) <= 1.79769296342094e+308 / (LONGREAL)__ABS(yval->realval)) { xval->realval = xval->realval * yval->realval; @@ -958,23 +958,23 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } else { OPB_err(204); } - } else if (f == 9) { + } else if (f == 7) { xval->setval = (xval->setval & yval->setval); } else if (f != 0) { OPB_err(101); } break; case 2: - if (f == 5) { + if (f == 4) { if (yval->intval != 0) { xval->realval = xval->intval / (REAL)yval->intval; - OPB_CheckRealType(7, 205, xval); + OPB_CheckRealType(5, 205, xval); } else { OPB_err(205); xval->realval = (LONGREAL)1; } x->typ = OPT_realtyp; - } else if (__IN(f, 0x0180)) { + } else if (__IN(f, 0x60)) { temp = __ABS(yval->realval) >= (LONGREAL)1; if (temp || __ABS(xval->realval) <= 1.79769296342094e+308 * __ABS(yval->realval)) { xval->realval = xval->realval / yval->realval; @@ -982,14 +982,14 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } else { OPB_err(205); } - } else if (f == 9) { + } else if (f == 7) { xval->setval = xval->setval ^ yval->setval; } else if (f != 0) { OPB_err(102); } break; case 3: - if (f == 5) { + if (f == 4) { if (yval->intval != 0) { xval->intval = __DIV(xval->intval, yval->intval); OPB_SetIntType(x); @@ -1001,7 +1001,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 4: - if (f == 5) { + if (f == 4) { if (yval->intval != 0) { xval->intval = __MOD(xval->intval, yval->intval); OPB_SetIntType(x); @@ -1020,7 +1020,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 6: - if (f == 5) { + if (f == 4) { temp = (yval->intval >= 0 && xval->intval <= 9223372036854775807 - yval->intval); if (temp || (yval->intval < 0 && xval->intval >= (-9223372036854775807-1) - yval->intval)) { xval->intval += yval->intval; @@ -1028,7 +1028,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } else { OPB_err(206); } - } else if (__IN(f, 0x0180)) { + } else if (__IN(f, 0x60)) { temp = (yval->realval >= (LONGREAL)0 && xval->realval <= 1.79769296342094e+308 - yval->realval); if (temp || (yval->realval < (LONGREAL)0 && xval->realval >= -1.79769296342094e+308 - yval->realval)) { xval->realval = xval->realval + yval->realval; @@ -1036,21 +1036,21 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } else { OPB_err(206); } - } else if (f == 9) { + } else if (f == 7) { xval->setval = xval->setval | yval->setval; } else if (f != 0) { OPB_err(105); } break; case 7: - if (f == 5) { + if (f == 4) { if ((yval->intval >= 0 && xval->intval >= (-9223372036854775807-1) + yval->intval) || (yval->intval < 0 && xval->intval <= 9223372036854775807 + yval->intval)) { xval->intval -= yval->intval; OPB_SetIntType(x); } else { OPB_err(207); } - } else if (__IN(f, 0x0180)) { + } else if (__IN(f, 0x60)) { temp = (yval->realval >= (LONGREAL)0 && xval->realval >= -1.79769296342094e+308 + yval->realval); if (temp || (yval->realval < (LONGREAL)0 && xval->realval <= 1.79769296342094e+308 + yval->realval)) { xval->realval = xval->realval - yval->realval; @@ -1058,7 +1058,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } else { OPB_err(207); } - } else if (f == 9) { + } else if (f == 7) { xval->setval = (xval->setval & ~yval->setval); } else if (f != 0) { OPB_err(106); @@ -1078,28 +1078,28 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) xval->intval = OPB_BoolToInt(ConstCmp__14() != 9); break; case 11: - if (__IN(f, 0x2a04)) { + if (__IN(f, 0x0a84)) { OPB_err(108); } else { xval->intval = OPB_BoolToInt(ConstCmp__14() == 11); } break; case 12: - if (__IN(f, 0x2a04)) { + if (__IN(f, 0x0a84)) { OPB_err(108); } else { xval->intval = OPB_BoolToInt(ConstCmp__14() != 13); } break; case 13: - if (__IN(f, 0x2a04)) { + if (__IN(f, 0x0a84)) { OPB_err(108); } else { xval->intval = OPB_BoolToInt(ConstCmp__14() == 13); } break; case 14: - if (__IN(f, 0x2a04)) { + if (__IN(f, 0x0a84)) { OPB_err(108); } else { xval->intval = OPB_BoolToInt(ConstCmp__14() != 11); @@ -1123,8 +1123,8 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) f = (*x)->typ->form; g = typ->form; if ((*x)->class == 7) { - if (f == 5) { - if (g == 5) { + if (f == 4) { + if (g == 4) { if (f > g) { OPB_SetIntType(*x); if ((*x)->typ->size > typ->size) { @@ -1132,7 +1132,7 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) (*x)->conval->intval = 1; } } - } else if (__IN(g, 0x0180)) { + } else if (__IN(g, 0x60)) { (*x)->conval->realval = (*x)->conval->intval; (*x)->conval->intval = -1; } else { @@ -1141,8 +1141,8 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) OPB_err(220); } } - } else if (__IN(f, 0x0180)) { - if (__IN(g, 0x0180)) { + } else if (__IN(f, 0x60)) { + if (__IN(g, 0x60)) { OPB_CheckRealType(g, 203, (*x)->conval); } else { r = (*x)->conval->realval; @@ -1191,25 +1191,25 @@ static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) { BOOLEAN _o_result; BOOLEAN ok, xCharArr, yCharArr; - xCharArr = (__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp->form == 3) || *Op__38_s->f == 10; - yCharArr = (__IN((*y)->typ->comp, 0x0c) && (*y)->typ->BaseTyp->form == 3) || *Op__38_s->g == 10; + xCharArr = (__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp->form == 3) || *Op__38_s->f == 8; + yCharArr = (__IN((*y)->typ->comp, 0x0c) && (*y)->typ->BaseTyp->form == 3) || *Op__38_s->g == 8; if ((((xCharArr && *Op__38_s->g == 3)) && (*y)->class == 7)) { OPB_CharToString(*y); - *Op__38_s->g = 10; + *Op__38_s->g = 8; yCharArr = 1; } if ((((yCharArr && *Op__38_s->f == 3)) && (*x)->class == 7)) { OPB_CharToString(*x); - *Op__38_s->f = 10; + *Op__38_s->f = 8; xCharArr = 1; } ok = (xCharArr && yCharArr); if (ok) { - if ((*Op__38_s->f == 10 && (*x)->conval->intval2 == 1)) { + if ((*Op__38_s->f == 8 && (*x)->conval->intval2 == 1)) { (*x)->typ = OPT_chartyp; (*x)->conval->intval = 0; OPB_Index(&*y, OPB_NewIntConst(0)); - } else if ((*Op__38_s->g == 10 && (*y)->conval->intval2 == 1)) { + } else if ((*Op__38_s->g == 8 && (*y)->conval->intval2 == 1)) { (*y)->typ = OPT_chartyp; (*y)->conval->intval = 0; OPB_Index(&*x, OPB_NewIntConst(0)); @@ -1248,49 +1248,49 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPB_err(100); } break; + case 4: + if ((g == 4 && y->typ->size < z->typ->size)) { + OPB_Convert(&y, z->typ); + } else if (__IN(g, 0x70)) { + OPB_Convert(&z, y->typ); + } else { + OPB_err(100); + } + break; case 5: - if ((g == 5 && y->typ->size < z->typ->size)) { + if (g == 4) { OPB_Convert(&y, z->typ); - } else if (__IN(g, 0x01a0)) { + } else if (__IN(g, 0x60)) { OPB_Convert(&z, y->typ); } else { OPB_err(100); } break; - case 7: - if (g == 5) { + case 6: + if (__IN(g, 0x70)) { + OPB_Convert(&y, z->typ); + } else if (__IN(g, 0x60)) { OPB_Convert(&y, z->typ); - } else if (__IN(g, 0x0180)) { - OPB_Convert(&z, y->typ); } else { OPB_err(100); } break; - case 8: - if (__IN(g, 0x01a0)) { - OPB_Convert(&y, z->typ); - } else if (__IN(g, 0x0180)) { - OPB_Convert(&y, z->typ); - } else { + case 9: + if (!__IN(g, 0x1800)) { OPB_err(100); } break; case 11: - if (!__IN(g, 0x6000)) { - OPB_err(100); - } - break; - case 13: OPB_CheckPtr(z, y); break; - case 14: - if (g != 11) { + case 12: + if (g != 9) { OPB_err(100); } break; - case 10: + case 8: break; - case 15: + case 13: if (z->typ->comp == 4) { OPB_err(100); } @@ -1306,7 +1306,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) switch (op) { case 1: do_ = 1; - if (f == 5) { + if (f == 4) { if (z->class == 7) { val = z->conval->intval; if (val == 1) { @@ -1337,7 +1337,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) y->obj = NIL; } } - } else if (!__IN(f, 0x0381)) { + } else if (!__IN(f, 0xe1)) { OPB_err(105); typ = OPT_undftyp; } @@ -1346,18 +1346,18 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 2: - if (f == 5) { + if (f == 4) { if ((y->class == 7 && y->conval->intval == 0)) { OPB_err(205); } OPB_Convert(&z, OPT_realtyp); OPB_Convert(&y, OPT_realtyp); typ = OPT_realtyp; - } else if (__IN(f, 0x0180)) { + } else if (__IN(f, 0x60)) { if ((y->class == 7 && y->conval->realval == (LONGREAL)0)) { OPB_err(205); } - } else if ((f != 9 && f != 0)) { + } else if ((f != 7 && f != 0)) { OPB_err(102); typ = OPT_undftyp; } @@ -1365,7 +1365,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) break; case 3: do_ = 1; - if (f == 5) { + if (f == 4) { if (y->class == 7) { val = y->conval->intval; if (val == 0) { @@ -1388,7 +1388,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 4: - if (f == 5) { + if (f == 4) { if (y->class == 7) { if (y->conval->intval == 0) { OPB_err(205); @@ -1420,12 +1420,12 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 6: - if (!__IN(f, 0x03e1)) { + if (!__IN(f, 0xf1)) { OPB_err(105); typ = OPT_undftyp; } do_ = 1; - if (f == 5) { + if (f == 4) { if ((z->class == 7 && z->conval->intval == 0)) { do_ = 0; z = y; @@ -1439,11 +1439,11 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 7: - if (!__IN(f, 0x03e1)) { + if (!__IN(f, 0xf1)) { OPB_err(106); typ = OPT_undftyp; } - if ((f != 5 || y->class != 7) || y->conval->intval != 0) { + if ((f != 4 || y->class != 7) || y->conval->intval != 0) { NewOp__39(op, typ, &z, y); } break; @@ -1463,7 +1463,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 9: case 10: - if (__IN(f, 0x6bff) || strings__41(&z, &y)) { + if (__IN(f, 0x1aff) || strings__41(&z, &y)) { typ = OPT_booltyp; } else { OPB_err(107); @@ -1472,7 +1472,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) NewOp__39(op, typ, &z, y); break; case 11: case 12: case 13: case 14: - if (__IN(f, 0x01f9) || strings__41(&z, &y)) { + if (__IN(f, 0x79) || strings__41(&z, &y)) { typ = OPT_booltyp; } else { OPM_LogWLn(); @@ -1499,7 +1499,7 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y) LONGINT k, l; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); - } else if (((*x)->typ->form == 5 && y->typ->form == 5)) { + } else if (((*x)->typ->form == 4 && y->typ->form == 4)) { if ((*x)->class == 7) { k = (*x)->conval->intval; if (0 > k || k > (SYSTEM_INT64)OPM_MaxSet) { @@ -1534,7 +1534,7 @@ void OPB_SetElem (OPT_Node *x) LONGINT k; if ((*x)->class == 8 || (*x)->class == 9) { OPB_err(126); - } else if ((*x)->typ->form != 5) { + } else if ((*x)->typ->form != 4) { OPB_err(93); } else if ((*x)->class == 7) { k = (*x)->conval->intval; @@ -1577,40 +1577,40 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPM_LogWNum(ynode->typ->size, 0); OPM_LogWLn(); } - if (ynode->class == 8 || (ynode->class == 9 && f != 14)) { + if (ynode->class == 8 || (ynode->class == 9 && f != 12)) { OPB_err(126); } switch (f) { - case 0: case 10: + case 0: case 8: break; case 1: - if (!((__IN(g, 0x2a) && y->size == 1))) { + if (!((__IN(g, 0x1a) && y->size == 1))) { OPB_err(113); } break; - case 2: case 3: case 9: + case 2: case 3: case 7: if (g != f) { OPB_err(113); } break; + case 4: + if (g != 4 || x->size < y->size) { + OPB_err(113); + } + break; case 5: - if (g != 5 || x->size < y->size) { + if (!__IN(g, 0x30)) { OPB_err(113); } break; - case 7: - if (!__IN(g, 0xe0)) { + case 6: + if (!__IN(g, 0x70)) { OPB_err(113); } break; - case 8: - if (!__IN(g, 0x01e0)) { - OPB_err(113); - } - break; - case 13: - if ((x == y || g == 11) || (x == OPT_sysptrtyp && g == 13)) { - } else if (g == 13) { + case 11: + if ((x == y || g == 9) || (x == OPT_sysptrtyp && g == 11)) { + } else if (g == 11) { p = x->BaseTyp; q = y->BaseTyp; if ((p->comp == 4 && q->comp == 4)) { @@ -1627,28 +1627,28 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPB_err(113); } break; - case 14: + case 12: if (ynode->class == 9) { OPB_CheckProc(x, ynode->obj); - } else if (x == y || g == 11) { + } else if (x == y || g == 9) { } else { OPB_err(113); } break; - case 12: case 11: + case 10: case 9: OPB_err(113); break; - case 15: + case 13: x->pvused = 1; if (x->comp == 2) { if ((ynode->class == 7 && g == 3)) { OPB_CharToString(ynode); y = ynode->typ; - g = 10; + g = 8; } if (x == y) { } else if (x->BaseTyp == OPT_chartyp) { - if (g == 10) { + if (g == 8) { if (ynode->conval->intval2 > x->n) { OPB_err(114); } @@ -1687,7 +1687,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPM_LogWLn(); break; } - if ((((((ynode->class == 7 && g < f)) && __IN(g, 0xe0))) && __IN(f, 0x01e0))) { + if ((((((ynode->class == 7 && g < f)) && __IN(g, 0x30))) && __IN(f, 0x70))) { OPB_Convert(&ynode, x); } } @@ -1705,7 +1705,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) f = x->typ->form; switch (fctno) { case 0: - if ((f == 5 && x->class == 7)) { + if ((f == 4 && x->class == 7)) { if ((0 <= x->conval->intval && x->conval->intval <= 255)) { OPB_BindNodes(28, OPT_notyp, &x, x); } else { @@ -1720,7 +1720,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) typ = OPT_notyp; if (OPB_NotVar(x)) { OPB_err(112); - } else if (f == 13) { + } else if (f == 11) { if (x->readonly) { OPB_err(76); } @@ -1758,7 +1758,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 5: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x0180)) { + } else if (__IN(f, 0x60)) { OPB_Convert(&x, OPT_linttyp); } else { OPB_err(111); @@ -1778,17 +1778,17 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) x = OPB_NewIntConst(0); x->typ = OPT_chartyp; break; - case 5: + case 4: x = OPB_NewIntConst(OPM_SignedMinimum(x->typ->size)); break; - case 9: + case 7: x = OPB_NewIntConst(0); x->typ = OPT_inttyp; break; - case 7: + case 5: x = OPB_NewRealConst(OPM_MinReal, OPT_realtyp); break; - case 8: + case 6: x = OPB_NewRealConst(OPM_MinLReal, OPT_lrltyp); break; default: @@ -1809,17 +1809,17 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) x = OPB_NewIntConst(255); x->typ = OPT_chartyp; break; - case 5: + case 4: x = OPB_NewIntConst(OPM_SignedMaximum(x->typ->size)); break; - case 9: + case 7: x = OPB_NewIntConst(OPM_MaxSet); x->typ = OPT_inttyp; break; - case 7: + case 5: x = OPB_NewRealConst(OPM_MaxReal, OPT_realtyp); break; - case 8: + case 6: x = OPB_NewRealConst(OPM_MaxLReal, OPT_lrltyp); break; default: @@ -1833,7 +1833,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 9: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x21)) { + } else if (__IN(f, 0x11)) { OPB_Convert(&x, OPT_chartyp); } else { OPB_err(111); @@ -1843,14 +1843,14 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 10: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 5) { + } else if (f == 4) { typ = OPT_ShorterOrLongerType(x->typ, -1); if (typ == NIL) { OPB_err(111); } else { OPB_Convert(&x, typ); } - } else if (f == 8) { + } else if (f == 6) { OPB_Convert(&x, OPT_realtyp); } else { OPB_err(111); @@ -1859,14 +1859,14 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 11: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 5) { + } else if (f == 4) { typ = OPT_ShorterOrLongerType(x->typ, 1); if (typ == NIL) { OPB_err(111); } else { OPB_Convert(&x, typ); } - } else if (f == 7) { + } else if (f == 5) { OPB_Convert(&x, OPT_lrltyp); } else if (f == 3) { OPB_Convert(&x, OPT_linttyp); @@ -1877,7 +1877,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 13: case 14: if (OPB_NotVar(x)) { OPB_err(112); - } else if (f != 5) { + } else if (f != 4) { OPB_err(111); } else if (x->readonly) { OPB_err(76); @@ -1901,18 +1901,18 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 18: if ((x->class == 7 && f == 3)) { OPB_CharToString(x); - f = 10; + f = 8; } if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (((!__IN(x->typ->comp, 0x0c) || x->typ->BaseTyp->form != 3) && f != 10)) { + } else if (((!__IN(x->typ->comp, 0x0c) || x->typ->BaseTyp->form != 3) && f != 8)) { OPB_err(111); } break; case 19: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 5) { + } else if (f == 4) { if (x->typ->size != (SYSTEM_INT64)OPM_LIntSize) { OPB_Convert(&x, OPT_linttyp); } @@ -1929,7 +1929,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) if (x->class != 8) { OPB_err(110); x = OPB_NewIntConst(1); - } else if (__IN(f, 0x63fe) || __IN(x->typ->comp, 0x14)) { + } else if (__IN(f, 0x18fe) || __IN(x->typ->comp, 0x14)) { (*OPB_typSize)(x->typ); x->typ->pvused = 1; x = OPB_NewIntConst(x->typ->size); @@ -1944,22 +1944,22 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 22: case 23: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (!__IN(f, 0x022a)) { + } else if (!__IN(f, 0x9a)) { OPB_err(111); } break; case 24: case 25: case 28: case 31: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((((x->class == 7 && f == 5)) && x->typ->size < OPT_linttyp->size)) { + } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x2020) && x->typ->size == (SYSTEM_INT64)OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x0810) && x->typ->size == (SYSTEM_INT64)OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } break; case 26: case 27: - if ((f == 5 && x->class == 7)) { + if ((f == 4 && x->class == 7)) { if (x->conval->intval < 0 || x->conval->intval > -1) { OPB_err(220); } @@ -1970,14 +1970,14 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 29: if (x->class != 8) { OPB_err(110); - } else if (__IN(f, 0x1401) || x->typ->comp == 3) { + } else if (__IN(f, 0x0501) || x->typ->comp == 3) { OPB_err(111); } break; case 30: if (OPB_NotVar(x)) { OPB_err(112); - } else if (f == 13) { + } else if (f == 11) { } else { OPB_err(111); } @@ -2037,7 +2037,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) p->typ = OPT_notyp; } else { if (x->typ != p->typ) { - if ((x->class == 7 && f == 5)) { + if ((x->class == 7 && f == 4)) { OPB_Convert(&x, p->typ); } else { OPB_err(111); @@ -2050,7 +2050,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 15: case 16: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 5) { + } else if (f == 4) { if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > (SYSTEM_INT64)OPM_MaxSet))) { OPB_err(202); } @@ -2061,7 +2061,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) p->typ = OPT_notyp; break; case 17: - if (!(f == 5) || x->class != 7) { + if (!(f == 4) || x->class != 7) { OPB_err(69); } else if (x->typ->size == 1) { L = (SYSTEM_INT32)x->conval->intval; @@ -2110,7 +2110,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 19: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 5) { + } else if (f == 4) { if ((p->class == 7 && x->class == 7)) { if (-OPB_maxExp > x->conval->intval || x->conval->intval > OPB_maxExp) { OPB_err(208); @@ -2138,7 +2138,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (p->typ->comp == 3) { - if (f == 5) { + if (f == 4) { if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > OPM_MaxIndex))) { OPB_err(63); } @@ -2154,7 +2154,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 22: case 23: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f != 5) { + } else if (f != 4) { OPB_err(111); } else { if (fctno == 22) { @@ -2168,7 +2168,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 24: case 25: case 26: case 27: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x63ff)) { + } else if (__IN(f, 0x18ff)) { if (fctno == 24 || fctno == 26) { if (OPB_NotVar(x)) { OPB_err(112); @@ -2186,7 +2186,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 28: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 5) { + } else if (f == 4) { p = NewOp__53(12, 26, p, x); } else { OPB_err(111); @@ -2194,7 +2194,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) p->typ = OPT_booltyp; break; case 29: - if (((x->class == 8 || x->class == 9) || __IN(f, 0x1401)) || x->typ->comp == 3) { + if (((x->class == 8 || x->class == 9) || __IN(f, 0x0501)) || x->typ->comp == 3) { OPB_err(126); } if (x->typ->size < p->typ->size) { @@ -2210,7 +2210,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 30: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 5) { + } else if (f == 4) { p = NewOp__53(19, 30, p, x); } else { OPB_err(111); @@ -2220,16 +2220,16 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 31: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((((x->class == 7 && f == 5)) && x->typ->size < OPT_linttyp->size)) { + } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x2020) && x->typ->size == (SYSTEM_INT64)OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x0810) && x->typ->size == (SYSTEM_INT64)OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } p->link = x; break; case 32: - if ((f == 5 && x->class == 7)) { + if ((f == 4 && x->class == 7)) { if ((0 <= x->conval->intval && x->conval->intval <= 255)) { OPB_BindNodes(28, OPT_notyp, &x, x); x->conval = OPT_NewConst(); @@ -2272,7 +2272,7 @@ void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n) OPB_err(126); } else if (p->typ->comp != 3) { OPB_err(64); - } else if (f == 5) { + } else if (f == 4) { if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > OPM_MaxIndex))) { OPB_err(63); } @@ -2288,7 +2288,7 @@ void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n) } else if ((fctno == 31 && n == 2)) { if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 5) { + } else if (f == 4) { node = OPT_NewNode(19); node->subcl = 31; node->right = p; @@ -2376,7 +2376,7 @@ static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpa ftyp = ftyp->BaseTyp; atyp = atyp->BaseTyp; if ((fvarpar && ftyp == OPT_bytetyp)) { - if (!__IN(f, 0x0c) || !((__IN(atyp->form, 0x2e) && atyp->size == 1))) { + if (!__IN(f, 0x0c) || !((__IN(atyp->form, 0x1e) && atyp->size == 1))) { if (__IN(18, OPM_opt)) { OPB_err(-301); } @@ -2385,7 +2385,7 @@ static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpa if (ftyp->comp == 3) { OPB_DynArrParCheck(ftyp, atyp, fvarpar); } else if (ftyp != atyp) { - if ((((!fvarpar && ftyp->form == 13)) && atyp->form == 13)) { + if ((((!fvarpar && ftyp->form == 11)) && atyp->form == 11)) { ftyp = ftyp->BaseTyp; atyp = atyp->BaseTyp; if ((ftyp->comp == 4 && atyp->comp == 4)) { @@ -2409,7 +2409,7 @@ static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpa static void OPB_CheckReceiver (OPT_Node *x, OPT_Object fp) { - if (fp->typ->form == 13) { + if (fp->typ->form == 11) { if ((*x)->class == 3) { *x = (*x)->left; } else { @@ -2426,7 +2426,7 @@ void OPB_PrepCall (OPT_Node *x, OPT_Object *fpar) OPB_CheckReceiver(&(*x)->left, *fpar); *fpar = (*fpar)->link; } - } else if (((((*x)->class != 8 && (*x)->typ != NIL)) && (*x)->typ->form == 14)) { + } else if (((((*x)->class != 8 && (*x)->typ != NIL)) && (*x)->typ->form == 12)) { *fpar = (*x)->typ->link; } else { OPB_err(121); @@ -2458,17 +2458,17 @@ void OPB_Param (OPT_Node ap, OPT_Object fp) if (q == NIL) { OPB_err(111); } - } else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 13)) { - } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x2e) && ap->typ->size == 1)))))) { + } else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 11)) { + } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x1e) && ap->typ->size == 1)))))) { OPB_err(123); - } else if ((fp->typ->form == 13 && ap->class == 5)) { + } else if ((fp->typ->form == 11 && ap->class == 5)) { OPB_err(123); } } else if (fp->typ->comp == 3) { if ((ap->class == 7 && ap->typ->form == 3)) { OPB_CharToString(ap); } - if ((ap->typ->form == 10 && fp->typ->BaseTyp->form == 3)) { + if ((ap->typ->form == 8 && fp->typ->BaseTyp->form == 3)) { } else if (ap->class >= 7) { OPB_err(59); } else { @@ -2576,7 +2576,7 @@ void OPB_Assign (OPT_Node *x, OPT_Node y) OPB_BindNodes(6, (*x)->typ, &z, NIL); *x = z; } - } else if (((((((*x)->typ->comp == 2 && (*x)->typ->BaseTyp == OPT_chartyp)) && y->typ->form == 10)) && y->conval->intval2 == 1)) { + } else if (((((((*x)->typ->comp == 2 && (*x)->typ->BaseTyp == OPT_chartyp)) && y->typ->form == 8)) && y->conval->intval2 == 1)) { y->typ = OPT_chartyp; y->conval->intval = 0; OPB_Index(&*x, OPB_NewIntConst(0)); diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index 0b71f987..7b980a10 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index b8a0608e..ad70616c 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -228,12 +228,12 @@ static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause) if (__IN(typ->comp, 0x0c)) { OPC_Stars(typ->BaseTyp, &*openClause); *openClause = typ->comp == 2; - } else if (typ->form == 14) { + } else if (typ->form == 12) { OPM_Write('('); OPM_Write('*'); } else { pointers = 0; - while (((typ->strobj == NIL || typ->strobj->name[0] == 0x00) && typ->form == 13)) { + while (((typ->strobj == NIL || typ->strobj->name[0] == 0x00) && typ->form == 11)) { pointers += 1; typ = typ->BaseTyp; } @@ -278,16 +278,16 @@ static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef) for (;;) { form = typ->form; comp = typ->comp; - if (((typ->strobj != NIL && typ->strobj->name[0] != 0x00) || form == 12) || comp == 4) { + if (((typ->strobj != NIL && typ->strobj->name[0] != 0x00) || form == 10) || comp == 4) { break; - } else if ((form == 13 && typ->BaseTyp->comp != 3)) { + } else if ((form == 11 && typ->BaseTyp->comp != 3)) { openClause = 1; - } else if (form == 14 || __IN(comp, 0x0c)) { + } else if (form == 12 || __IN(comp, 0x0c)) { if (openClause) { OPM_Write(')'); openClause = 0; } - if (form == 14) { + if (form == 12) { if (OPC_ansi) { OPM_Write(')'); OPC_AnsiParamList(typ->link, 0); @@ -332,19 +332,19 @@ static void OPC_DeclareBase (OPT_Object dcl) LONGINT off, n, dummy; typ = dcl->typ; prev = typ; - while ((((((((typ->strobj == NIL || typ->comp == 3) || OPC_Undefined(typ->strobj)) && typ->comp != 4)) && typ->form != 12)) && !((typ->form == 13 && typ->BaseTyp->comp == 3)))) { + while ((((((((typ->strobj == NIL || typ->comp == 3) || OPC_Undefined(typ->strobj)) && typ->comp != 4)) && typ->form != 10)) && !((typ->form == 11 && typ->BaseTyp->comp == 3)))) { prev = typ; typ = typ->BaseTyp; } obj = typ->strobj; - if (typ->form == 12) { + if (typ->form == 10) { OPM_WriteString((CHAR*)"void", 5); } else if ((obj != NIL && !OPC_Undefined(obj))) { OPC_Ident(obj); } else if (typ->comp == 4) { OPM_WriteString((CHAR*)"struct ", 8); OPC_Andent(typ); - if ((prev->form != 13 && (obj != NIL || dcl->name[0] == 0x00))) { + if ((prev->form != 11 && (obj != NIL || dcl->name[0] == 0x00))) { if ((typ->BaseTyp != NIL && typ->BaseTyp->strobj->vis != 0)) { OPM_WriteString((CHAR*)" { /* ", 7); OPC_Ident(typ->BaseTyp->strobj); @@ -358,7 +358,7 @@ static void OPC_DeclareBase (OPT_Object dcl) OPC_FieldList(typ, 1, &off, &n, &dummy); OPC_EndBlk0(); } - } else if ((typ->form == 13 && typ->BaseTyp->comp == 3)) { + } else if ((typ->form == 11 && typ->BaseTyp->comp == 3)) { typ = typ->BaseTyp->BaseTyp; nofdims = 1; while (typ->comp == 3) { @@ -373,7 +373,7 @@ static void OPC_DeclareBase (OPT_Object dcl) OPC_BegStat(); __NEW(obj, OPT_ObjDesc); __NEW(obj->typ, OPT_StrDesc); - obj->typ->form = 15; + obj->typ->form = 13; obj->typ->comp = 2; obj->typ->n = 1; obj->typ->BaseTyp = typ; @@ -394,7 +394,7 @@ LONGINT OPC_NofPtrs (OPT_Struct typ) OPT_Object fld = NIL; OPT_Struct btyp = NIL; LONGINT n; - if ((typ->form == 13 && typ->sysflag == 0)) { + if ((typ->form == 11 && typ->sysflag == 0)) { _o_result = 1; return _o_result; } else if ((typ->comp == 4 && __MASK(typ->sysflag, -256) == 0)) { @@ -436,7 +436,7 @@ static void OPC_PutPtrOffsets (OPT_Struct typ, LONGINT adr, LONGINT *cnt) OPT_Object fld = NIL; OPT_Struct btyp = NIL; LONGINT n, i; - if ((typ->form == 13 && typ->sysflag == 0)) { + if ((typ->form == 11 && typ->sysflag == 0)) { OPM_WriteInt(adr); OPM_WriteString((CHAR*)", ", 3); *cnt += 1; @@ -541,7 +541,7 @@ static void OPC_DeclareParams (OPT_Object par, BOOLEAN macro) if (macro) { OPM_WriteStringVar((void*)par->name, 256); } else { - if ((par->mode == 1 && par->typ->form == 7)) { + if ((par->mode == 1 && par->typ->form == 5)) { OPM_Write('_'); } OPC_Ident(par); @@ -613,7 +613,7 @@ OPT_Object OPC_BaseTProc (OPT_Object obj) OPT_Struct typ = NIL, base = NIL; LONGINT mno; typ = obj->link->typ; - if (typ->form == 13) { + if (typ->form == 11) { typ = typ->BaseTyp; } base = typ->BaseTyp; @@ -636,7 +636,7 @@ static void OPC_DefineTProcMacros (OPT_Object obj, BOOLEAN *empty) OPC_Ident(obj); OPC_DeclareParams(obj->link, 1); OPM_WriteString((CHAR*)" __SEND(", 9); - if (obj->link->typ->form == 13) { + if (obj->link->typ->form == 11) { OPM_WriteString((CHAR*)"__TYPEOF(", 10); OPC_Ident(obj->link); OPM_Write(')'); @@ -674,7 +674,7 @@ static void OPC_DefineType (OPT_Struct str) if (obj == NIL || OPC_Undefined(obj)) { if (obj != NIL) { if (obj->linkadr == 1) { - if (str->form != 13) { + if (str->form != 11) { OPM_Mark(244, str->txtpos); obj->linkadr = 2; } @@ -693,13 +693,13 @@ static void OPC_DefineType (OPT_Struct str) } field = field->link; } - } else if (str->form == 13) { + } else if (str->form == 11) { if (str->BaseTyp->comp != 4) { OPC_DefineType(str->BaseTyp); } } else if (__IN(str->comp, 0x0c)) { OPC_DefineType(str->BaseTyp); - } else if (str->form == 14) { + } else if (str->form == 12) { if (str->BaseTyp != OPT_notyp) { OPC_DefineType(str->BaseTyp); } @@ -890,7 +890,7 @@ LONGINT OPC_BaseAlignment (OPT_Struct typ) { LONGINT _o_result; LONGINT alignment; - if (typ->form == 15) { + if (typ->form == 13) { if (typ->comp == 4) { alignment = __MASK(typ->align, -65536); } else { @@ -1018,7 +1018,7 @@ static void OPC_IdentList (OPT_Object obj, INTEGER vis) OPM_WriteString((CHAR*)"export ", 8); } } - if ((((vis == 2 && obj->mode == 1)) && base->form == 7)) { + if ((((vis == 2 && obj->mode == 1)) && base->form == 5)) { OPM_WriteString((CHAR*)"double", 7); } else { OPC_DeclareBase(obj); @@ -1027,7 +1027,7 @@ static void OPC_IdentList (OPT_Object obj, INTEGER vis) OPM_Write(','); } OPM_Write(' '); - if ((((vis == 2 && obj->mode == 1)) && base->form == 7)) { + if ((((vis == 2 && obj->mode == 1)) && base->form == 5)) { OPM_Write('_'); } OPC_DeclareObj(obj, vis == 3); @@ -1044,7 +1044,7 @@ static void OPC_IdentList (OPT_Object obj, INTEGER vis) OPC_Ident(obj); OPM_WriteString((CHAR*)"__typ", 6); base = NIL; - } else if ((((((OPC_ptrinit && vis == 0)) && obj->mnolev > 0)) && obj->typ->form == 13)) { + } else if ((((((OPC_ptrinit && vis == 0)) && obj->mnolev > 0)) && obj->typ->form == 11)) { OPM_WriteString((CHAR*)" = NIL", 7); } } @@ -1381,7 +1381,7 @@ void OPC_GenEnumPtrs (OPT_Object var) OPC_BegBlk(); } OPC_BegStat(); - if (typ->form == 13) { + if (typ->form == 11) { OPM_WriteString((CHAR*)"P(", 3); OPC_Ident(var); OPM_Write(')'); @@ -1400,7 +1400,7 @@ void OPC_GenEnumPtrs (OPT_Object var) n = n * typ->n; typ = typ->BaseTyp; } - if (typ->form == 13) { + if (typ->form == 11) { OPM_WriteString((CHAR*)"__ENUMP(", 9); OPC_Ident(var); OPC_Str1((CHAR*)", #, P)", 8, n); @@ -1563,7 +1563,7 @@ void OPC_EnterProc (OPT_Object proc) if (!OPC_ansi) { var = proc->link; while (var != NIL) { - if ((var->typ->form == 7 && var->mode == 1)) { + if ((var->typ->form == 5 && var->mode == 1)) { OPC_BegStat(); OPC_Ident(var->typ->strobj); OPM_Write(' '); @@ -1879,7 +1879,7 @@ void OPC_Case (LONGINT caseVal, INTEGER form) case 3: OPC_CharacterLiteral(caseVal); break; - case 5: + case 4: OPM_WriteInt(caseVal); break; default: @@ -1977,16 +1977,16 @@ void OPC_Constant (OPT_Const con, INTEGER form) case 3: OPC_CharacterLiteral(con->intval); break; - case 5: + case 4: OPM_WriteInt(con->intval); break; - case 7: + case 5: OPM_WriteReal(con->realval, 'f'); break; - case 8: + case 6: OPM_WriteReal(con->realval, 0x00); break; - case 9: + case 7: OPM_WriteString((CHAR*)"0x", 3); skipLeading = 1; s = con->setval; @@ -2009,10 +2009,10 @@ void OPC_Constant (OPT_Const con, INTEGER form) OPM_Write('0'); } break; - case 10: + case 8: OPC_StringLiteral(*con->ext, 256, con->intval2 - 1); break; - case 11: + case 9: OPM_WriteString((CHAR*)"NIL", 4); break; default: diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index 21b48db8..bb250e9a 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 450ed83d..228e7978 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index 5363c227..6bbab25d 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index becc2507..9337c539 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPB.h" @@ -137,7 +137,7 @@ static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_) OPP_err(135); } OPP_ConstExpression(&x); - if (x->typ->form == 5) { + if (x->typ->form == 4) { sf = x->conval->intval; if (sf < 0 || sf > 1) { OPP_err(220); @@ -159,7 +159,7 @@ static void OPP_RecordType (OPT_Struct *typ, OPT_Struct *banned) OPT_Object fld = NIL, first = NIL, last = NIL, base = NIL; OPT_Struct ftyp = NIL; INTEGER sysflag; - *typ = OPT_NewStr(15, 4); + *typ = OPT_NewStr(13, 4); (*typ)->BaseTyp = NIL; OPP_CheckSysFlag(&sysflag, -1); if (OPP_sym == 30) { @@ -254,7 +254,7 @@ static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) INTEGER sysflag; OPP_CheckSysFlag(&sysflag, 0); if (OPP_sym == 25) { - *typ = OPT_NewStr(15, 3); + *typ = OPT_NewStr(13, 3); (*typ)->mno = 0; (*typ)->sysflag = sysflag; OPS_Get(&OPP_sym); @@ -266,10 +266,10 @@ static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) (*typ)->n = 0; } } else { - *typ = OPT_NewStr(15, 2); + *typ = OPT_NewStr(13, 2); (*typ)->sysflag = sysflag; OPP_ConstExpression(&x); - if (x->typ->form == 5) { + if (x->typ->form == 4) { n = x->conval->intval; if (n <= 0 || n > OPM_MaxIndex) { OPP_err(63); @@ -302,7 +302,7 @@ static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) static void OPP_PointerType (OPT_Struct *typ) { OPT_Object id = NIL; - *typ = OPT_NewStr(13, 1); + *typ = OPT_NewStr(11, 1); OPP_CheckSysFlag(&(*typ)->sysflag, 0); OPP_CheckSym(28); if (OPP_sym == 38) { @@ -410,7 +410,7 @@ static void OPP_FormalParameters (OPT_Object *firstPar, OPT_Struct *resTyp) if (OPP_sym == 38) { OPP_qualident(&res); if (res->mode == 5) { - if (res->typ->form < 15) { + if (res->typ->form < 13) { *resTyp = res->typ; } else { OPP_err(54); @@ -460,7 +460,7 @@ static void OPP_TypeDecl (OPT_Struct *typ, OPT_Struct *banned) OPP_PointerType(&*typ); } else if (OPP_sym == 61) { OPS_Get(&OPP_sym); - *typ = OPT_NewStr(14, 1); + *typ = OPT_NewStr(12, 1); OPP_CheckSysFlag(&(*typ)->sysflag, 0); if (OPP_sym == 30) { OPS_Get(&OPP_sym); @@ -489,7 +489,7 @@ static void OPP_TypeDecl (OPT_Struct *typ, OPT_Struct *banned) static void OPP_Type (OPT_Struct *typ, OPT_Struct *banned) { OPP_TypeDecl(&*typ, &*banned); - if (((((*typ)->form == 13 && (*typ)->BaseTyp == OPT_undftyp)) && (*typ)->strobj == NIL)) { + if (((((*typ)->form == 11 && (*typ)->BaseTyp == OPT_undftyp)) && (*typ)->strobj == NIL)) { OPP_err(0); } } @@ -504,7 +504,7 @@ static void OPP_selector (OPT_Node *x) if (OPP_sym == 31) { OPS_Get(&OPP_sym); for (;;) { - if (((*x)->typ != NIL && (*x)->typ->form == 13)) { + if (((*x)->typ != NIL && (*x)->typ->form == 11)) { OPB_DeRef(&*x); } OPP_Expression(&y); @@ -522,7 +522,7 @@ static void OPP_selector (OPT_Node *x) __COPY(OPS_name, name, 256); OPS_Get(&OPP_sym); if ((*x)->typ != NIL) { - if ((*x)->typ->form == 13) { + if ((*x)->typ->form == 11) { OPB_DeRef(&*x); } if ((*x)->typ->comp == 4) { @@ -544,7 +544,7 @@ static void OPP_selector (OPT_Node *x) OPP_err(75); } typ = y->obj->typ; - if (typ->form == 13) { + if (typ->form == 11) { typ = typ->BaseTyp; } OPT_FindField((*x)->obj->name, typ->BaseTyp, &proc); @@ -573,7 +573,7 @@ static void OPP_selector (OPT_Node *x) } else if (OPP_sym == 17) { OPS_Get(&OPP_sym); OPB_DeRef(&*x); - } else if ((((((OPP_sym == 30 && (*x)->class < 7)) && (*x)->typ->form != 14)) && ((*x)->obj == NIL || (*x)->obj->mode != 13))) { + } else if ((((((OPP_sym == 30 && (*x)->class < 7)) && (*x)->typ->form != 12)) && ((*x)->obj == NIL || (*x)->obj->mode != 13))) { OPS_Get(&OPP_sym); if (OPP_sym == 38) { OPP_qualident(&obj); @@ -872,10 +872,10 @@ static void OPP_Receiver (SHORTINT *mode, OPS_Name name, OPT_Struct *typ, OPT_St } else { *typ = obj->typ; *rec = *typ; - if ((*rec)->form == 13) { + if ((*rec)->form == 11) { *rec = (*rec)->BaseTyp; } - if (!((((*mode == 1 && (*typ)->form == 13)) && (*rec)->comp == 4) || (*mode == 2 && (*typ)->comp == 4))) { + if (!((((*mode == 1 && (*typ)->form == 11)) && (*rec)->comp == 4) || (*mode == 2 && (*typ)->comp == 4))) { OPP_err(70); *rec = NIL; } @@ -889,7 +889,7 @@ static void OPP_Receiver (SHORTINT *mode, OPS_Name name, OPT_Struct *typ, OPT_St } OPP_CheckSym(22); if (*rec == NIL) { - *rec = OPT_NewStr(15, 4); + *rec = OPT_NewStr(13, 4); (*rec)->BaseTyp = NIL; } } @@ -897,7 +897,7 @@ static void OPP_Receiver (SHORTINT *mode, OPS_Name name, OPT_Struct *typ, OPT_St static BOOLEAN OPP_Extends (OPT_Struct x, OPT_Struct b) { BOOLEAN _o_result; - if ((b->form == 13 && x->form == 13)) { + if ((b->form == 11 && x->form == 11)) { b = b->BaseTyp; x = x->BaseTyp; } @@ -1174,14 +1174,14 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, O for (;;) { OPP_ConstExpression(&x); f = x->typ->form; - if (__IN(f, 0x28)) { + if (__IN(f, 0x18)) { xval = x->conval->intval; } else { OPP_err(61); xval = 1; } - if (f == 5) { - if (!(LabelTyp->form == 5) || LabelTyp->size < x->typ->size) { + if (f == 4) { + if (!(LabelTyp->form == 4) || LabelTyp->size < x->typ->size) { OPP_err(60); } } else if (LabelTyp->form != f) { @@ -1191,7 +1191,7 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, O OPS_Get(&OPP_sym); OPP_ConstExpression(&y); yval = y->conval->intval; - if ((y->typ->form != f && !((f == 5 && y->typ->form == 5)))) { + if ((y->typ->form != f && !((f == 4 && y->typ->form == 4)))) { OPP_err(60); } if (yval < xval) { @@ -1254,7 +1254,7 @@ static void CasePart__31 (OPT_Node *x) *StatSeq__30_s->pos = OPM_errpos; if ((*x)->class == 8 || (*x)->class == 9) { OPP_err(126); - } else if (!__IN((*x)->typ->form, 0x38)) { + } else if (!__IN((*x)->typ->form, 0x18)) { OPP_err(125); } OPP_CheckSym(25); @@ -1440,7 +1440,7 @@ static void OPP_StatSeq (OPT_Node *stat) OPS_Get(&OPP_sym); if (OPP_sym == 38) { OPP_qualident(&id); - if (!(id->typ->form == 5)) { + if (!(id->typ->form == 4)) { OPP_err(68); } OPP_CheckSym(34); @@ -1472,7 +1472,7 @@ static void OPP_StatSeq (OPT_Node *stat) SetPos__35(z); OPB_Link(&*stat, &last, z); y = OPB_NewLeaf(t); - } else if (!(y->typ->form == 5) || y->typ->size > x->left->typ->size) { + } else if (!(y->typ->form == 4) || y->typ->size > x->left->typ->size) { OPP_err(113); } OPB_Link(&*stat, &last, x); @@ -1527,7 +1527,7 @@ static void OPP_StatSeq (OPT_Node *stat) if (OPP_sym == 38) { OPP_qualident(&id); y = OPB_NewLeaf(id); - if ((((id != NIL && id->typ->form == 13)) && (id->mode == 2 || !id->leaf))) { + if ((((id != NIL && id->typ->form == 11)) && (id->mode == 2 || !id->leaf))) { OPP_err(245); } OPP_CheckSym(20); diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index 7a12f897..863db6d6 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index 2ee978f2..e575dfe6 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index a8dccfed..a60ffe74 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index f8762935..35088301 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" @@ -174,7 +174,7 @@ OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir) { OPT_Struct _o_result; INTEGER i; - __ASSERT(x->form == 5, 0); + __ASSERT(x->form == 4, 0); __ASSERT(dir == 1 || dir == -1, 0); __ASSERT(x->BaseTyp == OPT_undftyp, 0); i = 0; @@ -285,7 +285,7 @@ void OPT_Close (void) OPT_GlbMod[__X(i, 64)] = NIL; i += 1; } - i = 16; + i = 14; while (i < 255) { OPT_impCtxt.ref[__X(i, 255)] = NIL; OPT_impCtxt.old[__X(i, 255)] = NIL; @@ -484,14 +484,14 @@ void OPT_IdFPrint (OPT_Struct typ) OPT_FPrintName(&idfp, (void*)OPT_GlbMod[__X(typ->mno, 64)]->name, 256); OPT_FPrintName(&idfp, (void*)strobj->name, 256); } - if ((f == 13 || (c == 4 && btyp != NIL)) || c == 3) { + if ((f == 11 || (c == 4 && btyp != NIL)) || c == 3) { OPT_IdFPrint(btyp); OPM_FPrint(&idfp, btyp->idfp); } else if (c == 2) { OPT_IdFPrint(btyp); OPM_FPrint(&idfp, btyp->idfp); OPM_FPrint(&idfp, typ->n); - } else if (f == 14) { + } else if (f == 12) { OPT_FPrintSign(&idfp, btyp, typ->link); } typ->idfp = idfp; @@ -520,7 +520,7 @@ static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr) n = btyp->n * n; btyp = btyp->BaseTyp; } - if (btyp->form == 13 || btyp->comp == 4) { + if (btyp->form == 11 || btyp->comp == 4) { j = OPT_nofhdfld; FPrintHdFld__15(btyp, fld, adr); if (j != OPT_nofhdfld) { @@ -532,8 +532,8 @@ static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr) } } } - } else if (typ->form == 13 || __STRCMP(fld->name, "@ptr") == 0) { - OPM_FPrint(&*FPrintStr__12_s->pvfp, 13); + } else if (typ->form == 11 || __STRCMP(fld->name, "@ptr") == 0) { + OPM_FPrint(&*FPrintStr__12_s->pvfp, 11); OPM_FPrint(&*FPrintStr__12_s->pvfp, adr); OPT_nofhdfld += 1; } @@ -596,7 +596,7 @@ void OPT_FPrintStr (OPT_Struct typ) f = typ->form; c = typ->comp; btyp = typ->BaseTyp; - if (f == 13) { + if (f == 11) { strobj = typ->strobj; bstrobj = btyp->strobj; if (((strobj == NIL || strobj->name[0] == 0x00) || bstrobj == NIL) || bstrobj->name[0] == 0x00) { @@ -604,7 +604,7 @@ void OPT_FPrintStr (OPT_Struct typ) OPM_FPrint(&pbfp, btyp->pbfp); pvfp = pbfp; } - } else if (f == 14) { + } else if (f == 12) { } else if (__IN(c, 0x0c)) { OPT_FPrintStr(btyp); OPM_FPrint(&pbfp, btyp->pvfp); @@ -650,23 +650,23 @@ void OPT_FPrintObj (OPT_Object obj) f = obj->typ->form; OPM_FPrint(&fprint, f); switch (f) { - case 2: case 3: case 5: + case 2: case 3: case 4: OPM_FPrint(&fprint, obj->conval->intval); break; - case 9: + case 7: OPM_FPrintSet(&fprint, obj->conval->setval); break; - case 7: + case 5: rval = obj->conval->realval; OPM_FPrintReal(&fprint, rval); break; - case 8: + case 6: OPM_FPrintLReal(&fprint, obj->conval->realval); break; - case 10: + case 8: OPT_FPrintName(&fprint, (void*)*obj->conval->ext, 256); break; - case 11: + case 9: break; default: OPT_err(127); @@ -851,22 +851,22 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval) OPM_SymRCh(&ch); conval->intval = ch; break; - case 5: + case 4: conval->intval = OPM_SymRInt(); break; - case 9: + case 7: OPM_SymRSet(&conval->setval); break; - case 7: + case 5: OPM_SymRReal(&rval); conval->realval = rval; conval->intval = -1; break; - case 8: + case 6: OPM_SymRLReal(&conval->realval); conval->intval = -1; break; - case 10: + case 8: ext = OPT_NewExt(); conval->ext = ext; i = 0; @@ -878,7 +878,7 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval) conval->intval2 = i; conval->intval = -1; break; - case 11: + case 9: conval->intval = 0; break; default: @@ -980,7 +980,7 @@ static OPT_Object OPT_InTProc (SHORTINT mno) static OPT_Struct OPT_InTyp (LONGINT tag) { OPT_Struct _o_result; - if (tag == 5) { + if (tag == 4) { _o_result = OPT_IntType(OPM_SymRInt()); return _o_result; } else { @@ -1055,20 +1055,20 @@ static void OPT_InStruct (OPT_Struct *typ) } switch (tag) { case 36: - (*typ)->form = 13; + (*typ)->form = 11; (*typ)->size = OPM_PointerSize; (*typ)->n = 0; OPT_InStruct(&(*typ)->BaseTyp); break; case 37: - (*typ)->form = 15; + (*typ)->form = 13; (*typ)->comp = 2; OPT_InStruct(&(*typ)->BaseTyp); (*typ)->n = OPM_SymRInt(); (*OPT_typSize)(*typ); break; case 38: - (*typ)->form = 15; + (*typ)->form = 13; (*typ)->comp = 3; OPT_InStruct(&(*typ)->BaseTyp); if ((*typ)->BaseTyp->comp == 3) { @@ -1079,7 +1079,7 @@ static void OPT_InStruct (OPT_Struct *typ) (*OPT_typSize)(*typ); break; case 39: - (*typ)->form = 15; + (*typ)->form = 13; (*typ)->comp = 4; OPT_InStruct(&(*typ)->BaseTyp); if ((*typ)->BaseTyp == OPT_notyp) { @@ -1113,7 +1113,7 @@ static void OPT_InStruct (OPT_Struct *typ) } break; case 40: - (*typ)->form = 14; + (*typ)->form = 12; (*typ)->size = OPM_ProcSize; OPT_InSign(mno, &(*typ)->BaseTyp, &(*typ)->link); break; @@ -1192,7 +1192,7 @@ static OPT_Object OPT_InObj (SHORTINT mno) obj = OPT_NewObj(); obj->mnolev = -mno; obj->vis = 1; - if (tag <= 13) { + if (tag <= 11) { obj->mode = 3; obj->conval = OPT_NewConst(); OPT_InConstant(tag, obj->conval); @@ -1289,7 +1289,7 @@ void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) obj->scope = OPT_syslink; obj->typ = OPT_notyp; } else { - OPT_impCtxt.nofr = 16; + OPT_impCtxt.nofr = 14; OPT_impCtxt.minr = 255; OPT_impCtxt.nofm = 0; OPT_impCtxt.self = __STRCMP(aliasName, "@self") == 0; @@ -1356,7 +1356,7 @@ static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, LONGINT adr) n = btyp->n * n; btyp = btyp->BaseTyp; } - if (btyp->form == 13 || btyp->comp == 4) { + if (btyp->form == 11 || btyp->comp == 4) { j = OPT_nofhdfld; OPT_OutHdFld(btyp, fld, adr); if (j != OPT_nofhdfld) { @@ -1368,7 +1368,7 @@ static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, LONGINT adr) } } } - } else if (typ->form == 13 || __STRCMP(fld->name, "@ptr") == 0) { + } else if (typ->form == 11 || __STRCMP(fld->name, "@ptr") == 0) { OPM_SymWInt(27); OPM_SymWInt(adr); OPT_nofhdfld += 1; @@ -1440,7 +1440,7 @@ static void OPT_OutStr (OPT_Struct typ) OPT_Object strobj = NIL; if (typ->ref < OPT_expCtxt.ref) { OPM_SymWInt(-typ->ref); - if (typ->ref == 5) { + if (typ->ref == 4) { OPM_SymWInt(typ->size); } } else { @@ -1475,15 +1475,15 @@ static void OPT_OutStr (OPT_Struct typ) OPM_SymWInt(typ->sysflag); } switch (typ->form) { - case 13: + case 11: OPM_SymWInt(36); OPT_OutStr(typ->BaseTyp); break; - case 14: + case 12: OPM_SymWInt(40); OPT_OutSign(typ->BaseTyp, typ->link); break; - case 15: + case 13: switch (typ->comp) { case 2: OPM_SymWInt(37); @@ -1538,24 +1538,24 @@ static void OPT_OutConstant (OPT_Object obj) case 2: case 3: OPM_SymWCh((CHAR)obj->conval->intval); break; - case 5: + case 4: OPM_SymWInt(obj->conval->intval); OPM_SymWInt(obj->typ->size); break; - case 9: + case 7: OPM_SymWSet(obj->conval->setval); break; - case 7: + case 5: rval = obj->conval->realval; OPM_SymWReal(rval); break; - case 8: + case 6: OPM_SymWLReal(obj->conval->realval); break; - case 10: + case 8: OPT_OutName((void*)*obj->conval->ext, 256); break; - case 11: + case 9: break; default: OPT_err(127); @@ -1669,7 +1669,7 @@ void OPT_Export (BOOLEAN *ext, BOOLEAN *new) OPM_SymWInt(16); OPT_OutName((void*)OPT_SelfName, 256); OPT_expCtxt.reffp = 0; - OPT_expCtxt.ref = 16; + OPT_expCtxt.ref = 14; OPT_expCtxt.nofm = 1; OPT_expCtxt.locmno[0] = 0; i = 1; @@ -1845,16 +1845,16 @@ export void *OPT__init(void) OPM_errpos = 0; OPT_InitStruct(&OPT_undftyp, 0); OPT_undftyp->BaseTyp = OPT_undftyp; - OPT_InitStruct(&OPT_notyp, 12); - OPT_InitStruct(&OPT_stringtyp, 10); - OPT_InitStruct(&OPT_niltyp, 11); + OPT_InitStruct(&OPT_notyp, 10); + OPT_InitStruct(&OPT_stringtyp, 8); + OPT_InitStruct(&OPT_niltyp, 9); OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp); - OPT_EnterTyp((CHAR*)"PTR", 13, OPM_PointerSize, &OPT_sysptrtyp); - OPT_EnterTyp((CHAR*)"ADRINT", 5, OPM_PointerSize, &OPT_ainttyp); - OPT_EnterTyp((CHAR*)"INT8", 5, 1, &OPT_int8typ); - OPT_EnterTyp((CHAR*)"INT16", 5, 2, &OPT_int16typ); - OPT_EnterTyp((CHAR*)"INT32", 5, 4, &OPT_int32typ); - OPT_EnterTyp((CHAR*)"INT64", 5, 8, &OPT_int64typ); + OPT_EnterTyp((CHAR*)"PTR", 11, OPM_PointerSize, &OPT_sysptrtyp); + OPT_EnterTyp((CHAR*)"ADRINT", 4, OPM_PointerSize, &OPT_ainttyp); + OPT_EnterTyp((CHAR*)"INT8", 4, 1, &OPT_int8typ); + OPT_EnterTyp((CHAR*)"INT16", 4, 2, &OPT_int16typ); + OPT_EnterTyp((CHAR*)"INT32", 4, 4, &OPT_int32typ); + OPT_EnterTyp((CHAR*)"INT64", 4, 8, &OPT_int64typ); OPT_EnterProc((CHAR*)"ADR", 20); OPT_EnterProc((CHAR*)"CC", 21); OPT_EnterProc((CHAR*)"LSH", 22); @@ -1872,12 +1872,12 @@ export void *OPT__init(void) OPT_topScope->right = NIL; OPT_EnterTyp((CHAR*)"BOOLEAN", 2, OPM_BoolSize, &OPT_booltyp); OPT_EnterTyp((CHAR*)"CHAR", 3, OPM_CharSize, &OPT_chartyp); - OPT_EnterTyp((CHAR*)"SET", 9, OPM_SetSize, &OPT_settyp); - OPT_EnterTyp((CHAR*)"REAL", 7, OPM_RealSize, &OPT_realtyp); - OPT_EnterTyp((CHAR*)"INTEGER", 5, OPM_IntSize, &OPT_inttyp); - OPT_EnterTyp((CHAR*)"LONGINT", 5, OPM_LIntSize, &OPT_linttyp); - OPT_EnterTyp((CHAR*)"LONGREAL", 8, OPM_LRealSize, &OPT_lrltyp); - OPT_EnterTyp((CHAR*)"SHORTINT", 5, OPM_SIntSize, &OPT_sinttyp); + OPT_EnterTyp((CHAR*)"SET", 7, OPM_SetSize, &OPT_settyp); + OPT_EnterTyp((CHAR*)"REAL", 5, OPM_RealSize, &OPT_realtyp); + OPT_EnterTyp((CHAR*)"INTEGER", 4, OPM_IntSize, &OPT_inttyp); + OPT_EnterTyp((CHAR*)"LONGINT", 4, OPM_LIntSize, &OPT_linttyp); + OPT_EnterTyp((CHAR*)"LONGREAL", 6, OPM_LRealSize, &OPT_lrltyp); + OPT_EnterTyp((CHAR*)"SHORTINT", 4, OPM_SIntSize, &OPT_sinttyp); OPT_EnterBoolConst((CHAR*)"FALSE", 0); OPT_EnterBoolConst((CHAR*)"TRUE", 1); OPT_EnterProc((CHAR*)"HALT", 0); @@ -1905,14 +1905,14 @@ export void *OPT__init(void) OPT_impCtxt.ref[1] = OPT_bytetyp; OPT_impCtxt.ref[2] = OPT_booltyp; OPT_impCtxt.ref[3] = OPT_chartyp; - OPT_impCtxt.ref[5] = OPT_inttyp; - OPT_impCtxt.ref[7] = OPT_realtyp; - OPT_impCtxt.ref[8] = OPT_lrltyp; - OPT_impCtxt.ref[9] = OPT_settyp; - OPT_impCtxt.ref[10] = OPT_stringtyp; - OPT_impCtxt.ref[11] = OPT_niltyp; - OPT_impCtxt.ref[12] = OPT_notyp; - OPT_impCtxt.ref[13] = OPT_sysptrtyp; + OPT_impCtxt.ref[4] = OPT_inttyp; + OPT_impCtxt.ref[5] = OPT_realtyp; + OPT_impCtxt.ref[6] = OPT_lrltyp; + OPT_impCtxt.ref[7] = OPT_settyp; + OPT_impCtxt.ref[8] = OPT_stringtyp; + OPT_impCtxt.ref[9] = OPT_niltyp; + OPT_impCtxt.ref[10] = OPT_notyp; + OPT_impCtxt.ref[11] = OPT_sysptrtyp; OPT_IntTypes[1] = OPT_sinttyp; OPT_IntTypes[2] = OPT_inttyp; OPT_IntTypes[3] = OPT_linttyp; diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index acf2e9e9..c3fdc0cf 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index b5cebda5..c769935e 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPC.h" @@ -123,14 +123,14 @@ void OPV_TypSize (OPT_Struct typ) } else if (c == 2) { OPV_TypSize(typ->BaseTyp); typ->size = typ->n * typ->BaseTyp->size; - } else if (f == 13) { + } else if (f == 11) { typ->size = OPM_PointerSize; if (typ->BaseTyp == OPT_undftyp) { OPM_Mark(128, typ->n); } else { OPV_TypSize(typ->BaseTyp); } - } else if (f == 14) { + } else if (f == 12) { typ->size = OPM_ProcSize; } else if (c == 3) { btyp = typ->BaseTyp; @@ -163,7 +163,7 @@ static void OPV_GetTProcNum (OPT_Object obj) oldPos = OPM_errpos; OPM_errpos = obj->scope->adr; typ = obj->link->typ; - if (typ->form == 13) { + if (typ->form == 11) { typ = typ->BaseTyp; } OPT_FindField(obj->name, typ->BaseTyp, &redef); @@ -237,7 +237,7 @@ static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exporte if ((mode == 5 && (obj->vis != 0) == exported)) { typ = obj->typ; OPV_TypSize(obj->typ); - if (typ->form == 13) { + if (typ->form == 11) { typ = typ->BaseTyp; } if (typ->comp == 4) { @@ -349,7 +349,7 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN case 12: switch (subclass) { case 1: - if (form == 9) { + if (form == 7) { _o_result = 4; return _o_result; } else { @@ -358,7 +358,7 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN } break; case 2: - if (form == 9) { + if (form == 7) { _o_result = 3; return _o_result; } else { @@ -371,7 +371,7 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN return _o_result; break; case 6: - if (form == 9) { + if (form == 7) { _o_result = 2; return _o_result; } else { @@ -380,7 +380,7 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN } break; case 7: - if (form == 9) { + if (form == 7) { _o_result = 4; return _o_result; } else { @@ -464,7 +464,7 @@ static BOOLEAN OPV_SideEffects (OPT_Node n) static void OPV_Entier (OPT_Node n, INTEGER prec) { - if (__IN(n->typ->form, 0x0180)) { + if (__IN(n->typ->form, 0x60)) { OPM_WriteString((CHAR*)"__ENTIER(", 10); OPV_expr(n, -1); OPM_Write(')'); @@ -503,11 +503,11 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec) INTEGER from, to; from = n->typ->form; to = newtype->form; - if (to == 9) { + if (to == 7) { OPM_WriteString((CHAR*)"__SETOF(", 9); OPV_Entier(n, -1); OPM_Write(')'); - } else if (to == 5) { + } else if (to == 4) { if ((newtype->size < n->typ->size && __IN(2, OPM_opt))) { OPM_WriteString((CHAR*)"__SHORT", 8); if (OPV_SideEffects(n)) { @@ -542,7 +542,7 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec) static void OPV_TypeOf (OPT_Node n) { - if (n->typ->form == 13) { + if (n->typ->form == 11) { OPM_WriteString((CHAR*)"__TYPEOF(", 10); OPV_expr(n, -1); OPM_Write(')'); @@ -794,14 +794,14 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) } else if (OPV_ansi) { if ((__IN(comp, 0x0c) && n->class == 7)) { OPM_WriteString((CHAR*)"(CHAR*)", 8); - } else if ((((form == 13 && typ != n->typ)) && n->typ != OPT_niltyp)) { + } else if ((((form == 11 && typ != n->typ)) && n->typ != OPT_niltyp)) { OPM_WriteString((CHAR*)"(void*)", 8); } } else { - if ((__IN(form, 0x0180) && n->typ->form == 5)) { + if ((__IN(form, 0x60) && n->typ->form == 4)) { OPM_WriteString((CHAR*)"(double)", 9); prec = 9; - } else if (form == 5) { + } else if (form == 4) { OPV_SizeCast(n->typ->size, typ->size); } } @@ -812,7 +812,7 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) } if ((((mode == 2 && n->class == 11)) && n->subcl == 29)) { OPV_expr(n->left, prec); - } else if ((form == 5 && n->class == 7)) { + } else if ((form == 4 && n->class == 7)) { OPV_ParIntLiteral(n->conval->intval, n->typ->size); } else { OPV_expr(n, prec); @@ -861,7 +861,7 @@ static OPT_Object OPV_SuperProc (OPT_Node n) OPT_Object obj = NIL; OPT_Struct typ = NIL; typ = n->right->typ; - if (typ->form == 13) { + if (typ->form == 11) { typ = typ->BaseTyp; } OPT_FindField(n->left->obj->name, typ->BaseTyp, &obj); @@ -902,7 +902,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPV_expr(l, exprPrec); break; case 7: - if (form == 9) { + if (form == 7) { OPM_Write('~'); } else { OPM_Write('-'); @@ -930,7 +930,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) break; case 21: if (OPV_SideEffects(l)) { - if (l->typ->form < 7) { + if (l->typ->form < 5) { if (l->typ->size <= 4) { OPM_WriteString((CHAR*)"(int)", 6); } @@ -959,18 +959,18 @@ static void OPV_expr (OPT_Node n, INTEGER prec) if (l->class == 1) { OPC_CompleteIdent(l->obj); } else { - if ((l->typ->form != 10 && !__IN(l->typ->comp, 0x0c))) { + if ((l->typ->form != 8 && !__IN(l->typ->comp, 0x0c))) { OPM_Write('&'); } OPV_expr(l, exprPrec); } break; case 29: - if (!__IN(l->class, 0x17) || (((__IN(n->typ->form, 0x6220) && __IN(l->typ->form, 0x6220))) && n->typ->size == l->typ->size)) { + if (!__IN(l->class, 0x17) || (((__IN(n->typ->form, 0x1890) && __IN(l->typ->form, 0x1890))) && n->typ->size == l->typ->size)) { OPM_Write('('); OPC_Ident(n->typ->strobj); OPM_Write(')'); - if (__IN(n->typ->form, 0x6000) || __IN(l->typ->form, 0x6000)) { + if (__IN(n->typ->form, 0x1800) || __IN(l->typ->form, 0x1800)) { OPM_WriteString((CHAR*)"(SYSTEM_ADRINT)", 16); } OPV_expr(l, exprPrec); @@ -1080,7 +1080,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) break; case 9: case 10: case 11: case 12: case 13: case 14: - if (__IN(l->typ->form, 0x8400)) { + if (__IN(l->typ->form, 0x2100)) { OPM_WriteString((CHAR*)"__STRCMP(", 10); OPV_expr(l, -1); OPM_WriteString((CHAR*)", ", 3); @@ -1092,31 +1092,31 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPV_expr(l, exprPrec); OPC_Cmp(subclass); typ = l->typ; - if ((((((typ->form == 13 && r->typ->form != 11)) && r->typ != typ)) && r->typ != OPT_sysptrtyp)) { + if ((((((typ->form == 11 && r->typ->form != 9)) && r->typ != typ)) && r->typ != OPT_sysptrtyp)) { OPM_WriteString((CHAR*)"(void *) ", 10); } OPV_expr(r, exprPrec); } break; default: - if (subclass == 5 || (form == 9 && (subclass == 1 || subclass == 7))) { + if (subclass == 5 || (form == 7 && (subclass == 1 || subclass == 7))) { OPM_Write('('); } OPV_expr(l, exprPrec); switch (subclass) { case 1: - if (form == 9) { + if (form == 7) { OPM_WriteString((CHAR*)" & ", 4); } else { OPM_WriteString((CHAR*)" * ", 4); } break; case 2: - if (form == 9) { + if (form == 7) { OPM_WriteString((CHAR*)" ^ ", 4); } else { OPM_WriteString((CHAR*)" / ", 4); - if (r->obj == NIL || r->obj->typ->form == 5) { + if (r->obj == NIL || r->obj->typ->form == 4) { OPM_Write('('); OPC_Ident(n->typ->strobj); OPM_Write(')'); @@ -1127,14 +1127,14 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPM_WriteString((CHAR*)" && ", 5); break; case 6: - if (form == 9) { + if (form == 7) { OPM_WriteString((CHAR*)" | ", 4); } else { OPM_WriteString((CHAR*)" + ", 4); } break; case 7: - if (form == 9) { + if (form == 7) { OPM_WriteString((CHAR*)" & ~", 5); } else { OPM_WriteString((CHAR*)" - ", 4); @@ -1150,7 +1150,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) break; } OPV_expr(r, exprPrec); - if (subclass == 5 || (form == 9 && (subclass == 1 || subclass == 7))) { + if (subclass == 5 || (form == 7 && (subclass == 1 || subclass == 7))) { OPM_Write(')'); } break; @@ -1324,7 +1324,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) if ((base->comp == 4 && OPC_NofPtrs(base) != 0)) { OPC_Ident(base->strobj); OPM_WriteString((CHAR*)"__typ", 6); - } else if (base->form == 13) { + } else if (base->form == 11) { OPM_WriteString((CHAR*)"POINTER__typ", 13); } else { OPM_WriteString((CHAR*)"NIL", 4); @@ -1430,11 +1430,11 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) } OPM_Write(')'); } else { - if ((((((l->typ->form == 13 && l->obj != NIL)) && l->obj->adr == 1)) && l->obj->mode == 1)) { + if ((((((l->typ->form == 11 && l->obj != NIL)) && l->obj->adr == 1)) && l->obj->mode == 1)) { l->obj->adr = 0; OPV_design(l, -1); l->obj->adr = 1; - if (r->typ->form != 11) { + if (r->typ->form != 9) { OPM_WriteString((CHAR*)" = (void*)", 11); } else { OPM_WriteString((CHAR*)" = ", 4); @@ -1445,7 +1445,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) } if (l->typ == r->typ) { OPV_expr(r, -1); - } else if ((((l->typ->form == 13 && r->typ->form != 11)) && l->typ->strobj != NIL)) { + } else if ((((l->typ->form == 11 && r->typ->form != 9)) && l->typ->strobj != NIL)) { OPM_Write('('); OPC_Ident(l->typ->strobj); OPM_Write(')'); @@ -1630,7 +1630,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) } else { if (n->left != NIL) { OPM_WriteString((CHAR*)"_o_result = ", 13); - if ((n->left->typ->form == 13 && n->obj->typ != n->left->typ)) { + if ((n->left->typ->form == 11 && n->obj->typ != n->left->typ)) { OPM_WriteString((CHAR*)"(void*)", 8); OPV_expr(n->left, 10); } else { diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index 351ef416..914ff060 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index efbe5376..3f699c1c 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index 45566c5d..cff07fba 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 0652d6b4..98719812 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index 9836b502..87c9aa45 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index ad6ecbeb..24999430 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index f836f9f9..9c2bad27 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index 01c67abc..ff526cbc 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Files.h" diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index 699c0323..f36b27cf 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/Vishap.c b/bootstrap/windows-88/Vishap.c index ffe27b0f..65dd2639 100644 --- a/bootstrap/windows-88/Vishap.c +++ b/bootstrap/windows-88/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkamSf */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/windows-88/errors.c b/bootstrap/windows-88/errors.c index 57e3252c..dc5320bb 100644 --- a/bootstrap/windows-88/errors.c +++ b/bootstrap/windows-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/windows-88/errors.h b/bootstrap/windows-88/errors.h index abc550ac..d15a472c 100644 --- a/bootstrap/windows-88/errors.h +++ b/bootstrap/windows-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index 4e7d428f..566e2b5c 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index b5b2af96..161e273a 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/vt100.c b/bootstrap/windows-88/vt100.c index 037caf04..b9fb5373 100644 --- a/bootstrap/windows-88/vt100.c +++ b/bootstrap/windows-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/windows-88/vt100.h b/bootstrap/windows-88/vt100.h index 0b63640a..745ff709 100644 --- a/bootstrap/windows-88/vt100.h +++ b/bootstrap/windows-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/src/test/confidence/planned-binary-change b/src/test/confidence/planned-binary-change index 78981922..61780798 100644 --- a/src/test/confidence/planned-binary-change +++ b/src/test/confidence/planned-binary-change @@ -1 +1 @@ -a +b From ee8342ef0d651353e077a2c28c44857a3327ba1b Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 1 Sep 2016 14:14:06 +0100 Subject: [PATCH 207/580] Moving to config independent types stage 1 - generate intxx types. --- bootstrap/unix-44/Console.c | 26 +-- bootstrap/unix-44/Console.h | 4 +- bootstrap/unix-44/Files.c | 166 +++++++++---------- bootstrap/unix-44/Files.h | 34 ++-- bootstrap/unix-44/Heap.c | 200 +++++++++++----------- bootstrap/unix-44/Heap.h | 10 +- bootstrap/unix-44/Modules.c | 12 +- bootstrap/unix-44/Modules.h | 8 +- bootstrap/unix-44/OPB.c | 154 ++++++++--------- bootstrap/unix-44/OPB.h | 20 +-- bootstrap/unix-44/OPC.c | 236 +++++++++++++------------- bootstrap/unix-44/OPC.h | 24 +-- bootstrap/unix-44/OPM.c | 168 +++++++++---------- bootstrap/unix-44/OPM.h | 34 ++-- bootstrap/unix-44/OPP.c | 92 +++++------ bootstrap/unix-44/OPS.c | 44 ++--- bootstrap/unix-44/OPS.h | 6 +- bootstrap/unix-44/OPT.c | 216 ++++++++++++------------ bootstrap/unix-44/OPT.h | 32 ++-- bootstrap/unix-44/OPV.c | 110 ++++++------- bootstrap/unix-44/Platform.c | 266 +++++++++++++++--------------- bootstrap/unix-44/Platform.h | 94 +++++------ bootstrap/unix-44/Reals.c | 64 ++++---- bootstrap/unix-44/Reals.h | 14 +- bootstrap/unix-44/SYSTEM.h | 104 ++++++++---- bootstrap/unix-44/Strings.c | 48 +++--- bootstrap/unix-44/Strings.h | 12 +- bootstrap/unix-44/Texts.c | 244 +++++++++++++-------------- bootstrap/unix-44/Texts.h | 56 +++---- bootstrap/unix-44/Vishap.c | 4 +- bootstrap/unix-44/extTools.c | 2 +- bootstrap/unix-44/vt100.c | 88 +++++----- bootstrap/unix-44/vt100.h | 34 ++-- bootstrap/unix-48/Console.c | 26 +-- bootstrap/unix-48/Console.h | 4 +- bootstrap/unix-48/Files.c | 166 +++++++++---------- bootstrap/unix-48/Files.h | 34 ++-- bootstrap/unix-48/Heap.c | 200 +++++++++++----------- bootstrap/unix-48/Heap.h | 10 +- bootstrap/unix-48/Modules.c | 12 +- bootstrap/unix-48/Modules.h | 8 +- bootstrap/unix-48/OPB.c | 154 ++++++++--------- bootstrap/unix-48/OPB.h | 20 +-- bootstrap/unix-48/OPC.c | 236 +++++++++++++------------- bootstrap/unix-48/OPC.h | 24 +-- bootstrap/unix-48/OPM.c | 168 +++++++++---------- bootstrap/unix-48/OPM.h | 34 ++-- bootstrap/unix-48/OPP.c | 92 +++++------ bootstrap/unix-48/OPS.c | 44 ++--- bootstrap/unix-48/OPS.h | 6 +- bootstrap/unix-48/OPT.c | 216 ++++++++++++------------ bootstrap/unix-48/OPT.h | 32 ++-- bootstrap/unix-48/OPV.c | 110 ++++++------- bootstrap/unix-48/Platform.c | 266 +++++++++++++++--------------- bootstrap/unix-48/Platform.h | 94 +++++------ bootstrap/unix-48/Reals.c | 64 ++++---- bootstrap/unix-48/Reals.h | 14 +- bootstrap/unix-48/SYSTEM.h | 104 ++++++++---- bootstrap/unix-48/Strings.c | 48 +++--- bootstrap/unix-48/Strings.h | 12 +- bootstrap/unix-48/Texts.c | 244 +++++++++++++-------------- bootstrap/unix-48/Texts.h | 56 +++---- bootstrap/unix-48/Vishap.c | 4 +- bootstrap/unix-48/extTools.c | 2 +- bootstrap/unix-48/vt100.c | 88 +++++----- bootstrap/unix-48/vt100.h | 34 ++-- bootstrap/unix-88/Console.c | 26 +-- bootstrap/unix-88/Console.h | 4 +- bootstrap/unix-88/Files.c | 158 +++++++++--------- bootstrap/unix-88/Files.h | 34 ++-- bootstrap/unix-88/Heap.c | 200 +++++++++++----------- bootstrap/unix-88/Heap.h | 10 +- bootstrap/unix-88/Modules.c | 12 +- bootstrap/unix-88/Modules.h | 8 +- bootstrap/unix-88/OPB.c | 164 +++++++++---------- bootstrap/unix-88/OPB.h | 20 +-- bootstrap/unix-88/OPC.c | 236 +++++++++++++------------- bootstrap/unix-88/OPC.h | 24 +-- bootstrap/unix-88/OPM.c | 156 +++++++++--------- bootstrap/unix-88/OPM.h | 34 ++-- bootstrap/unix-88/OPP.c | 86 +++++----- bootstrap/unix-88/OPS.c | 46 +++--- bootstrap/unix-88/OPS.h | 6 +- bootstrap/unix-88/OPT.c | 208 +++++++++++------------ bootstrap/unix-88/OPT.h | 32 ++-- bootstrap/unix-88/OPV.c | 110 ++++++------- bootstrap/unix-88/Platform.c | 262 ++++++++++++++--------------- bootstrap/unix-88/Platform.h | 94 +++++------ bootstrap/unix-88/Reals.c | 54 +++--- bootstrap/unix-88/Reals.h | 14 +- bootstrap/unix-88/SYSTEM.h | 104 ++++++++---- bootstrap/unix-88/Strings.c | 62 +++---- bootstrap/unix-88/Strings.h | 12 +- bootstrap/unix-88/Texts.c | 230 +++++++++++++------------- bootstrap/unix-88/Texts.h | 56 +++---- bootstrap/unix-88/Vishap.c | 4 +- bootstrap/unix-88/extTools.c | 2 +- bootstrap/unix-88/vt100.c | 88 +++++----- bootstrap/unix-88/vt100.h | 34 ++-- bootstrap/windows-48/Console.c | 26 +-- bootstrap/windows-48/Console.h | 4 +- bootstrap/windows-48/Files.c | 166 +++++++++---------- bootstrap/windows-48/Files.h | 34 ++-- bootstrap/windows-48/Heap.c | 200 +++++++++++----------- bootstrap/windows-48/Heap.h | 10 +- bootstrap/windows-48/Modules.c | 12 +- bootstrap/windows-48/Modules.h | 8 +- bootstrap/windows-48/OPB.c | 154 ++++++++--------- bootstrap/windows-48/OPB.h | 20 +-- bootstrap/windows-48/OPC.c | 236 +++++++++++++------------- bootstrap/windows-48/OPC.h | 24 +-- bootstrap/windows-48/OPM.c | 168 +++++++++---------- bootstrap/windows-48/OPM.h | 34 ++-- bootstrap/windows-48/OPP.c | 92 +++++------ bootstrap/windows-48/OPS.c | 44 ++--- bootstrap/windows-48/OPS.h | 6 +- bootstrap/windows-48/OPT.c | 216 ++++++++++++------------ bootstrap/windows-48/OPT.h | 32 ++-- bootstrap/windows-48/OPV.c | 110 ++++++------- bootstrap/windows-48/Platform.c | 282 ++++++++++++++++---------------- bootstrap/windows-48/Platform.h | 94 +++++------ bootstrap/windows-48/Reals.c | 64 ++++---- bootstrap/windows-48/Reals.h | 14 +- bootstrap/windows-48/SYSTEM.h | 104 ++++++++---- bootstrap/windows-48/Strings.c | 48 +++--- bootstrap/windows-48/Strings.h | 12 +- bootstrap/windows-48/Texts.c | 244 +++++++++++++-------------- bootstrap/windows-48/Texts.h | 56 +++---- bootstrap/windows-48/Vishap.c | 4 +- bootstrap/windows-48/extTools.c | 2 +- bootstrap/windows-48/vt100.c | 88 +++++----- bootstrap/windows-48/vt100.h | 34 ++-- bootstrap/windows-88/Console.c | 26 +-- bootstrap/windows-88/Console.h | 4 +- bootstrap/windows-88/Files.c | 158 +++++++++--------- bootstrap/windows-88/Files.h | 34 ++-- bootstrap/windows-88/Heap.c | 200 +++++++++++----------- bootstrap/windows-88/Heap.h | 10 +- bootstrap/windows-88/Modules.c | 12 +- bootstrap/windows-88/Modules.h | 8 +- bootstrap/windows-88/OPB.c | 164 +++++++++---------- bootstrap/windows-88/OPB.h | 20 +-- bootstrap/windows-88/OPC.c | 236 +++++++++++++------------- bootstrap/windows-88/OPC.h | 24 +-- bootstrap/windows-88/OPM.c | 156 +++++++++--------- bootstrap/windows-88/OPM.h | 34 ++-- bootstrap/windows-88/OPP.c | 86 +++++----- bootstrap/windows-88/OPS.c | 46 +++--- bootstrap/windows-88/OPS.h | 6 +- bootstrap/windows-88/OPT.c | 208 +++++++++++------------ bootstrap/windows-88/OPT.h | 32 ++-- bootstrap/windows-88/OPV.c | 110 ++++++------- bootstrap/windows-88/Platform.c | 282 ++++++++++++++++---------------- bootstrap/windows-88/Platform.h | 94 +++++------ bootstrap/windows-88/Reals.c | 54 +++--- bootstrap/windows-88/Reals.h | 14 +- bootstrap/windows-88/SYSTEM.h | 104 ++++++++---- bootstrap/windows-88/Strings.c | 62 +++---- bootstrap/windows-88/Strings.h | 12 +- bootstrap/windows-88/Texts.c | 230 +++++++++++++------------- bootstrap/windows-88/Texts.h | 56 +++---- bootstrap/windows-88/Vishap.c | 4 +- bootstrap/windows-88/extTools.c | 2 +- bootstrap/windows-88/vt100.c | 88 +++++----- bootstrap/windows-88/vt100.h | 34 ++-- src/compiler/OPC.Mod | 32 ++-- src/compiler/OPV.Mod | 8 +- src/system/SYSTEM.h | 104 ++++++++---- 168 files changed, 6673 insertions(+), 6565 deletions(-) diff --git a/bootstrap/unix-44/Console.c b/bootstrap/unix-44/Console.c index 816df1b9..8c9c6910 100644 --- a/bootstrap/unix-44/Console.c +++ b/bootstrap/unix-44/Console.c @@ -4,14 +4,14 @@ static CHAR Console_line[128]; -static INTEGER Console_pos; +static int16 Console_pos; export void Console_Bool (BOOLEAN b); export void Console_Char (CHAR ch); export void Console_Flush (void); -export void Console_Hex (LONGINT i); -export void Console_Int (LONGINT i, LONGINT n); +export void Console_Hex (int32 i); +export void Console_Int (int32 i, int32 n); export void Console_Ln (void); export void Console_Read (CHAR *ch); export void Console_ReadLine (CHAR *line, LONGINT line__len); @@ -20,7 +20,7 @@ export void Console_String (CHAR *s, LONGINT s__len); void Console_Flush (void) { - INTEGER error; + int16 error; error = Platform_Write(1, (SYSTEM_ADRINT)Console_line, Console_pos); Console_pos = 0; } @@ -39,7 +39,7 @@ void Console_Char (CHAR ch) void Console_String (CHAR *s, LONGINT s__len) { - INTEGER i; + int16 i; __DUP(s, s__len, CHAR); i = 0; while (s[__X(i, s__len)] != 0x00) { @@ -49,11 +49,11 @@ void Console_String (CHAR *s, LONGINT s__len) __DEL(s); } -void Console_Int (LONGINT i, LONGINT n) +void Console_Int (int32 i, int32 n) { CHAR s[32]; - LONGINT i1, k; - if (i == __LSHL(1, 31, LONGINT)) { + int32 i1, k; + if (i == __LSHL(1, 31, int32)) { __MOVE("8463847412", s, 11); k = 10; } else { @@ -95,9 +95,9 @@ void Console_Bool (BOOLEAN b) } } -void Console_Hex (LONGINT i) +void Console_Hex (int32 i) { - LONGINT k, n; + int32 k, n; k = -28; while (k <= 0) { n = __MASK(__ASH(i, k), -16); @@ -112,8 +112,8 @@ void Console_Hex (LONGINT i) void Console_Read (CHAR *ch) { - LONGINT n; - INTEGER error; + int32 n; + int16 error; Console_Flush(); error = Platform_ReadBuf(0, (void*)&*ch, 1, &n); if (n != 1) { @@ -123,7 +123,7 @@ void Console_Read (CHAR *ch) void Console_ReadLine (CHAR *line, LONGINT line__len) { - LONGINT i; + int32 i; CHAR ch; Console_Flush(); i = 0; diff --git a/bootstrap/unix-44/Console.h b/bootstrap/unix-44/Console.h index 2c01265d..16287a76 100644 --- a/bootstrap/unix-44/Console.h +++ b/bootstrap/unix-44/Console.h @@ -11,8 +11,8 @@ import void Console_Bool (BOOLEAN b); import void Console_Char (CHAR ch); import void Console_Flush (void); -import void Console_Hex (LONGINT i); -import void Console_Int (LONGINT i, LONGINT n); +import void Console_Hex (int32 i); +import void Console_Int (int32 i, int32 n); import void Console_Ln (void); import void Console_Read (CHAR *ch); import void Console_ReadLine (CHAR *line, LONGINT line__len); diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index bd3e3fd5..3c6594af 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -13,7 +13,7 @@ typedef struct Files_BufDesc { Files_File f; BOOLEAN chg; - LONGINT org, size; + int32 org, size; SYSTEM_BYTE data[4096]; } Files_BufDesc; @@ -28,23 +28,23 @@ typedef Files_FileName workName, registerName; BOOLEAN tempFile; Platform_FileIdentity identity; - LONGINT fd, len, pos; + int32 fd, len, pos; Files_Buffer bufs[4]; - INTEGER swapper, state; + int16 swapper, state; Files_File next; } Files_FileDesc; typedef struct Files_Rider { - LONGINT res; + int32 res; BOOLEAN eof; Files_Buffer buf; - LONGINT org, offset; + int32 org, offset; } Files_Rider; static Files_File Files_files; -static INTEGER Files_tempno; +static int16 Files_tempno; static CHAR Files_HOME[1024]; static struct { LONGINT len[1]; @@ -57,56 +57,56 @@ export LONGINT *Files_Rider__typ; export Files_File Files_Base (Files_Rider *r, LONGINT *r__typ); static Files_File Files_CacheEntry (Platform_FileIdentity identity); -export void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INTEGER *res); +export void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int16 *res); export void Files_Close (Files_File f); static void Files_CloseOSFile (Files_File f); static void Files_Create (Files_File f); -export void Files_Delete (CHAR *name, LONGINT name__len, INTEGER *res); -static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INTEGER errcode); +export void Files_Delete (CHAR *name, LONGINT name__len, int16 *res); +static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int16 errcode); static void Files_Finalize (SYSTEM_PTR o); static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *dest, LONGINT dest__len); static void Files_Flush (Files_Buffer buf); -export void Files_GetDate (Files_File f, LONGINT *t, LONGINT *d); +export void Files_GetDate (Files_File f, int32 *t, int32 *d); export void Files_GetName (Files_File f, CHAR *name, LONGINT name__len); static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *name, LONGINT name__len); static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len); -export LONGINT Files_Length (Files_File f); +export int32 Files_Length (Files_File f); static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT name__len, CHAR *dest, LONGINT dest__len); export Files_File Files_New (CHAR *name, LONGINT name__len); export Files_File Files_Old (CHAR *name, LONGINT name__len); -export LONGINT Files_Pos (Files_Rider *r, LONGINT *r__typ); +export int32 Files_Pos (Files_Rider *r, LONGINT *r__typ); export void Files_Purge (Files_File f); export void Files_Read (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x); export void Files_ReadBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN *x); export void Files_ReadByte (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len); -export void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, LONGINT n); -export void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, INTEGER *x); -export void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, LONGINT *x); +export void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); +export void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, int16 *x); +export void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, int32 *x); export void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x); export void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); -export void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, LONGINT *x); +export void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int32 *x); export void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x); export void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x); export void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); export void Files_Register (Files_File f); -export void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INTEGER *res); -static void Files_ScanPath (INTEGER *pos, CHAR *dir, LONGINT dir__len); -export void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, LONGINT pos); +export void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res); +static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len); +export void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, int32 pos); export void Files_SetSearchPath (CHAR *path, LONGINT path__len); export void Files_Write (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE x); export void Files_WriteBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN x); -export void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, LONGINT n); -export void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, INTEGER x); -export void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, LONGINT x); +export void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); +export void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, int16 x); +export void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, int32 x); export void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x); -export void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, LONGINT x); +export void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int32 x); export void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x); export void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x); export void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); #define Files_IdxTrap() __HALT(-1) -static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INTEGER errcode) +static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int16 errcode) { __DUP(s, s__len, CHAR); Console_Ln(); @@ -135,7 +135,7 @@ static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INTEGER errcode) static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT name__len, CHAR *dest, LONGINT dest__len) { - INTEGER i, j; + int16 i, j; __DUP(dir, dir__len, CHAR); __DUP(name, name__len, CHAR); i = 0; @@ -160,7 +160,7 @@ static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *name, LONGINT name__len) { - LONGINT n, i, j; + int32 n, i, j; __DUP(finalName, finalName__len, CHAR); Files_tempno += 1; n = Files_tempno; @@ -212,7 +212,7 @@ static void Files_Create (Files_File f) { Platform_FileIdentity identity; BOOLEAN done; - INTEGER error; + int16 error; CHAR err[32]; if (f->fd == -1) { if (f->state == 1) { @@ -249,7 +249,7 @@ static void Files_Create (Files_File f) static void Files_Flush (Files_Buffer buf) { - INTEGER error; + int16 error; Files_File f = NIL; if (buf->chg) { f = buf->f; @@ -273,7 +273,7 @@ static void Files_Flush (Files_Buffer buf) static void Files_CloseOSFile (Files_File f) { Files_File prev = NIL; - INTEGER error; + int16 error; if (Files_files == f) { Files_files = f->next; } else { @@ -293,8 +293,8 @@ static void Files_CloseOSFile (Files_File f) void Files_Close (Files_File f) { - LONGINT i; - INTEGER error; + int32 i; + int16 error; if (f->state != 1 || f->registerName[0] != 0x00) { Files_Create(f); i = 0; @@ -310,9 +310,9 @@ void Files_Close (Files_File f) } } -LONGINT Files_Length (Files_File f) +int32 Files_Length (Files_File f) { - LONGINT _o_result; + int32 _o_result; _o_result = f->len; return _o_result; } @@ -335,9 +335,9 @@ Files_File Files_New (CHAR *name, LONGINT name__len) return _o_result; } -static void Files_ScanPath (INTEGER *pos, CHAR *dir, LONGINT dir__len) +static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len) { - INTEGER i; + int16 i; CHAR ch; i = 0; if (Files_SearchPath == NIL) { @@ -381,7 +381,7 @@ static void Files_ScanPath (INTEGER *pos, CHAR *dir, LONGINT dir__len) static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len) { BOOLEAN _o_result; - INTEGER i; + int16 i; CHAR ch; i = 0; ch = name[0]; @@ -397,7 +397,7 @@ static Files_File Files_CacheEntry (Platform_FileIdentity identity) { Files_File _o_result; Files_File f = NIL; - INTEGER i, error; + int16 i, error; f = Files_files; while (f != NIL) { if (Platform_SameFile(identity, f->identity)) { @@ -427,11 +427,11 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) { Files_File _o_result; Files_File f = NIL; - LONGINT fd; - INTEGER pos; + int32 fd; + int16 pos; BOOLEAN done; CHAR dir[256], path[256]; - INTEGER error; + int16 error; Platform_FileIdentity identity; __DUP(name, name__len, CHAR); if (name[0] != 0x00) { @@ -506,9 +506,9 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) void Files_Purge (Files_File f) { - INTEGER i; + int16 i; Platform_FileIdentity identity; - INTEGER error; + int16 error; i = 0; while (i < 4) { if (f->bufs[i] != NIL) { @@ -528,27 +528,27 @@ void Files_Purge (Files_File f) Platform_SetMTime(&f->identity, Platform_FileIdentity__typ, identity); } -void Files_GetDate (Files_File f, LONGINT *t, LONGINT *d) +void Files_GetDate (Files_File f, int32 *t, int32 *d) { Platform_FileIdentity identity; - INTEGER error; + int16 error; Files_Create(f); error = Platform_Identify(f->fd, &identity, Platform_FileIdentity__typ); Platform_MTimeAsClock(identity, &*t, &*d); } -LONGINT Files_Pos (Files_Rider *r, LONGINT *r__typ) +int32 Files_Pos (Files_Rider *r, LONGINT *r__typ) { - LONGINT _o_result; + int32 _o_result; _o_result = (*r).org + (*r).offset; return _o_result; } -void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, LONGINT pos) +void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, int32 pos) { - LONGINT org, offset, i, n; + int32 org, offset, i, n; Files_Buffer buf = NIL; - INTEGER error; + int16 error; if (f != NIL) { if (pos > f->len) { pos = f->len; @@ -608,7 +608,7 @@ void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, LONGINT pos) void Files_Read (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x) { - LONGINT offset; + int32 offset; Files_Buffer buf = NIL; buf = (*r).buf; offset = (*r).offset; @@ -630,9 +630,9 @@ void Files_Read (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x) } } -void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, LONGINT n) +void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n) { - LONGINT xpos, min, restInBuf, offset; + int32 xpos, min, restInBuf, offset; Files_Buffer buf = NIL; if (n > x__len) { Files_IdxTrap(); @@ -681,7 +681,7 @@ Files_File Files_Base (Files_Rider *r, LONGINT *r__typ) void Files_Write (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE x) { Files_Buffer buf = NIL; - LONGINT offset; + int32 offset; buf = (*r).buf; offset = (*r).offset; if ((*r).org != buf->org || offset >= 4096) { @@ -699,9 +699,9 @@ void Files_Write (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE x) (*r).res = 0; } -void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, LONGINT n) +void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n) { - LONGINT xpos, min, restInBuf, offset; + int32 xpos, min, restInBuf, offset; Files_Buffer buf = NIL; if (n > x__len) { Files_IdxTrap(); @@ -735,17 +735,17 @@ void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT (*r).res = 0; } -void Files_Delete (CHAR *name, LONGINT name__len, INTEGER *res) +void Files_Delete (CHAR *name, LONGINT name__len, int16 *res) { __DUP(name, name__len, CHAR); *res = Platform_Unlink((void*)name, name__len); __DEL(name); } -void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INTEGER *res) +void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res) { - LONGINT fdold, fdnew, n; - INTEGER error, ignore; + int32 fdold, fdnew, n; + int16 error, ignore; Platform_FileIdentity oldidentity, newidentity; CHAR buf[4096]; __DUP(old, old__len, CHAR); @@ -800,7 +800,7 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT void Files_Register (Files_File f) { - INTEGER idx, errcode; + int16 idx, errcode; Files_File f1 = NIL; CHAR file[104]; if ((f->state == 1 && f->registerName[0] != 0x00)) { @@ -819,7 +819,7 @@ void Files_Register (Files_File f) } } -void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INTEGER *res) +void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int16 *res) { __DUP(path, path__len, CHAR); *res = Platform_Chdir((void*)path, path__len); @@ -828,7 +828,7 @@ void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INTEGER *res) static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *dest, LONGINT dest__len) { - LONGINT i, j; + int32 i, j; if (!Platform_LittleEndian) { i = src__len; j = 0; @@ -847,26 +847,26 @@ void Files_ReadBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN *x) Files_Read(&*R, R__typ, (CHAR*)(void*)&*x); } -void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, INTEGER *x) +void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, int16 *x) { CHAR b[2]; Files_ReadBytes(&*R, R__typ, (void*)b, 2, 2); - *x = (SYSTEM_INT16)b[0] + __ASHL((SYSTEM_INT16)b[1], 8); + *x = (int16)b[0] + __ASHL((int16)b[1], 8); } -void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, LONGINT *x) +void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, int32 *x) { CHAR b[4]; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); - *x = (((SYSTEM_INT16)b[0] + __ASHL((SYSTEM_INT16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); + *x = (((int16)b[0] + __ASHL((int16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); } void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x) { CHAR b[4]; - LONGINT l; + int32 l; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); - l = (((SYSTEM_INT16)b[0] + __ASHL((SYSTEM_INT16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); + l = (((int16)b[0] + __ASHL((int16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); *x = (SET)l; } @@ -886,7 +886,7 @@ void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x) void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) { - INTEGER i; + int16 i; CHAR ch; i = 0; do { @@ -898,7 +898,7 @@ void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) { - INTEGER i; + int16 i; CHAR ch; BOOLEAN b; i = 0; @@ -914,20 +914,20 @@ void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) } while (!b); } -void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, LONGINT *x) +void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int32 *x) { - SHORTINT s; + int8 s; CHAR ch; - LONGINT n; + int32 n; s = 0; n = 0; Files_Read(&*R, R__typ, (void*)&ch); - while ((SYSTEM_INT16)ch >= 128) { - n += __ASH(((SYSTEM_INT16)ch - 128), s); + while ((int16)ch >= 128) { + n += __ASH(((int16)ch - 128), s); s += 7; Files_Read(&*R, R__typ, (void*)&ch); } - n += __ASH((__MASK((SYSTEM_INT16)ch, -64) - __ASHL(__ASHR((SYSTEM_INT16)ch, 6), 6)), s); + n += __ASH((__MASK((int16)ch, -64) - __ASHL(__ASHR((int16)ch, 6), 6)), s); *x = n; } @@ -936,7 +936,7 @@ void Files_WriteBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN x) Files_Write(&*R, R__typ, __VAL(CHAR, x)); } -void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, INTEGER x) +void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, int16 x) { CHAR b[2]; b[0] = (CHAR)x; @@ -944,7 +944,7 @@ void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, INTEGER x) Files_WriteBytes(&*R, R__typ, (void*)b, 2, 2); } -void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, LONGINT x) +void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, int32 x) { CHAR b[4]; b[0] = (CHAR)x; @@ -957,8 +957,8 @@ void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, LONGINT x) void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x) { CHAR b[4]; - LONGINT i; - i = (LONGINT)x; + int32 i; + i = (int32)x; b[0] = (CHAR)i; b[1] = (CHAR)__ASHR(i, 8); b[2] = (CHAR)__ASHR(i, 16); @@ -982,7 +982,7 @@ void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x) void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) { - INTEGER i; + int16 i; i = 0; while (x[i] != 0x00) { i += 1; @@ -990,7 +990,7 @@ void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len Files_WriteBytes(&*R, R__typ, (void*)x, x__len * 1, i + 1); } -void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, LONGINT x) +void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int32 x) { while (x < -64 || x > 63) { Files_Write(&*R, R__typ, (CHAR)(__MASK(x, -128) + 128)); @@ -1007,7 +1007,7 @@ void Files_GetName (Files_File f, CHAR *name, LONGINT name__len) static void Files_Finalize (SYSTEM_PTR o) { Files_File f = NIL; - LONGINT res; + int32 res; f = (Files_File)(SYSTEM_ADRINT)o; if (f->fd >= 0) { Files_CloseOSFile(f); diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index 985572ec..d84672d4 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -11,13 +11,13 @@ typedef typedef struct Files_FileDesc { char _prvt0[216]; - LONGINT fd; + int32 fd; char _prvt1[32]; } Files_FileDesc; typedef struct Files_Rider { - LONGINT res; + int32 res; BOOLEAN eof; char _prvt0[15]; } Files_Rider; @@ -28,39 +28,39 @@ import LONGINT *Files_FileDesc__typ; import LONGINT *Files_Rider__typ; import Files_File Files_Base (Files_Rider *r, LONGINT *r__typ); -import void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INTEGER *res); +import void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int16 *res); import void Files_Close (Files_File f); -import void Files_Delete (CHAR *name, LONGINT name__len, INTEGER *res); -import void Files_GetDate (Files_File f, LONGINT *t, LONGINT *d); +import void Files_Delete (CHAR *name, LONGINT name__len, int16 *res); +import void Files_GetDate (Files_File f, int32 *t, int32 *d); import void Files_GetName (Files_File f, CHAR *name, LONGINT name__len); -import LONGINT Files_Length (Files_File f); +import int32 Files_Length (Files_File f); import Files_File Files_New (CHAR *name, LONGINT name__len); import Files_File Files_Old (CHAR *name, LONGINT name__len); -import LONGINT Files_Pos (Files_Rider *r, LONGINT *r__typ); +import int32 Files_Pos (Files_Rider *r, LONGINT *r__typ); import void Files_Purge (Files_File f); import void Files_Read (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x); import void Files_ReadBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN *x); import void Files_ReadByte (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len); -import void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, LONGINT n); -import void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, INTEGER *x); -import void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, LONGINT *x); +import void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); +import void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, int16 *x); +import void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, int32 *x); import void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x); import void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); -import void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, LONGINT *x); +import void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int32 *x); import void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x); import void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x); import void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); import void Files_Register (Files_File f); -import void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INTEGER *res); -import void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, LONGINT pos); +import void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res); +import void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, int32 pos); import void Files_SetSearchPath (CHAR *path, LONGINT path__len); import void Files_Write (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE x); import void Files_WriteBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN x); -import void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, LONGINT n); -import void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, INTEGER x); -import void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, LONGINT x); +import void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); +import void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, int16 x); +import void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, int32 x); import void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x); -import void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, LONGINT x); +import void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int32 x); import void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x); import void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x); import void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index 50d17d87..a252264a 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -34,7 +34,7 @@ typedef typedef struct Heap_FinDesc { Heap_FinNode next; - LONGINT obj; + int32 obj; BOOLEAN marked; Heap_Finalizer finalize; } Heap_FinDesc; @@ -49,25 +49,25 @@ typedef struct Heap_ModuleDesc { Heap_Module next; Heap_ModuleName name; - LONGINT refcnt; + int32 refcnt; Heap_Cmd cmds; - LONGINT types; + int32 types; Heap_EnumProc enumPtrs; - LONGINT reserved1, reserved2; + int32 reserved1, reserved2; } Heap_ModuleDesc; export SYSTEM_PTR Heap_modules; -static LONGINT Heap_freeList[10]; -static LONGINT Heap_bigBlocks; -export LONGINT Heap_allocated; +static int32 Heap_freeList[10]; +static int32 Heap_bigBlocks; +export int32 Heap_allocated; static BOOLEAN Heap_firstTry; -static LONGINT Heap_heap, Heap_heapend; -export LONGINT Heap_heapsize; +static int32 Heap_heap, Heap_heapend; +export int32 Heap_heapsize; static Heap_FinNode Heap_fin; -static INTEGER Heap_lockdepth; +static int16 Heap_lockdepth; static BOOLEAN Heap_interrupted; -export INTEGER Heap_FileCount; +export int16 Heap_FileCount; export LONGINT *Heap_ModuleDesc__typ; export LONGINT *Heap_CmdDesc__typ; @@ -75,27 +75,27 @@ export LONGINT *Heap_FinDesc__typ; export LONGINT *Heap__1__typ; static void Heap_CheckFin (void); -static void Heap_ExtendHeap (LONGINT blksz); +static void Heap_ExtendHeap (int32 blksz); export void Heap_FINALL (void); static void Heap_Finalize (void); export void Heap_GC (BOOLEAN markStack); -static void Heap_HeapSort (LONGINT n, LONGINT *a, LONGINT a__len); +static void Heap_HeapSort (int32 n, int32 *a, LONGINT a__len); export void Heap_INCREF (Heap_Module m); export void Heap_InitHeap (void); export void Heap_Lock (void); -static void Heap_Mark (LONGINT q); -static void Heap_MarkCandidates (LONGINT n, LONGINT *cand, LONGINT cand__len); +static void Heap_Mark (int32 q); +static void Heap_MarkCandidates (int32 n, int32 *cand, LONGINT cand__len); static void Heap_MarkP (SYSTEM_PTR p); -static void Heap_MarkStack (LONGINT n, LONGINT *cand, LONGINT cand__len); -export SYSTEM_PTR Heap_NEWBLK (LONGINT size); -export SYSTEM_PTR Heap_NEWREC (LONGINT tag); -static LONGINT Heap_NewChunk (LONGINT blksz); +static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len); +export SYSTEM_PTR Heap_NEWBLK (int32 size); +export SYSTEM_PTR Heap_NEWREC (int32 tag); +static int32 Heap_NewChunk (int32 blksz); export void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); export SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -export void Heap_REGTYP (Heap_Module m, LONGINT typ); +export void Heap_REGTYP (Heap_Module m, int32 typ); export void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); static void Heap_Scan (void); -static void Heap_Sift (LONGINT l, LONGINT r, LONGINT *a, LONGINT a__len); +static void Heap_Sift (int32 l, int32 r, int32 *a, LONGINT a__len); export void Heap_Unlock (void); extern void *Heap__init(); @@ -154,9 +154,9 @@ void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) m->cmds = c; } -void Heap_REGTYP (Heap_Module m, LONGINT typ) +void Heap_REGTYP (Heap_Module m, int32 typ) { - __PUT(typ, m->types, LONGINT); + __PUT(typ, m->types, int32); m->types = typ; } @@ -165,17 +165,17 @@ void Heap_INCREF (Heap_Module m) m->refcnt += 1; } -static LONGINT Heap_NewChunk (LONGINT blksz) +static int32 Heap_NewChunk (int32 blksz) { - LONGINT _o_result; - LONGINT chnk; + int32 _o_result; + int32 chnk; chnk = Heap_OSAllocate(blksz + 12); if (chnk != 0) { - __PUT(chnk + 4, chnk + (12 + blksz), LONGINT); - __PUT(chnk + 12, chnk + 16, LONGINT); - __PUT(chnk + 16, blksz, LONGINT); - __PUT(chnk + 20, -4, LONGINT); - __PUT(chnk + 24, Heap_bigBlocks, LONGINT); + __PUT(chnk + 4, chnk + (12 + blksz), int32); + __PUT(chnk + 12, chnk + 16, int32); + __PUT(chnk + 16, blksz, int32); + __PUT(chnk + 20, -4, int32); + __PUT(chnk + 24, Heap_bigBlocks, int32); Heap_bigBlocks = chnk + 12; Heap_heapsize += blksz; } @@ -183,9 +183,9 @@ static LONGINT Heap_NewChunk (LONGINT blksz) return _o_result; } -static void Heap_ExtendHeap (LONGINT blksz) +static void Heap_ExtendHeap (int32 blksz) { - LONGINT size, chnk, j, next; + int32 size, chnk, j, next; if (blksz > 160000) { size = blksz; } else { @@ -194,7 +194,7 @@ static void Heap_ExtendHeap (LONGINT blksz) chnk = Heap_NewChunk(size); if (chnk != 0) { if (chnk < Heap_heap) { - __PUT(chnk, Heap_heap, LONGINT); + __PUT(chnk, Heap_heap, int32); Heap_heap = chnk; } else { j = Heap_heap; @@ -203,8 +203,8 @@ static void Heap_ExtendHeap (LONGINT blksz) j = next; next = Heap_FetchAddress(j); } - __PUT(chnk, next, LONGINT); - __PUT(j, chnk, LONGINT); + __PUT(chnk, next, int32); + __PUT(j, chnk, int32); } if (next == 0) { Heap_heapend = Heap_FetchAddress(chnk + 4); @@ -212,10 +212,10 @@ static void Heap_ExtendHeap (LONGINT blksz) } } -SYSTEM_PTR Heap_NEWREC (LONGINT tag) +SYSTEM_PTR Heap_NEWREC (int32 tag) { SYSTEM_PTR _o_result; - LONGINT i, i0, di, blksz, restsize, t, adr, end, next, prev; + int32 i, i0, di, blksz, restsize, t, adr, end, next, prev; SYSTEM_PTR new; Heap_Lock(); blksz = Heap_FetchAddress(tag); @@ -235,11 +235,11 @@ SYSTEM_PTR Heap_NEWREC (LONGINT tag) di = i - i0; restsize = __ASHL(di, 4); end = adr + restsize; - __PUT(end + 4, blksz, LONGINT); - __PUT(end + 8, -4, LONGINT); - __PUT(end, end + 4, LONGINT); - __PUT(adr + 4, restsize, LONGINT); - __PUT(adr + 12, Heap_freeList[di], LONGINT); + __PUT(end + 4, blksz, int32); + __PUT(end + 8, -4, int32); + __PUT(end, end + 4, int32); + __PUT(adr + 4, restsize, int32); + __PUT(adr + 12, Heap_freeList[di], int32); Heap_freeList[di] = adr; adr += restsize; } @@ -279,22 +279,22 @@ SYSTEM_PTR Heap_NEWREC (LONGINT tag) } restsize = t - blksz; end = adr + restsize; - __PUT(end + 4, blksz, LONGINT); - __PUT(end + 8, -4, LONGINT); - __PUT(end, end + 4, LONGINT); + __PUT(end + 4, blksz, int32); + __PUT(end + 8, -4, int32); + __PUT(end, end + 4, int32); if (restsize > 144) { - __PUT(adr + 4, restsize, LONGINT); + __PUT(adr + 4, restsize, int32); } else { next = Heap_FetchAddress(adr + 12); if (prev == 0) { Heap_bigBlocks = next; } else { - __PUT(prev + 12, next, LONGINT); + __PUT(prev + 12, next, int32); } if (restsize > 0) { di = __ASHR(restsize, 4); - __PUT(adr + 4, restsize, LONGINT); - __PUT(adr + 12, Heap_freeList[di], LONGINT); + __PUT(adr + 4, restsize, int32); + __PUT(adr + 12, Heap_freeList[di], int32); Heap_freeList[di] = adr; } } @@ -303,53 +303,53 @@ SYSTEM_PTR Heap_NEWREC (LONGINT tag) i = adr + 16; end = adr + blksz; while (i < end) { - __PUT(i, 0, LONGINT); - __PUT(i + 4, 0, LONGINT); - __PUT(i + 8, 0, LONGINT); - __PUT(i + 12, 0, LONGINT); + __PUT(i, 0, int32); + __PUT(i + 4, 0, int32); + __PUT(i + 8, 0, int32); + __PUT(i + 12, 0, int32); i += 16; } - __PUT(adr + 12, 0, LONGINT); - __PUT(adr, tag, LONGINT); - __PUT(adr + 4, 0, LONGINT); - __PUT(adr + 8, 0, LONGINT); + __PUT(adr + 12, 0, int32); + __PUT(adr, tag, int32); + __PUT(adr + 4, 0, int32); + __PUT(adr + 8, 0, int32); Heap_allocated += blksz; Heap_Unlock(); _o_result = (SYSTEM_PTR)(SYSTEM_ADRINT)(adr + 4); return _o_result; } -SYSTEM_PTR Heap_NEWBLK (LONGINT size) +SYSTEM_PTR Heap_NEWBLK (int32 size) { SYSTEM_PTR _o_result; - LONGINT blksz, tag; + int32 blksz, tag; SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 31, 4), 4); new = Heap_NEWREC((SYSTEM_ADRINT)&blksz); - tag = ((LONGINT)(SYSTEM_ADRINT)new + blksz) - 12; - __PUT(tag - 4, 0, LONGINT); - __PUT(tag, blksz, LONGINT); - __PUT(tag + 4, -4, LONGINT); - __PUT((LONGINT)(SYSTEM_ADRINT)new - 4, tag, LONGINT); + tag = ((int32)(SYSTEM_ADRINT)new + blksz) - 12; + __PUT(tag - 4, 0, int32); + __PUT(tag, blksz, int32); + __PUT(tag + 4, -4, int32); + __PUT((int32)(SYSTEM_ADRINT)new - 4, tag, int32); Heap_Unlock(); _o_result = new; return _o_result; } -static void Heap_Mark (LONGINT q) +static void Heap_Mark (int32 q) { - LONGINT p, tag, fld, n, offset, tagbits; + int32 p, tag, fld, n, offset, tagbits; if (q != 0) { tagbits = Heap_FetchAddress(q - 4); if (!__ODD(tagbits)) { - __PUT(q - 4, tagbits + 1, LONGINT); + __PUT(q - 4, tagbits + 1, int32); p = 0; tag = tagbits + 4; for (;;) { - __GET(tag, offset, LONGINT); + __GET(tag, offset, int32); if (offset < 0) { - __PUT(q - 4, (tag + offset) + 1, LONGINT); + __PUT(q - 4, (tag + offset) + 1, int32); if (p == 0) { break; } @@ -357,7 +357,7 @@ static void Heap_Mark (LONGINT q) q = p; tag = Heap_FetchAddress(q - 4); tag -= 1; - __GET(tag, offset, LONGINT); + __GET(tag, offset, int32); fld = q + offset; p = Heap_FetchAddress(fld); __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)n, SYSTEM_PTR); @@ -367,8 +367,8 @@ static void Heap_Mark (LONGINT q) if (n != 0) { tagbits = Heap_FetchAddress(n - 4); if (!__ODD(tagbits)) { - __PUT(n - 4, tagbits + 1, LONGINT); - __PUT(q - 4, tag + 1, LONGINT); + __PUT(n - 4, tagbits + 1, int32); + __PUT(q - 4, tag + 1, int32); __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)p, SYSTEM_PTR); p = q; q = n; @@ -384,12 +384,12 @@ static void Heap_Mark (LONGINT q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((LONGINT)(SYSTEM_ADRINT)p); + Heap_Mark((int32)(SYSTEM_ADRINT)p); } static void Heap_Scan (void) { - LONGINT chnk, adr, end, start, tag, i, size, freesize; + int32 chnk, adr, end, start, tag, i, size, freesize; Heap_bigBlocks = 0; i = 1; while (i < 9) { @@ -407,21 +407,21 @@ static void Heap_Scan (void) if (__ODD(tag)) { if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 4, LONGINT); - __PUT(start + 4, freesize, LONGINT); - __PUT(start + 8, -4, LONGINT); + __PUT(start, start + 4, int32); + __PUT(start + 4, freesize, int32); + __PUT(start + 8, -4, int32); i = __ASHR(freesize, 4); freesize = 0; if (i < 9) { - __PUT(start + 12, Heap_freeList[i], LONGINT); + __PUT(start + 12, Heap_freeList[i], int32); Heap_freeList[i] = start; } else { - __PUT(start + 12, Heap_bigBlocks, LONGINT); + __PUT(start + 12, Heap_bigBlocks, int32); Heap_bigBlocks = start; } } tag -= 1; - __PUT(adr, tag, LONGINT); + __PUT(adr, tag, int32); size = Heap_FetchAddress(tag); Heap_allocated += size; adr += size; @@ -433,16 +433,16 @@ static void Heap_Scan (void) } if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 4, LONGINT); - __PUT(start + 4, freesize, LONGINT); - __PUT(start + 8, -4, LONGINT); + __PUT(start, start + 4, int32); + __PUT(start + 4, freesize, int32); + __PUT(start + 8, -4, int32); i = __ASHR(freesize, 4); freesize = 0; if (i < 9) { - __PUT(start + 12, Heap_freeList[i], LONGINT); + __PUT(start + 12, Heap_freeList[i], int32); Heap_freeList[i] = start; } else { - __PUT(start + 12, Heap_bigBlocks, LONGINT); + __PUT(start + 12, Heap_bigBlocks, int32); Heap_bigBlocks = start; } } @@ -450,9 +450,9 @@ static void Heap_Scan (void) } } -static void Heap_Sift (LONGINT l, LONGINT r, LONGINT *a, LONGINT a__len) +static void Heap_Sift (int32 l, int32 r, int32 *a, LONGINT a__len) { - LONGINT i, j, x; + int32 i, j, x; j = l; x = a[j]; for (;;) { @@ -469,9 +469,9 @@ static void Heap_Sift (LONGINT l, LONGINT r, LONGINT *a, LONGINT a__len) a[i] = x; } -static void Heap_HeapSort (LONGINT n, LONGINT *a, LONGINT a__len) +static void Heap_HeapSort (int32 n, int32 *a, LONGINT a__len) { - LONGINT l, r, x; + int32 l, r, x; l = __ASHR(n, 1); r = n - 1; while (l > 0) { @@ -487,9 +487,9 @@ static void Heap_HeapSort (LONGINT n, LONGINT *a, LONGINT a__len) } } -static void Heap_MarkCandidates (LONGINT n, LONGINT *cand, LONGINT cand__len) +static void Heap_MarkCandidates (int32 n, int32 *cand, LONGINT cand__len) { - LONGINT chnk, adr, tag, next, lim, lim1, i, ptr, size; + int32 chnk, adr, tag, next, lim, lim1, i, ptr, size; chnk = Heap_heap; i = 0; lim = cand[n - 1]; @@ -527,7 +527,7 @@ static void Heap_MarkCandidates (LONGINT n, LONGINT *cand, LONGINT cand__len) static void Heap_CheckFin (void) { Heap_FinNode n; - LONGINT tag; + int32 tag; n = Heap_fin; while (n != NIL) { tag = Heap_FetchAddress(n->obj - 4); @@ -576,10 +576,10 @@ void Heap_FINALL (void) } } -static void Heap_MarkStack (LONGINT n, LONGINT *cand, LONGINT cand__len) +static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len) { SYSTEM_PTR frame; - LONGINT inc, nofcand, sp, p, stack0; + int32 inc, nofcand, sp, p, stack0; struct Heap__1 align; if (n > 0) { Heap_MarkStack(n - 1, cand, cand__len); @@ -596,7 +596,7 @@ static void Heap_MarkStack (LONGINT n, LONGINT *cand, LONGINT cand__len) inc = -inc; } while (sp != stack0) { - __GET(sp, p, LONGINT); + __GET(sp, p, int32); if ((p > Heap_heap && p < Heap_heapend)) { if (nofcand == cand__len) { Heap_HeapSort(nofcand, (void*)cand, cand__len); @@ -618,8 +618,8 @@ static void Heap_MarkStack (LONGINT n, LONGINT *cand, LONGINT cand__len) void Heap_GC (BOOLEAN markStack) { Heap_Module m; - LONGINT i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; - LONGINT cand[10000]; + int32 i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; + int32 cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); m = (Heap_Module)(SYSTEM_ADRINT)Heap_modules; @@ -699,7 +699,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (LONGINT)(SYSTEM_ADRINT)obj; + f->obj = (int32)(SYSTEM_ADRINT)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; @@ -710,7 +710,7 @@ void Heap_InitHeap (void) { Heap_heap = Heap_NewChunk(128000); Heap_heapend = Heap_FetchAddress(Heap_heap + 4); - __PUT(Heap_heap, 0, LONGINT); + __PUT(Heap_heap, 0, int32); Heap_allocated = 0; Heap_firstTry = 1; Heap_freeList[9] = 1; diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index a4e30a5e..a89f18fc 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -31,8 +31,8 @@ typedef import SYSTEM_PTR Heap_modules; -import LONGINT Heap_allocated, Heap_heapsize; -import INTEGER Heap_FileCount; +import int32 Heap_allocated, Heap_heapsize; +import int16 Heap_FileCount; import LONGINT *Heap_ModuleDesc__typ; @@ -41,11 +41,11 @@ import void Heap_GC (BOOLEAN markStack); import void Heap_INCREF (Heap_Module m); import void Heap_InitHeap (void); import void Heap_Lock (void); -import SYSTEM_PTR Heap_NEWBLK (LONGINT size); -import SYSTEM_PTR Heap_NEWREC (LONGINT tag); +import SYSTEM_PTR Heap_NEWBLK (int32 size); +import SYSTEM_PTR Heap_NEWREC (int32 tag); import void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); import SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -import void Heap_REGTYP (Heap_Module m, LONGINT typ); +import void Heap_REGTYP (Heap_Module m, int32 typ); import void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); import void Heap_Unlock (void); import void *Heap__init(void); diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index 52abc5b8..7969f68f 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -26,15 +26,15 @@ typedef struct Modules_ModuleDesc { Modules_Module next; Modules_ModuleName name; - LONGINT refcnt; + int32 refcnt; Modules_Cmd cmds; - LONGINT types; - void (*enumPtrs)(void(*)(LONGINT)); - LONGINT reserved1, reserved2; + int32 types; + void (*enumPtrs)(void(*)(int32)); + int32 reserved1, reserved2; } Modules_ModuleDesc; -export INTEGER Modules_res; +export int16 Modules_res; export CHAR Modules_resMsg[256]; export Modules_ModuleName Modules_imported, Modules_importing; @@ -51,7 +51,7 @@ export Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len); static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len) { - INTEGER i, j; + int16 i, j; __DUP(b, b__len, CHAR); i = 0; while (a[__X(i, a__len)] != 0x00) { diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index 6bee52c7..8b271308 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -28,15 +28,15 @@ typedef struct Modules_ModuleDesc { Modules_Module next; Modules_ModuleName name; - LONGINT refcnt; + int32 refcnt; Modules_Cmd cmds; - LONGINT types; - void (*enumPtrs)(void(*)(LONGINT)); + int32 types; + void (*enumPtrs)(void(*)(int32)); char _prvt0[8]; } Modules_ModuleDesc; -import INTEGER Modules_res; +import int16 Modules_res; import CHAR Modules_resMsg[256]; import Modules_ModuleName Modules_imported, Modules_importing; diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index a3322969..bc74dd1d 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -6,13 +6,13 @@ export void (*OPB_typSize)(OPT_Struct); -static INTEGER OPB_exp; -static LONGINT OPB_maxExp; +static int16 OPB_exp; +static int32 OPB_maxExp; export void OPB_Assign (OPT_Node *x, OPT_Node y); -static void OPB_BindNodes (SHORTINT class, OPT_Struct typ, OPT_Node *x, OPT_Node y); -static LONGINT OPB_BoolToInt (BOOLEAN b); +static void OPB_BindNodes (int8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y); +static int32 OPB_BoolToInt (BOOLEAN b); export void OPB_Call (OPT_Node *x, OPT_Node apar, OPT_Object fp); static void OPB_CharToString (OPT_Node n); static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode); @@ -20,10 +20,10 @@ static void OPB_CheckLeaf (OPT_Node x, BOOLEAN dynArrToo); export void OPB_CheckParameters (OPT_Object fp, OPT_Object ap, BOOLEAN checkNames); static void OPB_CheckProc (OPT_Struct x, OPT_Object y); static void OPB_CheckPtr (OPT_Node x, OPT_Node y); -static void OPB_CheckRealType (INTEGER f, INTEGER nr, OPT_Const x); +static void OPB_CheckRealType (int16 f, int16 nr, OPT_Const x); static void OPB_CheckReceiver (OPT_Node *x, OPT_Object fp); -static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y); -export void OPB_Construct (SHORTINT class, OPT_Node *x, OPT_Node y); +static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y); +export void OPB_Construct (int8 class, OPT_Node *x, OPT_Node y); static void OPB_Convert (OPT_Node *x, OPT_Struct typ); export void OPB_DeRef (OPT_Node *x); static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpar); @@ -33,17 +33,17 @@ export void OPB_Field (OPT_Node *x, OPT_Object y); export void OPB_In (OPT_Node *x, OPT_Node y); export void OPB_Index (OPT_Node *x, OPT_Node y); export void OPB_Inittd (OPT_Node *inittd, OPT_Node *last, OPT_Struct typ); -static BOOLEAN OPB_IntToBool (LONGINT i); +static BOOLEAN OPB_IntToBool (int32 i); export void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y); -export void OPB_MOp (SHORTINT op, OPT_Node *x); +export void OPB_MOp (int8 op, OPT_Node *x); export OPT_Node OPB_NewBoolConst (BOOLEAN boolval); -export OPT_Node OPB_NewIntConst (LONGINT intval); +export OPT_Node OPB_NewIntConst (int32 intval); export OPT_Node OPB_NewLeaf (OPT_Object obj); export OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ); -export OPT_Node OPB_NewString (OPS_String str, LONGINT len); +export OPT_Node OPB_NewString (OPS_String str, int32 len); export OPT_Node OPB_Nil (void); static BOOLEAN OPB_NotVar (OPT_Node x); -export void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y); +export void OPB_Op (int8 op, OPT_Node *x, OPT_Node y); export void OPB_OptIf (OPT_Node *x); export void OPB_Param (OPT_Node ap, OPT_Object fp); export void OPB_PrepCall (OPT_Node *x, OPT_Object *fpar); @@ -51,17 +51,17 @@ export void OPB_Return (OPT_Node *x, OPT_Object proc); export void OPB_SetElem (OPT_Node *x); static void OPB_SetIntType (OPT_Node node); export void OPB_SetRange (OPT_Node *x, OPT_Node y); -export void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno); -export void OPB_StPar0 (OPT_Node *par0, INTEGER fctno); -export void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno); -export void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n); -export void OPB_StaticLink (SHORTINT dlev); +export void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno); +export void OPB_StPar0 (OPT_Node *par0, int16 fctno); +export void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno); +export void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n); +export void OPB_StaticLink (int8 dlev); export void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard); -static void OPB_err (INTEGER n); -static LONGINT OPB_log (LONGINT x); +static void OPB_err (int16 n); +static int32 OPB_log (int32 x); -static void OPB_err (INTEGER n) +static void OPB_err (int16 n) { OPM_err(n); } @@ -100,7 +100,7 @@ OPT_Node OPB_NewLeaf (OPT_Object obj) return _o_result; } -void OPB_Construct (SHORTINT class, OPT_Node *x, OPT_Node y) +void OPB_Construct (int8 class, OPT_Node *x, OPT_Node y) { OPT_Node node = NIL; node = OPT_NewNode(class); @@ -123,9 +123,9 @@ void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y) *last = y; } -static LONGINT OPB_BoolToInt (BOOLEAN b) +static int32 OPB_BoolToInt (BOOLEAN b) { - LONGINT _o_result; + int32 _o_result; if (b) { _o_result = 1; return _o_result; @@ -136,7 +136,7 @@ static LONGINT OPB_BoolToInt (BOOLEAN b) __RETCHK; } -static BOOLEAN OPB_IntToBool (LONGINT i) +static BOOLEAN OPB_IntToBool (int32 i) { BOOLEAN _o_result; if (i == 0) { @@ -222,8 +222,8 @@ OPT_Node OPB_EmptySet (void) static void OPB_SetIntType (OPT_Node node) { - INTEGER b; - LONGINT n; + int16 b; + int32 n; if (node->conval->intval >= 0) { n = node->conval->intval; } else { @@ -236,7 +236,7 @@ static void OPB_SetIntType (OPT_Node node) node->typ = OPT_IntType(b); } -OPT_Node OPB_NewIntConst (LONGINT intval) +OPT_Node OPB_NewIntConst (int32 intval) { OPT_Node _o_result; OPT_Node x = NIL; @@ -261,7 +261,7 @@ OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ) return _o_result; } -OPT_Node OPB_NewString (OPS_String str, LONGINT len) +OPT_Node OPB_NewString (OPS_String str, int32 len) { OPT_Node _o_result; OPT_Node x = NIL; @@ -293,7 +293,7 @@ static void OPB_CharToString (OPT_Node n) n->obj = NIL; } -static void OPB_BindNodes (SHORTINT class, OPT_Struct typ, OPT_Node *x, OPT_Node y) +static void OPB_BindNodes (int8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y) { OPT_Node node = NIL; node = OPT_NewNode(class); @@ -335,7 +335,7 @@ void OPB_DeRef (OPT_Node *x) void OPB_Index (OPT_Node *x, OPT_Node y) { - INTEGER f; + int16 f; OPT_Struct typ = NIL; f = y->typ->form; if ((*x)->class >= 7) { @@ -460,8 +460,8 @@ void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) void OPB_In (OPT_Node *x, OPT_Node y) { - INTEGER f; - LONGINT k; + int16 f; + int32 k; f = (*x)->typ->form; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); @@ -487,9 +487,9 @@ void OPB_In (OPT_Node *x, OPT_Node y) (*x)->typ = OPT_booltyp; } -static LONGINT OPB_log (LONGINT x) +static int32 OPB_log (int32 x) { - LONGINT _o_result; + int32 _o_result; OPB_exp = 0; if (x > 0) { while (!__ODD(x)) { @@ -501,7 +501,7 @@ static LONGINT OPB_log (LONGINT x) return _o_result; } -static void OPB_CheckRealType (INTEGER f, INTEGER nr, OPT_Const x) +static void OPB_CheckRealType (int16 f, int16 nr, OPT_Const x) { LONGREAL min, max, r; if (f == 5) { @@ -525,9 +525,9 @@ static struct MOp__28 { struct MOp__28 *lnk; } *MOp__28_s; -static OPT_Node NewOp__29 (SHORTINT op, OPT_Struct typ, OPT_Node z); +static OPT_Node NewOp__29 (int8 op, OPT_Struct typ, OPT_Node z); -static OPT_Node NewOp__29 (SHORTINT op, OPT_Struct typ, OPT_Node z) +static OPT_Node NewOp__29 (int8 op, OPT_Struct typ, OPT_Node z) { OPT_Node _o_result; OPT_Node node = NIL; @@ -539,9 +539,9 @@ static OPT_Node NewOp__29 (SHORTINT op, OPT_Struct typ, OPT_Node z) return _o_result; } -void OPB_MOp (SHORTINT op, OPT_Node *x) +void OPB_MOp (int8 op, OPT_Node *x) { - INTEGER f; + int16 f; OPT_Struct typ = NIL; OPT_Node z = NIL; struct MOp__28 _s; @@ -618,7 +618,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) case 22: if (f == 3) { if (z->class == 7) { - z->conval->intval = (SYSTEM_INT16)__CAP((CHAR)z->conval->intval); + z->conval->intval = (int16)__CAP((CHAR)z->conval->intval); z->obj = NIL; } else { z = NewOp__29(op, typ, z); @@ -678,7 +678,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) static void OPB_CheckPtr (OPT_Node x, OPT_Node y) { - INTEGER g; + int16 g; OPT_Struct p = NIL, q = NIL, t = NIL; g = y->typ->form; if (g == 11) { @@ -762,17 +762,17 @@ static void OPB_CheckProc (OPT_Struct x, OPT_Object y) static struct ConstOp__13 { OPT_Node *x; - INTEGER *f; + int16 *f; OPT_Const *xval, *yval; struct ConstOp__13 *lnk; } *ConstOp__13_s; -static INTEGER ConstCmp__14 (void); +static int16 ConstCmp__14 (void); -static INTEGER ConstCmp__14 (void) +static int16 ConstCmp__14 (void) { - INTEGER _o_result; - INTEGER res; + int16 _o_result; + int16 res; switch (*ConstOp__13_s->f) { case 0: res = 9; @@ -836,11 +836,11 @@ static INTEGER ConstCmp__14 (void) return _o_result; } -static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) +static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) { - INTEGER f, g; + int16 f, g; OPT_Const xval = NIL, yval = NIL; - LONGINT xv, yv; + int32 xv, yv; BOOLEAN temp; struct ConstOp__13 _s; _s.x = &x; @@ -1116,8 +1116,8 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) static void OPB_Convert (OPT_Node *x, OPT_Struct typ) { OPT_Node node = NIL; - INTEGER f, g; - LONGINT k; + int16 f, g; + int32 k; LONGREAL r; f = (*x)->typ->form; g = typ->form; @@ -1149,12 +1149,12 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) OPB_err(203); r = (LONGREAL)1; } - (*x)->conval->intval = (SYSTEM_INT32)__ENTIER(r); + (*x)->conval->intval = (int32)__ENTIER(r); OPB_SetIntType(*x); } } (*x)->obj = NIL; - } else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((SYSTEM_INT16)(*x)->left->typ->form < f || f > g))) { + } else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((int16)(*x)->left->typ->form < f || f > g))) { if ((*x)->left->typ == typ) { *x = (*x)->left; } @@ -1168,14 +1168,14 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) } static struct Op__38 { - INTEGER *f, *g; + int16 *f, *g; struct Op__38 *lnk; } *Op__38_s; -static void NewOp__39 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y); +static void NewOp__39 (int8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y); static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y); -static void NewOp__39 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y) +static void NewOp__39 (int8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y) { OPT_Node node = NIL; node = OPT_NewNode(12); @@ -1218,13 +1218,13 @@ static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) return _o_result; } -void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) +void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) { - INTEGER f, g; + int16 f, g; OPT_Node t = NIL, z = NIL; OPT_Struct typ = NIL; BOOLEAN do_; - LONGINT val; + int32 val; struct Op__38 _s; _s.f = &f; _s.g = &g; @@ -1495,7 +1495,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) void OPB_SetRange (OPT_Node *x, OPT_Node y) { - LONGINT k, l; + int32 k, l; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); } else if (((*x)->typ->form == 4 && y->typ->form == 4)) { @@ -1530,7 +1530,7 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y) void OPB_SetElem (OPT_Node *x) { - LONGINT k; + int32 k; if ((*x)->class == 8 || (*x)->class == 9) { OPB_err(126); } else if ((*x)->typ->form != 4) { @@ -1552,7 +1552,7 @@ void OPB_SetElem (OPT_Node *x) static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) { OPT_Struct y = NIL; - INTEGER f, g; + int16 f, g; OPT_Struct p = NIL, q = NIL; if (OPM_Verbose) { OPM_LogWLn(); @@ -1695,9 +1695,9 @@ static void OPB_CheckLeaf (OPT_Node x, BOOLEAN dynArrToo) { } -void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) +void OPB_StPar0 (OPT_Node *par0, int16 fctno) { - INTEGER f; + int16 f; OPT_Struct typ = NIL; OPT_Node x = NIL; x = *par0; @@ -2005,9 +2005,9 @@ static struct StPar1__52 { struct StPar1__52 *lnk; } *StPar1__52_s; -static OPT_Node NewOp__53 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right); +static OPT_Node NewOp__53 (int8 class, int8 subcl, OPT_Node left, OPT_Node right); -static OPT_Node NewOp__53 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right) +static OPT_Node NewOp__53 (int8 class, int8 subcl, OPT_Node left, OPT_Node right) { OPT_Node _o_result; OPT_Node node = NIL; @@ -2019,9 +2019,9 @@ static OPT_Node NewOp__53 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_No return _o_result; } -void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) +void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) { - INTEGER f, L; + int16 f, L; OPT_Struct typ = NIL; OPT_Node p = NIL, t = NIL; struct StPar1__52 _s; @@ -2063,7 +2063,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (!(f == 4) || x->class != 7) { OPB_err(69); } else if (x->typ->size == 1) { - L = (SYSTEM_INT16)x->conval->intval; + L = (int16)x->conval->intval; typ = p->typ; while ((L > 0 && __IN(typ->comp, 0x0c))) { typ = typ->BaseTyp; @@ -2259,10 +2259,10 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) StPar1__52_s = _s.lnk; } -void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n) +void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n) { OPT_Node node = NIL; - INTEGER f; + int16 f; OPT_Node p = NIL; p = *par0; f = x->typ->form; @@ -2304,9 +2304,9 @@ void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n) *par0 = p; } -void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno) +void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno) { - INTEGER dim; + int16 dim; OPT_Node x = NIL, p = NIL; p = *par0; if (fctno <= 19) { @@ -2370,7 +2370,7 @@ void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno) static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpar) { - INTEGER f; + int16 f; f = atyp->comp; ftyp = ftyp->BaseTyp; atyp = atyp->BaseTyp; @@ -2479,7 +2479,7 @@ void OPB_Param (OPT_Node ap, OPT_Object fp) } } -void OPB_StaticLink (SHORTINT dlev) +void OPB_StaticLink (int8 dlev) { OPT_Object scope = NIL; scope = OPT_topScope; @@ -2494,7 +2494,7 @@ void OPB_Call (OPT_Node *x, OPT_Node apar, OPT_Object fp) { OPT_Struct typ = NIL; OPT_Node p = NIL; - SHORTINT lev; + int8 lev; if ((*x)->class == 9) { typ = (*x)->typ; lev = (*x)->obj->mnolev; @@ -2554,7 +2554,7 @@ void OPB_Return (OPT_Node *x, OPT_Object proc) void OPB_Assign (OPT_Node *x, OPT_Node y) { OPT_Node z = NIL; - SHORTINT subcl; + int8 subcl; if ((*x)->class >= 7) { OPB_err(56); } diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index 97c4485c..a4ccc86e 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -14,7 +14,7 @@ import void (*OPB_typSize)(OPT_Struct); import void OPB_Assign (OPT_Node *x, OPT_Node y); import void OPB_Call (OPT_Node *x, OPT_Node apar, OPT_Object fp); import void OPB_CheckParameters (OPT_Object fp, OPT_Object ap, BOOLEAN checkNames); -import void OPB_Construct (SHORTINT class, OPT_Node *x, OPT_Node y); +import void OPB_Construct (int8 class, OPT_Node *x, OPT_Node y); import void OPB_DeRef (OPT_Node *x); import OPT_Node OPB_EmptySet (void); import void OPB_Enter (OPT_Node *procdec, OPT_Node stat, OPT_Object proc); @@ -23,25 +23,25 @@ import void OPB_In (OPT_Node *x, OPT_Node y); import void OPB_Index (OPT_Node *x, OPT_Node y); import void OPB_Inittd (OPT_Node *inittd, OPT_Node *last, OPT_Struct typ); import void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y); -import void OPB_MOp (SHORTINT op, OPT_Node *x); +import void OPB_MOp (int8 op, OPT_Node *x); import OPT_Node OPB_NewBoolConst (BOOLEAN boolval); -import OPT_Node OPB_NewIntConst (LONGINT intval); +import OPT_Node OPB_NewIntConst (int32 intval); import OPT_Node OPB_NewLeaf (OPT_Object obj); import OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ); -import OPT_Node OPB_NewString (OPS_String str, LONGINT len); +import OPT_Node OPB_NewString (OPS_String str, int32 len); import OPT_Node OPB_Nil (void); -import void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y); +import void OPB_Op (int8 op, OPT_Node *x, OPT_Node y); import void OPB_OptIf (OPT_Node *x); import void OPB_Param (OPT_Node ap, OPT_Object fp); import void OPB_PrepCall (OPT_Node *x, OPT_Object *fpar); import void OPB_Return (OPT_Node *x, OPT_Object proc); import void OPB_SetElem (OPT_Node *x); import void OPB_SetRange (OPT_Node *x, OPT_Node y); -import void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno); -import void OPB_StPar0 (OPT_Node *par0, INTEGER fctno); -import void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno); -import void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n); -import void OPB_StaticLink (SHORTINT dlev); +import void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno); +import void OPB_StPar0 (OPT_Node *par0, int16 fctno); +import void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno); +import void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n); +import void OPB_StaticLink (int8 dlev); import void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard); import void *OPB__init(void); diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 9f818a4a..08469d42 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -5,27 +5,27 @@ #include "OPT.h" -static INTEGER OPC_indentLevel; +static int16 OPC_indentLevel; static BOOLEAN OPC_ptrinit, OPC_mainprog, OPC_ansi; -static SHORTINT OPC_hashtab[105]; -static CHAR OPC_keytab[36][9]; +static int8 OPC_hashtab[105]; +static CHAR OPC_keytab[50][9]; static BOOLEAN OPC_GlbPtrs; static CHAR OPC_BodyNameExt[13]; -export void OPC_Align (LONGINT *adr, LONGINT base); +export void OPC_Align (int32 *adr, int32 base); export void OPC_Andent (OPT_Struct typ); static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames); -export LONGINT OPC_BaseAlignment (OPT_Struct typ); +export int32 OPC_BaseAlignment (OPT_Struct typ); export OPT_Object OPC_BaseTProc (OPT_Object obj); export void OPC_BegBlk (void); export void OPC_BegStat (void); -static void OPC_CProcDefs (OPT_Object obj, INTEGER vis); -export void OPC_Case (LONGINT caseVal, INTEGER form); -static void OPC_CharacterLiteral (LONGINT c); -export void OPC_Cmp (INTEGER rel); +static void OPC_CProcDefs (OPT_Object obj, int16 vis); +export void OPC_Case (int32 caseVal, int16 form); +static void OPC_CharacterLiteral (int32 c); +export void OPC_Cmp (int16 rel); export void OPC_CompleteIdent (OPT_Object obj); -export void OPC_Constant (OPT_Const con, INTEGER form); +export void OPC_Constant (OPT_Const con, int16 form); static void OPC_DeclareBase (OPT_Object dcl); static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef); static void OPC_DeclareParams (OPT_Object par, BOOLEAN macro); @@ -42,45 +42,45 @@ export void OPC_EnterBody (void); export void OPC_EnterProc (OPT_Object proc); export void OPC_ExitBody (void); export void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet); -static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, LONGINT *off, LONGINT *n, LONGINT *curAlign); -static void OPC_FillGap (LONGINT gap, LONGINT off, LONGINT align, LONGINT *n, LONGINT *curAlign); +static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, int32 *off, int32 *n, int32 *curAlign); +static void OPC_FillGap (int32 gap, int32 off, int32 align, int32 *n, int32 *curAlign); export void OPC_GenBdy (OPT_Node n); -static void OPC_GenDynTypes (OPT_Node n, INTEGER vis); +static void OPC_GenDynTypes (OPT_Node n, int16 vis); export void OPC_GenEnumPtrs (OPT_Object var); export void OPC_GenHdr (OPT_Node n); export void OPC_GenHdrIncludes (void); static void OPC_GenHeaderMsg (void); -export void OPC_Halt (LONGINT n); +export void OPC_Halt (int32 n); export void OPC_Ident (OPT_Object obj); -static void OPC_IdentList (OPT_Object obj, INTEGER vis); +static void OPC_IdentList (OPT_Object obj, int16 vis); static void OPC_Include (CHAR *name, LONGINT name__len); -static void OPC_IncludeImports (OPT_Object obj, INTEGER vis); +static void OPC_IncludeImports (OPT_Object obj, int16 vis); export void OPC_Increment (BOOLEAN decrement); -export void OPC_Indent (INTEGER count); +export void OPC_Indent (int16 count); export void OPC_Init (void); static void OPC_InitImports (OPT_Object obj); static void OPC_InitKeywords (void); export void OPC_InitTDesc (OPT_Struct typ); static void OPC_InitTProcs (OPT_Object typ, OPT_Object obj); -export void OPC_IntLiteral (LONGINT n, LONGINT size); -export void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim); +export void OPC_IntLiteral (int32 n, int32 size); +export void OPC_Len (OPT_Object obj, OPT_Struct array, int32 dim); static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName); -static INTEGER OPC_Length (CHAR *s, LONGINT s__len); -export LONGINT OPC_NofPtrs (OPT_Struct typ); -static INTEGER OPC_PerfectHash (CHAR *s, LONGINT s__len); +static int16 OPC_Length (CHAR *s, LONGINT s__len); +export int32 OPC_NofPtrs (OPT_Struct typ); +static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len); static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len); static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define); -static void OPC_ProcPredefs (OPT_Object obj, SHORTINT vis); +static void OPC_ProcPredefs (OPT_Object obj, int8 vis); static void OPC_PutBase (OPT_Struct typ); -static void OPC_PutPtrOffsets (OPT_Struct typ, LONGINT adr, LONGINT *cnt); +static void OPC_PutPtrOffsets (OPT_Struct typ, int32 adr, int32 *cnt); static void OPC_RegCmds (OPT_Object obj); export void OPC_SetInclude (BOOLEAN exclude); -export LONGINT OPC_SizeAlignment (LONGINT size); +export int32 OPC_SizeAlignment (int32 size); static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause); -static void OPC_Str1 (CHAR *s, LONGINT s__len, LONGINT x); -static void OPC_StringLiteral (CHAR *s, LONGINT s__len, LONGINT l); +static void OPC_Str1 (CHAR *s, LONGINT s__len, int32 x); +static void OPC_StringLiteral (CHAR *s, LONGINT s__len, int32 l); export void OPC_TDescDecl (OPT_Struct typ); -export void OPC_TypeDefs (OPT_Object obj, INTEGER vis); +export void OPC_TypeDefs (OPT_Object obj, int16 vis); export void OPC_TypeOf (OPT_Object ap); static BOOLEAN OPC_Undefined (OPT_Object obj); @@ -98,14 +98,14 @@ void OPC_Init (void) } } -void OPC_Indent (INTEGER count) +void OPC_Indent (int16 count) { OPC_indentLevel += count; } void OPC_BegStat (void) { - INTEGER i; + int16 i; i = OPC_indentLevel; while (i > 0) { OPM_Write(0x09); @@ -141,10 +141,10 @@ void OPC_EndBlk0 (void) OPM_Write('}'); } -static void OPC_Str1 (CHAR *s, LONGINT s__len, LONGINT x) +static void OPC_Str1 (CHAR *s, LONGINT s__len, int32 x) { CHAR ch; - INTEGER i; + int16 i; __DUP(s, s__len, CHAR); ch = s[0]; i = 0; @@ -160,10 +160,10 @@ static void OPC_Str1 (CHAR *s, LONGINT s__len, LONGINT x) __DEL(s); } -static INTEGER OPC_Length (CHAR *s, LONGINT s__len) +static int16 OPC_Length (CHAR *s, LONGINT s__len) { - INTEGER _o_result; - INTEGER i; + int16 _o_result; + int16 i; i = 0; while (s[__X(i, s__len)] != 0x00) { i += 1; @@ -172,14 +172,14 @@ static INTEGER OPC_Length (CHAR *s, LONGINT s__len) return _o_result; } -static INTEGER OPC_PerfectHash (CHAR *s, LONGINT s__len) +static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len) { - INTEGER _o_result; - INTEGER i, h; + int16 _o_result; + int16 i, h; i = 0; h = 0; while ((s[__X(i, s__len)] != 0x00 && i < 5)) { - h = 3 * h + (SYSTEM_INT16)s[__X(i, s__len)]; + h = 3 * h + (int16)s[__X(i, s__len)]; i += 1; } _o_result = (int)__MOD(h, 105); @@ -188,17 +188,20 @@ static INTEGER OPC_PerfectHash (CHAR *s, LONGINT s__len) void OPC_Ident (OPT_Object obj) { - INTEGER mode, level, h; + int16 mode, level, h; mode = obj->mode; level = obj->mnolev; if ((__IN(mode, 0x62) && level > 0) || __IN(mode, 0x14)) { OPM_WriteStringVar((void*)obj->name, 256); h = OPC_PerfectHash((void*)obj->name, 256); if (OPC_hashtab[__X(h, 105)] >= 0) { - if (__STRCMP(OPC_keytab[__X(OPC_hashtab[__X(h, 105)], 36)], obj->name) == 0) { + if (__STRCMP(OPC_keytab[__X(OPC_hashtab[__X(h, 105)], 50)], obj->name) == 0) { OPM_Write('_'); } } + } else if ((mode == 5 && obj->typ->form == 4)) { + OPM_WriteString((CHAR*)"int", 4); + OPM_WriteInt(__ASHL(obj->typ->size, 3)); } else { if (mode != 5 || obj->linkadr != 2) { if (mode == 13) { @@ -212,7 +215,7 @@ void OPC_Ident (OPT_Object obj) OPM_WriteStringVar((void*)OPM_modName, 32); } OPM_Write('_'); - } else if ((((((obj == OPT_sysptrtyp->strobj || obj == OPT_ainttyp->strobj) || obj == OPT_int8typ->strobj) || obj == OPT_int16typ->strobj) || obj == OPT_int32typ->strobj) || obj == OPT_int64typ->strobj) || obj == OPT_bytetyp->strobj) { + } else if ((obj == OPT_sysptrtyp->strobj || obj == OPT_ainttyp->strobj) || obj == OPT_bytetyp->strobj) { OPM_WriteString((CHAR*)"SYSTEM_", 8); } OPM_WriteStringVar((void*)obj->name, 256); @@ -221,7 +224,7 @@ void OPC_Ident (OPT_Object obj) static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause) { - INTEGER pointers; + int16 pointers; *openClause = 0; if (((typ->strobj == NIL || typ->strobj->name[0] == 0x00) && typ->comp != 4)) { if (__IN(typ->comp, 0x0c)) { @@ -257,7 +260,7 @@ static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef) { OPT_Struct typ = NIL; BOOLEAN varPar, openClause; - INTEGER form, comp; + int16 form, comp; typ = dcl->typ; varPar = ((dcl->mode == 2 && typ->comp != 2) || typ->comp == 3) || scopeDef; OPC_Stars(typ, &openClause); @@ -327,8 +330,8 @@ static void OPC_DeclareBase (OPT_Object dcl) { OPT_Struct typ = NIL, prev = NIL; OPT_Object obj = NIL; - INTEGER nofdims; - LONGINT off, n, dummy; + int16 nofdims; + int32 off, n, dummy; typ = dcl->typ; prev = typ; while ((((((((typ->strobj == NIL || typ->comp == 3) || OPC_Undefined(typ->strobj)) && typ->comp != 4)) && typ->form != 10)) && !((typ->form == 11 && typ->BaseTyp->comp == 3)))) { @@ -387,12 +390,12 @@ static void OPC_DeclareBase (OPT_Object dcl) } } -LONGINT OPC_NofPtrs (OPT_Struct typ) +int32 OPC_NofPtrs (OPT_Struct typ) { - LONGINT _o_result; + int32 _o_result; OPT_Object fld = NIL; OPT_Struct btyp = NIL; - LONGINT n; + int32 n; if ((typ->form == 11 && typ->sysflag == 0)) { _o_result = 1; return _o_result; @@ -430,11 +433,11 @@ LONGINT OPC_NofPtrs (OPT_Struct typ) __RETCHK; } -static void OPC_PutPtrOffsets (OPT_Struct typ, LONGINT adr, LONGINT *cnt) +static void OPC_PutPtrOffsets (OPT_Struct typ, int32 adr, int32 *cnt) { OPT_Object fld = NIL; OPT_Struct btyp = NIL; - LONGINT n, i; + int32 n, i; if ((typ->form == 11 && typ->sysflag == 0)) { OPM_WriteInt(adr); OPM_WriteString((CHAR*)", ", 3); @@ -510,7 +513,7 @@ static void OPC_PutBase (OPT_Struct typ) static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName) { OPT_Struct typ = NIL; - INTEGER dim; + int16 dim; if (showParamName) { OPC_Ident(par); OPM_WriteString((CHAR*)"__len", 6); @@ -610,7 +613,7 @@ OPT_Object OPC_BaseTProc (OPT_Object obj) { OPT_Object _o_result; OPT_Struct typ = NIL, base = NIL; - LONGINT mno; + int32 mno; typ = obj->link->typ; if (typ->form == 11) { typ = typ->BaseTyp; @@ -739,7 +742,7 @@ static void OPC_DefineType (OPT_Struct str) static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len) { BOOLEAN _o_result; - INTEGER i; + int16 i; BOOLEAN r; __DUP(y, y__len, CHAR); i = 0; @@ -752,14 +755,14 @@ static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len) return _o_result; } -static void OPC_CProcDefs (OPT_Object obj, INTEGER vis) +static void OPC_CProcDefs (OPT_Object obj, int16 vis) { - INTEGER i; + int16 i; OPT_ConstExt ext = NIL; - INTEGER _for__9; + int16 _for__9; if (obj != NIL) { OPC_CProcDefs(obj->left, vis); - if ((((obj->mode == 9 && (SYSTEM_INT16)obj->vis >= vis)) && obj->adr == 1)) { + if ((((obj->mode == 9 && (int16)obj->vis >= vis)) && obj->adr == 1)) { ext = obj->conval->ext; i = 1; if (((*ext)[1] != '#' && !(OPC_Prefixed(ext, (CHAR*)"extern ", 8) || OPC_Prefixed(ext, (CHAR*)"import ", 8)))) { @@ -768,7 +771,7 @@ static void OPC_CProcDefs (OPT_Object obj, INTEGER vis) OPC_DeclareParams(obj->link, 1); OPM_Write(0x09); } - _for__9 = (SYSTEM_INT16)(*obj->conval->ext)[0]; + _for__9 = (int16)(*obj->conval->ext)[0]; i = i; while (i <= _for__9) { OPM_Write((*obj->conval->ext)[__X(i, 256)]); @@ -780,7 +783,7 @@ static void OPC_CProcDefs (OPT_Object obj, INTEGER vis) } } -void OPC_TypeDefs (OPT_Object obj, INTEGER vis) +void OPC_TypeDefs (OPT_Object obj, int16 vis) { if (obj != NIL) { OPC_TypeDefs(obj->left, vis); @@ -812,7 +815,7 @@ static void OPC_DefAnonRecs (OPT_Node n) void OPC_TDescDecl (OPT_Struct typ) { - LONGINT nofptrs; + int32 nofptrs; OPT_Object o = NIL; OPC_BegStat(); OPM_WriteString((CHAR*)"__TDESC(", 9); @@ -849,7 +852,7 @@ void OPC_InitTDesc (OPT_Struct typ) } } -void OPC_Align (LONGINT *adr, LONGINT base) +void OPC_Align (int32 *adr, int32 base) { switch (base) { case 2: @@ -869,10 +872,10 @@ void OPC_Align (LONGINT *adr, LONGINT base) } } -LONGINT OPC_SizeAlignment (LONGINT size) +int32 OPC_SizeAlignment (int32 size) { - LONGINT _o_result; - LONGINT alignment; + int32 _o_result; + int32 alignment; if (size < OPM_Alignment) { alignment = 1; while (alignment < size) { @@ -885,10 +888,10 @@ LONGINT OPC_SizeAlignment (LONGINT size) return _o_result; } -LONGINT OPC_BaseAlignment (OPT_Struct typ) +int32 OPC_BaseAlignment (OPT_Struct typ) { - LONGINT _o_result; - LONGINT alignment; + int32 _o_result; + int32 alignment; if (typ->form == 13) { if (typ->comp == 4) { alignment = __MASK(typ->align, -65536); @@ -902,9 +905,9 @@ LONGINT OPC_BaseAlignment (OPT_Struct typ) return _o_result; } -static void OPC_FillGap (LONGINT gap, LONGINT off, LONGINT align, LONGINT *n, LONGINT *curAlign) +static void OPC_FillGap (int32 gap, int32 off, int32 align, int32 *n, int32 *curAlign) { - LONGINT adr; + int32 adr; adr = off; OPC_Align(&adr, align); if ((*curAlign < align && gap - (adr - off) >= align)) { @@ -931,11 +934,11 @@ static void OPC_FillGap (LONGINT gap, LONGINT off, LONGINT align, LONGINT *n, LO } } -static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, LONGINT *off, LONGINT *n, LONGINT *curAlign) +static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, int32 *off, int32 *n, int32 *curAlign) { OPT_Object fld = NIL; OPT_Struct base = NIL; - LONGINT gap, adr, align, fldAlign; + int32 gap, adr, align, fldAlign; fld = typ->link; align = __MASK(typ->align, -65536); if (typ->BaseTyp != NIL) { @@ -991,16 +994,16 @@ static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, LONGINT *off, LONGINT * } } -static void OPC_IdentList (OPT_Object obj, INTEGER vis) +static void OPC_IdentList (OPT_Object obj, int16 vis) { OPT_Struct base = NIL; BOOLEAN first; - INTEGER lastvis; + int16 lastvis; base = NIL; first = 1; while ((obj != NIL && obj->mode != 13)) { if ((__IN(vis, 0x05) || (vis == 1 && obj->vis != 0)) || (vis == 3 && !obj->leaf)) { - if (obj->typ != base || (SYSTEM_INT16)obj->vis != lastvis) { + if (obj->typ != base || (int16)obj->vis != lastvis) { if (!first) { OPC_EndStat(); } @@ -1120,7 +1123,7 @@ static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define) } } -static void OPC_ProcPredefs (OPT_Object obj, SHORTINT vis) +static void OPC_ProcPredefs (OPT_Object obj, int8 vis) { if (obj != NIL) { OPC_ProcPredefs(obj->left, vis); @@ -1150,18 +1153,18 @@ static void OPC_Include (CHAR *name, LONGINT name__len) __DEL(name); } -static void OPC_IncludeImports (OPT_Object obj, INTEGER vis) +static void OPC_IncludeImports (OPT_Object obj, int16 vis) { if (obj != NIL) { OPC_IncludeImports(obj->left, vis); - if ((((obj->mode == 11 && obj->mnolev != 0)) && (SYSTEM_INT16)OPT_GlbMod[__X(-obj->mnolev, 64)]->vis >= vis)) { + if ((((obj->mode == 11 && obj->mnolev != 0)) && (int16)OPT_GlbMod[__X(-obj->mnolev, 64)]->vis >= vis)) { OPC_Include(OPT_GlbMod[__X(-obj->mnolev, 64)]->name, 256); } OPC_IncludeImports(obj->right, vis); } } -static void OPC_GenDynTypes (OPT_Node n, INTEGER vis) +static void OPC_GenDynTypes (OPT_Node n, int16 vis) { OPT_Struct typ = NIL; while ((n != NIL && n->class == 14)) { @@ -1209,7 +1212,7 @@ void OPC_GenHdr (OPT_Node n) static void OPC_GenHeaderMsg (void) { - INTEGER i; + int16 i; OPM_WriteString((CHAR*)"/* ", 4); OPM_WriteString((CHAR*)"voc", 4); OPM_Write(' '); @@ -1360,7 +1363,7 @@ static void OPC_InitImports (OPT_Object obj) void OPC_GenEnumPtrs (OPT_Object var) { OPT_Struct typ = NIL; - LONGINT n; + int32 n; OPC_GlbPtrs = 0; while (var != NIL) { typ = var->typ; @@ -1521,7 +1524,7 @@ void OPC_EnterProc (OPT_Object proc) { OPT_Object var = NIL, scope = NIL; OPT_Struct typ = NIL; - INTEGER dim; + int16 dim; if (proc->vis != 1) { OPM_WriteString((CHAR*)"static ", 8); } @@ -1750,7 +1753,7 @@ void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet) void OPC_CompleteIdent (OPT_Object obj) { - INTEGER comp, level; + int16 comp, level; level = obj->mnolev; if (obj->adr == 1) { if (obj->typ->comp == 4) { @@ -1779,10 +1782,10 @@ void OPC_CompleteIdent (OPT_Object obj) void OPC_TypeOf (OPT_Object ap) { - INTEGER i; + int16 i; __ASSERT(ap->typ->comp == 4, 0); if (ap->mode == 2) { - if ((SYSTEM_INT16)ap->mnolev != OPM_level) { + if ((int16)ap->mnolev != OPM_level) { OPM_WriteStringVar((void*)ap->scope->name, 256); OPM_WriteString((CHAR*)"_s->", 5); OPC_Ident(ap); @@ -1798,7 +1801,7 @@ void OPC_TypeOf (OPT_Object ap) } } -void OPC_Cmp (INTEGER rel) +void OPC_Cmp (int16 rel) { switch (rel) { case 9: @@ -1827,7 +1830,7 @@ void OPC_Cmp (INTEGER rel) } } -static void OPC_CharacterLiteral (LONGINT c) +static void OPC_CharacterLiteral (int32 c) { if (c < 32 || c > 126) { OPM_WriteString((CHAR*)"0x", 3); @@ -1842,15 +1845,15 @@ static void OPC_CharacterLiteral (LONGINT c) } } -static void OPC_StringLiteral (CHAR *s, LONGINT s__len, LONGINT l) +static void OPC_StringLiteral (CHAR *s, LONGINT s__len, int32 l) { - LONGINT i; - INTEGER c; + int32 i; + int16 c; __DUP(s, s__len, CHAR); OPM_Write('"'); i = 0; while (i < l) { - c = (SYSTEM_INT16)s[__X(i, s__len)]; + c = (int16)s[__X(i, s__len)]; if (c < 32 || c > 126) { OPM_Write('\\'); OPM_Write((CHAR)(48 + __ASHR(c, 6))); @@ -1870,7 +1873,7 @@ static void OPC_StringLiteral (CHAR *s, LONGINT s__len, LONGINT l) __DEL(s); } -void OPC_Case (LONGINT caseVal, INTEGER form) +void OPC_Case (int32 caseVal, int16 form) { CHAR ch; OPM_WriteString((CHAR*)"case ", 6); @@ -1908,30 +1911,17 @@ void OPC_Increment (BOOLEAN decrement) } } -void OPC_Halt (LONGINT n) +void OPC_Halt (int32 n) { OPC_Str1((CHAR*)"__HALT(#)", 10, n); } -void OPC_IntLiteral (LONGINT n, LONGINT size) +void OPC_IntLiteral (int32 n, int32 size) { if ((((size > 4 && n <= 2147483647)) && n > (-2147483647-1))) { - switch (size) { - case 2: - OPM_WriteString((CHAR*)"((SYSTEM_INT16)(", 17); - break; - case 4: - OPM_WriteString((CHAR*)"((SYSTEM_INT32)(", 17); - break; - case 8: - OPM_WriteString((CHAR*)"((SYSTEM_INT64)(", 17); - break; - default: - OPM_LogWStr((CHAR*)"Unhandled case in OPC.IntLiteral, size = ", 42); - OPM_LogWNum(size, 1); - OPM_LogWLn(); - break; - } + OPM_WriteString((CHAR*)"((int", 6); + OPM_WriteInt(__ASHL(size, 3)); + OPM_WriteString((CHAR*)")(", 3); OPM_WriteInt(n); OPM_WriteString((CHAR*)"))", 3); } else { @@ -1939,7 +1929,7 @@ void OPC_IntLiteral (LONGINT n, LONGINT size) } } -void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim) +void OPC_Len (OPT_Object obj, OPT_Struct array, int32 dim) { if (array->comp == 3) { OPC_CompleteIdent(obj); @@ -1960,11 +1950,11 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim) } } -void OPC_Constant (OPT_Const con, INTEGER form) +void OPC_Constant (OPT_Const con, int16 form) { - INTEGER i; + int16 i; SET s; - LONGINT hex; + int32 hex; BOOLEAN skipLeading; switch (form) { case 1: @@ -2023,7 +2013,7 @@ void OPC_Constant (OPT_Const con, INTEGER form) } static struct InitKeywords__48 { - SHORTINT *n; + int8 *n; struct InitKeywords__48 *lnk; } *InitKeywords__48_s; @@ -2031,18 +2021,18 @@ static void Enter__49 (CHAR *s, LONGINT s__len); static void Enter__49 (CHAR *s, LONGINT s__len) { - INTEGER h; + int16 h; __DUP(s, s__len, CHAR); h = OPC_PerfectHash((void*)s, s__len); OPC_hashtab[__X(h, 105)] = *InitKeywords__48_s->n; - __COPY(s, OPC_keytab[__X(*InitKeywords__48_s->n, 36)], 9); + __COPY(s, OPC_keytab[__X(*InitKeywords__48_s->n, 50)], 9); *InitKeywords__48_s->n += 1; __DEL(s); } static void OPC_InitKeywords (void) { - SHORTINT n, i; + int8 n, i; struct InitKeywords__48 _s; _s.n = &n; _s.lnk = InitKeywords__48_s; @@ -2053,6 +2043,7 @@ static void OPC_InitKeywords (void) OPC_hashtab[__X(i, 105)] = -1; i += 1; } + Enter__49((CHAR*)"adrint", 7); Enter__49((CHAR*)"asm", 4); Enter__49((CHAR*)"auto", 5); Enter__49((CHAR*)"break", 6); @@ -2074,16 +2065,25 @@ static void OPC_InitKeywords (void) Enter__49((CHAR*)"if", 3); Enter__49((CHAR*)"import", 7); Enter__49((CHAR*)"int", 4); + Enter__49((CHAR*)"int16", 6); + Enter__49((CHAR*)"int32", 6); + Enter__49((CHAR*)"int64", 6); + Enter__49((CHAR*)"int8", 5); Enter__49((CHAR*)"long", 5); Enter__49((CHAR*)"register", 9); Enter__49((CHAR*)"return", 7); Enter__49((CHAR*)"short", 6); Enter__49((CHAR*)"signed", 7); Enter__49((CHAR*)"sizeof", 7); + Enter__49((CHAR*)"size_t", 7); Enter__49((CHAR*)"static", 7); Enter__49((CHAR*)"struct", 7); Enter__49((CHAR*)"switch", 7); Enter__49((CHAR*)"typedef", 8); + Enter__49((CHAR*)"uint16", 7); + Enter__49((CHAR*)"uint32", 7); + Enter__49((CHAR*)"uint64", 7); + Enter__49((CHAR*)"uint8", 6); Enter__49((CHAR*)"union", 6); Enter__49((CHAR*)"unsigned", 9); Enter__49((CHAR*)"void", 5); diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index 38f95afe..05c34fcc 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -9,16 +9,16 @@ -import void OPC_Align (LONGINT *adr, LONGINT base); +import void OPC_Align (int32 *adr, int32 base); import void OPC_Andent (OPT_Struct typ); -import LONGINT OPC_BaseAlignment (OPT_Struct typ); +import int32 OPC_BaseAlignment (OPT_Struct typ); import OPT_Object OPC_BaseTProc (OPT_Object obj); import void OPC_BegBlk (void); import void OPC_BegStat (void); -import void OPC_Case (LONGINT caseVal, INTEGER form); -import void OPC_Cmp (INTEGER rel); +import void OPC_Case (int32 caseVal, int16 form); +import void OPC_Cmp (int16 rel); import void OPC_CompleteIdent (OPT_Object obj); -import void OPC_Constant (OPT_Const con, INTEGER form); +import void OPC_Constant (OPT_Const con, int16 form); import void OPC_DefineInter (OPT_Object proc); import void OPC_EndBlk (void); import void OPC_EndBlk0 (void); @@ -31,19 +31,19 @@ import void OPC_GenBdy (OPT_Node n); import void OPC_GenEnumPtrs (OPT_Object var); import void OPC_GenHdr (OPT_Node n); import void OPC_GenHdrIncludes (void); -import void OPC_Halt (LONGINT n); +import void OPC_Halt (int32 n); import void OPC_Ident (OPT_Object obj); import void OPC_Increment (BOOLEAN decrement); -import void OPC_Indent (INTEGER count); +import void OPC_Indent (int16 count); import void OPC_Init (void); import void OPC_InitTDesc (OPT_Struct typ); -import void OPC_IntLiteral (LONGINT n, LONGINT size); -import void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim); -import LONGINT OPC_NofPtrs (OPT_Struct typ); +import void OPC_IntLiteral (int32 n, int32 size); +import void OPC_Len (OPT_Object obj, OPT_Struct array, int32 dim); +import int32 OPC_NofPtrs (OPT_Struct typ); import void OPC_SetInclude (BOOLEAN exclude); -import LONGINT OPC_SizeAlignment (LONGINT size); +import int32 OPC_SizeAlignment (int32 size); import void OPC_TDescDecl (OPT_Struct typ); -import void OPC_TypeDefs (OPT_Object obj, INTEGER vis); +import void OPC_TypeDefs (OPT_Object obj, int16 vis); import void OPC_TypeOf (OPT_Object ap); import void *OPC__init(void); diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index f2da0fed..8bf863b3 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -14,23 +14,23 @@ typedef static CHAR OPM_SourceFileName[256]; -export INTEGER OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet; -export LONGINT OPM_MaxIndex; +export int16 OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet; +export int32 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; -export LONGINT OPM_curpos, OPM_errpos, OPM_breakpc; -export INTEGER OPM_currFile, OPM_level, OPM_pc, OPM_entno; +export int32 OPM_curpos, OPM_errpos, OPM_breakpc; +export int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; export CHAR OPM_modName[32]; export CHAR OPM_objname[64]; export SET OPM_opt, OPM_glbopt; -static LONGINT OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; +static int32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; static Texts_Reader OPM_inR; static Texts_Text OPM_Log; static Texts_Writer OPM_W; static Files_Rider OPM_oldSF, OPM_newSF; static Files_Rider OPM_R[3]; static Files_File OPM_oldSFile, OPM_newSFile, OPM_HFile, OPM_BFile, OPM_HIFile; -static INTEGER OPM_S; +static int16 OPM_S; export BOOLEAN OPM_dontAsm, OPM_dontLink, OPM_mainProg, OPM_mainLinkStat, OPM_notColorOutput, OPM_forceNewSym, OPM_Verbose; static CHAR OPM_OBERON[1024]; static CHAR OPM_MODULES[1024]; @@ -40,54 +40,54 @@ static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F); export void OPM_CloseFiles (void); export void OPM_CloseOldSym (void); export void OPM_DeleteNewSym (void); -export void OPM_FPrint (LONGINT *fp, LONGINT val); -export void OPM_FPrintLReal (LONGINT *fp, LONGREAL lr); -export void OPM_FPrintReal (LONGINT *fp, REAL real); -export void OPM_FPrintSet (LONGINT *fp, SET set); -static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, LONGINT pos); +export void OPM_FPrint (int32 *fp, int32 val); +export void OPM_FPrintLReal (int32 *fp, LONGREAL lr); +export void OPM_FPrintReal (int32 *fp, REAL real); +export void OPM_FPrintSet (int32 *fp, SET set); +static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, int32 pos); export void OPM_Get (CHAR *ch); static void OPM_GetProperties (void); -static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONGINT name__len, INTEGER *size, INTEGER *align); +static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONGINT name__len, int16 *size, int16 *align); export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); export void OPM_InitOptions (void); -static void OPM_LogErrMsg (INTEGER n); +static void OPM_LogErrMsg (int16 n); export void OPM_LogW (CHAR ch); export void OPM_LogWLn (void); -export void OPM_LogWNum (LONGINT i, LONGINT len); +export void OPM_LogWNum (int32 i, int32 len); export void OPM_LogWStr (CHAR *s, LONGINT s__len); static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len); -export void OPM_Mark (INTEGER n, LONGINT pos); +export void OPM_Mark (int16 n, int32 pos); export void OPM_NewSym (CHAR *modName, LONGINT modName__len); export void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); export void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); export BOOLEAN OPM_OpenPar (void); export void OPM_RegisterNewSym (void); static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt); -static void OPM_ShowLine (LONGINT pos); -export LONGINT OPM_SignedMaximum (LONGINT bytecount); -export LONGINT OPM_SignedMinimum (LONGINT bytecount); +static void OPM_ShowLine (int32 pos); +export int32 OPM_SignedMaximum (int32 bytecount); +export int32 OPM_SignedMinimum (int32 bytecount); export void OPM_SymRCh (CHAR *ch); -export LONGINT OPM_SymRInt (void); +export int32 OPM_SymRInt (void); export void OPM_SymRLReal (LONGREAL *lr); export void OPM_SymRReal (REAL *r); export void OPM_SymRSet (SET *s); export void OPM_SymWCh (CHAR ch); -export void OPM_SymWInt (LONGINT i); +export void OPM_SymWInt (int32 i); export void OPM_SymWLReal (LONGREAL lr); export void OPM_SymWReal (REAL r); export void OPM_SymWSet (SET s); static void OPM_VerboseListSizes (void); export void OPM_Write (CHAR ch); -export void OPM_WriteHex (LONGINT i); -export void OPM_WriteInt (LONGINT i); +export void OPM_WriteHex (int32 i); +export void OPM_WriteInt (int32 i); export void OPM_WriteLn (void); export void OPM_WriteReal (LONGREAL r, CHAR suffx); export void OPM_WriteString (CHAR *s, LONGINT s__len); export void OPM_WriteStringVar (CHAR *s, LONGINT s__len); export BOOLEAN OPM_eofSF (void); -export void OPM_err (INTEGER n); -static LONGINT OPM_minusop (LONGINT i); -static LONGINT OPM_power0 (LONGINT i, LONGINT j); +export void OPM_err (int16 n); +static int32 OPM_minusop (int32 i); +static int32 OPM_power0 (int32 i, int32 j); void OPM_LogW (CHAR ch) @@ -102,7 +102,7 @@ void OPM_LogWStr (CHAR *s, LONGINT s__len) __DEL(s); } -void OPM_LogWNum (LONGINT i, LONGINT len) +void OPM_LogWNum (int32 i, int32 len) { Console_Int(i, len); } @@ -114,7 +114,7 @@ void OPM_LogWLn (void) static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) { - INTEGER i; + int16 i; i = 1; while (s[__X(i, s__len)] != 0x00) { switch (s[__X(i, s__len)]) { @@ -154,15 +154,15 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) case 'B': if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_IntSize = (SYSTEM_INT16)s[__X(i, s__len)] - 48; + OPM_IntSize = (int16)s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_PointerSize = (SYSTEM_INT16)s[__X(i, s__len)] - 48; + OPM_PointerSize = (int16)s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_Alignment = (SYSTEM_INT16)s[__X(i, s__len)] - 48; + OPM_Alignment = (int16)s[__X(i, s__len)] - 48; } __ASSERT(OPM_IntSize == 2 || OPM_IntSize == 4, 0); __ASSERT(OPM_PointerSize == 4 || OPM_PointerSize == 8, 0); @@ -299,7 +299,7 @@ void OPM_InitOptions (void) void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len) { Texts_Text T = NIL; - LONGINT beg, end, time; + int32 beg, end, time; CHAR s[256]; *done = 0; OPM_curpos = 0; @@ -347,7 +347,7 @@ void OPM_Get (CHAR *ch) static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len) { - INTEGER i, j; + int16 i, j; CHAR ch; __DUP(ext, ext__len, CHAR); i = 0; @@ -369,12 +369,12 @@ static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGIN __DEL(ext); } -static void OPM_LogErrMsg (INTEGER n) +static void OPM_LogErrMsg (int16 n) { Texts_Scanner S; Texts_Text T = NIL; CHAR ch; - INTEGER i; + int16 i; CHAR buf[1024]; if (n >= 0) { if (!OPM_notColorOutput) { @@ -399,7 +399,7 @@ static void OPM_LogErrMsg (INTEGER n) OPM_LogWStr(errors_errors[__X(n, 350)], 128); } -static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, LONGINT pos) +static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, int32 pos) { CHAR ch, cheol; if (pos < OPM_ErrorLineStartPos) { @@ -431,12 +431,12 @@ static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, LONGINT Files_Set(&*r, r__typ, f, OPM_ErrorLineStartPos); } -static void OPM_ShowLine (LONGINT pos) +static void OPM_ShowLine (int32 pos) { Files_File f = NIL; Files_Rider r; CHAR line[1023]; - INTEGER i; + int16 i; CHAR ch; f = Files_Old(OPM_SourceFileName, 256); OPM_FindLine(f, &r, Files_Rider__typ, pos); @@ -458,7 +458,7 @@ static void OPM_ShowLine (LONGINT pos) if (pos >= OPM_ErrorLineLimitPos) { pos = OPM_ErrorLineLimitPos - 1; } - i = (SYSTEM_INT16)(pos - OPM_ErrorLineStartPos); + i = (int16)(pos - OPM_ErrorLineStartPos); while (i > 0) { OPM_LogW(' '); i -= 1; @@ -473,7 +473,7 @@ static void OPM_ShowLine (LONGINT pos) Files_Close(f); } -void OPM_Mark (INTEGER n, LONGINT pos) +void OPM_Mark (int16 n, int32 pos) { if (pos == -1) { pos = 0; @@ -525,51 +525,51 @@ void OPM_Mark (INTEGER n, LONGINT pos) } } -void OPM_err (INTEGER n) +void OPM_err (int16 n) { OPM_Mark(n, OPM_errpos); } -void OPM_FPrint (LONGINT *fp, LONGINT val) +void OPM_FPrint (int32 *fp, int32 val) { - *fp = __ROTL((LONGINT)((SET)*fp ^ (SET)val), 1, LONGINT); + *fp = __ROTL((int32)((SET)*fp ^ (SET)val), 1, int32); } -void OPM_FPrintSet (LONGINT *fp, SET set) +void OPM_FPrintSet (int32 *fp, SET set) { - OPM_FPrint(&*fp, (LONGINT)set); + OPM_FPrint(&*fp, (int32)set); } -void OPM_FPrintReal (LONGINT *fp, REAL real) +void OPM_FPrintReal (int32 *fp, REAL real) { - INTEGER i; - LONGINT l; - __GET((SYSTEM_ADRINT)&real, l, LONGINT); + int16 i; + int32 l; + __GET((SYSTEM_ADRINT)&real, l, int32); OPM_FPrint(&*fp, l); } -void OPM_FPrintLReal (LONGINT *fp, LONGREAL lr) +void OPM_FPrintLReal (int32 *fp, LONGREAL lr) { - LONGINT l, h; - __GET((SYSTEM_ADRINT)&lr, l, LONGINT); - __GET((SYSTEM_ADRINT)&lr + 4, h, LONGINT); + int32 l, h; + __GET((SYSTEM_ADRINT)&lr, l, int32); + __GET((SYSTEM_ADRINT)&lr + 4, h, int32); OPM_FPrint(&*fp, l); OPM_FPrint(&*fp, h); } -static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONGINT name__len, INTEGER *size, INTEGER *align) +static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONGINT name__len, int16 *size, int16 *align) { __DUP(name, name__len, CHAR); if (((*S).class == 1 && __STRCMP((*S).s, name) == 0)) { Texts_Scan(&*S, S__typ); if ((*S).class == 3) { - *size = (SYSTEM_INT16)(*S).i; + *size = (int16)(*S).i; Texts_Scan(&*S, S__typ); } else { OPM_Mark(-157, -1); } if ((*S).class == 3) { - *align = (SYSTEM_INT16)(*S).i; + *align = (int16)(*S).i; Texts_Scan(&*S, S__typ); } else { OPM_Mark(-157, -1); @@ -580,17 +580,17 @@ static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONG __DEL(name); } -static LONGINT OPM_minusop (LONGINT i) +static int32 OPM_minusop (int32 i) { - LONGINT _o_result; + int32 _o_result; _o_result = -i; return _o_result; } -static LONGINT OPM_power0 (LONGINT i, LONGINT j) +static int32 OPM_power0 (int32 i, int32 j) { - LONGINT _o_result; - LONGINT k, p; + int32 _o_result; + int32 k, p; k = 1; p = i; do { @@ -642,19 +642,19 @@ static void OPM_VerboseListSizes (void) OPM_LogWLn(); } -LONGINT OPM_SignedMaximum (LONGINT bytecount) +int32 OPM_SignedMaximum (int32 bytecount) { - LONGINT _o_result; - LONGINT result; + int32 _o_result; + int32 result; result = 1; - result = __LSH(result, __ASHL(bytecount, 3) - 1, LONGINT); + result = __LSH(result, __ASHL(bytecount, 3) - 1, int32); _o_result = result - 1; return _o_result; } -LONGINT OPM_SignedMinimum (LONGINT bytecount) +int32 OPM_SignedMinimum (int32 bytecount) { - LONGINT _o_result; + int32 _o_result; _o_result = -OPM_SignedMaximum(bytecount) - 1; return _o_result; } @@ -688,10 +688,10 @@ void OPM_SymRCh (CHAR *ch) Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&*ch); } -LONGINT OPM_SymRInt (void) +int32 OPM_SymRInt (void) { - LONGINT _o_result; - LONGINT k; + int32 _o_result; + int32 k; Files_ReadNum(&OPM_oldSF, Files_Rider__typ, &k); _o_result = k; return _o_result; @@ -699,7 +699,7 @@ LONGINT OPM_SymRInt (void) void OPM_SymRSet (SET *s) { - Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (LONGINT*)&*s); + Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (int32*)&*s); } void OPM_SymRReal (REAL *r) @@ -746,14 +746,14 @@ void OPM_SymWCh (CHAR ch) Files_Write(&OPM_newSF, Files_Rider__typ, ch); } -void OPM_SymWInt (LONGINT i) +void OPM_SymWInt (int32 i) { Files_WriteNum(&OPM_newSF, Files_Rider__typ, i); } void OPM_SymWSet (SET s) { - Files_WriteNum(&OPM_newSF, Files_Rider__typ, (LONGINT)s); + Files_WriteNum(&OPM_newSF, Files_Rider__typ, (int32)s); } void OPM_SymWReal (REAL r) @@ -797,7 +797,7 @@ void OPM_Write (CHAR ch) void OPM_WriteString (CHAR *s, LONGINT s__len) { - INTEGER i; + int16 i; i = 0; while (s[__X(i, s__len)] != 0x00) { i += 1; @@ -807,7 +807,7 @@ void OPM_WriteString (CHAR *s, LONGINT s__len) void OPM_WriteStringVar (CHAR *s, LONGINT s__len) { - INTEGER i; + int16 i; i = 0; while (s[__X(i, s__len)] != 0x00) { i += 1; @@ -815,17 +815,17 @@ void OPM_WriteStringVar (CHAR *s, LONGINT s__len) Files_WriteBytes(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, (void*)s, s__len * 1, i); } -void OPM_WriteHex (LONGINT i) +void OPM_WriteHex (int32 i) { CHAR s[3]; - INTEGER digit; - digit = __ASHR((SYSTEM_INT16)i, 4); + int16 digit; + digit = __ASHR((int16)i, 4); if (digit < 10) { s[0] = (CHAR)(48 + digit); } else { s[0] = (CHAR)(87 + digit); } - digit = __MASK((SYSTEM_INT16)i, -16); + digit = __MASK((int16)i, -16); if (digit < 10) { s[1] = (CHAR)(48 + digit); } else { @@ -835,10 +835,10 @@ void OPM_WriteHex (LONGINT i) OPM_WriteString(s, 3); } -void OPM_WriteInt (LONGINT i) +void OPM_WriteInt (int32 i) { CHAR s[20]; - LONGINT i1, k; + int32 i1, k; if (i == OPM_SignedMinimum(OPM_IntSize) || i == OPM_SignedMinimum(OPM_LIntSize)) { OPM_Write('('); OPM_WriteInt(i + 1); @@ -871,14 +871,14 @@ void OPM_WriteReal (LONGREAL r, CHAR suffx) Texts_Reader R; CHAR s[32]; CHAR ch; - INTEGER i; - if ((((r < OPM_SignedMaximum(OPM_LIntSize) && r > OPM_SignedMinimum(OPM_LIntSize))) && r == ((SYSTEM_INT32)__ENTIER(r)))) { + int16 i; + if ((((r < OPM_SignedMaximum(OPM_LIntSize) && r > OPM_SignedMinimum(OPM_LIntSize))) && r == ((int32)__ENTIER(r)))) { if (suffx == 'f') { OPM_WriteString((CHAR*)"(REAL)", 7); } else { OPM_WriteString((CHAR*)"(LONGREAL)", 11); } - OPM_WriteInt((SYSTEM_INT32)__ENTIER(r)); + OPM_WriteInt((int32)__ENTIER(r)); } else { Texts_OpenWriter(&W, Texts_Writer__typ); if (suffx == 'f') { @@ -959,7 +959,7 @@ void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len) void OPM_CloseFiles (void) { CHAR FName[32]; - INTEGER res; + int16 res; if (OPM_noerr) { OPM_LogWStr((CHAR*)" ", 3); OPM_LogWNum(Files_Pos(&OPM_R[1], Files_Rider__typ), 0); diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index 15a980a6..36eb4165 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -6,12 +6,12 @@ #include "SYSTEM.h" -import INTEGER OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet; -import LONGINT OPM_MaxIndex; +import int16 OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet; +import int32 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; -import LONGINT OPM_curpos, OPM_errpos, OPM_breakpc; -import INTEGER OPM_currFile, OPM_level, OPM_pc, OPM_entno; +import int32 OPM_curpos, OPM_errpos, OPM_breakpc; +import int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; import CHAR OPM_modName[32]; import CHAR OPM_objname[64]; import SET OPM_opt, OPM_glbopt; @@ -21,44 +21,44 @@ import BOOLEAN OPM_dontAsm, OPM_dontLink, OPM_mainProg, OPM_mainLinkStat, OPM_no import void OPM_CloseFiles (void); import void OPM_CloseOldSym (void); import void OPM_DeleteNewSym (void); -import void OPM_FPrint (LONGINT *fp, LONGINT val); -import void OPM_FPrintLReal (LONGINT *fp, LONGREAL lr); -import void OPM_FPrintReal (LONGINT *fp, REAL real); -import void OPM_FPrintSet (LONGINT *fp, SET set); +import void OPM_FPrint (int32 *fp, int32 val); +import void OPM_FPrintLReal (int32 *fp, LONGREAL lr); +import void OPM_FPrintReal (int32 *fp, REAL real); +import void OPM_FPrintSet (int32 *fp, SET set); import void OPM_Get (CHAR *ch); import void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); import void OPM_InitOptions (void); import void OPM_LogW (CHAR ch); import void OPM_LogWLn (void); -import void OPM_LogWNum (LONGINT i, LONGINT len); +import void OPM_LogWNum (int32 i, int32 len); import void OPM_LogWStr (CHAR *s, LONGINT s__len); -import void OPM_Mark (INTEGER n, LONGINT pos); +import void OPM_Mark (int16 n, int32 pos); import void OPM_NewSym (CHAR *modName, LONGINT modName__len); import void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); import void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); import BOOLEAN OPM_OpenPar (void); import void OPM_RegisterNewSym (void); -import LONGINT OPM_SignedMaximum (LONGINT bytecount); -import LONGINT OPM_SignedMinimum (LONGINT bytecount); +import int32 OPM_SignedMaximum (int32 bytecount); +import int32 OPM_SignedMinimum (int32 bytecount); import void OPM_SymRCh (CHAR *ch); -import LONGINT OPM_SymRInt (void); +import int32 OPM_SymRInt (void); import void OPM_SymRLReal (LONGREAL *lr); import void OPM_SymRReal (REAL *r); import void OPM_SymRSet (SET *s); import void OPM_SymWCh (CHAR ch); -import void OPM_SymWInt (LONGINT i); +import void OPM_SymWInt (int32 i); import void OPM_SymWLReal (LONGREAL lr); import void OPM_SymWReal (REAL r); import void OPM_SymWSet (SET s); import void OPM_Write (CHAR ch); -import void OPM_WriteHex (LONGINT i); -import void OPM_WriteInt (LONGINT i); +import void OPM_WriteHex (int32 i); +import void OPM_WriteInt (int32 i); import void OPM_WriteLn (void); import void OPM_WriteReal (LONGREAL r, CHAR suffx); import void OPM_WriteString (CHAR *s, LONGINT s__len); import void OPM_WriteStringVar (CHAR *s, LONGINT s__len); import BOOLEAN OPM_eofSF (void); -import void OPM_err (INTEGER n); +import void OPM_err (int16 n); import void *OPM__init(void); diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index 21c21350..a366ef24 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -6,17 +6,17 @@ #include "OPT.h" struct OPP__1 { - LONGINT low, high; + int32 low, high; }; typedef struct OPP__1 OPP_CaseTable[128]; -static SHORTINT OPP_sym, OPP_level; -static INTEGER OPP_LoopLevel; +static int8 OPP_sym, OPP_level; +static int16 OPP_LoopLevel; static OPT_Node OPP_TDinit, OPP_lastTDinit; -static INTEGER OPP_nofFwdPtr; +static int16 OPP_nofFwdPtr; static OPT_Struct OPP_FwdPtr[64]; export LONGINT *OPP__1__typ; @@ -24,10 +24,10 @@ export LONGINT *OPP__1__typ; static void OPP_ActualParameters (OPT_Node *aparlist, OPT_Object fpar); static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned); static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq); -static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, OPP_CaseTable tab); -static void OPP_CheckMark (SHORTINT *vis); -static void OPP_CheckSym (INTEGER s); -static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_); +static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int16 *n, OPP_CaseTable tab); +static void OPP_CheckMark (int8 *vis); +static void OPP_CheckSym (int16 s); +static void OPP_CheckSysFlag (int16 *sysflag, int16 default_); static void OPP_ConstExpression (OPT_Node *x); static void OPP_Element (OPT_Node *x); static void OPP_Expression (OPT_Node *x); @@ -37,7 +37,7 @@ static void OPP_FormalParameters (OPT_Object *firstPar, OPT_Struct *resTyp); export void OPP_Module (OPT_Node *prog, SET opt); static void OPP_PointerType (OPT_Struct *typ); static void OPP_ProcedureDeclaration (OPT_Node *x); -static void OPP_Receiver (SHORTINT *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec); +static void OPP_Receiver (int8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec); static void OPP_RecordType (OPT_Struct *typ, OPT_Struct *banned); static void OPP_Sets (OPT_Node *x); static void OPP_SimpleExpression (OPT_Node *x); @@ -46,19 +46,19 @@ static void OPP_StatSeq (OPT_Node *stat); static void OPP_Term (OPT_Node *x); static void OPP_Type (OPT_Struct *typ, OPT_Struct *banned); static void OPP_TypeDecl (OPT_Struct *typ, OPT_Struct *banned); -static void OPP_err (INTEGER n); +static void OPP_err (int16 n); static void OPP_qualident (OPT_Object *id); static void OPP_selector (OPT_Node *x); -static void OPP_err (INTEGER n) +static void OPP_err (int16 n) { OPM_err(n); } -static void OPP_CheckSym (INTEGER s) +static void OPP_CheckSym (int16 s) { - if ((SYSTEM_INT16)OPP_sym == s) { + if ((int16)OPP_sym == s) { OPS_Get(&OPP_sym); } else { OPM_err(s); @@ -68,7 +68,7 @@ static void OPP_CheckSym (INTEGER s) static void OPP_qualident (OPT_Object *id) { OPT_Object obj = NIL; - SHORTINT lev; + int8 lev; OPT_Find(&obj); OPS_Get(&OPP_sym); if ((((OPP_sym == 18 && obj != NIL)) && obj->mode == 11)) { @@ -108,7 +108,7 @@ static void OPP_ConstExpression (OPT_Node *x) } } -static void OPP_CheckMark (SHORTINT *vis) +static void OPP_CheckMark (int8 *vis) { OPS_Get(&OPP_sym); if (OPP_sym == 1 || OPP_sym == 7) { @@ -126,10 +126,10 @@ static void OPP_CheckMark (SHORTINT *vis) } } -static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_) +static void OPP_CheckSysFlag (int16 *sysflag, int16 default_) { OPT_Node x = NIL; - LONGINT sf; + int32 sf; if (OPP_sym == 31) { OPS_Get(&OPP_sym); if (!OPT_SYSimported) { @@ -146,7 +146,7 @@ static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_) OPP_err(51); sf = 0; } - *sysflag = (SYSTEM_INT16)sf; + *sysflag = (int16)sf; OPP_CheckSym(23); } else { *sysflag = default_; @@ -157,7 +157,7 @@ static void OPP_RecordType (OPT_Struct *typ, OPT_Struct *banned) { OPT_Object fld = NIL, first = NIL, last = NIL, base = NIL; OPT_Struct ftyp = NIL; - INTEGER sysflag; + int16 sysflag; *typ = OPT_NewStr(13, 4); (*typ)->BaseTyp = NIL; OPP_CheckSysFlag(&sysflag, -1); @@ -249,8 +249,8 @@ static void OPP_RecordType (OPT_Struct *typ, OPT_Struct *banned) static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) { OPT_Node x = NIL; - LONGINT n; - INTEGER sysflag; + int32 n; + int16 sysflag; OPP_CheckSysFlag(&sysflag, 0); if (OPP_sym == 25) { *typ = OPT_NewStr(13, 3); @@ -342,7 +342,7 @@ static void OPP_PointerType (OPT_Struct *typ) static void OPP_FormalParameters (OPT_Object *firstPar, OPT_Struct *resTyp) { - SHORTINT mode; + int8 mode; OPT_Object par = NIL, first = NIL, last = NIL, res = NIL; OPT_Struct typ = NIL; first = NIL; @@ -623,9 +623,9 @@ static void OPP_ActualParameters (OPT_Node *aparlist, OPT_Object fpar) static void OPP_StandProcCall (OPT_Node *x) { OPT_Node y = NIL; - SHORTINT m; - INTEGER n; - m = (SYSTEM_INT8)((SYSTEM_INT16)(*x)->obj->adr); + int8 m; + int16 n; + m = (int8)((int16)(*x)->obj->adr); n = 0; if (OPP_sym == 30) { OPS_Get(&OPP_sym); @@ -784,7 +784,7 @@ static void OPP_Factor (OPT_Node *x) static void OPP_Term (OPT_Node *x) { OPT_Node y = NIL; - SHORTINT mulop; + int8 mulop; OPP_Factor(&*x); while ((1 <= OPP_sym && OPP_sym <= 5)) { mulop = OPP_sym; @@ -797,7 +797,7 @@ static void OPP_Term (OPT_Node *x) static void OPP_SimpleExpression (OPT_Node *x) { OPT_Node y = NIL; - SHORTINT addop; + int8 addop; if (OPP_sym == 7) { OPS_Get(&OPP_sym); OPP_Term(&*x); @@ -821,7 +821,7 @@ static void OPP_Expression (OPT_Node *x) { OPT_Node y = NIL; OPT_Object obj = NIL; - SHORTINT relation; + int8 relation; OPP_SimpleExpression(&*x); if ((9 <= OPP_sym && OPP_sym <= 14)) { relation = OPP_sym; @@ -847,7 +847,7 @@ static void OPP_Expression (OPT_Node *x) } } -static void OPP_Receiver (SHORTINT *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec) +static void OPP_Receiver (int8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec) { OPT_Object obj = NIL; *typ = OPT_undftyp; @@ -913,7 +913,7 @@ static struct ProcedureDeclaration__16 { OPT_Node *x; OPT_Object *proc, *fwd; OPS_Name *name; - SHORTINT *mode, *vis; + int8 *mode, *vis; BOOLEAN *forward; struct ProcedureDeclaration__16 *lnk; } *ProcedureDeclaration__16_s; @@ -926,8 +926,8 @@ static void TProcDecl__23 (void); static void GetCode__19 (void) { OPT_ConstExt ext = NIL; - INTEGER n; - LONGINT c; + int16 n; + int32 c; ext = OPT_NewExt(); (*ProcedureDeclaration__16_s->proc)->conval->ext = ext; n = 0; @@ -991,7 +991,7 @@ static void GetParams__21 (void) static void Body__17 (void) { OPT_Node procdec = NIL, statseq = NIL; - LONGINT c; + int32 c; c = OPM_errpos; (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1); OPP_CheckSym(39); @@ -1014,7 +1014,7 @@ static void TProcDecl__23 (void) { OPT_Object baseProc = NIL; OPT_Struct objTyp = NIL, recTyp = NIL; - SHORTINT objMode; + int8 objMode; OPS_Name objName; OPS_Get(&OPP_sym); *ProcedureDeclaration__16_s->mode = 13; @@ -1086,7 +1086,7 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) { OPT_Object proc = NIL, fwd = NIL; OPS_Name name; - SHORTINT mode, vis; + int8 mode, vis; BOOLEAN forward; struct ProcedureDeclaration__16 _s; _s.x = x; @@ -1163,11 +1163,11 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) ProcedureDeclaration__16_s = _s.lnk; } -static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, OPP_CaseTable tab) +static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int16 *n, OPP_CaseTable tab) { OPT_Node x = NIL, y = NIL, lastlab = NIL; - INTEGER i, f; - LONGINT xval, yval; + int16 i, f; + int32 xval, yval; *lab = NIL; lastlab = NIL; for (;;) { @@ -1183,14 +1183,14 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, O if (!(LabelTyp->form == 4) || LabelTyp->size < x->typ->size) { OPP_err(60); } - } else if ((SYSTEM_INT16)LabelTyp->form != f) { + } else if ((int16)LabelTyp->form != f) { OPP_err(60); } if (OPP_sym == 21) { OPS_Get(&OPP_sym); OPP_ConstExpression(&y); yval = y->conval->intval; - if (((SYSTEM_INT16)y->typ->form != f && !((f == 4 && y->typ->form == 4)))) { + if (((int16)y->typ->form != f && !((f == 4 && y->typ->form == 4)))) { OPP_err(60); } if (yval < xval) { @@ -1234,7 +1234,7 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, O } static struct StatSeq__30 { - LONGINT *pos; + int32 *pos; struct StatSeq__30 *lnk; } *StatSeq__30_s; @@ -1244,8 +1244,8 @@ static void SetPos__35 (OPT_Node x); static void CasePart__31 (OPT_Node *x) { - INTEGER n; - LONGINT low, high; + int16 n; + int32 low, high; BOOLEAN e; OPP_CaseTable tab; OPT_Node cases = NIL, lab = NIL, y = NIL, lastcase = NIL; @@ -1328,7 +1328,7 @@ static void OPP_StatSeq (OPT_Node *stat) OPT_Struct idtyp = NIL; BOOLEAN e; OPT_Node s = NIL, x = NIL, y = NIL, z = NIL, apar = NIL, last = NIL, lastif = NIL; - LONGINT pos; + int32 pos; OPS_Name name; struct StatSeq__30 _s; _s.pos = &pos; @@ -1621,7 +1621,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) OPT_Struct typ = NIL; OPT_Object obj = NIL, first = NIL, last = NIL; OPT_Node x = NIL, lastdec = NIL; - INTEGER i; + int16 i; first = NIL; last = NIL; OPP_nofFwdPtr = 0; @@ -1774,7 +1774,7 @@ void OPP_Module (OPT_Node *prog, SET opt) { OPS_Name impName, aliasName; OPT_Node procdec = NIL, statseq = NIL; - LONGINT c; + int32 c; BOOLEAN done; OPS_Init(); OPP_LoopLevel = 0; diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index f197a5c6..2b29372f 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -11,29 +11,29 @@ typedef export OPS_Name OPS_name; export OPS_String OPS_str; -export INTEGER OPS_numtyp; -export LONGINT OPS_intval; +export int16 OPS_numtyp; +export int32 OPS_intval; export REAL OPS_realval; export LONGREAL OPS_lrlval; static CHAR OPS_ch; -export void OPS_Get (SHORTINT *sym); -static void OPS_Identifier (SHORTINT *sym); +export void OPS_Get (int8 *sym); +static void OPS_Identifier (int8 *sym); export void OPS_Init (void); static void OPS_Number (void); -static void OPS_Str (SHORTINT *sym); -static void OPS_err (INTEGER n); +static void OPS_Str (int8 *sym); +static void OPS_err (int16 n); -static void OPS_err (INTEGER n) +static void OPS_err (int16 n) { OPM_err(n); } -static void OPS_Str (SHORTINT *sym) +static void OPS_Str (int8 *sym) { - INTEGER i; + int16 i; CHAR och; i = 0; och = OPS_ch; @@ -59,15 +59,15 @@ static void OPS_Str (SHORTINT *sym) if (OPS_intval == 2) { *sym = 35; OPS_numtyp = 1; - OPS_intval = (SYSTEM_INT16)OPS_str[0]; + OPS_intval = (int16)OPS_str[0]; } else { *sym = 37; } } -static void OPS_Identifier (SHORTINT *sym) +static void OPS_Identifier (int8 *sym) { - INTEGER i; + int16 i; i = 0; do { OPS_name[i] = OPS_ch; @@ -86,10 +86,10 @@ static struct Number__6 { struct Number__6 *lnk; } *Number__6_s; -static INTEGER Ord__7 (CHAR ch, BOOLEAN hex); -static LONGREAL Ten__9 (INTEGER e); +static int16 Ord__7 (CHAR ch, BOOLEAN hex); +static LONGREAL Ten__9 (int16 e); -static LONGREAL Ten__9 (INTEGER e) +static LONGREAL Ten__9 (int16 e) { LONGREAL _o_result; LONGREAL x, p; @@ -108,14 +108,14 @@ static LONGREAL Ten__9 (INTEGER e) return _o_result; } -static INTEGER Ord__7 (CHAR ch, BOOLEAN hex) +static int16 Ord__7 (CHAR ch, BOOLEAN hex) { - INTEGER _o_result; + int16 _o_result; if (ch <= '9') { - _o_result = (SYSTEM_INT16)ch - 48; + _o_result = (int16)ch - 48; return _o_result; } else if (hex) { - _o_result = ((SYSTEM_INT16)ch - 65) + 10; + _o_result = ((int16)ch - 65) + 10; return _o_result; } else { OPS_err(2); @@ -127,7 +127,7 @@ static INTEGER Ord__7 (CHAR ch, BOOLEAN hex) static void OPS_Number (void) { - INTEGER i, m, n, d, e, maxHdig; + int16 i, m, n, d, e, maxHdig; CHAR dig[24]; LONGREAL f; CHAR expCh; @@ -309,9 +309,9 @@ static void Comment__2 (void) } } -void OPS_Get (SHORTINT *sym) +void OPS_Get (int8 *sym) { - SHORTINT s; + int8 s; struct Get__1 _s; _s.lnk = Get__1_s; Get__1_s = &_s; diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index 1e99f5e9..e40119f7 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -14,13 +14,13 @@ typedef import OPS_Name OPS_name; import OPS_String OPS_str; -import INTEGER OPS_numtyp; -import LONGINT OPS_intval; +import int16 OPS_numtyp; +import int32 OPS_intval; import REAL OPS_realval; import LONGREAL OPS_lrlval; -import void OPS_Get (SHORTINT *sym); +import void OPS_Get (int8 *sym); import void OPS_Init (void); import void *OPS__init(void); diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index 5b495ad5..7fbad791 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -12,17 +12,17 @@ typedef typedef struct OPT_ConstDesc { OPT_ConstExt ext; - LONGINT intval, intval2; + int32 intval, intval2; SET setval; LONGREAL realval; } OPT_ConstDesc; typedef struct OPT_ExpCtxt { - LONGINT reffp; - INTEGER ref; - SHORTINT nofm; - SHORTINT locmno[64]; + int32 reffp; + int16 ref; + int8 nofm; + int8 locmno[64]; } OPT_ExpCtxt; typedef @@ -33,13 +33,13 @@ typedef typedef struct OPT_ImpCtxt { - LONGINT nextTag, reffp; - INTEGER nofr, minr, nofm; + int32 nextTag, reffp; + int16 nofr, minr, nofm; BOOLEAN self; OPT_Struct ref[255]; OPT_Object old[255]; - LONGINT pvfp[255]; - SHORTINT glbmno[64]; + int32 pvfp[255]; + int8 glbmno[64]; } OPT_ImpCtxt; typedef @@ -48,7 +48,7 @@ typedef typedef struct OPT_NodeDesc { OPT_Node left, right, link; - SHORTINT class, subcl; + int8 class, subcl; BOOLEAN readonly; OPT_Struct typ; OPT_Object obj; @@ -60,22 +60,22 @@ typedef OPT_Object left, right, link, scope; OPS_Name name; BOOLEAN leaf; - SHORTINT mode, mnolev, vis, history; + int8 mode, mnolev, vis, history; BOOLEAN used, fpdone; - LONGINT fprint; + int32 fprint; OPT_Struct typ; OPT_Const conval; - LONGINT adr, linkadr; - INTEGER x; + int32 adr, linkadr; + int16 x; } OPT_ObjDesc; typedef struct OPT_StrDesc { - SHORTINT form, comp, mno, extlev; - INTEGER ref, sysflag; - LONGINT n, size, align, txtpos; + int8 form, comp, mno, extlev; + int16 ref, sysflag; + int32 n, size, align, txtpos; BOOLEAN allocated, pbused, pvused, fpdone, idfpdone; - LONGINT idfp, pbfp, pvfp; + int32 idfp, pbfp, pvfp; OPT_Struct BaseTyp; OPT_Object link, strobj; } OPT_StrDesc; @@ -84,7 +84,7 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; -export SHORTINT OPT_nofGmod; +export int8 OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; export BOOLEAN OPT_SYSimported; @@ -92,7 +92,7 @@ static OPT_Struct OPT_IntTypes[20]; static OPT_Object OPT_universe, OPT_syslink; static OPT_ImpCtxt OPT_impCtxt; static OPT_ExpCtxt OPT_expCtxt; -static LONGINT OPT_nofhdfld; +static int32 OPT_nofhdfld; static BOOLEAN OPT_newsf, OPT_findpc, OPT_extsf, OPT_sfpresent, OPT_symExtended, OPT_symNew; export LONGINT *OPT_ConstDesc__typ; @@ -105,62 +105,62 @@ export LONGINT *OPT_ExpCtxt__typ; export void OPT_Close (void); export void OPT_CloseScope (void); static void OPT_DebugStruct (OPT_Struct btyp); -static void OPT_EnterBoolConst (OPS_Name name, LONGINT value); -static void OPT_EnterProc (OPS_Name name, INTEGER num); -static void OPT_EnterTyp (OPS_Name name, SHORTINT form, INTEGER size, OPT_Struct *res); +static void OPT_EnterBoolConst (OPS_Name name, int32 value); +static void OPT_EnterProc (OPS_Name name, int16 num); +static void OPT_EnterTyp (OPS_Name name, int8 form, int16 size, OPT_Struct *res); export void OPT_Export (BOOLEAN *ext, BOOLEAN *new); -export void OPT_FPrintErr (OPT_Object obj, INTEGER errcode); -static void OPT_FPrintName (LONGINT *fp, CHAR *name, LONGINT name__len); +export void OPT_FPrintErr (OPT_Object obj, int16 errcode); +static void OPT_FPrintName (int32 *fp, CHAR *name, LONGINT name__len); export void OPT_FPrintObj (OPT_Object obj); -static void OPT_FPrintSign (LONGINT *fp, OPT_Struct result, OPT_Object par); +static void OPT_FPrintSign (int32 *fp, OPT_Struct result, OPT_Object par); export void OPT_FPrintStr (OPT_Struct typ); export void OPT_Find (OPT_Object *res); export void OPT_FindField (OPS_Name name, OPT_Struct typ, OPT_Object *res); export void OPT_FindImport (OPT_Object mod, OPT_Object *res); export void OPT_IdFPrint (OPT_Struct typ); export void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); -static void OPT_InConstant (LONGINT f, OPT_Const conval); +static void OPT_InConstant (int32 f, OPT_Const conval); static OPT_Object OPT_InFld (void); -static void OPT_InMod (SHORTINT *mno); +static void OPT_InMod (int8 *mno); static void OPT_InName (CHAR *name, LONGINT name__len); -static OPT_Object OPT_InObj (SHORTINT mno); -static void OPT_InSign (SHORTINT mno, OPT_Struct *res, OPT_Object *par); +static OPT_Object OPT_InObj (int8 mno); +static void OPT_InSign (int8 mno, OPT_Struct *res, OPT_Object *par); static void OPT_InStruct (OPT_Struct *typ); -static OPT_Object OPT_InTProc (SHORTINT mno); -static OPT_Struct OPT_InTyp (LONGINT tag); +static OPT_Object OPT_InTProc (int8 mno); +static OPT_Struct OPT_InTyp (int32 tag); export void OPT_Init (OPS_Name name, SET opt); -static void OPT_InitStruct (OPT_Struct *typ, SHORTINT form); +static void OPT_InitStruct (OPT_Struct *typ, int8 form); export void OPT_Insert (OPS_Name name, OPT_Object *obj); export void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); -export OPT_Struct OPT_IntType (LONGINT size); +export OPT_Struct OPT_IntType (int32 size); export OPT_Const OPT_NewConst (void); export OPT_ConstExt OPT_NewExt (void); -export OPT_Node OPT_NewNode (SHORTINT class); +export OPT_Node OPT_NewNode (int8 class); export OPT_Object OPT_NewObj (void); -export OPT_Struct OPT_NewStr (SHORTINT form, SHORTINT comp); -export void OPT_OpenScope (SHORTINT level, OPT_Object owner); +export OPT_Struct OPT_NewStr (int8 form, int8 comp); +export void OPT_OpenScope (int8 level, OPT_Object owner); static void OPT_OutConstant (OPT_Object obj); -static void OPT_OutFlds (OPT_Object fld, LONGINT adr, BOOLEAN visible); -static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, LONGINT adr); -static void OPT_OutMod (INTEGER mno); +static void OPT_OutFlds (OPT_Object fld, int32 adr, BOOLEAN visible); +static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, int32 adr); +static void OPT_OutMod (int16 mno); static void OPT_OutName (CHAR *name, LONGINT name__len); static void OPT_OutObj (OPT_Object obj); static void OPT_OutSign (OPT_Struct result, OPT_Object par); static void OPT_OutStr (OPT_Struct typ); static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj); -export OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir); -static void OPT_err (INTEGER n); +export OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir); +static void OPT_err (int16 n); -static void OPT_err (INTEGER n) +static void OPT_err (int16 n) { OPM_err(n); } -OPT_Struct OPT_IntType (LONGINT size) +OPT_Struct OPT_IntType (int32 size) { OPT_Struct _o_result; - INTEGER i; + int16 i; i = 1; while ((OPT_IntTypes[__X(i, 20)]->size < size && OPT_IntTypes[__X(i + 1, 20)] != NIL)) { i += 1; @@ -169,10 +169,10 @@ OPT_Struct OPT_IntType (LONGINT size) return _o_result; } -OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir) +OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir) { OPT_Struct _o_result; - INTEGER i; + int16 i; __ASSERT(x->form == 4, 0); __ASSERT(dir == 1 || dir == -1, 0); __ASSERT(x->BaseTyp == OPT_undftyp, 0); @@ -203,7 +203,7 @@ OPT_Object OPT_NewObj (void) return _o_result; } -OPT_Struct OPT_NewStr (SHORTINT form, SHORTINT comp) +OPT_Struct OPT_NewStr (int8 form, int8 comp) { OPT_Struct _o_result; OPT_Struct typ = NIL; @@ -220,7 +220,7 @@ OPT_Struct OPT_NewStr (SHORTINT form, SHORTINT comp) return _o_result; } -OPT_Node OPT_NewNode (SHORTINT class) +OPT_Node OPT_NewNode (int8 class) { OPT_Node _o_result; OPT_Node node = NIL; @@ -239,7 +239,7 @@ OPT_ConstExt OPT_NewExt (void) return _o_result; } -void OPT_OpenScope (SHORTINT level, OPT_Object owner) +void OPT_OpenScope (int8 level, OPT_Object owner) { OPT_Object head = NIL; head = OPT_NewObj(); @@ -277,7 +277,7 @@ void OPT_Init (OPS_Name name, SET opt) void OPT_Close (void) { - INTEGER i; + int16 i; OPT_CloseScope(); i = 0; while (i < 64) { @@ -369,7 +369,7 @@ void OPT_Insert (OPS_Name name, OPT_Object *obj) { OPT_Object ob0 = NIL, ob1 = NIL; BOOLEAN left; - SHORTINT mnolev; + int8 mnolev; ob0 = OPT_topScope; ob1 = ob0->right; left = 0; @@ -407,14 +407,14 @@ void OPT_Insert (OPS_Name name, OPT_Object *obj) *obj = ob1; } -static void OPT_FPrintName (LONGINT *fp, CHAR *name, LONGINT name__len) +static void OPT_FPrintName (int32 *fp, CHAR *name, LONGINT name__len) { - INTEGER i; + int16 i; CHAR ch; i = 0; do { ch = name[__X(i, name__len)]; - OPM_FPrint(&*fp, (SYSTEM_INT16)ch); + OPM_FPrint(&*fp, (int16)ch); i += 1; } while (!(ch == 0x00)); } @@ -452,7 +452,7 @@ static void OPT_DebugStruct (OPT_Struct btyp) OPM_LogWLn(); } -static void OPT_FPrintSign (LONGINT *fp, OPT_Struct result, OPT_Object par) +static void OPT_FPrintSign (int32 *fp, OPT_Struct result, OPT_Object par) { OPT_IdFPrint(result); OPM_FPrint(&*fp, result->idfp); @@ -468,8 +468,8 @@ void OPT_IdFPrint (OPT_Struct typ) { OPT_Struct btyp = NIL; OPT_Object strobj = NIL; - LONGINT idfp; - INTEGER f, c; + int32 idfp; + int16 f, c; if (!typ->idfpdone) { typ->idfpdone = 1; idfp = 0; @@ -498,17 +498,17 @@ void OPT_IdFPrint (OPT_Struct typ) } static struct FPrintStr__12 { - LONGINT *pbfp, *pvfp; + int32 *pbfp, *pvfp; struct FPrintStr__12 *lnk; } *FPrintStr__12_s; -static void FPrintFlds__13 (OPT_Object fld, LONGINT adr, BOOLEAN visible); -static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr); +static void FPrintFlds__13 (OPT_Object fld, int32 adr, BOOLEAN visible); +static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, int32 adr); static void FPrintTProcs__17 (OPT_Object obj); -static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr) +static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, int32 adr) { - LONGINT i, j, n; + int32 i, j, n; OPT_Struct btyp = NIL; if (typ->comp == 4) { FPrintFlds__13(typ->link, adr, 0); @@ -538,7 +538,7 @@ static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr) } } -static void FPrintFlds__13 (OPT_Object fld, LONGINT adr, BOOLEAN visible) +static void FPrintFlds__13 (OPT_Object fld, int32 adr, BOOLEAN visible) { while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { @@ -573,10 +573,10 @@ static void FPrintTProcs__17 (OPT_Object obj) void OPT_FPrintStr (OPT_Struct typ) { - INTEGER f, c; + int16 f, c; OPT_Struct btyp = NIL; OPT_Object strobj = NIL, bstrobj = NIL; - LONGINT pbfp, pvfp; + int32 pbfp, pvfp; struct FPrintStr__12 _s; _s.pbfp = &pbfp; _s.pvfp = &pvfp; @@ -637,8 +637,8 @@ void OPT_FPrintStr (OPT_Struct typ) void OPT_FPrintObj (OPT_Object obj) { - LONGINT fprint; - INTEGER f, m; + int32 fprint; + int16 f, m; REAL rval; OPT_ConstExt ext = NIL; if (!obj->fpdone) { @@ -680,11 +680,11 @@ void OPT_FPrintObj (OPT_Object obj) } else if (obj->mode == 9) { OPT_FPrintSign(&fprint, obj->typ, obj->link); ext = obj->conval->ext; - m = (SYSTEM_INT16)(*ext)[0]; + m = (int16)(*ext)[0]; f = 1; OPM_FPrint(&fprint, m); while (f <= m) { - OPM_FPrint(&fprint, (SYSTEM_INT16)(*ext)[__X(f, 256)]); + OPM_FPrint(&fprint, (int16)(*ext)[__X(f, 256)]); f += 1; } } else if (obj->mode == 5) { @@ -695,9 +695,9 @@ void OPT_FPrintObj (OPT_Object obj) } } -void OPT_FPrintErr (OPT_Object obj, INTEGER errcode) +void OPT_FPrintErr (OPT_Object obj, int16 errcode) { - INTEGER i, j; + int16 i, j; CHAR ch; if (obj->mnolev != 0) { __COPY(OPT_GlbMod[__X(-obj->mnolev, 64)]->name, OPM_objname, 64); @@ -787,7 +787,7 @@ void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old) static void OPT_InName (CHAR *name, LONGINT name__len) { - INTEGER i; + int16 i; CHAR ch; i = 0; do { @@ -797,12 +797,12 @@ static void OPT_InName (CHAR *name, LONGINT name__len) } while (!(ch == 0x00)); } -static void OPT_InMod (SHORTINT *mno) +static void OPT_InMod (int8 *mno) { OPT_Object head = NIL; OPS_Name name; - LONGINT mn; - SHORTINT i; + int32 mn; + int8 i; mn = OPM_SymRInt(); if (mn == 0) { *mno = OPT_impCtxt.glbmno[0]; @@ -839,16 +839,16 @@ static void OPT_InMod (SHORTINT *mno) } } -static void OPT_InConstant (LONGINT f, OPT_Const conval) +static void OPT_InConstant (int32 f, OPT_Const conval) { CHAR ch; - INTEGER i; + int16 i; OPT_ConstExt ext = NIL; REAL rval; switch (f) { case 1: case 3: case 2: OPM_SymRCh(&ch); - conval->intval = (SYSTEM_INT16)ch; + conval->intval = (int16)ch; break; case 4: conval->intval = OPM_SymRInt(); @@ -888,10 +888,10 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval) } } -static void OPT_InSign (SHORTINT mno, OPT_Struct *res, OPT_Object *par) +static void OPT_InSign (int8 mno, OPT_Struct *res, OPT_Object *par) { OPT_Object last = NIL, new = NIL; - LONGINT tag; + int32 tag; OPT_InStruct(&*res); tag = OPM_SymRInt(); last = NIL; @@ -919,7 +919,7 @@ static void OPT_InSign (SHORTINT mno, OPT_Struct *res, OPT_Object *par) static OPT_Object OPT_InFld (void) { OPT_Object _o_result; - LONGINT tag; + int32 tag; OPT_Object obj = NIL; tag = OPT_impCtxt.nextTag; obj = OPT_NewObj(); @@ -948,10 +948,10 @@ static OPT_Object OPT_InFld (void) return _o_result; } -static OPT_Object OPT_InTProc (SHORTINT mno) +static OPT_Object OPT_InTProc (int8 mno) { OPT_Object _o_result; - LONGINT tag; + int32 tag; OPT_Object obj = NIL; tag = OPT_impCtxt.nextTag; obj = OPT_NewObj(); @@ -976,7 +976,7 @@ static OPT_Object OPT_InTProc (SHORTINT mno) return _o_result; } -static OPT_Struct OPT_InTyp (LONGINT tag) +static OPT_Struct OPT_InTyp (int32 tag) { OPT_Struct _o_result; if (tag == 4) { @@ -991,9 +991,9 @@ static OPT_Struct OPT_InTyp (LONGINT tag) static void OPT_InStruct (OPT_Struct *typ) { - SHORTINT mno; - INTEGER ref; - LONGINT tag; + int8 mno; + int16 ref; + int32 tag; OPS_Name name; OPT_Struct t = NIL; OPT_Object obj = NIL, last = NIL, fld = NIL, old = NIL, dummy = NIL; @@ -1049,7 +1049,7 @@ static void OPT_InStruct (OPT_Struct *typ) obj->vis = 0; tag = OPM_SymRInt(); if (tag == 35) { - (*typ)->sysflag = (SYSTEM_INT16)OPM_SymRInt(); + (*typ)->sysflag = (int16)OPM_SymRInt(); tag = OPM_SymRInt(); } switch (tag) { @@ -1171,14 +1171,14 @@ static void OPT_InStruct (OPT_Struct *typ) } } -static OPT_Object OPT_InObj (SHORTINT mno) +static OPT_Object OPT_InObj (int8 mno) { OPT_Object _o_result; - INTEGER i, s; + int16 i, s; CHAR ch; OPT_Object obj = NIL, old = NIL; OPT_Struct typ = NIL; - LONGINT tag; + int32 tag; OPT_ConstExt ext = NIL; tag = OPT_impCtxt.nextTag; if (tag == 19) { @@ -1211,7 +1211,7 @@ static OPT_Object OPT_InObj (SHORTINT mno) obj->mode = 9; ext = OPT_NewExt(); obj->conval->ext = ext; - s = (SYSTEM_INT16)OPM_SymRInt(); + s = (int16)OPM_SymRInt(); (*ext)[0] = (CHAR)s; i = 1; while (i <= s) { @@ -1277,7 +1277,7 @@ static OPT_Object OPT_InObj (SHORTINT mno) void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) { OPT_Object obj = NIL; - SHORTINT mno; + int8 mno; OPS_Name aliasName__copy; __DUPARR(aliasName, OPS_Name); if (__STRCMP(name, "SYSTEM") == 0) { @@ -1320,7 +1320,7 @@ void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) static void OPT_OutName (CHAR *name, LONGINT name__len) { - INTEGER i; + int16 i; CHAR ch; i = 0; do { @@ -1330,7 +1330,7 @@ static void OPT_OutName (CHAR *name, LONGINT name__len) } while (!(ch == 0x00)); } -static void OPT_OutMod (INTEGER mno) +static void OPT_OutMod (int16 mno) { if (OPT_expCtxt.locmno[__X(mno, 64)] < 0) { OPM_SymWInt(16); @@ -1342,9 +1342,9 @@ static void OPT_OutMod (INTEGER mno) } } -static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, LONGINT adr) +static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, int32 adr) { - LONGINT i, j, n; + int32 i, j, n; OPT_Struct btyp = NIL; if (typ->comp == 4) { OPT_OutFlds(typ->link, adr, 0); @@ -1374,7 +1374,7 @@ static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, LONGINT adr) } } -static void OPT_OutFlds (OPT_Object fld, LONGINT adr, BOOLEAN visible) +static void OPT_OutFlds (OPT_Object fld, int32 adr, BOOLEAN visible) { while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { @@ -1529,7 +1529,7 @@ static void OPT_OutStr (OPT_Struct typ) static void OPT_OutConstant (OPT_Object obj) { - INTEGER f; + int16 f; REAL rval; f = obj->typ->form; OPM_SymWInt(f); @@ -1564,7 +1564,7 @@ static void OPT_OutConstant (OPT_Object obj) static void OPT_OutObj (OPT_Object obj) { - INTEGER i, j; + int16 i, j; OPT_ConstExt ext = NIL; if (obj != NIL) { OPT_OutObj(obj->left); @@ -1631,7 +1631,7 @@ static void OPT_OutObj (OPT_Object obj) OPM_SymWInt(33); OPT_OutSign(obj->typ, obj->link); ext = obj->conval->ext; - j = (SYSTEM_INT16)(*ext)[0]; + j = (int16)(*ext)[0]; i = 1; OPM_SymWInt(j); while (i <= j) { @@ -1654,8 +1654,8 @@ static void OPT_OutObj (OPT_Object obj) void OPT_Export (BOOLEAN *ext, BOOLEAN *new) { - INTEGER i; - SHORTINT nofmod; + int16 i; + int8 nofmod; BOOLEAN done; OPT_symExtended = 0; OPT_symNew = 0; @@ -1697,7 +1697,7 @@ void OPT_Export (BOOLEAN *ext, BOOLEAN *new) } } -static void OPT_InitStruct (OPT_Struct *typ, SHORTINT form) +static void OPT_InitStruct (OPT_Struct *typ, int8 form) { *typ = OPT_NewStr(form, 1); (*typ)->ref = form; @@ -1711,7 +1711,7 @@ static void OPT_InitStruct (OPT_Struct *typ, SHORTINT form) (*typ)->idfpdone = 1; } -static void OPT_EnterBoolConst (OPS_Name name, LONGINT value) +static void OPT_EnterBoolConst (OPS_Name name, int32 value) { OPT_Object obj = NIL; OPS_Name name__copy; @@ -1723,7 +1723,7 @@ static void OPT_EnterBoolConst (OPS_Name name, LONGINT value) obj->conval->intval = value; } -static void OPT_EnterTyp (OPS_Name name, SHORTINT form, INTEGER size, OPT_Struct *res) +static void OPT_EnterTyp (OPS_Name name, int8 form, int16 size, OPT_Struct *res) { OPT_Object obj = NIL; OPT_Struct typ = NIL; @@ -1746,7 +1746,7 @@ static void OPT_EnterTyp (OPS_Name name, SHORTINT form, INTEGER size, OPT_Struct *res = typ; } -static void OPT_EnterProc (OPS_Name name, INTEGER num) +static void OPT_EnterProc (OPS_Name name, int16 num) { OPT_Object obj = NIL; OPS_Name name__copy; diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index 307b94e2..480267cc 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -15,7 +15,7 @@ typedef typedef struct OPT_ConstDesc { OPT_ConstExt ext; - LONGINT intval, intval2; + int32 intval, intval2; SET setval; LONGREAL realval; } OPT_ConstDesc; @@ -32,7 +32,7 @@ typedef typedef struct OPT_NodeDesc { OPT_Node left, right, link; - SHORTINT class, subcl; + int8 class, subcl; BOOLEAN readonly; OPT_Struct typ; OPT_Object obj; @@ -44,20 +44,20 @@ typedef OPT_Object left, right, link, scope; OPS_Name name; BOOLEAN leaf; - SHORTINT mode, mnolev, vis, history; + int8 mode, mnolev, vis, history; BOOLEAN used, fpdone; - LONGINT fprint; + int32 fprint; OPT_Struct typ; OPT_Const conval; - LONGINT adr, linkadr; - INTEGER x; + int32 adr, linkadr; + int16 x; } OPT_ObjDesc; typedef struct OPT_StrDesc { - SHORTINT form, comp, mno, extlev; - INTEGER ref, sysflag; - LONGINT n, size, align, txtpos; + int8 form, comp, mno, extlev; + int16 ref, sysflag; + int32 n, size, align, txtpos; BOOLEAN allocated, pbused, pvused; char _prvt0[16]; OPT_Struct BaseTyp; @@ -68,7 +68,7 @@ typedef import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; -import SHORTINT OPT_nofGmod; +import int8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; import BOOLEAN OPT_SYSimported; @@ -81,7 +81,7 @@ import LONGINT *OPT_NodeDesc__typ; import void OPT_Close (void); import void OPT_CloseScope (void); import void OPT_Export (BOOLEAN *ext, BOOLEAN *new); -import void OPT_FPrintErr (OPT_Object obj, INTEGER errcode); +import void OPT_FPrintErr (OPT_Object obj, int16 errcode); import void OPT_FPrintObj (OPT_Object obj); import void OPT_FPrintStr (OPT_Struct typ); import void OPT_Find (OPT_Object *res); @@ -92,14 +92,14 @@ import void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); import void OPT_Init (OPS_Name name, SET opt); import void OPT_Insert (OPS_Name name, OPT_Object *obj); import void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); -import OPT_Struct OPT_IntType (LONGINT size); +import OPT_Struct OPT_IntType (int32 size); import OPT_Const OPT_NewConst (void); import OPT_ConstExt OPT_NewExt (void); -import OPT_Node OPT_NewNode (SHORTINT class); +import OPT_Node OPT_NewNode (int8 class); import OPT_Object OPT_NewObj (void); -import OPT_Struct OPT_NewStr (SHORTINT form, SHORTINT comp); -import void OPT_OpenScope (SHORTINT level, OPT_Object owner); -import OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir); +import OPT_Struct OPT_NewStr (int8 form, int8 comp); +import void OPT_OpenScope (int8 level, OPT_Object owner); +import OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir); import void *OPT__init(void); diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index df62e985..5ef539df 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -7,15 +7,15 @@ typedef struct OPV_ExitInfo { - INTEGER level, label; + int16 level, label; } OPV_ExitInfo; static BOOLEAN OPV_assert, OPV_inxchk, OPV_mainprog, OPV_ansi; -static INTEGER OPV_stamp; -static LONGINT OPV_recno; +static int16 OPV_stamp; +static int32 OPV_recno; static OPV_ExitInfo OPV_exit; -static INTEGER OPV_nofExitLabels; +static int16 OPV_nofExitLabels; static BOOLEAN OPV_naturalAlignment; export LONGINT *OPV_ExitInfo__typ; @@ -23,38 +23,38 @@ export LONGINT *OPV_ExitInfo__typ; static void OPV_ActualPar (OPT_Node n, OPT_Object fp); export void OPV_AdrAndSize (OPT_Object topScope); static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc); -static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec); +static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int16 prec); static void OPV_DefineTDescs (OPT_Node n); -static void OPV_Entier (OPT_Node n, INTEGER prec); +static void OPV_Entier (OPT_Node n, int16 prec); static void OPV_GetTProcNum (OPT_Object obj); static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc); static BOOLEAN OPV_ImplicitReturn (OPT_Node n); -static void OPV_Index (OPT_Node n, OPT_Node d, INTEGER prec, INTEGER dim); +static void OPV_Index (OPT_Node n, OPT_Node d, int16 prec, int16 dim); export void OPV_Init (void); static void OPV_InitTDescs (OPT_Node n); -static void OPV_Len (OPT_Node n, LONGINT dim); +static void OPV_Len (OPT_Node n, int32 dim); export void OPV_Module (OPT_Node prog); -static LONGINT OPV_NaturalAlignment (LONGINT size, LONGINT max); +static int32 OPV_NaturalAlignment (int32 size, int32 max); static void OPV_NewArr (OPT_Node d, OPT_Node x); -static void OPV_ParIntLiteral (LONGINT n, LONGINT size); -static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, INTEGER comp); +static void OPV_ParIntLiteral (int32 n, int32 size); +static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp); static BOOLEAN OPV_SideEffects (OPT_Node n); -static void OPV_SizeCast (LONGINT from, LONGINT to); +static void OPV_SizeCast (int32 from, int32 to); static void OPV_Stamp (OPS_Name s); static OPT_Object OPV_SuperProc (OPT_Node n); static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported); static void OPV_TraverseRecord (OPT_Struct typ); export void OPV_TypSize (OPT_Struct typ); static void OPV_TypeOf (OPT_Node n); -static void OPV_design (OPT_Node n, INTEGER prec); -static void OPV_expr (OPT_Node n, INTEGER prec); +static void OPV_design (OPT_Node n, int16 prec); +static void OPV_expr (OPT_Node n, int16 prec); static void OPV_stat (OPT_Node n, OPT_Object outerProc); -static LONGINT OPV_NaturalAlignment (LONGINT size, LONGINT max) +static int32 OPV_NaturalAlignment (int32 size, int32 max) { - LONGINT _o_result; - LONGINT i; + int32 _o_result; + int32 i; if (size >= max) { _o_result = max; return _o_result; @@ -71,8 +71,8 @@ static LONGINT OPV_NaturalAlignment (LONGINT size, LONGINT max) void OPV_TypSize (OPT_Struct typ) { - INTEGER f, c; - LONGINT offset, size, base, fbase, off0; + int16 f, c; + int32 offset, size, base, fbase, off0; OPT_Object fld = NIL; OPT_Struct btyp = NIL; if (typ == OPT_undftyp) { @@ -118,7 +118,7 @@ void OPV_TypSize (OPT_Struct typ) } typ->size = offset; typ->align = base; - typ->sysflag = __MASK(typ->sysflag, -256) + (SYSTEM_INT16)__ASHL(offset - off0, 8); + typ->sysflag = __MASK(typ->sysflag, -256) + (int16)__ASHL(offset - off0, 8); } else if (c == 2) { OPV_TypSize(typ->BaseTyp); typ->size = typ->n * typ->BaseTyp->size; @@ -156,7 +156,7 @@ void OPV_Init (void) static void OPV_GetTProcNum (OPT_Object obj) { - LONGINT oldPos; + int32 oldPos; OPT_Struct typ = NIL; OPT_Object redef = NIL; oldPos = OPM_errpos; @@ -192,7 +192,7 @@ static void OPV_TraverseRecord (OPT_Struct typ) static void OPV_Stamp (OPS_Name s) { - INTEGER i, j, k; + int16 i, j, k; CHAR n[10]; OPV_stamp += 1; i = 0; @@ -222,7 +222,7 @@ static void OPV_Stamp (OPS_Name s) static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported) { - INTEGER mode; + int16 mode; OPT_Object scope = NIL; OPT_Struct typ = NIL; if (obj != NIL) { @@ -297,9 +297,9 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_sysptrtyp->strobj->linkadr = 2; } -static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, INTEGER comp) +static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp) { - INTEGER _o_result; + int16 _o_result; switch (class) { case 7: case 0: case 2: case 4: case 9: case 13: @@ -432,7 +432,7 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN __RETCHK; } -static void OPV_Len (OPT_Node n, LONGINT dim) +static void OPV_Len (OPT_Node n, int32 dim) { while ((n->class == 4 && n->typ->comp == 3)) { dim += 1; @@ -461,7 +461,7 @@ static BOOLEAN OPV_SideEffects (OPT_Node n) __RETCHK; } -static void OPV_Entier (OPT_Node n, INTEGER prec) +static void OPV_Entier (OPT_Node n, int16 prec) { if (__IN(n->typ->form, 0x60)) { OPM_WriteString((CHAR*)"__ENTIER(", 10); @@ -472,34 +472,18 @@ static void OPV_Entier (OPT_Node n, INTEGER prec) } } -static void OPV_SizeCast (LONGINT from, LONGINT to) +static void OPV_SizeCast (int32 from, int32 to) { if ((from != to && (from > 4 || to != 4))) { - switch (to) { - case 1: - OPM_WriteString((CHAR*)"(SYSTEM_INT8)", 14); - break; - case 2: - OPM_WriteString((CHAR*)"(SYSTEM_INT16)", 15); - break; - case 4: - OPM_WriteString((CHAR*)"(SYSTEM_INT32)", 15); - break; - case 8: - OPM_WriteString((CHAR*)"(SYSTEM_INT64)", 15); - break; - default: - OPM_LogWStr((CHAR*)"Unhandled case in OPC.SizeCast, to = ", 38); - OPM_LogWNum(to, 1); - OPM_LogWLn(); - break; - } + OPM_WriteString((CHAR*)"(int", 5); + OPM_WriteInt(__ASHL(to, 3)); + OPM_WriteString((CHAR*)")", 2); } } -static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec) +static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int16 prec) { - INTEGER from, to; + int16 from, to; from = n->typ->form; to = newtype->form; if (to == 7) { @@ -561,7 +545,7 @@ static void OPV_TypeOf (OPT_Node n) } } -static void OPV_Index (OPT_Node n, OPT_Node d, INTEGER prec, INTEGER dim) +static void OPV_Index (OPT_Node n, OPT_Node d, int16 prec, int16 dim) { if (!OPV_inxchk || (n->right->class == 7 && (n->right->conval->intval == 0 || n->left->typ->comp != 3))) { OPV_expr(n->right, prec); @@ -578,18 +562,18 @@ static void OPV_Index (OPT_Node n, OPT_Node d, INTEGER prec, INTEGER dim) } } -static void OPV_design (OPT_Node n, INTEGER prec) +static void OPV_design (OPT_Node n, int16 prec) { OPT_Object obj = NIL; OPT_Struct typ = NIL; - INTEGER class, designPrec, comp; + int16 class, designPrec, comp; OPT_Node d = NIL, x = NIL; - INTEGER dims, i, _for__28; + int16 dims, i, _for__28; comp = n->typ->comp; obj = n->obj; class = n->class; designPrec = OPV_Precedence(class, n->subcl, n->typ->form, comp); - if ((((((class == 0 && obj->mnolev > 0)) && (SYSTEM_INT16)obj->mnolev != OPM_level)) && prec == 10)) { + if ((((((class == 0 && obj->mnolev > 0)) && (int16)obj->mnolev != OPM_level)) && prec == 10)) { designPrec = 9; } if (prec > designPrec) { @@ -688,7 +672,7 @@ static void OPV_design (OPT_Node n, INTEGER prec) if (__IN(3, OPM_opt)) { if (typ->comp == 4) { OPM_WriteString((CHAR*)"__GUARDR(", 10); - if ((SYSTEM_INT16)obj->mnolev != OPM_level) { + if ((int16)obj->mnolev != OPM_level) { OPM_WriteStringVar((void*)obj->scope->name, 256); OPM_WriteString((CHAR*)"__curr->", 9); OPC_Ident(obj); @@ -757,7 +741,7 @@ static void OPV_design (OPT_Node n, INTEGER prec) } } -static void OPV_ParIntLiteral (LONGINT n, LONGINT size) +static void OPV_ParIntLiteral (int32 n, int32 size) { if (OPV_ansi) { OPM_WriteInt(n); @@ -769,7 +753,7 @@ static void OPV_ParIntLiteral (LONGINT n, LONGINT size) static void OPV_ActualPar (OPT_Node n, OPT_Object fp) { OPT_Struct typ = NIL, aptyp = NIL; - INTEGER comp, form, mode, prec, dim; + int16 comp, form, mode, prec, dim; OPM_Write('('); while (n != NIL) { typ = fp->typ; @@ -868,9 +852,9 @@ static OPT_Object OPV_SuperProc (OPT_Node n) return _o_result; } -static void OPV_expr (OPT_Node n, INTEGER prec) +static void OPV_expr (OPT_Node n, int16 prec) { - INTEGER class, subclass, form, exprPrec; + int16 class, subclass, form, exprPrec; OPT_Struct typ = NIL; OPT_Node l = NIL, r = NIL; OPT_Object proc = NIL; @@ -1186,7 +1170,7 @@ static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) OPT_Node if_ = NIL; OPT_Object obj = NIL; OPT_Struct typ = NIL; - LONGINT adr; + int32 adr; if_ = n->left; while (if_ != NIL) { OPM_WriteString((CHAR*)"if ", 4); @@ -1236,8 +1220,8 @@ static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc) { OPT_Node switchCase = NIL, label = NIL; - LONGINT low, high; - INTEGER form, i; + int32 low, high; + int16 form, i; OPM_WriteString((CHAR*)"switch ", 8); OPV_expr(n->left, 12); OPM_Write(' '); @@ -1304,7 +1288,7 @@ static BOOLEAN OPV_ImplicitReturn (OPT_Node n) static void OPV_NewArr (OPT_Node d, OPT_Node x) { OPT_Struct typ = NIL, base = NIL; - INTEGER nofdim, nofdyn; + int16 nofdim, nofdyn; typ = d->typ->BaseTyp; base = typ; nofdim = 0; diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 033e03cf..c247eb06 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -8,90 +8,90 @@ typedef Platform_ArgPtr (*Platform_ArgVec)[1024]; typedef - LONGINT (*Platform_ArgVecPtr)[1]; + int32 (*Platform_ArgVecPtr)[1]; typedef CHAR (*Platform_EnvPtr)[1024]; typedef struct Platform_FileIdentity { - LONGINT volume, index, mtime; + int32 volume, index, mtime; } Platform_FileIdentity; typedef - void (*Platform_HaltProcedure)(LONGINT); + void (*Platform_HaltProcedure)(int32); typedef - void (*Platform_SignalHandler)(INTEGER); + void (*Platform_SignalHandler)(int16); export BOOLEAN Platform_LittleEndian; -export LONGINT Platform_MainStackFrame, Platform_HaltCode; -export INTEGER Platform_PID; +export int32 Platform_MainStackFrame, Platform_HaltCode; +export int16 Platform_PID; export CHAR Platform_CWD[256]; -export INTEGER Platform_ArgCount; -export LONGINT Platform_ArgVector; +export int16 Platform_ArgCount; +export int32 Platform_ArgVector; static Platform_HaltProcedure Platform_HaltHandler; -static LONGINT Platform_TimeStart; -export INTEGER Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; +static int32 Platform_TimeStart; +export int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; export CHAR Platform_nl[3]; export LONGINT *Platform_FileIdentity__typ; -export BOOLEAN Platform_Absent (INTEGER e); -export INTEGER Platform_ArgPos (CHAR *s, LONGINT s__len); -export void Platform_AssertFail (LONGINT code); -export INTEGER Platform_Chdir (CHAR *n, LONGINT n__len); -export INTEGER Platform_Close (LONGINT h); -export BOOLEAN Platform_ConnectionFailed (INTEGER e); -export void Platform_Delay (LONGINT ms); -export BOOLEAN Platform_DifferentFilesystems (INTEGER e); -static void Platform_DisplayHaltCode (LONGINT code); -export INTEGER Platform_Error (void); -export void Platform_Exit (INTEGER code); -export void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len); -export void Platform_GetClock (LONGINT *t, LONGINT *d); +export BOOLEAN Platform_Absent (int16 e); +export int16 Platform_ArgPos (CHAR *s, LONGINT s__len); +export void Platform_AssertFail (int32 code); +export int16 Platform_Chdir (CHAR *n, LONGINT n__len); +export int16 Platform_Close (int32 h); +export BOOLEAN Platform_ConnectionFailed (int16 e); +export void Platform_Delay (int32 ms); +export BOOLEAN Platform_DifferentFilesystems (int16 e); +static void Platform_DisplayHaltCode (int32 code); +export int16 Platform_Error (void); +export void Platform_Exit (int16 code); +export void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len); +export void Platform_GetClock (int32 *t, int32 *d); export void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); -export void Platform_GetIntArg (INTEGER n, LONGINT *val); -export void Platform_GetTimeOfDay (LONGINT *sec, LONGINT *usec); -export void Platform_Halt (LONGINT code); -export INTEGER Platform_Identify (LONGINT h, Platform_FileIdentity *identity, LONGINT *identity__typ); -export INTEGER Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); -export BOOLEAN Platform_Inaccessible (INTEGER e); -export void Platform_Init (INTEGER argc, LONGINT argvadr); -export void Platform_MTimeAsClock (Platform_FileIdentity i, LONGINT *t, LONGINT *d); -export INTEGER Platform_New (CHAR *n, LONGINT n__len, LONGINT *h); -export BOOLEAN Platform_NoSuchDirectory (INTEGER e); -export LONGINT Platform_OSAllocate (LONGINT size); -export void Platform_OSFree (LONGINT address); -export INTEGER Platform_OldRO (CHAR *n, LONGINT n__len, LONGINT *h); -export INTEGER Platform_OldRW (CHAR *n, LONGINT n__len, LONGINT *h); -export INTEGER Platform_Read (LONGINT h, LONGINT p, LONGINT l, LONGINT *n); -export INTEGER Platform_ReadBuf (LONGINT h, SYSTEM_BYTE *b, LONGINT b__len, LONGINT *n); -export INTEGER Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); +export void Platform_GetIntArg (int16 n, int32 *val); +export void Platform_GetTimeOfDay (int32 *sec, int32 *usec); +export void Platform_Halt (int32 code); +export int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, LONGINT *identity__typ); +export int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); +export BOOLEAN Platform_Inaccessible (int16 e); +export void Platform_Init (int16 argc, int32 argvadr); +export void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); +export int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); +export BOOLEAN Platform_NoSuchDirectory (int16 e); +export int32 Platform_OSAllocate (int32 size); +export void Platform_OSFree (int32 address); +export int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); +export int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); +export int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n); +export int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n); +export int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); export BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); export BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); -export INTEGER Platform_Seek (LONGINT h, LONGINT offset, INTEGER whence); +export int16 Platform_Seek (int32 h, int32 offset, int16 whence); export void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); export void Platform_SetHalt (Platform_HaltProcedure p); export void Platform_SetInterruptHandler (Platform_SignalHandler handler); export void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Platform_FileIdentity source); export void Platform_SetQuitHandler (Platform_SignalHandler handler); -export INTEGER Platform_Size (LONGINT h, LONGINT *l); -export INTEGER Platform_Sync (LONGINT h); -export INTEGER Platform_System (CHAR *cmd, LONGINT cmd__len); +export int16 Platform_Size (int32 h, int32 *l); +export int16 Platform_Sync (int32 h); +export int16 Platform_System (CHAR *cmd, LONGINT cmd__len); static void Platform_TestLittleEndian (void); -export LONGINT Platform_Time (void); -export BOOLEAN Platform_TimedOut (INTEGER e); -export BOOLEAN Platform_TooManyFiles (INTEGER e); -export INTEGER Platform_Truncate (LONGINT h, LONGINT l); -export INTEGER Platform_Unlink (CHAR *n, LONGINT n__len); -export INTEGER Platform_Write (LONGINT h, LONGINT p, LONGINT l); -static void Platform_YMDHMStoClock (LONGINT ye, LONGINT mo, LONGINT da, LONGINT ho, LONGINT mi, LONGINT se, LONGINT *t, LONGINT *d); +export int32 Platform_Time (void); +export BOOLEAN Platform_TimedOut (int16 e); +export BOOLEAN Platform_TooManyFiles (int16 e); +export int16 Platform_Truncate (int32 h, int32 l); +export int16 Platform_Unlink (CHAR *n, LONGINT n__len); +export int16 Platform_Write (int32 h, int32 p, int32 l); +static void Platform_YMDHMStoClock (int32 ye, int32 mo, int32 da, int32 ho, int32 mi, int32 se, int32 *t, int32 *d); static void Platform_errch (CHAR c); -static void Platform_errint (LONGINT l); +static void Platform_errint (int32 l); static void Platform_errln (void); -static void Platform_errposint (LONGINT l); +static void Platform_errposint (int32 l); export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); #include @@ -163,68 +163,68 @@ extern void Heap_InitHeap(); #define Platform_unlink(n, n__len) unlink((char*)n) #define Platform_writefile(fd, p, l) write(fd, (void*)(SYSTEM_ADRINT)(p), l) -BOOLEAN Platform_TooManyFiles (INTEGER e) +BOOLEAN Platform_TooManyFiles (int16 e) { BOOLEAN _o_result; _o_result = e == Platform_EMFILE() || e == Platform_ENFILE(); return _o_result; } -BOOLEAN Platform_NoSuchDirectory (INTEGER e) +BOOLEAN Platform_NoSuchDirectory (int16 e) { BOOLEAN _o_result; _o_result = e == Platform_ENOENT(); return _o_result; } -BOOLEAN Platform_DifferentFilesystems (INTEGER e) +BOOLEAN Platform_DifferentFilesystems (int16 e) { BOOLEAN _o_result; _o_result = e == Platform_EXDEV(); return _o_result; } -BOOLEAN Platform_Inaccessible (INTEGER e) +BOOLEAN Platform_Inaccessible (int16 e) { BOOLEAN _o_result; _o_result = (e == Platform_EACCES() || e == Platform_EROFS()) || e == Platform_EAGAIN(); return _o_result; } -BOOLEAN Platform_Absent (INTEGER e) +BOOLEAN Platform_Absent (int16 e) { BOOLEAN _o_result; _o_result = e == Platform_ENOENT(); return _o_result; } -BOOLEAN Platform_TimedOut (INTEGER e) +BOOLEAN Platform_TimedOut (int16 e) { BOOLEAN _o_result; _o_result = e == Platform_ETIMEDOUT(); return _o_result; } -BOOLEAN Platform_ConnectionFailed (INTEGER e) +BOOLEAN Platform_ConnectionFailed (int16 e) { BOOLEAN _o_result; _o_result = ((e == Platform_ECONNREFUSED() || e == Platform_ECONNABORTED()) || e == Platform_ENETUNREACH()) || e == Platform_EHOSTUNREACH(); return _o_result; } -LONGINT Platform_OSAllocate (LONGINT size) +int32 Platform_OSAllocate (int32 size) { - LONGINT _o_result; + int32 _o_result; _o_result = Platform_allocate(size); return _o_result; } -void Platform_OSFree (LONGINT address) +void Platform_OSFree (int32 address) { Platform_free(address); } -void Platform_Init (INTEGER argc, LONGINT argvadr) +void Platform_Init (int16 argc, int32 argvadr) { Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; @@ -258,7 +258,7 @@ void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len) __DEL(var); } -void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len) +void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { @@ -267,10 +267,10 @@ void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len) } } -void Platform_GetIntArg (INTEGER n, LONGINT *val) +void Platform_GetIntArg (int16 n, int32 *val) { CHAR s[64]; - LONGINT k, d, i; + int32 k, d, i; s[0] = 0x00; Platform_GetArg(n, (void*)s, 64); i = 0; @@ -278,11 +278,11 @@ void Platform_GetIntArg (INTEGER n, LONGINT *val) i = 1; } k = 0; - d = (SYSTEM_INT16)s[__X(i, 64)] - 48; + d = (int16)s[__X(i, 64)] - 48; while ((d >= 0 && d <= 9)) { k = k * 10 + d; i += 1; - d = (SYSTEM_INT16)s[__X(i, 64)] - 48; + d = (int16)s[__X(i, 64)] - 48; } if (s[0] == '-') { k = -k; @@ -293,10 +293,10 @@ void Platform_GetIntArg (INTEGER n, LONGINT *val) } } -INTEGER Platform_ArgPos (CHAR *s, LONGINT s__len) +int16 Platform_ArgPos (CHAR *s, LONGINT s__len) { - INTEGER _o_result; - INTEGER i; + int16 _o_result; + int16 i; CHAR arg[256]; __DUP(s, s__len, CHAR); i = 0; @@ -325,64 +325,64 @@ void Platform_SetBadInstructionHandler (Platform_SignalHandler handler) Platform_sethandler(4, handler); } -static void Platform_YMDHMStoClock (LONGINT ye, LONGINT mo, LONGINT da, LONGINT ho, LONGINT mi, LONGINT se, LONGINT *t, LONGINT *d) +static void Platform_YMDHMStoClock (int32 ye, int32 mo, int32 da, int32 ho, int32 mi, int32 se, int32 *t, int32 *d) { *d = (__ASHL((int)__MOD(ye, 100), 9) + __ASHL(mo + 1, 5)) + da; *t = (__ASHL(ho, 12) + __ASHL(mi, 6)) + se; } -void Platform_GetClock (LONGINT *t, LONGINT *d) +void Platform_GetClock (int32 *t, int32 *d) { Platform_gettimeval(); Platform_sectotm(Platform_tvsec()); Platform_YMDHMStoClock(Platform_tmyear(), Platform_tmmon(), Platform_tmmday(), Platform_tmhour(), Platform_tmmin(), Platform_tmsec(), &*t, &*d); } -void Platform_GetTimeOfDay (LONGINT *sec, LONGINT *usec) +void Platform_GetTimeOfDay (int32 *sec, int32 *usec) { Platform_gettimeval(); *sec = Platform_tvsec(); *usec = Platform_tvusec(); } -LONGINT Platform_Time (void) +int32 Platform_Time (void) { - LONGINT _o_result; - LONGINT ms; + int32 _o_result; + int32 ms; Platform_gettimeval(); ms = (int)__DIVF(Platform_tvusec(), 1000) + Platform_tvsec() * 1000; _o_result = (int)__MOD(ms - Platform_TimeStart, 2147483647); return _o_result; } -void Platform_Delay (LONGINT ms) +void Platform_Delay (int32 ms) { - LONGINT s, ns; + int32 s, ns; s = __DIV(ms, 1000); ns = (int)__MOD(ms, 1000) * 1000000; Platform_nanosleep(s, ns); } -INTEGER Platform_System (CHAR *cmd, LONGINT cmd__len) +int16 Platform_System (CHAR *cmd, LONGINT cmd__len) { - INTEGER _o_result; + int16 _o_result; __DUP(cmd, cmd__len, CHAR); _o_result = Platform_system(cmd, cmd__len); __DEL(cmd); return _o_result; } -INTEGER Platform_Error (void) +int16 Platform_Error (void) { - INTEGER _o_result; + int16 _o_result; _o_result = Platform_err(); return _o_result; } -INTEGER Platform_OldRO (CHAR *n, LONGINT n__len, LONGINT *h) +int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h) { - INTEGER _o_result; - INTEGER fd; + int16 _o_result; + int16 fd; fd = Platform_openro(n, n__len); if (fd < 0) { _o_result = Platform_err(); @@ -395,10 +395,10 @@ INTEGER Platform_OldRO (CHAR *n, LONGINT n__len, LONGINT *h) __RETCHK; } -INTEGER Platform_OldRW (CHAR *n, LONGINT n__len, LONGINT *h) +int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h) { - INTEGER _o_result; - INTEGER fd; + int16 _o_result; + int16 fd; fd = Platform_openrw(n, n__len); if (fd < 0) { _o_result = Platform_err(); @@ -411,10 +411,10 @@ INTEGER Platform_OldRW (CHAR *n, LONGINT n__len, LONGINT *h) __RETCHK; } -INTEGER Platform_New (CHAR *n, LONGINT n__len, LONGINT *h) +int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h) { - INTEGER _o_result; - INTEGER fd; + int16 _o_result; + int16 fd; fd = Platform_opennew(n, n__len); if (fd < 0) { _o_result = Platform_err(); @@ -427,9 +427,9 @@ INTEGER Platform_New (CHAR *n, LONGINT n__len, LONGINT *h) __RETCHK; } -INTEGER Platform_Close (LONGINT h) +int16 Platform_Close (int32 h) { - INTEGER _o_result; + int16 _o_result; if (Platform_closefile(h) < 0) { _o_result = Platform_err(); return _o_result; @@ -440,9 +440,9 @@ INTEGER Platform_Close (LONGINT h) __RETCHK; } -INTEGER Platform_Identify (LONGINT h, Platform_FileIdentity *identity, LONGINT *identity__typ) +int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, LONGINT *identity__typ) { - INTEGER _o_result; + int16 _o_result; Platform_structstats(); if (Platform_fstat(h) < 0) { _o_result = Platform_err(); @@ -455,9 +455,9 @@ INTEGER Platform_Identify (LONGINT h, Platform_FileIdentity *identity, LONGINT * return _o_result; } -INTEGER Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ) +int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ) { - INTEGER _o_result; + int16 _o_result; __DUP(n, n__len, CHAR); Platform_structstats(); if (Platform_stat(n, n__len) < 0) { @@ -492,15 +492,15 @@ void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Pla (*target).mtime = source.mtime; } -void Platform_MTimeAsClock (Platform_FileIdentity i, LONGINT *t, LONGINT *d) +void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d) { Platform_sectotm(i.mtime); Platform_YMDHMStoClock(Platform_tmyear(), Platform_tmmon(), Platform_tmmday(), Platform_tmhour(), Platform_tmmin(), Platform_tmsec(), &*t, &*d); } -INTEGER Platform_Size (LONGINT h, LONGINT *l) +int16 Platform_Size (int32 h, int32 *l) { - INTEGER _o_result; + int16 _o_result; Platform_structstats(); if (Platform_fstat(h) < 0) { _o_result = Platform_err(); @@ -511,9 +511,9 @@ INTEGER Platform_Size (LONGINT h, LONGINT *l) return _o_result; } -INTEGER Platform_Read (LONGINT h, LONGINT p, LONGINT l, LONGINT *n) +int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n) { - INTEGER _o_result; + int16 _o_result; *n = Platform_readfile(h, p, l); if (*n < 0) { *n = 0; @@ -526,9 +526,9 @@ INTEGER Platform_Read (LONGINT h, LONGINT p, LONGINT l, LONGINT *n) __RETCHK; } -INTEGER Platform_ReadBuf (LONGINT h, SYSTEM_BYTE *b, LONGINT b__len, LONGINT *n) +int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n) { - INTEGER _o_result; + int16 _o_result; *n = Platform_readfile(h, (SYSTEM_ADRINT)b, b__len); if (*n < 0) { *n = 0; @@ -541,10 +541,10 @@ INTEGER Platform_ReadBuf (LONGINT h, SYSTEM_BYTE *b, LONGINT b__len, LONGINT *n) __RETCHK; } -INTEGER Platform_Write (LONGINT h, LONGINT p, LONGINT l) +int16 Platform_Write (int32 h, int32 p, int32 l) { - INTEGER _o_result; - LONGINT written; + int16 _o_result; + int32 written; written = Platform_writefile(h, p, l); if (written < 0) { _o_result = Platform_err(); @@ -556,9 +556,9 @@ INTEGER Platform_Write (LONGINT h, LONGINT p, LONGINT l) __RETCHK; } -INTEGER Platform_Sync (LONGINT h) +int16 Platform_Sync (int32 h) { - INTEGER _o_result; + int16 _o_result; if (Platform_fsync(h) < 0) { _o_result = Platform_err(); return _o_result; @@ -569,9 +569,9 @@ INTEGER Platform_Sync (LONGINT h) __RETCHK; } -INTEGER Platform_Seek (LONGINT h, LONGINT offset, INTEGER whence) +int16 Platform_Seek (int32 h, int32 offset, int16 whence) { - INTEGER _o_result; + int16 _o_result; if (Platform_lseek(h, offset, whence) < 0) { _o_result = Platform_err(); return _o_result; @@ -582,9 +582,9 @@ INTEGER Platform_Seek (LONGINT h, LONGINT offset, INTEGER whence) __RETCHK; } -INTEGER Platform_Truncate (LONGINT h, LONGINT l) +int16 Platform_Truncate (int32 h, int32 l) { - INTEGER _o_result; + int16 _o_result; if (Platform_ftruncate(h, l) < 0) { _o_result = Platform_err(); return _o_result; @@ -595,9 +595,9 @@ INTEGER Platform_Truncate (LONGINT h, LONGINT l) __RETCHK; } -INTEGER Platform_Unlink (CHAR *n, LONGINT n__len) +int16 Platform_Unlink (CHAR *n, LONGINT n__len) { - INTEGER _o_result; + int16 _o_result; if (Platform_unlink(n, n__len) < 0) { _o_result = Platform_err(); return _o_result; @@ -608,10 +608,10 @@ INTEGER Platform_Unlink (CHAR *n, LONGINT n__len) __RETCHK; } -INTEGER Platform_Chdir (CHAR *n, LONGINT n__len) +int16 Platform_Chdir (CHAR *n, LONGINT n__len) { - INTEGER _o_result; - INTEGER r; + int16 _o_result; + int16 r; r = Platform_chdir(n, n__len); Platform_getcwd((void*)Platform_CWD, 256); if (r < 0) { @@ -624,9 +624,9 @@ INTEGER Platform_Chdir (CHAR *n, LONGINT n__len) __RETCHK; } -INTEGER Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) +int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) { - INTEGER _o_result; + int16 _o_result; if (Platform_rename(o, o__len, n, n__len) < 0) { _o_result = Platform_err(); return _o_result; @@ -637,7 +637,7 @@ INTEGER Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) __RETCHK; } -void Platform_Exit (INTEGER code) +void Platform_Exit (int16 code) { Platform_exit(code); } @@ -653,7 +653,7 @@ static void Platform_errln (void) Platform_errch(0x0a); } -static void Platform_errposint (LONGINT l) +static void Platform_errposint (int32 l) { if (l > 10) { Platform_errposint(__DIV(l, 10)); @@ -661,7 +661,7 @@ static void Platform_errposint (LONGINT l) Platform_errch((CHAR)(48 + (int)__MOD(l, 10))); } -static void Platform_errint (LONGINT l) +static void Platform_errint (int32 l) { if (l < 0) { Platform_errch('-'); @@ -670,7 +670,7 @@ static void Platform_errint (LONGINT l) Platform_errposint(l); } -static void Platform_DisplayHaltCode (LONGINT code) +static void Platform_DisplayHaltCode (int32 code) { switch (code) { case -1: @@ -726,9 +726,9 @@ static void Platform_DisplayHaltCode (LONGINT code) } } -void Platform_Halt (LONGINT code) +void Platform_Halt (int32 code) { - INTEGER e; + int16 e; Platform_HaltCode = code; if (Platform_HaltHandler != NIL) { (*Platform_HaltHandler)(code); @@ -740,12 +740,12 @@ void Platform_Halt (LONGINT code) Platform_DisplayHaltCode(code); } Platform_errln(); - Platform_exit(__VAL(INTEGER, code)); + Platform_exit(__VAL(int16, code)); } -void Platform_AssertFail (LONGINT code) +void Platform_AssertFail (int32 code) { - INTEGER e; + int16 e; Platform_errstring((CHAR*)"Assertion failure.", 19); if (code != 0) { Platform_errstring((CHAR*)" ASSERT code ", 14); @@ -753,7 +753,7 @@ void Platform_AssertFail (LONGINT code) Platform_errstring((CHAR*)".", 2); } Platform_errln(); - Platform_exit(__VAL(INTEGER, code)); + Platform_exit(__VAL(int16, code)); } void Platform_SetHalt (Platform_HaltProcedure p) @@ -763,7 +763,7 @@ void Platform_SetHalt (Platform_HaltProcedure p) static void Platform_TestLittleEndian (void) { - INTEGER i; + int16 i; i = 1; __GET((SYSTEM_ADRINT)&i, Platform_LittleEndian, BOOLEAN); } diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index 34d088bf..129004fd 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -7,74 +7,74 @@ typedef struct Platform_FileIdentity { - LONGINT volume, index, mtime; + int32 volume, index, mtime; } Platform_FileIdentity; typedef - void (*Platform_HaltProcedure)(LONGINT); + void (*Platform_HaltProcedure)(int32); typedef - void (*Platform_SignalHandler)(INTEGER); + void (*Platform_SignalHandler)(int16); import BOOLEAN Platform_LittleEndian; -import LONGINT Platform_MainStackFrame, Platform_HaltCode; -import INTEGER Platform_PID; +import int32 Platform_MainStackFrame, Platform_HaltCode; +import int16 Platform_PID; import CHAR Platform_CWD[256]; -import INTEGER Platform_ArgCount; -import LONGINT Platform_ArgVector; -import INTEGER Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; +import int16 Platform_ArgCount; +import int32 Platform_ArgVector; +import int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; import CHAR Platform_nl[3]; import LONGINT *Platform_FileIdentity__typ; -import BOOLEAN Platform_Absent (INTEGER e); -import INTEGER Platform_ArgPos (CHAR *s, LONGINT s__len); -import void Platform_AssertFail (LONGINT code); -import INTEGER Platform_Chdir (CHAR *n, LONGINT n__len); -import INTEGER Platform_Close (LONGINT h); -import BOOLEAN Platform_ConnectionFailed (INTEGER e); -import void Platform_Delay (LONGINT ms); -import BOOLEAN Platform_DifferentFilesystems (INTEGER e); -import INTEGER Platform_Error (void); -import void Platform_Exit (INTEGER code); -import void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len); -import void Platform_GetClock (LONGINT *t, LONGINT *d); +import BOOLEAN Platform_Absent (int16 e); +import int16 Platform_ArgPos (CHAR *s, LONGINT s__len); +import void Platform_AssertFail (int32 code); +import int16 Platform_Chdir (CHAR *n, LONGINT n__len); +import int16 Platform_Close (int32 h); +import BOOLEAN Platform_ConnectionFailed (int16 e); +import void Platform_Delay (int32 ms); +import BOOLEAN Platform_DifferentFilesystems (int16 e); +import int16 Platform_Error (void); +import void Platform_Exit (int16 code); +import void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len); +import void Platform_GetClock (int32 *t, int32 *d); import void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); -import void Platform_GetIntArg (INTEGER n, LONGINT *val); -import void Platform_GetTimeOfDay (LONGINT *sec, LONGINT *usec); -import void Platform_Halt (LONGINT code); -import INTEGER Platform_Identify (LONGINT h, Platform_FileIdentity *identity, LONGINT *identity__typ); -import INTEGER Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); -import BOOLEAN Platform_Inaccessible (INTEGER e); -import void Platform_Init (INTEGER argc, LONGINT argvadr); -import void Platform_MTimeAsClock (Platform_FileIdentity i, LONGINT *t, LONGINT *d); -import INTEGER Platform_New (CHAR *n, LONGINT n__len, LONGINT *h); -import BOOLEAN Platform_NoSuchDirectory (INTEGER e); -import LONGINT Platform_OSAllocate (LONGINT size); -import void Platform_OSFree (LONGINT address); -import INTEGER Platform_OldRO (CHAR *n, LONGINT n__len, LONGINT *h); -import INTEGER Platform_OldRW (CHAR *n, LONGINT n__len, LONGINT *h); -import INTEGER Platform_Read (LONGINT h, LONGINT p, LONGINT l, LONGINT *n); -import INTEGER Platform_ReadBuf (LONGINT h, SYSTEM_BYTE *b, LONGINT b__len, LONGINT *n); -import INTEGER Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); +import void Platform_GetIntArg (int16 n, int32 *val); +import void Platform_GetTimeOfDay (int32 *sec, int32 *usec); +import void Platform_Halt (int32 code); +import int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, LONGINT *identity__typ); +import int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); +import BOOLEAN Platform_Inaccessible (int16 e); +import void Platform_Init (int16 argc, int32 argvadr); +import void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); +import int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); +import BOOLEAN Platform_NoSuchDirectory (int16 e); +import int32 Platform_OSAllocate (int32 size); +import void Platform_OSFree (int32 address); +import int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); +import int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); +import int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n); +import int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n); +import int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); import BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); import BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); -import INTEGER Platform_Seek (LONGINT h, LONGINT offset, INTEGER whence); +import int16 Platform_Seek (int32 h, int32 offset, int16 whence); import void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); import void Platform_SetHalt (Platform_HaltProcedure p); import void Platform_SetInterruptHandler (Platform_SignalHandler handler); import void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Platform_FileIdentity source); import void Platform_SetQuitHandler (Platform_SignalHandler handler); -import INTEGER Platform_Size (LONGINT h, LONGINT *l); -import INTEGER Platform_Sync (LONGINT h); -import INTEGER Platform_System (CHAR *cmd, LONGINT cmd__len); -import LONGINT Platform_Time (void); -import BOOLEAN Platform_TimedOut (INTEGER e); -import BOOLEAN Platform_TooManyFiles (INTEGER e); -import INTEGER Platform_Truncate (LONGINT h, LONGINT l); -import INTEGER Platform_Unlink (CHAR *n, LONGINT n__len); -import INTEGER Platform_Write (LONGINT h, LONGINT p, LONGINT l); +import int16 Platform_Size (int32 h, int32 *l); +import int16 Platform_Sync (int32 h); +import int16 Platform_System (CHAR *cmd, LONGINT cmd__len); +import int32 Platform_Time (void); +import BOOLEAN Platform_TimedOut (int16 e); +import BOOLEAN Platform_TooManyFiles (int16 e); +import int16 Platform_Truncate (int32 h, int32 l); +import int16 Platform_Unlink (CHAR *n, LONGINT n__len); +import int16 Platform_Write (int32 h, int32 p, int32 l); import BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); import void *Platform__init(void); diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 28a855aa..4b500170 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -5,19 +5,19 @@ static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LONGINT d__len); -export void Reals_Convert (REAL x, INTEGER n, CHAR *d, LONGINT d__len); +export void Reals_Convert (REAL x, int16 n, CHAR *d, LONGINT d__len); export void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len); export void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len); -export void Reals_ConvertL (LONGREAL x, INTEGER n, CHAR *d, LONGINT d__len); -export INTEGER Reals_Expo (REAL x); -export INTEGER Reals_ExpoL (LONGREAL x); -export void Reals_SetExpo (REAL *x, INTEGER ex); -export REAL Reals_Ten (INTEGER e); -export LONGREAL Reals_TenL (INTEGER e); -static CHAR Reals_ToHex (INTEGER i); +export void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len); +export int16 Reals_Expo (REAL x); +export int16 Reals_ExpoL (LONGREAL x); +export void Reals_SetExpo (REAL *x, int16 ex); +export REAL Reals_Ten (int16 e); +export LONGREAL Reals_TenL (int16 e); +static CHAR Reals_ToHex (int16 i); -REAL Reals_Ten (INTEGER e) +REAL Reals_Ten (int16 e) { REAL _o_result; LONGREAL r, power; @@ -34,7 +34,7 @@ REAL Reals_Ten (INTEGER e) return _o_result; } -LONGREAL Reals_TenL (INTEGER e) +LONGREAL Reals_TenL (int16 e) { LONGREAL _o_result; LONGREAL r, power; @@ -54,43 +54,43 @@ LONGREAL Reals_TenL (INTEGER e) __RETCHK; } -INTEGER Reals_Expo (REAL x) +int16 Reals_Expo (REAL x) { - INTEGER _o_result; - INTEGER i; - __GET((SYSTEM_ADRINT)&x + 2, i, INTEGER); + int16 _o_result; + int16 i; + __GET((SYSTEM_ADRINT)&x + 2, i, int16); _o_result = __MASK(__ASHR(i, 7), -256); return _o_result; } -void Reals_SetExpo (REAL *x, INTEGER ex) +void Reals_SetExpo (REAL *x, int16 ex) { CHAR c; __GET((SYSTEM_ADRINT)x + 3, c, CHAR); - __PUT((SYSTEM_ADRINT)x + 3, (CHAR)(__ASHL(__ASHR((SYSTEM_INT16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __PUT((SYSTEM_ADRINT)x + 3, (CHAR)(__ASHL(__ASHR((int16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); __GET((SYSTEM_ADRINT)x + 2, c, CHAR); - __PUT((SYSTEM_ADRINT)x + 2, (CHAR)(__MASK((SYSTEM_INT16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); + __PUT((SYSTEM_ADRINT)x + 2, (CHAR)(__MASK((int16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } -INTEGER Reals_ExpoL (LONGREAL x) +int16 Reals_ExpoL (LONGREAL x) { - INTEGER _o_result; - INTEGER i; - __GET((SYSTEM_ADRINT)&x + 6, i, INTEGER); + int16 _o_result; + int16 i; + __GET((SYSTEM_ADRINT)&x + 6, i, int16); _o_result = __MASK(__ASHR(i, 4), -2048); return _o_result; } -void Reals_ConvertL (LONGREAL x, INTEGER n, CHAR *d, LONGINT d__len) +void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len) { - LONGINT i, j, k; + int32 i, j, k; if (x < (LONGREAL)0) { x = -x; } k = 0; if (n > 9) { - i = (SYSTEM_INT32)__ENTIER(x / (LONGREAL)(LONGREAL)1000000000); - j = (SYSTEM_INT32)__ENTIER(x - i * (LONGREAL)1000000000); + i = (int32)__ENTIER(x / (LONGREAL)(LONGREAL)1000000000); + j = (int32)__ENTIER(x - i * (LONGREAL)1000000000); if (j < 0) { j = 0; } @@ -100,7 +100,7 @@ void Reals_ConvertL (LONGREAL x, INTEGER n, CHAR *d, LONGINT d__len) k += 1; } } else { - i = (SYSTEM_INT32)__ENTIER(x); + i = (int32)__ENTIER(x); } while (k < n) { d[__X(k, d__len)] = (CHAR)((int)__MOD(i, 10) + 48); @@ -109,12 +109,12 @@ void Reals_ConvertL (LONGREAL x, INTEGER n, CHAR *d, LONGINT d__len) } } -void Reals_Convert (REAL x, INTEGER n, CHAR *d, LONGINT d__len) +void Reals_Convert (REAL x, int16 n, CHAR *d, LONGINT d__len) { Reals_ConvertL(x, n, (void*)d, d__len); } -static CHAR Reals_ToHex (INTEGER i) +static CHAR Reals_ToHex (int16 i) { CHAR _o_result; if (i < 10) { @@ -129,15 +129,15 @@ static CHAR Reals_ToHex (INTEGER i) static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LONGINT d__len) { - INTEGER i; - LONGINT l; + int16 i; + int32 l; CHAR by; i = 0; l = b__len; while (i < l) { by = __VAL(CHAR, b[__X(i, b__len)]); - d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((SYSTEM_INT16)by, 4)); - d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((SYSTEM_INT16)by, -16)); + d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((int16)by, 4)); + d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((int16)by, -16)); i += 1; } } diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index 65543fac..a1191c0b 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -8,15 +8,15 @@ -import void Reals_Convert (REAL x, INTEGER n, CHAR *d, LONGINT d__len); +import void Reals_Convert (REAL x, int16 n, CHAR *d, LONGINT d__len); import void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len); import void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len); -import void Reals_ConvertL (LONGREAL x, INTEGER n, CHAR *d, LONGINT d__len); -import INTEGER Reals_Expo (REAL x); -import INTEGER Reals_ExpoL (LONGREAL x); -import void Reals_SetExpo (REAL *x, INTEGER ex); -import REAL Reals_Ten (INTEGER e); -import LONGREAL Reals_TenL (INTEGER e); +import void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len); +import int16 Reals_Expo (REAL x); +import int16 Reals_ExpoL (LONGREAL x); +import void Reals_SetExpo (REAL *x, int16 ex); +import REAL Reals_Ten (int16 e); +import LONGREAL Reals_TenL (int16 e); import void *Reals__init(void); diff --git a/bootstrap/unix-44/SYSTEM.h b/bootstrap/unix-44/SYSTEM.h index 343404a4..11ec8fc5 100644 --- a/bootstrap/unix-44/SYSTEM.h +++ b/bootstrap/unix-44/SYSTEM.h @@ -2,19 +2,21 @@ #define SYSTEM__h #if defined(_WIN64) - typedef long long SYSTEM_INT64; - typedef unsigned long long SYSTEM_CARD64; + typedef long long int64; + typedef unsigned long long uint64; #else - typedef long SYSTEM_INT64; - typedef unsigned long SYSTEM_CARD64; + typedef long int64; + typedef unsigned long uint64; #endif -typedef int SYSTEM_INT32; -typedef unsigned int SYSTEM_CARD32; -typedef short int SYSTEM_INT16; -typedef unsigned short int SYSTEM_CARD16; -typedef signed char SYSTEM_INT8; -typedef unsigned char SYSTEM_CARD8; +typedef int int32; +typedef unsigned int uint32; + +typedef short int int16; +typedef unsigned short int uint16; + +typedef signed char int8; +typedef unsigned char uint8; #if (__SIZEOF_POINTER__ == 8) || defined(_WIN64) || defined(__LP64__) #if defined(_WIN64) @@ -26,12 +28,30 @@ typedef unsigned char SYSTEM_CARD8; typedef unsigned int size_t; #endif -#define SYSTEM_ADRINT size_t -#define SYSTEM_ADDRESS size_t // Temporarily for bootstrap #define _SIZE_T_DECLARED // For FreeBSD #define _SIZE_T_DEFINED_ // For OpenBSD -void *memcpy(void *dest, const void *source, SYSTEM_ADRINT size); +void *memcpy(void *dest, const void *source, size_t size); + + +// Temporary while bootstrapping: + +#define SYSTEM_INT8 int8 +#define SYSTEM_INT16 int16 +#define SYSTEM_INT32 int32 +#define SYSTEM_INT64 int64 +#define SYSTEM_ADDRESS size_t + +#define U_SYSTEM_INT8 uint8 +#define U_SYSTEM_INT16 uint16 +#define U_SYSTEM_INT32 uint32 +#define U_SYSTEM_INT64 uint64 + +#define U_int8 uint8 +#define U_int16 uint16 +#define U_int32 uint32 +#define U_int64 uint64 + @@ -52,41 +72,53 @@ void *memcpy(void *dest, const void *source, SYSTEM_ADRINT size); // Oberon types -typedef char BOOLEAN; -typedef unsigned char SYSTEM_BYTE; -typedef unsigned char CHAR; -typedef signed char SHORTINT; -typedef float REAL; -typedef double LONGREAL; -typedef void* SYSTEM_PTR; +// typedef char BOOLEAN; +// typedef unsigned char SYSTEM_BYTE; +// typedef unsigned char CHAR; +// typedef signed char SHORTINT; +// typedef float REAL; +// typedef double LONGREAL; +// typedef void* SYSTEM_PTR; + +typedef int8 BOOLEAN; +typedef int8 SYSTEM_BYTE; +typedef uint8 U_SYSTEM_BYTE; +typedef uint8 CHAR; +typedef uint8 U_CHAR; +typedef int8 SHORTINT; +typedef uint8 U_SHORTINT; +typedef float REAL; +typedef double LONGREAL; +typedef void* SYSTEM_PTR; + +typedef size_t SYSTEM_ADRINT; + // For 32 bit builds, the size of LONGINT depends on a make option: #if (__SIZEOF_POINTER__ == 8) || defined(LARGE) || defined(_WIN64) - typedef int INTEGER; // INTEGER is 32 bit. - typedef long long LONGINT; // LONGINT is 64 bit. (long long is always 64 bits, while long can be 32 bits e.g. under MSC/MingW) - typedef unsigned int U_INTEGER; - typedef unsigned long long U_LONGINT; + typedef int32 INTEGER; + typedef int64 LONGINT; + typedef uint32 U_INTEGER; + typedef uint64 U_LONGINT; #else - typedef short int INTEGER; // INTEGER is 16 bit. - typedef long LONGINT; // LONGINT is 32 bit. - typedef unsigned short int U_INTEGER; - typedef unsigned long U_LONGINT; + typedef int16 INTEGER; + typedef int32 LONGINT; + typedef uint16 U_INTEGER; + typedef uint32 U_LONGINT; #endif // Unsigned variants are for use by shift and rotate macros. -typedef unsigned char U_SYSTEM_BYTE; -typedef unsigned char U_CHAR; -typedef unsigned char U_SHORTINT; - typedef U_LONGINT SET; typedef U_LONGINT U_SET; -typedef SYSTEM_CARD8 U_SYSTEM_INT8; -typedef SYSTEM_CARD16 U_SYSTEM_INT16; -typedef SYSTEM_CARD32 U_SYSTEM_INT32; -typedef SYSTEM_CARD64 U_SYSTEM_INT64; + + + +// ---------------------------------------------------------------------- +// ---------------------------------------------------------------------- + // OS Memory allocation interfaces are in PlatformXXX.Mod diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index 834c1fb1..6463db16 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -6,19 +6,19 @@ export void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len); export void Strings_Cap (CHAR *s, LONGINT s__len); -export void Strings_Delete (CHAR *s, LONGINT s__len, INTEGER pos, INTEGER n); -export void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n, CHAR *dest, LONGINT dest__len); -export void Strings_Insert (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, LONGINT dest__len); -export INTEGER Strings_Length (CHAR *s, LONGINT s__len); +export void Strings_Delete (CHAR *s, LONGINT s__len, int16 pos, int16 n); +export void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHAR *dest, LONGINT dest__len); +export void Strings_Insert (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len); +export int16 Strings_Length (CHAR *s, LONGINT s__len); export BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len); -export INTEGER Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, INTEGER pos); -export void Strings_Replace (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, LONGINT dest__len); +export int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int16 pos); +export void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len); -INTEGER Strings_Length (CHAR *s, LONGINT s__len) +int16 Strings_Length (CHAR *s, LONGINT s__len) { - INTEGER _o_result; - INTEGER i; + int16 _o_result; + int16 i; __DUP(s, s__len, CHAR); i = 0; while ((i < s__len && s[__X(i, s__len)] != 0x00)) { @@ -31,7 +31,7 @@ INTEGER Strings_Length (CHAR *s, LONGINT s__len) void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len) { - INTEGER n1, n2, i; + int16 n1, n2, i; __DUP(extra, extra__len, CHAR); n1 = Strings_Length(dest, dest__len); n2 = Strings_Length(extra, extra__len); @@ -46,9 +46,9 @@ void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__ __DEL(extra); } -void Strings_Insert (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, LONGINT dest__len) +void Strings_Insert (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len) { - INTEGER n1, n2, i; + int16 n1, n2, i; __DUP(source, source__len, CHAR); n1 = Strings_Length(dest, dest__len); n2 = Strings_Length(source, source__len); @@ -76,9 +76,9 @@ void Strings_Insert (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, __DEL(source); } -void Strings_Delete (CHAR *s, LONGINT s__len, INTEGER pos, INTEGER n) +void Strings_Delete (CHAR *s, LONGINT s__len, int16 pos, int16 n) { - INTEGER len, i; + int16 len, i; len = Strings_Length(s, s__len); if (pos < 0) { pos = 0; @@ -99,7 +99,7 @@ void Strings_Delete (CHAR *s, LONGINT s__len, INTEGER pos, INTEGER n) } } -void Strings_Replace (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, LONGINT dest__len) +void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len) { __DUP(source, source__len, CHAR); Strings_Delete((void*)dest, dest__len, pos, pos + Strings_Length(source, source__len)); @@ -107,12 +107,12 @@ void Strings_Replace (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest __DEL(source); } -void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n, CHAR *dest, LONGINT dest__len) +void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHAR *dest, LONGINT dest__len) { - INTEGER len, destLen, i; + int16 len, destLen, i; __DUP(source, source__len, CHAR); len = Strings_Length(source, source__len); - destLen = (SYSTEM_INT16)dest__len - 1; + destLen = (int16)dest__len - 1; if (pos < 0) { pos = 0; } @@ -131,10 +131,10 @@ void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n, __DEL(source); } -INTEGER Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, INTEGER pos) +int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int16 pos) { - INTEGER _o_result; - INTEGER n1, n2, i, j; + int16 _o_result; + int16 n1, n2, i, j; __DUP(pattern, pattern__len, CHAR); __DUP(s, s__len, CHAR); n1 = Strings_Length(s, s__len); @@ -169,7 +169,7 @@ INTEGER Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__le void Strings_Cap (CHAR *s, LONGINT s__len) { - INTEGER i; + int16 i; i = 0; while (s[__X(i, s__len)] != 0x00) { if (('a' <= s[__X(i, s__len)] && s[__X(i, s__len)] <= 'z')) { @@ -183,9 +183,9 @@ static struct Match__7 { struct Match__7 *lnk; } *Match__7_s; -static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, INTEGER n, INTEGER m); +static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, int16 n, int16 m); -static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, INTEGER n, INTEGER m) +static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, int16 n, int16 m) { BOOLEAN _o_result; while ((((n >= 0 && m >= 0)) && mask[__X(m, mask__len)] != '*')) { diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index 2edcc736..07051628 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -10,13 +10,13 @@ import void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len); import void Strings_Cap (CHAR *s, LONGINT s__len); -import void Strings_Delete (CHAR *s, LONGINT s__len, INTEGER pos, INTEGER n); -import void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n, CHAR *dest, LONGINT dest__len); -import void Strings_Insert (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, LONGINT dest__len); -import INTEGER Strings_Length (CHAR *s, LONGINT s__len); +import void Strings_Delete (CHAR *s, LONGINT s__len, int16 pos, int16 n); +import void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHAR *dest, LONGINT dest__len); +import void Strings_Insert (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len); +import int16 Strings_Length (CHAR *s, LONGINT s__len); import BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len); -import INTEGER Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, INTEGER pos); -import void Strings_Replace (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, LONGINT dest__len); +import int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int16 pos); +import void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len); import void *Strings__init(void); diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index df4278f7..a736989a 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -13,9 +13,9 @@ typedef typedef struct Texts_RunDesc { Texts_Run prev, next; - LONGINT len; + int32 len; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; BOOLEAN ascii; } Texts_RunDesc; @@ -36,26 +36,26 @@ typedef typedef struct Texts_ElemDesc { Texts_Run prev, next; - LONGINT len; + int32 len; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; BOOLEAN ascii; - LONGINT W, H; + int32 W, H; Texts_Handler handle; Texts_Text base; } Texts_ElemDesc; struct Texts__1 { /* Texts_ElemDesc */ Texts_Run prev, next; - LONGINT len; + int32 len; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; BOOLEAN ascii; - LONGINT W, H; + int32 W, H; Texts_Handler handle; Texts_Text base; Files_File file; - LONGINT org, span; + int32 org, span; CHAR mod[32], proc[32]; }; @@ -64,7 +64,7 @@ typedef typedef struct Texts_BufDesc { - LONGINT len; + int32 len; Texts_Run head; } Texts_BufDesc; @@ -78,8 +78,8 @@ typedef typedef struct Texts_FileMsg { /* Texts_ElemMsg */ - INTEGER id; - LONGINT pos; + int16 id; + int32 pos; Files_Rider r; } Texts_FileMsg; @@ -94,7 +94,7 @@ typedef } Texts_IdentifyMsg; typedef - void (*Texts_Notifier)(Texts_Text, INTEGER, LONGINT, LONGINT); + void (*Texts_Notifier)(Texts_Text, int16, int32, int32); typedef struct Texts_PieceDesc *Texts_Piece; @@ -102,57 +102,57 @@ typedef typedef struct Texts_PieceDesc { Texts_Run prev, next; - LONGINT len; + int32 len; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; BOOLEAN ascii; Files_File file; - LONGINT org; + int32 org; } Texts_PieceDesc; typedef struct Texts_Reader { BOOLEAN eot; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; Texts_Elem elem; Files_Rider rider; Texts_Run run; - LONGINT org, off; + int32 org, off; } Texts_Reader; typedef struct Texts_Scanner { /* Texts_Reader */ BOOLEAN eot; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; Texts_Elem elem; Files_Rider rider; Texts_Run run; - LONGINT org, off; + int32 org, off; CHAR nextCh; - INTEGER line, class; - LONGINT i; + int16 line, class; + int32 i; REAL x; LONGREAL y; CHAR c; - SHORTINT len; + int8 len; CHAR s[64]; } Texts_Scanner; typedef struct Texts_TextDesc { - LONGINT len; + int32 len; Texts_Notifier notify; Texts_Run head, cache; - LONGINT corg; + int32 corg; } Texts_TextDesc; typedef struct Texts_Writer { Texts_Buffer buf; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; Files_Rider rider; Files_File file; } Texts_Writer; @@ -178,50 +178,50 @@ export LONGINT *Texts_Writer__typ; export LONGINT *Texts__1__typ; export void Texts_Append (Texts_Text T, Texts_Buffer B); -export void Texts_ChangeLooks (Texts_Text T, LONGINT beg, LONGINT end, SET sel, Texts_FontsFont fnt, SHORTINT col, SHORTINT voff); +export void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff); static Texts_Elem Texts_CloneElem (Texts_Elem e); static Texts_Piece Texts_ClonePiece (Texts_Piece p); export void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len); export void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); export void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); -export void Texts_Delete (Texts_Text T, LONGINT beg, LONGINT end); +export void Texts_Delete (Texts_Text T, int32 beg, int32 end); export Texts_Text Texts_ElemBase (Texts_Elem E); -export LONGINT Texts_ElemPos (Texts_Elem E); -static void Texts_Find (Texts_Text T, LONGINT *pos, Texts_Run *u, LONGINT *org, LONGINT *off); +export int32 Texts_ElemPos (Texts_Elem E); +static void Texts_Find (Texts_Text T, int32 *pos, Texts_Run *u, int32 *org, int32 *off); static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len); static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, LONGINT *msg__typ); -export void Texts_Insert (Texts_Text T, LONGINT pos, Texts_Buffer B); +export void Texts_Insert (Texts_Text T, int32 pos, Texts_Buffer B); export void Texts_Load (Files_Rider *r, LONGINT *r__typ, Texts_Text T); static void Texts_Load0 (Files_Rider *r, LONGINT *r__typ, Texts_Text T); static void Texts_Merge (Texts_Text T, Texts_Run u, Texts_Run *v); export void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len); export void Texts_OpenBuf (Texts_Buffer B); -export void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, LONGINT pos); -export void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, LONGINT pos); +export void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, int32 pos); +export void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, int32 pos); export void Texts_OpenWriter (Texts_Writer *W, LONGINT *W__typ); -export LONGINT Texts_Pos (Texts_Reader *R, LONGINT *R__typ); +export int32 Texts_Pos (Texts_Reader *R, LONGINT *R__typ); export void Texts_Read (Texts_Reader *R, LONGINT *R__typ, CHAR *ch); export void Texts_ReadElem (Texts_Reader *R, LONGINT *R__typ); export void Texts_ReadPrevElem (Texts_Reader *R, LONGINT *R__typ); export void Texts_Recall (Texts_Buffer *B); -export void Texts_Save (Texts_Text T, LONGINT beg, LONGINT end, Texts_Buffer B); +export void Texts_Save (Texts_Text T, int32 beg, int32 end, Texts_Buffer B); export void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ); -export void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, SHORTINT col); +export void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, int8 col); export void Texts_SetFont (Texts_Writer *W, LONGINT *W__typ, Texts_FontsFont fnt); -export void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, SHORTINT voff); +export void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, int8 voff); static void Texts_Splice (Texts_Run un, Texts_Run v, Texts_Run w, Texts_Text base); -static void Texts_Split (LONGINT off, Texts_Run *u, Texts_Run *un); +static void Texts_Split (int32 off, Texts_Run *u, Texts_Run *un); export void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T); export void Texts_Write (Texts_Writer *W, LONGINT *W__typ, CHAR ch); -export void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, LONGINT t, LONGINT d); +export void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, int32 t, int32 d); export void Texts_WriteElem (Texts_Writer *W, LONGINT *W__typ, Texts_Elem e); -export void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, LONGINT x); -export void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n); +export void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, int32 x); +export void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int32 x, int32 n); export void Texts_WriteLn (Texts_Writer *W, LONGINT *W__typ); -export void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER n); +export void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, int16 n); export void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x); -export void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n); -export void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n, INTEGER k); +export void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, int16 n); +export void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, int16 n, int16 k); export void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x); export void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__len); @@ -236,10 +236,10 @@ static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len) return _o_result; } -static void Texts_Find (Texts_Text T, LONGINT *pos, Texts_Run *u, LONGINT *org, LONGINT *off) +static void Texts_Find (Texts_Text T, int32 *pos, Texts_Run *u, int32 *org, int32 *off) { Texts_Run v = NIL; - LONGINT m; + int32 m; if (*pos >= T->len) { *pos = T->len; *u = T->head; @@ -269,7 +269,7 @@ static void Texts_Find (Texts_Text T, LONGINT *pos, Texts_Run *u, LONGINT *org, } } -static void Texts_Split (LONGINT off, Texts_Run *u, Texts_Run *un) +static void Texts_Split (int32 off, Texts_Run *u, Texts_Run *un) { Texts_Piece p = NIL, U = NIL; if (off == 0) { @@ -368,11 +368,11 @@ Texts_Text Texts_ElemBase (Texts_Elem E) return _o_result; } -LONGINT Texts_ElemPos (Texts_Elem E) +int32 Texts_ElemPos (Texts_Elem E) { - LONGINT _o_result; + int32 _o_result; Texts_Run u = NIL; - LONGINT pos; + int32 pos; u = E->base->head->next; pos = 0; while (u != (void *) E) { @@ -387,7 +387,7 @@ static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, LONGINT *msg__t { Texts_Alien e = NIL; Files_Rider r; - LONGINT i; + int32 i; CHAR ch; if (__ISP(E, Texts__1, 2)) { if (__IS(msg__typ, Texts_CopyMsg, 1)) { @@ -463,10 +463,10 @@ void Texts_Recall (Texts_Buffer *B) Texts_del = NIL; } -void Texts_Save (Texts_Text T, LONGINT beg, LONGINT end, Texts_Buffer B) +void Texts_Save (Texts_Text T, int32 beg, int32 end, Texts_Buffer B) { Texts_Run u = NIL, v = NIL, w = NIL, wn = NIL; - LONGINT uo, ud, vo, vd; + int32 uo, ud, vo, vd; Texts_Find(T, &beg, &u, &uo, &ud); Texts_Find(T, &end, &v, &vo, &vd); w = B->head->prev; @@ -497,11 +497,11 @@ void Texts_Save (Texts_Text T, LONGINT beg, LONGINT end, Texts_Buffer B) B->len += end - beg; } -void Texts_Insert (Texts_Text T, LONGINT pos, Texts_Buffer B) +void Texts_Insert (Texts_Text T, int32 pos, Texts_Buffer B) { Texts_Run u = NIL, un = NIL, v = NIL; Texts_Piece p = NIL, q = NIL; - LONGINT uo, ud, len; + int32 uo, ud, len; Texts_Find(T, &pos, &u, &uo, &ud); Texts_Split(ud, &u, &un); len = B->len; @@ -520,7 +520,7 @@ void Texts_Insert (Texts_Text T, LONGINT pos, Texts_Buffer B) void Texts_Append (Texts_Text T, Texts_Buffer B) { Texts_Run v = NIL; - LONGINT pos, len; + int32 pos, len; pos = T->len; len = B->len; v = B->head->next; @@ -535,10 +535,10 @@ void Texts_Append (Texts_Text T, Texts_Buffer B) } } -void Texts_Delete (Texts_Text T, LONGINT beg, LONGINT end) +void Texts_Delete (Texts_Text T, int32 beg, int32 end) { Texts_Run c = NIL, u = NIL, un = NIL, v = NIL, vn = NIL; - LONGINT co, uo, ud, vo, vd; + int32 co, uo, ud, vo, vd; Texts_Find(T, &beg, &u, &uo, &ud); Texts_Split(ud, &u, &un); c = T->cache; @@ -560,10 +560,10 @@ void Texts_Delete (Texts_Text T, LONGINT beg, LONGINT end) } } -void Texts_ChangeLooks (Texts_Text T, LONGINT beg, LONGINT end, SET sel, Texts_FontsFont fnt, SHORTINT col, SHORTINT voff) +void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff) { Texts_Run c = NIL, u = NIL, un = NIL, v = NIL, vn = NIL; - LONGINT co, uo, ud, vo, vd; + int32 co, uo, ud, vo, vd; Texts_Find(T, &beg, &u, &uo, &ud); Texts_Split(ud, &u, &un); c = T->cache; @@ -599,7 +599,7 @@ void Texts_ChangeLooks (Texts_Text T, LONGINT beg, LONGINT end, SET sel, Texts_F } } -void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, LONGINT pos) +void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, int32 pos) { Texts_Run u = NIL; if (pos >= T->len) { @@ -616,7 +616,7 @@ void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, LONGINT p void Texts_Read (Texts_Reader *R, LONGINT *R__typ, CHAR *ch) { Texts_Run u = NIL; - LONGINT pos; + int32 pos; CHAR nextch; u = (*R).run; (*R).fnt = u->fnt; @@ -708,14 +708,14 @@ void Texts_ReadPrevElem (Texts_Reader *R, LONGINT *R__typ) } } -LONGINT Texts_Pos (Texts_Reader *R, LONGINT *R__typ) +int32 Texts_Pos (Texts_Reader *R, LONGINT *R__typ) { - LONGINT _o_result; + int32 _o_result; _o_result = (*R).org + (*R).off; return _o_result; } -void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, LONGINT pos) +void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, int32 pos) { Texts_OpenReader((void*)&*S, S__typ, T, pos); (*S).line = 0; @@ -727,7 +727,7 @@ static struct Scan__31 { LONGINT *S__typ; CHAR *ch; BOOLEAN *negE; - INTEGER *e; + int16 *e; struct Scan__31 *lnk; } *Scan__31_s; @@ -746,7 +746,7 @@ static void ReadScaleFactor__32 (void) } } while (('0' <= *Scan__31_s->ch && *Scan__31_s->ch <= '9')) { - *Scan__31_s->e = (*Scan__31_s->e * 10 + (SYSTEM_INT16)*Scan__31_s->ch) - 48; + *Scan__31_s->e = (*Scan__31_s->e * 10 + (int16)*Scan__31_s->ch) - 48; Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); } } @@ -755,9 +755,9 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) { CHAR ch, term; BOOLEAN neg, negE, hex; - SHORTINT i, j, h; - INTEGER e; - LONGINT k; + int8 i, j, h; + int16 e; + int32 k; REAL x, f; LONGREAL y, g; CHAR d[32]; @@ -818,10 +818,10 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) if ('9' < ch) { if (('A' <= ch && ch <= 'F')) { hex = 1; - ch = (CHAR)((SYSTEM_INT16)ch - 7); + ch = (CHAR)((int16)ch - 7); } else if (('a' <= ch && ch <= 'f')) { hex = 1; - ch = (CHAR)((SYSTEM_INT16)ch - 39); + ch = (CHAR)((int16)ch - 39); } else { break; } @@ -833,13 +833,13 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) if (i - j > 8) { j = i - 8; } - k = (SYSTEM_INT16)d[__X(j, 32)] - 48; + k = (int16)d[__X(j, 32)] - 48; j += 1; if ((i - j == 7 && k >= 8)) { k -= 16; } while (j < i) { - k = __ASHL(k, 4) + ((SYSTEM_INT16)d[__X(j, 32)] - 48); + k = __ASHL(k, 4) + ((int16)d[__X(j, 32)] - 48); j += 1; } if (neg) { @@ -860,12 +860,12 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) y = (LONGREAL)0; g = (LONGREAL)1; do { - y = y * (LONGREAL)10 + ((SYSTEM_INT16)d[__X(j, 32)] - 48); + y = y * (LONGREAL)10 + ((int16)d[__X(j, 32)] - 48); j += 1; } while (!(j == h)); while (j < i) { g = g / (LONGREAL)(LONGREAL)10; - y = ((SYSTEM_INT16)d[__X(j, 32)] - 48) * g + y; + y = ((int16)d[__X(j, 32)] - 48) * g + y; j += 1; } ReadScaleFactor__32(); @@ -892,12 +892,12 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) x = (REAL)0; f = (REAL)1; do { - x = x * (REAL)10 + ((SYSTEM_INT16)d[__X(j, 32)] - 48); + x = x * (REAL)10 + ((int16)d[__X(j, 32)] - 48); j += 1; } while (!(j == h)); while (j < i) { f = f / (REAL)(REAL)10; - x = ((SYSTEM_INT16)d[__X(j, 32)] - 48) * f + x; + x = ((int16)d[__X(j, 32)] - 48) * f + x; j += 1; } if (ch == 'E') { @@ -929,7 +929,7 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) (*S).class = 3; k = 0; do { - k = k * 10 + ((SYSTEM_INT16)d[__X(j, 32)] - 48); + k = k * 10 + ((int16)d[__X(j, 32)] - 48); j += 1; } while (!(j == i)); if (neg) { @@ -973,12 +973,12 @@ void Texts_SetFont (Texts_Writer *W, LONGINT *W__typ, Texts_FontsFont fnt) (*W).fnt = fnt; } -void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, SHORTINT col) +void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, int8 col) { (*W).col = col; } -void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, SHORTINT voff) +void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, int8 voff) { (*W).voff = voff; } @@ -1035,7 +1035,7 @@ void Texts_WriteLn (Texts_Writer *W, LONGINT *W__typ) void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__len) { - INTEGER i; + int16 i; __DUP(s, s__len, CHAR); i = 0; while (s[__X(i, s__len)] >= ' ') { @@ -1045,10 +1045,10 @@ void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__le __DEL(s); } -void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n) +void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int32 x, int32 n) { - INTEGER i; - LONGINT x0; + int16 i; + int32 x0; CHAR a[22]; i = 0; if (x < 0) { @@ -1080,10 +1080,10 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n) } while (!(i == 0)); } -void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, LONGINT x) +void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, int32 x) { - INTEGER i; - LONGINT y; + int16 i; + int32 y; CHAR a[20]; i = 0; Texts_Write(&*W, W__typ, ' '); @@ -1103,9 +1103,9 @@ void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, LONGINT x) } while (!(i == 0)); } -void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n) +void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, int16 n) { - INTEGER e; + int16 e; REAL x0; CHAR d[9]; e = Reals_Expo(x); @@ -1176,15 +1176,15 @@ void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n) static struct WriteRealFix__53 { Texts_Writer *W; LONGINT *W__typ; - INTEGER *i; + int16 *i; CHAR (*d)[9]; struct WriteRealFix__53 *lnk; } *WriteRealFix__53_s; -static void dig__54 (INTEGER n); -static void seq__56 (CHAR ch, INTEGER n); +static void dig__54 (int16 n); +static void seq__56 (CHAR ch, int16 n); -static void seq__56 (CHAR ch, INTEGER n) +static void seq__56 (CHAR ch, int16 n) { while (n > 0) { Texts_Write(&*WriteRealFix__53_s->W, WriteRealFix__53_s->W__typ, ch); @@ -1192,7 +1192,7 @@ static void seq__56 (CHAR ch, INTEGER n) } } -static void dig__54 (INTEGER n) +static void dig__54 (int16 n) { while (n > 0) { *WriteRealFix__53_s->i -= 1; @@ -1201,9 +1201,9 @@ static void dig__54 (INTEGER n) } } -void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n, INTEGER k) +void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, int16 n, int16 k) { - INTEGER e, i; + int16 e, i; CHAR sign; REAL x0; CHAR d[9]; @@ -1275,7 +1275,7 @@ void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n, IN void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x) { - INTEGER i; + int16 i; CHAR d[8]; Reals_ConvertH(x, (void*)d, 8); i = 0; @@ -1285,9 +1285,9 @@ void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x) } while (!(i == 8)); } -void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER n) +void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, int16 n) { - INTEGER e; + int16 e; LONGREAL x0; CHAR d[16]; e = Reals_ExpoL(x); @@ -1319,7 +1319,7 @@ void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER } else { Texts_Write(&*W, W__typ, ' '); } - e = (SYSTEM_INT16)__ASHR((e - 1023) * 77, 8); + e = (int16)__ASHR((e - 1023) * 77, 8); if (e >= 0) { x = x / (LONGREAL)Reals_TenL(e); } else { @@ -1359,7 +1359,7 @@ void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x) { - INTEGER i; + int16 i; CHAR d[16]; Reals_ConvertHL(x, (void*)d, 16); i = 0; @@ -1375,16 +1375,16 @@ static struct WriteDate__43 { struct WriteDate__43 *lnk; } *WriteDate__43_s; -static void WritePair__44 (CHAR ch, LONGINT x); +static void WritePair__44 (CHAR ch, int32 x); -static void WritePair__44 (CHAR ch, LONGINT x) +static void WritePair__44 (CHAR ch, int32 x) { Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, ch); Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)(__DIV(x, 10) + 48)); Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)((int)__MOD(x, 10) + 48)); } -void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, LONGINT t, LONGINT d) +void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, int32 t, int32 d) { struct WriteDate__43 _s; _s.W = W; _s.W__typ = W__typ; @@ -1401,22 +1401,22 @@ void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, LONGINT t, LONGINT d) static struct Load0__16 { Texts_Text *T; - SHORTINT *ecnt; + int8 *ecnt; Files_File *f; Texts_FileMsg *msg; CHAR (*mods)[64][32], (*procs)[64][32]; struct Load0__16 *lnk; } *Load0__16_s; -static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, LONGINT span, Texts_Elem *e); +static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, int32 pos, int32 span, Texts_Elem *e); -static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, LONGINT span, Texts_Elem *e) +static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, int32 pos, int32 span, Texts_Elem *e) { Modules_Module M = NIL; Modules_Command Cmd; Texts_Alien a = NIL; - LONGINT org, ew, eh; - SHORTINT eno; + int32 org, ew, eh; + int8 eno; Texts_new = NIL; Files_ReadLInt(&*r, r__typ, &ew); Files_ReadLInt(&*r, r__typ, &eh); @@ -1466,8 +1466,8 @@ static void Texts_Load0 (Files_Rider *r, LONGINT *r__typ, Texts_Text T) Texts_Run u = NIL, un = NIL; Texts_Piece p = NIL; Texts_Elem e = NIL; - LONGINT org, pos, hlen, plen; - SHORTINT ecnt, fno, fcnt, col, voff; + int32 org, pos, hlen, plen; + int8 ecnt, fno, fcnt, col, voff; Files_File f = NIL; Texts_FileMsg msg; CHAR mods[64][32], procs[64][32]; @@ -1537,7 +1537,7 @@ static void Texts_Load0 (Files_Rider *r, LONGINT *r__typ, Texts_Text T) void Texts_Load (Files_Rider *r, LONGINT *r__typ, Texts_Text T) { - INTEGER tag; + int16 tag; Files_ReadInt(&*r, r__typ, &tag); if (tag != -4095) { Files_Set(&*r, r__typ, Files_Base(&*r, r__typ), Files_Pos(&*r, r__typ) - 2); @@ -1552,7 +1552,7 @@ void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len) Texts_Run u = NIL; Texts_Piece p = NIL; CHAR tag, version; - LONGINT hlen; + int32 hlen; __DUP(name, name__len, CHAR); f = Files_Old(name, name__len); if (f == NIL) { @@ -1602,20 +1602,20 @@ void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len) } static struct Store__39 { - SHORTINT *ecnt; + int8 *ecnt; Texts_FileMsg *msg; Texts_IdentifyMsg *iden; CHAR (*mods)[64][32], (*procs)[64][32]; struct Store__39 *lnk; } *Store__39_s; -static void StoreElem__40 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, Texts_Elem e); +static void StoreElem__40 (Files_Rider *r, LONGINT *r__typ, int32 pos, Texts_Elem e); -static void StoreElem__40 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, Texts_Elem e) +static void StoreElem__40 (Files_Rider *r, LONGINT *r__typ, int32 pos, Texts_Elem e) { Files_Rider r1; - LONGINT org, span; - SHORTINT eno; + int32 org, span; + int8 eno; __COPY((*Store__39_s->iden).mod, (*Store__39_s->mods)[__X(*Store__39_s->ecnt, 64)], 32); __COPY((*Store__39_s->iden).proc, (*Store__39_s->procs)[__X(*Store__39_s->ecnt, 64)], 32); eno = 1; @@ -1646,8 +1646,8 @@ void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T) Files_Rider r1; Texts_Run u = NIL, un = NIL; Texts_Elem e = NIL; - LONGINT org, pos, delta, hlen, rlen; - SHORTINT ecnt, fno, fcnt; + int32 org, pos, delta, hlen, rlen; + int8 ecnt, fno, fcnt; CHAR ch; Texts_FileMsg msg; Texts_IdentifyMsg iden; @@ -1764,7 +1764,7 @@ void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len) { Files_File f = NIL; Files_Rider r; - INTEGER i, res; + int16 i, res; CHAR bak[64]; __DUP(name, name__len, CHAR); f = Files_New(name, name__len); diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index c878ff62..bba6eb24 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -8,7 +8,7 @@ typedef struct Texts_BufDesc { - LONGINT len; + int32 len; char _prvt0[4]; } Texts_BufDesc; @@ -40,15 +40,15 @@ typedef typedef struct Texts_ElemDesc { char _prvt0[20]; - LONGINT W, H; + int32 W, H; Texts_Handler handle; char _prvt1[4]; } Texts_ElemDesc; typedef struct Texts_FileMsg { /* Texts_ElemMsg */ - INTEGER id; - LONGINT pos; + int16 id; + int32 pos; Files_Rider r; } Texts_FileMsg; @@ -69,13 +69,13 @@ typedef struct Texts_TextDesc *Texts_Text; typedef - void (*Texts_Notifier)(Texts_Text, INTEGER, LONGINT, LONGINT); + void (*Texts_Notifier)(Texts_Text, int16, int32, int32); typedef struct Texts_Reader { BOOLEAN eot; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; Texts_Elem elem; char _prvt0[32]; } Texts_Reader; @@ -84,22 +84,22 @@ typedef struct Texts_Scanner { /* Texts_Reader */ BOOLEAN eot; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; Texts_Elem elem; char _prvt0[32]; CHAR nextCh; - INTEGER line, class; - LONGINT i; + int16 line, class; + int32 i; REAL x; LONGREAL y; CHAR c; - SHORTINT len; + int8 len; CHAR s[64]; } Texts_Scanner; typedef struct Texts_TextDesc { - LONGINT len; + int32 len; Texts_Notifier notify; char _prvt0[12]; } Texts_TextDesc; @@ -108,7 +108,7 @@ typedef struct Texts_Writer { Texts_Buffer buf; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; char _prvt0[26]; } Texts_Writer; @@ -129,41 +129,41 @@ import LONGINT *Texts_Scanner__typ; import LONGINT *Texts_Writer__typ; import void Texts_Append (Texts_Text T, Texts_Buffer B); -import void Texts_ChangeLooks (Texts_Text T, LONGINT beg, LONGINT end, SET sel, Texts_FontsFont fnt, SHORTINT col, SHORTINT voff); +import void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff); import void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len); import void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); import void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); -import void Texts_Delete (Texts_Text T, LONGINT beg, LONGINT end); +import void Texts_Delete (Texts_Text T, int32 beg, int32 end); import Texts_Text Texts_ElemBase (Texts_Elem E); -import LONGINT Texts_ElemPos (Texts_Elem E); -import void Texts_Insert (Texts_Text T, LONGINT pos, Texts_Buffer B); +import int32 Texts_ElemPos (Texts_Elem E); +import void Texts_Insert (Texts_Text T, int32 pos, Texts_Buffer B); import void Texts_Load (Files_Rider *r, LONGINT *r__typ, Texts_Text T); import void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len); import void Texts_OpenBuf (Texts_Buffer B); -import void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, LONGINT pos); -import void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, LONGINT pos); +import void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, int32 pos); +import void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, int32 pos); import void Texts_OpenWriter (Texts_Writer *W, LONGINT *W__typ); -import LONGINT Texts_Pos (Texts_Reader *R, LONGINT *R__typ); +import int32 Texts_Pos (Texts_Reader *R, LONGINT *R__typ); import void Texts_Read (Texts_Reader *R, LONGINT *R__typ, CHAR *ch); import void Texts_ReadElem (Texts_Reader *R, LONGINT *R__typ); import void Texts_ReadPrevElem (Texts_Reader *R, LONGINT *R__typ); import void Texts_Recall (Texts_Buffer *B); -import void Texts_Save (Texts_Text T, LONGINT beg, LONGINT end, Texts_Buffer B); +import void Texts_Save (Texts_Text T, int32 beg, int32 end, Texts_Buffer B); import void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ); -import void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, SHORTINT col); +import void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, int8 col); import void Texts_SetFont (Texts_Writer *W, LONGINT *W__typ, Texts_FontsFont fnt); -import void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, SHORTINT voff); +import void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, int8 voff); import void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T); import void Texts_Write (Texts_Writer *W, LONGINT *W__typ, CHAR ch); -import void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, LONGINT t, LONGINT d); +import void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, int32 t, int32 d); import void Texts_WriteElem (Texts_Writer *W, LONGINT *W__typ, Texts_Elem e); -import void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, LONGINT x); -import void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n); +import void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, int32 x); +import void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int32 x, int32 n); import void Texts_WriteLn (Texts_Writer *W, LONGINT *W__typ); -import void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER n); +import void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, int16 n); import void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x); -import void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n); -import void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n, INTEGER k); +import void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, int16 n); +import void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, int16 n, int16 k); import void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x); import void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__len); import void *Texts__init(void); diff --git a/bootstrap/unix-44/Vishap.c b/bootstrap/unix-44/Vishap.c index 030b94f6..c8f81032 100644 --- a/bootstrap/unix-44/Vishap.c +++ b/bootstrap/unix-44/Vishap.c @@ -20,7 +20,7 @@ static CHAR Vishap_mname[256]; export void Vishap_Module (BOOLEAN *done); static void Vishap_PropagateElementaryTypeSizes (void); export void Vishap_Translate (void); -static void Vishap_Trap (INTEGER sig); +static void Vishap_Trap (int16 sig); void Vishap_Module (BOOLEAN *done) @@ -126,7 +126,7 @@ void Vishap_Translate (void) } } -static void Vishap_Trap (INTEGER sig) +static void Vishap_Trap (int16 sig) { Heap_FINALL(); if (sig == 3) { diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index bfab2dc6..b894b3f9 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -17,7 +17,7 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGINT cmd__len) { - INTEGER r, status, exitcode; + int16 r, status, exitcode; __DUP(title, title__len, CHAR); __DUP(cmd, cmd__len, CHAR); if (OPM_Verbose) { diff --git a/bootstrap/unix-44/vt100.c b/bootstrap/unix-44/vt100.c index 84707926..46a1e460 100644 --- a/bootstrap/unix-44/vt100.c +++ b/bootstrap/unix-44/vt100.c @@ -8,36 +8,36 @@ export CHAR vt100_CSI[5]; static CHAR vt100_tmpstr[32]; -export void vt100_CHA (INTEGER n); -export void vt100_CNL (INTEGER n); -export void vt100_CPL (INTEGER n); -export void vt100_CUB (INTEGER n); -export void vt100_CUD (INTEGER n); -export void vt100_CUF (INTEGER n); -export void vt100_CUP (INTEGER n, INTEGER m); -export void vt100_CUU (INTEGER n); +export void vt100_CHA (int16 n); +export void vt100_CNL (int16 n); +export void vt100_CPL (int16 n); +export void vt100_CUB (int16 n); +export void vt100_CUD (int16 n); +export void vt100_CUF (int16 n); +export void vt100_CUP (int16 n, int16 m); +export void vt100_CUU (int16 n); export void vt100_DECTCEMh (void); export void vt100_DECTCEMl (void); -export void vt100_DSR (INTEGER n); -export void vt100_ED (INTEGER n); -export void vt100_EL (INTEGER n); -static void vt100_EscSeq (INTEGER n, CHAR *letter, LONGINT letter__len); +export void vt100_DSR (int16 n); +export void vt100_ED (int16 n); +export void vt100_EL (int16 n); +static void vt100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len); static void vt100_EscSeq0 (CHAR *letter, LONGINT letter__len); -static void vt100_EscSeq2 (INTEGER n, INTEGER m, CHAR *letter, LONGINT letter__len); -static void vt100_EscSeqSwapped (INTEGER n, CHAR *letter, LONGINT letter__len); -export void vt100_HVP (INTEGER n, INTEGER m); -export void vt100_IntToStr (LONGINT int_, CHAR *str, LONGINT str__len); +static void vt100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len); +static void vt100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len); +export void vt100_HVP (int16 n, int16 m); +export void vt100_IntToStr (int32 int_, CHAR *str, LONGINT str__len); export void vt100_RCP (void); -static void vt100_Reverse0 (CHAR *str, LONGINT str__len, INTEGER start, INTEGER end); +static void vt100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end); export void vt100_SCP (void); -export void vt100_SD (INTEGER n); -export void vt100_SGR (INTEGER n); -export void vt100_SGR2 (INTEGER n, INTEGER m); -export void vt100_SU (INTEGER n); +export void vt100_SD (int16 n); +export void vt100_SGR (int16 n); +export void vt100_SGR2 (int16 n, int16 m); +export void vt100_SU (int16 n); export void vt100_SetAttr (CHAR *attr, LONGINT attr__len); -static void vt100_Reverse0 (CHAR *str, LONGINT str__len, INTEGER start, INTEGER end) +static void vt100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end) { CHAR h; while (start < end) { @@ -49,11 +49,11 @@ static void vt100_Reverse0 (CHAR *str, LONGINT str__len, INTEGER start, INTEGER } } -void vt100_IntToStr (LONGINT int_, CHAR *str, LONGINT str__len) +void vt100_IntToStr (int32 int_, CHAR *str, LONGINT str__len) { CHAR b[21]; - INTEGER s, e; - SHORTINT maxLength; + int16 s, e; + int8 maxLength; maxLength = 11; if (int_ == (-2147483647-1)) { __MOVE("-2147483648", b, 12); @@ -88,7 +88,7 @@ static void vt100_EscSeq0 (CHAR *letter, LONGINT letter__len) __DEL(letter); } -static void vt100_EscSeq (INTEGER n, CHAR *letter, LONGINT letter__len) +static void vt100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len) { CHAR nstr[2]; CHAR cmd[7]; @@ -101,7 +101,7 @@ static void vt100_EscSeq (INTEGER n, CHAR *letter, LONGINT letter__len) __DEL(letter); } -static void vt100_EscSeqSwapped (INTEGER n, CHAR *letter, LONGINT letter__len) +static void vt100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len) { CHAR nstr[2]; CHAR cmd[7]; @@ -114,7 +114,7 @@ static void vt100_EscSeqSwapped (INTEGER n, CHAR *letter, LONGINT letter__len) __DEL(letter); } -static void vt100_EscSeq2 (INTEGER n, INTEGER m, CHAR *letter, LONGINT letter__len) +static void vt100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len) { CHAR nstr[5], mstr[5]; CHAR cmd[12]; @@ -130,82 +130,82 @@ static void vt100_EscSeq2 (INTEGER n, INTEGER m, CHAR *letter, LONGINT letter__l __DEL(letter); } -void vt100_CUU (INTEGER n) +void vt100_CUU (int16 n) { vt100_EscSeq(n, (CHAR*)"A", 2); } -void vt100_CUD (INTEGER n) +void vt100_CUD (int16 n) { vt100_EscSeq(n, (CHAR*)"B", 2); } -void vt100_CUF (INTEGER n) +void vt100_CUF (int16 n) { vt100_EscSeq(n, (CHAR*)"C", 2); } -void vt100_CUB (INTEGER n) +void vt100_CUB (int16 n) { vt100_EscSeq(n, (CHAR*)"D", 2); } -void vt100_CNL (INTEGER n) +void vt100_CNL (int16 n) { vt100_EscSeq(n, (CHAR*)"E", 2); } -void vt100_CPL (INTEGER n) +void vt100_CPL (int16 n) { vt100_EscSeq(n, (CHAR*)"F", 2); } -void vt100_CHA (INTEGER n) +void vt100_CHA (int16 n) { vt100_EscSeq(n, (CHAR*)"G", 2); } -void vt100_CUP (INTEGER n, INTEGER m) +void vt100_CUP (int16 n, int16 m) { vt100_EscSeq2(n, m, (CHAR*)"H", 2); } -void vt100_ED (INTEGER n) +void vt100_ED (int16 n) { vt100_EscSeq(n, (CHAR*)"J", 2); } -void vt100_EL (INTEGER n) +void vt100_EL (int16 n) { vt100_EscSeq(n, (CHAR*)"K", 2); } -void vt100_SU (INTEGER n) +void vt100_SU (int16 n) { vt100_EscSeq(n, (CHAR*)"S", 2); } -void vt100_SD (INTEGER n) +void vt100_SD (int16 n) { vt100_EscSeq(n, (CHAR*)"T", 2); } -void vt100_HVP (INTEGER n, INTEGER m) +void vt100_HVP (int16 n, int16 m) { vt100_EscSeq2(n, m, (CHAR*)"f", 2); } -void vt100_SGR (INTEGER n) +void vt100_SGR (int16 n) { vt100_EscSeq(n, (CHAR*)"m", 2); } -void vt100_SGR2 (INTEGER n, INTEGER m) +void vt100_SGR2 (int16 n, int16 m) { vt100_EscSeq2(n, m, (CHAR*)"m", 2); } -void vt100_DSR (INTEGER n) +void vt100_DSR (int16 n) { vt100_EscSeq(6, (CHAR*)"n", 2); } diff --git a/bootstrap/unix-44/vt100.h b/bootstrap/unix-44/vt100.h index 6266a678..ad1ac948 100644 --- a/bootstrap/unix-44/vt100.h +++ b/bootstrap/unix-44/vt100.h @@ -9,27 +9,27 @@ import CHAR vt100_CSI[5]; -import void vt100_CHA (INTEGER n); -import void vt100_CNL (INTEGER n); -import void vt100_CPL (INTEGER n); -import void vt100_CUB (INTEGER n); -import void vt100_CUD (INTEGER n); -import void vt100_CUF (INTEGER n); -import void vt100_CUP (INTEGER n, INTEGER m); -import void vt100_CUU (INTEGER n); +import void vt100_CHA (int16 n); +import void vt100_CNL (int16 n); +import void vt100_CPL (int16 n); +import void vt100_CUB (int16 n); +import void vt100_CUD (int16 n); +import void vt100_CUF (int16 n); +import void vt100_CUP (int16 n, int16 m); +import void vt100_CUU (int16 n); import void vt100_DECTCEMh (void); import void vt100_DECTCEMl (void); -import void vt100_DSR (INTEGER n); -import void vt100_ED (INTEGER n); -import void vt100_EL (INTEGER n); -import void vt100_HVP (INTEGER n, INTEGER m); -import void vt100_IntToStr (LONGINT int_, CHAR *str, LONGINT str__len); +import void vt100_DSR (int16 n); +import void vt100_ED (int16 n); +import void vt100_EL (int16 n); +import void vt100_HVP (int16 n, int16 m); +import void vt100_IntToStr (int32 int_, CHAR *str, LONGINT str__len); import void vt100_RCP (void); import void vt100_SCP (void); -import void vt100_SD (INTEGER n); -import void vt100_SGR (INTEGER n); -import void vt100_SGR2 (INTEGER n, INTEGER m); -import void vt100_SU (INTEGER n); +import void vt100_SD (int16 n); +import void vt100_SGR (int16 n); +import void vt100_SGR2 (int16 n, int16 m); +import void vt100_SU (int16 n); import void vt100_SetAttr (CHAR *attr, LONGINT attr__len); import void *vt100__init(void); diff --git a/bootstrap/unix-48/Console.c b/bootstrap/unix-48/Console.c index 816df1b9..8c9c6910 100644 --- a/bootstrap/unix-48/Console.c +++ b/bootstrap/unix-48/Console.c @@ -4,14 +4,14 @@ static CHAR Console_line[128]; -static INTEGER Console_pos; +static int16 Console_pos; export void Console_Bool (BOOLEAN b); export void Console_Char (CHAR ch); export void Console_Flush (void); -export void Console_Hex (LONGINT i); -export void Console_Int (LONGINT i, LONGINT n); +export void Console_Hex (int32 i); +export void Console_Int (int32 i, int32 n); export void Console_Ln (void); export void Console_Read (CHAR *ch); export void Console_ReadLine (CHAR *line, LONGINT line__len); @@ -20,7 +20,7 @@ export void Console_String (CHAR *s, LONGINT s__len); void Console_Flush (void) { - INTEGER error; + int16 error; error = Platform_Write(1, (SYSTEM_ADRINT)Console_line, Console_pos); Console_pos = 0; } @@ -39,7 +39,7 @@ void Console_Char (CHAR ch) void Console_String (CHAR *s, LONGINT s__len) { - INTEGER i; + int16 i; __DUP(s, s__len, CHAR); i = 0; while (s[__X(i, s__len)] != 0x00) { @@ -49,11 +49,11 @@ void Console_String (CHAR *s, LONGINT s__len) __DEL(s); } -void Console_Int (LONGINT i, LONGINT n) +void Console_Int (int32 i, int32 n) { CHAR s[32]; - LONGINT i1, k; - if (i == __LSHL(1, 31, LONGINT)) { + int32 i1, k; + if (i == __LSHL(1, 31, int32)) { __MOVE("8463847412", s, 11); k = 10; } else { @@ -95,9 +95,9 @@ void Console_Bool (BOOLEAN b) } } -void Console_Hex (LONGINT i) +void Console_Hex (int32 i) { - LONGINT k, n; + int32 k, n; k = -28; while (k <= 0) { n = __MASK(__ASH(i, k), -16); @@ -112,8 +112,8 @@ void Console_Hex (LONGINT i) void Console_Read (CHAR *ch) { - LONGINT n; - INTEGER error; + int32 n; + int16 error; Console_Flush(); error = Platform_ReadBuf(0, (void*)&*ch, 1, &n); if (n != 1) { @@ -123,7 +123,7 @@ void Console_Read (CHAR *ch) void Console_ReadLine (CHAR *line, LONGINT line__len) { - LONGINT i; + int32 i; CHAR ch; Console_Flush(); i = 0; diff --git a/bootstrap/unix-48/Console.h b/bootstrap/unix-48/Console.h index 2c01265d..16287a76 100644 --- a/bootstrap/unix-48/Console.h +++ b/bootstrap/unix-48/Console.h @@ -11,8 +11,8 @@ import void Console_Bool (BOOLEAN b); import void Console_Char (CHAR ch); import void Console_Flush (void); -import void Console_Hex (LONGINT i); -import void Console_Int (LONGINT i, LONGINT n); +import void Console_Hex (int32 i); +import void Console_Int (int32 i, int32 n); import void Console_Ln (void); import void Console_Read (CHAR *ch); import void Console_ReadLine (CHAR *line, LONGINT line__len); diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index bd3e3fd5..3c6594af 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -13,7 +13,7 @@ typedef struct Files_BufDesc { Files_File f; BOOLEAN chg; - LONGINT org, size; + int32 org, size; SYSTEM_BYTE data[4096]; } Files_BufDesc; @@ -28,23 +28,23 @@ typedef Files_FileName workName, registerName; BOOLEAN tempFile; Platform_FileIdentity identity; - LONGINT fd, len, pos; + int32 fd, len, pos; Files_Buffer bufs[4]; - INTEGER swapper, state; + int16 swapper, state; Files_File next; } Files_FileDesc; typedef struct Files_Rider { - LONGINT res; + int32 res; BOOLEAN eof; Files_Buffer buf; - LONGINT org, offset; + int32 org, offset; } Files_Rider; static Files_File Files_files; -static INTEGER Files_tempno; +static int16 Files_tempno; static CHAR Files_HOME[1024]; static struct { LONGINT len[1]; @@ -57,56 +57,56 @@ export LONGINT *Files_Rider__typ; export Files_File Files_Base (Files_Rider *r, LONGINT *r__typ); static Files_File Files_CacheEntry (Platform_FileIdentity identity); -export void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INTEGER *res); +export void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int16 *res); export void Files_Close (Files_File f); static void Files_CloseOSFile (Files_File f); static void Files_Create (Files_File f); -export void Files_Delete (CHAR *name, LONGINT name__len, INTEGER *res); -static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INTEGER errcode); +export void Files_Delete (CHAR *name, LONGINT name__len, int16 *res); +static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int16 errcode); static void Files_Finalize (SYSTEM_PTR o); static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *dest, LONGINT dest__len); static void Files_Flush (Files_Buffer buf); -export void Files_GetDate (Files_File f, LONGINT *t, LONGINT *d); +export void Files_GetDate (Files_File f, int32 *t, int32 *d); export void Files_GetName (Files_File f, CHAR *name, LONGINT name__len); static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *name, LONGINT name__len); static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len); -export LONGINT Files_Length (Files_File f); +export int32 Files_Length (Files_File f); static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT name__len, CHAR *dest, LONGINT dest__len); export Files_File Files_New (CHAR *name, LONGINT name__len); export Files_File Files_Old (CHAR *name, LONGINT name__len); -export LONGINT Files_Pos (Files_Rider *r, LONGINT *r__typ); +export int32 Files_Pos (Files_Rider *r, LONGINT *r__typ); export void Files_Purge (Files_File f); export void Files_Read (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x); export void Files_ReadBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN *x); export void Files_ReadByte (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len); -export void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, LONGINT n); -export void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, INTEGER *x); -export void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, LONGINT *x); +export void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); +export void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, int16 *x); +export void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, int32 *x); export void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x); export void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); -export void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, LONGINT *x); +export void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int32 *x); export void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x); export void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x); export void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); export void Files_Register (Files_File f); -export void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INTEGER *res); -static void Files_ScanPath (INTEGER *pos, CHAR *dir, LONGINT dir__len); -export void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, LONGINT pos); +export void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res); +static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len); +export void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, int32 pos); export void Files_SetSearchPath (CHAR *path, LONGINT path__len); export void Files_Write (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE x); export void Files_WriteBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN x); -export void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, LONGINT n); -export void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, INTEGER x); -export void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, LONGINT x); +export void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); +export void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, int16 x); +export void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, int32 x); export void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x); -export void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, LONGINT x); +export void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int32 x); export void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x); export void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x); export void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); #define Files_IdxTrap() __HALT(-1) -static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INTEGER errcode) +static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int16 errcode) { __DUP(s, s__len, CHAR); Console_Ln(); @@ -135,7 +135,7 @@ static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INTEGER errcode) static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT name__len, CHAR *dest, LONGINT dest__len) { - INTEGER i, j; + int16 i, j; __DUP(dir, dir__len, CHAR); __DUP(name, name__len, CHAR); i = 0; @@ -160,7 +160,7 @@ static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *name, LONGINT name__len) { - LONGINT n, i, j; + int32 n, i, j; __DUP(finalName, finalName__len, CHAR); Files_tempno += 1; n = Files_tempno; @@ -212,7 +212,7 @@ static void Files_Create (Files_File f) { Platform_FileIdentity identity; BOOLEAN done; - INTEGER error; + int16 error; CHAR err[32]; if (f->fd == -1) { if (f->state == 1) { @@ -249,7 +249,7 @@ static void Files_Create (Files_File f) static void Files_Flush (Files_Buffer buf) { - INTEGER error; + int16 error; Files_File f = NIL; if (buf->chg) { f = buf->f; @@ -273,7 +273,7 @@ static void Files_Flush (Files_Buffer buf) static void Files_CloseOSFile (Files_File f) { Files_File prev = NIL; - INTEGER error; + int16 error; if (Files_files == f) { Files_files = f->next; } else { @@ -293,8 +293,8 @@ static void Files_CloseOSFile (Files_File f) void Files_Close (Files_File f) { - LONGINT i; - INTEGER error; + int32 i; + int16 error; if (f->state != 1 || f->registerName[0] != 0x00) { Files_Create(f); i = 0; @@ -310,9 +310,9 @@ void Files_Close (Files_File f) } } -LONGINT Files_Length (Files_File f) +int32 Files_Length (Files_File f) { - LONGINT _o_result; + int32 _o_result; _o_result = f->len; return _o_result; } @@ -335,9 +335,9 @@ Files_File Files_New (CHAR *name, LONGINT name__len) return _o_result; } -static void Files_ScanPath (INTEGER *pos, CHAR *dir, LONGINT dir__len) +static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len) { - INTEGER i; + int16 i; CHAR ch; i = 0; if (Files_SearchPath == NIL) { @@ -381,7 +381,7 @@ static void Files_ScanPath (INTEGER *pos, CHAR *dir, LONGINT dir__len) static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len) { BOOLEAN _o_result; - INTEGER i; + int16 i; CHAR ch; i = 0; ch = name[0]; @@ -397,7 +397,7 @@ static Files_File Files_CacheEntry (Platform_FileIdentity identity) { Files_File _o_result; Files_File f = NIL; - INTEGER i, error; + int16 i, error; f = Files_files; while (f != NIL) { if (Platform_SameFile(identity, f->identity)) { @@ -427,11 +427,11 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) { Files_File _o_result; Files_File f = NIL; - LONGINT fd; - INTEGER pos; + int32 fd; + int16 pos; BOOLEAN done; CHAR dir[256], path[256]; - INTEGER error; + int16 error; Platform_FileIdentity identity; __DUP(name, name__len, CHAR); if (name[0] != 0x00) { @@ -506,9 +506,9 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) void Files_Purge (Files_File f) { - INTEGER i; + int16 i; Platform_FileIdentity identity; - INTEGER error; + int16 error; i = 0; while (i < 4) { if (f->bufs[i] != NIL) { @@ -528,27 +528,27 @@ void Files_Purge (Files_File f) Platform_SetMTime(&f->identity, Platform_FileIdentity__typ, identity); } -void Files_GetDate (Files_File f, LONGINT *t, LONGINT *d) +void Files_GetDate (Files_File f, int32 *t, int32 *d) { Platform_FileIdentity identity; - INTEGER error; + int16 error; Files_Create(f); error = Platform_Identify(f->fd, &identity, Platform_FileIdentity__typ); Platform_MTimeAsClock(identity, &*t, &*d); } -LONGINT Files_Pos (Files_Rider *r, LONGINT *r__typ) +int32 Files_Pos (Files_Rider *r, LONGINT *r__typ) { - LONGINT _o_result; + int32 _o_result; _o_result = (*r).org + (*r).offset; return _o_result; } -void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, LONGINT pos) +void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, int32 pos) { - LONGINT org, offset, i, n; + int32 org, offset, i, n; Files_Buffer buf = NIL; - INTEGER error; + int16 error; if (f != NIL) { if (pos > f->len) { pos = f->len; @@ -608,7 +608,7 @@ void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, LONGINT pos) void Files_Read (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x) { - LONGINT offset; + int32 offset; Files_Buffer buf = NIL; buf = (*r).buf; offset = (*r).offset; @@ -630,9 +630,9 @@ void Files_Read (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x) } } -void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, LONGINT n) +void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n) { - LONGINT xpos, min, restInBuf, offset; + int32 xpos, min, restInBuf, offset; Files_Buffer buf = NIL; if (n > x__len) { Files_IdxTrap(); @@ -681,7 +681,7 @@ Files_File Files_Base (Files_Rider *r, LONGINT *r__typ) void Files_Write (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE x) { Files_Buffer buf = NIL; - LONGINT offset; + int32 offset; buf = (*r).buf; offset = (*r).offset; if ((*r).org != buf->org || offset >= 4096) { @@ -699,9 +699,9 @@ void Files_Write (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE x) (*r).res = 0; } -void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, LONGINT n) +void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n) { - LONGINT xpos, min, restInBuf, offset; + int32 xpos, min, restInBuf, offset; Files_Buffer buf = NIL; if (n > x__len) { Files_IdxTrap(); @@ -735,17 +735,17 @@ void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT (*r).res = 0; } -void Files_Delete (CHAR *name, LONGINT name__len, INTEGER *res) +void Files_Delete (CHAR *name, LONGINT name__len, int16 *res) { __DUP(name, name__len, CHAR); *res = Platform_Unlink((void*)name, name__len); __DEL(name); } -void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INTEGER *res) +void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res) { - LONGINT fdold, fdnew, n; - INTEGER error, ignore; + int32 fdold, fdnew, n; + int16 error, ignore; Platform_FileIdentity oldidentity, newidentity; CHAR buf[4096]; __DUP(old, old__len, CHAR); @@ -800,7 +800,7 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT void Files_Register (Files_File f) { - INTEGER idx, errcode; + int16 idx, errcode; Files_File f1 = NIL; CHAR file[104]; if ((f->state == 1 && f->registerName[0] != 0x00)) { @@ -819,7 +819,7 @@ void Files_Register (Files_File f) } } -void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INTEGER *res) +void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int16 *res) { __DUP(path, path__len, CHAR); *res = Platform_Chdir((void*)path, path__len); @@ -828,7 +828,7 @@ void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INTEGER *res) static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *dest, LONGINT dest__len) { - LONGINT i, j; + int32 i, j; if (!Platform_LittleEndian) { i = src__len; j = 0; @@ -847,26 +847,26 @@ void Files_ReadBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN *x) Files_Read(&*R, R__typ, (CHAR*)(void*)&*x); } -void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, INTEGER *x) +void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, int16 *x) { CHAR b[2]; Files_ReadBytes(&*R, R__typ, (void*)b, 2, 2); - *x = (SYSTEM_INT16)b[0] + __ASHL((SYSTEM_INT16)b[1], 8); + *x = (int16)b[0] + __ASHL((int16)b[1], 8); } -void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, LONGINT *x) +void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, int32 *x) { CHAR b[4]; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); - *x = (((SYSTEM_INT16)b[0] + __ASHL((SYSTEM_INT16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); + *x = (((int16)b[0] + __ASHL((int16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); } void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x) { CHAR b[4]; - LONGINT l; + int32 l; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); - l = (((SYSTEM_INT16)b[0] + __ASHL((SYSTEM_INT16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); + l = (((int16)b[0] + __ASHL((int16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); *x = (SET)l; } @@ -886,7 +886,7 @@ void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x) void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) { - INTEGER i; + int16 i; CHAR ch; i = 0; do { @@ -898,7 +898,7 @@ void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) { - INTEGER i; + int16 i; CHAR ch; BOOLEAN b; i = 0; @@ -914,20 +914,20 @@ void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) } while (!b); } -void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, LONGINT *x) +void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int32 *x) { - SHORTINT s; + int8 s; CHAR ch; - LONGINT n; + int32 n; s = 0; n = 0; Files_Read(&*R, R__typ, (void*)&ch); - while ((SYSTEM_INT16)ch >= 128) { - n += __ASH(((SYSTEM_INT16)ch - 128), s); + while ((int16)ch >= 128) { + n += __ASH(((int16)ch - 128), s); s += 7; Files_Read(&*R, R__typ, (void*)&ch); } - n += __ASH((__MASK((SYSTEM_INT16)ch, -64) - __ASHL(__ASHR((SYSTEM_INT16)ch, 6), 6)), s); + n += __ASH((__MASK((int16)ch, -64) - __ASHL(__ASHR((int16)ch, 6), 6)), s); *x = n; } @@ -936,7 +936,7 @@ void Files_WriteBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN x) Files_Write(&*R, R__typ, __VAL(CHAR, x)); } -void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, INTEGER x) +void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, int16 x) { CHAR b[2]; b[0] = (CHAR)x; @@ -944,7 +944,7 @@ void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, INTEGER x) Files_WriteBytes(&*R, R__typ, (void*)b, 2, 2); } -void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, LONGINT x) +void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, int32 x) { CHAR b[4]; b[0] = (CHAR)x; @@ -957,8 +957,8 @@ void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, LONGINT x) void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x) { CHAR b[4]; - LONGINT i; - i = (LONGINT)x; + int32 i; + i = (int32)x; b[0] = (CHAR)i; b[1] = (CHAR)__ASHR(i, 8); b[2] = (CHAR)__ASHR(i, 16); @@ -982,7 +982,7 @@ void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x) void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) { - INTEGER i; + int16 i; i = 0; while (x[i] != 0x00) { i += 1; @@ -990,7 +990,7 @@ void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len Files_WriteBytes(&*R, R__typ, (void*)x, x__len * 1, i + 1); } -void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, LONGINT x) +void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int32 x) { while (x < -64 || x > 63) { Files_Write(&*R, R__typ, (CHAR)(__MASK(x, -128) + 128)); @@ -1007,7 +1007,7 @@ void Files_GetName (Files_File f, CHAR *name, LONGINT name__len) static void Files_Finalize (SYSTEM_PTR o) { Files_File f = NIL; - LONGINT res; + int32 res; f = (Files_File)(SYSTEM_ADRINT)o; if (f->fd >= 0) { Files_CloseOSFile(f); diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index 985572ec..d84672d4 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -11,13 +11,13 @@ typedef typedef struct Files_FileDesc { char _prvt0[216]; - LONGINT fd; + int32 fd; char _prvt1[32]; } Files_FileDesc; typedef struct Files_Rider { - LONGINT res; + int32 res; BOOLEAN eof; char _prvt0[15]; } Files_Rider; @@ -28,39 +28,39 @@ import LONGINT *Files_FileDesc__typ; import LONGINT *Files_Rider__typ; import Files_File Files_Base (Files_Rider *r, LONGINT *r__typ); -import void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INTEGER *res); +import void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int16 *res); import void Files_Close (Files_File f); -import void Files_Delete (CHAR *name, LONGINT name__len, INTEGER *res); -import void Files_GetDate (Files_File f, LONGINT *t, LONGINT *d); +import void Files_Delete (CHAR *name, LONGINT name__len, int16 *res); +import void Files_GetDate (Files_File f, int32 *t, int32 *d); import void Files_GetName (Files_File f, CHAR *name, LONGINT name__len); -import LONGINT Files_Length (Files_File f); +import int32 Files_Length (Files_File f); import Files_File Files_New (CHAR *name, LONGINT name__len); import Files_File Files_Old (CHAR *name, LONGINT name__len); -import LONGINT Files_Pos (Files_Rider *r, LONGINT *r__typ); +import int32 Files_Pos (Files_Rider *r, LONGINT *r__typ); import void Files_Purge (Files_File f); import void Files_Read (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x); import void Files_ReadBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN *x); import void Files_ReadByte (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len); -import void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, LONGINT n); -import void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, INTEGER *x); -import void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, LONGINT *x); +import void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); +import void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, int16 *x); +import void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, int32 *x); import void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x); import void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); -import void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, LONGINT *x); +import void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int32 *x); import void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x); import void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x); import void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); import void Files_Register (Files_File f); -import void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INTEGER *res); -import void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, LONGINT pos); +import void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res); +import void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, int32 pos); import void Files_SetSearchPath (CHAR *path, LONGINT path__len); import void Files_Write (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE x); import void Files_WriteBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN x); -import void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, LONGINT n); -import void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, INTEGER x); -import void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, LONGINT x); +import void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); +import void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, int16 x); +import void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, int32 x); import void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x); -import void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, LONGINT x); +import void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int32 x); import void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x); import void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x); import void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index 50d17d87..a252264a 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -34,7 +34,7 @@ typedef typedef struct Heap_FinDesc { Heap_FinNode next; - LONGINT obj; + int32 obj; BOOLEAN marked; Heap_Finalizer finalize; } Heap_FinDesc; @@ -49,25 +49,25 @@ typedef struct Heap_ModuleDesc { Heap_Module next; Heap_ModuleName name; - LONGINT refcnt; + int32 refcnt; Heap_Cmd cmds; - LONGINT types; + int32 types; Heap_EnumProc enumPtrs; - LONGINT reserved1, reserved2; + int32 reserved1, reserved2; } Heap_ModuleDesc; export SYSTEM_PTR Heap_modules; -static LONGINT Heap_freeList[10]; -static LONGINT Heap_bigBlocks; -export LONGINT Heap_allocated; +static int32 Heap_freeList[10]; +static int32 Heap_bigBlocks; +export int32 Heap_allocated; static BOOLEAN Heap_firstTry; -static LONGINT Heap_heap, Heap_heapend; -export LONGINT Heap_heapsize; +static int32 Heap_heap, Heap_heapend; +export int32 Heap_heapsize; static Heap_FinNode Heap_fin; -static INTEGER Heap_lockdepth; +static int16 Heap_lockdepth; static BOOLEAN Heap_interrupted; -export INTEGER Heap_FileCount; +export int16 Heap_FileCount; export LONGINT *Heap_ModuleDesc__typ; export LONGINT *Heap_CmdDesc__typ; @@ -75,27 +75,27 @@ export LONGINT *Heap_FinDesc__typ; export LONGINT *Heap__1__typ; static void Heap_CheckFin (void); -static void Heap_ExtendHeap (LONGINT blksz); +static void Heap_ExtendHeap (int32 blksz); export void Heap_FINALL (void); static void Heap_Finalize (void); export void Heap_GC (BOOLEAN markStack); -static void Heap_HeapSort (LONGINT n, LONGINT *a, LONGINT a__len); +static void Heap_HeapSort (int32 n, int32 *a, LONGINT a__len); export void Heap_INCREF (Heap_Module m); export void Heap_InitHeap (void); export void Heap_Lock (void); -static void Heap_Mark (LONGINT q); -static void Heap_MarkCandidates (LONGINT n, LONGINT *cand, LONGINT cand__len); +static void Heap_Mark (int32 q); +static void Heap_MarkCandidates (int32 n, int32 *cand, LONGINT cand__len); static void Heap_MarkP (SYSTEM_PTR p); -static void Heap_MarkStack (LONGINT n, LONGINT *cand, LONGINT cand__len); -export SYSTEM_PTR Heap_NEWBLK (LONGINT size); -export SYSTEM_PTR Heap_NEWREC (LONGINT tag); -static LONGINT Heap_NewChunk (LONGINT blksz); +static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len); +export SYSTEM_PTR Heap_NEWBLK (int32 size); +export SYSTEM_PTR Heap_NEWREC (int32 tag); +static int32 Heap_NewChunk (int32 blksz); export void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); export SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -export void Heap_REGTYP (Heap_Module m, LONGINT typ); +export void Heap_REGTYP (Heap_Module m, int32 typ); export void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); static void Heap_Scan (void); -static void Heap_Sift (LONGINT l, LONGINT r, LONGINT *a, LONGINT a__len); +static void Heap_Sift (int32 l, int32 r, int32 *a, LONGINT a__len); export void Heap_Unlock (void); extern void *Heap__init(); @@ -154,9 +154,9 @@ void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) m->cmds = c; } -void Heap_REGTYP (Heap_Module m, LONGINT typ) +void Heap_REGTYP (Heap_Module m, int32 typ) { - __PUT(typ, m->types, LONGINT); + __PUT(typ, m->types, int32); m->types = typ; } @@ -165,17 +165,17 @@ void Heap_INCREF (Heap_Module m) m->refcnt += 1; } -static LONGINT Heap_NewChunk (LONGINT blksz) +static int32 Heap_NewChunk (int32 blksz) { - LONGINT _o_result; - LONGINT chnk; + int32 _o_result; + int32 chnk; chnk = Heap_OSAllocate(blksz + 12); if (chnk != 0) { - __PUT(chnk + 4, chnk + (12 + blksz), LONGINT); - __PUT(chnk + 12, chnk + 16, LONGINT); - __PUT(chnk + 16, blksz, LONGINT); - __PUT(chnk + 20, -4, LONGINT); - __PUT(chnk + 24, Heap_bigBlocks, LONGINT); + __PUT(chnk + 4, chnk + (12 + blksz), int32); + __PUT(chnk + 12, chnk + 16, int32); + __PUT(chnk + 16, blksz, int32); + __PUT(chnk + 20, -4, int32); + __PUT(chnk + 24, Heap_bigBlocks, int32); Heap_bigBlocks = chnk + 12; Heap_heapsize += blksz; } @@ -183,9 +183,9 @@ static LONGINT Heap_NewChunk (LONGINT blksz) return _o_result; } -static void Heap_ExtendHeap (LONGINT blksz) +static void Heap_ExtendHeap (int32 blksz) { - LONGINT size, chnk, j, next; + int32 size, chnk, j, next; if (blksz > 160000) { size = blksz; } else { @@ -194,7 +194,7 @@ static void Heap_ExtendHeap (LONGINT blksz) chnk = Heap_NewChunk(size); if (chnk != 0) { if (chnk < Heap_heap) { - __PUT(chnk, Heap_heap, LONGINT); + __PUT(chnk, Heap_heap, int32); Heap_heap = chnk; } else { j = Heap_heap; @@ -203,8 +203,8 @@ static void Heap_ExtendHeap (LONGINT blksz) j = next; next = Heap_FetchAddress(j); } - __PUT(chnk, next, LONGINT); - __PUT(j, chnk, LONGINT); + __PUT(chnk, next, int32); + __PUT(j, chnk, int32); } if (next == 0) { Heap_heapend = Heap_FetchAddress(chnk + 4); @@ -212,10 +212,10 @@ static void Heap_ExtendHeap (LONGINT blksz) } } -SYSTEM_PTR Heap_NEWREC (LONGINT tag) +SYSTEM_PTR Heap_NEWREC (int32 tag) { SYSTEM_PTR _o_result; - LONGINT i, i0, di, blksz, restsize, t, adr, end, next, prev; + int32 i, i0, di, blksz, restsize, t, adr, end, next, prev; SYSTEM_PTR new; Heap_Lock(); blksz = Heap_FetchAddress(tag); @@ -235,11 +235,11 @@ SYSTEM_PTR Heap_NEWREC (LONGINT tag) di = i - i0; restsize = __ASHL(di, 4); end = adr + restsize; - __PUT(end + 4, blksz, LONGINT); - __PUT(end + 8, -4, LONGINT); - __PUT(end, end + 4, LONGINT); - __PUT(adr + 4, restsize, LONGINT); - __PUT(adr + 12, Heap_freeList[di], LONGINT); + __PUT(end + 4, blksz, int32); + __PUT(end + 8, -4, int32); + __PUT(end, end + 4, int32); + __PUT(adr + 4, restsize, int32); + __PUT(adr + 12, Heap_freeList[di], int32); Heap_freeList[di] = adr; adr += restsize; } @@ -279,22 +279,22 @@ SYSTEM_PTR Heap_NEWREC (LONGINT tag) } restsize = t - blksz; end = adr + restsize; - __PUT(end + 4, blksz, LONGINT); - __PUT(end + 8, -4, LONGINT); - __PUT(end, end + 4, LONGINT); + __PUT(end + 4, blksz, int32); + __PUT(end + 8, -4, int32); + __PUT(end, end + 4, int32); if (restsize > 144) { - __PUT(adr + 4, restsize, LONGINT); + __PUT(adr + 4, restsize, int32); } else { next = Heap_FetchAddress(adr + 12); if (prev == 0) { Heap_bigBlocks = next; } else { - __PUT(prev + 12, next, LONGINT); + __PUT(prev + 12, next, int32); } if (restsize > 0) { di = __ASHR(restsize, 4); - __PUT(adr + 4, restsize, LONGINT); - __PUT(adr + 12, Heap_freeList[di], LONGINT); + __PUT(adr + 4, restsize, int32); + __PUT(adr + 12, Heap_freeList[di], int32); Heap_freeList[di] = adr; } } @@ -303,53 +303,53 @@ SYSTEM_PTR Heap_NEWREC (LONGINT tag) i = adr + 16; end = adr + blksz; while (i < end) { - __PUT(i, 0, LONGINT); - __PUT(i + 4, 0, LONGINT); - __PUT(i + 8, 0, LONGINT); - __PUT(i + 12, 0, LONGINT); + __PUT(i, 0, int32); + __PUT(i + 4, 0, int32); + __PUT(i + 8, 0, int32); + __PUT(i + 12, 0, int32); i += 16; } - __PUT(adr + 12, 0, LONGINT); - __PUT(adr, tag, LONGINT); - __PUT(adr + 4, 0, LONGINT); - __PUT(adr + 8, 0, LONGINT); + __PUT(adr + 12, 0, int32); + __PUT(adr, tag, int32); + __PUT(adr + 4, 0, int32); + __PUT(adr + 8, 0, int32); Heap_allocated += blksz; Heap_Unlock(); _o_result = (SYSTEM_PTR)(SYSTEM_ADRINT)(adr + 4); return _o_result; } -SYSTEM_PTR Heap_NEWBLK (LONGINT size) +SYSTEM_PTR Heap_NEWBLK (int32 size) { SYSTEM_PTR _o_result; - LONGINT blksz, tag; + int32 blksz, tag; SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 31, 4), 4); new = Heap_NEWREC((SYSTEM_ADRINT)&blksz); - tag = ((LONGINT)(SYSTEM_ADRINT)new + blksz) - 12; - __PUT(tag - 4, 0, LONGINT); - __PUT(tag, blksz, LONGINT); - __PUT(tag + 4, -4, LONGINT); - __PUT((LONGINT)(SYSTEM_ADRINT)new - 4, tag, LONGINT); + tag = ((int32)(SYSTEM_ADRINT)new + blksz) - 12; + __PUT(tag - 4, 0, int32); + __PUT(tag, blksz, int32); + __PUT(tag + 4, -4, int32); + __PUT((int32)(SYSTEM_ADRINT)new - 4, tag, int32); Heap_Unlock(); _o_result = new; return _o_result; } -static void Heap_Mark (LONGINT q) +static void Heap_Mark (int32 q) { - LONGINT p, tag, fld, n, offset, tagbits; + int32 p, tag, fld, n, offset, tagbits; if (q != 0) { tagbits = Heap_FetchAddress(q - 4); if (!__ODD(tagbits)) { - __PUT(q - 4, tagbits + 1, LONGINT); + __PUT(q - 4, tagbits + 1, int32); p = 0; tag = tagbits + 4; for (;;) { - __GET(tag, offset, LONGINT); + __GET(tag, offset, int32); if (offset < 0) { - __PUT(q - 4, (tag + offset) + 1, LONGINT); + __PUT(q - 4, (tag + offset) + 1, int32); if (p == 0) { break; } @@ -357,7 +357,7 @@ static void Heap_Mark (LONGINT q) q = p; tag = Heap_FetchAddress(q - 4); tag -= 1; - __GET(tag, offset, LONGINT); + __GET(tag, offset, int32); fld = q + offset; p = Heap_FetchAddress(fld); __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)n, SYSTEM_PTR); @@ -367,8 +367,8 @@ static void Heap_Mark (LONGINT q) if (n != 0) { tagbits = Heap_FetchAddress(n - 4); if (!__ODD(tagbits)) { - __PUT(n - 4, tagbits + 1, LONGINT); - __PUT(q - 4, tag + 1, LONGINT); + __PUT(n - 4, tagbits + 1, int32); + __PUT(q - 4, tag + 1, int32); __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)p, SYSTEM_PTR); p = q; q = n; @@ -384,12 +384,12 @@ static void Heap_Mark (LONGINT q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((LONGINT)(SYSTEM_ADRINT)p); + Heap_Mark((int32)(SYSTEM_ADRINT)p); } static void Heap_Scan (void) { - LONGINT chnk, adr, end, start, tag, i, size, freesize; + int32 chnk, adr, end, start, tag, i, size, freesize; Heap_bigBlocks = 0; i = 1; while (i < 9) { @@ -407,21 +407,21 @@ static void Heap_Scan (void) if (__ODD(tag)) { if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 4, LONGINT); - __PUT(start + 4, freesize, LONGINT); - __PUT(start + 8, -4, LONGINT); + __PUT(start, start + 4, int32); + __PUT(start + 4, freesize, int32); + __PUT(start + 8, -4, int32); i = __ASHR(freesize, 4); freesize = 0; if (i < 9) { - __PUT(start + 12, Heap_freeList[i], LONGINT); + __PUT(start + 12, Heap_freeList[i], int32); Heap_freeList[i] = start; } else { - __PUT(start + 12, Heap_bigBlocks, LONGINT); + __PUT(start + 12, Heap_bigBlocks, int32); Heap_bigBlocks = start; } } tag -= 1; - __PUT(adr, tag, LONGINT); + __PUT(adr, tag, int32); size = Heap_FetchAddress(tag); Heap_allocated += size; adr += size; @@ -433,16 +433,16 @@ static void Heap_Scan (void) } if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 4, LONGINT); - __PUT(start + 4, freesize, LONGINT); - __PUT(start + 8, -4, LONGINT); + __PUT(start, start + 4, int32); + __PUT(start + 4, freesize, int32); + __PUT(start + 8, -4, int32); i = __ASHR(freesize, 4); freesize = 0; if (i < 9) { - __PUT(start + 12, Heap_freeList[i], LONGINT); + __PUT(start + 12, Heap_freeList[i], int32); Heap_freeList[i] = start; } else { - __PUT(start + 12, Heap_bigBlocks, LONGINT); + __PUT(start + 12, Heap_bigBlocks, int32); Heap_bigBlocks = start; } } @@ -450,9 +450,9 @@ static void Heap_Scan (void) } } -static void Heap_Sift (LONGINT l, LONGINT r, LONGINT *a, LONGINT a__len) +static void Heap_Sift (int32 l, int32 r, int32 *a, LONGINT a__len) { - LONGINT i, j, x; + int32 i, j, x; j = l; x = a[j]; for (;;) { @@ -469,9 +469,9 @@ static void Heap_Sift (LONGINT l, LONGINT r, LONGINT *a, LONGINT a__len) a[i] = x; } -static void Heap_HeapSort (LONGINT n, LONGINT *a, LONGINT a__len) +static void Heap_HeapSort (int32 n, int32 *a, LONGINT a__len) { - LONGINT l, r, x; + int32 l, r, x; l = __ASHR(n, 1); r = n - 1; while (l > 0) { @@ -487,9 +487,9 @@ static void Heap_HeapSort (LONGINT n, LONGINT *a, LONGINT a__len) } } -static void Heap_MarkCandidates (LONGINT n, LONGINT *cand, LONGINT cand__len) +static void Heap_MarkCandidates (int32 n, int32 *cand, LONGINT cand__len) { - LONGINT chnk, adr, tag, next, lim, lim1, i, ptr, size; + int32 chnk, adr, tag, next, lim, lim1, i, ptr, size; chnk = Heap_heap; i = 0; lim = cand[n - 1]; @@ -527,7 +527,7 @@ static void Heap_MarkCandidates (LONGINT n, LONGINT *cand, LONGINT cand__len) static void Heap_CheckFin (void) { Heap_FinNode n; - LONGINT tag; + int32 tag; n = Heap_fin; while (n != NIL) { tag = Heap_FetchAddress(n->obj - 4); @@ -576,10 +576,10 @@ void Heap_FINALL (void) } } -static void Heap_MarkStack (LONGINT n, LONGINT *cand, LONGINT cand__len) +static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len) { SYSTEM_PTR frame; - LONGINT inc, nofcand, sp, p, stack0; + int32 inc, nofcand, sp, p, stack0; struct Heap__1 align; if (n > 0) { Heap_MarkStack(n - 1, cand, cand__len); @@ -596,7 +596,7 @@ static void Heap_MarkStack (LONGINT n, LONGINT *cand, LONGINT cand__len) inc = -inc; } while (sp != stack0) { - __GET(sp, p, LONGINT); + __GET(sp, p, int32); if ((p > Heap_heap && p < Heap_heapend)) { if (nofcand == cand__len) { Heap_HeapSort(nofcand, (void*)cand, cand__len); @@ -618,8 +618,8 @@ static void Heap_MarkStack (LONGINT n, LONGINT *cand, LONGINT cand__len) void Heap_GC (BOOLEAN markStack) { Heap_Module m; - LONGINT i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; - LONGINT cand[10000]; + int32 i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; + int32 cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); m = (Heap_Module)(SYSTEM_ADRINT)Heap_modules; @@ -699,7 +699,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (LONGINT)(SYSTEM_ADRINT)obj; + f->obj = (int32)(SYSTEM_ADRINT)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; @@ -710,7 +710,7 @@ void Heap_InitHeap (void) { Heap_heap = Heap_NewChunk(128000); Heap_heapend = Heap_FetchAddress(Heap_heap + 4); - __PUT(Heap_heap, 0, LONGINT); + __PUT(Heap_heap, 0, int32); Heap_allocated = 0; Heap_firstTry = 1; Heap_freeList[9] = 1; diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index a4e30a5e..a89f18fc 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -31,8 +31,8 @@ typedef import SYSTEM_PTR Heap_modules; -import LONGINT Heap_allocated, Heap_heapsize; -import INTEGER Heap_FileCount; +import int32 Heap_allocated, Heap_heapsize; +import int16 Heap_FileCount; import LONGINT *Heap_ModuleDesc__typ; @@ -41,11 +41,11 @@ import void Heap_GC (BOOLEAN markStack); import void Heap_INCREF (Heap_Module m); import void Heap_InitHeap (void); import void Heap_Lock (void); -import SYSTEM_PTR Heap_NEWBLK (LONGINT size); -import SYSTEM_PTR Heap_NEWREC (LONGINT tag); +import SYSTEM_PTR Heap_NEWBLK (int32 size); +import SYSTEM_PTR Heap_NEWREC (int32 tag); import void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); import SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -import void Heap_REGTYP (Heap_Module m, LONGINT typ); +import void Heap_REGTYP (Heap_Module m, int32 typ); import void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); import void Heap_Unlock (void); import void *Heap__init(void); diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index 52abc5b8..7969f68f 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -26,15 +26,15 @@ typedef struct Modules_ModuleDesc { Modules_Module next; Modules_ModuleName name; - LONGINT refcnt; + int32 refcnt; Modules_Cmd cmds; - LONGINT types; - void (*enumPtrs)(void(*)(LONGINT)); - LONGINT reserved1, reserved2; + int32 types; + void (*enumPtrs)(void(*)(int32)); + int32 reserved1, reserved2; } Modules_ModuleDesc; -export INTEGER Modules_res; +export int16 Modules_res; export CHAR Modules_resMsg[256]; export Modules_ModuleName Modules_imported, Modules_importing; @@ -51,7 +51,7 @@ export Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len); static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len) { - INTEGER i, j; + int16 i, j; __DUP(b, b__len, CHAR); i = 0; while (a[__X(i, a__len)] != 0x00) { diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index 6bee52c7..8b271308 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -28,15 +28,15 @@ typedef struct Modules_ModuleDesc { Modules_Module next; Modules_ModuleName name; - LONGINT refcnt; + int32 refcnt; Modules_Cmd cmds; - LONGINT types; - void (*enumPtrs)(void(*)(LONGINT)); + int32 types; + void (*enumPtrs)(void(*)(int32)); char _prvt0[8]; } Modules_ModuleDesc; -import INTEGER Modules_res; +import int16 Modules_res; import CHAR Modules_resMsg[256]; import Modules_ModuleName Modules_imported, Modules_importing; diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index a3322969..bc74dd1d 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -6,13 +6,13 @@ export void (*OPB_typSize)(OPT_Struct); -static INTEGER OPB_exp; -static LONGINT OPB_maxExp; +static int16 OPB_exp; +static int32 OPB_maxExp; export void OPB_Assign (OPT_Node *x, OPT_Node y); -static void OPB_BindNodes (SHORTINT class, OPT_Struct typ, OPT_Node *x, OPT_Node y); -static LONGINT OPB_BoolToInt (BOOLEAN b); +static void OPB_BindNodes (int8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y); +static int32 OPB_BoolToInt (BOOLEAN b); export void OPB_Call (OPT_Node *x, OPT_Node apar, OPT_Object fp); static void OPB_CharToString (OPT_Node n); static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode); @@ -20,10 +20,10 @@ static void OPB_CheckLeaf (OPT_Node x, BOOLEAN dynArrToo); export void OPB_CheckParameters (OPT_Object fp, OPT_Object ap, BOOLEAN checkNames); static void OPB_CheckProc (OPT_Struct x, OPT_Object y); static void OPB_CheckPtr (OPT_Node x, OPT_Node y); -static void OPB_CheckRealType (INTEGER f, INTEGER nr, OPT_Const x); +static void OPB_CheckRealType (int16 f, int16 nr, OPT_Const x); static void OPB_CheckReceiver (OPT_Node *x, OPT_Object fp); -static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y); -export void OPB_Construct (SHORTINT class, OPT_Node *x, OPT_Node y); +static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y); +export void OPB_Construct (int8 class, OPT_Node *x, OPT_Node y); static void OPB_Convert (OPT_Node *x, OPT_Struct typ); export void OPB_DeRef (OPT_Node *x); static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpar); @@ -33,17 +33,17 @@ export void OPB_Field (OPT_Node *x, OPT_Object y); export void OPB_In (OPT_Node *x, OPT_Node y); export void OPB_Index (OPT_Node *x, OPT_Node y); export void OPB_Inittd (OPT_Node *inittd, OPT_Node *last, OPT_Struct typ); -static BOOLEAN OPB_IntToBool (LONGINT i); +static BOOLEAN OPB_IntToBool (int32 i); export void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y); -export void OPB_MOp (SHORTINT op, OPT_Node *x); +export void OPB_MOp (int8 op, OPT_Node *x); export OPT_Node OPB_NewBoolConst (BOOLEAN boolval); -export OPT_Node OPB_NewIntConst (LONGINT intval); +export OPT_Node OPB_NewIntConst (int32 intval); export OPT_Node OPB_NewLeaf (OPT_Object obj); export OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ); -export OPT_Node OPB_NewString (OPS_String str, LONGINT len); +export OPT_Node OPB_NewString (OPS_String str, int32 len); export OPT_Node OPB_Nil (void); static BOOLEAN OPB_NotVar (OPT_Node x); -export void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y); +export void OPB_Op (int8 op, OPT_Node *x, OPT_Node y); export void OPB_OptIf (OPT_Node *x); export void OPB_Param (OPT_Node ap, OPT_Object fp); export void OPB_PrepCall (OPT_Node *x, OPT_Object *fpar); @@ -51,17 +51,17 @@ export void OPB_Return (OPT_Node *x, OPT_Object proc); export void OPB_SetElem (OPT_Node *x); static void OPB_SetIntType (OPT_Node node); export void OPB_SetRange (OPT_Node *x, OPT_Node y); -export void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno); -export void OPB_StPar0 (OPT_Node *par0, INTEGER fctno); -export void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno); -export void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n); -export void OPB_StaticLink (SHORTINT dlev); +export void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno); +export void OPB_StPar0 (OPT_Node *par0, int16 fctno); +export void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno); +export void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n); +export void OPB_StaticLink (int8 dlev); export void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard); -static void OPB_err (INTEGER n); -static LONGINT OPB_log (LONGINT x); +static void OPB_err (int16 n); +static int32 OPB_log (int32 x); -static void OPB_err (INTEGER n) +static void OPB_err (int16 n) { OPM_err(n); } @@ -100,7 +100,7 @@ OPT_Node OPB_NewLeaf (OPT_Object obj) return _o_result; } -void OPB_Construct (SHORTINT class, OPT_Node *x, OPT_Node y) +void OPB_Construct (int8 class, OPT_Node *x, OPT_Node y) { OPT_Node node = NIL; node = OPT_NewNode(class); @@ -123,9 +123,9 @@ void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y) *last = y; } -static LONGINT OPB_BoolToInt (BOOLEAN b) +static int32 OPB_BoolToInt (BOOLEAN b) { - LONGINT _o_result; + int32 _o_result; if (b) { _o_result = 1; return _o_result; @@ -136,7 +136,7 @@ static LONGINT OPB_BoolToInt (BOOLEAN b) __RETCHK; } -static BOOLEAN OPB_IntToBool (LONGINT i) +static BOOLEAN OPB_IntToBool (int32 i) { BOOLEAN _o_result; if (i == 0) { @@ -222,8 +222,8 @@ OPT_Node OPB_EmptySet (void) static void OPB_SetIntType (OPT_Node node) { - INTEGER b; - LONGINT n; + int16 b; + int32 n; if (node->conval->intval >= 0) { n = node->conval->intval; } else { @@ -236,7 +236,7 @@ static void OPB_SetIntType (OPT_Node node) node->typ = OPT_IntType(b); } -OPT_Node OPB_NewIntConst (LONGINT intval) +OPT_Node OPB_NewIntConst (int32 intval) { OPT_Node _o_result; OPT_Node x = NIL; @@ -261,7 +261,7 @@ OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ) return _o_result; } -OPT_Node OPB_NewString (OPS_String str, LONGINT len) +OPT_Node OPB_NewString (OPS_String str, int32 len) { OPT_Node _o_result; OPT_Node x = NIL; @@ -293,7 +293,7 @@ static void OPB_CharToString (OPT_Node n) n->obj = NIL; } -static void OPB_BindNodes (SHORTINT class, OPT_Struct typ, OPT_Node *x, OPT_Node y) +static void OPB_BindNodes (int8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y) { OPT_Node node = NIL; node = OPT_NewNode(class); @@ -335,7 +335,7 @@ void OPB_DeRef (OPT_Node *x) void OPB_Index (OPT_Node *x, OPT_Node y) { - INTEGER f; + int16 f; OPT_Struct typ = NIL; f = y->typ->form; if ((*x)->class >= 7) { @@ -460,8 +460,8 @@ void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) void OPB_In (OPT_Node *x, OPT_Node y) { - INTEGER f; - LONGINT k; + int16 f; + int32 k; f = (*x)->typ->form; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); @@ -487,9 +487,9 @@ void OPB_In (OPT_Node *x, OPT_Node y) (*x)->typ = OPT_booltyp; } -static LONGINT OPB_log (LONGINT x) +static int32 OPB_log (int32 x) { - LONGINT _o_result; + int32 _o_result; OPB_exp = 0; if (x > 0) { while (!__ODD(x)) { @@ -501,7 +501,7 @@ static LONGINT OPB_log (LONGINT x) return _o_result; } -static void OPB_CheckRealType (INTEGER f, INTEGER nr, OPT_Const x) +static void OPB_CheckRealType (int16 f, int16 nr, OPT_Const x) { LONGREAL min, max, r; if (f == 5) { @@ -525,9 +525,9 @@ static struct MOp__28 { struct MOp__28 *lnk; } *MOp__28_s; -static OPT_Node NewOp__29 (SHORTINT op, OPT_Struct typ, OPT_Node z); +static OPT_Node NewOp__29 (int8 op, OPT_Struct typ, OPT_Node z); -static OPT_Node NewOp__29 (SHORTINT op, OPT_Struct typ, OPT_Node z) +static OPT_Node NewOp__29 (int8 op, OPT_Struct typ, OPT_Node z) { OPT_Node _o_result; OPT_Node node = NIL; @@ -539,9 +539,9 @@ static OPT_Node NewOp__29 (SHORTINT op, OPT_Struct typ, OPT_Node z) return _o_result; } -void OPB_MOp (SHORTINT op, OPT_Node *x) +void OPB_MOp (int8 op, OPT_Node *x) { - INTEGER f; + int16 f; OPT_Struct typ = NIL; OPT_Node z = NIL; struct MOp__28 _s; @@ -618,7 +618,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) case 22: if (f == 3) { if (z->class == 7) { - z->conval->intval = (SYSTEM_INT16)__CAP((CHAR)z->conval->intval); + z->conval->intval = (int16)__CAP((CHAR)z->conval->intval); z->obj = NIL; } else { z = NewOp__29(op, typ, z); @@ -678,7 +678,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) static void OPB_CheckPtr (OPT_Node x, OPT_Node y) { - INTEGER g; + int16 g; OPT_Struct p = NIL, q = NIL, t = NIL; g = y->typ->form; if (g == 11) { @@ -762,17 +762,17 @@ static void OPB_CheckProc (OPT_Struct x, OPT_Object y) static struct ConstOp__13 { OPT_Node *x; - INTEGER *f; + int16 *f; OPT_Const *xval, *yval; struct ConstOp__13 *lnk; } *ConstOp__13_s; -static INTEGER ConstCmp__14 (void); +static int16 ConstCmp__14 (void); -static INTEGER ConstCmp__14 (void) +static int16 ConstCmp__14 (void) { - INTEGER _o_result; - INTEGER res; + int16 _o_result; + int16 res; switch (*ConstOp__13_s->f) { case 0: res = 9; @@ -836,11 +836,11 @@ static INTEGER ConstCmp__14 (void) return _o_result; } -static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) +static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) { - INTEGER f, g; + int16 f, g; OPT_Const xval = NIL, yval = NIL; - LONGINT xv, yv; + int32 xv, yv; BOOLEAN temp; struct ConstOp__13 _s; _s.x = &x; @@ -1116,8 +1116,8 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) static void OPB_Convert (OPT_Node *x, OPT_Struct typ) { OPT_Node node = NIL; - INTEGER f, g; - LONGINT k; + int16 f, g; + int32 k; LONGREAL r; f = (*x)->typ->form; g = typ->form; @@ -1149,12 +1149,12 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) OPB_err(203); r = (LONGREAL)1; } - (*x)->conval->intval = (SYSTEM_INT32)__ENTIER(r); + (*x)->conval->intval = (int32)__ENTIER(r); OPB_SetIntType(*x); } } (*x)->obj = NIL; - } else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((SYSTEM_INT16)(*x)->left->typ->form < f || f > g))) { + } else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((int16)(*x)->left->typ->form < f || f > g))) { if ((*x)->left->typ == typ) { *x = (*x)->left; } @@ -1168,14 +1168,14 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) } static struct Op__38 { - INTEGER *f, *g; + int16 *f, *g; struct Op__38 *lnk; } *Op__38_s; -static void NewOp__39 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y); +static void NewOp__39 (int8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y); static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y); -static void NewOp__39 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y) +static void NewOp__39 (int8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y) { OPT_Node node = NIL; node = OPT_NewNode(12); @@ -1218,13 +1218,13 @@ static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) return _o_result; } -void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) +void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) { - INTEGER f, g; + int16 f, g; OPT_Node t = NIL, z = NIL; OPT_Struct typ = NIL; BOOLEAN do_; - LONGINT val; + int32 val; struct Op__38 _s; _s.f = &f; _s.g = &g; @@ -1495,7 +1495,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) void OPB_SetRange (OPT_Node *x, OPT_Node y) { - LONGINT k, l; + int32 k, l; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); } else if (((*x)->typ->form == 4 && y->typ->form == 4)) { @@ -1530,7 +1530,7 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y) void OPB_SetElem (OPT_Node *x) { - LONGINT k; + int32 k; if ((*x)->class == 8 || (*x)->class == 9) { OPB_err(126); } else if ((*x)->typ->form != 4) { @@ -1552,7 +1552,7 @@ void OPB_SetElem (OPT_Node *x) static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) { OPT_Struct y = NIL; - INTEGER f, g; + int16 f, g; OPT_Struct p = NIL, q = NIL; if (OPM_Verbose) { OPM_LogWLn(); @@ -1695,9 +1695,9 @@ static void OPB_CheckLeaf (OPT_Node x, BOOLEAN dynArrToo) { } -void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) +void OPB_StPar0 (OPT_Node *par0, int16 fctno) { - INTEGER f; + int16 f; OPT_Struct typ = NIL; OPT_Node x = NIL; x = *par0; @@ -2005,9 +2005,9 @@ static struct StPar1__52 { struct StPar1__52 *lnk; } *StPar1__52_s; -static OPT_Node NewOp__53 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right); +static OPT_Node NewOp__53 (int8 class, int8 subcl, OPT_Node left, OPT_Node right); -static OPT_Node NewOp__53 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right) +static OPT_Node NewOp__53 (int8 class, int8 subcl, OPT_Node left, OPT_Node right) { OPT_Node _o_result; OPT_Node node = NIL; @@ -2019,9 +2019,9 @@ static OPT_Node NewOp__53 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_No return _o_result; } -void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) +void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) { - INTEGER f, L; + int16 f, L; OPT_Struct typ = NIL; OPT_Node p = NIL, t = NIL; struct StPar1__52 _s; @@ -2063,7 +2063,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (!(f == 4) || x->class != 7) { OPB_err(69); } else if (x->typ->size == 1) { - L = (SYSTEM_INT16)x->conval->intval; + L = (int16)x->conval->intval; typ = p->typ; while ((L > 0 && __IN(typ->comp, 0x0c))) { typ = typ->BaseTyp; @@ -2259,10 +2259,10 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) StPar1__52_s = _s.lnk; } -void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n) +void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n) { OPT_Node node = NIL; - INTEGER f; + int16 f; OPT_Node p = NIL; p = *par0; f = x->typ->form; @@ -2304,9 +2304,9 @@ void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n) *par0 = p; } -void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno) +void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno) { - INTEGER dim; + int16 dim; OPT_Node x = NIL, p = NIL; p = *par0; if (fctno <= 19) { @@ -2370,7 +2370,7 @@ void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno) static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpar) { - INTEGER f; + int16 f; f = atyp->comp; ftyp = ftyp->BaseTyp; atyp = atyp->BaseTyp; @@ -2479,7 +2479,7 @@ void OPB_Param (OPT_Node ap, OPT_Object fp) } } -void OPB_StaticLink (SHORTINT dlev) +void OPB_StaticLink (int8 dlev) { OPT_Object scope = NIL; scope = OPT_topScope; @@ -2494,7 +2494,7 @@ void OPB_Call (OPT_Node *x, OPT_Node apar, OPT_Object fp) { OPT_Struct typ = NIL; OPT_Node p = NIL; - SHORTINT lev; + int8 lev; if ((*x)->class == 9) { typ = (*x)->typ; lev = (*x)->obj->mnolev; @@ -2554,7 +2554,7 @@ void OPB_Return (OPT_Node *x, OPT_Object proc) void OPB_Assign (OPT_Node *x, OPT_Node y) { OPT_Node z = NIL; - SHORTINT subcl; + int8 subcl; if ((*x)->class >= 7) { OPB_err(56); } diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index 97c4485c..a4ccc86e 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -14,7 +14,7 @@ import void (*OPB_typSize)(OPT_Struct); import void OPB_Assign (OPT_Node *x, OPT_Node y); import void OPB_Call (OPT_Node *x, OPT_Node apar, OPT_Object fp); import void OPB_CheckParameters (OPT_Object fp, OPT_Object ap, BOOLEAN checkNames); -import void OPB_Construct (SHORTINT class, OPT_Node *x, OPT_Node y); +import void OPB_Construct (int8 class, OPT_Node *x, OPT_Node y); import void OPB_DeRef (OPT_Node *x); import OPT_Node OPB_EmptySet (void); import void OPB_Enter (OPT_Node *procdec, OPT_Node stat, OPT_Object proc); @@ -23,25 +23,25 @@ import void OPB_In (OPT_Node *x, OPT_Node y); import void OPB_Index (OPT_Node *x, OPT_Node y); import void OPB_Inittd (OPT_Node *inittd, OPT_Node *last, OPT_Struct typ); import void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y); -import void OPB_MOp (SHORTINT op, OPT_Node *x); +import void OPB_MOp (int8 op, OPT_Node *x); import OPT_Node OPB_NewBoolConst (BOOLEAN boolval); -import OPT_Node OPB_NewIntConst (LONGINT intval); +import OPT_Node OPB_NewIntConst (int32 intval); import OPT_Node OPB_NewLeaf (OPT_Object obj); import OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ); -import OPT_Node OPB_NewString (OPS_String str, LONGINT len); +import OPT_Node OPB_NewString (OPS_String str, int32 len); import OPT_Node OPB_Nil (void); -import void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y); +import void OPB_Op (int8 op, OPT_Node *x, OPT_Node y); import void OPB_OptIf (OPT_Node *x); import void OPB_Param (OPT_Node ap, OPT_Object fp); import void OPB_PrepCall (OPT_Node *x, OPT_Object *fpar); import void OPB_Return (OPT_Node *x, OPT_Object proc); import void OPB_SetElem (OPT_Node *x); import void OPB_SetRange (OPT_Node *x, OPT_Node y); -import void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno); -import void OPB_StPar0 (OPT_Node *par0, INTEGER fctno); -import void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno); -import void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n); -import void OPB_StaticLink (SHORTINT dlev); +import void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno); +import void OPB_StPar0 (OPT_Node *par0, int16 fctno); +import void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno); +import void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n); +import void OPB_StaticLink (int8 dlev); import void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard); import void *OPB__init(void); diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 9f818a4a..08469d42 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -5,27 +5,27 @@ #include "OPT.h" -static INTEGER OPC_indentLevel; +static int16 OPC_indentLevel; static BOOLEAN OPC_ptrinit, OPC_mainprog, OPC_ansi; -static SHORTINT OPC_hashtab[105]; -static CHAR OPC_keytab[36][9]; +static int8 OPC_hashtab[105]; +static CHAR OPC_keytab[50][9]; static BOOLEAN OPC_GlbPtrs; static CHAR OPC_BodyNameExt[13]; -export void OPC_Align (LONGINT *adr, LONGINT base); +export void OPC_Align (int32 *adr, int32 base); export void OPC_Andent (OPT_Struct typ); static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames); -export LONGINT OPC_BaseAlignment (OPT_Struct typ); +export int32 OPC_BaseAlignment (OPT_Struct typ); export OPT_Object OPC_BaseTProc (OPT_Object obj); export void OPC_BegBlk (void); export void OPC_BegStat (void); -static void OPC_CProcDefs (OPT_Object obj, INTEGER vis); -export void OPC_Case (LONGINT caseVal, INTEGER form); -static void OPC_CharacterLiteral (LONGINT c); -export void OPC_Cmp (INTEGER rel); +static void OPC_CProcDefs (OPT_Object obj, int16 vis); +export void OPC_Case (int32 caseVal, int16 form); +static void OPC_CharacterLiteral (int32 c); +export void OPC_Cmp (int16 rel); export void OPC_CompleteIdent (OPT_Object obj); -export void OPC_Constant (OPT_Const con, INTEGER form); +export void OPC_Constant (OPT_Const con, int16 form); static void OPC_DeclareBase (OPT_Object dcl); static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef); static void OPC_DeclareParams (OPT_Object par, BOOLEAN macro); @@ -42,45 +42,45 @@ export void OPC_EnterBody (void); export void OPC_EnterProc (OPT_Object proc); export void OPC_ExitBody (void); export void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet); -static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, LONGINT *off, LONGINT *n, LONGINT *curAlign); -static void OPC_FillGap (LONGINT gap, LONGINT off, LONGINT align, LONGINT *n, LONGINT *curAlign); +static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, int32 *off, int32 *n, int32 *curAlign); +static void OPC_FillGap (int32 gap, int32 off, int32 align, int32 *n, int32 *curAlign); export void OPC_GenBdy (OPT_Node n); -static void OPC_GenDynTypes (OPT_Node n, INTEGER vis); +static void OPC_GenDynTypes (OPT_Node n, int16 vis); export void OPC_GenEnumPtrs (OPT_Object var); export void OPC_GenHdr (OPT_Node n); export void OPC_GenHdrIncludes (void); static void OPC_GenHeaderMsg (void); -export void OPC_Halt (LONGINT n); +export void OPC_Halt (int32 n); export void OPC_Ident (OPT_Object obj); -static void OPC_IdentList (OPT_Object obj, INTEGER vis); +static void OPC_IdentList (OPT_Object obj, int16 vis); static void OPC_Include (CHAR *name, LONGINT name__len); -static void OPC_IncludeImports (OPT_Object obj, INTEGER vis); +static void OPC_IncludeImports (OPT_Object obj, int16 vis); export void OPC_Increment (BOOLEAN decrement); -export void OPC_Indent (INTEGER count); +export void OPC_Indent (int16 count); export void OPC_Init (void); static void OPC_InitImports (OPT_Object obj); static void OPC_InitKeywords (void); export void OPC_InitTDesc (OPT_Struct typ); static void OPC_InitTProcs (OPT_Object typ, OPT_Object obj); -export void OPC_IntLiteral (LONGINT n, LONGINT size); -export void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim); +export void OPC_IntLiteral (int32 n, int32 size); +export void OPC_Len (OPT_Object obj, OPT_Struct array, int32 dim); static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName); -static INTEGER OPC_Length (CHAR *s, LONGINT s__len); -export LONGINT OPC_NofPtrs (OPT_Struct typ); -static INTEGER OPC_PerfectHash (CHAR *s, LONGINT s__len); +static int16 OPC_Length (CHAR *s, LONGINT s__len); +export int32 OPC_NofPtrs (OPT_Struct typ); +static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len); static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len); static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define); -static void OPC_ProcPredefs (OPT_Object obj, SHORTINT vis); +static void OPC_ProcPredefs (OPT_Object obj, int8 vis); static void OPC_PutBase (OPT_Struct typ); -static void OPC_PutPtrOffsets (OPT_Struct typ, LONGINT adr, LONGINT *cnt); +static void OPC_PutPtrOffsets (OPT_Struct typ, int32 adr, int32 *cnt); static void OPC_RegCmds (OPT_Object obj); export void OPC_SetInclude (BOOLEAN exclude); -export LONGINT OPC_SizeAlignment (LONGINT size); +export int32 OPC_SizeAlignment (int32 size); static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause); -static void OPC_Str1 (CHAR *s, LONGINT s__len, LONGINT x); -static void OPC_StringLiteral (CHAR *s, LONGINT s__len, LONGINT l); +static void OPC_Str1 (CHAR *s, LONGINT s__len, int32 x); +static void OPC_StringLiteral (CHAR *s, LONGINT s__len, int32 l); export void OPC_TDescDecl (OPT_Struct typ); -export void OPC_TypeDefs (OPT_Object obj, INTEGER vis); +export void OPC_TypeDefs (OPT_Object obj, int16 vis); export void OPC_TypeOf (OPT_Object ap); static BOOLEAN OPC_Undefined (OPT_Object obj); @@ -98,14 +98,14 @@ void OPC_Init (void) } } -void OPC_Indent (INTEGER count) +void OPC_Indent (int16 count) { OPC_indentLevel += count; } void OPC_BegStat (void) { - INTEGER i; + int16 i; i = OPC_indentLevel; while (i > 0) { OPM_Write(0x09); @@ -141,10 +141,10 @@ void OPC_EndBlk0 (void) OPM_Write('}'); } -static void OPC_Str1 (CHAR *s, LONGINT s__len, LONGINT x) +static void OPC_Str1 (CHAR *s, LONGINT s__len, int32 x) { CHAR ch; - INTEGER i; + int16 i; __DUP(s, s__len, CHAR); ch = s[0]; i = 0; @@ -160,10 +160,10 @@ static void OPC_Str1 (CHAR *s, LONGINT s__len, LONGINT x) __DEL(s); } -static INTEGER OPC_Length (CHAR *s, LONGINT s__len) +static int16 OPC_Length (CHAR *s, LONGINT s__len) { - INTEGER _o_result; - INTEGER i; + int16 _o_result; + int16 i; i = 0; while (s[__X(i, s__len)] != 0x00) { i += 1; @@ -172,14 +172,14 @@ static INTEGER OPC_Length (CHAR *s, LONGINT s__len) return _o_result; } -static INTEGER OPC_PerfectHash (CHAR *s, LONGINT s__len) +static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len) { - INTEGER _o_result; - INTEGER i, h; + int16 _o_result; + int16 i, h; i = 0; h = 0; while ((s[__X(i, s__len)] != 0x00 && i < 5)) { - h = 3 * h + (SYSTEM_INT16)s[__X(i, s__len)]; + h = 3 * h + (int16)s[__X(i, s__len)]; i += 1; } _o_result = (int)__MOD(h, 105); @@ -188,17 +188,20 @@ static INTEGER OPC_PerfectHash (CHAR *s, LONGINT s__len) void OPC_Ident (OPT_Object obj) { - INTEGER mode, level, h; + int16 mode, level, h; mode = obj->mode; level = obj->mnolev; if ((__IN(mode, 0x62) && level > 0) || __IN(mode, 0x14)) { OPM_WriteStringVar((void*)obj->name, 256); h = OPC_PerfectHash((void*)obj->name, 256); if (OPC_hashtab[__X(h, 105)] >= 0) { - if (__STRCMP(OPC_keytab[__X(OPC_hashtab[__X(h, 105)], 36)], obj->name) == 0) { + if (__STRCMP(OPC_keytab[__X(OPC_hashtab[__X(h, 105)], 50)], obj->name) == 0) { OPM_Write('_'); } } + } else if ((mode == 5 && obj->typ->form == 4)) { + OPM_WriteString((CHAR*)"int", 4); + OPM_WriteInt(__ASHL(obj->typ->size, 3)); } else { if (mode != 5 || obj->linkadr != 2) { if (mode == 13) { @@ -212,7 +215,7 @@ void OPC_Ident (OPT_Object obj) OPM_WriteStringVar((void*)OPM_modName, 32); } OPM_Write('_'); - } else if ((((((obj == OPT_sysptrtyp->strobj || obj == OPT_ainttyp->strobj) || obj == OPT_int8typ->strobj) || obj == OPT_int16typ->strobj) || obj == OPT_int32typ->strobj) || obj == OPT_int64typ->strobj) || obj == OPT_bytetyp->strobj) { + } else if ((obj == OPT_sysptrtyp->strobj || obj == OPT_ainttyp->strobj) || obj == OPT_bytetyp->strobj) { OPM_WriteString((CHAR*)"SYSTEM_", 8); } OPM_WriteStringVar((void*)obj->name, 256); @@ -221,7 +224,7 @@ void OPC_Ident (OPT_Object obj) static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause) { - INTEGER pointers; + int16 pointers; *openClause = 0; if (((typ->strobj == NIL || typ->strobj->name[0] == 0x00) && typ->comp != 4)) { if (__IN(typ->comp, 0x0c)) { @@ -257,7 +260,7 @@ static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef) { OPT_Struct typ = NIL; BOOLEAN varPar, openClause; - INTEGER form, comp; + int16 form, comp; typ = dcl->typ; varPar = ((dcl->mode == 2 && typ->comp != 2) || typ->comp == 3) || scopeDef; OPC_Stars(typ, &openClause); @@ -327,8 +330,8 @@ static void OPC_DeclareBase (OPT_Object dcl) { OPT_Struct typ = NIL, prev = NIL; OPT_Object obj = NIL; - INTEGER nofdims; - LONGINT off, n, dummy; + int16 nofdims; + int32 off, n, dummy; typ = dcl->typ; prev = typ; while ((((((((typ->strobj == NIL || typ->comp == 3) || OPC_Undefined(typ->strobj)) && typ->comp != 4)) && typ->form != 10)) && !((typ->form == 11 && typ->BaseTyp->comp == 3)))) { @@ -387,12 +390,12 @@ static void OPC_DeclareBase (OPT_Object dcl) } } -LONGINT OPC_NofPtrs (OPT_Struct typ) +int32 OPC_NofPtrs (OPT_Struct typ) { - LONGINT _o_result; + int32 _o_result; OPT_Object fld = NIL; OPT_Struct btyp = NIL; - LONGINT n; + int32 n; if ((typ->form == 11 && typ->sysflag == 0)) { _o_result = 1; return _o_result; @@ -430,11 +433,11 @@ LONGINT OPC_NofPtrs (OPT_Struct typ) __RETCHK; } -static void OPC_PutPtrOffsets (OPT_Struct typ, LONGINT adr, LONGINT *cnt) +static void OPC_PutPtrOffsets (OPT_Struct typ, int32 adr, int32 *cnt) { OPT_Object fld = NIL; OPT_Struct btyp = NIL; - LONGINT n, i; + int32 n, i; if ((typ->form == 11 && typ->sysflag == 0)) { OPM_WriteInt(adr); OPM_WriteString((CHAR*)", ", 3); @@ -510,7 +513,7 @@ static void OPC_PutBase (OPT_Struct typ) static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName) { OPT_Struct typ = NIL; - INTEGER dim; + int16 dim; if (showParamName) { OPC_Ident(par); OPM_WriteString((CHAR*)"__len", 6); @@ -610,7 +613,7 @@ OPT_Object OPC_BaseTProc (OPT_Object obj) { OPT_Object _o_result; OPT_Struct typ = NIL, base = NIL; - LONGINT mno; + int32 mno; typ = obj->link->typ; if (typ->form == 11) { typ = typ->BaseTyp; @@ -739,7 +742,7 @@ static void OPC_DefineType (OPT_Struct str) static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len) { BOOLEAN _o_result; - INTEGER i; + int16 i; BOOLEAN r; __DUP(y, y__len, CHAR); i = 0; @@ -752,14 +755,14 @@ static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len) return _o_result; } -static void OPC_CProcDefs (OPT_Object obj, INTEGER vis) +static void OPC_CProcDefs (OPT_Object obj, int16 vis) { - INTEGER i; + int16 i; OPT_ConstExt ext = NIL; - INTEGER _for__9; + int16 _for__9; if (obj != NIL) { OPC_CProcDefs(obj->left, vis); - if ((((obj->mode == 9 && (SYSTEM_INT16)obj->vis >= vis)) && obj->adr == 1)) { + if ((((obj->mode == 9 && (int16)obj->vis >= vis)) && obj->adr == 1)) { ext = obj->conval->ext; i = 1; if (((*ext)[1] != '#' && !(OPC_Prefixed(ext, (CHAR*)"extern ", 8) || OPC_Prefixed(ext, (CHAR*)"import ", 8)))) { @@ -768,7 +771,7 @@ static void OPC_CProcDefs (OPT_Object obj, INTEGER vis) OPC_DeclareParams(obj->link, 1); OPM_Write(0x09); } - _for__9 = (SYSTEM_INT16)(*obj->conval->ext)[0]; + _for__9 = (int16)(*obj->conval->ext)[0]; i = i; while (i <= _for__9) { OPM_Write((*obj->conval->ext)[__X(i, 256)]); @@ -780,7 +783,7 @@ static void OPC_CProcDefs (OPT_Object obj, INTEGER vis) } } -void OPC_TypeDefs (OPT_Object obj, INTEGER vis) +void OPC_TypeDefs (OPT_Object obj, int16 vis) { if (obj != NIL) { OPC_TypeDefs(obj->left, vis); @@ -812,7 +815,7 @@ static void OPC_DefAnonRecs (OPT_Node n) void OPC_TDescDecl (OPT_Struct typ) { - LONGINT nofptrs; + int32 nofptrs; OPT_Object o = NIL; OPC_BegStat(); OPM_WriteString((CHAR*)"__TDESC(", 9); @@ -849,7 +852,7 @@ void OPC_InitTDesc (OPT_Struct typ) } } -void OPC_Align (LONGINT *adr, LONGINT base) +void OPC_Align (int32 *adr, int32 base) { switch (base) { case 2: @@ -869,10 +872,10 @@ void OPC_Align (LONGINT *adr, LONGINT base) } } -LONGINT OPC_SizeAlignment (LONGINT size) +int32 OPC_SizeAlignment (int32 size) { - LONGINT _o_result; - LONGINT alignment; + int32 _o_result; + int32 alignment; if (size < OPM_Alignment) { alignment = 1; while (alignment < size) { @@ -885,10 +888,10 @@ LONGINT OPC_SizeAlignment (LONGINT size) return _o_result; } -LONGINT OPC_BaseAlignment (OPT_Struct typ) +int32 OPC_BaseAlignment (OPT_Struct typ) { - LONGINT _o_result; - LONGINT alignment; + int32 _o_result; + int32 alignment; if (typ->form == 13) { if (typ->comp == 4) { alignment = __MASK(typ->align, -65536); @@ -902,9 +905,9 @@ LONGINT OPC_BaseAlignment (OPT_Struct typ) return _o_result; } -static void OPC_FillGap (LONGINT gap, LONGINT off, LONGINT align, LONGINT *n, LONGINT *curAlign) +static void OPC_FillGap (int32 gap, int32 off, int32 align, int32 *n, int32 *curAlign) { - LONGINT adr; + int32 adr; adr = off; OPC_Align(&adr, align); if ((*curAlign < align && gap - (adr - off) >= align)) { @@ -931,11 +934,11 @@ static void OPC_FillGap (LONGINT gap, LONGINT off, LONGINT align, LONGINT *n, LO } } -static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, LONGINT *off, LONGINT *n, LONGINT *curAlign) +static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, int32 *off, int32 *n, int32 *curAlign) { OPT_Object fld = NIL; OPT_Struct base = NIL; - LONGINT gap, adr, align, fldAlign; + int32 gap, adr, align, fldAlign; fld = typ->link; align = __MASK(typ->align, -65536); if (typ->BaseTyp != NIL) { @@ -991,16 +994,16 @@ static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, LONGINT *off, LONGINT * } } -static void OPC_IdentList (OPT_Object obj, INTEGER vis) +static void OPC_IdentList (OPT_Object obj, int16 vis) { OPT_Struct base = NIL; BOOLEAN first; - INTEGER lastvis; + int16 lastvis; base = NIL; first = 1; while ((obj != NIL && obj->mode != 13)) { if ((__IN(vis, 0x05) || (vis == 1 && obj->vis != 0)) || (vis == 3 && !obj->leaf)) { - if (obj->typ != base || (SYSTEM_INT16)obj->vis != lastvis) { + if (obj->typ != base || (int16)obj->vis != lastvis) { if (!first) { OPC_EndStat(); } @@ -1120,7 +1123,7 @@ static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define) } } -static void OPC_ProcPredefs (OPT_Object obj, SHORTINT vis) +static void OPC_ProcPredefs (OPT_Object obj, int8 vis) { if (obj != NIL) { OPC_ProcPredefs(obj->left, vis); @@ -1150,18 +1153,18 @@ static void OPC_Include (CHAR *name, LONGINT name__len) __DEL(name); } -static void OPC_IncludeImports (OPT_Object obj, INTEGER vis) +static void OPC_IncludeImports (OPT_Object obj, int16 vis) { if (obj != NIL) { OPC_IncludeImports(obj->left, vis); - if ((((obj->mode == 11 && obj->mnolev != 0)) && (SYSTEM_INT16)OPT_GlbMod[__X(-obj->mnolev, 64)]->vis >= vis)) { + if ((((obj->mode == 11 && obj->mnolev != 0)) && (int16)OPT_GlbMod[__X(-obj->mnolev, 64)]->vis >= vis)) { OPC_Include(OPT_GlbMod[__X(-obj->mnolev, 64)]->name, 256); } OPC_IncludeImports(obj->right, vis); } } -static void OPC_GenDynTypes (OPT_Node n, INTEGER vis) +static void OPC_GenDynTypes (OPT_Node n, int16 vis) { OPT_Struct typ = NIL; while ((n != NIL && n->class == 14)) { @@ -1209,7 +1212,7 @@ void OPC_GenHdr (OPT_Node n) static void OPC_GenHeaderMsg (void) { - INTEGER i; + int16 i; OPM_WriteString((CHAR*)"/* ", 4); OPM_WriteString((CHAR*)"voc", 4); OPM_Write(' '); @@ -1360,7 +1363,7 @@ static void OPC_InitImports (OPT_Object obj) void OPC_GenEnumPtrs (OPT_Object var) { OPT_Struct typ = NIL; - LONGINT n; + int32 n; OPC_GlbPtrs = 0; while (var != NIL) { typ = var->typ; @@ -1521,7 +1524,7 @@ void OPC_EnterProc (OPT_Object proc) { OPT_Object var = NIL, scope = NIL; OPT_Struct typ = NIL; - INTEGER dim; + int16 dim; if (proc->vis != 1) { OPM_WriteString((CHAR*)"static ", 8); } @@ -1750,7 +1753,7 @@ void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet) void OPC_CompleteIdent (OPT_Object obj) { - INTEGER comp, level; + int16 comp, level; level = obj->mnolev; if (obj->adr == 1) { if (obj->typ->comp == 4) { @@ -1779,10 +1782,10 @@ void OPC_CompleteIdent (OPT_Object obj) void OPC_TypeOf (OPT_Object ap) { - INTEGER i; + int16 i; __ASSERT(ap->typ->comp == 4, 0); if (ap->mode == 2) { - if ((SYSTEM_INT16)ap->mnolev != OPM_level) { + if ((int16)ap->mnolev != OPM_level) { OPM_WriteStringVar((void*)ap->scope->name, 256); OPM_WriteString((CHAR*)"_s->", 5); OPC_Ident(ap); @@ -1798,7 +1801,7 @@ void OPC_TypeOf (OPT_Object ap) } } -void OPC_Cmp (INTEGER rel) +void OPC_Cmp (int16 rel) { switch (rel) { case 9: @@ -1827,7 +1830,7 @@ void OPC_Cmp (INTEGER rel) } } -static void OPC_CharacterLiteral (LONGINT c) +static void OPC_CharacterLiteral (int32 c) { if (c < 32 || c > 126) { OPM_WriteString((CHAR*)"0x", 3); @@ -1842,15 +1845,15 @@ static void OPC_CharacterLiteral (LONGINT c) } } -static void OPC_StringLiteral (CHAR *s, LONGINT s__len, LONGINT l) +static void OPC_StringLiteral (CHAR *s, LONGINT s__len, int32 l) { - LONGINT i; - INTEGER c; + int32 i; + int16 c; __DUP(s, s__len, CHAR); OPM_Write('"'); i = 0; while (i < l) { - c = (SYSTEM_INT16)s[__X(i, s__len)]; + c = (int16)s[__X(i, s__len)]; if (c < 32 || c > 126) { OPM_Write('\\'); OPM_Write((CHAR)(48 + __ASHR(c, 6))); @@ -1870,7 +1873,7 @@ static void OPC_StringLiteral (CHAR *s, LONGINT s__len, LONGINT l) __DEL(s); } -void OPC_Case (LONGINT caseVal, INTEGER form) +void OPC_Case (int32 caseVal, int16 form) { CHAR ch; OPM_WriteString((CHAR*)"case ", 6); @@ -1908,30 +1911,17 @@ void OPC_Increment (BOOLEAN decrement) } } -void OPC_Halt (LONGINT n) +void OPC_Halt (int32 n) { OPC_Str1((CHAR*)"__HALT(#)", 10, n); } -void OPC_IntLiteral (LONGINT n, LONGINT size) +void OPC_IntLiteral (int32 n, int32 size) { if ((((size > 4 && n <= 2147483647)) && n > (-2147483647-1))) { - switch (size) { - case 2: - OPM_WriteString((CHAR*)"((SYSTEM_INT16)(", 17); - break; - case 4: - OPM_WriteString((CHAR*)"((SYSTEM_INT32)(", 17); - break; - case 8: - OPM_WriteString((CHAR*)"((SYSTEM_INT64)(", 17); - break; - default: - OPM_LogWStr((CHAR*)"Unhandled case in OPC.IntLiteral, size = ", 42); - OPM_LogWNum(size, 1); - OPM_LogWLn(); - break; - } + OPM_WriteString((CHAR*)"((int", 6); + OPM_WriteInt(__ASHL(size, 3)); + OPM_WriteString((CHAR*)")(", 3); OPM_WriteInt(n); OPM_WriteString((CHAR*)"))", 3); } else { @@ -1939,7 +1929,7 @@ void OPC_IntLiteral (LONGINT n, LONGINT size) } } -void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim) +void OPC_Len (OPT_Object obj, OPT_Struct array, int32 dim) { if (array->comp == 3) { OPC_CompleteIdent(obj); @@ -1960,11 +1950,11 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim) } } -void OPC_Constant (OPT_Const con, INTEGER form) +void OPC_Constant (OPT_Const con, int16 form) { - INTEGER i; + int16 i; SET s; - LONGINT hex; + int32 hex; BOOLEAN skipLeading; switch (form) { case 1: @@ -2023,7 +2013,7 @@ void OPC_Constant (OPT_Const con, INTEGER form) } static struct InitKeywords__48 { - SHORTINT *n; + int8 *n; struct InitKeywords__48 *lnk; } *InitKeywords__48_s; @@ -2031,18 +2021,18 @@ static void Enter__49 (CHAR *s, LONGINT s__len); static void Enter__49 (CHAR *s, LONGINT s__len) { - INTEGER h; + int16 h; __DUP(s, s__len, CHAR); h = OPC_PerfectHash((void*)s, s__len); OPC_hashtab[__X(h, 105)] = *InitKeywords__48_s->n; - __COPY(s, OPC_keytab[__X(*InitKeywords__48_s->n, 36)], 9); + __COPY(s, OPC_keytab[__X(*InitKeywords__48_s->n, 50)], 9); *InitKeywords__48_s->n += 1; __DEL(s); } static void OPC_InitKeywords (void) { - SHORTINT n, i; + int8 n, i; struct InitKeywords__48 _s; _s.n = &n; _s.lnk = InitKeywords__48_s; @@ -2053,6 +2043,7 @@ static void OPC_InitKeywords (void) OPC_hashtab[__X(i, 105)] = -1; i += 1; } + Enter__49((CHAR*)"adrint", 7); Enter__49((CHAR*)"asm", 4); Enter__49((CHAR*)"auto", 5); Enter__49((CHAR*)"break", 6); @@ -2074,16 +2065,25 @@ static void OPC_InitKeywords (void) Enter__49((CHAR*)"if", 3); Enter__49((CHAR*)"import", 7); Enter__49((CHAR*)"int", 4); + Enter__49((CHAR*)"int16", 6); + Enter__49((CHAR*)"int32", 6); + Enter__49((CHAR*)"int64", 6); + Enter__49((CHAR*)"int8", 5); Enter__49((CHAR*)"long", 5); Enter__49((CHAR*)"register", 9); Enter__49((CHAR*)"return", 7); Enter__49((CHAR*)"short", 6); Enter__49((CHAR*)"signed", 7); Enter__49((CHAR*)"sizeof", 7); + Enter__49((CHAR*)"size_t", 7); Enter__49((CHAR*)"static", 7); Enter__49((CHAR*)"struct", 7); Enter__49((CHAR*)"switch", 7); Enter__49((CHAR*)"typedef", 8); + Enter__49((CHAR*)"uint16", 7); + Enter__49((CHAR*)"uint32", 7); + Enter__49((CHAR*)"uint64", 7); + Enter__49((CHAR*)"uint8", 6); Enter__49((CHAR*)"union", 6); Enter__49((CHAR*)"unsigned", 9); Enter__49((CHAR*)"void", 5); diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index 38f95afe..05c34fcc 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -9,16 +9,16 @@ -import void OPC_Align (LONGINT *adr, LONGINT base); +import void OPC_Align (int32 *adr, int32 base); import void OPC_Andent (OPT_Struct typ); -import LONGINT OPC_BaseAlignment (OPT_Struct typ); +import int32 OPC_BaseAlignment (OPT_Struct typ); import OPT_Object OPC_BaseTProc (OPT_Object obj); import void OPC_BegBlk (void); import void OPC_BegStat (void); -import void OPC_Case (LONGINT caseVal, INTEGER form); -import void OPC_Cmp (INTEGER rel); +import void OPC_Case (int32 caseVal, int16 form); +import void OPC_Cmp (int16 rel); import void OPC_CompleteIdent (OPT_Object obj); -import void OPC_Constant (OPT_Const con, INTEGER form); +import void OPC_Constant (OPT_Const con, int16 form); import void OPC_DefineInter (OPT_Object proc); import void OPC_EndBlk (void); import void OPC_EndBlk0 (void); @@ -31,19 +31,19 @@ import void OPC_GenBdy (OPT_Node n); import void OPC_GenEnumPtrs (OPT_Object var); import void OPC_GenHdr (OPT_Node n); import void OPC_GenHdrIncludes (void); -import void OPC_Halt (LONGINT n); +import void OPC_Halt (int32 n); import void OPC_Ident (OPT_Object obj); import void OPC_Increment (BOOLEAN decrement); -import void OPC_Indent (INTEGER count); +import void OPC_Indent (int16 count); import void OPC_Init (void); import void OPC_InitTDesc (OPT_Struct typ); -import void OPC_IntLiteral (LONGINT n, LONGINT size); -import void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim); -import LONGINT OPC_NofPtrs (OPT_Struct typ); +import void OPC_IntLiteral (int32 n, int32 size); +import void OPC_Len (OPT_Object obj, OPT_Struct array, int32 dim); +import int32 OPC_NofPtrs (OPT_Struct typ); import void OPC_SetInclude (BOOLEAN exclude); -import LONGINT OPC_SizeAlignment (LONGINT size); +import int32 OPC_SizeAlignment (int32 size); import void OPC_TDescDecl (OPT_Struct typ); -import void OPC_TypeDefs (OPT_Object obj, INTEGER vis); +import void OPC_TypeDefs (OPT_Object obj, int16 vis); import void OPC_TypeOf (OPT_Object ap); import void *OPC__init(void); diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index f2da0fed..8bf863b3 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -14,23 +14,23 @@ typedef static CHAR OPM_SourceFileName[256]; -export INTEGER OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet; -export LONGINT OPM_MaxIndex; +export int16 OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet; +export int32 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; -export LONGINT OPM_curpos, OPM_errpos, OPM_breakpc; -export INTEGER OPM_currFile, OPM_level, OPM_pc, OPM_entno; +export int32 OPM_curpos, OPM_errpos, OPM_breakpc; +export int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; export CHAR OPM_modName[32]; export CHAR OPM_objname[64]; export SET OPM_opt, OPM_glbopt; -static LONGINT OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; +static int32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; static Texts_Reader OPM_inR; static Texts_Text OPM_Log; static Texts_Writer OPM_W; static Files_Rider OPM_oldSF, OPM_newSF; static Files_Rider OPM_R[3]; static Files_File OPM_oldSFile, OPM_newSFile, OPM_HFile, OPM_BFile, OPM_HIFile; -static INTEGER OPM_S; +static int16 OPM_S; export BOOLEAN OPM_dontAsm, OPM_dontLink, OPM_mainProg, OPM_mainLinkStat, OPM_notColorOutput, OPM_forceNewSym, OPM_Verbose; static CHAR OPM_OBERON[1024]; static CHAR OPM_MODULES[1024]; @@ -40,54 +40,54 @@ static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F); export void OPM_CloseFiles (void); export void OPM_CloseOldSym (void); export void OPM_DeleteNewSym (void); -export void OPM_FPrint (LONGINT *fp, LONGINT val); -export void OPM_FPrintLReal (LONGINT *fp, LONGREAL lr); -export void OPM_FPrintReal (LONGINT *fp, REAL real); -export void OPM_FPrintSet (LONGINT *fp, SET set); -static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, LONGINT pos); +export void OPM_FPrint (int32 *fp, int32 val); +export void OPM_FPrintLReal (int32 *fp, LONGREAL lr); +export void OPM_FPrintReal (int32 *fp, REAL real); +export void OPM_FPrintSet (int32 *fp, SET set); +static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, int32 pos); export void OPM_Get (CHAR *ch); static void OPM_GetProperties (void); -static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONGINT name__len, INTEGER *size, INTEGER *align); +static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONGINT name__len, int16 *size, int16 *align); export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); export void OPM_InitOptions (void); -static void OPM_LogErrMsg (INTEGER n); +static void OPM_LogErrMsg (int16 n); export void OPM_LogW (CHAR ch); export void OPM_LogWLn (void); -export void OPM_LogWNum (LONGINT i, LONGINT len); +export void OPM_LogWNum (int32 i, int32 len); export void OPM_LogWStr (CHAR *s, LONGINT s__len); static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len); -export void OPM_Mark (INTEGER n, LONGINT pos); +export void OPM_Mark (int16 n, int32 pos); export void OPM_NewSym (CHAR *modName, LONGINT modName__len); export void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); export void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); export BOOLEAN OPM_OpenPar (void); export void OPM_RegisterNewSym (void); static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt); -static void OPM_ShowLine (LONGINT pos); -export LONGINT OPM_SignedMaximum (LONGINT bytecount); -export LONGINT OPM_SignedMinimum (LONGINT bytecount); +static void OPM_ShowLine (int32 pos); +export int32 OPM_SignedMaximum (int32 bytecount); +export int32 OPM_SignedMinimum (int32 bytecount); export void OPM_SymRCh (CHAR *ch); -export LONGINT OPM_SymRInt (void); +export int32 OPM_SymRInt (void); export void OPM_SymRLReal (LONGREAL *lr); export void OPM_SymRReal (REAL *r); export void OPM_SymRSet (SET *s); export void OPM_SymWCh (CHAR ch); -export void OPM_SymWInt (LONGINT i); +export void OPM_SymWInt (int32 i); export void OPM_SymWLReal (LONGREAL lr); export void OPM_SymWReal (REAL r); export void OPM_SymWSet (SET s); static void OPM_VerboseListSizes (void); export void OPM_Write (CHAR ch); -export void OPM_WriteHex (LONGINT i); -export void OPM_WriteInt (LONGINT i); +export void OPM_WriteHex (int32 i); +export void OPM_WriteInt (int32 i); export void OPM_WriteLn (void); export void OPM_WriteReal (LONGREAL r, CHAR suffx); export void OPM_WriteString (CHAR *s, LONGINT s__len); export void OPM_WriteStringVar (CHAR *s, LONGINT s__len); export BOOLEAN OPM_eofSF (void); -export void OPM_err (INTEGER n); -static LONGINT OPM_minusop (LONGINT i); -static LONGINT OPM_power0 (LONGINT i, LONGINT j); +export void OPM_err (int16 n); +static int32 OPM_minusop (int32 i); +static int32 OPM_power0 (int32 i, int32 j); void OPM_LogW (CHAR ch) @@ -102,7 +102,7 @@ void OPM_LogWStr (CHAR *s, LONGINT s__len) __DEL(s); } -void OPM_LogWNum (LONGINT i, LONGINT len) +void OPM_LogWNum (int32 i, int32 len) { Console_Int(i, len); } @@ -114,7 +114,7 @@ void OPM_LogWLn (void) static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) { - INTEGER i; + int16 i; i = 1; while (s[__X(i, s__len)] != 0x00) { switch (s[__X(i, s__len)]) { @@ -154,15 +154,15 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) case 'B': if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_IntSize = (SYSTEM_INT16)s[__X(i, s__len)] - 48; + OPM_IntSize = (int16)s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_PointerSize = (SYSTEM_INT16)s[__X(i, s__len)] - 48; + OPM_PointerSize = (int16)s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_Alignment = (SYSTEM_INT16)s[__X(i, s__len)] - 48; + OPM_Alignment = (int16)s[__X(i, s__len)] - 48; } __ASSERT(OPM_IntSize == 2 || OPM_IntSize == 4, 0); __ASSERT(OPM_PointerSize == 4 || OPM_PointerSize == 8, 0); @@ -299,7 +299,7 @@ void OPM_InitOptions (void) void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len) { Texts_Text T = NIL; - LONGINT beg, end, time; + int32 beg, end, time; CHAR s[256]; *done = 0; OPM_curpos = 0; @@ -347,7 +347,7 @@ void OPM_Get (CHAR *ch) static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len) { - INTEGER i, j; + int16 i, j; CHAR ch; __DUP(ext, ext__len, CHAR); i = 0; @@ -369,12 +369,12 @@ static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGIN __DEL(ext); } -static void OPM_LogErrMsg (INTEGER n) +static void OPM_LogErrMsg (int16 n) { Texts_Scanner S; Texts_Text T = NIL; CHAR ch; - INTEGER i; + int16 i; CHAR buf[1024]; if (n >= 0) { if (!OPM_notColorOutput) { @@ -399,7 +399,7 @@ static void OPM_LogErrMsg (INTEGER n) OPM_LogWStr(errors_errors[__X(n, 350)], 128); } -static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, LONGINT pos) +static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, int32 pos) { CHAR ch, cheol; if (pos < OPM_ErrorLineStartPos) { @@ -431,12 +431,12 @@ static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, LONGINT Files_Set(&*r, r__typ, f, OPM_ErrorLineStartPos); } -static void OPM_ShowLine (LONGINT pos) +static void OPM_ShowLine (int32 pos) { Files_File f = NIL; Files_Rider r; CHAR line[1023]; - INTEGER i; + int16 i; CHAR ch; f = Files_Old(OPM_SourceFileName, 256); OPM_FindLine(f, &r, Files_Rider__typ, pos); @@ -458,7 +458,7 @@ static void OPM_ShowLine (LONGINT pos) if (pos >= OPM_ErrorLineLimitPos) { pos = OPM_ErrorLineLimitPos - 1; } - i = (SYSTEM_INT16)(pos - OPM_ErrorLineStartPos); + i = (int16)(pos - OPM_ErrorLineStartPos); while (i > 0) { OPM_LogW(' '); i -= 1; @@ -473,7 +473,7 @@ static void OPM_ShowLine (LONGINT pos) Files_Close(f); } -void OPM_Mark (INTEGER n, LONGINT pos) +void OPM_Mark (int16 n, int32 pos) { if (pos == -1) { pos = 0; @@ -525,51 +525,51 @@ void OPM_Mark (INTEGER n, LONGINT pos) } } -void OPM_err (INTEGER n) +void OPM_err (int16 n) { OPM_Mark(n, OPM_errpos); } -void OPM_FPrint (LONGINT *fp, LONGINT val) +void OPM_FPrint (int32 *fp, int32 val) { - *fp = __ROTL((LONGINT)((SET)*fp ^ (SET)val), 1, LONGINT); + *fp = __ROTL((int32)((SET)*fp ^ (SET)val), 1, int32); } -void OPM_FPrintSet (LONGINT *fp, SET set) +void OPM_FPrintSet (int32 *fp, SET set) { - OPM_FPrint(&*fp, (LONGINT)set); + OPM_FPrint(&*fp, (int32)set); } -void OPM_FPrintReal (LONGINT *fp, REAL real) +void OPM_FPrintReal (int32 *fp, REAL real) { - INTEGER i; - LONGINT l; - __GET((SYSTEM_ADRINT)&real, l, LONGINT); + int16 i; + int32 l; + __GET((SYSTEM_ADRINT)&real, l, int32); OPM_FPrint(&*fp, l); } -void OPM_FPrintLReal (LONGINT *fp, LONGREAL lr) +void OPM_FPrintLReal (int32 *fp, LONGREAL lr) { - LONGINT l, h; - __GET((SYSTEM_ADRINT)&lr, l, LONGINT); - __GET((SYSTEM_ADRINT)&lr + 4, h, LONGINT); + int32 l, h; + __GET((SYSTEM_ADRINT)&lr, l, int32); + __GET((SYSTEM_ADRINT)&lr + 4, h, int32); OPM_FPrint(&*fp, l); OPM_FPrint(&*fp, h); } -static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONGINT name__len, INTEGER *size, INTEGER *align) +static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONGINT name__len, int16 *size, int16 *align) { __DUP(name, name__len, CHAR); if (((*S).class == 1 && __STRCMP((*S).s, name) == 0)) { Texts_Scan(&*S, S__typ); if ((*S).class == 3) { - *size = (SYSTEM_INT16)(*S).i; + *size = (int16)(*S).i; Texts_Scan(&*S, S__typ); } else { OPM_Mark(-157, -1); } if ((*S).class == 3) { - *align = (SYSTEM_INT16)(*S).i; + *align = (int16)(*S).i; Texts_Scan(&*S, S__typ); } else { OPM_Mark(-157, -1); @@ -580,17 +580,17 @@ static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONG __DEL(name); } -static LONGINT OPM_minusop (LONGINT i) +static int32 OPM_minusop (int32 i) { - LONGINT _o_result; + int32 _o_result; _o_result = -i; return _o_result; } -static LONGINT OPM_power0 (LONGINT i, LONGINT j) +static int32 OPM_power0 (int32 i, int32 j) { - LONGINT _o_result; - LONGINT k, p; + int32 _o_result; + int32 k, p; k = 1; p = i; do { @@ -642,19 +642,19 @@ static void OPM_VerboseListSizes (void) OPM_LogWLn(); } -LONGINT OPM_SignedMaximum (LONGINT bytecount) +int32 OPM_SignedMaximum (int32 bytecount) { - LONGINT _o_result; - LONGINT result; + int32 _o_result; + int32 result; result = 1; - result = __LSH(result, __ASHL(bytecount, 3) - 1, LONGINT); + result = __LSH(result, __ASHL(bytecount, 3) - 1, int32); _o_result = result - 1; return _o_result; } -LONGINT OPM_SignedMinimum (LONGINT bytecount) +int32 OPM_SignedMinimum (int32 bytecount) { - LONGINT _o_result; + int32 _o_result; _o_result = -OPM_SignedMaximum(bytecount) - 1; return _o_result; } @@ -688,10 +688,10 @@ void OPM_SymRCh (CHAR *ch) Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&*ch); } -LONGINT OPM_SymRInt (void) +int32 OPM_SymRInt (void) { - LONGINT _o_result; - LONGINT k; + int32 _o_result; + int32 k; Files_ReadNum(&OPM_oldSF, Files_Rider__typ, &k); _o_result = k; return _o_result; @@ -699,7 +699,7 @@ LONGINT OPM_SymRInt (void) void OPM_SymRSet (SET *s) { - Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (LONGINT*)&*s); + Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (int32*)&*s); } void OPM_SymRReal (REAL *r) @@ -746,14 +746,14 @@ void OPM_SymWCh (CHAR ch) Files_Write(&OPM_newSF, Files_Rider__typ, ch); } -void OPM_SymWInt (LONGINT i) +void OPM_SymWInt (int32 i) { Files_WriteNum(&OPM_newSF, Files_Rider__typ, i); } void OPM_SymWSet (SET s) { - Files_WriteNum(&OPM_newSF, Files_Rider__typ, (LONGINT)s); + Files_WriteNum(&OPM_newSF, Files_Rider__typ, (int32)s); } void OPM_SymWReal (REAL r) @@ -797,7 +797,7 @@ void OPM_Write (CHAR ch) void OPM_WriteString (CHAR *s, LONGINT s__len) { - INTEGER i; + int16 i; i = 0; while (s[__X(i, s__len)] != 0x00) { i += 1; @@ -807,7 +807,7 @@ void OPM_WriteString (CHAR *s, LONGINT s__len) void OPM_WriteStringVar (CHAR *s, LONGINT s__len) { - INTEGER i; + int16 i; i = 0; while (s[__X(i, s__len)] != 0x00) { i += 1; @@ -815,17 +815,17 @@ void OPM_WriteStringVar (CHAR *s, LONGINT s__len) Files_WriteBytes(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, (void*)s, s__len * 1, i); } -void OPM_WriteHex (LONGINT i) +void OPM_WriteHex (int32 i) { CHAR s[3]; - INTEGER digit; - digit = __ASHR((SYSTEM_INT16)i, 4); + int16 digit; + digit = __ASHR((int16)i, 4); if (digit < 10) { s[0] = (CHAR)(48 + digit); } else { s[0] = (CHAR)(87 + digit); } - digit = __MASK((SYSTEM_INT16)i, -16); + digit = __MASK((int16)i, -16); if (digit < 10) { s[1] = (CHAR)(48 + digit); } else { @@ -835,10 +835,10 @@ void OPM_WriteHex (LONGINT i) OPM_WriteString(s, 3); } -void OPM_WriteInt (LONGINT i) +void OPM_WriteInt (int32 i) { CHAR s[20]; - LONGINT i1, k; + int32 i1, k; if (i == OPM_SignedMinimum(OPM_IntSize) || i == OPM_SignedMinimum(OPM_LIntSize)) { OPM_Write('('); OPM_WriteInt(i + 1); @@ -871,14 +871,14 @@ void OPM_WriteReal (LONGREAL r, CHAR suffx) Texts_Reader R; CHAR s[32]; CHAR ch; - INTEGER i; - if ((((r < OPM_SignedMaximum(OPM_LIntSize) && r > OPM_SignedMinimum(OPM_LIntSize))) && r == ((SYSTEM_INT32)__ENTIER(r)))) { + int16 i; + if ((((r < OPM_SignedMaximum(OPM_LIntSize) && r > OPM_SignedMinimum(OPM_LIntSize))) && r == ((int32)__ENTIER(r)))) { if (suffx == 'f') { OPM_WriteString((CHAR*)"(REAL)", 7); } else { OPM_WriteString((CHAR*)"(LONGREAL)", 11); } - OPM_WriteInt((SYSTEM_INT32)__ENTIER(r)); + OPM_WriteInt((int32)__ENTIER(r)); } else { Texts_OpenWriter(&W, Texts_Writer__typ); if (suffx == 'f') { @@ -959,7 +959,7 @@ void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len) void OPM_CloseFiles (void) { CHAR FName[32]; - INTEGER res; + int16 res; if (OPM_noerr) { OPM_LogWStr((CHAR*)" ", 3); OPM_LogWNum(Files_Pos(&OPM_R[1], Files_Rider__typ), 0); diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index 15a980a6..36eb4165 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -6,12 +6,12 @@ #include "SYSTEM.h" -import INTEGER OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet; -import LONGINT OPM_MaxIndex; +import int16 OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet; +import int32 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; -import LONGINT OPM_curpos, OPM_errpos, OPM_breakpc; -import INTEGER OPM_currFile, OPM_level, OPM_pc, OPM_entno; +import int32 OPM_curpos, OPM_errpos, OPM_breakpc; +import int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; import CHAR OPM_modName[32]; import CHAR OPM_objname[64]; import SET OPM_opt, OPM_glbopt; @@ -21,44 +21,44 @@ import BOOLEAN OPM_dontAsm, OPM_dontLink, OPM_mainProg, OPM_mainLinkStat, OPM_no import void OPM_CloseFiles (void); import void OPM_CloseOldSym (void); import void OPM_DeleteNewSym (void); -import void OPM_FPrint (LONGINT *fp, LONGINT val); -import void OPM_FPrintLReal (LONGINT *fp, LONGREAL lr); -import void OPM_FPrintReal (LONGINT *fp, REAL real); -import void OPM_FPrintSet (LONGINT *fp, SET set); +import void OPM_FPrint (int32 *fp, int32 val); +import void OPM_FPrintLReal (int32 *fp, LONGREAL lr); +import void OPM_FPrintReal (int32 *fp, REAL real); +import void OPM_FPrintSet (int32 *fp, SET set); import void OPM_Get (CHAR *ch); import void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); import void OPM_InitOptions (void); import void OPM_LogW (CHAR ch); import void OPM_LogWLn (void); -import void OPM_LogWNum (LONGINT i, LONGINT len); +import void OPM_LogWNum (int32 i, int32 len); import void OPM_LogWStr (CHAR *s, LONGINT s__len); -import void OPM_Mark (INTEGER n, LONGINT pos); +import void OPM_Mark (int16 n, int32 pos); import void OPM_NewSym (CHAR *modName, LONGINT modName__len); import void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); import void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); import BOOLEAN OPM_OpenPar (void); import void OPM_RegisterNewSym (void); -import LONGINT OPM_SignedMaximum (LONGINT bytecount); -import LONGINT OPM_SignedMinimum (LONGINT bytecount); +import int32 OPM_SignedMaximum (int32 bytecount); +import int32 OPM_SignedMinimum (int32 bytecount); import void OPM_SymRCh (CHAR *ch); -import LONGINT OPM_SymRInt (void); +import int32 OPM_SymRInt (void); import void OPM_SymRLReal (LONGREAL *lr); import void OPM_SymRReal (REAL *r); import void OPM_SymRSet (SET *s); import void OPM_SymWCh (CHAR ch); -import void OPM_SymWInt (LONGINT i); +import void OPM_SymWInt (int32 i); import void OPM_SymWLReal (LONGREAL lr); import void OPM_SymWReal (REAL r); import void OPM_SymWSet (SET s); import void OPM_Write (CHAR ch); -import void OPM_WriteHex (LONGINT i); -import void OPM_WriteInt (LONGINT i); +import void OPM_WriteHex (int32 i); +import void OPM_WriteInt (int32 i); import void OPM_WriteLn (void); import void OPM_WriteReal (LONGREAL r, CHAR suffx); import void OPM_WriteString (CHAR *s, LONGINT s__len); import void OPM_WriteStringVar (CHAR *s, LONGINT s__len); import BOOLEAN OPM_eofSF (void); -import void OPM_err (INTEGER n); +import void OPM_err (int16 n); import void *OPM__init(void); diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index 21c21350..a366ef24 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -6,17 +6,17 @@ #include "OPT.h" struct OPP__1 { - LONGINT low, high; + int32 low, high; }; typedef struct OPP__1 OPP_CaseTable[128]; -static SHORTINT OPP_sym, OPP_level; -static INTEGER OPP_LoopLevel; +static int8 OPP_sym, OPP_level; +static int16 OPP_LoopLevel; static OPT_Node OPP_TDinit, OPP_lastTDinit; -static INTEGER OPP_nofFwdPtr; +static int16 OPP_nofFwdPtr; static OPT_Struct OPP_FwdPtr[64]; export LONGINT *OPP__1__typ; @@ -24,10 +24,10 @@ export LONGINT *OPP__1__typ; static void OPP_ActualParameters (OPT_Node *aparlist, OPT_Object fpar); static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned); static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq); -static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, OPP_CaseTable tab); -static void OPP_CheckMark (SHORTINT *vis); -static void OPP_CheckSym (INTEGER s); -static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_); +static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int16 *n, OPP_CaseTable tab); +static void OPP_CheckMark (int8 *vis); +static void OPP_CheckSym (int16 s); +static void OPP_CheckSysFlag (int16 *sysflag, int16 default_); static void OPP_ConstExpression (OPT_Node *x); static void OPP_Element (OPT_Node *x); static void OPP_Expression (OPT_Node *x); @@ -37,7 +37,7 @@ static void OPP_FormalParameters (OPT_Object *firstPar, OPT_Struct *resTyp); export void OPP_Module (OPT_Node *prog, SET opt); static void OPP_PointerType (OPT_Struct *typ); static void OPP_ProcedureDeclaration (OPT_Node *x); -static void OPP_Receiver (SHORTINT *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec); +static void OPP_Receiver (int8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec); static void OPP_RecordType (OPT_Struct *typ, OPT_Struct *banned); static void OPP_Sets (OPT_Node *x); static void OPP_SimpleExpression (OPT_Node *x); @@ -46,19 +46,19 @@ static void OPP_StatSeq (OPT_Node *stat); static void OPP_Term (OPT_Node *x); static void OPP_Type (OPT_Struct *typ, OPT_Struct *banned); static void OPP_TypeDecl (OPT_Struct *typ, OPT_Struct *banned); -static void OPP_err (INTEGER n); +static void OPP_err (int16 n); static void OPP_qualident (OPT_Object *id); static void OPP_selector (OPT_Node *x); -static void OPP_err (INTEGER n) +static void OPP_err (int16 n) { OPM_err(n); } -static void OPP_CheckSym (INTEGER s) +static void OPP_CheckSym (int16 s) { - if ((SYSTEM_INT16)OPP_sym == s) { + if ((int16)OPP_sym == s) { OPS_Get(&OPP_sym); } else { OPM_err(s); @@ -68,7 +68,7 @@ static void OPP_CheckSym (INTEGER s) static void OPP_qualident (OPT_Object *id) { OPT_Object obj = NIL; - SHORTINT lev; + int8 lev; OPT_Find(&obj); OPS_Get(&OPP_sym); if ((((OPP_sym == 18 && obj != NIL)) && obj->mode == 11)) { @@ -108,7 +108,7 @@ static void OPP_ConstExpression (OPT_Node *x) } } -static void OPP_CheckMark (SHORTINT *vis) +static void OPP_CheckMark (int8 *vis) { OPS_Get(&OPP_sym); if (OPP_sym == 1 || OPP_sym == 7) { @@ -126,10 +126,10 @@ static void OPP_CheckMark (SHORTINT *vis) } } -static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_) +static void OPP_CheckSysFlag (int16 *sysflag, int16 default_) { OPT_Node x = NIL; - LONGINT sf; + int32 sf; if (OPP_sym == 31) { OPS_Get(&OPP_sym); if (!OPT_SYSimported) { @@ -146,7 +146,7 @@ static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_) OPP_err(51); sf = 0; } - *sysflag = (SYSTEM_INT16)sf; + *sysflag = (int16)sf; OPP_CheckSym(23); } else { *sysflag = default_; @@ -157,7 +157,7 @@ static void OPP_RecordType (OPT_Struct *typ, OPT_Struct *banned) { OPT_Object fld = NIL, first = NIL, last = NIL, base = NIL; OPT_Struct ftyp = NIL; - INTEGER sysflag; + int16 sysflag; *typ = OPT_NewStr(13, 4); (*typ)->BaseTyp = NIL; OPP_CheckSysFlag(&sysflag, -1); @@ -249,8 +249,8 @@ static void OPP_RecordType (OPT_Struct *typ, OPT_Struct *banned) static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) { OPT_Node x = NIL; - LONGINT n; - INTEGER sysflag; + int32 n; + int16 sysflag; OPP_CheckSysFlag(&sysflag, 0); if (OPP_sym == 25) { *typ = OPT_NewStr(13, 3); @@ -342,7 +342,7 @@ static void OPP_PointerType (OPT_Struct *typ) static void OPP_FormalParameters (OPT_Object *firstPar, OPT_Struct *resTyp) { - SHORTINT mode; + int8 mode; OPT_Object par = NIL, first = NIL, last = NIL, res = NIL; OPT_Struct typ = NIL; first = NIL; @@ -623,9 +623,9 @@ static void OPP_ActualParameters (OPT_Node *aparlist, OPT_Object fpar) static void OPP_StandProcCall (OPT_Node *x) { OPT_Node y = NIL; - SHORTINT m; - INTEGER n; - m = (SYSTEM_INT8)((SYSTEM_INT16)(*x)->obj->adr); + int8 m; + int16 n; + m = (int8)((int16)(*x)->obj->adr); n = 0; if (OPP_sym == 30) { OPS_Get(&OPP_sym); @@ -784,7 +784,7 @@ static void OPP_Factor (OPT_Node *x) static void OPP_Term (OPT_Node *x) { OPT_Node y = NIL; - SHORTINT mulop; + int8 mulop; OPP_Factor(&*x); while ((1 <= OPP_sym && OPP_sym <= 5)) { mulop = OPP_sym; @@ -797,7 +797,7 @@ static void OPP_Term (OPT_Node *x) static void OPP_SimpleExpression (OPT_Node *x) { OPT_Node y = NIL; - SHORTINT addop; + int8 addop; if (OPP_sym == 7) { OPS_Get(&OPP_sym); OPP_Term(&*x); @@ -821,7 +821,7 @@ static void OPP_Expression (OPT_Node *x) { OPT_Node y = NIL; OPT_Object obj = NIL; - SHORTINT relation; + int8 relation; OPP_SimpleExpression(&*x); if ((9 <= OPP_sym && OPP_sym <= 14)) { relation = OPP_sym; @@ -847,7 +847,7 @@ static void OPP_Expression (OPT_Node *x) } } -static void OPP_Receiver (SHORTINT *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec) +static void OPP_Receiver (int8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec) { OPT_Object obj = NIL; *typ = OPT_undftyp; @@ -913,7 +913,7 @@ static struct ProcedureDeclaration__16 { OPT_Node *x; OPT_Object *proc, *fwd; OPS_Name *name; - SHORTINT *mode, *vis; + int8 *mode, *vis; BOOLEAN *forward; struct ProcedureDeclaration__16 *lnk; } *ProcedureDeclaration__16_s; @@ -926,8 +926,8 @@ static void TProcDecl__23 (void); static void GetCode__19 (void) { OPT_ConstExt ext = NIL; - INTEGER n; - LONGINT c; + int16 n; + int32 c; ext = OPT_NewExt(); (*ProcedureDeclaration__16_s->proc)->conval->ext = ext; n = 0; @@ -991,7 +991,7 @@ static void GetParams__21 (void) static void Body__17 (void) { OPT_Node procdec = NIL, statseq = NIL; - LONGINT c; + int32 c; c = OPM_errpos; (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1); OPP_CheckSym(39); @@ -1014,7 +1014,7 @@ static void TProcDecl__23 (void) { OPT_Object baseProc = NIL; OPT_Struct objTyp = NIL, recTyp = NIL; - SHORTINT objMode; + int8 objMode; OPS_Name objName; OPS_Get(&OPP_sym); *ProcedureDeclaration__16_s->mode = 13; @@ -1086,7 +1086,7 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) { OPT_Object proc = NIL, fwd = NIL; OPS_Name name; - SHORTINT mode, vis; + int8 mode, vis; BOOLEAN forward; struct ProcedureDeclaration__16 _s; _s.x = x; @@ -1163,11 +1163,11 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) ProcedureDeclaration__16_s = _s.lnk; } -static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, OPP_CaseTable tab) +static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int16 *n, OPP_CaseTable tab) { OPT_Node x = NIL, y = NIL, lastlab = NIL; - INTEGER i, f; - LONGINT xval, yval; + int16 i, f; + int32 xval, yval; *lab = NIL; lastlab = NIL; for (;;) { @@ -1183,14 +1183,14 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, O if (!(LabelTyp->form == 4) || LabelTyp->size < x->typ->size) { OPP_err(60); } - } else if ((SYSTEM_INT16)LabelTyp->form != f) { + } else if ((int16)LabelTyp->form != f) { OPP_err(60); } if (OPP_sym == 21) { OPS_Get(&OPP_sym); OPP_ConstExpression(&y); yval = y->conval->intval; - if (((SYSTEM_INT16)y->typ->form != f && !((f == 4 && y->typ->form == 4)))) { + if (((int16)y->typ->form != f && !((f == 4 && y->typ->form == 4)))) { OPP_err(60); } if (yval < xval) { @@ -1234,7 +1234,7 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, O } static struct StatSeq__30 { - LONGINT *pos; + int32 *pos; struct StatSeq__30 *lnk; } *StatSeq__30_s; @@ -1244,8 +1244,8 @@ static void SetPos__35 (OPT_Node x); static void CasePart__31 (OPT_Node *x) { - INTEGER n; - LONGINT low, high; + int16 n; + int32 low, high; BOOLEAN e; OPP_CaseTable tab; OPT_Node cases = NIL, lab = NIL, y = NIL, lastcase = NIL; @@ -1328,7 +1328,7 @@ static void OPP_StatSeq (OPT_Node *stat) OPT_Struct idtyp = NIL; BOOLEAN e; OPT_Node s = NIL, x = NIL, y = NIL, z = NIL, apar = NIL, last = NIL, lastif = NIL; - LONGINT pos; + int32 pos; OPS_Name name; struct StatSeq__30 _s; _s.pos = &pos; @@ -1621,7 +1621,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) OPT_Struct typ = NIL; OPT_Object obj = NIL, first = NIL, last = NIL; OPT_Node x = NIL, lastdec = NIL; - INTEGER i; + int16 i; first = NIL; last = NIL; OPP_nofFwdPtr = 0; @@ -1774,7 +1774,7 @@ void OPP_Module (OPT_Node *prog, SET opt) { OPS_Name impName, aliasName; OPT_Node procdec = NIL, statseq = NIL; - LONGINT c; + int32 c; BOOLEAN done; OPS_Init(); OPP_LoopLevel = 0; diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index f197a5c6..2b29372f 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -11,29 +11,29 @@ typedef export OPS_Name OPS_name; export OPS_String OPS_str; -export INTEGER OPS_numtyp; -export LONGINT OPS_intval; +export int16 OPS_numtyp; +export int32 OPS_intval; export REAL OPS_realval; export LONGREAL OPS_lrlval; static CHAR OPS_ch; -export void OPS_Get (SHORTINT *sym); -static void OPS_Identifier (SHORTINT *sym); +export void OPS_Get (int8 *sym); +static void OPS_Identifier (int8 *sym); export void OPS_Init (void); static void OPS_Number (void); -static void OPS_Str (SHORTINT *sym); -static void OPS_err (INTEGER n); +static void OPS_Str (int8 *sym); +static void OPS_err (int16 n); -static void OPS_err (INTEGER n) +static void OPS_err (int16 n) { OPM_err(n); } -static void OPS_Str (SHORTINT *sym) +static void OPS_Str (int8 *sym) { - INTEGER i; + int16 i; CHAR och; i = 0; och = OPS_ch; @@ -59,15 +59,15 @@ static void OPS_Str (SHORTINT *sym) if (OPS_intval == 2) { *sym = 35; OPS_numtyp = 1; - OPS_intval = (SYSTEM_INT16)OPS_str[0]; + OPS_intval = (int16)OPS_str[0]; } else { *sym = 37; } } -static void OPS_Identifier (SHORTINT *sym) +static void OPS_Identifier (int8 *sym) { - INTEGER i; + int16 i; i = 0; do { OPS_name[i] = OPS_ch; @@ -86,10 +86,10 @@ static struct Number__6 { struct Number__6 *lnk; } *Number__6_s; -static INTEGER Ord__7 (CHAR ch, BOOLEAN hex); -static LONGREAL Ten__9 (INTEGER e); +static int16 Ord__7 (CHAR ch, BOOLEAN hex); +static LONGREAL Ten__9 (int16 e); -static LONGREAL Ten__9 (INTEGER e) +static LONGREAL Ten__9 (int16 e) { LONGREAL _o_result; LONGREAL x, p; @@ -108,14 +108,14 @@ static LONGREAL Ten__9 (INTEGER e) return _o_result; } -static INTEGER Ord__7 (CHAR ch, BOOLEAN hex) +static int16 Ord__7 (CHAR ch, BOOLEAN hex) { - INTEGER _o_result; + int16 _o_result; if (ch <= '9') { - _o_result = (SYSTEM_INT16)ch - 48; + _o_result = (int16)ch - 48; return _o_result; } else if (hex) { - _o_result = ((SYSTEM_INT16)ch - 65) + 10; + _o_result = ((int16)ch - 65) + 10; return _o_result; } else { OPS_err(2); @@ -127,7 +127,7 @@ static INTEGER Ord__7 (CHAR ch, BOOLEAN hex) static void OPS_Number (void) { - INTEGER i, m, n, d, e, maxHdig; + int16 i, m, n, d, e, maxHdig; CHAR dig[24]; LONGREAL f; CHAR expCh; @@ -309,9 +309,9 @@ static void Comment__2 (void) } } -void OPS_Get (SHORTINT *sym) +void OPS_Get (int8 *sym) { - SHORTINT s; + int8 s; struct Get__1 _s; _s.lnk = Get__1_s; Get__1_s = &_s; diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index 1e99f5e9..e40119f7 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -14,13 +14,13 @@ typedef import OPS_Name OPS_name; import OPS_String OPS_str; -import INTEGER OPS_numtyp; -import LONGINT OPS_intval; +import int16 OPS_numtyp; +import int32 OPS_intval; import REAL OPS_realval; import LONGREAL OPS_lrlval; -import void OPS_Get (SHORTINT *sym); +import void OPS_Get (int8 *sym); import void OPS_Init (void); import void *OPS__init(void); diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 5b495ad5..7fbad791 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -12,17 +12,17 @@ typedef typedef struct OPT_ConstDesc { OPT_ConstExt ext; - LONGINT intval, intval2; + int32 intval, intval2; SET setval; LONGREAL realval; } OPT_ConstDesc; typedef struct OPT_ExpCtxt { - LONGINT reffp; - INTEGER ref; - SHORTINT nofm; - SHORTINT locmno[64]; + int32 reffp; + int16 ref; + int8 nofm; + int8 locmno[64]; } OPT_ExpCtxt; typedef @@ -33,13 +33,13 @@ typedef typedef struct OPT_ImpCtxt { - LONGINT nextTag, reffp; - INTEGER nofr, minr, nofm; + int32 nextTag, reffp; + int16 nofr, minr, nofm; BOOLEAN self; OPT_Struct ref[255]; OPT_Object old[255]; - LONGINT pvfp[255]; - SHORTINT glbmno[64]; + int32 pvfp[255]; + int8 glbmno[64]; } OPT_ImpCtxt; typedef @@ -48,7 +48,7 @@ typedef typedef struct OPT_NodeDesc { OPT_Node left, right, link; - SHORTINT class, subcl; + int8 class, subcl; BOOLEAN readonly; OPT_Struct typ; OPT_Object obj; @@ -60,22 +60,22 @@ typedef OPT_Object left, right, link, scope; OPS_Name name; BOOLEAN leaf; - SHORTINT mode, mnolev, vis, history; + int8 mode, mnolev, vis, history; BOOLEAN used, fpdone; - LONGINT fprint; + int32 fprint; OPT_Struct typ; OPT_Const conval; - LONGINT adr, linkadr; - INTEGER x; + int32 adr, linkadr; + int16 x; } OPT_ObjDesc; typedef struct OPT_StrDesc { - SHORTINT form, comp, mno, extlev; - INTEGER ref, sysflag; - LONGINT n, size, align, txtpos; + int8 form, comp, mno, extlev; + int16 ref, sysflag; + int32 n, size, align, txtpos; BOOLEAN allocated, pbused, pvused, fpdone, idfpdone; - LONGINT idfp, pbfp, pvfp; + int32 idfp, pbfp, pvfp; OPT_Struct BaseTyp; OPT_Object link, strobj; } OPT_StrDesc; @@ -84,7 +84,7 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; -export SHORTINT OPT_nofGmod; +export int8 OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; export BOOLEAN OPT_SYSimported; @@ -92,7 +92,7 @@ static OPT_Struct OPT_IntTypes[20]; static OPT_Object OPT_universe, OPT_syslink; static OPT_ImpCtxt OPT_impCtxt; static OPT_ExpCtxt OPT_expCtxt; -static LONGINT OPT_nofhdfld; +static int32 OPT_nofhdfld; static BOOLEAN OPT_newsf, OPT_findpc, OPT_extsf, OPT_sfpresent, OPT_symExtended, OPT_symNew; export LONGINT *OPT_ConstDesc__typ; @@ -105,62 +105,62 @@ export LONGINT *OPT_ExpCtxt__typ; export void OPT_Close (void); export void OPT_CloseScope (void); static void OPT_DebugStruct (OPT_Struct btyp); -static void OPT_EnterBoolConst (OPS_Name name, LONGINT value); -static void OPT_EnterProc (OPS_Name name, INTEGER num); -static void OPT_EnterTyp (OPS_Name name, SHORTINT form, INTEGER size, OPT_Struct *res); +static void OPT_EnterBoolConst (OPS_Name name, int32 value); +static void OPT_EnterProc (OPS_Name name, int16 num); +static void OPT_EnterTyp (OPS_Name name, int8 form, int16 size, OPT_Struct *res); export void OPT_Export (BOOLEAN *ext, BOOLEAN *new); -export void OPT_FPrintErr (OPT_Object obj, INTEGER errcode); -static void OPT_FPrintName (LONGINT *fp, CHAR *name, LONGINT name__len); +export void OPT_FPrintErr (OPT_Object obj, int16 errcode); +static void OPT_FPrintName (int32 *fp, CHAR *name, LONGINT name__len); export void OPT_FPrintObj (OPT_Object obj); -static void OPT_FPrintSign (LONGINT *fp, OPT_Struct result, OPT_Object par); +static void OPT_FPrintSign (int32 *fp, OPT_Struct result, OPT_Object par); export void OPT_FPrintStr (OPT_Struct typ); export void OPT_Find (OPT_Object *res); export void OPT_FindField (OPS_Name name, OPT_Struct typ, OPT_Object *res); export void OPT_FindImport (OPT_Object mod, OPT_Object *res); export void OPT_IdFPrint (OPT_Struct typ); export void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); -static void OPT_InConstant (LONGINT f, OPT_Const conval); +static void OPT_InConstant (int32 f, OPT_Const conval); static OPT_Object OPT_InFld (void); -static void OPT_InMod (SHORTINT *mno); +static void OPT_InMod (int8 *mno); static void OPT_InName (CHAR *name, LONGINT name__len); -static OPT_Object OPT_InObj (SHORTINT mno); -static void OPT_InSign (SHORTINT mno, OPT_Struct *res, OPT_Object *par); +static OPT_Object OPT_InObj (int8 mno); +static void OPT_InSign (int8 mno, OPT_Struct *res, OPT_Object *par); static void OPT_InStruct (OPT_Struct *typ); -static OPT_Object OPT_InTProc (SHORTINT mno); -static OPT_Struct OPT_InTyp (LONGINT tag); +static OPT_Object OPT_InTProc (int8 mno); +static OPT_Struct OPT_InTyp (int32 tag); export void OPT_Init (OPS_Name name, SET opt); -static void OPT_InitStruct (OPT_Struct *typ, SHORTINT form); +static void OPT_InitStruct (OPT_Struct *typ, int8 form); export void OPT_Insert (OPS_Name name, OPT_Object *obj); export void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); -export OPT_Struct OPT_IntType (LONGINT size); +export OPT_Struct OPT_IntType (int32 size); export OPT_Const OPT_NewConst (void); export OPT_ConstExt OPT_NewExt (void); -export OPT_Node OPT_NewNode (SHORTINT class); +export OPT_Node OPT_NewNode (int8 class); export OPT_Object OPT_NewObj (void); -export OPT_Struct OPT_NewStr (SHORTINT form, SHORTINT comp); -export void OPT_OpenScope (SHORTINT level, OPT_Object owner); +export OPT_Struct OPT_NewStr (int8 form, int8 comp); +export void OPT_OpenScope (int8 level, OPT_Object owner); static void OPT_OutConstant (OPT_Object obj); -static void OPT_OutFlds (OPT_Object fld, LONGINT adr, BOOLEAN visible); -static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, LONGINT adr); -static void OPT_OutMod (INTEGER mno); +static void OPT_OutFlds (OPT_Object fld, int32 adr, BOOLEAN visible); +static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, int32 adr); +static void OPT_OutMod (int16 mno); static void OPT_OutName (CHAR *name, LONGINT name__len); static void OPT_OutObj (OPT_Object obj); static void OPT_OutSign (OPT_Struct result, OPT_Object par); static void OPT_OutStr (OPT_Struct typ); static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj); -export OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir); -static void OPT_err (INTEGER n); +export OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir); +static void OPT_err (int16 n); -static void OPT_err (INTEGER n) +static void OPT_err (int16 n) { OPM_err(n); } -OPT_Struct OPT_IntType (LONGINT size) +OPT_Struct OPT_IntType (int32 size) { OPT_Struct _o_result; - INTEGER i; + int16 i; i = 1; while ((OPT_IntTypes[__X(i, 20)]->size < size && OPT_IntTypes[__X(i + 1, 20)] != NIL)) { i += 1; @@ -169,10 +169,10 @@ OPT_Struct OPT_IntType (LONGINT size) return _o_result; } -OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir) +OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir) { OPT_Struct _o_result; - INTEGER i; + int16 i; __ASSERT(x->form == 4, 0); __ASSERT(dir == 1 || dir == -1, 0); __ASSERT(x->BaseTyp == OPT_undftyp, 0); @@ -203,7 +203,7 @@ OPT_Object OPT_NewObj (void) return _o_result; } -OPT_Struct OPT_NewStr (SHORTINT form, SHORTINT comp) +OPT_Struct OPT_NewStr (int8 form, int8 comp) { OPT_Struct _o_result; OPT_Struct typ = NIL; @@ -220,7 +220,7 @@ OPT_Struct OPT_NewStr (SHORTINT form, SHORTINT comp) return _o_result; } -OPT_Node OPT_NewNode (SHORTINT class) +OPT_Node OPT_NewNode (int8 class) { OPT_Node _o_result; OPT_Node node = NIL; @@ -239,7 +239,7 @@ OPT_ConstExt OPT_NewExt (void) return _o_result; } -void OPT_OpenScope (SHORTINT level, OPT_Object owner) +void OPT_OpenScope (int8 level, OPT_Object owner) { OPT_Object head = NIL; head = OPT_NewObj(); @@ -277,7 +277,7 @@ void OPT_Init (OPS_Name name, SET opt) void OPT_Close (void) { - INTEGER i; + int16 i; OPT_CloseScope(); i = 0; while (i < 64) { @@ -369,7 +369,7 @@ void OPT_Insert (OPS_Name name, OPT_Object *obj) { OPT_Object ob0 = NIL, ob1 = NIL; BOOLEAN left; - SHORTINT mnolev; + int8 mnolev; ob0 = OPT_topScope; ob1 = ob0->right; left = 0; @@ -407,14 +407,14 @@ void OPT_Insert (OPS_Name name, OPT_Object *obj) *obj = ob1; } -static void OPT_FPrintName (LONGINT *fp, CHAR *name, LONGINT name__len) +static void OPT_FPrintName (int32 *fp, CHAR *name, LONGINT name__len) { - INTEGER i; + int16 i; CHAR ch; i = 0; do { ch = name[__X(i, name__len)]; - OPM_FPrint(&*fp, (SYSTEM_INT16)ch); + OPM_FPrint(&*fp, (int16)ch); i += 1; } while (!(ch == 0x00)); } @@ -452,7 +452,7 @@ static void OPT_DebugStruct (OPT_Struct btyp) OPM_LogWLn(); } -static void OPT_FPrintSign (LONGINT *fp, OPT_Struct result, OPT_Object par) +static void OPT_FPrintSign (int32 *fp, OPT_Struct result, OPT_Object par) { OPT_IdFPrint(result); OPM_FPrint(&*fp, result->idfp); @@ -468,8 +468,8 @@ void OPT_IdFPrint (OPT_Struct typ) { OPT_Struct btyp = NIL; OPT_Object strobj = NIL; - LONGINT idfp; - INTEGER f, c; + int32 idfp; + int16 f, c; if (!typ->idfpdone) { typ->idfpdone = 1; idfp = 0; @@ -498,17 +498,17 @@ void OPT_IdFPrint (OPT_Struct typ) } static struct FPrintStr__12 { - LONGINT *pbfp, *pvfp; + int32 *pbfp, *pvfp; struct FPrintStr__12 *lnk; } *FPrintStr__12_s; -static void FPrintFlds__13 (OPT_Object fld, LONGINT adr, BOOLEAN visible); -static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr); +static void FPrintFlds__13 (OPT_Object fld, int32 adr, BOOLEAN visible); +static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, int32 adr); static void FPrintTProcs__17 (OPT_Object obj); -static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr) +static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, int32 adr) { - LONGINT i, j, n; + int32 i, j, n; OPT_Struct btyp = NIL; if (typ->comp == 4) { FPrintFlds__13(typ->link, adr, 0); @@ -538,7 +538,7 @@ static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr) } } -static void FPrintFlds__13 (OPT_Object fld, LONGINT adr, BOOLEAN visible) +static void FPrintFlds__13 (OPT_Object fld, int32 adr, BOOLEAN visible) { while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { @@ -573,10 +573,10 @@ static void FPrintTProcs__17 (OPT_Object obj) void OPT_FPrintStr (OPT_Struct typ) { - INTEGER f, c; + int16 f, c; OPT_Struct btyp = NIL; OPT_Object strobj = NIL, bstrobj = NIL; - LONGINT pbfp, pvfp; + int32 pbfp, pvfp; struct FPrintStr__12 _s; _s.pbfp = &pbfp; _s.pvfp = &pvfp; @@ -637,8 +637,8 @@ void OPT_FPrintStr (OPT_Struct typ) void OPT_FPrintObj (OPT_Object obj) { - LONGINT fprint; - INTEGER f, m; + int32 fprint; + int16 f, m; REAL rval; OPT_ConstExt ext = NIL; if (!obj->fpdone) { @@ -680,11 +680,11 @@ void OPT_FPrintObj (OPT_Object obj) } else if (obj->mode == 9) { OPT_FPrintSign(&fprint, obj->typ, obj->link); ext = obj->conval->ext; - m = (SYSTEM_INT16)(*ext)[0]; + m = (int16)(*ext)[0]; f = 1; OPM_FPrint(&fprint, m); while (f <= m) { - OPM_FPrint(&fprint, (SYSTEM_INT16)(*ext)[__X(f, 256)]); + OPM_FPrint(&fprint, (int16)(*ext)[__X(f, 256)]); f += 1; } } else if (obj->mode == 5) { @@ -695,9 +695,9 @@ void OPT_FPrintObj (OPT_Object obj) } } -void OPT_FPrintErr (OPT_Object obj, INTEGER errcode) +void OPT_FPrintErr (OPT_Object obj, int16 errcode) { - INTEGER i, j; + int16 i, j; CHAR ch; if (obj->mnolev != 0) { __COPY(OPT_GlbMod[__X(-obj->mnolev, 64)]->name, OPM_objname, 64); @@ -787,7 +787,7 @@ void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old) static void OPT_InName (CHAR *name, LONGINT name__len) { - INTEGER i; + int16 i; CHAR ch; i = 0; do { @@ -797,12 +797,12 @@ static void OPT_InName (CHAR *name, LONGINT name__len) } while (!(ch == 0x00)); } -static void OPT_InMod (SHORTINT *mno) +static void OPT_InMod (int8 *mno) { OPT_Object head = NIL; OPS_Name name; - LONGINT mn; - SHORTINT i; + int32 mn; + int8 i; mn = OPM_SymRInt(); if (mn == 0) { *mno = OPT_impCtxt.glbmno[0]; @@ -839,16 +839,16 @@ static void OPT_InMod (SHORTINT *mno) } } -static void OPT_InConstant (LONGINT f, OPT_Const conval) +static void OPT_InConstant (int32 f, OPT_Const conval) { CHAR ch; - INTEGER i; + int16 i; OPT_ConstExt ext = NIL; REAL rval; switch (f) { case 1: case 3: case 2: OPM_SymRCh(&ch); - conval->intval = (SYSTEM_INT16)ch; + conval->intval = (int16)ch; break; case 4: conval->intval = OPM_SymRInt(); @@ -888,10 +888,10 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval) } } -static void OPT_InSign (SHORTINT mno, OPT_Struct *res, OPT_Object *par) +static void OPT_InSign (int8 mno, OPT_Struct *res, OPT_Object *par) { OPT_Object last = NIL, new = NIL; - LONGINT tag; + int32 tag; OPT_InStruct(&*res); tag = OPM_SymRInt(); last = NIL; @@ -919,7 +919,7 @@ static void OPT_InSign (SHORTINT mno, OPT_Struct *res, OPT_Object *par) static OPT_Object OPT_InFld (void) { OPT_Object _o_result; - LONGINT tag; + int32 tag; OPT_Object obj = NIL; tag = OPT_impCtxt.nextTag; obj = OPT_NewObj(); @@ -948,10 +948,10 @@ static OPT_Object OPT_InFld (void) return _o_result; } -static OPT_Object OPT_InTProc (SHORTINT mno) +static OPT_Object OPT_InTProc (int8 mno) { OPT_Object _o_result; - LONGINT tag; + int32 tag; OPT_Object obj = NIL; tag = OPT_impCtxt.nextTag; obj = OPT_NewObj(); @@ -976,7 +976,7 @@ static OPT_Object OPT_InTProc (SHORTINT mno) return _o_result; } -static OPT_Struct OPT_InTyp (LONGINT tag) +static OPT_Struct OPT_InTyp (int32 tag) { OPT_Struct _o_result; if (tag == 4) { @@ -991,9 +991,9 @@ static OPT_Struct OPT_InTyp (LONGINT tag) static void OPT_InStruct (OPT_Struct *typ) { - SHORTINT mno; - INTEGER ref; - LONGINT tag; + int8 mno; + int16 ref; + int32 tag; OPS_Name name; OPT_Struct t = NIL; OPT_Object obj = NIL, last = NIL, fld = NIL, old = NIL, dummy = NIL; @@ -1049,7 +1049,7 @@ static void OPT_InStruct (OPT_Struct *typ) obj->vis = 0; tag = OPM_SymRInt(); if (tag == 35) { - (*typ)->sysflag = (SYSTEM_INT16)OPM_SymRInt(); + (*typ)->sysflag = (int16)OPM_SymRInt(); tag = OPM_SymRInt(); } switch (tag) { @@ -1171,14 +1171,14 @@ static void OPT_InStruct (OPT_Struct *typ) } } -static OPT_Object OPT_InObj (SHORTINT mno) +static OPT_Object OPT_InObj (int8 mno) { OPT_Object _o_result; - INTEGER i, s; + int16 i, s; CHAR ch; OPT_Object obj = NIL, old = NIL; OPT_Struct typ = NIL; - LONGINT tag; + int32 tag; OPT_ConstExt ext = NIL; tag = OPT_impCtxt.nextTag; if (tag == 19) { @@ -1211,7 +1211,7 @@ static OPT_Object OPT_InObj (SHORTINT mno) obj->mode = 9; ext = OPT_NewExt(); obj->conval->ext = ext; - s = (SYSTEM_INT16)OPM_SymRInt(); + s = (int16)OPM_SymRInt(); (*ext)[0] = (CHAR)s; i = 1; while (i <= s) { @@ -1277,7 +1277,7 @@ static OPT_Object OPT_InObj (SHORTINT mno) void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) { OPT_Object obj = NIL; - SHORTINT mno; + int8 mno; OPS_Name aliasName__copy; __DUPARR(aliasName, OPS_Name); if (__STRCMP(name, "SYSTEM") == 0) { @@ -1320,7 +1320,7 @@ void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) static void OPT_OutName (CHAR *name, LONGINT name__len) { - INTEGER i; + int16 i; CHAR ch; i = 0; do { @@ -1330,7 +1330,7 @@ static void OPT_OutName (CHAR *name, LONGINT name__len) } while (!(ch == 0x00)); } -static void OPT_OutMod (INTEGER mno) +static void OPT_OutMod (int16 mno) { if (OPT_expCtxt.locmno[__X(mno, 64)] < 0) { OPM_SymWInt(16); @@ -1342,9 +1342,9 @@ static void OPT_OutMod (INTEGER mno) } } -static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, LONGINT adr) +static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, int32 adr) { - LONGINT i, j, n; + int32 i, j, n; OPT_Struct btyp = NIL; if (typ->comp == 4) { OPT_OutFlds(typ->link, adr, 0); @@ -1374,7 +1374,7 @@ static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, LONGINT adr) } } -static void OPT_OutFlds (OPT_Object fld, LONGINT adr, BOOLEAN visible) +static void OPT_OutFlds (OPT_Object fld, int32 adr, BOOLEAN visible) { while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { @@ -1529,7 +1529,7 @@ static void OPT_OutStr (OPT_Struct typ) static void OPT_OutConstant (OPT_Object obj) { - INTEGER f; + int16 f; REAL rval; f = obj->typ->form; OPM_SymWInt(f); @@ -1564,7 +1564,7 @@ static void OPT_OutConstant (OPT_Object obj) static void OPT_OutObj (OPT_Object obj) { - INTEGER i, j; + int16 i, j; OPT_ConstExt ext = NIL; if (obj != NIL) { OPT_OutObj(obj->left); @@ -1631,7 +1631,7 @@ static void OPT_OutObj (OPT_Object obj) OPM_SymWInt(33); OPT_OutSign(obj->typ, obj->link); ext = obj->conval->ext; - j = (SYSTEM_INT16)(*ext)[0]; + j = (int16)(*ext)[0]; i = 1; OPM_SymWInt(j); while (i <= j) { @@ -1654,8 +1654,8 @@ static void OPT_OutObj (OPT_Object obj) void OPT_Export (BOOLEAN *ext, BOOLEAN *new) { - INTEGER i; - SHORTINT nofmod; + int16 i; + int8 nofmod; BOOLEAN done; OPT_symExtended = 0; OPT_symNew = 0; @@ -1697,7 +1697,7 @@ void OPT_Export (BOOLEAN *ext, BOOLEAN *new) } } -static void OPT_InitStruct (OPT_Struct *typ, SHORTINT form) +static void OPT_InitStruct (OPT_Struct *typ, int8 form) { *typ = OPT_NewStr(form, 1); (*typ)->ref = form; @@ -1711,7 +1711,7 @@ static void OPT_InitStruct (OPT_Struct *typ, SHORTINT form) (*typ)->idfpdone = 1; } -static void OPT_EnterBoolConst (OPS_Name name, LONGINT value) +static void OPT_EnterBoolConst (OPS_Name name, int32 value) { OPT_Object obj = NIL; OPS_Name name__copy; @@ -1723,7 +1723,7 @@ static void OPT_EnterBoolConst (OPS_Name name, LONGINT value) obj->conval->intval = value; } -static void OPT_EnterTyp (OPS_Name name, SHORTINT form, INTEGER size, OPT_Struct *res) +static void OPT_EnterTyp (OPS_Name name, int8 form, int16 size, OPT_Struct *res) { OPT_Object obj = NIL; OPT_Struct typ = NIL; @@ -1746,7 +1746,7 @@ static void OPT_EnterTyp (OPS_Name name, SHORTINT form, INTEGER size, OPT_Struct *res = typ; } -static void OPT_EnterProc (OPS_Name name, INTEGER num) +static void OPT_EnterProc (OPS_Name name, int16 num) { OPT_Object obj = NIL; OPS_Name name__copy; diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index 307b94e2..480267cc 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -15,7 +15,7 @@ typedef typedef struct OPT_ConstDesc { OPT_ConstExt ext; - LONGINT intval, intval2; + int32 intval, intval2; SET setval; LONGREAL realval; } OPT_ConstDesc; @@ -32,7 +32,7 @@ typedef typedef struct OPT_NodeDesc { OPT_Node left, right, link; - SHORTINT class, subcl; + int8 class, subcl; BOOLEAN readonly; OPT_Struct typ; OPT_Object obj; @@ -44,20 +44,20 @@ typedef OPT_Object left, right, link, scope; OPS_Name name; BOOLEAN leaf; - SHORTINT mode, mnolev, vis, history; + int8 mode, mnolev, vis, history; BOOLEAN used, fpdone; - LONGINT fprint; + int32 fprint; OPT_Struct typ; OPT_Const conval; - LONGINT adr, linkadr; - INTEGER x; + int32 adr, linkadr; + int16 x; } OPT_ObjDesc; typedef struct OPT_StrDesc { - SHORTINT form, comp, mno, extlev; - INTEGER ref, sysflag; - LONGINT n, size, align, txtpos; + int8 form, comp, mno, extlev; + int16 ref, sysflag; + int32 n, size, align, txtpos; BOOLEAN allocated, pbused, pvused; char _prvt0[16]; OPT_Struct BaseTyp; @@ -68,7 +68,7 @@ typedef import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; -import SHORTINT OPT_nofGmod; +import int8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; import BOOLEAN OPT_SYSimported; @@ -81,7 +81,7 @@ import LONGINT *OPT_NodeDesc__typ; import void OPT_Close (void); import void OPT_CloseScope (void); import void OPT_Export (BOOLEAN *ext, BOOLEAN *new); -import void OPT_FPrintErr (OPT_Object obj, INTEGER errcode); +import void OPT_FPrintErr (OPT_Object obj, int16 errcode); import void OPT_FPrintObj (OPT_Object obj); import void OPT_FPrintStr (OPT_Struct typ); import void OPT_Find (OPT_Object *res); @@ -92,14 +92,14 @@ import void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); import void OPT_Init (OPS_Name name, SET opt); import void OPT_Insert (OPS_Name name, OPT_Object *obj); import void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); -import OPT_Struct OPT_IntType (LONGINT size); +import OPT_Struct OPT_IntType (int32 size); import OPT_Const OPT_NewConst (void); import OPT_ConstExt OPT_NewExt (void); -import OPT_Node OPT_NewNode (SHORTINT class); +import OPT_Node OPT_NewNode (int8 class); import OPT_Object OPT_NewObj (void); -import OPT_Struct OPT_NewStr (SHORTINT form, SHORTINT comp); -import void OPT_OpenScope (SHORTINT level, OPT_Object owner); -import OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir); +import OPT_Struct OPT_NewStr (int8 form, int8 comp); +import void OPT_OpenScope (int8 level, OPT_Object owner); +import OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir); import void *OPT__init(void); diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index df62e985..5ef539df 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -7,15 +7,15 @@ typedef struct OPV_ExitInfo { - INTEGER level, label; + int16 level, label; } OPV_ExitInfo; static BOOLEAN OPV_assert, OPV_inxchk, OPV_mainprog, OPV_ansi; -static INTEGER OPV_stamp; -static LONGINT OPV_recno; +static int16 OPV_stamp; +static int32 OPV_recno; static OPV_ExitInfo OPV_exit; -static INTEGER OPV_nofExitLabels; +static int16 OPV_nofExitLabels; static BOOLEAN OPV_naturalAlignment; export LONGINT *OPV_ExitInfo__typ; @@ -23,38 +23,38 @@ export LONGINT *OPV_ExitInfo__typ; static void OPV_ActualPar (OPT_Node n, OPT_Object fp); export void OPV_AdrAndSize (OPT_Object topScope); static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc); -static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec); +static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int16 prec); static void OPV_DefineTDescs (OPT_Node n); -static void OPV_Entier (OPT_Node n, INTEGER prec); +static void OPV_Entier (OPT_Node n, int16 prec); static void OPV_GetTProcNum (OPT_Object obj); static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc); static BOOLEAN OPV_ImplicitReturn (OPT_Node n); -static void OPV_Index (OPT_Node n, OPT_Node d, INTEGER prec, INTEGER dim); +static void OPV_Index (OPT_Node n, OPT_Node d, int16 prec, int16 dim); export void OPV_Init (void); static void OPV_InitTDescs (OPT_Node n); -static void OPV_Len (OPT_Node n, LONGINT dim); +static void OPV_Len (OPT_Node n, int32 dim); export void OPV_Module (OPT_Node prog); -static LONGINT OPV_NaturalAlignment (LONGINT size, LONGINT max); +static int32 OPV_NaturalAlignment (int32 size, int32 max); static void OPV_NewArr (OPT_Node d, OPT_Node x); -static void OPV_ParIntLiteral (LONGINT n, LONGINT size); -static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, INTEGER comp); +static void OPV_ParIntLiteral (int32 n, int32 size); +static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp); static BOOLEAN OPV_SideEffects (OPT_Node n); -static void OPV_SizeCast (LONGINT from, LONGINT to); +static void OPV_SizeCast (int32 from, int32 to); static void OPV_Stamp (OPS_Name s); static OPT_Object OPV_SuperProc (OPT_Node n); static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported); static void OPV_TraverseRecord (OPT_Struct typ); export void OPV_TypSize (OPT_Struct typ); static void OPV_TypeOf (OPT_Node n); -static void OPV_design (OPT_Node n, INTEGER prec); -static void OPV_expr (OPT_Node n, INTEGER prec); +static void OPV_design (OPT_Node n, int16 prec); +static void OPV_expr (OPT_Node n, int16 prec); static void OPV_stat (OPT_Node n, OPT_Object outerProc); -static LONGINT OPV_NaturalAlignment (LONGINT size, LONGINT max) +static int32 OPV_NaturalAlignment (int32 size, int32 max) { - LONGINT _o_result; - LONGINT i; + int32 _o_result; + int32 i; if (size >= max) { _o_result = max; return _o_result; @@ -71,8 +71,8 @@ static LONGINT OPV_NaturalAlignment (LONGINT size, LONGINT max) void OPV_TypSize (OPT_Struct typ) { - INTEGER f, c; - LONGINT offset, size, base, fbase, off0; + int16 f, c; + int32 offset, size, base, fbase, off0; OPT_Object fld = NIL; OPT_Struct btyp = NIL; if (typ == OPT_undftyp) { @@ -118,7 +118,7 @@ void OPV_TypSize (OPT_Struct typ) } typ->size = offset; typ->align = base; - typ->sysflag = __MASK(typ->sysflag, -256) + (SYSTEM_INT16)__ASHL(offset - off0, 8); + typ->sysflag = __MASK(typ->sysflag, -256) + (int16)__ASHL(offset - off0, 8); } else if (c == 2) { OPV_TypSize(typ->BaseTyp); typ->size = typ->n * typ->BaseTyp->size; @@ -156,7 +156,7 @@ void OPV_Init (void) static void OPV_GetTProcNum (OPT_Object obj) { - LONGINT oldPos; + int32 oldPos; OPT_Struct typ = NIL; OPT_Object redef = NIL; oldPos = OPM_errpos; @@ -192,7 +192,7 @@ static void OPV_TraverseRecord (OPT_Struct typ) static void OPV_Stamp (OPS_Name s) { - INTEGER i, j, k; + int16 i, j, k; CHAR n[10]; OPV_stamp += 1; i = 0; @@ -222,7 +222,7 @@ static void OPV_Stamp (OPS_Name s) static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported) { - INTEGER mode; + int16 mode; OPT_Object scope = NIL; OPT_Struct typ = NIL; if (obj != NIL) { @@ -297,9 +297,9 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_sysptrtyp->strobj->linkadr = 2; } -static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, INTEGER comp) +static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp) { - INTEGER _o_result; + int16 _o_result; switch (class) { case 7: case 0: case 2: case 4: case 9: case 13: @@ -432,7 +432,7 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN __RETCHK; } -static void OPV_Len (OPT_Node n, LONGINT dim) +static void OPV_Len (OPT_Node n, int32 dim) { while ((n->class == 4 && n->typ->comp == 3)) { dim += 1; @@ -461,7 +461,7 @@ static BOOLEAN OPV_SideEffects (OPT_Node n) __RETCHK; } -static void OPV_Entier (OPT_Node n, INTEGER prec) +static void OPV_Entier (OPT_Node n, int16 prec) { if (__IN(n->typ->form, 0x60)) { OPM_WriteString((CHAR*)"__ENTIER(", 10); @@ -472,34 +472,18 @@ static void OPV_Entier (OPT_Node n, INTEGER prec) } } -static void OPV_SizeCast (LONGINT from, LONGINT to) +static void OPV_SizeCast (int32 from, int32 to) { if ((from != to && (from > 4 || to != 4))) { - switch (to) { - case 1: - OPM_WriteString((CHAR*)"(SYSTEM_INT8)", 14); - break; - case 2: - OPM_WriteString((CHAR*)"(SYSTEM_INT16)", 15); - break; - case 4: - OPM_WriteString((CHAR*)"(SYSTEM_INT32)", 15); - break; - case 8: - OPM_WriteString((CHAR*)"(SYSTEM_INT64)", 15); - break; - default: - OPM_LogWStr((CHAR*)"Unhandled case in OPC.SizeCast, to = ", 38); - OPM_LogWNum(to, 1); - OPM_LogWLn(); - break; - } + OPM_WriteString((CHAR*)"(int", 5); + OPM_WriteInt(__ASHL(to, 3)); + OPM_WriteString((CHAR*)")", 2); } } -static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec) +static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int16 prec) { - INTEGER from, to; + int16 from, to; from = n->typ->form; to = newtype->form; if (to == 7) { @@ -561,7 +545,7 @@ static void OPV_TypeOf (OPT_Node n) } } -static void OPV_Index (OPT_Node n, OPT_Node d, INTEGER prec, INTEGER dim) +static void OPV_Index (OPT_Node n, OPT_Node d, int16 prec, int16 dim) { if (!OPV_inxchk || (n->right->class == 7 && (n->right->conval->intval == 0 || n->left->typ->comp != 3))) { OPV_expr(n->right, prec); @@ -578,18 +562,18 @@ static void OPV_Index (OPT_Node n, OPT_Node d, INTEGER prec, INTEGER dim) } } -static void OPV_design (OPT_Node n, INTEGER prec) +static void OPV_design (OPT_Node n, int16 prec) { OPT_Object obj = NIL; OPT_Struct typ = NIL; - INTEGER class, designPrec, comp; + int16 class, designPrec, comp; OPT_Node d = NIL, x = NIL; - INTEGER dims, i, _for__28; + int16 dims, i, _for__28; comp = n->typ->comp; obj = n->obj; class = n->class; designPrec = OPV_Precedence(class, n->subcl, n->typ->form, comp); - if ((((((class == 0 && obj->mnolev > 0)) && (SYSTEM_INT16)obj->mnolev != OPM_level)) && prec == 10)) { + if ((((((class == 0 && obj->mnolev > 0)) && (int16)obj->mnolev != OPM_level)) && prec == 10)) { designPrec = 9; } if (prec > designPrec) { @@ -688,7 +672,7 @@ static void OPV_design (OPT_Node n, INTEGER prec) if (__IN(3, OPM_opt)) { if (typ->comp == 4) { OPM_WriteString((CHAR*)"__GUARDR(", 10); - if ((SYSTEM_INT16)obj->mnolev != OPM_level) { + if ((int16)obj->mnolev != OPM_level) { OPM_WriteStringVar((void*)obj->scope->name, 256); OPM_WriteString((CHAR*)"__curr->", 9); OPC_Ident(obj); @@ -757,7 +741,7 @@ static void OPV_design (OPT_Node n, INTEGER prec) } } -static void OPV_ParIntLiteral (LONGINT n, LONGINT size) +static void OPV_ParIntLiteral (int32 n, int32 size) { if (OPV_ansi) { OPM_WriteInt(n); @@ -769,7 +753,7 @@ static void OPV_ParIntLiteral (LONGINT n, LONGINT size) static void OPV_ActualPar (OPT_Node n, OPT_Object fp) { OPT_Struct typ = NIL, aptyp = NIL; - INTEGER comp, form, mode, prec, dim; + int16 comp, form, mode, prec, dim; OPM_Write('('); while (n != NIL) { typ = fp->typ; @@ -868,9 +852,9 @@ static OPT_Object OPV_SuperProc (OPT_Node n) return _o_result; } -static void OPV_expr (OPT_Node n, INTEGER prec) +static void OPV_expr (OPT_Node n, int16 prec) { - INTEGER class, subclass, form, exprPrec; + int16 class, subclass, form, exprPrec; OPT_Struct typ = NIL; OPT_Node l = NIL, r = NIL; OPT_Object proc = NIL; @@ -1186,7 +1170,7 @@ static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) OPT_Node if_ = NIL; OPT_Object obj = NIL; OPT_Struct typ = NIL; - LONGINT adr; + int32 adr; if_ = n->left; while (if_ != NIL) { OPM_WriteString((CHAR*)"if ", 4); @@ -1236,8 +1220,8 @@ static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc) { OPT_Node switchCase = NIL, label = NIL; - LONGINT low, high; - INTEGER form, i; + int32 low, high; + int16 form, i; OPM_WriteString((CHAR*)"switch ", 8); OPV_expr(n->left, 12); OPM_Write(' '); @@ -1304,7 +1288,7 @@ static BOOLEAN OPV_ImplicitReturn (OPT_Node n) static void OPV_NewArr (OPT_Node d, OPT_Node x) { OPT_Struct typ = NIL, base = NIL; - INTEGER nofdim, nofdyn; + int16 nofdim, nofdyn; typ = d->typ->BaseTyp; base = typ; nofdim = 0; diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 033e03cf..c247eb06 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -8,90 +8,90 @@ typedef Platform_ArgPtr (*Platform_ArgVec)[1024]; typedef - LONGINT (*Platform_ArgVecPtr)[1]; + int32 (*Platform_ArgVecPtr)[1]; typedef CHAR (*Platform_EnvPtr)[1024]; typedef struct Platform_FileIdentity { - LONGINT volume, index, mtime; + int32 volume, index, mtime; } Platform_FileIdentity; typedef - void (*Platform_HaltProcedure)(LONGINT); + void (*Platform_HaltProcedure)(int32); typedef - void (*Platform_SignalHandler)(INTEGER); + void (*Platform_SignalHandler)(int16); export BOOLEAN Platform_LittleEndian; -export LONGINT Platform_MainStackFrame, Platform_HaltCode; -export INTEGER Platform_PID; +export int32 Platform_MainStackFrame, Platform_HaltCode; +export int16 Platform_PID; export CHAR Platform_CWD[256]; -export INTEGER Platform_ArgCount; -export LONGINT Platform_ArgVector; +export int16 Platform_ArgCount; +export int32 Platform_ArgVector; static Platform_HaltProcedure Platform_HaltHandler; -static LONGINT Platform_TimeStart; -export INTEGER Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; +static int32 Platform_TimeStart; +export int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; export CHAR Platform_nl[3]; export LONGINT *Platform_FileIdentity__typ; -export BOOLEAN Platform_Absent (INTEGER e); -export INTEGER Platform_ArgPos (CHAR *s, LONGINT s__len); -export void Platform_AssertFail (LONGINT code); -export INTEGER Platform_Chdir (CHAR *n, LONGINT n__len); -export INTEGER Platform_Close (LONGINT h); -export BOOLEAN Platform_ConnectionFailed (INTEGER e); -export void Platform_Delay (LONGINT ms); -export BOOLEAN Platform_DifferentFilesystems (INTEGER e); -static void Platform_DisplayHaltCode (LONGINT code); -export INTEGER Platform_Error (void); -export void Platform_Exit (INTEGER code); -export void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len); -export void Platform_GetClock (LONGINT *t, LONGINT *d); +export BOOLEAN Platform_Absent (int16 e); +export int16 Platform_ArgPos (CHAR *s, LONGINT s__len); +export void Platform_AssertFail (int32 code); +export int16 Platform_Chdir (CHAR *n, LONGINT n__len); +export int16 Platform_Close (int32 h); +export BOOLEAN Platform_ConnectionFailed (int16 e); +export void Platform_Delay (int32 ms); +export BOOLEAN Platform_DifferentFilesystems (int16 e); +static void Platform_DisplayHaltCode (int32 code); +export int16 Platform_Error (void); +export void Platform_Exit (int16 code); +export void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len); +export void Platform_GetClock (int32 *t, int32 *d); export void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); -export void Platform_GetIntArg (INTEGER n, LONGINT *val); -export void Platform_GetTimeOfDay (LONGINT *sec, LONGINT *usec); -export void Platform_Halt (LONGINT code); -export INTEGER Platform_Identify (LONGINT h, Platform_FileIdentity *identity, LONGINT *identity__typ); -export INTEGER Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); -export BOOLEAN Platform_Inaccessible (INTEGER e); -export void Platform_Init (INTEGER argc, LONGINT argvadr); -export void Platform_MTimeAsClock (Platform_FileIdentity i, LONGINT *t, LONGINT *d); -export INTEGER Platform_New (CHAR *n, LONGINT n__len, LONGINT *h); -export BOOLEAN Platform_NoSuchDirectory (INTEGER e); -export LONGINT Platform_OSAllocate (LONGINT size); -export void Platform_OSFree (LONGINT address); -export INTEGER Platform_OldRO (CHAR *n, LONGINT n__len, LONGINT *h); -export INTEGER Platform_OldRW (CHAR *n, LONGINT n__len, LONGINT *h); -export INTEGER Platform_Read (LONGINT h, LONGINT p, LONGINT l, LONGINT *n); -export INTEGER Platform_ReadBuf (LONGINT h, SYSTEM_BYTE *b, LONGINT b__len, LONGINT *n); -export INTEGER Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); +export void Platform_GetIntArg (int16 n, int32 *val); +export void Platform_GetTimeOfDay (int32 *sec, int32 *usec); +export void Platform_Halt (int32 code); +export int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, LONGINT *identity__typ); +export int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); +export BOOLEAN Platform_Inaccessible (int16 e); +export void Platform_Init (int16 argc, int32 argvadr); +export void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); +export int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); +export BOOLEAN Platform_NoSuchDirectory (int16 e); +export int32 Platform_OSAllocate (int32 size); +export void Platform_OSFree (int32 address); +export int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); +export int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); +export int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n); +export int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n); +export int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); export BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); export BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); -export INTEGER Platform_Seek (LONGINT h, LONGINT offset, INTEGER whence); +export int16 Platform_Seek (int32 h, int32 offset, int16 whence); export void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); export void Platform_SetHalt (Platform_HaltProcedure p); export void Platform_SetInterruptHandler (Platform_SignalHandler handler); export void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Platform_FileIdentity source); export void Platform_SetQuitHandler (Platform_SignalHandler handler); -export INTEGER Platform_Size (LONGINT h, LONGINT *l); -export INTEGER Platform_Sync (LONGINT h); -export INTEGER Platform_System (CHAR *cmd, LONGINT cmd__len); +export int16 Platform_Size (int32 h, int32 *l); +export int16 Platform_Sync (int32 h); +export int16 Platform_System (CHAR *cmd, LONGINT cmd__len); static void Platform_TestLittleEndian (void); -export LONGINT Platform_Time (void); -export BOOLEAN Platform_TimedOut (INTEGER e); -export BOOLEAN Platform_TooManyFiles (INTEGER e); -export INTEGER Platform_Truncate (LONGINT h, LONGINT l); -export INTEGER Platform_Unlink (CHAR *n, LONGINT n__len); -export INTEGER Platform_Write (LONGINT h, LONGINT p, LONGINT l); -static void Platform_YMDHMStoClock (LONGINT ye, LONGINT mo, LONGINT da, LONGINT ho, LONGINT mi, LONGINT se, LONGINT *t, LONGINT *d); +export int32 Platform_Time (void); +export BOOLEAN Platform_TimedOut (int16 e); +export BOOLEAN Platform_TooManyFiles (int16 e); +export int16 Platform_Truncate (int32 h, int32 l); +export int16 Platform_Unlink (CHAR *n, LONGINT n__len); +export int16 Platform_Write (int32 h, int32 p, int32 l); +static void Platform_YMDHMStoClock (int32 ye, int32 mo, int32 da, int32 ho, int32 mi, int32 se, int32 *t, int32 *d); static void Platform_errch (CHAR c); -static void Platform_errint (LONGINT l); +static void Platform_errint (int32 l); static void Platform_errln (void); -static void Platform_errposint (LONGINT l); +static void Platform_errposint (int32 l); export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); #include @@ -163,68 +163,68 @@ extern void Heap_InitHeap(); #define Platform_unlink(n, n__len) unlink((char*)n) #define Platform_writefile(fd, p, l) write(fd, (void*)(SYSTEM_ADRINT)(p), l) -BOOLEAN Platform_TooManyFiles (INTEGER e) +BOOLEAN Platform_TooManyFiles (int16 e) { BOOLEAN _o_result; _o_result = e == Platform_EMFILE() || e == Platform_ENFILE(); return _o_result; } -BOOLEAN Platform_NoSuchDirectory (INTEGER e) +BOOLEAN Platform_NoSuchDirectory (int16 e) { BOOLEAN _o_result; _o_result = e == Platform_ENOENT(); return _o_result; } -BOOLEAN Platform_DifferentFilesystems (INTEGER e) +BOOLEAN Platform_DifferentFilesystems (int16 e) { BOOLEAN _o_result; _o_result = e == Platform_EXDEV(); return _o_result; } -BOOLEAN Platform_Inaccessible (INTEGER e) +BOOLEAN Platform_Inaccessible (int16 e) { BOOLEAN _o_result; _o_result = (e == Platform_EACCES() || e == Platform_EROFS()) || e == Platform_EAGAIN(); return _o_result; } -BOOLEAN Platform_Absent (INTEGER e) +BOOLEAN Platform_Absent (int16 e) { BOOLEAN _o_result; _o_result = e == Platform_ENOENT(); return _o_result; } -BOOLEAN Platform_TimedOut (INTEGER e) +BOOLEAN Platform_TimedOut (int16 e) { BOOLEAN _o_result; _o_result = e == Platform_ETIMEDOUT(); return _o_result; } -BOOLEAN Platform_ConnectionFailed (INTEGER e) +BOOLEAN Platform_ConnectionFailed (int16 e) { BOOLEAN _o_result; _o_result = ((e == Platform_ECONNREFUSED() || e == Platform_ECONNABORTED()) || e == Platform_ENETUNREACH()) || e == Platform_EHOSTUNREACH(); return _o_result; } -LONGINT Platform_OSAllocate (LONGINT size) +int32 Platform_OSAllocate (int32 size) { - LONGINT _o_result; + int32 _o_result; _o_result = Platform_allocate(size); return _o_result; } -void Platform_OSFree (LONGINT address) +void Platform_OSFree (int32 address) { Platform_free(address); } -void Platform_Init (INTEGER argc, LONGINT argvadr) +void Platform_Init (int16 argc, int32 argvadr) { Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; @@ -258,7 +258,7 @@ void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len) __DEL(var); } -void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len) +void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { @@ -267,10 +267,10 @@ void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len) } } -void Platform_GetIntArg (INTEGER n, LONGINT *val) +void Platform_GetIntArg (int16 n, int32 *val) { CHAR s[64]; - LONGINT k, d, i; + int32 k, d, i; s[0] = 0x00; Platform_GetArg(n, (void*)s, 64); i = 0; @@ -278,11 +278,11 @@ void Platform_GetIntArg (INTEGER n, LONGINT *val) i = 1; } k = 0; - d = (SYSTEM_INT16)s[__X(i, 64)] - 48; + d = (int16)s[__X(i, 64)] - 48; while ((d >= 0 && d <= 9)) { k = k * 10 + d; i += 1; - d = (SYSTEM_INT16)s[__X(i, 64)] - 48; + d = (int16)s[__X(i, 64)] - 48; } if (s[0] == '-') { k = -k; @@ -293,10 +293,10 @@ void Platform_GetIntArg (INTEGER n, LONGINT *val) } } -INTEGER Platform_ArgPos (CHAR *s, LONGINT s__len) +int16 Platform_ArgPos (CHAR *s, LONGINT s__len) { - INTEGER _o_result; - INTEGER i; + int16 _o_result; + int16 i; CHAR arg[256]; __DUP(s, s__len, CHAR); i = 0; @@ -325,64 +325,64 @@ void Platform_SetBadInstructionHandler (Platform_SignalHandler handler) Platform_sethandler(4, handler); } -static void Platform_YMDHMStoClock (LONGINT ye, LONGINT mo, LONGINT da, LONGINT ho, LONGINT mi, LONGINT se, LONGINT *t, LONGINT *d) +static void Platform_YMDHMStoClock (int32 ye, int32 mo, int32 da, int32 ho, int32 mi, int32 se, int32 *t, int32 *d) { *d = (__ASHL((int)__MOD(ye, 100), 9) + __ASHL(mo + 1, 5)) + da; *t = (__ASHL(ho, 12) + __ASHL(mi, 6)) + se; } -void Platform_GetClock (LONGINT *t, LONGINT *d) +void Platform_GetClock (int32 *t, int32 *d) { Platform_gettimeval(); Platform_sectotm(Platform_tvsec()); Platform_YMDHMStoClock(Platform_tmyear(), Platform_tmmon(), Platform_tmmday(), Platform_tmhour(), Platform_tmmin(), Platform_tmsec(), &*t, &*d); } -void Platform_GetTimeOfDay (LONGINT *sec, LONGINT *usec) +void Platform_GetTimeOfDay (int32 *sec, int32 *usec) { Platform_gettimeval(); *sec = Platform_tvsec(); *usec = Platform_tvusec(); } -LONGINT Platform_Time (void) +int32 Platform_Time (void) { - LONGINT _o_result; - LONGINT ms; + int32 _o_result; + int32 ms; Platform_gettimeval(); ms = (int)__DIVF(Platform_tvusec(), 1000) + Platform_tvsec() * 1000; _o_result = (int)__MOD(ms - Platform_TimeStart, 2147483647); return _o_result; } -void Platform_Delay (LONGINT ms) +void Platform_Delay (int32 ms) { - LONGINT s, ns; + int32 s, ns; s = __DIV(ms, 1000); ns = (int)__MOD(ms, 1000) * 1000000; Platform_nanosleep(s, ns); } -INTEGER Platform_System (CHAR *cmd, LONGINT cmd__len) +int16 Platform_System (CHAR *cmd, LONGINT cmd__len) { - INTEGER _o_result; + int16 _o_result; __DUP(cmd, cmd__len, CHAR); _o_result = Platform_system(cmd, cmd__len); __DEL(cmd); return _o_result; } -INTEGER Platform_Error (void) +int16 Platform_Error (void) { - INTEGER _o_result; + int16 _o_result; _o_result = Platform_err(); return _o_result; } -INTEGER Platform_OldRO (CHAR *n, LONGINT n__len, LONGINT *h) +int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h) { - INTEGER _o_result; - INTEGER fd; + int16 _o_result; + int16 fd; fd = Platform_openro(n, n__len); if (fd < 0) { _o_result = Platform_err(); @@ -395,10 +395,10 @@ INTEGER Platform_OldRO (CHAR *n, LONGINT n__len, LONGINT *h) __RETCHK; } -INTEGER Platform_OldRW (CHAR *n, LONGINT n__len, LONGINT *h) +int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h) { - INTEGER _o_result; - INTEGER fd; + int16 _o_result; + int16 fd; fd = Platform_openrw(n, n__len); if (fd < 0) { _o_result = Platform_err(); @@ -411,10 +411,10 @@ INTEGER Platform_OldRW (CHAR *n, LONGINT n__len, LONGINT *h) __RETCHK; } -INTEGER Platform_New (CHAR *n, LONGINT n__len, LONGINT *h) +int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h) { - INTEGER _o_result; - INTEGER fd; + int16 _o_result; + int16 fd; fd = Platform_opennew(n, n__len); if (fd < 0) { _o_result = Platform_err(); @@ -427,9 +427,9 @@ INTEGER Platform_New (CHAR *n, LONGINT n__len, LONGINT *h) __RETCHK; } -INTEGER Platform_Close (LONGINT h) +int16 Platform_Close (int32 h) { - INTEGER _o_result; + int16 _o_result; if (Platform_closefile(h) < 0) { _o_result = Platform_err(); return _o_result; @@ -440,9 +440,9 @@ INTEGER Platform_Close (LONGINT h) __RETCHK; } -INTEGER Platform_Identify (LONGINT h, Platform_FileIdentity *identity, LONGINT *identity__typ) +int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, LONGINT *identity__typ) { - INTEGER _o_result; + int16 _o_result; Platform_structstats(); if (Platform_fstat(h) < 0) { _o_result = Platform_err(); @@ -455,9 +455,9 @@ INTEGER Platform_Identify (LONGINT h, Platform_FileIdentity *identity, LONGINT * return _o_result; } -INTEGER Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ) +int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ) { - INTEGER _o_result; + int16 _o_result; __DUP(n, n__len, CHAR); Platform_structstats(); if (Platform_stat(n, n__len) < 0) { @@ -492,15 +492,15 @@ void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Pla (*target).mtime = source.mtime; } -void Platform_MTimeAsClock (Platform_FileIdentity i, LONGINT *t, LONGINT *d) +void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d) { Platform_sectotm(i.mtime); Platform_YMDHMStoClock(Platform_tmyear(), Platform_tmmon(), Platform_tmmday(), Platform_tmhour(), Platform_tmmin(), Platform_tmsec(), &*t, &*d); } -INTEGER Platform_Size (LONGINT h, LONGINT *l) +int16 Platform_Size (int32 h, int32 *l) { - INTEGER _o_result; + int16 _o_result; Platform_structstats(); if (Platform_fstat(h) < 0) { _o_result = Platform_err(); @@ -511,9 +511,9 @@ INTEGER Platform_Size (LONGINT h, LONGINT *l) return _o_result; } -INTEGER Platform_Read (LONGINT h, LONGINT p, LONGINT l, LONGINT *n) +int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n) { - INTEGER _o_result; + int16 _o_result; *n = Platform_readfile(h, p, l); if (*n < 0) { *n = 0; @@ -526,9 +526,9 @@ INTEGER Platform_Read (LONGINT h, LONGINT p, LONGINT l, LONGINT *n) __RETCHK; } -INTEGER Platform_ReadBuf (LONGINT h, SYSTEM_BYTE *b, LONGINT b__len, LONGINT *n) +int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n) { - INTEGER _o_result; + int16 _o_result; *n = Platform_readfile(h, (SYSTEM_ADRINT)b, b__len); if (*n < 0) { *n = 0; @@ -541,10 +541,10 @@ INTEGER Platform_ReadBuf (LONGINT h, SYSTEM_BYTE *b, LONGINT b__len, LONGINT *n) __RETCHK; } -INTEGER Platform_Write (LONGINT h, LONGINT p, LONGINT l) +int16 Platform_Write (int32 h, int32 p, int32 l) { - INTEGER _o_result; - LONGINT written; + int16 _o_result; + int32 written; written = Platform_writefile(h, p, l); if (written < 0) { _o_result = Platform_err(); @@ -556,9 +556,9 @@ INTEGER Platform_Write (LONGINT h, LONGINT p, LONGINT l) __RETCHK; } -INTEGER Platform_Sync (LONGINT h) +int16 Platform_Sync (int32 h) { - INTEGER _o_result; + int16 _o_result; if (Platform_fsync(h) < 0) { _o_result = Platform_err(); return _o_result; @@ -569,9 +569,9 @@ INTEGER Platform_Sync (LONGINT h) __RETCHK; } -INTEGER Platform_Seek (LONGINT h, LONGINT offset, INTEGER whence) +int16 Platform_Seek (int32 h, int32 offset, int16 whence) { - INTEGER _o_result; + int16 _o_result; if (Platform_lseek(h, offset, whence) < 0) { _o_result = Platform_err(); return _o_result; @@ -582,9 +582,9 @@ INTEGER Platform_Seek (LONGINT h, LONGINT offset, INTEGER whence) __RETCHK; } -INTEGER Platform_Truncate (LONGINT h, LONGINT l) +int16 Platform_Truncate (int32 h, int32 l) { - INTEGER _o_result; + int16 _o_result; if (Platform_ftruncate(h, l) < 0) { _o_result = Platform_err(); return _o_result; @@ -595,9 +595,9 @@ INTEGER Platform_Truncate (LONGINT h, LONGINT l) __RETCHK; } -INTEGER Platform_Unlink (CHAR *n, LONGINT n__len) +int16 Platform_Unlink (CHAR *n, LONGINT n__len) { - INTEGER _o_result; + int16 _o_result; if (Platform_unlink(n, n__len) < 0) { _o_result = Platform_err(); return _o_result; @@ -608,10 +608,10 @@ INTEGER Platform_Unlink (CHAR *n, LONGINT n__len) __RETCHK; } -INTEGER Platform_Chdir (CHAR *n, LONGINT n__len) +int16 Platform_Chdir (CHAR *n, LONGINT n__len) { - INTEGER _o_result; - INTEGER r; + int16 _o_result; + int16 r; r = Platform_chdir(n, n__len); Platform_getcwd((void*)Platform_CWD, 256); if (r < 0) { @@ -624,9 +624,9 @@ INTEGER Platform_Chdir (CHAR *n, LONGINT n__len) __RETCHK; } -INTEGER Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) +int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) { - INTEGER _o_result; + int16 _o_result; if (Platform_rename(o, o__len, n, n__len) < 0) { _o_result = Platform_err(); return _o_result; @@ -637,7 +637,7 @@ INTEGER Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) __RETCHK; } -void Platform_Exit (INTEGER code) +void Platform_Exit (int16 code) { Platform_exit(code); } @@ -653,7 +653,7 @@ static void Platform_errln (void) Platform_errch(0x0a); } -static void Platform_errposint (LONGINT l) +static void Platform_errposint (int32 l) { if (l > 10) { Platform_errposint(__DIV(l, 10)); @@ -661,7 +661,7 @@ static void Platform_errposint (LONGINT l) Platform_errch((CHAR)(48 + (int)__MOD(l, 10))); } -static void Platform_errint (LONGINT l) +static void Platform_errint (int32 l) { if (l < 0) { Platform_errch('-'); @@ -670,7 +670,7 @@ static void Platform_errint (LONGINT l) Platform_errposint(l); } -static void Platform_DisplayHaltCode (LONGINT code) +static void Platform_DisplayHaltCode (int32 code) { switch (code) { case -1: @@ -726,9 +726,9 @@ static void Platform_DisplayHaltCode (LONGINT code) } } -void Platform_Halt (LONGINT code) +void Platform_Halt (int32 code) { - INTEGER e; + int16 e; Platform_HaltCode = code; if (Platform_HaltHandler != NIL) { (*Platform_HaltHandler)(code); @@ -740,12 +740,12 @@ void Platform_Halt (LONGINT code) Platform_DisplayHaltCode(code); } Platform_errln(); - Platform_exit(__VAL(INTEGER, code)); + Platform_exit(__VAL(int16, code)); } -void Platform_AssertFail (LONGINT code) +void Platform_AssertFail (int32 code) { - INTEGER e; + int16 e; Platform_errstring((CHAR*)"Assertion failure.", 19); if (code != 0) { Platform_errstring((CHAR*)" ASSERT code ", 14); @@ -753,7 +753,7 @@ void Platform_AssertFail (LONGINT code) Platform_errstring((CHAR*)".", 2); } Platform_errln(); - Platform_exit(__VAL(INTEGER, code)); + Platform_exit(__VAL(int16, code)); } void Platform_SetHalt (Platform_HaltProcedure p) @@ -763,7 +763,7 @@ void Platform_SetHalt (Platform_HaltProcedure p) static void Platform_TestLittleEndian (void) { - INTEGER i; + int16 i; i = 1; __GET((SYSTEM_ADRINT)&i, Platform_LittleEndian, BOOLEAN); } diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index 34d088bf..129004fd 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -7,74 +7,74 @@ typedef struct Platform_FileIdentity { - LONGINT volume, index, mtime; + int32 volume, index, mtime; } Platform_FileIdentity; typedef - void (*Platform_HaltProcedure)(LONGINT); + void (*Platform_HaltProcedure)(int32); typedef - void (*Platform_SignalHandler)(INTEGER); + void (*Platform_SignalHandler)(int16); import BOOLEAN Platform_LittleEndian; -import LONGINT Platform_MainStackFrame, Platform_HaltCode; -import INTEGER Platform_PID; +import int32 Platform_MainStackFrame, Platform_HaltCode; +import int16 Platform_PID; import CHAR Platform_CWD[256]; -import INTEGER Platform_ArgCount; -import LONGINT Platform_ArgVector; -import INTEGER Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; +import int16 Platform_ArgCount; +import int32 Platform_ArgVector; +import int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; import CHAR Platform_nl[3]; import LONGINT *Platform_FileIdentity__typ; -import BOOLEAN Platform_Absent (INTEGER e); -import INTEGER Platform_ArgPos (CHAR *s, LONGINT s__len); -import void Platform_AssertFail (LONGINT code); -import INTEGER Platform_Chdir (CHAR *n, LONGINT n__len); -import INTEGER Platform_Close (LONGINT h); -import BOOLEAN Platform_ConnectionFailed (INTEGER e); -import void Platform_Delay (LONGINT ms); -import BOOLEAN Platform_DifferentFilesystems (INTEGER e); -import INTEGER Platform_Error (void); -import void Platform_Exit (INTEGER code); -import void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len); -import void Platform_GetClock (LONGINT *t, LONGINT *d); +import BOOLEAN Platform_Absent (int16 e); +import int16 Platform_ArgPos (CHAR *s, LONGINT s__len); +import void Platform_AssertFail (int32 code); +import int16 Platform_Chdir (CHAR *n, LONGINT n__len); +import int16 Platform_Close (int32 h); +import BOOLEAN Platform_ConnectionFailed (int16 e); +import void Platform_Delay (int32 ms); +import BOOLEAN Platform_DifferentFilesystems (int16 e); +import int16 Platform_Error (void); +import void Platform_Exit (int16 code); +import void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len); +import void Platform_GetClock (int32 *t, int32 *d); import void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); -import void Platform_GetIntArg (INTEGER n, LONGINT *val); -import void Platform_GetTimeOfDay (LONGINT *sec, LONGINT *usec); -import void Platform_Halt (LONGINT code); -import INTEGER Platform_Identify (LONGINT h, Platform_FileIdentity *identity, LONGINT *identity__typ); -import INTEGER Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); -import BOOLEAN Platform_Inaccessible (INTEGER e); -import void Platform_Init (INTEGER argc, LONGINT argvadr); -import void Platform_MTimeAsClock (Platform_FileIdentity i, LONGINT *t, LONGINT *d); -import INTEGER Platform_New (CHAR *n, LONGINT n__len, LONGINT *h); -import BOOLEAN Platform_NoSuchDirectory (INTEGER e); -import LONGINT Platform_OSAllocate (LONGINT size); -import void Platform_OSFree (LONGINT address); -import INTEGER Platform_OldRO (CHAR *n, LONGINT n__len, LONGINT *h); -import INTEGER Platform_OldRW (CHAR *n, LONGINT n__len, LONGINT *h); -import INTEGER Platform_Read (LONGINT h, LONGINT p, LONGINT l, LONGINT *n); -import INTEGER Platform_ReadBuf (LONGINT h, SYSTEM_BYTE *b, LONGINT b__len, LONGINT *n); -import INTEGER Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); +import void Platform_GetIntArg (int16 n, int32 *val); +import void Platform_GetTimeOfDay (int32 *sec, int32 *usec); +import void Platform_Halt (int32 code); +import int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, LONGINT *identity__typ); +import int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); +import BOOLEAN Platform_Inaccessible (int16 e); +import void Platform_Init (int16 argc, int32 argvadr); +import void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); +import int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); +import BOOLEAN Platform_NoSuchDirectory (int16 e); +import int32 Platform_OSAllocate (int32 size); +import void Platform_OSFree (int32 address); +import int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); +import int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); +import int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n); +import int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n); +import int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); import BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); import BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); -import INTEGER Platform_Seek (LONGINT h, LONGINT offset, INTEGER whence); +import int16 Platform_Seek (int32 h, int32 offset, int16 whence); import void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); import void Platform_SetHalt (Platform_HaltProcedure p); import void Platform_SetInterruptHandler (Platform_SignalHandler handler); import void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Platform_FileIdentity source); import void Platform_SetQuitHandler (Platform_SignalHandler handler); -import INTEGER Platform_Size (LONGINT h, LONGINT *l); -import INTEGER Platform_Sync (LONGINT h); -import INTEGER Platform_System (CHAR *cmd, LONGINT cmd__len); -import LONGINT Platform_Time (void); -import BOOLEAN Platform_TimedOut (INTEGER e); -import BOOLEAN Platform_TooManyFiles (INTEGER e); -import INTEGER Platform_Truncate (LONGINT h, LONGINT l); -import INTEGER Platform_Unlink (CHAR *n, LONGINT n__len); -import INTEGER Platform_Write (LONGINT h, LONGINT p, LONGINT l); +import int16 Platform_Size (int32 h, int32 *l); +import int16 Platform_Sync (int32 h); +import int16 Platform_System (CHAR *cmd, LONGINT cmd__len); +import int32 Platform_Time (void); +import BOOLEAN Platform_TimedOut (int16 e); +import BOOLEAN Platform_TooManyFiles (int16 e); +import int16 Platform_Truncate (int32 h, int32 l); +import int16 Platform_Unlink (CHAR *n, LONGINT n__len); +import int16 Platform_Write (int32 h, int32 p, int32 l); import BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); import void *Platform__init(void); diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 28a855aa..4b500170 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -5,19 +5,19 @@ static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LONGINT d__len); -export void Reals_Convert (REAL x, INTEGER n, CHAR *d, LONGINT d__len); +export void Reals_Convert (REAL x, int16 n, CHAR *d, LONGINT d__len); export void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len); export void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len); -export void Reals_ConvertL (LONGREAL x, INTEGER n, CHAR *d, LONGINT d__len); -export INTEGER Reals_Expo (REAL x); -export INTEGER Reals_ExpoL (LONGREAL x); -export void Reals_SetExpo (REAL *x, INTEGER ex); -export REAL Reals_Ten (INTEGER e); -export LONGREAL Reals_TenL (INTEGER e); -static CHAR Reals_ToHex (INTEGER i); +export void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len); +export int16 Reals_Expo (REAL x); +export int16 Reals_ExpoL (LONGREAL x); +export void Reals_SetExpo (REAL *x, int16 ex); +export REAL Reals_Ten (int16 e); +export LONGREAL Reals_TenL (int16 e); +static CHAR Reals_ToHex (int16 i); -REAL Reals_Ten (INTEGER e) +REAL Reals_Ten (int16 e) { REAL _o_result; LONGREAL r, power; @@ -34,7 +34,7 @@ REAL Reals_Ten (INTEGER e) return _o_result; } -LONGREAL Reals_TenL (INTEGER e) +LONGREAL Reals_TenL (int16 e) { LONGREAL _o_result; LONGREAL r, power; @@ -54,43 +54,43 @@ LONGREAL Reals_TenL (INTEGER e) __RETCHK; } -INTEGER Reals_Expo (REAL x) +int16 Reals_Expo (REAL x) { - INTEGER _o_result; - INTEGER i; - __GET((SYSTEM_ADRINT)&x + 2, i, INTEGER); + int16 _o_result; + int16 i; + __GET((SYSTEM_ADRINT)&x + 2, i, int16); _o_result = __MASK(__ASHR(i, 7), -256); return _o_result; } -void Reals_SetExpo (REAL *x, INTEGER ex) +void Reals_SetExpo (REAL *x, int16 ex) { CHAR c; __GET((SYSTEM_ADRINT)x + 3, c, CHAR); - __PUT((SYSTEM_ADRINT)x + 3, (CHAR)(__ASHL(__ASHR((SYSTEM_INT16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __PUT((SYSTEM_ADRINT)x + 3, (CHAR)(__ASHL(__ASHR((int16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); __GET((SYSTEM_ADRINT)x + 2, c, CHAR); - __PUT((SYSTEM_ADRINT)x + 2, (CHAR)(__MASK((SYSTEM_INT16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); + __PUT((SYSTEM_ADRINT)x + 2, (CHAR)(__MASK((int16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } -INTEGER Reals_ExpoL (LONGREAL x) +int16 Reals_ExpoL (LONGREAL x) { - INTEGER _o_result; - INTEGER i; - __GET((SYSTEM_ADRINT)&x + 6, i, INTEGER); + int16 _o_result; + int16 i; + __GET((SYSTEM_ADRINT)&x + 6, i, int16); _o_result = __MASK(__ASHR(i, 4), -2048); return _o_result; } -void Reals_ConvertL (LONGREAL x, INTEGER n, CHAR *d, LONGINT d__len) +void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len) { - LONGINT i, j, k; + int32 i, j, k; if (x < (LONGREAL)0) { x = -x; } k = 0; if (n > 9) { - i = (SYSTEM_INT32)__ENTIER(x / (LONGREAL)(LONGREAL)1000000000); - j = (SYSTEM_INT32)__ENTIER(x - i * (LONGREAL)1000000000); + i = (int32)__ENTIER(x / (LONGREAL)(LONGREAL)1000000000); + j = (int32)__ENTIER(x - i * (LONGREAL)1000000000); if (j < 0) { j = 0; } @@ -100,7 +100,7 @@ void Reals_ConvertL (LONGREAL x, INTEGER n, CHAR *d, LONGINT d__len) k += 1; } } else { - i = (SYSTEM_INT32)__ENTIER(x); + i = (int32)__ENTIER(x); } while (k < n) { d[__X(k, d__len)] = (CHAR)((int)__MOD(i, 10) + 48); @@ -109,12 +109,12 @@ void Reals_ConvertL (LONGREAL x, INTEGER n, CHAR *d, LONGINT d__len) } } -void Reals_Convert (REAL x, INTEGER n, CHAR *d, LONGINT d__len) +void Reals_Convert (REAL x, int16 n, CHAR *d, LONGINT d__len) { Reals_ConvertL(x, n, (void*)d, d__len); } -static CHAR Reals_ToHex (INTEGER i) +static CHAR Reals_ToHex (int16 i) { CHAR _o_result; if (i < 10) { @@ -129,15 +129,15 @@ static CHAR Reals_ToHex (INTEGER i) static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LONGINT d__len) { - INTEGER i; - LONGINT l; + int16 i; + int32 l; CHAR by; i = 0; l = b__len; while (i < l) { by = __VAL(CHAR, b[__X(i, b__len)]); - d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((SYSTEM_INT16)by, 4)); - d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((SYSTEM_INT16)by, -16)); + d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((int16)by, 4)); + d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((int16)by, -16)); i += 1; } } diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index 65543fac..a1191c0b 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -8,15 +8,15 @@ -import void Reals_Convert (REAL x, INTEGER n, CHAR *d, LONGINT d__len); +import void Reals_Convert (REAL x, int16 n, CHAR *d, LONGINT d__len); import void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len); import void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len); -import void Reals_ConvertL (LONGREAL x, INTEGER n, CHAR *d, LONGINT d__len); -import INTEGER Reals_Expo (REAL x); -import INTEGER Reals_ExpoL (LONGREAL x); -import void Reals_SetExpo (REAL *x, INTEGER ex); -import REAL Reals_Ten (INTEGER e); -import LONGREAL Reals_TenL (INTEGER e); +import void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len); +import int16 Reals_Expo (REAL x); +import int16 Reals_ExpoL (LONGREAL x); +import void Reals_SetExpo (REAL *x, int16 ex); +import REAL Reals_Ten (int16 e); +import LONGREAL Reals_TenL (int16 e); import void *Reals__init(void); diff --git a/bootstrap/unix-48/SYSTEM.h b/bootstrap/unix-48/SYSTEM.h index 343404a4..11ec8fc5 100644 --- a/bootstrap/unix-48/SYSTEM.h +++ b/bootstrap/unix-48/SYSTEM.h @@ -2,19 +2,21 @@ #define SYSTEM__h #if defined(_WIN64) - typedef long long SYSTEM_INT64; - typedef unsigned long long SYSTEM_CARD64; + typedef long long int64; + typedef unsigned long long uint64; #else - typedef long SYSTEM_INT64; - typedef unsigned long SYSTEM_CARD64; + typedef long int64; + typedef unsigned long uint64; #endif -typedef int SYSTEM_INT32; -typedef unsigned int SYSTEM_CARD32; -typedef short int SYSTEM_INT16; -typedef unsigned short int SYSTEM_CARD16; -typedef signed char SYSTEM_INT8; -typedef unsigned char SYSTEM_CARD8; +typedef int int32; +typedef unsigned int uint32; + +typedef short int int16; +typedef unsigned short int uint16; + +typedef signed char int8; +typedef unsigned char uint8; #if (__SIZEOF_POINTER__ == 8) || defined(_WIN64) || defined(__LP64__) #if defined(_WIN64) @@ -26,12 +28,30 @@ typedef unsigned char SYSTEM_CARD8; typedef unsigned int size_t; #endif -#define SYSTEM_ADRINT size_t -#define SYSTEM_ADDRESS size_t // Temporarily for bootstrap #define _SIZE_T_DECLARED // For FreeBSD #define _SIZE_T_DEFINED_ // For OpenBSD -void *memcpy(void *dest, const void *source, SYSTEM_ADRINT size); +void *memcpy(void *dest, const void *source, size_t size); + + +// Temporary while bootstrapping: + +#define SYSTEM_INT8 int8 +#define SYSTEM_INT16 int16 +#define SYSTEM_INT32 int32 +#define SYSTEM_INT64 int64 +#define SYSTEM_ADDRESS size_t + +#define U_SYSTEM_INT8 uint8 +#define U_SYSTEM_INT16 uint16 +#define U_SYSTEM_INT32 uint32 +#define U_SYSTEM_INT64 uint64 + +#define U_int8 uint8 +#define U_int16 uint16 +#define U_int32 uint32 +#define U_int64 uint64 + @@ -52,41 +72,53 @@ void *memcpy(void *dest, const void *source, SYSTEM_ADRINT size); // Oberon types -typedef char BOOLEAN; -typedef unsigned char SYSTEM_BYTE; -typedef unsigned char CHAR; -typedef signed char SHORTINT; -typedef float REAL; -typedef double LONGREAL; -typedef void* SYSTEM_PTR; +// typedef char BOOLEAN; +// typedef unsigned char SYSTEM_BYTE; +// typedef unsigned char CHAR; +// typedef signed char SHORTINT; +// typedef float REAL; +// typedef double LONGREAL; +// typedef void* SYSTEM_PTR; + +typedef int8 BOOLEAN; +typedef int8 SYSTEM_BYTE; +typedef uint8 U_SYSTEM_BYTE; +typedef uint8 CHAR; +typedef uint8 U_CHAR; +typedef int8 SHORTINT; +typedef uint8 U_SHORTINT; +typedef float REAL; +typedef double LONGREAL; +typedef void* SYSTEM_PTR; + +typedef size_t SYSTEM_ADRINT; + // For 32 bit builds, the size of LONGINT depends on a make option: #if (__SIZEOF_POINTER__ == 8) || defined(LARGE) || defined(_WIN64) - typedef int INTEGER; // INTEGER is 32 bit. - typedef long long LONGINT; // LONGINT is 64 bit. (long long is always 64 bits, while long can be 32 bits e.g. under MSC/MingW) - typedef unsigned int U_INTEGER; - typedef unsigned long long U_LONGINT; + typedef int32 INTEGER; + typedef int64 LONGINT; + typedef uint32 U_INTEGER; + typedef uint64 U_LONGINT; #else - typedef short int INTEGER; // INTEGER is 16 bit. - typedef long LONGINT; // LONGINT is 32 bit. - typedef unsigned short int U_INTEGER; - typedef unsigned long U_LONGINT; + typedef int16 INTEGER; + typedef int32 LONGINT; + typedef uint16 U_INTEGER; + typedef uint32 U_LONGINT; #endif // Unsigned variants are for use by shift and rotate macros. -typedef unsigned char U_SYSTEM_BYTE; -typedef unsigned char U_CHAR; -typedef unsigned char U_SHORTINT; - typedef U_LONGINT SET; typedef U_LONGINT U_SET; -typedef SYSTEM_CARD8 U_SYSTEM_INT8; -typedef SYSTEM_CARD16 U_SYSTEM_INT16; -typedef SYSTEM_CARD32 U_SYSTEM_INT32; -typedef SYSTEM_CARD64 U_SYSTEM_INT64; + + + +// ---------------------------------------------------------------------- +// ---------------------------------------------------------------------- + // OS Memory allocation interfaces are in PlatformXXX.Mod diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index 834c1fb1..6463db16 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -6,19 +6,19 @@ export void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len); export void Strings_Cap (CHAR *s, LONGINT s__len); -export void Strings_Delete (CHAR *s, LONGINT s__len, INTEGER pos, INTEGER n); -export void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n, CHAR *dest, LONGINT dest__len); -export void Strings_Insert (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, LONGINT dest__len); -export INTEGER Strings_Length (CHAR *s, LONGINT s__len); +export void Strings_Delete (CHAR *s, LONGINT s__len, int16 pos, int16 n); +export void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHAR *dest, LONGINT dest__len); +export void Strings_Insert (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len); +export int16 Strings_Length (CHAR *s, LONGINT s__len); export BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len); -export INTEGER Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, INTEGER pos); -export void Strings_Replace (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, LONGINT dest__len); +export int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int16 pos); +export void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len); -INTEGER Strings_Length (CHAR *s, LONGINT s__len) +int16 Strings_Length (CHAR *s, LONGINT s__len) { - INTEGER _o_result; - INTEGER i; + int16 _o_result; + int16 i; __DUP(s, s__len, CHAR); i = 0; while ((i < s__len && s[__X(i, s__len)] != 0x00)) { @@ -31,7 +31,7 @@ INTEGER Strings_Length (CHAR *s, LONGINT s__len) void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len) { - INTEGER n1, n2, i; + int16 n1, n2, i; __DUP(extra, extra__len, CHAR); n1 = Strings_Length(dest, dest__len); n2 = Strings_Length(extra, extra__len); @@ -46,9 +46,9 @@ void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__ __DEL(extra); } -void Strings_Insert (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, LONGINT dest__len) +void Strings_Insert (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len) { - INTEGER n1, n2, i; + int16 n1, n2, i; __DUP(source, source__len, CHAR); n1 = Strings_Length(dest, dest__len); n2 = Strings_Length(source, source__len); @@ -76,9 +76,9 @@ void Strings_Insert (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, __DEL(source); } -void Strings_Delete (CHAR *s, LONGINT s__len, INTEGER pos, INTEGER n) +void Strings_Delete (CHAR *s, LONGINT s__len, int16 pos, int16 n) { - INTEGER len, i; + int16 len, i; len = Strings_Length(s, s__len); if (pos < 0) { pos = 0; @@ -99,7 +99,7 @@ void Strings_Delete (CHAR *s, LONGINT s__len, INTEGER pos, INTEGER n) } } -void Strings_Replace (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, LONGINT dest__len) +void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len) { __DUP(source, source__len, CHAR); Strings_Delete((void*)dest, dest__len, pos, pos + Strings_Length(source, source__len)); @@ -107,12 +107,12 @@ void Strings_Replace (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest __DEL(source); } -void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n, CHAR *dest, LONGINT dest__len) +void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHAR *dest, LONGINT dest__len) { - INTEGER len, destLen, i; + int16 len, destLen, i; __DUP(source, source__len, CHAR); len = Strings_Length(source, source__len); - destLen = (SYSTEM_INT16)dest__len - 1; + destLen = (int16)dest__len - 1; if (pos < 0) { pos = 0; } @@ -131,10 +131,10 @@ void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n, __DEL(source); } -INTEGER Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, INTEGER pos) +int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int16 pos) { - INTEGER _o_result; - INTEGER n1, n2, i, j; + int16 _o_result; + int16 n1, n2, i, j; __DUP(pattern, pattern__len, CHAR); __DUP(s, s__len, CHAR); n1 = Strings_Length(s, s__len); @@ -169,7 +169,7 @@ INTEGER Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__le void Strings_Cap (CHAR *s, LONGINT s__len) { - INTEGER i; + int16 i; i = 0; while (s[__X(i, s__len)] != 0x00) { if (('a' <= s[__X(i, s__len)] && s[__X(i, s__len)] <= 'z')) { @@ -183,9 +183,9 @@ static struct Match__7 { struct Match__7 *lnk; } *Match__7_s; -static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, INTEGER n, INTEGER m); +static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, int16 n, int16 m); -static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, INTEGER n, INTEGER m) +static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, int16 n, int16 m) { BOOLEAN _o_result; while ((((n >= 0 && m >= 0)) && mask[__X(m, mask__len)] != '*')) { diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index 2edcc736..07051628 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -10,13 +10,13 @@ import void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len); import void Strings_Cap (CHAR *s, LONGINT s__len); -import void Strings_Delete (CHAR *s, LONGINT s__len, INTEGER pos, INTEGER n); -import void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n, CHAR *dest, LONGINT dest__len); -import void Strings_Insert (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, LONGINT dest__len); -import INTEGER Strings_Length (CHAR *s, LONGINT s__len); +import void Strings_Delete (CHAR *s, LONGINT s__len, int16 pos, int16 n); +import void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHAR *dest, LONGINT dest__len); +import void Strings_Insert (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len); +import int16 Strings_Length (CHAR *s, LONGINT s__len); import BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len); -import INTEGER Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, INTEGER pos); -import void Strings_Replace (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, LONGINT dest__len); +import int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int16 pos); +import void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len); import void *Strings__init(void); diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index dddea925..8dea0639 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -13,9 +13,9 @@ typedef typedef struct Texts_RunDesc { Texts_Run prev, next; - LONGINT len; + int32 len; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; BOOLEAN ascii; } Texts_RunDesc; @@ -36,26 +36,26 @@ typedef typedef struct Texts_ElemDesc { Texts_Run prev, next; - LONGINT len; + int32 len; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; BOOLEAN ascii; - LONGINT W, H; + int32 W, H; Texts_Handler handle; Texts_Text base; } Texts_ElemDesc; struct Texts__1 { /* Texts_ElemDesc */ Texts_Run prev, next; - LONGINT len; + int32 len; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; BOOLEAN ascii; - LONGINT W, H; + int32 W, H; Texts_Handler handle; Texts_Text base; Files_File file; - LONGINT org, span; + int32 org, span; CHAR mod[32], proc[32]; }; @@ -64,7 +64,7 @@ typedef typedef struct Texts_BufDesc { - LONGINT len; + int32 len; Texts_Run head; } Texts_BufDesc; @@ -78,8 +78,8 @@ typedef typedef struct Texts_FileMsg { /* Texts_ElemMsg */ - INTEGER id; - LONGINT pos; + int16 id; + int32 pos; Files_Rider r; } Texts_FileMsg; @@ -94,7 +94,7 @@ typedef } Texts_IdentifyMsg; typedef - void (*Texts_Notifier)(Texts_Text, INTEGER, LONGINT, LONGINT); + void (*Texts_Notifier)(Texts_Text, int16, int32, int32); typedef struct Texts_PieceDesc *Texts_Piece; @@ -102,57 +102,57 @@ typedef typedef struct Texts_PieceDesc { Texts_Run prev, next; - LONGINT len; + int32 len; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; BOOLEAN ascii; Files_File file; - LONGINT org; + int32 org; } Texts_PieceDesc; typedef struct Texts_Reader { BOOLEAN eot; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; Texts_Elem elem; Files_Rider rider; Texts_Run run; - LONGINT org, off; + int32 org, off; } Texts_Reader; typedef struct Texts_Scanner { /* Texts_Reader */ BOOLEAN eot; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; Texts_Elem elem; Files_Rider rider; Texts_Run run; - LONGINT org, off; + int32 org, off; CHAR nextCh; - INTEGER line, class; - LONGINT i; + int16 line, class; + int32 i; REAL x; LONGREAL y; CHAR c; - SHORTINT len; + int8 len; CHAR s[64]; } Texts_Scanner; typedef struct Texts_TextDesc { - LONGINT len; + int32 len; Texts_Notifier notify; Texts_Run head, cache; - LONGINT corg; + int32 corg; } Texts_TextDesc; typedef struct Texts_Writer { Texts_Buffer buf; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; Files_Rider rider; Files_File file; } Texts_Writer; @@ -178,50 +178,50 @@ export LONGINT *Texts_Writer__typ; export LONGINT *Texts__1__typ; export void Texts_Append (Texts_Text T, Texts_Buffer B); -export void Texts_ChangeLooks (Texts_Text T, LONGINT beg, LONGINT end, SET sel, Texts_FontsFont fnt, SHORTINT col, SHORTINT voff); +export void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff); static Texts_Elem Texts_CloneElem (Texts_Elem e); static Texts_Piece Texts_ClonePiece (Texts_Piece p); export void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len); export void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); export void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); -export void Texts_Delete (Texts_Text T, LONGINT beg, LONGINT end); +export void Texts_Delete (Texts_Text T, int32 beg, int32 end); export Texts_Text Texts_ElemBase (Texts_Elem E); -export LONGINT Texts_ElemPos (Texts_Elem E); -static void Texts_Find (Texts_Text T, LONGINT *pos, Texts_Run *u, LONGINT *org, LONGINT *off); +export int32 Texts_ElemPos (Texts_Elem E); +static void Texts_Find (Texts_Text T, int32 *pos, Texts_Run *u, int32 *org, int32 *off); static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len); static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, LONGINT *msg__typ); -export void Texts_Insert (Texts_Text T, LONGINT pos, Texts_Buffer B); +export void Texts_Insert (Texts_Text T, int32 pos, Texts_Buffer B); export void Texts_Load (Files_Rider *r, LONGINT *r__typ, Texts_Text T); static void Texts_Load0 (Files_Rider *r, LONGINT *r__typ, Texts_Text T); static void Texts_Merge (Texts_Text T, Texts_Run u, Texts_Run *v); export void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len); export void Texts_OpenBuf (Texts_Buffer B); -export void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, LONGINT pos); -export void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, LONGINT pos); +export void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, int32 pos); +export void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, int32 pos); export void Texts_OpenWriter (Texts_Writer *W, LONGINT *W__typ); -export LONGINT Texts_Pos (Texts_Reader *R, LONGINT *R__typ); +export int32 Texts_Pos (Texts_Reader *R, LONGINT *R__typ); export void Texts_Read (Texts_Reader *R, LONGINT *R__typ, CHAR *ch); export void Texts_ReadElem (Texts_Reader *R, LONGINT *R__typ); export void Texts_ReadPrevElem (Texts_Reader *R, LONGINT *R__typ); export void Texts_Recall (Texts_Buffer *B); -export void Texts_Save (Texts_Text T, LONGINT beg, LONGINT end, Texts_Buffer B); +export void Texts_Save (Texts_Text T, int32 beg, int32 end, Texts_Buffer B); export void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ); -export void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, SHORTINT col); +export void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, int8 col); export void Texts_SetFont (Texts_Writer *W, LONGINT *W__typ, Texts_FontsFont fnt); -export void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, SHORTINT voff); +export void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, int8 voff); static void Texts_Splice (Texts_Run un, Texts_Run v, Texts_Run w, Texts_Text base); -static void Texts_Split (LONGINT off, Texts_Run *u, Texts_Run *un); +static void Texts_Split (int32 off, Texts_Run *u, Texts_Run *un); export void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T); export void Texts_Write (Texts_Writer *W, LONGINT *W__typ, CHAR ch); -export void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, LONGINT t, LONGINT d); +export void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, int32 t, int32 d); export void Texts_WriteElem (Texts_Writer *W, LONGINT *W__typ, Texts_Elem e); -export void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, LONGINT x); -export void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n); +export void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, int32 x); +export void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int32 x, int32 n); export void Texts_WriteLn (Texts_Writer *W, LONGINT *W__typ); -export void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER n); +export void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, int16 n); export void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x); -export void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n); -export void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n, INTEGER k); +export void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, int16 n); +export void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, int16 n, int16 k); export void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x); export void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__len); @@ -236,10 +236,10 @@ static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len) return _o_result; } -static void Texts_Find (Texts_Text T, LONGINT *pos, Texts_Run *u, LONGINT *org, LONGINT *off) +static void Texts_Find (Texts_Text T, int32 *pos, Texts_Run *u, int32 *org, int32 *off) { Texts_Run v = NIL; - LONGINT m; + int32 m; if (*pos >= T->len) { *pos = T->len; *u = T->head; @@ -269,7 +269,7 @@ static void Texts_Find (Texts_Text T, LONGINT *pos, Texts_Run *u, LONGINT *org, } } -static void Texts_Split (LONGINT off, Texts_Run *u, Texts_Run *un) +static void Texts_Split (int32 off, Texts_Run *u, Texts_Run *un) { Texts_Piece p = NIL, U = NIL; if (off == 0) { @@ -368,11 +368,11 @@ Texts_Text Texts_ElemBase (Texts_Elem E) return _o_result; } -LONGINT Texts_ElemPos (Texts_Elem E) +int32 Texts_ElemPos (Texts_Elem E) { - LONGINT _o_result; + int32 _o_result; Texts_Run u = NIL; - LONGINT pos; + int32 pos; u = E->base->head->next; pos = 0; while (u != (void *) E) { @@ -387,7 +387,7 @@ static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, LONGINT *msg__t { Texts_Alien e = NIL; Files_Rider r; - LONGINT i; + int32 i; CHAR ch; if (__ISP(E, Texts__1, 2)) { if (__IS(msg__typ, Texts_CopyMsg, 1)) { @@ -463,10 +463,10 @@ void Texts_Recall (Texts_Buffer *B) Texts_del = NIL; } -void Texts_Save (Texts_Text T, LONGINT beg, LONGINT end, Texts_Buffer B) +void Texts_Save (Texts_Text T, int32 beg, int32 end, Texts_Buffer B) { Texts_Run u = NIL, v = NIL, w = NIL, wn = NIL; - LONGINT uo, ud, vo, vd; + int32 uo, ud, vo, vd; Texts_Find(T, &beg, &u, &uo, &ud); Texts_Find(T, &end, &v, &vo, &vd); w = B->head->prev; @@ -497,11 +497,11 @@ void Texts_Save (Texts_Text T, LONGINT beg, LONGINT end, Texts_Buffer B) B->len += end - beg; } -void Texts_Insert (Texts_Text T, LONGINT pos, Texts_Buffer B) +void Texts_Insert (Texts_Text T, int32 pos, Texts_Buffer B) { Texts_Run u = NIL, un = NIL, v = NIL; Texts_Piece p = NIL, q = NIL; - LONGINT uo, ud, len; + int32 uo, ud, len; Texts_Find(T, &pos, &u, &uo, &ud); Texts_Split(ud, &u, &un); len = B->len; @@ -520,7 +520,7 @@ void Texts_Insert (Texts_Text T, LONGINT pos, Texts_Buffer B) void Texts_Append (Texts_Text T, Texts_Buffer B) { Texts_Run v = NIL; - LONGINT pos, len; + int32 pos, len; pos = T->len; len = B->len; v = B->head->next; @@ -535,10 +535,10 @@ void Texts_Append (Texts_Text T, Texts_Buffer B) } } -void Texts_Delete (Texts_Text T, LONGINT beg, LONGINT end) +void Texts_Delete (Texts_Text T, int32 beg, int32 end) { Texts_Run c = NIL, u = NIL, un = NIL, v = NIL, vn = NIL; - LONGINT co, uo, ud, vo, vd; + int32 co, uo, ud, vo, vd; Texts_Find(T, &beg, &u, &uo, &ud); Texts_Split(ud, &u, &un); c = T->cache; @@ -560,10 +560,10 @@ void Texts_Delete (Texts_Text T, LONGINT beg, LONGINT end) } } -void Texts_ChangeLooks (Texts_Text T, LONGINT beg, LONGINT end, SET sel, Texts_FontsFont fnt, SHORTINT col, SHORTINT voff) +void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff) { Texts_Run c = NIL, u = NIL, un = NIL, v = NIL, vn = NIL; - LONGINT co, uo, ud, vo, vd; + int32 co, uo, ud, vo, vd; Texts_Find(T, &beg, &u, &uo, &ud); Texts_Split(ud, &u, &un); c = T->cache; @@ -599,7 +599,7 @@ void Texts_ChangeLooks (Texts_Text T, LONGINT beg, LONGINT end, SET sel, Texts_F } } -void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, LONGINT pos) +void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, int32 pos) { Texts_Run u = NIL; if (pos >= T->len) { @@ -616,7 +616,7 @@ void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, LONGINT p void Texts_Read (Texts_Reader *R, LONGINT *R__typ, CHAR *ch) { Texts_Run u = NIL; - LONGINT pos; + int32 pos; CHAR nextch; u = (*R).run; (*R).fnt = u->fnt; @@ -708,14 +708,14 @@ void Texts_ReadPrevElem (Texts_Reader *R, LONGINT *R__typ) } } -LONGINT Texts_Pos (Texts_Reader *R, LONGINT *R__typ) +int32 Texts_Pos (Texts_Reader *R, LONGINT *R__typ) { - LONGINT _o_result; + int32 _o_result; _o_result = (*R).org + (*R).off; return _o_result; } -void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, LONGINT pos) +void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, int32 pos) { Texts_OpenReader((void*)&*S, S__typ, T, pos); (*S).line = 0; @@ -727,7 +727,7 @@ static struct Scan__31 { LONGINT *S__typ; CHAR *ch; BOOLEAN *negE; - INTEGER *e; + int16 *e; struct Scan__31 *lnk; } *Scan__31_s; @@ -746,7 +746,7 @@ static void ReadScaleFactor__32 (void) } } while (('0' <= *Scan__31_s->ch && *Scan__31_s->ch <= '9')) { - *Scan__31_s->e = (*Scan__31_s->e * 10 + (SYSTEM_INT16)*Scan__31_s->ch) - 48; + *Scan__31_s->e = (*Scan__31_s->e * 10 + (int16)*Scan__31_s->ch) - 48; Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); } } @@ -755,9 +755,9 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) { CHAR ch, term; BOOLEAN neg, negE, hex; - SHORTINT i, j, h; - INTEGER e; - LONGINT k; + int8 i, j, h; + int16 e; + int32 k; REAL x, f; LONGREAL y, g; CHAR d[32]; @@ -818,10 +818,10 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) if ('9' < ch) { if (('A' <= ch && ch <= 'F')) { hex = 1; - ch = (CHAR)((SYSTEM_INT16)ch - 7); + ch = (CHAR)((int16)ch - 7); } else if (('a' <= ch && ch <= 'f')) { hex = 1; - ch = (CHAR)((SYSTEM_INT16)ch - 39); + ch = (CHAR)((int16)ch - 39); } else { break; } @@ -833,13 +833,13 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) if (i - j > 8) { j = i - 8; } - k = (SYSTEM_INT16)d[__X(j, 32)] - 48; + k = (int16)d[__X(j, 32)] - 48; j += 1; if ((i - j == 7 && k >= 8)) { k -= 16; } while (j < i) { - k = __ASHL(k, 4) + ((SYSTEM_INT16)d[__X(j, 32)] - 48); + k = __ASHL(k, 4) + ((int16)d[__X(j, 32)] - 48); j += 1; } if (neg) { @@ -860,12 +860,12 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) y = (LONGREAL)0; g = (LONGREAL)1; do { - y = y * (LONGREAL)10 + ((SYSTEM_INT16)d[__X(j, 32)] - 48); + y = y * (LONGREAL)10 + ((int16)d[__X(j, 32)] - 48); j += 1; } while (!(j == h)); while (j < i) { g = g / (LONGREAL)(LONGREAL)10; - y = ((SYSTEM_INT16)d[__X(j, 32)] - 48) * g + y; + y = ((int16)d[__X(j, 32)] - 48) * g + y; j += 1; } ReadScaleFactor__32(); @@ -892,12 +892,12 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) x = (REAL)0; f = (REAL)1; do { - x = x * (REAL)10 + ((SYSTEM_INT16)d[__X(j, 32)] - 48); + x = x * (REAL)10 + ((int16)d[__X(j, 32)] - 48); j += 1; } while (!(j == h)); while (j < i) { f = f / (REAL)(REAL)10; - x = ((SYSTEM_INT16)d[__X(j, 32)] - 48) * f + x; + x = ((int16)d[__X(j, 32)] - 48) * f + x; j += 1; } if (ch == 'E') { @@ -929,7 +929,7 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) (*S).class = 3; k = 0; do { - k = k * 10 + ((SYSTEM_INT16)d[__X(j, 32)] - 48); + k = k * 10 + ((int16)d[__X(j, 32)] - 48); j += 1; } while (!(j == i)); if (neg) { @@ -973,12 +973,12 @@ void Texts_SetFont (Texts_Writer *W, LONGINT *W__typ, Texts_FontsFont fnt) (*W).fnt = fnt; } -void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, SHORTINT col) +void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, int8 col) { (*W).col = col; } -void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, SHORTINT voff) +void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, int8 voff) { (*W).voff = voff; } @@ -1035,7 +1035,7 @@ void Texts_WriteLn (Texts_Writer *W, LONGINT *W__typ) void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__len) { - INTEGER i; + int16 i; __DUP(s, s__len, CHAR); i = 0; while (s[__X(i, s__len)] >= ' ') { @@ -1045,10 +1045,10 @@ void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__le __DEL(s); } -void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n) +void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int32 x, int32 n) { - INTEGER i; - LONGINT x0; + int16 i; + int32 x0; CHAR a[22]; i = 0; if (x < 0) { @@ -1080,10 +1080,10 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n) } while (!(i == 0)); } -void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, LONGINT x) +void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, int32 x) { - INTEGER i; - LONGINT y; + int16 i; + int32 y; CHAR a[20]; i = 0; Texts_Write(&*W, W__typ, ' '); @@ -1103,9 +1103,9 @@ void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, LONGINT x) } while (!(i == 0)); } -void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n) +void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, int16 n) { - INTEGER e; + int16 e; REAL x0; CHAR d[9]; e = Reals_Expo(x); @@ -1176,15 +1176,15 @@ void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n) static struct WriteRealFix__53 { Texts_Writer *W; LONGINT *W__typ; - INTEGER *i; + int16 *i; CHAR (*d)[9]; struct WriteRealFix__53 *lnk; } *WriteRealFix__53_s; -static void dig__54 (INTEGER n); -static void seq__56 (CHAR ch, INTEGER n); +static void dig__54 (int16 n); +static void seq__56 (CHAR ch, int16 n); -static void seq__56 (CHAR ch, INTEGER n) +static void seq__56 (CHAR ch, int16 n) { while (n > 0) { Texts_Write(&*WriteRealFix__53_s->W, WriteRealFix__53_s->W__typ, ch); @@ -1192,7 +1192,7 @@ static void seq__56 (CHAR ch, INTEGER n) } } -static void dig__54 (INTEGER n) +static void dig__54 (int16 n) { while (n > 0) { *WriteRealFix__53_s->i -= 1; @@ -1201,9 +1201,9 @@ static void dig__54 (INTEGER n) } } -void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n, INTEGER k) +void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, int16 n, int16 k) { - INTEGER e, i; + int16 e, i; CHAR sign; REAL x0; CHAR d[9]; @@ -1275,7 +1275,7 @@ void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n, IN void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x) { - INTEGER i; + int16 i; CHAR d[8]; Reals_ConvertH(x, (void*)d, 8); i = 0; @@ -1285,9 +1285,9 @@ void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x) } while (!(i == 8)); } -void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER n) +void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, int16 n) { - INTEGER e; + int16 e; LONGREAL x0; CHAR d[16]; e = Reals_ExpoL(x); @@ -1319,7 +1319,7 @@ void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER } else { Texts_Write(&*W, W__typ, ' '); } - e = (SYSTEM_INT16)__ASHR((e - 1023) * 77, 8); + e = (int16)__ASHR((e - 1023) * 77, 8); if (e >= 0) { x = x / (LONGREAL)Reals_TenL(e); } else { @@ -1359,7 +1359,7 @@ void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x) { - INTEGER i; + int16 i; CHAR d[16]; Reals_ConvertHL(x, (void*)d, 16); i = 0; @@ -1375,16 +1375,16 @@ static struct WriteDate__43 { struct WriteDate__43 *lnk; } *WriteDate__43_s; -static void WritePair__44 (CHAR ch, LONGINT x); +static void WritePair__44 (CHAR ch, int32 x); -static void WritePair__44 (CHAR ch, LONGINT x) +static void WritePair__44 (CHAR ch, int32 x) { Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, ch); Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)(__DIV(x, 10) + 48)); Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)((int)__MOD(x, 10) + 48)); } -void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, LONGINT t, LONGINT d) +void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, int32 t, int32 d) { struct WriteDate__43 _s; _s.W = W; _s.W__typ = W__typ; @@ -1401,22 +1401,22 @@ void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, LONGINT t, LONGINT d) static struct Load0__16 { Texts_Text *T; - SHORTINT *ecnt; + int8 *ecnt; Files_File *f; Texts_FileMsg *msg; CHAR (*mods)[64][32], (*procs)[64][32]; struct Load0__16 *lnk; } *Load0__16_s; -static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, LONGINT span, Texts_Elem *e); +static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, int32 pos, int32 span, Texts_Elem *e); -static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, LONGINT span, Texts_Elem *e) +static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, int32 pos, int32 span, Texts_Elem *e) { Modules_Module M = NIL; Modules_Command Cmd; Texts_Alien a = NIL; - LONGINT org, ew, eh; - SHORTINT eno; + int32 org, ew, eh; + int8 eno; Texts_new = NIL; Files_ReadLInt(&*r, r__typ, &ew); Files_ReadLInt(&*r, r__typ, &eh); @@ -1466,8 +1466,8 @@ static void Texts_Load0 (Files_Rider *r, LONGINT *r__typ, Texts_Text T) Texts_Run u = NIL, un = NIL; Texts_Piece p = NIL; Texts_Elem e = NIL; - LONGINT org, pos, hlen, plen; - SHORTINT ecnt, fno, fcnt, col, voff; + int32 org, pos, hlen, plen; + int8 ecnt, fno, fcnt, col, voff; Files_File f = NIL; Texts_FileMsg msg; CHAR mods[64][32], procs[64][32]; @@ -1537,7 +1537,7 @@ static void Texts_Load0 (Files_Rider *r, LONGINT *r__typ, Texts_Text T) void Texts_Load (Files_Rider *r, LONGINT *r__typ, Texts_Text T) { - INTEGER tag; + int16 tag; Files_ReadInt(&*r, r__typ, &tag); if (tag != -4095) { Files_Set(&*r, r__typ, Files_Base(&*r, r__typ), Files_Pos(&*r, r__typ) - 2); @@ -1552,7 +1552,7 @@ void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len) Texts_Run u = NIL; Texts_Piece p = NIL; CHAR tag, version; - LONGINT hlen; + int32 hlen; __DUP(name, name__len, CHAR); f = Files_Old(name, name__len); if (f == NIL) { @@ -1602,20 +1602,20 @@ void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len) } static struct Store__39 { - SHORTINT *ecnt; + int8 *ecnt; Texts_FileMsg *msg; Texts_IdentifyMsg *iden; CHAR (*mods)[64][32], (*procs)[64][32]; struct Store__39 *lnk; } *Store__39_s; -static void StoreElem__40 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, Texts_Elem e); +static void StoreElem__40 (Files_Rider *r, LONGINT *r__typ, int32 pos, Texts_Elem e); -static void StoreElem__40 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, Texts_Elem e) +static void StoreElem__40 (Files_Rider *r, LONGINT *r__typ, int32 pos, Texts_Elem e) { Files_Rider r1; - LONGINT org, span; - SHORTINT eno; + int32 org, span; + int8 eno; __COPY((*Store__39_s->iden).mod, (*Store__39_s->mods)[__X(*Store__39_s->ecnt, 64)], 32); __COPY((*Store__39_s->iden).proc, (*Store__39_s->procs)[__X(*Store__39_s->ecnt, 64)], 32); eno = 1; @@ -1646,8 +1646,8 @@ void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T) Files_Rider r1; Texts_Run u = NIL, un = NIL; Texts_Elem e = NIL; - LONGINT org, pos, delta, hlen, rlen; - SHORTINT ecnt, fno, fcnt; + int32 org, pos, delta, hlen, rlen; + int8 ecnt, fno, fcnt; CHAR ch; Texts_FileMsg msg; Texts_IdentifyMsg iden; @@ -1764,7 +1764,7 @@ void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len) { Files_File f = NIL; Files_Rider r; - INTEGER i, res; + int16 i, res; CHAR bak[64]; __DUP(name, name__len, CHAR); f = Files_New(name, name__len); diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index 5499c3d0..d946691c 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -8,7 +8,7 @@ typedef struct Texts_BufDesc { - LONGINT len; + int32 len; char _prvt0[4]; } Texts_BufDesc; @@ -40,15 +40,15 @@ typedef typedef struct Texts_ElemDesc { char _prvt0[20]; - LONGINT W, H; + int32 W, H; Texts_Handler handle; char _prvt1[4]; } Texts_ElemDesc; typedef struct Texts_FileMsg { /* Texts_ElemMsg */ - INTEGER id; - LONGINT pos; + int16 id; + int32 pos; Files_Rider r; } Texts_FileMsg; @@ -69,13 +69,13 @@ typedef struct Texts_TextDesc *Texts_Text; typedef - void (*Texts_Notifier)(Texts_Text, INTEGER, LONGINT, LONGINT); + void (*Texts_Notifier)(Texts_Text, int16, int32, int32); typedef struct Texts_Reader { BOOLEAN eot; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; Texts_Elem elem; char _prvt0[32]; } Texts_Reader; @@ -84,23 +84,23 @@ typedef struct Texts_Scanner { /* Texts_Reader */ BOOLEAN eot; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; Texts_Elem elem; LONGREAL _prvt0; char _prvt1[24]; CHAR nextCh; - INTEGER line, class; - LONGINT i; + int16 line, class; + int32 i; REAL x; LONGREAL y; CHAR c; - SHORTINT len; + int8 len; CHAR s[64]; } Texts_Scanner; typedef struct Texts_TextDesc { - LONGINT len; + int32 len; Texts_Notifier notify; char _prvt0[12]; } Texts_TextDesc; @@ -109,7 +109,7 @@ typedef struct Texts_Writer { Texts_Buffer buf; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; char _prvt0[26]; } Texts_Writer; @@ -130,41 +130,41 @@ import LONGINT *Texts_Scanner__typ; import LONGINT *Texts_Writer__typ; import void Texts_Append (Texts_Text T, Texts_Buffer B); -import void Texts_ChangeLooks (Texts_Text T, LONGINT beg, LONGINT end, SET sel, Texts_FontsFont fnt, SHORTINT col, SHORTINT voff); +import void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff); import void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len); import void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); import void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); -import void Texts_Delete (Texts_Text T, LONGINT beg, LONGINT end); +import void Texts_Delete (Texts_Text T, int32 beg, int32 end); import Texts_Text Texts_ElemBase (Texts_Elem E); -import LONGINT Texts_ElemPos (Texts_Elem E); -import void Texts_Insert (Texts_Text T, LONGINT pos, Texts_Buffer B); +import int32 Texts_ElemPos (Texts_Elem E); +import void Texts_Insert (Texts_Text T, int32 pos, Texts_Buffer B); import void Texts_Load (Files_Rider *r, LONGINT *r__typ, Texts_Text T); import void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len); import void Texts_OpenBuf (Texts_Buffer B); -import void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, LONGINT pos); -import void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, LONGINT pos); +import void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, int32 pos); +import void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, int32 pos); import void Texts_OpenWriter (Texts_Writer *W, LONGINT *W__typ); -import LONGINT Texts_Pos (Texts_Reader *R, LONGINT *R__typ); +import int32 Texts_Pos (Texts_Reader *R, LONGINT *R__typ); import void Texts_Read (Texts_Reader *R, LONGINT *R__typ, CHAR *ch); import void Texts_ReadElem (Texts_Reader *R, LONGINT *R__typ); import void Texts_ReadPrevElem (Texts_Reader *R, LONGINT *R__typ); import void Texts_Recall (Texts_Buffer *B); -import void Texts_Save (Texts_Text T, LONGINT beg, LONGINT end, Texts_Buffer B); +import void Texts_Save (Texts_Text T, int32 beg, int32 end, Texts_Buffer B); import void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ); -import void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, SHORTINT col); +import void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, int8 col); import void Texts_SetFont (Texts_Writer *W, LONGINT *W__typ, Texts_FontsFont fnt); -import void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, SHORTINT voff); +import void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, int8 voff); import void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T); import void Texts_Write (Texts_Writer *W, LONGINT *W__typ, CHAR ch); -import void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, LONGINT t, LONGINT d); +import void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, int32 t, int32 d); import void Texts_WriteElem (Texts_Writer *W, LONGINT *W__typ, Texts_Elem e); -import void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, LONGINT x); -import void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n); +import void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, int32 x); +import void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int32 x, int32 n); import void Texts_WriteLn (Texts_Writer *W, LONGINT *W__typ); -import void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER n); +import void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, int16 n); import void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x); -import void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n); -import void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n, INTEGER k); +import void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, int16 n); +import void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, int16 n, int16 k); import void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x); import void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__len); import void *Texts__init(void); diff --git a/bootstrap/unix-48/Vishap.c b/bootstrap/unix-48/Vishap.c index 030b94f6..c8f81032 100644 --- a/bootstrap/unix-48/Vishap.c +++ b/bootstrap/unix-48/Vishap.c @@ -20,7 +20,7 @@ static CHAR Vishap_mname[256]; export void Vishap_Module (BOOLEAN *done); static void Vishap_PropagateElementaryTypeSizes (void); export void Vishap_Translate (void); -static void Vishap_Trap (INTEGER sig); +static void Vishap_Trap (int16 sig); void Vishap_Module (BOOLEAN *done) @@ -126,7 +126,7 @@ void Vishap_Translate (void) } } -static void Vishap_Trap (INTEGER sig) +static void Vishap_Trap (int16 sig) { Heap_FINALL(); if (sig == 3) { diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index bfab2dc6..b894b3f9 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -17,7 +17,7 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGINT cmd__len) { - INTEGER r, status, exitcode; + int16 r, status, exitcode; __DUP(title, title__len, CHAR); __DUP(cmd, cmd__len, CHAR); if (OPM_Verbose) { diff --git a/bootstrap/unix-48/vt100.c b/bootstrap/unix-48/vt100.c index 84707926..46a1e460 100644 --- a/bootstrap/unix-48/vt100.c +++ b/bootstrap/unix-48/vt100.c @@ -8,36 +8,36 @@ export CHAR vt100_CSI[5]; static CHAR vt100_tmpstr[32]; -export void vt100_CHA (INTEGER n); -export void vt100_CNL (INTEGER n); -export void vt100_CPL (INTEGER n); -export void vt100_CUB (INTEGER n); -export void vt100_CUD (INTEGER n); -export void vt100_CUF (INTEGER n); -export void vt100_CUP (INTEGER n, INTEGER m); -export void vt100_CUU (INTEGER n); +export void vt100_CHA (int16 n); +export void vt100_CNL (int16 n); +export void vt100_CPL (int16 n); +export void vt100_CUB (int16 n); +export void vt100_CUD (int16 n); +export void vt100_CUF (int16 n); +export void vt100_CUP (int16 n, int16 m); +export void vt100_CUU (int16 n); export void vt100_DECTCEMh (void); export void vt100_DECTCEMl (void); -export void vt100_DSR (INTEGER n); -export void vt100_ED (INTEGER n); -export void vt100_EL (INTEGER n); -static void vt100_EscSeq (INTEGER n, CHAR *letter, LONGINT letter__len); +export void vt100_DSR (int16 n); +export void vt100_ED (int16 n); +export void vt100_EL (int16 n); +static void vt100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len); static void vt100_EscSeq0 (CHAR *letter, LONGINT letter__len); -static void vt100_EscSeq2 (INTEGER n, INTEGER m, CHAR *letter, LONGINT letter__len); -static void vt100_EscSeqSwapped (INTEGER n, CHAR *letter, LONGINT letter__len); -export void vt100_HVP (INTEGER n, INTEGER m); -export void vt100_IntToStr (LONGINT int_, CHAR *str, LONGINT str__len); +static void vt100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len); +static void vt100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len); +export void vt100_HVP (int16 n, int16 m); +export void vt100_IntToStr (int32 int_, CHAR *str, LONGINT str__len); export void vt100_RCP (void); -static void vt100_Reverse0 (CHAR *str, LONGINT str__len, INTEGER start, INTEGER end); +static void vt100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end); export void vt100_SCP (void); -export void vt100_SD (INTEGER n); -export void vt100_SGR (INTEGER n); -export void vt100_SGR2 (INTEGER n, INTEGER m); -export void vt100_SU (INTEGER n); +export void vt100_SD (int16 n); +export void vt100_SGR (int16 n); +export void vt100_SGR2 (int16 n, int16 m); +export void vt100_SU (int16 n); export void vt100_SetAttr (CHAR *attr, LONGINT attr__len); -static void vt100_Reverse0 (CHAR *str, LONGINT str__len, INTEGER start, INTEGER end) +static void vt100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end) { CHAR h; while (start < end) { @@ -49,11 +49,11 @@ static void vt100_Reverse0 (CHAR *str, LONGINT str__len, INTEGER start, INTEGER } } -void vt100_IntToStr (LONGINT int_, CHAR *str, LONGINT str__len) +void vt100_IntToStr (int32 int_, CHAR *str, LONGINT str__len) { CHAR b[21]; - INTEGER s, e; - SHORTINT maxLength; + int16 s, e; + int8 maxLength; maxLength = 11; if (int_ == (-2147483647-1)) { __MOVE("-2147483648", b, 12); @@ -88,7 +88,7 @@ static void vt100_EscSeq0 (CHAR *letter, LONGINT letter__len) __DEL(letter); } -static void vt100_EscSeq (INTEGER n, CHAR *letter, LONGINT letter__len) +static void vt100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len) { CHAR nstr[2]; CHAR cmd[7]; @@ -101,7 +101,7 @@ static void vt100_EscSeq (INTEGER n, CHAR *letter, LONGINT letter__len) __DEL(letter); } -static void vt100_EscSeqSwapped (INTEGER n, CHAR *letter, LONGINT letter__len) +static void vt100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len) { CHAR nstr[2]; CHAR cmd[7]; @@ -114,7 +114,7 @@ static void vt100_EscSeqSwapped (INTEGER n, CHAR *letter, LONGINT letter__len) __DEL(letter); } -static void vt100_EscSeq2 (INTEGER n, INTEGER m, CHAR *letter, LONGINT letter__len) +static void vt100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len) { CHAR nstr[5], mstr[5]; CHAR cmd[12]; @@ -130,82 +130,82 @@ static void vt100_EscSeq2 (INTEGER n, INTEGER m, CHAR *letter, LONGINT letter__l __DEL(letter); } -void vt100_CUU (INTEGER n) +void vt100_CUU (int16 n) { vt100_EscSeq(n, (CHAR*)"A", 2); } -void vt100_CUD (INTEGER n) +void vt100_CUD (int16 n) { vt100_EscSeq(n, (CHAR*)"B", 2); } -void vt100_CUF (INTEGER n) +void vt100_CUF (int16 n) { vt100_EscSeq(n, (CHAR*)"C", 2); } -void vt100_CUB (INTEGER n) +void vt100_CUB (int16 n) { vt100_EscSeq(n, (CHAR*)"D", 2); } -void vt100_CNL (INTEGER n) +void vt100_CNL (int16 n) { vt100_EscSeq(n, (CHAR*)"E", 2); } -void vt100_CPL (INTEGER n) +void vt100_CPL (int16 n) { vt100_EscSeq(n, (CHAR*)"F", 2); } -void vt100_CHA (INTEGER n) +void vt100_CHA (int16 n) { vt100_EscSeq(n, (CHAR*)"G", 2); } -void vt100_CUP (INTEGER n, INTEGER m) +void vt100_CUP (int16 n, int16 m) { vt100_EscSeq2(n, m, (CHAR*)"H", 2); } -void vt100_ED (INTEGER n) +void vt100_ED (int16 n) { vt100_EscSeq(n, (CHAR*)"J", 2); } -void vt100_EL (INTEGER n) +void vt100_EL (int16 n) { vt100_EscSeq(n, (CHAR*)"K", 2); } -void vt100_SU (INTEGER n) +void vt100_SU (int16 n) { vt100_EscSeq(n, (CHAR*)"S", 2); } -void vt100_SD (INTEGER n) +void vt100_SD (int16 n) { vt100_EscSeq(n, (CHAR*)"T", 2); } -void vt100_HVP (INTEGER n, INTEGER m) +void vt100_HVP (int16 n, int16 m) { vt100_EscSeq2(n, m, (CHAR*)"f", 2); } -void vt100_SGR (INTEGER n) +void vt100_SGR (int16 n) { vt100_EscSeq(n, (CHAR*)"m", 2); } -void vt100_SGR2 (INTEGER n, INTEGER m) +void vt100_SGR2 (int16 n, int16 m) { vt100_EscSeq2(n, m, (CHAR*)"m", 2); } -void vt100_DSR (INTEGER n) +void vt100_DSR (int16 n) { vt100_EscSeq(6, (CHAR*)"n", 2); } diff --git a/bootstrap/unix-48/vt100.h b/bootstrap/unix-48/vt100.h index 6266a678..ad1ac948 100644 --- a/bootstrap/unix-48/vt100.h +++ b/bootstrap/unix-48/vt100.h @@ -9,27 +9,27 @@ import CHAR vt100_CSI[5]; -import void vt100_CHA (INTEGER n); -import void vt100_CNL (INTEGER n); -import void vt100_CPL (INTEGER n); -import void vt100_CUB (INTEGER n); -import void vt100_CUD (INTEGER n); -import void vt100_CUF (INTEGER n); -import void vt100_CUP (INTEGER n, INTEGER m); -import void vt100_CUU (INTEGER n); +import void vt100_CHA (int16 n); +import void vt100_CNL (int16 n); +import void vt100_CPL (int16 n); +import void vt100_CUB (int16 n); +import void vt100_CUD (int16 n); +import void vt100_CUF (int16 n); +import void vt100_CUP (int16 n, int16 m); +import void vt100_CUU (int16 n); import void vt100_DECTCEMh (void); import void vt100_DECTCEMl (void); -import void vt100_DSR (INTEGER n); -import void vt100_ED (INTEGER n); -import void vt100_EL (INTEGER n); -import void vt100_HVP (INTEGER n, INTEGER m); -import void vt100_IntToStr (LONGINT int_, CHAR *str, LONGINT str__len); +import void vt100_DSR (int16 n); +import void vt100_ED (int16 n); +import void vt100_EL (int16 n); +import void vt100_HVP (int16 n, int16 m); +import void vt100_IntToStr (int32 int_, CHAR *str, LONGINT str__len); import void vt100_RCP (void); import void vt100_SCP (void); -import void vt100_SD (INTEGER n); -import void vt100_SGR (INTEGER n); -import void vt100_SGR2 (INTEGER n, INTEGER m); -import void vt100_SU (INTEGER n); +import void vt100_SD (int16 n); +import void vt100_SGR (int16 n); +import void vt100_SGR2 (int16 n, int16 m); +import void vt100_SU (int16 n); import void vt100_SetAttr (CHAR *attr, LONGINT attr__len); import void *vt100__init(void); diff --git a/bootstrap/unix-88/Console.c b/bootstrap/unix-88/Console.c index d884a64a..b4cd60d3 100644 --- a/bootstrap/unix-88/Console.c +++ b/bootstrap/unix-88/Console.c @@ -5,14 +5,14 @@ static CHAR Console_line[128]; -static INTEGER Console_pos; +static int32 Console_pos; export void Console_Bool (BOOLEAN b); export void Console_Char (CHAR ch); export void Console_Flush (void); -export void Console_Hex (LONGINT i); -export void Console_Int (LONGINT i, LONGINT n); +export void Console_Hex (int64 i); +export void Console_Int (int64 i, int64 n); export void Console_Ln (void); export void Console_Read (CHAR *ch); export void Console_ReadLine (CHAR *line, LONGINT line__len); @@ -21,7 +21,7 @@ export void Console_String (CHAR *s, LONGINT s__len); void Console_Flush (void) { - INTEGER error; + int32 error; error = Platform_Write(1, (SYSTEM_ADRINT)Console_line, Console_pos); Console_pos = 0; } @@ -40,7 +40,7 @@ void Console_Char (CHAR ch) void Console_String (CHAR *s, LONGINT s__len) { - INTEGER i; + int32 i; __DUP(s, s__len, CHAR); i = 0; while (s[__X(i, s__len)] != 0x00) { @@ -50,11 +50,11 @@ void Console_String (CHAR *s, LONGINT s__len) __DEL(s); } -void Console_Int (LONGINT i, LONGINT n) +void Console_Int (int64 i, int64 n) { CHAR s[32]; - LONGINT i1, k; - if (i == __LSHL(1, 63, LONGINT)) { + int64 i1, k; + if (i == __LSHL(1, 63, int64)) { __MOVE("8085774586302733229", s, 20); k = 19; } else { @@ -96,9 +96,9 @@ void Console_Bool (BOOLEAN b) } } -void Console_Hex (LONGINT i) +void Console_Hex (int64 i) { - LONGINT k, n; + int64 k, n; k = -28; while (k <= 0) { n = __MASK(__ASH(i, k), -16); @@ -113,8 +113,8 @@ void Console_Hex (LONGINT i) void Console_Read (CHAR *ch) { - LONGINT n; - INTEGER error; + int64 n; + int32 error; Console_Flush(); error = Platform_ReadBuf(0, (void*)&*ch, 1, &n); if (n != 1) { @@ -124,7 +124,7 @@ void Console_Read (CHAR *ch) void Console_ReadLine (CHAR *line, LONGINT line__len) { - LONGINT i; + int64 i; CHAR ch; Console_Flush(); i = 0; diff --git a/bootstrap/unix-88/Console.h b/bootstrap/unix-88/Console.h index 8d9e2fb5..987b5478 100644 --- a/bootstrap/unix-88/Console.h +++ b/bootstrap/unix-88/Console.h @@ -12,8 +12,8 @@ import void Console_Bool (BOOLEAN b); import void Console_Char (CHAR ch); import void Console_Flush (void); -import void Console_Hex (LONGINT i); -import void Console_Int (LONGINT i, LONGINT n); +import void Console_Hex (int64 i); +import void Console_Int (int64 i, int64 n); import void Console_Ln (void); import void Console_Read (CHAR *ch); import void Console_ReadLine (CHAR *line, LONGINT line__len); diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 67a7a958..9ce98932 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -14,7 +14,7 @@ typedef struct Files_BufDesc { Files_File f; BOOLEAN chg; - LONGINT org, size; + int64 org, size; SYSTEM_BYTE data[4096]; } Files_BufDesc; @@ -29,23 +29,23 @@ typedef Files_FileName workName, registerName; BOOLEAN tempFile; Platform_FileIdentity identity; - LONGINT fd, len, pos; + int64 fd, len, pos; Files_Buffer bufs[4]; - INTEGER swapper, state; + int32 swapper, state; Files_File next; } Files_FileDesc; typedef struct Files_Rider { - LONGINT res; + int64 res; BOOLEAN eof; Files_Buffer buf; - LONGINT org, offset; + int64 org, offset; } Files_Rider; static Files_File Files_files; -static INTEGER Files_tempno; +static int32 Files_tempno; static CHAR Files_HOME[1024]; static struct { LONGINT len[1]; @@ -58,56 +58,56 @@ export LONGINT *Files_Rider__typ; export Files_File Files_Base (Files_Rider *r, LONGINT *r__typ); static Files_File Files_CacheEntry (Platform_FileIdentity identity); -export void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INTEGER *res); +export void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int32 *res); export void Files_Close (Files_File f); static void Files_CloseOSFile (Files_File f); static void Files_Create (Files_File f); -export void Files_Delete (CHAR *name, LONGINT name__len, INTEGER *res); -static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INTEGER errcode); +export void Files_Delete (CHAR *name, LONGINT name__len, int32 *res); +static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int32 errcode); static void Files_Finalize (SYSTEM_PTR o); static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *dest, LONGINT dest__len); static void Files_Flush (Files_Buffer buf); -export void Files_GetDate (Files_File f, LONGINT *t, LONGINT *d); +export void Files_GetDate (Files_File f, int64 *t, int64 *d); export void Files_GetName (Files_File f, CHAR *name, LONGINT name__len); static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *name, LONGINT name__len); static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len); -export LONGINT Files_Length (Files_File f); +export int64 Files_Length (Files_File f); static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT name__len, CHAR *dest, LONGINT dest__len); export Files_File Files_New (CHAR *name, LONGINT name__len); export Files_File Files_Old (CHAR *name, LONGINT name__len); -export LONGINT Files_Pos (Files_Rider *r, LONGINT *r__typ); +export int64 Files_Pos (Files_Rider *r, LONGINT *r__typ); export void Files_Purge (Files_File f); export void Files_Read (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x); export void Files_ReadBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN *x); export void Files_ReadByte (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len); -export void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, LONGINT n); -export void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, INTEGER *x); -export void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, LONGINT *x); +export void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int64 n); +export void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, int32 *x); +export void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, int64 *x); export void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x); export void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); -export void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, LONGINT *x); +export void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int64 *x); export void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x); export void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x); export void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); export void Files_Register (Files_File f); -export void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INTEGER *res); -static void Files_ScanPath (INTEGER *pos, CHAR *dir, LONGINT dir__len); -export void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, LONGINT pos); +export void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int32 *res); +static void Files_ScanPath (int32 *pos, CHAR *dir, LONGINT dir__len); +export void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, int64 pos); export void Files_SetSearchPath (CHAR *path, LONGINT path__len); export void Files_Write (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE x); export void Files_WriteBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN x); -export void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, LONGINT n); -export void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, INTEGER x); -export void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, LONGINT x); +export void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int64 n); +export void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, int32 x); +export void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, int64 x); export void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x); -export void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, LONGINT x); +export void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int64 x); export void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x); export void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x); export void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); #define Files_IdxTrap() __HALT(-1) -static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INTEGER errcode) +static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int32 errcode) { __DUP(s, s__len, CHAR); Console_Ln(); @@ -136,7 +136,7 @@ static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INTEGER errcode) static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT name__len, CHAR *dest, LONGINT dest__len) { - INTEGER i, j; + int32 i, j; __DUP(dir, dir__len, CHAR); __DUP(name, name__len, CHAR); i = 0; @@ -161,7 +161,7 @@ static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *name, LONGINT name__len) { - LONGINT n, i, j; + int64 n, i, j; __DUP(finalName, finalName__len, CHAR); Files_tempno += 1; n = Files_tempno; @@ -213,7 +213,7 @@ static void Files_Create (Files_File f) { Platform_FileIdentity identity; BOOLEAN done; - INTEGER error; + int32 error; CHAR err[32]; if (f->fd == -1) { if (f->state == 1) { @@ -250,7 +250,7 @@ static void Files_Create (Files_File f) static void Files_Flush (Files_Buffer buf) { - INTEGER error; + int32 error; Files_File f = NIL; if (buf->chg) { f = buf->f; @@ -274,7 +274,7 @@ static void Files_Flush (Files_Buffer buf) static void Files_CloseOSFile (Files_File f) { Files_File prev = NIL; - INTEGER error; + int32 error; if (Files_files == f) { Files_files = f->next; } else { @@ -294,8 +294,8 @@ static void Files_CloseOSFile (Files_File f) void Files_Close (Files_File f) { - LONGINT i; - INTEGER error; + int64 i; + int32 error; if (f->state != 1 || f->registerName[0] != 0x00) { Files_Create(f); i = 0; @@ -311,9 +311,9 @@ void Files_Close (Files_File f) } } -LONGINT Files_Length (Files_File f) +int64 Files_Length (Files_File f) { - LONGINT _o_result; + int64 _o_result; _o_result = f->len; return _o_result; } @@ -336,9 +336,9 @@ Files_File Files_New (CHAR *name, LONGINT name__len) return _o_result; } -static void Files_ScanPath (INTEGER *pos, CHAR *dir, LONGINT dir__len) +static void Files_ScanPath (int32 *pos, CHAR *dir, LONGINT dir__len) { - INTEGER i; + int32 i; CHAR ch; i = 0; if (Files_SearchPath == NIL) { @@ -382,7 +382,7 @@ static void Files_ScanPath (INTEGER *pos, CHAR *dir, LONGINT dir__len) static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len) { BOOLEAN _o_result; - INTEGER i; + int32 i; CHAR ch; i = 0; ch = name[0]; @@ -398,7 +398,7 @@ static Files_File Files_CacheEntry (Platform_FileIdentity identity) { Files_File _o_result; Files_File f = NIL; - INTEGER i, error; + int32 i, error; f = Files_files; while (f != NIL) { if (Platform_SameFile(identity, f->identity)) { @@ -428,11 +428,11 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) { Files_File _o_result; Files_File f = NIL; - LONGINT fd; - INTEGER pos; + int64 fd; + int32 pos; BOOLEAN done; CHAR dir[256], path[256]; - INTEGER error; + int32 error; Platform_FileIdentity identity; __DUP(name, name__len, CHAR); if (name[0] != 0x00) { @@ -507,9 +507,9 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) void Files_Purge (Files_File f) { - INTEGER i; + int32 i; Platform_FileIdentity identity; - INTEGER error; + int32 error; i = 0; while (i < 4) { if (f->bufs[i] != NIL) { @@ -529,27 +529,27 @@ void Files_Purge (Files_File f) Platform_SetMTime(&f->identity, Platform_FileIdentity__typ, identity); } -void Files_GetDate (Files_File f, LONGINT *t, LONGINT *d) +void Files_GetDate (Files_File f, int64 *t, int64 *d) { Platform_FileIdentity identity; - INTEGER error; + int32 error; Files_Create(f); error = Platform_Identify(f->fd, &identity, Platform_FileIdentity__typ); Platform_MTimeAsClock(identity, &*t, &*d); } -LONGINT Files_Pos (Files_Rider *r, LONGINT *r__typ) +int64 Files_Pos (Files_Rider *r, LONGINT *r__typ) { - LONGINT _o_result; + int64 _o_result; _o_result = (*r).org + (*r).offset; return _o_result; } -void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, LONGINT pos) +void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, int64 pos) { - LONGINT org, offset, i, n; + int64 org, offset, i, n; Files_Buffer buf = NIL; - INTEGER error; + int32 error; if (f != NIL) { if (pos > f->len) { pos = f->len; @@ -609,7 +609,7 @@ void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, LONGINT pos) void Files_Read (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x) { - LONGINT offset; + int64 offset; Files_Buffer buf = NIL; buf = (*r).buf; offset = (*r).offset; @@ -631,9 +631,9 @@ void Files_Read (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x) } } -void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, LONGINT n) +void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int64 n) { - LONGINT xpos, min, restInBuf, offset; + int64 xpos, min, restInBuf, offset; Files_Buffer buf = NIL; if (n > x__len) { Files_IdxTrap(); @@ -682,7 +682,7 @@ Files_File Files_Base (Files_Rider *r, LONGINT *r__typ) void Files_Write (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE x) { Files_Buffer buf = NIL; - LONGINT offset; + int64 offset; buf = (*r).buf; offset = (*r).offset; if ((*r).org != buf->org || offset >= 4096) { @@ -700,9 +700,9 @@ void Files_Write (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE x) (*r).res = 0; } -void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, LONGINT n) +void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int64 n) { - LONGINT xpos, min, restInBuf, offset; + int64 xpos, min, restInBuf, offset; Files_Buffer buf = NIL; if (n > x__len) { Files_IdxTrap(); @@ -736,17 +736,17 @@ void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT (*r).res = 0; } -void Files_Delete (CHAR *name, LONGINT name__len, INTEGER *res) +void Files_Delete (CHAR *name, LONGINT name__len, int32 *res) { __DUP(name, name__len, CHAR); *res = Platform_Unlink((void*)name, name__len); __DEL(name); } -void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INTEGER *res) +void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int32 *res) { - LONGINT fdold, fdnew, n; - INTEGER error, ignore; + int64 fdold, fdnew, n; + int32 error, ignore; Platform_FileIdentity oldidentity, newidentity; CHAR buf[4096]; __DUP(old, old__len, CHAR); @@ -801,7 +801,7 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT void Files_Register (Files_File f) { - INTEGER idx, errcode; + int32 idx, errcode; Files_File f1 = NIL; CHAR file[104]; if ((f->state == 1 && f->registerName[0] != 0x00)) { @@ -820,7 +820,7 @@ void Files_Register (Files_File f) } } -void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INTEGER *res) +void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int32 *res) { __DUP(path, path__len, CHAR); *res = Platform_Chdir((void*)path, path__len); @@ -829,7 +829,7 @@ void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INTEGER *res) static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *dest, LONGINT dest__len) { - LONGINT i, j; + int64 i, j; if (!Platform_LittleEndian) { i = src__len; j = 0; @@ -848,14 +848,14 @@ void Files_ReadBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN *x) Files_Read(&*R, R__typ, (CHAR*)(void*)&*x); } -void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, INTEGER *x) +void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, int32 *x) { CHAR b[2]; Files_ReadBytes(&*R, R__typ, (void*)b, 2, 2); *x = b[0] + __ASHL(b[1], 8); } -void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, LONGINT *x) +void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, int64 *x) { CHAR b[4]; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); @@ -865,7 +865,7 @@ void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, LONGINT *x) void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x) { CHAR b[4]; - LONGINT l; + int64 l; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); l = ((b[0] + __ASHL(b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); *x = (SET)l; @@ -887,7 +887,7 @@ void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x) void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) { - INTEGER i; + int32 i; CHAR ch; i = 0; do { @@ -899,7 +899,7 @@ void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) { - INTEGER i; + int32 i; CHAR ch; BOOLEAN b; i = 0; @@ -915,20 +915,20 @@ void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) } while (!b); } -void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, LONGINT *x) +void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int64 *x) { - SHORTINT s; + int8 s; CHAR ch; - LONGINT n; + int64 n; s = 0; n = 0; Files_Read(&*R, R__typ, (void*)&ch); while (ch >= 128) { - n += __ASH((SYSTEM_INT64)(ch - 128), s); + n += __ASH((int64)(ch - 128), s); s += 7; Files_Read(&*R, R__typ, (void*)&ch); } - n += __ASH((SYSTEM_INT64)(__MASK(ch, -64) - __ASHL(__ASHR(ch, 6), 6)), s); + n += __ASH((int64)(__MASK(ch, -64) - __ASHL(__ASHR(ch, 6), 6)), s); *x = n; } @@ -937,7 +937,7 @@ void Files_WriteBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN x) Files_Write(&*R, R__typ, __VAL(CHAR, x)); } -void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, INTEGER x) +void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, int32 x) { CHAR b[2]; b[0] = (CHAR)x; @@ -945,7 +945,7 @@ void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, INTEGER x) Files_WriteBytes(&*R, R__typ, (void*)b, 2, 2); } -void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, LONGINT x) +void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, int64 x) { CHAR b[4]; b[0] = (CHAR)x; @@ -958,8 +958,8 @@ void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, LONGINT x) void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x) { CHAR b[4]; - LONGINT i; - i = (LONGINT)x; + int64 i; + i = (int64)x; b[0] = (CHAR)i; b[1] = (CHAR)__ASHR(i, 8); b[2] = (CHAR)__ASHR(i, 16); @@ -983,7 +983,7 @@ void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x) void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) { - INTEGER i; + int32 i; i = 0; while (x[i] != 0x00) { i += 1; @@ -991,7 +991,7 @@ void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len Files_WriteBytes(&*R, R__typ, (void*)x, x__len * 1, i + 1); } -void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, LONGINT x) +void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int64 x) { while (x < -64 || x > 63) { Files_Write(&*R, R__typ, (CHAR)(__MASK(x, -128) + 128)); @@ -1008,7 +1008,7 @@ void Files_GetName (Files_File f, CHAR *name, LONGINT name__len) static void Files_Finalize (SYSTEM_PTR o) { Files_File f = NIL; - LONGINT res; + int64 res; f = (Files_File)(SYSTEM_ADRINT)o; if (f->fd >= 0) { Files_CloseOSFile(f); diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 3be486fe..dee1234e 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -12,13 +12,13 @@ typedef typedef struct Files_FileDesc { char _prvt0[232]; - LONGINT fd; + int64 fd; char _prvt1[64]; } Files_FileDesc; typedef struct Files_Rider { - LONGINT res; + int64 res; BOOLEAN eof; char _prvt0[31]; } Files_Rider; @@ -29,39 +29,39 @@ import LONGINT *Files_FileDesc__typ; import LONGINT *Files_Rider__typ; import Files_File Files_Base (Files_Rider *r, LONGINT *r__typ); -import void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INTEGER *res); +import void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int32 *res); import void Files_Close (Files_File f); -import void Files_Delete (CHAR *name, LONGINT name__len, INTEGER *res); -import void Files_GetDate (Files_File f, LONGINT *t, LONGINT *d); +import void Files_Delete (CHAR *name, LONGINT name__len, int32 *res); +import void Files_GetDate (Files_File f, int64 *t, int64 *d); import void Files_GetName (Files_File f, CHAR *name, LONGINT name__len); -import LONGINT Files_Length (Files_File f); +import int64 Files_Length (Files_File f); import Files_File Files_New (CHAR *name, LONGINT name__len); import Files_File Files_Old (CHAR *name, LONGINT name__len); -import LONGINT Files_Pos (Files_Rider *r, LONGINT *r__typ); +import int64 Files_Pos (Files_Rider *r, LONGINT *r__typ); import void Files_Purge (Files_File f); import void Files_Read (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x); import void Files_ReadBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN *x); import void Files_ReadByte (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len); -import void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, LONGINT n); -import void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, INTEGER *x); -import void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, LONGINT *x); +import void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int64 n); +import void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, int32 *x); +import void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, int64 *x); import void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x); import void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); -import void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, LONGINT *x); +import void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int64 *x); import void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x); import void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x); import void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); import void Files_Register (Files_File f); -import void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INTEGER *res); -import void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, LONGINT pos); +import void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int32 *res); +import void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, int64 pos); import void Files_SetSearchPath (CHAR *path, LONGINT path__len); import void Files_Write (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE x); import void Files_WriteBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN x); -import void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, LONGINT n); -import void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, INTEGER x); -import void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, LONGINT x); +import void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int64 n); +import void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, int32 x); +import void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, int64 x); import void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x); -import void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, LONGINT x); +import void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int64 x); import void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x); import void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x); import void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index 5822f690..e96f7807 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -35,7 +35,7 @@ typedef typedef struct Heap_FinDesc { Heap_FinNode next; - LONGINT obj; + int64 obj; BOOLEAN marked; Heap_Finalizer finalize; } Heap_FinDesc; @@ -50,25 +50,25 @@ typedef struct Heap_ModuleDesc { Heap_Module next; Heap_ModuleName name; - LONGINT refcnt; + int64 refcnt; Heap_Cmd cmds; - LONGINT types; + int64 types; Heap_EnumProc enumPtrs; - LONGINT reserved1, reserved2; + int64 reserved1, reserved2; } Heap_ModuleDesc; export SYSTEM_PTR Heap_modules; -static LONGINT Heap_freeList[10]; -static LONGINT Heap_bigBlocks; -export LONGINT Heap_allocated; +static int64 Heap_freeList[10]; +static int64 Heap_bigBlocks; +export int64 Heap_allocated; static BOOLEAN Heap_firstTry; -static LONGINT Heap_heap, Heap_heapend; -export LONGINT Heap_heapsize; +static int64 Heap_heap, Heap_heapend; +export int64 Heap_heapsize; static Heap_FinNode Heap_fin; -static INTEGER Heap_lockdepth; +static int32 Heap_lockdepth; static BOOLEAN Heap_interrupted; -export INTEGER Heap_FileCount; +export int32 Heap_FileCount; export LONGINT *Heap_ModuleDesc__typ; export LONGINT *Heap_CmdDesc__typ; @@ -76,27 +76,27 @@ export LONGINT *Heap_FinDesc__typ; export LONGINT *Heap__1__typ; static void Heap_CheckFin (void); -static void Heap_ExtendHeap (LONGINT blksz); +static void Heap_ExtendHeap (int64 blksz); export void Heap_FINALL (void); static void Heap_Finalize (void); export void Heap_GC (BOOLEAN markStack); -static void Heap_HeapSort (LONGINT n, LONGINT *a, LONGINT a__len); +static void Heap_HeapSort (int64 n, int64 *a, LONGINT a__len); export void Heap_INCREF (Heap_Module m); export void Heap_InitHeap (void); export void Heap_Lock (void); -static void Heap_Mark (LONGINT q); -static void Heap_MarkCandidates (LONGINT n, LONGINT *cand, LONGINT cand__len); +static void Heap_Mark (int64 q); +static void Heap_MarkCandidates (int64 n, int64 *cand, LONGINT cand__len); static void Heap_MarkP (SYSTEM_PTR p); -static void Heap_MarkStack (LONGINT n, LONGINT *cand, LONGINT cand__len); -export SYSTEM_PTR Heap_NEWBLK (LONGINT size); -export SYSTEM_PTR Heap_NEWREC (LONGINT tag); -static LONGINT Heap_NewChunk (LONGINT blksz); +static void Heap_MarkStack (int64 n, int64 *cand, LONGINT cand__len); +export SYSTEM_PTR Heap_NEWBLK (int64 size); +export SYSTEM_PTR Heap_NEWREC (int64 tag); +static int64 Heap_NewChunk (int64 blksz); export void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); export SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -export void Heap_REGTYP (Heap_Module m, LONGINT typ); +export void Heap_REGTYP (Heap_Module m, int64 typ); export void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); static void Heap_Scan (void); -static void Heap_Sift (LONGINT l, LONGINT r, LONGINT *a, LONGINT a__len); +static void Heap_Sift (int64 l, int64 r, int64 *a, LONGINT a__len); export void Heap_Unlock (void); extern void *Heap__init(); @@ -155,9 +155,9 @@ void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) m->cmds = c; } -void Heap_REGTYP (Heap_Module m, LONGINT typ) +void Heap_REGTYP (Heap_Module m, int64 typ) { - __PUT(typ, m->types, LONGINT); + __PUT(typ, m->types, int64); m->types = typ; } @@ -166,17 +166,17 @@ void Heap_INCREF (Heap_Module m) m->refcnt += 1; } -static LONGINT Heap_NewChunk (LONGINT blksz) +static int64 Heap_NewChunk (int64 blksz) { - LONGINT _o_result; - LONGINT chnk; + int64 _o_result; + int64 chnk; chnk = Heap_OSAllocate(blksz + 24); if (chnk != 0) { - __PUT(chnk + 8, chnk + (24 + blksz), LONGINT); - __PUT(chnk + 24, chnk + 32, LONGINT); - __PUT(chnk + 32, blksz, LONGINT); - __PUT(chnk + 40, -8, LONGINT); - __PUT(chnk + 48, Heap_bigBlocks, LONGINT); + __PUT(chnk + 8, chnk + (24 + blksz), int64); + __PUT(chnk + 24, chnk + 32, int64); + __PUT(chnk + 32, blksz, int64); + __PUT(chnk + 40, -8, int64); + __PUT(chnk + 48, Heap_bigBlocks, int64); Heap_bigBlocks = chnk + 24; Heap_heapsize += blksz; } @@ -184,9 +184,9 @@ static LONGINT Heap_NewChunk (LONGINT blksz) return _o_result; } -static void Heap_ExtendHeap (LONGINT blksz) +static void Heap_ExtendHeap (int64 blksz) { - LONGINT size, chnk, j, next; + int64 size, chnk, j, next; if (blksz > 320000) { size = blksz; } else { @@ -195,7 +195,7 @@ static void Heap_ExtendHeap (LONGINT blksz) chnk = Heap_NewChunk(size); if (chnk != 0) { if (chnk < Heap_heap) { - __PUT(chnk, Heap_heap, LONGINT); + __PUT(chnk, Heap_heap, int64); Heap_heap = chnk; } else { j = Heap_heap; @@ -204,8 +204,8 @@ static void Heap_ExtendHeap (LONGINT blksz) j = next; next = Heap_FetchAddress(j); } - __PUT(chnk, next, LONGINT); - __PUT(j, chnk, LONGINT); + __PUT(chnk, next, int64); + __PUT(j, chnk, int64); } if (next == 0) { Heap_heapend = Heap_FetchAddress(chnk + 8); @@ -213,10 +213,10 @@ static void Heap_ExtendHeap (LONGINT blksz) } } -SYSTEM_PTR Heap_NEWREC (LONGINT tag) +SYSTEM_PTR Heap_NEWREC (int64 tag) { SYSTEM_PTR _o_result; - LONGINT i, i0, di, blksz, restsize, t, adr, end, next, prev; + int64 i, i0, di, blksz, restsize, t, adr, end, next, prev; SYSTEM_PTR new; Heap_Lock(); blksz = Heap_FetchAddress(tag); @@ -236,11 +236,11 @@ SYSTEM_PTR Heap_NEWREC (LONGINT tag) di = i - i0; restsize = __ASHL(di, 5); end = adr + restsize; - __PUT(end + 8, blksz, LONGINT); - __PUT(end + 16, -8, LONGINT); - __PUT(end, end + 8, LONGINT); - __PUT(adr + 8, restsize, LONGINT); - __PUT(adr + 24, Heap_freeList[di], LONGINT); + __PUT(end + 8, blksz, int64); + __PUT(end + 16, -8, int64); + __PUT(end, end + 8, int64); + __PUT(adr + 8, restsize, int64); + __PUT(adr + 24, Heap_freeList[di], int64); Heap_freeList[di] = adr; adr += restsize; } @@ -280,22 +280,22 @@ SYSTEM_PTR Heap_NEWREC (LONGINT tag) } restsize = t - blksz; end = adr + restsize; - __PUT(end + 8, blksz, LONGINT); - __PUT(end + 16, -8, LONGINT); - __PUT(end, end + 8, LONGINT); + __PUT(end + 8, blksz, int64); + __PUT(end + 16, -8, int64); + __PUT(end, end + 8, int64); if (restsize > 288) { - __PUT(adr + 8, restsize, LONGINT); + __PUT(adr + 8, restsize, int64); } else { next = Heap_FetchAddress(adr + 24); if (prev == 0) { Heap_bigBlocks = next; } else { - __PUT(prev + 24, next, LONGINT); + __PUT(prev + 24, next, int64); } if (restsize > 0) { di = __ASHR(restsize, 5); - __PUT(adr + 8, restsize, LONGINT); - __PUT(adr + 24, Heap_freeList[di], LONGINT); + __PUT(adr + 8, restsize, int64); + __PUT(adr + 24, Heap_freeList[di], int64); Heap_freeList[di] = adr; } } @@ -304,53 +304,53 @@ SYSTEM_PTR Heap_NEWREC (LONGINT tag) i = adr + 32; end = adr + blksz; while (i < end) { - __PUT(i, 0, LONGINT); - __PUT(i + 8, 0, LONGINT); - __PUT(i + 16, 0, LONGINT); - __PUT(i + 24, 0, LONGINT); + __PUT(i, 0, int64); + __PUT(i + 8, 0, int64); + __PUT(i + 16, 0, int64); + __PUT(i + 24, 0, int64); i += 32; } - __PUT(adr + 24, 0, LONGINT); - __PUT(adr, tag, LONGINT); - __PUT(adr + 8, 0, LONGINT); - __PUT(adr + 16, 0, LONGINT); + __PUT(adr + 24, 0, int64); + __PUT(adr, tag, int64); + __PUT(adr + 8, 0, int64); + __PUT(adr + 16, 0, int64); Heap_allocated += blksz; Heap_Unlock(); _o_result = (SYSTEM_PTR)(SYSTEM_ADRINT)(adr + 8); return _o_result; } -SYSTEM_PTR Heap_NEWBLK (LONGINT size) +SYSTEM_PTR Heap_NEWBLK (int64 size) { SYSTEM_PTR _o_result; - LONGINT blksz, tag; + int64 blksz, tag; SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 63, 5), 5); new = Heap_NEWREC((SYSTEM_ADRINT)&blksz); - tag = ((LONGINT)(SYSTEM_ADRINT)new + blksz) - 24; - __PUT(tag - 8, 0, LONGINT); - __PUT(tag, blksz, LONGINT); - __PUT(tag + 8, -8, LONGINT); - __PUT((LONGINT)(SYSTEM_ADRINT)new - 8, tag, LONGINT); + tag = ((int64)(SYSTEM_ADRINT)new + blksz) - 24; + __PUT(tag - 8, 0, int64); + __PUT(tag, blksz, int64); + __PUT(tag + 8, -8, int64); + __PUT((int64)(SYSTEM_ADRINT)new - 8, tag, int64); Heap_Unlock(); _o_result = new; return _o_result; } -static void Heap_Mark (LONGINT q) +static void Heap_Mark (int64 q) { - LONGINT p, tag, fld, n, offset, tagbits; + int64 p, tag, fld, n, offset, tagbits; if (q != 0) { tagbits = Heap_FetchAddress(q - 8); if (!__ODD(tagbits)) { - __PUT(q - 8, tagbits + 1, LONGINT); + __PUT(q - 8, tagbits + 1, int64); p = 0; tag = tagbits + 8; for (;;) { - __GET(tag, offset, LONGINT); + __GET(tag, offset, int64); if (offset < 0) { - __PUT(q - 8, (tag + offset) + 1, LONGINT); + __PUT(q - 8, (tag + offset) + 1, int64); if (p == 0) { break; } @@ -358,7 +358,7 @@ static void Heap_Mark (LONGINT q) q = p; tag = Heap_FetchAddress(q - 8); tag -= 1; - __GET(tag, offset, LONGINT); + __GET(tag, offset, int64); fld = q + offset; p = Heap_FetchAddress(fld); __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)n, SYSTEM_PTR); @@ -368,8 +368,8 @@ static void Heap_Mark (LONGINT q) if (n != 0) { tagbits = Heap_FetchAddress(n - 8); if (!__ODD(tagbits)) { - __PUT(n - 8, tagbits + 1, LONGINT); - __PUT(q - 8, tag + 1, LONGINT); + __PUT(n - 8, tagbits + 1, int64); + __PUT(q - 8, tag + 1, int64); __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)p, SYSTEM_PTR); p = q; q = n; @@ -385,12 +385,12 @@ static void Heap_Mark (LONGINT q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((LONGINT)(SYSTEM_ADRINT)p); + Heap_Mark((int64)(SYSTEM_ADRINT)p); } static void Heap_Scan (void) { - LONGINT chnk, adr, end, start, tag, i, size, freesize; + int64 chnk, adr, end, start, tag, i, size, freesize; Heap_bigBlocks = 0; i = 1; while (i < 9) { @@ -408,21 +408,21 @@ static void Heap_Scan (void) if (__ODD(tag)) { if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 8, LONGINT); - __PUT(start + 8, freesize, LONGINT); - __PUT(start + 16, -8, LONGINT); + __PUT(start, start + 8, int64); + __PUT(start + 8, freesize, int64); + __PUT(start + 16, -8, int64); i = __ASHR(freesize, 5); freesize = 0; if (i < 9) { - __PUT(start + 24, Heap_freeList[i], LONGINT); + __PUT(start + 24, Heap_freeList[i], int64); Heap_freeList[i] = start; } else { - __PUT(start + 24, Heap_bigBlocks, LONGINT); + __PUT(start + 24, Heap_bigBlocks, int64); Heap_bigBlocks = start; } } tag -= 1; - __PUT(adr, tag, LONGINT); + __PUT(adr, tag, int64); size = Heap_FetchAddress(tag); Heap_allocated += size; adr += size; @@ -434,16 +434,16 @@ static void Heap_Scan (void) } if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 8, LONGINT); - __PUT(start + 8, freesize, LONGINT); - __PUT(start + 16, -8, LONGINT); + __PUT(start, start + 8, int64); + __PUT(start + 8, freesize, int64); + __PUT(start + 16, -8, int64); i = __ASHR(freesize, 5); freesize = 0; if (i < 9) { - __PUT(start + 24, Heap_freeList[i], LONGINT); + __PUT(start + 24, Heap_freeList[i], int64); Heap_freeList[i] = start; } else { - __PUT(start + 24, Heap_bigBlocks, LONGINT); + __PUT(start + 24, Heap_bigBlocks, int64); Heap_bigBlocks = start; } } @@ -451,9 +451,9 @@ static void Heap_Scan (void) } } -static void Heap_Sift (LONGINT l, LONGINT r, LONGINT *a, LONGINT a__len) +static void Heap_Sift (int64 l, int64 r, int64 *a, LONGINT a__len) { - LONGINT i, j, x; + int64 i, j, x; j = l; x = a[j]; for (;;) { @@ -470,9 +470,9 @@ static void Heap_Sift (LONGINT l, LONGINT r, LONGINT *a, LONGINT a__len) a[i] = x; } -static void Heap_HeapSort (LONGINT n, LONGINT *a, LONGINT a__len) +static void Heap_HeapSort (int64 n, int64 *a, LONGINT a__len) { - LONGINT l, r, x; + int64 l, r, x; l = __ASHR(n, 1); r = n - 1; while (l > 0) { @@ -488,9 +488,9 @@ static void Heap_HeapSort (LONGINT n, LONGINT *a, LONGINT a__len) } } -static void Heap_MarkCandidates (LONGINT n, LONGINT *cand, LONGINT cand__len) +static void Heap_MarkCandidates (int64 n, int64 *cand, LONGINT cand__len) { - LONGINT chnk, adr, tag, next, lim, lim1, i, ptr, size; + int64 chnk, adr, tag, next, lim, lim1, i, ptr, size; chnk = Heap_heap; i = 0; lim = cand[n - 1]; @@ -528,7 +528,7 @@ static void Heap_MarkCandidates (LONGINT n, LONGINT *cand, LONGINT cand__len) static void Heap_CheckFin (void) { Heap_FinNode n; - LONGINT tag; + int64 tag; n = Heap_fin; while (n != NIL) { tag = Heap_FetchAddress(n->obj - 8); @@ -577,10 +577,10 @@ void Heap_FINALL (void) } } -static void Heap_MarkStack (LONGINT n, LONGINT *cand, LONGINT cand__len) +static void Heap_MarkStack (int64 n, int64 *cand, LONGINT cand__len) { SYSTEM_PTR frame; - LONGINT inc, nofcand, sp, p, stack0; + int64 inc, nofcand, sp, p, stack0; struct Heap__1 align; if (n > 0) { Heap_MarkStack(n - 1, cand, cand__len); @@ -597,7 +597,7 @@ static void Heap_MarkStack (LONGINT n, LONGINT *cand, LONGINT cand__len) inc = -inc; } while (sp != stack0) { - __GET(sp, p, LONGINT); + __GET(sp, p, int64); if ((p > Heap_heap && p < Heap_heapend)) { if (nofcand == cand__len) { Heap_HeapSort(nofcand, (void*)cand, cand__len); @@ -619,8 +619,8 @@ static void Heap_MarkStack (LONGINT n, LONGINT *cand, LONGINT cand__len) void Heap_GC (BOOLEAN markStack) { Heap_Module m; - LONGINT i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; - LONGINT cand[10000]; + int64 i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; + int64 cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); m = (Heap_Module)(SYSTEM_ADRINT)Heap_modules; @@ -700,7 +700,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (LONGINT)(SYSTEM_ADRINT)obj; + f->obj = (int64)(SYSTEM_ADRINT)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; @@ -711,7 +711,7 @@ void Heap_InitHeap (void) { Heap_heap = Heap_NewChunk(256000); Heap_heapend = Heap_FetchAddress(Heap_heap + 8); - __PUT(Heap_heap, 0, LONGINT); + __PUT(Heap_heap, 0, int64); Heap_allocated = 0; Heap_firstTry = 1; Heap_freeList[9] = 1; diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index 5e7c01fb..40c921e4 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -32,8 +32,8 @@ typedef import SYSTEM_PTR Heap_modules; -import LONGINT Heap_allocated, Heap_heapsize; -import INTEGER Heap_FileCount; +import int64 Heap_allocated, Heap_heapsize; +import int32 Heap_FileCount; import LONGINT *Heap_ModuleDesc__typ; @@ -42,11 +42,11 @@ import void Heap_GC (BOOLEAN markStack); import void Heap_INCREF (Heap_Module m); import void Heap_InitHeap (void); import void Heap_Lock (void); -import SYSTEM_PTR Heap_NEWBLK (LONGINT size); -import SYSTEM_PTR Heap_NEWREC (LONGINT tag); +import SYSTEM_PTR Heap_NEWBLK (int64 size); +import SYSTEM_PTR Heap_NEWREC (int64 tag); import void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); import SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -import void Heap_REGTYP (Heap_Module m, LONGINT typ); +import void Heap_REGTYP (Heap_Module m, int64 typ); import void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); import void Heap_Unlock (void); import void *Heap__init(void); diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 004f1f8b..5f85fd33 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -27,15 +27,15 @@ typedef struct Modules_ModuleDesc { Modules_Module next; Modules_ModuleName name; - LONGINT refcnt; + int64 refcnt; Modules_Cmd cmds; - LONGINT types; - void (*enumPtrs)(void(*)(LONGINT)); - LONGINT reserved1, reserved2; + int64 types; + void (*enumPtrs)(void(*)(int64)); + int64 reserved1, reserved2; } Modules_ModuleDesc; -export INTEGER Modules_res; +export int32 Modules_res; export CHAR Modules_resMsg[256]; export Modules_ModuleName Modules_imported, Modules_importing; @@ -52,7 +52,7 @@ export Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len); static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len) { - INTEGER i, j; + int32 i, j; __DUP(b, b__len, CHAR); i = 0; while (a[__X(i, a__len)] != 0x00) { diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index 6f5e4cad..d61c2889 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -29,15 +29,15 @@ typedef struct Modules_ModuleDesc { Modules_Module next; Modules_ModuleName name; - LONGINT refcnt; + int64 refcnt; Modules_Cmd cmds; - LONGINT types; - void (*enumPtrs)(void(*)(LONGINT)); + int64 types; + void (*enumPtrs)(void(*)(int64)); char _prvt0[16]; } Modules_ModuleDesc; -import INTEGER Modules_res; +import int32 Modules_res; import CHAR Modules_resMsg[256]; import Modules_ModuleName Modules_imported, Modules_importing; diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index eacff2d0..36f97a5d 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -7,13 +7,13 @@ export void (*OPB_typSize)(OPT_Struct); -static INTEGER OPB_exp; -static LONGINT OPB_maxExp; +static int32 OPB_exp; +static int64 OPB_maxExp; export void OPB_Assign (OPT_Node *x, OPT_Node y); -static void OPB_BindNodes (SHORTINT class, OPT_Struct typ, OPT_Node *x, OPT_Node y); -static LONGINT OPB_BoolToInt (BOOLEAN b); +static void OPB_BindNodes (int8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y); +static int64 OPB_BoolToInt (BOOLEAN b); export void OPB_Call (OPT_Node *x, OPT_Node apar, OPT_Object fp); static void OPB_CharToString (OPT_Node n); static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode); @@ -21,10 +21,10 @@ static void OPB_CheckLeaf (OPT_Node x, BOOLEAN dynArrToo); export void OPB_CheckParameters (OPT_Object fp, OPT_Object ap, BOOLEAN checkNames); static void OPB_CheckProc (OPT_Struct x, OPT_Object y); static void OPB_CheckPtr (OPT_Node x, OPT_Node y); -static void OPB_CheckRealType (INTEGER f, INTEGER nr, OPT_Const x); +static void OPB_CheckRealType (int32 f, int32 nr, OPT_Const x); static void OPB_CheckReceiver (OPT_Node *x, OPT_Object fp); -static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y); -export void OPB_Construct (SHORTINT class, OPT_Node *x, OPT_Node y); +static void OPB_ConstOp (int32 op, OPT_Node x, OPT_Node y); +export void OPB_Construct (int8 class, OPT_Node *x, OPT_Node y); static void OPB_Convert (OPT_Node *x, OPT_Struct typ); export void OPB_DeRef (OPT_Node *x); static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpar); @@ -34,17 +34,17 @@ export void OPB_Field (OPT_Node *x, OPT_Object y); export void OPB_In (OPT_Node *x, OPT_Node y); export void OPB_Index (OPT_Node *x, OPT_Node y); export void OPB_Inittd (OPT_Node *inittd, OPT_Node *last, OPT_Struct typ); -static BOOLEAN OPB_IntToBool (LONGINT i); +static BOOLEAN OPB_IntToBool (int64 i); export void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y); -export void OPB_MOp (SHORTINT op, OPT_Node *x); +export void OPB_MOp (int8 op, OPT_Node *x); export OPT_Node OPB_NewBoolConst (BOOLEAN boolval); -export OPT_Node OPB_NewIntConst (LONGINT intval); +export OPT_Node OPB_NewIntConst (int64 intval); export OPT_Node OPB_NewLeaf (OPT_Object obj); export OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ); -export OPT_Node OPB_NewString (OPS_String str, LONGINT len); +export OPT_Node OPB_NewString (OPS_String str, int64 len); export OPT_Node OPB_Nil (void); static BOOLEAN OPB_NotVar (OPT_Node x); -export void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y); +export void OPB_Op (int8 op, OPT_Node *x, OPT_Node y); export void OPB_OptIf (OPT_Node *x); export void OPB_Param (OPT_Node ap, OPT_Object fp); export void OPB_PrepCall (OPT_Node *x, OPT_Object *fpar); @@ -52,17 +52,17 @@ export void OPB_Return (OPT_Node *x, OPT_Object proc); export void OPB_SetElem (OPT_Node *x); static void OPB_SetIntType (OPT_Node node); export void OPB_SetRange (OPT_Node *x, OPT_Node y); -export void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno); -export void OPB_StPar0 (OPT_Node *par0, INTEGER fctno); -export void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno); -export void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n); -export void OPB_StaticLink (SHORTINT dlev); +export void OPB_StFct (OPT_Node *par0, int8 fctno, int32 parno); +export void OPB_StPar0 (OPT_Node *par0, int32 fctno); +export void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno); +export void OPB_StParN (OPT_Node *par0, OPT_Node x, int32 fctno, int32 n); +export void OPB_StaticLink (int8 dlev); export void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard); -static void OPB_err (INTEGER n); -static LONGINT OPB_log (LONGINT x); +static void OPB_err (int32 n); +static int64 OPB_log (int64 x); -static void OPB_err (INTEGER n) +static void OPB_err (int32 n) { OPM_err(n); } @@ -101,7 +101,7 @@ OPT_Node OPB_NewLeaf (OPT_Object obj) return _o_result; } -void OPB_Construct (SHORTINT class, OPT_Node *x, OPT_Node y) +void OPB_Construct (int8 class, OPT_Node *x, OPT_Node y) { OPT_Node node = NIL; node = OPT_NewNode(class); @@ -124,9 +124,9 @@ void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y) *last = y; } -static LONGINT OPB_BoolToInt (BOOLEAN b) +static int64 OPB_BoolToInt (BOOLEAN b) { - LONGINT _o_result; + int64 _o_result; if (b) { _o_result = 1; return _o_result; @@ -137,7 +137,7 @@ static LONGINT OPB_BoolToInt (BOOLEAN b) __RETCHK; } -static BOOLEAN OPB_IntToBool (LONGINT i) +static BOOLEAN OPB_IntToBool (int64 i) { BOOLEAN _o_result; if (i == 0) { @@ -223,8 +223,8 @@ OPT_Node OPB_EmptySet (void) static void OPB_SetIntType (OPT_Node node) { - INTEGER b; - LONGINT n; + int32 b; + int64 n; if (node->conval->intval >= 0) { n = node->conval->intval; } else { @@ -237,7 +237,7 @@ static void OPB_SetIntType (OPT_Node node) node->typ = OPT_IntType(b); } -OPT_Node OPB_NewIntConst (LONGINT intval) +OPT_Node OPB_NewIntConst (int64 intval) { OPT_Node _o_result; OPT_Node x = NIL; @@ -262,7 +262,7 @@ OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ) return _o_result; } -OPT_Node OPB_NewString (OPS_String str, LONGINT len) +OPT_Node OPB_NewString (OPS_String str, int64 len) { OPT_Node _o_result; OPT_Node x = NIL; @@ -294,7 +294,7 @@ static void OPB_CharToString (OPT_Node n) n->obj = NIL; } -static void OPB_BindNodes (SHORTINT class, OPT_Struct typ, OPT_Node *x, OPT_Node y) +static void OPB_BindNodes (int8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y) { OPT_Node node = NIL; node = OPT_NewNode(class); @@ -336,7 +336,7 @@ void OPB_DeRef (OPT_Node *x) void OPB_Index (OPT_Node *x, OPT_Node y) { - INTEGER f; + int32 f; OPT_Struct typ = NIL; f = y->typ->form; if ((*x)->class >= 7) { @@ -461,15 +461,15 @@ void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) void OPB_In (OPT_Node *x, OPT_Node y) { - INTEGER f; - LONGINT k; + int32 f; + int64 k; f = (*x)->typ->form; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); } else if ((f == 4 && y->typ->form == 7)) { if ((*x)->class == 7) { k = (*x)->conval->intval; - if (k < 0 || k > (SYSTEM_INT64)OPM_MaxSet) { + if (k < 0 || k > (int64)OPM_MaxSet) { OPB_err(202); } else if (y->class == 7) { (*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval)); @@ -488,9 +488,9 @@ void OPB_In (OPT_Node *x, OPT_Node y) (*x)->typ = OPT_booltyp; } -static LONGINT OPB_log (LONGINT x) +static int64 OPB_log (int64 x) { - LONGINT _o_result; + int64 _o_result; OPB_exp = 0; if (x > 0) { while (!__ODD(x)) { @@ -502,7 +502,7 @@ static LONGINT OPB_log (LONGINT x) return _o_result; } -static void OPB_CheckRealType (INTEGER f, INTEGER nr, OPT_Const x) +static void OPB_CheckRealType (int32 f, int32 nr, OPT_Const x) { LONGREAL min, max, r; if (f == 5) { @@ -526,9 +526,9 @@ static struct MOp__28 { struct MOp__28 *lnk; } *MOp__28_s; -static OPT_Node NewOp__29 (SHORTINT op, OPT_Struct typ, OPT_Node z); +static OPT_Node NewOp__29 (int8 op, OPT_Struct typ, OPT_Node z); -static OPT_Node NewOp__29 (SHORTINT op, OPT_Struct typ, OPT_Node z) +static OPT_Node NewOp__29 (int8 op, OPT_Struct typ, OPT_Node z) { OPT_Node _o_result; OPT_Node node = NIL; @@ -540,9 +540,9 @@ static OPT_Node NewOp__29 (SHORTINT op, OPT_Struct typ, OPT_Node z) return _o_result; } -void OPB_MOp (SHORTINT op, OPT_Node *x) +void OPB_MOp (int8 op, OPT_Node *x) { - INTEGER f; + int32 f; OPT_Struct typ = NIL; OPT_Node z = NIL; struct MOp__28 _s; @@ -679,7 +679,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) static void OPB_CheckPtr (OPT_Node x, OPT_Node y) { - INTEGER g; + int32 g; OPT_Struct p = NIL, q = NIL, t = NIL; g = y->typ->form; if (g == 11) { @@ -763,17 +763,17 @@ static void OPB_CheckProc (OPT_Struct x, OPT_Object y) static struct ConstOp__13 { OPT_Node *x; - INTEGER *f; + int32 *f; OPT_Const *xval, *yval; struct ConstOp__13 *lnk; } *ConstOp__13_s; -static INTEGER ConstCmp__14 (void); +static int32 ConstCmp__14 (void); -static INTEGER ConstCmp__14 (void) +static int32 ConstCmp__14 (void) { - INTEGER _o_result; - INTEGER res; + int32 _o_result; + int32 res; switch (*ConstOp__13_s->f) { case 0: res = 9; @@ -837,11 +837,11 @@ static INTEGER ConstCmp__14 (void) return _o_result; } -static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) +static void OPB_ConstOp (int32 op, OPT_Node x, OPT_Node y) { - INTEGER f, g; + int32 f, g; OPT_Const xval = NIL, yval = NIL; - LONGINT xv, yv; + int64 xv, yv; BOOLEAN temp; struct ConstOp__13 _s; _s.x = &x; @@ -1117,8 +1117,8 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) static void OPB_Convert (OPT_Node *x, OPT_Struct typ) { OPT_Node node = NIL; - INTEGER f, g; - LONGINT k; + int32 f, g; + int64 k; LONGREAL r; f = (*x)->typ->form; g = typ->form; @@ -1169,14 +1169,14 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) } static struct Op__38 { - INTEGER *f, *g; + int32 *f, *g; struct Op__38 *lnk; } *Op__38_s; -static void NewOp__39 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y); +static void NewOp__39 (int8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y); static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y); -static void NewOp__39 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y) +static void NewOp__39 (int8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y) { OPT_Node node = NIL; node = OPT_NewNode(12); @@ -1219,13 +1219,13 @@ static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) return _o_result; } -void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) +void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) { - INTEGER f, g; + int32 f, g; OPT_Node t = NIL, z = NIL; OPT_Struct typ = NIL; BOOLEAN do_; - LONGINT val; + int64 val; struct Op__38 _s; _s.f = &f; _s.g = &g; @@ -1496,19 +1496,19 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) void OPB_SetRange (OPT_Node *x, OPT_Node y) { - LONGINT k, l; + int64 k, l; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); } else if (((*x)->typ->form == 4 && y->typ->form == 4)) { if ((*x)->class == 7) { k = (*x)->conval->intval; - if (0 > k || k > (SYSTEM_INT64)OPM_MaxSet) { + if (0 > k || k > (int64)OPM_MaxSet) { OPB_err(202); } } if (y->class == 7) { l = y->conval->intval; - if (0 > l || l > (SYSTEM_INT64)OPM_MaxSet) { + if (0 > l || l > (int64)OPM_MaxSet) { OPB_err(202); } } @@ -1531,14 +1531,14 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y) void OPB_SetElem (OPT_Node *x) { - LONGINT k; + int64 k; if ((*x)->class == 8 || (*x)->class == 9) { OPB_err(126); } else if ((*x)->typ->form != 4) { OPB_err(93); } else if ((*x)->class == 7) { k = (*x)->conval->intval; - if ((0 <= k && k <= (SYSTEM_INT64)OPM_MaxSet)) { + if ((0 <= k && k <= (int64)OPM_MaxSet)) { (*x)->conval->setval = __SETOF(k); } else { OPB_err(202); @@ -1553,7 +1553,7 @@ void OPB_SetElem (OPT_Node *x) static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) { OPT_Struct y = NIL; - INTEGER f, g; + int32 f, g; OPT_Struct p = NIL, q = NIL; if (OPM_Verbose) { OPM_LogWLn(); @@ -1696,9 +1696,9 @@ static void OPB_CheckLeaf (OPT_Node x, BOOLEAN dynArrToo) { } -void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) +void OPB_StPar0 (OPT_Node *par0, int32 fctno) { - INTEGER f; + int32 f; OPT_Struct typ = NIL; OPT_Node x = NIL; x = *par0; @@ -1913,7 +1913,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (f == 4) { - if (x->typ->size != (SYSTEM_INT64)OPM_LIntSize) { + if (x->typ->size != (int64)OPM_LIntSize) { OPB_Convert(&x, OPT_linttyp); } } else { @@ -1953,7 +1953,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) OPB_err(126); } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x0810) && x->typ->size == (SYSTEM_INT64)OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x0810) && x->typ->size == (int64)OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } @@ -2006,9 +2006,9 @@ static struct StPar1__52 { struct StPar1__52 *lnk; } *StPar1__52_s; -static OPT_Node NewOp__53 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right); +static OPT_Node NewOp__53 (int8 class, int8 subcl, OPT_Node left, OPT_Node right); -static OPT_Node NewOp__53 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right) +static OPT_Node NewOp__53 (int8 class, int8 subcl, OPT_Node left, OPT_Node right) { OPT_Node _o_result; OPT_Node node = NIL; @@ -2020,9 +2020,9 @@ static OPT_Node NewOp__53 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_No return _o_result; } -void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) +void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) { - INTEGER f, L; + int32 f, L; OPT_Struct typ = NIL; OPT_Node p = NIL, t = NIL; struct StPar1__52 _s; @@ -2051,7 +2051,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (f == 4) { - if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > (SYSTEM_INT64)OPM_MaxSet))) { + if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > (int64)OPM_MaxSet))) { OPB_err(202); } p = NewOp__53(19, fctno, p, x); @@ -2064,7 +2064,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (!(f == 4) || x->class != 7) { OPB_err(69); } else if (x->typ->size == 1) { - L = (SYSTEM_INT32)x->conval->intval; + L = (int32)x->conval->intval; typ = p->typ; while ((L > 0 && __IN(typ->comp, 0x0c))) { typ = typ->BaseTyp; @@ -2222,7 +2222,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) OPB_err(126); } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x0810) && x->typ->size == (SYSTEM_INT64)OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x0810) && x->typ->size == (int64)OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } @@ -2260,10 +2260,10 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) StPar1__52_s = _s.lnk; } -void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n) +void OPB_StParN (OPT_Node *par0, OPT_Node x, int32 fctno, int32 n) { OPT_Node node = NIL; - INTEGER f; + int32 f; OPT_Node p = NIL; p = *par0; f = x->typ->form; @@ -2305,9 +2305,9 @@ void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n) *par0 = p; } -void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno) +void OPB_StFct (OPT_Node *par0, int8 fctno, int32 parno) { - INTEGER dim; + int32 dim; OPT_Node x = NIL, p = NIL; p = *par0; if (fctno <= 19) { @@ -2371,7 +2371,7 @@ void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno) static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpar) { - INTEGER f; + int32 f; f = atyp->comp; ftyp = ftyp->BaseTyp; atyp = atyp->BaseTyp; @@ -2480,7 +2480,7 @@ void OPB_Param (OPT_Node ap, OPT_Object fp) } } -void OPB_StaticLink (SHORTINT dlev) +void OPB_StaticLink (int8 dlev) { OPT_Object scope = NIL; scope = OPT_topScope; @@ -2495,7 +2495,7 @@ void OPB_Call (OPT_Node *x, OPT_Node apar, OPT_Object fp) { OPT_Struct typ = NIL; OPT_Node p = NIL; - SHORTINT lev; + int8 lev; if ((*x)->class == 9) { typ = (*x)->typ; lev = (*x)->obj->mnolev; @@ -2555,7 +2555,7 @@ void OPB_Return (OPT_Node *x, OPT_Object proc) void OPB_Assign (OPT_Node *x, OPT_Node y) { OPT_Node z = NIL; - SHORTINT subcl; + int8 subcl; if ((*x)->class >= 7) { OPB_err(56); } diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index 7b980a10..61a0edcd 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -15,7 +15,7 @@ import void (*OPB_typSize)(OPT_Struct); import void OPB_Assign (OPT_Node *x, OPT_Node y); import void OPB_Call (OPT_Node *x, OPT_Node apar, OPT_Object fp); import void OPB_CheckParameters (OPT_Object fp, OPT_Object ap, BOOLEAN checkNames); -import void OPB_Construct (SHORTINT class, OPT_Node *x, OPT_Node y); +import void OPB_Construct (int8 class, OPT_Node *x, OPT_Node y); import void OPB_DeRef (OPT_Node *x); import OPT_Node OPB_EmptySet (void); import void OPB_Enter (OPT_Node *procdec, OPT_Node stat, OPT_Object proc); @@ -24,25 +24,25 @@ import void OPB_In (OPT_Node *x, OPT_Node y); import void OPB_Index (OPT_Node *x, OPT_Node y); import void OPB_Inittd (OPT_Node *inittd, OPT_Node *last, OPT_Struct typ); import void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y); -import void OPB_MOp (SHORTINT op, OPT_Node *x); +import void OPB_MOp (int8 op, OPT_Node *x); import OPT_Node OPB_NewBoolConst (BOOLEAN boolval); -import OPT_Node OPB_NewIntConst (LONGINT intval); +import OPT_Node OPB_NewIntConst (int64 intval); import OPT_Node OPB_NewLeaf (OPT_Object obj); import OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ); -import OPT_Node OPB_NewString (OPS_String str, LONGINT len); +import OPT_Node OPB_NewString (OPS_String str, int64 len); import OPT_Node OPB_Nil (void); -import void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y); +import void OPB_Op (int8 op, OPT_Node *x, OPT_Node y); import void OPB_OptIf (OPT_Node *x); import void OPB_Param (OPT_Node ap, OPT_Object fp); import void OPB_PrepCall (OPT_Node *x, OPT_Object *fpar); import void OPB_Return (OPT_Node *x, OPT_Object proc); import void OPB_SetElem (OPT_Node *x); import void OPB_SetRange (OPT_Node *x, OPT_Node y); -import void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno); -import void OPB_StPar0 (OPT_Node *par0, INTEGER fctno); -import void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno); -import void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n); -import void OPB_StaticLink (SHORTINT dlev); +import void OPB_StFct (OPT_Node *par0, int8 fctno, int32 parno); +import void OPB_StPar0 (OPT_Node *par0, int32 fctno); +import void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno); +import void OPB_StParN (OPT_Node *par0, OPT_Node x, int32 fctno, int32 n); +import void OPB_StaticLink (int8 dlev); import void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard); import void *OPB__init(void); diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index ad70616c..8310f854 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -6,27 +6,27 @@ #include "OPT.h" -static INTEGER OPC_indentLevel; +static int32 OPC_indentLevel; static BOOLEAN OPC_ptrinit, OPC_mainprog, OPC_ansi; -static SHORTINT OPC_hashtab[105]; -static CHAR OPC_keytab[36][9]; +static int8 OPC_hashtab[105]; +static CHAR OPC_keytab[50][9]; static BOOLEAN OPC_GlbPtrs; static CHAR OPC_BodyNameExt[13]; -export void OPC_Align (LONGINT *adr, LONGINT base); +export void OPC_Align (int64 *adr, int64 base); export void OPC_Andent (OPT_Struct typ); static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames); -export LONGINT OPC_BaseAlignment (OPT_Struct typ); +export int64 OPC_BaseAlignment (OPT_Struct typ); export OPT_Object OPC_BaseTProc (OPT_Object obj); export void OPC_BegBlk (void); export void OPC_BegStat (void); -static void OPC_CProcDefs (OPT_Object obj, INTEGER vis); -export void OPC_Case (LONGINT caseVal, INTEGER form); -static void OPC_CharacterLiteral (LONGINT c); -export void OPC_Cmp (INTEGER rel); +static void OPC_CProcDefs (OPT_Object obj, int32 vis); +export void OPC_Case (int64 caseVal, int32 form); +static void OPC_CharacterLiteral (int64 c); +export void OPC_Cmp (int32 rel); export void OPC_CompleteIdent (OPT_Object obj); -export void OPC_Constant (OPT_Const con, INTEGER form); +export void OPC_Constant (OPT_Const con, int32 form); static void OPC_DeclareBase (OPT_Object dcl); static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef); static void OPC_DeclareParams (OPT_Object par, BOOLEAN macro); @@ -43,45 +43,45 @@ export void OPC_EnterBody (void); export void OPC_EnterProc (OPT_Object proc); export void OPC_ExitBody (void); export void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet); -static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, LONGINT *off, LONGINT *n, LONGINT *curAlign); -static void OPC_FillGap (LONGINT gap, LONGINT off, LONGINT align, LONGINT *n, LONGINT *curAlign); +static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, int64 *off, int64 *n, int64 *curAlign); +static void OPC_FillGap (int64 gap, int64 off, int64 align, int64 *n, int64 *curAlign); export void OPC_GenBdy (OPT_Node n); -static void OPC_GenDynTypes (OPT_Node n, INTEGER vis); +static void OPC_GenDynTypes (OPT_Node n, int32 vis); export void OPC_GenEnumPtrs (OPT_Object var); export void OPC_GenHdr (OPT_Node n); export void OPC_GenHdrIncludes (void); static void OPC_GenHeaderMsg (void); -export void OPC_Halt (LONGINT n); +export void OPC_Halt (int64 n); export void OPC_Ident (OPT_Object obj); -static void OPC_IdentList (OPT_Object obj, INTEGER vis); +static void OPC_IdentList (OPT_Object obj, int32 vis); static void OPC_Include (CHAR *name, LONGINT name__len); -static void OPC_IncludeImports (OPT_Object obj, INTEGER vis); +static void OPC_IncludeImports (OPT_Object obj, int32 vis); export void OPC_Increment (BOOLEAN decrement); -export void OPC_Indent (INTEGER count); +export void OPC_Indent (int32 count); export void OPC_Init (void); static void OPC_InitImports (OPT_Object obj); static void OPC_InitKeywords (void); export void OPC_InitTDesc (OPT_Struct typ); static void OPC_InitTProcs (OPT_Object typ, OPT_Object obj); -export void OPC_IntLiteral (LONGINT n, LONGINT size); -export void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim); +export void OPC_IntLiteral (int64 n, int64 size); +export void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim); static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName); -static INTEGER OPC_Length (CHAR *s, LONGINT s__len); -export LONGINT OPC_NofPtrs (OPT_Struct typ); -static INTEGER OPC_PerfectHash (CHAR *s, LONGINT s__len); +static int32 OPC_Length (CHAR *s, LONGINT s__len); +export int64 OPC_NofPtrs (OPT_Struct typ); +static int32 OPC_PerfectHash (CHAR *s, LONGINT s__len); static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len); static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define); -static void OPC_ProcPredefs (OPT_Object obj, SHORTINT vis); +static void OPC_ProcPredefs (OPT_Object obj, int8 vis); static void OPC_PutBase (OPT_Struct typ); -static void OPC_PutPtrOffsets (OPT_Struct typ, LONGINT adr, LONGINT *cnt); +static void OPC_PutPtrOffsets (OPT_Struct typ, int64 adr, int64 *cnt); static void OPC_RegCmds (OPT_Object obj); export void OPC_SetInclude (BOOLEAN exclude); -export LONGINT OPC_SizeAlignment (LONGINT size); +export int64 OPC_SizeAlignment (int64 size); static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause); -static void OPC_Str1 (CHAR *s, LONGINT s__len, LONGINT x); -static void OPC_StringLiteral (CHAR *s, LONGINT s__len, LONGINT l); +static void OPC_Str1 (CHAR *s, LONGINT s__len, int64 x); +static void OPC_StringLiteral (CHAR *s, LONGINT s__len, int64 l); export void OPC_TDescDecl (OPT_Struct typ); -export void OPC_TypeDefs (OPT_Object obj, INTEGER vis); +export void OPC_TypeDefs (OPT_Object obj, int32 vis); export void OPC_TypeOf (OPT_Object ap); static BOOLEAN OPC_Undefined (OPT_Object obj); @@ -99,14 +99,14 @@ void OPC_Init (void) } } -void OPC_Indent (INTEGER count) +void OPC_Indent (int32 count) { OPC_indentLevel += count; } void OPC_BegStat (void) { - INTEGER i; + int32 i; i = OPC_indentLevel; while (i > 0) { OPM_Write(0x09); @@ -142,10 +142,10 @@ void OPC_EndBlk0 (void) OPM_Write('}'); } -static void OPC_Str1 (CHAR *s, LONGINT s__len, LONGINT x) +static void OPC_Str1 (CHAR *s, LONGINT s__len, int64 x) { CHAR ch; - INTEGER i; + int32 i; __DUP(s, s__len, CHAR); ch = s[0]; i = 0; @@ -161,10 +161,10 @@ static void OPC_Str1 (CHAR *s, LONGINT s__len, LONGINT x) __DEL(s); } -static INTEGER OPC_Length (CHAR *s, LONGINT s__len) +static int32 OPC_Length (CHAR *s, LONGINT s__len) { - INTEGER _o_result; - INTEGER i; + int32 _o_result; + int32 i; i = 0; while (s[__X(i, s__len)] != 0x00) { i += 1; @@ -173,10 +173,10 @@ static INTEGER OPC_Length (CHAR *s, LONGINT s__len) return _o_result; } -static INTEGER OPC_PerfectHash (CHAR *s, LONGINT s__len) +static int32 OPC_PerfectHash (CHAR *s, LONGINT s__len) { - INTEGER _o_result; - INTEGER i, h; + int32 _o_result; + int32 i, h; i = 0; h = 0; while ((s[__X(i, s__len)] != 0x00 && i < 5)) { @@ -189,17 +189,20 @@ static INTEGER OPC_PerfectHash (CHAR *s, LONGINT s__len) void OPC_Ident (OPT_Object obj) { - INTEGER mode, level, h; + int32 mode, level, h; mode = obj->mode; level = obj->mnolev; if ((__IN(mode, 0x62) && level > 0) || __IN(mode, 0x14)) { OPM_WriteStringVar((void*)obj->name, 256); h = OPC_PerfectHash((void*)obj->name, 256); if (OPC_hashtab[__X(h, 105)] >= 0) { - if (__STRCMP(OPC_keytab[__X(OPC_hashtab[__X(h, 105)], 36)], obj->name) == 0) { + if (__STRCMP(OPC_keytab[__X(OPC_hashtab[__X(h, 105)], 50)], obj->name) == 0) { OPM_Write('_'); } } + } else if ((mode == 5 && obj->typ->form == 4)) { + OPM_WriteString((CHAR*)"int", 4); + OPM_WriteInt(__ASHL(obj->typ->size, 3)); } else { if (mode != 5 || obj->linkadr != 2) { if (mode == 13) { @@ -213,7 +216,7 @@ void OPC_Ident (OPT_Object obj) OPM_WriteStringVar((void*)OPM_modName, 32); } OPM_Write('_'); - } else if ((((((obj == OPT_sysptrtyp->strobj || obj == OPT_ainttyp->strobj) || obj == OPT_int8typ->strobj) || obj == OPT_int16typ->strobj) || obj == OPT_int32typ->strobj) || obj == OPT_int64typ->strobj) || obj == OPT_bytetyp->strobj) { + } else if ((obj == OPT_sysptrtyp->strobj || obj == OPT_ainttyp->strobj) || obj == OPT_bytetyp->strobj) { OPM_WriteString((CHAR*)"SYSTEM_", 8); } OPM_WriteStringVar((void*)obj->name, 256); @@ -222,7 +225,7 @@ void OPC_Ident (OPT_Object obj) static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause) { - INTEGER pointers; + int32 pointers; *openClause = 0; if (((typ->strobj == NIL || typ->strobj->name[0] == 0x00) && typ->comp != 4)) { if (__IN(typ->comp, 0x0c)) { @@ -258,7 +261,7 @@ static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef) { OPT_Struct typ = NIL; BOOLEAN varPar, openClause; - INTEGER form, comp; + int32 form, comp; typ = dcl->typ; varPar = ((dcl->mode == 2 && typ->comp != 2) || typ->comp == 3) || scopeDef; OPC_Stars(typ, &openClause); @@ -320,7 +323,7 @@ void OPC_Andent (OPT_Struct typ) static BOOLEAN OPC_Undefined (OPT_Object obj) { BOOLEAN _o_result; - _o_result = obj->name[0] == 0x00 || (((obj->mnolev >= 0 && obj->linkadr != (SYSTEM_INT64)(3 + OPM_currFile))) && obj->linkadr != 2); + _o_result = obj->name[0] == 0x00 || (((obj->mnolev >= 0 && obj->linkadr != (int64)(3 + OPM_currFile))) && obj->linkadr != 2); return _o_result; } @@ -328,8 +331,8 @@ static void OPC_DeclareBase (OPT_Object dcl) { OPT_Struct typ = NIL, prev = NIL; OPT_Object obj = NIL; - INTEGER nofdims; - LONGINT off, n, dummy; + int32 nofdims; + int64 off, n, dummy; typ = dcl->typ; prev = typ; while ((((((((typ->strobj == NIL || typ->comp == 3) || OPC_Undefined(typ->strobj)) && typ->comp != 4)) && typ->form != 10)) && !((typ->form == 11 && typ->BaseTyp->comp == 3)))) { @@ -388,12 +391,12 @@ static void OPC_DeclareBase (OPT_Object dcl) } } -LONGINT OPC_NofPtrs (OPT_Struct typ) +int64 OPC_NofPtrs (OPT_Struct typ) { - LONGINT _o_result; + int64 _o_result; OPT_Object fld = NIL; OPT_Struct btyp = NIL; - LONGINT n; + int64 n; if ((typ->form == 11 && typ->sysflag == 0)) { _o_result = 1; return _o_result; @@ -431,11 +434,11 @@ LONGINT OPC_NofPtrs (OPT_Struct typ) __RETCHK; } -static void OPC_PutPtrOffsets (OPT_Struct typ, LONGINT adr, LONGINT *cnt) +static void OPC_PutPtrOffsets (OPT_Struct typ, int64 adr, int64 *cnt) { OPT_Object fld = NIL; OPT_Struct btyp = NIL; - LONGINT n, i; + int64 n, i; if ((typ->form == 11 && typ->sysflag == 0)) { OPM_WriteInt(adr); OPM_WriteString((CHAR*)", ", 3); @@ -511,7 +514,7 @@ static void OPC_PutBase (OPT_Struct typ) static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName) { OPT_Struct typ = NIL; - INTEGER dim; + int32 dim; if (showParamName) { OPC_Ident(par); OPM_WriteString((CHAR*)"__len", 6); @@ -611,7 +614,7 @@ OPT_Object OPC_BaseTProc (OPT_Object obj) { OPT_Object _o_result; OPT_Struct typ = NIL, base = NIL; - LONGINT mno; + int64 mno; typ = obj->link->typ; if (typ->form == 11) { typ = typ->BaseTyp; @@ -740,7 +743,7 @@ static void OPC_DefineType (OPT_Struct str) static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len) { BOOLEAN _o_result; - INTEGER i; + int32 i; BOOLEAN r; __DUP(y, y__len, CHAR); i = 0; @@ -753,11 +756,11 @@ static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len) return _o_result; } -static void OPC_CProcDefs (OPT_Object obj, INTEGER vis) +static void OPC_CProcDefs (OPT_Object obj, int32 vis) { - INTEGER i; + int32 i; OPT_ConstExt ext = NIL; - INTEGER _for__9; + int32 _for__9; if (obj != NIL) { OPC_CProcDefs(obj->left, vis); if ((((obj->mode == 9 && obj->vis >= vis)) && obj->adr == 1)) { @@ -781,7 +784,7 @@ static void OPC_CProcDefs (OPT_Object obj, INTEGER vis) } } -void OPC_TypeDefs (OPT_Object obj, INTEGER vis) +void OPC_TypeDefs (OPT_Object obj, int32 vis) { if (obj != NIL) { OPC_TypeDefs(obj->left, vis); @@ -813,7 +816,7 @@ static void OPC_DefAnonRecs (OPT_Node n) void OPC_TDescDecl (OPT_Struct typ) { - LONGINT nofptrs; + int64 nofptrs; OPT_Object o = NIL; OPC_BegStat(); OPM_WriteString((CHAR*)"__TDESC(", 9); @@ -828,7 +831,7 @@ void OPC_TDescDecl (OPT_Struct typ) OPC_Str1((CHAR*)", #), {", 8, typ->size); nofptrs = 0; OPC_PutPtrOffsets(typ, 0, &nofptrs); - OPC_Str1((CHAR*)"#}}", 4, -((nofptrs + 1) * (SYSTEM_INT64)OPM_LIntSize)); + OPC_Str1((CHAR*)"#}}", 4, -((nofptrs + 1) * (int64)OPM_LIntSize)); OPC_EndStat(); } @@ -850,7 +853,7 @@ void OPC_InitTDesc (OPT_Struct typ) } } -void OPC_Align (LONGINT *adr, LONGINT base) +void OPC_Align (int64 *adr, int64 base) { switch (base) { case 2: @@ -870,11 +873,11 @@ void OPC_Align (LONGINT *adr, LONGINT base) } } -LONGINT OPC_SizeAlignment (LONGINT size) +int64 OPC_SizeAlignment (int64 size) { - LONGINT _o_result; - LONGINT alignment; - if (size < (SYSTEM_INT64)OPM_Alignment) { + int64 _o_result; + int64 alignment; + if (size < (int64)OPM_Alignment) { alignment = 1; while (alignment < size) { alignment = __ASHL(alignment, 1); @@ -886,10 +889,10 @@ LONGINT OPC_SizeAlignment (LONGINT size) return _o_result; } -LONGINT OPC_BaseAlignment (OPT_Struct typ) +int64 OPC_BaseAlignment (OPT_Struct typ) { - LONGINT _o_result; - LONGINT alignment; + int64 _o_result; + int64 alignment; if (typ->form == 13) { if (typ->comp == 4) { alignment = __MASK(typ->align, -65536); @@ -903,19 +906,19 @@ LONGINT OPC_BaseAlignment (OPT_Struct typ) return _o_result; } -static void OPC_FillGap (LONGINT gap, LONGINT off, LONGINT align, LONGINT *n, LONGINT *curAlign) +static void OPC_FillGap (int64 gap, int64 off, int64 align, int64 *n, int64 *curAlign) { - LONGINT adr; + int64 adr; adr = off; OPC_Align(&adr, align); if ((*curAlign < align && gap - (adr - off) >= align)) { gap -= (adr - off) + align; OPC_BegStat(); - if (align == (SYSTEM_INT64)OPM_IntSize) { + if (align == (int64)OPM_IntSize) { OPM_WriteString((CHAR*)"INTEGER", 8); - } else if (align == (SYSTEM_INT64)OPM_LIntSize) { + } else if (align == (int64)OPM_LIntSize) { OPM_WriteString((CHAR*)"LONGINT", 8); - } else if (align == (SYSTEM_INT64)OPM_LRealSize) { + } else if (align == (int64)OPM_LRealSize) { OPM_WriteString((CHAR*)"LONGREAL", 9); } OPC_Str1((CHAR*)" _prvt#", 8, *n); @@ -932,11 +935,11 @@ static void OPC_FillGap (LONGINT gap, LONGINT off, LONGINT align, LONGINT *n, LO } } -static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, LONGINT *off, LONGINT *n, LONGINT *curAlign) +static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, int64 *off, int64 *n, int64 *curAlign) { OPT_Object fld = NIL; OPT_Struct base = NIL; - LONGINT gap, adr, align, fldAlign; + int64 gap, adr, align, fldAlign; fld = typ->link; align = __MASK(typ->align, -65536); if (typ->BaseTyp != NIL) { @@ -980,7 +983,7 @@ static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, LONGINT *off, LONGINT * } } if (last) { - adr = typ->size - (SYSTEM_INT64)__ASHR(typ->sysflag, 8); + adr = typ->size - (int64)__ASHR(typ->sysflag, 8); if (adr == 0) { gap = 1; } else { @@ -992,11 +995,11 @@ static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, LONGINT *off, LONGINT * } } -static void OPC_IdentList (OPT_Object obj, INTEGER vis) +static void OPC_IdentList (OPT_Object obj, int32 vis) { OPT_Struct base = NIL; BOOLEAN first; - INTEGER lastvis; + int32 lastvis; base = NIL; first = 1; while ((obj != NIL && obj->mode != 13)) { @@ -1121,7 +1124,7 @@ static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define) } } -static void OPC_ProcPredefs (OPT_Object obj, SHORTINT vis) +static void OPC_ProcPredefs (OPT_Object obj, int8 vis) { if (obj != NIL) { OPC_ProcPredefs(obj->left, vis); @@ -1151,7 +1154,7 @@ static void OPC_Include (CHAR *name, LONGINT name__len) __DEL(name); } -static void OPC_IncludeImports (OPT_Object obj, INTEGER vis) +static void OPC_IncludeImports (OPT_Object obj, int32 vis) { if (obj != NIL) { OPC_IncludeImports(obj->left, vis); @@ -1162,7 +1165,7 @@ static void OPC_IncludeImports (OPT_Object obj, INTEGER vis) } } -static void OPC_GenDynTypes (OPT_Node n, INTEGER vis) +static void OPC_GenDynTypes (OPT_Node n, int32 vis) { OPT_Struct typ = NIL; while ((n != NIL && n->class == 14)) { @@ -1210,7 +1213,7 @@ void OPC_GenHdr (OPT_Node n) static void OPC_GenHeaderMsg (void) { - INTEGER i; + int32 i; OPM_WriteString((CHAR*)"/* ", 4); OPM_WriteString((CHAR*)"voc", 4); OPM_Write(' '); @@ -1361,7 +1364,7 @@ static void OPC_InitImports (OPT_Object obj) void OPC_GenEnumPtrs (OPT_Object var) { OPT_Struct typ = NIL; - LONGINT n; + int64 n; OPC_GlbPtrs = 0; while (var != NIL) { typ = var->typ; @@ -1522,7 +1525,7 @@ void OPC_EnterProc (OPT_Object proc) { OPT_Object var = NIL, scope = NIL; OPT_Struct typ = NIL; - INTEGER dim; + int32 dim; if (proc->vis != 1) { OPM_WriteString((CHAR*)"static ", 8); } @@ -1751,7 +1754,7 @@ void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet) void OPC_CompleteIdent (OPT_Object obj) { - INTEGER comp, level; + int32 comp, level; level = obj->mnolev; if (obj->adr == 1) { if (obj->typ->comp == 4) { @@ -1780,7 +1783,7 @@ void OPC_CompleteIdent (OPT_Object obj) void OPC_TypeOf (OPT_Object ap) { - INTEGER i; + int32 i; __ASSERT(ap->typ->comp == 4, 0); if (ap->mode == 2) { if (ap->mnolev != OPM_level) { @@ -1799,7 +1802,7 @@ void OPC_TypeOf (OPT_Object ap) } } -void OPC_Cmp (INTEGER rel) +void OPC_Cmp (int32 rel) { switch (rel) { case 9: @@ -1828,7 +1831,7 @@ void OPC_Cmp (INTEGER rel) } } -static void OPC_CharacterLiteral (LONGINT c) +static void OPC_CharacterLiteral (int64 c) { if (c < 32 || c > 126) { OPM_WriteString((CHAR*)"0x", 3); @@ -1843,10 +1846,10 @@ static void OPC_CharacterLiteral (LONGINT c) } } -static void OPC_StringLiteral (CHAR *s, LONGINT s__len, LONGINT l) +static void OPC_StringLiteral (CHAR *s, LONGINT s__len, int64 l) { - LONGINT i; - INTEGER c; + int64 i; + int32 c; __DUP(s, s__len, CHAR); OPM_Write('"'); i = 0; @@ -1871,7 +1874,7 @@ static void OPC_StringLiteral (CHAR *s, LONGINT s__len, LONGINT l) __DEL(s); } -void OPC_Case (LONGINT caseVal, INTEGER form) +void OPC_Case (int64 caseVal, int32 form) { CHAR ch; OPM_WriteString((CHAR*)"case ", 6); @@ -1909,30 +1912,17 @@ void OPC_Increment (BOOLEAN decrement) } } -void OPC_Halt (LONGINT n) +void OPC_Halt (int64 n) { OPC_Str1((CHAR*)"__HALT(#)", 10, n); } -void OPC_IntLiteral (LONGINT n, LONGINT size) +void OPC_IntLiteral (int64 n, int64 size) { if ((((size > 4 && n <= 2147483647)) && n > (-2147483647-1))) { - switch (size) { - case 2: - OPM_WriteString((CHAR*)"((SYSTEM_INT16)(", 17); - break; - case 4: - OPM_WriteString((CHAR*)"((SYSTEM_INT32)(", 17); - break; - case 8: - OPM_WriteString((CHAR*)"((SYSTEM_INT64)(", 17); - break; - default: - OPM_LogWStr((CHAR*)"Unhandled case in OPC.IntLiteral, size = ", 42); - OPM_LogWNum(size, 1); - OPM_LogWLn(); - break; - } + OPM_WriteString((CHAR*)"((int", 6); + OPM_WriteInt(__ASHL(size, 3)); + OPM_WriteString((CHAR*)")(", 3); OPM_WriteInt(n); OPM_WriteString((CHAR*)"))", 3); } else { @@ -1940,7 +1930,7 @@ void OPC_IntLiteral (LONGINT n, LONGINT size) } } -void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim) +void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim) { if (array->comp == 3) { OPC_CompleteIdent(obj); @@ -1961,11 +1951,11 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim) } } -void OPC_Constant (OPT_Const con, INTEGER form) +void OPC_Constant (OPT_Const con, int32 form) { - INTEGER i; + int32 i; SET s; - LONGINT hex; + int64 hex; BOOLEAN skipLeading; switch (form) { case 1: @@ -2024,7 +2014,7 @@ void OPC_Constant (OPT_Const con, INTEGER form) } static struct InitKeywords__48 { - SHORTINT *n; + int8 *n; struct InitKeywords__48 *lnk; } *InitKeywords__48_s; @@ -2032,18 +2022,18 @@ static void Enter__49 (CHAR *s, LONGINT s__len); static void Enter__49 (CHAR *s, LONGINT s__len) { - INTEGER h; + int32 h; __DUP(s, s__len, CHAR); h = OPC_PerfectHash((void*)s, s__len); OPC_hashtab[__X(h, 105)] = *InitKeywords__48_s->n; - __COPY(s, OPC_keytab[__X(*InitKeywords__48_s->n, 36)], 9); + __COPY(s, OPC_keytab[__X(*InitKeywords__48_s->n, 50)], 9); *InitKeywords__48_s->n += 1; __DEL(s); } static void OPC_InitKeywords (void) { - SHORTINT n, i; + int8 n, i; struct InitKeywords__48 _s; _s.n = &n; _s.lnk = InitKeywords__48_s; @@ -2054,6 +2044,7 @@ static void OPC_InitKeywords (void) OPC_hashtab[__X(i, 105)] = -1; i += 1; } + Enter__49((CHAR*)"adrint", 7); Enter__49((CHAR*)"asm", 4); Enter__49((CHAR*)"auto", 5); Enter__49((CHAR*)"break", 6); @@ -2075,16 +2066,25 @@ static void OPC_InitKeywords (void) Enter__49((CHAR*)"if", 3); Enter__49((CHAR*)"import", 7); Enter__49((CHAR*)"int", 4); + Enter__49((CHAR*)"int16", 6); + Enter__49((CHAR*)"int32", 6); + Enter__49((CHAR*)"int64", 6); + Enter__49((CHAR*)"int8", 5); Enter__49((CHAR*)"long", 5); Enter__49((CHAR*)"register", 9); Enter__49((CHAR*)"return", 7); Enter__49((CHAR*)"short", 6); Enter__49((CHAR*)"signed", 7); Enter__49((CHAR*)"sizeof", 7); + Enter__49((CHAR*)"size_t", 7); Enter__49((CHAR*)"static", 7); Enter__49((CHAR*)"struct", 7); Enter__49((CHAR*)"switch", 7); Enter__49((CHAR*)"typedef", 8); + Enter__49((CHAR*)"uint16", 7); + Enter__49((CHAR*)"uint32", 7); + Enter__49((CHAR*)"uint64", 7); + Enter__49((CHAR*)"uint8", 6); Enter__49((CHAR*)"union", 6); Enter__49((CHAR*)"unsigned", 9); Enter__49((CHAR*)"void", 5); diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index bb250e9a..3c5dedf4 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -10,16 +10,16 @@ -import void OPC_Align (LONGINT *adr, LONGINT base); +import void OPC_Align (int64 *adr, int64 base); import void OPC_Andent (OPT_Struct typ); -import LONGINT OPC_BaseAlignment (OPT_Struct typ); +import int64 OPC_BaseAlignment (OPT_Struct typ); import OPT_Object OPC_BaseTProc (OPT_Object obj); import void OPC_BegBlk (void); import void OPC_BegStat (void); -import void OPC_Case (LONGINT caseVal, INTEGER form); -import void OPC_Cmp (INTEGER rel); +import void OPC_Case (int64 caseVal, int32 form); +import void OPC_Cmp (int32 rel); import void OPC_CompleteIdent (OPT_Object obj); -import void OPC_Constant (OPT_Const con, INTEGER form); +import void OPC_Constant (OPT_Const con, int32 form); import void OPC_DefineInter (OPT_Object proc); import void OPC_EndBlk (void); import void OPC_EndBlk0 (void); @@ -32,19 +32,19 @@ import void OPC_GenBdy (OPT_Node n); import void OPC_GenEnumPtrs (OPT_Object var); import void OPC_GenHdr (OPT_Node n); import void OPC_GenHdrIncludes (void); -import void OPC_Halt (LONGINT n); +import void OPC_Halt (int64 n); import void OPC_Ident (OPT_Object obj); import void OPC_Increment (BOOLEAN decrement); -import void OPC_Indent (INTEGER count); +import void OPC_Indent (int32 count); import void OPC_Init (void); import void OPC_InitTDesc (OPT_Struct typ); -import void OPC_IntLiteral (LONGINT n, LONGINT size); -import void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim); -import LONGINT OPC_NofPtrs (OPT_Struct typ); +import void OPC_IntLiteral (int64 n, int64 size); +import void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim); +import int64 OPC_NofPtrs (OPT_Struct typ); import void OPC_SetInclude (BOOLEAN exclude); -import LONGINT OPC_SizeAlignment (LONGINT size); +import int64 OPC_SizeAlignment (int64 size); import void OPC_TDescDecl (OPT_Struct typ); -import void OPC_TypeDefs (OPT_Object obj, INTEGER vis); +import void OPC_TypeDefs (OPT_Object obj, int32 vis); import void OPC_TypeOf (OPT_Object ap); import void *OPC__init(void); diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 228e7978..d4b582de 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -15,23 +15,23 @@ typedef static CHAR OPM_SourceFileName[256]; -export INTEGER OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet; -export LONGINT OPM_MaxIndex; +export int32 OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet; +export int64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; -export LONGINT OPM_curpos, OPM_errpos, OPM_breakpc; -export INTEGER OPM_currFile, OPM_level, OPM_pc, OPM_entno; +export int64 OPM_curpos, OPM_errpos, OPM_breakpc; +export int32 OPM_currFile, OPM_level, OPM_pc, OPM_entno; export CHAR OPM_modName[32]; export CHAR OPM_objname[64]; export SET OPM_opt, OPM_glbopt; -static LONGINT OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; +static int64 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; static Texts_Reader OPM_inR; static Texts_Text OPM_Log; static Texts_Writer OPM_W; static Files_Rider OPM_oldSF, OPM_newSF; static Files_Rider OPM_R[3]; static Files_File OPM_oldSFile, OPM_newSFile, OPM_HFile, OPM_BFile, OPM_HIFile; -static INTEGER OPM_S; +static int32 OPM_S; export BOOLEAN OPM_dontAsm, OPM_dontLink, OPM_mainProg, OPM_mainLinkStat, OPM_notColorOutput, OPM_forceNewSym, OPM_Verbose; static CHAR OPM_OBERON[1024]; static CHAR OPM_MODULES[1024]; @@ -41,54 +41,54 @@ static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F); export void OPM_CloseFiles (void); export void OPM_CloseOldSym (void); export void OPM_DeleteNewSym (void); -export void OPM_FPrint (LONGINT *fp, LONGINT val); -export void OPM_FPrintLReal (LONGINT *fp, LONGREAL lr); -export void OPM_FPrintReal (LONGINT *fp, REAL real); -export void OPM_FPrintSet (LONGINT *fp, SET set); -static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, LONGINT pos); +export void OPM_FPrint (int64 *fp, int64 val); +export void OPM_FPrintLReal (int64 *fp, LONGREAL lr); +export void OPM_FPrintReal (int64 *fp, REAL real); +export void OPM_FPrintSet (int64 *fp, SET set); +static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, int64 pos); export void OPM_Get (CHAR *ch); static void OPM_GetProperties (void); -static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONGINT name__len, INTEGER *size, INTEGER *align); +static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONGINT name__len, int32 *size, int32 *align); export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); export void OPM_InitOptions (void); -static void OPM_LogErrMsg (INTEGER n); +static void OPM_LogErrMsg (int32 n); export void OPM_LogW (CHAR ch); export void OPM_LogWLn (void); -export void OPM_LogWNum (LONGINT i, LONGINT len); +export void OPM_LogWNum (int64 i, int64 len); export void OPM_LogWStr (CHAR *s, LONGINT s__len); static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len); -export void OPM_Mark (INTEGER n, LONGINT pos); +export void OPM_Mark (int32 n, int64 pos); export void OPM_NewSym (CHAR *modName, LONGINT modName__len); export void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); export void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); export BOOLEAN OPM_OpenPar (void); export void OPM_RegisterNewSym (void); static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt); -static void OPM_ShowLine (LONGINT pos); -export LONGINT OPM_SignedMaximum (LONGINT bytecount); -export LONGINT OPM_SignedMinimum (LONGINT bytecount); +static void OPM_ShowLine (int64 pos); +export int64 OPM_SignedMaximum (int64 bytecount); +export int64 OPM_SignedMinimum (int64 bytecount); export void OPM_SymRCh (CHAR *ch); -export LONGINT OPM_SymRInt (void); +export int64 OPM_SymRInt (void); export void OPM_SymRLReal (LONGREAL *lr); export void OPM_SymRReal (REAL *r); export void OPM_SymRSet (SET *s); export void OPM_SymWCh (CHAR ch); -export void OPM_SymWInt (LONGINT i); +export void OPM_SymWInt (int64 i); export void OPM_SymWLReal (LONGREAL lr); export void OPM_SymWReal (REAL r); export void OPM_SymWSet (SET s); static void OPM_VerboseListSizes (void); export void OPM_Write (CHAR ch); -export void OPM_WriteHex (LONGINT i); -export void OPM_WriteInt (LONGINT i); +export void OPM_WriteHex (int64 i); +export void OPM_WriteInt (int64 i); export void OPM_WriteLn (void); export void OPM_WriteReal (LONGREAL r, CHAR suffx); export void OPM_WriteString (CHAR *s, LONGINT s__len); export void OPM_WriteStringVar (CHAR *s, LONGINT s__len); export BOOLEAN OPM_eofSF (void); -export void OPM_err (INTEGER n); -static LONGINT OPM_minusop (LONGINT i); -static LONGINT OPM_power0 (LONGINT i, LONGINT j); +export void OPM_err (int32 n); +static int64 OPM_minusop (int64 i); +static int64 OPM_power0 (int64 i, int64 j); void OPM_LogW (CHAR ch) @@ -103,7 +103,7 @@ void OPM_LogWStr (CHAR *s, LONGINT s__len) __DEL(s); } -void OPM_LogWNum (LONGINT i, LONGINT len) +void OPM_LogWNum (int64 i, int64 len) { Console_Int(i, len); } @@ -115,7 +115,7 @@ void OPM_LogWLn (void) static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) { - INTEGER i; + int32 i; i = 1; while (s[__X(i, s__len)] != 0x00) { switch (s[__X(i, s__len)]) { @@ -300,7 +300,7 @@ void OPM_InitOptions (void) void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len) { Texts_Text T = NIL; - LONGINT beg, end, time; + int64 beg, end, time; CHAR s[256]; *done = 0; OPM_curpos = 0; @@ -348,7 +348,7 @@ void OPM_Get (CHAR *ch) static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len) { - INTEGER i, j; + int32 i, j; CHAR ch; __DUP(ext, ext__len, CHAR); i = 0; @@ -370,12 +370,12 @@ static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGIN __DEL(ext); } -static void OPM_LogErrMsg (INTEGER n) +static void OPM_LogErrMsg (int32 n) { Texts_Scanner S; Texts_Text T = NIL; CHAR ch; - INTEGER i; + int32 i; CHAR buf[1024]; if (n >= 0) { if (!OPM_notColorOutput) { @@ -400,7 +400,7 @@ static void OPM_LogErrMsg (INTEGER n) OPM_LogWStr(errors_errors[__X(n, 350)], 128); } -static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, LONGINT pos) +static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, int64 pos) { CHAR ch, cheol; if (pos < OPM_ErrorLineStartPos) { @@ -432,12 +432,12 @@ static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, LONGINT Files_Set(&*r, r__typ, f, OPM_ErrorLineStartPos); } -static void OPM_ShowLine (LONGINT pos) +static void OPM_ShowLine (int64 pos) { Files_File f = NIL; Files_Rider r; CHAR line[1023]; - INTEGER i; + int32 i; CHAR ch; f = Files_Old(OPM_SourceFileName, 256); OPM_FindLine(f, &r, Files_Rider__typ, pos); @@ -459,7 +459,7 @@ static void OPM_ShowLine (LONGINT pos) if (pos >= OPM_ErrorLineLimitPos) { pos = OPM_ErrorLineLimitPos - 1; } - i = (SYSTEM_INT32)(pos - OPM_ErrorLineStartPos); + i = (int32)(pos - OPM_ErrorLineStartPos); while (i > 0) { OPM_LogW(' '); i -= 1; @@ -474,7 +474,7 @@ static void OPM_ShowLine (LONGINT pos) Files_Close(f); } -void OPM_Mark (INTEGER n, LONGINT pos) +void OPM_Mark (int32 n, int64 pos) { if (pos == -1) { pos = 0; @@ -526,49 +526,49 @@ void OPM_Mark (INTEGER n, LONGINT pos) } } -void OPM_err (INTEGER n) +void OPM_err (int32 n) { OPM_Mark(n, OPM_errpos); } -void OPM_FPrint (LONGINT *fp, LONGINT val) +void OPM_FPrint (int64 *fp, int64 val) { - *fp = __ROTL((LONGINT)((SET)*fp ^ (SET)val), 1, LONGINT); + *fp = __ROTL((int64)((SET)*fp ^ (SET)val), 1, int64); } -void OPM_FPrintSet (LONGINT *fp, SET set) +void OPM_FPrintSet (int64 *fp, SET set) { - OPM_FPrint(&*fp, (LONGINT)set); + OPM_FPrint(&*fp, (int64)set); } -void OPM_FPrintReal (LONGINT *fp, REAL real) +void OPM_FPrintReal (int64 *fp, REAL real) { - INTEGER i; - LONGINT l; - __GET((SYSTEM_ADRINT)&real, i, INTEGER); + int32 i; + int64 l; + __GET((SYSTEM_ADRINT)&real, i, int32); l = i; OPM_FPrint(&*fp, l); } -void OPM_FPrintLReal (LONGINT *fp, LONGREAL lr) +void OPM_FPrintLReal (int64 *fp, LONGREAL lr) { - LONGINT l, h; - OPM_FPrint(&*fp, __VAL(LONGINT, lr)); + int64 l, h; + OPM_FPrint(&*fp, __VAL(int64, lr)); } -static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONGINT name__len, INTEGER *size, INTEGER *align) +static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONGINT name__len, int32 *size, int32 *align) { __DUP(name, name__len, CHAR); if (((*S).class == 1 && __STRCMP((*S).s, name) == 0)) { Texts_Scan(&*S, S__typ); if ((*S).class == 3) { - *size = (SYSTEM_INT32)(*S).i; + *size = (int32)(*S).i; Texts_Scan(&*S, S__typ); } else { OPM_Mark(-157, -1); } if ((*S).class == 3) { - *align = (SYSTEM_INT32)(*S).i; + *align = (int32)(*S).i; Texts_Scan(&*S, S__typ); } else { OPM_Mark(-157, -1); @@ -579,17 +579,17 @@ static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONG __DEL(name); } -static LONGINT OPM_minusop (LONGINT i) +static int64 OPM_minusop (int64 i) { - LONGINT _o_result; + int64 _o_result; _o_result = -i; return _o_result; } -static LONGINT OPM_power0 (LONGINT i, LONGINT j) +static int64 OPM_power0 (int64 i, int64 j) { - LONGINT _o_result; - LONGINT k, p; + int64 _o_result; + int64 k, p; k = 1; p = i; do { @@ -641,19 +641,19 @@ static void OPM_VerboseListSizes (void) OPM_LogWLn(); } -LONGINT OPM_SignedMaximum (LONGINT bytecount) +int64 OPM_SignedMaximum (int64 bytecount) { - LONGINT _o_result; - LONGINT result; + int64 _o_result; + int64 result; result = 1; - result = __LSH(result, __ASHL(bytecount, 3) - 1, LONGINT); + result = __LSH(result, __ASHL(bytecount, 3) - 1, int64); _o_result = result - 1; return _o_result; } -LONGINT OPM_SignedMinimum (LONGINT bytecount) +int64 OPM_SignedMinimum (int64 bytecount) { - LONGINT _o_result; + int64 _o_result; _o_result = -OPM_SignedMaximum(bytecount) - 1; return _o_result; } @@ -687,10 +687,10 @@ void OPM_SymRCh (CHAR *ch) Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&*ch); } -LONGINT OPM_SymRInt (void) +int64 OPM_SymRInt (void) { - LONGINT _o_result; - LONGINT k; + int64 _o_result; + int64 k; Files_ReadNum(&OPM_oldSF, Files_Rider__typ, &k); _o_result = k; return _o_result; @@ -698,7 +698,7 @@ LONGINT OPM_SymRInt (void) void OPM_SymRSet (SET *s) { - Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (LONGINT*)&*s); + Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (int64*)&*s); } void OPM_SymRReal (REAL *r) @@ -745,14 +745,14 @@ void OPM_SymWCh (CHAR ch) Files_Write(&OPM_newSF, Files_Rider__typ, ch); } -void OPM_SymWInt (LONGINT i) +void OPM_SymWInt (int64 i) { Files_WriteNum(&OPM_newSF, Files_Rider__typ, i); } void OPM_SymWSet (SET s) { - Files_WriteNum(&OPM_newSF, Files_Rider__typ, (LONGINT)s); + Files_WriteNum(&OPM_newSF, Files_Rider__typ, (int64)s); } void OPM_SymWReal (REAL r) @@ -796,7 +796,7 @@ void OPM_Write (CHAR ch) void OPM_WriteString (CHAR *s, LONGINT s__len) { - INTEGER i; + int32 i; i = 0; while (s[__X(i, s__len)] != 0x00) { i += 1; @@ -806,7 +806,7 @@ void OPM_WriteString (CHAR *s, LONGINT s__len) void OPM_WriteStringVar (CHAR *s, LONGINT s__len) { - INTEGER i; + int32 i; i = 0; while (s[__X(i, s__len)] != 0x00) { i += 1; @@ -814,17 +814,17 @@ void OPM_WriteStringVar (CHAR *s, LONGINT s__len) Files_WriteBytes(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, (void*)s, s__len * 1, i); } -void OPM_WriteHex (LONGINT i) +void OPM_WriteHex (int64 i) { CHAR s[3]; - INTEGER digit; - digit = __ASHR((SYSTEM_INT32)i, 4); + int32 digit; + digit = __ASHR((int32)i, 4); if (digit < 10) { s[0] = (CHAR)(48 + digit); } else { s[0] = (CHAR)(87 + digit); } - digit = __MASK((SYSTEM_INT32)i, -16); + digit = __MASK((int32)i, -16); if (digit < 10) { s[1] = (CHAR)(48 + digit); } else { @@ -834,10 +834,10 @@ void OPM_WriteHex (LONGINT i) OPM_WriteString(s, 3); } -void OPM_WriteInt (LONGINT i) +void OPM_WriteInt (int64 i) { CHAR s[20]; - LONGINT i1, k; + int64 i1, k; if (i == OPM_SignedMinimum(OPM_IntSize) || i == OPM_SignedMinimum(OPM_LIntSize)) { OPM_Write('('); OPM_WriteInt(i + 1); @@ -870,7 +870,7 @@ void OPM_WriteReal (LONGREAL r, CHAR suffx) Texts_Reader R; CHAR s[32]; CHAR ch; - INTEGER i; + int32 i; if ((((r < OPM_SignedMaximum(OPM_LIntSize) && r > OPM_SignedMinimum(OPM_LIntSize))) && r == (__ENTIER(r)))) { if (suffx == 'f') { OPM_WriteString((CHAR*)"(REAL)", 7); @@ -958,7 +958,7 @@ void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len) void OPM_CloseFiles (void) { CHAR FName[32]; - INTEGER res; + int32 res; if (OPM_noerr) { OPM_LogWStr((CHAR*)" ", 3); OPM_LogWNum(Files_Pos(&OPM_R[1], Files_Rider__typ), 0); diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index 6bbab25d..ccce7304 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -7,12 +7,12 @@ #include "SYSTEM.h" -import INTEGER OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet; -import LONGINT OPM_MaxIndex; +import int32 OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet; +import int64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; -import LONGINT OPM_curpos, OPM_errpos, OPM_breakpc; -import INTEGER OPM_currFile, OPM_level, OPM_pc, OPM_entno; +import int64 OPM_curpos, OPM_errpos, OPM_breakpc; +import int32 OPM_currFile, OPM_level, OPM_pc, OPM_entno; import CHAR OPM_modName[32]; import CHAR OPM_objname[64]; import SET OPM_opt, OPM_glbopt; @@ -22,44 +22,44 @@ import BOOLEAN OPM_dontAsm, OPM_dontLink, OPM_mainProg, OPM_mainLinkStat, OPM_no import void OPM_CloseFiles (void); import void OPM_CloseOldSym (void); import void OPM_DeleteNewSym (void); -import void OPM_FPrint (LONGINT *fp, LONGINT val); -import void OPM_FPrintLReal (LONGINT *fp, LONGREAL lr); -import void OPM_FPrintReal (LONGINT *fp, REAL real); -import void OPM_FPrintSet (LONGINT *fp, SET set); +import void OPM_FPrint (int64 *fp, int64 val); +import void OPM_FPrintLReal (int64 *fp, LONGREAL lr); +import void OPM_FPrintReal (int64 *fp, REAL real); +import void OPM_FPrintSet (int64 *fp, SET set); import void OPM_Get (CHAR *ch); import void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); import void OPM_InitOptions (void); import void OPM_LogW (CHAR ch); import void OPM_LogWLn (void); -import void OPM_LogWNum (LONGINT i, LONGINT len); +import void OPM_LogWNum (int64 i, int64 len); import void OPM_LogWStr (CHAR *s, LONGINT s__len); -import void OPM_Mark (INTEGER n, LONGINT pos); +import void OPM_Mark (int32 n, int64 pos); import void OPM_NewSym (CHAR *modName, LONGINT modName__len); import void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); import void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); import BOOLEAN OPM_OpenPar (void); import void OPM_RegisterNewSym (void); -import LONGINT OPM_SignedMaximum (LONGINT bytecount); -import LONGINT OPM_SignedMinimum (LONGINT bytecount); +import int64 OPM_SignedMaximum (int64 bytecount); +import int64 OPM_SignedMinimum (int64 bytecount); import void OPM_SymRCh (CHAR *ch); -import LONGINT OPM_SymRInt (void); +import int64 OPM_SymRInt (void); import void OPM_SymRLReal (LONGREAL *lr); import void OPM_SymRReal (REAL *r); import void OPM_SymRSet (SET *s); import void OPM_SymWCh (CHAR ch); -import void OPM_SymWInt (LONGINT i); +import void OPM_SymWInt (int64 i); import void OPM_SymWLReal (LONGREAL lr); import void OPM_SymWReal (REAL r); import void OPM_SymWSet (SET s); import void OPM_Write (CHAR ch); -import void OPM_WriteHex (LONGINT i); -import void OPM_WriteInt (LONGINT i); +import void OPM_WriteHex (int64 i); +import void OPM_WriteInt (int64 i); import void OPM_WriteLn (void); import void OPM_WriteReal (LONGREAL r, CHAR suffx); import void OPM_WriteString (CHAR *s, LONGINT s__len); import void OPM_WriteStringVar (CHAR *s, LONGINT s__len); import BOOLEAN OPM_eofSF (void); -import void OPM_err (INTEGER n); +import void OPM_err (int32 n); import void *OPM__init(void); diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index 9337c539..78136a18 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -7,17 +7,17 @@ #include "OPT.h" struct OPP__1 { - LONGINT low, high; + int64 low, high; }; typedef struct OPP__1 OPP_CaseTable[128]; -static SHORTINT OPP_sym, OPP_level; -static INTEGER OPP_LoopLevel; +static int8 OPP_sym, OPP_level; +static int32 OPP_LoopLevel; static OPT_Node OPP_TDinit, OPP_lastTDinit; -static INTEGER OPP_nofFwdPtr; +static int32 OPP_nofFwdPtr; static OPT_Struct OPP_FwdPtr[64]; export LONGINT *OPP__1__typ; @@ -25,10 +25,10 @@ export LONGINT *OPP__1__typ; static void OPP_ActualParameters (OPT_Node *aparlist, OPT_Object fpar); static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned); static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq); -static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, OPP_CaseTable tab); -static void OPP_CheckMark (SHORTINT *vis); -static void OPP_CheckSym (INTEGER s); -static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_); +static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int32 *n, OPP_CaseTable tab); +static void OPP_CheckMark (int8 *vis); +static void OPP_CheckSym (int32 s); +static void OPP_CheckSysFlag (int32 *sysflag, int32 default_); static void OPP_ConstExpression (OPT_Node *x); static void OPP_Element (OPT_Node *x); static void OPP_Expression (OPT_Node *x); @@ -38,7 +38,7 @@ static void OPP_FormalParameters (OPT_Object *firstPar, OPT_Struct *resTyp); export void OPP_Module (OPT_Node *prog, SET opt); static void OPP_PointerType (OPT_Struct *typ); static void OPP_ProcedureDeclaration (OPT_Node *x); -static void OPP_Receiver (SHORTINT *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec); +static void OPP_Receiver (int8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec); static void OPP_RecordType (OPT_Struct *typ, OPT_Struct *banned); static void OPP_Sets (OPT_Node *x); static void OPP_SimpleExpression (OPT_Node *x); @@ -47,17 +47,17 @@ static void OPP_StatSeq (OPT_Node *stat); static void OPP_Term (OPT_Node *x); static void OPP_Type (OPT_Struct *typ, OPT_Struct *banned); static void OPP_TypeDecl (OPT_Struct *typ, OPT_Struct *banned); -static void OPP_err (INTEGER n); +static void OPP_err (int32 n); static void OPP_qualident (OPT_Object *id); static void OPP_selector (OPT_Node *x); -static void OPP_err (INTEGER n) +static void OPP_err (int32 n) { OPM_err(n); } -static void OPP_CheckSym (INTEGER s) +static void OPP_CheckSym (int32 s) { if (OPP_sym == s) { OPS_Get(&OPP_sym); @@ -69,7 +69,7 @@ static void OPP_CheckSym (INTEGER s) static void OPP_qualident (OPT_Object *id) { OPT_Object obj = NIL; - SHORTINT lev; + int8 lev; OPT_Find(&obj); OPS_Get(&OPP_sym); if ((((OPP_sym == 18 && obj != NIL)) && obj->mode == 11)) { @@ -109,7 +109,7 @@ static void OPP_ConstExpression (OPT_Node *x) } } -static void OPP_CheckMark (SHORTINT *vis) +static void OPP_CheckMark (int8 *vis) { OPS_Get(&OPP_sym); if (OPP_sym == 1 || OPP_sym == 7) { @@ -127,10 +127,10 @@ static void OPP_CheckMark (SHORTINT *vis) } } -static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_) +static void OPP_CheckSysFlag (int32 *sysflag, int32 default_) { OPT_Node x = NIL; - LONGINT sf; + int64 sf; if (OPP_sym == 31) { OPS_Get(&OPP_sym); if (!OPT_SYSimported) { @@ -147,7 +147,7 @@ static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_) OPP_err(51); sf = 0; } - *sysflag = (SYSTEM_INT32)sf; + *sysflag = (int32)sf; OPP_CheckSym(23); } else { *sysflag = default_; @@ -158,7 +158,7 @@ static void OPP_RecordType (OPT_Struct *typ, OPT_Struct *banned) { OPT_Object fld = NIL, first = NIL, last = NIL, base = NIL; OPT_Struct ftyp = NIL; - INTEGER sysflag; + int32 sysflag; *typ = OPT_NewStr(13, 4); (*typ)->BaseTyp = NIL; OPP_CheckSysFlag(&sysflag, -1); @@ -250,8 +250,8 @@ static void OPP_RecordType (OPT_Struct *typ, OPT_Struct *banned) static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) { OPT_Node x = NIL; - LONGINT n; - INTEGER sysflag; + int64 n; + int32 sysflag; OPP_CheckSysFlag(&sysflag, 0); if (OPP_sym == 25) { *typ = OPT_NewStr(13, 3); @@ -343,7 +343,7 @@ static void OPP_PointerType (OPT_Struct *typ) static void OPP_FormalParameters (OPT_Object *firstPar, OPT_Struct *resTyp) { - SHORTINT mode; + int8 mode; OPT_Object par = NIL, first = NIL, last = NIL, res = NIL; OPT_Struct typ = NIL; first = NIL; @@ -624,9 +624,9 @@ static void OPP_ActualParameters (OPT_Node *aparlist, OPT_Object fpar) static void OPP_StandProcCall (OPT_Node *x) { OPT_Node y = NIL; - SHORTINT m; - INTEGER n; - m = (SYSTEM_INT8)((SYSTEM_INT32)(*x)->obj->adr); + int8 m; + int32 n; + m = (int8)((int32)(*x)->obj->adr); n = 0; if (OPP_sym == 30) { OPS_Get(&OPP_sym); @@ -785,7 +785,7 @@ static void OPP_Factor (OPT_Node *x) static void OPP_Term (OPT_Node *x) { OPT_Node y = NIL; - SHORTINT mulop; + int8 mulop; OPP_Factor(&*x); while ((1 <= OPP_sym && OPP_sym <= 5)) { mulop = OPP_sym; @@ -798,7 +798,7 @@ static void OPP_Term (OPT_Node *x) static void OPP_SimpleExpression (OPT_Node *x) { OPT_Node y = NIL; - SHORTINT addop; + int8 addop; if (OPP_sym == 7) { OPS_Get(&OPP_sym); OPP_Term(&*x); @@ -822,7 +822,7 @@ static void OPP_Expression (OPT_Node *x) { OPT_Node y = NIL; OPT_Object obj = NIL; - SHORTINT relation; + int8 relation; OPP_SimpleExpression(&*x); if ((9 <= OPP_sym && OPP_sym <= 14)) { relation = OPP_sym; @@ -848,7 +848,7 @@ static void OPP_Expression (OPT_Node *x) } } -static void OPP_Receiver (SHORTINT *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec) +static void OPP_Receiver (int8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec) { OPT_Object obj = NIL; *typ = OPT_undftyp; @@ -914,7 +914,7 @@ static struct ProcedureDeclaration__16 { OPT_Node *x; OPT_Object *proc, *fwd; OPS_Name *name; - SHORTINT *mode, *vis; + int8 *mode, *vis; BOOLEAN *forward; struct ProcedureDeclaration__16 *lnk; } *ProcedureDeclaration__16_s; @@ -927,8 +927,8 @@ static void TProcDecl__23 (void); static void GetCode__19 (void) { OPT_ConstExt ext = NIL; - INTEGER n; - LONGINT c; + int32 n; + int64 c; ext = OPT_NewExt(); (*ProcedureDeclaration__16_s->proc)->conval->ext = ext; n = 0; @@ -992,7 +992,7 @@ static void GetParams__21 (void) static void Body__17 (void) { OPT_Node procdec = NIL, statseq = NIL; - LONGINT c; + int64 c; c = OPM_errpos; (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1); OPP_CheckSym(39); @@ -1015,7 +1015,7 @@ static void TProcDecl__23 (void) { OPT_Object baseProc = NIL; OPT_Struct objTyp = NIL, recTyp = NIL; - SHORTINT objMode; + int8 objMode; OPS_Name objName; OPS_Get(&OPP_sym); *ProcedureDeclaration__16_s->mode = 13; @@ -1087,7 +1087,7 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) { OPT_Object proc = NIL, fwd = NIL; OPS_Name name; - SHORTINT mode, vis; + int8 mode, vis; BOOLEAN forward; struct ProcedureDeclaration__16 _s; _s.x = x; @@ -1164,11 +1164,11 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) ProcedureDeclaration__16_s = _s.lnk; } -static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, OPP_CaseTable tab) +static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int32 *n, OPP_CaseTable tab) { OPT_Node x = NIL, y = NIL, lastlab = NIL; - INTEGER i, f; - LONGINT xval, yval; + int32 i, f; + int64 xval, yval; *lab = NIL; lastlab = NIL; for (;;) { @@ -1235,7 +1235,7 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, O } static struct StatSeq__30 { - LONGINT *pos; + int64 *pos; struct StatSeq__30 *lnk; } *StatSeq__30_s; @@ -1245,8 +1245,8 @@ static void SetPos__35 (OPT_Node x); static void CasePart__31 (OPT_Node *x) { - INTEGER n; - LONGINT low, high; + int32 n; + int64 low, high; BOOLEAN e; OPP_CaseTable tab; OPT_Node cases = NIL, lab = NIL, y = NIL, lastcase = NIL; @@ -1329,7 +1329,7 @@ static void OPP_StatSeq (OPT_Node *stat) OPT_Struct idtyp = NIL; BOOLEAN e; OPT_Node s = NIL, x = NIL, y = NIL, z = NIL, apar = NIL, last = NIL, lastif = NIL; - LONGINT pos; + int64 pos; OPS_Name name; struct StatSeq__30 _s; _s.pos = &pos; @@ -1622,7 +1622,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) OPT_Struct typ = NIL; OPT_Object obj = NIL, first = NIL, last = NIL; OPT_Node x = NIL, lastdec = NIL; - INTEGER i; + int32 i; first = NIL; last = NIL; OPP_nofFwdPtr = 0; @@ -1775,7 +1775,7 @@ void OPP_Module (OPT_Node *prog, SET opt) { OPS_Name impName, aliasName; OPT_Node procdec = NIL, statseq = NIL; - LONGINT c; + int64 c; BOOLEAN done; OPS_Init(); OPP_LoopLevel = 0; diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index e575dfe6..efd39a62 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -12,29 +12,29 @@ typedef export OPS_Name OPS_name; export OPS_String OPS_str; -export INTEGER OPS_numtyp; -export LONGINT OPS_intval; +export int32 OPS_numtyp; +export int64 OPS_intval; export REAL OPS_realval; export LONGREAL OPS_lrlval; static CHAR OPS_ch; -export void OPS_Get (SHORTINT *sym); -static void OPS_Identifier (SHORTINT *sym); +export void OPS_Get (int8 *sym); +static void OPS_Identifier (int8 *sym); export void OPS_Init (void); static void OPS_Number (void); -static void OPS_Str (SHORTINT *sym); -static void OPS_err (INTEGER n); +static void OPS_Str (int8 *sym); +static void OPS_err (int32 n); -static void OPS_err (INTEGER n) +static void OPS_err (int32 n) { OPM_err(n); } -static void OPS_Str (SHORTINT *sym) +static void OPS_Str (int8 *sym) { - INTEGER i; + int32 i; CHAR och; i = 0; och = OPS_ch; @@ -66,9 +66,9 @@ static void OPS_Str (SHORTINT *sym) } } -static void OPS_Identifier (SHORTINT *sym) +static void OPS_Identifier (int8 *sym) { - INTEGER i; + int32 i; i = 0; do { OPS_name[i] = OPS_ch; @@ -87,10 +87,10 @@ static struct Number__6 { struct Number__6 *lnk; } *Number__6_s; -static INTEGER Ord__7 (CHAR ch, BOOLEAN hex); -static LONGREAL Ten__9 (INTEGER e); +static int32 Ord__7 (CHAR ch, BOOLEAN hex); +static LONGREAL Ten__9 (int32 e); -static LONGREAL Ten__9 (INTEGER e) +static LONGREAL Ten__9 (int32 e) { LONGREAL _o_result; LONGREAL x, p; @@ -109,9 +109,9 @@ static LONGREAL Ten__9 (INTEGER e) return _o_result; } -static INTEGER Ord__7 (CHAR ch, BOOLEAN hex) +static int32 Ord__7 (CHAR ch, BOOLEAN hex) { - INTEGER _o_result; + int32 _o_result; if (ch <= '9') { _o_result = ch - 48; return _o_result; @@ -128,7 +128,7 @@ static INTEGER Ord__7 (CHAR ch, BOOLEAN hex) static void OPS_Number (void) { - INTEGER i, m, n, d, e, maxHdig; + int32 i, m, n, d, e, maxHdig; CHAR dig[24]; LONGREAL f; CHAR expCh; @@ -174,7 +174,7 @@ static void OPS_Number (void) OPS_numtyp = 1; if (n <= 2) { while (i < n) { - OPS_intval = __ASHL(OPS_intval, 4) + (SYSTEM_INT64)Ord__7(dig[i], 1); + OPS_intval = __ASHL(OPS_intval, 4) + (int64)Ord__7(dig[i], 1); i += 1; } } else { @@ -189,7 +189,7 @@ static void OPS_Number (void) OPS_intval = -1; } while (i < n) { - OPS_intval = __ASHL(OPS_intval, 4) + (SYSTEM_INT64)Ord__7(dig[i], 1); + OPS_intval = __ASHL(OPS_intval, 4) + (int64)Ord__7(dig[i], 1); i += 1; } } else { @@ -200,8 +200,8 @@ static void OPS_Number (void) while (i < n) { d = Ord__7(dig[i], 0); i += 1; - if (OPS_intval <= __DIV(9223372036854775807 - (SYSTEM_INT64)d, 10)) { - OPS_intval = OPS_intval * 10 + (SYSTEM_INT64)d; + if (OPS_intval <= __DIV(9223372036854775807 - (int64)d, 10)) { + OPS_intval = OPS_intval * 10 + (int64)d; } else { OPS_err(203); } @@ -310,9 +310,9 @@ static void Comment__2 (void) } } -void OPS_Get (SHORTINT *sym) +void OPS_Get (int8 *sym) { - SHORTINT s; + int8 s; struct Get__1 _s; _s.lnk = Get__1_s; Get__1_s = &_s; diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index a60ffe74..c497e5c6 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -15,13 +15,13 @@ typedef import OPS_Name OPS_name; import OPS_String OPS_str; -import INTEGER OPS_numtyp; -import LONGINT OPS_intval; +import int32 OPS_numtyp; +import int64 OPS_intval; import REAL OPS_realval; import LONGREAL OPS_lrlval; -import void OPS_Get (SHORTINT *sym); +import void OPS_Get (int8 *sym); import void OPS_Init (void); import void *OPS__init(void); diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index 35088301..287c2ba6 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -13,17 +13,17 @@ typedef typedef struct OPT_ConstDesc { OPT_ConstExt ext; - LONGINT intval, intval2; + int64 intval, intval2; SET setval; LONGREAL realval; } OPT_ConstDesc; typedef struct OPT_ExpCtxt { - LONGINT reffp; - INTEGER ref; - SHORTINT nofm; - SHORTINT locmno[64]; + int64 reffp; + int32 ref; + int8 nofm; + int8 locmno[64]; } OPT_ExpCtxt; typedef @@ -34,13 +34,13 @@ typedef typedef struct OPT_ImpCtxt { - LONGINT nextTag, reffp; - INTEGER nofr, minr, nofm; + int64 nextTag, reffp; + int32 nofr, minr, nofm; BOOLEAN self; OPT_Struct ref[255]; OPT_Object old[255]; - LONGINT pvfp[255]; - SHORTINT glbmno[64]; + int64 pvfp[255]; + int8 glbmno[64]; } OPT_ImpCtxt; typedef @@ -49,7 +49,7 @@ typedef typedef struct OPT_NodeDesc { OPT_Node left, right, link; - SHORTINT class, subcl; + int8 class, subcl; BOOLEAN readonly; OPT_Struct typ; OPT_Object obj; @@ -61,22 +61,22 @@ typedef OPT_Object left, right, link, scope; OPS_Name name; BOOLEAN leaf; - SHORTINT mode, mnolev, vis, history; + int8 mode, mnolev, vis, history; BOOLEAN used, fpdone; - LONGINT fprint; + int64 fprint; OPT_Struct typ; OPT_Const conval; - LONGINT adr, linkadr; - INTEGER x; + int64 adr, linkadr; + int32 x; } OPT_ObjDesc; typedef struct OPT_StrDesc { - SHORTINT form, comp, mno, extlev; - INTEGER ref, sysflag; - LONGINT n, size, align, txtpos; + int8 form, comp, mno, extlev; + int32 ref, sysflag; + int64 n, size, align, txtpos; BOOLEAN allocated, pbused, pvused, fpdone, idfpdone; - LONGINT idfp, pbfp, pvfp; + int64 idfp, pbfp, pvfp; OPT_Struct BaseTyp; OPT_Object link, strobj; } OPT_StrDesc; @@ -85,7 +85,7 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; -export SHORTINT OPT_nofGmod; +export int8 OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; export BOOLEAN OPT_SYSimported; @@ -93,7 +93,7 @@ static OPT_Struct OPT_IntTypes[20]; static OPT_Object OPT_universe, OPT_syslink; static OPT_ImpCtxt OPT_impCtxt; static OPT_ExpCtxt OPT_expCtxt; -static LONGINT OPT_nofhdfld; +static int64 OPT_nofhdfld; static BOOLEAN OPT_newsf, OPT_findpc, OPT_extsf, OPT_sfpresent, OPT_symExtended, OPT_symNew; export LONGINT *OPT_ConstDesc__typ; @@ -106,62 +106,62 @@ export LONGINT *OPT_ExpCtxt__typ; export void OPT_Close (void); export void OPT_CloseScope (void); static void OPT_DebugStruct (OPT_Struct btyp); -static void OPT_EnterBoolConst (OPS_Name name, LONGINT value); -static void OPT_EnterProc (OPS_Name name, INTEGER num); -static void OPT_EnterTyp (OPS_Name name, SHORTINT form, INTEGER size, OPT_Struct *res); +static void OPT_EnterBoolConst (OPS_Name name, int64 value); +static void OPT_EnterProc (OPS_Name name, int32 num); +static void OPT_EnterTyp (OPS_Name name, int8 form, int32 size, OPT_Struct *res); export void OPT_Export (BOOLEAN *ext, BOOLEAN *new); -export void OPT_FPrintErr (OPT_Object obj, INTEGER errcode); -static void OPT_FPrintName (LONGINT *fp, CHAR *name, LONGINT name__len); +export void OPT_FPrintErr (OPT_Object obj, int32 errcode); +static void OPT_FPrintName (int64 *fp, CHAR *name, LONGINT name__len); export void OPT_FPrintObj (OPT_Object obj); -static void OPT_FPrintSign (LONGINT *fp, OPT_Struct result, OPT_Object par); +static void OPT_FPrintSign (int64 *fp, OPT_Struct result, OPT_Object par); export void OPT_FPrintStr (OPT_Struct typ); export void OPT_Find (OPT_Object *res); export void OPT_FindField (OPS_Name name, OPT_Struct typ, OPT_Object *res); export void OPT_FindImport (OPT_Object mod, OPT_Object *res); export void OPT_IdFPrint (OPT_Struct typ); export void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); -static void OPT_InConstant (LONGINT f, OPT_Const conval); +static void OPT_InConstant (int64 f, OPT_Const conval); static OPT_Object OPT_InFld (void); -static void OPT_InMod (SHORTINT *mno); +static void OPT_InMod (int8 *mno); static void OPT_InName (CHAR *name, LONGINT name__len); -static OPT_Object OPT_InObj (SHORTINT mno); -static void OPT_InSign (SHORTINT mno, OPT_Struct *res, OPT_Object *par); +static OPT_Object OPT_InObj (int8 mno); +static void OPT_InSign (int8 mno, OPT_Struct *res, OPT_Object *par); static void OPT_InStruct (OPT_Struct *typ); -static OPT_Object OPT_InTProc (SHORTINT mno); -static OPT_Struct OPT_InTyp (LONGINT tag); +static OPT_Object OPT_InTProc (int8 mno); +static OPT_Struct OPT_InTyp (int64 tag); export void OPT_Init (OPS_Name name, SET opt); -static void OPT_InitStruct (OPT_Struct *typ, SHORTINT form); +static void OPT_InitStruct (OPT_Struct *typ, int8 form); export void OPT_Insert (OPS_Name name, OPT_Object *obj); export void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); -export OPT_Struct OPT_IntType (LONGINT size); +export OPT_Struct OPT_IntType (int64 size); export OPT_Const OPT_NewConst (void); export OPT_ConstExt OPT_NewExt (void); -export OPT_Node OPT_NewNode (SHORTINT class); +export OPT_Node OPT_NewNode (int8 class); export OPT_Object OPT_NewObj (void); -export OPT_Struct OPT_NewStr (SHORTINT form, SHORTINT comp); -export void OPT_OpenScope (SHORTINT level, OPT_Object owner); +export OPT_Struct OPT_NewStr (int8 form, int8 comp); +export void OPT_OpenScope (int8 level, OPT_Object owner); static void OPT_OutConstant (OPT_Object obj); -static void OPT_OutFlds (OPT_Object fld, LONGINT adr, BOOLEAN visible); -static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, LONGINT adr); -static void OPT_OutMod (INTEGER mno); +static void OPT_OutFlds (OPT_Object fld, int64 adr, BOOLEAN visible); +static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, int64 adr); +static void OPT_OutMod (int32 mno); static void OPT_OutName (CHAR *name, LONGINT name__len); static void OPT_OutObj (OPT_Object obj); static void OPT_OutSign (OPT_Struct result, OPT_Object par); static void OPT_OutStr (OPT_Struct typ); static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj); -export OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir); -static void OPT_err (INTEGER n); +export OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int32 dir); +static void OPT_err (int32 n); -static void OPT_err (INTEGER n) +static void OPT_err (int32 n) { OPM_err(n); } -OPT_Struct OPT_IntType (LONGINT size) +OPT_Struct OPT_IntType (int64 size) { OPT_Struct _o_result; - INTEGER i; + int32 i; i = 1; while ((OPT_IntTypes[__X(i, 20)]->size < size && OPT_IntTypes[__X(i + 1, 20)] != NIL)) { i += 1; @@ -170,10 +170,10 @@ OPT_Struct OPT_IntType (LONGINT size) return _o_result; } -OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir) +OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int32 dir) { OPT_Struct _o_result; - INTEGER i; + int32 i; __ASSERT(x->form == 4, 0); __ASSERT(dir == 1 || dir == -1, 0); __ASSERT(x->BaseTyp == OPT_undftyp, 0); @@ -204,7 +204,7 @@ OPT_Object OPT_NewObj (void) return _o_result; } -OPT_Struct OPT_NewStr (SHORTINT form, SHORTINT comp) +OPT_Struct OPT_NewStr (int8 form, int8 comp) { OPT_Struct _o_result; OPT_Struct typ = NIL; @@ -221,7 +221,7 @@ OPT_Struct OPT_NewStr (SHORTINT form, SHORTINT comp) return _o_result; } -OPT_Node OPT_NewNode (SHORTINT class) +OPT_Node OPT_NewNode (int8 class) { OPT_Node _o_result; OPT_Node node = NIL; @@ -235,12 +235,12 @@ OPT_ConstExt OPT_NewExt (void) { OPT_ConstExt _o_result; OPT_ConstExt ext = NIL; - ext = __NEWARR(NIL, 1, 1, 1, 0, ((SYSTEM_INT64)(256))); + ext = __NEWARR(NIL, 1, 1, 1, 0, ((int64)(256))); _o_result = ext; return _o_result; } -void OPT_OpenScope (SHORTINT level, OPT_Object owner) +void OPT_OpenScope (int8 level, OPT_Object owner) { OPT_Object head = NIL; head = OPT_NewObj(); @@ -278,7 +278,7 @@ void OPT_Init (OPS_Name name, SET opt) void OPT_Close (void) { - INTEGER i; + int32 i; OPT_CloseScope(); i = 0; while (i < 64) { @@ -370,7 +370,7 @@ void OPT_Insert (OPS_Name name, OPT_Object *obj) { OPT_Object ob0 = NIL, ob1 = NIL; BOOLEAN left; - SHORTINT mnolev; + int8 mnolev; ob0 = OPT_topScope; ob1 = ob0->right; left = 0; @@ -408,9 +408,9 @@ void OPT_Insert (OPS_Name name, OPT_Object *obj) *obj = ob1; } -static void OPT_FPrintName (LONGINT *fp, CHAR *name, LONGINT name__len) +static void OPT_FPrintName (int64 *fp, CHAR *name, LONGINT name__len) { - INTEGER i; + int32 i; CHAR ch; i = 0; do { @@ -453,7 +453,7 @@ static void OPT_DebugStruct (OPT_Struct btyp) OPM_LogWLn(); } -static void OPT_FPrintSign (LONGINT *fp, OPT_Struct result, OPT_Object par) +static void OPT_FPrintSign (int64 *fp, OPT_Struct result, OPT_Object par) { OPT_IdFPrint(result); OPM_FPrint(&*fp, result->idfp); @@ -469,8 +469,8 @@ void OPT_IdFPrint (OPT_Struct typ) { OPT_Struct btyp = NIL; OPT_Object strobj = NIL; - LONGINT idfp; - INTEGER f, c; + int64 idfp; + int32 f, c; if (!typ->idfpdone) { typ->idfpdone = 1; idfp = 0; @@ -499,17 +499,17 @@ void OPT_IdFPrint (OPT_Struct typ) } static struct FPrintStr__12 { - LONGINT *pbfp, *pvfp; + int64 *pbfp, *pvfp; struct FPrintStr__12 *lnk; } *FPrintStr__12_s; -static void FPrintFlds__13 (OPT_Object fld, LONGINT adr, BOOLEAN visible); -static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr); +static void FPrintFlds__13 (OPT_Object fld, int64 adr, BOOLEAN visible); +static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, int64 adr); static void FPrintTProcs__17 (OPT_Object obj); -static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr) +static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, int64 adr) { - LONGINT i, j, n; + int64 i, j, n; OPT_Struct btyp = NIL; if (typ->comp == 4) { FPrintFlds__13(typ->link, adr, 0); @@ -539,7 +539,7 @@ static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr) } } -static void FPrintFlds__13 (OPT_Object fld, LONGINT adr, BOOLEAN visible) +static void FPrintFlds__13 (OPT_Object fld, int64 adr, BOOLEAN visible) { while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { @@ -574,10 +574,10 @@ static void FPrintTProcs__17 (OPT_Object obj) void OPT_FPrintStr (OPT_Struct typ) { - INTEGER f, c; + int32 f, c; OPT_Struct btyp = NIL; OPT_Object strobj = NIL, bstrobj = NIL; - LONGINT pbfp, pvfp; + int64 pbfp, pvfp; struct FPrintStr__12 _s; _s.pbfp = &pbfp; _s.pvfp = &pvfp; @@ -638,8 +638,8 @@ void OPT_FPrintStr (OPT_Struct typ) void OPT_FPrintObj (OPT_Object obj) { - LONGINT fprint; - INTEGER f, m; + int64 fprint; + int32 f, m; REAL rval; OPT_ConstExt ext = NIL; if (!obj->fpdone) { @@ -696,9 +696,9 @@ void OPT_FPrintObj (OPT_Object obj) } } -void OPT_FPrintErr (OPT_Object obj, INTEGER errcode) +void OPT_FPrintErr (OPT_Object obj, int32 errcode) { - INTEGER i, j; + int32 i, j; CHAR ch; if (obj->mnolev != 0) { __COPY(OPT_GlbMod[__X(-obj->mnolev, 64)]->name, OPM_objname, 64); @@ -788,7 +788,7 @@ void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old) static void OPT_InName (CHAR *name, LONGINT name__len) { - INTEGER i; + int32 i; CHAR ch; i = 0; do { @@ -798,12 +798,12 @@ static void OPT_InName (CHAR *name, LONGINT name__len) } while (!(ch == 0x00)); } -static void OPT_InMod (SHORTINT *mno) +static void OPT_InMod (int8 *mno) { OPT_Object head = NIL; OPS_Name name; - LONGINT mn; - SHORTINT i; + int64 mn; + int8 i; mn = OPM_SymRInt(); if (mn == 0) { *mno = OPT_impCtxt.glbmno[0]; @@ -840,10 +840,10 @@ static void OPT_InMod (SHORTINT *mno) } } -static void OPT_InConstant (LONGINT f, OPT_Const conval) +static void OPT_InConstant (int64 f, OPT_Const conval) { CHAR ch; - INTEGER i; + int32 i; OPT_ConstExt ext = NIL; REAL rval; switch (f) { @@ -889,10 +889,10 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval) } } -static void OPT_InSign (SHORTINT mno, OPT_Struct *res, OPT_Object *par) +static void OPT_InSign (int8 mno, OPT_Struct *res, OPT_Object *par) { OPT_Object last = NIL, new = NIL; - LONGINT tag; + int64 tag; OPT_InStruct(&*res); tag = OPM_SymRInt(); last = NIL; @@ -920,7 +920,7 @@ static void OPT_InSign (SHORTINT mno, OPT_Struct *res, OPT_Object *par) static OPT_Object OPT_InFld (void) { OPT_Object _o_result; - LONGINT tag; + int64 tag; OPT_Object obj = NIL; tag = OPT_impCtxt.nextTag; obj = OPT_NewObj(); @@ -949,10 +949,10 @@ static OPT_Object OPT_InFld (void) return _o_result; } -static OPT_Object OPT_InTProc (SHORTINT mno) +static OPT_Object OPT_InTProc (int8 mno) { OPT_Object _o_result; - LONGINT tag; + int64 tag; OPT_Object obj = NIL; tag = OPT_impCtxt.nextTag; obj = OPT_NewObj(); @@ -977,7 +977,7 @@ static OPT_Object OPT_InTProc (SHORTINT mno) return _o_result; } -static OPT_Struct OPT_InTyp (LONGINT tag) +static OPT_Struct OPT_InTyp (int64 tag) { OPT_Struct _o_result; if (tag == 4) { @@ -992,9 +992,9 @@ static OPT_Struct OPT_InTyp (LONGINT tag) static void OPT_InStruct (OPT_Struct *typ) { - SHORTINT mno; - INTEGER ref; - LONGINT tag; + int8 mno; + int32 ref; + int64 tag; OPS_Name name; OPT_Struct t = NIL; OPT_Object obj = NIL, last = NIL, fld = NIL, old = NIL, dummy = NIL; @@ -1050,7 +1050,7 @@ static void OPT_InStruct (OPT_Struct *typ) obj->vis = 0; tag = OPM_SymRInt(); if (tag == 35) { - (*typ)->sysflag = (SYSTEM_INT32)OPM_SymRInt(); + (*typ)->sysflag = (int32)OPM_SymRInt(); tag = OPM_SymRInt(); } switch (tag) { @@ -1172,14 +1172,14 @@ static void OPT_InStruct (OPT_Struct *typ) } } -static OPT_Object OPT_InObj (SHORTINT mno) +static OPT_Object OPT_InObj (int8 mno) { OPT_Object _o_result; - INTEGER i, s; + int32 i, s; CHAR ch; OPT_Object obj = NIL, old = NIL; OPT_Struct typ = NIL; - LONGINT tag; + int64 tag; OPT_ConstExt ext = NIL; tag = OPT_impCtxt.nextTag; if (tag == 19) { @@ -1212,7 +1212,7 @@ static OPT_Object OPT_InObj (SHORTINT mno) obj->mode = 9; ext = OPT_NewExt(); obj->conval->ext = ext; - s = (SYSTEM_INT32)OPM_SymRInt(); + s = (int32)OPM_SymRInt(); (*ext)[0] = (CHAR)s; i = 1; while (i <= s) { @@ -1278,7 +1278,7 @@ static OPT_Object OPT_InObj (SHORTINT mno) void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) { OPT_Object obj = NIL; - SHORTINT mno; + int8 mno; OPS_Name aliasName__copy; __DUPARR(aliasName, OPS_Name); if (__STRCMP(name, "SYSTEM") == 0) { @@ -1321,7 +1321,7 @@ void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) static void OPT_OutName (CHAR *name, LONGINT name__len) { - INTEGER i; + int32 i; CHAR ch; i = 0; do { @@ -1331,7 +1331,7 @@ static void OPT_OutName (CHAR *name, LONGINT name__len) } while (!(ch == 0x00)); } -static void OPT_OutMod (INTEGER mno) +static void OPT_OutMod (int32 mno) { if (OPT_expCtxt.locmno[__X(mno, 64)] < 0) { OPM_SymWInt(16); @@ -1343,9 +1343,9 @@ static void OPT_OutMod (INTEGER mno) } } -static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, LONGINT adr) +static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, int64 adr) { - LONGINT i, j, n; + int64 i, j, n; OPT_Struct btyp = NIL; if (typ->comp == 4) { OPT_OutFlds(typ->link, adr, 0); @@ -1375,7 +1375,7 @@ static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, LONGINT adr) } } -static void OPT_OutFlds (OPT_Object fld, LONGINT adr, BOOLEAN visible) +static void OPT_OutFlds (OPT_Object fld, int64 adr, BOOLEAN visible) { while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { @@ -1530,7 +1530,7 @@ static void OPT_OutStr (OPT_Struct typ) static void OPT_OutConstant (OPT_Object obj) { - INTEGER f; + int32 f; REAL rval; f = obj->typ->form; OPM_SymWInt(f); @@ -1565,7 +1565,7 @@ static void OPT_OutConstant (OPT_Object obj) static void OPT_OutObj (OPT_Object obj) { - INTEGER i, j; + int32 i, j; OPT_ConstExt ext = NIL; if (obj != NIL) { OPT_OutObj(obj->left); @@ -1655,8 +1655,8 @@ static void OPT_OutObj (OPT_Object obj) void OPT_Export (BOOLEAN *ext, BOOLEAN *new) { - INTEGER i; - SHORTINT nofmod; + int32 i; + int8 nofmod; BOOLEAN done; OPT_symExtended = 0; OPT_symNew = 0; @@ -1698,7 +1698,7 @@ void OPT_Export (BOOLEAN *ext, BOOLEAN *new) } } -static void OPT_InitStruct (OPT_Struct *typ, SHORTINT form) +static void OPT_InitStruct (OPT_Struct *typ, int8 form) { *typ = OPT_NewStr(form, 1); (*typ)->ref = form; @@ -1712,7 +1712,7 @@ static void OPT_InitStruct (OPT_Struct *typ, SHORTINT form) (*typ)->idfpdone = 1; } -static void OPT_EnterBoolConst (OPS_Name name, LONGINT value) +static void OPT_EnterBoolConst (OPS_Name name, int64 value) { OPT_Object obj = NIL; OPS_Name name__copy; @@ -1724,7 +1724,7 @@ static void OPT_EnterBoolConst (OPS_Name name, LONGINT value) obj->conval->intval = value; } -static void OPT_EnterTyp (OPS_Name name, SHORTINT form, INTEGER size, OPT_Struct *res) +static void OPT_EnterTyp (OPS_Name name, int8 form, int32 size, OPT_Struct *res) { OPT_Object obj = NIL; OPT_Struct typ = NIL; @@ -1747,7 +1747,7 @@ static void OPT_EnterTyp (OPS_Name name, SHORTINT form, INTEGER size, OPT_Struct *res = typ; } -static void OPT_EnterProc (OPS_Name name, INTEGER num) +static void OPT_EnterProc (OPS_Name name, int32 num) { OPT_Object obj = NIL; OPS_Name name__copy; diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index c3fdc0cf..808e8043 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -16,7 +16,7 @@ typedef typedef struct OPT_ConstDesc { OPT_ConstExt ext; - LONGINT intval, intval2; + int64 intval, intval2; SET setval; LONGREAL realval; } OPT_ConstDesc; @@ -33,7 +33,7 @@ typedef typedef struct OPT_NodeDesc { OPT_Node left, right, link; - SHORTINT class, subcl; + int8 class, subcl; BOOLEAN readonly; OPT_Struct typ; OPT_Object obj; @@ -45,20 +45,20 @@ typedef OPT_Object left, right, link, scope; OPS_Name name; BOOLEAN leaf; - SHORTINT mode, mnolev, vis, history; + int8 mode, mnolev, vis, history; BOOLEAN used, fpdone; - LONGINT fprint; + int64 fprint; OPT_Struct typ; OPT_Const conval; - LONGINT adr, linkadr; - INTEGER x; + int64 adr, linkadr; + int32 x; } OPT_ObjDesc; typedef struct OPT_StrDesc { - SHORTINT form, comp, mno, extlev; - INTEGER ref, sysflag; - LONGINT n, size, align, txtpos; + int8 form, comp, mno, extlev; + int32 ref, sysflag; + int64 n, size, align, txtpos; BOOLEAN allocated, pbused, pvused; char _prvt0[24]; OPT_Struct BaseTyp; @@ -69,7 +69,7 @@ typedef import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; -import SHORTINT OPT_nofGmod; +import int8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; import BOOLEAN OPT_SYSimported; @@ -82,7 +82,7 @@ import LONGINT *OPT_NodeDesc__typ; import void OPT_Close (void); import void OPT_CloseScope (void); import void OPT_Export (BOOLEAN *ext, BOOLEAN *new); -import void OPT_FPrintErr (OPT_Object obj, INTEGER errcode); +import void OPT_FPrintErr (OPT_Object obj, int32 errcode); import void OPT_FPrintObj (OPT_Object obj); import void OPT_FPrintStr (OPT_Struct typ); import void OPT_Find (OPT_Object *res); @@ -93,14 +93,14 @@ import void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); import void OPT_Init (OPS_Name name, SET opt); import void OPT_Insert (OPS_Name name, OPT_Object *obj); import void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); -import OPT_Struct OPT_IntType (LONGINT size); +import OPT_Struct OPT_IntType (int64 size); import OPT_Const OPT_NewConst (void); import OPT_ConstExt OPT_NewExt (void); -import OPT_Node OPT_NewNode (SHORTINT class); +import OPT_Node OPT_NewNode (int8 class); import OPT_Object OPT_NewObj (void); -import OPT_Struct OPT_NewStr (SHORTINT form, SHORTINT comp); -import void OPT_OpenScope (SHORTINT level, OPT_Object owner); -import OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir); +import OPT_Struct OPT_NewStr (int8 form, int8 comp); +import void OPT_OpenScope (int8 level, OPT_Object owner); +import OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int32 dir); import void *OPT__init(void); diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index c769935e..5b1ffe19 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -8,15 +8,15 @@ typedef struct OPV_ExitInfo { - INTEGER level, label; + int32 level, label; } OPV_ExitInfo; static BOOLEAN OPV_assert, OPV_inxchk, OPV_mainprog, OPV_ansi; -static INTEGER OPV_stamp; -static LONGINT OPV_recno; +static int32 OPV_stamp; +static int64 OPV_recno; static OPV_ExitInfo OPV_exit; -static INTEGER OPV_nofExitLabels; +static int32 OPV_nofExitLabels; static BOOLEAN OPV_naturalAlignment; export LONGINT *OPV_ExitInfo__typ; @@ -24,38 +24,38 @@ export LONGINT *OPV_ExitInfo__typ; static void OPV_ActualPar (OPT_Node n, OPT_Object fp); export void OPV_AdrAndSize (OPT_Object topScope); static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc); -static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec); +static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int32 prec); static void OPV_DefineTDescs (OPT_Node n); -static void OPV_Entier (OPT_Node n, INTEGER prec); +static void OPV_Entier (OPT_Node n, int32 prec); static void OPV_GetTProcNum (OPT_Object obj); static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc); static BOOLEAN OPV_ImplicitReturn (OPT_Node n); -static void OPV_Index (OPT_Node n, OPT_Node d, INTEGER prec, INTEGER dim); +static void OPV_Index (OPT_Node n, OPT_Node d, int32 prec, int32 dim); export void OPV_Init (void); static void OPV_InitTDescs (OPT_Node n); -static void OPV_Len (OPT_Node n, LONGINT dim); +static void OPV_Len (OPT_Node n, int64 dim); export void OPV_Module (OPT_Node prog); -static LONGINT OPV_NaturalAlignment (LONGINT size, LONGINT max); +static int64 OPV_NaturalAlignment (int64 size, int64 max); static void OPV_NewArr (OPT_Node d, OPT_Node x); -static void OPV_ParIntLiteral (LONGINT n, LONGINT size); -static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, INTEGER comp); +static void OPV_ParIntLiteral (int64 n, int64 size); +static int32 OPV_Precedence (int32 class, int32 subclass, int32 form, int32 comp); static BOOLEAN OPV_SideEffects (OPT_Node n); -static void OPV_SizeCast (LONGINT from, LONGINT to); +static void OPV_SizeCast (int64 from, int64 to); static void OPV_Stamp (OPS_Name s); static OPT_Object OPV_SuperProc (OPT_Node n); static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported); static void OPV_TraverseRecord (OPT_Struct typ); export void OPV_TypSize (OPT_Struct typ); static void OPV_TypeOf (OPT_Node n); -static void OPV_design (OPT_Node n, INTEGER prec); -static void OPV_expr (OPT_Node n, INTEGER prec); +static void OPV_design (OPT_Node n, int32 prec); +static void OPV_expr (OPT_Node n, int32 prec); static void OPV_stat (OPT_Node n, OPT_Object outerProc); -static LONGINT OPV_NaturalAlignment (LONGINT size, LONGINT max) +static int64 OPV_NaturalAlignment (int64 size, int64 max) { - LONGINT _o_result; - LONGINT i; + int64 _o_result; + int64 i; if (size >= max) { _o_result = max; return _o_result; @@ -72,8 +72,8 @@ static LONGINT OPV_NaturalAlignment (LONGINT size, LONGINT max) void OPV_TypSize (OPT_Struct typ) { - INTEGER f, c; - LONGINT offset, size, base, fbase, off0; + int32 f, c; + int64 offset, size, base, fbase, off0; OPT_Object fld = NIL; OPT_Struct btyp = NIL; if (typ == OPT_undftyp) { @@ -88,7 +88,7 @@ void OPV_TypSize (OPT_Struct typ) base = OPC_SizeAlignment(OPM_RecSize); } else { OPV_TypSize(btyp); - offset = btyp->size - (SYSTEM_INT64)__ASHR(btyp->sysflag, 8); + offset = btyp->size - (int64)__ASHR(btyp->sysflag, 8); base = btyp->align; } fld = typ->link; @@ -119,7 +119,7 @@ void OPV_TypSize (OPT_Struct typ) } typ->size = offset; typ->align = base; - typ->sysflag = __MASK(typ->sysflag, -256) + (SYSTEM_INT32)__ASHL(offset - off0, 8); + typ->sysflag = __MASK(typ->sysflag, -256) + (int32)__ASHL(offset - off0, 8); } else if (c == 2) { OPV_TypSize(typ->BaseTyp); typ->size = typ->n * typ->BaseTyp->size; @@ -157,7 +157,7 @@ void OPV_Init (void) static void OPV_GetTProcNum (OPT_Object obj) { - LONGINT oldPos; + int64 oldPos; OPT_Struct typ = NIL; OPT_Object redef = NIL; oldPos = OPM_errpos; @@ -193,7 +193,7 @@ static void OPV_TraverseRecord (OPT_Struct typ) static void OPV_Stamp (OPS_Name s) { - INTEGER i, j, k; + int32 i, j, k; CHAR n[10]; OPV_stamp += 1; i = 0; @@ -223,7 +223,7 @@ static void OPV_Stamp (OPS_Name s) static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported) { - INTEGER mode; + int32 mode; OPT_Object scope = NIL; OPT_Struct typ = NIL; if (obj != NIL) { @@ -298,9 +298,9 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_sysptrtyp->strobj->linkadr = 2; } -static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, INTEGER comp) +static int32 OPV_Precedence (int32 class, int32 subclass, int32 form, int32 comp) { - INTEGER _o_result; + int32 _o_result; switch (class) { case 7: case 0: case 2: case 4: case 9: case 13: @@ -433,7 +433,7 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN __RETCHK; } -static void OPV_Len (OPT_Node n, LONGINT dim) +static void OPV_Len (OPT_Node n, int64 dim) { while ((n->class == 4 && n->typ->comp == 3)) { dim += 1; @@ -462,7 +462,7 @@ static BOOLEAN OPV_SideEffects (OPT_Node n) __RETCHK; } -static void OPV_Entier (OPT_Node n, INTEGER prec) +static void OPV_Entier (OPT_Node n, int32 prec) { if (__IN(n->typ->form, 0x60)) { OPM_WriteString((CHAR*)"__ENTIER(", 10); @@ -473,34 +473,18 @@ static void OPV_Entier (OPT_Node n, INTEGER prec) } } -static void OPV_SizeCast (LONGINT from, LONGINT to) +static void OPV_SizeCast (int64 from, int64 to) { if ((from != to && (from > 4 || to != 4))) { - switch (to) { - case 1: - OPM_WriteString((CHAR*)"(SYSTEM_INT8)", 14); - break; - case 2: - OPM_WriteString((CHAR*)"(SYSTEM_INT16)", 15); - break; - case 4: - OPM_WriteString((CHAR*)"(SYSTEM_INT32)", 15); - break; - case 8: - OPM_WriteString((CHAR*)"(SYSTEM_INT64)", 15); - break; - default: - OPM_LogWStr((CHAR*)"Unhandled case in OPC.SizeCast, to = ", 38); - OPM_LogWNum(to, 1); - OPM_LogWLn(); - break; - } + OPM_WriteString((CHAR*)"(int", 5); + OPM_WriteInt(__ASHL(to, 3)); + OPM_WriteString((CHAR*)")", 2); } } -static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec) +static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int32 prec) { - INTEGER from, to; + int32 from, to; from = n->typ->form; to = newtype->form; if (to == 7) { @@ -562,7 +546,7 @@ static void OPV_TypeOf (OPT_Node n) } } -static void OPV_Index (OPT_Node n, OPT_Node d, INTEGER prec, INTEGER dim) +static void OPV_Index (OPT_Node n, OPT_Node d, int32 prec, int32 dim) { if (!OPV_inxchk || (n->right->class == 7 && (n->right->conval->intval == 0 || n->left->typ->comp != 3))) { OPV_expr(n->right, prec); @@ -579,13 +563,13 @@ static void OPV_Index (OPT_Node n, OPT_Node d, INTEGER prec, INTEGER dim) } } -static void OPV_design (OPT_Node n, INTEGER prec) +static void OPV_design (OPT_Node n, int32 prec) { OPT_Object obj = NIL; OPT_Struct typ = NIL; - INTEGER class, designPrec, comp; + int32 class, designPrec, comp; OPT_Node d = NIL, x = NIL; - INTEGER dims, i, _for__28; + int32 dims, i, _for__28; comp = n->typ->comp; obj = n->obj; class = n->class; @@ -669,7 +653,7 @@ static void OPV_design (OPT_Node n, INTEGER prec) } if (n->typ->comp == 3) { OPM_Write(')'); - while ((SYSTEM_INT64)i < __ASHR(d->typ->size - 4, 2)) { + while ((int64)i < __ASHR(d->typ->size - 4, 2)) { OPM_WriteString((CHAR*)" * ", 4); OPV_Len(d, i); i += 1; @@ -758,7 +742,7 @@ static void OPV_design (OPT_Node n, INTEGER prec) } } -static void OPV_ParIntLiteral (LONGINT n, LONGINT size) +static void OPV_ParIntLiteral (int64 n, int64 size) { if (OPV_ansi) { OPM_WriteInt(n); @@ -770,7 +754,7 @@ static void OPV_ParIntLiteral (LONGINT n, LONGINT size) static void OPV_ActualPar (OPT_Node n, OPT_Object fp) { OPT_Struct typ = NIL, aptyp = NIL; - INTEGER comp, form, mode, prec, dim; + int32 comp, form, mode, prec, dim; OPM_Write('('); while (n != NIL) { typ = fp->typ; @@ -869,9 +853,9 @@ static OPT_Object OPV_SuperProc (OPT_Node n) return _o_result; } -static void OPV_expr (OPT_Node n, INTEGER prec) +static void OPV_expr (OPT_Node n, int32 prec) { - INTEGER class, subclass, form, exprPrec; + int32 class, subclass, form, exprPrec; OPT_Struct typ = NIL; OPT_Node l = NIL, r = NIL; OPT_Object proc = NIL; @@ -1187,7 +1171,7 @@ static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) OPT_Node if_ = NIL; OPT_Object obj = NIL; OPT_Struct typ = NIL; - LONGINT adr; + int64 adr; if_ = n->left; while (if_ != NIL) { OPM_WriteString((CHAR*)"if ", 4); @@ -1237,8 +1221,8 @@ static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc) { OPT_Node switchCase = NIL, label = NIL; - LONGINT low, high; - INTEGER form, i; + int64 low, high; + int32 form, i; OPM_WriteString((CHAR*)"switch ", 8); OPV_expr(n->left, 12); OPM_Write(' '); @@ -1305,7 +1289,7 @@ static BOOLEAN OPV_ImplicitReturn (OPT_Node n) static void OPV_NewArr (OPT_Node d, OPT_Node x) { OPT_Struct typ = NIL, base = NIL; - INTEGER nofdim, nofdyn; + int32 nofdim, nofdyn; typ = d->typ->BaseTyp; base = typ; nofdim = 0; diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 84e4aba7..fd00502a 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -9,90 +9,90 @@ typedef Platform_ArgPtr (*Platform_ArgVec)[1024]; typedef - LONGINT (*Platform_ArgVecPtr)[1]; + int64 (*Platform_ArgVecPtr)[1]; typedef CHAR (*Platform_EnvPtr)[1024]; typedef struct Platform_FileIdentity { - LONGINT volume, index, mtime; + int64 volume, index, mtime; } Platform_FileIdentity; typedef - void (*Platform_HaltProcedure)(LONGINT); + void (*Platform_HaltProcedure)(int64); typedef - void (*Platform_SignalHandler)(INTEGER); + void (*Platform_SignalHandler)(int32); export BOOLEAN Platform_LittleEndian; -export LONGINT Platform_MainStackFrame, Platform_HaltCode; -export INTEGER Platform_PID; +export int64 Platform_MainStackFrame, Platform_HaltCode; +export int32 Platform_PID; export CHAR Platform_CWD[256]; -export INTEGER Platform_ArgCount; -export LONGINT Platform_ArgVector; +export int32 Platform_ArgCount; +export int64 Platform_ArgVector; static Platform_HaltProcedure Platform_HaltHandler; -static LONGINT Platform_TimeStart; -export INTEGER Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; +static int64 Platform_TimeStart; +export int32 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; export CHAR Platform_nl[3]; export LONGINT *Platform_FileIdentity__typ; -export BOOLEAN Platform_Absent (INTEGER e); -export INTEGER Platform_ArgPos (CHAR *s, LONGINT s__len); -export void Platform_AssertFail (LONGINT code); -export INTEGER Platform_Chdir (CHAR *n, LONGINT n__len); -export INTEGER Platform_Close (LONGINT h); -export BOOLEAN Platform_ConnectionFailed (INTEGER e); -export void Platform_Delay (LONGINT ms); -export BOOLEAN Platform_DifferentFilesystems (INTEGER e); -static void Platform_DisplayHaltCode (LONGINT code); -export INTEGER Platform_Error (void); -export void Platform_Exit (INTEGER code); -export void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len); -export void Platform_GetClock (LONGINT *t, LONGINT *d); +export BOOLEAN Platform_Absent (int32 e); +export int32 Platform_ArgPos (CHAR *s, LONGINT s__len); +export void Platform_AssertFail (int64 code); +export int32 Platform_Chdir (CHAR *n, LONGINT n__len); +export int32 Platform_Close (int64 h); +export BOOLEAN Platform_ConnectionFailed (int32 e); +export void Platform_Delay (int64 ms); +export BOOLEAN Platform_DifferentFilesystems (int32 e); +static void Platform_DisplayHaltCode (int64 code); +export int32 Platform_Error (void); +export void Platform_Exit (int32 code); +export void Platform_GetArg (int32 n, CHAR *val, LONGINT val__len); +export void Platform_GetClock (int64 *t, int64 *d); export void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); -export void Platform_GetIntArg (INTEGER n, LONGINT *val); -export void Platform_GetTimeOfDay (LONGINT *sec, LONGINT *usec); -export void Platform_Halt (LONGINT code); -export INTEGER Platform_Identify (LONGINT h, Platform_FileIdentity *identity, LONGINT *identity__typ); -export INTEGER Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); -export BOOLEAN Platform_Inaccessible (INTEGER e); -export void Platform_Init (INTEGER argc, LONGINT argvadr); -export void Platform_MTimeAsClock (Platform_FileIdentity i, LONGINT *t, LONGINT *d); -export INTEGER Platform_New (CHAR *n, LONGINT n__len, LONGINT *h); -export BOOLEAN Platform_NoSuchDirectory (INTEGER e); -export LONGINT Platform_OSAllocate (LONGINT size); -export void Platform_OSFree (LONGINT address); -export INTEGER Platform_OldRO (CHAR *n, LONGINT n__len, LONGINT *h); -export INTEGER Platform_OldRW (CHAR *n, LONGINT n__len, LONGINT *h); -export INTEGER Platform_Read (LONGINT h, LONGINT p, LONGINT l, LONGINT *n); -export INTEGER Platform_ReadBuf (LONGINT h, SYSTEM_BYTE *b, LONGINT b__len, LONGINT *n); -export INTEGER Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); +export void Platform_GetIntArg (int32 n, int64 *val); +export void Platform_GetTimeOfDay (int64 *sec, int64 *usec); +export void Platform_Halt (int64 code); +export int32 Platform_Identify (int64 h, Platform_FileIdentity *identity, LONGINT *identity__typ); +export int32 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); +export BOOLEAN Platform_Inaccessible (int32 e); +export void Platform_Init (int32 argc, int64 argvadr); +export void Platform_MTimeAsClock (Platform_FileIdentity i, int64 *t, int64 *d); +export int32 Platform_New (CHAR *n, LONGINT n__len, int64 *h); +export BOOLEAN Platform_NoSuchDirectory (int32 e); +export int64 Platform_OSAllocate (int64 size); +export void Platform_OSFree (int64 address); +export int32 Platform_OldRO (CHAR *n, LONGINT n__len, int64 *h); +export int32 Platform_OldRW (CHAR *n, LONGINT n__len, int64 *h); +export int32 Platform_Read (int64 h, int64 p, int64 l, int64 *n); +export int32 Platform_ReadBuf (int64 h, SYSTEM_BYTE *b, LONGINT b__len, int64 *n); +export int32 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); export BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); export BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); -export INTEGER Platform_Seek (LONGINT h, LONGINT offset, INTEGER whence); +export int32 Platform_Seek (int64 h, int64 offset, int32 whence); export void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); export void Platform_SetHalt (Platform_HaltProcedure p); export void Platform_SetInterruptHandler (Platform_SignalHandler handler); export void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Platform_FileIdentity source); export void Platform_SetQuitHandler (Platform_SignalHandler handler); -export INTEGER Platform_Size (LONGINT h, LONGINT *l); -export INTEGER Platform_Sync (LONGINT h); -export INTEGER Platform_System (CHAR *cmd, LONGINT cmd__len); +export int32 Platform_Size (int64 h, int64 *l); +export int32 Platform_Sync (int64 h); +export int32 Platform_System (CHAR *cmd, LONGINT cmd__len); static void Platform_TestLittleEndian (void); -export LONGINT Platform_Time (void); -export BOOLEAN Platform_TimedOut (INTEGER e); -export BOOLEAN Platform_TooManyFiles (INTEGER e); -export INTEGER Platform_Truncate (LONGINT h, LONGINT l); -export INTEGER Platform_Unlink (CHAR *n, LONGINT n__len); -export INTEGER Platform_Write (LONGINT h, LONGINT p, LONGINT l); -static void Platform_YMDHMStoClock (LONGINT ye, LONGINT mo, LONGINT da, LONGINT ho, LONGINT mi, LONGINT se, LONGINT *t, LONGINT *d); +export int64 Platform_Time (void); +export BOOLEAN Platform_TimedOut (int32 e); +export BOOLEAN Platform_TooManyFiles (int32 e); +export int32 Platform_Truncate (int64 h, int64 l); +export int32 Platform_Unlink (CHAR *n, LONGINT n__len); +export int32 Platform_Write (int64 h, int64 p, int64 l); +static void Platform_YMDHMStoClock (int64 ye, int64 mo, int64 da, int64 ho, int64 mi, int64 se, int64 *t, int64 *d); static void Platform_errch (CHAR c); -static void Platform_errint (LONGINT l); +static void Platform_errint (int64 l); static void Platform_errln (void); -static void Platform_errposint (LONGINT l); +static void Platform_errposint (int64 l); export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); #include @@ -164,68 +164,68 @@ extern void Heap_InitHeap(); #define Platform_unlink(n, n__len) unlink((char*)n) #define Platform_writefile(fd, p, l) write(fd, (void*)(SYSTEM_ADRINT)(p), l) -BOOLEAN Platform_TooManyFiles (INTEGER e) +BOOLEAN Platform_TooManyFiles (int32 e) { BOOLEAN _o_result; _o_result = e == Platform_EMFILE() || e == Platform_ENFILE(); return _o_result; } -BOOLEAN Platform_NoSuchDirectory (INTEGER e) +BOOLEAN Platform_NoSuchDirectory (int32 e) { BOOLEAN _o_result; _o_result = e == Platform_ENOENT(); return _o_result; } -BOOLEAN Platform_DifferentFilesystems (INTEGER e) +BOOLEAN Platform_DifferentFilesystems (int32 e) { BOOLEAN _o_result; _o_result = e == Platform_EXDEV(); return _o_result; } -BOOLEAN Platform_Inaccessible (INTEGER e) +BOOLEAN Platform_Inaccessible (int32 e) { BOOLEAN _o_result; _o_result = (e == Platform_EACCES() || e == Platform_EROFS()) || e == Platform_EAGAIN(); return _o_result; } -BOOLEAN Platform_Absent (INTEGER e) +BOOLEAN Platform_Absent (int32 e) { BOOLEAN _o_result; _o_result = e == Platform_ENOENT(); return _o_result; } -BOOLEAN Platform_TimedOut (INTEGER e) +BOOLEAN Platform_TimedOut (int32 e) { BOOLEAN _o_result; _o_result = e == Platform_ETIMEDOUT(); return _o_result; } -BOOLEAN Platform_ConnectionFailed (INTEGER e) +BOOLEAN Platform_ConnectionFailed (int32 e) { BOOLEAN _o_result; _o_result = ((e == Platform_ECONNREFUSED() || e == Platform_ECONNABORTED()) || e == Platform_ENETUNREACH()) || e == Platform_EHOSTUNREACH(); return _o_result; } -LONGINT Platform_OSAllocate (LONGINT size) +int64 Platform_OSAllocate (int64 size) { - LONGINT _o_result; + int64 _o_result; _o_result = Platform_allocate(size); return _o_result; } -void Platform_OSFree (LONGINT address) +void Platform_OSFree (int64 address) { Platform_free(address); } -void Platform_Init (INTEGER argc, LONGINT argvadr) +void Platform_Init (int32 argc, int64 argvadr) { Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; @@ -259,7 +259,7 @@ void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len) __DEL(var); } -void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len) +void Platform_GetArg (int32 n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { @@ -268,10 +268,10 @@ void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len) } } -void Platform_GetIntArg (INTEGER n, LONGINT *val) +void Platform_GetIntArg (int32 n, int64 *val) { CHAR s[64]; - LONGINT k, d, i; + int64 k, d, i; s[0] = 0x00; Platform_GetArg(n, (void*)s, 64); i = 0; @@ -294,10 +294,10 @@ void Platform_GetIntArg (INTEGER n, LONGINT *val) } } -INTEGER Platform_ArgPos (CHAR *s, LONGINT s__len) +int32 Platform_ArgPos (CHAR *s, LONGINT s__len) { - INTEGER _o_result; - INTEGER i; + int32 _o_result; + int32 i; CHAR arg[256]; __DUP(s, s__len, CHAR); i = 0; @@ -326,64 +326,64 @@ void Platform_SetBadInstructionHandler (Platform_SignalHandler handler) Platform_sethandler(4, handler); } -static void Platform_YMDHMStoClock (LONGINT ye, LONGINT mo, LONGINT da, LONGINT ho, LONGINT mi, LONGINT se, LONGINT *t, LONGINT *d) +static void Platform_YMDHMStoClock (int64 ye, int64 mo, int64 da, int64 ho, int64 mi, int64 se, int64 *t, int64 *d) { *d = (__ASHL(__MOD(ye, 100), 9) + __ASHL(mo + 1, 5)) + da; *t = (__ASHL(ho, 12) + __ASHL(mi, 6)) + se; } -void Platform_GetClock (LONGINT *t, LONGINT *d) +void Platform_GetClock (int64 *t, int64 *d) { Platform_gettimeval(); Platform_sectotm(Platform_tvsec()); Platform_YMDHMStoClock(Platform_tmyear(), Platform_tmmon(), Platform_tmmday(), Platform_tmhour(), Platform_tmmin(), Platform_tmsec(), &*t, &*d); } -void Platform_GetTimeOfDay (LONGINT *sec, LONGINT *usec) +void Platform_GetTimeOfDay (int64 *sec, int64 *usec) { Platform_gettimeval(); *sec = Platform_tvsec(); *usec = Platform_tvusec(); } -LONGINT Platform_Time (void) +int64 Platform_Time (void) { - LONGINT _o_result; - LONGINT ms; + int64 _o_result; + int64 ms; Platform_gettimeval(); ms = __DIVF(Platform_tvusec(), 1000) + Platform_tvsec() * 1000; _o_result = __MOD(ms - Platform_TimeStart, 2147483647); return _o_result; } -void Platform_Delay (LONGINT ms) +void Platform_Delay (int64 ms) { - LONGINT s, ns; + int64 s, ns; s = __DIV(ms, 1000); ns = __MOD(ms, 1000) * 1000000; Platform_nanosleep(s, ns); } -INTEGER Platform_System (CHAR *cmd, LONGINT cmd__len) +int32 Platform_System (CHAR *cmd, LONGINT cmd__len) { - INTEGER _o_result; + int32 _o_result; __DUP(cmd, cmd__len, CHAR); _o_result = Platform_system(cmd, cmd__len); __DEL(cmd); return _o_result; } -INTEGER Platform_Error (void) +int32 Platform_Error (void) { - INTEGER _o_result; + int32 _o_result; _o_result = Platform_err(); return _o_result; } -INTEGER Platform_OldRO (CHAR *n, LONGINT n__len, LONGINT *h) +int32 Platform_OldRO (CHAR *n, LONGINT n__len, int64 *h) { - INTEGER _o_result; - INTEGER fd; + int32 _o_result; + int32 fd; fd = Platform_openro(n, n__len); if (fd < 0) { _o_result = Platform_err(); @@ -396,10 +396,10 @@ INTEGER Platform_OldRO (CHAR *n, LONGINT n__len, LONGINT *h) __RETCHK; } -INTEGER Platform_OldRW (CHAR *n, LONGINT n__len, LONGINT *h) +int32 Platform_OldRW (CHAR *n, LONGINT n__len, int64 *h) { - INTEGER _o_result; - INTEGER fd; + int32 _o_result; + int32 fd; fd = Platform_openrw(n, n__len); if (fd < 0) { _o_result = Platform_err(); @@ -412,10 +412,10 @@ INTEGER Platform_OldRW (CHAR *n, LONGINT n__len, LONGINT *h) __RETCHK; } -INTEGER Platform_New (CHAR *n, LONGINT n__len, LONGINT *h) +int32 Platform_New (CHAR *n, LONGINT n__len, int64 *h) { - INTEGER _o_result; - INTEGER fd; + int32 _o_result; + int32 fd; fd = Platform_opennew(n, n__len); if (fd < 0) { _o_result = Platform_err(); @@ -428,9 +428,9 @@ INTEGER Platform_New (CHAR *n, LONGINT n__len, LONGINT *h) __RETCHK; } -INTEGER Platform_Close (LONGINT h) +int32 Platform_Close (int64 h) { - INTEGER _o_result; + int32 _o_result; if (Platform_closefile(h) < 0) { _o_result = Platform_err(); return _o_result; @@ -441,9 +441,9 @@ INTEGER Platform_Close (LONGINT h) __RETCHK; } -INTEGER Platform_Identify (LONGINT h, Platform_FileIdentity *identity, LONGINT *identity__typ) +int32 Platform_Identify (int64 h, Platform_FileIdentity *identity, LONGINT *identity__typ) { - INTEGER _o_result; + int32 _o_result; Platform_structstats(); if (Platform_fstat(h) < 0) { _o_result = Platform_err(); @@ -456,9 +456,9 @@ INTEGER Platform_Identify (LONGINT h, Platform_FileIdentity *identity, LONGINT * return _o_result; } -INTEGER Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ) +int32 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ) { - INTEGER _o_result; + int32 _o_result; __DUP(n, n__len, CHAR); Platform_structstats(); if (Platform_stat(n, n__len) < 0) { @@ -493,15 +493,15 @@ void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Pla (*target).mtime = source.mtime; } -void Platform_MTimeAsClock (Platform_FileIdentity i, LONGINT *t, LONGINT *d) +void Platform_MTimeAsClock (Platform_FileIdentity i, int64 *t, int64 *d) { Platform_sectotm(i.mtime); Platform_YMDHMStoClock(Platform_tmyear(), Platform_tmmon(), Platform_tmmday(), Platform_tmhour(), Platform_tmmin(), Platform_tmsec(), &*t, &*d); } -INTEGER Platform_Size (LONGINT h, LONGINT *l) +int32 Platform_Size (int64 h, int64 *l) { - INTEGER _o_result; + int32 _o_result; Platform_structstats(); if (Platform_fstat(h) < 0) { _o_result = Platform_err(); @@ -512,9 +512,9 @@ INTEGER Platform_Size (LONGINT h, LONGINT *l) return _o_result; } -INTEGER Platform_Read (LONGINT h, LONGINT p, LONGINT l, LONGINT *n) +int32 Platform_Read (int64 h, int64 p, int64 l, int64 *n) { - INTEGER _o_result; + int32 _o_result; *n = Platform_readfile(h, p, l); if (*n < 0) { *n = 0; @@ -527,9 +527,9 @@ INTEGER Platform_Read (LONGINT h, LONGINT p, LONGINT l, LONGINT *n) __RETCHK; } -INTEGER Platform_ReadBuf (LONGINT h, SYSTEM_BYTE *b, LONGINT b__len, LONGINT *n) +int32 Platform_ReadBuf (int64 h, SYSTEM_BYTE *b, LONGINT b__len, int64 *n) { - INTEGER _o_result; + int32 _o_result; *n = Platform_readfile(h, (SYSTEM_ADRINT)b, b__len); if (*n < 0) { *n = 0; @@ -542,10 +542,10 @@ INTEGER Platform_ReadBuf (LONGINT h, SYSTEM_BYTE *b, LONGINT b__len, LONGINT *n) __RETCHK; } -INTEGER Platform_Write (LONGINT h, LONGINT p, LONGINT l) +int32 Platform_Write (int64 h, int64 p, int64 l) { - INTEGER _o_result; - LONGINT written; + int32 _o_result; + int64 written; written = Platform_writefile(h, p, l); if (written < 0) { _o_result = Platform_err(); @@ -557,9 +557,9 @@ INTEGER Platform_Write (LONGINT h, LONGINT p, LONGINT l) __RETCHK; } -INTEGER Platform_Sync (LONGINT h) +int32 Platform_Sync (int64 h) { - INTEGER _o_result; + int32 _o_result; if (Platform_fsync(h) < 0) { _o_result = Platform_err(); return _o_result; @@ -570,9 +570,9 @@ INTEGER Platform_Sync (LONGINT h) __RETCHK; } -INTEGER Platform_Seek (LONGINT h, LONGINT offset, INTEGER whence) +int32 Platform_Seek (int64 h, int64 offset, int32 whence) { - INTEGER _o_result; + int32 _o_result; if (Platform_lseek(h, offset, whence) < 0) { _o_result = Platform_err(); return _o_result; @@ -583,9 +583,9 @@ INTEGER Platform_Seek (LONGINT h, LONGINT offset, INTEGER whence) __RETCHK; } -INTEGER Platform_Truncate (LONGINT h, LONGINT l) +int32 Platform_Truncate (int64 h, int64 l) { - INTEGER _o_result; + int32 _o_result; if (Platform_ftruncate(h, l) < 0) { _o_result = Platform_err(); return _o_result; @@ -596,9 +596,9 @@ INTEGER Platform_Truncate (LONGINT h, LONGINT l) __RETCHK; } -INTEGER Platform_Unlink (CHAR *n, LONGINT n__len) +int32 Platform_Unlink (CHAR *n, LONGINT n__len) { - INTEGER _o_result; + int32 _o_result; if (Platform_unlink(n, n__len) < 0) { _o_result = Platform_err(); return _o_result; @@ -609,10 +609,10 @@ INTEGER Platform_Unlink (CHAR *n, LONGINT n__len) __RETCHK; } -INTEGER Platform_Chdir (CHAR *n, LONGINT n__len) +int32 Platform_Chdir (CHAR *n, LONGINT n__len) { - INTEGER _o_result; - INTEGER r; + int32 _o_result; + int32 r; r = Platform_chdir(n, n__len); Platform_getcwd((void*)Platform_CWD, 256); if (r < 0) { @@ -625,9 +625,9 @@ INTEGER Platform_Chdir (CHAR *n, LONGINT n__len) __RETCHK; } -INTEGER Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) +int32 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) { - INTEGER _o_result; + int32 _o_result; if (Platform_rename(o, o__len, n, n__len) < 0) { _o_result = Platform_err(); return _o_result; @@ -638,7 +638,7 @@ INTEGER Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) __RETCHK; } -void Platform_Exit (INTEGER code) +void Platform_Exit (int32 code) { Platform_exit(code); } @@ -654,7 +654,7 @@ static void Platform_errln (void) Platform_errch(0x0a); } -static void Platform_errposint (LONGINT l) +static void Platform_errposint (int64 l) { if (l > 10) { Platform_errposint(__DIV(l, 10)); @@ -662,7 +662,7 @@ static void Platform_errposint (LONGINT l) Platform_errch((CHAR)(48 + __MOD(l, 10))); } -static void Platform_errint (LONGINT l) +static void Platform_errint (int64 l) { if (l < 0) { Platform_errch('-'); @@ -671,7 +671,7 @@ static void Platform_errint (LONGINT l) Platform_errposint(l); } -static void Platform_DisplayHaltCode (LONGINT code) +static void Platform_DisplayHaltCode (int64 code) { switch (code) { case -1: @@ -727,9 +727,9 @@ static void Platform_DisplayHaltCode (LONGINT code) } } -void Platform_Halt (LONGINT code) +void Platform_Halt (int64 code) { - INTEGER e; + int32 e; Platform_HaltCode = code; if (Platform_HaltHandler != NIL) { (*Platform_HaltHandler)(code); @@ -741,12 +741,12 @@ void Platform_Halt (LONGINT code) Platform_DisplayHaltCode(code); } Platform_errln(); - Platform_exit(__VAL(INTEGER, code)); + Platform_exit(__VAL(int32, code)); } -void Platform_AssertFail (LONGINT code) +void Platform_AssertFail (int64 code) { - INTEGER e; + int32 e; Platform_errstring((CHAR*)"Assertion failure.", 19); if (code != 0) { Platform_errstring((CHAR*)" ASSERT code ", 14); @@ -754,7 +754,7 @@ void Platform_AssertFail (LONGINT code) Platform_errstring((CHAR*)".", 2); } Platform_errln(); - Platform_exit(__VAL(INTEGER, code)); + Platform_exit(__VAL(int32, code)); } void Platform_SetHalt (Platform_HaltProcedure p) @@ -764,7 +764,7 @@ void Platform_SetHalt (Platform_HaltProcedure p) static void Platform_TestLittleEndian (void) { - INTEGER i; + int32 i; i = 1; __GET((SYSTEM_ADRINT)&i, Platform_LittleEndian, BOOLEAN); } diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index 906f09cb..caba8898 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -8,74 +8,74 @@ typedef struct Platform_FileIdentity { - LONGINT volume, index, mtime; + int64 volume, index, mtime; } Platform_FileIdentity; typedef - void (*Platform_HaltProcedure)(LONGINT); + void (*Platform_HaltProcedure)(int64); typedef - void (*Platform_SignalHandler)(INTEGER); + void (*Platform_SignalHandler)(int32); import BOOLEAN Platform_LittleEndian; -import LONGINT Platform_MainStackFrame, Platform_HaltCode; -import INTEGER Platform_PID; +import int64 Platform_MainStackFrame, Platform_HaltCode; +import int32 Platform_PID; import CHAR Platform_CWD[256]; -import INTEGER Platform_ArgCount; -import LONGINT Platform_ArgVector; -import INTEGER Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; +import int32 Platform_ArgCount; +import int64 Platform_ArgVector; +import int32 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; import CHAR Platform_nl[3]; import LONGINT *Platform_FileIdentity__typ; -import BOOLEAN Platform_Absent (INTEGER e); -import INTEGER Platform_ArgPos (CHAR *s, LONGINT s__len); -import void Platform_AssertFail (LONGINT code); -import INTEGER Platform_Chdir (CHAR *n, LONGINT n__len); -import INTEGER Platform_Close (LONGINT h); -import BOOLEAN Platform_ConnectionFailed (INTEGER e); -import void Platform_Delay (LONGINT ms); -import BOOLEAN Platform_DifferentFilesystems (INTEGER e); -import INTEGER Platform_Error (void); -import void Platform_Exit (INTEGER code); -import void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len); -import void Platform_GetClock (LONGINT *t, LONGINT *d); +import BOOLEAN Platform_Absent (int32 e); +import int32 Platform_ArgPos (CHAR *s, LONGINT s__len); +import void Platform_AssertFail (int64 code); +import int32 Platform_Chdir (CHAR *n, LONGINT n__len); +import int32 Platform_Close (int64 h); +import BOOLEAN Platform_ConnectionFailed (int32 e); +import void Platform_Delay (int64 ms); +import BOOLEAN Platform_DifferentFilesystems (int32 e); +import int32 Platform_Error (void); +import void Platform_Exit (int32 code); +import void Platform_GetArg (int32 n, CHAR *val, LONGINT val__len); +import void Platform_GetClock (int64 *t, int64 *d); import void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); -import void Platform_GetIntArg (INTEGER n, LONGINT *val); -import void Platform_GetTimeOfDay (LONGINT *sec, LONGINT *usec); -import void Platform_Halt (LONGINT code); -import INTEGER Platform_Identify (LONGINT h, Platform_FileIdentity *identity, LONGINT *identity__typ); -import INTEGER Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); -import BOOLEAN Platform_Inaccessible (INTEGER e); -import void Platform_Init (INTEGER argc, LONGINT argvadr); -import void Platform_MTimeAsClock (Platform_FileIdentity i, LONGINT *t, LONGINT *d); -import INTEGER Platform_New (CHAR *n, LONGINT n__len, LONGINT *h); -import BOOLEAN Platform_NoSuchDirectory (INTEGER e); -import LONGINT Platform_OSAllocate (LONGINT size); -import void Platform_OSFree (LONGINT address); -import INTEGER Platform_OldRO (CHAR *n, LONGINT n__len, LONGINT *h); -import INTEGER Platform_OldRW (CHAR *n, LONGINT n__len, LONGINT *h); -import INTEGER Platform_Read (LONGINT h, LONGINT p, LONGINT l, LONGINT *n); -import INTEGER Platform_ReadBuf (LONGINT h, SYSTEM_BYTE *b, LONGINT b__len, LONGINT *n); -import INTEGER Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); +import void Platform_GetIntArg (int32 n, int64 *val); +import void Platform_GetTimeOfDay (int64 *sec, int64 *usec); +import void Platform_Halt (int64 code); +import int32 Platform_Identify (int64 h, Platform_FileIdentity *identity, LONGINT *identity__typ); +import int32 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); +import BOOLEAN Platform_Inaccessible (int32 e); +import void Platform_Init (int32 argc, int64 argvadr); +import void Platform_MTimeAsClock (Platform_FileIdentity i, int64 *t, int64 *d); +import int32 Platform_New (CHAR *n, LONGINT n__len, int64 *h); +import BOOLEAN Platform_NoSuchDirectory (int32 e); +import int64 Platform_OSAllocate (int64 size); +import void Platform_OSFree (int64 address); +import int32 Platform_OldRO (CHAR *n, LONGINT n__len, int64 *h); +import int32 Platform_OldRW (CHAR *n, LONGINT n__len, int64 *h); +import int32 Platform_Read (int64 h, int64 p, int64 l, int64 *n); +import int32 Platform_ReadBuf (int64 h, SYSTEM_BYTE *b, LONGINT b__len, int64 *n); +import int32 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); import BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); import BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); -import INTEGER Platform_Seek (LONGINT h, LONGINT offset, INTEGER whence); +import int32 Platform_Seek (int64 h, int64 offset, int32 whence); import void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); import void Platform_SetHalt (Platform_HaltProcedure p); import void Platform_SetInterruptHandler (Platform_SignalHandler handler); import void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Platform_FileIdentity source); import void Platform_SetQuitHandler (Platform_SignalHandler handler); -import INTEGER Platform_Size (LONGINT h, LONGINT *l); -import INTEGER Platform_Sync (LONGINT h); -import INTEGER Platform_System (CHAR *cmd, LONGINT cmd__len); -import LONGINT Platform_Time (void); -import BOOLEAN Platform_TimedOut (INTEGER e); -import BOOLEAN Platform_TooManyFiles (INTEGER e); -import INTEGER Platform_Truncate (LONGINT h, LONGINT l); -import INTEGER Platform_Unlink (CHAR *n, LONGINT n__len); -import INTEGER Platform_Write (LONGINT h, LONGINT p, LONGINT l); +import int32 Platform_Size (int64 h, int64 *l); +import int32 Platform_Sync (int64 h); +import int32 Platform_System (CHAR *cmd, LONGINT cmd__len); +import int64 Platform_Time (void); +import BOOLEAN Platform_TimedOut (int32 e); +import BOOLEAN Platform_TooManyFiles (int32 e); +import int32 Platform_Truncate (int64 h, int64 l); +import int32 Platform_Unlink (CHAR *n, LONGINT n__len); +import int32 Platform_Write (int64 h, int64 p, int64 l); import BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); import void *Platform__init(void); diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 98719812..5877bedc 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -6,19 +6,19 @@ static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LONGINT d__len); -export void Reals_Convert (REAL x, INTEGER n, CHAR *d, LONGINT d__len); +export void Reals_Convert (REAL x, int32 n, CHAR *d, LONGINT d__len); export void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len); export void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len); -export void Reals_ConvertL (LONGREAL x, INTEGER n, CHAR *d, LONGINT d__len); -export INTEGER Reals_Expo (REAL x); -export INTEGER Reals_ExpoL (LONGREAL x); -export void Reals_SetExpo (REAL *x, INTEGER ex); -export REAL Reals_Ten (INTEGER e); -export LONGREAL Reals_TenL (INTEGER e); -static CHAR Reals_ToHex (INTEGER i); +export void Reals_ConvertL (LONGREAL x, int32 n, CHAR *d, LONGINT d__len); +export int32 Reals_Expo (REAL x); +export int32 Reals_ExpoL (LONGREAL x); +export void Reals_SetExpo (REAL *x, int32 ex); +export REAL Reals_Ten (int32 e); +export LONGREAL Reals_TenL (int32 e); +static CHAR Reals_ToHex (int32 i); -REAL Reals_Ten (INTEGER e) +REAL Reals_Ten (int32 e) { REAL _o_result; LONGREAL r, power; @@ -35,7 +35,7 @@ REAL Reals_Ten (INTEGER e) return _o_result; } -LONGREAL Reals_TenL (INTEGER e) +LONGREAL Reals_TenL (int32 e) { LONGREAL _o_result; LONGREAL r, power; @@ -55,16 +55,16 @@ LONGREAL Reals_TenL (INTEGER e) __RETCHK; } -INTEGER Reals_Expo (REAL x) +int32 Reals_Expo (REAL x) { - INTEGER _o_result; - INTEGER i; - __GET((SYSTEM_ADRINT)&x + 2, i, INTEGER); + int32 _o_result; + int32 i; + __GET((SYSTEM_ADRINT)&x + 2, i, int32); _o_result = __MASK(__ASHR(i, 7), -256); return _o_result; } -void Reals_SetExpo (REAL *x, INTEGER ex) +void Reals_SetExpo (REAL *x, int32 ex) { CHAR c; __GET((SYSTEM_ADRINT)x + 3, c, CHAR); @@ -73,36 +73,36 @@ void Reals_SetExpo (REAL *x, INTEGER ex) __PUT((SYSTEM_ADRINT)x + 2, (CHAR)(__MASK(c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } -INTEGER Reals_ExpoL (LONGREAL x) +int32 Reals_ExpoL (LONGREAL x) { - INTEGER _o_result; - INTEGER i; - __GET((SYSTEM_ADRINT)&x + 6, i, INTEGER); + int32 _o_result; + int32 i; + __GET((SYSTEM_ADRINT)&x + 6, i, int32); _o_result = __MASK(__ASHR(i, 4), -2048); return _o_result; } -void Reals_ConvertL (LONGREAL x, INTEGER n, CHAR *d, LONGINT d__len) +void Reals_ConvertL (LONGREAL x, int32 n, CHAR *d, LONGINT d__len) { - LONGINT i, j, k; + int64 i, j, k; if (x < (LONGREAL)0) { x = -x; } k = 0; i = __ENTIER(x); - while (k < (SYSTEM_INT64)n) { + while (k < (int64)n) { d[__X(k, d__len)] = (CHAR)(__MOD(i, 10) + 48); i = __DIV(i, 10); k += 1; } } -void Reals_Convert (REAL x, INTEGER n, CHAR *d, LONGINT d__len) +void Reals_Convert (REAL x, int32 n, CHAR *d, LONGINT d__len) { Reals_ConvertL(x, n, (void*)d, d__len); } -static CHAR Reals_ToHex (INTEGER i) +static CHAR Reals_ToHex (int32 i) { CHAR _o_result; if (i < 10) { @@ -117,12 +117,12 @@ static CHAR Reals_ToHex (INTEGER i) static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LONGINT d__len) { - INTEGER i; - LONGINT l; + int32 i; + int64 l; CHAR by; i = 0; l = b__len; - while ((SYSTEM_INT64)i < l) { + while ((int64)i < l) { by = __VAL(CHAR, b[__X(i, b__len)]); d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR(by, 4)); d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK(by, -16)); diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index 87c9aa45..cf944612 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -9,15 +9,15 @@ -import void Reals_Convert (REAL x, INTEGER n, CHAR *d, LONGINT d__len); +import void Reals_Convert (REAL x, int32 n, CHAR *d, LONGINT d__len); import void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len); import void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len); -import void Reals_ConvertL (LONGREAL x, INTEGER n, CHAR *d, LONGINT d__len); -import INTEGER Reals_Expo (REAL x); -import INTEGER Reals_ExpoL (LONGREAL x); -import void Reals_SetExpo (REAL *x, INTEGER ex); -import REAL Reals_Ten (INTEGER e); -import LONGREAL Reals_TenL (INTEGER e); +import void Reals_ConvertL (LONGREAL x, int32 n, CHAR *d, LONGINT d__len); +import int32 Reals_Expo (REAL x); +import int32 Reals_ExpoL (LONGREAL x); +import void Reals_SetExpo (REAL *x, int32 ex); +import REAL Reals_Ten (int32 e); +import LONGREAL Reals_TenL (int32 e); import void *Reals__init(void); diff --git a/bootstrap/unix-88/SYSTEM.h b/bootstrap/unix-88/SYSTEM.h index 343404a4..11ec8fc5 100644 --- a/bootstrap/unix-88/SYSTEM.h +++ b/bootstrap/unix-88/SYSTEM.h @@ -2,19 +2,21 @@ #define SYSTEM__h #if defined(_WIN64) - typedef long long SYSTEM_INT64; - typedef unsigned long long SYSTEM_CARD64; + typedef long long int64; + typedef unsigned long long uint64; #else - typedef long SYSTEM_INT64; - typedef unsigned long SYSTEM_CARD64; + typedef long int64; + typedef unsigned long uint64; #endif -typedef int SYSTEM_INT32; -typedef unsigned int SYSTEM_CARD32; -typedef short int SYSTEM_INT16; -typedef unsigned short int SYSTEM_CARD16; -typedef signed char SYSTEM_INT8; -typedef unsigned char SYSTEM_CARD8; +typedef int int32; +typedef unsigned int uint32; + +typedef short int int16; +typedef unsigned short int uint16; + +typedef signed char int8; +typedef unsigned char uint8; #if (__SIZEOF_POINTER__ == 8) || defined(_WIN64) || defined(__LP64__) #if defined(_WIN64) @@ -26,12 +28,30 @@ typedef unsigned char SYSTEM_CARD8; typedef unsigned int size_t; #endif -#define SYSTEM_ADRINT size_t -#define SYSTEM_ADDRESS size_t // Temporarily for bootstrap #define _SIZE_T_DECLARED // For FreeBSD #define _SIZE_T_DEFINED_ // For OpenBSD -void *memcpy(void *dest, const void *source, SYSTEM_ADRINT size); +void *memcpy(void *dest, const void *source, size_t size); + + +// Temporary while bootstrapping: + +#define SYSTEM_INT8 int8 +#define SYSTEM_INT16 int16 +#define SYSTEM_INT32 int32 +#define SYSTEM_INT64 int64 +#define SYSTEM_ADDRESS size_t + +#define U_SYSTEM_INT8 uint8 +#define U_SYSTEM_INT16 uint16 +#define U_SYSTEM_INT32 uint32 +#define U_SYSTEM_INT64 uint64 + +#define U_int8 uint8 +#define U_int16 uint16 +#define U_int32 uint32 +#define U_int64 uint64 + @@ -52,41 +72,53 @@ void *memcpy(void *dest, const void *source, SYSTEM_ADRINT size); // Oberon types -typedef char BOOLEAN; -typedef unsigned char SYSTEM_BYTE; -typedef unsigned char CHAR; -typedef signed char SHORTINT; -typedef float REAL; -typedef double LONGREAL; -typedef void* SYSTEM_PTR; +// typedef char BOOLEAN; +// typedef unsigned char SYSTEM_BYTE; +// typedef unsigned char CHAR; +// typedef signed char SHORTINT; +// typedef float REAL; +// typedef double LONGREAL; +// typedef void* SYSTEM_PTR; + +typedef int8 BOOLEAN; +typedef int8 SYSTEM_BYTE; +typedef uint8 U_SYSTEM_BYTE; +typedef uint8 CHAR; +typedef uint8 U_CHAR; +typedef int8 SHORTINT; +typedef uint8 U_SHORTINT; +typedef float REAL; +typedef double LONGREAL; +typedef void* SYSTEM_PTR; + +typedef size_t SYSTEM_ADRINT; + // For 32 bit builds, the size of LONGINT depends on a make option: #if (__SIZEOF_POINTER__ == 8) || defined(LARGE) || defined(_WIN64) - typedef int INTEGER; // INTEGER is 32 bit. - typedef long long LONGINT; // LONGINT is 64 bit. (long long is always 64 bits, while long can be 32 bits e.g. under MSC/MingW) - typedef unsigned int U_INTEGER; - typedef unsigned long long U_LONGINT; + typedef int32 INTEGER; + typedef int64 LONGINT; + typedef uint32 U_INTEGER; + typedef uint64 U_LONGINT; #else - typedef short int INTEGER; // INTEGER is 16 bit. - typedef long LONGINT; // LONGINT is 32 bit. - typedef unsigned short int U_INTEGER; - typedef unsigned long U_LONGINT; + typedef int16 INTEGER; + typedef int32 LONGINT; + typedef uint16 U_INTEGER; + typedef uint32 U_LONGINT; #endif // Unsigned variants are for use by shift and rotate macros. -typedef unsigned char U_SYSTEM_BYTE; -typedef unsigned char U_CHAR; -typedef unsigned char U_SHORTINT; - typedef U_LONGINT SET; typedef U_LONGINT U_SET; -typedef SYSTEM_CARD8 U_SYSTEM_INT8; -typedef SYSTEM_CARD16 U_SYSTEM_INT16; -typedef SYSTEM_CARD32 U_SYSTEM_INT32; -typedef SYSTEM_CARD64 U_SYSTEM_INT64; + + + +// ---------------------------------------------------------------------- +// ---------------------------------------------------------------------- + // OS Memory allocation interfaces are in PlatformXXX.Mod diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index 24999430..85e9fca9 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -7,22 +7,22 @@ export void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len); export void Strings_Cap (CHAR *s, LONGINT s__len); -export void Strings_Delete (CHAR *s, LONGINT s__len, INTEGER pos, INTEGER n); -export void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n, CHAR *dest, LONGINT dest__len); -export void Strings_Insert (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, LONGINT dest__len); -export INTEGER Strings_Length (CHAR *s, LONGINT s__len); +export void Strings_Delete (CHAR *s, LONGINT s__len, int32 pos, int32 n); +export void Strings_Extract (CHAR *source, LONGINT source__len, int32 pos, int32 n, CHAR *dest, LONGINT dest__len); +export void Strings_Insert (CHAR *source, LONGINT source__len, int32 pos, CHAR *dest, LONGINT dest__len); +export int32 Strings_Length (CHAR *s, LONGINT s__len); export BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len); -export INTEGER Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, INTEGER pos); -export void Strings_Replace (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, LONGINT dest__len); +export int32 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int32 pos); +export void Strings_Replace (CHAR *source, LONGINT source__len, int32 pos, CHAR *dest, LONGINT dest__len); -INTEGER Strings_Length (CHAR *s, LONGINT s__len) +int32 Strings_Length (CHAR *s, LONGINT s__len) { - INTEGER _o_result; - INTEGER i; + int32 _o_result; + int32 i; __DUP(s, s__len, CHAR); i = 0; - while (((SYSTEM_INT64)i < s__len && s[__X(i, s__len)] != 0x00)) { + while (((int64)i < s__len && s[__X(i, s__len)] != 0x00)) { i += 1; } _o_result = i; @@ -32,24 +32,24 @@ INTEGER Strings_Length (CHAR *s, LONGINT s__len) void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len) { - INTEGER n1, n2, i; + int32 n1, n2, i; __DUP(extra, extra__len, CHAR); n1 = Strings_Length(dest, dest__len); n2 = Strings_Length(extra, extra__len); i = 0; - while ((i < n2 && (SYSTEM_INT64)(i + n1) < dest__len)) { + while ((i < n2 && (int64)(i + n1) < dest__len)) { dest[__X(i + n1, dest__len)] = extra[__X(i, extra__len)]; i += 1; } - if ((SYSTEM_INT64)(i + n1) < dest__len) { + if ((int64)(i + n1) < dest__len) { dest[__X(i + n1, dest__len)] = 0x00; } __DEL(extra); } -void Strings_Insert (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, LONGINT dest__len) +void Strings_Insert (CHAR *source, LONGINT source__len, int32 pos, CHAR *dest, LONGINT dest__len) { - INTEGER n1, n2, i; + int32 n1, n2, i; __DUP(source, source__len, CHAR); n1 = Strings_Length(dest, dest__len); n2 = Strings_Length(source, source__len); @@ -60,10 +60,10 @@ void Strings_Insert (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, Strings_Append(dest, dest__len, (void*)source, source__len); return; } - if ((SYSTEM_INT64)(pos + n2) < dest__len) { + if ((int64)(pos + n2) < dest__len) { i = n1; while (i >= pos) { - if ((SYSTEM_INT64)(i + n2) < dest__len) { + if ((int64)(i + n2) < dest__len) { dest[__X(i + n2, dest__len)] = dest[__X(i, dest__len)]; } i -= 1; @@ -77,9 +77,9 @@ void Strings_Insert (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, __DEL(source); } -void Strings_Delete (CHAR *s, LONGINT s__len, INTEGER pos, INTEGER n) +void Strings_Delete (CHAR *s, LONGINT s__len, int32 pos, int32 n) { - INTEGER len, i; + int32 len, i; len = Strings_Length(s, s__len); if (pos < 0) { pos = 0; @@ -92,7 +92,7 @@ void Strings_Delete (CHAR *s, LONGINT s__len, INTEGER pos, INTEGER n) s[__X(i - n, s__len)] = s[__X(i, s__len)]; i += 1; } - if ((SYSTEM_INT64)(i - n) < s__len) { + if ((int64)(i - n) < s__len) { s[__X(i - n, s__len)] = 0x00; } } else { @@ -100,7 +100,7 @@ void Strings_Delete (CHAR *s, LONGINT s__len, INTEGER pos, INTEGER n) } } -void Strings_Replace (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, LONGINT dest__len) +void Strings_Replace (CHAR *source, LONGINT source__len, int32 pos, CHAR *dest, LONGINT dest__len) { __DUP(source, source__len, CHAR); Strings_Delete((void*)dest, dest__len, pos, pos + Strings_Length(source, source__len)); @@ -108,12 +108,12 @@ void Strings_Replace (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest __DEL(source); } -void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n, CHAR *dest, LONGINT dest__len) +void Strings_Extract (CHAR *source, LONGINT source__len, int32 pos, int32 n, CHAR *dest, LONGINT dest__len) { - INTEGER len, destLen, i; + int32 len, destLen, i; __DUP(source, source__len, CHAR); len = Strings_Length(source, source__len); - destLen = (SYSTEM_INT32)dest__len - 1; + destLen = (int32)dest__len - 1; if (pos < 0) { pos = 0; } @@ -122,7 +122,7 @@ void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n, return; } i = 0; - while (((((SYSTEM_INT64)(pos + i) <= source__len && source[__X(pos + i, source__len)] != 0x00)) && i < n)) { + while (((((int64)(pos + i) <= source__len && source[__X(pos + i, source__len)] != 0x00)) && i < n)) { if (i < destLen) { dest[__X(i, dest__len)] = source[__X(pos + i, source__len)]; } @@ -132,10 +132,10 @@ void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n, __DEL(source); } -INTEGER Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, INTEGER pos) +int32 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int32 pos) { - INTEGER _o_result; - INTEGER n1, n2, i, j; + int32 _o_result; + int32 n1, n2, i, j; __DUP(pattern, pattern__len, CHAR); __DUP(s, s__len, CHAR); n1 = Strings_Length(s, s__len); @@ -170,7 +170,7 @@ INTEGER Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__le void Strings_Cap (CHAR *s, LONGINT s__len) { - INTEGER i; + int32 i; i = 0; while (s[__X(i, s__len)] != 0x00) { if (('a' <= s[__X(i, s__len)] && s[__X(i, s__len)] <= 'z')) { @@ -184,9 +184,9 @@ static struct Match__7 { struct Match__7 *lnk; } *Match__7_s; -static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, INTEGER n, INTEGER m); +static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, int32 n, int32 m); -static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, INTEGER n, INTEGER m) +static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, int32 n, int32 m) { BOOLEAN _o_result; while ((((n >= 0 && m >= 0)) && mask[__X(m, mask__len)] != '*')) { diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index 9c2bad27..d703f8c0 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -11,13 +11,13 @@ import void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len); import void Strings_Cap (CHAR *s, LONGINT s__len); -import void Strings_Delete (CHAR *s, LONGINT s__len, INTEGER pos, INTEGER n); -import void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n, CHAR *dest, LONGINT dest__len); -import void Strings_Insert (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, LONGINT dest__len); -import INTEGER Strings_Length (CHAR *s, LONGINT s__len); +import void Strings_Delete (CHAR *s, LONGINT s__len, int32 pos, int32 n); +import void Strings_Extract (CHAR *source, LONGINT source__len, int32 pos, int32 n, CHAR *dest, LONGINT dest__len); +import void Strings_Insert (CHAR *source, LONGINT source__len, int32 pos, CHAR *dest, LONGINT dest__len); +import int32 Strings_Length (CHAR *s, LONGINT s__len); import BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len); -import INTEGER Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, INTEGER pos); -import void Strings_Replace (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, LONGINT dest__len); +import int32 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int32 pos); +import void Strings_Replace (CHAR *source, LONGINT source__len, int32 pos, CHAR *dest, LONGINT dest__len); import void *Strings__init(void); diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index ff526cbc..0c5cb89c 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -14,9 +14,9 @@ typedef typedef struct Texts_RunDesc { Texts_Run prev, next; - LONGINT len; + int64 len; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; BOOLEAN ascii; } Texts_RunDesc; @@ -37,26 +37,26 @@ typedef typedef struct Texts_ElemDesc { Texts_Run prev, next; - LONGINT len; + int64 len; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; BOOLEAN ascii; - LONGINT W, H; + int64 W, H; Texts_Handler handle; Texts_Text base; } Texts_ElemDesc; struct Texts__1 { /* Texts_ElemDesc */ Texts_Run prev, next; - LONGINT len; + int64 len; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; BOOLEAN ascii; - LONGINT W, H; + int64 W, H; Texts_Handler handle; Texts_Text base; Files_File file; - LONGINT org, span; + int64 org, span; CHAR mod[32], proc[32]; }; @@ -65,7 +65,7 @@ typedef typedef struct Texts_BufDesc { - LONGINT len; + int64 len; Texts_Run head; } Texts_BufDesc; @@ -79,8 +79,8 @@ typedef typedef struct Texts_FileMsg { /* Texts_ElemMsg */ - INTEGER id; - LONGINT pos; + int32 id; + int64 pos; Files_Rider r; } Texts_FileMsg; @@ -95,7 +95,7 @@ typedef } Texts_IdentifyMsg; typedef - void (*Texts_Notifier)(Texts_Text, INTEGER, LONGINT, LONGINT); + void (*Texts_Notifier)(Texts_Text, int32, int64, int64); typedef struct Texts_PieceDesc *Texts_Piece; @@ -103,57 +103,57 @@ typedef typedef struct Texts_PieceDesc { Texts_Run prev, next; - LONGINT len; + int64 len; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; BOOLEAN ascii; Files_File file; - LONGINT org; + int64 org; } Texts_PieceDesc; typedef struct Texts_Reader { BOOLEAN eot; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; Texts_Elem elem; Files_Rider rider; Texts_Run run; - LONGINT org, off; + int64 org, off; } Texts_Reader; typedef struct Texts_Scanner { /* Texts_Reader */ BOOLEAN eot; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; Texts_Elem elem; Files_Rider rider; Texts_Run run; - LONGINT org, off; + int64 org, off; CHAR nextCh; - INTEGER line, class; - LONGINT i; + int32 line, class; + int64 i; REAL x; LONGREAL y; CHAR c; - SHORTINT len; + int8 len; CHAR s[64]; } Texts_Scanner; typedef struct Texts_TextDesc { - LONGINT len; + int64 len; Texts_Notifier notify; Texts_Run head, cache; - LONGINT corg; + int64 corg; } Texts_TextDesc; typedef struct Texts_Writer { Texts_Buffer buf; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; Files_Rider rider; Files_File file; } Texts_Writer; @@ -179,50 +179,50 @@ export LONGINT *Texts_Writer__typ; export LONGINT *Texts__1__typ; export void Texts_Append (Texts_Text T, Texts_Buffer B); -export void Texts_ChangeLooks (Texts_Text T, LONGINT beg, LONGINT end, SET sel, Texts_FontsFont fnt, SHORTINT col, SHORTINT voff); +export void Texts_ChangeLooks (Texts_Text T, int64 beg, int64 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff); static Texts_Elem Texts_CloneElem (Texts_Elem e); static Texts_Piece Texts_ClonePiece (Texts_Piece p); export void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len); export void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); export void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); -export void Texts_Delete (Texts_Text T, LONGINT beg, LONGINT end); +export void Texts_Delete (Texts_Text T, int64 beg, int64 end); export Texts_Text Texts_ElemBase (Texts_Elem E); -export LONGINT Texts_ElemPos (Texts_Elem E); -static void Texts_Find (Texts_Text T, LONGINT *pos, Texts_Run *u, LONGINT *org, LONGINT *off); +export int64 Texts_ElemPos (Texts_Elem E); +static void Texts_Find (Texts_Text T, int64 *pos, Texts_Run *u, int64 *org, int64 *off); static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len); static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, LONGINT *msg__typ); -export void Texts_Insert (Texts_Text T, LONGINT pos, Texts_Buffer B); +export void Texts_Insert (Texts_Text T, int64 pos, Texts_Buffer B); export void Texts_Load (Files_Rider *r, LONGINT *r__typ, Texts_Text T); static void Texts_Load0 (Files_Rider *r, LONGINT *r__typ, Texts_Text T); static void Texts_Merge (Texts_Text T, Texts_Run u, Texts_Run *v); export void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len); export void Texts_OpenBuf (Texts_Buffer B); -export void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, LONGINT pos); -export void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, LONGINT pos); +export void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, int64 pos); +export void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, int64 pos); export void Texts_OpenWriter (Texts_Writer *W, LONGINT *W__typ); -export LONGINT Texts_Pos (Texts_Reader *R, LONGINT *R__typ); +export int64 Texts_Pos (Texts_Reader *R, LONGINT *R__typ); export void Texts_Read (Texts_Reader *R, LONGINT *R__typ, CHAR *ch); export void Texts_ReadElem (Texts_Reader *R, LONGINT *R__typ); export void Texts_ReadPrevElem (Texts_Reader *R, LONGINT *R__typ); export void Texts_Recall (Texts_Buffer *B); -export void Texts_Save (Texts_Text T, LONGINT beg, LONGINT end, Texts_Buffer B); +export void Texts_Save (Texts_Text T, int64 beg, int64 end, Texts_Buffer B); export void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ); -export void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, SHORTINT col); +export void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, int8 col); export void Texts_SetFont (Texts_Writer *W, LONGINT *W__typ, Texts_FontsFont fnt); -export void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, SHORTINT voff); +export void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, int8 voff); static void Texts_Splice (Texts_Run un, Texts_Run v, Texts_Run w, Texts_Text base); -static void Texts_Split (LONGINT off, Texts_Run *u, Texts_Run *un); +static void Texts_Split (int64 off, Texts_Run *u, Texts_Run *un); export void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T); export void Texts_Write (Texts_Writer *W, LONGINT *W__typ, CHAR ch); -export void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, LONGINT t, LONGINT d); +export void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, int64 t, int64 d); export void Texts_WriteElem (Texts_Writer *W, LONGINT *W__typ, Texts_Elem e); -export void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, LONGINT x); -export void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n); +export void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, int64 x); +export void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int64 x, int64 n); export void Texts_WriteLn (Texts_Writer *W, LONGINT *W__typ); -export void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER n); +export void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, int32 n); export void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x); -export void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n); -export void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n, INTEGER k); +export void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, int32 n); +export void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, int32 n, int32 k); export void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x); export void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__len); @@ -237,10 +237,10 @@ static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len) return _o_result; } -static void Texts_Find (Texts_Text T, LONGINT *pos, Texts_Run *u, LONGINT *org, LONGINT *off) +static void Texts_Find (Texts_Text T, int64 *pos, Texts_Run *u, int64 *org, int64 *off) { Texts_Run v = NIL; - LONGINT m; + int64 m; if (*pos >= T->len) { *pos = T->len; *u = T->head; @@ -270,7 +270,7 @@ static void Texts_Find (Texts_Text T, LONGINT *pos, Texts_Run *u, LONGINT *org, } } -static void Texts_Split (LONGINT off, Texts_Run *u, Texts_Run *un) +static void Texts_Split (int64 off, Texts_Run *u, Texts_Run *un) { Texts_Piece p = NIL, U = NIL; if (off == 0) { @@ -369,11 +369,11 @@ Texts_Text Texts_ElemBase (Texts_Elem E) return _o_result; } -LONGINT Texts_ElemPos (Texts_Elem E) +int64 Texts_ElemPos (Texts_Elem E) { - LONGINT _o_result; + int64 _o_result; Texts_Run u = NIL; - LONGINT pos; + int64 pos; u = E->base->head->next; pos = 0; while (u != (void *) E) { @@ -388,7 +388,7 @@ static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, LONGINT *msg__t { Texts_Alien e = NIL; Files_Rider r; - LONGINT i; + int64 i; CHAR ch; if (__ISP(E, Texts__1, 2)) { if (__IS(msg__typ, Texts_CopyMsg, 1)) { @@ -464,10 +464,10 @@ void Texts_Recall (Texts_Buffer *B) Texts_del = NIL; } -void Texts_Save (Texts_Text T, LONGINT beg, LONGINT end, Texts_Buffer B) +void Texts_Save (Texts_Text T, int64 beg, int64 end, Texts_Buffer B) { Texts_Run u = NIL, v = NIL, w = NIL, wn = NIL; - LONGINT uo, ud, vo, vd; + int64 uo, ud, vo, vd; Texts_Find(T, &beg, &u, &uo, &ud); Texts_Find(T, &end, &v, &vo, &vd); w = B->head->prev; @@ -498,11 +498,11 @@ void Texts_Save (Texts_Text T, LONGINT beg, LONGINT end, Texts_Buffer B) B->len += end - beg; } -void Texts_Insert (Texts_Text T, LONGINT pos, Texts_Buffer B) +void Texts_Insert (Texts_Text T, int64 pos, Texts_Buffer B) { Texts_Run u = NIL, un = NIL, v = NIL; Texts_Piece p = NIL, q = NIL; - LONGINT uo, ud, len; + int64 uo, ud, len; Texts_Find(T, &pos, &u, &uo, &ud); Texts_Split(ud, &u, &un); len = B->len; @@ -521,7 +521,7 @@ void Texts_Insert (Texts_Text T, LONGINT pos, Texts_Buffer B) void Texts_Append (Texts_Text T, Texts_Buffer B) { Texts_Run v = NIL; - LONGINT pos, len; + int64 pos, len; pos = T->len; len = B->len; v = B->head->next; @@ -536,10 +536,10 @@ void Texts_Append (Texts_Text T, Texts_Buffer B) } } -void Texts_Delete (Texts_Text T, LONGINT beg, LONGINT end) +void Texts_Delete (Texts_Text T, int64 beg, int64 end) { Texts_Run c = NIL, u = NIL, un = NIL, v = NIL, vn = NIL; - LONGINT co, uo, ud, vo, vd; + int64 co, uo, ud, vo, vd; Texts_Find(T, &beg, &u, &uo, &ud); Texts_Split(ud, &u, &un); c = T->cache; @@ -561,10 +561,10 @@ void Texts_Delete (Texts_Text T, LONGINT beg, LONGINT end) } } -void Texts_ChangeLooks (Texts_Text T, LONGINT beg, LONGINT end, SET sel, Texts_FontsFont fnt, SHORTINT col, SHORTINT voff) +void Texts_ChangeLooks (Texts_Text T, int64 beg, int64 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff) { Texts_Run c = NIL, u = NIL, un = NIL, v = NIL, vn = NIL; - LONGINT co, uo, ud, vo, vd; + int64 co, uo, ud, vo, vd; Texts_Find(T, &beg, &u, &uo, &ud); Texts_Split(ud, &u, &un); c = T->cache; @@ -600,7 +600,7 @@ void Texts_ChangeLooks (Texts_Text T, LONGINT beg, LONGINT end, SET sel, Texts_F } } -void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, LONGINT pos) +void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, int64 pos) { Texts_Run u = NIL; if (pos >= T->len) { @@ -617,7 +617,7 @@ void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, LONGINT p void Texts_Read (Texts_Reader *R, LONGINT *R__typ, CHAR *ch) { Texts_Run u = NIL; - LONGINT pos; + int64 pos; CHAR nextch; u = (*R).run; (*R).fnt = u->fnt; @@ -709,14 +709,14 @@ void Texts_ReadPrevElem (Texts_Reader *R, LONGINT *R__typ) } } -LONGINT Texts_Pos (Texts_Reader *R, LONGINT *R__typ) +int64 Texts_Pos (Texts_Reader *R, LONGINT *R__typ) { - LONGINT _o_result; + int64 _o_result; _o_result = (*R).org + (*R).off; return _o_result; } -void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, LONGINT pos) +void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, int64 pos) { Texts_OpenReader((void*)&*S, S__typ, T, pos); (*S).line = 0; @@ -728,7 +728,7 @@ static struct Scan__31 { LONGINT *S__typ; CHAR *ch; BOOLEAN *negE; - INTEGER *e; + int32 *e; struct Scan__31 *lnk; } *Scan__31_s; @@ -756,9 +756,9 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) { CHAR ch, term; BOOLEAN neg, negE, hex; - SHORTINT i, j, h; - INTEGER e; - LONGINT k; + int8 i, j, h; + int32 e; + int64 k; REAL x, f; LONGREAL y, g; CHAR d[32]; @@ -840,7 +840,7 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) k -= 16; } while (j < i) { - k = __ASHL(k, 4) + (SYSTEM_INT64)(d[__X(j, 32)] - 48); + k = __ASHL(k, 4) + (int64)(d[__X(j, 32)] - 48); j += 1; } if (neg) { @@ -930,7 +930,7 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) (*S).class = 3; k = 0; do { - k = k * 10 + (SYSTEM_INT64)(d[__X(j, 32)] - 48); + k = k * 10 + (int64)(d[__X(j, 32)] - 48); j += 1; } while (!(j == i)); if (neg) { @@ -974,12 +974,12 @@ void Texts_SetFont (Texts_Writer *W, LONGINT *W__typ, Texts_FontsFont fnt) (*W).fnt = fnt; } -void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, SHORTINT col) +void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, int8 col) { (*W).col = col; } -void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, SHORTINT voff) +void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, int8 voff) { (*W).voff = voff; } @@ -1036,7 +1036,7 @@ void Texts_WriteLn (Texts_Writer *W, LONGINT *W__typ) void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__len) { - INTEGER i; + int32 i; __DUP(s, s__len, CHAR); i = 0; while (s[__X(i, s__len)] >= ' ') { @@ -1046,10 +1046,10 @@ void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__le __DEL(s); } -void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n) +void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int64 x, int64 n) { - INTEGER i; - LONGINT x0; + int32 i; + int64 x0; CHAR a[22]; i = 0; if (x < 0) { @@ -1068,7 +1068,7 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n) x0 = __DIV(x0, 10); i += 1; } while (!(x0 == 0)); - while (n > (SYSTEM_INT64)i) { + while (n > (int64)i) { Texts_Write(&*W, W__typ, ' '); n -= 1; } @@ -1081,10 +1081,10 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n) } while (!(i == 0)); } -void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, LONGINT x) +void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, int64 x) { - INTEGER i; - LONGINT y; + int32 i; + int64 y; CHAR a[20]; i = 0; Texts_Write(&*W, W__typ, ' '); @@ -1104,9 +1104,9 @@ void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, LONGINT x) } while (!(i == 0)); } -void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n) +void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, int32 n) { - INTEGER e; + int32 e; REAL x0; CHAR d[9]; e = Reals_Expo(x); @@ -1177,15 +1177,15 @@ void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n) static struct WriteRealFix__53 { Texts_Writer *W; LONGINT *W__typ; - INTEGER *i; + int32 *i; CHAR (*d)[9]; struct WriteRealFix__53 *lnk; } *WriteRealFix__53_s; -static void dig__54 (INTEGER n); -static void seq__56 (CHAR ch, INTEGER n); +static void dig__54 (int32 n); +static void seq__56 (CHAR ch, int32 n); -static void seq__56 (CHAR ch, INTEGER n) +static void seq__56 (CHAR ch, int32 n) { while (n > 0) { Texts_Write(&*WriteRealFix__53_s->W, WriteRealFix__53_s->W__typ, ch); @@ -1193,7 +1193,7 @@ static void seq__56 (CHAR ch, INTEGER n) } } -static void dig__54 (INTEGER n) +static void dig__54 (int32 n) { while (n > 0) { *WriteRealFix__53_s->i -= 1; @@ -1202,9 +1202,9 @@ static void dig__54 (INTEGER n) } } -void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n, INTEGER k) +void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, int32 n, int32 k) { - INTEGER e, i; + int32 e, i; CHAR sign; REAL x0; CHAR d[9]; @@ -1276,7 +1276,7 @@ void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n, IN void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x) { - INTEGER i; + int32 i; CHAR d[8]; Reals_ConvertH(x, (void*)d, 8); i = 0; @@ -1286,9 +1286,9 @@ void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x) } while (!(i == 8)); } -void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER n) +void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, int32 n) { - INTEGER e; + int32 e; LONGREAL x0; CHAR d[16]; e = Reals_ExpoL(x); @@ -1320,7 +1320,7 @@ void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER } else { Texts_Write(&*W, W__typ, ' '); } - e = (SYSTEM_INT32)__ASHR((SYSTEM_INT64)(e - 1023) * 77, 8); + e = (int32)__ASHR((int64)(e - 1023) * 77, 8); if (e >= 0) { x = x / (LONGREAL)Reals_TenL(e); } else { @@ -1360,7 +1360,7 @@ void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x) { - INTEGER i; + int32 i; CHAR d[16]; Reals_ConvertHL(x, (void*)d, 16); i = 0; @@ -1376,16 +1376,16 @@ static struct WriteDate__43 { struct WriteDate__43 *lnk; } *WriteDate__43_s; -static void WritePair__44 (CHAR ch, LONGINT x); +static void WritePair__44 (CHAR ch, int64 x); -static void WritePair__44 (CHAR ch, LONGINT x) +static void WritePair__44 (CHAR ch, int64 x) { Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, ch); Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)(__DIV(x, 10) + 48)); Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)(__MOD(x, 10) + 48)); } -void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, LONGINT t, LONGINT d) +void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, int64 t, int64 d) { struct WriteDate__43 _s; _s.W = W; _s.W__typ = W__typ; @@ -1402,22 +1402,22 @@ void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, LONGINT t, LONGINT d) static struct Load0__16 { Texts_Text *T; - SHORTINT *ecnt; + int8 *ecnt; Files_File *f; Texts_FileMsg *msg; CHAR (*mods)[64][32], (*procs)[64][32]; struct Load0__16 *lnk; } *Load0__16_s; -static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, LONGINT span, Texts_Elem *e); +static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, int64 pos, int64 span, Texts_Elem *e); -static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, LONGINT span, Texts_Elem *e) +static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, int64 pos, int64 span, Texts_Elem *e) { Modules_Module M = NIL; Modules_Command Cmd; Texts_Alien a = NIL; - LONGINT org, ew, eh; - SHORTINT eno; + int64 org, ew, eh; + int8 eno; Texts_new = NIL; Files_ReadLInt(&*r, r__typ, &ew); Files_ReadLInt(&*r, r__typ, &eh); @@ -1467,8 +1467,8 @@ static void Texts_Load0 (Files_Rider *r, LONGINT *r__typ, Texts_Text T) Texts_Run u = NIL, un = NIL; Texts_Piece p = NIL; Texts_Elem e = NIL; - LONGINT org, pos, hlen, plen; - SHORTINT ecnt, fno, fcnt, col, voff; + int64 org, pos, hlen, plen; + int8 ecnt, fno, fcnt, col, voff; Files_File f = NIL; Texts_FileMsg msg; CHAR mods[64][32], procs[64][32]; @@ -1538,7 +1538,7 @@ static void Texts_Load0 (Files_Rider *r, LONGINT *r__typ, Texts_Text T) void Texts_Load (Files_Rider *r, LONGINT *r__typ, Texts_Text T) { - INTEGER tag; + int32 tag; Files_ReadInt(&*r, r__typ, &tag); if (tag != -4095) { Files_Set(&*r, r__typ, Files_Base(&*r, r__typ), Files_Pos(&*r, r__typ) - 2); @@ -1553,7 +1553,7 @@ void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len) Texts_Run u = NIL; Texts_Piece p = NIL; CHAR tag, version; - LONGINT hlen; + int64 hlen; __DUP(name, name__len, CHAR); f = Files_Old(name, name__len); if (f == NIL) { @@ -1603,20 +1603,20 @@ void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len) } static struct Store__39 { - SHORTINT *ecnt; + int8 *ecnt; Texts_FileMsg *msg; Texts_IdentifyMsg *iden; CHAR (*mods)[64][32], (*procs)[64][32]; struct Store__39 *lnk; } *Store__39_s; -static void StoreElem__40 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, Texts_Elem e); +static void StoreElem__40 (Files_Rider *r, LONGINT *r__typ, int64 pos, Texts_Elem e); -static void StoreElem__40 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, Texts_Elem e) +static void StoreElem__40 (Files_Rider *r, LONGINT *r__typ, int64 pos, Texts_Elem e) { Files_Rider r1; - LONGINT org, span; - SHORTINT eno; + int64 org, span; + int8 eno; __COPY((*Store__39_s->iden).mod, (*Store__39_s->mods)[__X(*Store__39_s->ecnt, 64)], 32); __COPY((*Store__39_s->iden).proc, (*Store__39_s->procs)[__X(*Store__39_s->ecnt, 64)], 32); eno = 1; @@ -1647,8 +1647,8 @@ void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T) Files_Rider r1; Texts_Run u = NIL, un = NIL; Texts_Elem e = NIL; - LONGINT org, pos, delta, hlen, rlen; - SHORTINT ecnt, fno, fcnt; + int64 org, pos, delta, hlen, rlen; + int8 ecnt, fno, fcnt; CHAR ch; Texts_FileMsg msg; Texts_IdentifyMsg iden; @@ -1765,7 +1765,7 @@ void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len) { Files_File f = NIL; Files_Rider r; - INTEGER i, res; + int32 i, res; CHAR bak[64]; __DUP(name, name__len, CHAR); f = Files_New(name, name__len); diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index f36b27cf..2e48fe94 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -9,7 +9,7 @@ typedef struct Texts_BufDesc { - LONGINT len; + int64 len; char _prvt0[8]; } Texts_BufDesc; @@ -41,15 +41,15 @@ typedef typedef struct Texts_ElemDesc { char _prvt0[40]; - LONGINT W, H; + int64 W, H; Texts_Handler handle; char _prvt1[8]; } Texts_ElemDesc; typedef struct Texts_FileMsg { /* Texts_ElemMsg */ - INTEGER id; - LONGINT pos; + int32 id; + int64 pos; Files_Rider r; } Texts_FileMsg; @@ -70,13 +70,13 @@ typedef struct Texts_TextDesc *Texts_Text; typedef - void (*Texts_Notifier)(Texts_Text, INTEGER, LONGINT, LONGINT); + void (*Texts_Notifier)(Texts_Text, int32, int64, int64); typedef struct Texts_Reader { BOOLEAN eot; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; Texts_Elem elem; char _prvt0[64]; } Texts_Reader; @@ -85,22 +85,22 @@ typedef struct Texts_Scanner { /* Texts_Reader */ BOOLEAN eot; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; Texts_Elem elem; char _prvt0[64]; CHAR nextCh; - INTEGER line, class; - LONGINT i; + int32 line, class; + int64 i; REAL x; LONGREAL y; CHAR c; - SHORTINT len; + int8 len; CHAR s[64]; } Texts_Scanner; typedef struct Texts_TextDesc { - LONGINT len; + int64 len; Texts_Notifier notify; char _prvt0[24]; } Texts_TextDesc; @@ -109,7 +109,7 @@ typedef struct Texts_Writer { Texts_Buffer buf; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; char _prvt0[54]; } Texts_Writer; @@ -130,41 +130,41 @@ import LONGINT *Texts_Scanner__typ; import LONGINT *Texts_Writer__typ; import void Texts_Append (Texts_Text T, Texts_Buffer B); -import void Texts_ChangeLooks (Texts_Text T, LONGINT beg, LONGINT end, SET sel, Texts_FontsFont fnt, SHORTINT col, SHORTINT voff); +import void Texts_ChangeLooks (Texts_Text T, int64 beg, int64 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff); import void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len); import void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); import void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); -import void Texts_Delete (Texts_Text T, LONGINT beg, LONGINT end); +import void Texts_Delete (Texts_Text T, int64 beg, int64 end); import Texts_Text Texts_ElemBase (Texts_Elem E); -import LONGINT Texts_ElemPos (Texts_Elem E); -import void Texts_Insert (Texts_Text T, LONGINT pos, Texts_Buffer B); +import int64 Texts_ElemPos (Texts_Elem E); +import void Texts_Insert (Texts_Text T, int64 pos, Texts_Buffer B); import void Texts_Load (Files_Rider *r, LONGINT *r__typ, Texts_Text T); import void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len); import void Texts_OpenBuf (Texts_Buffer B); -import void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, LONGINT pos); -import void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, LONGINT pos); +import void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, int64 pos); +import void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, int64 pos); import void Texts_OpenWriter (Texts_Writer *W, LONGINT *W__typ); -import LONGINT Texts_Pos (Texts_Reader *R, LONGINT *R__typ); +import int64 Texts_Pos (Texts_Reader *R, LONGINT *R__typ); import void Texts_Read (Texts_Reader *R, LONGINT *R__typ, CHAR *ch); import void Texts_ReadElem (Texts_Reader *R, LONGINT *R__typ); import void Texts_ReadPrevElem (Texts_Reader *R, LONGINT *R__typ); import void Texts_Recall (Texts_Buffer *B); -import void Texts_Save (Texts_Text T, LONGINT beg, LONGINT end, Texts_Buffer B); +import void Texts_Save (Texts_Text T, int64 beg, int64 end, Texts_Buffer B); import void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ); -import void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, SHORTINT col); +import void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, int8 col); import void Texts_SetFont (Texts_Writer *W, LONGINT *W__typ, Texts_FontsFont fnt); -import void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, SHORTINT voff); +import void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, int8 voff); import void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T); import void Texts_Write (Texts_Writer *W, LONGINT *W__typ, CHAR ch); -import void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, LONGINT t, LONGINT d); +import void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, int64 t, int64 d); import void Texts_WriteElem (Texts_Writer *W, LONGINT *W__typ, Texts_Elem e); -import void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, LONGINT x); -import void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n); +import void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, int64 x); +import void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int64 x, int64 n); import void Texts_WriteLn (Texts_Writer *W, LONGINT *W__typ); -import void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER n); +import void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, int32 n); import void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x); -import void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n); -import void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n, INTEGER k); +import void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, int32 n); +import void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, int32 n, int32 k); import void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x); import void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__len); import void *Texts__init(void); diff --git a/bootstrap/unix-88/Vishap.c b/bootstrap/unix-88/Vishap.c index 65dd2639..c313eb20 100644 --- a/bootstrap/unix-88/Vishap.c +++ b/bootstrap/unix-88/Vishap.c @@ -21,7 +21,7 @@ static CHAR Vishap_mname[256]; export void Vishap_Module (BOOLEAN *done); static void Vishap_PropagateElementaryTypeSizes (void); export void Vishap_Translate (void); -static void Vishap_Trap (INTEGER sig); +static void Vishap_Trap (int32 sig); void Vishap_Module (BOOLEAN *done) @@ -127,7 +127,7 @@ void Vishap_Translate (void) } } -static void Vishap_Trap (INTEGER sig) +static void Vishap_Trap (int32 sig) { Heap_FINALL(); if (sig == 3) { diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index 566e2b5c..bc32dc20 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -18,7 +18,7 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGINT cmd__len) { - INTEGER r, status, exitcode; + int32 r, status, exitcode; __DUP(title, title__len, CHAR); __DUP(cmd, cmd__len, CHAR); if (OPM_Verbose) { diff --git a/bootstrap/unix-88/vt100.c b/bootstrap/unix-88/vt100.c index b9fb5373..a757d25d 100644 --- a/bootstrap/unix-88/vt100.c +++ b/bootstrap/unix-88/vt100.c @@ -9,36 +9,36 @@ export CHAR vt100_CSI[5]; static CHAR vt100_tmpstr[32]; -export void vt100_CHA (INTEGER n); -export void vt100_CNL (INTEGER n); -export void vt100_CPL (INTEGER n); -export void vt100_CUB (INTEGER n); -export void vt100_CUD (INTEGER n); -export void vt100_CUF (INTEGER n); -export void vt100_CUP (INTEGER n, INTEGER m); -export void vt100_CUU (INTEGER n); +export void vt100_CHA (int32 n); +export void vt100_CNL (int32 n); +export void vt100_CPL (int32 n); +export void vt100_CUB (int32 n); +export void vt100_CUD (int32 n); +export void vt100_CUF (int32 n); +export void vt100_CUP (int32 n, int32 m); +export void vt100_CUU (int32 n); export void vt100_DECTCEMh (void); export void vt100_DECTCEMl (void); -export void vt100_DSR (INTEGER n); -export void vt100_ED (INTEGER n); -export void vt100_EL (INTEGER n); -static void vt100_EscSeq (INTEGER n, CHAR *letter, LONGINT letter__len); +export void vt100_DSR (int32 n); +export void vt100_ED (int32 n); +export void vt100_EL (int32 n); +static void vt100_EscSeq (int32 n, CHAR *letter, LONGINT letter__len); static void vt100_EscSeq0 (CHAR *letter, LONGINT letter__len); -static void vt100_EscSeq2 (INTEGER n, INTEGER m, CHAR *letter, LONGINT letter__len); -static void vt100_EscSeqSwapped (INTEGER n, CHAR *letter, LONGINT letter__len); -export void vt100_HVP (INTEGER n, INTEGER m); -export void vt100_IntToStr (LONGINT int_, CHAR *str, LONGINT str__len); +static void vt100_EscSeq2 (int32 n, int32 m, CHAR *letter, LONGINT letter__len); +static void vt100_EscSeqSwapped (int32 n, CHAR *letter, LONGINT letter__len); +export void vt100_HVP (int32 n, int32 m); +export void vt100_IntToStr (int64 int_, CHAR *str, LONGINT str__len); export void vt100_RCP (void); -static void vt100_Reverse0 (CHAR *str, LONGINT str__len, INTEGER start, INTEGER end); +static void vt100_Reverse0 (CHAR *str, LONGINT str__len, int32 start, int32 end); export void vt100_SCP (void); -export void vt100_SD (INTEGER n); -export void vt100_SGR (INTEGER n); -export void vt100_SGR2 (INTEGER n, INTEGER m); -export void vt100_SU (INTEGER n); +export void vt100_SD (int32 n); +export void vt100_SGR (int32 n); +export void vt100_SGR2 (int32 n, int32 m); +export void vt100_SU (int32 n); export void vt100_SetAttr (CHAR *attr, LONGINT attr__len); -static void vt100_Reverse0 (CHAR *str, LONGINT str__len, INTEGER start, INTEGER end) +static void vt100_Reverse0 (CHAR *str, LONGINT str__len, int32 start, int32 end) { CHAR h; while (start < end) { @@ -50,11 +50,11 @@ static void vt100_Reverse0 (CHAR *str, LONGINT str__len, INTEGER start, INTEGER } } -void vt100_IntToStr (LONGINT int_, CHAR *str, LONGINT str__len) +void vt100_IntToStr (int64 int_, CHAR *str, LONGINT str__len) { CHAR b[21]; - INTEGER s, e; - SHORTINT maxLength; + int32 s, e; + int8 maxLength; maxLength = 20; if (int_ == (-9223372036854775807-1)) { __MOVE("-9223372036854775808", b, 21); @@ -89,7 +89,7 @@ static void vt100_EscSeq0 (CHAR *letter, LONGINT letter__len) __DEL(letter); } -static void vt100_EscSeq (INTEGER n, CHAR *letter, LONGINT letter__len) +static void vt100_EscSeq (int32 n, CHAR *letter, LONGINT letter__len) { CHAR nstr[2]; CHAR cmd[7]; @@ -102,7 +102,7 @@ static void vt100_EscSeq (INTEGER n, CHAR *letter, LONGINT letter__len) __DEL(letter); } -static void vt100_EscSeqSwapped (INTEGER n, CHAR *letter, LONGINT letter__len) +static void vt100_EscSeqSwapped (int32 n, CHAR *letter, LONGINT letter__len) { CHAR nstr[2]; CHAR cmd[7]; @@ -115,7 +115,7 @@ static void vt100_EscSeqSwapped (INTEGER n, CHAR *letter, LONGINT letter__len) __DEL(letter); } -static void vt100_EscSeq2 (INTEGER n, INTEGER m, CHAR *letter, LONGINT letter__len) +static void vt100_EscSeq2 (int32 n, int32 m, CHAR *letter, LONGINT letter__len) { CHAR nstr[5], mstr[5]; CHAR cmd[12]; @@ -131,82 +131,82 @@ static void vt100_EscSeq2 (INTEGER n, INTEGER m, CHAR *letter, LONGINT letter__l __DEL(letter); } -void vt100_CUU (INTEGER n) +void vt100_CUU (int32 n) { vt100_EscSeq(n, (CHAR*)"A", 2); } -void vt100_CUD (INTEGER n) +void vt100_CUD (int32 n) { vt100_EscSeq(n, (CHAR*)"B", 2); } -void vt100_CUF (INTEGER n) +void vt100_CUF (int32 n) { vt100_EscSeq(n, (CHAR*)"C", 2); } -void vt100_CUB (INTEGER n) +void vt100_CUB (int32 n) { vt100_EscSeq(n, (CHAR*)"D", 2); } -void vt100_CNL (INTEGER n) +void vt100_CNL (int32 n) { vt100_EscSeq(n, (CHAR*)"E", 2); } -void vt100_CPL (INTEGER n) +void vt100_CPL (int32 n) { vt100_EscSeq(n, (CHAR*)"F", 2); } -void vt100_CHA (INTEGER n) +void vt100_CHA (int32 n) { vt100_EscSeq(n, (CHAR*)"G", 2); } -void vt100_CUP (INTEGER n, INTEGER m) +void vt100_CUP (int32 n, int32 m) { vt100_EscSeq2(n, m, (CHAR*)"H", 2); } -void vt100_ED (INTEGER n) +void vt100_ED (int32 n) { vt100_EscSeq(n, (CHAR*)"J", 2); } -void vt100_EL (INTEGER n) +void vt100_EL (int32 n) { vt100_EscSeq(n, (CHAR*)"K", 2); } -void vt100_SU (INTEGER n) +void vt100_SU (int32 n) { vt100_EscSeq(n, (CHAR*)"S", 2); } -void vt100_SD (INTEGER n) +void vt100_SD (int32 n) { vt100_EscSeq(n, (CHAR*)"T", 2); } -void vt100_HVP (INTEGER n, INTEGER m) +void vt100_HVP (int32 n, int32 m) { vt100_EscSeq2(n, m, (CHAR*)"f", 2); } -void vt100_SGR (INTEGER n) +void vt100_SGR (int32 n) { vt100_EscSeq(n, (CHAR*)"m", 2); } -void vt100_SGR2 (INTEGER n, INTEGER m) +void vt100_SGR2 (int32 n, int32 m) { vt100_EscSeq2(n, m, (CHAR*)"m", 2); } -void vt100_DSR (INTEGER n) +void vt100_DSR (int32 n) { vt100_EscSeq(6, (CHAR*)"n", 2); } diff --git a/bootstrap/unix-88/vt100.h b/bootstrap/unix-88/vt100.h index 745ff709..fb8a12d0 100644 --- a/bootstrap/unix-88/vt100.h +++ b/bootstrap/unix-88/vt100.h @@ -10,27 +10,27 @@ import CHAR vt100_CSI[5]; -import void vt100_CHA (INTEGER n); -import void vt100_CNL (INTEGER n); -import void vt100_CPL (INTEGER n); -import void vt100_CUB (INTEGER n); -import void vt100_CUD (INTEGER n); -import void vt100_CUF (INTEGER n); -import void vt100_CUP (INTEGER n, INTEGER m); -import void vt100_CUU (INTEGER n); +import void vt100_CHA (int32 n); +import void vt100_CNL (int32 n); +import void vt100_CPL (int32 n); +import void vt100_CUB (int32 n); +import void vt100_CUD (int32 n); +import void vt100_CUF (int32 n); +import void vt100_CUP (int32 n, int32 m); +import void vt100_CUU (int32 n); import void vt100_DECTCEMh (void); import void vt100_DECTCEMl (void); -import void vt100_DSR (INTEGER n); -import void vt100_ED (INTEGER n); -import void vt100_EL (INTEGER n); -import void vt100_HVP (INTEGER n, INTEGER m); -import void vt100_IntToStr (LONGINT int_, CHAR *str, LONGINT str__len); +import void vt100_DSR (int32 n); +import void vt100_ED (int32 n); +import void vt100_EL (int32 n); +import void vt100_HVP (int32 n, int32 m); +import void vt100_IntToStr (int64 int_, CHAR *str, LONGINT str__len); import void vt100_RCP (void); import void vt100_SCP (void); -import void vt100_SD (INTEGER n); -import void vt100_SGR (INTEGER n); -import void vt100_SGR2 (INTEGER n, INTEGER m); -import void vt100_SU (INTEGER n); +import void vt100_SD (int32 n); +import void vt100_SGR (int32 n); +import void vt100_SGR2 (int32 n, int32 m); +import void vt100_SU (int32 n); import void vt100_SetAttr (CHAR *attr, LONGINT attr__len); import void *vt100__init(void); diff --git a/bootstrap/windows-48/Console.c b/bootstrap/windows-48/Console.c index bd7a7d85..72c0b6bf 100644 --- a/bootstrap/windows-48/Console.c +++ b/bootstrap/windows-48/Console.c @@ -4,14 +4,14 @@ static CHAR Console_line[128]; -static INTEGER Console_pos; +static int16 Console_pos; export void Console_Bool (BOOLEAN b); export void Console_Char (CHAR ch); export void Console_Flush (void); -export void Console_Hex (LONGINT i); -export void Console_Int (LONGINT i, LONGINT n); +export void Console_Hex (int32 i); +export void Console_Int (int32 i, int32 n); export void Console_Ln (void); export void Console_Read (CHAR *ch); export void Console_ReadLine (CHAR *line, LONGINT line__len); @@ -20,7 +20,7 @@ export void Console_String (CHAR *s, LONGINT s__len); void Console_Flush (void) { - INTEGER error; + int16 error; error = Platform_Write(Platform_StdOut, (SYSTEM_ADRINT)Console_line, Console_pos); Console_pos = 0; } @@ -39,7 +39,7 @@ void Console_Char (CHAR ch) void Console_String (CHAR *s, LONGINT s__len) { - INTEGER i; + int16 i; __DUP(s, s__len, CHAR); i = 0; while (s[__X(i, s__len)] != 0x00) { @@ -49,11 +49,11 @@ void Console_String (CHAR *s, LONGINT s__len) __DEL(s); } -void Console_Int (LONGINT i, LONGINT n) +void Console_Int (int32 i, int32 n) { CHAR s[32]; - LONGINT i1, k; - if (i == __LSHL(1, 31, LONGINT)) { + int32 i1, k; + if (i == __LSHL(1, 31, int32)) { __MOVE("8463847412", s, 11); k = 10; } else { @@ -95,9 +95,9 @@ void Console_Bool (BOOLEAN b) } } -void Console_Hex (LONGINT i) +void Console_Hex (int32 i) { - LONGINT k, n; + int32 k, n; k = -28; while (k <= 0) { n = __MASK(__ASH(i, k), -16); @@ -112,8 +112,8 @@ void Console_Hex (LONGINT i) void Console_Read (CHAR *ch) { - LONGINT n; - INTEGER error; + int32 n; + int16 error; Console_Flush(); error = Platform_ReadBuf(Platform_StdIn, (void*)&*ch, 1, &n); if (n != 1) { @@ -123,7 +123,7 @@ void Console_Read (CHAR *ch) void Console_ReadLine (CHAR *line, LONGINT line__len) { - LONGINT i; + int32 i; CHAR ch; Console_Flush(); i = 0; diff --git a/bootstrap/windows-48/Console.h b/bootstrap/windows-48/Console.h index 2c01265d..16287a76 100644 --- a/bootstrap/windows-48/Console.h +++ b/bootstrap/windows-48/Console.h @@ -11,8 +11,8 @@ import void Console_Bool (BOOLEAN b); import void Console_Char (CHAR ch); import void Console_Flush (void); -import void Console_Hex (LONGINT i); -import void Console_Int (LONGINT i, LONGINT n); +import void Console_Hex (int32 i); +import void Console_Int (int32 i, int32 n); import void Console_Ln (void); import void Console_Read (CHAR *ch); import void Console_ReadLine (CHAR *line, LONGINT line__len); diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 459e292f..4aecc2ee 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -13,7 +13,7 @@ typedef struct Files_BufDesc { Files_File f; BOOLEAN chg; - LONGINT org, size; + int32 org, size; SYSTEM_BYTE data[4096]; } Files_BufDesc; @@ -28,23 +28,23 @@ typedef Files_FileName workName, registerName; BOOLEAN tempFile; Platform_FileIdentity identity; - LONGINT fd, len, pos; + int32 fd, len, pos; Files_Buffer bufs[4]; - INTEGER swapper, state; + int16 swapper, state; Files_File next; } Files_FileDesc; typedef struct Files_Rider { - LONGINT res; + int32 res; BOOLEAN eof; Files_Buffer buf; - LONGINT org, offset; + int32 org, offset; } Files_Rider; static Files_File Files_files; -static INTEGER Files_tempno; +static int16 Files_tempno; static CHAR Files_HOME[1024]; static struct { LONGINT len[1]; @@ -57,56 +57,56 @@ export LONGINT *Files_Rider__typ; export Files_File Files_Base (Files_Rider *r, LONGINT *r__typ); static Files_File Files_CacheEntry (Platform_FileIdentity identity); -export void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INTEGER *res); +export void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int16 *res); export void Files_Close (Files_File f); static void Files_CloseOSFile (Files_File f); static void Files_Create (Files_File f); -export void Files_Delete (CHAR *name, LONGINT name__len, INTEGER *res); -static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INTEGER errcode); +export void Files_Delete (CHAR *name, LONGINT name__len, int16 *res); +static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int16 errcode); static void Files_Finalize (SYSTEM_PTR o); static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *dest, LONGINT dest__len); static void Files_Flush (Files_Buffer buf); -export void Files_GetDate (Files_File f, LONGINT *t, LONGINT *d); +export void Files_GetDate (Files_File f, int32 *t, int32 *d); export void Files_GetName (Files_File f, CHAR *name, LONGINT name__len); static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *name, LONGINT name__len); static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len); -export LONGINT Files_Length (Files_File f); +export int32 Files_Length (Files_File f); static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT name__len, CHAR *dest, LONGINT dest__len); export Files_File Files_New (CHAR *name, LONGINT name__len); export Files_File Files_Old (CHAR *name, LONGINT name__len); -export LONGINT Files_Pos (Files_Rider *r, LONGINT *r__typ); +export int32 Files_Pos (Files_Rider *r, LONGINT *r__typ); export void Files_Purge (Files_File f); export void Files_Read (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x); export void Files_ReadBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN *x); export void Files_ReadByte (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len); -export void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, LONGINT n); -export void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, INTEGER *x); -export void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, LONGINT *x); +export void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); +export void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, int16 *x); +export void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, int32 *x); export void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x); export void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); -export void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, LONGINT *x); +export void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int32 *x); export void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x); export void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x); export void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); export void Files_Register (Files_File f); -export void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INTEGER *res); -static void Files_ScanPath (INTEGER *pos, CHAR *dir, LONGINT dir__len); -export void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, LONGINT pos); +export void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res); +static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len); +export void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, int32 pos); export void Files_SetSearchPath (CHAR *path, LONGINT path__len); export void Files_Write (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE x); export void Files_WriteBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN x); -export void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, LONGINT n); -export void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, INTEGER x); -export void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, LONGINT x); +export void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); +export void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, int16 x); +export void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, int32 x); export void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x); -export void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, LONGINT x); +export void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int32 x); export void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x); export void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x); export void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); #define Files_IdxTrap() __HALT(-1) -static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INTEGER errcode) +static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int16 errcode) { __DUP(s, s__len, CHAR); Console_Ln(); @@ -135,7 +135,7 @@ static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INTEGER errcode) static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT name__len, CHAR *dest, LONGINT dest__len) { - INTEGER i, j; + int16 i, j; __DUP(dir, dir__len, CHAR); __DUP(name, name__len, CHAR); i = 0; @@ -160,7 +160,7 @@ static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *name, LONGINT name__len) { - LONGINT n, i, j; + int32 n, i, j; __DUP(finalName, finalName__len, CHAR); Files_tempno += 1; n = Files_tempno; @@ -212,7 +212,7 @@ static void Files_Create (Files_File f) { Platform_FileIdentity identity; BOOLEAN done; - INTEGER error; + int16 error; CHAR err[32]; if (f->fd == -1) { if (f->state == 1) { @@ -249,7 +249,7 @@ static void Files_Create (Files_File f) static void Files_Flush (Files_Buffer buf) { - INTEGER error; + int16 error; Files_File f = NIL; if (buf->chg) { f = buf->f; @@ -273,7 +273,7 @@ static void Files_Flush (Files_Buffer buf) static void Files_CloseOSFile (Files_File f) { Files_File prev = NIL; - INTEGER error; + int16 error; if (Files_files == f) { Files_files = f->next; } else { @@ -293,8 +293,8 @@ static void Files_CloseOSFile (Files_File f) void Files_Close (Files_File f) { - LONGINT i; - INTEGER error; + int32 i; + int16 error; if (f->state != 1 || f->registerName[0] != 0x00) { Files_Create(f); i = 0; @@ -310,9 +310,9 @@ void Files_Close (Files_File f) } } -LONGINT Files_Length (Files_File f) +int32 Files_Length (Files_File f) { - LONGINT _o_result; + int32 _o_result; _o_result = f->len; return _o_result; } @@ -335,9 +335,9 @@ Files_File Files_New (CHAR *name, LONGINT name__len) return _o_result; } -static void Files_ScanPath (INTEGER *pos, CHAR *dir, LONGINT dir__len) +static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len) { - INTEGER i; + int16 i; CHAR ch; i = 0; if (Files_SearchPath == NIL) { @@ -381,7 +381,7 @@ static void Files_ScanPath (INTEGER *pos, CHAR *dir, LONGINT dir__len) static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len) { BOOLEAN _o_result; - INTEGER i; + int16 i; CHAR ch; i = 0; ch = name[0]; @@ -397,7 +397,7 @@ static Files_File Files_CacheEntry (Platform_FileIdentity identity) { Files_File _o_result; Files_File f = NIL; - INTEGER i, error; + int16 i, error; f = Files_files; while (f != NIL) { if (Platform_SameFile(identity, f->identity)) { @@ -427,11 +427,11 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) { Files_File _o_result; Files_File f = NIL; - LONGINT fd; - INTEGER pos; + int32 fd; + int16 pos; BOOLEAN done; CHAR dir[256], path[256]; - INTEGER error; + int16 error; Platform_FileIdentity identity; __DUP(name, name__len, CHAR); if (name[0] != 0x00) { @@ -506,9 +506,9 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) void Files_Purge (Files_File f) { - INTEGER i; + int16 i; Platform_FileIdentity identity; - INTEGER error; + int16 error; i = 0; while (i < 4) { if (f->bufs[i] != NIL) { @@ -528,27 +528,27 @@ void Files_Purge (Files_File f) Platform_SetMTime(&f->identity, Platform_FileIdentity__typ, identity); } -void Files_GetDate (Files_File f, LONGINT *t, LONGINT *d) +void Files_GetDate (Files_File f, int32 *t, int32 *d) { Platform_FileIdentity identity; - INTEGER error; + int16 error; Files_Create(f); error = Platform_Identify(f->fd, &identity, Platform_FileIdentity__typ); Platform_MTimeAsClock(identity, &*t, &*d); } -LONGINT Files_Pos (Files_Rider *r, LONGINT *r__typ) +int32 Files_Pos (Files_Rider *r, LONGINT *r__typ) { - LONGINT _o_result; + int32 _o_result; _o_result = (*r).org + (*r).offset; return _o_result; } -void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, LONGINT pos) +void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, int32 pos) { - LONGINT org, offset, i, n; + int32 org, offset, i, n; Files_Buffer buf = NIL; - INTEGER error; + int16 error; if (f != NIL) { if (pos > f->len) { pos = f->len; @@ -608,7 +608,7 @@ void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, LONGINT pos) void Files_Read (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x) { - LONGINT offset; + int32 offset; Files_Buffer buf = NIL; buf = (*r).buf; offset = (*r).offset; @@ -630,9 +630,9 @@ void Files_Read (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x) } } -void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, LONGINT n) +void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n) { - LONGINT xpos, min, restInBuf, offset; + int32 xpos, min, restInBuf, offset; Files_Buffer buf = NIL; if (n > x__len) { Files_IdxTrap(); @@ -681,7 +681,7 @@ Files_File Files_Base (Files_Rider *r, LONGINT *r__typ) void Files_Write (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE x) { Files_Buffer buf = NIL; - LONGINT offset; + int32 offset; buf = (*r).buf; offset = (*r).offset; if ((*r).org != buf->org || offset >= 4096) { @@ -699,9 +699,9 @@ void Files_Write (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE x) (*r).res = 0; } -void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, LONGINT n) +void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n) { - LONGINT xpos, min, restInBuf, offset; + int32 xpos, min, restInBuf, offset; Files_Buffer buf = NIL; if (n > x__len) { Files_IdxTrap(); @@ -735,17 +735,17 @@ void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT (*r).res = 0; } -void Files_Delete (CHAR *name, LONGINT name__len, INTEGER *res) +void Files_Delete (CHAR *name, LONGINT name__len, int16 *res) { __DUP(name, name__len, CHAR); *res = Platform_Unlink((void*)name, name__len); __DEL(name); } -void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INTEGER *res) +void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res) { - LONGINT fdold, fdnew, n; - INTEGER error, ignore; + int32 fdold, fdnew, n; + int16 error, ignore; Platform_FileIdentity oldidentity, newidentity; CHAR buf[4096]; __DUP(old, old__len, CHAR); @@ -800,7 +800,7 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT void Files_Register (Files_File f) { - INTEGER idx, errcode; + int16 idx, errcode; Files_File f1 = NIL; CHAR file[104]; if ((f->state == 1 && f->registerName[0] != 0x00)) { @@ -819,7 +819,7 @@ void Files_Register (Files_File f) } } -void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INTEGER *res) +void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int16 *res) { __DUP(path, path__len, CHAR); *res = Platform_Chdir((void*)path, path__len); @@ -828,7 +828,7 @@ void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INTEGER *res) static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *dest, LONGINT dest__len) { - LONGINT i, j; + int32 i, j; if (!Platform_LittleEndian) { i = src__len; j = 0; @@ -847,26 +847,26 @@ void Files_ReadBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN *x) Files_Read(&*R, R__typ, (CHAR*)(void*)&*x); } -void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, INTEGER *x) +void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, int16 *x) { CHAR b[2]; Files_ReadBytes(&*R, R__typ, (void*)b, 2, 2); - *x = (SYSTEM_INT16)b[0] + __ASHL((SYSTEM_INT16)b[1], 8); + *x = (int16)b[0] + __ASHL((int16)b[1], 8); } -void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, LONGINT *x) +void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, int32 *x) { CHAR b[4]; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); - *x = (((SYSTEM_INT16)b[0] + __ASHL((SYSTEM_INT16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); + *x = (((int16)b[0] + __ASHL((int16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); } void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x) { CHAR b[4]; - LONGINT l; + int32 l; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); - l = (((SYSTEM_INT16)b[0] + __ASHL((SYSTEM_INT16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); + l = (((int16)b[0] + __ASHL((int16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); *x = (SET)l; } @@ -886,7 +886,7 @@ void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x) void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) { - INTEGER i; + int16 i; CHAR ch; i = 0; do { @@ -898,7 +898,7 @@ void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) { - INTEGER i; + int16 i; CHAR ch; BOOLEAN b; i = 0; @@ -914,20 +914,20 @@ void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) } while (!b); } -void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, LONGINT *x) +void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int32 *x) { - SHORTINT s; + int8 s; CHAR ch; - LONGINT n; + int32 n; s = 0; n = 0; Files_Read(&*R, R__typ, (void*)&ch); - while ((SYSTEM_INT16)ch >= 128) { - n += __ASH(((SYSTEM_INT16)ch - 128), s); + while ((int16)ch >= 128) { + n += __ASH(((int16)ch - 128), s); s += 7; Files_Read(&*R, R__typ, (void*)&ch); } - n += __ASH((__MASK((SYSTEM_INT16)ch, -64) - __ASHL(__ASHR((SYSTEM_INT16)ch, 6), 6)), s); + n += __ASH((__MASK((int16)ch, -64) - __ASHL(__ASHR((int16)ch, 6), 6)), s); *x = n; } @@ -936,7 +936,7 @@ void Files_WriteBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN x) Files_Write(&*R, R__typ, __VAL(CHAR, x)); } -void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, INTEGER x) +void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, int16 x) { CHAR b[2]; b[0] = (CHAR)x; @@ -944,7 +944,7 @@ void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, INTEGER x) Files_WriteBytes(&*R, R__typ, (void*)b, 2, 2); } -void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, LONGINT x) +void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, int32 x) { CHAR b[4]; b[0] = (CHAR)x; @@ -957,8 +957,8 @@ void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, LONGINT x) void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x) { CHAR b[4]; - LONGINT i; - i = (LONGINT)x; + int32 i; + i = (int32)x; b[0] = (CHAR)i; b[1] = (CHAR)__ASHR(i, 8); b[2] = (CHAR)__ASHR(i, 16); @@ -982,7 +982,7 @@ void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x) void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) { - INTEGER i; + int16 i; i = 0; while (x[i] != 0x00) { i += 1; @@ -990,7 +990,7 @@ void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len Files_WriteBytes(&*R, R__typ, (void*)x, x__len * 1, i + 1); } -void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, LONGINT x) +void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int32 x) { while (x < -64 || x > 63) { Files_Write(&*R, R__typ, (CHAR)(__MASK(x, -128) + 128)); @@ -1007,7 +1007,7 @@ void Files_GetName (Files_File f, CHAR *name, LONGINT name__len) static void Files_Finalize (SYSTEM_PTR o) { Files_File f = NIL; - LONGINT res; + int32 res; f = (Files_File)(SYSTEM_ADRINT)o; if (f->fd >= 0) { Files_CloseOSFile(f); diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index 3de5b022..e85d1cfd 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -11,13 +11,13 @@ typedef typedef struct Files_FileDesc { char _prvt0[224]; - LONGINT fd; + int32 fd; char _prvt1[32]; } Files_FileDesc; typedef struct Files_Rider { - LONGINT res; + int32 res; BOOLEAN eof; char _prvt0[15]; } Files_Rider; @@ -28,39 +28,39 @@ import LONGINT *Files_FileDesc__typ; import LONGINT *Files_Rider__typ; import Files_File Files_Base (Files_Rider *r, LONGINT *r__typ); -import void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INTEGER *res); +import void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int16 *res); import void Files_Close (Files_File f); -import void Files_Delete (CHAR *name, LONGINT name__len, INTEGER *res); -import void Files_GetDate (Files_File f, LONGINT *t, LONGINT *d); +import void Files_Delete (CHAR *name, LONGINT name__len, int16 *res); +import void Files_GetDate (Files_File f, int32 *t, int32 *d); import void Files_GetName (Files_File f, CHAR *name, LONGINT name__len); -import LONGINT Files_Length (Files_File f); +import int32 Files_Length (Files_File f); import Files_File Files_New (CHAR *name, LONGINT name__len); import Files_File Files_Old (CHAR *name, LONGINT name__len); -import LONGINT Files_Pos (Files_Rider *r, LONGINT *r__typ); +import int32 Files_Pos (Files_Rider *r, LONGINT *r__typ); import void Files_Purge (Files_File f); import void Files_Read (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x); import void Files_ReadBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN *x); import void Files_ReadByte (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len); -import void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, LONGINT n); -import void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, INTEGER *x); -import void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, LONGINT *x); +import void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); +import void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, int16 *x); +import void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, int32 *x); import void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x); import void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); -import void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, LONGINT *x); +import void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int32 *x); import void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x); import void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x); import void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); import void Files_Register (Files_File f); -import void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INTEGER *res); -import void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, LONGINT pos); +import void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res); +import void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, int32 pos); import void Files_SetSearchPath (CHAR *path, LONGINT path__len); import void Files_Write (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE x); import void Files_WriteBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN x); -import void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, LONGINT n); -import void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, INTEGER x); -import void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, LONGINT x); +import void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); +import void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, int16 x); +import void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, int32 x); import void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x); -import void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, LONGINT x); +import void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int32 x); import void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x); import void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x); import void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index 50d17d87..a252264a 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -34,7 +34,7 @@ typedef typedef struct Heap_FinDesc { Heap_FinNode next; - LONGINT obj; + int32 obj; BOOLEAN marked; Heap_Finalizer finalize; } Heap_FinDesc; @@ -49,25 +49,25 @@ typedef struct Heap_ModuleDesc { Heap_Module next; Heap_ModuleName name; - LONGINT refcnt; + int32 refcnt; Heap_Cmd cmds; - LONGINT types; + int32 types; Heap_EnumProc enumPtrs; - LONGINT reserved1, reserved2; + int32 reserved1, reserved2; } Heap_ModuleDesc; export SYSTEM_PTR Heap_modules; -static LONGINT Heap_freeList[10]; -static LONGINT Heap_bigBlocks; -export LONGINT Heap_allocated; +static int32 Heap_freeList[10]; +static int32 Heap_bigBlocks; +export int32 Heap_allocated; static BOOLEAN Heap_firstTry; -static LONGINT Heap_heap, Heap_heapend; -export LONGINT Heap_heapsize; +static int32 Heap_heap, Heap_heapend; +export int32 Heap_heapsize; static Heap_FinNode Heap_fin; -static INTEGER Heap_lockdepth; +static int16 Heap_lockdepth; static BOOLEAN Heap_interrupted; -export INTEGER Heap_FileCount; +export int16 Heap_FileCount; export LONGINT *Heap_ModuleDesc__typ; export LONGINT *Heap_CmdDesc__typ; @@ -75,27 +75,27 @@ export LONGINT *Heap_FinDesc__typ; export LONGINT *Heap__1__typ; static void Heap_CheckFin (void); -static void Heap_ExtendHeap (LONGINT blksz); +static void Heap_ExtendHeap (int32 blksz); export void Heap_FINALL (void); static void Heap_Finalize (void); export void Heap_GC (BOOLEAN markStack); -static void Heap_HeapSort (LONGINT n, LONGINT *a, LONGINT a__len); +static void Heap_HeapSort (int32 n, int32 *a, LONGINT a__len); export void Heap_INCREF (Heap_Module m); export void Heap_InitHeap (void); export void Heap_Lock (void); -static void Heap_Mark (LONGINT q); -static void Heap_MarkCandidates (LONGINT n, LONGINT *cand, LONGINT cand__len); +static void Heap_Mark (int32 q); +static void Heap_MarkCandidates (int32 n, int32 *cand, LONGINT cand__len); static void Heap_MarkP (SYSTEM_PTR p); -static void Heap_MarkStack (LONGINT n, LONGINT *cand, LONGINT cand__len); -export SYSTEM_PTR Heap_NEWBLK (LONGINT size); -export SYSTEM_PTR Heap_NEWREC (LONGINT tag); -static LONGINT Heap_NewChunk (LONGINT blksz); +static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len); +export SYSTEM_PTR Heap_NEWBLK (int32 size); +export SYSTEM_PTR Heap_NEWREC (int32 tag); +static int32 Heap_NewChunk (int32 blksz); export void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); export SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -export void Heap_REGTYP (Heap_Module m, LONGINT typ); +export void Heap_REGTYP (Heap_Module m, int32 typ); export void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); static void Heap_Scan (void); -static void Heap_Sift (LONGINT l, LONGINT r, LONGINT *a, LONGINT a__len); +static void Heap_Sift (int32 l, int32 r, int32 *a, LONGINT a__len); export void Heap_Unlock (void); extern void *Heap__init(); @@ -154,9 +154,9 @@ void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) m->cmds = c; } -void Heap_REGTYP (Heap_Module m, LONGINT typ) +void Heap_REGTYP (Heap_Module m, int32 typ) { - __PUT(typ, m->types, LONGINT); + __PUT(typ, m->types, int32); m->types = typ; } @@ -165,17 +165,17 @@ void Heap_INCREF (Heap_Module m) m->refcnt += 1; } -static LONGINT Heap_NewChunk (LONGINT blksz) +static int32 Heap_NewChunk (int32 blksz) { - LONGINT _o_result; - LONGINT chnk; + int32 _o_result; + int32 chnk; chnk = Heap_OSAllocate(blksz + 12); if (chnk != 0) { - __PUT(chnk + 4, chnk + (12 + blksz), LONGINT); - __PUT(chnk + 12, chnk + 16, LONGINT); - __PUT(chnk + 16, blksz, LONGINT); - __PUT(chnk + 20, -4, LONGINT); - __PUT(chnk + 24, Heap_bigBlocks, LONGINT); + __PUT(chnk + 4, chnk + (12 + blksz), int32); + __PUT(chnk + 12, chnk + 16, int32); + __PUT(chnk + 16, blksz, int32); + __PUT(chnk + 20, -4, int32); + __PUT(chnk + 24, Heap_bigBlocks, int32); Heap_bigBlocks = chnk + 12; Heap_heapsize += blksz; } @@ -183,9 +183,9 @@ static LONGINT Heap_NewChunk (LONGINT blksz) return _o_result; } -static void Heap_ExtendHeap (LONGINT blksz) +static void Heap_ExtendHeap (int32 blksz) { - LONGINT size, chnk, j, next; + int32 size, chnk, j, next; if (blksz > 160000) { size = blksz; } else { @@ -194,7 +194,7 @@ static void Heap_ExtendHeap (LONGINT blksz) chnk = Heap_NewChunk(size); if (chnk != 0) { if (chnk < Heap_heap) { - __PUT(chnk, Heap_heap, LONGINT); + __PUT(chnk, Heap_heap, int32); Heap_heap = chnk; } else { j = Heap_heap; @@ -203,8 +203,8 @@ static void Heap_ExtendHeap (LONGINT blksz) j = next; next = Heap_FetchAddress(j); } - __PUT(chnk, next, LONGINT); - __PUT(j, chnk, LONGINT); + __PUT(chnk, next, int32); + __PUT(j, chnk, int32); } if (next == 0) { Heap_heapend = Heap_FetchAddress(chnk + 4); @@ -212,10 +212,10 @@ static void Heap_ExtendHeap (LONGINT blksz) } } -SYSTEM_PTR Heap_NEWREC (LONGINT tag) +SYSTEM_PTR Heap_NEWREC (int32 tag) { SYSTEM_PTR _o_result; - LONGINT i, i0, di, blksz, restsize, t, adr, end, next, prev; + int32 i, i0, di, blksz, restsize, t, adr, end, next, prev; SYSTEM_PTR new; Heap_Lock(); blksz = Heap_FetchAddress(tag); @@ -235,11 +235,11 @@ SYSTEM_PTR Heap_NEWREC (LONGINT tag) di = i - i0; restsize = __ASHL(di, 4); end = adr + restsize; - __PUT(end + 4, blksz, LONGINT); - __PUT(end + 8, -4, LONGINT); - __PUT(end, end + 4, LONGINT); - __PUT(adr + 4, restsize, LONGINT); - __PUT(adr + 12, Heap_freeList[di], LONGINT); + __PUT(end + 4, blksz, int32); + __PUT(end + 8, -4, int32); + __PUT(end, end + 4, int32); + __PUT(adr + 4, restsize, int32); + __PUT(adr + 12, Heap_freeList[di], int32); Heap_freeList[di] = adr; adr += restsize; } @@ -279,22 +279,22 @@ SYSTEM_PTR Heap_NEWREC (LONGINT tag) } restsize = t - blksz; end = adr + restsize; - __PUT(end + 4, blksz, LONGINT); - __PUT(end + 8, -4, LONGINT); - __PUT(end, end + 4, LONGINT); + __PUT(end + 4, blksz, int32); + __PUT(end + 8, -4, int32); + __PUT(end, end + 4, int32); if (restsize > 144) { - __PUT(adr + 4, restsize, LONGINT); + __PUT(adr + 4, restsize, int32); } else { next = Heap_FetchAddress(adr + 12); if (prev == 0) { Heap_bigBlocks = next; } else { - __PUT(prev + 12, next, LONGINT); + __PUT(prev + 12, next, int32); } if (restsize > 0) { di = __ASHR(restsize, 4); - __PUT(adr + 4, restsize, LONGINT); - __PUT(adr + 12, Heap_freeList[di], LONGINT); + __PUT(adr + 4, restsize, int32); + __PUT(adr + 12, Heap_freeList[di], int32); Heap_freeList[di] = adr; } } @@ -303,53 +303,53 @@ SYSTEM_PTR Heap_NEWREC (LONGINT tag) i = adr + 16; end = adr + blksz; while (i < end) { - __PUT(i, 0, LONGINT); - __PUT(i + 4, 0, LONGINT); - __PUT(i + 8, 0, LONGINT); - __PUT(i + 12, 0, LONGINT); + __PUT(i, 0, int32); + __PUT(i + 4, 0, int32); + __PUT(i + 8, 0, int32); + __PUT(i + 12, 0, int32); i += 16; } - __PUT(adr + 12, 0, LONGINT); - __PUT(adr, tag, LONGINT); - __PUT(adr + 4, 0, LONGINT); - __PUT(adr + 8, 0, LONGINT); + __PUT(adr + 12, 0, int32); + __PUT(adr, tag, int32); + __PUT(adr + 4, 0, int32); + __PUT(adr + 8, 0, int32); Heap_allocated += blksz; Heap_Unlock(); _o_result = (SYSTEM_PTR)(SYSTEM_ADRINT)(adr + 4); return _o_result; } -SYSTEM_PTR Heap_NEWBLK (LONGINT size) +SYSTEM_PTR Heap_NEWBLK (int32 size) { SYSTEM_PTR _o_result; - LONGINT blksz, tag; + int32 blksz, tag; SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 31, 4), 4); new = Heap_NEWREC((SYSTEM_ADRINT)&blksz); - tag = ((LONGINT)(SYSTEM_ADRINT)new + blksz) - 12; - __PUT(tag - 4, 0, LONGINT); - __PUT(tag, blksz, LONGINT); - __PUT(tag + 4, -4, LONGINT); - __PUT((LONGINT)(SYSTEM_ADRINT)new - 4, tag, LONGINT); + tag = ((int32)(SYSTEM_ADRINT)new + blksz) - 12; + __PUT(tag - 4, 0, int32); + __PUT(tag, blksz, int32); + __PUT(tag + 4, -4, int32); + __PUT((int32)(SYSTEM_ADRINT)new - 4, tag, int32); Heap_Unlock(); _o_result = new; return _o_result; } -static void Heap_Mark (LONGINT q) +static void Heap_Mark (int32 q) { - LONGINT p, tag, fld, n, offset, tagbits; + int32 p, tag, fld, n, offset, tagbits; if (q != 0) { tagbits = Heap_FetchAddress(q - 4); if (!__ODD(tagbits)) { - __PUT(q - 4, tagbits + 1, LONGINT); + __PUT(q - 4, tagbits + 1, int32); p = 0; tag = tagbits + 4; for (;;) { - __GET(tag, offset, LONGINT); + __GET(tag, offset, int32); if (offset < 0) { - __PUT(q - 4, (tag + offset) + 1, LONGINT); + __PUT(q - 4, (tag + offset) + 1, int32); if (p == 0) { break; } @@ -357,7 +357,7 @@ static void Heap_Mark (LONGINT q) q = p; tag = Heap_FetchAddress(q - 4); tag -= 1; - __GET(tag, offset, LONGINT); + __GET(tag, offset, int32); fld = q + offset; p = Heap_FetchAddress(fld); __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)n, SYSTEM_PTR); @@ -367,8 +367,8 @@ static void Heap_Mark (LONGINT q) if (n != 0) { tagbits = Heap_FetchAddress(n - 4); if (!__ODD(tagbits)) { - __PUT(n - 4, tagbits + 1, LONGINT); - __PUT(q - 4, tag + 1, LONGINT); + __PUT(n - 4, tagbits + 1, int32); + __PUT(q - 4, tag + 1, int32); __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)p, SYSTEM_PTR); p = q; q = n; @@ -384,12 +384,12 @@ static void Heap_Mark (LONGINT q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((LONGINT)(SYSTEM_ADRINT)p); + Heap_Mark((int32)(SYSTEM_ADRINT)p); } static void Heap_Scan (void) { - LONGINT chnk, adr, end, start, tag, i, size, freesize; + int32 chnk, adr, end, start, tag, i, size, freesize; Heap_bigBlocks = 0; i = 1; while (i < 9) { @@ -407,21 +407,21 @@ static void Heap_Scan (void) if (__ODD(tag)) { if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 4, LONGINT); - __PUT(start + 4, freesize, LONGINT); - __PUT(start + 8, -4, LONGINT); + __PUT(start, start + 4, int32); + __PUT(start + 4, freesize, int32); + __PUT(start + 8, -4, int32); i = __ASHR(freesize, 4); freesize = 0; if (i < 9) { - __PUT(start + 12, Heap_freeList[i], LONGINT); + __PUT(start + 12, Heap_freeList[i], int32); Heap_freeList[i] = start; } else { - __PUT(start + 12, Heap_bigBlocks, LONGINT); + __PUT(start + 12, Heap_bigBlocks, int32); Heap_bigBlocks = start; } } tag -= 1; - __PUT(adr, tag, LONGINT); + __PUT(adr, tag, int32); size = Heap_FetchAddress(tag); Heap_allocated += size; adr += size; @@ -433,16 +433,16 @@ static void Heap_Scan (void) } if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 4, LONGINT); - __PUT(start + 4, freesize, LONGINT); - __PUT(start + 8, -4, LONGINT); + __PUT(start, start + 4, int32); + __PUT(start + 4, freesize, int32); + __PUT(start + 8, -4, int32); i = __ASHR(freesize, 4); freesize = 0; if (i < 9) { - __PUT(start + 12, Heap_freeList[i], LONGINT); + __PUT(start + 12, Heap_freeList[i], int32); Heap_freeList[i] = start; } else { - __PUT(start + 12, Heap_bigBlocks, LONGINT); + __PUT(start + 12, Heap_bigBlocks, int32); Heap_bigBlocks = start; } } @@ -450,9 +450,9 @@ static void Heap_Scan (void) } } -static void Heap_Sift (LONGINT l, LONGINT r, LONGINT *a, LONGINT a__len) +static void Heap_Sift (int32 l, int32 r, int32 *a, LONGINT a__len) { - LONGINT i, j, x; + int32 i, j, x; j = l; x = a[j]; for (;;) { @@ -469,9 +469,9 @@ static void Heap_Sift (LONGINT l, LONGINT r, LONGINT *a, LONGINT a__len) a[i] = x; } -static void Heap_HeapSort (LONGINT n, LONGINT *a, LONGINT a__len) +static void Heap_HeapSort (int32 n, int32 *a, LONGINT a__len) { - LONGINT l, r, x; + int32 l, r, x; l = __ASHR(n, 1); r = n - 1; while (l > 0) { @@ -487,9 +487,9 @@ static void Heap_HeapSort (LONGINT n, LONGINT *a, LONGINT a__len) } } -static void Heap_MarkCandidates (LONGINT n, LONGINT *cand, LONGINT cand__len) +static void Heap_MarkCandidates (int32 n, int32 *cand, LONGINT cand__len) { - LONGINT chnk, adr, tag, next, lim, lim1, i, ptr, size; + int32 chnk, adr, tag, next, lim, lim1, i, ptr, size; chnk = Heap_heap; i = 0; lim = cand[n - 1]; @@ -527,7 +527,7 @@ static void Heap_MarkCandidates (LONGINT n, LONGINT *cand, LONGINT cand__len) static void Heap_CheckFin (void) { Heap_FinNode n; - LONGINT tag; + int32 tag; n = Heap_fin; while (n != NIL) { tag = Heap_FetchAddress(n->obj - 4); @@ -576,10 +576,10 @@ void Heap_FINALL (void) } } -static void Heap_MarkStack (LONGINT n, LONGINT *cand, LONGINT cand__len) +static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len) { SYSTEM_PTR frame; - LONGINT inc, nofcand, sp, p, stack0; + int32 inc, nofcand, sp, p, stack0; struct Heap__1 align; if (n > 0) { Heap_MarkStack(n - 1, cand, cand__len); @@ -596,7 +596,7 @@ static void Heap_MarkStack (LONGINT n, LONGINT *cand, LONGINT cand__len) inc = -inc; } while (sp != stack0) { - __GET(sp, p, LONGINT); + __GET(sp, p, int32); if ((p > Heap_heap && p < Heap_heapend)) { if (nofcand == cand__len) { Heap_HeapSort(nofcand, (void*)cand, cand__len); @@ -618,8 +618,8 @@ static void Heap_MarkStack (LONGINT n, LONGINT *cand, LONGINT cand__len) void Heap_GC (BOOLEAN markStack) { Heap_Module m; - LONGINT i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; - LONGINT cand[10000]; + int32 i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; + int32 cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); m = (Heap_Module)(SYSTEM_ADRINT)Heap_modules; @@ -699,7 +699,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (LONGINT)(SYSTEM_ADRINT)obj; + f->obj = (int32)(SYSTEM_ADRINT)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; @@ -710,7 +710,7 @@ void Heap_InitHeap (void) { Heap_heap = Heap_NewChunk(128000); Heap_heapend = Heap_FetchAddress(Heap_heap + 4); - __PUT(Heap_heap, 0, LONGINT); + __PUT(Heap_heap, 0, int32); Heap_allocated = 0; Heap_firstTry = 1; Heap_freeList[9] = 1; diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index a4e30a5e..a89f18fc 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -31,8 +31,8 @@ typedef import SYSTEM_PTR Heap_modules; -import LONGINT Heap_allocated, Heap_heapsize; -import INTEGER Heap_FileCount; +import int32 Heap_allocated, Heap_heapsize; +import int16 Heap_FileCount; import LONGINT *Heap_ModuleDesc__typ; @@ -41,11 +41,11 @@ import void Heap_GC (BOOLEAN markStack); import void Heap_INCREF (Heap_Module m); import void Heap_InitHeap (void); import void Heap_Lock (void); -import SYSTEM_PTR Heap_NEWBLK (LONGINT size); -import SYSTEM_PTR Heap_NEWREC (LONGINT tag); +import SYSTEM_PTR Heap_NEWBLK (int32 size); +import SYSTEM_PTR Heap_NEWREC (int32 tag); import void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); import SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -import void Heap_REGTYP (Heap_Module m, LONGINT typ); +import void Heap_REGTYP (Heap_Module m, int32 typ); import void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); import void Heap_Unlock (void); import void *Heap__init(void); diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index 52abc5b8..7969f68f 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -26,15 +26,15 @@ typedef struct Modules_ModuleDesc { Modules_Module next; Modules_ModuleName name; - LONGINT refcnt; + int32 refcnt; Modules_Cmd cmds; - LONGINT types; - void (*enumPtrs)(void(*)(LONGINT)); - LONGINT reserved1, reserved2; + int32 types; + void (*enumPtrs)(void(*)(int32)); + int32 reserved1, reserved2; } Modules_ModuleDesc; -export INTEGER Modules_res; +export int16 Modules_res; export CHAR Modules_resMsg[256]; export Modules_ModuleName Modules_imported, Modules_importing; @@ -51,7 +51,7 @@ export Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len); static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len) { - INTEGER i, j; + int16 i, j; __DUP(b, b__len, CHAR); i = 0; while (a[__X(i, a__len)] != 0x00) { diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index 6bee52c7..8b271308 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -28,15 +28,15 @@ typedef struct Modules_ModuleDesc { Modules_Module next; Modules_ModuleName name; - LONGINT refcnt; + int32 refcnt; Modules_Cmd cmds; - LONGINT types; - void (*enumPtrs)(void(*)(LONGINT)); + int32 types; + void (*enumPtrs)(void(*)(int32)); char _prvt0[8]; } Modules_ModuleDesc; -import INTEGER Modules_res; +import int16 Modules_res; import CHAR Modules_resMsg[256]; import Modules_ModuleName Modules_imported, Modules_importing; diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index a3322969..bc74dd1d 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -6,13 +6,13 @@ export void (*OPB_typSize)(OPT_Struct); -static INTEGER OPB_exp; -static LONGINT OPB_maxExp; +static int16 OPB_exp; +static int32 OPB_maxExp; export void OPB_Assign (OPT_Node *x, OPT_Node y); -static void OPB_BindNodes (SHORTINT class, OPT_Struct typ, OPT_Node *x, OPT_Node y); -static LONGINT OPB_BoolToInt (BOOLEAN b); +static void OPB_BindNodes (int8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y); +static int32 OPB_BoolToInt (BOOLEAN b); export void OPB_Call (OPT_Node *x, OPT_Node apar, OPT_Object fp); static void OPB_CharToString (OPT_Node n); static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode); @@ -20,10 +20,10 @@ static void OPB_CheckLeaf (OPT_Node x, BOOLEAN dynArrToo); export void OPB_CheckParameters (OPT_Object fp, OPT_Object ap, BOOLEAN checkNames); static void OPB_CheckProc (OPT_Struct x, OPT_Object y); static void OPB_CheckPtr (OPT_Node x, OPT_Node y); -static void OPB_CheckRealType (INTEGER f, INTEGER nr, OPT_Const x); +static void OPB_CheckRealType (int16 f, int16 nr, OPT_Const x); static void OPB_CheckReceiver (OPT_Node *x, OPT_Object fp); -static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y); -export void OPB_Construct (SHORTINT class, OPT_Node *x, OPT_Node y); +static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y); +export void OPB_Construct (int8 class, OPT_Node *x, OPT_Node y); static void OPB_Convert (OPT_Node *x, OPT_Struct typ); export void OPB_DeRef (OPT_Node *x); static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpar); @@ -33,17 +33,17 @@ export void OPB_Field (OPT_Node *x, OPT_Object y); export void OPB_In (OPT_Node *x, OPT_Node y); export void OPB_Index (OPT_Node *x, OPT_Node y); export void OPB_Inittd (OPT_Node *inittd, OPT_Node *last, OPT_Struct typ); -static BOOLEAN OPB_IntToBool (LONGINT i); +static BOOLEAN OPB_IntToBool (int32 i); export void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y); -export void OPB_MOp (SHORTINT op, OPT_Node *x); +export void OPB_MOp (int8 op, OPT_Node *x); export OPT_Node OPB_NewBoolConst (BOOLEAN boolval); -export OPT_Node OPB_NewIntConst (LONGINT intval); +export OPT_Node OPB_NewIntConst (int32 intval); export OPT_Node OPB_NewLeaf (OPT_Object obj); export OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ); -export OPT_Node OPB_NewString (OPS_String str, LONGINT len); +export OPT_Node OPB_NewString (OPS_String str, int32 len); export OPT_Node OPB_Nil (void); static BOOLEAN OPB_NotVar (OPT_Node x); -export void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y); +export void OPB_Op (int8 op, OPT_Node *x, OPT_Node y); export void OPB_OptIf (OPT_Node *x); export void OPB_Param (OPT_Node ap, OPT_Object fp); export void OPB_PrepCall (OPT_Node *x, OPT_Object *fpar); @@ -51,17 +51,17 @@ export void OPB_Return (OPT_Node *x, OPT_Object proc); export void OPB_SetElem (OPT_Node *x); static void OPB_SetIntType (OPT_Node node); export void OPB_SetRange (OPT_Node *x, OPT_Node y); -export void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno); -export void OPB_StPar0 (OPT_Node *par0, INTEGER fctno); -export void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno); -export void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n); -export void OPB_StaticLink (SHORTINT dlev); +export void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno); +export void OPB_StPar0 (OPT_Node *par0, int16 fctno); +export void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno); +export void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n); +export void OPB_StaticLink (int8 dlev); export void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard); -static void OPB_err (INTEGER n); -static LONGINT OPB_log (LONGINT x); +static void OPB_err (int16 n); +static int32 OPB_log (int32 x); -static void OPB_err (INTEGER n) +static void OPB_err (int16 n) { OPM_err(n); } @@ -100,7 +100,7 @@ OPT_Node OPB_NewLeaf (OPT_Object obj) return _o_result; } -void OPB_Construct (SHORTINT class, OPT_Node *x, OPT_Node y) +void OPB_Construct (int8 class, OPT_Node *x, OPT_Node y) { OPT_Node node = NIL; node = OPT_NewNode(class); @@ -123,9 +123,9 @@ void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y) *last = y; } -static LONGINT OPB_BoolToInt (BOOLEAN b) +static int32 OPB_BoolToInt (BOOLEAN b) { - LONGINT _o_result; + int32 _o_result; if (b) { _o_result = 1; return _o_result; @@ -136,7 +136,7 @@ static LONGINT OPB_BoolToInt (BOOLEAN b) __RETCHK; } -static BOOLEAN OPB_IntToBool (LONGINT i) +static BOOLEAN OPB_IntToBool (int32 i) { BOOLEAN _o_result; if (i == 0) { @@ -222,8 +222,8 @@ OPT_Node OPB_EmptySet (void) static void OPB_SetIntType (OPT_Node node) { - INTEGER b; - LONGINT n; + int16 b; + int32 n; if (node->conval->intval >= 0) { n = node->conval->intval; } else { @@ -236,7 +236,7 @@ static void OPB_SetIntType (OPT_Node node) node->typ = OPT_IntType(b); } -OPT_Node OPB_NewIntConst (LONGINT intval) +OPT_Node OPB_NewIntConst (int32 intval) { OPT_Node _o_result; OPT_Node x = NIL; @@ -261,7 +261,7 @@ OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ) return _o_result; } -OPT_Node OPB_NewString (OPS_String str, LONGINT len) +OPT_Node OPB_NewString (OPS_String str, int32 len) { OPT_Node _o_result; OPT_Node x = NIL; @@ -293,7 +293,7 @@ static void OPB_CharToString (OPT_Node n) n->obj = NIL; } -static void OPB_BindNodes (SHORTINT class, OPT_Struct typ, OPT_Node *x, OPT_Node y) +static void OPB_BindNodes (int8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y) { OPT_Node node = NIL; node = OPT_NewNode(class); @@ -335,7 +335,7 @@ void OPB_DeRef (OPT_Node *x) void OPB_Index (OPT_Node *x, OPT_Node y) { - INTEGER f; + int16 f; OPT_Struct typ = NIL; f = y->typ->form; if ((*x)->class >= 7) { @@ -460,8 +460,8 @@ void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) void OPB_In (OPT_Node *x, OPT_Node y) { - INTEGER f; - LONGINT k; + int16 f; + int32 k; f = (*x)->typ->form; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); @@ -487,9 +487,9 @@ void OPB_In (OPT_Node *x, OPT_Node y) (*x)->typ = OPT_booltyp; } -static LONGINT OPB_log (LONGINT x) +static int32 OPB_log (int32 x) { - LONGINT _o_result; + int32 _o_result; OPB_exp = 0; if (x > 0) { while (!__ODD(x)) { @@ -501,7 +501,7 @@ static LONGINT OPB_log (LONGINT x) return _o_result; } -static void OPB_CheckRealType (INTEGER f, INTEGER nr, OPT_Const x) +static void OPB_CheckRealType (int16 f, int16 nr, OPT_Const x) { LONGREAL min, max, r; if (f == 5) { @@ -525,9 +525,9 @@ static struct MOp__28 { struct MOp__28 *lnk; } *MOp__28_s; -static OPT_Node NewOp__29 (SHORTINT op, OPT_Struct typ, OPT_Node z); +static OPT_Node NewOp__29 (int8 op, OPT_Struct typ, OPT_Node z); -static OPT_Node NewOp__29 (SHORTINT op, OPT_Struct typ, OPT_Node z) +static OPT_Node NewOp__29 (int8 op, OPT_Struct typ, OPT_Node z) { OPT_Node _o_result; OPT_Node node = NIL; @@ -539,9 +539,9 @@ static OPT_Node NewOp__29 (SHORTINT op, OPT_Struct typ, OPT_Node z) return _o_result; } -void OPB_MOp (SHORTINT op, OPT_Node *x) +void OPB_MOp (int8 op, OPT_Node *x) { - INTEGER f; + int16 f; OPT_Struct typ = NIL; OPT_Node z = NIL; struct MOp__28 _s; @@ -618,7 +618,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) case 22: if (f == 3) { if (z->class == 7) { - z->conval->intval = (SYSTEM_INT16)__CAP((CHAR)z->conval->intval); + z->conval->intval = (int16)__CAP((CHAR)z->conval->intval); z->obj = NIL; } else { z = NewOp__29(op, typ, z); @@ -678,7 +678,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) static void OPB_CheckPtr (OPT_Node x, OPT_Node y) { - INTEGER g; + int16 g; OPT_Struct p = NIL, q = NIL, t = NIL; g = y->typ->form; if (g == 11) { @@ -762,17 +762,17 @@ static void OPB_CheckProc (OPT_Struct x, OPT_Object y) static struct ConstOp__13 { OPT_Node *x; - INTEGER *f; + int16 *f; OPT_Const *xval, *yval; struct ConstOp__13 *lnk; } *ConstOp__13_s; -static INTEGER ConstCmp__14 (void); +static int16 ConstCmp__14 (void); -static INTEGER ConstCmp__14 (void) +static int16 ConstCmp__14 (void) { - INTEGER _o_result; - INTEGER res; + int16 _o_result; + int16 res; switch (*ConstOp__13_s->f) { case 0: res = 9; @@ -836,11 +836,11 @@ static INTEGER ConstCmp__14 (void) return _o_result; } -static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) +static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) { - INTEGER f, g; + int16 f, g; OPT_Const xval = NIL, yval = NIL; - LONGINT xv, yv; + int32 xv, yv; BOOLEAN temp; struct ConstOp__13 _s; _s.x = &x; @@ -1116,8 +1116,8 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) static void OPB_Convert (OPT_Node *x, OPT_Struct typ) { OPT_Node node = NIL; - INTEGER f, g; - LONGINT k; + int16 f, g; + int32 k; LONGREAL r; f = (*x)->typ->form; g = typ->form; @@ -1149,12 +1149,12 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) OPB_err(203); r = (LONGREAL)1; } - (*x)->conval->intval = (SYSTEM_INT32)__ENTIER(r); + (*x)->conval->intval = (int32)__ENTIER(r); OPB_SetIntType(*x); } } (*x)->obj = NIL; - } else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((SYSTEM_INT16)(*x)->left->typ->form < f || f > g))) { + } else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((int16)(*x)->left->typ->form < f || f > g))) { if ((*x)->left->typ == typ) { *x = (*x)->left; } @@ -1168,14 +1168,14 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) } static struct Op__38 { - INTEGER *f, *g; + int16 *f, *g; struct Op__38 *lnk; } *Op__38_s; -static void NewOp__39 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y); +static void NewOp__39 (int8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y); static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y); -static void NewOp__39 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y) +static void NewOp__39 (int8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y) { OPT_Node node = NIL; node = OPT_NewNode(12); @@ -1218,13 +1218,13 @@ static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) return _o_result; } -void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) +void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) { - INTEGER f, g; + int16 f, g; OPT_Node t = NIL, z = NIL; OPT_Struct typ = NIL; BOOLEAN do_; - LONGINT val; + int32 val; struct Op__38 _s; _s.f = &f; _s.g = &g; @@ -1495,7 +1495,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) void OPB_SetRange (OPT_Node *x, OPT_Node y) { - LONGINT k, l; + int32 k, l; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); } else if (((*x)->typ->form == 4 && y->typ->form == 4)) { @@ -1530,7 +1530,7 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y) void OPB_SetElem (OPT_Node *x) { - LONGINT k; + int32 k; if ((*x)->class == 8 || (*x)->class == 9) { OPB_err(126); } else if ((*x)->typ->form != 4) { @@ -1552,7 +1552,7 @@ void OPB_SetElem (OPT_Node *x) static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) { OPT_Struct y = NIL; - INTEGER f, g; + int16 f, g; OPT_Struct p = NIL, q = NIL; if (OPM_Verbose) { OPM_LogWLn(); @@ -1695,9 +1695,9 @@ static void OPB_CheckLeaf (OPT_Node x, BOOLEAN dynArrToo) { } -void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) +void OPB_StPar0 (OPT_Node *par0, int16 fctno) { - INTEGER f; + int16 f; OPT_Struct typ = NIL; OPT_Node x = NIL; x = *par0; @@ -2005,9 +2005,9 @@ static struct StPar1__52 { struct StPar1__52 *lnk; } *StPar1__52_s; -static OPT_Node NewOp__53 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right); +static OPT_Node NewOp__53 (int8 class, int8 subcl, OPT_Node left, OPT_Node right); -static OPT_Node NewOp__53 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right) +static OPT_Node NewOp__53 (int8 class, int8 subcl, OPT_Node left, OPT_Node right) { OPT_Node _o_result; OPT_Node node = NIL; @@ -2019,9 +2019,9 @@ static OPT_Node NewOp__53 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_No return _o_result; } -void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) +void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) { - INTEGER f, L; + int16 f, L; OPT_Struct typ = NIL; OPT_Node p = NIL, t = NIL; struct StPar1__52 _s; @@ -2063,7 +2063,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (!(f == 4) || x->class != 7) { OPB_err(69); } else if (x->typ->size == 1) { - L = (SYSTEM_INT16)x->conval->intval; + L = (int16)x->conval->intval; typ = p->typ; while ((L > 0 && __IN(typ->comp, 0x0c))) { typ = typ->BaseTyp; @@ -2259,10 +2259,10 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) StPar1__52_s = _s.lnk; } -void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n) +void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n) { OPT_Node node = NIL; - INTEGER f; + int16 f; OPT_Node p = NIL; p = *par0; f = x->typ->form; @@ -2304,9 +2304,9 @@ void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n) *par0 = p; } -void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno) +void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno) { - INTEGER dim; + int16 dim; OPT_Node x = NIL, p = NIL; p = *par0; if (fctno <= 19) { @@ -2370,7 +2370,7 @@ void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno) static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpar) { - INTEGER f; + int16 f; f = atyp->comp; ftyp = ftyp->BaseTyp; atyp = atyp->BaseTyp; @@ -2479,7 +2479,7 @@ void OPB_Param (OPT_Node ap, OPT_Object fp) } } -void OPB_StaticLink (SHORTINT dlev) +void OPB_StaticLink (int8 dlev) { OPT_Object scope = NIL; scope = OPT_topScope; @@ -2494,7 +2494,7 @@ void OPB_Call (OPT_Node *x, OPT_Node apar, OPT_Object fp) { OPT_Struct typ = NIL; OPT_Node p = NIL; - SHORTINT lev; + int8 lev; if ((*x)->class == 9) { typ = (*x)->typ; lev = (*x)->obj->mnolev; @@ -2554,7 +2554,7 @@ void OPB_Return (OPT_Node *x, OPT_Object proc) void OPB_Assign (OPT_Node *x, OPT_Node y) { OPT_Node z = NIL; - SHORTINT subcl; + int8 subcl; if ((*x)->class >= 7) { OPB_err(56); } diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index 97c4485c..a4ccc86e 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -14,7 +14,7 @@ import void (*OPB_typSize)(OPT_Struct); import void OPB_Assign (OPT_Node *x, OPT_Node y); import void OPB_Call (OPT_Node *x, OPT_Node apar, OPT_Object fp); import void OPB_CheckParameters (OPT_Object fp, OPT_Object ap, BOOLEAN checkNames); -import void OPB_Construct (SHORTINT class, OPT_Node *x, OPT_Node y); +import void OPB_Construct (int8 class, OPT_Node *x, OPT_Node y); import void OPB_DeRef (OPT_Node *x); import OPT_Node OPB_EmptySet (void); import void OPB_Enter (OPT_Node *procdec, OPT_Node stat, OPT_Object proc); @@ -23,25 +23,25 @@ import void OPB_In (OPT_Node *x, OPT_Node y); import void OPB_Index (OPT_Node *x, OPT_Node y); import void OPB_Inittd (OPT_Node *inittd, OPT_Node *last, OPT_Struct typ); import void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y); -import void OPB_MOp (SHORTINT op, OPT_Node *x); +import void OPB_MOp (int8 op, OPT_Node *x); import OPT_Node OPB_NewBoolConst (BOOLEAN boolval); -import OPT_Node OPB_NewIntConst (LONGINT intval); +import OPT_Node OPB_NewIntConst (int32 intval); import OPT_Node OPB_NewLeaf (OPT_Object obj); import OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ); -import OPT_Node OPB_NewString (OPS_String str, LONGINT len); +import OPT_Node OPB_NewString (OPS_String str, int32 len); import OPT_Node OPB_Nil (void); -import void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y); +import void OPB_Op (int8 op, OPT_Node *x, OPT_Node y); import void OPB_OptIf (OPT_Node *x); import void OPB_Param (OPT_Node ap, OPT_Object fp); import void OPB_PrepCall (OPT_Node *x, OPT_Object *fpar); import void OPB_Return (OPT_Node *x, OPT_Object proc); import void OPB_SetElem (OPT_Node *x); import void OPB_SetRange (OPT_Node *x, OPT_Node y); -import void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno); -import void OPB_StPar0 (OPT_Node *par0, INTEGER fctno); -import void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno); -import void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n); -import void OPB_StaticLink (SHORTINT dlev); +import void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno); +import void OPB_StPar0 (OPT_Node *par0, int16 fctno); +import void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno); +import void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n); +import void OPB_StaticLink (int8 dlev); import void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard); import void *OPB__init(void); diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 9f818a4a..08469d42 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -5,27 +5,27 @@ #include "OPT.h" -static INTEGER OPC_indentLevel; +static int16 OPC_indentLevel; static BOOLEAN OPC_ptrinit, OPC_mainprog, OPC_ansi; -static SHORTINT OPC_hashtab[105]; -static CHAR OPC_keytab[36][9]; +static int8 OPC_hashtab[105]; +static CHAR OPC_keytab[50][9]; static BOOLEAN OPC_GlbPtrs; static CHAR OPC_BodyNameExt[13]; -export void OPC_Align (LONGINT *adr, LONGINT base); +export void OPC_Align (int32 *adr, int32 base); export void OPC_Andent (OPT_Struct typ); static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames); -export LONGINT OPC_BaseAlignment (OPT_Struct typ); +export int32 OPC_BaseAlignment (OPT_Struct typ); export OPT_Object OPC_BaseTProc (OPT_Object obj); export void OPC_BegBlk (void); export void OPC_BegStat (void); -static void OPC_CProcDefs (OPT_Object obj, INTEGER vis); -export void OPC_Case (LONGINT caseVal, INTEGER form); -static void OPC_CharacterLiteral (LONGINT c); -export void OPC_Cmp (INTEGER rel); +static void OPC_CProcDefs (OPT_Object obj, int16 vis); +export void OPC_Case (int32 caseVal, int16 form); +static void OPC_CharacterLiteral (int32 c); +export void OPC_Cmp (int16 rel); export void OPC_CompleteIdent (OPT_Object obj); -export void OPC_Constant (OPT_Const con, INTEGER form); +export void OPC_Constant (OPT_Const con, int16 form); static void OPC_DeclareBase (OPT_Object dcl); static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef); static void OPC_DeclareParams (OPT_Object par, BOOLEAN macro); @@ -42,45 +42,45 @@ export void OPC_EnterBody (void); export void OPC_EnterProc (OPT_Object proc); export void OPC_ExitBody (void); export void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet); -static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, LONGINT *off, LONGINT *n, LONGINT *curAlign); -static void OPC_FillGap (LONGINT gap, LONGINT off, LONGINT align, LONGINT *n, LONGINT *curAlign); +static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, int32 *off, int32 *n, int32 *curAlign); +static void OPC_FillGap (int32 gap, int32 off, int32 align, int32 *n, int32 *curAlign); export void OPC_GenBdy (OPT_Node n); -static void OPC_GenDynTypes (OPT_Node n, INTEGER vis); +static void OPC_GenDynTypes (OPT_Node n, int16 vis); export void OPC_GenEnumPtrs (OPT_Object var); export void OPC_GenHdr (OPT_Node n); export void OPC_GenHdrIncludes (void); static void OPC_GenHeaderMsg (void); -export void OPC_Halt (LONGINT n); +export void OPC_Halt (int32 n); export void OPC_Ident (OPT_Object obj); -static void OPC_IdentList (OPT_Object obj, INTEGER vis); +static void OPC_IdentList (OPT_Object obj, int16 vis); static void OPC_Include (CHAR *name, LONGINT name__len); -static void OPC_IncludeImports (OPT_Object obj, INTEGER vis); +static void OPC_IncludeImports (OPT_Object obj, int16 vis); export void OPC_Increment (BOOLEAN decrement); -export void OPC_Indent (INTEGER count); +export void OPC_Indent (int16 count); export void OPC_Init (void); static void OPC_InitImports (OPT_Object obj); static void OPC_InitKeywords (void); export void OPC_InitTDesc (OPT_Struct typ); static void OPC_InitTProcs (OPT_Object typ, OPT_Object obj); -export void OPC_IntLiteral (LONGINT n, LONGINT size); -export void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim); +export void OPC_IntLiteral (int32 n, int32 size); +export void OPC_Len (OPT_Object obj, OPT_Struct array, int32 dim); static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName); -static INTEGER OPC_Length (CHAR *s, LONGINT s__len); -export LONGINT OPC_NofPtrs (OPT_Struct typ); -static INTEGER OPC_PerfectHash (CHAR *s, LONGINT s__len); +static int16 OPC_Length (CHAR *s, LONGINT s__len); +export int32 OPC_NofPtrs (OPT_Struct typ); +static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len); static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len); static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define); -static void OPC_ProcPredefs (OPT_Object obj, SHORTINT vis); +static void OPC_ProcPredefs (OPT_Object obj, int8 vis); static void OPC_PutBase (OPT_Struct typ); -static void OPC_PutPtrOffsets (OPT_Struct typ, LONGINT adr, LONGINT *cnt); +static void OPC_PutPtrOffsets (OPT_Struct typ, int32 adr, int32 *cnt); static void OPC_RegCmds (OPT_Object obj); export void OPC_SetInclude (BOOLEAN exclude); -export LONGINT OPC_SizeAlignment (LONGINT size); +export int32 OPC_SizeAlignment (int32 size); static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause); -static void OPC_Str1 (CHAR *s, LONGINT s__len, LONGINT x); -static void OPC_StringLiteral (CHAR *s, LONGINT s__len, LONGINT l); +static void OPC_Str1 (CHAR *s, LONGINT s__len, int32 x); +static void OPC_StringLiteral (CHAR *s, LONGINT s__len, int32 l); export void OPC_TDescDecl (OPT_Struct typ); -export void OPC_TypeDefs (OPT_Object obj, INTEGER vis); +export void OPC_TypeDefs (OPT_Object obj, int16 vis); export void OPC_TypeOf (OPT_Object ap); static BOOLEAN OPC_Undefined (OPT_Object obj); @@ -98,14 +98,14 @@ void OPC_Init (void) } } -void OPC_Indent (INTEGER count) +void OPC_Indent (int16 count) { OPC_indentLevel += count; } void OPC_BegStat (void) { - INTEGER i; + int16 i; i = OPC_indentLevel; while (i > 0) { OPM_Write(0x09); @@ -141,10 +141,10 @@ void OPC_EndBlk0 (void) OPM_Write('}'); } -static void OPC_Str1 (CHAR *s, LONGINT s__len, LONGINT x) +static void OPC_Str1 (CHAR *s, LONGINT s__len, int32 x) { CHAR ch; - INTEGER i; + int16 i; __DUP(s, s__len, CHAR); ch = s[0]; i = 0; @@ -160,10 +160,10 @@ static void OPC_Str1 (CHAR *s, LONGINT s__len, LONGINT x) __DEL(s); } -static INTEGER OPC_Length (CHAR *s, LONGINT s__len) +static int16 OPC_Length (CHAR *s, LONGINT s__len) { - INTEGER _o_result; - INTEGER i; + int16 _o_result; + int16 i; i = 0; while (s[__X(i, s__len)] != 0x00) { i += 1; @@ -172,14 +172,14 @@ static INTEGER OPC_Length (CHAR *s, LONGINT s__len) return _o_result; } -static INTEGER OPC_PerfectHash (CHAR *s, LONGINT s__len) +static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len) { - INTEGER _o_result; - INTEGER i, h; + int16 _o_result; + int16 i, h; i = 0; h = 0; while ((s[__X(i, s__len)] != 0x00 && i < 5)) { - h = 3 * h + (SYSTEM_INT16)s[__X(i, s__len)]; + h = 3 * h + (int16)s[__X(i, s__len)]; i += 1; } _o_result = (int)__MOD(h, 105); @@ -188,17 +188,20 @@ static INTEGER OPC_PerfectHash (CHAR *s, LONGINT s__len) void OPC_Ident (OPT_Object obj) { - INTEGER mode, level, h; + int16 mode, level, h; mode = obj->mode; level = obj->mnolev; if ((__IN(mode, 0x62) && level > 0) || __IN(mode, 0x14)) { OPM_WriteStringVar((void*)obj->name, 256); h = OPC_PerfectHash((void*)obj->name, 256); if (OPC_hashtab[__X(h, 105)] >= 0) { - if (__STRCMP(OPC_keytab[__X(OPC_hashtab[__X(h, 105)], 36)], obj->name) == 0) { + if (__STRCMP(OPC_keytab[__X(OPC_hashtab[__X(h, 105)], 50)], obj->name) == 0) { OPM_Write('_'); } } + } else if ((mode == 5 && obj->typ->form == 4)) { + OPM_WriteString((CHAR*)"int", 4); + OPM_WriteInt(__ASHL(obj->typ->size, 3)); } else { if (mode != 5 || obj->linkadr != 2) { if (mode == 13) { @@ -212,7 +215,7 @@ void OPC_Ident (OPT_Object obj) OPM_WriteStringVar((void*)OPM_modName, 32); } OPM_Write('_'); - } else if ((((((obj == OPT_sysptrtyp->strobj || obj == OPT_ainttyp->strobj) || obj == OPT_int8typ->strobj) || obj == OPT_int16typ->strobj) || obj == OPT_int32typ->strobj) || obj == OPT_int64typ->strobj) || obj == OPT_bytetyp->strobj) { + } else if ((obj == OPT_sysptrtyp->strobj || obj == OPT_ainttyp->strobj) || obj == OPT_bytetyp->strobj) { OPM_WriteString((CHAR*)"SYSTEM_", 8); } OPM_WriteStringVar((void*)obj->name, 256); @@ -221,7 +224,7 @@ void OPC_Ident (OPT_Object obj) static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause) { - INTEGER pointers; + int16 pointers; *openClause = 0; if (((typ->strobj == NIL || typ->strobj->name[0] == 0x00) && typ->comp != 4)) { if (__IN(typ->comp, 0x0c)) { @@ -257,7 +260,7 @@ static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef) { OPT_Struct typ = NIL; BOOLEAN varPar, openClause; - INTEGER form, comp; + int16 form, comp; typ = dcl->typ; varPar = ((dcl->mode == 2 && typ->comp != 2) || typ->comp == 3) || scopeDef; OPC_Stars(typ, &openClause); @@ -327,8 +330,8 @@ static void OPC_DeclareBase (OPT_Object dcl) { OPT_Struct typ = NIL, prev = NIL; OPT_Object obj = NIL; - INTEGER nofdims; - LONGINT off, n, dummy; + int16 nofdims; + int32 off, n, dummy; typ = dcl->typ; prev = typ; while ((((((((typ->strobj == NIL || typ->comp == 3) || OPC_Undefined(typ->strobj)) && typ->comp != 4)) && typ->form != 10)) && !((typ->form == 11 && typ->BaseTyp->comp == 3)))) { @@ -387,12 +390,12 @@ static void OPC_DeclareBase (OPT_Object dcl) } } -LONGINT OPC_NofPtrs (OPT_Struct typ) +int32 OPC_NofPtrs (OPT_Struct typ) { - LONGINT _o_result; + int32 _o_result; OPT_Object fld = NIL; OPT_Struct btyp = NIL; - LONGINT n; + int32 n; if ((typ->form == 11 && typ->sysflag == 0)) { _o_result = 1; return _o_result; @@ -430,11 +433,11 @@ LONGINT OPC_NofPtrs (OPT_Struct typ) __RETCHK; } -static void OPC_PutPtrOffsets (OPT_Struct typ, LONGINT adr, LONGINT *cnt) +static void OPC_PutPtrOffsets (OPT_Struct typ, int32 adr, int32 *cnt) { OPT_Object fld = NIL; OPT_Struct btyp = NIL; - LONGINT n, i; + int32 n, i; if ((typ->form == 11 && typ->sysflag == 0)) { OPM_WriteInt(adr); OPM_WriteString((CHAR*)", ", 3); @@ -510,7 +513,7 @@ static void OPC_PutBase (OPT_Struct typ) static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName) { OPT_Struct typ = NIL; - INTEGER dim; + int16 dim; if (showParamName) { OPC_Ident(par); OPM_WriteString((CHAR*)"__len", 6); @@ -610,7 +613,7 @@ OPT_Object OPC_BaseTProc (OPT_Object obj) { OPT_Object _o_result; OPT_Struct typ = NIL, base = NIL; - LONGINT mno; + int32 mno; typ = obj->link->typ; if (typ->form == 11) { typ = typ->BaseTyp; @@ -739,7 +742,7 @@ static void OPC_DefineType (OPT_Struct str) static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len) { BOOLEAN _o_result; - INTEGER i; + int16 i; BOOLEAN r; __DUP(y, y__len, CHAR); i = 0; @@ -752,14 +755,14 @@ static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len) return _o_result; } -static void OPC_CProcDefs (OPT_Object obj, INTEGER vis) +static void OPC_CProcDefs (OPT_Object obj, int16 vis) { - INTEGER i; + int16 i; OPT_ConstExt ext = NIL; - INTEGER _for__9; + int16 _for__9; if (obj != NIL) { OPC_CProcDefs(obj->left, vis); - if ((((obj->mode == 9 && (SYSTEM_INT16)obj->vis >= vis)) && obj->adr == 1)) { + if ((((obj->mode == 9 && (int16)obj->vis >= vis)) && obj->adr == 1)) { ext = obj->conval->ext; i = 1; if (((*ext)[1] != '#' && !(OPC_Prefixed(ext, (CHAR*)"extern ", 8) || OPC_Prefixed(ext, (CHAR*)"import ", 8)))) { @@ -768,7 +771,7 @@ static void OPC_CProcDefs (OPT_Object obj, INTEGER vis) OPC_DeclareParams(obj->link, 1); OPM_Write(0x09); } - _for__9 = (SYSTEM_INT16)(*obj->conval->ext)[0]; + _for__9 = (int16)(*obj->conval->ext)[0]; i = i; while (i <= _for__9) { OPM_Write((*obj->conval->ext)[__X(i, 256)]); @@ -780,7 +783,7 @@ static void OPC_CProcDefs (OPT_Object obj, INTEGER vis) } } -void OPC_TypeDefs (OPT_Object obj, INTEGER vis) +void OPC_TypeDefs (OPT_Object obj, int16 vis) { if (obj != NIL) { OPC_TypeDefs(obj->left, vis); @@ -812,7 +815,7 @@ static void OPC_DefAnonRecs (OPT_Node n) void OPC_TDescDecl (OPT_Struct typ) { - LONGINT nofptrs; + int32 nofptrs; OPT_Object o = NIL; OPC_BegStat(); OPM_WriteString((CHAR*)"__TDESC(", 9); @@ -849,7 +852,7 @@ void OPC_InitTDesc (OPT_Struct typ) } } -void OPC_Align (LONGINT *adr, LONGINT base) +void OPC_Align (int32 *adr, int32 base) { switch (base) { case 2: @@ -869,10 +872,10 @@ void OPC_Align (LONGINT *adr, LONGINT base) } } -LONGINT OPC_SizeAlignment (LONGINT size) +int32 OPC_SizeAlignment (int32 size) { - LONGINT _o_result; - LONGINT alignment; + int32 _o_result; + int32 alignment; if (size < OPM_Alignment) { alignment = 1; while (alignment < size) { @@ -885,10 +888,10 @@ LONGINT OPC_SizeAlignment (LONGINT size) return _o_result; } -LONGINT OPC_BaseAlignment (OPT_Struct typ) +int32 OPC_BaseAlignment (OPT_Struct typ) { - LONGINT _o_result; - LONGINT alignment; + int32 _o_result; + int32 alignment; if (typ->form == 13) { if (typ->comp == 4) { alignment = __MASK(typ->align, -65536); @@ -902,9 +905,9 @@ LONGINT OPC_BaseAlignment (OPT_Struct typ) return _o_result; } -static void OPC_FillGap (LONGINT gap, LONGINT off, LONGINT align, LONGINT *n, LONGINT *curAlign) +static void OPC_FillGap (int32 gap, int32 off, int32 align, int32 *n, int32 *curAlign) { - LONGINT adr; + int32 adr; adr = off; OPC_Align(&adr, align); if ((*curAlign < align && gap - (adr - off) >= align)) { @@ -931,11 +934,11 @@ static void OPC_FillGap (LONGINT gap, LONGINT off, LONGINT align, LONGINT *n, LO } } -static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, LONGINT *off, LONGINT *n, LONGINT *curAlign) +static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, int32 *off, int32 *n, int32 *curAlign) { OPT_Object fld = NIL; OPT_Struct base = NIL; - LONGINT gap, adr, align, fldAlign; + int32 gap, adr, align, fldAlign; fld = typ->link; align = __MASK(typ->align, -65536); if (typ->BaseTyp != NIL) { @@ -991,16 +994,16 @@ static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, LONGINT *off, LONGINT * } } -static void OPC_IdentList (OPT_Object obj, INTEGER vis) +static void OPC_IdentList (OPT_Object obj, int16 vis) { OPT_Struct base = NIL; BOOLEAN first; - INTEGER lastvis; + int16 lastvis; base = NIL; first = 1; while ((obj != NIL && obj->mode != 13)) { if ((__IN(vis, 0x05) || (vis == 1 && obj->vis != 0)) || (vis == 3 && !obj->leaf)) { - if (obj->typ != base || (SYSTEM_INT16)obj->vis != lastvis) { + if (obj->typ != base || (int16)obj->vis != lastvis) { if (!first) { OPC_EndStat(); } @@ -1120,7 +1123,7 @@ static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define) } } -static void OPC_ProcPredefs (OPT_Object obj, SHORTINT vis) +static void OPC_ProcPredefs (OPT_Object obj, int8 vis) { if (obj != NIL) { OPC_ProcPredefs(obj->left, vis); @@ -1150,18 +1153,18 @@ static void OPC_Include (CHAR *name, LONGINT name__len) __DEL(name); } -static void OPC_IncludeImports (OPT_Object obj, INTEGER vis) +static void OPC_IncludeImports (OPT_Object obj, int16 vis) { if (obj != NIL) { OPC_IncludeImports(obj->left, vis); - if ((((obj->mode == 11 && obj->mnolev != 0)) && (SYSTEM_INT16)OPT_GlbMod[__X(-obj->mnolev, 64)]->vis >= vis)) { + if ((((obj->mode == 11 && obj->mnolev != 0)) && (int16)OPT_GlbMod[__X(-obj->mnolev, 64)]->vis >= vis)) { OPC_Include(OPT_GlbMod[__X(-obj->mnolev, 64)]->name, 256); } OPC_IncludeImports(obj->right, vis); } } -static void OPC_GenDynTypes (OPT_Node n, INTEGER vis) +static void OPC_GenDynTypes (OPT_Node n, int16 vis) { OPT_Struct typ = NIL; while ((n != NIL && n->class == 14)) { @@ -1209,7 +1212,7 @@ void OPC_GenHdr (OPT_Node n) static void OPC_GenHeaderMsg (void) { - INTEGER i; + int16 i; OPM_WriteString((CHAR*)"/* ", 4); OPM_WriteString((CHAR*)"voc", 4); OPM_Write(' '); @@ -1360,7 +1363,7 @@ static void OPC_InitImports (OPT_Object obj) void OPC_GenEnumPtrs (OPT_Object var) { OPT_Struct typ = NIL; - LONGINT n; + int32 n; OPC_GlbPtrs = 0; while (var != NIL) { typ = var->typ; @@ -1521,7 +1524,7 @@ void OPC_EnterProc (OPT_Object proc) { OPT_Object var = NIL, scope = NIL; OPT_Struct typ = NIL; - INTEGER dim; + int16 dim; if (proc->vis != 1) { OPM_WriteString((CHAR*)"static ", 8); } @@ -1750,7 +1753,7 @@ void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet) void OPC_CompleteIdent (OPT_Object obj) { - INTEGER comp, level; + int16 comp, level; level = obj->mnolev; if (obj->adr == 1) { if (obj->typ->comp == 4) { @@ -1779,10 +1782,10 @@ void OPC_CompleteIdent (OPT_Object obj) void OPC_TypeOf (OPT_Object ap) { - INTEGER i; + int16 i; __ASSERT(ap->typ->comp == 4, 0); if (ap->mode == 2) { - if ((SYSTEM_INT16)ap->mnolev != OPM_level) { + if ((int16)ap->mnolev != OPM_level) { OPM_WriteStringVar((void*)ap->scope->name, 256); OPM_WriteString((CHAR*)"_s->", 5); OPC_Ident(ap); @@ -1798,7 +1801,7 @@ void OPC_TypeOf (OPT_Object ap) } } -void OPC_Cmp (INTEGER rel) +void OPC_Cmp (int16 rel) { switch (rel) { case 9: @@ -1827,7 +1830,7 @@ void OPC_Cmp (INTEGER rel) } } -static void OPC_CharacterLiteral (LONGINT c) +static void OPC_CharacterLiteral (int32 c) { if (c < 32 || c > 126) { OPM_WriteString((CHAR*)"0x", 3); @@ -1842,15 +1845,15 @@ static void OPC_CharacterLiteral (LONGINT c) } } -static void OPC_StringLiteral (CHAR *s, LONGINT s__len, LONGINT l) +static void OPC_StringLiteral (CHAR *s, LONGINT s__len, int32 l) { - LONGINT i; - INTEGER c; + int32 i; + int16 c; __DUP(s, s__len, CHAR); OPM_Write('"'); i = 0; while (i < l) { - c = (SYSTEM_INT16)s[__X(i, s__len)]; + c = (int16)s[__X(i, s__len)]; if (c < 32 || c > 126) { OPM_Write('\\'); OPM_Write((CHAR)(48 + __ASHR(c, 6))); @@ -1870,7 +1873,7 @@ static void OPC_StringLiteral (CHAR *s, LONGINT s__len, LONGINT l) __DEL(s); } -void OPC_Case (LONGINT caseVal, INTEGER form) +void OPC_Case (int32 caseVal, int16 form) { CHAR ch; OPM_WriteString((CHAR*)"case ", 6); @@ -1908,30 +1911,17 @@ void OPC_Increment (BOOLEAN decrement) } } -void OPC_Halt (LONGINT n) +void OPC_Halt (int32 n) { OPC_Str1((CHAR*)"__HALT(#)", 10, n); } -void OPC_IntLiteral (LONGINT n, LONGINT size) +void OPC_IntLiteral (int32 n, int32 size) { if ((((size > 4 && n <= 2147483647)) && n > (-2147483647-1))) { - switch (size) { - case 2: - OPM_WriteString((CHAR*)"((SYSTEM_INT16)(", 17); - break; - case 4: - OPM_WriteString((CHAR*)"((SYSTEM_INT32)(", 17); - break; - case 8: - OPM_WriteString((CHAR*)"((SYSTEM_INT64)(", 17); - break; - default: - OPM_LogWStr((CHAR*)"Unhandled case in OPC.IntLiteral, size = ", 42); - OPM_LogWNum(size, 1); - OPM_LogWLn(); - break; - } + OPM_WriteString((CHAR*)"((int", 6); + OPM_WriteInt(__ASHL(size, 3)); + OPM_WriteString((CHAR*)")(", 3); OPM_WriteInt(n); OPM_WriteString((CHAR*)"))", 3); } else { @@ -1939,7 +1929,7 @@ void OPC_IntLiteral (LONGINT n, LONGINT size) } } -void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim) +void OPC_Len (OPT_Object obj, OPT_Struct array, int32 dim) { if (array->comp == 3) { OPC_CompleteIdent(obj); @@ -1960,11 +1950,11 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim) } } -void OPC_Constant (OPT_Const con, INTEGER form) +void OPC_Constant (OPT_Const con, int16 form) { - INTEGER i; + int16 i; SET s; - LONGINT hex; + int32 hex; BOOLEAN skipLeading; switch (form) { case 1: @@ -2023,7 +2013,7 @@ void OPC_Constant (OPT_Const con, INTEGER form) } static struct InitKeywords__48 { - SHORTINT *n; + int8 *n; struct InitKeywords__48 *lnk; } *InitKeywords__48_s; @@ -2031,18 +2021,18 @@ static void Enter__49 (CHAR *s, LONGINT s__len); static void Enter__49 (CHAR *s, LONGINT s__len) { - INTEGER h; + int16 h; __DUP(s, s__len, CHAR); h = OPC_PerfectHash((void*)s, s__len); OPC_hashtab[__X(h, 105)] = *InitKeywords__48_s->n; - __COPY(s, OPC_keytab[__X(*InitKeywords__48_s->n, 36)], 9); + __COPY(s, OPC_keytab[__X(*InitKeywords__48_s->n, 50)], 9); *InitKeywords__48_s->n += 1; __DEL(s); } static void OPC_InitKeywords (void) { - SHORTINT n, i; + int8 n, i; struct InitKeywords__48 _s; _s.n = &n; _s.lnk = InitKeywords__48_s; @@ -2053,6 +2043,7 @@ static void OPC_InitKeywords (void) OPC_hashtab[__X(i, 105)] = -1; i += 1; } + Enter__49((CHAR*)"adrint", 7); Enter__49((CHAR*)"asm", 4); Enter__49((CHAR*)"auto", 5); Enter__49((CHAR*)"break", 6); @@ -2074,16 +2065,25 @@ static void OPC_InitKeywords (void) Enter__49((CHAR*)"if", 3); Enter__49((CHAR*)"import", 7); Enter__49((CHAR*)"int", 4); + Enter__49((CHAR*)"int16", 6); + Enter__49((CHAR*)"int32", 6); + Enter__49((CHAR*)"int64", 6); + Enter__49((CHAR*)"int8", 5); Enter__49((CHAR*)"long", 5); Enter__49((CHAR*)"register", 9); Enter__49((CHAR*)"return", 7); Enter__49((CHAR*)"short", 6); Enter__49((CHAR*)"signed", 7); Enter__49((CHAR*)"sizeof", 7); + Enter__49((CHAR*)"size_t", 7); Enter__49((CHAR*)"static", 7); Enter__49((CHAR*)"struct", 7); Enter__49((CHAR*)"switch", 7); Enter__49((CHAR*)"typedef", 8); + Enter__49((CHAR*)"uint16", 7); + Enter__49((CHAR*)"uint32", 7); + Enter__49((CHAR*)"uint64", 7); + Enter__49((CHAR*)"uint8", 6); Enter__49((CHAR*)"union", 6); Enter__49((CHAR*)"unsigned", 9); Enter__49((CHAR*)"void", 5); diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index 38f95afe..05c34fcc 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -9,16 +9,16 @@ -import void OPC_Align (LONGINT *adr, LONGINT base); +import void OPC_Align (int32 *adr, int32 base); import void OPC_Andent (OPT_Struct typ); -import LONGINT OPC_BaseAlignment (OPT_Struct typ); +import int32 OPC_BaseAlignment (OPT_Struct typ); import OPT_Object OPC_BaseTProc (OPT_Object obj); import void OPC_BegBlk (void); import void OPC_BegStat (void); -import void OPC_Case (LONGINT caseVal, INTEGER form); -import void OPC_Cmp (INTEGER rel); +import void OPC_Case (int32 caseVal, int16 form); +import void OPC_Cmp (int16 rel); import void OPC_CompleteIdent (OPT_Object obj); -import void OPC_Constant (OPT_Const con, INTEGER form); +import void OPC_Constant (OPT_Const con, int16 form); import void OPC_DefineInter (OPT_Object proc); import void OPC_EndBlk (void); import void OPC_EndBlk0 (void); @@ -31,19 +31,19 @@ import void OPC_GenBdy (OPT_Node n); import void OPC_GenEnumPtrs (OPT_Object var); import void OPC_GenHdr (OPT_Node n); import void OPC_GenHdrIncludes (void); -import void OPC_Halt (LONGINT n); +import void OPC_Halt (int32 n); import void OPC_Ident (OPT_Object obj); import void OPC_Increment (BOOLEAN decrement); -import void OPC_Indent (INTEGER count); +import void OPC_Indent (int16 count); import void OPC_Init (void); import void OPC_InitTDesc (OPT_Struct typ); -import void OPC_IntLiteral (LONGINT n, LONGINT size); -import void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim); -import LONGINT OPC_NofPtrs (OPT_Struct typ); +import void OPC_IntLiteral (int32 n, int32 size); +import void OPC_Len (OPT_Object obj, OPT_Struct array, int32 dim); +import int32 OPC_NofPtrs (OPT_Struct typ); import void OPC_SetInclude (BOOLEAN exclude); -import LONGINT OPC_SizeAlignment (LONGINT size); +import int32 OPC_SizeAlignment (int32 size); import void OPC_TDescDecl (OPT_Struct typ); -import void OPC_TypeDefs (OPT_Object obj, INTEGER vis); +import void OPC_TypeDefs (OPT_Object obj, int16 vis); import void OPC_TypeOf (OPT_Object ap); import void *OPC__init(void); diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index f2da0fed..8bf863b3 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -14,23 +14,23 @@ typedef static CHAR OPM_SourceFileName[256]; -export INTEGER OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet; -export LONGINT OPM_MaxIndex; +export int16 OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet; +export int32 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; -export LONGINT OPM_curpos, OPM_errpos, OPM_breakpc; -export INTEGER OPM_currFile, OPM_level, OPM_pc, OPM_entno; +export int32 OPM_curpos, OPM_errpos, OPM_breakpc; +export int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; export CHAR OPM_modName[32]; export CHAR OPM_objname[64]; export SET OPM_opt, OPM_glbopt; -static LONGINT OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; +static int32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; static Texts_Reader OPM_inR; static Texts_Text OPM_Log; static Texts_Writer OPM_W; static Files_Rider OPM_oldSF, OPM_newSF; static Files_Rider OPM_R[3]; static Files_File OPM_oldSFile, OPM_newSFile, OPM_HFile, OPM_BFile, OPM_HIFile; -static INTEGER OPM_S; +static int16 OPM_S; export BOOLEAN OPM_dontAsm, OPM_dontLink, OPM_mainProg, OPM_mainLinkStat, OPM_notColorOutput, OPM_forceNewSym, OPM_Verbose; static CHAR OPM_OBERON[1024]; static CHAR OPM_MODULES[1024]; @@ -40,54 +40,54 @@ static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F); export void OPM_CloseFiles (void); export void OPM_CloseOldSym (void); export void OPM_DeleteNewSym (void); -export void OPM_FPrint (LONGINT *fp, LONGINT val); -export void OPM_FPrintLReal (LONGINT *fp, LONGREAL lr); -export void OPM_FPrintReal (LONGINT *fp, REAL real); -export void OPM_FPrintSet (LONGINT *fp, SET set); -static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, LONGINT pos); +export void OPM_FPrint (int32 *fp, int32 val); +export void OPM_FPrintLReal (int32 *fp, LONGREAL lr); +export void OPM_FPrintReal (int32 *fp, REAL real); +export void OPM_FPrintSet (int32 *fp, SET set); +static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, int32 pos); export void OPM_Get (CHAR *ch); static void OPM_GetProperties (void); -static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONGINT name__len, INTEGER *size, INTEGER *align); +static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONGINT name__len, int16 *size, int16 *align); export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); export void OPM_InitOptions (void); -static void OPM_LogErrMsg (INTEGER n); +static void OPM_LogErrMsg (int16 n); export void OPM_LogW (CHAR ch); export void OPM_LogWLn (void); -export void OPM_LogWNum (LONGINT i, LONGINT len); +export void OPM_LogWNum (int32 i, int32 len); export void OPM_LogWStr (CHAR *s, LONGINT s__len); static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len); -export void OPM_Mark (INTEGER n, LONGINT pos); +export void OPM_Mark (int16 n, int32 pos); export void OPM_NewSym (CHAR *modName, LONGINT modName__len); export void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); export void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); export BOOLEAN OPM_OpenPar (void); export void OPM_RegisterNewSym (void); static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt); -static void OPM_ShowLine (LONGINT pos); -export LONGINT OPM_SignedMaximum (LONGINT bytecount); -export LONGINT OPM_SignedMinimum (LONGINT bytecount); +static void OPM_ShowLine (int32 pos); +export int32 OPM_SignedMaximum (int32 bytecount); +export int32 OPM_SignedMinimum (int32 bytecount); export void OPM_SymRCh (CHAR *ch); -export LONGINT OPM_SymRInt (void); +export int32 OPM_SymRInt (void); export void OPM_SymRLReal (LONGREAL *lr); export void OPM_SymRReal (REAL *r); export void OPM_SymRSet (SET *s); export void OPM_SymWCh (CHAR ch); -export void OPM_SymWInt (LONGINT i); +export void OPM_SymWInt (int32 i); export void OPM_SymWLReal (LONGREAL lr); export void OPM_SymWReal (REAL r); export void OPM_SymWSet (SET s); static void OPM_VerboseListSizes (void); export void OPM_Write (CHAR ch); -export void OPM_WriteHex (LONGINT i); -export void OPM_WriteInt (LONGINT i); +export void OPM_WriteHex (int32 i); +export void OPM_WriteInt (int32 i); export void OPM_WriteLn (void); export void OPM_WriteReal (LONGREAL r, CHAR suffx); export void OPM_WriteString (CHAR *s, LONGINT s__len); export void OPM_WriteStringVar (CHAR *s, LONGINT s__len); export BOOLEAN OPM_eofSF (void); -export void OPM_err (INTEGER n); -static LONGINT OPM_minusop (LONGINT i); -static LONGINT OPM_power0 (LONGINT i, LONGINT j); +export void OPM_err (int16 n); +static int32 OPM_minusop (int32 i); +static int32 OPM_power0 (int32 i, int32 j); void OPM_LogW (CHAR ch) @@ -102,7 +102,7 @@ void OPM_LogWStr (CHAR *s, LONGINT s__len) __DEL(s); } -void OPM_LogWNum (LONGINT i, LONGINT len) +void OPM_LogWNum (int32 i, int32 len) { Console_Int(i, len); } @@ -114,7 +114,7 @@ void OPM_LogWLn (void) static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) { - INTEGER i; + int16 i; i = 1; while (s[__X(i, s__len)] != 0x00) { switch (s[__X(i, s__len)]) { @@ -154,15 +154,15 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) case 'B': if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_IntSize = (SYSTEM_INT16)s[__X(i, s__len)] - 48; + OPM_IntSize = (int16)s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_PointerSize = (SYSTEM_INT16)s[__X(i, s__len)] - 48; + OPM_PointerSize = (int16)s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_Alignment = (SYSTEM_INT16)s[__X(i, s__len)] - 48; + OPM_Alignment = (int16)s[__X(i, s__len)] - 48; } __ASSERT(OPM_IntSize == 2 || OPM_IntSize == 4, 0); __ASSERT(OPM_PointerSize == 4 || OPM_PointerSize == 8, 0); @@ -299,7 +299,7 @@ void OPM_InitOptions (void) void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len) { Texts_Text T = NIL; - LONGINT beg, end, time; + int32 beg, end, time; CHAR s[256]; *done = 0; OPM_curpos = 0; @@ -347,7 +347,7 @@ void OPM_Get (CHAR *ch) static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len) { - INTEGER i, j; + int16 i, j; CHAR ch; __DUP(ext, ext__len, CHAR); i = 0; @@ -369,12 +369,12 @@ static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGIN __DEL(ext); } -static void OPM_LogErrMsg (INTEGER n) +static void OPM_LogErrMsg (int16 n) { Texts_Scanner S; Texts_Text T = NIL; CHAR ch; - INTEGER i; + int16 i; CHAR buf[1024]; if (n >= 0) { if (!OPM_notColorOutput) { @@ -399,7 +399,7 @@ static void OPM_LogErrMsg (INTEGER n) OPM_LogWStr(errors_errors[__X(n, 350)], 128); } -static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, LONGINT pos) +static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, int32 pos) { CHAR ch, cheol; if (pos < OPM_ErrorLineStartPos) { @@ -431,12 +431,12 @@ static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, LONGINT Files_Set(&*r, r__typ, f, OPM_ErrorLineStartPos); } -static void OPM_ShowLine (LONGINT pos) +static void OPM_ShowLine (int32 pos) { Files_File f = NIL; Files_Rider r; CHAR line[1023]; - INTEGER i; + int16 i; CHAR ch; f = Files_Old(OPM_SourceFileName, 256); OPM_FindLine(f, &r, Files_Rider__typ, pos); @@ -458,7 +458,7 @@ static void OPM_ShowLine (LONGINT pos) if (pos >= OPM_ErrorLineLimitPos) { pos = OPM_ErrorLineLimitPos - 1; } - i = (SYSTEM_INT16)(pos - OPM_ErrorLineStartPos); + i = (int16)(pos - OPM_ErrorLineStartPos); while (i > 0) { OPM_LogW(' '); i -= 1; @@ -473,7 +473,7 @@ static void OPM_ShowLine (LONGINT pos) Files_Close(f); } -void OPM_Mark (INTEGER n, LONGINT pos) +void OPM_Mark (int16 n, int32 pos) { if (pos == -1) { pos = 0; @@ -525,51 +525,51 @@ void OPM_Mark (INTEGER n, LONGINT pos) } } -void OPM_err (INTEGER n) +void OPM_err (int16 n) { OPM_Mark(n, OPM_errpos); } -void OPM_FPrint (LONGINT *fp, LONGINT val) +void OPM_FPrint (int32 *fp, int32 val) { - *fp = __ROTL((LONGINT)((SET)*fp ^ (SET)val), 1, LONGINT); + *fp = __ROTL((int32)((SET)*fp ^ (SET)val), 1, int32); } -void OPM_FPrintSet (LONGINT *fp, SET set) +void OPM_FPrintSet (int32 *fp, SET set) { - OPM_FPrint(&*fp, (LONGINT)set); + OPM_FPrint(&*fp, (int32)set); } -void OPM_FPrintReal (LONGINT *fp, REAL real) +void OPM_FPrintReal (int32 *fp, REAL real) { - INTEGER i; - LONGINT l; - __GET((SYSTEM_ADRINT)&real, l, LONGINT); + int16 i; + int32 l; + __GET((SYSTEM_ADRINT)&real, l, int32); OPM_FPrint(&*fp, l); } -void OPM_FPrintLReal (LONGINT *fp, LONGREAL lr) +void OPM_FPrintLReal (int32 *fp, LONGREAL lr) { - LONGINT l, h; - __GET((SYSTEM_ADRINT)&lr, l, LONGINT); - __GET((SYSTEM_ADRINT)&lr + 4, h, LONGINT); + int32 l, h; + __GET((SYSTEM_ADRINT)&lr, l, int32); + __GET((SYSTEM_ADRINT)&lr + 4, h, int32); OPM_FPrint(&*fp, l); OPM_FPrint(&*fp, h); } -static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONGINT name__len, INTEGER *size, INTEGER *align) +static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONGINT name__len, int16 *size, int16 *align) { __DUP(name, name__len, CHAR); if (((*S).class == 1 && __STRCMP((*S).s, name) == 0)) { Texts_Scan(&*S, S__typ); if ((*S).class == 3) { - *size = (SYSTEM_INT16)(*S).i; + *size = (int16)(*S).i; Texts_Scan(&*S, S__typ); } else { OPM_Mark(-157, -1); } if ((*S).class == 3) { - *align = (SYSTEM_INT16)(*S).i; + *align = (int16)(*S).i; Texts_Scan(&*S, S__typ); } else { OPM_Mark(-157, -1); @@ -580,17 +580,17 @@ static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONG __DEL(name); } -static LONGINT OPM_minusop (LONGINT i) +static int32 OPM_minusop (int32 i) { - LONGINT _o_result; + int32 _o_result; _o_result = -i; return _o_result; } -static LONGINT OPM_power0 (LONGINT i, LONGINT j) +static int32 OPM_power0 (int32 i, int32 j) { - LONGINT _o_result; - LONGINT k, p; + int32 _o_result; + int32 k, p; k = 1; p = i; do { @@ -642,19 +642,19 @@ static void OPM_VerboseListSizes (void) OPM_LogWLn(); } -LONGINT OPM_SignedMaximum (LONGINT bytecount) +int32 OPM_SignedMaximum (int32 bytecount) { - LONGINT _o_result; - LONGINT result; + int32 _o_result; + int32 result; result = 1; - result = __LSH(result, __ASHL(bytecount, 3) - 1, LONGINT); + result = __LSH(result, __ASHL(bytecount, 3) - 1, int32); _o_result = result - 1; return _o_result; } -LONGINT OPM_SignedMinimum (LONGINT bytecount) +int32 OPM_SignedMinimum (int32 bytecount) { - LONGINT _o_result; + int32 _o_result; _o_result = -OPM_SignedMaximum(bytecount) - 1; return _o_result; } @@ -688,10 +688,10 @@ void OPM_SymRCh (CHAR *ch) Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&*ch); } -LONGINT OPM_SymRInt (void) +int32 OPM_SymRInt (void) { - LONGINT _o_result; - LONGINT k; + int32 _o_result; + int32 k; Files_ReadNum(&OPM_oldSF, Files_Rider__typ, &k); _o_result = k; return _o_result; @@ -699,7 +699,7 @@ LONGINT OPM_SymRInt (void) void OPM_SymRSet (SET *s) { - Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (LONGINT*)&*s); + Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (int32*)&*s); } void OPM_SymRReal (REAL *r) @@ -746,14 +746,14 @@ void OPM_SymWCh (CHAR ch) Files_Write(&OPM_newSF, Files_Rider__typ, ch); } -void OPM_SymWInt (LONGINT i) +void OPM_SymWInt (int32 i) { Files_WriteNum(&OPM_newSF, Files_Rider__typ, i); } void OPM_SymWSet (SET s) { - Files_WriteNum(&OPM_newSF, Files_Rider__typ, (LONGINT)s); + Files_WriteNum(&OPM_newSF, Files_Rider__typ, (int32)s); } void OPM_SymWReal (REAL r) @@ -797,7 +797,7 @@ void OPM_Write (CHAR ch) void OPM_WriteString (CHAR *s, LONGINT s__len) { - INTEGER i; + int16 i; i = 0; while (s[__X(i, s__len)] != 0x00) { i += 1; @@ -807,7 +807,7 @@ void OPM_WriteString (CHAR *s, LONGINT s__len) void OPM_WriteStringVar (CHAR *s, LONGINT s__len) { - INTEGER i; + int16 i; i = 0; while (s[__X(i, s__len)] != 0x00) { i += 1; @@ -815,17 +815,17 @@ void OPM_WriteStringVar (CHAR *s, LONGINT s__len) Files_WriteBytes(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, (void*)s, s__len * 1, i); } -void OPM_WriteHex (LONGINT i) +void OPM_WriteHex (int32 i) { CHAR s[3]; - INTEGER digit; - digit = __ASHR((SYSTEM_INT16)i, 4); + int16 digit; + digit = __ASHR((int16)i, 4); if (digit < 10) { s[0] = (CHAR)(48 + digit); } else { s[0] = (CHAR)(87 + digit); } - digit = __MASK((SYSTEM_INT16)i, -16); + digit = __MASK((int16)i, -16); if (digit < 10) { s[1] = (CHAR)(48 + digit); } else { @@ -835,10 +835,10 @@ void OPM_WriteHex (LONGINT i) OPM_WriteString(s, 3); } -void OPM_WriteInt (LONGINT i) +void OPM_WriteInt (int32 i) { CHAR s[20]; - LONGINT i1, k; + int32 i1, k; if (i == OPM_SignedMinimum(OPM_IntSize) || i == OPM_SignedMinimum(OPM_LIntSize)) { OPM_Write('('); OPM_WriteInt(i + 1); @@ -871,14 +871,14 @@ void OPM_WriteReal (LONGREAL r, CHAR suffx) Texts_Reader R; CHAR s[32]; CHAR ch; - INTEGER i; - if ((((r < OPM_SignedMaximum(OPM_LIntSize) && r > OPM_SignedMinimum(OPM_LIntSize))) && r == ((SYSTEM_INT32)__ENTIER(r)))) { + int16 i; + if ((((r < OPM_SignedMaximum(OPM_LIntSize) && r > OPM_SignedMinimum(OPM_LIntSize))) && r == ((int32)__ENTIER(r)))) { if (suffx == 'f') { OPM_WriteString((CHAR*)"(REAL)", 7); } else { OPM_WriteString((CHAR*)"(LONGREAL)", 11); } - OPM_WriteInt((SYSTEM_INT32)__ENTIER(r)); + OPM_WriteInt((int32)__ENTIER(r)); } else { Texts_OpenWriter(&W, Texts_Writer__typ); if (suffx == 'f') { @@ -959,7 +959,7 @@ void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len) void OPM_CloseFiles (void) { CHAR FName[32]; - INTEGER res; + int16 res; if (OPM_noerr) { OPM_LogWStr((CHAR*)" ", 3); OPM_LogWNum(Files_Pos(&OPM_R[1], Files_Rider__typ), 0); diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index 15a980a6..36eb4165 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -6,12 +6,12 @@ #include "SYSTEM.h" -import INTEGER OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet; -import LONGINT OPM_MaxIndex; +import int16 OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet; +import int32 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; -import LONGINT OPM_curpos, OPM_errpos, OPM_breakpc; -import INTEGER OPM_currFile, OPM_level, OPM_pc, OPM_entno; +import int32 OPM_curpos, OPM_errpos, OPM_breakpc; +import int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; import CHAR OPM_modName[32]; import CHAR OPM_objname[64]; import SET OPM_opt, OPM_glbopt; @@ -21,44 +21,44 @@ import BOOLEAN OPM_dontAsm, OPM_dontLink, OPM_mainProg, OPM_mainLinkStat, OPM_no import void OPM_CloseFiles (void); import void OPM_CloseOldSym (void); import void OPM_DeleteNewSym (void); -import void OPM_FPrint (LONGINT *fp, LONGINT val); -import void OPM_FPrintLReal (LONGINT *fp, LONGREAL lr); -import void OPM_FPrintReal (LONGINT *fp, REAL real); -import void OPM_FPrintSet (LONGINT *fp, SET set); +import void OPM_FPrint (int32 *fp, int32 val); +import void OPM_FPrintLReal (int32 *fp, LONGREAL lr); +import void OPM_FPrintReal (int32 *fp, REAL real); +import void OPM_FPrintSet (int32 *fp, SET set); import void OPM_Get (CHAR *ch); import void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); import void OPM_InitOptions (void); import void OPM_LogW (CHAR ch); import void OPM_LogWLn (void); -import void OPM_LogWNum (LONGINT i, LONGINT len); +import void OPM_LogWNum (int32 i, int32 len); import void OPM_LogWStr (CHAR *s, LONGINT s__len); -import void OPM_Mark (INTEGER n, LONGINT pos); +import void OPM_Mark (int16 n, int32 pos); import void OPM_NewSym (CHAR *modName, LONGINT modName__len); import void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); import void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); import BOOLEAN OPM_OpenPar (void); import void OPM_RegisterNewSym (void); -import LONGINT OPM_SignedMaximum (LONGINT bytecount); -import LONGINT OPM_SignedMinimum (LONGINT bytecount); +import int32 OPM_SignedMaximum (int32 bytecount); +import int32 OPM_SignedMinimum (int32 bytecount); import void OPM_SymRCh (CHAR *ch); -import LONGINT OPM_SymRInt (void); +import int32 OPM_SymRInt (void); import void OPM_SymRLReal (LONGREAL *lr); import void OPM_SymRReal (REAL *r); import void OPM_SymRSet (SET *s); import void OPM_SymWCh (CHAR ch); -import void OPM_SymWInt (LONGINT i); +import void OPM_SymWInt (int32 i); import void OPM_SymWLReal (LONGREAL lr); import void OPM_SymWReal (REAL r); import void OPM_SymWSet (SET s); import void OPM_Write (CHAR ch); -import void OPM_WriteHex (LONGINT i); -import void OPM_WriteInt (LONGINT i); +import void OPM_WriteHex (int32 i); +import void OPM_WriteInt (int32 i); import void OPM_WriteLn (void); import void OPM_WriteReal (LONGREAL r, CHAR suffx); import void OPM_WriteString (CHAR *s, LONGINT s__len); import void OPM_WriteStringVar (CHAR *s, LONGINT s__len); import BOOLEAN OPM_eofSF (void); -import void OPM_err (INTEGER n); +import void OPM_err (int16 n); import void *OPM__init(void); diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index 21c21350..a366ef24 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -6,17 +6,17 @@ #include "OPT.h" struct OPP__1 { - LONGINT low, high; + int32 low, high; }; typedef struct OPP__1 OPP_CaseTable[128]; -static SHORTINT OPP_sym, OPP_level; -static INTEGER OPP_LoopLevel; +static int8 OPP_sym, OPP_level; +static int16 OPP_LoopLevel; static OPT_Node OPP_TDinit, OPP_lastTDinit; -static INTEGER OPP_nofFwdPtr; +static int16 OPP_nofFwdPtr; static OPT_Struct OPP_FwdPtr[64]; export LONGINT *OPP__1__typ; @@ -24,10 +24,10 @@ export LONGINT *OPP__1__typ; static void OPP_ActualParameters (OPT_Node *aparlist, OPT_Object fpar); static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned); static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq); -static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, OPP_CaseTable tab); -static void OPP_CheckMark (SHORTINT *vis); -static void OPP_CheckSym (INTEGER s); -static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_); +static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int16 *n, OPP_CaseTable tab); +static void OPP_CheckMark (int8 *vis); +static void OPP_CheckSym (int16 s); +static void OPP_CheckSysFlag (int16 *sysflag, int16 default_); static void OPP_ConstExpression (OPT_Node *x); static void OPP_Element (OPT_Node *x); static void OPP_Expression (OPT_Node *x); @@ -37,7 +37,7 @@ static void OPP_FormalParameters (OPT_Object *firstPar, OPT_Struct *resTyp); export void OPP_Module (OPT_Node *prog, SET opt); static void OPP_PointerType (OPT_Struct *typ); static void OPP_ProcedureDeclaration (OPT_Node *x); -static void OPP_Receiver (SHORTINT *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec); +static void OPP_Receiver (int8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec); static void OPP_RecordType (OPT_Struct *typ, OPT_Struct *banned); static void OPP_Sets (OPT_Node *x); static void OPP_SimpleExpression (OPT_Node *x); @@ -46,19 +46,19 @@ static void OPP_StatSeq (OPT_Node *stat); static void OPP_Term (OPT_Node *x); static void OPP_Type (OPT_Struct *typ, OPT_Struct *banned); static void OPP_TypeDecl (OPT_Struct *typ, OPT_Struct *banned); -static void OPP_err (INTEGER n); +static void OPP_err (int16 n); static void OPP_qualident (OPT_Object *id); static void OPP_selector (OPT_Node *x); -static void OPP_err (INTEGER n) +static void OPP_err (int16 n) { OPM_err(n); } -static void OPP_CheckSym (INTEGER s) +static void OPP_CheckSym (int16 s) { - if ((SYSTEM_INT16)OPP_sym == s) { + if ((int16)OPP_sym == s) { OPS_Get(&OPP_sym); } else { OPM_err(s); @@ -68,7 +68,7 @@ static void OPP_CheckSym (INTEGER s) static void OPP_qualident (OPT_Object *id) { OPT_Object obj = NIL; - SHORTINT lev; + int8 lev; OPT_Find(&obj); OPS_Get(&OPP_sym); if ((((OPP_sym == 18 && obj != NIL)) && obj->mode == 11)) { @@ -108,7 +108,7 @@ static void OPP_ConstExpression (OPT_Node *x) } } -static void OPP_CheckMark (SHORTINT *vis) +static void OPP_CheckMark (int8 *vis) { OPS_Get(&OPP_sym); if (OPP_sym == 1 || OPP_sym == 7) { @@ -126,10 +126,10 @@ static void OPP_CheckMark (SHORTINT *vis) } } -static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_) +static void OPP_CheckSysFlag (int16 *sysflag, int16 default_) { OPT_Node x = NIL; - LONGINT sf; + int32 sf; if (OPP_sym == 31) { OPS_Get(&OPP_sym); if (!OPT_SYSimported) { @@ -146,7 +146,7 @@ static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_) OPP_err(51); sf = 0; } - *sysflag = (SYSTEM_INT16)sf; + *sysflag = (int16)sf; OPP_CheckSym(23); } else { *sysflag = default_; @@ -157,7 +157,7 @@ static void OPP_RecordType (OPT_Struct *typ, OPT_Struct *banned) { OPT_Object fld = NIL, first = NIL, last = NIL, base = NIL; OPT_Struct ftyp = NIL; - INTEGER sysflag; + int16 sysflag; *typ = OPT_NewStr(13, 4); (*typ)->BaseTyp = NIL; OPP_CheckSysFlag(&sysflag, -1); @@ -249,8 +249,8 @@ static void OPP_RecordType (OPT_Struct *typ, OPT_Struct *banned) static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) { OPT_Node x = NIL; - LONGINT n; - INTEGER sysflag; + int32 n; + int16 sysflag; OPP_CheckSysFlag(&sysflag, 0); if (OPP_sym == 25) { *typ = OPT_NewStr(13, 3); @@ -342,7 +342,7 @@ static void OPP_PointerType (OPT_Struct *typ) static void OPP_FormalParameters (OPT_Object *firstPar, OPT_Struct *resTyp) { - SHORTINT mode; + int8 mode; OPT_Object par = NIL, first = NIL, last = NIL, res = NIL; OPT_Struct typ = NIL; first = NIL; @@ -623,9 +623,9 @@ static void OPP_ActualParameters (OPT_Node *aparlist, OPT_Object fpar) static void OPP_StandProcCall (OPT_Node *x) { OPT_Node y = NIL; - SHORTINT m; - INTEGER n; - m = (SYSTEM_INT8)((SYSTEM_INT16)(*x)->obj->adr); + int8 m; + int16 n; + m = (int8)((int16)(*x)->obj->adr); n = 0; if (OPP_sym == 30) { OPS_Get(&OPP_sym); @@ -784,7 +784,7 @@ static void OPP_Factor (OPT_Node *x) static void OPP_Term (OPT_Node *x) { OPT_Node y = NIL; - SHORTINT mulop; + int8 mulop; OPP_Factor(&*x); while ((1 <= OPP_sym && OPP_sym <= 5)) { mulop = OPP_sym; @@ -797,7 +797,7 @@ static void OPP_Term (OPT_Node *x) static void OPP_SimpleExpression (OPT_Node *x) { OPT_Node y = NIL; - SHORTINT addop; + int8 addop; if (OPP_sym == 7) { OPS_Get(&OPP_sym); OPP_Term(&*x); @@ -821,7 +821,7 @@ static void OPP_Expression (OPT_Node *x) { OPT_Node y = NIL; OPT_Object obj = NIL; - SHORTINT relation; + int8 relation; OPP_SimpleExpression(&*x); if ((9 <= OPP_sym && OPP_sym <= 14)) { relation = OPP_sym; @@ -847,7 +847,7 @@ static void OPP_Expression (OPT_Node *x) } } -static void OPP_Receiver (SHORTINT *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec) +static void OPP_Receiver (int8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec) { OPT_Object obj = NIL; *typ = OPT_undftyp; @@ -913,7 +913,7 @@ static struct ProcedureDeclaration__16 { OPT_Node *x; OPT_Object *proc, *fwd; OPS_Name *name; - SHORTINT *mode, *vis; + int8 *mode, *vis; BOOLEAN *forward; struct ProcedureDeclaration__16 *lnk; } *ProcedureDeclaration__16_s; @@ -926,8 +926,8 @@ static void TProcDecl__23 (void); static void GetCode__19 (void) { OPT_ConstExt ext = NIL; - INTEGER n; - LONGINT c; + int16 n; + int32 c; ext = OPT_NewExt(); (*ProcedureDeclaration__16_s->proc)->conval->ext = ext; n = 0; @@ -991,7 +991,7 @@ static void GetParams__21 (void) static void Body__17 (void) { OPT_Node procdec = NIL, statseq = NIL; - LONGINT c; + int32 c; c = OPM_errpos; (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1); OPP_CheckSym(39); @@ -1014,7 +1014,7 @@ static void TProcDecl__23 (void) { OPT_Object baseProc = NIL; OPT_Struct objTyp = NIL, recTyp = NIL; - SHORTINT objMode; + int8 objMode; OPS_Name objName; OPS_Get(&OPP_sym); *ProcedureDeclaration__16_s->mode = 13; @@ -1086,7 +1086,7 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) { OPT_Object proc = NIL, fwd = NIL; OPS_Name name; - SHORTINT mode, vis; + int8 mode, vis; BOOLEAN forward; struct ProcedureDeclaration__16 _s; _s.x = x; @@ -1163,11 +1163,11 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) ProcedureDeclaration__16_s = _s.lnk; } -static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, OPP_CaseTable tab) +static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int16 *n, OPP_CaseTable tab) { OPT_Node x = NIL, y = NIL, lastlab = NIL; - INTEGER i, f; - LONGINT xval, yval; + int16 i, f; + int32 xval, yval; *lab = NIL; lastlab = NIL; for (;;) { @@ -1183,14 +1183,14 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, O if (!(LabelTyp->form == 4) || LabelTyp->size < x->typ->size) { OPP_err(60); } - } else if ((SYSTEM_INT16)LabelTyp->form != f) { + } else if ((int16)LabelTyp->form != f) { OPP_err(60); } if (OPP_sym == 21) { OPS_Get(&OPP_sym); OPP_ConstExpression(&y); yval = y->conval->intval; - if (((SYSTEM_INT16)y->typ->form != f && !((f == 4 && y->typ->form == 4)))) { + if (((int16)y->typ->form != f && !((f == 4 && y->typ->form == 4)))) { OPP_err(60); } if (yval < xval) { @@ -1234,7 +1234,7 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, O } static struct StatSeq__30 { - LONGINT *pos; + int32 *pos; struct StatSeq__30 *lnk; } *StatSeq__30_s; @@ -1244,8 +1244,8 @@ static void SetPos__35 (OPT_Node x); static void CasePart__31 (OPT_Node *x) { - INTEGER n; - LONGINT low, high; + int16 n; + int32 low, high; BOOLEAN e; OPP_CaseTable tab; OPT_Node cases = NIL, lab = NIL, y = NIL, lastcase = NIL; @@ -1328,7 +1328,7 @@ static void OPP_StatSeq (OPT_Node *stat) OPT_Struct idtyp = NIL; BOOLEAN e; OPT_Node s = NIL, x = NIL, y = NIL, z = NIL, apar = NIL, last = NIL, lastif = NIL; - LONGINT pos; + int32 pos; OPS_Name name; struct StatSeq__30 _s; _s.pos = &pos; @@ -1621,7 +1621,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) OPT_Struct typ = NIL; OPT_Object obj = NIL, first = NIL, last = NIL; OPT_Node x = NIL, lastdec = NIL; - INTEGER i; + int16 i; first = NIL; last = NIL; OPP_nofFwdPtr = 0; @@ -1774,7 +1774,7 @@ void OPP_Module (OPT_Node *prog, SET opt) { OPS_Name impName, aliasName; OPT_Node procdec = NIL, statseq = NIL; - LONGINT c; + int32 c; BOOLEAN done; OPS_Init(); OPP_LoopLevel = 0; diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index f197a5c6..2b29372f 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -11,29 +11,29 @@ typedef export OPS_Name OPS_name; export OPS_String OPS_str; -export INTEGER OPS_numtyp; -export LONGINT OPS_intval; +export int16 OPS_numtyp; +export int32 OPS_intval; export REAL OPS_realval; export LONGREAL OPS_lrlval; static CHAR OPS_ch; -export void OPS_Get (SHORTINT *sym); -static void OPS_Identifier (SHORTINT *sym); +export void OPS_Get (int8 *sym); +static void OPS_Identifier (int8 *sym); export void OPS_Init (void); static void OPS_Number (void); -static void OPS_Str (SHORTINT *sym); -static void OPS_err (INTEGER n); +static void OPS_Str (int8 *sym); +static void OPS_err (int16 n); -static void OPS_err (INTEGER n) +static void OPS_err (int16 n) { OPM_err(n); } -static void OPS_Str (SHORTINT *sym) +static void OPS_Str (int8 *sym) { - INTEGER i; + int16 i; CHAR och; i = 0; och = OPS_ch; @@ -59,15 +59,15 @@ static void OPS_Str (SHORTINT *sym) if (OPS_intval == 2) { *sym = 35; OPS_numtyp = 1; - OPS_intval = (SYSTEM_INT16)OPS_str[0]; + OPS_intval = (int16)OPS_str[0]; } else { *sym = 37; } } -static void OPS_Identifier (SHORTINT *sym) +static void OPS_Identifier (int8 *sym) { - INTEGER i; + int16 i; i = 0; do { OPS_name[i] = OPS_ch; @@ -86,10 +86,10 @@ static struct Number__6 { struct Number__6 *lnk; } *Number__6_s; -static INTEGER Ord__7 (CHAR ch, BOOLEAN hex); -static LONGREAL Ten__9 (INTEGER e); +static int16 Ord__7 (CHAR ch, BOOLEAN hex); +static LONGREAL Ten__9 (int16 e); -static LONGREAL Ten__9 (INTEGER e) +static LONGREAL Ten__9 (int16 e) { LONGREAL _o_result; LONGREAL x, p; @@ -108,14 +108,14 @@ static LONGREAL Ten__9 (INTEGER e) return _o_result; } -static INTEGER Ord__7 (CHAR ch, BOOLEAN hex) +static int16 Ord__7 (CHAR ch, BOOLEAN hex) { - INTEGER _o_result; + int16 _o_result; if (ch <= '9') { - _o_result = (SYSTEM_INT16)ch - 48; + _o_result = (int16)ch - 48; return _o_result; } else if (hex) { - _o_result = ((SYSTEM_INT16)ch - 65) + 10; + _o_result = ((int16)ch - 65) + 10; return _o_result; } else { OPS_err(2); @@ -127,7 +127,7 @@ static INTEGER Ord__7 (CHAR ch, BOOLEAN hex) static void OPS_Number (void) { - INTEGER i, m, n, d, e, maxHdig; + int16 i, m, n, d, e, maxHdig; CHAR dig[24]; LONGREAL f; CHAR expCh; @@ -309,9 +309,9 @@ static void Comment__2 (void) } } -void OPS_Get (SHORTINT *sym) +void OPS_Get (int8 *sym) { - SHORTINT s; + int8 s; struct Get__1 _s; _s.lnk = Get__1_s; Get__1_s = &_s; diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index 1e99f5e9..e40119f7 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -14,13 +14,13 @@ typedef import OPS_Name OPS_name; import OPS_String OPS_str; -import INTEGER OPS_numtyp; -import LONGINT OPS_intval; +import int16 OPS_numtyp; +import int32 OPS_intval; import REAL OPS_realval; import LONGREAL OPS_lrlval; -import void OPS_Get (SHORTINT *sym); +import void OPS_Get (int8 *sym); import void OPS_Init (void); import void *OPS__init(void); diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 5b495ad5..7fbad791 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -12,17 +12,17 @@ typedef typedef struct OPT_ConstDesc { OPT_ConstExt ext; - LONGINT intval, intval2; + int32 intval, intval2; SET setval; LONGREAL realval; } OPT_ConstDesc; typedef struct OPT_ExpCtxt { - LONGINT reffp; - INTEGER ref; - SHORTINT nofm; - SHORTINT locmno[64]; + int32 reffp; + int16 ref; + int8 nofm; + int8 locmno[64]; } OPT_ExpCtxt; typedef @@ -33,13 +33,13 @@ typedef typedef struct OPT_ImpCtxt { - LONGINT nextTag, reffp; - INTEGER nofr, minr, nofm; + int32 nextTag, reffp; + int16 nofr, minr, nofm; BOOLEAN self; OPT_Struct ref[255]; OPT_Object old[255]; - LONGINT pvfp[255]; - SHORTINT glbmno[64]; + int32 pvfp[255]; + int8 glbmno[64]; } OPT_ImpCtxt; typedef @@ -48,7 +48,7 @@ typedef typedef struct OPT_NodeDesc { OPT_Node left, right, link; - SHORTINT class, subcl; + int8 class, subcl; BOOLEAN readonly; OPT_Struct typ; OPT_Object obj; @@ -60,22 +60,22 @@ typedef OPT_Object left, right, link, scope; OPS_Name name; BOOLEAN leaf; - SHORTINT mode, mnolev, vis, history; + int8 mode, mnolev, vis, history; BOOLEAN used, fpdone; - LONGINT fprint; + int32 fprint; OPT_Struct typ; OPT_Const conval; - LONGINT adr, linkadr; - INTEGER x; + int32 adr, linkadr; + int16 x; } OPT_ObjDesc; typedef struct OPT_StrDesc { - SHORTINT form, comp, mno, extlev; - INTEGER ref, sysflag; - LONGINT n, size, align, txtpos; + int8 form, comp, mno, extlev; + int16 ref, sysflag; + int32 n, size, align, txtpos; BOOLEAN allocated, pbused, pvused, fpdone, idfpdone; - LONGINT idfp, pbfp, pvfp; + int32 idfp, pbfp, pvfp; OPT_Struct BaseTyp; OPT_Object link, strobj; } OPT_StrDesc; @@ -84,7 +84,7 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; -export SHORTINT OPT_nofGmod; +export int8 OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; export BOOLEAN OPT_SYSimported; @@ -92,7 +92,7 @@ static OPT_Struct OPT_IntTypes[20]; static OPT_Object OPT_universe, OPT_syslink; static OPT_ImpCtxt OPT_impCtxt; static OPT_ExpCtxt OPT_expCtxt; -static LONGINT OPT_nofhdfld; +static int32 OPT_nofhdfld; static BOOLEAN OPT_newsf, OPT_findpc, OPT_extsf, OPT_sfpresent, OPT_symExtended, OPT_symNew; export LONGINT *OPT_ConstDesc__typ; @@ -105,62 +105,62 @@ export LONGINT *OPT_ExpCtxt__typ; export void OPT_Close (void); export void OPT_CloseScope (void); static void OPT_DebugStruct (OPT_Struct btyp); -static void OPT_EnterBoolConst (OPS_Name name, LONGINT value); -static void OPT_EnterProc (OPS_Name name, INTEGER num); -static void OPT_EnterTyp (OPS_Name name, SHORTINT form, INTEGER size, OPT_Struct *res); +static void OPT_EnterBoolConst (OPS_Name name, int32 value); +static void OPT_EnterProc (OPS_Name name, int16 num); +static void OPT_EnterTyp (OPS_Name name, int8 form, int16 size, OPT_Struct *res); export void OPT_Export (BOOLEAN *ext, BOOLEAN *new); -export void OPT_FPrintErr (OPT_Object obj, INTEGER errcode); -static void OPT_FPrintName (LONGINT *fp, CHAR *name, LONGINT name__len); +export void OPT_FPrintErr (OPT_Object obj, int16 errcode); +static void OPT_FPrintName (int32 *fp, CHAR *name, LONGINT name__len); export void OPT_FPrintObj (OPT_Object obj); -static void OPT_FPrintSign (LONGINT *fp, OPT_Struct result, OPT_Object par); +static void OPT_FPrintSign (int32 *fp, OPT_Struct result, OPT_Object par); export void OPT_FPrintStr (OPT_Struct typ); export void OPT_Find (OPT_Object *res); export void OPT_FindField (OPS_Name name, OPT_Struct typ, OPT_Object *res); export void OPT_FindImport (OPT_Object mod, OPT_Object *res); export void OPT_IdFPrint (OPT_Struct typ); export void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); -static void OPT_InConstant (LONGINT f, OPT_Const conval); +static void OPT_InConstant (int32 f, OPT_Const conval); static OPT_Object OPT_InFld (void); -static void OPT_InMod (SHORTINT *mno); +static void OPT_InMod (int8 *mno); static void OPT_InName (CHAR *name, LONGINT name__len); -static OPT_Object OPT_InObj (SHORTINT mno); -static void OPT_InSign (SHORTINT mno, OPT_Struct *res, OPT_Object *par); +static OPT_Object OPT_InObj (int8 mno); +static void OPT_InSign (int8 mno, OPT_Struct *res, OPT_Object *par); static void OPT_InStruct (OPT_Struct *typ); -static OPT_Object OPT_InTProc (SHORTINT mno); -static OPT_Struct OPT_InTyp (LONGINT tag); +static OPT_Object OPT_InTProc (int8 mno); +static OPT_Struct OPT_InTyp (int32 tag); export void OPT_Init (OPS_Name name, SET opt); -static void OPT_InitStruct (OPT_Struct *typ, SHORTINT form); +static void OPT_InitStruct (OPT_Struct *typ, int8 form); export void OPT_Insert (OPS_Name name, OPT_Object *obj); export void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); -export OPT_Struct OPT_IntType (LONGINT size); +export OPT_Struct OPT_IntType (int32 size); export OPT_Const OPT_NewConst (void); export OPT_ConstExt OPT_NewExt (void); -export OPT_Node OPT_NewNode (SHORTINT class); +export OPT_Node OPT_NewNode (int8 class); export OPT_Object OPT_NewObj (void); -export OPT_Struct OPT_NewStr (SHORTINT form, SHORTINT comp); -export void OPT_OpenScope (SHORTINT level, OPT_Object owner); +export OPT_Struct OPT_NewStr (int8 form, int8 comp); +export void OPT_OpenScope (int8 level, OPT_Object owner); static void OPT_OutConstant (OPT_Object obj); -static void OPT_OutFlds (OPT_Object fld, LONGINT adr, BOOLEAN visible); -static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, LONGINT adr); -static void OPT_OutMod (INTEGER mno); +static void OPT_OutFlds (OPT_Object fld, int32 adr, BOOLEAN visible); +static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, int32 adr); +static void OPT_OutMod (int16 mno); static void OPT_OutName (CHAR *name, LONGINT name__len); static void OPT_OutObj (OPT_Object obj); static void OPT_OutSign (OPT_Struct result, OPT_Object par); static void OPT_OutStr (OPT_Struct typ); static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj); -export OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir); -static void OPT_err (INTEGER n); +export OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir); +static void OPT_err (int16 n); -static void OPT_err (INTEGER n) +static void OPT_err (int16 n) { OPM_err(n); } -OPT_Struct OPT_IntType (LONGINT size) +OPT_Struct OPT_IntType (int32 size) { OPT_Struct _o_result; - INTEGER i; + int16 i; i = 1; while ((OPT_IntTypes[__X(i, 20)]->size < size && OPT_IntTypes[__X(i + 1, 20)] != NIL)) { i += 1; @@ -169,10 +169,10 @@ OPT_Struct OPT_IntType (LONGINT size) return _o_result; } -OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir) +OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir) { OPT_Struct _o_result; - INTEGER i; + int16 i; __ASSERT(x->form == 4, 0); __ASSERT(dir == 1 || dir == -1, 0); __ASSERT(x->BaseTyp == OPT_undftyp, 0); @@ -203,7 +203,7 @@ OPT_Object OPT_NewObj (void) return _o_result; } -OPT_Struct OPT_NewStr (SHORTINT form, SHORTINT comp) +OPT_Struct OPT_NewStr (int8 form, int8 comp) { OPT_Struct _o_result; OPT_Struct typ = NIL; @@ -220,7 +220,7 @@ OPT_Struct OPT_NewStr (SHORTINT form, SHORTINT comp) return _o_result; } -OPT_Node OPT_NewNode (SHORTINT class) +OPT_Node OPT_NewNode (int8 class) { OPT_Node _o_result; OPT_Node node = NIL; @@ -239,7 +239,7 @@ OPT_ConstExt OPT_NewExt (void) return _o_result; } -void OPT_OpenScope (SHORTINT level, OPT_Object owner) +void OPT_OpenScope (int8 level, OPT_Object owner) { OPT_Object head = NIL; head = OPT_NewObj(); @@ -277,7 +277,7 @@ void OPT_Init (OPS_Name name, SET opt) void OPT_Close (void) { - INTEGER i; + int16 i; OPT_CloseScope(); i = 0; while (i < 64) { @@ -369,7 +369,7 @@ void OPT_Insert (OPS_Name name, OPT_Object *obj) { OPT_Object ob0 = NIL, ob1 = NIL; BOOLEAN left; - SHORTINT mnolev; + int8 mnolev; ob0 = OPT_topScope; ob1 = ob0->right; left = 0; @@ -407,14 +407,14 @@ void OPT_Insert (OPS_Name name, OPT_Object *obj) *obj = ob1; } -static void OPT_FPrintName (LONGINT *fp, CHAR *name, LONGINT name__len) +static void OPT_FPrintName (int32 *fp, CHAR *name, LONGINT name__len) { - INTEGER i; + int16 i; CHAR ch; i = 0; do { ch = name[__X(i, name__len)]; - OPM_FPrint(&*fp, (SYSTEM_INT16)ch); + OPM_FPrint(&*fp, (int16)ch); i += 1; } while (!(ch == 0x00)); } @@ -452,7 +452,7 @@ static void OPT_DebugStruct (OPT_Struct btyp) OPM_LogWLn(); } -static void OPT_FPrintSign (LONGINT *fp, OPT_Struct result, OPT_Object par) +static void OPT_FPrintSign (int32 *fp, OPT_Struct result, OPT_Object par) { OPT_IdFPrint(result); OPM_FPrint(&*fp, result->idfp); @@ -468,8 +468,8 @@ void OPT_IdFPrint (OPT_Struct typ) { OPT_Struct btyp = NIL; OPT_Object strobj = NIL; - LONGINT idfp; - INTEGER f, c; + int32 idfp; + int16 f, c; if (!typ->idfpdone) { typ->idfpdone = 1; idfp = 0; @@ -498,17 +498,17 @@ void OPT_IdFPrint (OPT_Struct typ) } static struct FPrintStr__12 { - LONGINT *pbfp, *pvfp; + int32 *pbfp, *pvfp; struct FPrintStr__12 *lnk; } *FPrintStr__12_s; -static void FPrintFlds__13 (OPT_Object fld, LONGINT adr, BOOLEAN visible); -static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr); +static void FPrintFlds__13 (OPT_Object fld, int32 adr, BOOLEAN visible); +static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, int32 adr); static void FPrintTProcs__17 (OPT_Object obj); -static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr) +static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, int32 adr) { - LONGINT i, j, n; + int32 i, j, n; OPT_Struct btyp = NIL; if (typ->comp == 4) { FPrintFlds__13(typ->link, adr, 0); @@ -538,7 +538,7 @@ static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr) } } -static void FPrintFlds__13 (OPT_Object fld, LONGINT adr, BOOLEAN visible) +static void FPrintFlds__13 (OPT_Object fld, int32 adr, BOOLEAN visible) { while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { @@ -573,10 +573,10 @@ static void FPrintTProcs__17 (OPT_Object obj) void OPT_FPrintStr (OPT_Struct typ) { - INTEGER f, c; + int16 f, c; OPT_Struct btyp = NIL; OPT_Object strobj = NIL, bstrobj = NIL; - LONGINT pbfp, pvfp; + int32 pbfp, pvfp; struct FPrintStr__12 _s; _s.pbfp = &pbfp; _s.pvfp = &pvfp; @@ -637,8 +637,8 @@ void OPT_FPrintStr (OPT_Struct typ) void OPT_FPrintObj (OPT_Object obj) { - LONGINT fprint; - INTEGER f, m; + int32 fprint; + int16 f, m; REAL rval; OPT_ConstExt ext = NIL; if (!obj->fpdone) { @@ -680,11 +680,11 @@ void OPT_FPrintObj (OPT_Object obj) } else if (obj->mode == 9) { OPT_FPrintSign(&fprint, obj->typ, obj->link); ext = obj->conval->ext; - m = (SYSTEM_INT16)(*ext)[0]; + m = (int16)(*ext)[0]; f = 1; OPM_FPrint(&fprint, m); while (f <= m) { - OPM_FPrint(&fprint, (SYSTEM_INT16)(*ext)[__X(f, 256)]); + OPM_FPrint(&fprint, (int16)(*ext)[__X(f, 256)]); f += 1; } } else if (obj->mode == 5) { @@ -695,9 +695,9 @@ void OPT_FPrintObj (OPT_Object obj) } } -void OPT_FPrintErr (OPT_Object obj, INTEGER errcode) +void OPT_FPrintErr (OPT_Object obj, int16 errcode) { - INTEGER i, j; + int16 i, j; CHAR ch; if (obj->mnolev != 0) { __COPY(OPT_GlbMod[__X(-obj->mnolev, 64)]->name, OPM_objname, 64); @@ -787,7 +787,7 @@ void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old) static void OPT_InName (CHAR *name, LONGINT name__len) { - INTEGER i; + int16 i; CHAR ch; i = 0; do { @@ -797,12 +797,12 @@ static void OPT_InName (CHAR *name, LONGINT name__len) } while (!(ch == 0x00)); } -static void OPT_InMod (SHORTINT *mno) +static void OPT_InMod (int8 *mno) { OPT_Object head = NIL; OPS_Name name; - LONGINT mn; - SHORTINT i; + int32 mn; + int8 i; mn = OPM_SymRInt(); if (mn == 0) { *mno = OPT_impCtxt.glbmno[0]; @@ -839,16 +839,16 @@ static void OPT_InMod (SHORTINT *mno) } } -static void OPT_InConstant (LONGINT f, OPT_Const conval) +static void OPT_InConstant (int32 f, OPT_Const conval) { CHAR ch; - INTEGER i; + int16 i; OPT_ConstExt ext = NIL; REAL rval; switch (f) { case 1: case 3: case 2: OPM_SymRCh(&ch); - conval->intval = (SYSTEM_INT16)ch; + conval->intval = (int16)ch; break; case 4: conval->intval = OPM_SymRInt(); @@ -888,10 +888,10 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval) } } -static void OPT_InSign (SHORTINT mno, OPT_Struct *res, OPT_Object *par) +static void OPT_InSign (int8 mno, OPT_Struct *res, OPT_Object *par) { OPT_Object last = NIL, new = NIL; - LONGINT tag; + int32 tag; OPT_InStruct(&*res); tag = OPM_SymRInt(); last = NIL; @@ -919,7 +919,7 @@ static void OPT_InSign (SHORTINT mno, OPT_Struct *res, OPT_Object *par) static OPT_Object OPT_InFld (void) { OPT_Object _o_result; - LONGINT tag; + int32 tag; OPT_Object obj = NIL; tag = OPT_impCtxt.nextTag; obj = OPT_NewObj(); @@ -948,10 +948,10 @@ static OPT_Object OPT_InFld (void) return _o_result; } -static OPT_Object OPT_InTProc (SHORTINT mno) +static OPT_Object OPT_InTProc (int8 mno) { OPT_Object _o_result; - LONGINT tag; + int32 tag; OPT_Object obj = NIL; tag = OPT_impCtxt.nextTag; obj = OPT_NewObj(); @@ -976,7 +976,7 @@ static OPT_Object OPT_InTProc (SHORTINT mno) return _o_result; } -static OPT_Struct OPT_InTyp (LONGINT tag) +static OPT_Struct OPT_InTyp (int32 tag) { OPT_Struct _o_result; if (tag == 4) { @@ -991,9 +991,9 @@ static OPT_Struct OPT_InTyp (LONGINT tag) static void OPT_InStruct (OPT_Struct *typ) { - SHORTINT mno; - INTEGER ref; - LONGINT tag; + int8 mno; + int16 ref; + int32 tag; OPS_Name name; OPT_Struct t = NIL; OPT_Object obj = NIL, last = NIL, fld = NIL, old = NIL, dummy = NIL; @@ -1049,7 +1049,7 @@ static void OPT_InStruct (OPT_Struct *typ) obj->vis = 0; tag = OPM_SymRInt(); if (tag == 35) { - (*typ)->sysflag = (SYSTEM_INT16)OPM_SymRInt(); + (*typ)->sysflag = (int16)OPM_SymRInt(); tag = OPM_SymRInt(); } switch (tag) { @@ -1171,14 +1171,14 @@ static void OPT_InStruct (OPT_Struct *typ) } } -static OPT_Object OPT_InObj (SHORTINT mno) +static OPT_Object OPT_InObj (int8 mno) { OPT_Object _o_result; - INTEGER i, s; + int16 i, s; CHAR ch; OPT_Object obj = NIL, old = NIL; OPT_Struct typ = NIL; - LONGINT tag; + int32 tag; OPT_ConstExt ext = NIL; tag = OPT_impCtxt.nextTag; if (tag == 19) { @@ -1211,7 +1211,7 @@ static OPT_Object OPT_InObj (SHORTINT mno) obj->mode = 9; ext = OPT_NewExt(); obj->conval->ext = ext; - s = (SYSTEM_INT16)OPM_SymRInt(); + s = (int16)OPM_SymRInt(); (*ext)[0] = (CHAR)s; i = 1; while (i <= s) { @@ -1277,7 +1277,7 @@ static OPT_Object OPT_InObj (SHORTINT mno) void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) { OPT_Object obj = NIL; - SHORTINT mno; + int8 mno; OPS_Name aliasName__copy; __DUPARR(aliasName, OPS_Name); if (__STRCMP(name, "SYSTEM") == 0) { @@ -1320,7 +1320,7 @@ void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) static void OPT_OutName (CHAR *name, LONGINT name__len) { - INTEGER i; + int16 i; CHAR ch; i = 0; do { @@ -1330,7 +1330,7 @@ static void OPT_OutName (CHAR *name, LONGINT name__len) } while (!(ch == 0x00)); } -static void OPT_OutMod (INTEGER mno) +static void OPT_OutMod (int16 mno) { if (OPT_expCtxt.locmno[__X(mno, 64)] < 0) { OPM_SymWInt(16); @@ -1342,9 +1342,9 @@ static void OPT_OutMod (INTEGER mno) } } -static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, LONGINT adr) +static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, int32 adr) { - LONGINT i, j, n; + int32 i, j, n; OPT_Struct btyp = NIL; if (typ->comp == 4) { OPT_OutFlds(typ->link, adr, 0); @@ -1374,7 +1374,7 @@ static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, LONGINT adr) } } -static void OPT_OutFlds (OPT_Object fld, LONGINT adr, BOOLEAN visible) +static void OPT_OutFlds (OPT_Object fld, int32 adr, BOOLEAN visible) { while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { @@ -1529,7 +1529,7 @@ static void OPT_OutStr (OPT_Struct typ) static void OPT_OutConstant (OPT_Object obj) { - INTEGER f; + int16 f; REAL rval; f = obj->typ->form; OPM_SymWInt(f); @@ -1564,7 +1564,7 @@ static void OPT_OutConstant (OPT_Object obj) static void OPT_OutObj (OPT_Object obj) { - INTEGER i, j; + int16 i, j; OPT_ConstExt ext = NIL; if (obj != NIL) { OPT_OutObj(obj->left); @@ -1631,7 +1631,7 @@ static void OPT_OutObj (OPT_Object obj) OPM_SymWInt(33); OPT_OutSign(obj->typ, obj->link); ext = obj->conval->ext; - j = (SYSTEM_INT16)(*ext)[0]; + j = (int16)(*ext)[0]; i = 1; OPM_SymWInt(j); while (i <= j) { @@ -1654,8 +1654,8 @@ static void OPT_OutObj (OPT_Object obj) void OPT_Export (BOOLEAN *ext, BOOLEAN *new) { - INTEGER i; - SHORTINT nofmod; + int16 i; + int8 nofmod; BOOLEAN done; OPT_symExtended = 0; OPT_symNew = 0; @@ -1697,7 +1697,7 @@ void OPT_Export (BOOLEAN *ext, BOOLEAN *new) } } -static void OPT_InitStruct (OPT_Struct *typ, SHORTINT form) +static void OPT_InitStruct (OPT_Struct *typ, int8 form) { *typ = OPT_NewStr(form, 1); (*typ)->ref = form; @@ -1711,7 +1711,7 @@ static void OPT_InitStruct (OPT_Struct *typ, SHORTINT form) (*typ)->idfpdone = 1; } -static void OPT_EnterBoolConst (OPS_Name name, LONGINT value) +static void OPT_EnterBoolConst (OPS_Name name, int32 value) { OPT_Object obj = NIL; OPS_Name name__copy; @@ -1723,7 +1723,7 @@ static void OPT_EnterBoolConst (OPS_Name name, LONGINT value) obj->conval->intval = value; } -static void OPT_EnterTyp (OPS_Name name, SHORTINT form, INTEGER size, OPT_Struct *res) +static void OPT_EnterTyp (OPS_Name name, int8 form, int16 size, OPT_Struct *res) { OPT_Object obj = NIL; OPT_Struct typ = NIL; @@ -1746,7 +1746,7 @@ static void OPT_EnterTyp (OPS_Name name, SHORTINT form, INTEGER size, OPT_Struct *res = typ; } -static void OPT_EnterProc (OPS_Name name, INTEGER num) +static void OPT_EnterProc (OPS_Name name, int16 num) { OPT_Object obj = NIL; OPS_Name name__copy; diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index 307b94e2..480267cc 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -15,7 +15,7 @@ typedef typedef struct OPT_ConstDesc { OPT_ConstExt ext; - LONGINT intval, intval2; + int32 intval, intval2; SET setval; LONGREAL realval; } OPT_ConstDesc; @@ -32,7 +32,7 @@ typedef typedef struct OPT_NodeDesc { OPT_Node left, right, link; - SHORTINT class, subcl; + int8 class, subcl; BOOLEAN readonly; OPT_Struct typ; OPT_Object obj; @@ -44,20 +44,20 @@ typedef OPT_Object left, right, link, scope; OPS_Name name; BOOLEAN leaf; - SHORTINT mode, mnolev, vis, history; + int8 mode, mnolev, vis, history; BOOLEAN used, fpdone; - LONGINT fprint; + int32 fprint; OPT_Struct typ; OPT_Const conval; - LONGINT adr, linkadr; - INTEGER x; + int32 adr, linkadr; + int16 x; } OPT_ObjDesc; typedef struct OPT_StrDesc { - SHORTINT form, comp, mno, extlev; - INTEGER ref, sysflag; - LONGINT n, size, align, txtpos; + int8 form, comp, mno, extlev; + int16 ref, sysflag; + int32 n, size, align, txtpos; BOOLEAN allocated, pbused, pvused; char _prvt0[16]; OPT_Struct BaseTyp; @@ -68,7 +68,7 @@ typedef import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; -import SHORTINT OPT_nofGmod; +import int8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; import BOOLEAN OPT_SYSimported; @@ -81,7 +81,7 @@ import LONGINT *OPT_NodeDesc__typ; import void OPT_Close (void); import void OPT_CloseScope (void); import void OPT_Export (BOOLEAN *ext, BOOLEAN *new); -import void OPT_FPrintErr (OPT_Object obj, INTEGER errcode); +import void OPT_FPrintErr (OPT_Object obj, int16 errcode); import void OPT_FPrintObj (OPT_Object obj); import void OPT_FPrintStr (OPT_Struct typ); import void OPT_Find (OPT_Object *res); @@ -92,14 +92,14 @@ import void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); import void OPT_Init (OPS_Name name, SET opt); import void OPT_Insert (OPS_Name name, OPT_Object *obj); import void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); -import OPT_Struct OPT_IntType (LONGINT size); +import OPT_Struct OPT_IntType (int32 size); import OPT_Const OPT_NewConst (void); import OPT_ConstExt OPT_NewExt (void); -import OPT_Node OPT_NewNode (SHORTINT class); +import OPT_Node OPT_NewNode (int8 class); import OPT_Object OPT_NewObj (void); -import OPT_Struct OPT_NewStr (SHORTINT form, SHORTINT comp); -import void OPT_OpenScope (SHORTINT level, OPT_Object owner); -import OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir); +import OPT_Struct OPT_NewStr (int8 form, int8 comp); +import void OPT_OpenScope (int8 level, OPT_Object owner); +import OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir); import void *OPT__init(void); diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index df62e985..5ef539df 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -7,15 +7,15 @@ typedef struct OPV_ExitInfo { - INTEGER level, label; + int16 level, label; } OPV_ExitInfo; static BOOLEAN OPV_assert, OPV_inxchk, OPV_mainprog, OPV_ansi; -static INTEGER OPV_stamp; -static LONGINT OPV_recno; +static int16 OPV_stamp; +static int32 OPV_recno; static OPV_ExitInfo OPV_exit; -static INTEGER OPV_nofExitLabels; +static int16 OPV_nofExitLabels; static BOOLEAN OPV_naturalAlignment; export LONGINT *OPV_ExitInfo__typ; @@ -23,38 +23,38 @@ export LONGINT *OPV_ExitInfo__typ; static void OPV_ActualPar (OPT_Node n, OPT_Object fp); export void OPV_AdrAndSize (OPT_Object topScope); static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc); -static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec); +static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int16 prec); static void OPV_DefineTDescs (OPT_Node n); -static void OPV_Entier (OPT_Node n, INTEGER prec); +static void OPV_Entier (OPT_Node n, int16 prec); static void OPV_GetTProcNum (OPT_Object obj); static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc); static BOOLEAN OPV_ImplicitReturn (OPT_Node n); -static void OPV_Index (OPT_Node n, OPT_Node d, INTEGER prec, INTEGER dim); +static void OPV_Index (OPT_Node n, OPT_Node d, int16 prec, int16 dim); export void OPV_Init (void); static void OPV_InitTDescs (OPT_Node n); -static void OPV_Len (OPT_Node n, LONGINT dim); +static void OPV_Len (OPT_Node n, int32 dim); export void OPV_Module (OPT_Node prog); -static LONGINT OPV_NaturalAlignment (LONGINT size, LONGINT max); +static int32 OPV_NaturalAlignment (int32 size, int32 max); static void OPV_NewArr (OPT_Node d, OPT_Node x); -static void OPV_ParIntLiteral (LONGINT n, LONGINT size); -static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, INTEGER comp); +static void OPV_ParIntLiteral (int32 n, int32 size); +static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp); static BOOLEAN OPV_SideEffects (OPT_Node n); -static void OPV_SizeCast (LONGINT from, LONGINT to); +static void OPV_SizeCast (int32 from, int32 to); static void OPV_Stamp (OPS_Name s); static OPT_Object OPV_SuperProc (OPT_Node n); static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported); static void OPV_TraverseRecord (OPT_Struct typ); export void OPV_TypSize (OPT_Struct typ); static void OPV_TypeOf (OPT_Node n); -static void OPV_design (OPT_Node n, INTEGER prec); -static void OPV_expr (OPT_Node n, INTEGER prec); +static void OPV_design (OPT_Node n, int16 prec); +static void OPV_expr (OPT_Node n, int16 prec); static void OPV_stat (OPT_Node n, OPT_Object outerProc); -static LONGINT OPV_NaturalAlignment (LONGINT size, LONGINT max) +static int32 OPV_NaturalAlignment (int32 size, int32 max) { - LONGINT _o_result; - LONGINT i; + int32 _o_result; + int32 i; if (size >= max) { _o_result = max; return _o_result; @@ -71,8 +71,8 @@ static LONGINT OPV_NaturalAlignment (LONGINT size, LONGINT max) void OPV_TypSize (OPT_Struct typ) { - INTEGER f, c; - LONGINT offset, size, base, fbase, off0; + int16 f, c; + int32 offset, size, base, fbase, off0; OPT_Object fld = NIL; OPT_Struct btyp = NIL; if (typ == OPT_undftyp) { @@ -118,7 +118,7 @@ void OPV_TypSize (OPT_Struct typ) } typ->size = offset; typ->align = base; - typ->sysflag = __MASK(typ->sysflag, -256) + (SYSTEM_INT16)__ASHL(offset - off0, 8); + typ->sysflag = __MASK(typ->sysflag, -256) + (int16)__ASHL(offset - off0, 8); } else if (c == 2) { OPV_TypSize(typ->BaseTyp); typ->size = typ->n * typ->BaseTyp->size; @@ -156,7 +156,7 @@ void OPV_Init (void) static void OPV_GetTProcNum (OPT_Object obj) { - LONGINT oldPos; + int32 oldPos; OPT_Struct typ = NIL; OPT_Object redef = NIL; oldPos = OPM_errpos; @@ -192,7 +192,7 @@ static void OPV_TraverseRecord (OPT_Struct typ) static void OPV_Stamp (OPS_Name s) { - INTEGER i, j, k; + int16 i, j, k; CHAR n[10]; OPV_stamp += 1; i = 0; @@ -222,7 +222,7 @@ static void OPV_Stamp (OPS_Name s) static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported) { - INTEGER mode; + int16 mode; OPT_Object scope = NIL; OPT_Struct typ = NIL; if (obj != NIL) { @@ -297,9 +297,9 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_sysptrtyp->strobj->linkadr = 2; } -static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, INTEGER comp) +static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp) { - INTEGER _o_result; + int16 _o_result; switch (class) { case 7: case 0: case 2: case 4: case 9: case 13: @@ -432,7 +432,7 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN __RETCHK; } -static void OPV_Len (OPT_Node n, LONGINT dim) +static void OPV_Len (OPT_Node n, int32 dim) { while ((n->class == 4 && n->typ->comp == 3)) { dim += 1; @@ -461,7 +461,7 @@ static BOOLEAN OPV_SideEffects (OPT_Node n) __RETCHK; } -static void OPV_Entier (OPT_Node n, INTEGER prec) +static void OPV_Entier (OPT_Node n, int16 prec) { if (__IN(n->typ->form, 0x60)) { OPM_WriteString((CHAR*)"__ENTIER(", 10); @@ -472,34 +472,18 @@ static void OPV_Entier (OPT_Node n, INTEGER prec) } } -static void OPV_SizeCast (LONGINT from, LONGINT to) +static void OPV_SizeCast (int32 from, int32 to) { if ((from != to && (from > 4 || to != 4))) { - switch (to) { - case 1: - OPM_WriteString((CHAR*)"(SYSTEM_INT8)", 14); - break; - case 2: - OPM_WriteString((CHAR*)"(SYSTEM_INT16)", 15); - break; - case 4: - OPM_WriteString((CHAR*)"(SYSTEM_INT32)", 15); - break; - case 8: - OPM_WriteString((CHAR*)"(SYSTEM_INT64)", 15); - break; - default: - OPM_LogWStr((CHAR*)"Unhandled case in OPC.SizeCast, to = ", 38); - OPM_LogWNum(to, 1); - OPM_LogWLn(); - break; - } + OPM_WriteString((CHAR*)"(int", 5); + OPM_WriteInt(__ASHL(to, 3)); + OPM_WriteString((CHAR*)")", 2); } } -static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec) +static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int16 prec) { - INTEGER from, to; + int16 from, to; from = n->typ->form; to = newtype->form; if (to == 7) { @@ -561,7 +545,7 @@ static void OPV_TypeOf (OPT_Node n) } } -static void OPV_Index (OPT_Node n, OPT_Node d, INTEGER prec, INTEGER dim) +static void OPV_Index (OPT_Node n, OPT_Node d, int16 prec, int16 dim) { if (!OPV_inxchk || (n->right->class == 7 && (n->right->conval->intval == 0 || n->left->typ->comp != 3))) { OPV_expr(n->right, prec); @@ -578,18 +562,18 @@ static void OPV_Index (OPT_Node n, OPT_Node d, INTEGER prec, INTEGER dim) } } -static void OPV_design (OPT_Node n, INTEGER prec) +static void OPV_design (OPT_Node n, int16 prec) { OPT_Object obj = NIL; OPT_Struct typ = NIL; - INTEGER class, designPrec, comp; + int16 class, designPrec, comp; OPT_Node d = NIL, x = NIL; - INTEGER dims, i, _for__28; + int16 dims, i, _for__28; comp = n->typ->comp; obj = n->obj; class = n->class; designPrec = OPV_Precedence(class, n->subcl, n->typ->form, comp); - if ((((((class == 0 && obj->mnolev > 0)) && (SYSTEM_INT16)obj->mnolev != OPM_level)) && prec == 10)) { + if ((((((class == 0 && obj->mnolev > 0)) && (int16)obj->mnolev != OPM_level)) && prec == 10)) { designPrec = 9; } if (prec > designPrec) { @@ -688,7 +672,7 @@ static void OPV_design (OPT_Node n, INTEGER prec) if (__IN(3, OPM_opt)) { if (typ->comp == 4) { OPM_WriteString((CHAR*)"__GUARDR(", 10); - if ((SYSTEM_INT16)obj->mnolev != OPM_level) { + if ((int16)obj->mnolev != OPM_level) { OPM_WriteStringVar((void*)obj->scope->name, 256); OPM_WriteString((CHAR*)"__curr->", 9); OPC_Ident(obj); @@ -757,7 +741,7 @@ static void OPV_design (OPT_Node n, INTEGER prec) } } -static void OPV_ParIntLiteral (LONGINT n, LONGINT size) +static void OPV_ParIntLiteral (int32 n, int32 size) { if (OPV_ansi) { OPM_WriteInt(n); @@ -769,7 +753,7 @@ static void OPV_ParIntLiteral (LONGINT n, LONGINT size) static void OPV_ActualPar (OPT_Node n, OPT_Object fp) { OPT_Struct typ = NIL, aptyp = NIL; - INTEGER comp, form, mode, prec, dim; + int16 comp, form, mode, prec, dim; OPM_Write('('); while (n != NIL) { typ = fp->typ; @@ -868,9 +852,9 @@ static OPT_Object OPV_SuperProc (OPT_Node n) return _o_result; } -static void OPV_expr (OPT_Node n, INTEGER prec) +static void OPV_expr (OPT_Node n, int16 prec) { - INTEGER class, subclass, form, exprPrec; + int16 class, subclass, form, exprPrec; OPT_Struct typ = NIL; OPT_Node l = NIL, r = NIL; OPT_Object proc = NIL; @@ -1186,7 +1170,7 @@ static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) OPT_Node if_ = NIL; OPT_Object obj = NIL; OPT_Struct typ = NIL; - LONGINT adr; + int32 adr; if_ = n->left; while (if_ != NIL) { OPM_WriteString((CHAR*)"if ", 4); @@ -1236,8 +1220,8 @@ static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc) { OPT_Node switchCase = NIL, label = NIL; - LONGINT low, high; - INTEGER form, i; + int32 low, high; + int16 form, i; OPM_WriteString((CHAR*)"switch ", 8); OPV_expr(n->left, 12); OPM_Write(' '); @@ -1304,7 +1288,7 @@ static BOOLEAN OPV_ImplicitReturn (OPT_Node n) static void OPV_NewArr (OPT_Node d, OPT_Node x) { OPT_Struct typ = NIL, base = NIL; - INTEGER nofdim, nofdyn; + int16 nofdim, nofdyn; typ = d->typ->BaseTyp; base = typ; nofdim = 0; diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index c1158d0f..b8a6b5a5 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -8,90 +8,90 @@ typedef Platform_ArgPtr (*Platform_ArgVec)[1024]; typedef - LONGINT (*Platform_ArgVecPtr)[1]; + int32 (*Platform_ArgVecPtr)[1]; typedef CHAR (*Platform_EnvPtr)[1024]; typedef struct Platform_FileIdentity { - LONGINT volume, indexhigh, indexlow, mtimehigh, mtimelow; + int32 volume, indexhigh, indexlow, mtimehigh, mtimelow; } Platform_FileIdentity; typedef - void (*Platform_HaltProcedure)(LONGINT); + void (*Platform_HaltProcedure)(int32); typedef - void (*Platform_SignalHandler)(INTEGER); + void (*Platform_SignalHandler)(int16); export BOOLEAN Platform_LittleEndian; -export LONGINT Platform_MainStackFrame, Platform_HaltCode; -export INTEGER Platform_PID; +export int32 Platform_MainStackFrame, Platform_HaltCode; +export int16 Platform_PID; export CHAR Platform_CWD[4096]; -export INTEGER Platform_ArgCount; -export LONGINT Platform_ArgVector; +export int16 Platform_ArgCount; +export int32 Platform_ArgVector; static Platform_HaltProcedure Platform_HaltHandler; -static LONGINT Platform_TimeStart; -export INTEGER Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; -export LONGINT Platform_StdIn, Platform_StdOut, Platform_StdErr; +static int32 Platform_TimeStart; +export int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; +export int32 Platform_StdIn, Platform_StdOut, Platform_StdErr; static Platform_SignalHandler Platform_InterruptHandler; export CHAR Platform_nl[3]; export LONGINT *Platform_FileIdentity__typ; -export BOOLEAN Platform_Absent (INTEGER e); -export INTEGER Platform_ArgPos (CHAR *s, LONGINT s__len); -export void Platform_AssertFail (LONGINT code); -export INTEGER Platform_Chdir (CHAR *n, LONGINT n__len); -export INTEGER Platform_Close (LONGINT h); -export BOOLEAN Platform_ConnectionFailed (INTEGER e); -export void Platform_Delay (LONGINT ms); -export BOOLEAN Platform_DifferentFilesystems (INTEGER e); -static void Platform_DisplayHaltCode (LONGINT code); -export INTEGER Platform_Error (void); -export void Platform_Exit (INTEGER code); -export void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len); -export void Platform_GetClock (LONGINT *t, LONGINT *d); +export BOOLEAN Platform_Absent (int16 e); +export int16 Platform_ArgPos (CHAR *s, LONGINT s__len); +export void Platform_AssertFail (int32 code); +export int16 Platform_Chdir (CHAR *n, LONGINT n__len); +export int16 Platform_Close (int32 h); +export BOOLEAN Platform_ConnectionFailed (int16 e); +export void Platform_Delay (int32 ms); +export BOOLEAN Platform_DifferentFilesystems (int16 e); +static void Platform_DisplayHaltCode (int32 code); +export int16 Platform_Error (void); +export void Platform_Exit (int16 code); +export void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len); +export void Platform_GetClock (int32 *t, int32 *d); export void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); -export void Platform_GetIntArg (INTEGER n, LONGINT *val); -export void Platform_GetTimeOfDay (LONGINT *sec, LONGINT *usec); -export void Platform_Halt (LONGINT code); -export INTEGER Platform_Identify (LONGINT h, Platform_FileIdentity *identity, LONGINT *identity__typ); -export INTEGER Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); -export BOOLEAN Platform_Inaccessible (INTEGER e); -export void Platform_Init (INTEGER argc, LONGINT argvadr); -export void Platform_MTimeAsClock (Platform_FileIdentity i, LONGINT *t, LONGINT *d); -export INTEGER Platform_New (CHAR *n, LONGINT n__len, LONGINT *h); -export BOOLEAN Platform_NoSuchDirectory (INTEGER e); -export LONGINT Platform_OSAllocate (LONGINT size); -export void Platform_OSFree (LONGINT address); -export INTEGER Platform_OldRO (CHAR *n, LONGINT n__len, LONGINT *h); -export INTEGER Platform_OldRW (CHAR *n, LONGINT n__len, LONGINT *h); -export INTEGER Platform_Read (LONGINT h, LONGINT p, LONGINT l, LONGINT *n); -export INTEGER Platform_ReadBuf (LONGINT h, SYSTEM_BYTE *b, LONGINT b__len, LONGINT *n); -export INTEGER Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); +export void Platform_GetIntArg (int16 n, int32 *val); +export void Platform_GetTimeOfDay (int32 *sec, int32 *usec); +export void Platform_Halt (int32 code); +export int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, LONGINT *identity__typ); +export int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); +export BOOLEAN Platform_Inaccessible (int16 e); +export void Platform_Init (int16 argc, int32 argvadr); +export void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); +export int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); +export BOOLEAN Platform_NoSuchDirectory (int16 e); +export int32 Platform_OSAllocate (int32 size); +export void Platform_OSFree (int32 address); +export int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); +export int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); +export int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n); +export int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n); +export int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); export BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); export BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); -export INTEGER Platform_Seek (LONGINT h, LONGINT o, INTEGER r); +export int16 Platform_Seek (int32 h, int32 o, int16 r); export void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); export void Platform_SetHalt (Platform_HaltProcedure p); export void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Platform_FileIdentity source); -export INTEGER Platform_Size (LONGINT h, LONGINT *l); -export INTEGER Platform_Sync (LONGINT h); -export INTEGER Platform_System (CHAR *cmd, LONGINT cmd__len); +export int16 Platform_Size (int32 h, int32 *l); +export int16 Platform_Sync (int32 h); +export int16 Platform_System (CHAR *cmd, LONGINT cmd__len); static void Platform_TestLittleEndian (void); -export LONGINT Platform_Time (void); -export BOOLEAN Platform_TimedOut (INTEGER e); -export BOOLEAN Platform_TooManyFiles (INTEGER e); -export INTEGER Platform_Truncate (LONGINT h, LONGINT limit); -export INTEGER Platform_Unlink (CHAR *n, LONGINT n__len); -export INTEGER Platform_Write (LONGINT h, LONGINT p, LONGINT l); -static void Platform_YMDHMStoClock (INTEGER ye, INTEGER mo, INTEGER da, INTEGER ho, INTEGER mi, INTEGER se, LONGINT *t, LONGINT *d); +export int32 Platform_Time (void); +export BOOLEAN Platform_TimedOut (int16 e); +export BOOLEAN Platform_TooManyFiles (int16 e); +export int16 Platform_Truncate (int32 h, int32 limit); +export int16 Platform_Unlink (CHAR *n, LONGINT n__len); +export int16 Platform_Write (int32 h, int32 p, int32 l); +static void Platform_YMDHMStoClock (int16 ye, int16 mo, int16 da, int16 ho, int16 mi, int16 se, int32 *t, int32 *d); static void Platform_errch (CHAR c); -static void Platform_errint (LONGINT l); +static void Platform_errint (int32 l); static void Platform_errln (void); -static void Platform_errposint (LONGINT l); +static void Platform_errposint (int32 l); export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); #include "WindowsWrapper.h" @@ -175,68 +175,68 @@ extern void Heap_InitHeap(); #define Platform_waitForProcess() (INTEGER)WaitForSingleObject(pi.hProcess, INFINITE) #define Platform_writefile(fd, p, l) (INTEGER)WriteFile((HANDLE)(SYSTEM_ADRINT)fd, (void*)(SYSTEM_ADRINT)(p), (DWORD)l, 0,0) -BOOLEAN Platform_TooManyFiles (INTEGER e) +BOOLEAN Platform_TooManyFiles (int16 e) { BOOLEAN _o_result; _o_result = e == Platform_ERRORTOOMANYOPENFILES(); return _o_result; } -BOOLEAN Platform_NoSuchDirectory (INTEGER e) +BOOLEAN Platform_NoSuchDirectory (int16 e) { BOOLEAN _o_result; _o_result = e == Platform_ERRORPATHNOTFOUND(); return _o_result; } -BOOLEAN Platform_DifferentFilesystems (INTEGER e) +BOOLEAN Platform_DifferentFilesystems (int16 e) { BOOLEAN _o_result; _o_result = e == Platform_ERRORNOTSAMEDEVICE(); return _o_result; } -BOOLEAN Platform_Inaccessible (INTEGER e) +BOOLEAN Platform_Inaccessible (int16 e) { BOOLEAN _o_result; _o_result = ((e == Platform_ERRORACCESSDENIED() || e == Platform_ERRORWRITEPROTECT()) || e == Platform_ERRORNOTREADY()) || e == Platform_ERRORSHARINGVIOLATION(); return _o_result; } -BOOLEAN Platform_Absent (INTEGER e) +BOOLEAN Platform_Absent (int16 e) { BOOLEAN _o_result; _o_result = e == Platform_ERRORFILENOTFOUND() || e == Platform_ERRORPATHNOTFOUND(); return _o_result; } -BOOLEAN Platform_TimedOut (INTEGER e) +BOOLEAN Platform_TimedOut (int16 e) { BOOLEAN _o_result; _o_result = e == Platform_ETIMEDOUT(); return _o_result; } -BOOLEAN Platform_ConnectionFailed (INTEGER e) +BOOLEAN Platform_ConnectionFailed (int16 e) { BOOLEAN _o_result; _o_result = ((e == Platform_ECONNREFUSED() || e == Platform_ECONNABORTED()) || e == Platform_ENETUNREACH()) || e == Platform_EHOSTUNREACH(); return _o_result; } -LONGINT Platform_OSAllocate (LONGINT size) +int32 Platform_OSAllocate (int32 size) { - LONGINT _o_result; + int32 _o_result; _o_result = Platform_allocate(size); return _o_result; } -void Platform_OSFree (LONGINT address) +void Platform_OSFree (int32 address) { Platform_free(address); } -void Platform_Init (INTEGER argc, LONGINT argvadr) +void Platform_Init (int16 argc, int32 argvadr) { Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; @@ -251,7 +251,7 @@ BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__le { BOOLEAN _o_result; CHAR buf[4096]; - INTEGER res; + int16 res; __DUP(var, var__len, CHAR); res = Platform_getenv(var, var__len, (void*)buf, 4096); if ((res > 0 && res < 4096)) { @@ -276,7 +276,7 @@ void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len) __DEL(var); } -void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len) +void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { @@ -285,10 +285,10 @@ void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len) } } -void Platform_GetIntArg (INTEGER n, LONGINT *val) +void Platform_GetIntArg (int16 n, int32 *val) { CHAR s[64]; - LONGINT k, d, i; + int32 k, d, i; s[0] = 0x00; Platform_GetArg(n, (void*)s, 64); i = 0; @@ -296,11 +296,11 @@ void Platform_GetIntArg (INTEGER n, LONGINT *val) i = 1; } k = 0; - d = (SYSTEM_INT16)s[__X(i, 64)] - 48; + d = (int16)s[__X(i, 64)] - 48; while ((d >= 0 && d <= 9)) { k = k * 10 + d; i += 1; - d = (SYSTEM_INT16)s[__X(i, 64)] - 48; + d = (int16)s[__X(i, 64)] - 48; } if (s[0] == '-') { k = -k; @@ -311,10 +311,10 @@ void Platform_GetIntArg (INTEGER n, LONGINT *val) } } -INTEGER Platform_ArgPos (CHAR *s, LONGINT s__len) +int16 Platform_ArgPos (CHAR *s, LONGINT s__len) { - INTEGER _o_result; - INTEGER i; + int16 _o_result; + int16 i; CHAR arg[256]; __DUP(s, s__len, CHAR); i = 0; @@ -332,28 +332,28 @@ void Platform_SetBadInstructionHandler (Platform_SignalHandler handler) { } -static void Platform_YMDHMStoClock (INTEGER ye, INTEGER mo, INTEGER da, INTEGER ho, INTEGER mi, INTEGER se, LONGINT *t, LONGINT *d) +static void Platform_YMDHMStoClock (int16 ye, int16 mo, int16 da, int16 ho, int16 mi, int16 se, int32 *t, int32 *d) { *d = (__ASHL((int)__MOD(ye, 100), 9) + __ASHL((mo + 1), 5)) + da; *t = (__ASHL(ho, 12) + __ASHL(mi, 6)) + se; } -void Platform_GetClock (LONGINT *t, LONGINT *d) +void Platform_GetClock (int32 *t, int32 *d) { Platform_getLocalTime(); Platform_YMDHMStoClock(Platform_styear(), Platform_stmon(), Platform_stmday(), Platform_sthour(), Platform_stmin(), Platform_stsec(), &*t, &*d); } -LONGINT Platform_Time (void) +int32 Platform_Time (void) { - LONGINT _o_result; - LONGINT ms; + int32 _o_result; + int32 ms; ms = Platform_GetTickCount(); _o_result = (int)__MOD(ms - Platform_TimeStart, 2147483647); return _o_result; } -void Platform_Delay (LONGINT ms) +void Platform_Delay (int32 ms) { while (ms > 30000) { Platform_sleep(30000); @@ -364,7 +364,7 @@ void Platform_Delay (LONGINT ms) } } -void Platform_GetTimeOfDay (LONGINT *sec, LONGINT *usec) +void Platform_GetTimeOfDay (int32 *sec, int32 *usec) { Platform_getLocalTime(); Platform_stToFt(); @@ -374,10 +374,10 @@ void Platform_GetTimeOfDay (LONGINT *sec, LONGINT *usec) *usec = Platform_uluSec(); } -INTEGER Platform_System (CHAR *cmd, LONGINT cmd__len) +int16 Platform_System (CHAR *cmd, LONGINT cmd__len) { - INTEGER _o_result; - INTEGER result; + int16 _o_result; + int16 result; __DUP(cmd, cmd__len, CHAR); result = 127; Platform_startupInfo(); @@ -393,17 +393,17 @@ INTEGER Platform_System (CHAR *cmd, LONGINT cmd__len) return _o_result; } -INTEGER Platform_Error (void) +int16 Platform_Error (void) { - INTEGER _o_result; + int16 _o_result; _o_result = Platform_err(); return _o_result; } -INTEGER Platform_OldRO (CHAR *n, LONGINT n__len, LONGINT *h) +int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h) { - INTEGER _o_result; - LONGINT fd; + int16 _o_result; + int32 fd; fd = Platform_openro(n, n__len); if (fd == Platform_invalidHandleValue()) { _o_result = Platform_err(); @@ -416,10 +416,10 @@ INTEGER Platform_OldRO (CHAR *n, LONGINT n__len, LONGINT *h) __RETCHK; } -INTEGER Platform_OldRW (CHAR *n, LONGINT n__len, LONGINT *h) +int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h) { - INTEGER _o_result; - LONGINT fd; + int16 _o_result; + int32 fd; fd = Platform_openrw(n, n__len); if (fd == Platform_invalidHandleValue()) { _o_result = Platform_err(); @@ -432,10 +432,10 @@ INTEGER Platform_OldRW (CHAR *n, LONGINT n__len, LONGINT *h) __RETCHK; } -INTEGER Platform_New (CHAR *n, LONGINT n__len, LONGINT *h) +int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h) { - INTEGER _o_result; - LONGINT fd; + int16 _o_result; + int32 fd; fd = Platform_opennew(n, n__len); if (fd == Platform_invalidHandleValue()) { _o_result = Platform_err(); @@ -448,9 +448,9 @@ INTEGER Platform_New (CHAR *n, LONGINT n__len, LONGINT *h) __RETCHK; } -INTEGER Platform_Close (LONGINT h) +int16 Platform_Close (int32 h) { - INTEGER _o_result; + int16 _o_result; if (Platform_closeHandle(h) == 0) { _o_result = Platform_err(); return _o_result; @@ -461,9 +461,9 @@ INTEGER Platform_Close (LONGINT h) __RETCHK; } -INTEGER Platform_Identify (LONGINT h, Platform_FileIdentity *identity, LONGINT *identity__typ) +int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, LONGINT *identity__typ) { - INTEGER _o_result; + int16 _o_result; Platform_byHandleFileInformation(); if (Platform_getFileInformationByHandle(h) == 0) { _o_result = Platform_err(); @@ -478,11 +478,11 @@ INTEGER Platform_Identify (LONGINT h, Platform_FileIdentity *identity, LONGINT * return _o_result; } -INTEGER Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ) +int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ) { - INTEGER _o_result; - LONGINT h; - INTEGER e, i; + int16 _o_result; + int32 h; + int16 e, i; __DUP(n, n__len, CHAR); e = Platform_OldRO((void*)n, n__len, &h); if (e != 0) { @@ -517,16 +517,16 @@ void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Pla (*target).mtimelow = source.mtimelow; } -void Platform_MTimeAsClock (Platform_FileIdentity i, LONGINT *t, LONGINT *d) +void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d) { Platform_identityToFileTime(i); Platform_fileTimeToSysTime(); Platform_YMDHMStoClock(Platform_styear(), Platform_stmon(), Platform_stmday(), Platform_sthour(), Platform_stmin(), Platform_stsec(), &*t, &*d); } -INTEGER Platform_Size (LONGINT h, LONGINT *l) +int16 Platform_Size (int32 h, int32 *l) { - INTEGER _o_result; + int16 _o_result; Platform_largeInteger(); if (Platform_getFileSize(h) == 0) { _o_result = Platform_err(); @@ -537,10 +537,10 @@ INTEGER Platform_Size (LONGINT h, LONGINT *l) return _o_result; } -INTEGER Platform_Read (LONGINT h, LONGINT p, LONGINT l, LONGINT *n) +int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n) { - INTEGER _o_result; - INTEGER result; + int16 _o_result; + int16 result; *n = 0; result = Platform_readfile(h, p, l, &*n); if (result == 0) { @@ -554,10 +554,10 @@ INTEGER Platform_Read (LONGINT h, LONGINT p, LONGINT l, LONGINT *n) __RETCHK; } -INTEGER Platform_ReadBuf (LONGINT h, SYSTEM_BYTE *b, LONGINT b__len, LONGINT *n) +int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n) { - INTEGER _o_result; - INTEGER result; + int16 _o_result; + int16 result; *n = 0; result = Platform_readfile(h, (SYSTEM_ADRINT)b, b__len, &*n); if (result == 0) { @@ -571,9 +571,9 @@ INTEGER Platform_ReadBuf (LONGINT h, SYSTEM_BYTE *b, LONGINT b__len, LONGINT *n) __RETCHK; } -INTEGER Platform_Write (LONGINT h, LONGINT p, LONGINT l) +int16 Platform_Write (int32 h, int32 p, int32 l) { - INTEGER _o_result; + int16 _o_result; if (Platform_writefile(h, p, l) == 0) { _o_result = Platform_err(); return _o_result; @@ -584,9 +584,9 @@ INTEGER Platform_Write (LONGINT h, LONGINT p, LONGINT l) __RETCHK; } -INTEGER Platform_Sync (LONGINT h) +int16 Platform_Sync (int32 h) { - INTEGER _o_result; + int16 _o_result; if (Platform_flushFileBuffers(h) == 0) { _o_result = Platform_err(); return _o_result; @@ -597,10 +597,10 @@ INTEGER Platform_Sync (LONGINT h) __RETCHK; } -INTEGER Platform_Seek (LONGINT h, LONGINT o, INTEGER r) +int16 Platform_Seek (int32 h, int32 o, int16 r) { - INTEGER _o_result; - INTEGER rc; + int16 _o_result; + int16 rc; Platform_largeInteger(); Platform_setFilePointerEx(h, o, r, &rc); if (rc == 0) { @@ -613,11 +613,11 @@ INTEGER Platform_Seek (LONGINT h, LONGINT o, INTEGER r) __RETCHK; } -INTEGER Platform_Truncate (LONGINT h, LONGINT limit) +int16 Platform_Truncate (int32 h, int32 limit) { - INTEGER _o_result; - INTEGER rc; - LONGINT oldpos; + int16 _o_result; + int16 rc; + int32 oldpos; Platform_largeInteger(); Platform_getFilePos(h, &oldpos, &rc); if (rc == 0) { @@ -642,9 +642,9 @@ INTEGER Platform_Truncate (LONGINT h, LONGINT limit) return _o_result; } -INTEGER Platform_Unlink (CHAR *n, LONGINT n__len) +int16 Platform_Unlink (CHAR *n, LONGINT n__len) { - INTEGER _o_result; + int16 _o_result; if (Platform_deleteFile(n, n__len) == 0) { _o_result = Platform_err(); return _o_result; @@ -655,10 +655,10 @@ INTEGER Platform_Unlink (CHAR *n, LONGINT n__len) __RETCHK; } -INTEGER Platform_Chdir (CHAR *n, LONGINT n__len) +int16 Platform_Chdir (CHAR *n, LONGINT n__len) { - INTEGER _o_result; - INTEGER r; + int16 _o_result; + int16 r; r = Platform_setCurrentDirectory(n, n__len); if (r == 0) { _o_result = Platform_err(); @@ -669,9 +669,9 @@ INTEGER Platform_Chdir (CHAR *n, LONGINT n__len) return _o_result; } -INTEGER Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) +int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) { - INTEGER _o_result; + int16 _o_result; if (Platform_moveFile(o, o__len, n, n__len) == 0) { _o_result = Platform_err(); return _o_result; @@ -682,7 +682,7 @@ INTEGER Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) __RETCHK; } -void Platform_Exit (INTEGER code) +void Platform_Exit (int16 code) { Platform_exit(code); } @@ -698,7 +698,7 @@ static void Platform_errln (void) Platform_errch(0x0a); } -static void Platform_errposint (LONGINT l) +static void Platform_errposint (int32 l) { if (l > 10) { Platform_errposint(__DIV(l, 10)); @@ -706,7 +706,7 @@ static void Platform_errposint (LONGINT l) Platform_errch((CHAR)(48 + (int)__MOD(l, 10))); } -static void Platform_errint (LONGINT l) +static void Platform_errint (int32 l) { if (l < 0) { Platform_errch('-'); @@ -715,7 +715,7 @@ static void Platform_errint (LONGINT l) Platform_errposint(l); } -static void Platform_DisplayHaltCode (LONGINT code) +static void Platform_DisplayHaltCode (int32 code) { switch (code) { case -1: @@ -756,9 +756,9 @@ static void Platform_DisplayHaltCode (LONGINT code) } } -void Platform_Halt (LONGINT code) +void Platform_Halt (int32 code) { - INTEGER e; + int16 e; Platform_HaltCode = code; if (Platform_HaltHandler != NIL) { (*Platform_HaltHandler)(code); @@ -770,12 +770,12 @@ void Platform_Halt (LONGINT code) Platform_DisplayHaltCode(code); } Platform_errln(); - Platform_exit(__VAL(INTEGER, code)); + Platform_exit(__VAL(int16, code)); } -void Platform_AssertFail (LONGINT code) +void Platform_AssertFail (int32 code) { - INTEGER e; + int16 e; Platform_errstring((CHAR*)"Assertion failure.", 19); if (code != 0) { Platform_errstring((CHAR*)" ASSERT code ", 14); @@ -783,7 +783,7 @@ void Platform_AssertFail (LONGINT code) Platform_errstring((CHAR*)".", 2); } Platform_errln(); - Platform_exit(__VAL(INTEGER, code)); + Platform_exit(__VAL(int16, code)); } void Platform_SetHalt (Platform_HaltProcedure p) @@ -793,7 +793,7 @@ void Platform_SetHalt (Platform_HaltProcedure p) static void Platform_TestLittleEndian (void) { - INTEGER i; + int16 i; i = 1; __GET((SYSTEM_ADRINT)&i, Platform_LittleEndian, BOOLEAN); } diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index 7deb4830..23922225 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -12,69 +12,69 @@ typedef } Platform_FileIdentity; typedef - void (*Platform_HaltProcedure)(LONGINT); + void (*Platform_HaltProcedure)(int32); typedef - void (*Platform_SignalHandler)(INTEGER); + void (*Platform_SignalHandler)(int16); import BOOLEAN Platform_LittleEndian; -import LONGINT Platform_MainStackFrame, Platform_HaltCode; -import INTEGER Platform_PID; +import int32 Platform_MainStackFrame, Platform_HaltCode; +import int16 Platform_PID; import CHAR Platform_CWD[4096]; -import INTEGER Platform_ArgCount; -import LONGINT Platform_ArgVector; -import INTEGER Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; -import LONGINT Platform_StdIn, Platform_StdOut, Platform_StdErr; +import int16 Platform_ArgCount; +import int32 Platform_ArgVector; +import int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; +import int32 Platform_StdIn, Platform_StdOut, Platform_StdErr; import CHAR Platform_nl[3]; import LONGINT *Platform_FileIdentity__typ; -import BOOLEAN Platform_Absent (INTEGER e); -import INTEGER Platform_ArgPos (CHAR *s, LONGINT s__len); -import void Platform_AssertFail (LONGINT code); -import INTEGER Platform_Chdir (CHAR *n, LONGINT n__len); -import INTEGER Platform_Close (LONGINT h); -import BOOLEAN Platform_ConnectionFailed (INTEGER e); -import void Platform_Delay (LONGINT ms); -import BOOLEAN Platform_DifferentFilesystems (INTEGER e); -import INTEGER Platform_Error (void); -import void Platform_Exit (INTEGER code); -import void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len); -import void Platform_GetClock (LONGINT *t, LONGINT *d); +import BOOLEAN Platform_Absent (int16 e); +import int16 Platform_ArgPos (CHAR *s, LONGINT s__len); +import void Platform_AssertFail (int32 code); +import int16 Platform_Chdir (CHAR *n, LONGINT n__len); +import int16 Platform_Close (int32 h); +import BOOLEAN Platform_ConnectionFailed (int16 e); +import void Platform_Delay (int32 ms); +import BOOLEAN Platform_DifferentFilesystems (int16 e); +import int16 Platform_Error (void); +import void Platform_Exit (int16 code); +import void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len); +import void Platform_GetClock (int32 *t, int32 *d); import void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); -import void Platform_GetIntArg (INTEGER n, LONGINT *val); -import void Platform_GetTimeOfDay (LONGINT *sec, LONGINT *usec); -import void Platform_Halt (LONGINT code); -import INTEGER Platform_Identify (LONGINT h, Platform_FileIdentity *identity, LONGINT *identity__typ); -import INTEGER Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); -import BOOLEAN Platform_Inaccessible (INTEGER e); -import void Platform_Init (INTEGER argc, LONGINT argvadr); -import void Platform_MTimeAsClock (Platform_FileIdentity i, LONGINT *t, LONGINT *d); -import INTEGER Platform_New (CHAR *n, LONGINT n__len, LONGINT *h); -import BOOLEAN Platform_NoSuchDirectory (INTEGER e); -import LONGINT Platform_OSAllocate (LONGINT size); -import void Platform_OSFree (LONGINT address); -import INTEGER Platform_OldRO (CHAR *n, LONGINT n__len, LONGINT *h); -import INTEGER Platform_OldRW (CHAR *n, LONGINT n__len, LONGINT *h); -import INTEGER Platform_Read (LONGINT h, LONGINT p, LONGINT l, LONGINT *n); -import INTEGER Platform_ReadBuf (LONGINT h, SYSTEM_BYTE *b, LONGINT b__len, LONGINT *n); -import INTEGER Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); +import void Platform_GetIntArg (int16 n, int32 *val); +import void Platform_GetTimeOfDay (int32 *sec, int32 *usec); +import void Platform_Halt (int32 code); +import int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, LONGINT *identity__typ); +import int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); +import BOOLEAN Platform_Inaccessible (int16 e); +import void Platform_Init (int16 argc, int32 argvadr); +import void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); +import int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); +import BOOLEAN Platform_NoSuchDirectory (int16 e); +import int32 Platform_OSAllocate (int32 size); +import void Platform_OSFree (int32 address); +import int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); +import int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); +import int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n); +import int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n); +import int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); import BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); import BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); -import INTEGER Platform_Seek (LONGINT h, LONGINT o, INTEGER r); +import int16 Platform_Seek (int32 h, int32 o, int16 r); import void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); import void Platform_SetHalt (Platform_HaltProcedure p); import void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Platform_FileIdentity source); -import INTEGER Platform_Size (LONGINT h, LONGINT *l); -import INTEGER Platform_Sync (LONGINT h); -import INTEGER Platform_System (CHAR *cmd, LONGINT cmd__len); -import LONGINT Platform_Time (void); -import BOOLEAN Platform_TimedOut (INTEGER e); -import BOOLEAN Platform_TooManyFiles (INTEGER e); -import INTEGER Platform_Truncate (LONGINT h, LONGINT limit); -import INTEGER Platform_Unlink (CHAR *n, LONGINT n__len); -import INTEGER Platform_Write (LONGINT h, LONGINT p, LONGINT l); +import int16 Platform_Size (int32 h, int32 *l); +import int16 Platform_Sync (int32 h); +import int16 Platform_System (CHAR *cmd, LONGINT cmd__len); +import int32 Platform_Time (void); +import BOOLEAN Platform_TimedOut (int16 e); +import BOOLEAN Platform_TooManyFiles (int16 e); +import int16 Platform_Truncate (int32 h, int32 limit); +import int16 Platform_Unlink (CHAR *n, LONGINT n__len); +import int16 Platform_Write (int32 h, int32 p, int32 l); import BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); import void *Platform__init(void); diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 28a855aa..4b500170 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -5,19 +5,19 @@ static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LONGINT d__len); -export void Reals_Convert (REAL x, INTEGER n, CHAR *d, LONGINT d__len); +export void Reals_Convert (REAL x, int16 n, CHAR *d, LONGINT d__len); export void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len); export void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len); -export void Reals_ConvertL (LONGREAL x, INTEGER n, CHAR *d, LONGINT d__len); -export INTEGER Reals_Expo (REAL x); -export INTEGER Reals_ExpoL (LONGREAL x); -export void Reals_SetExpo (REAL *x, INTEGER ex); -export REAL Reals_Ten (INTEGER e); -export LONGREAL Reals_TenL (INTEGER e); -static CHAR Reals_ToHex (INTEGER i); +export void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len); +export int16 Reals_Expo (REAL x); +export int16 Reals_ExpoL (LONGREAL x); +export void Reals_SetExpo (REAL *x, int16 ex); +export REAL Reals_Ten (int16 e); +export LONGREAL Reals_TenL (int16 e); +static CHAR Reals_ToHex (int16 i); -REAL Reals_Ten (INTEGER e) +REAL Reals_Ten (int16 e) { REAL _o_result; LONGREAL r, power; @@ -34,7 +34,7 @@ REAL Reals_Ten (INTEGER e) return _o_result; } -LONGREAL Reals_TenL (INTEGER e) +LONGREAL Reals_TenL (int16 e) { LONGREAL _o_result; LONGREAL r, power; @@ -54,43 +54,43 @@ LONGREAL Reals_TenL (INTEGER e) __RETCHK; } -INTEGER Reals_Expo (REAL x) +int16 Reals_Expo (REAL x) { - INTEGER _o_result; - INTEGER i; - __GET((SYSTEM_ADRINT)&x + 2, i, INTEGER); + int16 _o_result; + int16 i; + __GET((SYSTEM_ADRINT)&x + 2, i, int16); _o_result = __MASK(__ASHR(i, 7), -256); return _o_result; } -void Reals_SetExpo (REAL *x, INTEGER ex) +void Reals_SetExpo (REAL *x, int16 ex) { CHAR c; __GET((SYSTEM_ADRINT)x + 3, c, CHAR); - __PUT((SYSTEM_ADRINT)x + 3, (CHAR)(__ASHL(__ASHR((SYSTEM_INT16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __PUT((SYSTEM_ADRINT)x + 3, (CHAR)(__ASHL(__ASHR((int16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); __GET((SYSTEM_ADRINT)x + 2, c, CHAR); - __PUT((SYSTEM_ADRINT)x + 2, (CHAR)(__MASK((SYSTEM_INT16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); + __PUT((SYSTEM_ADRINT)x + 2, (CHAR)(__MASK((int16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } -INTEGER Reals_ExpoL (LONGREAL x) +int16 Reals_ExpoL (LONGREAL x) { - INTEGER _o_result; - INTEGER i; - __GET((SYSTEM_ADRINT)&x + 6, i, INTEGER); + int16 _o_result; + int16 i; + __GET((SYSTEM_ADRINT)&x + 6, i, int16); _o_result = __MASK(__ASHR(i, 4), -2048); return _o_result; } -void Reals_ConvertL (LONGREAL x, INTEGER n, CHAR *d, LONGINT d__len) +void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len) { - LONGINT i, j, k; + int32 i, j, k; if (x < (LONGREAL)0) { x = -x; } k = 0; if (n > 9) { - i = (SYSTEM_INT32)__ENTIER(x / (LONGREAL)(LONGREAL)1000000000); - j = (SYSTEM_INT32)__ENTIER(x - i * (LONGREAL)1000000000); + i = (int32)__ENTIER(x / (LONGREAL)(LONGREAL)1000000000); + j = (int32)__ENTIER(x - i * (LONGREAL)1000000000); if (j < 0) { j = 0; } @@ -100,7 +100,7 @@ void Reals_ConvertL (LONGREAL x, INTEGER n, CHAR *d, LONGINT d__len) k += 1; } } else { - i = (SYSTEM_INT32)__ENTIER(x); + i = (int32)__ENTIER(x); } while (k < n) { d[__X(k, d__len)] = (CHAR)((int)__MOD(i, 10) + 48); @@ -109,12 +109,12 @@ void Reals_ConvertL (LONGREAL x, INTEGER n, CHAR *d, LONGINT d__len) } } -void Reals_Convert (REAL x, INTEGER n, CHAR *d, LONGINT d__len) +void Reals_Convert (REAL x, int16 n, CHAR *d, LONGINT d__len) { Reals_ConvertL(x, n, (void*)d, d__len); } -static CHAR Reals_ToHex (INTEGER i) +static CHAR Reals_ToHex (int16 i) { CHAR _o_result; if (i < 10) { @@ -129,15 +129,15 @@ static CHAR Reals_ToHex (INTEGER i) static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LONGINT d__len) { - INTEGER i; - LONGINT l; + int16 i; + int32 l; CHAR by; i = 0; l = b__len; while (i < l) { by = __VAL(CHAR, b[__X(i, b__len)]); - d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((SYSTEM_INT16)by, 4)); - d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((SYSTEM_INT16)by, -16)); + d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((int16)by, 4)); + d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((int16)by, -16)); i += 1; } } diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index 65543fac..a1191c0b 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -8,15 +8,15 @@ -import void Reals_Convert (REAL x, INTEGER n, CHAR *d, LONGINT d__len); +import void Reals_Convert (REAL x, int16 n, CHAR *d, LONGINT d__len); import void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len); import void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len); -import void Reals_ConvertL (LONGREAL x, INTEGER n, CHAR *d, LONGINT d__len); -import INTEGER Reals_Expo (REAL x); -import INTEGER Reals_ExpoL (LONGREAL x); -import void Reals_SetExpo (REAL *x, INTEGER ex); -import REAL Reals_Ten (INTEGER e); -import LONGREAL Reals_TenL (INTEGER e); +import void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len); +import int16 Reals_Expo (REAL x); +import int16 Reals_ExpoL (LONGREAL x); +import void Reals_SetExpo (REAL *x, int16 ex); +import REAL Reals_Ten (int16 e); +import LONGREAL Reals_TenL (int16 e); import void *Reals__init(void); diff --git a/bootstrap/windows-48/SYSTEM.h b/bootstrap/windows-48/SYSTEM.h index 343404a4..11ec8fc5 100644 --- a/bootstrap/windows-48/SYSTEM.h +++ b/bootstrap/windows-48/SYSTEM.h @@ -2,19 +2,21 @@ #define SYSTEM__h #if defined(_WIN64) - typedef long long SYSTEM_INT64; - typedef unsigned long long SYSTEM_CARD64; + typedef long long int64; + typedef unsigned long long uint64; #else - typedef long SYSTEM_INT64; - typedef unsigned long SYSTEM_CARD64; + typedef long int64; + typedef unsigned long uint64; #endif -typedef int SYSTEM_INT32; -typedef unsigned int SYSTEM_CARD32; -typedef short int SYSTEM_INT16; -typedef unsigned short int SYSTEM_CARD16; -typedef signed char SYSTEM_INT8; -typedef unsigned char SYSTEM_CARD8; +typedef int int32; +typedef unsigned int uint32; + +typedef short int int16; +typedef unsigned short int uint16; + +typedef signed char int8; +typedef unsigned char uint8; #if (__SIZEOF_POINTER__ == 8) || defined(_WIN64) || defined(__LP64__) #if defined(_WIN64) @@ -26,12 +28,30 @@ typedef unsigned char SYSTEM_CARD8; typedef unsigned int size_t; #endif -#define SYSTEM_ADRINT size_t -#define SYSTEM_ADDRESS size_t // Temporarily for bootstrap #define _SIZE_T_DECLARED // For FreeBSD #define _SIZE_T_DEFINED_ // For OpenBSD -void *memcpy(void *dest, const void *source, SYSTEM_ADRINT size); +void *memcpy(void *dest, const void *source, size_t size); + + +// Temporary while bootstrapping: + +#define SYSTEM_INT8 int8 +#define SYSTEM_INT16 int16 +#define SYSTEM_INT32 int32 +#define SYSTEM_INT64 int64 +#define SYSTEM_ADDRESS size_t + +#define U_SYSTEM_INT8 uint8 +#define U_SYSTEM_INT16 uint16 +#define U_SYSTEM_INT32 uint32 +#define U_SYSTEM_INT64 uint64 + +#define U_int8 uint8 +#define U_int16 uint16 +#define U_int32 uint32 +#define U_int64 uint64 + @@ -52,41 +72,53 @@ void *memcpy(void *dest, const void *source, SYSTEM_ADRINT size); // Oberon types -typedef char BOOLEAN; -typedef unsigned char SYSTEM_BYTE; -typedef unsigned char CHAR; -typedef signed char SHORTINT; -typedef float REAL; -typedef double LONGREAL; -typedef void* SYSTEM_PTR; +// typedef char BOOLEAN; +// typedef unsigned char SYSTEM_BYTE; +// typedef unsigned char CHAR; +// typedef signed char SHORTINT; +// typedef float REAL; +// typedef double LONGREAL; +// typedef void* SYSTEM_PTR; + +typedef int8 BOOLEAN; +typedef int8 SYSTEM_BYTE; +typedef uint8 U_SYSTEM_BYTE; +typedef uint8 CHAR; +typedef uint8 U_CHAR; +typedef int8 SHORTINT; +typedef uint8 U_SHORTINT; +typedef float REAL; +typedef double LONGREAL; +typedef void* SYSTEM_PTR; + +typedef size_t SYSTEM_ADRINT; + // For 32 bit builds, the size of LONGINT depends on a make option: #if (__SIZEOF_POINTER__ == 8) || defined(LARGE) || defined(_WIN64) - typedef int INTEGER; // INTEGER is 32 bit. - typedef long long LONGINT; // LONGINT is 64 bit. (long long is always 64 bits, while long can be 32 bits e.g. under MSC/MingW) - typedef unsigned int U_INTEGER; - typedef unsigned long long U_LONGINT; + typedef int32 INTEGER; + typedef int64 LONGINT; + typedef uint32 U_INTEGER; + typedef uint64 U_LONGINT; #else - typedef short int INTEGER; // INTEGER is 16 bit. - typedef long LONGINT; // LONGINT is 32 bit. - typedef unsigned short int U_INTEGER; - typedef unsigned long U_LONGINT; + typedef int16 INTEGER; + typedef int32 LONGINT; + typedef uint16 U_INTEGER; + typedef uint32 U_LONGINT; #endif // Unsigned variants are for use by shift and rotate macros. -typedef unsigned char U_SYSTEM_BYTE; -typedef unsigned char U_CHAR; -typedef unsigned char U_SHORTINT; - typedef U_LONGINT SET; typedef U_LONGINT U_SET; -typedef SYSTEM_CARD8 U_SYSTEM_INT8; -typedef SYSTEM_CARD16 U_SYSTEM_INT16; -typedef SYSTEM_CARD32 U_SYSTEM_INT32; -typedef SYSTEM_CARD64 U_SYSTEM_INT64; + + + +// ---------------------------------------------------------------------- +// ---------------------------------------------------------------------- + // OS Memory allocation interfaces are in PlatformXXX.Mod diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index 834c1fb1..6463db16 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -6,19 +6,19 @@ export void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len); export void Strings_Cap (CHAR *s, LONGINT s__len); -export void Strings_Delete (CHAR *s, LONGINT s__len, INTEGER pos, INTEGER n); -export void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n, CHAR *dest, LONGINT dest__len); -export void Strings_Insert (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, LONGINT dest__len); -export INTEGER Strings_Length (CHAR *s, LONGINT s__len); +export void Strings_Delete (CHAR *s, LONGINT s__len, int16 pos, int16 n); +export void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHAR *dest, LONGINT dest__len); +export void Strings_Insert (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len); +export int16 Strings_Length (CHAR *s, LONGINT s__len); export BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len); -export INTEGER Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, INTEGER pos); -export void Strings_Replace (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, LONGINT dest__len); +export int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int16 pos); +export void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len); -INTEGER Strings_Length (CHAR *s, LONGINT s__len) +int16 Strings_Length (CHAR *s, LONGINT s__len) { - INTEGER _o_result; - INTEGER i; + int16 _o_result; + int16 i; __DUP(s, s__len, CHAR); i = 0; while ((i < s__len && s[__X(i, s__len)] != 0x00)) { @@ -31,7 +31,7 @@ INTEGER Strings_Length (CHAR *s, LONGINT s__len) void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len) { - INTEGER n1, n2, i; + int16 n1, n2, i; __DUP(extra, extra__len, CHAR); n1 = Strings_Length(dest, dest__len); n2 = Strings_Length(extra, extra__len); @@ -46,9 +46,9 @@ void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__ __DEL(extra); } -void Strings_Insert (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, LONGINT dest__len) +void Strings_Insert (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len) { - INTEGER n1, n2, i; + int16 n1, n2, i; __DUP(source, source__len, CHAR); n1 = Strings_Length(dest, dest__len); n2 = Strings_Length(source, source__len); @@ -76,9 +76,9 @@ void Strings_Insert (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, __DEL(source); } -void Strings_Delete (CHAR *s, LONGINT s__len, INTEGER pos, INTEGER n) +void Strings_Delete (CHAR *s, LONGINT s__len, int16 pos, int16 n) { - INTEGER len, i; + int16 len, i; len = Strings_Length(s, s__len); if (pos < 0) { pos = 0; @@ -99,7 +99,7 @@ void Strings_Delete (CHAR *s, LONGINT s__len, INTEGER pos, INTEGER n) } } -void Strings_Replace (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, LONGINT dest__len) +void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len) { __DUP(source, source__len, CHAR); Strings_Delete((void*)dest, dest__len, pos, pos + Strings_Length(source, source__len)); @@ -107,12 +107,12 @@ void Strings_Replace (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest __DEL(source); } -void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n, CHAR *dest, LONGINT dest__len) +void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHAR *dest, LONGINT dest__len) { - INTEGER len, destLen, i; + int16 len, destLen, i; __DUP(source, source__len, CHAR); len = Strings_Length(source, source__len); - destLen = (SYSTEM_INT16)dest__len - 1; + destLen = (int16)dest__len - 1; if (pos < 0) { pos = 0; } @@ -131,10 +131,10 @@ void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n, __DEL(source); } -INTEGER Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, INTEGER pos) +int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int16 pos) { - INTEGER _o_result; - INTEGER n1, n2, i, j; + int16 _o_result; + int16 n1, n2, i, j; __DUP(pattern, pattern__len, CHAR); __DUP(s, s__len, CHAR); n1 = Strings_Length(s, s__len); @@ -169,7 +169,7 @@ INTEGER Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__le void Strings_Cap (CHAR *s, LONGINT s__len) { - INTEGER i; + int16 i; i = 0; while (s[__X(i, s__len)] != 0x00) { if (('a' <= s[__X(i, s__len)] && s[__X(i, s__len)] <= 'z')) { @@ -183,9 +183,9 @@ static struct Match__7 { struct Match__7 *lnk; } *Match__7_s; -static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, INTEGER n, INTEGER m); +static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, int16 n, int16 m); -static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, INTEGER n, INTEGER m) +static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, int16 n, int16 m) { BOOLEAN _o_result; while ((((n >= 0 && m >= 0)) && mask[__X(m, mask__len)] != '*')) { diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index 2edcc736..07051628 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -10,13 +10,13 @@ import void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len); import void Strings_Cap (CHAR *s, LONGINT s__len); -import void Strings_Delete (CHAR *s, LONGINT s__len, INTEGER pos, INTEGER n); -import void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n, CHAR *dest, LONGINT dest__len); -import void Strings_Insert (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, LONGINT dest__len); -import INTEGER Strings_Length (CHAR *s, LONGINT s__len); +import void Strings_Delete (CHAR *s, LONGINT s__len, int16 pos, int16 n); +import void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHAR *dest, LONGINT dest__len); +import void Strings_Insert (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len); +import int16 Strings_Length (CHAR *s, LONGINT s__len); import BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len); -import INTEGER Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, INTEGER pos); -import void Strings_Replace (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, LONGINT dest__len); +import int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int16 pos); +import void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len); import void *Strings__init(void); diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index dddea925..8dea0639 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -13,9 +13,9 @@ typedef typedef struct Texts_RunDesc { Texts_Run prev, next; - LONGINT len; + int32 len; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; BOOLEAN ascii; } Texts_RunDesc; @@ -36,26 +36,26 @@ typedef typedef struct Texts_ElemDesc { Texts_Run prev, next; - LONGINT len; + int32 len; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; BOOLEAN ascii; - LONGINT W, H; + int32 W, H; Texts_Handler handle; Texts_Text base; } Texts_ElemDesc; struct Texts__1 { /* Texts_ElemDesc */ Texts_Run prev, next; - LONGINT len; + int32 len; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; BOOLEAN ascii; - LONGINT W, H; + int32 W, H; Texts_Handler handle; Texts_Text base; Files_File file; - LONGINT org, span; + int32 org, span; CHAR mod[32], proc[32]; }; @@ -64,7 +64,7 @@ typedef typedef struct Texts_BufDesc { - LONGINT len; + int32 len; Texts_Run head; } Texts_BufDesc; @@ -78,8 +78,8 @@ typedef typedef struct Texts_FileMsg { /* Texts_ElemMsg */ - INTEGER id; - LONGINT pos; + int16 id; + int32 pos; Files_Rider r; } Texts_FileMsg; @@ -94,7 +94,7 @@ typedef } Texts_IdentifyMsg; typedef - void (*Texts_Notifier)(Texts_Text, INTEGER, LONGINT, LONGINT); + void (*Texts_Notifier)(Texts_Text, int16, int32, int32); typedef struct Texts_PieceDesc *Texts_Piece; @@ -102,57 +102,57 @@ typedef typedef struct Texts_PieceDesc { Texts_Run prev, next; - LONGINT len; + int32 len; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; BOOLEAN ascii; Files_File file; - LONGINT org; + int32 org; } Texts_PieceDesc; typedef struct Texts_Reader { BOOLEAN eot; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; Texts_Elem elem; Files_Rider rider; Texts_Run run; - LONGINT org, off; + int32 org, off; } Texts_Reader; typedef struct Texts_Scanner { /* Texts_Reader */ BOOLEAN eot; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; Texts_Elem elem; Files_Rider rider; Texts_Run run; - LONGINT org, off; + int32 org, off; CHAR nextCh; - INTEGER line, class; - LONGINT i; + int16 line, class; + int32 i; REAL x; LONGREAL y; CHAR c; - SHORTINT len; + int8 len; CHAR s[64]; } Texts_Scanner; typedef struct Texts_TextDesc { - LONGINT len; + int32 len; Texts_Notifier notify; Texts_Run head, cache; - LONGINT corg; + int32 corg; } Texts_TextDesc; typedef struct Texts_Writer { Texts_Buffer buf; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; Files_Rider rider; Files_File file; } Texts_Writer; @@ -178,50 +178,50 @@ export LONGINT *Texts_Writer__typ; export LONGINT *Texts__1__typ; export void Texts_Append (Texts_Text T, Texts_Buffer B); -export void Texts_ChangeLooks (Texts_Text T, LONGINT beg, LONGINT end, SET sel, Texts_FontsFont fnt, SHORTINT col, SHORTINT voff); +export void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff); static Texts_Elem Texts_CloneElem (Texts_Elem e); static Texts_Piece Texts_ClonePiece (Texts_Piece p); export void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len); export void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); export void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); -export void Texts_Delete (Texts_Text T, LONGINT beg, LONGINT end); +export void Texts_Delete (Texts_Text T, int32 beg, int32 end); export Texts_Text Texts_ElemBase (Texts_Elem E); -export LONGINT Texts_ElemPos (Texts_Elem E); -static void Texts_Find (Texts_Text T, LONGINT *pos, Texts_Run *u, LONGINT *org, LONGINT *off); +export int32 Texts_ElemPos (Texts_Elem E); +static void Texts_Find (Texts_Text T, int32 *pos, Texts_Run *u, int32 *org, int32 *off); static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len); static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, LONGINT *msg__typ); -export void Texts_Insert (Texts_Text T, LONGINT pos, Texts_Buffer B); +export void Texts_Insert (Texts_Text T, int32 pos, Texts_Buffer B); export void Texts_Load (Files_Rider *r, LONGINT *r__typ, Texts_Text T); static void Texts_Load0 (Files_Rider *r, LONGINT *r__typ, Texts_Text T); static void Texts_Merge (Texts_Text T, Texts_Run u, Texts_Run *v); export void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len); export void Texts_OpenBuf (Texts_Buffer B); -export void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, LONGINT pos); -export void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, LONGINT pos); +export void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, int32 pos); +export void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, int32 pos); export void Texts_OpenWriter (Texts_Writer *W, LONGINT *W__typ); -export LONGINT Texts_Pos (Texts_Reader *R, LONGINT *R__typ); +export int32 Texts_Pos (Texts_Reader *R, LONGINT *R__typ); export void Texts_Read (Texts_Reader *R, LONGINT *R__typ, CHAR *ch); export void Texts_ReadElem (Texts_Reader *R, LONGINT *R__typ); export void Texts_ReadPrevElem (Texts_Reader *R, LONGINT *R__typ); export void Texts_Recall (Texts_Buffer *B); -export void Texts_Save (Texts_Text T, LONGINT beg, LONGINT end, Texts_Buffer B); +export void Texts_Save (Texts_Text T, int32 beg, int32 end, Texts_Buffer B); export void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ); -export void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, SHORTINT col); +export void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, int8 col); export void Texts_SetFont (Texts_Writer *W, LONGINT *W__typ, Texts_FontsFont fnt); -export void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, SHORTINT voff); +export void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, int8 voff); static void Texts_Splice (Texts_Run un, Texts_Run v, Texts_Run w, Texts_Text base); -static void Texts_Split (LONGINT off, Texts_Run *u, Texts_Run *un); +static void Texts_Split (int32 off, Texts_Run *u, Texts_Run *un); export void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T); export void Texts_Write (Texts_Writer *W, LONGINT *W__typ, CHAR ch); -export void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, LONGINT t, LONGINT d); +export void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, int32 t, int32 d); export void Texts_WriteElem (Texts_Writer *W, LONGINT *W__typ, Texts_Elem e); -export void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, LONGINT x); -export void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n); +export void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, int32 x); +export void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int32 x, int32 n); export void Texts_WriteLn (Texts_Writer *W, LONGINT *W__typ); -export void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER n); +export void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, int16 n); export void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x); -export void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n); -export void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n, INTEGER k); +export void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, int16 n); +export void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, int16 n, int16 k); export void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x); export void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__len); @@ -236,10 +236,10 @@ static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len) return _o_result; } -static void Texts_Find (Texts_Text T, LONGINT *pos, Texts_Run *u, LONGINT *org, LONGINT *off) +static void Texts_Find (Texts_Text T, int32 *pos, Texts_Run *u, int32 *org, int32 *off) { Texts_Run v = NIL; - LONGINT m; + int32 m; if (*pos >= T->len) { *pos = T->len; *u = T->head; @@ -269,7 +269,7 @@ static void Texts_Find (Texts_Text T, LONGINT *pos, Texts_Run *u, LONGINT *org, } } -static void Texts_Split (LONGINT off, Texts_Run *u, Texts_Run *un) +static void Texts_Split (int32 off, Texts_Run *u, Texts_Run *un) { Texts_Piece p = NIL, U = NIL; if (off == 0) { @@ -368,11 +368,11 @@ Texts_Text Texts_ElemBase (Texts_Elem E) return _o_result; } -LONGINT Texts_ElemPos (Texts_Elem E) +int32 Texts_ElemPos (Texts_Elem E) { - LONGINT _o_result; + int32 _o_result; Texts_Run u = NIL; - LONGINT pos; + int32 pos; u = E->base->head->next; pos = 0; while (u != (void *) E) { @@ -387,7 +387,7 @@ static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, LONGINT *msg__t { Texts_Alien e = NIL; Files_Rider r; - LONGINT i; + int32 i; CHAR ch; if (__ISP(E, Texts__1, 2)) { if (__IS(msg__typ, Texts_CopyMsg, 1)) { @@ -463,10 +463,10 @@ void Texts_Recall (Texts_Buffer *B) Texts_del = NIL; } -void Texts_Save (Texts_Text T, LONGINT beg, LONGINT end, Texts_Buffer B) +void Texts_Save (Texts_Text T, int32 beg, int32 end, Texts_Buffer B) { Texts_Run u = NIL, v = NIL, w = NIL, wn = NIL; - LONGINT uo, ud, vo, vd; + int32 uo, ud, vo, vd; Texts_Find(T, &beg, &u, &uo, &ud); Texts_Find(T, &end, &v, &vo, &vd); w = B->head->prev; @@ -497,11 +497,11 @@ void Texts_Save (Texts_Text T, LONGINT beg, LONGINT end, Texts_Buffer B) B->len += end - beg; } -void Texts_Insert (Texts_Text T, LONGINT pos, Texts_Buffer B) +void Texts_Insert (Texts_Text T, int32 pos, Texts_Buffer B) { Texts_Run u = NIL, un = NIL, v = NIL; Texts_Piece p = NIL, q = NIL; - LONGINT uo, ud, len; + int32 uo, ud, len; Texts_Find(T, &pos, &u, &uo, &ud); Texts_Split(ud, &u, &un); len = B->len; @@ -520,7 +520,7 @@ void Texts_Insert (Texts_Text T, LONGINT pos, Texts_Buffer B) void Texts_Append (Texts_Text T, Texts_Buffer B) { Texts_Run v = NIL; - LONGINT pos, len; + int32 pos, len; pos = T->len; len = B->len; v = B->head->next; @@ -535,10 +535,10 @@ void Texts_Append (Texts_Text T, Texts_Buffer B) } } -void Texts_Delete (Texts_Text T, LONGINT beg, LONGINT end) +void Texts_Delete (Texts_Text T, int32 beg, int32 end) { Texts_Run c = NIL, u = NIL, un = NIL, v = NIL, vn = NIL; - LONGINT co, uo, ud, vo, vd; + int32 co, uo, ud, vo, vd; Texts_Find(T, &beg, &u, &uo, &ud); Texts_Split(ud, &u, &un); c = T->cache; @@ -560,10 +560,10 @@ void Texts_Delete (Texts_Text T, LONGINT beg, LONGINT end) } } -void Texts_ChangeLooks (Texts_Text T, LONGINT beg, LONGINT end, SET sel, Texts_FontsFont fnt, SHORTINT col, SHORTINT voff) +void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff) { Texts_Run c = NIL, u = NIL, un = NIL, v = NIL, vn = NIL; - LONGINT co, uo, ud, vo, vd; + int32 co, uo, ud, vo, vd; Texts_Find(T, &beg, &u, &uo, &ud); Texts_Split(ud, &u, &un); c = T->cache; @@ -599,7 +599,7 @@ void Texts_ChangeLooks (Texts_Text T, LONGINT beg, LONGINT end, SET sel, Texts_F } } -void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, LONGINT pos) +void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, int32 pos) { Texts_Run u = NIL; if (pos >= T->len) { @@ -616,7 +616,7 @@ void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, LONGINT p void Texts_Read (Texts_Reader *R, LONGINT *R__typ, CHAR *ch) { Texts_Run u = NIL; - LONGINT pos; + int32 pos; CHAR nextch; u = (*R).run; (*R).fnt = u->fnt; @@ -708,14 +708,14 @@ void Texts_ReadPrevElem (Texts_Reader *R, LONGINT *R__typ) } } -LONGINT Texts_Pos (Texts_Reader *R, LONGINT *R__typ) +int32 Texts_Pos (Texts_Reader *R, LONGINT *R__typ) { - LONGINT _o_result; + int32 _o_result; _o_result = (*R).org + (*R).off; return _o_result; } -void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, LONGINT pos) +void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, int32 pos) { Texts_OpenReader((void*)&*S, S__typ, T, pos); (*S).line = 0; @@ -727,7 +727,7 @@ static struct Scan__31 { LONGINT *S__typ; CHAR *ch; BOOLEAN *negE; - INTEGER *e; + int16 *e; struct Scan__31 *lnk; } *Scan__31_s; @@ -746,7 +746,7 @@ static void ReadScaleFactor__32 (void) } } while (('0' <= *Scan__31_s->ch && *Scan__31_s->ch <= '9')) { - *Scan__31_s->e = (*Scan__31_s->e * 10 + (SYSTEM_INT16)*Scan__31_s->ch) - 48; + *Scan__31_s->e = (*Scan__31_s->e * 10 + (int16)*Scan__31_s->ch) - 48; Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); } } @@ -755,9 +755,9 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) { CHAR ch, term; BOOLEAN neg, negE, hex; - SHORTINT i, j, h; - INTEGER e; - LONGINT k; + int8 i, j, h; + int16 e; + int32 k; REAL x, f; LONGREAL y, g; CHAR d[32]; @@ -818,10 +818,10 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) if ('9' < ch) { if (('A' <= ch && ch <= 'F')) { hex = 1; - ch = (CHAR)((SYSTEM_INT16)ch - 7); + ch = (CHAR)((int16)ch - 7); } else if (('a' <= ch && ch <= 'f')) { hex = 1; - ch = (CHAR)((SYSTEM_INT16)ch - 39); + ch = (CHAR)((int16)ch - 39); } else { break; } @@ -833,13 +833,13 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) if (i - j > 8) { j = i - 8; } - k = (SYSTEM_INT16)d[__X(j, 32)] - 48; + k = (int16)d[__X(j, 32)] - 48; j += 1; if ((i - j == 7 && k >= 8)) { k -= 16; } while (j < i) { - k = __ASHL(k, 4) + ((SYSTEM_INT16)d[__X(j, 32)] - 48); + k = __ASHL(k, 4) + ((int16)d[__X(j, 32)] - 48); j += 1; } if (neg) { @@ -860,12 +860,12 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) y = (LONGREAL)0; g = (LONGREAL)1; do { - y = y * (LONGREAL)10 + ((SYSTEM_INT16)d[__X(j, 32)] - 48); + y = y * (LONGREAL)10 + ((int16)d[__X(j, 32)] - 48); j += 1; } while (!(j == h)); while (j < i) { g = g / (LONGREAL)(LONGREAL)10; - y = ((SYSTEM_INT16)d[__X(j, 32)] - 48) * g + y; + y = ((int16)d[__X(j, 32)] - 48) * g + y; j += 1; } ReadScaleFactor__32(); @@ -892,12 +892,12 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) x = (REAL)0; f = (REAL)1; do { - x = x * (REAL)10 + ((SYSTEM_INT16)d[__X(j, 32)] - 48); + x = x * (REAL)10 + ((int16)d[__X(j, 32)] - 48); j += 1; } while (!(j == h)); while (j < i) { f = f / (REAL)(REAL)10; - x = ((SYSTEM_INT16)d[__X(j, 32)] - 48) * f + x; + x = ((int16)d[__X(j, 32)] - 48) * f + x; j += 1; } if (ch == 'E') { @@ -929,7 +929,7 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) (*S).class = 3; k = 0; do { - k = k * 10 + ((SYSTEM_INT16)d[__X(j, 32)] - 48); + k = k * 10 + ((int16)d[__X(j, 32)] - 48); j += 1; } while (!(j == i)); if (neg) { @@ -973,12 +973,12 @@ void Texts_SetFont (Texts_Writer *W, LONGINT *W__typ, Texts_FontsFont fnt) (*W).fnt = fnt; } -void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, SHORTINT col) +void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, int8 col) { (*W).col = col; } -void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, SHORTINT voff) +void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, int8 voff) { (*W).voff = voff; } @@ -1035,7 +1035,7 @@ void Texts_WriteLn (Texts_Writer *W, LONGINT *W__typ) void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__len) { - INTEGER i; + int16 i; __DUP(s, s__len, CHAR); i = 0; while (s[__X(i, s__len)] >= ' ') { @@ -1045,10 +1045,10 @@ void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__le __DEL(s); } -void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n) +void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int32 x, int32 n) { - INTEGER i; - LONGINT x0; + int16 i; + int32 x0; CHAR a[22]; i = 0; if (x < 0) { @@ -1080,10 +1080,10 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n) } while (!(i == 0)); } -void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, LONGINT x) +void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, int32 x) { - INTEGER i; - LONGINT y; + int16 i; + int32 y; CHAR a[20]; i = 0; Texts_Write(&*W, W__typ, ' '); @@ -1103,9 +1103,9 @@ void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, LONGINT x) } while (!(i == 0)); } -void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n) +void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, int16 n) { - INTEGER e; + int16 e; REAL x0; CHAR d[9]; e = Reals_Expo(x); @@ -1176,15 +1176,15 @@ void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n) static struct WriteRealFix__53 { Texts_Writer *W; LONGINT *W__typ; - INTEGER *i; + int16 *i; CHAR (*d)[9]; struct WriteRealFix__53 *lnk; } *WriteRealFix__53_s; -static void dig__54 (INTEGER n); -static void seq__56 (CHAR ch, INTEGER n); +static void dig__54 (int16 n); +static void seq__56 (CHAR ch, int16 n); -static void seq__56 (CHAR ch, INTEGER n) +static void seq__56 (CHAR ch, int16 n) { while (n > 0) { Texts_Write(&*WriteRealFix__53_s->W, WriteRealFix__53_s->W__typ, ch); @@ -1192,7 +1192,7 @@ static void seq__56 (CHAR ch, INTEGER n) } } -static void dig__54 (INTEGER n) +static void dig__54 (int16 n) { while (n > 0) { *WriteRealFix__53_s->i -= 1; @@ -1201,9 +1201,9 @@ static void dig__54 (INTEGER n) } } -void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n, INTEGER k) +void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, int16 n, int16 k) { - INTEGER e, i; + int16 e, i; CHAR sign; REAL x0; CHAR d[9]; @@ -1275,7 +1275,7 @@ void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n, IN void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x) { - INTEGER i; + int16 i; CHAR d[8]; Reals_ConvertH(x, (void*)d, 8); i = 0; @@ -1285,9 +1285,9 @@ void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x) } while (!(i == 8)); } -void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER n) +void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, int16 n) { - INTEGER e; + int16 e; LONGREAL x0; CHAR d[16]; e = Reals_ExpoL(x); @@ -1319,7 +1319,7 @@ void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER } else { Texts_Write(&*W, W__typ, ' '); } - e = (SYSTEM_INT16)__ASHR((e - 1023) * 77, 8); + e = (int16)__ASHR((e - 1023) * 77, 8); if (e >= 0) { x = x / (LONGREAL)Reals_TenL(e); } else { @@ -1359,7 +1359,7 @@ void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x) { - INTEGER i; + int16 i; CHAR d[16]; Reals_ConvertHL(x, (void*)d, 16); i = 0; @@ -1375,16 +1375,16 @@ static struct WriteDate__43 { struct WriteDate__43 *lnk; } *WriteDate__43_s; -static void WritePair__44 (CHAR ch, LONGINT x); +static void WritePair__44 (CHAR ch, int32 x); -static void WritePair__44 (CHAR ch, LONGINT x) +static void WritePair__44 (CHAR ch, int32 x) { Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, ch); Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)(__DIV(x, 10) + 48)); Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)((int)__MOD(x, 10) + 48)); } -void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, LONGINT t, LONGINT d) +void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, int32 t, int32 d) { struct WriteDate__43 _s; _s.W = W; _s.W__typ = W__typ; @@ -1401,22 +1401,22 @@ void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, LONGINT t, LONGINT d) static struct Load0__16 { Texts_Text *T; - SHORTINT *ecnt; + int8 *ecnt; Files_File *f; Texts_FileMsg *msg; CHAR (*mods)[64][32], (*procs)[64][32]; struct Load0__16 *lnk; } *Load0__16_s; -static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, LONGINT span, Texts_Elem *e); +static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, int32 pos, int32 span, Texts_Elem *e); -static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, LONGINT span, Texts_Elem *e) +static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, int32 pos, int32 span, Texts_Elem *e) { Modules_Module M = NIL; Modules_Command Cmd; Texts_Alien a = NIL; - LONGINT org, ew, eh; - SHORTINT eno; + int32 org, ew, eh; + int8 eno; Texts_new = NIL; Files_ReadLInt(&*r, r__typ, &ew); Files_ReadLInt(&*r, r__typ, &eh); @@ -1466,8 +1466,8 @@ static void Texts_Load0 (Files_Rider *r, LONGINT *r__typ, Texts_Text T) Texts_Run u = NIL, un = NIL; Texts_Piece p = NIL; Texts_Elem e = NIL; - LONGINT org, pos, hlen, plen; - SHORTINT ecnt, fno, fcnt, col, voff; + int32 org, pos, hlen, plen; + int8 ecnt, fno, fcnt, col, voff; Files_File f = NIL; Texts_FileMsg msg; CHAR mods[64][32], procs[64][32]; @@ -1537,7 +1537,7 @@ static void Texts_Load0 (Files_Rider *r, LONGINT *r__typ, Texts_Text T) void Texts_Load (Files_Rider *r, LONGINT *r__typ, Texts_Text T) { - INTEGER tag; + int16 tag; Files_ReadInt(&*r, r__typ, &tag); if (tag != -4095) { Files_Set(&*r, r__typ, Files_Base(&*r, r__typ), Files_Pos(&*r, r__typ) - 2); @@ -1552,7 +1552,7 @@ void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len) Texts_Run u = NIL; Texts_Piece p = NIL; CHAR tag, version; - LONGINT hlen; + int32 hlen; __DUP(name, name__len, CHAR); f = Files_Old(name, name__len); if (f == NIL) { @@ -1602,20 +1602,20 @@ void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len) } static struct Store__39 { - SHORTINT *ecnt; + int8 *ecnt; Texts_FileMsg *msg; Texts_IdentifyMsg *iden; CHAR (*mods)[64][32], (*procs)[64][32]; struct Store__39 *lnk; } *Store__39_s; -static void StoreElem__40 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, Texts_Elem e); +static void StoreElem__40 (Files_Rider *r, LONGINT *r__typ, int32 pos, Texts_Elem e); -static void StoreElem__40 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, Texts_Elem e) +static void StoreElem__40 (Files_Rider *r, LONGINT *r__typ, int32 pos, Texts_Elem e) { Files_Rider r1; - LONGINT org, span; - SHORTINT eno; + int32 org, span; + int8 eno; __COPY((*Store__39_s->iden).mod, (*Store__39_s->mods)[__X(*Store__39_s->ecnt, 64)], 32); __COPY((*Store__39_s->iden).proc, (*Store__39_s->procs)[__X(*Store__39_s->ecnt, 64)], 32); eno = 1; @@ -1646,8 +1646,8 @@ void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T) Files_Rider r1; Texts_Run u = NIL, un = NIL; Texts_Elem e = NIL; - LONGINT org, pos, delta, hlen, rlen; - SHORTINT ecnt, fno, fcnt; + int32 org, pos, delta, hlen, rlen; + int8 ecnt, fno, fcnt; CHAR ch; Texts_FileMsg msg; Texts_IdentifyMsg iden; @@ -1764,7 +1764,7 @@ void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len) { Files_File f = NIL; Files_Rider r; - INTEGER i, res; + int16 i, res; CHAR bak[64]; __DUP(name, name__len, CHAR); f = Files_New(name, name__len); diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index 5499c3d0..d946691c 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -8,7 +8,7 @@ typedef struct Texts_BufDesc { - LONGINT len; + int32 len; char _prvt0[4]; } Texts_BufDesc; @@ -40,15 +40,15 @@ typedef typedef struct Texts_ElemDesc { char _prvt0[20]; - LONGINT W, H; + int32 W, H; Texts_Handler handle; char _prvt1[4]; } Texts_ElemDesc; typedef struct Texts_FileMsg { /* Texts_ElemMsg */ - INTEGER id; - LONGINT pos; + int16 id; + int32 pos; Files_Rider r; } Texts_FileMsg; @@ -69,13 +69,13 @@ typedef struct Texts_TextDesc *Texts_Text; typedef - void (*Texts_Notifier)(Texts_Text, INTEGER, LONGINT, LONGINT); + void (*Texts_Notifier)(Texts_Text, int16, int32, int32); typedef struct Texts_Reader { BOOLEAN eot; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; Texts_Elem elem; char _prvt0[32]; } Texts_Reader; @@ -84,23 +84,23 @@ typedef struct Texts_Scanner { /* Texts_Reader */ BOOLEAN eot; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; Texts_Elem elem; LONGREAL _prvt0; char _prvt1[24]; CHAR nextCh; - INTEGER line, class; - LONGINT i; + int16 line, class; + int32 i; REAL x; LONGREAL y; CHAR c; - SHORTINT len; + int8 len; CHAR s[64]; } Texts_Scanner; typedef struct Texts_TextDesc { - LONGINT len; + int32 len; Texts_Notifier notify; char _prvt0[12]; } Texts_TextDesc; @@ -109,7 +109,7 @@ typedef struct Texts_Writer { Texts_Buffer buf; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; char _prvt0[26]; } Texts_Writer; @@ -130,41 +130,41 @@ import LONGINT *Texts_Scanner__typ; import LONGINT *Texts_Writer__typ; import void Texts_Append (Texts_Text T, Texts_Buffer B); -import void Texts_ChangeLooks (Texts_Text T, LONGINT beg, LONGINT end, SET sel, Texts_FontsFont fnt, SHORTINT col, SHORTINT voff); +import void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff); import void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len); import void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); import void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); -import void Texts_Delete (Texts_Text T, LONGINT beg, LONGINT end); +import void Texts_Delete (Texts_Text T, int32 beg, int32 end); import Texts_Text Texts_ElemBase (Texts_Elem E); -import LONGINT Texts_ElemPos (Texts_Elem E); -import void Texts_Insert (Texts_Text T, LONGINT pos, Texts_Buffer B); +import int32 Texts_ElemPos (Texts_Elem E); +import void Texts_Insert (Texts_Text T, int32 pos, Texts_Buffer B); import void Texts_Load (Files_Rider *r, LONGINT *r__typ, Texts_Text T); import void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len); import void Texts_OpenBuf (Texts_Buffer B); -import void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, LONGINT pos); -import void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, LONGINT pos); +import void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, int32 pos); +import void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, int32 pos); import void Texts_OpenWriter (Texts_Writer *W, LONGINT *W__typ); -import LONGINT Texts_Pos (Texts_Reader *R, LONGINT *R__typ); +import int32 Texts_Pos (Texts_Reader *R, LONGINT *R__typ); import void Texts_Read (Texts_Reader *R, LONGINT *R__typ, CHAR *ch); import void Texts_ReadElem (Texts_Reader *R, LONGINT *R__typ); import void Texts_ReadPrevElem (Texts_Reader *R, LONGINT *R__typ); import void Texts_Recall (Texts_Buffer *B); -import void Texts_Save (Texts_Text T, LONGINT beg, LONGINT end, Texts_Buffer B); +import void Texts_Save (Texts_Text T, int32 beg, int32 end, Texts_Buffer B); import void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ); -import void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, SHORTINT col); +import void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, int8 col); import void Texts_SetFont (Texts_Writer *W, LONGINT *W__typ, Texts_FontsFont fnt); -import void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, SHORTINT voff); +import void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, int8 voff); import void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T); import void Texts_Write (Texts_Writer *W, LONGINT *W__typ, CHAR ch); -import void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, LONGINT t, LONGINT d); +import void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, int32 t, int32 d); import void Texts_WriteElem (Texts_Writer *W, LONGINT *W__typ, Texts_Elem e); -import void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, LONGINT x); -import void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n); +import void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, int32 x); +import void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int32 x, int32 n); import void Texts_WriteLn (Texts_Writer *W, LONGINT *W__typ); -import void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER n); +import void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, int16 n); import void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x); -import void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n); -import void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n, INTEGER k); +import void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, int16 n); +import void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, int16 n, int16 k); import void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x); import void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__len); import void *Texts__init(void); diff --git a/bootstrap/windows-48/Vishap.c b/bootstrap/windows-48/Vishap.c index 030b94f6..c8f81032 100644 --- a/bootstrap/windows-48/Vishap.c +++ b/bootstrap/windows-48/Vishap.c @@ -20,7 +20,7 @@ static CHAR Vishap_mname[256]; export void Vishap_Module (BOOLEAN *done); static void Vishap_PropagateElementaryTypeSizes (void); export void Vishap_Translate (void); -static void Vishap_Trap (INTEGER sig); +static void Vishap_Trap (int16 sig); void Vishap_Module (BOOLEAN *done) @@ -126,7 +126,7 @@ void Vishap_Translate (void) } } -static void Vishap_Trap (INTEGER sig) +static void Vishap_Trap (int16 sig) { Heap_FINALL(); if (sig == 3) { diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index bfab2dc6..b894b3f9 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -17,7 +17,7 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGINT cmd__len) { - INTEGER r, status, exitcode; + int16 r, status, exitcode; __DUP(title, title__len, CHAR); __DUP(cmd, cmd__len, CHAR); if (OPM_Verbose) { diff --git a/bootstrap/windows-48/vt100.c b/bootstrap/windows-48/vt100.c index 84707926..46a1e460 100644 --- a/bootstrap/windows-48/vt100.c +++ b/bootstrap/windows-48/vt100.c @@ -8,36 +8,36 @@ export CHAR vt100_CSI[5]; static CHAR vt100_tmpstr[32]; -export void vt100_CHA (INTEGER n); -export void vt100_CNL (INTEGER n); -export void vt100_CPL (INTEGER n); -export void vt100_CUB (INTEGER n); -export void vt100_CUD (INTEGER n); -export void vt100_CUF (INTEGER n); -export void vt100_CUP (INTEGER n, INTEGER m); -export void vt100_CUU (INTEGER n); +export void vt100_CHA (int16 n); +export void vt100_CNL (int16 n); +export void vt100_CPL (int16 n); +export void vt100_CUB (int16 n); +export void vt100_CUD (int16 n); +export void vt100_CUF (int16 n); +export void vt100_CUP (int16 n, int16 m); +export void vt100_CUU (int16 n); export void vt100_DECTCEMh (void); export void vt100_DECTCEMl (void); -export void vt100_DSR (INTEGER n); -export void vt100_ED (INTEGER n); -export void vt100_EL (INTEGER n); -static void vt100_EscSeq (INTEGER n, CHAR *letter, LONGINT letter__len); +export void vt100_DSR (int16 n); +export void vt100_ED (int16 n); +export void vt100_EL (int16 n); +static void vt100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len); static void vt100_EscSeq0 (CHAR *letter, LONGINT letter__len); -static void vt100_EscSeq2 (INTEGER n, INTEGER m, CHAR *letter, LONGINT letter__len); -static void vt100_EscSeqSwapped (INTEGER n, CHAR *letter, LONGINT letter__len); -export void vt100_HVP (INTEGER n, INTEGER m); -export void vt100_IntToStr (LONGINT int_, CHAR *str, LONGINT str__len); +static void vt100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len); +static void vt100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len); +export void vt100_HVP (int16 n, int16 m); +export void vt100_IntToStr (int32 int_, CHAR *str, LONGINT str__len); export void vt100_RCP (void); -static void vt100_Reverse0 (CHAR *str, LONGINT str__len, INTEGER start, INTEGER end); +static void vt100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end); export void vt100_SCP (void); -export void vt100_SD (INTEGER n); -export void vt100_SGR (INTEGER n); -export void vt100_SGR2 (INTEGER n, INTEGER m); -export void vt100_SU (INTEGER n); +export void vt100_SD (int16 n); +export void vt100_SGR (int16 n); +export void vt100_SGR2 (int16 n, int16 m); +export void vt100_SU (int16 n); export void vt100_SetAttr (CHAR *attr, LONGINT attr__len); -static void vt100_Reverse0 (CHAR *str, LONGINT str__len, INTEGER start, INTEGER end) +static void vt100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end) { CHAR h; while (start < end) { @@ -49,11 +49,11 @@ static void vt100_Reverse0 (CHAR *str, LONGINT str__len, INTEGER start, INTEGER } } -void vt100_IntToStr (LONGINT int_, CHAR *str, LONGINT str__len) +void vt100_IntToStr (int32 int_, CHAR *str, LONGINT str__len) { CHAR b[21]; - INTEGER s, e; - SHORTINT maxLength; + int16 s, e; + int8 maxLength; maxLength = 11; if (int_ == (-2147483647-1)) { __MOVE("-2147483648", b, 12); @@ -88,7 +88,7 @@ static void vt100_EscSeq0 (CHAR *letter, LONGINT letter__len) __DEL(letter); } -static void vt100_EscSeq (INTEGER n, CHAR *letter, LONGINT letter__len) +static void vt100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len) { CHAR nstr[2]; CHAR cmd[7]; @@ -101,7 +101,7 @@ static void vt100_EscSeq (INTEGER n, CHAR *letter, LONGINT letter__len) __DEL(letter); } -static void vt100_EscSeqSwapped (INTEGER n, CHAR *letter, LONGINT letter__len) +static void vt100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len) { CHAR nstr[2]; CHAR cmd[7]; @@ -114,7 +114,7 @@ static void vt100_EscSeqSwapped (INTEGER n, CHAR *letter, LONGINT letter__len) __DEL(letter); } -static void vt100_EscSeq2 (INTEGER n, INTEGER m, CHAR *letter, LONGINT letter__len) +static void vt100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len) { CHAR nstr[5], mstr[5]; CHAR cmd[12]; @@ -130,82 +130,82 @@ static void vt100_EscSeq2 (INTEGER n, INTEGER m, CHAR *letter, LONGINT letter__l __DEL(letter); } -void vt100_CUU (INTEGER n) +void vt100_CUU (int16 n) { vt100_EscSeq(n, (CHAR*)"A", 2); } -void vt100_CUD (INTEGER n) +void vt100_CUD (int16 n) { vt100_EscSeq(n, (CHAR*)"B", 2); } -void vt100_CUF (INTEGER n) +void vt100_CUF (int16 n) { vt100_EscSeq(n, (CHAR*)"C", 2); } -void vt100_CUB (INTEGER n) +void vt100_CUB (int16 n) { vt100_EscSeq(n, (CHAR*)"D", 2); } -void vt100_CNL (INTEGER n) +void vt100_CNL (int16 n) { vt100_EscSeq(n, (CHAR*)"E", 2); } -void vt100_CPL (INTEGER n) +void vt100_CPL (int16 n) { vt100_EscSeq(n, (CHAR*)"F", 2); } -void vt100_CHA (INTEGER n) +void vt100_CHA (int16 n) { vt100_EscSeq(n, (CHAR*)"G", 2); } -void vt100_CUP (INTEGER n, INTEGER m) +void vt100_CUP (int16 n, int16 m) { vt100_EscSeq2(n, m, (CHAR*)"H", 2); } -void vt100_ED (INTEGER n) +void vt100_ED (int16 n) { vt100_EscSeq(n, (CHAR*)"J", 2); } -void vt100_EL (INTEGER n) +void vt100_EL (int16 n) { vt100_EscSeq(n, (CHAR*)"K", 2); } -void vt100_SU (INTEGER n) +void vt100_SU (int16 n) { vt100_EscSeq(n, (CHAR*)"S", 2); } -void vt100_SD (INTEGER n) +void vt100_SD (int16 n) { vt100_EscSeq(n, (CHAR*)"T", 2); } -void vt100_HVP (INTEGER n, INTEGER m) +void vt100_HVP (int16 n, int16 m) { vt100_EscSeq2(n, m, (CHAR*)"f", 2); } -void vt100_SGR (INTEGER n) +void vt100_SGR (int16 n) { vt100_EscSeq(n, (CHAR*)"m", 2); } -void vt100_SGR2 (INTEGER n, INTEGER m) +void vt100_SGR2 (int16 n, int16 m) { vt100_EscSeq2(n, m, (CHAR*)"m", 2); } -void vt100_DSR (INTEGER n) +void vt100_DSR (int16 n) { vt100_EscSeq(6, (CHAR*)"n", 2); } diff --git a/bootstrap/windows-48/vt100.h b/bootstrap/windows-48/vt100.h index 6266a678..ad1ac948 100644 --- a/bootstrap/windows-48/vt100.h +++ b/bootstrap/windows-48/vt100.h @@ -9,27 +9,27 @@ import CHAR vt100_CSI[5]; -import void vt100_CHA (INTEGER n); -import void vt100_CNL (INTEGER n); -import void vt100_CPL (INTEGER n); -import void vt100_CUB (INTEGER n); -import void vt100_CUD (INTEGER n); -import void vt100_CUF (INTEGER n); -import void vt100_CUP (INTEGER n, INTEGER m); -import void vt100_CUU (INTEGER n); +import void vt100_CHA (int16 n); +import void vt100_CNL (int16 n); +import void vt100_CPL (int16 n); +import void vt100_CUB (int16 n); +import void vt100_CUD (int16 n); +import void vt100_CUF (int16 n); +import void vt100_CUP (int16 n, int16 m); +import void vt100_CUU (int16 n); import void vt100_DECTCEMh (void); import void vt100_DECTCEMl (void); -import void vt100_DSR (INTEGER n); -import void vt100_ED (INTEGER n); -import void vt100_EL (INTEGER n); -import void vt100_HVP (INTEGER n, INTEGER m); -import void vt100_IntToStr (LONGINT int_, CHAR *str, LONGINT str__len); +import void vt100_DSR (int16 n); +import void vt100_ED (int16 n); +import void vt100_EL (int16 n); +import void vt100_HVP (int16 n, int16 m); +import void vt100_IntToStr (int32 int_, CHAR *str, LONGINT str__len); import void vt100_RCP (void); import void vt100_SCP (void); -import void vt100_SD (INTEGER n); -import void vt100_SGR (INTEGER n); -import void vt100_SGR2 (INTEGER n, INTEGER m); -import void vt100_SU (INTEGER n); +import void vt100_SD (int16 n); +import void vt100_SGR (int16 n); +import void vt100_SGR2 (int16 n, int16 m); +import void vt100_SU (int16 n); import void vt100_SetAttr (CHAR *attr, LONGINT attr__len); import void *vt100__init(void); diff --git a/bootstrap/windows-88/Console.c b/bootstrap/windows-88/Console.c index 7269d448..4331a772 100644 --- a/bootstrap/windows-88/Console.c +++ b/bootstrap/windows-88/Console.c @@ -5,14 +5,14 @@ static CHAR Console_line[128]; -static INTEGER Console_pos; +static int32 Console_pos; export void Console_Bool (BOOLEAN b); export void Console_Char (CHAR ch); export void Console_Flush (void); -export void Console_Hex (LONGINT i); -export void Console_Int (LONGINT i, LONGINT n); +export void Console_Hex (int64 i); +export void Console_Int (int64 i, int64 n); export void Console_Ln (void); export void Console_Read (CHAR *ch); export void Console_ReadLine (CHAR *line, LONGINT line__len); @@ -21,7 +21,7 @@ export void Console_String (CHAR *s, LONGINT s__len); void Console_Flush (void) { - INTEGER error; + int32 error; error = Platform_Write(Platform_StdOut, (SYSTEM_ADRINT)Console_line, Console_pos); Console_pos = 0; } @@ -40,7 +40,7 @@ void Console_Char (CHAR ch) void Console_String (CHAR *s, LONGINT s__len) { - INTEGER i; + int32 i; __DUP(s, s__len, CHAR); i = 0; while (s[__X(i, s__len)] != 0x00) { @@ -50,11 +50,11 @@ void Console_String (CHAR *s, LONGINT s__len) __DEL(s); } -void Console_Int (LONGINT i, LONGINT n) +void Console_Int (int64 i, int64 n) { CHAR s[32]; - LONGINT i1, k; - if (i == __LSHL(1, 63, LONGINT)) { + int64 i1, k; + if (i == __LSHL(1, 63, int64)) { __MOVE("8085774586302733229", s, 20); k = 19; } else { @@ -96,9 +96,9 @@ void Console_Bool (BOOLEAN b) } } -void Console_Hex (LONGINT i) +void Console_Hex (int64 i) { - LONGINT k, n; + int64 k, n; k = -28; while (k <= 0) { n = __MASK(__ASH(i, k), -16); @@ -113,8 +113,8 @@ void Console_Hex (LONGINT i) void Console_Read (CHAR *ch) { - LONGINT n; - INTEGER error; + int64 n; + int32 error; Console_Flush(); error = Platform_ReadBuf(Platform_StdIn, (void*)&*ch, 1, &n); if (n != 1) { @@ -124,7 +124,7 @@ void Console_Read (CHAR *ch) void Console_ReadLine (CHAR *line, LONGINT line__len) { - LONGINT i; + int64 i; CHAR ch; Console_Flush(); i = 0; diff --git a/bootstrap/windows-88/Console.h b/bootstrap/windows-88/Console.h index 8d9e2fb5..987b5478 100644 --- a/bootstrap/windows-88/Console.h +++ b/bootstrap/windows-88/Console.h @@ -12,8 +12,8 @@ import void Console_Bool (BOOLEAN b); import void Console_Char (CHAR ch); import void Console_Flush (void); -import void Console_Hex (LONGINT i); -import void Console_Int (LONGINT i, LONGINT n); +import void Console_Hex (int64 i); +import void Console_Int (int64 i, int64 n); import void Console_Ln (void); import void Console_Read (CHAR *ch); import void Console_ReadLine (CHAR *line, LONGINT line__len); diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 5ec9a8a2..0c20d87b 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -14,7 +14,7 @@ typedef struct Files_BufDesc { Files_File f; BOOLEAN chg; - LONGINT org, size; + int64 org, size; SYSTEM_BYTE data[4096]; } Files_BufDesc; @@ -29,23 +29,23 @@ typedef Files_FileName workName, registerName; BOOLEAN tempFile; Platform_FileIdentity identity; - LONGINT fd, len, pos; + int64 fd, len, pos; Files_Buffer bufs[4]; - INTEGER swapper, state; + int32 swapper, state; Files_File next; } Files_FileDesc; typedef struct Files_Rider { - LONGINT res; + int64 res; BOOLEAN eof; Files_Buffer buf; - LONGINT org, offset; + int64 org, offset; } Files_Rider; static Files_File Files_files; -static INTEGER Files_tempno; +static int32 Files_tempno; static CHAR Files_HOME[1024]; static struct { LONGINT len[1]; @@ -58,56 +58,56 @@ export LONGINT *Files_Rider__typ; export Files_File Files_Base (Files_Rider *r, LONGINT *r__typ); static Files_File Files_CacheEntry (Platform_FileIdentity identity); -export void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INTEGER *res); +export void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int32 *res); export void Files_Close (Files_File f); static void Files_CloseOSFile (Files_File f); static void Files_Create (Files_File f); -export void Files_Delete (CHAR *name, LONGINT name__len, INTEGER *res); -static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INTEGER errcode); +export void Files_Delete (CHAR *name, LONGINT name__len, int32 *res); +static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int32 errcode); static void Files_Finalize (SYSTEM_PTR o); static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *dest, LONGINT dest__len); static void Files_Flush (Files_Buffer buf); -export void Files_GetDate (Files_File f, LONGINT *t, LONGINT *d); +export void Files_GetDate (Files_File f, int64 *t, int64 *d); export void Files_GetName (Files_File f, CHAR *name, LONGINT name__len); static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *name, LONGINT name__len); static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len); -export LONGINT Files_Length (Files_File f); +export int64 Files_Length (Files_File f); static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT name__len, CHAR *dest, LONGINT dest__len); export Files_File Files_New (CHAR *name, LONGINT name__len); export Files_File Files_Old (CHAR *name, LONGINT name__len); -export LONGINT Files_Pos (Files_Rider *r, LONGINT *r__typ); +export int64 Files_Pos (Files_Rider *r, LONGINT *r__typ); export void Files_Purge (Files_File f); export void Files_Read (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x); export void Files_ReadBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN *x); export void Files_ReadByte (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len); -export void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, LONGINT n); -export void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, INTEGER *x); -export void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, LONGINT *x); +export void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int64 n); +export void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, int32 *x); +export void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, int64 *x); export void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x); export void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); -export void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, LONGINT *x); +export void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int64 *x); export void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x); export void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x); export void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); export void Files_Register (Files_File f); -export void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INTEGER *res); -static void Files_ScanPath (INTEGER *pos, CHAR *dir, LONGINT dir__len); -export void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, LONGINT pos); +export void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int32 *res); +static void Files_ScanPath (int32 *pos, CHAR *dir, LONGINT dir__len); +export void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, int64 pos); export void Files_SetSearchPath (CHAR *path, LONGINT path__len); export void Files_Write (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE x); export void Files_WriteBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN x); -export void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, LONGINT n); -export void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, INTEGER x); -export void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, LONGINT x); +export void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int64 n); +export void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, int32 x); +export void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, int64 x); export void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x); -export void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, LONGINT x); +export void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int64 x); export void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x); export void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x); export void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); #define Files_IdxTrap() __HALT(-1) -static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INTEGER errcode) +static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int32 errcode) { __DUP(s, s__len, CHAR); Console_Ln(); @@ -136,7 +136,7 @@ static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INTEGER errcode) static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT name__len, CHAR *dest, LONGINT dest__len) { - INTEGER i, j; + int32 i, j; __DUP(dir, dir__len, CHAR); __DUP(name, name__len, CHAR); i = 0; @@ -161,7 +161,7 @@ static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *name, LONGINT name__len) { - LONGINT n, i, j; + int64 n, i, j; __DUP(finalName, finalName__len, CHAR); Files_tempno += 1; n = Files_tempno; @@ -213,7 +213,7 @@ static void Files_Create (Files_File f) { Platform_FileIdentity identity; BOOLEAN done; - INTEGER error; + int32 error; CHAR err[32]; if (f->fd == -1) { if (f->state == 1) { @@ -250,7 +250,7 @@ static void Files_Create (Files_File f) static void Files_Flush (Files_Buffer buf) { - INTEGER error; + int32 error; Files_File f = NIL; if (buf->chg) { f = buf->f; @@ -274,7 +274,7 @@ static void Files_Flush (Files_Buffer buf) static void Files_CloseOSFile (Files_File f) { Files_File prev = NIL; - INTEGER error; + int32 error; if (Files_files == f) { Files_files = f->next; } else { @@ -294,8 +294,8 @@ static void Files_CloseOSFile (Files_File f) void Files_Close (Files_File f) { - LONGINT i; - INTEGER error; + int64 i; + int32 error; if (f->state != 1 || f->registerName[0] != 0x00) { Files_Create(f); i = 0; @@ -311,9 +311,9 @@ void Files_Close (Files_File f) } } -LONGINT Files_Length (Files_File f) +int64 Files_Length (Files_File f) { - LONGINT _o_result; + int64 _o_result; _o_result = f->len; return _o_result; } @@ -336,9 +336,9 @@ Files_File Files_New (CHAR *name, LONGINT name__len) return _o_result; } -static void Files_ScanPath (INTEGER *pos, CHAR *dir, LONGINT dir__len) +static void Files_ScanPath (int32 *pos, CHAR *dir, LONGINT dir__len) { - INTEGER i; + int32 i; CHAR ch; i = 0; if (Files_SearchPath == NIL) { @@ -382,7 +382,7 @@ static void Files_ScanPath (INTEGER *pos, CHAR *dir, LONGINT dir__len) static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len) { BOOLEAN _o_result; - INTEGER i; + int32 i; CHAR ch; i = 0; ch = name[0]; @@ -398,7 +398,7 @@ static Files_File Files_CacheEntry (Platform_FileIdentity identity) { Files_File _o_result; Files_File f = NIL; - INTEGER i, error; + int32 i, error; f = Files_files; while (f != NIL) { if (Platform_SameFile(identity, f->identity)) { @@ -428,11 +428,11 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) { Files_File _o_result; Files_File f = NIL; - LONGINT fd; - INTEGER pos; + int64 fd; + int32 pos; BOOLEAN done; CHAR dir[256], path[256]; - INTEGER error; + int32 error; Platform_FileIdentity identity; __DUP(name, name__len, CHAR); if (name[0] != 0x00) { @@ -507,9 +507,9 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) void Files_Purge (Files_File f) { - INTEGER i; + int32 i; Platform_FileIdentity identity; - INTEGER error; + int32 error; i = 0; while (i < 4) { if (f->bufs[i] != NIL) { @@ -529,27 +529,27 @@ void Files_Purge (Files_File f) Platform_SetMTime(&f->identity, Platform_FileIdentity__typ, identity); } -void Files_GetDate (Files_File f, LONGINT *t, LONGINT *d) +void Files_GetDate (Files_File f, int64 *t, int64 *d) { Platform_FileIdentity identity; - INTEGER error; + int32 error; Files_Create(f); error = Platform_Identify(f->fd, &identity, Platform_FileIdentity__typ); Platform_MTimeAsClock(identity, &*t, &*d); } -LONGINT Files_Pos (Files_Rider *r, LONGINT *r__typ) +int64 Files_Pos (Files_Rider *r, LONGINT *r__typ) { - LONGINT _o_result; + int64 _o_result; _o_result = (*r).org + (*r).offset; return _o_result; } -void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, LONGINT pos) +void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, int64 pos) { - LONGINT org, offset, i, n; + int64 org, offset, i, n; Files_Buffer buf = NIL; - INTEGER error; + int32 error; if (f != NIL) { if (pos > f->len) { pos = f->len; @@ -609,7 +609,7 @@ void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, LONGINT pos) void Files_Read (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x) { - LONGINT offset; + int64 offset; Files_Buffer buf = NIL; buf = (*r).buf; offset = (*r).offset; @@ -631,9 +631,9 @@ void Files_Read (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x) } } -void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, LONGINT n) +void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int64 n) { - LONGINT xpos, min, restInBuf, offset; + int64 xpos, min, restInBuf, offset; Files_Buffer buf = NIL; if (n > x__len) { Files_IdxTrap(); @@ -682,7 +682,7 @@ Files_File Files_Base (Files_Rider *r, LONGINT *r__typ) void Files_Write (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE x) { Files_Buffer buf = NIL; - LONGINT offset; + int64 offset; buf = (*r).buf; offset = (*r).offset; if ((*r).org != buf->org || offset >= 4096) { @@ -700,9 +700,9 @@ void Files_Write (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE x) (*r).res = 0; } -void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, LONGINT n) +void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int64 n) { - LONGINT xpos, min, restInBuf, offset; + int64 xpos, min, restInBuf, offset; Files_Buffer buf = NIL; if (n > x__len) { Files_IdxTrap(); @@ -736,17 +736,17 @@ void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT (*r).res = 0; } -void Files_Delete (CHAR *name, LONGINT name__len, INTEGER *res) +void Files_Delete (CHAR *name, LONGINT name__len, int32 *res) { __DUP(name, name__len, CHAR); *res = Platform_Unlink((void*)name, name__len); __DEL(name); } -void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INTEGER *res) +void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int32 *res) { - LONGINT fdold, fdnew, n; - INTEGER error, ignore; + int64 fdold, fdnew, n; + int32 error, ignore; Platform_FileIdentity oldidentity, newidentity; CHAR buf[4096]; __DUP(old, old__len, CHAR); @@ -801,7 +801,7 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT void Files_Register (Files_File f) { - INTEGER idx, errcode; + int32 idx, errcode; Files_File f1 = NIL; CHAR file[104]; if ((f->state == 1 && f->registerName[0] != 0x00)) { @@ -820,7 +820,7 @@ void Files_Register (Files_File f) } } -void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INTEGER *res) +void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int32 *res) { __DUP(path, path__len, CHAR); *res = Platform_Chdir((void*)path, path__len); @@ -829,7 +829,7 @@ void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INTEGER *res) static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *dest, LONGINT dest__len) { - LONGINT i, j; + int64 i, j; if (!Platform_LittleEndian) { i = src__len; j = 0; @@ -848,14 +848,14 @@ void Files_ReadBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN *x) Files_Read(&*R, R__typ, (CHAR*)(void*)&*x); } -void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, INTEGER *x) +void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, int32 *x) { CHAR b[2]; Files_ReadBytes(&*R, R__typ, (void*)b, 2, 2); *x = b[0] + __ASHL(b[1], 8); } -void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, LONGINT *x) +void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, int64 *x) { CHAR b[4]; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); @@ -865,7 +865,7 @@ void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, LONGINT *x) void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x) { CHAR b[4]; - LONGINT l; + int64 l; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); l = ((b[0] + __ASHL(b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); *x = (SET)l; @@ -887,7 +887,7 @@ void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x) void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) { - INTEGER i; + int32 i; CHAR ch; i = 0; do { @@ -899,7 +899,7 @@ void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) { - INTEGER i; + int32 i; CHAR ch; BOOLEAN b; i = 0; @@ -915,20 +915,20 @@ void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) } while (!b); } -void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, LONGINT *x) +void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int64 *x) { - SHORTINT s; + int8 s; CHAR ch; - LONGINT n; + int64 n; s = 0; n = 0; Files_Read(&*R, R__typ, (void*)&ch); while (ch >= 128) { - n += __ASH((SYSTEM_INT64)(ch - 128), s); + n += __ASH((int64)(ch - 128), s); s += 7; Files_Read(&*R, R__typ, (void*)&ch); } - n += __ASH((SYSTEM_INT64)(__MASK(ch, -64) - __ASHL(__ASHR(ch, 6), 6)), s); + n += __ASH((int64)(__MASK(ch, -64) - __ASHL(__ASHR(ch, 6), 6)), s); *x = n; } @@ -937,7 +937,7 @@ void Files_WriteBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN x) Files_Write(&*R, R__typ, __VAL(CHAR, x)); } -void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, INTEGER x) +void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, int32 x) { CHAR b[2]; b[0] = (CHAR)x; @@ -945,7 +945,7 @@ void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, INTEGER x) Files_WriteBytes(&*R, R__typ, (void*)b, 2, 2); } -void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, LONGINT x) +void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, int64 x) { CHAR b[4]; b[0] = (CHAR)x; @@ -958,8 +958,8 @@ void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, LONGINT x) void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x) { CHAR b[4]; - LONGINT i; - i = (LONGINT)x; + int64 i; + i = (int64)x; b[0] = (CHAR)i; b[1] = (CHAR)__ASHR(i, 8); b[2] = (CHAR)__ASHR(i, 16); @@ -983,7 +983,7 @@ void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x) void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) { - INTEGER i; + int32 i; i = 0; while (x[i] != 0x00) { i += 1; @@ -991,7 +991,7 @@ void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len Files_WriteBytes(&*R, R__typ, (void*)x, x__len * 1, i + 1); } -void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, LONGINT x) +void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int64 x) { while (x < -64 || x > 63) { Files_Write(&*R, R__typ, (CHAR)(__MASK(x, -128) + 128)); @@ -1008,7 +1008,7 @@ void Files_GetName (Files_File f, CHAR *name, LONGINT name__len) static void Files_Finalize (SYSTEM_PTR o) { Files_File f = NIL; - LONGINT res; + int64 res; f = (Files_File)(SYSTEM_ADRINT)o; if (f->fd >= 0) { Files_CloseOSFile(f); diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index c2853bea..918f272c 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -12,13 +12,13 @@ typedef typedef struct Files_FileDesc { char _prvt0[248]; - LONGINT fd; + int64 fd; char _prvt1[64]; } Files_FileDesc; typedef struct Files_Rider { - LONGINT res; + int64 res; BOOLEAN eof; char _prvt0[31]; } Files_Rider; @@ -29,39 +29,39 @@ import LONGINT *Files_FileDesc__typ; import LONGINT *Files_Rider__typ; import Files_File Files_Base (Files_Rider *r, LONGINT *r__typ); -import void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INTEGER *res); +import void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int32 *res); import void Files_Close (Files_File f); -import void Files_Delete (CHAR *name, LONGINT name__len, INTEGER *res); -import void Files_GetDate (Files_File f, LONGINT *t, LONGINT *d); +import void Files_Delete (CHAR *name, LONGINT name__len, int32 *res); +import void Files_GetDate (Files_File f, int64 *t, int64 *d); import void Files_GetName (Files_File f, CHAR *name, LONGINT name__len); -import LONGINT Files_Length (Files_File f); +import int64 Files_Length (Files_File f); import Files_File Files_New (CHAR *name, LONGINT name__len); import Files_File Files_Old (CHAR *name, LONGINT name__len); -import LONGINT Files_Pos (Files_Rider *r, LONGINT *r__typ); +import int64 Files_Pos (Files_Rider *r, LONGINT *r__typ); import void Files_Purge (Files_File f); import void Files_Read (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x); import void Files_ReadBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN *x); import void Files_ReadByte (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len); -import void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, LONGINT n); -import void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, INTEGER *x); -import void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, LONGINT *x); +import void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int64 n); +import void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, int32 *x); +import void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, int64 *x); import void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x); import void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); -import void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, LONGINT *x); +import void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int64 *x); import void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x); import void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x); import void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); import void Files_Register (Files_File f); -import void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INTEGER *res); -import void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, LONGINT pos); +import void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int32 *res); +import void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, int64 pos); import void Files_SetSearchPath (CHAR *path, LONGINT path__len); import void Files_Write (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE x); import void Files_WriteBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN x); -import void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, LONGINT n); -import void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, INTEGER x); -import void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, LONGINT x); +import void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int64 n); +import void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, int32 x); +import void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, int64 x); import void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x); -import void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, LONGINT x); +import void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int64 x); import void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x); import void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x); import void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index 5822f690..e96f7807 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -35,7 +35,7 @@ typedef typedef struct Heap_FinDesc { Heap_FinNode next; - LONGINT obj; + int64 obj; BOOLEAN marked; Heap_Finalizer finalize; } Heap_FinDesc; @@ -50,25 +50,25 @@ typedef struct Heap_ModuleDesc { Heap_Module next; Heap_ModuleName name; - LONGINT refcnt; + int64 refcnt; Heap_Cmd cmds; - LONGINT types; + int64 types; Heap_EnumProc enumPtrs; - LONGINT reserved1, reserved2; + int64 reserved1, reserved2; } Heap_ModuleDesc; export SYSTEM_PTR Heap_modules; -static LONGINT Heap_freeList[10]; -static LONGINT Heap_bigBlocks; -export LONGINT Heap_allocated; +static int64 Heap_freeList[10]; +static int64 Heap_bigBlocks; +export int64 Heap_allocated; static BOOLEAN Heap_firstTry; -static LONGINT Heap_heap, Heap_heapend; -export LONGINT Heap_heapsize; +static int64 Heap_heap, Heap_heapend; +export int64 Heap_heapsize; static Heap_FinNode Heap_fin; -static INTEGER Heap_lockdepth; +static int32 Heap_lockdepth; static BOOLEAN Heap_interrupted; -export INTEGER Heap_FileCount; +export int32 Heap_FileCount; export LONGINT *Heap_ModuleDesc__typ; export LONGINT *Heap_CmdDesc__typ; @@ -76,27 +76,27 @@ export LONGINT *Heap_FinDesc__typ; export LONGINT *Heap__1__typ; static void Heap_CheckFin (void); -static void Heap_ExtendHeap (LONGINT blksz); +static void Heap_ExtendHeap (int64 blksz); export void Heap_FINALL (void); static void Heap_Finalize (void); export void Heap_GC (BOOLEAN markStack); -static void Heap_HeapSort (LONGINT n, LONGINT *a, LONGINT a__len); +static void Heap_HeapSort (int64 n, int64 *a, LONGINT a__len); export void Heap_INCREF (Heap_Module m); export void Heap_InitHeap (void); export void Heap_Lock (void); -static void Heap_Mark (LONGINT q); -static void Heap_MarkCandidates (LONGINT n, LONGINT *cand, LONGINT cand__len); +static void Heap_Mark (int64 q); +static void Heap_MarkCandidates (int64 n, int64 *cand, LONGINT cand__len); static void Heap_MarkP (SYSTEM_PTR p); -static void Heap_MarkStack (LONGINT n, LONGINT *cand, LONGINT cand__len); -export SYSTEM_PTR Heap_NEWBLK (LONGINT size); -export SYSTEM_PTR Heap_NEWREC (LONGINT tag); -static LONGINT Heap_NewChunk (LONGINT blksz); +static void Heap_MarkStack (int64 n, int64 *cand, LONGINT cand__len); +export SYSTEM_PTR Heap_NEWBLK (int64 size); +export SYSTEM_PTR Heap_NEWREC (int64 tag); +static int64 Heap_NewChunk (int64 blksz); export void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); export SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -export void Heap_REGTYP (Heap_Module m, LONGINT typ); +export void Heap_REGTYP (Heap_Module m, int64 typ); export void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); static void Heap_Scan (void); -static void Heap_Sift (LONGINT l, LONGINT r, LONGINT *a, LONGINT a__len); +static void Heap_Sift (int64 l, int64 r, int64 *a, LONGINT a__len); export void Heap_Unlock (void); extern void *Heap__init(); @@ -155,9 +155,9 @@ void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) m->cmds = c; } -void Heap_REGTYP (Heap_Module m, LONGINT typ) +void Heap_REGTYP (Heap_Module m, int64 typ) { - __PUT(typ, m->types, LONGINT); + __PUT(typ, m->types, int64); m->types = typ; } @@ -166,17 +166,17 @@ void Heap_INCREF (Heap_Module m) m->refcnt += 1; } -static LONGINT Heap_NewChunk (LONGINT blksz) +static int64 Heap_NewChunk (int64 blksz) { - LONGINT _o_result; - LONGINT chnk; + int64 _o_result; + int64 chnk; chnk = Heap_OSAllocate(blksz + 24); if (chnk != 0) { - __PUT(chnk + 8, chnk + (24 + blksz), LONGINT); - __PUT(chnk + 24, chnk + 32, LONGINT); - __PUT(chnk + 32, blksz, LONGINT); - __PUT(chnk + 40, -8, LONGINT); - __PUT(chnk + 48, Heap_bigBlocks, LONGINT); + __PUT(chnk + 8, chnk + (24 + blksz), int64); + __PUT(chnk + 24, chnk + 32, int64); + __PUT(chnk + 32, blksz, int64); + __PUT(chnk + 40, -8, int64); + __PUT(chnk + 48, Heap_bigBlocks, int64); Heap_bigBlocks = chnk + 24; Heap_heapsize += blksz; } @@ -184,9 +184,9 @@ static LONGINT Heap_NewChunk (LONGINT blksz) return _o_result; } -static void Heap_ExtendHeap (LONGINT blksz) +static void Heap_ExtendHeap (int64 blksz) { - LONGINT size, chnk, j, next; + int64 size, chnk, j, next; if (blksz > 320000) { size = blksz; } else { @@ -195,7 +195,7 @@ static void Heap_ExtendHeap (LONGINT blksz) chnk = Heap_NewChunk(size); if (chnk != 0) { if (chnk < Heap_heap) { - __PUT(chnk, Heap_heap, LONGINT); + __PUT(chnk, Heap_heap, int64); Heap_heap = chnk; } else { j = Heap_heap; @@ -204,8 +204,8 @@ static void Heap_ExtendHeap (LONGINT blksz) j = next; next = Heap_FetchAddress(j); } - __PUT(chnk, next, LONGINT); - __PUT(j, chnk, LONGINT); + __PUT(chnk, next, int64); + __PUT(j, chnk, int64); } if (next == 0) { Heap_heapend = Heap_FetchAddress(chnk + 8); @@ -213,10 +213,10 @@ static void Heap_ExtendHeap (LONGINT blksz) } } -SYSTEM_PTR Heap_NEWREC (LONGINT tag) +SYSTEM_PTR Heap_NEWREC (int64 tag) { SYSTEM_PTR _o_result; - LONGINT i, i0, di, blksz, restsize, t, adr, end, next, prev; + int64 i, i0, di, blksz, restsize, t, adr, end, next, prev; SYSTEM_PTR new; Heap_Lock(); blksz = Heap_FetchAddress(tag); @@ -236,11 +236,11 @@ SYSTEM_PTR Heap_NEWREC (LONGINT tag) di = i - i0; restsize = __ASHL(di, 5); end = adr + restsize; - __PUT(end + 8, blksz, LONGINT); - __PUT(end + 16, -8, LONGINT); - __PUT(end, end + 8, LONGINT); - __PUT(adr + 8, restsize, LONGINT); - __PUT(adr + 24, Heap_freeList[di], LONGINT); + __PUT(end + 8, blksz, int64); + __PUT(end + 16, -8, int64); + __PUT(end, end + 8, int64); + __PUT(adr + 8, restsize, int64); + __PUT(adr + 24, Heap_freeList[di], int64); Heap_freeList[di] = adr; adr += restsize; } @@ -280,22 +280,22 @@ SYSTEM_PTR Heap_NEWREC (LONGINT tag) } restsize = t - blksz; end = adr + restsize; - __PUT(end + 8, blksz, LONGINT); - __PUT(end + 16, -8, LONGINT); - __PUT(end, end + 8, LONGINT); + __PUT(end + 8, blksz, int64); + __PUT(end + 16, -8, int64); + __PUT(end, end + 8, int64); if (restsize > 288) { - __PUT(adr + 8, restsize, LONGINT); + __PUT(adr + 8, restsize, int64); } else { next = Heap_FetchAddress(adr + 24); if (prev == 0) { Heap_bigBlocks = next; } else { - __PUT(prev + 24, next, LONGINT); + __PUT(prev + 24, next, int64); } if (restsize > 0) { di = __ASHR(restsize, 5); - __PUT(adr + 8, restsize, LONGINT); - __PUT(adr + 24, Heap_freeList[di], LONGINT); + __PUT(adr + 8, restsize, int64); + __PUT(adr + 24, Heap_freeList[di], int64); Heap_freeList[di] = adr; } } @@ -304,53 +304,53 @@ SYSTEM_PTR Heap_NEWREC (LONGINT tag) i = adr + 32; end = adr + blksz; while (i < end) { - __PUT(i, 0, LONGINT); - __PUT(i + 8, 0, LONGINT); - __PUT(i + 16, 0, LONGINT); - __PUT(i + 24, 0, LONGINT); + __PUT(i, 0, int64); + __PUT(i + 8, 0, int64); + __PUT(i + 16, 0, int64); + __PUT(i + 24, 0, int64); i += 32; } - __PUT(adr + 24, 0, LONGINT); - __PUT(adr, tag, LONGINT); - __PUT(adr + 8, 0, LONGINT); - __PUT(adr + 16, 0, LONGINT); + __PUT(adr + 24, 0, int64); + __PUT(adr, tag, int64); + __PUT(adr + 8, 0, int64); + __PUT(adr + 16, 0, int64); Heap_allocated += blksz; Heap_Unlock(); _o_result = (SYSTEM_PTR)(SYSTEM_ADRINT)(adr + 8); return _o_result; } -SYSTEM_PTR Heap_NEWBLK (LONGINT size) +SYSTEM_PTR Heap_NEWBLK (int64 size) { SYSTEM_PTR _o_result; - LONGINT blksz, tag; + int64 blksz, tag; SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 63, 5), 5); new = Heap_NEWREC((SYSTEM_ADRINT)&blksz); - tag = ((LONGINT)(SYSTEM_ADRINT)new + blksz) - 24; - __PUT(tag - 8, 0, LONGINT); - __PUT(tag, blksz, LONGINT); - __PUT(tag + 8, -8, LONGINT); - __PUT((LONGINT)(SYSTEM_ADRINT)new - 8, tag, LONGINT); + tag = ((int64)(SYSTEM_ADRINT)new + blksz) - 24; + __PUT(tag - 8, 0, int64); + __PUT(tag, blksz, int64); + __PUT(tag + 8, -8, int64); + __PUT((int64)(SYSTEM_ADRINT)new - 8, tag, int64); Heap_Unlock(); _o_result = new; return _o_result; } -static void Heap_Mark (LONGINT q) +static void Heap_Mark (int64 q) { - LONGINT p, tag, fld, n, offset, tagbits; + int64 p, tag, fld, n, offset, tagbits; if (q != 0) { tagbits = Heap_FetchAddress(q - 8); if (!__ODD(tagbits)) { - __PUT(q - 8, tagbits + 1, LONGINT); + __PUT(q - 8, tagbits + 1, int64); p = 0; tag = tagbits + 8; for (;;) { - __GET(tag, offset, LONGINT); + __GET(tag, offset, int64); if (offset < 0) { - __PUT(q - 8, (tag + offset) + 1, LONGINT); + __PUT(q - 8, (tag + offset) + 1, int64); if (p == 0) { break; } @@ -358,7 +358,7 @@ static void Heap_Mark (LONGINT q) q = p; tag = Heap_FetchAddress(q - 8); tag -= 1; - __GET(tag, offset, LONGINT); + __GET(tag, offset, int64); fld = q + offset; p = Heap_FetchAddress(fld); __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)n, SYSTEM_PTR); @@ -368,8 +368,8 @@ static void Heap_Mark (LONGINT q) if (n != 0) { tagbits = Heap_FetchAddress(n - 8); if (!__ODD(tagbits)) { - __PUT(n - 8, tagbits + 1, LONGINT); - __PUT(q - 8, tag + 1, LONGINT); + __PUT(n - 8, tagbits + 1, int64); + __PUT(q - 8, tag + 1, int64); __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)p, SYSTEM_PTR); p = q; q = n; @@ -385,12 +385,12 @@ static void Heap_Mark (LONGINT q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((LONGINT)(SYSTEM_ADRINT)p); + Heap_Mark((int64)(SYSTEM_ADRINT)p); } static void Heap_Scan (void) { - LONGINT chnk, adr, end, start, tag, i, size, freesize; + int64 chnk, adr, end, start, tag, i, size, freesize; Heap_bigBlocks = 0; i = 1; while (i < 9) { @@ -408,21 +408,21 @@ static void Heap_Scan (void) if (__ODD(tag)) { if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 8, LONGINT); - __PUT(start + 8, freesize, LONGINT); - __PUT(start + 16, -8, LONGINT); + __PUT(start, start + 8, int64); + __PUT(start + 8, freesize, int64); + __PUT(start + 16, -8, int64); i = __ASHR(freesize, 5); freesize = 0; if (i < 9) { - __PUT(start + 24, Heap_freeList[i], LONGINT); + __PUT(start + 24, Heap_freeList[i], int64); Heap_freeList[i] = start; } else { - __PUT(start + 24, Heap_bigBlocks, LONGINT); + __PUT(start + 24, Heap_bigBlocks, int64); Heap_bigBlocks = start; } } tag -= 1; - __PUT(adr, tag, LONGINT); + __PUT(adr, tag, int64); size = Heap_FetchAddress(tag); Heap_allocated += size; adr += size; @@ -434,16 +434,16 @@ static void Heap_Scan (void) } if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 8, LONGINT); - __PUT(start + 8, freesize, LONGINT); - __PUT(start + 16, -8, LONGINT); + __PUT(start, start + 8, int64); + __PUT(start + 8, freesize, int64); + __PUT(start + 16, -8, int64); i = __ASHR(freesize, 5); freesize = 0; if (i < 9) { - __PUT(start + 24, Heap_freeList[i], LONGINT); + __PUT(start + 24, Heap_freeList[i], int64); Heap_freeList[i] = start; } else { - __PUT(start + 24, Heap_bigBlocks, LONGINT); + __PUT(start + 24, Heap_bigBlocks, int64); Heap_bigBlocks = start; } } @@ -451,9 +451,9 @@ static void Heap_Scan (void) } } -static void Heap_Sift (LONGINT l, LONGINT r, LONGINT *a, LONGINT a__len) +static void Heap_Sift (int64 l, int64 r, int64 *a, LONGINT a__len) { - LONGINT i, j, x; + int64 i, j, x; j = l; x = a[j]; for (;;) { @@ -470,9 +470,9 @@ static void Heap_Sift (LONGINT l, LONGINT r, LONGINT *a, LONGINT a__len) a[i] = x; } -static void Heap_HeapSort (LONGINT n, LONGINT *a, LONGINT a__len) +static void Heap_HeapSort (int64 n, int64 *a, LONGINT a__len) { - LONGINT l, r, x; + int64 l, r, x; l = __ASHR(n, 1); r = n - 1; while (l > 0) { @@ -488,9 +488,9 @@ static void Heap_HeapSort (LONGINT n, LONGINT *a, LONGINT a__len) } } -static void Heap_MarkCandidates (LONGINT n, LONGINT *cand, LONGINT cand__len) +static void Heap_MarkCandidates (int64 n, int64 *cand, LONGINT cand__len) { - LONGINT chnk, adr, tag, next, lim, lim1, i, ptr, size; + int64 chnk, adr, tag, next, lim, lim1, i, ptr, size; chnk = Heap_heap; i = 0; lim = cand[n - 1]; @@ -528,7 +528,7 @@ static void Heap_MarkCandidates (LONGINT n, LONGINT *cand, LONGINT cand__len) static void Heap_CheckFin (void) { Heap_FinNode n; - LONGINT tag; + int64 tag; n = Heap_fin; while (n != NIL) { tag = Heap_FetchAddress(n->obj - 8); @@ -577,10 +577,10 @@ void Heap_FINALL (void) } } -static void Heap_MarkStack (LONGINT n, LONGINT *cand, LONGINT cand__len) +static void Heap_MarkStack (int64 n, int64 *cand, LONGINT cand__len) { SYSTEM_PTR frame; - LONGINT inc, nofcand, sp, p, stack0; + int64 inc, nofcand, sp, p, stack0; struct Heap__1 align; if (n > 0) { Heap_MarkStack(n - 1, cand, cand__len); @@ -597,7 +597,7 @@ static void Heap_MarkStack (LONGINT n, LONGINT *cand, LONGINT cand__len) inc = -inc; } while (sp != stack0) { - __GET(sp, p, LONGINT); + __GET(sp, p, int64); if ((p > Heap_heap && p < Heap_heapend)) { if (nofcand == cand__len) { Heap_HeapSort(nofcand, (void*)cand, cand__len); @@ -619,8 +619,8 @@ static void Heap_MarkStack (LONGINT n, LONGINT *cand, LONGINT cand__len) void Heap_GC (BOOLEAN markStack) { Heap_Module m; - LONGINT i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; - LONGINT cand[10000]; + int64 i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; + int64 cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); m = (Heap_Module)(SYSTEM_ADRINT)Heap_modules; @@ -700,7 +700,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (LONGINT)(SYSTEM_ADRINT)obj; + f->obj = (int64)(SYSTEM_ADRINT)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; @@ -711,7 +711,7 @@ void Heap_InitHeap (void) { Heap_heap = Heap_NewChunk(256000); Heap_heapend = Heap_FetchAddress(Heap_heap + 8); - __PUT(Heap_heap, 0, LONGINT); + __PUT(Heap_heap, 0, int64); Heap_allocated = 0; Heap_firstTry = 1; Heap_freeList[9] = 1; diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index 5e7c01fb..40c921e4 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -32,8 +32,8 @@ typedef import SYSTEM_PTR Heap_modules; -import LONGINT Heap_allocated, Heap_heapsize; -import INTEGER Heap_FileCount; +import int64 Heap_allocated, Heap_heapsize; +import int32 Heap_FileCount; import LONGINT *Heap_ModuleDesc__typ; @@ -42,11 +42,11 @@ import void Heap_GC (BOOLEAN markStack); import void Heap_INCREF (Heap_Module m); import void Heap_InitHeap (void); import void Heap_Lock (void); -import SYSTEM_PTR Heap_NEWBLK (LONGINT size); -import SYSTEM_PTR Heap_NEWREC (LONGINT tag); +import SYSTEM_PTR Heap_NEWBLK (int64 size); +import SYSTEM_PTR Heap_NEWREC (int64 tag); import void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); import SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -import void Heap_REGTYP (Heap_Module m, LONGINT typ); +import void Heap_REGTYP (Heap_Module m, int64 typ); import void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); import void Heap_Unlock (void); import void *Heap__init(void); diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 004f1f8b..5f85fd33 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -27,15 +27,15 @@ typedef struct Modules_ModuleDesc { Modules_Module next; Modules_ModuleName name; - LONGINT refcnt; + int64 refcnt; Modules_Cmd cmds; - LONGINT types; - void (*enumPtrs)(void(*)(LONGINT)); - LONGINT reserved1, reserved2; + int64 types; + void (*enumPtrs)(void(*)(int64)); + int64 reserved1, reserved2; } Modules_ModuleDesc; -export INTEGER Modules_res; +export int32 Modules_res; export CHAR Modules_resMsg[256]; export Modules_ModuleName Modules_imported, Modules_importing; @@ -52,7 +52,7 @@ export Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len); static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len) { - INTEGER i, j; + int32 i, j; __DUP(b, b__len, CHAR); i = 0; while (a[__X(i, a__len)] != 0x00) { diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index 6f5e4cad..d61c2889 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -29,15 +29,15 @@ typedef struct Modules_ModuleDesc { Modules_Module next; Modules_ModuleName name; - LONGINT refcnt; + int64 refcnt; Modules_Cmd cmds; - LONGINT types; - void (*enumPtrs)(void(*)(LONGINT)); + int64 types; + void (*enumPtrs)(void(*)(int64)); char _prvt0[16]; } Modules_ModuleDesc; -import INTEGER Modules_res; +import int32 Modules_res; import CHAR Modules_resMsg[256]; import Modules_ModuleName Modules_imported, Modules_importing; diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index eacff2d0..36f97a5d 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -7,13 +7,13 @@ export void (*OPB_typSize)(OPT_Struct); -static INTEGER OPB_exp; -static LONGINT OPB_maxExp; +static int32 OPB_exp; +static int64 OPB_maxExp; export void OPB_Assign (OPT_Node *x, OPT_Node y); -static void OPB_BindNodes (SHORTINT class, OPT_Struct typ, OPT_Node *x, OPT_Node y); -static LONGINT OPB_BoolToInt (BOOLEAN b); +static void OPB_BindNodes (int8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y); +static int64 OPB_BoolToInt (BOOLEAN b); export void OPB_Call (OPT_Node *x, OPT_Node apar, OPT_Object fp); static void OPB_CharToString (OPT_Node n); static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode); @@ -21,10 +21,10 @@ static void OPB_CheckLeaf (OPT_Node x, BOOLEAN dynArrToo); export void OPB_CheckParameters (OPT_Object fp, OPT_Object ap, BOOLEAN checkNames); static void OPB_CheckProc (OPT_Struct x, OPT_Object y); static void OPB_CheckPtr (OPT_Node x, OPT_Node y); -static void OPB_CheckRealType (INTEGER f, INTEGER nr, OPT_Const x); +static void OPB_CheckRealType (int32 f, int32 nr, OPT_Const x); static void OPB_CheckReceiver (OPT_Node *x, OPT_Object fp); -static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y); -export void OPB_Construct (SHORTINT class, OPT_Node *x, OPT_Node y); +static void OPB_ConstOp (int32 op, OPT_Node x, OPT_Node y); +export void OPB_Construct (int8 class, OPT_Node *x, OPT_Node y); static void OPB_Convert (OPT_Node *x, OPT_Struct typ); export void OPB_DeRef (OPT_Node *x); static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpar); @@ -34,17 +34,17 @@ export void OPB_Field (OPT_Node *x, OPT_Object y); export void OPB_In (OPT_Node *x, OPT_Node y); export void OPB_Index (OPT_Node *x, OPT_Node y); export void OPB_Inittd (OPT_Node *inittd, OPT_Node *last, OPT_Struct typ); -static BOOLEAN OPB_IntToBool (LONGINT i); +static BOOLEAN OPB_IntToBool (int64 i); export void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y); -export void OPB_MOp (SHORTINT op, OPT_Node *x); +export void OPB_MOp (int8 op, OPT_Node *x); export OPT_Node OPB_NewBoolConst (BOOLEAN boolval); -export OPT_Node OPB_NewIntConst (LONGINT intval); +export OPT_Node OPB_NewIntConst (int64 intval); export OPT_Node OPB_NewLeaf (OPT_Object obj); export OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ); -export OPT_Node OPB_NewString (OPS_String str, LONGINT len); +export OPT_Node OPB_NewString (OPS_String str, int64 len); export OPT_Node OPB_Nil (void); static BOOLEAN OPB_NotVar (OPT_Node x); -export void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y); +export void OPB_Op (int8 op, OPT_Node *x, OPT_Node y); export void OPB_OptIf (OPT_Node *x); export void OPB_Param (OPT_Node ap, OPT_Object fp); export void OPB_PrepCall (OPT_Node *x, OPT_Object *fpar); @@ -52,17 +52,17 @@ export void OPB_Return (OPT_Node *x, OPT_Object proc); export void OPB_SetElem (OPT_Node *x); static void OPB_SetIntType (OPT_Node node); export void OPB_SetRange (OPT_Node *x, OPT_Node y); -export void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno); -export void OPB_StPar0 (OPT_Node *par0, INTEGER fctno); -export void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno); -export void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n); -export void OPB_StaticLink (SHORTINT dlev); +export void OPB_StFct (OPT_Node *par0, int8 fctno, int32 parno); +export void OPB_StPar0 (OPT_Node *par0, int32 fctno); +export void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno); +export void OPB_StParN (OPT_Node *par0, OPT_Node x, int32 fctno, int32 n); +export void OPB_StaticLink (int8 dlev); export void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard); -static void OPB_err (INTEGER n); -static LONGINT OPB_log (LONGINT x); +static void OPB_err (int32 n); +static int64 OPB_log (int64 x); -static void OPB_err (INTEGER n) +static void OPB_err (int32 n) { OPM_err(n); } @@ -101,7 +101,7 @@ OPT_Node OPB_NewLeaf (OPT_Object obj) return _o_result; } -void OPB_Construct (SHORTINT class, OPT_Node *x, OPT_Node y) +void OPB_Construct (int8 class, OPT_Node *x, OPT_Node y) { OPT_Node node = NIL; node = OPT_NewNode(class); @@ -124,9 +124,9 @@ void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y) *last = y; } -static LONGINT OPB_BoolToInt (BOOLEAN b) +static int64 OPB_BoolToInt (BOOLEAN b) { - LONGINT _o_result; + int64 _o_result; if (b) { _o_result = 1; return _o_result; @@ -137,7 +137,7 @@ static LONGINT OPB_BoolToInt (BOOLEAN b) __RETCHK; } -static BOOLEAN OPB_IntToBool (LONGINT i) +static BOOLEAN OPB_IntToBool (int64 i) { BOOLEAN _o_result; if (i == 0) { @@ -223,8 +223,8 @@ OPT_Node OPB_EmptySet (void) static void OPB_SetIntType (OPT_Node node) { - INTEGER b; - LONGINT n; + int32 b; + int64 n; if (node->conval->intval >= 0) { n = node->conval->intval; } else { @@ -237,7 +237,7 @@ static void OPB_SetIntType (OPT_Node node) node->typ = OPT_IntType(b); } -OPT_Node OPB_NewIntConst (LONGINT intval) +OPT_Node OPB_NewIntConst (int64 intval) { OPT_Node _o_result; OPT_Node x = NIL; @@ -262,7 +262,7 @@ OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ) return _o_result; } -OPT_Node OPB_NewString (OPS_String str, LONGINT len) +OPT_Node OPB_NewString (OPS_String str, int64 len) { OPT_Node _o_result; OPT_Node x = NIL; @@ -294,7 +294,7 @@ static void OPB_CharToString (OPT_Node n) n->obj = NIL; } -static void OPB_BindNodes (SHORTINT class, OPT_Struct typ, OPT_Node *x, OPT_Node y) +static void OPB_BindNodes (int8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y) { OPT_Node node = NIL; node = OPT_NewNode(class); @@ -336,7 +336,7 @@ void OPB_DeRef (OPT_Node *x) void OPB_Index (OPT_Node *x, OPT_Node y) { - INTEGER f; + int32 f; OPT_Struct typ = NIL; f = y->typ->form; if ((*x)->class >= 7) { @@ -461,15 +461,15 @@ void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) void OPB_In (OPT_Node *x, OPT_Node y) { - INTEGER f; - LONGINT k; + int32 f; + int64 k; f = (*x)->typ->form; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); } else if ((f == 4 && y->typ->form == 7)) { if ((*x)->class == 7) { k = (*x)->conval->intval; - if (k < 0 || k > (SYSTEM_INT64)OPM_MaxSet) { + if (k < 0 || k > (int64)OPM_MaxSet) { OPB_err(202); } else if (y->class == 7) { (*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval)); @@ -488,9 +488,9 @@ void OPB_In (OPT_Node *x, OPT_Node y) (*x)->typ = OPT_booltyp; } -static LONGINT OPB_log (LONGINT x) +static int64 OPB_log (int64 x) { - LONGINT _o_result; + int64 _o_result; OPB_exp = 0; if (x > 0) { while (!__ODD(x)) { @@ -502,7 +502,7 @@ static LONGINT OPB_log (LONGINT x) return _o_result; } -static void OPB_CheckRealType (INTEGER f, INTEGER nr, OPT_Const x) +static void OPB_CheckRealType (int32 f, int32 nr, OPT_Const x) { LONGREAL min, max, r; if (f == 5) { @@ -526,9 +526,9 @@ static struct MOp__28 { struct MOp__28 *lnk; } *MOp__28_s; -static OPT_Node NewOp__29 (SHORTINT op, OPT_Struct typ, OPT_Node z); +static OPT_Node NewOp__29 (int8 op, OPT_Struct typ, OPT_Node z); -static OPT_Node NewOp__29 (SHORTINT op, OPT_Struct typ, OPT_Node z) +static OPT_Node NewOp__29 (int8 op, OPT_Struct typ, OPT_Node z) { OPT_Node _o_result; OPT_Node node = NIL; @@ -540,9 +540,9 @@ static OPT_Node NewOp__29 (SHORTINT op, OPT_Struct typ, OPT_Node z) return _o_result; } -void OPB_MOp (SHORTINT op, OPT_Node *x) +void OPB_MOp (int8 op, OPT_Node *x) { - INTEGER f; + int32 f; OPT_Struct typ = NIL; OPT_Node z = NIL; struct MOp__28 _s; @@ -679,7 +679,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) static void OPB_CheckPtr (OPT_Node x, OPT_Node y) { - INTEGER g; + int32 g; OPT_Struct p = NIL, q = NIL, t = NIL; g = y->typ->form; if (g == 11) { @@ -763,17 +763,17 @@ static void OPB_CheckProc (OPT_Struct x, OPT_Object y) static struct ConstOp__13 { OPT_Node *x; - INTEGER *f; + int32 *f; OPT_Const *xval, *yval; struct ConstOp__13 *lnk; } *ConstOp__13_s; -static INTEGER ConstCmp__14 (void); +static int32 ConstCmp__14 (void); -static INTEGER ConstCmp__14 (void) +static int32 ConstCmp__14 (void) { - INTEGER _o_result; - INTEGER res; + int32 _o_result; + int32 res; switch (*ConstOp__13_s->f) { case 0: res = 9; @@ -837,11 +837,11 @@ static INTEGER ConstCmp__14 (void) return _o_result; } -static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) +static void OPB_ConstOp (int32 op, OPT_Node x, OPT_Node y) { - INTEGER f, g; + int32 f, g; OPT_Const xval = NIL, yval = NIL; - LONGINT xv, yv; + int64 xv, yv; BOOLEAN temp; struct ConstOp__13 _s; _s.x = &x; @@ -1117,8 +1117,8 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) static void OPB_Convert (OPT_Node *x, OPT_Struct typ) { OPT_Node node = NIL; - INTEGER f, g; - LONGINT k; + int32 f, g; + int64 k; LONGREAL r; f = (*x)->typ->form; g = typ->form; @@ -1169,14 +1169,14 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) } static struct Op__38 { - INTEGER *f, *g; + int32 *f, *g; struct Op__38 *lnk; } *Op__38_s; -static void NewOp__39 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y); +static void NewOp__39 (int8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y); static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y); -static void NewOp__39 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y) +static void NewOp__39 (int8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y) { OPT_Node node = NIL; node = OPT_NewNode(12); @@ -1219,13 +1219,13 @@ static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) return _o_result; } -void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) +void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) { - INTEGER f, g; + int32 f, g; OPT_Node t = NIL, z = NIL; OPT_Struct typ = NIL; BOOLEAN do_; - LONGINT val; + int64 val; struct Op__38 _s; _s.f = &f; _s.g = &g; @@ -1496,19 +1496,19 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) void OPB_SetRange (OPT_Node *x, OPT_Node y) { - LONGINT k, l; + int64 k, l; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); } else if (((*x)->typ->form == 4 && y->typ->form == 4)) { if ((*x)->class == 7) { k = (*x)->conval->intval; - if (0 > k || k > (SYSTEM_INT64)OPM_MaxSet) { + if (0 > k || k > (int64)OPM_MaxSet) { OPB_err(202); } } if (y->class == 7) { l = y->conval->intval; - if (0 > l || l > (SYSTEM_INT64)OPM_MaxSet) { + if (0 > l || l > (int64)OPM_MaxSet) { OPB_err(202); } } @@ -1531,14 +1531,14 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y) void OPB_SetElem (OPT_Node *x) { - LONGINT k; + int64 k; if ((*x)->class == 8 || (*x)->class == 9) { OPB_err(126); } else if ((*x)->typ->form != 4) { OPB_err(93); } else if ((*x)->class == 7) { k = (*x)->conval->intval; - if ((0 <= k && k <= (SYSTEM_INT64)OPM_MaxSet)) { + if ((0 <= k && k <= (int64)OPM_MaxSet)) { (*x)->conval->setval = __SETOF(k); } else { OPB_err(202); @@ -1553,7 +1553,7 @@ void OPB_SetElem (OPT_Node *x) static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) { OPT_Struct y = NIL; - INTEGER f, g; + int32 f, g; OPT_Struct p = NIL, q = NIL; if (OPM_Verbose) { OPM_LogWLn(); @@ -1696,9 +1696,9 @@ static void OPB_CheckLeaf (OPT_Node x, BOOLEAN dynArrToo) { } -void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) +void OPB_StPar0 (OPT_Node *par0, int32 fctno) { - INTEGER f; + int32 f; OPT_Struct typ = NIL; OPT_Node x = NIL; x = *par0; @@ -1913,7 +1913,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (f == 4) { - if (x->typ->size != (SYSTEM_INT64)OPM_LIntSize) { + if (x->typ->size != (int64)OPM_LIntSize) { OPB_Convert(&x, OPT_linttyp); } } else { @@ -1953,7 +1953,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) OPB_err(126); } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x0810) && x->typ->size == (SYSTEM_INT64)OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x0810) && x->typ->size == (int64)OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } @@ -2006,9 +2006,9 @@ static struct StPar1__52 { struct StPar1__52 *lnk; } *StPar1__52_s; -static OPT_Node NewOp__53 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right); +static OPT_Node NewOp__53 (int8 class, int8 subcl, OPT_Node left, OPT_Node right); -static OPT_Node NewOp__53 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right) +static OPT_Node NewOp__53 (int8 class, int8 subcl, OPT_Node left, OPT_Node right) { OPT_Node _o_result; OPT_Node node = NIL; @@ -2020,9 +2020,9 @@ static OPT_Node NewOp__53 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_No return _o_result; } -void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) +void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) { - INTEGER f, L; + int32 f, L; OPT_Struct typ = NIL; OPT_Node p = NIL, t = NIL; struct StPar1__52 _s; @@ -2051,7 +2051,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (f == 4) { - if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > (SYSTEM_INT64)OPM_MaxSet))) { + if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > (int64)OPM_MaxSet))) { OPB_err(202); } p = NewOp__53(19, fctno, p, x); @@ -2064,7 +2064,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (!(f == 4) || x->class != 7) { OPB_err(69); } else if (x->typ->size == 1) { - L = (SYSTEM_INT32)x->conval->intval; + L = (int32)x->conval->intval; typ = p->typ; while ((L > 0 && __IN(typ->comp, 0x0c))) { typ = typ->BaseTyp; @@ -2222,7 +2222,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) OPB_err(126); } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x0810) && x->typ->size == (SYSTEM_INT64)OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x0810) && x->typ->size == (int64)OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } @@ -2260,10 +2260,10 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) StPar1__52_s = _s.lnk; } -void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n) +void OPB_StParN (OPT_Node *par0, OPT_Node x, int32 fctno, int32 n) { OPT_Node node = NIL; - INTEGER f; + int32 f; OPT_Node p = NIL; p = *par0; f = x->typ->form; @@ -2305,9 +2305,9 @@ void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n) *par0 = p; } -void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno) +void OPB_StFct (OPT_Node *par0, int8 fctno, int32 parno) { - INTEGER dim; + int32 dim; OPT_Node x = NIL, p = NIL; p = *par0; if (fctno <= 19) { @@ -2371,7 +2371,7 @@ void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno) static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpar) { - INTEGER f; + int32 f; f = atyp->comp; ftyp = ftyp->BaseTyp; atyp = atyp->BaseTyp; @@ -2480,7 +2480,7 @@ void OPB_Param (OPT_Node ap, OPT_Object fp) } } -void OPB_StaticLink (SHORTINT dlev) +void OPB_StaticLink (int8 dlev) { OPT_Object scope = NIL; scope = OPT_topScope; @@ -2495,7 +2495,7 @@ void OPB_Call (OPT_Node *x, OPT_Node apar, OPT_Object fp) { OPT_Struct typ = NIL; OPT_Node p = NIL; - SHORTINT lev; + int8 lev; if ((*x)->class == 9) { typ = (*x)->typ; lev = (*x)->obj->mnolev; @@ -2555,7 +2555,7 @@ void OPB_Return (OPT_Node *x, OPT_Object proc) void OPB_Assign (OPT_Node *x, OPT_Node y) { OPT_Node z = NIL; - SHORTINT subcl; + int8 subcl; if ((*x)->class >= 7) { OPB_err(56); } diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index 7b980a10..61a0edcd 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -15,7 +15,7 @@ import void (*OPB_typSize)(OPT_Struct); import void OPB_Assign (OPT_Node *x, OPT_Node y); import void OPB_Call (OPT_Node *x, OPT_Node apar, OPT_Object fp); import void OPB_CheckParameters (OPT_Object fp, OPT_Object ap, BOOLEAN checkNames); -import void OPB_Construct (SHORTINT class, OPT_Node *x, OPT_Node y); +import void OPB_Construct (int8 class, OPT_Node *x, OPT_Node y); import void OPB_DeRef (OPT_Node *x); import OPT_Node OPB_EmptySet (void); import void OPB_Enter (OPT_Node *procdec, OPT_Node stat, OPT_Object proc); @@ -24,25 +24,25 @@ import void OPB_In (OPT_Node *x, OPT_Node y); import void OPB_Index (OPT_Node *x, OPT_Node y); import void OPB_Inittd (OPT_Node *inittd, OPT_Node *last, OPT_Struct typ); import void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y); -import void OPB_MOp (SHORTINT op, OPT_Node *x); +import void OPB_MOp (int8 op, OPT_Node *x); import OPT_Node OPB_NewBoolConst (BOOLEAN boolval); -import OPT_Node OPB_NewIntConst (LONGINT intval); +import OPT_Node OPB_NewIntConst (int64 intval); import OPT_Node OPB_NewLeaf (OPT_Object obj); import OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ); -import OPT_Node OPB_NewString (OPS_String str, LONGINT len); +import OPT_Node OPB_NewString (OPS_String str, int64 len); import OPT_Node OPB_Nil (void); -import void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y); +import void OPB_Op (int8 op, OPT_Node *x, OPT_Node y); import void OPB_OptIf (OPT_Node *x); import void OPB_Param (OPT_Node ap, OPT_Object fp); import void OPB_PrepCall (OPT_Node *x, OPT_Object *fpar); import void OPB_Return (OPT_Node *x, OPT_Object proc); import void OPB_SetElem (OPT_Node *x); import void OPB_SetRange (OPT_Node *x, OPT_Node y); -import void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno); -import void OPB_StPar0 (OPT_Node *par0, INTEGER fctno); -import void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno); -import void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n); -import void OPB_StaticLink (SHORTINT dlev); +import void OPB_StFct (OPT_Node *par0, int8 fctno, int32 parno); +import void OPB_StPar0 (OPT_Node *par0, int32 fctno); +import void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno); +import void OPB_StParN (OPT_Node *par0, OPT_Node x, int32 fctno, int32 n); +import void OPB_StaticLink (int8 dlev); import void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard); import void *OPB__init(void); diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index ad70616c..8310f854 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -6,27 +6,27 @@ #include "OPT.h" -static INTEGER OPC_indentLevel; +static int32 OPC_indentLevel; static BOOLEAN OPC_ptrinit, OPC_mainprog, OPC_ansi; -static SHORTINT OPC_hashtab[105]; -static CHAR OPC_keytab[36][9]; +static int8 OPC_hashtab[105]; +static CHAR OPC_keytab[50][9]; static BOOLEAN OPC_GlbPtrs; static CHAR OPC_BodyNameExt[13]; -export void OPC_Align (LONGINT *adr, LONGINT base); +export void OPC_Align (int64 *adr, int64 base); export void OPC_Andent (OPT_Struct typ); static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames); -export LONGINT OPC_BaseAlignment (OPT_Struct typ); +export int64 OPC_BaseAlignment (OPT_Struct typ); export OPT_Object OPC_BaseTProc (OPT_Object obj); export void OPC_BegBlk (void); export void OPC_BegStat (void); -static void OPC_CProcDefs (OPT_Object obj, INTEGER vis); -export void OPC_Case (LONGINT caseVal, INTEGER form); -static void OPC_CharacterLiteral (LONGINT c); -export void OPC_Cmp (INTEGER rel); +static void OPC_CProcDefs (OPT_Object obj, int32 vis); +export void OPC_Case (int64 caseVal, int32 form); +static void OPC_CharacterLiteral (int64 c); +export void OPC_Cmp (int32 rel); export void OPC_CompleteIdent (OPT_Object obj); -export void OPC_Constant (OPT_Const con, INTEGER form); +export void OPC_Constant (OPT_Const con, int32 form); static void OPC_DeclareBase (OPT_Object dcl); static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef); static void OPC_DeclareParams (OPT_Object par, BOOLEAN macro); @@ -43,45 +43,45 @@ export void OPC_EnterBody (void); export void OPC_EnterProc (OPT_Object proc); export void OPC_ExitBody (void); export void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet); -static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, LONGINT *off, LONGINT *n, LONGINT *curAlign); -static void OPC_FillGap (LONGINT gap, LONGINT off, LONGINT align, LONGINT *n, LONGINT *curAlign); +static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, int64 *off, int64 *n, int64 *curAlign); +static void OPC_FillGap (int64 gap, int64 off, int64 align, int64 *n, int64 *curAlign); export void OPC_GenBdy (OPT_Node n); -static void OPC_GenDynTypes (OPT_Node n, INTEGER vis); +static void OPC_GenDynTypes (OPT_Node n, int32 vis); export void OPC_GenEnumPtrs (OPT_Object var); export void OPC_GenHdr (OPT_Node n); export void OPC_GenHdrIncludes (void); static void OPC_GenHeaderMsg (void); -export void OPC_Halt (LONGINT n); +export void OPC_Halt (int64 n); export void OPC_Ident (OPT_Object obj); -static void OPC_IdentList (OPT_Object obj, INTEGER vis); +static void OPC_IdentList (OPT_Object obj, int32 vis); static void OPC_Include (CHAR *name, LONGINT name__len); -static void OPC_IncludeImports (OPT_Object obj, INTEGER vis); +static void OPC_IncludeImports (OPT_Object obj, int32 vis); export void OPC_Increment (BOOLEAN decrement); -export void OPC_Indent (INTEGER count); +export void OPC_Indent (int32 count); export void OPC_Init (void); static void OPC_InitImports (OPT_Object obj); static void OPC_InitKeywords (void); export void OPC_InitTDesc (OPT_Struct typ); static void OPC_InitTProcs (OPT_Object typ, OPT_Object obj); -export void OPC_IntLiteral (LONGINT n, LONGINT size); -export void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim); +export void OPC_IntLiteral (int64 n, int64 size); +export void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim); static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName); -static INTEGER OPC_Length (CHAR *s, LONGINT s__len); -export LONGINT OPC_NofPtrs (OPT_Struct typ); -static INTEGER OPC_PerfectHash (CHAR *s, LONGINT s__len); +static int32 OPC_Length (CHAR *s, LONGINT s__len); +export int64 OPC_NofPtrs (OPT_Struct typ); +static int32 OPC_PerfectHash (CHAR *s, LONGINT s__len); static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len); static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define); -static void OPC_ProcPredefs (OPT_Object obj, SHORTINT vis); +static void OPC_ProcPredefs (OPT_Object obj, int8 vis); static void OPC_PutBase (OPT_Struct typ); -static void OPC_PutPtrOffsets (OPT_Struct typ, LONGINT adr, LONGINT *cnt); +static void OPC_PutPtrOffsets (OPT_Struct typ, int64 adr, int64 *cnt); static void OPC_RegCmds (OPT_Object obj); export void OPC_SetInclude (BOOLEAN exclude); -export LONGINT OPC_SizeAlignment (LONGINT size); +export int64 OPC_SizeAlignment (int64 size); static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause); -static void OPC_Str1 (CHAR *s, LONGINT s__len, LONGINT x); -static void OPC_StringLiteral (CHAR *s, LONGINT s__len, LONGINT l); +static void OPC_Str1 (CHAR *s, LONGINT s__len, int64 x); +static void OPC_StringLiteral (CHAR *s, LONGINT s__len, int64 l); export void OPC_TDescDecl (OPT_Struct typ); -export void OPC_TypeDefs (OPT_Object obj, INTEGER vis); +export void OPC_TypeDefs (OPT_Object obj, int32 vis); export void OPC_TypeOf (OPT_Object ap); static BOOLEAN OPC_Undefined (OPT_Object obj); @@ -99,14 +99,14 @@ void OPC_Init (void) } } -void OPC_Indent (INTEGER count) +void OPC_Indent (int32 count) { OPC_indentLevel += count; } void OPC_BegStat (void) { - INTEGER i; + int32 i; i = OPC_indentLevel; while (i > 0) { OPM_Write(0x09); @@ -142,10 +142,10 @@ void OPC_EndBlk0 (void) OPM_Write('}'); } -static void OPC_Str1 (CHAR *s, LONGINT s__len, LONGINT x) +static void OPC_Str1 (CHAR *s, LONGINT s__len, int64 x) { CHAR ch; - INTEGER i; + int32 i; __DUP(s, s__len, CHAR); ch = s[0]; i = 0; @@ -161,10 +161,10 @@ static void OPC_Str1 (CHAR *s, LONGINT s__len, LONGINT x) __DEL(s); } -static INTEGER OPC_Length (CHAR *s, LONGINT s__len) +static int32 OPC_Length (CHAR *s, LONGINT s__len) { - INTEGER _o_result; - INTEGER i; + int32 _o_result; + int32 i; i = 0; while (s[__X(i, s__len)] != 0x00) { i += 1; @@ -173,10 +173,10 @@ static INTEGER OPC_Length (CHAR *s, LONGINT s__len) return _o_result; } -static INTEGER OPC_PerfectHash (CHAR *s, LONGINT s__len) +static int32 OPC_PerfectHash (CHAR *s, LONGINT s__len) { - INTEGER _o_result; - INTEGER i, h; + int32 _o_result; + int32 i, h; i = 0; h = 0; while ((s[__X(i, s__len)] != 0x00 && i < 5)) { @@ -189,17 +189,20 @@ static INTEGER OPC_PerfectHash (CHAR *s, LONGINT s__len) void OPC_Ident (OPT_Object obj) { - INTEGER mode, level, h; + int32 mode, level, h; mode = obj->mode; level = obj->mnolev; if ((__IN(mode, 0x62) && level > 0) || __IN(mode, 0x14)) { OPM_WriteStringVar((void*)obj->name, 256); h = OPC_PerfectHash((void*)obj->name, 256); if (OPC_hashtab[__X(h, 105)] >= 0) { - if (__STRCMP(OPC_keytab[__X(OPC_hashtab[__X(h, 105)], 36)], obj->name) == 0) { + if (__STRCMP(OPC_keytab[__X(OPC_hashtab[__X(h, 105)], 50)], obj->name) == 0) { OPM_Write('_'); } } + } else if ((mode == 5 && obj->typ->form == 4)) { + OPM_WriteString((CHAR*)"int", 4); + OPM_WriteInt(__ASHL(obj->typ->size, 3)); } else { if (mode != 5 || obj->linkadr != 2) { if (mode == 13) { @@ -213,7 +216,7 @@ void OPC_Ident (OPT_Object obj) OPM_WriteStringVar((void*)OPM_modName, 32); } OPM_Write('_'); - } else if ((((((obj == OPT_sysptrtyp->strobj || obj == OPT_ainttyp->strobj) || obj == OPT_int8typ->strobj) || obj == OPT_int16typ->strobj) || obj == OPT_int32typ->strobj) || obj == OPT_int64typ->strobj) || obj == OPT_bytetyp->strobj) { + } else if ((obj == OPT_sysptrtyp->strobj || obj == OPT_ainttyp->strobj) || obj == OPT_bytetyp->strobj) { OPM_WriteString((CHAR*)"SYSTEM_", 8); } OPM_WriteStringVar((void*)obj->name, 256); @@ -222,7 +225,7 @@ void OPC_Ident (OPT_Object obj) static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause) { - INTEGER pointers; + int32 pointers; *openClause = 0; if (((typ->strobj == NIL || typ->strobj->name[0] == 0x00) && typ->comp != 4)) { if (__IN(typ->comp, 0x0c)) { @@ -258,7 +261,7 @@ static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef) { OPT_Struct typ = NIL; BOOLEAN varPar, openClause; - INTEGER form, comp; + int32 form, comp; typ = dcl->typ; varPar = ((dcl->mode == 2 && typ->comp != 2) || typ->comp == 3) || scopeDef; OPC_Stars(typ, &openClause); @@ -320,7 +323,7 @@ void OPC_Andent (OPT_Struct typ) static BOOLEAN OPC_Undefined (OPT_Object obj) { BOOLEAN _o_result; - _o_result = obj->name[0] == 0x00 || (((obj->mnolev >= 0 && obj->linkadr != (SYSTEM_INT64)(3 + OPM_currFile))) && obj->linkadr != 2); + _o_result = obj->name[0] == 0x00 || (((obj->mnolev >= 0 && obj->linkadr != (int64)(3 + OPM_currFile))) && obj->linkadr != 2); return _o_result; } @@ -328,8 +331,8 @@ static void OPC_DeclareBase (OPT_Object dcl) { OPT_Struct typ = NIL, prev = NIL; OPT_Object obj = NIL; - INTEGER nofdims; - LONGINT off, n, dummy; + int32 nofdims; + int64 off, n, dummy; typ = dcl->typ; prev = typ; while ((((((((typ->strobj == NIL || typ->comp == 3) || OPC_Undefined(typ->strobj)) && typ->comp != 4)) && typ->form != 10)) && !((typ->form == 11 && typ->BaseTyp->comp == 3)))) { @@ -388,12 +391,12 @@ static void OPC_DeclareBase (OPT_Object dcl) } } -LONGINT OPC_NofPtrs (OPT_Struct typ) +int64 OPC_NofPtrs (OPT_Struct typ) { - LONGINT _o_result; + int64 _o_result; OPT_Object fld = NIL; OPT_Struct btyp = NIL; - LONGINT n; + int64 n; if ((typ->form == 11 && typ->sysflag == 0)) { _o_result = 1; return _o_result; @@ -431,11 +434,11 @@ LONGINT OPC_NofPtrs (OPT_Struct typ) __RETCHK; } -static void OPC_PutPtrOffsets (OPT_Struct typ, LONGINT adr, LONGINT *cnt) +static void OPC_PutPtrOffsets (OPT_Struct typ, int64 adr, int64 *cnt) { OPT_Object fld = NIL; OPT_Struct btyp = NIL; - LONGINT n, i; + int64 n, i; if ((typ->form == 11 && typ->sysflag == 0)) { OPM_WriteInt(adr); OPM_WriteString((CHAR*)", ", 3); @@ -511,7 +514,7 @@ static void OPC_PutBase (OPT_Struct typ) static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName) { OPT_Struct typ = NIL; - INTEGER dim; + int32 dim; if (showParamName) { OPC_Ident(par); OPM_WriteString((CHAR*)"__len", 6); @@ -611,7 +614,7 @@ OPT_Object OPC_BaseTProc (OPT_Object obj) { OPT_Object _o_result; OPT_Struct typ = NIL, base = NIL; - LONGINT mno; + int64 mno; typ = obj->link->typ; if (typ->form == 11) { typ = typ->BaseTyp; @@ -740,7 +743,7 @@ static void OPC_DefineType (OPT_Struct str) static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len) { BOOLEAN _o_result; - INTEGER i; + int32 i; BOOLEAN r; __DUP(y, y__len, CHAR); i = 0; @@ -753,11 +756,11 @@ static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len) return _o_result; } -static void OPC_CProcDefs (OPT_Object obj, INTEGER vis) +static void OPC_CProcDefs (OPT_Object obj, int32 vis) { - INTEGER i; + int32 i; OPT_ConstExt ext = NIL; - INTEGER _for__9; + int32 _for__9; if (obj != NIL) { OPC_CProcDefs(obj->left, vis); if ((((obj->mode == 9 && obj->vis >= vis)) && obj->adr == 1)) { @@ -781,7 +784,7 @@ static void OPC_CProcDefs (OPT_Object obj, INTEGER vis) } } -void OPC_TypeDefs (OPT_Object obj, INTEGER vis) +void OPC_TypeDefs (OPT_Object obj, int32 vis) { if (obj != NIL) { OPC_TypeDefs(obj->left, vis); @@ -813,7 +816,7 @@ static void OPC_DefAnonRecs (OPT_Node n) void OPC_TDescDecl (OPT_Struct typ) { - LONGINT nofptrs; + int64 nofptrs; OPT_Object o = NIL; OPC_BegStat(); OPM_WriteString((CHAR*)"__TDESC(", 9); @@ -828,7 +831,7 @@ void OPC_TDescDecl (OPT_Struct typ) OPC_Str1((CHAR*)", #), {", 8, typ->size); nofptrs = 0; OPC_PutPtrOffsets(typ, 0, &nofptrs); - OPC_Str1((CHAR*)"#}}", 4, -((nofptrs + 1) * (SYSTEM_INT64)OPM_LIntSize)); + OPC_Str1((CHAR*)"#}}", 4, -((nofptrs + 1) * (int64)OPM_LIntSize)); OPC_EndStat(); } @@ -850,7 +853,7 @@ void OPC_InitTDesc (OPT_Struct typ) } } -void OPC_Align (LONGINT *adr, LONGINT base) +void OPC_Align (int64 *adr, int64 base) { switch (base) { case 2: @@ -870,11 +873,11 @@ void OPC_Align (LONGINT *adr, LONGINT base) } } -LONGINT OPC_SizeAlignment (LONGINT size) +int64 OPC_SizeAlignment (int64 size) { - LONGINT _o_result; - LONGINT alignment; - if (size < (SYSTEM_INT64)OPM_Alignment) { + int64 _o_result; + int64 alignment; + if (size < (int64)OPM_Alignment) { alignment = 1; while (alignment < size) { alignment = __ASHL(alignment, 1); @@ -886,10 +889,10 @@ LONGINT OPC_SizeAlignment (LONGINT size) return _o_result; } -LONGINT OPC_BaseAlignment (OPT_Struct typ) +int64 OPC_BaseAlignment (OPT_Struct typ) { - LONGINT _o_result; - LONGINT alignment; + int64 _o_result; + int64 alignment; if (typ->form == 13) { if (typ->comp == 4) { alignment = __MASK(typ->align, -65536); @@ -903,19 +906,19 @@ LONGINT OPC_BaseAlignment (OPT_Struct typ) return _o_result; } -static void OPC_FillGap (LONGINT gap, LONGINT off, LONGINT align, LONGINT *n, LONGINT *curAlign) +static void OPC_FillGap (int64 gap, int64 off, int64 align, int64 *n, int64 *curAlign) { - LONGINT adr; + int64 adr; adr = off; OPC_Align(&adr, align); if ((*curAlign < align && gap - (adr - off) >= align)) { gap -= (adr - off) + align; OPC_BegStat(); - if (align == (SYSTEM_INT64)OPM_IntSize) { + if (align == (int64)OPM_IntSize) { OPM_WriteString((CHAR*)"INTEGER", 8); - } else if (align == (SYSTEM_INT64)OPM_LIntSize) { + } else if (align == (int64)OPM_LIntSize) { OPM_WriteString((CHAR*)"LONGINT", 8); - } else if (align == (SYSTEM_INT64)OPM_LRealSize) { + } else if (align == (int64)OPM_LRealSize) { OPM_WriteString((CHAR*)"LONGREAL", 9); } OPC_Str1((CHAR*)" _prvt#", 8, *n); @@ -932,11 +935,11 @@ static void OPC_FillGap (LONGINT gap, LONGINT off, LONGINT align, LONGINT *n, LO } } -static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, LONGINT *off, LONGINT *n, LONGINT *curAlign) +static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, int64 *off, int64 *n, int64 *curAlign) { OPT_Object fld = NIL; OPT_Struct base = NIL; - LONGINT gap, adr, align, fldAlign; + int64 gap, adr, align, fldAlign; fld = typ->link; align = __MASK(typ->align, -65536); if (typ->BaseTyp != NIL) { @@ -980,7 +983,7 @@ static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, LONGINT *off, LONGINT * } } if (last) { - adr = typ->size - (SYSTEM_INT64)__ASHR(typ->sysflag, 8); + adr = typ->size - (int64)__ASHR(typ->sysflag, 8); if (adr == 0) { gap = 1; } else { @@ -992,11 +995,11 @@ static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, LONGINT *off, LONGINT * } } -static void OPC_IdentList (OPT_Object obj, INTEGER vis) +static void OPC_IdentList (OPT_Object obj, int32 vis) { OPT_Struct base = NIL; BOOLEAN first; - INTEGER lastvis; + int32 lastvis; base = NIL; first = 1; while ((obj != NIL && obj->mode != 13)) { @@ -1121,7 +1124,7 @@ static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define) } } -static void OPC_ProcPredefs (OPT_Object obj, SHORTINT vis) +static void OPC_ProcPredefs (OPT_Object obj, int8 vis) { if (obj != NIL) { OPC_ProcPredefs(obj->left, vis); @@ -1151,7 +1154,7 @@ static void OPC_Include (CHAR *name, LONGINT name__len) __DEL(name); } -static void OPC_IncludeImports (OPT_Object obj, INTEGER vis) +static void OPC_IncludeImports (OPT_Object obj, int32 vis) { if (obj != NIL) { OPC_IncludeImports(obj->left, vis); @@ -1162,7 +1165,7 @@ static void OPC_IncludeImports (OPT_Object obj, INTEGER vis) } } -static void OPC_GenDynTypes (OPT_Node n, INTEGER vis) +static void OPC_GenDynTypes (OPT_Node n, int32 vis) { OPT_Struct typ = NIL; while ((n != NIL && n->class == 14)) { @@ -1210,7 +1213,7 @@ void OPC_GenHdr (OPT_Node n) static void OPC_GenHeaderMsg (void) { - INTEGER i; + int32 i; OPM_WriteString((CHAR*)"/* ", 4); OPM_WriteString((CHAR*)"voc", 4); OPM_Write(' '); @@ -1361,7 +1364,7 @@ static void OPC_InitImports (OPT_Object obj) void OPC_GenEnumPtrs (OPT_Object var) { OPT_Struct typ = NIL; - LONGINT n; + int64 n; OPC_GlbPtrs = 0; while (var != NIL) { typ = var->typ; @@ -1522,7 +1525,7 @@ void OPC_EnterProc (OPT_Object proc) { OPT_Object var = NIL, scope = NIL; OPT_Struct typ = NIL; - INTEGER dim; + int32 dim; if (proc->vis != 1) { OPM_WriteString((CHAR*)"static ", 8); } @@ -1751,7 +1754,7 @@ void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet) void OPC_CompleteIdent (OPT_Object obj) { - INTEGER comp, level; + int32 comp, level; level = obj->mnolev; if (obj->adr == 1) { if (obj->typ->comp == 4) { @@ -1780,7 +1783,7 @@ void OPC_CompleteIdent (OPT_Object obj) void OPC_TypeOf (OPT_Object ap) { - INTEGER i; + int32 i; __ASSERT(ap->typ->comp == 4, 0); if (ap->mode == 2) { if (ap->mnolev != OPM_level) { @@ -1799,7 +1802,7 @@ void OPC_TypeOf (OPT_Object ap) } } -void OPC_Cmp (INTEGER rel) +void OPC_Cmp (int32 rel) { switch (rel) { case 9: @@ -1828,7 +1831,7 @@ void OPC_Cmp (INTEGER rel) } } -static void OPC_CharacterLiteral (LONGINT c) +static void OPC_CharacterLiteral (int64 c) { if (c < 32 || c > 126) { OPM_WriteString((CHAR*)"0x", 3); @@ -1843,10 +1846,10 @@ static void OPC_CharacterLiteral (LONGINT c) } } -static void OPC_StringLiteral (CHAR *s, LONGINT s__len, LONGINT l) +static void OPC_StringLiteral (CHAR *s, LONGINT s__len, int64 l) { - LONGINT i; - INTEGER c; + int64 i; + int32 c; __DUP(s, s__len, CHAR); OPM_Write('"'); i = 0; @@ -1871,7 +1874,7 @@ static void OPC_StringLiteral (CHAR *s, LONGINT s__len, LONGINT l) __DEL(s); } -void OPC_Case (LONGINT caseVal, INTEGER form) +void OPC_Case (int64 caseVal, int32 form) { CHAR ch; OPM_WriteString((CHAR*)"case ", 6); @@ -1909,30 +1912,17 @@ void OPC_Increment (BOOLEAN decrement) } } -void OPC_Halt (LONGINT n) +void OPC_Halt (int64 n) { OPC_Str1((CHAR*)"__HALT(#)", 10, n); } -void OPC_IntLiteral (LONGINT n, LONGINT size) +void OPC_IntLiteral (int64 n, int64 size) { if ((((size > 4 && n <= 2147483647)) && n > (-2147483647-1))) { - switch (size) { - case 2: - OPM_WriteString((CHAR*)"((SYSTEM_INT16)(", 17); - break; - case 4: - OPM_WriteString((CHAR*)"((SYSTEM_INT32)(", 17); - break; - case 8: - OPM_WriteString((CHAR*)"((SYSTEM_INT64)(", 17); - break; - default: - OPM_LogWStr((CHAR*)"Unhandled case in OPC.IntLiteral, size = ", 42); - OPM_LogWNum(size, 1); - OPM_LogWLn(); - break; - } + OPM_WriteString((CHAR*)"((int", 6); + OPM_WriteInt(__ASHL(size, 3)); + OPM_WriteString((CHAR*)")(", 3); OPM_WriteInt(n); OPM_WriteString((CHAR*)"))", 3); } else { @@ -1940,7 +1930,7 @@ void OPC_IntLiteral (LONGINT n, LONGINT size) } } -void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim) +void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim) { if (array->comp == 3) { OPC_CompleteIdent(obj); @@ -1961,11 +1951,11 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim) } } -void OPC_Constant (OPT_Const con, INTEGER form) +void OPC_Constant (OPT_Const con, int32 form) { - INTEGER i; + int32 i; SET s; - LONGINT hex; + int64 hex; BOOLEAN skipLeading; switch (form) { case 1: @@ -2024,7 +2014,7 @@ void OPC_Constant (OPT_Const con, INTEGER form) } static struct InitKeywords__48 { - SHORTINT *n; + int8 *n; struct InitKeywords__48 *lnk; } *InitKeywords__48_s; @@ -2032,18 +2022,18 @@ static void Enter__49 (CHAR *s, LONGINT s__len); static void Enter__49 (CHAR *s, LONGINT s__len) { - INTEGER h; + int32 h; __DUP(s, s__len, CHAR); h = OPC_PerfectHash((void*)s, s__len); OPC_hashtab[__X(h, 105)] = *InitKeywords__48_s->n; - __COPY(s, OPC_keytab[__X(*InitKeywords__48_s->n, 36)], 9); + __COPY(s, OPC_keytab[__X(*InitKeywords__48_s->n, 50)], 9); *InitKeywords__48_s->n += 1; __DEL(s); } static void OPC_InitKeywords (void) { - SHORTINT n, i; + int8 n, i; struct InitKeywords__48 _s; _s.n = &n; _s.lnk = InitKeywords__48_s; @@ -2054,6 +2044,7 @@ static void OPC_InitKeywords (void) OPC_hashtab[__X(i, 105)] = -1; i += 1; } + Enter__49((CHAR*)"adrint", 7); Enter__49((CHAR*)"asm", 4); Enter__49((CHAR*)"auto", 5); Enter__49((CHAR*)"break", 6); @@ -2075,16 +2066,25 @@ static void OPC_InitKeywords (void) Enter__49((CHAR*)"if", 3); Enter__49((CHAR*)"import", 7); Enter__49((CHAR*)"int", 4); + Enter__49((CHAR*)"int16", 6); + Enter__49((CHAR*)"int32", 6); + Enter__49((CHAR*)"int64", 6); + Enter__49((CHAR*)"int8", 5); Enter__49((CHAR*)"long", 5); Enter__49((CHAR*)"register", 9); Enter__49((CHAR*)"return", 7); Enter__49((CHAR*)"short", 6); Enter__49((CHAR*)"signed", 7); Enter__49((CHAR*)"sizeof", 7); + Enter__49((CHAR*)"size_t", 7); Enter__49((CHAR*)"static", 7); Enter__49((CHAR*)"struct", 7); Enter__49((CHAR*)"switch", 7); Enter__49((CHAR*)"typedef", 8); + Enter__49((CHAR*)"uint16", 7); + Enter__49((CHAR*)"uint32", 7); + Enter__49((CHAR*)"uint64", 7); + Enter__49((CHAR*)"uint8", 6); Enter__49((CHAR*)"union", 6); Enter__49((CHAR*)"unsigned", 9); Enter__49((CHAR*)"void", 5); diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index bb250e9a..3c5dedf4 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -10,16 +10,16 @@ -import void OPC_Align (LONGINT *adr, LONGINT base); +import void OPC_Align (int64 *adr, int64 base); import void OPC_Andent (OPT_Struct typ); -import LONGINT OPC_BaseAlignment (OPT_Struct typ); +import int64 OPC_BaseAlignment (OPT_Struct typ); import OPT_Object OPC_BaseTProc (OPT_Object obj); import void OPC_BegBlk (void); import void OPC_BegStat (void); -import void OPC_Case (LONGINT caseVal, INTEGER form); -import void OPC_Cmp (INTEGER rel); +import void OPC_Case (int64 caseVal, int32 form); +import void OPC_Cmp (int32 rel); import void OPC_CompleteIdent (OPT_Object obj); -import void OPC_Constant (OPT_Const con, INTEGER form); +import void OPC_Constant (OPT_Const con, int32 form); import void OPC_DefineInter (OPT_Object proc); import void OPC_EndBlk (void); import void OPC_EndBlk0 (void); @@ -32,19 +32,19 @@ import void OPC_GenBdy (OPT_Node n); import void OPC_GenEnumPtrs (OPT_Object var); import void OPC_GenHdr (OPT_Node n); import void OPC_GenHdrIncludes (void); -import void OPC_Halt (LONGINT n); +import void OPC_Halt (int64 n); import void OPC_Ident (OPT_Object obj); import void OPC_Increment (BOOLEAN decrement); -import void OPC_Indent (INTEGER count); +import void OPC_Indent (int32 count); import void OPC_Init (void); import void OPC_InitTDesc (OPT_Struct typ); -import void OPC_IntLiteral (LONGINT n, LONGINT size); -import void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim); -import LONGINT OPC_NofPtrs (OPT_Struct typ); +import void OPC_IntLiteral (int64 n, int64 size); +import void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim); +import int64 OPC_NofPtrs (OPT_Struct typ); import void OPC_SetInclude (BOOLEAN exclude); -import LONGINT OPC_SizeAlignment (LONGINT size); +import int64 OPC_SizeAlignment (int64 size); import void OPC_TDescDecl (OPT_Struct typ); -import void OPC_TypeDefs (OPT_Object obj, INTEGER vis); +import void OPC_TypeDefs (OPT_Object obj, int32 vis); import void OPC_TypeOf (OPT_Object ap); import void *OPC__init(void); diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 228e7978..d4b582de 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -15,23 +15,23 @@ typedef static CHAR OPM_SourceFileName[256]; -export INTEGER OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet; -export LONGINT OPM_MaxIndex; +export int32 OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet; +export int64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; -export LONGINT OPM_curpos, OPM_errpos, OPM_breakpc; -export INTEGER OPM_currFile, OPM_level, OPM_pc, OPM_entno; +export int64 OPM_curpos, OPM_errpos, OPM_breakpc; +export int32 OPM_currFile, OPM_level, OPM_pc, OPM_entno; export CHAR OPM_modName[32]; export CHAR OPM_objname[64]; export SET OPM_opt, OPM_glbopt; -static LONGINT OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; +static int64 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; static Texts_Reader OPM_inR; static Texts_Text OPM_Log; static Texts_Writer OPM_W; static Files_Rider OPM_oldSF, OPM_newSF; static Files_Rider OPM_R[3]; static Files_File OPM_oldSFile, OPM_newSFile, OPM_HFile, OPM_BFile, OPM_HIFile; -static INTEGER OPM_S; +static int32 OPM_S; export BOOLEAN OPM_dontAsm, OPM_dontLink, OPM_mainProg, OPM_mainLinkStat, OPM_notColorOutput, OPM_forceNewSym, OPM_Verbose; static CHAR OPM_OBERON[1024]; static CHAR OPM_MODULES[1024]; @@ -41,54 +41,54 @@ static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F); export void OPM_CloseFiles (void); export void OPM_CloseOldSym (void); export void OPM_DeleteNewSym (void); -export void OPM_FPrint (LONGINT *fp, LONGINT val); -export void OPM_FPrintLReal (LONGINT *fp, LONGREAL lr); -export void OPM_FPrintReal (LONGINT *fp, REAL real); -export void OPM_FPrintSet (LONGINT *fp, SET set); -static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, LONGINT pos); +export void OPM_FPrint (int64 *fp, int64 val); +export void OPM_FPrintLReal (int64 *fp, LONGREAL lr); +export void OPM_FPrintReal (int64 *fp, REAL real); +export void OPM_FPrintSet (int64 *fp, SET set); +static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, int64 pos); export void OPM_Get (CHAR *ch); static void OPM_GetProperties (void); -static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONGINT name__len, INTEGER *size, INTEGER *align); +static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONGINT name__len, int32 *size, int32 *align); export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); export void OPM_InitOptions (void); -static void OPM_LogErrMsg (INTEGER n); +static void OPM_LogErrMsg (int32 n); export void OPM_LogW (CHAR ch); export void OPM_LogWLn (void); -export void OPM_LogWNum (LONGINT i, LONGINT len); +export void OPM_LogWNum (int64 i, int64 len); export void OPM_LogWStr (CHAR *s, LONGINT s__len); static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len); -export void OPM_Mark (INTEGER n, LONGINT pos); +export void OPM_Mark (int32 n, int64 pos); export void OPM_NewSym (CHAR *modName, LONGINT modName__len); export void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); export void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); export BOOLEAN OPM_OpenPar (void); export void OPM_RegisterNewSym (void); static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt); -static void OPM_ShowLine (LONGINT pos); -export LONGINT OPM_SignedMaximum (LONGINT bytecount); -export LONGINT OPM_SignedMinimum (LONGINT bytecount); +static void OPM_ShowLine (int64 pos); +export int64 OPM_SignedMaximum (int64 bytecount); +export int64 OPM_SignedMinimum (int64 bytecount); export void OPM_SymRCh (CHAR *ch); -export LONGINT OPM_SymRInt (void); +export int64 OPM_SymRInt (void); export void OPM_SymRLReal (LONGREAL *lr); export void OPM_SymRReal (REAL *r); export void OPM_SymRSet (SET *s); export void OPM_SymWCh (CHAR ch); -export void OPM_SymWInt (LONGINT i); +export void OPM_SymWInt (int64 i); export void OPM_SymWLReal (LONGREAL lr); export void OPM_SymWReal (REAL r); export void OPM_SymWSet (SET s); static void OPM_VerboseListSizes (void); export void OPM_Write (CHAR ch); -export void OPM_WriteHex (LONGINT i); -export void OPM_WriteInt (LONGINT i); +export void OPM_WriteHex (int64 i); +export void OPM_WriteInt (int64 i); export void OPM_WriteLn (void); export void OPM_WriteReal (LONGREAL r, CHAR suffx); export void OPM_WriteString (CHAR *s, LONGINT s__len); export void OPM_WriteStringVar (CHAR *s, LONGINT s__len); export BOOLEAN OPM_eofSF (void); -export void OPM_err (INTEGER n); -static LONGINT OPM_minusop (LONGINT i); -static LONGINT OPM_power0 (LONGINT i, LONGINT j); +export void OPM_err (int32 n); +static int64 OPM_minusop (int64 i); +static int64 OPM_power0 (int64 i, int64 j); void OPM_LogW (CHAR ch) @@ -103,7 +103,7 @@ void OPM_LogWStr (CHAR *s, LONGINT s__len) __DEL(s); } -void OPM_LogWNum (LONGINT i, LONGINT len) +void OPM_LogWNum (int64 i, int64 len) { Console_Int(i, len); } @@ -115,7 +115,7 @@ void OPM_LogWLn (void) static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) { - INTEGER i; + int32 i; i = 1; while (s[__X(i, s__len)] != 0x00) { switch (s[__X(i, s__len)]) { @@ -300,7 +300,7 @@ void OPM_InitOptions (void) void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len) { Texts_Text T = NIL; - LONGINT beg, end, time; + int64 beg, end, time; CHAR s[256]; *done = 0; OPM_curpos = 0; @@ -348,7 +348,7 @@ void OPM_Get (CHAR *ch) static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len) { - INTEGER i, j; + int32 i, j; CHAR ch; __DUP(ext, ext__len, CHAR); i = 0; @@ -370,12 +370,12 @@ static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGIN __DEL(ext); } -static void OPM_LogErrMsg (INTEGER n) +static void OPM_LogErrMsg (int32 n) { Texts_Scanner S; Texts_Text T = NIL; CHAR ch; - INTEGER i; + int32 i; CHAR buf[1024]; if (n >= 0) { if (!OPM_notColorOutput) { @@ -400,7 +400,7 @@ static void OPM_LogErrMsg (INTEGER n) OPM_LogWStr(errors_errors[__X(n, 350)], 128); } -static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, LONGINT pos) +static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, int64 pos) { CHAR ch, cheol; if (pos < OPM_ErrorLineStartPos) { @@ -432,12 +432,12 @@ static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, LONGINT Files_Set(&*r, r__typ, f, OPM_ErrorLineStartPos); } -static void OPM_ShowLine (LONGINT pos) +static void OPM_ShowLine (int64 pos) { Files_File f = NIL; Files_Rider r; CHAR line[1023]; - INTEGER i; + int32 i; CHAR ch; f = Files_Old(OPM_SourceFileName, 256); OPM_FindLine(f, &r, Files_Rider__typ, pos); @@ -459,7 +459,7 @@ static void OPM_ShowLine (LONGINT pos) if (pos >= OPM_ErrorLineLimitPos) { pos = OPM_ErrorLineLimitPos - 1; } - i = (SYSTEM_INT32)(pos - OPM_ErrorLineStartPos); + i = (int32)(pos - OPM_ErrorLineStartPos); while (i > 0) { OPM_LogW(' '); i -= 1; @@ -474,7 +474,7 @@ static void OPM_ShowLine (LONGINT pos) Files_Close(f); } -void OPM_Mark (INTEGER n, LONGINT pos) +void OPM_Mark (int32 n, int64 pos) { if (pos == -1) { pos = 0; @@ -526,49 +526,49 @@ void OPM_Mark (INTEGER n, LONGINT pos) } } -void OPM_err (INTEGER n) +void OPM_err (int32 n) { OPM_Mark(n, OPM_errpos); } -void OPM_FPrint (LONGINT *fp, LONGINT val) +void OPM_FPrint (int64 *fp, int64 val) { - *fp = __ROTL((LONGINT)((SET)*fp ^ (SET)val), 1, LONGINT); + *fp = __ROTL((int64)((SET)*fp ^ (SET)val), 1, int64); } -void OPM_FPrintSet (LONGINT *fp, SET set) +void OPM_FPrintSet (int64 *fp, SET set) { - OPM_FPrint(&*fp, (LONGINT)set); + OPM_FPrint(&*fp, (int64)set); } -void OPM_FPrintReal (LONGINT *fp, REAL real) +void OPM_FPrintReal (int64 *fp, REAL real) { - INTEGER i; - LONGINT l; - __GET((SYSTEM_ADRINT)&real, i, INTEGER); + int32 i; + int64 l; + __GET((SYSTEM_ADRINT)&real, i, int32); l = i; OPM_FPrint(&*fp, l); } -void OPM_FPrintLReal (LONGINT *fp, LONGREAL lr) +void OPM_FPrintLReal (int64 *fp, LONGREAL lr) { - LONGINT l, h; - OPM_FPrint(&*fp, __VAL(LONGINT, lr)); + int64 l, h; + OPM_FPrint(&*fp, __VAL(int64, lr)); } -static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONGINT name__len, INTEGER *size, INTEGER *align) +static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONGINT name__len, int32 *size, int32 *align) { __DUP(name, name__len, CHAR); if (((*S).class == 1 && __STRCMP((*S).s, name) == 0)) { Texts_Scan(&*S, S__typ); if ((*S).class == 3) { - *size = (SYSTEM_INT32)(*S).i; + *size = (int32)(*S).i; Texts_Scan(&*S, S__typ); } else { OPM_Mark(-157, -1); } if ((*S).class == 3) { - *align = (SYSTEM_INT32)(*S).i; + *align = (int32)(*S).i; Texts_Scan(&*S, S__typ); } else { OPM_Mark(-157, -1); @@ -579,17 +579,17 @@ static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONG __DEL(name); } -static LONGINT OPM_minusop (LONGINT i) +static int64 OPM_minusop (int64 i) { - LONGINT _o_result; + int64 _o_result; _o_result = -i; return _o_result; } -static LONGINT OPM_power0 (LONGINT i, LONGINT j) +static int64 OPM_power0 (int64 i, int64 j) { - LONGINT _o_result; - LONGINT k, p; + int64 _o_result; + int64 k, p; k = 1; p = i; do { @@ -641,19 +641,19 @@ static void OPM_VerboseListSizes (void) OPM_LogWLn(); } -LONGINT OPM_SignedMaximum (LONGINT bytecount) +int64 OPM_SignedMaximum (int64 bytecount) { - LONGINT _o_result; - LONGINT result; + int64 _o_result; + int64 result; result = 1; - result = __LSH(result, __ASHL(bytecount, 3) - 1, LONGINT); + result = __LSH(result, __ASHL(bytecount, 3) - 1, int64); _o_result = result - 1; return _o_result; } -LONGINT OPM_SignedMinimum (LONGINT bytecount) +int64 OPM_SignedMinimum (int64 bytecount) { - LONGINT _o_result; + int64 _o_result; _o_result = -OPM_SignedMaximum(bytecount) - 1; return _o_result; } @@ -687,10 +687,10 @@ void OPM_SymRCh (CHAR *ch) Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&*ch); } -LONGINT OPM_SymRInt (void) +int64 OPM_SymRInt (void) { - LONGINT _o_result; - LONGINT k; + int64 _o_result; + int64 k; Files_ReadNum(&OPM_oldSF, Files_Rider__typ, &k); _o_result = k; return _o_result; @@ -698,7 +698,7 @@ LONGINT OPM_SymRInt (void) void OPM_SymRSet (SET *s) { - Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (LONGINT*)&*s); + Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (int64*)&*s); } void OPM_SymRReal (REAL *r) @@ -745,14 +745,14 @@ void OPM_SymWCh (CHAR ch) Files_Write(&OPM_newSF, Files_Rider__typ, ch); } -void OPM_SymWInt (LONGINT i) +void OPM_SymWInt (int64 i) { Files_WriteNum(&OPM_newSF, Files_Rider__typ, i); } void OPM_SymWSet (SET s) { - Files_WriteNum(&OPM_newSF, Files_Rider__typ, (LONGINT)s); + Files_WriteNum(&OPM_newSF, Files_Rider__typ, (int64)s); } void OPM_SymWReal (REAL r) @@ -796,7 +796,7 @@ void OPM_Write (CHAR ch) void OPM_WriteString (CHAR *s, LONGINT s__len) { - INTEGER i; + int32 i; i = 0; while (s[__X(i, s__len)] != 0x00) { i += 1; @@ -806,7 +806,7 @@ void OPM_WriteString (CHAR *s, LONGINT s__len) void OPM_WriteStringVar (CHAR *s, LONGINT s__len) { - INTEGER i; + int32 i; i = 0; while (s[__X(i, s__len)] != 0x00) { i += 1; @@ -814,17 +814,17 @@ void OPM_WriteStringVar (CHAR *s, LONGINT s__len) Files_WriteBytes(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, (void*)s, s__len * 1, i); } -void OPM_WriteHex (LONGINT i) +void OPM_WriteHex (int64 i) { CHAR s[3]; - INTEGER digit; - digit = __ASHR((SYSTEM_INT32)i, 4); + int32 digit; + digit = __ASHR((int32)i, 4); if (digit < 10) { s[0] = (CHAR)(48 + digit); } else { s[0] = (CHAR)(87 + digit); } - digit = __MASK((SYSTEM_INT32)i, -16); + digit = __MASK((int32)i, -16); if (digit < 10) { s[1] = (CHAR)(48 + digit); } else { @@ -834,10 +834,10 @@ void OPM_WriteHex (LONGINT i) OPM_WriteString(s, 3); } -void OPM_WriteInt (LONGINT i) +void OPM_WriteInt (int64 i) { CHAR s[20]; - LONGINT i1, k; + int64 i1, k; if (i == OPM_SignedMinimum(OPM_IntSize) || i == OPM_SignedMinimum(OPM_LIntSize)) { OPM_Write('('); OPM_WriteInt(i + 1); @@ -870,7 +870,7 @@ void OPM_WriteReal (LONGREAL r, CHAR suffx) Texts_Reader R; CHAR s[32]; CHAR ch; - INTEGER i; + int32 i; if ((((r < OPM_SignedMaximum(OPM_LIntSize) && r > OPM_SignedMinimum(OPM_LIntSize))) && r == (__ENTIER(r)))) { if (suffx == 'f') { OPM_WriteString((CHAR*)"(REAL)", 7); @@ -958,7 +958,7 @@ void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len) void OPM_CloseFiles (void) { CHAR FName[32]; - INTEGER res; + int32 res; if (OPM_noerr) { OPM_LogWStr((CHAR*)" ", 3); OPM_LogWNum(Files_Pos(&OPM_R[1], Files_Rider__typ), 0); diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index 6bbab25d..ccce7304 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -7,12 +7,12 @@ #include "SYSTEM.h" -import INTEGER OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet; -import LONGINT OPM_MaxIndex; +import int32 OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet; +import int64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; -import LONGINT OPM_curpos, OPM_errpos, OPM_breakpc; -import INTEGER OPM_currFile, OPM_level, OPM_pc, OPM_entno; +import int64 OPM_curpos, OPM_errpos, OPM_breakpc; +import int32 OPM_currFile, OPM_level, OPM_pc, OPM_entno; import CHAR OPM_modName[32]; import CHAR OPM_objname[64]; import SET OPM_opt, OPM_glbopt; @@ -22,44 +22,44 @@ import BOOLEAN OPM_dontAsm, OPM_dontLink, OPM_mainProg, OPM_mainLinkStat, OPM_no import void OPM_CloseFiles (void); import void OPM_CloseOldSym (void); import void OPM_DeleteNewSym (void); -import void OPM_FPrint (LONGINT *fp, LONGINT val); -import void OPM_FPrintLReal (LONGINT *fp, LONGREAL lr); -import void OPM_FPrintReal (LONGINT *fp, REAL real); -import void OPM_FPrintSet (LONGINT *fp, SET set); +import void OPM_FPrint (int64 *fp, int64 val); +import void OPM_FPrintLReal (int64 *fp, LONGREAL lr); +import void OPM_FPrintReal (int64 *fp, REAL real); +import void OPM_FPrintSet (int64 *fp, SET set); import void OPM_Get (CHAR *ch); import void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); import void OPM_InitOptions (void); import void OPM_LogW (CHAR ch); import void OPM_LogWLn (void); -import void OPM_LogWNum (LONGINT i, LONGINT len); +import void OPM_LogWNum (int64 i, int64 len); import void OPM_LogWStr (CHAR *s, LONGINT s__len); -import void OPM_Mark (INTEGER n, LONGINT pos); +import void OPM_Mark (int32 n, int64 pos); import void OPM_NewSym (CHAR *modName, LONGINT modName__len); import void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); import void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); import BOOLEAN OPM_OpenPar (void); import void OPM_RegisterNewSym (void); -import LONGINT OPM_SignedMaximum (LONGINT bytecount); -import LONGINT OPM_SignedMinimum (LONGINT bytecount); +import int64 OPM_SignedMaximum (int64 bytecount); +import int64 OPM_SignedMinimum (int64 bytecount); import void OPM_SymRCh (CHAR *ch); -import LONGINT OPM_SymRInt (void); +import int64 OPM_SymRInt (void); import void OPM_SymRLReal (LONGREAL *lr); import void OPM_SymRReal (REAL *r); import void OPM_SymRSet (SET *s); import void OPM_SymWCh (CHAR ch); -import void OPM_SymWInt (LONGINT i); +import void OPM_SymWInt (int64 i); import void OPM_SymWLReal (LONGREAL lr); import void OPM_SymWReal (REAL r); import void OPM_SymWSet (SET s); import void OPM_Write (CHAR ch); -import void OPM_WriteHex (LONGINT i); -import void OPM_WriteInt (LONGINT i); +import void OPM_WriteHex (int64 i); +import void OPM_WriteInt (int64 i); import void OPM_WriteLn (void); import void OPM_WriteReal (LONGREAL r, CHAR suffx); import void OPM_WriteString (CHAR *s, LONGINT s__len); import void OPM_WriteStringVar (CHAR *s, LONGINT s__len); import BOOLEAN OPM_eofSF (void); -import void OPM_err (INTEGER n); +import void OPM_err (int32 n); import void *OPM__init(void); diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index 9337c539..78136a18 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -7,17 +7,17 @@ #include "OPT.h" struct OPP__1 { - LONGINT low, high; + int64 low, high; }; typedef struct OPP__1 OPP_CaseTable[128]; -static SHORTINT OPP_sym, OPP_level; -static INTEGER OPP_LoopLevel; +static int8 OPP_sym, OPP_level; +static int32 OPP_LoopLevel; static OPT_Node OPP_TDinit, OPP_lastTDinit; -static INTEGER OPP_nofFwdPtr; +static int32 OPP_nofFwdPtr; static OPT_Struct OPP_FwdPtr[64]; export LONGINT *OPP__1__typ; @@ -25,10 +25,10 @@ export LONGINT *OPP__1__typ; static void OPP_ActualParameters (OPT_Node *aparlist, OPT_Object fpar); static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned); static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq); -static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, OPP_CaseTable tab); -static void OPP_CheckMark (SHORTINT *vis); -static void OPP_CheckSym (INTEGER s); -static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_); +static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int32 *n, OPP_CaseTable tab); +static void OPP_CheckMark (int8 *vis); +static void OPP_CheckSym (int32 s); +static void OPP_CheckSysFlag (int32 *sysflag, int32 default_); static void OPP_ConstExpression (OPT_Node *x); static void OPP_Element (OPT_Node *x); static void OPP_Expression (OPT_Node *x); @@ -38,7 +38,7 @@ static void OPP_FormalParameters (OPT_Object *firstPar, OPT_Struct *resTyp); export void OPP_Module (OPT_Node *prog, SET opt); static void OPP_PointerType (OPT_Struct *typ); static void OPP_ProcedureDeclaration (OPT_Node *x); -static void OPP_Receiver (SHORTINT *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec); +static void OPP_Receiver (int8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec); static void OPP_RecordType (OPT_Struct *typ, OPT_Struct *banned); static void OPP_Sets (OPT_Node *x); static void OPP_SimpleExpression (OPT_Node *x); @@ -47,17 +47,17 @@ static void OPP_StatSeq (OPT_Node *stat); static void OPP_Term (OPT_Node *x); static void OPP_Type (OPT_Struct *typ, OPT_Struct *banned); static void OPP_TypeDecl (OPT_Struct *typ, OPT_Struct *banned); -static void OPP_err (INTEGER n); +static void OPP_err (int32 n); static void OPP_qualident (OPT_Object *id); static void OPP_selector (OPT_Node *x); -static void OPP_err (INTEGER n) +static void OPP_err (int32 n) { OPM_err(n); } -static void OPP_CheckSym (INTEGER s) +static void OPP_CheckSym (int32 s) { if (OPP_sym == s) { OPS_Get(&OPP_sym); @@ -69,7 +69,7 @@ static void OPP_CheckSym (INTEGER s) static void OPP_qualident (OPT_Object *id) { OPT_Object obj = NIL; - SHORTINT lev; + int8 lev; OPT_Find(&obj); OPS_Get(&OPP_sym); if ((((OPP_sym == 18 && obj != NIL)) && obj->mode == 11)) { @@ -109,7 +109,7 @@ static void OPP_ConstExpression (OPT_Node *x) } } -static void OPP_CheckMark (SHORTINT *vis) +static void OPP_CheckMark (int8 *vis) { OPS_Get(&OPP_sym); if (OPP_sym == 1 || OPP_sym == 7) { @@ -127,10 +127,10 @@ static void OPP_CheckMark (SHORTINT *vis) } } -static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_) +static void OPP_CheckSysFlag (int32 *sysflag, int32 default_) { OPT_Node x = NIL; - LONGINT sf; + int64 sf; if (OPP_sym == 31) { OPS_Get(&OPP_sym); if (!OPT_SYSimported) { @@ -147,7 +147,7 @@ static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_) OPP_err(51); sf = 0; } - *sysflag = (SYSTEM_INT32)sf; + *sysflag = (int32)sf; OPP_CheckSym(23); } else { *sysflag = default_; @@ -158,7 +158,7 @@ static void OPP_RecordType (OPT_Struct *typ, OPT_Struct *banned) { OPT_Object fld = NIL, first = NIL, last = NIL, base = NIL; OPT_Struct ftyp = NIL; - INTEGER sysflag; + int32 sysflag; *typ = OPT_NewStr(13, 4); (*typ)->BaseTyp = NIL; OPP_CheckSysFlag(&sysflag, -1); @@ -250,8 +250,8 @@ static void OPP_RecordType (OPT_Struct *typ, OPT_Struct *banned) static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) { OPT_Node x = NIL; - LONGINT n; - INTEGER sysflag; + int64 n; + int32 sysflag; OPP_CheckSysFlag(&sysflag, 0); if (OPP_sym == 25) { *typ = OPT_NewStr(13, 3); @@ -343,7 +343,7 @@ static void OPP_PointerType (OPT_Struct *typ) static void OPP_FormalParameters (OPT_Object *firstPar, OPT_Struct *resTyp) { - SHORTINT mode; + int8 mode; OPT_Object par = NIL, first = NIL, last = NIL, res = NIL; OPT_Struct typ = NIL; first = NIL; @@ -624,9 +624,9 @@ static void OPP_ActualParameters (OPT_Node *aparlist, OPT_Object fpar) static void OPP_StandProcCall (OPT_Node *x) { OPT_Node y = NIL; - SHORTINT m; - INTEGER n; - m = (SYSTEM_INT8)((SYSTEM_INT32)(*x)->obj->adr); + int8 m; + int32 n; + m = (int8)((int32)(*x)->obj->adr); n = 0; if (OPP_sym == 30) { OPS_Get(&OPP_sym); @@ -785,7 +785,7 @@ static void OPP_Factor (OPT_Node *x) static void OPP_Term (OPT_Node *x) { OPT_Node y = NIL; - SHORTINT mulop; + int8 mulop; OPP_Factor(&*x); while ((1 <= OPP_sym && OPP_sym <= 5)) { mulop = OPP_sym; @@ -798,7 +798,7 @@ static void OPP_Term (OPT_Node *x) static void OPP_SimpleExpression (OPT_Node *x) { OPT_Node y = NIL; - SHORTINT addop; + int8 addop; if (OPP_sym == 7) { OPS_Get(&OPP_sym); OPP_Term(&*x); @@ -822,7 +822,7 @@ static void OPP_Expression (OPT_Node *x) { OPT_Node y = NIL; OPT_Object obj = NIL; - SHORTINT relation; + int8 relation; OPP_SimpleExpression(&*x); if ((9 <= OPP_sym && OPP_sym <= 14)) { relation = OPP_sym; @@ -848,7 +848,7 @@ static void OPP_Expression (OPT_Node *x) } } -static void OPP_Receiver (SHORTINT *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec) +static void OPP_Receiver (int8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec) { OPT_Object obj = NIL; *typ = OPT_undftyp; @@ -914,7 +914,7 @@ static struct ProcedureDeclaration__16 { OPT_Node *x; OPT_Object *proc, *fwd; OPS_Name *name; - SHORTINT *mode, *vis; + int8 *mode, *vis; BOOLEAN *forward; struct ProcedureDeclaration__16 *lnk; } *ProcedureDeclaration__16_s; @@ -927,8 +927,8 @@ static void TProcDecl__23 (void); static void GetCode__19 (void) { OPT_ConstExt ext = NIL; - INTEGER n; - LONGINT c; + int32 n; + int64 c; ext = OPT_NewExt(); (*ProcedureDeclaration__16_s->proc)->conval->ext = ext; n = 0; @@ -992,7 +992,7 @@ static void GetParams__21 (void) static void Body__17 (void) { OPT_Node procdec = NIL, statseq = NIL; - LONGINT c; + int64 c; c = OPM_errpos; (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1); OPP_CheckSym(39); @@ -1015,7 +1015,7 @@ static void TProcDecl__23 (void) { OPT_Object baseProc = NIL; OPT_Struct objTyp = NIL, recTyp = NIL; - SHORTINT objMode; + int8 objMode; OPS_Name objName; OPS_Get(&OPP_sym); *ProcedureDeclaration__16_s->mode = 13; @@ -1087,7 +1087,7 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) { OPT_Object proc = NIL, fwd = NIL; OPS_Name name; - SHORTINT mode, vis; + int8 mode, vis; BOOLEAN forward; struct ProcedureDeclaration__16 _s; _s.x = x; @@ -1164,11 +1164,11 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) ProcedureDeclaration__16_s = _s.lnk; } -static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, OPP_CaseTable tab) +static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int32 *n, OPP_CaseTable tab) { OPT_Node x = NIL, y = NIL, lastlab = NIL; - INTEGER i, f; - LONGINT xval, yval; + int32 i, f; + int64 xval, yval; *lab = NIL; lastlab = NIL; for (;;) { @@ -1235,7 +1235,7 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, O } static struct StatSeq__30 { - LONGINT *pos; + int64 *pos; struct StatSeq__30 *lnk; } *StatSeq__30_s; @@ -1245,8 +1245,8 @@ static void SetPos__35 (OPT_Node x); static void CasePart__31 (OPT_Node *x) { - INTEGER n; - LONGINT low, high; + int32 n; + int64 low, high; BOOLEAN e; OPP_CaseTable tab; OPT_Node cases = NIL, lab = NIL, y = NIL, lastcase = NIL; @@ -1329,7 +1329,7 @@ static void OPP_StatSeq (OPT_Node *stat) OPT_Struct idtyp = NIL; BOOLEAN e; OPT_Node s = NIL, x = NIL, y = NIL, z = NIL, apar = NIL, last = NIL, lastif = NIL; - LONGINT pos; + int64 pos; OPS_Name name; struct StatSeq__30 _s; _s.pos = &pos; @@ -1622,7 +1622,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) OPT_Struct typ = NIL; OPT_Object obj = NIL, first = NIL, last = NIL; OPT_Node x = NIL, lastdec = NIL; - INTEGER i; + int32 i; first = NIL; last = NIL; OPP_nofFwdPtr = 0; @@ -1775,7 +1775,7 @@ void OPP_Module (OPT_Node *prog, SET opt) { OPS_Name impName, aliasName; OPT_Node procdec = NIL, statseq = NIL; - LONGINT c; + int64 c; BOOLEAN done; OPS_Init(); OPP_LoopLevel = 0; diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index e575dfe6..efd39a62 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -12,29 +12,29 @@ typedef export OPS_Name OPS_name; export OPS_String OPS_str; -export INTEGER OPS_numtyp; -export LONGINT OPS_intval; +export int32 OPS_numtyp; +export int64 OPS_intval; export REAL OPS_realval; export LONGREAL OPS_lrlval; static CHAR OPS_ch; -export void OPS_Get (SHORTINT *sym); -static void OPS_Identifier (SHORTINT *sym); +export void OPS_Get (int8 *sym); +static void OPS_Identifier (int8 *sym); export void OPS_Init (void); static void OPS_Number (void); -static void OPS_Str (SHORTINT *sym); -static void OPS_err (INTEGER n); +static void OPS_Str (int8 *sym); +static void OPS_err (int32 n); -static void OPS_err (INTEGER n) +static void OPS_err (int32 n) { OPM_err(n); } -static void OPS_Str (SHORTINT *sym) +static void OPS_Str (int8 *sym) { - INTEGER i; + int32 i; CHAR och; i = 0; och = OPS_ch; @@ -66,9 +66,9 @@ static void OPS_Str (SHORTINT *sym) } } -static void OPS_Identifier (SHORTINT *sym) +static void OPS_Identifier (int8 *sym) { - INTEGER i; + int32 i; i = 0; do { OPS_name[i] = OPS_ch; @@ -87,10 +87,10 @@ static struct Number__6 { struct Number__6 *lnk; } *Number__6_s; -static INTEGER Ord__7 (CHAR ch, BOOLEAN hex); -static LONGREAL Ten__9 (INTEGER e); +static int32 Ord__7 (CHAR ch, BOOLEAN hex); +static LONGREAL Ten__9 (int32 e); -static LONGREAL Ten__9 (INTEGER e) +static LONGREAL Ten__9 (int32 e) { LONGREAL _o_result; LONGREAL x, p; @@ -109,9 +109,9 @@ static LONGREAL Ten__9 (INTEGER e) return _o_result; } -static INTEGER Ord__7 (CHAR ch, BOOLEAN hex) +static int32 Ord__7 (CHAR ch, BOOLEAN hex) { - INTEGER _o_result; + int32 _o_result; if (ch <= '9') { _o_result = ch - 48; return _o_result; @@ -128,7 +128,7 @@ static INTEGER Ord__7 (CHAR ch, BOOLEAN hex) static void OPS_Number (void) { - INTEGER i, m, n, d, e, maxHdig; + int32 i, m, n, d, e, maxHdig; CHAR dig[24]; LONGREAL f; CHAR expCh; @@ -174,7 +174,7 @@ static void OPS_Number (void) OPS_numtyp = 1; if (n <= 2) { while (i < n) { - OPS_intval = __ASHL(OPS_intval, 4) + (SYSTEM_INT64)Ord__7(dig[i], 1); + OPS_intval = __ASHL(OPS_intval, 4) + (int64)Ord__7(dig[i], 1); i += 1; } } else { @@ -189,7 +189,7 @@ static void OPS_Number (void) OPS_intval = -1; } while (i < n) { - OPS_intval = __ASHL(OPS_intval, 4) + (SYSTEM_INT64)Ord__7(dig[i], 1); + OPS_intval = __ASHL(OPS_intval, 4) + (int64)Ord__7(dig[i], 1); i += 1; } } else { @@ -200,8 +200,8 @@ static void OPS_Number (void) while (i < n) { d = Ord__7(dig[i], 0); i += 1; - if (OPS_intval <= __DIV(9223372036854775807 - (SYSTEM_INT64)d, 10)) { - OPS_intval = OPS_intval * 10 + (SYSTEM_INT64)d; + if (OPS_intval <= __DIV(9223372036854775807 - (int64)d, 10)) { + OPS_intval = OPS_intval * 10 + (int64)d; } else { OPS_err(203); } @@ -310,9 +310,9 @@ static void Comment__2 (void) } } -void OPS_Get (SHORTINT *sym) +void OPS_Get (int8 *sym) { - SHORTINT s; + int8 s; struct Get__1 _s; _s.lnk = Get__1_s; Get__1_s = &_s; diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index a60ffe74..c497e5c6 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -15,13 +15,13 @@ typedef import OPS_Name OPS_name; import OPS_String OPS_str; -import INTEGER OPS_numtyp; -import LONGINT OPS_intval; +import int32 OPS_numtyp; +import int64 OPS_intval; import REAL OPS_realval; import LONGREAL OPS_lrlval; -import void OPS_Get (SHORTINT *sym); +import void OPS_Get (int8 *sym); import void OPS_Init (void); import void *OPS__init(void); diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index 35088301..287c2ba6 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -13,17 +13,17 @@ typedef typedef struct OPT_ConstDesc { OPT_ConstExt ext; - LONGINT intval, intval2; + int64 intval, intval2; SET setval; LONGREAL realval; } OPT_ConstDesc; typedef struct OPT_ExpCtxt { - LONGINT reffp; - INTEGER ref; - SHORTINT nofm; - SHORTINT locmno[64]; + int64 reffp; + int32 ref; + int8 nofm; + int8 locmno[64]; } OPT_ExpCtxt; typedef @@ -34,13 +34,13 @@ typedef typedef struct OPT_ImpCtxt { - LONGINT nextTag, reffp; - INTEGER nofr, minr, nofm; + int64 nextTag, reffp; + int32 nofr, minr, nofm; BOOLEAN self; OPT_Struct ref[255]; OPT_Object old[255]; - LONGINT pvfp[255]; - SHORTINT glbmno[64]; + int64 pvfp[255]; + int8 glbmno[64]; } OPT_ImpCtxt; typedef @@ -49,7 +49,7 @@ typedef typedef struct OPT_NodeDesc { OPT_Node left, right, link; - SHORTINT class, subcl; + int8 class, subcl; BOOLEAN readonly; OPT_Struct typ; OPT_Object obj; @@ -61,22 +61,22 @@ typedef OPT_Object left, right, link, scope; OPS_Name name; BOOLEAN leaf; - SHORTINT mode, mnolev, vis, history; + int8 mode, mnolev, vis, history; BOOLEAN used, fpdone; - LONGINT fprint; + int64 fprint; OPT_Struct typ; OPT_Const conval; - LONGINT adr, linkadr; - INTEGER x; + int64 adr, linkadr; + int32 x; } OPT_ObjDesc; typedef struct OPT_StrDesc { - SHORTINT form, comp, mno, extlev; - INTEGER ref, sysflag; - LONGINT n, size, align, txtpos; + int8 form, comp, mno, extlev; + int32 ref, sysflag; + int64 n, size, align, txtpos; BOOLEAN allocated, pbused, pvused, fpdone, idfpdone; - LONGINT idfp, pbfp, pvfp; + int64 idfp, pbfp, pvfp; OPT_Struct BaseTyp; OPT_Object link, strobj; } OPT_StrDesc; @@ -85,7 +85,7 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; -export SHORTINT OPT_nofGmod; +export int8 OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; export BOOLEAN OPT_SYSimported; @@ -93,7 +93,7 @@ static OPT_Struct OPT_IntTypes[20]; static OPT_Object OPT_universe, OPT_syslink; static OPT_ImpCtxt OPT_impCtxt; static OPT_ExpCtxt OPT_expCtxt; -static LONGINT OPT_nofhdfld; +static int64 OPT_nofhdfld; static BOOLEAN OPT_newsf, OPT_findpc, OPT_extsf, OPT_sfpresent, OPT_symExtended, OPT_symNew; export LONGINT *OPT_ConstDesc__typ; @@ -106,62 +106,62 @@ export LONGINT *OPT_ExpCtxt__typ; export void OPT_Close (void); export void OPT_CloseScope (void); static void OPT_DebugStruct (OPT_Struct btyp); -static void OPT_EnterBoolConst (OPS_Name name, LONGINT value); -static void OPT_EnterProc (OPS_Name name, INTEGER num); -static void OPT_EnterTyp (OPS_Name name, SHORTINT form, INTEGER size, OPT_Struct *res); +static void OPT_EnterBoolConst (OPS_Name name, int64 value); +static void OPT_EnterProc (OPS_Name name, int32 num); +static void OPT_EnterTyp (OPS_Name name, int8 form, int32 size, OPT_Struct *res); export void OPT_Export (BOOLEAN *ext, BOOLEAN *new); -export void OPT_FPrintErr (OPT_Object obj, INTEGER errcode); -static void OPT_FPrintName (LONGINT *fp, CHAR *name, LONGINT name__len); +export void OPT_FPrintErr (OPT_Object obj, int32 errcode); +static void OPT_FPrintName (int64 *fp, CHAR *name, LONGINT name__len); export void OPT_FPrintObj (OPT_Object obj); -static void OPT_FPrintSign (LONGINT *fp, OPT_Struct result, OPT_Object par); +static void OPT_FPrintSign (int64 *fp, OPT_Struct result, OPT_Object par); export void OPT_FPrintStr (OPT_Struct typ); export void OPT_Find (OPT_Object *res); export void OPT_FindField (OPS_Name name, OPT_Struct typ, OPT_Object *res); export void OPT_FindImport (OPT_Object mod, OPT_Object *res); export void OPT_IdFPrint (OPT_Struct typ); export void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); -static void OPT_InConstant (LONGINT f, OPT_Const conval); +static void OPT_InConstant (int64 f, OPT_Const conval); static OPT_Object OPT_InFld (void); -static void OPT_InMod (SHORTINT *mno); +static void OPT_InMod (int8 *mno); static void OPT_InName (CHAR *name, LONGINT name__len); -static OPT_Object OPT_InObj (SHORTINT mno); -static void OPT_InSign (SHORTINT mno, OPT_Struct *res, OPT_Object *par); +static OPT_Object OPT_InObj (int8 mno); +static void OPT_InSign (int8 mno, OPT_Struct *res, OPT_Object *par); static void OPT_InStruct (OPT_Struct *typ); -static OPT_Object OPT_InTProc (SHORTINT mno); -static OPT_Struct OPT_InTyp (LONGINT tag); +static OPT_Object OPT_InTProc (int8 mno); +static OPT_Struct OPT_InTyp (int64 tag); export void OPT_Init (OPS_Name name, SET opt); -static void OPT_InitStruct (OPT_Struct *typ, SHORTINT form); +static void OPT_InitStruct (OPT_Struct *typ, int8 form); export void OPT_Insert (OPS_Name name, OPT_Object *obj); export void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); -export OPT_Struct OPT_IntType (LONGINT size); +export OPT_Struct OPT_IntType (int64 size); export OPT_Const OPT_NewConst (void); export OPT_ConstExt OPT_NewExt (void); -export OPT_Node OPT_NewNode (SHORTINT class); +export OPT_Node OPT_NewNode (int8 class); export OPT_Object OPT_NewObj (void); -export OPT_Struct OPT_NewStr (SHORTINT form, SHORTINT comp); -export void OPT_OpenScope (SHORTINT level, OPT_Object owner); +export OPT_Struct OPT_NewStr (int8 form, int8 comp); +export void OPT_OpenScope (int8 level, OPT_Object owner); static void OPT_OutConstant (OPT_Object obj); -static void OPT_OutFlds (OPT_Object fld, LONGINT adr, BOOLEAN visible); -static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, LONGINT adr); -static void OPT_OutMod (INTEGER mno); +static void OPT_OutFlds (OPT_Object fld, int64 adr, BOOLEAN visible); +static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, int64 adr); +static void OPT_OutMod (int32 mno); static void OPT_OutName (CHAR *name, LONGINT name__len); static void OPT_OutObj (OPT_Object obj); static void OPT_OutSign (OPT_Struct result, OPT_Object par); static void OPT_OutStr (OPT_Struct typ); static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj); -export OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir); -static void OPT_err (INTEGER n); +export OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int32 dir); +static void OPT_err (int32 n); -static void OPT_err (INTEGER n) +static void OPT_err (int32 n) { OPM_err(n); } -OPT_Struct OPT_IntType (LONGINT size) +OPT_Struct OPT_IntType (int64 size) { OPT_Struct _o_result; - INTEGER i; + int32 i; i = 1; while ((OPT_IntTypes[__X(i, 20)]->size < size && OPT_IntTypes[__X(i + 1, 20)] != NIL)) { i += 1; @@ -170,10 +170,10 @@ OPT_Struct OPT_IntType (LONGINT size) return _o_result; } -OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir) +OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int32 dir) { OPT_Struct _o_result; - INTEGER i; + int32 i; __ASSERT(x->form == 4, 0); __ASSERT(dir == 1 || dir == -1, 0); __ASSERT(x->BaseTyp == OPT_undftyp, 0); @@ -204,7 +204,7 @@ OPT_Object OPT_NewObj (void) return _o_result; } -OPT_Struct OPT_NewStr (SHORTINT form, SHORTINT comp) +OPT_Struct OPT_NewStr (int8 form, int8 comp) { OPT_Struct _o_result; OPT_Struct typ = NIL; @@ -221,7 +221,7 @@ OPT_Struct OPT_NewStr (SHORTINT form, SHORTINT comp) return _o_result; } -OPT_Node OPT_NewNode (SHORTINT class) +OPT_Node OPT_NewNode (int8 class) { OPT_Node _o_result; OPT_Node node = NIL; @@ -235,12 +235,12 @@ OPT_ConstExt OPT_NewExt (void) { OPT_ConstExt _o_result; OPT_ConstExt ext = NIL; - ext = __NEWARR(NIL, 1, 1, 1, 0, ((SYSTEM_INT64)(256))); + ext = __NEWARR(NIL, 1, 1, 1, 0, ((int64)(256))); _o_result = ext; return _o_result; } -void OPT_OpenScope (SHORTINT level, OPT_Object owner) +void OPT_OpenScope (int8 level, OPT_Object owner) { OPT_Object head = NIL; head = OPT_NewObj(); @@ -278,7 +278,7 @@ void OPT_Init (OPS_Name name, SET opt) void OPT_Close (void) { - INTEGER i; + int32 i; OPT_CloseScope(); i = 0; while (i < 64) { @@ -370,7 +370,7 @@ void OPT_Insert (OPS_Name name, OPT_Object *obj) { OPT_Object ob0 = NIL, ob1 = NIL; BOOLEAN left; - SHORTINT mnolev; + int8 mnolev; ob0 = OPT_topScope; ob1 = ob0->right; left = 0; @@ -408,9 +408,9 @@ void OPT_Insert (OPS_Name name, OPT_Object *obj) *obj = ob1; } -static void OPT_FPrintName (LONGINT *fp, CHAR *name, LONGINT name__len) +static void OPT_FPrintName (int64 *fp, CHAR *name, LONGINT name__len) { - INTEGER i; + int32 i; CHAR ch; i = 0; do { @@ -453,7 +453,7 @@ static void OPT_DebugStruct (OPT_Struct btyp) OPM_LogWLn(); } -static void OPT_FPrintSign (LONGINT *fp, OPT_Struct result, OPT_Object par) +static void OPT_FPrintSign (int64 *fp, OPT_Struct result, OPT_Object par) { OPT_IdFPrint(result); OPM_FPrint(&*fp, result->idfp); @@ -469,8 +469,8 @@ void OPT_IdFPrint (OPT_Struct typ) { OPT_Struct btyp = NIL; OPT_Object strobj = NIL; - LONGINT idfp; - INTEGER f, c; + int64 idfp; + int32 f, c; if (!typ->idfpdone) { typ->idfpdone = 1; idfp = 0; @@ -499,17 +499,17 @@ void OPT_IdFPrint (OPT_Struct typ) } static struct FPrintStr__12 { - LONGINT *pbfp, *pvfp; + int64 *pbfp, *pvfp; struct FPrintStr__12 *lnk; } *FPrintStr__12_s; -static void FPrintFlds__13 (OPT_Object fld, LONGINT adr, BOOLEAN visible); -static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr); +static void FPrintFlds__13 (OPT_Object fld, int64 adr, BOOLEAN visible); +static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, int64 adr); static void FPrintTProcs__17 (OPT_Object obj); -static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr) +static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, int64 adr) { - LONGINT i, j, n; + int64 i, j, n; OPT_Struct btyp = NIL; if (typ->comp == 4) { FPrintFlds__13(typ->link, adr, 0); @@ -539,7 +539,7 @@ static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr) } } -static void FPrintFlds__13 (OPT_Object fld, LONGINT adr, BOOLEAN visible) +static void FPrintFlds__13 (OPT_Object fld, int64 adr, BOOLEAN visible) { while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { @@ -574,10 +574,10 @@ static void FPrintTProcs__17 (OPT_Object obj) void OPT_FPrintStr (OPT_Struct typ) { - INTEGER f, c; + int32 f, c; OPT_Struct btyp = NIL; OPT_Object strobj = NIL, bstrobj = NIL; - LONGINT pbfp, pvfp; + int64 pbfp, pvfp; struct FPrintStr__12 _s; _s.pbfp = &pbfp; _s.pvfp = &pvfp; @@ -638,8 +638,8 @@ void OPT_FPrintStr (OPT_Struct typ) void OPT_FPrintObj (OPT_Object obj) { - LONGINT fprint; - INTEGER f, m; + int64 fprint; + int32 f, m; REAL rval; OPT_ConstExt ext = NIL; if (!obj->fpdone) { @@ -696,9 +696,9 @@ void OPT_FPrintObj (OPT_Object obj) } } -void OPT_FPrintErr (OPT_Object obj, INTEGER errcode) +void OPT_FPrintErr (OPT_Object obj, int32 errcode) { - INTEGER i, j; + int32 i, j; CHAR ch; if (obj->mnolev != 0) { __COPY(OPT_GlbMod[__X(-obj->mnolev, 64)]->name, OPM_objname, 64); @@ -788,7 +788,7 @@ void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old) static void OPT_InName (CHAR *name, LONGINT name__len) { - INTEGER i; + int32 i; CHAR ch; i = 0; do { @@ -798,12 +798,12 @@ static void OPT_InName (CHAR *name, LONGINT name__len) } while (!(ch == 0x00)); } -static void OPT_InMod (SHORTINT *mno) +static void OPT_InMod (int8 *mno) { OPT_Object head = NIL; OPS_Name name; - LONGINT mn; - SHORTINT i; + int64 mn; + int8 i; mn = OPM_SymRInt(); if (mn == 0) { *mno = OPT_impCtxt.glbmno[0]; @@ -840,10 +840,10 @@ static void OPT_InMod (SHORTINT *mno) } } -static void OPT_InConstant (LONGINT f, OPT_Const conval) +static void OPT_InConstant (int64 f, OPT_Const conval) { CHAR ch; - INTEGER i; + int32 i; OPT_ConstExt ext = NIL; REAL rval; switch (f) { @@ -889,10 +889,10 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval) } } -static void OPT_InSign (SHORTINT mno, OPT_Struct *res, OPT_Object *par) +static void OPT_InSign (int8 mno, OPT_Struct *res, OPT_Object *par) { OPT_Object last = NIL, new = NIL; - LONGINT tag; + int64 tag; OPT_InStruct(&*res); tag = OPM_SymRInt(); last = NIL; @@ -920,7 +920,7 @@ static void OPT_InSign (SHORTINT mno, OPT_Struct *res, OPT_Object *par) static OPT_Object OPT_InFld (void) { OPT_Object _o_result; - LONGINT tag; + int64 tag; OPT_Object obj = NIL; tag = OPT_impCtxt.nextTag; obj = OPT_NewObj(); @@ -949,10 +949,10 @@ static OPT_Object OPT_InFld (void) return _o_result; } -static OPT_Object OPT_InTProc (SHORTINT mno) +static OPT_Object OPT_InTProc (int8 mno) { OPT_Object _o_result; - LONGINT tag; + int64 tag; OPT_Object obj = NIL; tag = OPT_impCtxt.nextTag; obj = OPT_NewObj(); @@ -977,7 +977,7 @@ static OPT_Object OPT_InTProc (SHORTINT mno) return _o_result; } -static OPT_Struct OPT_InTyp (LONGINT tag) +static OPT_Struct OPT_InTyp (int64 tag) { OPT_Struct _o_result; if (tag == 4) { @@ -992,9 +992,9 @@ static OPT_Struct OPT_InTyp (LONGINT tag) static void OPT_InStruct (OPT_Struct *typ) { - SHORTINT mno; - INTEGER ref; - LONGINT tag; + int8 mno; + int32 ref; + int64 tag; OPS_Name name; OPT_Struct t = NIL; OPT_Object obj = NIL, last = NIL, fld = NIL, old = NIL, dummy = NIL; @@ -1050,7 +1050,7 @@ static void OPT_InStruct (OPT_Struct *typ) obj->vis = 0; tag = OPM_SymRInt(); if (tag == 35) { - (*typ)->sysflag = (SYSTEM_INT32)OPM_SymRInt(); + (*typ)->sysflag = (int32)OPM_SymRInt(); tag = OPM_SymRInt(); } switch (tag) { @@ -1172,14 +1172,14 @@ static void OPT_InStruct (OPT_Struct *typ) } } -static OPT_Object OPT_InObj (SHORTINT mno) +static OPT_Object OPT_InObj (int8 mno) { OPT_Object _o_result; - INTEGER i, s; + int32 i, s; CHAR ch; OPT_Object obj = NIL, old = NIL; OPT_Struct typ = NIL; - LONGINT tag; + int64 tag; OPT_ConstExt ext = NIL; tag = OPT_impCtxt.nextTag; if (tag == 19) { @@ -1212,7 +1212,7 @@ static OPT_Object OPT_InObj (SHORTINT mno) obj->mode = 9; ext = OPT_NewExt(); obj->conval->ext = ext; - s = (SYSTEM_INT32)OPM_SymRInt(); + s = (int32)OPM_SymRInt(); (*ext)[0] = (CHAR)s; i = 1; while (i <= s) { @@ -1278,7 +1278,7 @@ static OPT_Object OPT_InObj (SHORTINT mno) void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) { OPT_Object obj = NIL; - SHORTINT mno; + int8 mno; OPS_Name aliasName__copy; __DUPARR(aliasName, OPS_Name); if (__STRCMP(name, "SYSTEM") == 0) { @@ -1321,7 +1321,7 @@ void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) static void OPT_OutName (CHAR *name, LONGINT name__len) { - INTEGER i; + int32 i; CHAR ch; i = 0; do { @@ -1331,7 +1331,7 @@ static void OPT_OutName (CHAR *name, LONGINT name__len) } while (!(ch == 0x00)); } -static void OPT_OutMod (INTEGER mno) +static void OPT_OutMod (int32 mno) { if (OPT_expCtxt.locmno[__X(mno, 64)] < 0) { OPM_SymWInt(16); @@ -1343,9 +1343,9 @@ static void OPT_OutMod (INTEGER mno) } } -static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, LONGINT adr) +static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, int64 adr) { - LONGINT i, j, n; + int64 i, j, n; OPT_Struct btyp = NIL; if (typ->comp == 4) { OPT_OutFlds(typ->link, adr, 0); @@ -1375,7 +1375,7 @@ static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, LONGINT adr) } } -static void OPT_OutFlds (OPT_Object fld, LONGINT adr, BOOLEAN visible) +static void OPT_OutFlds (OPT_Object fld, int64 adr, BOOLEAN visible) { while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { @@ -1530,7 +1530,7 @@ static void OPT_OutStr (OPT_Struct typ) static void OPT_OutConstant (OPT_Object obj) { - INTEGER f; + int32 f; REAL rval; f = obj->typ->form; OPM_SymWInt(f); @@ -1565,7 +1565,7 @@ static void OPT_OutConstant (OPT_Object obj) static void OPT_OutObj (OPT_Object obj) { - INTEGER i, j; + int32 i, j; OPT_ConstExt ext = NIL; if (obj != NIL) { OPT_OutObj(obj->left); @@ -1655,8 +1655,8 @@ static void OPT_OutObj (OPT_Object obj) void OPT_Export (BOOLEAN *ext, BOOLEAN *new) { - INTEGER i; - SHORTINT nofmod; + int32 i; + int8 nofmod; BOOLEAN done; OPT_symExtended = 0; OPT_symNew = 0; @@ -1698,7 +1698,7 @@ void OPT_Export (BOOLEAN *ext, BOOLEAN *new) } } -static void OPT_InitStruct (OPT_Struct *typ, SHORTINT form) +static void OPT_InitStruct (OPT_Struct *typ, int8 form) { *typ = OPT_NewStr(form, 1); (*typ)->ref = form; @@ -1712,7 +1712,7 @@ static void OPT_InitStruct (OPT_Struct *typ, SHORTINT form) (*typ)->idfpdone = 1; } -static void OPT_EnterBoolConst (OPS_Name name, LONGINT value) +static void OPT_EnterBoolConst (OPS_Name name, int64 value) { OPT_Object obj = NIL; OPS_Name name__copy; @@ -1724,7 +1724,7 @@ static void OPT_EnterBoolConst (OPS_Name name, LONGINT value) obj->conval->intval = value; } -static void OPT_EnterTyp (OPS_Name name, SHORTINT form, INTEGER size, OPT_Struct *res) +static void OPT_EnterTyp (OPS_Name name, int8 form, int32 size, OPT_Struct *res) { OPT_Object obj = NIL; OPT_Struct typ = NIL; @@ -1747,7 +1747,7 @@ static void OPT_EnterTyp (OPS_Name name, SHORTINT form, INTEGER size, OPT_Struct *res = typ; } -static void OPT_EnterProc (OPS_Name name, INTEGER num) +static void OPT_EnterProc (OPS_Name name, int32 num) { OPT_Object obj = NIL; OPS_Name name__copy; diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index c3fdc0cf..808e8043 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -16,7 +16,7 @@ typedef typedef struct OPT_ConstDesc { OPT_ConstExt ext; - LONGINT intval, intval2; + int64 intval, intval2; SET setval; LONGREAL realval; } OPT_ConstDesc; @@ -33,7 +33,7 @@ typedef typedef struct OPT_NodeDesc { OPT_Node left, right, link; - SHORTINT class, subcl; + int8 class, subcl; BOOLEAN readonly; OPT_Struct typ; OPT_Object obj; @@ -45,20 +45,20 @@ typedef OPT_Object left, right, link, scope; OPS_Name name; BOOLEAN leaf; - SHORTINT mode, mnolev, vis, history; + int8 mode, mnolev, vis, history; BOOLEAN used, fpdone; - LONGINT fprint; + int64 fprint; OPT_Struct typ; OPT_Const conval; - LONGINT adr, linkadr; - INTEGER x; + int64 adr, linkadr; + int32 x; } OPT_ObjDesc; typedef struct OPT_StrDesc { - SHORTINT form, comp, mno, extlev; - INTEGER ref, sysflag; - LONGINT n, size, align, txtpos; + int8 form, comp, mno, extlev; + int32 ref, sysflag; + int64 n, size, align, txtpos; BOOLEAN allocated, pbused, pvused; char _prvt0[24]; OPT_Struct BaseTyp; @@ -69,7 +69,7 @@ typedef import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; -import SHORTINT OPT_nofGmod; +import int8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; import BOOLEAN OPT_SYSimported; @@ -82,7 +82,7 @@ import LONGINT *OPT_NodeDesc__typ; import void OPT_Close (void); import void OPT_CloseScope (void); import void OPT_Export (BOOLEAN *ext, BOOLEAN *new); -import void OPT_FPrintErr (OPT_Object obj, INTEGER errcode); +import void OPT_FPrintErr (OPT_Object obj, int32 errcode); import void OPT_FPrintObj (OPT_Object obj); import void OPT_FPrintStr (OPT_Struct typ); import void OPT_Find (OPT_Object *res); @@ -93,14 +93,14 @@ import void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); import void OPT_Init (OPS_Name name, SET opt); import void OPT_Insert (OPS_Name name, OPT_Object *obj); import void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); -import OPT_Struct OPT_IntType (LONGINT size); +import OPT_Struct OPT_IntType (int64 size); import OPT_Const OPT_NewConst (void); import OPT_ConstExt OPT_NewExt (void); -import OPT_Node OPT_NewNode (SHORTINT class); +import OPT_Node OPT_NewNode (int8 class); import OPT_Object OPT_NewObj (void); -import OPT_Struct OPT_NewStr (SHORTINT form, SHORTINT comp); -import void OPT_OpenScope (SHORTINT level, OPT_Object owner); -import OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir); +import OPT_Struct OPT_NewStr (int8 form, int8 comp); +import void OPT_OpenScope (int8 level, OPT_Object owner); +import OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int32 dir); import void *OPT__init(void); diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index c769935e..5b1ffe19 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -8,15 +8,15 @@ typedef struct OPV_ExitInfo { - INTEGER level, label; + int32 level, label; } OPV_ExitInfo; static BOOLEAN OPV_assert, OPV_inxchk, OPV_mainprog, OPV_ansi; -static INTEGER OPV_stamp; -static LONGINT OPV_recno; +static int32 OPV_stamp; +static int64 OPV_recno; static OPV_ExitInfo OPV_exit; -static INTEGER OPV_nofExitLabels; +static int32 OPV_nofExitLabels; static BOOLEAN OPV_naturalAlignment; export LONGINT *OPV_ExitInfo__typ; @@ -24,38 +24,38 @@ export LONGINT *OPV_ExitInfo__typ; static void OPV_ActualPar (OPT_Node n, OPT_Object fp); export void OPV_AdrAndSize (OPT_Object topScope); static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc); -static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec); +static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int32 prec); static void OPV_DefineTDescs (OPT_Node n); -static void OPV_Entier (OPT_Node n, INTEGER prec); +static void OPV_Entier (OPT_Node n, int32 prec); static void OPV_GetTProcNum (OPT_Object obj); static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc); static BOOLEAN OPV_ImplicitReturn (OPT_Node n); -static void OPV_Index (OPT_Node n, OPT_Node d, INTEGER prec, INTEGER dim); +static void OPV_Index (OPT_Node n, OPT_Node d, int32 prec, int32 dim); export void OPV_Init (void); static void OPV_InitTDescs (OPT_Node n); -static void OPV_Len (OPT_Node n, LONGINT dim); +static void OPV_Len (OPT_Node n, int64 dim); export void OPV_Module (OPT_Node prog); -static LONGINT OPV_NaturalAlignment (LONGINT size, LONGINT max); +static int64 OPV_NaturalAlignment (int64 size, int64 max); static void OPV_NewArr (OPT_Node d, OPT_Node x); -static void OPV_ParIntLiteral (LONGINT n, LONGINT size); -static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, INTEGER comp); +static void OPV_ParIntLiteral (int64 n, int64 size); +static int32 OPV_Precedence (int32 class, int32 subclass, int32 form, int32 comp); static BOOLEAN OPV_SideEffects (OPT_Node n); -static void OPV_SizeCast (LONGINT from, LONGINT to); +static void OPV_SizeCast (int64 from, int64 to); static void OPV_Stamp (OPS_Name s); static OPT_Object OPV_SuperProc (OPT_Node n); static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported); static void OPV_TraverseRecord (OPT_Struct typ); export void OPV_TypSize (OPT_Struct typ); static void OPV_TypeOf (OPT_Node n); -static void OPV_design (OPT_Node n, INTEGER prec); -static void OPV_expr (OPT_Node n, INTEGER prec); +static void OPV_design (OPT_Node n, int32 prec); +static void OPV_expr (OPT_Node n, int32 prec); static void OPV_stat (OPT_Node n, OPT_Object outerProc); -static LONGINT OPV_NaturalAlignment (LONGINT size, LONGINT max) +static int64 OPV_NaturalAlignment (int64 size, int64 max) { - LONGINT _o_result; - LONGINT i; + int64 _o_result; + int64 i; if (size >= max) { _o_result = max; return _o_result; @@ -72,8 +72,8 @@ static LONGINT OPV_NaturalAlignment (LONGINT size, LONGINT max) void OPV_TypSize (OPT_Struct typ) { - INTEGER f, c; - LONGINT offset, size, base, fbase, off0; + int32 f, c; + int64 offset, size, base, fbase, off0; OPT_Object fld = NIL; OPT_Struct btyp = NIL; if (typ == OPT_undftyp) { @@ -88,7 +88,7 @@ void OPV_TypSize (OPT_Struct typ) base = OPC_SizeAlignment(OPM_RecSize); } else { OPV_TypSize(btyp); - offset = btyp->size - (SYSTEM_INT64)__ASHR(btyp->sysflag, 8); + offset = btyp->size - (int64)__ASHR(btyp->sysflag, 8); base = btyp->align; } fld = typ->link; @@ -119,7 +119,7 @@ void OPV_TypSize (OPT_Struct typ) } typ->size = offset; typ->align = base; - typ->sysflag = __MASK(typ->sysflag, -256) + (SYSTEM_INT32)__ASHL(offset - off0, 8); + typ->sysflag = __MASK(typ->sysflag, -256) + (int32)__ASHL(offset - off0, 8); } else if (c == 2) { OPV_TypSize(typ->BaseTyp); typ->size = typ->n * typ->BaseTyp->size; @@ -157,7 +157,7 @@ void OPV_Init (void) static void OPV_GetTProcNum (OPT_Object obj) { - LONGINT oldPos; + int64 oldPos; OPT_Struct typ = NIL; OPT_Object redef = NIL; oldPos = OPM_errpos; @@ -193,7 +193,7 @@ static void OPV_TraverseRecord (OPT_Struct typ) static void OPV_Stamp (OPS_Name s) { - INTEGER i, j, k; + int32 i, j, k; CHAR n[10]; OPV_stamp += 1; i = 0; @@ -223,7 +223,7 @@ static void OPV_Stamp (OPS_Name s) static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported) { - INTEGER mode; + int32 mode; OPT_Object scope = NIL; OPT_Struct typ = NIL; if (obj != NIL) { @@ -298,9 +298,9 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_sysptrtyp->strobj->linkadr = 2; } -static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, INTEGER comp) +static int32 OPV_Precedence (int32 class, int32 subclass, int32 form, int32 comp) { - INTEGER _o_result; + int32 _o_result; switch (class) { case 7: case 0: case 2: case 4: case 9: case 13: @@ -433,7 +433,7 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN __RETCHK; } -static void OPV_Len (OPT_Node n, LONGINT dim) +static void OPV_Len (OPT_Node n, int64 dim) { while ((n->class == 4 && n->typ->comp == 3)) { dim += 1; @@ -462,7 +462,7 @@ static BOOLEAN OPV_SideEffects (OPT_Node n) __RETCHK; } -static void OPV_Entier (OPT_Node n, INTEGER prec) +static void OPV_Entier (OPT_Node n, int32 prec) { if (__IN(n->typ->form, 0x60)) { OPM_WriteString((CHAR*)"__ENTIER(", 10); @@ -473,34 +473,18 @@ static void OPV_Entier (OPT_Node n, INTEGER prec) } } -static void OPV_SizeCast (LONGINT from, LONGINT to) +static void OPV_SizeCast (int64 from, int64 to) { if ((from != to && (from > 4 || to != 4))) { - switch (to) { - case 1: - OPM_WriteString((CHAR*)"(SYSTEM_INT8)", 14); - break; - case 2: - OPM_WriteString((CHAR*)"(SYSTEM_INT16)", 15); - break; - case 4: - OPM_WriteString((CHAR*)"(SYSTEM_INT32)", 15); - break; - case 8: - OPM_WriteString((CHAR*)"(SYSTEM_INT64)", 15); - break; - default: - OPM_LogWStr((CHAR*)"Unhandled case in OPC.SizeCast, to = ", 38); - OPM_LogWNum(to, 1); - OPM_LogWLn(); - break; - } + OPM_WriteString((CHAR*)"(int", 5); + OPM_WriteInt(__ASHL(to, 3)); + OPM_WriteString((CHAR*)")", 2); } } -static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec) +static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int32 prec) { - INTEGER from, to; + int32 from, to; from = n->typ->form; to = newtype->form; if (to == 7) { @@ -562,7 +546,7 @@ static void OPV_TypeOf (OPT_Node n) } } -static void OPV_Index (OPT_Node n, OPT_Node d, INTEGER prec, INTEGER dim) +static void OPV_Index (OPT_Node n, OPT_Node d, int32 prec, int32 dim) { if (!OPV_inxchk || (n->right->class == 7 && (n->right->conval->intval == 0 || n->left->typ->comp != 3))) { OPV_expr(n->right, prec); @@ -579,13 +563,13 @@ static void OPV_Index (OPT_Node n, OPT_Node d, INTEGER prec, INTEGER dim) } } -static void OPV_design (OPT_Node n, INTEGER prec) +static void OPV_design (OPT_Node n, int32 prec) { OPT_Object obj = NIL; OPT_Struct typ = NIL; - INTEGER class, designPrec, comp; + int32 class, designPrec, comp; OPT_Node d = NIL, x = NIL; - INTEGER dims, i, _for__28; + int32 dims, i, _for__28; comp = n->typ->comp; obj = n->obj; class = n->class; @@ -669,7 +653,7 @@ static void OPV_design (OPT_Node n, INTEGER prec) } if (n->typ->comp == 3) { OPM_Write(')'); - while ((SYSTEM_INT64)i < __ASHR(d->typ->size - 4, 2)) { + while ((int64)i < __ASHR(d->typ->size - 4, 2)) { OPM_WriteString((CHAR*)" * ", 4); OPV_Len(d, i); i += 1; @@ -758,7 +742,7 @@ static void OPV_design (OPT_Node n, INTEGER prec) } } -static void OPV_ParIntLiteral (LONGINT n, LONGINT size) +static void OPV_ParIntLiteral (int64 n, int64 size) { if (OPV_ansi) { OPM_WriteInt(n); @@ -770,7 +754,7 @@ static void OPV_ParIntLiteral (LONGINT n, LONGINT size) static void OPV_ActualPar (OPT_Node n, OPT_Object fp) { OPT_Struct typ = NIL, aptyp = NIL; - INTEGER comp, form, mode, prec, dim; + int32 comp, form, mode, prec, dim; OPM_Write('('); while (n != NIL) { typ = fp->typ; @@ -869,9 +853,9 @@ static OPT_Object OPV_SuperProc (OPT_Node n) return _o_result; } -static void OPV_expr (OPT_Node n, INTEGER prec) +static void OPV_expr (OPT_Node n, int32 prec) { - INTEGER class, subclass, form, exprPrec; + int32 class, subclass, form, exprPrec; OPT_Struct typ = NIL; OPT_Node l = NIL, r = NIL; OPT_Object proc = NIL; @@ -1187,7 +1171,7 @@ static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) OPT_Node if_ = NIL; OPT_Object obj = NIL; OPT_Struct typ = NIL; - LONGINT adr; + int64 adr; if_ = n->left; while (if_ != NIL) { OPM_WriteString((CHAR*)"if ", 4); @@ -1237,8 +1221,8 @@ static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc) { OPT_Node switchCase = NIL, label = NIL; - LONGINT low, high; - INTEGER form, i; + int64 low, high; + int32 form, i; OPM_WriteString((CHAR*)"switch ", 8); OPV_expr(n->left, 12); OPM_Write(' '); @@ -1305,7 +1289,7 @@ static BOOLEAN OPV_ImplicitReturn (OPT_Node n) static void OPV_NewArr (OPT_Node d, OPT_Node x) { OPT_Struct typ = NIL, base = NIL; - INTEGER nofdim, nofdyn; + int32 nofdim, nofdyn; typ = d->typ->BaseTyp; base = typ; nofdim = 0; diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 3f699c1c..2724553b 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -9,90 +9,90 @@ typedef Platform_ArgPtr (*Platform_ArgVec)[1024]; typedef - LONGINT (*Platform_ArgVecPtr)[1]; + int64 (*Platform_ArgVecPtr)[1]; typedef CHAR (*Platform_EnvPtr)[1024]; typedef struct Platform_FileIdentity { - LONGINT volume, indexhigh, indexlow, mtimehigh, mtimelow; + int64 volume, indexhigh, indexlow, mtimehigh, mtimelow; } Platform_FileIdentity; typedef - void (*Platform_HaltProcedure)(LONGINT); + void (*Platform_HaltProcedure)(int64); typedef - void (*Platform_SignalHandler)(INTEGER); + void (*Platform_SignalHandler)(int32); export BOOLEAN Platform_LittleEndian; -export LONGINT Platform_MainStackFrame, Platform_HaltCode; -export INTEGER Platform_PID; +export int64 Platform_MainStackFrame, Platform_HaltCode; +export int32 Platform_PID; export CHAR Platform_CWD[4096]; -export INTEGER Platform_ArgCount; -export LONGINT Platform_ArgVector; +export int32 Platform_ArgCount; +export int64 Platform_ArgVector; static Platform_HaltProcedure Platform_HaltHandler; -static LONGINT Platform_TimeStart; -export INTEGER Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; -export LONGINT Platform_StdIn, Platform_StdOut, Platform_StdErr; +static int64 Platform_TimeStart; +export int32 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; +export int64 Platform_StdIn, Platform_StdOut, Platform_StdErr; static Platform_SignalHandler Platform_InterruptHandler; export CHAR Platform_nl[3]; export LONGINT *Platform_FileIdentity__typ; -export BOOLEAN Platform_Absent (INTEGER e); -export INTEGER Platform_ArgPos (CHAR *s, LONGINT s__len); -export void Platform_AssertFail (LONGINT code); -export INTEGER Platform_Chdir (CHAR *n, LONGINT n__len); -export INTEGER Platform_Close (LONGINT h); -export BOOLEAN Platform_ConnectionFailed (INTEGER e); -export void Platform_Delay (LONGINT ms); -export BOOLEAN Platform_DifferentFilesystems (INTEGER e); -static void Platform_DisplayHaltCode (LONGINT code); -export INTEGER Platform_Error (void); -export void Platform_Exit (INTEGER code); -export void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len); -export void Platform_GetClock (LONGINT *t, LONGINT *d); +export BOOLEAN Platform_Absent (int32 e); +export int32 Platform_ArgPos (CHAR *s, LONGINT s__len); +export void Platform_AssertFail (int64 code); +export int32 Platform_Chdir (CHAR *n, LONGINT n__len); +export int32 Platform_Close (int64 h); +export BOOLEAN Platform_ConnectionFailed (int32 e); +export void Platform_Delay (int64 ms); +export BOOLEAN Platform_DifferentFilesystems (int32 e); +static void Platform_DisplayHaltCode (int64 code); +export int32 Platform_Error (void); +export void Platform_Exit (int32 code); +export void Platform_GetArg (int32 n, CHAR *val, LONGINT val__len); +export void Platform_GetClock (int64 *t, int64 *d); export void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); -export void Platform_GetIntArg (INTEGER n, LONGINT *val); -export void Platform_GetTimeOfDay (LONGINT *sec, LONGINT *usec); -export void Platform_Halt (LONGINT code); -export INTEGER Platform_Identify (LONGINT h, Platform_FileIdentity *identity, LONGINT *identity__typ); -export INTEGER Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); -export BOOLEAN Platform_Inaccessible (INTEGER e); -export void Platform_Init (INTEGER argc, LONGINT argvadr); -export void Platform_MTimeAsClock (Platform_FileIdentity i, LONGINT *t, LONGINT *d); -export INTEGER Platform_New (CHAR *n, LONGINT n__len, LONGINT *h); -export BOOLEAN Platform_NoSuchDirectory (INTEGER e); -export LONGINT Platform_OSAllocate (LONGINT size); -export void Platform_OSFree (LONGINT address); -export INTEGER Platform_OldRO (CHAR *n, LONGINT n__len, LONGINT *h); -export INTEGER Platform_OldRW (CHAR *n, LONGINT n__len, LONGINT *h); -export INTEGER Platform_Read (LONGINT h, LONGINT p, LONGINT l, LONGINT *n); -export INTEGER Platform_ReadBuf (LONGINT h, SYSTEM_BYTE *b, LONGINT b__len, LONGINT *n); -export INTEGER Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); +export void Platform_GetIntArg (int32 n, int64 *val); +export void Platform_GetTimeOfDay (int64 *sec, int64 *usec); +export void Platform_Halt (int64 code); +export int32 Platform_Identify (int64 h, Platform_FileIdentity *identity, LONGINT *identity__typ); +export int32 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); +export BOOLEAN Platform_Inaccessible (int32 e); +export void Platform_Init (int32 argc, int64 argvadr); +export void Platform_MTimeAsClock (Platform_FileIdentity i, int64 *t, int64 *d); +export int32 Platform_New (CHAR *n, LONGINT n__len, int64 *h); +export BOOLEAN Platform_NoSuchDirectory (int32 e); +export int64 Platform_OSAllocate (int64 size); +export void Platform_OSFree (int64 address); +export int32 Platform_OldRO (CHAR *n, LONGINT n__len, int64 *h); +export int32 Platform_OldRW (CHAR *n, LONGINT n__len, int64 *h); +export int32 Platform_Read (int64 h, int64 p, int64 l, int64 *n); +export int32 Platform_ReadBuf (int64 h, SYSTEM_BYTE *b, LONGINT b__len, int64 *n); +export int32 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); export BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); export BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); -export INTEGER Platform_Seek (LONGINT h, LONGINT o, INTEGER r); +export int32 Platform_Seek (int64 h, int64 o, int32 r); export void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); export void Platform_SetHalt (Platform_HaltProcedure p); export void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Platform_FileIdentity source); -export INTEGER Platform_Size (LONGINT h, LONGINT *l); -export INTEGER Platform_Sync (LONGINT h); -export INTEGER Platform_System (CHAR *cmd, LONGINT cmd__len); +export int32 Platform_Size (int64 h, int64 *l); +export int32 Platform_Sync (int64 h); +export int32 Platform_System (CHAR *cmd, LONGINT cmd__len); static void Platform_TestLittleEndian (void); -export LONGINT Platform_Time (void); -export BOOLEAN Platform_TimedOut (INTEGER e); -export BOOLEAN Platform_TooManyFiles (INTEGER e); -export INTEGER Platform_Truncate (LONGINT h, LONGINT limit); -export INTEGER Platform_Unlink (CHAR *n, LONGINT n__len); -export INTEGER Platform_Write (LONGINT h, LONGINT p, LONGINT l); -static void Platform_YMDHMStoClock (INTEGER ye, INTEGER mo, INTEGER da, INTEGER ho, INTEGER mi, INTEGER se, LONGINT *t, LONGINT *d); +export int64 Platform_Time (void); +export BOOLEAN Platform_TimedOut (int32 e); +export BOOLEAN Platform_TooManyFiles (int32 e); +export int32 Platform_Truncate (int64 h, int64 limit); +export int32 Platform_Unlink (CHAR *n, LONGINT n__len); +export int32 Platform_Write (int64 h, int64 p, int64 l); +static void Platform_YMDHMStoClock (int32 ye, int32 mo, int32 da, int32 ho, int32 mi, int32 se, int64 *t, int64 *d); static void Platform_errch (CHAR c); -static void Platform_errint (LONGINT l); +static void Platform_errint (int64 l); static void Platform_errln (void); -static void Platform_errposint (LONGINT l); +static void Platform_errposint (int64 l); export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); #include "WindowsWrapper.h" @@ -176,68 +176,68 @@ extern void Heap_InitHeap(); #define Platform_waitForProcess() (INTEGER)WaitForSingleObject(pi.hProcess, INFINITE) #define Platform_writefile(fd, p, l) (INTEGER)WriteFile((HANDLE)(SYSTEM_ADRINT)fd, (void*)(SYSTEM_ADRINT)(p), (DWORD)l, 0,0) -BOOLEAN Platform_TooManyFiles (INTEGER e) +BOOLEAN Platform_TooManyFiles (int32 e) { BOOLEAN _o_result; _o_result = e == Platform_ERRORTOOMANYOPENFILES(); return _o_result; } -BOOLEAN Platform_NoSuchDirectory (INTEGER e) +BOOLEAN Platform_NoSuchDirectory (int32 e) { BOOLEAN _o_result; _o_result = e == Platform_ERRORPATHNOTFOUND(); return _o_result; } -BOOLEAN Platform_DifferentFilesystems (INTEGER e) +BOOLEAN Platform_DifferentFilesystems (int32 e) { BOOLEAN _o_result; _o_result = e == Platform_ERRORNOTSAMEDEVICE(); return _o_result; } -BOOLEAN Platform_Inaccessible (INTEGER e) +BOOLEAN Platform_Inaccessible (int32 e) { BOOLEAN _o_result; _o_result = ((e == Platform_ERRORACCESSDENIED() || e == Platform_ERRORWRITEPROTECT()) || e == Platform_ERRORNOTREADY()) || e == Platform_ERRORSHARINGVIOLATION(); return _o_result; } -BOOLEAN Platform_Absent (INTEGER e) +BOOLEAN Platform_Absent (int32 e) { BOOLEAN _o_result; _o_result = e == Platform_ERRORFILENOTFOUND() || e == Platform_ERRORPATHNOTFOUND(); return _o_result; } -BOOLEAN Platform_TimedOut (INTEGER e) +BOOLEAN Platform_TimedOut (int32 e) { BOOLEAN _o_result; _o_result = e == Platform_ETIMEDOUT(); return _o_result; } -BOOLEAN Platform_ConnectionFailed (INTEGER e) +BOOLEAN Platform_ConnectionFailed (int32 e) { BOOLEAN _o_result; _o_result = ((e == Platform_ECONNREFUSED() || e == Platform_ECONNABORTED()) || e == Platform_ENETUNREACH()) || e == Platform_EHOSTUNREACH(); return _o_result; } -LONGINT Platform_OSAllocate (LONGINT size) +int64 Platform_OSAllocate (int64 size) { - LONGINT _o_result; + int64 _o_result; _o_result = Platform_allocate(size); return _o_result; } -void Platform_OSFree (LONGINT address) +void Platform_OSFree (int64 address) { Platform_free(address); } -void Platform_Init (INTEGER argc, LONGINT argvadr) +void Platform_Init (int32 argc, int64 argvadr) { Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; @@ -252,7 +252,7 @@ BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__le { BOOLEAN _o_result; CHAR buf[4096]; - INTEGER res; + int32 res; __DUP(var, var__len, CHAR); res = Platform_getenv(var, var__len, (void*)buf, 4096); if ((res > 0 && res < 4096)) { @@ -277,7 +277,7 @@ void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len) __DEL(var); } -void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len) +void Platform_GetArg (int32 n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { @@ -286,10 +286,10 @@ void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len) } } -void Platform_GetIntArg (INTEGER n, LONGINT *val) +void Platform_GetIntArg (int32 n, int64 *val) { CHAR s[64]; - LONGINT k, d, i; + int64 k, d, i; s[0] = 0x00; Platform_GetArg(n, (void*)s, 64); i = 0; @@ -312,10 +312,10 @@ void Platform_GetIntArg (INTEGER n, LONGINT *val) } } -INTEGER Platform_ArgPos (CHAR *s, LONGINT s__len) +int32 Platform_ArgPos (CHAR *s, LONGINT s__len) { - INTEGER _o_result; - INTEGER i; + int32 _o_result; + int32 i; CHAR arg[256]; __DUP(s, s__len, CHAR); i = 0; @@ -333,28 +333,28 @@ void Platform_SetBadInstructionHandler (Platform_SignalHandler handler) { } -static void Platform_YMDHMStoClock (INTEGER ye, INTEGER mo, INTEGER da, INTEGER ho, INTEGER mi, INTEGER se, LONGINT *t, LONGINT *d) +static void Platform_YMDHMStoClock (int32 ye, int32 mo, int32 da, int32 ho, int32 mi, int32 se, int64 *t, int64 *d) { - *d = (__ASHL((SYSTEM_INT64)(int)__MOD(ye, 100), 9) + __ASHL((SYSTEM_INT64)(mo + 1), 5)) + (SYSTEM_INT64)da; - *t = (__ASHL((SYSTEM_INT64)ho, 12) + __ASHL((SYSTEM_INT64)mi, 6)) + (SYSTEM_INT64)se; + *d = (__ASHL((int64)(int)__MOD(ye, 100), 9) + __ASHL((int64)(mo + 1), 5)) + (int64)da; + *t = (__ASHL((int64)ho, 12) + __ASHL((int64)mi, 6)) + (int64)se; } -void Platform_GetClock (LONGINT *t, LONGINT *d) +void Platform_GetClock (int64 *t, int64 *d) { Platform_getLocalTime(); Platform_YMDHMStoClock(Platform_styear(), Platform_stmon(), Platform_stmday(), Platform_sthour(), Platform_stmin(), Platform_stsec(), &*t, &*d); } -LONGINT Platform_Time (void) +int64 Platform_Time (void) { - LONGINT _o_result; - LONGINT ms; + int64 _o_result; + int64 ms; ms = Platform_GetTickCount(); _o_result = __MOD(ms - Platform_TimeStart, 2147483647); return _o_result; } -void Platform_Delay (LONGINT ms) +void Platform_Delay (int64 ms) { while (ms > 30000) { Platform_sleep(30000); @@ -365,7 +365,7 @@ void Platform_Delay (LONGINT ms) } } -void Platform_GetTimeOfDay (LONGINT *sec, LONGINT *usec) +void Platform_GetTimeOfDay (int64 *sec, int64 *usec) { Platform_getLocalTime(); Platform_stToFt(); @@ -375,10 +375,10 @@ void Platform_GetTimeOfDay (LONGINT *sec, LONGINT *usec) *usec = Platform_uluSec(); } -INTEGER Platform_System (CHAR *cmd, LONGINT cmd__len) +int32 Platform_System (CHAR *cmd, LONGINT cmd__len) { - INTEGER _o_result; - INTEGER result; + int32 _o_result; + int32 result; __DUP(cmd, cmd__len, CHAR); result = 127; Platform_startupInfo(); @@ -394,17 +394,17 @@ INTEGER Platform_System (CHAR *cmd, LONGINT cmd__len) return _o_result; } -INTEGER Platform_Error (void) +int32 Platform_Error (void) { - INTEGER _o_result; + int32 _o_result; _o_result = Platform_err(); return _o_result; } -INTEGER Platform_OldRO (CHAR *n, LONGINT n__len, LONGINT *h) +int32 Platform_OldRO (CHAR *n, LONGINT n__len, int64 *h) { - INTEGER _o_result; - LONGINT fd; + int32 _o_result; + int64 fd; fd = Platform_openro(n, n__len); if (fd == Platform_invalidHandleValue()) { _o_result = Platform_err(); @@ -417,10 +417,10 @@ INTEGER Platform_OldRO (CHAR *n, LONGINT n__len, LONGINT *h) __RETCHK; } -INTEGER Platform_OldRW (CHAR *n, LONGINT n__len, LONGINT *h) +int32 Platform_OldRW (CHAR *n, LONGINT n__len, int64 *h) { - INTEGER _o_result; - LONGINT fd; + int32 _o_result; + int64 fd; fd = Platform_openrw(n, n__len); if (fd == Platform_invalidHandleValue()) { _o_result = Platform_err(); @@ -433,10 +433,10 @@ INTEGER Platform_OldRW (CHAR *n, LONGINT n__len, LONGINT *h) __RETCHK; } -INTEGER Platform_New (CHAR *n, LONGINT n__len, LONGINT *h) +int32 Platform_New (CHAR *n, LONGINT n__len, int64 *h) { - INTEGER _o_result; - LONGINT fd; + int32 _o_result; + int64 fd; fd = Platform_opennew(n, n__len); if (fd == Platform_invalidHandleValue()) { _o_result = Platform_err(); @@ -449,9 +449,9 @@ INTEGER Platform_New (CHAR *n, LONGINT n__len, LONGINT *h) __RETCHK; } -INTEGER Platform_Close (LONGINT h) +int32 Platform_Close (int64 h) { - INTEGER _o_result; + int32 _o_result; if (Platform_closeHandle(h) == 0) { _o_result = Platform_err(); return _o_result; @@ -462,9 +462,9 @@ INTEGER Platform_Close (LONGINT h) __RETCHK; } -INTEGER Platform_Identify (LONGINT h, Platform_FileIdentity *identity, LONGINT *identity__typ) +int32 Platform_Identify (int64 h, Platform_FileIdentity *identity, LONGINT *identity__typ) { - INTEGER _o_result; + int32 _o_result; Platform_byHandleFileInformation(); if (Platform_getFileInformationByHandle(h) == 0) { _o_result = Platform_err(); @@ -479,11 +479,11 @@ INTEGER Platform_Identify (LONGINT h, Platform_FileIdentity *identity, LONGINT * return _o_result; } -INTEGER Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ) +int32 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ) { - INTEGER _o_result; - LONGINT h; - INTEGER e, i; + int32 _o_result; + int64 h; + int32 e, i; __DUP(n, n__len, CHAR); e = Platform_OldRO((void*)n, n__len, &h); if (e != 0) { @@ -518,16 +518,16 @@ void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Pla (*target).mtimelow = source.mtimelow; } -void Platform_MTimeAsClock (Platform_FileIdentity i, LONGINT *t, LONGINT *d) +void Platform_MTimeAsClock (Platform_FileIdentity i, int64 *t, int64 *d) { Platform_identityToFileTime(i); Platform_fileTimeToSysTime(); Platform_YMDHMStoClock(Platform_styear(), Platform_stmon(), Platform_stmday(), Platform_sthour(), Platform_stmin(), Platform_stsec(), &*t, &*d); } -INTEGER Platform_Size (LONGINT h, LONGINT *l) +int32 Platform_Size (int64 h, int64 *l) { - INTEGER _o_result; + int32 _o_result; Platform_largeInteger(); if (Platform_getFileSize(h) == 0) { _o_result = Platform_err(); @@ -538,10 +538,10 @@ INTEGER Platform_Size (LONGINT h, LONGINT *l) return _o_result; } -INTEGER Platform_Read (LONGINT h, LONGINT p, LONGINT l, LONGINT *n) +int32 Platform_Read (int64 h, int64 p, int64 l, int64 *n) { - INTEGER _o_result; - INTEGER result; + int32 _o_result; + int32 result; *n = 0; result = Platform_readfile(h, p, l, &*n); if (result == 0) { @@ -555,10 +555,10 @@ INTEGER Platform_Read (LONGINT h, LONGINT p, LONGINT l, LONGINT *n) __RETCHK; } -INTEGER Platform_ReadBuf (LONGINT h, SYSTEM_BYTE *b, LONGINT b__len, LONGINT *n) +int32 Platform_ReadBuf (int64 h, SYSTEM_BYTE *b, LONGINT b__len, int64 *n) { - INTEGER _o_result; - INTEGER result; + int32 _o_result; + int32 result; *n = 0; result = Platform_readfile(h, (SYSTEM_ADRINT)b, b__len, &*n); if (result == 0) { @@ -572,9 +572,9 @@ INTEGER Platform_ReadBuf (LONGINT h, SYSTEM_BYTE *b, LONGINT b__len, LONGINT *n) __RETCHK; } -INTEGER Platform_Write (LONGINT h, LONGINT p, LONGINT l) +int32 Platform_Write (int64 h, int64 p, int64 l) { - INTEGER _o_result; + int32 _o_result; if (Platform_writefile(h, p, l) == 0) { _o_result = Platform_err(); return _o_result; @@ -585,9 +585,9 @@ INTEGER Platform_Write (LONGINT h, LONGINT p, LONGINT l) __RETCHK; } -INTEGER Platform_Sync (LONGINT h) +int32 Platform_Sync (int64 h) { - INTEGER _o_result; + int32 _o_result; if (Platform_flushFileBuffers(h) == 0) { _o_result = Platform_err(); return _o_result; @@ -598,10 +598,10 @@ INTEGER Platform_Sync (LONGINT h) __RETCHK; } -INTEGER Platform_Seek (LONGINT h, LONGINT o, INTEGER r) +int32 Platform_Seek (int64 h, int64 o, int32 r) { - INTEGER _o_result; - INTEGER rc; + int32 _o_result; + int32 rc; Platform_largeInteger(); Platform_setFilePointerEx(h, o, r, &rc); if (rc == 0) { @@ -614,11 +614,11 @@ INTEGER Platform_Seek (LONGINT h, LONGINT o, INTEGER r) __RETCHK; } -INTEGER Platform_Truncate (LONGINT h, LONGINT limit) +int32 Platform_Truncate (int64 h, int64 limit) { - INTEGER _o_result; - INTEGER rc; - LONGINT oldpos; + int32 _o_result; + int32 rc; + int64 oldpos; Platform_largeInteger(); Platform_getFilePos(h, &oldpos, &rc); if (rc == 0) { @@ -643,9 +643,9 @@ INTEGER Platform_Truncate (LONGINT h, LONGINT limit) return _o_result; } -INTEGER Platform_Unlink (CHAR *n, LONGINT n__len) +int32 Platform_Unlink (CHAR *n, LONGINT n__len) { - INTEGER _o_result; + int32 _o_result; if (Platform_deleteFile(n, n__len) == 0) { _o_result = Platform_err(); return _o_result; @@ -656,10 +656,10 @@ INTEGER Platform_Unlink (CHAR *n, LONGINT n__len) __RETCHK; } -INTEGER Platform_Chdir (CHAR *n, LONGINT n__len) +int32 Platform_Chdir (CHAR *n, LONGINT n__len) { - INTEGER _o_result; - INTEGER r; + int32 _o_result; + int32 r; r = Platform_setCurrentDirectory(n, n__len); if (r == 0) { _o_result = Platform_err(); @@ -670,9 +670,9 @@ INTEGER Platform_Chdir (CHAR *n, LONGINT n__len) return _o_result; } -INTEGER Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) +int32 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) { - INTEGER _o_result; + int32 _o_result; if (Platform_moveFile(o, o__len, n, n__len) == 0) { _o_result = Platform_err(); return _o_result; @@ -683,7 +683,7 @@ INTEGER Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) __RETCHK; } -void Platform_Exit (INTEGER code) +void Platform_Exit (int32 code) { Platform_exit(code); } @@ -699,7 +699,7 @@ static void Platform_errln (void) Platform_errch(0x0a); } -static void Platform_errposint (LONGINT l) +static void Platform_errposint (int64 l) { if (l > 10) { Platform_errposint(__DIV(l, 10)); @@ -707,7 +707,7 @@ static void Platform_errposint (LONGINT l) Platform_errch((CHAR)(48 + __MOD(l, 10))); } -static void Platform_errint (LONGINT l) +static void Platform_errint (int64 l) { if (l < 0) { Platform_errch('-'); @@ -716,7 +716,7 @@ static void Platform_errint (LONGINT l) Platform_errposint(l); } -static void Platform_DisplayHaltCode (LONGINT code) +static void Platform_DisplayHaltCode (int64 code) { switch (code) { case -1: @@ -757,9 +757,9 @@ static void Platform_DisplayHaltCode (LONGINT code) } } -void Platform_Halt (LONGINT code) +void Platform_Halt (int64 code) { - INTEGER e; + int32 e; Platform_HaltCode = code; if (Platform_HaltHandler != NIL) { (*Platform_HaltHandler)(code); @@ -771,12 +771,12 @@ void Platform_Halt (LONGINT code) Platform_DisplayHaltCode(code); } Platform_errln(); - Platform_exit(__VAL(INTEGER, code)); + Platform_exit(__VAL(int32, code)); } -void Platform_AssertFail (LONGINT code) +void Platform_AssertFail (int64 code) { - INTEGER e; + int32 e; Platform_errstring((CHAR*)"Assertion failure.", 19); if (code != 0) { Platform_errstring((CHAR*)" ASSERT code ", 14); @@ -784,7 +784,7 @@ void Platform_AssertFail (LONGINT code) Platform_errstring((CHAR*)".", 2); } Platform_errln(); - Platform_exit(__VAL(INTEGER, code)); + Platform_exit(__VAL(int32, code)); } void Platform_SetHalt (Platform_HaltProcedure p) @@ -794,7 +794,7 @@ void Platform_SetHalt (Platform_HaltProcedure p) static void Platform_TestLittleEndian (void) { - INTEGER i; + int32 i; i = 1; __GET((SYSTEM_ADRINT)&i, Platform_LittleEndian, BOOLEAN); } diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index cff07fba..13f60995 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -13,69 +13,69 @@ typedef } Platform_FileIdentity; typedef - void (*Platform_HaltProcedure)(LONGINT); + void (*Platform_HaltProcedure)(int64); typedef - void (*Platform_SignalHandler)(INTEGER); + void (*Platform_SignalHandler)(int32); import BOOLEAN Platform_LittleEndian; -import LONGINT Platform_MainStackFrame, Platform_HaltCode; -import INTEGER Platform_PID; +import int64 Platform_MainStackFrame, Platform_HaltCode; +import int32 Platform_PID; import CHAR Platform_CWD[4096]; -import INTEGER Platform_ArgCount; -import LONGINT Platform_ArgVector; -import INTEGER Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; -import LONGINT Platform_StdIn, Platform_StdOut, Platform_StdErr; +import int32 Platform_ArgCount; +import int64 Platform_ArgVector; +import int32 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; +import int64 Platform_StdIn, Platform_StdOut, Platform_StdErr; import CHAR Platform_nl[3]; import LONGINT *Platform_FileIdentity__typ; -import BOOLEAN Platform_Absent (INTEGER e); -import INTEGER Platform_ArgPos (CHAR *s, LONGINT s__len); -import void Platform_AssertFail (LONGINT code); -import INTEGER Platform_Chdir (CHAR *n, LONGINT n__len); -import INTEGER Platform_Close (LONGINT h); -import BOOLEAN Platform_ConnectionFailed (INTEGER e); -import void Platform_Delay (LONGINT ms); -import BOOLEAN Platform_DifferentFilesystems (INTEGER e); -import INTEGER Platform_Error (void); -import void Platform_Exit (INTEGER code); -import void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len); -import void Platform_GetClock (LONGINT *t, LONGINT *d); +import BOOLEAN Platform_Absent (int32 e); +import int32 Platform_ArgPos (CHAR *s, LONGINT s__len); +import void Platform_AssertFail (int64 code); +import int32 Platform_Chdir (CHAR *n, LONGINT n__len); +import int32 Platform_Close (int64 h); +import BOOLEAN Platform_ConnectionFailed (int32 e); +import void Platform_Delay (int64 ms); +import BOOLEAN Platform_DifferentFilesystems (int32 e); +import int32 Platform_Error (void); +import void Platform_Exit (int32 code); +import void Platform_GetArg (int32 n, CHAR *val, LONGINT val__len); +import void Platform_GetClock (int64 *t, int64 *d); import void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); -import void Platform_GetIntArg (INTEGER n, LONGINT *val); -import void Platform_GetTimeOfDay (LONGINT *sec, LONGINT *usec); -import void Platform_Halt (LONGINT code); -import INTEGER Platform_Identify (LONGINT h, Platform_FileIdentity *identity, LONGINT *identity__typ); -import INTEGER Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); -import BOOLEAN Platform_Inaccessible (INTEGER e); -import void Platform_Init (INTEGER argc, LONGINT argvadr); -import void Platform_MTimeAsClock (Platform_FileIdentity i, LONGINT *t, LONGINT *d); -import INTEGER Platform_New (CHAR *n, LONGINT n__len, LONGINT *h); -import BOOLEAN Platform_NoSuchDirectory (INTEGER e); -import LONGINT Platform_OSAllocate (LONGINT size); -import void Platform_OSFree (LONGINT address); -import INTEGER Platform_OldRO (CHAR *n, LONGINT n__len, LONGINT *h); -import INTEGER Platform_OldRW (CHAR *n, LONGINT n__len, LONGINT *h); -import INTEGER Platform_Read (LONGINT h, LONGINT p, LONGINT l, LONGINT *n); -import INTEGER Platform_ReadBuf (LONGINT h, SYSTEM_BYTE *b, LONGINT b__len, LONGINT *n); -import INTEGER Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); +import void Platform_GetIntArg (int32 n, int64 *val); +import void Platform_GetTimeOfDay (int64 *sec, int64 *usec); +import void Platform_Halt (int64 code); +import int32 Platform_Identify (int64 h, Platform_FileIdentity *identity, LONGINT *identity__typ); +import int32 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); +import BOOLEAN Platform_Inaccessible (int32 e); +import void Platform_Init (int32 argc, int64 argvadr); +import void Platform_MTimeAsClock (Platform_FileIdentity i, int64 *t, int64 *d); +import int32 Platform_New (CHAR *n, LONGINT n__len, int64 *h); +import BOOLEAN Platform_NoSuchDirectory (int32 e); +import int64 Platform_OSAllocate (int64 size); +import void Platform_OSFree (int64 address); +import int32 Platform_OldRO (CHAR *n, LONGINT n__len, int64 *h); +import int32 Platform_OldRW (CHAR *n, LONGINT n__len, int64 *h); +import int32 Platform_Read (int64 h, int64 p, int64 l, int64 *n); +import int32 Platform_ReadBuf (int64 h, SYSTEM_BYTE *b, LONGINT b__len, int64 *n); +import int32 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); import BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); import BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); -import INTEGER Platform_Seek (LONGINT h, LONGINT o, INTEGER r); +import int32 Platform_Seek (int64 h, int64 o, int32 r); import void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); import void Platform_SetHalt (Platform_HaltProcedure p); import void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Platform_FileIdentity source); -import INTEGER Platform_Size (LONGINT h, LONGINT *l); -import INTEGER Platform_Sync (LONGINT h); -import INTEGER Platform_System (CHAR *cmd, LONGINT cmd__len); -import LONGINT Platform_Time (void); -import BOOLEAN Platform_TimedOut (INTEGER e); -import BOOLEAN Platform_TooManyFiles (INTEGER e); -import INTEGER Platform_Truncate (LONGINT h, LONGINT limit); -import INTEGER Platform_Unlink (CHAR *n, LONGINT n__len); -import INTEGER Platform_Write (LONGINT h, LONGINT p, LONGINT l); +import int32 Platform_Size (int64 h, int64 *l); +import int32 Platform_Sync (int64 h); +import int32 Platform_System (CHAR *cmd, LONGINT cmd__len); +import int64 Platform_Time (void); +import BOOLEAN Platform_TimedOut (int32 e); +import BOOLEAN Platform_TooManyFiles (int32 e); +import int32 Platform_Truncate (int64 h, int64 limit); +import int32 Platform_Unlink (CHAR *n, LONGINT n__len); +import int32 Platform_Write (int64 h, int64 p, int64 l); import BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); import void *Platform__init(void); diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 98719812..5877bedc 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -6,19 +6,19 @@ static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LONGINT d__len); -export void Reals_Convert (REAL x, INTEGER n, CHAR *d, LONGINT d__len); +export void Reals_Convert (REAL x, int32 n, CHAR *d, LONGINT d__len); export void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len); export void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len); -export void Reals_ConvertL (LONGREAL x, INTEGER n, CHAR *d, LONGINT d__len); -export INTEGER Reals_Expo (REAL x); -export INTEGER Reals_ExpoL (LONGREAL x); -export void Reals_SetExpo (REAL *x, INTEGER ex); -export REAL Reals_Ten (INTEGER e); -export LONGREAL Reals_TenL (INTEGER e); -static CHAR Reals_ToHex (INTEGER i); +export void Reals_ConvertL (LONGREAL x, int32 n, CHAR *d, LONGINT d__len); +export int32 Reals_Expo (REAL x); +export int32 Reals_ExpoL (LONGREAL x); +export void Reals_SetExpo (REAL *x, int32 ex); +export REAL Reals_Ten (int32 e); +export LONGREAL Reals_TenL (int32 e); +static CHAR Reals_ToHex (int32 i); -REAL Reals_Ten (INTEGER e) +REAL Reals_Ten (int32 e) { REAL _o_result; LONGREAL r, power; @@ -35,7 +35,7 @@ REAL Reals_Ten (INTEGER e) return _o_result; } -LONGREAL Reals_TenL (INTEGER e) +LONGREAL Reals_TenL (int32 e) { LONGREAL _o_result; LONGREAL r, power; @@ -55,16 +55,16 @@ LONGREAL Reals_TenL (INTEGER e) __RETCHK; } -INTEGER Reals_Expo (REAL x) +int32 Reals_Expo (REAL x) { - INTEGER _o_result; - INTEGER i; - __GET((SYSTEM_ADRINT)&x + 2, i, INTEGER); + int32 _o_result; + int32 i; + __GET((SYSTEM_ADRINT)&x + 2, i, int32); _o_result = __MASK(__ASHR(i, 7), -256); return _o_result; } -void Reals_SetExpo (REAL *x, INTEGER ex) +void Reals_SetExpo (REAL *x, int32 ex) { CHAR c; __GET((SYSTEM_ADRINT)x + 3, c, CHAR); @@ -73,36 +73,36 @@ void Reals_SetExpo (REAL *x, INTEGER ex) __PUT((SYSTEM_ADRINT)x + 2, (CHAR)(__MASK(c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } -INTEGER Reals_ExpoL (LONGREAL x) +int32 Reals_ExpoL (LONGREAL x) { - INTEGER _o_result; - INTEGER i; - __GET((SYSTEM_ADRINT)&x + 6, i, INTEGER); + int32 _o_result; + int32 i; + __GET((SYSTEM_ADRINT)&x + 6, i, int32); _o_result = __MASK(__ASHR(i, 4), -2048); return _o_result; } -void Reals_ConvertL (LONGREAL x, INTEGER n, CHAR *d, LONGINT d__len) +void Reals_ConvertL (LONGREAL x, int32 n, CHAR *d, LONGINT d__len) { - LONGINT i, j, k; + int64 i, j, k; if (x < (LONGREAL)0) { x = -x; } k = 0; i = __ENTIER(x); - while (k < (SYSTEM_INT64)n) { + while (k < (int64)n) { d[__X(k, d__len)] = (CHAR)(__MOD(i, 10) + 48); i = __DIV(i, 10); k += 1; } } -void Reals_Convert (REAL x, INTEGER n, CHAR *d, LONGINT d__len) +void Reals_Convert (REAL x, int32 n, CHAR *d, LONGINT d__len) { Reals_ConvertL(x, n, (void*)d, d__len); } -static CHAR Reals_ToHex (INTEGER i) +static CHAR Reals_ToHex (int32 i) { CHAR _o_result; if (i < 10) { @@ -117,12 +117,12 @@ static CHAR Reals_ToHex (INTEGER i) static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LONGINT d__len) { - INTEGER i; - LONGINT l; + int32 i; + int64 l; CHAR by; i = 0; l = b__len; - while ((SYSTEM_INT64)i < l) { + while ((int64)i < l) { by = __VAL(CHAR, b[__X(i, b__len)]); d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR(by, 4)); d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK(by, -16)); diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index 87c9aa45..cf944612 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -9,15 +9,15 @@ -import void Reals_Convert (REAL x, INTEGER n, CHAR *d, LONGINT d__len); +import void Reals_Convert (REAL x, int32 n, CHAR *d, LONGINT d__len); import void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len); import void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len); -import void Reals_ConvertL (LONGREAL x, INTEGER n, CHAR *d, LONGINT d__len); -import INTEGER Reals_Expo (REAL x); -import INTEGER Reals_ExpoL (LONGREAL x); -import void Reals_SetExpo (REAL *x, INTEGER ex); -import REAL Reals_Ten (INTEGER e); -import LONGREAL Reals_TenL (INTEGER e); +import void Reals_ConvertL (LONGREAL x, int32 n, CHAR *d, LONGINT d__len); +import int32 Reals_Expo (REAL x); +import int32 Reals_ExpoL (LONGREAL x); +import void Reals_SetExpo (REAL *x, int32 ex); +import REAL Reals_Ten (int32 e); +import LONGREAL Reals_TenL (int32 e); import void *Reals__init(void); diff --git a/bootstrap/windows-88/SYSTEM.h b/bootstrap/windows-88/SYSTEM.h index 343404a4..11ec8fc5 100644 --- a/bootstrap/windows-88/SYSTEM.h +++ b/bootstrap/windows-88/SYSTEM.h @@ -2,19 +2,21 @@ #define SYSTEM__h #if defined(_WIN64) - typedef long long SYSTEM_INT64; - typedef unsigned long long SYSTEM_CARD64; + typedef long long int64; + typedef unsigned long long uint64; #else - typedef long SYSTEM_INT64; - typedef unsigned long SYSTEM_CARD64; + typedef long int64; + typedef unsigned long uint64; #endif -typedef int SYSTEM_INT32; -typedef unsigned int SYSTEM_CARD32; -typedef short int SYSTEM_INT16; -typedef unsigned short int SYSTEM_CARD16; -typedef signed char SYSTEM_INT8; -typedef unsigned char SYSTEM_CARD8; +typedef int int32; +typedef unsigned int uint32; + +typedef short int int16; +typedef unsigned short int uint16; + +typedef signed char int8; +typedef unsigned char uint8; #if (__SIZEOF_POINTER__ == 8) || defined(_WIN64) || defined(__LP64__) #if defined(_WIN64) @@ -26,12 +28,30 @@ typedef unsigned char SYSTEM_CARD8; typedef unsigned int size_t; #endif -#define SYSTEM_ADRINT size_t -#define SYSTEM_ADDRESS size_t // Temporarily for bootstrap #define _SIZE_T_DECLARED // For FreeBSD #define _SIZE_T_DEFINED_ // For OpenBSD -void *memcpy(void *dest, const void *source, SYSTEM_ADRINT size); +void *memcpy(void *dest, const void *source, size_t size); + + +// Temporary while bootstrapping: + +#define SYSTEM_INT8 int8 +#define SYSTEM_INT16 int16 +#define SYSTEM_INT32 int32 +#define SYSTEM_INT64 int64 +#define SYSTEM_ADDRESS size_t + +#define U_SYSTEM_INT8 uint8 +#define U_SYSTEM_INT16 uint16 +#define U_SYSTEM_INT32 uint32 +#define U_SYSTEM_INT64 uint64 + +#define U_int8 uint8 +#define U_int16 uint16 +#define U_int32 uint32 +#define U_int64 uint64 + @@ -52,41 +72,53 @@ void *memcpy(void *dest, const void *source, SYSTEM_ADRINT size); // Oberon types -typedef char BOOLEAN; -typedef unsigned char SYSTEM_BYTE; -typedef unsigned char CHAR; -typedef signed char SHORTINT; -typedef float REAL; -typedef double LONGREAL; -typedef void* SYSTEM_PTR; +// typedef char BOOLEAN; +// typedef unsigned char SYSTEM_BYTE; +// typedef unsigned char CHAR; +// typedef signed char SHORTINT; +// typedef float REAL; +// typedef double LONGREAL; +// typedef void* SYSTEM_PTR; + +typedef int8 BOOLEAN; +typedef int8 SYSTEM_BYTE; +typedef uint8 U_SYSTEM_BYTE; +typedef uint8 CHAR; +typedef uint8 U_CHAR; +typedef int8 SHORTINT; +typedef uint8 U_SHORTINT; +typedef float REAL; +typedef double LONGREAL; +typedef void* SYSTEM_PTR; + +typedef size_t SYSTEM_ADRINT; + // For 32 bit builds, the size of LONGINT depends on a make option: #if (__SIZEOF_POINTER__ == 8) || defined(LARGE) || defined(_WIN64) - typedef int INTEGER; // INTEGER is 32 bit. - typedef long long LONGINT; // LONGINT is 64 bit. (long long is always 64 bits, while long can be 32 bits e.g. under MSC/MingW) - typedef unsigned int U_INTEGER; - typedef unsigned long long U_LONGINT; + typedef int32 INTEGER; + typedef int64 LONGINT; + typedef uint32 U_INTEGER; + typedef uint64 U_LONGINT; #else - typedef short int INTEGER; // INTEGER is 16 bit. - typedef long LONGINT; // LONGINT is 32 bit. - typedef unsigned short int U_INTEGER; - typedef unsigned long U_LONGINT; + typedef int16 INTEGER; + typedef int32 LONGINT; + typedef uint16 U_INTEGER; + typedef uint32 U_LONGINT; #endif // Unsigned variants are for use by shift and rotate macros. -typedef unsigned char U_SYSTEM_BYTE; -typedef unsigned char U_CHAR; -typedef unsigned char U_SHORTINT; - typedef U_LONGINT SET; typedef U_LONGINT U_SET; -typedef SYSTEM_CARD8 U_SYSTEM_INT8; -typedef SYSTEM_CARD16 U_SYSTEM_INT16; -typedef SYSTEM_CARD32 U_SYSTEM_INT32; -typedef SYSTEM_CARD64 U_SYSTEM_INT64; + + + +// ---------------------------------------------------------------------- +// ---------------------------------------------------------------------- + // OS Memory allocation interfaces are in PlatformXXX.Mod diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index 24999430..85e9fca9 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -7,22 +7,22 @@ export void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len); export void Strings_Cap (CHAR *s, LONGINT s__len); -export void Strings_Delete (CHAR *s, LONGINT s__len, INTEGER pos, INTEGER n); -export void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n, CHAR *dest, LONGINT dest__len); -export void Strings_Insert (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, LONGINT dest__len); -export INTEGER Strings_Length (CHAR *s, LONGINT s__len); +export void Strings_Delete (CHAR *s, LONGINT s__len, int32 pos, int32 n); +export void Strings_Extract (CHAR *source, LONGINT source__len, int32 pos, int32 n, CHAR *dest, LONGINT dest__len); +export void Strings_Insert (CHAR *source, LONGINT source__len, int32 pos, CHAR *dest, LONGINT dest__len); +export int32 Strings_Length (CHAR *s, LONGINT s__len); export BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len); -export INTEGER Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, INTEGER pos); -export void Strings_Replace (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, LONGINT dest__len); +export int32 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int32 pos); +export void Strings_Replace (CHAR *source, LONGINT source__len, int32 pos, CHAR *dest, LONGINT dest__len); -INTEGER Strings_Length (CHAR *s, LONGINT s__len) +int32 Strings_Length (CHAR *s, LONGINT s__len) { - INTEGER _o_result; - INTEGER i; + int32 _o_result; + int32 i; __DUP(s, s__len, CHAR); i = 0; - while (((SYSTEM_INT64)i < s__len && s[__X(i, s__len)] != 0x00)) { + while (((int64)i < s__len && s[__X(i, s__len)] != 0x00)) { i += 1; } _o_result = i; @@ -32,24 +32,24 @@ INTEGER Strings_Length (CHAR *s, LONGINT s__len) void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len) { - INTEGER n1, n2, i; + int32 n1, n2, i; __DUP(extra, extra__len, CHAR); n1 = Strings_Length(dest, dest__len); n2 = Strings_Length(extra, extra__len); i = 0; - while ((i < n2 && (SYSTEM_INT64)(i + n1) < dest__len)) { + while ((i < n2 && (int64)(i + n1) < dest__len)) { dest[__X(i + n1, dest__len)] = extra[__X(i, extra__len)]; i += 1; } - if ((SYSTEM_INT64)(i + n1) < dest__len) { + if ((int64)(i + n1) < dest__len) { dest[__X(i + n1, dest__len)] = 0x00; } __DEL(extra); } -void Strings_Insert (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, LONGINT dest__len) +void Strings_Insert (CHAR *source, LONGINT source__len, int32 pos, CHAR *dest, LONGINT dest__len) { - INTEGER n1, n2, i; + int32 n1, n2, i; __DUP(source, source__len, CHAR); n1 = Strings_Length(dest, dest__len); n2 = Strings_Length(source, source__len); @@ -60,10 +60,10 @@ void Strings_Insert (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, Strings_Append(dest, dest__len, (void*)source, source__len); return; } - if ((SYSTEM_INT64)(pos + n2) < dest__len) { + if ((int64)(pos + n2) < dest__len) { i = n1; while (i >= pos) { - if ((SYSTEM_INT64)(i + n2) < dest__len) { + if ((int64)(i + n2) < dest__len) { dest[__X(i + n2, dest__len)] = dest[__X(i, dest__len)]; } i -= 1; @@ -77,9 +77,9 @@ void Strings_Insert (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, __DEL(source); } -void Strings_Delete (CHAR *s, LONGINT s__len, INTEGER pos, INTEGER n) +void Strings_Delete (CHAR *s, LONGINT s__len, int32 pos, int32 n) { - INTEGER len, i; + int32 len, i; len = Strings_Length(s, s__len); if (pos < 0) { pos = 0; @@ -92,7 +92,7 @@ void Strings_Delete (CHAR *s, LONGINT s__len, INTEGER pos, INTEGER n) s[__X(i - n, s__len)] = s[__X(i, s__len)]; i += 1; } - if ((SYSTEM_INT64)(i - n) < s__len) { + if ((int64)(i - n) < s__len) { s[__X(i - n, s__len)] = 0x00; } } else { @@ -100,7 +100,7 @@ void Strings_Delete (CHAR *s, LONGINT s__len, INTEGER pos, INTEGER n) } } -void Strings_Replace (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, LONGINT dest__len) +void Strings_Replace (CHAR *source, LONGINT source__len, int32 pos, CHAR *dest, LONGINT dest__len) { __DUP(source, source__len, CHAR); Strings_Delete((void*)dest, dest__len, pos, pos + Strings_Length(source, source__len)); @@ -108,12 +108,12 @@ void Strings_Replace (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest __DEL(source); } -void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n, CHAR *dest, LONGINT dest__len) +void Strings_Extract (CHAR *source, LONGINT source__len, int32 pos, int32 n, CHAR *dest, LONGINT dest__len) { - INTEGER len, destLen, i; + int32 len, destLen, i; __DUP(source, source__len, CHAR); len = Strings_Length(source, source__len); - destLen = (SYSTEM_INT32)dest__len - 1; + destLen = (int32)dest__len - 1; if (pos < 0) { pos = 0; } @@ -122,7 +122,7 @@ void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n, return; } i = 0; - while (((((SYSTEM_INT64)(pos + i) <= source__len && source[__X(pos + i, source__len)] != 0x00)) && i < n)) { + while (((((int64)(pos + i) <= source__len && source[__X(pos + i, source__len)] != 0x00)) && i < n)) { if (i < destLen) { dest[__X(i, dest__len)] = source[__X(pos + i, source__len)]; } @@ -132,10 +132,10 @@ void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n, __DEL(source); } -INTEGER Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, INTEGER pos) +int32 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int32 pos) { - INTEGER _o_result; - INTEGER n1, n2, i, j; + int32 _o_result; + int32 n1, n2, i, j; __DUP(pattern, pattern__len, CHAR); __DUP(s, s__len, CHAR); n1 = Strings_Length(s, s__len); @@ -170,7 +170,7 @@ INTEGER Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__le void Strings_Cap (CHAR *s, LONGINT s__len) { - INTEGER i; + int32 i; i = 0; while (s[__X(i, s__len)] != 0x00) { if (('a' <= s[__X(i, s__len)] && s[__X(i, s__len)] <= 'z')) { @@ -184,9 +184,9 @@ static struct Match__7 { struct Match__7 *lnk; } *Match__7_s; -static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, INTEGER n, INTEGER m); +static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, int32 n, int32 m); -static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, INTEGER n, INTEGER m) +static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, int32 n, int32 m) { BOOLEAN _o_result; while ((((n >= 0 && m >= 0)) && mask[__X(m, mask__len)] != '*')) { diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index 9c2bad27..d703f8c0 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -11,13 +11,13 @@ import void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len); import void Strings_Cap (CHAR *s, LONGINT s__len); -import void Strings_Delete (CHAR *s, LONGINT s__len, INTEGER pos, INTEGER n); -import void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n, CHAR *dest, LONGINT dest__len); -import void Strings_Insert (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, LONGINT dest__len); -import INTEGER Strings_Length (CHAR *s, LONGINT s__len); +import void Strings_Delete (CHAR *s, LONGINT s__len, int32 pos, int32 n); +import void Strings_Extract (CHAR *source, LONGINT source__len, int32 pos, int32 n, CHAR *dest, LONGINT dest__len); +import void Strings_Insert (CHAR *source, LONGINT source__len, int32 pos, CHAR *dest, LONGINT dest__len); +import int32 Strings_Length (CHAR *s, LONGINT s__len); import BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len); -import INTEGER Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, INTEGER pos); -import void Strings_Replace (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, LONGINT dest__len); +import int32 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int32 pos); +import void Strings_Replace (CHAR *source, LONGINT source__len, int32 pos, CHAR *dest, LONGINT dest__len); import void *Strings__init(void); diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index ff526cbc..0c5cb89c 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -14,9 +14,9 @@ typedef typedef struct Texts_RunDesc { Texts_Run prev, next; - LONGINT len; + int64 len; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; BOOLEAN ascii; } Texts_RunDesc; @@ -37,26 +37,26 @@ typedef typedef struct Texts_ElemDesc { Texts_Run prev, next; - LONGINT len; + int64 len; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; BOOLEAN ascii; - LONGINT W, H; + int64 W, H; Texts_Handler handle; Texts_Text base; } Texts_ElemDesc; struct Texts__1 { /* Texts_ElemDesc */ Texts_Run prev, next; - LONGINT len; + int64 len; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; BOOLEAN ascii; - LONGINT W, H; + int64 W, H; Texts_Handler handle; Texts_Text base; Files_File file; - LONGINT org, span; + int64 org, span; CHAR mod[32], proc[32]; }; @@ -65,7 +65,7 @@ typedef typedef struct Texts_BufDesc { - LONGINT len; + int64 len; Texts_Run head; } Texts_BufDesc; @@ -79,8 +79,8 @@ typedef typedef struct Texts_FileMsg { /* Texts_ElemMsg */ - INTEGER id; - LONGINT pos; + int32 id; + int64 pos; Files_Rider r; } Texts_FileMsg; @@ -95,7 +95,7 @@ typedef } Texts_IdentifyMsg; typedef - void (*Texts_Notifier)(Texts_Text, INTEGER, LONGINT, LONGINT); + void (*Texts_Notifier)(Texts_Text, int32, int64, int64); typedef struct Texts_PieceDesc *Texts_Piece; @@ -103,57 +103,57 @@ typedef typedef struct Texts_PieceDesc { Texts_Run prev, next; - LONGINT len; + int64 len; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; BOOLEAN ascii; Files_File file; - LONGINT org; + int64 org; } Texts_PieceDesc; typedef struct Texts_Reader { BOOLEAN eot; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; Texts_Elem elem; Files_Rider rider; Texts_Run run; - LONGINT org, off; + int64 org, off; } Texts_Reader; typedef struct Texts_Scanner { /* Texts_Reader */ BOOLEAN eot; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; Texts_Elem elem; Files_Rider rider; Texts_Run run; - LONGINT org, off; + int64 org, off; CHAR nextCh; - INTEGER line, class; - LONGINT i; + int32 line, class; + int64 i; REAL x; LONGREAL y; CHAR c; - SHORTINT len; + int8 len; CHAR s[64]; } Texts_Scanner; typedef struct Texts_TextDesc { - LONGINT len; + int64 len; Texts_Notifier notify; Texts_Run head, cache; - LONGINT corg; + int64 corg; } Texts_TextDesc; typedef struct Texts_Writer { Texts_Buffer buf; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; Files_Rider rider; Files_File file; } Texts_Writer; @@ -179,50 +179,50 @@ export LONGINT *Texts_Writer__typ; export LONGINT *Texts__1__typ; export void Texts_Append (Texts_Text T, Texts_Buffer B); -export void Texts_ChangeLooks (Texts_Text T, LONGINT beg, LONGINT end, SET sel, Texts_FontsFont fnt, SHORTINT col, SHORTINT voff); +export void Texts_ChangeLooks (Texts_Text T, int64 beg, int64 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff); static Texts_Elem Texts_CloneElem (Texts_Elem e); static Texts_Piece Texts_ClonePiece (Texts_Piece p); export void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len); export void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); export void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); -export void Texts_Delete (Texts_Text T, LONGINT beg, LONGINT end); +export void Texts_Delete (Texts_Text T, int64 beg, int64 end); export Texts_Text Texts_ElemBase (Texts_Elem E); -export LONGINT Texts_ElemPos (Texts_Elem E); -static void Texts_Find (Texts_Text T, LONGINT *pos, Texts_Run *u, LONGINT *org, LONGINT *off); +export int64 Texts_ElemPos (Texts_Elem E); +static void Texts_Find (Texts_Text T, int64 *pos, Texts_Run *u, int64 *org, int64 *off); static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len); static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, LONGINT *msg__typ); -export void Texts_Insert (Texts_Text T, LONGINT pos, Texts_Buffer B); +export void Texts_Insert (Texts_Text T, int64 pos, Texts_Buffer B); export void Texts_Load (Files_Rider *r, LONGINT *r__typ, Texts_Text T); static void Texts_Load0 (Files_Rider *r, LONGINT *r__typ, Texts_Text T); static void Texts_Merge (Texts_Text T, Texts_Run u, Texts_Run *v); export void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len); export void Texts_OpenBuf (Texts_Buffer B); -export void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, LONGINT pos); -export void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, LONGINT pos); +export void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, int64 pos); +export void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, int64 pos); export void Texts_OpenWriter (Texts_Writer *W, LONGINT *W__typ); -export LONGINT Texts_Pos (Texts_Reader *R, LONGINT *R__typ); +export int64 Texts_Pos (Texts_Reader *R, LONGINT *R__typ); export void Texts_Read (Texts_Reader *R, LONGINT *R__typ, CHAR *ch); export void Texts_ReadElem (Texts_Reader *R, LONGINT *R__typ); export void Texts_ReadPrevElem (Texts_Reader *R, LONGINT *R__typ); export void Texts_Recall (Texts_Buffer *B); -export void Texts_Save (Texts_Text T, LONGINT beg, LONGINT end, Texts_Buffer B); +export void Texts_Save (Texts_Text T, int64 beg, int64 end, Texts_Buffer B); export void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ); -export void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, SHORTINT col); +export void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, int8 col); export void Texts_SetFont (Texts_Writer *W, LONGINT *W__typ, Texts_FontsFont fnt); -export void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, SHORTINT voff); +export void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, int8 voff); static void Texts_Splice (Texts_Run un, Texts_Run v, Texts_Run w, Texts_Text base); -static void Texts_Split (LONGINT off, Texts_Run *u, Texts_Run *un); +static void Texts_Split (int64 off, Texts_Run *u, Texts_Run *un); export void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T); export void Texts_Write (Texts_Writer *W, LONGINT *W__typ, CHAR ch); -export void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, LONGINT t, LONGINT d); +export void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, int64 t, int64 d); export void Texts_WriteElem (Texts_Writer *W, LONGINT *W__typ, Texts_Elem e); -export void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, LONGINT x); -export void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n); +export void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, int64 x); +export void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int64 x, int64 n); export void Texts_WriteLn (Texts_Writer *W, LONGINT *W__typ); -export void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER n); +export void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, int32 n); export void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x); -export void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n); -export void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n, INTEGER k); +export void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, int32 n); +export void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, int32 n, int32 k); export void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x); export void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__len); @@ -237,10 +237,10 @@ static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len) return _o_result; } -static void Texts_Find (Texts_Text T, LONGINT *pos, Texts_Run *u, LONGINT *org, LONGINT *off) +static void Texts_Find (Texts_Text T, int64 *pos, Texts_Run *u, int64 *org, int64 *off) { Texts_Run v = NIL; - LONGINT m; + int64 m; if (*pos >= T->len) { *pos = T->len; *u = T->head; @@ -270,7 +270,7 @@ static void Texts_Find (Texts_Text T, LONGINT *pos, Texts_Run *u, LONGINT *org, } } -static void Texts_Split (LONGINT off, Texts_Run *u, Texts_Run *un) +static void Texts_Split (int64 off, Texts_Run *u, Texts_Run *un) { Texts_Piece p = NIL, U = NIL; if (off == 0) { @@ -369,11 +369,11 @@ Texts_Text Texts_ElemBase (Texts_Elem E) return _o_result; } -LONGINT Texts_ElemPos (Texts_Elem E) +int64 Texts_ElemPos (Texts_Elem E) { - LONGINT _o_result; + int64 _o_result; Texts_Run u = NIL; - LONGINT pos; + int64 pos; u = E->base->head->next; pos = 0; while (u != (void *) E) { @@ -388,7 +388,7 @@ static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, LONGINT *msg__t { Texts_Alien e = NIL; Files_Rider r; - LONGINT i; + int64 i; CHAR ch; if (__ISP(E, Texts__1, 2)) { if (__IS(msg__typ, Texts_CopyMsg, 1)) { @@ -464,10 +464,10 @@ void Texts_Recall (Texts_Buffer *B) Texts_del = NIL; } -void Texts_Save (Texts_Text T, LONGINT beg, LONGINT end, Texts_Buffer B) +void Texts_Save (Texts_Text T, int64 beg, int64 end, Texts_Buffer B) { Texts_Run u = NIL, v = NIL, w = NIL, wn = NIL; - LONGINT uo, ud, vo, vd; + int64 uo, ud, vo, vd; Texts_Find(T, &beg, &u, &uo, &ud); Texts_Find(T, &end, &v, &vo, &vd); w = B->head->prev; @@ -498,11 +498,11 @@ void Texts_Save (Texts_Text T, LONGINT beg, LONGINT end, Texts_Buffer B) B->len += end - beg; } -void Texts_Insert (Texts_Text T, LONGINT pos, Texts_Buffer B) +void Texts_Insert (Texts_Text T, int64 pos, Texts_Buffer B) { Texts_Run u = NIL, un = NIL, v = NIL; Texts_Piece p = NIL, q = NIL; - LONGINT uo, ud, len; + int64 uo, ud, len; Texts_Find(T, &pos, &u, &uo, &ud); Texts_Split(ud, &u, &un); len = B->len; @@ -521,7 +521,7 @@ void Texts_Insert (Texts_Text T, LONGINT pos, Texts_Buffer B) void Texts_Append (Texts_Text T, Texts_Buffer B) { Texts_Run v = NIL; - LONGINT pos, len; + int64 pos, len; pos = T->len; len = B->len; v = B->head->next; @@ -536,10 +536,10 @@ void Texts_Append (Texts_Text T, Texts_Buffer B) } } -void Texts_Delete (Texts_Text T, LONGINT beg, LONGINT end) +void Texts_Delete (Texts_Text T, int64 beg, int64 end) { Texts_Run c = NIL, u = NIL, un = NIL, v = NIL, vn = NIL; - LONGINT co, uo, ud, vo, vd; + int64 co, uo, ud, vo, vd; Texts_Find(T, &beg, &u, &uo, &ud); Texts_Split(ud, &u, &un); c = T->cache; @@ -561,10 +561,10 @@ void Texts_Delete (Texts_Text T, LONGINT beg, LONGINT end) } } -void Texts_ChangeLooks (Texts_Text T, LONGINT beg, LONGINT end, SET sel, Texts_FontsFont fnt, SHORTINT col, SHORTINT voff) +void Texts_ChangeLooks (Texts_Text T, int64 beg, int64 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff) { Texts_Run c = NIL, u = NIL, un = NIL, v = NIL, vn = NIL; - LONGINT co, uo, ud, vo, vd; + int64 co, uo, ud, vo, vd; Texts_Find(T, &beg, &u, &uo, &ud); Texts_Split(ud, &u, &un); c = T->cache; @@ -600,7 +600,7 @@ void Texts_ChangeLooks (Texts_Text T, LONGINT beg, LONGINT end, SET sel, Texts_F } } -void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, LONGINT pos) +void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, int64 pos) { Texts_Run u = NIL; if (pos >= T->len) { @@ -617,7 +617,7 @@ void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, LONGINT p void Texts_Read (Texts_Reader *R, LONGINT *R__typ, CHAR *ch) { Texts_Run u = NIL; - LONGINT pos; + int64 pos; CHAR nextch; u = (*R).run; (*R).fnt = u->fnt; @@ -709,14 +709,14 @@ void Texts_ReadPrevElem (Texts_Reader *R, LONGINT *R__typ) } } -LONGINT Texts_Pos (Texts_Reader *R, LONGINT *R__typ) +int64 Texts_Pos (Texts_Reader *R, LONGINT *R__typ) { - LONGINT _o_result; + int64 _o_result; _o_result = (*R).org + (*R).off; return _o_result; } -void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, LONGINT pos) +void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, int64 pos) { Texts_OpenReader((void*)&*S, S__typ, T, pos); (*S).line = 0; @@ -728,7 +728,7 @@ static struct Scan__31 { LONGINT *S__typ; CHAR *ch; BOOLEAN *negE; - INTEGER *e; + int32 *e; struct Scan__31 *lnk; } *Scan__31_s; @@ -756,9 +756,9 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) { CHAR ch, term; BOOLEAN neg, negE, hex; - SHORTINT i, j, h; - INTEGER e; - LONGINT k; + int8 i, j, h; + int32 e; + int64 k; REAL x, f; LONGREAL y, g; CHAR d[32]; @@ -840,7 +840,7 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) k -= 16; } while (j < i) { - k = __ASHL(k, 4) + (SYSTEM_INT64)(d[__X(j, 32)] - 48); + k = __ASHL(k, 4) + (int64)(d[__X(j, 32)] - 48); j += 1; } if (neg) { @@ -930,7 +930,7 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) (*S).class = 3; k = 0; do { - k = k * 10 + (SYSTEM_INT64)(d[__X(j, 32)] - 48); + k = k * 10 + (int64)(d[__X(j, 32)] - 48); j += 1; } while (!(j == i)); if (neg) { @@ -974,12 +974,12 @@ void Texts_SetFont (Texts_Writer *W, LONGINT *W__typ, Texts_FontsFont fnt) (*W).fnt = fnt; } -void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, SHORTINT col) +void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, int8 col) { (*W).col = col; } -void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, SHORTINT voff) +void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, int8 voff) { (*W).voff = voff; } @@ -1036,7 +1036,7 @@ void Texts_WriteLn (Texts_Writer *W, LONGINT *W__typ) void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__len) { - INTEGER i; + int32 i; __DUP(s, s__len, CHAR); i = 0; while (s[__X(i, s__len)] >= ' ') { @@ -1046,10 +1046,10 @@ void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__le __DEL(s); } -void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n) +void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int64 x, int64 n) { - INTEGER i; - LONGINT x0; + int32 i; + int64 x0; CHAR a[22]; i = 0; if (x < 0) { @@ -1068,7 +1068,7 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n) x0 = __DIV(x0, 10); i += 1; } while (!(x0 == 0)); - while (n > (SYSTEM_INT64)i) { + while (n > (int64)i) { Texts_Write(&*W, W__typ, ' '); n -= 1; } @@ -1081,10 +1081,10 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n) } while (!(i == 0)); } -void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, LONGINT x) +void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, int64 x) { - INTEGER i; - LONGINT y; + int32 i; + int64 y; CHAR a[20]; i = 0; Texts_Write(&*W, W__typ, ' '); @@ -1104,9 +1104,9 @@ void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, LONGINT x) } while (!(i == 0)); } -void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n) +void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, int32 n) { - INTEGER e; + int32 e; REAL x0; CHAR d[9]; e = Reals_Expo(x); @@ -1177,15 +1177,15 @@ void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n) static struct WriteRealFix__53 { Texts_Writer *W; LONGINT *W__typ; - INTEGER *i; + int32 *i; CHAR (*d)[9]; struct WriteRealFix__53 *lnk; } *WriteRealFix__53_s; -static void dig__54 (INTEGER n); -static void seq__56 (CHAR ch, INTEGER n); +static void dig__54 (int32 n); +static void seq__56 (CHAR ch, int32 n); -static void seq__56 (CHAR ch, INTEGER n) +static void seq__56 (CHAR ch, int32 n) { while (n > 0) { Texts_Write(&*WriteRealFix__53_s->W, WriteRealFix__53_s->W__typ, ch); @@ -1193,7 +1193,7 @@ static void seq__56 (CHAR ch, INTEGER n) } } -static void dig__54 (INTEGER n) +static void dig__54 (int32 n) { while (n > 0) { *WriteRealFix__53_s->i -= 1; @@ -1202,9 +1202,9 @@ static void dig__54 (INTEGER n) } } -void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n, INTEGER k) +void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, int32 n, int32 k) { - INTEGER e, i; + int32 e, i; CHAR sign; REAL x0; CHAR d[9]; @@ -1276,7 +1276,7 @@ void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n, IN void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x) { - INTEGER i; + int32 i; CHAR d[8]; Reals_ConvertH(x, (void*)d, 8); i = 0; @@ -1286,9 +1286,9 @@ void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x) } while (!(i == 8)); } -void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER n) +void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, int32 n) { - INTEGER e; + int32 e; LONGREAL x0; CHAR d[16]; e = Reals_ExpoL(x); @@ -1320,7 +1320,7 @@ void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER } else { Texts_Write(&*W, W__typ, ' '); } - e = (SYSTEM_INT32)__ASHR((SYSTEM_INT64)(e - 1023) * 77, 8); + e = (int32)__ASHR((int64)(e - 1023) * 77, 8); if (e >= 0) { x = x / (LONGREAL)Reals_TenL(e); } else { @@ -1360,7 +1360,7 @@ void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x) { - INTEGER i; + int32 i; CHAR d[16]; Reals_ConvertHL(x, (void*)d, 16); i = 0; @@ -1376,16 +1376,16 @@ static struct WriteDate__43 { struct WriteDate__43 *lnk; } *WriteDate__43_s; -static void WritePair__44 (CHAR ch, LONGINT x); +static void WritePair__44 (CHAR ch, int64 x); -static void WritePair__44 (CHAR ch, LONGINT x) +static void WritePair__44 (CHAR ch, int64 x) { Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, ch); Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)(__DIV(x, 10) + 48)); Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)(__MOD(x, 10) + 48)); } -void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, LONGINT t, LONGINT d) +void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, int64 t, int64 d) { struct WriteDate__43 _s; _s.W = W; _s.W__typ = W__typ; @@ -1402,22 +1402,22 @@ void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, LONGINT t, LONGINT d) static struct Load0__16 { Texts_Text *T; - SHORTINT *ecnt; + int8 *ecnt; Files_File *f; Texts_FileMsg *msg; CHAR (*mods)[64][32], (*procs)[64][32]; struct Load0__16 *lnk; } *Load0__16_s; -static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, LONGINT span, Texts_Elem *e); +static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, int64 pos, int64 span, Texts_Elem *e); -static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, LONGINT span, Texts_Elem *e) +static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, int64 pos, int64 span, Texts_Elem *e) { Modules_Module M = NIL; Modules_Command Cmd; Texts_Alien a = NIL; - LONGINT org, ew, eh; - SHORTINT eno; + int64 org, ew, eh; + int8 eno; Texts_new = NIL; Files_ReadLInt(&*r, r__typ, &ew); Files_ReadLInt(&*r, r__typ, &eh); @@ -1467,8 +1467,8 @@ static void Texts_Load0 (Files_Rider *r, LONGINT *r__typ, Texts_Text T) Texts_Run u = NIL, un = NIL; Texts_Piece p = NIL; Texts_Elem e = NIL; - LONGINT org, pos, hlen, plen; - SHORTINT ecnt, fno, fcnt, col, voff; + int64 org, pos, hlen, plen; + int8 ecnt, fno, fcnt, col, voff; Files_File f = NIL; Texts_FileMsg msg; CHAR mods[64][32], procs[64][32]; @@ -1538,7 +1538,7 @@ static void Texts_Load0 (Files_Rider *r, LONGINT *r__typ, Texts_Text T) void Texts_Load (Files_Rider *r, LONGINT *r__typ, Texts_Text T) { - INTEGER tag; + int32 tag; Files_ReadInt(&*r, r__typ, &tag); if (tag != -4095) { Files_Set(&*r, r__typ, Files_Base(&*r, r__typ), Files_Pos(&*r, r__typ) - 2); @@ -1553,7 +1553,7 @@ void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len) Texts_Run u = NIL; Texts_Piece p = NIL; CHAR tag, version; - LONGINT hlen; + int64 hlen; __DUP(name, name__len, CHAR); f = Files_Old(name, name__len); if (f == NIL) { @@ -1603,20 +1603,20 @@ void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len) } static struct Store__39 { - SHORTINT *ecnt; + int8 *ecnt; Texts_FileMsg *msg; Texts_IdentifyMsg *iden; CHAR (*mods)[64][32], (*procs)[64][32]; struct Store__39 *lnk; } *Store__39_s; -static void StoreElem__40 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, Texts_Elem e); +static void StoreElem__40 (Files_Rider *r, LONGINT *r__typ, int64 pos, Texts_Elem e); -static void StoreElem__40 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, Texts_Elem e) +static void StoreElem__40 (Files_Rider *r, LONGINT *r__typ, int64 pos, Texts_Elem e) { Files_Rider r1; - LONGINT org, span; - SHORTINT eno; + int64 org, span; + int8 eno; __COPY((*Store__39_s->iden).mod, (*Store__39_s->mods)[__X(*Store__39_s->ecnt, 64)], 32); __COPY((*Store__39_s->iden).proc, (*Store__39_s->procs)[__X(*Store__39_s->ecnt, 64)], 32); eno = 1; @@ -1647,8 +1647,8 @@ void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T) Files_Rider r1; Texts_Run u = NIL, un = NIL; Texts_Elem e = NIL; - LONGINT org, pos, delta, hlen, rlen; - SHORTINT ecnt, fno, fcnt; + int64 org, pos, delta, hlen, rlen; + int8 ecnt, fno, fcnt; CHAR ch; Texts_FileMsg msg; Texts_IdentifyMsg iden; @@ -1765,7 +1765,7 @@ void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len) { Files_File f = NIL; Files_Rider r; - INTEGER i, res; + int32 i, res; CHAR bak[64]; __DUP(name, name__len, CHAR); f = Files_New(name, name__len); diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index f36b27cf..2e48fe94 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -9,7 +9,7 @@ typedef struct Texts_BufDesc { - LONGINT len; + int64 len; char _prvt0[8]; } Texts_BufDesc; @@ -41,15 +41,15 @@ typedef typedef struct Texts_ElemDesc { char _prvt0[40]; - LONGINT W, H; + int64 W, H; Texts_Handler handle; char _prvt1[8]; } Texts_ElemDesc; typedef struct Texts_FileMsg { /* Texts_ElemMsg */ - INTEGER id; - LONGINT pos; + int32 id; + int64 pos; Files_Rider r; } Texts_FileMsg; @@ -70,13 +70,13 @@ typedef struct Texts_TextDesc *Texts_Text; typedef - void (*Texts_Notifier)(Texts_Text, INTEGER, LONGINT, LONGINT); + void (*Texts_Notifier)(Texts_Text, int32, int64, int64); typedef struct Texts_Reader { BOOLEAN eot; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; Texts_Elem elem; char _prvt0[64]; } Texts_Reader; @@ -85,22 +85,22 @@ typedef struct Texts_Scanner { /* Texts_Reader */ BOOLEAN eot; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; Texts_Elem elem; char _prvt0[64]; CHAR nextCh; - INTEGER line, class; - LONGINT i; + int32 line, class; + int64 i; REAL x; LONGREAL y; CHAR c; - SHORTINT len; + int8 len; CHAR s[64]; } Texts_Scanner; typedef struct Texts_TextDesc { - LONGINT len; + int64 len; Texts_Notifier notify; char _prvt0[24]; } Texts_TextDesc; @@ -109,7 +109,7 @@ typedef struct Texts_Writer { Texts_Buffer buf; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; char _prvt0[54]; } Texts_Writer; @@ -130,41 +130,41 @@ import LONGINT *Texts_Scanner__typ; import LONGINT *Texts_Writer__typ; import void Texts_Append (Texts_Text T, Texts_Buffer B); -import void Texts_ChangeLooks (Texts_Text T, LONGINT beg, LONGINT end, SET sel, Texts_FontsFont fnt, SHORTINT col, SHORTINT voff); +import void Texts_ChangeLooks (Texts_Text T, int64 beg, int64 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff); import void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len); import void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); import void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); -import void Texts_Delete (Texts_Text T, LONGINT beg, LONGINT end); +import void Texts_Delete (Texts_Text T, int64 beg, int64 end); import Texts_Text Texts_ElemBase (Texts_Elem E); -import LONGINT Texts_ElemPos (Texts_Elem E); -import void Texts_Insert (Texts_Text T, LONGINT pos, Texts_Buffer B); +import int64 Texts_ElemPos (Texts_Elem E); +import void Texts_Insert (Texts_Text T, int64 pos, Texts_Buffer B); import void Texts_Load (Files_Rider *r, LONGINT *r__typ, Texts_Text T); import void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len); import void Texts_OpenBuf (Texts_Buffer B); -import void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, LONGINT pos); -import void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, LONGINT pos); +import void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, int64 pos); +import void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, int64 pos); import void Texts_OpenWriter (Texts_Writer *W, LONGINT *W__typ); -import LONGINT Texts_Pos (Texts_Reader *R, LONGINT *R__typ); +import int64 Texts_Pos (Texts_Reader *R, LONGINT *R__typ); import void Texts_Read (Texts_Reader *R, LONGINT *R__typ, CHAR *ch); import void Texts_ReadElem (Texts_Reader *R, LONGINT *R__typ); import void Texts_ReadPrevElem (Texts_Reader *R, LONGINT *R__typ); import void Texts_Recall (Texts_Buffer *B); -import void Texts_Save (Texts_Text T, LONGINT beg, LONGINT end, Texts_Buffer B); +import void Texts_Save (Texts_Text T, int64 beg, int64 end, Texts_Buffer B); import void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ); -import void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, SHORTINT col); +import void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, int8 col); import void Texts_SetFont (Texts_Writer *W, LONGINT *W__typ, Texts_FontsFont fnt); -import void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, SHORTINT voff); +import void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, int8 voff); import void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T); import void Texts_Write (Texts_Writer *W, LONGINT *W__typ, CHAR ch); -import void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, LONGINT t, LONGINT d); +import void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, int64 t, int64 d); import void Texts_WriteElem (Texts_Writer *W, LONGINT *W__typ, Texts_Elem e); -import void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, LONGINT x); -import void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n); +import void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, int64 x); +import void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int64 x, int64 n); import void Texts_WriteLn (Texts_Writer *W, LONGINT *W__typ); -import void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER n); +import void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, int32 n); import void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x); -import void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n); -import void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n, INTEGER k); +import void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, int32 n); +import void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, int32 n, int32 k); import void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x); import void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__len); import void *Texts__init(void); diff --git a/bootstrap/windows-88/Vishap.c b/bootstrap/windows-88/Vishap.c index 65dd2639..c313eb20 100644 --- a/bootstrap/windows-88/Vishap.c +++ b/bootstrap/windows-88/Vishap.c @@ -21,7 +21,7 @@ static CHAR Vishap_mname[256]; export void Vishap_Module (BOOLEAN *done); static void Vishap_PropagateElementaryTypeSizes (void); export void Vishap_Translate (void); -static void Vishap_Trap (INTEGER sig); +static void Vishap_Trap (int32 sig); void Vishap_Module (BOOLEAN *done) @@ -127,7 +127,7 @@ void Vishap_Translate (void) } } -static void Vishap_Trap (INTEGER sig) +static void Vishap_Trap (int32 sig) { Heap_FINALL(); if (sig == 3) { diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index 566e2b5c..bc32dc20 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -18,7 +18,7 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGINT cmd__len) { - INTEGER r, status, exitcode; + int32 r, status, exitcode; __DUP(title, title__len, CHAR); __DUP(cmd, cmd__len, CHAR); if (OPM_Verbose) { diff --git a/bootstrap/windows-88/vt100.c b/bootstrap/windows-88/vt100.c index b9fb5373..a757d25d 100644 --- a/bootstrap/windows-88/vt100.c +++ b/bootstrap/windows-88/vt100.c @@ -9,36 +9,36 @@ export CHAR vt100_CSI[5]; static CHAR vt100_tmpstr[32]; -export void vt100_CHA (INTEGER n); -export void vt100_CNL (INTEGER n); -export void vt100_CPL (INTEGER n); -export void vt100_CUB (INTEGER n); -export void vt100_CUD (INTEGER n); -export void vt100_CUF (INTEGER n); -export void vt100_CUP (INTEGER n, INTEGER m); -export void vt100_CUU (INTEGER n); +export void vt100_CHA (int32 n); +export void vt100_CNL (int32 n); +export void vt100_CPL (int32 n); +export void vt100_CUB (int32 n); +export void vt100_CUD (int32 n); +export void vt100_CUF (int32 n); +export void vt100_CUP (int32 n, int32 m); +export void vt100_CUU (int32 n); export void vt100_DECTCEMh (void); export void vt100_DECTCEMl (void); -export void vt100_DSR (INTEGER n); -export void vt100_ED (INTEGER n); -export void vt100_EL (INTEGER n); -static void vt100_EscSeq (INTEGER n, CHAR *letter, LONGINT letter__len); +export void vt100_DSR (int32 n); +export void vt100_ED (int32 n); +export void vt100_EL (int32 n); +static void vt100_EscSeq (int32 n, CHAR *letter, LONGINT letter__len); static void vt100_EscSeq0 (CHAR *letter, LONGINT letter__len); -static void vt100_EscSeq2 (INTEGER n, INTEGER m, CHAR *letter, LONGINT letter__len); -static void vt100_EscSeqSwapped (INTEGER n, CHAR *letter, LONGINT letter__len); -export void vt100_HVP (INTEGER n, INTEGER m); -export void vt100_IntToStr (LONGINT int_, CHAR *str, LONGINT str__len); +static void vt100_EscSeq2 (int32 n, int32 m, CHAR *letter, LONGINT letter__len); +static void vt100_EscSeqSwapped (int32 n, CHAR *letter, LONGINT letter__len); +export void vt100_HVP (int32 n, int32 m); +export void vt100_IntToStr (int64 int_, CHAR *str, LONGINT str__len); export void vt100_RCP (void); -static void vt100_Reverse0 (CHAR *str, LONGINT str__len, INTEGER start, INTEGER end); +static void vt100_Reverse0 (CHAR *str, LONGINT str__len, int32 start, int32 end); export void vt100_SCP (void); -export void vt100_SD (INTEGER n); -export void vt100_SGR (INTEGER n); -export void vt100_SGR2 (INTEGER n, INTEGER m); -export void vt100_SU (INTEGER n); +export void vt100_SD (int32 n); +export void vt100_SGR (int32 n); +export void vt100_SGR2 (int32 n, int32 m); +export void vt100_SU (int32 n); export void vt100_SetAttr (CHAR *attr, LONGINT attr__len); -static void vt100_Reverse0 (CHAR *str, LONGINT str__len, INTEGER start, INTEGER end) +static void vt100_Reverse0 (CHAR *str, LONGINT str__len, int32 start, int32 end) { CHAR h; while (start < end) { @@ -50,11 +50,11 @@ static void vt100_Reverse0 (CHAR *str, LONGINT str__len, INTEGER start, INTEGER } } -void vt100_IntToStr (LONGINT int_, CHAR *str, LONGINT str__len) +void vt100_IntToStr (int64 int_, CHAR *str, LONGINT str__len) { CHAR b[21]; - INTEGER s, e; - SHORTINT maxLength; + int32 s, e; + int8 maxLength; maxLength = 20; if (int_ == (-9223372036854775807-1)) { __MOVE("-9223372036854775808", b, 21); @@ -89,7 +89,7 @@ static void vt100_EscSeq0 (CHAR *letter, LONGINT letter__len) __DEL(letter); } -static void vt100_EscSeq (INTEGER n, CHAR *letter, LONGINT letter__len) +static void vt100_EscSeq (int32 n, CHAR *letter, LONGINT letter__len) { CHAR nstr[2]; CHAR cmd[7]; @@ -102,7 +102,7 @@ static void vt100_EscSeq (INTEGER n, CHAR *letter, LONGINT letter__len) __DEL(letter); } -static void vt100_EscSeqSwapped (INTEGER n, CHAR *letter, LONGINT letter__len) +static void vt100_EscSeqSwapped (int32 n, CHAR *letter, LONGINT letter__len) { CHAR nstr[2]; CHAR cmd[7]; @@ -115,7 +115,7 @@ static void vt100_EscSeqSwapped (INTEGER n, CHAR *letter, LONGINT letter__len) __DEL(letter); } -static void vt100_EscSeq2 (INTEGER n, INTEGER m, CHAR *letter, LONGINT letter__len) +static void vt100_EscSeq2 (int32 n, int32 m, CHAR *letter, LONGINT letter__len) { CHAR nstr[5], mstr[5]; CHAR cmd[12]; @@ -131,82 +131,82 @@ static void vt100_EscSeq2 (INTEGER n, INTEGER m, CHAR *letter, LONGINT letter__l __DEL(letter); } -void vt100_CUU (INTEGER n) +void vt100_CUU (int32 n) { vt100_EscSeq(n, (CHAR*)"A", 2); } -void vt100_CUD (INTEGER n) +void vt100_CUD (int32 n) { vt100_EscSeq(n, (CHAR*)"B", 2); } -void vt100_CUF (INTEGER n) +void vt100_CUF (int32 n) { vt100_EscSeq(n, (CHAR*)"C", 2); } -void vt100_CUB (INTEGER n) +void vt100_CUB (int32 n) { vt100_EscSeq(n, (CHAR*)"D", 2); } -void vt100_CNL (INTEGER n) +void vt100_CNL (int32 n) { vt100_EscSeq(n, (CHAR*)"E", 2); } -void vt100_CPL (INTEGER n) +void vt100_CPL (int32 n) { vt100_EscSeq(n, (CHAR*)"F", 2); } -void vt100_CHA (INTEGER n) +void vt100_CHA (int32 n) { vt100_EscSeq(n, (CHAR*)"G", 2); } -void vt100_CUP (INTEGER n, INTEGER m) +void vt100_CUP (int32 n, int32 m) { vt100_EscSeq2(n, m, (CHAR*)"H", 2); } -void vt100_ED (INTEGER n) +void vt100_ED (int32 n) { vt100_EscSeq(n, (CHAR*)"J", 2); } -void vt100_EL (INTEGER n) +void vt100_EL (int32 n) { vt100_EscSeq(n, (CHAR*)"K", 2); } -void vt100_SU (INTEGER n) +void vt100_SU (int32 n) { vt100_EscSeq(n, (CHAR*)"S", 2); } -void vt100_SD (INTEGER n) +void vt100_SD (int32 n) { vt100_EscSeq(n, (CHAR*)"T", 2); } -void vt100_HVP (INTEGER n, INTEGER m) +void vt100_HVP (int32 n, int32 m) { vt100_EscSeq2(n, m, (CHAR*)"f", 2); } -void vt100_SGR (INTEGER n) +void vt100_SGR (int32 n) { vt100_EscSeq(n, (CHAR*)"m", 2); } -void vt100_SGR2 (INTEGER n, INTEGER m) +void vt100_SGR2 (int32 n, int32 m) { vt100_EscSeq2(n, m, (CHAR*)"m", 2); } -void vt100_DSR (INTEGER n) +void vt100_DSR (int32 n) { vt100_EscSeq(6, (CHAR*)"n", 2); } diff --git a/bootstrap/windows-88/vt100.h b/bootstrap/windows-88/vt100.h index 745ff709..fb8a12d0 100644 --- a/bootstrap/windows-88/vt100.h +++ b/bootstrap/windows-88/vt100.h @@ -10,27 +10,27 @@ import CHAR vt100_CSI[5]; -import void vt100_CHA (INTEGER n); -import void vt100_CNL (INTEGER n); -import void vt100_CPL (INTEGER n); -import void vt100_CUB (INTEGER n); -import void vt100_CUD (INTEGER n); -import void vt100_CUF (INTEGER n); -import void vt100_CUP (INTEGER n, INTEGER m); -import void vt100_CUU (INTEGER n); +import void vt100_CHA (int32 n); +import void vt100_CNL (int32 n); +import void vt100_CPL (int32 n); +import void vt100_CUB (int32 n); +import void vt100_CUD (int32 n); +import void vt100_CUF (int32 n); +import void vt100_CUP (int32 n, int32 m); +import void vt100_CUU (int32 n); import void vt100_DECTCEMh (void); import void vt100_DECTCEMl (void); -import void vt100_DSR (INTEGER n); -import void vt100_ED (INTEGER n); -import void vt100_EL (INTEGER n); -import void vt100_HVP (INTEGER n, INTEGER m); -import void vt100_IntToStr (LONGINT int_, CHAR *str, LONGINT str__len); +import void vt100_DSR (int32 n); +import void vt100_ED (int32 n); +import void vt100_EL (int32 n); +import void vt100_HVP (int32 n, int32 m); +import void vt100_IntToStr (int64 int_, CHAR *str, LONGINT str__len); import void vt100_RCP (void); import void vt100_SCP (void); -import void vt100_SD (INTEGER n); -import void vt100_SGR (INTEGER n); -import void vt100_SGR2 (INTEGER n, INTEGER m); -import void vt100_SU (INTEGER n); +import void vt100_SD (int32 n); +import void vt100_SGR (int32 n); +import void vt100_SGR2 (int32 n, int32 m); +import void vt100_SU (int32 n); import void vt100_SetAttr (CHAR *attr, LONGINT attr__len); import void *vt100__init(void); diff --git a/src/compiler/OPC.Mod b/src/compiler/OPC.Mod index 50ba59a0..e51f9704 100644 --- a/src/compiler/OPC.Mod +++ b/src/compiler/OPC.Mod @@ -41,7 +41,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) indentLevel: INTEGER; ptrinit, mainprog, ansi: BOOLEAN; hashtab: ARRAY 105 OF SHORTINT; - keytab: ARRAY 36, 9 OF CHAR; + keytab: ARRAY 50, 9 OF CHAR; GlbPtrs: BOOLEAN; BodyNameExt: ARRAY 13 OF CHAR; @@ -117,6 +117,8 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) IF hashtab[h] >= 0 THEN IF keytab[hashtab[h]] = obj^.name THEN OPM.Write('_') END END + ELSIF (mode = OPT.Typ) & (obj.typ.form = OPT.Int) THEN + OPM.WriteString("int"); OPM.WriteInt(obj.typ.size*8) ELSE IF (mode # OPT.Typ) OR (obj^.linkadr # PredefinedType) THEN IF mode = OPT.TProc THEN Ident(obj^.link^.typ^.strobj) @@ -128,10 +130,6 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) OPM.Write('_') ELSIF (obj = OPT.sysptrtyp^.strobj) OR (obj = OPT.ainttyp^.strobj) - OR (obj = OPT.int8typ^.strobj) - OR (obj = OPT.int16typ^.strobj) - OR (obj = OPT.int32typ^.strobj) - OR (obj = OPT.int64typ^.strobj) OR (obj = OPT.bytetyp^.strobj) THEN OPM.WriteString("SYSTEM_") END; @@ -1261,14 +1259,8 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) PROCEDURE IntLiteral*(n, size: LONGINT); BEGIN IF (size > OPM.CIntSize) & (n <= OPM.CIntMax) & (n > OPM.CIntMin) THEN - CASE size OF - |2: OPM.WriteString("((SYSTEM_INT16)("); - |4: OPM.WriteString("((SYSTEM_INT32)("); - |8: OPM.WriteString("((SYSTEM_INT64)("); - ELSE OPM.LogWStr("Unhandled case in OPC.IntLiteral, size = "); OPM.LogWNum(size,1); OPM.LogWLn; - END; - OPM.WriteInt(n); - OPM.WriteString("))") + OPM.WriteString("((int"); OPM.WriteInt(size*8); OPM.WriteString(")("); + OPM.WriteInt(n); OPM.WriteString("))") ELSE OPM.WriteInt(n) END @@ -1328,6 +1320,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) BEGIN n := 0; FOR i := 0 TO 104 DO hashtab[i] := -1 END ; + Enter("adrint"); (* pseudo keyword used by voc *) Enter("asm"); Enter("auto"); Enter("break"); @@ -1341,24 +1334,33 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) Enter("else"); Enter("enum"); Enter("extern"); - Enter("export"); (* pseudo keyword used by voc *) + Enter("export"); (* pseudo keyword used by voc *) Enter("float"); Enter("for"); Enter("fortran"); Enter("goto"); Enter("if"); - Enter("import"); (* pseudo keyword used by voc *) + Enter("import"); (* pseudo keyword used by voc *) Enter("int"); + Enter("int16"); (* pseudo keyword used by voc *) + Enter("int32"); (* pseudo keyword used by voc *) + Enter("int64"); (* pseudo keyword used by voc *) + Enter("int8"); (* pseudo keyword used by voc *) Enter("long"); Enter("register"); Enter("return"); Enter("short"); Enter("signed"); Enter("sizeof"); + Enter("size_t"); Enter("static"); Enter("struct"); Enter("switch"); Enter("typedef"); + Enter("uint16"); (* pseudo keyword used by voc *) + Enter("uint32"); (* pseudo keyword used by voc *) + Enter("uint64"); (* pseudo keyword used by voc *) + Enter("uint8"); (* pseudo keyword used by voc *) Enter("union"); Enter("unsigned"); Enter("void"); diff --git a/src/compiler/OPV.Mod b/src/compiler/OPV.Mod index 6eb2ffb0..089cd5e1 100644 --- a/src/compiler/OPV.Mod +++ b/src/compiler/OPV.Mod @@ -298,13 +298,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 PROCEDURE SizeCast(from, to: LONGINT); BEGIN IF (from # to) & ((from > OPM.CIntSize) OR (to # OPM.CIntSize)) THEN - CASE to OF - |1: OPM.WriteString("(SYSTEM_INT8)"); - |2: OPM.WriteString("(SYSTEM_INT16)"); - |4: OPM.WriteString("(SYSTEM_INT32)"); - |8: OPM.WriteString("(SYSTEM_INT64)"); - ELSE OPM.LogWStr("Unhandled case in OPC.SizeCast, to = "); OPM.LogWNum(to,1); OPM.LogWLn; - END + OPM.WriteString("(int"); OPM.WriteInt(to*8); OPM.WriteString(")") END END SizeCast; diff --git a/src/system/SYSTEM.h b/src/system/SYSTEM.h index 343404a4..11ec8fc5 100644 --- a/src/system/SYSTEM.h +++ b/src/system/SYSTEM.h @@ -2,19 +2,21 @@ #define SYSTEM__h #if defined(_WIN64) - typedef long long SYSTEM_INT64; - typedef unsigned long long SYSTEM_CARD64; + typedef long long int64; + typedef unsigned long long uint64; #else - typedef long SYSTEM_INT64; - typedef unsigned long SYSTEM_CARD64; + typedef long int64; + typedef unsigned long uint64; #endif -typedef int SYSTEM_INT32; -typedef unsigned int SYSTEM_CARD32; -typedef short int SYSTEM_INT16; -typedef unsigned short int SYSTEM_CARD16; -typedef signed char SYSTEM_INT8; -typedef unsigned char SYSTEM_CARD8; +typedef int int32; +typedef unsigned int uint32; + +typedef short int int16; +typedef unsigned short int uint16; + +typedef signed char int8; +typedef unsigned char uint8; #if (__SIZEOF_POINTER__ == 8) || defined(_WIN64) || defined(__LP64__) #if defined(_WIN64) @@ -26,12 +28,30 @@ typedef unsigned char SYSTEM_CARD8; typedef unsigned int size_t; #endif -#define SYSTEM_ADRINT size_t -#define SYSTEM_ADDRESS size_t // Temporarily for bootstrap #define _SIZE_T_DECLARED // For FreeBSD #define _SIZE_T_DEFINED_ // For OpenBSD -void *memcpy(void *dest, const void *source, SYSTEM_ADRINT size); +void *memcpy(void *dest, const void *source, size_t size); + + +// Temporary while bootstrapping: + +#define SYSTEM_INT8 int8 +#define SYSTEM_INT16 int16 +#define SYSTEM_INT32 int32 +#define SYSTEM_INT64 int64 +#define SYSTEM_ADDRESS size_t + +#define U_SYSTEM_INT8 uint8 +#define U_SYSTEM_INT16 uint16 +#define U_SYSTEM_INT32 uint32 +#define U_SYSTEM_INT64 uint64 + +#define U_int8 uint8 +#define U_int16 uint16 +#define U_int32 uint32 +#define U_int64 uint64 + @@ -52,41 +72,53 @@ void *memcpy(void *dest, const void *source, SYSTEM_ADRINT size); // Oberon types -typedef char BOOLEAN; -typedef unsigned char SYSTEM_BYTE; -typedef unsigned char CHAR; -typedef signed char SHORTINT; -typedef float REAL; -typedef double LONGREAL; -typedef void* SYSTEM_PTR; +// typedef char BOOLEAN; +// typedef unsigned char SYSTEM_BYTE; +// typedef unsigned char CHAR; +// typedef signed char SHORTINT; +// typedef float REAL; +// typedef double LONGREAL; +// typedef void* SYSTEM_PTR; + +typedef int8 BOOLEAN; +typedef int8 SYSTEM_BYTE; +typedef uint8 U_SYSTEM_BYTE; +typedef uint8 CHAR; +typedef uint8 U_CHAR; +typedef int8 SHORTINT; +typedef uint8 U_SHORTINT; +typedef float REAL; +typedef double LONGREAL; +typedef void* SYSTEM_PTR; + +typedef size_t SYSTEM_ADRINT; + // For 32 bit builds, the size of LONGINT depends on a make option: #if (__SIZEOF_POINTER__ == 8) || defined(LARGE) || defined(_WIN64) - typedef int INTEGER; // INTEGER is 32 bit. - typedef long long LONGINT; // LONGINT is 64 bit. (long long is always 64 bits, while long can be 32 bits e.g. under MSC/MingW) - typedef unsigned int U_INTEGER; - typedef unsigned long long U_LONGINT; + typedef int32 INTEGER; + typedef int64 LONGINT; + typedef uint32 U_INTEGER; + typedef uint64 U_LONGINT; #else - typedef short int INTEGER; // INTEGER is 16 bit. - typedef long LONGINT; // LONGINT is 32 bit. - typedef unsigned short int U_INTEGER; - typedef unsigned long U_LONGINT; + typedef int16 INTEGER; + typedef int32 LONGINT; + typedef uint16 U_INTEGER; + typedef uint32 U_LONGINT; #endif // Unsigned variants are for use by shift and rotate macros. -typedef unsigned char U_SYSTEM_BYTE; -typedef unsigned char U_CHAR; -typedef unsigned char U_SHORTINT; - typedef U_LONGINT SET; typedef U_LONGINT U_SET; -typedef SYSTEM_CARD8 U_SYSTEM_INT8; -typedef SYSTEM_CARD16 U_SYSTEM_INT16; -typedef SYSTEM_CARD32 U_SYSTEM_INT32; -typedef SYSTEM_CARD64 U_SYSTEM_INT64; + + + +// ---------------------------------------------------------------------- +// ---------------------------------------------------------------------- + // OS Memory allocation interfaces are in PlatformXXX.Mod From 6851833a1ea4b49bfe308581a4e1a9d720d8f87e Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 1 Sep 2016 14:45:23 +0100 Subject: [PATCH 208/580] Remove some temporary bottstrapping types. Change 'U_' to 'u'. --- bootstrap/unix-44/SYSTEM.c | 6 +-- bootstrap/unix-44/SYSTEM.h | 67 +++++++++------------------------- bootstrap/unix-48/SYSTEM.c | 6 +-- bootstrap/unix-48/SYSTEM.h | 67 +++++++++------------------------- bootstrap/unix-88/SYSTEM.c | 6 +-- bootstrap/unix-88/SYSTEM.h | 67 +++++++++------------------------- bootstrap/windows-48/SYSTEM.c | 6 +-- bootstrap/windows-48/SYSTEM.h | 67 +++++++++------------------------- bootstrap/windows-88/SYSTEM.c | 6 +-- bootstrap/windows-88/SYSTEM.h | 67 +++++++++------------------------- src/system/Platformwindows.Mod | 2 +- src/system/SYSTEM.c | 6 +-- src/system/SYSTEM.h | 67 +++++++++------------------------- src/tools/make/configure.c | 8 ++-- 14 files changed, 125 insertions(+), 323 deletions(-) diff --git a/bootstrap/unix-44/SYSTEM.c b/bootstrap/unix-44/SYSTEM.c index 1077d3ce..9bc6b756 100644 --- a/bootstrap/unix-44/SYSTEM.c +++ b/bootstrap/unix-44/SYSTEM.c @@ -54,13 +54,13 @@ void SYSTEM_ENUMR(void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()) } } -LONGINT SYSTEM_DIV(U_LONGINT x, U_LONGINT y) +LONGINT SYSTEM_DIV(uLONGINT x, uLONGINT y) { if ((LONGINT) x >= 0) return (x / y); else return -((y - 1 - x) / y); } -LONGINT SYSTEM_MOD(U_LONGINT x, U_LONGINT y) -{ U_LONGINT m; +LONGINT SYSTEM_MOD(uLONGINT x, uLONGINT y) +{ uLONGINT m; if ((LONGINT) x >= 0) return (x % y); else { m = (-x) % y; if (m != 0) return (y - m); else return 0; diff --git a/bootstrap/unix-44/SYSTEM.h b/bootstrap/unix-44/SYSTEM.h index 11ec8fc5..2cab2429 100644 --- a/bootstrap/unix-44/SYSTEM.h +++ b/bootstrap/unix-44/SYSTEM.h @@ -34,27 +34,6 @@ typedef unsigned char uint8; void *memcpy(void *dest, const void *source, size_t size); -// Temporary while bootstrapping: - -#define SYSTEM_INT8 int8 -#define SYSTEM_INT16 int16 -#define SYSTEM_INT32 int32 -#define SYSTEM_INT64 int64 -#define SYSTEM_ADDRESS size_t - -#define U_SYSTEM_INT8 uint8 -#define U_SYSTEM_INT16 uint16 -#define U_SYSTEM_INT32 uint32 -#define U_SYSTEM_INT64 uint64 - -#define U_int8 uint8 -#define U_int16 uint16 -#define U_int32 uint32 -#define U_int64 uint64 - - - - // The compiler uses 'import' and 'export' which translate to 'extern' and // nothing respectively. @@ -72,21 +51,11 @@ void *memcpy(void *dest, const void *source, size_t size); // Oberon types -// typedef char BOOLEAN; -// typedef unsigned char SYSTEM_BYTE; -// typedef unsigned char CHAR; -// typedef signed char SHORTINT; -// typedef float REAL; -// typedef double LONGREAL; -// typedef void* SYSTEM_PTR; - typedef int8 BOOLEAN; typedef int8 SYSTEM_BYTE; -typedef uint8 U_SYSTEM_BYTE; +typedef uint8 uSYSTEM_BYTE; typedef uint8 CHAR; -typedef uint8 U_CHAR; -typedef int8 SHORTINT; -typedef uint8 U_SHORTINT; +typedef uint8 uCHAR; typedef float REAL; typedef double LONGREAL; typedef void* SYSTEM_PTR; @@ -99,19 +68,17 @@ typedef size_t SYSTEM_ADRINT; #if (__SIZEOF_POINTER__ == 8) || defined(LARGE) || defined(_WIN64) typedef int32 INTEGER; typedef int64 LONGINT; - typedef uint32 U_INTEGER; - typedef uint64 U_LONGINT; + typedef uint64 uLONGINT; #else typedef int16 INTEGER; typedef int32 LONGINT; - typedef uint16 U_INTEGER; - typedef uint32 U_LONGINT; + typedef uint32 uLONGINT; #endif // Unsigned variants are for use by shift and rotate macros. -typedef U_LONGINT SET; -typedef U_LONGINT U_SET; +typedef uLONGINT SET; +typedef uLONGINT uSET; @@ -137,8 +104,8 @@ extern double SYSTEM_ABSD (double i); extern void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0); extern void SYSTEM_ENUMP (void *adr, LONGINT n, void (*P)()); extern void SYSTEM_ENUMR (void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()); -extern LONGINT SYSTEM_DIV (U_LONGINT x, U_LONGINT y); -extern LONGINT SYSTEM_MOD (U_LONGINT x, U_LONGINT y); +extern LONGINT SYSTEM_DIV (uLONGINT x, uLONGINT y); +extern LONGINT SYSTEM_MOD (uLONGINT x, uLONGINT y); extern LONGINT SYSTEM_ENTIER (double x); @@ -186,22 +153,22 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __GET(a, x, t) x= *(t*)(SYSTEM_ADRINT)(a) #define __PUT(a, x, t) *(t*)(SYSTEM_ADRINT)(a)=x -#define __LSHL(x, n, t) ((t)((U_##t)(x)<<(n))) -#define __LSHR(x, n, t) ((t)((U_##t)(x)>>(n))) +#define __LSHL(x, n, t) ((t)((u##t)(x)<<(n))) +#define __LSHR(x, n, t) ((t)((u##t)(x)>>(n))) #define __LSH(x, n, t) ((n)>=0? __LSHL(x, n, t): __LSHR(x, -(n), t)) #define __ASHL(x, n) ((LONGINT)(x)<<(n)) #define __ASHR(x, n) ((LONGINT)(x)>>(n)) #define __ASH(x, n) ((n)>=0?__ASHL(x,n):__ASHR(x,-(n))) -#define __ROTL(x, n, t) ((t)((U_##t)(x)<<(n)|(U_##t)(x)>>(8*sizeof(t)-(n)))) -#define __ROTR(x, n, t) ((t)((U_##t)(x)>>(n)|(U_##t)(x)<<(8*sizeof(t)-(n)))) +#define __ROTL(x, n, t) ((t)((u##t)(x)<<(n)|(u##t)(x)>>(8*sizeof(t)-(n)))) +#define __ROTR(x, n, t) ((t)((u##t)(x)>>(n)|(u##t)(x)<<(8*sizeof(t)-(n)))) #define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) -#define __BIT(x, n) (*(U_LONGINT*)(x)>>(n)&1) +#define __BIT(x, n) (*(uLONGINT*)(x)>>(n)&1) #define __MOVE(s, d, n) memcpy((char*)(SYSTEM_ADRINT)(d),(char*)(SYSTEM_ADRINT)(s),n) #define __ASHF(x, n) SYSTEM_ASH((LONGINT)(x), (LONGINT)(n)) -#define __SHORT(x, y) ((int)((U_LONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) +#define __SHORT(x, y) ((int)((uLONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) #define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) #define __CHR(x) ((CHAR)__R(x, 256)) #define __CHRF(x) ((CHAR)__RF(x, 256)) @@ -215,7 +182,7 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __ABSFD(x) SYSTEM_ABSD((double)(x)) #define __CAP(ch) ((CHAR)((ch)&0x5f)) #define __ODD(x) ((x)&1) -#define __IN(x, s) ((x)>=0 && (x)<(8*sizeof(SET)) && ((((U_SET)(s))>>(x))&1)) +#define __IN(x, s) ((x)>=0 && (x)<(8*sizeof(SET)) && ((((uSET)(s))>>(x))&1)) #define __SETOF(x) ((SET)1<<(x)) #define __SETRNG(l, h) ((~(SET)0<<(l))&~(SET)0>>(8*sizeof(SET)-1-(h))) #define __MASK(x, m) ((x)&~(m)) @@ -224,9 +191,9 @@ static int __str_cmp(CHAR *x, CHAR *y){ // Runtime checks -#define __X(i, ub) (((U_LONGINT)(i)<(U_LONGINT)(ub))?i:(__HALT(-2),0)) +#define __X(i, ub) (((uLONGINT)(i)<(uLONGINT)(ub))?i:(__HALT(-2),0)) #define __XF(i, ub) SYSTEM_XCHK((LONGINT)(i), (LONGINT)(ub)) -#define __R(i, ub) (((U_LONGINT)(i)<(U_LONGINT)(ub))?i:(__HALT(-8),0)) +#define __R(i, ub) (((uLONGINT)(i)<(uLONGINT)(ub))?i:(__HALT(-8),0)) #define __RF(i, ub) SYSTEM_RCHK((LONGINT)(i),(LONGINT)(ub)) #define __RETCHK __retchk: __HALT(-3); return 0; #define __CASECHK __HALT(-4) diff --git a/bootstrap/unix-48/SYSTEM.c b/bootstrap/unix-48/SYSTEM.c index 1077d3ce..9bc6b756 100644 --- a/bootstrap/unix-48/SYSTEM.c +++ b/bootstrap/unix-48/SYSTEM.c @@ -54,13 +54,13 @@ void SYSTEM_ENUMR(void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()) } } -LONGINT SYSTEM_DIV(U_LONGINT x, U_LONGINT y) +LONGINT SYSTEM_DIV(uLONGINT x, uLONGINT y) { if ((LONGINT) x >= 0) return (x / y); else return -((y - 1 - x) / y); } -LONGINT SYSTEM_MOD(U_LONGINT x, U_LONGINT y) -{ U_LONGINT m; +LONGINT SYSTEM_MOD(uLONGINT x, uLONGINT y) +{ uLONGINT m; if ((LONGINT) x >= 0) return (x % y); else { m = (-x) % y; if (m != 0) return (y - m); else return 0; diff --git a/bootstrap/unix-48/SYSTEM.h b/bootstrap/unix-48/SYSTEM.h index 11ec8fc5..2cab2429 100644 --- a/bootstrap/unix-48/SYSTEM.h +++ b/bootstrap/unix-48/SYSTEM.h @@ -34,27 +34,6 @@ typedef unsigned char uint8; void *memcpy(void *dest, const void *source, size_t size); -// Temporary while bootstrapping: - -#define SYSTEM_INT8 int8 -#define SYSTEM_INT16 int16 -#define SYSTEM_INT32 int32 -#define SYSTEM_INT64 int64 -#define SYSTEM_ADDRESS size_t - -#define U_SYSTEM_INT8 uint8 -#define U_SYSTEM_INT16 uint16 -#define U_SYSTEM_INT32 uint32 -#define U_SYSTEM_INT64 uint64 - -#define U_int8 uint8 -#define U_int16 uint16 -#define U_int32 uint32 -#define U_int64 uint64 - - - - // The compiler uses 'import' and 'export' which translate to 'extern' and // nothing respectively. @@ -72,21 +51,11 @@ void *memcpy(void *dest, const void *source, size_t size); // Oberon types -// typedef char BOOLEAN; -// typedef unsigned char SYSTEM_BYTE; -// typedef unsigned char CHAR; -// typedef signed char SHORTINT; -// typedef float REAL; -// typedef double LONGREAL; -// typedef void* SYSTEM_PTR; - typedef int8 BOOLEAN; typedef int8 SYSTEM_BYTE; -typedef uint8 U_SYSTEM_BYTE; +typedef uint8 uSYSTEM_BYTE; typedef uint8 CHAR; -typedef uint8 U_CHAR; -typedef int8 SHORTINT; -typedef uint8 U_SHORTINT; +typedef uint8 uCHAR; typedef float REAL; typedef double LONGREAL; typedef void* SYSTEM_PTR; @@ -99,19 +68,17 @@ typedef size_t SYSTEM_ADRINT; #if (__SIZEOF_POINTER__ == 8) || defined(LARGE) || defined(_WIN64) typedef int32 INTEGER; typedef int64 LONGINT; - typedef uint32 U_INTEGER; - typedef uint64 U_LONGINT; + typedef uint64 uLONGINT; #else typedef int16 INTEGER; typedef int32 LONGINT; - typedef uint16 U_INTEGER; - typedef uint32 U_LONGINT; + typedef uint32 uLONGINT; #endif // Unsigned variants are for use by shift and rotate macros. -typedef U_LONGINT SET; -typedef U_LONGINT U_SET; +typedef uLONGINT SET; +typedef uLONGINT uSET; @@ -137,8 +104,8 @@ extern double SYSTEM_ABSD (double i); extern void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0); extern void SYSTEM_ENUMP (void *adr, LONGINT n, void (*P)()); extern void SYSTEM_ENUMR (void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()); -extern LONGINT SYSTEM_DIV (U_LONGINT x, U_LONGINT y); -extern LONGINT SYSTEM_MOD (U_LONGINT x, U_LONGINT y); +extern LONGINT SYSTEM_DIV (uLONGINT x, uLONGINT y); +extern LONGINT SYSTEM_MOD (uLONGINT x, uLONGINT y); extern LONGINT SYSTEM_ENTIER (double x); @@ -186,22 +153,22 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __GET(a, x, t) x= *(t*)(SYSTEM_ADRINT)(a) #define __PUT(a, x, t) *(t*)(SYSTEM_ADRINT)(a)=x -#define __LSHL(x, n, t) ((t)((U_##t)(x)<<(n))) -#define __LSHR(x, n, t) ((t)((U_##t)(x)>>(n))) +#define __LSHL(x, n, t) ((t)((u##t)(x)<<(n))) +#define __LSHR(x, n, t) ((t)((u##t)(x)>>(n))) #define __LSH(x, n, t) ((n)>=0? __LSHL(x, n, t): __LSHR(x, -(n), t)) #define __ASHL(x, n) ((LONGINT)(x)<<(n)) #define __ASHR(x, n) ((LONGINT)(x)>>(n)) #define __ASH(x, n) ((n)>=0?__ASHL(x,n):__ASHR(x,-(n))) -#define __ROTL(x, n, t) ((t)((U_##t)(x)<<(n)|(U_##t)(x)>>(8*sizeof(t)-(n)))) -#define __ROTR(x, n, t) ((t)((U_##t)(x)>>(n)|(U_##t)(x)<<(8*sizeof(t)-(n)))) +#define __ROTL(x, n, t) ((t)((u##t)(x)<<(n)|(u##t)(x)>>(8*sizeof(t)-(n)))) +#define __ROTR(x, n, t) ((t)((u##t)(x)>>(n)|(u##t)(x)<<(8*sizeof(t)-(n)))) #define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) -#define __BIT(x, n) (*(U_LONGINT*)(x)>>(n)&1) +#define __BIT(x, n) (*(uLONGINT*)(x)>>(n)&1) #define __MOVE(s, d, n) memcpy((char*)(SYSTEM_ADRINT)(d),(char*)(SYSTEM_ADRINT)(s),n) #define __ASHF(x, n) SYSTEM_ASH((LONGINT)(x), (LONGINT)(n)) -#define __SHORT(x, y) ((int)((U_LONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) +#define __SHORT(x, y) ((int)((uLONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) #define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) #define __CHR(x) ((CHAR)__R(x, 256)) #define __CHRF(x) ((CHAR)__RF(x, 256)) @@ -215,7 +182,7 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __ABSFD(x) SYSTEM_ABSD((double)(x)) #define __CAP(ch) ((CHAR)((ch)&0x5f)) #define __ODD(x) ((x)&1) -#define __IN(x, s) ((x)>=0 && (x)<(8*sizeof(SET)) && ((((U_SET)(s))>>(x))&1)) +#define __IN(x, s) ((x)>=0 && (x)<(8*sizeof(SET)) && ((((uSET)(s))>>(x))&1)) #define __SETOF(x) ((SET)1<<(x)) #define __SETRNG(l, h) ((~(SET)0<<(l))&~(SET)0>>(8*sizeof(SET)-1-(h))) #define __MASK(x, m) ((x)&~(m)) @@ -224,9 +191,9 @@ static int __str_cmp(CHAR *x, CHAR *y){ // Runtime checks -#define __X(i, ub) (((U_LONGINT)(i)<(U_LONGINT)(ub))?i:(__HALT(-2),0)) +#define __X(i, ub) (((uLONGINT)(i)<(uLONGINT)(ub))?i:(__HALT(-2),0)) #define __XF(i, ub) SYSTEM_XCHK((LONGINT)(i), (LONGINT)(ub)) -#define __R(i, ub) (((U_LONGINT)(i)<(U_LONGINT)(ub))?i:(__HALT(-8),0)) +#define __R(i, ub) (((uLONGINT)(i)<(uLONGINT)(ub))?i:(__HALT(-8),0)) #define __RF(i, ub) SYSTEM_RCHK((LONGINT)(i),(LONGINT)(ub)) #define __RETCHK __retchk: __HALT(-3); return 0; #define __CASECHK __HALT(-4) diff --git a/bootstrap/unix-88/SYSTEM.c b/bootstrap/unix-88/SYSTEM.c index 1077d3ce..9bc6b756 100644 --- a/bootstrap/unix-88/SYSTEM.c +++ b/bootstrap/unix-88/SYSTEM.c @@ -54,13 +54,13 @@ void SYSTEM_ENUMR(void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()) } } -LONGINT SYSTEM_DIV(U_LONGINT x, U_LONGINT y) +LONGINT SYSTEM_DIV(uLONGINT x, uLONGINT y) { if ((LONGINT) x >= 0) return (x / y); else return -((y - 1 - x) / y); } -LONGINT SYSTEM_MOD(U_LONGINT x, U_LONGINT y) -{ U_LONGINT m; +LONGINT SYSTEM_MOD(uLONGINT x, uLONGINT y) +{ uLONGINT m; if ((LONGINT) x >= 0) return (x % y); else { m = (-x) % y; if (m != 0) return (y - m); else return 0; diff --git a/bootstrap/unix-88/SYSTEM.h b/bootstrap/unix-88/SYSTEM.h index 11ec8fc5..2cab2429 100644 --- a/bootstrap/unix-88/SYSTEM.h +++ b/bootstrap/unix-88/SYSTEM.h @@ -34,27 +34,6 @@ typedef unsigned char uint8; void *memcpy(void *dest, const void *source, size_t size); -// Temporary while bootstrapping: - -#define SYSTEM_INT8 int8 -#define SYSTEM_INT16 int16 -#define SYSTEM_INT32 int32 -#define SYSTEM_INT64 int64 -#define SYSTEM_ADDRESS size_t - -#define U_SYSTEM_INT8 uint8 -#define U_SYSTEM_INT16 uint16 -#define U_SYSTEM_INT32 uint32 -#define U_SYSTEM_INT64 uint64 - -#define U_int8 uint8 -#define U_int16 uint16 -#define U_int32 uint32 -#define U_int64 uint64 - - - - // The compiler uses 'import' and 'export' which translate to 'extern' and // nothing respectively. @@ -72,21 +51,11 @@ void *memcpy(void *dest, const void *source, size_t size); // Oberon types -// typedef char BOOLEAN; -// typedef unsigned char SYSTEM_BYTE; -// typedef unsigned char CHAR; -// typedef signed char SHORTINT; -// typedef float REAL; -// typedef double LONGREAL; -// typedef void* SYSTEM_PTR; - typedef int8 BOOLEAN; typedef int8 SYSTEM_BYTE; -typedef uint8 U_SYSTEM_BYTE; +typedef uint8 uSYSTEM_BYTE; typedef uint8 CHAR; -typedef uint8 U_CHAR; -typedef int8 SHORTINT; -typedef uint8 U_SHORTINT; +typedef uint8 uCHAR; typedef float REAL; typedef double LONGREAL; typedef void* SYSTEM_PTR; @@ -99,19 +68,17 @@ typedef size_t SYSTEM_ADRINT; #if (__SIZEOF_POINTER__ == 8) || defined(LARGE) || defined(_WIN64) typedef int32 INTEGER; typedef int64 LONGINT; - typedef uint32 U_INTEGER; - typedef uint64 U_LONGINT; + typedef uint64 uLONGINT; #else typedef int16 INTEGER; typedef int32 LONGINT; - typedef uint16 U_INTEGER; - typedef uint32 U_LONGINT; + typedef uint32 uLONGINT; #endif // Unsigned variants are for use by shift and rotate macros. -typedef U_LONGINT SET; -typedef U_LONGINT U_SET; +typedef uLONGINT SET; +typedef uLONGINT uSET; @@ -137,8 +104,8 @@ extern double SYSTEM_ABSD (double i); extern void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0); extern void SYSTEM_ENUMP (void *adr, LONGINT n, void (*P)()); extern void SYSTEM_ENUMR (void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()); -extern LONGINT SYSTEM_DIV (U_LONGINT x, U_LONGINT y); -extern LONGINT SYSTEM_MOD (U_LONGINT x, U_LONGINT y); +extern LONGINT SYSTEM_DIV (uLONGINT x, uLONGINT y); +extern LONGINT SYSTEM_MOD (uLONGINT x, uLONGINT y); extern LONGINT SYSTEM_ENTIER (double x); @@ -186,22 +153,22 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __GET(a, x, t) x= *(t*)(SYSTEM_ADRINT)(a) #define __PUT(a, x, t) *(t*)(SYSTEM_ADRINT)(a)=x -#define __LSHL(x, n, t) ((t)((U_##t)(x)<<(n))) -#define __LSHR(x, n, t) ((t)((U_##t)(x)>>(n))) +#define __LSHL(x, n, t) ((t)((u##t)(x)<<(n))) +#define __LSHR(x, n, t) ((t)((u##t)(x)>>(n))) #define __LSH(x, n, t) ((n)>=0? __LSHL(x, n, t): __LSHR(x, -(n), t)) #define __ASHL(x, n) ((LONGINT)(x)<<(n)) #define __ASHR(x, n) ((LONGINT)(x)>>(n)) #define __ASH(x, n) ((n)>=0?__ASHL(x,n):__ASHR(x,-(n))) -#define __ROTL(x, n, t) ((t)((U_##t)(x)<<(n)|(U_##t)(x)>>(8*sizeof(t)-(n)))) -#define __ROTR(x, n, t) ((t)((U_##t)(x)>>(n)|(U_##t)(x)<<(8*sizeof(t)-(n)))) +#define __ROTL(x, n, t) ((t)((u##t)(x)<<(n)|(u##t)(x)>>(8*sizeof(t)-(n)))) +#define __ROTR(x, n, t) ((t)((u##t)(x)>>(n)|(u##t)(x)<<(8*sizeof(t)-(n)))) #define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) -#define __BIT(x, n) (*(U_LONGINT*)(x)>>(n)&1) +#define __BIT(x, n) (*(uLONGINT*)(x)>>(n)&1) #define __MOVE(s, d, n) memcpy((char*)(SYSTEM_ADRINT)(d),(char*)(SYSTEM_ADRINT)(s),n) #define __ASHF(x, n) SYSTEM_ASH((LONGINT)(x), (LONGINT)(n)) -#define __SHORT(x, y) ((int)((U_LONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) +#define __SHORT(x, y) ((int)((uLONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) #define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) #define __CHR(x) ((CHAR)__R(x, 256)) #define __CHRF(x) ((CHAR)__RF(x, 256)) @@ -215,7 +182,7 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __ABSFD(x) SYSTEM_ABSD((double)(x)) #define __CAP(ch) ((CHAR)((ch)&0x5f)) #define __ODD(x) ((x)&1) -#define __IN(x, s) ((x)>=0 && (x)<(8*sizeof(SET)) && ((((U_SET)(s))>>(x))&1)) +#define __IN(x, s) ((x)>=0 && (x)<(8*sizeof(SET)) && ((((uSET)(s))>>(x))&1)) #define __SETOF(x) ((SET)1<<(x)) #define __SETRNG(l, h) ((~(SET)0<<(l))&~(SET)0>>(8*sizeof(SET)-1-(h))) #define __MASK(x, m) ((x)&~(m)) @@ -224,9 +191,9 @@ static int __str_cmp(CHAR *x, CHAR *y){ // Runtime checks -#define __X(i, ub) (((U_LONGINT)(i)<(U_LONGINT)(ub))?i:(__HALT(-2),0)) +#define __X(i, ub) (((uLONGINT)(i)<(uLONGINT)(ub))?i:(__HALT(-2),0)) #define __XF(i, ub) SYSTEM_XCHK((LONGINT)(i), (LONGINT)(ub)) -#define __R(i, ub) (((U_LONGINT)(i)<(U_LONGINT)(ub))?i:(__HALT(-8),0)) +#define __R(i, ub) (((uLONGINT)(i)<(uLONGINT)(ub))?i:(__HALT(-8),0)) #define __RF(i, ub) SYSTEM_RCHK((LONGINT)(i),(LONGINT)(ub)) #define __RETCHK __retchk: __HALT(-3); return 0; #define __CASECHK __HALT(-4) diff --git a/bootstrap/windows-48/SYSTEM.c b/bootstrap/windows-48/SYSTEM.c index 1077d3ce..9bc6b756 100644 --- a/bootstrap/windows-48/SYSTEM.c +++ b/bootstrap/windows-48/SYSTEM.c @@ -54,13 +54,13 @@ void SYSTEM_ENUMR(void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()) } } -LONGINT SYSTEM_DIV(U_LONGINT x, U_LONGINT y) +LONGINT SYSTEM_DIV(uLONGINT x, uLONGINT y) { if ((LONGINT) x >= 0) return (x / y); else return -((y - 1 - x) / y); } -LONGINT SYSTEM_MOD(U_LONGINT x, U_LONGINT y) -{ U_LONGINT m; +LONGINT SYSTEM_MOD(uLONGINT x, uLONGINT y) +{ uLONGINT m; if ((LONGINT) x >= 0) return (x % y); else { m = (-x) % y; if (m != 0) return (y - m); else return 0; diff --git a/bootstrap/windows-48/SYSTEM.h b/bootstrap/windows-48/SYSTEM.h index 11ec8fc5..2cab2429 100644 --- a/bootstrap/windows-48/SYSTEM.h +++ b/bootstrap/windows-48/SYSTEM.h @@ -34,27 +34,6 @@ typedef unsigned char uint8; void *memcpy(void *dest, const void *source, size_t size); -// Temporary while bootstrapping: - -#define SYSTEM_INT8 int8 -#define SYSTEM_INT16 int16 -#define SYSTEM_INT32 int32 -#define SYSTEM_INT64 int64 -#define SYSTEM_ADDRESS size_t - -#define U_SYSTEM_INT8 uint8 -#define U_SYSTEM_INT16 uint16 -#define U_SYSTEM_INT32 uint32 -#define U_SYSTEM_INT64 uint64 - -#define U_int8 uint8 -#define U_int16 uint16 -#define U_int32 uint32 -#define U_int64 uint64 - - - - // The compiler uses 'import' and 'export' which translate to 'extern' and // nothing respectively. @@ -72,21 +51,11 @@ void *memcpy(void *dest, const void *source, size_t size); // Oberon types -// typedef char BOOLEAN; -// typedef unsigned char SYSTEM_BYTE; -// typedef unsigned char CHAR; -// typedef signed char SHORTINT; -// typedef float REAL; -// typedef double LONGREAL; -// typedef void* SYSTEM_PTR; - typedef int8 BOOLEAN; typedef int8 SYSTEM_BYTE; -typedef uint8 U_SYSTEM_BYTE; +typedef uint8 uSYSTEM_BYTE; typedef uint8 CHAR; -typedef uint8 U_CHAR; -typedef int8 SHORTINT; -typedef uint8 U_SHORTINT; +typedef uint8 uCHAR; typedef float REAL; typedef double LONGREAL; typedef void* SYSTEM_PTR; @@ -99,19 +68,17 @@ typedef size_t SYSTEM_ADRINT; #if (__SIZEOF_POINTER__ == 8) || defined(LARGE) || defined(_WIN64) typedef int32 INTEGER; typedef int64 LONGINT; - typedef uint32 U_INTEGER; - typedef uint64 U_LONGINT; + typedef uint64 uLONGINT; #else typedef int16 INTEGER; typedef int32 LONGINT; - typedef uint16 U_INTEGER; - typedef uint32 U_LONGINT; + typedef uint32 uLONGINT; #endif // Unsigned variants are for use by shift and rotate macros. -typedef U_LONGINT SET; -typedef U_LONGINT U_SET; +typedef uLONGINT SET; +typedef uLONGINT uSET; @@ -137,8 +104,8 @@ extern double SYSTEM_ABSD (double i); extern void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0); extern void SYSTEM_ENUMP (void *adr, LONGINT n, void (*P)()); extern void SYSTEM_ENUMR (void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()); -extern LONGINT SYSTEM_DIV (U_LONGINT x, U_LONGINT y); -extern LONGINT SYSTEM_MOD (U_LONGINT x, U_LONGINT y); +extern LONGINT SYSTEM_DIV (uLONGINT x, uLONGINT y); +extern LONGINT SYSTEM_MOD (uLONGINT x, uLONGINT y); extern LONGINT SYSTEM_ENTIER (double x); @@ -186,22 +153,22 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __GET(a, x, t) x= *(t*)(SYSTEM_ADRINT)(a) #define __PUT(a, x, t) *(t*)(SYSTEM_ADRINT)(a)=x -#define __LSHL(x, n, t) ((t)((U_##t)(x)<<(n))) -#define __LSHR(x, n, t) ((t)((U_##t)(x)>>(n))) +#define __LSHL(x, n, t) ((t)((u##t)(x)<<(n))) +#define __LSHR(x, n, t) ((t)((u##t)(x)>>(n))) #define __LSH(x, n, t) ((n)>=0? __LSHL(x, n, t): __LSHR(x, -(n), t)) #define __ASHL(x, n) ((LONGINT)(x)<<(n)) #define __ASHR(x, n) ((LONGINT)(x)>>(n)) #define __ASH(x, n) ((n)>=0?__ASHL(x,n):__ASHR(x,-(n))) -#define __ROTL(x, n, t) ((t)((U_##t)(x)<<(n)|(U_##t)(x)>>(8*sizeof(t)-(n)))) -#define __ROTR(x, n, t) ((t)((U_##t)(x)>>(n)|(U_##t)(x)<<(8*sizeof(t)-(n)))) +#define __ROTL(x, n, t) ((t)((u##t)(x)<<(n)|(u##t)(x)>>(8*sizeof(t)-(n)))) +#define __ROTR(x, n, t) ((t)((u##t)(x)>>(n)|(u##t)(x)<<(8*sizeof(t)-(n)))) #define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) -#define __BIT(x, n) (*(U_LONGINT*)(x)>>(n)&1) +#define __BIT(x, n) (*(uLONGINT*)(x)>>(n)&1) #define __MOVE(s, d, n) memcpy((char*)(SYSTEM_ADRINT)(d),(char*)(SYSTEM_ADRINT)(s),n) #define __ASHF(x, n) SYSTEM_ASH((LONGINT)(x), (LONGINT)(n)) -#define __SHORT(x, y) ((int)((U_LONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) +#define __SHORT(x, y) ((int)((uLONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) #define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) #define __CHR(x) ((CHAR)__R(x, 256)) #define __CHRF(x) ((CHAR)__RF(x, 256)) @@ -215,7 +182,7 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __ABSFD(x) SYSTEM_ABSD((double)(x)) #define __CAP(ch) ((CHAR)((ch)&0x5f)) #define __ODD(x) ((x)&1) -#define __IN(x, s) ((x)>=0 && (x)<(8*sizeof(SET)) && ((((U_SET)(s))>>(x))&1)) +#define __IN(x, s) ((x)>=0 && (x)<(8*sizeof(SET)) && ((((uSET)(s))>>(x))&1)) #define __SETOF(x) ((SET)1<<(x)) #define __SETRNG(l, h) ((~(SET)0<<(l))&~(SET)0>>(8*sizeof(SET)-1-(h))) #define __MASK(x, m) ((x)&~(m)) @@ -224,9 +191,9 @@ static int __str_cmp(CHAR *x, CHAR *y){ // Runtime checks -#define __X(i, ub) (((U_LONGINT)(i)<(U_LONGINT)(ub))?i:(__HALT(-2),0)) +#define __X(i, ub) (((uLONGINT)(i)<(uLONGINT)(ub))?i:(__HALT(-2),0)) #define __XF(i, ub) SYSTEM_XCHK((LONGINT)(i), (LONGINT)(ub)) -#define __R(i, ub) (((U_LONGINT)(i)<(U_LONGINT)(ub))?i:(__HALT(-8),0)) +#define __R(i, ub) (((uLONGINT)(i)<(uLONGINT)(ub))?i:(__HALT(-8),0)) #define __RF(i, ub) SYSTEM_RCHK((LONGINT)(i),(LONGINT)(ub)) #define __RETCHK __retchk: __HALT(-3); return 0; #define __CASECHK __HALT(-4) diff --git a/bootstrap/windows-88/SYSTEM.c b/bootstrap/windows-88/SYSTEM.c index 1077d3ce..9bc6b756 100644 --- a/bootstrap/windows-88/SYSTEM.c +++ b/bootstrap/windows-88/SYSTEM.c @@ -54,13 +54,13 @@ void SYSTEM_ENUMR(void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()) } } -LONGINT SYSTEM_DIV(U_LONGINT x, U_LONGINT y) +LONGINT SYSTEM_DIV(uLONGINT x, uLONGINT y) { if ((LONGINT) x >= 0) return (x / y); else return -((y - 1 - x) / y); } -LONGINT SYSTEM_MOD(U_LONGINT x, U_LONGINT y) -{ U_LONGINT m; +LONGINT SYSTEM_MOD(uLONGINT x, uLONGINT y) +{ uLONGINT m; if ((LONGINT) x >= 0) return (x % y); else { m = (-x) % y; if (m != 0) return (y - m); else return 0; diff --git a/bootstrap/windows-88/SYSTEM.h b/bootstrap/windows-88/SYSTEM.h index 11ec8fc5..2cab2429 100644 --- a/bootstrap/windows-88/SYSTEM.h +++ b/bootstrap/windows-88/SYSTEM.h @@ -34,27 +34,6 @@ typedef unsigned char uint8; void *memcpy(void *dest, const void *source, size_t size); -// Temporary while bootstrapping: - -#define SYSTEM_INT8 int8 -#define SYSTEM_INT16 int16 -#define SYSTEM_INT32 int32 -#define SYSTEM_INT64 int64 -#define SYSTEM_ADDRESS size_t - -#define U_SYSTEM_INT8 uint8 -#define U_SYSTEM_INT16 uint16 -#define U_SYSTEM_INT32 uint32 -#define U_SYSTEM_INT64 uint64 - -#define U_int8 uint8 -#define U_int16 uint16 -#define U_int32 uint32 -#define U_int64 uint64 - - - - // The compiler uses 'import' and 'export' which translate to 'extern' and // nothing respectively. @@ -72,21 +51,11 @@ void *memcpy(void *dest, const void *source, size_t size); // Oberon types -// typedef char BOOLEAN; -// typedef unsigned char SYSTEM_BYTE; -// typedef unsigned char CHAR; -// typedef signed char SHORTINT; -// typedef float REAL; -// typedef double LONGREAL; -// typedef void* SYSTEM_PTR; - typedef int8 BOOLEAN; typedef int8 SYSTEM_BYTE; -typedef uint8 U_SYSTEM_BYTE; +typedef uint8 uSYSTEM_BYTE; typedef uint8 CHAR; -typedef uint8 U_CHAR; -typedef int8 SHORTINT; -typedef uint8 U_SHORTINT; +typedef uint8 uCHAR; typedef float REAL; typedef double LONGREAL; typedef void* SYSTEM_PTR; @@ -99,19 +68,17 @@ typedef size_t SYSTEM_ADRINT; #if (__SIZEOF_POINTER__ == 8) || defined(LARGE) || defined(_WIN64) typedef int32 INTEGER; typedef int64 LONGINT; - typedef uint32 U_INTEGER; - typedef uint64 U_LONGINT; + typedef uint64 uLONGINT; #else typedef int16 INTEGER; typedef int32 LONGINT; - typedef uint16 U_INTEGER; - typedef uint32 U_LONGINT; + typedef uint32 uLONGINT; #endif // Unsigned variants are for use by shift and rotate macros. -typedef U_LONGINT SET; -typedef U_LONGINT U_SET; +typedef uLONGINT SET; +typedef uLONGINT uSET; @@ -137,8 +104,8 @@ extern double SYSTEM_ABSD (double i); extern void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0); extern void SYSTEM_ENUMP (void *adr, LONGINT n, void (*P)()); extern void SYSTEM_ENUMR (void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()); -extern LONGINT SYSTEM_DIV (U_LONGINT x, U_LONGINT y); -extern LONGINT SYSTEM_MOD (U_LONGINT x, U_LONGINT y); +extern LONGINT SYSTEM_DIV (uLONGINT x, uLONGINT y); +extern LONGINT SYSTEM_MOD (uLONGINT x, uLONGINT y); extern LONGINT SYSTEM_ENTIER (double x); @@ -186,22 +153,22 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __GET(a, x, t) x= *(t*)(SYSTEM_ADRINT)(a) #define __PUT(a, x, t) *(t*)(SYSTEM_ADRINT)(a)=x -#define __LSHL(x, n, t) ((t)((U_##t)(x)<<(n))) -#define __LSHR(x, n, t) ((t)((U_##t)(x)>>(n))) +#define __LSHL(x, n, t) ((t)((u##t)(x)<<(n))) +#define __LSHR(x, n, t) ((t)((u##t)(x)>>(n))) #define __LSH(x, n, t) ((n)>=0? __LSHL(x, n, t): __LSHR(x, -(n), t)) #define __ASHL(x, n) ((LONGINT)(x)<<(n)) #define __ASHR(x, n) ((LONGINT)(x)>>(n)) #define __ASH(x, n) ((n)>=0?__ASHL(x,n):__ASHR(x,-(n))) -#define __ROTL(x, n, t) ((t)((U_##t)(x)<<(n)|(U_##t)(x)>>(8*sizeof(t)-(n)))) -#define __ROTR(x, n, t) ((t)((U_##t)(x)>>(n)|(U_##t)(x)<<(8*sizeof(t)-(n)))) +#define __ROTL(x, n, t) ((t)((u##t)(x)<<(n)|(u##t)(x)>>(8*sizeof(t)-(n)))) +#define __ROTR(x, n, t) ((t)((u##t)(x)>>(n)|(u##t)(x)<<(8*sizeof(t)-(n)))) #define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) -#define __BIT(x, n) (*(U_LONGINT*)(x)>>(n)&1) +#define __BIT(x, n) (*(uLONGINT*)(x)>>(n)&1) #define __MOVE(s, d, n) memcpy((char*)(SYSTEM_ADRINT)(d),(char*)(SYSTEM_ADRINT)(s),n) #define __ASHF(x, n) SYSTEM_ASH((LONGINT)(x), (LONGINT)(n)) -#define __SHORT(x, y) ((int)((U_LONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) +#define __SHORT(x, y) ((int)((uLONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) #define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) #define __CHR(x) ((CHAR)__R(x, 256)) #define __CHRF(x) ((CHAR)__RF(x, 256)) @@ -215,7 +182,7 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __ABSFD(x) SYSTEM_ABSD((double)(x)) #define __CAP(ch) ((CHAR)((ch)&0x5f)) #define __ODD(x) ((x)&1) -#define __IN(x, s) ((x)>=0 && (x)<(8*sizeof(SET)) && ((((U_SET)(s))>>(x))&1)) +#define __IN(x, s) ((x)>=0 && (x)<(8*sizeof(SET)) && ((((uSET)(s))>>(x))&1)) #define __SETOF(x) ((SET)1<<(x)) #define __SETRNG(l, h) ((~(SET)0<<(l))&~(SET)0>>(8*sizeof(SET)-1-(h))) #define __MASK(x, m) ((x)&~(m)) @@ -224,9 +191,9 @@ static int __str_cmp(CHAR *x, CHAR *y){ // Runtime checks -#define __X(i, ub) (((U_LONGINT)(i)<(U_LONGINT)(ub))?i:(__HALT(-2),0)) +#define __X(i, ub) (((uLONGINT)(i)<(uLONGINT)(ub))?i:(__HALT(-2),0)) #define __XF(i, ub) SYSTEM_XCHK((LONGINT)(i), (LONGINT)(ub)) -#define __R(i, ub) (((U_LONGINT)(i)<(U_LONGINT)(ub))?i:(__HALT(-8),0)) +#define __R(i, ub) (((uLONGINT)(i)<(uLONGINT)(ub))?i:(__HALT(-8),0)) #define __RF(i, ub) SYSTEM_RCHK((LONGINT)(i),(LONGINT)(ub)) #define __RETCHK __retchk: __HALT(-3); return 0; #define __CASECHK __HALT(-4) diff --git a/src/system/Platformwindows.Mod b/src/system/Platformwindows.Mod index cfd080be..7511e427 100644 --- a/src/system/Platformwindows.Mod +++ b/src/system/Platformwindows.Mod @@ -232,7 +232,7 @@ BEGIN YMDHMStoClock(styear(), stmon(), stmday(), sthour(), stmin(), stsec(), t, d); END GetClock; -PROCEDURE -GetTickCount(): LONGINT "(LONGINT)(SYSTEM_CARD32)GetTickCount()"; +PROCEDURE -GetTickCount(): LONGINT "(LONGINT)(uint32)GetTickCount()"; PROCEDURE Time*(): LONGINT; VAR ms: LONGINT; diff --git a/src/system/SYSTEM.c b/src/system/SYSTEM.c index 1077d3ce..9bc6b756 100644 --- a/src/system/SYSTEM.c +++ b/src/system/SYSTEM.c @@ -54,13 +54,13 @@ void SYSTEM_ENUMR(void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()) } } -LONGINT SYSTEM_DIV(U_LONGINT x, U_LONGINT y) +LONGINT SYSTEM_DIV(uLONGINT x, uLONGINT y) { if ((LONGINT) x >= 0) return (x / y); else return -((y - 1 - x) / y); } -LONGINT SYSTEM_MOD(U_LONGINT x, U_LONGINT y) -{ U_LONGINT m; +LONGINT SYSTEM_MOD(uLONGINT x, uLONGINT y) +{ uLONGINT m; if ((LONGINT) x >= 0) return (x % y); else { m = (-x) % y; if (m != 0) return (y - m); else return 0; diff --git a/src/system/SYSTEM.h b/src/system/SYSTEM.h index 11ec8fc5..2cab2429 100644 --- a/src/system/SYSTEM.h +++ b/src/system/SYSTEM.h @@ -34,27 +34,6 @@ typedef unsigned char uint8; void *memcpy(void *dest, const void *source, size_t size); -// Temporary while bootstrapping: - -#define SYSTEM_INT8 int8 -#define SYSTEM_INT16 int16 -#define SYSTEM_INT32 int32 -#define SYSTEM_INT64 int64 -#define SYSTEM_ADDRESS size_t - -#define U_SYSTEM_INT8 uint8 -#define U_SYSTEM_INT16 uint16 -#define U_SYSTEM_INT32 uint32 -#define U_SYSTEM_INT64 uint64 - -#define U_int8 uint8 -#define U_int16 uint16 -#define U_int32 uint32 -#define U_int64 uint64 - - - - // The compiler uses 'import' and 'export' which translate to 'extern' and // nothing respectively. @@ -72,21 +51,11 @@ void *memcpy(void *dest, const void *source, size_t size); // Oberon types -// typedef char BOOLEAN; -// typedef unsigned char SYSTEM_BYTE; -// typedef unsigned char CHAR; -// typedef signed char SHORTINT; -// typedef float REAL; -// typedef double LONGREAL; -// typedef void* SYSTEM_PTR; - typedef int8 BOOLEAN; typedef int8 SYSTEM_BYTE; -typedef uint8 U_SYSTEM_BYTE; +typedef uint8 uSYSTEM_BYTE; typedef uint8 CHAR; -typedef uint8 U_CHAR; -typedef int8 SHORTINT; -typedef uint8 U_SHORTINT; +typedef uint8 uCHAR; typedef float REAL; typedef double LONGREAL; typedef void* SYSTEM_PTR; @@ -99,19 +68,17 @@ typedef size_t SYSTEM_ADRINT; #if (__SIZEOF_POINTER__ == 8) || defined(LARGE) || defined(_WIN64) typedef int32 INTEGER; typedef int64 LONGINT; - typedef uint32 U_INTEGER; - typedef uint64 U_LONGINT; + typedef uint64 uLONGINT; #else typedef int16 INTEGER; typedef int32 LONGINT; - typedef uint16 U_INTEGER; - typedef uint32 U_LONGINT; + typedef uint32 uLONGINT; #endif // Unsigned variants are for use by shift and rotate macros. -typedef U_LONGINT SET; -typedef U_LONGINT U_SET; +typedef uLONGINT SET; +typedef uLONGINT uSET; @@ -137,8 +104,8 @@ extern double SYSTEM_ABSD (double i); extern void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0); extern void SYSTEM_ENUMP (void *adr, LONGINT n, void (*P)()); extern void SYSTEM_ENUMR (void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()); -extern LONGINT SYSTEM_DIV (U_LONGINT x, U_LONGINT y); -extern LONGINT SYSTEM_MOD (U_LONGINT x, U_LONGINT y); +extern LONGINT SYSTEM_DIV (uLONGINT x, uLONGINT y); +extern LONGINT SYSTEM_MOD (uLONGINT x, uLONGINT y); extern LONGINT SYSTEM_ENTIER (double x); @@ -186,22 +153,22 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __GET(a, x, t) x= *(t*)(SYSTEM_ADRINT)(a) #define __PUT(a, x, t) *(t*)(SYSTEM_ADRINT)(a)=x -#define __LSHL(x, n, t) ((t)((U_##t)(x)<<(n))) -#define __LSHR(x, n, t) ((t)((U_##t)(x)>>(n))) +#define __LSHL(x, n, t) ((t)((u##t)(x)<<(n))) +#define __LSHR(x, n, t) ((t)((u##t)(x)>>(n))) #define __LSH(x, n, t) ((n)>=0? __LSHL(x, n, t): __LSHR(x, -(n), t)) #define __ASHL(x, n) ((LONGINT)(x)<<(n)) #define __ASHR(x, n) ((LONGINT)(x)>>(n)) #define __ASH(x, n) ((n)>=0?__ASHL(x,n):__ASHR(x,-(n))) -#define __ROTL(x, n, t) ((t)((U_##t)(x)<<(n)|(U_##t)(x)>>(8*sizeof(t)-(n)))) -#define __ROTR(x, n, t) ((t)((U_##t)(x)>>(n)|(U_##t)(x)<<(8*sizeof(t)-(n)))) +#define __ROTL(x, n, t) ((t)((u##t)(x)<<(n)|(u##t)(x)>>(8*sizeof(t)-(n)))) +#define __ROTR(x, n, t) ((t)((u##t)(x)>>(n)|(u##t)(x)<<(8*sizeof(t)-(n)))) #define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) -#define __BIT(x, n) (*(U_LONGINT*)(x)>>(n)&1) +#define __BIT(x, n) (*(uLONGINT*)(x)>>(n)&1) #define __MOVE(s, d, n) memcpy((char*)(SYSTEM_ADRINT)(d),(char*)(SYSTEM_ADRINT)(s),n) #define __ASHF(x, n) SYSTEM_ASH((LONGINT)(x), (LONGINT)(n)) -#define __SHORT(x, y) ((int)((U_LONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) +#define __SHORT(x, y) ((int)((uLONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) #define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) #define __CHR(x) ((CHAR)__R(x, 256)) #define __CHRF(x) ((CHAR)__RF(x, 256)) @@ -215,7 +182,7 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __ABSFD(x) SYSTEM_ABSD((double)(x)) #define __CAP(ch) ((CHAR)((ch)&0x5f)) #define __ODD(x) ((x)&1) -#define __IN(x, s) ((x)>=0 && (x)<(8*sizeof(SET)) && ((((U_SET)(s))>>(x))&1)) +#define __IN(x, s) ((x)>=0 && (x)<(8*sizeof(SET)) && ((((uSET)(s))>>(x))&1)) #define __SETOF(x) ((SET)1<<(x)) #define __SETRNG(l, h) ((~(SET)0<<(l))&~(SET)0>>(8*sizeof(SET)-1-(h))) #define __MASK(x, m) ((x)&~(m)) @@ -224,9 +191,9 @@ static int __str_cmp(CHAR *x, CHAR *y){ // Runtime checks -#define __X(i, ub) (((U_LONGINT)(i)<(U_LONGINT)(ub))?i:(__HALT(-2),0)) +#define __X(i, ub) (((uLONGINT)(i)<(uLONGINT)(ub))?i:(__HALT(-2),0)) #define __XF(i, ub) SYSTEM_XCHK((LONGINT)(i), (LONGINT)(ub)) -#define __R(i, ub) (((U_LONGINT)(i)<(U_LONGINT)(ub))?i:(__HALT(-8),0)) +#define __R(i, ub) (((uLONGINT)(i)<(uLONGINT)(ub))?i:(__HALT(-8),0)) #define __RF(i, ub) SYSTEM_RCHK((LONGINT)(i),(LONGINT)(ub)) #define __RETCHK __retchk: __HALT(-3); return 0; #define __CASECHK __HALT(-4) diff --git a/src/tools/make/configure.c b/src/tools/make/configure.c index 312b3ca5..28530ece 100644 --- a/src/tools/make/configure.c +++ b/src/tools/make/configure.c @@ -212,7 +212,7 @@ void determineBuildDate() { struct {char ch; CHAR x;} c; struct {char ch; BOOLEAN x;} b; -struct {char ch; SHORTINT x;} si; +//struct {char ch; SHORTINT x;} si; struct {char ch; INTEGER x;} i; struct {char ch; LONGINT x;} li; struct {char ch; SET x;} s; @@ -246,7 +246,7 @@ void ReportSizesAndAlignments() { printf("Type Size Align\n"); printf("CHAR %4zd %4td\n", sizeof(CHAR), (char*)&c.x - (char*)&c); printf("BOOLEAN %4zd %4td\n", sizeof(BOOLEAN), (char*)&b.x - (char*)&b); - printf("SHORTINT %4zd %4td\n", sizeof(SHORTINT), (char*)&si.x - (char*)&si); +//printf("SHORTINT %4zd %4td\n", sizeof(SHORTINT), (char*)&si.x - (char*)&si); printf("INTEGER %4zd %4td\n", sizeof(INTEGER), (char*)&i.x - (char*)&i); printf("LONGINT %4zd %4td\n", sizeof(LONGINT), (char*)&li.x - (char*)&li); printf("SET %4zd %4td\n", sizeof(SET), (char*)&s.x - (char*)&s); @@ -326,7 +326,7 @@ void testSystemDotH() { assert(sizeof(CHAR) == 1, "Size of CHAR not 1."); assert(sizeof(BOOLEAN) == 1, "Size of BOOLEAN not 1."); - assert(sizeof(SHORTINT) == 1, "Size of SHORTINT not 1."); +//assert(sizeof(SHORTINT) == 1, "Size of SHORTINT not 1."); assert(sizeof(INTEGER) == 2 || sizeof(INTEGER) == 4, "Size of INTEGER neither 2 nor 4 bytes."); assert(sizeof(LONGINT) == 4 @@ -340,7 +340,7 @@ void testSystemDotH() { assert(((char*)&c.x - (char*)&c) == 1, "Alignment of CHAR not 1."); assert(((char*)&b.x - (char*)&b) == 1, "Alignment of BOOLEAN not 1."); - assert(((char*)&si.x - (char*)&si) == 1, "Alignment of SHORTINT not 1."); +//assert(((char*)&si.x - (char*)&si) == 1, "Alignment of SHORTINT not 1."); //assert(((char*)&i.x - (char*)&i) == 4, "Alignment of INTEGER not 4 bytes."); assert(((char*)&r.x - (char*)&r) == 4, "Alignment of REAL not 4 bytes."); assert(((char*)&lr.x - (char*)&lr) >= 4, "Alignment of LONGREAL less than 4 bytes."); From fdaa5ec81bfbdef469dc8355b9fd6a41fa5498a7 Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 1 Sep 2016 14:53:23 +0100 Subject: [PATCH 209/580] Fix outdated CARD32 type in PlatformWindows. --- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-88/Platform.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index b8a6b5a5..76fb4a1d 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -109,7 +109,7 @@ export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT #define Platform_ERRORWRITEPROTECT() ERROR_WRITE_PROTECT #define Platform_ETIMEDOUT() WSAETIMEDOUT extern void Heap_InitHeap(); -#define Platform_GetTickCount() (LONGINT)(SYSTEM_CARD32)GetTickCount() +#define Platform_GetTickCount() (LONGINT)(uint32)GetTickCount() #define Platform_HeapInitHeap() Heap_InitHeap() #define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((SYSTEM_ADRINT)h) #define Platform_SetQuitHandler(h) SystemSetQuitHandler((SYSTEM_ADRINT)h) diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 2724553b..2e9530e6 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -110,7 +110,7 @@ export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT #define Platform_ERRORWRITEPROTECT() ERROR_WRITE_PROTECT #define Platform_ETIMEDOUT() WSAETIMEDOUT extern void Heap_InitHeap(); -#define Platform_GetTickCount() (LONGINT)(SYSTEM_CARD32)GetTickCount() +#define Platform_GetTickCount() (LONGINT)(uint32)GetTickCount() #define Platform_HeapInitHeap() Heap_InitHeap() #define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((SYSTEM_ADRINT)h) #define Platform_SetQuitHandler(h) SystemSetQuitHandler((SYSTEM_ADRINT)h) From 11de6b8512385c05cdf9007f9ed55b437d648d7f Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 2 Sep 2016 13:02:44 +0100 Subject: [PATCH 210/580] uintptr for alloc/free, some sys fns from LONGINT to int64. --- bootstrap/unix-44/Configuration.c | 4 +- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Console.c | 2 +- bootstrap/unix-44/Console.h | 2 +- bootstrap/unix-44/Files.c | 2 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 4 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 13 ++- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 2 +- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 6 +- bootstrap/unix-44/OPT.h | 4 +- bootstrap/unix-44/OPV.c | 3 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Platform.c | 23 +++--- bootstrap/unix-44/Platform.h | 11 +-- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/SYSTEM.c | 31 +++---- bootstrap/unix-44/SYSTEM.h | 118 +++++++++++++++------------ bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/Vishap.c | 4 +- bootstrap/unix-44/errors.c | 2 +- bootstrap/unix-44/errors.h | 2 +- bootstrap/unix-44/extTools.c | 2 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-44/vt100.c | 2 +- bootstrap/unix-44/vt100.h | 2 +- bootstrap/unix-48/Configuration.c | 4 +- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Console.c | 2 +- bootstrap/unix-48/Console.h | 2 +- bootstrap/unix-48/Files.c | 2 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 4 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 13 ++- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 2 +- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 6 +- bootstrap/unix-48/OPT.h | 4 +- bootstrap/unix-48/OPV.c | 3 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Platform.c | 23 +++--- bootstrap/unix-48/Platform.h | 11 +-- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/SYSTEM.c | 31 +++---- bootstrap/unix-48/SYSTEM.h | 118 +++++++++++++++------------ bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/Vishap.c | 4 +- bootstrap/unix-48/errors.c | 2 +- bootstrap/unix-48/errors.h | 2 +- bootstrap/unix-48/extTools.c | 2 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-48/vt100.c | 2 +- bootstrap/unix-48/vt100.h | 2 +- bootstrap/unix-88/Configuration.c | 4 +- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Console.c | 2 +- bootstrap/unix-88/Console.h | 2 +- bootstrap/unix-88/Files.c | 2 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 4 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 13 ++- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 2 +- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 6 +- bootstrap/unix-88/OPT.h | 4 +- bootstrap/unix-88/OPV.c | 3 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Platform.c | 21 ++--- bootstrap/unix-88/Platform.h | 11 +-- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/SYSTEM.c | 31 +++---- bootstrap/unix-88/SYSTEM.h | 118 +++++++++++++++------------ bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/Vishap.c | 4 +- bootstrap/unix-88/errors.c | 2 +- bootstrap/unix-88/errors.h | 2 +- bootstrap/unix-88/extTools.c | 2 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/unix-88/vt100.c | 2 +- bootstrap/unix-88/vt100.h | 2 +- bootstrap/windows-48/Configuration.c | 4 +- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Console.c | 2 +- bootstrap/windows-48/Console.h | 2 +- bootstrap/windows-48/Files.c | 2 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 4 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 13 ++- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 2 +- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 6 +- bootstrap/windows-48/OPT.h | 4 +- bootstrap/windows-48/OPV.c | 3 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/SYSTEM.c | 31 +++---- bootstrap/windows-48/SYSTEM.h | 118 +++++++++++++++------------ bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/Vishap.c | 4 +- bootstrap/windows-48/errors.c | 2 +- bootstrap/windows-48/errors.h | 2 +- bootstrap/windows-48/extTools.c | 2 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-48/vt100.c | 2 +- bootstrap/windows-48/vt100.h | 2 +- bootstrap/windows-88/Configuration.c | 4 +- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Console.c | 2 +- bootstrap/windows-88/Console.h | 2 +- bootstrap/windows-88/Files.c | 2 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 4 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 13 ++- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 2 +- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 6 +- bootstrap/windows-88/OPT.h | 4 +- bootstrap/windows-88/OPV.c | 3 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Platform.c | 2 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/SYSTEM.c | 31 +++---- bootstrap/windows-88/SYSTEM.h | 118 +++++++++++++++------------ bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/Vishap.c | 4 +- bootstrap/windows-88/errors.c | 2 +- bootstrap/windows-88/errors.h | 2 +- bootstrap/windows-88/extTools.c | 2 +- bootstrap/windows-88/extTools.h | 2 +- bootstrap/windows-88/vt100.c | 2 +- bootstrap/windows-88/vt100.h | 2 +- makefile | 11 +++ src/compiler/OPC.Mod | 9 +- src/compiler/OPT.Mod | 17 ++-- src/compiler/OPV.Mod | 1 + src/compiler/Vishap.Mod | 2 +- src/system/Heap.Mod | 4 +- src/system/Platformunix.Mod | 12 +-- src/system/SYSTEM.c | 31 +++---- src/system/SYSTEM.h | 118 +++++++++++++++------------ 214 files changed, 850 insertions(+), 698 deletions(-) diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index fb7df026..194e9da8 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -13,6 +13,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/01] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/02] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index 61b33bc5..fbca10e0 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Console.c b/bootstrap/unix-44/Console.c index 8c9c6910..baf934fc 100644 --- a/bootstrap/unix-44/Console.c +++ b/bootstrap/unix-44/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Platform.h" diff --git a/bootstrap/unix-44/Console.h b/bootstrap/unix-44/Console.h index 16287a76..3823dacc 100644 --- a/bootstrap/unix-44/Console.h +++ b/bootstrap/unix-44/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 3c6594af..c971536e 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index d84672d4..f5c55397 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index a252264a..2315b64e 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tskSfF */ #include "SYSTEM.h" struct Heap__1 { @@ -100,7 +100,7 @@ export void Heap_Unlock (void); extern void *Heap__init(); extern LONGINT Platform_MainStackFrame; -extern LONGINT Platform_OSAllocate(LONGINT size); +extern uintptr Platform_OSAllocate(uintptr size); #define Heap_FetchAddress(pointer) (LONGINT)(SYSTEM_ADRINT)(*((void**)((SYSTEM_ADRINT)pointer))) #define Heap_HeapModuleInit() Heap__init() #define Heap_OSAllocate(size) Platform_OSAllocate(size) diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index a89f18fc..83733c20 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index 7969f68f..e7006b76 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Heap.h" diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index 8b271308..632138b5 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index bc74dd1d..fa8f98fe 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index a4ccc86e..8b2baa5f 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 08469d42..93d60530 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "OPM.h" @@ -200,8 +200,12 @@ void OPC_Ident (OPT_Object obj) } } } else if ((mode == 5 && obj->typ->form == 4)) { - OPM_WriteString((CHAR*)"int", 4); - OPM_WriteInt(__ASHL(obj->typ->size, 3)); + if (obj->typ == OPT_pinttyp || obj->typ == OPT_ainttyp) { + OPM_WriteString((CHAR*)"uintptr", 8); + } else { + OPM_WriteString((CHAR*)"int", 4); + OPM_WriteInt(__ASHL(obj->typ->size, 3)); + } } else { if (mode != 5 || obj->linkadr != 2) { if (mode == 13) { @@ -215,7 +219,7 @@ void OPC_Ident (OPT_Object obj) OPM_WriteStringVar((void*)OPM_modName, 32); } OPM_Write('_'); - } else if ((obj == OPT_sysptrtyp->strobj || obj == OPT_ainttyp->strobj) || obj == OPT_bytetyp->strobj) { + } else if (obj == OPT_sysptrtyp->strobj || obj == OPT_bytetyp->strobj) { OPM_WriteString((CHAR*)"SYSTEM_", 8); } OPM_WriteStringVar((void*)obj->name, 256); @@ -2080,6 +2084,7 @@ static void OPC_InitKeywords (void) Enter__49((CHAR*)"struct", 7); Enter__49((CHAR*)"switch", 7); Enter__49((CHAR*)"typedef", 8); + Enter__49((CHAR*)"uintptr", 8); Enter__49((CHAR*)"uint16", 7); Enter__49((CHAR*)"uint32", 7); Enter__49((CHAR*)"uint64", 7); diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index 05c34fcc..78a60ed9 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 8bf863b3..19ad29af 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index 36eb4165..44fe5275 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index a366ef24..b0cd8613 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPB.h" #include "OPM.h" diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index 8bed9493..423013a4 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index 2b29372f..36b37592 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index e40119f7..dec9c209 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index 7fbad791..16dfc5b1 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" @@ -83,7 +83,7 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; -export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_pinttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; export int8 OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; @@ -1767,6 +1767,7 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_sinttyp); P(OPT_inttyp); P(OPT_linttyp); + P(OPT_pinttyp); P(OPT_ainttyp); P(OPT_int8typ); P(OPT_int16typ); @@ -1849,6 +1850,7 @@ export void *OPT__init(void) OPT_InitStruct(&OPT_niltyp, 9); OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp); OPT_EnterTyp((CHAR*)"PTR", 11, OPM_PointerSize, &OPT_sysptrtyp); + OPT_EnterTyp((CHAR*)"UINTPTR", 4, OPM_PointerSize, &OPT_pinttyp); OPT_EnterTyp((CHAR*)"ADRINT", 4, OPM_PointerSize, &OPT_ainttyp); OPT_EnterTyp((CHAR*)"INT8", 4, 1, &OPT_int8typ); OPT_EnterTyp((CHAR*)"INT16", 4, 2, &OPT_int16typ); diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index 480267cc..c290d3de 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h @@ -67,7 +67,7 @@ typedef import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; -import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_pinttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; import int8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index 5ef539df..aeef6224 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPC.h" #include "OPM.h" @@ -285,6 +285,7 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_realtyp->strobj->linkadr = 2; OPT_inttyp->strobj->linkadr = 2; OPT_linttyp->strobj->linkadr = 2; + OPT_pinttyp->strobj->linkadr = 2; OPT_ainttyp->strobj->linkadr = 2; OPT_int8typ->strobj->linkadr = 2; OPT_int16typ->strobj->linkadr = 2; diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index 06bc39f1..8fd772f8 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index c247eb06..f8dc8de8 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef @@ -26,11 +26,12 @@ typedef export BOOLEAN Platform_LittleEndian; -export int32 Platform_MainStackFrame, Platform_HaltCode; +export uintptr Platform_MainStackFrame; +export int32 Platform_HaltCode; export int16 Platform_PID; export CHAR Platform_CWD[256]; export int16 Platform_ArgCount; -export int32 Platform_ArgVector; +export uintptr Platform_ArgVector; static Platform_HaltProcedure Platform_HaltHandler; static int32 Platform_TimeStart; export int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; @@ -62,8 +63,8 @@ export void Platform_Init (int16 argc, int32 argvadr); export void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); export int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); export BOOLEAN Platform_NoSuchDirectory (int16 e); -export int32 Platform_OSAllocate (int32 size); -export void Platform_OSFree (int32 address); +export uintptr Platform_OSAllocate (uintptr size); +export void Platform_OSFree (uintptr address); export int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); export int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); export int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n); @@ -118,14 +119,14 @@ export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT #define Platform_EXDEV() EXDEV extern void Heap_InitHeap(); #define Platform_HeapInitHeap() Heap_InitHeap() -#define Platform_allocate(size) (LONGINT)(SYSTEM_ADRINT)((void*)malloc((size_t)size)) +#define Platform_allocate(size) (uintptr)((void*)malloc((size_t)size)) #define Platform_chdir(n, n__len) chdir((char*)n) #define Platform_closefile(fd) close(fd) #define Platform_err() errno #define Platform_errc(c) write(1, &c, 1) #define Platform_errstring(s, s__len) write(1, s, s__len-1) #define Platform_exit(code) exit(code) -#define Platform_free(address) free((void*)(SYSTEM_ADRINT)address) +#define Platform_free(address) free((void*)address) #define Platform_fstat(fd) fstat(fd, &s) #define Platform_fsync(fd) fsync(fd) #define Platform_ftruncate(fd, l) ftruncate(fd, l) @@ -212,14 +213,14 @@ BOOLEAN Platform_ConnectionFailed (int16 e) return _o_result; } -int32 Platform_OSAllocate (int32 size) +uintptr Platform_OSAllocate (uintptr size) { - int32 _o_result; + uintptr _o_result; _o_result = Platform_allocate(size); return _o_result; } -void Platform_OSFree (int32 address) +void Platform_OSFree (uintptr address) { Platform_free(address); } @@ -262,7 +263,7 @@ void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { - av = (Platform_ArgVec)(SYSTEM_ADRINT)Platform_ArgVector; + av = __VAL(Platform_ArgVec, Platform_ArgVector); __COPY(*(*av)[__X(n, 1024)], val, val__len); } } diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index 129004fd..a4c001f3 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h @@ -18,11 +18,12 @@ typedef import BOOLEAN Platform_LittleEndian; -import int32 Platform_MainStackFrame, Platform_HaltCode; +import uintptr Platform_MainStackFrame; +import int32 Platform_HaltCode; import int16 Platform_PID; import CHAR Platform_CWD[256]; import int16 Platform_ArgCount; -import int32 Platform_ArgVector; +import uintptr Platform_ArgVector; import int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; import CHAR Platform_nl[3]; @@ -51,8 +52,8 @@ import void Platform_Init (int16 argc, int32 argvadr); import void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); import int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); import BOOLEAN Platform_NoSuchDirectory (int16 e); -import int32 Platform_OSAllocate (int32 size); -import void Platform_OSFree (int32 address); +import uintptr Platform_OSAllocate (uintptr size); +import void Platform_OSFree (uintptr address); import int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); import int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); import int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n); diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 4b500170..4e271371 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index a1191c0b..b1e62271 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/SYSTEM.c b/bootstrap/unix-44/SYSTEM.c index 9bc6b756..16681ab8 100644 --- a/bootstrap/unix-44/SYSTEM.c +++ b/bootstrap/unix-44/SYSTEM.c @@ -18,8 +18,11 @@ #include -LONGINT SYSTEM_XCHK(LONGINT i, LONGINT ub) {return __X(i, ub);} -LONGINT SYSTEM_RCHK(LONGINT i, LONGINT ub) {return __R(i, ub);} +// Procedure verions of SYSTEM.H versions used when a multiply accessed +// parameter has side effects. + +int64 SYSTEM_XCHK(uint64 i, uint64 ub) {return __X(i, ub);} +int64 SYSTEM_RCHK(uint64 i, uint64 ub) {return __R(i, ub);} LONGINT SYSTEM_ASH (LONGINT i, LONGINT n) {return __ASH(i, n);} LONGINT SYSTEM_ABS (LONGINT i) {return __ABS(i);} double SYSTEM_ABSD(double i) {return __ABS(i);} @@ -35,7 +38,7 @@ void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0) void SYSTEM_ENUMP(void *adr, LONGINT n, void (*P)()) { while (n > 0) { - P((LONGINT)(SYSTEM_ADRINT)(*((void**)(adr)))); + P((uintptr)(*((void**)(adr)))); adr = ((void**)adr) + 1; n--; } @@ -48,20 +51,20 @@ void SYSTEM_ENUMR(void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()) while (n > 0) { t = typ; off = *t; - while (off >= 0) {P(*(LONGINT*)((char*)adr+off)); t++; off = *t;} + while (off >= 0) {P(*(uintptr*)((char*)adr+off)); t++; off = *t;} adr = ((char*)adr) + size; n--; } } -LONGINT SYSTEM_DIV(uLONGINT x, uLONGINT y) -{ if ((LONGINT) x >= 0) return (x / y); +LONGINT SYSTEM_DIV(uint64 x, uint64 y) +{ if ((int64) x >= 0) return (x / y); else return -((y - 1 - x) / y); } -LONGINT SYSTEM_MOD(uLONGINT x, uLONGINT y) -{ uLONGINT m; - if ((LONGINT) x >= 0) return (x % y); +LONGINT SYSTEM_MOD(uint64 x, uint64 y) +{ uint64 m; + if ((int64) x >= 0) return (x % y); else { m = (-x) % y; if (m != 0) return (y - m); else return 0; } @@ -106,7 +109,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, else if (typ == (LONGINT*)POINTER__typ) { /* element type is a pointer */ x = Heap_NEWBLK(size + nofelems * sizeof(LONGINT)); - p = (LONGINT*)(SYSTEM_ADRINT)x[-1]; + p = (LONGINT*)(uintptr)x[-1]; p[-nofelems] = *p; /* build new type desc in situ: 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nofelems - 1; n = 1; /* n =1 for skipping the size field */ while (n <= nofelems) {*p = n*sizeof(LONGINT); p++; n++;} @@ -119,7 +122,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, while (ptab[nofptrs] >= 0) {nofptrs++;} /* number of pointers per element */ nptr = nofelems * nofptrs; /* total number of pointers */ x = Heap_NEWBLK(size + nptr * sizeof(LONGINT)); - p = (LONGINT*)(SYSTEM_ADRINT)x[- 1]; + p = (LONGINT*)(uintptr)x[- 1]; p[-nptr] = *p; /* build new type desc in situ; 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nptr - 1; n = 0; off = dataoff; while (n < nofelems) {i = 0; @@ -155,7 +158,7 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler // (Ignore other signals) } - void SystemSetHandler(int s, SYSTEM_ADRINT h) { + void SystemSetHandler(int s, uintptr h) { if (s >= 2 && s <= 4) { int needtosetsystemhandler = handler[s-2] == 0; handler[s-2] = (SystemSignalHandler)h; @@ -194,12 +197,12 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler } } - void SystemSetInterruptHandler(SYSTEM_ADRINT h) { + void SystemSetInterruptHandler(uintptr h) { EnsureConsoleCtrlHandler(); SystemInterruptHandler = (SystemSignalHandler)h; } - void SystemSetQuitHandler(SYSTEM_ADRINT h) { + void SystemSetQuitHandler(uintptr h) { EnsureConsoleCtrlHandler(); SystemQuitHandler = (SystemSignalHandler)h; } diff --git a/bootstrap/unix-44/SYSTEM.h b/bootstrap/unix-44/SYSTEM.h index 2cab2429..c83f69f1 100644 --- a/bootstrap/unix-44/SYSTEM.h +++ b/bootstrap/unix-44/SYSTEM.h @@ -1,6 +1,27 @@ #ifndef SYSTEM__h #define SYSTEM__h +// Declare memcpy in a way compatible with C compilers intrinsic +// built in implementations. + +#if (__SIZEOF_POINTER__ == 8) || defined(_WIN64) || defined(__LP64__) + #if defined(_WIN64) + typedef unsigned long long size_t; + #else + typedef unsigned long size_t; + #endif +#else + typedef unsigned int size_t; +#endif + +#define _SIZE_T_DECLARED // For FreeBSD +#define _SIZE_T_DEFINED_ // For OpenBSD + +void *memcpy(void *dest, const void *source, size_t size); + + +// Declare fixed size versions of basic intger types + #if defined(_WIN64) typedef long long int64; typedef unsigned long long uint64; @@ -18,20 +39,7 @@ typedef unsigned short int uint16; typedef signed char int8; typedef unsigned char uint8; -#if (__SIZEOF_POINTER__ == 8) || defined(_WIN64) || defined(__LP64__) - #if defined(_WIN64) - typedef unsigned long long size_t; - #else - typedef unsigned long size_t; - #endif -#else - typedef unsigned int size_t; -#endif - -#define _SIZE_T_DECLARED // For FreeBSD -#define _SIZE_T_DEFINED_ // For OpenBSD - -void *memcpy(void *dest, const void *source, size_t size); +#define uintptr size_t // The compiler uses 'import' and 'export' which translate to 'extern' and @@ -46,7 +54,7 @@ void *memcpy(void *dest, const void *source, size_t size); #define NIL ((void*)0) #define __MAXEXT 16 -#define POINTER__typ ((LONGINT*)(1)) // not NIL and not a valid type +#define POINTER__typ ((uintptr*)(1)) // not NIL and not a valid type // Oberon types @@ -60,7 +68,7 @@ typedef float REAL; typedef double LONGREAL; typedef void* SYSTEM_PTR; -typedef size_t SYSTEM_ADRINT; +typedef uintptr SYSTEM_ADRINT; // For 32 bit builds, the size of LONGINT depends on a make option: @@ -68,18 +76,19 @@ typedef size_t SYSTEM_ADRINT; #if (__SIZEOF_POINTER__ == 8) || defined(LARGE) || defined(_WIN64) typedef int32 INTEGER; typedef int64 LONGINT; - typedef uint64 uLONGINT; + typedef uint64 SET; + typedef uint64 uSET; #else typedef int16 INTEGER; typedef int32 LONGINT; - typedef uint32 uLONGINT; + typedef uint32 SET; + typedef uint32 uSET; #endif -// Unsigned variants are for use by shift and rotate macros. -typedef uLONGINT SET; -typedef uLONGINT uSET; +// Temporary defs while bootstrapping +#define uLONGINT uint64 @@ -90,32 +99,32 @@ typedef uLONGINT uSET; // OS Memory allocation interfaces are in PlatformXXX.Mod -extern LONGINT Platform_OSAllocate (LONGINT size); -extern void Platform_OSFree (LONGINT addr); +extern uintptr Platform_OSAllocate (uintptr size); +extern void Platform_OSFree (uintptr addr); // Run time system routines in SYSTEM.c -extern LONGINT SYSTEM_XCHK (LONGINT i, LONGINT ub); -extern LONGINT SYSTEM_RCHK (LONGINT i, LONGINT ub); +extern int64 SYSTEM_XCHK (uint64 i, uint64 ub); +extern int64 SYSTEM_RCHK (uint64 i, uint64 ub); extern LONGINT SYSTEM_ASH (LONGINT i, LONGINT n); extern LONGINT SYSTEM_ABS (LONGINT i); extern double SYSTEM_ABSD (double i); extern void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0); extern void SYSTEM_ENUMP (void *adr, LONGINT n, void (*P)()); extern void SYSTEM_ENUMR (void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()); -extern LONGINT SYSTEM_DIV (uLONGINT x, uLONGINT y); -extern LONGINT SYSTEM_MOD (uLONGINT x, uLONGINT y); +extern LONGINT SYSTEM_DIV (uint64 x, uint64 y); +extern LONGINT SYSTEM_MOD (uint64 x, uint64 y); extern LONGINT SYSTEM_ENTIER (double x); // Signal handling in SYSTEM.c #ifndef _WIN32 - extern void SystemSetHandler(int s, SYSTEM_ADRINT h); + extern void SystemSetHandler(int s, uintptr h); #else - extern void SystemSetInterruptHandler(SYSTEM_ADRINT h); - extern void SystemSetQuitHandler (SYSTEM_ADRINT h); + extern void SystemSetInterruptHandler(uintptr h); + extern void SystemSetQuitHandler (uintptr h); #endif @@ -138,11 +147,18 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __COPY(s, d, n) {char*_a=(void*)s,*_b=(void*)d; LONGINT _i=0,_t=n-1; \ while(_i<_t&&((_b[_i]=_a[_i])!=0)){_i++;};_b[_i]=0;} -#define __DUP(x, l, t) x=(void*)memcpy((void*)(SYSTEM_ADRINT)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) +#define __DUP(x, l, t) x=(void*)memcpy((void*)(uintptr)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) #define __DUPARR(v, t) v=(void*)memcpy(v##__copy,v,sizeof(t)) -#define __DEL(x) Platform_OSFree((LONGINT)(SYSTEM_ADRINT)x) +#define __DEL(x) Platform_OSFree((LONGINT)(uintptr)x) +// Index and range checks + +#define __X(i, ub) (((uint64)(i)<(uint64)(ub))?i:(__HALT(-2),0)) +#define __XF(i, ub) SYSTEM_XCHK((uint64)(i), (uint64)(ub)) + +#define __R(i, ub) (((uint64)(i)<(uint64)(ub))?i:(__HALT(-8),0)) +#define __RF(i, ub) SYSTEM_RCHK((uint64)(i),(uint64)(ub)) /* SYSTEM ops */ @@ -150,24 +166,24 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __VAL(t, x) (*(t*)&(x)) -#define __GET(a, x, t) x= *(t*)(SYSTEM_ADRINT)(a) -#define __PUT(a, x, t) *(t*)(SYSTEM_ADRINT)(a)=x +#define __GET(a, x, t) x= *(t*)(uintptr)(a) +#define __PUT(a, x, t) *(t*)(uintptr)(a)=x #define __LSHL(x, n, t) ((t)((u##t)(x)<<(n))) #define __LSHR(x, n, t) ((t)((u##t)(x)>>(n))) #define __LSH(x, n, t) ((n)>=0? __LSHL(x, n, t): __LSHR(x, -(n), t)) -#define __ASHL(x, n) ((LONGINT)(x)<<(n)) -#define __ASHR(x, n) ((LONGINT)(x)>>(n)) -#define __ASH(x, n) ((n)>=0?__ASHL(x,n):__ASHR(x,-(n))) - #define __ROTL(x, n, t) ((t)((u##t)(x)<<(n)|(u##t)(x)>>(8*sizeof(t)-(n)))) #define __ROTR(x, n, t) ((t)((u##t)(x)>>(n)|(u##t)(x)<<(8*sizeof(t)-(n)))) #define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) -#define __BIT(x, n) (*(uLONGINT*)(x)>>(n)&1) -#define __MOVE(s, d, n) memcpy((char*)(SYSTEM_ADRINT)(d),(char*)(SYSTEM_ADRINT)(s),n) +#define __ASHL(x, n) ((LONGINT)(x)<<(n)) +#define __ASHR(x, n) ((LONGINT)(x)>>(n)) +#define __ASH(x, n) ((n)>=0?__ASHL(x,n):__ASHR(x,-(n))) #define __ASHF(x, n) SYSTEM_ASH((LONGINT)(x), (LONGINT)(n)) + +#define __BIT(x, n) (*(uint64*)(x)>>(n)&1) +#define __MOVE(s, d, n) memcpy((char*)(uintptr)(d),(char*)(uintptr)(s),n) #define __SHORT(x, y) ((int)((uLONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) #define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) #define __CHR(x) ((CHAR)__R(x, 256)) @@ -191,10 +207,6 @@ static int __str_cmp(CHAR *x, CHAR *y){ // Runtime checks -#define __X(i, ub) (((uLONGINT)(i)<(uLONGINT)(ub))?i:(__HALT(-2),0)) -#define __XF(i, ub) SYSTEM_XCHK((LONGINT)(i), (LONGINT)(ub)) -#define __R(i, ub) (((uLONGINT)(i)<(uLONGINT)(ub))?i:(__HALT(-8),0)) -#define __RF(i, ub) SYSTEM_RCHK((LONGINT)(i),(LONGINT)(ub)) #define __RETCHK __retchk: __HALT(-3); return 0; #define __CASECHK __HALT(-4) #define __WITHCHK __HALT(-7) @@ -227,7 +239,7 @@ extern void Heap_INCREF(); extern void Platform_Init(INTEGER argc, LONGINT argv); extern void Heap_FINALL(); -#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (LONGINT)(SYSTEM_ADRINT)&argv); +#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (LONGINT)(uintptr)&argv); #define __REGMAIN(name, enum) m = Heap_REGMOD((CHAR*)name,enum) #define __FINI Heap_FINALL(); return 0 @@ -248,7 +260,7 @@ extern SYSTEM_PTR Heap_NEWREC (LONGINT tag); extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __SYSNEW(p, len) p = Heap_NEWBLK((LONGINT)(len)) -#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(SYSTEM_ADRINT)t##__typ) +#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(uintptr)t##__typ) #define __NEWARR SYSTEM_NEWARR @@ -279,20 +291,20 @@ extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __INITYP(t, t0, level) \ t##__typ = (LONGINT*)&t##__desc.blksz; \ memcpy(t##__desc.basep, t0##__typ - __BASEOFF, level*sizeof(LONGINT)); \ - t##__desc.basep[level] = (LONGINT)(SYSTEM_ADRINT)t##__typ; \ - t##__desc.module = (LONGINT)(SYSTEM_ADRINT)m; \ + t##__desc.basep[level] = (LONGINT)(uintptr)t##__typ; \ + t##__desc.module = (LONGINT)(uintptr)m; \ if(t##__desc.blksz!=sizeof(struct t)) __HALT(-15); \ t##__desc.blksz = (t##__desc.blksz+5*sizeof(LONGINT)-1)/(4*sizeof(LONGINT))*(4*sizeof(LONGINT)); \ - Heap_REGTYP(m, (LONGINT)(SYSTEM_ADRINT)&t##__desc.next); \ + Heap_REGTYP(m, (LONGINT)(uintptr)&t##__desc.next); \ SYSTEM_INHERIT(t##__typ, t0##__typ) -#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(SYSTEM_ADRINT)typ##__typ) -#define __TYPEOF(p) ((LONGINT*)(SYSTEM_ADRINT)(*(((LONGINT*)(p))-1))) +#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(uintptr)typ##__typ) +#define __TYPEOF(p) ((LONGINT*)(uintptr)(*(((LONGINT*)(p))-1))) #define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) // Oberon-2 type bound procedures support -#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(SYSTEM_ADRINT)proc -#define __SEND(typ, num, funtyp, parlist) ((funtyp)((SYSTEM_ADRINT)*(typ-(__TPROC0OFF+num))))parlist +#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(uintptr)proc +#define __SEND(typ, num, funtyp, parlist) ((funtyp)((uintptr)*(typ-(__TPROC0OFF+num))))parlist diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index 6463db16..439a49e9 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index 07051628..681fcf1c 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index a736989a..4692859f 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Files.h" #include "Modules.h" diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index bba6eb24..e78a2d49 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/Vishap.c b/bootstrap/unix-44/Vishap.c index c8f81032..9224220a 100644 --- a/bootstrap/unix-44/Vishap.c +++ b/bootstrap/unix-44/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkamSf */ #include "SYSTEM.h" #include "Configuration.h" #include "Heap.h" @@ -81,7 +81,7 @@ static void Vishap_PropagateElementaryTypeSizes (void) OPT_realtyp->size = OPM_RealSize; OPT_inttyp->size = OPM_IntSize; OPT_linttyp->size = OPM_LIntSize; - OPT_ainttyp->size = OPM_PointerSize; + OPT_pinttyp->size = OPM_PointerSize; OPT_lrltyp->size = OPM_LRealSize; OPT_sinttyp->size = OPM_SIntSize; OPT_booltyp->size = OPM_BoolSize; diff --git a/bootstrap/unix-44/errors.c b/bootstrap/unix-44/errors.c index 3f916fe9..6e4f20e5 100644 --- a/bootstrap/unix-44/errors.c +++ b/bootstrap/unix-44/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/unix-44/errors.h b/bootstrap/unix-44/errors.h index 2afac320..f06c706d 100644 --- a/bootstrap/unix-44/errors.h +++ b/bootstrap/unix-44/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index b894b3f9..00be6a22 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index ca635519..9d9202c0 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-44/vt100.c b/bootstrap/unix-44/vt100.c index 46a1e460..8ca75a42 100644 --- a/bootstrap/unix-44/vt100.c +++ b/bootstrap/unix-44/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Strings.h" diff --git a/bootstrap/unix-44/vt100.h b/bootstrap/unix-44/vt100.h index ad1ac948..901eed38 100644 --- a/bootstrap/unix-44/vt100.h +++ b/bootstrap/unix-44/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index fb7df026..194e9da8 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -13,6 +13,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/01] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/02] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index 61b33bc5..fbca10e0 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Console.c b/bootstrap/unix-48/Console.c index 8c9c6910..baf934fc 100644 --- a/bootstrap/unix-48/Console.c +++ b/bootstrap/unix-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Platform.h" diff --git a/bootstrap/unix-48/Console.h b/bootstrap/unix-48/Console.h index 16287a76..3823dacc 100644 --- a/bootstrap/unix-48/Console.h +++ b/bootstrap/unix-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 3c6594af..c971536e 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index d84672d4..f5c55397 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index a252264a..2315b64e 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tskSfF */ #include "SYSTEM.h" struct Heap__1 { @@ -100,7 +100,7 @@ export void Heap_Unlock (void); extern void *Heap__init(); extern LONGINT Platform_MainStackFrame; -extern LONGINT Platform_OSAllocate(LONGINT size); +extern uintptr Platform_OSAllocate(uintptr size); #define Heap_FetchAddress(pointer) (LONGINT)(SYSTEM_ADRINT)(*((void**)((SYSTEM_ADRINT)pointer))) #define Heap_HeapModuleInit() Heap__init() #define Heap_OSAllocate(size) Platform_OSAllocate(size) diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index a89f18fc..83733c20 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index 7969f68f..e7006b76 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Heap.h" diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index 8b271308..632138b5 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index bc74dd1d..fa8f98fe 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index a4ccc86e..8b2baa5f 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 08469d42..93d60530 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "OPM.h" @@ -200,8 +200,12 @@ void OPC_Ident (OPT_Object obj) } } } else if ((mode == 5 && obj->typ->form == 4)) { - OPM_WriteString((CHAR*)"int", 4); - OPM_WriteInt(__ASHL(obj->typ->size, 3)); + if (obj->typ == OPT_pinttyp || obj->typ == OPT_ainttyp) { + OPM_WriteString((CHAR*)"uintptr", 8); + } else { + OPM_WriteString((CHAR*)"int", 4); + OPM_WriteInt(__ASHL(obj->typ->size, 3)); + } } else { if (mode != 5 || obj->linkadr != 2) { if (mode == 13) { @@ -215,7 +219,7 @@ void OPC_Ident (OPT_Object obj) OPM_WriteStringVar((void*)OPM_modName, 32); } OPM_Write('_'); - } else if ((obj == OPT_sysptrtyp->strobj || obj == OPT_ainttyp->strobj) || obj == OPT_bytetyp->strobj) { + } else if (obj == OPT_sysptrtyp->strobj || obj == OPT_bytetyp->strobj) { OPM_WriteString((CHAR*)"SYSTEM_", 8); } OPM_WriteStringVar((void*)obj->name, 256); @@ -2080,6 +2084,7 @@ static void OPC_InitKeywords (void) Enter__49((CHAR*)"struct", 7); Enter__49((CHAR*)"switch", 7); Enter__49((CHAR*)"typedef", 8); + Enter__49((CHAR*)"uintptr", 8); Enter__49((CHAR*)"uint16", 7); Enter__49((CHAR*)"uint32", 7); Enter__49((CHAR*)"uint64", 7); diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index 05c34fcc..78a60ed9 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 8bf863b3..19ad29af 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index 36eb4165..44fe5275 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index a366ef24..b0cd8613 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPB.h" #include "OPM.h" diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index 8bed9493..423013a4 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index 2b29372f..36b37592 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index e40119f7..dec9c209 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 7fbad791..16dfc5b1 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" @@ -83,7 +83,7 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; -export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_pinttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; export int8 OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; @@ -1767,6 +1767,7 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_sinttyp); P(OPT_inttyp); P(OPT_linttyp); + P(OPT_pinttyp); P(OPT_ainttyp); P(OPT_int8typ); P(OPT_int16typ); @@ -1849,6 +1850,7 @@ export void *OPT__init(void) OPT_InitStruct(&OPT_niltyp, 9); OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp); OPT_EnterTyp((CHAR*)"PTR", 11, OPM_PointerSize, &OPT_sysptrtyp); + OPT_EnterTyp((CHAR*)"UINTPTR", 4, OPM_PointerSize, &OPT_pinttyp); OPT_EnterTyp((CHAR*)"ADRINT", 4, OPM_PointerSize, &OPT_ainttyp); OPT_EnterTyp((CHAR*)"INT8", 4, 1, &OPT_int8typ); OPT_EnterTyp((CHAR*)"INT16", 4, 2, &OPT_int16typ); diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index 480267cc..c290d3de 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h @@ -67,7 +67,7 @@ typedef import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; -import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_pinttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; import int8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index 5ef539df..aeef6224 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPC.h" #include "OPM.h" @@ -285,6 +285,7 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_realtyp->strobj->linkadr = 2; OPT_inttyp->strobj->linkadr = 2; OPT_linttyp->strobj->linkadr = 2; + OPT_pinttyp->strobj->linkadr = 2; OPT_ainttyp->strobj->linkadr = 2; OPT_int8typ->strobj->linkadr = 2; OPT_int16typ->strobj->linkadr = 2; diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index 06bc39f1..8fd772f8 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index c247eb06..f8dc8de8 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef @@ -26,11 +26,12 @@ typedef export BOOLEAN Platform_LittleEndian; -export int32 Platform_MainStackFrame, Platform_HaltCode; +export uintptr Platform_MainStackFrame; +export int32 Platform_HaltCode; export int16 Platform_PID; export CHAR Platform_CWD[256]; export int16 Platform_ArgCount; -export int32 Platform_ArgVector; +export uintptr Platform_ArgVector; static Platform_HaltProcedure Platform_HaltHandler; static int32 Platform_TimeStart; export int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; @@ -62,8 +63,8 @@ export void Platform_Init (int16 argc, int32 argvadr); export void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); export int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); export BOOLEAN Platform_NoSuchDirectory (int16 e); -export int32 Platform_OSAllocate (int32 size); -export void Platform_OSFree (int32 address); +export uintptr Platform_OSAllocate (uintptr size); +export void Platform_OSFree (uintptr address); export int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); export int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); export int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n); @@ -118,14 +119,14 @@ export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT #define Platform_EXDEV() EXDEV extern void Heap_InitHeap(); #define Platform_HeapInitHeap() Heap_InitHeap() -#define Platform_allocate(size) (LONGINT)(SYSTEM_ADRINT)((void*)malloc((size_t)size)) +#define Platform_allocate(size) (uintptr)((void*)malloc((size_t)size)) #define Platform_chdir(n, n__len) chdir((char*)n) #define Platform_closefile(fd) close(fd) #define Platform_err() errno #define Platform_errc(c) write(1, &c, 1) #define Platform_errstring(s, s__len) write(1, s, s__len-1) #define Platform_exit(code) exit(code) -#define Platform_free(address) free((void*)(SYSTEM_ADRINT)address) +#define Platform_free(address) free((void*)address) #define Platform_fstat(fd) fstat(fd, &s) #define Platform_fsync(fd) fsync(fd) #define Platform_ftruncate(fd, l) ftruncate(fd, l) @@ -212,14 +213,14 @@ BOOLEAN Platform_ConnectionFailed (int16 e) return _o_result; } -int32 Platform_OSAllocate (int32 size) +uintptr Platform_OSAllocate (uintptr size) { - int32 _o_result; + uintptr _o_result; _o_result = Platform_allocate(size); return _o_result; } -void Platform_OSFree (int32 address) +void Platform_OSFree (uintptr address) { Platform_free(address); } @@ -262,7 +263,7 @@ void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { - av = (Platform_ArgVec)(SYSTEM_ADRINT)Platform_ArgVector; + av = __VAL(Platform_ArgVec, Platform_ArgVector); __COPY(*(*av)[__X(n, 1024)], val, val__len); } } diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index 129004fd..a4c001f3 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h @@ -18,11 +18,12 @@ typedef import BOOLEAN Platform_LittleEndian; -import int32 Platform_MainStackFrame, Platform_HaltCode; +import uintptr Platform_MainStackFrame; +import int32 Platform_HaltCode; import int16 Platform_PID; import CHAR Platform_CWD[256]; import int16 Platform_ArgCount; -import int32 Platform_ArgVector; +import uintptr Platform_ArgVector; import int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; import CHAR Platform_nl[3]; @@ -51,8 +52,8 @@ import void Platform_Init (int16 argc, int32 argvadr); import void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); import int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); import BOOLEAN Platform_NoSuchDirectory (int16 e); -import int32 Platform_OSAllocate (int32 size); -import void Platform_OSFree (int32 address); +import uintptr Platform_OSAllocate (uintptr size); +import void Platform_OSFree (uintptr address); import int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); import int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); import int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n); diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 4b500170..4e271371 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index a1191c0b..b1e62271 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/SYSTEM.c b/bootstrap/unix-48/SYSTEM.c index 9bc6b756..16681ab8 100644 --- a/bootstrap/unix-48/SYSTEM.c +++ b/bootstrap/unix-48/SYSTEM.c @@ -18,8 +18,11 @@ #include -LONGINT SYSTEM_XCHK(LONGINT i, LONGINT ub) {return __X(i, ub);} -LONGINT SYSTEM_RCHK(LONGINT i, LONGINT ub) {return __R(i, ub);} +// Procedure verions of SYSTEM.H versions used when a multiply accessed +// parameter has side effects. + +int64 SYSTEM_XCHK(uint64 i, uint64 ub) {return __X(i, ub);} +int64 SYSTEM_RCHK(uint64 i, uint64 ub) {return __R(i, ub);} LONGINT SYSTEM_ASH (LONGINT i, LONGINT n) {return __ASH(i, n);} LONGINT SYSTEM_ABS (LONGINT i) {return __ABS(i);} double SYSTEM_ABSD(double i) {return __ABS(i);} @@ -35,7 +38,7 @@ void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0) void SYSTEM_ENUMP(void *adr, LONGINT n, void (*P)()) { while (n > 0) { - P((LONGINT)(SYSTEM_ADRINT)(*((void**)(adr)))); + P((uintptr)(*((void**)(adr)))); adr = ((void**)adr) + 1; n--; } @@ -48,20 +51,20 @@ void SYSTEM_ENUMR(void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()) while (n > 0) { t = typ; off = *t; - while (off >= 0) {P(*(LONGINT*)((char*)adr+off)); t++; off = *t;} + while (off >= 0) {P(*(uintptr*)((char*)adr+off)); t++; off = *t;} adr = ((char*)adr) + size; n--; } } -LONGINT SYSTEM_DIV(uLONGINT x, uLONGINT y) -{ if ((LONGINT) x >= 0) return (x / y); +LONGINT SYSTEM_DIV(uint64 x, uint64 y) +{ if ((int64) x >= 0) return (x / y); else return -((y - 1 - x) / y); } -LONGINT SYSTEM_MOD(uLONGINT x, uLONGINT y) -{ uLONGINT m; - if ((LONGINT) x >= 0) return (x % y); +LONGINT SYSTEM_MOD(uint64 x, uint64 y) +{ uint64 m; + if ((int64) x >= 0) return (x % y); else { m = (-x) % y; if (m != 0) return (y - m); else return 0; } @@ -106,7 +109,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, else if (typ == (LONGINT*)POINTER__typ) { /* element type is a pointer */ x = Heap_NEWBLK(size + nofelems * sizeof(LONGINT)); - p = (LONGINT*)(SYSTEM_ADRINT)x[-1]; + p = (LONGINT*)(uintptr)x[-1]; p[-nofelems] = *p; /* build new type desc in situ: 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nofelems - 1; n = 1; /* n =1 for skipping the size field */ while (n <= nofelems) {*p = n*sizeof(LONGINT); p++; n++;} @@ -119,7 +122,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, while (ptab[nofptrs] >= 0) {nofptrs++;} /* number of pointers per element */ nptr = nofelems * nofptrs; /* total number of pointers */ x = Heap_NEWBLK(size + nptr * sizeof(LONGINT)); - p = (LONGINT*)(SYSTEM_ADRINT)x[- 1]; + p = (LONGINT*)(uintptr)x[- 1]; p[-nptr] = *p; /* build new type desc in situ; 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nptr - 1; n = 0; off = dataoff; while (n < nofelems) {i = 0; @@ -155,7 +158,7 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler // (Ignore other signals) } - void SystemSetHandler(int s, SYSTEM_ADRINT h) { + void SystemSetHandler(int s, uintptr h) { if (s >= 2 && s <= 4) { int needtosetsystemhandler = handler[s-2] == 0; handler[s-2] = (SystemSignalHandler)h; @@ -194,12 +197,12 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler } } - void SystemSetInterruptHandler(SYSTEM_ADRINT h) { + void SystemSetInterruptHandler(uintptr h) { EnsureConsoleCtrlHandler(); SystemInterruptHandler = (SystemSignalHandler)h; } - void SystemSetQuitHandler(SYSTEM_ADRINT h) { + void SystemSetQuitHandler(uintptr h) { EnsureConsoleCtrlHandler(); SystemQuitHandler = (SystemSignalHandler)h; } diff --git a/bootstrap/unix-48/SYSTEM.h b/bootstrap/unix-48/SYSTEM.h index 2cab2429..c83f69f1 100644 --- a/bootstrap/unix-48/SYSTEM.h +++ b/bootstrap/unix-48/SYSTEM.h @@ -1,6 +1,27 @@ #ifndef SYSTEM__h #define SYSTEM__h +// Declare memcpy in a way compatible with C compilers intrinsic +// built in implementations. + +#if (__SIZEOF_POINTER__ == 8) || defined(_WIN64) || defined(__LP64__) + #if defined(_WIN64) + typedef unsigned long long size_t; + #else + typedef unsigned long size_t; + #endif +#else + typedef unsigned int size_t; +#endif + +#define _SIZE_T_DECLARED // For FreeBSD +#define _SIZE_T_DEFINED_ // For OpenBSD + +void *memcpy(void *dest, const void *source, size_t size); + + +// Declare fixed size versions of basic intger types + #if defined(_WIN64) typedef long long int64; typedef unsigned long long uint64; @@ -18,20 +39,7 @@ typedef unsigned short int uint16; typedef signed char int8; typedef unsigned char uint8; -#if (__SIZEOF_POINTER__ == 8) || defined(_WIN64) || defined(__LP64__) - #if defined(_WIN64) - typedef unsigned long long size_t; - #else - typedef unsigned long size_t; - #endif -#else - typedef unsigned int size_t; -#endif - -#define _SIZE_T_DECLARED // For FreeBSD -#define _SIZE_T_DEFINED_ // For OpenBSD - -void *memcpy(void *dest, const void *source, size_t size); +#define uintptr size_t // The compiler uses 'import' and 'export' which translate to 'extern' and @@ -46,7 +54,7 @@ void *memcpy(void *dest, const void *source, size_t size); #define NIL ((void*)0) #define __MAXEXT 16 -#define POINTER__typ ((LONGINT*)(1)) // not NIL and not a valid type +#define POINTER__typ ((uintptr*)(1)) // not NIL and not a valid type // Oberon types @@ -60,7 +68,7 @@ typedef float REAL; typedef double LONGREAL; typedef void* SYSTEM_PTR; -typedef size_t SYSTEM_ADRINT; +typedef uintptr SYSTEM_ADRINT; // For 32 bit builds, the size of LONGINT depends on a make option: @@ -68,18 +76,19 @@ typedef size_t SYSTEM_ADRINT; #if (__SIZEOF_POINTER__ == 8) || defined(LARGE) || defined(_WIN64) typedef int32 INTEGER; typedef int64 LONGINT; - typedef uint64 uLONGINT; + typedef uint64 SET; + typedef uint64 uSET; #else typedef int16 INTEGER; typedef int32 LONGINT; - typedef uint32 uLONGINT; + typedef uint32 SET; + typedef uint32 uSET; #endif -// Unsigned variants are for use by shift and rotate macros. -typedef uLONGINT SET; -typedef uLONGINT uSET; +// Temporary defs while bootstrapping +#define uLONGINT uint64 @@ -90,32 +99,32 @@ typedef uLONGINT uSET; // OS Memory allocation interfaces are in PlatformXXX.Mod -extern LONGINT Platform_OSAllocate (LONGINT size); -extern void Platform_OSFree (LONGINT addr); +extern uintptr Platform_OSAllocate (uintptr size); +extern void Platform_OSFree (uintptr addr); // Run time system routines in SYSTEM.c -extern LONGINT SYSTEM_XCHK (LONGINT i, LONGINT ub); -extern LONGINT SYSTEM_RCHK (LONGINT i, LONGINT ub); +extern int64 SYSTEM_XCHK (uint64 i, uint64 ub); +extern int64 SYSTEM_RCHK (uint64 i, uint64 ub); extern LONGINT SYSTEM_ASH (LONGINT i, LONGINT n); extern LONGINT SYSTEM_ABS (LONGINT i); extern double SYSTEM_ABSD (double i); extern void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0); extern void SYSTEM_ENUMP (void *adr, LONGINT n, void (*P)()); extern void SYSTEM_ENUMR (void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()); -extern LONGINT SYSTEM_DIV (uLONGINT x, uLONGINT y); -extern LONGINT SYSTEM_MOD (uLONGINT x, uLONGINT y); +extern LONGINT SYSTEM_DIV (uint64 x, uint64 y); +extern LONGINT SYSTEM_MOD (uint64 x, uint64 y); extern LONGINT SYSTEM_ENTIER (double x); // Signal handling in SYSTEM.c #ifndef _WIN32 - extern void SystemSetHandler(int s, SYSTEM_ADRINT h); + extern void SystemSetHandler(int s, uintptr h); #else - extern void SystemSetInterruptHandler(SYSTEM_ADRINT h); - extern void SystemSetQuitHandler (SYSTEM_ADRINT h); + extern void SystemSetInterruptHandler(uintptr h); + extern void SystemSetQuitHandler (uintptr h); #endif @@ -138,11 +147,18 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __COPY(s, d, n) {char*_a=(void*)s,*_b=(void*)d; LONGINT _i=0,_t=n-1; \ while(_i<_t&&((_b[_i]=_a[_i])!=0)){_i++;};_b[_i]=0;} -#define __DUP(x, l, t) x=(void*)memcpy((void*)(SYSTEM_ADRINT)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) +#define __DUP(x, l, t) x=(void*)memcpy((void*)(uintptr)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) #define __DUPARR(v, t) v=(void*)memcpy(v##__copy,v,sizeof(t)) -#define __DEL(x) Platform_OSFree((LONGINT)(SYSTEM_ADRINT)x) +#define __DEL(x) Platform_OSFree((LONGINT)(uintptr)x) +// Index and range checks + +#define __X(i, ub) (((uint64)(i)<(uint64)(ub))?i:(__HALT(-2),0)) +#define __XF(i, ub) SYSTEM_XCHK((uint64)(i), (uint64)(ub)) + +#define __R(i, ub) (((uint64)(i)<(uint64)(ub))?i:(__HALT(-8),0)) +#define __RF(i, ub) SYSTEM_RCHK((uint64)(i),(uint64)(ub)) /* SYSTEM ops */ @@ -150,24 +166,24 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __VAL(t, x) (*(t*)&(x)) -#define __GET(a, x, t) x= *(t*)(SYSTEM_ADRINT)(a) -#define __PUT(a, x, t) *(t*)(SYSTEM_ADRINT)(a)=x +#define __GET(a, x, t) x= *(t*)(uintptr)(a) +#define __PUT(a, x, t) *(t*)(uintptr)(a)=x #define __LSHL(x, n, t) ((t)((u##t)(x)<<(n))) #define __LSHR(x, n, t) ((t)((u##t)(x)>>(n))) #define __LSH(x, n, t) ((n)>=0? __LSHL(x, n, t): __LSHR(x, -(n), t)) -#define __ASHL(x, n) ((LONGINT)(x)<<(n)) -#define __ASHR(x, n) ((LONGINT)(x)>>(n)) -#define __ASH(x, n) ((n)>=0?__ASHL(x,n):__ASHR(x,-(n))) - #define __ROTL(x, n, t) ((t)((u##t)(x)<<(n)|(u##t)(x)>>(8*sizeof(t)-(n)))) #define __ROTR(x, n, t) ((t)((u##t)(x)>>(n)|(u##t)(x)<<(8*sizeof(t)-(n)))) #define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) -#define __BIT(x, n) (*(uLONGINT*)(x)>>(n)&1) -#define __MOVE(s, d, n) memcpy((char*)(SYSTEM_ADRINT)(d),(char*)(SYSTEM_ADRINT)(s),n) +#define __ASHL(x, n) ((LONGINT)(x)<<(n)) +#define __ASHR(x, n) ((LONGINT)(x)>>(n)) +#define __ASH(x, n) ((n)>=0?__ASHL(x,n):__ASHR(x,-(n))) #define __ASHF(x, n) SYSTEM_ASH((LONGINT)(x), (LONGINT)(n)) + +#define __BIT(x, n) (*(uint64*)(x)>>(n)&1) +#define __MOVE(s, d, n) memcpy((char*)(uintptr)(d),(char*)(uintptr)(s),n) #define __SHORT(x, y) ((int)((uLONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) #define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) #define __CHR(x) ((CHAR)__R(x, 256)) @@ -191,10 +207,6 @@ static int __str_cmp(CHAR *x, CHAR *y){ // Runtime checks -#define __X(i, ub) (((uLONGINT)(i)<(uLONGINT)(ub))?i:(__HALT(-2),0)) -#define __XF(i, ub) SYSTEM_XCHK((LONGINT)(i), (LONGINT)(ub)) -#define __R(i, ub) (((uLONGINT)(i)<(uLONGINT)(ub))?i:(__HALT(-8),0)) -#define __RF(i, ub) SYSTEM_RCHK((LONGINT)(i),(LONGINT)(ub)) #define __RETCHK __retchk: __HALT(-3); return 0; #define __CASECHK __HALT(-4) #define __WITHCHK __HALT(-7) @@ -227,7 +239,7 @@ extern void Heap_INCREF(); extern void Platform_Init(INTEGER argc, LONGINT argv); extern void Heap_FINALL(); -#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (LONGINT)(SYSTEM_ADRINT)&argv); +#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (LONGINT)(uintptr)&argv); #define __REGMAIN(name, enum) m = Heap_REGMOD((CHAR*)name,enum) #define __FINI Heap_FINALL(); return 0 @@ -248,7 +260,7 @@ extern SYSTEM_PTR Heap_NEWREC (LONGINT tag); extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __SYSNEW(p, len) p = Heap_NEWBLK((LONGINT)(len)) -#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(SYSTEM_ADRINT)t##__typ) +#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(uintptr)t##__typ) #define __NEWARR SYSTEM_NEWARR @@ -279,20 +291,20 @@ extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __INITYP(t, t0, level) \ t##__typ = (LONGINT*)&t##__desc.blksz; \ memcpy(t##__desc.basep, t0##__typ - __BASEOFF, level*sizeof(LONGINT)); \ - t##__desc.basep[level] = (LONGINT)(SYSTEM_ADRINT)t##__typ; \ - t##__desc.module = (LONGINT)(SYSTEM_ADRINT)m; \ + t##__desc.basep[level] = (LONGINT)(uintptr)t##__typ; \ + t##__desc.module = (LONGINT)(uintptr)m; \ if(t##__desc.blksz!=sizeof(struct t)) __HALT(-15); \ t##__desc.blksz = (t##__desc.blksz+5*sizeof(LONGINT)-1)/(4*sizeof(LONGINT))*(4*sizeof(LONGINT)); \ - Heap_REGTYP(m, (LONGINT)(SYSTEM_ADRINT)&t##__desc.next); \ + Heap_REGTYP(m, (LONGINT)(uintptr)&t##__desc.next); \ SYSTEM_INHERIT(t##__typ, t0##__typ) -#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(SYSTEM_ADRINT)typ##__typ) -#define __TYPEOF(p) ((LONGINT*)(SYSTEM_ADRINT)(*(((LONGINT*)(p))-1))) +#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(uintptr)typ##__typ) +#define __TYPEOF(p) ((LONGINT*)(uintptr)(*(((LONGINT*)(p))-1))) #define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) // Oberon-2 type bound procedures support -#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(SYSTEM_ADRINT)proc -#define __SEND(typ, num, funtyp, parlist) ((funtyp)((SYSTEM_ADRINT)*(typ-(__TPROC0OFF+num))))parlist +#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(uintptr)proc +#define __SEND(typ, num, funtyp, parlist) ((funtyp)((uintptr)*(typ-(__TPROC0OFF+num))))parlist diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index 6463db16..439a49e9 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index 07051628..681fcf1c 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index 8dea0639..e3516799 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Files.h" #include "Modules.h" diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index d946691c..b8f301f7 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/Vishap.c b/bootstrap/unix-48/Vishap.c index c8f81032..9224220a 100644 --- a/bootstrap/unix-48/Vishap.c +++ b/bootstrap/unix-48/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkamSf */ #include "SYSTEM.h" #include "Configuration.h" #include "Heap.h" @@ -81,7 +81,7 @@ static void Vishap_PropagateElementaryTypeSizes (void) OPT_realtyp->size = OPM_RealSize; OPT_inttyp->size = OPM_IntSize; OPT_linttyp->size = OPM_LIntSize; - OPT_ainttyp->size = OPM_PointerSize; + OPT_pinttyp->size = OPM_PointerSize; OPT_lrltyp->size = OPM_LRealSize; OPT_sinttyp->size = OPM_SIntSize; OPT_booltyp->size = OPM_BoolSize; diff --git a/bootstrap/unix-48/errors.c b/bootstrap/unix-48/errors.c index 3f916fe9..6e4f20e5 100644 --- a/bootstrap/unix-48/errors.c +++ b/bootstrap/unix-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/unix-48/errors.h b/bootstrap/unix-48/errors.h index 2afac320..f06c706d 100644 --- a/bootstrap/unix-48/errors.h +++ b/bootstrap/unix-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index b894b3f9..00be6a22 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index ca635519..9d9202c0 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/vt100.c b/bootstrap/unix-48/vt100.c index 46a1e460..8ca75a42 100644 --- a/bootstrap/unix-48/vt100.c +++ b/bootstrap/unix-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Strings.h" diff --git a/bootstrap/unix-48/vt100.h b/bootstrap/unix-48/vt100.h index ad1ac948..901eed38 100644 --- a/bootstrap/unix-48/vt100.h +++ b/bootstrap/unix-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index f4abd052..ea06c48a 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -14,6 +14,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/01] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/02] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index c756e930..1e741041 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Console.c b/bootstrap/unix-88/Console.c index b4cd60d3..32b4d836 100644 --- a/bootstrap/unix-88/Console.c +++ b/bootstrap/unix-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Platform.h" diff --git a/bootstrap/unix-88/Console.h b/bootstrap/unix-88/Console.h index 987b5478..432a6e71 100644 --- a/bootstrap/unix-88/Console.h +++ b/bootstrap/unix-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 9ce98932..55714eaa 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index dee1234e..4dcd76c5 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index e96f7807..ba7f69f4 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tskSfF */ #define LARGE #include "SYSTEM.h" @@ -101,7 +101,7 @@ export void Heap_Unlock (void); extern void *Heap__init(); extern LONGINT Platform_MainStackFrame; -extern LONGINT Platform_OSAllocate(LONGINT size); +extern uintptr Platform_OSAllocate(uintptr size); #define Heap_FetchAddress(pointer) (LONGINT)(SYSTEM_ADRINT)(*((void**)((SYSTEM_ADRINT)pointer))) #define Heap_HeapModuleInit() Heap__init() #define Heap_OSAllocate(size) Platform_OSAllocate(size) diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index 40c921e4..e07b0d1e 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 5f85fd33..3cc9156d 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index d61c2889..f1bcc92f 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index 36f97a5d..ad99f16a 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index 61a0edcd..82eb03c4 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index 8310f854..f67c2556 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -201,8 +201,12 @@ void OPC_Ident (OPT_Object obj) } } } else if ((mode == 5 && obj->typ->form == 4)) { - OPM_WriteString((CHAR*)"int", 4); - OPM_WriteInt(__ASHL(obj->typ->size, 3)); + if (obj->typ == OPT_pinttyp || obj->typ == OPT_ainttyp) { + OPM_WriteString((CHAR*)"uintptr", 8); + } else { + OPM_WriteString((CHAR*)"int", 4); + OPM_WriteInt(__ASHL(obj->typ->size, 3)); + } } else { if (mode != 5 || obj->linkadr != 2) { if (mode == 13) { @@ -216,7 +220,7 @@ void OPC_Ident (OPT_Object obj) OPM_WriteStringVar((void*)OPM_modName, 32); } OPM_Write('_'); - } else if ((obj == OPT_sysptrtyp->strobj || obj == OPT_ainttyp->strobj) || obj == OPT_bytetyp->strobj) { + } else if (obj == OPT_sysptrtyp->strobj || obj == OPT_bytetyp->strobj) { OPM_WriteString((CHAR*)"SYSTEM_", 8); } OPM_WriteStringVar((void*)obj->name, 256); @@ -2081,6 +2085,7 @@ static void OPC_InitKeywords (void) Enter__49((CHAR*)"struct", 7); Enter__49((CHAR*)"switch", 7); Enter__49((CHAR*)"typedef", 8); + Enter__49((CHAR*)"uintptr", 8); Enter__49((CHAR*)"uint16", 7); Enter__49((CHAR*)"uint32", 7); Enter__49((CHAR*)"uint64", 7); diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index 3c5dedf4..42f6f30d 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index d4b582de..fb89bcd6 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index ccce7304..72257311 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index 78136a18..e270236a 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPB.h" diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index 863db6d6..9897c9c2 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index efd39a62..d07d06ca 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index c497e5c6..2aee5b21 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index 287c2ba6..6fd27531 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" @@ -84,7 +84,7 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; -export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_pinttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; export int8 OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; @@ -1768,6 +1768,7 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_sinttyp); P(OPT_inttyp); P(OPT_linttyp); + P(OPT_pinttyp); P(OPT_ainttyp); P(OPT_int8typ); P(OPT_int16typ); @@ -1850,6 +1851,7 @@ export void *OPT__init(void) OPT_InitStruct(&OPT_niltyp, 9); OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp); OPT_EnterTyp((CHAR*)"PTR", 11, OPM_PointerSize, &OPT_sysptrtyp); + OPT_EnterTyp((CHAR*)"UINTPTR", 4, OPM_PointerSize, &OPT_pinttyp); OPT_EnterTyp((CHAR*)"ADRINT", 4, OPM_PointerSize, &OPT_ainttyp); OPT_EnterTyp((CHAR*)"INT8", 4, 1, &OPT_int8typ); OPT_EnterTyp((CHAR*)"INT16", 4, 2, &OPT_int16typ); diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 808e8043..349849e8 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h @@ -68,7 +68,7 @@ typedef import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; -import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_pinttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; import int8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 5b1ffe19..d3aa0a87 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPC.h" @@ -286,6 +286,7 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_realtyp->strobj->linkadr = 2; OPT_inttyp->strobj->linkadr = 2; OPT_linttyp->strobj->linkadr = 2; + OPT_pinttyp->strobj->linkadr = 2; OPT_ainttyp->strobj->linkadr = 2; OPT_int8typ->strobj->linkadr = 2; OPT_int16typ->strobj->linkadr = 2; diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index 914ff060..09b50b36 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index fd00502a..2a6381d8 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -27,11 +27,12 @@ typedef export BOOLEAN Platform_LittleEndian; -export int64 Platform_MainStackFrame, Platform_HaltCode; +export uintptr Platform_MainStackFrame; +export int64 Platform_HaltCode; export int32 Platform_PID; export CHAR Platform_CWD[256]; export int32 Platform_ArgCount; -export int64 Platform_ArgVector; +export uintptr Platform_ArgVector; static Platform_HaltProcedure Platform_HaltHandler; static int64 Platform_TimeStart; export int32 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; @@ -63,8 +64,8 @@ export void Platform_Init (int32 argc, int64 argvadr); export void Platform_MTimeAsClock (Platform_FileIdentity i, int64 *t, int64 *d); export int32 Platform_New (CHAR *n, LONGINT n__len, int64 *h); export BOOLEAN Platform_NoSuchDirectory (int32 e); -export int64 Platform_OSAllocate (int64 size); -export void Platform_OSFree (int64 address); +export uintptr Platform_OSAllocate (uintptr size); +export void Platform_OSFree (uintptr address); export int32 Platform_OldRO (CHAR *n, LONGINT n__len, int64 *h); export int32 Platform_OldRW (CHAR *n, LONGINT n__len, int64 *h); export int32 Platform_Read (int64 h, int64 p, int64 l, int64 *n); @@ -119,14 +120,14 @@ export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT #define Platform_EXDEV() EXDEV extern void Heap_InitHeap(); #define Platform_HeapInitHeap() Heap_InitHeap() -#define Platform_allocate(size) (LONGINT)(SYSTEM_ADRINT)((void*)malloc((size_t)size)) +#define Platform_allocate(size) (uintptr)((void*)malloc((size_t)size)) #define Platform_chdir(n, n__len) chdir((char*)n) #define Platform_closefile(fd) close(fd) #define Platform_err() errno #define Platform_errc(c) write(1, &c, 1) #define Platform_errstring(s, s__len) write(1, s, s__len-1) #define Platform_exit(code) exit(code) -#define Platform_free(address) free((void*)(SYSTEM_ADRINT)address) +#define Platform_free(address) free((void*)address) #define Platform_fstat(fd) fstat(fd, &s) #define Platform_fsync(fd) fsync(fd) #define Platform_ftruncate(fd, l) ftruncate(fd, l) @@ -213,14 +214,14 @@ BOOLEAN Platform_ConnectionFailed (int32 e) return _o_result; } -int64 Platform_OSAllocate (int64 size) +uintptr Platform_OSAllocate (uintptr size) { - int64 _o_result; + uintptr _o_result; _o_result = Platform_allocate(size); return _o_result; } -void Platform_OSFree (int64 address) +void Platform_OSFree (uintptr address) { Platform_free(address); } diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index caba8898..63531c58 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h @@ -19,11 +19,12 @@ typedef import BOOLEAN Platform_LittleEndian; -import int64 Platform_MainStackFrame, Platform_HaltCode; +import uintptr Platform_MainStackFrame; +import int64 Platform_HaltCode; import int32 Platform_PID; import CHAR Platform_CWD[256]; import int32 Platform_ArgCount; -import int64 Platform_ArgVector; +import uintptr Platform_ArgVector; import int32 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; import CHAR Platform_nl[3]; @@ -52,8 +53,8 @@ import void Platform_Init (int32 argc, int64 argvadr); import void Platform_MTimeAsClock (Platform_FileIdentity i, int64 *t, int64 *d); import int32 Platform_New (CHAR *n, LONGINT n__len, int64 *h); import BOOLEAN Platform_NoSuchDirectory (int32 e); -import int64 Platform_OSAllocate (int64 size); -import void Platform_OSFree (int64 address); +import uintptr Platform_OSAllocate (uintptr size); +import void Platform_OSFree (uintptr address); import int32 Platform_OldRO (CHAR *n, LONGINT n__len, int64 *h); import int32 Platform_OldRW (CHAR *n, LONGINT n__len, int64 *h); import int32 Platform_Read (int64 h, int64 p, int64 l, int64 *n); diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 5877bedc..d6e77abf 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index cf944612..2c04bec3 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/SYSTEM.c b/bootstrap/unix-88/SYSTEM.c index 9bc6b756..16681ab8 100644 --- a/bootstrap/unix-88/SYSTEM.c +++ b/bootstrap/unix-88/SYSTEM.c @@ -18,8 +18,11 @@ #include -LONGINT SYSTEM_XCHK(LONGINT i, LONGINT ub) {return __X(i, ub);} -LONGINT SYSTEM_RCHK(LONGINT i, LONGINT ub) {return __R(i, ub);} +// Procedure verions of SYSTEM.H versions used when a multiply accessed +// parameter has side effects. + +int64 SYSTEM_XCHK(uint64 i, uint64 ub) {return __X(i, ub);} +int64 SYSTEM_RCHK(uint64 i, uint64 ub) {return __R(i, ub);} LONGINT SYSTEM_ASH (LONGINT i, LONGINT n) {return __ASH(i, n);} LONGINT SYSTEM_ABS (LONGINT i) {return __ABS(i);} double SYSTEM_ABSD(double i) {return __ABS(i);} @@ -35,7 +38,7 @@ void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0) void SYSTEM_ENUMP(void *adr, LONGINT n, void (*P)()) { while (n > 0) { - P((LONGINT)(SYSTEM_ADRINT)(*((void**)(adr)))); + P((uintptr)(*((void**)(adr)))); adr = ((void**)adr) + 1; n--; } @@ -48,20 +51,20 @@ void SYSTEM_ENUMR(void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()) while (n > 0) { t = typ; off = *t; - while (off >= 0) {P(*(LONGINT*)((char*)adr+off)); t++; off = *t;} + while (off >= 0) {P(*(uintptr*)((char*)adr+off)); t++; off = *t;} adr = ((char*)adr) + size; n--; } } -LONGINT SYSTEM_DIV(uLONGINT x, uLONGINT y) -{ if ((LONGINT) x >= 0) return (x / y); +LONGINT SYSTEM_DIV(uint64 x, uint64 y) +{ if ((int64) x >= 0) return (x / y); else return -((y - 1 - x) / y); } -LONGINT SYSTEM_MOD(uLONGINT x, uLONGINT y) -{ uLONGINT m; - if ((LONGINT) x >= 0) return (x % y); +LONGINT SYSTEM_MOD(uint64 x, uint64 y) +{ uint64 m; + if ((int64) x >= 0) return (x % y); else { m = (-x) % y; if (m != 0) return (y - m); else return 0; } @@ -106,7 +109,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, else if (typ == (LONGINT*)POINTER__typ) { /* element type is a pointer */ x = Heap_NEWBLK(size + nofelems * sizeof(LONGINT)); - p = (LONGINT*)(SYSTEM_ADRINT)x[-1]; + p = (LONGINT*)(uintptr)x[-1]; p[-nofelems] = *p; /* build new type desc in situ: 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nofelems - 1; n = 1; /* n =1 for skipping the size field */ while (n <= nofelems) {*p = n*sizeof(LONGINT); p++; n++;} @@ -119,7 +122,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, while (ptab[nofptrs] >= 0) {nofptrs++;} /* number of pointers per element */ nptr = nofelems * nofptrs; /* total number of pointers */ x = Heap_NEWBLK(size + nptr * sizeof(LONGINT)); - p = (LONGINT*)(SYSTEM_ADRINT)x[- 1]; + p = (LONGINT*)(uintptr)x[- 1]; p[-nptr] = *p; /* build new type desc in situ; 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nptr - 1; n = 0; off = dataoff; while (n < nofelems) {i = 0; @@ -155,7 +158,7 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler // (Ignore other signals) } - void SystemSetHandler(int s, SYSTEM_ADRINT h) { + void SystemSetHandler(int s, uintptr h) { if (s >= 2 && s <= 4) { int needtosetsystemhandler = handler[s-2] == 0; handler[s-2] = (SystemSignalHandler)h; @@ -194,12 +197,12 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler } } - void SystemSetInterruptHandler(SYSTEM_ADRINT h) { + void SystemSetInterruptHandler(uintptr h) { EnsureConsoleCtrlHandler(); SystemInterruptHandler = (SystemSignalHandler)h; } - void SystemSetQuitHandler(SYSTEM_ADRINT h) { + void SystemSetQuitHandler(uintptr h) { EnsureConsoleCtrlHandler(); SystemQuitHandler = (SystemSignalHandler)h; } diff --git a/bootstrap/unix-88/SYSTEM.h b/bootstrap/unix-88/SYSTEM.h index 2cab2429..c83f69f1 100644 --- a/bootstrap/unix-88/SYSTEM.h +++ b/bootstrap/unix-88/SYSTEM.h @@ -1,6 +1,27 @@ #ifndef SYSTEM__h #define SYSTEM__h +// Declare memcpy in a way compatible with C compilers intrinsic +// built in implementations. + +#if (__SIZEOF_POINTER__ == 8) || defined(_WIN64) || defined(__LP64__) + #if defined(_WIN64) + typedef unsigned long long size_t; + #else + typedef unsigned long size_t; + #endif +#else + typedef unsigned int size_t; +#endif + +#define _SIZE_T_DECLARED // For FreeBSD +#define _SIZE_T_DEFINED_ // For OpenBSD + +void *memcpy(void *dest, const void *source, size_t size); + + +// Declare fixed size versions of basic intger types + #if defined(_WIN64) typedef long long int64; typedef unsigned long long uint64; @@ -18,20 +39,7 @@ typedef unsigned short int uint16; typedef signed char int8; typedef unsigned char uint8; -#if (__SIZEOF_POINTER__ == 8) || defined(_WIN64) || defined(__LP64__) - #if defined(_WIN64) - typedef unsigned long long size_t; - #else - typedef unsigned long size_t; - #endif -#else - typedef unsigned int size_t; -#endif - -#define _SIZE_T_DECLARED // For FreeBSD -#define _SIZE_T_DEFINED_ // For OpenBSD - -void *memcpy(void *dest, const void *source, size_t size); +#define uintptr size_t // The compiler uses 'import' and 'export' which translate to 'extern' and @@ -46,7 +54,7 @@ void *memcpy(void *dest, const void *source, size_t size); #define NIL ((void*)0) #define __MAXEXT 16 -#define POINTER__typ ((LONGINT*)(1)) // not NIL and not a valid type +#define POINTER__typ ((uintptr*)(1)) // not NIL and not a valid type // Oberon types @@ -60,7 +68,7 @@ typedef float REAL; typedef double LONGREAL; typedef void* SYSTEM_PTR; -typedef size_t SYSTEM_ADRINT; +typedef uintptr SYSTEM_ADRINT; // For 32 bit builds, the size of LONGINT depends on a make option: @@ -68,18 +76,19 @@ typedef size_t SYSTEM_ADRINT; #if (__SIZEOF_POINTER__ == 8) || defined(LARGE) || defined(_WIN64) typedef int32 INTEGER; typedef int64 LONGINT; - typedef uint64 uLONGINT; + typedef uint64 SET; + typedef uint64 uSET; #else typedef int16 INTEGER; typedef int32 LONGINT; - typedef uint32 uLONGINT; + typedef uint32 SET; + typedef uint32 uSET; #endif -// Unsigned variants are for use by shift and rotate macros. -typedef uLONGINT SET; -typedef uLONGINT uSET; +// Temporary defs while bootstrapping +#define uLONGINT uint64 @@ -90,32 +99,32 @@ typedef uLONGINT uSET; // OS Memory allocation interfaces are in PlatformXXX.Mod -extern LONGINT Platform_OSAllocate (LONGINT size); -extern void Platform_OSFree (LONGINT addr); +extern uintptr Platform_OSAllocate (uintptr size); +extern void Platform_OSFree (uintptr addr); // Run time system routines in SYSTEM.c -extern LONGINT SYSTEM_XCHK (LONGINT i, LONGINT ub); -extern LONGINT SYSTEM_RCHK (LONGINT i, LONGINT ub); +extern int64 SYSTEM_XCHK (uint64 i, uint64 ub); +extern int64 SYSTEM_RCHK (uint64 i, uint64 ub); extern LONGINT SYSTEM_ASH (LONGINT i, LONGINT n); extern LONGINT SYSTEM_ABS (LONGINT i); extern double SYSTEM_ABSD (double i); extern void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0); extern void SYSTEM_ENUMP (void *adr, LONGINT n, void (*P)()); extern void SYSTEM_ENUMR (void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()); -extern LONGINT SYSTEM_DIV (uLONGINT x, uLONGINT y); -extern LONGINT SYSTEM_MOD (uLONGINT x, uLONGINT y); +extern LONGINT SYSTEM_DIV (uint64 x, uint64 y); +extern LONGINT SYSTEM_MOD (uint64 x, uint64 y); extern LONGINT SYSTEM_ENTIER (double x); // Signal handling in SYSTEM.c #ifndef _WIN32 - extern void SystemSetHandler(int s, SYSTEM_ADRINT h); + extern void SystemSetHandler(int s, uintptr h); #else - extern void SystemSetInterruptHandler(SYSTEM_ADRINT h); - extern void SystemSetQuitHandler (SYSTEM_ADRINT h); + extern void SystemSetInterruptHandler(uintptr h); + extern void SystemSetQuitHandler (uintptr h); #endif @@ -138,11 +147,18 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __COPY(s, d, n) {char*_a=(void*)s,*_b=(void*)d; LONGINT _i=0,_t=n-1; \ while(_i<_t&&((_b[_i]=_a[_i])!=0)){_i++;};_b[_i]=0;} -#define __DUP(x, l, t) x=(void*)memcpy((void*)(SYSTEM_ADRINT)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) +#define __DUP(x, l, t) x=(void*)memcpy((void*)(uintptr)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) #define __DUPARR(v, t) v=(void*)memcpy(v##__copy,v,sizeof(t)) -#define __DEL(x) Platform_OSFree((LONGINT)(SYSTEM_ADRINT)x) +#define __DEL(x) Platform_OSFree((LONGINT)(uintptr)x) +// Index and range checks + +#define __X(i, ub) (((uint64)(i)<(uint64)(ub))?i:(__HALT(-2),0)) +#define __XF(i, ub) SYSTEM_XCHK((uint64)(i), (uint64)(ub)) + +#define __R(i, ub) (((uint64)(i)<(uint64)(ub))?i:(__HALT(-8),0)) +#define __RF(i, ub) SYSTEM_RCHK((uint64)(i),(uint64)(ub)) /* SYSTEM ops */ @@ -150,24 +166,24 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __VAL(t, x) (*(t*)&(x)) -#define __GET(a, x, t) x= *(t*)(SYSTEM_ADRINT)(a) -#define __PUT(a, x, t) *(t*)(SYSTEM_ADRINT)(a)=x +#define __GET(a, x, t) x= *(t*)(uintptr)(a) +#define __PUT(a, x, t) *(t*)(uintptr)(a)=x #define __LSHL(x, n, t) ((t)((u##t)(x)<<(n))) #define __LSHR(x, n, t) ((t)((u##t)(x)>>(n))) #define __LSH(x, n, t) ((n)>=0? __LSHL(x, n, t): __LSHR(x, -(n), t)) -#define __ASHL(x, n) ((LONGINT)(x)<<(n)) -#define __ASHR(x, n) ((LONGINT)(x)>>(n)) -#define __ASH(x, n) ((n)>=0?__ASHL(x,n):__ASHR(x,-(n))) - #define __ROTL(x, n, t) ((t)((u##t)(x)<<(n)|(u##t)(x)>>(8*sizeof(t)-(n)))) #define __ROTR(x, n, t) ((t)((u##t)(x)>>(n)|(u##t)(x)<<(8*sizeof(t)-(n)))) #define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) -#define __BIT(x, n) (*(uLONGINT*)(x)>>(n)&1) -#define __MOVE(s, d, n) memcpy((char*)(SYSTEM_ADRINT)(d),(char*)(SYSTEM_ADRINT)(s),n) +#define __ASHL(x, n) ((LONGINT)(x)<<(n)) +#define __ASHR(x, n) ((LONGINT)(x)>>(n)) +#define __ASH(x, n) ((n)>=0?__ASHL(x,n):__ASHR(x,-(n))) #define __ASHF(x, n) SYSTEM_ASH((LONGINT)(x), (LONGINT)(n)) + +#define __BIT(x, n) (*(uint64*)(x)>>(n)&1) +#define __MOVE(s, d, n) memcpy((char*)(uintptr)(d),(char*)(uintptr)(s),n) #define __SHORT(x, y) ((int)((uLONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) #define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) #define __CHR(x) ((CHAR)__R(x, 256)) @@ -191,10 +207,6 @@ static int __str_cmp(CHAR *x, CHAR *y){ // Runtime checks -#define __X(i, ub) (((uLONGINT)(i)<(uLONGINT)(ub))?i:(__HALT(-2),0)) -#define __XF(i, ub) SYSTEM_XCHK((LONGINT)(i), (LONGINT)(ub)) -#define __R(i, ub) (((uLONGINT)(i)<(uLONGINT)(ub))?i:(__HALT(-8),0)) -#define __RF(i, ub) SYSTEM_RCHK((LONGINT)(i),(LONGINT)(ub)) #define __RETCHK __retchk: __HALT(-3); return 0; #define __CASECHK __HALT(-4) #define __WITHCHK __HALT(-7) @@ -227,7 +239,7 @@ extern void Heap_INCREF(); extern void Platform_Init(INTEGER argc, LONGINT argv); extern void Heap_FINALL(); -#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (LONGINT)(SYSTEM_ADRINT)&argv); +#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (LONGINT)(uintptr)&argv); #define __REGMAIN(name, enum) m = Heap_REGMOD((CHAR*)name,enum) #define __FINI Heap_FINALL(); return 0 @@ -248,7 +260,7 @@ extern SYSTEM_PTR Heap_NEWREC (LONGINT tag); extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __SYSNEW(p, len) p = Heap_NEWBLK((LONGINT)(len)) -#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(SYSTEM_ADRINT)t##__typ) +#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(uintptr)t##__typ) #define __NEWARR SYSTEM_NEWARR @@ -279,20 +291,20 @@ extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __INITYP(t, t0, level) \ t##__typ = (LONGINT*)&t##__desc.blksz; \ memcpy(t##__desc.basep, t0##__typ - __BASEOFF, level*sizeof(LONGINT)); \ - t##__desc.basep[level] = (LONGINT)(SYSTEM_ADRINT)t##__typ; \ - t##__desc.module = (LONGINT)(SYSTEM_ADRINT)m; \ + t##__desc.basep[level] = (LONGINT)(uintptr)t##__typ; \ + t##__desc.module = (LONGINT)(uintptr)m; \ if(t##__desc.blksz!=sizeof(struct t)) __HALT(-15); \ t##__desc.blksz = (t##__desc.blksz+5*sizeof(LONGINT)-1)/(4*sizeof(LONGINT))*(4*sizeof(LONGINT)); \ - Heap_REGTYP(m, (LONGINT)(SYSTEM_ADRINT)&t##__desc.next); \ + Heap_REGTYP(m, (LONGINT)(uintptr)&t##__desc.next); \ SYSTEM_INHERIT(t##__typ, t0##__typ) -#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(SYSTEM_ADRINT)typ##__typ) -#define __TYPEOF(p) ((LONGINT*)(SYSTEM_ADRINT)(*(((LONGINT*)(p))-1))) +#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(uintptr)typ##__typ) +#define __TYPEOF(p) ((LONGINT*)(uintptr)(*(((LONGINT*)(p))-1))) #define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) // Oberon-2 type bound procedures support -#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(SYSTEM_ADRINT)proc -#define __SEND(typ, num, funtyp, parlist) ((funtyp)((SYSTEM_ADRINT)*(typ-(__TPROC0OFF+num))))parlist +#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(uintptr)proc +#define __SEND(typ, num, funtyp, parlist) ((funtyp)((uintptr)*(typ-(__TPROC0OFF+num))))parlist diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index 85e9fca9..769cecb7 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index d703f8c0..012e77f9 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index 0c5cb89c..934bc227 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Files.h" diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index 2e48fe94..fbd8a7a4 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/Vishap.c b/bootstrap/unix-88/Vishap.c index c313eb20..f781d7ee 100644 --- a/bootstrap/unix-88/Vishap.c +++ b/bootstrap/unix-88/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkamSf */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -82,7 +82,7 @@ static void Vishap_PropagateElementaryTypeSizes (void) OPT_realtyp->size = OPM_RealSize; OPT_inttyp->size = OPM_IntSize; OPT_linttyp->size = OPM_LIntSize; - OPT_ainttyp->size = OPM_PointerSize; + OPT_pinttyp->size = OPM_PointerSize; OPT_lrltyp->size = OPM_LRealSize; OPT_sinttyp->size = OPM_SIntSize; OPT_booltyp->size = OPM_BoolSize; diff --git a/bootstrap/unix-88/errors.c b/bootstrap/unix-88/errors.c index dc5320bb..b1aa1639 100644 --- a/bootstrap/unix-88/errors.c +++ b/bootstrap/unix-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/unix-88/errors.h b/bootstrap/unix-88/errors.h index d15a472c..049c862a 100644 --- a/bootstrap/unix-88/errors.h +++ b/bootstrap/unix-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index bc32dc20..51975db4 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index 161e273a..3cba883d 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/vt100.c b/bootstrap/unix-88/vt100.c index a757d25d..dfa8df9c 100644 --- a/bootstrap/unix-88/vt100.c +++ b/bootstrap/unix-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/unix-88/vt100.h b/bootstrap/unix-88/vt100.h index fb8a12d0..139b592e 100644 --- a/bootstrap/unix-88/vt100.h +++ b/bootstrap/unix-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index fb7df026..194e9da8 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -13,6 +13,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/01] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/02] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index 61b33bc5..fbca10e0 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Console.c b/bootstrap/windows-48/Console.c index 72c0b6bf..5b63f566 100644 --- a/bootstrap/windows-48/Console.c +++ b/bootstrap/windows-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Platform.h" diff --git a/bootstrap/windows-48/Console.h b/bootstrap/windows-48/Console.h index 16287a76..3823dacc 100644 --- a/bootstrap/windows-48/Console.h +++ b/bootstrap/windows-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 4aecc2ee..b53ae4ca 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index e85d1cfd..c216c6c6 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index a252264a..2315b64e 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tskSfF */ #include "SYSTEM.h" struct Heap__1 { @@ -100,7 +100,7 @@ export void Heap_Unlock (void); extern void *Heap__init(); extern LONGINT Platform_MainStackFrame; -extern LONGINT Platform_OSAllocate(LONGINT size); +extern uintptr Platform_OSAllocate(uintptr size); #define Heap_FetchAddress(pointer) (LONGINT)(SYSTEM_ADRINT)(*((void**)((SYSTEM_ADRINT)pointer))) #define Heap_HeapModuleInit() Heap__init() #define Heap_OSAllocate(size) Platform_OSAllocate(size) diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index a89f18fc..83733c20 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index 7969f68f..e7006b76 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Heap.h" diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index 8b271308..632138b5 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index bc74dd1d..fa8f98fe 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index a4ccc86e..8b2baa5f 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 08469d42..93d60530 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "OPM.h" @@ -200,8 +200,12 @@ void OPC_Ident (OPT_Object obj) } } } else if ((mode == 5 && obj->typ->form == 4)) { - OPM_WriteString((CHAR*)"int", 4); - OPM_WriteInt(__ASHL(obj->typ->size, 3)); + if (obj->typ == OPT_pinttyp || obj->typ == OPT_ainttyp) { + OPM_WriteString((CHAR*)"uintptr", 8); + } else { + OPM_WriteString((CHAR*)"int", 4); + OPM_WriteInt(__ASHL(obj->typ->size, 3)); + } } else { if (mode != 5 || obj->linkadr != 2) { if (mode == 13) { @@ -215,7 +219,7 @@ void OPC_Ident (OPT_Object obj) OPM_WriteStringVar((void*)OPM_modName, 32); } OPM_Write('_'); - } else if ((obj == OPT_sysptrtyp->strobj || obj == OPT_ainttyp->strobj) || obj == OPT_bytetyp->strobj) { + } else if (obj == OPT_sysptrtyp->strobj || obj == OPT_bytetyp->strobj) { OPM_WriteString((CHAR*)"SYSTEM_", 8); } OPM_WriteStringVar((void*)obj->name, 256); @@ -2080,6 +2084,7 @@ static void OPC_InitKeywords (void) Enter__49((CHAR*)"struct", 7); Enter__49((CHAR*)"switch", 7); Enter__49((CHAR*)"typedef", 8); + Enter__49((CHAR*)"uintptr", 8); Enter__49((CHAR*)"uint16", 7); Enter__49((CHAR*)"uint32", 7); Enter__49((CHAR*)"uint64", 7); diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index 05c34fcc..78a60ed9 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 8bf863b3..19ad29af 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index 36eb4165..44fe5275 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index a366ef24..b0cd8613 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPB.h" #include "OPM.h" diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index 8bed9493..423013a4 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index 2b29372f..36b37592 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index e40119f7..dec9c209 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 7fbad791..16dfc5b1 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" @@ -83,7 +83,7 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; -export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_pinttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; export int8 OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; @@ -1767,6 +1767,7 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_sinttyp); P(OPT_inttyp); P(OPT_linttyp); + P(OPT_pinttyp); P(OPT_ainttyp); P(OPT_int8typ); P(OPT_int16typ); @@ -1849,6 +1850,7 @@ export void *OPT__init(void) OPT_InitStruct(&OPT_niltyp, 9); OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp); OPT_EnterTyp((CHAR*)"PTR", 11, OPM_PointerSize, &OPT_sysptrtyp); + OPT_EnterTyp((CHAR*)"UINTPTR", 4, OPM_PointerSize, &OPT_pinttyp); OPT_EnterTyp((CHAR*)"ADRINT", 4, OPM_PointerSize, &OPT_ainttyp); OPT_EnterTyp((CHAR*)"INT8", 4, 1, &OPT_int8typ); OPT_EnterTyp((CHAR*)"INT16", 4, 2, &OPT_int16typ); diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index 480267cc..c290d3de 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h @@ -67,7 +67,7 @@ typedef import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; -import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_pinttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; import int8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index 5ef539df..aeef6224 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPC.h" #include "OPM.h" @@ -285,6 +285,7 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_realtyp->strobj->linkadr = 2; OPT_inttyp->strobj->linkadr = 2; OPT_linttyp->strobj->linkadr = 2; + OPT_pinttyp->strobj->linkadr = 2; OPT_ainttyp->strobj->linkadr = 2; OPT_int8typ->strobj->linkadr = 2; OPT_int16typ->strobj->linkadr = 2; diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index 06bc39f1..8fd772f8 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 76fb4a1d..67dc8e39 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index 23922225..39074f3e 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 4b500170..4e271371 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index a1191c0b..b1e62271 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/SYSTEM.c b/bootstrap/windows-48/SYSTEM.c index 9bc6b756..16681ab8 100644 --- a/bootstrap/windows-48/SYSTEM.c +++ b/bootstrap/windows-48/SYSTEM.c @@ -18,8 +18,11 @@ #include -LONGINT SYSTEM_XCHK(LONGINT i, LONGINT ub) {return __X(i, ub);} -LONGINT SYSTEM_RCHK(LONGINT i, LONGINT ub) {return __R(i, ub);} +// Procedure verions of SYSTEM.H versions used when a multiply accessed +// parameter has side effects. + +int64 SYSTEM_XCHK(uint64 i, uint64 ub) {return __X(i, ub);} +int64 SYSTEM_RCHK(uint64 i, uint64 ub) {return __R(i, ub);} LONGINT SYSTEM_ASH (LONGINT i, LONGINT n) {return __ASH(i, n);} LONGINT SYSTEM_ABS (LONGINT i) {return __ABS(i);} double SYSTEM_ABSD(double i) {return __ABS(i);} @@ -35,7 +38,7 @@ void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0) void SYSTEM_ENUMP(void *adr, LONGINT n, void (*P)()) { while (n > 0) { - P((LONGINT)(SYSTEM_ADRINT)(*((void**)(adr)))); + P((uintptr)(*((void**)(adr)))); adr = ((void**)adr) + 1; n--; } @@ -48,20 +51,20 @@ void SYSTEM_ENUMR(void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()) while (n > 0) { t = typ; off = *t; - while (off >= 0) {P(*(LONGINT*)((char*)adr+off)); t++; off = *t;} + while (off >= 0) {P(*(uintptr*)((char*)adr+off)); t++; off = *t;} adr = ((char*)adr) + size; n--; } } -LONGINT SYSTEM_DIV(uLONGINT x, uLONGINT y) -{ if ((LONGINT) x >= 0) return (x / y); +LONGINT SYSTEM_DIV(uint64 x, uint64 y) +{ if ((int64) x >= 0) return (x / y); else return -((y - 1 - x) / y); } -LONGINT SYSTEM_MOD(uLONGINT x, uLONGINT y) -{ uLONGINT m; - if ((LONGINT) x >= 0) return (x % y); +LONGINT SYSTEM_MOD(uint64 x, uint64 y) +{ uint64 m; + if ((int64) x >= 0) return (x % y); else { m = (-x) % y; if (m != 0) return (y - m); else return 0; } @@ -106,7 +109,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, else if (typ == (LONGINT*)POINTER__typ) { /* element type is a pointer */ x = Heap_NEWBLK(size + nofelems * sizeof(LONGINT)); - p = (LONGINT*)(SYSTEM_ADRINT)x[-1]; + p = (LONGINT*)(uintptr)x[-1]; p[-nofelems] = *p; /* build new type desc in situ: 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nofelems - 1; n = 1; /* n =1 for skipping the size field */ while (n <= nofelems) {*p = n*sizeof(LONGINT); p++; n++;} @@ -119,7 +122,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, while (ptab[nofptrs] >= 0) {nofptrs++;} /* number of pointers per element */ nptr = nofelems * nofptrs; /* total number of pointers */ x = Heap_NEWBLK(size + nptr * sizeof(LONGINT)); - p = (LONGINT*)(SYSTEM_ADRINT)x[- 1]; + p = (LONGINT*)(uintptr)x[- 1]; p[-nptr] = *p; /* build new type desc in situ; 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nptr - 1; n = 0; off = dataoff; while (n < nofelems) {i = 0; @@ -155,7 +158,7 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler // (Ignore other signals) } - void SystemSetHandler(int s, SYSTEM_ADRINT h) { + void SystemSetHandler(int s, uintptr h) { if (s >= 2 && s <= 4) { int needtosetsystemhandler = handler[s-2] == 0; handler[s-2] = (SystemSignalHandler)h; @@ -194,12 +197,12 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler } } - void SystemSetInterruptHandler(SYSTEM_ADRINT h) { + void SystemSetInterruptHandler(uintptr h) { EnsureConsoleCtrlHandler(); SystemInterruptHandler = (SystemSignalHandler)h; } - void SystemSetQuitHandler(SYSTEM_ADRINT h) { + void SystemSetQuitHandler(uintptr h) { EnsureConsoleCtrlHandler(); SystemQuitHandler = (SystemSignalHandler)h; } diff --git a/bootstrap/windows-48/SYSTEM.h b/bootstrap/windows-48/SYSTEM.h index 2cab2429..c83f69f1 100644 --- a/bootstrap/windows-48/SYSTEM.h +++ b/bootstrap/windows-48/SYSTEM.h @@ -1,6 +1,27 @@ #ifndef SYSTEM__h #define SYSTEM__h +// Declare memcpy in a way compatible with C compilers intrinsic +// built in implementations. + +#if (__SIZEOF_POINTER__ == 8) || defined(_WIN64) || defined(__LP64__) + #if defined(_WIN64) + typedef unsigned long long size_t; + #else + typedef unsigned long size_t; + #endif +#else + typedef unsigned int size_t; +#endif + +#define _SIZE_T_DECLARED // For FreeBSD +#define _SIZE_T_DEFINED_ // For OpenBSD + +void *memcpy(void *dest, const void *source, size_t size); + + +// Declare fixed size versions of basic intger types + #if defined(_WIN64) typedef long long int64; typedef unsigned long long uint64; @@ -18,20 +39,7 @@ typedef unsigned short int uint16; typedef signed char int8; typedef unsigned char uint8; -#if (__SIZEOF_POINTER__ == 8) || defined(_WIN64) || defined(__LP64__) - #if defined(_WIN64) - typedef unsigned long long size_t; - #else - typedef unsigned long size_t; - #endif -#else - typedef unsigned int size_t; -#endif - -#define _SIZE_T_DECLARED // For FreeBSD -#define _SIZE_T_DEFINED_ // For OpenBSD - -void *memcpy(void *dest, const void *source, size_t size); +#define uintptr size_t // The compiler uses 'import' and 'export' which translate to 'extern' and @@ -46,7 +54,7 @@ void *memcpy(void *dest, const void *source, size_t size); #define NIL ((void*)0) #define __MAXEXT 16 -#define POINTER__typ ((LONGINT*)(1)) // not NIL and not a valid type +#define POINTER__typ ((uintptr*)(1)) // not NIL and not a valid type // Oberon types @@ -60,7 +68,7 @@ typedef float REAL; typedef double LONGREAL; typedef void* SYSTEM_PTR; -typedef size_t SYSTEM_ADRINT; +typedef uintptr SYSTEM_ADRINT; // For 32 bit builds, the size of LONGINT depends on a make option: @@ -68,18 +76,19 @@ typedef size_t SYSTEM_ADRINT; #if (__SIZEOF_POINTER__ == 8) || defined(LARGE) || defined(_WIN64) typedef int32 INTEGER; typedef int64 LONGINT; - typedef uint64 uLONGINT; + typedef uint64 SET; + typedef uint64 uSET; #else typedef int16 INTEGER; typedef int32 LONGINT; - typedef uint32 uLONGINT; + typedef uint32 SET; + typedef uint32 uSET; #endif -// Unsigned variants are for use by shift and rotate macros. -typedef uLONGINT SET; -typedef uLONGINT uSET; +// Temporary defs while bootstrapping +#define uLONGINT uint64 @@ -90,32 +99,32 @@ typedef uLONGINT uSET; // OS Memory allocation interfaces are in PlatformXXX.Mod -extern LONGINT Platform_OSAllocate (LONGINT size); -extern void Platform_OSFree (LONGINT addr); +extern uintptr Platform_OSAllocate (uintptr size); +extern void Platform_OSFree (uintptr addr); // Run time system routines in SYSTEM.c -extern LONGINT SYSTEM_XCHK (LONGINT i, LONGINT ub); -extern LONGINT SYSTEM_RCHK (LONGINT i, LONGINT ub); +extern int64 SYSTEM_XCHK (uint64 i, uint64 ub); +extern int64 SYSTEM_RCHK (uint64 i, uint64 ub); extern LONGINT SYSTEM_ASH (LONGINT i, LONGINT n); extern LONGINT SYSTEM_ABS (LONGINT i); extern double SYSTEM_ABSD (double i); extern void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0); extern void SYSTEM_ENUMP (void *adr, LONGINT n, void (*P)()); extern void SYSTEM_ENUMR (void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()); -extern LONGINT SYSTEM_DIV (uLONGINT x, uLONGINT y); -extern LONGINT SYSTEM_MOD (uLONGINT x, uLONGINT y); +extern LONGINT SYSTEM_DIV (uint64 x, uint64 y); +extern LONGINT SYSTEM_MOD (uint64 x, uint64 y); extern LONGINT SYSTEM_ENTIER (double x); // Signal handling in SYSTEM.c #ifndef _WIN32 - extern void SystemSetHandler(int s, SYSTEM_ADRINT h); + extern void SystemSetHandler(int s, uintptr h); #else - extern void SystemSetInterruptHandler(SYSTEM_ADRINT h); - extern void SystemSetQuitHandler (SYSTEM_ADRINT h); + extern void SystemSetInterruptHandler(uintptr h); + extern void SystemSetQuitHandler (uintptr h); #endif @@ -138,11 +147,18 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __COPY(s, d, n) {char*_a=(void*)s,*_b=(void*)d; LONGINT _i=0,_t=n-1; \ while(_i<_t&&((_b[_i]=_a[_i])!=0)){_i++;};_b[_i]=0;} -#define __DUP(x, l, t) x=(void*)memcpy((void*)(SYSTEM_ADRINT)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) +#define __DUP(x, l, t) x=(void*)memcpy((void*)(uintptr)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) #define __DUPARR(v, t) v=(void*)memcpy(v##__copy,v,sizeof(t)) -#define __DEL(x) Platform_OSFree((LONGINT)(SYSTEM_ADRINT)x) +#define __DEL(x) Platform_OSFree((LONGINT)(uintptr)x) +// Index and range checks + +#define __X(i, ub) (((uint64)(i)<(uint64)(ub))?i:(__HALT(-2),0)) +#define __XF(i, ub) SYSTEM_XCHK((uint64)(i), (uint64)(ub)) + +#define __R(i, ub) (((uint64)(i)<(uint64)(ub))?i:(__HALT(-8),0)) +#define __RF(i, ub) SYSTEM_RCHK((uint64)(i),(uint64)(ub)) /* SYSTEM ops */ @@ -150,24 +166,24 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __VAL(t, x) (*(t*)&(x)) -#define __GET(a, x, t) x= *(t*)(SYSTEM_ADRINT)(a) -#define __PUT(a, x, t) *(t*)(SYSTEM_ADRINT)(a)=x +#define __GET(a, x, t) x= *(t*)(uintptr)(a) +#define __PUT(a, x, t) *(t*)(uintptr)(a)=x #define __LSHL(x, n, t) ((t)((u##t)(x)<<(n))) #define __LSHR(x, n, t) ((t)((u##t)(x)>>(n))) #define __LSH(x, n, t) ((n)>=0? __LSHL(x, n, t): __LSHR(x, -(n), t)) -#define __ASHL(x, n) ((LONGINT)(x)<<(n)) -#define __ASHR(x, n) ((LONGINT)(x)>>(n)) -#define __ASH(x, n) ((n)>=0?__ASHL(x,n):__ASHR(x,-(n))) - #define __ROTL(x, n, t) ((t)((u##t)(x)<<(n)|(u##t)(x)>>(8*sizeof(t)-(n)))) #define __ROTR(x, n, t) ((t)((u##t)(x)>>(n)|(u##t)(x)<<(8*sizeof(t)-(n)))) #define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) -#define __BIT(x, n) (*(uLONGINT*)(x)>>(n)&1) -#define __MOVE(s, d, n) memcpy((char*)(SYSTEM_ADRINT)(d),(char*)(SYSTEM_ADRINT)(s),n) +#define __ASHL(x, n) ((LONGINT)(x)<<(n)) +#define __ASHR(x, n) ((LONGINT)(x)>>(n)) +#define __ASH(x, n) ((n)>=0?__ASHL(x,n):__ASHR(x,-(n))) #define __ASHF(x, n) SYSTEM_ASH((LONGINT)(x), (LONGINT)(n)) + +#define __BIT(x, n) (*(uint64*)(x)>>(n)&1) +#define __MOVE(s, d, n) memcpy((char*)(uintptr)(d),(char*)(uintptr)(s),n) #define __SHORT(x, y) ((int)((uLONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) #define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) #define __CHR(x) ((CHAR)__R(x, 256)) @@ -191,10 +207,6 @@ static int __str_cmp(CHAR *x, CHAR *y){ // Runtime checks -#define __X(i, ub) (((uLONGINT)(i)<(uLONGINT)(ub))?i:(__HALT(-2),0)) -#define __XF(i, ub) SYSTEM_XCHK((LONGINT)(i), (LONGINT)(ub)) -#define __R(i, ub) (((uLONGINT)(i)<(uLONGINT)(ub))?i:(__HALT(-8),0)) -#define __RF(i, ub) SYSTEM_RCHK((LONGINT)(i),(LONGINT)(ub)) #define __RETCHK __retchk: __HALT(-3); return 0; #define __CASECHK __HALT(-4) #define __WITHCHK __HALT(-7) @@ -227,7 +239,7 @@ extern void Heap_INCREF(); extern void Platform_Init(INTEGER argc, LONGINT argv); extern void Heap_FINALL(); -#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (LONGINT)(SYSTEM_ADRINT)&argv); +#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (LONGINT)(uintptr)&argv); #define __REGMAIN(name, enum) m = Heap_REGMOD((CHAR*)name,enum) #define __FINI Heap_FINALL(); return 0 @@ -248,7 +260,7 @@ extern SYSTEM_PTR Heap_NEWREC (LONGINT tag); extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __SYSNEW(p, len) p = Heap_NEWBLK((LONGINT)(len)) -#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(SYSTEM_ADRINT)t##__typ) +#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(uintptr)t##__typ) #define __NEWARR SYSTEM_NEWARR @@ -279,20 +291,20 @@ extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __INITYP(t, t0, level) \ t##__typ = (LONGINT*)&t##__desc.blksz; \ memcpy(t##__desc.basep, t0##__typ - __BASEOFF, level*sizeof(LONGINT)); \ - t##__desc.basep[level] = (LONGINT)(SYSTEM_ADRINT)t##__typ; \ - t##__desc.module = (LONGINT)(SYSTEM_ADRINT)m; \ + t##__desc.basep[level] = (LONGINT)(uintptr)t##__typ; \ + t##__desc.module = (LONGINT)(uintptr)m; \ if(t##__desc.blksz!=sizeof(struct t)) __HALT(-15); \ t##__desc.blksz = (t##__desc.blksz+5*sizeof(LONGINT)-1)/(4*sizeof(LONGINT))*(4*sizeof(LONGINT)); \ - Heap_REGTYP(m, (LONGINT)(SYSTEM_ADRINT)&t##__desc.next); \ + Heap_REGTYP(m, (LONGINT)(uintptr)&t##__desc.next); \ SYSTEM_INHERIT(t##__typ, t0##__typ) -#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(SYSTEM_ADRINT)typ##__typ) -#define __TYPEOF(p) ((LONGINT*)(SYSTEM_ADRINT)(*(((LONGINT*)(p))-1))) +#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(uintptr)typ##__typ) +#define __TYPEOF(p) ((LONGINT*)(uintptr)(*(((LONGINT*)(p))-1))) #define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) // Oberon-2 type bound procedures support -#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(SYSTEM_ADRINT)proc -#define __SEND(typ, num, funtyp, parlist) ((funtyp)((SYSTEM_ADRINT)*(typ-(__TPROC0OFF+num))))parlist +#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(uintptr)proc +#define __SEND(typ, num, funtyp, parlist) ((funtyp)((uintptr)*(typ-(__TPROC0OFF+num))))parlist diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index 6463db16..439a49e9 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index 07051628..681fcf1c 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index 8dea0639..e3516799 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Files.h" #include "Modules.h" diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index d946691c..b8f301f7 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/Vishap.c b/bootstrap/windows-48/Vishap.c index c8f81032..9224220a 100644 --- a/bootstrap/windows-48/Vishap.c +++ b/bootstrap/windows-48/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkamSf */ #include "SYSTEM.h" #include "Configuration.h" #include "Heap.h" @@ -81,7 +81,7 @@ static void Vishap_PropagateElementaryTypeSizes (void) OPT_realtyp->size = OPM_RealSize; OPT_inttyp->size = OPM_IntSize; OPT_linttyp->size = OPM_LIntSize; - OPT_ainttyp->size = OPM_PointerSize; + OPT_pinttyp->size = OPM_PointerSize; OPT_lrltyp->size = OPM_LRealSize; OPT_sinttyp->size = OPM_SIntSize; OPT_booltyp->size = OPM_BoolSize; diff --git a/bootstrap/windows-48/errors.c b/bootstrap/windows-48/errors.c index 3f916fe9..6e4f20e5 100644 --- a/bootstrap/windows-48/errors.c +++ b/bootstrap/windows-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/windows-48/errors.h b/bootstrap/windows-48/errors.h index 2afac320..f06c706d 100644 --- a/bootstrap/windows-48/errors.h +++ b/bootstrap/windows-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index b894b3f9..00be6a22 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index ca635519..9d9202c0 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/vt100.c b/bootstrap/windows-48/vt100.c index 46a1e460..8ca75a42 100644 --- a/bootstrap/windows-48/vt100.c +++ b/bootstrap/windows-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Strings.h" diff --git a/bootstrap/windows-48/vt100.h b/bootstrap/windows-48/vt100.h index ad1ac948..901eed38 100644 --- a/bootstrap/windows-48/vt100.h +++ b/bootstrap/windows-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index f4abd052..ea06c48a 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -14,6 +14,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/01] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/02] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index c756e930..1e741041 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Console.c b/bootstrap/windows-88/Console.c index 4331a772..7133027a 100644 --- a/bootstrap/windows-88/Console.c +++ b/bootstrap/windows-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Platform.h" diff --git a/bootstrap/windows-88/Console.h b/bootstrap/windows-88/Console.h index 987b5478..432a6e71 100644 --- a/bootstrap/windows-88/Console.h +++ b/bootstrap/windows-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 0c20d87b..7eae4cc4 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 918f272c..9a9b3b58 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index e96f7807..ba7f69f4 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tskSfF */ #define LARGE #include "SYSTEM.h" @@ -101,7 +101,7 @@ export void Heap_Unlock (void); extern void *Heap__init(); extern LONGINT Platform_MainStackFrame; -extern LONGINT Platform_OSAllocate(LONGINT size); +extern uintptr Platform_OSAllocate(uintptr size); #define Heap_FetchAddress(pointer) (LONGINT)(SYSTEM_ADRINT)(*((void**)((SYSTEM_ADRINT)pointer))) #define Heap_HeapModuleInit() Heap__init() #define Heap_OSAllocate(size) Platform_OSAllocate(size) diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index 40c921e4..e07b0d1e 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 5f85fd33..3cc9156d 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index d61c2889..f1bcc92f 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index 36f97a5d..ad99f16a 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index 61a0edcd..82eb03c4 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index 8310f854..f67c2556 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -201,8 +201,12 @@ void OPC_Ident (OPT_Object obj) } } } else if ((mode == 5 && obj->typ->form == 4)) { - OPM_WriteString((CHAR*)"int", 4); - OPM_WriteInt(__ASHL(obj->typ->size, 3)); + if (obj->typ == OPT_pinttyp || obj->typ == OPT_ainttyp) { + OPM_WriteString((CHAR*)"uintptr", 8); + } else { + OPM_WriteString((CHAR*)"int", 4); + OPM_WriteInt(__ASHL(obj->typ->size, 3)); + } } else { if (mode != 5 || obj->linkadr != 2) { if (mode == 13) { @@ -216,7 +220,7 @@ void OPC_Ident (OPT_Object obj) OPM_WriteStringVar((void*)OPM_modName, 32); } OPM_Write('_'); - } else if ((obj == OPT_sysptrtyp->strobj || obj == OPT_ainttyp->strobj) || obj == OPT_bytetyp->strobj) { + } else if (obj == OPT_sysptrtyp->strobj || obj == OPT_bytetyp->strobj) { OPM_WriteString((CHAR*)"SYSTEM_", 8); } OPM_WriteStringVar((void*)obj->name, 256); @@ -2081,6 +2085,7 @@ static void OPC_InitKeywords (void) Enter__49((CHAR*)"struct", 7); Enter__49((CHAR*)"switch", 7); Enter__49((CHAR*)"typedef", 8); + Enter__49((CHAR*)"uintptr", 8); Enter__49((CHAR*)"uint16", 7); Enter__49((CHAR*)"uint32", 7); Enter__49((CHAR*)"uint64", 7); diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index 3c5dedf4..42f6f30d 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index d4b582de..fb89bcd6 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index ccce7304..72257311 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index 78136a18..e270236a 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPB.h" diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index 863db6d6..9897c9c2 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index efd39a62..d07d06ca 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index c497e5c6..2aee5b21 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index 287c2ba6..6fd27531 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" @@ -84,7 +84,7 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; -export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_pinttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; export int8 OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; @@ -1768,6 +1768,7 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_sinttyp); P(OPT_inttyp); P(OPT_linttyp); + P(OPT_pinttyp); P(OPT_ainttyp); P(OPT_int8typ); P(OPT_int16typ); @@ -1850,6 +1851,7 @@ export void *OPT__init(void) OPT_InitStruct(&OPT_niltyp, 9); OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp); OPT_EnterTyp((CHAR*)"PTR", 11, OPM_PointerSize, &OPT_sysptrtyp); + OPT_EnterTyp((CHAR*)"UINTPTR", 4, OPM_PointerSize, &OPT_pinttyp); OPT_EnterTyp((CHAR*)"ADRINT", 4, OPM_PointerSize, &OPT_ainttyp); OPT_EnterTyp((CHAR*)"INT8", 4, 1, &OPT_int8typ); OPT_EnterTyp((CHAR*)"INT16", 4, 2, &OPT_int16typ); diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 808e8043..349849e8 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h @@ -68,7 +68,7 @@ typedef import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; -import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_pinttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; import int8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 5b1ffe19..d3aa0a87 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPC.h" @@ -286,6 +286,7 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_realtyp->strobj->linkadr = 2; OPT_inttyp->strobj->linkadr = 2; OPT_linttyp->strobj->linkadr = 2; + OPT_pinttyp->strobj->linkadr = 2; OPT_ainttyp->strobj->linkadr = 2; OPT_int8typ->strobj->linkadr = 2; OPT_int16typ->strobj->linkadr = 2; diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index 914ff060..09b50b36 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 2e9530e6..456a43cf 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index 13f60995..3691e5fb 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 5877bedc..d6e77abf 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index cf944612..2c04bec3 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/SYSTEM.c b/bootstrap/windows-88/SYSTEM.c index 9bc6b756..16681ab8 100644 --- a/bootstrap/windows-88/SYSTEM.c +++ b/bootstrap/windows-88/SYSTEM.c @@ -18,8 +18,11 @@ #include -LONGINT SYSTEM_XCHK(LONGINT i, LONGINT ub) {return __X(i, ub);} -LONGINT SYSTEM_RCHK(LONGINT i, LONGINT ub) {return __R(i, ub);} +// Procedure verions of SYSTEM.H versions used when a multiply accessed +// parameter has side effects. + +int64 SYSTEM_XCHK(uint64 i, uint64 ub) {return __X(i, ub);} +int64 SYSTEM_RCHK(uint64 i, uint64 ub) {return __R(i, ub);} LONGINT SYSTEM_ASH (LONGINT i, LONGINT n) {return __ASH(i, n);} LONGINT SYSTEM_ABS (LONGINT i) {return __ABS(i);} double SYSTEM_ABSD(double i) {return __ABS(i);} @@ -35,7 +38,7 @@ void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0) void SYSTEM_ENUMP(void *adr, LONGINT n, void (*P)()) { while (n > 0) { - P((LONGINT)(SYSTEM_ADRINT)(*((void**)(adr)))); + P((uintptr)(*((void**)(adr)))); adr = ((void**)adr) + 1; n--; } @@ -48,20 +51,20 @@ void SYSTEM_ENUMR(void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()) while (n > 0) { t = typ; off = *t; - while (off >= 0) {P(*(LONGINT*)((char*)adr+off)); t++; off = *t;} + while (off >= 0) {P(*(uintptr*)((char*)adr+off)); t++; off = *t;} adr = ((char*)adr) + size; n--; } } -LONGINT SYSTEM_DIV(uLONGINT x, uLONGINT y) -{ if ((LONGINT) x >= 0) return (x / y); +LONGINT SYSTEM_DIV(uint64 x, uint64 y) +{ if ((int64) x >= 0) return (x / y); else return -((y - 1 - x) / y); } -LONGINT SYSTEM_MOD(uLONGINT x, uLONGINT y) -{ uLONGINT m; - if ((LONGINT) x >= 0) return (x % y); +LONGINT SYSTEM_MOD(uint64 x, uint64 y) +{ uint64 m; + if ((int64) x >= 0) return (x % y); else { m = (-x) % y; if (m != 0) return (y - m); else return 0; } @@ -106,7 +109,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, else if (typ == (LONGINT*)POINTER__typ) { /* element type is a pointer */ x = Heap_NEWBLK(size + nofelems * sizeof(LONGINT)); - p = (LONGINT*)(SYSTEM_ADRINT)x[-1]; + p = (LONGINT*)(uintptr)x[-1]; p[-nofelems] = *p; /* build new type desc in situ: 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nofelems - 1; n = 1; /* n =1 for skipping the size field */ while (n <= nofelems) {*p = n*sizeof(LONGINT); p++; n++;} @@ -119,7 +122,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, while (ptab[nofptrs] >= 0) {nofptrs++;} /* number of pointers per element */ nptr = nofelems * nofptrs; /* total number of pointers */ x = Heap_NEWBLK(size + nptr * sizeof(LONGINT)); - p = (LONGINT*)(SYSTEM_ADRINT)x[- 1]; + p = (LONGINT*)(uintptr)x[- 1]; p[-nptr] = *p; /* build new type desc in situ; 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nptr - 1; n = 0; off = dataoff; while (n < nofelems) {i = 0; @@ -155,7 +158,7 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler // (Ignore other signals) } - void SystemSetHandler(int s, SYSTEM_ADRINT h) { + void SystemSetHandler(int s, uintptr h) { if (s >= 2 && s <= 4) { int needtosetsystemhandler = handler[s-2] == 0; handler[s-2] = (SystemSignalHandler)h; @@ -194,12 +197,12 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler } } - void SystemSetInterruptHandler(SYSTEM_ADRINT h) { + void SystemSetInterruptHandler(uintptr h) { EnsureConsoleCtrlHandler(); SystemInterruptHandler = (SystemSignalHandler)h; } - void SystemSetQuitHandler(SYSTEM_ADRINT h) { + void SystemSetQuitHandler(uintptr h) { EnsureConsoleCtrlHandler(); SystemQuitHandler = (SystemSignalHandler)h; } diff --git a/bootstrap/windows-88/SYSTEM.h b/bootstrap/windows-88/SYSTEM.h index 2cab2429..c83f69f1 100644 --- a/bootstrap/windows-88/SYSTEM.h +++ b/bootstrap/windows-88/SYSTEM.h @@ -1,6 +1,27 @@ #ifndef SYSTEM__h #define SYSTEM__h +// Declare memcpy in a way compatible with C compilers intrinsic +// built in implementations. + +#if (__SIZEOF_POINTER__ == 8) || defined(_WIN64) || defined(__LP64__) + #if defined(_WIN64) + typedef unsigned long long size_t; + #else + typedef unsigned long size_t; + #endif +#else + typedef unsigned int size_t; +#endif + +#define _SIZE_T_DECLARED // For FreeBSD +#define _SIZE_T_DEFINED_ // For OpenBSD + +void *memcpy(void *dest, const void *source, size_t size); + + +// Declare fixed size versions of basic intger types + #if defined(_WIN64) typedef long long int64; typedef unsigned long long uint64; @@ -18,20 +39,7 @@ typedef unsigned short int uint16; typedef signed char int8; typedef unsigned char uint8; -#if (__SIZEOF_POINTER__ == 8) || defined(_WIN64) || defined(__LP64__) - #if defined(_WIN64) - typedef unsigned long long size_t; - #else - typedef unsigned long size_t; - #endif -#else - typedef unsigned int size_t; -#endif - -#define _SIZE_T_DECLARED // For FreeBSD -#define _SIZE_T_DEFINED_ // For OpenBSD - -void *memcpy(void *dest, const void *source, size_t size); +#define uintptr size_t // The compiler uses 'import' and 'export' which translate to 'extern' and @@ -46,7 +54,7 @@ void *memcpy(void *dest, const void *source, size_t size); #define NIL ((void*)0) #define __MAXEXT 16 -#define POINTER__typ ((LONGINT*)(1)) // not NIL and not a valid type +#define POINTER__typ ((uintptr*)(1)) // not NIL and not a valid type // Oberon types @@ -60,7 +68,7 @@ typedef float REAL; typedef double LONGREAL; typedef void* SYSTEM_PTR; -typedef size_t SYSTEM_ADRINT; +typedef uintptr SYSTEM_ADRINT; // For 32 bit builds, the size of LONGINT depends on a make option: @@ -68,18 +76,19 @@ typedef size_t SYSTEM_ADRINT; #if (__SIZEOF_POINTER__ == 8) || defined(LARGE) || defined(_WIN64) typedef int32 INTEGER; typedef int64 LONGINT; - typedef uint64 uLONGINT; + typedef uint64 SET; + typedef uint64 uSET; #else typedef int16 INTEGER; typedef int32 LONGINT; - typedef uint32 uLONGINT; + typedef uint32 SET; + typedef uint32 uSET; #endif -// Unsigned variants are for use by shift and rotate macros. -typedef uLONGINT SET; -typedef uLONGINT uSET; +// Temporary defs while bootstrapping +#define uLONGINT uint64 @@ -90,32 +99,32 @@ typedef uLONGINT uSET; // OS Memory allocation interfaces are in PlatformXXX.Mod -extern LONGINT Platform_OSAllocate (LONGINT size); -extern void Platform_OSFree (LONGINT addr); +extern uintptr Platform_OSAllocate (uintptr size); +extern void Platform_OSFree (uintptr addr); // Run time system routines in SYSTEM.c -extern LONGINT SYSTEM_XCHK (LONGINT i, LONGINT ub); -extern LONGINT SYSTEM_RCHK (LONGINT i, LONGINT ub); +extern int64 SYSTEM_XCHK (uint64 i, uint64 ub); +extern int64 SYSTEM_RCHK (uint64 i, uint64 ub); extern LONGINT SYSTEM_ASH (LONGINT i, LONGINT n); extern LONGINT SYSTEM_ABS (LONGINT i); extern double SYSTEM_ABSD (double i); extern void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0); extern void SYSTEM_ENUMP (void *adr, LONGINT n, void (*P)()); extern void SYSTEM_ENUMR (void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()); -extern LONGINT SYSTEM_DIV (uLONGINT x, uLONGINT y); -extern LONGINT SYSTEM_MOD (uLONGINT x, uLONGINT y); +extern LONGINT SYSTEM_DIV (uint64 x, uint64 y); +extern LONGINT SYSTEM_MOD (uint64 x, uint64 y); extern LONGINT SYSTEM_ENTIER (double x); // Signal handling in SYSTEM.c #ifndef _WIN32 - extern void SystemSetHandler(int s, SYSTEM_ADRINT h); + extern void SystemSetHandler(int s, uintptr h); #else - extern void SystemSetInterruptHandler(SYSTEM_ADRINT h); - extern void SystemSetQuitHandler (SYSTEM_ADRINT h); + extern void SystemSetInterruptHandler(uintptr h); + extern void SystemSetQuitHandler (uintptr h); #endif @@ -138,11 +147,18 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __COPY(s, d, n) {char*_a=(void*)s,*_b=(void*)d; LONGINT _i=0,_t=n-1; \ while(_i<_t&&((_b[_i]=_a[_i])!=0)){_i++;};_b[_i]=0;} -#define __DUP(x, l, t) x=(void*)memcpy((void*)(SYSTEM_ADRINT)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) +#define __DUP(x, l, t) x=(void*)memcpy((void*)(uintptr)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) #define __DUPARR(v, t) v=(void*)memcpy(v##__copy,v,sizeof(t)) -#define __DEL(x) Platform_OSFree((LONGINT)(SYSTEM_ADRINT)x) +#define __DEL(x) Platform_OSFree((LONGINT)(uintptr)x) +// Index and range checks + +#define __X(i, ub) (((uint64)(i)<(uint64)(ub))?i:(__HALT(-2),0)) +#define __XF(i, ub) SYSTEM_XCHK((uint64)(i), (uint64)(ub)) + +#define __R(i, ub) (((uint64)(i)<(uint64)(ub))?i:(__HALT(-8),0)) +#define __RF(i, ub) SYSTEM_RCHK((uint64)(i),(uint64)(ub)) /* SYSTEM ops */ @@ -150,24 +166,24 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __VAL(t, x) (*(t*)&(x)) -#define __GET(a, x, t) x= *(t*)(SYSTEM_ADRINT)(a) -#define __PUT(a, x, t) *(t*)(SYSTEM_ADRINT)(a)=x +#define __GET(a, x, t) x= *(t*)(uintptr)(a) +#define __PUT(a, x, t) *(t*)(uintptr)(a)=x #define __LSHL(x, n, t) ((t)((u##t)(x)<<(n))) #define __LSHR(x, n, t) ((t)((u##t)(x)>>(n))) #define __LSH(x, n, t) ((n)>=0? __LSHL(x, n, t): __LSHR(x, -(n), t)) -#define __ASHL(x, n) ((LONGINT)(x)<<(n)) -#define __ASHR(x, n) ((LONGINT)(x)>>(n)) -#define __ASH(x, n) ((n)>=0?__ASHL(x,n):__ASHR(x,-(n))) - #define __ROTL(x, n, t) ((t)((u##t)(x)<<(n)|(u##t)(x)>>(8*sizeof(t)-(n)))) #define __ROTR(x, n, t) ((t)((u##t)(x)>>(n)|(u##t)(x)<<(8*sizeof(t)-(n)))) #define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) -#define __BIT(x, n) (*(uLONGINT*)(x)>>(n)&1) -#define __MOVE(s, d, n) memcpy((char*)(SYSTEM_ADRINT)(d),(char*)(SYSTEM_ADRINT)(s),n) +#define __ASHL(x, n) ((LONGINT)(x)<<(n)) +#define __ASHR(x, n) ((LONGINT)(x)>>(n)) +#define __ASH(x, n) ((n)>=0?__ASHL(x,n):__ASHR(x,-(n))) #define __ASHF(x, n) SYSTEM_ASH((LONGINT)(x), (LONGINT)(n)) + +#define __BIT(x, n) (*(uint64*)(x)>>(n)&1) +#define __MOVE(s, d, n) memcpy((char*)(uintptr)(d),(char*)(uintptr)(s),n) #define __SHORT(x, y) ((int)((uLONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) #define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) #define __CHR(x) ((CHAR)__R(x, 256)) @@ -191,10 +207,6 @@ static int __str_cmp(CHAR *x, CHAR *y){ // Runtime checks -#define __X(i, ub) (((uLONGINT)(i)<(uLONGINT)(ub))?i:(__HALT(-2),0)) -#define __XF(i, ub) SYSTEM_XCHK((LONGINT)(i), (LONGINT)(ub)) -#define __R(i, ub) (((uLONGINT)(i)<(uLONGINT)(ub))?i:(__HALT(-8),0)) -#define __RF(i, ub) SYSTEM_RCHK((LONGINT)(i),(LONGINT)(ub)) #define __RETCHK __retchk: __HALT(-3); return 0; #define __CASECHK __HALT(-4) #define __WITHCHK __HALT(-7) @@ -227,7 +239,7 @@ extern void Heap_INCREF(); extern void Platform_Init(INTEGER argc, LONGINT argv); extern void Heap_FINALL(); -#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (LONGINT)(SYSTEM_ADRINT)&argv); +#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (LONGINT)(uintptr)&argv); #define __REGMAIN(name, enum) m = Heap_REGMOD((CHAR*)name,enum) #define __FINI Heap_FINALL(); return 0 @@ -248,7 +260,7 @@ extern SYSTEM_PTR Heap_NEWREC (LONGINT tag); extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __SYSNEW(p, len) p = Heap_NEWBLK((LONGINT)(len)) -#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(SYSTEM_ADRINT)t##__typ) +#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(uintptr)t##__typ) #define __NEWARR SYSTEM_NEWARR @@ -279,20 +291,20 @@ extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __INITYP(t, t0, level) \ t##__typ = (LONGINT*)&t##__desc.blksz; \ memcpy(t##__desc.basep, t0##__typ - __BASEOFF, level*sizeof(LONGINT)); \ - t##__desc.basep[level] = (LONGINT)(SYSTEM_ADRINT)t##__typ; \ - t##__desc.module = (LONGINT)(SYSTEM_ADRINT)m; \ + t##__desc.basep[level] = (LONGINT)(uintptr)t##__typ; \ + t##__desc.module = (LONGINT)(uintptr)m; \ if(t##__desc.blksz!=sizeof(struct t)) __HALT(-15); \ t##__desc.blksz = (t##__desc.blksz+5*sizeof(LONGINT)-1)/(4*sizeof(LONGINT))*(4*sizeof(LONGINT)); \ - Heap_REGTYP(m, (LONGINT)(SYSTEM_ADRINT)&t##__desc.next); \ + Heap_REGTYP(m, (LONGINT)(uintptr)&t##__desc.next); \ SYSTEM_INHERIT(t##__typ, t0##__typ) -#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(SYSTEM_ADRINT)typ##__typ) -#define __TYPEOF(p) ((LONGINT*)(SYSTEM_ADRINT)(*(((LONGINT*)(p))-1))) +#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(uintptr)typ##__typ) +#define __TYPEOF(p) ((LONGINT*)(uintptr)(*(((LONGINT*)(p))-1))) #define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) // Oberon-2 type bound procedures support -#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(SYSTEM_ADRINT)proc -#define __SEND(typ, num, funtyp, parlist) ((funtyp)((SYSTEM_ADRINT)*(typ-(__TPROC0OFF+num))))parlist +#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(uintptr)proc +#define __SEND(typ, num, funtyp, parlist) ((funtyp)((uintptr)*(typ-(__TPROC0OFF+num))))parlist diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index 85e9fca9..769cecb7 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index d703f8c0..012e77f9 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index 0c5cb89c..934bc227 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Files.h" diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index 2e48fe94..fbd8a7a4 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/Vishap.c b/bootstrap/windows-88/Vishap.c index c313eb20..f781d7ee 100644 --- a/bootstrap/windows-88/Vishap.c +++ b/bootstrap/windows-88/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkamSf */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -82,7 +82,7 @@ static void Vishap_PropagateElementaryTypeSizes (void) OPT_realtyp->size = OPM_RealSize; OPT_inttyp->size = OPM_IntSize; OPT_linttyp->size = OPM_LIntSize; - OPT_ainttyp->size = OPM_PointerSize; + OPT_pinttyp->size = OPM_PointerSize; OPT_lrltyp->size = OPM_LRealSize; OPT_sinttyp->size = OPM_SIntSize; OPT_booltyp->size = OPM_BoolSize; diff --git a/bootstrap/windows-88/errors.c b/bootstrap/windows-88/errors.c index dc5320bb..b1aa1639 100644 --- a/bootstrap/windows-88/errors.c +++ b/bootstrap/windows-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/windows-88/errors.h b/bootstrap/windows-88/errors.h index d15a472c..049c862a 100644 --- a/bootstrap/windows-88/errors.h +++ b/bootstrap/windows-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index bc32dc20..51975db4 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index 161e273a..3cba883d 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/vt100.c b/bootstrap/windows-88/vt100.c index a757d25d..dfa8df9c 100644 --- a/bootstrap/windows-88/vt100.c +++ b/bootstrap/windows-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/windows-88/vt100.h b/bootstrap/windows-88/vt100.h index fb8a12d0..139b592e 100644 --- a/bootstrap/windows-88/vt100.h +++ b/bootstrap/windows-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/makefile b/makefile index eee8238a..3840589a 100644 --- a/makefile +++ b/makefile @@ -158,6 +158,9 @@ full: configuration +assemble: + @make -f src/tools/make/vishap.make -s assemble + # compile: compiler only, without cleaning compiler: configuration @@ -244,6 +247,14 @@ bootstrap: configuration make -f src/tools/make/vishap.make -s translate INTSIZE=4 ADRSIZE=8 ALIGNMENT=8 PLATFORM=windows BUILDDIR=bootstrap/windows-88 && rm bootstrap/windows-88/*.sym +bootstrapunclean: + rm -rf bootstrap/* + make -f src/tools/make/vishap.make -s translate INTSIZE=2 ADRSIZE=4 ALIGNMENT=4 PLATFORM=unix BUILDDIR=bootstrap/unix-44 && rm bootstrap/unix-44/*.sym + make -f src/tools/make/vishap.make -s translate INTSIZE=2 ADRSIZE=4 ALIGNMENT=8 PLATFORM=unix BUILDDIR=bootstrap/unix-48 && rm bootstrap/unix-48/*.sym + make -f src/tools/make/vishap.make -s translate INTSIZE=4 ADRSIZE=8 ALIGNMENT=8 PLATFORM=unix BUILDDIR=bootstrap/unix-88 && rm bootstrap/unix-88/*.sym + make -f src/tools/make/vishap.make -s translate INTSIZE=2 ADRSIZE=4 ALIGNMENT=8 PLATFORM=windows BUILDDIR=bootstrap/windows-48 && rm bootstrap/windows-48/*.sym + make -f src/tools/make/vishap.make -s translate INTSIZE=4 ADRSIZE=8 ALIGNMENT=8 PLATFORM=windows BUILDDIR=bootstrap/windows-88 && rm bootstrap/windows-88/*.sym + revertbootstrap: diff --git a/src/compiler/OPC.Mod b/src/compiler/OPC.Mod index e51f9704..5b4f9195 100644 --- a/src/compiler/OPC.Mod +++ b/src/compiler/OPC.Mod @@ -7,7 +7,6 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) IMPORT OPT, OPM, Configuration, SYSTEM; - CONST demoVersion = FALSE; @@ -118,7 +117,11 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) IF keytab[hashtab[h]] = obj^.name THEN OPM.Write('_') END END ELSIF (mode = OPT.Typ) & (obj.typ.form = OPT.Int) THEN - OPM.WriteString("int"); OPM.WriteInt(obj.typ.size*8) + IF (obj.typ = OPT.pinttyp) OR (obj.typ = OPT.ainttyp) THEN + OPM.WriteString("uintptr") + ELSE + OPM.WriteString("int"); OPM.WriteInt(obj.typ.size*8) + END ELSE IF (mode # OPT.Typ) OR (obj^.linkadr # PredefinedType) THEN IF mode = OPT.TProc THEN Ident(obj^.link^.typ^.strobj) @@ -129,7 +132,6 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) END ; OPM.Write('_') ELSIF (obj = OPT.sysptrtyp^.strobj) - OR (obj = OPT.ainttyp^.strobj) OR (obj = OPT.bytetyp^.strobj) THEN OPM.WriteString("SYSTEM_") END; @@ -1357,6 +1359,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) Enter("struct"); Enter("switch"); Enter("typedef"); + Enter("uintptr"); (* pseudo keyword used by voc *) Enter("uint16"); (* pseudo keyword used by voc *) Enter("uint32"); (* pseudo keyword used by voc *) Enter("uint64"); (* pseudo keyword used by voc *) diff --git a/src/compiler/OPT.Mod b/src/compiler/OPT.Mod index a60f30f8..135d1016 100644 --- a/src/compiler/OPT.Mod +++ b/src/compiler/OPT.Mod @@ -155,7 +155,7 @@ VAR undftyp*, bytetyp*, booltyp*, chartyp*, sinttyp*, inttyp*, linttyp*, - ainttyp*, + pinttyp*, ainttyp*, int8typ*, int16typ*, int32typ*, int64typ*, realtyp*, lrltyp*, settyp*, stringtyp*, niltyp*, notyp*, sysptrtyp*: Struct; @@ -1186,13 +1186,14 @@ BEGIN topScope := NIL; OpenScope(0, NIL); OPM.errpos := 0; InitStruct(niltyp, NilTyp); (*initialization of module SYSTEM*) - EnterTyp("BYTE", Byte, OPM.ByteSize, bytetyp); - EnterTyp("PTR", Pointer, OPM.PointerSize, sysptrtyp); - EnterTyp("ADRINT", Int, OPM.PointerSize, ainttyp); - EnterTyp("INT8", Int, 1, int8typ); - EnterTyp("INT16", Int, 2, int16typ); - EnterTyp("INT32", Int, 4, int32typ); - EnterTyp("INT64", Int, 8, int64typ); + EnterTyp("BYTE", Byte, OPM.ByteSize, bytetyp); + EnterTyp("PTR", Pointer, OPM.PointerSize, sysptrtyp); + EnterTyp("UINTPTR", Int, OPM.PointerSize, pinttyp); + EnterTyp("ADRINT", Int, OPM.PointerSize, ainttyp); (* Temporary for bootstrapping *) + EnterTyp("INT8", Int, 1, int8typ); + EnterTyp("INT16", Int, 2, int16typ); + EnterTyp("INT32", Int, 4, int32typ); + EnterTyp("INT64", Int, 8, int64typ); EnterProc("ADR", adrfn); EnterProc("CC", ccfn); EnterProc("LSH", lshfn); diff --git a/src/compiler/OPV.Mod b/src/compiler/OPV.Mod index 089cd5e1..e23a89ad 100644 --- a/src/compiler/OPV.Mod +++ b/src/compiler/OPV.Mod @@ -205,6 +205,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 OPT.realtyp^.strobj^.linkadr := PredefinedType; OPT.inttyp^.strobj^.linkadr := PredefinedType; OPT.linttyp^.strobj^.linkadr := PredefinedType; + OPT.pinttyp^.strobj^.linkadr := PredefinedType; OPT.ainttyp^.strobj^.linkadr := PredefinedType; OPT.int8typ^.strobj^.linkadr := PredefinedType; OPT.int16typ^.strobj^.linkadr := PredefinedType; diff --git a/src/compiler/Vishap.Mod b/src/compiler/Vishap.Mod index 6d306e5e..615a032c 100644 --- a/src/compiler/Vishap.Mod +++ b/src/compiler/Vishap.Mod @@ -58,7 +58,7 @@ MODULE Vishap; (* J. Templ 3.2.95 *) OPT.realtyp.size := OPM.RealSize; OPT.inttyp.size := OPM.IntSize; OPT.linttyp.size := OPM.LIntSize; - OPT.ainttyp.size := OPM.PointerSize; + OPT.pinttyp.size := OPM.PointerSize; OPT.lrltyp.size := OPM.LRealSize; OPT.sinttyp.size := OPM.SIntSize; OPT.booltyp.size := OPM.BoolSize diff --git a/src/system/Heap.Mod b/src/system/Heap.Mod index 5acbb04e..619daf53 100644 --- a/src/system/Heap.Mod +++ b/src/system/Heap.Mod @@ -162,8 +162,8 @@ MODULE Heap; END INCREF; - PROCEDURE -ExternPlatformOSAllocate "extern LONGINT Platform_OSAllocate(LONGINT size);"; - PROCEDURE -OSAllocate(size: LONGINT): LONGINT "Platform_OSAllocate(size)"; + PROCEDURE -ExternPlatformOSAllocate "extern uintptr Platform_OSAllocate(uintptr size);"; + PROCEDURE -OSAllocate(size: SYSTEM.UINTPTR): SYSTEM.UINTPTR "Platform_OSAllocate(size)"; PROCEDURE NewChunk(blksz: LONGINT): LONGINT; VAR chnk: LONGINT; diff --git a/src/system/Platformunix.Mod b/src/system/Platformunix.Mod index a55e1130..34ee60b6 100644 --- a/src/system/Platformunix.Mod +++ b/src/system/Platformunix.Mod @@ -27,13 +27,13 @@ TYPE VAR LittleEndian-: BOOLEAN; - MainStackFrame-: LONGINT; + MainStackFrame-: SYSTEM.ADRINT; HaltCode-: LONGINT; PID-: INTEGER; (* Note: Must be updated by Fork implementation *) CWD-: ARRAY 256 OF CHAR; ArgCount-: INTEGER; - ArgVector-: LONGINT; + ArgVector-: SYSTEM.ADRINT; HaltHandler: HaltProcedure; TimeStart: LONGINT; @@ -106,11 +106,11 @@ BEGIN RETURN (e = ECONNREFUSED()) OR (e = ECONNABORTED()) (* OS memory allocaton *) -PROCEDURE -allocate(size: LONGINT): LONGINT "(LONGINT)(SYSTEM_ADRINT)((void*)malloc((size_t)size))"; -PROCEDURE OSAllocate*(size: LONGINT): LONGINT; BEGIN RETURN allocate(size) END OSAllocate; +PROCEDURE -allocate (size: SYSTEM.UINTPTR): SYSTEM.UINTPTR "(uintptr)((void*)malloc((size_t)size))"; +PROCEDURE OSAllocate*(size: SYSTEM.UINTPTR): SYSTEM.UINTPTR; BEGIN RETURN allocate(size) END OSAllocate; -PROCEDURE -free(address: LONGINT) "free((void*)(SYSTEM_ADRINT)address)"; -PROCEDURE OSFree*(address: LONGINT); BEGIN free(address) END OSFree; +PROCEDURE -free(address: SYSTEM.UINTPTR) "free((void*)address)"; +PROCEDURE OSFree*(address: SYSTEM.UINTPTR); BEGIN free(address) END OSFree; diff --git a/src/system/SYSTEM.c b/src/system/SYSTEM.c index 9bc6b756..16681ab8 100644 --- a/src/system/SYSTEM.c +++ b/src/system/SYSTEM.c @@ -18,8 +18,11 @@ #include -LONGINT SYSTEM_XCHK(LONGINT i, LONGINT ub) {return __X(i, ub);} -LONGINT SYSTEM_RCHK(LONGINT i, LONGINT ub) {return __R(i, ub);} +// Procedure verions of SYSTEM.H versions used when a multiply accessed +// parameter has side effects. + +int64 SYSTEM_XCHK(uint64 i, uint64 ub) {return __X(i, ub);} +int64 SYSTEM_RCHK(uint64 i, uint64 ub) {return __R(i, ub);} LONGINT SYSTEM_ASH (LONGINT i, LONGINT n) {return __ASH(i, n);} LONGINT SYSTEM_ABS (LONGINT i) {return __ABS(i);} double SYSTEM_ABSD(double i) {return __ABS(i);} @@ -35,7 +38,7 @@ void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0) void SYSTEM_ENUMP(void *adr, LONGINT n, void (*P)()) { while (n > 0) { - P((LONGINT)(SYSTEM_ADRINT)(*((void**)(adr)))); + P((uintptr)(*((void**)(adr)))); adr = ((void**)adr) + 1; n--; } @@ -48,20 +51,20 @@ void SYSTEM_ENUMR(void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()) while (n > 0) { t = typ; off = *t; - while (off >= 0) {P(*(LONGINT*)((char*)adr+off)); t++; off = *t;} + while (off >= 0) {P(*(uintptr*)((char*)adr+off)); t++; off = *t;} adr = ((char*)adr) + size; n--; } } -LONGINT SYSTEM_DIV(uLONGINT x, uLONGINT y) -{ if ((LONGINT) x >= 0) return (x / y); +LONGINT SYSTEM_DIV(uint64 x, uint64 y) +{ if ((int64) x >= 0) return (x / y); else return -((y - 1 - x) / y); } -LONGINT SYSTEM_MOD(uLONGINT x, uLONGINT y) -{ uLONGINT m; - if ((LONGINT) x >= 0) return (x % y); +LONGINT SYSTEM_MOD(uint64 x, uint64 y) +{ uint64 m; + if ((int64) x >= 0) return (x % y); else { m = (-x) % y; if (m != 0) return (y - m); else return 0; } @@ -106,7 +109,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, else if (typ == (LONGINT*)POINTER__typ) { /* element type is a pointer */ x = Heap_NEWBLK(size + nofelems * sizeof(LONGINT)); - p = (LONGINT*)(SYSTEM_ADRINT)x[-1]; + p = (LONGINT*)(uintptr)x[-1]; p[-nofelems] = *p; /* build new type desc in situ: 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nofelems - 1; n = 1; /* n =1 for skipping the size field */ while (n <= nofelems) {*p = n*sizeof(LONGINT); p++; n++;} @@ -119,7 +122,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, while (ptab[nofptrs] >= 0) {nofptrs++;} /* number of pointers per element */ nptr = nofelems * nofptrs; /* total number of pointers */ x = Heap_NEWBLK(size + nptr * sizeof(LONGINT)); - p = (LONGINT*)(SYSTEM_ADRINT)x[- 1]; + p = (LONGINT*)(uintptr)x[- 1]; p[-nptr] = *p; /* build new type desc in situ; 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nptr - 1; n = 0; off = dataoff; while (n < nofelems) {i = 0; @@ -155,7 +158,7 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler // (Ignore other signals) } - void SystemSetHandler(int s, SYSTEM_ADRINT h) { + void SystemSetHandler(int s, uintptr h) { if (s >= 2 && s <= 4) { int needtosetsystemhandler = handler[s-2] == 0; handler[s-2] = (SystemSignalHandler)h; @@ -194,12 +197,12 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler } } - void SystemSetInterruptHandler(SYSTEM_ADRINT h) { + void SystemSetInterruptHandler(uintptr h) { EnsureConsoleCtrlHandler(); SystemInterruptHandler = (SystemSignalHandler)h; } - void SystemSetQuitHandler(SYSTEM_ADRINT h) { + void SystemSetQuitHandler(uintptr h) { EnsureConsoleCtrlHandler(); SystemQuitHandler = (SystemSignalHandler)h; } diff --git a/src/system/SYSTEM.h b/src/system/SYSTEM.h index 2cab2429..c83f69f1 100644 --- a/src/system/SYSTEM.h +++ b/src/system/SYSTEM.h @@ -1,6 +1,27 @@ #ifndef SYSTEM__h #define SYSTEM__h +// Declare memcpy in a way compatible with C compilers intrinsic +// built in implementations. + +#if (__SIZEOF_POINTER__ == 8) || defined(_WIN64) || defined(__LP64__) + #if defined(_WIN64) + typedef unsigned long long size_t; + #else + typedef unsigned long size_t; + #endif +#else + typedef unsigned int size_t; +#endif + +#define _SIZE_T_DECLARED // For FreeBSD +#define _SIZE_T_DEFINED_ // For OpenBSD + +void *memcpy(void *dest, const void *source, size_t size); + + +// Declare fixed size versions of basic intger types + #if defined(_WIN64) typedef long long int64; typedef unsigned long long uint64; @@ -18,20 +39,7 @@ typedef unsigned short int uint16; typedef signed char int8; typedef unsigned char uint8; -#if (__SIZEOF_POINTER__ == 8) || defined(_WIN64) || defined(__LP64__) - #if defined(_WIN64) - typedef unsigned long long size_t; - #else - typedef unsigned long size_t; - #endif -#else - typedef unsigned int size_t; -#endif - -#define _SIZE_T_DECLARED // For FreeBSD -#define _SIZE_T_DEFINED_ // For OpenBSD - -void *memcpy(void *dest, const void *source, size_t size); +#define uintptr size_t // The compiler uses 'import' and 'export' which translate to 'extern' and @@ -46,7 +54,7 @@ void *memcpy(void *dest, const void *source, size_t size); #define NIL ((void*)0) #define __MAXEXT 16 -#define POINTER__typ ((LONGINT*)(1)) // not NIL and not a valid type +#define POINTER__typ ((uintptr*)(1)) // not NIL and not a valid type // Oberon types @@ -60,7 +68,7 @@ typedef float REAL; typedef double LONGREAL; typedef void* SYSTEM_PTR; -typedef size_t SYSTEM_ADRINT; +typedef uintptr SYSTEM_ADRINT; // For 32 bit builds, the size of LONGINT depends on a make option: @@ -68,18 +76,19 @@ typedef size_t SYSTEM_ADRINT; #if (__SIZEOF_POINTER__ == 8) || defined(LARGE) || defined(_WIN64) typedef int32 INTEGER; typedef int64 LONGINT; - typedef uint64 uLONGINT; + typedef uint64 SET; + typedef uint64 uSET; #else typedef int16 INTEGER; typedef int32 LONGINT; - typedef uint32 uLONGINT; + typedef uint32 SET; + typedef uint32 uSET; #endif -// Unsigned variants are for use by shift and rotate macros. -typedef uLONGINT SET; -typedef uLONGINT uSET; +// Temporary defs while bootstrapping +#define uLONGINT uint64 @@ -90,32 +99,32 @@ typedef uLONGINT uSET; // OS Memory allocation interfaces are in PlatformXXX.Mod -extern LONGINT Platform_OSAllocate (LONGINT size); -extern void Platform_OSFree (LONGINT addr); +extern uintptr Platform_OSAllocate (uintptr size); +extern void Platform_OSFree (uintptr addr); // Run time system routines in SYSTEM.c -extern LONGINT SYSTEM_XCHK (LONGINT i, LONGINT ub); -extern LONGINT SYSTEM_RCHK (LONGINT i, LONGINT ub); +extern int64 SYSTEM_XCHK (uint64 i, uint64 ub); +extern int64 SYSTEM_RCHK (uint64 i, uint64 ub); extern LONGINT SYSTEM_ASH (LONGINT i, LONGINT n); extern LONGINT SYSTEM_ABS (LONGINT i); extern double SYSTEM_ABSD (double i); extern void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0); extern void SYSTEM_ENUMP (void *adr, LONGINT n, void (*P)()); extern void SYSTEM_ENUMR (void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()); -extern LONGINT SYSTEM_DIV (uLONGINT x, uLONGINT y); -extern LONGINT SYSTEM_MOD (uLONGINT x, uLONGINT y); +extern LONGINT SYSTEM_DIV (uint64 x, uint64 y); +extern LONGINT SYSTEM_MOD (uint64 x, uint64 y); extern LONGINT SYSTEM_ENTIER (double x); // Signal handling in SYSTEM.c #ifndef _WIN32 - extern void SystemSetHandler(int s, SYSTEM_ADRINT h); + extern void SystemSetHandler(int s, uintptr h); #else - extern void SystemSetInterruptHandler(SYSTEM_ADRINT h); - extern void SystemSetQuitHandler (SYSTEM_ADRINT h); + extern void SystemSetInterruptHandler(uintptr h); + extern void SystemSetQuitHandler (uintptr h); #endif @@ -138,11 +147,18 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __COPY(s, d, n) {char*_a=(void*)s,*_b=(void*)d; LONGINT _i=0,_t=n-1; \ while(_i<_t&&((_b[_i]=_a[_i])!=0)){_i++;};_b[_i]=0;} -#define __DUP(x, l, t) x=(void*)memcpy((void*)(SYSTEM_ADRINT)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) +#define __DUP(x, l, t) x=(void*)memcpy((void*)(uintptr)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) #define __DUPARR(v, t) v=(void*)memcpy(v##__copy,v,sizeof(t)) -#define __DEL(x) Platform_OSFree((LONGINT)(SYSTEM_ADRINT)x) +#define __DEL(x) Platform_OSFree((LONGINT)(uintptr)x) +// Index and range checks + +#define __X(i, ub) (((uint64)(i)<(uint64)(ub))?i:(__HALT(-2),0)) +#define __XF(i, ub) SYSTEM_XCHK((uint64)(i), (uint64)(ub)) + +#define __R(i, ub) (((uint64)(i)<(uint64)(ub))?i:(__HALT(-8),0)) +#define __RF(i, ub) SYSTEM_RCHK((uint64)(i),(uint64)(ub)) /* SYSTEM ops */ @@ -150,24 +166,24 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __VAL(t, x) (*(t*)&(x)) -#define __GET(a, x, t) x= *(t*)(SYSTEM_ADRINT)(a) -#define __PUT(a, x, t) *(t*)(SYSTEM_ADRINT)(a)=x +#define __GET(a, x, t) x= *(t*)(uintptr)(a) +#define __PUT(a, x, t) *(t*)(uintptr)(a)=x #define __LSHL(x, n, t) ((t)((u##t)(x)<<(n))) #define __LSHR(x, n, t) ((t)((u##t)(x)>>(n))) #define __LSH(x, n, t) ((n)>=0? __LSHL(x, n, t): __LSHR(x, -(n), t)) -#define __ASHL(x, n) ((LONGINT)(x)<<(n)) -#define __ASHR(x, n) ((LONGINT)(x)>>(n)) -#define __ASH(x, n) ((n)>=0?__ASHL(x,n):__ASHR(x,-(n))) - #define __ROTL(x, n, t) ((t)((u##t)(x)<<(n)|(u##t)(x)>>(8*sizeof(t)-(n)))) #define __ROTR(x, n, t) ((t)((u##t)(x)>>(n)|(u##t)(x)<<(8*sizeof(t)-(n)))) #define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) -#define __BIT(x, n) (*(uLONGINT*)(x)>>(n)&1) -#define __MOVE(s, d, n) memcpy((char*)(SYSTEM_ADRINT)(d),(char*)(SYSTEM_ADRINT)(s),n) +#define __ASHL(x, n) ((LONGINT)(x)<<(n)) +#define __ASHR(x, n) ((LONGINT)(x)>>(n)) +#define __ASH(x, n) ((n)>=0?__ASHL(x,n):__ASHR(x,-(n))) #define __ASHF(x, n) SYSTEM_ASH((LONGINT)(x), (LONGINT)(n)) + +#define __BIT(x, n) (*(uint64*)(x)>>(n)&1) +#define __MOVE(s, d, n) memcpy((char*)(uintptr)(d),(char*)(uintptr)(s),n) #define __SHORT(x, y) ((int)((uLONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) #define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) #define __CHR(x) ((CHAR)__R(x, 256)) @@ -191,10 +207,6 @@ static int __str_cmp(CHAR *x, CHAR *y){ // Runtime checks -#define __X(i, ub) (((uLONGINT)(i)<(uLONGINT)(ub))?i:(__HALT(-2),0)) -#define __XF(i, ub) SYSTEM_XCHK((LONGINT)(i), (LONGINT)(ub)) -#define __R(i, ub) (((uLONGINT)(i)<(uLONGINT)(ub))?i:(__HALT(-8),0)) -#define __RF(i, ub) SYSTEM_RCHK((LONGINT)(i),(LONGINT)(ub)) #define __RETCHK __retchk: __HALT(-3); return 0; #define __CASECHK __HALT(-4) #define __WITHCHK __HALT(-7) @@ -227,7 +239,7 @@ extern void Heap_INCREF(); extern void Platform_Init(INTEGER argc, LONGINT argv); extern void Heap_FINALL(); -#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (LONGINT)(SYSTEM_ADRINT)&argv); +#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (LONGINT)(uintptr)&argv); #define __REGMAIN(name, enum) m = Heap_REGMOD((CHAR*)name,enum) #define __FINI Heap_FINALL(); return 0 @@ -248,7 +260,7 @@ extern SYSTEM_PTR Heap_NEWREC (LONGINT tag); extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __SYSNEW(p, len) p = Heap_NEWBLK((LONGINT)(len)) -#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(SYSTEM_ADRINT)t##__typ) +#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(uintptr)t##__typ) #define __NEWARR SYSTEM_NEWARR @@ -279,20 +291,20 @@ extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __INITYP(t, t0, level) \ t##__typ = (LONGINT*)&t##__desc.blksz; \ memcpy(t##__desc.basep, t0##__typ - __BASEOFF, level*sizeof(LONGINT)); \ - t##__desc.basep[level] = (LONGINT)(SYSTEM_ADRINT)t##__typ; \ - t##__desc.module = (LONGINT)(SYSTEM_ADRINT)m; \ + t##__desc.basep[level] = (LONGINT)(uintptr)t##__typ; \ + t##__desc.module = (LONGINT)(uintptr)m; \ if(t##__desc.blksz!=sizeof(struct t)) __HALT(-15); \ t##__desc.blksz = (t##__desc.blksz+5*sizeof(LONGINT)-1)/(4*sizeof(LONGINT))*(4*sizeof(LONGINT)); \ - Heap_REGTYP(m, (LONGINT)(SYSTEM_ADRINT)&t##__desc.next); \ + Heap_REGTYP(m, (LONGINT)(uintptr)&t##__desc.next); \ SYSTEM_INHERIT(t##__typ, t0##__typ) -#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(SYSTEM_ADRINT)typ##__typ) -#define __TYPEOF(p) ((LONGINT*)(SYSTEM_ADRINT)(*(((LONGINT*)(p))-1))) +#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(uintptr)typ##__typ) +#define __TYPEOF(p) ((LONGINT*)(uintptr)(*(((LONGINT*)(p))-1))) #define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) // Oberon-2 type bound procedures support -#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(SYSTEM_ADRINT)proc -#define __SEND(typ, num, funtyp, parlist) ((funtyp)((SYSTEM_ADRINT)*(typ-(__TPROC0OFF+num))))parlist +#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(uintptr)proc +#define __SEND(typ, num, funtyp, parlist) ((funtyp)((uintptr)*(typ-(__TPROC0OFF+num))))parlist From cdd8a26481abf43655291bcf64a4079ae78cf558 Mon Sep 17 00:00:00 2001 From: David Brown Date: Sat, 3 Sep 2016 11:56:17 +0100 Subject: [PATCH 211/580] Moving Heap.Mod to SYSTEM.UINTPTR. Only 64 bit working for now. --- bootstrap/unix-44/Configuration.c | 4 +- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Console.c | 4 +- bootstrap/unix-44/Console.h | 2 +- bootstrap/unix-44/Files.c | 20 +++--- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 100 +++++++++++++-------------- bootstrap/unix-44/Heap.h | 10 +-- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 4 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 2 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 8 +-- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 2 +- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 8 +-- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Platform.c | 14 ++-- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 14 ++-- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/SYSTEM.h | 8 +-- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/Vishap.c | 2 +- bootstrap/unix-44/errors.c | 2 +- bootstrap/unix-44/errors.h | 2 +- bootstrap/unix-44/extTools.c | 2 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-44/vt100.c | 2 +- bootstrap/unix-44/vt100.h | 2 +- bootstrap/unix-48/Configuration.c | 4 +- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Console.c | 4 +- bootstrap/unix-48/Console.h | 2 +- bootstrap/unix-48/Files.c | 20 +++--- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 100 +++++++++++++-------------- bootstrap/unix-48/Heap.h | 10 +-- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 4 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 2 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 8 +-- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 2 +- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 8 +-- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Platform.c | 14 ++-- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 14 ++-- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/SYSTEM.h | 8 +-- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/Vishap.c | 2 +- bootstrap/unix-48/errors.c | 2 +- bootstrap/unix-48/errors.h | 2 +- bootstrap/unix-48/extTools.c | 2 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-48/vt100.c | 2 +- bootstrap/unix-48/vt100.h | 2 +- bootstrap/unix-88/Configuration.c | 4 +- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Console.c | 4 +- bootstrap/unix-88/Console.h | 2 +- bootstrap/unix-88/Files.c | 20 +++--- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 100 +++++++++++++-------------- bootstrap/unix-88/Heap.h | 10 +-- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 4 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 2 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 4 +- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 2 +- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 8 +-- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Platform.c | 16 ++--- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 14 ++-- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/SYSTEM.h | 8 +-- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/Vishap.c | 2 +- bootstrap/unix-88/errors.c | 2 +- bootstrap/unix-88/errors.h | 2 +- bootstrap/unix-88/extTools.c | 2 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/unix-88/vt100.c | 2 +- bootstrap/unix-88/vt100.h | 2 +- bootstrap/windows-48/Configuration.c | 4 +- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Console.c | 4 +- bootstrap/windows-48/Console.h | 2 +- bootstrap/windows-48/Files.c | 20 +++--- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 100 +++++++++++++-------------- bootstrap/windows-48/Heap.h | 10 +-- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 4 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 2 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 8 +-- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 2 +- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 8 +-- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Platform.c | 10 +-- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 14 ++-- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/SYSTEM.h | 8 +-- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/Vishap.c | 2 +- bootstrap/windows-48/errors.c | 2 +- bootstrap/windows-48/errors.h | 2 +- bootstrap/windows-48/extTools.c | 2 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-48/vt100.c | 2 +- bootstrap/windows-48/vt100.h | 2 +- bootstrap/windows-88/Configuration.c | 4 +- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Console.c | 4 +- bootstrap/windows-88/Console.h | 2 +- bootstrap/windows-88/Files.c | 20 +++--- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 100 +++++++++++++-------------- bootstrap/windows-88/Heap.h | 10 +-- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 4 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 2 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 4 +- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 2 +- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 8 +-- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Platform.c | 10 +-- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 14 ++-- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/SYSTEM.h | 8 +-- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/Vishap.c | 2 +- bootstrap/windows-88/errors.c | 2 +- bootstrap/windows-88/errors.h | 2 +- bootstrap/windows-88/extTools.c | 2 +- bootstrap/windows-88/extTools.h | 2 +- bootstrap/windows-88/vt100.c | 2 +- bootstrap/windows-88/vt100.h | 2 +- src/compiler/OPB.Mod | 2 +- src/compiler/OPV.Mod | 6 +- src/system/Heap.Mod | 38 +++++----- src/system/Platformunix.Mod | 6 +- src/system/SYSTEM.h | 8 +-- 205 files changed, 656 insertions(+), 650 deletions(-) diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index 194e9da8..5cfd3bbe 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -13,6 +13,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/02] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/03] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index fbca10e0..28ac1853 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Console.c b/bootstrap/unix-44/Console.c index baf934fc..fa03933a 100644 --- a/bootstrap/unix-44/Console.c +++ b/bootstrap/unix-44/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Platform.h" @@ -21,7 +21,7 @@ export void Console_String (CHAR *s, LONGINT s__len); void Console_Flush (void) { int16 error; - error = Platform_Write(1, (SYSTEM_ADRINT)Console_line, Console_pos); + error = Platform_Write(1, (uintptr)Console_line, Console_pos); Console_pos = 0; } diff --git a/bootstrap/unix-44/Console.h b/bootstrap/unix-44/Console.h index 3823dacc..5f33afb3 100644 --- a/bootstrap/unix-44/Console.h +++ b/bootstrap/unix-44/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index c971536e..2337fa73 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" @@ -257,7 +257,7 @@ static void Files_Flush (Files_Buffer buf) if (buf->org != f->pos) { error = Platform_Seek(f->fd, buf->org, Platform_SeekSet); } - error = Platform_Write(f->fd, (SYSTEM_ADRINT)buf->data, buf->size); + error = Platform_Write(f->fd, (uintptr)buf->data, buf->size); if (error != 0) { Files_Err((CHAR*)"error writing file", 19, f, error); } @@ -656,7 +656,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x } else { min = n; } - __MOVE((SYSTEM_ADRINT)buf->data + offset, (SYSTEM_ADRINT)x + xpos, min); + __MOVE((uintptr)buf->data + offset, (uintptr)x + xpos, min); offset += min; (*r).offset = offset; xpos += min; @@ -721,7 +721,7 @@ void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT } else { min = n; } - __MOVE((SYSTEM_ADRINT)x + xpos, (SYSTEM_ADRINT)buf->data + offset, min); + __MOVE((uintptr)x + xpos, (uintptr)buf->data + offset, min); offset += min; (*r).offset = offset; if (offset > buf->size) { @@ -772,15 +772,15 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int *res = 3; return; } - error = Platform_Read(fdold, (SYSTEM_ADRINT)buf, 4096, &n); + error = Platform_Read(fdold, (uintptr)buf, 4096, &n); while (n > 0) { - error = Platform_Write(fdnew, (SYSTEM_ADRINT)buf, n); + error = Platform_Write(fdnew, (uintptr)buf, n); if (error != 0) { ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); Files_Err((CHAR*)"cannot move file", 17, NIL, error); } - error = Platform_Read(fdold, (SYSTEM_ADRINT)buf, 4096, &n); + error = Platform_Read(fdold, (uintptr)buf, 4096, &n); } ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); @@ -838,7 +838,7 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *de j += 1; } } else { - __MOVE((SYSTEM_ADRINT)src, (SYSTEM_ADRINT)dest, src__len); + __MOVE((uintptr)src, (uintptr)dest, src__len); } } @@ -1008,7 +1008,7 @@ static void Files_Finalize (SYSTEM_PTR o) { Files_File f = NIL; int32 res; - f = (Files_File)(SYSTEM_ADRINT)o; + f = (Files_File)(uintptr)o; if (f->fd >= 0) { Files_CloseOSFile(f); if (f->tempFile) { @@ -1021,7 +1021,7 @@ void Files_SetSearchPath (CHAR *path, LONGINT path__len) { __DUP(path, path__len, CHAR); if (Strings_Length(path, path__len) != 0) { - Files_SearchPath = __NEWARR(NIL, 1, 1, 1, 1, ((SYSTEM_ADRINT)((Strings_Length(path, path__len) + 1)))); + Files_SearchPath = __NEWARR(NIL, 1, 1, 1, 1, ((uintptr)((Strings_Length(path, path__len) + 1)))); __COPY(path, Files_SearchPath->data, Files_SearchPath->len[0]); } else { Files_SearchPath = NIL; diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index f5c55397..a76b0c07 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index 2315b64e..8f51e615 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tskSfF */ #include "SYSTEM.h" struct Heap__1 { @@ -34,7 +34,7 @@ typedef typedef struct Heap_FinDesc { Heap_FinNode next; - int32 obj; + uintptr obj; BOOLEAN marked; Heap_Finalizer finalize; } Heap_FinDesc; @@ -60,10 +60,10 @@ typedef export SYSTEM_PTR Heap_modules; static int32 Heap_freeList[10]; static int32 Heap_bigBlocks; -export int32 Heap_allocated; +export uintptr Heap_allocated; static BOOLEAN Heap_firstTry; -static int32 Heap_heap, Heap_heapend; -export int32 Heap_heapsize; +static uintptr Heap_heap, Heap_heapend; +export uintptr Heap_heapsize; static Heap_FinNode Heap_fin; static int16 Heap_lockdepth; static BOOLEAN Heap_interrupted; @@ -87,12 +87,12 @@ static void Heap_Mark (int32 q); static void Heap_MarkCandidates (int32 n, int32 *cand, LONGINT cand__len); static void Heap_MarkP (SYSTEM_PTR p); static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len); -export SYSTEM_PTR Heap_NEWBLK (int32 size); -export SYSTEM_PTR Heap_NEWREC (int32 tag); -static int32 Heap_NewChunk (int32 blksz); +export SYSTEM_PTR Heap_NEWBLK (uintptr size); +export SYSTEM_PTR Heap_NEWREC (uintptr tag); +static uintptr Heap_NewChunk (uintptr blksz); export void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); export SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -export void Heap_REGTYP (Heap_Module m, int32 typ); +export void Heap_REGTYP (Heap_Module m, uintptr typ); export void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); static void Heap_Scan (void); static void Heap_Sift (int32 l, int32 r, int32 *a, LONGINT a__len); @@ -101,7 +101,7 @@ export void Heap_Unlock (void); extern void *Heap__init(); extern LONGINT Platform_MainStackFrame; extern uintptr Platform_OSAllocate(uintptr size); -#define Heap_FetchAddress(pointer) (LONGINT)(SYSTEM_ADRINT)(*((void**)((SYSTEM_ADRINT)pointer))) +#define Heap_FetchAddress(pointer) (uintptr)(*((void**)((uintptr)pointer))) #define Heap_HeapModuleInit() Heap__init() #define Heap_OSAllocate(size) Platform_OSAllocate(size) #define Heap_PlatformHalt(code) Platform_Halt(code) @@ -134,7 +134,7 @@ SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) __COPY(name, m->name, 20); m->refcnt = 0; m->enumPtrs = enumPtrs; - m->next = (Heap_Module)(SYSTEM_ADRINT)Heap_modules; + m->next = (Heap_Module)(uintptr)Heap_modules; Heap_modules = (SYSTEM_PTR)m; _o_result = (void*)m; return _o_result; @@ -154,7 +154,7 @@ void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) m->cmds = c; } -void Heap_REGTYP (Heap_Module m, int32 typ) +void Heap_REGTYP (Heap_Module m, uintptr typ) { __PUT(typ, m->types, int32); m->types = typ; @@ -165,15 +165,15 @@ void Heap_INCREF (Heap_Module m) m->refcnt += 1; } -static int32 Heap_NewChunk (int32 blksz) +static uintptr Heap_NewChunk (uintptr blksz) { - int32 _o_result; - int32 chnk; + uintptr _o_result; + uintptr chnk; chnk = Heap_OSAllocate(blksz + 12); if (chnk != 0) { - __PUT(chnk + 4, chnk + (12 + blksz), int32); - __PUT(chnk + 12, chnk + 16, int32); - __PUT(chnk + 16, blksz, int32); + __PUT(chnk + 4, chnk + (12 + blksz), uintptr); + __PUT(chnk + 12, chnk + 16, uintptr); + __PUT(chnk + 16, blksz, uintptr); __PUT(chnk + 20, -4, int32); __PUT(chnk + 24, Heap_bigBlocks, int32); Heap_bigBlocks = chnk + 12; @@ -194,7 +194,7 @@ static void Heap_ExtendHeap (int32 blksz) chnk = Heap_NewChunk(size); if (chnk != 0) { if (chnk < Heap_heap) { - __PUT(chnk, Heap_heap, int32); + __PUT(chnk, Heap_heap, uintptr); Heap_heap = chnk; } else { j = Heap_heap; @@ -212,10 +212,10 @@ static void Heap_ExtendHeap (int32 blksz) } } -SYSTEM_PTR Heap_NEWREC (int32 tag) +SYSTEM_PTR Heap_NEWREC (uintptr tag) { SYSTEM_PTR _o_result; - int32 i, i0, di, blksz, restsize, t, adr, end, next, prev; + uintptr i, i0, di, blksz, restsize, t, adr, end, next, prev; SYSTEM_PTR new; Heap_Lock(); blksz = Heap_FetchAddress(tag); @@ -235,10 +235,10 @@ SYSTEM_PTR Heap_NEWREC (int32 tag) di = i - i0; restsize = __ASHL(di, 4); end = adr + restsize; - __PUT(end + 4, blksz, int32); + __PUT(end + 4, blksz, uintptr); __PUT(end + 8, -4, int32); __PUT(end, end + 4, int32); - __PUT(adr + 4, restsize, int32); + __PUT(adr + 4, restsize, uintptr); __PUT(adr + 12, Heap_freeList[di], int32); Heap_freeList[di] = adr; adr += restsize; @@ -279,21 +279,21 @@ SYSTEM_PTR Heap_NEWREC (int32 tag) } restsize = t - blksz; end = adr + restsize; - __PUT(end + 4, blksz, int32); + __PUT(end + 4, blksz, uintptr); __PUT(end + 8, -4, int32); __PUT(end, end + 4, int32); if (restsize > 144) { - __PUT(adr + 4, restsize, int32); + __PUT(adr + 4, restsize, uintptr); } else { next = Heap_FetchAddress(adr + 12); if (prev == 0) { Heap_bigBlocks = next; } else { - __PUT(prev + 12, next, int32); + __PUT(prev + 12, next, uintptr); } if (restsize > 0) { di = __ASHR(restsize, 4); - __PUT(adr + 4, restsize, int32); + __PUT(adr + 4, restsize, uintptr); __PUT(adr + 12, Heap_freeList[di], int32); Heap_freeList[di] = adr; } @@ -310,28 +310,28 @@ SYSTEM_PTR Heap_NEWREC (int32 tag) i += 16; } __PUT(adr + 12, 0, int32); - __PUT(adr, tag, int32); + __PUT(adr, tag, uintptr); __PUT(adr + 4, 0, int32); __PUT(adr + 8, 0, int32); Heap_allocated += blksz; Heap_Unlock(); - _o_result = (SYSTEM_PTR)(SYSTEM_ADRINT)(adr + 4); + _o_result = (SYSTEM_PTR)(uintptr)(adr + 4); return _o_result; } -SYSTEM_PTR Heap_NEWBLK (int32 size) +SYSTEM_PTR Heap_NEWBLK (uintptr size) { SYSTEM_PTR _o_result; - int32 blksz, tag; + uintptr blksz, tag; SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 31, 4), 4); - new = Heap_NEWREC((SYSTEM_ADRINT)&blksz); - tag = ((int32)(SYSTEM_ADRINT)new + blksz) - 12; + new = Heap_NEWREC((uintptr)&blksz); + tag = (((int32)(uintptr)new) + blksz) - 12; __PUT(tag - 4, 0, int32); - __PUT(tag, blksz, int32); + __PUT(tag, blksz, uintptr); __PUT(tag + 4, -4, int32); - __PUT((int32)(SYSTEM_ADRINT)new - 4, tag, int32); + __PUT((int32)(uintptr)new - 4, tag, uintptr); Heap_Unlock(); _o_result = new; return _o_result; @@ -360,7 +360,7 @@ static void Heap_Mark (int32 q) __GET(tag, offset, int32); fld = q + offset; p = Heap_FetchAddress(fld); - __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)n, SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(uintptr)n, SYSTEM_PTR); } else { fld = q + offset; n = Heap_FetchAddress(fld); @@ -369,7 +369,7 @@ static void Heap_Mark (int32 q) if (!__ODD(tagbits)) { __PUT(n - 4, tagbits + 1, int32); __PUT(q - 4, tag + 1, int32); - __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)p, SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(uintptr)p, SYSTEM_PTR); p = q; q = n; tag = tagbits; @@ -384,12 +384,12 @@ static void Heap_Mark (int32 q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((int32)(SYSTEM_ADRINT)p); + Heap_Mark((int32)(uintptr)p); } static void Heap_Scan (void) { - int32 chnk, adr, end, start, tag, i, size, freesize; + uintptr chnk, adr, end, start, tag, i, size, freesize; Heap_bigBlocks = 0; i = 1; while (i < 9) { @@ -407,8 +407,8 @@ static void Heap_Scan (void) if (__ODD(tag)) { if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 4, int32); - __PUT(start + 4, freesize, int32); + __PUT(start, start + 4, uintptr); + __PUT(start + 4, freesize, uintptr); __PUT(start + 8, -4, int32); i = __ASHR(freesize, 4); freesize = 0; @@ -421,7 +421,7 @@ static void Heap_Scan (void) } } tag -= 1; - __PUT(adr, tag, int32); + __PUT(adr, tag, uintptr); size = Heap_FetchAddress(tag); Heap_allocated += size; adr += size; @@ -433,8 +433,8 @@ static void Heap_Scan (void) } if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 4, int32); - __PUT(start + 4, freesize, int32); + __PUT(start, start + 4, uintptr); + __PUT(start + 4, freesize, uintptr); __PUT(start + 8, -4, int32); i = __ASHR(freesize, 4); freesize = 0; @@ -553,7 +553,7 @@ static void Heap_Finalize (void) } else { prev->next = n->next; } - (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); + (*n->finalize)((SYSTEM_PTR)(uintptr)n->obj); if (prev == NIL) { n = Heap_fin; } else { @@ -572,7 +572,7 @@ void Heap_FINALL (void) while (Heap_fin != NIL) { n = Heap_fin; Heap_fin = Heap_fin->next; - (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); + (*n->finalize)((SYSTEM_PTR)(uintptr)n->obj); } } @@ -589,9 +589,9 @@ static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len) } if (n == 0) { nofcand = 0; - sp = (SYSTEM_ADRINT)&frame; + sp = (uintptr)&frame; stack0 = Heap_PlatformMainStackFrame(); - inc = (SYSTEM_ADRINT)&align.p - (SYSTEM_ADRINT)&align; + inc = (uintptr)&align.p - (uintptr)&align; if (sp > stack0) { inc = -inc; } @@ -622,7 +622,7 @@ void Heap_GC (BOOLEAN markStack) int32 cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); - m = (Heap_Module)(SYSTEM_ADRINT)Heap_modules; + m = (Heap_Module)(uintptr)Heap_modules; while (m != NIL) { if (m->enumPtrs != NIL) { (*m->enumPtrs)(Heap_MarkP); @@ -699,7 +699,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (int32)(SYSTEM_ADRINT)obj; + f->obj = (int32)(uintptr)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index 83733c20..771fc9d8 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h @@ -31,7 +31,7 @@ typedef import SYSTEM_PTR Heap_modules; -import int32 Heap_allocated, Heap_heapsize; +import uintptr Heap_allocated, Heap_heapsize; import int16 Heap_FileCount; import LONGINT *Heap_ModuleDesc__typ; @@ -41,11 +41,11 @@ import void Heap_GC (BOOLEAN markStack); import void Heap_INCREF (Heap_Module m); import void Heap_InitHeap (void); import void Heap_Lock (void); -import SYSTEM_PTR Heap_NEWBLK (int32 size); -import SYSTEM_PTR Heap_NEWREC (int32 tag); +import SYSTEM_PTR Heap_NEWBLK (uintptr size); +import SYSTEM_PTR Heap_NEWREC (uintptr tag); import void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); import SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -import void Heap_REGTYP (Heap_Module m, int32 typ); +import void Heap_REGTYP (Heap_Module m, uintptr typ); import void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); import void Heap_Unlock (void); import void *Heap__init(void); diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index e7006b76..84914960 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Heap.h" diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index 632138b5..2409c160 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index fa8f98fe..3af88ab8 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" @@ -2196,7 +2196,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) if (((x->class == 8 || x->class == 9) || __IN(f, 0x0501)) || x->typ->comp == 3) { OPB_err(126); } - if (x->typ->size < p->typ->size) { + if ((x->class != 7 && x->typ->size < p->typ->size)) { OPB_err(-308); } t = OPT_NewNode(11); diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index 8b2baa5f..47603929 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 93d60530..10b51482 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "OPM.h" diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index 78a60ed9..a13d99e4 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 19ad29af..1cd8fb97 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" @@ -544,15 +544,15 @@ void OPM_FPrintReal (int32 *fp, REAL real) { int16 i; int32 l; - __GET((SYSTEM_ADRINT)&real, l, int32); + __GET((uintptr)&real, l, int32); OPM_FPrint(&*fp, l); } void OPM_FPrintLReal (int32 *fp, LONGREAL lr) { int32 l, h; - __GET((SYSTEM_ADRINT)&lr, l, int32); - __GET((SYSTEM_ADRINT)&lr + 4, h, int32); + __GET((uintptr)&lr, l, int32); + __GET((uintptr)&lr + 4, h, int32); OPM_FPrint(&*fp, l); OPM_FPrint(&*fp, h); } diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index 44fe5275..f0a96a82 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index b0cd8613..f727dcde 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPB.h" #include "OPM.h" diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index 423013a4..b8787f9f 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index 36b37592..7a14e8c2 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index dec9c209..0e48367c 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index 16dfc5b1..32d09e08 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index c290d3de..b12f68e2 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index aeef6224..7a155032 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPC.h" #include "OPM.h" @@ -939,7 +939,7 @@ static void OPV_expr (OPT_Node n, int16 prec) OPM_Write(')'); break; case 24: - OPM_WriteString((CHAR*)"(SYSTEM_ADRINT)", 16); + OPM_WriteString((CHAR*)"(uintptr)", 10); if (l->class == 1) { OPC_CompleteIdent(l->obj); } else { @@ -955,7 +955,7 @@ static void OPV_expr (OPT_Node n, int16 prec) OPC_Ident(n->typ->strobj); OPM_Write(')'); if (__IN(n->typ->form, 0x1800) || __IN(l->typ->form, 0x1800)) { - OPM_WriteString((CHAR*)"(SYSTEM_ADRINT)", 16); + OPM_WriteString((CHAR*)"(uintptr)", 10); } OPV_expr(l, exprPrec); } else { @@ -1327,7 +1327,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) if (x->class == 7) { OPC_IntLiteral(x->conval->intval, OPM_PointerSize); } else { - OPM_WriteString((CHAR*)"((SYSTEM_ADRINT)(", 18); + OPM_WriteString((CHAR*)"((uintptr)(", 12); OPV_expr(x, 10); OPM_WriteString((CHAR*)"))", 3); } diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index 8fd772f8..d45ee079 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index f8dc8de8..5b3bea8f 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef @@ -139,13 +139,13 @@ extern void Heap_InitHeap(); #define Platform_opennew(n, n__len) open((char*)n, O_CREAT | O_TRUNC | O_RDWR, 0664) #define Platform_openro(n, n__len) open((char*)n, O_RDONLY) #define Platform_openrw(n, n__len) open((char*)n, O_RDWR) -#define Platform_readfile(fd, p, l) read(fd, (void*)(SYSTEM_ADRINT)(p), l) +#define Platform_readfile(fd, p, l) read(fd, (void*)(uintptr)(p), l) #define Platform_rename(o, o__len, n, n__len) rename((char*)o, (char*)n) #define Platform_sectotm(s) struct tm *time = localtime((time_t*)&s) #define Platform_seekcur() SEEK_CUR #define Platform_seekend() SEEK_END #define Platform_seekset() SEEK_SET -#define Platform_sethandler(s, h) SystemSetHandler(s, (SYSTEM_ADRINT)h) +#define Platform_sethandler(s, h) SystemSetHandler(s, (uintptr)h) #define Platform_stat(n, n__len) stat((char*)n, &s) #define Platform_statdev() (LONGINT)s.st_dev #define Platform_statino() (LONGINT)s.st_ino @@ -162,7 +162,7 @@ extern void Heap_InitHeap(); #define Platform_tvsec() tv.tv_sec #define Platform_tvusec() tv.tv_usec #define Platform_unlink(n, n__len) unlink((char*)n) -#define Platform_writefile(fd, p, l) write(fd, (void*)(SYSTEM_ADRINT)(p), l) +#define Platform_writefile(fd, p, l) write(fd, (void*)(uintptr)(p), l) BOOLEAN Platform_TooManyFiles (int16 e) { @@ -230,7 +230,7 @@ void Platform_Init (int16 argc, int32 argvadr) Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; Platform_ArgCount = argc; - av = (Platform_ArgVecPtr)(SYSTEM_ADRINT)argvadr; + av = (Platform_ArgVecPtr)(uintptr)argvadr; Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; Platform_HeapInitHeap(); @@ -530,7 +530,7 @@ int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n) int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n) { int16 _o_result; - *n = Platform_readfile(h, (SYSTEM_ADRINT)b, b__len); + *n = Platform_readfile(h, (uintptr)b, b__len); if (*n < 0) { *n = 0; _o_result = Platform_err(); @@ -766,7 +766,7 @@ static void Platform_TestLittleEndian (void) { int16 i; i = 1; - __GET((SYSTEM_ADRINT)&i, Platform_LittleEndian, BOOLEAN); + __GET((uintptr)&i, Platform_LittleEndian, BOOLEAN); } __TDESC(Platform_FileIdentity, 1, 0) = {__TDFLDS("FileIdentity", 12), {-4}}; diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index a4c001f3..bed97db3 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 4e271371..32931aec 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -58,7 +58,7 @@ int16 Reals_Expo (REAL x) { int16 _o_result; int16 i; - __GET((SYSTEM_ADRINT)&x + 2, i, int16); + __GET((uintptr)&x + 2, i, int16); _o_result = __MASK(__ASHR(i, 7), -256); return _o_result; } @@ -66,17 +66,17 @@ int16 Reals_Expo (REAL x) void Reals_SetExpo (REAL *x, int16 ex) { CHAR c; - __GET((SYSTEM_ADRINT)x + 3, c, CHAR); - __PUT((SYSTEM_ADRINT)x + 3, (CHAR)(__ASHL(__ASHR((int16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); - __GET((SYSTEM_ADRINT)x + 2, c, CHAR); - __PUT((SYSTEM_ADRINT)x + 2, (CHAR)(__MASK((int16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); + __GET((uintptr)x + 3, c, CHAR); + __PUT((uintptr)x + 3, (CHAR)(__ASHL(__ASHR((int16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __GET((uintptr)x + 2, c, CHAR); + __PUT((uintptr)x + 2, (CHAR)(__MASK((int16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } int16 Reals_ExpoL (LONGREAL x) { int16 _o_result; int16 i; - __GET((SYSTEM_ADRINT)&x + 6, i, int16); + __GET((uintptr)&x + 6, i, int16); _o_result = __MASK(__ASHR(i, 4), -2048); return _o_result; } diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index b1e62271..38d206bb 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/SYSTEM.h b/bootstrap/unix-44/SYSTEM.h index c83f69f1..31fa97c5 100644 --- a/bootstrap/unix-44/SYSTEM.h +++ b/bootstrap/unix-44/SYSTEM.h @@ -39,8 +39,8 @@ typedef unsigned short int uint16; typedef signed char int8; typedef unsigned char uint8; -#define uintptr size_t - +//#define uintptr size_t +#define uintptr int64 // The compiler uses 'import' and 'export' which translate to 'extern' and // nothing respectively. @@ -255,8 +255,8 @@ extern void Platform_AssertFail(LONGINT x); // Memory allocation -extern SYSTEM_PTR Heap_NEWBLK (LONGINT size); -extern SYSTEM_PTR Heap_NEWREC (LONGINT tag); +extern SYSTEM_PTR Heap_NEWBLK (uintptr size); +extern SYSTEM_PTR Heap_NEWREC (uintptr tag); extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __SYSNEW(p, len) p = Heap_NEWBLK((LONGINT)(len)) diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index 439a49e9..728d163f 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index 681fcf1c..6e1bcc56 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index 4692859f..6157e386 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Files.h" #include "Modules.h" diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index e78a2d49..76aee9f2 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/Vishap.c b/bootstrap/unix-44/Vishap.c index 9224220a..f2e2ae7d 100644 --- a/bootstrap/unix-44/Vishap.c +++ b/bootstrap/unix-44/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkamSf */ #include "SYSTEM.h" #include "Configuration.h" #include "Heap.h" diff --git a/bootstrap/unix-44/errors.c b/bootstrap/unix-44/errors.c index 6e4f20e5..0dc0c60a 100644 --- a/bootstrap/unix-44/errors.c +++ b/bootstrap/unix-44/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/unix-44/errors.h b/bootstrap/unix-44/errors.h index f06c706d..4415a5f2 100644 --- a/bootstrap/unix-44/errors.h +++ b/bootstrap/unix-44/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index 00be6a22..6a7aab56 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index 9d9202c0..4e806a33 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-44/vt100.c b/bootstrap/unix-44/vt100.c index 8ca75a42..447b9c81 100644 --- a/bootstrap/unix-44/vt100.c +++ b/bootstrap/unix-44/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Strings.h" diff --git a/bootstrap/unix-44/vt100.h b/bootstrap/unix-44/vt100.h index 901eed38..3d9d98a7 100644 --- a/bootstrap/unix-44/vt100.h +++ b/bootstrap/unix-44/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index 194e9da8..5cfd3bbe 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -13,6 +13,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/02] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/03] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index fbca10e0..28ac1853 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Console.c b/bootstrap/unix-48/Console.c index baf934fc..fa03933a 100644 --- a/bootstrap/unix-48/Console.c +++ b/bootstrap/unix-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Platform.h" @@ -21,7 +21,7 @@ export void Console_String (CHAR *s, LONGINT s__len); void Console_Flush (void) { int16 error; - error = Platform_Write(1, (SYSTEM_ADRINT)Console_line, Console_pos); + error = Platform_Write(1, (uintptr)Console_line, Console_pos); Console_pos = 0; } diff --git a/bootstrap/unix-48/Console.h b/bootstrap/unix-48/Console.h index 3823dacc..5f33afb3 100644 --- a/bootstrap/unix-48/Console.h +++ b/bootstrap/unix-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index c971536e..2337fa73 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" @@ -257,7 +257,7 @@ static void Files_Flush (Files_Buffer buf) if (buf->org != f->pos) { error = Platform_Seek(f->fd, buf->org, Platform_SeekSet); } - error = Platform_Write(f->fd, (SYSTEM_ADRINT)buf->data, buf->size); + error = Platform_Write(f->fd, (uintptr)buf->data, buf->size); if (error != 0) { Files_Err((CHAR*)"error writing file", 19, f, error); } @@ -656,7 +656,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x } else { min = n; } - __MOVE((SYSTEM_ADRINT)buf->data + offset, (SYSTEM_ADRINT)x + xpos, min); + __MOVE((uintptr)buf->data + offset, (uintptr)x + xpos, min); offset += min; (*r).offset = offset; xpos += min; @@ -721,7 +721,7 @@ void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT } else { min = n; } - __MOVE((SYSTEM_ADRINT)x + xpos, (SYSTEM_ADRINT)buf->data + offset, min); + __MOVE((uintptr)x + xpos, (uintptr)buf->data + offset, min); offset += min; (*r).offset = offset; if (offset > buf->size) { @@ -772,15 +772,15 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int *res = 3; return; } - error = Platform_Read(fdold, (SYSTEM_ADRINT)buf, 4096, &n); + error = Platform_Read(fdold, (uintptr)buf, 4096, &n); while (n > 0) { - error = Platform_Write(fdnew, (SYSTEM_ADRINT)buf, n); + error = Platform_Write(fdnew, (uintptr)buf, n); if (error != 0) { ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); Files_Err((CHAR*)"cannot move file", 17, NIL, error); } - error = Platform_Read(fdold, (SYSTEM_ADRINT)buf, 4096, &n); + error = Platform_Read(fdold, (uintptr)buf, 4096, &n); } ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); @@ -838,7 +838,7 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *de j += 1; } } else { - __MOVE((SYSTEM_ADRINT)src, (SYSTEM_ADRINT)dest, src__len); + __MOVE((uintptr)src, (uintptr)dest, src__len); } } @@ -1008,7 +1008,7 @@ static void Files_Finalize (SYSTEM_PTR o) { Files_File f = NIL; int32 res; - f = (Files_File)(SYSTEM_ADRINT)o; + f = (Files_File)(uintptr)o; if (f->fd >= 0) { Files_CloseOSFile(f); if (f->tempFile) { @@ -1021,7 +1021,7 @@ void Files_SetSearchPath (CHAR *path, LONGINT path__len) { __DUP(path, path__len, CHAR); if (Strings_Length(path, path__len) != 0) { - Files_SearchPath = __NEWARR(NIL, 1, 1, 1, 1, ((SYSTEM_ADRINT)((Strings_Length(path, path__len) + 1)))); + Files_SearchPath = __NEWARR(NIL, 1, 1, 1, 1, ((uintptr)((Strings_Length(path, path__len) + 1)))); __COPY(path, Files_SearchPath->data, Files_SearchPath->len[0]); } else { Files_SearchPath = NIL; diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index f5c55397..a76b0c07 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index 2315b64e..8f51e615 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tskSfF */ #include "SYSTEM.h" struct Heap__1 { @@ -34,7 +34,7 @@ typedef typedef struct Heap_FinDesc { Heap_FinNode next; - int32 obj; + uintptr obj; BOOLEAN marked; Heap_Finalizer finalize; } Heap_FinDesc; @@ -60,10 +60,10 @@ typedef export SYSTEM_PTR Heap_modules; static int32 Heap_freeList[10]; static int32 Heap_bigBlocks; -export int32 Heap_allocated; +export uintptr Heap_allocated; static BOOLEAN Heap_firstTry; -static int32 Heap_heap, Heap_heapend; -export int32 Heap_heapsize; +static uintptr Heap_heap, Heap_heapend; +export uintptr Heap_heapsize; static Heap_FinNode Heap_fin; static int16 Heap_lockdepth; static BOOLEAN Heap_interrupted; @@ -87,12 +87,12 @@ static void Heap_Mark (int32 q); static void Heap_MarkCandidates (int32 n, int32 *cand, LONGINT cand__len); static void Heap_MarkP (SYSTEM_PTR p); static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len); -export SYSTEM_PTR Heap_NEWBLK (int32 size); -export SYSTEM_PTR Heap_NEWREC (int32 tag); -static int32 Heap_NewChunk (int32 blksz); +export SYSTEM_PTR Heap_NEWBLK (uintptr size); +export SYSTEM_PTR Heap_NEWREC (uintptr tag); +static uintptr Heap_NewChunk (uintptr blksz); export void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); export SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -export void Heap_REGTYP (Heap_Module m, int32 typ); +export void Heap_REGTYP (Heap_Module m, uintptr typ); export void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); static void Heap_Scan (void); static void Heap_Sift (int32 l, int32 r, int32 *a, LONGINT a__len); @@ -101,7 +101,7 @@ export void Heap_Unlock (void); extern void *Heap__init(); extern LONGINT Platform_MainStackFrame; extern uintptr Platform_OSAllocate(uintptr size); -#define Heap_FetchAddress(pointer) (LONGINT)(SYSTEM_ADRINT)(*((void**)((SYSTEM_ADRINT)pointer))) +#define Heap_FetchAddress(pointer) (uintptr)(*((void**)((uintptr)pointer))) #define Heap_HeapModuleInit() Heap__init() #define Heap_OSAllocate(size) Platform_OSAllocate(size) #define Heap_PlatformHalt(code) Platform_Halt(code) @@ -134,7 +134,7 @@ SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) __COPY(name, m->name, 20); m->refcnt = 0; m->enumPtrs = enumPtrs; - m->next = (Heap_Module)(SYSTEM_ADRINT)Heap_modules; + m->next = (Heap_Module)(uintptr)Heap_modules; Heap_modules = (SYSTEM_PTR)m; _o_result = (void*)m; return _o_result; @@ -154,7 +154,7 @@ void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) m->cmds = c; } -void Heap_REGTYP (Heap_Module m, int32 typ) +void Heap_REGTYP (Heap_Module m, uintptr typ) { __PUT(typ, m->types, int32); m->types = typ; @@ -165,15 +165,15 @@ void Heap_INCREF (Heap_Module m) m->refcnt += 1; } -static int32 Heap_NewChunk (int32 blksz) +static uintptr Heap_NewChunk (uintptr blksz) { - int32 _o_result; - int32 chnk; + uintptr _o_result; + uintptr chnk; chnk = Heap_OSAllocate(blksz + 12); if (chnk != 0) { - __PUT(chnk + 4, chnk + (12 + blksz), int32); - __PUT(chnk + 12, chnk + 16, int32); - __PUT(chnk + 16, blksz, int32); + __PUT(chnk + 4, chnk + (12 + blksz), uintptr); + __PUT(chnk + 12, chnk + 16, uintptr); + __PUT(chnk + 16, blksz, uintptr); __PUT(chnk + 20, -4, int32); __PUT(chnk + 24, Heap_bigBlocks, int32); Heap_bigBlocks = chnk + 12; @@ -194,7 +194,7 @@ static void Heap_ExtendHeap (int32 blksz) chnk = Heap_NewChunk(size); if (chnk != 0) { if (chnk < Heap_heap) { - __PUT(chnk, Heap_heap, int32); + __PUT(chnk, Heap_heap, uintptr); Heap_heap = chnk; } else { j = Heap_heap; @@ -212,10 +212,10 @@ static void Heap_ExtendHeap (int32 blksz) } } -SYSTEM_PTR Heap_NEWREC (int32 tag) +SYSTEM_PTR Heap_NEWREC (uintptr tag) { SYSTEM_PTR _o_result; - int32 i, i0, di, blksz, restsize, t, adr, end, next, prev; + uintptr i, i0, di, blksz, restsize, t, adr, end, next, prev; SYSTEM_PTR new; Heap_Lock(); blksz = Heap_FetchAddress(tag); @@ -235,10 +235,10 @@ SYSTEM_PTR Heap_NEWREC (int32 tag) di = i - i0; restsize = __ASHL(di, 4); end = adr + restsize; - __PUT(end + 4, blksz, int32); + __PUT(end + 4, blksz, uintptr); __PUT(end + 8, -4, int32); __PUT(end, end + 4, int32); - __PUT(adr + 4, restsize, int32); + __PUT(adr + 4, restsize, uintptr); __PUT(adr + 12, Heap_freeList[di], int32); Heap_freeList[di] = adr; adr += restsize; @@ -279,21 +279,21 @@ SYSTEM_PTR Heap_NEWREC (int32 tag) } restsize = t - blksz; end = adr + restsize; - __PUT(end + 4, blksz, int32); + __PUT(end + 4, blksz, uintptr); __PUT(end + 8, -4, int32); __PUT(end, end + 4, int32); if (restsize > 144) { - __PUT(adr + 4, restsize, int32); + __PUT(adr + 4, restsize, uintptr); } else { next = Heap_FetchAddress(adr + 12); if (prev == 0) { Heap_bigBlocks = next; } else { - __PUT(prev + 12, next, int32); + __PUT(prev + 12, next, uintptr); } if (restsize > 0) { di = __ASHR(restsize, 4); - __PUT(adr + 4, restsize, int32); + __PUT(adr + 4, restsize, uintptr); __PUT(adr + 12, Heap_freeList[di], int32); Heap_freeList[di] = adr; } @@ -310,28 +310,28 @@ SYSTEM_PTR Heap_NEWREC (int32 tag) i += 16; } __PUT(adr + 12, 0, int32); - __PUT(adr, tag, int32); + __PUT(adr, tag, uintptr); __PUT(adr + 4, 0, int32); __PUT(adr + 8, 0, int32); Heap_allocated += blksz; Heap_Unlock(); - _o_result = (SYSTEM_PTR)(SYSTEM_ADRINT)(adr + 4); + _o_result = (SYSTEM_PTR)(uintptr)(adr + 4); return _o_result; } -SYSTEM_PTR Heap_NEWBLK (int32 size) +SYSTEM_PTR Heap_NEWBLK (uintptr size) { SYSTEM_PTR _o_result; - int32 blksz, tag; + uintptr blksz, tag; SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 31, 4), 4); - new = Heap_NEWREC((SYSTEM_ADRINT)&blksz); - tag = ((int32)(SYSTEM_ADRINT)new + blksz) - 12; + new = Heap_NEWREC((uintptr)&blksz); + tag = (((int32)(uintptr)new) + blksz) - 12; __PUT(tag - 4, 0, int32); - __PUT(tag, blksz, int32); + __PUT(tag, blksz, uintptr); __PUT(tag + 4, -4, int32); - __PUT((int32)(SYSTEM_ADRINT)new - 4, tag, int32); + __PUT((int32)(uintptr)new - 4, tag, uintptr); Heap_Unlock(); _o_result = new; return _o_result; @@ -360,7 +360,7 @@ static void Heap_Mark (int32 q) __GET(tag, offset, int32); fld = q + offset; p = Heap_FetchAddress(fld); - __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)n, SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(uintptr)n, SYSTEM_PTR); } else { fld = q + offset; n = Heap_FetchAddress(fld); @@ -369,7 +369,7 @@ static void Heap_Mark (int32 q) if (!__ODD(tagbits)) { __PUT(n - 4, tagbits + 1, int32); __PUT(q - 4, tag + 1, int32); - __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)p, SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(uintptr)p, SYSTEM_PTR); p = q; q = n; tag = tagbits; @@ -384,12 +384,12 @@ static void Heap_Mark (int32 q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((int32)(SYSTEM_ADRINT)p); + Heap_Mark((int32)(uintptr)p); } static void Heap_Scan (void) { - int32 chnk, adr, end, start, tag, i, size, freesize; + uintptr chnk, adr, end, start, tag, i, size, freesize; Heap_bigBlocks = 0; i = 1; while (i < 9) { @@ -407,8 +407,8 @@ static void Heap_Scan (void) if (__ODD(tag)) { if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 4, int32); - __PUT(start + 4, freesize, int32); + __PUT(start, start + 4, uintptr); + __PUT(start + 4, freesize, uintptr); __PUT(start + 8, -4, int32); i = __ASHR(freesize, 4); freesize = 0; @@ -421,7 +421,7 @@ static void Heap_Scan (void) } } tag -= 1; - __PUT(adr, tag, int32); + __PUT(adr, tag, uintptr); size = Heap_FetchAddress(tag); Heap_allocated += size; adr += size; @@ -433,8 +433,8 @@ static void Heap_Scan (void) } if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 4, int32); - __PUT(start + 4, freesize, int32); + __PUT(start, start + 4, uintptr); + __PUT(start + 4, freesize, uintptr); __PUT(start + 8, -4, int32); i = __ASHR(freesize, 4); freesize = 0; @@ -553,7 +553,7 @@ static void Heap_Finalize (void) } else { prev->next = n->next; } - (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); + (*n->finalize)((SYSTEM_PTR)(uintptr)n->obj); if (prev == NIL) { n = Heap_fin; } else { @@ -572,7 +572,7 @@ void Heap_FINALL (void) while (Heap_fin != NIL) { n = Heap_fin; Heap_fin = Heap_fin->next; - (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); + (*n->finalize)((SYSTEM_PTR)(uintptr)n->obj); } } @@ -589,9 +589,9 @@ static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len) } if (n == 0) { nofcand = 0; - sp = (SYSTEM_ADRINT)&frame; + sp = (uintptr)&frame; stack0 = Heap_PlatformMainStackFrame(); - inc = (SYSTEM_ADRINT)&align.p - (SYSTEM_ADRINT)&align; + inc = (uintptr)&align.p - (uintptr)&align; if (sp > stack0) { inc = -inc; } @@ -622,7 +622,7 @@ void Heap_GC (BOOLEAN markStack) int32 cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); - m = (Heap_Module)(SYSTEM_ADRINT)Heap_modules; + m = (Heap_Module)(uintptr)Heap_modules; while (m != NIL) { if (m->enumPtrs != NIL) { (*m->enumPtrs)(Heap_MarkP); @@ -699,7 +699,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (int32)(SYSTEM_ADRINT)obj; + f->obj = (int32)(uintptr)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index 83733c20..771fc9d8 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h @@ -31,7 +31,7 @@ typedef import SYSTEM_PTR Heap_modules; -import int32 Heap_allocated, Heap_heapsize; +import uintptr Heap_allocated, Heap_heapsize; import int16 Heap_FileCount; import LONGINT *Heap_ModuleDesc__typ; @@ -41,11 +41,11 @@ import void Heap_GC (BOOLEAN markStack); import void Heap_INCREF (Heap_Module m); import void Heap_InitHeap (void); import void Heap_Lock (void); -import SYSTEM_PTR Heap_NEWBLK (int32 size); -import SYSTEM_PTR Heap_NEWREC (int32 tag); +import SYSTEM_PTR Heap_NEWBLK (uintptr size); +import SYSTEM_PTR Heap_NEWREC (uintptr tag); import void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); import SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -import void Heap_REGTYP (Heap_Module m, int32 typ); +import void Heap_REGTYP (Heap_Module m, uintptr typ); import void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); import void Heap_Unlock (void); import void *Heap__init(void); diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index e7006b76..84914960 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Heap.h" diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index 632138b5..2409c160 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index fa8f98fe..3af88ab8 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" @@ -2196,7 +2196,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) if (((x->class == 8 || x->class == 9) || __IN(f, 0x0501)) || x->typ->comp == 3) { OPB_err(126); } - if (x->typ->size < p->typ->size) { + if ((x->class != 7 && x->typ->size < p->typ->size)) { OPB_err(-308); } t = OPT_NewNode(11); diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index 8b2baa5f..47603929 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 93d60530..10b51482 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "OPM.h" diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index 78a60ed9..a13d99e4 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 19ad29af..1cd8fb97 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" @@ -544,15 +544,15 @@ void OPM_FPrintReal (int32 *fp, REAL real) { int16 i; int32 l; - __GET((SYSTEM_ADRINT)&real, l, int32); + __GET((uintptr)&real, l, int32); OPM_FPrint(&*fp, l); } void OPM_FPrintLReal (int32 *fp, LONGREAL lr) { int32 l, h; - __GET((SYSTEM_ADRINT)&lr, l, int32); - __GET((SYSTEM_ADRINT)&lr + 4, h, int32); + __GET((uintptr)&lr, l, int32); + __GET((uintptr)&lr + 4, h, int32); OPM_FPrint(&*fp, l); OPM_FPrint(&*fp, h); } diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index 44fe5275..f0a96a82 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index b0cd8613..f727dcde 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPB.h" #include "OPM.h" diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index 423013a4..b8787f9f 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index 36b37592..7a14e8c2 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index dec9c209..0e48367c 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 16dfc5b1..32d09e08 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index c290d3de..b12f68e2 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index aeef6224..7a155032 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPC.h" #include "OPM.h" @@ -939,7 +939,7 @@ static void OPV_expr (OPT_Node n, int16 prec) OPM_Write(')'); break; case 24: - OPM_WriteString((CHAR*)"(SYSTEM_ADRINT)", 16); + OPM_WriteString((CHAR*)"(uintptr)", 10); if (l->class == 1) { OPC_CompleteIdent(l->obj); } else { @@ -955,7 +955,7 @@ static void OPV_expr (OPT_Node n, int16 prec) OPC_Ident(n->typ->strobj); OPM_Write(')'); if (__IN(n->typ->form, 0x1800) || __IN(l->typ->form, 0x1800)) { - OPM_WriteString((CHAR*)"(SYSTEM_ADRINT)", 16); + OPM_WriteString((CHAR*)"(uintptr)", 10); } OPV_expr(l, exprPrec); } else { @@ -1327,7 +1327,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) if (x->class == 7) { OPC_IntLiteral(x->conval->intval, OPM_PointerSize); } else { - OPM_WriteString((CHAR*)"((SYSTEM_ADRINT)(", 18); + OPM_WriteString((CHAR*)"((uintptr)(", 12); OPV_expr(x, 10); OPM_WriteString((CHAR*)"))", 3); } diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index 8fd772f8..d45ee079 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index f8dc8de8..5b3bea8f 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef @@ -139,13 +139,13 @@ extern void Heap_InitHeap(); #define Platform_opennew(n, n__len) open((char*)n, O_CREAT | O_TRUNC | O_RDWR, 0664) #define Platform_openro(n, n__len) open((char*)n, O_RDONLY) #define Platform_openrw(n, n__len) open((char*)n, O_RDWR) -#define Platform_readfile(fd, p, l) read(fd, (void*)(SYSTEM_ADRINT)(p), l) +#define Platform_readfile(fd, p, l) read(fd, (void*)(uintptr)(p), l) #define Platform_rename(o, o__len, n, n__len) rename((char*)o, (char*)n) #define Platform_sectotm(s) struct tm *time = localtime((time_t*)&s) #define Platform_seekcur() SEEK_CUR #define Platform_seekend() SEEK_END #define Platform_seekset() SEEK_SET -#define Platform_sethandler(s, h) SystemSetHandler(s, (SYSTEM_ADRINT)h) +#define Platform_sethandler(s, h) SystemSetHandler(s, (uintptr)h) #define Platform_stat(n, n__len) stat((char*)n, &s) #define Platform_statdev() (LONGINT)s.st_dev #define Platform_statino() (LONGINT)s.st_ino @@ -162,7 +162,7 @@ extern void Heap_InitHeap(); #define Platform_tvsec() tv.tv_sec #define Platform_tvusec() tv.tv_usec #define Platform_unlink(n, n__len) unlink((char*)n) -#define Platform_writefile(fd, p, l) write(fd, (void*)(SYSTEM_ADRINT)(p), l) +#define Platform_writefile(fd, p, l) write(fd, (void*)(uintptr)(p), l) BOOLEAN Platform_TooManyFiles (int16 e) { @@ -230,7 +230,7 @@ void Platform_Init (int16 argc, int32 argvadr) Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; Platform_ArgCount = argc; - av = (Platform_ArgVecPtr)(SYSTEM_ADRINT)argvadr; + av = (Platform_ArgVecPtr)(uintptr)argvadr; Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; Platform_HeapInitHeap(); @@ -530,7 +530,7 @@ int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n) int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n) { int16 _o_result; - *n = Platform_readfile(h, (SYSTEM_ADRINT)b, b__len); + *n = Platform_readfile(h, (uintptr)b, b__len); if (*n < 0) { *n = 0; _o_result = Platform_err(); @@ -766,7 +766,7 @@ static void Platform_TestLittleEndian (void) { int16 i; i = 1; - __GET((SYSTEM_ADRINT)&i, Platform_LittleEndian, BOOLEAN); + __GET((uintptr)&i, Platform_LittleEndian, BOOLEAN); } __TDESC(Platform_FileIdentity, 1, 0) = {__TDFLDS("FileIdentity", 12), {-4}}; diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index a4c001f3..bed97db3 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 4e271371..32931aec 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -58,7 +58,7 @@ int16 Reals_Expo (REAL x) { int16 _o_result; int16 i; - __GET((SYSTEM_ADRINT)&x + 2, i, int16); + __GET((uintptr)&x + 2, i, int16); _o_result = __MASK(__ASHR(i, 7), -256); return _o_result; } @@ -66,17 +66,17 @@ int16 Reals_Expo (REAL x) void Reals_SetExpo (REAL *x, int16 ex) { CHAR c; - __GET((SYSTEM_ADRINT)x + 3, c, CHAR); - __PUT((SYSTEM_ADRINT)x + 3, (CHAR)(__ASHL(__ASHR((int16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); - __GET((SYSTEM_ADRINT)x + 2, c, CHAR); - __PUT((SYSTEM_ADRINT)x + 2, (CHAR)(__MASK((int16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); + __GET((uintptr)x + 3, c, CHAR); + __PUT((uintptr)x + 3, (CHAR)(__ASHL(__ASHR((int16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __GET((uintptr)x + 2, c, CHAR); + __PUT((uintptr)x + 2, (CHAR)(__MASK((int16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } int16 Reals_ExpoL (LONGREAL x) { int16 _o_result; int16 i; - __GET((SYSTEM_ADRINT)&x + 6, i, int16); + __GET((uintptr)&x + 6, i, int16); _o_result = __MASK(__ASHR(i, 4), -2048); return _o_result; } diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index b1e62271..38d206bb 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/SYSTEM.h b/bootstrap/unix-48/SYSTEM.h index c83f69f1..31fa97c5 100644 --- a/bootstrap/unix-48/SYSTEM.h +++ b/bootstrap/unix-48/SYSTEM.h @@ -39,8 +39,8 @@ typedef unsigned short int uint16; typedef signed char int8; typedef unsigned char uint8; -#define uintptr size_t - +//#define uintptr size_t +#define uintptr int64 // The compiler uses 'import' and 'export' which translate to 'extern' and // nothing respectively. @@ -255,8 +255,8 @@ extern void Platform_AssertFail(LONGINT x); // Memory allocation -extern SYSTEM_PTR Heap_NEWBLK (LONGINT size); -extern SYSTEM_PTR Heap_NEWREC (LONGINT tag); +extern SYSTEM_PTR Heap_NEWBLK (uintptr size); +extern SYSTEM_PTR Heap_NEWREC (uintptr tag); extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __SYSNEW(p, len) p = Heap_NEWBLK((LONGINT)(len)) diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index 439a49e9..728d163f 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index 681fcf1c..6e1bcc56 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index e3516799..343d9491 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Files.h" #include "Modules.h" diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index b8f301f7..776889ff 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/Vishap.c b/bootstrap/unix-48/Vishap.c index 9224220a..f2e2ae7d 100644 --- a/bootstrap/unix-48/Vishap.c +++ b/bootstrap/unix-48/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkamSf */ #include "SYSTEM.h" #include "Configuration.h" #include "Heap.h" diff --git a/bootstrap/unix-48/errors.c b/bootstrap/unix-48/errors.c index 6e4f20e5..0dc0c60a 100644 --- a/bootstrap/unix-48/errors.c +++ b/bootstrap/unix-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/unix-48/errors.h b/bootstrap/unix-48/errors.h index f06c706d..4415a5f2 100644 --- a/bootstrap/unix-48/errors.h +++ b/bootstrap/unix-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index 00be6a22..6a7aab56 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index 9d9202c0..4e806a33 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/vt100.c b/bootstrap/unix-48/vt100.c index 8ca75a42..447b9c81 100644 --- a/bootstrap/unix-48/vt100.c +++ b/bootstrap/unix-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Strings.h" diff --git a/bootstrap/unix-48/vt100.h b/bootstrap/unix-48/vt100.h index 901eed38..3d9d98a7 100644 --- a/bootstrap/unix-48/vt100.h +++ b/bootstrap/unix-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index ea06c48a..b1d34288 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -14,6 +14,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/02] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/03] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index 1e741041..5fbd4f23 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Console.c b/bootstrap/unix-88/Console.c index 32b4d836..b285b3ec 100644 --- a/bootstrap/unix-88/Console.c +++ b/bootstrap/unix-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Platform.h" @@ -22,7 +22,7 @@ export void Console_String (CHAR *s, LONGINT s__len); void Console_Flush (void) { int32 error; - error = Platform_Write(1, (SYSTEM_ADRINT)Console_line, Console_pos); + error = Platform_Write(1, (uintptr)Console_line, Console_pos); Console_pos = 0; } diff --git a/bootstrap/unix-88/Console.h b/bootstrap/unix-88/Console.h index 432a6e71..51684091 100644 --- a/bootstrap/unix-88/Console.h +++ b/bootstrap/unix-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 55714eaa..14855929 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -258,7 +258,7 @@ static void Files_Flush (Files_Buffer buf) if (buf->org != f->pos) { error = Platform_Seek(f->fd, buf->org, Platform_SeekSet); } - error = Platform_Write(f->fd, (SYSTEM_ADRINT)buf->data, buf->size); + error = Platform_Write(f->fd, (uintptr)buf->data, buf->size); if (error != 0) { Files_Err((CHAR*)"error writing file", 19, f, error); } @@ -657,7 +657,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x } else { min = n; } - __MOVE((SYSTEM_ADRINT)buf->data + offset, (SYSTEM_ADRINT)x + xpos, min); + __MOVE((uintptr)buf->data + offset, (uintptr)x + xpos, min); offset += min; (*r).offset = offset; xpos += min; @@ -722,7 +722,7 @@ void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT } else { min = n; } - __MOVE((SYSTEM_ADRINT)x + xpos, (SYSTEM_ADRINT)buf->data + offset, min); + __MOVE((uintptr)x + xpos, (uintptr)buf->data + offset, min); offset += min; (*r).offset = offset; if (offset > buf->size) { @@ -773,15 +773,15 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int *res = 3; return; } - error = Platform_Read(fdold, (SYSTEM_ADRINT)buf, 4096, &n); + error = Platform_Read(fdold, (uintptr)buf, 4096, &n); while (n > 0) { - error = Platform_Write(fdnew, (SYSTEM_ADRINT)buf, n); + error = Platform_Write(fdnew, (uintptr)buf, n); if (error != 0) { ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); Files_Err((CHAR*)"cannot move file", 17, NIL, error); } - error = Platform_Read(fdold, (SYSTEM_ADRINT)buf, 4096, &n); + error = Platform_Read(fdold, (uintptr)buf, 4096, &n); } ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); @@ -839,7 +839,7 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *de j += 1; } } else { - __MOVE((SYSTEM_ADRINT)src, (SYSTEM_ADRINT)dest, src__len); + __MOVE((uintptr)src, (uintptr)dest, src__len); } } @@ -1009,7 +1009,7 @@ static void Files_Finalize (SYSTEM_PTR o) { Files_File f = NIL; int64 res; - f = (Files_File)(SYSTEM_ADRINT)o; + f = (Files_File)(uintptr)o; if (f->fd >= 0) { Files_CloseOSFile(f); if (f->tempFile) { @@ -1022,7 +1022,7 @@ void Files_SetSearchPath (CHAR *path, LONGINT path__len) { __DUP(path, path__len, CHAR); if (Strings_Length(path, path__len) != 0) { - Files_SearchPath = __NEWARR(NIL, 1, 1, 1, 1, ((SYSTEM_ADRINT)((Strings_Length(path, path__len) + 1)))); + Files_SearchPath = __NEWARR(NIL, 1, 1, 1, 1, ((uintptr)((Strings_Length(path, path__len) + 1)))); __COPY(path, Files_SearchPath->data, Files_SearchPath->len[0]); } else { Files_SearchPath = NIL; diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 4dcd76c5..fb2ef55f 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index ba7f69f4..1f1b65b4 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tskSfF */ #define LARGE #include "SYSTEM.h" @@ -35,7 +35,7 @@ typedef typedef struct Heap_FinDesc { Heap_FinNode next; - int64 obj; + uintptr obj; BOOLEAN marked; Heap_Finalizer finalize; } Heap_FinDesc; @@ -61,10 +61,10 @@ typedef export SYSTEM_PTR Heap_modules; static int64 Heap_freeList[10]; static int64 Heap_bigBlocks; -export int64 Heap_allocated; +export uintptr Heap_allocated; static BOOLEAN Heap_firstTry; -static int64 Heap_heap, Heap_heapend; -export int64 Heap_heapsize; +static uintptr Heap_heap, Heap_heapend; +export uintptr Heap_heapsize; static Heap_FinNode Heap_fin; static int32 Heap_lockdepth; static BOOLEAN Heap_interrupted; @@ -88,12 +88,12 @@ static void Heap_Mark (int64 q); static void Heap_MarkCandidates (int64 n, int64 *cand, LONGINT cand__len); static void Heap_MarkP (SYSTEM_PTR p); static void Heap_MarkStack (int64 n, int64 *cand, LONGINT cand__len); -export SYSTEM_PTR Heap_NEWBLK (int64 size); -export SYSTEM_PTR Heap_NEWREC (int64 tag); -static int64 Heap_NewChunk (int64 blksz); +export SYSTEM_PTR Heap_NEWBLK (uintptr size); +export SYSTEM_PTR Heap_NEWREC (uintptr tag); +static uintptr Heap_NewChunk (uintptr blksz); export void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); export SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -export void Heap_REGTYP (Heap_Module m, int64 typ); +export void Heap_REGTYP (Heap_Module m, uintptr typ); export void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); static void Heap_Scan (void); static void Heap_Sift (int64 l, int64 r, int64 *a, LONGINT a__len); @@ -102,7 +102,7 @@ export void Heap_Unlock (void); extern void *Heap__init(); extern LONGINT Platform_MainStackFrame; extern uintptr Platform_OSAllocate(uintptr size); -#define Heap_FetchAddress(pointer) (LONGINT)(SYSTEM_ADRINT)(*((void**)((SYSTEM_ADRINT)pointer))) +#define Heap_FetchAddress(pointer) (uintptr)(*((void**)((uintptr)pointer))) #define Heap_HeapModuleInit() Heap__init() #define Heap_OSAllocate(size) Platform_OSAllocate(size) #define Heap_PlatformHalt(code) Platform_Halt(code) @@ -135,7 +135,7 @@ SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) __COPY(name, m->name, 20); m->refcnt = 0; m->enumPtrs = enumPtrs; - m->next = (Heap_Module)(SYSTEM_ADRINT)Heap_modules; + m->next = (Heap_Module)(uintptr)Heap_modules; Heap_modules = (SYSTEM_PTR)m; _o_result = (void*)m; return _o_result; @@ -155,7 +155,7 @@ void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) m->cmds = c; } -void Heap_REGTYP (Heap_Module m, int64 typ) +void Heap_REGTYP (Heap_Module m, uintptr typ) { __PUT(typ, m->types, int64); m->types = typ; @@ -166,15 +166,15 @@ void Heap_INCREF (Heap_Module m) m->refcnt += 1; } -static int64 Heap_NewChunk (int64 blksz) +static uintptr Heap_NewChunk (uintptr blksz) { - int64 _o_result; - int64 chnk; + uintptr _o_result; + uintptr chnk; chnk = Heap_OSAllocate(blksz + 24); if (chnk != 0) { - __PUT(chnk + 8, chnk + (24 + blksz), int64); - __PUT(chnk + 24, chnk + 32, int64); - __PUT(chnk + 32, blksz, int64); + __PUT(chnk + 8, chnk + (24 + blksz), uintptr); + __PUT(chnk + 24, chnk + 32, uintptr); + __PUT(chnk + 32, blksz, uintptr); __PUT(chnk + 40, -8, int64); __PUT(chnk + 48, Heap_bigBlocks, int64); Heap_bigBlocks = chnk + 24; @@ -195,7 +195,7 @@ static void Heap_ExtendHeap (int64 blksz) chnk = Heap_NewChunk(size); if (chnk != 0) { if (chnk < Heap_heap) { - __PUT(chnk, Heap_heap, int64); + __PUT(chnk, Heap_heap, uintptr); Heap_heap = chnk; } else { j = Heap_heap; @@ -213,10 +213,10 @@ static void Heap_ExtendHeap (int64 blksz) } } -SYSTEM_PTR Heap_NEWREC (int64 tag) +SYSTEM_PTR Heap_NEWREC (uintptr tag) { SYSTEM_PTR _o_result; - int64 i, i0, di, blksz, restsize, t, adr, end, next, prev; + uintptr i, i0, di, blksz, restsize, t, adr, end, next, prev; SYSTEM_PTR new; Heap_Lock(); blksz = Heap_FetchAddress(tag); @@ -236,10 +236,10 @@ SYSTEM_PTR Heap_NEWREC (int64 tag) di = i - i0; restsize = __ASHL(di, 5); end = adr + restsize; - __PUT(end + 8, blksz, int64); + __PUT(end + 8, blksz, uintptr); __PUT(end + 16, -8, int64); __PUT(end, end + 8, int64); - __PUT(adr + 8, restsize, int64); + __PUT(adr + 8, restsize, uintptr); __PUT(adr + 24, Heap_freeList[di], int64); Heap_freeList[di] = adr; adr += restsize; @@ -280,21 +280,21 @@ SYSTEM_PTR Heap_NEWREC (int64 tag) } restsize = t - blksz; end = adr + restsize; - __PUT(end + 8, blksz, int64); + __PUT(end + 8, blksz, uintptr); __PUT(end + 16, -8, int64); __PUT(end, end + 8, int64); if (restsize > 288) { - __PUT(adr + 8, restsize, int64); + __PUT(adr + 8, restsize, uintptr); } else { next = Heap_FetchAddress(adr + 24); if (prev == 0) { Heap_bigBlocks = next; } else { - __PUT(prev + 24, next, int64); + __PUT(prev + 24, next, uintptr); } if (restsize > 0) { di = __ASHR(restsize, 5); - __PUT(adr + 8, restsize, int64); + __PUT(adr + 8, restsize, uintptr); __PUT(adr + 24, Heap_freeList[di], int64); Heap_freeList[di] = adr; } @@ -311,28 +311,28 @@ SYSTEM_PTR Heap_NEWREC (int64 tag) i += 32; } __PUT(adr + 24, 0, int64); - __PUT(adr, tag, int64); + __PUT(adr, tag, uintptr); __PUT(adr + 8, 0, int64); __PUT(adr + 16, 0, int64); Heap_allocated += blksz; Heap_Unlock(); - _o_result = (SYSTEM_PTR)(SYSTEM_ADRINT)(adr + 8); + _o_result = (SYSTEM_PTR)(uintptr)(adr + 8); return _o_result; } -SYSTEM_PTR Heap_NEWBLK (int64 size) +SYSTEM_PTR Heap_NEWBLK (uintptr size) { SYSTEM_PTR _o_result; - int64 blksz, tag; + uintptr blksz, tag; SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 63, 5), 5); - new = Heap_NEWREC((SYSTEM_ADRINT)&blksz); - tag = ((int64)(SYSTEM_ADRINT)new + blksz) - 24; + new = Heap_NEWREC((uintptr)&blksz); + tag = (((int64)(uintptr)new) + blksz) - 24; __PUT(tag - 8, 0, int64); - __PUT(tag, blksz, int64); + __PUT(tag, blksz, uintptr); __PUT(tag + 8, -8, int64); - __PUT((int64)(SYSTEM_ADRINT)new - 8, tag, int64); + __PUT((int64)(uintptr)new - 8, tag, uintptr); Heap_Unlock(); _o_result = new; return _o_result; @@ -361,7 +361,7 @@ static void Heap_Mark (int64 q) __GET(tag, offset, int64); fld = q + offset; p = Heap_FetchAddress(fld); - __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)n, SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(uintptr)n, SYSTEM_PTR); } else { fld = q + offset; n = Heap_FetchAddress(fld); @@ -370,7 +370,7 @@ static void Heap_Mark (int64 q) if (!__ODD(tagbits)) { __PUT(n - 8, tagbits + 1, int64); __PUT(q - 8, tag + 1, int64); - __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)p, SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(uintptr)p, SYSTEM_PTR); p = q; q = n; tag = tagbits; @@ -385,12 +385,12 @@ static void Heap_Mark (int64 q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((int64)(SYSTEM_ADRINT)p); + Heap_Mark((int64)(uintptr)p); } static void Heap_Scan (void) { - int64 chnk, adr, end, start, tag, i, size, freesize; + uintptr chnk, adr, end, start, tag, i, size, freesize; Heap_bigBlocks = 0; i = 1; while (i < 9) { @@ -408,8 +408,8 @@ static void Heap_Scan (void) if (__ODD(tag)) { if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 8, int64); - __PUT(start + 8, freesize, int64); + __PUT(start, start + 8, uintptr); + __PUT(start + 8, freesize, uintptr); __PUT(start + 16, -8, int64); i = __ASHR(freesize, 5); freesize = 0; @@ -422,7 +422,7 @@ static void Heap_Scan (void) } } tag -= 1; - __PUT(adr, tag, int64); + __PUT(adr, tag, uintptr); size = Heap_FetchAddress(tag); Heap_allocated += size; adr += size; @@ -434,8 +434,8 @@ static void Heap_Scan (void) } if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 8, int64); - __PUT(start + 8, freesize, int64); + __PUT(start, start + 8, uintptr); + __PUT(start + 8, freesize, uintptr); __PUT(start + 16, -8, int64); i = __ASHR(freesize, 5); freesize = 0; @@ -554,7 +554,7 @@ static void Heap_Finalize (void) } else { prev->next = n->next; } - (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); + (*n->finalize)((SYSTEM_PTR)(uintptr)n->obj); if (prev == NIL) { n = Heap_fin; } else { @@ -573,7 +573,7 @@ void Heap_FINALL (void) while (Heap_fin != NIL) { n = Heap_fin; Heap_fin = Heap_fin->next; - (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); + (*n->finalize)((SYSTEM_PTR)(uintptr)n->obj); } } @@ -590,9 +590,9 @@ static void Heap_MarkStack (int64 n, int64 *cand, LONGINT cand__len) } if (n == 0) { nofcand = 0; - sp = (SYSTEM_ADRINT)&frame; + sp = (uintptr)&frame; stack0 = Heap_PlatformMainStackFrame(); - inc = (SYSTEM_ADRINT)&align.p - (SYSTEM_ADRINT)&align; + inc = (uintptr)&align.p - (uintptr)&align; if (sp > stack0) { inc = -inc; } @@ -623,7 +623,7 @@ void Heap_GC (BOOLEAN markStack) int64 cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); - m = (Heap_Module)(SYSTEM_ADRINT)Heap_modules; + m = (Heap_Module)(uintptr)Heap_modules; while (m != NIL) { if (m->enumPtrs != NIL) { (*m->enumPtrs)(Heap_MarkP); @@ -700,7 +700,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (int64)(SYSTEM_ADRINT)obj; + f->obj = (int64)(uintptr)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index e07b0d1e..82ba661b 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h @@ -32,7 +32,7 @@ typedef import SYSTEM_PTR Heap_modules; -import int64 Heap_allocated, Heap_heapsize; +import uintptr Heap_allocated, Heap_heapsize; import int32 Heap_FileCount; import LONGINT *Heap_ModuleDesc__typ; @@ -42,11 +42,11 @@ import void Heap_GC (BOOLEAN markStack); import void Heap_INCREF (Heap_Module m); import void Heap_InitHeap (void); import void Heap_Lock (void); -import SYSTEM_PTR Heap_NEWBLK (int64 size); -import SYSTEM_PTR Heap_NEWREC (int64 tag); +import SYSTEM_PTR Heap_NEWBLK (uintptr size); +import SYSTEM_PTR Heap_NEWREC (uintptr tag); import void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); import SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -import void Heap_REGTYP (Heap_Module m, int64 typ); +import void Heap_REGTYP (Heap_Module m, uintptr typ); import void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); import void Heap_Unlock (void); import void *Heap__init(void); diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 3cc9156d..7db3d54c 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index f1bcc92f..fe368fa3 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index ad99f16a..bab019ae 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" @@ -2197,7 +2197,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) if (((x->class == 8 || x->class == 9) || __IN(f, 0x0501)) || x->typ->comp == 3) { OPB_err(126); } - if (x->typ->size < p->typ->size) { + if ((x->class != 7 && x->typ->size < p->typ->size)) { OPB_err(-308); } t = OPT_NewNode(11); diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index 82eb03c4..6b193164 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index f67c2556..ee075a94 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index 42f6f30d..90ff6275 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index fb89bcd6..44c0d929 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -545,7 +545,7 @@ void OPM_FPrintReal (int64 *fp, REAL real) { int32 i; int64 l; - __GET((SYSTEM_ADRINT)&real, i, int32); + __GET((uintptr)&real, i, int32); l = i; OPM_FPrint(&*fp, l); } diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index 72257311..3e1ddd3d 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index e270236a..0ac463ca 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPB.h" diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index 9897c9c2..bd26983c 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index d07d06ca..5ae4fbdf 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index 2aee5b21..5fcf9030 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index 6fd27531..94145f3d 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 349849e8..e2409b86 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index d3aa0a87..a99c5bfe 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPC.h" @@ -940,7 +940,7 @@ static void OPV_expr (OPT_Node n, int32 prec) OPM_Write(')'); break; case 24: - OPM_WriteString((CHAR*)"(SYSTEM_ADRINT)", 16); + OPM_WriteString((CHAR*)"(uintptr)", 10); if (l->class == 1) { OPC_CompleteIdent(l->obj); } else { @@ -956,7 +956,7 @@ static void OPV_expr (OPT_Node n, int32 prec) OPC_Ident(n->typ->strobj); OPM_Write(')'); if (__IN(n->typ->form, 0x1800) || __IN(l->typ->form, 0x1800)) { - OPM_WriteString((CHAR*)"(SYSTEM_ADRINT)", 16); + OPM_WriteString((CHAR*)"(uintptr)", 10); } OPV_expr(l, exprPrec); } else { @@ -1328,7 +1328,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) if (x->class == 7) { OPC_IntLiteral(x->conval->intval, OPM_PointerSize); } else { - OPM_WriteString((CHAR*)"((SYSTEM_ADRINT)(", 18); + OPM_WriteString((CHAR*)"((uintptr)(", 12); OPV_expr(x, 10); OPM_WriteString((CHAR*)"))", 3); } diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index 09b50b36..6e3e6c65 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 2a6381d8..7895f7e6 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -140,13 +140,13 @@ extern void Heap_InitHeap(); #define Platform_opennew(n, n__len) open((char*)n, O_CREAT | O_TRUNC | O_RDWR, 0664) #define Platform_openro(n, n__len) open((char*)n, O_RDONLY) #define Platform_openrw(n, n__len) open((char*)n, O_RDWR) -#define Platform_readfile(fd, p, l) read(fd, (void*)(SYSTEM_ADRINT)(p), l) +#define Platform_readfile(fd, p, l) read(fd, (void*)(uintptr)(p), l) #define Platform_rename(o, o__len, n, n__len) rename((char*)o, (char*)n) #define Platform_sectotm(s) struct tm *time = localtime((time_t*)&s) #define Platform_seekcur() SEEK_CUR #define Platform_seekend() SEEK_END #define Platform_seekset() SEEK_SET -#define Platform_sethandler(s, h) SystemSetHandler(s, (SYSTEM_ADRINT)h) +#define Platform_sethandler(s, h) SystemSetHandler(s, (uintptr)h) #define Platform_stat(n, n__len) stat((char*)n, &s) #define Platform_statdev() (LONGINT)s.st_dev #define Platform_statino() (LONGINT)s.st_ino @@ -163,7 +163,7 @@ extern void Heap_InitHeap(); #define Platform_tvsec() tv.tv_sec #define Platform_tvusec() tv.tv_usec #define Platform_unlink(n, n__len) unlink((char*)n) -#define Platform_writefile(fd, p, l) write(fd, (void*)(SYSTEM_ADRINT)(p), l) +#define Platform_writefile(fd, p, l) write(fd, (void*)(uintptr)(p), l) BOOLEAN Platform_TooManyFiles (int32 e) { @@ -231,7 +231,7 @@ void Platform_Init (int32 argc, int64 argvadr) Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; Platform_ArgCount = argc; - av = (Platform_ArgVecPtr)(SYSTEM_ADRINT)argvadr; + av = (Platform_ArgVecPtr)(uintptr)argvadr; Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; Platform_HeapInitHeap(); @@ -264,7 +264,7 @@ void Platform_GetArg (int32 n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { - av = (Platform_ArgVec)(SYSTEM_ADRINT)Platform_ArgVector; + av = (Platform_ArgVec)(uintptr)Platform_ArgVector; __COPY(*(*av)[__X(n, 1024)], val, val__len); } } @@ -531,7 +531,7 @@ int32 Platform_Read (int64 h, int64 p, int64 l, int64 *n) int32 Platform_ReadBuf (int64 h, SYSTEM_BYTE *b, LONGINT b__len, int64 *n) { int32 _o_result; - *n = Platform_readfile(h, (SYSTEM_ADRINT)b, b__len); + *n = Platform_readfile(h, (uintptr)b, b__len); if (*n < 0) { *n = 0; _o_result = Platform_err(); @@ -767,7 +767,7 @@ static void Platform_TestLittleEndian (void) { int32 i; i = 1; - __GET((SYSTEM_ADRINT)&i, Platform_LittleEndian, BOOLEAN); + __GET((uintptr)&i, Platform_LittleEndian, BOOLEAN); } __TDESC(Platform_FileIdentity, 1, 0) = {__TDFLDS("FileIdentity", 24), {-8}}; diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index 63531c58..7b310e29 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index d6e77abf..4aafefde 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -59,7 +59,7 @@ int32 Reals_Expo (REAL x) { int32 _o_result; int32 i; - __GET((SYSTEM_ADRINT)&x + 2, i, int32); + __GET((uintptr)&x + 2, i, int32); _o_result = __MASK(__ASHR(i, 7), -256); return _o_result; } @@ -67,17 +67,17 @@ int32 Reals_Expo (REAL x) void Reals_SetExpo (REAL *x, int32 ex) { CHAR c; - __GET((SYSTEM_ADRINT)x + 3, c, CHAR); - __PUT((SYSTEM_ADRINT)x + 3, (CHAR)(__ASHL(__ASHR(c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); - __GET((SYSTEM_ADRINT)x + 2, c, CHAR); - __PUT((SYSTEM_ADRINT)x + 2, (CHAR)(__MASK(c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); + __GET((uintptr)x + 3, c, CHAR); + __PUT((uintptr)x + 3, (CHAR)(__ASHL(__ASHR(c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __GET((uintptr)x + 2, c, CHAR); + __PUT((uintptr)x + 2, (CHAR)(__MASK(c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } int32 Reals_ExpoL (LONGREAL x) { int32 _o_result; int32 i; - __GET((SYSTEM_ADRINT)&x + 6, i, int32); + __GET((uintptr)&x + 6, i, int32); _o_result = __MASK(__ASHR(i, 4), -2048); return _o_result; } diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index 2c04bec3..1b6d1f96 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/SYSTEM.h b/bootstrap/unix-88/SYSTEM.h index c83f69f1..31fa97c5 100644 --- a/bootstrap/unix-88/SYSTEM.h +++ b/bootstrap/unix-88/SYSTEM.h @@ -39,8 +39,8 @@ typedef unsigned short int uint16; typedef signed char int8; typedef unsigned char uint8; -#define uintptr size_t - +//#define uintptr size_t +#define uintptr int64 // The compiler uses 'import' and 'export' which translate to 'extern' and // nothing respectively. @@ -255,8 +255,8 @@ extern void Platform_AssertFail(LONGINT x); // Memory allocation -extern SYSTEM_PTR Heap_NEWBLK (LONGINT size); -extern SYSTEM_PTR Heap_NEWREC (LONGINT tag); +extern SYSTEM_PTR Heap_NEWBLK (uintptr size); +extern SYSTEM_PTR Heap_NEWREC (uintptr tag); extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __SYSNEW(p, len) p = Heap_NEWBLK((LONGINT)(len)) diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index 769cecb7..abf00b3b 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index 012e77f9..5280395c 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index 934bc227..e8858afa 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Files.h" diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index fbd8a7a4..990d15c3 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/Vishap.c b/bootstrap/unix-88/Vishap.c index f781d7ee..bed71868 100644 --- a/bootstrap/unix-88/Vishap.c +++ b/bootstrap/unix-88/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkamSf */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/unix-88/errors.c b/bootstrap/unix-88/errors.c index b1aa1639..2f0938c0 100644 --- a/bootstrap/unix-88/errors.c +++ b/bootstrap/unix-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/unix-88/errors.h b/bootstrap/unix-88/errors.h index 049c862a..c2bb7560 100644 --- a/bootstrap/unix-88/errors.h +++ b/bootstrap/unix-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index 51975db4..b9d03b09 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index 3cba883d..30095155 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/vt100.c b/bootstrap/unix-88/vt100.c index dfa8df9c..5dd451e1 100644 --- a/bootstrap/unix-88/vt100.c +++ b/bootstrap/unix-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/unix-88/vt100.h b/bootstrap/unix-88/vt100.h index 139b592e..bcc323cc 100644 --- a/bootstrap/unix-88/vt100.h +++ b/bootstrap/unix-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index 194e9da8..5cfd3bbe 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -13,6 +13,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/02] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/03] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index fbca10e0..28ac1853 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Console.c b/bootstrap/windows-48/Console.c index 5b63f566..c69949e1 100644 --- a/bootstrap/windows-48/Console.c +++ b/bootstrap/windows-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Platform.h" @@ -21,7 +21,7 @@ export void Console_String (CHAR *s, LONGINT s__len); void Console_Flush (void) { int16 error; - error = Platform_Write(Platform_StdOut, (SYSTEM_ADRINT)Console_line, Console_pos); + error = Platform_Write(Platform_StdOut, (uintptr)Console_line, Console_pos); Console_pos = 0; } diff --git a/bootstrap/windows-48/Console.h b/bootstrap/windows-48/Console.h index 3823dacc..5f33afb3 100644 --- a/bootstrap/windows-48/Console.h +++ b/bootstrap/windows-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index b53ae4ca..308a2a37 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" @@ -257,7 +257,7 @@ static void Files_Flush (Files_Buffer buf) if (buf->org != f->pos) { error = Platform_Seek(f->fd, buf->org, Platform_SeekSet); } - error = Platform_Write(f->fd, (SYSTEM_ADRINT)buf->data, buf->size); + error = Platform_Write(f->fd, (uintptr)buf->data, buf->size); if (error != 0) { Files_Err((CHAR*)"error writing file", 19, f, error); } @@ -656,7 +656,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x } else { min = n; } - __MOVE((SYSTEM_ADRINT)buf->data + offset, (SYSTEM_ADRINT)x + xpos, min); + __MOVE((uintptr)buf->data + offset, (uintptr)x + xpos, min); offset += min; (*r).offset = offset; xpos += min; @@ -721,7 +721,7 @@ void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT } else { min = n; } - __MOVE((SYSTEM_ADRINT)x + xpos, (SYSTEM_ADRINT)buf->data + offset, min); + __MOVE((uintptr)x + xpos, (uintptr)buf->data + offset, min); offset += min; (*r).offset = offset; if (offset > buf->size) { @@ -772,15 +772,15 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int *res = 3; return; } - error = Platform_Read(fdold, (SYSTEM_ADRINT)buf, 4096, &n); + error = Platform_Read(fdold, (uintptr)buf, 4096, &n); while (n > 0) { - error = Platform_Write(fdnew, (SYSTEM_ADRINT)buf, n); + error = Platform_Write(fdnew, (uintptr)buf, n); if (error != 0) { ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); Files_Err((CHAR*)"cannot move file", 17, NIL, error); } - error = Platform_Read(fdold, (SYSTEM_ADRINT)buf, 4096, &n); + error = Platform_Read(fdold, (uintptr)buf, 4096, &n); } ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); @@ -838,7 +838,7 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *de j += 1; } } else { - __MOVE((SYSTEM_ADRINT)src, (SYSTEM_ADRINT)dest, src__len); + __MOVE((uintptr)src, (uintptr)dest, src__len); } } @@ -1008,7 +1008,7 @@ static void Files_Finalize (SYSTEM_PTR o) { Files_File f = NIL; int32 res; - f = (Files_File)(SYSTEM_ADRINT)o; + f = (Files_File)(uintptr)o; if (f->fd >= 0) { Files_CloseOSFile(f); if (f->tempFile) { @@ -1021,7 +1021,7 @@ void Files_SetSearchPath (CHAR *path, LONGINT path__len) { __DUP(path, path__len, CHAR); if (Strings_Length(path, path__len) != 0) { - Files_SearchPath = __NEWARR(NIL, 1, 1, 1, 1, ((SYSTEM_ADRINT)((Strings_Length(path, path__len) + 1)))); + Files_SearchPath = __NEWARR(NIL, 1, 1, 1, 1, ((uintptr)((Strings_Length(path, path__len) + 1)))); __COPY(path, Files_SearchPath->data, Files_SearchPath->len[0]); } else { Files_SearchPath = NIL; diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index c216c6c6..41cd7233 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index 2315b64e..8f51e615 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tskSfF */ #include "SYSTEM.h" struct Heap__1 { @@ -34,7 +34,7 @@ typedef typedef struct Heap_FinDesc { Heap_FinNode next; - int32 obj; + uintptr obj; BOOLEAN marked; Heap_Finalizer finalize; } Heap_FinDesc; @@ -60,10 +60,10 @@ typedef export SYSTEM_PTR Heap_modules; static int32 Heap_freeList[10]; static int32 Heap_bigBlocks; -export int32 Heap_allocated; +export uintptr Heap_allocated; static BOOLEAN Heap_firstTry; -static int32 Heap_heap, Heap_heapend; -export int32 Heap_heapsize; +static uintptr Heap_heap, Heap_heapend; +export uintptr Heap_heapsize; static Heap_FinNode Heap_fin; static int16 Heap_lockdepth; static BOOLEAN Heap_interrupted; @@ -87,12 +87,12 @@ static void Heap_Mark (int32 q); static void Heap_MarkCandidates (int32 n, int32 *cand, LONGINT cand__len); static void Heap_MarkP (SYSTEM_PTR p); static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len); -export SYSTEM_PTR Heap_NEWBLK (int32 size); -export SYSTEM_PTR Heap_NEWREC (int32 tag); -static int32 Heap_NewChunk (int32 blksz); +export SYSTEM_PTR Heap_NEWBLK (uintptr size); +export SYSTEM_PTR Heap_NEWREC (uintptr tag); +static uintptr Heap_NewChunk (uintptr blksz); export void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); export SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -export void Heap_REGTYP (Heap_Module m, int32 typ); +export void Heap_REGTYP (Heap_Module m, uintptr typ); export void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); static void Heap_Scan (void); static void Heap_Sift (int32 l, int32 r, int32 *a, LONGINT a__len); @@ -101,7 +101,7 @@ export void Heap_Unlock (void); extern void *Heap__init(); extern LONGINT Platform_MainStackFrame; extern uintptr Platform_OSAllocate(uintptr size); -#define Heap_FetchAddress(pointer) (LONGINT)(SYSTEM_ADRINT)(*((void**)((SYSTEM_ADRINT)pointer))) +#define Heap_FetchAddress(pointer) (uintptr)(*((void**)((uintptr)pointer))) #define Heap_HeapModuleInit() Heap__init() #define Heap_OSAllocate(size) Platform_OSAllocate(size) #define Heap_PlatformHalt(code) Platform_Halt(code) @@ -134,7 +134,7 @@ SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) __COPY(name, m->name, 20); m->refcnt = 0; m->enumPtrs = enumPtrs; - m->next = (Heap_Module)(SYSTEM_ADRINT)Heap_modules; + m->next = (Heap_Module)(uintptr)Heap_modules; Heap_modules = (SYSTEM_PTR)m; _o_result = (void*)m; return _o_result; @@ -154,7 +154,7 @@ void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) m->cmds = c; } -void Heap_REGTYP (Heap_Module m, int32 typ) +void Heap_REGTYP (Heap_Module m, uintptr typ) { __PUT(typ, m->types, int32); m->types = typ; @@ -165,15 +165,15 @@ void Heap_INCREF (Heap_Module m) m->refcnt += 1; } -static int32 Heap_NewChunk (int32 blksz) +static uintptr Heap_NewChunk (uintptr blksz) { - int32 _o_result; - int32 chnk; + uintptr _o_result; + uintptr chnk; chnk = Heap_OSAllocate(blksz + 12); if (chnk != 0) { - __PUT(chnk + 4, chnk + (12 + blksz), int32); - __PUT(chnk + 12, chnk + 16, int32); - __PUT(chnk + 16, blksz, int32); + __PUT(chnk + 4, chnk + (12 + blksz), uintptr); + __PUT(chnk + 12, chnk + 16, uintptr); + __PUT(chnk + 16, blksz, uintptr); __PUT(chnk + 20, -4, int32); __PUT(chnk + 24, Heap_bigBlocks, int32); Heap_bigBlocks = chnk + 12; @@ -194,7 +194,7 @@ static void Heap_ExtendHeap (int32 blksz) chnk = Heap_NewChunk(size); if (chnk != 0) { if (chnk < Heap_heap) { - __PUT(chnk, Heap_heap, int32); + __PUT(chnk, Heap_heap, uintptr); Heap_heap = chnk; } else { j = Heap_heap; @@ -212,10 +212,10 @@ static void Heap_ExtendHeap (int32 blksz) } } -SYSTEM_PTR Heap_NEWREC (int32 tag) +SYSTEM_PTR Heap_NEWREC (uintptr tag) { SYSTEM_PTR _o_result; - int32 i, i0, di, blksz, restsize, t, adr, end, next, prev; + uintptr i, i0, di, blksz, restsize, t, adr, end, next, prev; SYSTEM_PTR new; Heap_Lock(); blksz = Heap_FetchAddress(tag); @@ -235,10 +235,10 @@ SYSTEM_PTR Heap_NEWREC (int32 tag) di = i - i0; restsize = __ASHL(di, 4); end = adr + restsize; - __PUT(end + 4, blksz, int32); + __PUT(end + 4, blksz, uintptr); __PUT(end + 8, -4, int32); __PUT(end, end + 4, int32); - __PUT(adr + 4, restsize, int32); + __PUT(adr + 4, restsize, uintptr); __PUT(adr + 12, Heap_freeList[di], int32); Heap_freeList[di] = adr; adr += restsize; @@ -279,21 +279,21 @@ SYSTEM_PTR Heap_NEWREC (int32 tag) } restsize = t - blksz; end = adr + restsize; - __PUT(end + 4, blksz, int32); + __PUT(end + 4, blksz, uintptr); __PUT(end + 8, -4, int32); __PUT(end, end + 4, int32); if (restsize > 144) { - __PUT(adr + 4, restsize, int32); + __PUT(adr + 4, restsize, uintptr); } else { next = Heap_FetchAddress(adr + 12); if (prev == 0) { Heap_bigBlocks = next; } else { - __PUT(prev + 12, next, int32); + __PUT(prev + 12, next, uintptr); } if (restsize > 0) { di = __ASHR(restsize, 4); - __PUT(adr + 4, restsize, int32); + __PUT(adr + 4, restsize, uintptr); __PUT(adr + 12, Heap_freeList[di], int32); Heap_freeList[di] = adr; } @@ -310,28 +310,28 @@ SYSTEM_PTR Heap_NEWREC (int32 tag) i += 16; } __PUT(adr + 12, 0, int32); - __PUT(adr, tag, int32); + __PUT(adr, tag, uintptr); __PUT(adr + 4, 0, int32); __PUT(adr + 8, 0, int32); Heap_allocated += blksz; Heap_Unlock(); - _o_result = (SYSTEM_PTR)(SYSTEM_ADRINT)(adr + 4); + _o_result = (SYSTEM_PTR)(uintptr)(adr + 4); return _o_result; } -SYSTEM_PTR Heap_NEWBLK (int32 size) +SYSTEM_PTR Heap_NEWBLK (uintptr size) { SYSTEM_PTR _o_result; - int32 blksz, tag; + uintptr blksz, tag; SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 31, 4), 4); - new = Heap_NEWREC((SYSTEM_ADRINT)&blksz); - tag = ((int32)(SYSTEM_ADRINT)new + blksz) - 12; + new = Heap_NEWREC((uintptr)&blksz); + tag = (((int32)(uintptr)new) + blksz) - 12; __PUT(tag - 4, 0, int32); - __PUT(tag, blksz, int32); + __PUT(tag, blksz, uintptr); __PUT(tag + 4, -4, int32); - __PUT((int32)(SYSTEM_ADRINT)new - 4, tag, int32); + __PUT((int32)(uintptr)new - 4, tag, uintptr); Heap_Unlock(); _o_result = new; return _o_result; @@ -360,7 +360,7 @@ static void Heap_Mark (int32 q) __GET(tag, offset, int32); fld = q + offset; p = Heap_FetchAddress(fld); - __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)n, SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(uintptr)n, SYSTEM_PTR); } else { fld = q + offset; n = Heap_FetchAddress(fld); @@ -369,7 +369,7 @@ static void Heap_Mark (int32 q) if (!__ODD(tagbits)) { __PUT(n - 4, tagbits + 1, int32); __PUT(q - 4, tag + 1, int32); - __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)p, SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(uintptr)p, SYSTEM_PTR); p = q; q = n; tag = tagbits; @@ -384,12 +384,12 @@ static void Heap_Mark (int32 q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((int32)(SYSTEM_ADRINT)p); + Heap_Mark((int32)(uintptr)p); } static void Heap_Scan (void) { - int32 chnk, adr, end, start, tag, i, size, freesize; + uintptr chnk, adr, end, start, tag, i, size, freesize; Heap_bigBlocks = 0; i = 1; while (i < 9) { @@ -407,8 +407,8 @@ static void Heap_Scan (void) if (__ODD(tag)) { if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 4, int32); - __PUT(start + 4, freesize, int32); + __PUT(start, start + 4, uintptr); + __PUT(start + 4, freesize, uintptr); __PUT(start + 8, -4, int32); i = __ASHR(freesize, 4); freesize = 0; @@ -421,7 +421,7 @@ static void Heap_Scan (void) } } tag -= 1; - __PUT(adr, tag, int32); + __PUT(adr, tag, uintptr); size = Heap_FetchAddress(tag); Heap_allocated += size; adr += size; @@ -433,8 +433,8 @@ static void Heap_Scan (void) } if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 4, int32); - __PUT(start + 4, freesize, int32); + __PUT(start, start + 4, uintptr); + __PUT(start + 4, freesize, uintptr); __PUT(start + 8, -4, int32); i = __ASHR(freesize, 4); freesize = 0; @@ -553,7 +553,7 @@ static void Heap_Finalize (void) } else { prev->next = n->next; } - (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); + (*n->finalize)((SYSTEM_PTR)(uintptr)n->obj); if (prev == NIL) { n = Heap_fin; } else { @@ -572,7 +572,7 @@ void Heap_FINALL (void) while (Heap_fin != NIL) { n = Heap_fin; Heap_fin = Heap_fin->next; - (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); + (*n->finalize)((SYSTEM_PTR)(uintptr)n->obj); } } @@ -589,9 +589,9 @@ static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len) } if (n == 0) { nofcand = 0; - sp = (SYSTEM_ADRINT)&frame; + sp = (uintptr)&frame; stack0 = Heap_PlatformMainStackFrame(); - inc = (SYSTEM_ADRINT)&align.p - (SYSTEM_ADRINT)&align; + inc = (uintptr)&align.p - (uintptr)&align; if (sp > stack0) { inc = -inc; } @@ -622,7 +622,7 @@ void Heap_GC (BOOLEAN markStack) int32 cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); - m = (Heap_Module)(SYSTEM_ADRINT)Heap_modules; + m = (Heap_Module)(uintptr)Heap_modules; while (m != NIL) { if (m->enumPtrs != NIL) { (*m->enumPtrs)(Heap_MarkP); @@ -699,7 +699,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (int32)(SYSTEM_ADRINT)obj; + f->obj = (int32)(uintptr)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index 83733c20..771fc9d8 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h @@ -31,7 +31,7 @@ typedef import SYSTEM_PTR Heap_modules; -import int32 Heap_allocated, Heap_heapsize; +import uintptr Heap_allocated, Heap_heapsize; import int16 Heap_FileCount; import LONGINT *Heap_ModuleDesc__typ; @@ -41,11 +41,11 @@ import void Heap_GC (BOOLEAN markStack); import void Heap_INCREF (Heap_Module m); import void Heap_InitHeap (void); import void Heap_Lock (void); -import SYSTEM_PTR Heap_NEWBLK (int32 size); -import SYSTEM_PTR Heap_NEWREC (int32 tag); +import SYSTEM_PTR Heap_NEWBLK (uintptr size); +import SYSTEM_PTR Heap_NEWREC (uintptr tag); import void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); import SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -import void Heap_REGTYP (Heap_Module m, int32 typ); +import void Heap_REGTYP (Heap_Module m, uintptr typ); import void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); import void Heap_Unlock (void); import void *Heap__init(void); diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index e7006b76..84914960 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Heap.h" diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index 632138b5..2409c160 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index fa8f98fe..3af88ab8 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" @@ -2196,7 +2196,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) if (((x->class == 8 || x->class == 9) || __IN(f, 0x0501)) || x->typ->comp == 3) { OPB_err(126); } - if (x->typ->size < p->typ->size) { + if ((x->class != 7 && x->typ->size < p->typ->size)) { OPB_err(-308); } t = OPT_NewNode(11); diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index 8b2baa5f..47603929 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 93d60530..10b51482 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "OPM.h" diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index 78a60ed9..a13d99e4 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 19ad29af..1cd8fb97 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" @@ -544,15 +544,15 @@ void OPM_FPrintReal (int32 *fp, REAL real) { int16 i; int32 l; - __GET((SYSTEM_ADRINT)&real, l, int32); + __GET((uintptr)&real, l, int32); OPM_FPrint(&*fp, l); } void OPM_FPrintLReal (int32 *fp, LONGREAL lr) { int32 l, h; - __GET((SYSTEM_ADRINT)&lr, l, int32); - __GET((SYSTEM_ADRINT)&lr + 4, h, int32); + __GET((uintptr)&lr, l, int32); + __GET((uintptr)&lr + 4, h, int32); OPM_FPrint(&*fp, l); OPM_FPrint(&*fp, h); } diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index 44fe5275..f0a96a82 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index b0cd8613..f727dcde 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPB.h" #include "OPM.h" diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index 423013a4..b8787f9f 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index 36b37592..7a14e8c2 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index dec9c209..0e48367c 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 16dfc5b1..32d09e08 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index c290d3de..b12f68e2 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index aeef6224..7a155032 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPC.h" #include "OPM.h" @@ -939,7 +939,7 @@ static void OPV_expr (OPT_Node n, int16 prec) OPM_Write(')'); break; case 24: - OPM_WriteString((CHAR*)"(SYSTEM_ADRINT)", 16); + OPM_WriteString((CHAR*)"(uintptr)", 10); if (l->class == 1) { OPC_CompleteIdent(l->obj); } else { @@ -955,7 +955,7 @@ static void OPV_expr (OPT_Node n, int16 prec) OPC_Ident(n->typ->strobj); OPM_Write(')'); if (__IN(n->typ->form, 0x1800) || __IN(l->typ->form, 0x1800)) { - OPM_WriteString((CHAR*)"(SYSTEM_ADRINT)", 16); + OPM_WriteString((CHAR*)"(uintptr)", 10); } OPV_expr(l, exprPrec); } else { @@ -1327,7 +1327,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) if (x->class == 7) { OPC_IntLiteral(x->conval->intval, OPM_PointerSize); } else { - OPM_WriteString((CHAR*)"((SYSTEM_ADRINT)(", 18); + OPM_WriteString((CHAR*)"((uintptr)(", 12); OPV_expr(x, 10); OPM_WriteString((CHAR*)"))", 3); } diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index 8fd772f8..d45ee079 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 67dc8e39..95b8b50f 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef @@ -241,7 +241,7 @@ void Platform_Init (int16 argc, int32 argvadr) Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; Platform_ArgCount = argc; - av = (Platform_ArgVecPtr)(SYSTEM_ADRINT)argvadr; + av = (Platform_ArgVecPtr)(uintptr)argvadr; Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; Platform_HeapInitHeap(); @@ -280,7 +280,7 @@ void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { - av = (Platform_ArgVec)(SYSTEM_ADRINT)Platform_ArgVector; + av = (Platform_ArgVec)(uintptr)Platform_ArgVector; __COPY(*(*av)[__X(n, 1024)], val, val__len); } } @@ -559,7 +559,7 @@ int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n) int16 _o_result; int16 result; *n = 0; - result = Platform_readfile(h, (SYSTEM_ADRINT)b, b__len, &*n); + result = Platform_readfile(h, (uintptr)b, b__len, &*n); if (result == 0) { *n = 0; _o_result = Platform_err(); @@ -795,7 +795,7 @@ static void Platform_TestLittleEndian (void) { int16 i; i = 1; - __GET((SYSTEM_ADRINT)&i, Platform_LittleEndian, BOOLEAN); + __GET((uintptr)&i, Platform_LittleEndian, BOOLEAN); } __TDESC(Platform_FileIdentity, 1, 0) = {__TDFLDS("FileIdentity", 20), {-4}}; diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index 39074f3e..6d983649 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 4e271371..32931aec 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -58,7 +58,7 @@ int16 Reals_Expo (REAL x) { int16 _o_result; int16 i; - __GET((SYSTEM_ADRINT)&x + 2, i, int16); + __GET((uintptr)&x + 2, i, int16); _o_result = __MASK(__ASHR(i, 7), -256); return _o_result; } @@ -66,17 +66,17 @@ int16 Reals_Expo (REAL x) void Reals_SetExpo (REAL *x, int16 ex) { CHAR c; - __GET((SYSTEM_ADRINT)x + 3, c, CHAR); - __PUT((SYSTEM_ADRINT)x + 3, (CHAR)(__ASHL(__ASHR((int16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); - __GET((SYSTEM_ADRINT)x + 2, c, CHAR); - __PUT((SYSTEM_ADRINT)x + 2, (CHAR)(__MASK((int16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); + __GET((uintptr)x + 3, c, CHAR); + __PUT((uintptr)x + 3, (CHAR)(__ASHL(__ASHR((int16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __GET((uintptr)x + 2, c, CHAR); + __PUT((uintptr)x + 2, (CHAR)(__MASK((int16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } int16 Reals_ExpoL (LONGREAL x) { int16 _o_result; int16 i; - __GET((SYSTEM_ADRINT)&x + 6, i, int16); + __GET((uintptr)&x + 6, i, int16); _o_result = __MASK(__ASHR(i, 4), -2048); return _o_result; } diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index b1e62271..38d206bb 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/SYSTEM.h b/bootstrap/windows-48/SYSTEM.h index c83f69f1..31fa97c5 100644 --- a/bootstrap/windows-48/SYSTEM.h +++ b/bootstrap/windows-48/SYSTEM.h @@ -39,8 +39,8 @@ typedef unsigned short int uint16; typedef signed char int8; typedef unsigned char uint8; -#define uintptr size_t - +//#define uintptr size_t +#define uintptr int64 // The compiler uses 'import' and 'export' which translate to 'extern' and // nothing respectively. @@ -255,8 +255,8 @@ extern void Platform_AssertFail(LONGINT x); // Memory allocation -extern SYSTEM_PTR Heap_NEWBLK (LONGINT size); -extern SYSTEM_PTR Heap_NEWREC (LONGINT tag); +extern SYSTEM_PTR Heap_NEWBLK (uintptr size); +extern SYSTEM_PTR Heap_NEWREC (uintptr tag); extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __SYSNEW(p, len) p = Heap_NEWBLK((LONGINT)(len)) diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index 439a49e9..728d163f 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index 681fcf1c..6e1bcc56 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index e3516799..343d9491 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Files.h" #include "Modules.h" diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index b8f301f7..776889ff 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/Vishap.c b/bootstrap/windows-48/Vishap.c index 9224220a..f2e2ae7d 100644 --- a/bootstrap/windows-48/Vishap.c +++ b/bootstrap/windows-48/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkamSf */ #include "SYSTEM.h" #include "Configuration.h" #include "Heap.h" diff --git a/bootstrap/windows-48/errors.c b/bootstrap/windows-48/errors.c index 6e4f20e5..0dc0c60a 100644 --- a/bootstrap/windows-48/errors.c +++ b/bootstrap/windows-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/windows-48/errors.h b/bootstrap/windows-48/errors.h index f06c706d..4415a5f2 100644 --- a/bootstrap/windows-48/errors.h +++ b/bootstrap/windows-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index 00be6a22..6a7aab56 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index 9d9202c0..4e806a33 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/vt100.c b/bootstrap/windows-48/vt100.c index 8ca75a42..447b9c81 100644 --- a/bootstrap/windows-48/vt100.c +++ b/bootstrap/windows-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Strings.h" diff --git a/bootstrap/windows-48/vt100.h b/bootstrap/windows-48/vt100.h index 901eed38..3d9d98a7 100644 --- a/bootstrap/windows-48/vt100.h +++ b/bootstrap/windows-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index ea06c48a..b1d34288 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -14,6 +14,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/02] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/03] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index 1e741041..5fbd4f23 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Console.c b/bootstrap/windows-88/Console.c index 7133027a..b73a59cc 100644 --- a/bootstrap/windows-88/Console.c +++ b/bootstrap/windows-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Platform.h" @@ -22,7 +22,7 @@ export void Console_String (CHAR *s, LONGINT s__len); void Console_Flush (void) { int32 error; - error = Platform_Write(Platform_StdOut, (SYSTEM_ADRINT)Console_line, Console_pos); + error = Platform_Write(Platform_StdOut, (uintptr)Console_line, Console_pos); Console_pos = 0; } diff --git a/bootstrap/windows-88/Console.h b/bootstrap/windows-88/Console.h index 432a6e71..51684091 100644 --- a/bootstrap/windows-88/Console.h +++ b/bootstrap/windows-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 7eae4cc4..cf6feb16 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -258,7 +258,7 @@ static void Files_Flush (Files_Buffer buf) if (buf->org != f->pos) { error = Platform_Seek(f->fd, buf->org, Platform_SeekSet); } - error = Platform_Write(f->fd, (SYSTEM_ADRINT)buf->data, buf->size); + error = Platform_Write(f->fd, (uintptr)buf->data, buf->size); if (error != 0) { Files_Err((CHAR*)"error writing file", 19, f, error); } @@ -657,7 +657,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x } else { min = n; } - __MOVE((SYSTEM_ADRINT)buf->data + offset, (SYSTEM_ADRINT)x + xpos, min); + __MOVE((uintptr)buf->data + offset, (uintptr)x + xpos, min); offset += min; (*r).offset = offset; xpos += min; @@ -722,7 +722,7 @@ void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT } else { min = n; } - __MOVE((SYSTEM_ADRINT)x + xpos, (SYSTEM_ADRINT)buf->data + offset, min); + __MOVE((uintptr)x + xpos, (uintptr)buf->data + offset, min); offset += min; (*r).offset = offset; if (offset > buf->size) { @@ -773,15 +773,15 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int *res = 3; return; } - error = Platform_Read(fdold, (SYSTEM_ADRINT)buf, 4096, &n); + error = Platform_Read(fdold, (uintptr)buf, 4096, &n); while (n > 0) { - error = Platform_Write(fdnew, (SYSTEM_ADRINT)buf, n); + error = Platform_Write(fdnew, (uintptr)buf, n); if (error != 0) { ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); Files_Err((CHAR*)"cannot move file", 17, NIL, error); } - error = Platform_Read(fdold, (SYSTEM_ADRINT)buf, 4096, &n); + error = Platform_Read(fdold, (uintptr)buf, 4096, &n); } ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); @@ -839,7 +839,7 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *de j += 1; } } else { - __MOVE((SYSTEM_ADRINT)src, (SYSTEM_ADRINT)dest, src__len); + __MOVE((uintptr)src, (uintptr)dest, src__len); } } @@ -1009,7 +1009,7 @@ static void Files_Finalize (SYSTEM_PTR o) { Files_File f = NIL; int64 res; - f = (Files_File)(SYSTEM_ADRINT)o; + f = (Files_File)(uintptr)o; if (f->fd >= 0) { Files_CloseOSFile(f); if (f->tempFile) { @@ -1022,7 +1022,7 @@ void Files_SetSearchPath (CHAR *path, LONGINT path__len) { __DUP(path, path__len, CHAR); if (Strings_Length(path, path__len) != 0) { - Files_SearchPath = __NEWARR(NIL, 1, 1, 1, 1, ((SYSTEM_ADRINT)((Strings_Length(path, path__len) + 1)))); + Files_SearchPath = __NEWARR(NIL, 1, 1, 1, 1, ((uintptr)((Strings_Length(path, path__len) + 1)))); __COPY(path, Files_SearchPath->data, Files_SearchPath->len[0]); } else { Files_SearchPath = NIL; diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 9a9b3b58..0be3f73d 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index ba7f69f4..1f1b65b4 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tskSfF */ #define LARGE #include "SYSTEM.h" @@ -35,7 +35,7 @@ typedef typedef struct Heap_FinDesc { Heap_FinNode next; - int64 obj; + uintptr obj; BOOLEAN marked; Heap_Finalizer finalize; } Heap_FinDesc; @@ -61,10 +61,10 @@ typedef export SYSTEM_PTR Heap_modules; static int64 Heap_freeList[10]; static int64 Heap_bigBlocks; -export int64 Heap_allocated; +export uintptr Heap_allocated; static BOOLEAN Heap_firstTry; -static int64 Heap_heap, Heap_heapend; -export int64 Heap_heapsize; +static uintptr Heap_heap, Heap_heapend; +export uintptr Heap_heapsize; static Heap_FinNode Heap_fin; static int32 Heap_lockdepth; static BOOLEAN Heap_interrupted; @@ -88,12 +88,12 @@ static void Heap_Mark (int64 q); static void Heap_MarkCandidates (int64 n, int64 *cand, LONGINT cand__len); static void Heap_MarkP (SYSTEM_PTR p); static void Heap_MarkStack (int64 n, int64 *cand, LONGINT cand__len); -export SYSTEM_PTR Heap_NEWBLK (int64 size); -export SYSTEM_PTR Heap_NEWREC (int64 tag); -static int64 Heap_NewChunk (int64 blksz); +export SYSTEM_PTR Heap_NEWBLK (uintptr size); +export SYSTEM_PTR Heap_NEWREC (uintptr tag); +static uintptr Heap_NewChunk (uintptr blksz); export void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); export SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -export void Heap_REGTYP (Heap_Module m, int64 typ); +export void Heap_REGTYP (Heap_Module m, uintptr typ); export void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); static void Heap_Scan (void); static void Heap_Sift (int64 l, int64 r, int64 *a, LONGINT a__len); @@ -102,7 +102,7 @@ export void Heap_Unlock (void); extern void *Heap__init(); extern LONGINT Platform_MainStackFrame; extern uintptr Platform_OSAllocate(uintptr size); -#define Heap_FetchAddress(pointer) (LONGINT)(SYSTEM_ADRINT)(*((void**)((SYSTEM_ADRINT)pointer))) +#define Heap_FetchAddress(pointer) (uintptr)(*((void**)((uintptr)pointer))) #define Heap_HeapModuleInit() Heap__init() #define Heap_OSAllocate(size) Platform_OSAllocate(size) #define Heap_PlatformHalt(code) Platform_Halt(code) @@ -135,7 +135,7 @@ SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) __COPY(name, m->name, 20); m->refcnt = 0; m->enumPtrs = enumPtrs; - m->next = (Heap_Module)(SYSTEM_ADRINT)Heap_modules; + m->next = (Heap_Module)(uintptr)Heap_modules; Heap_modules = (SYSTEM_PTR)m; _o_result = (void*)m; return _o_result; @@ -155,7 +155,7 @@ void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) m->cmds = c; } -void Heap_REGTYP (Heap_Module m, int64 typ) +void Heap_REGTYP (Heap_Module m, uintptr typ) { __PUT(typ, m->types, int64); m->types = typ; @@ -166,15 +166,15 @@ void Heap_INCREF (Heap_Module m) m->refcnt += 1; } -static int64 Heap_NewChunk (int64 blksz) +static uintptr Heap_NewChunk (uintptr blksz) { - int64 _o_result; - int64 chnk; + uintptr _o_result; + uintptr chnk; chnk = Heap_OSAllocate(blksz + 24); if (chnk != 0) { - __PUT(chnk + 8, chnk + (24 + blksz), int64); - __PUT(chnk + 24, chnk + 32, int64); - __PUT(chnk + 32, blksz, int64); + __PUT(chnk + 8, chnk + (24 + blksz), uintptr); + __PUT(chnk + 24, chnk + 32, uintptr); + __PUT(chnk + 32, blksz, uintptr); __PUT(chnk + 40, -8, int64); __PUT(chnk + 48, Heap_bigBlocks, int64); Heap_bigBlocks = chnk + 24; @@ -195,7 +195,7 @@ static void Heap_ExtendHeap (int64 blksz) chnk = Heap_NewChunk(size); if (chnk != 0) { if (chnk < Heap_heap) { - __PUT(chnk, Heap_heap, int64); + __PUT(chnk, Heap_heap, uintptr); Heap_heap = chnk; } else { j = Heap_heap; @@ -213,10 +213,10 @@ static void Heap_ExtendHeap (int64 blksz) } } -SYSTEM_PTR Heap_NEWREC (int64 tag) +SYSTEM_PTR Heap_NEWREC (uintptr tag) { SYSTEM_PTR _o_result; - int64 i, i0, di, blksz, restsize, t, adr, end, next, prev; + uintptr i, i0, di, blksz, restsize, t, adr, end, next, prev; SYSTEM_PTR new; Heap_Lock(); blksz = Heap_FetchAddress(tag); @@ -236,10 +236,10 @@ SYSTEM_PTR Heap_NEWREC (int64 tag) di = i - i0; restsize = __ASHL(di, 5); end = adr + restsize; - __PUT(end + 8, blksz, int64); + __PUT(end + 8, blksz, uintptr); __PUT(end + 16, -8, int64); __PUT(end, end + 8, int64); - __PUT(adr + 8, restsize, int64); + __PUT(adr + 8, restsize, uintptr); __PUT(adr + 24, Heap_freeList[di], int64); Heap_freeList[di] = adr; adr += restsize; @@ -280,21 +280,21 @@ SYSTEM_PTR Heap_NEWREC (int64 tag) } restsize = t - blksz; end = adr + restsize; - __PUT(end + 8, blksz, int64); + __PUT(end + 8, blksz, uintptr); __PUT(end + 16, -8, int64); __PUT(end, end + 8, int64); if (restsize > 288) { - __PUT(adr + 8, restsize, int64); + __PUT(adr + 8, restsize, uintptr); } else { next = Heap_FetchAddress(adr + 24); if (prev == 0) { Heap_bigBlocks = next; } else { - __PUT(prev + 24, next, int64); + __PUT(prev + 24, next, uintptr); } if (restsize > 0) { di = __ASHR(restsize, 5); - __PUT(adr + 8, restsize, int64); + __PUT(adr + 8, restsize, uintptr); __PUT(adr + 24, Heap_freeList[di], int64); Heap_freeList[di] = adr; } @@ -311,28 +311,28 @@ SYSTEM_PTR Heap_NEWREC (int64 tag) i += 32; } __PUT(adr + 24, 0, int64); - __PUT(adr, tag, int64); + __PUT(adr, tag, uintptr); __PUT(adr + 8, 0, int64); __PUT(adr + 16, 0, int64); Heap_allocated += blksz; Heap_Unlock(); - _o_result = (SYSTEM_PTR)(SYSTEM_ADRINT)(adr + 8); + _o_result = (SYSTEM_PTR)(uintptr)(adr + 8); return _o_result; } -SYSTEM_PTR Heap_NEWBLK (int64 size) +SYSTEM_PTR Heap_NEWBLK (uintptr size) { SYSTEM_PTR _o_result; - int64 blksz, tag; + uintptr blksz, tag; SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 63, 5), 5); - new = Heap_NEWREC((SYSTEM_ADRINT)&blksz); - tag = ((int64)(SYSTEM_ADRINT)new + blksz) - 24; + new = Heap_NEWREC((uintptr)&blksz); + tag = (((int64)(uintptr)new) + blksz) - 24; __PUT(tag - 8, 0, int64); - __PUT(tag, blksz, int64); + __PUT(tag, blksz, uintptr); __PUT(tag + 8, -8, int64); - __PUT((int64)(SYSTEM_ADRINT)new - 8, tag, int64); + __PUT((int64)(uintptr)new - 8, tag, uintptr); Heap_Unlock(); _o_result = new; return _o_result; @@ -361,7 +361,7 @@ static void Heap_Mark (int64 q) __GET(tag, offset, int64); fld = q + offset; p = Heap_FetchAddress(fld); - __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)n, SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(uintptr)n, SYSTEM_PTR); } else { fld = q + offset; n = Heap_FetchAddress(fld); @@ -370,7 +370,7 @@ static void Heap_Mark (int64 q) if (!__ODD(tagbits)) { __PUT(n - 8, tagbits + 1, int64); __PUT(q - 8, tag + 1, int64); - __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)p, SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(uintptr)p, SYSTEM_PTR); p = q; q = n; tag = tagbits; @@ -385,12 +385,12 @@ static void Heap_Mark (int64 q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((int64)(SYSTEM_ADRINT)p); + Heap_Mark((int64)(uintptr)p); } static void Heap_Scan (void) { - int64 chnk, adr, end, start, tag, i, size, freesize; + uintptr chnk, adr, end, start, tag, i, size, freesize; Heap_bigBlocks = 0; i = 1; while (i < 9) { @@ -408,8 +408,8 @@ static void Heap_Scan (void) if (__ODD(tag)) { if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 8, int64); - __PUT(start + 8, freesize, int64); + __PUT(start, start + 8, uintptr); + __PUT(start + 8, freesize, uintptr); __PUT(start + 16, -8, int64); i = __ASHR(freesize, 5); freesize = 0; @@ -422,7 +422,7 @@ static void Heap_Scan (void) } } tag -= 1; - __PUT(adr, tag, int64); + __PUT(adr, tag, uintptr); size = Heap_FetchAddress(tag); Heap_allocated += size; adr += size; @@ -434,8 +434,8 @@ static void Heap_Scan (void) } if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 8, int64); - __PUT(start + 8, freesize, int64); + __PUT(start, start + 8, uintptr); + __PUT(start + 8, freesize, uintptr); __PUT(start + 16, -8, int64); i = __ASHR(freesize, 5); freesize = 0; @@ -554,7 +554,7 @@ static void Heap_Finalize (void) } else { prev->next = n->next; } - (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); + (*n->finalize)((SYSTEM_PTR)(uintptr)n->obj); if (prev == NIL) { n = Heap_fin; } else { @@ -573,7 +573,7 @@ void Heap_FINALL (void) while (Heap_fin != NIL) { n = Heap_fin; Heap_fin = Heap_fin->next; - (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); + (*n->finalize)((SYSTEM_PTR)(uintptr)n->obj); } } @@ -590,9 +590,9 @@ static void Heap_MarkStack (int64 n, int64 *cand, LONGINT cand__len) } if (n == 0) { nofcand = 0; - sp = (SYSTEM_ADRINT)&frame; + sp = (uintptr)&frame; stack0 = Heap_PlatformMainStackFrame(); - inc = (SYSTEM_ADRINT)&align.p - (SYSTEM_ADRINT)&align; + inc = (uintptr)&align.p - (uintptr)&align; if (sp > stack0) { inc = -inc; } @@ -623,7 +623,7 @@ void Heap_GC (BOOLEAN markStack) int64 cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); - m = (Heap_Module)(SYSTEM_ADRINT)Heap_modules; + m = (Heap_Module)(uintptr)Heap_modules; while (m != NIL) { if (m->enumPtrs != NIL) { (*m->enumPtrs)(Heap_MarkP); @@ -700,7 +700,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (int64)(SYSTEM_ADRINT)obj; + f->obj = (int64)(uintptr)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index e07b0d1e..82ba661b 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h @@ -32,7 +32,7 @@ typedef import SYSTEM_PTR Heap_modules; -import int64 Heap_allocated, Heap_heapsize; +import uintptr Heap_allocated, Heap_heapsize; import int32 Heap_FileCount; import LONGINT *Heap_ModuleDesc__typ; @@ -42,11 +42,11 @@ import void Heap_GC (BOOLEAN markStack); import void Heap_INCREF (Heap_Module m); import void Heap_InitHeap (void); import void Heap_Lock (void); -import SYSTEM_PTR Heap_NEWBLK (int64 size); -import SYSTEM_PTR Heap_NEWREC (int64 tag); +import SYSTEM_PTR Heap_NEWBLK (uintptr size); +import SYSTEM_PTR Heap_NEWREC (uintptr tag); import void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); import SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -import void Heap_REGTYP (Heap_Module m, int64 typ); +import void Heap_REGTYP (Heap_Module m, uintptr typ); import void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); import void Heap_Unlock (void); import void *Heap__init(void); diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 3cc9156d..7db3d54c 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index f1bcc92f..fe368fa3 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index ad99f16a..bab019ae 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" @@ -2197,7 +2197,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) if (((x->class == 8 || x->class == 9) || __IN(f, 0x0501)) || x->typ->comp == 3) { OPB_err(126); } - if (x->typ->size < p->typ->size) { + if ((x->class != 7 && x->typ->size < p->typ->size)) { OPB_err(-308); } t = OPT_NewNode(11); diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index 82eb03c4..6b193164 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index f67c2556..ee075a94 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index 42f6f30d..90ff6275 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index fb89bcd6..44c0d929 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -545,7 +545,7 @@ void OPM_FPrintReal (int64 *fp, REAL real) { int32 i; int64 l; - __GET((SYSTEM_ADRINT)&real, i, int32); + __GET((uintptr)&real, i, int32); l = i; OPM_FPrint(&*fp, l); } diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index 72257311..3e1ddd3d 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index e270236a..0ac463ca 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPB.h" diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index 9897c9c2..bd26983c 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index d07d06ca..5ae4fbdf 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index 2aee5b21..5fcf9030 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index 6fd27531..94145f3d 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 349849e8..e2409b86 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index d3aa0a87..a99c5bfe 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPC.h" @@ -940,7 +940,7 @@ static void OPV_expr (OPT_Node n, int32 prec) OPM_Write(')'); break; case 24: - OPM_WriteString((CHAR*)"(SYSTEM_ADRINT)", 16); + OPM_WriteString((CHAR*)"(uintptr)", 10); if (l->class == 1) { OPC_CompleteIdent(l->obj); } else { @@ -956,7 +956,7 @@ static void OPV_expr (OPT_Node n, int32 prec) OPC_Ident(n->typ->strobj); OPM_Write(')'); if (__IN(n->typ->form, 0x1800) || __IN(l->typ->form, 0x1800)) { - OPM_WriteString((CHAR*)"(SYSTEM_ADRINT)", 16); + OPM_WriteString((CHAR*)"(uintptr)", 10); } OPV_expr(l, exprPrec); } else { @@ -1328,7 +1328,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) if (x->class == 7) { OPC_IntLiteral(x->conval->intval, OPM_PointerSize); } else { - OPM_WriteString((CHAR*)"((SYSTEM_ADRINT)(", 18); + OPM_WriteString((CHAR*)"((uintptr)(", 12); OPV_expr(x, 10); OPM_WriteString((CHAR*)"))", 3); } diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index 09b50b36..6e3e6c65 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 456a43cf..0135ee93 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -242,7 +242,7 @@ void Platform_Init (int32 argc, int64 argvadr) Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; Platform_ArgCount = argc; - av = (Platform_ArgVecPtr)(SYSTEM_ADRINT)argvadr; + av = (Platform_ArgVecPtr)(uintptr)argvadr; Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; Platform_HeapInitHeap(); @@ -281,7 +281,7 @@ void Platform_GetArg (int32 n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { - av = (Platform_ArgVec)(SYSTEM_ADRINT)Platform_ArgVector; + av = (Platform_ArgVec)(uintptr)Platform_ArgVector; __COPY(*(*av)[__X(n, 1024)], val, val__len); } } @@ -560,7 +560,7 @@ int32 Platform_ReadBuf (int64 h, SYSTEM_BYTE *b, LONGINT b__len, int64 *n) int32 _o_result; int32 result; *n = 0; - result = Platform_readfile(h, (SYSTEM_ADRINT)b, b__len, &*n); + result = Platform_readfile(h, (uintptr)b, b__len, &*n); if (result == 0) { *n = 0; _o_result = Platform_err(); @@ -796,7 +796,7 @@ static void Platform_TestLittleEndian (void) { int32 i; i = 1; - __GET((SYSTEM_ADRINT)&i, Platform_LittleEndian, BOOLEAN); + __GET((uintptr)&i, Platform_LittleEndian, BOOLEAN); } __TDESC(Platform_FileIdentity, 1, 0) = {__TDFLDS("FileIdentity", 40), {-8}}; diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index 3691e5fb..f3b3574f 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index d6e77abf..4aafefde 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -59,7 +59,7 @@ int32 Reals_Expo (REAL x) { int32 _o_result; int32 i; - __GET((SYSTEM_ADRINT)&x + 2, i, int32); + __GET((uintptr)&x + 2, i, int32); _o_result = __MASK(__ASHR(i, 7), -256); return _o_result; } @@ -67,17 +67,17 @@ int32 Reals_Expo (REAL x) void Reals_SetExpo (REAL *x, int32 ex) { CHAR c; - __GET((SYSTEM_ADRINT)x + 3, c, CHAR); - __PUT((SYSTEM_ADRINT)x + 3, (CHAR)(__ASHL(__ASHR(c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); - __GET((SYSTEM_ADRINT)x + 2, c, CHAR); - __PUT((SYSTEM_ADRINT)x + 2, (CHAR)(__MASK(c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); + __GET((uintptr)x + 3, c, CHAR); + __PUT((uintptr)x + 3, (CHAR)(__ASHL(__ASHR(c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __GET((uintptr)x + 2, c, CHAR); + __PUT((uintptr)x + 2, (CHAR)(__MASK(c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } int32 Reals_ExpoL (LONGREAL x) { int32 _o_result; int32 i; - __GET((SYSTEM_ADRINT)&x + 6, i, int32); + __GET((uintptr)&x + 6, i, int32); _o_result = __MASK(__ASHR(i, 4), -2048); return _o_result; } diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index 2c04bec3..1b6d1f96 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/SYSTEM.h b/bootstrap/windows-88/SYSTEM.h index c83f69f1..31fa97c5 100644 --- a/bootstrap/windows-88/SYSTEM.h +++ b/bootstrap/windows-88/SYSTEM.h @@ -39,8 +39,8 @@ typedef unsigned short int uint16; typedef signed char int8; typedef unsigned char uint8; -#define uintptr size_t - +//#define uintptr size_t +#define uintptr int64 // The compiler uses 'import' and 'export' which translate to 'extern' and // nothing respectively. @@ -255,8 +255,8 @@ extern void Platform_AssertFail(LONGINT x); // Memory allocation -extern SYSTEM_PTR Heap_NEWBLK (LONGINT size); -extern SYSTEM_PTR Heap_NEWREC (LONGINT tag); +extern SYSTEM_PTR Heap_NEWBLK (uintptr size); +extern SYSTEM_PTR Heap_NEWREC (uintptr tag); extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __SYSNEW(p, len) p = Heap_NEWBLK((LONGINT)(len)) diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index 769cecb7..abf00b3b 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index 012e77f9..5280395c 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index 934bc227..e8858afa 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Files.h" diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index fbd8a7a4..990d15c3 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/Vishap.c b/bootstrap/windows-88/Vishap.c index f781d7ee..bed71868 100644 --- a/bootstrap/windows-88/Vishap.c +++ b/bootstrap/windows-88/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkamSf */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/windows-88/errors.c b/bootstrap/windows-88/errors.c index b1aa1639..2f0938c0 100644 --- a/bootstrap/windows-88/errors.c +++ b/bootstrap/windows-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/windows-88/errors.h b/bootstrap/windows-88/errors.h index 049c862a..c2bb7560 100644 --- a/bootstrap/windows-88/errors.h +++ b/bootstrap/windows-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index 51975db4..b9d03b09 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index 3cba883d..30095155 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/vt100.c b/bootstrap/windows-88/vt100.c index dfa8df9c..5dd451e1 100644 --- a/bootstrap/windows-88/vt100.c +++ b/bootstrap/windows-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/windows-88/vt100.h b/bootstrap/windows-88/vt100.h index 139b592e..bcc323cc 100644 --- a/bootstrap/windows-88/vt100.h +++ b/bootstrap/windows-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/src/compiler/OPB.Mod b/src/compiler/OPB.Mod index 9f696edc..62be133a 100644 --- a/src/compiler/OPB.Mod +++ b/src/compiler/OPB.Mod @@ -1208,7 +1208,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) err(126) END; (* Warn if the result type includes memory past the end of the source variable *) - IF x.typ.size < p.typ.size THEN err(-308) END; + IF (x.class # OPT.Nconst) & (x.typ.size < p.typ.size) THEN err(-308) END; t := OPT.NewNode(OPT.Nmop); t^.subcl := OPT.val; t^.left := x; x := t; (* IF (x^.class >= OPT.Nconst) OR ((f IN OPT.realSet) # (p^.typ^.form IN OPT.realSet)) THEN diff --git a/src/compiler/OPV.Mod b/src/compiler/OPV.Mod index e23a89ad..cd387568 100644 --- a/src/compiler/OPV.Mod +++ b/src/compiler/OPV.Mod @@ -566,7 +566,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 expr(l, MinPrec); OPM.Write(CloseParen) | OPT.cap: OPM.WriteString("__CAP("); expr(l, MinPrec); OPM.Write(CloseParen) | OPT.odd: OPM.WriteString("__ODD("); expr(l, MinPrec); OPM.Write(CloseParen) - | OPT.adr: OPM.WriteString("(SYSTEM_ADRINT)"); (*SYSTEM*) + | OPT.adr: OPM.WriteString("(uintptr)"); (*SYSTEM*) IF l^.class = OPT.Nvarpar THEN OPC.CompleteIdent(l^.obj) ELSE IF (l^.typ^.form # OPT.String) & ~(l^.typ^.comp IN {OPT.Array, OPT.DynArr}) THEN OPM.Write("&") END ; @@ -579,7 +579,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 THEN OPM.Write(OpenParen); OPC.Ident(n^.typ^.strobj); OPM.Write(CloseParen); IF (n^.typ^.form IN {OPT.Pointer, OPT.ProcTyp}) OR (l^.typ^.form IN {OPT.Pointer, OPT.ProcTyp}) THEN - OPM.WriteString("(SYSTEM_ADRINT)") + OPM.WriteString("(uintptr)") END; expr(l, exprPrec) ELSE @@ -797,7 +797,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 IF typ^.comp = OPT.DynArr THEN IF x^.class = OPT.Nconst THEN OPC.IntLiteral(x.conval.intval, OPM.PointerSize) - ELSE OPM.WriteString("((SYSTEM_ADRINT)("); expr(x, 10); OPM.WriteString("))") + ELSE OPM.WriteString("((uintptr)("); expr(x, 10); OPM.WriteString("))") END ; x := x^.link ELSE diff --git a/src/system/Heap.Mod b/src/system/Heap.Mod index 619daf53..6b6411a2 100644 --- a/src/system/Heap.Mod +++ b/src/system/Heap.Mod @@ -30,6 +30,7 @@ MODULE Heap; sntlOff = LONG(LONG(2*SZL)); (* pointer offset table sentinel in free block relative to block start *) nextOff = LONG(LONG(3*SZL)); (* next pointer in free block relative to block start *) NoPtrSntl = LONG(LONG(-SZL)); + (*NoPtrSntl = SYSTEM.VAL(SYSTEM.UINTPTR, -SZL);*) LongZero = LONG(LONG(0)); TYPE @@ -64,7 +65,7 @@ MODULE Heap; FinNode = POINTER TO FinDesc; FinDesc = RECORD next: FinNode; - obj: LONGINT; (* weak pointer *) + obj: SYSTEM.UINTPTR; (* weak pointer *) marked: BOOLEAN; finalize: Finalizer; END ; @@ -75,13 +76,13 @@ MODULE Heap; freeList: ARRAY nofLists + 1 OF LONGINT; (* dummy, 16, 32, 48, 64, 80, 96, 112, 128, sentinel *) bigBlocks: LONGINT; - allocated*: LONGINT; + allocated*: SYSTEM.UINTPTR; firstTry: BOOLEAN; (* extensible heap *) - heap: LONGINT; (* the sorted list of heap chunks *) - heapend: LONGINT; (* max possible pointer value (used for stack collection) *) - heapsize*: LONGINT; (* the sum of all heap chunk sizes *) + heap: SYSTEM.UINTPTR; (* the sorted list of heap chunks *) + heapend: SYSTEM.UINTPTR; (* max possible pointer value (used for stack collection) *) + heapsize*: SYSTEM.UINTPTR; (* the sum of all heap chunk sizes *) (* finalization candidates *) fin: FinNode; @@ -153,7 +154,7 @@ MODULE Heap; COPY(name, c.name); c.cmd := cmd; c.next := m.cmds; m.cmds := c END REGCMD; - PROCEDURE REGTYP*(m: Module; typ: LONGINT); + PROCEDURE REGTYP*(m: Module; typ: SYSTEM.UINTPTR); BEGIN SYSTEM.PUT(typ, m.types); m.types := typ END REGTYP; @@ -165,8 +166,8 @@ MODULE Heap; PROCEDURE -ExternPlatformOSAllocate "extern uintptr Platform_OSAllocate(uintptr size);"; PROCEDURE -OSAllocate(size: SYSTEM.UINTPTR): SYSTEM.UINTPTR "Platform_OSAllocate(size)"; - PROCEDURE NewChunk(blksz: LONGINT): LONGINT; - VAR chnk: LONGINT; + PROCEDURE NewChunk(blksz: SYSTEM.UINTPTR): SYSTEM.UINTPTR; + VAR chnk: SYSTEM.UINTPTR; BEGIN chnk := OSAllocate(blksz + blkOff); IF chnk # 0 THEN @@ -185,8 +186,13 @@ MODULE Heap; (* FetchAddress fetches a pointer from memory and returns it as a LONGINT. It works correctly regardless of the size of an address. Specifically on 32 bit address architectures with 64 bit LONGINT, it loads 32 bits and extends it to LONGINT - rather than loading 64 bits. *) - PROCEDURE -FetchAddress(pointer: LONGINT): LONGINT "(LONGINT)(SYSTEM_ADRINT)(*((void**)((SYSTEM_ADRINT)pointer)))"; + rather than loading 64 bits. + + NOTE - with uintpr work complete this function should be replaces withSYSTEM.GET + as there will be no need to extend addresses to larger types. + + *) + PROCEDURE -FetchAddress(pointer: SYSTEM.UINTPTR): SYSTEM.UINTPTR "(uintptr)(*((void**)((uintptr)pointer)))"; PROCEDURE ExtendHeap(blksz: LONGINT); VAR size, chnk, j, next: LONGINT; @@ -213,16 +219,16 @@ MODULE Heap; PROCEDURE ^GC*(markStack: BOOLEAN); - PROCEDURE NEWREC*(tag: LONGINT): SYSTEM.PTR; + PROCEDURE NEWREC*(tag: SYSTEM.UINTPTR): SYSTEM.PTR; VAR - i, i0, di, blksz, restsize, t, adr, end, next, prev: LONGINT; + i, i0, di, blksz, restsize, t, adr, end, next, prev: SYSTEM.UINTPTR; new: SYSTEM.PTR; BEGIN Lock(); blksz := FetchAddress(tag); ASSERT((Unit = 16) OR (Unit = 32)); - ASSERT(SIZE(SYSTEM.PTR) <= SIZE(LONGINT)); + ASSERT(SIZE(SYSTEM.PTR) = SIZE(SYSTEM.UINTPTR)); ASSERT(blksz MOD Unit = 0); i0 := blksz DIV Unit; i := i0; @@ -305,8 +311,8 @@ MODULE Heap; RETURN SYSTEM.VAL(SYSTEM.PTR, adr + SZL) END NEWREC; - PROCEDURE NEWBLK*(size: LONGINT): SYSTEM.PTR; - VAR blksz, tag: LONGINT; new: SYSTEM.PTR; + PROCEDURE NEWBLK*(size: SYSTEM.UINTPTR): SYSTEM.PTR; + VAR blksz, tag: SYSTEM.UINTPTR; new: SYSTEM.PTR; BEGIN Lock(); blksz := (size + (4*SZL + Unit - 1)) DIV Unit * Unit; (*size + tag + meta + blksz + sntnl + UnitAlignment*) @@ -364,7 +370,7 @@ MODULE Heap; END MarkP; PROCEDURE Scan; - VAR chnk, adr, end, start, tag, i, size, freesize: LONGINT; + VAR chnk, adr, end, start, tag, i, size, freesize: SYSTEM.UINTPTR; BEGIN bigBlocks := 0; i := 1; WHILE i < nofLists DO freeList[i] := 0; INC(i) END ; freesize := 0; allocated := 0; chnk := heap; diff --git a/src/system/Platformunix.Mod b/src/system/Platformunix.Mod index 34ee60b6..76c0db89 100644 --- a/src/system/Platformunix.Mod +++ b/src/system/Platformunix.Mod @@ -189,7 +189,7 @@ END ArgPos; (* Signals and traps *) -PROCEDURE -sethandler(s: INTEGER; h: SignalHandler) "SystemSetHandler(s, (SYSTEM_ADRINT)h)"; +PROCEDURE -sethandler(s: INTEGER; h: SignalHandler) "SystemSetHandler(s, (uintptr)h)"; PROCEDURE SetInterruptHandler*(handler: SignalHandler); BEGIN sethandler(2, handler); END SetInterruptHandler; @@ -369,7 +369,7 @@ END Size; PROCEDURE -readfile (fd: LONGINT; p: LONGINT; l: LONGINT): LONGINT -"read(fd, (void*)(SYSTEM_ADRINT)(p), l)"; +"read(fd, (void*)(uintptr)(p), l)"; PROCEDURE Read*(h: FileHandle; p: LONGINT; l: LONGINT; VAR n: LONGINT): ErrorCode; BEGIN @@ -386,7 +386,7 @@ END ReadBuf; PROCEDURE -writefile(fd: LONGINT; p: LONGINT; l: LONGINT): LONGINT -"write(fd, (void*)(SYSTEM_ADRINT)(p), l)"; +"write(fd, (void*)(uintptr)(p), l)"; PROCEDURE Write*(h: FileHandle; p: LONGINT; l: LONGINT): ErrorCode; VAR written: LONGINT; diff --git a/src/system/SYSTEM.h b/src/system/SYSTEM.h index c83f69f1..31fa97c5 100644 --- a/src/system/SYSTEM.h +++ b/src/system/SYSTEM.h @@ -39,8 +39,8 @@ typedef unsigned short int uint16; typedef signed char int8; typedef unsigned char uint8; -#define uintptr size_t - +//#define uintptr size_t +#define uintptr int64 // The compiler uses 'import' and 'export' which translate to 'extern' and // nothing respectively. @@ -255,8 +255,8 @@ extern void Platform_AssertFail(LONGINT x); // Memory allocation -extern SYSTEM_PTR Heap_NEWBLK (LONGINT size); -extern SYSTEM_PTR Heap_NEWREC (LONGINT tag); +extern SYSTEM_PTR Heap_NEWBLK (uintptr size); +extern SYSTEM_PTR Heap_NEWREC (uintptr tag); extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __SYSNEW(p, len) p = Heap_NEWBLK((LONGINT)(len)) From a730d6c96bfbd0441f746d28801b0710825d8252 Mon Sep 17 00:00:00 2001 From: David Brown Date: Sat, 3 Sep 2016 12:01:04 +0100 Subject: [PATCH 212/580] Switch SYSTEM.h uintptr type from int64 to size_t, 32 bit working again. --- bootstrap/unix-44/SYSTEM.h | 4 ++-- bootstrap/unix-48/SYSTEM.h | 4 ++-- bootstrap/unix-88/SYSTEM.h | 4 ++-- bootstrap/windows-48/SYSTEM.h | 4 ++-- bootstrap/windows-88/SYSTEM.h | 4 ++-- src/system/SYSTEM.h | 3 +-- 6 files changed, 11 insertions(+), 12 deletions(-) diff --git a/bootstrap/unix-44/SYSTEM.h b/bootstrap/unix-44/SYSTEM.h index 31fa97c5..b7d405ff 100644 --- a/bootstrap/unix-44/SYSTEM.h +++ b/bootstrap/unix-44/SYSTEM.h @@ -39,8 +39,8 @@ typedef unsigned short int uint16; typedef signed char int8; typedef unsigned char uint8; -//#define uintptr size_t -#define uintptr int64 +#define uintptr size_t +//#define uintptr int64 // The compiler uses 'import' and 'export' which translate to 'extern' and // nothing respectively. diff --git a/bootstrap/unix-48/SYSTEM.h b/bootstrap/unix-48/SYSTEM.h index 31fa97c5..b7d405ff 100644 --- a/bootstrap/unix-48/SYSTEM.h +++ b/bootstrap/unix-48/SYSTEM.h @@ -39,8 +39,8 @@ typedef unsigned short int uint16; typedef signed char int8; typedef unsigned char uint8; -//#define uintptr size_t -#define uintptr int64 +#define uintptr size_t +//#define uintptr int64 // The compiler uses 'import' and 'export' which translate to 'extern' and // nothing respectively. diff --git a/bootstrap/unix-88/SYSTEM.h b/bootstrap/unix-88/SYSTEM.h index 31fa97c5..b7d405ff 100644 --- a/bootstrap/unix-88/SYSTEM.h +++ b/bootstrap/unix-88/SYSTEM.h @@ -39,8 +39,8 @@ typedef unsigned short int uint16; typedef signed char int8; typedef unsigned char uint8; -//#define uintptr size_t -#define uintptr int64 +#define uintptr size_t +//#define uintptr int64 // The compiler uses 'import' and 'export' which translate to 'extern' and // nothing respectively. diff --git a/bootstrap/windows-48/SYSTEM.h b/bootstrap/windows-48/SYSTEM.h index 31fa97c5..b7d405ff 100644 --- a/bootstrap/windows-48/SYSTEM.h +++ b/bootstrap/windows-48/SYSTEM.h @@ -39,8 +39,8 @@ typedef unsigned short int uint16; typedef signed char int8; typedef unsigned char uint8; -//#define uintptr size_t -#define uintptr int64 +#define uintptr size_t +//#define uintptr int64 // The compiler uses 'import' and 'export' which translate to 'extern' and // nothing respectively. diff --git a/bootstrap/windows-88/SYSTEM.h b/bootstrap/windows-88/SYSTEM.h index 31fa97c5..b7d405ff 100644 --- a/bootstrap/windows-88/SYSTEM.h +++ b/bootstrap/windows-88/SYSTEM.h @@ -39,8 +39,8 @@ typedef unsigned short int uint16; typedef signed char int8; typedef unsigned char uint8; -//#define uintptr size_t -#define uintptr int64 +#define uintptr size_t +//#define uintptr int64 // The compiler uses 'import' and 'export' which translate to 'extern' and // nothing respectively. diff --git a/src/system/SYSTEM.h b/src/system/SYSTEM.h index 31fa97c5..2622657f 100644 --- a/src/system/SYSTEM.h +++ b/src/system/SYSTEM.h @@ -39,8 +39,7 @@ typedef unsigned short int uint16; typedef signed char int8; typedef unsigned char uint8; -//#define uintptr size_t -#define uintptr int64 +#define uintptr size_t // The compiler uses 'import' and 'export' which translate to 'extern' and // nothing respectively. From db18774de117339389d8af30c447f9abb9cf84e4 Mon Sep 17 00:00:00 2001 From: David Brown Date: Sat, 3 Sep 2016 17:47:55 +0100 Subject: [PATCH 213/580] Allow SYSTEM.VAL of constant in CONST and use in Heap.Mod. --- bootstrap/unix-44/OPB.c | 16 +++++++++------ bootstrap/unix-44/SYSTEM.h | 1 - bootstrap/unix-48/OPB.c | 16 +++++++++------ bootstrap/unix-48/SYSTEM.h | 1 - bootstrap/unix-88/OPB.c | 16 +++++++++------ bootstrap/unix-88/SYSTEM.h | 1 - bootstrap/windows-48/OPB.c | 16 +++++++++------ bootstrap/windows-48/SYSTEM.h | 1 - bootstrap/windows-88/OPB.c | 16 +++++++++------ bootstrap/windows-88/SYSTEM.h | 1 - src/compiler/OPB.Mod | 28 ++++++++++++++++---------- src/system/Heap.Mod | 37 +++++++++++++++++------------------ 12 files changed, 86 insertions(+), 64 deletions(-) diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index 3af88ab8..07797236 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1124,7 +1124,7 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) if ((*x)->class == 7) { if (f == 4) { if (g == 4) { - if (f > g) { + if ((*x)->typ->size > typ->size) { OPB_SetIntType(*x); if ((*x)->typ->size > typ->size) { OPB_err(203); @@ -2199,11 +2199,15 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) if ((x->class != 7 && x->typ->size < p->typ->size)) { OPB_err(-308); } - t = OPT_NewNode(11); - t->subcl = 29; - t->left = x; - x = t; - x->typ = p->typ; + if ((((x->class == 7 && x->typ->form == 4)) && p->typ->form == 4)) { + OPB_Convert(&x, p->typ); + } else { + t = OPT_NewNode(11); + t->subcl = 29; + t->left = x; + x = t; + x->typ = p->typ; + } p = x; break; case 30: diff --git a/bootstrap/unix-44/SYSTEM.h b/bootstrap/unix-44/SYSTEM.h index b7d405ff..2622657f 100644 --- a/bootstrap/unix-44/SYSTEM.h +++ b/bootstrap/unix-44/SYSTEM.h @@ -40,7 +40,6 @@ typedef signed char int8; typedef unsigned char uint8; #define uintptr size_t -//#define uintptr int64 // The compiler uses 'import' and 'export' which translate to 'extern' and // nothing respectively. diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index 3af88ab8..07797236 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1124,7 +1124,7 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) if ((*x)->class == 7) { if (f == 4) { if (g == 4) { - if (f > g) { + if ((*x)->typ->size > typ->size) { OPB_SetIntType(*x); if ((*x)->typ->size > typ->size) { OPB_err(203); @@ -2199,11 +2199,15 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) if ((x->class != 7 && x->typ->size < p->typ->size)) { OPB_err(-308); } - t = OPT_NewNode(11); - t->subcl = 29; - t->left = x; - x = t; - x->typ = p->typ; + if ((((x->class == 7 && x->typ->form == 4)) && p->typ->form == 4)) { + OPB_Convert(&x, p->typ); + } else { + t = OPT_NewNode(11); + t->subcl = 29; + t->left = x; + x = t; + x->typ = p->typ; + } p = x; break; case 30: diff --git a/bootstrap/unix-48/SYSTEM.h b/bootstrap/unix-48/SYSTEM.h index b7d405ff..2622657f 100644 --- a/bootstrap/unix-48/SYSTEM.h +++ b/bootstrap/unix-48/SYSTEM.h @@ -40,7 +40,6 @@ typedef signed char int8; typedef unsigned char uint8; #define uintptr size_t -//#define uintptr int64 // The compiler uses 'import' and 'export' which translate to 'extern' and // nothing respectively. diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index bab019ae..5ede35ed 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1125,7 +1125,7 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) if ((*x)->class == 7) { if (f == 4) { if (g == 4) { - if (f > g) { + if ((*x)->typ->size > typ->size) { OPB_SetIntType(*x); if ((*x)->typ->size > typ->size) { OPB_err(203); @@ -2200,11 +2200,15 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) if ((x->class != 7 && x->typ->size < p->typ->size)) { OPB_err(-308); } - t = OPT_NewNode(11); - t->subcl = 29; - t->left = x; - x = t; - x->typ = p->typ; + if ((((x->class == 7 && x->typ->form == 4)) && p->typ->form == 4)) { + OPB_Convert(&x, p->typ); + } else { + t = OPT_NewNode(11); + t->subcl = 29; + t->left = x; + x = t; + x->typ = p->typ; + } p = x; break; case 30: diff --git a/bootstrap/unix-88/SYSTEM.h b/bootstrap/unix-88/SYSTEM.h index b7d405ff..2622657f 100644 --- a/bootstrap/unix-88/SYSTEM.h +++ b/bootstrap/unix-88/SYSTEM.h @@ -40,7 +40,6 @@ typedef signed char int8; typedef unsigned char uint8; #define uintptr size_t -//#define uintptr int64 // The compiler uses 'import' and 'export' which translate to 'extern' and // nothing respectively. diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index 3af88ab8..07797236 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1124,7 +1124,7 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) if ((*x)->class == 7) { if (f == 4) { if (g == 4) { - if (f > g) { + if ((*x)->typ->size > typ->size) { OPB_SetIntType(*x); if ((*x)->typ->size > typ->size) { OPB_err(203); @@ -2199,11 +2199,15 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) if ((x->class != 7 && x->typ->size < p->typ->size)) { OPB_err(-308); } - t = OPT_NewNode(11); - t->subcl = 29; - t->left = x; - x = t; - x->typ = p->typ; + if ((((x->class == 7 && x->typ->form == 4)) && p->typ->form == 4)) { + OPB_Convert(&x, p->typ); + } else { + t = OPT_NewNode(11); + t->subcl = 29; + t->left = x; + x = t; + x->typ = p->typ; + } p = x; break; case 30: diff --git a/bootstrap/windows-48/SYSTEM.h b/bootstrap/windows-48/SYSTEM.h index b7d405ff..2622657f 100644 --- a/bootstrap/windows-48/SYSTEM.h +++ b/bootstrap/windows-48/SYSTEM.h @@ -40,7 +40,6 @@ typedef signed char int8; typedef unsigned char uint8; #define uintptr size_t -//#define uintptr int64 // The compiler uses 'import' and 'export' which translate to 'extern' and // nothing respectively. diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index bab019ae..5ede35ed 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1125,7 +1125,7 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) if ((*x)->class == 7) { if (f == 4) { if (g == 4) { - if (f > g) { + if ((*x)->typ->size > typ->size) { OPB_SetIntType(*x); if ((*x)->typ->size > typ->size) { OPB_err(203); @@ -2200,11 +2200,15 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) if ((x->class != 7 && x->typ->size < p->typ->size)) { OPB_err(-308); } - t = OPT_NewNode(11); - t->subcl = 29; - t->left = x; - x = t; - x->typ = p->typ; + if ((((x->class == 7 && x->typ->form == 4)) && p->typ->form == 4)) { + OPB_Convert(&x, p->typ); + } else { + t = OPT_NewNode(11); + t->subcl = 29; + t->left = x; + x = t; + x->typ = p->typ; + } p = x; break; case 30: diff --git a/bootstrap/windows-88/SYSTEM.h b/bootstrap/windows-88/SYSTEM.h index b7d405ff..2622657f 100644 --- a/bootstrap/windows-88/SYSTEM.h +++ b/bootstrap/windows-88/SYSTEM.h @@ -40,7 +40,6 @@ typedef signed char int8; typedef unsigned char uint8; #define uintptr size_t -//#define uintptr int64 // The compiler uses 'import' and 'export' which translate to 'extern' and // nothing respectively. diff --git a/src/compiler/OPB.Mod b/src/compiler/OPB.Mod index 62be133a..73832049 100644 --- a/src/compiler/OPB.Mod +++ b/src/compiler/OPB.Mod @@ -598,11 +598,11 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) PROCEDURE Convert(VAR x: OPT.Node; typ: OPT.Struct); (* Convert node x to new type typ *) VAR node: OPT.Node; f, g: INTEGER; k: LONGINT; r: LONGREAL; - BEGIN f := x^.typ^.form; g := typ^.form; + BEGIN f := x^.typ^.form; g := typ^.form; (* f: old form, g: new form *) IF x^.class = OPT.Nconst THEN IF f = OPT.Int THEN IF g = OPT.Int THEN - IF f > g THEN SetIntType(x); + IF x.typ.size > typ.size THEN SetIntType(x); IF x.typ.size > typ.size THEN err(203); x^.conval^.intval := 1 END END ELSIF g IN OPT.realSet THEN x^.conval^.realval := x^.conval^.intval; x^.conval^.intval := OPM.ConstNotAlloc @@ -1201,6 +1201,8 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) END ; p^.typ := OPT.booltyp |OPT.valfn: (*SYSTEM.VAL*) (* type is changed without considering the byte ordering on the target machine *) + (* p (1st param): desired type *) + (* x (2nd param): constant or value to be converted to p *) IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) OR (f IN {OPT.Undef, OPT.String, OPT.NoTyp}) @@ -1209,14 +1211,20 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) END; (* Warn if the result type includes memory past the end of the source variable *) IF (x.class # OPT.Nconst) & (x.typ.size < p.typ.size) THEN err(-308) END; - t := OPT.NewNode(OPT.Nmop); t^.subcl := OPT.val; t^.left := x; x := t; - (* - IF (x^.class >= OPT.Nconst) OR ((f IN OPT.realSet) # (p^.typ^.form IN OPT.realSet)) THEN - t := OPT.NewNode(OPT.Nmop); t^.subcl := val; t^.left := x; x := t - ELSE x^.readonly := FALSE - END ; - *) - x^.typ := p^.typ; p := x + + IF (x.class = OPT.Nconst) & (x.typ.form = OPT.Int) & (p.typ.form = OPT.Int) THEN + Convert(x, p.typ) + ELSE + t := OPT.NewNode(OPT.Nmop); t^.subcl := OPT.val; t^.left := x; x := t; + (* + IF (x^.class >= OPT.Nconst) OR ((f IN OPT.realSet) # (p^.typ^.form IN OPT.realSet)) THEN + t := OPT.NewNode(OPT.Nmop); t^.subcl := val; t^.left := x; x := t + ELSE x^.readonly := FALSE + END ; + *) + x^.typ := p^.typ; + END; + p := x |OPT.sysnewfn: (*SYSTEM.NEW*) IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) ELSIF f = OPT.Int THEN diff --git a/src/system/Heap.Mod b/src/system/Heap.Mod index 6b6411a2..11723ec5 100644 --- a/src/system/Heap.Mod +++ b/src/system/Heap.Mod @@ -20,18 +20,17 @@ MODULE Heap; *) (* heap chunks *) - nextChnkOff = LONG(LONG(0)); (* next heap chunk, sorted ascendingly! *) - endOff = LONG(LONG(SZL)); (* end of heap chunk *) - blkOff = LONG(LONG(3*SZL)); (* first block in a chunk *) + nextChnkOff = SYSTEM.VAL(SYSTEM.UINTPTR, 0); (* next heap chunk, sorted ascendingly! *) + endOff = SYSTEM.VAL(SYSTEM.UINTPTR, SZL); (* end of heap chunk *) + blkOff = SYSTEM.VAL(SYSTEM.UINTPTR, 3*SZL); (* first block in a chunk *) (* heap blocks *) - tagOff = LONG(LONG(0)); (* block starts with tag *) - sizeOff = LONG(LONG(SZL)); (* block size in free block relative to block start *) - sntlOff = LONG(LONG(2*SZL)); (* pointer offset table sentinel in free block relative to block start *) - nextOff = LONG(LONG(3*SZL)); (* next pointer in free block relative to block start *) - NoPtrSntl = LONG(LONG(-SZL)); - (*NoPtrSntl = SYSTEM.VAL(SYSTEM.UINTPTR, -SZL);*) - LongZero = LONG(LONG(0)); + tagOff = SYSTEM.VAL(SYSTEM.UINTPTR, 0); (* block starts with tag *) + sizeOff = SYSTEM.VAL(SYSTEM.UINTPTR, SZL); (* block size in free block relative to block start *) + sntlOff = SYSTEM.VAL(SYSTEM.UINTPTR, 2*SZL); (* pointer offset table sentinel in free block relative to block start *) + nextOff = SYSTEM.VAL(SYSTEM.UINTPTR, 3*SZL); (* next pointer in free block relative to block start *) + NoPtrSntl = SYSTEM.VAL(SYSTEM.UINTPTR, -SZL); + AddressZero = SYSTEM.VAL(SYSTEM.UINTPTR, 0); TYPE ModuleName = ARRAY ModNameLen OF CHAR; @@ -296,16 +295,16 @@ MODULE Heap; END ; i := adr + 4*SZL; end := adr + blksz; WHILE i < end DO (*deliberately unrolled*) - SYSTEM.PUT(i, LongZero); - SYSTEM.PUT(i + SZL, LongZero); - SYSTEM.PUT(i + 2*SZL, LongZero); - SYSTEM.PUT(i + 3*SZL, LongZero); + SYSTEM.PUT(i, AddressZero); + SYSTEM.PUT(i + SZL, AddressZero); + SYSTEM.PUT(i + 2*SZL, AddressZero); + SYSTEM.PUT(i + 3*SZL, AddressZero); INC(i, 4*SZL) END ; - SYSTEM.PUT(adr + nextOff, LongZero); + SYSTEM.PUT(adr + nextOff, AddressZero); SYSTEM.PUT(adr, tag); - SYSTEM.PUT(adr + sizeOff, LongZero); - SYSTEM.PUT(adr + sntlOff, LongZero); + SYSTEM.PUT(adr + sizeOff, AddressZero); + SYSTEM.PUT(adr + sntlOff, AddressZero); INC(allocated, blksz); Unlock(); RETURN SYSTEM.VAL(SYSTEM.PTR, adr + SZL) @@ -318,7 +317,7 @@ MODULE Heap; blksz := (size + (4*SZL + Unit - 1)) DIV Unit * Unit; (*size + tag + meta + blksz + sntnl + UnitAlignment*) new := NEWREC(SYSTEM.ADR(blksz)); tag := SYSTEM.VAL(LONGINT, new) + blksz - 3*SZL; - SYSTEM.PUT(tag - SZL, LongZero); (*reserved for meta info*) + SYSTEM.PUT(tag - SZL, AddressZero); (*reserved for meta info*) SYSTEM.PUT(tag, blksz); SYSTEM.PUT(tag + SZL, NoPtrSntl); SYSTEM.PUT(SYSTEM.VAL(LONGINT, new) - SZL, tag); @@ -580,7 +579,7 @@ PROCEDURE -HeapModuleInit 'Heap__init()'; BEGIN heap := NewChunk(heapSize0); heapend := FetchAddress(heap + endOff); - SYSTEM.PUT(heap, LongZero); + SYSTEM.PUT(heap, AddressZero); allocated := 0; firstTry := TRUE; freeList[nofLists] := 1; lockdepth := 0; FileCount := 0; modules := NIL; heapsize := 0; bigBlocks := 0; fin := NIL; interrupted := FALSE; From 4ec2e61ed03da1d79a5f1bd95e8530e7d2616ffa Mon Sep 17 00:00:00 2001 From: David Brown Date: Sat, 3 Sep 2016 18:55:55 +0100 Subject: [PATCH 214/580] Completely update addresing vars in heap from LONGINT to SYSTEM.UINTPTR. --- bootstrap/unix-44/Heap.c | 128 ++++++++++++++++++------------------ bootstrap/unix-48/Heap.c | 128 ++++++++++++++++++------------------ bootstrap/unix-88/Heap.c | 128 ++++++++++++++++++------------------ bootstrap/windows-48/Heap.c | 128 ++++++++++++++++++------------------ bootstrap/windows-88/Heap.c | 128 ++++++++++++++++++------------------ src/system/Heap.Mod | 119 ++++++++++++++++----------------- 6 files changed, 380 insertions(+), 379 deletions(-) diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index 8f51e615..a003e797 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -51,15 +51,15 @@ typedef Heap_ModuleName name; int32 refcnt; Heap_Cmd cmds; - int32 types; + uintptr types; Heap_EnumProc enumPtrs; int32 reserved1, reserved2; } Heap_ModuleDesc; export SYSTEM_PTR Heap_modules; -static int32 Heap_freeList[10]; -static int32 Heap_bigBlocks; +static uintptr Heap_freeList[10]; +static uintptr Heap_bigBlocks; export uintptr Heap_allocated; static BOOLEAN Heap_firstTry; static uintptr Heap_heap, Heap_heapend; @@ -75,18 +75,18 @@ export LONGINT *Heap_FinDesc__typ; export LONGINT *Heap__1__typ; static void Heap_CheckFin (void); -static void Heap_ExtendHeap (int32 blksz); +static void Heap_ExtendHeap (uintptr blksz); export void Heap_FINALL (void); static void Heap_Finalize (void); export void Heap_GC (BOOLEAN markStack); -static void Heap_HeapSort (int32 n, int32 *a, LONGINT a__len); +static void Heap_HeapSort (uintptr n, uintptr *a, LONGINT a__len); export void Heap_INCREF (Heap_Module m); export void Heap_InitHeap (void); export void Heap_Lock (void); -static void Heap_Mark (int32 q); -static void Heap_MarkCandidates (int32 n, int32 *cand, LONGINT cand__len); +static void Heap_Mark (uintptr q); +static void Heap_MarkCandidates (uintptr n, uintptr *cand, LONGINT cand__len); static void Heap_MarkP (SYSTEM_PTR p); -static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len); +static void Heap_MarkStack (uintptr n, uintptr *cand, LONGINT cand__len); export SYSTEM_PTR Heap_NEWBLK (uintptr size); export SYSTEM_PTR Heap_NEWREC (uintptr tag); static uintptr Heap_NewChunk (uintptr blksz); @@ -95,11 +95,11 @@ export SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); export void Heap_REGTYP (Heap_Module m, uintptr typ); export void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); static void Heap_Scan (void); -static void Heap_Sift (int32 l, int32 r, int32 *a, LONGINT a__len); +static void Heap_Sift (uintptr l, uintptr r, uintptr *a, LONGINT a__len); export void Heap_Unlock (void); extern void *Heap__init(); -extern LONGINT Platform_MainStackFrame; +extern uintptr Platform_MainStackFrame; extern uintptr Platform_OSAllocate(uintptr size); #define Heap_FetchAddress(pointer) (uintptr)(*((void**)((uintptr)pointer))) #define Heap_HeapModuleInit() Heap__init() @@ -156,7 +156,7 @@ void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) void Heap_REGTYP (Heap_Module m, uintptr typ) { - __PUT(typ, m->types, int32); + __PUT(typ, m->types, uintptr); m->types = typ; } @@ -174,8 +174,8 @@ static uintptr Heap_NewChunk (uintptr blksz) __PUT(chnk + 4, chnk + (12 + blksz), uintptr); __PUT(chnk + 12, chnk + 16, uintptr); __PUT(chnk + 16, blksz, uintptr); - __PUT(chnk + 20, -4, int32); - __PUT(chnk + 24, Heap_bigBlocks, int32); + __PUT(chnk + 20, -4, uintptr); + __PUT(chnk + 24, Heap_bigBlocks, uintptr); Heap_bigBlocks = chnk + 12; Heap_heapsize += blksz; } @@ -183,9 +183,9 @@ static uintptr Heap_NewChunk (uintptr blksz) return _o_result; } -static void Heap_ExtendHeap (int32 blksz) +static void Heap_ExtendHeap (uintptr blksz) { - int32 size, chnk, j, next; + uintptr size, chnk, j, next; if (blksz > 160000) { size = blksz; } else { @@ -203,8 +203,8 @@ static void Heap_ExtendHeap (int32 blksz) j = next; next = Heap_FetchAddress(j); } - __PUT(chnk, next, int32); - __PUT(j, chnk, int32); + __PUT(chnk, next, uintptr); + __PUT(j, chnk, uintptr); } if (next == 0) { Heap_heapend = Heap_FetchAddress(chnk + 4); @@ -236,10 +236,10 @@ SYSTEM_PTR Heap_NEWREC (uintptr tag) restsize = __ASHL(di, 4); end = adr + restsize; __PUT(end + 4, blksz, uintptr); - __PUT(end + 8, -4, int32); - __PUT(end, end + 4, int32); + __PUT(end + 8, -4, uintptr); + __PUT(end, end + 4, uintptr); __PUT(adr + 4, restsize, uintptr); - __PUT(adr + 12, Heap_freeList[di], int32); + __PUT(adr + 12, Heap_freeList[di], uintptr); Heap_freeList[di] = adr; adr += restsize; } @@ -280,8 +280,8 @@ SYSTEM_PTR Heap_NEWREC (uintptr tag) restsize = t - blksz; end = adr + restsize; __PUT(end + 4, blksz, uintptr); - __PUT(end + 8, -4, int32); - __PUT(end, end + 4, int32); + __PUT(end + 8, -4, uintptr); + __PUT(end, end + 4, uintptr); if (restsize > 144) { __PUT(adr + 4, restsize, uintptr); } else { @@ -294,7 +294,7 @@ SYSTEM_PTR Heap_NEWREC (uintptr tag) if (restsize > 0) { di = __ASHR(restsize, 4); __PUT(adr + 4, restsize, uintptr); - __PUT(adr + 12, Heap_freeList[di], int32); + __PUT(adr + 12, Heap_freeList[di], uintptr); Heap_freeList[di] = adr; } } @@ -303,16 +303,16 @@ SYSTEM_PTR Heap_NEWREC (uintptr tag) i = adr + 16; end = adr + blksz; while (i < end) { - __PUT(i, 0, int32); - __PUT(i + 4, 0, int32); - __PUT(i + 8, 0, int32); - __PUT(i + 12, 0, int32); + __PUT(i, 0, uintptr); + __PUT(i + 4, 0, uintptr); + __PUT(i + 8, 0, uintptr); + __PUT(i + 12, 0, uintptr); i += 16; } - __PUT(adr + 12, 0, int32); + __PUT(adr + 12, 0, uintptr); __PUT(adr, tag, uintptr); - __PUT(adr + 4, 0, int32); - __PUT(adr + 8, 0, int32); + __PUT(adr + 4, 0, uintptr); + __PUT(adr + 8, 0, uintptr); Heap_allocated += blksz; Heap_Unlock(); _o_result = (SYSTEM_PTR)(uintptr)(adr + 4); @@ -327,29 +327,29 @@ SYSTEM_PTR Heap_NEWBLK (uintptr size) Heap_Lock(); blksz = __ASHL(__ASHR(size + 31, 4), 4); new = Heap_NEWREC((uintptr)&blksz); - tag = (((int32)(uintptr)new) + blksz) - 12; - __PUT(tag - 4, 0, int32); + tag = ((uintptr)(uintptr)new + blksz) - 12; + __PUT(tag - 4, 0, uintptr); __PUT(tag, blksz, uintptr); - __PUT(tag + 4, -4, int32); - __PUT((int32)(uintptr)new - 4, tag, uintptr); + __PUT(tag + 4, -4, uintptr); + __PUT((uintptr)(uintptr)new - 4, tag, uintptr); Heap_Unlock(); _o_result = new; return _o_result; } -static void Heap_Mark (int32 q) +static void Heap_Mark (uintptr q) { - int32 p, tag, fld, n, offset, tagbits; + uintptr p, tag, offset, fld, n, tagbits; if (q != 0) { tagbits = Heap_FetchAddress(q - 4); if (!__ODD(tagbits)) { - __PUT(q - 4, tagbits + 1, int32); + __PUT(q - 4, tagbits + 1, uintptr); p = 0; tag = tagbits + 4; for (;;) { - __GET(tag, offset, int32); - if (offset < 0) { - __PUT(q - 4, (tag + offset) + 1, int32); + __GET(tag, offset, uintptr); + if (__BIT((uintptr)&offset, 31)) { + __PUT(q - 4, (tag + offset) + 1, uintptr); if (p == 0) { break; } @@ -357,7 +357,7 @@ static void Heap_Mark (int32 q) q = p; tag = Heap_FetchAddress(q - 4); tag -= 1; - __GET(tag, offset, int32); + __GET(tag, offset, uintptr); fld = q + offset; p = Heap_FetchAddress(fld); __PUT(fld, (SYSTEM_PTR)(uintptr)n, SYSTEM_PTR); @@ -367,8 +367,8 @@ static void Heap_Mark (int32 q) if (n != 0) { tagbits = Heap_FetchAddress(n - 4); if (!__ODD(tagbits)) { - __PUT(n - 4, tagbits + 1, int32); - __PUT(q - 4, tag + 1, int32); + __PUT(n - 4, tagbits + 1, uintptr); + __PUT(q - 4, tag + 1, uintptr); __PUT(fld, (SYSTEM_PTR)(uintptr)p, SYSTEM_PTR); p = q; q = n; @@ -384,7 +384,7 @@ static void Heap_Mark (int32 q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((int32)(uintptr)p); + Heap_Mark((uintptr)(uintptr)p); } static void Heap_Scan (void) @@ -409,14 +409,14 @@ static void Heap_Scan (void) start = adr - freesize; __PUT(start, start + 4, uintptr); __PUT(start + 4, freesize, uintptr); - __PUT(start + 8, -4, int32); + __PUT(start + 8, -4, uintptr); i = __ASHR(freesize, 4); freesize = 0; if (i < 9) { - __PUT(start + 12, Heap_freeList[i], int32); + __PUT(start + 12, Heap_freeList[i], uintptr); Heap_freeList[i] = start; } else { - __PUT(start + 12, Heap_bigBlocks, int32); + __PUT(start + 12, Heap_bigBlocks, uintptr); Heap_bigBlocks = start; } } @@ -435,14 +435,14 @@ static void Heap_Scan (void) start = adr - freesize; __PUT(start, start + 4, uintptr); __PUT(start + 4, freesize, uintptr); - __PUT(start + 8, -4, int32); + __PUT(start + 8, -4, uintptr); i = __ASHR(freesize, 4); freesize = 0; if (i < 9) { - __PUT(start + 12, Heap_freeList[i], int32); + __PUT(start + 12, Heap_freeList[i], uintptr); Heap_freeList[i] = start; } else { - __PUT(start + 12, Heap_bigBlocks, int32); + __PUT(start + 12, Heap_bigBlocks, uintptr); Heap_bigBlocks = start; } } @@ -450,9 +450,9 @@ static void Heap_Scan (void) } } -static void Heap_Sift (int32 l, int32 r, int32 *a, LONGINT a__len) +static void Heap_Sift (uintptr l, uintptr r, uintptr *a, LONGINT a__len) { - int32 i, j, x; + uintptr i, j, x; j = l; x = a[j]; for (;;) { @@ -469,9 +469,9 @@ static void Heap_Sift (int32 l, int32 r, int32 *a, LONGINT a__len) a[i] = x; } -static void Heap_HeapSort (int32 n, int32 *a, LONGINT a__len) +static void Heap_HeapSort (uintptr n, uintptr *a, LONGINT a__len) { - int32 l, r, x; + uintptr l, r, x; l = __ASHR(n, 1); r = n - 1; while (l > 0) { @@ -487,9 +487,9 @@ static void Heap_HeapSort (int32 n, int32 *a, LONGINT a__len) } } -static void Heap_MarkCandidates (int32 n, int32 *cand, LONGINT cand__len) +static void Heap_MarkCandidates (uintptr n, uintptr *cand, LONGINT cand__len) { - int32 chnk, adr, tag, next, lim, lim1, i, ptr, size; + uintptr chnk, adr, tag, next, lim, lim1, i, ptr, size; chnk = Heap_heap; i = 0; lim = cand[n - 1]; @@ -527,7 +527,7 @@ static void Heap_MarkCandidates (int32 n, int32 *cand, LONGINT cand__len) static void Heap_CheckFin (void) { Heap_FinNode n; - int32 tag; + uintptr tag; n = Heap_fin; while (n != NIL) { tag = Heap_FetchAddress(n->obj - 4); @@ -576,10 +576,10 @@ void Heap_FINALL (void) } } -static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len) +static void Heap_MarkStack (uintptr n, uintptr *cand, LONGINT cand__len) { SYSTEM_PTR frame; - int32 inc, nofcand, sp, p, stack0; + uintptr inc, nofcand, sp, p, stack0; struct Heap__1 align; if (n > 0) { Heap_MarkStack(n - 1, cand, cand__len); @@ -596,7 +596,7 @@ static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len) inc = -inc; } while (sp != stack0) { - __GET(sp, p, int32); + __GET(sp, p, uintptr); if ((p > Heap_heap && p < Heap_heapend)) { if (nofcand == cand__len) { Heap_HeapSort(nofcand, (void*)cand, cand__len); @@ -618,8 +618,8 @@ static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len) void Heap_GC (BOOLEAN markStack) { Heap_Module m; - int32 i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; - int32 cand[10000]; + uintptr i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; + uintptr cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); m = (Heap_Module)(uintptr)Heap_modules; @@ -699,7 +699,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (int32)(uintptr)obj; + f->obj = (uintptr)(uintptr)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; @@ -710,7 +710,7 @@ void Heap_InitHeap (void) { Heap_heap = Heap_NewChunk(128000); Heap_heapend = Heap_FetchAddress(Heap_heap + 4); - __PUT(Heap_heap, 0, int32); + __PUT(Heap_heap, 0, uintptr); Heap_allocated = 0; Heap_firstTry = 1; Heap_freeList[9] = 1; diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index 8f51e615..a003e797 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -51,15 +51,15 @@ typedef Heap_ModuleName name; int32 refcnt; Heap_Cmd cmds; - int32 types; + uintptr types; Heap_EnumProc enumPtrs; int32 reserved1, reserved2; } Heap_ModuleDesc; export SYSTEM_PTR Heap_modules; -static int32 Heap_freeList[10]; -static int32 Heap_bigBlocks; +static uintptr Heap_freeList[10]; +static uintptr Heap_bigBlocks; export uintptr Heap_allocated; static BOOLEAN Heap_firstTry; static uintptr Heap_heap, Heap_heapend; @@ -75,18 +75,18 @@ export LONGINT *Heap_FinDesc__typ; export LONGINT *Heap__1__typ; static void Heap_CheckFin (void); -static void Heap_ExtendHeap (int32 blksz); +static void Heap_ExtendHeap (uintptr blksz); export void Heap_FINALL (void); static void Heap_Finalize (void); export void Heap_GC (BOOLEAN markStack); -static void Heap_HeapSort (int32 n, int32 *a, LONGINT a__len); +static void Heap_HeapSort (uintptr n, uintptr *a, LONGINT a__len); export void Heap_INCREF (Heap_Module m); export void Heap_InitHeap (void); export void Heap_Lock (void); -static void Heap_Mark (int32 q); -static void Heap_MarkCandidates (int32 n, int32 *cand, LONGINT cand__len); +static void Heap_Mark (uintptr q); +static void Heap_MarkCandidates (uintptr n, uintptr *cand, LONGINT cand__len); static void Heap_MarkP (SYSTEM_PTR p); -static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len); +static void Heap_MarkStack (uintptr n, uintptr *cand, LONGINT cand__len); export SYSTEM_PTR Heap_NEWBLK (uintptr size); export SYSTEM_PTR Heap_NEWREC (uintptr tag); static uintptr Heap_NewChunk (uintptr blksz); @@ -95,11 +95,11 @@ export SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); export void Heap_REGTYP (Heap_Module m, uintptr typ); export void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); static void Heap_Scan (void); -static void Heap_Sift (int32 l, int32 r, int32 *a, LONGINT a__len); +static void Heap_Sift (uintptr l, uintptr r, uintptr *a, LONGINT a__len); export void Heap_Unlock (void); extern void *Heap__init(); -extern LONGINT Platform_MainStackFrame; +extern uintptr Platform_MainStackFrame; extern uintptr Platform_OSAllocate(uintptr size); #define Heap_FetchAddress(pointer) (uintptr)(*((void**)((uintptr)pointer))) #define Heap_HeapModuleInit() Heap__init() @@ -156,7 +156,7 @@ void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) void Heap_REGTYP (Heap_Module m, uintptr typ) { - __PUT(typ, m->types, int32); + __PUT(typ, m->types, uintptr); m->types = typ; } @@ -174,8 +174,8 @@ static uintptr Heap_NewChunk (uintptr blksz) __PUT(chnk + 4, chnk + (12 + blksz), uintptr); __PUT(chnk + 12, chnk + 16, uintptr); __PUT(chnk + 16, blksz, uintptr); - __PUT(chnk + 20, -4, int32); - __PUT(chnk + 24, Heap_bigBlocks, int32); + __PUT(chnk + 20, -4, uintptr); + __PUT(chnk + 24, Heap_bigBlocks, uintptr); Heap_bigBlocks = chnk + 12; Heap_heapsize += blksz; } @@ -183,9 +183,9 @@ static uintptr Heap_NewChunk (uintptr blksz) return _o_result; } -static void Heap_ExtendHeap (int32 blksz) +static void Heap_ExtendHeap (uintptr blksz) { - int32 size, chnk, j, next; + uintptr size, chnk, j, next; if (blksz > 160000) { size = blksz; } else { @@ -203,8 +203,8 @@ static void Heap_ExtendHeap (int32 blksz) j = next; next = Heap_FetchAddress(j); } - __PUT(chnk, next, int32); - __PUT(j, chnk, int32); + __PUT(chnk, next, uintptr); + __PUT(j, chnk, uintptr); } if (next == 0) { Heap_heapend = Heap_FetchAddress(chnk + 4); @@ -236,10 +236,10 @@ SYSTEM_PTR Heap_NEWREC (uintptr tag) restsize = __ASHL(di, 4); end = adr + restsize; __PUT(end + 4, blksz, uintptr); - __PUT(end + 8, -4, int32); - __PUT(end, end + 4, int32); + __PUT(end + 8, -4, uintptr); + __PUT(end, end + 4, uintptr); __PUT(adr + 4, restsize, uintptr); - __PUT(adr + 12, Heap_freeList[di], int32); + __PUT(adr + 12, Heap_freeList[di], uintptr); Heap_freeList[di] = adr; adr += restsize; } @@ -280,8 +280,8 @@ SYSTEM_PTR Heap_NEWREC (uintptr tag) restsize = t - blksz; end = adr + restsize; __PUT(end + 4, blksz, uintptr); - __PUT(end + 8, -4, int32); - __PUT(end, end + 4, int32); + __PUT(end + 8, -4, uintptr); + __PUT(end, end + 4, uintptr); if (restsize > 144) { __PUT(adr + 4, restsize, uintptr); } else { @@ -294,7 +294,7 @@ SYSTEM_PTR Heap_NEWREC (uintptr tag) if (restsize > 0) { di = __ASHR(restsize, 4); __PUT(adr + 4, restsize, uintptr); - __PUT(adr + 12, Heap_freeList[di], int32); + __PUT(adr + 12, Heap_freeList[di], uintptr); Heap_freeList[di] = adr; } } @@ -303,16 +303,16 @@ SYSTEM_PTR Heap_NEWREC (uintptr tag) i = adr + 16; end = adr + blksz; while (i < end) { - __PUT(i, 0, int32); - __PUT(i + 4, 0, int32); - __PUT(i + 8, 0, int32); - __PUT(i + 12, 0, int32); + __PUT(i, 0, uintptr); + __PUT(i + 4, 0, uintptr); + __PUT(i + 8, 0, uintptr); + __PUT(i + 12, 0, uintptr); i += 16; } - __PUT(adr + 12, 0, int32); + __PUT(adr + 12, 0, uintptr); __PUT(adr, tag, uintptr); - __PUT(adr + 4, 0, int32); - __PUT(adr + 8, 0, int32); + __PUT(adr + 4, 0, uintptr); + __PUT(adr + 8, 0, uintptr); Heap_allocated += blksz; Heap_Unlock(); _o_result = (SYSTEM_PTR)(uintptr)(adr + 4); @@ -327,29 +327,29 @@ SYSTEM_PTR Heap_NEWBLK (uintptr size) Heap_Lock(); blksz = __ASHL(__ASHR(size + 31, 4), 4); new = Heap_NEWREC((uintptr)&blksz); - tag = (((int32)(uintptr)new) + blksz) - 12; - __PUT(tag - 4, 0, int32); + tag = ((uintptr)(uintptr)new + blksz) - 12; + __PUT(tag - 4, 0, uintptr); __PUT(tag, blksz, uintptr); - __PUT(tag + 4, -4, int32); - __PUT((int32)(uintptr)new - 4, tag, uintptr); + __PUT(tag + 4, -4, uintptr); + __PUT((uintptr)(uintptr)new - 4, tag, uintptr); Heap_Unlock(); _o_result = new; return _o_result; } -static void Heap_Mark (int32 q) +static void Heap_Mark (uintptr q) { - int32 p, tag, fld, n, offset, tagbits; + uintptr p, tag, offset, fld, n, tagbits; if (q != 0) { tagbits = Heap_FetchAddress(q - 4); if (!__ODD(tagbits)) { - __PUT(q - 4, tagbits + 1, int32); + __PUT(q - 4, tagbits + 1, uintptr); p = 0; tag = tagbits + 4; for (;;) { - __GET(tag, offset, int32); - if (offset < 0) { - __PUT(q - 4, (tag + offset) + 1, int32); + __GET(tag, offset, uintptr); + if (__BIT((uintptr)&offset, 31)) { + __PUT(q - 4, (tag + offset) + 1, uintptr); if (p == 0) { break; } @@ -357,7 +357,7 @@ static void Heap_Mark (int32 q) q = p; tag = Heap_FetchAddress(q - 4); tag -= 1; - __GET(tag, offset, int32); + __GET(tag, offset, uintptr); fld = q + offset; p = Heap_FetchAddress(fld); __PUT(fld, (SYSTEM_PTR)(uintptr)n, SYSTEM_PTR); @@ -367,8 +367,8 @@ static void Heap_Mark (int32 q) if (n != 0) { tagbits = Heap_FetchAddress(n - 4); if (!__ODD(tagbits)) { - __PUT(n - 4, tagbits + 1, int32); - __PUT(q - 4, tag + 1, int32); + __PUT(n - 4, tagbits + 1, uintptr); + __PUT(q - 4, tag + 1, uintptr); __PUT(fld, (SYSTEM_PTR)(uintptr)p, SYSTEM_PTR); p = q; q = n; @@ -384,7 +384,7 @@ static void Heap_Mark (int32 q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((int32)(uintptr)p); + Heap_Mark((uintptr)(uintptr)p); } static void Heap_Scan (void) @@ -409,14 +409,14 @@ static void Heap_Scan (void) start = adr - freesize; __PUT(start, start + 4, uintptr); __PUT(start + 4, freesize, uintptr); - __PUT(start + 8, -4, int32); + __PUT(start + 8, -4, uintptr); i = __ASHR(freesize, 4); freesize = 0; if (i < 9) { - __PUT(start + 12, Heap_freeList[i], int32); + __PUT(start + 12, Heap_freeList[i], uintptr); Heap_freeList[i] = start; } else { - __PUT(start + 12, Heap_bigBlocks, int32); + __PUT(start + 12, Heap_bigBlocks, uintptr); Heap_bigBlocks = start; } } @@ -435,14 +435,14 @@ static void Heap_Scan (void) start = adr - freesize; __PUT(start, start + 4, uintptr); __PUT(start + 4, freesize, uintptr); - __PUT(start + 8, -4, int32); + __PUT(start + 8, -4, uintptr); i = __ASHR(freesize, 4); freesize = 0; if (i < 9) { - __PUT(start + 12, Heap_freeList[i], int32); + __PUT(start + 12, Heap_freeList[i], uintptr); Heap_freeList[i] = start; } else { - __PUT(start + 12, Heap_bigBlocks, int32); + __PUT(start + 12, Heap_bigBlocks, uintptr); Heap_bigBlocks = start; } } @@ -450,9 +450,9 @@ static void Heap_Scan (void) } } -static void Heap_Sift (int32 l, int32 r, int32 *a, LONGINT a__len) +static void Heap_Sift (uintptr l, uintptr r, uintptr *a, LONGINT a__len) { - int32 i, j, x; + uintptr i, j, x; j = l; x = a[j]; for (;;) { @@ -469,9 +469,9 @@ static void Heap_Sift (int32 l, int32 r, int32 *a, LONGINT a__len) a[i] = x; } -static void Heap_HeapSort (int32 n, int32 *a, LONGINT a__len) +static void Heap_HeapSort (uintptr n, uintptr *a, LONGINT a__len) { - int32 l, r, x; + uintptr l, r, x; l = __ASHR(n, 1); r = n - 1; while (l > 0) { @@ -487,9 +487,9 @@ static void Heap_HeapSort (int32 n, int32 *a, LONGINT a__len) } } -static void Heap_MarkCandidates (int32 n, int32 *cand, LONGINT cand__len) +static void Heap_MarkCandidates (uintptr n, uintptr *cand, LONGINT cand__len) { - int32 chnk, adr, tag, next, lim, lim1, i, ptr, size; + uintptr chnk, adr, tag, next, lim, lim1, i, ptr, size; chnk = Heap_heap; i = 0; lim = cand[n - 1]; @@ -527,7 +527,7 @@ static void Heap_MarkCandidates (int32 n, int32 *cand, LONGINT cand__len) static void Heap_CheckFin (void) { Heap_FinNode n; - int32 tag; + uintptr tag; n = Heap_fin; while (n != NIL) { tag = Heap_FetchAddress(n->obj - 4); @@ -576,10 +576,10 @@ void Heap_FINALL (void) } } -static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len) +static void Heap_MarkStack (uintptr n, uintptr *cand, LONGINT cand__len) { SYSTEM_PTR frame; - int32 inc, nofcand, sp, p, stack0; + uintptr inc, nofcand, sp, p, stack0; struct Heap__1 align; if (n > 0) { Heap_MarkStack(n - 1, cand, cand__len); @@ -596,7 +596,7 @@ static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len) inc = -inc; } while (sp != stack0) { - __GET(sp, p, int32); + __GET(sp, p, uintptr); if ((p > Heap_heap && p < Heap_heapend)) { if (nofcand == cand__len) { Heap_HeapSort(nofcand, (void*)cand, cand__len); @@ -618,8 +618,8 @@ static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len) void Heap_GC (BOOLEAN markStack) { Heap_Module m; - int32 i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; - int32 cand[10000]; + uintptr i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; + uintptr cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); m = (Heap_Module)(uintptr)Heap_modules; @@ -699,7 +699,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (int32)(uintptr)obj; + f->obj = (uintptr)(uintptr)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; @@ -710,7 +710,7 @@ void Heap_InitHeap (void) { Heap_heap = Heap_NewChunk(128000); Heap_heapend = Heap_FetchAddress(Heap_heap + 4); - __PUT(Heap_heap, 0, int32); + __PUT(Heap_heap, 0, uintptr); Heap_allocated = 0; Heap_firstTry = 1; Heap_freeList[9] = 1; diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index 1f1b65b4..6712b853 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -52,15 +52,15 @@ typedef Heap_ModuleName name; int64 refcnt; Heap_Cmd cmds; - int64 types; + uintptr types; Heap_EnumProc enumPtrs; int64 reserved1, reserved2; } Heap_ModuleDesc; export SYSTEM_PTR Heap_modules; -static int64 Heap_freeList[10]; -static int64 Heap_bigBlocks; +static uintptr Heap_freeList[10]; +static uintptr Heap_bigBlocks; export uintptr Heap_allocated; static BOOLEAN Heap_firstTry; static uintptr Heap_heap, Heap_heapend; @@ -76,18 +76,18 @@ export LONGINT *Heap_FinDesc__typ; export LONGINT *Heap__1__typ; static void Heap_CheckFin (void); -static void Heap_ExtendHeap (int64 blksz); +static void Heap_ExtendHeap (uintptr blksz); export void Heap_FINALL (void); static void Heap_Finalize (void); export void Heap_GC (BOOLEAN markStack); -static void Heap_HeapSort (int64 n, int64 *a, LONGINT a__len); +static void Heap_HeapSort (uintptr n, uintptr *a, LONGINT a__len); export void Heap_INCREF (Heap_Module m); export void Heap_InitHeap (void); export void Heap_Lock (void); -static void Heap_Mark (int64 q); -static void Heap_MarkCandidates (int64 n, int64 *cand, LONGINT cand__len); +static void Heap_Mark (uintptr q); +static void Heap_MarkCandidates (uintptr n, uintptr *cand, LONGINT cand__len); static void Heap_MarkP (SYSTEM_PTR p); -static void Heap_MarkStack (int64 n, int64 *cand, LONGINT cand__len); +static void Heap_MarkStack (uintptr n, uintptr *cand, LONGINT cand__len); export SYSTEM_PTR Heap_NEWBLK (uintptr size); export SYSTEM_PTR Heap_NEWREC (uintptr tag); static uintptr Heap_NewChunk (uintptr blksz); @@ -96,11 +96,11 @@ export SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); export void Heap_REGTYP (Heap_Module m, uintptr typ); export void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); static void Heap_Scan (void); -static void Heap_Sift (int64 l, int64 r, int64 *a, LONGINT a__len); +static void Heap_Sift (uintptr l, uintptr r, uintptr *a, LONGINT a__len); export void Heap_Unlock (void); extern void *Heap__init(); -extern LONGINT Platform_MainStackFrame; +extern uintptr Platform_MainStackFrame; extern uintptr Platform_OSAllocate(uintptr size); #define Heap_FetchAddress(pointer) (uintptr)(*((void**)((uintptr)pointer))) #define Heap_HeapModuleInit() Heap__init() @@ -157,7 +157,7 @@ void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) void Heap_REGTYP (Heap_Module m, uintptr typ) { - __PUT(typ, m->types, int64); + __PUT(typ, m->types, uintptr); m->types = typ; } @@ -175,8 +175,8 @@ static uintptr Heap_NewChunk (uintptr blksz) __PUT(chnk + 8, chnk + (24 + blksz), uintptr); __PUT(chnk + 24, chnk + 32, uintptr); __PUT(chnk + 32, blksz, uintptr); - __PUT(chnk + 40, -8, int64); - __PUT(chnk + 48, Heap_bigBlocks, int64); + __PUT(chnk + 40, -8, uintptr); + __PUT(chnk + 48, Heap_bigBlocks, uintptr); Heap_bigBlocks = chnk + 24; Heap_heapsize += blksz; } @@ -184,9 +184,9 @@ static uintptr Heap_NewChunk (uintptr blksz) return _o_result; } -static void Heap_ExtendHeap (int64 blksz) +static void Heap_ExtendHeap (uintptr blksz) { - int64 size, chnk, j, next; + uintptr size, chnk, j, next; if (blksz > 320000) { size = blksz; } else { @@ -204,8 +204,8 @@ static void Heap_ExtendHeap (int64 blksz) j = next; next = Heap_FetchAddress(j); } - __PUT(chnk, next, int64); - __PUT(j, chnk, int64); + __PUT(chnk, next, uintptr); + __PUT(j, chnk, uintptr); } if (next == 0) { Heap_heapend = Heap_FetchAddress(chnk + 8); @@ -237,10 +237,10 @@ SYSTEM_PTR Heap_NEWREC (uintptr tag) restsize = __ASHL(di, 5); end = adr + restsize; __PUT(end + 8, blksz, uintptr); - __PUT(end + 16, -8, int64); - __PUT(end, end + 8, int64); + __PUT(end + 16, -8, uintptr); + __PUT(end, end + 8, uintptr); __PUT(adr + 8, restsize, uintptr); - __PUT(adr + 24, Heap_freeList[di], int64); + __PUT(adr + 24, Heap_freeList[di], uintptr); Heap_freeList[di] = adr; adr += restsize; } @@ -281,8 +281,8 @@ SYSTEM_PTR Heap_NEWREC (uintptr tag) restsize = t - blksz; end = adr + restsize; __PUT(end + 8, blksz, uintptr); - __PUT(end + 16, -8, int64); - __PUT(end, end + 8, int64); + __PUT(end + 16, -8, uintptr); + __PUT(end, end + 8, uintptr); if (restsize > 288) { __PUT(adr + 8, restsize, uintptr); } else { @@ -295,7 +295,7 @@ SYSTEM_PTR Heap_NEWREC (uintptr tag) if (restsize > 0) { di = __ASHR(restsize, 5); __PUT(adr + 8, restsize, uintptr); - __PUT(adr + 24, Heap_freeList[di], int64); + __PUT(adr + 24, Heap_freeList[di], uintptr); Heap_freeList[di] = adr; } } @@ -304,16 +304,16 @@ SYSTEM_PTR Heap_NEWREC (uintptr tag) i = adr + 32; end = adr + blksz; while (i < end) { - __PUT(i, 0, int64); - __PUT(i + 8, 0, int64); - __PUT(i + 16, 0, int64); - __PUT(i + 24, 0, int64); + __PUT(i, 0, uintptr); + __PUT(i + 8, 0, uintptr); + __PUT(i + 16, 0, uintptr); + __PUT(i + 24, 0, uintptr); i += 32; } - __PUT(adr + 24, 0, int64); + __PUT(adr + 24, 0, uintptr); __PUT(adr, tag, uintptr); - __PUT(adr + 8, 0, int64); - __PUT(adr + 16, 0, int64); + __PUT(adr + 8, 0, uintptr); + __PUT(adr + 16, 0, uintptr); Heap_allocated += blksz; Heap_Unlock(); _o_result = (SYSTEM_PTR)(uintptr)(adr + 8); @@ -328,29 +328,29 @@ SYSTEM_PTR Heap_NEWBLK (uintptr size) Heap_Lock(); blksz = __ASHL(__ASHR(size + 63, 5), 5); new = Heap_NEWREC((uintptr)&blksz); - tag = (((int64)(uintptr)new) + blksz) - 24; - __PUT(tag - 8, 0, int64); + tag = ((uintptr)(uintptr)new + blksz) - 24; + __PUT(tag - 8, 0, uintptr); __PUT(tag, blksz, uintptr); - __PUT(tag + 8, -8, int64); - __PUT((int64)(uintptr)new - 8, tag, uintptr); + __PUT(tag + 8, -8, uintptr); + __PUT((uintptr)(uintptr)new - 8, tag, uintptr); Heap_Unlock(); _o_result = new; return _o_result; } -static void Heap_Mark (int64 q) +static void Heap_Mark (uintptr q) { - int64 p, tag, fld, n, offset, tagbits; + uintptr p, tag, offset, fld, n, tagbits; if (q != 0) { tagbits = Heap_FetchAddress(q - 8); if (!__ODD(tagbits)) { - __PUT(q - 8, tagbits + 1, int64); + __PUT(q - 8, tagbits + 1, uintptr); p = 0; tag = tagbits + 8; for (;;) { - __GET(tag, offset, int64); - if (offset < 0) { - __PUT(q - 8, (tag + offset) + 1, int64); + __GET(tag, offset, uintptr); + if (__BIT((uintptr)&offset, 63)) { + __PUT(q - 8, (tag + offset) + 1, uintptr); if (p == 0) { break; } @@ -358,7 +358,7 @@ static void Heap_Mark (int64 q) q = p; tag = Heap_FetchAddress(q - 8); tag -= 1; - __GET(tag, offset, int64); + __GET(tag, offset, uintptr); fld = q + offset; p = Heap_FetchAddress(fld); __PUT(fld, (SYSTEM_PTR)(uintptr)n, SYSTEM_PTR); @@ -368,8 +368,8 @@ static void Heap_Mark (int64 q) if (n != 0) { tagbits = Heap_FetchAddress(n - 8); if (!__ODD(tagbits)) { - __PUT(n - 8, tagbits + 1, int64); - __PUT(q - 8, tag + 1, int64); + __PUT(n - 8, tagbits + 1, uintptr); + __PUT(q - 8, tag + 1, uintptr); __PUT(fld, (SYSTEM_PTR)(uintptr)p, SYSTEM_PTR); p = q; q = n; @@ -385,7 +385,7 @@ static void Heap_Mark (int64 q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((int64)(uintptr)p); + Heap_Mark((uintptr)(uintptr)p); } static void Heap_Scan (void) @@ -410,14 +410,14 @@ static void Heap_Scan (void) start = adr - freesize; __PUT(start, start + 8, uintptr); __PUT(start + 8, freesize, uintptr); - __PUT(start + 16, -8, int64); + __PUT(start + 16, -8, uintptr); i = __ASHR(freesize, 5); freesize = 0; if (i < 9) { - __PUT(start + 24, Heap_freeList[i], int64); + __PUT(start + 24, Heap_freeList[i], uintptr); Heap_freeList[i] = start; } else { - __PUT(start + 24, Heap_bigBlocks, int64); + __PUT(start + 24, Heap_bigBlocks, uintptr); Heap_bigBlocks = start; } } @@ -436,14 +436,14 @@ static void Heap_Scan (void) start = adr - freesize; __PUT(start, start + 8, uintptr); __PUT(start + 8, freesize, uintptr); - __PUT(start + 16, -8, int64); + __PUT(start + 16, -8, uintptr); i = __ASHR(freesize, 5); freesize = 0; if (i < 9) { - __PUT(start + 24, Heap_freeList[i], int64); + __PUT(start + 24, Heap_freeList[i], uintptr); Heap_freeList[i] = start; } else { - __PUT(start + 24, Heap_bigBlocks, int64); + __PUT(start + 24, Heap_bigBlocks, uintptr); Heap_bigBlocks = start; } } @@ -451,9 +451,9 @@ static void Heap_Scan (void) } } -static void Heap_Sift (int64 l, int64 r, int64 *a, LONGINT a__len) +static void Heap_Sift (uintptr l, uintptr r, uintptr *a, LONGINT a__len) { - int64 i, j, x; + uintptr i, j, x; j = l; x = a[j]; for (;;) { @@ -470,9 +470,9 @@ static void Heap_Sift (int64 l, int64 r, int64 *a, LONGINT a__len) a[i] = x; } -static void Heap_HeapSort (int64 n, int64 *a, LONGINT a__len) +static void Heap_HeapSort (uintptr n, uintptr *a, LONGINT a__len) { - int64 l, r, x; + uintptr l, r, x; l = __ASHR(n, 1); r = n - 1; while (l > 0) { @@ -488,9 +488,9 @@ static void Heap_HeapSort (int64 n, int64 *a, LONGINT a__len) } } -static void Heap_MarkCandidates (int64 n, int64 *cand, LONGINT cand__len) +static void Heap_MarkCandidates (uintptr n, uintptr *cand, LONGINT cand__len) { - int64 chnk, adr, tag, next, lim, lim1, i, ptr, size; + uintptr chnk, adr, tag, next, lim, lim1, i, ptr, size; chnk = Heap_heap; i = 0; lim = cand[n - 1]; @@ -528,7 +528,7 @@ static void Heap_MarkCandidates (int64 n, int64 *cand, LONGINT cand__len) static void Heap_CheckFin (void) { Heap_FinNode n; - int64 tag; + uintptr tag; n = Heap_fin; while (n != NIL) { tag = Heap_FetchAddress(n->obj - 8); @@ -577,10 +577,10 @@ void Heap_FINALL (void) } } -static void Heap_MarkStack (int64 n, int64 *cand, LONGINT cand__len) +static void Heap_MarkStack (uintptr n, uintptr *cand, LONGINT cand__len) { SYSTEM_PTR frame; - int64 inc, nofcand, sp, p, stack0; + uintptr inc, nofcand, sp, p, stack0; struct Heap__1 align; if (n > 0) { Heap_MarkStack(n - 1, cand, cand__len); @@ -597,7 +597,7 @@ static void Heap_MarkStack (int64 n, int64 *cand, LONGINT cand__len) inc = -inc; } while (sp != stack0) { - __GET(sp, p, int64); + __GET(sp, p, uintptr); if ((p > Heap_heap && p < Heap_heapend)) { if (nofcand == cand__len) { Heap_HeapSort(nofcand, (void*)cand, cand__len); @@ -619,8 +619,8 @@ static void Heap_MarkStack (int64 n, int64 *cand, LONGINT cand__len) void Heap_GC (BOOLEAN markStack) { Heap_Module m; - int64 i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; - int64 cand[10000]; + uintptr i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; + uintptr cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); m = (Heap_Module)(uintptr)Heap_modules; @@ -700,7 +700,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (int64)(uintptr)obj; + f->obj = (uintptr)(uintptr)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; @@ -711,7 +711,7 @@ void Heap_InitHeap (void) { Heap_heap = Heap_NewChunk(256000); Heap_heapend = Heap_FetchAddress(Heap_heap + 8); - __PUT(Heap_heap, 0, int64); + __PUT(Heap_heap, 0, uintptr); Heap_allocated = 0; Heap_firstTry = 1; Heap_freeList[9] = 1; diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index 8f51e615..a003e797 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -51,15 +51,15 @@ typedef Heap_ModuleName name; int32 refcnt; Heap_Cmd cmds; - int32 types; + uintptr types; Heap_EnumProc enumPtrs; int32 reserved1, reserved2; } Heap_ModuleDesc; export SYSTEM_PTR Heap_modules; -static int32 Heap_freeList[10]; -static int32 Heap_bigBlocks; +static uintptr Heap_freeList[10]; +static uintptr Heap_bigBlocks; export uintptr Heap_allocated; static BOOLEAN Heap_firstTry; static uintptr Heap_heap, Heap_heapend; @@ -75,18 +75,18 @@ export LONGINT *Heap_FinDesc__typ; export LONGINT *Heap__1__typ; static void Heap_CheckFin (void); -static void Heap_ExtendHeap (int32 blksz); +static void Heap_ExtendHeap (uintptr blksz); export void Heap_FINALL (void); static void Heap_Finalize (void); export void Heap_GC (BOOLEAN markStack); -static void Heap_HeapSort (int32 n, int32 *a, LONGINT a__len); +static void Heap_HeapSort (uintptr n, uintptr *a, LONGINT a__len); export void Heap_INCREF (Heap_Module m); export void Heap_InitHeap (void); export void Heap_Lock (void); -static void Heap_Mark (int32 q); -static void Heap_MarkCandidates (int32 n, int32 *cand, LONGINT cand__len); +static void Heap_Mark (uintptr q); +static void Heap_MarkCandidates (uintptr n, uintptr *cand, LONGINT cand__len); static void Heap_MarkP (SYSTEM_PTR p); -static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len); +static void Heap_MarkStack (uintptr n, uintptr *cand, LONGINT cand__len); export SYSTEM_PTR Heap_NEWBLK (uintptr size); export SYSTEM_PTR Heap_NEWREC (uintptr tag); static uintptr Heap_NewChunk (uintptr blksz); @@ -95,11 +95,11 @@ export SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); export void Heap_REGTYP (Heap_Module m, uintptr typ); export void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); static void Heap_Scan (void); -static void Heap_Sift (int32 l, int32 r, int32 *a, LONGINT a__len); +static void Heap_Sift (uintptr l, uintptr r, uintptr *a, LONGINT a__len); export void Heap_Unlock (void); extern void *Heap__init(); -extern LONGINT Platform_MainStackFrame; +extern uintptr Platform_MainStackFrame; extern uintptr Platform_OSAllocate(uintptr size); #define Heap_FetchAddress(pointer) (uintptr)(*((void**)((uintptr)pointer))) #define Heap_HeapModuleInit() Heap__init() @@ -156,7 +156,7 @@ void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) void Heap_REGTYP (Heap_Module m, uintptr typ) { - __PUT(typ, m->types, int32); + __PUT(typ, m->types, uintptr); m->types = typ; } @@ -174,8 +174,8 @@ static uintptr Heap_NewChunk (uintptr blksz) __PUT(chnk + 4, chnk + (12 + blksz), uintptr); __PUT(chnk + 12, chnk + 16, uintptr); __PUT(chnk + 16, blksz, uintptr); - __PUT(chnk + 20, -4, int32); - __PUT(chnk + 24, Heap_bigBlocks, int32); + __PUT(chnk + 20, -4, uintptr); + __PUT(chnk + 24, Heap_bigBlocks, uintptr); Heap_bigBlocks = chnk + 12; Heap_heapsize += blksz; } @@ -183,9 +183,9 @@ static uintptr Heap_NewChunk (uintptr blksz) return _o_result; } -static void Heap_ExtendHeap (int32 blksz) +static void Heap_ExtendHeap (uintptr blksz) { - int32 size, chnk, j, next; + uintptr size, chnk, j, next; if (blksz > 160000) { size = blksz; } else { @@ -203,8 +203,8 @@ static void Heap_ExtendHeap (int32 blksz) j = next; next = Heap_FetchAddress(j); } - __PUT(chnk, next, int32); - __PUT(j, chnk, int32); + __PUT(chnk, next, uintptr); + __PUT(j, chnk, uintptr); } if (next == 0) { Heap_heapend = Heap_FetchAddress(chnk + 4); @@ -236,10 +236,10 @@ SYSTEM_PTR Heap_NEWREC (uintptr tag) restsize = __ASHL(di, 4); end = adr + restsize; __PUT(end + 4, blksz, uintptr); - __PUT(end + 8, -4, int32); - __PUT(end, end + 4, int32); + __PUT(end + 8, -4, uintptr); + __PUT(end, end + 4, uintptr); __PUT(adr + 4, restsize, uintptr); - __PUT(adr + 12, Heap_freeList[di], int32); + __PUT(adr + 12, Heap_freeList[di], uintptr); Heap_freeList[di] = adr; adr += restsize; } @@ -280,8 +280,8 @@ SYSTEM_PTR Heap_NEWREC (uintptr tag) restsize = t - blksz; end = adr + restsize; __PUT(end + 4, blksz, uintptr); - __PUT(end + 8, -4, int32); - __PUT(end, end + 4, int32); + __PUT(end + 8, -4, uintptr); + __PUT(end, end + 4, uintptr); if (restsize > 144) { __PUT(adr + 4, restsize, uintptr); } else { @@ -294,7 +294,7 @@ SYSTEM_PTR Heap_NEWREC (uintptr tag) if (restsize > 0) { di = __ASHR(restsize, 4); __PUT(adr + 4, restsize, uintptr); - __PUT(adr + 12, Heap_freeList[di], int32); + __PUT(adr + 12, Heap_freeList[di], uintptr); Heap_freeList[di] = adr; } } @@ -303,16 +303,16 @@ SYSTEM_PTR Heap_NEWREC (uintptr tag) i = adr + 16; end = adr + blksz; while (i < end) { - __PUT(i, 0, int32); - __PUT(i + 4, 0, int32); - __PUT(i + 8, 0, int32); - __PUT(i + 12, 0, int32); + __PUT(i, 0, uintptr); + __PUT(i + 4, 0, uintptr); + __PUT(i + 8, 0, uintptr); + __PUT(i + 12, 0, uintptr); i += 16; } - __PUT(adr + 12, 0, int32); + __PUT(adr + 12, 0, uintptr); __PUT(adr, tag, uintptr); - __PUT(adr + 4, 0, int32); - __PUT(adr + 8, 0, int32); + __PUT(adr + 4, 0, uintptr); + __PUT(adr + 8, 0, uintptr); Heap_allocated += blksz; Heap_Unlock(); _o_result = (SYSTEM_PTR)(uintptr)(adr + 4); @@ -327,29 +327,29 @@ SYSTEM_PTR Heap_NEWBLK (uintptr size) Heap_Lock(); blksz = __ASHL(__ASHR(size + 31, 4), 4); new = Heap_NEWREC((uintptr)&blksz); - tag = (((int32)(uintptr)new) + blksz) - 12; - __PUT(tag - 4, 0, int32); + tag = ((uintptr)(uintptr)new + blksz) - 12; + __PUT(tag - 4, 0, uintptr); __PUT(tag, blksz, uintptr); - __PUT(tag + 4, -4, int32); - __PUT((int32)(uintptr)new - 4, tag, uintptr); + __PUT(tag + 4, -4, uintptr); + __PUT((uintptr)(uintptr)new - 4, tag, uintptr); Heap_Unlock(); _o_result = new; return _o_result; } -static void Heap_Mark (int32 q) +static void Heap_Mark (uintptr q) { - int32 p, tag, fld, n, offset, tagbits; + uintptr p, tag, offset, fld, n, tagbits; if (q != 0) { tagbits = Heap_FetchAddress(q - 4); if (!__ODD(tagbits)) { - __PUT(q - 4, tagbits + 1, int32); + __PUT(q - 4, tagbits + 1, uintptr); p = 0; tag = tagbits + 4; for (;;) { - __GET(tag, offset, int32); - if (offset < 0) { - __PUT(q - 4, (tag + offset) + 1, int32); + __GET(tag, offset, uintptr); + if (__BIT((uintptr)&offset, 31)) { + __PUT(q - 4, (tag + offset) + 1, uintptr); if (p == 0) { break; } @@ -357,7 +357,7 @@ static void Heap_Mark (int32 q) q = p; tag = Heap_FetchAddress(q - 4); tag -= 1; - __GET(tag, offset, int32); + __GET(tag, offset, uintptr); fld = q + offset; p = Heap_FetchAddress(fld); __PUT(fld, (SYSTEM_PTR)(uintptr)n, SYSTEM_PTR); @@ -367,8 +367,8 @@ static void Heap_Mark (int32 q) if (n != 0) { tagbits = Heap_FetchAddress(n - 4); if (!__ODD(tagbits)) { - __PUT(n - 4, tagbits + 1, int32); - __PUT(q - 4, tag + 1, int32); + __PUT(n - 4, tagbits + 1, uintptr); + __PUT(q - 4, tag + 1, uintptr); __PUT(fld, (SYSTEM_PTR)(uintptr)p, SYSTEM_PTR); p = q; q = n; @@ -384,7 +384,7 @@ static void Heap_Mark (int32 q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((int32)(uintptr)p); + Heap_Mark((uintptr)(uintptr)p); } static void Heap_Scan (void) @@ -409,14 +409,14 @@ static void Heap_Scan (void) start = adr - freesize; __PUT(start, start + 4, uintptr); __PUT(start + 4, freesize, uintptr); - __PUT(start + 8, -4, int32); + __PUT(start + 8, -4, uintptr); i = __ASHR(freesize, 4); freesize = 0; if (i < 9) { - __PUT(start + 12, Heap_freeList[i], int32); + __PUT(start + 12, Heap_freeList[i], uintptr); Heap_freeList[i] = start; } else { - __PUT(start + 12, Heap_bigBlocks, int32); + __PUT(start + 12, Heap_bigBlocks, uintptr); Heap_bigBlocks = start; } } @@ -435,14 +435,14 @@ static void Heap_Scan (void) start = adr - freesize; __PUT(start, start + 4, uintptr); __PUT(start + 4, freesize, uintptr); - __PUT(start + 8, -4, int32); + __PUT(start + 8, -4, uintptr); i = __ASHR(freesize, 4); freesize = 0; if (i < 9) { - __PUT(start + 12, Heap_freeList[i], int32); + __PUT(start + 12, Heap_freeList[i], uintptr); Heap_freeList[i] = start; } else { - __PUT(start + 12, Heap_bigBlocks, int32); + __PUT(start + 12, Heap_bigBlocks, uintptr); Heap_bigBlocks = start; } } @@ -450,9 +450,9 @@ static void Heap_Scan (void) } } -static void Heap_Sift (int32 l, int32 r, int32 *a, LONGINT a__len) +static void Heap_Sift (uintptr l, uintptr r, uintptr *a, LONGINT a__len) { - int32 i, j, x; + uintptr i, j, x; j = l; x = a[j]; for (;;) { @@ -469,9 +469,9 @@ static void Heap_Sift (int32 l, int32 r, int32 *a, LONGINT a__len) a[i] = x; } -static void Heap_HeapSort (int32 n, int32 *a, LONGINT a__len) +static void Heap_HeapSort (uintptr n, uintptr *a, LONGINT a__len) { - int32 l, r, x; + uintptr l, r, x; l = __ASHR(n, 1); r = n - 1; while (l > 0) { @@ -487,9 +487,9 @@ static void Heap_HeapSort (int32 n, int32 *a, LONGINT a__len) } } -static void Heap_MarkCandidates (int32 n, int32 *cand, LONGINT cand__len) +static void Heap_MarkCandidates (uintptr n, uintptr *cand, LONGINT cand__len) { - int32 chnk, adr, tag, next, lim, lim1, i, ptr, size; + uintptr chnk, adr, tag, next, lim, lim1, i, ptr, size; chnk = Heap_heap; i = 0; lim = cand[n - 1]; @@ -527,7 +527,7 @@ static void Heap_MarkCandidates (int32 n, int32 *cand, LONGINT cand__len) static void Heap_CheckFin (void) { Heap_FinNode n; - int32 tag; + uintptr tag; n = Heap_fin; while (n != NIL) { tag = Heap_FetchAddress(n->obj - 4); @@ -576,10 +576,10 @@ void Heap_FINALL (void) } } -static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len) +static void Heap_MarkStack (uintptr n, uintptr *cand, LONGINT cand__len) { SYSTEM_PTR frame; - int32 inc, nofcand, sp, p, stack0; + uintptr inc, nofcand, sp, p, stack0; struct Heap__1 align; if (n > 0) { Heap_MarkStack(n - 1, cand, cand__len); @@ -596,7 +596,7 @@ static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len) inc = -inc; } while (sp != stack0) { - __GET(sp, p, int32); + __GET(sp, p, uintptr); if ((p > Heap_heap && p < Heap_heapend)) { if (nofcand == cand__len) { Heap_HeapSort(nofcand, (void*)cand, cand__len); @@ -618,8 +618,8 @@ static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len) void Heap_GC (BOOLEAN markStack) { Heap_Module m; - int32 i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; - int32 cand[10000]; + uintptr i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; + uintptr cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); m = (Heap_Module)(uintptr)Heap_modules; @@ -699,7 +699,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (int32)(uintptr)obj; + f->obj = (uintptr)(uintptr)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; @@ -710,7 +710,7 @@ void Heap_InitHeap (void) { Heap_heap = Heap_NewChunk(128000); Heap_heapend = Heap_FetchAddress(Heap_heap + 4); - __PUT(Heap_heap, 0, int32); + __PUT(Heap_heap, 0, uintptr); Heap_allocated = 0; Heap_firstTry = 1; Heap_freeList[9] = 1; diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index 1f1b65b4..6712b853 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -52,15 +52,15 @@ typedef Heap_ModuleName name; int64 refcnt; Heap_Cmd cmds; - int64 types; + uintptr types; Heap_EnumProc enumPtrs; int64 reserved1, reserved2; } Heap_ModuleDesc; export SYSTEM_PTR Heap_modules; -static int64 Heap_freeList[10]; -static int64 Heap_bigBlocks; +static uintptr Heap_freeList[10]; +static uintptr Heap_bigBlocks; export uintptr Heap_allocated; static BOOLEAN Heap_firstTry; static uintptr Heap_heap, Heap_heapend; @@ -76,18 +76,18 @@ export LONGINT *Heap_FinDesc__typ; export LONGINT *Heap__1__typ; static void Heap_CheckFin (void); -static void Heap_ExtendHeap (int64 blksz); +static void Heap_ExtendHeap (uintptr blksz); export void Heap_FINALL (void); static void Heap_Finalize (void); export void Heap_GC (BOOLEAN markStack); -static void Heap_HeapSort (int64 n, int64 *a, LONGINT a__len); +static void Heap_HeapSort (uintptr n, uintptr *a, LONGINT a__len); export void Heap_INCREF (Heap_Module m); export void Heap_InitHeap (void); export void Heap_Lock (void); -static void Heap_Mark (int64 q); -static void Heap_MarkCandidates (int64 n, int64 *cand, LONGINT cand__len); +static void Heap_Mark (uintptr q); +static void Heap_MarkCandidates (uintptr n, uintptr *cand, LONGINT cand__len); static void Heap_MarkP (SYSTEM_PTR p); -static void Heap_MarkStack (int64 n, int64 *cand, LONGINT cand__len); +static void Heap_MarkStack (uintptr n, uintptr *cand, LONGINT cand__len); export SYSTEM_PTR Heap_NEWBLK (uintptr size); export SYSTEM_PTR Heap_NEWREC (uintptr tag); static uintptr Heap_NewChunk (uintptr blksz); @@ -96,11 +96,11 @@ export SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); export void Heap_REGTYP (Heap_Module m, uintptr typ); export void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); static void Heap_Scan (void); -static void Heap_Sift (int64 l, int64 r, int64 *a, LONGINT a__len); +static void Heap_Sift (uintptr l, uintptr r, uintptr *a, LONGINT a__len); export void Heap_Unlock (void); extern void *Heap__init(); -extern LONGINT Platform_MainStackFrame; +extern uintptr Platform_MainStackFrame; extern uintptr Platform_OSAllocate(uintptr size); #define Heap_FetchAddress(pointer) (uintptr)(*((void**)((uintptr)pointer))) #define Heap_HeapModuleInit() Heap__init() @@ -157,7 +157,7 @@ void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) void Heap_REGTYP (Heap_Module m, uintptr typ) { - __PUT(typ, m->types, int64); + __PUT(typ, m->types, uintptr); m->types = typ; } @@ -175,8 +175,8 @@ static uintptr Heap_NewChunk (uintptr blksz) __PUT(chnk + 8, chnk + (24 + blksz), uintptr); __PUT(chnk + 24, chnk + 32, uintptr); __PUT(chnk + 32, blksz, uintptr); - __PUT(chnk + 40, -8, int64); - __PUT(chnk + 48, Heap_bigBlocks, int64); + __PUT(chnk + 40, -8, uintptr); + __PUT(chnk + 48, Heap_bigBlocks, uintptr); Heap_bigBlocks = chnk + 24; Heap_heapsize += blksz; } @@ -184,9 +184,9 @@ static uintptr Heap_NewChunk (uintptr blksz) return _o_result; } -static void Heap_ExtendHeap (int64 blksz) +static void Heap_ExtendHeap (uintptr blksz) { - int64 size, chnk, j, next; + uintptr size, chnk, j, next; if (blksz > 320000) { size = blksz; } else { @@ -204,8 +204,8 @@ static void Heap_ExtendHeap (int64 blksz) j = next; next = Heap_FetchAddress(j); } - __PUT(chnk, next, int64); - __PUT(j, chnk, int64); + __PUT(chnk, next, uintptr); + __PUT(j, chnk, uintptr); } if (next == 0) { Heap_heapend = Heap_FetchAddress(chnk + 8); @@ -237,10 +237,10 @@ SYSTEM_PTR Heap_NEWREC (uintptr tag) restsize = __ASHL(di, 5); end = adr + restsize; __PUT(end + 8, blksz, uintptr); - __PUT(end + 16, -8, int64); - __PUT(end, end + 8, int64); + __PUT(end + 16, -8, uintptr); + __PUT(end, end + 8, uintptr); __PUT(adr + 8, restsize, uintptr); - __PUT(adr + 24, Heap_freeList[di], int64); + __PUT(adr + 24, Heap_freeList[di], uintptr); Heap_freeList[di] = adr; adr += restsize; } @@ -281,8 +281,8 @@ SYSTEM_PTR Heap_NEWREC (uintptr tag) restsize = t - blksz; end = adr + restsize; __PUT(end + 8, blksz, uintptr); - __PUT(end + 16, -8, int64); - __PUT(end, end + 8, int64); + __PUT(end + 16, -8, uintptr); + __PUT(end, end + 8, uintptr); if (restsize > 288) { __PUT(adr + 8, restsize, uintptr); } else { @@ -295,7 +295,7 @@ SYSTEM_PTR Heap_NEWREC (uintptr tag) if (restsize > 0) { di = __ASHR(restsize, 5); __PUT(adr + 8, restsize, uintptr); - __PUT(adr + 24, Heap_freeList[di], int64); + __PUT(adr + 24, Heap_freeList[di], uintptr); Heap_freeList[di] = adr; } } @@ -304,16 +304,16 @@ SYSTEM_PTR Heap_NEWREC (uintptr tag) i = adr + 32; end = adr + blksz; while (i < end) { - __PUT(i, 0, int64); - __PUT(i + 8, 0, int64); - __PUT(i + 16, 0, int64); - __PUT(i + 24, 0, int64); + __PUT(i, 0, uintptr); + __PUT(i + 8, 0, uintptr); + __PUT(i + 16, 0, uintptr); + __PUT(i + 24, 0, uintptr); i += 32; } - __PUT(adr + 24, 0, int64); + __PUT(adr + 24, 0, uintptr); __PUT(adr, tag, uintptr); - __PUT(adr + 8, 0, int64); - __PUT(adr + 16, 0, int64); + __PUT(adr + 8, 0, uintptr); + __PUT(adr + 16, 0, uintptr); Heap_allocated += blksz; Heap_Unlock(); _o_result = (SYSTEM_PTR)(uintptr)(adr + 8); @@ -328,29 +328,29 @@ SYSTEM_PTR Heap_NEWBLK (uintptr size) Heap_Lock(); blksz = __ASHL(__ASHR(size + 63, 5), 5); new = Heap_NEWREC((uintptr)&blksz); - tag = (((int64)(uintptr)new) + blksz) - 24; - __PUT(tag - 8, 0, int64); + tag = ((uintptr)(uintptr)new + blksz) - 24; + __PUT(tag - 8, 0, uintptr); __PUT(tag, blksz, uintptr); - __PUT(tag + 8, -8, int64); - __PUT((int64)(uintptr)new - 8, tag, uintptr); + __PUT(tag + 8, -8, uintptr); + __PUT((uintptr)(uintptr)new - 8, tag, uintptr); Heap_Unlock(); _o_result = new; return _o_result; } -static void Heap_Mark (int64 q) +static void Heap_Mark (uintptr q) { - int64 p, tag, fld, n, offset, tagbits; + uintptr p, tag, offset, fld, n, tagbits; if (q != 0) { tagbits = Heap_FetchAddress(q - 8); if (!__ODD(tagbits)) { - __PUT(q - 8, tagbits + 1, int64); + __PUT(q - 8, tagbits + 1, uintptr); p = 0; tag = tagbits + 8; for (;;) { - __GET(tag, offset, int64); - if (offset < 0) { - __PUT(q - 8, (tag + offset) + 1, int64); + __GET(tag, offset, uintptr); + if (__BIT((uintptr)&offset, 63)) { + __PUT(q - 8, (tag + offset) + 1, uintptr); if (p == 0) { break; } @@ -358,7 +358,7 @@ static void Heap_Mark (int64 q) q = p; tag = Heap_FetchAddress(q - 8); tag -= 1; - __GET(tag, offset, int64); + __GET(tag, offset, uintptr); fld = q + offset; p = Heap_FetchAddress(fld); __PUT(fld, (SYSTEM_PTR)(uintptr)n, SYSTEM_PTR); @@ -368,8 +368,8 @@ static void Heap_Mark (int64 q) if (n != 0) { tagbits = Heap_FetchAddress(n - 8); if (!__ODD(tagbits)) { - __PUT(n - 8, tagbits + 1, int64); - __PUT(q - 8, tag + 1, int64); + __PUT(n - 8, tagbits + 1, uintptr); + __PUT(q - 8, tag + 1, uintptr); __PUT(fld, (SYSTEM_PTR)(uintptr)p, SYSTEM_PTR); p = q; q = n; @@ -385,7 +385,7 @@ static void Heap_Mark (int64 q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((int64)(uintptr)p); + Heap_Mark((uintptr)(uintptr)p); } static void Heap_Scan (void) @@ -410,14 +410,14 @@ static void Heap_Scan (void) start = adr - freesize; __PUT(start, start + 8, uintptr); __PUT(start + 8, freesize, uintptr); - __PUT(start + 16, -8, int64); + __PUT(start + 16, -8, uintptr); i = __ASHR(freesize, 5); freesize = 0; if (i < 9) { - __PUT(start + 24, Heap_freeList[i], int64); + __PUT(start + 24, Heap_freeList[i], uintptr); Heap_freeList[i] = start; } else { - __PUT(start + 24, Heap_bigBlocks, int64); + __PUT(start + 24, Heap_bigBlocks, uintptr); Heap_bigBlocks = start; } } @@ -436,14 +436,14 @@ static void Heap_Scan (void) start = adr - freesize; __PUT(start, start + 8, uintptr); __PUT(start + 8, freesize, uintptr); - __PUT(start + 16, -8, int64); + __PUT(start + 16, -8, uintptr); i = __ASHR(freesize, 5); freesize = 0; if (i < 9) { - __PUT(start + 24, Heap_freeList[i], int64); + __PUT(start + 24, Heap_freeList[i], uintptr); Heap_freeList[i] = start; } else { - __PUT(start + 24, Heap_bigBlocks, int64); + __PUT(start + 24, Heap_bigBlocks, uintptr); Heap_bigBlocks = start; } } @@ -451,9 +451,9 @@ static void Heap_Scan (void) } } -static void Heap_Sift (int64 l, int64 r, int64 *a, LONGINT a__len) +static void Heap_Sift (uintptr l, uintptr r, uintptr *a, LONGINT a__len) { - int64 i, j, x; + uintptr i, j, x; j = l; x = a[j]; for (;;) { @@ -470,9 +470,9 @@ static void Heap_Sift (int64 l, int64 r, int64 *a, LONGINT a__len) a[i] = x; } -static void Heap_HeapSort (int64 n, int64 *a, LONGINT a__len) +static void Heap_HeapSort (uintptr n, uintptr *a, LONGINT a__len) { - int64 l, r, x; + uintptr l, r, x; l = __ASHR(n, 1); r = n - 1; while (l > 0) { @@ -488,9 +488,9 @@ static void Heap_HeapSort (int64 n, int64 *a, LONGINT a__len) } } -static void Heap_MarkCandidates (int64 n, int64 *cand, LONGINT cand__len) +static void Heap_MarkCandidates (uintptr n, uintptr *cand, LONGINT cand__len) { - int64 chnk, adr, tag, next, lim, lim1, i, ptr, size; + uintptr chnk, adr, tag, next, lim, lim1, i, ptr, size; chnk = Heap_heap; i = 0; lim = cand[n - 1]; @@ -528,7 +528,7 @@ static void Heap_MarkCandidates (int64 n, int64 *cand, LONGINT cand__len) static void Heap_CheckFin (void) { Heap_FinNode n; - int64 tag; + uintptr tag; n = Heap_fin; while (n != NIL) { tag = Heap_FetchAddress(n->obj - 8); @@ -577,10 +577,10 @@ void Heap_FINALL (void) } } -static void Heap_MarkStack (int64 n, int64 *cand, LONGINT cand__len) +static void Heap_MarkStack (uintptr n, uintptr *cand, LONGINT cand__len) { SYSTEM_PTR frame; - int64 inc, nofcand, sp, p, stack0; + uintptr inc, nofcand, sp, p, stack0; struct Heap__1 align; if (n > 0) { Heap_MarkStack(n - 1, cand, cand__len); @@ -597,7 +597,7 @@ static void Heap_MarkStack (int64 n, int64 *cand, LONGINT cand__len) inc = -inc; } while (sp != stack0) { - __GET(sp, p, int64); + __GET(sp, p, uintptr); if ((p > Heap_heap && p < Heap_heapend)) { if (nofcand == cand__len) { Heap_HeapSort(nofcand, (void*)cand, cand__len); @@ -619,8 +619,8 @@ static void Heap_MarkStack (int64 n, int64 *cand, LONGINT cand__len) void Heap_GC (BOOLEAN markStack) { Heap_Module m; - int64 i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; - int64 cand[10000]; + uintptr i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; + uintptr cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); m = (Heap_Module)(uintptr)Heap_modules; @@ -700,7 +700,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (int64)(uintptr)obj; + f->obj = (uintptr)(uintptr)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; @@ -711,7 +711,7 @@ void Heap_InitHeap (void) { Heap_heap = Heap_NewChunk(256000); Heap_heapend = Heap_FetchAddress(Heap_heap + 8); - __PUT(Heap_heap, 0, int64); + __PUT(Heap_heap, 0, uintptr); Heap_allocated = 0; Heap_firstTry = 1; Heap_freeList[9] = 1; diff --git a/src/system/Heap.Mod b/src/system/Heap.Mod index 11723ec5..926fdaab 100644 --- a/src/system/Heap.Mod +++ b/src/system/Heap.Mod @@ -6,30 +6,30 @@ MODULE Heap; CONST ModNameLen = 20; CmdNameLen = 24; - SZL = SIZE(LONGINT); - Unit = 4*SZL; (* smallest possible heap block *) - nofLists = 9; (* number of free_lists *) - heapSize0 = 8000*Unit; (* startup heap size *) + SZA = SIZE(SYSTEM.UINTPTR); (* Size of address *) + Unit = 4*SZA; (* smallest possible heap block *) + nofLists = 9; (* number of free_lists *) + heapSize0 = 8000*Unit; (* startup heap size *) (* all blocks look the same: free blocks describe themselves: size = Unit tag = &tag++ ->block size - sentinel = -SZL + sentinel = -SZA next *) (* heap chunks *) nextChnkOff = SYSTEM.VAL(SYSTEM.UINTPTR, 0); (* next heap chunk, sorted ascendingly! *) - endOff = SYSTEM.VAL(SYSTEM.UINTPTR, SZL); (* end of heap chunk *) - blkOff = SYSTEM.VAL(SYSTEM.UINTPTR, 3*SZL); (* first block in a chunk *) + endOff = SYSTEM.VAL(SYSTEM.UINTPTR, SZA); (* end of heap chunk *) + blkOff = SYSTEM.VAL(SYSTEM.UINTPTR, 3*SZA); (* first block in a chunk *) (* heap blocks *) tagOff = SYSTEM.VAL(SYSTEM.UINTPTR, 0); (* block starts with tag *) - sizeOff = SYSTEM.VAL(SYSTEM.UINTPTR, SZL); (* block size in free block relative to block start *) - sntlOff = SYSTEM.VAL(SYSTEM.UINTPTR, 2*SZL); (* pointer offset table sentinel in free block relative to block start *) - nextOff = SYSTEM.VAL(SYSTEM.UINTPTR, 3*SZL); (* next pointer in free block relative to block start *) - NoPtrSntl = SYSTEM.VAL(SYSTEM.UINTPTR, -SZL); + sizeOff = SYSTEM.VAL(SYSTEM.UINTPTR, SZA); (* block size in free block relative to block start *) + sntlOff = SYSTEM.VAL(SYSTEM.UINTPTR, 2*SZA); (* pointer offset table sentinel in free block relative to block start *) + nextOff = SYSTEM.VAL(SYSTEM.UINTPTR, 3*SZA); (* next pointer in free block relative to block start *) + NoPtrSntl = SYSTEM.VAL(SYSTEM.UINTPTR, -SZA); AddressZero = SYSTEM.VAL(SYSTEM.UINTPTR, 0); TYPE @@ -46,7 +46,7 @@ MODULE Heap; name: ModuleName; refcnt: LONGINT; cmds: Cmd; - types: LONGINT; + types: SYSTEM.UINTPTR; enumPtrs: EnumProc; reserved1, reserved2: LONGINT END ; @@ -73,8 +73,8 @@ MODULE Heap; (* the list of loaded (=initialization started) modules *) modules*: SYSTEM.PTR; - freeList: ARRAY nofLists + 1 OF LONGINT; (* dummy, 16, 32, 48, 64, 80, 96, 112, 128, sentinel *) - bigBlocks: LONGINT; + freeList: ARRAY nofLists + 1 OF SYSTEM.UINTPTR; (* dummy, 16, 32, 48, 64, 80, 96, 112, 128, sentinel *) + bigBlocks: SYSTEM.UINTPTR; allocated*: SYSTEM.UINTPTR; firstTry: BOOLEAN; @@ -193,8 +193,8 @@ MODULE Heap; *) PROCEDURE -FetchAddress(pointer: SYSTEM.UINTPTR): SYSTEM.UINTPTR "(uintptr)(*((void**)((uintptr)pointer)))"; - PROCEDURE ExtendHeap(blksz: LONGINT); - VAR size, chnk, j, next: LONGINT; + PROCEDURE ExtendHeap(blksz: SYSTEM.UINTPTR); + VAR size, chnk, j, next: SYSTEM.UINTPTR; BEGIN IF blksz > 10000*Unit THEN size := blksz ELSE size := 10000*Unit (* additional heuristics *) @@ -293,13 +293,13 @@ MODULE Heap; END ; INC(adr, restsize) END ; - i := adr + 4*SZL; end := adr + blksz; + i := adr + 4*SZA; end := adr + blksz; WHILE i < end DO (*deliberately unrolled*) SYSTEM.PUT(i, AddressZero); - SYSTEM.PUT(i + SZL, AddressZero); - SYSTEM.PUT(i + 2*SZL, AddressZero); - SYSTEM.PUT(i + 3*SZL, AddressZero); - INC(i, 4*SZL) + SYSTEM.PUT(i + SZA, AddressZero); + SYSTEM.PUT(i + 2*SZA, AddressZero); + SYSTEM.PUT(i + 3*SZA, AddressZero); + INC(i, 4*SZA) END ; SYSTEM.PUT(adr + nextOff, AddressZero); SYSTEM.PUT(adr, tag); @@ -307,57 +307,58 @@ MODULE Heap; SYSTEM.PUT(adr + sntlOff, AddressZero); INC(allocated, blksz); Unlock(); - RETURN SYSTEM.VAL(SYSTEM.PTR, adr + SZL) + RETURN SYSTEM.VAL(SYSTEM.PTR, adr + SZA) END NEWREC; PROCEDURE NEWBLK*(size: SYSTEM.UINTPTR): SYSTEM.PTR; VAR blksz, tag: SYSTEM.UINTPTR; new: SYSTEM.PTR; BEGIN Lock(); - blksz := (size + (4*SZL + Unit - 1)) DIV Unit * Unit; (*size + tag + meta + blksz + sntnl + UnitAlignment*) + blksz := (size + (4*SZA + Unit - 1)) DIV Unit * Unit; (*size + tag + meta + blksz + sntnl + UnitAlignment*) new := NEWREC(SYSTEM.ADR(blksz)); - tag := SYSTEM.VAL(LONGINT, new) + blksz - 3*SZL; - SYSTEM.PUT(tag - SZL, AddressZero); (*reserved for meta info*) + tag := SYSTEM.VAL(SYSTEM.UINTPTR, new) + blksz - 3*SZA; + SYSTEM.PUT(tag - SZA, AddressZero); (*reserved for meta info*) SYSTEM.PUT(tag, blksz); - SYSTEM.PUT(tag + SZL, NoPtrSntl); - SYSTEM.PUT(SYSTEM.VAL(LONGINT, new) - SZL, tag); + SYSTEM.PUT(tag + SZA, NoPtrSntl); + SYSTEM.PUT(SYSTEM.VAL(SYSTEM.UINTPTR, new) - SZA, tag); Unlock(); RETURN new END NEWBLK; - PROCEDURE Mark(q: LONGINT); - VAR p, tag, fld, n, offset, tagbits: LONGINT; + PROCEDURE Mark(q: SYSTEM.UINTPTR); + VAR p, tag, offset, fld, n, tagbits: SYSTEM.UINTPTR; BEGIN IF q # 0 THEN - tagbits := FetchAddress(q - SZL); (* Load the tag for the record at q *) + tagbits := FetchAddress(q - SZA); (* Load the tag for the record at q *) IF ~ODD(tagbits) THEN (* If it has not already been marked *) - SYSTEM.PUT(q - SZL, tagbits + 1); (* Mark it *) + SYSTEM.PUT(q - SZA, tagbits + 1); (* Mark it *) p := 0; - tag := tagbits + SZL; (* Tag addresses first offset *) + tag := tagbits + SZA; (* Tag addresses first offset *) LOOP SYSTEM.GET(tag, offset); (* Get next ptr field offset *) - IF offset < 0 THEN (* If sentinel. (Value is -8*(#fields+1) *) - SYSTEM.PUT(q - SZL, tag + offset + 1); (* Rotate base ptr into tag *) + IF SYSTEM.BIT(SYSTEM.ADR(offset), SIZE(SYSTEM.UINTPTR)*8 - 1) THEN + (* Sentinel reached: Value is -8*(#fields+1) *) + SYSTEM.PUT(q - SZA, tag + offset + 1); (* Rotate base ptr into tag *) IF p = 0 THEN EXIT END ; n := q; q := p; - tag := FetchAddress(q - SZL); DEC(tag, 1); + tag := FetchAddress(q - SZA); DEC(tag, 1); SYSTEM.GET(tag, offset); fld := q + offset; p := FetchAddress(fld); SYSTEM.PUT(fld, SYSTEM.VAL(SYSTEM.PTR, n)) ELSE (* offset references a ptr field *) fld := q + offset; (* Address the pointer *) n := FetchAddress(fld); (* Load the pointer *) IF n # 0 THEN (* If pointer is not NIL *) - tagbits := FetchAddress(n - SZL); (* Consider record pointed to by this field *) + tagbits := FetchAddress(n - SZA); (* Consider record pointed to by this field *) IF ~ODD(tagbits) THEN - SYSTEM.PUT(n - SZL, tagbits + 1); - SYSTEM.PUT(q - SZL, tag + 1); + SYSTEM.PUT(n - SZA, tagbits + 1); + SYSTEM.PUT(q - SZA, tag + 1); SYSTEM.PUT(fld, SYSTEM.VAL(SYSTEM.PTR, p)); p := q; q := n; tag := tagbits END END END ; - INC(tag, SZL) + INC(tag, SZA) END END END @@ -365,7 +366,7 @@ MODULE Heap; PROCEDURE MarkP(p: SYSTEM.PTR); (* for compatibility with EnumPtrs in ANSI mode *) BEGIN - Mark(SYSTEM.VAL(LONGINT, p)) + Mark(SYSTEM.VAL(SYSTEM.UINTPTR, p)) END MarkP; PROCEDURE Scan; @@ -381,7 +382,7 @@ MODULE Heap; IF ODD(tag) THEN (*marked*) IF freesize > 0 THEN start := adr - freesize; - SYSTEM.PUT(start, start+SZL); + SYSTEM.PUT(start, start+SZA); SYSTEM.PUT(start+sizeOff, freesize); SYSTEM.PUT(start+sntlOff, NoPtrSntl); i := freesize DIV Unit; freesize := 0; @@ -402,7 +403,7 @@ MODULE Heap; END ; IF freesize > 0 THEN (*collect last block*) start := adr - freesize; - SYSTEM.PUT(start, start+SZL); + SYSTEM.PUT(start, start+SZA); SYSTEM.PUT(start+sizeOff, freesize); SYSTEM.PUT(start+sntlOff, NoPtrSntl); i := freesize DIV Unit; freesize := 0; @@ -414,8 +415,8 @@ MODULE Heap; END END Scan; - PROCEDURE Sift (l, r: LONGINT; VAR a: ARRAY OF LONGINT); - VAR i, j, x: LONGINT; + PROCEDURE Sift (l, r: SYSTEM.UINTPTR; VAR a: ARRAY OF SYSTEM.UINTPTR); + VAR i, j, x: SYSTEM.UINTPTR; BEGIN j := l; x := a[j]; LOOP i := j; j := 2*j + 1; IF (j < r) & (a[j] < a[j+1]) THEN INC(j) END; @@ -425,15 +426,15 @@ MODULE Heap; a[i] := x END Sift; - PROCEDURE HeapSort (n: LONGINT; VAR a: ARRAY OF LONGINT); - VAR l, r, x: LONGINT; + PROCEDURE HeapSort (n: SYSTEM.UINTPTR; VAR a: ARRAY OF SYSTEM.UINTPTR); + VAR l, r, x: SYSTEM.UINTPTR; BEGIN l := n DIV 2; r := n - 1; WHILE l > 0 DO DEC(l); Sift(l, r, a) END; WHILE r > 0 DO x := a[0]; a[0] := a[r]; a[r] := x; DEC(r); Sift(l, r, a) END END HeapSort; - PROCEDURE MarkCandidates(n: LONGINT; VAR cand: ARRAY OF LONGINT); - VAR chnk, adr, tag, next, lim, lim1, i, ptr, size: LONGINT; + PROCEDURE MarkCandidates(n: SYSTEM.UINTPTR; VAR cand: ARRAY OF SYSTEM.UINTPTR); + VAR chnk, adr, tag, next, lim, lim1, i, ptr, size: SYSTEM.UINTPTR; BEGIN chnk := heap; i := 0; lim := cand[n-1]; WHILE (chnk # 0 ) & (chnk < lim) DO @@ -446,7 +447,7 @@ MODULE Heap; size := FetchAddress(tag-1); INC(adr, size) ELSE size := FetchAddress(tag); - ptr := adr + SZL; + ptr := adr + SZA; WHILE cand[i] < ptr DO INC(i) END ; IF i = n THEN RETURN END ; next := adr + size; @@ -459,11 +460,11 @@ MODULE Heap; END MarkCandidates; PROCEDURE CheckFin; - VAR n: FinNode; tag: LONGINT; + VAR n: FinNode; tag: SYSTEM.UINTPTR; BEGIN n := fin; WHILE n # NIL DO - tag := FetchAddress(n.obj - SZL); + tag := FetchAddress(n.obj - SZA); IF ~ODD(tag) THEN n.marked := FALSE; Mark(n.obj) ELSE n.marked := TRUE END ; @@ -495,14 +496,14 @@ MODULE Heap; END END FINALL; - PROCEDURE -ExternMainStackFrame "extern LONGINT Platform_MainStackFrame;"; - PROCEDURE -PlatformMainStackFrame(): LONGINT "Platform_MainStackFrame"; + PROCEDURE -ExternMainStackFrame "extern uintptr Platform_MainStackFrame;"; + PROCEDURE -PlatformMainStackFrame(): SYSTEM.UINTPTR "Platform_MainStackFrame"; - PROCEDURE MarkStack(n: LONGINT; VAR cand: ARRAY OF LONGINT); + PROCEDURE MarkStack(n: SYSTEM.UINTPTR; VAR cand: ARRAY OF SYSTEM.UINTPTR); VAR frame: SYSTEM.PTR; - inc, nofcand: LONGINT; - sp, p, stack0: LONGINT; + inc, nofcand: SYSTEM.UINTPTR; + sp, p, stack0: SYSTEM.UINTPTR; align: RECORD ch: CHAR; p: SYSTEM.PTR END ; BEGIN IF n > 0 THEN MarkStack(n-1, cand); (* flush register windows by means of recursive calls *) @@ -529,8 +530,8 @@ MODULE Heap; PROCEDURE GC*(markStack: BOOLEAN); VAR m: Module; - i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23: LONGINT; - cand: ARRAY 10000 OF LONGINT; + i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23: SYSTEM.UINTPTR; + cand: ARRAY 10000 OF SYSTEM.UINTPTR; BEGIN IF (lockdepth = 0) OR (lockdepth = 1) & ~markStack THEN Lock(); @@ -565,7 +566,7 @@ MODULE Heap; PROCEDURE RegisterFinalizer*(obj: SYSTEM.PTR; finalize: Finalizer); VAR f: FinNode; BEGIN NEW(f); - f.obj := SYSTEM.VAL(LONGINT, obj); f.finalize := finalize; f.marked := TRUE; + f.obj := SYSTEM.VAL(SYSTEM.UINTPTR, obj); f.finalize := finalize; f.marked := TRUE; f.next := fin; fin := f; END RegisterFinalizer; From 90737e5677fc54c93c12937915b1d0964680495f Mon Sep 17 00:00:00 2001 From: David Brown Date: Sat, 3 Sep 2016 23:28:50 +0100 Subject: [PATCH 215/580] Remove obsolete SYSTEM.ADRINT. (Not that I much like uintptr). --- bootstrap/unix-44/OPC.c | 2 +- bootstrap/unix-44/OPT.c | 4 +--- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 1 - bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/SYSTEM.h | 2 +- bootstrap/unix-48/OPC.c | 2 +- bootstrap/unix-48/OPT.c | 4 +--- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 1 - bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/SYSTEM.h | 2 +- bootstrap/unix-88/OPC.c | 2 +- bootstrap/unix-88/OPT.c | 4 +--- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 1 - bootstrap/unix-88/SYSTEM.h | 2 +- bootstrap/windows-48/OPC.c | 2 +- bootstrap/windows-48/OPT.c | 4 +--- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 1 - bootstrap/windows-48/SYSTEM.h | 2 +- bootstrap/windows-88/OPC.c | 2 +- bootstrap/windows-88/OPT.c | 4 +--- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 1 - bootstrap/windows-88/SYSTEM.h | 2 +- src/compiler/OPC.Mod | 6 ++---- src/compiler/OPT.Mod | 3 +-- src/compiler/OPV.Mod | 1 - src/system/Heap.Mod | 4 ++-- src/system/Platformunix.Mod | 4 ++-- src/system/SYSTEM.h | 2 +- 33 files changed, 30 insertions(+), 49 deletions(-) diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 10b51482..8949813a 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -200,7 +200,7 @@ void OPC_Ident (OPT_Object obj) } } } else if ((mode == 5 && obj->typ->form == 4)) { - if (obj->typ == OPT_pinttyp || obj->typ == OPT_ainttyp) { + if (obj->typ == OPT_pinttyp) { OPM_WriteString((CHAR*)"uintptr", 8); } else { OPM_WriteString((CHAR*)"int", 4); diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index 32d09e08..f151a183 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -83,7 +83,7 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; -export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_pinttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_pinttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; export int8 OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; @@ -1768,7 +1768,6 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_inttyp); P(OPT_linttyp); P(OPT_pinttyp); - P(OPT_ainttyp); P(OPT_int8typ); P(OPT_int16typ); P(OPT_int32typ); @@ -1851,7 +1850,6 @@ export void *OPT__init(void) OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp); OPT_EnterTyp((CHAR*)"PTR", 11, OPM_PointerSize, &OPT_sysptrtyp); OPT_EnterTyp((CHAR*)"UINTPTR", 4, OPM_PointerSize, &OPT_pinttyp); - OPT_EnterTyp((CHAR*)"ADRINT", 4, OPM_PointerSize, &OPT_ainttyp); OPT_EnterTyp((CHAR*)"INT8", 4, 1, &OPT_int8typ); OPT_EnterTyp((CHAR*)"INT16", 4, 2, &OPT_int16typ); OPT_EnterTyp((CHAR*)"INT32", 4, 4, &OPT_int32typ); diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index b12f68e2..41a1b2e4 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -67,7 +67,7 @@ typedef import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; -import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_pinttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_pinttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; import int8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index 7a155032..4272132e 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -286,7 +286,6 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_inttyp->strobj->linkadr = 2; OPT_linttyp->strobj->linkadr = 2; OPT_pinttyp->strobj->linkadr = 2; - OPT_ainttyp->strobj->linkadr = 2; OPT_int8typ->strobj->linkadr = 2; OPT_int16typ->strobj->linkadr = 2; OPT_int32typ->strobj->linkadr = 2; diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 5b3bea8f..f7f6f6b6 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -263,7 +263,7 @@ void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { - av = __VAL(Platform_ArgVec, Platform_ArgVector); + av = (Platform_ArgVec)(uintptr)Platform_ArgVector; __COPY(*(*av)[__X(n, 1024)], val, val__len); } } diff --git a/bootstrap/unix-44/SYSTEM.h b/bootstrap/unix-44/SYSTEM.h index 2622657f..e7b38a26 100644 --- a/bootstrap/unix-44/SYSTEM.h +++ b/bootstrap/unix-44/SYSTEM.h @@ -67,7 +67,7 @@ typedef float REAL; typedef double LONGREAL; typedef void* SYSTEM_PTR; -typedef uintptr SYSTEM_ADRINT; + // For 32 bit builds, the size of LONGINT depends on a make option: diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 10b51482..8949813a 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -200,7 +200,7 @@ void OPC_Ident (OPT_Object obj) } } } else if ((mode == 5 && obj->typ->form == 4)) { - if (obj->typ == OPT_pinttyp || obj->typ == OPT_ainttyp) { + if (obj->typ == OPT_pinttyp) { OPM_WriteString((CHAR*)"uintptr", 8); } else { OPM_WriteString((CHAR*)"int", 4); diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 32d09e08..f151a183 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -83,7 +83,7 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; -export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_pinttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_pinttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; export int8 OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; @@ -1768,7 +1768,6 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_inttyp); P(OPT_linttyp); P(OPT_pinttyp); - P(OPT_ainttyp); P(OPT_int8typ); P(OPT_int16typ); P(OPT_int32typ); @@ -1851,7 +1850,6 @@ export void *OPT__init(void) OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp); OPT_EnterTyp((CHAR*)"PTR", 11, OPM_PointerSize, &OPT_sysptrtyp); OPT_EnterTyp((CHAR*)"UINTPTR", 4, OPM_PointerSize, &OPT_pinttyp); - OPT_EnterTyp((CHAR*)"ADRINT", 4, OPM_PointerSize, &OPT_ainttyp); OPT_EnterTyp((CHAR*)"INT8", 4, 1, &OPT_int8typ); OPT_EnterTyp((CHAR*)"INT16", 4, 2, &OPT_int16typ); OPT_EnterTyp((CHAR*)"INT32", 4, 4, &OPT_int32typ); diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index b12f68e2..41a1b2e4 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -67,7 +67,7 @@ typedef import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; -import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_pinttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_pinttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; import int8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index 7a155032..4272132e 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -286,7 +286,6 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_inttyp->strobj->linkadr = 2; OPT_linttyp->strobj->linkadr = 2; OPT_pinttyp->strobj->linkadr = 2; - OPT_ainttyp->strobj->linkadr = 2; OPT_int8typ->strobj->linkadr = 2; OPT_int16typ->strobj->linkadr = 2; OPT_int32typ->strobj->linkadr = 2; diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 5b3bea8f..f7f6f6b6 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -263,7 +263,7 @@ void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { - av = __VAL(Platform_ArgVec, Platform_ArgVector); + av = (Platform_ArgVec)(uintptr)Platform_ArgVector; __COPY(*(*av)[__X(n, 1024)], val, val__len); } } diff --git a/bootstrap/unix-48/SYSTEM.h b/bootstrap/unix-48/SYSTEM.h index 2622657f..e7b38a26 100644 --- a/bootstrap/unix-48/SYSTEM.h +++ b/bootstrap/unix-48/SYSTEM.h @@ -67,7 +67,7 @@ typedef float REAL; typedef double LONGREAL; typedef void* SYSTEM_PTR; -typedef uintptr SYSTEM_ADRINT; + // For 32 bit builds, the size of LONGINT depends on a make option: diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index ee075a94..d4a0fc06 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -201,7 +201,7 @@ void OPC_Ident (OPT_Object obj) } } } else if ((mode == 5 && obj->typ->form == 4)) { - if (obj->typ == OPT_pinttyp || obj->typ == OPT_ainttyp) { + if (obj->typ == OPT_pinttyp) { OPM_WriteString((CHAR*)"uintptr", 8); } else { OPM_WriteString((CHAR*)"int", 4); diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index 94145f3d..d5057c1d 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -84,7 +84,7 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; -export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_pinttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_pinttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; export int8 OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; @@ -1769,7 +1769,6 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_inttyp); P(OPT_linttyp); P(OPT_pinttyp); - P(OPT_ainttyp); P(OPT_int8typ); P(OPT_int16typ); P(OPT_int32typ); @@ -1852,7 +1851,6 @@ export void *OPT__init(void) OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp); OPT_EnterTyp((CHAR*)"PTR", 11, OPM_PointerSize, &OPT_sysptrtyp); OPT_EnterTyp((CHAR*)"UINTPTR", 4, OPM_PointerSize, &OPT_pinttyp); - OPT_EnterTyp((CHAR*)"ADRINT", 4, OPM_PointerSize, &OPT_ainttyp); OPT_EnterTyp((CHAR*)"INT8", 4, 1, &OPT_int8typ); OPT_EnterTyp((CHAR*)"INT16", 4, 2, &OPT_int16typ); OPT_EnterTyp((CHAR*)"INT32", 4, 4, &OPT_int32typ); diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index e2409b86..aefdfd2a 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -68,7 +68,7 @@ typedef import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; -import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_pinttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_pinttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; import int8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index a99c5bfe..7edc861b 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -287,7 +287,6 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_inttyp->strobj->linkadr = 2; OPT_linttyp->strobj->linkadr = 2; OPT_pinttyp->strobj->linkadr = 2; - OPT_ainttyp->strobj->linkadr = 2; OPT_int8typ->strobj->linkadr = 2; OPT_int16typ->strobj->linkadr = 2; OPT_int32typ->strobj->linkadr = 2; diff --git a/bootstrap/unix-88/SYSTEM.h b/bootstrap/unix-88/SYSTEM.h index 2622657f..e7b38a26 100644 --- a/bootstrap/unix-88/SYSTEM.h +++ b/bootstrap/unix-88/SYSTEM.h @@ -67,7 +67,7 @@ typedef float REAL; typedef double LONGREAL; typedef void* SYSTEM_PTR; -typedef uintptr SYSTEM_ADRINT; + // For 32 bit builds, the size of LONGINT depends on a make option: diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 10b51482..8949813a 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -200,7 +200,7 @@ void OPC_Ident (OPT_Object obj) } } } else if ((mode == 5 && obj->typ->form == 4)) { - if (obj->typ == OPT_pinttyp || obj->typ == OPT_ainttyp) { + if (obj->typ == OPT_pinttyp) { OPM_WriteString((CHAR*)"uintptr", 8); } else { OPM_WriteString((CHAR*)"int", 4); diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 32d09e08..f151a183 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -83,7 +83,7 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; -export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_pinttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_pinttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; export int8 OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; @@ -1768,7 +1768,6 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_inttyp); P(OPT_linttyp); P(OPT_pinttyp); - P(OPT_ainttyp); P(OPT_int8typ); P(OPT_int16typ); P(OPT_int32typ); @@ -1851,7 +1850,6 @@ export void *OPT__init(void) OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp); OPT_EnterTyp((CHAR*)"PTR", 11, OPM_PointerSize, &OPT_sysptrtyp); OPT_EnterTyp((CHAR*)"UINTPTR", 4, OPM_PointerSize, &OPT_pinttyp); - OPT_EnterTyp((CHAR*)"ADRINT", 4, OPM_PointerSize, &OPT_ainttyp); OPT_EnterTyp((CHAR*)"INT8", 4, 1, &OPT_int8typ); OPT_EnterTyp((CHAR*)"INT16", 4, 2, &OPT_int16typ); OPT_EnterTyp((CHAR*)"INT32", 4, 4, &OPT_int32typ); diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index b12f68e2..41a1b2e4 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -67,7 +67,7 @@ typedef import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; -import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_pinttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_pinttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; import int8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index 7a155032..4272132e 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -286,7 +286,6 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_inttyp->strobj->linkadr = 2; OPT_linttyp->strobj->linkadr = 2; OPT_pinttyp->strobj->linkadr = 2; - OPT_ainttyp->strobj->linkadr = 2; OPT_int8typ->strobj->linkadr = 2; OPT_int16typ->strobj->linkadr = 2; OPT_int32typ->strobj->linkadr = 2; diff --git a/bootstrap/windows-48/SYSTEM.h b/bootstrap/windows-48/SYSTEM.h index 2622657f..e7b38a26 100644 --- a/bootstrap/windows-48/SYSTEM.h +++ b/bootstrap/windows-48/SYSTEM.h @@ -67,7 +67,7 @@ typedef float REAL; typedef double LONGREAL; typedef void* SYSTEM_PTR; -typedef uintptr SYSTEM_ADRINT; + // For 32 bit builds, the size of LONGINT depends on a make option: diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index ee075a94..d4a0fc06 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -201,7 +201,7 @@ void OPC_Ident (OPT_Object obj) } } } else if ((mode == 5 && obj->typ->form == 4)) { - if (obj->typ == OPT_pinttyp || obj->typ == OPT_ainttyp) { + if (obj->typ == OPT_pinttyp) { OPM_WriteString((CHAR*)"uintptr", 8); } else { OPM_WriteString((CHAR*)"int", 4); diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index 94145f3d..d5057c1d 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -84,7 +84,7 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; -export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_pinttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_pinttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; export int8 OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; @@ -1769,7 +1769,6 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_inttyp); P(OPT_linttyp); P(OPT_pinttyp); - P(OPT_ainttyp); P(OPT_int8typ); P(OPT_int16typ); P(OPT_int32typ); @@ -1852,7 +1851,6 @@ export void *OPT__init(void) OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp); OPT_EnterTyp((CHAR*)"PTR", 11, OPM_PointerSize, &OPT_sysptrtyp); OPT_EnterTyp((CHAR*)"UINTPTR", 4, OPM_PointerSize, &OPT_pinttyp); - OPT_EnterTyp((CHAR*)"ADRINT", 4, OPM_PointerSize, &OPT_ainttyp); OPT_EnterTyp((CHAR*)"INT8", 4, 1, &OPT_int8typ); OPT_EnterTyp((CHAR*)"INT16", 4, 2, &OPT_int16typ); OPT_EnterTyp((CHAR*)"INT32", 4, 4, &OPT_int32typ); diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index e2409b86..aefdfd2a 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -68,7 +68,7 @@ typedef import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; -import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_pinttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_pinttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; import int8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index a99c5bfe..7edc861b 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -287,7 +287,6 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_inttyp->strobj->linkadr = 2; OPT_linttyp->strobj->linkadr = 2; OPT_pinttyp->strobj->linkadr = 2; - OPT_ainttyp->strobj->linkadr = 2; OPT_int8typ->strobj->linkadr = 2; OPT_int16typ->strobj->linkadr = 2; OPT_int32typ->strobj->linkadr = 2; diff --git a/bootstrap/windows-88/SYSTEM.h b/bootstrap/windows-88/SYSTEM.h index 2622657f..e7b38a26 100644 --- a/bootstrap/windows-88/SYSTEM.h +++ b/bootstrap/windows-88/SYSTEM.h @@ -67,7 +67,7 @@ typedef float REAL; typedef double LONGREAL; typedef void* SYSTEM_PTR; -typedef uintptr SYSTEM_ADRINT; + // For 32 bit builds, the size of LONGINT depends on a make option: diff --git a/src/compiler/OPC.Mod b/src/compiler/OPC.Mod index 5b4f9195..f8c71ee8 100644 --- a/src/compiler/OPC.Mod +++ b/src/compiler/OPC.Mod @@ -117,10 +117,8 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) IF keytab[hashtab[h]] = obj^.name THEN OPM.Write('_') END END ELSIF (mode = OPT.Typ) & (obj.typ.form = OPT.Int) THEN - IF (obj.typ = OPT.pinttyp) OR (obj.typ = OPT.ainttyp) THEN - OPM.WriteString("uintptr") - ELSE - OPM.WriteString("int"); OPM.WriteInt(obj.typ.size*8) + IF obj.typ = OPT.pinttyp THEN OPM.WriteString("uintptr") + ELSE OPM.WriteString("int"); OPM.WriteInt(obj.typ.size*8) END ELSE IF (mode # OPT.Typ) OR (obj^.linkadr # PredefinedType) THEN diff --git a/src/compiler/OPT.Mod b/src/compiler/OPT.Mod index 135d1016..19bfdb47 100644 --- a/src/compiler/OPT.Mod +++ b/src/compiler/OPT.Mod @@ -155,7 +155,7 @@ VAR undftyp*, bytetyp*, booltyp*, chartyp*, sinttyp*, inttyp*, linttyp*, - pinttyp*, ainttyp*, + pinttyp*, int8typ*, int16typ*, int32typ*, int64typ*, realtyp*, lrltyp*, settyp*, stringtyp*, niltyp*, notyp*, sysptrtyp*: Struct; @@ -1189,7 +1189,6 @@ BEGIN topScope := NIL; OpenScope(0, NIL); OPM.errpos := 0; EnterTyp("BYTE", Byte, OPM.ByteSize, bytetyp); EnterTyp("PTR", Pointer, OPM.PointerSize, sysptrtyp); EnterTyp("UINTPTR", Int, OPM.PointerSize, pinttyp); - EnterTyp("ADRINT", Int, OPM.PointerSize, ainttyp); (* Temporary for bootstrapping *) EnterTyp("INT8", Int, 1, int8typ); EnterTyp("INT16", Int, 2, int16typ); EnterTyp("INT32", Int, 4, int32typ); diff --git a/src/compiler/OPV.Mod b/src/compiler/OPV.Mod index cd387568..25cc2898 100644 --- a/src/compiler/OPV.Mod +++ b/src/compiler/OPV.Mod @@ -206,7 +206,6 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 OPT.inttyp^.strobj^.linkadr := PredefinedType; OPT.linttyp^.strobj^.linkadr := PredefinedType; OPT.pinttyp^.strobj^.linkadr := PredefinedType; - OPT.ainttyp^.strobj^.linkadr := PredefinedType; OPT.int8typ^.strobj^.linkadr := PredefinedType; OPT.int16typ^.strobj^.linkadr := PredefinedType; OPT.int32typ^.strobj^.linkadr := PredefinedType; diff --git a/src/system/Heap.Mod b/src/system/Heap.Mod index 926fdaab..00c106dd 100644 --- a/src/system/Heap.Mod +++ b/src/system/Heap.Mod @@ -187,10 +187,10 @@ MODULE Heap; architectures with 64 bit LONGINT, it loads 32 bits and extends it to LONGINT rather than loading 64 bits. - NOTE - with uintpr work complete this function should be replaces withSYSTEM.GET + NOTE - with uintpr work complete this function should be replaced with SYSTEM.GET as there will be no need to extend addresses to larger types. - *) + PROCEDURE -FetchAddress(pointer: SYSTEM.UINTPTR): SYSTEM.UINTPTR "(uintptr)(*((void**)((uintptr)pointer)))"; PROCEDURE ExtendHeap(blksz: SYSTEM.UINTPTR); diff --git a/src/system/Platformunix.Mod b/src/system/Platformunix.Mod index 76c0db89..f950f2a3 100644 --- a/src/system/Platformunix.Mod +++ b/src/system/Platformunix.Mod @@ -27,13 +27,13 @@ TYPE VAR LittleEndian-: BOOLEAN; - MainStackFrame-: SYSTEM.ADRINT; + MainStackFrame-: SYSTEM.UINTPTR; HaltCode-: LONGINT; PID-: INTEGER; (* Note: Must be updated by Fork implementation *) CWD-: ARRAY 256 OF CHAR; ArgCount-: INTEGER; - ArgVector-: SYSTEM.ADRINT; + ArgVector-: SYSTEM.UINTPTR; HaltHandler: HaltProcedure; TimeStart: LONGINT; diff --git a/src/system/SYSTEM.h b/src/system/SYSTEM.h index 2622657f..e7b38a26 100644 --- a/src/system/SYSTEM.h +++ b/src/system/SYSTEM.h @@ -67,7 +67,7 @@ typedef float REAL; typedef double LONGREAL; typedef void* SYSTEM_PTR; -typedef uintptr SYSTEM_ADRINT; + // For 32 bit builds, the size of LONGINT depends on a make option: From a865643d6cc68233d213258b90408d369efb6514 Mon Sep 17 00:00:00 2001 From: David Brown Date: Sun, 4 Sep 2016 14:34:24 +0100 Subject: [PATCH 216/580] Change of mind: s/uintptr/address/. Replace LONGINT with ADDRESS in Platform*. --- bootstrap/unix-44/Configuration.c | 4 +- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Console.c | 4 +- bootstrap/unix-44/Console.h | 2 +- bootstrap/unix-44/Files.c | 20 +-- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 222 +++++++++++++-------------- bootstrap/unix-44/Heap.h | 10 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 9 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 8 +- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 8 +- bootstrap/unix-44/OPT.h | 4 +- bootstrap/unix-44/OPV.c | 10 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Platform.c | 51 +++--- bootstrap/unix-44/Platform.h | 18 +-- bootstrap/unix-44/Reals.c | 14 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/SYSTEM.c | 14 +- bootstrap/unix-44/SYSTEM.h | 48 +++--- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/Vishap.c | 4 +- bootstrap/unix-44/errors.c | 2 +- bootstrap/unix-44/errors.h | 2 +- bootstrap/unix-44/extTools.c | 2 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-44/vt100.c | 2 +- bootstrap/unix-44/vt100.h | 2 +- bootstrap/unix-48/Configuration.c | 4 +- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Console.c | 4 +- bootstrap/unix-48/Console.h | 2 +- bootstrap/unix-48/Files.c | 20 +-- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 222 +++++++++++++-------------- bootstrap/unix-48/Heap.h | 10 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 9 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 8 +- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 8 +- bootstrap/unix-48/OPT.h | 4 +- bootstrap/unix-48/OPV.c | 10 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Platform.c | 51 +++--- bootstrap/unix-48/Platform.h | 18 +-- bootstrap/unix-48/Reals.c | 14 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/SYSTEM.c | 14 +- bootstrap/unix-48/SYSTEM.h | 48 +++--- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/Vishap.c | 4 +- bootstrap/unix-48/errors.c | 2 +- bootstrap/unix-48/errors.h | 2 +- bootstrap/unix-48/extTools.c | 2 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-48/vt100.c | 2 +- bootstrap/unix-48/vt100.h | 2 +- bootstrap/unix-88/Configuration.c | 4 +- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Console.c | 4 +- bootstrap/unix-88/Console.h | 2 +- bootstrap/unix-88/Files.c | 20 +-- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 222 +++++++++++++-------------- bootstrap/unix-88/Heap.h | 10 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 9 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 4 +- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 8 +- bootstrap/unix-88/OPT.h | 4 +- bootstrap/unix-88/OPV.c | 10 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Platform.c | 51 +++--- bootstrap/unix-88/Platform.h | 18 +-- bootstrap/unix-88/Reals.c | 14 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/SYSTEM.c | 14 +- bootstrap/unix-88/SYSTEM.h | 48 +++--- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/Vishap.c | 4 +- bootstrap/unix-88/errors.c | 2 +- bootstrap/unix-88/errors.h | 2 +- bootstrap/unix-88/extTools.c | 2 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/unix-88/vt100.c | 2 +- bootstrap/unix-88/vt100.h | 2 +- bootstrap/windows-48/Configuration.c | 4 +- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Console.c | 4 +- bootstrap/windows-48/Console.h | 2 +- bootstrap/windows-48/Files.c | 20 +-- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 222 +++++++++++++-------------- bootstrap/windows-48/Heap.h | 10 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 9 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 8 +- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 8 +- bootstrap/windows-48/OPT.h | 4 +- bootstrap/windows-48/OPV.c | 10 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Platform.c | 90 ++++++----- bootstrap/windows-48/Platform.h | 17 +- bootstrap/windows-48/Reals.c | 14 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/SYSTEM.c | 14 +- bootstrap/windows-48/SYSTEM.h | 48 +++--- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/Vishap.c | 4 +- bootstrap/windows-48/errors.c | 2 +- bootstrap/windows-48/errors.h | 2 +- bootstrap/windows-48/extTools.c | 2 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-48/vt100.c | 2 +- bootstrap/windows-48/vt100.h | 2 +- bootstrap/windows-88/Configuration.c | 4 +- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Console.c | 4 +- bootstrap/windows-88/Console.h | 2 +- bootstrap/windows-88/Files.c | 20 +-- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 222 +++++++++++++-------------- bootstrap/windows-88/Heap.h | 10 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 9 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 4 +- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 8 +- bootstrap/windows-88/OPT.h | 4 +- bootstrap/windows-88/OPV.c | 10 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Platform.c | 90 ++++++----- bootstrap/windows-88/Platform.h | 17 +- bootstrap/windows-88/Reals.c | 14 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/SYSTEM.c | 14 +- bootstrap/windows-88/SYSTEM.h | 48 +++--- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/Vishap.c | 4 +- bootstrap/windows-88/errors.c | 2 +- bootstrap/windows-88/errors.h | 2 +- bootstrap/windows-88/extTools.c | 2 +- bootstrap/windows-88/extTools.h | 2 +- bootstrap/windows-88/vt100.c | 2 +- bootstrap/windows-88/vt100.h | 2 +- src/compiler/OPB.Mod | 1 + src/compiler/OPC.Mod | 5 +- src/compiler/OPT.Mod | 4 +- src/compiler/OPV.Mod | 8 +- src/compiler/Vishap.Mod | 2 +- src/system/Heap.Mod | 106 ++++++------- src/system/Platformunix.Mod | 34 ++-- src/system/Platformwindows.Mod | 71 +++++---- src/system/SYSTEM.c | 14 +- src/system/SYSTEM.h | 48 +++--- 215 files changed, 1441 insertions(+), 1410 deletions(-) diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index 5cfd3bbe..560d018b 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -13,6 +13,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/03] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/04] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index 28ac1853..ac266eec 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Console.c b/bootstrap/unix-44/Console.c index fa03933a..7a2cc9d0 100644 --- a/bootstrap/unix-44/Console.c +++ b/bootstrap/unix-44/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Platform.h" @@ -21,7 +21,7 @@ export void Console_String (CHAR *s, LONGINT s__len); void Console_Flush (void) { int16 error; - error = Platform_Write(1, (uintptr)Console_line, Console_pos); + error = Platform_Write(1, (address)Console_line, Console_pos); Console_pos = 0; } diff --git a/bootstrap/unix-44/Console.h b/bootstrap/unix-44/Console.h index 5f33afb3..fd32774b 100644 --- a/bootstrap/unix-44/Console.h +++ b/bootstrap/unix-44/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 2337fa73..87b9a0a5 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" @@ -257,7 +257,7 @@ static void Files_Flush (Files_Buffer buf) if (buf->org != f->pos) { error = Platform_Seek(f->fd, buf->org, Platform_SeekSet); } - error = Platform_Write(f->fd, (uintptr)buf->data, buf->size); + error = Platform_Write(f->fd, (address)buf->data, buf->size); if (error != 0) { Files_Err((CHAR*)"error writing file", 19, f, error); } @@ -656,7 +656,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x } else { min = n; } - __MOVE((uintptr)buf->data + offset, (uintptr)x + xpos, min); + __MOVE((address)buf->data + offset, (address)x + xpos, min); offset += min; (*r).offset = offset; xpos += min; @@ -721,7 +721,7 @@ void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT } else { min = n; } - __MOVE((uintptr)x + xpos, (uintptr)buf->data + offset, min); + __MOVE((address)x + xpos, (address)buf->data + offset, min); offset += min; (*r).offset = offset; if (offset > buf->size) { @@ -772,15 +772,15 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int *res = 3; return; } - error = Platform_Read(fdold, (uintptr)buf, 4096, &n); + error = Platform_Read(fdold, (address)buf, 4096, &n); while (n > 0) { - error = Platform_Write(fdnew, (uintptr)buf, n); + error = Platform_Write(fdnew, (address)buf, n); if (error != 0) { ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); Files_Err((CHAR*)"cannot move file", 17, NIL, error); } - error = Platform_Read(fdold, (uintptr)buf, 4096, &n); + error = Platform_Read(fdold, (address)buf, 4096, &n); } ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); @@ -838,7 +838,7 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *de j += 1; } } else { - __MOVE((uintptr)src, (uintptr)dest, src__len); + __MOVE((address)src, (address)dest, src__len); } } @@ -1008,7 +1008,7 @@ static void Files_Finalize (SYSTEM_PTR o) { Files_File f = NIL; int32 res; - f = (Files_File)(uintptr)o; + f = (Files_File)(address)o; if (f->fd >= 0) { Files_CloseOSFile(f); if (f->tempFile) { @@ -1021,7 +1021,7 @@ void Files_SetSearchPath (CHAR *path, LONGINT path__len) { __DUP(path, path__len, CHAR); if (Strings_Length(path, path__len) != 0) { - Files_SearchPath = __NEWARR(NIL, 1, 1, 1, 1, ((uintptr)((Strings_Length(path, path__len) + 1)))); + Files_SearchPath = __NEWARR(NIL, 1, 1, 1, 1, ((address)((Strings_Length(path, path__len) + 1)))); __COPY(path, Files_SearchPath->data, Files_SearchPath->len[0]); } else { Files_SearchPath = NIL; diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index a76b0c07..4fc7ce7e 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index a003e797..02e6f1cb 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tskSfF */ #include "SYSTEM.h" struct Heap__1 { @@ -34,7 +34,7 @@ typedef typedef struct Heap_FinDesc { Heap_FinNode next; - uintptr obj; + address obj; BOOLEAN marked; Heap_Finalizer finalize; } Heap_FinDesc; @@ -51,19 +51,19 @@ typedef Heap_ModuleName name; int32 refcnt; Heap_Cmd cmds; - uintptr types; + address types; Heap_EnumProc enumPtrs; int32 reserved1, reserved2; } Heap_ModuleDesc; export SYSTEM_PTR Heap_modules; -static uintptr Heap_freeList[10]; -static uintptr Heap_bigBlocks; -export uintptr Heap_allocated; +static address Heap_freeList[10]; +static address Heap_bigBlocks; +export address Heap_allocated; static BOOLEAN Heap_firstTry; -static uintptr Heap_heap, Heap_heapend; -export uintptr Heap_heapsize; +static address Heap_heap, Heap_heapend; +export address Heap_heapsize; static Heap_FinNode Heap_fin; static int16 Heap_lockdepth; static BOOLEAN Heap_interrupted; @@ -75,33 +75,33 @@ export LONGINT *Heap_FinDesc__typ; export LONGINT *Heap__1__typ; static void Heap_CheckFin (void); -static void Heap_ExtendHeap (uintptr blksz); +static void Heap_ExtendHeap (address blksz); export void Heap_FINALL (void); static void Heap_Finalize (void); export void Heap_GC (BOOLEAN markStack); -static void Heap_HeapSort (uintptr n, uintptr *a, LONGINT a__len); +static void Heap_HeapSort (address n, address *a, LONGINT a__len); export void Heap_INCREF (Heap_Module m); export void Heap_InitHeap (void); export void Heap_Lock (void); -static void Heap_Mark (uintptr q); -static void Heap_MarkCandidates (uintptr n, uintptr *cand, LONGINT cand__len); +static void Heap_Mark (address q); +static void Heap_MarkCandidates (address n, address *cand, LONGINT cand__len); static void Heap_MarkP (SYSTEM_PTR p); -static void Heap_MarkStack (uintptr n, uintptr *cand, LONGINT cand__len); -export SYSTEM_PTR Heap_NEWBLK (uintptr size); -export SYSTEM_PTR Heap_NEWREC (uintptr tag); -static uintptr Heap_NewChunk (uintptr blksz); +static void Heap_MarkStack (address n, address *cand, LONGINT cand__len); +export SYSTEM_PTR Heap_NEWBLK (address size); +export SYSTEM_PTR Heap_NEWREC (address tag); +static address Heap_NewChunk (address blksz); export void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); export SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -export void Heap_REGTYP (Heap_Module m, uintptr typ); +export void Heap_REGTYP (Heap_Module m, address typ); export void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); static void Heap_Scan (void); -static void Heap_Sift (uintptr l, uintptr r, uintptr *a, LONGINT a__len); +static void Heap_Sift (address l, address r, address *a, LONGINT a__len); export void Heap_Unlock (void); extern void *Heap__init(); -extern uintptr Platform_MainStackFrame; -extern uintptr Platform_OSAllocate(uintptr size); -#define Heap_FetchAddress(pointer) (uintptr)(*((void**)((uintptr)pointer))) +extern address Platform_MainStackFrame; +extern address Platform_OSAllocate(address size); +#define Heap_FetchAddress(pointer) (address)(*((void**)((address)pointer))) #define Heap_HeapModuleInit() Heap__init() #define Heap_OSAllocate(size) Platform_OSAllocate(size) #define Heap_PlatformHalt(code) Platform_Halt(code) @@ -134,7 +134,7 @@ SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) __COPY(name, m->name, 20); m->refcnt = 0; m->enumPtrs = enumPtrs; - m->next = (Heap_Module)(uintptr)Heap_modules; + m->next = (Heap_Module)(address)Heap_modules; Heap_modules = (SYSTEM_PTR)m; _o_result = (void*)m; return _o_result; @@ -154,9 +154,9 @@ void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) m->cmds = c; } -void Heap_REGTYP (Heap_Module m, uintptr typ) +void Heap_REGTYP (Heap_Module m, address typ) { - __PUT(typ, m->types, uintptr); + __PUT(typ, m->types, address); m->types = typ; } @@ -165,17 +165,17 @@ void Heap_INCREF (Heap_Module m) m->refcnt += 1; } -static uintptr Heap_NewChunk (uintptr blksz) +static address Heap_NewChunk (address blksz) { - uintptr _o_result; - uintptr chnk; + address _o_result; + address chnk; chnk = Heap_OSAllocate(blksz + 12); if (chnk != 0) { - __PUT(chnk + 4, chnk + (12 + blksz), uintptr); - __PUT(chnk + 12, chnk + 16, uintptr); - __PUT(chnk + 16, blksz, uintptr); - __PUT(chnk + 20, -4, uintptr); - __PUT(chnk + 24, Heap_bigBlocks, uintptr); + __PUT(chnk + 4, chnk + (12 + blksz), address); + __PUT(chnk + 12, chnk + 16, address); + __PUT(chnk + 16, blksz, address); + __PUT(chnk + 20, -4, address); + __PUT(chnk + 24, Heap_bigBlocks, address); Heap_bigBlocks = chnk + 12; Heap_heapsize += blksz; } @@ -183,9 +183,9 @@ static uintptr Heap_NewChunk (uintptr blksz) return _o_result; } -static void Heap_ExtendHeap (uintptr blksz) +static void Heap_ExtendHeap (address blksz) { - uintptr size, chnk, j, next; + address size, chnk, j, next; if (blksz > 160000) { size = blksz; } else { @@ -194,7 +194,7 @@ static void Heap_ExtendHeap (uintptr blksz) chnk = Heap_NewChunk(size); if (chnk != 0) { if (chnk < Heap_heap) { - __PUT(chnk, Heap_heap, uintptr); + __PUT(chnk, Heap_heap, address); Heap_heap = chnk; } else { j = Heap_heap; @@ -203,8 +203,8 @@ static void Heap_ExtendHeap (uintptr blksz) j = next; next = Heap_FetchAddress(j); } - __PUT(chnk, next, uintptr); - __PUT(j, chnk, uintptr); + __PUT(chnk, next, address); + __PUT(j, chnk, address); } if (next == 0) { Heap_heapend = Heap_FetchAddress(chnk + 4); @@ -212,10 +212,10 @@ static void Heap_ExtendHeap (uintptr blksz) } } -SYSTEM_PTR Heap_NEWREC (uintptr tag) +SYSTEM_PTR Heap_NEWREC (address tag) { SYSTEM_PTR _o_result; - uintptr i, i0, di, blksz, restsize, t, adr, end, next, prev; + address i, i0, di, blksz, restsize, t, adr, end, next, prev; SYSTEM_PTR new; Heap_Lock(); blksz = Heap_FetchAddress(tag); @@ -235,11 +235,11 @@ SYSTEM_PTR Heap_NEWREC (uintptr tag) di = i - i0; restsize = __ASHL(di, 4); end = adr + restsize; - __PUT(end + 4, blksz, uintptr); - __PUT(end + 8, -4, uintptr); - __PUT(end, end + 4, uintptr); - __PUT(adr + 4, restsize, uintptr); - __PUT(adr + 12, Heap_freeList[di], uintptr); + __PUT(end + 4, blksz, address); + __PUT(end + 8, -4, address); + __PUT(end, end + 4, address); + __PUT(adr + 4, restsize, address); + __PUT(adr + 12, Heap_freeList[di], address); Heap_freeList[di] = adr; adr += restsize; } @@ -279,22 +279,22 @@ SYSTEM_PTR Heap_NEWREC (uintptr tag) } restsize = t - blksz; end = adr + restsize; - __PUT(end + 4, blksz, uintptr); - __PUT(end + 8, -4, uintptr); - __PUT(end, end + 4, uintptr); + __PUT(end + 4, blksz, address); + __PUT(end + 8, -4, address); + __PUT(end, end + 4, address); if (restsize > 144) { - __PUT(adr + 4, restsize, uintptr); + __PUT(adr + 4, restsize, address); } else { next = Heap_FetchAddress(adr + 12); if (prev == 0) { Heap_bigBlocks = next; } else { - __PUT(prev + 12, next, uintptr); + __PUT(prev + 12, next, address); } if (restsize > 0) { di = __ASHR(restsize, 4); - __PUT(adr + 4, restsize, uintptr); - __PUT(adr + 12, Heap_freeList[di], uintptr); + __PUT(adr + 4, restsize, address); + __PUT(adr + 12, Heap_freeList[di], address); Heap_freeList[di] = adr; } } @@ -303,53 +303,53 @@ SYSTEM_PTR Heap_NEWREC (uintptr tag) i = adr + 16; end = adr + blksz; while (i < end) { - __PUT(i, 0, uintptr); - __PUT(i + 4, 0, uintptr); - __PUT(i + 8, 0, uintptr); - __PUT(i + 12, 0, uintptr); + __PUT(i, 0, address); + __PUT(i + 4, 0, address); + __PUT(i + 8, 0, address); + __PUT(i + 12, 0, address); i += 16; } - __PUT(adr + 12, 0, uintptr); - __PUT(adr, tag, uintptr); - __PUT(adr + 4, 0, uintptr); - __PUT(adr + 8, 0, uintptr); + __PUT(adr + 12, 0, address); + __PUT(adr, tag, address); + __PUT(adr + 4, 0, address); + __PUT(adr + 8, 0, address); Heap_allocated += blksz; Heap_Unlock(); - _o_result = (SYSTEM_PTR)(uintptr)(adr + 4); + _o_result = (SYSTEM_PTR)(address)(adr + 4); return _o_result; } -SYSTEM_PTR Heap_NEWBLK (uintptr size) +SYSTEM_PTR Heap_NEWBLK (address size) { SYSTEM_PTR _o_result; - uintptr blksz, tag; + address blksz, tag; SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 31, 4), 4); - new = Heap_NEWREC((uintptr)&blksz); - tag = ((uintptr)(uintptr)new + blksz) - 12; - __PUT(tag - 4, 0, uintptr); - __PUT(tag, blksz, uintptr); - __PUT(tag + 4, -4, uintptr); - __PUT((uintptr)(uintptr)new - 4, tag, uintptr); + new = Heap_NEWREC((address)&blksz); + tag = ((address)(address)new + blksz) - 12; + __PUT(tag - 4, 0, address); + __PUT(tag, blksz, address); + __PUT(tag + 4, -4, address); + __PUT((address)(address)new - 4, tag, address); Heap_Unlock(); _o_result = new; return _o_result; } -static void Heap_Mark (uintptr q) +static void Heap_Mark (address q) { - uintptr p, tag, offset, fld, n, tagbits; + address p, tag, offset, fld, n, tagbits; if (q != 0) { tagbits = Heap_FetchAddress(q - 4); if (!__ODD(tagbits)) { - __PUT(q - 4, tagbits + 1, uintptr); + __PUT(q - 4, tagbits + 1, address); p = 0; tag = tagbits + 4; for (;;) { - __GET(tag, offset, uintptr); - if (__BIT((uintptr)&offset, 31)) { - __PUT(q - 4, (tag + offset) + 1, uintptr); + __GET(tag, offset, address); + if (__BIT((address)&offset, 31)) { + __PUT(q - 4, (tag + offset) + 1, address); if (p == 0) { break; } @@ -357,19 +357,19 @@ static void Heap_Mark (uintptr q) q = p; tag = Heap_FetchAddress(q - 4); tag -= 1; - __GET(tag, offset, uintptr); + __GET(tag, offset, address); fld = q + offset; p = Heap_FetchAddress(fld); - __PUT(fld, (SYSTEM_PTR)(uintptr)n, SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(address)n, SYSTEM_PTR); } else { fld = q + offset; n = Heap_FetchAddress(fld); if (n != 0) { tagbits = Heap_FetchAddress(n - 4); if (!__ODD(tagbits)) { - __PUT(n - 4, tagbits + 1, uintptr); - __PUT(q - 4, tag + 1, uintptr); - __PUT(fld, (SYSTEM_PTR)(uintptr)p, SYSTEM_PTR); + __PUT(n - 4, tagbits + 1, address); + __PUT(q - 4, tag + 1, address); + __PUT(fld, (SYSTEM_PTR)(address)p, SYSTEM_PTR); p = q; q = n; tag = tagbits; @@ -384,12 +384,12 @@ static void Heap_Mark (uintptr q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((uintptr)(uintptr)p); + Heap_Mark((address)(address)p); } static void Heap_Scan (void) { - uintptr chnk, adr, end, start, tag, i, size, freesize; + address chnk, adr, end, start, tag, i, size, freesize; Heap_bigBlocks = 0; i = 1; while (i < 9) { @@ -407,21 +407,21 @@ static void Heap_Scan (void) if (__ODD(tag)) { if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 4, uintptr); - __PUT(start + 4, freesize, uintptr); - __PUT(start + 8, -4, uintptr); + __PUT(start, start + 4, address); + __PUT(start + 4, freesize, address); + __PUT(start + 8, -4, address); i = __ASHR(freesize, 4); freesize = 0; if (i < 9) { - __PUT(start + 12, Heap_freeList[i], uintptr); + __PUT(start + 12, Heap_freeList[i], address); Heap_freeList[i] = start; } else { - __PUT(start + 12, Heap_bigBlocks, uintptr); + __PUT(start + 12, Heap_bigBlocks, address); Heap_bigBlocks = start; } } tag -= 1; - __PUT(adr, tag, uintptr); + __PUT(adr, tag, address); size = Heap_FetchAddress(tag); Heap_allocated += size; adr += size; @@ -433,16 +433,16 @@ static void Heap_Scan (void) } if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 4, uintptr); - __PUT(start + 4, freesize, uintptr); - __PUT(start + 8, -4, uintptr); + __PUT(start, start + 4, address); + __PUT(start + 4, freesize, address); + __PUT(start + 8, -4, address); i = __ASHR(freesize, 4); freesize = 0; if (i < 9) { - __PUT(start + 12, Heap_freeList[i], uintptr); + __PUT(start + 12, Heap_freeList[i], address); Heap_freeList[i] = start; } else { - __PUT(start + 12, Heap_bigBlocks, uintptr); + __PUT(start + 12, Heap_bigBlocks, address); Heap_bigBlocks = start; } } @@ -450,9 +450,9 @@ static void Heap_Scan (void) } } -static void Heap_Sift (uintptr l, uintptr r, uintptr *a, LONGINT a__len) +static void Heap_Sift (address l, address r, address *a, LONGINT a__len) { - uintptr i, j, x; + address i, j, x; j = l; x = a[j]; for (;;) { @@ -469,9 +469,9 @@ static void Heap_Sift (uintptr l, uintptr r, uintptr *a, LONGINT a__len) a[i] = x; } -static void Heap_HeapSort (uintptr n, uintptr *a, LONGINT a__len) +static void Heap_HeapSort (address n, address *a, LONGINT a__len) { - uintptr l, r, x; + address l, r, x; l = __ASHR(n, 1); r = n - 1; while (l > 0) { @@ -487,9 +487,9 @@ static void Heap_HeapSort (uintptr n, uintptr *a, LONGINT a__len) } } -static void Heap_MarkCandidates (uintptr n, uintptr *cand, LONGINT cand__len) +static void Heap_MarkCandidates (address n, address *cand, LONGINT cand__len) { - uintptr chnk, adr, tag, next, lim, lim1, i, ptr, size; + address chnk, adr, tag, next, lim, lim1, i, ptr, size; chnk = Heap_heap; i = 0; lim = cand[n - 1]; @@ -527,7 +527,7 @@ static void Heap_MarkCandidates (uintptr n, uintptr *cand, LONGINT cand__len) static void Heap_CheckFin (void) { Heap_FinNode n; - uintptr tag; + address tag; n = Heap_fin; while (n != NIL) { tag = Heap_FetchAddress(n->obj - 4); @@ -553,7 +553,7 @@ static void Heap_Finalize (void) } else { prev->next = n->next; } - (*n->finalize)((SYSTEM_PTR)(uintptr)n->obj); + (*n->finalize)((SYSTEM_PTR)(address)n->obj); if (prev == NIL) { n = Heap_fin; } else { @@ -572,14 +572,14 @@ void Heap_FINALL (void) while (Heap_fin != NIL) { n = Heap_fin; Heap_fin = Heap_fin->next; - (*n->finalize)((SYSTEM_PTR)(uintptr)n->obj); + (*n->finalize)((SYSTEM_PTR)(address)n->obj); } } -static void Heap_MarkStack (uintptr n, uintptr *cand, LONGINT cand__len) +static void Heap_MarkStack (address n, address *cand, LONGINT cand__len) { SYSTEM_PTR frame; - uintptr inc, nofcand, sp, p, stack0; + address inc, nofcand, sp, p, stack0; struct Heap__1 align; if (n > 0) { Heap_MarkStack(n - 1, cand, cand__len); @@ -589,14 +589,14 @@ static void Heap_MarkStack (uintptr n, uintptr *cand, LONGINT cand__len) } if (n == 0) { nofcand = 0; - sp = (uintptr)&frame; + sp = (address)&frame; stack0 = Heap_PlatformMainStackFrame(); - inc = (uintptr)&align.p - (uintptr)&align; + inc = (address)&align.p - (address)&align; if (sp > stack0) { inc = -inc; } while (sp != stack0) { - __GET(sp, p, uintptr); + __GET(sp, p, address); if ((p > Heap_heap && p < Heap_heapend)) { if (nofcand == cand__len) { Heap_HeapSort(nofcand, (void*)cand, cand__len); @@ -618,11 +618,11 @@ static void Heap_MarkStack (uintptr n, uintptr *cand, LONGINT cand__len) void Heap_GC (BOOLEAN markStack) { Heap_Module m; - uintptr i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; - uintptr cand[10000]; + address i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; + address cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); - m = (Heap_Module)(uintptr)Heap_modules; + m = (Heap_Module)(address)Heap_modules; while (m != NIL) { if (m->enumPtrs != NIL) { (*m->enumPtrs)(Heap_MarkP); @@ -699,7 +699,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (uintptr)(uintptr)obj; + f->obj = (address)(address)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; @@ -710,7 +710,7 @@ void Heap_InitHeap (void) { Heap_heap = Heap_NewChunk(128000); Heap_heapend = Heap_FetchAddress(Heap_heap + 4); - __PUT(Heap_heap, 0, uintptr); + __PUT(Heap_heap, 0, address); Heap_allocated = 0; Heap_firstTry = 1; Heap_freeList[9] = 1; diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index 771fc9d8..ca1d8e95 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h @@ -31,7 +31,7 @@ typedef import SYSTEM_PTR Heap_modules; -import uintptr Heap_allocated, Heap_heapsize; +import address Heap_allocated, Heap_heapsize; import int16 Heap_FileCount; import LONGINT *Heap_ModuleDesc__typ; @@ -41,11 +41,11 @@ import void Heap_GC (BOOLEAN markStack); import void Heap_INCREF (Heap_Module m); import void Heap_InitHeap (void); import void Heap_Lock (void); -import SYSTEM_PTR Heap_NEWBLK (uintptr size); -import SYSTEM_PTR Heap_NEWREC (uintptr tag); +import SYSTEM_PTR Heap_NEWBLK (address size); +import SYSTEM_PTR Heap_NEWREC (address tag); import void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); import SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -import void Heap_REGTYP (Heap_Module m, uintptr typ); +import void Heap_REGTYP (Heap_Module m, address typ); import void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); import void Heap_Unlock (void); import void *Heap__init(void); diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index 84914960..fab3561e 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Heap.h" diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index 2409c160..13abd6d0 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index 07797236..1d0b8774 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index 47603929..465ba585 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 8949813a..b702852c 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "OPM.h" @@ -200,8 +200,8 @@ void OPC_Ident (OPT_Object obj) } } } else if ((mode == 5 && obj->typ->form == 4)) { - if (obj->typ == OPT_pinttyp) { - OPM_WriteString((CHAR*)"uintptr", 8); + if (obj->typ == OPT_adrtyp) { + OPM_WriteString((CHAR*)"address", 8); } else { OPM_WriteString((CHAR*)"int", 4); OPM_WriteInt(__ASHL(obj->typ->size, 3)); @@ -2047,7 +2047,7 @@ static void OPC_InitKeywords (void) OPC_hashtab[__X(i, 105)] = -1; i += 1; } - Enter__49((CHAR*)"adrint", 7); + Enter__49((CHAR*)"address", 8); Enter__49((CHAR*)"asm", 4); Enter__49((CHAR*)"auto", 5); Enter__49((CHAR*)"break", 6); @@ -2084,7 +2084,6 @@ static void OPC_InitKeywords (void) Enter__49((CHAR*)"struct", 7); Enter__49((CHAR*)"switch", 7); Enter__49((CHAR*)"typedef", 8); - Enter__49((CHAR*)"uintptr", 8); Enter__49((CHAR*)"uint16", 7); Enter__49((CHAR*)"uint32", 7); Enter__49((CHAR*)"uint64", 7); diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index a13d99e4..2839fb0f 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 1cd8fb97..70121d63 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" @@ -544,15 +544,15 @@ void OPM_FPrintReal (int32 *fp, REAL real) { int16 i; int32 l; - __GET((uintptr)&real, l, int32); + __GET((address)&real, l, int32); OPM_FPrint(&*fp, l); } void OPM_FPrintLReal (int32 *fp, LONGREAL lr) { int32 l, h; - __GET((uintptr)&lr, l, int32); - __GET((uintptr)&lr + 4, h, int32); + __GET((address)&lr, l, int32); + __GET((address)&lr + 4, h, int32); OPM_FPrint(&*fp, l); OPM_FPrint(&*fp, h); } diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index f0a96a82..fce4bdd3 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index f727dcde..dc286221 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPB.h" #include "OPM.h" diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index b8787f9f..e79b5819 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index 7a14e8c2..b90cb34b 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index 0e48367c..347c669a 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index f151a183..ccfba447 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" @@ -83,7 +83,7 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; -export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_pinttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; export int8 OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; @@ -1767,7 +1767,7 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_sinttyp); P(OPT_inttyp); P(OPT_linttyp); - P(OPT_pinttyp); + P(OPT_adrtyp); P(OPT_int8typ); P(OPT_int16typ); P(OPT_int32typ); @@ -1849,7 +1849,7 @@ export void *OPT__init(void) OPT_InitStruct(&OPT_niltyp, 9); OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp); OPT_EnterTyp((CHAR*)"PTR", 11, OPM_PointerSize, &OPT_sysptrtyp); - OPT_EnterTyp((CHAR*)"UINTPTR", 4, OPM_PointerSize, &OPT_pinttyp); + OPT_EnterTyp((CHAR*)"ADDRESS", 4, OPM_PointerSize, &OPT_adrtyp); OPT_EnterTyp((CHAR*)"INT8", 4, 1, &OPT_int8typ); OPT_EnterTyp((CHAR*)"INT16", 4, 2, &OPT_int16typ); OPT_EnterTyp((CHAR*)"INT32", 4, 4, &OPT_int32typ); diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index 41a1b2e4..ce146e6f 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h @@ -67,7 +67,7 @@ typedef import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; -import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_pinttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; import int8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index 4272132e..da9a8429 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPC.h" #include "OPM.h" @@ -285,7 +285,7 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_realtyp->strobj->linkadr = 2; OPT_inttyp->strobj->linkadr = 2; OPT_linttyp->strobj->linkadr = 2; - OPT_pinttyp->strobj->linkadr = 2; + OPT_adrtyp->strobj->linkadr = 2; OPT_int8typ->strobj->linkadr = 2; OPT_int16typ->strobj->linkadr = 2; OPT_int32typ->strobj->linkadr = 2; @@ -938,7 +938,7 @@ static void OPV_expr (OPT_Node n, int16 prec) OPM_Write(')'); break; case 24: - OPM_WriteString((CHAR*)"(uintptr)", 10); + OPM_WriteString((CHAR*)"(address)", 10); if (l->class == 1) { OPC_CompleteIdent(l->obj); } else { @@ -954,7 +954,7 @@ static void OPV_expr (OPT_Node n, int16 prec) OPC_Ident(n->typ->strobj); OPM_Write(')'); if (__IN(n->typ->form, 0x1800) || __IN(l->typ->form, 0x1800)) { - OPM_WriteString((CHAR*)"(uintptr)", 10); + OPM_WriteString((CHAR*)"(address)", 10); } OPV_expr(l, exprPrec); } else { @@ -1326,7 +1326,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) if (x->class == 7) { OPC_IntLiteral(x->conval->intval, OPM_PointerSize); } else { - OPM_WriteString((CHAR*)"((uintptr)(", 12); + OPM_WriteString((CHAR*)"((address)(", 12); OPV_expr(x, 10); OPM_WriteString((CHAR*)"))", 3); } diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index d45ee079..600b19bd 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index f7f6f6b6..056a333c 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef @@ -26,12 +26,12 @@ typedef export BOOLEAN Platform_LittleEndian; -export uintptr Platform_MainStackFrame; +export address Platform_MainStackFrame; export int32 Platform_HaltCode; export int16 Platform_PID; export CHAR Platform_CWD[256]; export int16 Platform_ArgCount; -export uintptr Platform_ArgVector; +export address Platform_ArgVector; static Platform_HaltProcedure Platform_HaltHandler; static int32 Platform_TimeStart; export int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; @@ -59,16 +59,16 @@ export void Platform_Halt (int32 code); export int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, LONGINT *identity__typ); export int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); export BOOLEAN Platform_Inaccessible (int16 e); -export void Platform_Init (int16 argc, int32 argvadr); +export void Platform_Init (int16 argc, address argvadr); export void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); export int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); export BOOLEAN Platform_NoSuchDirectory (int16 e); -export uintptr Platform_OSAllocate (uintptr size); -export void Platform_OSFree (uintptr address); +export address Platform_OSAllocate (address size); +export void Platform_OSFree (address address); export int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); export int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); -export int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n); -export int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n); +export int16 Platform_Read (int32 h, address p, address l, address *n); +export int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, address *n); export int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); export BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); export BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); @@ -87,7 +87,7 @@ export BOOLEAN Platform_TimedOut (int16 e); export BOOLEAN Platform_TooManyFiles (int16 e); export int16 Platform_Truncate (int32 h, int32 l); export int16 Platform_Unlink (CHAR *n, LONGINT n__len); -export int16 Platform_Write (int32 h, int32 p, int32 l); +export int16 Platform_Write (int32 h, address p, address l); static void Platform_YMDHMStoClock (int32 ye, int32 mo, int32 da, int32 ho, int32 mi, int32 se, int32 *t, int32 *d); static void Platform_errch (CHAR c); static void Platform_errint (int32 l); @@ -119,7 +119,7 @@ export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT #define Platform_EXDEV() EXDEV extern void Heap_InitHeap(); #define Platform_HeapInitHeap() Heap_InitHeap() -#define Platform_allocate(size) (uintptr)((void*)malloc((size_t)size)) +#define Platform_allocate(size) (address)((void*)malloc((size_t)size)) #define Platform_chdir(n, n__len) chdir((char*)n) #define Platform_closefile(fd) close(fd) #define Platform_err() errno @@ -139,13 +139,13 @@ extern void Heap_InitHeap(); #define Platform_opennew(n, n__len) open((char*)n, O_CREAT | O_TRUNC | O_RDWR, 0664) #define Platform_openro(n, n__len) open((char*)n, O_RDONLY) #define Platform_openrw(n, n__len) open((char*)n, O_RDWR) -#define Platform_readfile(fd, p, l) read(fd, (void*)(uintptr)(p), l) +#define Platform_readfile(fd, p, l) read(fd, (void*)(address)(p), l) #define Platform_rename(o, o__len, n, n__len) rename((char*)o, (char*)n) #define Platform_sectotm(s) struct tm *time = localtime((time_t*)&s) #define Platform_seekcur() SEEK_CUR #define Platform_seekend() SEEK_END #define Platform_seekset() SEEK_SET -#define Platform_sethandler(s, h) SystemSetHandler(s, (uintptr)h) +#define Platform_sethandler(s, h) SystemSetHandler(s, (address)h) #define Platform_stat(n, n__len) stat((char*)n, &s) #define Platform_statdev() (LONGINT)s.st_dev #define Platform_statino() (LONGINT)s.st_ino @@ -162,7 +162,7 @@ extern void Heap_InitHeap(); #define Platform_tvsec() tv.tv_sec #define Platform_tvusec() tv.tv_usec #define Platform_unlink(n, n__len) unlink((char*)n) -#define Platform_writefile(fd, p, l) write(fd, (void*)(uintptr)(p), l) +#define Platform_writefile(fd, p, l) write(fd, (void*)(address)(p), l) BOOLEAN Platform_TooManyFiles (int16 e) { @@ -213,24 +213,24 @@ BOOLEAN Platform_ConnectionFailed (int16 e) return _o_result; } -uintptr Platform_OSAllocate (uintptr size) +address Platform_OSAllocate (address size) { - uintptr _o_result; + address _o_result; _o_result = Platform_allocate(size); return _o_result; } -void Platform_OSFree (uintptr address) +void Platform_OSFree (address address) { Platform_free(address); } -void Platform_Init (int16 argc, int32 argvadr) +void Platform_Init (int16 argc, address argvadr) { Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; Platform_ArgCount = argc; - av = (Platform_ArgVecPtr)(uintptr)argvadr; + av = (Platform_ArgVecPtr)(address)argvadr; Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; Platform_HeapInitHeap(); @@ -263,7 +263,7 @@ void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { - av = (Platform_ArgVec)(uintptr)Platform_ArgVector; + av = (Platform_ArgVec)(address)Platform_ArgVector; __COPY(*(*av)[__X(n, 1024)], val, val__len); } } @@ -512,7 +512,7 @@ int16 Platform_Size (int32 h, int32 *l) return _o_result; } -int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n) +int16 Platform_Read (int32 h, address p, address l, address *n) { int16 _o_result; *n = Platform_readfile(h, p, l); @@ -527,10 +527,10 @@ int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n) __RETCHK; } -int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n) +int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, address *n) { int16 _o_result; - *n = Platform_readfile(h, (uintptr)b, b__len); + *n = Platform_readfile(h, (address)b, b__len); if (*n < 0) { *n = 0; _o_result = Platform_err(); @@ -542,10 +542,10 @@ int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n) __RETCHK; } -int16 Platform_Write (int32 h, int32 p, int32 l) +int16 Platform_Write (int32 h, address p, address l) { int16 _o_result; - int32 written; + address written; written = Platform_writefile(h, p, l); if (written < 0) { _o_result = Platform_err(); @@ -650,7 +650,6 @@ static void Platform_errch (CHAR c) static void Platform_errln (void) { - Platform_errch(0x0d); Platform_errch(0x0a); } @@ -766,7 +765,7 @@ static void Platform_TestLittleEndian (void) { int16 i; i = 1; - __GET((uintptr)&i, Platform_LittleEndian, BOOLEAN); + __GET((address)&i, Platform_LittleEndian, BOOLEAN); } __TDESC(Platform_FileIdentity, 1, 0) = {__TDFLDS("FileIdentity", 12), {-4}}; diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index bed97db3..ab1d3003 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h @@ -18,12 +18,12 @@ typedef import BOOLEAN Platform_LittleEndian; -import uintptr Platform_MainStackFrame; +import address Platform_MainStackFrame; import int32 Platform_HaltCode; import int16 Platform_PID; import CHAR Platform_CWD[256]; import int16 Platform_ArgCount; -import uintptr Platform_ArgVector; +import address Platform_ArgVector; import int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; import CHAR Platform_nl[3]; @@ -48,16 +48,16 @@ import void Platform_Halt (int32 code); import int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, LONGINT *identity__typ); import int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); import BOOLEAN Platform_Inaccessible (int16 e); -import void Platform_Init (int16 argc, int32 argvadr); +import void Platform_Init (int16 argc, address argvadr); import void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); import int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); import BOOLEAN Platform_NoSuchDirectory (int16 e); -import uintptr Platform_OSAllocate (uintptr size); -import void Platform_OSFree (uintptr address); +import address Platform_OSAllocate (address size); +import void Platform_OSFree (address address); import int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); import int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); -import int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n); -import int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n); +import int16 Platform_Read (int32 h, address p, address l, address *n); +import int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, address *n); import int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); import BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); import BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); @@ -75,7 +75,7 @@ import BOOLEAN Platform_TimedOut (int16 e); import BOOLEAN Platform_TooManyFiles (int16 e); import int16 Platform_Truncate (int32 h, int32 l); import int16 Platform_Unlink (CHAR *n, LONGINT n__len); -import int16 Platform_Write (int32 h, int32 p, int32 l); +import int16 Platform_Write (int32 h, address p, address l); import BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); import void *Platform__init(void); diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 32931aec..8fe37010 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -58,7 +58,7 @@ int16 Reals_Expo (REAL x) { int16 _o_result; int16 i; - __GET((uintptr)&x + 2, i, int16); + __GET((address)&x + 2, i, int16); _o_result = __MASK(__ASHR(i, 7), -256); return _o_result; } @@ -66,17 +66,17 @@ int16 Reals_Expo (REAL x) void Reals_SetExpo (REAL *x, int16 ex) { CHAR c; - __GET((uintptr)x + 3, c, CHAR); - __PUT((uintptr)x + 3, (CHAR)(__ASHL(__ASHR((int16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); - __GET((uintptr)x + 2, c, CHAR); - __PUT((uintptr)x + 2, (CHAR)(__MASK((int16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); + __GET((address)x + 3, c, CHAR); + __PUT((address)x + 3, (CHAR)(__ASHL(__ASHR((int16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __GET((address)x + 2, c, CHAR); + __PUT((address)x + 2, (CHAR)(__MASK((int16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } int16 Reals_ExpoL (LONGREAL x) { int16 _o_result; int16 i; - __GET((uintptr)&x + 6, i, int16); + __GET((address)&x + 6, i, int16); _o_result = __MASK(__ASHR(i, 4), -2048); return _o_result; } diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index 38d206bb..9ebc1c17 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/SYSTEM.c b/bootstrap/unix-44/SYSTEM.c index 16681ab8..821a6096 100644 --- a/bootstrap/unix-44/SYSTEM.c +++ b/bootstrap/unix-44/SYSTEM.c @@ -38,7 +38,7 @@ void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0) void SYSTEM_ENUMP(void *adr, LONGINT n, void (*P)()) { while (n > 0) { - P((uintptr)(*((void**)(adr)))); + P((address)(*((void**)(adr)))); adr = ((void**)adr) + 1; n--; } @@ -51,7 +51,7 @@ void SYSTEM_ENUMR(void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()) while (n > 0) { t = typ; off = *t; - while (off >= 0) {P(*(uintptr*)((char*)adr+off)); t++; off = *t;} + while (off >= 0) {P(*(address*)((char*)adr+off)); t++; off = *t;} adr = ((char*)adr) + size; n--; } @@ -109,7 +109,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, else if (typ == (LONGINT*)POINTER__typ) { /* element type is a pointer */ x = Heap_NEWBLK(size + nofelems * sizeof(LONGINT)); - p = (LONGINT*)(uintptr)x[-1]; + p = (LONGINT*)(address)x[-1]; p[-nofelems] = *p; /* build new type desc in situ: 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nofelems - 1; n = 1; /* n =1 for skipping the size field */ while (n <= nofelems) {*p = n*sizeof(LONGINT); p++; n++;} @@ -122,7 +122,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, while (ptab[nofptrs] >= 0) {nofptrs++;} /* number of pointers per element */ nptr = nofelems * nofptrs; /* total number of pointers */ x = Heap_NEWBLK(size + nptr * sizeof(LONGINT)); - p = (LONGINT*)(uintptr)x[- 1]; + p = (LONGINT*)(address)x[- 1]; p[-nptr] = *p; /* build new type desc in situ; 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nptr - 1; n = 0; off = dataoff; while (n < nofelems) {i = 0; @@ -158,7 +158,7 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler // (Ignore other signals) } - void SystemSetHandler(int s, uintptr h) { + void SystemSetHandler(int s, address h) { if (s >= 2 && s <= 4) { int needtosetsystemhandler = handler[s-2] == 0; handler[s-2] = (SystemSignalHandler)h; @@ -197,12 +197,12 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler } } - void SystemSetInterruptHandler(uintptr h) { + void SystemSetInterruptHandler(address h) { EnsureConsoleCtrlHandler(); SystemInterruptHandler = (SystemSignalHandler)h; } - void SystemSetQuitHandler(uintptr h) { + void SystemSetQuitHandler(address h) { EnsureConsoleCtrlHandler(); SystemQuitHandler = (SystemSignalHandler)h; } diff --git a/bootstrap/unix-44/SYSTEM.h b/bootstrap/unix-44/SYSTEM.h index e7b38a26..8c6c335e 100644 --- a/bootstrap/unix-44/SYSTEM.h +++ b/bootstrap/unix-44/SYSTEM.h @@ -39,7 +39,7 @@ typedef unsigned short int uint16; typedef signed char int8; typedef unsigned char uint8; -#define uintptr size_t +#define address size_t // The compiler uses 'import' and 'export' which translate to 'extern' and // nothing respectively. @@ -53,7 +53,7 @@ typedef unsigned char uint8; #define NIL ((void*)0) #define __MAXEXT 16 -#define POINTER__typ ((uintptr*)(1)) // not NIL and not a valid type +#define POINTER__typ ((address*)(1)) // not NIL and not a valid type // Oberon types @@ -98,8 +98,8 @@ typedef void* SYSTEM_PTR; // OS Memory allocation interfaces are in PlatformXXX.Mod -extern uintptr Platform_OSAllocate (uintptr size); -extern void Platform_OSFree (uintptr addr); +extern address Platform_OSAllocate (address size); +extern void Platform_OSFree (address addr); // Run time system routines in SYSTEM.c @@ -120,10 +120,10 @@ extern LONGINT SYSTEM_ENTIER (double x); // Signal handling in SYSTEM.c #ifndef _WIN32 - extern void SystemSetHandler(int s, uintptr h); + extern void SystemSetHandler(int s, address h); #else - extern void SystemSetInterruptHandler(uintptr h); - extern void SystemSetQuitHandler (uintptr h); + extern void SystemSetInterruptHandler(address h); + extern void SystemSetQuitHandler (address h); #endif @@ -146,9 +146,9 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __COPY(s, d, n) {char*_a=(void*)s,*_b=(void*)d; LONGINT _i=0,_t=n-1; \ while(_i<_t&&((_b[_i]=_a[_i])!=0)){_i++;};_b[_i]=0;} -#define __DUP(x, l, t) x=(void*)memcpy((void*)(uintptr)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) +#define __DUP(x, l, t) x=(void*)memcpy((void*)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) #define __DUPARR(v, t) v=(void*)memcpy(v##__copy,v,sizeof(t)) -#define __DEL(x) Platform_OSFree((LONGINT)(uintptr)x) +#define __DEL(x) Platform_OSFree((address)x) // Index and range checks @@ -165,8 +165,8 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __VAL(t, x) (*(t*)&(x)) -#define __GET(a, x, t) x= *(t*)(uintptr)(a) -#define __PUT(a, x, t) *(t*)(uintptr)(a)=x +#define __GET(a, x, t) x= *(t*)(address)(a) +#define __PUT(a, x, t) *(t*)(address)(a)=x #define __LSHL(x, n, t) ((t)((u##t)(x)<<(n))) #define __LSHR(x, n, t) ((t)((u##t)(x)>>(n))) @@ -182,7 +182,7 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __ASHF(x, n) SYSTEM_ASH((LONGINT)(x), (LONGINT)(n)) #define __BIT(x, n) (*(uint64*)(x)>>(n)&1) -#define __MOVE(s, d, n) memcpy((char*)(uintptr)(d),(char*)(uintptr)(s),n) +#define __MOVE(s, d, n) memcpy((char*)(address)(d),(char*)(address)(s),n) #define __SHORT(x, y) ((int)((uLONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) #define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) #define __CHR(x) ((CHAR)__R(x, 256)) @@ -235,10 +235,10 @@ extern void Heap_INCREF(); // Main module initialisation, registration and finalisation -extern void Platform_Init(INTEGER argc, LONGINT argv); +extern void Platform_Init(INTEGER argc, address argv); extern void Heap_FINALL(); -#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (LONGINT)(uintptr)&argv); +#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (address)&argv); #define __REGMAIN(name, enum) m = Heap_REGMOD((CHAR*)name,enum) #define __FINI Heap_FINALL(); return 0 @@ -254,12 +254,12 @@ extern void Platform_AssertFail(LONGINT x); // Memory allocation -extern SYSTEM_PTR Heap_NEWBLK (uintptr size); -extern SYSTEM_PTR Heap_NEWREC (uintptr tag); +extern SYSTEM_PTR Heap_NEWBLK (address size); +extern SYSTEM_PTR Heap_NEWREC (address tag); extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __SYSNEW(p, len) p = Heap_NEWBLK((LONGINT)(len)) -#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(uintptr)t##__typ) +#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(address)t##__typ) #define __NEWARR SYSTEM_NEWARR @@ -290,20 +290,20 @@ extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __INITYP(t, t0, level) \ t##__typ = (LONGINT*)&t##__desc.blksz; \ memcpy(t##__desc.basep, t0##__typ - __BASEOFF, level*sizeof(LONGINT)); \ - t##__desc.basep[level] = (LONGINT)(uintptr)t##__typ; \ - t##__desc.module = (LONGINT)(uintptr)m; \ + t##__desc.basep[level] = (LONGINT)(address)t##__typ; \ + t##__desc.module = (LONGINT)(address)m; \ if(t##__desc.blksz!=sizeof(struct t)) __HALT(-15); \ t##__desc.blksz = (t##__desc.blksz+5*sizeof(LONGINT)-1)/(4*sizeof(LONGINT))*(4*sizeof(LONGINT)); \ - Heap_REGTYP(m, (LONGINT)(uintptr)&t##__desc.next); \ + Heap_REGTYP(m, (LONGINT)(address)&t##__desc.next); \ SYSTEM_INHERIT(t##__typ, t0##__typ) -#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(uintptr)typ##__typ) -#define __TYPEOF(p) ((LONGINT*)(uintptr)(*(((LONGINT*)(p))-1))) +#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(address)typ##__typ) +#define __TYPEOF(p) ((LONGINT*)(address)(*(((LONGINT*)(p))-1))) #define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) // Oberon-2 type bound procedures support -#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(uintptr)proc -#define __SEND(typ, num, funtyp, parlist) ((funtyp)((uintptr)*(typ-(__TPROC0OFF+num))))parlist +#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(address)proc +#define __SEND(typ, num, funtyp, parlist) ((funtyp)((address)*(typ-(__TPROC0OFF+num))))parlist diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index 728d163f..a642190c 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index 6e1bcc56..f537406e 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index 6157e386..8b4c3700 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Files.h" #include "Modules.h" diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index 76aee9f2..4444900f 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/Vishap.c b/bootstrap/unix-44/Vishap.c index f2e2ae7d..81b2d70f 100644 --- a/bootstrap/unix-44/Vishap.c +++ b/bootstrap/unix-44/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkamSf */ #include "SYSTEM.h" #include "Configuration.h" #include "Heap.h" @@ -81,7 +81,7 @@ static void Vishap_PropagateElementaryTypeSizes (void) OPT_realtyp->size = OPM_RealSize; OPT_inttyp->size = OPM_IntSize; OPT_linttyp->size = OPM_LIntSize; - OPT_pinttyp->size = OPM_PointerSize; + OPT_adrtyp->size = OPM_PointerSize; OPT_lrltyp->size = OPM_LRealSize; OPT_sinttyp->size = OPM_SIntSize; OPT_booltyp->size = OPM_BoolSize; diff --git a/bootstrap/unix-44/errors.c b/bootstrap/unix-44/errors.c index 0dc0c60a..a5576d43 100644 --- a/bootstrap/unix-44/errors.c +++ b/bootstrap/unix-44/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/unix-44/errors.h b/bootstrap/unix-44/errors.h index 4415a5f2..696219d4 100644 --- a/bootstrap/unix-44/errors.h +++ b/bootstrap/unix-44/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index 6a7aab56..553a3d7d 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index 4e806a33..ba9937e8 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-44/vt100.c b/bootstrap/unix-44/vt100.c index 447b9c81..ab305ed1 100644 --- a/bootstrap/unix-44/vt100.c +++ b/bootstrap/unix-44/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Strings.h" diff --git a/bootstrap/unix-44/vt100.h b/bootstrap/unix-44/vt100.h index 3d9d98a7..71079dc0 100644 --- a/bootstrap/unix-44/vt100.h +++ b/bootstrap/unix-44/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index 5cfd3bbe..560d018b 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -13,6 +13,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/03] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/04] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index 28ac1853..ac266eec 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Console.c b/bootstrap/unix-48/Console.c index fa03933a..7a2cc9d0 100644 --- a/bootstrap/unix-48/Console.c +++ b/bootstrap/unix-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Platform.h" @@ -21,7 +21,7 @@ export void Console_String (CHAR *s, LONGINT s__len); void Console_Flush (void) { int16 error; - error = Platform_Write(1, (uintptr)Console_line, Console_pos); + error = Platform_Write(1, (address)Console_line, Console_pos); Console_pos = 0; } diff --git a/bootstrap/unix-48/Console.h b/bootstrap/unix-48/Console.h index 5f33afb3..fd32774b 100644 --- a/bootstrap/unix-48/Console.h +++ b/bootstrap/unix-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 2337fa73..87b9a0a5 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" @@ -257,7 +257,7 @@ static void Files_Flush (Files_Buffer buf) if (buf->org != f->pos) { error = Platform_Seek(f->fd, buf->org, Platform_SeekSet); } - error = Platform_Write(f->fd, (uintptr)buf->data, buf->size); + error = Platform_Write(f->fd, (address)buf->data, buf->size); if (error != 0) { Files_Err((CHAR*)"error writing file", 19, f, error); } @@ -656,7 +656,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x } else { min = n; } - __MOVE((uintptr)buf->data + offset, (uintptr)x + xpos, min); + __MOVE((address)buf->data + offset, (address)x + xpos, min); offset += min; (*r).offset = offset; xpos += min; @@ -721,7 +721,7 @@ void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT } else { min = n; } - __MOVE((uintptr)x + xpos, (uintptr)buf->data + offset, min); + __MOVE((address)x + xpos, (address)buf->data + offset, min); offset += min; (*r).offset = offset; if (offset > buf->size) { @@ -772,15 +772,15 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int *res = 3; return; } - error = Platform_Read(fdold, (uintptr)buf, 4096, &n); + error = Platform_Read(fdold, (address)buf, 4096, &n); while (n > 0) { - error = Platform_Write(fdnew, (uintptr)buf, n); + error = Platform_Write(fdnew, (address)buf, n); if (error != 0) { ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); Files_Err((CHAR*)"cannot move file", 17, NIL, error); } - error = Platform_Read(fdold, (uintptr)buf, 4096, &n); + error = Platform_Read(fdold, (address)buf, 4096, &n); } ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); @@ -838,7 +838,7 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *de j += 1; } } else { - __MOVE((uintptr)src, (uintptr)dest, src__len); + __MOVE((address)src, (address)dest, src__len); } } @@ -1008,7 +1008,7 @@ static void Files_Finalize (SYSTEM_PTR o) { Files_File f = NIL; int32 res; - f = (Files_File)(uintptr)o; + f = (Files_File)(address)o; if (f->fd >= 0) { Files_CloseOSFile(f); if (f->tempFile) { @@ -1021,7 +1021,7 @@ void Files_SetSearchPath (CHAR *path, LONGINT path__len) { __DUP(path, path__len, CHAR); if (Strings_Length(path, path__len) != 0) { - Files_SearchPath = __NEWARR(NIL, 1, 1, 1, 1, ((uintptr)((Strings_Length(path, path__len) + 1)))); + Files_SearchPath = __NEWARR(NIL, 1, 1, 1, 1, ((address)((Strings_Length(path, path__len) + 1)))); __COPY(path, Files_SearchPath->data, Files_SearchPath->len[0]); } else { Files_SearchPath = NIL; diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index a76b0c07..4fc7ce7e 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index a003e797..02e6f1cb 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tskSfF */ #include "SYSTEM.h" struct Heap__1 { @@ -34,7 +34,7 @@ typedef typedef struct Heap_FinDesc { Heap_FinNode next; - uintptr obj; + address obj; BOOLEAN marked; Heap_Finalizer finalize; } Heap_FinDesc; @@ -51,19 +51,19 @@ typedef Heap_ModuleName name; int32 refcnt; Heap_Cmd cmds; - uintptr types; + address types; Heap_EnumProc enumPtrs; int32 reserved1, reserved2; } Heap_ModuleDesc; export SYSTEM_PTR Heap_modules; -static uintptr Heap_freeList[10]; -static uintptr Heap_bigBlocks; -export uintptr Heap_allocated; +static address Heap_freeList[10]; +static address Heap_bigBlocks; +export address Heap_allocated; static BOOLEAN Heap_firstTry; -static uintptr Heap_heap, Heap_heapend; -export uintptr Heap_heapsize; +static address Heap_heap, Heap_heapend; +export address Heap_heapsize; static Heap_FinNode Heap_fin; static int16 Heap_lockdepth; static BOOLEAN Heap_interrupted; @@ -75,33 +75,33 @@ export LONGINT *Heap_FinDesc__typ; export LONGINT *Heap__1__typ; static void Heap_CheckFin (void); -static void Heap_ExtendHeap (uintptr blksz); +static void Heap_ExtendHeap (address blksz); export void Heap_FINALL (void); static void Heap_Finalize (void); export void Heap_GC (BOOLEAN markStack); -static void Heap_HeapSort (uintptr n, uintptr *a, LONGINT a__len); +static void Heap_HeapSort (address n, address *a, LONGINT a__len); export void Heap_INCREF (Heap_Module m); export void Heap_InitHeap (void); export void Heap_Lock (void); -static void Heap_Mark (uintptr q); -static void Heap_MarkCandidates (uintptr n, uintptr *cand, LONGINT cand__len); +static void Heap_Mark (address q); +static void Heap_MarkCandidates (address n, address *cand, LONGINT cand__len); static void Heap_MarkP (SYSTEM_PTR p); -static void Heap_MarkStack (uintptr n, uintptr *cand, LONGINT cand__len); -export SYSTEM_PTR Heap_NEWBLK (uintptr size); -export SYSTEM_PTR Heap_NEWREC (uintptr tag); -static uintptr Heap_NewChunk (uintptr blksz); +static void Heap_MarkStack (address n, address *cand, LONGINT cand__len); +export SYSTEM_PTR Heap_NEWBLK (address size); +export SYSTEM_PTR Heap_NEWREC (address tag); +static address Heap_NewChunk (address blksz); export void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); export SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -export void Heap_REGTYP (Heap_Module m, uintptr typ); +export void Heap_REGTYP (Heap_Module m, address typ); export void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); static void Heap_Scan (void); -static void Heap_Sift (uintptr l, uintptr r, uintptr *a, LONGINT a__len); +static void Heap_Sift (address l, address r, address *a, LONGINT a__len); export void Heap_Unlock (void); extern void *Heap__init(); -extern uintptr Platform_MainStackFrame; -extern uintptr Platform_OSAllocate(uintptr size); -#define Heap_FetchAddress(pointer) (uintptr)(*((void**)((uintptr)pointer))) +extern address Platform_MainStackFrame; +extern address Platform_OSAllocate(address size); +#define Heap_FetchAddress(pointer) (address)(*((void**)((address)pointer))) #define Heap_HeapModuleInit() Heap__init() #define Heap_OSAllocate(size) Platform_OSAllocate(size) #define Heap_PlatformHalt(code) Platform_Halt(code) @@ -134,7 +134,7 @@ SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) __COPY(name, m->name, 20); m->refcnt = 0; m->enumPtrs = enumPtrs; - m->next = (Heap_Module)(uintptr)Heap_modules; + m->next = (Heap_Module)(address)Heap_modules; Heap_modules = (SYSTEM_PTR)m; _o_result = (void*)m; return _o_result; @@ -154,9 +154,9 @@ void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) m->cmds = c; } -void Heap_REGTYP (Heap_Module m, uintptr typ) +void Heap_REGTYP (Heap_Module m, address typ) { - __PUT(typ, m->types, uintptr); + __PUT(typ, m->types, address); m->types = typ; } @@ -165,17 +165,17 @@ void Heap_INCREF (Heap_Module m) m->refcnt += 1; } -static uintptr Heap_NewChunk (uintptr blksz) +static address Heap_NewChunk (address blksz) { - uintptr _o_result; - uintptr chnk; + address _o_result; + address chnk; chnk = Heap_OSAllocate(blksz + 12); if (chnk != 0) { - __PUT(chnk + 4, chnk + (12 + blksz), uintptr); - __PUT(chnk + 12, chnk + 16, uintptr); - __PUT(chnk + 16, blksz, uintptr); - __PUT(chnk + 20, -4, uintptr); - __PUT(chnk + 24, Heap_bigBlocks, uintptr); + __PUT(chnk + 4, chnk + (12 + blksz), address); + __PUT(chnk + 12, chnk + 16, address); + __PUT(chnk + 16, blksz, address); + __PUT(chnk + 20, -4, address); + __PUT(chnk + 24, Heap_bigBlocks, address); Heap_bigBlocks = chnk + 12; Heap_heapsize += blksz; } @@ -183,9 +183,9 @@ static uintptr Heap_NewChunk (uintptr blksz) return _o_result; } -static void Heap_ExtendHeap (uintptr blksz) +static void Heap_ExtendHeap (address blksz) { - uintptr size, chnk, j, next; + address size, chnk, j, next; if (blksz > 160000) { size = blksz; } else { @@ -194,7 +194,7 @@ static void Heap_ExtendHeap (uintptr blksz) chnk = Heap_NewChunk(size); if (chnk != 0) { if (chnk < Heap_heap) { - __PUT(chnk, Heap_heap, uintptr); + __PUT(chnk, Heap_heap, address); Heap_heap = chnk; } else { j = Heap_heap; @@ -203,8 +203,8 @@ static void Heap_ExtendHeap (uintptr blksz) j = next; next = Heap_FetchAddress(j); } - __PUT(chnk, next, uintptr); - __PUT(j, chnk, uintptr); + __PUT(chnk, next, address); + __PUT(j, chnk, address); } if (next == 0) { Heap_heapend = Heap_FetchAddress(chnk + 4); @@ -212,10 +212,10 @@ static void Heap_ExtendHeap (uintptr blksz) } } -SYSTEM_PTR Heap_NEWREC (uintptr tag) +SYSTEM_PTR Heap_NEWREC (address tag) { SYSTEM_PTR _o_result; - uintptr i, i0, di, blksz, restsize, t, adr, end, next, prev; + address i, i0, di, blksz, restsize, t, adr, end, next, prev; SYSTEM_PTR new; Heap_Lock(); blksz = Heap_FetchAddress(tag); @@ -235,11 +235,11 @@ SYSTEM_PTR Heap_NEWREC (uintptr tag) di = i - i0; restsize = __ASHL(di, 4); end = adr + restsize; - __PUT(end + 4, blksz, uintptr); - __PUT(end + 8, -4, uintptr); - __PUT(end, end + 4, uintptr); - __PUT(adr + 4, restsize, uintptr); - __PUT(adr + 12, Heap_freeList[di], uintptr); + __PUT(end + 4, blksz, address); + __PUT(end + 8, -4, address); + __PUT(end, end + 4, address); + __PUT(adr + 4, restsize, address); + __PUT(adr + 12, Heap_freeList[di], address); Heap_freeList[di] = adr; adr += restsize; } @@ -279,22 +279,22 @@ SYSTEM_PTR Heap_NEWREC (uintptr tag) } restsize = t - blksz; end = adr + restsize; - __PUT(end + 4, blksz, uintptr); - __PUT(end + 8, -4, uintptr); - __PUT(end, end + 4, uintptr); + __PUT(end + 4, blksz, address); + __PUT(end + 8, -4, address); + __PUT(end, end + 4, address); if (restsize > 144) { - __PUT(adr + 4, restsize, uintptr); + __PUT(adr + 4, restsize, address); } else { next = Heap_FetchAddress(adr + 12); if (prev == 0) { Heap_bigBlocks = next; } else { - __PUT(prev + 12, next, uintptr); + __PUT(prev + 12, next, address); } if (restsize > 0) { di = __ASHR(restsize, 4); - __PUT(adr + 4, restsize, uintptr); - __PUT(adr + 12, Heap_freeList[di], uintptr); + __PUT(adr + 4, restsize, address); + __PUT(adr + 12, Heap_freeList[di], address); Heap_freeList[di] = adr; } } @@ -303,53 +303,53 @@ SYSTEM_PTR Heap_NEWREC (uintptr tag) i = adr + 16; end = adr + blksz; while (i < end) { - __PUT(i, 0, uintptr); - __PUT(i + 4, 0, uintptr); - __PUT(i + 8, 0, uintptr); - __PUT(i + 12, 0, uintptr); + __PUT(i, 0, address); + __PUT(i + 4, 0, address); + __PUT(i + 8, 0, address); + __PUT(i + 12, 0, address); i += 16; } - __PUT(adr + 12, 0, uintptr); - __PUT(adr, tag, uintptr); - __PUT(adr + 4, 0, uintptr); - __PUT(adr + 8, 0, uintptr); + __PUT(adr + 12, 0, address); + __PUT(adr, tag, address); + __PUT(adr + 4, 0, address); + __PUT(adr + 8, 0, address); Heap_allocated += blksz; Heap_Unlock(); - _o_result = (SYSTEM_PTR)(uintptr)(adr + 4); + _o_result = (SYSTEM_PTR)(address)(adr + 4); return _o_result; } -SYSTEM_PTR Heap_NEWBLK (uintptr size) +SYSTEM_PTR Heap_NEWBLK (address size) { SYSTEM_PTR _o_result; - uintptr blksz, tag; + address blksz, tag; SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 31, 4), 4); - new = Heap_NEWREC((uintptr)&blksz); - tag = ((uintptr)(uintptr)new + blksz) - 12; - __PUT(tag - 4, 0, uintptr); - __PUT(tag, blksz, uintptr); - __PUT(tag + 4, -4, uintptr); - __PUT((uintptr)(uintptr)new - 4, tag, uintptr); + new = Heap_NEWREC((address)&blksz); + tag = ((address)(address)new + blksz) - 12; + __PUT(tag - 4, 0, address); + __PUT(tag, blksz, address); + __PUT(tag + 4, -4, address); + __PUT((address)(address)new - 4, tag, address); Heap_Unlock(); _o_result = new; return _o_result; } -static void Heap_Mark (uintptr q) +static void Heap_Mark (address q) { - uintptr p, tag, offset, fld, n, tagbits; + address p, tag, offset, fld, n, tagbits; if (q != 0) { tagbits = Heap_FetchAddress(q - 4); if (!__ODD(tagbits)) { - __PUT(q - 4, tagbits + 1, uintptr); + __PUT(q - 4, tagbits + 1, address); p = 0; tag = tagbits + 4; for (;;) { - __GET(tag, offset, uintptr); - if (__BIT((uintptr)&offset, 31)) { - __PUT(q - 4, (tag + offset) + 1, uintptr); + __GET(tag, offset, address); + if (__BIT((address)&offset, 31)) { + __PUT(q - 4, (tag + offset) + 1, address); if (p == 0) { break; } @@ -357,19 +357,19 @@ static void Heap_Mark (uintptr q) q = p; tag = Heap_FetchAddress(q - 4); tag -= 1; - __GET(tag, offset, uintptr); + __GET(tag, offset, address); fld = q + offset; p = Heap_FetchAddress(fld); - __PUT(fld, (SYSTEM_PTR)(uintptr)n, SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(address)n, SYSTEM_PTR); } else { fld = q + offset; n = Heap_FetchAddress(fld); if (n != 0) { tagbits = Heap_FetchAddress(n - 4); if (!__ODD(tagbits)) { - __PUT(n - 4, tagbits + 1, uintptr); - __PUT(q - 4, tag + 1, uintptr); - __PUT(fld, (SYSTEM_PTR)(uintptr)p, SYSTEM_PTR); + __PUT(n - 4, tagbits + 1, address); + __PUT(q - 4, tag + 1, address); + __PUT(fld, (SYSTEM_PTR)(address)p, SYSTEM_PTR); p = q; q = n; tag = tagbits; @@ -384,12 +384,12 @@ static void Heap_Mark (uintptr q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((uintptr)(uintptr)p); + Heap_Mark((address)(address)p); } static void Heap_Scan (void) { - uintptr chnk, adr, end, start, tag, i, size, freesize; + address chnk, adr, end, start, tag, i, size, freesize; Heap_bigBlocks = 0; i = 1; while (i < 9) { @@ -407,21 +407,21 @@ static void Heap_Scan (void) if (__ODD(tag)) { if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 4, uintptr); - __PUT(start + 4, freesize, uintptr); - __PUT(start + 8, -4, uintptr); + __PUT(start, start + 4, address); + __PUT(start + 4, freesize, address); + __PUT(start + 8, -4, address); i = __ASHR(freesize, 4); freesize = 0; if (i < 9) { - __PUT(start + 12, Heap_freeList[i], uintptr); + __PUT(start + 12, Heap_freeList[i], address); Heap_freeList[i] = start; } else { - __PUT(start + 12, Heap_bigBlocks, uintptr); + __PUT(start + 12, Heap_bigBlocks, address); Heap_bigBlocks = start; } } tag -= 1; - __PUT(adr, tag, uintptr); + __PUT(adr, tag, address); size = Heap_FetchAddress(tag); Heap_allocated += size; adr += size; @@ -433,16 +433,16 @@ static void Heap_Scan (void) } if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 4, uintptr); - __PUT(start + 4, freesize, uintptr); - __PUT(start + 8, -4, uintptr); + __PUT(start, start + 4, address); + __PUT(start + 4, freesize, address); + __PUT(start + 8, -4, address); i = __ASHR(freesize, 4); freesize = 0; if (i < 9) { - __PUT(start + 12, Heap_freeList[i], uintptr); + __PUT(start + 12, Heap_freeList[i], address); Heap_freeList[i] = start; } else { - __PUT(start + 12, Heap_bigBlocks, uintptr); + __PUT(start + 12, Heap_bigBlocks, address); Heap_bigBlocks = start; } } @@ -450,9 +450,9 @@ static void Heap_Scan (void) } } -static void Heap_Sift (uintptr l, uintptr r, uintptr *a, LONGINT a__len) +static void Heap_Sift (address l, address r, address *a, LONGINT a__len) { - uintptr i, j, x; + address i, j, x; j = l; x = a[j]; for (;;) { @@ -469,9 +469,9 @@ static void Heap_Sift (uintptr l, uintptr r, uintptr *a, LONGINT a__len) a[i] = x; } -static void Heap_HeapSort (uintptr n, uintptr *a, LONGINT a__len) +static void Heap_HeapSort (address n, address *a, LONGINT a__len) { - uintptr l, r, x; + address l, r, x; l = __ASHR(n, 1); r = n - 1; while (l > 0) { @@ -487,9 +487,9 @@ static void Heap_HeapSort (uintptr n, uintptr *a, LONGINT a__len) } } -static void Heap_MarkCandidates (uintptr n, uintptr *cand, LONGINT cand__len) +static void Heap_MarkCandidates (address n, address *cand, LONGINT cand__len) { - uintptr chnk, adr, tag, next, lim, lim1, i, ptr, size; + address chnk, adr, tag, next, lim, lim1, i, ptr, size; chnk = Heap_heap; i = 0; lim = cand[n - 1]; @@ -527,7 +527,7 @@ static void Heap_MarkCandidates (uintptr n, uintptr *cand, LONGINT cand__len) static void Heap_CheckFin (void) { Heap_FinNode n; - uintptr tag; + address tag; n = Heap_fin; while (n != NIL) { tag = Heap_FetchAddress(n->obj - 4); @@ -553,7 +553,7 @@ static void Heap_Finalize (void) } else { prev->next = n->next; } - (*n->finalize)((SYSTEM_PTR)(uintptr)n->obj); + (*n->finalize)((SYSTEM_PTR)(address)n->obj); if (prev == NIL) { n = Heap_fin; } else { @@ -572,14 +572,14 @@ void Heap_FINALL (void) while (Heap_fin != NIL) { n = Heap_fin; Heap_fin = Heap_fin->next; - (*n->finalize)((SYSTEM_PTR)(uintptr)n->obj); + (*n->finalize)((SYSTEM_PTR)(address)n->obj); } } -static void Heap_MarkStack (uintptr n, uintptr *cand, LONGINT cand__len) +static void Heap_MarkStack (address n, address *cand, LONGINT cand__len) { SYSTEM_PTR frame; - uintptr inc, nofcand, sp, p, stack0; + address inc, nofcand, sp, p, stack0; struct Heap__1 align; if (n > 0) { Heap_MarkStack(n - 1, cand, cand__len); @@ -589,14 +589,14 @@ static void Heap_MarkStack (uintptr n, uintptr *cand, LONGINT cand__len) } if (n == 0) { nofcand = 0; - sp = (uintptr)&frame; + sp = (address)&frame; stack0 = Heap_PlatformMainStackFrame(); - inc = (uintptr)&align.p - (uintptr)&align; + inc = (address)&align.p - (address)&align; if (sp > stack0) { inc = -inc; } while (sp != stack0) { - __GET(sp, p, uintptr); + __GET(sp, p, address); if ((p > Heap_heap && p < Heap_heapend)) { if (nofcand == cand__len) { Heap_HeapSort(nofcand, (void*)cand, cand__len); @@ -618,11 +618,11 @@ static void Heap_MarkStack (uintptr n, uintptr *cand, LONGINT cand__len) void Heap_GC (BOOLEAN markStack) { Heap_Module m; - uintptr i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; - uintptr cand[10000]; + address i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; + address cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); - m = (Heap_Module)(uintptr)Heap_modules; + m = (Heap_Module)(address)Heap_modules; while (m != NIL) { if (m->enumPtrs != NIL) { (*m->enumPtrs)(Heap_MarkP); @@ -699,7 +699,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (uintptr)(uintptr)obj; + f->obj = (address)(address)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; @@ -710,7 +710,7 @@ void Heap_InitHeap (void) { Heap_heap = Heap_NewChunk(128000); Heap_heapend = Heap_FetchAddress(Heap_heap + 4); - __PUT(Heap_heap, 0, uintptr); + __PUT(Heap_heap, 0, address); Heap_allocated = 0; Heap_firstTry = 1; Heap_freeList[9] = 1; diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index 771fc9d8..ca1d8e95 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h @@ -31,7 +31,7 @@ typedef import SYSTEM_PTR Heap_modules; -import uintptr Heap_allocated, Heap_heapsize; +import address Heap_allocated, Heap_heapsize; import int16 Heap_FileCount; import LONGINT *Heap_ModuleDesc__typ; @@ -41,11 +41,11 @@ import void Heap_GC (BOOLEAN markStack); import void Heap_INCREF (Heap_Module m); import void Heap_InitHeap (void); import void Heap_Lock (void); -import SYSTEM_PTR Heap_NEWBLK (uintptr size); -import SYSTEM_PTR Heap_NEWREC (uintptr tag); +import SYSTEM_PTR Heap_NEWBLK (address size); +import SYSTEM_PTR Heap_NEWREC (address tag); import void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); import SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -import void Heap_REGTYP (Heap_Module m, uintptr typ); +import void Heap_REGTYP (Heap_Module m, address typ); import void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); import void Heap_Unlock (void); import void *Heap__init(void); diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index 84914960..fab3561e 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Heap.h" diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index 2409c160..13abd6d0 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index 07797236..1d0b8774 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index 47603929..465ba585 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 8949813a..b702852c 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "OPM.h" @@ -200,8 +200,8 @@ void OPC_Ident (OPT_Object obj) } } } else if ((mode == 5 && obj->typ->form == 4)) { - if (obj->typ == OPT_pinttyp) { - OPM_WriteString((CHAR*)"uintptr", 8); + if (obj->typ == OPT_adrtyp) { + OPM_WriteString((CHAR*)"address", 8); } else { OPM_WriteString((CHAR*)"int", 4); OPM_WriteInt(__ASHL(obj->typ->size, 3)); @@ -2047,7 +2047,7 @@ static void OPC_InitKeywords (void) OPC_hashtab[__X(i, 105)] = -1; i += 1; } - Enter__49((CHAR*)"adrint", 7); + Enter__49((CHAR*)"address", 8); Enter__49((CHAR*)"asm", 4); Enter__49((CHAR*)"auto", 5); Enter__49((CHAR*)"break", 6); @@ -2084,7 +2084,6 @@ static void OPC_InitKeywords (void) Enter__49((CHAR*)"struct", 7); Enter__49((CHAR*)"switch", 7); Enter__49((CHAR*)"typedef", 8); - Enter__49((CHAR*)"uintptr", 8); Enter__49((CHAR*)"uint16", 7); Enter__49((CHAR*)"uint32", 7); Enter__49((CHAR*)"uint64", 7); diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index a13d99e4..2839fb0f 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 1cd8fb97..70121d63 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" @@ -544,15 +544,15 @@ void OPM_FPrintReal (int32 *fp, REAL real) { int16 i; int32 l; - __GET((uintptr)&real, l, int32); + __GET((address)&real, l, int32); OPM_FPrint(&*fp, l); } void OPM_FPrintLReal (int32 *fp, LONGREAL lr) { int32 l, h; - __GET((uintptr)&lr, l, int32); - __GET((uintptr)&lr + 4, h, int32); + __GET((address)&lr, l, int32); + __GET((address)&lr + 4, h, int32); OPM_FPrint(&*fp, l); OPM_FPrint(&*fp, h); } diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index f0a96a82..fce4bdd3 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index f727dcde..dc286221 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPB.h" #include "OPM.h" diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index b8787f9f..e79b5819 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index 7a14e8c2..b90cb34b 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index 0e48367c..347c669a 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index f151a183..ccfba447 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" @@ -83,7 +83,7 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; -export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_pinttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; export int8 OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; @@ -1767,7 +1767,7 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_sinttyp); P(OPT_inttyp); P(OPT_linttyp); - P(OPT_pinttyp); + P(OPT_adrtyp); P(OPT_int8typ); P(OPT_int16typ); P(OPT_int32typ); @@ -1849,7 +1849,7 @@ export void *OPT__init(void) OPT_InitStruct(&OPT_niltyp, 9); OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp); OPT_EnterTyp((CHAR*)"PTR", 11, OPM_PointerSize, &OPT_sysptrtyp); - OPT_EnterTyp((CHAR*)"UINTPTR", 4, OPM_PointerSize, &OPT_pinttyp); + OPT_EnterTyp((CHAR*)"ADDRESS", 4, OPM_PointerSize, &OPT_adrtyp); OPT_EnterTyp((CHAR*)"INT8", 4, 1, &OPT_int8typ); OPT_EnterTyp((CHAR*)"INT16", 4, 2, &OPT_int16typ); OPT_EnterTyp((CHAR*)"INT32", 4, 4, &OPT_int32typ); diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index 41a1b2e4..ce146e6f 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h @@ -67,7 +67,7 @@ typedef import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; -import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_pinttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; import int8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index 4272132e..da9a8429 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPC.h" #include "OPM.h" @@ -285,7 +285,7 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_realtyp->strobj->linkadr = 2; OPT_inttyp->strobj->linkadr = 2; OPT_linttyp->strobj->linkadr = 2; - OPT_pinttyp->strobj->linkadr = 2; + OPT_adrtyp->strobj->linkadr = 2; OPT_int8typ->strobj->linkadr = 2; OPT_int16typ->strobj->linkadr = 2; OPT_int32typ->strobj->linkadr = 2; @@ -938,7 +938,7 @@ static void OPV_expr (OPT_Node n, int16 prec) OPM_Write(')'); break; case 24: - OPM_WriteString((CHAR*)"(uintptr)", 10); + OPM_WriteString((CHAR*)"(address)", 10); if (l->class == 1) { OPC_CompleteIdent(l->obj); } else { @@ -954,7 +954,7 @@ static void OPV_expr (OPT_Node n, int16 prec) OPC_Ident(n->typ->strobj); OPM_Write(')'); if (__IN(n->typ->form, 0x1800) || __IN(l->typ->form, 0x1800)) { - OPM_WriteString((CHAR*)"(uintptr)", 10); + OPM_WriteString((CHAR*)"(address)", 10); } OPV_expr(l, exprPrec); } else { @@ -1326,7 +1326,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) if (x->class == 7) { OPC_IntLiteral(x->conval->intval, OPM_PointerSize); } else { - OPM_WriteString((CHAR*)"((uintptr)(", 12); + OPM_WriteString((CHAR*)"((address)(", 12); OPV_expr(x, 10); OPM_WriteString((CHAR*)"))", 3); } diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index d45ee079..600b19bd 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index f7f6f6b6..056a333c 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef @@ -26,12 +26,12 @@ typedef export BOOLEAN Platform_LittleEndian; -export uintptr Platform_MainStackFrame; +export address Platform_MainStackFrame; export int32 Platform_HaltCode; export int16 Platform_PID; export CHAR Platform_CWD[256]; export int16 Platform_ArgCount; -export uintptr Platform_ArgVector; +export address Platform_ArgVector; static Platform_HaltProcedure Platform_HaltHandler; static int32 Platform_TimeStart; export int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; @@ -59,16 +59,16 @@ export void Platform_Halt (int32 code); export int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, LONGINT *identity__typ); export int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); export BOOLEAN Platform_Inaccessible (int16 e); -export void Platform_Init (int16 argc, int32 argvadr); +export void Platform_Init (int16 argc, address argvadr); export void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); export int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); export BOOLEAN Platform_NoSuchDirectory (int16 e); -export uintptr Platform_OSAllocate (uintptr size); -export void Platform_OSFree (uintptr address); +export address Platform_OSAllocate (address size); +export void Platform_OSFree (address address); export int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); export int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); -export int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n); -export int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n); +export int16 Platform_Read (int32 h, address p, address l, address *n); +export int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, address *n); export int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); export BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); export BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); @@ -87,7 +87,7 @@ export BOOLEAN Platform_TimedOut (int16 e); export BOOLEAN Platform_TooManyFiles (int16 e); export int16 Platform_Truncate (int32 h, int32 l); export int16 Platform_Unlink (CHAR *n, LONGINT n__len); -export int16 Platform_Write (int32 h, int32 p, int32 l); +export int16 Platform_Write (int32 h, address p, address l); static void Platform_YMDHMStoClock (int32 ye, int32 mo, int32 da, int32 ho, int32 mi, int32 se, int32 *t, int32 *d); static void Platform_errch (CHAR c); static void Platform_errint (int32 l); @@ -119,7 +119,7 @@ export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT #define Platform_EXDEV() EXDEV extern void Heap_InitHeap(); #define Platform_HeapInitHeap() Heap_InitHeap() -#define Platform_allocate(size) (uintptr)((void*)malloc((size_t)size)) +#define Platform_allocate(size) (address)((void*)malloc((size_t)size)) #define Platform_chdir(n, n__len) chdir((char*)n) #define Platform_closefile(fd) close(fd) #define Platform_err() errno @@ -139,13 +139,13 @@ extern void Heap_InitHeap(); #define Platform_opennew(n, n__len) open((char*)n, O_CREAT | O_TRUNC | O_RDWR, 0664) #define Platform_openro(n, n__len) open((char*)n, O_RDONLY) #define Platform_openrw(n, n__len) open((char*)n, O_RDWR) -#define Platform_readfile(fd, p, l) read(fd, (void*)(uintptr)(p), l) +#define Platform_readfile(fd, p, l) read(fd, (void*)(address)(p), l) #define Platform_rename(o, o__len, n, n__len) rename((char*)o, (char*)n) #define Platform_sectotm(s) struct tm *time = localtime((time_t*)&s) #define Platform_seekcur() SEEK_CUR #define Platform_seekend() SEEK_END #define Platform_seekset() SEEK_SET -#define Platform_sethandler(s, h) SystemSetHandler(s, (uintptr)h) +#define Platform_sethandler(s, h) SystemSetHandler(s, (address)h) #define Platform_stat(n, n__len) stat((char*)n, &s) #define Platform_statdev() (LONGINT)s.st_dev #define Platform_statino() (LONGINT)s.st_ino @@ -162,7 +162,7 @@ extern void Heap_InitHeap(); #define Platform_tvsec() tv.tv_sec #define Platform_tvusec() tv.tv_usec #define Platform_unlink(n, n__len) unlink((char*)n) -#define Platform_writefile(fd, p, l) write(fd, (void*)(uintptr)(p), l) +#define Platform_writefile(fd, p, l) write(fd, (void*)(address)(p), l) BOOLEAN Platform_TooManyFiles (int16 e) { @@ -213,24 +213,24 @@ BOOLEAN Platform_ConnectionFailed (int16 e) return _o_result; } -uintptr Platform_OSAllocate (uintptr size) +address Platform_OSAllocate (address size) { - uintptr _o_result; + address _o_result; _o_result = Platform_allocate(size); return _o_result; } -void Platform_OSFree (uintptr address) +void Platform_OSFree (address address) { Platform_free(address); } -void Platform_Init (int16 argc, int32 argvadr) +void Platform_Init (int16 argc, address argvadr) { Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; Platform_ArgCount = argc; - av = (Platform_ArgVecPtr)(uintptr)argvadr; + av = (Platform_ArgVecPtr)(address)argvadr; Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; Platform_HeapInitHeap(); @@ -263,7 +263,7 @@ void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { - av = (Platform_ArgVec)(uintptr)Platform_ArgVector; + av = (Platform_ArgVec)(address)Platform_ArgVector; __COPY(*(*av)[__X(n, 1024)], val, val__len); } } @@ -512,7 +512,7 @@ int16 Platform_Size (int32 h, int32 *l) return _o_result; } -int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n) +int16 Platform_Read (int32 h, address p, address l, address *n) { int16 _o_result; *n = Platform_readfile(h, p, l); @@ -527,10 +527,10 @@ int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n) __RETCHK; } -int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n) +int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, address *n) { int16 _o_result; - *n = Platform_readfile(h, (uintptr)b, b__len); + *n = Platform_readfile(h, (address)b, b__len); if (*n < 0) { *n = 0; _o_result = Platform_err(); @@ -542,10 +542,10 @@ int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n) __RETCHK; } -int16 Platform_Write (int32 h, int32 p, int32 l) +int16 Platform_Write (int32 h, address p, address l) { int16 _o_result; - int32 written; + address written; written = Platform_writefile(h, p, l); if (written < 0) { _o_result = Platform_err(); @@ -650,7 +650,6 @@ static void Platform_errch (CHAR c) static void Platform_errln (void) { - Platform_errch(0x0d); Platform_errch(0x0a); } @@ -766,7 +765,7 @@ static void Platform_TestLittleEndian (void) { int16 i; i = 1; - __GET((uintptr)&i, Platform_LittleEndian, BOOLEAN); + __GET((address)&i, Platform_LittleEndian, BOOLEAN); } __TDESC(Platform_FileIdentity, 1, 0) = {__TDFLDS("FileIdentity", 12), {-4}}; diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index bed97db3..ab1d3003 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h @@ -18,12 +18,12 @@ typedef import BOOLEAN Platform_LittleEndian; -import uintptr Platform_MainStackFrame; +import address Platform_MainStackFrame; import int32 Platform_HaltCode; import int16 Platform_PID; import CHAR Platform_CWD[256]; import int16 Platform_ArgCount; -import uintptr Platform_ArgVector; +import address Platform_ArgVector; import int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; import CHAR Platform_nl[3]; @@ -48,16 +48,16 @@ import void Platform_Halt (int32 code); import int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, LONGINT *identity__typ); import int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); import BOOLEAN Platform_Inaccessible (int16 e); -import void Platform_Init (int16 argc, int32 argvadr); +import void Platform_Init (int16 argc, address argvadr); import void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); import int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); import BOOLEAN Platform_NoSuchDirectory (int16 e); -import uintptr Platform_OSAllocate (uintptr size); -import void Platform_OSFree (uintptr address); +import address Platform_OSAllocate (address size); +import void Platform_OSFree (address address); import int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); import int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); -import int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n); -import int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n); +import int16 Platform_Read (int32 h, address p, address l, address *n); +import int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, address *n); import int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); import BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); import BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); @@ -75,7 +75,7 @@ import BOOLEAN Platform_TimedOut (int16 e); import BOOLEAN Platform_TooManyFiles (int16 e); import int16 Platform_Truncate (int32 h, int32 l); import int16 Platform_Unlink (CHAR *n, LONGINT n__len); -import int16 Platform_Write (int32 h, int32 p, int32 l); +import int16 Platform_Write (int32 h, address p, address l); import BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); import void *Platform__init(void); diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 32931aec..8fe37010 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -58,7 +58,7 @@ int16 Reals_Expo (REAL x) { int16 _o_result; int16 i; - __GET((uintptr)&x + 2, i, int16); + __GET((address)&x + 2, i, int16); _o_result = __MASK(__ASHR(i, 7), -256); return _o_result; } @@ -66,17 +66,17 @@ int16 Reals_Expo (REAL x) void Reals_SetExpo (REAL *x, int16 ex) { CHAR c; - __GET((uintptr)x + 3, c, CHAR); - __PUT((uintptr)x + 3, (CHAR)(__ASHL(__ASHR((int16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); - __GET((uintptr)x + 2, c, CHAR); - __PUT((uintptr)x + 2, (CHAR)(__MASK((int16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); + __GET((address)x + 3, c, CHAR); + __PUT((address)x + 3, (CHAR)(__ASHL(__ASHR((int16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __GET((address)x + 2, c, CHAR); + __PUT((address)x + 2, (CHAR)(__MASK((int16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } int16 Reals_ExpoL (LONGREAL x) { int16 _o_result; int16 i; - __GET((uintptr)&x + 6, i, int16); + __GET((address)&x + 6, i, int16); _o_result = __MASK(__ASHR(i, 4), -2048); return _o_result; } diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index 38d206bb..9ebc1c17 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/SYSTEM.c b/bootstrap/unix-48/SYSTEM.c index 16681ab8..821a6096 100644 --- a/bootstrap/unix-48/SYSTEM.c +++ b/bootstrap/unix-48/SYSTEM.c @@ -38,7 +38,7 @@ void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0) void SYSTEM_ENUMP(void *adr, LONGINT n, void (*P)()) { while (n > 0) { - P((uintptr)(*((void**)(adr)))); + P((address)(*((void**)(adr)))); adr = ((void**)adr) + 1; n--; } @@ -51,7 +51,7 @@ void SYSTEM_ENUMR(void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()) while (n > 0) { t = typ; off = *t; - while (off >= 0) {P(*(uintptr*)((char*)adr+off)); t++; off = *t;} + while (off >= 0) {P(*(address*)((char*)adr+off)); t++; off = *t;} adr = ((char*)adr) + size; n--; } @@ -109,7 +109,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, else if (typ == (LONGINT*)POINTER__typ) { /* element type is a pointer */ x = Heap_NEWBLK(size + nofelems * sizeof(LONGINT)); - p = (LONGINT*)(uintptr)x[-1]; + p = (LONGINT*)(address)x[-1]; p[-nofelems] = *p; /* build new type desc in situ: 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nofelems - 1; n = 1; /* n =1 for skipping the size field */ while (n <= nofelems) {*p = n*sizeof(LONGINT); p++; n++;} @@ -122,7 +122,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, while (ptab[nofptrs] >= 0) {nofptrs++;} /* number of pointers per element */ nptr = nofelems * nofptrs; /* total number of pointers */ x = Heap_NEWBLK(size + nptr * sizeof(LONGINT)); - p = (LONGINT*)(uintptr)x[- 1]; + p = (LONGINT*)(address)x[- 1]; p[-nptr] = *p; /* build new type desc in situ; 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nptr - 1; n = 0; off = dataoff; while (n < nofelems) {i = 0; @@ -158,7 +158,7 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler // (Ignore other signals) } - void SystemSetHandler(int s, uintptr h) { + void SystemSetHandler(int s, address h) { if (s >= 2 && s <= 4) { int needtosetsystemhandler = handler[s-2] == 0; handler[s-2] = (SystemSignalHandler)h; @@ -197,12 +197,12 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler } } - void SystemSetInterruptHandler(uintptr h) { + void SystemSetInterruptHandler(address h) { EnsureConsoleCtrlHandler(); SystemInterruptHandler = (SystemSignalHandler)h; } - void SystemSetQuitHandler(uintptr h) { + void SystemSetQuitHandler(address h) { EnsureConsoleCtrlHandler(); SystemQuitHandler = (SystemSignalHandler)h; } diff --git a/bootstrap/unix-48/SYSTEM.h b/bootstrap/unix-48/SYSTEM.h index e7b38a26..8c6c335e 100644 --- a/bootstrap/unix-48/SYSTEM.h +++ b/bootstrap/unix-48/SYSTEM.h @@ -39,7 +39,7 @@ typedef unsigned short int uint16; typedef signed char int8; typedef unsigned char uint8; -#define uintptr size_t +#define address size_t // The compiler uses 'import' and 'export' which translate to 'extern' and // nothing respectively. @@ -53,7 +53,7 @@ typedef unsigned char uint8; #define NIL ((void*)0) #define __MAXEXT 16 -#define POINTER__typ ((uintptr*)(1)) // not NIL and not a valid type +#define POINTER__typ ((address*)(1)) // not NIL and not a valid type // Oberon types @@ -98,8 +98,8 @@ typedef void* SYSTEM_PTR; // OS Memory allocation interfaces are in PlatformXXX.Mod -extern uintptr Platform_OSAllocate (uintptr size); -extern void Platform_OSFree (uintptr addr); +extern address Platform_OSAllocate (address size); +extern void Platform_OSFree (address addr); // Run time system routines in SYSTEM.c @@ -120,10 +120,10 @@ extern LONGINT SYSTEM_ENTIER (double x); // Signal handling in SYSTEM.c #ifndef _WIN32 - extern void SystemSetHandler(int s, uintptr h); + extern void SystemSetHandler(int s, address h); #else - extern void SystemSetInterruptHandler(uintptr h); - extern void SystemSetQuitHandler (uintptr h); + extern void SystemSetInterruptHandler(address h); + extern void SystemSetQuitHandler (address h); #endif @@ -146,9 +146,9 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __COPY(s, d, n) {char*_a=(void*)s,*_b=(void*)d; LONGINT _i=0,_t=n-1; \ while(_i<_t&&((_b[_i]=_a[_i])!=0)){_i++;};_b[_i]=0;} -#define __DUP(x, l, t) x=(void*)memcpy((void*)(uintptr)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) +#define __DUP(x, l, t) x=(void*)memcpy((void*)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) #define __DUPARR(v, t) v=(void*)memcpy(v##__copy,v,sizeof(t)) -#define __DEL(x) Platform_OSFree((LONGINT)(uintptr)x) +#define __DEL(x) Platform_OSFree((address)x) // Index and range checks @@ -165,8 +165,8 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __VAL(t, x) (*(t*)&(x)) -#define __GET(a, x, t) x= *(t*)(uintptr)(a) -#define __PUT(a, x, t) *(t*)(uintptr)(a)=x +#define __GET(a, x, t) x= *(t*)(address)(a) +#define __PUT(a, x, t) *(t*)(address)(a)=x #define __LSHL(x, n, t) ((t)((u##t)(x)<<(n))) #define __LSHR(x, n, t) ((t)((u##t)(x)>>(n))) @@ -182,7 +182,7 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __ASHF(x, n) SYSTEM_ASH((LONGINT)(x), (LONGINT)(n)) #define __BIT(x, n) (*(uint64*)(x)>>(n)&1) -#define __MOVE(s, d, n) memcpy((char*)(uintptr)(d),(char*)(uintptr)(s),n) +#define __MOVE(s, d, n) memcpy((char*)(address)(d),(char*)(address)(s),n) #define __SHORT(x, y) ((int)((uLONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) #define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) #define __CHR(x) ((CHAR)__R(x, 256)) @@ -235,10 +235,10 @@ extern void Heap_INCREF(); // Main module initialisation, registration and finalisation -extern void Platform_Init(INTEGER argc, LONGINT argv); +extern void Platform_Init(INTEGER argc, address argv); extern void Heap_FINALL(); -#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (LONGINT)(uintptr)&argv); +#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (address)&argv); #define __REGMAIN(name, enum) m = Heap_REGMOD((CHAR*)name,enum) #define __FINI Heap_FINALL(); return 0 @@ -254,12 +254,12 @@ extern void Platform_AssertFail(LONGINT x); // Memory allocation -extern SYSTEM_PTR Heap_NEWBLK (uintptr size); -extern SYSTEM_PTR Heap_NEWREC (uintptr tag); +extern SYSTEM_PTR Heap_NEWBLK (address size); +extern SYSTEM_PTR Heap_NEWREC (address tag); extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __SYSNEW(p, len) p = Heap_NEWBLK((LONGINT)(len)) -#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(uintptr)t##__typ) +#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(address)t##__typ) #define __NEWARR SYSTEM_NEWARR @@ -290,20 +290,20 @@ extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __INITYP(t, t0, level) \ t##__typ = (LONGINT*)&t##__desc.blksz; \ memcpy(t##__desc.basep, t0##__typ - __BASEOFF, level*sizeof(LONGINT)); \ - t##__desc.basep[level] = (LONGINT)(uintptr)t##__typ; \ - t##__desc.module = (LONGINT)(uintptr)m; \ + t##__desc.basep[level] = (LONGINT)(address)t##__typ; \ + t##__desc.module = (LONGINT)(address)m; \ if(t##__desc.blksz!=sizeof(struct t)) __HALT(-15); \ t##__desc.blksz = (t##__desc.blksz+5*sizeof(LONGINT)-1)/(4*sizeof(LONGINT))*(4*sizeof(LONGINT)); \ - Heap_REGTYP(m, (LONGINT)(uintptr)&t##__desc.next); \ + Heap_REGTYP(m, (LONGINT)(address)&t##__desc.next); \ SYSTEM_INHERIT(t##__typ, t0##__typ) -#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(uintptr)typ##__typ) -#define __TYPEOF(p) ((LONGINT*)(uintptr)(*(((LONGINT*)(p))-1))) +#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(address)typ##__typ) +#define __TYPEOF(p) ((LONGINT*)(address)(*(((LONGINT*)(p))-1))) #define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) // Oberon-2 type bound procedures support -#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(uintptr)proc -#define __SEND(typ, num, funtyp, parlist) ((funtyp)((uintptr)*(typ-(__TPROC0OFF+num))))parlist +#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(address)proc +#define __SEND(typ, num, funtyp, parlist) ((funtyp)((address)*(typ-(__TPROC0OFF+num))))parlist diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index 728d163f..a642190c 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index 6e1bcc56..f537406e 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index 343d9491..b218c1b0 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Files.h" #include "Modules.h" diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index 776889ff..3174aa9b 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/Vishap.c b/bootstrap/unix-48/Vishap.c index f2e2ae7d..81b2d70f 100644 --- a/bootstrap/unix-48/Vishap.c +++ b/bootstrap/unix-48/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkamSf */ #include "SYSTEM.h" #include "Configuration.h" #include "Heap.h" @@ -81,7 +81,7 @@ static void Vishap_PropagateElementaryTypeSizes (void) OPT_realtyp->size = OPM_RealSize; OPT_inttyp->size = OPM_IntSize; OPT_linttyp->size = OPM_LIntSize; - OPT_pinttyp->size = OPM_PointerSize; + OPT_adrtyp->size = OPM_PointerSize; OPT_lrltyp->size = OPM_LRealSize; OPT_sinttyp->size = OPM_SIntSize; OPT_booltyp->size = OPM_BoolSize; diff --git a/bootstrap/unix-48/errors.c b/bootstrap/unix-48/errors.c index 0dc0c60a..a5576d43 100644 --- a/bootstrap/unix-48/errors.c +++ b/bootstrap/unix-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/unix-48/errors.h b/bootstrap/unix-48/errors.h index 4415a5f2..696219d4 100644 --- a/bootstrap/unix-48/errors.h +++ b/bootstrap/unix-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index 6a7aab56..553a3d7d 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index 4e806a33..ba9937e8 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/vt100.c b/bootstrap/unix-48/vt100.c index 447b9c81..ab305ed1 100644 --- a/bootstrap/unix-48/vt100.c +++ b/bootstrap/unix-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Strings.h" diff --git a/bootstrap/unix-48/vt100.h b/bootstrap/unix-48/vt100.h index 3d9d98a7..71079dc0 100644 --- a/bootstrap/unix-48/vt100.h +++ b/bootstrap/unix-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index b1d34288..c0502177 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -14,6 +14,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/03] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/04] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index 5fbd4f23..73002e87 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Console.c b/bootstrap/unix-88/Console.c index b285b3ec..13a36e69 100644 --- a/bootstrap/unix-88/Console.c +++ b/bootstrap/unix-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Platform.h" @@ -22,7 +22,7 @@ export void Console_String (CHAR *s, LONGINT s__len); void Console_Flush (void) { int32 error; - error = Platform_Write(1, (uintptr)Console_line, Console_pos); + error = Platform_Write(1, (address)Console_line, Console_pos); Console_pos = 0; } diff --git a/bootstrap/unix-88/Console.h b/bootstrap/unix-88/Console.h index 51684091..bcf5714f 100644 --- a/bootstrap/unix-88/Console.h +++ b/bootstrap/unix-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 14855929..0633202c 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -258,7 +258,7 @@ static void Files_Flush (Files_Buffer buf) if (buf->org != f->pos) { error = Platform_Seek(f->fd, buf->org, Platform_SeekSet); } - error = Platform_Write(f->fd, (uintptr)buf->data, buf->size); + error = Platform_Write(f->fd, (address)buf->data, buf->size); if (error != 0) { Files_Err((CHAR*)"error writing file", 19, f, error); } @@ -657,7 +657,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x } else { min = n; } - __MOVE((uintptr)buf->data + offset, (uintptr)x + xpos, min); + __MOVE((address)buf->data + offset, (address)x + xpos, min); offset += min; (*r).offset = offset; xpos += min; @@ -722,7 +722,7 @@ void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT } else { min = n; } - __MOVE((uintptr)x + xpos, (uintptr)buf->data + offset, min); + __MOVE((address)x + xpos, (address)buf->data + offset, min); offset += min; (*r).offset = offset; if (offset > buf->size) { @@ -773,15 +773,15 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int *res = 3; return; } - error = Platform_Read(fdold, (uintptr)buf, 4096, &n); + error = Platform_Read(fdold, (address)buf, 4096, &n); while (n > 0) { - error = Platform_Write(fdnew, (uintptr)buf, n); + error = Platform_Write(fdnew, (address)buf, n); if (error != 0) { ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); Files_Err((CHAR*)"cannot move file", 17, NIL, error); } - error = Platform_Read(fdold, (uintptr)buf, 4096, &n); + error = Platform_Read(fdold, (address)buf, 4096, &n); } ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); @@ -839,7 +839,7 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *de j += 1; } } else { - __MOVE((uintptr)src, (uintptr)dest, src__len); + __MOVE((address)src, (address)dest, src__len); } } @@ -1009,7 +1009,7 @@ static void Files_Finalize (SYSTEM_PTR o) { Files_File f = NIL; int64 res; - f = (Files_File)(uintptr)o; + f = (Files_File)(address)o; if (f->fd >= 0) { Files_CloseOSFile(f); if (f->tempFile) { @@ -1022,7 +1022,7 @@ void Files_SetSearchPath (CHAR *path, LONGINT path__len) { __DUP(path, path__len, CHAR); if (Strings_Length(path, path__len) != 0) { - Files_SearchPath = __NEWARR(NIL, 1, 1, 1, 1, ((uintptr)((Strings_Length(path, path__len) + 1)))); + Files_SearchPath = __NEWARR(NIL, 1, 1, 1, 1, ((address)((Strings_Length(path, path__len) + 1)))); __COPY(path, Files_SearchPath->data, Files_SearchPath->len[0]); } else { Files_SearchPath = NIL; diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index fb2ef55f..340af571 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index 6712b853..b5749b04 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tskSfF */ #define LARGE #include "SYSTEM.h" @@ -35,7 +35,7 @@ typedef typedef struct Heap_FinDesc { Heap_FinNode next; - uintptr obj; + address obj; BOOLEAN marked; Heap_Finalizer finalize; } Heap_FinDesc; @@ -52,19 +52,19 @@ typedef Heap_ModuleName name; int64 refcnt; Heap_Cmd cmds; - uintptr types; + address types; Heap_EnumProc enumPtrs; int64 reserved1, reserved2; } Heap_ModuleDesc; export SYSTEM_PTR Heap_modules; -static uintptr Heap_freeList[10]; -static uintptr Heap_bigBlocks; -export uintptr Heap_allocated; +static address Heap_freeList[10]; +static address Heap_bigBlocks; +export address Heap_allocated; static BOOLEAN Heap_firstTry; -static uintptr Heap_heap, Heap_heapend; -export uintptr Heap_heapsize; +static address Heap_heap, Heap_heapend; +export address Heap_heapsize; static Heap_FinNode Heap_fin; static int32 Heap_lockdepth; static BOOLEAN Heap_interrupted; @@ -76,33 +76,33 @@ export LONGINT *Heap_FinDesc__typ; export LONGINT *Heap__1__typ; static void Heap_CheckFin (void); -static void Heap_ExtendHeap (uintptr blksz); +static void Heap_ExtendHeap (address blksz); export void Heap_FINALL (void); static void Heap_Finalize (void); export void Heap_GC (BOOLEAN markStack); -static void Heap_HeapSort (uintptr n, uintptr *a, LONGINT a__len); +static void Heap_HeapSort (address n, address *a, LONGINT a__len); export void Heap_INCREF (Heap_Module m); export void Heap_InitHeap (void); export void Heap_Lock (void); -static void Heap_Mark (uintptr q); -static void Heap_MarkCandidates (uintptr n, uintptr *cand, LONGINT cand__len); +static void Heap_Mark (address q); +static void Heap_MarkCandidates (address n, address *cand, LONGINT cand__len); static void Heap_MarkP (SYSTEM_PTR p); -static void Heap_MarkStack (uintptr n, uintptr *cand, LONGINT cand__len); -export SYSTEM_PTR Heap_NEWBLK (uintptr size); -export SYSTEM_PTR Heap_NEWREC (uintptr tag); -static uintptr Heap_NewChunk (uintptr blksz); +static void Heap_MarkStack (address n, address *cand, LONGINT cand__len); +export SYSTEM_PTR Heap_NEWBLK (address size); +export SYSTEM_PTR Heap_NEWREC (address tag); +static address Heap_NewChunk (address blksz); export void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); export SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -export void Heap_REGTYP (Heap_Module m, uintptr typ); +export void Heap_REGTYP (Heap_Module m, address typ); export void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); static void Heap_Scan (void); -static void Heap_Sift (uintptr l, uintptr r, uintptr *a, LONGINT a__len); +static void Heap_Sift (address l, address r, address *a, LONGINT a__len); export void Heap_Unlock (void); extern void *Heap__init(); -extern uintptr Platform_MainStackFrame; -extern uintptr Platform_OSAllocate(uintptr size); -#define Heap_FetchAddress(pointer) (uintptr)(*((void**)((uintptr)pointer))) +extern address Platform_MainStackFrame; +extern address Platform_OSAllocate(address size); +#define Heap_FetchAddress(pointer) (address)(*((void**)((address)pointer))) #define Heap_HeapModuleInit() Heap__init() #define Heap_OSAllocate(size) Platform_OSAllocate(size) #define Heap_PlatformHalt(code) Platform_Halt(code) @@ -135,7 +135,7 @@ SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) __COPY(name, m->name, 20); m->refcnt = 0; m->enumPtrs = enumPtrs; - m->next = (Heap_Module)(uintptr)Heap_modules; + m->next = (Heap_Module)(address)Heap_modules; Heap_modules = (SYSTEM_PTR)m; _o_result = (void*)m; return _o_result; @@ -155,9 +155,9 @@ void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) m->cmds = c; } -void Heap_REGTYP (Heap_Module m, uintptr typ) +void Heap_REGTYP (Heap_Module m, address typ) { - __PUT(typ, m->types, uintptr); + __PUT(typ, m->types, address); m->types = typ; } @@ -166,17 +166,17 @@ void Heap_INCREF (Heap_Module m) m->refcnt += 1; } -static uintptr Heap_NewChunk (uintptr blksz) +static address Heap_NewChunk (address blksz) { - uintptr _o_result; - uintptr chnk; + address _o_result; + address chnk; chnk = Heap_OSAllocate(blksz + 24); if (chnk != 0) { - __PUT(chnk + 8, chnk + (24 + blksz), uintptr); - __PUT(chnk + 24, chnk + 32, uintptr); - __PUT(chnk + 32, blksz, uintptr); - __PUT(chnk + 40, -8, uintptr); - __PUT(chnk + 48, Heap_bigBlocks, uintptr); + __PUT(chnk + 8, chnk + (24 + blksz), address); + __PUT(chnk + 24, chnk + 32, address); + __PUT(chnk + 32, blksz, address); + __PUT(chnk + 40, -8, address); + __PUT(chnk + 48, Heap_bigBlocks, address); Heap_bigBlocks = chnk + 24; Heap_heapsize += blksz; } @@ -184,9 +184,9 @@ static uintptr Heap_NewChunk (uintptr blksz) return _o_result; } -static void Heap_ExtendHeap (uintptr blksz) +static void Heap_ExtendHeap (address blksz) { - uintptr size, chnk, j, next; + address size, chnk, j, next; if (blksz > 320000) { size = blksz; } else { @@ -195,7 +195,7 @@ static void Heap_ExtendHeap (uintptr blksz) chnk = Heap_NewChunk(size); if (chnk != 0) { if (chnk < Heap_heap) { - __PUT(chnk, Heap_heap, uintptr); + __PUT(chnk, Heap_heap, address); Heap_heap = chnk; } else { j = Heap_heap; @@ -204,8 +204,8 @@ static void Heap_ExtendHeap (uintptr blksz) j = next; next = Heap_FetchAddress(j); } - __PUT(chnk, next, uintptr); - __PUT(j, chnk, uintptr); + __PUT(chnk, next, address); + __PUT(j, chnk, address); } if (next == 0) { Heap_heapend = Heap_FetchAddress(chnk + 8); @@ -213,10 +213,10 @@ static void Heap_ExtendHeap (uintptr blksz) } } -SYSTEM_PTR Heap_NEWREC (uintptr tag) +SYSTEM_PTR Heap_NEWREC (address tag) { SYSTEM_PTR _o_result; - uintptr i, i0, di, blksz, restsize, t, adr, end, next, prev; + address i, i0, di, blksz, restsize, t, adr, end, next, prev; SYSTEM_PTR new; Heap_Lock(); blksz = Heap_FetchAddress(tag); @@ -236,11 +236,11 @@ SYSTEM_PTR Heap_NEWREC (uintptr tag) di = i - i0; restsize = __ASHL(di, 5); end = adr + restsize; - __PUT(end + 8, blksz, uintptr); - __PUT(end + 16, -8, uintptr); - __PUT(end, end + 8, uintptr); - __PUT(adr + 8, restsize, uintptr); - __PUT(adr + 24, Heap_freeList[di], uintptr); + __PUT(end + 8, blksz, address); + __PUT(end + 16, -8, address); + __PUT(end, end + 8, address); + __PUT(adr + 8, restsize, address); + __PUT(adr + 24, Heap_freeList[di], address); Heap_freeList[di] = adr; adr += restsize; } @@ -280,22 +280,22 @@ SYSTEM_PTR Heap_NEWREC (uintptr tag) } restsize = t - blksz; end = adr + restsize; - __PUT(end + 8, blksz, uintptr); - __PUT(end + 16, -8, uintptr); - __PUT(end, end + 8, uintptr); + __PUT(end + 8, blksz, address); + __PUT(end + 16, -8, address); + __PUT(end, end + 8, address); if (restsize > 288) { - __PUT(adr + 8, restsize, uintptr); + __PUT(adr + 8, restsize, address); } else { next = Heap_FetchAddress(adr + 24); if (prev == 0) { Heap_bigBlocks = next; } else { - __PUT(prev + 24, next, uintptr); + __PUT(prev + 24, next, address); } if (restsize > 0) { di = __ASHR(restsize, 5); - __PUT(adr + 8, restsize, uintptr); - __PUT(adr + 24, Heap_freeList[di], uintptr); + __PUT(adr + 8, restsize, address); + __PUT(adr + 24, Heap_freeList[di], address); Heap_freeList[di] = adr; } } @@ -304,53 +304,53 @@ SYSTEM_PTR Heap_NEWREC (uintptr tag) i = adr + 32; end = adr + blksz; while (i < end) { - __PUT(i, 0, uintptr); - __PUT(i + 8, 0, uintptr); - __PUT(i + 16, 0, uintptr); - __PUT(i + 24, 0, uintptr); + __PUT(i, 0, address); + __PUT(i + 8, 0, address); + __PUT(i + 16, 0, address); + __PUT(i + 24, 0, address); i += 32; } - __PUT(adr + 24, 0, uintptr); - __PUT(adr, tag, uintptr); - __PUT(adr + 8, 0, uintptr); - __PUT(adr + 16, 0, uintptr); + __PUT(adr + 24, 0, address); + __PUT(adr, tag, address); + __PUT(adr + 8, 0, address); + __PUT(adr + 16, 0, address); Heap_allocated += blksz; Heap_Unlock(); - _o_result = (SYSTEM_PTR)(uintptr)(adr + 8); + _o_result = (SYSTEM_PTR)(address)(adr + 8); return _o_result; } -SYSTEM_PTR Heap_NEWBLK (uintptr size) +SYSTEM_PTR Heap_NEWBLK (address size) { SYSTEM_PTR _o_result; - uintptr blksz, tag; + address blksz, tag; SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 63, 5), 5); - new = Heap_NEWREC((uintptr)&blksz); - tag = ((uintptr)(uintptr)new + blksz) - 24; - __PUT(tag - 8, 0, uintptr); - __PUT(tag, blksz, uintptr); - __PUT(tag + 8, -8, uintptr); - __PUT((uintptr)(uintptr)new - 8, tag, uintptr); + new = Heap_NEWREC((address)&blksz); + tag = ((address)(address)new + blksz) - 24; + __PUT(tag - 8, 0, address); + __PUT(tag, blksz, address); + __PUT(tag + 8, -8, address); + __PUT((address)(address)new - 8, tag, address); Heap_Unlock(); _o_result = new; return _o_result; } -static void Heap_Mark (uintptr q) +static void Heap_Mark (address q) { - uintptr p, tag, offset, fld, n, tagbits; + address p, tag, offset, fld, n, tagbits; if (q != 0) { tagbits = Heap_FetchAddress(q - 8); if (!__ODD(tagbits)) { - __PUT(q - 8, tagbits + 1, uintptr); + __PUT(q - 8, tagbits + 1, address); p = 0; tag = tagbits + 8; for (;;) { - __GET(tag, offset, uintptr); - if (__BIT((uintptr)&offset, 63)) { - __PUT(q - 8, (tag + offset) + 1, uintptr); + __GET(tag, offset, address); + if (__BIT((address)&offset, 63)) { + __PUT(q - 8, (tag + offset) + 1, address); if (p == 0) { break; } @@ -358,19 +358,19 @@ static void Heap_Mark (uintptr q) q = p; tag = Heap_FetchAddress(q - 8); tag -= 1; - __GET(tag, offset, uintptr); + __GET(tag, offset, address); fld = q + offset; p = Heap_FetchAddress(fld); - __PUT(fld, (SYSTEM_PTR)(uintptr)n, SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(address)n, SYSTEM_PTR); } else { fld = q + offset; n = Heap_FetchAddress(fld); if (n != 0) { tagbits = Heap_FetchAddress(n - 8); if (!__ODD(tagbits)) { - __PUT(n - 8, tagbits + 1, uintptr); - __PUT(q - 8, tag + 1, uintptr); - __PUT(fld, (SYSTEM_PTR)(uintptr)p, SYSTEM_PTR); + __PUT(n - 8, tagbits + 1, address); + __PUT(q - 8, tag + 1, address); + __PUT(fld, (SYSTEM_PTR)(address)p, SYSTEM_PTR); p = q; q = n; tag = tagbits; @@ -385,12 +385,12 @@ static void Heap_Mark (uintptr q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((uintptr)(uintptr)p); + Heap_Mark((address)(address)p); } static void Heap_Scan (void) { - uintptr chnk, adr, end, start, tag, i, size, freesize; + address chnk, adr, end, start, tag, i, size, freesize; Heap_bigBlocks = 0; i = 1; while (i < 9) { @@ -408,21 +408,21 @@ static void Heap_Scan (void) if (__ODD(tag)) { if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 8, uintptr); - __PUT(start + 8, freesize, uintptr); - __PUT(start + 16, -8, uintptr); + __PUT(start, start + 8, address); + __PUT(start + 8, freesize, address); + __PUT(start + 16, -8, address); i = __ASHR(freesize, 5); freesize = 0; if (i < 9) { - __PUT(start + 24, Heap_freeList[i], uintptr); + __PUT(start + 24, Heap_freeList[i], address); Heap_freeList[i] = start; } else { - __PUT(start + 24, Heap_bigBlocks, uintptr); + __PUT(start + 24, Heap_bigBlocks, address); Heap_bigBlocks = start; } } tag -= 1; - __PUT(adr, tag, uintptr); + __PUT(adr, tag, address); size = Heap_FetchAddress(tag); Heap_allocated += size; adr += size; @@ -434,16 +434,16 @@ static void Heap_Scan (void) } if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 8, uintptr); - __PUT(start + 8, freesize, uintptr); - __PUT(start + 16, -8, uintptr); + __PUT(start, start + 8, address); + __PUT(start + 8, freesize, address); + __PUT(start + 16, -8, address); i = __ASHR(freesize, 5); freesize = 0; if (i < 9) { - __PUT(start + 24, Heap_freeList[i], uintptr); + __PUT(start + 24, Heap_freeList[i], address); Heap_freeList[i] = start; } else { - __PUT(start + 24, Heap_bigBlocks, uintptr); + __PUT(start + 24, Heap_bigBlocks, address); Heap_bigBlocks = start; } } @@ -451,9 +451,9 @@ static void Heap_Scan (void) } } -static void Heap_Sift (uintptr l, uintptr r, uintptr *a, LONGINT a__len) +static void Heap_Sift (address l, address r, address *a, LONGINT a__len) { - uintptr i, j, x; + address i, j, x; j = l; x = a[j]; for (;;) { @@ -470,9 +470,9 @@ static void Heap_Sift (uintptr l, uintptr r, uintptr *a, LONGINT a__len) a[i] = x; } -static void Heap_HeapSort (uintptr n, uintptr *a, LONGINT a__len) +static void Heap_HeapSort (address n, address *a, LONGINT a__len) { - uintptr l, r, x; + address l, r, x; l = __ASHR(n, 1); r = n - 1; while (l > 0) { @@ -488,9 +488,9 @@ static void Heap_HeapSort (uintptr n, uintptr *a, LONGINT a__len) } } -static void Heap_MarkCandidates (uintptr n, uintptr *cand, LONGINT cand__len) +static void Heap_MarkCandidates (address n, address *cand, LONGINT cand__len) { - uintptr chnk, adr, tag, next, lim, lim1, i, ptr, size; + address chnk, adr, tag, next, lim, lim1, i, ptr, size; chnk = Heap_heap; i = 0; lim = cand[n - 1]; @@ -528,7 +528,7 @@ static void Heap_MarkCandidates (uintptr n, uintptr *cand, LONGINT cand__len) static void Heap_CheckFin (void) { Heap_FinNode n; - uintptr tag; + address tag; n = Heap_fin; while (n != NIL) { tag = Heap_FetchAddress(n->obj - 8); @@ -554,7 +554,7 @@ static void Heap_Finalize (void) } else { prev->next = n->next; } - (*n->finalize)((SYSTEM_PTR)(uintptr)n->obj); + (*n->finalize)((SYSTEM_PTR)(address)n->obj); if (prev == NIL) { n = Heap_fin; } else { @@ -573,14 +573,14 @@ void Heap_FINALL (void) while (Heap_fin != NIL) { n = Heap_fin; Heap_fin = Heap_fin->next; - (*n->finalize)((SYSTEM_PTR)(uintptr)n->obj); + (*n->finalize)((SYSTEM_PTR)(address)n->obj); } } -static void Heap_MarkStack (uintptr n, uintptr *cand, LONGINT cand__len) +static void Heap_MarkStack (address n, address *cand, LONGINT cand__len) { SYSTEM_PTR frame; - uintptr inc, nofcand, sp, p, stack0; + address inc, nofcand, sp, p, stack0; struct Heap__1 align; if (n > 0) { Heap_MarkStack(n - 1, cand, cand__len); @@ -590,14 +590,14 @@ static void Heap_MarkStack (uintptr n, uintptr *cand, LONGINT cand__len) } if (n == 0) { nofcand = 0; - sp = (uintptr)&frame; + sp = (address)&frame; stack0 = Heap_PlatformMainStackFrame(); - inc = (uintptr)&align.p - (uintptr)&align; + inc = (address)&align.p - (address)&align; if (sp > stack0) { inc = -inc; } while (sp != stack0) { - __GET(sp, p, uintptr); + __GET(sp, p, address); if ((p > Heap_heap && p < Heap_heapend)) { if (nofcand == cand__len) { Heap_HeapSort(nofcand, (void*)cand, cand__len); @@ -619,11 +619,11 @@ static void Heap_MarkStack (uintptr n, uintptr *cand, LONGINT cand__len) void Heap_GC (BOOLEAN markStack) { Heap_Module m; - uintptr i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; - uintptr cand[10000]; + address i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; + address cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); - m = (Heap_Module)(uintptr)Heap_modules; + m = (Heap_Module)(address)Heap_modules; while (m != NIL) { if (m->enumPtrs != NIL) { (*m->enumPtrs)(Heap_MarkP); @@ -700,7 +700,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (uintptr)(uintptr)obj; + f->obj = (address)(address)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; @@ -711,7 +711,7 @@ void Heap_InitHeap (void) { Heap_heap = Heap_NewChunk(256000); Heap_heapend = Heap_FetchAddress(Heap_heap + 8); - __PUT(Heap_heap, 0, uintptr); + __PUT(Heap_heap, 0, address); Heap_allocated = 0; Heap_firstTry = 1; Heap_freeList[9] = 1; diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index 82ba661b..b547af41 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h @@ -32,7 +32,7 @@ typedef import SYSTEM_PTR Heap_modules; -import uintptr Heap_allocated, Heap_heapsize; +import address Heap_allocated, Heap_heapsize; import int32 Heap_FileCount; import LONGINT *Heap_ModuleDesc__typ; @@ -42,11 +42,11 @@ import void Heap_GC (BOOLEAN markStack); import void Heap_INCREF (Heap_Module m); import void Heap_InitHeap (void); import void Heap_Lock (void); -import SYSTEM_PTR Heap_NEWBLK (uintptr size); -import SYSTEM_PTR Heap_NEWREC (uintptr tag); +import SYSTEM_PTR Heap_NEWBLK (address size); +import SYSTEM_PTR Heap_NEWREC (address tag); import void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); import SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -import void Heap_REGTYP (Heap_Module m, uintptr typ); +import void Heap_REGTYP (Heap_Module m, address typ); import void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); import void Heap_Unlock (void); import void *Heap__init(void); diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 7db3d54c..bce66b2e 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index fe368fa3..544820fd 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index 5ede35ed..1414fc79 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index 6b193164..718d88bb 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index d4a0fc06..fad896b9 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -201,8 +201,8 @@ void OPC_Ident (OPT_Object obj) } } } else if ((mode == 5 && obj->typ->form == 4)) { - if (obj->typ == OPT_pinttyp) { - OPM_WriteString((CHAR*)"uintptr", 8); + if (obj->typ == OPT_adrtyp) { + OPM_WriteString((CHAR*)"address", 8); } else { OPM_WriteString((CHAR*)"int", 4); OPM_WriteInt(__ASHL(obj->typ->size, 3)); @@ -2048,7 +2048,7 @@ static void OPC_InitKeywords (void) OPC_hashtab[__X(i, 105)] = -1; i += 1; } - Enter__49((CHAR*)"adrint", 7); + Enter__49((CHAR*)"address", 8); Enter__49((CHAR*)"asm", 4); Enter__49((CHAR*)"auto", 5); Enter__49((CHAR*)"break", 6); @@ -2085,7 +2085,6 @@ static void OPC_InitKeywords (void) Enter__49((CHAR*)"struct", 7); Enter__49((CHAR*)"switch", 7); Enter__49((CHAR*)"typedef", 8); - Enter__49((CHAR*)"uintptr", 8); Enter__49((CHAR*)"uint16", 7); Enter__49((CHAR*)"uint32", 7); Enter__49((CHAR*)"uint64", 7); diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index 90ff6275..ac5c7677 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 44c0d929..f410e6d3 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -545,7 +545,7 @@ void OPM_FPrintReal (int64 *fp, REAL real) { int32 i; int64 l; - __GET((uintptr)&real, i, int32); + __GET((address)&real, i, int32); l = i; OPM_FPrint(&*fp, l); } diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index 3e1ddd3d..cc77f079 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index 0ac463ca..6c3c14fe 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPB.h" diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index bd26983c..9aba4ad7 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index 5ae4fbdf..e0988fb0 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index 5fcf9030..1601514e 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index d5057c1d..c08c86af 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" @@ -84,7 +84,7 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; -export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_pinttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; export int8 OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; @@ -1768,7 +1768,7 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_sinttyp); P(OPT_inttyp); P(OPT_linttyp); - P(OPT_pinttyp); + P(OPT_adrtyp); P(OPT_int8typ); P(OPT_int16typ); P(OPT_int32typ); @@ -1850,7 +1850,7 @@ export void *OPT__init(void) OPT_InitStruct(&OPT_niltyp, 9); OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp); OPT_EnterTyp((CHAR*)"PTR", 11, OPM_PointerSize, &OPT_sysptrtyp); - OPT_EnterTyp((CHAR*)"UINTPTR", 4, OPM_PointerSize, &OPT_pinttyp); + OPT_EnterTyp((CHAR*)"ADDRESS", 4, OPM_PointerSize, &OPT_adrtyp); OPT_EnterTyp((CHAR*)"INT8", 4, 1, &OPT_int8typ); OPT_EnterTyp((CHAR*)"INT16", 4, 2, &OPT_int16typ); OPT_EnterTyp((CHAR*)"INT32", 4, 4, &OPT_int32typ); diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index aefdfd2a..f50911dd 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h @@ -68,7 +68,7 @@ typedef import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; -import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_pinttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; import int8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 7edc861b..b8c77e55 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPC.h" @@ -286,7 +286,7 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_realtyp->strobj->linkadr = 2; OPT_inttyp->strobj->linkadr = 2; OPT_linttyp->strobj->linkadr = 2; - OPT_pinttyp->strobj->linkadr = 2; + OPT_adrtyp->strobj->linkadr = 2; OPT_int8typ->strobj->linkadr = 2; OPT_int16typ->strobj->linkadr = 2; OPT_int32typ->strobj->linkadr = 2; @@ -939,7 +939,7 @@ static void OPV_expr (OPT_Node n, int32 prec) OPM_Write(')'); break; case 24: - OPM_WriteString((CHAR*)"(uintptr)", 10); + OPM_WriteString((CHAR*)"(address)", 10); if (l->class == 1) { OPC_CompleteIdent(l->obj); } else { @@ -955,7 +955,7 @@ static void OPV_expr (OPT_Node n, int32 prec) OPC_Ident(n->typ->strobj); OPM_Write(')'); if (__IN(n->typ->form, 0x1800) || __IN(l->typ->form, 0x1800)) { - OPM_WriteString((CHAR*)"(uintptr)", 10); + OPM_WriteString((CHAR*)"(address)", 10); } OPV_expr(l, exprPrec); } else { @@ -1327,7 +1327,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) if (x->class == 7) { OPC_IntLiteral(x->conval->intval, OPM_PointerSize); } else { - OPM_WriteString((CHAR*)"((uintptr)(", 12); + OPM_WriteString((CHAR*)"((address)(", 12); OPV_expr(x, 10); OPM_WriteString((CHAR*)"))", 3); } diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index 6e3e6c65..92c13a0a 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 7895f7e6..0aab8de3 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -27,12 +27,12 @@ typedef export BOOLEAN Platform_LittleEndian; -export uintptr Platform_MainStackFrame; +export address Platform_MainStackFrame; export int64 Platform_HaltCode; export int32 Platform_PID; export CHAR Platform_CWD[256]; export int32 Platform_ArgCount; -export uintptr Platform_ArgVector; +export address Platform_ArgVector; static Platform_HaltProcedure Platform_HaltHandler; static int64 Platform_TimeStart; export int32 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; @@ -60,16 +60,16 @@ export void Platform_Halt (int64 code); export int32 Platform_Identify (int64 h, Platform_FileIdentity *identity, LONGINT *identity__typ); export int32 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); export BOOLEAN Platform_Inaccessible (int32 e); -export void Platform_Init (int32 argc, int64 argvadr); +export void Platform_Init (int32 argc, address argvadr); export void Platform_MTimeAsClock (Platform_FileIdentity i, int64 *t, int64 *d); export int32 Platform_New (CHAR *n, LONGINT n__len, int64 *h); export BOOLEAN Platform_NoSuchDirectory (int32 e); -export uintptr Platform_OSAllocate (uintptr size); -export void Platform_OSFree (uintptr address); +export address Platform_OSAllocate (address size); +export void Platform_OSFree (address address); export int32 Platform_OldRO (CHAR *n, LONGINT n__len, int64 *h); export int32 Platform_OldRW (CHAR *n, LONGINT n__len, int64 *h); -export int32 Platform_Read (int64 h, int64 p, int64 l, int64 *n); -export int32 Platform_ReadBuf (int64 h, SYSTEM_BYTE *b, LONGINT b__len, int64 *n); +export int32 Platform_Read (int64 h, address p, address l, address *n); +export int32 Platform_ReadBuf (int64 h, SYSTEM_BYTE *b, LONGINT b__len, address *n); export int32 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); export BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); export BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); @@ -88,7 +88,7 @@ export BOOLEAN Platform_TimedOut (int32 e); export BOOLEAN Platform_TooManyFiles (int32 e); export int32 Platform_Truncate (int64 h, int64 l); export int32 Platform_Unlink (CHAR *n, LONGINT n__len); -export int32 Platform_Write (int64 h, int64 p, int64 l); +export int32 Platform_Write (int64 h, address p, address l); static void Platform_YMDHMStoClock (int64 ye, int64 mo, int64 da, int64 ho, int64 mi, int64 se, int64 *t, int64 *d); static void Platform_errch (CHAR c); static void Platform_errint (int64 l); @@ -120,7 +120,7 @@ export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT #define Platform_EXDEV() EXDEV extern void Heap_InitHeap(); #define Platform_HeapInitHeap() Heap_InitHeap() -#define Platform_allocate(size) (uintptr)((void*)malloc((size_t)size)) +#define Platform_allocate(size) (address)((void*)malloc((size_t)size)) #define Platform_chdir(n, n__len) chdir((char*)n) #define Platform_closefile(fd) close(fd) #define Platform_err() errno @@ -140,13 +140,13 @@ extern void Heap_InitHeap(); #define Platform_opennew(n, n__len) open((char*)n, O_CREAT | O_TRUNC | O_RDWR, 0664) #define Platform_openro(n, n__len) open((char*)n, O_RDONLY) #define Platform_openrw(n, n__len) open((char*)n, O_RDWR) -#define Platform_readfile(fd, p, l) read(fd, (void*)(uintptr)(p), l) +#define Platform_readfile(fd, p, l) read(fd, (void*)(address)(p), l) #define Platform_rename(o, o__len, n, n__len) rename((char*)o, (char*)n) #define Platform_sectotm(s) struct tm *time = localtime((time_t*)&s) #define Platform_seekcur() SEEK_CUR #define Platform_seekend() SEEK_END #define Platform_seekset() SEEK_SET -#define Platform_sethandler(s, h) SystemSetHandler(s, (uintptr)h) +#define Platform_sethandler(s, h) SystemSetHandler(s, (address)h) #define Platform_stat(n, n__len) stat((char*)n, &s) #define Platform_statdev() (LONGINT)s.st_dev #define Platform_statino() (LONGINT)s.st_ino @@ -163,7 +163,7 @@ extern void Heap_InitHeap(); #define Platform_tvsec() tv.tv_sec #define Platform_tvusec() tv.tv_usec #define Platform_unlink(n, n__len) unlink((char*)n) -#define Platform_writefile(fd, p, l) write(fd, (void*)(uintptr)(p), l) +#define Platform_writefile(fd, p, l) write(fd, (void*)(address)(p), l) BOOLEAN Platform_TooManyFiles (int32 e) { @@ -214,24 +214,24 @@ BOOLEAN Platform_ConnectionFailed (int32 e) return _o_result; } -uintptr Platform_OSAllocate (uintptr size) +address Platform_OSAllocate (address size) { - uintptr _o_result; + address _o_result; _o_result = Platform_allocate(size); return _o_result; } -void Platform_OSFree (uintptr address) +void Platform_OSFree (address address) { Platform_free(address); } -void Platform_Init (int32 argc, int64 argvadr) +void Platform_Init (int32 argc, address argvadr) { Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; Platform_ArgCount = argc; - av = (Platform_ArgVecPtr)(uintptr)argvadr; + av = (Platform_ArgVecPtr)(address)argvadr; Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; Platform_HeapInitHeap(); @@ -264,7 +264,7 @@ void Platform_GetArg (int32 n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { - av = (Platform_ArgVec)(uintptr)Platform_ArgVector; + av = (Platform_ArgVec)(address)Platform_ArgVector; __COPY(*(*av)[__X(n, 1024)], val, val__len); } } @@ -513,7 +513,7 @@ int32 Platform_Size (int64 h, int64 *l) return _o_result; } -int32 Platform_Read (int64 h, int64 p, int64 l, int64 *n) +int32 Platform_Read (int64 h, address p, address l, address *n) { int32 _o_result; *n = Platform_readfile(h, p, l); @@ -528,10 +528,10 @@ int32 Platform_Read (int64 h, int64 p, int64 l, int64 *n) __RETCHK; } -int32 Platform_ReadBuf (int64 h, SYSTEM_BYTE *b, LONGINT b__len, int64 *n) +int32 Platform_ReadBuf (int64 h, SYSTEM_BYTE *b, LONGINT b__len, address *n) { int32 _o_result; - *n = Platform_readfile(h, (uintptr)b, b__len); + *n = Platform_readfile(h, (address)b, b__len); if (*n < 0) { *n = 0; _o_result = Platform_err(); @@ -543,10 +543,10 @@ int32 Platform_ReadBuf (int64 h, SYSTEM_BYTE *b, LONGINT b__len, int64 *n) __RETCHK; } -int32 Platform_Write (int64 h, int64 p, int64 l) +int32 Platform_Write (int64 h, address p, address l) { int32 _o_result; - int64 written; + address written; written = Platform_writefile(h, p, l); if (written < 0) { _o_result = Platform_err(); @@ -651,7 +651,6 @@ static void Platform_errch (CHAR c) static void Platform_errln (void) { - Platform_errch(0x0d); Platform_errch(0x0a); } @@ -767,7 +766,7 @@ static void Platform_TestLittleEndian (void) { int32 i; i = 1; - __GET((uintptr)&i, Platform_LittleEndian, BOOLEAN); + __GET((address)&i, Platform_LittleEndian, BOOLEAN); } __TDESC(Platform_FileIdentity, 1, 0) = {__TDFLDS("FileIdentity", 24), {-8}}; diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index 7b310e29..324566bf 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h @@ -19,12 +19,12 @@ typedef import BOOLEAN Platform_LittleEndian; -import uintptr Platform_MainStackFrame; +import address Platform_MainStackFrame; import int64 Platform_HaltCode; import int32 Platform_PID; import CHAR Platform_CWD[256]; import int32 Platform_ArgCount; -import uintptr Platform_ArgVector; +import address Platform_ArgVector; import int32 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; import CHAR Platform_nl[3]; @@ -49,16 +49,16 @@ import void Platform_Halt (int64 code); import int32 Platform_Identify (int64 h, Platform_FileIdentity *identity, LONGINT *identity__typ); import int32 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); import BOOLEAN Platform_Inaccessible (int32 e); -import void Platform_Init (int32 argc, int64 argvadr); +import void Platform_Init (int32 argc, address argvadr); import void Platform_MTimeAsClock (Platform_FileIdentity i, int64 *t, int64 *d); import int32 Platform_New (CHAR *n, LONGINT n__len, int64 *h); import BOOLEAN Platform_NoSuchDirectory (int32 e); -import uintptr Platform_OSAllocate (uintptr size); -import void Platform_OSFree (uintptr address); +import address Platform_OSAllocate (address size); +import void Platform_OSFree (address address); import int32 Platform_OldRO (CHAR *n, LONGINT n__len, int64 *h); import int32 Platform_OldRW (CHAR *n, LONGINT n__len, int64 *h); -import int32 Platform_Read (int64 h, int64 p, int64 l, int64 *n); -import int32 Platform_ReadBuf (int64 h, SYSTEM_BYTE *b, LONGINT b__len, int64 *n); +import int32 Platform_Read (int64 h, address p, address l, address *n); +import int32 Platform_ReadBuf (int64 h, SYSTEM_BYTE *b, LONGINT b__len, address *n); import int32 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); import BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); import BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); @@ -76,7 +76,7 @@ import BOOLEAN Platform_TimedOut (int32 e); import BOOLEAN Platform_TooManyFiles (int32 e); import int32 Platform_Truncate (int64 h, int64 l); import int32 Platform_Unlink (CHAR *n, LONGINT n__len); -import int32 Platform_Write (int64 h, int64 p, int64 l); +import int32 Platform_Write (int64 h, address p, address l); import BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); import void *Platform__init(void); diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 4aafefde..80ca4829 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -59,7 +59,7 @@ int32 Reals_Expo (REAL x) { int32 _o_result; int32 i; - __GET((uintptr)&x + 2, i, int32); + __GET((address)&x + 2, i, int32); _o_result = __MASK(__ASHR(i, 7), -256); return _o_result; } @@ -67,17 +67,17 @@ int32 Reals_Expo (REAL x) void Reals_SetExpo (REAL *x, int32 ex) { CHAR c; - __GET((uintptr)x + 3, c, CHAR); - __PUT((uintptr)x + 3, (CHAR)(__ASHL(__ASHR(c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); - __GET((uintptr)x + 2, c, CHAR); - __PUT((uintptr)x + 2, (CHAR)(__MASK(c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); + __GET((address)x + 3, c, CHAR); + __PUT((address)x + 3, (CHAR)(__ASHL(__ASHR(c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __GET((address)x + 2, c, CHAR); + __PUT((address)x + 2, (CHAR)(__MASK(c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } int32 Reals_ExpoL (LONGREAL x) { int32 _o_result; int32 i; - __GET((uintptr)&x + 6, i, int32); + __GET((address)&x + 6, i, int32); _o_result = __MASK(__ASHR(i, 4), -2048); return _o_result; } diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index 1b6d1f96..da0c1f86 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/SYSTEM.c b/bootstrap/unix-88/SYSTEM.c index 16681ab8..821a6096 100644 --- a/bootstrap/unix-88/SYSTEM.c +++ b/bootstrap/unix-88/SYSTEM.c @@ -38,7 +38,7 @@ void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0) void SYSTEM_ENUMP(void *adr, LONGINT n, void (*P)()) { while (n > 0) { - P((uintptr)(*((void**)(adr)))); + P((address)(*((void**)(adr)))); adr = ((void**)adr) + 1; n--; } @@ -51,7 +51,7 @@ void SYSTEM_ENUMR(void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()) while (n > 0) { t = typ; off = *t; - while (off >= 0) {P(*(uintptr*)((char*)adr+off)); t++; off = *t;} + while (off >= 0) {P(*(address*)((char*)adr+off)); t++; off = *t;} adr = ((char*)adr) + size; n--; } @@ -109,7 +109,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, else if (typ == (LONGINT*)POINTER__typ) { /* element type is a pointer */ x = Heap_NEWBLK(size + nofelems * sizeof(LONGINT)); - p = (LONGINT*)(uintptr)x[-1]; + p = (LONGINT*)(address)x[-1]; p[-nofelems] = *p; /* build new type desc in situ: 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nofelems - 1; n = 1; /* n =1 for skipping the size field */ while (n <= nofelems) {*p = n*sizeof(LONGINT); p++; n++;} @@ -122,7 +122,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, while (ptab[nofptrs] >= 0) {nofptrs++;} /* number of pointers per element */ nptr = nofelems * nofptrs; /* total number of pointers */ x = Heap_NEWBLK(size + nptr * sizeof(LONGINT)); - p = (LONGINT*)(uintptr)x[- 1]; + p = (LONGINT*)(address)x[- 1]; p[-nptr] = *p; /* build new type desc in situ; 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nptr - 1; n = 0; off = dataoff; while (n < nofelems) {i = 0; @@ -158,7 +158,7 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler // (Ignore other signals) } - void SystemSetHandler(int s, uintptr h) { + void SystemSetHandler(int s, address h) { if (s >= 2 && s <= 4) { int needtosetsystemhandler = handler[s-2] == 0; handler[s-2] = (SystemSignalHandler)h; @@ -197,12 +197,12 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler } } - void SystemSetInterruptHandler(uintptr h) { + void SystemSetInterruptHandler(address h) { EnsureConsoleCtrlHandler(); SystemInterruptHandler = (SystemSignalHandler)h; } - void SystemSetQuitHandler(uintptr h) { + void SystemSetQuitHandler(address h) { EnsureConsoleCtrlHandler(); SystemQuitHandler = (SystemSignalHandler)h; } diff --git a/bootstrap/unix-88/SYSTEM.h b/bootstrap/unix-88/SYSTEM.h index e7b38a26..8c6c335e 100644 --- a/bootstrap/unix-88/SYSTEM.h +++ b/bootstrap/unix-88/SYSTEM.h @@ -39,7 +39,7 @@ typedef unsigned short int uint16; typedef signed char int8; typedef unsigned char uint8; -#define uintptr size_t +#define address size_t // The compiler uses 'import' and 'export' which translate to 'extern' and // nothing respectively. @@ -53,7 +53,7 @@ typedef unsigned char uint8; #define NIL ((void*)0) #define __MAXEXT 16 -#define POINTER__typ ((uintptr*)(1)) // not NIL and not a valid type +#define POINTER__typ ((address*)(1)) // not NIL and not a valid type // Oberon types @@ -98,8 +98,8 @@ typedef void* SYSTEM_PTR; // OS Memory allocation interfaces are in PlatformXXX.Mod -extern uintptr Platform_OSAllocate (uintptr size); -extern void Platform_OSFree (uintptr addr); +extern address Platform_OSAllocate (address size); +extern void Platform_OSFree (address addr); // Run time system routines in SYSTEM.c @@ -120,10 +120,10 @@ extern LONGINT SYSTEM_ENTIER (double x); // Signal handling in SYSTEM.c #ifndef _WIN32 - extern void SystemSetHandler(int s, uintptr h); + extern void SystemSetHandler(int s, address h); #else - extern void SystemSetInterruptHandler(uintptr h); - extern void SystemSetQuitHandler (uintptr h); + extern void SystemSetInterruptHandler(address h); + extern void SystemSetQuitHandler (address h); #endif @@ -146,9 +146,9 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __COPY(s, d, n) {char*_a=(void*)s,*_b=(void*)d; LONGINT _i=0,_t=n-1; \ while(_i<_t&&((_b[_i]=_a[_i])!=0)){_i++;};_b[_i]=0;} -#define __DUP(x, l, t) x=(void*)memcpy((void*)(uintptr)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) +#define __DUP(x, l, t) x=(void*)memcpy((void*)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) #define __DUPARR(v, t) v=(void*)memcpy(v##__copy,v,sizeof(t)) -#define __DEL(x) Platform_OSFree((LONGINT)(uintptr)x) +#define __DEL(x) Platform_OSFree((address)x) // Index and range checks @@ -165,8 +165,8 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __VAL(t, x) (*(t*)&(x)) -#define __GET(a, x, t) x= *(t*)(uintptr)(a) -#define __PUT(a, x, t) *(t*)(uintptr)(a)=x +#define __GET(a, x, t) x= *(t*)(address)(a) +#define __PUT(a, x, t) *(t*)(address)(a)=x #define __LSHL(x, n, t) ((t)((u##t)(x)<<(n))) #define __LSHR(x, n, t) ((t)((u##t)(x)>>(n))) @@ -182,7 +182,7 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __ASHF(x, n) SYSTEM_ASH((LONGINT)(x), (LONGINT)(n)) #define __BIT(x, n) (*(uint64*)(x)>>(n)&1) -#define __MOVE(s, d, n) memcpy((char*)(uintptr)(d),(char*)(uintptr)(s),n) +#define __MOVE(s, d, n) memcpy((char*)(address)(d),(char*)(address)(s),n) #define __SHORT(x, y) ((int)((uLONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) #define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) #define __CHR(x) ((CHAR)__R(x, 256)) @@ -235,10 +235,10 @@ extern void Heap_INCREF(); // Main module initialisation, registration and finalisation -extern void Platform_Init(INTEGER argc, LONGINT argv); +extern void Platform_Init(INTEGER argc, address argv); extern void Heap_FINALL(); -#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (LONGINT)(uintptr)&argv); +#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (address)&argv); #define __REGMAIN(name, enum) m = Heap_REGMOD((CHAR*)name,enum) #define __FINI Heap_FINALL(); return 0 @@ -254,12 +254,12 @@ extern void Platform_AssertFail(LONGINT x); // Memory allocation -extern SYSTEM_PTR Heap_NEWBLK (uintptr size); -extern SYSTEM_PTR Heap_NEWREC (uintptr tag); +extern SYSTEM_PTR Heap_NEWBLK (address size); +extern SYSTEM_PTR Heap_NEWREC (address tag); extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __SYSNEW(p, len) p = Heap_NEWBLK((LONGINT)(len)) -#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(uintptr)t##__typ) +#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(address)t##__typ) #define __NEWARR SYSTEM_NEWARR @@ -290,20 +290,20 @@ extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __INITYP(t, t0, level) \ t##__typ = (LONGINT*)&t##__desc.blksz; \ memcpy(t##__desc.basep, t0##__typ - __BASEOFF, level*sizeof(LONGINT)); \ - t##__desc.basep[level] = (LONGINT)(uintptr)t##__typ; \ - t##__desc.module = (LONGINT)(uintptr)m; \ + t##__desc.basep[level] = (LONGINT)(address)t##__typ; \ + t##__desc.module = (LONGINT)(address)m; \ if(t##__desc.blksz!=sizeof(struct t)) __HALT(-15); \ t##__desc.blksz = (t##__desc.blksz+5*sizeof(LONGINT)-1)/(4*sizeof(LONGINT))*(4*sizeof(LONGINT)); \ - Heap_REGTYP(m, (LONGINT)(uintptr)&t##__desc.next); \ + Heap_REGTYP(m, (LONGINT)(address)&t##__desc.next); \ SYSTEM_INHERIT(t##__typ, t0##__typ) -#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(uintptr)typ##__typ) -#define __TYPEOF(p) ((LONGINT*)(uintptr)(*(((LONGINT*)(p))-1))) +#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(address)typ##__typ) +#define __TYPEOF(p) ((LONGINT*)(address)(*(((LONGINT*)(p))-1))) #define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) // Oberon-2 type bound procedures support -#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(uintptr)proc -#define __SEND(typ, num, funtyp, parlist) ((funtyp)((uintptr)*(typ-(__TPROC0OFF+num))))parlist +#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(address)proc +#define __SEND(typ, num, funtyp, parlist) ((funtyp)((address)*(typ-(__TPROC0OFF+num))))parlist diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index abf00b3b..f240e3b4 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index 5280395c..88b212f1 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index e8858afa..59d184b4 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Files.h" diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index 990d15c3..d779d5d5 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/Vishap.c b/bootstrap/unix-88/Vishap.c index bed71868..7a2484a5 100644 --- a/bootstrap/unix-88/Vishap.c +++ b/bootstrap/unix-88/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkamSf */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -82,7 +82,7 @@ static void Vishap_PropagateElementaryTypeSizes (void) OPT_realtyp->size = OPM_RealSize; OPT_inttyp->size = OPM_IntSize; OPT_linttyp->size = OPM_LIntSize; - OPT_pinttyp->size = OPM_PointerSize; + OPT_adrtyp->size = OPM_PointerSize; OPT_lrltyp->size = OPM_LRealSize; OPT_sinttyp->size = OPM_SIntSize; OPT_booltyp->size = OPM_BoolSize; diff --git a/bootstrap/unix-88/errors.c b/bootstrap/unix-88/errors.c index 2f0938c0..1d7e852f 100644 --- a/bootstrap/unix-88/errors.c +++ b/bootstrap/unix-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/unix-88/errors.h b/bootstrap/unix-88/errors.h index c2bb7560..f917a7b6 100644 --- a/bootstrap/unix-88/errors.h +++ b/bootstrap/unix-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index b9d03b09..d656f5be 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index 30095155..1f0bb8e7 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/vt100.c b/bootstrap/unix-88/vt100.c index 5dd451e1..22698256 100644 --- a/bootstrap/unix-88/vt100.c +++ b/bootstrap/unix-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/unix-88/vt100.h b/bootstrap/unix-88/vt100.h index bcc323cc..f6c994fa 100644 --- a/bootstrap/unix-88/vt100.h +++ b/bootstrap/unix-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index 5cfd3bbe..560d018b 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -13,6 +13,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/03] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/04] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index 28ac1853..ac266eec 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Console.c b/bootstrap/windows-48/Console.c index c69949e1..5b34dfb9 100644 --- a/bootstrap/windows-48/Console.c +++ b/bootstrap/windows-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Platform.h" @@ -21,7 +21,7 @@ export void Console_String (CHAR *s, LONGINT s__len); void Console_Flush (void) { int16 error; - error = Platform_Write(Platform_StdOut, (uintptr)Console_line, Console_pos); + error = Platform_Write(Platform_StdOut, (address)Console_line, Console_pos); Console_pos = 0; } diff --git a/bootstrap/windows-48/Console.h b/bootstrap/windows-48/Console.h index 5f33afb3..fd32774b 100644 --- a/bootstrap/windows-48/Console.h +++ b/bootstrap/windows-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 308a2a37..0957fcfb 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" @@ -257,7 +257,7 @@ static void Files_Flush (Files_Buffer buf) if (buf->org != f->pos) { error = Platform_Seek(f->fd, buf->org, Platform_SeekSet); } - error = Platform_Write(f->fd, (uintptr)buf->data, buf->size); + error = Platform_Write(f->fd, (address)buf->data, buf->size); if (error != 0) { Files_Err((CHAR*)"error writing file", 19, f, error); } @@ -656,7 +656,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x } else { min = n; } - __MOVE((uintptr)buf->data + offset, (uintptr)x + xpos, min); + __MOVE((address)buf->data + offset, (address)x + xpos, min); offset += min; (*r).offset = offset; xpos += min; @@ -721,7 +721,7 @@ void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT } else { min = n; } - __MOVE((uintptr)x + xpos, (uintptr)buf->data + offset, min); + __MOVE((address)x + xpos, (address)buf->data + offset, min); offset += min; (*r).offset = offset; if (offset > buf->size) { @@ -772,15 +772,15 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int *res = 3; return; } - error = Platform_Read(fdold, (uintptr)buf, 4096, &n); + error = Platform_Read(fdold, (address)buf, 4096, &n); while (n > 0) { - error = Platform_Write(fdnew, (uintptr)buf, n); + error = Platform_Write(fdnew, (address)buf, n); if (error != 0) { ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); Files_Err((CHAR*)"cannot move file", 17, NIL, error); } - error = Platform_Read(fdold, (uintptr)buf, 4096, &n); + error = Platform_Read(fdold, (address)buf, 4096, &n); } ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); @@ -838,7 +838,7 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *de j += 1; } } else { - __MOVE((uintptr)src, (uintptr)dest, src__len); + __MOVE((address)src, (address)dest, src__len); } } @@ -1008,7 +1008,7 @@ static void Files_Finalize (SYSTEM_PTR o) { Files_File f = NIL; int32 res; - f = (Files_File)(uintptr)o; + f = (Files_File)(address)o; if (f->fd >= 0) { Files_CloseOSFile(f); if (f->tempFile) { @@ -1021,7 +1021,7 @@ void Files_SetSearchPath (CHAR *path, LONGINT path__len) { __DUP(path, path__len, CHAR); if (Strings_Length(path, path__len) != 0) { - Files_SearchPath = __NEWARR(NIL, 1, 1, 1, 1, ((uintptr)((Strings_Length(path, path__len) + 1)))); + Files_SearchPath = __NEWARR(NIL, 1, 1, 1, 1, ((address)((Strings_Length(path, path__len) + 1)))); __COPY(path, Files_SearchPath->data, Files_SearchPath->len[0]); } else { Files_SearchPath = NIL; diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index 41cd7233..01dff049 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index a003e797..02e6f1cb 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tskSfF */ #include "SYSTEM.h" struct Heap__1 { @@ -34,7 +34,7 @@ typedef typedef struct Heap_FinDesc { Heap_FinNode next; - uintptr obj; + address obj; BOOLEAN marked; Heap_Finalizer finalize; } Heap_FinDesc; @@ -51,19 +51,19 @@ typedef Heap_ModuleName name; int32 refcnt; Heap_Cmd cmds; - uintptr types; + address types; Heap_EnumProc enumPtrs; int32 reserved1, reserved2; } Heap_ModuleDesc; export SYSTEM_PTR Heap_modules; -static uintptr Heap_freeList[10]; -static uintptr Heap_bigBlocks; -export uintptr Heap_allocated; +static address Heap_freeList[10]; +static address Heap_bigBlocks; +export address Heap_allocated; static BOOLEAN Heap_firstTry; -static uintptr Heap_heap, Heap_heapend; -export uintptr Heap_heapsize; +static address Heap_heap, Heap_heapend; +export address Heap_heapsize; static Heap_FinNode Heap_fin; static int16 Heap_lockdepth; static BOOLEAN Heap_interrupted; @@ -75,33 +75,33 @@ export LONGINT *Heap_FinDesc__typ; export LONGINT *Heap__1__typ; static void Heap_CheckFin (void); -static void Heap_ExtendHeap (uintptr blksz); +static void Heap_ExtendHeap (address blksz); export void Heap_FINALL (void); static void Heap_Finalize (void); export void Heap_GC (BOOLEAN markStack); -static void Heap_HeapSort (uintptr n, uintptr *a, LONGINT a__len); +static void Heap_HeapSort (address n, address *a, LONGINT a__len); export void Heap_INCREF (Heap_Module m); export void Heap_InitHeap (void); export void Heap_Lock (void); -static void Heap_Mark (uintptr q); -static void Heap_MarkCandidates (uintptr n, uintptr *cand, LONGINT cand__len); +static void Heap_Mark (address q); +static void Heap_MarkCandidates (address n, address *cand, LONGINT cand__len); static void Heap_MarkP (SYSTEM_PTR p); -static void Heap_MarkStack (uintptr n, uintptr *cand, LONGINT cand__len); -export SYSTEM_PTR Heap_NEWBLK (uintptr size); -export SYSTEM_PTR Heap_NEWREC (uintptr tag); -static uintptr Heap_NewChunk (uintptr blksz); +static void Heap_MarkStack (address n, address *cand, LONGINT cand__len); +export SYSTEM_PTR Heap_NEWBLK (address size); +export SYSTEM_PTR Heap_NEWREC (address tag); +static address Heap_NewChunk (address blksz); export void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); export SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -export void Heap_REGTYP (Heap_Module m, uintptr typ); +export void Heap_REGTYP (Heap_Module m, address typ); export void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); static void Heap_Scan (void); -static void Heap_Sift (uintptr l, uintptr r, uintptr *a, LONGINT a__len); +static void Heap_Sift (address l, address r, address *a, LONGINT a__len); export void Heap_Unlock (void); extern void *Heap__init(); -extern uintptr Platform_MainStackFrame; -extern uintptr Platform_OSAllocate(uintptr size); -#define Heap_FetchAddress(pointer) (uintptr)(*((void**)((uintptr)pointer))) +extern address Platform_MainStackFrame; +extern address Platform_OSAllocate(address size); +#define Heap_FetchAddress(pointer) (address)(*((void**)((address)pointer))) #define Heap_HeapModuleInit() Heap__init() #define Heap_OSAllocate(size) Platform_OSAllocate(size) #define Heap_PlatformHalt(code) Platform_Halt(code) @@ -134,7 +134,7 @@ SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) __COPY(name, m->name, 20); m->refcnt = 0; m->enumPtrs = enumPtrs; - m->next = (Heap_Module)(uintptr)Heap_modules; + m->next = (Heap_Module)(address)Heap_modules; Heap_modules = (SYSTEM_PTR)m; _o_result = (void*)m; return _o_result; @@ -154,9 +154,9 @@ void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) m->cmds = c; } -void Heap_REGTYP (Heap_Module m, uintptr typ) +void Heap_REGTYP (Heap_Module m, address typ) { - __PUT(typ, m->types, uintptr); + __PUT(typ, m->types, address); m->types = typ; } @@ -165,17 +165,17 @@ void Heap_INCREF (Heap_Module m) m->refcnt += 1; } -static uintptr Heap_NewChunk (uintptr blksz) +static address Heap_NewChunk (address blksz) { - uintptr _o_result; - uintptr chnk; + address _o_result; + address chnk; chnk = Heap_OSAllocate(blksz + 12); if (chnk != 0) { - __PUT(chnk + 4, chnk + (12 + blksz), uintptr); - __PUT(chnk + 12, chnk + 16, uintptr); - __PUT(chnk + 16, blksz, uintptr); - __PUT(chnk + 20, -4, uintptr); - __PUT(chnk + 24, Heap_bigBlocks, uintptr); + __PUT(chnk + 4, chnk + (12 + blksz), address); + __PUT(chnk + 12, chnk + 16, address); + __PUT(chnk + 16, blksz, address); + __PUT(chnk + 20, -4, address); + __PUT(chnk + 24, Heap_bigBlocks, address); Heap_bigBlocks = chnk + 12; Heap_heapsize += blksz; } @@ -183,9 +183,9 @@ static uintptr Heap_NewChunk (uintptr blksz) return _o_result; } -static void Heap_ExtendHeap (uintptr blksz) +static void Heap_ExtendHeap (address blksz) { - uintptr size, chnk, j, next; + address size, chnk, j, next; if (blksz > 160000) { size = blksz; } else { @@ -194,7 +194,7 @@ static void Heap_ExtendHeap (uintptr blksz) chnk = Heap_NewChunk(size); if (chnk != 0) { if (chnk < Heap_heap) { - __PUT(chnk, Heap_heap, uintptr); + __PUT(chnk, Heap_heap, address); Heap_heap = chnk; } else { j = Heap_heap; @@ -203,8 +203,8 @@ static void Heap_ExtendHeap (uintptr blksz) j = next; next = Heap_FetchAddress(j); } - __PUT(chnk, next, uintptr); - __PUT(j, chnk, uintptr); + __PUT(chnk, next, address); + __PUT(j, chnk, address); } if (next == 0) { Heap_heapend = Heap_FetchAddress(chnk + 4); @@ -212,10 +212,10 @@ static void Heap_ExtendHeap (uintptr blksz) } } -SYSTEM_PTR Heap_NEWREC (uintptr tag) +SYSTEM_PTR Heap_NEWREC (address tag) { SYSTEM_PTR _o_result; - uintptr i, i0, di, blksz, restsize, t, adr, end, next, prev; + address i, i0, di, blksz, restsize, t, adr, end, next, prev; SYSTEM_PTR new; Heap_Lock(); blksz = Heap_FetchAddress(tag); @@ -235,11 +235,11 @@ SYSTEM_PTR Heap_NEWREC (uintptr tag) di = i - i0; restsize = __ASHL(di, 4); end = adr + restsize; - __PUT(end + 4, blksz, uintptr); - __PUT(end + 8, -4, uintptr); - __PUT(end, end + 4, uintptr); - __PUT(adr + 4, restsize, uintptr); - __PUT(adr + 12, Heap_freeList[di], uintptr); + __PUT(end + 4, blksz, address); + __PUT(end + 8, -4, address); + __PUT(end, end + 4, address); + __PUT(adr + 4, restsize, address); + __PUT(adr + 12, Heap_freeList[di], address); Heap_freeList[di] = adr; adr += restsize; } @@ -279,22 +279,22 @@ SYSTEM_PTR Heap_NEWREC (uintptr tag) } restsize = t - blksz; end = adr + restsize; - __PUT(end + 4, blksz, uintptr); - __PUT(end + 8, -4, uintptr); - __PUT(end, end + 4, uintptr); + __PUT(end + 4, blksz, address); + __PUT(end + 8, -4, address); + __PUT(end, end + 4, address); if (restsize > 144) { - __PUT(adr + 4, restsize, uintptr); + __PUT(adr + 4, restsize, address); } else { next = Heap_FetchAddress(adr + 12); if (prev == 0) { Heap_bigBlocks = next; } else { - __PUT(prev + 12, next, uintptr); + __PUT(prev + 12, next, address); } if (restsize > 0) { di = __ASHR(restsize, 4); - __PUT(adr + 4, restsize, uintptr); - __PUT(adr + 12, Heap_freeList[di], uintptr); + __PUT(adr + 4, restsize, address); + __PUT(adr + 12, Heap_freeList[di], address); Heap_freeList[di] = adr; } } @@ -303,53 +303,53 @@ SYSTEM_PTR Heap_NEWREC (uintptr tag) i = adr + 16; end = adr + blksz; while (i < end) { - __PUT(i, 0, uintptr); - __PUT(i + 4, 0, uintptr); - __PUT(i + 8, 0, uintptr); - __PUT(i + 12, 0, uintptr); + __PUT(i, 0, address); + __PUT(i + 4, 0, address); + __PUT(i + 8, 0, address); + __PUT(i + 12, 0, address); i += 16; } - __PUT(adr + 12, 0, uintptr); - __PUT(adr, tag, uintptr); - __PUT(adr + 4, 0, uintptr); - __PUT(adr + 8, 0, uintptr); + __PUT(adr + 12, 0, address); + __PUT(adr, tag, address); + __PUT(adr + 4, 0, address); + __PUT(adr + 8, 0, address); Heap_allocated += blksz; Heap_Unlock(); - _o_result = (SYSTEM_PTR)(uintptr)(adr + 4); + _o_result = (SYSTEM_PTR)(address)(adr + 4); return _o_result; } -SYSTEM_PTR Heap_NEWBLK (uintptr size) +SYSTEM_PTR Heap_NEWBLK (address size) { SYSTEM_PTR _o_result; - uintptr blksz, tag; + address blksz, tag; SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 31, 4), 4); - new = Heap_NEWREC((uintptr)&blksz); - tag = ((uintptr)(uintptr)new + blksz) - 12; - __PUT(tag - 4, 0, uintptr); - __PUT(tag, blksz, uintptr); - __PUT(tag + 4, -4, uintptr); - __PUT((uintptr)(uintptr)new - 4, tag, uintptr); + new = Heap_NEWREC((address)&blksz); + tag = ((address)(address)new + blksz) - 12; + __PUT(tag - 4, 0, address); + __PUT(tag, blksz, address); + __PUT(tag + 4, -4, address); + __PUT((address)(address)new - 4, tag, address); Heap_Unlock(); _o_result = new; return _o_result; } -static void Heap_Mark (uintptr q) +static void Heap_Mark (address q) { - uintptr p, tag, offset, fld, n, tagbits; + address p, tag, offset, fld, n, tagbits; if (q != 0) { tagbits = Heap_FetchAddress(q - 4); if (!__ODD(tagbits)) { - __PUT(q - 4, tagbits + 1, uintptr); + __PUT(q - 4, tagbits + 1, address); p = 0; tag = tagbits + 4; for (;;) { - __GET(tag, offset, uintptr); - if (__BIT((uintptr)&offset, 31)) { - __PUT(q - 4, (tag + offset) + 1, uintptr); + __GET(tag, offset, address); + if (__BIT((address)&offset, 31)) { + __PUT(q - 4, (tag + offset) + 1, address); if (p == 0) { break; } @@ -357,19 +357,19 @@ static void Heap_Mark (uintptr q) q = p; tag = Heap_FetchAddress(q - 4); tag -= 1; - __GET(tag, offset, uintptr); + __GET(tag, offset, address); fld = q + offset; p = Heap_FetchAddress(fld); - __PUT(fld, (SYSTEM_PTR)(uintptr)n, SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(address)n, SYSTEM_PTR); } else { fld = q + offset; n = Heap_FetchAddress(fld); if (n != 0) { tagbits = Heap_FetchAddress(n - 4); if (!__ODD(tagbits)) { - __PUT(n - 4, tagbits + 1, uintptr); - __PUT(q - 4, tag + 1, uintptr); - __PUT(fld, (SYSTEM_PTR)(uintptr)p, SYSTEM_PTR); + __PUT(n - 4, tagbits + 1, address); + __PUT(q - 4, tag + 1, address); + __PUT(fld, (SYSTEM_PTR)(address)p, SYSTEM_PTR); p = q; q = n; tag = tagbits; @@ -384,12 +384,12 @@ static void Heap_Mark (uintptr q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((uintptr)(uintptr)p); + Heap_Mark((address)(address)p); } static void Heap_Scan (void) { - uintptr chnk, adr, end, start, tag, i, size, freesize; + address chnk, adr, end, start, tag, i, size, freesize; Heap_bigBlocks = 0; i = 1; while (i < 9) { @@ -407,21 +407,21 @@ static void Heap_Scan (void) if (__ODD(tag)) { if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 4, uintptr); - __PUT(start + 4, freesize, uintptr); - __PUT(start + 8, -4, uintptr); + __PUT(start, start + 4, address); + __PUT(start + 4, freesize, address); + __PUT(start + 8, -4, address); i = __ASHR(freesize, 4); freesize = 0; if (i < 9) { - __PUT(start + 12, Heap_freeList[i], uintptr); + __PUT(start + 12, Heap_freeList[i], address); Heap_freeList[i] = start; } else { - __PUT(start + 12, Heap_bigBlocks, uintptr); + __PUT(start + 12, Heap_bigBlocks, address); Heap_bigBlocks = start; } } tag -= 1; - __PUT(adr, tag, uintptr); + __PUT(adr, tag, address); size = Heap_FetchAddress(tag); Heap_allocated += size; adr += size; @@ -433,16 +433,16 @@ static void Heap_Scan (void) } if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 4, uintptr); - __PUT(start + 4, freesize, uintptr); - __PUT(start + 8, -4, uintptr); + __PUT(start, start + 4, address); + __PUT(start + 4, freesize, address); + __PUT(start + 8, -4, address); i = __ASHR(freesize, 4); freesize = 0; if (i < 9) { - __PUT(start + 12, Heap_freeList[i], uintptr); + __PUT(start + 12, Heap_freeList[i], address); Heap_freeList[i] = start; } else { - __PUT(start + 12, Heap_bigBlocks, uintptr); + __PUT(start + 12, Heap_bigBlocks, address); Heap_bigBlocks = start; } } @@ -450,9 +450,9 @@ static void Heap_Scan (void) } } -static void Heap_Sift (uintptr l, uintptr r, uintptr *a, LONGINT a__len) +static void Heap_Sift (address l, address r, address *a, LONGINT a__len) { - uintptr i, j, x; + address i, j, x; j = l; x = a[j]; for (;;) { @@ -469,9 +469,9 @@ static void Heap_Sift (uintptr l, uintptr r, uintptr *a, LONGINT a__len) a[i] = x; } -static void Heap_HeapSort (uintptr n, uintptr *a, LONGINT a__len) +static void Heap_HeapSort (address n, address *a, LONGINT a__len) { - uintptr l, r, x; + address l, r, x; l = __ASHR(n, 1); r = n - 1; while (l > 0) { @@ -487,9 +487,9 @@ static void Heap_HeapSort (uintptr n, uintptr *a, LONGINT a__len) } } -static void Heap_MarkCandidates (uintptr n, uintptr *cand, LONGINT cand__len) +static void Heap_MarkCandidates (address n, address *cand, LONGINT cand__len) { - uintptr chnk, adr, tag, next, lim, lim1, i, ptr, size; + address chnk, adr, tag, next, lim, lim1, i, ptr, size; chnk = Heap_heap; i = 0; lim = cand[n - 1]; @@ -527,7 +527,7 @@ static void Heap_MarkCandidates (uintptr n, uintptr *cand, LONGINT cand__len) static void Heap_CheckFin (void) { Heap_FinNode n; - uintptr tag; + address tag; n = Heap_fin; while (n != NIL) { tag = Heap_FetchAddress(n->obj - 4); @@ -553,7 +553,7 @@ static void Heap_Finalize (void) } else { prev->next = n->next; } - (*n->finalize)((SYSTEM_PTR)(uintptr)n->obj); + (*n->finalize)((SYSTEM_PTR)(address)n->obj); if (prev == NIL) { n = Heap_fin; } else { @@ -572,14 +572,14 @@ void Heap_FINALL (void) while (Heap_fin != NIL) { n = Heap_fin; Heap_fin = Heap_fin->next; - (*n->finalize)((SYSTEM_PTR)(uintptr)n->obj); + (*n->finalize)((SYSTEM_PTR)(address)n->obj); } } -static void Heap_MarkStack (uintptr n, uintptr *cand, LONGINT cand__len) +static void Heap_MarkStack (address n, address *cand, LONGINT cand__len) { SYSTEM_PTR frame; - uintptr inc, nofcand, sp, p, stack0; + address inc, nofcand, sp, p, stack0; struct Heap__1 align; if (n > 0) { Heap_MarkStack(n - 1, cand, cand__len); @@ -589,14 +589,14 @@ static void Heap_MarkStack (uintptr n, uintptr *cand, LONGINT cand__len) } if (n == 0) { nofcand = 0; - sp = (uintptr)&frame; + sp = (address)&frame; stack0 = Heap_PlatformMainStackFrame(); - inc = (uintptr)&align.p - (uintptr)&align; + inc = (address)&align.p - (address)&align; if (sp > stack0) { inc = -inc; } while (sp != stack0) { - __GET(sp, p, uintptr); + __GET(sp, p, address); if ((p > Heap_heap && p < Heap_heapend)) { if (nofcand == cand__len) { Heap_HeapSort(nofcand, (void*)cand, cand__len); @@ -618,11 +618,11 @@ static void Heap_MarkStack (uintptr n, uintptr *cand, LONGINT cand__len) void Heap_GC (BOOLEAN markStack) { Heap_Module m; - uintptr i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; - uintptr cand[10000]; + address i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; + address cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); - m = (Heap_Module)(uintptr)Heap_modules; + m = (Heap_Module)(address)Heap_modules; while (m != NIL) { if (m->enumPtrs != NIL) { (*m->enumPtrs)(Heap_MarkP); @@ -699,7 +699,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (uintptr)(uintptr)obj; + f->obj = (address)(address)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; @@ -710,7 +710,7 @@ void Heap_InitHeap (void) { Heap_heap = Heap_NewChunk(128000); Heap_heapend = Heap_FetchAddress(Heap_heap + 4); - __PUT(Heap_heap, 0, uintptr); + __PUT(Heap_heap, 0, address); Heap_allocated = 0; Heap_firstTry = 1; Heap_freeList[9] = 1; diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index 771fc9d8..ca1d8e95 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h @@ -31,7 +31,7 @@ typedef import SYSTEM_PTR Heap_modules; -import uintptr Heap_allocated, Heap_heapsize; +import address Heap_allocated, Heap_heapsize; import int16 Heap_FileCount; import LONGINT *Heap_ModuleDesc__typ; @@ -41,11 +41,11 @@ import void Heap_GC (BOOLEAN markStack); import void Heap_INCREF (Heap_Module m); import void Heap_InitHeap (void); import void Heap_Lock (void); -import SYSTEM_PTR Heap_NEWBLK (uintptr size); -import SYSTEM_PTR Heap_NEWREC (uintptr tag); +import SYSTEM_PTR Heap_NEWBLK (address size); +import SYSTEM_PTR Heap_NEWREC (address tag); import void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); import SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -import void Heap_REGTYP (Heap_Module m, uintptr typ); +import void Heap_REGTYP (Heap_Module m, address typ); import void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); import void Heap_Unlock (void); import void *Heap__init(void); diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index 84914960..fab3561e 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Heap.h" diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index 2409c160..13abd6d0 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index 07797236..1d0b8774 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index 47603929..465ba585 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 8949813a..b702852c 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "OPM.h" @@ -200,8 +200,8 @@ void OPC_Ident (OPT_Object obj) } } } else if ((mode == 5 && obj->typ->form == 4)) { - if (obj->typ == OPT_pinttyp) { - OPM_WriteString((CHAR*)"uintptr", 8); + if (obj->typ == OPT_adrtyp) { + OPM_WriteString((CHAR*)"address", 8); } else { OPM_WriteString((CHAR*)"int", 4); OPM_WriteInt(__ASHL(obj->typ->size, 3)); @@ -2047,7 +2047,7 @@ static void OPC_InitKeywords (void) OPC_hashtab[__X(i, 105)] = -1; i += 1; } - Enter__49((CHAR*)"adrint", 7); + Enter__49((CHAR*)"address", 8); Enter__49((CHAR*)"asm", 4); Enter__49((CHAR*)"auto", 5); Enter__49((CHAR*)"break", 6); @@ -2084,7 +2084,6 @@ static void OPC_InitKeywords (void) Enter__49((CHAR*)"struct", 7); Enter__49((CHAR*)"switch", 7); Enter__49((CHAR*)"typedef", 8); - Enter__49((CHAR*)"uintptr", 8); Enter__49((CHAR*)"uint16", 7); Enter__49((CHAR*)"uint32", 7); Enter__49((CHAR*)"uint64", 7); diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index a13d99e4..2839fb0f 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 1cd8fb97..70121d63 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" @@ -544,15 +544,15 @@ void OPM_FPrintReal (int32 *fp, REAL real) { int16 i; int32 l; - __GET((uintptr)&real, l, int32); + __GET((address)&real, l, int32); OPM_FPrint(&*fp, l); } void OPM_FPrintLReal (int32 *fp, LONGREAL lr) { int32 l, h; - __GET((uintptr)&lr, l, int32); - __GET((uintptr)&lr + 4, h, int32); + __GET((address)&lr, l, int32); + __GET((address)&lr + 4, h, int32); OPM_FPrint(&*fp, l); OPM_FPrint(&*fp, h); } diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index f0a96a82..fce4bdd3 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index f727dcde..dc286221 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPB.h" #include "OPM.h" diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index b8787f9f..e79b5819 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index 7a14e8c2..b90cb34b 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index 0e48367c..347c669a 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index f151a183..ccfba447 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" @@ -83,7 +83,7 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; -export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_pinttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; export int8 OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; @@ -1767,7 +1767,7 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_sinttyp); P(OPT_inttyp); P(OPT_linttyp); - P(OPT_pinttyp); + P(OPT_adrtyp); P(OPT_int8typ); P(OPT_int16typ); P(OPT_int32typ); @@ -1849,7 +1849,7 @@ export void *OPT__init(void) OPT_InitStruct(&OPT_niltyp, 9); OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp); OPT_EnterTyp((CHAR*)"PTR", 11, OPM_PointerSize, &OPT_sysptrtyp); - OPT_EnterTyp((CHAR*)"UINTPTR", 4, OPM_PointerSize, &OPT_pinttyp); + OPT_EnterTyp((CHAR*)"ADDRESS", 4, OPM_PointerSize, &OPT_adrtyp); OPT_EnterTyp((CHAR*)"INT8", 4, 1, &OPT_int8typ); OPT_EnterTyp((CHAR*)"INT16", 4, 2, &OPT_int16typ); OPT_EnterTyp((CHAR*)"INT32", 4, 4, &OPT_int32typ); diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index 41a1b2e4..ce146e6f 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h @@ -67,7 +67,7 @@ typedef import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; -import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_pinttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; import int8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index 4272132e..da9a8429 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPC.h" #include "OPM.h" @@ -285,7 +285,7 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_realtyp->strobj->linkadr = 2; OPT_inttyp->strobj->linkadr = 2; OPT_linttyp->strobj->linkadr = 2; - OPT_pinttyp->strobj->linkadr = 2; + OPT_adrtyp->strobj->linkadr = 2; OPT_int8typ->strobj->linkadr = 2; OPT_int16typ->strobj->linkadr = 2; OPT_int32typ->strobj->linkadr = 2; @@ -938,7 +938,7 @@ static void OPV_expr (OPT_Node n, int16 prec) OPM_Write(')'); break; case 24: - OPM_WriteString((CHAR*)"(uintptr)", 10); + OPM_WriteString((CHAR*)"(address)", 10); if (l->class == 1) { OPC_CompleteIdent(l->obj); } else { @@ -954,7 +954,7 @@ static void OPV_expr (OPT_Node n, int16 prec) OPC_Ident(n->typ->strobj); OPM_Write(')'); if (__IN(n->typ->form, 0x1800) || __IN(l->typ->form, 0x1800)) { - OPM_WriteString((CHAR*)"(uintptr)", 10); + OPM_WriteString((CHAR*)"(address)", 10); } OPV_expr(l, exprPrec); } else { @@ -1326,7 +1326,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) if (x->class == 7) { OPC_IntLiteral(x->conval->intval, OPM_PointerSize); } else { - OPM_WriteString((CHAR*)"((uintptr)(", 12); + OPM_WriteString((CHAR*)"((address)(", 12); OPV_expr(x, 10); OPM_WriteString((CHAR*)"))", 3); } diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index d45ee079..600b19bd 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 95b8b50f..e3a21ae0 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef @@ -26,11 +26,12 @@ typedef export BOOLEAN Platform_LittleEndian; -export int32 Platform_MainStackFrame, Platform_HaltCode; +export address Platform_MainStackFrame; +export int32 Platform_HaltCode; export int16 Platform_PID; export CHAR Platform_CWD[4096]; export int16 Platform_ArgCount; -export int32 Platform_ArgVector; +export address Platform_ArgVector; static Platform_HaltProcedure Platform_HaltHandler; static int32 Platform_TimeStart; export int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; @@ -60,12 +61,12 @@ export void Platform_Halt (int32 code); export int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, LONGINT *identity__typ); export int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); export BOOLEAN Platform_Inaccessible (int16 e); -export void Platform_Init (int16 argc, int32 argvadr); +export void Platform_Init (int16 argc, address argvadr); export void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); export int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); export BOOLEAN Platform_NoSuchDirectory (int16 e); -export int32 Platform_OSAllocate (int32 size); -export void Platform_OSFree (int32 address); +export address Platform_OSAllocate (address size); +export void Platform_OSFree (address address); export int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); export int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); export int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n); @@ -111,9 +112,9 @@ export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT extern void Heap_InitHeap(); #define Platform_GetTickCount() (LONGINT)(uint32)GetTickCount() #define Platform_HeapInitHeap() Heap_InitHeap() -#define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((SYSTEM_ADRINT)h) -#define Platform_SetQuitHandler(h) SystemSetQuitHandler((SYSTEM_ADRINT)h) -#define Platform_allocate(size) (LONGINT)(SYSTEM_ADRINT)((void*)HeapAlloc(GetProcessHeap(), 0, (size_t)size)) +#define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((address)h) +#define Platform_SetQuitHandler(h) SystemSetQuitHandler((address)h) +#define Platform_allocate(size) (address)((void*)HeapAlloc(GetProcessHeap(), 0, (size_t)size)) #define Platform_bhfiIndexHigh() (LONGINT)bhfi.nFileIndexHigh #define Platform_bhfiIndexLow() (LONGINT)bhfi.nFileIndexLow #define Platform_bhfiMtimeHigh() (LONGINT)bhfi.ftLastWriteTime.dwHighDateTime @@ -121,44 +122,44 @@ extern void Heap_InitHeap(); #define Platform_bhfiVsn() (LONGINT)bhfi.dwVolumeSerialNumber #define Platform_byHandleFileInformation() BY_HANDLE_FILE_INFORMATION bhfi #define Platform_cleanupProcess() CloseHandle(pi.hProcess); CloseHandle(pi.hThread); -#define Platform_closeHandle(h) (INTEGER)CloseHandle((HANDLE)(SYSTEM_ADRINT)h) +#define Platform_closeHandle(h) (INTEGER)CloseHandle((HANDLE)(address)h) #define Platform_createProcess(str, str__len) (INTEGER)CreateProcess(0, (char*)str, 0,0,0,0,0,0,&si,&pi) #define Platform_deleteFile(n, n__len) (INTEGER)DeleteFile((char*)n) #define Platform_err() (INTEGER)GetLastError() -#define Platform_errc(c) WriteFile((HANDLE)(SYSTEM_ADRINT)Platform_StdOut, &c, 1, 0,0) -#define Platform_errstring(s, s__len) WriteFile((HANDLE)(SYSTEM_ADRINT)Platform_StdOut, s, s__len-1, 0,0) +#define Platform_errc(c) WriteFile((HANDLE)(address)Platform_StdOut, &c, 1, 0,0) +#define Platform_errstring(s, s__len) WriteFile((HANDLE)(address)Platform_StdOut, s, s__len-1, 0,0) #define Platform_exit(code) ExitProcess((UINT)code) #define Platform_fileTimeToSysTime() SYSTEMTIME st; FileTimeToSystemTime(&ft, &st) -#define Platform_flushFileBuffers(h) (INTEGER)FlushFileBuffers((HANDLE)(SYSTEM_ADRINT)h) -#define Platform_free(address) HeapFree(GetProcessHeap(), 0, (void*)(SYSTEM_ADRINT)address) +#define Platform_flushFileBuffers(h) (INTEGER)FlushFileBuffers((HANDLE)(address)h) +#define Platform_free(address) HeapFree(GetProcessHeap(), 0, (void*)address) #define Platform_ftToUli() ULARGE_INTEGER ul; ul.LowPart=ft.dwLowDateTime; ul.HighPart=ft.dwHighDateTime #define Platform_getCurrentDirectory(n, n__len) GetCurrentDirectory(n__len, (char*)n) #define Platform_getExitCodeProcess(exitcode) GetExitCodeProcess(pi.hProcess, (DWORD*)exitcode); -#define Platform_getFileInformationByHandle(h) (INTEGER)GetFileInformationByHandle((HANDLE)(SYSTEM_ADRINT)h, &bhfi) -#define Platform_getFilePos(h, r, rc) LARGE_INTEGER liz = {0}; *rc = (INTEGER)SetFilePointerEx((HANDLE)(SYSTEM_ADRINT)h, liz, &li, FILE_CURRENT); *r = (LONGINT)li.QuadPart -#define Platform_getFileSize(h) (INTEGER)GetFileSizeEx((HANDLE)(SYSTEM_ADRINT)h, &li) +#define Platform_getFileInformationByHandle(h) (INTEGER)GetFileInformationByHandle((HANDLE)(address)h, &bhfi) +#define Platform_getFilePos(h, r, rc) LARGE_INTEGER liz = {0}; *rc = (INTEGER)SetFilePointerEx((HANDLE)(address)h, liz, &li, FILE_CURRENT); *r = (LONGINT)li.QuadPart +#define Platform_getFileSize(h) (INTEGER)GetFileSizeEx((HANDLE)(address)h, &li) #define Platform_getLocalTime() SYSTEMTIME st; GetLocalTime(&st) #define Platform_getenv(name, name__len, buf, buf__len) (INTEGER)GetEnvironmentVariable((char*)name, (char*)buf, buf__len) #define Platform_getpid() (INTEGER)GetCurrentProcessId() -#define Platform_getstderrhandle() (SYSTEM_ADRINT)GetStdHandle(STD_ERROR_HANDLE) -#define Platform_getstdinhandle() (SYSTEM_ADRINT)GetStdHandle(STD_INPUT_HANDLE) -#define Platform_getstdouthandle() (SYSTEM_ADRINT)GetStdHandle(STD_OUTPUT_HANDLE) +#define Platform_getstderrhandle() (address)GetStdHandle(STD_ERROR_HANDLE) +#define Platform_getstdinhandle() (address)GetStdHandle(STD_INPUT_HANDLE) +#define Platform_getstdouthandle() (address)GetStdHandle(STD_OUTPUT_HANDLE) #define Platform_identityToFileTime(i) FILETIME ft; ft.dwHighDateTime = i.mtimehigh; ft.dwLowDateTime = i.mtimelow -#define Platform_invalidHandleValue() ((LONGINT)(SYSTEM_ADRINT)INVALID_HANDLE_VALUE) +#define Platform_invalidHandleValue() ((LONGINT)(address)INVALID_HANDLE_VALUE) #define Platform_largeInteger() LARGE_INTEGER li #define Platform_liLongint() (LONGINT)li.QuadPart #define Platform_moveFile(o, o__len, n, n__len) (INTEGER)MoveFileEx((char*)o, (char*)n, MOVEFILE_REPLACE_EXISTING) -#define Platform_opennew(n, n__len) (LONGINT)(SYSTEM_ADRINT)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0) -#define Platform_openro(n, n__len) (LONGINT)(SYSTEM_ADRINT)CreateFile((char*)n, GENERIC_READ , FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) -#define Platform_openrw(n, n__len) (LONGINT)(SYSTEM_ADRINT)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) +#define Platform_opennew(n, n__len) (LONGINT)(address)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0) +#define Platform_openro(n, n__len) (LONGINT)(address)CreateFile((char*)n, GENERIC_READ , FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) +#define Platform_openrw(n, n__len) (LONGINT)(address)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) #define Platform_processInfo() PROCESS_INFORMATION pi = {0}; -#define Platform_readfile(fd, p, l, n) (INTEGER)ReadFile ((HANDLE)(SYSTEM_ADRINT)fd, (void*)(SYSTEM_ADRINT)(p), (DWORD)l, (DWORD*)n, 0) +#define Platform_readfile(fd, p, l, n) (INTEGER)ReadFile ((HANDLE)(address)fd, (void*)(address)(p), (DWORD)l, (DWORD*)n, 0) #define Platform_seekcur() FILE_CURRENT #define Platform_seekend() FILE_END #define Platform_seekset() FILE_BEGIN #define Platform_setCurrentDirectory(n, n__len) (INTEGER)SetCurrentDirectory((char*)n) -#define Platform_setEndOfFile(h) (INTEGER)SetEndOfFile((HANDLE)(SYSTEM_ADRINT)h) -#define Platform_setFilePointerEx(h, o, r, rc) li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((HANDLE)(SYSTEM_ADRINT)h, li, 0, (DWORD)r) +#define Platform_setEndOfFile(h) (INTEGER)SetEndOfFile((HANDLE)(address)h) +#define Platform_setFilePointerEx(h, o, r, rc) li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((HANDLE)(address)h, li, 0, (DWORD)r) #define Platform_sleep(ms) Sleep((DWORD)ms) #define Platform_stToFt() FILETIME ft; SystemTimeToFileTime(&st, &ft) #define Platform_startupInfo() STARTUPINFO si = {0}; si.cb = sizeof(si); @@ -173,7 +174,7 @@ extern void Heap_InitHeap(); #define Platform_ulSec() (LONGINT)(ul.QuadPart / 1000000LL) #define Platform_uluSec() (LONGINT)(ul.QuadPart % 1000000LL) #define Platform_waitForProcess() (INTEGER)WaitForSingleObject(pi.hProcess, INFINITE) -#define Platform_writefile(fd, p, l) (INTEGER)WriteFile((HANDLE)(SYSTEM_ADRINT)fd, (void*)(SYSTEM_ADRINT)(p), (DWORD)l, 0,0) +#define Platform_writefile(fd, p, l) (INTEGER)WriteFile((HANDLE)(address)fd, (void*)(address)(p), (DWORD)l, 0,0) BOOLEAN Platform_TooManyFiles (int16 e) { @@ -224,24 +225,24 @@ BOOLEAN Platform_ConnectionFailed (int16 e) return _o_result; } -int32 Platform_OSAllocate (int32 size) +address Platform_OSAllocate (address size) { - int32 _o_result; + address _o_result; _o_result = Platform_allocate(size); return _o_result; } -void Platform_OSFree (int32 address) +void Platform_OSFree (address address) { Platform_free(address); } -void Platform_Init (int16 argc, int32 argvadr) +void Platform_Init (int16 argc, address argvadr) { Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; Platform_ArgCount = argc; - av = (Platform_ArgVecPtr)(uintptr)argvadr; + av = (Platform_ArgVecPtr)(address)argvadr; Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; Platform_HeapInitHeap(); @@ -280,7 +281,7 @@ void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { - av = (Platform_ArgVec)(uintptr)Platform_ArgVector; + av = (Platform_ArgVec)(address)Platform_ArgVector; __COPY(*(*av)[__X(n, 1024)], val, val__len); } } @@ -559,7 +560,7 @@ int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n) int16 _o_result; int16 result; *n = 0; - result = Platform_readfile(h, (uintptr)b, b__len, &*n); + result = Platform_readfile(h, (address)b, b__len, &*n); if (result == 0) { *n = 0; _o_result = Platform_err(); @@ -745,8 +746,23 @@ static void Platform_DisplayHaltCode (int32 code) case -9: Platform_errstring((CHAR*)"Heap interrupted while locked, but lockdepth = 0 at unlock.", 60); break; + case -10: + Platform_errstring((CHAR*)"NIL access.", 12); + break; + case -11: + Platform_errstring((CHAR*)"Alignment error.", 17); + break; + case -12: + Platform_errstring((CHAR*)"Divide by zero.", 16); + break; + case -13: + Platform_errstring((CHAR*)"Arithmetic overflow/underflow.", 31); + break; + case -14: + Platform_errstring((CHAR*)"Invalid function argument.", 27); + break; case -15: - Platform_errstring((CHAR*)"Type descriptor size mismatch.", 31); + Platform_errstring((CHAR*)"Internal error, e.g. Type descriptor size mismatch.", 52); break; case -20: Platform_errstring((CHAR*)"Too many, or negative number of, elements in dynamic array.", 60); @@ -795,7 +811,7 @@ static void Platform_TestLittleEndian (void) { int16 i; i = 1; - __GET((uintptr)&i, Platform_LittleEndian, BOOLEAN); + __GET((address)&i, Platform_LittleEndian, BOOLEAN); } __TDESC(Platform_FileIdentity, 1, 0) = {__TDFLDS("FileIdentity", 20), {-4}}; diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index 6d983649..6d0de5b3 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h @@ -19,11 +19,12 @@ typedef import BOOLEAN Platform_LittleEndian; -import int32 Platform_MainStackFrame, Platform_HaltCode; +import address Platform_MainStackFrame; +import int32 Platform_HaltCode; import int16 Platform_PID; import CHAR Platform_CWD[4096]; import int16 Platform_ArgCount; -import int32 Platform_ArgVector; +import address Platform_ArgVector; import int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; import int32 Platform_StdIn, Platform_StdOut, Platform_StdErr; import CHAR Platform_nl[3]; @@ -49,12 +50,12 @@ import void Platform_Halt (int32 code); import int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, LONGINT *identity__typ); import int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); import BOOLEAN Platform_Inaccessible (int16 e); -import void Platform_Init (int16 argc, int32 argvadr); +import void Platform_Init (int16 argc, address argvadr); import void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); import int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); import BOOLEAN Platform_NoSuchDirectory (int16 e); -import int32 Platform_OSAllocate (int32 size); -import void Platform_OSFree (int32 address); +import address Platform_OSAllocate (address size); +import void Platform_OSFree (address address); import int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); import int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); import int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n); @@ -78,7 +79,7 @@ import int16 Platform_Write (int32 h, int32 p, int32 l); import BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); import void *Platform__init(void); -#define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((SYSTEM_ADRINT)h) -#define Platform_SetQuitHandler(h) SystemSetQuitHandler((SYSTEM_ADRINT)h) +#define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((address)h) +#define Platform_SetQuitHandler(h) SystemSetQuitHandler((address)h) #endif diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 32931aec..8fe37010 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -58,7 +58,7 @@ int16 Reals_Expo (REAL x) { int16 _o_result; int16 i; - __GET((uintptr)&x + 2, i, int16); + __GET((address)&x + 2, i, int16); _o_result = __MASK(__ASHR(i, 7), -256); return _o_result; } @@ -66,17 +66,17 @@ int16 Reals_Expo (REAL x) void Reals_SetExpo (REAL *x, int16 ex) { CHAR c; - __GET((uintptr)x + 3, c, CHAR); - __PUT((uintptr)x + 3, (CHAR)(__ASHL(__ASHR((int16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); - __GET((uintptr)x + 2, c, CHAR); - __PUT((uintptr)x + 2, (CHAR)(__MASK((int16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); + __GET((address)x + 3, c, CHAR); + __PUT((address)x + 3, (CHAR)(__ASHL(__ASHR((int16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __GET((address)x + 2, c, CHAR); + __PUT((address)x + 2, (CHAR)(__MASK((int16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } int16 Reals_ExpoL (LONGREAL x) { int16 _o_result; int16 i; - __GET((uintptr)&x + 6, i, int16); + __GET((address)&x + 6, i, int16); _o_result = __MASK(__ASHR(i, 4), -2048); return _o_result; } diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index 38d206bb..9ebc1c17 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/SYSTEM.c b/bootstrap/windows-48/SYSTEM.c index 16681ab8..821a6096 100644 --- a/bootstrap/windows-48/SYSTEM.c +++ b/bootstrap/windows-48/SYSTEM.c @@ -38,7 +38,7 @@ void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0) void SYSTEM_ENUMP(void *adr, LONGINT n, void (*P)()) { while (n > 0) { - P((uintptr)(*((void**)(adr)))); + P((address)(*((void**)(adr)))); adr = ((void**)adr) + 1; n--; } @@ -51,7 +51,7 @@ void SYSTEM_ENUMR(void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()) while (n > 0) { t = typ; off = *t; - while (off >= 0) {P(*(uintptr*)((char*)adr+off)); t++; off = *t;} + while (off >= 0) {P(*(address*)((char*)adr+off)); t++; off = *t;} adr = ((char*)adr) + size; n--; } @@ -109,7 +109,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, else if (typ == (LONGINT*)POINTER__typ) { /* element type is a pointer */ x = Heap_NEWBLK(size + nofelems * sizeof(LONGINT)); - p = (LONGINT*)(uintptr)x[-1]; + p = (LONGINT*)(address)x[-1]; p[-nofelems] = *p; /* build new type desc in situ: 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nofelems - 1; n = 1; /* n =1 for skipping the size field */ while (n <= nofelems) {*p = n*sizeof(LONGINT); p++; n++;} @@ -122,7 +122,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, while (ptab[nofptrs] >= 0) {nofptrs++;} /* number of pointers per element */ nptr = nofelems * nofptrs; /* total number of pointers */ x = Heap_NEWBLK(size + nptr * sizeof(LONGINT)); - p = (LONGINT*)(uintptr)x[- 1]; + p = (LONGINT*)(address)x[- 1]; p[-nptr] = *p; /* build new type desc in situ; 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nptr - 1; n = 0; off = dataoff; while (n < nofelems) {i = 0; @@ -158,7 +158,7 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler // (Ignore other signals) } - void SystemSetHandler(int s, uintptr h) { + void SystemSetHandler(int s, address h) { if (s >= 2 && s <= 4) { int needtosetsystemhandler = handler[s-2] == 0; handler[s-2] = (SystemSignalHandler)h; @@ -197,12 +197,12 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler } } - void SystemSetInterruptHandler(uintptr h) { + void SystemSetInterruptHandler(address h) { EnsureConsoleCtrlHandler(); SystemInterruptHandler = (SystemSignalHandler)h; } - void SystemSetQuitHandler(uintptr h) { + void SystemSetQuitHandler(address h) { EnsureConsoleCtrlHandler(); SystemQuitHandler = (SystemSignalHandler)h; } diff --git a/bootstrap/windows-48/SYSTEM.h b/bootstrap/windows-48/SYSTEM.h index e7b38a26..8c6c335e 100644 --- a/bootstrap/windows-48/SYSTEM.h +++ b/bootstrap/windows-48/SYSTEM.h @@ -39,7 +39,7 @@ typedef unsigned short int uint16; typedef signed char int8; typedef unsigned char uint8; -#define uintptr size_t +#define address size_t // The compiler uses 'import' and 'export' which translate to 'extern' and // nothing respectively. @@ -53,7 +53,7 @@ typedef unsigned char uint8; #define NIL ((void*)0) #define __MAXEXT 16 -#define POINTER__typ ((uintptr*)(1)) // not NIL and not a valid type +#define POINTER__typ ((address*)(1)) // not NIL and not a valid type // Oberon types @@ -98,8 +98,8 @@ typedef void* SYSTEM_PTR; // OS Memory allocation interfaces are in PlatformXXX.Mod -extern uintptr Platform_OSAllocate (uintptr size); -extern void Platform_OSFree (uintptr addr); +extern address Platform_OSAllocate (address size); +extern void Platform_OSFree (address addr); // Run time system routines in SYSTEM.c @@ -120,10 +120,10 @@ extern LONGINT SYSTEM_ENTIER (double x); // Signal handling in SYSTEM.c #ifndef _WIN32 - extern void SystemSetHandler(int s, uintptr h); + extern void SystemSetHandler(int s, address h); #else - extern void SystemSetInterruptHandler(uintptr h); - extern void SystemSetQuitHandler (uintptr h); + extern void SystemSetInterruptHandler(address h); + extern void SystemSetQuitHandler (address h); #endif @@ -146,9 +146,9 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __COPY(s, d, n) {char*_a=(void*)s,*_b=(void*)d; LONGINT _i=0,_t=n-1; \ while(_i<_t&&((_b[_i]=_a[_i])!=0)){_i++;};_b[_i]=0;} -#define __DUP(x, l, t) x=(void*)memcpy((void*)(uintptr)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) +#define __DUP(x, l, t) x=(void*)memcpy((void*)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) #define __DUPARR(v, t) v=(void*)memcpy(v##__copy,v,sizeof(t)) -#define __DEL(x) Platform_OSFree((LONGINT)(uintptr)x) +#define __DEL(x) Platform_OSFree((address)x) // Index and range checks @@ -165,8 +165,8 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __VAL(t, x) (*(t*)&(x)) -#define __GET(a, x, t) x= *(t*)(uintptr)(a) -#define __PUT(a, x, t) *(t*)(uintptr)(a)=x +#define __GET(a, x, t) x= *(t*)(address)(a) +#define __PUT(a, x, t) *(t*)(address)(a)=x #define __LSHL(x, n, t) ((t)((u##t)(x)<<(n))) #define __LSHR(x, n, t) ((t)((u##t)(x)>>(n))) @@ -182,7 +182,7 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __ASHF(x, n) SYSTEM_ASH((LONGINT)(x), (LONGINT)(n)) #define __BIT(x, n) (*(uint64*)(x)>>(n)&1) -#define __MOVE(s, d, n) memcpy((char*)(uintptr)(d),(char*)(uintptr)(s),n) +#define __MOVE(s, d, n) memcpy((char*)(address)(d),(char*)(address)(s),n) #define __SHORT(x, y) ((int)((uLONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) #define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) #define __CHR(x) ((CHAR)__R(x, 256)) @@ -235,10 +235,10 @@ extern void Heap_INCREF(); // Main module initialisation, registration and finalisation -extern void Platform_Init(INTEGER argc, LONGINT argv); +extern void Platform_Init(INTEGER argc, address argv); extern void Heap_FINALL(); -#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (LONGINT)(uintptr)&argv); +#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (address)&argv); #define __REGMAIN(name, enum) m = Heap_REGMOD((CHAR*)name,enum) #define __FINI Heap_FINALL(); return 0 @@ -254,12 +254,12 @@ extern void Platform_AssertFail(LONGINT x); // Memory allocation -extern SYSTEM_PTR Heap_NEWBLK (uintptr size); -extern SYSTEM_PTR Heap_NEWREC (uintptr tag); +extern SYSTEM_PTR Heap_NEWBLK (address size); +extern SYSTEM_PTR Heap_NEWREC (address tag); extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __SYSNEW(p, len) p = Heap_NEWBLK((LONGINT)(len)) -#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(uintptr)t##__typ) +#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(address)t##__typ) #define __NEWARR SYSTEM_NEWARR @@ -290,20 +290,20 @@ extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __INITYP(t, t0, level) \ t##__typ = (LONGINT*)&t##__desc.blksz; \ memcpy(t##__desc.basep, t0##__typ - __BASEOFF, level*sizeof(LONGINT)); \ - t##__desc.basep[level] = (LONGINT)(uintptr)t##__typ; \ - t##__desc.module = (LONGINT)(uintptr)m; \ + t##__desc.basep[level] = (LONGINT)(address)t##__typ; \ + t##__desc.module = (LONGINT)(address)m; \ if(t##__desc.blksz!=sizeof(struct t)) __HALT(-15); \ t##__desc.blksz = (t##__desc.blksz+5*sizeof(LONGINT)-1)/(4*sizeof(LONGINT))*(4*sizeof(LONGINT)); \ - Heap_REGTYP(m, (LONGINT)(uintptr)&t##__desc.next); \ + Heap_REGTYP(m, (LONGINT)(address)&t##__desc.next); \ SYSTEM_INHERIT(t##__typ, t0##__typ) -#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(uintptr)typ##__typ) -#define __TYPEOF(p) ((LONGINT*)(uintptr)(*(((LONGINT*)(p))-1))) +#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(address)typ##__typ) +#define __TYPEOF(p) ((LONGINT*)(address)(*(((LONGINT*)(p))-1))) #define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) // Oberon-2 type bound procedures support -#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(uintptr)proc -#define __SEND(typ, num, funtyp, parlist) ((funtyp)((uintptr)*(typ-(__TPROC0OFF+num))))parlist +#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(address)proc +#define __SEND(typ, num, funtyp, parlist) ((funtyp)((address)*(typ-(__TPROC0OFF+num))))parlist diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index 728d163f..a642190c 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index 6e1bcc56..f537406e 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index 343d9491..b218c1b0 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Files.h" #include "Modules.h" diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index 776889ff..3174aa9b 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/Vishap.c b/bootstrap/windows-48/Vishap.c index f2e2ae7d..81b2d70f 100644 --- a/bootstrap/windows-48/Vishap.c +++ b/bootstrap/windows-48/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkamSf */ #include "SYSTEM.h" #include "Configuration.h" #include "Heap.h" @@ -81,7 +81,7 @@ static void Vishap_PropagateElementaryTypeSizes (void) OPT_realtyp->size = OPM_RealSize; OPT_inttyp->size = OPM_IntSize; OPT_linttyp->size = OPM_LIntSize; - OPT_pinttyp->size = OPM_PointerSize; + OPT_adrtyp->size = OPM_PointerSize; OPT_lrltyp->size = OPM_LRealSize; OPT_sinttyp->size = OPM_SIntSize; OPT_booltyp->size = OPM_BoolSize; diff --git a/bootstrap/windows-48/errors.c b/bootstrap/windows-48/errors.c index 0dc0c60a..a5576d43 100644 --- a/bootstrap/windows-48/errors.c +++ b/bootstrap/windows-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/windows-48/errors.h b/bootstrap/windows-48/errors.h index 4415a5f2..696219d4 100644 --- a/bootstrap/windows-48/errors.h +++ b/bootstrap/windows-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index 6a7aab56..553a3d7d 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index 4e806a33..ba9937e8 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/vt100.c b/bootstrap/windows-48/vt100.c index 447b9c81..ab305ed1 100644 --- a/bootstrap/windows-48/vt100.c +++ b/bootstrap/windows-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Strings.h" diff --git a/bootstrap/windows-48/vt100.h b/bootstrap/windows-48/vt100.h index 3d9d98a7..71079dc0 100644 --- a/bootstrap/windows-48/vt100.h +++ b/bootstrap/windows-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index b1d34288..c0502177 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -14,6 +14,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/03] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/04] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index 5fbd4f23..73002e87 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Console.c b/bootstrap/windows-88/Console.c index b73a59cc..83c649cf 100644 --- a/bootstrap/windows-88/Console.c +++ b/bootstrap/windows-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Platform.h" @@ -22,7 +22,7 @@ export void Console_String (CHAR *s, LONGINT s__len); void Console_Flush (void) { int32 error; - error = Platform_Write(Platform_StdOut, (uintptr)Console_line, Console_pos); + error = Platform_Write(Platform_StdOut, (address)Console_line, Console_pos); Console_pos = 0; } diff --git a/bootstrap/windows-88/Console.h b/bootstrap/windows-88/Console.h index 51684091..bcf5714f 100644 --- a/bootstrap/windows-88/Console.h +++ b/bootstrap/windows-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index cf6feb16..1f5e58a0 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -258,7 +258,7 @@ static void Files_Flush (Files_Buffer buf) if (buf->org != f->pos) { error = Platform_Seek(f->fd, buf->org, Platform_SeekSet); } - error = Platform_Write(f->fd, (uintptr)buf->data, buf->size); + error = Platform_Write(f->fd, (address)buf->data, buf->size); if (error != 0) { Files_Err((CHAR*)"error writing file", 19, f, error); } @@ -657,7 +657,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x } else { min = n; } - __MOVE((uintptr)buf->data + offset, (uintptr)x + xpos, min); + __MOVE((address)buf->data + offset, (address)x + xpos, min); offset += min; (*r).offset = offset; xpos += min; @@ -722,7 +722,7 @@ void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT } else { min = n; } - __MOVE((uintptr)x + xpos, (uintptr)buf->data + offset, min); + __MOVE((address)x + xpos, (address)buf->data + offset, min); offset += min; (*r).offset = offset; if (offset > buf->size) { @@ -773,15 +773,15 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int *res = 3; return; } - error = Platform_Read(fdold, (uintptr)buf, 4096, &n); + error = Platform_Read(fdold, (address)buf, 4096, &n); while (n > 0) { - error = Platform_Write(fdnew, (uintptr)buf, n); + error = Platform_Write(fdnew, (address)buf, n); if (error != 0) { ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); Files_Err((CHAR*)"cannot move file", 17, NIL, error); } - error = Platform_Read(fdold, (uintptr)buf, 4096, &n); + error = Platform_Read(fdold, (address)buf, 4096, &n); } ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); @@ -839,7 +839,7 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *de j += 1; } } else { - __MOVE((uintptr)src, (uintptr)dest, src__len); + __MOVE((address)src, (address)dest, src__len); } } @@ -1009,7 +1009,7 @@ static void Files_Finalize (SYSTEM_PTR o) { Files_File f = NIL; int64 res; - f = (Files_File)(uintptr)o; + f = (Files_File)(address)o; if (f->fd >= 0) { Files_CloseOSFile(f); if (f->tempFile) { @@ -1022,7 +1022,7 @@ void Files_SetSearchPath (CHAR *path, LONGINT path__len) { __DUP(path, path__len, CHAR); if (Strings_Length(path, path__len) != 0) { - Files_SearchPath = __NEWARR(NIL, 1, 1, 1, 1, ((uintptr)((Strings_Length(path, path__len) + 1)))); + Files_SearchPath = __NEWARR(NIL, 1, 1, 1, 1, ((address)((Strings_Length(path, path__len) + 1)))); __COPY(path, Files_SearchPath->data, Files_SearchPath->len[0]); } else { Files_SearchPath = NIL; diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 0be3f73d..65de586e 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index 6712b853..b5749b04 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tskSfF */ #define LARGE #include "SYSTEM.h" @@ -35,7 +35,7 @@ typedef typedef struct Heap_FinDesc { Heap_FinNode next; - uintptr obj; + address obj; BOOLEAN marked; Heap_Finalizer finalize; } Heap_FinDesc; @@ -52,19 +52,19 @@ typedef Heap_ModuleName name; int64 refcnt; Heap_Cmd cmds; - uintptr types; + address types; Heap_EnumProc enumPtrs; int64 reserved1, reserved2; } Heap_ModuleDesc; export SYSTEM_PTR Heap_modules; -static uintptr Heap_freeList[10]; -static uintptr Heap_bigBlocks; -export uintptr Heap_allocated; +static address Heap_freeList[10]; +static address Heap_bigBlocks; +export address Heap_allocated; static BOOLEAN Heap_firstTry; -static uintptr Heap_heap, Heap_heapend; -export uintptr Heap_heapsize; +static address Heap_heap, Heap_heapend; +export address Heap_heapsize; static Heap_FinNode Heap_fin; static int32 Heap_lockdepth; static BOOLEAN Heap_interrupted; @@ -76,33 +76,33 @@ export LONGINT *Heap_FinDesc__typ; export LONGINT *Heap__1__typ; static void Heap_CheckFin (void); -static void Heap_ExtendHeap (uintptr blksz); +static void Heap_ExtendHeap (address blksz); export void Heap_FINALL (void); static void Heap_Finalize (void); export void Heap_GC (BOOLEAN markStack); -static void Heap_HeapSort (uintptr n, uintptr *a, LONGINT a__len); +static void Heap_HeapSort (address n, address *a, LONGINT a__len); export void Heap_INCREF (Heap_Module m); export void Heap_InitHeap (void); export void Heap_Lock (void); -static void Heap_Mark (uintptr q); -static void Heap_MarkCandidates (uintptr n, uintptr *cand, LONGINT cand__len); +static void Heap_Mark (address q); +static void Heap_MarkCandidates (address n, address *cand, LONGINT cand__len); static void Heap_MarkP (SYSTEM_PTR p); -static void Heap_MarkStack (uintptr n, uintptr *cand, LONGINT cand__len); -export SYSTEM_PTR Heap_NEWBLK (uintptr size); -export SYSTEM_PTR Heap_NEWREC (uintptr tag); -static uintptr Heap_NewChunk (uintptr blksz); +static void Heap_MarkStack (address n, address *cand, LONGINT cand__len); +export SYSTEM_PTR Heap_NEWBLK (address size); +export SYSTEM_PTR Heap_NEWREC (address tag); +static address Heap_NewChunk (address blksz); export void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); export SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -export void Heap_REGTYP (Heap_Module m, uintptr typ); +export void Heap_REGTYP (Heap_Module m, address typ); export void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); static void Heap_Scan (void); -static void Heap_Sift (uintptr l, uintptr r, uintptr *a, LONGINT a__len); +static void Heap_Sift (address l, address r, address *a, LONGINT a__len); export void Heap_Unlock (void); extern void *Heap__init(); -extern uintptr Platform_MainStackFrame; -extern uintptr Platform_OSAllocate(uintptr size); -#define Heap_FetchAddress(pointer) (uintptr)(*((void**)((uintptr)pointer))) +extern address Platform_MainStackFrame; +extern address Platform_OSAllocate(address size); +#define Heap_FetchAddress(pointer) (address)(*((void**)((address)pointer))) #define Heap_HeapModuleInit() Heap__init() #define Heap_OSAllocate(size) Platform_OSAllocate(size) #define Heap_PlatformHalt(code) Platform_Halt(code) @@ -135,7 +135,7 @@ SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) __COPY(name, m->name, 20); m->refcnt = 0; m->enumPtrs = enumPtrs; - m->next = (Heap_Module)(uintptr)Heap_modules; + m->next = (Heap_Module)(address)Heap_modules; Heap_modules = (SYSTEM_PTR)m; _o_result = (void*)m; return _o_result; @@ -155,9 +155,9 @@ void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) m->cmds = c; } -void Heap_REGTYP (Heap_Module m, uintptr typ) +void Heap_REGTYP (Heap_Module m, address typ) { - __PUT(typ, m->types, uintptr); + __PUT(typ, m->types, address); m->types = typ; } @@ -166,17 +166,17 @@ void Heap_INCREF (Heap_Module m) m->refcnt += 1; } -static uintptr Heap_NewChunk (uintptr blksz) +static address Heap_NewChunk (address blksz) { - uintptr _o_result; - uintptr chnk; + address _o_result; + address chnk; chnk = Heap_OSAllocate(blksz + 24); if (chnk != 0) { - __PUT(chnk + 8, chnk + (24 + blksz), uintptr); - __PUT(chnk + 24, chnk + 32, uintptr); - __PUT(chnk + 32, blksz, uintptr); - __PUT(chnk + 40, -8, uintptr); - __PUT(chnk + 48, Heap_bigBlocks, uintptr); + __PUT(chnk + 8, chnk + (24 + blksz), address); + __PUT(chnk + 24, chnk + 32, address); + __PUT(chnk + 32, blksz, address); + __PUT(chnk + 40, -8, address); + __PUT(chnk + 48, Heap_bigBlocks, address); Heap_bigBlocks = chnk + 24; Heap_heapsize += blksz; } @@ -184,9 +184,9 @@ static uintptr Heap_NewChunk (uintptr blksz) return _o_result; } -static void Heap_ExtendHeap (uintptr blksz) +static void Heap_ExtendHeap (address blksz) { - uintptr size, chnk, j, next; + address size, chnk, j, next; if (blksz > 320000) { size = blksz; } else { @@ -195,7 +195,7 @@ static void Heap_ExtendHeap (uintptr blksz) chnk = Heap_NewChunk(size); if (chnk != 0) { if (chnk < Heap_heap) { - __PUT(chnk, Heap_heap, uintptr); + __PUT(chnk, Heap_heap, address); Heap_heap = chnk; } else { j = Heap_heap; @@ -204,8 +204,8 @@ static void Heap_ExtendHeap (uintptr blksz) j = next; next = Heap_FetchAddress(j); } - __PUT(chnk, next, uintptr); - __PUT(j, chnk, uintptr); + __PUT(chnk, next, address); + __PUT(j, chnk, address); } if (next == 0) { Heap_heapend = Heap_FetchAddress(chnk + 8); @@ -213,10 +213,10 @@ static void Heap_ExtendHeap (uintptr blksz) } } -SYSTEM_PTR Heap_NEWREC (uintptr tag) +SYSTEM_PTR Heap_NEWREC (address tag) { SYSTEM_PTR _o_result; - uintptr i, i0, di, blksz, restsize, t, adr, end, next, prev; + address i, i0, di, blksz, restsize, t, adr, end, next, prev; SYSTEM_PTR new; Heap_Lock(); blksz = Heap_FetchAddress(tag); @@ -236,11 +236,11 @@ SYSTEM_PTR Heap_NEWREC (uintptr tag) di = i - i0; restsize = __ASHL(di, 5); end = adr + restsize; - __PUT(end + 8, blksz, uintptr); - __PUT(end + 16, -8, uintptr); - __PUT(end, end + 8, uintptr); - __PUT(adr + 8, restsize, uintptr); - __PUT(adr + 24, Heap_freeList[di], uintptr); + __PUT(end + 8, blksz, address); + __PUT(end + 16, -8, address); + __PUT(end, end + 8, address); + __PUT(adr + 8, restsize, address); + __PUT(adr + 24, Heap_freeList[di], address); Heap_freeList[di] = adr; adr += restsize; } @@ -280,22 +280,22 @@ SYSTEM_PTR Heap_NEWREC (uintptr tag) } restsize = t - blksz; end = adr + restsize; - __PUT(end + 8, blksz, uintptr); - __PUT(end + 16, -8, uintptr); - __PUT(end, end + 8, uintptr); + __PUT(end + 8, blksz, address); + __PUT(end + 16, -8, address); + __PUT(end, end + 8, address); if (restsize > 288) { - __PUT(adr + 8, restsize, uintptr); + __PUT(adr + 8, restsize, address); } else { next = Heap_FetchAddress(adr + 24); if (prev == 0) { Heap_bigBlocks = next; } else { - __PUT(prev + 24, next, uintptr); + __PUT(prev + 24, next, address); } if (restsize > 0) { di = __ASHR(restsize, 5); - __PUT(adr + 8, restsize, uintptr); - __PUT(adr + 24, Heap_freeList[di], uintptr); + __PUT(adr + 8, restsize, address); + __PUT(adr + 24, Heap_freeList[di], address); Heap_freeList[di] = adr; } } @@ -304,53 +304,53 @@ SYSTEM_PTR Heap_NEWREC (uintptr tag) i = adr + 32; end = adr + blksz; while (i < end) { - __PUT(i, 0, uintptr); - __PUT(i + 8, 0, uintptr); - __PUT(i + 16, 0, uintptr); - __PUT(i + 24, 0, uintptr); + __PUT(i, 0, address); + __PUT(i + 8, 0, address); + __PUT(i + 16, 0, address); + __PUT(i + 24, 0, address); i += 32; } - __PUT(adr + 24, 0, uintptr); - __PUT(adr, tag, uintptr); - __PUT(adr + 8, 0, uintptr); - __PUT(adr + 16, 0, uintptr); + __PUT(adr + 24, 0, address); + __PUT(adr, tag, address); + __PUT(adr + 8, 0, address); + __PUT(adr + 16, 0, address); Heap_allocated += blksz; Heap_Unlock(); - _o_result = (SYSTEM_PTR)(uintptr)(adr + 8); + _o_result = (SYSTEM_PTR)(address)(adr + 8); return _o_result; } -SYSTEM_PTR Heap_NEWBLK (uintptr size) +SYSTEM_PTR Heap_NEWBLK (address size) { SYSTEM_PTR _o_result; - uintptr blksz, tag; + address blksz, tag; SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 63, 5), 5); - new = Heap_NEWREC((uintptr)&blksz); - tag = ((uintptr)(uintptr)new + blksz) - 24; - __PUT(tag - 8, 0, uintptr); - __PUT(tag, blksz, uintptr); - __PUT(tag + 8, -8, uintptr); - __PUT((uintptr)(uintptr)new - 8, tag, uintptr); + new = Heap_NEWREC((address)&blksz); + tag = ((address)(address)new + blksz) - 24; + __PUT(tag - 8, 0, address); + __PUT(tag, blksz, address); + __PUT(tag + 8, -8, address); + __PUT((address)(address)new - 8, tag, address); Heap_Unlock(); _o_result = new; return _o_result; } -static void Heap_Mark (uintptr q) +static void Heap_Mark (address q) { - uintptr p, tag, offset, fld, n, tagbits; + address p, tag, offset, fld, n, tagbits; if (q != 0) { tagbits = Heap_FetchAddress(q - 8); if (!__ODD(tagbits)) { - __PUT(q - 8, tagbits + 1, uintptr); + __PUT(q - 8, tagbits + 1, address); p = 0; tag = tagbits + 8; for (;;) { - __GET(tag, offset, uintptr); - if (__BIT((uintptr)&offset, 63)) { - __PUT(q - 8, (tag + offset) + 1, uintptr); + __GET(tag, offset, address); + if (__BIT((address)&offset, 63)) { + __PUT(q - 8, (tag + offset) + 1, address); if (p == 0) { break; } @@ -358,19 +358,19 @@ static void Heap_Mark (uintptr q) q = p; tag = Heap_FetchAddress(q - 8); tag -= 1; - __GET(tag, offset, uintptr); + __GET(tag, offset, address); fld = q + offset; p = Heap_FetchAddress(fld); - __PUT(fld, (SYSTEM_PTR)(uintptr)n, SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(address)n, SYSTEM_PTR); } else { fld = q + offset; n = Heap_FetchAddress(fld); if (n != 0) { tagbits = Heap_FetchAddress(n - 8); if (!__ODD(tagbits)) { - __PUT(n - 8, tagbits + 1, uintptr); - __PUT(q - 8, tag + 1, uintptr); - __PUT(fld, (SYSTEM_PTR)(uintptr)p, SYSTEM_PTR); + __PUT(n - 8, tagbits + 1, address); + __PUT(q - 8, tag + 1, address); + __PUT(fld, (SYSTEM_PTR)(address)p, SYSTEM_PTR); p = q; q = n; tag = tagbits; @@ -385,12 +385,12 @@ static void Heap_Mark (uintptr q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((uintptr)(uintptr)p); + Heap_Mark((address)(address)p); } static void Heap_Scan (void) { - uintptr chnk, adr, end, start, tag, i, size, freesize; + address chnk, adr, end, start, tag, i, size, freesize; Heap_bigBlocks = 0; i = 1; while (i < 9) { @@ -408,21 +408,21 @@ static void Heap_Scan (void) if (__ODD(tag)) { if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 8, uintptr); - __PUT(start + 8, freesize, uintptr); - __PUT(start + 16, -8, uintptr); + __PUT(start, start + 8, address); + __PUT(start + 8, freesize, address); + __PUT(start + 16, -8, address); i = __ASHR(freesize, 5); freesize = 0; if (i < 9) { - __PUT(start + 24, Heap_freeList[i], uintptr); + __PUT(start + 24, Heap_freeList[i], address); Heap_freeList[i] = start; } else { - __PUT(start + 24, Heap_bigBlocks, uintptr); + __PUT(start + 24, Heap_bigBlocks, address); Heap_bigBlocks = start; } } tag -= 1; - __PUT(adr, tag, uintptr); + __PUT(adr, tag, address); size = Heap_FetchAddress(tag); Heap_allocated += size; adr += size; @@ -434,16 +434,16 @@ static void Heap_Scan (void) } if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 8, uintptr); - __PUT(start + 8, freesize, uintptr); - __PUT(start + 16, -8, uintptr); + __PUT(start, start + 8, address); + __PUT(start + 8, freesize, address); + __PUT(start + 16, -8, address); i = __ASHR(freesize, 5); freesize = 0; if (i < 9) { - __PUT(start + 24, Heap_freeList[i], uintptr); + __PUT(start + 24, Heap_freeList[i], address); Heap_freeList[i] = start; } else { - __PUT(start + 24, Heap_bigBlocks, uintptr); + __PUT(start + 24, Heap_bigBlocks, address); Heap_bigBlocks = start; } } @@ -451,9 +451,9 @@ static void Heap_Scan (void) } } -static void Heap_Sift (uintptr l, uintptr r, uintptr *a, LONGINT a__len) +static void Heap_Sift (address l, address r, address *a, LONGINT a__len) { - uintptr i, j, x; + address i, j, x; j = l; x = a[j]; for (;;) { @@ -470,9 +470,9 @@ static void Heap_Sift (uintptr l, uintptr r, uintptr *a, LONGINT a__len) a[i] = x; } -static void Heap_HeapSort (uintptr n, uintptr *a, LONGINT a__len) +static void Heap_HeapSort (address n, address *a, LONGINT a__len) { - uintptr l, r, x; + address l, r, x; l = __ASHR(n, 1); r = n - 1; while (l > 0) { @@ -488,9 +488,9 @@ static void Heap_HeapSort (uintptr n, uintptr *a, LONGINT a__len) } } -static void Heap_MarkCandidates (uintptr n, uintptr *cand, LONGINT cand__len) +static void Heap_MarkCandidates (address n, address *cand, LONGINT cand__len) { - uintptr chnk, adr, tag, next, lim, lim1, i, ptr, size; + address chnk, adr, tag, next, lim, lim1, i, ptr, size; chnk = Heap_heap; i = 0; lim = cand[n - 1]; @@ -528,7 +528,7 @@ static void Heap_MarkCandidates (uintptr n, uintptr *cand, LONGINT cand__len) static void Heap_CheckFin (void) { Heap_FinNode n; - uintptr tag; + address tag; n = Heap_fin; while (n != NIL) { tag = Heap_FetchAddress(n->obj - 8); @@ -554,7 +554,7 @@ static void Heap_Finalize (void) } else { prev->next = n->next; } - (*n->finalize)((SYSTEM_PTR)(uintptr)n->obj); + (*n->finalize)((SYSTEM_PTR)(address)n->obj); if (prev == NIL) { n = Heap_fin; } else { @@ -573,14 +573,14 @@ void Heap_FINALL (void) while (Heap_fin != NIL) { n = Heap_fin; Heap_fin = Heap_fin->next; - (*n->finalize)((SYSTEM_PTR)(uintptr)n->obj); + (*n->finalize)((SYSTEM_PTR)(address)n->obj); } } -static void Heap_MarkStack (uintptr n, uintptr *cand, LONGINT cand__len) +static void Heap_MarkStack (address n, address *cand, LONGINT cand__len) { SYSTEM_PTR frame; - uintptr inc, nofcand, sp, p, stack0; + address inc, nofcand, sp, p, stack0; struct Heap__1 align; if (n > 0) { Heap_MarkStack(n - 1, cand, cand__len); @@ -590,14 +590,14 @@ static void Heap_MarkStack (uintptr n, uintptr *cand, LONGINT cand__len) } if (n == 0) { nofcand = 0; - sp = (uintptr)&frame; + sp = (address)&frame; stack0 = Heap_PlatformMainStackFrame(); - inc = (uintptr)&align.p - (uintptr)&align; + inc = (address)&align.p - (address)&align; if (sp > stack0) { inc = -inc; } while (sp != stack0) { - __GET(sp, p, uintptr); + __GET(sp, p, address); if ((p > Heap_heap && p < Heap_heapend)) { if (nofcand == cand__len) { Heap_HeapSort(nofcand, (void*)cand, cand__len); @@ -619,11 +619,11 @@ static void Heap_MarkStack (uintptr n, uintptr *cand, LONGINT cand__len) void Heap_GC (BOOLEAN markStack) { Heap_Module m; - uintptr i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; - uintptr cand[10000]; + address i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; + address cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); - m = (Heap_Module)(uintptr)Heap_modules; + m = (Heap_Module)(address)Heap_modules; while (m != NIL) { if (m->enumPtrs != NIL) { (*m->enumPtrs)(Heap_MarkP); @@ -700,7 +700,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (uintptr)(uintptr)obj; + f->obj = (address)(address)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; @@ -711,7 +711,7 @@ void Heap_InitHeap (void) { Heap_heap = Heap_NewChunk(256000); Heap_heapend = Heap_FetchAddress(Heap_heap + 8); - __PUT(Heap_heap, 0, uintptr); + __PUT(Heap_heap, 0, address); Heap_allocated = 0; Heap_firstTry = 1; Heap_freeList[9] = 1; diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index 82ba661b..b547af41 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h @@ -32,7 +32,7 @@ typedef import SYSTEM_PTR Heap_modules; -import uintptr Heap_allocated, Heap_heapsize; +import address Heap_allocated, Heap_heapsize; import int32 Heap_FileCount; import LONGINT *Heap_ModuleDesc__typ; @@ -42,11 +42,11 @@ import void Heap_GC (BOOLEAN markStack); import void Heap_INCREF (Heap_Module m); import void Heap_InitHeap (void); import void Heap_Lock (void); -import SYSTEM_PTR Heap_NEWBLK (uintptr size); -import SYSTEM_PTR Heap_NEWREC (uintptr tag); +import SYSTEM_PTR Heap_NEWBLK (address size); +import SYSTEM_PTR Heap_NEWREC (address tag); import void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); import SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -import void Heap_REGTYP (Heap_Module m, uintptr typ); +import void Heap_REGTYP (Heap_Module m, address typ); import void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); import void Heap_Unlock (void); import void *Heap__init(void); diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 7db3d54c..bce66b2e 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index fe368fa3..544820fd 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index 5ede35ed..1414fc79 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index 6b193164..718d88bb 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index d4a0fc06..fad896b9 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -201,8 +201,8 @@ void OPC_Ident (OPT_Object obj) } } } else if ((mode == 5 && obj->typ->form == 4)) { - if (obj->typ == OPT_pinttyp) { - OPM_WriteString((CHAR*)"uintptr", 8); + if (obj->typ == OPT_adrtyp) { + OPM_WriteString((CHAR*)"address", 8); } else { OPM_WriteString((CHAR*)"int", 4); OPM_WriteInt(__ASHL(obj->typ->size, 3)); @@ -2048,7 +2048,7 @@ static void OPC_InitKeywords (void) OPC_hashtab[__X(i, 105)] = -1; i += 1; } - Enter__49((CHAR*)"adrint", 7); + Enter__49((CHAR*)"address", 8); Enter__49((CHAR*)"asm", 4); Enter__49((CHAR*)"auto", 5); Enter__49((CHAR*)"break", 6); @@ -2085,7 +2085,6 @@ static void OPC_InitKeywords (void) Enter__49((CHAR*)"struct", 7); Enter__49((CHAR*)"switch", 7); Enter__49((CHAR*)"typedef", 8); - Enter__49((CHAR*)"uintptr", 8); Enter__49((CHAR*)"uint16", 7); Enter__49((CHAR*)"uint32", 7); Enter__49((CHAR*)"uint64", 7); diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index 90ff6275..ac5c7677 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 44c0d929..f410e6d3 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -545,7 +545,7 @@ void OPM_FPrintReal (int64 *fp, REAL real) { int32 i; int64 l; - __GET((uintptr)&real, i, int32); + __GET((address)&real, i, int32); l = i; OPM_FPrint(&*fp, l); } diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index 3e1ddd3d..cc77f079 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index 0ac463ca..6c3c14fe 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPB.h" diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index bd26983c..9aba4ad7 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index 5ae4fbdf..e0988fb0 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index 5fcf9030..1601514e 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index d5057c1d..c08c86af 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" @@ -84,7 +84,7 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; -export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_pinttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; export int8 OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; @@ -1768,7 +1768,7 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_sinttyp); P(OPT_inttyp); P(OPT_linttyp); - P(OPT_pinttyp); + P(OPT_adrtyp); P(OPT_int8typ); P(OPT_int16typ); P(OPT_int32typ); @@ -1850,7 +1850,7 @@ export void *OPT__init(void) OPT_InitStruct(&OPT_niltyp, 9); OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp); OPT_EnterTyp((CHAR*)"PTR", 11, OPM_PointerSize, &OPT_sysptrtyp); - OPT_EnterTyp((CHAR*)"UINTPTR", 4, OPM_PointerSize, &OPT_pinttyp); + OPT_EnterTyp((CHAR*)"ADDRESS", 4, OPM_PointerSize, &OPT_adrtyp); OPT_EnterTyp((CHAR*)"INT8", 4, 1, &OPT_int8typ); OPT_EnterTyp((CHAR*)"INT16", 4, 2, &OPT_int16typ); OPT_EnterTyp((CHAR*)"INT32", 4, 4, &OPT_int32typ); diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index aefdfd2a..f50911dd 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h @@ -68,7 +68,7 @@ typedef import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; -import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_pinttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; import int8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 7edc861b..b8c77e55 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPC.h" @@ -286,7 +286,7 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_realtyp->strobj->linkadr = 2; OPT_inttyp->strobj->linkadr = 2; OPT_linttyp->strobj->linkadr = 2; - OPT_pinttyp->strobj->linkadr = 2; + OPT_adrtyp->strobj->linkadr = 2; OPT_int8typ->strobj->linkadr = 2; OPT_int16typ->strobj->linkadr = 2; OPT_int32typ->strobj->linkadr = 2; @@ -939,7 +939,7 @@ static void OPV_expr (OPT_Node n, int32 prec) OPM_Write(')'); break; case 24: - OPM_WriteString((CHAR*)"(uintptr)", 10); + OPM_WriteString((CHAR*)"(address)", 10); if (l->class == 1) { OPC_CompleteIdent(l->obj); } else { @@ -955,7 +955,7 @@ static void OPV_expr (OPT_Node n, int32 prec) OPC_Ident(n->typ->strobj); OPM_Write(')'); if (__IN(n->typ->form, 0x1800) || __IN(l->typ->form, 0x1800)) { - OPM_WriteString((CHAR*)"(uintptr)", 10); + OPM_WriteString((CHAR*)"(address)", 10); } OPV_expr(l, exprPrec); } else { @@ -1327,7 +1327,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) if (x->class == 7) { OPC_IntLiteral(x->conval->intval, OPM_PointerSize); } else { - OPM_WriteString((CHAR*)"((uintptr)(", 12); + OPM_WriteString((CHAR*)"((address)(", 12); OPV_expr(x, 10); OPM_WriteString((CHAR*)"))", 3); } diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index 6e3e6c65..92c13a0a 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 0135ee93..128d21e0 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -27,11 +27,12 @@ typedef export BOOLEAN Platform_LittleEndian; -export int64 Platform_MainStackFrame, Platform_HaltCode; +export address Platform_MainStackFrame; +export int64 Platform_HaltCode; export int32 Platform_PID; export CHAR Platform_CWD[4096]; export int32 Platform_ArgCount; -export int64 Platform_ArgVector; +export address Platform_ArgVector; static Platform_HaltProcedure Platform_HaltHandler; static int64 Platform_TimeStart; export int32 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; @@ -61,12 +62,12 @@ export void Platform_Halt (int64 code); export int32 Platform_Identify (int64 h, Platform_FileIdentity *identity, LONGINT *identity__typ); export int32 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); export BOOLEAN Platform_Inaccessible (int32 e); -export void Platform_Init (int32 argc, int64 argvadr); +export void Platform_Init (int32 argc, address argvadr); export void Platform_MTimeAsClock (Platform_FileIdentity i, int64 *t, int64 *d); export int32 Platform_New (CHAR *n, LONGINT n__len, int64 *h); export BOOLEAN Platform_NoSuchDirectory (int32 e); -export int64 Platform_OSAllocate (int64 size); -export void Platform_OSFree (int64 address); +export address Platform_OSAllocate (address size); +export void Platform_OSFree (address address); export int32 Platform_OldRO (CHAR *n, LONGINT n__len, int64 *h); export int32 Platform_OldRW (CHAR *n, LONGINT n__len, int64 *h); export int32 Platform_Read (int64 h, int64 p, int64 l, int64 *n); @@ -112,9 +113,9 @@ export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT extern void Heap_InitHeap(); #define Platform_GetTickCount() (LONGINT)(uint32)GetTickCount() #define Platform_HeapInitHeap() Heap_InitHeap() -#define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((SYSTEM_ADRINT)h) -#define Platform_SetQuitHandler(h) SystemSetQuitHandler((SYSTEM_ADRINT)h) -#define Platform_allocate(size) (LONGINT)(SYSTEM_ADRINT)((void*)HeapAlloc(GetProcessHeap(), 0, (size_t)size)) +#define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((address)h) +#define Platform_SetQuitHandler(h) SystemSetQuitHandler((address)h) +#define Platform_allocate(size) (address)((void*)HeapAlloc(GetProcessHeap(), 0, (size_t)size)) #define Platform_bhfiIndexHigh() (LONGINT)bhfi.nFileIndexHigh #define Platform_bhfiIndexLow() (LONGINT)bhfi.nFileIndexLow #define Platform_bhfiMtimeHigh() (LONGINT)bhfi.ftLastWriteTime.dwHighDateTime @@ -122,44 +123,44 @@ extern void Heap_InitHeap(); #define Platform_bhfiVsn() (LONGINT)bhfi.dwVolumeSerialNumber #define Platform_byHandleFileInformation() BY_HANDLE_FILE_INFORMATION bhfi #define Platform_cleanupProcess() CloseHandle(pi.hProcess); CloseHandle(pi.hThread); -#define Platform_closeHandle(h) (INTEGER)CloseHandle((HANDLE)(SYSTEM_ADRINT)h) +#define Platform_closeHandle(h) (INTEGER)CloseHandle((HANDLE)(address)h) #define Platform_createProcess(str, str__len) (INTEGER)CreateProcess(0, (char*)str, 0,0,0,0,0,0,&si,&pi) #define Platform_deleteFile(n, n__len) (INTEGER)DeleteFile((char*)n) #define Platform_err() (INTEGER)GetLastError() -#define Platform_errc(c) WriteFile((HANDLE)(SYSTEM_ADRINT)Platform_StdOut, &c, 1, 0,0) -#define Platform_errstring(s, s__len) WriteFile((HANDLE)(SYSTEM_ADRINT)Platform_StdOut, s, s__len-1, 0,0) +#define Platform_errc(c) WriteFile((HANDLE)(address)Platform_StdOut, &c, 1, 0,0) +#define Platform_errstring(s, s__len) WriteFile((HANDLE)(address)Platform_StdOut, s, s__len-1, 0,0) #define Platform_exit(code) ExitProcess((UINT)code) #define Platform_fileTimeToSysTime() SYSTEMTIME st; FileTimeToSystemTime(&ft, &st) -#define Platform_flushFileBuffers(h) (INTEGER)FlushFileBuffers((HANDLE)(SYSTEM_ADRINT)h) -#define Platform_free(address) HeapFree(GetProcessHeap(), 0, (void*)(SYSTEM_ADRINT)address) +#define Platform_flushFileBuffers(h) (INTEGER)FlushFileBuffers((HANDLE)(address)h) +#define Platform_free(address) HeapFree(GetProcessHeap(), 0, (void*)address) #define Platform_ftToUli() ULARGE_INTEGER ul; ul.LowPart=ft.dwLowDateTime; ul.HighPart=ft.dwHighDateTime #define Platform_getCurrentDirectory(n, n__len) GetCurrentDirectory(n__len, (char*)n) #define Platform_getExitCodeProcess(exitcode) GetExitCodeProcess(pi.hProcess, (DWORD*)exitcode); -#define Platform_getFileInformationByHandle(h) (INTEGER)GetFileInformationByHandle((HANDLE)(SYSTEM_ADRINT)h, &bhfi) -#define Platform_getFilePos(h, r, rc) LARGE_INTEGER liz = {0}; *rc = (INTEGER)SetFilePointerEx((HANDLE)(SYSTEM_ADRINT)h, liz, &li, FILE_CURRENT); *r = (LONGINT)li.QuadPart -#define Platform_getFileSize(h) (INTEGER)GetFileSizeEx((HANDLE)(SYSTEM_ADRINT)h, &li) +#define Platform_getFileInformationByHandle(h) (INTEGER)GetFileInformationByHandle((HANDLE)(address)h, &bhfi) +#define Platform_getFilePos(h, r, rc) LARGE_INTEGER liz = {0}; *rc = (INTEGER)SetFilePointerEx((HANDLE)(address)h, liz, &li, FILE_CURRENT); *r = (LONGINT)li.QuadPart +#define Platform_getFileSize(h) (INTEGER)GetFileSizeEx((HANDLE)(address)h, &li) #define Platform_getLocalTime() SYSTEMTIME st; GetLocalTime(&st) #define Platform_getenv(name, name__len, buf, buf__len) (INTEGER)GetEnvironmentVariable((char*)name, (char*)buf, buf__len) #define Platform_getpid() (INTEGER)GetCurrentProcessId() -#define Platform_getstderrhandle() (SYSTEM_ADRINT)GetStdHandle(STD_ERROR_HANDLE) -#define Platform_getstdinhandle() (SYSTEM_ADRINT)GetStdHandle(STD_INPUT_HANDLE) -#define Platform_getstdouthandle() (SYSTEM_ADRINT)GetStdHandle(STD_OUTPUT_HANDLE) +#define Platform_getstderrhandle() (address)GetStdHandle(STD_ERROR_HANDLE) +#define Platform_getstdinhandle() (address)GetStdHandle(STD_INPUT_HANDLE) +#define Platform_getstdouthandle() (address)GetStdHandle(STD_OUTPUT_HANDLE) #define Platform_identityToFileTime(i) FILETIME ft; ft.dwHighDateTime = i.mtimehigh; ft.dwLowDateTime = i.mtimelow -#define Platform_invalidHandleValue() ((LONGINT)(SYSTEM_ADRINT)INVALID_HANDLE_VALUE) +#define Platform_invalidHandleValue() ((LONGINT)(address)INVALID_HANDLE_VALUE) #define Platform_largeInteger() LARGE_INTEGER li #define Platform_liLongint() (LONGINT)li.QuadPart #define Platform_moveFile(o, o__len, n, n__len) (INTEGER)MoveFileEx((char*)o, (char*)n, MOVEFILE_REPLACE_EXISTING) -#define Platform_opennew(n, n__len) (LONGINT)(SYSTEM_ADRINT)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0) -#define Platform_openro(n, n__len) (LONGINT)(SYSTEM_ADRINT)CreateFile((char*)n, GENERIC_READ , FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) -#define Platform_openrw(n, n__len) (LONGINT)(SYSTEM_ADRINT)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) +#define Platform_opennew(n, n__len) (LONGINT)(address)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0) +#define Platform_openro(n, n__len) (LONGINT)(address)CreateFile((char*)n, GENERIC_READ , FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) +#define Platform_openrw(n, n__len) (LONGINT)(address)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) #define Platform_processInfo() PROCESS_INFORMATION pi = {0}; -#define Platform_readfile(fd, p, l, n) (INTEGER)ReadFile ((HANDLE)(SYSTEM_ADRINT)fd, (void*)(SYSTEM_ADRINT)(p), (DWORD)l, (DWORD*)n, 0) +#define Platform_readfile(fd, p, l, n) (INTEGER)ReadFile ((HANDLE)(address)fd, (void*)(address)(p), (DWORD)l, (DWORD*)n, 0) #define Platform_seekcur() FILE_CURRENT #define Platform_seekend() FILE_END #define Platform_seekset() FILE_BEGIN #define Platform_setCurrentDirectory(n, n__len) (INTEGER)SetCurrentDirectory((char*)n) -#define Platform_setEndOfFile(h) (INTEGER)SetEndOfFile((HANDLE)(SYSTEM_ADRINT)h) -#define Platform_setFilePointerEx(h, o, r, rc) li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((HANDLE)(SYSTEM_ADRINT)h, li, 0, (DWORD)r) +#define Platform_setEndOfFile(h) (INTEGER)SetEndOfFile((HANDLE)(address)h) +#define Platform_setFilePointerEx(h, o, r, rc) li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((HANDLE)(address)h, li, 0, (DWORD)r) #define Platform_sleep(ms) Sleep((DWORD)ms) #define Platform_stToFt() FILETIME ft; SystemTimeToFileTime(&st, &ft) #define Platform_startupInfo() STARTUPINFO si = {0}; si.cb = sizeof(si); @@ -174,7 +175,7 @@ extern void Heap_InitHeap(); #define Platform_ulSec() (LONGINT)(ul.QuadPart / 1000000LL) #define Platform_uluSec() (LONGINT)(ul.QuadPart % 1000000LL) #define Platform_waitForProcess() (INTEGER)WaitForSingleObject(pi.hProcess, INFINITE) -#define Platform_writefile(fd, p, l) (INTEGER)WriteFile((HANDLE)(SYSTEM_ADRINT)fd, (void*)(SYSTEM_ADRINT)(p), (DWORD)l, 0,0) +#define Platform_writefile(fd, p, l) (INTEGER)WriteFile((HANDLE)(address)fd, (void*)(address)(p), (DWORD)l, 0,0) BOOLEAN Platform_TooManyFiles (int32 e) { @@ -225,24 +226,24 @@ BOOLEAN Platform_ConnectionFailed (int32 e) return _o_result; } -int64 Platform_OSAllocate (int64 size) +address Platform_OSAllocate (address size) { - int64 _o_result; + address _o_result; _o_result = Platform_allocate(size); return _o_result; } -void Platform_OSFree (int64 address) +void Platform_OSFree (address address) { Platform_free(address); } -void Platform_Init (int32 argc, int64 argvadr) +void Platform_Init (int32 argc, address argvadr) { Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; Platform_ArgCount = argc; - av = (Platform_ArgVecPtr)(uintptr)argvadr; + av = (Platform_ArgVecPtr)(address)argvadr; Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; Platform_HeapInitHeap(); @@ -281,7 +282,7 @@ void Platform_GetArg (int32 n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { - av = (Platform_ArgVec)(uintptr)Platform_ArgVector; + av = (Platform_ArgVec)(address)Platform_ArgVector; __COPY(*(*av)[__X(n, 1024)], val, val__len); } } @@ -560,7 +561,7 @@ int32 Platform_ReadBuf (int64 h, SYSTEM_BYTE *b, LONGINT b__len, int64 *n) int32 _o_result; int32 result; *n = 0; - result = Platform_readfile(h, (uintptr)b, b__len, &*n); + result = Platform_readfile(h, (address)b, b__len, &*n); if (result == 0) { *n = 0; _o_result = Platform_err(); @@ -746,8 +747,23 @@ static void Platform_DisplayHaltCode (int64 code) case -9: Platform_errstring((CHAR*)"Heap interrupted while locked, but lockdepth = 0 at unlock.", 60); break; + case -10: + Platform_errstring((CHAR*)"NIL access.", 12); + break; + case -11: + Platform_errstring((CHAR*)"Alignment error.", 17); + break; + case -12: + Platform_errstring((CHAR*)"Divide by zero.", 16); + break; + case -13: + Platform_errstring((CHAR*)"Arithmetic overflow/underflow.", 31); + break; + case -14: + Platform_errstring((CHAR*)"Invalid function argument.", 27); + break; case -15: - Platform_errstring((CHAR*)"Type descriptor size mismatch.", 31); + Platform_errstring((CHAR*)"Internal error, e.g. Type descriptor size mismatch.", 52); break; case -20: Platform_errstring((CHAR*)"Too many, or negative number of, elements in dynamic array.", 60); @@ -796,7 +812,7 @@ static void Platform_TestLittleEndian (void) { int32 i; i = 1; - __GET((uintptr)&i, Platform_LittleEndian, BOOLEAN); + __GET((address)&i, Platform_LittleEndian, BOOLEAN); } __TDESC(Platform_FileIdentity, 1, 0) = {__TDFLDS("FileIdentity", 40), {-8}}; diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index f3b3574f..25f6197f 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h @@ -20,11 +20,12 @@ typedef import BOOLEAN Platform_LittleEndian; -import int64 Platform_MainStackFrame, Platform_HaltCode; +import address Platform_MainStackFrame; +import int64 Platform_HaltCode; import int32 Platform_PID; import CHAR Platform_CWD[4096]; import int32 Platform_ArgCount; -import int64 Platform_ArgVector; +import address Platform_ArgVector; import int32 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; import int64 Platform_StdIn, Platform_StdOut, Platform_StdErr; import CHAR Platform_nl[3]; @@ -50,12 +51,12 @@ import void Platform_Halt (int64 code); import int32 Platform_Identify (int64 h, Platform_FileIdentity *identity, LONGINT *identity__typ); import int32 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); import BOOLEAN Platform_Inaccessible (int32 e); -import void Platform_Init (int32 argc, int64 argvadr); +import void Platform_Init (int32 argc, address argvadr); import void Platform_MTimeAsClock (Platform_FileIdentity i, int64 *t, int64 *d); import int32 Platform_New (CHAR *n, LONGINT n__len, int64 *h); import BOOLEAN Platform_NoSuchDirectory (int32 e); -import int64 Platform_OSAllocate (int64 size); -import void Platform_OSFree (int64 address); +import address Platform_OSAllocate (address size); +import void Platform_OSFree (address address); import int32 Platform_OldRO (CHAR *n, LONGINT n__len, int64 *h); import int32 Platform_OldRW (CHAR *n, LONGINT n__len, int64 *h); import int32 Platform_Read (int64 h, int64 p, int64 l, int64 *n); @@ -79,7 +80,7 @@ import int32 Platform_Write (int64 h, int64 p, int64 l); import BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); import void *Platform__init(void); -#define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((SYSTEM_ADRINT)h) -#define Platform_SetQuitHandler(h) SystemSetQuitHandler((SYSTEM_ADRINT)h) +#define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((address)h) +#define Platform_SetQuitHandler(h) SystemSetQuitHandler((address)h) #endif diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 4aafefde..80ca4829 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -59,7 +59,7 @@ int32 Reals_Expo (REAL x) { int32 _o_result; int32 i; - __GET((uintptr)&x + 2, i, int32); + __GET((address)&x + 2, i, int32); _o_result = __MASK(__ASHR(i, 7), -256); return _o_result; } @@ -67,17 +67,17 @@ int32 Reals_Expo (REAL x) void Reals_SetExpo (REAL *x, int32 ex) { CHAR c; - __GET((uintptr)x + 3, c, CHAR); - __PUT((uintptr)x + 3, (CHAR)(__ASHL(__ASHR(c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); - __GET((uintptr)x + 2, c, CHAR); - __PUT((uintptr)x + 2, (CHAR)(__MASK(c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); + __GET((address)x + 3, c, CHAR); + __PUT((address)x + 3, (CHAR)(__ASHL(__ASHR(c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __GET((address)x + 2, c, CHAR); + __PUT((address)x + 2, (CHAR)(__MASK(c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } int32 Reals_ExpoL (LONGREAL x) { int32 _o_result; int32 i; - __GET((uintptr)&x + 6, i, int32); + __GET((address)&x + 6, i, int32); _o_result = __MASK(__ASHR(i, 4), -2048); return _o_result; } diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index 1b6d1f96..da0c1f86 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/SYSTEM.c b/bootstrap/windows-88/SYSTEM.c index 16681ab8..821a6096 100644 --- a/bootstrap/windows-88/SYSTEM.c +++ b/bootstrap/windows-88/SYSTEM.c @@ -38,7 +38,7 @@ void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0) void SYSTEM_ENUMP(void *adr, LONGINT n, void (*P)()) { while (n > 0) { - P((uintptr)(*((void**)(adr)))); + P((address)(*((void**)(adr)))); adr = ((void**)adr) + 1; n--; } @@ -51,7 +51,7 @@ void SYSTEM_ENUMR(void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()) while (n > 0) { t = typ; off = *t; - while (off >= 0) {P(*(uintptr*)((char*)adr+off)); t++; off = *t;} + while (off >= 0) {P(*(address*)((char*)adr+off)); t++; off = *t;} adr = ((char*)adr) + size; n--; } @@ -109,7 +109,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, else if (typ == (LONGINT*)POINTER__typ) { /* element type is a pointer */ x = Heap_NEWBLK(size + nofelems * sizeof(LONGINT)); - p = (LONGINT*)(uintptr)x[-1]; + p = (LONGINT*)(address)x[-1]; p[-nofelems] = *p; /* build new type desc in situ: 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nofelems - 1; n = 1; /* n =1 for skipping the size field */ while (n <= nofelems) {*p = n*sizeof(LONGINT); p++; n++;} @@ -122,7 +122,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, while (ptab[nofptrs] >= 0) {nofptrs++;} /* number of pointers per element */ nptr = nofelems * nofptrs; /* total number of pointers */ x = Heap_NEWBLK(size + nptr * sizeof(LONGINT)); - p = (LONGINT*)(uintptr)x[- 1]; + p = (LONGINT*)(address)x[- 1]; p[-nptr] = *p; /* build new type desc in situ; 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nptr - 1; n = 0; off = dataoff; while (n < nofelems) {i = 0; @@ -158,7 +158,7 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler // (Ignore other signals) } - void SystemSetHandler(int s, uintptr h) { + void SystemSetHandler(int s, address h) { if (s >= 2 && s <= 4) { int needtosetsystemhandler = handler[s-2] == 0; handler[s-2] = (SystemSignalHandler)h; @@ -197,12 +197,12 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler } } - void SystemSetInterruptHandler(uintptr h) { + void SystemSetInterruptHandler(address h) { EnsureConsoleCtrlHandler(); SystemInterruptHandler = (SystemSignalHandler)h; } - void SystemSetQuitHandler(uintptr h) { + void SystemSetQuitHandler(address h) { EnsureConsoleCtrlHandler(); SystemQuitHandler = (SystemSignalHandler)h; } diff --git a/bootstrap/windows-88/SYSTEM.h b/bootstrap/windows-88/SYSTEM.h index e7b38a26..8c6c335e 100644 --- a/bootstrap/windows-88/SYSTEM.h +++ b/bootstrap/windows-88/SYSTEM.h @@ -39,7 +39,7 @@ typedef unsigned short int uint16; typedef signed char int8; typedef unsigned char uint8; -#define uintptr size_t +#define address size_t // The compiler uses 'import' and 'export' which translate to 'extern' and // nothing respectively. @@ -53,7 +53,7 @@ typedef unsigned char uint8; #define NIL ((void*)0) #define __MAXEXT 16 -#define POINTER__typ ((uintptr*)(1)) // not NIL and not a valid type +#define POINTER__typ ((address*)(1)) // not NIL and not a valid type // Oberon types @@ -98,8 +98,8 @@ typedef void* SYSTEM_PTR; // OS Memory allocation interfaces are in PlatformXXX.Mod -extern uintptr Platform_OSAllocate (uintptr size); -extern void Platform_OSFree (uintptr addr); +extern address Platform_OSAllocate (address size); +extern void Platform_OSFree (address addr); // Run time system routines in SYSTEM.c @@ -120,10 +120,10 @@ extern LONGINT SYSTEM_ENTIER (double x); // Signal handling in SYSTEM.c #ifndef _WIN32 - extern void SystemSetHandler(int s, uintptr h); + extern void SystemSetHandler(int s, address h); #else - extern void SystemSetInterruptHandler(uintptr h); - extern void SystemSetQuitHandler (uintptr h); + extern void SystemSetInterruptHandler(address h); + extern void SystemSetQuitHandler (address h); #endif @@ -146,9 +146,9 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __COPY(s, d, n) {char*_a=(void*)s,*_b=(void*)d; LONGINT _i=0,_t=n-1; \ while(_i<_t&&((_b[_i]=_a[_i])!=0)){_i++;};_b[_i]=0;} -#define __DUP(x, l, t) x=(void*)memcpy((void*)(uintptr)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) +#define __DUP(x, l, t) x=(void*)memcpy((void*)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) #define __DUPARR(v, t) v=(void*)memcpy(v##__copy,v,sizeof(t)) -#define __DEL(x) Platform_OSFree((LONGINT)(uintptr)x) +#define __DEL(x) Platform_OSFree((address)x) // Index and range checks @@ -165,8 +165,8 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __VAL(t, x) (*(t*)&(x)) -#define __GET(a, x, t) x= *(t*)(uintptr)(a) -#define __PUT(a, x, t) *(t*)(uintptr)(a)=x +#define __GET(a, x, t) x= *(t*)(address)(a) +#define __PUT(a, x, t) *(t*)(address)(a)=x #define __LSHL(x, n, t) ((t)((u##t)(x)<<(n))) #define __LSHR(x, n, t) ((t)((u##t)(x)>>(n))) @@ -182,7 +182,7 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __ASHF(x, n) SYSTEM_ASH((LONGINT)(x), (LONGINT)(n)) #define __BIT(x, n) (*(uint64*)(x)>>(n)&1) -#define __MOVE(s, d, n) memcpy((char*)(uintptr)(d),(char*)(uintptr)(s),n) +#define __MOVE(s, d, n) memcpy((char*)(address)(d),(char*)(address)(s),n) #define __SHORT(x, y) ((int)((uLONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) #define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) #define __CHR(x) ((CHAR)__R(x, 256)) @@ -235,10 +235,10 @@ extern void Heap_INCREF(); // Main module initialisation, registration and finalisation -extern void Platform_Init(INTEGER argc, LONGINT argv); +extern void Platform_Init(INTEGER argc, address argv); extern void Heap_FINALL(); -#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (LONGINT)(uintptr)&argv); +#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (address)&argv); #define __REGMAIN(name, enum) m = Heap_REGMOD((CHAR*)name,enum) #define __FINI Heap_FINALL(); return 0 @@ -254,12 +254,12 @@ extern void Platform_AssertFail(LONGINT x); // Memory allocation -extern SYSTEM_PTR Heap_NEWBLK (uintptr size); -extern SYSTEM_PTR Heap_NEWREC (uintptr tag); +extern SYSTEM_PTR Heap_NEWBLK (address size); +extern SYSTEM_PTR Heap_NEWREC (address tag); extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __SYSNEW(p, len) p = Heap_NEWBLK((LONGINT)(len)) -#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(uintptr)t##__typ) +#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(address)t##__typ) #define __NEWARR SYSTEM_NEWARR @@ -290,20 +290,20 @@ extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __INITYP(t, t0, level) \ t##__typ = (LONGINT*)&t##__desc.blksz; \ memcpy(t##__desc.basep, t0##__typ - __BASEOFF, level*sizeof(LONGINT)); \ - t##__desc.basep[level] = (LONGINT)(uintptr)t##__typ; \ - t##__desc.module = (LONGINT)(uintptr)m; \ + t##__desc.basep[level] = (LONGINT)(address)t##__typ; \ + t##__desc.module = (LONGINT)(address)m; \ if(t##__desc.blksz!=sizeof(struct t)) __HALT(-15); \ t##__desc.blksz = (t##__desc.blksz+5*sizeof(LONGINT)-1)/(4*sizeof(LONGINT))*(4*sizeof(LONGINT)); \ - Heap_REGTYP(m, (LONGINT)(uintptr)&t##__desc.next); \ + Heap_REGTYP(m, (LONGINT)(address)&t##__desc.next); \ SYSTEM_INHERIT(t##__typ, t0##__typ) -#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(uintptr)typ##__typ) -#define __TYPEOF(p) ((LONGINT*)(uintptr)(*(((LONGINT*)(p))-1))) +#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(address)typ##__typ) +#define __TYPEOF(p) ((LONGINT*)(address)(*(((LONGINT*)(p))-1))) #define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) // Oberon-2 type bound procedures support -#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(uintptr)proc -#define __SEND(typ, num, funtyp, parlist) ((funtyp)((uintptr)*(typ-(__TPROC0OFF+num))))parlist +#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(address)proc +#define __SEND(typ, num, funtyp, parlist) ((funtyp)((address)*(typ-(__TPROC0OFF+num))))parlist diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index abf00b3b..f240e3b4 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index 5280395c..88b212f1 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index e8858afa..59d184b4 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Files.h" diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index 990d15c3..d779d5d5 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/Vishap.c b/bootstrap/windows-88/Vishap.c index bed71868..7a2484a5 100644 --- a/bootstrap/windows-88/Vishap.c +++ b/bootstrap/windows-88/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkamSf */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -82,7 +82,7 @@ static void Vishap_PropagateElementaryTypeSizes (void) OPT_realtyp->size = OPM_RealSize; OPT_inttyp->size = OPM_IntSize; OPT_linttyp->size = OPM_LIntSize; - OPT_pinttyp->size = OPM_PointerSize; + OPT_adrtyp->size = OPM_PointerSize; OPT_lrltyp->size = OPM_LRealSize; OPT_sinttyp->size = OPM_SIntSize; OPT_booltyp->size = OPM_BoolSize; diff --git a/bootstrap/windows-88/errors.c b/bootstrap/windows-88/errors.c index 2f0938c0..1d7e852f 100644 --- a/bootstrap/windows-88/errors.c +++ b/bootstrap/windows-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/windows-88/errors.h b/bootstrap/windows-88/errors.h index c2bb7560..f917a7b6 100644 --- a/bootstrap/windows-88/errors.h +++ b/bootstrap/windows-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index b9d03b09..d656f5be 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index 30095155..1f0bb8e7 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/vt100.c b/bootstrap/windows-88/vt100.c index 5dd451e1..22698256 100644 --- a/bootstrap/windows-88/vt100.c +++ b/bootstrap/windows-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/windows-88/vt100.h b/bootstrap/windows-88/vt100.h index bcc323cc..f6c994fa 100644 --- a/bootstrap/windows-88/vt100.h +++ b/bootstrap/windows-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/src/compiler/OPB.Mod b/src/compiler/OPB.Mod index 73832049..44b11ad9 100644 --- a/src/compiler/OPB.Mod +++ b/src/compiler/OPB.Mod @@ -1213,6 +1213,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) IF (x.class # OPT.Nconst) & (x.typ.size < p.typ.size) THEN err(-308) END; IF (x.class = OPT.Nconst) & (x.typ.form = OPT.Int) & (p.typ.form = OPT.Int) THEN + (* Convert integer constants in place allowing usage in CONST section. *) Convert(x, p.typ) ELSE t := OPT.NewNode(OPT.Nmop); t^.subcl := OPT.val; t^.left := x; x := t; diff --git a/src/compiler/OPC.Mod b/src/compiler/OPC.Mod index f8c71ee8..362a72df 100644 --- a/src/compiler/OPC.Mod +++ b/src/compiler/OPC.Mod @@ -117,7 +117,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) IF keytab[hashtab[h]] = obj^.name THEN OPM.Write('_') END END ELSIF (mode = OPT.Typ) & (obj.typ.form = OPT.Int) THEN - IF obj.typ = OPT.pinttyp THEN OPM.WriteString("uintptr") + IF obj.typ = OPT.adrtyp THEN OPM.WriteString("address") ELSE OPM.WriteString("int"); OPM.WriteInt(obj.typ.size*8) END ELSE @@ -1320,7 +1320,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) BEGIN n := 0; FOR i := 0 TO 104 DO hashtab[i] := -1 END ; - Enter("adrint"); (* pseudo keyword used by voc *) + Enter("address"); (* pseudo keyword used by voc *) Enter("asm"); Enter("auto"); Enter("break"); @@ -1357,7 +1357,6 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) Enter("struct"); Enter("switch"); Enter("typedef"); - Enter("uintptr"); (* pseudo keyword used by voc *) Enter("uint16"); (* pseudo keyword used by voc *) Enter("uint32"); (* pseudo keyword used by voc *) Enter("uint64"); (* pseudo keyword used by voc *) diff --git a/src/compiler/OPT.Mod b/src/compiler/OPT.Mod index 19bfdb47..8b21b9a5 100644 --- a/src/compiler/OPT.Mod +++ b/src/compiler/OPT.Mod @@ -155,7 +155,7 @@ VAR undftyp*, bytetyp*, booltyp*, chartyp*, sinttyp*, inttyp*, linttyp*, - pinttyp*, + adrtyp*, int8typ*, int16typ*, int32typ*, int64typ*, realtyp*, lrltyp*, settyp*, stringtyp*, niltyp*, notyp*, sysptrtyp*: Struct; @@ -1188,7 +1188,7 @@ BEGIN topScope := NIL; OpenScope(0, NIL); OPM.errpos := 0; (*initialization of module SYSTEM*) EnterTyp("BYTE", Byte, OPM.ByteSize, bytetyp); EnterTyp("PTR", Pointer, OPM.PointerSize, sysptrtyp); - EnterTyp("UINTPTR", Int, OPM.PointerSize, pinttyp); + EnterTyp("ADDRESS", Int, OPM.PointerSize, adrtyp); EnterTyp("INT8", Int, 1, int8typ); EnterTyp("INT16", Int, 2, int16typ); EnterTyp("INT32", Int, 4, int32typ); diff --git a/src/compiler/OPV.Mod b/src/compiler/OPV.Mod index 25cc2898..7cc0fe38 100644 --- a/src/compiler/OPV.Mod +++ b/src/compiler/OPV.Mod @@ -205,7 +205,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 OPT.realtyp^.strobj^.linkadr := PredefinedType; OPT.inttyp^.strobj^.linkadr := PredefinedType; OPT.linttyp^.strobj^.linkadr := PredefinedType; - OPT.pinttyp^.strobj^.linkadr := PredefinedType; + OPT.adrtyp^.strobj^.linkadr := PredefinedType; OPT.int8typ^.strobj^.linkadr := PredefinedType; OPT.int16typ^.strobj^.linkadr := PredefinedType; OPT.int32typ^.strobj^.linkadr := PredefinedType; @@ -565,7 +565,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 expr(l, MinPrec); OPM.Write(CloseParen) | OPT.cap: OPM.WriteString("__CAP("); expr(l, MinPrec); OPM.Write(CloseParen) | OPT.odd: OPM.WriteString("__ODD("); expr(l, MinPrec); OPM.Write(CloseParen) - | OPT.adr: OPM.WriteString("(uintptr)"); (*SYSTEM*) + | OPT.adr: OPM.WriteString("(address)"); (*SYSTEM*) IF l^.class = OPT.Nvarpar THEN OPC.CompleteIdent(l^.obj) ELSE IF (l^.typ^.form # OPT.String) & ~(l^.typ^.comp IN {OPT.Array, OPT.DynArr}) THEN OPM.Write("&") END ; @@ -578,7 +578,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 THEN OPM.Write(OpenParen); OPC.Ident(n^.typ^.strobj); OPM.Write(CloseParen); IF (n^.typ^.form IN {OPT.Pointer, OPT.ProcTyp}) OR (l^.typ^.form IN {OPT.Pointer, OPT.ProcTyp}) THEN - OPM.WriteString("(uintptr)") + OPM.WriteString("(address)") END; expr(l, exprPrec) ELSE @@ -796,7 +796,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 IF typ^.comp = OPT.DynArr THEN IF x^.class = OPT.Nconst THEN OPC.IntLiteral(x.conval.intval, OPM.PointerSize) - ELSE OPM.WriteString("((uintptr)("); expr(x, 10); OPM.WriteString("))") + ELSE OPM.WriteString("((address)("); expr(x, 10); OPM.WriteString("))") END ; x := x^.link ELSE diff --git a/src/compiler/Vishap.Mod b/src/compiler/Vishap.Mod index 615a032c..3323883d 100644 --- a/src/compiler/Vishap.Mod +++ b/src/compiler/Vishap.Mod @@ -58,7 +58,7 @@ MODULE Vishap; (* J. Templ 3.2.95 *) OPT.realtyp.size := OPM.RealSize; OPT.inttyp.size := OPM.IntSize; OPT.linttyp.size := OPM.LIntSize; - OPT.pinttyp.size := OPM.PointerSize; + OPT.adrtyp.size := OPM.PointerSize; OPT.lrltyp.size := OPM.LRealSize; OPT.sinttyp.size := OPM.SIntSize; OPT.booltyp.size := OPM.BoolSize diff --git a/src/system/Heap.Mod b/src/system/Heap.Mod index 00c106dd..e1fc81c4 100644 --- a/src/system/Heap.Mod +++ b/src/system/Heap.Mod @@ -6,7 +6,7 @@ MODULE Heap; CONST ModNameLen = 20; CmdNameLen = 24; - SZA = SIZE(SYSTEM.UINTPTR); (* Size of address *) + SZA = SIZE(SYSTEM.ADDRESS); (* Size of address *) Unit = 4*SZA; (* smallest possible heap block *) nofLists = 9; (* number of free_lists *) heapSize0 = 8000*Unit; (* startup heap size *) @@ -20,17 +20,17 @@ MODULE Heap; *) (* heap chunks *) - nextChnkOff = SYSTEM.VAL(SYSTEM.UINTPTR, 0); (* next heap chunk, sorted ascendingly! *) - endOff = SYSTEM.VAL(SYSTEM.UINTPTR, SZA); (* end of heap chunk *) - blkOff = SYSTEM.VAL(SYSTEM.UINTPTR, 3*SZA); (* first block in a chunk *) + nextChnkOff = SYSTEM.VAL(SYSTEM.ADDRESS, 0); (* next heap chunk, sorted ascendingly! *) + endOff = SYSTEM.VAL(SYSTEM.ADDRESS, SZA); (* end of heap chunk *) + blkOff = SYSTEM.VAL(SYSTEM.ADDRESS, 3*SZA); (* first block in a chunk *) (* heap blocks *) - tagOff = SYSTEM.VAL(SYSTEM.UINTPTR, 0); (* block starts with tag *) - sizeOff = SYSTEM.VAL(SYSTEM.UINTPTR, SZA); (* block size in free block relative to block start *) - sntlOff = SYSTEM.VAL(SYSTEM.UINTPTR, 2*SZA); (* pointer offset table sentinel in free block relative to block start *) - nextOff = SYSTEM.VAL(SYSTEM.UINTPTR, 3*SZA); (* next pointer in free block relative to block start *) - NoPtrSntl = SYSTEM.VAL(SYSTEM.UINTPTR, -SZA); - AddressZero = SYSTEM.VAL(SYSTEM.UINTPTR, 0); + tagOff = SYSTEM.VAL(SYSTEM.ADDRESS, 0); (* block starts with tag *) + sizeOff = SYSTEM.VAL(SYSTEM.ADDRESS, SZA); (* block size in free block relative to block start *) + sntlOff = SYSTEM.VAL(SYSTEM.ADDRESS, 2*SZA); (* pointer offset table sentinel in free block relative to block start *) + nextOff = SYSTEM.VAL(SYSTEM.ADDRESS, 3*SZA); (* next pointer in free block relative to block start *) + NoPtrSntl = SYSTEM.VAL(SYSTEM.ADDRESS, -SZA); + AddressZero = SYSTEM.VAL(SYSTEM.ADDRESS, 0); TYPE ModuleName = ARRAY ModNameLen OF CHAR; @@ -46,7 +46,7 @@ MODULE Heap; name: ModuleName; refcnt: LONGINT; cmds: Cmd; - types: SYSTEM.UINTPTR; + types: SYSTEM.ADDRESS; enumPtrs: EnumProc; reserved1, reserved2: LONGINT END ; @@ -64,7 +64,7 @@ MODULE Heap; FinNode = POINTER TO FinDesc; FinDesc = RECORD next: FinNode; - obj: SYSTEM.UINTPTR; (* weak pointer *) + obj: SYSTEM.ADDRESS; (* weak pointer *) marked: BOOLEAN; finalize: Finalizer; END ; @@ -73,15 +73,15 @@ MODULE Heap; (* the list of loaded (=initialization started) modules *) modules*: SYSTEM.PTR; - freeList: ARRAY nofLists + 1 OF SYSTEM.UINTPTR; (* dummy, 16, 32, 48, 64, 80, 96, 112, 128, sentinel *) - bigBlocks: SYSTEM.UINTPTR; - allocated*: SYSTEM.UINTPTR; + freeList: ARRAY nofLists + 1 OF SYSTEM.ADDRESS; (* dummy, 16, 32, 48, 64, 80, 96, 112, 128, sentinel *) + bigBlocks: SYSTEM.ADDRESS; + allocated*: SYSTEM.ADDRESS; firstTry: BOOLEAN; (* extensible heap *) - heap: SYSTEM.UINTPTR; (* the sorted list of heap chunks *) - heapend: SYSTEM.UINTPTR; (* max possible pointer value (used for stack collection) *) - heapsize*: SYSTEM.UINTPTR; (* the sum of all heap chunk sizes *) + heap: SYSTEM.ADDRESS; (* the sorted list of heap chunks *) + heapend: SYSTEM.ADDRESS; (* max possible pointer value (used for stack collection) *) + heapsize*: SYSTEM.ADDRESS; (* the sum of all heap chunk sizes *) (* finalization candidates *) fin: FinNode; @@ -153,7 +153,7 @@ MODULE Heap; COPY(name, c.name); c.cmd := cmd; c.next := m.cmds; m.cmds := c END REGCMD; - PROCEDURE REGTYP*(m: Module; typ: SYSTEM.UINTPTR); + PROCEDURE REGTYP*(m: Module; typ: SYSTEM.ADDRESS); BEGIN SYSTEM.PUT(typ, m.types); m.types := typ END REGTYP; @@ -162,11 +162,11 @@ MODULE Heap; END INCREF; - PROCEDURE -ExternPlatformOSAllocate "extern uintptr Platform_OSAllocate(uintptr size);"; - PROCEDURE -OSAllocate(size: SYSTEM.UINTPTR): SYSTEM.UINTPTR "Platform_OSAllocate(size)"; + PROCEDURE -ExternPlatformOSAllocate "extern address Platform_OSAllocate(address size);"; + PROCEDURE -OSAllocate(size: SYSTEM.ADDRESS): SYSTEM.ADDRESS "Platform_OSAllocate(size)"; - PROCEDURE NewChunk(blksz: SYSTEM.UINTPTR): SYSTEM.UINTPTR; - VAR chnk: SYSTEM.UINTPTR; + PROCEDURE NewChunk(blksz: SYSTEM.ADDRESS): SYSTEM.ADDRESS; + VAR chnk: SYSTEM.ADDRESS; BEGIN chnk := OSAllocate(blksz + blkOff); IF chnk # 0 THEN @@ -191,10 +191,10 @@ MODULE Heap; as there will be no need to extend addresses to larger types. *) - PROCEDURE -FetchAddress(pointer: SYSTEM.UINTPTR): SYSTEM.UINTPTR "(uintptr)(*((void**)((uintptr)pointer)))"; + PROCEDURE -FetchAddress(pointer: SYSTEM.ADDRESS): SYSTEM.ADDRESS "(address)(*((void**)((address)pointer)))"; - PROCEDURE ExtendHeap(blksz: SYSTEM.UINTPTR); - VAR size, chnk, j, next: SYSTEM.UINTPTR; + PROCEDURE ExtendHeap(blksz: SYSTEM.ADDRESS); + VAR size, chnk, j, next: SYSTEM.ADDRESS; BEGIN IF blksz > 10000*Unit THEN size := blksz ELSE size := 10000*Unit (* additional heuristics *) @@ -218,16 +218,16 @@ MODULE Heap; PROCEDURE ^GC*(markStack: BOOLEAN); - PROCEDURE NEWREC*(tag: SYSTEM.UINTPTR): SYSTEM.PTR; + PROCEDURE NEWREC*(tag: SYSTEM.ADDRESS): SYSTEM.PTR; VAR - i, i0, di, blksz, restsize, t, adr, end, next, prev: SYSTEM.UINTPTR; + i, i0, di, blksz, restsize, t, adr, end, next, prev: SYSTEM.ADDRESS; new: SYSTEM.PTR; BEGIN Lock(); blksz := FetchAddress(tag); ASSERT((Unit = 16) OR (Unit = 32)); - ASSERT(SIZE(SYSTEM.PTR) = SIZE(SYSTEM.UINTPTR)); + ASSERT(SIZE(SYSTEM.PTR) = SIZE(SYSTEM.ADDRESS)); ASSERT(blksz MOD Unit = 0); i0 := blksz DIV Unit; i := i0; @@ -310,23 +310,23 @@ MODULE Heap; RETURN SYSTEM.VAL(SYSTEM.PTR, adr + SZA) END NEWREC; - PROCEDURE NEWBLK*(size: SYSTEM.UINTPTR): SYSTEM.PTR; - VAR blksz, tag: SYSTEM.UINTPTR; new: SYSTEM.PTR; + PROCEDURE NEWBLK*(size: SYSTEM.ADDRESS): SYSTEM.PTR; + VAR blksz, tag: SYSTEM.ADDRESS; new: SYSTEM.PTR; BEGIN Lock(); blksz := (size + (4*SZA + Unit - 1)) DIV Unit * Unit; (*size + tag + meta + blksz + sntnl + UnitAlignment*) new := NEWREC(SYSTEM.ADR(blksz)); - tag := SYSTEM.VAL(SYSTEM.UINTPTR, new) + blksz - 3*SZA; + tag := SYSTEM.VAL(SYSTEM.ADDRESS, new) + blksz - 3*SZA; SYSTEM.PUT(tag - SZA, AddressZero); (*reserved for meta info*) SYSTEM.PUT(tag, blksz); SYSTEM.PUT(tag + SZA, NoPtrSntl); - SYSTEM.PUT(SYSTEM.VAL(SYSTEM.UINTPTR, new) - SZA, tag); + SYSTEM.PUT(SYSTEM.VAL(SYSTEM.ADDRESS, new) - SZA, tag); Unlock(); RETURN new END NEWBLK; - PROCEDURE Mark(q: SYSTEM.UINTPTR); - VAR p, tag, offset, fld, n, tagbits: SYSTEM.UINTPTR; + PROCEDURE Mark(q: SYSTEM.ADDRESS); + VAR p, tag, offset, fld, n, tagbits: SYSTEM.ADDRESS; BEGIN IF q # 0 THEN tagbits := FetchAddress(q - SZA); (* Load the tag for the record at q *) @@ -336,7 +336,7 @@ MODULE Heap; tag := tagbits + SZA; (* Tag addresses first offset *) LOOP SYSTEM.GET(tag, offset); (* Get next ptr field offset *) - IF SYSTEM.BIT(SYSTEM.ADR(offset), SIZE(SYSTEM.UINTPTR)*8 - 1) THEN + IF SYSTEM.BIT(SYSTEM.ADR(offset), SIZE(SYSTEM.ADDRESS)*8 - 1) THEN (* Sentinel reached: Value is -8*(#fields+1) *) SYSTEM.PUT(q - SZA, tag + offset + 1); (* Rotate base ptr into tag *) IF p = 0 THEN EXIT END ; @@ -366,11 +366,11 @@ MODULE Heap; PROCEDURE MarkP(p: SYSTEM.PTR); (* for compatibility with EnumPtrs in ANSI mode *) BEGIN - Mark(SYSTEM.VAL(SYSTEM.UINTPTR, p)) + Mark(SYSTEM.VAL(SYSTEM.ADDRESS, p)) END MarkP; PROCEDURE Scan; - VAR chnk, adr, end, start, tag, i, size, freesize: SYSTEM.UINTPTR; + VAR chnk, adr, end, start, tag, i, size, freesize: SYSTEM.ADDRESS; BEGIN bigBlocks := 0; i := 1; WHILE i < nofLists DO freeList[i] := 0; INC(i) END ; freesize := 0; allocated := 0; chnk := heap; @@ -415,8 +415,8 @@ MODULE Heap; END END Scan; - PROCEDURE Sift (l, r: SYSTEM.UINTPTR; VAR a: ARRAY OF SYSTEM.UINTPTR); - VAR i, j, x: SYSTEM.UINTPTR; + PROCEDURE Sift (l, r: SYSTEM.ADDRESS; VAR a: ARRAY OF SYSTEM.ADDRESS); + VAR i, j, x: SYSTEM.ADDRESS; BEGIN j := l; x := a[j]; LOOP i := j; j := 2*j + 1; IF (j < r) & (a[j] < a[j+1]) THEN INC(j) END; @@ -426,15 +426,15 @@ MODULE Heap; a[i] := x END Sift; - PROCEDURE HeapSort (n: SYSTEM.UINTPTR; VAR a: ARRAY OF SYSTEM.UINTPTR); - VAR l, r, x: SYSTEM.UINTPTR; + PROCEDURE HeapSort (n: SYSTEM.ADDRESS; VAR a: ARRAY OF SYSTEM.ADDRESS); + VAR l, r, x: SYSTEM.ADDRESS; BEGIN l := n DIV 2; r := n - 1; WHILE l > 0 DO DEC(l); Sift(l, r, a) END; WHILE r > 0 DO x := a[0]; a[0] := a[r]; a[r] := x; DEC(r); Sift(l, r, a) END END HeapSort; - PROCEDURE MarkCandidates(n: SYSTEM.UINTPTR; VAR cand: ARRAY OF SYSTEM.UINTPTR); - VAR chnk, adr, tag, next, lim, lim1, i, ptr, size: SYSTEM.UINTPTR; + PROCEDURE MarkCandidates(n: SYSTEM.ADDRESS; VAR cand: ARRAY OF SYSTEM.ADDRESS); + VAR chnk, adr, tag, next, lim, lim1, i, ptr, size: SYSTEM.ADDRESS; BEGIN chnk := heap; i := 0; lim := cand[n-1]; WHILE (chnk # 0 ) & (chnk < lim) DO @@ -460,7 +460,7 @@ MODULE Heap; END MarkCandidates; PROCEDURE CheckFin; - VAR n: FinNode; tag: SYSTEM.UINTPTR; + VAR n: FinNode; tag: SYSTEM.ADDRESS; BEGIN n := fin; WHILE n # NIL DO @@ -496,14 +496,14 @@ MODULE Heap; END END FINALL; - PROCEDURE -ExternMainStackFrame "extern uintptr Platform_MainStackFrame;"; - PROCEDURE -PlatformMainStackFrame(): SYSTEM.UINTPTR "Platform_MainStackFrame"; + PROCEDURE -ExternMainStackFrame "extern address Platform_MainStackFrame;"; + PROCEDURE -PlatformMainStackFrame(): SYSTEM.ADDRESS "Platform_MainStackFrame"; - PROCEDURE MarkStack(n: SYSTEM.UINTPTR; VAR cand: ARRAY OF SYSTEM.UINTPTR); + PROCEDURE MarkStack(n: SYSTEM.ADDRESS; VAR cand: ARRAY OF SYSTEM.ADDRESS); VAR frame: SYSTEM.PTR; - inc, nofcand: SYSTEM.UINTPTR; - sp, p, stack0: SYSTEM.UINTPTR; + inc, nofcand: SYSTEM.ADDRESS; + sp, p, stack0: SYSTEM.ADDRESS; align: RECORD ch: CHAR; p: SYSTEM.PTR END ; BEGIN IF n > 0 THEN MarkStack(n-1, cand); (* flush register windows by means of recursive calls *) @@ -530,8 +530,8 @@ MODULE Heap; PROCEDURE GC*(markStack: BOOLEAN); VAR m: Module; - i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23: SYSTEM.UINTPTR; - cand: ARRAY 10000 OF SYSTEM.UINTPTR; + i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23: SYSTEM.ADDRESS; + cand: ARRAY 10000 OF SYSTEM.ADDRESS; BEGIN IF (lockdepth = 0) OR (lockdepth = 1) & ~markStack THEN Lock(); @@ -566,7 +566,7 @@ MODULE Heap; PROCEDURE RegisterFinalizer*(obj: SYSTEM.PTR; finalize: Finalizer); VAR f: FinNode; BEGIN NEW(f); - f.obj := SYSTEM.VAL(SYSTEM.UINTPTR, obj); f.finalize := finalize; f.marked := TRUE; + f.obj := SYSTEM.VAL(SYSTEM.ADDRESS, obj); f.finalize := finalize; f.marked := TRUE; f.next := fin; fin := f; END RegisterFinalizer; diff --git a/src/system/Platformunix.Mod b/src/system/Platformunix.Mod index f950f2a3..cbd5b646 100644 --- a/src/system/Platformunix.Mod +++ b/src/system/Platformunix.Mod @@ -27,13 +27,13 @@ TYPE VAR LittleEndian-: BOOLEAN; - MainStackFrame-: SYSTEM.UINTPTR; + MainStackFrame-: SYSTEM.ADDRESS; HaltCode-: LONGINT; PID-: INTEGER; (* Note: Must be updated by Fork implementation *) CWD-: ARRAY 256 OF CHAR; ArgCount-: INTEGER; - ArgVector-: SYSTEM.UINTPTR; + ArgVector-: SYSTEM.ADDRESS; HaltHandler: HaltProcedure; TimeStart: LONGINT; @@ -106,11 +106,11 @@ BEGIN RETURN (e = ECONNREFUSED()) OR (e = ECONNABORTED()) (* OS memory allocaton *) -PROCEDURE -allocate (size: SYSTEM.UINTPTR): SYSTEM.UINTPTR "(uintptr)((void*)malloc((size_t)size))"; -PROCEDURE OSAllocate*(size: SYSTEM.UINTPTR): SYSTEM.UINTPTR; BEGIN RETURN allocate(size) END OSAllocate; +PROCEDURE -allocate (size: SYSTEM.ADDRESS): SYSTEM.ADDRESS "(address)((void*)malloc((size_t)size))"; +PROCEDURE OSAllocate*(size: SYSTEM.ADDRESS): SYSTEM.ADDRESS; BEGIN RETURN allocate(size) END OSAllocate; -PROCEDURE -free(address: SYSTEM.UINTPTR) "free((void*)address)"; -PROCEDURE OSFree*(address: SYSTEM.UINTPTR); BEGIN free(address) END OSFree; +PROCEDURE -free(address: SYSTEM.ADDRESS) "free((void*)address)"; +PROCEDURE OSFree*(address: SYSTEM.ADDRESS); BEGIN free(address) END OSFree; @@ -120,7 +120,7 @@ PROCEDURE OSFree*(address: SYSTEM.UINTPTR); BEGIN free(address) END OSFree; PROCEDURE -ExternInitHeap "extern void Heap_InitHeap();"; PROCEDURE -HeapInitHeap() "Heap_InitHeap()"; -PROCEDURE Init*(argc: INTEGER; argvadr: LONGINT); +PROCEDURE Init*(argc: INTEGER; argvadr: SYSTEM.ADDRESS); VAR av: ArgVecPtr; BEGIN MainStackFrame := argvadr; @@ -189,7 +189,7 @@ END ArgPos; (* Signals and traps *) -PROCEDURE -sethandler(s: INTEGER; h: SignalHandler) "SystemSetHandler(s, (uintptr)h)"; +PROCEDURE -sethandler(s: INTEGER; h: SignalHandler) "SystemSetHandler(s, (address)h)"; PROCEDURE SetInterruptHandler*(handler: SignalHandler); BEGIN sethandler(2, handler); END SetInterruptHandler; @@ -368,16 +368,16 @@ END Size; -PROCEDURE -readfile (fd: LONGINT; p: LONGINT; l: LONGINT): LONGINT -"read(fd, (void*)(uintptr)(p), l)"; +PROCEDURE -readfile (fd: LONGINT; p: SYSTEM.ADDRESS; l: SYSTEM.ADDRESS): SYSTEM.ADDRESS +"read(fd, (void*)(address)(p), l)"; -PROCEDURE Read*(h: FileHandle; p: LONGINT; l: LONGINT; VAR n: LONGINT): ErrorCode; +PROCEDURE Read*(h: FileHandle; p: SYSTEM.ADDRESS; l: SYSTEM.ADDRESS; VAR n: SYSTEM.ADDRESS): ErrorCode; BEGIN n := readfile(h, p, l); IF n < 0 THEN n := 0; RETURN err() ELSE RETURN 0 END END Read; -PROCEDURE ReadBuf*(h: FileHandle; VAR b: ARRAY OF SYSTEM.BYTE; VAR n: LONGINT): ErrorCode; +PROCEDURE ReadBuf*(h: FileHandle; VAR b: ARRAY OF SYSTEM.BYTE; VAR n: SYSTEM.ADDRESS): ErrorCode; BEGIN n := readfile(h, SYSTEM.ADR(b), LEN(b)); IF n < 0 THEN n := 0; RETURN err() ELSE RETURN 0 END @@ -385,11 +385,11 @@ END ReadBuf; -PROCEDURE -writefile(fd: LONGINT; p: LONGINT; l: LONGINT): LONGINT -"write(fd, (void*)(uintptr)(p), l)"; +PROCEDURE -writefile(fd: LONGINT; p: SYSTEM.ADDRESS; l: SYSTEM.ADDRESS): SYSTEM.ADDRESS +"write(fd, (void*)(address)(p), l)"; -PROCEDURE Write*(h: FileHandle; p: LONGINT; l: LONGINT): ErrorCode; - VAR written: LONGINT; +PROCEDURE Write*(h: FileHandle; p: SYSTEM.ADDRESS; l: SYSTEM.ADDRESS): ErrorCode; + VAR written: SYSTEM.ADDRESS; BEGIN written := writefile(h, p, l); IF written < 0 THEN RETURN err() ELSE RETURN 0 END @@ -467,7 +467,7 @@ BEGIN exit(code) END Exit; PROCEDURE -errstring(s: ARRAY OF CHAR) 'write(1, s, s__len-1)'; PROCEDURE -errc (c: CHAR) 'write(1, &c, 1)'; PROCEDURE errch(c: CHAR); BEGIN errc(c) END errch; -PROCEDURE errln; BEGIN errch(0DX); errch(0AX) END errln; +PROCEDURE errln; BEGIN errch(0AX) END errln; PROCEDURE errposint(l: LONGINT); BEGIN IF l>10 THEN errposint(l DIV 10) END; errch(CHR(ORD('0') + (l MOD 10))) END errposint; diff --git a/src/system/Platformwindows.Mod b/src/system/Platformwindows.Mod index 7511e427..272180b8 100644 --- a/src/system/Platformwindows.Mod +++ b/src/system/Platformwindows.Mod @@ -30,13 +30,13 @@ TYPE VAR LittleEndian-: BOOLEAN; - MainStackFrame-: LONGINT; + MainStackFrame-: SYSTEM.ADDRESS; HaltCode-: LONGINT; PID-: INTEGER; (* Note: Must be updated by Fork implementation *) CWD-: ARRAY 4096 OF CHAR; ArgCount-: INTEGER; - ArgVector-: LONGINT; + ArgVector-: SYSTEM.ADDRESS; HaltHandler: HaltProcedure; TimeStart: LONGINT; @@ -104,11 +104,11 @@ BEGIN RETURN (e = ECONNREFUSED()) OR (e = ECONNABORTED()) (* OS memory allocaton *) -PROCEDURE -allocate(size: LONGINT): LONGINT "(LONGINT)(SYSTEM_ADRINT)((void*)HeapAlloc(GetProcessHeap(), 0, (size_t)size))"; -PROCEDURE OSAllocate*(size: LONGINT): LONGINT; BEGIN RETURN allocate(size) END OSAllocate; +PROCEDURE -allocate(size: SYSTEM.ADDRESS): SYSTEM.ADDRESS "(address)((void*)HeapAlloc(GetProcessHeap(), 0, (size_t)size))"; +PROCEDURE OSAllocate*(size: SYSTEM.ADDRESS): SYSTEM.ADDRESS; BEGIN RETURN allocate(size) END OSAllocate; -PROCEDURE -free(address: LONGINT) "HeapFree(GetProcessHeap(), 0, (void*)(SYSTEM_ADRINT)address)"; -PROCEDURE OSFree*(address: LONGINT); BEGIN free(address) END OSFree; +PROCEDURE -free(address: SYSTEM.ADDRESS) "HeapFree(GetProcessHeap(), 0, (void*)address)"; +PROCEDURE OSFree*(address: SYSTEM.ADDRESS); BEGIN free(address) END OSFree; @@ -118,7 +118,7 @@ PROCEDURE OSFree*(address: LONGINT); BEGIN free(address) END OSFree; PROCEDURE -ExternInitHeap "extern void Heap_InitHeap();"; PROCEDURE -HeapInitHeap() "Heap_InitHeap()"; -PROCEDURE Init*(argc: INTEGER; argvadr: LONGINT); +PROCEDURE Init*(argc: INTEGER; argvadr: SYSTEM.ADDRESS); VAR av: ArgVecPtr; BEGIN MainStackFrame := argvadr; @@ -200,8 +200,8 @@ END ArgPos; (* Ctrl/c handling *) -PROCEDURE -SetInterruptHandler*(h: SignalHandler) "SystemSetInterruptHandler((SYSTEM_ADRINT)h)"; -PROCEDURE -SetQuitHandler* (h: SignalHandler) "SystemSetQuitHandler((SYSTEM_ADRINT)h)"; +PROCEDURE -SetInterruptHandler*(h: SignalHandler) "SystemSetInterruptHandler((address)h)"; +PROCEDURE -SetQuitHandler* (h: SignalHandler) "SystemSetQuitHandler((address)h)"; PROCEDURE SetBadInstructionHandler*(handler: SignalHandler); BEGIN (* TODO *) END SetBadInstructionHandler; @@ -293,16 +293,16 @@ PROCEDURE Error*(): ErrorCode; BEGIN RETURN err() END Error; (* File system *) -PROCEDURE -invalidHandleValue(): LONGINT "((LONGINT)(SYSTEM_ADRINT)INVALID_HANDLE_VALUE)"; +PROCEDURE -invalidHandleValue(): LONGINT "((LONGINT)(address)INVALID_HANDLE_VALUE)"; PROCEDURE -openrw (n: ARRAY OF CHAR): LONGINT -"(LONGINT)(SYSTEM_ADRINT)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0)"; +"(LONGINT)(address)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0)"; PROCEDURE -openro (n: ARRAY OF CHAR): LONGINT -"(LONGINT)(SYSTEM_ADRINT)CreateFile((char*)n, GENERIC_READ , FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0)"; +"(LONGINT)(address)CreateFile((char*)n, GENERIC_READ , FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0)"; PROCEDURE -opennew(n: ARRAY OF CHAR): LONGINT -"(LONGINT)(SYSTEM_ADRINT)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0)"; +"(LONGINT)(address)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0)"; @@ -332,7 +332,7 @@ END New; -PROCEDURE -closeHandle(h: FileHandle): INTEGER "(INTEGER)CloseHandle((HANDLE)(SYSTEM_ADRINT)h)"; +PROCEDURE -closeHandle(h: FileHandle): INTEGER "(INTEGER)CloseHandle((HANDLE)(address)h)"; PROCEDURE Close*(h: FileHandle): ErrorCode; BEGIN @@ -342,7 +342,7 @@ END Close; PROCEDURE -byHandleFileInformation "BY_HANDLE_FILE_INFORMATION bhfi"; -PROCEDURE -getFileInformationByHandle(h: FileHandle): INTEGER "(INTEGER)GetFileInformationByHandle((HANDLE)(SYSTEM_ADRINT)h, &bhfi)"; +PROCEDURE -getFileInformationByHandle(h: FileHandle): INTEGER "(INTEGER)GetFileInformationByHandle((HANDLE)(address)h, &bhfi)"; PROCEDURE -bhfiMtimeHigh(): LONGINT "(LONGINT)bhfi.ftLastWriteTime.dwHighDateTime"; PROCEDURE -bhfiMtimeLow(): LONGINT "(LONGINT)bhfi.ftLastWriteTime.dwLowDateTime"; PROCEDURE -bhfiVsn(): LONGINT "(LONGINT)bhfi.dwVolumeSerialNumber"; @@ -401,7 +401,7 @@ END MTimeAsClock; PROCEDURE -largeInteger "LARGE_INTEGER li"; PROCEDURE -liLongint(): LONGINT "(LONGINT)li.QuadPart"; -PROCEDURE -getFileSize(h: FileHandle): INTEGER "(INTEGER)GetFileSizeEx((HANDLE)(SYSTEM_ADRINT)h, &li)"; +PROCEDURE -getFileSize(h: FileHandle): INTEGER "(INTEGER)GetFileSizeEx((HANDLE)(address)h, &li)"; PROCEDURE Size*(h: FileHandle; VAR l: LONGINT): ErrorCode; BEGIN @@ -412,10 +412,10 @@ BEGIN END Size; -PROCEDURE -readfile (fd: LONGINT; p: LONGINT; l: LONGINT; VAR n: LONGINT): INTEGER -"(INTEGER)ReadFile ((HANDLE)(SYSTEM_ADRINT)fd, (void*)(SYSTEM_ADRINT)(p), (DWORD)l, (DWORD*)n, 0)"; +PROCEDURE -readfile (fd: LONGINT; p: SYSTEM.ADDRESS; l: SYSTEM.ADDRESS; VAR n: SYSTEM.ADDRESS): SYSTEM.ADDRESS +"(address)ReadFile((HANDLE)fd, (void*)p, (DWORD)l, (DWORD*)n, 0)"; -PROCEDURE Read*(h: FileHandle; p: LONGINT; l: LONGINT; VAR n: LONGINT): ErrorCode; +PROCEDURE Read*(h: FileHandle; p: SYSTEM.ADDRESS; l: SYSTEM.ADDRESS; VAR n: SYSTEM.ADDRESS): ErrorCode; VAR result: INTEGER; BEGIN n := 0; (* Clear n because readfile takes a LONGINT but only updates the bottom 32 bits *) @@ -423,18 +423,18 @@ BEGIN IF result = 0 THEN n := 0; RETURN err() ELSE RETURN 0 END END Read; -PROCEDURE ReadBuf*(h: FileHandle; VAR b: ARRAY OF SYSTEM.BYTE; VAR n: LONGINT): ErrorCode; +PROCEDURE ReadBuf*(h: FileHandle; VAR b: ARRAY OF SYSTEM.BYTE; VAR n: SYSTEM.ADDRESS): ErrorCode; VAR result: INTEGER; BEGIN - n := 0; (* Clear n because readfile takes a LONGINT but only updates the bottom 32 bits *) + n := 0; (* Clear n because readfile takes a SYSTEM.ADDRESS but only updates the bottom 32 bits *) result := readfile(h, SYSTEM.ADR(b), LEN(b), n); IF result = 0 THEN n := 0; RETURN err() ELSE RETURN 0 END END ReadBuf; -PROCEDURE -writefile(fd: LONGINT; p: LONGINT; l: LONGINT): INTEGER -"(INTEGER)WriteFile((HANDLE)(SYSTEM_ADRINT)fd, (void*)(SYSTEM_ADRINT)(p), (DWORD)l, 0,0)"; +PROCEDURE -writefile(fd: LONGINT; p: SYSTEM.ADDRESS; l: SYSTEM.ADDRESS): INTEGER +"(INTEGER)WriteFile((HANDLE)fd, (void*)(p), (DWORD)l, 0,0)"; PROCEDURE Write*(h: FileHandle; p: LONGINT; l: LONGINT): ErrorCode; BEGIN @@ -443,7 +443,7 @@ END Write; -PROCEDURE -flushFileBuffers(h: FileHandle): INTEGER "(INTEGER)FlushFileBuffers((HANDLE)(SYSTEM_ADRINT)h)"; +PROCEDURE -flushFileBuffers(h: FileHandle): INTEGER "(INTEGER)FlushFileBuffers((HANDLE)h)"; PROCEDURE Sync*(h: FileHandle): ErrorCode; BEGIN @@ -453,7 +453,7 @@ END Sync; PROCEDURE -setFilePointerEx(h: FileHandle; o: LONGINT; r: INTEGER; VAR rc: INTEGER) -"li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((HANDLE)(SYSTEM_ADRINT)h, li, 0, (DWORD)r)"; +"li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((HANDLE)(address)h, li, 0, (DWORD)r)"; PROCEDURE -seekset(): INTEGER "FILE_BEGIN"; PROCEDURE -seekcur(): INTEGER "FILE_CURRENT"; @@ -469,9 +469,9 @@ END Seek; -PROCEDURE -setEndOfFile(h: FileHandle): INTEGER "(INTEGER)SetEndOfFile((HANDLE)(SYSTEM_ADRINT)h)"; +PROCEDURE -setEndOfFile(h: FileHandle): INTEGER "(INTEGER)SetEndOfFile((HANDLE)(address)h)"; PROCEDURE -getFilePos(h: FileHandle; VAR r: LONGINT; VAR rc: INTEGER) -"LARGE_INTEGER liz = {0}; *rc = (INTEGER)SetFilePointerEx((HANDLE)(SYSTEM_ADRINT)h, liz, &li, FILE_CURRENT); *r = (LONGINT)li.QuadPart"; +"LARGE_INTEGER liz = {0}; *rc = (INTEGER)SetFilePointerEx((HANDLE)(address)h, liz, &li, FILE_CURRENT); *r = (LONGINT)li.QuadPart"; PROCEDURE Truncate*(h: FileHandle; limit: LONGINT): ErrorCode; VAR rc: INTEGER; oldpos: LONGINT; @@ -529,8 +529,8 @@ PROCEDURE Exit*(code: INTEGER); BEGIN exit(code) END Exit; -PROCEDURE -errstring(s: ARRAY OF CHAR) 'WriteFile((HANDLE)(SYSTEM_ADRINT)Platform_StdOut, s, s__len-1, 0,0)'; -PROCEDURE -errc (c: CHAR) 'WriteFile((HANDLE)(SYSTEM_ADRINT)Platform_StdOut, &c, 1, 0,0)'; +PROCEDURE -errstring(s: ARRAY OF CHAR) 'WriteFile((HANDLE)(address)Platform_StdOut, s, s__len-1, 0,0)'; +PROCEDURE -errc (c: CHAR) 'WriteFile((HANDLE)(address)Platform_StdOut, &c, 1, 0,0)'; PROCEDURE errch(c: CHAR); BEGIN errc(c) END errch; PROCEDURE errln; BEGIN errch(0DX); errch(0AX) END errln; @@ -552,7 +552,12 @@ BEGIN | -7: errstring("WITH statement type guard failed.") | -8: errstring("SHORT: Value too large for shorter type.") | -9: errstring("Heap interrupted while locked, but lockdepth = 0 at unlock.") - |-15: errstring("Type descriptor size mismatch.") + |-10: errstring("NIL access."); + |-11: errstring("Alignment error."); + |-12: errstring("Divide by zero."); + |-13: errstring("Arithmetic overflow/underflow."); + |-14: errstring("Invalid function argument."); + |-15: errstring("Internal error, e.g. Type descriptor size mismatch.") |-20: errstring("Too many, or negative number of, elements in dynamic array.") ELSE END @@ -589,9 +594,9 @@ PROCEDURE TestLittleEndian; BEGIN i := 1; SYSTEM.GET(SYSTEM.ADR(i), LittleEndian); END TestLittleEndian; -PROCEDURE -getstdinhandle(): FileHandle "(SYSTEM_ADRINT)GetStdHandle(STD_INPUT_HANDLE)"; -PROCEDURE -getstdouthandle(): FileHandle "(SYSTEM_ADRINT)GetStdHandle(STD_OUTPUT_HANDLE)"; -PROCEDURE -getstderrhandle(): FileHandle "(SYSTEM_ADRINT)GetStdHandle(STD_ERROR_HANDLE)"; +PROCEDURE -getstdinhandle(): FileHandle "(address)GetStdHandle(STD_INPUT_HANDLE)"; +PROCEDURE -getstdouthandle(): FileHandle "(address)GetStdHandle(STD_OUTPUT_HANDLE)"; +PROCEDURE -getstderrhandle(): FileHandle "(address)GetStdHandle(STD_ERROR_HANDLE)"; PROCEDURE -getpid(): INTEGER "(INTEGER)GetCurrentProcessId()"; BEGIN diff --git a/src/system/SYSTEM.c b/src/system/SYSTEM.c index 16681ab8..821a6096 100644 --- a/src/system/SYSTEM.c +++ b/src/system/SYSTEM.c @@ -38,7 +38,7 @@ void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0) void SYSTEM_ENUMP(void *adr, LONGINT n, void (*P)()) { while (n > 0) { - P((uintptr)(*((void**)(adr)))); + P((address)(*((void**)(adr)))); adr = ((void**)adr) + 1; n--; } @@ -51,7 +51,7 @@ void SYSTEM_ENUMR(void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()) while (n > 0) { t = typ; off = *t; - while (off >= 0) {P(*(uintptr*)((char*)adr+off)); t++; off = *t;} + while (off >= 0) {P(*(address*)((char*)adr+off)); t++; off = *t;} adr = ((char*)adr) + size; n--; } @@ -109,7 +109,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, else if (typ == (LONGINT*)POINTER__typ) { /* element type is a pointer */ x = Heap_NEWBLK(size + nofelems * sizeof(LONGINT)); - p = (LONGINT*)(uintptr)x[-1]; + p = (LONGINT*)(address)x[-1]; p[-nofelems] = *p; /* build new type desc in situ: 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nofelems - 1; n = 1; /* n =1 for skipping the size field */ while (n <= nofelems) {*p = n*sizeof(LONGINT); p++; n++;} @@ -122,7 +122,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, while (ptab[nofptrs] >= 0) {nofptrs++;} /* number of pointers per element */ nptr = nofelems * nofptrs; /* total number of pointers */ x = Heap_NEWBLK(size + nptr * sizeof(LONGINT)); - p = (LONGINT*)(uintptr)x[- 1]; + p = (LONGINT*)(address)x[- 1]; p[-nptr] = *p; /* build new type desc in situ; 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nptr - 1; n = 0; off = dataoff; while (n < nofelems) {i = 0; @@ -158,7 +158,7 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler // (Ignore other signals) } - void SystemSetHandler(int s, uintptr h) { + void SystemSetHandler(int s, address h) { if (s >= 2 && s <= 4) { int needtosetsystemhandler = handler[s-2] == 0; handler[s-2] = (SystemSignalHandler)h; @@ -197,12 +197,12 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler } } - void SystemSetInterruptHandler(uintptr h) { + void SystemSetInterruptHandler(address h) { EnsureConsoleCtrlHandler(); SystemInterruptHandler = (SystemSignalHandler)h; } - void SystemSetQuitHandler(uintptr h) { + void SystemSetQuitHandler(address h) { EnsureConsoleCtrlHandler(); SystemQuitHandler = (SystemSignalHandler)h; } diff --git a/src/system/SYSTEM.h b/src/system/SYSTEM.h index e7b38a26..8c6c335e 100644 --- a/src/system/SYSTEM.h +++ b/src/system/SYSTEM.h @@ -39,7 +39,7 @@ typedef unsigned short int uint16; typedef signed char int8; typedef unsigned char uint8; -#define uintptr size_t +#define address size_t // The compiler uses 'import' and 'export' which translate to 'extern' and // nothing respectively. @@ -53,7 +53,7 @@ typedef unsigned char uint8; #define NIL ((void*)0) #define __MAXEXT 16 -#define POINTER__typ ((uintptr*)(1)) // not NIL and not a valid type +#define POINTER__typ ((address*)(1)) // not NIL and not a valid type // Oberon types @@ -98,8 +98,8 @@ typedef void* SYSTEM_PTR; // OS Memory allocation interfaces are in PlatformXXX.Mod -extern uintptr Platform_OSAllocate (uintptr size); -extern void Platform_OSFree (uintptr addr); +extern address Platform_OSAllocate (address size); +extern void Platform_OSFree (address addr); // Run time system routines in SYSTEM.c @@ -120,10 +120,10 @@ extern LONGINT SYSTEM_ENTIER (double x); // Signal handling in SYSTEM.c #ifndef _WIN32 - extern void SystemSetHandler(int s, uintptr h); + extern void SystemSetHandler(int s, address h); #else - extern void SystemSetInterruptHandler(uintptr h); - extern void SystemSetQuitHandler (uintptr h); + extern void SystemSetInterruptHandler(address h); + extern void SystemSetQuitHandler (address h); #endif @@ -146,9 +146,9 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __COPY(s, d, n) {char*_a=(void*)s,*_b=(void*)d; LONGINT _i=0,_t=n-1; \ while(_i<_t&&((_b[_i]=_a[_i])!=0)){_i++;};_b[_i]=0;} -#define __DUP(x, l, t) x=(void*)memcpy((void*)(uintptr)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) +#define __DUP(x, l, t) x=(void*)memcpy((void*)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) #define __DUPARR(v, t) v=(void*)memcpy(v##__copy,v,sizeof(t)) -#define __DEL(x) Platform_OSFree((LONGINT)(uintptr)x) +#define __DEL(x) Platform_OSFree((address)x) // Index and range checks @@ -165,8 +165,8 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __VAL(t, x) (*(t*)&(x)) -#define __GET(a, x, t) x= *(t*)(uintptr)(a) -#define __PUT(a, x, t) *(t*)(uintptr)(a)=x +#define __GET(a, x, t) x= *(t*)(address)(a) +#define __PUT(a, x, t) *(t*)(address)(a)=x #define __LSHL(x, n, t) ((t)((u##t)(x)<<(n))) #define __LSHR(x, n, t) ((t)((u##t)(x)>>(n))) @@ -182,7 +182,7 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __ASHF(x, n) SYSTEM_ASH((LONGINT)(x), (LONGINT)(n)) #define __BIT(x, n) (*(uint64*)(x)>>(n)&1) -#define __MOVE(s, d, n) memcpy((char*)(uintptr)(d),(char*)(uintptr)(s),n) +#define __MOVE(s, d, n) memcpy((char*)(address)(d),(char*)(address)(s),n) #define __SHORT(x, y) ((int)((uLONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) #define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) #define __CHR(x) ((CHAR)__R(x, 256)) @@ -235,10 +235,10 @@ extern void Heap_INCREF(); // Main module initialisation, registration and finalisation -extern void Platform_Init(INTEGER argc, LONGINT argv); +extern void Platform_Init(INTEGER argc, address argv); extern void Heap_FINALL(); -#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (LONGINT)(uintptr)&argv); +#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (address)&argv); #define __REGMAIN(name, enum) m = Heap_REGMOD((CHAR*)name,enum) #define __FINI Heap_FINALL(); return 0 @@ -254,12 +254,12 @@ extern void Platform_AssertFail(LONGINT x); // Memory allocation -extern SYSTEM_PTR Heap_NEWBLK (uintptr size); -extern SYSTEM_PTR Heap_NEWREC (uintptr tag); +extern SYSTEM_PTR Heap_NEWBLK (address size); +extern SYSTEM_PTR Heap_NEWREC (address tag); extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __SYSNEW(p, len) p = Heap_NEWBLK((LONGINT)(len)) -#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(uintptr)t##__typ) +#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(address)t##__typ) #define __NEWARR SYSTEM_NEWARR @@ -290,20 +290,20 @@ extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __INITYP(t, t0, level) \ t##__typ = (LONGINT*)&t##__desc.blksz; \ memcpy(t##__desc.basep, t0##__typ - __BASEOFF, level*sizeof(LONGINT)); \ - t##__desc.basep[level] = (LONGINT)(uintptr)t##__typ; \ - t##__desc.module = (LONGINT)(uintptr)m; \ + t##__desc.basep[level] = (LONGINT)(address)t##__typ; \ + t##__desc.module = (LONGINT)(address)m; \ if(t##__desc.blksz!=sizeof(struct t)) __HALT(-15); \ t##__desc.blksz = (t##__desc.blksz+5*sizeof(LONGINT)-1)/(4*sizeof(LONGINT))*(4*sizeof(LONGINT)); \ - Heap_REGTYP(m, (LONGINT)(uintptr)&t##__desc.next); \ + Heap_REGTYP(m, (LONGINT)(address)&t##__desc.next); \ SYSTEM_INHERIT(t##__typ, t0##__typ) -#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(uintptr)typ##__typ) -#define __TYPEOF(p) ((LONGINT*)(uintptr)(*(((LONGINT*)(p))-1))) +#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(address)typ##__typ) +#define __TYPEOF(p) ((LONGINT*)(address)(*(((LONGINT*)(p))-1))) #define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) // Oberon-2 type bound procedures support -#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(uintptr)proc -#define __SEND(typ, num, funtyp, parlist) ((funtyp)((uintptr)*(typ-(__TPROC0OFF+num))))parlist +#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(address)proc +#define __SEND(typ, num, funtyp, parlist) ((funtyp)((address)*(typ-(__TPROC0OFF+num))))parlist From 682fa59e42b4953372ff297bb3ff5c4cdb7c94e1 Mon Sep 17 00:00:00 2001 From: David Brown Date: Sun, 4 Sep 2016 16:38:17 +0100 Subject: [PATCH 217/580] Fix mingw windows build. --- bootstrap/windows-48/Platform.c | 14 +++++++------- bootstrap/windows-48/Platform.h | 4 ++-- bootstrap/windows-88/Platform.c | 14 +++++++------- bootstrap/windows-88/Platform.h | 4 ++-- src/system/Platformwindows.Mod | 4 ++-- src/tools/make/configure.c | 1 + 6 files changed, 21 insertions(+), 20 deletions(-) diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index e3a21ae0..62a367e1 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -69,8 +69,8 @@ export address Platform_OSAllocate (address size); export void Platform_OSFree (address address); export int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); export int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); -export int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n); -export int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n); +export int16 Platform_Read (int32 h, address p, address l, address *n); +export int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, address *n); export int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); export BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); export BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); @@ -130,7 +130,7 @@ extern void Heap_InitHeap(); #define Platform_errstring(s, s__len) WriteFile((HANDLE)(address)Platform_StdOut, s, s__len-1, 0,0) #define Platform_exit(code) ExitProcess((UINT)code) #define Platform_fileTimeToSysTime() SYSTEMTIME st; FileTimeToSystemTime(&ft, &st) -#define Platform_flushFileBuffers(h) (INTEGER)FlushFileBuffers((HANDLE)(address)h) +#define Platform_flushFileBuffers(h) (INTEGER)FlushFileBuffers((HANDLE)h) #define Platform_free(address) HeapFree(GetProcessHeap(), 0, (void*)address) #define Platform_ftToUli() ULARGE_INTEGER ul; ul.LowPart=ft.dwLowDateTime; ul.HighPart=ft.dwHighDateTime #define Platform_getCurrentDirectory(n, n__len) GetCurrentDirectory(n__len, (char*)n) @@ -153,7 +153,7 @@ extern void Heap_InitHeap(); #define Platform_openro(n, n__len) (LONGINT)(address)CreateFile((char*)n, GENERIC_READ , FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) #define Platform_openrw(n, n__len) (LONGINT)(address)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) #define Platform_processInfo() PROCESS_INFORMATION pi = {0}; -#define Platform_readfile(fd, p, l, n) (INTEGER)ReadFile ((HANDLE)(address)fd, (void*)(address)(p), (DWORD)l, (DWORD*)n, 0) +#define Platform_readfile(fd, p, l, n) (INTEGER)ReadFile((HANDLE)fd, (void*)p, (DWORD)l, (DWORD*)n, 0) #define Platform_seekcur() FILE_CURRENT #define Platform_seekend() FILE_END #define Platform_seekset() FILE_BEGIN @@ -174,7 +174,7 @@ extern void Heap_InitHeap(); #define Platform_ulSec() (LONGINT)(ul.QuadPart / 1000000LL) #define Platform_uluSec() (LONGINT)(ul.QuadPart % 1000000LL) #define Platform_waitForProcess() (INTEGER)WaitForSingleObject(pi.hProcess, INFINITE) -#define Platform_writefile(fd, p, l) (INTEGER)WriteFile((HANDLE)(address)fd, (void*)(address)(p), (DWORD)l, 0,0) +#define Platform_writefile(fd, p, l) (INTEGER)WriteFile((HANDLE)fd, (void*)(p), (DWORD)l, 0,0) BOOLEAN Platform_TooManyFiles (int16 e) { @@ -538,7 +538,7 @@ int16 Platform_Size (int32 h, int32 *l) return _o_result; } -int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n) +int16 Platform_Read (int32 h, address p, address l, address *n) { int16 _o_result; int16 result; @@ -555,7 +555,7 @@ int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n) __RETCHK; } -int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n) +int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, address *n) { int16 _o_result; int16 result; diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index 6d0de5b3..0b6a48d8 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -58,8 +58,8 @@ import address Platform_OSAllocate (address size); import void Platform_OSFree (address address); import int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); import int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); -import int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n); -import int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n); +import int16 Platform_Read (int32 h, address p, address l, address *n); +import int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, address *n); import int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); import BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); import BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 128d21e0..0f3aae72 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -70,8 +70,8 @@ export address Platform_OSAllocate (address size); export void Platform_OSFree (address address); export int32 Platform_OldRO (CHAR *n, LONGINT n__len, int64 *h); export int32 Platform_OldRW (CHAR *n, LONGINT n__len, int64 *h); -export int32 Platform_Read (int64 h, int64 p, int64 l, int64 *n); -export int32 Platform_ReadBuf (int64 h, SYSTEM_BYTE *b, LONGINT b__len, int64 *n); +export int32 Platform_Read (int64 h, address p, address l, address *n); +export int32 Platform_ReadBuf (int64 h, SYSTEM_BYTE *b, LONGINT b__len, address *n); export int32 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); export BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); export BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); @@ -131,7 +131,7 @@ extern void Heap_InitHeap(); #define Platform_errstring(s, s__len) WriteFile((HANDLE)(address)Platform_StdOut, s, s__len-1, 0,0) #define Platform_exit(code) ExitProcess((UINT)code) #define Platform_fileTimeToSysTime() SYSTEMTIME st; FileTimeToSystemTime(&ft, &st) -#define Platform_flushFileBuffers(h) (INTEGER)FlushFileBuffers((HANDLE)(address)h) +#define Platform_flushFileBuffers(h) (INTEGER)FlushFileBuffers((HANDLE)h) #define Platform_free(address) HeapFree(GetProcessHeap(), 0, (void*)address) #define Platform_ftToUli() ULARGE_INTEGER ul; ul.LowPart=ft.dwLowDateTime; ul.HighPart=ft.dwHighDateTime #define Platform_getCurrentDirectory(n, n__len) GetCurrentDirectory(n__len, (char*)n) @@ -154,7 +154,7 @@ extern void Heap_InitHeap(); #define Platform_openro(n, n__len) (LONGINT)(address)CreateFile((char*)n, GENERIC_READ , FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) #define Platform_openrw(n, n__len) (LONGINT)(address)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) #define Platform_processInfo() PROCESS_INFORMATION pi = {0}; -#define Platform_readfile(fd, p, l, n) (INTEGER)ReadFile ((HANDLE)(address)fd, (void*)(address)(p), (DWORD)l, (DWORD*)n, 0) +#define Platform_readfile(fd, p, l, n) (INTEGER)ReadFile((HANDLE)fd, (void*)p, (DWORD)l, (DWORD*)n, 0) #define Platform_seekcur() FILE_CURRENT #define Platform_seekend() FILE_END #define Platform_seekset() FILE_BEGIN @@ -175,7 +175,7 @@ extern void Heap_InitHeap(); #define Platform_ulSec() (LONGINT)(ul.QuadPart / 1000000LL) #define Platform_uluSec() (LONGINT)(ul.QuadPart % 1000000LL) #define Platform_waitForProcess() (INTEGER)WaitForSingleObject(pi.hProcess, INFINITE) -#define Platform_writefile(fd, p, l) (INTEGER)WriteFile((HANDLE)(address)fd, (void*)(address)(p), (DWORD)l, 0,0) +#define Platform_writefile(fd, p, l) (INTEGER)WriteFile((HANDLE)fd, (void*)(p), (DWORD)l, 0,0) BOOLEAN Platform_TooManyFiles (int32 e) { @@ -539,7 +539,7 @@ int32 Platform_Size (int64 h, int64 *l) return _o_result; } -int32 Platform_Read (int64 h, int64 p, int64 l, int64 *n) +int32 Platform_Read (int64 h, address p, address l, address *n) { int32 _o_result; int32 result; @@ -556,7 +556,7 @@ int32 Platform_Read (int64 h, int64 p, int64 l, int64 *n) __RETCHK; } -int32 Platform_ReadBuf (int64 h, SYSTEM_BYTE *b, LONGINT b__len, int64 *n) +int32 Platform_ReadBuf (int64 h, SYSTEM_BYTE *b, LONGINT b__len, address *n) { int32 _o_result; int32 result; diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index 25f6197f..0d17921c 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -59,8 +59,8 @@ import address Platform_OSAllocate (address size); import void Platform_OSFree (address address); import int32 Platform_OldRO (CHAR *n, LONGINT n__len, int64 *h); import int32 Platform_OldRW (CHAR *n, LONGINT n__len, int64 *h); -import int32 Platform_Read (int64 h, int64 p, int64 l, int64 *n); -import int32 Platform_ReadBuf (int64 h, SYSTEM_BYTE *b, LONGINT b__len, int64 *n); +import int32 Platform_Read (int64 h, address p, address l, address *n); +import int32 Platform_ReadBuf (int64 h, SYSTEM_BYTE *b, LONGINT b__len, address *n); import int32 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); import BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); import BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); diff --git a/src/system/Platformwindows.Mod b/src/system/Platformwindows.Mod index 272180b8..9ed6bc8c 100644 --- a/src/system/Platformwindows.Mod +++ b/src/system/Platformwindows.Mod @@ -412,8 +412,8 @@ BEGIN END Size; -PROCEDURE -readfile (fd: LONGINT; p: SYSTEM.ADDRESS; l: SYSTEM.ADDRESS; VAR n: SYSTEM.ADDRESS): SYSTEM.ADDRESS -"(address)ReadFile((HANDLE)fd, (void*)p, (DWORD)l, (DWORD*)n, 0)"; +PROCEDURE -readfile (fd: LONGINT; p: SYSTEM.ADDRESS; l: SYSTEM.ADDRESS; VAR n: SYSTEM.ADDRESS): INTEGER +"(INTEGER)ReadFile((HANDLE)fd, (void*)p, (DWORD)l, (DWORD*)n, 0)"; PROCEDURE Read*(h: FileHandle; p: SYSTEM.ADDRESS; l: SYSTEM.ADDRESS; VAR n: SYSTEM.ADDRESS): ErrorCode; VAR result: INTEGER; diff --git a/src/tools/make/configure.c b/src/tools/make/configure.c index 28530ece..767763bc 100644 --- a/src/tools/make/configure.c +++ b/src/tools/make/configure.c @@ -19,6 +19,7 @@ #ifdef _WIN32 #define strncasecmp _strnicmp + char* getcwd(char* buf, size_t size); #else #include #include From ebfc60f49dc74e31c32917979054d17538bd9403 Mon Sep 17 00:00:00 2001 From: David Brown Date: Tue, 6 Sep 2016 20:48:22 +0100 Subject: [PATCH 218/580] Define integer sizes before including SYSTEM.h --- bootstrap/unix-44/Configuration.c | 9 +++- bootstrap/unix-44/Configuration.h | 4 +- bootstrap/unix-44/Console.c | 7 ++- bootstrap/unix-44/Console.h | 4 +- bootstrap/unix-44/Files.c | 7 ++- bootstrap/unix-44/Files.h | 4 +- bootstrap/unix-44/Heap.c | 7 ++- bootstrap/unix-44/Heap.h | 6 +-- bootstrap/unix-44/Modules.c | 7 ++- bootstrap/unix-44/Modules.h | 4 +- bootstrap/unix-44/OPB.c | 9 +++- bootstrap/unix-44/OPB.h | 4 +- bootstrap/unix-44/OPC.c | 51 ++++++++++++------- bootstrap/unix-44/OPC.h | 4 +- bootstrap/unix-44/OPM.c | 7 ++- bootstrap/unix-44/OPM.h | 4 +- bootstrap/unix-44/OPP.c | 7 ++- bootstrap/unix-44/OPP.h | 4 +- bootstrap/unix-44/OPS.c | 7 ++- bootstrap/unix-44/OPS.h | 4 +- bootstrap/unix-44/OPT.c | 7 ++- bootstrap/unix-44/OPT.h | 4 +- bootstrap/unix-44/OPV.c | 36 ++++--------- bootstrap/unix-44/OPV.h | 4 +- bootstrap/unix-44/Platform.c | 9 ++-- bootstrap/unix-44/Platform.h | 4 +- bootstrap/unix-44/Reals.c | 7 ++- bootstrap/unix-44/Reals.h | 4 +- bootstrap/unix-44/SYSTEM.h | 43 ++++++++-------- bootstrap/unix-44/Strings.c | 7 ++- bootstrap/unix-44/Strings.h | 4 +- bootstrap/unix-44/Texts.c | 7 ++- bootstrap/unix-44/Texts.h | 6 +-- bootstrap/unix-44/Vishap.c | 7 ++- bootstrap/unix-44/errors.c | 7 ++- bootstrap/unix-44/errors.h | 4 +- bootstrap/unix-44/extTools.c | 7 ++- bootstrap/unix-44/extTools.h | 4 +- bootstrap/unix-44/vt100.c | 7 ++- bootstrap/unix-44/vt100.h | 4 +- bootstrap/unix-48/Configuration.c | 9 +++- bootstrap/unix-48/Configuration.h | 4 +- bootstrap/unix-48/Console.c | 7 ++- bootstrap/unix-48/Console.h | 4 +- bootstrap/unix-48/Files.c | 7 ++- bootstrap/unix-48/Files.h | 4 +- bootstrap/unix-48/Heap.c | 7 ++- bootstrap/unix-48/Heap.h | 6 +-- bootstrap/unix-48/Modules.c | 7 ++- bootstrap/unix-48/Modules.h | 4 +- bootstrap/unix-48/OPB.c | 9 +++- bootstrap/unix-48/OPB.h | 4 +- bootstrap/unix-48/OPC.c | 51 ++++++++++++------- bootstrap/unix-48/OPC.h | 4 +- bootstrap/unix-48/OPM.c | 7 ++- bootstrap/unix-48/OPM.h | 4 +- bootstrap/unix-48/OPP.c | 7 ++- bootstrap/unix-48/OPP.h | 4 +- bootstrap/unix-48/OPS.c | 7 ++- bootstrap/unix-48/OPS.h | 4 +- bootstrap/unix-48/OPT.c | 7 ++- bootstrap/unix-48/OPT.h | 4 +- bootstrap/unix-48/OPV.c | 36 ++++--------- bootstrap/unix-48/OPV.h | 4 +- bootstrap/unix-48/Platform.c | 9 ++-- bootstrap/unix-48/Platform.h | 4 +- bootstrap/unix-48/Reals.c | 7 ++- bootstrap/unix-48/Reals.h | 4 +- bootstrap/unix-48/SYSTEM.h | 43 ++++++++-------- bootstrap/unix-48/Strings.c | 7 ++- bootstrap/unix-48/Strings.h | 4 +- bootstrap/unix-48/Texts.c | 7 ++- bootstrap/unix-48/Texts.h | 8 +-- bootstrap/unix-48/Vishap.c | 7 ++- bootstrap/unix-48/errors.c | 7 ++- bootstrap/unix-48/errors.h | 4 +- bootstrap/unix-48/extTools.c | 7 ++- bootstrap/unix-48/extTools.h | 4 +- bootstrap/unix-48/vt100.c | 7 ++- bootstrap/unix-48/vt100.h | 4 +- bootstrap/unix-88/Configuration.c | 10 ++-- bootstrap/unix-88/Configuration.h | 5 +- bootstrap/unix-88/Console.c | 8 ++- bootstrap/unix-88/Console.h | 5 +- bootstrap/unix-88/Files.c | 8 ++- bootstrap/unix-88/Files.h | 5 +- bootstrap/unix-88/Heap.c | 8 ++- bootstrap/unix-88/Heap.h | 7 ++- bootstrap/unix-88/Modules.c | 8 ++- bootstrap/unix-88/Modules.h | 5 +- bootstrap/unix-88/OPB.c | 10 ++-- bootstrap/unix-88/OPB.h | 5 +- bootstrap/unix-88/OPC.c | 52 ++++++++++++------- bootstrap/unix-88/OPC.h | 5 +- bootstrap/unix-88/OPM.c | 8 ++- bootstrap/unix-88/OPM.h | 5 +- bootstrap/unix-88/OPP.c | 8 ++- bootstrap/unix-88/OPP.h | 5 +- bootstrap/unix-88/OPS.c | 8 ++- bootstrap/unix-88/OPS.h | 5 +- bootstrap/unix-88/OPT.c | 8 ++- bootstrap/unix-88/OPT.h | 5 +- bootstrap/unix-88/OPV.c | 37 ++++---------- bootstrap/unix-88/OPV.h | 5 +- bootstrap/unix-88/Platform.c | 10 ++-- bootstrap/unix-88/Platform.h | 5 +- bootstrap/unix-88/Reals.c | 8 ++- bootstrap/unix-88/Reals.h | 5 +- bootstrap/unix-88/SYSTEM.h | 43 ++++++++-------- bootstrap/unix-88/Strings.c | 8 ++- bootstrap/unix-88/Strings.h | 5 +- bootstrap/unix-88/Texts.c | 8 ++- bootstrap/unix-88/Texts.h | 7 ++- bootstrap/unix-88/Vishap.c | 8 ++- bootstrap/unix-88/errors.c | 8 ++- bootstrap/unix-88/errors.h | 5 +- bootstrap/unix-88/extTools.c | 8 ++- bootstrap/unix-88/extTools.h | 5 +- bootstrap/unix-88/vt100.c | 8 ++- bootstrap/unix-88/vt100.h | 5 +- bootstrap/windows-48/Configuration.c | 9 +++- bootstrap/windows-48/Configuration.h | 4 +- bootstrap/windows-48/Console.c | 7 ++- bootstrap/windows-48/Console.h | 4 +- bootstrap/windows-48/Files.c | 7 ++- bootstrap/windows-48/Files.h | 4 +- bootstrap/windows-48/Heap.c | 7 ++- bootstrap/windows-48/Heap.h | 6 +-- bootstrap/windows-48/Modules.c | 7 ++- bootstrap/windows-48/Modules.h | 4 +- bootstrap/windows-48/OPB.c | 9 +++- bootstrap/windows-48/OPB.h | 4 +- bootstrap/windows-48/OPC.c | 51 ++++++++++++------- bootstrap/windows-48/OPC.h | 4 +- bootstrap/windows-48/OPM.c | 7 ++- bootstrap/windows-48/OPM.h | 4 +- bootstrap/windows-48/OPP.c | 7 ++- bootstrap/windows-48/OPP.h | 4 +- bootstrap/windows-48/OPS.c | 7 ++- bootstrap/windows-48/OPS.h | 4 +- bootstrap/windows-48/OPT.c | 7 ++- bootstrap/windows-48/OPT.h | 4 +- bootstrap/windows-48/OPV.c | 36 ++++--------- bootstrap/windows-48/OPV.h | 4 +- bootstrap/windows-48/Platform.c | 9 ++-- bootstrap/windows-48/Platform.h | 6 +-- bootstrap/windows-48/Reals.c | 7 ++- bootstrap/windows-48/Reals.h | 4 +- bootstrap/windows-48/SYSTEM.h | 43 ++++++++-------- bootstrap/windows-48/Strings.c | 7 ++- bootstrap/windows-48/Strings.h | 4 +- bootstrap/windows-48/Texts.c | 7 ++- bootstrap/windows-48/Texts.h | 8 +-- bootstrap/windows-48/Vishap.c | 7 ++- bootstrap/windows-48/errors.c | 7 ++- bootstrap/windows-48/errors.h | 4 +- bootstrap/windows-48/extTools.c | 7 ++- bootstrap/windows-48/extTools.h | 4 +- bootstrap/windows-48/vt100.c | 7 ++- bootstrap/windows-48/vt100.h | 4 +- bootstrap/windows-88/Configuration.c | 10 ++-- bootstrap/windows-88/Configuration.h | 5 +- bootstrap/windows-88/Console.c | 8 ++- bootstrap/windows-88/Console.h | 5 +- bootstrap/windows-88/Files.c | 8 ++- bootstrap/windows-88/Files.h | 5 +- bootstrap/windows-88/Heap.c | 8 ++- bootstrap/windows-88/Heap.h | 7 ++- bootstrap/windows-88/Modules.c | 8 ++- bootstrap/windows-88/Modules.h | 5 +- bootstrap/windows-88/OPB.c | 10 ++-- bootstrap/windows-88/OPB.h | 5 +- bootstrap/windows-88/OPC.c | 52 ++++++++++++------- bootstrap/windows-88/OPC.h | 5 +- bootstrap/windows-88/OPM.c | 8 ++- bootstrap/windows-88/OPM.h | 5 +- bootstrap/windows-88/OPP.c | 8 ++- bootstrap/windows-88/OPP.h | 5 +- bootstrap/windows-88/OPS.c | 8 ++- bootstrap/windows-88/OPS.h | 5 +- bootstrap/windows-88/OPT.c | 8 ++- bootstrap/windows-88/OPT.h | 5 +- bootstrap/windows-88/OPV.c | 37 ++++---------- bootstrap/windows-88/OPV.h | 5 +- bootstrap/windows-88/Platform.c | 10 ++-- bootstrap/windows-88/Platform.h | 7 ++- bootstrap/windows-88/Reals.c | 8 ++- bootstrap/windows-88/Reals.h | 5 +- bootstrap/windows-88/SYSTEM.h | 43 ++++++++-------- bootstrap/windows-88/Strings.c | 8 ++- bootstrap/windows-88/Strings.h | 5 +- bootstrap/windows-88/Texts.c | 8 ++- bootstrap/windows-88/Texts.h | 7 ++- bootstrap/windows-88/Vishap.c | 8 ++- bootstrap/windows-88/errors.c | 8 ++- bootstrap/windows-88/errors.h | 5 +- bootstrap/windows-88/extTools.c | 8 ++- bootstrap/windows-88/extTools.h | 5 +- bootstrap/windows-88/vt100.c | 8 ++- bootstrap/windows-88/vt100.h | 5 +- src/compiler/OPB.Mod | 2 +- src/compiler/OPC.Mod | 76 +++++++++++++++++++--------- src/compiler/OPM.cmdln.Mod | 8 +-- src/compiler/OPV.Mod | 16 +----- src/system/Platformunix.Mod | 2 - src/system/Platformwindows.Mod | 2 - src/system/SYSTEM.h | 43 ++++++++-------- src/tools/make/configure.c | 6 +++ 208 files changed, 1164 insertions(+), 787 deletions(-) diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index 560d018b..115f8dec 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" @@ -13,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/04] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/06] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index ac266eec..84e8427b 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h @@ -12,4 +12,4 @@ import CHAR Configuration_versionLong[41]; import void *Configuration__init(void); -#endif +#endif // Configuration diff --git a/bootstrap/unix-44/Console.c b/bootstrap/unix-44/Console.c index 7a2cc9d0..8cbc9ce9 100644 --- a/bootstrap/unix-44/Console.c +++ b/bootstrap/unix-44/Console.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "Platform.h" diff --git a/bootstrap/unix-44/Console.h b/bootstrap/unix-44/Console.h index fd32774b..e9913d2d 100644 --- a/bootstrap/unix-44/Console.h +++ b/bootstrap/unix-44/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h @@ -20,4 +20,4 @@ import void Console_String (CHAR *s, LONGINT s__len); import void *Console__init(void); -#endif +#endif // Console diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 87b9a0a5..d596986e 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index 4fc7ce7e..b0f34806 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h @@ -67,4 +67,4 @@ import void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT import void *Files__init(void); -#endif +#endif // Files diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index 02e6f1cb..2bbe63b2 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tskSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" struct Heap__1 { diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index ca1d8e95..6694ef70 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h @@ -22,7 +22,7 @@ typedef typedef struct Heap_ModuleDesc { - LONGINT _prvt0; + int32 _prvt0; char _prvt1[44]; } Heap_ModuleDesc; @@ -51,4 +51,4 @@ import void Heap_Unlock (void); import void *Heap__init(void); -#endif +#endif // Heap diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index fab3561e..e31876fb 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "Console.h" #include "Heap.h" diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index 13abd6d0..4bd4082d 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h @@ -51,4 +51,4 @@ import void *Modules__init(void); #define Modules_modules() (Modules_Module)Heap_modules #define Modules_setmodules(m) Heap_modules = m -#endif +#endif // Modules diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index 1d0b8774..0a1a9f63 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" @@ -1912,7 +1917,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (f == 4) { - if (x->typ->size != OPM_LIntSize) { + if (x->typ->size != OPT_linttyp->size) { OPB_Convert(&x, OPT_linttyp); } } else { diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index 465ba585..5ffa3869 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h @@ -46,4 +46,4 @@ import void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard); import void *OPB__init(void); -#endif +#endif // OPB diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index b702852c..5666c7cd 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "Configuration.h" #include "OPM.h" @@ -834,7 +839,7 @@ void OPC_TDescDecl (OPT_Struct typ) OPC_Str1((CHAR*)", #), {", 8, typ->size); nofptrs = 0; OPC_PutPtrOffsets(typ, 0, &nofptrs); - OPC_Str1((CHAR*)"#}}", 4, -((nofptrs + 1) * OPM_LIntSize)); + OPC_Str1((CHAR*)"#}}", 4, -((nofptrs + 1) * OPM_PointerSize)); OPC_EndStat(); } @@ -917,12 +922,20 @@ static void OPC_FillGap (int32 gap, int32 off, int32 align, int32 *n, int32 *cur if ((*curAlign < align && gap - (adr - off) >= align)) { gap -= (adr - off) + align; OPC_BegStat(); - if (align == OPM_IntSize) { - OPM_WriteString((CHAR*)"INTEGER", 8); - } else if (align == OPM_LIntSize) { - OPM_WriteString((CHAR*)"LONGINT", 8); - } else if (align == OPM_LRealSize) { - OPM_WriteString((CHAR*)"LONGREAL", 9); + switch (align) { + case 2: + OPM_WriteString((CHAR*)"int16", 6); + break; + case 4: + OPM_WriteString((CHAR*)"int32", 6); + break; + case 8: + OPM_WriteString((CHAR*)"int64", 6); + break; + default: + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Unexpected enclosing alignment in FillGap.", 43); + break; } OPC_Str1((CHAR*)" _prvt#", 8, *n); *n += 1; @@ -1210,7 +1223,8 @@ void OPC_GenHdr (OPT_Node n) OPM_WriteLn(); OPC_CProcDefs(OPT_topScope->right, 1); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#endif", 7); + OPM_WriteString((CHAR*)"#endif // ", 11); + OPM_WriteStringVar((void*)OPM_modName, 32); OPM_WriteLn(); } @@ -1297,10 +1311,6 @@ void OPC_GenHdrIncludes (void) OPM_WriteString((CHAR*)"__h", 4); OPM_WriteLn(); OPM_WriteLn(); - if (OPM_LIntSize == 8) { - OPM_WriteString((CHAR*)"#define LARGE", 14); - OPM_WriteLn(); - } OPC_Include((CHAR*)"SYSTEM", 7); OPC_IncludeImports(OPT_topScope->right, 1); OPM_WriteLn(); @@ -1310,10 +1320,17 @@ void OPC_GenBdy (OPT_Node n) { OPM_currFile = 1; OPC_GenHeaderMsg(); - if (OPM_LIntSize == 8) { - OPM_WriteString((CHAR*)"#define LARGE", 14); - OPM_WriteLn(); - } + OPM_WriteLn(); + OPM_WriteString((CHAR*)"#define INTEGER int", 20); + OPM_WriteInt(__ASHL(OPT_inttyp->size, 3)); + OPM_WriteLn(); + OPM_WriteString((CHAR*)"#define LONGINT int", 20); + OPM_WriteInt(__ASHL(OPT_linttyp->size, 3)); + OPM_WriteLn(); + OPM_WriteString((CHAR*)"#define SET uint", 21); + OPM_WriteInt(__ASHL(OPT_settyp->size, 3)); + OPM_WriteLn(); + OPM_WriteLn(); OPC_Include((CHAR*)"SYSTEM", 7); OPC_IncludeImports(OPT_topScope->right, 0); OPM_WriteLn(); diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index 2839fb0f..e1fc08ec 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h @@ -48,4 +48,4 @@ import void OPC_TypeOf (OPT_Object ap); import void *OPC__init(void); -#endif +#endif // OPC diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 70121d63..461b5b85 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index fce4bdd3..c60f6f98 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h @@ -62,4 +62,4 @@ import void OPM_err (int16 n); import void *OPM__init(void); -#endif +#endif // OPM diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index dc286221..1ab60658 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "OPB.h" #include "OPM.h" diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index e79b5819..ce85af11 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h @@ -13,4 +13,4 @@ import void OPP_Module (OPT_Node *prog, SET opt); import void *OPP__init(void); -#endif +#endif // OPP diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index b90cb34b..3a1c4787 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index 347c669a..512cfa75 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h @@ -25,4 +25,4 @@ import void OPS_Init (void); import void *OPS__init(void); -#endif +#endif // OPS diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index ccfba447..1983daf5 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index ce146e6f..d3b24cc6 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h @@ -103,4 +103,4 @@ import OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir); import void *OPT__init(void); -#endif +#endif // OPT diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index da9a8429..a62894dd 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "OPC.h" #include "OPM.h" @@ -16,7 +21,6 @@ static int16 OPV_stamp; static int32 OPV_recno; static OPV_ExitInfo OPV_exit; static int16 OPV_nofExitLabels; -static BOOLEAN OPV_naturalAlignment; export LONGINT *OPV_ExitInfo__typ; @@ -34,7 +38,6 @@ export void OPV_Init (void); static void OPV_InitTDescs (OPT_Node n); static void OPV_Len (OPT_Node n, int32 dim); export void OPV_Module (OPT_Node prog); -static int32 OPV_NaturalAlignment (int32 size, int32 max); static void OPV_NewArr (OPT_Node d, OPT_Node x); static void OPV_ParIntLiteral (int32 n, int32 size); static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp); @@ -51,24 +54,6 @@ static void OPV_expr (OPT_Node n, int16 prec); static void OPV_stat (OPT_Node n, OPT_Object outerProc); -static int32 OPV_NaturalAlignment (int32 size, int32 max) -{ - int32 _o_result; - int32 i; - if (size >= max) { - _o_result = max; - return _o_result; - } else { - i = 1; - while (i < size) { - i += i; - } - _o_result = i; - return _o_result; - } - __RETCHK; -} - void OPV_TypSize (OPT_Struct typ) { int16 f, c; @@ -108,9 +93,6 @@ void OPV_TypSize (OPT_Struct typ) if (offset == 0) { offset = 1; } - if (OPM_RecSize == 0) { - base = OPV_NaturalAlignment(offset, OPC_SizeAlignment(OPM_RecSize)); - } OPC_Align(&offset, base); if ((typ->strobj == NIL && __MASK(typ->align, -65536) == 0)) { OPV_recno += 1; @@ -568,7 +550,7 @@ static void OPV_design (OPT_Node n, int16 prec) OPT_Struct typ = NIL; int16 class, designPrec, comp; OPT_Node d = NIL, x = NIL; - int16 dims, i, _for__28; + int16 dims, i, _for__27; comp = n->typ->comp; obj = n->obj; class = n->class; @@ -644,9 +626,9 @@ static void OPV_design (OPT_Node n, int16 prec) } x = x->left; } - _for__28 = dims; + _for__27 = dims; i = 1; - while (i <= _for__28) { + while (i <= _for__27) { OPM_Write(')'); i += 1; } diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index 600b19bd..b10704dc 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h @@ -16,4 +16,4 @@ import void OPV_TypSize (OPT_Struct typ); import void *OPV__init(void); -#endif +#endif // OPV diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 056a333c..43761270 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" typedef @@ -728,7 +733,6 @@ static void Platform_DisplayHaltCode (int32 code) void Platform_Halt (int32 code) { - int16 e; Platform_HaltCode = code; if (Platform_HaltHandler != NIL) { (*Platform_HaltHandler)(code); @@ -745,7 +749,6 @@ void Platform_Halt (int32 code) void Platform_AssertFail (int32 code) { - int16 e; Platform_errstring((CHAR*)"Assertion failure.", 19); if (code != 0) { Platform_errstring((CHAR*)" ASSERT code ", 14); diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index ab1d3003..0f9c0290 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h @@ -80,4 +80,4 @@ import BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT import void *Platform__init(void); -#endif +#endif // Platform diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 8fe37010..5f3d11a5 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index 9ebc1c17..cf931556 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h @@ -20,4 +20,4 @@ import LONGREAL Reals_TenL (int16 e); import void *Reals__init(void); -#endif +#endif // Reals diff --git a/bootstrap/unix-44/SYSTEM.h b/bootstrap/unix-44/SYSTEM.h index 8c6c335e..6fc57309 100644 --- a/bootstrap/unix-44/SYSTEM.h +++ b/bootstrap/unix-44/SYSTEM.h @@ -1,6 +1,24 @@ #ifndef SYSTEM__h #define SYSTEM__h + + +#ifndef LONGINT + #if (__SIZEOF_POINTER__ == 8) || defined(_WIN64) + #define INTEGER int32 + #define LONGINT int64 + #define SET uint64 + #else + #define INTEGER int16 + #define LONGINT int32 + #define SET uint32 + #endif +#endif + + + + + // Declare memcpy in a way compatible with C compilers intrinsic // built in implementations. @@ -22,10 +40,12 @@ void *memcpy(void *dest, const void *source, size_t size); // Declare fixed size versions of basic intger types -#if defined(_WIN64) +#if (__SIZEOF_POINTER__ < 8) || defined(_WIN64) + // ILP32 or LLP64 typedef long long int64; typedef unsigned long long uint64; #else + // LP64 typedef long int64; typedef unsigned long uint64; #endif @@ -67,29 +87,10 @@ typedef float REAL; typedef double LONGREAL; typedef void* SYSTEM_PTR; +#define uSET SET -// For 32 bit builds, the size of LONGINT depends on a make option: - -#if (__SIZEOF_POINTER__ == 8) || defined(LARGE) || defined(_WIN64) - typedef int32 INTEGER; - typedef int64 LONGINT; - typedef uint64 SET; - typedef uint64 uSET; -#else - typedef int16 INTEGER; - typedef int32 LONGINT; - typedef uint32 SET; - typedef uint32 uSET; -#endif - - -// Temporary defs while bootstrapping - -#define uLONGINT uint64 - - // ---------------------------------------------------------------------- // ---------------------------------------------------------------------- diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index a642190c..7e1a6845 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index f537406e..59076121 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h @@ -20,4 +20,4 @@ import void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR import void *Strings__init(void); -#endif +#endif // Strings diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index 8b4c3700..9314c178 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "Files.h" #include "Modules.h" diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index 4444900f..ce868328 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h @@ -30,7 +30,7 @@ typedef typedef struct Texts_RunDesc { - LONGINT _prvt0; + int32 _prvt0; char _prvt1[15]; } Texts_RunDesc; @@ -169,4 +169,4 @@ import void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGIN import void *Texts__init(void); -#endif +#endif // Texts diff --git a/bootstrap/unix-44/Vishap.c b/bootstrap/unix-44/Vishap.c index 81b2d70f..549268e2 100644 --- a/bootstrap/unix-44/Vishap.c +++ b/bootstrap/unix-44/Vishap.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkamSf */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "Configuration.h" #include "Heap.h" diff --git a/bootstrap/unix-44/errors.c b/bootstrap/unix-44/errors.c index a5576d43..a2f7cf75 100644 --- a/bootstrap/unix-44/errors.c +++ b/bootstrap/unix-44/errors.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" typedef diff --git a/bootstrap/unix-44/errors.h b/bootstrap/unix-44/errors.h index 696219d4..bf0e9564 100644 --- a/bootstrap/unix-44/errors.h +++ b/bootstrap/unix-44/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h @@ -15,4 +15,4 @@ import errors_string errors_errors[350]; import void *errors__init(void); -#endif +#endif // errors diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index 553a3d7d..27ef9f8f 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index ba9937e8..c5d5c772 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h @@ -13,4 +13,4 @@ import void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEA import void *extTools__init(void); -#endif +#endif // extTools diff --git a/bootstrap/unix-44/vt100.c b/bootstrap/unix-44/vt100.c index ab305ed1..912e5e83 100644 --- a/bootstrap/unix-44/vt100.c +++ b/bootstrap/unix-44/vt100.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "Console.h" #include "Strings.h" diff --git a/bootstrap/unix-44/vt100.h b/bootstrap/unix-44/vt100.h index 71079dc0..36c0bc7e 100644 --- a/bootstrap/unix-44/vt100.h +++ b/bootstrap/unix-44/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h @@ -34,4 +34,4 @@ import void vt100_SetAttr (CHAR *attr, LONGINT attr__len); import void *vt100__init(void); -#endif +#endif // vt100 diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index 560d018b..115f8dec 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" @@ -13,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/04] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/06] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index ac266eec..84e8427b 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h @@ -12,4 +12,4 @@ import CHAR Configuration_versionLong[41]; import void *Configuration__init(void); -#endif +#endif // Configuration diff --git a/bootstrap/unix-48/Console.c b/bootstrap/unix-48/Console.c index 7a2cc9d0..8cbc9ce9 100644 --- a/bootstrap/unix-48/Console.c +++ b/bootstrap/unix-48/Console.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "Platform.h" diff --git a/bootstrap/unix-48/Console.h b/bootstrap/unix-48/Console.h index fd32774b..e9913d2d 100644 --- a/bootstrap/unix-48/Console.h +++ b/bootstrap/unix-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h @@ -20,4 +20,4 @@ import void Console_String (CHAR *s, LONGINT s__len); import void *Console__init(void); -#endif +#endif // Console diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 87b9a0a5..d596986e 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index 4fc7ce7e..b0f34806 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h @@ -67,4 +67,4 @@ import void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT import void *Files__init(void); -#endif +#endif // Files diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index 02e6f1cb..2bbe63b2 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tskSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" struct Heap__1 { diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index ca1d8e95..6694ef70 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h @@ -22,7 +22,7 @@ typedef typedef struct Heap_ModuleDesc { - LONGINT _prvt0; + int32 _prvt0; char _prvt1[44]; } Heap_ModuleDesc; @@ -51,4 +51,4 @@ import void Heap_Unlock (void); import void *Heap__init(void); -#endif +#endif // Heap diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index fab3561e..e31876fb 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "Console.h" #include "Heap.h" diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index 13abd6d0..4bd4082d 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h @@ -51,4 +51,4 @@ import void *Modules__init(void); #define Modules_modules() (Modules_Module)Heap_modules #define Modules_setmodules(m) Heap_modules = m -#endif +#endif // Modules diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index 1d0b8774..0a1a9f63 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" @@ -1912,7 +1917,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (f == 4) { - if (x->typ->size != OPM_LIntSize) { + if (x->typ->size != OPT_linttyp->size) { OPB_Convert(&x, OPT_linttyp); } } else { diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index 465ba585..5ffa3869 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h @@ -46,4 +46,4 @@ import void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard); import void *OPB__init(void); -#endif +#endif // OPB diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index b702852c..5666c7cd 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "Configuration.h" #include "OPM.h" @@ -834,7 +839,7 @@ void OPC_TDescDecl (OPT_Struct typ) OPC_Str1((CHAR*)", #), {", 8, typ->size); nofptrs = 0; OPC_PutPtrOffsets(typ, 0, &nofptrs); - OPC_Str1((CHAR*)"#}}", 4, -((nofptrs + 1) * OPM_LIntSize)); + OPC_Str1((CHAR*)"#}}", 4, -((nofptrs + 1) * OPM_PointerSize)); OPC_EndStat(); } @@ -917,12 +922,20 @@ static void OPC_FillGap (int32 gap, int32 off, int32 align, int32 *n, int32 *cur if ((*curAlign < align && gap - (adr - off) >= align)) { gap -= (adr - off) + align; OPC_BegStat(); - if (align == OPM_IntSize) { - OPM_WriteString((CHAR*)"INTEGER", 8); - } else if (align == OPM_LIntSize) { - OPM_WriteString((CHAR*)"LONGINT", 8); - } else if (align == OPM_LRealSize) { - OPM_WriteString((CHAR*)"LONGREAL", 9); + switch (align) { + case 2: + OPM_WriteString((CHAR*)"int16", 6); + break; + case 4: + OPM_WriteString((CHAR*)"int32", 6); + break; + case 8: + OPM_WriteString((CHAR*)"int64", 6); + break; + default: + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Unexpected enclosing alignment in FillGap.", 43); + break; } OPC_Str1((CHAR*)" _prvt#", 8, *n); *n += 1; @@ -1210,7 +1223,8 @@ void OPC_GenHdr (OPT_Node n) OPM_WriteLn(); OPC_CProcDefs(OPT_topScope->right, 1); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#endif", 7); + OPM_WriteString((CHAR*)"#endif // ", 11); + OPM_WriteStringVar((void*)OPM_modName, 32); OPM_WriteLn(); } @@ -1297,10 +1311,6 @@ void OPC_GenHdrIncludes (void) OPM_WriteString((CHAR*)"__h", 4); OPM_WriteLn(); OPM_WriteLn(); - if (OPM_LIntSize == 8) { - OPM_WriteString((CHAR*)"#define LARGE", 14); - OPM_WriteLn(); - } OPC_Include((CHAR*)"SYSTEM", 7); OPC_IncludeImports(OPT_topScope->right, 1); OPM_WriteLn(); @@ -1310,10 +1320,17 @@ void OPC_GenBdy (OPT_Node n) { OPM_currFile = 1; OPC_GenHeaderMsg(); - if (OPM_LIntSize == 8) { - OPM_WriteString((CHAR*)"#define LARGE", 14); - OPM_WriteLn(); - } + OPM_WriteLn(); + OPM_WriteString((CHAR*)"#define INTEGER int", 20); + OPM_WriteInt(__ASHL(OPT_inttyp->size, 3)); + OPM_WriteLn(); + OPM_WriteString((CHAR*)"#define LONGINT int", 20); + OPM_WriteInt(__ASHL(OPT_linttyp->size, 3)); + OPM_WriteLn(); + OPM_WriteString((CHAR*)"#define SET uint", 21); + OPM_WriteInt(__ASHL(OPT_settyp->size, 3)); + OPM_WriteLn(); + OPM_WriteLn(); OPC_Include((CHAR*)"SYSTEM", 7); OPC_IncludeImports(OPT_topScope->right, 0); OPM_WriteLn(); diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index 2839fb0f..e1fc08ec 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h @@ -48,4 +48,4 @@ import void OPC_TypeOf (OPT_Object ap); import void *OPC__init(void); -#endif +#endif // OPC diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 70121d63..461b5b85 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index fce4bdd3..c60f6f98 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h @@ -62,4 +62,4 @@ import void OPM_err (int16 n); import void *OPM__init(void); -#endif +#endif // OPM diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index dc286221..1ab60658 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "OPB.h" #include "OPM.h" diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index e79b5819..ce85af11 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h @@ -13,4 +13,4 @@ import void OPP_Module (OPT_Node *prog, SET opt); import void *OPP__init(void); -#endif +#endif // OPP diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index b90cb34b..3a1c4787 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index 347c669a..512cfa75 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h @@ -25,4 +25,4 @@ import void OPS_Init (void); import void *OPS__init(void); -#endif +#endif // OPS diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index ccfba447..1983daf5 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index ce146e6f..d3b24cc6 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h @@ -103,4 +103,4 @@ import OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir); import void *OPT__init(void); -#endif +#endif // OPT diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index da9a8429..a62894dd 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "OPC.h" #include "OPM.h" @@ -16,7 +21,6 @@ static int16 OPV_stamp; static int32 OPV_recno; static OPV_ExitInfo OPV_exit; static int16 OPV_nofExitLabels; -static BOOLEAN OPV_naturalAlignment; export LONGINT *OPV_ExitInfo__typ; @@ -34,7 +38,6 @@ export void OPV_Init (void); static void OPV_InitTDescs (OPT_Node n); static void OPV_Len (OPT_Node n, int32 dim); export void OPV_Module (OPT_Node prog); -static int32 OPV_NaturalAlignment (int32 size, int32 max); static void OPV_NewArr (OPT_Node d, OPT_Node x); static void OPV_ParIntLiteral (int32 n, int32 size); static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp); @@ -51,24 +54,6 @@ static void OPV_expr (OPT_Node n, int16 prec); static void OPV_stat (OPT_Node n, OPT_Object outerProc); -static int32 OPV_NaturalAlignment (int32 size, int32 max) -{ - int32 _o_result; - int32 i; - if (size >= max) { - _o_result = max; - return _o_result; - } else { - i = 1; - while (i < size) { - i += i; - } - _o_result = i; - return _o_result; - } - __RETCHK; -} - void OPV_TypSize (OPT_Struct typ) { int16 f, c; @@ -108,9 +93,6 @@ void OPV_TypSize (OPT_Struct typ) if (offset == 0) { offset = 1; } - if (OPM_RecSize == 0) { - base = OPV_NaturalAlignment(offset, OPC_SizeAlignment(OPM_RecSize)); - } OPC_Align(&offset, base); if ((typ->strobj == NIL && __MASK(typ->align, -65536) == 0)) { OPV_recno += 1; @@ -568,7 +550,7 @@ static void OPV_design (OPT_Node n, int16 prec) OPT_Struct typ = NIL; int16 class, designPrec, comp; OPT_Node d = NIL, x = NIL; - int16 dims, i, _for__28; + int16 dims, i, _for__27; comp = n->typ->comp; obj = n->obj; class = n->class; @@ -644,9 +626,9 @@ static void OPV_design (OPT_Node n, int16 prec) } x = x->left; } - _for__28 = dims; + _for__27 = dims; i = 1; - while (i <= _for__28) { + while (i <= _for__27) { OPM_Write(')'); i += 1; } diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index 600b19bd..b10704dc 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h @@ -16,4 +16,4 @@ import void OPV_TypSize (OPT_Struct typ); import void *OPV__init(void); -#endif +#endif // OPV diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 056a333c..43761270 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" typedef @@ -728,7 +733,6 @@ static void Platform_DisplayHaltCode (int32 code) void Platform_Halt (int32 code) { - int16 e; Platform_HaltCode = code; if (Platform_HaltHandler != NIL) { (*Platform_HaltHandler)(code); @@ -745,7 +749,6 @@ void Platform_Halt (int32 code) void Platform_AssertFail (int32 code) { - int16 e; Platform_errstring((CHAR*)"Assertion failure.", 19); if (code != 0) { Platform_errstring((CHAR*)" ASSERT code ", 14); diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index ab1d3003..0f9c0290 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h @@ -80,4 +80,4 @@ import BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT import void *Platform__init(void); -#endif +#endif // Platform diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 8fe37010..5f3d11a5 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index 9ebc1c17..cf931556 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h @@ -20,4 +20,4 @@ import LONGREAL Reals_TenL (int16 e); import void *Reals__init(void); -#endif +#endif // Reals diff --git a/bootstrap/unix-48/SYSTEM.h b/bootstrap/unix-48/SYSTEM.h index 8c6c335e..6fc57309 100644 --- a/bootstrap/unix-48/SYSTEM.h +++ b/bootstrap/unix-48/SYSTEM.h @@ -1,6 +1,24 @@ #ifndef SYSTEM__h #define SYSTEM__h + + +#ifndef LONGINT + #if (__SIZEOF_POINTER__ == 8) || defined(_WIN64) + #define INTEGER int32 + #define LONGINT int64 + #define SET uint64 + #else + #define INTEGER int16 + #define LONGINT int32 + #define SET uint32 + #endif +#endif + + + + + // Declare memcpy in a way compatible with C compilers intrinsic // built in implementations. @@ -22,10 +40,12 @@ void *memcpy(void *dest, const void *source, size_t size); // Declare fixed size versions of basic intger types -#if defined(_WIN64) +#if (__SIZEOF_POINTER__ < 8) || defined(_WIN64) + // ILP32 or LLP64 typedef long long int64; typedef unsigned long long uint64; #else + // LP64 typedef long int64; typedef unsigned long uint64; #endif @@ -67,29 +87,10 @@ typedef float REAL; typedef double LONGREAL; typedef void* SYSTEM_PTR; +#define uSET SET -// For 32 bit builds, the size of LONGINT depends on a make option: - -#if (__SIZEOF_POINTER__ == 8) || defined(LARGE) || defined(_WIN64) - typedef int32 INTEGER; - typedef int64 LONGINT; - typedef uint64 SET; - typedef uint64 uSET; -#else - typedef int16 INTEGER; - typedef int32 LONGINT; - typedef uint32 SET; - typedef uint32 uSET; -#endif - - -// Temporary defs while bootstrapping - -#define uLONGINT uint64 - - // ---------------------------------------------------------------------- // ---------------------------------------------------------------------- diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index a642190c..7e1a6845 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index f537406e..59076121 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h @@ -20,4 +20,4 @@ import void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR import void *Strings__init(void); -#endif +#endif // Strings diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index b218c1b0..a4267893 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "Files.h" #include "Modules.h" diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index 3174aa9b..2238689d 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h @@ -30,7 +30,7 @@ typedef typedef struct Texts_RunDesc { - LONGINT _prvt0; + int32 _prvt0; char _prvt1[15]; } Texts_RunDesc; @@ -86,7 +86,7 @@ typedef Texts_FontsFont fnt; int8 col, voff; Texts_Elem elem; - LONGREAL _prvt0; + int64 _prvt0; char _prvt1[24]; CHAR nextCh; int16 line, class; @@ -170,4 +170,4 @@ import void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGIN import void *Texts__init(void); -#endif +#endif // Texts diff --git a/bootstrap/unix-48/Vishap.c b/bootstrap/unix-48/Vishap.c index 81b2d70f..549268e2 100644 --- a/bootstrap/unix-48/Vishap.c +++ b/bootstrap/unix-48/Vishap.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkamSf */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "Configuration.h" #include "Heap.h" diff --git a/bootstrap/unix-48/errors.c b/bootstrap/unix-48/errors.c index a5576d43..a2f7cf75 100644 --- a/bootstrap/unix-48/errors.c +++ b/bootstrap/unix-48/errors.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" typedef diff --git a/bootstrap/unix-48/errors.h b/bootstrap/unix-48/errors.h index 696219d4..bf0e9564 100644 --- a/bootstrap/unix-48/errors.h +++ b/bootstrap/unix-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h @@ -15,4 +15,4 @@ import errors_string errors_errors[350]; import void *errors__init(void); -#endif +#endif // errors diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index 553a3d7d..27ef9f8f 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index ba9937e8..c5d5c772 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h @@ -13,4 +13,4 @@ import void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEA import void *extTools__init(void); -#endif +#endif // extTools diff --git a/bootstrap/unix-48/vt100.c b/bootstrap/unix-48/vt100.c index ab305ed1..912e5e83 100644 --- a/bootstrap/unix-48/vt100.c +++ b/bootstrap/unix-48/vt100.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "Console.h" #include "Strings.h" diff --git a/bootstrap/unix-48/vt100.h b/bootstrap/unix-48/vt100.h index 71079dc0..36c0bc7e 100644 --- a/bootstrap/unix-48/vt100.h +++ b/bootstrap/unix-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h @@ -34,4 +34,4 @@ import void vt100_SetAttr (CHAR *attr, LONGINT attr__len); import void *vt100__init(void); -#endif +#endif // vt100 diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index c0502177..cfce02b8 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" @@ -14,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/04] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/06] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index 73002e87..84e8427b 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h -#define LARGE #include "SYSTEM.h" @@ -13,4 +12,4 @@ import CHAR Configuration_versionLong[41]; import void *Configuration__init(void); -#endif +#endif // Configuration diff --git a/bootstrap/unix-88/Console.c b/bootstrap/unix-88/Console.c index 13a36e69..3dc7b5ab 100644 --- a/bootstrap/unix-88/Console.c +++ b/bootstrap/unix-88/Console.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" #include "Platform.h" diff --git a/bootstrap/unix-88/Console.h b/bootstrap/unix-88/Console.h index bcf5714f..1f1182fd 100644 --- a/bootstrap/unix-88/Console.h +++ b/bootstrap/unix-88/Console.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h -#define LARGE #include "SYSTEM.h" @@ -21,4 +20,4 @@ import void Console_String (CHAR *s, LONGINT s__len); import void *Console__init(void); -#endif +#endif // Console diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 0633202c..29b0069e 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 340af571..60221720 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h -#define LARGE #include "SYSTEM.h" typedef @@ -68,4 +67,4 @@ import void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT import void *Files__init(void); -#endif +#endif // Files diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index b5749b04..1fe3ce13 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tskSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tskSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" struct Heap__1 { diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index b547af41..def46dcf 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h -#define LARGE #include "SYSTEM.h" typedef @@ -23,7 +22,7 @@ typedef typedef struct Heap_ModuleDesc { - LONGINT _prvt0; + int64 _prvt0; char _prvt1[72]; } Heap_ModuleDesc; @@ -52,4 +51,4 @@ import void Heap_Unlock (void); import void *Heap__init(void); -#endif +#endif // Heap diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index bce66b2e..9d93e3d2 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" #include "Console.h" #include "Heap.h" diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index 544820fd..f9e49aa7 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h -#define LARGE #include "SYSTEM.h" typedef @@ -52,4 +51,4 @@ import void *Modules__init(void); #define Modules_modules() (Modules_Module)Heap_modules #define Modules_setmodules(m) Heap_modules = m -#endif +#endif // Modules diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index 1414fc79..11b9a1a9 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" @@ -1913,7 +1917,7 @@ void OPB_StPar0 (OPT_Node *par0, int32 fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (f == 4) { - if (x->typ->size != (int64)OPM_LIntSize) { + if (x->typ->size != OPT_linttyp->size) { OPB_Convert(&x, OPT_linttyp); } } else { diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index 718d88bb..c3c5c1e8 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h -#define LARGE #include "SYSTEM.h" #include "OPS.h" #include "OPT.h" @@ -47,4 +46,4 @@ import void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard); import void *OPB__init(void); -#endif +#endif // OPB diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index fad896b9..e971762c 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" #include "Configuration.h" #include "OPM.h" @@ -835,7 +839,7 @@ void OPC_TDescDecl (OPT_Struct typ) OPC_Str1((CHAR*)", #), {", 8, typ->size); nofptrs = 0; OPC_PutPtrOffsets(typ, 0, &nofptrs); - OPC_Str1((CHAR*)"#}}", 4, -((nofptrs + 1) * (int64)OPM_LIntSize)); + OPC_Str1((CHAR*)"#}}", 4, -((nofptrs + 1) * (int64)OPM_PointerSize)); OPC_EndStat(); } @@ -918,12 +922,20 @@ static void OPC_FillGap (int64 gap, int64 off, int64 align, int64 *n, int64 *cur if ((*curAlign < align && gap - (adr - off) >= align)) { gap -= (adr - off) + align; OPC_BegStat(); - if (align == (int64)OPM_IntSize) { - OPM_WriteString((CHAR*)"INTEGER", 8); - } else if (align == (int64)OPM_LIntSize) { - OPM_WriteString((CHAR*)"LONGINT", 8); - } else if (align == (int64)OPM_LRealSize) { - OPM_WriteString((CHAR*)"LONGREAL", 9); + switch (align) { + case 2: + OPM_WriteString((CHAR*)"int16", 6); + break; + case 4: + OPM_WriteString((CHAR*)"int32", 6); + break; + case 8: + OPM_WriteString((CHAR*)"int64", 6); + break; + default: + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Unexpected enclosing alignment in FillGap.", 43); + break; } OPC_Str1((CHAR*)" _prvt#", 8, *n); *n += 1; @@ -1211,7 +1223,8 @@ void OPC_GenHdr (OPT_Node n) OPM_WriteLn(); OPC_CProcDefs(OPT_topScope->right, 1); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#endif", 7); + OPM_WriteString((CHAR*)"#endif // ", 11); + OPM_WriteStringVar((void*)OPM_modName, 32); OPM_WriteLn(); } @@ -1298,10 +1311,6 @@ void OPC_GenHdrIncludes (void) OPM_WriteString((CHAR*)"__h", 4); OPM_WriteLn(); OPM_WriteLn(); - if (OPM_LIntSize == 8) { - OPM_WriteString((CHAR*)"#define LARGE", 14); - OPM_WriteLn(); - } OPC_Include((CHAR*)"SYSTEM", 7); OPC_IncludeImports(OPT_topScope->right, 1); OPM_WriteLn(); @@ -1311,10 +1320,17 @@ void OPC_GenBdy (OPT_Node n) { OPM_currFile = 1; OPC_GenHeaderMsg(); - if (OPM_LIntSize == 8) { - OPM_WriteString((CHAR*)"#define LARGE", 14); - OPM_WriteLn(); - } + OPM_WriteLn(); + OPM_WriteString((CHAR*)"#define INTEGER int", 20); + OPM_WriteInt(__ASHL(OPT_inttyp->size, 3)); + OPM_WriteLn(); + OPM_WriteString((CHAR*)"#define LONGINT int", 20); + OPM_WriteInt(__ASHL(OPT_linttyp->size, 3)); + OPM_WriteLn(); + OPM_WriteString((CHAR*)"#define SET uint", 21); + OPM_WriteInt(__ASHL(OPT_settyp->size, 3)); + OPM_WriteLn(); + OPM_WriteLn(); OPC_Include((CHAR*)"SYSTEM", 7); OPC_IncludeImports(OPT_topScope->right, 0); OPM_WriteLn(); diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index ac5c7677..a218490a 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h -#define LARGE #include "SYSTEM.h" #include "OPT.h" @@ -49,4 +48,4 @@ import void OPC_TypeOf (OPT_Object ap); import void *OPC__init(void); -#endif +#endif // OPC diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index f410e6d3..389fda93 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index cc77f079..51042a0e 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h -#define LARGE #include "SYSTEM.h" @@ -63,4 +62,4 @@ import void OPM_err (int32 n); import void *OPM__init(void); -#endif +#endif // OPM diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index 6c3c14fe..9ab86b22 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" #include "OPB.h" #include "OPM.h" diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index 9aba4ad7..ce85af11 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h -#define LARGE #include "SYSTEM.h" #include "OPT.h" @@ -14,4 +13,4 @@ import void OPP_Module (OPT_Node *prog, SET opt); import void *OPP__init(void); -#endif +#endif // OPP diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index e0988fb0..8e53d027 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index 1601514e..ffbc5084 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h -#define LARGE #include "SYSTEM.h" typedef @@ -26,4 +25,4 @@ import void OPS_Init (void); import void *OPS__init(void); -#endif +#endif // OPS diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index c08c86af..bd27c789 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index f50911dd..583c31ff 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h -#define LARGE #include "SYSTEM.h" #include "OPS.h" @@ -104,4 +103,4 @@ import OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int32 dir); import void *OPT__init(void); -#endif +#endif // OPT diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index b8c77e55..2d81dd31 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" #include "OPC.h" #include "OPM.h" @@ -17,7 +21,6 @@ static int32 OPV_stamp; static int64 OPV_recno; static OPV_ExitInfo OPV_exit; static int32 OPV_nofExitLabels; -static BOOLEAN OPV_naturalAlignment; export LONGINT *OPV_ExitInfo__typ; @@ -35,7 +38,6 @@ export void OPV_Init (void); static void OPV_InitTDescs (OPT_Node n); static void OPV_Len (OPT_Node n, int64 dim); export void OPV_Module (OPT_Node prog); -static int64 OPV_NaturalAlignment (int64 size, int64 max); static void OPV_NewArr (OPT_Node d, OPT_Node x); static void OPV_ParIntLiteral (int64 n, int64 size); static int32 OPV_Precedence (int32 class, int32 subclass, int32 form, int32 comp); @@ -52,24 +54,6 @@ static void OPV_expr (OPT_Node n, int32 prec); static void OPV_stat (OPT_Node n, OPT_Object outerProc); -static int64 OPV_NaturalAlignment (int64 size, int64 max) -{ - int64 _o_result; - int64 i; - if (size >= max) { - _o_result = max; - return _o_result; - } else { - i = 1; - while (i < size) { - i += i; - } - _o_result = i; - return _o_result; - } - __RETCHK; -} - void OPV_TypSize (OPT_Struct typ) { int32 f, c; @@ -109,9 +93,6 @@ void OPV_TypSize (OPT_Struct typ) if (offset == 0) { offset = 1; } - if (OPM_RecSize == 0) { - base = OPV_NaturalAlignment(offset, OPC_SizeAlignment(OPM_RecSize)); - } OPC_Align(&offset, base); if ((typ->strobj == NIL && __MASK(typ->align, -65536) == 0)) { OPV_recno += 1; @@ -569,7 +550,7 @@ static void OPV_design (OPT_Node n, int32 prec) OPT_Struct typ = NIL; int32 class, designPrec, comp; OPT_Node d = NIL, x = NIL; - int32 dims, i, _for__28; + int32 dims, i, _for__27; comp = n->typ->comp; obj = n->obj; class = n->class; @@ -645,9 +626,9 @@ static void OPV_design (OPT_Node n, int32 prec) } x = x->left; } - _for__28 = dims; + _for__27 = dims; i = 1; - while (i <= _for__28) { + while (i <= _for__27) { OPM_Write(')'); i += 1; } diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index 92c13a0a..b10704dc 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h -#define LARGE #include "SYSTEM.h" #include "OPT.h" @@ -17,4 +16,4 @@ import void OPV_TypSize (OPT_Struct typ); import void *OPV__init(void); -#endif +#endif // OPV diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 0aab8de3..70c9bcb7 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" typedef @@ -729,7 +733,6 @@ static void Platform_DisplayHaltCode (int64 code) void Platform_Halt (int64 code) { - int32 e; Platform_HaltCode = code; if (Platform_HaltHandler != NIL) { (*Platform_HaltHandler)(code); @@ -746,7 +749,6 @@ void Platform_Halt (int64 code) void Platform_AssertFail (int64 code) { - int32 e; Platform_errstring((CHAR*)"Assertion failure.", 19); if (code != 0) { Platform_errstring((CHAR*)" ASSERT code ", 14); diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index 324566bf..1ffe3227 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h -#define LARGE #include "SYSTEM.h" typedef @@ -81,4 +80,4 @@ import BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT import void *Platform__init(void); -#endif +#endif // Platform diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 80ca4829..0b5761ee 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index da0c1f86..dfc56cef 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h -#define LARGE #include "SYSTEM.h" @@ -21,4 +20,4 @@ import LONGREAL Reals_TenL (int32 e); import void *Reals__init(void); -#endif +#endif // Reals diff --git a/bootstrap/unix-88/SYSTEM.h b/bootstrap/unix-88/SYSTEM.h index 8c6c335e..6fc57309 100644 --- a/bootstrap/unix-88/SYSTEM.h +++ b/bootstrap/unix-88/SYSTEM.h @@ -1,6 +1,24 @@ #ifndef SYSTEM__h #define SYSTEM__h + + +#ifndef LONGINT + #if (__SIZEOF_POINTER__ == 8) || defined(_WIN64) + #define INTEGER int32 + #define LONGINT int64 + #define SET uint64 + #else + #define INTEGER int16 + #define LONGINT int32 + #define SET uint32 + #endif +#endif + + + + + // Declare memcpy in a way compatible with C compilers intrinsic // built in implementations. @@ -22,10 +40,12 @@ void *memcpy(void *dest, const void *source, size_t size); // Declare fixed size versions of basic intger types -#if defined(_WIN64) +#if (__SIZEOF_POINTER__ < 8) || defined(_WIN64) + // ILP32 or LLP64 typedef long long int64; typedef unsigned long long uint64; #else + // LP64 typedef long int64; typedef unsigned long uint64; #endif @@ -67,29 +87,10 @@ typedef float REAL; typedef double LONGREAL; typedef void* SYSTEM_PTR; +#define uSET SET -// For 32 bit builds, the size of LONGINT depends on a make option: - -#if (__SIZEOF_POINTER__ == 8) || defined(LARGE) || defined(_WIN64) - typedef int32 INTEGER; - typedef int64 LONGINT; - typedef uint64 SET; - typedef uint64 uSET; -#else - typedef int16 INTEGER; - typedef int32 LONGINT; - typedef uint32 SET; - typedef uint32 uSET; -#endif - - -// Temporary defs while bootstrapping - -#define uLONGINT uint64 - - // ---------------------------------------------------------------------- // ---------------------------------------------------------------------- diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index f240e3b4..39f247ba 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index 88b212f1..2c6a801d 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h -#define LARGE #include "SYSTEM.h" @@ -21,4 +20,4 @@ import void Strings_Replace (CHAR *source, LONGINT source__len, int32 pos, CHAR import void *Strings__init(void); -#endif +#endif // Strings diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index 59d184b4..a78b77bb 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" #include "Files.h" #include "Modules.h" diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index d779d5d5..7156eb22 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h -#define LARGE #include "SYSTEM.h" #include "Files.h" @@ -31,7 +30,7 @@ typedef typedef struct Texts_RunDesc { - LONGINT _prvt0; + int64 _prvt0; char _prvt1[27]; } Texts_RunDesc; @@ -170,4 +169,4 @@ import void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGIN import void *Texts__init(void); -#endif +#endif // Texts diff --git a/bootstrap/unix-88/Vishap.c b/bootstrap/unix-88/Vishap.c index 7a2484a5..46a95ea9 100644 --- a/bootstrap/unix-88/Vishap.c +++ b/bootstrap/unix-88/Vishap.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkamSf */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkamSf */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" #include "Configuration.h" #include "Heap.h" diff --git a/bootstrap/unix-88/errors.c b/bootstrap/unix-88/errors.c index 1d7e852f..9c9ed747 100644 --- a/bootstrap/unix-88/errors.c +++ b/bootstrap/unix-88/errors.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" typedef diff --git a/bootstrap/unix-88/errors.h b/bootstrap/unix-88/errors.h index f917a7b6..bf0e9564 100644 --- a/bootstrap/unix-88/errors.h +++ b/bootstrap/unix-88/errors.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h -#define LARGE #include "SYSTEM.h" typedef @@ -16,4 +15,4 @@ import errors_string errors_errors[350]; import void *errors__init(void); -#endif +#endif // errors diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index d656f5be..c3dc490a 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index 1f0bb8e7..c5d5c772 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h -#define LARGE #include "SYSTEM.h" @@ -14,4 +13,4 @@ import void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEA import void *extTools__init(void); -#endif +#endif // extTools diff --git a/bootstrap/unix-88/vt100.c b/bootstrap/unix-88/vt100.c index 22698256..fac0e0ba 100644 --- a/bootstrap/unix-88/vt100.c +++ b/bootstrap/unix-88/vt100.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" #include "Console.h" #include "Strings.h" diff --git a/bootstrap/unix-88/vt100.h b/bootstrap/unix-88/vt100.h index f6c994fa..c2ebcd84 100644 --- a/bootstrap/unix-88/vt100.h +++ b/bootstrap/unix-88/vt100.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h -#define LARGE #include "SYSTEM.h" @@ -35,4 +34,4 @@ import void vt100_SetAttr (CHAR *attr, LONGINT attr__len); import void *vt100__init(void); -#endif +#endif // vt100 diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index 560d018b..115f8dec 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" @@ -13,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/04] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/06] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index ac266eec..84e8427b 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h @@ -12,4 +12,4 @@ import CHAR Configuration_versionLong[41]; import void *Configuration__init(void); -#endif +#endif // Configuration diff --git a/bootstrap/windows-48/Console.c b/bootstrap/windows-48/Console.c index 5b34dfb9..0b87cb07 100644 --- a/bootstrap/windows-48/Console.c +++ b/bootstrap/windows-48/Console.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "Platform.h" diff --git a/bootstrap/windows-48/Console.h b/bootstrap/windows-48/Console.h index fd32774b..e9913d2d 100644 --- a/bootstrap/windows-48/Console.h +++ b/bootstrap/windows-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h @@ -20,4 +20,4 @@ import void Console_String (CHAR *s, LONGINT s__len); import void *Console__init(void); -#endif +#endif // Console diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 0957fcfb..930aa8c9 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index 01dff049..55b2a130 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h @@ -67,4 +67,4 @@ import void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT import void *Files__init(void); -#endif +#endif // Files diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index 02e6f1cb..2bbe63b2 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tskSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" struct Heap__1 { diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index ca1d8e95..6694ef70 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h @@ -22,7 +22,7 @@ typedef typedef struct Heap_ModuleDesc { - LONGINT _prvt0; + int32 _prvt0; char _prvt1[44]; } Heap_ModuleDesc; @@ -51,4 +51,4 @@ import void Heap_Unlock (void); import void *Heap__init(void); -#endif +#endif // Heap diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index fab3561e..e31876fb 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "Console.h" #include "Heap.h" diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index 13abd6d0..4bd4082d 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h @@ -51,4 +51,4 @@ import void *Modules__init(void); #define Modules_modules() (Modules_Module)Heap_modules #define Modules_setmodules(m) Heap_modules = m -#endif +#endif // Modules diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index 1d0b8774..0a1a9f63 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" @@ -1912,7 +1917,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (f == 4) { - if (x->typ->size != OPM_LIntSize) { + if (x->typ->size != OPT_linttyp->size) { OPB_Convert(&x, OPT_linttyp); } } else { diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index 465ba585..5ffa3869 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h @@ -46,4 +46,4 @@ import void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard); import void *OPB__init(void); -#endif +#endif // OPB diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index b702852c..5666c7cd 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "Configuration.h" #include "OPM.h" @@ -834,7 +839,7 @@ void OPC_TDescDecl (OPT_Struct typ) OPC_Str1((CHAR*)", #), {", 8, typ->size); nofptrs = 0; OPC_PutPtrOffsets(typ, 0, &nofptrs); - OPC_Str1((CHAR*)"#}}", 4, -((nofptrs + 1) * OPM_LIntSize)); + OPC_Str1((CHAR*)"#}}", 4, -((nofptrs + 1) * OPM_PointerSize)); OPC_EndStat(); } @@ -917,12 +922,20 @@ static void OPC_FillGap (int32 gap, int32 off, int32 align, int32 *n, int32 *cur if ((*curAlign < align && gap - (adr - off) >= align)) { gap -= (adr - off) + align; OPC_BegStat(); - if (align == OPM_IntSize) { - OPM_WriteString((CHAR*)"INTEGER", 8); - } else if (align == OPM_LIntSize) { - OPM_WriteString((CHAR*)"LONGINT", 8); - } else if (align == OPM_LRealSize) { - OPM_WriteString((CHAR*)"LONGREAL", 9); + switch (align) { + case 2: + OPM_WriteString((CHAR*)"int16", 6); + break; + case 4: + OPM_WriteString((CHAR*)"int32", 6); + break; + case 8: + OPM_WriteString((CHAR*)"int64", 6); + break; + default: + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Unexpected enclosing alignment in FillGap.", 43); + break; } OPC_Str1((CHAR*)" _prvt#", 8, *n); *n += 1; @@ -1210,7 +1223,8 @@ void OPC_GenHdr (OPT_Node n) OPM_WriteLn(); OPC_CProcDefs(OPT_topScope->right, 1); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#endif", 7); + OPM_WriteString((CHAR*)"#endif // ", 11); + OPM_WriteStringVar((void*)OPM_modName, 32); OPM_WriteLn(); } @@ -1297,10 +1311,6 @@ void OPC_GenHdrIncludes (void) OPM_WriteString((CHAR*)"__h", 4); OPM_WriteLn(); OPM_WriteLn(); - if (OPM_LIntSize == 8) { - OPM_WriteString((CHAR*)"#define LARGE", 14); - OPM_WriteLn(); - } OPC_Include((CHAR*)"SYSTEM", 7); OPC_IncludeImports(OPT_topScope->right, 1); OPM_WriteLn(); @@ -1310,10 +1320,17 @@ void OPC_GenBdy (OPT_Node n) { OPM_currFile = 1; OPC_GenHeaderMsg(); - if (OPM_LIntSize == 8) { - OPM_WriteString((CHAR*)"#define LARGE", 14); - OPM_WriteLn(); - } + OPM_WriteLn(); + OPM_WriteString((CHAR*)"#define INTEGER int", 20); + OPM_WriteInt(__ASHL(OPT_inttyp->size, 3)); + OPM_WriteLn(); + OPM_WriteString((CHAR*)"#define LONGINT int", 20); + OPM_WriteInt(__ASHL(OPT_linttyp->size, 3)); + OPM_WriteLn(); + OPM_WriteString((CHAR*)"#define SET uint", 21); + OPM_WriteInt(__ASHL(OPT_settyp->size, 3)); + OPM_WriteLn(); + OPM_WriteLn(); OPC_Include((CHAR*)"SYSTEM", 7); OPC_IncludeImports(OPT_topScope->right, 0); OPM_WriteLn(); diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index 2839fb0f..e1fc08ec 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h @@ -48,4 +48,4 @@ import void OPC_TypeOf (OPT_Object ap); import void *OPC__init(void); -#endif +#endif // OPC diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 70121d63..461b5b85 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index fce4bdd3..c60f6f98 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h @@ -62,4 +62,4 @@ import void OPM_err (int16 n); import void *OPM__init(void); -#endif +#endif // OPM diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index dc286221..1ab60658 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "OPB.h" #include "OPM.h" diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index e79b5819..ce85af11 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h @@ -13,4 +13,4 @@ import void OPP_Module (OPT_Node *prog, SET opt); import void *OPP__init(void); -#endif +#endif // OPP diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index b90cb34b..3a1c4787 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index 347c669a..512cfa75 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h @@ -25,4 +25,4 @@ import void OPS_Init (void); import void *OPS__init(void); -#endif +#endif // OPS diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index ccfba447..1983daf5 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index ce146e6f..d3b24cc6 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h @@ -103,4 +103,4 @@ import OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir); import void *OPT__init(void); -#endif +#endif // OPT diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index da9a8429..a62894dd 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "OPC.h" #include "OPM.h" @@ -16,7 +21,6 @@ static int16 OPV_stamp; static int32 OPV_recno; static OPV_ExitInfo OPV_exit; static int16 OPV_nofExitLabels; -static BOOLEAN OPV_naturalAlignment; export LONGINT *OPV_ExitInfo__typ; @@ -34,7 +38,6 @@ export void OPV_Init (void); static void OPV_InitTDescs (OPT_Node n); static void OPV_Len (OPT_Node n, int32 dim); export void OPV_Module (OPT_Node prog); -static int32 OPV_NaturalAlignment (int32 size, int32 max); static void OPV_NewArr (OPT_Node d, OPT_Node x); static void OPV_ParIntLiteral (int32 n, int32 size); static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp); @@ -51,24 +54,6 @@ static void OPV_expr (OPT_Node n, int16 prec); static void OPV_stat (OPT_Node n, OPT_Object outerProc); -static int32 OPV_NaturalAlignment (int32 size, int32 max) -{ - int32 _o_result; - int32 i; - if (size >= max) { - _o_result = max; - return _o_result; - } else { - i = 1; - while (i < size) { - i += i; - } - _o_result = i; - return _o_result; - } - __RETCHK; -} - void OPV_TypSize (OPT_Struct typ) { int16 f, c; @@ -108,9 +93,6 @@ void OPV_TypSize (OPT_Struct typ) if (offset == 0) { offset = 1; } - if (OPM_RecSize == 0) { - base = OPV_NaturalAlignment(offset, OPC_SizeAlignment(OPM_RecSize)); - } OPC_Align(&offset, base); if ((typ->strobj == NIL && __MASK(typ->align, -65536) == 0)) { OPV_recno += 1; @@ -568,7 +550,7 @@ static void OPV_design (OPT_Node n, int16 prec) OPT_Struct typ = NIL; int16 class, designPrec, comp; OPT_Node d = NIL, x = NIL; - int16 dims, i, _for__28; + int16 dims, i, _for__27; comp = n->typ->comp; obj = n->obj; class = n->class; @@ -644,9 +626,9 @@ static void OPV_design (OPT_Node n, int16 prec) } x = x->left; } - _for__28 = dims; + _for__27 = dims; i = 1; - while (i <= _for__28) { + while (i <= _for__27) { OPM_Write(')'); i += 1; } diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index 600b19bd..b10704dc 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h @@ -16,4 +16,4 @@ import void OPV_TypSize (OPT_Struct typ); import void *OPV__init(void); -#endif +#endif // OPV diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 62a367e1..bdf72323 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" typedef @@ -774,7 +779,6 @@ static void Platform_DisplayHaltCode (int32 code) void Platform_Halt (int32 code) { - int16 e; Platform_HaltCode = code; if (Platform_HaltHandler != NIL) { (*Platform_HaltHandler)(code); @@ -791,7 +795,6 @@ void Platform_Halt (int32 code) void Platform_AssertFail (int32 code) { - int16 e; Platform_errstring((CHAR*)"Assertion failure.", 19); if (code != 0) { Platform_errstring((CHAR*)" ASSERT code ", 14); diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index 0b6a48d8..d1466be1 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h @@ -7,7 +7,7 @@ typedef struct Platform_FileIdentity { - LONGINT _prvt0; + int32 _prvt0; char _prvt1[16]; } Platform_FileIdentity; @@ -82,4 +82,4 @@ import void *Platform__init(void); #define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((address)h) #define Platform_SetQuitHandler(h) SystemSetQuitHandler((address)h) -#endif +#endif // Platform diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 8fe37010..5f3d11a5 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index 9ebc1c17..cf931556 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h @@ -20,4 +20,4 @@ import LONGREAL Reals_TenL (int16 e); import void *Reals__init(void); -#endif +#endif // Reals diff --git a/bootstrap/windows-48/SYSTEM.h b/bootstrap/windows-48/SYSTEM.h index 8c6c335e..6fc57309 100644 --- a/bootstrap/windows-48/SYSTEM.h +++ b/bootstrap/windows-48/SYSTEM.h @@ -1,6 +1,24 @@ #ifndef SYSTEM__h #define SYSTEM__h + + +#ifndef LONGINT + #if (__SIZEOF_POINTER__ == 8) || defined(_WIN64) + #define INTEGER int32 + #define LONGINT int64 + #define SET uint64 + #else + #define INTEGER int16 + #define LONGINT int32 + #define SET uint32 + #endif +#endif + + + + + // Declare memcpy in a way compatible with C compilers intrinsic // built in implementations. @@ -22,10 +40,12 @@ void *memcpy(void *dest, const void *source, size_t size); // Declare fixed size versions of basic intger types -#if defined(_WIN64) +#if (__SIZEOF_POINTER__ < 8) || defined(_WIN64) + // ILP32 or LLP64 typedef long long int64; typedef unsigned long long uint64; #else + // LP64 typedef long int64; typedef unsigned long uint64; #endif @@ -67,29 +87,10 @@ typedef float REAL; typedef double LONGREAL; typedef void* SYSTEM_PTR; +#define uSET SET -// For 32 bit builds, the size of LONGINT depends on a make option: - -#if (__SIZEOF_POINTER__ == 8) || defined(LARGE) || defined(_WIN64) - typedef int32 INTEGER; - typedef int64 LONGINT; - typedef uint64 SET; - typedef uint64 uSET; -#else - typedef int16 INTEGER; - typedef int32 LONGINT; - typedef uint32 SET; - typedef uint32 uSET; -#endif - - -// Temporary defs while bootstrapping - -#define uLONGINT uint64 - - // ---------------------------------------------------------------------- // ---------------------------------------------------------------------- diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index a642190c..7e1a6845 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index f537406e..59076121 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h @@ -20,4 +20,4 @@ import void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR import void *Strings__init(void); -#endif +#endif // Strings diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index b218c1b0..a4267893 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "Files.h" #include "Modules.h" diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index 3174aa9b..2238689d 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h @@ -30,7 +30,7 @@ typedef typedef struct Texts_RunDesc { - LONGINT _prvt0; + int32 _prvt0; char _prvt1[15]; } Texts_RunDesc; @@ -86,7 +86,7 @@ typedef Texts_FontsFont fnt; int8 col, voff; Texts_Elem elem; - LONGREAL _prvt0; + int64 _prvt0; char _prvt1[24]; CHAR nextCh; int16 line, class; @@ -170,4 +170,4 @@ import void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGIN import void *Texts__init(void); -#endif +#endif // Texts diff --git a/bootstrap/windows-48/Vishap.c b/bootstrap/windows-48/Vishap.c index 81b2d70f..549268e2 100644 --- a/bootstrap/windows-48/Vishap.c +++ b/bootstrap/windows-48/Vishap.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkamSf */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "Configuration.h" #include "Heap.h" diff --git a/bootstrap/windows-48/errors.c b/bootstrap/windows-48/errors.c index a5576d43..a2f7cf75 100644 --- a/bootstrap/windows-48/errors.c +++ b/bootstrap/windows-48/errors.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" typedef diff --git a/bootstrap/windows-48/errors.h b/bootstrap/windows-48/errors.h index 696219d4..bf0e9564 100644 --- a/bootstrap/windows-48/errors.h +++ b/bootstrap/windows-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h @@ -15,4 +15,4 @@ import errors_string errors_errors[350]; import void *errors__init(void); -#endif +#endif // errors diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index 553a3d7d..27ef9f8f 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index ba9937e8..c5d5c772 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h @@ -13,4 +13,4 @@ import void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEA import void *extTools__init(void); -#endif +#endif // extTools diff --git a/bootstrap/windows-48/vt100.c b/bootstrap/windows-48/vt100.c index ab305ed1..912e5e83 100644 --- a/bootstrap/windows-48/vt100.c +++ b/bootstrap/windows-48/vt100.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "Console.h" #include "Strings.h" diff --git a/bootstrap/windows-48/vt100.h b/bootstrap/windows-48/vt100.h index 71079dc0..36c0bc7e 100644 --- a/bootstrap/windows-48/vt100.h +++ b/bootstrap/windows-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h @@ -34,4 +34,4 @@ import void vt100_SetAttr (CHAR *attr, LONGINT attr__len); import void *vt100__init(void); -#endif +#endif // vt100 diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index c0502177..cfce02b8 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" @@ -14,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/04] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/06] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index 73002e87..84e8427b 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h -#define LARGE #include "SYSTEM.h" @@ -13,4 +12,4 @@ import CHAR Configuration_versionLong[41]; import void *Configuration__init(void); -#endif +#endif // Configuration diff --git a/bootstrap/windows-88/Console.c b/bootstrap/windows-88/Console.c index 83c649cf..c9058a13 100644 --- a/bootstrap/windows-88/Console.c +++ b/bootstrap/windows-88/Console.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" #include "Platform.h" diff --git a/bootstrap/windows-88/Console.h b/bootstrap/windows-88/Console.h index bcf5714f..1f1182fd 100644 --- a/bootstrap/windows-88/Console.h +++ b/bootstrap/windows-88/Console.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h -#define LARGE #include "SYSTEM.h" @@ -21,4 +20,4 @@ import void Console_String (CHAR *s, LONGINT s__len); import void *Console__init(void); -#endif +#endif // Console diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 1f5e58a0..61842215 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 65de586e..2c581e47 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h -#define LARGE #include "SYSTEM.h" typedef @@ -68,4 +67,4 @@ import void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT import void *Files__init(void); -#endif +#endif // Files diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index b5749b04..1fe3ce13 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tskSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tskSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" struct Heap__1 { diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index b547af41..def46dcf 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h -#define LARGE #include "SYSTEM.h" typedef @@ -23,7 +22,7 @@ typedef typedef struct Heap_ModuleDesc { - LONGINT _prvt0; + int64 _prvt0; char _prvt1[72]; } Heap_ModuleDesc; @@ -52,4 +51,4 @@ import void Heap_Unlock (void); import void *Heap__init(void); -#endif +#endif // Heap diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index bce66b2e..9d93e3d2 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" #include "Console.h" #include "Heap.h" diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index 544820fd..f9e49aa7 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h -#define LARGE #include "SYSTEM.h" typedef @@ -52,4 +51,4 @@ import void *Modules__init(void); #define Modules_modules() (Modules_Module)Heap_modules #define Modules_setmodules(m) Heap_modules = m -#endif +#endif // Modules diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index 1414fc79..11b9a1a9 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" @@ -1913,7 +1917,7 @@ void OPB_StPar0 (OPT_Node *par0, int32 fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (f == 4) { - if (x->typ->size != (int64)OPM_LIntSize) { + if (x->typ->size != OPT_linttyp->size) { OPB_Convert(&x, OPT_linttyp); } } else { diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index 718d88bb..c3c5c1e8 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h -#define LARGE #include "SYSTEM.h" #include "OPS.h" #include "OPT.h" @@ -47,4 +46,4 @@ import void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard); import void *OPB__init(void); -#endif +#endif // OPB diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index fad896b9..e971762c 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" #include "Configuration.h" #include "OPM.h" @@ -835,7 +839,7 @@ void OPC_TDescDecl (OPT_Struct typ) OPC_Str1((CHAR*)", #), {", 8, typ->size); nofptrs = 0; OPC_PutPtrOffsets(typ, 0, &nofptrs); - OPC_Str1((CHAR*)"#}}", 4, -((nofptrs + 1) * (int64)OPM_LIntSize)); + OPC_Str1((CHAR*)"#}}", 4, -((nofptrs + 1) * (int64)OPM_PointerSize)); OPC_EndStat(); } @@ -918,12 +922,20 @@ static void OPC_FillGap (int64 gap, int64 off, int64 align, int64 *n, int64 *cur if ((*curAlign < align && gap - (adr - off) >= align)) { gap -= (adr - off) + align; OPC_BegStat(); - if (align == (int64)OPM_IntSize) { - OPM_WriteString((CHAR*)"INTEGER", 8); - } else if (align == (int64)OPM_LIntSize) { - OPM_WriteString((CHAR*)"LONGINT", 8); - } else if (align == (int64)OPM_LRealSize) { - OPM_WriteString((CHAR*)"LONGREAL", 9); + switch (align) { + case 2: + OPM_WriteString((CHAR*)"int16", 6); + break; + case 4: + OPM_WriteString((CHAR*)"int32", 6); + break; + case 8: + OPM_WriteString((CHAR*)"int64", 6); + break; + default: + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Unexpected enclosing alignment in FillGap.", 43); + break; } OPC_Str1((CHAR*)" _prvt#", 8, *n); *n += 1; @@ -1211,7 +1223,8 @@ void OPC_GenHdr (OPT_Node n) OPM_WriteLn(); OPC_CProcDefs(OPT_topScope->right, 1); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#endif", 7); + OPM_WriteString((CHAR*)"#endif // ", 11); + OPM_WriteStringVar((void*)OPM_modName, 32); OPM_WriteLn(); } @@ -1298,10 +1311,6 @@ void OPC_GenHdrIncludes (void) OPM_WriteString((CHAR*)"__h", 4); OPM_WriteLn(); OPM_WriteLn(); - if (OPM_LIntSize == 8) { - OPM_WriteString((CHAR*)"#define LARGE", 14); - OPM_WriteLn(); - } OPC_Include((CHAR*)"SYSTEM", 7); OPC_IncludeImports(OPT_topScope->right, 1); OPM_WriteLn(); @@ -1311,10 +1320,17 @@ void OPC_GenBdy (OPT_Node n) { OPM_currFile = 1; OPC_GenHeaderMsg(); - if (OPM_LIntSize == 8) { - OPM_WriteString((CHAR*)"#define LARGE", 14); - OPM_WriteLn(); - } + OPM_WriteLn(); + OPM_WriteString((CHAR*)"#define INTEGER int", 20); + OPM_WriteInt(__ASHL(OPT_inttyp->size, 3)); + OPM_WriteLn(); + OPM_WriteString((CHAR*)"#define LONGINT int", 20); + OPM_WriteInt(__ASHL(OPT_linttyp->size, 3)); + OPM_WriteLn(); + OPM_WriteString((CHAR*)"#define SET uint", 21); + OPM_WriteInt(__ASHL(OPT_settyp->size, 3)); + OPM_WriteLn(); + OPM_WriteLn(); OPC_Include((CHAR*)"SYSTEM", 7); OPC_IncludeImports(OPT_topScope->right, 0); OPM_WriteLn(); diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index ac5c7677..a218490a 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h -#define LARGE #include "SYSTEM.h" #include "OPT.h" @@ -49,4 +48,4 @@ import void OPC_TypeOf (OPT_Object ap); import void *OPC__init(void); -#endif +#endif // OPC diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index f410e6d3..389fda93 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index cc77f079..51042a0e 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h -#define LARGE #include "SYSTEM.h" @@ -63,4 +62,4 @@ import void OPM_err (int32 n); import void *OPM__init(void); -#endif +#endif // OPM diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index 6c3c14fe..9ab86b22 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" #include "OPB.h" #include "OPM.h" diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index 9aba4ad7..ce85af11 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h -#define LARGE #include "SYSTEM.h" #include "OPT.h" @@ -14,4 +13,4 @@ import void OPP_Module (OPT_Node *prog, SET opt); import void *OPP__init(void); -#endif +#endif // OPP diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index e0988fb0..8e53d027 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index 1601514e..ffbc5084 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h -#define LARGE #include "SYSTEM.h" typedef @@ -26,4 +25,4 @@ import void OPS_Init (void); import void *OPS__init(void); -#endif +#endif // OPS diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index c08c86af..bd27c789 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index f50911dd..583c31ff 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h -#define LARGE #include "SYSTEM.h" #include "OPS.h" @@ -104,4 +103,4 @@ import OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int32 dir); import void *OPT__init(void); -#endif +#endif // OPT diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index b8c77e55..2d81dd31 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" #include "OPC.h" #include "OPM.h" @@ -17,7 +21,6 @@ static int32 OPV_stamp; static int64 OPV_recno; static OPV_ExitInfo OPV_exit; static int32 OPV_nofExitLabels; -static BOOLEAN OPV_naturalAlignment; export LONGINT *OPV_ExitInfo__typ; @@ -35,7 +38,6 @@ export void OPV_Init (void); static void OPV_InitTDescs (OPT_Node n); static void OPV_Len (OPT_Node n, int64 dim); export void OPV_Module (OPT_Node prog); -static int64 OPV_NaturalAlignment (int64 size, int64 max); static void OPV_NewArr (OPT_Node d, OPT_Node x); static void OPV_ParIntLiteral (int64 n, int64 size); static int32 OPV_Precedence (int32 class, int32 subclass, int32 form, int32 comp); @@ -52,24 +54,6 @@ static void OPV_expr (OPT_Node n, int32 prec); static void OPV_stat (OPT_Node n, OPT_Object outerProc); -static int64 OPV_NaturalAlignment (int64 size, int64 max) -{ - int64 _o_result; - int64 i; - if (size >= max) { - _o_result = max; - return _o_result; - } else { - i = 1; - while (i < size) { - i += i; - } - _o_result = i; - return _o_result; - } - __RETCHK; -} - void OPV_TypSize (OPT_Struct typ) { int32 f, c; @@ -109,9 +93,6 @@ void OPV_TypSize (OPT_Struct typ) if (offset == 0) { offset = 1; } - if (OPM_RecSize == 0) { - base = OPV_NaturalAlignment(offset, OPC_SizeAlignment(OPM_RecSize)); - } OPC_Align(&offset, base); if ((typ->strobj == NIL && __MASK(typ->align, -65536) == 0)) { OPV_recno += 1; @@ -569,7 +550,7 @@ static void OPV_design (OPT_Node n, int32 prec) OPT_Struct typ = NIL; int32 class, designPrec, comp; OPT_Node d = NIL, x = NIL; - int32 dims, i, _for__28; + int32 dims, i, _for__27; comp = n->typ->comp; obj = n->obj; class = n->class; @@ -645,9 +626,9 @@ static void OPV_design (OPT_Node n, int32 prec) } x = x->left; } - _for__28 = dims; + _for__27 = dims; i = 1; - while (i <= _for__28) { + while (i <= _for__27) { OPM_Write(')'); i += 1; } diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index 92c13a0a..b10704dc 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h -#define LARGE #include "SYSTEM.h" #include "OPT.h" @@ -17,4 +16,4 @@ import void OPV_TypSize (OPT_Struct typ); import void *OPV__init(void); -#endif +#endif // OPV diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 0f3aae72..dda7a46a 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" typedef @@ -775,7 +779,6 @@ static void Platform_DisplayHaltCode (int64 code) void Platform_Halt (int64 code) { - int32 e; Platform_HaltCode = code; if (Platform_HaltHandler != NIL) { (*Platform_HaltHandler)(code); @@ -792,7 +795,6 @@ void Platform_Halt (int64 code) void Platform_AssertFail (int64 code) { - int32 e; Platform_errstring((CHAR*)"Assertion failure.", 19); if (code != 0) { Platform_errstring((CHAR*)" ASSERT code ", 14); diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index 0d17921c..472cf2f1 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,14 +1,13 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h -#define LARGE #include "SYSTEM.h" typedef struct Platform_FileIdentity { - LONGINT _prvt0; + int64 _prvt0; char _prvt1[32]; } Platform_FileIdentity; @@ -83,4 +82,4 @@ import void *Platform__init(void); #define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((address)h) #define Platform_SetQuitHandler(h) SystemSetQuitHandler((address)h) -#endif +#endif // Platform diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 80ca4829..0b5761ee 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index da0c1f86..dfc56cef 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h -#define LARGE #include "SYSTEM.h" @@ -21,4 +20,4 @@ import LONGREAL Reals_TenL (int32 e); import void *Reals__init(void); -#endif +#endif // Reals diff --git a/bootstrap/windows-88/SYSTEM.h b/bootstrap/windows-88/SYSTEM.h index 8c6c335e..6fc57309 100644 --- a/bootstrap/windows-88/SYSTEM.h +++ b/bootstrap/windows-88/SYSTEM.h @@ -1,6 +1,24 @@ #ifndef SYSTEM__h #define SYSTEM__h + + +#ifndef LONGINT + #if (__SIZEOF_POINTER__ == 8) || defined(_WIN64) + #define INTEGER int32 + #define LONGINT int64 + #define SET uint64 + #else + #define INTEGER int16 + #define LONGINT int32 + #define SET uint32 + #endif +#endif + + + + + // Declare memcpy in a way compatible with C compilers intrinsic // built in implementations. @@ -22,10 +40,12 @@ void *memcpy(void *dest, const void *source, size_t size); // Declare fixed size versions of basic intger types -#if defined(_WIN64) +#if (__SIZEOF_POINTER__ < 8) || defined(_WIN64) + // ILP32 or LLP64 typedef long long int64; typedef unsigned long long uint64; #else + // LP64 typedef long int64; typedef unsigned long uint64; #endif @@ -67,29 +87,10 @@ typedef float REAL; typedef double LONGREAL; typedef void* SYSTEM_PTR; +#define uSET SET -// For 32 bit builds, the size of LONGINT depends on a make option: - -#if (__SIZEOF_POINTER__ == 8) || defined(LARGE) || defined(_WIN64) - typedef int32 INTEGER; - typedef int64 LONGINT; - typedef uint64 SET; - typedef uint64 uSET; -#else - typedef int16 INTEGER; - typedef int32 LONGINT; - typedef uint32 SET; - typedef uint32 uSET; -#endif - - -// Temporary defs while bootstrapping - -#define uLONGINT uint64 - - // ---------------------------------------------------------------------- // ---------------------------------------------------------------------- diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index f240e3b4..39f247ba 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index 88b212f1..2c6a801d 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h -#define LARGE #include "SYSTEM.h" @@ -21,4 +20,4 @@ import void Strings_Replace (CHAR *source, LONGINT source__len, int32 pos, CHAR import void *Strings__init(void); -#endif +#endif // Strings diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index 59d184b4..a78b77bb 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" #include "Files.h" #include "Modules.h" diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index d779d5d5..7156eb22 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h -#define LARGE #include "SYSTEM.h" #include "Files.h" @@ -31,7 +30,7 @@ typedef typedef struct Texts_RunDesc { - LONGINT _prvt0; + int64 _prvt0; char _prvt1[27]; } Texts_RunDesc; @@ -170,4 +169,4 @@ import void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGIN import void *Texts__init(void); -#endif +#endif // Texts diff --git a/bootstrap/windows-88/Vishap.c b/bootstrap/windows-88/Vishap.c index 7a2484a5..46a95ea9 100644 --- a/bootstrap/windows-88/Vishap.c +++ b/bootstrap/windows-88/Vishap.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkamSf */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkamSf */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" #include "Configuration.h" #include "Heap.h" diff --git a/bootstrap/windows-88/errors.c b/bootstrap/windows-88/errors.c index 1d7e852f..9c9ed747 100644 --- a/bootstrap/windows-88/errors.c +++ b/bootstrap/windows-88/errors.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" typedef diff --git a/bootstrap/windows-88/errors.h b/bootstrap/windows-88/errors.h index f917a7b6..bf0e9564 100644 --- a/bootstrap/windows-88/errors.h +++ b/bootstrap/windows-88/errors.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h -#define LARGE #include "SYSTEM.h" typedef @@ -16,4 +15,4 @@ import errors_string errors_errors[350]; import void *errors__init(void); -#endif +#endif // errors diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index d656f5be..c3dc490a 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index 1f0bb8e7..c5d5c772 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h -#define LARGE #include "SYSTEM.h" @@ -14,4 +13,4 @@ import void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEA import void *extTools__init(void); -#endif +#endif // extTools diff --git a/bootstrap/windows-88/vt100.c b/bootstrap/windows-88/vt100.c index 22698256..fac0e0ba 100644 --- a/bootstrap/windows-88/vt100.c +++ b/bootstrap/windows-88/vt100.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" #include "Console.h" #include "Strings.h" diff --git a/bootstrap/windows-88/vt100.h b/bootstrap/windows-88/vt100.h index f6c994fa..c2ebcd84 100644 --- a/bootstrap/windows-88/vt100.h +++ b/bootstrap/windows-88/vt100.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h -#define LARGE #include "SYSTEM.h" @@ -35,4 +34,4 @@ import void vt100_SetAttr (CHAR *attr, LONGINT attr__len); import void *vt100__init(void); -#endif +#endif // vt100 diff --git a/src/compiler/OPB.Mod b/src/compiler/OPB.Mod index 44b11ad9..ee6dc10a 100644 --- a/src/compiler/OPB.Mod +++ b/src/compiler/OPB.Mod @@ -1034,7 +1034,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) |OPT.ashfn: (*ASH*) IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) ELSIF f = OPT.Int THEN - IF x.typ.size # OPM.LIntSize THEN Convert(x, OPT.linttyp) END + IF x.typ.size # OPT.linttyp.size THEN Convert(x, OPT.linttyp) END ELSE err(111); x^.typ := OPT.linttyp END |OPT.adrfn: (*SYSTEM.ADR*) diff --git a/src/compiler/OPC.Mod b/src/compiler/OPC.Mod index 362a72df..c5b16ad0 100644 --- a/src/compiler/OPC.Mod +++ b/src/compiler/OPC.Mod @@ -552,7 +552,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) IF typ^.strobj # NIL THEN OPM.WriteStringVar(typ^.strobj^.name) END ; OPM.Write(DoubleQuote); Str1(', #), {', typ^.size); - nofptrs := 0; PutPtrOffsets(typ, 0, nofptrs); Str1("#}}", -(nofptrs + 1) * OPM.LIntSize); + nofptrs := 0; PutPtrOffsets(typ, 0, nofptrs); Str1("#}}", -(nofptrs + 1) * OPM.PointerSize); EndStat END TDescDecl; @@ -589,6 +589,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) RETURN alignment END SizeAlignment; + PROCEDURE BaseAlignment*(typ: OPT.Struct): LONGINT; VAR alignment: LONGINT; BEGIN @@ -606,16 +607,24 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) PROCEDURE FillGap(gap, off, align: LONGINT; VAR n, curAlign: LONGINT); + (* gap: Required gap - already calculated based on alignment requirements + off: Current offset - where gap begins + align: Containing record type alignment + n: Next ordinal to use for private field names + curAlign: Largest alignment of any field so far + *) VAR adr: LONGINT; BEGIN adr := off; Align(adr, align); IF (curAlign < align) & (gap - (adr - off) >= align) THEN (* preserve alignment of the enclosing struct! *) DEC(gap, (adr - off) + align); BegStat; - IF align = OPM.IntSize THEN OPM.WriteString("INTEGER") - ELSIF align = OPM.LIntSize THEN OPM.WriteString("LONGINT") - ELSIF align = OPM.LRealSize THEN OPM.WriteString("LONGREAL") - END ; + CASE align OF + |2: OPM.WriteString("int16") + |4: OPM.WriteString("int32") + |8: OPM.WriteString("int64") + ELSE OPM.LogWLn; OPM.LogWStr("Unexpected enclosing alignment in FillGap.") + END; Str1(" _prvt#", n); INC(n); EndStat; curAlign := align END ; @@ -625,30 +634,44 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) PROCEDURE FieldList (typ: OPT.Struct; last: BOOLEAN; VAR off, n, curAlign: LONGINT); VAR fld: OPT.Object; base: OPT.Struct; gap, adr, align, fldAlign: LONGINT; BEGIN - fld := typ.link; align := typ^.align MOD 10000H; + fld := typ.link; + align := typ^.align MOD 10000H; IF typ.BaseTyp # NIL THEN FieldList(typ.BaseTyp, FALSE, off, n, curAlign) ELSE off := 0; n := 0; curAlign := 1 - END ; + END; + (* off: Current offset into record + align: Overall (RECORD) alignment + curAlign: Current alignment - largest alignment of any field so far + n: Next ordinal to use for private field names + *) WHILE (fld # NIL) & (fld.mode = OPT.Fld) DO - IF (OPM.currFile = OPM.HeaderFile) & (fld.vis = OPT.internal) OR - (OPM.currFile = OPM.BodyFile) & (fld.vis = OPT.internal) & (typ^.mno # 0) THEN + IF (OPM.currFile = OPM.HeaderFile) & (fld.vis = OPT.internal) + OR (OPM.currFile = OPM.BodyFile) & (fld.vis = OPT.internal) & (typ^.mno # 0) THEN + (* Skip private fields *) fld := fld.link; - WHILE (fld # NIL) & (fld.mode = OPT.Fld) & (fld.vis = OPT.internal) DO fld := fld.link END ; + WHILE (fld # NIL) & (fld.mode = OPT.Fld) & (fld.vis = OPT.internal) DO fld := fld.link END; ELSE (* mimic OPV.TypSize to detect gaps caused by private fields *) - adr := off; fldAlign := BaseAlignment(fld^.typ); Align(adr, fldAlign); + adr := off; + fldAlign := BaseAlignment(fld^.typ); + Align(adr, fldAlign); gap := fld.adr - adr; - IF fldAlign > curAlign THEN curAlign := fldAlign END ; - IF gap > 0 THEN FillGap(gap, off, align, n, curAlign) END ; + IF fldAlign > curAlign THEN curAlign := fldAlign END; + IF gap > 0 THEN + FillGap(gap, off, align, n, curAlign) + END; BegStat; DeclareBase(fld); OPM.Write(' '); DeclareObj(fld, FALSE); off := fld.adr + fld.typ.size; base := fld.typ; fld := fld.link; - WHILE (fld # NIL) & (fld.mode = OPT.Fld) & (fld.typ = base) & (fld.adr = off) + WHILE (fld # NIL) + & (fld.mode = OPT.Fld) + & (fld.typ = base) + & (fld.adr = off) (* ?? *) & ((OPM.currFile = OPM.BodyFile) OR (fld.vis # OPT.internal) OR (fld.typ.strobj = NIL)) DO OPM.WriteString(", "); DeclareObj(fld, FALSE); off := fld.adr + fld.typ.size; fld := fld.link - END ; + END; EndStat END - END ; + END; IF last THEN adr := typ.size - typ^.sysflag DIV 100H; IF adr = 0 THEN gap := 1 (* avoid empty struct *) ELSE gap := adr - off END ; @@ -807,7 +830,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) OPM.WriteStringVar(OPM.modName); OPM.WriteString(BodyNameExt); EndStat; OPM.WriteLn; CProcDefs(OPT.topScope^.right, 1); OPM.WriteLn; - OPM.WriteString("#endif"); OPM.WriteLn + OPM.WriteString("#endif // "); OPM.WriteStringVar(OPM.modName); OPM.WriteLn END GenHdr; PROCEDURE GenHeaderMsg; @@ -848,7 +871,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) OPM.WriteString("#ifndef "); OPM.WriteStringVar(OPM.modName); OPM.WriteString(FlagExt); OPM.WriteLn; OPM.WriteString("#define "); OPM.WriteStringVar(OPM.modName); OPM.WriteString(FlagExt); OPM.WriteLn; OPM.WriteLn; - IF OPM.LIntSize = 8 THEN OPM.WriteString("#define LARGE"); OPM.WriteLn END; + Include(BasicIncludeFile); IncludeImports(OPT.topScope^.right, 1); OPM.WriteLn END GenHdrIncludes; @@ -857,7 +880,14 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) BEGIN OPM.currFile := OPM.BodyFile; GenHeaderMsg; - IF OPM.LIntSize = 8 THEN OPM.WriteString("#define LARGE"); OPM.WriteLn END; + OPM.WriteLn; + + (* Define adjustable type sizes *) + OPM.WriteString("#define INTEGER int"); OPM.WriteInt(OPT.inttyp.size*8); OPM.WriteLn; + OPM.WriteString("#define LONGINT int"); OPM.WriteInt(OPT.linttyp.size*8); OPM.WriteLn; + OPM.WriteString("#define SET uint"); OPM.WriteInt(OPT.settyp.size*8); OPM.WriteLn; + OPM.WriteLn; + Include(BasicIncludeFile); IncludeImports(OPT.topScope^.right, 0); OPM.WriteLn; DefAnonRecs(n); @@ -1001,10 +1031,10 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) (* If there will be a result, provide a result variable. *) IF proc^.typ # OPT.notyp THEN BegStat; - Ident(proc^.typ^.strobj); - OPM.WriteString(" _o_result;"); - OPM.WriteLn; - END; + Ident(proc^.typ^.strobj); + OPM.WriteString(" _o_result;"); + OPM.WriteLn; + END; scope := proc^.scope; IdentList(scope^.scope, 0); diff --git a/src/compiler/OPM.cmdln.Mod b/src/compiler/OPM.cmdln.Mod index 10ee8ebb..a7810f0c 100644 --- a/src/compiler/OPM.cmdln.Mod +++ b/src/compiler/OPM.cmdln.Mod @@ -9,7 +9,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) CONST OptionChar* = "-"; - (* compiler options; don't change the encoding *) + (* compiler option flag bits; don't change the encoding *) inxchk* = 0; (* index check on *) ranchk* = 2; (* range check on *) typchk* = 3; (* type check on *) @@ -49,12 +49,6 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) MaxStruct* = 255; - (* maximal number of pointer fields in a record: *) - MaxPtr* = MAX(LONGINT); - - (* maximal number of global pointers per module: *) - MaxGPtr* = MAX(LONGINT); - (* maximal number of hidden fields in an exported record: *) MaxHdFld* = 2048; diff --git a/src/compiler/OPV.Mod b/src/compiler/OPV.Mod index 7cc0fe38..61125e5b 100644 --- a/src/compiler/OPV.Mod +++ b/src/compiler/OPV.Mod @@ -50,24 +50,12 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 VAR assert, inxchk, mainprog, ansi: BOOLEAN; stamp: INTEGER; (* unique number for nested objects *) - (*recno: INTEGER;*) (* number of anonymous record types *) recno: LONGINT; (* number of anonymous record types *) exit: ExitInfo; (* to check if EXIT is simply a break *) nofExitLabels: INTEGER; - naturalAlignment: BOOLEAN; - PROCEDURE NaturalAlignment(size, max: LONGINT): LONGINT; - VAR i: LONGINT; - BEGIN - IF size >= max THEN RETURN max - ELSE i := 1; - WHILE i < size DO INC(i, i) END ; - RETURN i - END - END NaturalAlignment; - PROCEDURE TypSize*(typ: OPT.Struct); VAR f, c: INTEGER; offset, size, base, fbase, off0: LONGINT; fld: OPT.Object; btyp: OPT.Struct; @@ -87,10 +75,10 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 fld^.adr := offset; INC(offset, size); IF fbase > base THEN base := fbase END ; fld := fld^.link - END ; + END; + (* base is now the largest alignment of any field *) off0 := offset; IF offset = 0 THEN offset := 1 END ; (* 1 byte filler to avoid empty struct *) - IF OPM.RecSize = 0 THEN base := NaturalAlignment(offset, (*OPM.RecAlign*)OPC.SizeAlignment(OPM.RecSize)) END ; OPC.Align(offset, base); IF (typ^.strobj = NIL) & (typ^.align MOD 10000H = 0) THEN INC(recno); INC(base, recno * 10000H) END ; typ^.size := offset; typ^.align := base; diff --git a/src/system/Platformunix.Mod b/src/system/Platformunix.Mod index cbd5b646..6c86de7c 100644 --- a/src/system/Platformunix.Mod +++ b/src/system/Platformunix.Mod @@ -499,7 +499,6 @@ BEGIN END DisplayHaltCode; PROCEDURE Halt*(code: LONGINT); -VAR e: ErrorCode; BEGIN HaltCode := code; IF HaltHandler # NIL THEN HaltHandler(code) END; @@ -510,7 +509,6 @@ BEGIN END Halt; PROCEDURE AssertFail*(code: LONGINT); -VAR e: ErrorCode; BEGIN errstring("Assertion failure."); IF code # 0 THEN errstring(" ASSERT code "); errint(code); errstring("."); END; diff --git a/src/system/Platformwindows.Mod b/src/system/Platformwindows.Mod index 9ed6bc8c..a81507d9 100644 --- a/src/system/Platformwindows.Mod +++ b/src/system/Platformwindows.Mod @@ -564,7 +564,6 @@ BEGIN END DisplayHaltCode; PROCEDURE Halt*(code: LONGINT); -VAR e: ErrorCode; BEGIN HaltCode := code; IF HaltHandler # NIL THEN HaltHandler(code) END; @@ -575,7 +574,6 @@ BEGIN END Halt; PROCEDURE AssertFail*(code: LONGINT); -VAR e: ErrorCode; BEGIN errstring("Assertion failure."); IF code # 0 THEN errstring(" ASSERT code "); errint(code); errstring("."); END; diff --git a/src/system/SYSTEM.h b/src/system/SYSTEM.h index 8c6c335e..6fc57309 100644 --- a/src/system/SYSTEM.h +++ b/src/system/SYSTEM.h @@ -1,6 +1,24 @@ #ifndef SYSTEM__h #define SYSTEM__h + + +#ifndef LONGINT + #if (__SIZEOF_POINTER__ == 8) || defined(_WIN64) + #define INTEGER int32 + #define LONGINT int64 + #define SET uint64 + #else + #define INTEGER int16 + #define LONGINT int32 + #define SET uint32 + #endif +#endif + + + + + // Declare memcpy in a way compatible with C compilers intrinsic // built in implementations. @@ -22,10 +40,12 @@ void *memcpy(void *dest, const void *source, size_t size); // Declare fixed size versions of basic intger types -#if defined(_WIN64) +#if (__SIZEOF_POINTER__ < 8) || defined(_WIN64) + // ILP32 or LLP64 typedef long long int64; typedef unsigned long long uint64; #else + // LP64 typedef long int64; typedef unsigned long uint64; #endif @@ -67,29 +87,10 @@ typedef float REAL; typedef double LONGREAL; typedef void* SYSTEM_PTR; +#define uSET SET -// For 32 bit builds, the size of LONGINT depends on a make option: - -#if (__SIZEOF_POINTER__ == 8) || defined(LARGE) || defined(_WIN64) - typedef int32 INTEGER; - typedef int64 LONGINT; - typedef uint64 SET; - typedef uint64 uSET; -#else - typedef int16 INTEGER; - typedef int32 LONGINT; - typedef uint32 SET; - typedef uint32 uSET; -#endif - - -// Temporary defs while bootstrapping - -#define uLONGINT uint64 - - // ---------------------------------------------------------------------- // ---------------------------------------------------------------------- diff --git a/src/tools/make/configure.c b/src/tools/make/configure.c index 767763bc..a74b40e8 100644 --- a/src/tools/make/configure.c +++ b/src/tools/make/configure.c @@ -421,6 +421,12 @@ void writeConfigurationMod() { int main(int argc, char *argv[]) { + // Make sure SYSTEM.h has set up our core data types correctly. + assert(sizeof(int8) == 1, "sizeof(int8) is not 1."); + assert(sizeof(int16) == 2, "sizeof(int16) is not 2."); + assert(sizeof(int32) == 4, "sizeof(int32) is not 4."); + assert(sizeof(int64) == 8, "sizeof(int64) is not 8."); + oname = getenv("ONAME"); if (!oname) oname = macrotostring(O_NAME); if (argc>1) { From 83aaa702903322b1eb7b23f6a84e4765ce0ca39d Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 9 Sep 2016 14:47:40 +0100 Subject: [PATCH 219/580] SYSTEM.ADDRESS signed (again), DIV, MOD full integer support, ASH and checks support 64 bit ints. Change (back) to address type being signed. DIV and MOD fully defined for the full range of integer on both parameters. _X, _XF, _R and _RF checks upgraded for 64 bit support. ASH upgraded for 64 bit. Add div and mod tests to language confidence test. Enable debuggable C compiler options. --- makefile | 3 + src/system/Heap.Mod | 3 +- src/system/SYSTEM.c | 46 ++++++---- src/system/SYSTEM.h | 90 +++++++++++-------- src/test/confidence/language/TestLanguage.mod | 54 +++++++++++ src/test/confidence/planned-binary-change | 2 +- src/test/confidence/testenv.sh | 2 +- src/tools/make/configure.c | 10 +-- 8 files changed, 146 insertions(+), 64 deletions(-) diff --git a/makefile b/makefile index 3840589a..31f5fa39 100644 --- a/makefile +++ b/makefile @@ -226,6 +226,9 @@ uninstall: configuration confidence: configuration @make -f src/tools/make/vishap.make -s confidence +planned-binary-change: + @date >src/test/confidence/planned-binary-change + diff --git a/src/system/Heap.Mod b/src/system/Heap.Mod index e1fc81c4..bf3d0d7f 100644 --- a/src/system/Heap.Mod +++ b/src/system/Heap.Mod @@ -336,8 +336,7 @@ MODULE Heap; tag := tagbits + SZA; (* Tag addresses first offset *) LOOP SYSTEM.GET(tag, offset); (* Get next ptr field offset *) - IF SYSTEM.BIT(SYSTEM.ADR(offset), SIZE(SYSTEM.ADDRESS)*8 - 1) THEN - (* Sentinel reached: Value is -8*(#fields+1) *) + IF offset < 0 THEN (* Sentinel reached: Value is -8*(#fields+1) *) SYSTEM.PUT(q - SZA, tag + offset + 1); (* Rotate base ptr into tag *) IF p = 0 THEN EXIT END ; n := q; q := p; diff --git a/src/system/SYSTEM.c b/src/system/SYSTEM.c index 821a6096..d7603f8e 100644 --- a/src/system/SYSTEM.c +++ b/src/system/SYSTEM.c @@ -21,11 +21,34 @@ // Procedure verions of SYSTEM.H versions used when a multiply accessed // parameter has side effects. -int64 SYSTEM_XCHK(uint64 i, uint64 ub) {return __X(i, ub);} -int64 SYSTEM_RCHK(uint64 i, uint64 ub) {return __R(i, ub);} -LONGINT SYSTEM_ASH (LONGINT i, LONGINT n) {return __ASH(i, n);} -LONGINT SYSTEM_ABS (LONGINT i) {return __ABS(i);} -double SYSTEM_ABSD(double i) {return __ABS(i);} + + +LONGINT SYSTEM_ABS (LONGINT i) {return __ABS(i);} +double SYSTEM_ABSD(double i) {return __ABS(i);} + + +int64 SYSTEM_DIV(int64 x, int64 y) +{ + if (x == 0) return 0; + if (x >= 0) + if (y >= 0) {return x/y;} + else {return -((x-y-1)/(-y));} + else + if (y >= 0) {return -((y-x-1)/y);} + else {return (-x)/(-y);} +} + +int64 SYSTEM_MOD(int64 x, int64 y) +{ + if (x == 0) return 0; + if (x >= 0) + if (y >= 0) {return x % y;} + else {return (y+1) + ((x-1) % (-y));} + else + if (y >= 0) {return (y-1) - ((-x-1) % y);} + else {return -((-x) % (-y));} +} + void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0) { @@ -57,19 +80,6 @@ void SYSTEM_ENUMR(void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()) } } -LONGINT SYSTEM_DIV(uint64 x, uint64 y) -{ if ((int64) x >= 0) return (x / y); - else return -((y - 1 - x) / y); -} - -LONGINT SYSTEM_MOD(uint64 x, uint64 y) -{ uint64 m; - if ((int64) x >= 0) return (x % y); - else { m = (-x) % y; - if (m != 0) return (y - m); else return 0; - } -} - LONGINT SYSTEM_ENTIER(double x) { LONGINT y; diff --git a/src/system/SYSTEM.h b/src/system/SYSTEM.h index 6fc57309..881004ba 100644 --- a/src/system/SYSTEM.h +++ b/src/system/SYSTEM.h @@ -2,6 +2,8 @@ #define SYSTEM__h +// Temporary while bootstrapping and clearing up SYSTEM.c. + #ifndef LONGINT #if (__SIZEOF_POINTER__ == 8) || defined(_WIN64) @@ -25,11 +27,14 @@ #if (__SIZEOF_POINTER__ == 8) || defined(_WIN64) || defined(__LP64__) #if defined(_WIN64) typedef unsigned long long size_t; + typedef long long address; #else typedef unsigned long size_t; + typedef long address; #endif #else typedef unsigned int size_t; + typedef int address; #endif #define _SIZE_T_DECLARED // For FreeBSD @@ -59,7 +64,7 @@ typedef unsigned short int uint16; typedef signed char int8; typedef unsigned char uint8; -#define address size_t + // The compiler uses 'import' and 'export' which translate to 'extern' and // nothing respectively. @@ -103,18 +108,40 @@ extern address Platform_OSAllocate (address size); extern void Platform_OSFree (address addr); +// Assertions and Halts + +extern void Platform_Halt(LONGINT x); +extern void Platform_AssertFail(LONGINT x); + +#define __HALT(x) Platform_Halt(x) +#define __ASSERT(cond, x) if (!(cond)) Platform_AssertFail((LONGINT)(x)) + + +// Index checking + +static inline int64 __XF(uint64 i, uint64 ub) {if (i >= ub) {__HALT(-2);} return i;} +#define __X(i, ub) (((uint64)(i)<(uint64)(ub))?i:(__HALT(-2),0)) + + +// Range checking, and checked SHORT and CHR functions + +static inline int64 __RF(uint64 i, uint64 ub) {if (i >= ub) {__HALT(-8);} return i;} +#define __R(i, ub) (((uint64)(i)<(uint64)(ub))?i:(__HALT(-8),0)) +#define __SHORT(x, ub) ((int)((uLONGINT)(x)+(ub)<(ub)+(ub)?(x):(__HALT(-8),0))) +#define __SHORTF(x, ub) ((int)(__RF((x)+(ub),(ub)+(ub))-(ub))) +#define __CHR(x) ((CHAR)__R(x, 256)) +#define __CHRF(x) ((CHAR)__RF(x, 256)) + + + // Run time system routines in SYSTEM.c -extern int64 SYSTEM_XCHK (uint64 i, uint64 ub); -extern int64 SYSTEM_RCHK (uint64 i, uint64 ub); -extern LONGINT SYSTEM_ASH (LONGINT i, LONGINT n); + extern LONGINT SYSTEM_ABS (LONGINT i); extern double SYSTEM_ABSD (double i); extern void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0); extern void SYSTEM_ENUMP (void *adr, LONGINT n, void (*P)()); extern void SYSTEM_ENUMR (void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()); -extern LONGINT SYSTEM_DIV (uint64 x, uint64 y); -extern LONGINT SYSTEM_MOD (uint64 x, uint64 y); extern LONGINT SYSTEM_ENTIER (double x); @@ -131,7 +158,7 @@ extern LONGINT SYSTEM_ENTIER (double x); // String comparison -static int __str_cmp(CHAR *x, CHAR *y){ +static inline int __str_cmp(CHAR *x, CHAR *y){ LONGINT i = 0; CHAR ch1, ch2; do {ch1 = x[i]; ch2 = y[i]; i++; @@ -152,21 +179,12 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __DEL(x) Platform_OSFree((address)x) -// Index and range checks - -#define __X(i, ub) (((uint64)(i)<(uint64)(ub))?i:(__HALT(-2),0)) -#define __XF(i, ub) SYSTEM_XCHK((uint64)(i), (uint64)(ub)) - -#define __R(i, ub) (((uint64)(i)<(uint64)(ub))?i:(__HALT(-8),0)) -#define __RF(i, ub) SYSTEM_RCHK((uint64)(i),(uint64)(ub)) - - /* SYSTEM ops */ #define __VAL(t, x) (*(t*)&(x)) -#define __GET(a, x, t) x= *(t*)(address)(a) +#define __GET(a, x, t) x=*(t*)(address)(a) #define __PUT(a, x, t) *(t*)(address)(a)=x #define __LSHL(x, n, t) ((t)((u##t)(x)<<(n))) @@ -177,21 +195,28 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __ROTR(x, n, t) ((t)((u##t)(x)>>(n)|(u##t)(x)<<(8*sizeof(t)-(n)))) #define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) -#define __ASHL(x, n) ((LONGINT)(x)<<(n)) -#define __ASHR(x, n) ((LONGINT)(x)>>(n)) +#define __ASHL(x, n) ((int64)(x)<<(n)) +#define __ASHR(x, n) ((int64)(x)>>(n)) #define __ASH(x, n) ((n)>=0?__ASHL(x,n):__ASHR(x,-(n))) -#define __ASHF(x, n) SYSTEM_ASH((LONGINT)(x), (LONGINT)(n)) +static inline int64 SYSTEM_ASH(int64 x, int64 n) {return __ASH(x,n);} +#define __ASHF(x, n) SYSTEM_ASH((int64)(x), (int64)(n)) #define __BIT(x, n) (*(uint64*)(x)>>(n)&1) #define __MOVE(s, d, n) memcpy((char*)(address)(d),(char*)(address)(s),n) -#define __SHORT(x, y) ((int)((uLONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) -#define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) -#define __CHR(x) ((CHAR)__R(x, 256)) -#define __CHRF(x) ((CHAR)__RF(x, 256)) -#define __DIV(x, y) ((x)>=0?(x)/(y):-(((y)-1-(x))/(y))) -#define __DIVF(x, y) SYSTEM_DIV((LONGINT)(x),(LONGINT)(y)) -#define __MOD(x, y) ((x)>=0?(x)%(y):__MODF(x,y)) -#define __MODF(x, y) SYSTEM_MOD((LONGINT)(x),(LONGINT)(y)) + + + +extern int64 SYSTEM_DIV(int64 x, int64 y); +#define __DIVF(x, y) SYSTEM_DIV(x, y) +#define __DIV(x, y) (((x)>0 && (y)>0) ? (x)/(y) : __DIVF(x, y)) + + +extern int64 SYSTEM_MOD(int64 x, int64 y); +#define __MODF(x, y) SYSTEM_MOD(x, y) +#define __MOD(x, y) (((x)>0 && (y)>0) ? (x)%(y) : __MODF(x, y)) + + + #define __ENTIER(x) SYSTEM_ENTIER(x) #define __ABS(x) (((x)<0)?-(x):(x)) #define __ABSF(x) SYSTEM_ABS((LONGINT)(x)) @@ -244,15 +269,6 @@ extern void Heap_FINALL(); #define __FINI Heap_FINALL(); return 0 -// Assertions and Halts - -extern void Platform_Halt(LONGINT x); -extern void Platform_AssertFail(LONGINT x); - -#define __HALT(x) Platform_Halt(x) -#define __ASSERT(cond, x) if (!(cond)) Platform_AssertFail((LONGINT)(x)) - - // Memory allocation extern SYSTEM_PTR Heap_NEWBLK (address size); diff --git a/src/test/confidence/language/TestLanguage.mod b/src/test/confidence/language/TestLanguage.mod index d3653c0b..3db99f44 100644 --- a/src/test/confidence/language/TestLanguage.mod +++ b/src/test/confidence/language/TestLanguage.mod @@ -108,6 +108,59 @@ BEGIN END END TestValue; + +PROCEDURE side(i: INTEGER): INTEGER; BEGIN RETURN i END side; + +PROCEDURE DivMod; + VAR i,j: INTEGER; +BEGIN + j := 2; + i := 4; TestValue(i DIV j, 2, "4 DIV 2"); TestValue(side(i) DIV side(j), 2, "side(4) DIV side(2)"); + i := 5; TestValue(i DIV j, 2, "5 DIV 2"); TestValue(side(i) DIV side(j), 2, "side(5) DIV side(2)"); + i := 6; TestValue(i DIV j, 3, "6 DIV 2"); TestValue(side(i) DIV side(j), 3, "side(6) DIV side(2)"); + i := 7; TestValue(i DIV j, 3, "7 DIV 2"); TestValue(side(i) DIV side(j), 3, "side(7) DIV side(2)"); + i := -4; TestValue(i DIV j, -2, "(-4) DIV 2"); TestValue(side(i) DIV side(j), -2, "side(-4) DIV side(2)"); + i := -5; TestValue(i DIV j, -3, "(-5) DIV 2"); TestValue(side(i) DIV side(j), -3, "side(-5) DIV side(2)"); + i := -6; TestValue(i DIV j, -3, "(-6) DIV 2"); TestValue(side(i) DIV side(j), -3, "side(-6) DIV side(2)"); + i := -7; TestValue(i DIV j, -4, "(-7) DIV 2"); TestValue(side(i) DIV side(j), -4, "side(-7) DIV side(2)"); + + j := -2; + i := 4; TestValue(i DIV j, -2, "4 DIV (-2)"); TestValue(side(i) DIV side(j), -2, "side(4) DIV side(-2)"); + i := 5; TestValue(i DIV j, -3, "5 DIV (-2)"); TestValue(side(i) DIV side(j), -3, "side(5) DIV side(-2)"); + i := 6; TestValue(i DIV j, -3, "6 DIV (-2)"); TestValue(side(i) DIV side(j), -3, "side(6) DIV side(-2)"); + i := 7; TestValue(i DIV j, -4, "7 DIV (-2)"); TestValue(side(i) DIV side(j), -4, "side(7) DIV side(-2)"); + i := -4; TestValue(i DIV j, 2, "(-4) DIV (-2)"); TestValue(side(i) DIV side(j), 2, "side(-4) DIV side(-2)"); + i := -5; TestValue(i DIV j, 2, "(-5) DIV (-2)"); TestValue(side(i) DIV side(j), 2, "side(-5) DIV side(-2)"); + i := -6; TestValue(i DIV j, 3, "(-6) DIV (-2)"); TestValue(side(i) DIV side(j), 3, "side(-6) DIV side(-2)"); + i := -7; TestValue(i DIV j, 3, "(-7) DIV (-2)"); TestValue(side(i) DIV side(j), 3, "side(-7) DIV side(-2)"); + + (* x = (x DIV y) * y + (x MOD y) + => x MOd y = x - ((x DIV y) * y) + *) + + + i := 4; j := 3; TestValue(i MOD j, i - ((i DIV j) * j), "4 MOD 3"); + i := 5; j := 3; TestValue(i MOD j, i - ((i DIV j) * j), "5 MOD 3"); + i := 6; j := 3; TestValue(i MOD j, i - ((i DIV j) * j), "6 MOD 3"); + i := 7; j := 3; TestValue(i MOD j, i - ((i DIV j) * j), "7 MOD 3"); + + i := -4; j := 3; TestValue(i MOD j, i - ((i DIV j) * j), "-4 MOD 3"); + i := -5; j := 3; TestValue(i MOD j, i - ((i DIV j) * j), "-5 MOD 3"); + i := -6; j := 3; TestValue(i MOD j, i - ((i DIV j) * j), "-6 MOD 3"); + i := -7; j := 3; TestValue(i MOD j, i - ((i DIV j) * j), "-7 MOD 3"); + + i := 4; j := -3; TestValue(i MOD j, i - ((i DIV j) * j), "4 MOD -3"); + i := 5; j := -3; TestValue(i MOD j, i - ((i DIV j) * j), "5 MOD -3"); + i := 6; j := -3; TestValue(i MOD j, i - ((i DIV j) * j), "6 MOD -3"); + i := 7; j := -3; TestValue(i MOD j, i - ((i DIV j) * j), "7 MOD -3"); + + i := -4; j := -3; TestValue(i MOD j, i - ((i DIV j) * j), "-4 MOD -3"); + i := -5; j := -3; TestValue(i MOD j, i - ((i DIV j) * j), "-5 MOD -3"); + i := -6; j := -3; TestValue(i MOD j, i - ((i DIV j) * j), "-6 MOD -3"); + i := -7; j := -3; TestValue(i MOD j, i - ((i DIV j) * j), "-7 MOD -3"); +END DivMod; + + PROCEDURE IntSize; VAR l: LONGINT; BEGIN @@ -136,6 +189,7 @@ END IntSize; BEGIN Shift; + DivMod; IntSize; Console.String("Language tests successful."); Console.Ln; END TestLanguage. diff --git a/src/test/confidence/planned-binary-change b/src/test/confidence/planned-binary-change index 61780798..3c9d13b0 100644 --- a/src/test/confidence/planned-binary-change +++ b/src/test/confidence/planned-binary-change @@ -1 +1 @@ -b +09 Sep 2016 14:20:47 diff --git a/src/test/confidence/testenv.sh b/src/test/confidence/testenv.sh index 63d5fa26..d61ba439 100755 --- a/src/test/confidence/testenv.sh +++ b/src/test/confidence/testenv.sh @@ -22,5 +22,5 @@ rm -f *.o *.obj *.exe *.sym *.c *.h result new.asm # NOTE 2: The cygwin 64 bit build has relocation errors with # these assembly generation options. if [ "$COMPILER" = "gcc" -a "$FLAVOUR" != "cygwin.LP64.gcc" ] -then export CFLAGS="-gstabs -g1 -Wa,-acdhln=new.asm" +then export CFLAGS="-gstabs -g1 -Wa,-acdhln=new.asm -Wl,-Map=output.map" fi diff --git a/src/tools/make/configure.c b/src/tools/make/configure.c index a74b40e8..b3c46d3e 100644 --- a/src/tools/make/configure.c +++ b/src/tools/make/configure.c @@ -131,20 +131,20 @@ void determineCCompiler() { #if defined(__MINGW32__) compiler = "mingw"; if (sizeof (void*) == 4) { - cc = "i686-w64-mingw32-gcc -g"; + cc = "i686-w64-mingw32-gcc -g -Og"; } else { - cc = "x86_64-w64-mingw32-gcc -g"; + cc = "x86_64-w64-mingw32-gcc -g -Og"; } #elif defined(__clang__) compiler = "clang"; - cc = "clang -fPIC -g"; + cc = "clang -fPIC -g -O1"; #elif defined(__GNUC__) compiler = "gcc"; if (strncasecmp(os, "cygwin", 6) == 0) { // Avoid cygwin specific warning that -fPIC is ignored. - cc = "gcc -g"; + cc = "gcc -g -Og"; } else { - cc = "gcc -fPIC -g"; + cc = "gcc -fPIC -g -Og"; } #elif defined(_MSC_VER) compiler = "MSC"; From 24aa3c6508b9d8c93629c8afd6539ab54609e0a2 Mon Sep 17 00:00:00 2001 From: David Brown Date: Sat, 10 Sep 2016 12:24:06 +0100 Subject: [PATCH 220/580] -Ob not working on my FreeBSD, use -O1. Better LP64 detection for OpenBSD. --- src/system/SYSTEM.h | 21 +++++++++++++-------- src/tools/make/configure.c | 8 ++++---- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/src/system/SYSTEM.h b/src/system/SYSTEM.h index 881004ba..e32fb677 100644 --- a/src/system/SYSTEM.h +++ b/src/system/SYSTEM.h @@ -2,11 +2,17 @@ #define SYSTEM__h +// 64 bit system detection + +#if (__SIZEOF_POINTER__ == 8) || defined (_LP64) || defined(__LP64__) || defined(_WIN64) + #define __o_64 +#endif + // Temporary while bootstrapping and clearing up SYSTEM.c. #ifndef LONGINT - #if (__SIZEOF_POINTER__ == 8) || defined(_WIN64) + #if defined (__o_64) #define INTEGER int32 #define LONGINT int64 #define SET uint64 @@ -24,7 +30,7 @@ // Declare memcpy in a way compatible with C compilers intrinsic // built in implementations. -#if (__SIZEOF_POINTER__ == 8) || defined(_WIN64) || defined(__LP64__) +#if defined (__o_64) #if defined(_WIN64) typedef unsigned long long size_t; typedef long long address; @@ -45,14 +51,14 @@ void *memcpy(void *dest, const void *source, size_t size); // Declare fixed size versions of basic intger types -#if (__SIZEOF_POINTER__ < 8) || defined(_WIN64) - // ILP32 or LLP64 - typedef long long int64; - typedef unsigned long long uint64; -#else +#if defined (__o_64) && !defined(_WIN64) // LP64 typedef long int64; typedef unsigned long uint64; +#else + // ILP32 or LLP64 + typedef long long int64; + typedef unsigned long long uint64; #endif typedef int int32; @@ -205,7 +211,6 @@ static inline int64 SYSTEM_ASH(int64 x, int64 n) {return __ASH(x,n);} #define __MOVE(s, d, n) memcpy((char*)(address)(d),(char*)(address)(s),n) - extern int64 SYSTEM_DIV(int64 x, int64 y); #define __DIVF(x, y) SYSTEM_DIV(x, y) #define __DIV(x, y) (((x)>0 && (y)>0) ? (x)/(y) : __DIVF(x, y)) diff --git a/src/tools/make/configure.c b/src/tools/make/configure.c index b3c46d3e..10886067 100644 --- a/src/tools/make/configure.c +++ b/src/tools/make/configure.c @@ -131,9 +131,9 @@ void determineCCompiler() { #if defined(__MINGW32__) compiler = "mingw"; if (sizeof (void*) == 4) { - cc = "i686-w64-mingw32-gcc -g -Og"; + cc = "i686-w64-mingw32-gcc -g -O1"; } else { - cc = "x86_64-w64-mingw32-gcc -g -Og"; + cc = "x86_64-w64-mingw32-gcc -g -O1"; } #elif defined(__clang__) compiler = "clang"; @@ -142,9 +142,9 @@ void determineCCompiler() { compiler = "gcc"; if (strncasecmp(os, "cygwin", 6) == 0) { // Avoid cygwin specific warning that -fPIC is ignored. - cc = "gcc -g -Og"; + cc = "gcc -g -O1"; } else { - cc = "gcc -fPIC -g -Og"; + cc = "gcc -fPIC -g -O1"; } #elif defined(_MSC_VER) compiler = "MSC"; From 1bce6ac9b0d4f7e9e093965d9431299bd568542f Mon Sep 17 00:00:00 2001 From: David Brown Date: Sun, 11 Sep 2016 18:00:35 +0100 Subject: [PATCH 221/580] Make address just a synonym for int32 or int64. --- src/system/SYSTEM.h | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/system/SYSTEM.h b/src/system/SYSTEM.h index e32fb677..168b0beb 100644 --- a/src/system/SYSTEM.h +++ b/src/system/SYSTEM.h @@ -33,14 +33,14 @@ #if defined (__o_64) #if defined(_WIN64) typedef unsigned long long size_t; - typedef long long address; +// typedef long long address; #else typedef unsigned long size_t; - typedef long address; +// typedef long address; #endif #else typedef unsigned int size_t; - typedef int address; +//typedef int address; #endif #define _SIZE_T_DECLARED // For FreeBSD @@ -71,6 +71,13 @@ typedef signed char int8; typedef unsigned char uint8; +// 'address' is a synonym for an int32 of pointer size + +#if defined (__o_64) + #define address int64 +#else + #define address int32 +#endif // The compiler uses 'import' and 'export' which translate to 'extern' and // nothing respectively. From 74a085dda3b8c0e10cb12b43817015aa6043a511 Mon Sep 17 00:00:00 2001 From: David Brown Date: Sun, 11 Sep 2016 18:33:30 +0100 Subject: [PATCH 222/580] Update bootstrap. --- bootstrap/unix-44/Configuration.c | 4 +- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Console.c | 2 +- bootstrap/unix-44/Console.h | 2 +- bootstrap/unix-44/Files.c | 2 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 4 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 2 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 2 +- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 2 +- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 2 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/SYSTEM.c | 46 ++++++----- bootstrap/unix-44/SYSTEM.h | 116 +++++++++++++++++---------- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/Vishap.c | 2 +- bootstrap/unix-44/errors.c | 2 +- bootstrap/unix-44/errors.h | 2 +- bootstrap/unix-44/extTools.c | 6 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-44/vt100.c | 2 +- bootstrap/unix-44/vt100.h | 2 +- bootstrap/unix-48/Configuration.c | 4 +- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Console.c | 2 +- bootstrap/unix-48/Console.h | 2 +- bootstrap/unix-48/Files.c | 2 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 4 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 2 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 2 +- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 2 +- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 2 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/SYSTEM.c | 46 ++++++----- bootstrap/unix-48/SYSTEM.h | 116 +++++++++++++++++---------- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/Vishap.c | 2 +- bootstrap/unix-48/errors.c | 2 +- bootstrap/unix-48/errors.h | 2 +- bootstrap/unix-48/extTools.c | 6 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-48/vt100.c | 2 +- bootstrap/unix-48/vt100.h | 2 +- bootstrap/unix-88/Configuration.c | 4 +- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Console.c | 2 +- bootstrap/unix-88/Console.h | 2 +- bootstrap/unix-88/Files.c | 2 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 4 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 2 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 2 +- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 2 +- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 2 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/SYSTEM.c | 46 ++++++----- bootstrap/unix-88/SYSTEM.h | 116 +++++++++++++++++---------- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/Vishap.c | 2 +- bootstrap/unix-88/errors.c | 2 +- bootstrap/unix-88/errors.h | 2 +- bootstrap/unix-88/extTools.c | 6 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/unix-88/vt100.c | 2 +- bootstrap/unix-88/vt100.h | 2 +- bootstrap/windows-48/Configuration.c | 4 +- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Console.c | 2 +- bootstrap/windows-48/Console.h | 2 +- bootstrap/windows-48/Files.c | 2 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 4 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 2 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 2 +- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 2 +- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 2 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/SYSTEM.c | 46 ++++++----- bootstrap/windows-48/SYSTEM.h | 116 +++++++++++++++++---------- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/Vishap.c | 2 +- bootstrap/windows-48/errors.c | 2 +- bootstrap/windows-48/errors.h | 2 +- bootstrap/windows-48/extTools.c | 6 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-48/vt100.c | 2 +- bootstrap/windows-48/vt100.h | 2 +- bootstrap/windows-88/Configuration.c | 4 +- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Console.c | 2 +- bootstrap/windows-88/Console.h | 2 +- bootstrap/windows-88/Files.c | 2 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 4 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 2 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 2 +- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 2 +- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 2 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Platform.c | 2 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/SYSTEM.c | 46 ++++++----- bootstrap/windows-88/SYSTEM.h | 116 +++++++++++++++++---------- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/Vishap.c | 2 +- bootstrap/windows-88/errors.c | 2 +- bootstrap/windows-88/errors.h | 2 +- bootstrap/windows-88/extTools.c | 6 +- bootstrap/windows-88/extTools.h | 2 +- bootstrap/windows-88/vt100.c | 2 +- bootstrap/windows-88/vt100.h | 2 +- 205 files changed, 715 insertions(+), 525 deletions(-) diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index 115f8dec..5736ed9f 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/06] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/11] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index 84e8427b..31877f12 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Console.c b/bootstrap/unix-44/Console.c index 8cbc9ce9..6181cbfd 100644 --- a/bootstrap/unix-44/Console.c +++ b/bootstrap/unix-44/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Console.h b/bootstrap/unix-44/Console.h index e9913d2d..78586a68 100644 --- a/bootstrap/unix-44/Console.h +++ b/bootstrap/unix-44/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index d596986e..f98f4e55 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index b0f34806..de420c7c 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index 2bbe63b2..58be6181 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tskSfF */ #define INTEGER int16 #define LONGINT int32 @@ -353,7 +353,7 @@ static void Heap_Mark (address q) tag = tagbits + 4; for (;;) { __GET(tag, offset, address); - if (__BIT((address)&offset, 31)) { + if (offset < 0) { __PUT(q - 4, (tag + offset) + 1, address); if (p == 0) { break; diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index 6694ef70..827a3a7c 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index e31876fb..66a8c776 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index 4bd4082d..02abd713 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index 0a1a9f63..8d44024a 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index 5ffa3869..5aaa8469 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 5666c7cd..1122a8d0 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index e1fc08ec..1a9ad61f 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 461b5b85..e6d709e7 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index c60f6f98..c5192f5b 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index 1ab60658..6e2d4cd0 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index ce85af11..de48c5ba 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index 3a1c4787..9b3bf8f0 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index 512cfa75..8689aa3b 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index 1983daf5..0d16f8ec 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index d3b24cc6..b9e46b1a 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index a62894dd..e36e3be5 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index b10704dc..c692efd8 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 43761270..b8559160 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index 0f9c0290..868c4e52 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 5f3d11a5..c9e8e867 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index cf931556..bd36f8d6 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/SYSTEM.c b/bootstrap/unix-44/SYSTEM.c index 821a6096..d7603f8e 100644 --- a/bootstrap/unix-44/SYSTEM.c +++ b/bootstrap/unix-44/SYSTEM.c @@ -21,11 +21,34 @@ // Procedure verions of SYSTEM.H versions used when a multiply accessed // parameter has side effects. -int64 SYSTEM_XCHK(uint64 i, uint64 ub) {return __X(i, ub);} -int64 SYSTEM_RCHK(uint64 i, uint64 ub) {return __R(i, ub);} -LONGINT SYSTEM_ASH (LONGINT i, LONGINT n) {return __ASH(i, n);} -LONGINT SYSTEM_ABS (LONGINT i) {return __ABS(i);} -double SYSTEM_ABSD(double i) {return __ABS(i);} + + +LONGINT SYSTEM_ABS (LONGINT i) {return __ABS(i);} +double SYSTEM_ABSD(double i) {return __ABS(i);} + + +int64 SYSTEM_DIV(int64 x, int64 y) +{ + if (x == 0) return 0; + if (x >= 0) + if (y >= 0) {return x/y;} + else {return -((x-y-1)/(-y));} + else + if (y >= 0) {return -((y-x-1)/y);} + else {return (-x)/(-y);} +} + +int64 SYSTEM_MOD(int64 x, int64 y) +{ + if (x == 0) return 0; + if (x >= 0) + if (y >= 0) {return x % y;} + else {return (y+1) + ((x-1) % (-y));} + else + if (y >= 0) {return (y-1) - ((-x-1) % y);} + else {return -((-x) % (-y));} +} + void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0) { @@ -57,19 +80,6 @@ void SYSTEM_ENUMR(void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()) } } -LONGINT SYSTEM_DIV(uint64 x, uint64 y) -{ if ((int64) x >= 0) return (x / y); - else return -((y - 1 - x) / y); -} - -LONGINT SYSTEM_MOD(uint64 x, uint64 y) -{ uint64 m; - if ((int64) x >= 0) return (x % y); - else { m = (-x) % y; - if (m != 0) return (y - m); else return 0; - } -} - LONGINT SYSTEM_ENTIER(double x) { LONGINT y; diff --git a/bootstrap/unix-44/SYSTEM.h b/bootstrap/unix-44/SYSTEM.h index 6fc57309..168b0beb 100644 --- a/bootstrap/unix-44/SYSTEM.h +++ b/bootstrap/unix-44/SYSTEM.h @@ -2,9 +2,17 @@ #define SYSTEM__h +// 64 bit system detection + +#if (__SIZEOF_POINTER__ == 8) || defined (_LP64) || defined(__LP64__) || defined(_WIN64) + #define __o_64 +#endif + +// Temporary while bootstrapping and clearing up SYSTEM.c. + #ifndef LONGINT - #if (__SIZEOF_POINTER__ == 8) || defined(_WIN64) + #if defined (__o_64) #define INTEGER int32 #define LONGINT int64 #define SET uint64 @@ -22,14 +30,17 @@ // Declare memcpy in a way compatible with C compilers intrinsic // built in implementations. -#if (__SIZEOF_POINTER__ == 8) || defined(_WIN64) || defined(__LP64__) +#if defined (__o_64) #if defined(_WIN64) typedef unsigned long long size_t; +// typedef long long address; #else typedef unsigned long size_t; +// typedef long address; #endif #else typedef unsigned int size_t; +//typedef int address; #endif #define _SIZE_T_DECLARED // For FreeBSD @@ -40,14 +51,14 @@ void *memcpy(void *dest, const void *source, size_t size); // Declare fixed size versions of basic intger types -#if (__SIZEOF_POINTER__ < 8) || defined(_WIN64) - // ILP32 or LLP64 - typedef long long int64; - typedef unsigned long long uint64; -#else +#if defined (__o_64) && !defined(_WIN64) // LP64 typedef long int64; typedef unsigned long uint64; +#else + // ILP32 or LLP64 + typedef long long int64; + typedef unsigned long long uint64; #endif typedef int int32; @@ -59,7 +70,14 @@ typedef unsigned short int uint16; typedef signed char int8; typedef unsigned char uint8; -#define address size_t + +// 'address' is a synonym for an int32 of pointer size + +#if defined (__o_64) + #define address int64 +#else + #define address int32 +#endif // The compiler uses 'import' and 'export' which translate to 'extern' and // nothing respectively. @@ -103,18 +121,40 @@ extern address Platform_OSAllocate (address size); extern void Platform_OSFree (address addr); +// Assertions and Halts + +extern void Platform_Halt(LONGINT x); +extern void Platform_AssertFail(LONGINT x); + +#define __HALT(x) Platform_Halt(x) +#define __ASSERT(cond, x) if (!(cond)) Platform_AssertFail((LONGINT)(x)) + + +// Index checking + +static inline int64 __XF(uint64 i, uint64 ub) {if (i >= ub) {__HALT(-2);} return i;} +#define __X(i, ub) (((uint64)(i)<(uint64)(ub))?i:(__HALT(-2),0)) + + +// Range checking, and checked SHORT and CHR functions + +static inline int64 __RF(uint64 i, uint64 ub) {if (i >= ub) {__HALT(-8);} return i;} +#define __R(i, ub) (((uint64)(i)<(uint64)(ub))?i:(__HALT(-8),0)) +#define __SHORT(x, ub) ((int)((uLONGINT)(x)+(ub)<(ub)+(ub)?(x):(__HALT(-8),0))) +#define __SHORTF(x, ub) ((int)(__RF((x)+(ub),(ub)+(ub))-(ub))) +#define __CHR(x) ((CHAR)__R(x, 256)) +#define __CHRF(x) ((CHAR)__RF(x, 256)) + + + // Run time system routines in SYSTEM.c -extern int64 SYSTEM_XCHK (uint64 i, uint64 ub); -extern int64 SYSTEM_RCHK (uint64 i, uint64 ub); -extern LONGINT SYSTEM_ASH (LONGINT i, LONGINT n); + extern LONGINT SYSTEM_ABS (LONGINT i); extern double SYSTEM_ABSD (double i); extern void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0); extern void SYSTEM_ENUMP (void *adr, LONGINT n, void (*P)()); extern void SYSTEM_ENUMR (void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()); -extern LONGINT SYSTEM_DIV (uint64 x, uint64 y); -extern LONGINT SYSTEM_MOD (uint64 x, uint64 y); extern LONGINT SYSTEM_ENTIER (double x); @@ -131,7 +171,7 @@ extern LONGINT SYSTEM_ENTIER (double x); // String comparison -static int __str_cmp(CHAR *x, CHAR *y){ +static inline int __str_cmp(CHAR *x, CHAR *y){ LONGINT i = 0; CHAR ch1, ch2; do {ch1 = x[i]; ch2 = y[i]; i++; @@ -152,21 +192,12 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __DEL(x) Platform_OSFree((address)x) -// Index and range checks - -#define __X(i, ub) (((uint64)(i)<(uint64)(ub))?i:(__HALT(-2),0)) -#define __XF(i, ub) SYSTEM_XCHK((uint64)(i), (uint64)(ub)) - -#define __R(i, ub) (((uint64)(i)<(uint64)(ub))?i:(__HALT(-8),0)) -#define __RF(i, ub) SYSTEM_RCHK((uint64)(i),(uint64)(ub)) - - /* SYSTEM ops */ #define __VAL(t, x) (*(t*)&(x)) -#define __GET(a, x, t) x= *(t*)(address)(a) +#define __GET(a, x, t) x=*(t*)(address)(a) #define __PUT(a, x, t) *(t*)(address)(a)=x #define __LSHL(x, n, t) ((t)((u##t)(x)<<(n))) @@ -177,21 +208,27 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __ROTR(x, n, t) ((t)((u##t)(x)>>(n)|(u##t)(x)<<(8*sizeof(t)-(n)))) #define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) -#define __ASHL(x, n) ((LONGINT)(x)<<(n)) -#define __ASHR(x, n) ((LONGINT)(x)>>(n)) +#define __ASHL(x, n) ((int64)(x)<<(n)) +#define __ASHR(x, n) ((int64)(x)>>(n)) #define __ASH(x, n) ((n)>=0?__ASHL(x,n):__ASHR(x,-(n))) -#define __ASHF(x, n) SYSTEM_ASH((LONGINT)(x), (LONGINT)(n)) +static inline int64 SYSTEM_ASH(int64 x, int64 n) {return __ASH(x,n);} +#define __ASHF(x, n) SYSTEM_ASH((int64)(x), (int64)(n)) #define __BIT(x, n) (*(uint64*)(x)>>(n)&1) #define __MOVE(s, d, n) memcpy((char*)(address)(d),(char*)(address)(s),n) -#define __SHORT(x, y) ((int)((uLONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) -#define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) -#define __CHR(x) ((CHAR)__R(x, 256)) -#define __CHRF(x) ((CHAR)__RF(x, 256)) -#define __DIV(x, y) ((x)>=0?(x)/(y):-(((y)-1-(x))/(y))) -#define __DIVF(x, y) SYSTEM_DIV((LONGINT)(x),(LONGINT)(y)) -#define __MOD(x, y) ((x)>=0?(x)%(y):__MODF(x,y)) -#define __MODF(x, y) SYSTEM_MOD((LONGINT)(x),(LONGINT)(y)) + + +extern int64 SYSTEM_DIV(int64 x, int64 y); +#define __DIVF(x, y) SYSTEM_DIV(x, y) +#define __DIV(x, y) (((x)>0 && (y)>0) ? (x)/(y) : __DIVF(x, y)) + + +extern int64 SYSTEM_MOD(int64 x, int64 y); +#define __MODF(x, y) SYSTEM_MOD(x, y) +#define __MOD(x, y) (((x)>0 && (y)>0) ? (x)%(y) : __MODF(x, y)) + + + #define __ENTIER(x) SYSTEM_ENTIER(x) #define __ABS(x) (((x)<0)?-(x):(x)) #define __ABSF(x) SYSTEM_ABS((LONGINT)(x)) @@ -244,15 +281,6 @@ extern void Heap_FINALL(); #define __FINI Heap_FINALL(); return 0 -// Assertions and Halts - -extern void Platform_Halt(LONGINT x); -extern void Platform_AssertFail(LONGINT x); - -#define __HALT(x) Platform_Halt(x) -#define __ASSERT(cond, x) if (!(cond)) Platform_AssertFail((LONGINT)(x)) - - // Memory allocation extern SYSTEM_PTR Heap_NEWBLK (address size); diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index 7e1a6845..af7a679b 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index 59076121..d145001a 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index 9314c178..ace0257e 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index ce868328..e52c65ca 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/Vishap.c b/bootstrap/unix-44/Vishap.c index 549268e2..b289dfa6 100644 --- a/bootstrap/unix-44/Vishap.c +++ b/bootstrap/unix-44/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkamSf */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/errors.c b/bootstrap/unix-44/errors.c index a2f7cf75..76fa35bf 100644 --- a/bootstrap/unix-44/errors.c +++ b/bootstrap/unix-44/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/errors.h b/bootstrap/unix-44/errors.h index bf0e9564..9d5bbe45 100644 --- a/bootstrap/unix-44/errors.h +++ b/bootstrap/unix-44/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index 27ef9f8f..3dbc28ba 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -64,7 +64,7 @@ void extTools_Assemble (CHAR *moduleName, LONGINT moduleName__len) { CHAR cmd[1023]; __DUP(moduleName, moduleName__len, CHAR); - __MOVE("gcc -g", cmd, 7); + __MOVE("gcc -g -O1", cmd, 11); Strings_Append(extTools_compilationOptions, 1023, (void*)cmd, 1023); Strings_Append((CHAR*)"-c ", 4, (void*)cmd, 1023); Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); @@ -77,7 +77,7 @@ void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN stati { CHAR cmd[1023]; __DUP(additionalopts, additionalopts__len, CHAR); - __MOVE("gcc -g", cmd, 7); + __MOVE("gcc -g -O1", cmd, 11); Strings_Append((CHAR*)" ", 2, (void*)cmd, 1023); Strings_Append(extTools_compilationOptions, 1023, (void*)cmd, 1023); Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index c5d5c772..8bdd3b71 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-44/vt100.c b/bootstrap/unix-44/vt100.c index 912e5e83..2e236578 100644 --- a/bootstrap/unix-44/vt100.c +++ b/bootstrap/unix-44/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/vt100.h b/bootstrap/unix-44/vt100.h index 36c0bc7e..0eae5799 100644 --- a/bootstrap/unix-44/vt100.h +++ b/bootstrap/unix-44/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index 115f8dec..5736ed9f 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/06] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/11] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index 84e8427b..31877f12 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Console.c b/bootstrap/unix-48/Console.c index 8cbc9ce9..6181cbfd 100644 --- a/bootstrap/unix-48/Console.c +++ b/bootstrap/unix-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Console.h b/bootstrap/unix-48/Console.h index e9913d2d..78586a68 100644 --- a/bootstrap/unix-48/Console.h +++ b/bootstrap/unix-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index d596986e..f98f4e55 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index b0f34806..de420c7c 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index 2bbe63b2..58be6181 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tskSfF */ #define INTEGER int16 #define LONGINT int32 @@ -353,7 +353,7 @@ static void Heap_Mark (address q) tag = tagbits + 4; for (;;) { __GET(tag, offset, address); - if (__BIT((address)&offset, 31)) { + if (offset < 0) { __PUT(q - 4, (tag + offset) + 1, address); if (p == 0) { break; diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index 6694ef70..827a3a7c 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index e31876fb..66a8c776 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index 4bd4082d..02abd713 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index 0a1a9f63..8d44024a 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index 5ffa3869..5aaa8469 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 5666c7cd..1122a8d0 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index e1fc08ec..1a9ad61f 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 461b5b85..e6d709e7 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index c60f6f98..c5192f5b 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index 1ab60658..6e2d4cd0 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index ce85af11..de48c5ba 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index 3a1c4787..9b3bf8f0 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index 512cfa75..8689aa3b 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 1983daf5..0d16f8ec 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index d3b24cc6..b9e46b1a 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index a62894dd..e36e3be5 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index b10704dc..c692efd8 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 43761270..b8559160 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index 0f9c0290..868c4e52 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 5f3d11a5..c9e8e867 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index cf931556..bd36f8d6 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/SYSTEM.c b/bootstrap/unix-48/SYSTEM.c index 821a6096..d7603f8e 100644 --- a/bootstrap/unix-48/SYSTEM.c +++ b/bootstrap/unix-48/SYSTEM.c @@ -21,11 +21,34 @@ // Procedure verions of SYSTEM.H versions used when a multiply accessed // parameter has side effects. -int64 SYSTEM_XCHK(uint64 i, uint64 ub) {return __X(i, ub);} -int64 SYSTEM_RCHK(uint64 i, uint64 ub) {return __R(i, ub);} -LONGINT SYSTEM_ASH (LONGINT i, LONGINT n) {return __ASH(i, n);} -LONGINT SYSTEM_ABS (LONGINT i) {return __ABS(i);} -double SYSTEM_ABSD(double i) {return __ABS(i);} + + +LONGINT SYSTEM_ABS (LONGINT i) {return __ABS(i);} +double SYSTEM_ABSD(double i) {return __ABS(i);} + + +int64 SYSTEM_DIV(int64 x, int64 y) +{ + if (x == 0) return 0; + if (x >= 0) + if (y >= 0) {return x/y;} + else {return -((x-y-1)/(-y));} + else + if (y >= 0) {return -((y-x-1)/y);} + else {return (-x)/(-y);} +} + +int64 SYSTEM_MOD(int64 x, int64 y) +{ + if (x == 0) return 0; + if (x >= 0) + if (y >= 0) {return x % y;} + else {return (y+1) + ((x-1) % (-y));} + else + if (y >= 0) {return (y-1) - ((-x-1) % y);} + else {return -((-x) % (-y));} +} + void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0) { @@ -57,19 +80,6 @@ void SYSTEM_ENUMR(void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()) } } -LONGINT SYSTEM_DIV(uint64 x, uint64 y) -{ if ((int64) x >= 0) return (x / y); - else return -((y - 1 - x) / y); -} - -LONGINT SYSTEM_MOD(uint64 x, uint64 y) -{ uint64 m; - if ((int64) x >= 0) return (x % y); - else { m = (-x) % y; - if (m != 0) return (y - m); else return 0; - } -} - LONGINT SYSTEM_ENTIER(double x) { LONGINT y; diff --git a/bootstrap/unix-48/SYSTEM.h b/bootstrap/unix-48/SYSTEM.h index 6fc57309..168b0beb 100644 --- a/bootstrap/unix-48/SYSTEM.h +++ b/bootstrap/unix-48/SYSTEM.h @@ -2,9 +2,17 @@ #define SYSTEM__h +// 64 bit system detection + +#if (__SIZEOF_POINTER__ == 8) || defined (_LP64) || defined(__LP64__) || defined(_WIN64) + #define __o_64 +#endif + +// Temporary while bootstrapping and clearing up SYSTEM.c. + #ifndef LONGINT - #if (__SIZEOF_POINTER__ == 8) || defined(_WIN64) + #if defined (__o_64) #define INTEGER int32 #define LONGINT int64 #define SET uint64 @@ -22,14 +30,17 @@ // Declare memcpy in a way compatible with C compilers intrinsic // built in implementations. -#if (__SIZEOF_POINTER__ == 8) || defined(_WIN64) || defined(__LP64__) +#if defined (__o_64) #if defined(_WIN64) typedef unsigned long long size_t; +// typedef long long address; #else typedef unsigned long size_t; +// typedef long address; #endif #else typedef unsigned int size_t; +//typedef int address; #endif #define _SIZE_T_DECLARED // For FreeBSD @@ -40,14 +51,14 @@ void *memcpy(void *dest, const void *source, size_t size); // Declare fixed size versions of basic intger types -#if (__SIZEOF_POINTER__ < 8) || defined(_WIN64) - // ILP32 or LLP64 - typedef long long int64; - typedef unsigned long long uint64; -#else +#if defined (__o_64) && !defined(_WIN64) // LP64 typedef long int64; typedef unsigned long uint64; +#else + // ILP32 or LLP64 + typedef long long int64; + typedef unsigned long long uint64; #endif typedef int int32; @@ -59,7 +70,14 @@ typedef unsigned short int uint16; typedef signed char int8; typedef unsigned char uint8; -#define address size_t + +// 'address' is a synonym for an int32 of pointer size + +#if defined (__o_64) + #define address int64 +#else + #define address int32 +#endif // The compiler uses 'import' and 'export' which translate to 'extern' and // nothing respectively. @@ -103,18 +121,40 @@ extern address Platform_OSAllocate (address size); extern void Platform_OSFree (address addr); +// Assertions and Halts + +extern void Platform_Halt(LONGINT x); +extern void Platform_AssertFail(LONGINT x); + +#define __HALT(x) Platform_Halt(x) +#define __ASSERT(cond, x) if (!(cond)) Platform_AssertFail((LONGINT)(x)) + + +// Index checking + +static inline int64 __XF(uint64 i, uint64 ub) {if (i >= ub) {__HALT(-2);} return i;} +#define __X(i, ub) (((uint64)(i)<(uint64)(ub))?i:(__HALT(-2),0)) + + +// Range checking, and checked SHORT and CHR functions + +static inline int64 __RF(uint64 i, uint64 ub) {if (i >= ub) {__HALT(-8);} return i;} +#define __R(i, ub) (((uint64)(i)<(uint64)(ub))?i:(__HALT(-8),0)) +#define __SHORT(x, ub) ((int)((uLONGINT)(x)+(ub)<(ub)+(ub)?(x):(__HALT(-8),0))) +#define __SHORTF(x, ub) ((int)(__RF((x)+(ub),(ub)+(ub))-(ub))) +#define __CHR(x) ((CHAR)__R(x, 256)) +#define __CHRF(x) ((CHAR)__RF(x, 256)) + + + // Run time system routines in SYSTEM.c -extern int64 SYSTEM_XCHK (uint64 i, uint64 ub); -extern int64 SYSTEM_RCHK (uint64 i, uint64 ub); -extern LONGINT SYSTEM_ASH (LONGINT i, LONGINT n); + extern LONGINT SYSTEM_ABS (LONGINT i); extern double SYSTEM_ABSD (double i); extern void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0); extern void SYSTEM_ENUMP (void *adr, LONGINT n, void (*P)()); extern void SYSTEM_ENUMR (void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()); -extern LONGINT SYSTEM_DIV (uint64 x, uint64 y); -extern LONGINT SYSTEM_MOD (uint64 x, uint64 y); extern LONGINT SYSTEM_ENTIER (double x); @@ -131,7 +171,7 @@ extern LONGINT SYSTEM_ENTIER (double x); // String comparison -static int __str_cmp(CHAR *x, CHAR *y){ +static inline int __str_cmp(CHAR *x, CHAR *y){ LONGINT i = 0; CHAR ch1, ch2; do {ch1 = x[i]; ch2 = y[i]; i++; @@ -152,21 +192,12 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __DEL(x) Platform_OSFree((address)x) -// Index and range checks - -#define __X(i, ub) (((uint64)(i)<(uint64)(ub))?i:(__HALT(-2),0)) -#define __XF(i, ub) SYSTEM_XCHK((uint64)(i), (uint64)(ub)) - -#define __R(i, ub) (((uint64)(i)<(uint64)(ub))?i:(__HALT(-8),0)) -#define __RF(i, ub) SYSTEM_RCHK((uint64)(i),(uint64)(ub)) - - /* SYSTEM ops */ #define __VAL(t, x) (*(t*)&(x)) -#define __GET(a, x, t) x= *(t*)(address)(a) +#define __GET(a, x, t) x=*(t*)(address)(a) #define __PUT(a, x, t) *(t*)(address)(a)=x #define __LSHL(x, n, t) ((t)((u##t)(x)<<(n))) @@ -177,21 +208,27 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __ROTR(x, n, t) ((t)((u##t)(x)>>(n)|(u##t)(x)<<(8*sizeof(t)-(n)))) #define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) -#define __ASHL(x, n) ((LONGINT)(x)<<(n)) -#define __ASHR(x, n) ((LONGINT)(x)>>(n)) +#define __ASHL(x, n) ((int64)(x)<<(n)) +#define __ASHR(x, n) ((int64)(x)>>(n)) #define __ASH(x, n) ((n)>=0?__ASHL(x,n):__ASHR(x,-(n))) -#define __ASHF(x, n) SYSTEM_ASH((LONGINT)(x), (LONGINT)(n)) +static inline int64 SYSTEM_ASH(int64 x, int64 n) {return __ASH(x,n);} +#define __ASHF(x, n) SYSTEM_ASH((int64)(x), (int64)(n)) #define __BIT(x, n) (*(uint64*)(x)>>(n)&1) #define __MOVE(s, d, n) memcpy((char*)(address)(d),(char*)(address)(s),n) -#define __SHORT(x, y) ((int)((uLONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) -#define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) -#define __CHR(x) ((CHAR)__R(x, 256)) -#define __CHRF(x) ((CHAR)__RF(x, 256)) -#define __DIV(x, y) ((x)>=0?(x)/(y):-(((y)-1-(x))/(y))) -#define __DIVF(x, y) SYSTEM_DIV((LONGINT)(x),(LONGINT)(y)) -#define __MOD(x, y) ((x)>=0?(x)%(y):__MODF(x,y)) -#define __MODF(x, y) SYSTEM_MOD((LONGINT)(x),(LONGINT)(y)) + + +extern int64 SYSTEM_DIV(int64 x, int64 y); +#define __DIVF(x, y) SYSTEM_DIV(x, y) +#define __DIV(x, y) (((x)>0 && (y)>0) ? (x)/(y) : __DIVF(x, y)) + + +extern int64 SYSTEM_MOD(int64 x, int64 y); +#define __MODF(x, y) SYSTEM_MOD(x, y) +#define __MOD(x, y) (((x)>0 && (y)>0) ? (x)%(y) : __MODF(x, y)) + + + #define __ENTIER(x) SYSTEM_ENTIER(x) #define __ABS(x) (((x)<0)?-(x):(x)) #define __ABSF(x) SYSTEM_ABS((LONGINT)(x)) @@ -244,15 +281,6 @@ extern void Heap_FINALL(); #define __FINI Heap_FINALL(); return 0 -// Assertions and Halts - -extern void Platform_Halt(LONGINT x); -extern void Platform_AssertFail(LONGINT x); - -#define __HALT(x) Platform_Halt(x) -#define __ASSERT(cond, x) if (!(cond)) Platform_AssertFail((LONGINT)(x)) - - // Memory allocation extern SYSTEM_PTR Heap_NEWBLK (address size); diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index 7e1a6845..af7a679b 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index 59076121..d145001a 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index a4267893..c40b975f 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index 2238689d..0aac4cc8 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/Vishap.c b/bootstrap/unix-48/Vishap.c index 549268e2..b289dfa6 100644 --- a/bootstrap/unix-48/Vishap.c +++ b/bootstrap/unix-48/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkamSf */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/errors.c b/bootstrap/unix-48/errors.c index a2f7cf75..76fa35bf 100644 --- a/bootstrap/unix-48/errors.c +++ b/bootstrap/unix-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/errors.h b/bootstrap/unix-48/errors.h index bf0e9564..9d5bbe45 100644 --- a/bootstrap/unix-48/errors.h +++ b/bootstrap/unix-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index 27ef9f8f..3dbc28ba 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -64,7 +64,7 @@ void extTools_Assemble (CHAR *moduleName, LONGINT moduleName__len) { CHAR cmd[1023]; __DUP(moduleName, moduleName__len, CHAR); - __MOVE("gcc -g", cmd, 7); + __MOVE("gcc -g -O1", cmd, 11); Strings_Append(extTools_compilationOptions, 1023, (void*)cmd, 1023); Strings_Append((CHAR*)"-c ", 4, (void*)cmd, 1023); Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); @@ -77,7 +77,7 @@ void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN stati { CHAR cmd[1023]; __DUP(additionalopts, additionalopts__len, CHAR); - __MOVE("gcc -g", cmd, 7); + __MOVE("gcc -g -O1", cmd, 11); Strings_Append((CHAR*)" ", 2, (void*)cmd, 1023); Strings_Append(extTools_compilationOptions, 1023, (void*)cmd, 1023); Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index c5d5c772..8bdd3b71 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/vt100.c b/bootstrap/unix-48/vt100.c index 912e5e83..2e236578 100644 --- a/bootstrap/unix-48/vt100.c +++ b/bootstrap/unix-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/vt100.h b/bootstrap/unix-48/vt100.h index 36c0bc7e..0eae5799 100644 --- a/bootstrap/unix-48/vt100.h +++ b/bootstrap/unix-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index cfce02b8..b5ee44a5 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/06] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/11] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index 84e8427b..31877f12 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Console.c b/bootstrap/unix-88/Console.c index 3dc7b5ab..74de0b0a 100644 --- a/bootstrap/unix-88/Console.c +++ b/bootstrap/unix-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Console.h b/bootstrap/unix-88/Console.h index 1f1182fd..1d06d0fe 100644 --- a/bootstrap/unix-88/Console.h +++ b/bootstrap/unix-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 29b0069e..aabcb14d 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 60221720..054cde33 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index 1fe3ce13..d0175b87 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tskSfF */ #define INTEGER int32 #define LONGINT int64 @@ -353,7 +353,7 @@ static void Heap_Mark (address q) tag = tagbits + 8; for (;;) { __GET(tag, offset, address); - if (__BIT((address)&offset, 63)) { + if (offset < 0) { __PUT(q - 8, (tag + offset) + 1, address); if (p == 0) { break; diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index def46dcf..fabb54ef 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 9d93e3d2..53bf2640 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index f9e49aa7..8e54ce53 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index 11b9a1a9..f22a9ab5 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index c3c5c1e8..aa26ea1c 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index e971762c..8916c00b 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index a218490a..71b95812 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 389fda93..b15aba16 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index 51042a0e..d23aed25 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index 9ab86b22..3f77df4f 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index ce85af11..de48c5ba 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index 8e53d027..491faa22 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index ffbc5084..3937b6f6 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index bd27c789..da8bab08 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 583c31ff..668c3d79 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 2d81dd31..52fc9966 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index b10704dc..c692efd8 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 70c9bcb7..9142bf02 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index 1ffe3227..e52525fd 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 0b5761ee..185aec0b 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index dfc56cef..a2fc2612 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/SYSTEM.c b/bootstrap/unix-88/SYSTEM.c index 821a6096..d7603f8e 100644 --- a/bootstrap/unix-88/SYSTEM.c +++ b/bootstrap/unix-88/SYSTEM.c @@ -21,11 +21,34 @@ // Procedure verions of SYSTEM.H versions used when a multiply accessed // parameter has side effects. -int64 SYSTEM_XCHK(uint64 i, uint64 ub) {return __X(i, ub);} -int64 SYSTEM_RCHK(uint64 i, uint64 ub) {return __R(i, ub);} -LONGINT SYSTEM_ASH (LONGINT i, LONGINT n) {return __ASH(i, n);} -LONGINT SYSTEM_ABS (LONGINT i) {return __ABS(i);} -double SYSTEM_ABSD(double i) {return __ABS(i);} + + +LONGINT SYSTEM_ABS (LONGINT i) {return __ABS(i);} +double SYSTEM_ABSD(double i) {return __ABS(i);} + + +int64 SYSTEM_DIV(int64 x, int64 y) +{ + if (x == 0) return 0; + if (x >= 0) + if (y >= 0) {return x/y;} + else {return -((x-y-1)/(-y));} + else + if (y >= 0) {return -((y-x-1)/y);} + else {return (-x)/(-y);} +} + +int64 SYSTEM_MOD(int64 x, int64 y) +{ + if (x == 0) return 0; + if (x >= 0) + if (y >= 0) {return x % y;} + else {return (y+1) + ((x-1) % (-y));} + else + if (y >= 0) {return (y-1) - ((-x-1) % y);} + else {return -((-x) % (-y));} +} + void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0) { @@ -57,19 +80,6 @@ void SYSTEM_ENUMR(void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()) } } -LONGINT SYSTEM_DIV(uint64 x, uint64 y) -{ if ((int64) x >= 0) return (x / y); - else return -((y - 1 - x) / y); -} - -LONGINT SYSTEM_MOD(uint64 x, uint64 y) -{ uint64 m; - if ((int64) x >= 0) return (x % y); - else { m = (-x) % y; - if (m != 0) return (y - m); else return 0; - } -} - LONGINT SYSTEM_ENTIER(double x) { LONGINT y; diff --git a/bootstrap/unix-88/SYSTEM.h b/bootstrap/unix-88/SYSTEM.h index 6fc57309..168b0beb 100644 --- a/bootstrap/unix-88/SYSTEM.h +++ b/bootstrap/unix-88/SYSTEM.h @@ -2,9 +2,17 @@ #define SYSTEM__h +// 64 bit system detection + +#if (__SIZEOF_POINTER__ == 8) || defined (_LP64) || defined(__LP64__) || defined(_WIN64) + #define __o_64 +#endif + +// Temporary while bootstrapping and clearing up SYSTEM.c. + #ifndef LONGINT - #if (__SIZEOF_POINTER__ == 8) || defined(_WIN64) + #if defined (__o_64) #define INTEGER int32 #define LONGINT int64 #define SET uint64 @@ -22,14 +30,17 @@ // Declare memcpy in a way compatible with C compilers intrinsic // built in implementations. -#if (__SIZEOF_POINTER__ == 8) || defined(_WIN64) || defined(__LP64__) +#if defined (__o_64) #if defined(_WIN64) typedef unsigned long long size_t; +// typedef long long address; #else typedef unsigned long size_t; +// typedef long address; #endif #else typedef unsigned int size_t; +//typedef int address; #endif #define _SIZE_T_DECLARED // For FreeBSD @@ -40,14 +51,14 @@ void *memcpy(void *dest, const void *source, size_t size); // Declare fixed size versions of basic intger types -#if (__SIZEOF_POINTER__ < 8) || defined(_WIN64) - // ILP32 or LLP64 - typedef long long int64; - typedef unsigned long long uint64; -#else +#if defined (__o_64) && !defined(_WIN64) // LP64 typedef long int64; typedef unsigned long uint64; +#else + // ILP32 or LLP64 + typedef long long int64; + typedef unsigned long long uint64; #endif typedef int int32; @@ -59,7 +70,14 @@ typedef unsigned short int uint16; typedef signed char int8; typedef unsigned char uint8; -#define address size_t + +// 'address' is a synonym for an int32 of pointer size + +#if defined (__o_64) + #define address int64 +#else + #define address int32 +#endif // The compiler uses 'import' and 'export' which translate to 'extern' and // nothing respectively. @@ -103,18 +121,40 @@ extern address Platform_OSAllocate (address size); extern void Platform_OSFree (address addr); +// Assertions and Halts + +extern void Platform_Halt(LONGINT x); +extern void Platform_AssertFail(LONGINT x); + +#define __HALT(x) Platform_Halt(x) +#define __ASSERT(cond, x) if (!(cond)) Platform_AssertFail((LONGINT)(x)) + + +// Index checking + +static inline int64 __XF(uint64 i, uint64 ub) {if (i >= ub) {__HALT(-2);} return i;} +#define __X(i, ub) (((uint64)(i)<(uint64)(ub))?i:(__HALT(-2),0)) + + +// Range checking, and checked SHORT and CHR functions + +static inline int64 __RF(uint64 i, uint64 ub) {if (i >= ub) {__HALT(-8);} return i;} +#define __R(i, ub) (((uint64)(i)<(uint64)(ub))?i:(__HALT(-8),0)) +#define __SHORT(x, ub) ((int)((uLONGINT)(x)+(ub)<(ub)+(ub)?(x):(__HALT(-8),0))) +#define __SHORTF(x, ub) ((int)(__RF((x)+(ub),(ub)+(ub))-(ub))) +#define __CHR(x) ((CHAR)__R(x, 256)) +#define __CHRF(x) ((CHAR)__RF(x, 256)) + + + // Run time system routines in SYSTEM.c -extern int64 SYSTEM_XCHK (uint64 i, uint64 ub); -extern int64 SYSTEM_RCHK (uint64 i, uint64 ub); -extern LONGINT SYSTEM_ASH (LONGINT i, LONGINT n); + extern LONGINT SYSTEM_ABS (LONGINT i); extern double SYSTEM_ABSD (double i); extern void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0); extern void SYSTEM_ENUMP (void *adr, LONGINT n, void (*P)()); extern void SYSTEM_ENUMR (void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()); -extern LONGINT SYSTEM_DIV (uint64 x, uint64 y); -extern LONGINT SYSTEM_MOD (uint64 x, uint64 y); extern LONGINT SYSTEM_ENTIER (double x); @@ -131,7 +171,7 @@ extern LONGINT SYSTEM_ENTIER (double x); // String comparison -static int __str_cmp(CHAR *x, CHAR *y){ +static inline int __str_cmp(CHAR *x, CHAR *y){ LONGINT i = 0; CHAR ch1, ch2; do {ch1 = x[i]; ch2 = y[i]; i++; @@ -152,21 +192,12 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __DEL(x) Platform_OSFree((address)x) -// Index and range checks - -#define __X(i, ub) (((uint64)(i)<(uint64)(ub))?i:(__HALT(-2),0)) -#define __XF(i, ub) SYSTEM_XCHK((uint64)(i), (uint64)(ub)) - -#define __R(i, ub) (((uint64)(i)<(uint64)(ub))?i:(__HALT(-8),0)) -#define __RF(i, ub) SYSTEM_RCHK((uint64)(i),(uint64)(ub)) - - /* SYSTEM ops */ #define __VAL(t, x) (*(t*)&(x)) -#define __GET(a, x, t) x= *(t*)(address)(a) +#define __GET(a, x, t) x=*(t*)(address)(a) #define __PUT(a, x, t) *(t*)(address)(a)=x #define __LSHL(x, n, t) ((t)((u##t)(x)<<(n))) @@ -177,21 +208,27 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __ROTR(x, n, t) ((t)((u##t)(x)>>(n)|(u##t)(x)<<(8*sizeof(t)-(n)))) #define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) -#define __ASHL(x, n) ((LONGINT)(x)<<(n)) -#define __ASHR(x, n) ((LONGINT)(x)>>(n)) +#define __ASHL(x, n) ((int64)(x)<<(n)) +#define __ASHR(x, n) ((int64)(x)>>(n)) #define __ASH(x, n) ((n)>=0?__ASHL(x,n):__ASHR(x,-(n))) -#define __ASHF(x, n) SYSTEM_ASH((LONGINT)(x), (LONGINT)(n)) +static inline int64 SYSTEM_ASH(int64 x, int64 n) {return __ASH(x,n);} +#define __ASHF(x, n) SYSTEM_ASH((int64)(x), (int64)(n)) #define __BIT(x, n) (*(uint64*)(x)>>(n)&1) #define __MOVE(s, d, n) memcpy((char*)(address)(d),(char*)(address)(s),n) -#define __SHORT(x, y) ((int)((uLONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) -#define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) -#define __CHR(x) ((CHAR)__R(x, 256)) -#define __CHRF(x) ((CHAR)__RF(x, 256)) -#define __DIV(x, y) ((x)>=0?(x)/(y):-(((y)-1-(x))/(y))) -#define __DIVF(x, y) SYSTEM_DIV((LONGINT)(x),(LONGINT)(y)) -#define __MOD(x, y) ((x)>=0?(x)%(y):__MODF(x,y)) -#define __MODF(x, y) SYSTEM_MOD((LONGINT)(x),(LONGINT)(y)) + + +extern int64 SYSTEM_DIV(int64 x, int64 y); +#define __DIVF(x, y) SYSTEM_DIV(x, y) +#define __DIV(x, y) (((x)>0 && (y)>0) ? (x)/(y) : __DIVF(x, y)) + + +extern int64 SYSTEM_MOD(int64 x, int64 y); +#define __MODF(x, y) SYSTEM_MOD(x, y) +#define __MOD(x, y) (((x)>0 && (y)>0) ? (x)%(y) : __MODF(x, y)) + + + #define __ENTIER(x) SYSTEM_ENTIER(x) #define __ABS(x) (((x)<0)?-(x):(x)) #define __ABSF(x) SYSTEM_ABS((LONGINT)(x)) @@ -244,15 +281,6 @@ extern void Heap_FINALL(); #define __FINI Heap_FINALL(); return 0 -// Assertions and Halts - -extern void Platform_Halt(LONGINT x); -extern void Platform_AssertFail(LONGINT x); - -#define __HALT(x) Platform_Halt(x) -#define __ASSERT(cond, x) if (!(cond)) Platform_AssertFail((LONGINT)(x)) - - // Memory allocation extern SYSTEM_PTR Heap_NEWBLK (address size); diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index 39f247ba..d4ecf06e 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index 2c6a801d..b664568e 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index a78b77bb..b3c1a3bf 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index 7156eb22..116ee5e3 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/Vishap.c b/bootstrap/unix-88/Vishap.c index 46a95ea9..a04ca149 100644 --- a/bootstrap/unix-88/Vishap.c +++ b/bootstrap/unix-88/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkamSf */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/errors.c b/bootstrap/unix-88/errors.c index 9c9ed747..5dba1a33 100644 --- a/bootstrap/unix-88/errors.c +++ b/bootstrap/unix-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/errors.h b/bootstrap/unix-88/errors.h index bf0e9564..9d5bbe45 100644 --- a/bootstrap/unix-88/errors.h +++ b/bootstrap/unix-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index c3dc490a..1080b9a3 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -64,7 +64,7 @@ void extTools_Assemble (CHAR *moduleName, LONGINT moduleName__len) { CHAR cmd[1023]; __DUP(moduleName, moduleName__len, CHAR); - __MOVE("gcc -g", cmd, 7); + __MOVE("gcc -g -O1", cmd, 11); Strings_Append(extTools_compilationOptions, 1023, (void*)cmd, 1023); Strings_Append((CHAR*)"-c ", 4, (void*)cmd, 1023); Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); @@ -77,7 +77,7 @@ void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN stati { CHAR cmd[1023]; __DUP(additionalopts, additionalopts__len, CHAR); - __MOVE("gcc -g", cmd, 7); + __MOVE("gcc -g -O1", cmd, 11); Strings_Append((CHAR*)" ", 2, (void*)cmd, 1023); Strings_Append(extTools_compilationOptions, 1023, (void*)cmd, 1023); Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index c5d5c772..8bdd3b71 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/vt100.c b/bootstrap/unix-88/vt100.c index fac0e0ba..3efc2842 100644 --- a/bootstrap/unix-88/vt100.c +++ b/bootstrap/unix-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/vt100.h b/bootstrap/unix-88/vt100.h index c2ebcd84..71738164 100644 --- a/bootstrap/unix-88/vt100.h +++ b/bootstrap/unix-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index 115f8dec..5736ed9f 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/06] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/11] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index 84e8427b..31877f12 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Console.c b/bootstrap/windows-48/Console.c index 0b87cb07..111663dc 100644 --- a/bootstrap/windows-48/Console.c +++ b/bootstrap/windows-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Console.h b/bootstrap/windows-48/Console.h index e9913d2d..78586a68 100644 --- a/bootstrap/windows-48/Console.h +++ b/bootstrap/windows-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 930aa8c9..b50a99c2 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index 55b2a130..54236cf4 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index 2bbe63b2..58be6181 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tskSfF */ #define INTEGER int16 #define LONGINT int32 @@ -353,7 +353,7 @@ static void Heap_Mark (address q) tag = tagbits + 4; for (;;) { __GET(tag, offset, address); - if (__BIT((address)&offset, 31)) { + if (offset < 0) { __PUT(q - 4, (tag + offset) + 1, address); if (p == 0) { break; diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index 6694ef70..827a3a7c 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index e31876fb..66a8c776 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index 4bd4082d..02abd713 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index 0a1a9f63..8d44024a 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index 5ffa3869..5aaa8469 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 5666c7cd..1122a8d0 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index e1fc08ec..1a9ad61f 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 461b5b85..e6d709e7 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index c60f6f98..c5192f5b 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index 1ab60658..6e2d4cd0 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index ce85af11..de48c5ba 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index 3a1c4787..9b3bf8f0 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index 512cfa75..8689aa3b 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 1983daf5..0d16f8ec 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index d3b24cc6..b9e46b1a 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index a62894dd..e36e3be5 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index b10704dc..c692efd8 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index bdf72323..777ee3b8 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index d1466be1..587135b3 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 5f3d11a5..c9e8e867 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index cf931556..bd36f8d6 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/SYSTEM.c b/bootstrap/windows-48/SYSTEM.c index 821a6096..d7603f8e 100644 --- a/bootstrap/windows-48/SYSTEM.c +++ b/bootstrap/windows-48/SYSTEM.c @@ -21,11 +21,34 @@ // Procedure verions of SYSTEM.H versions used when a multiply accessed // parameter has side effects. -int64 SYSTEM_XCHK(uint64 i, uint64 ub) {return __X(i, ub);} -int64 SYSTEM_RCHK(uint64 i, uint64 ub) {return __R(i, ub);} -LONGINT SYSTEM_ASH (LONGINT i, LONGINT n) {return __ASH(i, n);} -LONGINT SYSTEM_ABS (LONGINT i) {return __ABS(i);} -double SYSTEM_ABSD(double i) {return __ABS(i);} + + +LONGINT SYSTEM_ABS (LONGINT i) {return __ABS(i);} +double SYSTEM_ABSD(double i) {return __ABS(i);} + + +int64 SYSTEM_DIV(int64 x, int64 y) +{ + if (x == 0) return 0; + if (x >= 0) + if (y >= 0) {return x/y;} + else {return -((x-y-1)/(-y));} + else + if (y >= 0) {return -((y-x-1)/y);} + else {return (-x)/(-y);} +} + +int64 SYSTEM_MOD(int64 x, int64 y) +{ + if (x == 0) return 0; + if (x >= 0) + if (y >= 0) {return x % y;} + else {return (y+1) + ((x-1) % (-y));} + else + if (y >= 0) {return (y-1) - ((-x-1) % y);} + else {return -((-x) % (-y));} +} + void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0) { @@ -57,19 +80,6 @@ void SYSTEM_ENUMR(void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()) } } -LONGINT SYSTEM_DIV(uint64 x, uint64 y) -{ if ((int64) x >= 0) return (x / y); - else return -((y - 1 - x) / y); -} - -LONGINT SYSTEM_MOD(uint64 x, uint64 y) -{ uint64 m; - if ((int64) x >= 0) return (x % y); - else { m = (-x) % y; - if (m != 0) return (y - m); else return 0; - } -} - LONGINT SYSTEM_ENTIER(double x) { LONGINT y; diff --git a/bootstrap/windows-48/SYSTEM.h b/bootstrap/windows-48/SYSTEM.h index 6fc57309..168b0beb 100644 --- a/bootstrap/windows-48/SYSTEM.h +++ b/bootstrap/windows-48/SYSTEM.h @@ -2,9 +2,17 @@ #define SYSTEM__h +// 64 bit system detection + +#if (__SIZEOF_POINTER__ == 8) || defined (_LP64) || defined(__LP64__) || defined(_WIN64) + #define __o_64 +#endif + +// Temporary while bootstrapping and clearing up SYSTEM.c. + #ifndef LONGINT - #if (__SIZEOF_POINTER__ == 8) || defined(_WIN64) + #if defined (__o_64) #define INTEGER int32 #define LONGINT int64 #define SET uint64 @@ -22,14 +30,17 @@ // Declare memcpy in a way compatible with C compilers intrinsic // built in implementations. -#if (__SIZEOF_POINTER__ == 8) || defined(_WIN64) || defined(__LP64__) +#if defined (__o_64) #if defined(_WIN64) typedef unsigned long long size_t; +// typedef long long address; #else typedef unsigned long size_t; +// typedef long address; #endif #else typedef unsigned int size_t; +//typedef int address; #endif #define _SIZE_T_DECLARED // For FreeBSD @@ -40,14 +51,14 @@ void *memcpy(void *dest, const void *source, size_t size); // Declare fixed size versions of basic intger types -#if (__SIZEOF_POINTER__ < 8) || defined(_WIN64) - // ILP32 or LLP64 - typedef long long int64; - typedef unsigned long long uint64; -#else +#if defined (__o_64) && !defined(_WIN64) // LP64 typedef long int64; typedef unsigned long uint64; +#else + // ILP32 or LLP64 + typedef long long int64; + typedef unsigned long long uint64; #endif typedef int int32; @@ -59,7 +70,14 @@ typedef unsigned short int uint16; typedef signed char int8; typedef unsigned char uint8; -#define address size_t + +// 'address' is a synonym for an int32 of pointer size + +#if defined (__o_64) + #define address int64 +#else + #define address int32 +#endif // The compiler uses 'import' and 'export' which translate to 'extern' and // nothing respectively. @@ -103,18 +121,40 @@ extern address Platform_OSAllocate (address size); extern void Platform_OSFree (address addr); +// Assertions and Halts + +extern void Platform_Halt(LONGINT x); +extern void Platform_AssertFail(LONGINT x); + +#define __HALT(x) Platform_Halt(x) +#define __ASSERT(cond, x) if (!(cond)) Platform_AssertFail((LONGINT)(x)) + + +// Index checking + +static inline int64 __XF(uint64 i, uint64 ub) {if (i >= ub) {__HALT(-2);} return i;} +#define __X(i, ub) (((uint64)(i)<(uint64)(ub))?i:(__HALT(-2),0)) + + +// Range checking, and checked SHORT and CHR functions + +static inline int64 __RF(uint64 i, uint64 ub) {if (i >= ub) {__HALT(-8);} return i;} +#define __R(i, ub) (((uint64)(i)<(uint64)(ub))?i:(__HALT(-8),0)) +#define __SHORT(x, ub) ((int)((uLONGINT)(x)+(ub)<(ub)+(ub)?(x):(__HALT(-8),0))) +#define __SHORTF(x, ub) ((int)(__RF((x)+(ub),(ub)+(ub))-(ub))) +#define __CHR(x) ((CHAR)__R(x, 256)) +#define __CHRF(x) ((CHAR)__RF(x, 256)) + + + // Run time system routines in SYSTEM.c -extern int64 SYSTEM_XCHK (uint64 i, uint64 ub); -extern int64 SYSTEM_RCHK (uint64 i, uint64 ub); -extern LONGINT SYSTEM_ASH (LONGINT i, LONGINT n); + extern LONGINT SYSTEM_ABS (LONGINT i); extern double SYSTEM_ABSD (double i); extern void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0); extern void SYSTEM_ENUMP (void *adr, LONGINT n, void (*P)()); extern void SYSTEM_ENUMR (void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()); -extern LONGINT SYSTEM_DIV (uint64 x, uint64 y); -extern LONGINT SYSTEM_MOD (uint64 x, uint64 y); extern LONGINT SYSTEM_ENTIER (double x); @@ -131,7 +171,7 @@ extern LONGINT SYSTEM_ENTIER (double x); // String comparison -static int __str_cmp(CHAR *x, CHAR *y){ +static inline int __str_cmp(CHAR *x, CHAR *y){ LONGINT i = 0; CHAR ch1, ch2; do {ch1 = x[i]; ch2 = y[i]; i++; @@ -152,21 +192,12 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __DEL(x) Platform_OSFree((address)x) -// Index and range checks - -#define __X(i, ub) (((uint64)(i)<(uint64)(ub))?i:(__HALT(-2),0)) -#define __XF(i, ub) SYSTEM_XCHK((uint64)(i), (uint64)(ub)) - -#define __R(i, ub) (((uint64)(i)<(uint64)(ub))?i:(__HALT(-8),0)) -#define __RF(i, ub) SYSTEM_RCHK((uint64)(i),(uint64)(ub)) - - /* SYSTEM ops */ #define __VAL(t, x) (*(t*)&(x)) -#define __GET(a, x, t) x= *(t*)(address)(a) +#define __GET(a, x, t) x=*(t*)(address)(a) #define __PUT(a, x, t) *(t*)(address)(a)=x #define __LSHL(x, n, t) ((t)((u##t)(x)<<(n))) @@ -177,21 +208,27 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __ROTR(x, n, t) ((t)((u##t)(x)>>(n)|(u##t)(x)<<(8*sizeof(t)-(n)))) #define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) -#define __ASHL(x, n) ((LONGINT)(x)<<(n)) -#define __ASHR(x, n) ((LONGINT)(x)>>(n)) +#define __ASHL(x, n) ((int64)(x)<<(n)) +#define __ASHR(x, n) ((int64)(x)>>(n)) #define __ASH(x, n) ((n)>=0?__ASHL(x,n):__ASHR(x,-(n))) -#define __ASHF(x, n) SYSTEM_ASH((LONGINT)(x), (LONGINT)(n)) +static inline int64 SYSTEM_ASH(int64 x, int64 n) {return __ASH(x,n);} +#define __ASHF(x, n) SYSTEM_ASH((int64)(x), (int64)(n)) #define __BIT(x, n) (*(uint64*)(x)>>(n)&1) #define __MOVE(s, d, n) memcpy((char*)(address)(d),(char*)(address)(s),n) -#define __SHORT(x, y) ((int)((uLONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) -#define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) -#define __CHR(x) ((CHAR)__R(x, 256)) -#define __CHRF(x) ((CHAR)__RF(x, 256)) -#define __DIV(x, y) ((x)>=0?(x)/(y):-(((y)-1-(x))/(y))) -#define __DIVF(x, y) SYSTEM_DIV((LONGINT)(x),(LONGINT)(y)) -#define __MOD(x, y) ((x)>=0?(x)%(y):__MODF(x,y)) -#define __MODF(x, y) SYSTEM_MOD((LONGINT)(x),(LONGINT)(y)) + + +extern int64 SYSTEM_DIV(int64 x, int64 y); +#define __DIVF(x, y) SYSTEM_DIV(x, y) +#define __DIV(x, y) (((x)>0 && (y)>0) ? (x)/(y) : __DIVF(x, y)) + + +extern int64 SYSTEM_MOD(int64 x, int64 y); +#define __MODF(x, y) SYSTEM_MOD(x, y) +#define __MOD(x, y) (((x)>0 && (y)>0) ? (x)%(y) : __MODF(x, y)) + + + #define __ENTIER(x) SYSTEM_ENTIER(x) #define __ABS(x) (((x)<0)?-(x):(x)) #define __ABSF(x) SYSTEM_ABS((LONGINT)(x)) @@ -244,15 +281,6 @@ extern void Heap_FINALL(); #define __FINI Heap_FINALL(); return 0 -// Assertions and Halts - -extern void Platform_Halt(LONGINT x); -extern void Platform_AssertFail(LONGINT x); - -#define __HALT(x) Platform_Halt(x) -#define __ASSERT(cond, x) if (!(cond)) Platform_AssertFail((LONGINT)(x)) - - // Memory allocation extern SYSTEM_PTR Heap_NEWBLK (address size); diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index 7e1a6845..af7a679b 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index 59076121..d145001a 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index a4267893..c40b975f 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index 2238689d..0aac4cc8 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/Vishap.c b/bootstrap/windows-48/Vishap.c index 549268e2..b289dfa6 100644 --- a/bootstrap/windows-48/Vishap.c +++ b/bootstrap/windows-48/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkamSf */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/errors.c b/bootstrap/windows-48/errors.c index a2f7cf75..76fa35bf 100644 --- a/bootstrap/windows-48/errors.c +++ b/bootstrap/windows-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/errors.h b/bootstrap/windows-48/errors.h index bf0e9564..9d5bbe45 100644 --- a/bootstrap/windows-48/errors.h +++ b/bootstrap/windows-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index 27ef9f8f..3dbc28ba 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -64,7 +64,7 @@ void extTools_Assemble (CHAR *moduleName, LONGINT moduleName__len) { CHAR cmd[1023]; __DUP(moduleName, moduleName__len, CHAR); - __MOVE("gcc -g", cmd, 7); + __MOVE("gcc -g -O1", cmd, 11); Strings_Append(extTools_compilationOptions, 1023, (void*)cmd, 1023); Strings_Append((CHAR*)"-c ", 4, (void*)cmd, 1023); Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); @@ -77,7 +77,7 @@ void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN stati { CHAR cmd[1023]; __DUP(additionalopts, additionalopts__len, CHAR); - __MOVE("gcc -g", cmd, 7); + __MOVE("gcc -g -O1", cmd, 11); Strings_Append((CHAR*)" ", 2, (void*)cmd, 1023); Strings_Append(extTools_compilationOptions, 1023, (void*)cmd, 1023); Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index c5d5c772..8bdd3b71 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/vt100.c b/bootstrap/windows-48/vt100.c index 912e5e83..2e236578 100644 --- a/bootstrap/windows-48/vt100.c +++ b/bootstrap/windows-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/vt100.h b/bootstrap/windows-48/vt100.h index 36c0bc7e..0eae5799 100644 --- a/bootstrap/windows-48/vt100.h +++ b/bootstrap/windows-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index cfce02b8..b5ee44a5 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/06] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/11] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index 84e8427b..31877f12 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Console.c b/bootstrap/windows-88/Console.c index c9058a13..e24d169a 100644 --- a/bootstrap/windows-88/Console.c +++ b/bootstrap/windows-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Console.h b/bootstrap/windows-88/Console.h index 1f1182fd..1d06d0fe 100644 --- a/bootstrap/windows-88/Console.h +++ b/bootstrap/windows-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 61842215..0f262baa 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 2c581e47..58cb3b1e 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index 1fe3ce13..d0175b87 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tskSfF */ #define INTEGER int32 #define LONGINT int64 @@ -353,7 +353,7 @@ static void Heap_Mark (address q) tag = tagbits + 8; for (;;) { __GET(tag, offset, address); - if (__BIT((address)&offset, 63)) { + if (offset < 0) { __PUT(q - 8, (tag + offset) + 1, address); if (p == 0) { break; diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index def46dcf..fabb54ef 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 9d93e3d2..53bf2640 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index f9e49aa7..8e54ce53 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index 11b9a1a9..f22a9ab5 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index c3c5c1e8..aa26ea1c 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index e971762c..8916c00b 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index a218490a..71b95812 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 389fda93..b15aba16 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index 51042a0e..d23aed25 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index 9ab86b22..3f77df4f 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index ce85af11..de48c5ba 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index 8e53d027..491faa22 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index ffbc5084..3937b6f6 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index bd27c789..da8bab08 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 583c31ff..668c3d79 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 2d81dd31..52fc9966 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index b10704dc..c692efd8 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index dda7a46a..b862e3ee 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index 472cf2f1..d74f41bc 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 0b5761ee..185aec0b 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index dfc56cef..a2fc2612 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/SYSTEM.c b/bootstrap/windows-88/SYSTEM.c index 821a6096..d7603f8e 100644 --- a/bootstrap/windows-88/SYSTEM.c +++ b/bootstrap/windows-88/SYSTEM.c @@ -21,11 +21,34 @@ // Procedure verions of SYSTEM.H versions used when a multiply accessed // parameter has side effects. -int64 SYSTEM_XCHK(uint64 i, uint64 ub) {return __X(i, ub);} -int64 SYSTEM_RCHK(uint64 i, uint64 ub) {return __R(i, ub);} -LONGINT SYSTEM_ASH (LONGINT i, LONGINT n) {return __ASH(i, n);} -LONGINT SYSTEM_ABS (LONGINT i) {return __ABS(i);} -double SYSTEM_ABSD(double i) {return __ABS(i);} + + +LONGINT SYSTEM_ABS (LONGINT i) {return __ABS(i);} +double SYSTEM_ABSD(double i) {return __ABS(i);} + + +int64 SYSTEM_DIV(int64 x, int64 y) +{ + if (x == 0) return 0; + if (x >= 0) + if (y >= 0) {return x/y;} + else {return -((x-y-1)/(-y));} + else + if (y >= 0) {return -((y-x-1)/y);} + else {return (-x)/(-y);} +} + +int64 SYSTEM_MOD(int64 x, int64 y) +{ + if (x == 0) return 0; + if (x >= 0) + if (y >= 0) {return x % y;} + else {return (y+1) + ((x-1) % (-y));} + else + if (y >= 0) {return (y-1) - ((-x-1) % y);} + else {return -((-x) % (-y));} +} + void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0) { @@ -57,19 +80,6 @@ void SYSTEM_ENUMR(void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()) } } -LONGINT SYSTEM_DIV(uint64 x, uint64 y) -{ if ((int64) x >= 0) return (x / y); - else return -((y - 1 - x) / y); -} - -LONGINT SYSTEM_MOD(uint64 x, uint64 y) -{ uint64 m; - if ((int64) x >= 0) return (x % y); - else { m = (-x) % y; - if (m != 0) return (y - m); else return 0; - } -} - LONGINT SYSTEM_ENTIER(double x) { LONGINT y; diff --git a/bootstrap/windows-88/SYSTEM.h b/bootstrap/windows-88/SYSTEM.h index 6fc57309..168b0beb 100644 --- a/bootstrap/windows-88/SYSTEM.h +++ b/bootstrap/windows-88/SYSTEM.h @@ -2,9 +2,17 @@ #define SYSTEM__h +// 64 bit system detection + +#if (__SIZEOF_POINTER__ == 8) || defined (_LP64) || defined(__LP64__) || defined(_WIN64) + #define __o_64 +#endif + +// Temporary while bootstrapping and clearing up SYSTEM.c. + #ifndef LONGINT - #if (__SIZEOF_POINTER__ == 8) || defined(_WIN64) + #if defined (__o_64) #define INTEGER int32 #define LONGINT int64 #define SET uint64 @@ -22,14 +30,17 @@ // Declare memcpy in a way compatible with C compilers intrinsic // built in implementations. -#if (__SIZEOF_POINTER__ == 8) || defined(_WIN64) || defined(__LP64__) +#if defined (__o_64) #if defined(_WIN64) typedef unsigned long long size_t; +// typedef long long address; #else typedef unsigned long size_t; +// typedef long address; #endif #else typedef unsigned int size_t; +//typedef int address; #endif #define _SIZE_T_DECLARED // For FreeBSD @@ -40,14 +51,14 @@ void *memcpy(void *dest, const void *source, size_t size); // Declare fixed size versions of basic intger types -#if (__SIZEOF_POINTER__ < 8) || defined(_WIN64) - // ILP32 or LLP64 - typedef long long int64; - typedef unsigned long long uint64; -#else +#if defined (__o_64) && !defined(_WIN64) // LP64 typedef long int64; typedef unsigned long uint64; +#else + // ILP32 or LLP64 + typedef long long int64; + typedef unsigned long long uint64; #endif typedef int int32; @@ -59,7 +70,14 @@ typedef unsigned short int uint16; typedef signed char int8; typedef unsigned char uint8; -#define address size_t + +// 'address' is a synonym for an int32 of pointer size + +#if defined (__o_64) + #define address int64 +#else + #define address int32 +#endif // The compiler uses 'import' and 'export' which translate to 'extern' and // nothing respectively. @@ -103,18 +121,40 @@ extern address Platform_OSAllocate (address size); extern void Platform_OSFree (address addr); +// Assertions and Halts + +extern void Platform_Halt(LONGINT x); +extern void Platform_AssertFail(LONGINT x); + +#define __HALT(x) Platform_Halt(x) +#define __ASSERT(cond, x) if (!(cond)) Platform_AssertFail((LONGINT)(x)) + + +// Index checking + +static inline int64 __XF(uint64 i, uint64 ub) {if (i >= ub) {__HALT(-2);} return i;} +#define __X(i, ub) (((uint64)(i)<(uint64)(ub))?i:(__HALT(-2),0)) + + +// Range checking, and checked SHORT and CHR functions + +static inline int64 __RF(uint64 i, uint64 ub) {if (i >= ub) {__HALT(-8);} return i;} +#define __R(i, ub) (((uint64)(i)<(uint64)(ub))?i:(__HALT(-8),0)) +#define __SHORT(x, ub) ((int)((uLONGINT)(x)+(ub)<(ub)+(ub)?(x):(__HALT(-8),0))) +#define __SHORTF(x, ub) ((int)(__RF((x)+(ub),(ub)+(ub))-(ub))) +#define __CHR(x) ((CHAR)__R(x, 256)) +#define __CHRF(x) ((CHAR)__RF(x, 256)) + + + // Run time system routines in SYSTEM.c -extern int64 SYSTEM_XCHK (uint64 i, uint64 ub); -extern int64 SYSTEM_RCHK (uint64 i, uint64 ub); -extern LONGINT SYSTEM_ASH (LONGINT i, LONGINT n); + extern LONGINT SYSTEM_ABS (LONGINT i); extern double SYSTEM_ABSD (double i); extern void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0); extern void SYSTEM_ENUMP (void *adr, LONGINT n, void (*P)()); extern void SYSTEM_ENUMR (void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()); -extern LONGINT SYSTEM_DIV (uint64 x, uint64 y); -extern LONGINT SYSTEM_MOD (uint64 x, uint64 y); extern LONGINT SYSTEM_ENTIER (double x); @@ -131,7 +171,7 @@ extern LONGINT SYSTEM_ENTIER (double x); // String comparison -static int __str_cmp(CHAR *x, CHAR *y){ +static inline int __str_cmp(CHAR *x, CHAR *y){ LONGINT i = 0; CHAR ch1, ch2; do {ch1 = x[i]; ch2 = y[i]; i++; @@ -152,21 +192,12 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __DEL(x) Platform_OSFree((address)x) -// Index and range checks - -#define __X(i, ub) (((uint64)(i)<(uint64)(ub))?i:(__HALT(-2),0)) -#define __XF(i, ub) SYSTEM_XCHK((uint64)(i), (uint64)(ub)) - -#define __R(i, ub) (((uint64)(i)<(uint64)(ub))?i:(__HALT(-8),0)) -#define __RF(i, ub) SYSTEM_RCHK((uint64)(i),(uint64)(ub)) - - /* SYSTEM ops */ #define __VAL(t, x) (*(t*)&(x)) -#define __GET(a, x, t) x= *(t*)(address)(a) +#define __GET(a, x, t) x=*(t*)(address)(a) #define __PUT(a, x, t) *(t*)(address)(a)=x #define __LSHL(x, n, t) ((t)((u##t)(x)<<(n))) @@ -177,21 +208,27 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __ROTR(x, n, t) ((t)((u##t)(x)>>(n)|(u##t)(x)<<(8*sizeof(t)-(n)))) #define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) -#define __ASHL(x, n) ((LONGINT)(x)<<(n)) -#define __ASHR(x, n) ((LONGINT)(x)>>(n)) +#define __ASHL(x, n) ((int64)(x)<<(n)) +#define __ASHR(x, n) ((int64)(x)>>(n)) #define __ASH(x, n) ((n)>=0?__ASHL(x,n):__ASHR(x,-(n))) -#define __ASHF(x, n) SYSTEM_ASH((LONGINT)(x), (LONGINT)(n)) +static inline int64 SYSTEM_ASH(int64 x, int64 n) {return __ASH(x,n);} +#define __ASHF(x, n) SYSTEM_ASH((int64)(x), (int64)(n)) #define __BIT(x, n) (*(uint64*)(x)>>(n)&1) #define __MOVE(s, d, n) memcpy((char*)(address)(d),(char*)(address)(s),n) -#define __SHORT(x, y) ((int)((uLONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) -#define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) -#define __CHR(x) ((CHAR)__R(x, 256)) -#define __CHRF(x) ((CHAR)__RF(x, 256)) -#define __DIV(x, y) ((x)>=0?(x)/(y):-(((y)-1-(x))/(y))) -#define __DIVF(x, y) SYSTEM_DIV((LONGINT)(x),(LONGINT)(y)) -#define __MOD(x, y) ((x)>=0?(x)%(y):__MODF(x,y)) -#define __MODF(x, y) SYSTEM_MOD((LONGINT)(x),(LONGINT)(y)) + + +extern int64 SYSTEM_DIV(int64 x, int64 y); +#define __DIVF(x, y) SYSTEM_DIV(x, y) +#define __DIV(x, y) (((x)>0 && (y)>0) ? (x)/(y) : __DIVF(x, y)) + + +extern int64 SYSTEM_MOD(int64 x, int64 y); +#define __MODF(x, y) SYSTEM_MOD(x, y) +#define __MOD(x, y) (((x)>0 && (y)>0) ? (x)%(y) : __MODF(x, y)) + + + #define __ENTIER(x) SYSTEM_ENTIER(x) #define __ABS(x) (((x)<0)?-(x):(x)) #define __ABSF(x) SYSTEM_ABS((LONGINT)(x)) @@ -244,15 +281,6 @@ extern void Heap_FINALL(); #define __FINI Heap_FINALL(); return 0 -// Assertions and Halts - -extern void Platform_Halt(LONGINT x); -extern void Platform_AssertFail(LONGINT x); - -#define __HALT(x) Platform_Halt(x) -#define __ASSERT(cond, x) if (!(cond)) Platform_AssertFail((LONGINT)(x)) - - // Memory allocation extern SYSTEM_PTR Heap_NEWBLK (address size); diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index 39f247ba..d4ecf06e 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index 2c6a801d..b664568e 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index a78b77bb..b3c1a3bf 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index 7156eb22..116ee5e3 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/Vishap.c b/bootstrap/windows-88/Vishap.c index 46a95ea9..a04ca149 100644 --- a/bootstrap/windows-88/Vishap.c +++ b/bootstrap/windows-88/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkamSf */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/errors.c b/bootstrap/windows-88/errors.c index 9c9ed747..5dba1a33 100644 --- a/bootstrap/windows-88/errors.c +++ b/bootstrap/windows-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/errors.h b/bootstrap/windows-88/errors.h index bf0e9564..9d5bbe45 100644 --- a/bootstrap/windows-88/errors.h +++ b/bootstrap/windows-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index c3dc490a..1080b9a3 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -64,7 +64,7 @@ void extTools_Assemble (CHAR *moduleName, LONGINT moduleName__len) { CHAR cmd[1023]; __DUP(moduleName, moduleName__len, CHAR); - __MOVE("gcc -g", cmd, 7); + __MOVE("gcc -g -O1", cmd, 11); Strings_Append(extTools_compilationOptions, 1023, (void*)cmd, 1023); Strings_Append((CHAR*)"-c ", 4, (void*)cmd, 1023); Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); @@ -77,7 +77,7 @@ void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN stati { CHAR cmd[1023]; __DUP(additionalopts, additionalopts__len, CHAR); - __MOVE("gcc -g", cmd, 7); + __MOVE("gcc -g -O1", cmd, 11); Strings_Append((CHAR*)" ", 2, (void*)cmd, 1023); Strings_Append(extTools_compilationOptions, 1023, (void*)cmd, 1023); Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index c5d5c772..8bdd3b71 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/vt100.c b/bootstrap/windows-88/vt100.c index fac0e0ba..3efc2842 100644 --- a/bootstrap/windows-88/vt100.c +++ b/bootstrap/windows-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/vt100.h b/bootstrap/windows-88/vt100.h index c2ebcd84..71738164 100644 --- a/bootstrap/windows-88/vt100.h +++ b/bootstrap/windows-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h From 9baf4c9429c7c6646c5b156c8d2b6738f236e2cf Mon Sep 17 00:00:00 2001 From: David Brown Date: Mon, 12 Sep 2016 15:55:54 +0100 Subject: [PATCH 223/580] Fix shift/rotate for all integer types, add tests, make build order work for SYSTEM.c/h changes. --- .gitignore | 8 +- bootstrap/{unix-44 => }/SYSTEM.c | 0 bootstrap/{unix-44 => }/SYSTEM.h | 35 +- bootstrap/{unix-44 => }/WindowsWrapper.h | 0 bootstrap/unix-44/Configuration.c | 4 +- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Console.c | 4 +- bootstrap/unix-44/Console.h | 2 +- bootstrap/unix-44/Files.c | 2 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 2 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 2 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 6 +- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 2 +- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 4 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/Vishap.c | 2 +- bootstrap/unix-44/errors.c | 2 +- bootstrap/unix-44/errors.h | 2 +- bootstrap/unix-44/extTools.c | 2 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-44/vt100.c | 2 +- bootstrap/unix-44/vt100.h | 2 +- bootstrap/unix-48/Configuration.c | 4 +- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Console.c | 4 +- bootstrap/unix-48/Console.h | 2 +- bootstrap/unix-48/Files.c | 2 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 2 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 2 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 6 +- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 2 +- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 4 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/SYSTEM.c | 220 ------------ bootstrap/unix-48/SYSTEM.h | 340 ------------------ bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/Vishap.c | 2 +- bootstrap/unix-48/WindowsWrapper.h | 10 - bootstrap/unix-48/errors.c | 2 +- bootstrap/unix-48/errors.h | 2 +- bootstrap/unix-48/extTools.c | 2 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-48/vt100.c | 2 +- bootstrap/unix-48/vt100.h | 2 +- bootstrap/unix-88/Configuration.c | 4 +- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Console.c | 4 +- bootstrap/unix-88/Console.h | 2 +- bootstrap/unix-88/Files.c | 2 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 2 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 2 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 6 +- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 2 +- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 4 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/SYSTEM.c | 220 ------------ bootstrap/unix-88/SYSTEM.h | 340 ------------------ bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/Vishap.c | 2 +- bootstrap/unix-88/WindowsWrapper.h | 10 - bootstrap/unix-88/errors.c | 2 +- bootstrap/unix-88/errors.h | 2 +- bootstrap/unix-88/extTools.c | 2 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/unix-88/vt100.c | 2 +- bootstrap/unix-88/vt100.h | 2 +- bootstrap/windows-48/Configuration.c | 4 +- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Console.c | 4 +- bootstrap/windows-48/Console.h | 2 +- bootstrap/windows-48/Files.c | 2 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 2 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 2 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 6 +- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 2 +- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 4 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/SYSTEM.c | 220 ------------ bootstrap/windows-48/SYSTEM.h | 340 ------------------ bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/Vishap.c | 2 +- bootstrap/windows-48/WindowsWrapper.h | 10 - bootstrap/windows-48/errors.c | 2 +- bootstrap/windows-48/errors.h | 2 +- bootstrap/windows-48/extTools.c | 2 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-48/vt100.c | 2 +- bootstrap/windows-48/vt100.h | 2 +- bootstrap/windows-88/Configuration.c | 4 +- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Console.c | 4 +- bootstrap/windows-88/Console.h | 2 +- bootstrap/windows-88/Files.c | 2 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 2 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 2 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 6 +- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 2 +- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 4 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Platform.c | 2 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/SYSTEM.c | 220 ------------ bootstrap/windows-88/SYSTEM.h | 340 ------------------ bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/Vishap.c | 2 +- bootstrap/windows-88/WindowsWrapper.h | 10 - bootstrap/windows-88/errors.c | 2 +- bootstrap/windows-88/errors.h | 2 +- bootstrap/windows-88/extTools.c | 2 +- bootstrap/windows-88/extTools.h | 2 +- bootstrap/windows-88/vt100.c | 2 +- bootstrap/windows-88/vt100.h | 2 +- makefile | 2 + src/compiler/OPV.Mod | 2 +- src/system/SYSTEM.h | 35 +- src/test/confidence/language/TestLanguage.mod | 74 +++- src/test/confidence/planned-binary-change | 2 +- src/tools/make/vishap.make | 6 +- 217 files changed, 334 insertions(+), 2550 deletions(-) rename bootstrap/{unix-44 => }/SYSTEM.c (100%) rename bootstrap/{unix-44 => }/SYSTEM.h (94%) rename bootstrap/{unix-44 => }/WindowsWrapper.h (100%) delete mode 100644 bootstrap/unix-48/SYSTEM.c delete mode 100644 bootstrap/unix-48/SYSTEM.h delete mode 100644 bootstrap/unix-48/WindowsWrapper.h delete mode 100644 bootstrap/unix-88/SYSTEM.c delete mode 100644 bootstrap/unix-88/SYSTEM.h delete mode 100644 bootstrap/unix-88/WindowsWrapper.h delete mode 100644 bootstrap/windows-48/SYSTEM.c delete mode 100644 bootstrap/windows-48/SYSTEM.h delete mode 100644 bootstrap/windows-48/WindowsWrapper.h delete mode 100644 bootstrap/windows-88/SYSTEM.c delete mode 100644 bootstrap/windows-88/SYSTEM.h delete mode 100644 bootstrap/windows-88/WindowsWrapper.h diff --git a/.gitignore b/.gitignore index 0e401127..2c05bb3a 100644 --- a/.gitignore +++ b/.gitignore @@ -4,9 +4,12 @@ /build/* /*.exe /*.obj -/*.o +/*.[cho] /*.lib /*.map +/*.sym +/*.asm +/*.mod /olang /src/test/**/*.exe /src/test/**/*.c @@ -14,10 +17,11 @@ /src/test/**/*.o /src/test/**/*.obj /src/test/**/*.sym -/src/test/**/*.stackdump +**/*.stackdump /src/test/confidence/**/result /src/test/confidence/**/*.asm /src/test/confidence/**/*.s +/src/test/confidence/**/*.map /.DS_store **/.DS_store **/*.dSYM diff --git a/bootstrap/unix-44/SYSTEM.c b/bootstrap/SYSTEM.c similarity index 100% rename from bootstrap/unix-44/SYSTEM.c rename to bootstrap/SYSTEM.c diff --git a/bootstrap/unix-44/SYSTEM.h b/bootstrap/SYSTEM.h similarity index 94% rename from bootstrap/unix-44/SYSTEM.h rename to bootstrap/SYSTEM.h index 168b0beb..709c26a7 100644 --- a/bootstrap/unix-44/SYSTEM.h +++ b/bootstrap/SYSTEM.h @@ -33,14 +33,11 @@ #if defined (__o_64) #if defined(_WIN64) typedef unsigned long long size_t; -// typedef long long address; #else typedef unsigned long size_t; -// typedef long address; #endif #else typedef unsigned int size_t; -//typedef int address; #endif #define _SIZE_T_DECLARED // For FreeBSD @@ -71,14 +68,6 @@ typedef signed char int8; typedef unsigned char uint8; -// 'address' is a synonym for an int32 of pointer size - -#if defined (__o_64) - #define address int64 -#else - #define address int32 -#endif - // The compiler uses 'import' and 'export' which translate to 'extern' and // nothing respectively. @@ -98,9 +87,7 @@ typedef unsigned char uint8; typedef int8 BOOLEAN; typedef int8 SYSTEM_BYTE; -typedef uint8 uSYSTEM_BYTE; typedef uint8 CHAR; -typedef uint8 uCHAR; typedef float REAL; typedef double LONGREAL; typedef void* SYSTEM_PTR; @@ -108,6 +95,16 @@ typedef void* SYSTEM_PTR; #define uSET SET +// 'address' is a synonym for an int of pointer size + +#if defined (__o_64) + #define address int64 +#else + #define address int32 +#endif + + + // ---------------------------------------------------------------------- @@ -200,13 +197,13 @@ static inline int __str_cmp(CHAR *x, CHAR *y){ #define __GET(a, x, t) x=*(t*)(address)(a) #define __PUT(a, x, t) *(t*)(address)(a)=x -#define __LSHL(x, n, t) ((t)((u##t)(x)<<(n))) -#define __LSHR(x, n, t) ((t)((u##t)(x)>>(n))) -#define __LSH(x, n, t) ((n)>=0? __LSHL(x, n, t): __LSHR(x, -(n), t)) +#define __LSHL(x, n, s) ((int##s)((uint##s)(x)<<(n))) +#define __LSHR(x, n, s) ((int##s)((uint##s)(x)>>(n))) +#define __LSH(x, n, s) ((n)>=0? __LSHL(x, n, s): __LSHR(x, -(n), s)) -#define __ROTL(x, n, t) ((t)((u##t)(x)<<(n)|(u##t)(x)>>(8*sizeof(t)-(n)))) -#define __ROTR(x, n, t) ((t)((u##t)(x)>>(n)|(u##t)(x)<<(8*sizeof(t)-(n)))) -#define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) +#define __ROTL(x, n, s) ((int##s)((uint##s)(x)<<(n)|(uint##s)(x)>>(s-(n)))) +#define __ROTR(x, n, s) ((int##s)((uint##s)(x)>>(n)|(uint##s)(x)<<(s-(n)))) +#define __ROT(x, n, s) ((n)>=0? __ROTL(x, n, s): __ROTR(x, -(n), s)) #define __ASHL(x, n) ((int64)(x)<<(n)) #define __ASHR(x, n) ((int64)(x)>>(n)) diff --git a/bootstrap/unix-44/WindowsWrapper.h b/bootstrap/WindowsWrapper.h similarity index 100% rename from bootstrap/unix-44/WindowsWrapper.h rename to bootstrap/WindowsWrapper.h diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index 5736ed9f..cc4f7969 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/11] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/12] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index 31877f12..3ce4467e 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Console.c b/bootstrap/unix-44/Console.c index 6181cbfd..e33f3d7c 100644 --- a/bootstrap/unix-44/Console.c +++ b/bootstrap/unix-44/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -58,7 +58,7 @@ void Console_Int (int32 i, int32 n) { CHAR s[32]; int32 i1, k; - if (i == __LSHL(1, 31, int32)) { + if (i == __LSHL(1, 31, 32)) { __MOVE("8463847412", s, 11); k = 10; } else { diff --git a/bootstrap/unix-44/Console.h b/bootstrap/unix-44/Console.h index 78586a68..c6fe7fc4 100644 --- a/bootstrap/unix-44/Console.h +++ b/bootstrap/unix-44/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index f98f4e55..ebdd14a9 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index de420c7c..42e60467 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index 58be6181..4d96ea89 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tskSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index 827a3a7c..1a6c9e05 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index 66a8c776..9834a814 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index 02abd713..e34e59ed 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index 8d44024a..92c0af42 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index 5aaa8469..96866563 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 1122a8d0..452c85d2 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index 1a9ad61f..81e8362d 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index e6d709e7..671a9d8f 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -537,7 +537,7 @@ void OPM_err (int16 n) void OPM_FPrint (int32 *fp, int32 val) { - *fp = __ROTL((int32)((SET)*fp ^ (SET)val), 1, int32); + *fp = __ROTL((int32)((SET)*fp ^ (SET)val), 1, 32); } void OPM_FPrintSet (int32 *fp, SET set) @@ -652,7 +652,7 @@ int32 OPM_SignedMaximum (int32 bytecount) int32 _o_result; int32 result; result = 1; - result = __LSH(result, __ASHL(bytecount, 3) - 1, int32); + result = __LSH(result, __ASHL(bytecount, 3) - 1, 32); _o_result = result - 1; return _o_result; } diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index c5192f5b..0d9bcdeb 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index 6e2d4cd0..de0afa51 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index de48c5ba..2d3ebd77 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index 9b3bf8f0..e6e99c02 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index 8689aa3b..99448598 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index 0d16f8ec..4a645e7a 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index b9e46b1a..93975ea1 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index e36e3be5..b264d44e 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -1039,7 +1039,7 @@ static void OPV_expr (OPT_Node n, int16 prec) } if (__IN(subclass, 0x18000000)) { OPM_WriteString((CHAR*)", ", 3); - OPC_Ident(l->typ->strobj); + OPM_WriteInt(__ASHL(l->typ->size, 3)); } OPM_Write(')'); break; diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index c692efd8..3b43e61e 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index b8559160..4842a8c4 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index 868c4e52..295013cf 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index c9e8e867..e209af08 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index bd36f8d6..2779fc88 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index af7a679b..387345ab 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index d145001a..fe90bd09 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index ace0257e..1d7b5409 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index e52c65ca..d684a9c0 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/Vishap.c b/bootstrap/unix-44/Vishap.c index b289dfa6..fb1c1662 100644 --- a/bootstrap/unix-44/Vishap.c +++ b/bootstrap/unix-44/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkamSf */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/errors.c b/bootstrap/unix-44/errors.c index 76fa35bf..7feed8e7 100644 --- a/bootstrap/unix-44/errors.c +++ b/bootstrap/unix-44/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/errors.h b/bootstrap/unix-44/errors.h index 9d5bbe45..4fe434e1 100644 --- a/bootstrap/unix-44/errors.h +++ b/bootstrap/unix-44/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index 3dbc28ba..0afff1f0 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index 8bdd3b71..5d996dae 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-44/vt100.c b/bootstrap/unix-44/vt100.c index 2e236578..8a5286ec 100644 --- a/bootstrap/unix-44/vt100.c +++ b/bootstrap/unix-44/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/vt100.h b/bootstrap/unix-44/vt100.h index 0eae5799..c09b4c71 100644 --- a/bootstrap/unix-44/vt100.h +++ b/bootstrap/unix-44/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index 5736ed9f..cc4f7969 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/11] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/12] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index 31877f12..3ce4467e 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Console.c b/bootstrap/unix-48/Console.c index 6181cbfd..e33f3d7c 100644 --- a/bootstrap/unix-48/Console.c +++ b/bootstrap/unix-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -58,7 +58,7 @@ void Console_Int (int32 i, int32 n) { CHAR s[32]; int32 i1, k; - if (i == __LSHL(1, 31, int32)) { + if (i == __LSHL(1, 31, 32)) { __MOVE("8463847412", s, 11); k = 10; } else { diff --git a/bootstrap/unix-48/Console.h b/bootstrap/unix-48/Console.h index 78586a68..c6fe7fc4 100644 --- a/bootstrap/unix-48/Console.h +++ b/bootstrap/unix-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index f98f4e55..ebdd14a9 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index de420c7c..42e60467 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index 58be6181..4d96ea89 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tskSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index 827a3a7c..1a6c9e05 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index 66a8c776..9834a814 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index 02abd713..e34e59ed 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index 8d44024a..92c0af42 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index 5aaa8469..96866563 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 1122a8d0..452c85d2 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index 1a9ad61f..81e8362d 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index e6d709e7..671a9d8f 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -537,7 +537,7 @@ void OPM_err (int16 n) void OPM_FPrint (int32 *fp, int32 val) { - *fp = __ROTL((int32)((SET)*fp ^ (SET)val), 1, int32); + *fp = __ROTL((int32)((SET)*fp ^ (SET)val), 1, 32); } void OPM_FPrintSet (int32 *fp, SET set) @@ -652,7 +652,7 @@ int32 OPM_SignedMaximum (int32 bytecount) int32 _o_result; int32 result; result = 1; - result = __LSH(result, __ASHL(bytecount, 3) - 1, int32); + result = __LSH(result, __ASHL(bytecount, 3) - 1, 32); _o_result = result - 1; return _o_result; } diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index c5192f5b..0d9bcdeb 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index 6e2d4cd0..de0afa51 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index de48c5ba..2d3ebd77 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index 9b3bf8f0..e6e99c02 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index 8689aa3b..99448598 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 0d16f8ec..4a645e7a 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index b9e46b1a..93975ea1 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index e36e3be5..b264d44e 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -1039,7 +1039,7 @@ static void OPV_expr (OPT_Node n, int16 prec) } if (__IN(subclass, 0x18000000)) { OPM_WriteString((CHAR*)", ", 3); - OPC_Ident(l->typ->strobj); + OPM_WriteInt(__ASHL(l->typ->size, 3)); } OPM_Write(')'); break; diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index c692efd8..3b43e61e 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index b8559160..4842a8c4 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index 868c4e52..295013cf 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index c9e8e867..e209af08 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index bd36f8d6..2779fc88 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/SYSTEM.c b/bootstrap/unix-48/SYSTEM.c deleted file mode 100644 index d7603f8e..00000000 --- a/bootstrap/unix-48/SYSTEM.c +++ /dev/null @@ -1,220 +0,0 @@ -/* -* The body prefix file of the voc(jet backend) runtime system, Version 1.0 -* -* Copyright (c) Software Templ, 1994, 1995 -* -* Module SYSTEM is subject to change any time without prior notification. -* Software Templ disclaims all warranties with regard to module SYSTEM, -* in particular shall Software Templ not be liable for any damage resulting -* from inappropriate use or modification of module SYSTEM. -* -* Version 1.1 jt, 24.11.95 fixes for correct pointer arithmetic on Cray computers -* jt 31.1.2007 ANSI prototypes for malloc and exit in order to avoid cc warnings -* -*/ - -#include "SYSTEM.h" -#include "stdarg.h" -#include - - -// Procedure verions of SYSTEM.H versions used when a multiply accessed -// parameter has side effects. - - - -LONGINT SYSTEM_ABS (LONGINT i) {return __ABS(i);} -double SYSTEM_ABSD(double i) {return __ABS(i);} - - -int64 SYSTEM_DIV(int64 x, int64 y) -{ - if (x == 0) return 0; - if (x >= 0) - if (y >= 0) {return x/y;} - else {return -((x-y-1)/(-y));} - else - if (y >= 0) {return -((y-x-1)/y);} - else {return (-x)/(-y);} -} - -int64 SYSTEM_MOD(int64 x, int64 y) -{ - if (x == 0) return 0; - if (x >= 0) - if (y >= 0) {return x % y;} - else {return (y+1) + ((x-1) % (-y));} - else - if (y >= 0) {return (y-1) - ((-x-1) % y);} - else {return -((-x) % (-y));} -} - - -void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0) -{ - t -= __TPROC0OFF; - t0 -= __TPROC0OFF; - while (*t0 != __EOM) {*t = *t0; t--; t0--;} -} - - -void SYSTEM_ENUMP(void *adr, LONGINT n, void (*P)()) -{ - while (n > 0) { - P((address)(*((void**)(adr)))); - adr = ((void**)adr) + 1; - n--; - } -} - -void SYSTEM_ENUMR(void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()) -{ - LONGINT *t, off; - typ++; - while (n > 0) { - t = typ; - off = *t; - while (off >= 0) {P(*(address*)((char*)adr+off)); t++; off = *t;} - adr = ((char*)adr) + size; - n--; - } -} - -LONGINT SYSTEM_ENTIER(double x) -{ - LONGINT y; - if (x >= 0) - return (LONGINT)x; - else { - y = (LONGINT)x; - if (y <= x) return y; else return y - 1; - } -} - -extern void Heap_Lock(); -extern void Heap_Unlock(); - -SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, int nofdyn, ...) -{ - LONGINT nofelems, size, dataoff, n, nptr, *x, *p, nofptrs, i, *ptab, off; - va_list ap; - va_start(ap, nofdyn); - nofelems = 1; - while (nofdim > 0) { - nofelems = nofelems * va_arg(ap, LONGINT); nofdim--; - if (nofelems <= 0) __HALT(-20); - } - va_end(ap); - dataoff = nofdyn * sizeof(LONGINT); - if (elemalgn > sizeof(LONGINT)) { - n = dataoff % elemalgn; - if (n != 0) dataoff += elemalgn - n; - } - size = dataoff + nofelems * elemsz; - Heap_Lock(); - if (typ == NIL) { - /* element typ does not contain pointers */ - x = Heap_NEWBLK(size); - } - else if (typ == (LONGINT*)POINTER__typ) { - /* element type is a pointer */ - x = Heap_NEWBLK(size + nofelems * sizeof(LONGINT)); - p = (LONGINT*)(address)x[-1]; - p[-nofelems] = *p; /* build new type desc in situ: 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ - p -= nofelems - 1; n = 1; /* n =1 for skipping the size field */ - while (n <= nofelems) {*p = n*sizeof(LONGINT); p++; n++;} - *p = - (nofelems + 1) * sizeof(LONGINT); /* sentinel */ - x[-1] -= nofelems * sizeof(LONGINT); - } - else { - /* element type is a record that contains pointers */ - ptab = typ + 1; nofptrs = 0; - while (ptab[nofptrs] >= 0) {nofptrs++;} /* number of pointers per element */ - nptr = nofelems * nofptrs; /* total number of pointers */ - x = Heap_NEWBLK(size + nptr * sizeof(LONGINT)); - p = (LONGINT*)(address)x[- 1]; - p[-nptr] = *p; /* build new type desc in situ; 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ - p -= nptr - 1; n = 0; off = dataoff; - while (n < nofelems) {i = 0; - while (i < nofptrs) {*p = off + ptab[i]; p++; i++;} - off += elemsz; n++; - } - *p = - (nptr + 1) * sizeof(LONGINT); /* sentinel */ - x[-1] -= nptr * sizeof(LONGINT); - } - if (nofdyn != 0) { - /* setup len vector for index checks */ - va_start(ap, nofdyn); - p = x; - while (nofdyn > 0) {*p = va_arg(ap, LONGINT); p++, nofdyn--;} - va_end(ap); - } - Heap_Unlock(); - return x; -} - - - - -typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler - -#ifndef _WIN32 - - SystemSignalHandler handler[3] = {0}; - - // Provide signal handling for Unix based systems - void signalHandler(int s) { - if (s >= 2 && s <= 4) handler[s-2](s); - // (Ignore other signals) - } - - void SystemSetHandler(int s, address h) { - if (s >= 2 && s <= 4) { - int needtosetsystemhandler = handler[s-2] == 0; - handler[s-2] = (SystemSignalHandler)h; - if (needtosetsystemhandler) {signal(s, signalHandler);} - } - } - -#else - - // Provides Windows callback handlers for signal-like scenarios - #include "WindowsWrapper.h" - - SystemSignalHandler SystemInterruptHandler = 0; - SystemSignalHandler SystemQuitHandler = 0; - BOOL ConsoleCtrlHandlerSet = FALSE; - - BOOL WINAPI SystemConsoleCtrlHandler(DWORD ctrlType) { - if ((ctrlType == CTRL_C_EVENT) || (ctrlType == CTRL_BREAK_EVENT)) { - if (SystemInterruptHandler) { - SystemInterruptHandler(2); // SIGINT - return TRUE; - } - } else { // Close, logoff or shutdown - if (SystemQuitHandler) { - SystemQuitHandler(3); // SIGQUIT - return TRUE; - } - } - return FALSE; - } - - void EnsureConsoleCtrlHandler() { - if (!ConsoleCtrlHandlerSet) { - SetConsoleCtrlHandler(SystemConsoleCtrlHandler, TRUE); - ConsoleCtrlHandlerSet = TRUE; - } - } - - void SystemSetInterruptHandler(address h) { - EnsureConsoleCtrlHandler(); - SystemInterruptHandler = (SystemSignalHandler)h; - } - - void SystemSetQuitHandler(address h) { - EnsureConsoleCtrlHandler(); - SystemQuitHandler = (SystemSignalHandler)h; - } - -#endif diff --git a/bootstrap/unix-48/SYSTEM.h b/bootstrap/unix-48/SYSTEM.h deleted file mode 100644 index 168b0beb..00000000 --- a/bootstrap/unix-48/SYSTEM.h +++ /dev/null @@ -1,340 +0,0 @@ -#ifndef SYSTEM__h -#define SYSTEM__h - - -// 64 bit system detection - -#if (__SIZEOF_POINTER__ == 8) || defined (_LP64) || defined(__LP64__) || defined(_WIN64) - #define __o_64 -#endif - -// Temporary while bootstrapping and clearing up SYSTEM.c. - - -#ifndef LONGINT - #if defined (__o_64) - #define INTEGER int32 - #define LONGINT int64 - #define SET uint64 - #else - #define INTEGER int16 - #define LONGINT int32 - #define SET uint32 - #endif -#endif - - - - - -// Declare memcpy in a way compatible with C compilers intrinsic -// built in implementations. - -#if defined (__o_64) - #if defined(_WIN64) - typedef unsigned long long size_t; -// typedef long long address; - #else - typedef unsigned long size_t; -// typedef long address; - #endif -#else - typedef unsigned int size_t; -//typedef int address; -#endif - -#define _SIZE_T_DECLARED // For FreeBSD -#define _SIZE_T_DEFINED_ // For OpenBSD - -void *memcpy(void *dest, const void *source, size_t size); - - -// Declare fixed size versions of basic intger types - -#if defined (__o_64) && !defined(_WIN64) - // LP64 - typedef long int64; - typedef unsigned long uint64; -#else - // ILP32 or LLP64 - typedef long long int64; - typedef unsigned long long uint64; -#endif - -typedef int int32; -typedef unsigned int uint32; - -typedef short int int16; -typedef unsigned short int uint16; - -typedef signed char int8; -typedef unsigned char uint8; - - -// 'address' is a synonym for an int32 of pointer size - -#if defined (__o_64) - #define address int64 -#else - #define address int32 -#endif - -// The compiler uses 'import' and 'export' which translate to 'extern' and -// nothing respectively. - -#define import extern -#define export - - - -// Known constants - -#define NIL ((void*)0) -#define __MAXEXT 16 -#define POINTER__typ ((address*)(1)) // not NIL and not a valid type - - -// Oberon types - -typedef int8 BOOLEAN; -typedef int8 SYSTEM_BYTE; -typedef uint8 uSYSTEM_BYTE; -typedef uint8 CHAR; -typedef uint8 uCHAR; -typedef float REAL; -typedef double LONGREAL; -typedef void* SYSTEM_PTR; - -#define uSET SET - - - - -// ---------------------------------------------------------------------- -// ---------------------------------------------------------------------- - - - -// OS Memory allocation interfaces are in PlatformXXX.Mod - -extern address Platform_OSAllocate (address size); -extern void Platform_OSFree (address addr); - - -// Assertions and Halts - -extern void Platform_Halt(LONGINT x); -extern void Platform_AssertFail(LONGINT x); - -#define __HALT(x) Platform_Halt(x) -#define __ASSERT(cond, x) if (!(cond)) Platform_AssertFail((LONGINT)(x)) - - -// Index checking - -static inline int64 __XF(uint64 i, uint64 ub) {if (i >= ub) {__HALT(-2);} return i;} -#define __X(i, ub) (((uint64)(i)<(uint64)(ub))?i:(__HALT(-2),0)) - - -// Range checking, and checked SHORT and CHR functions - -static inline int64 __RF(uint64 i, uint64 ub) {if (i >= ub) {__HALT(-8);} return i;} -#define __R(i, ub) (((uint64)(i)<(uint64)(ub))?i:(__HALT(-8),0)) -#define __SHORT(x, ub) ((int)((uLONGINT)(x)+(ub)<(ub)+(ub)?(x):(__HALT(-8),0))) -#define __SHORTF(x, ub) ((int)(__RF((x)+(ub),(ub)+(ub))-(ub))) -#define __CHR(x) ((CHAR)__R(x, 256)) -#define __CHRF(x) ((CHAR)__RF(x, 256)) - - - -// Run time system routines in SYSTEM.c - - -extern LONGINT SYSTEM_ABS (LONGINT i); -extern double SYSTEM_ABSD (double i); -extern void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0); -extern void SYSTEM_ENUMP (void *adr, LONGINT n, void (*P)()); -extern void SYSTEM_ENUMR (void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()); -extern LONGINT SYSTEM_ENTIER (double x); - - -// Signal handling in SYSTEM.c - -#ifndef _WIN32 - extern void SystemSetHandler(int s, address h); -#else - extern void SystemSetInterruptHandler(address h); - extern void SystemSetQuitHandler (address h); -#endif - - - -// String comparison - -static inline int __str_cmp(CHAR *x, CHAR *y){ - LONGINT i = 0; - CHAR ch1, ch2; - do {ch1 = x[i]; ch2 = y[i]; i++; - if (!ch1) return -(int)ch2; - } while (ch1==ch2); - return (int)ch1 - (int)ch2; -} -#define __STRCMP(a,b) __str_cmp((CHAR*)(a), (CHAR*)(b)) - - - -// Inline string, record and array copy - -#define __COPY(s, d, n) {char*_a=(void*)s,*_b=(void*)d; LONGINT _i=0,_t=n-1; \ - while(_i<_t&&((_b[_i]=_a[_i])!=0)){_i++;};_b[_i]=0;} -#define __DUP(x, l, t) x=(void*)memcpy((void*)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) -#define __DUPARR(v, t) v=(void*)memcpy(v##__copy,v,sizeof(t)) -#define __DEL(x) Platform_OSFree((address)x) - - -/* SYSTEM ops */ - -#define __VAL(t, x) (*(t*)&(x)) - - -#define __GET(a, x, t) x=*(t*)(address)(a) -#define __PUT(a, x, t) *(t*)(address)(a)=x - -#define __LSHL(x, n, t) ((t)((u##t)(x)<<(n))) -#define __LSHR(x, n, t) ((t)((u##t)(x)>>(n))) -#define __LSH(x, n, t) ((n)>=0? __LSHL(x, n, t): __LSHR(x, -(n), t)) - -#define __ROTL(x, n, t) ((t)((u##t)(x)<<(n)|(u##t)(x)>>(8*sizeof(t)-(n)))) -#define __ROTR(x, n, t) ((t)((u##t)(x)>>(n)|(u##t)(x)<<(8*sizeof(t)-(n)))) -#define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) - -#define __ASHL(x, n) ((int64)(x)<<(n)) -#define __ASHR(x, n) ((int64)(x)>>(n)) -#define __ASH(x, n) ((n)>=0?__ASHL(x,n):__ASHR(x,-(n))) -static inline int64 SYSTEM_ASH(int64 x, int64 n) {return __ASH(x,n);} -#define __ASHF(x, n) SYSTEM_ASH((int64)(x), (int64)(n)) - -#define __BIT(x, n) (*(uint64*)(x)>>(n)&1) -#define __MOVE(s, d, n) memcpy((char*)(address)(d),(char*)(address)(s),n) - - -extern int64 SYSTEM_DIV(int64 x, int64 y); -#define __DIVF(x, y) SYSTEM_DIV(x, y) -#define __DIV(x, y) (((x)>0 && (y)>0) ? (x)/(y) : __DIVF(x, y)) - - -extern int64 SYSTEM_MOD(int64 x, int64 y); -#define __MODF(x, y) SYSTEM_MOD(x, y) -#define __MOD(x, y) (((x)>0 && (y)>0) ? (x)%(y) : __MODF(x, y)) - - - -#define __ENTIER(x) SYSTEM_ENTIER(x) -#define __ABS(x) (((x)<0)?-(x):(x)) -#define __ABSF(x) SYSTEM_ABS((LONGINT)(x)) -#define __ABSFD(x) SYSTEM_ABSD((double)(x)) -#define __CAP(ch) ((CHAR)((ch)&0x5f)) -#define __ODD(x) ((x)&1) -#define __IN(x, s) ((x)>=0 && (x)<(8*sizeof(SET)) && ((((uSET)(s))>>(x))&1)) -#define __SETOF(x) ((SET)1<<(x)) -#define __SETRNG(l, h) ((~(SET)0<<(l))&~(SET)0>>(8*sizeof(SET)-1-(h))) -#define __MASK(x, m) ((x)&~(m)) - - - -// Runtime checks - -#define __RETCHK __retchk: __HALT(-3); return 0; -#define __CASECHK __HALT(-4) -#define __WITHCHK __HALT(-7) - -#define __GUARDP(p, typ, level) ((typ*)(__ISP(p,typ,level)?p:(__HALT(-5),p))) -#define __GUARDR(r, typ, level) (*((typ*)(__IS(r##__typ,typ,level)?r:(__HALT(-5),r)))) -#define __GUARDA(p, typ, level) ((struct typ*)(__IS(__TYPEOF(p),typ,level)?p:(__HALT(-5),p))) -#define __GUARDEQR(p, dyntyp, typ) if(dyntyp!=typ##__typ) __HALT(-6);*(p) -#define __GUARDEQP(p, typ) if(__TYPEOF(p)!=typ##__typ)__HALT(-6);*(p) - - - -// Module entry/registration/exit - -extern void Heap_REGCMD(); -extern SYSTEM_PTR Heap_REGMOD(); -extern void Heap_REGTYP(); -extern void Heap_INCREF(); - -#define __DEFMOD static void *m; if (m!=0) {return m;} -#define __REGCMD(name, cmd) Heap_REGCMD(m, (CHAR*)name, cmd) -#define __REGMOD(name, enum) if (m==0) {m = Heap_REGMOD((CHAR*)name,enum);} -#define __ENDMOD return m -#define __MODULE_IMPORT(name) Heap_INCREF(name##__init()) - - - -// Main module initialisation, registration and finalisation - -extern void Platform_Init(INTEGER argc, address argv); -extern void Heap_FINALL(); - -#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (address)&argv); -#define __REGMAIN(name, enum) m = Heap_REGMOD((CHAR*)name,enum) -#define __FINI Heap_FINALL(); return 0 - - -// Memory allocation - -extern SYSTEM_PTR Heap_NEWBLK (address size); -extern SYSTEM_PTR Heap_NEWREC (address tag); -extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); - -#define __SYSNEW(p, len) p = Heap_NEWBLK((LONGINT)(len)) -#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(address)t##__typ) -#define __NEWARR SYSTEM_NEWARR - - - -/* Type handling */ - -#define __TDESC(t, m, n) \ - static struct t##__desc { \ - LONGINT tproc[m]; /* Proc for each ptr field */ \ - LONGINT tag; \ - LONGINT next; /* Module table type list points here */ \ - LONGINT level; \ - LONGINT module; \ - char name[24]; \ - LONGINT basep[__MAXEXT]; /* List of bases this extends */ \ - LONGINT reserved; \ - LONGINT blksz; /* xxx_typ points here */ \ - LONGINT ptr[n+1]; /* Offsets of ptrs up to -ve sentinel */ \ - } t##__desc - -#define __BASEOFF (__MAXEXT+1) // blksz as index to base. -#define __TPROC0OFF (__BASEOFF+24/sizeof(LONGINT)+5) // blksz as index to tproc IFF m=1. -#define __EOM 1 -#define __TDFLDS(name, size) {__EOM}, 1, 0, 0, 0, name, {0}, 0, size -#define __ENUMP(adr, n, P) SYSTEM_ENUMP(adr, (LONGINT)(n), P) -#define __ENUMR(adr, typ, size, n, P) SYSTEM_ENUMR(adr, typ, (LONGINT)(size), (LONGINT)(n), P) - -#define __INITYP(t, t0, level) \ - t##__typ = (LONGINT*)&t##__desc.blksz; \ - memcpy(t##__desc.basep, t0##__typ - __BASEOFF, level*sizeof(LONGINT)); \ - t##__desc.basep[level] = (LONGINT)(address)t##__typ; \ - t##__desc.module = (LONGINT)(address)m; \ - if(t##__desc.blksz!=sizeof(struct t)) __HALT(-15); \ - t##__desc.blksz = (t##__desc.blksz+5*sizeof(LONGINT)-1)/(4*sizeof(LONGINT))*(4*sizeof(LONGINT)); \ - Heap_REGTYP(m, (LONGINT)(address)&t##__desc.next); \ - SYSTEM_INHERIT(t##__typ, t0##__typ) - -#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(address)typ##__typ) -#define __TYPEOF(p) ((LONGINT*)(address)(*(((LONGINT*)(p))-1))) -#define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) - -// Oberon-2 type bound procedures support -#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(address)proc -#define __SEND(typ, num, funtyp, parlist) ((funtyp)((address)*(typ-(__TPROC0OFF+num))))parlist - - - - -#endif diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index af7a679b..387345ab 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index d145001a..fe90bd09 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index c40b975f..c37a4a2c 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index 0aac4cc8..c6ee484f 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/Vishap.c b/bootstrap/unix-48/Vishap.c index b289dfa6..fb1c1662 100644 --- a/bootstrap/unix-48/Vishap.c +++ b/bootstrap/unix-48/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkamSf */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/WindowsWrapper.h b/bootstrap/unix-48/WindowsWrapper.h deleted file mode 100644 index b72c815a..00000000 --- a/bootstrap/unix-48/WindowsWrapper.h +++ /dev/null @@ -1,10 +0,0 @@ -// WindowsWrapper.h -// -// Includes Windows.h while avoiding conflicts with Oberon types. - - -#define BOOLEAN _BOOLEAN -#define CHAR _CHAR -#include -#undef BOOLEAN -#undef CHAR diff --git a/bootstrap/unix-48/errors.c b/bootstrap/unix-48/errors.c index 76fa35bf..7feed8e7 100644 --- a/bootstrap/unix-48/errors.c +++ b/bootstrap/unix-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/errors.h b/bootstrap/unix-48/errors.h index 9d5bbe45..4fe434e1 100644 --- a/bootstrap/unix-48/errors.h +++ b/bootstrap/unix-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index 3dbc28ba..0afff1f0 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index 8bdd3b71..5d996dae 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/vt100.c b/bootstrap/unix-48/vt100.c index 2e236578..8a5286ec 100644 --- a/bootstrap/unix-48/vt100.c +++ b/bootstrap/unix-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/vt100.h b/bootstrap/unix-48/vt100.h index 0eae5799..c09b4c71 100644 --- a/bootstrap/unix-48/vt100.h +++ b/bootstrap/unix-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index b5ee44a5..b023c21b 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/11] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/12] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index 31877f12..3ce4467e 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Console.c b/bootstrap/unix-88/Console.c index 74de0b0a..3677dd09 100644 --- a/bootstrap/unix-88/Console.c +++ b/bootstrap/unix-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -58,7 +58,7 @@ void Console_Int (int64 i, int64 n) { CHAR s[32]; int64 i1, k; - if (i == __LSHL(1, 63, int64)) { + if (i == __LSHL(1, 63, 64)) { __MOVE("8085774586302733229", s, 20); k = 19; } else { diff --git a/bootstrap/unix-88/Console.h b/bootstrap/unix-88/Console.h index 1d06d0fe..27d906ad 100644 --- a/bootstrap/unix-88/Console.h +++ b/bootstrap/unix-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index aabcb14d..acdf5f8a 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 054cde33..7fb2cb03 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index d0175b87..67044d79 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tskSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index fabb54ef..584661bc 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 53bf2640..547909bb 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index 8e54ce53..2666971d 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index f22a9ab5..f048dc85 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index aa26ea1c..adefb869 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index 8916c00b..aee5581c 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index 71b95812..aba4bdbb 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index b15aba16..55420864 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -537,7 +537,7 @@ void OPM_err (int32 n) void OPM_FPrint (int64 *fp, int64 val) { - *fp = __ROTL((int64)((SET)*fp ^ (SET)val), 1, int64); + *fp = __ROTL((int64)((SET)*fp ^ (SET)val), 1, 64); } void OPM_FPrintSet (int64 *fp, SET set) @@ -650,7 +650,7 @@ int64 OPM_SignedMaximum (int64 bytecount) int64 _o_result; int64 result; result = 1; - result = __LSH(result, __ASHL(bytecount, 3) - 1, int64); + result = __LSH(result, __ASHL(bytecount, 3) - 1, 64); _o_result = result - 1; return _o_result; } diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index d23aed25..1e5c3e72 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index 3f77df4f..f175938c 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index de48c5ba..2d3ebd77 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index 491faa22..0c36910a 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index 3937b6f6..a16c2ce8 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index da8bab08..3006ea90 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 668c3d79..5f466ec4 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 52fc9966..082797f1 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -1039,7 +1039,7 @@ static void OPV_expr (OPT_Node n, int32 prec) } if (__IN(subclass, 0x18000000)) { OPM_WriteString((CHAR*)", ", 3); - OPC_Ident(l->typ->strobj); + OPM_WriteInt(__ASHL(l->typ->size, 3)); } OPM_Write(')'); break; diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index c692efd8..3b43e61e 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 9142bf02..cf8dfa9f 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index e52525fd..708e58d7 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 185aec0b..2a753b7a 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index a2fc2612..c3cac05a 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/SYSTEM.c b/bootstrap/unix-88/SYSTEM.c deleted file mode 100644 index d7603f8e..00000000 --- a/bootstrap/unix-88/SYSTEM.c +++ /dev/null @@ -1,220 +0,0 @@ -/* -* The body prefix file of the voc(jet backend) runtime system, Version 1.0 -* -* Copyright (c) Software Templ, 1994, 1995 -* -* Module SYSTEM is subject to change any time without prior notification. -* Software Templ disclaims all warranties with regard to module SYSTEM, -* in particular shall Software Templ not be liable for any damage resulting -* from inappropriate use or modification of module SYSTEM. -* -* Version 1.1 jt, 24.11.95 fixes for correct pointer arithmetic on Cray computers -* jt 31.1.2007 ANSI prototypes for malloc and exit in order to avoid cc warnings -* -*/ - -#include "SYSTEM.h" -#include "stdarg.h" -#include - - -// Procedure verions of SYSTEM.H versions used when a multiply accessed -// parameter has side effects. - - - -LONGINT SYSTEM_ABS (LONGINT i) {return __ABS(i);} -double SYSTEM_ABSD(double i) {return __ABS(i);} - - -int64 SYSTEM_DIV(int64 x, int64 y) -{ - if (x == 0) return 0; - if (x >= 0) - if (y >= 0) {return x/y;} - else {return -((x-y-1)/(-y));} - else - if (y >= 0) {return -((y-x-1)/y);} - else {return (-x)/(-y);} -} - -int64 SYSTEM_MOD(int64 x, int64 y) -{ - if (x == 0) return 0; - if (x >= 0) - if (y >= 0) {return x % y;} - else {return (y+1) + ((x-1) % (-y));} - else - if (y >= 0) {return (y-1) - ((-x-1) % y);} - else {return -((-x) % (-y));} -} - - -void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0) -{ - t -= __TPROC0OFF; - t0 -= __TPROC0OFF; - while (*t0 != __EOM) {*t = *t0; t--; t0--;} -} - - -void SYSTEM_ENUMP(void *adr, LONGINT n, void (*P)()) -{ - while (n > 0) { - P((address)(*((void**)(adr)))); - adr = ((void**)adr) + 1; - n--; - } -} - -void SYSTEM_ENUMR(void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()) -{ - LONGINT *t, off; - typ++; - while (n > 0) { - t = typ; - off = *t; - while (off >= 0) {P(*(address*)((char*)adr+off)); t++; off = *t;} - adr = ((char*)adr) + size; - n--; - } -} - -LONGINT SYSTEM_ENTIER(double x) -{ - LONGINT y; - if (x >= 0) - return (LONGINT)x; - else { - y = (LONGINT)x; - if (y <= x) return y; else return y - 1; - } -} - -extern void Heap_Lock(); -extern void Heap_Unlock(); - -SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, int nofdyn, ...) -{ - LONGINT nofelems, size, dataoff, n, nptr, *x, *p, nofptrs, i, *ptab, off; - va_list ap; - va_start(ap, nofdyn); - nofelems = 1; - while (nofdim > 0) { - nofelems = nofelems * va_arg(ap, LONGINT); nofdim--; - if (nofelems <= 0) __HALT(-20); - } - va_end(ap); - dataoff = nofdyn * sizeof(LONGINT); - if (elemalgn > sizeof(LONGINT)) { - n = dataoff % elemalgn; - if (n != 0) dataoff += elemalgn - n; - } - size = dataoff + nofelems * elemsz; - Heap_Lock(); - if (typ == NIL) { - /* element typ does not contain pointers */ - x = Heap_NEWBLK(size); - } - else if (typ == (LONGINT*)POINTER__typ) { - /* element type is a pointer */ - x = Heap_NEWBLK(size + nofelems * sizeof(LONGINT)); - p = (LONGINT*)(address)x[-1]; - p[-nofelems] = *p; /* build new type desc in situ: 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ - p -= nofelems - 1; n = 1; /* n =1 for skipping the size field */ - while (n <= nofelems) {*p = n*sizeof(LONGINT); p++; n++;} - *p = - (nofelems + 1) * sizeof(LONGINT); /* sentinel */ - x[-1] -= nofelems * sizeof(LONGINT); - } - else { - /* element type is a record that contains pointers */ - ptab = typ + 1; nofptrs = 0; - while (ptab[nofptrs] >= 0) {nofptrs++;} /* number of pointers per element */ - nptr = nofelems * nofptrs; /* total number of pointers */ - x = Heap_NEWBLK(size + nptr * sizeof(LONGINT)); - p = (LONGINT*)(address)x[- 1]; - p[-nptr] = *p; /* build new type desc in situ; 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ - p -= nptr - 1; n = 0; off = dataoff; - while (n < nofelems) {i = 0; - while (i < nofptrs) {*p = off + ptab[i]; p++; i++;} - off += elemsz; n++; - } - *p = - (nptr + 1) * sizeof(LONGINT); /* sentinel */ - x[-1] -= nptr * sizeof(LONGINT); - } - if (nofdyn != 0) { - /* setup len vector for index checks */ - va_start(ap, nofdyn); - p = x; - while (nofdyn > 0) {*p = va_arg(ap, LONGINT); p++, nofdyn--;} - va_end(ap); - } - Heap_Unlock(); - return x; -} - - - - -typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler - -#ifndef _WIN32 - - SystemSignalHandler handler[3] = {0}; - - // Provide signal handling for Unix based systems - void signalHandler(int s) { - if (s >= 2 && s <= 4) handler[s-2](s); - // (Ignore other signals) - } - - void SystemSetHandler(int s, address h) { - if (s >= 2 && s <= 4) { - int needtosetsystemhandler = handler[s-2] == 0; - handler[s-2] = (SystemSignalHandler)h; - if (needtosetsystemhandler) {signal(s, signalHandler);} - } - } - -#else - - // Provides Windows callback handlers for signal-like scenarios - #include "WindowsWrapper.h" - - SystemSignalHandler SystemInterruptHandler = 0; - SystemSignalHandler SystemQuitHandler = 0; - BOOL ConsoleCtrlHandlerSet = FALSE; - - BOOL WINAPI SystemConsoleCtrlHandler(DWORD ctrlType) { - if ((ctrlType == CTRL_C_EVENT) || (ctrlType == CTRL_BREAK_EVENT)) { - if (SystemInterruptHandler) { - SystemInterruptHandler(2); // SIGINT - return TRUE; - } - } else { // Close, logoff or shutdown - if (SystemQuitHandler) { - SystemQuitHandler(3); // SIGQUIT - return TRUE; - } - } - return FALSE; - } - - void EnsureConsoleCtrlHandler() { - if (!ConsoleCtrlHandlerSet) { - SetConsoleCtrlHandler(SystemConsoleCtrlHandler, TRUE); - ConsoleCtrlHandlerSet = TRUE; - } - } - - void SystemSetInterruptHandler(address h) { - EnsureConsoleCtrlHandler(); - SystemInterruptHandler = (SystemSignalHandler)h; - } - - void SystemSetQuitHandler(address h) { - EnsureConsoleCtrlHandler(); - SystemQuitHandler = (SystemSignalHandler)h; - } - -#endif diff --git a/bootstrap/unix-88/SYSTEM.h b/bootstrap/unix-88/SYSTEM.h deleted file mode 100644 index 168b0beb..00000000 --- a/bootstrap/unix-88/SYSTEM.h +++ /dev/null @@ -1,340 +0,0 @@ -#ifndef SYSTEM__h -#define SYSTEM__h - - -// 64 bit system detection - -#if (__SIZEOF_POINTER__ == 8) || defined (_LP64) || defined(__LP64__) || defined(_WIN64) - #define __o_64 -#endif - -// Temporary while bootstrapping and clearing up SYSTEM.c. - - -#ifndef LONGINT - #if defined (__o_64) - #define INTEGER int32 - #define LONGINT int64 - #define SET uint64 - #else - #define INTEGER int16 - #define LONGINT int32 - #define SET uint32 - #endif -#endif - - - - - -// Declare memcpy in a way compatible with C compilers intrinsic -// built in implementations. - -#if defined (__o_64) - #if defined(_WIN64) - typedef unsigned long long size_t; -// typedef long long address; - #else - typedef unsigned long size_t; -// typedef long address; - #endif -#else - typedef unsigned int size_t; -//typedef int address; -#endif - -#define _SIZE_T_DECLARED // For FreeBSD -#define _SIZE_T_DEFINED_ // For OpenBSD - -void *memcpy(void *dest, const void *source, size_t size); - - -// Declare fixed size versions of basic intger types - -#if defined (__o_64) && !defined(_WIN64) - // LP64 - typedef long int64; - typedef unsigned long uint64; -#else - // ILP32 or LLP64 - typedef long long int64; - typedef unsigned long long uint64; -#endif - -typedef int int32; -typedef unsigned int uint32; - -typedef short int int16; -typedef unsigned short int uint16; - -typedef signed char int8; -typedef unsigned char uint8; - - -// 'address' is a synonym for an int32 of pointer size - -#if defined (__o_64) - #define address int64 -#else - #define address int32 -#endif - -// The compiler uses 'import' and 'export' which translate to 'extern' and -// nothing respectively. - -#define import extern -#define export - - - -// Known constants - -#define NIL ((void*)0) -#define __MAXEXT 16 -#define POINTER__typ ((address*)(1)) // not NIL and not a valid type - - -// Oberon types - -typedef int8 BOOLEAN; -typedef int8 SYSTEM_BYTE; -typedef uint8 uSYSTEM_BYTE; -typedef uint8 CHAR; -typedef uint8 uCHAR; -typedef float REAL; -typedef double LONGREAL; -typedef void* SYSTEM_PTR; - -#define uSET SET - - - - -// ---------------------------------------------------------------------- -// ---------------------------------------------------------------------- - - - -// OS Memory allocation interfaces are in PlatformXXX.Mod - -extern address Platform_OSAllocate (address size); -extern void Platform_OSFree (address addr); - - -// Assertions and Halts - -extern void Platform_Halt(LONGINT x); -extern void Platform_AssertFail(LONGINT x); - -#define __HALT(x) Platform_Halt(x) -#define __ASSERT(cond, x) if (!(cond)) Platform_AssertFail((LONGINT)(x)) - - -// Index checking - -static inline int64 __XF(uint64 i, uint64 ub) {if (i >= ub) {__HALT(-2);} return i;} -#define __X(i, ub) (((uint64)(i)<(uint64)(ub))?i:(__HALT(-2),0)) - - -// Range checking, and checked SHORT and CHR functions - -static inline int64 __RF(uint64 i, uint64 ub) {if (i >= ub) {__HALT(-8);} return i;} -#define __R(i, ub) (((uint64)(i)<(uint64)(ub))?i:(__HALT(-8),0)) -#define __SHORT(x, ub) ((int)((uLONGINT)(x)+(ub)<(ub)+(ub)?(x):(__HALT(-8),0))) -#define __SHORTF(x, ub) ((int)(__RF((x)+(ub),(ub)+(ub))-(ub))) -#define __CHR(x) ((CHAR)__R(x, 256)) -#define __CHRF(x) ((CHAR)__RF(x, 256)) - - - -// Run time system routines in SYSTEM.c - - -extern LONGINT SYSTEM_ABS (LONGINT i); -extern double SYSTEM_ABSD (double i); -extern void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0); -extern void SYSTEM_ENUMP (void *adr, LONGINT n, void (*P)()); -extern void SYSTEM_ENUMR (void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()); -extern LONGINT SYSTEM_ENTIER (double x); - - -// Signal handling in SYSTEM.c - -#ifndef _WIN32 - extern void SystemSetHandler(int s, address h); -#else - extern void SystemSetInterruptHandler(address h); - extern void SystemSetQuitHandler (address h); -#endif - - - -// String comparison - -static inline int __str_cmp(CHAR *x, CHAR *y){ - LONGINT i = 0; - CHAR ch1, ch2; - do {ch1 = x[i]; ch2 = y[i]; i++; - if (!ch1) return -(int)ch2; - } while (ch1==ch2); - return (int)ch1 - (int)ch2; -} -#define __STRCMP(a,b) __str_cmp((CHAR*)(a), (CHAR*)(b)) - - - -// Inline string, record and array copy - -#define __COPY(s, d, n) {char*_a=(void*)s,*_b=(void*)d; LONGINT _i=0,_t=n-1; \ - while(_i<_t&&((_b[_i]=_a[_i])!=0)){_i++;};_b[_i]=0;} -#define __DUP(x, l, t) x=(void*)memcpy((void*)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) -#define __DUPARR(v, t) v=(void*)memcpy(v##__copy,v,sizeof(t)) -#define __DEL(x) Platform_OSFree((address)x) - - -/* SYSTEM ops */ - -#define __VAL(t, x) (*(t*)&(x)) - - -#define __GET(a, x, t) x=*(t*)(address)(a) -#define __PUT(a, x, t) *(t*)(address)(a)=x - -#define __LSHL(x, n, t) ((t)((u##t)(x)<<(n))) -#define __LSHR(x, n, t) ((t)((u##t)(x)>>(n))) -#define __LSH(x, n, t) ((n)>=0? __LSHL(x, n, t): __LSHR(x, -(n), t)) - -#define __ROTL(x, n, t) ((t)((u##t)(x)<<(n)|(u##t)(x)>>(8*sizeof(t)-(n)))) -#define __ROTR(x, n, t) ((t)((u##t)(x)>>(n)|(u##t)(x)<<(8*sizeof(t)-(n)))) -#define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) - -#define __ASHL(x, n) ((int64)(x)<<(n)) -#define __ASHR(x, n) ((int64)(x)>>(n)) -#define __ASH(x, n) ((n)>=0?__ASHL(x,n):__ASHR(x,-(n))) -static inline int64 SYSTEM_ASH(int64 x, int64 n) {return __ASH(x,n);} -#define __ASHF(x, n) SYSTEM_ASH((int64)(x), (int64)(n)) - -#define __BIT(x, n) (*(uint64*)(x)>>(n)&1) -#define __MOVE(s, d, n) memcpy((char*)(address)(d),(char*)(address)(s),n) - - -extern int64 SYSTEM_DIV(int64 x, int64 y); -#define __DIVF(x, y) SYSTEM_DIV(x, y) -#define __DIV(x, y) (((x)>0 && (y)>0) ? (x)/(y) : __DIVF(x, y)) - - -extern int64 SYSTEM_MOD(int64 x, int64 y); -#define __MODF(x, y) SYSTEM_MOD(x, y) -#define __MOD(x, y) (((x)>0 && (y)>0) ? (x)%(y) : __MODF(x, y)) - - - -#define __ENTIER(x) SYSTEM_ENTIER(x) -#define __ABS(x) (((x)<0)?-(x):(x)) -#define __ABSF(x) SYSTEM_ABS((LONGINT)(x)) -#define __ABSFD(x) SYSTEM_ABSD((double)(x)) -#define __CAP(ch) ((CHAR)((ch)&0x5f)) -#define __ODD(x) ((x)&1) -#define __IN(x, s) ((x)>=0 && (x)<(8*sizeof(SET)) && ((((uSET)(s))>>(x))&1)) -#define __SETOF(x) ((SET)1<<(x)) -#define __SETRNG(l, h) ((~(SET)0<<(l))&~(SET)0>>(8*sizeof(SET)-1-(h))) -#define __MASK(x, m) ((x)&~(m)) - - - -// Runtime checks - -#define __RETCHK __retchk: __HALT(-3); return 0; -#define __CASECHK __HALT(-4) -#define __WITHCHK __HALT(-7) - -#define __GUARDP(p, typ, level) ((typ*)(__ISP(p,typ,level)?p:(__HALT(-5),p))) -#define __GUARDR(r, typ, level) (*((typ*)(__IS(r##__typ,typ,level)?r:(__HALT(-5),r)))) -#define __GUARDA(p, typ, level) ((struct typ*)(__IS(__TYPEOF(p),typ,level)?p:(__HALT(-5),p))) -#define __GUARDEQR(p, dyntyp, typ) if(dyntyp!=typ##__typ) __HALT(-6);*(p) -#define __GUARDEQP(p, typ) if(__TYPEOF(p)!=typ##__typ)__HALT(-6);*(p) - - - -// Module entry/registration/exit - -extern void Heap_REGCMD(); -extern SYSTEM_PTR Heap_REGMOD(); -extern void Heap_REGTYP(); -extern void Heap_INCREF(); - -#define __DEFMOD static void *m; if (m!=0) {return m;} -#define __REGCMD(name, cmd) Heap_REGCMD(m, (CHAR*)name, cmd) -#define __REGMOD(name, enum) if (m==0) {m = Heap_REGMOD((CHAR*)name,enum);} -#define __ENDMOD return m -#define __MODULE_IMPORT(name) Heap_INCREF(name##__init()) - - - -// Main module initialisation, registration and finalisation - -extern void Platform_Init(INTEGER argc, address argv); -extern void Heap_FINALL(); - -#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (address)&argv); -#define __REGMAIN(name, enum) m = Heap_REGMOD((CHAR*)name,enum) -#define __FINI Heap_FINALL(); return 0 - - -// Memory allocation - -extern SYSTEM_PTR Heap_NEWBLK (address size); -extern SYSTEM_PTR Heap_NEWREC (address tag); -extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); - -#define __SYSNEW(p, len) p = Heap_NEWBLK((LONGINT)(len)) -#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(address)t##__typ) -#define __NEWARR SYSTEM_NEWARR - - - -/* Type handling */ - -#define __TDESC(t, m, n) \ - static struct t##__desc { \ - LONGINT tproc[m]; /* Proc for each ptr field */ \ - LONGINT tag; \ - LONGINT next; /* Module table type list points here */ \ - LONGINT level; \ - LONGINT module; \ - char name[24]; \ - LONGINT basep[__MAXEXT]; /* List of bases this extends */ \ - LONGINT reserved; \ - LONGINT blksz; /* xxx_typ points here */ \ - LONGINT ptr[n+1]; /* Offsets of ptrs up to -ve sentinel */ \ - } t##__desc - -#define __BASEOFF (__MAXEXT+1) // blksz as index to base. -#define __TPROC0OFF (__BASEOFF+24/sizeof(LONGINT)+5) // blksz as index to tproc IFF m=1. -#define __EOM 1 -#define __TDFLDS(name, size) {__EOM}, 1, 0, 0, 0, name, {0}, 0, size -#define __ENUMP(adr, n, P) SYSTEM_ENUMP(adr, (LONGINT)(n), P) -#define __ENUMR(adr, typ, size, n, P) SYSTEM_ENUMR(adr, typ, (LONGINT)(size), (LONGINT)(n), P) - -#define __INITYP(t, t0, level) \ - t##__typ = (LONGINT*)&t##__desc.blksz; \ - memcpy(t##__desc.basep, t0##__typ - __BASEOFF, level*sizeof(LONGINT)); \ - t##__desc.basep[level] = (LONGINT)(address)t##__typ; \ - t##__desc.module = (LONGINT)(address)m; \ - if(t##__desc.blksz!=sizeof(struct t)) __HALT(-15); \ - t##__desc.blksz = (t##__desc.blksz+5*sizeof(LONGINT)-1)/(4*sizeof(LONGINT))*(4*sizeof(LONGINT)); \ - Heap_REGTYP(m, (LONGINT)(address)&t##__desc.next); \ - SYSTEM_INHERIT(t##__typ, t0##__typ) - -#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(address)typ##__typ) -#define __TYPEOF(p) ((LONGINT*)(address)(*(((LONGINT*)(p))-1))) -#define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) - -// Oberon-2 type bound procedures support -#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(address)proc -#define __SEND(typ, num, funtyp, parlist) ((funtyp)((address)*(typ-(__TPROC0OFF+num))))parlist - - - - -#endif diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index d4ecf06e..d8c606d3 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index b664568e..130e1d06 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index b3c1a3bf..056c54e0 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index 116ee5e3..1e734f9d 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/Vishap.c b/bootstrap/unix-88/Vishap.c index a04ca149..08b89b00 100644 --- a/bootstrap/unix-88/Vishap.c +++ b/bootstrap/unix-88/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkamSf */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/WindowsWrapper.h b/bootstrap/unix-88/WindowsWrapper.h deleted file mode 100644 index b72c815a..00000000 --- a/bootstrap/unix-88/WindowsWrapper.h +++ /dev/null @@ -1,10 +0,0 @@ -// WindowsWrapper.h -// -// Includes Windows.h while avoiding conflicts with Oberon types. - - -#define BOOLEAN _BOOLEAN -#define CHAR _CHAR -#include -#undef BOOLEAN -#undef CHAR diff --git a/bootstrap/unix-88/errors.c b/bootstrap/unix-88/errors.c index 5dba1a33..84d35faf 100644 --- a/bootstrap/unix-88/errors.c +++ b/bootstrap/unix-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/errors.h b/bootstrap/unix-88/errors.h index 9d5bbe45..4fe434e1 100644 --- a/bootstrap/unix-88/errors.h +++ b/bootstrap/unix-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index 1080b9a3..7651bcf8 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index 8bdd3b71..5d996dae 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/vt100.c b/bootstrap/unix-88/vt100.c index 3efc2842..b7524886 100644 --- a/bootstrap/unix-88/vt100.c +++ b/bootstrap/unix-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/vt100.h b/bootstrap/unix-88/vt100.h index 71738164..ef3afa5a 100644 --- a/bootstrap/unix-88/vt100.h +++ b/bootstrap/unix-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index 5736ed9f..cc4f7969 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/11] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/12] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index 31877f12..3ce4467e 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Console.c b/bootstrap/windows-48/Console.c index 111663dc..6ad2295c 100644 --- a/bootstrap/windows-48/Console.c +++ b/bootstrap/windows-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -58,7 +58,7 @@ void Console_Int (int32 i, int32 n) { CHAR s[32]; int32 i1, k; - if (i == __LSHL(1, 31, int32)) { + if (i == __LSHL(1, 31, 32)) { __MOVE("8463847412", s, 11); k = 10; } else { diff --git a/bootstrap/windows-48/Console.h b/bootstrap/windows-48/Console.h index 78586a68..c6fe7fc4 100644 --- a/bootstrap/windows-48/Console.h +++ b/bootstrap/windows-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index b50a99c2..1e560865 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index 54236cf4..b082c461 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index 58be6181..4d96ea89 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tskSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index 827a3a7c..1a6c9e05 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index 66a8c776..9834a814 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index 02abd713..e34e59ed 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index 8d44024a..92c0af42 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index 5aaa8469..96866563 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 1122a8d0..452c85d2 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index 1a9ad61f..81e8362d 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index e6d709e7..671a9d8f 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -537,7 +537,7 @@ void OPM_err (int16 n) void OPM_FPrint (int32 *fp, int32 val) { - *fp = __ROTL((int32)((SET)*fp ^ (SET)val), 1, int32); + *fp = __ROTL((int32)((SET)*fp ^ (SET)val), 1, 32); } void OPM_FPrintSet (int32 *fp, SET set) @@ -652,7 +652,7 @@ int32 OPM_SignedMaximum (int32 bytecount) int32 _o_result; int32 result; result = 1; - result = __LSH(result, __ASHL(bytecount, 3) - 1, int32); + result = __LSH(result, __ASHL(bytecount, 3) - 1, 32); _o_result = result - 1; return _o_result; } diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index c5192f5b..0d9bcdeb 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index 6e2d4cd0..de0afa51 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index de48c5ba..2d3ebd77 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index 9b3bf8f0..e6e99c02 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index 8689aa3b..99448598 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 0d16f8ec..4a645e7a 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index b9e46b1a..93975ea1 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index e36e3be5..b264d44e 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -1039,7 +1039,7 @@ static void OPV_expr (OPT_Node n, int16 prec) } if (__IN(subclass, 0x18000000)) { OPM_WriteString((CHAR*)", ", 3); - OPC_Ident(l->typ->strobj); + OPM_WriteInt(__ASHL(l->typ->size, 3)); } OPM_Write(')'); break; diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index c692efd8..3b43e61e 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 777ee3b8..06824f8e 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index 587135b3..a2301fff 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index c9e8e867..e209af08 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index bd36f8d6..2779fc88 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/SYSTEM.c b/bootstrap/windows-48/SYSTEM.c deleted file mode 100644 index d7603f8e..00000000 --- a/bootstrap/windows-48/SYSTEM.c +++ /dev/null @@ -1,220 +0,0 @@ -/* -* The body prefix file of the voc(jet backend) runtime system, Version 1.0 -* -* Copyright (c) Software Templ, 1994, 1995 -* -* Module SYSTEM is subject to change any time without prior notification. -* Software Templ disclaims all warranties with regard to module SYSTEM, -* in particular shall Software Templ not be liable for any damage resulting -* from inappropriate use or modification of module SYSTEM. -* -* Version 1.1 jt, 24.11.95 fixes for correct pointer arithmetic on Cray computers -* jt 31.1.2007 ANSI prototypes for malloc and exit in order to avoid cc warnings -* -*/ - -#include "SYSTEM.h" -#include "stdarg.h" -#include - - -// Procedure verions of SYSTEM.H versions used when a multiply accessed -// parameter has side effects. - - - -LONGINT SYSTEM_ABS (LONGINT i) {return __ABS(i);} -double SYSTEM_ABSD(double i) {return __ABS(i);} - - -int64 SYSTEM_DIV(int64 x, int64 y) -{ - if (x == 0) return 0; - if (x >= 0) - if (y >= 0) {return x/y;} - else {return -((x-y-1)/(-y));} - else - if (y >= 0) {return -((y-x-1)/y);} - else {return (-x)/(-y);} -} - -int64 SYSTEM_MOD(int64 x, int64 y) -{ - if (x == 0) return 0; - if (x >= 0) - if (y >= 0) {return x % y;} - else {return (y+1) + ((x-1) % (-y));} - else - if (y >= 0) {return (y-1) - ((-x-1) % y);} - else {return -((-x) % (-y));} -} - - -void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0) -{ - t -= __TPROC0OFF; - t0 -= __TPROC0OFF; - while (*t0 != __EOM) {*t = *t0; t--; t0--;} -} - - -void SYSTEM_ENUMP(void *adr, LONGINT n, void (*P)()) -{ - while (n > 0) { - P((address)(*((void**)(adr)))); - adr = ((void**)adr) + 1; - n--; - } -} - -void SYSTEM_ENUMR(void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()) -{ - LONGINT *t, off; - typ++; - while (n > 0) { - t = typ; - off = *t; - while (off >= 0) {P(*(address*)((char*)adr+off)); t++; off = *t;} - adr = ((char*)adr) + size; - n--; - } -} - -LONGINT SYSTEM_ENTIER(double x) -{ - LONGINT y; - if (x >= 0) - return (LONGINT)x; - else { - y = (LONGINT)x; - if (y <= x) return y; else return y - 1; - } -} - -extern void Heap_Lock(); -extern void Heap_Unlock(); - -SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, int nofdyn, ...) -{ - LONGINT nofelems, size, dataoff, n, nptr, *x, *p, nofptrs, i, *ptab, off; - va_list ap; - va_start(ap, nofdyn); - nofelems = 1; - while (nofdim > 0) { - nofelems = nofelems * va_arg(ap, LONGINT); nofdim--; - if (nofelems <= 0) __HALT(-20); - } - va_end(ap); - dataoff = nofdyn * sizeof(LONGINT); - if (elemalgn > sizeof(LONGINT)) { - n = dataoff % elemalgn; - if (n != 0) dataoff += elemalgn - n; - } - size = dataoff + nofelems * elemsz; - Heap_Lock(); - if (typ == NIL) { - /* element typ does not contain pointers */ - x = Heap_NEWBLK(size); - } - else if (typ == (LONGINT*)POINTER__typ) { - /* element type is a pointer */ - x = Heap_NEWBLK(size + nofelems * sizeof(LONGINT)); - p = (LONGINT*)(address)x[-1]; - p[-nofelems] = *p; /* build new type desc in situ: 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ - p -= nofelems - 1; n = 1; /* n =1 for skipping the size field */ - while (n <= nofelems) {*p = n*sizeof(LONGINT); p++; n++;} - *p = - (nofelems + 1) * sizeof(LONGINT); /* sentinel */ - x[-1] -= nofelems * sizeof(LONGINT); - } - else { - /* element type is a record that contains pointers */ - ptab = typ + 1; nofptrs = 0; - while (ptab[nofptrs] >= 0) {nofptrs++;} /* number of pointers per element */ - nptr = nofelems * nofptrs; /* total number of pointers */ - x = Heap_NEWBLK(size + nptr * sizeof(LONGINT)); - p = (LONGINT*)(address)x[- 1]; - p[-nptr] = *p; /* build new type desc in situ; 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ - p -= nptr - 1; n = 0; off = dataoff; - while (n < nofelems) {i = 0; - while (i < nofptrs) {*p = off + ptab[i]; p++; i++;} - off += elemsz; n++; - } - *p = - (nptr + 1) * sizeof(LONGINT); /* sentinel */ - x[-1] -= nptr * sizeof(LONGINT); - } - if (nofdyn != 0) { - /* setup len vector for index checks */ - va_start(ap, nofdyn); - p = x; - while (nofdyn > 0) {*p = va_arg(ap, LONGINT); p++, nofdyn--;} - va_end(ap); - } - Heap_Unlock(); - return x; -} - - - - -typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler - -#ifndef _WIN32 - - SystemSignalHandler handler[3] = {0}; - - // Provide signal handling for Unix based systems - void signalHandler(int s) { - if (s >= 2 && s <= 4) handler[s-2](s); - // (Ignore other signals) - } - - void SystemSetHandler(int s, address h) { - if (s >= 2 && s <= 4) { - int needtosetsystemhandler = handler[s-2] == 0; - handler[s-2] = (SystemSignalHandler)h; - if (needtosetsystemhandler) {signal(s, signalHandler);} - } - } - -#else - - // Provides Windows callback handlers for signal-like scenarios - #include "WindowsWrapper.h" - - SystemSignalHandler SystemInterruptHandler = 0; - SystemSignalHandler SystemQuitHandler = 0; - BOOL ConsoleCtrlHandlerSet = FALSE; - - BOOL WINAPI SystemConsoleCtrlHandler(DWORD ctrlType) { - if ((ctrlType == CTRL_C_EVENT) || (ctrlType == CTRL_BREAK_EVENT)) { - if (SystemInterruptHandler) { - SystemInterruptHandler(2); // SIGINT - return TRUE; - } - } else { // Close, logoff or shutdown - if (SystemQuitHandler) { - SystemQuitHandler(3); // SIGQUIT - return TRUE; - } - } - return FALSE; - } - - void EnsureConsoleCtrlHandler() { - if (!ConsoleCtrlHandlerSet) { - SetConsoleCtrlHandler(SystemConsoleCtrlHandler, TRUE); - ConsoleCtrlHandlerSet = TRUE; - } - } - - void SystemSetInterruptHandler(address h) { - EnsureConsoleCtrlHandler(); - SystemInterruptHandler = (SystemSignalHandler)h; - } - - void SystemSetQuitHandler(address h) { - EnsureConsoleCtrlHandler(); - SystemQuitHandler = (SystemSignalHandler)h; - } - -#endif diff --git a/bootstrap/windows-48/SYSTEM.h b/bootstrap/windows-48/SYSTEM.h deleted file mode 100644 index 168b0beb..00000000 --- a/bootstrap/windows-48/SYSTEM.h +++ /dev/null @@ -1,340 +0,0 @@ -#ifndef SYSTEM__h -#define SYSTEM__h - - -// 64 bit system detection - -#if (__SIZEOF_POINTER__ == 8) || defined (_LP64) || defined(__LP64__) || defined(_WIN64) - #define __o_64 -#endif - -// Temporary while bootstrapping and clearing up SYSTEM.c. - - -#ifndef LONGINT - #if defined (__o_64) - #define INTEGER int32 - #define LONGINT int64 - #define SET uint64 - #else - #define INTEGER int16 - #define LONGINT int32 - #define SET uint32 - #endif -#endif - - - - - -// Declare memcpy in a way compatible with C compilers intrinsic -// built in implementations. - -#if defined (__o_64) - #if defined(_WIN64) - typedef unsigned long long size_t; -// typedef long long address; - #else - typedef unsigned long size_t; -// typedef long address; - #endif -#else - typedef unsigned int size_t; -//typedef int address; -#endif - -#define _SIZE_T_DECLARED // For FreeBSD -#define _SIZE_T_DEFINED_ // For OpenBSD - -void *memcpy(void *dest, const void *source, size_t size); - - -// Declare fixed size versions of basic intger types - -#if defined (__o_64) && !defined(_WIN64) - // LP64 - typedef long int64; - typedef unsigned long uint64; -#else - // ILP32 or LLP64 - typedef long long int64; - typedef unsigned long long uint64; -#endif - -typedef int int32; -typedef unsigned int uint32; - -typedef short int int16; -typedef unsigned short int uint16; - -typedef signed char int8; -typedef unsigned char uint8; - - -// 'address' is a synonym for an int32 of pointer size - -#if defined (__o_64) - #define address int64 -#else - #define address int32 -#endif - -// The compiler uses 'import' and 'export' which translate to 'extern' and -// nothing respectively. - -#define import extern -#define export - - - -// Known constants - -#define NIL ((void*)0) -#define __MAXEXT 16 -#define POINTER__typ ((address*)(1)) // not NIL and not a valid type - - -// Oberon types - -typedef int8 BOOLEAN; -typedef int8 SYSTEM_BYTE; -typedef uint8 uSYSTEM_BYTE; -typedef uint8 CHAR; -typedef uint8 uCHAR; -typedef float REAL; -typedef double LONGREAL; -typedef void* SYSTEM_PTR; - -#define uSET SET - - - - -// ---------------------------------------------------------------------- -// ---------------------------------------------------------------------- - - - -// OS Memory allocation interfaces are in PlatformXXX.Mod - -extern address Platform_OSAllocate (address size); -extern void Platform_OSFree (address addr); - - -// Assertions and Halts - -extern void Platform_Halt(LONGINT x); -extern void Platform_AssertFail(LONGINT x); - -#define __HALT(x) Platform_Halt(x) -#define __ASSERT(cond, x) if (!(cond)) Platform_AssertFail((LONGINT)(x)) - - -// Index checking - -static inline int64 __XF(uint64 i, uint64 ub) {if (i >= ub) {__HALT(-2);} return i;} -#define __X(i, ub) (((uint64)(i)<(uint64)(ub))?i:(__HALT(-2),0)) - - -// Range checking, and checked SHORT and CHR functions - -static inline int64 __RF(uint64 i, uint64 ub) {if (i >= ub) {__HALT(-8);} return i;} -#define __R(i, ub) (((uint64)(i)<(uint64)(ub))?i:(__HALT(-8),0)) -#define __SHORT(x, ub) ((int)((uLONGINT)(x)+(ub)<(ub)+(ub)?(x):(__HALT(-8),0))) -#define __SHORTF(x, ub) ((int)(__RF((x)+(ub),(ub)+(ub))-(ub))) -#define __CHR(x) ((CHAR)__R(x, 256)) -#define __CHRF(x) ((CHAR)__RF(x, 256)) - - - -// Run time system routines in SYSTEM.c - - -extern LONGINT SYSTEM_ABS (LONGINT i); -extern double SYSTEM_ABSD (double i); -extern void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0); -extern void SYSTEM_ENUMP (void *adr, LONGINT n, void (*P)()); -extern void SYSTEM_ENUMR (void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()); -extern LONGINT SYSTEM_ENTIER (double x); - - -// Signal handling in SYSTEM.c - -#ifndef _WIN32 - extern void SystemSetHandler(int s, address h); -#else - extern void SystemSetInterruptHandler(address h); - extern void SystemSetQuitHandler (address h); -#endif - - - -// String comparison - -static inline int __str_cmp(CHAR *x, CHAR *y){ - LONGINT i = 0; - CHAR ch1, ch2; - do {ch1 = x[i]; ch2 = y[i]; i++; - if (!ch1) return -(int)ch2; - } while (ch1==ch2); - return (int)ch1 - (int)ch2; -} -#define __STRCMP(a,b) __str_cmp((CHAR*)(a), (CHAR*)(b)) - - - -// Inline string, record and array copy - -#define __COPY(s, d, n) {char*_a=(void*)s,*_b=(void*)d; LONGINT _i=0,_t=n-1; \ - while(_i<_t&&((_b[_i]=_a[_i])!=0)){_i++;};_b[_i]=0;} -#define __DUP(x, l, t) x=(void*)memcpy((void*)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) -#define __DUPARR(v, t) v=(void*)memcpy(v##__copy,v,sizeof(t)) -#define __DEL(x) Platform_OSFree((address)x) - - -/* SYSTEM ops */ - -#define __VAL(t, x) (*(t*)&(x)) - - -#define __GET(a, x, t) x=*(t*)(address)(a) -#define __PUT(a, x, t) *(t*)(address)(a)=x - -#define __LSHL(x, n, t) ((t)((u##t)(x)<<(n))) -#define __LSHR(x, n, t) ((t)((u##t)(x)>>(n))) -#define __LSH(x, n, t) ((n)>=0? __LSHL(x, n, t): __LSHR(x, -(n), t)) - -#define __ROTL(x, n, t) ((t)((u##t)(x)<<(n)|(u##t)(x)>>(8*sizeof(t)-(n)))) -#define __ROTR(x, n, t) ((t)((u##t)(x)>>(n)|(u##t)(x)<<(8*sizeof(t)-(n)))) -#define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) - -#define __ASHL(x, n) ((int64)(x)<<(n)) -#define __ASHR(x, n) ((int64)(x)>>(n)) -#define __ASH(x, n) ((n)>=0?__ASHL(x,n):__ASHR(x,-(n))) -static inline int64 SYSTEM_ASH(int64 x, int64 n) {return __ASH(x,n);} -#define __ASHF(x, n) SYSTEM_ASH((int64)(x), (int64)(n)) - -#define __BIT(x, n) (*(uint64*)(x)>>(n)&1) -#define __MOVE(s, d, n) memcpy((char*)(address)(d),(char*)(address)(s),n) - - -extern int64 SYSTEM_DIV(int64 x, int64 y); -#define __DIVF(x, y) SYSTEM_DIV(x, y) -#define __DIV(x, y) (((x)>0 && (y)>0) ? (x)/(y) : __DIVF(x, y)) - - -extern int64 SYSTEM_MOD(int64 x, int64 y); -#define __MODF(x, y) SYSTEM_MOD(x, y) -#define __MOD(x, y) (((x)>0 && (y)>0) ? (x)%(y) : __MODF(x, y)) - - - -#define __ENTIER(x) SYSTEM_ENTIER(x) -#define __ABS(x) (((x)<0)?-(x):(x)) -#define __ABSF(x) SYSTEM_ABS((LONGINT)(x)) -#define __ABSFD(x) SYSTEM_ABSD((double)(x)) -#define __CAP(ch) ((CHAR)((ch)&0x5f)) -#define __ODD(x) ((x)&1) -#define __IN(x, s) ((x)>=0 && (x)<(8*sizeof(SET)) && ((((uSET)(s))>>(x))&1)) -#define __SETOF(x) ((SET)1<<(x)) -#define __SETRNG(l, h) ((~(SET)0<<(l))&~(SET)0>>(8*sizeof(SET)-1-(h))) -#define __MASK(x, m) ((x)&~(m)) - - - -// Runtime checks - -#define __RETCHK __retchk: __HALT(-3); return 0; -#define __CASECHK __HALT(-4) -#define __WITHCHK __HALT(-7) - -#define __GUARDP(p, typ, level) ((typ*)(__ISP(p,typ,level)?p:(__HALT(-5),p))) -#define __GUARDR(r, typ, level) (*((typ*)(__IS(r##__typ,typ,level)?r:(__HALT(-5),r)))) -#define __GUARDA(p, typ, level) ((struct typ*)(__IS(__TYPEOF(p),typ,level)?p:(__HALT(-5),p))) -#define __GUARDEQR(p, dyntyp, typ) if(dyntyp!=typ##__typ) __HALT(-6);*(p) -#define __GUARDEQP(p, typ) if(__TYPEOF(p)!=typ##__typ)__HALT(-6);*(p) - - - -// Module entry/registration/exit - -extern void Heap_REGCMD(); -extern SYSTEM_PTR Heap_REGMOD(); -extern void Heap_REGTYP(); -extern void Heap_INCREF(); - -#define __DEFMOD static void *m; if (m!=0) {return m;} -#define __REGCMD(name, cmd) Heap_REGCMD(m, (CHAR*)name, cmd) -#define __REGMOD(name, enum) if (m==0) {m = Heap_REGMOD((CHAR*)name,enum);} -#define __ENDMOD return m -#define __MODULE_IMPORT(name) Heap_INCREF(name##__init()) - - - -// Main module initialisation, registration and finalisation - -extern void Platform_Init(INTEGER argc, address argv); -extern void Heap_FINALL(); - -#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (address)&argv); -#define __REGMAIN(name, enum) m = Heap_REGMOD((CHAR*)name,enum) -#define __FINI Heap_FINALL(); return 0 - - -// Memory allocation - -extern SYSTEM_PTR Heap_NEWBLK (address size); -extern SYSTEM_PTR Heap_NEWREC (address tag); -extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); - -#define __SYSNEW(p, len) p = Heap_NEWBLK((LONGINT)(len)) -#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(address)t##__typ) -#define __NEWARR SYSTEM_NEWARR - - - -/* Type handling */ - -#define __TDESC(t, m, n) \ - static struct t##__desc { \ - LONGINT tproc[m]; /* Proc for each ptr field */ \ - LONGINT tag; \ - LONGINT next; /* Module table type list points here */ \ - LONGINT level; \ - LONGINT module; \ - char name[24]; \ - LONGINT basep[__MAXEXT]; /* List of bases this extends */ \ - LONGINT reserved; \ - LONGINT blksz; /* xxx_typ points here */ \ - LONGINT ptr[n+1]; /* Offsets of ptrs up to -ve sentinel */ \ - } t##__desc - -#define __BASEOFF (__MAXEXT+1) // blksz as index to base. -#define __TPROC0OFF (__BASEOFF+24/sizeof(LONGINT)+5) // blksz as index to tproc IFF m=1. -#define __EOM 1 -#define __TDFLDS(name, size) {__EOM}, 1, 0, 0, 0, name, {0}, 0, size -#define __ENUMP(adr, n, P) SYSTEM_ENUMP(adr, (LONGINT)(n), P) -#define __ENUMR(adr, typ, size, n, P) SYSTEM_ENUMR(adr, typ, (LONGINT)(size), (LONGINT)(n), P) - -#define __INITYP(t, t0, level) \ - t##__typ = (LONGINT*)&t##__desc.blksz; \ - memcpy(t##__desc.basep, t0##__typ - __BASEOFF, level*sizeof(LONGINT)); \ - t##__desc.basep[level] = (LONGINT)(address)t##__typ; \ - t##__desc.module = (LONGINT)(address)m; \ - if(t##__desc.blksz!=sizeof(struct t)) __HALT(-15); \ - t##__desc.blksz = (t##__desc.blksz+5*sizeof(LONGINT)-1)/(4*sizeof(LONGINT))*(4*sizeof(LONGINT)); \ - Heap_REGTYP(m, (LONGINT)(address)&t##__desc.next); \ - SYSTEM_INHERIT(t##__typ, t0##__typ) - -#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(address)typ##__typ) -#define __TYPEOF(p) ((LONGINT*)(address)(*(((LONGINT*)(p))-1))) -#define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) - -// Oberon-2 type bound procedures support -#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(address)proc -#define __SEND(typ, num, funtyp, parlist) ((funtyp)((address)*(typ-(__TPROC0OFF+num))))parlist - - - - -#endif diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index af7a679b..387345ab 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index d145001a..fe90bd09 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index c40b975f..c37a4a2c 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index 0aac4cc8..c6ee484f 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/Vishap.c b/bootstrap/windows-48/Vishap.c index b289dfa6..fb1c1662 100644 --- a/bootstrap/windows-48/Vishap.c +++ b/bootstrap/windows-48/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkamSf */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/WindowsWrapper.h b/bootstrap/windows-48/WindowsWrapper.h deleted file mode 100644 index b72c815a..00000000 --- a/bootstrap/windows-48/WindowsWrapper.h +++ /dev/null @@ -1,10 +0,0 @@ -// WindowsWrapper.h -// -// Includes Windows.h while avoiding conflicts with Oberon types. - - -#define BOOLEAN _BOOLEAN -#define CHAR _CHAR -#include -#undef BOOLEAN -#undef CHAR diff --git a/bootstrap/windows-48/errors.c b/bootstrap/windows-48/errors.c index 76fa35bf..7feed8e7 100644 --- a/bootstrap/windows-48/errors.c +++ b/bootstrap/windows-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/errors.h b/bootstrap/windows-48/errors.h index 9d5bbe45..4fe434e1 100644 --- a/bootstrap/windows-48/errors.h +++ b/bootstrap/windows-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index 3dbc28ba..0afff1f0 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index 8bdd3b71..5d996dae 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/vt100.c b/bootstrap/windows-48/vt100.c index 2e236578..8a5286ec 100644 --- a/bootstrap/windows-48/vt100.c +++ b/bootstrap/windows-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/vt100.h b/bootstrap/windows-48/vt100.h index 0eae5799..c09b4c71 100644 --- a/bootstrap/windows-48/vt100.h +++ b/bootstrap/windows-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index b5ee44a5..b023c21b 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/11] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/12] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index 31877f12..3ce4467e 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Console.c b/bootstrap/windows-88/Console.c index e24d169a..1190773d 100644 --- a/bootstrap/windows-88/Console.c +++ b/bootstrap/windows-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -58,7 +58,7 @@ void Console_Int (int64 i, int64 n) { CHAR s[32]; int64 i1, k; - if (i == __LSHL(1, 63, int64)) { + if (i == __LSHL(1, 63, 64)) { __MOVE("8085774586302733229", s, 20); k = 19; } else { diff --git a/bootstrap/windows-88/Console.h b/bootstrap/windows-88/Console.h index 1d06d0fe..27d906ad 100644 --- a/bootstrap/windows-88/Console.h +++ b/bootstrap/windows-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 0f262baa..dbe8d119 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 58cb3b1e..8a4fb7c5 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index d0175b87..67044d79 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tskSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index fabb54ef..584661bc 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 53bf2640..547909bb 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index 8e54ce53..2666971d 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index f22a9ab5..f048dc85 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index aa26ea1c..adefb869 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index 8916c00b..aee5581c 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index 71b95812..aba4bdbb 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index b15aba16..55420864 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -537,7 +537,7 @@ void OPM_err (int32 n) void OPM_FPrint (int64 *fp, int64 val) { - *fp = __ROTL((int64)((SET)*fp ^ (SET)val), 1, int64); + *fp = __ROTL((int64)((SET)*fp ^ (SET)val), 1, 64); } void OPM_FPrintSet (int64 *fp, SET set) @@ -650,7 +650,7 @@ int64 OPM_SignedMaximum (int64 bytecount) int64 _o_result; int64 result; result = 1; - result = __LSH(result, __ASHL(bytecount, 3) - 1, int64); + result = __LSH(result, __ASHL(bytecount, 3) - 1, 64); _o_result = result - 1; return _o_result; } diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index d23aed25..1e5c3e72 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index 3f77df4f..f175938c 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index de48c5ba..2d3ebd77 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index 491faa22..0c36910a 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index 3937b6f6..a16c2ce8 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index da8bab08..3006ea90 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 668c3d79..5f466ec4 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 52fc9966..082797f1 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -1039,7 +1039,7 @@ static void OPV_expr (OPT_Node n, int32 prec) } if (__IN(subclass, 0x18000000)) { OPM_WriteString((CHAR*)", ", 3); - OPC_Ident(l->typ->strobj); + OPM_WriteInt(__ASHL(l->typ->size, 3)); } OPM_Write(')'); break; diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index c692efd8..3b43e61e 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index b862e3ee..b7705767 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index d74f41bc..290fc518 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 185aec0b..2a753b7a 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index a2fc2612..c3cac05a 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/SYSTEM.c b/bootstrap/windows-88/SYSTEM.c deleted file mode 100644 index d7603f8e..00000000 --- a/bootstrap/windows-88/SYSTEM.c +++ /dev/null @@ -1,220 +0,0 @@ -/* -* The body prefix file of the voc(jet backend) runtime system, Version 1.0 -* -* Copyright (c) Software Templ, 1994, 1995 -* -* Module SYSTEM is subject to change any time without prior notification. -* Software Templ disclaims all warranties with regard to module SYSTEM, -* in particular shall Software Templ not be liable for any damage resulting -* from inappropriate use or modification of module SYSTEM. -* -* Version 1.1 jt, 24.11.95 fixes for correct pointer arithmetic on Cray computers -* jt 31.1.2007 ANSI prototypes for malloc and exit in order to avoid cc warnings -* -*/ - -#include "SYSTEM.h" -#include "stdarg.h" -#include - - -// Procedure verions of SYSTEM.H versions used when a multiply accessed -// parameter has side effects. - - - -LONGINT SYSTEM_ABS (LONGINT i) {return __ABS(i);} -double SYSTEM_ABSD(double i) {return __ABS(i);} - - -int64 SYSTEM_DIV(int64 x, int64 y) -{ - if (x == 0) return 0; - if (x >= 0) - if (y >= 0) {return x/y;} - else {return -((x-y-1)/(-y));} - else - if (y >= 0) {return -((y-x-1)/y);} - else {return (-x)/(-y);} -} - -int64 SYSTEM_MOD(int64 x, int64 y) -{ - if (x == 0) return 0; - if (x >= 0) - if (y >= 0) {return x % y;} - else {return (y+1) + ((x-1) % (-y));} - else - if (y >= 0) {return (y-1) - ((-x-1) % y);} - else {return -((-x) % (-y));} -} - - -void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0) -{ - t -= __TPROC0OFF; - t0 -= __TPROC0OFF; - while (*t0 != __EOM) {*t = *t0; t--; t0--;} -} - - -void SYSTEM_ENUMP(void *adr, LONGINT n, void (*P)()) -{ - while (n > 0) { - P((address)(*((void**)(adr)))); - adr = ((void**)adr) + 1; - n--; - } -} - -void SYSTEM_ENUMR(void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()) -{ - LONGINT *t, off; - typ++; - while (n > 0) { - t = typ; - off = *t; - while (off >= 0) {P(*(address*)((char*)adr+off)); t++; off = *t;} - adr = ((char*)adr) + size; - n--; - } -} - -LONGINT SYSTEM_ENTIER(double x) -{ - LONGINT y; - if (x >= 0) - return (LONGINT)x; - else { - y = (LONGINT)x; - if (y <= x) return y; else return y - 1; - } -} - -extern void Heap_Lock(); -extern void Heap_Unlock(); - -SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, int nofdyn, ...) -{ - LONGINT nofelems, size, dataoff, n, nptr, *x, *p, nofptrs, i, *ptab, off; - va_list ap; - va_start(ap, nofdyn); - nofelems = 1; - while (nofdim > 0) { - nofelems = nofelems * va_arg(ap, LONGINT); nofdim--; - if (nofelems <= 0) __HALT(-20); - } - va_end(ap); - dataoff = nofdyn * sizeof(LONGINT); - if (elemalgn > sizeof(LONGINT)) { - n = dataoff % elemalgn; - if (n != 0) dataoff += elemalgn - n; - } - size = dataoff + nofelems * elemsz; - Heap_Lock(); - if (typ == NIL) { - /* element typ does not contain pointers */ - x = Heap_NEWBLK(size); - } - else if (typ == (LONGINT*)POINTER__typ) { - /* element type is a pointer */ - x = Heap_NEWBLK(size + nofelems * sizeof(LONGINT)); - p = (LONGINT*)(address)x[-1]; - p[-nofelems] = *p; /* build new type desc in situ: 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ - p -= nofelems - 1; n = 1; /* n =1 for skipping the size field */ - while (n <= nofelems) {*p = n*sizeof(LONGINT); p++; n++;} - *p = - (nofelems + 1) * sizeof(LONGINT); /* sentinel */ - x[-1] -= nofelems * sizeof(LONGINT); - } - else { - /* element type is a record that contains pointers */ - ptab = typ + 1; nofptrs = 0; - while (ptab[nofptrs] >= 0) {nofptrs++;} /* number of pointers per element */ - nptr = nofelems * nofptrs; /* total number of pointers */ - x = Heap_NEWBLK(size + nptr * sizeof(LONGINT)); - p = (LONGINT*)(address)x[- 1]; - p[-nptr] = *p; /* build new type desc in situ; 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ - p -= nptr - 1; n = 0; off = dataoff; - while (n < nofelems) {i = 0; - while (i < nofptrs) {*p = off + ptab[i]; p++; i++;} - off += elemsz; n++; - } - *p = - (nptr + 1) * sizeof(LONGINT); /* sentinel */ - x[-1] -= nptr * sizeof(LONGINT); - } - if (nofdyn != 0) { - /* setup len vector for index checks */ - va_start(ap, nofdyn); - p = x; - while (nofdyn > 0) {*p = va_arg(ap, LONGINT); p++, nofdyn--;} - va_end(ap); - } - Heap_Unlock(); - return x; -} - - - - -typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler - -#ifndef _WIN32 - - SystemSignalHandler handler[3] = {0}; - - // Provide signal handling for Unix based systems - void signalHandler(int s) { - if (s >= 2 && s <= 4) handler[s-2](s); - // (Ignore other signals) - } - - void SystemSetHandler(int s, address h) { - if (s >= 2 && s <= 4) { - int needtosetsystemhandler = handler[s-2] == 0; - handler[s-2] = (SystemSignalHandler)h; - if (needtosetsystemhandler) {signal(s, signalHandler);} - } - } - -#else - - // Provides Windows callback handlers for signal-like scenarios - #include "WindowsWrapper.h" - - SystemSignalHandler SystemInterruptHandler = 0; - SystemSignalHandler SystemQuitHandler = 0; - BOOL ConsoleCtrlHandlerSet = FALSE; - - BOOL WINAPI SystemConsoleCtrlHandler(DWORD ctrlType) { - if ((ctrlType == CTRL_C_EVENT) || (ctrlType == CTRL_BREAK_EVENT)) { - if (SystemInterruptHandler) { - SystemInterruptHandler(2); // SIGINT - return TRUE; - } - } else { // Close, logoff or shutdown - if (SystemQuitHandler) { - SystemQuitHandler(3); // SIGQUIT - return TRUE; - } - } - return FALSE; - } - - void EnsureConsoleCtrlHandler() { - if (!ConsoleCtrlHandlerSet) { - SetConsoleCtrlHandler(SystemConsoleCtrlHandler, TRUE); - ConsoleCtrlHandlerSet = TRUE; - } - } - - void SystemSetInterruptHandler(address h) { - EnsureConsoleCtrlHandler(); - SystemInterruptHandler = (SystemSignalHandler)h; - } - - void SystemSetQuitHandler(address h) { - EnsureConsoleCtrlHandler(); - SystemQuitHandler = (SystemSignalHandler)h; - } - -#endif diff --git a/bootstrap/windows-88/SYSTEM.h b/bootstrap/windows-88/SYSTEM.h deleted file mode 100644 index 168b0beb..00000000 --- a/bootstrap/windows-88/SYSTEM.h +++ /dev/null @@ -1,340 +0,0 @@ -#ifndef SYSTEM__h -#define SYSTEM__h - - -// 64 bit system detection - -#if (__SIZEOF_POINTER__ == 8) || defined (_LP64) || defined(__LP64__) || defined(_WIN64) - #define __o_64 -#endif - -// Temporary while bootstrapping and clearing up SYSTEM.c. - - -#ifndef LONGINT - #if defined (__o_64) - #define INTEGER int32 - #define LONGINT int64 - #define SET uint64 - #else - #define INTEGER int16 - #define LONGINT int32 - #define SET uint32 - #endif -#endif - - - - - -// Declare memcpy in a way compatible with C compilers intrinsic -// built in implementations. - -#if defined (__o_64) - #if defined(_WIN64) - typedef unsigned long long size_t; -// typedef long long address; - #else - typedef unsigned long size_t; -// typedef long address; - #endif -#else - typedef unsigned int size_t; -//typedef int address; -#endif - -#define _SIZE_T_DECLARED // For FreeBSD -#define _SIZE_T_DEFINED_ // For OpenBSD - -void *memcpy(void *dest, const void *source, size_t size); - - -// Declare fixed size versions of basic intger types - -#if defined (__o_64) && !defined(_WIN64) - // LP64 - typedef long int64; - typedef unsigned long uint64; -#else - // ILP32 or LLP64 - typedef long long int64; - typedef unsigned long long uint64; -#endif - -typedef int int32; -typedef unsigned int uint32; - -typedef short int int16; -typedef unsigned short int uint16; - -typedef signed char int8; -typedef unsigned char uint8; - - -// 'address' is a synonym for an int32 of pointer size - -#if defined (__o_64) - #define address int64 -#else - #define address int32 -#endif - -// The compiler uses 'import' and 'export' which translate to 'extern' and -// nothing respectively. - -#define import extern -#define export - - - -// Known constants - -#define NIL ((void*)0) -#define __MAXEXT 16 -#define POINTER__typ ((address*)(1)) // not NIL and not a valid type - - -// Oberon types - -typedef int8 BOOLEAN; -typedef int8 SYSTEM_BYTE; -typedef uint8 uSYSTEM_BYTE; -typedef uint8 CHAR; -typedef uint8 uCHAR; -typedef float REAL; -typedef double LONGREAL; -typedef void* SYSTEM_PTR; - -#define uSET SET - - - - -// ---------------------------------------------------------------------- -// ---------------------------------------------------------------------- - - - -// OS Memory allocation interfaces are in PlatformXXX.Mod - -extern address Platform_OSAllocate (address size); -extern void Platform_OSFree (address addr); - - -// Assertions and Halts - -extern void Platform_Halt(LONGINT x); -extern void Platform_AssertFail(LONGINT x); - -#define __HALT(x) Platform_Halt(x) -#define __ASSERT(cond, x) if (!(cond)) Platform_AssertFail((LONGINT)(x)) - - -// Index checking - -static inline int64 __XF(uint64 i, uint64 ub) {if (i >= ub) {__HALT(-2);} return i;} -#define __X(i, ub) (((uint64)(i)<(uint64)(ub))?i:(__HALT(-2),0)) - - -// Range checking, and checked SHORT and CHR functions - -static inline int64 __RF(uint64 i, uint64 ub) {if (i >= ub) {__HALT(-8);} return i;} -#define __R(i, ub) (((uint64)(i)<(uint64)(ub))?i:(__HALT(-8),0)) -#define __SHORT(x, ub) ((int)((uLONGINT)(x)+(ub)<(ub)+(ub)?(x):(__HALT(-8),0))) -#define __SHORTF(x, ub) ((int)(__RF((x)+(ub),(ub)+(ub))-(ub))) -#define __CHR(x) ((CHAR)__R(x, 256)) -#define __CHRF(x) ((CHAR)__RF(x, 256)) - - - -// Run time system routines in SYSTEM.c - - -extern LONGINT SYSTEM_ABS (LONGINT i); -extern double SYSTEM_ABSD (double i); -extern void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0); -extern void SYSTEM_ENUMP (void *adr, LONGINT n, void (*P)()); -extern void SYSTEM_ENUMR (void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()); -extern LONGINT SYSTEM_ENTIER (double x); - - -// Signal handling in SYSTEM.c - -#ifndef _WIN32 - extern void SystemSetHandler(int s, address h); -#else - extern void SystemSetInterruptHandler(address h); - extern void SystemSetQuitHandler (address h); -#endif - - - -// String comparison - -static inline int __str_cmp(CHAR *x, CHAR *y){ - LONGINT i = 0; - CHAR ch1, ch2; - do {ch1 = x[i]; ch2 = y[i]; i++; - if (!ch1) return -(int)ch2; - } while (ch1==ch2); - return (int)ch1 - (int)ch2; -} -#define __STRCMP(a,b) __str_cmp((CHAR*)(a), (CHAR*)(b)) - - - -// Inline string, record and array copy - -#define __COPY(s, d, n) {char*_a=(void*)s,*_b=(void*)d; LONGINT _i=0,_t=n-1; \ - while(_i<_t&&((_b[_i]=_a[_i])!=0)){_i++;};_b[_i]=0;} -#define __DUP(x, l, t) x=(void*)memcpy((void*)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) -#define __DUPARR(v, t) v=(void*)memcpy(v##__copy,v,sizeof(t)) -#define __DEL(x) Platform_OSFree((address)x) - - -/* SYSTEM ops */ - -#define __VAL(t, x) (*(t*)&(x)) - - -#define __GET(a, x, t) x=*(t*)(address)(a) -#define __PUT(a, x, t) *(t*)(address)(a)=x - -#define __LSHL(x, n, t) ((t)((u##t)(x)<<(n))) -#define __LSHR(x, n, t) ((t)((u##t)(x)>>(n))) -#define __LSH(x, n, t) ((n)>=0? __LSHL(x, n, t): __LSHR(x, -(n), t)) - -#define __ROTL(x, n, t) ((t)((u##t)(x)<<(n)|(u##t)(x)>>(8*sizeof(t)-(n)))) -#define __ROTR(x, n, t) ((t)((u##t)(x)>>(n)|(u##t)(x)<<(8*sizeof(t)-(n)))) -#define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) - -#define __ASHL(x, n) ((int64)(x)<<(n)) -#define __ASHR(x, n) ((int64)(x)>>(n)) -#define __ASH(x, n) ((n)>=0?__ASHL(x,n):__ASHR(x,-(n))) -static inline int64 SYSTEM_ASH(int64 x, int64 n) {return __ASH(x,n);} -#define __ASHF(x, n) SYSTEM_ASH((int64)(x), (int64)(n)) - -#define __BIT(x, n) (*(uint64*)(x)>>(n)&1) -#define __MOVE(s, d, n) memcpy((char*)(address)(d),(char*)(address)(s),n) - - -extern int64 SYSTEM_DIV(int64 x, int64 y); -#define __DIVF(x, y) SYSTEM_DIV(x, y) -#define __DIV(x, y) (((x)>0 && (y)>0) ? (x)/(y) : __DIVF(x, y)) - - -extern int64 SYSTEM_MOD(int64 x, int64 y); -#define __MODF(x, y) SYSTEM_MOD(x, y) -#define __MOD(x, y) (((x)>0 && (y)>0) ? (x)%(y) : __MODF(x, y)) - - - -#define __ENTIER(x) SYSTEM_ENTIER(x) -#define __ABS(x) (((x)<0)?-(x):(x)) -#define __ABSF(x) SYSTEM_ABS((LONGINT)(x)) -#define __ABSFD(x) SYSTEM_ABSD((double)(x)) -#define __CAP(ch) ((CHAR)((ch)&0x5f)) -#define __ODD(x) ((x)&1) -#define __IN(x, s) ((x)>=0 && (x)<(8*sizeof(SET)) && ((((uSET)(s))>>(x))&1)) -#define __SETOF(x) ((SET)1<<(x)) -#define __SETRNG(l, h) ((~(SET)0<<(l))&~(SET)0>>(8*sizeof(SET)-1-(h))) -#define __MASK(x, m) ((x)&~(m)) - - - -// Runtime checks - -#define __RETCHK __retchk: __HALT(-3); return 0; -#define __CASECHK __HALT(-4) -#define __WITHCHK __HALT(-7) - -#define __GUARDP(p, typ, level) ((typ*)(__ISP(p,typ,level)?p:(__HALT(-5),p))) -#define __GUARDR(r, typ, level) (*((typ*)(__IS(r##__typ,typ,level)?r:(__HALT(-5),r)))) -#define __GUARDA(p, typ, level) ((struct typ*)(__IS(__TYPEOF(p),typ,level)?p:(__HALT(-5),p))) -#define __GUARDEQR(p, dyntyp, typ) if(dyntyp!=typ##__typ) __HALT(-6);*(p) -#define __GUARDEQP(p, typ) if(__TYPEOF(p)!=typ##__typ)__HALT(-6);*(p) - - - -// Module entry/registration/exit - -extern void Heap_REGCMD(); -extern SYSTEM_PTR Heap_REGMOD(); -extern void Heap_REGTYP(); -extern void Heap_INCREF(); - -#define __DEFMOD static void *m; if (m!=0) {return m;} -#define __REGCMD(name, cmd) Heap_REGCMD(m, (CHAR*)name, cmd) -#define __REGMOD(name, enum) if (m==0) {m = Heap_REGMOD((CHAR*)name,enum);} -#define __ENDMOD return m -#define __MODULE_IMPORT(name) Heap_INCREF(name##__init()) - - - -// Main module initialisation, registration and finalisation - -extern void Platform_Init(INTEGER argc, address argv); -extern void Heap_FINALL(); - -#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (address)&argv); -#define __REGMAIN(name, enum) m = Heap_REGMOD((CHAR*)name,enum) -#define __FINI Heap_FINALL(); return 0 - - -// Memory allocation - -extern SYSTEM_PTR Heap_NEWBLK (address size); -extern SYSTEM_PTR Heap_NEWREC (address tag); -extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); - -#define __SYSNEW(p, len) p = Heap_NEWBLK((LONGINT)(len)) -#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(address)t##__typ) -#define __NEWARR SYSTEM_NEWARR - - - -/* Type handling */ - -#define __TDESC(t, m, n) \ - static struct t##__desc { \ - LONGINT tproc[m]; /* Proc for each ptr field */ \ - LONGINT tag; \ - LONGINT next; /* Module table type list points here */ \ - LONGINT level; \ - LONGINT module; \ - char name[24]; \ - LONGINT basep[__MAXEXT]; /* List of bases this extends */ \ - LONGINT reserved; \ - LONGINT blksz; /* xxx_typ points here */ \ - LONGINT ptr[n+1]; /* Offsets of ptrs up to -ve sentinel */ \ - } t##__desc - -#define __BASEOFF (__MAXEXT+1) // blksz as index to base. -#define __TPROC0OFF (__BASEOFF+24/sizeof(LONGINT)+5) // blksz as index to tproc IFF m=1. -#define __EOM 1 -#define __TDFLDS(name, size) {__EOM}, 1, 0, 0, 0, name, {0}, 0, size -#define __ENUMP(adr, n, P) SYSTEM_ENUMP(adr, (LONGINT)(n), P) -#define __ENUMR(adr, typ, size, n, P) SYSTEM_ENUMR(adr, typ, (LONGINT)(size), (LONGINT)(n), P) - -#define __INITYP(t, t0, level) \ - t##__typ = (LONGINT*)&t##__desc.blksz; \ - memcpy(t##__desc.basep, t0##__typ - __BASEOFF, level*sizeof(LONGINT)); \ - t##__desc.basep[level] = (LONGINT)(address)t##__typ; \ - t##__desc.module = (LONGINT)(address)m; \ - if(t##__desc.blksz!=sizeof(struct t)) __HALT(-15); \ - t##__desc.blksz = (t##__desc.blksz+5*sizeof(LONGINT)-1)/(4*sizeof(LONGINT))*(4*sizeof(LONGINT)); \ - Heap_REGTYP(m, (LONGINT)(address)&t##__desc.next); \ - SYSTEM_INHERIT(t##__typ, t0##__typ) - -#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(address)typ##__typ) -#define __TYPEOF(p) ((LONGINT*)(address)(*(((LONGINT*)(p))-1))) -#define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) - -// Oberon-2 type bound procedures support -#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(address)proc -#define __SEND(typ, num, funtyp, parlist) ((funtyp)((address)*(typ-(__TPROC0OFF+num))))parlist - - - - -#endif diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index d4ecf06e..d8c606d3 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index b664568e..130e1d06 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index b3c1a3bf..056c54e0 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index 116ee5e3..1e734f9d 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/Vishap.c b/bootstrap/windows-88/Vishap.c index a04ca149..08b89b00 100644 --- a/bootstrap/windows-88/Vishap.c +++ b/bootstrap/windows-88/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkamSf */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/WindowsWrapper.h b/bootstrap/windows-88/WindowsWrapper.h deleted file mode 100644 index b72c815a..00000000 --- a/bootstrap/windows-88/WindowsWrapper.h +++ /dev/null @@ -1,10 +0,0 @@ -// WindowsWrapper.h -// -// Includes Windows.h while avoiding conflicts with Oberon types. - - -#define BOOLEAN _BOOLEAN -#define CHAR _CHAR -#include -#undef BOOLEAN -#undef CHAR diff --git a/bootstrap/windows-88/errors.c b/bootstrap/windows-88/errors.c index 5dba1a33..84d35faf 100644 --- a/bootstrap/windows-88/errors.c +++ b/bootstrap/windows-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/errors.h b/bootstrap/windows-88/errors.h index 9d5bbe45..4fe434e1 100644 --- a/bootstrap/windows-88/errors.h +++ b/bootstrap/windows-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index 1080b9a3..7651bcf8 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index 8bdd3b71..5d996dae 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/vt100.c b/bootstrap/windows-88/vt100.c index 3efc2842..b7524886 100644 --- a/bootstrap/windows-88/vt100.c +++ b/bootstrap/windows-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/vt100.h b/bootstrap/windows-88/vt100.h index 71738164..ef3afa5a 100644 --- a/bootstrap/windows-88/vt100.h +++ b/bootstrap/windows-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/makefile b/makefile index 31f5fa39..ade812e7 100644 --- a/makefile +++ b/makefile @@ -248,6 +248,7 @@ bootstrap: configuration make -f src/tools/make/vishap.make -s translate INTSIZE=4 ADRSIZE=8 ALIGNMENT=8 PLATFORM=unix BUILDDIR=bootstrap/unix-88 && rm bootstrap/unix-88/*.sym make -f src/tools/make/vishap.make -s translate INTSIZE=2 ADRSIZE=4 ALIGNMENT=8 PLATFORM=windows BUILDDIR=bootstrap/windows-48 && rm bootstrap/windows-48/*.sym make -f src/tools/make/vishap.make -s translate INTSIZE=4 ADRSIZE=8 ALIGNMENT=8 PLATFORM=windows BUILDDIR=bootstrap/windows-88 && rm bootstrap/windows-88/*.sym + cp src/system/*.[ch] bootstrap bootstrapunclean: @@ -257,6 +258,7 @@ bootstrapunclean: make -f src/tools/make/vishap.make -s translate INTSIZE=4 ADRSIZE=8 ALIGNMENT=8 PLATFORM=unix BUILDDIR=bootstrap/unix-88 && rm bootstrap/unix-88/*.sym make -f src/tools/make/vishap.make -s translate INTSIZE=2 ADRSIZE=4 ALIGNMENT=8 PLATFORM=windows BUILDDIR=bootstrap/windows-48 && rm bootstrap/windows-48/*.sym make -f src/tools/make/vishap.make -s translate INTSIZE=4 ADRSIZE=8 ALIGNMENT=8 PLATFORM=windows BUILDDIR=bootstrap/windows-88 && rm bootstrap/windows-88/*.sym + cp src/system/*.[ch] bootstrap diff --git a/src/compiler/OPV.Mod b/src/compiler/OPV.Mod index 61125e5b..2f679ace 100644 --- a/src/compiler/OPV.Mod +++ b/src/compiler/OPV.Mod @@ -625,7 +625,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 OPM.WriteInt(-r^.conval^.intval) ELSE expr(r, MinPrec) END ; - IF subclass IN {OPT.lsh, OPT.rot} THEN OPM.WriteString(Comma); OPC.Ident(l^.typ^.strobj) END ; + IF subclass IN {OPT.lsh, OPT.rot} THEN OPM.WriteString(Comma); OPM.WriteInt(l.typ.size*8) END; OPM.Write(CloseParen) | OPS.eql .. OPS.geq: IF l^.typ^.form IN {OPT.String, OPT.Comp} THEN diff --git a/src/system/SYSTEM.h b/src/system/SYSTEM.h index 168b0beb..709c26a7 100644 --- a/src/system/SYSTEM.h +++ b/src/system/SYSTEM.h @@ -33,14 +33,11 @@ #if defined (__o_64) #if defined(_WIN64) typedef unsigned long long size_t; -// typedef long long address; #else typedef unsigned long size_t; -// typedef long address; #endif #else typedef unsigned int size_t; -//typedef int address; #endif #define _SIZE_T_DECLARED // For FreeBSD @@ -71,14 +68,6 @@ typedef signed char int8; typedef unsigned char uint8; -// 'address' is a synonym for an int32 of pointer size - -#if defined (__o_64) - #define address int64 -#else - #define address int32 -#endif - // The compiler uses 'import' and 'export' which translate to 'extern' and // nothing respectively. @@ -98,9 +87,7 @@ typedef unsigned char uint8; typedef int8 BOOLEAN; typedef int8 SYSTEM_BYTE; -typedef uint8 uSYSTEM_BYTE; typedef uint8 CHAR; -typedef uint8 uCHAR; typedef float REAL; typedef double LONGREAL; typedef void* SYSTEM_PTR; @@ -108,6 +95,16 @@ typedef void* SYSTEM_PTR; #define uSET SET +// 'address' is a synonym for an int of pointer size + +#if defined (__o_64) + #define address int64 +#else + #define address int32 +#endif + + + // ---------------------------------------------------------------------- @@ -200,13 +197,13 @@ static inline int __str_cmp(CHAR *x, CHAR *y){ #define __GET(a, x, t) x=*(t*)(address)(a) #define __PUT(a, x, t) *(t*)(address)(a)=x -#define __LSHL(x, n, t) ((t)((u##t)(x)<<(n))) -#define __LSHR(x, n, t) ((t)((u##t)(x)>>(n))) -#define __LSH(x, n, t) ((n)>=0? __LSHL(x, n, t): __LSHR(x, -(n), t)) +#define __LSHL(x, n, s) ((int##s)((uint##s)(x)<<(n))) +#define __LSHR(x, n, s) ((int##s)((uint##s)(x)>>(n))) +#define __LSH(x, n, s) ((n)>=0? __LSHL(x, n, s): __LSHR(x, -(n), s)) -#define __ROTL(x, n, t) ((t)((u##t)(x)<<(n)|(u##t)(x)>>(8*sizeof(t)-(n)))) -#define __ROTR(x, n, t) ((t)((u##t)(x)>>(n)|(u##t)(x)<<(8*sizeof(t)-(n)))) -#define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) +#define __ROTL(x, n, s) ((int##s)((uint##s)(x)<<(n)|(uint##s)(x)>>(s-(n)))) +#define __ROTR(x, n, s) ((int##s)((uint##s)(x)>>(n)|(uint##s)(x)<<(s-(n)))) +#define __ROT(x, n, s) ((n)>=0? __ROTL(x, n, s): __ROTR(x, -(n), s)) #define __ASHL(x, n) ((int64)(x)<<(n)) #define __ASHR(x, n) ((int64)(x)>>(n)) diff --git a/src/test/confidence/language/TestLanguage.mod b/src/test/confidence/language/TestLanguage.mod index 3db99f44..724ae63a 100644 --- a/src/test/confidence/language/TestLanguage.mod +++ b/src/test/confidence/language/TestLanguage.mod @@ -2,8 +2,20 @@ MODULE TestLanguage; IMPORT SYSTEM, Console; +PROCEDURE TestShiftResult(of, by, actual, expected: LONGINT; msg: ARRAY OF CHAR); +BEGIN + IF actual # expected THEN + Console.String(msg); + Console.String(" of $"); Console.Hex(of); + Console.String(" by "); Console.Int(by,1); + Console.String(" is $"); Console.Hex(actual); + Console.String(" but should be $"); Console.Hex(expected); + Console.Ln; + END +END TestShiftResult; + PROCEDURE Shift; -VAR c: CHAR; b: SYSTEM.BYTE; s,t,u: SHORTINT; h,i,j,k: INTEGER; l,m,n: LONGINT; +VAR c: CHAR; b: SYSTEM.BYTE; s,t,u: SHORTINT; h,i,j,k: INTEGER; l,m,n,r: LONGINT; (* Aritmetic shift always returns type LONGINT. Defined as x * 2**n. LSH and ROT produces results of the same type as the value being shifted. @@ -13,8 +25,8 @@ BEGIN i := 0; m := 1; WHILE i < SIZE(LONGINT)*8 DO - l := 1; l := SYSTEM.LSH(l,i); ASSERT(l = m, 16); - l := 1; l := SYSTEM.ROT(l,i); ASSERT(l = m, 17); + l := 1; r := SYSTEM.LSH(l,i); TestShiftResult(l, i, r, m, "LSH"); + l := 1; r := SYSTEM.ROT(l,i); TestShiftResult(l, i, r, m, "ROT(1)"); m := m * 2; INC(i); END; @@ -84,9 +96,55 @@ BEGIN END; + (* Positive LSH shifts and ROTs with overflow *) + + i := 1; m := 1; + WHILE i < SIZE(LONGINT)*8 DO + l := MAX(LONGINT); INC(l); r := SYSTEM.LSH(l,i); TestShiftResult(l, i, r, 0, "LSH"); + l := MAX(LONGINT); INC(l); r := SYSTEM.ROT(l,i); TestShiftResult(l, i, r, m, "ROT(2)"); + m := m * 2; INC(i); + END; + + i := 1; k := 1; + WHILE i < SIZE(INTEGER)*8 DO + j := MAX(INTEGER); INC(j); r := SYSTEM.LSH(j,i); TestShiftResult(j, i, r, 0, "LSH"); + j := MAX(INTEGER); INC(j); r := SYSTEM.ROT(j,i); TestShiftResult(j, i, r, k, "ROT(3)"); + k := k * 2; INC(i); + END; + + i := 1; t := 1; + WHILE i < SIZE(SHORTINT)*8 DO + s := MAX(SHORTINT); INC(s); r := SYSTEM.LSH(s,i); TestShiftResult(s, i, r, 0, "LSH"); + s := MAX(SHORTINT); INC(s); r := SYSTEM.ROT(s,i); TestShiftResult(s, i, r, t, "ROT(4)"); + t := t * 2; INC(i); + END; + + (* Negative LSH shifts and ROTs without overflow *) + + i := -1; m := MAX(LONGINT); INC(m); + WHILE i > -SIZE(LONGINT)*8 DO + l := 1; r := SYSTEM.LSH(l,i); TestShiftResult(l, i, r, 0, "LSH"); + l := 1; r := SYSTEM.ROT(l,i); TestShiftResult(l, i, r, m, "ROT"); + m := SYSTEM.LSH(m,-1); (* m := m DIV 2; *) + DEC(i); + END; + + i := -1; k := MAX(INTEGER); INC(k); + WHILE i > -SIZE(INTEGER)*8 DO + j := 1; r := SYSTEM.LSH(j,i); TestShiftResult(j, i, r, 0, "LSH"); + j := 1; r := SYSTEM.ROT(j,i); TestShiftResult(j, i, r, k, "ROT"); + k := SYSTEM.LSH(k,-1); (* k := k DIV 2; *) + DEC(i); + END; + + i := -1; t := MAX(SHORTINT); INC(t); + WHILE i > -SIZE(SHORTINT)*8 DO + s := 1; r := SYSTEM.LSH(s,i); TestShiftResult(s, i, r, 0, "LSH"); + s := 1; r := SYSTEM.ROT(s,i); TestShiftResult(s, i, r, t, "ROT"); + t := SYSTEM.LSH(t,-1); (* t := t DIV 2; *) + DEC(i); + END; - (* Also need tests that bits that are shifted / rotated off the end - are zeroed or wrapped correctly. *) (* Also need full tests for CHAR, and poossibly SYSTEM.BYTE. Here's a simple one *) @@ -138,7 +196,6 @@ BEGIN => x MOd y = x - ((x DIV y) * y) *) - i := 4; j := 3; TestValue(i MOD j, i - ((i DIV j) * j), "4 MOD 3"); i := 5; j := 3; TestValue(i MOD j, i - ((i DIV j) * j), "5 MOD 3"); i := 6; j := 3; TestValue(i MOD j, i - ((i DIV j) * j), "6 MOD 3"); @@ -161,6 +218,8 @@ BEGIN END DivMod; + + PROCEDURE IntSize; VAR l: LONGINT; BEGIN @@ -187,6 +246,9 @@ BEGIN END; END IntSize; + + + BEGIN Shift; DivMod; diff --git a/src/test/confidence/planned-binary-change b/src/test/confidence/planned-binary-change index 3c9d13b0..ebcef2cb 100644 --- a/src/test/confidence/planned-binary-change +++ b/src/test/confidence/planned-binary-change @@ -1 +1 @@ -09 Sep 2016 14:20:47 +12 Sep 2016 15:40:20 diff --git a/src/tools/make/vishap.make b/src/tools/make/vishap.make index 838b5ef7..faacf33f 100644 --- a/src/tools/make/vishap.make +++ b/src/tools/make/vishap.make @@ -70,6 +70,8 @@ assemble: SYSTEM.o Configuration.o Platform.o Heap.o Console.o Strings.o Modules.o Files.o \ Reals.o Texts.o vt100.o errors.o OPM.o extTools.o OPS.o OPT.o \ OPC.o OPV.o OPB.o OPP.o + + cp src/system/*.[ch] $(BUILDDIR) @printf "$(VISHAP) created.\n" @@ -79,7 +81,9 @@ compilerfromsavedsource: @echo Populating clean build directory from bootstrap C sources. @mkdir -p $(BUILDDIR) @cp bootstrap/$(PLATFORM)-$(ADRSIZE)$(ALIGNMENT)/* $(BUILDDIR) + @cp bootstrap/*.[ch] $(BUILDDIR) @make -f src/tools/make/vishap.make -s assemble + @cp bootstrap/*.[ch] $(BUILDDIR) @@ -119,8 +123,6 @@ translate: cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -B$(INTSIZE)$(ADRSIZE)$(ALIGNMENT) ../../src/compiler/OPP.Mod cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ssfm -B$(INTSIZE)$(ADRSIZE)$(ALIGNMENT) ../../src/compiler/Vishap.Mod - cp src/system/*.[ch] $(BUILDDIR) - @printf "$(BUILDDIR) filled with compiler C source.\n" From 516e261242dee20da76a9114b647f2720580fc0a Mon Sep 17 00:00:00 2001 From: David Brown Date: Mon, 12 Sep 2016 17:03:02 +0100 Subject: [PATCH 224/580] Support int64 in ABS. Remove unneccessary cast in __XF, __RF. --- src/system/SYSTEM.c | 3 --- src/system/SYSTEM.h | 19 ++++++++++++------- src/test/confidence/language/TestLanguage.mod | 18 ++++++++++++++++++ src/test/confidence/planned-binary-change | 2 +- 4 files changed, 31 insertions(+), 11 deletions(-) diff --git a/src/system/SYSTEM.c b/src/system/SYSTEM.c index d7603f8e..defcc9fa 100644 --- a/src/system/SYSTEM.c +++ b/src/system/SYSTEM.c @@ -23,9 +23,6 @@ -LONGINT SYSTEM_ABS (LONGINT i) {return __ABS(i);} -double SYSTEM_ABSD(double i) {return __ABS(i);} - int64 SYSTEM_DIV(int64 x, int64 y) { diff --git a/src/system/SYSTEM.h b/src/system/SYSTEM.h index 709c26a7..fa63a9ab 100644 --- a/src/system/SYSTEM.h +++ b/src/system/SYSTEM.h @@ -130,13 +130,13 @@ extern void Platform_AssertFail(LONGINT x); // Index checking static inline int64 __XF(uint64 i, uint64 ub) {if (i >= ub) {__HALT(-2);} return i;} -#define __X(i, ub) (((uint64)(i)<(uint64)(ub))?i:(__HALT(-2),0)) +#define __X(i, ub) (((i)<(ub))?i:(__HALT(-2),0)) // Range checking, and checked SHORT and CHR functions static inline int64 __RF(uint64 i, uint64 ub) {if (i >= ub) {__HALT(-8);} return i;} -#define __R(i, ub) (((uint64)(i)<(uint64)(ub))?i:(__HALT(-8),0)) +#define __R(i, ub) (((i)<(ub))?i:(__HALT(-8),0)) #define __SHORT(x, ub) ((int)((uLONGINT)(x)+(ub)<(ub)+(ub)?(x):(__HALT(-8),0))) #define __SHORTF(x, ub) ((int)(__RF((x)+(ub),(ub)+(ub))-(ub))) #define __CHR(x) ((CHAR)__R(x, 256)) @@ -147,8 +147,6 @@ static inline int64 __RF(uint64 i, uint64 ub) {if (i >= ub) {__HALT(-8);} return // Run time system routines in SYSTEM.c -extern LONGINT SYSTEM_ABS (LONGINT i); -extern double SYSTEM_ABSD (double i); extern void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0); extern void SYSTEM_ENUMP (void *adr, LONGINT n, void (*P)()); extern void SYSTEM_ENUMR (void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()); @@ -227,9 +225,16 @@ extern int64 SYSTEM_MOD(int64 x, int64 y); #define __ENTIER(x) SYSTEM_ENTIER(x) -#define __ABS(x) (((x)<0)?-(x):(x)) -#define __ABSF(x) SYSTEM_ABS((LONGINT)(x)) -#define __ABSFD(x) SYSTEM_ABSD((double)(x)) + +#define __ABS(x) (((x)<0)?-(x):(x)) + +static inline int32 SYSTEM_ABS64(int64 i) {return i >= 0 ? i : -i;} +static inline int64 SYSTEM_ABS32(int32 i) {return i >= 0 ? i : -i;} +#define __ABSF(x) ((sizeof(x) <= 4) ? SYSTEM_ABS32(i) : SYSTEM_ABS64(i)) + +static inline double SYSTEM_ABSD(double i) {return i >= 0.0 ? i : -i;} +#define __ABSFD(x) SYSTEM_ABSD(x) + #define __CAP(ch) ((CHAR)((ch)&0x5f)) #define __ODD(x) ((x)&1) #define __IN(x, s) ((x)>=0 && (x)<(8*sizeof(SET)) && ((((uSET)(s))>>(x))&1)) diff --git a/src/test/confidence/language/TestLanguage.mod b/src/test/confidence/language/TestLanguage.mod index 724ae63a..6ae8c9e7 100644 --- a/src/test/confidence/language/TestLanguage.mod +++ b/src/test/confidence/language/TestLanguage.mod @@ -220,6 +220,23 @@ END DivMod; +PROCEDURE Abs; + VAR + i: INTEGER; + l: LONGINT; + h: SYSTEM.INT64; +BEGIN + i := 5; TestValue(ABS(i), 5, "ABS(INTEGER 5)"); + i := -5; TestValue(ABS(i), 5, "ABS(INTEGER -5)"); + l := 5; TestValue(ABS(l), 5, "ABS(LONGINT 5)"); + l := -5; TestValue(ABS(l), 5, "ABS(LONGINT -5)"); + h := 5; TestValue(SYSTEM.VAL(LONGINT,ABS(h)), 5, "ABS(SYSTEM.INT64 5)"); + h := -5; TestValue(SYSTEM.VAL(LONGINT,ABS(h)), 5, "ABS(SYSTEM.INT64 -5)"); +END Abs; + + + + PROCEDURE IntSize; VAR l: LONGINT; BEGIN @@ -253,5 +270,6 @@ BEGIN Shift; DivMod; IntSize; + Abs; Console.String("Language tests successful."); Console.Ln; END TestLanguage. diff --git a/src/test/confidence/planned-binary-change b/src/test/confidence/planned-binary-change index ebcef2cb..601e55c7 100644 --- a/src/test/confidence/planned-binary-change +++ b/src/test/confidence/planned-binary-change @@ -1 +1 @@ -12 Sep 2016 15:40:20 +12 Sep 2016 17:01:41 From 68c105b48c6b56189ccac3408578d090e3628c31 Mon Sep 17 00:00:00 2001 From: David Brown Date: Tue, 13 Sep 2016 19:44:01 +0100 Subject: [PATCH 225/580] Add tests for ENTIER. --- src/system/SYSTEM.h | 18 +++++++-------- src/test/confidence/language/TestLanguage.mod | 23 +++++++++++++++++++ 2 files changed, 31 insertions(+), 10 deletions(-) diff --git a/src/system/SYSTEM.h b/src/system/SYSTEM.h index fa63a9ab..d5f53efa 100644 --- a/src/system/SYSTEM.h +++ b/src/system/SYSTEM.h @@ -144,15 +144,6 @@ static inline int64 __RF(uint64 i, uint64 ub) {if (i >= ub) {__HALT(-8);} return -// Run time system routines in SYSTEM.c - - -extern void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0); -extern void SYSTEM_ENUMP (void *adr, LONGINT n, void (*P)()); -extern void SYSTEM_ENUMR (void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()); -extern LONGINT SYSTEM_ENTIER (double x); - - // Signal handling in SYSTEM.c #ifndef _WIN32 @@ -223,8 +214,9 @@ extern int64 SYSTEM_MOD(int64 x, int64 y); #define __MOD(x, y) (((x)>0 && (y)>0) ? (x)%(y) : __MODF(x, y)) +extern LONGINT SYSTEM_ENTIER (double x); +#define __ENTIER(x) SYSTEM_ENTIER(x) -#define __ENTIER(x) SYSTEM_ENTIER(x) #define __ABS(x) (((x)<0)?-(x):(x)) @@ -237,6 +229,7 @@ static inline double SYSTEM_ABSD(double i) {return i >= 0.0 ? i : -i;} #define __CAP(ch) ((CHAR)((ch)&0x5f)) #define __ODD(x) ((x)&1) + #define __IN(x, s) ((x)>=0 && (x)<(8*sizeof(SET)) && ((((uSET)(s))>>(x))&1)) #define __SETOF(x) ((SET)1<<(x)) #define __SETRNG(l, h) ((~(SET)0<<(l))&~(SET)0>>(8*sizeof(SET)-1-(h))) @@ -297,6 +290,11 @@ extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); /* Type handling */ +extern void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0); +extern void SYSTEM_ENUMP (void *adr, LONGINT n, void (*P)()); +extern void SYSTEM_ENUMR (void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()); + + #define __TDESC(t, m, n) \ static struct t##__desc { \ LONGINT tproc[m]; /* Proc for each ptr field */ \ diff --git a/src/test/confidence/language/TestLanguage.mod b/src/test/confidence/language/TestLanguage.mod index 6ae8c9e7..7399b006 100644 --- a/src/test/confidence/language/TestLanguage.mod +++ b/src/test/confidence/language/TestLanguage.mod @@ -2,6 +2,8 @@ MODULE TestLanguage; IMPORT SYSTEM, Console; + VAR gz: LONGREAL; + PROCEDURE TestShiftResult(of, by, actual, expected: LONGINT; msg: ARRAY OF CHAR); BEGIN IF actual # expected THEN @@ -236,6 +238,26 @@ END Abs; +(* LR does nothing numerically, but is enough to stop the C compiler + optimizing away the LR assignment and ENTIER implementation. *) +PROCEDURE LR(lr: LONGREAL): LONGREAL; BEGIN RETURN lr + gz; END LR; + +PROCEDURE Entier; + VAR lr: LONGREAL; +BEGIN + gz := 0.0; + lr := LR(-0.01); TestValue(ENTIER(lr), -1, "ENTIER(-0.01"); + lr := LR( 0.00); TestValue(ENTIER(lr), 0, "ENTIER(0.00"); + lr := LR( 5.00); TestValue(ENTIER(lr), 5, "ENTIER(5.00"); + lr := LR( 5.50); TestValue(ENTIER(lr), 5, "ENTIER(5.50"); + lr := LR( 5.99); TestValue(ENTIER(lr), 5, "ENTIER(5.99"); + lr := LR(-5.00); TestValue(ENTIER(lr), -5, "ENTIER(-5.00"); + lr := LR(-5.50); TestValue(ENTIER(lr), -6, "ENTIER(-5.50"); + lr := LR(-5.99); TestValue(ENTIER(lr), -6, "ENTIER(-5.99"); +END Entier; + + + PROCEDURE IntSize; VAR l: LONGINT; @@ -271,5 +293,6 @@ BEGIN DivMod; IntSize; Abs; + Entier; Console.String("Language tests successful."); Console.Ln; END TestLanguage. From b8496c37369da7c24511a3c73bbf18972a3e7a5a Mon Sep 17 00:00:00 2001 From: David Brown Date: Tue, 13 Sep 2016 20:14:17 +0100 Subject: [PATCH 226/580] Pass set size to __IN, remove uSET Ctype, optimize __IN size test. --- src/compiler/OPV.Mod | 7 +++++-- src/system/SYSTEM.h | 13 +++++++------ src/test/confidence/planned-binary-change | 2 +- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/compiler/OPV.Mod b/src/compiler/OPV.Mod index 2f679ace..ef8a1394 100644 --- a/src/compiler/OPV.Mod +++ b/src/compiler/OPV.Mod @@ -624,8 +624,11 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 IF (subclass IN {OPT.ash, OPT.lsh, OPT.rot}) & (r^.class = OPT.Nconst) & (r^.conval^.intval < 0) THEN OPM.WriteInt(-r^.conval^.intval) ELSE expr(r, MinPrec) - END ; - IF subclass IN {OPT.lsh, OPT.rot} THEN OPM.WriteString(Comma); OPM.WriteInt(l.typ.size*8) END; + END; + IF subclass IN {OPS.in, OPT.lsh, OPT.rot} THEN + OPM.WriteString(Comma); + IF subclass = OPS.in THEN OPM.WriteInt(r.typ.size*8) ELSE OPM.WriteInt(l.typ.size*8) END + END; OPM.Write(CloseParen) | OPS.eql .. OPS.geq: IF l^.typ^.form IN {OPT.String, OPT.Comp} THEN diff --git a/src/system/SYSTEM.h b/src/system/SYSTEM.h index d5f53efa..896934e7 100644 --- a/src/system/SYSTEM.h +++ b/src/system/SYSTEM.h @@ -92,7 +92,6 @@ typedef float REAL; typedef double LONGREAL; typedef void* SYSTEM_PTR; -#define uSET SET // 'address' is a synonym for an int of pointer size @@ -200,7 +199,6 @@ static inline int __str_cmp(CHAR *x, CHAR *y){ static inline int64 SYSTEM_ASH(int64 x, int64 n) {return __ASH(x,n);} #define __ASHF(x, n) SYSTEM_ASH((int64)(x), (int64)(n)) -#define __BIT(x, n) (*(uint64*)(x)>>(n)&1) #define __MOVE(s, d, n) memcpy((char*)(address)(d),(char*)(address)(s),n) @@ -230,10 +228,13 @@ static inline double SYSTEM_ABSD(double i) {return i >= 0.0 ? i : -i;} #define __CAP(ch) ((CHAR)((ch)&0x5f)) #define __ODD(x) ((x)&1) -#define __IN(x, s) ((x)>=0 && (x)<(8*sizeof(SET)) && ((((uSET)(s))>>(x))&1)) -#define __SETOF(x) ((SET)1<<(x)) -#define __SETRNG(l, h) ((~(SET)0<<(l))&~(SET)0>>(8*sizeof(SET)-1-(h))) -#define __MASK(x, m) ((x)&~(m)) +//#define __IN(x, s, size) ((x)>=0 && (x)>(x))&1)) + +#define __IN(x, s, size) (((unsigned int)(x))>(x))&1)) +#define __SETOF(x) ((SET)1<<(x)) +#define __SETRNG(l, h) ((~(SET)0<<(l))&~(SET)0>>(8*sizeof(SET)-1-(h))) +#define __MASK(x, m) ((x)&~(m)) +#define __BIT(x, n) (*(uint64*)(x)>>(n)&1) diff --git a/src/test/confidence/planned-binary-change b/src/test/confidence/planned-binary-change index 601e55c7..a2fd3632 100644 --- a/src/test/confidence/planned-binary-change +++ b/src/test/confidence/planned-binary-change @@ -1 +1 @@ -12 Sep 2016 17:01:41 +13 Sep 2016 20:12:45 From f13130bbd3e47f2aed485f655e15ff2ede5687d2 Mon Sep 17 00:00:00 2001 From: David Brown Date: Tue, 13 Sep 2016 20:35:29 +0100 Subject: [PATCH 227/580] Add set size to __SETOF and __SETRNG. --- src/compiler/OPV.Mod | 15 ++++++++------- src/system/SYSTEM.h | 11 +++++------ src/tools/make/configure.c | 5 ++++- 3 files changed, 17 insertions(+), 14 deletions(-) diff --git a/src/compiler/OPV.Mod b/src/compiler/OPV.Mod index ef8a1394..f4a82ca5 100644 --- a/src/compiler/OPV.Mod +++ b/src/compiler/OPV.Mod @@ -27,8 +27,6 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 GuardPtrFunc = "__GUARDP("; GuardRecFunc = "__GUARDR("; TypeFunc = "__TYPEOF("; - SetOfFunc = "__SETOF("; - SetRangeFunc = "__SETRNG("; CopyFunc = "__COPY("; MoveFunc = "__MOVE("; GetFunc = "__GET("; @@ -293,7 +291,9 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 PROCEDURE Convert(n: OPT.Node; newtype: OPT.Struct; prec: INTEGER); VAR from, to: INTEGER; BEGIN from := n^.typ^.form; to := newtype.form; - IF to = OPT.Set THEN OPM.WriteString(SetOfFunc); Entier(n, MinPrec); OPM.Write(CloseParen) + IF to = OPT.Set THEN + OPM.WriteString("__SETOF("); Entier(n, MinPrec); + OPM.WriteString(","); OPM.WriteInt(newtype.size*8); OPM.Write(CloseParen) ELSIF to = OPT.Int THEN IF (newtype.size < n.typ.size) & (OPM.ranchk IN OPM.opt) THEN OPM.WriteString("__SHORT"); IF SideEffects(n) THEN OPM.Write("F") END; @@ -527,8 +527,8 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 CASE class OF | OPT.Nconst: OPC.Constant(n^.conval, form) | OPT.Nupto: (* n^.typ = OPT.settyp *) - OPM.WriteString(SetRangeFunc); expr(l, MinPrec); OPM.WriteString(Comma); expr (r, MinPrec); - OPM.Write(CloseParen) + OPM.WriteString("__SETRNG("); expr(l, MinPrec); OPM.WriteString(Comma); expr(r, MinPrec); + OPM.WriteString(Comma); OPM.WriteInt(n.typ.size*8); OPM.Write(CloseParen) | OPT.Nmop: CASE subclass OF | OPS.not: OPM.Write("!"); expr(l, exprPrec) @@ -865,8 +865,9 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 | OPT.incfn, OPT.decfn: expr(n^.left, MinPrec); OPC.Increment(n^.subcl = OPT.decfn); expr(n^.right, MinPrec) | OPT.inclfn, - OPT.exclfn: expr(n^.left, MinPrec); OPC.SetInclude(n^.subcl = OPT.exclfn); OPM.WriteString(SetOfFunc); expr(n^.right, MinPrec); - OPM.Write(CloseParen) + OPT.exclfn: expr(n^.left, MinPrec); OPC.SetInclude(n^.subcl = OPT.exclfn); + OPM.WriteString("__SETOF("); expr(n^.right, MinPrec); + OPM.WriteString(","); OPM.WriteInt(n.left.typ.size*8); OPM.Write(CloseParen) | OPT.copyfn: OPM.WriteString(CopyFunc); expr(n^.right, MinPrec); OPM.WriteString(Comma); expr(n^.left, MinPrec); OPM.WriteString(Comma); Len(n^.left, 0); OPM.Write(CloseParen) diff --git a/src/system/SYSTEM.h b/src/system/SYSTEM.h index 896934e7..7c645e85 100644 --- a/src/system/SYSTEM.h +++ b/src/system/SYSTEM.h @@ -228,13 +228,12 @@ static inline double SYSTEM_ABSD(double i) {return i >= 0.0 ? i : -i;} #define __CAP(ch) ((CHAR)((ch)&0x5f)) #define __ODD(x) ((x)&1) -//#define __IN(x, s, size) ((x)>=0 && (x)>(x))&1)) +#define __IN(x, s, size) (((unsigned int)(x))>(x))&1)) +#define __SETOF(x, size) ((uint##size)1<<(x)) +#define __SETRNG(l, h, size) ((~(uint##size)0<<(l))&~(uint##size)0>>(size-1-(h))) -#define __IN(x, s, size) (((unsigned int)(x))>(x))&1)) -#define __SETOF(x) ((SET)1<<(x)) -#define __SETRNG(l, h) ((~(SET)0<<(l))&~(SET)0>>(8*sizeof(SET)-1-(h))) -#define __MASK(x, m) ((x)&~(m)) -#define __BIT(x, n) (*(uint64*)(x)>>(n)&1) +#define __MASK(x, m) ((x)&~(m)) +#define __BIT(x, n) (*(uint64*)(x)>>(n)&1) diff --git a/src/tools/make/configure.c b/src/tools/make/configure.c index 10886067..f976c756 100644 --- a/src/tools/make/configure.c +++ b/src/tools/make/configure.c @@ -313,7 +313,10 @@ void testSystemDotH() { /* test the __SETRNG macro */ long x = 0; long y = sizeof(SET)*8 - 1; - assert(__SETRNG(x, y) == -1, "SETRNG(0, MAX(SET)) != -1."); + if (sizeof(SET) == 4) + assert(__SETRNG(x, y, 32) == -1, "SETRNG(0, MAX(SET)) != -1."); + else + assert(__SETRNG(x, y, 64) == -1, "SETRNG(0, MAX(SET)) != -1."); /* test string comparison for extended ascii */ {char a[10], b[10]; From 7efd5a0158079febaa2b40d4f398ff016b709873 Mon Sep 17 00:00:00 2001 From: David Brown Date: Wed, 14 Sep 2016 13:02:00 +0100 Subject: [PATCH 228/580] More LONGINTS changed to Address. Remove special FetchAddress code in Heap. --- bootstrap/SYSTEM.c | 99 ++++++++-------- bootstrap/SYSTEM.h | 99 ++++++++-------- bootstrap/unix-44/Configuration.c | 4 +- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Console.c | 2 +- bootstrap/unix-44/Console.h | 2 +- bootstrap/unix-44/Files.c | 2 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 13 ++- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 130 +++++++++++----------- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 26 ++--- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 24 ++-- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 26 ++--- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 14 +-- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 74 ++++++------ bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 8 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/Vishap.c | 2 +- bootstrap/unix-44/errors.c | 2 +- bootstrap/unix-44/errors.h | 2 +- bootstrap/unix-44/extTools.c | 2 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-44/vt100.c | 2 +- bootstrap/unix-44/vt100.h | 2 +- bootstrap/unix-48/Configuration.c | 4 +- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Console.c | 2 +- bootstrap/unix-48/Console.h | 2 +- bootstrap/unix-48/Files.c | 2 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 13 ++- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 130 +++++++++++----------- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 26 ++--- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 24 ++-- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 26 ++--- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 14 +-- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 74 ++++++------ bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 8 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/Vishap.c | 2 +- bootstrap/unix-48/errors.c | 2 +- bootstrap/unix-48/errors.h | 2 +- bootstrap/unix-48/extTools.c | 2 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-48/vt100.c | 2 +- bootstrap/unix-48/vt100.h | 2 +- bootstrap/unix-88/Configuration.c | 4 +- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Console.c | 2 +- bootstrap/unix-88/Console.h | 2 +- bootstrap/unix-88/Files.c | 2 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 13 ++- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 130 +++++++++++----------- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 26 ++--- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 24 ++-- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 26 ++--- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 14 +-- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 74 ++++++------ bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 8 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/Vishap.c | 2 +- bootstrap/unix-88/errors.c | 2 +- bootstrap/unix-88/errors.h | 2 +- bootstrap/unix-88/extTools.c | 2 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/unix-88/vt100.c | 2 +- bootstrap/unix-88/vt100.h | 2 +- bootstrap/windows-48/Configuration.c | 4 +- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Console.c | 2 +- bootstrap/windows-48/Console.h | 2 +- bootstrap/windows-48/Files.c | 2 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 13 ++- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 130 +++++++++++----------- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 26 ++--- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 24 ++-- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 26 ++--- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 14 +-- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 74 ++++++------ bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 8 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/Vishap.c | 2 +- bootstrap/windows-48/errors.c | 2 +- bootstrap/windows-48/errors.h | 2 +- bootstrap/windows-48/extTools.c | 2 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-48/vt100.c | 2 +- bootstrap/windows-48/vt100.h | 2 +- bootstrap/windows-88/Configuration.c | 4 +- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Console.c | 2 +- bootstrap/windows-88/Console.h | 2 +- bootstrap/windows-88/Files.c | 2 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 13 ++- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 130 +++++++++++----------- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 26 ++--- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 24 ++-- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 26 ++--- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 14 +-- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 74 ++++++------ bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Platform.c | 2 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 8 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/Vishap.c | 2 +- bootstrap/windows-88/errors.c | 2 +- bootstrap/windows-88/errors.h | 2 +- bootstrap/windows-88/extTools.c | 2 +- bootstrap/windows-88/extTools.h | 2 +- bootstrap/windows-88/vt100.c | 2 +- bootstrap/windows-88/vt100.h | 2 +- src/system/Heap.Mod | 112 +++++++++---------- src/system/SYSTEM.c | 96 ++++++++-------- src/system/SYSTEM.h | 56 +++++----- src/test/confidence/planned-binary-change | 2 +- 201 files changed, 1227 insertions(+), 1132 deletions(-) diff --git a/bootstrap/SYSTEM.c b/bootstrap/SYSTEM.c index d7603f8e..6efc8321 100644 --- a/bootstrap/SYSTEM.c +++ b/bootstrap/SYSTEM.c @@ -23,9 +23,6 @@ -LONGINT SYSTEM_ABS (LONGINT i) {return __ABS(i);} -double SYSTEM_ABSD(double i) {return __ABS(i);} - int64 SYSTEM_DIV(int64 x, int64 y) { @@ -49,37 +46,6 @@ int64 SYSTEM_MOD(int64 x, int64 y) else {return -((-x) % (-y));} } - -void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0) -{ - t -= __TPROC0OFF; - t0 -= __TPROC0OFF; - while (*t0 != __EOM) {*t = *t0; t--; t0--;} -} - - -void SYSTEM_ENUMP(void *adr, LONGINT n, void (*P)()) -{ - while (n > 0) { - P((address)(*((void**)(adr)))); - adr = ((void**)adr) + 1; - n--; - } -} - -void SYSTEM_ENUMR(void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()) -{ - LONGINT *t, off; - typ++; - while (n > 0) { - t = typ; - off = *t; - while (off >= 0) {P(*(address*)((char*)adr+off)); t++; off = *t;} - adr = ((char*)adr) + size; - n--; - } -} - LONGINT SYSTEM_ENTIER(double x) { LONGINT y; @@ -91,22 +57,55 @@ LONGINT SYSTEM_ENTIER(double x) } } + + + +void SYSTEM_INHERIT(address *t, address *t0) +{ + t -= __TPROC0OFF; + t0 -= __TPROC0OFF; + while (*t0 != __EOM) {*t = *t0; t--; t0--;} +} + + +void SYSTEM_ENUMP(void *adr, address n, void (*P)()) +{ + while (n > 0) { + P((address)(*((void**)(adr)))); + adr = ((void**)adr) + 1; + n--; + } +} + +void SYSTEM_ENUMR(void *adr, address *typ, address size, address n, void (*P)()) +{ + address *t, off; + typ++; + while (n > 0) { + t = typ; + off = *t; + while (off >= 0) {P(*(address*)((char*)adr+off)); t++; off = *t;} + adr = ((char*)adr) + size; + n--; + } +} + extern void Heap_Lock(); extern void Heap_Unlock(); -SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, int nofdyn, ...) +SYSTEM_PTR SYSTEM_NEWARR(address *typ, address elemsz, int elemalgn, int nofdim, int nofdyn, ...) { - LONGINT nofelems, size, dataoff, n, nptr, *x, *p, nofptrs, i, *ptab, off; + address nofelems, size, dataoff, n, nptr, *x, *p, nofptrs, i, *ptab, off; va_list ap; va_start(ap, nofdyn); nofelems = 1; while (nofdim > 0) { - nofelems = nofelems * va_arg(ap, LONGINT); nofdim--; + nofelems = nofelems * va_arg(ap, address); nofdim--; if (nofelems <= 0) __HALT(-20); } va_end(ap); - dataoff = nofdyn * sizeof(LONGINT); - if (elemalgn > sizeof(LONGINT)) { + dataoff = nofdyn * sizeof(address); + if (elemalgn > sizeof(address)) { n = dataoff % elemalgn; if (n != 0) dataoff += elemalgn - n; } @@ -116,37 +115,37 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, /* element typ does not contain pointers */ x = Heap_NEWBLK(size); } - else if (typ == (LONGINT*)POINTER__typ) { + else if (typ == (address*)POINTER__typ) { /* element type is a pointer */ - x = Heap_NEWBLK(size + nofelems * sizeof(LONGINT)); - p = (LONGINT*)(address)x[-1]; + x = Heap_NEWBLK(size + nofelems * sizeof(address)); + p = (address*)(address)x[-1]; p[-nofelems] = *p; /* build new type desc in situ: 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nofelems - 1; n = 1; /* n =1 for skipping the size field */ - while (n <= nofelems) {*p = n*sizeof(LONGINT); p++; n++;} - *p = - (nofelems + 1) * sizeof(LONGINT); /* sentinel */ - x[-1] -= nofelems * sizeof(LONGINT); + while (n <= nofelems) {*p = n*sizeof(address); p++; n++;} + *p = - (nofelems + 1) * sizeof(address); /* sentinel */ + x[-1] -= nofelems * sizeof(address); } else { /* element type is a record that contains pointers */ ptab = typ + 1; nofptrs = 0; while (ptab[nofptrs] >= 0) {nofptrs++;} /* number of pointers per element */ nptr = nofelems * nofptrs; /* total number of pointers */ - x = Heap_NEWBLK(size + nptr * sizeof(LONGINT)); - p = (LONGINT*)(address)x[- 1]; + x = Heap_NEWBLK(size + nptr * sizeof(address)); + p = (address*)(address)x[- 1]; p[-nptr] = *p; /* build new type desc in situ; 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nptr - 1; n = 0; off = dataoff; while (n < nofelems) {i = 0; while (i < nofptrs) {*p = off + ptab[i]; p++; i++;} off += elemsz; n++; } - *p = - (nptr + 1) * sizeof(LONGINT); /* sentinel */ - x[-1] -= nptr * sizeof(LONGINT); + *p = - (nptr + 1) * sizeof(address); /* sentinel */ + x[-1] -= nptr * sizeof(address); } if (nofdyn != 0) { /* setup len vector for index checks */ va_start(ap, nofdyn); p = x; - while (nofdyn > 0) {*p = va_arg(ap, LONGINT); p++, nofdyn--;} + while (nofdyn > 0) {*p = va_arg(ap, address); p++, nofdyn--;} va_end(ap); } Heap_Unlock(); diff --git a/bootstrap/SYSTEM.h b/bootstrap/SYSTEM.h index 709c26a7..ddd85144 100644 --- a/bootstrap/SYSTEM.h +++ b/bootstrap/SYSTEM.h @@ -92,7 +92,6 @@ typedef float REAL; typedef double LONGREAL; typedef void* SYSTEM_PTR; -#define uSET SET // 'address' is a synonym for an int of pointer size @@ -130,13 +129,13 @@ extern void Platform_AssertFail(LONGINT x); // Index checking static inline int64 __XF(uint64 i, uint64 ub) {if (i >= ub) {__HALT(-2);} return i;} -#define __X(i, ub) (((uint64)(i)<(uint64)(ub))?i:(__HALT(-2),0)) +#define __X(i, ub) (((i)<(ub))?i:(__HALT(-2),0)) // Range checking, and checked SHORT and CHR functions static inline int64 __RF(uint64 i, uint64 ub) {if (i >= ub) {__HALT(-8);} return i;} -#define __R(i, ub) (((uint64)(i)<(uint64)(ub))?i:(__HALT(-8),0)) +#define __R(i, ub) (((i)<(ub))?i:(__HALT(-8),0)) #define __SHORT(x, ub) ((int)((uLONGINT)(x)+(ub)<(ub)+(ub)?(x):(__HALT(-8),0))) #define __SHORTF(x, ub) ((int)(__RF((x)+(ub),(ub)+(ub))-(ub))) #define __CHR(x) ((CHAR)__R(x, 256)) @@ -144,17 +143,6 @@ static inline int64 __RF(uint64 i, uint64 ub) {if (i >= ub) {__HALT(-8);} return -// Run time system routines in SYSTEM.c - - -extern LONGINT SYSTEM_ABS (LONGINT i); -extern double SYSTEM_ABSD (double i); -extern void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0); -extern void SYSTEM_ENUMP (void *adr, LONGINT n, void (*P)()); -extern void SYSTEM_ENUMR (void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()); -extern LONGINT SYSTEM_ENTIER (double x); - - // Signal handling in SYSTEM.c #ifndef _WIN32 @@ -211,7 +199,6 @@ static inline int __str_cmp(CHAR *x, CHAR *y){ static inline int64 SYSTEM_ASH(int64 x, int64 n) {return __ASH(x,n);} #define __ASHF(x, n) SYSTEM_ASH((int64)(x), (int64)(n)) -#define __BIT(x, n) (*(uint64*)(x)>>(n)&1) #define __MOVE(s, d, n) memcpy((char*)(address)(d),(char*)(address)(s),n) @@ -225,17 +212,28 @@ extern int64 SYSTEM_MOD(int64 x, int64 y); #define __MOD(x, y) (((x)>0 && (y)>0) ? (x)%(y) : __MODF(x, y)) +extern LONGINT SYSTEM_ENTIER (double x); +#define __ENTIER(x) SYSTEM_ENTIER(x) + + +#define __ABS(x) (((x)<0)?-(x):(x)) + +static inline int32 SYSTEM_ABS64(int64 i) {return i >= 0 ? i : -i;} +static inline int64 SYSTEM_ABS32(int32 i) {return i >= 0 ? i : -i;} +#define __ABSF(x) ((sizeof(x) <= 4) ? SYSTEM_ABS32(i) : SYSTEM_ABS64(i)) + +static inline double SYSTEM_ABSD(double i) {return i >= 0.0 ? i : -i;} +#define __ABSFD(x) SYSTEM_ABSD(x) -#define __ENTIER(x) SYSTEM_ENTIER(x) -#define __ABS(x) (((x)<0)?-(x):(x)) -#define __ABSF(x) SYSTEM_ABS((LONGINT)(x)) -#define __ABSFD(x) SYSTEM_ABSD((double)(x)) #define __CAP(ch) ((CHAR)((ch)&0x5f)) #define __ODD(x) ((x)&1) -#define __IN(x, s) ((x)>=0 && (x)<(8*sizeof(SET)) && ((((uSET)(s))>>(x))&1)) -#define __SETOF(x) ((SET)1<<(x)) -#define __SETRNG(l, h) ((~(SET)0<<(l))&~(SET)0>>(8*sizeof(SET)-1-(h))) -#define __MASK(x, m) ((x)&~(m)) + +#define __IN(x, s, size) (((unsigned int)(x))>(x))&1)) +#define __SETOF(x, size) ((uint##size)1<<(x)) +#define __SETRNG(l, h, size) ((~(uint##size)0<<(l))&~(uint##size)0>>(size-1-(h))) + +#define __MASK(x, m) ((x)&~(m)) +#define __BIT(x, n) (*(uint64*)(x)>>(n)&1) @@ -245,6 +243,10 @@ extern int64 SYSTEM_MOD(int64 x, int64 y); #define __CASECHK __HALT(-4) #define __WITHCHK __HALT(-7) +#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(address)typ##__typ) +#define __TYPEOF(p) ((LONGINT*)(address)(*(((LONGINT*)(p))-1))) +#define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) + #define __GUARDP(p, typ, level) ((typ*)(__ISP(p,typ,level)?p:(__HALT(-5),p))) #define __GUARDR(r, typ, level) (*((typ*)(__IS(r##__typ,typ,level)?r:(__HALT(-5),r)))) #define __GUARDA(p, typ, level) ((struct typ*)(__IS(__TYPEOF(p),typ,level)?p:(__HALT(-5),p))) @@ -284,51 +286,52 @@ extern SYSTEM_PTR Heap_NEWBLK (address size); extern SYSTEM_PTR Heap_NEWREC (address tag); extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); -#define __SYSNEW(p, len) p = Heap_NEWBLK((LONGINT)(len)) -#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(address)t##__typ) +#define __SYSNEW(p, len) p = Heap_NEWBLK((address)(len)) +#define __NEW(p, t) p = Heap_NEWREC((address)t##__typ) #define __NEWARR SYSTEM_NEWARR /* Type handling */ +extern void SYSTEM_INHERIT(address *t, address *t0); +extern void SYSTEM_ENUMP (void *adr, address n, void (*P)()); +extern void SYSTEM_ENUMR (void *adr, address *typ, address size, address n, void (*P)()); + + #define __TDESC(t, m, n) \ static struct t##__desc { \ - LONGINT tproc[m]; /* Proc for each ptr field */ \ - LONGINT tag; \ - LONGINT next; /* Module table type list points here */ \ - LONGINT level; \ - LONGINT module; \ + address tproc[m]; /* Proc for each ptr field */ \ + address tag; \ + address next; /* Module table type list points here */ \ + address level; \ + address module; \ char name[24]; \ - LONGINT basep[__MAXEXT]; /* List of bases this extends */ \ - LONGINT reserved; \ - LONGINT blksz; /* xxx_typ points here */ \ - LONGINT ptr[n+1]; /* Offsets of ptrs up to -ve sentinel */ \ + address basep[__MAXEXT]; /* List of bases this extends */ \ + address reserved; \ + address blksz; /* xxx_typ points here */ \ + address ptr[n+1]; /* Offsets of ptrs up to -ve sentinel */ \ } t##__desc #define __BASEOFF (__MAXEXT+1) // blksz as index to base. -#define __TPROC0OFF (__BASEOFF+24/sizeof(LONGINT)+5) // blksz as index to tproc IFF m=1. +#define __TPROC0OFF (__BASEOFF+24/sizeof(address)+5) // blksz as index to tproc IFF m=1. #define __EOM 1 #define __TDFLDS(name, size) {__EOM}, 1, 0, 0, 0, name, {0}, 0, size -#define __ENUMP(adr, n, P) SYSTEM_ENUMP(adr, (LONGINT)(n), P) -#define __ENUMR(adr, typ, size, n, P) SYSTEM_ENUMR(adr, typ, (LONGINT)(size), (LONGINT)(n), P) +#define __ENUMP(adr, n, P) SYSTEM_ENUMP(adr, (address)(n), P) +#define __ENUMR(adr, typ, size, n, P) SYSTEM_ENUMR(adr, typ, (address)(size), (address)(n), P) #define __INITYP(t, t0, level) \ - t##__typ = (LONGINT*)&t##__desc.blksz; \ - memcpy(t##__desc.basep, t0##__typ - __BASEOFF, level*sizeof(LONGINT)); \ - t##__desc.basep[level] = (LONGINT)(address)t##__typ; \ - t##__desc.module = (LONGINT)(address)m; \ + t##__typ = (address*)&t##__desc.blksz; \ + memcpy(t##__desc.basep, t0##__typ - __BASEOFF, level*sizeof(address)); \ + t##__desc.basep[level] = (address)t##__typ; \ + t##__desc.module = (address)m; \ if(t##__desc.blksz!=sizeof(struct t)) __HALT(-15); \ - t##__desc.blksz = (t##__desc.blksz+5*sizeof(LONGINT)-1)/(4*sizeof(LONGINT))*(4*sizeof(LONGINT)); \ - Heap_REGTYP(m, (LONGINT)(address)&t##__desc.next); \ + t##__desc.blksz = (t##__desc.blksz+5*sizeof(address)-1)/(4*sizeof(address))*(4*sizeof(address)); \ + Heap_REGTYP(m, (address)&t##__desc.next); \ SYSTEM_INHERIT(t##__typ, t0##__typ) -#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(address)typ##__typ) -#define __TYPEOF(p) ((LONGINT*)(address)(*(((LONGINT*)(p))-1))) -#define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) - // Oberon-2 type bound procedures support -#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(address)proc +#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(address)proc #define __SEND(typ, num, funtyp, parlist) ((funtyp)((address)*(typ-(__TPROC0OFF+num))))parlist diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index cc4f7969..d8c934bf 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/12] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/14] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index 3ce4467e..2b7bdf82 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Console.c b/bootstrap/unix-44/Console.c index e33f3d7c..5a0b29a2 100644 --- a/bootstrap/unix-44/Console.c +++ b/bootstrap/unix-44/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Console.h b/bootstrap/unix-44/Console.h index c6fe7fc4..0af02096 100644 --- a/bootstrap/unix-44/Console.h +++ b/bootstrap/unix-44/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index ebdd14a9..58145066 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index 42e60467..521906c3 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index 4d96ea89..f03a4d7e 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tskSfF */ #define INTEGER int16 #define LONGINT int32 @@ -82,6 +82,7 @@ export LONGINT *Heap__1__typ; static void Heap_CheckFin (void); static void Heap_ExtendHeap (address blksz); export void Heap_FINALL (void); +static address Heap_FetchAddress (address pointer); static void Heap_Finalize (void); export void Heap_GC (BOOLEAN markStack); static void Heap_HeapSort (address n, address *a, LONGINT a__len); @@ -106,7 +107,6 @@ export void Heap_Unlock (void); extern void *Heap__init(); extern address Platform_MainStackFrame; extern address Platform_OSAllocate(address size); -#define Heap_FetchAddress(pointer) (address)(*((void**)((address)pointer))) #define Heap_HeapModuleInit() Heap__init() #define Heap_OSAllocate(size) Platform_OSAllocate(size) #define Heap_PlatformHalt(code) Platform_Halt(code) @@ -188,6 +188,15 @@ static address Heap_NewChunk (address blksz) return _o_result; } +static address Heap_FetchAddress (address pointer) +{ + address _o_result; + address r; + __GET(pointer, r, address); + _o_result = r; + return _o_result; +} + static void Heap_ExtendHeap (address blksz) { address size, chnk, j, next; diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index 1a6c9e05..29b4cb26 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index 9834a814..a71d3e4d 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index e34e59ed..6a744f9b 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index 92c0af42..a905da35 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -345,7 +345,7 @@ void OPB_Index (OPT_Node *x, OPT_Node y) f = y->typ->form; if ((*x)->class >= 7) { OPB_err(79); - } else if (f != 4 || __IN(y->class, 0x0300)) { + } else if (f != 4 || __IN(y->class, 0x0300, 32)) { OPB_err(80); y->typ = OPT_inttyp; } @@ -372,7 +372,7 @@ void OPB_Field (OPT_Node *x, OPT_Object y) if ((*x)->class >= 7) { OPB_err(77); } - if ((y != NIL && __IN(y->mode, 0x2010))) { + if ((y != NIL && __IN(y->mode, 0x2010, 32))) { OPB_BindNodes(2, y->typ, &*x, NIL); (*x)->obj = y; (*x)->readonly = (*x)->left->readonly || (y->vis == 2 && y->mnolev < 0); @@ -476,7 +476,7 @@ void OPB_In (OPT_Node *x, OPT_Node y) if (k < 0 || k > OPM_MaxSet) { OPB_err(202); } else if (y->class == 7) { - (*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval)); + (*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval, 32)); (*x)->obj = NIL; } else { OPB_BindNodes(12, OPT_booltyp, &*x, y); @@ -572,12 +572,12 @@ void OPB_MOp (int8 op, OPT_Node *x) } break; case 6: - if (!__IN(f, 0x70)) { + if (!__IN(f, 0x70, 32)) { OPB_err(96); } break; case 7: - if (__IN(f, 0xf0)) { + if (__IN(f, 0xf0, 32)) { if (z->class == 7) { if (f == 4) { if (z->conval->intval == (-2147483647-1)) { @@ -586,7 +586,7 @@ void OPB_MOp (int8 op, OPT_Node *x) z->conval->intval = -z->conval->intval; OPB_SetIntType(z); } - } else if (__IN(f, 0x60)) { + } else if (__IN(f, 0x60, 32)) { z->conval->realval = -z->conval->realval; } else { z->conval->setval = ~z->conval->setval; @@ -600,7 +600,7 @@ void OPB_MOp (int8 op, OPT_Node *x) } break; case 21: - if (__IN(f, 0x70)) { + if (__IN(f, 0x70, 32)) { if (z->class == 7) { if (f == 4) { if (z->conval->intval == (-2147483647-1)) { @@ -747,7 +747,7 @@ void OPB_CheckParameters (OPT_Object fp, OPT_Object ap, BOOLEAN checkNames) static void OPB_CheckProc (OPT_Struct x, OPT_Object y) { - if (__IN(y->mode, 0x04c0)) { + if (__IN(y->mode, 0x04c0, 32)) { if (y->mode == 6) { if (y->mnolev == 0) { y->mode = 7; @@ -923,7 +923,7 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) } break; case 9: - if (!__IN(g, 0x1800)) { + if (!__IN(g, 0x1800, 32)) { OPB_err(100); } break; @@ -954,7 +954,7 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) } else { OPB_err(204); } - } else if (__IN(f, 0x60)) { + } else if (__IN(f, 0x60, 32)) { temp = __ABS(yval->realval) <= (LONGREAL)1; if (temp || __ABS(xval->realval) <= 1.79769296342094e+308 / (LONGREAL)__ABS(yval->realval)) { xval->realval = xval->realval * yval->realval; @@ -978,7 +978,7 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) xval->realval = (LONGREAL)1; } x->typ = OPT_realtyp; - } else if (__IN(f, 0x60)) { + } else if (__IN(f, 0x60, 32)) { temp = __ABS(yval->realval) >= (LONGREAL)1; if (temp || __ABS(xval->realval) <= 1.79769296342094e+308 * __ABS(yval->realval)) { xval->realval = xval->realval / yval->realval; @@ -1032,7 +1032,7 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) } else { OPB_err(206); } - } else if (__IN(f, 0x60)) { + } else if (__IN(f, 0x60, 32)) { temp = (yval->realval >= (LONGREAL)0 && xval->realval <= 1.79769296342094e+308 - yval->realval); if (temp || (yval->realval < (LONGREAL)0 && xval->realval >= -1.79769296342094e+308 - yval->realval)) { xval->realval = xval->realval + yval->realval; @@ -1054,7 +1054,7 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) } else { OPB_err(207); } - } else if (__IN(f, 0x60)) { + } else if (__IN(f, 0x60, 32)) { temp = (yval->realval >= (LONGREAL)0 && xval->realval >= -1.79769296342094e+308 + yval->realval); if (temp || (yval->realval < (LONGREAL)0 && xval->realval <= 1.79769296342094e+308 + yval->realval)) { xval->realval = xval->realval - yval->realval; @@ -1082,28 +1082,28 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) xval->intval = OPB_BoolToInt(ConstCmp__14() != 9); break; case 11: - if (__IN(f, 0x0a84)) { + if (__IN(f, 0x0a84, 32)) { OPB_err(108); } else { xval->intval = OPB_BoolToInt(ConstCmp__14() == 11); } break; case 12: - if (__IN(f, 0x0a84)) { + if (__IN(f, 0x0a84, 32)) { OPB_err(108); } else { xval->intval = OPB_BoolToInt(ConstCmp__14() != 13); } break; case 13: - if (__IN(f, 0x0a84)) { + if (__IN(f, 0x0a84, 32)) { OPB_err(108); } else { xval->intval = OPB_BoolToInt(ConstCmp__14() == 13); } break; case 14: - if (__IN(f, 0x0a84)) { + if (__IN(f, 0x0a84, 32)) { OPB_err(108); } else { xval->intval = OPB_BoolToInt(ConstCmp__14() != 11); @@ -1136,7 +1136,7 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) (*x)->conval->intval = 1; } } - } else if (__IN(g, 0x60)) { + } else if (__IN(g, 0x60, 32)) { (*x)->conval->realval = (*x)->conval->intval; (*x)->conval->intval = -1; } else { @@ -1145,8 +1145,8 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) OPB_err(220); } } - } else if (__IN(f, 0x60)) { - if (__IN(g, 0x60)) { + } else if (__IN(f, 0x60, 32)) { + if (__IN(g, 0x60, 32)) { OPB_CheckRealType(g, 203, (*x)->conval); } else { r = (*x)->conval->realval; @@ -1195,8 +1195,8 @@ static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) { BOOLEAN _o_result; BOOLEAN ok, xCharArr, yCharArr; - xCharArr = (__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp->form == 3) || *Op__38_s->f == 8; - yCharArr = (__IN((*y)->typ->comp, 0x0c) && (*y)->typ->BaseTyp->form == 3) || *Op__38_s->g == 8; + xCharArr = (__IN((*x)->typ->comp, 0x0c, 32) && (*x)->typ->BaseTyp->form == 3) || *Op__38_s->f == 8; + yCharArr = (__IN((*y)->typ->comp, 0x0c, 32) && (*y)->typ->BaseTyp->form == 3) || *Op__38_s->g == 8; if ((((xCharArr && *Op__38_s->g == 3)) && (*y)->class == 7)) { OPB_CharToString(*y); *Op__38_s->g = 8; @@ -1255,7 +1255,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) case 4: if ((g == 4 && y->typ->size < z->typ->size)) { OPB_Convert(&y, z->typ); - } else if (__IN(g, 0x70)) { + } else if (__IN(g, 0x70, 32)) { OPB_Convert(&z, y->typ); } else { OPB_err(100); @@ -1264,23 +1264,23 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) case 5: if (g == 4) { OPB_Convert(&y, z->typ); - } else if (__IN(g, 0x60)) { + } else if (__IN(g, 0x60, 32)) { OPB_Convert(&z, y->typ); } else { OPB_err(100); } break; case 6: - if (__IN(g, 0x70)) { + if (__IN(g, 0x70, 32)) { OPB_Convert(&y, z->typ); - } else if (__IN(g, 0x60)) { + } else if (__IN(g, 0x60, 32)) { OPB_Convert(&y, z->typ); } else { OPB_err(100); } break; case 9: - if (!__IN(g, 0x1800)) { + if (!__IN(g, 0x1800, 32)) { OPB_err(100); } break; @@ -1341,7 +1341,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) y->obj = NIL; } } - } else if (!__IN(f, 0xe1)) { + } else if (!__IN(f, 0xe1, 32)) { OPB_err(105); typ = OPT_undftyp; } @@ -1357,7 +1357,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) OPB_Convert(&z, OPT_realtyp); OPB_Convert(&y, OPT_realtyp); typ = OPT_realtyp; - } else if (__IN(f, 0x60)) { + } else if (__IN(f, 0x60, 32)) { if ((y->class == 7 && y->conval->realval == (LONGREAL)0)) { OPB_err(205); } @@ -1424,7 +1424,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) } break; case 6: - if (!__IN(f, 0xf1)) { + if (!__IN(f, 0xf1, 32)) { OPB_err(105); typ = OPT_undftyp; } @@ -1443,7 +1443,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) } break; case 7: - if (!__IN(f, 0xf1)) { + if (!__IN(f, 0xf1, 32)) { OPB_err(106); typ = OPT_undftyp; } @@ -1467,7 +1467,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) } break; case 9: case 10: - if (__IN(f, 0x1aff) || strings__41(&z, &y)) { + if (__IN(f, 0x1aff, 32) || strings__41(&z, &y)) { typ = OPT_booltyp; } else { OPB_err(107); @@ -1476,7 +1476,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) NewOp__39(op, typ, &z, y); break; case 11: case 12: case 13: case 14: - if (__IN(f, 0x79) || strings__41(&z, &y)) { + if (__IN(f, 0x79, 32) || strings__41(&z, &y)) { typ = OPT_booltyp; } else { OPM_LogWLn(); @@ -1518,10 +1518,10 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y) } if (((*x)->class == 7 && y->class == 7)) { if (k <= l) { - (*x)->conval->setval = __SETRNG(k, l); + (*x)->conval->setval = __SETRNG(k, l, 32); } else { OPB_err(201); - (*x)->conval->setval = __SETRNG(l, k); + (*x)->conval->setval = __SETRNG(l, k, 32); } (*x)->obj = NIL; } else { @@ -1543,7 +1543,7 @@ void OPB_SetElem (OPT_Node *x) } else if ((*x)->class == 7) { k = (*x)->conval->intval; if ((0 <= k && k <= OPM_MaxSet)) { - (*x)->conval->setval = __SETOF(k); + (*x)->conval->setval = __SETOF(k,32); } else { OPB_err(202); } @@ -1588,7 +1588,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) case 0: case 8: break; case 1: - if (!((__IN(g, 0x1a) && y->size == 1))) { + if (!((__IN(g, 0x1a, 32) && y->size == 1))) { OPB_err(113); } break; @@ -1603,12 +1603,12 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) } break; case 5: - if (!__IN(g, 0x30)) { + if (!__IN(g, 0x30, 32)) { OPB_err(113); } break; case 6: - if (!__IN(g, 0x70)) { + if (!__IN(g, 0x70, 32)) { OPB_err(113); } break; @@ -1656,7 +1656,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) if (ynode->conval->intval2 > x->n) { OPB_err(114); } - } else if ((__IN(y->comp, 0x0c) && y->BaseTyp == OPT_chartyp)) { + } else if ((__IN(y->comp, 0x0c, 32) && y->BaseTyp == OPT_chartyp)) { } else { OPB_err(113); } @@ -1664,7 +1664,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPB_err(113); } } else if ((x->comp == 3 && x->BaseTyp == OPT_chartyp)) { - if ((__IN(y->comp, 0x0c) && y->BaseTyp == OPT_chartyp)) { + if ((__IN(y->comp, 0x0c, 32) && y->BaseTyp == OPT_chartyp)) { } else { OPB_err(113); } @@ -1691,7 +1691,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPM_LogWLn(); break; } - if ((((((ynode->class == 7 && g < f)) && __IN(g, 0x30))) && __IN(f, 0x70))) { + if ((((((ynode->class == 7 && g < f)) && __IN(g, 0x30, 32))) && __IN(f, 0x70, 32))) { OPB_Convert(&ynode, x); } } @@ -1729,7 +1729,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) OPB_err(76); } f = x->typ->BaseTyp->comp; - if (__IN(f, 0x1c)) { + if (__IN(f, 0x1c, 32)) { if (f == 3) { typ = x->typ->BaseTyp; } @@ -1762,7 +1762,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) case 5: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x60)) { + } else if (__IN(f, 0x60, 32)) { OPB_Convert(&x, OPT_linttyp); } else { OPB_err(111); @@ -1837,7 +1837,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) case 9: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x11)) { + } else if (__IN(f, 0x11, 32)) { OPB_Convert(&x, OPT_chartyp); } else { OPB_err(111); @@ -1898,7 +1898,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) } break; case 17: - if (!__IN(x->typ->comp, 0x0c)) { + if (!__IN(x->typ->comp, 0x0c, 32)) { OPB_err(131); } break; @@ -1909,7 +1909,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) } if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (((!__IN(x->typ->comp, 0x0c) || x->typ->BaseTyp->form != 3) && f != 8)) { + } else if (((!__IN(x->typ->comp, 0x0c, 32) || x->typ->BaseTyp->form != 3) && f != 8)) { OPB_err(111); } break; @@ -1933,7 +1933,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) if (x->class != 8) { OPB_err(110); x = OPB_NewIntConst(1); - } else if (__IN(f, 0x18fe) || __IN(x->typ->comp, 0x14)) { + } else if (__IN(f, 0x18fe, 32) || __IN(x->typ->comp, 0x14, 32)) { (*OPB_typSize)(x->typ); x->typ->pvused = 1; x = OPB_NewIntConst(x->typ->size); @@ -1948,7 +1948,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) case 22: case 23: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (!__IN(f, 0x9a)) { + } else if (!__IN(f, 0x9a, 32)) { OPB_err(111); } break; @@ -1957,7 +1957,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) OPB_err(126); } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x0810) && x->typ->size == OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x0810, 32) && x->typ->size == OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } @@ -1974,7 +1974,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) case 29: if (x->class != 8) { OPB_err(110); - } else if (__IN(f, 0x0501) || x->typ->comp == 3) { + } else if (__IN(f, 0x0501, 32) || x->typ->comp == 3) { OPB_err(111); } break; @@ -2070,11 +2070,11 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) } else if (x->typ->size == 1) { L = (int16)x->conval->intval; typ = p->typ; - while ((L > 0 && __IN(typ->comp, 0x0c))) { + while ((L > 0 && __IN(typ->comp, 0x0c, 32))) { typ = typ->BaseTyp; L -= 1; } - if (L != 0 || !__IN(typ->comp, 0x0c)) { + if (L != 0 || !__IN(typ->comp, 0x0c, 32)) { OPB_err(132); } else { x->obj = NIL; @@ -2098,7 +2098,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) case 18: if (OPB_NotVar(x)) { OPB_err(112); - } else if ((__IN(x->typ->comp, 0x0c) && x->typ->BaseTyp->form == 3)) { + } else if ((__IN(x->typ->comp, 0x0c, 32) && x->typ->BaseTyp->form == 3)) { if (x->readonly) { OPB_err(76); } @@ -2172,7 +2172,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) case 24: case 25: case 26: case 27: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x18ff)) { + } else if (__IN(f, 0x18ff, 32)) { if (fctno == 24 || fctno == 26) { if (OPB_NotVar(x)) { OPB_err(112); @@ -2198,7 +2198,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) p->typ = OPT_booltyp; break; case 29: - if (((x->class == 8 || x->class == 9) || __IN(f, 0x0501)) || x->typ->comp == 3) { + if (((x->class == 8 || x->class == 9) || __IN(f, 0x0501, 32)) || x->typ->comp == 3) { OPB_err(126); } if ((x->class != 7 && x->typ->size < p->typ->size)) { @@ -2230,7 +2230,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) OPB_err(126); } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x0810) && x->typ->size == OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x0810, 32) && x->typ->size == OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } @@ -2384,12 +2384,12 @@ static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpa ftyp = ftyp->BaseTyp; atyp = atyp->BaseTyp; if ((fvarpar && ftyp == OPT_bytetyp)) { - if (!__IN(f, 0x0c) || !((__IN(atyp->form, 0x1e) && atyp->size == 1))) { - if (__IN(18, OPM_opt)) { + if (!__IN(f, 0x0c, 32) || !((__IN(atyp->form, 0x1e, 32) && atyp->size == 1))) { + if (__IN(18, OPM_opt, 32)) { OPB_err(-301); } } - } else if (__IN(f, 0x0c)) { + } else if (__IN(f, 0x0c, 32)) { if (ftyp->comp == 3) { OPB_DynArrParCheck(ftyp, atyp, fvarpar); } else if (ftyp != atyp) { @@ -2428,7 +2428,7 @@ static void OPB_CheckReceiver (OPT_Node *x, OPT_Object fp) void OPB_PrepCall (OPT_Node *x, OPT_Object *fpar) { - if (((*x)->obj != NIL && __IN((*x)->obj->mode, 0x22c0))) { + if (((*x)->obj != NIL && __IN((*x)->obj->mode, 0x22c0, 32))) { *fpar = (*x)->obj->link; if ((*x)->obj->mode == 13) { OPB_CheckReceiver(&(*x)->left, *fpar); @@ -2467,7 +2467,7 @@ void OPB_Param (OPT_Node ap, OPT_Object fp) OPB_err(111); } } else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 11)) { - } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x1e) && ap->typ->size == 1)))))) { + } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x1e, 32) && ap->typ->size == 1)))))) { OPB_err(123); } else if ((fp->typ->form == 11 && ap->class == 5)) { OPB_err(123); @@ -2494,7 +2494,7 @@ void OPB_StaticLink (int8 dlev) scope = OPT_topScope; while (dlev > 0) { dlev -= 1; - scope->link->conval->setval |= __SETOF(3); + scope->link->conval->setval |= __SETOF(3,32); scope = scope->left; } } @@ -2589,7 +2589,7 @@ void OPB_Assign (OPT_Node *x, OPT_Node y) y->conval->intval = 0; OPB_Index(&*x, OPB_NewIntConst(0)); } - if ((((((__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp == OPT_chartyp)) && __IN(y->typ->comp, 0x0c))) && y->typ->BaseTyp == OPT_chartyp)) { + if ((((((__IN((*x)->typ->comp, 0x0c, 32) && (*x)->typ->BaseTyp == OPT_chartyp)) && __IN(y->typ->comp, 0x0c, 32))) && y->typ->BaseTyp == OPT_chartyp)) { subcl = 18; } else { subcl = 0; diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index 96866563..f9bf31fe 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 452c85d2..1fecd152 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -93,9 +93,9 @@ static BOOLEAN OPC_Undefined (OPT_Object obj); void OPC_Init (void) { OPC_indentLevel = 0; - OPC_ptrinit = __IN(5, OPM_opt); + OPC_ptrinit = __IN(5, OPM_opt, 32); OPC_mainprog = OPM_mainProg || OPM_mainLinkStat; - OPC_ansi = __IN(6, OPM_opt); + OPC_ansi = __IN(6, OPM_opt, 32); if (OPC_ansi) { __MOVE("__init(void)", OPC_BodyNameExt, 13); } else { @@ -196,7 +196,7 @@ void OPC_Ident (OPT_Object obj) int16 mode, level, h; mode = obj->mode; level = obj->mnolev; - if ((__IN(mode, 0x62) && level > 0) || __IN(mode, 0x14)) { + if ((__IN(mode, 0x62, 32) && level > 0) || __IN(mode, 0x14, 32)) { OPM_WriteStringVar((void*)obj->name, 256); h = OPC_PerfectHash((void*)obj->name, 256); if (OPC_hashtab[__X(h, 105)] >= 0) { @@ -236,7 +236,7 @@ static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause) int16 pointers; *openClause = 0; if (((typ->strobj == NIL || typ->strobj->name[0] == 0x00) && typ->comp != 4)) { - if (__IN(typ->comp, 0x0c)) { + if (__IN(typ->comp, 0x0c, 32)) { OPC_Stars(typ->BaseTyp, &*openClause); *openClause = typ->comp == 2; } else if (typ->form == 12) { @@ -293,7 +293,7 @@ static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef) break; } else if ((form == 11 && typ->BaseTyp->comp != 3)) { openClause = 1; - } else if (form == 12 || __IN(comp, 0x0c)) { + } else if (form == 12 || __IN(comp, 0x0c, 32)) { if (openClause) { OPM_Write(')'); openClause = 0; @@ -708,7 +708,7 @@ static void OPC_DefineType (OPT_Struct str) if (str->BaseTyp->comp != 4) { OPC_DefineType(str->BaseTyp); } - } else if (__IN(str->comp, 0x0c)) { + } else if (__IN(str->comp, 0x0c, 32)) { OPC_DefineType(str->BaseTyp); } else if (str->form == 12) { if (str->BaseTyp != OPT_notyp) { @@ -1019,7 +1019,7 @@ static void OPC_IdentList (OPT_Object obj, int16 vis) base = NIL; first = 1; while ((obj != NIL && obj->mode != 13)) { - if ((__IN(vis, 0x05) || (vis == 1 && obj->vis != 0)) || (vis == 3 && !obj->leaf)) { + if ((__IN(vis, 0x05, 32) || (vis == 1 && obj->vis != 0)) || (vis == 3 && !obj->leaf)) { if (obj->typ != base || (int16)obj->vis != lastvis) { if (!first) { OPC_EndStat(); @@ -1144,7 +1144,7 @@ static void OPC_ProcPredefs (OPT_Object obj, int8 vis) { if (obj != NIL) { OPC_ProcPredefs(obj->left, vis); - if ((((__IN(obj->mode, 0xc0) && obj->vis >= vis)) && (obj->history != 4 || obj->mode == 6))) { + if ((((__IN(obj->mode, 0xc0, 32) && obj->vis >= vis)) && (obj->history != 4 || obj->mode == 6))) { if (vis == 1) { OPM_WriteString((CHAR*)"import ", 8); } else if (obj->vis == 0) { @@ -1238,7 +1238,7 @@ static void OPC_GenHeaderMsg (void) OPM_Write(' '); i = 0; while (i <= 31) { - if (__IN(i, OPM_glbopt)) { + if (__IN(i, OPM_glbopt, 32)) { switch (i) { case 0: OPM_Write('x'); @@ -1600,7 +1600,7 @@ void OPC_EnterProc (OPT_Object proc) } var = proc->link; while (var != NIL) { - if ((((__IN(var->typ->comp, 0x0c) && var->mode == 1)) && var->typ->sysflag == 0)) { + if ((((__IN(var->typ->comp, 0x0c, 32) && var->mode == 1)) && var->typ->sysflag == 0)) { OPC_BegStat(); if (var->typ->comp == 2) { OPM_WriteString((CHAR*)"__DUPARR(", 10); @@ -1648,7 +1648,7 @@ void OPC_EnterProc (OPT_Object proc) OPM_Write('.'); OPC_Ident(var); OPM_WriteString((CHAR*)" = ", 4); - if (__IN(var->typ->comp, 0x0c)) { + if (__IN(var->typ->comp, 0x0c, 32)) { OPM_WriteString((CHAR*)"(void*)", 8); } else if (var->mode != 2) { OPM_Write('&'); @@ -2006,7 +2006,7 @@ void OPC_Constant (OPT_Const con, int16 form) do { i -= 1; hex = __ASHL(hex, 1); - if (__IN(i, s)) { + if (__IN(i, s, 32)) { hex += 1; } } while (!(__MASK(i, -8) == 0)); diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index 81e8362d..b8f44225 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 671a9d8f..6af53f8c 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -288,15 +288,15 @@ void OPM_InitOptions (void) s[0] = 0x00; Platform_GetArg(OPM_S, (void*)s, 256); } - OPM_dontAsm = __IN(13, OPM_opt); - OPM_dontLink = __IN(14, OPM_opt); - OPM_mainProg = __IN(10, OPM_opt); - OPM_mainLinkStat = __IN(15, OPM_opt); - OPM_notColorOutput = __IN(16, OPM_opt); - OPM_forceNewSym = __IN(17, OPM_opt); - OPM_Verbose = __IN(18, OPM_opt); + OPM_dontAsm = __IN(13, OPM_opt, 32); + OPM_dontLink = __IN(14, OPM_opt, 32); + OPM_mainProg = __IN(10, OPM_opt, 32); + OPM_mainLinkStat = __IN(15, OPM_opt, 32); + OPM_notColorOutput = __IN(16, OPM_opt, 32); + OPM_forceNewSym = __IN(17, OPM_opt, 32); + OPM_Verbose = __IN(18, OPM_opt, 32); if (OPM_mainLinkStat) { - OPM_glbopt |= __SETOF(10); + OPM_glbopt |= __SETOF(10,32); } OPM_GetProperties(); } @@ -773,7 +773,7 @@ void OPM_SymWLReal (LONGREAL lr) void OPM_RegisterNewSym (void) { - if (__STRCMP(OPM_modName, "SYSTEM") != 0 || __IN(10, OPM_opt)) { + if (__STRCMP(OPM_modName, "SYSTEM") != 0 || __IN(10, OPM_opt, 32)) { Files_Register(OPM_newSFile); } } @@ -972,10 +972,10 @@ void OPM_CloseFiles (void) } if (OPM_noerr) { if (__STRCMP(OPM_modName, "SYSTEM") == 0) { - if (!__IN(10, OPM_opt)) { + if (!__IN(10, OPM_opt, 32)) { Files_Register(OPM_BFile); } - } else if (!__IN(10, OPM_opt)) { + } else if (!__IN(10, OPM_opt, 32)) { OPM_Append(&OPM_R[2], Files_Rider__typ, OPM_HFile); Files_Register(OPM_HIFile); Files_Register(OPM_BFile); diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index 0d9bcdeb..67edafa5 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index de0afa51..d8dee08e 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -94,7 +94,7 @@ static void OPP_qualident (OPT_Object *id) obj->adr = 0; } else { lev = obj->mnolev; - if ((__IN(obj->mode, 0x06) && lev != OPP_level)) { + if ((__IN(obj->mode, 0x06, 32) && lev != OPP_level)) { obj->leaf = 0; if (lev > 0) { OPB_StaticLink(OPP_level - lev); @@ -325,7 +325,7 @@ static void OPP_PointerType (OPT_Struct *typ) } else { OPP_qualident(&id); if (id->mode == 5) { - if (__IN(id->typ->comp, 0x1c)) { + if (__IN(id->typ->comp, 0x1c, 32)) { (*typ)->BaseTyp = id->typ; } else { (*typ)->BaseTyp = OPT_undftyp; @@ -338,7 +338,7 @@ static void OPP_PointerType (OPT_Struct *typ) } } else { OPP_Type(&(*typ)->BaseTyp, &OPT_notyp); - if (!__IN((*typ)->BaseTyp->comp, 0x1c)) { + if (!__IN((*typ)->BaseTyp->comp, 0x1c, 32)) { (*typ)->BaseTyp = OPT_undftyp; OPP_err(57); } @@ -966,7 +966,7 @@ static void GetCode__19 (void) } } } - (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1); + (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1,32); } static void GetParams__21 (void) @@ -998,7 +998,7 @@ static void Body__17 (void) OPT_Node procdec = NIL, statseq = NIL; int32 c; c = OPM_errpos; - (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1); + (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1,32); OPP_CheckSym(39); OPP_Block(&procdec, &statseq); OPB_Enter(&procdec, statseq, *ProcedureDeclaration__16_s->proc); @@ -1041,7 +1041,7 @@ static void TProcDecl__23 (void) if ((*ProcedureDeclaration__16_s->fwd != NIL && (*ProcedureDeclaration__16_s->fwd)->mnolev != OPP_level)) { *ProcedureDeclaration__16_s->fwd = NIL; } - if ((((*ProcedureDeclaration__16_s->fwd != NIL && (*ProcedureDeclaration__16_s->fwd)->mode == 13)) && !__IN(1, (*ProcedureDeclaration__16_s->fwd)->conval->setval))) { + if ((((*ProcedureDeclaration__16_s->fwd != NIL && (*ProcedureDeclaration__16_s->fwd)->mode == 13)) && !__IN(1, (*ProcedureDeclaration__16_s->fwd)->conval->setval, 32))) { *ProcedureDeclaration__16_s->proc = OPT_NewObj(); (*ProcedureDeclaration__16_s->proc)->leaf = 1; if ((*ProcedureDeclaration__16_s->fwd)->vis != *ProcedureDeclaration__16_s->vis) { @@ -1075,7 +1075,7 @@ static void TProcDecl__23 (void) if ((((((baseProc->vis == 1 && (*ProcedureDeclaration__16_s->proc)->vis == 0)) && recTyp->strobj != NIL)) && recTyp->strobj->vis == 1)) { OPP_err(109); } - (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(2); + (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(2,32); } if (!*ProcedureDeclaration__16_s->forward) { Body__17(); @@ -1118,7 +1118,7 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) } else { OPP_err(38); } - if ((__IN(mode, 0x0600) && !OPT_SYSimported)) { + if ((__IN(mode, 0x0600, 32) && !OPT_SYSimported)) { OPP_err(135); } OPS_Get(&OPP_sym); @@ -1135,7 +1135,7 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) if ((fwd != NIL && (fwd->mnolev != OPP_level || fwd->mode == 8))) { fwd = NIL; } - if ((((fwd != NIL && __IN(fwd->mode, 0xc0))) && !__IN(1, fwd->conval->setval))) { + if ((((fwd != NIL && __IN(fwd->mode, 0xc0, 32))) && !__IN(1, fwd->conval->setval, 32))) { proc = OPT_NewObj(); proc->leaf = 1; if (fwd->vis != vis) { @@ -1178,7 +1178,7 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int16 *n, OPP for (;;) { OPP_ConstExpression(&x); f = x->typ->form; - if (__IN(f, 0x18)) { + if (__IN(f, 0x18, 32)) { xval = x->conval->intval; } else { OPP_err(61); @@ -1258,7 +1258,7 @@ static void CasePart__31 (OPT_Node *x) *StatSeq__30_s->pos = OPM_errpos; if ((*x)->class == 8 || (*x)->class == 9) { OPP_err(126); - } else if (!__IN((*x)->typ->form, 0x18)) { + } else if (!__IN((*x)->typ->form, 0x18, 32)) { OPP_err(125); } OPP_CheckSym(25); @@ -1675,7 +1675,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) if (obj->typ->strobj == NIL) { obj->typ->strobj = obj; } - if (__IN(obj->typ->comp, 0x1c)) { + if (__IN(obj->typ->comp, 0x1c, 32)) { i = 0; while (i < OPP_nofFwdPtr) { typ = OPP_FwdPtr[__X(i, 64)]; diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index 2d3ebd77..9ddded2f 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index e6e99c02..cd51e788 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index 99448598..658c87db 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index 4a645e7a..ab44584b 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -274,9 +274,9 @@ void OPT_Init (OPS_Name name, SET opt) __COPY(name, OPT_topScope->name, 256); OPT_GlbMod[0] = OPT_topScope; OPT_nofGmod = 1; - OPT_newsf = __IN(4, opt); - OPT_findpc = __IN(8, opt); - OPT_extsf = OPT_newsf || __IN(9, opt); + OPT_newsf = __IN(4, opt, 32); + OPT_findpc = __IN(8, opt, 32); + OPT_extsf = OPT_newsf || __IN(9, opt, 32); OPT_sfpresent = 1; } @@ -609,7 +609,7 @@ void OPT_FPrintStr (OPT_Struct typ) pvfp = pbfp; } } else if (f == 12) { - } else if (__IN(c, 0x0c)) { + } else if (__IN(c, 0x0c, 32)) { OPT_FPrintStr(btyp); OPM_FPrint(&pbfp, btyp->pvfp); pvfp = pbfp; @@ -680,7 +680,7 @@ void OPT_FPrintObj (OPT_Object obj) OPM_FPrint(&fprint, obj->vis); OPT_FPrintStr(obj->typ); OPM_FPrint(&fprint, obj->typ->pbfp); - } else if (__IN(obj->mode, 0x0480)) { + } else if (__IN(obj->mode, 0x0480, 32)) { OPT_FPrintSign(&fprint, obj->typ, obj->link); } else if (obj->mode == 9) { OPT_FPrintSign(&fprint, obj->typ, obj->link); @@ -1573,7 +1573,7 @@ static void OPT_OutObj (OPT_Object obj) OPT_ConstExt ext = NIL; if (obj != NIL) { OPT_OutObj(obj->left); - if (__IN(obj->mode, 0x06ea)) { + if (__IN(obj->mode, 0x06ea, 32)) { if (obj->history == 4) { OPT_FPrintErr(obj, 250); } else if (obj->vis != 0) { diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index 93975ea1..978ae16b 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index b264d44e..c20aef90 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -130,10 +130,10 @@ void OPV_Init (void) OPV_stamp = 0; OPV_recno = 0; OPV_nofExitLabels = 0; - OPV_assert = __IN(7, OPM_opt); - OPV_inxchk = __IN(0, OPM_opt); - OPV_mainprog = __IN(10, OPM_opt); - OPV_ansi = __IN(6, OPM_opt); + OPV_assert = __IN(7, OPM_opt, 32); + OPV_inxchk = __IN(0, OPM_opt, 32); + OPV_mainprog = __IN(10, OPM_opt, 32); + OPV_ansi = __IN(6, OPM_opt, 32); } static void OPV_GetTProcNum (OPT_Object obj) @@ -150,7 +150,7 @@ static void OPV_GetTProcNum (OPT_Object obj) OPT_FindField(obj->name, typ->BaseTyp, &redef); if (redef != NIL) { obj->adr = __ASHL(__ASHR(redef->adr, 16), 16); - if (!__IN(2, obj->conval->setval)) { + if (!__IN(2, obj->conval->setval, 32)) { OPM_err(119); } } else { @@ -230,12 +230,12 @@ static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exporte OPV_TypSize(obj->typ); } if (!exported) { - if ((__IN(mode, 0x60) && obj->mnolev > 0)) { + if ((__IN(mode, 0x60, 32) && obj->mnolev > 0)) { OPV_Stamp(obj->name); } - if (__IN(mode, 0x26)) { + if (__IN(mode, 0x26, 32)) { obj->scope = outerScope; - } else if (__IN(mode, 0x26c0)) { + } else if (__IN(mode, 0x26c0, 32)) { if (obj->conval->setval == 0x0) { OPM_err(129); } @@ -289,7 +289,7 @@ static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp return _o_result; break; case 5: - if (__IN(3, OPM_opt)) { + if (__IN(3, OPM_opt, 32)) { _o_result = 10; return _o_result; } else { @@ -298,7 +298,7 @@ static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp } break; case 1: - if (__IN(comp, 0x0c)) { + if (__IN(comp, 0x0c, 32)) { _o_result = 10; return _o_result; } else { @@ -445,7 +445,7 @@ static BOOLEAN OPV_SideEffects (OPT_Node n) static void OPV_Entier (OPT_Node n, int16 prec) { - if (__IN(n->typ->form, 0x60)) { + if (__IN(n->typ->form, 0x60, 32)) { OPM_WriteString((CHAR*)"__ENTIER(", 10); OPV_expr(n, -1); OPM_Write(')'); @@ -471,9 +471,11 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int16 prec) if (to == 7) { OPM_WriteString((CHAR*)"__SETOF(", 9); OPV_Entier(n, -1); + OPM_WriteString((CHAR*)",", 2); + OPM_WriteInt(__ASHL(newtype->size, 3)); OPM_Write(')'); } else if (to == 4) { - if ((newtype->size < n->typ->size && __IN(2, OPM_opt))) { + if ((newtype->size < n->typ->size && __IN(2, OPM_opt, 32))) { OPM_WriteString((CHAR*)"__SHORT", 8); if (OPV_SideEffects(n)) { OPM_Write('F'); @@ -488,7 +490,7 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int16 prec) OPV_Entier(n, 9); } } else if (to == 3) { - if (__IN(2, OPM_opt)) { + if (__IN(2, OPM_opt, 32)) { OPM_WriteString((CHAR*)"__CHR", 6); if (OPV_SideEffects(n)) { OPM_Write('F'); @@ -511,7 +513,7 @@ static void OPV_TypeOf (OPT_Node n) OPM_WriteString((CHAR*)"__TYPEOF(", 10); OPV_expr(n, -1); OPM_Write(')'); - } else if (__IN(n->class, 0x15)) { + } else if (__IN(n->class, 0x15, 32)) { OPC_Andent(n->typ); OPM_WriteString((CHAR*)"__typ", 6); } else if (n->class == 3) { @@ -572,7 +574,7 @@ static void OPV_design (OPT_Node n, int16 prec) OPC_CompleteIdent(n->obj); break; case 1: - if (!__IN(comp, 0x0c)) { + if (!__IN(comp, 0x0c, 32)) { OPM_Write('*'); } OPC_CompleteIdent(n->obj); @@ -651,7 +653,7 @@ static void OPV_design (OPT_Node n, int16 prec) case 5: typ = n->typ; obj = n->left->obj; - if (__IN(3, OPM_opt)) { + if (__IN(3, OPM_opt, 32)) { if (typ->comp == 4) { OPM_WriteString((CHAR*)"__GUARDR(", 10); if ((int16)obj->mnolev != OPM_level) { @@ -690,7 +692,7 @@ static void OPV_design (OPT_Node n, int16 prec) } break; case 6: - if (__IN(3, OPM_opt)) { + if (__IN(3, OPM_opt, 32)) { if (n->left->class == 1) { OPM_WriteString((CHAR*)"__GUARDEQR(", 12); OPC_CompleteIdent(n->left->obj); @@ -749,7 +751,7 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) OPM_WriteString((CHAR*)"*)", 3); prec = 10; } - if (!__IN(n->typ->comp, 0x0c)) { + if (!__IN(n->typ->comp, 0x0c, 32)) { if (mode == 2) { if ((OPV_ansi && typ != n->typ)) { OPM_WriteString((CHAR*)"(void*)", 8); @@ -757,13 +759,13 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) OPM_Write('&'); prec = 9; } else if (OPV_ansi) { - if ((__IN(comp, 0x0c) && n->class == 7)) { + if ((__IN(comp, 0x0c, 32) && n->class == 7)) { OPM_WriteString((CHAR*)"(CHAR*)", 8); } else if ((((form == 11 && typ != n->typ)) && n->typ != OPT_niltyp)) { OPM_WriteString((CHAR*)"(void*)", 8); } } else { - if ((__IN(form, 0x60) && n->typ->form == 4)) { + if ((__IN(form, 0x60, 32) && n->typ->form == 4)) { OPM_WriteString((CHAR*)"(double)", 9); prec = 9; } else if (form == 4) { @@ -846,7 +848,7 @@ static void OPV_expr (OPT_Node n, int16 prec) l = n->left; r = n->right; exprPrec = OPV_Precedence(class, subclass, form, n->typ->comp); - if ((exprPrec <= prec && __IN(class, 0x3ce0))) { + if ((exprPrec <= prec && __IN(class, 0x3ce0, 32))) { OPM_Write('('); } switch (class) { @@ -858,6 +860,8 @@ static void OPV_expr (OPT_Node n, int16 prec) OPV_expr(l, -1); OPM_WriteString((CHAR*)", ", 3); OPV_expr(r, -1); + OPM_WriteString((CHAR*)", ", 3); + OPM_WriteInt(__ASHL(n->typ->size, 3)); OPM_Write(')'); break; case 11: @@ -924,18 +928,18 @@ static void OPV_expr (OPT_Node n, int16 prec) if (l->class == 1) { OPC_CompleteIdent(l->obj); } else { - if ((l->typ->form != 8 && !__IN(l->typ->comp, 0x0c))) { + if ((l->typ->form != 8 && !__IN(l->typ->comp, 0x0c, 32))) { OPM_Write('&'); } OPV_expr(l, exprPrec); } break; case 29: - if (!__IN(l->class, 0x17) || (((__IN(n->typ->form, 0x1890) && __IN(l->typ->form, 0x1890))) && n->typ->size == l->typ->size)) { + if (!__IN(l->class, 0x17, 32) || (((__IN(n->typ->form, 0x1890, 32) && __IN(l->typ->form, 0x1890, 32))) && n->typ->size == l->typ->size)) { OPM_Write('('); OPC_Ident(n->typ->strobj); OPM_Write(')'); - if (__IN(n->typ->form, 0x1800) || __IN(l->typ->form, 0x1800)) { + if (__IN(n->typ->form, 0x1800, 32) || __IN(l->typ->form, 0x1800, 32)) { OPM_WriteString((CHAR*)"(address)", 10); } OPV_expr(l, exprPrec); @@ -1032,20 +1036,24 @@ static void OPV_expr (OPT_Node n, int16 prec) } OPV_expr(l, -1); OPM_WriteString((CHAR*)", ", 3); - if ((((__IN(subclass, 0x18020000) && r->class == 7)) && r->conval->intval < 0)) { + if ((((__IN(subclass, 0x18020000, 32) && r->class == 7)) && r->conval->intval < 0)) { OPM_WriteInt(-r->conval->intval); } else { OPV_expr(r, -1); } - if (__IN(subclass, 0x18000000)) { + if (__IN(subclass, 0x18008000, 32)) { OPM_WriteString((CHAR*)", ", 3); - OPM_WriteInt(__ASHL(l->typ->size, 3)); + if (subclass == 15) { + OPM_WriteInt(__ASHL(r->typ->size, 3)); + } else { + OPM_WriteInt(__ASHL(l->typ->size, 3)); + } } OPM_Write(')'); break; case 9: case 10: case 11: case 12: case 13: case 14: - if (__IN(l->typ->form, 0x2100)) { + if (__IN(l->typ->form, 0x2100, 32)) { OPM_WriteString((CHAR*)"__STRCMP(", 10); OPV_expr(l, -1); OPM_WriteString((CHAR*)", ", 3); @@ -1142,7 +1150,7 @@ static void OPV_expr (OPT_Node n, int16 prec) OPV_design(n, prec); break; } - if ((exprPrec <= prec && __IN(class, 0x3ca0))) { + if ((exprPrec <= prec && __IN(class, 0x3ca0, 32))) { OPM_Write(')'); } } @@ -1432,7 +1440,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPM_WriteString((CHAR*)", ", 3); OPC_Andent(n->left->typ->BaseTyp); OPM_WriteString((CHAR*)")", 2); - } else if (__IN(n->left->typ->BaseTyp->comp, 0x0c)) { + } else if (__IN(n->left->typ->BaseTyp->comp, 0x0c, 32)) { OPV_NewArr(n->left, n->right); } break; @@ -1446,6 +1454,8 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPC_SetInclude(n->subcl == 16); OPM_WriteString((CHAR*)"__SETOF(", 9); OPV_expr(n->right, -1); + OPM_WriteString((CHAR*)",", 2); + OPM_WriteInt(__ASHL(n->left->typ->size, 3)); OPM_Write(')'); break; case 18: @@ -1623,7 +1633,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPM_LogWLn(); break; } - if (!__IN(n->class, 0x09744000)) { + if (!__IN(n->class, 0x09744000, 32)) { OPC_EndStat(); } n = n->link; diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index 3b43e61e..ea1f9aaa 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 4842a8c4..1bf0628e 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index 295013cf..7c0b2d21 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index e209af08..a64c2d13 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index 2779fc88..d7981245 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index 387345ab..67c0f055 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index fe90bd09..6f4f1073 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index 1d7b5409..503c4e06 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -578,13 +578,13 @@ void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, SET sel, Texts_Fonts T->cache = c; T->corg = co; while (un != vn) { - if ((__IN(0, sel) && fnt != NIL)) { + if ((__IN(0, sel, 32) && fnt != NIL)) { un->fnt = fnt; } - if (__IN(1, sel)) { + if (__IN(1, sel, 32)) { un->col = col; } - if (__IN(2, sel)) { + if (__IN(2, sel, 32)) { un->voff = voff; } Texts_Merge(T, u, &un); diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index d684a9c0..b5b22e1b 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/Vishap.c b/bootstrap/unix-44/Vishap.c index fb1c1662..2efce68f 100644 --- a/bootstrap/unix-44/Vishap.c +++ b/bootstrap/unix-44/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkamSf */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/errors.c b/bootstrap/unix-44/errors.c index 7feed8e7..6f8e3d33 100644 --- a/bootstrap/unix-44/errors.c +++ b/bootstrap/unix-44/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/errors.h b/bootstrap/unix-44/errors.h index 4fe434e1..58286fd8 100644 --- a/bootstrap/unix-44/errors.h +++ b/bootstrap/unix-44/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index 0afff1f0..bbecb9f2 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index 5d996dae..8a0d60be 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-44/vt100.c b/bootstrap/unix-44/vt100.c index 8a5286ec..b5422c40 100644 --- a/bootstrap/unix-44/vt100.c +++ b/bootstrap/unix-44/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/vt100.h b/bootstrap/unix-44/vt100.h index c09b4c71..85494a63 100644 --- a/bootstrap/unix-44/vt100.h +++ b/bootstrap/unix-44/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index cc4f7969..d8c934bf 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/12] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/14] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index 3ce4467e..2b7bdf82 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Console.c b/bootstrap/unix-48/Console.c index e33f3d7c..5a0b29a2 100644 --- a/bootstrap/unix-48/Console.c +++ b/bootstrap/unix-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Console.h b/bootstrap/unix-48/Console.h index c6fe7fc4..0af02096 100644 --- a/bootstrap/unix-48/Console.h +++ b/bootstrap/unix-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index ebdd14a9..58145066 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index 42e60467..521906c3 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index 4d96ea89..f03a4d7e 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tskSfF */ #define INTEGER int16 #define LONGINT int32 @@ -82,6 +82,7 @@ export LONGINT *Heap__1__typ; static void Heap_CheckFin (void); static void Heap_ExtendHeap (address blksz); export void Heap_FINALL (void); +static address Heap_FetchAddress (address pointer); static void Heap_Finalize (void); export void Heap_GC (BOOLEAN markStack); static void Heap_HeapSort (address n, address *a, LONGINT a__len); @@ -106,7 +107,6 @@ export void Heap_Unlock (void); extern void *Heap__init(); extern address Platform_MainStackFrame; extern address Platform_OSAllocate(address size); -#define Heap_FetchAddress(pointer) (address)(*((void**)((address)pointer))) #define Heap_HeapModuleInit() Heap__init() #define Heap_OSAllocate(size) Platform_OSAllocate(size) #define Heap_PlatformHalt(code) Platform_Halt(code) @@ -188,6 +188,15 @@ static address Heap_NewChunk (address blksz) return _o_result; } +static address Heap_FetchAddress (address pointer) +{ + address _o_result; + address r; + __GET(pointer, r, address); + _o_result = r; + return _o_result; +} + static void Heap_ExtendHeap (address blksz) { address size, chnk, j, next; diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index 1a6c9e05..29b4cb26 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index 9834a814..a71d3e4d 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index e34e59ed..6a744f9b 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index 92c0af42..a905da35 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -345,7 +345,7 @@ void OPB_Index (OPT_Node *x, OPT_Node y) f = y->typ->form; if ((*x)->class >= 7) { OPB_err(79); - } else if (f != 4 || __IN(y->class, 0x0300)) { + } else if (f != 4 || __IN(y->class, 0x0300, 32)) { OPB_err(80); y->typ = OPT_inttyp; } @@ -372,7 +372,7 @@ void OPB_Field (OPT_Node *x, OPT_Object y) if ((*x)->class >= 7) { OPB_err(77); } - if ((y != NIL && __IN(y->mode, 0x2010))) { + if ((y != NIL && __IN(y->mode, 0x2010, 32))) { OPB_BindNodes(2, y->typ, &*x, NIL); (*x)->obj = y; (*x)->readonly = (*x)->left->readonly || (y->vis == 2 && y->mnolev < 0); @@ -476,7 +476,7 @@ void OPB_In (OPT_Node *x, OPT_Node y) if (k < 0 || k > OPM_MaxSet) { OPB_err(202); } else if (y->class == 7) { - (*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval)); + (*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval, 32)); (*x)->obj = NIL; } else { OPB_BindNodes(12, OPT_booltyp, &*x, y); @@ -572,12 +572,12 @@ void OPB_MOp (int8 op, OPT_Node *x) } break; case 6: - if (!__IN(f, 0x70)) { + if (!__IN(f, 0x70, 32)) { OPB_err(96); } break; case 7: - if (__IN(f, 0xf0)) { + if (__IN(f, 0xf0, 32)) { if (z->class == 7) { if (f == 4) { if (z->conval->intval == (-2147483647-1)) { @@ -586,7 +586,7 @@ void OPB_MOp (int8 op, OPT_Node *x) z->conval->intval = -z->conval->intval; OPB_SetIntType(z); } - } else if (__IN(f, 0x60)) { + } else if (__IN(f, 0x60, 32)) { z->conval->realval = -z->conval->realval; } else { z->conval->setval = ~z->conval->setval; @@ -600,7 +600,7 @@ void OPB_MOp (int8 op, OPT_Node *x) } break; case 21: - if (__IN(f, 0x70)) { + if (__IN(f, 0x70, 32)) { if (z->class == 7) { if (f == 4) { if (z->conval->intval == (-2147483647-1)) { @@ -747,7 +747,7 @@ void OPB_CheckParameters (OPT_Object fp, OPT_Object ap, BOOLEAN checkNames) static void OPB_CheckProc (OPT_Struct x, OPT_Object y) { - if (__IN(y->mode, 0x04c0)) { + if (__IN(y->mode, 0x04c0, 32)) { if (y->mode == 6) { if (y->mnolev == 0) { y->mode = 7; @@ -923,7 +923,7 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) } break; case 9: - if (!__IN(g, 0x1800)) { + if (!__IN(g, 0x1800, 32)) { OPB_err(100); } break; @@ -954,7 +954,7 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) } else { OPB_err(204); } - } else if (__IN(f, 0x60)) { + } else if (__IN(f, 0x60, 32)) { temp = __ABS(yval->realval) <= (LONGREAL)1; if (temp || __ABS(xval->realval) <= 1.79769296342094e+308 / (LONGREAL)__ABS(yval->realval)) { xval->realval = xval->realval * yval->realval; @@ -978,7 +978,7 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) xval->realval = (LONGREAL)1; } x->typ = OPT_realtyp; - } else if (__IN(f, 0x60)) { + } else if (__IN(f, 0x60, 32)) { temp = __ABS(yval->realval) >= (LONGREAL)1; if (temp || __ABS(xval->realval) <= 1.79769296342094e+308 * __ABS(yval->realval)) { xval->realval = xval->realval / yval->realval; @@ -1032,7 +1032,7 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) } else { OPB_err(206); } - } else if (__IN(f, 0x60)) { + } else if (__IN(f, 0x60, 32)) { temp = (yval->realval >= (LONGREAL)0 && xval->realval <= 1.79769296342094e+308 - yval->realval); if (temp || (yval->realval < (LONGREAL)0 && xval->realval >= -1.79769296342094e+308 - yval->realval)) { xval->realval = xval->realval + yval->realval; @@ -1054,7 +1054,7 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) } else { OPB_err(207); } - } else if (__IN(f, 0x60)) { + } else if (__IN(f, 0x60, 32)) { temp = (yval->realval >= (LONGREAL)0 && xval->realval >= -1.79769296342094e+308 + yval->realval); if (temp || (yval->realval < (LONGREAL)0 && xval->realval <= 1.79769296342094e+308 + yval->realval)) { xval->realval = xval->realval - yval->realval; @@ -1082,28 +1082,28 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) xval->intval = OPB_BoolToInt(ConstCmp__14() != 9); break; case 11: - if (__IN(f, 0x0a84)) { + if (__IN(f, 0x0a84, 32)) { OPB_err(108); } else { xval->intval = OPB_BoolToInt(ConstCmp__14() == 11); } break; case 12: - if (__IN(f, 0x0a84)) { + if (__IN(f, 0x0a84, 32)) { OPB_err(108); } else { xval->intval = OPB_BoolToInt(ConstCmp__14() != 13); } break; case 13: - if (__IN(f, 0x0a84)) { + if (__IN(f, 0x0a84, 32)) { OPB_err(108); } else { xval->intval = OPB_BoolToInt(ConstCmp__14() == 13); } break; case 14: - if (__IN(f, 0x0a84)) { + if (__IN(f, 0x0a84, 32)) { OPB_err(108); } else { xval->intval = OPB_BoolToInt(ConstCmp__14() != 11); @@ -1136,7 +1136,7 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) (*x)->conval->intval = 1; } } - } else if (__IN(g, 0x60)) { + } else if (__IN(g, 0x60, 32)) { (*x)->conval->realval = (*x)->conval->intval; (*x)->conval->intval = -1; } else { @@ -1145,8 +1145,8 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) OPB_err(220); } } - } else if (__IN(f, 0x60)) { - if (__IN(g, 0x60)) { + } else if (__IN(f, 0x60, 32)) { + if (__IN(g, 0x60, 32)) { OPB_CheckRealType(g, 203, (*x)->conval); } else { r = (*x)->conval->realval; @@ -1195,8 +1195,8 @@ static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) { BOOLEAN _o_result; BOOLEAN ok, xCharArr, yCharArr; - xCharArr = (__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp->form == 3) || *Op__38_s->f == 8; - yCharArr = (__IN((*y)->typ->comp, 0x0c) && (*y)->typ->BaseTyp->form == 3) || *Op__38_s->g == 8; + xCharArr = (__IN((*x)->typ->comp, 0x0c, 32) && (*x)->typ->BaseTyp->form == 3) || *Op__38_s->f == 8; + yCharArr = (__IN((*y)->typ->comp, 0x0c, 32) && (*y)->typ->BaseTyp->form == 3) || *Op__38_s->g == 8; if ((((xCharArr && *Op__38_s->g == 3)) && (*y)->class == 7)) { OPB_CharToString(*y); *Op__38_s->g = 8; @@ -1255,7 +1255,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) case 4: if ((g == 4 && y->typ->size < z->typ->size)) { OPB_Convert(&y, z->typ); - } else if (__IN(g, 0x70)) { + } else if (__IN(g, 0x70, 32)) { OPB_Convert(&z, y->typ); } else { OPB_err(100); @@ -1264,23 +1264,23 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) case 5: if (g == 4) { OPB_Convert(&y, z->typ); - } else if (__IN(g, 0x60)) { + } else if (__IN(g, 0x60, 32)) { OPB_Convert(&z, y->typ); } else { OPB_err(100); } break; case 6: - if (__IN(g, 0x70)) { + if (__IN(g, 0x70, 32)) { OPB_Convert(&y, z->typ); - } else if (__IN(g, 0x60)) { + } else if (__IN(g, 0x60, 32)) { OPB_Convert(&y, z->typ); } else { OPB_err(100); } break; case 9: - if (!__IN(g, 0x1800)) { + if (!__IN(g, 0x1800, 32)) { OPB_err(100); } break; @@ -1341,7 +1341,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) y->obj = NIL; } } - } else if (!__IN(f, 0xe1)) { + } else if (!__IN(f, 0xe1, 32)) { OPB_err(105); typ = OPT_undftyp; } @@ -1357,7 +1357,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) OPB_Convert(&z, OPT_realtyp); OPB_Convert(&y, OPT_realtyp); typ = OPT_realtyp; - } else if (__IN(f, 0x60)) { + } else if (__IN(f, 0x60, 32)) { if ((y->class == 7 && y->conval->realval == (LONGREAL)0)) { OPB_err(205); } @@ -1424,7 +1424,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) } break; case 6: - if (!__IN(f, 0xf1)) { + if (!__IN(f, 0xf1, 32)) { OPB_err(105); typ = OPT_undftyp; } @@ -1443,7 +1443,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) } break; case 7: - if (!__IN(f, 0xf1)) { + if (!__IN(f, 0xf1, 32)) { OPB_err(106); typ = OPT_undftyp; } @@ -1467,7 +1467,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) } break; case 9: case 10: - if (__IN(f, 0x1aff) || strings__41(&z, &y)) { + if (__IN(f, 0x1aff, 32) || strings__41(&z, &y)) { typ = OPT_booltyp; } else { OPB_err(107); @@ -1476,7 +1476,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) NewOp__39(op, typ, &z, y); break; case 11: case 12: case 13: case 14: - if (__IN(f, 0x79) || strings__41(&z, &y)) { + if (__IN(f, 0x79, 32) || strings__41(&z, &y)) { typ = OPT_booltyp; } else { OPM_LogWLn(); @@ -1518,10 +1518,10 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y) } if (((*x)->class == 7 && y->class == 7)) { if (k <= l) { - (*x)->conval->setval = __SETRNG(k, l); + (*x)->conval->setval = __SETRNG(k, l, 32); } else { OPB_err(201); - (*x)->conval->setval = __SETRNG(l, k); + (*x)->conval->setval = __SETRNG(l, k, 32); } (*x)->obj = NIL; } else { @@ -1543,7 +1543,7 @@ void OPB_SetElem (OPT_Node *x) } else if ((*x)->class == 7) { k = (*x)->conval->intval; if ((0 <= k && k <= OPM_MaxSet)) { - (*x)->conval->setval = __SETOF(k); + (*x)->conval->setval = __SETOF(k,32); } else { OPB_err(202); } @@ -1588,7 +1588,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) case 0: case 8: break; case 1: - if (!((__IN(g, 0x1a) && y->size == 1))) { + if (!((__IN(g, 0x1a, 32) && y->size == 1))) { OPB_err(113); } break; @@ -1603,12 +1603,12 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) } break; case 5: - if (!__IN(g, 0x30)) { + if (!__IN(g, 0x30, 32)) { OPB_err(113); } break; case 6: - if (!__IN(g, 0x70)) { + if (!__IN(g, 0x70, 32)) { OPB_err(113); } break; @@ -1656,7 +1656,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) if (ynode->conval->intval2 > x->n) { OPB_err(114); } - } else if ((__IN(y->comp, 0x0c) && y->BaseTyp == OPT_chartyp)) { + } else if ((__IN(y->comp, 0x0c, 32) && y->BaseTyp == OPT_chartyp)) { } else { OPB_err(113); } @@ -1664,7 +1664,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPB_err(113); } } else if ((x->comp == 3 && x->BaseTyp == OPT_chartyp)) { - if ((__IN(y->comp, 0x0c) && y->BaseTyp == OPT_chartyp)) { + if ((__IN(y->comp, 0x0c, 32) && y->BaseTyp == OPT_chartyp)) { } else { OPB_err(113); } @@ -1691,7 +1691,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPM_LogWLn(); break; } - if ((((((ynode->class == 7 && g < f)) && __IN(g, 0x30))) && __IN(f, 0x70))) { + if ((((((ynode->class == 7 && g < f)) && __IN(g, 0x30, 32))) && __IN(f, 0x70, 32))) { OPB_Convert(&ynode, x); } } @@ -1729,7 +1729,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) OPB_err(76); } f = x->typ->BaseTyp->comp; - if (__IN(f, 0x1c)) { + if (__IN(f, 0x1c, 32)) { if (f == 3) { typ = x->typ->BaseTyp; } @@ -1762,7 +1762,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) case 5: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x60)) { + } else if (__IN(f, 0x60, 32)) { OPB_Convert(&x, OPT_linttyp); } else { OPB_err(111); @@ -1837,7 +1837,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) case 9: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x11)) { + } else if (__IN(f, 0x11, 32)) { OPB_Convert(&x, OPT_chartyp); } else { OPB_err(111); @@ -1898,7 +1898,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) } break; case 17: - if (!__IN(x->typ->comp, 0x0c)) { + if (!__IN(x->typ->comp, 0x0c, 32)) { OPB_err(131); } break; @@ -1909,7 +1909,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) } if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (((!__IN(x->typ->comp, 0x0c) || x->typ->BaseTyp->form != 3) && f != 8)) { + } else if (((!__IN(x->typ->comp, 0x0c, 32) || x->typ->BaseTyp->form != 3) && f != 8)) { OPB_err(111); } break; @@ -1933,7 +1933,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) if (x->class != 8) { OPB_err(110); x = OPB_NewIntConst(1); - } else if (__IN(f, 0x18fe) || __IN(x->typ->comp, 0x14)) { + } else if (__IN(f, 0x18fe, 32) || __IN(x->typ->comp, 0x14, 32)) { (*OPB_typSize)(x->typ); x->typ->pvused = 1; x = OPB_NewIntConst(x->typ->size); @@ -1948,7 +1948,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) case 22: case 23: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (!__IN(f, 0x9a)) { + } else if (!__IN(f, 0x9a, 32)) { OPB_err(111); } break; @@ -1957,7 +1957,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) OPB_err(126); } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x0810) && x->typ->size == OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x0810, 32) && x->typ->size == OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } @@ -1974,7 +1974,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) case 29: if (x->class != 8) { OPB_err(110); - } else if (__IN(f, 0x0501) || x->typ->comp == 3) { + } else if (__IN(f, 0x0501, 32) || x->typ->comp == 3) { OPB_err(111); } break; @@ -2070,11 +2070,11 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) } else if (x->typ->size == 1) { L = (int16)x->conval->intval; typ = p->typ; - while ((L > 0 && __IN(typ->comp, 0x0c))) { + while ((L > 0 && __IN(typ->comp, 0x0c, 32))) { typ = typ->BaseTyp; L -= 1; } - if (L != 0 || !__IN(typ->comp, 0x0c)) { + if (L != 0 || !__IN(typ->comp, 0x0c, 32)) { OPB_err(132); } else { x->obj = NIL; @@ -2098,7 +2098,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) case 18: if (OPB_NotVar(x)) { OPB_err(112); - } else if ((__IN(x->typ->comp, 0x0c) && x->typ->BaseTyp->form == 3)) { + } else if ((__IN(x->typ->comp, 0x0c, 32) && x->typ->BaseTyp->form == 3)) { if (x->readonly) { OPB_err(76); } @@ -2172,7 +2172,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) case 24: case 25: case 26: case 27: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x18ff)) { + } else if (__IN(f, 0x18ff, 32)) { if (fctno == 24 || fctno == 26) { if (OPB_NotVar(x)) { OPB_err(112); @@ -2198,7 +2198,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) p->typ = OPT_booltyp; break; case 29: - if (((x->class == 8 || x->class == 9) || __IN(f, 0x0501)) || x->typ->comp == 3) { + if (((x->class == 8 || x->class == 9) || __IN(f, 0x0501, 32)) || x->typ->comp == 3) { OPB_err(126); } if ((x->class != 7 && x->typ->size < p->typ->size)) { @@ -2230,7 +2230,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) OPB_err(126); } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x0810) && x->typ->size == OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x0810, 32) && x->typ->size == OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } @@ -2384,12 +2384,12 @@ static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpa ftyp = ftyp->BaseTyp; atyp = atyp->BaseTyp; if ((fvarpar && ftyp == OPT_bytetyp)) { - if (!__IN(f, 0x0c) || !((__IN(atyp->form, 0x1e) && atyp->size == 1))) { - if (__IN(18, OPM_opt)) { + if (!__IN(f, 0x0c, 32) || !((__IN(atyp->form, 0x1e, 32) && atyp->size == 1))) { + if (__IN(18, OPM_opt, 32)) { OPB_err(-301); } } - } else if (__IN(f, 0x0c)) { + } else if (__IN(f, 0x0c, 32)) { if (ftyp->comp == 3) { OPB_DynArrParCheck(ftyp, atyp, fvarpar); } else if (ftyp != atyp) { @@ -2428,7 +2428,7 @@ static void OPB_CheckReceiver (OPT_Node *x, OPT_Object fp) void OPB_PrepCall (OPT_Node *x, OPT_Object *fpar) { - if (((*x)->obj != NIL && __IN((*x)->obj->mode, 0x22c0))) { + if (((*x)->obj != NIL && __IN((*x)->obj->mode, 0x22c0, 32))) { *fpar = (*x)->obj->link; if ((*x)->obj->mode == 13) { OPB_CheckReceiver(&(*x)->left, *fpar); @@ -2467,7 +2467,7 @@ void OPB_Param (OPT_Node ap, OPT_Object fp) OPB_err(111); } } else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 11)) { - } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x1e) && ap->typ->size == 1)))))) { + } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x1e, 32) && ap->typ->size == 1)))))) { OPB_err(123); } else if ((fp->typ->form == 11 && ap->class == 5)) { OPB_err(123); @@ -2494,7 +2494,7 @@ void OPB_StaticLink (int8 dlev) scope = OPT_topScope; while (dlev > 0) { dlev -= 1; - scope->link->conval->setval |= __SETOF(3); + scope->link->conval->setval |= __SETOF(3,32); scope = scope->left; } } @@ -2589,7 +2589,7 @@ void OPB_Assign (OPT_Node *x, OPT_Node y) y->conval->intval = 0; OPB_Index(&*x, OPB_NewIntConst(0)); } - if ((((((__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp == OPT_chartyp)) && __IN(y->typ->comp, 0x0c))) && y->typ->BaseTyp == OPT_chartyp)) { + if ((((((__IN((*x)->typ->comp, 0x0c, 32) && (*x)->typ->BaseTyp == OPT_chartyp)) && __IN(y->typ->comp, 0x0c, 32))) && y->typ->BaseTyp == OPT_chartyp)) { subcl = 18; } else { subcl = 0; diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index 96866563..f9bf31fe 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 452c85d2..1fecd152 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -93,9 +93,9 @@ static BOOLEAN OPC_Undefined (OPT_Object obj); void OPC_Init (void) { OPC_indentLevel = 0; - OPC_ptrinit = __IN(5, OPM_opt); + OPC_ptrinit = __IN(5, OPM_opt, 32); OPC_mainprog = OPM_mainProg || OPM_mainLinkStat; - OPC_ansi = __IN(6, OPM_opt); + OPC_ansi = __IN(6, OPM_opt, 32); if (OPC_ansi) { __MOVE("__init(void)", OPC_BodyNameExt, 13); } else { @@ -196,7 +196,7 @@ void OPC_Ident (OPT_Object obj) int16 mode, level, h; mode = obj->mode; level = obj->mnolev; - if ((__IN(mode, 0x62) && level > 0) || __IN(mode, 0x14)) { + if ((__IN(mode, 0x62, 32) && level > 0) || __IN(mode, 0x14, 32)) { OPM_WriteStringVar((void*)obj->name, 256); h = OPC_PerfectHash((void*)obj->name, 256); if (OPC_hashtab[__X(h, 105)] >= 0) { @@ -236,7 +236,7 @@ static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause) int16 pointers; *openClause = 0; if (((typ->strobj == NIL || typ->strobj->name[0] == 0x00) && typ->comp != 4)) { - if (__IN(typ->comp, 0x0c)) { + if (__IN(typ->comp, 0x0c, 32)) { OPC_Stars(typ->BaseTyp, &*openClause); *openClause = typ->comp == 2; } else if (typ->form == 12) { @@ -293,7 +293,7 @@ static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef) break; } else if ((form == 11 && typ->BaseTyp->comp != 3)) { openClause = 1; - } else if (form == 12 || __IN(comp, 0x0c)) { + } else if (form == 12 || __IN(comp, 0x0c, 32)) { if (openClause) { OPM_Write(')'); openClause = 0; @@ -708,7 +708,7 @@ static void OPC_DefineType (OPT_Struct str) if (str->BaseTyp->comp != 4) { OPC_DefineType(str->BaseTyp); } - } else if (__IN(str->comp, 0x0c)) { + } else if (__IN(str->comp, 0x0c, 32)) { OPC_DefineType(str->BaseTyp); } else if (str->form == 12) { if (str->BaseTyp != OPT_notyp) { @@ -1019,7 +1019,7 @@ static void OPC_IdentList (OPT_Object obj, int16 vis) base = NIL; first = 1; while ((obj != NIL && obj->mode != 13)) { - if ((__IN(vis, 0x05) || (vis == 1 && obj->vis != 0)) || (vis == 3 && !obj->leaf)) { + if ((__IN(vis, 0x05, 32) || (vis == 1 && obj->vis != 0)) || (vis == 3 && !obj->leaf)) { if (obj->typ != base || (int16)obj->vis != lastvis) { if (!first) { OPC_EndStat(); @@ -1144,7 +1144,7 @@ static void OPC_ProcPredefs (OPT_Object obj, int8 vis) { if (obj != NIL) { OPC_ProcPredefs(obj->left, vis); - if ((((__IN(obj->mode, 0xc0) && obj->vis >= vis)) && (obj->history != 4 || obj->mode == 6))) { + if ((((__IN(obj->mode, 0xc0, 32) && obj->vis >= vis)) && (obj->history != 4 || obj->mode == 6))) { if (vis == 1) { OPM_WriteString((CHAR*)"import ", 8); } else if (obj->vis == 0) { @@ -1238,7 +1238,7 @@ static void OPC_GenHeaderMsg (void) OPM_Write(' '); i = 0; while (i <= 31) { - if (__IN(i, OPM_glbopt)) { + if (__IN(i, OPM_glbopt, 32)) { switch (i) { case 0: OPM_Write('x'); @@ -1600,7 +1600,7 @@ void OPC_EnterProc (OPT_Object proc) } var = proc->link; while (var != NIL) { - if ((((__IN(var->typ->comp, 0x0c) && var->mode == 1)) && var->typ->sysflag == 0)) { + if ((((__IN(var->typ->comp, 0x0c, 32) && var->mode == 1)) && var->typ->sysflag == 0)) { OPC_BegStat(); if (var->typ->comp == 2) { OPM_WriteString((CHAR*)"__DUPARR(", 10); @@ -1648,7 +1648,7 @@ void OPC_EnterProc (OPT_Object proc) OPM_Write('.'); OPC_Ident(var); OPM_WriteString((CHAR*)" = ", 4); - if (__IN(var->typ->comp, 0x0c)) { + if (__IN(var->typ->comp, 0x0c, 32)) { OPM_WriteString((CHAR*)"(void*)", 8); } else if (var->mode != 2) { OPM_Write('&'); @@ -2006,7 +2006,7 @@ void OPC_Constant (OPT_Const con, int16 form) do { i -= 1; hex = __ASHL(hex, 1); - if (__IN(i, s)) { + if (__IN(i, s, 32)) { hex += 1; } } while (!(__MASK(i, -8) == 0)); diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index 81e8362d..b8f44225 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 671a9d8f..6af53f8c 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -288,15 +288,15 @@ void OPM_InitOptions (void) s[0] = 0x00; Platform_GetArg(OPM_S, (void*)s, 256); } - OPM_dontAsm = __IN(13, OPM_opt); - OPM_dontLink = __IN(14, OPM_opt); - OPM_mainProg = __IN(10, OPM_opt); - OPM_mainLinkStat = __IN(15, OPM_opt); - OPM_notColorOutput = __IN(16, OPM_opt); - OPM_forceNewSym = __IN(17, OPM_opt); - OPM_Verbose = __IN(18, OPM_opt); + OPM_dontAsm = __IN(13, OPM_opt, 32); + OPM_dontLink = __IN(14, OPM_opt, 32); + OPM_mainProg = __IN(10, OPM_opt, 32); + OPM_mainLinkStat = __IN(15, OPM_opt, 32); + OPM_notColorOutput = __IN(16, OPM_opt, 32); + OPM_forceNewSym = __IN(17, OPM_opt, 32); + OPM_Verbose = __IN(18, OPM_opt, 32); if (OPM_mainLinkStat) { - OPM_glbopt |= __SETOF(10); + OPM_glbopt |= __SETOF(10,32); } OPM_GetProperties(); } @@ -773,7 +773,7 @@ void OPM_SymWLReal (LONGREAL lr) void OPM_RegisterNewSym (void) { - if (__STRCMP(OPM_modName, "SYSTEM") != 0 || __IN(10, OPM_opt)) { + if (__STRCMP(OPM_modName, "SYSTEM") != 0 || __IN(10, OPM_opt, 32)) { Files_Register(OPM_newSFile); } } @@ -972,10 +972,10 @@ void OPM_CloseFiles (void) } if (OPM_noerr) { if (__STRCMP(OPM_modName, "SYSTEM") == 0) { - if (!__IN(10, OPM_opt)) { + if (!__IN(10, OPM_opt, 32)) { Files_Register(OPM_BFile); } - } else if (!__IN(10, OPM_opt)) { + } else if (!__IN(10, OPM_opt, 32)) { OPM_Append(&OPM_R[2], Files_Rider__typ, OPM_HFile); Files_Register(OPM_HIFile); Files_Register(OPM_BFile); diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index 0d9bcdeb..67edafa5 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index de0afa51..d8dee08e 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -94,7 +94,7 @@ static void OPP_qualident (OPT_Object *id) obj->adr = 0; } else { lev = obj->mnolev; - if ((__IN(obj->mode, 0x06) && lev != OPP_level)) { + if ((__IN(obj->mode, 0x06, 32) && lev != OPP_level)) { obj->leaf = 0; if (lev > 0) { OPB_StaticLink(OPP_level - lev); @@ -325,7 +325,7 @@ static void OPP_PointerType (OPT_Struct *typ) } else { OPP_qualident(&id); if (id->mode == 5) { - if (__IN(id->typ->comp, 0x1c)) { + if (__IN(id->typ->comp, 0x1c, 32)) { (*typ)->BaseTyp = id->typ; } else { (*typ)->BaseTyp = OPT_undftyp; @@ -338,7 +338,7 @@ static void OPP_PointerType (OPT_Struct *typ) } } else { OPP_Type(&(*typ)->BaseTyp, &OPT_notyp); - if (!__IN((*typ)->BaseTyp->comp, 0x1c)) { + if (!__IN((*typ)->BaseTyp->comp, 0x1c, 32)) { (*typ)->BaseTyp = OPT_undftyp; OPP_err(57); } @@ -966,7 +966,7 @@ static void GetCode__19 (void) } } } - (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1); + (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1,32); } static void GetParams__21 (void) @@ -998,7 +998,7 @@ static void Body__17 (void) OPT_Node procdec = NIL, statseq = NIL; int32 c; c = OPM_errpos; - (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1); + (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1,32); OPP_CheckSym(39); OPP_Block(&procdec, &statseq); OPB_Enter(&procdec, statseq, *ProcedureDeclaration__16_s->proc); @@ -1041,7 +1041,7 @@ static void TProcDecl__23 (void) if ((*ProcedureDeclaration__16_s->fwd != NIL && (*ProcedureDeclaration__16_s->fwd)->mnolev != OPP_level)) { *ProcedureDeclaration__16_s->fwd = NIL; } - if ((((*ProcedureDeclaration__16_s->fwd != NIL && (*ProcedureDeclaration__16_s->fwd)->mode == 13)) && !__IN(1, (*ProcedureDeclaration__16_s->fwd)->conval->setval))) { + if ((((*ProcedureDeclaration__16_s->fwd != NIL && (*ProcedureDeclaration__16_s->fwd)->mode == 13)) && !__IN(1, (*ProcedureDeclaration__16_s->fwd)->conval->setval, 32))) { *ProcedureDeclaration__16_s->proc = OPT_NewObj(); (*ProcedureDeclaration__16_s->proc)->leaf = 1; if ((*ProcedureDeclaration__16_s->fwd)->vis != *ProcedureDeclaration__16_s->vis) { @@ -1075,7 +1075,7 @@ static void TProcDecl__23 (void) if ((((((baseProc->vis == 1 && (*ProcedureDeclaration__16_s->proc)->vis == 0)) && recTyp->strobj != NIL)) && recTyp->strobj->vis == 1)) { OPP_err(109); } - (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(2); + (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(2,32); } if (!*ProcedureDeclaration__16_s->forward) { Body__17(); @@ -1118,7 +1118,7 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) } else { OPP_err(38); } - if ((__IN(mode, 0x0600) && !OPT_SYSimported)) { + if ((__IN(mode, 0x0600, 32) && !OPT_SYSimported)) { OPP_err(135); } OPS_Get(&OPP_sym); @@ -1135,7 +1135,7 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) if ((fwd != NIL && (fwd->mnolev != OPP_level || fwd->mode == 8))) { fwd = NIL; } - if ((((fwd != NIL && __IN(fwd->mode, 0xc0))) && !__IN(1, fwd->conval->setval))) { + if ((((fwd != NIL && __IN(fwd->mode, 0xc0, 32))) && !__IN(1, fwd->conval->setval, 32))) { proc = OPT_NewObj(); proc->leaf = 1; if (fwd->vis != vis) { @@ -1178,7 +1178,7 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int16 *n, OPP for (;;) { OPP_ConstExpression(&x); f = x->typ->form; - if (__IN(f, 0x18)) { + if (__IN(f, 0x18, 32)) { xval = x->conval->intval; } else { OPP_err(61); @@ -1258,7 +1258,7 @@ static void CasePart__31 (OPT_Node *x) *StatSeq__30_s->pos = OPM_errpos; if ((*x)->class == 8 || (*x)->class == 9) { OPP_err(126); - } else if (!__IN((*x)->typ->form, 0x18)) { + } else if (!__IN((*x)->typ->form, 0x18, 32)) { OPP_err(125); } OPP_CheckSym(25); @@ -1675,7 +1675,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) if (obj->typ->strobj == NIL) { obj->typ->strobj = obj; } - if (__IN(obj->typ->comp, 0x1c)) { + if (__IN(obj->typ->comp, 0x1c, 32)) { i = 0; while (i < OPP_nofFwdPtr) { typ = OPP_FwdPtr[__X(i, 64)]; diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index 2d3ebd77..9ddded2f 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index e6e99c02..cd51e788 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index 99448598..658c87db 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 4a645e7a..ab44584b 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -274,9 +274,9 @@ void OPT_Init (OPS_Name name, SET opt) __COPY(name, OPT_topScope->name, 256); OPT_GlbMod[0] = OPT_topScope; OPT_nofGmod = 1; - OPT_newsf = __IN(4, opt); - OPT_findpc = __IN(8, opt); - OPT_extsf = OPT_newsf || __IN(9, opt); + OPT_newsf = __IN(4, opt, 32); + OPT_findpc = __IN(8, opt, 32); + OPT_extsf = OPT_newsf || __IN(9, opt, 32); OPT_sfpresent = 1; } @@ -609,7 +609,7 @@ void OPT_FPrintStr (OPT_Struct typ) pvfp = pbfp; } } else if (f == 12) { - } else if (__IN(c, 0x0c)) { + } else if (__IN(c, 0x0c, 32)) { OPT_FPrintStr(btyp); OPM_FPrint(&pbfp, btyp->pvfp); pvfp = pbfp; @@ -680,7 +680,7 @@ void OPT_FPrintObj (OPT_Object obj) OPM_FPrint(&fprint, obj->vis); OPT_FPrintStr(obj->typ); OPM_FPrint(&fprint, obj->typ->pbfp); - } else if (__IN(obj->mode, 0x0480)) { + } else if (__IN(obj->mode, 0x0480, 32)) { OPT_FPrintSign(&fprint, obj->typ, obj->link); } else if (obj->mode == 9) { OPT_FPrintSign(&fprint, obj->typ, obj->link); @@ -1573,7 +1573,7 @@ static void OPT_OutObj (OPT_Object obj) OPT_ConstExt ext = NIL; if (obj != NIL) { OPT_OutObj(obj->left); - if (__IN(obj->mode, 0x06ea)) { + if (__IN(obj->mode, 0x06ea, 32)) { if (obj->history == 4) { OPT_FPrintErr(obj, 250); } else if (obj->vis != 0) { diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index 93975ea1..978ae16b 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index b264d44e..c20aef90 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -130,10 +130,10 @@ void OPV_Init (void) OPV_stamp = 0; OPV_recno = 0; OPV_nofExitLabels = 0; - OPV_assert = __IN(7, OPM_opt); - OPV_inxchk = __IN(0, OPM_opt); - OPV_mainprog = __IN(10, OPM_opt); - OPV_ansi = __IN(6, OPM_opt); + OPV_assert = __IN(7, OPM_opt, 32); + OPV_inxchk = __IN(0, OPM_opt, 32); + OPV_mainprog = __IN(10, OPM_opt, 32); + OPV_ansi = __IN(6, OPM_opt, 32); } static void OPV_GetTProcNum (OPT_Object obj) @@ -150,7 +150,7 @@ static void OPV_GetTProcNum (OPT_Object obj) OPT_FindField(obj->name, typ->BaseTyp, &redef); if (redef != NIL) { obj->adr = __ASHL(__ASHR(redef->adr, 16), 16); - if (!__IN(2, obj->conval->setval)) { + if (!__IN(2, obj->conval->setval, 32)) { OPM_err(119); } } else { @@ -230,12 +230,12 @@ static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exporte OPV_TypSize(obj->typ); } if (!exported) { - if ((__IN(mode, 0x60) && obj->mnolev > 0)) { + if ((__IN(mode, 0x60, 32) && obj->mnolev > 0)) { OPV_Stamp(obj->name); } - if (__IN(mode, 0x26)) { + if (__IN(mode, 0x26, 32)) { obj->scope = outerScope; - } else if (__IN(mode, 0x26c0)) { + } else if (__IN(mode, 0x26c0, 32)) { if (obj->conval->setval == 0x0) { OPM_err(129); } @@ -289,7 +289,7 @@ static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp return _o_result; break; case 5: - if (__IN(3, OPM_opt)) { + if (__IN(3, OPM_opt, 32)) { _o_result = 10; return _o_result; } else { @@ -298,7 +298,7 @@ static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp } break; case 1: - if (__IN(comp, 0x0c)) { + if (__IN(comp, 0x0c, 32)) { _o_result = 10; return _o_result; } else { @@ -445,7 +445,7 @@ static BOOLEAN OPV_SideEffects (OPT_Node n) static void OPV_Entier (OPT_Node n, int16 prec) { - if (__IN(n->typ->form, 0x60)) { + if (__IN(n->typ->form, 0x60, 32)) { OPM_WriteString((CHAR*)"__ENTIER(", 10); OPV_expr(n, -1); OPM_Write(')'); @@ -471,9 +471,11 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int16 prec) if (to == 7) { OPM_WriteString((CHAR*)"__SETOF(", 9); OPV_Entier(n, -1); + OPM_WriteString((CHAR*)",", 2); + OPM_WriteInt(__ASHL(newtype->size, 3)); OPM_Write(')'); } else if (to == 4) { - if ((newtype->size < n->typ->size && __IN(2, OPM_opt))) { + if ((newtype->size < n->typ->size && __IN(2, OPM_opt, 32))) { OPM_WriteString((CHAR*)"__SHORT", 8); if (OPV_SideEffects(n)) { OPM_Write('F'); @@ -488,7 +490,7 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int16 prec) OPV_Entier(n, 9); } } else if (to == 3) { - if (__IN(2, OPM_opt)) { + if (__IN(2, OPM_opt, 32)) { OPM_WriteString((CHAR*)"__CHR", 6); if (OPV_SideEffects(n)) { OPM_Write('F'); @@ -511,7 +513,7 @@ static void OPV_TypeOf (OPT_Node n) OPM_WriteString((CHAR*)"__TYPEOF(", 10); OPV_expr(n, -1); OPM_Write(')'); - } else if (__IN(n->class, 0x15)) { + } else if (__IN(n->class, 0x15, 32)) { OPC_Andent(n->typ); OPM_WriteString((CHAR*)"__typ", 6); } else if (n->class == 3) { @@ -572,7 +574,7 @@ static void OPV_design (OPT_Node n, int16 prec) OPC_CompleteIdent(n->obj); break; case 1: - if (!__IN(comp, 0x0c)) { + if (!__IN(comp, 0x0c, 32)) { OPM_Write('*'); } OPC_CompleteIdent(n->obj); @@ -651,7 +653,7 @@ static void OPV_design (OPT_Node n, int16 prec) case 5: typ = n->typ; obj = n->left->obj; - if (__IN(3, OPM_opt)) { + if (__IN(3, OPM_opt, 32)) { if (typ->comp == 4) { OPM_WriteString((CHAR*)"__GUARDR(", 10); if ((int16)obj->mnolev != OPM_level) { @@ -690,7 +692,7 @@ static void OPV_design (OPT_Node n, int16 prec) } break; case 6: - if (__IN(3, OPM_opt)) { + if (__IN(3, OPM_opt, 32)) { if (n->left->class == 1) { OPM_WriteString((CHAR*)"__GUARDEQR(", 12); OPC_CompleteIdent(n->left->obj); @@ -749,7 +751,7 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) OPM_WriteString((CHAR*)"*)", 3); prec = 10; } - if (!__IN(n->typ->comp, 0x0c)) { + if (!__IN(n->typ->comp, 0x0c, 32)) { if (mode == 2) { if ((OPV_ansi && typ != n->typ)) { OPM_WriteString((CHAR*)"(void*)", 8); @@ -757,13 +759,13 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) OPM_Write('&'); prec = 9; } else if (OPV_ansi) { - if ((__IN(comp, 0x0c) && n->class == 7)) { + if ((__IN(comp, 0x0c, 32) && n->class == 7)) { OPM_WriteString((CHAR*)"(CHAR*)", 8); } else if ((((form == 11 && typ != n->typ)) && n->typ != OPT_niltyp)) { OPM_WriteString((CHAR*)"(void*)", 8); } } else { - if ((__IN(form, 0x60) && n->typ->form == 4)) { + if ((__IN(form, 0x60, 32) && n->typ->form == 4)) { OPM_WriteString((CHAR*)"(double)", 9); prec = 9; } else if (form == 4) { @@ -846,7 +848,7 @@ static void OPV_expr (OPT_Node n, int16 prec) l = n->left; r = n->right; exprPrec = OPV_Precedence(class, subclass, form, n->typ->comp); - if ((exprPrec <= prec && __IN(class, 0x3ce0))) { + if ((exprPrec <= prec && __IN(class, 0x3ce0, 32))) { OPM_Write('('); } switch (class) { @@ -858,6 +860,8 @@ static void OPV_expr (OPT_Node n, int16 prec) OPV_expr(l, -1); OPM_WriteString((CHAR*)", ", 3); OPV_expr(r, -1); + OPM_WriteString((CHAR*)", ", 3); + OPM_WriteInt(__ASHL(n->typ->size, 3)); OPM_Write(')'); break; case 11: @@ -924,18 +928,18 @@ static void OPV_expr (OPT_Node n, int16 prec) if (l->class == 1) { OPC_CompleteIdent(l->obj); } else { - if ((l->typ->form != 8 && !__IN(l->typ->comp, 0x0c))) { + if ((l->typ->form != 8 && !__IN(l->typ->comp, 0x0c, 32))) { OPM_Write('&'); } OPV_expr(l, exprPrec); } break; case 29: - if (!__IN(l->class, 0x17) || (((__IN(n->typ->form, 0x1890) && __IN(l->typ->form, 0x1890))) && n->typ->size == l->typ->size)) { + if (!__IN(l->class, 0x17, 32) || (((__IN(n->typ->form, 0x1890, 32) && __IN(l->typ->form, 0x1890, 32))) && n->typ->size == l->typ->size)) { OPM_Write('('); OPC_Ident(n->typ->strobj); OPM_Write(')'); - if (__IN(n->typ->form, 0x1800) || __IN(l->typ->form, 0x1800)) { + if (__IN(n->typ->form, 0x1800, 32) || __IN(l->typ->form, 0x1800, 32)) { OPM_WriteString((CHAR*)"(address)", 10); } OPV_expr(l, exprPrec); @@ -1032,20 +1036,24 @@ static void OPV_expr (OPT_Node n, int16 prec) } OPV_expr(l, -1); OPM_WriteString((CHAR*)", ", 3); - if ((((__IN(subclass, 0x18020000) && r->class == 7)) && r->conval->intval < 0)) { + if ((((__IN(subclass, 0x18020000, 32) && r->class == 7)) && r->conval->intval < 0)) { OPM_WriteInt(-r->conval->intval); } else { OPV_expr(r, -1); } - if (__IN(subclass, 0x18000000)) { + if (__IN(subclass, 0x18008000, 32)) { OPM_WriteString((CHAR*)", ", 3); - OPM_WriteInt(__ASHL(l->typ->size, 3)); + if (subclass == 15) { + OPM_WriteInt(__ASHL(r->typ->size, 3)); + } else { + OPM_WriteInt(__ASHL(l->typ->size, 3)); + } } OPM_Write(')'); break; case 9: case 10: case 11: case 12: case 13: case 14: - if (__IN(l->typ->form, 0x2100)) { + if (__IN(l->typ->form, 0x2100, 32)) { OPM_WriteString((CHAR*)"__STRCMP(", 10); OPV_expr(l, -1); OPM_WriteString((CHAR*)", ", 3); @@ -1142,7 +1150,7 @@ static void OPV_expr (OPT_Node n, int16 prec) OPV_design(n, prec); break; } - if ((exprPrec <= prec && __IN(class, 0x3ca0))) { + if ((exprPrec <= prec && __IN(class, 0x3ca0, 32))) { OPM_Write(')'); } } @@ -1432,7 +1440,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPM_WriteString((CHAR*)", ", 3); OPC_Andent(n->left->typ->BaseTyp); OPM_WriteString((CHAR*)")", 2); - } else if (__IN(n->left->typ->BaseTyp->comp, 0x0c)) { + } else if (__IN(n->left->typ->BaseTyp->comp, 0x0c, 32)) { OPV_NewArr(n->left, n->right); } break; @@ -1446,6 +1454,8 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPC_SetInclude(n->subcl == 16); OPM_WriteString((CHAR*)"__SETOF(", 9); OPV_expr(n->right, -1); + OPM_WriteString((CHAR*)",", 2); + OPM_WriteInt(__ASHL(n->left->typ->size, 3)); OPM_Write(')'); break; case 18: @@ -1623,7 +1633,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPM_LogWLn(); break; } - if (!__IN(n->class, 0x09744000)) { + if (!__IN(n->class, 0x09744000, 32)) { OPC_EndStat(); } n = n->link; diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index 3b43e61e..ea1f9aaa 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 4842a8c4..1bf0628e 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index 295013cf..7c0b2d21 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index e209af08..a64c2d13 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index 2779fc88..d7981245 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index 387345ab..67c0f055 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index fe90bd09..6f4f1073 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index c37a4a2c..4d12f6cb 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -578,13 +578,13 @@ void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, SET sel, Texts_Fonts T->cache = c; T->corg = co; while (un != vn) { - if ((__IN(0, sel) && fnt != NIL)) { + if ((__IN(0, sel, 32) && fnt != NIL)) { un->fnt = fnt; } - if (__IN(1, sel)) { + if (__IN(1, sel, 32)) { un->col = col; } - if (__IN(2, sel)) { + if (__IN(2, sel, 32)) { un->voff = voff; } Texts_Merge(T, u, &un); diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index c6ee484f..2b694f6c 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/Vishap.c b/bootstrap/unix-48/Vishap.c index fb1c1662..2efce68f 100644 --- a/bootstrap/unix-48/Vishap.c +++ b/bootstrap/unix-48/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkamSf */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/errors.c b/bootstrap/unix-48/errors.c index 7feed8e7..6f8e3d33 100644 --- a/bootstrap/unix-48/errors.c +++ b/bootstrap/unix-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/errors.h b/bootstrap/unix-48/errors.h index 4fe434e1..58286fd8 100644 --- a/bootstrap/unix-48/errors.h +++ b/bootstrap/unix-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index 0afff1f0..bbecb9f2 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index 5d996dae..8a0d60be 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/vt100.c b/bootstrap/unix-48/vt100.c index 8a5286ec..b5422c40 100644 --- a/bootstrap/unix-48/vt100.c +++ b/bootstrap/unix-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/vt100.h b/bootstrap/unix-48/vt100.h index c09b4c71..85494a63 100644 --- a/bootstrap/unix-48/vt100.h +++ b/bootstrap/unix-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index b023c21b..f3f2e52d 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/12] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/14] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index 3ce4467e..2b7bdf82 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Console.c b/bootstrap/unix-88/Console.c index 3677dd09..5039dae6 100644 --- a/bootstrap/unix-88/Console.c +++ b/bootstrap/unix-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Console.h b/bootstrap/unix-88/Console.h index 27d906ad..8336a3d0 100644 --- a/bootstrap/unix-88/Console.h +++ b/bootstrap/unix-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index acdf5f8a..1f4e38bf 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 7fb2cb03..b1a16504 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index 67044d79..626812cb 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tskSfF */ #define INTEGER int32 #define LONGINT int64 @@ -82,6 +82,7 @@ export LONGINT *Heap__1__typ; static void Heap_CheckFin (void); static void Heap_ExtendHeap (address blksz); export void Heap_FINALL (void); +static address Heap_FetchAddress (address pointer); static void Heap_Finalize (void); export void Heap_GC (BOOLEAN markStack); static void Heap_HeapSort (address n, address *a, LONGINT a__len); @@ -106,7 +107,6 @@ export void Heap_Unlock (void); extern void *Heap__init(); extern address Platform_MainStackFrame; extern address Platform_OSAllocate(address size); -#define Heap_FetchAddress(pointer) (address)(*((void**)((address)pointer))) #define Heap_HeapModuleInit() Heap__init() #define Heap_OSAllocate(size) Platform_OSAllocate(size) #define Heap_PlatformHalt(code) Platform_Halt(code) @@ -188,6 +188,15 @@ static address Heap_NewChunk (address blksz) return _o_result; } +static address Heap_FetchAddress (address pointer) +{ + address _o_result; + address r; + __GET(pointer, r, address); + _o_result = r; + return _o_result; +} + static void Heap_ExtendHeap (address blksz) { address size, chnk, j, next; diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index 584661bc..08afe43e 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 547909bb..3a48e24a 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index 2666971d..3ebde4f3 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index f048dc85..883d2559 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -345,7 +345,7 @@ void OPB_Index (OPT_Node *x, OPT_Node y) f = y->typ->form; if ((*x)->class >= 7) { OPB_err(79); - } else if (f != 4 || __IN(y->class, 0x0300)) { + } else if (f != 4 || __IN(y->class, 0x0300, 64)) { OPB_err(80); y->typ = OPT_inttyp; } @@ -372,7 +372,7 @@ void OPB_Field (OPT_Node *x, OPT_Object y) if ((*x)->class >= 7) { OPB_err(77); } - if ((y != NIL && __IN(y->mode, 0x2010))) { + if ((y != NIL && __IN(y->mode, 0x2010, 64))) { OPB_BindNodes(2, y->typ, &*x, NIL); (*x)->obj = y; (*x)->readonly = (*x)->left->readonly || (y->vis == 2 && y->mnolev < 0); @@ -476,7 +476,7 @@ void OPB_In (OPT_Node *x, OPT_Node y) if (k < 0 || k > (int64)OPM_MaxSet) { OPB_err(202); } else if (y->class == 7) { - (*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval)); + (*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval, 64)); (*x)->obj = NIL; } else { OPB_BindNodes(12, OPT_booltyp, &*x, y); @@ -572,12 +572,12 @@ void OPB_MOp (int8 op, OPT_Node *x) } break; case 6: - if (!__IN(f, 0x70)) { + if (!__IN(f, 0x70, 64)) { OPB_err(96); } break; case 7: - if (__IN(f, 0xf0)) { + if (__IN(f, 0xf0, 64)) { if (z->class == 7) { if (f == 4) { if (z->conval->intval == (-9223372036854775807-1)) { @@ -586,7 +586,7 @@ void OPB_MOp (int8 op, OPT_Node *x) z->conval->intval = -z->conval->intval; OPB_SetIntType(z); } - } else if (__IN(f, 0x60)) { + } else if (__IN(f, 0x60, 64)) { z->conval->realval = -z->conval->realval; } else { z->conval->setval = ~z->conval->setval; @@ -600,7 +600,7 @@ void OPB_MOp (int8 op, OPT_Node *x) } break; case 21: - if (__IN(f, 0x70)) { + if (__IN(f, 0x70, 64)) { if (z->class == 7) { if (f == 4) { if (z->conval->intval == (-9223372036854775807-1)) { @@ -747,7 +747,7 @@ void OPB_CheckParameters (OPT_Object fp, OPT_Object ap, BOOLEAN checkNames) static void OPB_CheckProc (OPT_Struct x, OPT_Object y) { - if (__IN(y->mode, 0x04c0)) { + if (__IN(y->mode, 0x04c0, 64)) { if (y->mode == 6) { if (y->mnolev == 0) { y->mode = 7; @@ -923,7 +923,7 @@ static void OPB_ConstOp (int32 op, OPT_Node x, OPT_Node y) } break; case 9: - if (!__IN(g, 0x1800)) { + if (!__IN(g, 0x1800, 64)) { OPB_err(100); } break; @@ -954,7 +954,7 @@ static void OPB_ConstOp (int32 op, OPT_Node x, OPT_Node y) } else { OPB_err(204); } - } else if (__IN(f, 0x60)) { + } else if (__IN(f, 0x60, 64)) { temp = __ABS(yval->realval) <= (LONGREAL)1; if (temp || __ABS(xval->realval) <= 1.79769296342094e+308 / (LONGREAL)__ABS(yval->realval)) { xval->realval = xval->realval * yval->realval; @@ -978,7 +978,7 @@ static void OPB_ConstOp (int32 op, OPT_Node x, OPT_Node y) xval->realval = (LONGREAL)1; } x->typ = OPT_realtyp; - } else if (__IN(f, 0x60)) { + } else if (__IN(f, 0x60, 64)) { temp = __ABS(yval->realval) >= (LONGREAL)1; if (temp || __ABS(xval->realval) <= 1.79769296342094e+308 * __ABS(yval->realval)) { xval->realval = xval->realval / yval->realval; @@ -1032,7 +1032,7 @@ static void OPB_ConstOp (int32 op, OPT_Node x, OPT_Node y) } else { OPB_err(206); } - } else if (__IN(f, 0x60)) { + } else if (__IN(f, 0x60, 64)) { temp = (yval->realval >= (LONGREAL)0 && xval->realval <= 1.79769296342094e+308 - yval->realval); if (temp || (yval->realval < (LONGREAL)0 && xval->realval >= -1.79769296342094e+308 - yval->realval)) { xval->realval = xval->realval + yval->realval; @@ -1054,7 +1054,7 @@ static void OPB_ConstOp (int32 op, OPT_Node x, OPT_Node y) } else { OPB_err(207); } - } else if (__IN(f, 0x60)) { + } else if (__IN(f, 0x60, 64)) { temp = (yval->realval >= (LONGREAL)0 && xval->realval >= -1.79769296342094e+308 + yval->realval); if (temp || (yval->realval < (LONGREAL)0 && xval->realval <= 1.79769296342094e+308 + yval->realval)) { xval->realval = xval->realval - yval->realval; @@ -1082,28 +1082,28 @@ static void OPB_ConstOp (int32 op, OPT_Node x, OPT_Node y) xval->intval = OPB_BoolToInt(ConstCmp__14() != 9); break; case 11: - if (__IN(f, 0x0a84)) { + if (__IN(f, 0x0a84, 64)) { OPB_err(108); } else { xval->intval = OPB_BoolToInt(ConstCmp__14() == 11); } break; case 12: - if (__IN(f, 0x0a84)) { + if (__IN(f, 0x0a84, 64)) { OPB_err(108); } else { xval->intval = OPB_BoolToInt(ConstCmp__14() != 13); } break; case 13: - if (__IN(f, 0x0a84)) { + if (__IN(f, 0x0a84, 64)) { OPB_err(108); } else { xval->intval = OPB_BoolToInt(ConstCmp__14() == 13); } break; case 14: - if (__IN(f, 0x0a84)) { + if (__IN(f, 0x0a84, 64)) { OPB_err(108); } else { xval->intval = OPB_BoolToInt(ConstCmp__14() != 11); @@ -1136,7 +1136,7 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) (*x)->conval->intval = 1; } } - } else if (__IN(g, 0x60)) { + } else if (__IN(g, 0x60, 64)) { (*x)->conval->realval = (*x)->conval->intval; (*x)->conval->intval = -1; } else { @@ -1145,8 +1145,8 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) OPB_err(220); } } - } else if (__IN(f, 0x60)) { - if (__IN(g, 0x60)) { + } else if (__IN(f, 0x60, 64)) { + if (__IN(g, 0x60, 64)) { OPB_CheckRealType(g, 203, (*x)->conval); } else { r = (*x)->conval->realval; @@ -1195,8 +1195,8 @@ static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) { BOOLEAN _o_result; BOOLEAN ok, xCharArr, yCharArr; - xCharArr = (__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp->form == 3) || *Op__38_s->f == 8; - yCharArr = (__IN((*y)->typ->comp, 0x0c) && (*y)->typ->BaseTyp->form == 3) || *Op__38_s->g == 8; + xCharArr = (__IN((*x)->typ->comp, 0x0c, 64) && (*x)->typ->BaseTyp->form == 3) || *Op__38_s->f == 8; + yCharArr = (__IN((*y)->typ->comp, 0x0c, 64) && (*y)->typ->BaseTyp->form == 3) || *Op__38_s->g == 8; if ((((xCharArr && *Op__38_s->g == 3)) && (*y)->class == 7)) { OPB_CharToString(*y); *Op__38_s->g = 8; @@ -1255,7 +1255,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) case 4: if ((g == 4 && y->typ->size < z->typ->size)) { OPB_Convert(&y, z->typ); - } else if (__IN(g, 0x70)) { + } else if (__IN(g, 0x70, 64)) { OPB_Convert(&z, y->typ); } else { OPB_err(100); @@ -1264,23 +1264,23 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) case 5: if (g == 4) { OPB_Convert(&y, z->typ); - } else if (__IN(g, 0x60)) { + } else if (__IN(g, 0x60, 64)) { OPB_Convert(&z, y->typ); } else { OPB_err(100); } break; case 6: - if (__IN(g, 0x70)) { + if (__IN(g, 0x70, 64)) { OPB_Convert(&y, z->typ); - } else if (__IN(g, 0x60)) { + } else if (__IN(g, 0x60, 64)) { OPB_Convert(&y, z->typ); } else { OPB_err(100); } break; case 9: - if (!__IN(g, 0x1800)) { + if (!__IN(g, 0x1800, 64)) { OPB_err(100); } break; @@ -1341,7 +1341,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) y->obj = NIL; } } - } else if (!__IN(f, 0xe1)) { + } else if (!__IN(f, 0xe1, 64)) { OPB_err(105); typ = OPT_undftyp; } @@ -1357,7 +1357,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) OPB_Convert(&z, OPT_realtyp); OPB_Convert(&y, OPT_realtyp); typ = OPT_realtyp; - } else if (__IN(f, 0x60)) { + } else if (__IN(f, 0x60, 64)) { if ((y->class == 7 && y->conval->realval == (LONGREAL)0)) { OPB_err(205); } @@ -1424,7 +1424,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) } break; case 6: - if (!__IN(f, 0xf1)) { + if (!__IN(f, 0xf1, 64)) { OPB_err(105); typ = OPT_undftyp; } @@ -1443,7 +1443,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) } break; case 7: - if (!__IN(f, 0xf1)) { + if (!__IN(f, 0xf1, 64)) { OPB_err(106); typ = OPT_undftyp; } @@ -1467,7 +1467,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) } break; case 9: case 10: - if (__IN(f, 0x1aff) || strings__41(&z, &y)) { + if (__IN(f, 0x1aff, 64) || strings__41(&z, &y)) { typ = OPT_booltyp; } else { OPB_err(107); @@ -1476,7 +1476,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) NewOp__39(op, typ, &z, y); break; case 11: case 12: case 13: case 14: - if (__IN(f, 0x79) || strings__41(&z, &y)) { + if (__IN(f, 0x79, 64) || strings__41(&z, &y)) { typ = OPT_booltyp; } else { OPM_LogWLn(); @@ -1518,10 +1518,10 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y) } if (((*x)->class == 7 && y->class == 7)) { if (k <= l) { - (*x)->conval->setval = __SETRNG(k, l); + (*x)->conval->setval = __SETRNG(k, l, 64); } else { OPB_err(201); - (*x)->conval->setval = __SETRNG(l, k); + (*x)->conval->setval = __SETRNG(l, k, 64); } (*x)->obj = NIL; } else { @@ -1543,7 +1543,7 @@ void OPB_SetElem (OPT_Node *x) } else if ((*x)->class == 7) { k = (*x)->conval->intval; if ((0 <= k && k <= (int64)OPM_MaxSet)) { - (*x)->conval->setval = __SETOF(k); + (*x)->conval->setval = __SETOF(k,64); } else { OPB_err(202); } @@ -1588,7 +1588,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) case 0: case 8: break; case 1: - if (!((__IN(g, 0x1a) && y->size == 1))) { + if (!((__IN(g, 0x1a, 64) && y->size == 1))) { OPB_err(113); } break; @@ -1603,12 +1603,12 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) } break; case 5: - if (!__IN(g, 0x30)) { + if (!__IN(g, 0x30, 64)) { OPB_err(113); } break; case 6: - if (!__IN(g, 0x70)) { + if (!__IN(g, 0x70, 64)) { OPB_err(113); } break; @@ -1656,7 +1656,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) if (ynode->conval->intval2 > x->n) { OPB_err(114); } - } else if ((__IN(y->comp, 0x0c) && y->BaseTyp == OPT_chartyp)) { + } else if ((__IN(y->comp, 0x0c, 64) && y->BaseTyp == OPT_chartyp)) { } else { OPB_err(113); } @@ -1664,7 +1664,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPB_err(113); } } else if ((x->comp == 3 && x->BaseTyp == OPT_chartyp)) { - if ((__IN(y->comp, 0x0c) && y->BaseTyp == OPT_chartyp)) { + if ((__IN(y->comp, 0x0c, 64) && y->BaseTyp == OPT_chartyp)) { } else { OPB_err(113); } @@ -1691,7 +1691,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPM_LogWLn(); break; } - if ((((((ynode->class == 7 && g < f)) && __IN(g, 0x30))) && __IN(f, 0x70))) { + if ((((((ynode->class == 7 && g < f)) && __IN(g, 0x30, 64))) && __IN(f, 0x70, 64))) { OPB_Convert(&ynode, x); } } @@ -1729,7 +1729,7 @@ void OPB_StPar0 (OPT_Node *par0, int32 fctno) OPB_err(76); } f = x->typ->BaseTyp->comp; - if (__IN(f, 0x1c)) { + if (__IN(f, 0x1c, 64)) { if (f == 3) { typ = x->typ->BaseTyp; } @@ -1762,7 +1762,7 @@ void OPB_StPar0 (OPT_Node *par0, int32 fctno) case 5: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x60)) { + } else if (__IN(f, 0x60, 64)) { OPB_Convert(&x, OPT_linttyp); } else { OPB_err(111); @@ -1837,7 +1837,7 @@ void OPB_StPar0 (OPT_Node *par0, int32 fctno) case 9: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x11)) { + } else if (__IN(f, 0x11, 64)) { OPB_Convert(&x, OPT_chartyp); } else { OPB_err(111); @@ -1898,7 +1898,7 @@ void OPB_StPar0 (OPT_Node *par0, int32 fctno) } break; case 17: - if (!__IN(x->typ->comp, 0x0c)) { + if (!__IN(x->typ->comp, 0x0c, 64)) { OPB_err(131); } break; @@ -1909,7 +1909,7 @@ void OPB_StPar0 (OPT_Node *par0, int32 fctno) } if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (((!__IN(x->typ->comp, 0x0c) || x->typ->BaseTyp->form != 3) && f != 8)) { + } else if (((!__IN(x->typ->comp, 0x0c, 64) || x->typ->BaseTyp->form != 3) && f != 8)) { OPB_err(111); } break; @@ -1933,7 +1933,7 @@ void OPB_StPar0 (OPT_Node *par0, int32 fctno) if (x->class != 8) { OPB_err(110); x = OPB_NewIntConst(1); - } else if (__IN(f, 0x18fe) || __IN(x->typ->comp, 0x14)) { + } else if (__IN(f, 0x18fe, 64) || __IN(x->typ->comp, 0x14, 64)) { (*OPB_typSize)(x->typ); x->typ->pvused = 1; x = OPB_NewIntConst(x->typ->size); @@ -1948,7 +1948,7 @@ void OPB_StPar0 (OPT_Node *par0, int32 fctno) case 22: case 23: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (!__IN(f, 0x9a)) { + } else if (!__IN(f, 0x9a, 64)) { OPB_err(111); } break; @@ -1957,7 +1957,7 @@ void OPB_StPar0 (OPT_Node *par0, int32 fctno) OPB_err(126); } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x0810) && x->typ->size == (int64)OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x0810, 64) && x->typ->size == (int64)OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } @@ -1974,7 +1974,7 @@ void OPB_StPar0 (OPT_Node *par0, int32 fctno) case 29: if (x->class != 8) { OPB_err(110); - } else if (__IN(f, 0x0501) || x->typ->comp == 3) { + } else if (__IN(f, 0x0501, 64) || x->typ->comp == 3) { OPB_err(111); } break; @@ -2070,11 +2070,11 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) } else if (x->typ->size == 1) { L = (int32)x->conval->intval; typ = p->typ; - while ((L > 0 && __IN(typ->comp, 0x0c))) { + while ((L > 0 && __IN(typ->comp, 0x0c, 64))) { typ = typ->BaseTyp; L -= 1; } - if (L != 0 || !__IN(typ->comp, 0x0c)) { + if (L != 0 || !__IN(typ->comp, 0x0c, 64)) { OPB_err(132); } else { x->obj = NIL; @@ -2098,7 +2098,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) case 18: if (OPB_NotVar(x)) { OPB_err(112); - } else if ((__IN(x->typ->comp, 0x0c) && x->typ->BaseTyp->form == 3)) { + } else if ((__IN(x->typ->comp, 0x0c, 64) && x->typ->BaseTyp->form == 3)) { if (x->readonly) { OPB_err(76); } @@ -2172,7 +2172,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) case 24: case 25: case 26: case 27: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x18ff)) { + } else if (__IN(f, 0x18ff, 64)) { if (fctno == 24 || fctno == 26) { if (OPB_NotVar(x)) { OPB_err(112); @@ -2198,7 +2198,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) p->typ = OPT_booltyp; break; case 29: - if (((x->class == 8 || x->class == 9) || __IN(f, 0x0501)) || x->typ->comp == 3) { + if (((x->class == 8 || x->class == 9) || __IN(f, 0x0501, 64)) || x->typ->comp == 3) { OPB_err(126); } if ((x->class != 7 && x->typ->size < p->typ->size)) { @@ -2230,7 +2230,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) OPB_err(126); } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x0810) && x->typ->size == (int64)OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x0810, 64) && x->typ->size == (int64)OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } @@ -2384,12 +2384,12 @@ static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpa ftyp = ftyp->BaseTyp; atyp = atyp->BaseTyp; if ((fvarpar && ftyp == OPT_bytetyp)) { - if (!__IN(f, 0x0c) || !((__IN(atyp->form, 0x1e) && atyp->size == 1))) { - if (__IN(18, OPM_opt)) { + if (!__IN(f, 0x0c, 64) || !((__IN(atyp->form, 0x1e, 64) && atyp->size == 1))) { + if (__IN(18, OPM_opt, 64)) { OPB_err(-301); } } - } else if (__IN(f, 0x0c)) { + } else if (__IN(f, 0x0c, 64)) { if (ftyp->comp == 3) { OPB_DynArrParCheck(ftyp, atyp, fvarpar); } else if (ftyp != atyp) { @@ -2428,7 +2428,7 @@ static void OPB_CheckReceiver (OPT_Node *x, OPT_Object fp) void OPB_PrepCall (OPT_Node *x, OPT_Object *fpar) { - if (((*x)->obj != NIL && __IN((*x)->obj->mode, 0x22c0))) { + if (((*x)->obj != NIL && __IN((*x)->obj->mode, 0x22c0, 64))) { *fpar = (*x)->obj->link; if ((*x)->obj->mode == 13) { OPB_CheckReceiver(&(*x)->left, *fpar); @@ -2467,7 +2467,7 @@ void OPB_Param (OPT_Node ap, OPT_Object fp) OPB_err(111); } } else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 11)) { - } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x1e) && ap->typ->size == 1)))))) { + } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x1e, 64) && ap->typ->size == 1)))))) { OPB_err(123); } else if ((fp->typ->form == 11 && ap->class == 5)) { OPB_err(123); @@ -2494,7 +2494,7 @@ void OPB_StaticLink (int8 dlev) scope = OPT_topScope; while (dlev > 0) { dlev -= 1; - scope->link->conval->setval |= __SETOF(3); + scope->link->conval->setval |= __SETOF(3,64); scope = scope->left; } } @@ -2589,7 +2589,7 @@ void OPB_Assign (OPT_Node *x, OPT_Node y) y->conval->intval = 0; OPB_Index(&*x, OPB_NewIntConst(0)); } - if ((((((__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp == OPT_chartyp)) && __IN(y->typ->comp, 0x0c))) && y->typ->BaseTyp == OPT_chartyp)) { + if ((((((__IN((*x)->typ->comp, 0x0c, 64) && (*x)->typ->BaseTyp == OPT_chartyp)) && __IN(y->typ->comp, 0x0c, 64))) && y->typ->BaseTyp == OPT_chartyp)) { subcl = 18; } else { subcl = 0; diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index adefb869..35fb2186 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index aee5581c..ef8f41a1 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -93,9 +93,9 @@ static BOOLEAN OPC_Undefined (OPT_Object obj); void OPC_Init (void) { OPC_indentLevel = 0; - OPC_ptrinit = __IN(5, OPM_opt); + OPC_ptrinit = __IN(5, OPM_opt, 64); OPC_mainprog = OPM_mainProg || OPM_mainLinkStat; - OPC_ansi = __IN(6, OPM_opt); + OPC_ansi = __IN(6, OPM_opt, 64); if (OPC_ansi) { __MOVE("__init(void)", OPC_BodyNameExt, 13); } else { @@ -196,7 +196,7 @@ void OPC_Ident (OPT_Object obj) int32 mode, level, h; mode = obj->mode; level = obj->mnolev; - if ((__IN(mode, 0x62) && level > 0) || __IN(mode, 0x14)) { + if ((__IN(mode, 0x62, 64) && level > 0) || __IN(mode, 0x14, 64)) { OPM_WriteStringVar((void*)obj->name, 256); h = OPC_PerfectHash((void*)obj->name, 256); if (OPC_hashtab[__X(h, 105)] >= 0) { @@ -236,7 +236,7 @@ static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause) int32 pointers; *openClause = 0; if (((typ->strobj == NIL || typ->strobj->name[0] == 0x00) && typ->comp != 4)) { - if (__IN(typ->comp, 0x0c)) { + if (__IN(typ->comp, 0x0c, 64)) { OPC_Stars(typ->BaseTyp, &*openClause); *openClause = typ->comp == 2; } else if (typ->form == 12) { @@ -293,7 +293,7 @@ static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef) break; } else if ((form == 11 && typ->BaseTyp->comp != 3)) { openClause = 1; - } else if (form == 12 || __IN(comp, 0x0c)) { + } else if (form == 12 || __IN(comp, 0x0c, 64)) { if (openClause) { OPM_Write(')'); openClause = 0; @@ -708,7 +708,7 @@ static void OPC_DefineType (OPT_Struct str) if (str->BaseTyp->comp != 4) { OPC_DefineType(str->BaseTyp); } - } else if (__IN(str->comp, 0x0c)) { + } else if (__IN(str->comp, 0x0c, 64)) { OPC_DefineType(str->BaseTyp); } else if (str->form == 12) { if (str->BaseTyp != OPT_notyp) { @@ -1019,7 +1019,7 @@ static void OPC_IdentList (OPT_Object obj, int32 vis) base = NIL; first = 1; while ((obj != NIL && obj->mode != 13)) { - if ((__IN(vis, 0x05) || (vis == 1 && obj->vis != 0)) || (vis == 3 && !obj->leaf)) { + if ((__IN(vis, 0x05, 64) || (vis == 1 && obj->vis != 0)) || (vis == 3 && !obj->leaf)) { if (obj->typ != base || obj->vis != lastvis) { if (!first) { OPC_EndStat(); @@ -1144,7 +1144,7 @@ static void OPC_ProcPredefs (OPT_Object obj, int8 vis) { if (obj != NIL) { OPC_ProcPredefs(obj->left, vis); - if ((((__IN(obj->mode, 0xc0) && obj->vis >= vis)) && (obj->history != 4 || obj->mode == 6))) { + if ((((__IN(obj->mode, 0xc0, 64) && obj->vis >= vis)) && (obj->history != 4 || obj->mode == 6))) { if (vis == 1) { OPM_WriteString((CHAR*)"import ", 8); } else if (obj->vis == 0) { @@ -1238,7 +1238,7 @@ static void OPC_GenHeaderMsg (void) OPM_Write(' '); i = 0; while (i <= 63) { - if (__IN(i, OPM_glbopt)) { + if (__IN(i, OPM_glbopt, 64)) { switch (i) { case 0: OPM_Write('x'); @@ -1600,7 +1600,7 @@ void OPC_EnterProc (OPT_Object proc) } var = proc->link; while (var != NIL) { - if ((((__IN(var->typ->comp, 0x0c) && var->mode == 1)) && var->typ->sysflag == 0)) { + if ((((__IN(var->typ->comp, 0x0c, 64) && var->mode == 1)) && var->typ->sysflag == 0)) { OPC_BegStat(); if (var->typ->comp == 2) { OPM_WriteString((CHAR*)"__DUPARR(", 10); @@ -1648,7 +1648,7 @@ void OPC_EnterProc (OPT_Object proc) OPM_Write('.'); OPC_Ident(var); OPM_WriteString((CHAR*)" = ", 4); - if (__IN(var->typ->comp, 0x0c)) { + if (__IN(var->typ->comp, 0x0c, 64)) { OPM_WriteString((CHAR*)"(void*)", 8); } else if (var->mode != 2) { OPM_Write('&'); @@ -2006,7 +2006,7 @@ void OPC_Constant (OPT_Const con, int32 form) do { i -= 1; hex = __ASHL(hex, 1); - if (__IN(i, s)) { + if (__IN(i, s, 64)) { hex += 1; } } while (!(__MASK(i, -8) == 0)); diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index aba4bdbb..646d0151 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 55420864..96868200 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -288,15 +288,15 @@ void OPM_InitOptions (void) s[0] = 0x00; Platform_GetArg(OPM_S, (void*)s, 256); } - OPM_dontAsm = __IN(13, OPM_opt); - OPM_dontLink = __IN(14, OPM_opt); - OPM_mainProg = __IN(10, OPM_opt); - OPM_mainLinkStat = __IN(15, OPM_opt); - OPM_notColorOutput = __IN(16, OPM_opt); - OPM_forceNewSym = __IN(17, OPM_opt); - OPM_Verbose = __IN(18, OPM_opt); + OPM_dontAsm = __IN(13, OPM_opt, 64); + OPM_dontLink = __IN(14, OPM_opt, 64); + OPM_mainProg = __IN(10, OPM_opt, 64); + OPM_mainLinkStat = __IN(15, OPM_opt, 64); + OPM_notColorOutput = __IN(16, OPM_opt, 64); + OPM_forceNewSym = __IN(17, OPM_opt, 64); + OPM_Verbose = __IN(18, OPM_opt, 64); if (OPM_mainLinkStat) { - OPM_glbopt |= __SETOF(10); + OPM_glbopt |= __SETOF(10,64); } OPM_GetProperties(); } @@ -771,7 +771,7 @@ void OPM_SymWLReal (LONGREAL lr) void OPM_RegisterNewSym (void) { - if (__STRCMP(OPM_modName, "SYSTEM") != 0 || __IN(10, OPM_opt)) { + if (__STRCMP(OPM_modName, "SYSTEM") != 0 || __IN(10, OPM_opt, 64)) { Files_Register(OPM_newSFile); } } @@ -970,10 +970,10 @@ void OPM_CloseFiles (void) } if (OPM_noerr) { if (__STRCMP(OPM_modName, "SYSTEM") == 0) { - if (!__IN(10, OPM_opt)) { + if (!__IN(10, OPM_opt, 64)) { Files_Register(OPM_BFile); } - } else if (!__IN(10, OPM_opt)) { + } else if (!__IN(10, OPM_opt, 64)) { OPM_Append(&OPM_R[2], Files_Rider__typ, OPM_HFile); Files_Register(OPM_HIFile); Files_Register(OPM_BFile); diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index 1e5c3e72..d4b77c79 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index f175938c..7e958472 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -94,7 +94,7 @@ static void OPP_qualident (OPT_Object *id) obj->adr = 0; } else { lev = obj->mnolev; - if ((__IN(obj->mode, 0x06) && lev != OPP_level)) { + if ((__IN(obj->mode, 0x06, 64) && lev != OPP_level)) { obj->leaf = 0; if (lev > 0) { OPB_StaticLink(OPP_level - lev); @@ -325,7 +325,7 @@ static void OPP_PointerType (OPT_Struct *typ) } else { OPP_qualident(&id); if (id->mode == 5) { - if (__IN(id->typ->comp, 0x1c)) { + if (__IN(id->typ->comp, 0x1c, 64)) { (*typ)->BaseTyp = id->typ; } else { (*typ)->BaseTyp = OPT_undftyp; @@ -338,7 +338,7 @@ static void OPP_PointerType (OPT_Struct *typ) } } else { OPP_Type(&(*typ)->BaseTyp, &OPT_notyp); - if (!__IN((*typ)->BaseTyp->comp, 0x1c)) { + if (!__IN((*typ)->BaseTyp->comp, 0x1c, 64)) { (*typ)->BaseTyp = OPT_undftyp; OPP_err(57); } @@ -966,7 +966,7 @@ static void GetCode__19 (void) } } } - (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1); + (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1,64); } static void GetParams__21 (void) @@ -998,7 +998,7 @@ static void Body__17 (void) OPT_Node procdec = NIL, statseq = NIL; int64 c; c = OPM_errpos; - (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1); + (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1,64); OPP_CheckSym(39); OPP_Block(&procdec, &statseq); OPB_Enter(&procdec, statseq, *ProcedureDeclaration__16_s->proc); @@ -1041,7 +1041,7 @@ static void TProcDecl__23 (void) if ((*ProcedureDeclaration__16_s->fwd != NIL && (*ProcedureDeclaration__16_s->fwd)->mnolev != OPP_level)) { *ProcedureDeclaration__16_s->fwd = NIL; } - if ((((*ProcedureDeclaration__16_s->fwd != NIL && (*ProcedureDeclaration__16_s->fwd)->mode == 13)) && !__IN(1, (*ProcedureDeclaration__16_s->fwd)->conval->setval))) { + if ((((*ProcedureDeclaration__16_s->fwd != NIL && (*ProcedureDeclaration__16_s->fwd)->mode == 13)) && !__IN(1, (*ProcedureDeclaration__16_s->fwd)->conval->setval, 64))) { *ProcedureDeclaration__16_s->proc = OPT_NewObj(); (*ProcedureDeclaration__16_s->proc)->leaf = 1; if ((*ProcedureDeclaration__16_s->fwd)->vis != *ProcedureDeclaration__16_s->vis) { @@ -1075,7 +1075,7 @@ static void TProcDecl__23 (void) if ((((((baseProc->vis == 1 && (*ProcedureDeclaration__16_s->proc)->vis == 0)) && recTyp->strobj != NIL)) && recTyp->strobj->vis == 1)) { OPP_err(109); } - (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(2); + (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(2,64); } if (!*ProcedureDeclaration__16_s->forward) { Body__17(); @@ -1118,7 +1118,7 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) } else { OPP_err(38); } - if ((__IN(mode, 0x0600) && !OPT_SYSimported)) { + if ((__IN(mode, 0x0600, 64) && !OPT_SYSimported)) { OPP_err(135); } OPS_Get(&OPP_sym); @@ -1135,7 +1135,7 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) if ((fwd != NIL && (fwd->mnolev != OPP_level || fwd->mode == 8))) { fwd = NIL; } - if ((((fwd != NIL && __IN(fwd->mode, 0xc0))) && !__IN(1, fwd->conval->setval))) { + if ((((fwd != NIL && __IN(fwd->mode, 0xc0, 64))) && !__IN(1, fwd->conval->setval, 64))) { proc = OPT_NewObj(); proc->leaf = 1; if (fwd->vis != vis) { @@ -1178,7 +1178,7 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int32 *n, OPP for (;;) { OPP_ConstExpression(&x); f = x->typ->form; - if (__IN(f, 0x18)) { + if (__IN(f, 0x18, 64)) { xval = x->conval->intval; } else { OPP_err(61); @@ -1258,7 +1258,7 @@ static void CasePart__31 (OPT_Node *x) *StatSeq__30_s->pos = OPM_errpos; if ((*x)->class == 8 || (*x)->class == 9) { OPP_err(126); - } else if (!__IN((*x)->typ->form, 0x18)) { + } else if (!__IN((*x)->typ->form, 0x18, 64)) { OPP_err(125); } OPP_CheckSym(25); @@ -1675,7 +1675,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) if (obj->typ->strobj == NIL) { obj->typ->strobj = obj; } - if (__IN(obj->typ->comp, 0x1c)) { + if (__IN(obj->typ->comp, 0x1c, 64)) { i = 0; while (i < OPP_nofFwdPtr) { typ = OPP_FwdPtr[__X(i, 64)]; diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index 2d3ebd77..9ddded2f 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index 0c36910a..208f4934 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index a16c2ce8..bb045fe9 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index 3006ea90..afc5a8b6 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -274,9 +274,9 @@ void OPT_Init (OPS_Name name, SET opt) __COPY(name, OPT_topScope->name, 256); OPT_GlbMod[0] = OPT_topScope; OPT_nofGmod = 1; - OPT_newsf = __IN(4, opt); - OPT_findpc = __IN(8, opt); - OPT_extsf = OPT_newsf || __IN(9, opt); + OPT_newsf = __IN(4, opt, 64); + OPT_findpc = __IN(8, opt, 64); + OPT_extsf = OPT_newsf || __IN(9, opt, 64); OPT_sfpresent = 1; } @@ -609,7 +609,7 @@ void OPT_FPrintStr (OPT_Struct typ) pvfp = pbfp; } } else if (f == 12) { - } else if (__IN(c, 0x0c)) { + } else if (__IN(c, 0x0c, 64)) { OPT_FPrintStr(btyp); OPM_FPrint(&pbfp, btyp->pvfp); pvfp = pbfp; @@ -680,7 +680,7 @@ void OPT_FPrintObj (OPT_Object obj) OPM_FPrint(&fprint, obj->vis); OPT_FPrintStr(obj->typ); OPM_FPrint(&fprint, obj->typ->pbfp); - } else if (__IN(obj->mode, 0x0480)) { + } else if (__IN(obj->mode, 0x0480, 64)) { OPT_FPrintSign(&fprint, obj->typ, obj->link); } else if (obj->mode == 9) { OPT_FPrintSign(&fprint, obj->typ, obj->link); @@ -1573,7 +1573,7 @@ static void OPT_OutObj (OPT_Object obj) OPT_ConstExt ext = NIL; if (obj != NIL) { OPT_OutObj(obj->left); - if (__IN(obj->mode, 0x06ea)) { + if (__IN(obj->mode, 0x06ea, 64)) { if (obj->history == 4) { OPT_FPrintErr(obj, 250); } else if (obj->vis != 0) { diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 5f466ec4..090d9111 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 082797f1..098463c4 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -130,10 +130,10 @@ void OPV_Init (void) OPV_stamp = 0; OPV_recno = 0; OPV_nofExitLabels = 0; - OPV_assert = __IN(7, OPM_opt); - OPV_inxchk = __IN(0, OPM_opt); - OPV_mainprog = __IN(10, OPM_opt); - OPV_ansi = __IN(6, OPM_opt); + OPV_assert = __IN(7, OPM_opt, 64); + OPV_inxchk = __IN(0, OPM_opt, 64); + OPV_mainprog = __IN(10, OPM_opt, 64); + OPV_ansi = __IN(6, OPM_opt, 64); } static void OPV_GetTProcNum (OPT_Object obj) @@ -150,7 +150,7 @@ static void OPV_GetTProcNum (OPT_Object obj) OPT_FindField(obj->name, typ->BaseTyp, &redef); if (redef != NIL) { obj->adr = __ASHL(__ASHR(redef->adr, 16), 16); - if (!__IN(2, obj->conval->setval)) { + if (!__IN(2, obj->conval->setval, 64)) { OPM_err(119); } } else { @@ -230,12 +230,12 @@ static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exporte OPV_TypSize(obj->typ); } if (!exported) { - if ((__IN(mode, 0x60) && obj->mnolev > 0)) { + if ((__IN(mode, 0x60, 64) && obj->mnolev > 0)) { OPV_Stamp(obj->name); } - if (__IN(mode, 0x26)) { + if (__IN(mode, 0x26, 64)) { obj->scope = outerScope; - } else if (__IN(mode, 0x26c0)) { + } else if (__IN(mode, 0x26c0, 64)) { if (obj->conval->setval == 0x0) { OPM_err(129); } @@ -289,7 +289,7 @@ static int32 OPV_Precedence (int32 class, int32 subclass, int32 form, int32 comp return _o_result; break; case 5: - if (__IN(3, OPM_opt)) { + if (__IN(3, OPM_opt, 64)) { _o_result = 10; return _o_result; } else { @@ -298,7 +298,7 @@ static int32 OPV_Precedence (int32 class, int32 subclass, int32 form, int32 comp } break; case 1: - if (__IN(comp, 0x0c)) { + if (__IN(comp, 0x0c, 64)) { _o_result = 10; return _o_result; } else { @@ -445,7 +445,7 @@ static BOOLEAN OPV_SideEffects (OPT_Node n) static void OPV_Entier (OPT_Node n, int32 prec) { - if (__IN(n->typ->form, 0x60)) { + if (__IN(n->typ->form, 0x60, 64)) { OPM_WriteString((CHAR*)"__ENTIER(", 10); OPV_expr(n, -1); OPM_Write(')'); @@ -471,9 +471,11 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int32 prec) if (to == 7) { OPM_WriteString((CHAR*)"__SETOF(", 9); OPV_Entier(n, -1); + OPM_WriteString((CHAR*)",", 2); + OPM_WriteInt(__ASHL(newtype->size, 3)); OPM_Write(')'); } else if (to == 4) { - if ((newtype->size < n->typ->size && __IN(2, OPM_opt))) { + if ((newtype->size < n->typ->size && __IN(2, OPM_opt, 64))) { OPM_WriteString((CHAR*)"__SHORT", 8); if (OPV_SideEffects(n)) { OPM_Write('F'); @@ -488,7 +490,7 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int32 prec) OPV_Entier(n, 9); } } else if (to == 3) { - if (__IN(2, OPM_opt)) { + if (__IN(2, OPM_opt, 64)) { OPM_WriteString((CHAR*)"__CHR", 6); if (OPV_SideEffects(n)) { OPM_Write('F'); @@ -511,7 +513,7 @@ static void OPV_TypeOf (OPT_Node n) OPM_WriteString((CHAR*)"__TYPEOF(", 10); OPV_expr(n, -1); OPM_Write(')'); - } else if (__IN(n->class, 0x15)) { + } else if (__IN(n->class, 0x15, 64)) { OPC_Andent(n->typ); OPM_WriteString((CHAR*)"__typ", 6); } else if (n->class == 3) { @@ -572,7 +574,7 @@ static void OPV_design (OPT_Node n, int32 prec) OPC_CompleteIdent(n->obj); break; case 1: - if (!__IN(comp, 0x0c)) { + if (!__IN(comp, 0x0c, 64)) { OPM_Write('*'); } OPC_CompleteIdent(n->obj); @@ -651,7 +653,7 @@ static void OPV_design (OPT_Node n, int32 prec) case 5: typ = n->typ; obj = n->left->obj; - if (__IN(3, OPM_opt)) { + if (__IN(3, OPM_opt, 64)) { if (typ->comp == 4) { OPM_WriteString((CHAR*)"__GUARDR(", 10); if (obj->mnolev != OPM_level) { @@ -690,7 +692,7 @@ static void OPV_design (OPT_Node n, int32 prec) } break; case 6: - if (__IN(3, OPM_opt)) { + if (__IN(3, OPM_opt, 64)) { if (n->left->class == 1) { OPM_WriteString((CHAR*)"__GUARDEQR(", 12); OPC_CompleteIdent(n->left->obj); @@ -749,7 +751,7 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) OPM_WriteString((CHAR*)"*)", 3); prec = 10; } - if (!__IN(n->typ->comp, 0x0c)) { + if (!__IN(n->typ->comp, 0x0c, 64)) { if (mode == 2) { if ((OPV_ansi && typ != n->typ)) { OPM_WriteString((CHAR*)"(void*)", 8); @@ -757,13 +759,13 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) OPM_Write('&'); prec = 9; } else if (OPV_ansi) { - if ((__IN(comp, 0x0c) && n->class == 7)) { + if ((__IN(comp, 0x0c, 64) && n->class == 7)) { OPM_WriteString((CHAR*)"(CHAR*)", 8); } else if ((((form == 11 && typ != n->typ)) && n->typ != OPT_niltyp)) { OPM_WriteString((CHAR*)"(void*)", 8); } } else { - if ((__IN(form, 0x60) && n->typ->form == 4)) { + if ((__IN(form, 0x60, 64) && n->typ->form == 4)) { OPM_WriteString((CHAR*)"(double)", 9); prec = 9; } else if (form == 4) { @@ -846,7 +848,7 @@ static void OPV_expr (OPT_Node n, int32 prec) l = n->left; r = n->right; exprPrec = OPV_Precedence(class, subclass, form, n->typ->comp); - if ((exprPrec <= prec && __IN(class, 0x3ce0))) { + if ((exprPrec <= prec && __IN(class, 0x3ce0, 64))) { OPM_Write('('); } switch (class) { @@ -858,6 +860,8 @@ static void OPV_expr (OPT_Node n, int32 prec) OPV_expr(l, -1); OPM_WriteString((CHAR*)", ", 3); OPV_expr(r, -1); + OPM_WriteString((CHAR*)", ", 3); + OPM_WriteInt(__ASHL(n->typ->size, 3)); OPM_Write(')'); break; case 11: @@ -924,18 +928,18 @@ static void OPV_expr (OPT_Node n, int32 prec) if (l->class == 1) { OPC_CompleteIdent(l->obj); } else { - if ((l->typ->form != 8 && !__IN(l->typ->comp, 0x0c))) { + if ((l->typ->form != 8 && !__IN(l->typ->comp, 0x0c, 64))) { OPM_Write('&'); } OPV_expr(l, exprPrec); } break; case 29: - if (!__IN(l->class, 0x17) || (((__IN(n->typ->form, 0x1890) && __IN(l->typ->form, 0x1890))) && n->typ->size == l->typ->size)) { + if (!__IN(l->class, 0x17, 64) || (((__IN(n->typ->form, 0x1890, 64) && __IN(l->typ->form, 0x1890, 64))) && n->typ->size == l->typ->size)) { OPM_Write('('); OPC_Ident(n->typ->strobj); OPM_Write(')'); - if (__IN(n->typ->form, 0x1800) || __IN(l->typ->form, 0x1800)) { + if (__IN(n->typ->form, 0x1800, 64) || __IN(l->typ->form, 0x1800, 64)) { OPM_WriteString((CHAR*)"(address)", 10); } OPV_expr(l, exprPrec); @@ -1032,20 +1036,24 @@ static void OPV_expr (OPT_Node n, int32 prec) } OPV_expr(l, -1); OPM_WriteString((CHAR*)", ", 3); - if ((((__IN(subclass, 0x18020000) && r->class == 7)) && r->conval->intval < 0)) { + if ((((__IN(subclass, 0x18020000, 64) && r->class == 7)) && r->conval->intval < 0)) { OPM_WriteInt(-r->conval->intval); } else { OPV_expr(r, -1); } - if (__IN(subclass, 0x18000000)) { + if (__IN(subclass, 0x18008000, 64)) { OPM_WriteString((CHAR*)", ", 3); - OPM_WriteInt(__ASHL(l->typ->size, 3)); + if (subclass == 15) { + OPM_WriteInt(__ASHL(r->typ->size, 3)); + } else { + OPM_WriteInt(__ASHL(l->typ->size, 3)); + } } OPM_Write(')'); break; case 9: case 10: case 11: case 12: case 13: case 14: - if (__IN(l->typ->form, 0x2100)) { + if (__IN(l->typ->form, 0x2100, 64)) { OPM_WriteString((CHAR*)"__STRCMP(", 10); OPV_expr(l, -1); OPM_WriteString((CHAR*)", ", 3); @@ -1142,7 +1150,7 @@ static void OPV_expr (OPT_Node n, int32 prec) OPV_design(n, prec); break; } - if ((exprPrec <= prec && __IN(class, 0x3ca0))) { + if ((exprPrec <= prec && __IN(class, 0x3ca0, 64))) { OPM_Write(')'); } } @@ -1432,7 +1440,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPM_WriteString((CHAR*)", ", 3); OPC_Andent(n->left->typ->BaseTyp); OPM_WriteString((CHAR*)")", 2); - } else if (__IN(n->left->typ->BaseTyp->comp, 0x0c)) { + } else if (__IN(n->left->typ->BaseTyp->comp, 0x0c, 64)) { OPV_NewArr(n->left, n->right); } break; @@ -1446,6 +1454,8 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPC_SetInclude(n->subcl == 16); OPM_WriteString((CHAR*)"__SETOF(", 9); OPV_expr(n->right, -1); + OPM_WriteString((CHAR*)",", 2); + OPM_WriteInt(__ASHL(n->left->typ->size, 3)); OPM_Write(')'); break; case 18: @@ -1623,7 +1633,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPM_LogWLn(); break; } - if (!__IN(n->class, 0x09744000)) { + if (!__IN(n->class, 0x09744000, 64)) { OPC_EndStat(); } n = n->link; diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index 3b43e61e..ea1f9aaa 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index cf8dfa9f..f428c2b1 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index 708e58d7..d9212710 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 2a753b7a..b3e89e04 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index c3cac05a..3892d49c 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index d8c606d3..1eef261b 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index 130e1d06..8145aa00 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index 056c54e0..d8710e54 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -578,13 +578,13 @@ void Texts_ChangeLooks (Texts_Text T, int64 beg, int64 end, SET sel, Texts_Fonts T->cache = c; T->corg = co; while (un != vn) { - if ((__IN(0, sel) && fnt != NIL)) { + if ((__IN(0, sel, 64) && fnt != NIL)) { un->fnt = fnt; } - if (__IN(1, sel)) { + if (__IN(1, sel, 64)) { un->col = col; } - if (__IN(2, sel)) { + if (__IN(2, sel, 64)) { un->voff = voff; } Texts_Merge(T, u, &un); diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index 1e734f9d..8389bc47 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/Vishap.c b/bootstrap/unix-88/Vishap.c index 08b89b00..3972af10 100644 --- a/bootstrap/unix-88/Vishap.c +++ b/bootstrap/unix-88/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkamSf */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/errors.c b/bootstrap/unix-88/errors.c index 84d35faf..8864c777 100644 --- a/bootstrap/unix-88/errors.c +++ b/bootstrap/unix-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/errors.h b/bootstrap/unix-88/errors.h index 4fe434e1..58286fd8 100644 --- a/bootstrap/unix-88/errors.h +++ b/bootstrap/unix-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index 7651bcf8..bb60848a 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index 5d996dae..8a0d60be 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/vt100.c b/bootstrap/unix-88/vt100.c index b7524886..c143a6b3 100644 --- a/bootstrap/unix-88/vt100.c +++ b/bootstrap/unix-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/vt100.h b/bootstrap/unix-88/vt100.h index ef3afa5a..11a9c941 100644 --- a/bootstrap/unix-88/vt100.h +++ b/bootstrap/unix-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index cc4f7969..d8c934bf 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/12] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/14] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index 3ce4467e..2b7bdf82 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Console.c b/bootstrap/windows-48/Console.c index 6ad2295c..359bad0a 100644 --- a/bootstrap/windows-48/Console.c +++ b/bootstrap/windows-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Console.h b/bootstrap/windows-48/Console.h index c6fe7fc4..0af02096 100644 --- a/bootstrap/windows-48/Console.h +++ b/bootstrap/windows-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 1e560865..01218f26 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index b082c461..ffdc05f6 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index 4d96ea89..f03a4d7e 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tskSfF */ #define INTEGER int16 #define LONGINT int32 @@ -82,6 +82,7 @@ export LONGINT *Heap__1__typ; static void Heap_CheckFin (void); static void Heap_ExtendHeap (address blksz); export void Heap_FINALL (void); +static address Heap_FetchAddress (address pointer); static void Heap_Finalize (void); export void Heap_GC (BOOLEAN markStack); static void Heap_HeapSort (address n, address *a, LONGINT a__len); @@ -106,7 +107,6 @@ export void Heap_Unlock (void); extern void *Heap__init(); extern address Platform_MainStackFrame; extern address Platform_OSAllocate(address size); -#define Heap_FetchAddress(pointer) (address)(*((void**)((address)pointer))) #define Heap_HeapModuleInit() Heap__init() #define Heap_OSAllocate(size) Platform_OSAllocate(size) #define Heap_PlatformHalt(code) Platform_Halt(code) @@ -188,6 +188,15 @@ static address Heap_NewChunk (address blksz) return _o_result; } +static address Heap_FetchAddress (address pointer) +{ + address _o_result; + address r; + __GET(pointer, r, address); + _o_result = r; + return _o_result; +} + static void Heap_ExtendHeap (address blksz) { address size, chnk, j, next; diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index 1a6c9e05..29b4cb26 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index 9834a814..a71d3e4d 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index e34e59ed..6a744f9b 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index 92c0af42..a905da35 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -345,7 +345,7 @@ void OPB_Index (OPT_Node *x, OPT_Node y) f = y->typ->form; if ((*x)->class >= 7) { OPB_err(79); - } else if (f != 4 || __IN(y->class, 0x0300)) { + } else if (f != 4 || __IN(y->class, 0x0300, 32)) { OPB_err(80); y->typ = OPT_inttyp; } @@ -372,7 +372,7 @@ void OPB_Field (OPT_Node *x, OPT_Object y) if ((*x)->class >= 7) { OPB_err(77); } - if ((y != NIL && __IN(y->mode, 0x2010))) { + if ((y != NIL && __IN(y->mode, 0x2010, 32))) { OPB_BindNodes(2, y->typ, &*x, NIL); (*x)->obj = y; (*x)->readonly = (*x)->left->readonly || (y->vis == 2 && y->mnolev < 0); @@ -476,7 +476,7 @@ void OPB_In (OPT_Node *x, OPT_Node y) if (k < 0 || k > OPM_MaxSet) { OPB_err(202); } else if (y->class == 7) { - (*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval)); + (*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval, 32)); (*x)->obj = NIL; } else { OPB_BindNodes(12, OPT_booltyp, &*x, y); @@ -572,12 +572,12 @@ void OPB_MOp (int8 op, OPT_Node *x) } break; case 6: - if (!__IN(f, 0x70)) { + if (!__IN(f, 0x70, 32)) { OPB_err(96); } break; case 7: - if (__IN(f, 0xf0)) { + if (__IN(f, 0xf0, 32)) { if (z->class == 7) { if (f == 4) { if (z->conval->intval == (-2147483647-1)) { @@ -586,7 +586,7 @@ void OPB_MOp (int8 op, OPT_Node *x) z->conval->intval = -z->conval->intval; OPB_SetIntType(z); } - } else if (__IN(f, 0x60)) { + } else if (__IN(f, 0x60, 32)) { z->conval->realval = -z->conval->realval; } else { z->conval->setval = ~z->conval->setval; @@ -600,7 +600,7 @@ void OPB_MOp (int8 op, OPT_Node *x) } break; case 21: - if (__IN(f, 0x70)) { + if (__IN(f, 0x70, 32)) { if (z->class == 7) { if (f == 4) { if (z->conval->intval == (-2147483647-1)) { @@ -747,7 +747,7 @@ void OPB_CheckParameters (OPT_Object fp, OPT_Object ap, BOOLEAN checkNames) static void OPB_CheckProc (OPT_Struct x, OPT_Object y) { - if (__IN(y->mode, 0x04c0)) { + if (__IN(y->mode, 0x04c0, 32)) { if (y->mode == 6) { if (y->mnolev == 0) { y->mode = 7; @@ -923,7 +923,7 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) } break; case 9: - if (!__IN(g, 0x1800)) { + if (!__IN(g, 0x1800, 32)) { OPB_err(100); } break; @@ -954,7 +954,7 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) } else { OPB_err(204); } - } else if (__IN(f, 0x60)) { + } else if (__IN(f, 0x60, 32)) { temp = __ABS(yval->realval) <= (LONGREAL)1; if (temp || __ABS(xval->realval) <= 1.79769296342094e+308 / (LONGREAL)__ABS(yval->realval)) { xval->realval = xval->realval * yval->realval; @@ -978,7 +978,7 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) xval->realval = (LONGREAL)1; } x->typ = OPT_realtyp; - } else if (__IN(f, 0x60)) { + } else if (__IN(f, 0x60, 32)) { temp = __ABS(yval->realval) >= (LONGREAL)1; if (temp || __ABS(xval->realval) <= 1.79769296342094e+308 * __ABS(yval->realval)) { xval->realval = xval->realval / yval->realval; @@ -1032,7 +1032,7 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) } else { OPB_err(206); } - } else if (__IN(f, 0x60)) { + } else if (__IN(f, 0x60, 32)) { temp = (yval->realval >= (LONGREAL)0 && xval->realval <= 1.79769296342094e+308 - yval->realval); if (temp || (yval->realval < (LONGREAL)0 && xval->realval >= -1.79769296342094e+308 - yval->realval)) { xval->realval = xval->realval + yval->realval; @@ -1054,7 +1054,7 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) } else { OPB_err(207); } - } else if (__IN(f, 0x60)) { + } else if (__IN(f, 0x60, 32)) { temp = (yval->realval >= (LONGREAL)0 && xval->realval >= -1.79769296342094e+308 + yval->realval); if (temp || (yval->realval < (LONGREAL)0 && xval->realval <= 1.79769296342094e+308 + yval->realval)) { xval->realval = xval->realval - yval->realval; @@ -1082,28 +1082,28 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) xval->intval = OPB_BoolToInt(ConstCmp__14() != 9); break; case 11: - if (__IN(f, 0x0a84)) { + if (__IN(f, 0x0a84, 32)) { OPB_err(108); } else { xval->intval = OPB_BoolToInt(ConstCmp__14() == 11); } break; case 12: - if (__IN(f, 0x0a84)) { + if (__IN(f, 0x0a84, 32)) { OPB_err(108); } else { xval->intval = OPB_BoolToInt(ConstCmp__14() != 13); } break; case 13: - if (__IN(f, 0x0a84)) { + if (__IN(f, 0x0a84, 32)) { OPB_err(108); } else { xval->intval = OPB_BoolToInt(ConstCmp__14() == 13); } break; case 14: - if (__IN(f, 0x0a84)) { + if (__IN(f, 0x0a84, 32)) { OPB_err(108); } else { xval->intval = OPB_BoolToInt(ConstCmp__14() != 11); @@ -1136,7 +1136,7 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) (*x)->conval->intval = 1; } } - } else if (__IN(g, 0x60)) { + } else if (__IN(g, 0x60, 32)) { (*x)->conval->realval = (*x)->conval->intval; (*x)->conval->intval = -1; } else { @@ -1145,8 +1145,8 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) OPB_err(220); } } - } else if (__IN(f, 0x60)) { - if (__IN(g, 0x60)) { + } else if (__IN(f, 0x60, 32)) { + if (__IN(g, 0x60, 32)) { OPB_CheckRealType(g, 203, (*x)->conval); } else { r = (*x)->conval->realval; @@ -1195,8 +1195,8 @@ static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) { BOOLEAN _o_result; BOOLEAN ok, xCharArr, yCharArr; - xCharArr = (__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp->form == 3) || *Op__38_s->f == 8; - yCharArr = (__IN((*y)->typ->comp, 0x0c) && (*y)->typ->BaseTyp->form == 3) || *Op__38_s->g == 8; + xCharArr = (__IN((*x)->typ->comp, 0x0c, 32) && (*x)->typ->BaseTyp->form == 3) || *Op__38_s->f == 8; + yCharArr = (__IN((*y)->typ->comp, 0x0c, 32) && (*y)->typ->BaseTyp->form == 3) || *Op__38_s->g == 8; if ((((xCharArr && *Op__38_s->g == 3)) && (*y)->class == 7)) { OPB_CharToString(*y); *Op__38_s->g = 8; @@ -1255,7 +1255,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) case 4: if ((g == 4 && y->typ->size < z->typ->size)) { OPB_Convert(&y, z->typ); - } else if (__IN(g, 0x70)) { + } else if (__IN(g, 0x70, 32)) { OPB_Convert(&z, y->typ); } else { OPB_err(100); @@ -1264,23 +1264,23 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) case 5: if (g == 4) { OPB_Convert(&y, z->typ); - } else if (__IN(g, 0x60)) { + } else if (__IN(g, 0x60, 32)) { OPB_Convert(&z, y->typ); } else { OPB_err(100); } break; case 6: - if (__IN(g, 0x70)) { + if (__IN(g, 0x70, 32)) { OPB_Convert(&y, z->typ); - } else if (__IN(g, 0x60)) { + } else if (__IN(g, 0x60, 32)) { OPB_Convert(&y, z->typ); } else { OPB_err(100); } break; case 9: - if (!__IN(g, 0x1800)) { + if (!__IN(g, 0x1800, 32)) { OPB_err(100); } break; @@ -1341,7 +1341,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) y->obj = NIL; } } - } else if (!__IN(f, 0xe1)) { + } else if (!__IN(f, 0xe1, 32)) { OPB_err(105); typ = OPT_undftyp; } @@ -1357,7 +1357,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) OPB_Convert(&z, OPT_realtyp); OPB_Convert(&y, OPT_realtyp); typ = OPT_realtyp; - } else if (__IN(f, 0x60)) { + } else if (__IN(f, 0x60, 32)) { if ((y->class == 7 && y->conval->realval == (LONGREAL)0)) { OPB_err(205); } @@ -1424,7 +1424,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) } break; case 6: - if (!__IN(f, 0xf1)) { + if (!__IN(f, 0xf1, 32)) { OPB_err(105); typ = OPT_undftyp; } @@ -1443,7 +1443,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) } break; case 7: - if (!__IN(f, 0xf1)) { + if (!__IN(f, 0xf1, 32)) { OPB_err(106); typ = OPT_undftyp; } @@ -1467,7 +1467,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) } break; case 9: case 10: - if (__IN(f, 0x1aff) || strings__41(&z, &y)) { + if (__IN(f, 0x1aff, 32) || strings__41(&z, &y)) { typ = OPT_booltyp; } else { OPB_err(107); @@ -1476,7 +1476,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) NewOp__39(op, typ, &z, y); break; case 11: case 12: case 13: case 14: - if (__IN(f, 0x79) || strings__41(&z, &y)) { + if (__IN(f, 0x79, 32) || strings__41(&z, &y)) { typ = OPT_booltyp; } else { OPM_LogWLn(); @@ -1518,10 +1518,10 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y) } if (((*x)->class == 7 && y->class == 7)) { if (k <= l) { - (*x)->conval->setval = __SETRNG(k, l); + (*x)->conval->setval = __SETRNG(k, l, 32); } else { OPB_err(201); - (*x)->conval->setval = __SETRNG(l, k); + (*x)->conval->setval = __SETRNG(l, k, 32); } (*x)->obj = NIL; } else { @@ -1543,7 +1543,7 @@ void OPB_SetElem (OPT_Node *x) } else if ((*x)->class == 7) { k = (*x)->conval->intval; if ((0 <= k && k <= OPM_MaxSet)) { - (*x)->conval->setval = __SETOF(k); + (*x)->conval->setval = __SETOF(k,32); } else { OPB_err(202); } @@ -1588,7 +1588,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) case 0: case 8: break; case 1: - if (!((__IN(g, 0x1a) && y->size == 1))) { + if (!((__IN(g, 0x1a, 32) && y->size == 1))) { OPB_err(113); } break; @@ -1603,12 +1603,12 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) } break; case 5: - if (!__IN(g, 0x30)) { + if (!__IN(g, 0x30, 32)) { OPB_err(113); } break; case 6: - if (!__IN(g, 0x70)) { + if (!__IN(g, 0x70, 32)) { OPB_err(113); } break; @@ -1656,7 +1656,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) if (ynode->conval->intval2 > x->n) { OPB_err(114); } - } else if ((__IN(y->comp, 0x0c) && y->BaseTyp == OPT_chartyp)) { + } else if ((__IN(y->comp, 0x0c, 32) && y->BaseTyp == OPT_chartyp)) { } else { OPB_err(113); } @@ -1664,7 +1664,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPB_err(113); } } else if ((x->comp == 3 && x->BaseTyp == OPT_chartyp)) { - if ((__IN(y->comp, 0x0c) && y->BaseTyp == OPT_chartyp)) { + if ((__IN(y->comp, 0x0c, 32) && y->BaseTyp == OPT_chartyp)) { } else { OPB_err(113); } @@ -1691,7 +1691,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPM_LogWLn(); break; } - if ((((((ynode->class == 7 && g < f)) && __IN(g, 0x30))) && __IN(f, 0x70))) { + if ((((((ynode->class == 7 && g < f)) && __IN(g, 0x30, 32))) && __IN(f, 0x70, 32))) { OPB_Convert(&ynode, x); } } @@ -1729,7 +1729,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) OPB_err(76); } f = x->typ->BaseTyp->comp; - if (__IN(f, 0x1c)) { + if (__IN(f, 0x1c, 32)) { if (f == 3) { typ = x->typ->BaseTyp; } @@ -1762,7 +1762,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) case 5: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x60)) { + } else if (__IN(f, 0x60, 32)) { OPB_Convert(&x, OPT_linttyp); } else { OPB_err(111); @@ -1837,7 +1837,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) case 9: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x11)) { + } else if (__IN(f, 0x11, 32)) { OPB_Convert(&x, OPT_chartyp); } else { OPB_err(111); @@ -1898,7 +1898,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) } break; case 17: - if (!__IN(x->typ->comp, 0x0c)) { + if (!__IN(x->typ->comp, 0x0c, 32)) { OPB_err(131); } break; @@ -1909,7 +1909,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) } if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (((!__IN(x->typ->comp, 0x0c) || x->typ->BaseTyp->form != 3) && f != 8)) { + } else if (((!__IN(x->typ->comp, 0x0c, 32) || x->typ->BaseTyp->form != 3) && f != 8)) { OPB_err(111); } break; @@ -1933,7 +1933,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) if (x->class != 8) { OPB_err(110); x = OPB_NewIntConst(1); - } else if (__IN(f, 0x18fe) || __IN(x->typ->comp, 0x14)) { + } else if (__IN(f, 0x18fe, 32) || __IN(x->typ->comp, 0x14, 32)) { (*OPB_typSize)(x->typ); x->typ->pvused = 1; x = OPB_NewIntConst(x->typ->size); @@ -1948,7 +1948,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) case 22: case 23: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (!__IN(f, 0x9a)) { + } else if (!__IN(f, 0x9a, 32)) { OPB_err(111); } break; @@ -1957,7 +1957,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) OPB_err(126); } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x0810) && x->typ->size == OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x0810, 32) && x->typ->size == OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } @@ -1974,7 +1974,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) case 29: if (x->class != 8) { OPB_err(110); - } else if (__IN(f, 0x0501) || x->typ->comp == 3) { + } else if (__IN(f, 0x0501, 32) || x->typ->comp == 3) { OPB_err(111); } break; @@ -2070,11 +2070,11 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) } else if (x->typ->size == 1) { L = (int16)x->conval->intval; typ = p->typ; - while ((L > 0 && __IN(typ->comp, 0x0c))) { + while ((L > 0 && __IN(typ->comp, 0x0c, 32))) { typ = typ->BaseTyp; L -= 1; } - if (L != 0 || !__IN(typ->comp, 0x0c)) { + if (L != 0 || !__IN(typ->comp, 0x0c, 32)) { OPB_err(132); } else { x->obj = NIL; @@ -2098,7 +2098,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) case 18: if (OPB_NotVar(x)) { OPB_err(112); - } else if ((__IN(x->typ->comp, 0x0c) && x->typ->BaseTyp->form == 3)) { + } else if ((__IN(x->typ->comp, 0x0c, 32) && x->typ->BaseTyp->form == 3)) { if (x->readonly) { OPB_err(76); } @@ -2172,7 +2172,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) case 24: case 25: case 26: case 27: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x18ff)) { + } else if (__IN(f, 0x18ff, 32)) { if (fctno == 24 || fctno == 26) { if (OPB_NotVar(x)) { OPB_err(112); @@ -2198,7 +2198,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) p->typ = OPT_booltyp; break; case 29: - if (((x->class == 8 || x->class == 9) || __IN(f, 0x0501)) || x->typ->comp == 3) { + if (((x->class == 8 || x->class == 9) || __IN(f, 0x0501, 32)) || x->typ->comp == 3) { OPB_err(126); } if ((x->class != 7 && x->typ->size < p->typ->size)) { @@ -2230,7 +2230,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) OPB_err(126); } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x0810) && x->typ->size == OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x0810, 32) && x->typ->size == OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } @@ -2384,12 +2384,12 @@ static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpa ftyp = ftyp->BaseTyp; atyp = atyp->BaseTyp; if ((fvarpar && ftyp == OPT_bytetyp)) { - if (!__IN(f, 0x0c) || !((__IN(atyp->form, 0x1e) && atyp->size == 1))) { - if (__IN(18, OPM_opt)) { + if (!__IN(f, 0x0c, 32) || !((__IN(atyp->form, 0x1e, 32) && atyp->size == 1))) { + if (__IN(18, OPM_opt, 32)) { OPB_err(-301); } } - } else if (__IN(f, 0x0c)) { + } else if (__IN(f, 0x0c, 32)) { if (ftyp->comp == 3) { OPB_DynArrParCheck(ftyp, atyp, fvarpar); } else if (ftyp != atyp) { @@ -2428,7 +2428,7 @@ static void OPB_CheckReceiver (OPT_Node *x, OPT_Object fp) void OPB_PrepCall (OPT_Node *x, OPT_Object *fpar) { - if (((*x)->obj != NIL && __IN((*x)->obj->mode, 0x22c0))) { + if (((*x)->obj != NIL && __IN((*x)->obj->mode, 0x22c0, 32))) { *fpar = (*x)->obj->link; if ((*x)->obj->mode == 13) { OPB_CheckReceiver(&(*x)->left, *fpar); @@ -2467,7 +2467,7 @@ void OPB_Param (OPT_Node ap, OPT_Object fp) OPB_err(111); } } else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 11)) { - } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x1e) && ap->typ->size == 1)))))) { + } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x1e, 32) && ap->typ->size == 1)))))) { OPB_err(123); } else if ((fp->typ->form == 11 && ap->class == 5)) { OPB_err(123); @@ -2494,7 +2494,7 @@ void OPB_StaticLink (int8 dlev) scope = OPT_topScope; while (dlev > 0) { dlev -= 1; - scope->link->conval->setval |= __SETOF(3); + scope->link->conval->setval |= __SETOF(3,32); scope = scope->left; } } @@ -2589,7 +2589,7 @@ void OPB_Assign (OPT_Node *x, OPT_Node y) y->conval->intval = 0; OPB_Index(&*x, OPB_NewIntConst(0)); } - if ((((((__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp == OPT_chartyp)) && __IN(y->typ->comp, 0x0c))) && y->typ->BaseTyp == OPT_chartyp)) { + if ((((((__IN((*x)->typ->comp, 0x0c, 32) && (*x)->typ->BaseTyp == OPT_chartyp)) && __IN(y->typ->comp, 0x0c, 32))) && y->typ->BaseTyp == OPT_chartyp)) { subcl = 18; } else { subcl = 0; diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index 96866563..f9bf31fe 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 452c85d2..1fecd152 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -93,9 +93,9 @@ static BOOLEAN OPC_Undefined (OPT_Object obj); void OPC_Init (void) { OPC_indentLevel = 0; - OPC_ptrinit = __IN(5, OPM_opt); + OPC_ptrinit = __IN(5, OPM_opt, 32); OPC_mainprog = OPM_mainProg || OPM_mainLinkStat; - OPC_ansi = __IN(6, OPM_opt); + OPC_ansi = __IN(6, OPM_opt, 32); if (OPC_ansi) { __MOVE("__init(void)", OPC_BodyNameExt, 13); } else { @@ -196,7 +196,7 @@ void OPC_Ident (OPT_Object obj) int16 mode, level, h; mode = obj->mode; level = obj->mnolev; - if ((__IN(mode, 0x62) && level > 0) || __IN(mode, 0x14)) { + if ((__IN(mode, 0x62, 32) && level > 0) || __IN(mode, 0x14, 32)) { OPM_WriteStringVar((void*)obj->name, 256); h = OPC_PerfectHash((void*)obj->name, 256); if (OPC_hashtab[__X(h, 105)] >= 0) { @@ -236,7 +236,7 @@ static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause) int16 pointers; *openClause = 0; if (((typ->strobj == NIL || typ->strobj->name[0] == 0x00) && typ->comp != 4)) { - if (__IN(typ->comp, 0x0c)) { + if (__IN(typ->comp, 0x0c, 32)) { OPC_Stars(typ->BaseTyp, &*openClause); *openClause = typ->comp == 2; } else if (typ->form == 12) { @@ -293,7 +293,7 @@ static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef) break; } else if ((form == 11 && typ->BaseTyp->comp != 3)) { openClause = 1; - } else if (form == 12 || __IN(comp, 0x0c)) { + } else if (form == 12 || __IN(comp, 0x0c, 32)) { if (openClause) { OPM_Write(')'); openClause = 0; @@ -708,7 +708,7 @@ static void OPC_DefineType (OPT_Struct str) if (str->BaseTyp->comp != 4) { OPC_DefineType(str->BaseTyp); } - } else if (__IN(str->comp, 0x0c)) { + } else if (__IN(str->comp, 0x0c, 32)) { OPC_DefineType(str->BaseTyp); } else if (str->form == 12) { if (str->BaseTyp != OPT_notyp) { @@ -1019,7 +1019,7 @@ static void OPC_IdentList (OPT_Object obj, int16 vis) base = NIL; first = 1; while ((obj != NIL && obj->mode != 13)) { - if ((__IN(vis, 0x05) || (vis == 1 && obj->vis != 0)) || (vis == 3 && !obj->leaf)) { + if ((__IN(vis, 0x05, 32) || (vis == 1 && obj->vis != 0)) || (vis == 3 && !obj->leaf)) { if (obj->typ != base || (int16)obj->vis != lastvis) { if (!first) { OPC_EndStat(); @@ -1144,7 +1144,7 @@ static void OPC_ProcPredefs (OPT_Object obj, int8 vis) { if (obj != NIL) { OPC_ProcPredefs(obj->left, vis); - if ((((__IN(obj->mode, 0xc0) && obj->vis >= vis)) && (obj->history != 4 || obj->mode == 6))) { + if ((((__IN(obj->mode, 0xc0, 32) && obj->vis >= vis)) && (obj->history != 4 || obj->mode == 6))) { if (vis == 1) { OPM_WriteString((CHAR*)"import ", 8); } else if (obj->vis == 0) { @@ -1238,7 +1238,7 @@ static void OPC_GenHeaderMsg (void) OPM_Write(' '); i = 0; while (i <= 31) { - if (__IN(i, OPM_glbopt)) { + if (__IN(i, OPM_glbopt, 32)) { switch (i) { case 0: OPM_Write('x'); @@ -1600,7 +1600,7 @@ void OPC_EnterProc (OPT_Object proc) } var = proc->link; while (var != NIL) { - if ((((__IN(var->typ->comp, 0x0c) && var->mode == 1)) && var->typ->sysflag == 0)) { + if ((((__IN(var->typ->comp, 0x0c, 32) && var->mode == 1)) && var->typ->sysflag == 0)) { OPC_BegStat(); if (var->typ->comp == 2) { OPM_WriteString((CHAR*)"__DUPARR(", 10); @@ -1648,7 +1648,7 @@ void OPC_EnterProc (OPT_Object proc) OPM_Write('.'); OPC_Ident(var); OPM_WriteString((CHAR*)" = ", 4); - if (__IN(var->typ->comp, 0x0c)) { + if (__IN(var->typ->comp, 0x0c, 32)) { OPM_WriteString((CHAR*)"(void*)", 8); } else if (var->mode != 2) { OPM_Write('&'); @@ -2006,7 +2006,7 @@ void OPC_Constant (OPT_Const con, int16 form) do { i -= 1; hex = __ASHL(hex, 1); - if (__IN(i, s)) { + if (__IN(i, s, 32)) { hex += 1; } } while (!(__MASK(i, -8) == 0)); diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index 81e8362d..b8f44225 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 671a9d8f..6af53f8c 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -288,15 +288,15 @@ void OPM_InitOptions (void) s[0] = 0x00; Platform_GetArg(OPM_S, (void*)s, 256); } - OPM_dontAsm = __IN(13, OPM_opt); - OPM_dontLink = __IN(14, OPM_opt); - OPM_mainProg = __IN(10, OPM_opt); - OPM_mainLinkStat = __IN(15, OPM_opt); - OPM_notColorOutput = __IN(16, OPM_opt); - OPM_forceNewSym = __IN(17, OPM_opt); - OPM_Verbose = __IN(18, OPM_opt); + OPM_dontAsm = __IN(13, OPM_opt, 32); + OPM_dontLink = __IN(14, OPM_opt, 32); + OPM_mainProg = __IN(10, OPM_opt, 32); + OPM_mainLinkStat = __IN(15, OPM_opt, 32); + OPM_notColorOutput = __IN(16, OPM_opt, 32); + OPM_forceNewSym = __IN(17, OPM_opt, 32); + OPM_Verbose = __IN(18, OPM_opt, 32); if (OPM_mainLinkStat) { - OPM_glbopt |= __SETOF(10); + OPM_glbopt |= __SETOF(10,32); } OPM_GetProperties(); } @@ -773,7 +773,7 @@ void OPM_SymWLReal (LONGREAL lr) void OPM_RegisterNewSym (void) { - if (__STRCMP(OPM_modName, "SYSTEM") != 0 || __IN(10, OPM_opt)) { + if (__STRCMP(OPM_modName, "SYSTEM") != 0 || __IN(10, OPM_opt, 32)) { Files_Register(OPM_newSFile); } } @@ -972,10 +972,10 @@ void OPM_CloseFiles (void) } if (OPM_noerr) { if (__STRCMP(OPM_modName, "SYSTEM") == 0) { - if (!__IN(10, OPM_opt)) { + if (!__IN(10, OPM_opt, 32)) { Files_Register(OPM_BFile); } - } else if (!__IN(10, OPM_opt)) { + } else if (!__IN(10, OPM_opt, 32)) { OPM_Append(&OPM_R[2], Files_Rider__typ, OPM_HFile); Files_Register(OPM_HIFile); Files_Register(OPM_BFile); diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index 0d9bcdeb..67edafa5 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index de0afa51..d8dee08e 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -94,7 +94,7 @@ static void OPP_qualident (OPT_Object *id) obj->adr = 0; } else { lev = obj->mnolev; - if ((__IN(obj->mode, 0x06) && lev != OPP_level)) { + if ((__IN(obj->mode, 0x06, 32) && lev != OPP_level)) { obj->leaf = 0; if (lev > 0) { OPB_StaticLink(OPP_level - lev); @@ -325,7 +325,7 @@ static void OPP_PointerType (OPT_Struct *typ) } else { OPP_qualident(&id); if (id->mode == 5) { - if (__IN(id->typ->comp, 0x1c)) { + if (__IN(id->typ->comp, 0x1c, 32)) { (*typ)->BaseTyp = id->typ; } else { (*typ)->BaseTyp = OPT_undftyp; @@ -338,7 +338,7 @@ static void OPP_PointerType (OPT_Struct *typ) } } else { OPP_Type(&(*typ)->BaseTyp, &OPT_notyp); - if (!__IN((*typ)->BaseTyp->comp, 0x1c)) { + if (!__IN((*typ)->BaseTyp->comp, 0x1c, 32)) { (*typ)->BaseTyp = OPT_undftyp; OPP_err(57); } @@ -966,7 +966,7 @@ static void GetCode__19 (void) } } } - (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1); + (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1,32); } static void GetParams__21 (void) @@ -998,7 +998,7 @@ static void Body__17 (void) OPT_Node procdec = NIL, statseq = NIL; int32 c; c = OPM_errpos; - (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1); + (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1,32); OPP_CheckSym(39); OPP_Block(&procdec, &statseq); OPB_Enter(&procdec, statseq, *ProcedureDeclaration__16_s->proc); @@ -1041,7 +1041,7 @@ static void TProcDecl__23 (void) if ((*ProcedureDeclaration__16_s->fwd != NIL && (*ProcedureDeclaration__16_s->fwd)->mnolev != OPP_level)) { *ProcedureDeclaration__16_s->fwd = NIL; } - if ((((*ProcedureDeclaration__16_s->fwd != NIL && (*ProcedureDeclaration__16_s->fwd)->mode == 13)) && !__IN(1, (*ProcedureDeclaration__16_s->fwd)->conval->setval))) { + if ((((*ProcedureDeclaration__16_s->fwd != NIL && (*ProcedureDeclaration__16_s->fwd)->mode == 13)) && !__IN(1, (*ProcedureDeclaration__16_s->fwd)->conval->setval, 32))) { *ProcedureDeclaration__16_s->proc = OPT_NewObj(); (*ProcedureDeclaration__16_s->proc)->leaf = 1; if ((*ProcedureDeclaration__16_s->fwd)->vis != *ProcedureDeclaration__16_s->vis) { @@ -1075,7 +1075,7 @@ static void TProcDecl__23 (void) if ((((((baseProc->vis == 1 && (*ProcedureDeclaration__16_s->proc)->vis == 0)) && recTyp->strobj != NIL)) && recTyp->strobj->vis == 1)) { OPP_err(109); } - (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(2); + (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(2,32); } if (!*ProcedureDeclaration__16_s->forward) { Body__17(); @@ -1118,7 +1118,7 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) } else { OPP_err(38); } - if ((__IN(mode, 0x0600) && !OPT_SYSimported)) { + if ((__IN(mode, 0x0600, 32) && !OPT_SYSimported)) { OPP_err(135); } OPS_Get(&OPP_sym); @@ -1135,7 +1135,7 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) if ((fwd != NIL && (fwd->mnolev != OPP_level || fwd->mode == 8))) { fwd = NIL; } - if ((((fwd != NIL && __IN(fwd->mode, 0xc0))) && !__IN(1, fwd->conval->setval))) { + if ((((fwd != NIL && __IN(fwd->mode, 0xc0, 32))) && !__IN(1, fwd->conval->setval, 32))) { proc = OPT_NewObj(); proc->leaf = 1; if (fwd->vis != vis) { @@ -1178,7 +1178,7 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int16 *n, OPP for (;;) { OPP_ConstExpression(&x); f = x->typ->form; - if (__IN(f, 0x18)) { + if (__IN(f, 0x18, 32)) { xval = x->conval->intval; } else { OPP_err(61); @@ -1258,7 +1258,7 @@ static void CasePart__31 (OPT_Node *x) *StatSeq__30_s->pos = OPM_errpos; if ((*x)->class == 8 || (*x)->class == 9) { OPP_err(126); - } else if (!__IN((*x)->typ->form, 0x18)) { + } else if (!__IN((*x)->typ->form, 0x18, 32)) { OPP_err(125); } OPP_CheckSym(25); @@ -1675,7 +1675,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) if (obj->typ->strobj == NIL) { obj->typ->strobj = obj; } - if (__IN(obj->typ->comp, 0x1c)) { + if (__IN(obj->typ->comp, 0x1c, 32)) { i = 0; while (i < OPP_nofFwdPtr) { typ = OPP_FwdPtr[__X(i, 64)]; diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index 2d3ebd77..9ddded2f 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index e6e99c02..cd51e788 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index 99448598..658c87db 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 4a645e7a..ab44584b 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -274,9 +274,9 @@ void OPT_Init (OPS_Name name, SET opt) __COPY(name, OPT_topScope->name, 256); OPT_GlbMod[0] = OPT_topScope; OPT_nofGmod = 1; - OPT_newsf = __IN(4, opt); - OPT_findpc = __IN(8, opt); - OPT_extsf = OPT_newsf || __IN(9, opt); + OPT_newsf = __IN(4, opt, 32); + OPT_findpc = __IN(8, opt, 32); + OPT_extsf = OPT_newsf || __IN(9, opt, 32); OPT_sfpresent = 1; } @@ -609,7 +609,7 @@ void OPT_FPrintStr (OPT_Struct typ) pvfp = pbfp; } } else if (f == 12) { - } else if (__IN(c, 0x0c)) { + } else if (__IN(c, 0x0c, 32)) { OPT_FPrintStr(btyp); OPM_FPrint(&pbfp, btyp->pvfp); pvfp = pbfp; @@ -680,7 +680,7 @@ void OPT_FPrintObj (OPT_Object obj) OPM_FPrint(&fprint, obj->vis); OPT_FPrintStr(obj->typ); OPM_FPrint(&fprint, obj->typ->pbfp); - } else if (__IN(obj->mode, 0x0480)) { + } else if (__IN(obj->mode, 0x0480, 32)) { OPT_FPrintSign(&fprint, obj->typ, obj->link); } else if (obj->mode == 9) { OPT_FPrintSign(&fprint, obj->typ, obj->link); @@ -1573,7 +1573,7 @@ static void OPT_OutObj (OPT_Object obj) OPT_ConstExt ext = NIL; if (obj != NIL) { OPT_OutObj(obj->left); - if (__IN(obj->mode, 0x06ea)) { + if (__IN(obj->mode, 0x06ea, 32)) { if (obj->history == 4) { OPT_FPrintErr(obj, 250); } else if (obj->vis != 0) { diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index 93975ea1..978ae16b 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index b264d44e..c20aef90 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -130,10 +130,10 @@ void OPV_Init (void) OPV_stamp = 0; OPV_recno = 0; OPV_nofExitLabels = 0; - OPV_assert = __IN(7, OPM_opt); - OPV_inxchk = __IN(0, OPM_opt); - OPV_mainprog = __IN(10, OPM_opt); - OPV_ansi = __IN(6, OPM_opt); + OPV_assert = __IN(7, OPM_opt, 32); + OPV_inxchk = __IN(0, OPM_opt, 32); + OPV_mainprog = __IN(10, OPM_opt, 32); + OPV_ansi = __IN(6, OPM_opt, 32); } static void OPV_GetTProcNum (OPT_Object obj) @@ -150,7 +150,7 @@ static void OPV_GetTProcNum (OPT_Object obj) OPT_FindField(obj->name, typ->BaseTyp, &redef); if (redef != NIL) { obj->adr = __ASHL(__ASHR(redef->adr, 16), 16); - if (!__IN(2, obj->conval->setval)) { + if (!__IN(2, obj->conval->setval, 32)) { OPM_err(119); } } else { @@ -230,12 +230,12 @@ static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exporte OPV_TypSize(obj->typ); } if (!exported) { - if ((__IN(mode, 0x60) && obj->mnolev > 0)) { + if ((__IN(mode, 0x60, 32) && obj->mnolev > 0)) { OPV_Stamp(obj->name); } - if (__IN(mode, 0x26)) { + if (__IN(mode, 0x26, 32)) { obj->scope = outerScope; - } else if (__IN(mode, 0x26c0)) { + } else if (__IN(mode, 0x26c0, 32)) { if (obj->conval->setval == 0x0) { OPM_err(129); } @@ -289,7 +289,7 @@ static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp return _o_result; break; case 5: - if (__IN(3, OPM_opt)) { + if (__IN(3, OPM_opt, 32)) { _o_result = 10; return _o_result; } else { @@ -298,7 +298,7 @@ static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp } break; case 1: - if (__IN(comp, 0x0c)) { + if (__IN(comp, 0x0c, 32)) { _o_result = 10; return _o_result; } else { @@ -445,7 +445,7 @@ static BOOLEAN OPV_SideEffects (OPT_Node n) static void OPV_Entier (OPT_Node n, int16 prec) { - if (__IN(n->typ->form, 0x60)) { + if (__IN(n->typ->form, 0x60, 32)) { OPM_WriteString((CHAR*)"__ENTIER(", 10); OPV_expr(n, -1); OPM_Write(')'); @@ -471,9 +471,11 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int16 prec) if (to == 7) { OPM_WriteString((CHAR*)"__SETOF(", 9); OPV_Entier(n, -1); + OPM_WriteString((CHAR*)",", 2); + OPM_WriteInt(__ASHL(newtype->size, 3)); OPM_Write(')'); } else if (to == 4) { - if ((newtype->size < n->typ->size && __IN(2, OPM_opt))) { + if ((newtype->size < n->typ->size && __IN(2, OPM_opt, 32))) { OPM_WriteString((CHAR*)"__SHORT", 8); if (OPV_SideEffects(n)) { OPM_Write('F'); @@ -488,7 +490,7 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int16 prec) OPV_Entier(n, 9); } } else if (to == 3) { - if (__IN(2, OPM_opt)) { + if (__IN(2, OPM_opt, 32)) { OPM_WriteString((CHAR*)"__CHR", 6); if (OPV_SideEffects(n)) { OPM_Write('F'); @@ -511,7 +513,7 @@ static void OPV_TypeOf (OPT_Node n) OPM_WriteString((CHAR*)"__TYPEOF(", 10); OPV_expr(n, -1); OPM_Write(')'); - } else if (__IN(n->class, 0x15)) { + } else if (__IN(n->class, 0x15, 32)) { OPC_Andent(n->typ); OPM_WriteString((CHAR*)"__typ", 6); } else if (n->class == 3) { @@ -572,7 +574,7 @@ static void OPV_design (OPT_Node n, int16 prec) OPC_CompleteIdent(n->obj); break; case 1: - if (!__IN(comp, 0x0c)) { + if (!__IN(comp, 0x0c, 32)) { OPM_Write('*'); } OPC_CompleteIdent(n->obj); @@ -651,7 +653,7 @@ static void OPV_design (OPT_Node n, int16 prec) case 5: typ = n->typ; obj = n->left->obj; - if (__IN(3, OPM_opt)) { + if (__IN(3, OPM_opt, 32)) { if (typ->comp == 4) { OPM_WriteString((CHAR*)"__GUARDR(", 10); if ((int16)obj->mnolev != OPM_level) { @@ -690,7 +692,7 @@ static void OPV_design (OPT_Node n, int16 prec) } break; case 6: - if (__IN(3, OPM_opt)) { + if (__IN(3, OPM_opt, 32)) { if (n->left->class == 1) { OPM_WriteString((CHAR*)"__GUARDEQR(", 12); OPC_CompleteIdent(n->left->obj); @@ -749,7 +751,7 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) OPM_WriteString((CHAR*)"*)", 3); prec = 10; } - if (!__IN(n->typ->comp, 0x0c)) { + if (!__IN(n->typ->comp, 0x0c, 32)) { if (mode == 2) { if ((OPV_ansi && typ != n->typ)) { OPM_WriteString((CHAR*)"(void*)", 8); @@ -757,13 +759,13 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) OPM_Write('&'); prec = 9; } else if (OPV_ansi) { - if ((__IN(comp, 0x0c) && n->class == 7)) { + if ((__IN(comp, 0x0c, 32) && n->class == 7)) { OPM_WriteString((CHAR*)"(CHAR*)", 8); } else if ((((form == 11 && typ != n->typ)) && n->typ != OPT_niltyp)) { OPM_WriteString((CHAR*)"(void*)", 8); } } else { - if ((__IN(form, 0x60) && n->typ->form == 4)) { + if ((__IN(form, 0x60, 32) && n->typ->form == 4)) { OPM_WriteString((CHAR*)"(double)", 9); prec = 9; } else if (form == 4) { @@ -846,7 +848,7 @@ static void OPV_expr (OPT_Node n, int16 prec) l = n->left; r = n->right; exprPrec = OPV_Precedence(class, subclass, form, n->typ->comp); - if ((exprPrec <= prec && __IN(class, 0x3ce0))) { + if ((exprPrec <= prec && __IN(class, 0x3ce0, 32))) { OPM_Write('('); } switch (class) { @@ -858,6 +860,8 @@ static void OPV_expr (OPT_Node n, int16 prec) OPV_expr(l, -1); OPM_WriteString((CHAR*)", ", 3); OPV_expr(r, -1); + OPM_WriteString((CHAR*)", ", 3); + OPM_WriteInt(__ASHL(n->typ->size, 3)); OPM_Write(')'); break; case 11: @@ -924,18 +928,18 @@ static void OPV_expr (OPT_Node n, int16 prec) if (l->class == 1) { OPC_CompleteIdent(l->obj); } else { - if ((l->typ->form != 8 && !__IN(l->typ->comp, 0x0c))) { + if ((l->typ->form != 8 && !__IN(l->typ->comp, 0x0c, 32))) { OPM_Write('&'); } OPV_expr(l, exprPrec); } break; case 29: - if (!__IN(l->class, 0x17) || (((__IN(n->typ->form, 0x1890) && __IN(l->typ->form, 0x1890))) && n->typ->size == l->typ->size)) { + if (!__IN(l->class, 0x17, 32) || (((__IN(n->typ->form, 0x1890, 32) && __IN(l->typ->form, 0x1890, 32))) && n->typ->size == l->typ->size)) { OPM_Write('('); OPC_Ident(n->typ->strobj); OPM_Write(')'); - if (__IN(n->typ->form, 0x1800) || __IN(l->typ->form, 0x1800)) { + if (__IN(n->typ->form, 0x1800, 32) || __IN(l->typ->form, 0x1800, 32)) { OPM_WriteString((CHAR*)"(address)", 10); } OPV_expr(l, exprPrec); @@ -1032,20 +1036,24 @@ static void OPV_expr (OPT_Node n, int16 prec) } OPV_expr(l, -1); OPM_WriteString((CHAR*)", ", 3); - if ((((__IN(subclass, 0x18020000) && r->class == 7)) && r->conval->intval < 0)) { + if ((((__IN(subclass, 0x18020000, 32) && r->class == 7)) && r->conval->intval < 0)) { OPM_WriteInt(-r->conval->intval); } else { OPV_expr(r, -1); } - if (__IN(subclass, 0x18000000)) { + if (__IN(subclass, 0x18008000, 32)) { OPM_WriteString((CHAR*)", ", 3); - OPM_WriteInt(__ASHL(l->typ->size, 3)); + if (subclass == 15) { + OPM_WriteInt(__ASHL(r->typ->size, 3)); + } else { + OPM_WriteInt(__ASHL(l->typ->size, 3)); + } } OPM_Write(')'); break; case 9: case 10: case 11: case 12: case 13: case 14: - if (__IN(l->typ->form, 0x2100)) { + if (__IN(l->typ->form, 0x2100, 32)) { OPM_WriteString((CHAR*)"__STRCMP(", 10); OPV_expr(l, -1); OPM_WriteString((CHAR*)", ", 3); @@ -1142,7 +1150,7 @@ static void OPV_expr (OPT_Node n, int16 prec) OPV_design(n, prec); break; } - if ((exprPrec <= prec && __IN(class, 0x3ca0))) { + if ((exprPrec <= prec && __IN(class, 0x3ca0, 32))) { OPM_Write(')'); } } @@ -1432,7 +1440,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPM_WriteString((CHAR*)", ", 3); OPC_Andent(n->left->typ->BaseTyp); OPM_WriteString((CHAR*)")", 2); - } else if (__IN(n->left->typ->BaseTyp->comp, 0x0c)) { + } else if (__IN(n->left->typ->BaseTyp->comp, 0x0c, 32)) { OPV_NewArr(n->left, n->right); } break; @@ -1446,6 +1454,8 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPC_SetInclude(n->subcl == 16); OPM_WriteString((CHAR*)"__SETOF(", 9); OPV_expr(n->right, -1); + OPM_WriteString((CHAR*)",", 2); + OPM_WriteInt(__ASHL(n->left->typ->size, 3)); OPM_Write(')'); break; case 18: @@ -1623,7 +1633,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPM_LogWLn(); break; } - if (!__IN(n->class, 0x09744000)) { + if (!__IN(n->class, 0x09744000, 32)) { OPC_EndStat(); } n = n->link; diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index 3b43e61e..ea1f9aaa 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 06824f8e..8740b5b0 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index a2301fff..ce51df39 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index e209af08..a64c2d13 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index 2779fc88..d7981245 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index 387345ab..67c0f055 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index fe90bd09..6f4f1073 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index c37a4a2c..4d12f6cb 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -578,13 +578,13 @@ void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, SET sel, Texts_Fonts T->cache = c; T->corg = co; while (un != vn) { - if ((__IN(0, sel) && fnt != NIL)) { + if ((__IN(0, sel, 32) && fnt != NIL)) { un->fnt = fnt; } - if (__IN(1, sel)) { + if (__IN(1, sel, 32)) { un->col = col; } - if (__IN(2, sel)) { + if (__IN(2, sel, 32)) { un->voff = voff; } Texts_Merge(T, u, &un); diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index c6ee484f..2b694f6c 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/Vishap.c b/bootstrap/windows-48/Vishap.c index fb1c1662..2efce68f 100644 --- a/bootstrap/windows-48/Vishap.c +++ b/bootstrap/windows-48/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkamSf */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/errors.c b/bootstrap/windows-48/errors.c index 7feed8e7..6f8e3d33 100644 --- a/bootstrap/windows-48/errors.c +++ b/bootstrap/windows-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/errors.h b/bootstrap/windows-48/errors.h index 4fe434e1..58286fd8 100644 --- a/bootstrap/windows-48/errors.h +++ b/bootstrap/windows-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index 0afff1f0..bbecb9f2 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index 5d996dae..8a0d60be 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/vt100.c b/bootstrap/windows-48/vt100.c index 8a5286ec..b5422c40 100644 --- a/bootstrap/windows-48/vt100.c +++ b/bootstrap/windows-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/vt100.h b/bootstrap/windows-48/vt100.h index c09b4c71..85494a63 100644 --- a/bootstrap/windows-48/vt100.h +++ b/bootstrap/windows-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index b023c21b..f3f2e52d 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/12] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/14] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index 3ce4467e..2b7bdf82 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Console.c b/bootstrap/windows-88/Console.c index 1190773d..f1d67d28 100644 --- a/bootstrap/windows-88/Console.c +++ b/bootstrap/windows-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Console.h b/bootstrap/windows-88/Console.h index 27d906ad..8336a3d0 100644 --- a/bootstrap/windows-88/Console.h +++ b/bootstrap/windows-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index dbe8d119..6c40d595 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 8a4fb7c5..d3432e7a 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index 67044d79..626812cb 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tskSfF */ #define INTEGER int32 #define LONGINT int64 @@ -82,6 +82,7 @@ export LONGINT *Heap__1__typ; static void Heap_CheckFin (void); static void Heap_ExtendHeap (address blksz); export void Heap_FINALL (void); +static address Heap_FetchAddress (address pointer); static void Heap_Finalize (void); export void Heap_GC (BOOLEAN markStack); static void Heap_HeapSort (address n, address *a, LONGINT a__len); @@ -106,7 +107,6 @@ export void Heap_Unlock (void); extern void *Heap__init(); extern address Platform_MainStackFrame; extern address Platform_OSAllocate(address size); -#define Heap_FetchAddress(pointer) (address)(*((void**)((address)pointer))) #define Heap_HeapModuleInit() Heap__init() #define Heap_OSAllocate(size) Platform_OSAllocate(size) #define Heap_PlatformHalt(code) Platform_Halt(code) @@ -188,6 +188,15 @@ static address Heap_NewChunk (address blksz) return _o_result; } +static address Heap_FetchAddress (address pointer) +{ + address _o_result; + address r; + __GET(pointer, r, address); + _o_result = r; + return _o_result; +} + static void Heap_ExtendHeap (address blksz) { address size, chnk, j, next; diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index 584661bc..08afe43e 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 547909bb..3a48e24a 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index 2666971d..3ebde4f3 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index f048dc85..883d2559 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -345,7 +345,7 @@ void OPB_Index (OPT_Node *x, OPT_Node y) f = y->typ->form; if ((*x)->class >= 7) { OPB_err(79); - } else if (f != 4 || __IN(y->class, 0x0300)) { + } else if (f != 4 || __IN(y->class, 0x0300, 64)) { OPB_err(80); y->typ = OPT_inttyp; } @@ -372,7 +372,7 @@ void OPB_Field (OPT_Node *x, OPT_Object y) if ((*x)->class >= 7) { OPB_err(77); } - if ((y != NIL && __IN(y->mode, 0x2010))) { + if ((y != NIL && __IN(y->mode, 0x2010, 64))) { OPB_BindNodes(2, y->typ, &*x, NIL); (*x)->obj = y; (*x)->readonly = (*x)->left->readonly || (y->vis == 2 && y->mnolev < 0); @@ -476,7 +476,7 @@ void OPB_In (OPT_Node *x, OPT_Node y) if (k < 0 || k > (int64)OPM_MaxSet) { OPB_err(202); } else if (y->class == 7) { - (*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval)); + (*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval, 64)); (*x)->obj = NIL; } else { OPB_BindNodes(12, OPT_booltyp, &*x, y); @@ -572,12 +572,12 @@ void OPB_MOp (int8 op, OPT_Node *x) } break; case 6: - if (!__IN(f, 0x70)) { + if (!__IN(f, 0x70, 64)) { OPB_err(96); } break; case 7: - if (__IN(f, 0xf0)) { + if (__IN(f, 0xf0, 64)) { if (z->class == 7) { if (f == 4) { if (z->conval->intval == (-9223372036854775807-1)) { @@ -586,7 +586,7 @@ void OPB_MOp (int8 op, OPT_Node *x) z->conval->intval = -z->conval->intval; OPB_SetIntType(z); } - } else if (__IN(f, 0x60)) { + } else if (__IN(f, 0x60, 64)) { z->conval->realval = -z->conval->realval; } else { z->conval->setval = ~z->conval->setval; @@ -600,7 +600,7 @@ void OPB_MOp (int8 op, OPT_Node *x) } break; case 21: - if (__IN(f, 0x70)) { + if (__IN(f, 0x70, 64)) { if (z->class == 7) { if (f == 4) { if (z->conval->intval == (-9223372036854775807-1)) { @@ -747,7 +747,7 @@ void OPB_CheckParameters (OPT_Object fp, OPT_Object ap, BOOLEAN checkNames) static void OPB_CheckProc (OPT_Struct x, OPT_Object y) { - if (__IN(y->mode, 0x04c0)) { + if (__IN(y->mode, 0x04c0, 64)) { if (y->mode == 6) { if (y->mnolev == 0) { y->mode = 7; @@ -923,7 +923,7 @@ static void OPB_ConstOp (int32 op, OPT_Node x, OPT_Node y) } break; case 9: - if (!__IN(g, 0x1800)) { + if (!__IN(g, 0x1800, 64)) { OPB_err(100); } break; @@ -954,7 +954,7 @@ static void OPB_ConstOp (int32 op, OPT_Node x, OPT_Node y) } else { OPB_err(204); } - } else if (__IN(f, 0x60)) { + } else if (__IN(f, 0x60, 64)) { temp = __ABS(yval->realval) <= (LONGREAL)1; if (temp || __ABS(xval->realval) <= 1.79769296342094e+308 / (LONGREAL)__ABS(yval->realval)) { xval->realval = xval->realval * yval->realval; @@ -978,7 +978,7 @@ static void OPB_ConstOp (int32 op, OPT_Node x, OPT_Node y) xval->realval = (LONGREAL)1; } x->typ = OPT_realtyp; - } else if (__IN(f, 0x60)) { + } else if (__IN(f, 0x60, 64)) { temp = __ABS(yval->realval) >= (LONGREAL)1; if (temp || __ABS(xval->realval) <= 1.79769296342094e+308 * __ABS(yval->realval)) { xval->realval = xval->realval / yval->realval; @@ -1032,7 +1032,7 @@ static void OPB_ConstOp (int32 op, OPT_Node x, OPT_Node y) } else { OPB_err(206); } - } else if (__IN(f, 0x60)) { + } else if (__IN(f, 0x60, 64)) { temp = (yval->realval >= (LONGREAL)0 && xval->realval <= 1.79769296342094e+308 - yval->realval); if (temp || (yval->realval < (LONGREAL)0 && xval->realval >= -1.79769296342094e+308 - yval->realval)) { xval->realval = xval->realval + yval->realval; @@ -1054,7 +1054,7 @@ static void OPB_ConstOp (int32 op, OPT_Node x, OPT_Node y) } else { OPB_err(207); } - } else if (__IN(f, 0x60)) { + } else if (__IN(f, 0x60, 64)) { temp = (yval->realval >= (LONGREAL)0 && xval->realval >= -1.79769296342094e+308 + yval->realval); if (temp || (yval->realval < (LONGREAL)0 && xval->realval <= 1.79769296342094e+308 + yval->realval)) { xval->realval = xval->realval - yval->realval; @@ -1082,28 +1082,28 @@ static void OPB_ConstOp (int32 op, OPT_Node x, OPT_Node y) xval->intval = OPB_BoolToInt(ConstCmp__14() != 9); break; case 11: - if (__IN(f, 0x0a84)) { + if (__IN(f, 0x0a84, 64)) { OPB_err(108); } else { xval->intval = OPB_BoolToInt(ConstCmp__14() == 11); } break; case 12: - if (__IN(f, 0x0a84)) { + if (__IN(f, 0x0a84, 64)) { OPB_err(108); } else { xval->intval = OPB_BoolToInt(ConstCmp__14() != 13); } break; case 13: - if (__IN(f, 0x0a84)) { + if (__IN(f, 0x0a84, 64)) { OPB_err(108); } else { xval->intval = OPB_BoolToInt(ConstCmp__14() == 13); } break; case 14: - if (__IN(f, 0x0a84)) { + if (__IN(f, 0x0a84, 64)) { OPB_err(108); } else { xval->intval = OPB_BoolToInt(ConstCmp__14() != 11); @@ -1136,7 +1136,7 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) (*x)->conval->intval = 1; } } - } else if (__IN(g, 0x60)) { + } else if (__IN(g, 0x60, 64)) { (*x)->conval->realval = (*x)->conval->intval; (*x)->conval->intval = -1; } else { @@ -1145,8 +1145,8 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) OPB_err(220); } } - } else if (__IN(f, 0x60)) { - if (__IN(g, 0x60)) { + } else if (__IN(f, 0x60, 64)) { + if (__IN(g, 0x60, 64)) { OPB_CheckRealType(g, 203, (*x)->conval); } else { r = (*x)->conval->realval; @@ -1195,8 +1195,8 @@ static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) { BOOLEAN _o_result; BOOLEAN ok, xCharArr, yCharArr; - xCharArr = (__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp->form == 3) || *Op__38_s->f == 8; - yCharArr = (__IN((*y)->typ->comp, 0x0c) && (*y)->typ->BaseTyp->form == 3) || *Op__38_s->g == 8; + xCharArr = (__IN((*x)->typ->comp, 0x0c, 64) && (*x)->typ->BaseTyp->form == 3) || *Op__38_s->f == 8; + yCharArr = (__IN((*y)->typ->comp, 0x0c, 64) && (*y)->typ->BaseTyp->form == 3) || *Op__38_s->g == 8; if ((((xCharArr && *Op__38_s->g == 3)) && (*y)->class == 7)) { OPB_CharToString(*y); *Op__38_s->g = 8; @@ -1255,7 +1255,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) case 4: if ((g == 4 && y->typ->size < z->typ->size)) { OPB_Convert(&y, z->typ); - } else if (__IN(g, 0x70)) { + } else if (__IN(g, 0x70, 64)) { OPB_Convert(&z, y->typ); } else { OPB_err(100); @@ -1264,23 +1264,23 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) case 5: if (g == 4) { OPB_Convert(&y, z->typ); - } else if (__IN(g, 0x60)) { + } else if (__IN(g, 0x60, 64)) { OPB_Convert(&z, y->typ); } else { OPB_err(100); } break; case 6: - if (__IN(g, 0x70)) { + if (__IN(g, 0x70, 64)) { OPB_Convert(&y, z->typ); - } else if (__IN(g, 0x60)) { + } else if (__IN(g, 0x60, 64)) { OPB_Convert(&y, z->typ); } else { OPB_err(100); } break; case 9: - if (!__IN(g, 0x1800)) { + if (!__IN(g, 0x1800, 64)) { OPB_err(100); } break; @@ -1341,7 +1341,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) y->obj = NIL; } } - } else if (!__IN(f, 0xe1)) { + } else if (!__IN(f, 0xe1, 64)) { OPB_err(105); typ = OPT_undftyp; } @@ -1357,7 +1357,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) OPB_Convert(&z, OPT_realtyp); OPB_Convert(&y, OPT_realtyp); typ = OPT_realtyp; - } else if (__IN(f, 0x60)) { + } else if (__IN(f, 0x60, 64)) { if ((y->class == 7 && y->conval->realval == (LONGREAL)0)) { OPB_err(205); } @@ -1424,7 +1424,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) } break; case 6: - if (!__IN(f, 0xf1)) { + if (!__IN(f, 0xf1, 64)) { OPB_err(105); typ = OPT_undftyp; } @@ -1443,7 +1443,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) } break; case 7: - if (!__IN(f, 0xf1)) { + if (!__IN(f, 0xf1, 64)) { OPB_err(106); typ = OPT_undftyp; } @@ -1467,7 +1467,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) } break; case 9: case 10: - if (__IN(f, 0x1aff) || strings__41(&z, &y)) { + if (__IN(f, 0x1aff, 64) || strings__41(&z, &y)) { typ = OPT_booltyp; } else { OPB_err(107); @@ -1476,7 +1476,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) NewOp__39(op, typ, &z, y); break; case 11: case 12: case 13: case 14: - if (__IN(f, 0x79) || strings__41(&z, &y)) { + if (__IN(f, 0x79, 64) || strings__41(&z, &y)) { typ = OPT_booltyp; } else { OPM_LogWLn(); @@ -1518,10 +1518,10 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y) } if (((*x)->class == 7 && y->class == 7)) { if (k <= l) { - (*x)->conval->setval = __SETRNG(k, l); + (*x)->conval->setval = __SETRNG(k, l, 64); } else { OPB_err(201); - (*x)->conval->setval = __SETRNG(l, k); + (*x)->conval->setval = __SETRNG(l, k, 64); } (*x)->obj = NIL; } else { @@ -1543,7 +1543,7 @@ void OPB_SetElem (OPT_Node *x) } else if ((*x)->class == 7) { k = (*x)->conval->intval; if ((0 <= k && k <= (int64)OPM_MaxSet)) { - (*x)->conval->setval = __SETOF(k); + (*x)->conval->setval = __SETOF(k,64); } else { OPB_err(202); } @@ -1588,7 +1588,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) case 0: case 8: break; case 1: - if (!((__IN(g, 0x1a) && y->size == 1))) { + if (!((__IN(g, 0x1a, 64) && y->size == 1))) { OPB_err(113); } break; @@ -1603,12 +1603,12 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) } break; case 5: - if (!__IN(g, 0x30)) { + if (!__IN(g, 0x30, 64)) { OPB_err(113); } break; case 6: - if (!__IN(g, 0x70)) { + if (!__IN(g, 0x70, 64)) { OPB_err(113); } break; @@ -1656,7 +1656,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) if (ynode->conval->intval2 > x->n) { OPB_err(114); } - } else if ((__IN(y->comp, 0x0c) && y->BaseTyp == OPT_chartyp)) { + } else if ((__IN(y->comp, 0x0c, 64) && y->BaseTyp == OPT_chartyp)) { } else { OPB_err(113); } @@ -1664,7 +1664,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPB_err(113); } } else if ((x->comp == 3 && x->BaseTyp == OPT_chartyp)) { - if ((__IN(y->comp, 0x0c) && y->BaseTyp == OPT_chartyp)) { + if ((__IN(y->comp, 0x0c, 64) && y->BaseTyp == OPT_chartyp)) { } else { OPB_err(113); } @@ -1691,7 +1691,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPM_LogWLn(); break; } - if ((((((ynode->class == 7 && g < f)) && __IN(g, 0x30))) && __IN(f, 0x70))) { + if ((((((ynode->class == 7 && g < f)) && __IN(g, 0x30, 64))) && __IN(f, 0x70, 64))) { OPB_Convert(&ynode, x); } } @@ -1729,7 +1729,7 @@ void OPB_StPar0 (OPT_Node *par0, int32 fctno) OPB_err(76); } f = x->typ->BaseTyp->comp; - if (__IN(f, 0x1c)) { + if (__IN(f, 0x1c, 64)) { if (f == 3) { typ = x->typ->BaseTyp; } @@ -1762,7 +1762,7 @@ void OPB_StPar0 (OPT_Node *par0, int32 fctno) case 5: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x60)) { + } else if (__IN(f, 0x60, 64)) { OPB_Convert(&x, OPT_linttyp); } else { OPB_err(111); @@ -1837,7 +1837,7 @@ void OPB_StPar0 (OPT_Node *par0, int32 fctno) case 9: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x11)) { + } else if (__IN(f, 0x11, 64)) { OPB_Convert(&x, OPT_chartyp); } else { OPB_err(111); @@ -1898,7 +1898,7 @@ void OPB_StPar0 (OPT_Node *par0, int32 fctno) } break; case 17: - if (!__IN(x->typ->comp, 0x0c)) { + if (!__IN(x->typ->comp, 0x0c, 64)) { OPB_err(131); } break; @@ -1909,7 +1909,7 @@ void OPB_StPar0 (OPT_Node *par0, int32 fctno) } if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (((!__IN(x->typ->comp, 0x0c) || x->typ->BaseTyp->form != 3) && f != 8)) { + } else if (((!__IN(x->typ->comp, 0x0c, 64) || x->typ->BaseTyp->form != 3) && f != 8)) { OPB_err(111); } break; @@ -1933,7 +1933,7 @@ void OPB_StPar0 (OPT_Node *par0, int32 fctno) if (x->class != 8) { OPB_err(110); x = OPB_NewIntConst(1); - } else if (__IN(f, 0x18fe) || __IN(x->typ->comp, 0x14)) { + } else if (__IN(f, 0x18fe, 64) || __IN(x->typ->comp, 0x14, 64)) { (*OPB_typSize)(x->typ); x->typ->pvused = 1; x = OPB_NewIntConst(x->typ->size); @@ -1948,7 +1948,7 @@ void OPB_StPar0 (OPT_Node *par0, int32 fctno) case 22: case 23: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (!__IN(f, 0x9a)) { + } else if (!__IN(f, 0x9a, 64)) { OPB_err(111); } break; @@ -1957,7 +1957,7 @@ void OPB_StPar0 (OPT_Node *par0, int32 fctno) OPB_err(126); } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x0810) && x->typ->size == (int64)OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x0810, 64) && x->typ->size == (int64)OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } @@ -1974,7 +1974,7 @@ void OPB_StPar0 (OPT_Node *par0, int32 fctno) case 29: if (x->class != 8) { OPB_err(110); - } else if (__IN(f, 0x0501) || x->typ->comp == 3) { + } else if (__IN(f, 0x0501, 64) || x->typ->comp == 3) { OPB_err(111); } break; @@ -2070,11 +2070,11 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) } else if (x->typ->size == 1) { L = (int32)x->conval->intval; typ = p->typ; - while ((L > 0 && __IN(typ->comp, 0x0c))) { + while ((L > 0 && __IN(typ->comp, 0x0c, 64))) { typ = typ->BaseTyp; L -= 1; } - if (L != 0 || !__IN(typ->comp, 0x0c)) { + if (L != 0 || !__IN(typ->comp, 0x0c, 64)) { OPB_err(132); } else { x->obj = NIL; @@ -2098,7 +2098,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) case 18: if (OPB_NotVar(x)) { OPB_err(112); - } else if ((__IN(x->typ->comp, 0x0c) && x->typ->BaseTyp->form == 3)) { + } else if ((__IN(x->typ->comp, 0x0c, 64) && x->typ->BaseTyp->form == 3)) { if (x->readonly) { OPB_err(76); } @@ -2172,7 +2172,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) case 24: case 25: case 26: case 27: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x18ff)) { + } else if (__IN(f, 0x18ff, 64)) { if (fctno == 24 || fctno == 26) { if (OPB_NotVar(x)) { OPB_err(112); @@ -2198,7 +2198,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) p->typ = OPT_booltyp; break; case 29: - if (((x->class == 8 || x->class == 9) || __IN(f, 0x0501)) || x->typ->comp == 3) { + if (((x->class == 8 || x->class == 9) || __IN(f, 0x0501, 64)) || x->typ->comp == 3) { OPB_err(126); } if ((x->class != 7 && x->typ->size < p->typ->size)) { @@ -2230,7 +2230,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) OPB_err(126); } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x0810) && x->typ->size == (int64)OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x0810, 64) && x->typ->size == (int64)OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } @@ -2384,12 +2384,12 @@ static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpa ftyp = ftyp->BaseTyp; atyp = atyp->BaseTyp; if ((fvarpar && ftyp == OPT_bytetyp)) { - if (!__IN(f, 0x0c) || !((__IN(atyp->form, 0x1e) && atyp->size == 1))) { - if (__IN(18, OPM_opt)) { + if (!__IN(f, 0x0c, 64) || !((__IN(atyp->form, 0x1e, 64) && atyp->size == 1))) { + if (__IN(18, OPM_opt, 64)) { OPB_err(-301); } } - } else if (__IN(f, 0x0c)) { + } else if (__IN(f, 0x0c, 64)) { if (ftyp->comp == 3) { OPB_DynArrParCheck(ftyp, atyp, fvarpar); } else if (ftyp != atyp) { @@ -2428,7 +2428,7 @@ static void OPB_CheckReceiver (OPT_Node *x, OPT_Object fp) void OPB_PrepCall (OPT_Node *x, OPT_Object *fpar) { - if (((*x)->obj != NIL && __IN((*x)->obj->mode, 0x22c0))) { + if (((*x)->obj != NIL && __IN((*x)->obj->mode, 0x22c0, 64))) { *fpar = (*x)->obj->link; if ((*x)->obj->mode == 13) { OPB_CheckReceiver(&(*x)->left, *fpar); @@ -2467,7 +2467,7 @@ void OPB_Param (OPT_Node ap, OPT_Object fp) OPB_err(111); } } else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 11)) { - } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x1e) && ap->typ->size == 1)))))) { + } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x1e, 64) && ap->typ->size == 1)))))) { OPB_err(123); } else if ((fp->typ->form == 11 && ap->class == 5)) { OPB_err(123); @@ -2494,7 +2494,7 @@ void OPB_StaticLink (int8 dlev) scope = OPT_topScope; while (dlev > 0) { dlev -= 1; - scope->link->conval->setval |= __SETOF(3); + scope->link->conval->setval |= __SETOF(3,64); scope = scope->left; } } @@ -2589,7 +2589,7 @@ void OPB_Assign (OPT_Node *x, OPT_Node y) y->conval->intval = 0; OPB_Index(&*x, OPB_NewIntConst(0)); } - if ((((((__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp == OPT_chartyp)) && __IN(y->typ->comp, 0x0c))) && y->typ->BaseTyp == OPT_chartyp)) { + if ((((((__IN((*x)->typ->comp, 0x0c, 64) && (*x)->typ->BaseTyp == OPT_chartyp)) && __IN(y->typ->comp, 0x0c, 64))) && y->typ->BaseTyp == OPT_chartyp)) { subcl = 18; } else { subcl = 0; diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index adefb869..35fb2186 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index aee5581c..ef8f41a1 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -93,9 +93,9 @@ static BOOLEAN OPC_Undefined (OPT_Object obj); void OPC_Init (void) { OPC_indentLevel = 0; - OPC_ptrinit = __IN(5, OPM_opt); + OPC_ptrinit = __IN(5, OPM_opt, 64); OPC_mainprog = OPM_mainProg || OPM_mainLinkStat; - OPC_ansi = __IN(6, OPM_opt); + OPC_ansi = __IN(6, OPM_opt, 64); if (OPC_ansi) { __MOVE("__init(void)", OPC_BodyNameExt, 13); } else { @@ -196,7 +196,7 @@ void OPC_Ident (OPT_Object obj) int32 mode, level, h; mode = obj->mode; level = obj->mnolev; - if ((__IN(mode, 0x62) && level > 0) || __IN(mode, 0x14)) { + if ((__IN(mode, 0x62, 64) && level > 0) || __IN(mode, 0x14, 64)) { OPM_WriteStringVar((void*)obj->name, 256); h = OPC_PerfectHash((void*)obj->name, 256); if (OPC_hashtab[__X(h, 105)] >= 0) { @@ -236,7 +236,7 @@ static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause) int32 pointers; *openClause = 0; if (((typ->strobj == NIL || typ->strobj->name[0] == 0x00) && typ->comp != 4)) { - if (__IN(typ->comp, 0x0c)) { + if (__IN(typ->comp, 0x0c, 64)) { OPC_Stars(typ->BaseTyp, &*openClause); *openClause = typ->comp == 2; } else if (typ->form == 12) { @@ -293,7 +293,7 @@ static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef) break; } else if ((form == 11 && typ->BaseTyp->comp != 3)) { openClause = 1; - } else if (form == 12 || __IN(comp, 0x0c)) { + } else if (form == 12 || __IN(comp, 0x0c, 64)) { if (openClause) { OPM_Write(')'); openClause = 0; @@ -708,7 +708,7 @@ static void OPC_DefineType (OPT_Struct str) if (str->BaseTyp->comp != 4) { OPC_DefineType(str->BaseTyp); } - } else if (__IN(str->comp, 0x0c)) { + } else if (__IN(str->comp, 0x0c, 64)) { OPC_DefineType(str->BaseTyp); } else if (str->form == 12) { if (str->BaseTyp != OPT_notyp) { @@ -1019,7 +1019,7 @@ static void OPC_IdentList (OPT_Object obj, int32 vis) base = NIL; first = 1; while ((obj != NIL && obj->mode != 13)) { - if ((__IN(vis, 0x05) || (vis == 1 && obj->vis != 0)) || (vis == 3 && !obj->leaf)) { + if ((__IN(vis, 0x05, 64) || (vis == 1 && obj->vis != 0)) || (vis == 3 && !obj->leaf)) { if (obj->typ != base || obj->vis != lastvis) { if (!first) { OPC_EndStat(); @@ -1144,7 +1144,7 @@ static void OPC_ProcPredefs (OPT_Object obj, int8 vis) { if (obj != NIL) { OPC_ProcPredefs(obj->left, vis); - if ((((__IN(obj->mode, 0xc0) && obj->vis >= vis)) && (obj->history != 4 || obj->mode == 6))) { + if ((((__IN(obj->mode, 0xc0, 64) && obj->vis >= vis)) && (obj->history != 4 || obj->mode == 6))) { if (vis == 1) { OPM_WriteString((CHAR*)"import ", 8); } else if (obj->vis == 0) { @@ -1238,7 +1238,7 @@ static void OPC_GenHeaderMsg (void) OPM_Write(' '); i = 0; while (i <= 63) { - if (__IN(i, OPM_glbopt)) { + if (__IN(i, OPM_glbopt, 64)) { switch (i) { case 0: OPM_Write('x'); @@ -1600,7 +1600,7 @@ void OPC_EnterProc (OPT_Object proc) } var = proc->link; while (var != NIL) { - if ((((__IN(var->typ->comp, 0x0c) && var->mode == 1)) && var->typ->sysflag == 0)) { + if ((((__IN(var->typ->comp, 0x0c, 64) && var->mode == 1)) && var->typ->sysflag == 0)) { OPC_BegStat(); if (var->typ->comp == 2) { OPM_WriteString((CHAR*)"__DUPARR(", 10); @@ -1648,7 +1648,7 @@ void OPC_EnterProc (OPT_Object proc) OPM_Write('.'); OPC_Ident(var); OPM_WriteString((CHAR*)" = ", 4); - if (__IN(var->typ->comp, 0x0c)) { + if (__IN(var->typ->comp, 0x0c, 64)) { OPM_WriteString((CHAR*)"(void*)", 8); } else if (var->mode != 2) { OPM_Write('&'); @@ -2006,7 +2006,7 @@ void OPC_Constant (OPT_Const con, int32 form) do { i -= 1; hex = __ASHL(hex, 1); - if (__IN(i, s)) { + if (__IN(i, s, 64)) { hex += 1; } } while (!(__MASK(i, -8) == 0)); diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index aba4bdbb..646d0151 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 55420864..96868200 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -288,15 +288,15 @@ void OPM_InitOptions (void) s[0] = 0x00; Platform_GetArg(OPM_S, (void*)s, 256); } - OPM_dontAsm = __IN(13, OPM_opt); - OPM_dontLink = __IN(14, OPM_opt); - OPM_mainProg = __IN(10, OPM_opt); - OPM_mainLinkStat = __IN(15, OPM_opt); - OPM_notColorOutput = __IN(16, OPM_opt); - OPM_forceNewSym = __IN(17, OPM_opt); - OPM_Verbose = __IN(18, OPM_opt); + OPM_dontAsm = __IN(13, OPM_opt, 64); + OPM_dontLink = __IN(14, OPM_opt, 64); + OPM_mainProg = __IN(10, OPM_opt, 64); + OPM_mainLinkStat = __IN(15, OPM_opt, 64); + OPM_notColorOutput = __IN(16, OPM_opt, 64); + OPM_forceNewSym = __IN(17, OPM_opt, 64); + OPM_Verbose = __IN(18, OPM_opt, 64); if (OPM_mainLinkStat) { - OPM_glbopt |= __SETOF(10); + OPM_glbopt |= __SETOF(10,64); } OPM_GetProperties(); } @@ -771,7 +771,7 @@ void OPM_SymWLReal (LONGREAL lr) void OPM_RegisterNewSym (void) { - if (__STRCMP(OPM_modName, "SYSTEM") != 0 || __IN(10, OPM_opt)) { + if (__STRCMP(OPM_modName, "SYSTEM") != 0 || __IN(10, OPM_opt, 64)) { Files_Register(OPM_newSFile); } } @@ -970,10 +970,10 @@ void OPM_CloseFiles (void) } if (OPM_noerr) { if (__STRCMP(OPM_modName, "SYSTEM") == 0) { - if (!__IN(10, OPM_opt)) { + if (!__IN(10, OPM_opt, 64)) { Files_Register(OPM_BFile); } - } else if (!__IN(10, OPM_opt)) { + } else if (!__IN(10, OPM_opt, 64)) { OPM_Append(&OPM_R[2], Files_Rider__typ, OPM_HFile); Files_Register(OPM_HIFile); Files_Register(OPM_BFile); diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index 1e5c3e72..d4b77c79 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index f175938c..7e958472 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -94,7 +94,7 @@ static void OPP_qualident (OPT_Object *id) obj->adr = 0; } else { lev = obj->mnolev; - if ((__IN(obj->mode, 0x06) && lev != OPP_level)) { + if ((__IN(obj->mode, 0x06, 64) && lev != OPP_level)) { obj->leaf = 0; if (lev > 0) { OPB_StaticLink(OPP_level - lev); @@ -325,7 +325,7 @@ static void OPP_PointerType (OPT_Struct *typ) } else { OPP_qualident(&id); if (id->mode == 5) { - if (__IN(id->typ->comp, 0x1c)) { + if (__IN(id->typ->comp, 0x1c, 64)) { (*typ)->BaseTyp = id->typ; } else { (*typ)->BaseTyp = OPT_undftyp; @@ -338,7 +338,7 @@ static void OPP_PointerType (OPT_Struct *typ) } } else { OPP_Type(&(*typ)->BaseTyp, &OPT_notyp); - if (!__IN((*typ)->BaseTyp->comp, 0x1c)) { + if (!__IN((*typ)->BaseTyp->comp, 0x1c, 64)) { (*typ)->BaseTyp = OPT_undftyp; OPP_err(57); } @@ -966,7 +966,7 @@ static void GetCode__19 (void) } } } - (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1); + (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1,64); } static void GetParams__21 (void) @@ -998,7 +998,7 @@ static void Body__17 (void) OPT_Node procdec = NIL, statseq = NIL; int64 c; c = OPM_errpos; - (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1); + (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1,64); OPP_CheckSym(39); OPP_Block(&procdec, &statseq); OPB_Enter(&procdec, statseq, *ProcedureDeclaration__16_s->proc); @@ -1041,7 +1041,7 @@ static void TProcDecl__23 (void) if ((*ProcedureDeclaration__16_s->fwd != NIL && (*ProcedureDeclaration__16_s->fwd)->mnolev != OPP_level)) { *ProcedureDeclaration__16_s->fwd = NIL; } - if ((((*ProcedureDeclaration__16_s->fwd != NIL && (*ProcedureDeclaration__16_s->fwd)->mode == 13)) && !__IN(1, (*ProcedureDeclaration__16_s->fwd)->conval->setval))) { + if ((((*ProcedureDeclaration__16_s->fwd != NIL && (*ProcedureDeclaration__16_s->fwd)->mode == 13)) && !__IN(1, (*ProcedureDeclaration__16_s->fwd)->conval->setval, 64))) { *ProcedureDeclaration__16_s->proc = OPT_NewObj(); (*ProcedureDeclaration__16_s->proc)->leaf = 1; if ((*ProcedureDeclaration__16_s->fwd)->vis != *ProcedureDeclaration__16_s->vis) { @@ -1075,7 +1075,7 @@ static void TProcDecl__23 (void) if ((((((baseProc->vis == 1 && (*ProcedureDeclaration__16_s->proc)->vis == 0)) && recTyp->strobj != NIL)) && recTyp->strobj->vis == 1)) { OPP_err(109); } - (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(2); + (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(2,64); } if (!*ProcedureDeclaration__16_s->forward) { Body__17(); @@ -1118,7 +1118,7 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) } else { OPP_err(38); } - if ((__IN(mode, 0x0600) && !OPT_SYSimported)) { + if ((__IN(mode, 0x0600, 64) && !OPT_SYSimported)) { OPP_err(135); } OPS_Get(&OPP_sym); @@ -1135,7 +1135,7 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) if ((fwd != NIL && (fwd->mnolev != OPP_level || fwd->mode == 8))) { fwd = NIL; } - if ((((fwd != NIL && __IN(fwd->mode, 0xc0))) && !__IN(1, fwd->conval->setval))) { + if ((((fwd != NIL && __IN(fwd->mode, 0xc0, 64))) && !__IN(1, fwd->conval->setval, 64))) { proc = OPT_NewObj(); proc->leaf = 1; if (fwd->vis != vis) { @@ -1178,7 +1178,7 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int32 *n, OPP for (;;) { OPP_ConstExpression(&x); f = x->typ->form; - if (__IN(f, 0x18)) { + if (__IN(f, 0x18, 64)) { xval = x->conval->intval; } else { OPP_err(61); @@ -1258,7 +1258,7 @@ static void CasePart__31 (OPT_Node *x) *StatSeq__30_s->pos = OPM_errpos; if ((*x)->class == 8 || (*x)->class == 9) { OPP_err(126); - } else if (!__IN((*x)->typ->form, 0x18)) { + } else if (!__IN((*x)->typ->form, 0x18, 64)) { OPP_err(125); } OPP_CheckSym(25); @@ -1675,7 +1675,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) if (obj->typ->strobj == NIL) { obj->typ->strobj = obj; } - if (__IN(obj->typ->comp, 0x1c)) { + if (__IN(obj->typ->comp, 0x1c, 64)) { i = 0; while (i < OPP_nofFwdPtr) { typ = OPP_FwdPtr[__X(i, 64)]; diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index 2d3ebd77..9ddded2f 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index 0c36910a..208f4934 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index a16c2ce8..bb045fe9 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index 3006ea90..afc5a8b6 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -274,9 +274,9 @@ void OPT_Init (OPS_Name name, SET opt) __COPY(name, OPT_topScope->name, 256); OPT_GlbMod[0] = OPT_topScope; OPT_nofGmod = 1; - OPT_newsf = __IN(4, opt); - OPT_findpc = __IN(8, opt); - OPT_extsf = OPT_newsf || __IN(9, opt); + OPT_newsf = __IN(4, opt, 64); + OPT_findpc = __IN(8, opt, 64); + OPT_extsf = OPT_newsf || __IN(9, opt, 64); OPT_sfpresent = 1; } @@ -609,7 +609,7 @@ void OPT_FPrintStr (OPT_Struct typ) pvfp = pbfp; } } else if (f == 12) { - } else if (__IN(c, 0x0c)) { + } else if (__IN(c, 0x0c, 64)) { OPT_FPrintStr(btyp); OPM_FPrint(&pbfp, btyp->pvfp); pvfp = pbfp; @@ -680,7 +680,7 @@ void OPT_FPrintObj (OPT_Object obj) OPM_FPrint(&fprint, obj->vis); OPT_FPrintStr(obj->typ); OPM_FPrint(&fprint, obj->typ->pbfp); - } else if (__IN(obj->mode, 0x0480)) { + } else if (__IN(obj->mode, 0x0480, 64)) { OPT_FPrintSign(&fprint, obj->typ, obj->link); } else if (obj->mode == 9) { OPT_FPrintSign(&fprint, obj->typ, obj->link); @@ -1573,7 +1573,7 @@ static void OPT_OutObj (OPT_Object obj) OPT_ConstExt ext = NIL; if (obj != NIL) { OPT_OutObj(obj->left); - if (__IN(obj->mode, 0x06ea)) { + if (__IN(obj->mode, 0x06ea, 64)) { if (obj->history == 4) { OPT_FPrintErr(obj, 250); } else if (obj->vis != 0) { diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 5f466ec4..090d9111 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 082797f1..098463c4 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -130,10 +130,10 @@ void OPV_Init (void) OPV_stamp = 0; OPV_recno = 0; OPV_nofExitLabels = 0; - OPV_assert = __IN(7, OPM_opt); - OPV_inxchk = __IN(0, OPM_opt); - OPV_mainprog = __IN(10, OPM_opt); - OPV_ansi = __IN(6, OPM_opt); + OPV_assert = __IN(7, OPM_opt, 64); + OPV_inxchk = __IN(0, OPM_opt, 64); + OPV_mainprog = __IN(10, OPM_opt, 64); + OPV_ansi = __IN(6, OPM_opt, 64); } static void OPV_GetTProcNum (OPT_Object obj) @@ -150,7 +150,7 @@ static void OPV_GetTProcNum (OPT_Object obj) OPT_FindField(obj->name, typ->BaseTyp, &redef); if (redef != NIL) { obj->adr = __ASHL(__ASHR(redef->adr, 16), 16); - if (!__IN(2, obj->conval->setval)) { + if (!__IN(2, obj->conval->setval, 64)) { OPM_err(119); } } else { @@ -230,12 +230,12 @@ static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exporte OPV_TypSize(obj->typ); } if (!exported) { - if ((__IN(mode, 0x60) && obj->mnolev > 0)) { + if ((__IN(mode, 0x60, 64) && obj->mnolev > 0)) { OPV_Stamp(obj->name); } - if (__IN(mode, 0x26)) { + if (__IN(mode, 0x26, 64)) { obj->scope = outerScope; - } else if (__IN(mode, 0x26c0)) { + } else if (__IN(mode, 0x26c0, 64)) { if (obj->conval->setval == 0x0) { OPM_err(129); } @@ -289,7 +289,7 @@ static int32 OPV_Precedence (int32 class, int32 subclass, int32 form, int32 comp return _o_result; break; case 5: - if (__IN(3, OPM_opt)) { + if (__IN(3, OPM_opt, 64)) { _o_result = 10; return _o_result; } else { @@ -298,7 +298,7 @@ static int32 OPV_Precedence (int32 class, int32 subclass, int32 form, int32 comp } break; case 1: - if (__IN(comp, 0x0c)) { + if (__IN(comp, 0x0c, 64)) { _o_result = 10; return _o_result; } else { @@ -445,7 +445,7 @@ static BOOLEAN OPV_SideEffects (OPT_Node n) static void OPV_Entier (OPT_Node n, int32 prec) { - if (__IN(n->typ->form, 0x60)) { + if (__IN(n->typ->form, 0x60, 64)) { OPM_WriteString((CHAR*)"__ENTIER(", 10); OPV_expr(n, -1); OPM_Write(')'); @@ -471,9 +471,11 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int32 prec) if (to == 7) { OPM_WriteString((CHAR*)"__SETOF(", 9); OPV_Entier(n, -1); + OPM_WriteString((CHAR*)",", 2); + OPM_WriteInt(__ASHL(newtype->size, 3)); OPM_Write(')'); } else if (to == 4) { - if ((newtype->size < n->typ->size && __IN(2, OPM_opt))) { + if ((newtype->size < n->typ->size && __IN(2, OPM_opt, 64))) { OPM_WriteString((CHAR*)"__SHORT", 8); if (OPV_SideEffects(n)) { OPM_Write('F'); @@ -488,7 +490,7 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int32 prec) OPV_Entier(n, 9); } } else if (to == 3) { - if (__IN(2, OPM_opt)) { + if (__IN(2, OPM_opt, 64)) { OPM_WriteString((CHAR*)"__CHR", 6); if (OPV_SideEffects(n)) { OPM_Write('F'); @@ -511,7 +513,7 @@ static void OPV_TypeOf (OPT_Node n) OPM_WriteString((CHAR*)"__TYPEOF(", 10); OPV_expr(n, -1); OPM_Write(')'); - } else if (__IN(n->class, 0x15)) { + } else if (__IN(n->class, 0x15, 64)) { OPC_Andent(n->typ); OPM_WriteString((CHAR*)"__typ", 6); } else if (n->class == 3) { @@ -572,7 +574,7 @@ static void OPV_design (OPT_Node n, int32 prec) OPC_CompleteIdent(n->obj); break; case 1: - if (!__IN(comp, 0x0c)) { + if (!__IN(comp, 0x0c, 64)) { OPM_Write('*'); } OPC_CompleteIdent(n->obj); @@ -651,7 +653,7 @@ static void OPV_design (OPT_Node n, int32 prec) case 5: typ = n->typ; obj = n->left->obj; - if (__IN(3, OPM_opt)) { + if (__IN(3, OPM_opt, 64)) { if (typ->comp == 4) { OPM_WriteString((CHAR*)"__GUARDR(", 10); if (obj->mnolev != OPM_level) { @@ -690,7 +692,7 @@ static void OPV_design (OPT_Node n, int32 prec) } break; case 6: - if (__IN(3, OPM_opt)) { + if (__IN(3, OPM_opt, 64)) { if (n->left->class == 1) { OPM_WriteString((CHAR*)"__GUARDEQR(", 12); OPC_CompleteIdent(n->left->obj); @@ -749,7 +751,7 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) OPM_WriteString((CHAR*)"*)", 3); prec = 10; } - if (!__IN(n->typ->comp, 0x0c)) { + if (!__IN(n->typ->comp, 0x0c, 64)) { if (mode == 2) { if ((OPV_ansi && typ != n->typ)) { OPM_WriteString((CHAR*)"(void*)", 8); @@ -757,13 +759,13 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) OPM_Write('&'); prec = 9; } else if (OPV_ansi) { - if ((__IN(comp, 0x0c) && n->class == 7)) { + if ((__IN(comp, 0x0c, 64) && n->class == 7)) { OPM_WriteString((CHAR*)"(CHAR*)", 8); } else if ((((form == 11 && typ != n->typ)) && n->typ != OPT_niltyp)) { OPM_WriteString((CHAR*)"(void*)", 8); } } else { - if ((__IN(form, 0x60) && n->typ->form == 4)) { + if ((__IN(form, 0x60, 64) && n->typ->form == 4)) { OPM_WriteString((CHAR*)"(double)", 9); prec = 9; } else if (form == 4) { @@ -846,7 +848,7 @@ static void OPV_expr (OPT_Node n, int32 prec) l = n->left; r = n->right; exprPrec = OPV_Precedence(class, subclass, form, n->typ->comp); - if ((exprPrec <= prec && __IN(class, 0x3ce0))) { + if ((exprPrec <= prec && __IN(class, 0x3ce0, 64))) { OPM_Write('('); } switch (class) { @@ -858,6 +860,8 @@ static void OPV_expr (OPT_Node n, int32 prec) OPV_expr(l, -1); OPM_WriteString((CHAR*)", ", 3); OPV_expr(r, -1); + OPM_WriteString((CHAR*)", ", 3); + OPM_WriteInt(__ASHL(n->typ->size, 3)); OPM_Write(')'); break; case 11: @@ -924,18 +928,18 @@ static void OPV_expr (OPT_Node n, int32 prec) if (l->class == 1) { OPC_CompleteIdent(l->obj); } else { - if ((l->typ->form != 8 && !__IN(l->typ->comp, 0x0c))) { + if ((l->typ->form != 8 && !__IN(l->typ->comp, 0x0c, 64))) { OPM_Write('&'); } OPV_expr(l, exprPrec); } break; case 29: - if (!__IN(l->class, 0x17) || (((__IN(n->typ->form, 0x1890) && __IN(l->typ->form, 0x1890))) && n->typ->size == l->typ->size)) { + if (!__IN(l->class, 0x17, 64) || (((__IN(n->typ->form, 0x1890, 64) && __IN(l->typ->form, 0x1890, 64))) && n->typ->size == l->typ->size)) { OPM_Write('('); OPC_Ident(n->typ->strobj); OPM_Write(')'); - if (__IN(n->typ->form, 0x1800) || __IN(l->typ->form, 0x1800)) { + if (__IN(n->typ->form, 0x1800, 64) || __IN(l->typ->form, 0x1800, 64)) { OPM_WriteString((CHAR*)"(address)", 10); } OPV_expr(l, exprPrec); @@ -1032,20 +1036,24 @@ static void OPV_expr (OPT_Node n, int32 prec) } OPV_expr(l, -1); OPM_WriteString((CHAR*)", ", 3); - if ((((__IN(subclass, 0x18020000) && r->class == 7)) && r->conval->intval < 0)) { + if ((((__IN(subclass, 0x18020000, 64) && r->class == 7)) && r->conval->intval < 0)) { OPM_WriteInt(-r->conval->intval); } else { OPV_expr(r, -1); } - if (__IN(subclass, 0x18000000)) { + if (__IN(subclass, 0x18008000, 64)) { OPM_WriteString((CHAR*)", ", 3); - OPM_WriteInt(__ASHL(l->typ->size, 3)); + if (subclass == 15) { + OPM_WriteInt(__ASHL(r->typ->size, 3)); + } else { + OPM_WriteInt(__ASHL(l->typ->size, 3)); + } } OPM_Write(')'); break; case 9: case 10: case 11: case 12: case 13: case 14: - if (__IN(l->typ->form, 0x2100)) { + if (__IN(l->typ->form, 0x2100, 64)) { OPM_WriteString((CHAR*)"__STRCMP(", 10); OPV_expr(l, -1); OPM_WriteString((CHAR*)", ", 3); @@ -1142,7 +1150,7 @@ static void OPV_expr (OPT_Node n, int32 prec) OPV_design(n, prec); break; } - if ((exprPrec <= prec && __IN(class, 0x3ca0))) { + if ((exprPrec <= prec && __IN(class, 0x3ca0, 64))) { OPM_Write(')'); } } @@ -1432,7 +1440,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPM_WriteString((CHAR*)", ", 3); OPC_Andent(n->left->typ->BaseTyp); OPM_WriteString((CHAR*)")", 2); - } else if (__IN(n->left->typ->BaseTyp->comp, 0x0c)) { + } else if (__IN(n->left->typ->BaseTyp->comp, 0x0c, 64)) { OPV_NewArr(n->left, n->right); } break; @@ -1446,6 +1454,8 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPC_SetInclude(n->subcl == 16); OPM_WriteString((CHAR*)"__SETOF(", 9); OPV_expr(n->right, -1); + OPM_WriteString((CHAR*)",", 2); + OPM_WriteInt(__ASHL(n->left->typ->size, 3)); OPM_Write(')'); break; case 18: @@ -1623,7 +1633,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPM_LogWLn(); break; } - if (!__IN(n->class, 0x09744000)) { + if (!__IN(n->class, 0x09744000, 64)) { OPC_EndStat(); } n = n->link; diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index 3b43e61e..ea1f9aaa 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index b7705767..3bb993de 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index 290fc518..c1175e02 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 2a753b7a..b3e89e04 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index c3cac05a..3892d49c 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index d8c606d3..1eef261b 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index 130e1d06..8145aa00 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index 056c54e0..d8710e54 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -578,13 +578,13 @@ void Texts_ChangeLooks (Texts_Text T, int64 beg, int64 end, SET sel, Texts_Fonts T->cache = c; T->corg = co; while (un != vn) { - if ((__IN(0, sel) && fnt != NIL)) { + if ((__IN(0, sel, 64) && fnt != NIL)) { un->fnt = fnt; } - if (__IN(1, sel)) { + if (__IN(1, sel, 64)) { un->col = col; } - if (__IN(2, sel)) { + if (__IN(2, sel, 64)) { un->voff = voff; } Texts_Merge(T, u, &un); diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index 1e734f9d..8389bc47 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/Vishap.c b/bootstrap/windows-88/Vishap.c index 08b89b00..3972af10 100644 --- a/bootstrap/windows-88/Vishap.c +++ b/bootstrap/windows-88/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkamSf */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/errors.c b/bootstrap/windows-88/errors.c index 84d35faf..8864c777 100644 --- a/bootstrap/windows-88/errors.c +++ b/bootstrap/windows-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/errors.h b/bootstrap/windows-88/errors.h index 4fe434e1..58286fd8 100644 --- a/bootstrap/windows-88/errors.h +++ b/bootstrap/windows-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index 7651bcf8..bb60848a 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index 5d996dae..8a0d60be 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/vt100.c b/bootstrap/windows-88/vt100.c index b7524886..c143a6b3 100644 --- a/bootstrap/windows-88/vt100.c +++ b/bootstrap/windows-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/vt100.h b/bootstrap/windows-88/vt100.h index ef3afa5a..11a9c941 100644 --- a/bootstrap/windows-88/vt100.h +++ b/bootstrap/windows-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/src/system/Heap.Mod b/src/system/Heap.Mod index bf3d0d7f..00023a0a 100644 --- a/src/system/Heap.Mod +++ b/src/system/Heap.Mod @@ -3,10 +3,12 @@ MODULE Heap; IMPORT SYSTEM; (* Cannot import anything else as heap initialization must complete before any other modules are initialized. *) + TYPE Address = SYSTEM.ADDRESS; + CONST ModNameLen = 20; CmdNameLen = 24; - SZA = SIZE(SYSTEM.ADDRESS); (* Size of address *) + SZA = SIZE(Address); (* Size of address *) Unit = 4*SZA; (* smallest possible heap block *) nofLists = 9; (* number of free_lists *) heapSize0 = 8000*Unit; (* startup heap size *) @@ -20,17 +22,17 @@ MODULE Heap; *) (* heap chunks *) - nextChnkOff = SYSTEM.VAL(SYSTEM.ADDRESS, 0); (* next heap chunk, sorted ascendingly! *) - endOff = SYSTEM.VAL(SYSTEM.ADDRESS, SZA); (* end of heap chunk *) - blkOff = SYSTEM.VAL(SYSTEM.ADDRESS, 3*SZA); (* first block in a chunk *) + nextChnkOff = SYSTEM.VAL(Address, 0); (* next heap chunk, sorted ascendingly! *) + endOff = SYSTEM.VAL(Address, SZA); (* end of heap chunk *) + blkOff = SYSTEM.VAL(Address, 3*SZA); (* first block in a chunk *) (* heap blocks *) - tagOff = SYSTEM.VAL(SYSTEM.ADDRESS, 0); (* block starts with tag *) - sizeOff = SYSTEM.VAL(SYSTEM.ADDRESS, SZA); (* block size in free block relative to block start *) - sntlOff = SYSTEM.VAL(SYSTEM.ADDRESS, 2*SZA); (* pointer offset table sentinel in free block relative to block start *) - nextOff = SYSTEM.VAL(SYSTEM.ADDRESS, 3*SZA); (* next pointer in free block relative to block start *) - NoPtrSntl = SYSTEM.VAL(SYSTEM.ADDRESS, -SZA); - AddressZero = SYSTEM.VAL(SYSTEM.ADDRESS, 0); + tagOff = SYSTEM.VAL(Address, 0); (* block starts with tag *) + sizeOff = SYSTEM.VAL(Address, SZA); (* block size in free block relative to block start *) + sntlOff = SYSTEM.VAL(Address, 2*SZA); (* pointer offset table sentinel in free block relative to block start *) + nextOff = SYSTEM.VAL(Address, 3*SZA); (* next pointer in free block relative to block start *) + NoPtrSntl = SYSTEM.VAL(Address, -SZA); + AddressZero = SYSTEM.VAL(Address, 0); TYPE ModuleName = ARRAY ModNameLen OF CHAR; @@ -46,7 +48,7 @@ MODULE Heap; name: ModuleName; refcnt: LONGINT; cmds: Cmd; - types: SYSTEM.ADDRESS; + types: Address; enumPtrs: EnumProc; reserved1, reserved2: LONGINT END ; @@ -64,7 +66,7 @@ MODULE Heap; FinNode = POINTER TO FinDesc; FinDesc = RECORD next: FinNode; - obj: SYSTEM.ADDRESS; (* weak pointer *) + obj: Address; (* weak pointer *) marked: BOOLEAN; finalize: Finalizer; END ; @@ -73,15 +75,15 @@ MODULE Heap; (* the list of loaded (=initialization started) modules *) modules*: SYSTEM.PTR; - freeList: ARRAY nofLists + 1 OF SYSTEM.ADDRESS; (* dummy, 16, 32, 48, 64, 80, 96, 112, 128, sentinel *) - bigBlocks: SYSTEM.ADDRESS; - allocated*: SYSTEM.ADDRESS; + freeList: ARRAY nofLists + 1 OF Address; (* dummy, 16, 32, 48, 64, 80, 96, 112, 128, sentinel *) + bigBlocks: Address; + allocated*: Address; firstTry: BOOLEAN; (* extensible heap *) - heap: SYSTEM.ADDRESS; (* the sorted list of heap chunks *) - heapend: SYSTEM.ADDRESS; (* max possible pointer value (used for stack collection) *) - heapsize*: SYSTEM.ADDRESS; (* the sum of all heap chunk sizes *) + heap: Address; (* the sorted list of heap chunks *) + heapend: Address; (* max possible pointer value (used for stack collection) *) + heapsize*: Address; (* the sum of all heap chunk sizes *) (* finalization candidates *) fin: FinNode; @@ -153,7 +155,7 @@ MODULE Heap; COPY(name, c.name); c.cmd := cmd; c.next := m.cmds; m.cmds := c END REGCMD; - PROCEDURE REGTYP*(m: Module; typ: SYSTEM.ADDRESS); + PROCEDURE REGTYP*(m: Module; typ: Address); BEGIN SYSTEM.PUT(typ, m.types); m.types := typ END REGTYP; @@ -163,10 +165,10 @@ MODULE Heap; PROCEDURE -ExternPlatformOSAllocate "extern address Platform_OSAllocate(address size);"; - PROCEDURE -OSAllocate(size: SYSTEM.ADDRESS): SYSTEM.ADDRESS "Platform_OSAllocate(size)"; + PROCEDURE -OSAllocate(size: Address): Address "Platform_OSAllocate(size)"; - PROCEDURE NewChunk(blksz: SYSTEM.ADDRESS): SYSTEM.ADDRESS; - VAR chnk: SYSTEM.ADDRESS; + PROCEDURE NewChunk(blksz: Address): Address; + VAR chnk: Address; BEGIN chnk := OSAllocate(blksz + blkOff); IF chnk # 0 THEN @@ -182,19 +184,13 @@ MODULE Heap; END NewChunk; - (* FetchAddress fetches a pointer from memory and returns it as a LONGINT. It works - correctly regardless of the size of an address. Specifically on 32 bit address - architectures with 64 bit LONGINT, it loads 32 bits and extends it to LONGINT - rather than loading 64 bits. - - NOTE - with uintpr work complete this function should be replaced with SYSTEM.GET - as there will be no need to extend addresses to larger types. + (* + PROCEDURE -FetchAddress(pointer: Address): Address "(address)(*((void**)((address)pointer)))"; *) + PROCEDURE FetchAddress(pointer: Address): Address; VAR r: Address; BEGIN SYSTEM.GET(pointer, r); RETURN r END FetchAddress; - PROCEDURE -FetchAddress(pointer: SYSTEM.ADDRESS): SYSTEM.ADDRESS "(address)(*((void**)((address)pointer)))"; - - PROCEDURE ExtendHeap(blksz: SYSTEM.ADDRESS); - VAR size, chnk, j, next: SYSTEM.ADDRESS; + PROCEDURE ExtendHeap(blksz: Address); + VAR size, chnk, j, next: Address; BEGIN IF blksz > 10000*Unit THEN size := blksz ELSE size := 10000*Unit (* additional heuristics *) @@ -218,16 +214,16 @@ MODULE Heap; PROCEDURE ^GC*(markStack: BOOLEAN); - PROCEDURE NEWREC*(tag: SYSTEM.ADDRESS): SYSTEM.PTR; + PROCEDURE NEWREC*(tag: Address): SYSTEM.PTR; VAR - i, i0, di, blksz, restsize, t, adr, end, next, prev: SYSTEM.ADDRESS; + i, i0, di, blksz, restsize, t, adr, end, next, prev: Address; new: SYSTEM.PTR; BEGIN Lock(); blksz := FetchAddress(tag); ASSERT((Unit = 16) OR (Unit = 32)); - ASSERT(SIZE(SYSTEM.PTR) = SIZE(SYSTEM.ADDRESS)); + ASSERT(SIZE(SYSTEM.PTR) = SIZE(Address)); ASSERT(blksz MOD Unit = 0); i0 := blksz DIV Unit; i := i0; @@ -310,23 +306,23 @@ MODULE Heap; RETURN SYSTEM.VAL(SYSTEM.PTR, adr + SZA) END NEWREC; - PROCEDURE NEWBLK*(size: SYSTEM.ADDRESS): SYSTEM.PTR; - VAR blksz, tag: SYSTEM.ADDRESS; new: SYSTEM.PTR; + PROCEDURE NEWBLK*(size: Address): SYSTEM.PTR; + VAR blksz, tag: Address; new: SYSTEM.PTR; BEGIN Lock(); blksz := (size + (4*SZA + Unit - 1)) DIV Unit * Unit; (*size + tag + meta + blksz + sntnl + UnitAlignment*) new := NEWREC(SYSTEM.ADR(blksz)); - tag := SYSTEM.VAL(SYSTEM.ADDRESS, new) + blksz - 3*SZA; + tag := SYSTEM.VAL(Address, new) + blksz - 3*SZA; SYSTEM.PUT(tag - SZA, AddressZero); (*reserved for meta info*) SYSTEM.PUT(tag, blksz); SYSTEM.PUT(tag + SZA, NoPtrSntl); - SYSTEM.PUT(SYSTEM.VAL(SYSTEM.ADDRESS, new) - SZA, tag); + SYSTEM.PUT(SYSTEM.VAL(Address, new) - SZA, tag); Unlock(); RETURN new END NEWBLK; - PROCEDURE Mark(q: SYSTEM.ADDRESS); - VAR p, tag, offset, fld, n, tagbits: SYSTEM.ADDRESS; + PROCEDURE Mark(q: Address); + VAR p, tag, offset, fld, n, tagbits: Address; BEGIN IF q # 0 THEN tagbits := FetchAddress(q - SZA); (* Load the tag for the record at q *) @@ -365,11 +361,11 @@ MODULE Heap; PROCEDURE MarkP(p: SYSTEM.PTR); (* for compatibility with EnumPtrs in ANSI mode *) BEGIN - Mark(SYSTEM.VAL(SYSTEM.ADDRESS, p)) + Mark(SYSTEM.VAL(Address, p)) END MarkP; PROCEDURE Scan; - VAR chnk, adr, end, start, tag, i, size, freesize: SYSTEM.ADDRESS; + VAR chnk, adr, end, start, tag, i, size, freesize: Address; BEGIN bigBlocks := 0; i := 1; WHILE i < nofLists DO freeList[i] := 0; INC(i) END ; freesize := 0; allocated := 0; chnk := heap; @@ -414,8 +410,8 @@ MODULE Heap; END END Scan; - PROCEDURE Sift (l, r: SYSTEM.ADDRESS; VAR a: ARRAY OF SYSTEM.ADDRESS); - VAR i, j, x: SYSTEM.ADDRESS; + PROCEDURE Sift (l, r: Address; VAR a: ARRAY OF Address); + VAR i, j, x: Address; BEGIN j := l; x := a[j]; LOOP i := j; j := 2*j + 1; IF (j < r) & (a[j] < a[j+1]) THEN INC(j) END; @@ -425,15 +421,15 @@ MODULE Heap; a[i] := x END Sift; - PROCEDURE HeapSort (n: SYSTEM.ADDRESS; VAR a: ARRAY OF SYSTEM.ADDRESS); - VAR l, r, x: SYSTEM.ADDRESS; + PROCEDURE HeapSort (n: Address; VAR a: ARRAY OF Address); + VAR l, r, x: Address; BEGIN l := n DIV 2; r := n - 1; WHILE l > 0 DO DEC(l); Sift(l, r, a) END; WHILE r > 0 DO x := a[0]; a[0] := a[r]; a[r] := x; DEC(r); Sift(l, r, a) END END HeapSort; - PROCEDURE MarkCandidates(n: SYSTEM.ADDRESS; VAR cand: ARRAY OF SYSTEM.ADDRESS); - VAR chnk, adr, tag, next, lim, lim1, i, ptr, size: SYSTEM.ADDRESS; + PROCEDURE MarkCandidates(n: Address; VAR cand: ARRAY OF Address); + VAR chnk, adr, tag, next, lim, lim1, i, ptr, size: Address; BEGIN chnk := heap; i := 0; lim := cand[n-1]; WHILE (chnk # 0 ) & (chnk < lim) DO @@ -459,7 +455,7 @@ MODULE Heap; END MarkCandidates; PROCEDURE CheckFin; - VAR n: FinNode; tag: SYSTEM.ADDRESS; + VAR n: FinNode; tag: Address; BEGIN n := fin; WHILE n # NIL DO @@ -496,13 +492,13 @@ MODULE Heap; END FINALL; PROCEDURE -ExternMainStackFrame "extern address Platform_MainStackFrame;"; - PROCEDURE -PlatformMainStackFrame(): SYSTEM.ADDRESS "Platform_MainStackFrame"; + PROCEDURE -PlatformMainStackFrame(): Address "Platform_MainStackFrame"; - PROCEDURE MarkStack(n: SYSTEM.ADDRESS; VAR cand: ARRAY OF SYSTEM.ADDRESS); + PROCEDURE MarkStack(n: Address; VAR cand: ARRAY OF Address); VAR frame: SYSTEM.PTR; - inc, nofcand: SYSTEM.ADDRESS; - sp, p, stack0: SYSTEM.ADDRESS; + inc, nofcand: Address; + sp, p, stack0: Address; align: RECORD ch: CHAR; p: SYSTEM.PTR END ; BEGIN IF n > 0 THEN MarkStack(n-1, cand); (* flush register windows by means of recursive calls *) @@ -529,8 +525,8 @@ MODULE Heap; PROCEDURE GC*(markStack: BOOLEAN); VAR m: Module; - i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23: SYSTEM.ADDRESS; - cand: ARRAY 10000 OF SYSTEM.ADDRESS; + i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23: Address; + cand: ARRAY 10000 OF Address; BEGIN IF (lockdepth = 0) OR (lockdepth = 1) & ~markStack THEN Lock(); @@ -565,7 +561,7 @@ MODULE Heap; PROCEDURE RegisterFinalizer*(obj: SYSTEM.PTR; finalize: Finalizer); VAR f: FinNode; BEGIN NEW(f); - f.obj := SYSTEM.VAL(SYSTEM.ADDRESS, obj); f.finalize := finalize; f.marked := TRUE; + f.obj := SYSTEM.VAL(Address, obj); f.finalize := finalize; f.marked := TRUE; f.next := fin; fin := f; END RegisterFinalizer; diff --git a/src/system/SYSTEM.c b/src/system/SYSTEM.c index defcc9fa..6efc8321 100644 --- a/src/system/SYSTEM.c +++ b/src/system/SYSTEM.c @@ -46,37 +46,6 @@ int64 SYSTEM_MOD(int64 x, int64 y) else {return -((-x) % (-y));} } - -void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0) -{ - t -= __TPROC0OFF; - t0 -= __TPROC0OFF; - while (*t0 != __EOM) {*t = *t0; t--; t0--;} -} - - -void SYSTEM_ENUMP(void *adr, LONGINT n, void (*P)()) -{ - while (n > 0) { - P((address)(*((void**)(adr)))); - adr = ((void**)adr) + 1; - n--; - } -} - -void SYSTEM_ENUMR(void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()) -{ - LONGINT *t, off; - typ++; - while (n > 0) { - t = typ; - off = *t; - while (off >= 0) {P(*(address*)((char*)adr+off)); t++; off = *t;} - adr = ((char*)adr) + size; - n--; - } -} - LONGINT SYSTEM_ENTIER(double x) { LONGINT y; @@ -88,22 +57,55 @@ LONGINT SYSTEM_ENTIER(double x) } } + + + +void SYSTEM_INHERIT(address *t, address *t0) +{ + t -= __TPROC0OFF; + t0 -= __TPROC0OFF; + while (*t0 != __EOM) {*t = *t0; t--; t0--;} +} + + +void SYSTEM_ENUMP(void *adr, address n, void (*P)()) +{ + while (n > 0) { + P((address)(*((void**)(adr)))); + adr = ((void**)adr) + 1; + n--; + } +} + +void SYSTEM_ENUMR(void *adr, address *typ, address size, address n, void (*P)()) +{ + address *t, off; + typ++; + while (n > 0) { + t = typ; + off = *t; + while (off >= 0) {P(*(address*)((char*)adr+off)); t++; off = *t;} + adr = ((char*)adr) + size; + n--; + } +} + extern void Heap_Lock(); extern void Heap_Unlock(); -SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, int nofdyn, ...) +SYSTEM_PTR SYSTEM_NEWARR(address *typ, address elemsz, int elemalgn, int nofdim, int nofdyn, ...) { - LONGINT nofelems, size, dataoff, n, nptr, *x, *p, nofptrs, i, *ptab, off; + address nofelems, size, dataoff, n, nptr, *x, *p, nofptrs, i, *ptab, off; va_list ap; va_start(ap, nofdyn); nofelems = 1; while (nofdim > 0) { - nofelems = nofelems * va_arg(ap, LONGINT); nofdim--; + nofelems = nofelems * va_arg(ap, address); nofdim--; if (nofelems <= 0) __HALT(-20); } va_end(ap); - dataoff = nofdyn * sizeof(LONGINT); - if (elemalgn > sizeof(LONGINT)) { + dataoff = nofdyn * sizeof(address); + if (elemalgn > sizeof(address)) { n = dataoff % elemalgn; if (n != 0) dataoff += elemalgn - n; } @@ -113,37 +115,37 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, /* element typ does not contain pointers */ x = Heap_NEWBLK(size); } - else if (typ == (LONGINT*)POINTER__typ) { + else if (typ == (address*)POINTER__typ) { /* element type is a pointer */ - x = Heap_NEWBLK(size + nofelems * sizeof(LONGINT)); - p = (LONGINT*)(address)x[-1]; + x = Heap_NEWBLK(size + nofelems * sizeof(address)); + p = (address*)(address)x[-1]; p[-nofelems] = *p; /* build new type desc in situ: 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nofelems - 1; n = 1; /* n =1 for skipping the size field */ - while (n <= nofelems) {*p = n*sizeof(LONGINT); p++; n++;} - *p = - (nofelems + 1) * sizeof(LONGINT); /* sentinel */ - x[-1] -= nofelems * sizeof(LONGINT); + while (n <= nofelems) {*p = n*sizeof(address); p++; n++;} + *p = - (nofelems + 1) * sizeof(address); /* sentinel */ + x[-1] -= nofelems * sizeof(address); } else { /* element type is a record that contains pointers */ ptab = typ + 1; nofptrs = 0; while (ptab[nofptrs] >= 0) {nofptrs++;} /* number of pointers per element */ nptr = nofelems * nofptrs; /* total number of pointers */ - x = Heap_NEWBLK(size + nptr * sizeof(LONGINT)); - p = (LONGINT*)(address)x[- 1]; + x = Heap_NEWBLK(size + nptr * sizeof(address)); + p = (address*)(address)x[- 1]; p[-nptr] = *p; /* build new type desc in situ; 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nptr - 1; n = 0; off = dataoff; while (n < nofelems) {i = 0; while (i < nofptrs) {*p = off + ptab[i]; p++; i++;} off += elemsz; n++; } - *p = - (nptr + 1) * sizeof(LONGINT); /* sentinel */ - x[-1] -= nptr * sizeof(LONGINT); + *p = - (nptr + 1) * sizeof(address); /* sentinel */ + x[-1] -= nptr * sizeof(address); } if (nofdyn != 0) { /* setup len vector for index checks */ va_start(ap, nofdyn); p = x; - while (nofdyn > 0) {*p = va_arg(ap, LONGINT); p++, nofdyn--;} + while (nofdyn > 0) {*p = va_arg(ap, address); p++, nofdyn--;} va_end(ap); } Heap_Unlock(); diff --git a/src/system/SYSTEM.h b/src/system/SYSTEM.h index 7c645e85..ddd85144 100644 --- a/src/system/SYSTEM.h +++ b/src/system/SYSTEM.h @@ -243,6 +243,10 @@ static inline double SYSTEM_ABSD(double i) {return i >= 0.0 ? i : -i;} #define __CASECHK __HALT(-4) #define __WITHCHK __HALT(-7) +#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(address)typ##__typ) +#define __TYPEOF(p) ((LONGINT*)(address)(*(((LONGINT*)(p))-1))) +#define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) + #define __GUARDP(p, typ, level) ((typ*)(__ISP(p,typ,level)?p:(__HALT(-5),p))) #define __GUARDR(r, typ, level) (*((typ*)(__IS(r##__typ,typ,level)?r:(__HALT(-5),r)))) #define __GUARDA(p, typ, level) ((struct typ*)(__IS(__TYPEOF(p),typ,level)?p:(__HALT(-5),p))) @@ -282,56 +286,52 @@ extern SYSTEM_PTR Heap_NEWBLK (address size); extern SYSTEM_PTR Heap_NEWREC (address tag); extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); -#define __SYSNEW(p, len) p = Heap_NEWBLK((LONGINT)(len)) -#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(address)t##__typ) +#define __SYSNEW(p, len) p = Heap_NEWBLK((address)(len)) +#define __NEW(p, t) p = Heap_NEWREC((address)t##__typ) #define __NEWARR SYSTEM_NEWARR /* Type handling */ -extern void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0); -extern void SYSTEM_ENUMP (void *adr, LONGINT n, void (*P)()); -extern void SYSTEM_ENUMR (void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()); +extern void SYSTEM_INHERIT(address *t, address *t0); +extern void SYSTEM_ENUMP (void *adr, address n, void (*P)()); +extern void SYSTEM_ENUMR (void *adr, address *typ, address size, address n, void (*P)()); #define __TDESC(t, m, n) \ static struct t##__desc { \ - LONGINT tproc[m]; /* Proc for each ptr field */ \ - LONGINT tag; \ - LONGINT next; /* Module table type list points here */ \ - LONGINT level; \ - LONGINT module; \ + address tproc[m]; /* Proc for each ptr field */ \ + address tag; \ + address next; /* Module table type list points here */ \ + address level; \ + address module; \ char name[24]; \ - LONGINT basep[__MAXEXT]; /* List of bases this extends */ \ - LONGINT reserved; \ - LONGINT blksz; /* xxx_typ points here */ \ - LONGINT ptr[n+1]; /* Offsets of ptrs up to -ve sentinel */ \ + address basep[__MAXEXT]; /* List of bases this extends */ \ + address reserved; \ + address blksz; /* xxx_typ points here */ \ + address ptr[n+1]; /* Offsets of ptrs up to -ve sentinel */ \ } t##__desc #define __BASEOFF (__MAXEXT+1) // blksz as index to base. -#define __TPROC0OFF (__BASEOFF+24/sizeof(LONGINT)+5) // blksz as index to tproc IFF m=1. +#define __TPROC0OFF (__BASEOFF+24/sizeof(address)+5) // blksz as index to tproc IFF m=1. #define __EOM 1 #define __TDFLDS(name, size) {__EOM}, 1, 0, 0, 0, name, {0}, 0, size -#define __ENUMP(adr, n, P) SYSTEM_ENUMP(adr, (LONGINT)(n), P) -#define __ENUMR(adr, typ, size, n, P) SYSTEM_ENUMR(adr, typ, (LONGINT)(size), (LONGINT)(n), P) +#define __ENUMP(adr, n, P) SYSTEM_ENUMP(adr, (address)(n), P) +#define __ENUMR(adr, typ, size, n, P) SYSTEM_ENUMR(adr, typ, (address)(size), (address)(n), P) #define __INITYP(t, t0, level) \ - t##__typ = (LONGINT*)&t##__desc.blksz; \ - memcpy(t##__desc.basep, t0##__typ - __BASEOFF, level*sizeof(LONGINT)); \ - t##__desc.basep[level] = (LONGINT)(address)t##__typ; \ - t##__desc.module = (LONGINT)(address)m; \ + t##__typ = (address*)&t##__desc.blksz; \ + memcpy(t##__desc.basep, t0##__typ - __BASEOFF, level*sizeof(address)); \ + t##__desc.basep[level] = (address)t##__typ; \ + t##__desc.module = (address)m; \ if(t##__desc.blksz!=sizeof(struct t)) __HALT(-15); \ - t##__desc.blksz = (t##__desc.blksz+5*sizeof(LONGINT)-1)/(4*sizeof(LONGINT))*(4*sizeof(LONGINT)); \ - Heap_REGTYP(m, (LONGINT)(address)&t##__desc.next); \ + t##__desc.blksz = (t##__desc.blksz+5*sizeof(address)-1)/(4*sizeof(address))*(4*sizeof(address)); \ + Heap_REGTYP(m, (address)&t##__desc.next); \ SYSTEM_INHERIT(t##__typ, t0##__typ) -#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(address)typ##__typ) -#define __TYPEOF(p) ((LONGINT*)(address)(*(((LONGINT*)(p))-1))) -#define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) - // Oberon-2 type bound procedures support -#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(address)proc +#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(address)proc #define __SEND(typ, num, funtyp, parlist) ((funtyp)((address)*(typ-(__TPROC0OFF+num))))parlist diff --git a/src/test/confidence/planned-binary-change b/src/test/confidence/planned-binary-change index a2fd3632..b9c5c369 100644 --- a/src/test/confidence/planned-binary-change +++ b/src/test/confidence/planned-binary-change @@ -1 +1 @@ -13 Sep 2016 20:12:45 +14 Sep 2016 13:00:54 From a36e04ebd72fd23ab7480d773423daa17d00c959 Mon Sep 17 00:00:00 2001 From: David Brown Date: Wed, 14 Sep 2016 14:01:31 +0100 Subject: [PATCH 229/580] Replace FetchAddress with (original) SYSTEM.GET. --- bootstrap/unix-44/Heap.c | 60 ++++++++++------------- bootstrap/unix-48/Heap.c | 60 ++++++++++------------- bootstrap/unix-88/Heap.c | 60 ++++++++++------------- bootstrap/windows-48/Heap.c | 60 ++++++++++------------- bootstrap/windows-88/Heap.c | 60 ++++++++++------------- src/system/Heap.Mod | 56 ++++++++++----------- src/test/confidence/planned-binary-change | 2 +- 7 files changed, 151 insertions(+), 207 deletions(-) diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index f03a4d7e..b3a5908c 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -82,7 +82,6 @@ export LONGINT *Heap__1__typ; static void Heap_CheckFin (void); static void Heap_ExtendHeap (address blksz); export void Heap_FINALL (void); -static address Heap_FetchAddress (address pointer); static void Heap_Finalize (void); export void Heap_GC (BOOLEAN markStack); static void Heap_HeapSort (address n, address *a, LONGINT a__len); @@ -188,15 +187,6 @@ static address Heap_NewChunk (address blksz) return _o_result; } -static address Heap_FetchAddress (address pointer) -{ - address _o_result; - address r; - __GET(pointer, r, address); - _o_result = r; - return _o_result; -} - static void Heap_ExtendHeap (address blksz) { address size, chnk, j, next; @@ -212,16 +202,16 @@ static void Heap_ExtendHeap (address blksz) Heap_heap = chnk; } else { j = Heap_heap; - next = Heap_FetchAddress(j); + __GET(j, next, address); while ((next != 0 && chnk > next)) { j = next; - next = Heap_FetchAddress(j); + __GET(j, next, address); } __PUT(chnk, next, address); __PUT(j, chnk, address); } if (next == 0) { - Heap_heapend = Heap_FetchAddress(chnk + 4); + __GET(chnk + 4, Heap_heapend, address); } } } @@ -232,7 +222,7 @@ SYSTEM_PTR Heap_NEWREC (address tag) address i, i0, di, blksz, restsize, t, adr, end, next, prev; SYSTEM_PTR new; Heap_Lock(); - blksz = Heap_FetchAddress(tag); + __GET(tag, blksz, address); i0 = __ASHR(blksz, 4); i = i0; if (i < 9) { @@ -243,7 +233,7 @@ SYSTEM_PTR Heap_NEWREC (address tag) } } if (i < 9) { - next = Heap_FetchAddress(adr + 12); + __GET(adr + 12, next, address); Heap_freeList[i] = next; if (i != i0) { di = i - i0; @@ -284,12 +274,12 @@ SYSTEM_PTR Heap_NEWREC (address tag) return _o_result; } } - t = Heap_FetchAddress(adr + 4); + __GET(adr + 4, t, address); if (t >= blksz) { break; } prev = adr; - adr = Heap_FetchAddress(adr + 12); + __GET(adr + 12, adr, address); } restsize = t - blksz; end = adr + restsize; @@ -299,7 +289,7 @@ SYSTEM_PTR Heap_NEWREC (address tag) if (restsize > 144) { __PUT(adr + 4, restsize, address); } else { - next = Heap_FetchAddress(adr + 12); + __GET(adr + 12, next, address); if (prev == 0) { Heap_bigBlocks = next; } else { @@ -355,7 +345,7 @@ static void Heap_Mark (address q) { address p, tag, offset, fld, n, tagbits; if (q != 0) { - tagbits = Heap_FetchAddress(q - 4); + __GET(q - 4, tagbits, address); if (!__ODD(tagbits)) { __PUT(q - 4, tagbits + 1, address); p = 0; @@ -369,17 +359,17 @@ static void Heap_Mark (address q) } n = q; q = p; - tag = Heap_FetchAddress(q - 4); + __GET(q - 4, tag, address); tag -= 1; __GET(tag, offset, address); fld = q + offset; - p = Heap_FetchAddress(fld); + __GET(fld, p, address); __PUT(fld, (SYSTEM_PTR)(address)n, SYSTEM_PTR); } else { fld = q + offset; - n = Heap_FetchAddress(fld); + __GET(fld, n, address); if (n != 0) { - tagbits = Heap_FetchAddress(n - 4); + __GET(n - 4, tagbits, address); if (!__ODD(tagbits)) { __PUT(n - 4, tagbits + 1, address); __PUT(q - 4, tag + 1, address); @@ -415,9 +405,9 @@ static void Heap_Scan (void) chnk = Heap_heap; while (chnk != 0) { adr = chnk + 12; - end = Heap_FetchAddress(chnk + 4); + __GET(chnk + 4, end, address); while (adr < end) { - tag = Heap_FetchAddress(adr); + __GET(adr, tag, address); if (__ODD(tag)) { if (freesize > 0) { start = adr - freesize; @@ -436,11 +426,11 @@ static void Heap_Scan (void) } tag -= 1; __PUT(adr, tag, address); - size = Heap_FetchAddress(tag); + __GET(tag, size, address); Heap_allocated += size; adr += size; } else { - size = Heap_FetchAddress(tag); + __GET(tag, size, address); freesize += size; adr += size; } @@ -460,7 +450,7 @@ static void Heap_Scan (void) Heap_bigBlocks = start; } } - chnk = Heap_FetchAddress(chnk); + __GET(chnk, chnk, address); } } @@ -509,17 +499,17 @@ static void Heap_MarkCandidates (address n, address *cand, LONGINT cand__len) lim = cand[n - 1]; while ((chnk != 0 && chnk < lim)) { adr = chnk + 12; - lim1 = Heap_FetchAddress(chnk + 4); + __GET(chnk + 4, lim1, address); if (lim < lim1) { lim1 = lim; } while (adr < lim1) { - tag = Heap_FetchAddress(adr); + __GET(adr, tag, address); if (__ODD(tag)) { - size = Heap_FetchAddress(tag - 1); + __GET(tag - 1, size, address); adr += size; } else { - size = Heap_FetchAddress(tag); + __GET(tag, size, address); ptr = adr + 4; while (cand[i] < ptr) { i += 1; @@ -534,7 +524,7 @@ static void Heap_MarkCandidates (address n, address *cand, LONGINT cand__len) adr = next; } } - chnk = Heap_FetchAddress(chnk); + __GET(chnk, chnk, address); } } @@ -544,7 +534,7 @@ static void Heap_CheckFin (void) address tag; n = Heap_fin; while (n != NIL) { - tag = Heap_FetchAddress(n->obj - 4); + __GET(n->obj - 4, tag, address); if (!__ODD(tag)) { n->marked = 0; Heap_Mark(n->obj); @@ -723,7 +713,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) void Heap_InitHeap (void) { Heap_heap = Heap_NewChunk(128000); - Heap_heapend = Heap_FetchAddress(Heap_heap + 4); + __GET(Heap_heap + 4, Heap_heapend, address); __PUT(Heap_heap, 0, address); Heap_allocated = 0; Heap_firstTry = 1; diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index f03a4d7e..b3a5908c 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -82,7 +82,6 @@ export LONGINT *Heap__1__typ; static void Heap_CheckFin (void); static void Heap_ExtendHeap (address blksz); export void Heap_FINALL (void); -static address Heap_FetchAddress (address pointer); static void Heap_Finalize (void); export void Heap_GC (BOOLEAN markStack); static void Heap_HeapSort (address n, address *a, LONGINT a__len); @@ -188,15 +187,6 @@ static address Heap_NewChunk (address blksz) return _o_result; } -static address Heap_FetchAddress (address pointer) -{ - address _o_result; - address r; - __GET(pointer, r, address); - _o_result = r; - return _o_result; -} - static void Heap_ExtendHeap (address blksz) { address size, chnk, j, next; @@ -212,16 +202,16 @@ static void Heap_ExtendHeap (address blksz) Heap_heap = chnk; } else { j = Heap_heap; - next = Heap_FetchAddress(j); + __GET(j, next, address); while ((next != 0 && chnk > next)) { j = next; - next = Heap_FetchAddress(j); + __GET(j, next, address); } __PUT(chnk, next, address); __PUT(j, chnk, address); } if (next == 0) { - Heap_heapend = Heap_FetchAddress(chnk + 4); + __GET(chnk + 4, Heap_heapend, address); } } } @@ -232,7 +222,7 @@ SYSTEM_PTR Heap_NEWREC (address tag) address i, i0, di, blksz, restsize, t, adr, end, next, prev; SYSTEM_PTR new; Heap_Lock(); - blksz = Heap_FetchAddress(tag); + __GET(tag, blksz, address); i0 = __ASHR(blksz, 4); i = i0; if (i < 9) { @@ -243,7 +233,7 @@ SYSTEM_PTR Heap_NEWREC (address tag) } } if (i < 9) { - next = Heap_FetchAddress(adr + 12); + __GET(adr + 12, next, address); Heap_freeList[i] = next; if (i != i0) { di = i - i0; @@ -284,12 +274,12 @@ SYSTEM_PTR Heap_NEWREC (address tag) return _o_result; } } - t = Heap_FetchAddress(adr + 4); + __GET(adr + 4, t, address); if (t >= blksz) { break; } prev = adr; - adr = Heap_FetchAddress(adr + 12); + __GET(adr + 12, adr, address); } restsize = t - blksz; end = adr + restsize; @@ -299,7 +289,7 @@ SYSTEM_PTR Heap_NEWREC (address tag) if (restsize > 144) { __PUT(adr + 4, restsize, address); } else { - next = Heap_FetchAddress(adr + 12); + __GET(adr + 12, next, address); if (prev == 0) { Heap_bigBlocks = next; } else { @@ -355,7 +345,7 @@ static void Heap_Mark (address q) { address p, tag, offset, fld, n, tagbits; if (q != 0) { - tagbits = Heap_FetchAddress(q - 4); + __GET(q - 4, tagbits, address); if (!__ODD(tagbits)) { __PUT(q - 4, tagbits + 1, address); p = 0; @@ -369,17 +359,17 @@ static void Heap_Mark (address q) } n = q; q = p; - tag = Heap_FetchAddress(q - 4); + __GET(q - 4, tag, address); tag -= 1; __GET(tag, offset, address); fld = q + offset; - p = Heap_FetchAddress(fld); + __GET(fld, p, address); __PUT(fld, (SYSTEM_PTR)(address)n, SYSTEM_PTR); } else { fld = q + offset; - n = Heap_FetchAddress(fld); + __GET(fld, n, address); if (n != 0) { - tagbits = Heap_FetchAddress(n - 4); + __GET(n - 4, tagbits, address); if (!__ODD(tagbits)) { __PUT(n - 4, tagbits + 1, address); __PUT(q - 4, tag + 1, address); @@ -415,9 +405,9 @@ static void Heap_Scan (void) chnk = Heap_heap; while (chnk != 0) { adr = chnk + 12; - end = Heap_FetchAddress(chnk + 4); + __GET(chnk + 4, end, address); while (adr < end) { - tag = Heap_FetchAddress(adr); + __GET(adr, tag, address); if (__ODD(tag)) { if (freesize > 0) { start = adr - freesize; @@ -436,11 +426,11 @@ static void Heap_Scan (void) } tag -= 1; __PUT(adr, tag, address); - size = Heap_FetchAddress(tag); + __GET(tag, size, address); Heap_allocated += size; adr += size; } else { - size = Heap_FetchAddress(tag); + __GET(tag, size, address); freesize += size; adr += size; } @@ -460,7 +450,7 @@ static void Heap_Scan (void) Heap_bigBlocks = start; } } - chnk = Heap_FetchAddress(chnk); + __GET(chnk, chnk, address); } } @@ -509,17 +499,17 @@ static void Heap_MarkCandidates (address n, address *cand, LONGINT cand__len) lim = cand[n - 1]; while ((chnk != 0 && chnk < lim)) { adr = chnk + 12; - lim1 = Heap_FetchAddress(chnk + 4); + __GET(chnk + 4, lim1, address); if (lim < lim1) { lim1 = lim; } while (adr < lim1) { - tag = Heap_FetchAddress(adr); + __GET(adr, tag, address); if (__ODD(tag)) { - size = Heap_FetchAddress(tag - 1); + __GET(tag - 1, size, address); adr += size; } else { - size = Heap_FetchAddress(tag); + __GET(tag, size, address); ptr = adr + 4; while (cand[i] < ptr) { i += 1; @@ -534,7 +524,7 @@ static void Heap_MarkCandidates (address n, address *cand, LONGINT cand__len) adr = next; } } - chnk = Heap_FetchAddress(chnk); + __GET(chnk, chnk, address); } } @@ -544,7 +534,7 @@ static void Heap_CheckFin (void) address tag; n = Heap_fin; while (n != NIL) { - tag = Heap_FetchAddress(n->obj - 4); + __GET(n->obj - 4, tag, address); if (!__ODD(tag)) { n->marked = 0; Heap_Mark(n->obj); @@ -723,7 +713,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) void Heap_InitHeap (void) { Heap_heap = Heap_NewChunk(128000); - Heap_heapend = Heap_FetchAddress(Heap_heap + 4); + __GET(Heap_heap + 4, Heap_heapend, address); __PUT(Heap_heap, 0, address); Heap_allocated = 0; Heap_firstTry = 1; diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index 626812cb..26f7af6f 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -82,7 +82,6 @@ export LONGINT *Heap__1__typ; static void Heap_CheckFin (void); static void Heap_ExtendHeap (address blksz); export void Heap_FINALL (void); -static address Heap_FetchAddress (address pointer); static void Heap_Finalize (void); export void Heap_GC (BOOLEAN markStack); static void Heap_HeapSort (address n, address *a, LONGINT a__len); @@ -188,15 +187,6 @@ static address Heap_NewChunk (address blksz) return _o_result; } -static address Heap_FetchAddress (address pointer) -{ - address _o_result; - address r; - __GET(pointer, r, address); - _o_result = r; - return _o_result; -} - static void Heap_ExtendHeap (address blksz) { address size, chnk, j, next; @@ -212,16 +202,16 @@ static void Heap_ExtendHeap (address blksz) Heap_heap = chnk; } else { j = Heap_heap; - next = Heap_FetchAddress(j); + __GET(j, next, address); while ((next != 0 && chnk > next)) { j = next; - next = Heap_FetchAddress(j); + __GET(j, next, address); } __PUT(chnk, next, address); __PUT(j, chnk, address); } if (next == 0) { - Heap_heapend = Heap_FetchAddress(chnk + 8); + __GET(chnk + 8, Heap_heapend, address); } } } @@ -232,7 +222,7 @@ SYSTEM_PTR Heap_NEWREC (address tag) address i, i0, di, blksz, restsize, t, adr, end, next, prev; SYSTEM_PTR new; Heap_Lock(); - blksz = Heap_FetchAddress(tag); + __GET(tag, blksz, address); i0 = __ASHR(blksz, 5); i = i0; if (i < 9) { @@ -243,7 +233,7 @@ SYSTEM_PTR Heap_NEWREC (address tag) } } if (i < 9) { - next = Heap_FetchAddress(adr + 24); + __GET(adr + 24, next, address); Heap_freeList[i] = next; if (i != i0) { di = i - i0; @@ -284,12 +274,12 @@ SYSTEM_PTR Heap_NEWREC (address tag) return _o_result; } } - t = Heap_FetchAddress(adr + 8); + __GET(adr + 8, t, address); if (t >= blksz) { break; } prev = adr; - adr = Heap_FetchAddress(adr + 24); + __GET(adr + 24, adr, address); } restsize = t - blksz; end = adr + restsize; @@ -299,7 +289,7 @@ SYSTEM_PTR Heap_NEWREC (address tag) if (restsize > 288) { __PUT(adr + 8, restsize, address); } else { - next = Heap_FetchAddress(adr + 24); + __GET(adr + 24, next, address); if (prev == 0) { Heap_bigBlocks = next; } else { @@ -355,7 +345,7 @@ static void Heap_Mark (address q) { address p, tag, offset, fld, n, tagbits; if (q != 0) { - tagbits = Heap_FetchAddress(q - 8); + __GET(q - 8, tagbits, address); if (!__ODD(tagbits)) { __PUT(q - 8, tagbits + 1, address); p = 0; @@ -369,17 +359,17 @@ static void Heap_Mark (address q) } n = q; q = p; - tag = Heap_FetchAddress(q - 8); + __GET(q - 8, tag, address); tag -= 1; __GET(tag, offset, address); fld = q + offset; - p = Heap_FetchAddress(fld); + __GET(fld, p, address); __PUT(fld, (SYSTEM_PTR)(address)n, SYSTEM_PTR); } else { fld = q + offset; - n = Heap_FetchAddress(fld); + __GET(fld, n, address); if (n != 0) { - tagbits = Heap_FetchAddress(n - 8); + __GET(n - 8, tagbits, address); if (!__ODD(tagbits)) { __PUT(n - 8, tagbits + 1, address); __PUT(q - 8, tag + 1, address); @@ -415,9 +405,9 @@ static void Heap_Scan (void) chnk = Heap_heap; while (chnk != 0) { adr = chnk + 24; - end = Heap_FetchAddress(chnk + 8); + __GET(chnk + 8, end, address); while (adr < end) { - tag = Heap_FetchAddress(adr); + __GET(adr, tag, address); if (__ODD(tag)) { if (freesize > 0) { start = adr - freesize; @@ -436,11 +426,11 @@ static void Heap_Scan (void) } tag -= 1; __PUT(adr, tag, address); - size = Heap_FetchAddress(tag); + __GET(tag, size, address); Heap_allocated += size; adr += size; } else { - size = Heap_FetchAddress(tag); + __GET(tag, size, address); freesize += size; adr += size; } @@ -460,7 +450,7 @@ static void Heap_Scan (void) Heap_bigBlocks = start; } } - chnk = Heap_FetchAddress(chnk); + __GET(chnk, chnk, address); } } @@ -509,17 +499,17 @@ static void Heap_MarkCandidates (address n, address *cand, LONGINT cand__len) lim = cand[n - 1]; while ((chnk != 0 && chnk < lim)) { adr = chnk + 24; - lim1 = Heap_FetchAddress(chnk + 8); + __GET(chnk + 8, lim1, address); if (lim < lim1) { lim1 = lim; } while (adr < lim1) { - tag = Heap_FetchAddress(adr); + __GET(adr, tag, address); if (__ODD(tag)) { - size = Heap_FetchAddress(tag - 1); + __GET(tag - 1, size, address); adr += size; } else { - size = Heap_FetchAddress(tag); + __GET(tag, size, address); ptr = adr + 8; while (cand[i] < ptr) { i += 1; @@ -534,7 +524,7 @@ static void Heap_MarkCandidates (address n, address *cand, LONGINT cand__len) adr = next; } } - chnk = Heap_FetchAddress(chnk); + __GET(chnk, chnk, address); } } @@ -544,7 +534,7 @@ static void Heap_CheckFin (void) address tag; n = Heap_fin; while (n != NIL) { - tag = Heap_FetchAddress(n->obj - 8); + __GET(n->obj - 8, tag, address); if (!__ODD(tag)) { n->marked = 0; Heap_Mark(n->obj); @@ -723,7 +713,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) void Heap_InitHeap (void) { Heap_heap = Heap_NewChunk(256000); - Heap_heapend = Heap_FetchAddress(Heap_heap + 8); + __GET(Heap_heap + 8, Heap_heapend, address); __PUT(Heap_heap, 0, address); Heap_allocated = 0; Heap_firstTry = 1; diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index f03a4d7e..b3a5908c 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -82,7 +82,6 @@ export LONGINT *Heap__1__typ; static void Heap_CheckFin (void); static void Heap_ExtendHeap (address blksz); export void Heap_FINALL (void); -static address Heap_FetchAddress (address pointer); static void Heap_Finalize (void); export void Heap_GC (BOOLEAN markStack); static void Heap_HeapSort (address n, address *a, LONGINT a__len); @@ -188,15 +187,6 @@ static address Heap_NewChunk (address blksz) return _o_result; } -static address Heap_FetchAddress (address pointer) -{ - address _o_result; - address r; - __GET(pointer, r, address); - _o_result = r; - return _o_result; -} - static void Heap_ExtendHeap (address blksz) { address size, chnk, j, next; @@ -212,16 +202,16 @@ static void Heap_ExtendHeap (address blksz) Heap_heap = chnk; } else { j = Heap_heap; - next = Heap_FetchAddress(j); + __GET(j, next, address); while ((next != 0 && chnk > next)) { j = next; - next = Heap_FetchAddress(j); + __GET(j, next, address); } __PUT(chnk, next, address); __PUT(j, chnk, address); } if (next == 0) { - Heap_heapend = Heap_FetchAddress(chnk + 4); + __GET(chnk + 4, Heap_heapend, address); } } } @@ -232,7 +222,7 @@ SYSTEM_PTR Heap_NEWREC (address tag) address i, i0, di, blksz, restsize, t, adr, end, next, prev; SYSTEM_PTR new; Heap_Lock(); - blksz = Heap_FetchAddress(tag); + __GET(tag, blksz, address); i0 = __ASHR(blksz, 4); i = i0; if (i < 9) { @@ -243,7 +233,7 @@ SYSTEM_PTR Heap_NEWREC (address tag) } } if (i < 9) { - next = Heap_FetchAddress(adr + 12); + __GET(adr + 12, next, address); Heap_freeList[i] = next; if (i != i0) { di = i - i0; @@ -284,12 +274,12 @@ SYSTEM_PTR Heap_NEWREC (address tag) return _o_result; } } - t = Heap_FetchAddress(adr + 4); + __GET(adr + 4, t, address); if (t >= blksz) { break; } prev = adr; - adr = Heap_FetchAddress(adr + 12); + __GET(adr + 12, adr, address); } restsize = t - blksz; end = adr + restsize; @@ -299,7 +289,7 @@ SYSTEM_PTR Heap_NEWREC (address tag) if (restsize > 144) { __PUT(adr + 4, restsize, address); } else { - next = Heap_FetchAddress(adr + 12); + __GET(adr + 12, next, address); if (prev == 0) { Heap_bigBlocks = next; } else { @@ -355,7 +345,7 @@ static void Heap_Mark (address q) { address p, tag, offset, fld, n, tagbits; if (q != 0) { - tagbits = Heap_FetchAddress(q - 4); + __GET(q - 4, tagbits, address); if (!__ODD(tagbits)) { __PUT(q - 4, tagbits + 1, address); p = 0; @@ -369,17 +359,17 @@ static void Heap_Mark (address q) } n = q; q = p; - tag = Heap_FetchAddress(q - 4); + __GET(q - 4, tag, address); tag -= 1; __GET(tag, offset, address); fld = q + offset; - p = Heap_FetchAddress(fld); + __GET(fld, p, address); __PUT(fld, (SYSTEM_PTR)(address)n, SYSTEM_PTR); } else { fld = q + offset; - n = Heap_FetchAddress(fld); + __GET(fld, n, address); if (n != 0) { - tagbits = Heap_FetchAddress(n - 4); + __GET(n - 4, tagbits, address); if (!__ODD(tagbits)) { __PUT(n - 4, tagbits + 1, address); __PUT(q - 4, tag + 1, address); @@ -415,9 +405,9 @@ static void Heap_Scan (void) chnk = Heap_heap; while (chnk != 0) { adr = chnk + 12; - end = Heap_FetchAddress(chnk + 4); + __GET(chnk + 4, end, address); while (adr < end) { - tag = Heap_FetchAddress(adr); + __GET(adr, tag, address); if (__ODD(tag)) { if (freesize > 0) { start = adr - freesize; @@ -436,11 +426,11 @@ static void Heap_Scan (void) } tag -= 1; __PUT(adr, tag, address); - size = Heap_FetchAddress(tag); + __GET(tag, size, address); Heap_allocated += size; adr += size; } else { - size = Heap_FetchAddress(tag); + __GET(tag, size, address); freesize += size; adr += size; } @@ -460,7 +450,7 @@ static void Heap_Scan (void) Heap_bigBlocks = start; } } - chnk = Heap_FetchAddress(chnk); + __GET(chnk, chnk, address); } } @@ -509,17 +499,17 @@ static void Heap_MarkCandidates (address n, address *cand, LONGINT cand__len) lim = cand[n - 1]; while ((chnk != 0 && chnk < lim)) { adr = chnk + 12; - lim1 = Heap_FetchAddress(chnk + 4); + __GET(chnk + 4, lim1, address); if (lim < lim1) { lim1 = lim; } while (adr < lim1) { - tag = Heap_FetchAddress(adr); + __GET(adr, tag, address); if (__ODD(tag)) { - size = Heap_FetchAddress(tag - 1); + __GET(tag - 1, size, address); adr += size; } else { - size = Heap_FetchAddress(tag); + __GET(tag, size, address); ptr = adr + 4; while (cand[i] < ptr) { i += 1; @@ -534,7 +524,7 @@ static void Heap_MarkCandidates (address n, address *cand, LONGINT cand__len) adr = next; } } - chnk = Heap_FetchAddress(chnk); + __GET(chnk, chnk, address); } } @@ -544,7 +534,7 @@ static void Heap_CheckFin (void) address tag; n = Heap_fin; while (n != NIL) { - tag = Heap_FetchAddress(n->obj - 4); + __GET(n->obj - 4, tag, address); if (!__ODD(tag)) { n->marked = 0; Heap_Mark(n->obj); @@ -723,7 +713,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) void Heap_InitHeap (void) { Heap_heap = Heap_NewChunk(128000); - Heap_heapend = Heap_FetchAddress(Heap_heap + 4); + __GET(Heap_heap + 4, Heap_heapend, address); __PUT(Heap_heap, 0, address); Heap_allocated = 0; Heap_firstTry = 1; diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index 626812cb..26f7af6f 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -82,7 +82,6 @@ export LONGINT *Heap__1__typ; static void Heap_CheckFin (void); static void Heap_ExtendHeap (address blksz); export void Heap_FINALL (void); -static address Heap_FetchAddress (address pointer); static void Heap_Finalize (void); export void Heap_GC (BOOLEAN markStack); static void Heap_HeapSort (address n, address *a, LONGINT a__len); @@ -188,15 +187,6 @@ static address Heap_NewChunk (address blksz) return _o_result; } -static address Heap_FetchAddress (address pointer) -{ - address _o_result; - address r; - __GET(pointer, r, address); - _o_result = r; - return _o_result; -} - static void Heap_ExtendHeap (address blksz) { address size, chnk, j, next; @@ -212,16 +202,16 @@ static void Heap_ExtendHeap (address blksz) Heap_heap = chnk; } else { j = Heap_heap; - next = Heap_FetchAddress(j); + __GET(j, next, address); while ((next != 0 && chnk > next)) { j = next; - next = Heap_FetchAddress(j); + __GET(j, next, address); } __PUT(chnk, next, address); __PUT(j, chnk, address); } if (next == 0) { - Heap_heapend = Heap_FetchAddress(chnk + 8); + __GET(chnk + 8, Heap_heapend, address); } } } @@ -232,7 +222,7 @@ SYSTEM_PTR Heap_NEWREC (address tag) address i, i0, di, blksz, restsize, t, adr, end, next, prev; SYSTEM_PTR new; Heap_Lock(); - blksz = Heap_FetchAddress(tag); + __GET(tag, blksz, address); i0 = __ASHR(blksz, 5); i = i0; if (i < 9) { @@ -243,7 +233,7 @@ SYSTEM_PTR Heap_NEWREC (address tag) } } if (i < 9) { - next = Heap_FetchAddress(adr + 24); + __GET(adr + 24, next, address); Heap_freeList[i] = next; if (i != i0) { di = i - i0; @@ -284,12 +274,12 @@ SYSTEM_PTR Heap_NEWREC (address tag) return _o_result; } } - t = Heap_FetchAddress(adr + 8); + __GET(adr + 8, t, address); if (t >= blksz) { break; } prev = adr; - adr = Heap_FetchAddress(adr + 24); + __GET(adr + 24, adr, address); } restsize = t - blksz; end = adr + restsize; @@ -299,7 +289,7 @@ SYSTEM_PTR Heap_NEWREC (address tag) if (restsize > 288) { __PUT(adr + 8, restsize, address); } else { - next = Heap_FetchAddress(adr + 24); + __GET(adr + 24, next, address); if (prev == 0) { Heap_bigBlocks = next; } else { @@ -355,7 +345,7 @@ static void Heap_Mark (address q) { address p, tag, offset, fld, n, tagbits; if (q != 0) { - tagbits = Heap_FetchAddress(q - 8); + __GET(q - 8, tagbits, address); if (!__ODD(tagbits)) { __PUT(q - 8, tagbits + 1, address); p = 0; @@ -369,17 +359,17 @@ static void Heap_Mark (address q) } n = q; q = p; - tag = Heap_FetchAddress(q - 8); + __GET(q - 8, tag, address); tag -= 1; __GET(tag, offset, address); fld = q + offset; - p = Heap_FetchAddress(fld); + __GET(fld, p, address); __PUT(fld, (SYSTEM_PTR)(address)n, SYSTEM_PTR); } else { fld = q + offset; - n = Heap_FetchAddress(fld); + __GET(fld, n, address); if (n != 0) { - tagbits = Heap_FetchAddress(n - 8); + __GET(n - 8, tagbits, address); if (!__ODD(tagbits)) { __PUT(n - 8, tagbits + 1, address); __PUT(q - 8, tag + 1, address); @@ -415,9 +405,9 @@ static void Heap_Scan (void) chnk = Heap_heap; while (chnk != 0) { adr = chnk + 24; - end = Heap_FetchAddress(chnk + 8); + __GET(chnk + 8, end, address); while (adr < end) { - tag = Heap_FetchAddress(adr); + __GET(adr, tag, address); if (__ODD(tag)) { if (freesize > 0) { start = adr - freesize; @@ -436,11 +426,11 @@ static void Heap_Scan (void) } tag -= 1; __PUT(adr, tag, address); - size = Heap_FetchAddress(tag); + __GET(tag, size, address); Heap_allocated += size; adr += size; } else { - size = Heap_FetchAddress(tag); + __GET(tag, size, address); freesize += size; adr += size; } @@ -460,7 +450,7 @@ static void Heap_Scan (void) Heap_bigBlocks = start; } } - chnk = Heap_FetchAddress(chnk); + __GET(chnk, chnk, address); } } @@ -509,17 +499,17 @@ static void Heap_MarkCandidates (address n, address *cand, LONGINT cand__len) lim = cand[n - 1]; while ((chnk != 0 && chnk < lim)) { adr = chnk + 24; - lim1 = Heap_FetchAddress(chnk + 8); + __GET(chnk + 8, lim1, address); if (lim < lim1) { lim1 = lim; } while (adr < lim1) { - tag = Heap_FetchAddress(adr); + __GET(adr, tag, address); if (__ODD(tag)) { - size = Heap_FetchAddress(tag - 1); + __GET(tag - 1, size, address); adr += size; } else { - size = Heap_FetchAddress(tag); + __GET(tag, size, address); ptr = adr + 8; while (cand[i] < ptr) { i += 1; @@ -534,7 +524,7 @@ static void Heap_MarkCandidates (address n, address *cand, LONGINT cand__len) adr = next; } } - chnk = Heap_FetchAddress(chnk); + __GET(chnk, chnk, address); } } @@ -544,7 +534,7 @@ static void Heap_CheckFin (void) address tag; n = Heap_fin; while (n != NIL) { - tag = Heap_FetchAddress(n->obj - 8); + __GET(n->obj - 8, tag, address); if (!__ODD(tag)) { n->marked = 0; Heap_Mark(n->obj); @@ -723,7 +713,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) void Heap_InitHeap (void) { Heap_heap = Heap_NewChunk(256000); - Heap_heapend = Heap_FetchAddress(Heap_heap + 8); + __GET(Heap_heap + 8, Heap_heapend, address); __PUT(Heap_heap, 0, address); Heap_allocated = 0; Heap_firstTry = 1; diff --git a/src/system/Heap.Mod b/src/system/Heap.Mod index 00023a0a..0ba6d076 100644 --- a/src/system/Heap.Mod +++ b/src/system/Heap.Mod @@ -183,12 +183,6 @@ MODULE Heap; RETURN chnk END NewChunk; - - (* - PROCEDURE -FetchAddress(pointer: Address): Address "(address)(*((void**)((address)pointer)))"; - *) - PROCEDURE FetchAddress(pointer: Address): Address; VAR r: Address; BEGIN SYSTEM.GET(pointer, r); RETURN r END FetchAddress; - PROCEDURE ExtendHeap(blksz: Address); VAR size, chnk, j, next: Address; BEGIN @@ -201,14 +195,14 @@ MODULE Heap; IF chnk < heap THEN SYSTEM.PUT(chnk, heap); heap := chnk ELSE - j := heap; next := FetchAddress(j); + j := heap; SYSTEM.GET(j, next); WHILE (next # 0) & (chnk > next) DO j := next; - next := FetchAddress(j) + SYSTEM.GET(j, next) END; SYSTEM.PUT(chnk, next); SYSTEM.PUT(j, chnk) END ; - IF next = 0 THEN heapend := FetchAddress(chnk+endOff) END + IF next = 0 THEN SYSTEM.GET(chnk+endOff, heapend) END END END ExtendHeap; @@ -220,7 +214,7 @@ MODULE Heap; new: SYSTEM.PTR; BEGIN Lock(); - blksz := FetchAddress(tag); + SYSTEM.GET(tag, blksz); ASSERT((Unit = 16) OR (Unit = 32)); ASSERT(SIZE(SYSTEM.PTR) = SIZE(Address)); @@ -231,7 +225,7 @@ MODULE Heap; WHILE adr = 0 DO INC(i); adr := freeList[i] END END ; IF i < nofLists THEN (* unlink *) - next := FetchAddress(adr + nextOff); + SYSTEM.GET(adr + nextOff, next); freeList[i] := next; IF i # i0 THEN (* split *) di := i - i0; restsize := di * Unit; end := adr + restsize; @@ -265,9 +259,9 @@ MODULE Heap; Unlock(); RETURN NIL END END ; - t := FetchAddress(adr+sizeOff); + SYSTEM.GET(adr+sizeOff, t); IF t >= blksz THEN EXIT END ; - prev := adr; adr := FetchAddress(adr + nextOff) + prev := adr; SYSTEM.GET(adr + nextOff, adr) END ; restsize := t - blksz; end := adr + restsize; SYSTEM.PUT(end + sizeOff, blksz); @@ -276,7 +270,7 @@ MODULE Heap; IF restsize > nofLists * Unit THEN (*resize*) SYSTEM.PUT(adr + sizeOff, restsize) ELSE (*unlink*) - next := FetchAddress(adr + nextOff); + SYSTEM.GET(adr + nextOff, next); IF prev = 0 THEN bigBlocks := next ELSE SYSTEM.PUT(prev + nextOff, next); END ; @@ -325,7 +319,7 @@ MODULE Heap; VAR p, tag, offset, fld, n, tagbits: Address; BEGIN IF q # 0 THEN - tagbits := FetchAddress(q - SZA); (* Load the tag for the record at q *) + SYSTEM.GET(q - SZA, tagbits); (* Load the tag for the record at q *) IF ~ODD(tagbits) THEN (* If it has not already been marked *) SYSTEM.PUT(q - SZA, tagbits + 1); (* Mark it *) p := 0; @@ -336,14 +330,14 @@ MODULE Heap; SYSTEM.PUT(q - SZA, tag + offset + 1); (* Rotate base ptr into tag *) IF p = 0 THEN EXIT END ; n := q; q := p; - tag := FetchAddress(q - SZA); DEC(tag, 1); + SYSTEM.GET(q - SZA, tag); DEC(tag, 1); SYSTEM.GET(tag, offset); fld := q + offset; - p := FetchAddress(fld); SYSTEM.PUT(fld, SYSTEM.VAL(SYSTEM.PTR, n)) + SYSTEM.GET(fld, p); SYSTEM.PUT(fld, SYSTEM.VAL(SYSTEM.PTR, n)) ELSE (* offset references a ptr field *) fld := q + offset; (* Address the pointer *) - n := FetchAddress(fld); (* Load the pointer *) + SYSTEM.GET(fld, n); (* Load the pointer *) IF n # 0 THEN (* If pointer is not NIL *) - tagbits := FetchAddress(n - SZA); (* Consider record pointed to by this field *) + SYSTEM.GET(n - SZA, tagbits); (* Consider record pointed to by this field *) IF ~ODD(tagbits) THEN SYSTEM.PUT(n - SZA, tagbits + 1); SYSTEM.PUT(q - SZA, tag + 1); @@ -371,9 +365,9 @@ MODULE Heap; freesize := 0; allocated := 0; chnk := heap; WHILE chnk # 0 DO adr := chnk + blkOff; - end := FetchAddress(chnk + endOff); + SYSTEM.GET(chnk + endOff, end); WHILE adr < end DO - tag := FetchAddress(adr); + SYSTEM.GET(adr, tag); IF ODD(tag) THEN (*marked*) IF freesize > 0 THEN start := adr - freesize; @@ -387,11 +381,11 @@ MODULE Heap; END ; DEC(tag, 1); SYSTEM.PUT(adr, tag); - size := FetchAddress(tag); + SYSTEM.GET(tag, size); INC(allocated, size); INC(adr, size) ELSE (*unmarked*) - size := FetchAddress(tag); + SYSTEM.GET(tag, size); INC(freesize, size); INC(adr, size) END @@ -406,7 +400,7 @@ MODULE Heap; ELSE SYSTEM.PUT(start + nextOff, bigBlocks); bigBlocks := start END END ; - chnk := FetchAddress(chnk) + SYSTEM.GET(chnk, chnk) END END Scan; @@ -434,14 +428,14 @@ MODULE Heap; chnk := heap; i := 0; lim := cand[n-1]; WHILE (chnk # 0 ) & (chnk < lim) DO adr := chnk + blkOff; - lim1 := FetchAddress(chnk + endOff); + SYSTEM.GET(chnk + endOff, lim1); IF lim < lim1 THEN lim1 := lim END ; WHILE adr < lim1 DO - tag := FetchAddress(adr); + SYSTEM.GET(adr, tag); IF ODD(tag) THEN (*already marked*) - size := FetchAddress(tag-1); INC(adr, size) + SYSTEM.GET(tag-1, size); INC(adr, size) ELSE - size := FetchAddress(tag); + SYSTEM.GET(tag, size); ptr := adr + SZA; WHILE cand[i] < ptr DO INC(i) END ; IF i = n THEN RETURN END ; @@ -450,7 +444,7 @@ MODULE Heap; adr := next END END ; - chnk := FetchAddress(chnk) + SYSTEM.GET(chnk, chnk) END END MarkCandidates; @@ -459,7 +453,7 @@ MODULE Heap; BEGIN n := fin; WHILE n # NIL DO - tag := FetchAddress(n.obj - SZA); + SYSTEM.GET(n.obj - SZA, tag); IF ~ODD(tag) THEN n.marked := FALSE; Mark(n.obj) ELSE n.marked := TRUE END ; @@ -574,7 +568,7 @@ PROCEDURE -HeapModuleInit 'Heap__init()'; initialised, to enable NEW, SYSTEM.NEW *) BEGIN heap := NewChunk(heapSize0); - heapend := FetchAddress(heap + endOff); + SYSTEM.GET(heap + endOff, heapend); SYSTEM.PUT(heap, AddressZero); allocated := 0; firstTry := TRUE; freeList[nofLists] := 1; lockdepth := 0; FileCount := 0; modules := NIL; heapsize := 0; bigBlocks := 0; fin := NIL; diff --git a/src/test/confidence/planned-binary-change b/src/test/confidence/planned-binary-change index b9c5c369..9613b179 100644 --- a/src/test/confidence/planned-binary-change +++ b/src/test/confidence/planned-binary-change @@ -1 +1 @@ -14 Sep 2016 13:00:54 +14 Sep 2016 13:59:08 From 7fad168e4081c27d7bd266edb51b49b9a70f23fd Mon Sep 17 00:00:00 2001 From: David Brown Date: Wed, 14 Sep 2016 14:22:24 +0100 Subject: [PATCH 230/580] Tidy source of HEAP a bit. --- src/system/Heap.Mod | 308 ++++++++++++++++++++++---------------------- 1 file changed, 153 insertions(+), 155 deletions(-) diff --git a/src/system/Heap.Mod b/src/system/Heap.Mod index 0ba6d076..b05b218b 100644 --- a/src/system/Heap.Mod +++ b/src/system/Heap.Mod @@ -1,17 +1,15 @@ MODULE Heap; - IMPORT SYSTEM; (* Cannot import anything else as heap initialization must complete - before any other modules are initialized. *) - - TYPE Address = SYSTEM.ADDRESS; + IMPORT S := SYSTEM; (* Cannot import anything else as heap initialization must complete + before any other modules are initialized. *) CONST ModNameLen = 20; CmdNameLen = 24; - SZA = SIZE(Address); (* Size of address *) - Unit = 4*SZA; (* smallest possible heap block *) - nofLists = 9; (* number of free_lists *) - heapSize0 = 8000*Unit; (* startup heap size *) + SZA = SIZE(S.ADDRESS); (* Size of address *) + Unit = 4*SZA; (* smallest possible heap block *) + nofLists = 9; (* number of free_lists *) + heapSize0 = 8000*Unit; (* startup heap size *) (* all blocks look the same: free blocks describe themselves: size = Unit @@ -22,17 +20,17 @@ MODULE Heap; *) (* heap chunks *) - nextChnkOff = SYSTEM.VAL(Address, 0); (* next heap chunk, sorted ascendingly! *) - endOff = SYSTEM.VAL(Address, SZA); (* end of heap chunk *) - blkOff = SYSTEM.VAL(Address, 3*SZA); (* first block in a chunk *) + nextChnkOff = S.VAL(S.ADDRESS, 0); (* next heap chunk, sorted ascendingly! *) + endOff = S.VAL(S.ADDRESS, SZA); (* end of heap chunk *) + blkOff = S.VAL(S.ADDRESS, 3*SZA); (* first block in a chunk *) (* heap blocks *) - tagOff = SYSTEM.VAL(Address, 0); (* block starts with tag *) - sizeOff = SYSTEM.VAL(Address, SZA); (* block size in free block relative to block start *) - sntlOff = SYSTEM.VAL(Address, 2*SZA); (* pointer offset table sentinel in free block relative to block start *) - nextOff = SYSTEM.VAL(Address, 3*SZA); (* next pointer in free block relative to block start *) - NoPtrSntl = SYSTEM.VAL(Address, -SZA); - AddressZero = SYSTEM.VAL(Address, 0); + tagOff = S.VAL(S.ADDRESS, 0); (* block starts with tag *) + sizeOff = S.VAL(S.ADDRESS, SZA); (* block size in free block relative to block start *) + sntlOff = S.VAL(S.ADDRESS, 2*SZA); (* pointer offset table sentinel in free block relative to block start *) + nextOff = S.VAL(S.ADDRESS, 3*SZA); (* next pointer in free block relative to block start *) + NoPtrSntl = S.VAL(S.ADDRESS, -SZA); + AddressZero = S.VAL(S.ADDRESS, 0); TYPE ModuleName = ARRAY ModNameLen OF CHAR; @@ -41,14 +39,14 @@ MODULE Heap; Module = POINTER TO ModuleDesc; Cmd = POINTER TO CmdDesc; - EnumProc = PROCEDURE(P: PROCEDURE(p: SYSTEM.PTR)); + EnumProc = PROCEDURE(P: PROCEDURE(p: S.PTR)); ModuleDesc = RECORD next: Module; name: ModuleName; refcnt: LONGINT; cmds: Cmd; - types: Address; + types: S.ADDRESS; enumPtrs: EnumProc; reserved1, reserved2: LONGINT END ; @@ -61,29 +59,29 @@ MODULE Heap; cmd: Command END ; - Finalizer = PROCEDURE(obj: SYSTEM.PTR); + Finalizer = PROCEDURE(obj: S.PTR); FinNode = POINTER TO FinDesc; FinDesc = RECORD next: FinNode; - obj: Address; (* weak pointer *) + obj: S.ADDRESS; (* weak pointer *) marked: BOOLEAN; finalize: Finalizer; END ; VAR (* the list of loaded (=initialization started) modules *) - modules*: SYSTEM.PTR; + modules*: S.PTR; - freeList: ARRAY nofLists + 1 OF Address; (* dummy, 16, 32, 48, 64, 80, 96, 112, 128, sentinel *) - bigBlocks: Address; - allocated*: Address; + freeList: ARRAY nofLists + 1 OF S.ADDRESS; (* dummy, 16, 32, 48, 64, 80, 96, 112, 128, sentinel *) + bigBlocks: S.ADDRESS; + allocated*: S.ADDRESS; firstTry: BOOLEAN; (* extensible heap *) - heap: Address; (* the sorted list of heap chunks *) - heapend: Address; (* max possible pointer value (used for stack collection) *) - heapsize*: Address; (* the sum of all heap chunk sizes *) + heap: S.ADDRESS; (* the sorted list of heap chunks *) + heapend: S.ADDRESS; (* max possible pointer value (used for stack collection) *) + heapsize*: S.ADDRESS; (* the sum of all heap chunk sizes *) (* finalization candidates *) fin: FinNode; @@ -122,20 +120,20 @@ MODULE Heap; END TAS; *) - PROCEDURE REGMOD*(VAR name: ModuleName; enumPtrs: EnumProc): SYSTEM.PTR; + PROCEDURE REGMOD*(VAR name: ModuleName; enumPtrs: EnumProc): S.PTR; VAR m: Module; BEGIN (* REGMOD is called at the start of module initialisation code before that modules type descriptors have been set up. 'NEW' depends on the Heap modules type descriptors being ready for use, therefore, just for the Heap module itself, we - must use SYSTEM.NEW. *) + must use S.NEW. *) IF name = "Heap" THEN - SYSTEM.NEW(m, SIZE(ModuleDesc)) + S.NEW(m, SIZE(ModuleDesc)) ELSE NEW(m) END; m.types := 0; m.cmds := NIL; - COPY(name, m.name); m.refcnt := 0; m.enumPtrs := enumPtrs; m.next := SYSTEM.VAL(Module, modules); + COPY(name, m.name); m.refcnt := 0; m.enumPtrs := enumPtrs; m.next := S.VAL(Module, modules); modules := m; RETURN m END REGMOD; @@ -146,17 +144,17 @@ MODULE Heap; (* REGCMD is called during module initialisation code before that modules type descriptors have been set up. 'NEW' depends on the Heap modules type descriptors being ready for use, therefore, just for the commands registered - by the Heap module itself, we must use SYSTEM.NEW. *) + by the Heap module itself, we must use S.NEW. *) IF m.name = "Heap" THEN - SYSTEM.NEW(c, SIZE(CmdDesc)) + S.NEW(c, SIZE(CmdDesc)) ELSE NEW(c) END; COPY(name, c.name); c.cmd := cmd; c.next := m.cmds; m.cmds := c END REGCMD; - PROCEDURE REGTYP*(m: Module; typ: Address); - BEGIN SYSTEM.PUT(typ, m.types); m.types := typ + PROCEDURE REGTYP*(m: Module; typ: S.ADDRESS); + BEGIN S.PUT(typ, m.types); m.types := typ END REGTYP; PROCEDURE INCREF*(m: Module); @@ -165,26 +163,26 @@ MODULE Heap; PROCEDURE -ExternPlatformOSAllocate "extern address Platform_OSAllocate(address size);"; - PROCEDURE -OSAllocate(size: Address): Address "Platform_OSAllocate(size)"; + PROCEDURE -OSAllocate(size: S.ADDRESS): S.ADDRESS "Platform_OSAllocate(size)"; - PROCEDURE NewChunk(blksz: Address): Address; - VAR chnk: Address; + PROCEDURE NewChunk(blksz: S.ADDRESS): S.ADDRESS; + VAR chnk: S.ADDRESS; BEGIN chnk := OSAllocate(blksz + blkOff); IF chnk # 0 THEN - SYSTEM.PUT(chnk + endOff, chnk + (blkOff + blksz)); - SYSTEM.PUT(chnk + blkOff, chnk + (blkOff + sizeOff)); - SYSTEM.PUT(chnk + (blkOff + sizeOff), blksz); - SYSTEM.PUT(chnk + (blkOff + sntlOff), NoPtrSntl); - SYSTEM.PUT(chnk + (blkOff + nextOff), bigBlocks); + S.PUT(chnk + endOff, chnk + (blkOff + blksz)); + S.PUT(chnk + blkOff, chnk + (blkOff + sizeOff)); + S.PUT(chnk + (blkOff + sizeOff), blksz); + S.PUT(chnk + (blkOff + sntlOff), NoPtrSntl); + S.PUT(chnk + (blkOff + nextOff), bigBlocks); bigBlocks := chnk + blkOff; INC(heapsize, blksz) END ; RETURN chnk END NewChunk; - PROCEDURE ExtendHeap(blksz: Address); - VAR size, chnk, j, next: Address; + PROCEDURE ExtendHeap(blksz: S.ADDRESS); + VAR size, chnk, j, next: S.ADDRESS; BEGIN IF blksz > 10000*Unit THEN size := blksz ELSE size := 10000*Unit (* additional heuristics *) @@ -193,31 +191,31 @@ MODULE Heap; IF chnk # 0 THEN (*sorted insertion*) IF chnk < heap THEN - SYSTEM.PUT(chnk, heap); heap := chnk + S.PUT(chnk, heap); heap := chnk ELSE - j := heap; SYSTEM.GET(j, next); + j := heap; S.GET(j, next); WHILE (next # 0) & (chnk > next) DO j := next; - SYSTEM.GET(j, next) + S.GET(j, next) END; - SYSTEM.PUT(chnk, next); SYSTEM.PUT(j, chnk) + S.PUT(chnk, next); S.PUT(j, chnk) END ; - IF next = 0 THEN SYSTEM.GET(chnk+endOff, heapend) END + IF next = 0 THEN S.GET(chnk+endOff, heapend) END END END ExtendHeap; PROCEDURE ^GC*(markStack: BOOLEAN); - PROCEDURE NEWREC*(tag: Address): SYSTEM.PTR; + PROCEDURE NEWREC*(tag: S.ADDRESS): S.PTR; VAR - i, i0, di, blksz, restsize, t, adr, end, next, prev: Address; - new: SYSTEM.PTR; + i, i0, di, blksz, restsize, t, adr, end, next, prev: S.ADDRESS; + new: S.PTR; BEGIN Lock(); - SYSTEM.GET(tag, blksz); + S.GET(tag, blksz); ASSERT((Unit = 16) OR (Unit = 32)); - ASSERT(SIZE(SYSTEM.PTR) = SIZE(Address)); + ASSERT(SIZE(S.PTR) = SIZE(S.ADDRESS)); ASSERT(blksz MOD Unit = 0); i0 := blksz DIV Unit; i := i0; @@ -225,15 +223,15 @@ MODULE Heap; WHILE adr = 0 DO INC(i); adr := freeList[i] END END ; IF i < nofLists THEN (* unlink *) - SYSTEM.GET(adr + nextOff, next); + S.GET(adr + nextOff, next); freeList[i] := next; IF i # i0 THEN (* split *) di := i - i0; restsize := di * Unit; end := adr + restsize; - SYSTEM.PUT(end + sizeOff, blksz); - SYSTEM.PUT(end + sntlOff, NoPtrSntl); - SYSTEM.PUT(end, end + sizeOff); - SYSTEM.PUT(adr + sizeOff, restsize); - SYSTEM.PUT(adr + nextOff, freeList[di]); + S.PUT(end + sizeOff, blksz); + S.PUT(end + sntlOff, NoPtrSntl); + S.PUT(end, end + sizeOff); + S.PUT(adr + sizeOff, restsize); + S.PUT(adr + nextOff, freeList[di]); freeList[di] := adr; INC(adr, restsize) END @@ -259,25 +257,25 @@ MODULE Heap; Unlock(); RETURN NIL END END ; - SYSTEM.GET(adr+sizeOff, t); + S.GET(adr+sizeOff, t); IF t >= blksz THEN EXIT END ; - prev := adr; SYSTEM.GET(adr + nextOff, adr) + prev := adr; S.GET(adr + nextOff, adr) END ; restsize := t - blksz; end := adr + restsize; - SYSTEM.PUT(end + sizeOff, blksz); - SYSTEM.PUT(end + sntlOff, NoPtrSntl); - SYSTEM.PUT(end, end + sizeOff); + S.PUT(end + sizeOff, blksz); + S.PUT(end + sntlOff, NoPtrSntl); + S.PUT(end, end + sizeOff); IF restsize > nofLists * Unit THEN (*resize*) - SYSTEM.PUT(adr + sizeOff, restsize) + S.PUT(adr + sizeOff, restsize) ELSE (*unlink*) - SYSTEM.GET(adr + nextOff, next); + S.GET(adr + nextOff, next); IF prev = 0 THEN bigBlocks := next - ELSE SYSTEM.PUT(prev + nextOff, next); + ELSE S.PUT(prev + nextOff, next); END ; IF restsize > 0 THEN (*move*) di := restsize DIV Unit; - SYSTEM.PUT(adr + sizeOff, restsize); - SYSTEM.PUT(adr + nextOff, freeList[di]); + S.PUT(adr + sizeOff, restsize); + S.PUT(adr + nextOff, freeList[di]); freeList[di] := adr END END ; @@ -285,63 +283,63 @@ MODULE Heap; END ; i := adr + 4*SZA; end := adr + blksz; WHILE i < end DO (*deliberately unrolled*) - SYSTEM.PUT(i, AddressZero); - SYSTEM.PUT(i + SZA, AddressZero); - SYSTEM.PUT(i + 2*SZA, AddressZero); - SYSTEM.PUT(i + 3*SZA, AddressZero); + S.PUT(i, AddressZero); + S.PUT(i + SZA, AddressZero); + S.PUT(i + 2*SZA, AddressZero); + S.PUT(i + 3*SZA, AddressZero); INC(i, 4*SZA) END ; - SYSTEM.PUT(adr + nextOff, AddressZero); - SYSTEM.PUT(adr, tag); - SYSTEM.PUT(adr + sizeOff, AddressZero); - SYSTEM.PUT(adr + sntlOff, AddressZero); + S.PUT(adr + nextOff, AddressZero); + S.PUT(adr, tag); + S.PUT(adr + sizeOff, AddressZero); + S.PUT(adr + sntlOff, AddressZero); INC(allocated, blksz); Unlock(); - RETURN SYSTEM.VAL(SYSTEM.PTR, adr + SZA) + RETURN S.VAL(S.PTR, adr + SZA) END NEWREC; - PROCEDURE NEWBLK*(size: Address): SYSTEM.PTR; - VAR blksz, tag: Address; new: SYSTEM.PTR; + PROCEDURE NEWBLK*(size: S.ADDRESS): S.PTR; + VAR blksz, tag: S.ADDRESS; new: S.PTR; BEGIN Lock(); blksz := (size + (4*SZA + Unit - 1)) DIV Unit * Unit; (*size + tag + meta + blksz + sntnl + UnitAlignment*) - new := NEWREC(SYSTEM.ADR(blksz)); - tag := SYSTEM.VAL(Address, new) + blksz - 3*SZA; - SYSTEM.PUT(tag - SZA, AddressZero); (*reserved for meta info*) - SYSTEM.PUT(tag, blksz); - SYSTEM.PUT(tag + SZA, NoPtrSntl); - SYSTEM.PUT(SYSTEM.VAL(Address, new) - SZA, tag); + new := NEWREC(S.ADR(blksz)); + tag := S.VAL(S.ADDRESS, new) + blksz - 3*SZA; + S.PUT(tag - SZA, AddressZero); (*reserved for meta info*) + S.PUT(tag, blksz); + S.PUT(tag + SZA, NoPtrSntl); + S.PUT(S.VAL(S.ADDRESS, new) - SZA, tag); Unlock(); RETURN new END NEWBLK; - PROCEDURE Mark(q: Address); - VAR p, tag, offset, fld, n, tagbits: Address; + PROCEDURE Mark(q: S.ADDRESS); + VAR p, tag, offset, fld, n, tagbits: S.ADDRESS; BEGIN IF q # 0 THEN - SYSTEM.GET(q - SZA, tagbits); (* Load the tag for the record at q *) + S.GET(q - SZA, tagbits); (* Load the tag for the record at q *) IF ~ODD(tagbits) THEN (* If it has not already been marked *) - SYSTEM.PUT(q - SZA, tagbits + 1); (* Mark it *) + S.PUT(q - SZA, tagbits + 1); (* Mark it *) p := 0; tag := tagbits + SZA; (* Tag addresses first offset *) LOOP - SYSTEM.GET(tag, offset); (* Get next ptr field offset *) + S.GET(tag, offset); (* Get next ptr field offset *) IF offset < 0 THEN (* Sentinel reached: Value is -8*(#fields+1) *) - SYSTEM.PUT(q - SZA, tag + offset + 1); (* Rotate base ptr into tag *) + S.PUT(q - SZA, tag + offset + 1); (* Rotate base ptr into tag *) IF p = 0 THEN EXIT END ; n := q; q := p; - SYSTEM.GET(q - SZA, tag); DEC(tag, 1); - SYSTEM.GET(tag, offset); fld := q + offset; - SYSTEM.GET(fld, p); SYSTEM.PUT(fld, SYSTEM.VAL(SYSTEM.PTR, n)) + S.GET(q - SZA, tag); DEC(tag, 1); + S.GET(tag, offset); fld := q + offset; + S.GET(fld, p); S.PUT(fld, S.VAL(S.PTR, n)) ELSE (* offset references a ptr field *) - fld := q + offset; (* Address the pointer *) - SYSTEM.GET(fld, n); (* Load the pointer *) + fld := q + offset; (* S.ADDRESS the pointer *) + S.GET(fld, n); (* Load the pointer *) IF n # 0 THEN (* If pointer is not NIL *) - SYSTEM.GET(n - SZA, tagbits); (* Consider record pointed to by this field *) + S.GET(n - SZA, tagbits); (* Consider record pointed to by this field *) IF ~ODD(tagbits) THEN - SYSTEM.PUT(n - SZA, tagbits + 1); - SYSTEM.PUT(q - SZA, tag + 1); - SYSTEM.PUT(fld, SYSTEM.VAL(SYSTEM.PTR, p)); + S.PUT(n - SZA, tagbits + 1); + S.PUT(q - SZA, tag + 1); + S.PUT(fld, S.VAL(S.PTR, p)); p := q; q := n; tag := tagbits END @@ -353,59 +351,59 @@ MODULE Heap; END END Mark; - PROCEDURE MarkP(p: SYSTEM.PTR); (* for compatibility with EnumPtrs in ANSI mode *) + PROCEDURE MarkP(p: S.PTR); (* for compatibility with EnumPtrs in ANSI mode *) BEGIN - Mark(SYSTEM.VAL(Address, p)) + Mark(S.VAL(S.ADDRESS, p)) END MarkP; PROCEDURE Scan; - VAR chnk, adr, end, start, tag, i, size, freesize: Address; + VAR chnk, adr, end, start, tag, i, size, freesize: S.ADDRESS; BEGIN bigBlocks := 0; i := 1; WHILE i < nofLists DO freeList[i] := 0; INC(i) END ; freesize := 0; allocated := 0; chnk := heap; WHILE chnk # 0 DO adr := chnk + blkOff; - SYSTEM.GET(chnk + endOff, end); + S.GET(chnk + endOff, end); WHILE adr < end DO - SYSTEM.GET(adr, tag); + S.GET(adr, tag); IF ODD(tag) THEN (*marked*) IF freesize > 0 THEN start := adr - freesize; - SYSTEM.PUT(start, start+SZA); - SYSTEM.PUT(start+sizeOff, freesize); - SYSTEM.PUT(start+sntlOff, NoPtrSntl); + S.PUT(start, start+SZA); + S.PUT(start+sizeOff, freesize); + S.PUT(start+sntlOff, NoPtrSntl); i := freesize DIV Unit; freesize := 0; - IF i < nofLists THEN SYSTEM.PUT(start + nextOff, freeList[i]); freeList[i] := start - ELSE SYSTEM.PUT(start + nextOff, bigBlocks); bigBlocks := start + IF i < nofLists THEN S.PUT(start + nextOff, freeList[i]); freeList[i] := start + ELSE S.PUT(start + nextOff, bigBlocks); bigBlocks := start END END ; DEC(tag, 1); - SYSTEM.PUT(adr, tag); - SYSTEM.GET(tag, size); + S.PUT(adr, tag); + S.GET(tag, size); INC(allocated, size); INC(adr, size) ELSE (*unmarked*) - SYSTEM.GET(tag, size); + S.GET(tag, size); INC(freesize, size); INC(adr, size) END END ; IF freesize > 0 THEN (*collect last block*) start := adr - freesize; - SYSTEM.PUT(start, start+SZA); - SYSTEM.PUT(start+sizeOff, freesize); - SYSTEM.PUT(start+sntlOff, NoPtrSntl); + S.PUT(start, start+SZA); + S.PUT(start+sizeOff, freesize); + S.PUT(start+sntlOff, NoPtrSntl); i := freesize DIV Unit; freesize := 0; - IF i < nofLists THEN SYSTEM.PUT(start + nextOff, freeList[i]); freeList[i] := start - ELSE SYSTEM.PUT(start + nextOff, bigBlocks); bigBlocks := start + IF i < nofLists THEN S.PUT(start + nextOff, freeList[i]); freeList[i] := start + ELSE S.PUT(start + nextOff, bigBlocks); bigBlocks := start END END ; - SYSTEM.GET(chnk, chnk) + S.GET(chnk, chnk) END END Scan; - PROCEDURE Sift (l, r: Address; VAR a: ARRAY OF Address); - VAR i, j, x: Address; + PROCEDURE Sift (l, r: S.ADDRESS; VAR a: ARRAY OF S.ADDRESS); + VAR i, j, x: S.ADDRESS; BEGIN j := l; x := a[j]; LOOP i := j; j := 2*j + 1; IF (j < r) & (a[j] < a[j+1]) THEN INC(j) END; @@ -415,27 +413,27 @@ MODULE Heap; a[i] := x END Sift; - PROCEDURE HeapSort (n: Address; VAR a: ARRAY OF Address); - VAR l, r, x: Address; + PROCEDURE HeapSort (n: S.ADDRESS; VAR a: ARRAY OF S.ADDRESS); + VAR l, r, x: S.ADDRESS; BEGIN l := n DIV 2; r := n - 1; WHILE l > 0 DO DEC(l); Sift(l, r, a) END; WHILE r > 0 DO x := a[0]; a[0] := a[r]; a[r] := x; DEC(r); Sift(l, r, a) END END HeapSort; - PROCEDURE MarkCandidates(n: Address; VAR cand: ARRAY OF Address); - VAR chnk, adr, tag, next, lim, lim1, i, ptr, size: Address; + PROCEDURE MarkCandidates(n: S.ADDRESS; VAR cand: ARRAY OF S.ADDRESS); + VAR chnk, adr, tag, next, lim, lim1, i, ptr, size: S.ADDRESS; BEGIN chnk := heap; i := 0; lim := cand[n-1]; WHILE (chnk # 0 ) & (chnk < lim) DO adr := chnk + blkOff; - SYSTEM.GET(chnk + endOff, lim1); + S.GET(chnk + endOff, lim1); IF lim < lim1 THEN lim1 := lim END ; WHILE adr < lim1 DO - SYSTEM.GET(adr, tag); + S.GET(adr, tag); IF ODD(tag) THEN (*already marked*) - SYSTEM.GET(tag-1, size); INC(adr, size) + S.GET(tag-1, size); INC(adr, size) ELSE - SYSTEM.GET(tag, size); + S.GET(tag, size); ptr := adr + SZA; WHILE cand[i] < ptr DO INC(i) END ; IF i = n THEN RETURN END ; @@ -444,16 +442,16 @@ MODULE Heap; adr := next END END ; - SYSTEM.GET(chnk, chnk) + S.GET(chnk, chnk) END END MarkCandidates; PROCEDURE CheckFin; - VAR n: FinNode; tag: Address; + VAR n: FinNode; tag: S.ADDRESS; BEGIN n := fin; WHILE n # NIL DO - SYSTEM.GET(n.obj - SZA, tag); + S.GET(n.obj - SZA, tag); IF ~ODD(tag) THEN n.marked := FALSE; Mark(n.obj) ELSE n.marked := TRUE END ; @@ -467,7 +465,7 @@ MODULE Heap; WHILE n # NIL DO IF ~n.marked THEN IF n = fin THEN fin := fin.next ELSE prev.next := n.next END ; - n.finalize(SYSTEM.VAL(SYSTEM.PTR, n.obj)); + n.finalize(S.VAL(S.PTR, n.obj)); (* new nodes may have been pushed in n.finalize, therefore: *) IF prev = NIL THEN n := fin ELSE n := n.next END ELSE @@ -481,31 +479,31 @@ MODULE Heap; BEGIN WHILE fin # NIL DO n := fin; fin := fin.next; - n.finalize(SYSTEM.VAL(SYSTEM.PTR, n.obj)) + n.finalize(S.VAL(S.PTR, n.obj)) END END FINALL; PROCEDURE -ExternMainStackFrame "extern address Platform_MainStackFrame;"; - PROCEDURE -PlatformMainStackFrame(): Address "Platform_MainStackFrame"; + PROCEDURE -PlatformMainStackFrame(): S.ADDRESS "Platform_MainStackFrame"; - PROCEDURE MarkStack(n: Address; VAR cand: ARRAY OF Address); + PROCEDURE MarkStack(n: S.ADDRESS; VAR cand: ARRAY OF S.ADDRESS); VAR - frame: SYSTEM.PTR; - inc, nofcand: Address; - sp, p, stack0: Address; - align: RECORD ch: CHAR; p: SYSTEM.PTR END ; + frame: S.PTR; + inc, nofcand: S.ADDRESS; + sp, p, stack0: S.ADDRESS; + align: RECORD ch: CHAR; p: S.PTR END ; BEGIN IF n > 0 THEN MarkStack(n-1, cand); (* flush register windows by means of recursive calls *) IF n > 100 THEN RETURN END (* prevent tail recursion optimization *) END ; IF n = 0 THEN - nofcand := 0; sp := SYSTEM.ADR(frame); + nofcand := 0; sp := S.ADR(frame); stack0 := PlatformMainStackFrame(); (* check for minimum alignment of pointers *) - inc := SYSTEM.ADR(align.p) - SYSTEM.ADR(align); + inc := S.ADR(align.p) - S.ADR(align); IF sp > stack0 THEN inc := -inc END ; WHILE sp # stack0 DO - SYSTEM.GET(sp, p); + S.GET(sp, p); IF (p > heap) & (p < heapend) THEN IF nofcand = LEN(cand) THEN HeapSort(nofcand, cand); MarkCandidates(nofcand, cand); nofcand := 0 END ; cand[nofcand] := p; INC(nofcand) @@ -519,12 +517,12 @@ MODULE Heap; PROCEDURE GC*(markStack: BOOLEAN); VAR m: Module; - i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23: Address; - cand: ARRAY 10000 OF Address; + i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23: S.ADDRESS; + cand: ARRAY 10000 OF S.ADDRESS; BEGIN IF (lockdepth = 0) OR (lockdepth = 1) & ~markStack THEN Lock(); - m := SYSTEM.VAL(Module, modules); + m := S.VAL(Module, modules); WHILE m # NIL DO IF m.enumPtrs # NIL THEN m.enumPtrs(MarkP) END ; m := m^.next @@ -552,10 +550,10 @@ MODULE Heap; END END GC; - PROCEDURE RegisterFinalizer*(obj: SYSTEM.PTR; finalize: Finalizer); + PROCEDURE RegisterFinalizer*(obj: S.PTR; finalize: Finalizer); VAR f: FinNode; BEGIN NEW(f); - f.obj := SYSTEM.VAL(Address, obj); f.finalize := finalize; f.marked := TRUE; + f.obj := S.VAL(S.ADDRESS, obj); f.finalize := finalize; f.marked := TRUE; f.next := fin; fin := f; END RegisterFinalizer; @@ -565,11 +563,11 @@ PROCEDURE -HeapModuleInit 'Heap__init()'; PROCEDURE InitHeap*; (* InitHeap is called by Platform.init before any module bodies have been - initialised, to enable NEW, SYSTEM.NEW *) + initialised, to enable NEW, S.NEW *) BEGIN heap := NewChunk(heapSize0); - SYSTEM.GET(heap + endOff, heapend); - SYSTEM.PUT(heap, AddressZero); + S.GET(heap + endOff, heapend); + S.PUT(heap, AddressZero); allocated := 0; firstTry := TRUE; freeList[nofLists] := 1; lockdepth := 0; FileCount := 0; modules := NIL; heapsize := 0; bigBlocks := 0; fin := NIL; interrupted := FALSE; From b8694e65ab1561132fbd86dda176500cdd41f5bc Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 15 Sep 2016 13:30:08 +0100 Subject: [PATCH 231/580] Return d0 correctly in ulmSYSTEM read unixcall handler. Fixes #43. --- src/library/ulm/ulmSYSTEM.Mod | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/library/ulm/ulmSYSTEM.Mod b/src/library/ulm/ulmSYSTEM.Mod index 838548f0..bbd054b8 100644 --- a/src/library/ulm/ulmSYSTEM.Mod +++ b/src/library/ulm/ulmSYSTEM.Mod @@ -50,23 +50,25 @@ TYPE pchar = POINTER TO ARRAY 1 OF CHAR; END TAS; PROCEDURE UNIXCALL*(syscall: LONGINT; VAR d0, d1: LONGINT; (* in ulm version both LONGINT and INTEGER are 4 byte size *) - arg1, arg2, arg3: LONGINT) : BOOLEAN; + arg1, arg2, arg3: LONGINT) : BOOLEAN; VAR n: LONGINT; ch: CHAR; pch: pchar; - pstr: pstring; + pstr: pstring; h: Platform.FileHandle; (* pst : pstatus; *) BEGIN - + IF syscall = Sys.read THEN - RETURN Platform.Read(arg1, arg2, arg3, n) = 0; + d0 := Platform.Read(arg1, arg2, arg3, n); + IF d0 >= 0 THEN d0 := n END; + RETURN d0 >= 0; (*NEW(pch); pch := SYSTEM.VAL(pchar, arg2); ch := pch^[0]; n := read(ch); - IF n # 1 THEN + IF n # 1 THEN ch := 0X; RETURN FALSE ELSE @@ -81,7 +83,7 @@ TYPE pchar = POINTER TO ARRAY 1 OF CHAR; n := Write(SYSTEM.VAL(LONGINT, pch), 1); IF n # 1 THEN RETURN FALSE ELSE RETURN TRUE END *) - ELSIF syscall = Sys.open THEN + ELSIF syscall = Sys.open THEN pstr := SYSTEM.VAL(pstring, arg1); IF SYSTEM.VAL(SET, arg3) * {0,1} # {} THEN RETURN Platform.OldRW(pstr^, d0) = 0 From dc699db9f5006433913b762ddf6c09d6c1c4e0bd Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 15 Sep 2016 15:23:08 +0100 Subject: [PATCH 232/580] Support 64 bit integer literals on all builds, and fix 64 bit Console.hex display. --- bootstrap/unix-44/Configuration.c | 4 +- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Console.c | 5 +- bootstrap/unix-44/Console.h | 2 +- bootstrap/unix-44/Files.c | 2 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 2 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 2 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 2 +- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 19 +- bootstrap/unix-44/OPS.h | 4 +- bootstrap/unix-44/OPT.c | 2 +- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 2 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/Vishap.c | 2 +- bootstrap/unix-44/errors.c | 2 +- bootstrap/unix-44/errors.h | 2 +- bootstrap/unix-44/extTools.c | 2 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-44/vt100.c | 2 +- bootstrap/unix-44/vt100.h | 2 +- bootstrap/unix-48/Configuration.c | 4 +- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Console.c | 5 +- bootstrap/unix-48/Console.h | 2 +- bootstrap/unix-48/Files.c | 2 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 2 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 2 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 2 +- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 19 +- bootstrap/unix-48/OPS.h | 4 +- bootstrap/unix-48/OPT.c | 2 +- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 2 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/Vishap.c | 2 +- bootstrap/unix-48/errors.c | 2 +- bootstrap/unix-48/errors.h | 2 +- bootstrap/unix-48/extTools.c | 2 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-48/vt100.c | 2 +- bootstrap/unix-48/vt100.h | 2 +- bootstrap/unix-88/Configuration.c | 4 +- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Console.c | 7 +- bootstrap/unix-88/Console.h | 2 +- bootstrap/unix-88/Files.c | 2 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 2 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 2 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 2 +- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 9 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 2 +- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 2 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/Vishap.c | 2 +- bootstrap/unix-88/errors.c | 2 +- bootstrap/unix-88/errors.h | 2 +- bootstrap/unix-88/extTools.c | 2 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/unix-88/vt100.c | 2 +- bootstrap/unix-88/vt100.h | 2 +- bootstrap/windows-48/Configuration.c | 4 +- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Console.c | 5 +- bootstrap/windows-48/Console.h | 2 +- bootstrap/windows-48/Files.c | 2 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 2 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 2 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 2 +- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 19 +- bootstrap/windows-48/OPS.h | 4 +- bootstrap/windows-48/OPT.c | 2 +- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 2 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/Vishap.c | 2 +- bootstrap/windows-48/errors.c | 2 +- bootstrap/windows-48/errors.h | 2 +- bootstrap/windows-48/extTools.c | 2 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-48/vt100.c | 2 +- bootstrap/windows-48/vt100.h | 2 +- bootstrap/windows-88/Configuration.c | 4 +- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Console.c | 7 +- bootstrap/windows-88/Console.h | 2 +- bootstrap/windows-88/Files.c | 2 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 2 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 2 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 2 +- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 9 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 2 +- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 2 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Platform.c | 2 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/Vishap.c | 2 +- bootstrap/windows-88/errors.c | 2 +- bootstrap/windows-88/errors.h | 2 +- bootstrap/windows-88/extTools.c | 2 +- bootstrap/windows-88/extTools.h | 2 +- bootstrap/windows-88/vt100.c | 2 +- bootstrap/windows-88/vt100.h | 2 +- src/compiler/OPS.Mod | 16 +- src/library/ulm/ulmIO.Mod | 429 +++++++++++++-------------- src/library/ulm/ulmSYSTEM.Mod | 14 +- src/system/Console.Mod | 6 +- 199 files changed, 478 insertions(+), 477 deletions(-) diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index d8c934bf..06ec0ed7 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/14] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/15] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index 2b7bdf82..9276e796 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Console.c b/bootstrap/unix-44/Console.c index 5a0b29a2..4007101f 100644 --- a/bootstrap/unix-44/Console.c +++ b/bootstrap/unix-44/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -102,7 +102,8 @@ void Console_Bool (BOOLEAN b) void Console_Hex (int32 i) { - int32 k, n; + int16 k; + int64 n; k = -28; while (k <= 0) { n = __MASK(__ASH(i, k), -16); diff --git a/bootstrap/unix-44/Console.h b/bootstrap/unix-44/Console.h index 0af02096..23ec5930 100644 --- a/bootstrap/unix-44/Console.h +++ b/bootstrap/unix-44/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 58145066..17a56a1d 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index 521906c3..81a5660b 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index b3a5908c..c3422d37 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tskSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index 29b4cb26..2a231c6e 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index a71d3e4d..74cb4e47 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index 6a744f9b..ba7f2930 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index a905da35..5bc128d1 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index f9bf31fe..8579409b 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 1fecd152..c1a7d45a 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index b8f44225..576bdf18 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 6af53f8c..ffc05a37 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index 67edafa5..56b587e9 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index d8dee08e..7c0b62db 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index 9ddded2f..e578b0bd 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index cd51e788..5243ea65 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -17,7 +17,7 @@ typedef export OPS_Name OPS_name; export OPS_String OPS_str; export int16 OPS_numtyp; -export int32 OPS_intval; +export int64 OPS_intval; export REAL OPS_realval; export LONGREAL OPS_lrlval; static CHAR OPS_ch; @@ -132,7 +132,7 @@ static int16 Ord__7 (CHAR ch, BOOLEAN hex) static void OPS_Number (void) { - int16 i, m, n, d, e, maxHdig; + int16 i, m, n, d, e; CHAR dig[24]; LONGREAL f; CHAR expCh; @@ -178,7 +178,7 @@ static void OPS_Number (void) OPS_numtyp = 1; if (n <= 2) { while (i < n) { - OPS_intval = __ASHL(OPS_intval, 4) + Ord__7(dig[i], 1); + OPS_intval = __ASHL(OPS_intval, 4) + (int64)Ord__7(dig[i], 1); i += 1; } } else { @@ -187,13 +187,12 @@ static void OPS_Number (void) } else if (OPS_ch == 'H') { OPM_Get(&OPS_ch); OPS_numtyp = 2; - maxHdig = 8; - if (n <= maxHdig) { - if ((n == maxHdig && dig[0] > '7')) { + if (n <= 16) { + if ((n == 16 && dig[0] > '7')) { OPS_intval = -1; } while (i < n) { - OPS_intval = __ASHL(OPS_intval, 4) + Ord__7(dig[i], 1); + OPS_intval = __ASHL(OPS_intval, 4) + (int64)Ord__7(dig[i], 1); i += 1; } } else { @@ -204,8 +203,8 @@ static void OPS_Number (void) while (i < n) { d = Ord__7(dig[i], 0); i += 1; - if (OPS_intval <= __DIV(2147483647 - d, 10)) { - OPS_intval = OPS_intval * 10 + d; + if (OPS_intval <= (int64)__DIV(9223372036854775807 - d, 10)) { + OPS_intval = OPS_intval * 10 + (int64)d; } else { OPS_err(203); } diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index 658c87db..af53d634 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h @@ -15,7 +15,7 @@ typedef import OPS_Name OPS_name; import OPS_String OPS_str; import int16 OPS_numtyp; -import int32 OPS_intval; +import int64 OPS_intval; import REAL OPS_realval; import LONGREAL OPS_lrlval; diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index ab44584b..a12c1a7f 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index 978ae16b..dff6a509 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index c20aef90..b34d16d0 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index ea1f9aaa..0716a62f 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 1bf0628e..a7b7d28a 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index 7c0b2d21..574abdf6 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index a64c2d13..30d7462f 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index d7981245..034d0e43 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index 67c0f055..a4ed943e 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index 6f4f1073..226b6aeb 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index 503c4e06..9ae78a2d 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index b5b22e1b..af7ba940 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/Vishap.c b/bootstrap/unix-44/Vishap.c index 2efce68f..93bbfaf4 100644 --- a/bootstrap/unix-44/Vishap.c +++ b/bootstrap/unix-44/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkamSf */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/errors.c b/bootstrap/unix-44/errors.c index 6f8e3d33..330d0f79 100644 --- a/bootstrap/unix-44/errors.c +++ b/bootstrap/unix-44/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/errors.h b/bootstrap/unix-44/errors.h index 58286fd8..f916c173 100644 --- a/bootstrap/unix-44/errors.h +++ b/bootstrap/unix-44/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index bbecb9f2..a0370292 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index 8a0d60be..04a7b8d6 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-44/vt100.c b/bootstrap/unix-44/vt100.c index b5422c40..7e16410c 100644 --- a/bootstrap/unix-44/vt100.c +++ b/bootstrap/unix-44/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/vt100.h b/bootstrap/unix-44/vt100.h index 85494a63..c1c3c8fa 100644 --- a/bootstrap/unix-44/vt100.h +++ b/bootstrap/unix-44/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index d8c934bf..06ec0ed7 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/14] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/15] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index 2b7bdf82..9276e796 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Console.c b/bootstrap/unix-48/Console.c index 5a0b29a2..4007101f 100644 --- a/bootstrap/unix-48/Console.c +++ b/bootstrap/unix-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -102,7 +102,8 @@ void Console_Bool (BOOLEAN b) void Console_Hex (int32 i) { - int32 k, n; + int16 k; + int64 n; k = -28; while (k <= 0) { n = __MASK(__ASH(i, k), -16); diff --git a/bootstrap/unix-48/Console.h b/bootstrap/unix-48/Console.h index 0af02096..23ec5930 100644 --- a/bootstrap/unix-48/Console.h +++ b/bootstrap/unix-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 58145066..17a56a1d 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index 521906c3..81a5660b 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index b3a5908c..c3422d37 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tskSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index 29b4cb26..2a231c6e 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index a71d3e4d..74cb4e47 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index 6a744f9b..ba7f2930 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index a905da35..5bc128d1 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index f9bf31fe..8579409b 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 1fecd152..c1a7d45a 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index b8f44225..576bdf18 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 6af53f8c..ffc05a37 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index 67edafa5..56b587e9 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index d8dee08e..7c0b62db 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index 9ddded2f..e578b0bd 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index cd51e788..5243ea65 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -17,7 +17,7 @@ typedef export OPS_Name OPS_name; export OPS_String OPS_str; export int16 OPS_numtyp; -export int32 OPS_intval; +export int64 OPS_intval; export REAL OPS_realval; export LONGREAL OPS_lrlval; static CHAR OPS_ch; @@ -132,7 +132,7 @@ static int16 Ord__7 (CHAR ch, BOOLEAN hex) static void OPS_Number (void) { - int16 i, m, n, d, e, maxHdig; + int16 i, m, n, d, e; CHAR dig[24]; LONGREAL f; CHAR expCh; @@ -178,7 +178,7 @@ static void OPS_Number (void) OPS_numtyp = 1; if (n <= 2) { while (i < n) { - OPS_intval = __ASHL(OPS_intval, 4) + Ord__7(dig[i], 1); + OPS_intval = __ASHL(OPS_intval, 4) + (int64)Ord__7(dig[i], 1); i += 1; } } else { @@ -187,13 +187,12 @@ static void OPS_Number (void) } else if (OPS_ch == 'H') { OPM_Get(&OPS_ch); OPS_numtyp = 2; - maxHdig = 8; - if (n <= maxHdig) { - if ((n == maxHdig && dig[0] > '7')) { + if (n <= 16) { + if ((n == 16 && dig[0] > '7')) { OPS_intval = -1; } while (i < n) { - OPS_intval = __ASHL(OPS_intval, 4) + Ord__7(dig[i], 1); + OPS_intval = __ASHL(OPS_intval, 4) + (int64)Ord__7(dig[i], 1); i += 1; } } else { @@ -204,8 +203,8 @@ static void OPS_Number (void) while (i < n) { d = Ord__7(dig[i], 0); i += 1; - if (OPS_intval <= __DIV(2147483647 - d, 10)) { - OPS_intval = OPS_intval * 10 + d; + if (OPS_intval <= (int64)__DIV(9223372036854775807 - d, 10)) { + OPS_intval = OPS_intval * 10 + (int64)d; } else { OPS_err(203); } diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index 658c87db..af53d634 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h @@ -15,7 +15,7 @@ typedef import OPS_Name OPS_name; import OPS_String OPS_str; import int16 OPS_numtyp; -import int32 OPS_intval; +import int64 OPS_intval; import REAL OPS_realval; import LONGREAL OPS_lrlval; diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index ab44584b..a12c1a7f 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index 978ae16b..dff6a509 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index c20aef90..b34d16d0 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index ea1f9aaa..0716a62f 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 1bf0628e..a7b7d28a 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index 7c0b2d21..574abdf6 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index a64c2d13..30d7462f 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index d7981245..034d0e43 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index 67c0f055..a4ed943e 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index 6f4f1073..226b6aeb 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index 4d12f6cb..660559f5 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index 2b694f6c..5ac796d7 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/Vishap.c b/bootstrap/unix-48/Vishap.c index 2efce68f..93bbfaf4 100644 --- a/bootstrap/unix-48/Vishap.c +++ b/bootstrap/unix-48/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkamSf */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/errors.c b/bootstrap/unix-48/errors.c index 6f8e3d33..330d0f79 100644 --- a/bootstrap/unix-48/errors.c +++ b/bootstrap/unix-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/errors.h b/bootstrap/unix-48/errors.h index 58286fd8..f916c173 100644 --- a/bootstrap/unix-48/errors.h +++ b/bootstrap/unix-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index bbecb9f2..a0370292 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index 8a0d60be..04a7b8d6 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/vt100.c b/bootstrap/unix-48/vt100.c index b5422c40..7e16410c 100644 --- a/bootstrap/unix-48/vt100.c +++ b/bootstrap/unix-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/vt100.h b/bootstrap/unix-48/vt100.h index 85494a63..c1c3c8fa 100644 --- a/bootstrap/unix-48/vt100.h +++ b/bootstrap/unix-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index f3f2e52d..e936fb1b 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/14] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/15] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index 2b7bdf82..9276e796 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Console.c b/bootstrap/unix-88/Console.c index 5039dae6..c25651d5 100644 --- a/bootstrap/unix-88/Console.c +++ b/bootstrap/unix-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -102,8 +102,9 @@ void Console_Bool (BOOLEAN b) void Console_Hex (int64 i) { - int64 k, n; - k = -28; + int32 k; + int64 n; + k = -60; while (k <= 0) { n = __MASK(__ASH(i, k), -16); if (n <= 9) { diff --git a/bootstrap/unix-88/Console.h b/bootstrap/unix-88/Console.h index 8336a3d0..288d9e0a 100644 --- a/bootstrap/unix-88/Console.h +++ b/bootstrap/unix-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 1f4e38bf..79b77102 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index b1a16504..048e6c0f 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index 26f7af6f..fa10e8c0 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tskSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index 08afe43e..ecebdfeb 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 3a48e24a..66df0a5c 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index 3ebde4f3..86580ab4 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index 883d2559..5a6a8dda 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index 35fb2186..94ff6cbf 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index ef8f41a1..a4e6388c 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index 646d0151..185ac689 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 96868200..6b30d07b 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index d4b77c79..9c71f996 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index 7e958472..dce9eaec 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index 9ddded2f..e578b0bd 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index 208f4934..61d3ad08 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -132,7 +132,7 @@ static int32 Ord__7 (CHAR ch, BOOLEAN hex) static void OPS_Number (void) { - int32 i, m, n, d, e, maxHdig; + int32 i, m, n, d, e; CHAR dig[24]; LONGREAL f; CHAR expCh; @@ -187,9 +187,8 @@ static void OPS_Number (void) } else if (OPS_ch == 'H') { OPM_Get(&OPS_ch); OPS_numtyp = 2; - maxHdig = 16; - if (n <= maxHdig) { - if ((n == maxHdig && dig[0] > '7')) { + if (n <= 16) { + if ((n == 16 && dig[0] > '7')) { OPS_intval = -1; } while (i < n) { diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index bb045fe9..eef23e1f 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index afc5a8b6..82c2df59 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 090d9111..7b529043 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 098463c4..023ee089 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index ea1f9aaa..0716a62f 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index f428c2b1..8bbc2357 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index d9212710..077cb445 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index b3e89e04..b4890fa9 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index 3892d49c..37f91340 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index 1eef261b..4f6767e1 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index 8145aa00..235891d2 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index d8710e54..7a6726a6 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index 8389bc47..ea9dde4b 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/Vishap.c b/bootstrap/unix-88/Vishap.c index 3972af10..fef94478 100644 --- a/bootstrap/unix-88/Vishap.c +++ b/bootstrap/unix-88/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkamSf */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/errors.c b/bootstrap/unix-88/errors.c index 8864c777..88cb5688 100644 --- a/bootstrap/unix-88/errors.c +++ b/bootstrap/unix-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/errors.h b/bootstrap/unix-88/errors.h index 58286fd8..f916c173 100644 --- a/bootstrap/unix-88/errors.h +++ b/bootstrap/unix-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index bb60848a..08e242e0 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index 8a0d60be..04a7b8d6 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/vt100.c b/bootstrap/unix-88/vt100.c index c143a6b3..96358c5b 100644 --- a/bootstrap/unix-88/vt100.c +++ b/bootstrap/unix-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/vt100.h b/bootstrap/unix-88/vt100.h index 11a9c941..b9c5430c 100644 --- a/bootstrap/unix-88/vt100.h +++ b/bootstrap/unix-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index d8c934bf..06ec0ed7 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/14] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/15] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index 2b7bdf82..9276e796 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Console.c b/bootstrap/windows-48/Console.c index 359bad0a..931e8e9b 100644 --- a/bootstrap/windows-48/Console.c +++ b/bootstrap/windows-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -102,7 +102,8 @@ void Console_Bool (BOOLEAN b) void Console_Hex (int32 i) { - int32 k, n; + int16 k; + int64 n; k = -28; while (k <= 0) { n = __MASK(__ASH(i, k), -16); diff --git a/bootstrap/windows-48/Console.h b/bootstrap/windows-48/Console.h index 0af02096..23ec5930 100644 --- a/bootstrap/windows-48/Console.h +++ b/bootstrap/windows-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 01218f26..50b625ff 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index ffdc05f6..f680e056 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index b3a5908c..c3422d37 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tskSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index 29b4cb26..2a231c6e 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index a71d3e4d..74cb4e47 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index 6a744f9b..ba7f2930 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index a905da35..5bc128d1 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index f9bf31fe..8579409b 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 1fecd152..c1a7d45a 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index b8f44225..576bdf18 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 6af53f8c..ffc05a37 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index 67edafa5..56b587e9 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index d8dee08e..7c0b62db 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index 9ddded2f..e578b0bd 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index cd51e788..5243ea65 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -17,7 +17,7 @@ typedef export OPS_Name OPS_name; export OPS_String OPS_str; export int16 OPS_numtyp; -export int32 OPS_intval; +export int64 OPS_intval; export REAL OPS_realval; export LONGREAL OPS_lrlval; static CHAR OPS_ch; @@ -132,7 +132,7 @@ static int16 Ord__7 (CHAR ch, BOOLEAN hex) static void OPS_Number (void) { - int16 i, m, n, d, e, maxHdig; + int16 i, m, n, d, e; CHAR dig[24]; LONGREAL f; CHAR expCh; @@ -178,7 +178,7 @@ static void OPS_Number (void) OPS_numtyp = 1; if (n <= 2) { while (i < n) { - OPS_intval = __ASHL(OPS_intval, 4) + Ord__7(dig[i], 1); + OPS_intval = __ASHL(OPS_intval, 4) + (int64)Ord__7(dig[i], 1); i += 1; } } else { @@ -187,13 +187,12 @@ static void OPS_Number (void) } else if (OPS_ch == 'H') { OPM_Get(&OPS_ch); OPS_numtyp = 2; - maxHdig = 8; - if (n <= maxHdig) { - if ((n == maxHdig && dig[0] > '7')) { + if (n <= 16) { + if ((n == 16 && dig[0] > '7')) { OPS_intval = -1; } while (i < n) { - OPS_intval = __ASHL(OPS_intval, 4) + Ord__7(dig[i], 1); + OPS_intval = __ASHL(OPS_intval, 4) + (int64)Ord__7(dig[i], 1); i += 1; } } else { @@ -204,8 +203,8 @@ static void OPS_Number (void) while (i < n) { d = Ord__7(dig[i], 0); i += 1; - if (OPS_intval <= __DIV(2147483647 - d, 10)) { - OPS_intval = OPS_intval * 10 + d; + if (OPS_intval <= (int64)__DIV(9223372036854775807 - d, 10)) { + OPS_intval = OPS_intval * 10 + (int64)d; } else { OPS_err(203); } diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index 658c87db..af53d634 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h @@ -15,7 +15,7 @@ typedef import OPS_Name OPS_name; import OPS_String OPS_str; import int16 OPS_numtyp; -import int32 OPS_intval; +import int64 OPS_intval; import REAL OPS_realval; import LONGREAL OPS_lrlval; diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index ab44584b..a12c1a7f 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index 978ae16b..dff6a509 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index c20aef90..b34d16d0 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index ea1f9aaa..0716a62f 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 8740b5b0..afc6f96c 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index ce51df39..2d3185ce 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index a64c2d13..30d7462f 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index d7981245..034d0e43 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index 67c0f055..a4ed943e 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index 6f4f1073..226b6aeb 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index 4d12f6cb..660559f5 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index 2b694f6c..5ac796d7 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/Vishap.c b/bootstrap/windows-48/Vishap.c index 2efce68f..93bbfaf4 100644 --- a/bootstrap/windows-48/Vishap.c +++ b/bootstrap/windows-48/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkamSf */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/errors.c b/bootstrap/windows-48/errors.c index 6f8e3d33..330d0f79 100644 --- a/bootstrap/windows-48/errors.c +++ b/bootstrap/windows-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/errors.h b/bootstrap/windows-48/errors.h index 58286fd8..f916c173 100644 --- a/bootstrap/windows-48/errors.h +++ b/bootstrap/windows-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index bbecb9f2..a0370292 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index 8a0d60be..04a7b8d6 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/vt100.c b/bootstrap/windows-48/vt100.c index b5422c40..7e16410c 100644 --- a/bootstrap/windows-48/vt100.c +++ b/bootstrap/windows-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/vt100.h b/bootstrap/windows-48/vt100.h index 85494a63..c1c3c8fa 100644 --- a/bootstrap/windows-48/vt100.h +++ b/bootstrap/windows-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index f3f2e52d..e936fb1b 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/14] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/15] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index 2b7bdf82..9276e796 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Console.c b/bootstrap/windows-88/Console.c index f1d67d28..ef385b37 100644 --- a/bootstrap/windows-88/Console.c +++ b/bootstrap/windows-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -102,8 +102,9 @@ void Console_Bool (BOOLEAN b) void Console_Hex (int64 i) { - int64 k, n; - k = -28; + int32 k; + int64 n; + k = -60; while (k <= 0) { n = __MASK(__ASH(i, k), -16); if (n <= 9) { diff --git a/bootstrap/windows-88/Console.h b/bootstrap/windows-88/Console.h index 8336a3d0..288d9e0a 100644 --- a/bootstrap/windows-88/Console.h +++ b/bootstrap/windows-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 6c40d595..6b890417 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index d3432e7a..ab570a35 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index 26f7af6f..fa10e8c0 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tskSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index 08afe43e..ecebdfeb 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 3a48e24a..66df0a5c 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index 3ebde4f3..86580ab4 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index 883d2559..5a6a8dda 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index 35fb2186..94ff6cbf 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index ef8f41a1..a4e6388c 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index 646d0151..185ac689 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 96868200..6b30d07b 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index d4b77c79..9c71f996 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index 7e958472..dce9eaec 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index 9ddded2f..e578b0bd 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index 208f4934..61d3ad08 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -132,7 +132,7 @@ static int32 Ord__7 (CHAR ch, BOOLEAN hex) static void OPS_Number (void) { - int32 i, m, n, d, e, maxHdig; + int32 i, m, n, d, e; CHAR dig[24]; LONGREAL f; CHAR expCh; @@ -187,9 +187,8 @@ static void OPS_Number (void) } else if (OPS_ch == 'H') { OPM_Get(&OPS_ch); OPS_numtyp = 2; - maxHdig = 16; - if (n <= maxHdig) { - if ((n == maxHdig && dig[0] > '7')) { + if (n <= 16) { + if ((n == 16 && dig[0] > '7')) { OPS_intval = -1; } while (i < n) { diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index bb045fe9..eef23e1f 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index afc5a8b6..82c2df59 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 090d9111..7b529043 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 098463c4..023ee089 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index ea1f9aaa..0716a62f 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 3bb993de..a8579af5 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index c1175e02..a016f061 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index b3e89e04..b4890fa9 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index 3892d49c..37f91340 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index 1eef261b..4f6767e1 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index 8145aa00..235891d2 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index d8710e54..7a6726a6 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index 8389bc47..ea9dde4b 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/Vishap.c b/bootstrap/windows-88/Vishap.c index 3972af10..fef94478 100644 --- a/bootstrap/windows-88/Vishap.c +++ b/bootstrap/windows-88/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkamSf */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/errors.c b/bootstrap/windows-88/errors.c index 8864c777..88cb5688 100644 --- a/bootstrap/windows-88/errors.c +++ b/bootstrap/windows-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/errors.h b/bootstrap/windows-88/errors.h index 58286fd8..f916c173 100644 --- a/bootstrap/windows-88/errors.h +++ b/bootstrap/windows-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index bb60848a..08e242e0 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index 8a0d60be..04a7b8d6 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/vt100.c b/bootstrap/windows-88/vt100.c index c143a6b3..96358c5b 100644 --- a/bootstrap/windows-88/vt100.c +++ b/bootstrap/windows-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/vt100.h b/bootstrap/windows-88/vt100.h index 11a9c941..b9c5430c 100644 --- a/bootstrap/windows-88/vt100.h +++ b/bootstrap/windows-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/src/compiler/OPS.Mod b/src/compiler/OPS.Mod index 33b325d8..909cdee2 100644 --- a/src/compiler/OPS.Mod +++ b/src/compiler/OPS.Mod @@ -1,6 +1,6 @@ MODULE OPS; (* NW, RC 6.3.89 / 18.10.92 *) (* object model 3.6.92 *) - IMPORT OPM; + IMPORT OPM, SYSTEM; CONST MaxStrLen* = 256; @@ -51,8 +51,8 @@ MODULE OPS; (* NW, RC 6.3.89 / 18.10.92 *) (* object model 3.6.92 *) (* name, str, numtyp, intval, realval, lrlval are implicit results of Get *) name*: Name; str*: String; - numtyp*: INTEGER; (* 1 = char, 2 = integer, 3 = real, 4 = longreal *) - intval*: LONGINT; (* integer value or string length *) + numtyp*: INTEGER; (* 1 = char, 2 = integer, 3 = real, 4 = longreal *) + intval*: SYSTEM.INT64; (* integer value or string length *) realval*: REAL; lrlval*: LONGREAL; @@ -89,7 +89,8 @@ MODULE OPS; (* NW, RC 6.3.89 / 18.10.92 *) (* object model 3.6.92 *) END Identifier; PROCEDURE Number; - VAR i, m, n, d, e, maxHdig: INTEGER; dig: ARRAY 24 OF CHAR; f: LONGREAL; expCh: CHAR; neg: BOOLEAN; + CONST maxhexdigits = 16; + VAR i, m, n, d, e: INTEGER; dig: ARRAY 24 OF CHAR; f: LONGREAL; expCh: CHAR; neg: BOOLEAN; PROCEDURE Ten(e: INTEGER): LONGREAL; VAR x, p: LONGREAL; @@ -135,15 +136,14 @@ MODULE OPS; (* NW, RC 6.3.89 / 18.10.92 *) (* object model 3.6.92 *) ELSE err(203) END ELSIF ch = "H" THEN (* hexadecimal *) OPM.Get(ch); numtyp := integer; - IF MAX(LONGINT) > 2147483647 THEN maxHdig := 16 ELSE maxHdig := 8 END; - IF n <= maxHdig THEN - IF (n = maxHdig) & (dig[0] > "7") THEN (* prevent overflow *) intval := -1 END; + IF n <= maxhexdigits THEN + IF (n = maxhexdigits) & (dig[0] > "7") THEN (* prevent overflow *) intval := -1 END; WHILE i < n DO intval := intval*10H + Ord(dig[i], TRUE); INC(i) END ELSE err(203) END ELSE (* decimal *) numtyp := integer; WHILE i < n DO d := Ord(dig[i], FALSE); INC(i); - IF intval <= (MAX(LONGINT) - d) DIV 10 THEN intval := intval*10 + d + IF intval <= (MAX(SYSTEM.INT64) - d) DIV 10 THEN intval := intval*10 + d ELSE err(203) END END diff --git a/src/library/ulm/ulmIO.Mod b/src/library/ulm/ulmIO.Mod index 2fa775e1..87ff46fa 100644 --- a/src/library/ulm/ulmIO.Mod +++ b/src/library/ulm/ulmIO.Mod @@ -1,244 +1,243 @@ MODULE ulmIO; - IMPORT SYS := ulmSYSTEM, SYSTEM; + IMPORT SYS := ulmSYSTEM, SYSTEM; - CONST nl = 0AX; + CONST nl = 0AX; - (* conversions *) + (* conversions *) - CONST - oct = 0; - dec = 1; - hex = 2; - TYPE - Basetype = SHORTINT; (* oct..hex *) + CONST + oct = 0; + dec = 1; + hex = 2; + TYPE + Basetype = SHORTINT; (* oct..hex *) - (* basic IO *) + (* basic IO *) - VAR - Done*: BOOLEAN; - oldch: CHAR; - readAgain: BOOLEAN; + VAR + Done*: BOOLEAN; + oldch: CHAR; + readAgain: BOOLEAN; - (* ==================== conversions ================================= *) + (* ==================== conversions ================================= *) - PROCEDURE ConvertNumber(num, len: LONGINT; btyp: Basetype; neg: BOOLEAN; - VAR str: ARRAY OF CHAR); + PROCEDURE ConvertNumber(num, len: LONGINT; btyp: Basetype; neg: BOOLEAN; + VAR str: ARRAY OF CHAR); - (* conversion of a number into a string of characters *) - (* num must get the absolute value of the number *) - (* len is the minimal length of the generated string *) - (* neg means: "the number is negative" for btyp = dec *) + (* conversion of a number into a string of characters *) + (* num must get the absolute value of the number *) + (* len is the minimal length of the generated string *) + (* neg means: "the number is negative" for btyp = dec *) - (*CONST - NumberLen = 11;*) - (* we need it as variable to change the value depending on architecture; -- noch *) - VAR - (*digits : ARRAY NumberLen+1 OF CHAR;*) - digits : POINTER TO ARRAY OF CHAR; - base : INTEGER; - cnt, ix : INTEGER; - maxlen : LONGINT; - dig : LONGINT; - NumberLen : SHORTINT; - BEGIN - - IF SIZE(LONGINT) = 4 THEN - NumberLen := 11 - ELSIF SIZE(LONGINT) = 8 THEN - NumberLen := 21 + (*CONST + NumberLen = 11;*) + (* we need it as variable to change the value depending on architecture; -- noch *) + VAR + (*digits : ARRAY NumberLen+1 OF CHAR;*) + digits : POINTER TO ARRAY OF CHAR; + base : INTEGER; + cnt, ix : INTEGER; + maxlen : LONGINT; + dig : LONGINT; + NumberLen : SHORTINT; + BEGIN + IF SIZE(LONGINT) = 4 THEN + NumberLen := 11 + ELSIF SIZE(LONGINT) = 8 THEN + NumberLen := 21 + ELSE + NumberLen := 11 (* default value, corresponds to 32 bit *) + END; + NEW(digits, NumberLen + 1 ); + ASSERT(num >= 0); + ix := 1; + WHILE ix <= NumberLen DO + digits[ix] := "0"; + INC(ix); + END; (* initialisation *) + IF btyp = oct THEN + base := 8; + ELSIF btyp = dec THEN + base := 10; + ELSIF btyp = hex THEN + base := 10H; + END; + cnt := 0; + REPEAT + INC(cnt); + dig := num MOD base; + num := num DIV base; + IF dig < 10 THEN + dig := dig + ORD("0"); ELSE - NumberLen := 11 (* default value, corresponds to 32 bit *) + dig := dig - 10 + ORD("A"); END; - NEW(digits, NumberLen + 1 ); - ASSERT(num >= 0); - ix := 1; - WHILE ix <= NumberLen DO - digits[ix] := "0"; - INC(ix); - END; (* initialisation *) - IF btyp = oct THEN - base := 8; - ELSIF btyp = dec THEN - base := 10; - ELSIF btyp = hex THEN - base := 10H; - END; - cnt := 0; - REPEAT - INC(cnt); - dig := num MOD base; - num := num DIV base; - IF dig < 10 THEN - dig := dig + ORD("0"); - ELSE - dig := dig - 10 + ORD("A"); - END; - digits[cnt] := CHR(dig); - UNTIL num = 0; - (* (* i don't like this *) - IF btyp = oct THEN - cnt := 11; - ELSIF btyp = hex THEN - cnt := 8; - ELSIF neg THEN - *) - IF neg THEN - INC(cnt); - digits[cnt] := "-"; - END; - maxlen := LEN(str); (* get maximal length *) - IF len > maxlen THEN - len := SHORT(maxlen); - END; - IF cnt > maxlen THEN - cnt := SHORT(maxlen); - END; - ix := 0; - WHILE len > cnt DO - str[ix] := " "; - INC(ix); - DEC(len); - END; - WHILE cnt > 0 DO - str[ix] := digits[cnt]; - INC(ix); - DEC(cnt); - END; - IF ix < maxlen THEN - str[ix] := 0X; - END; - END ConvertNumber; + digits[cnt] := CHR(dig); + UNTIL num = 0; + (* (* i don't like this *) + IF btyp = oct THEN + cnt := 11; + ELSIF btyp = hex THEN + cnt := 8; + ELSIF neg THEN + *) + IF neg THEN + INC(cnt); + digits[cnt] := "-"; + END; + maxlen := LEN(str); (* get maximal length *) + IF len > maxlen THEN + len := SHORT(maxlen); + END; + IF cnt > maxlen THEN + cnt := SHORT(maxlen); + END; + ix := 0; + WHILE len > cnt DO + str[ix] := " "; + INC(ix); + DEC(len); + END; + WHILE cnt > 0 DO + str[ix] := digits[cnt]; + INC(ix); + DEC(cnt); + END; + IF ix < maxlen THEN + str[ix] := 0X; + END; + END ConvertNumber; - PROCEDURE ConvertInteger(num: LONGINT; len: INTEGER; VAR str: ARRAY OF - CHAR); - (* conversion of an integer decimal number to a string *) - BEGIN - ConvertNumber(ABS(num),len,dec,num < 0,str); - END ConvertInteger; + PROCEDURE ConvertInteger(num: LONGINT; len: INTEGER; VAR str: ARRAY OF + CHAR); + (* conversion of an integer decimal number to a string *) + BEGIN + ConvertNumber(ABS(num),len,dec,num < 0,str); + END ConvertInteger; - (* ========================= terminal ============================ *) + (* ========================= terminal ============================ *) - PROCEDURE ReadChar(VAR ch: CHAR) : BOOLEAN; - CONST read = 3; - (*VAR r0, r1: INTEGER;*) - VAR r0, r1: LONGINT; (* in ulm system INTEGER and LONGINT have the same 4 byte size; -- noch *) - BEGIN - RETURN SYS.UNIXCALL(read, r0, r1, 0, SYSTEM.ADR(ch), 1) & (r0 > 0) - END ReadChar; + PROCEDURE ReadChar(VAR ch: CHAR) : BOOLEAN; + CONST read = 3; + (*VAR r0, r1: INTEGER;*) + VAR r0, r1: LONGINT; (* in ulm system INTEGER and LONGINT have the same 4 byte size; -- noch *) + BEGIN + RETURN SYS.UNIXCALL(read, r0, r1, 0, SYSTEM.ADR(ch), 1) & (r0 > 0) + END ReadChar; - PROCEDURE WriteChar(ch: CHAR) : BOOLEAN; - CONST write = 4; - (*VAR r0, r1: INTEGER;*) - VAR r0, r1: LONGINT; (* same here *) - BEGIN - RETURN SYS.UNIXCALL(write, r0, r1, 1, SYSTEM.ADR(ch), 1) - END WriteChar; + PROCEDURE WriteChar(ch: CHAR) : BOOLEAN; + CONST write = 4; + (*VAR r0, r1: INTEGER;*) + VAR r0, r1: LONGINT; (* same here *) + BEGIN + RETURN SYS.UNIXCALL(write, r0, r1, 1, SYSTEM.ADR(ch), 1) + END WriteChar; - PROCEDURE Read*(VAR ch: CHAR); - BEGIN - Done := TRUE; - IF readAgain THEN - ch := oldch; - readAgain := FALSE; - ELSIF ~ReadChar(ch) THEN - Done := FALSE; - ch := 0X; - ELSE - oldch := ch; - END; - END Read; - - PROCEDURE ReadAgain*; - BEGIN - IF readAgain THEN - Done := FALSE; - ELSE - Done := TRUE; - readAgain := TRUE; - END; - END ReadAgain; - - PROCEDURE Write*(ch: CHAR); - BEGIN - Done := WriteChar(ch); - END Write; - - PROCEDURE WriteLn*; - CONST nl = 0AX; - BEGIN - Write(nl); - END WriteLn; - - PROCEDURE WriteString*(s: ARRAY OF CHAR); - VAR i: INTEGER; - BEGIN - i := 0; - WHILE (i < LEN(s)) & (s[i] # 0X) DO - Write(s[i]); - INC(i); - END; - END WriteString; - - PROCEDURE InitIO; - BEGIN + PROCEDURE Read*(VAR ch: CHAR); + BEGIN + Done := TRUE; + IF readAgain THEN + ch := oldch; readAgain := FALSE; + ELSIF ~ReadChar(ch) THEN + Done := FALSE; + ch := 0X; + ELSE + oldch := ch; + END; + END Read; + + PROCEDURE ReadAgain*; + BEGIN + IF readAgain THEN + Done := FALSE; + ELSE Done := TRUE; - END InitIO; + readAgain := TRUE; + END; + END ReadAgain; - PROCEDURE WriteInt*(arg: LONGINT); - VAR field: ARRAY 23 OF CHAR; - BEGIN (* the field size should be big enough to hold the long number. it was 12 to hold just 32 bit numbers, now it can hold 64 bit numbers; need to be more for 128bit numbers; -- noch *) - ConvertInteger(arg, 1, field); - WriteString(field); - END WriteInt; + PROCEDURE Write*(ch: CHAR); + BEGIN + Done := WriteChar(ch); + END Write; - PROCEDURE ReadInt*(VAR arg: LONGINT); - VAR ch: CHAR; - minus: BOOLEAN; - BEGIN - minus := FALSE; - REPEAT - Read(ch); - IF ~Done THEN RETURN END; - IF ch = "-" THEN - minus := TRUE; - ELSIF (ch # " ") & (ch # nl) & ((ch < "0") OR (ch > "9")) THEN - WriteString("--- Integer expected on input"); WriteLn; - END; - UNTIL (ch >= "0") & (ch <= "9"); - arg := ORD(ch) - ORD("0"); - REPEAT - Read(ch); - IF ~Done THEN RETURN END; - IF (ch >= "0") & (ch <= "9") THEN - arg := arg*10 + (ORD(ch) - ORD("0")); - END; - UNTIL (ch < "0") OR (ch > "9"); - ReadAgain; - IF minus THEN arg := -arg; END; - END ReadInt; + PROCEDURE WriteLn*; + CONST nl = 0AX; + BEGIN + Write(nl); + END WriteLn; - PROCEDURE ReadLine*(VAR string: ARRAY OF CHAR); - VAR - index: INTEGER; - ch: CHAR; - ok: BOOLEAN; - BEGIN - index := 0; ok := TRUE; - LOOP - IF ~ReadChar(ch) THEN ok := FALSE; EXIT END; - IF ch = nl THEN EXIT END; - IF index < LEN(string) THEN - string[index] := ch; INC(index); - END; + PROCEDURE WriteString*(s: ARRAY OF CHAR); + VAR i: INTEGER; + BEGIN + i := 0; + WHILE (i < LEN(s)) & (s[i] # 0X) DO + Write(s[i]); + INC(i); + END; + END WriteString; + + PROCEDURE InitIO; + BEGIN + readAgain := FALSE; + Done := TRUE; + END InitIO; + + PROCEDURE WriteInt*(arg: LONGINT); + VAR field: ARRAY 23 OF CHAR; + BEGIN (* the field size should be big enough to hold the long number. it was 12 to hold just 32 bit numbers, now it can hold 64 bit numbers; need to be more for 128bit numbers; -- noch *) + ConvertInteger(arg, 1, field); + WriteString(field); + END WriteInt; + + PROCEDURE ReadInt*(VAR arg: LONGINT); + VAR ch: CHAR; + minus: BOOLEAN; + BEGIN + minus := FALSE; + REPEAT + Read(ch); + IF ~Done THEN RETURN END; + IF ch = "-" THEN + minus := TRUE; + ELSIF (ch # " ") & (ch # nl) & ((ch < "0") OR (ch > "9")) THEN + WriteString("--- Integer expected on input"); WriteLn; END; + UNTIL (ch >= "0") & (ch <= "9"); + arg := ORD(ch) - ORD("0"); + REPEAT + Read(ch); + IF ~Done THEN RETURN END; + IF (ch >= "0") & (ch <= "9") THEN + arg := arg*10 + (ORD(ch) - ORD("0")); + END; + UNTIL (ch < "0") OR (ch > "9"); + ReadAgain; + IF minus THEN arg := -arg; END; + END ReadInt; + + PROCEDURE ReadLine*(VAR string: ARRAY OF CHAR); + VAR + index: INTEGER; + ch: CHAR; + ok: BOOLEAN; + BEGIN + index := 0; ok := TRUE; + LOOP + IF ~ReadChar(ch) THEN ok := FALSE; EXIT END; + IF ch = nl THEN EXIT END; IF index < LEN(string) THEN - string[index] := 0X; + string[index] := ch; INC(index); END; - Done := ok OR (index > 0); - END ReadLine; + END; + IF index < LEN(string) THEN + string[index] := 0X; + END; + Done := ok OR (index > 0); + END ReadLine; BEGIN - InitIO; + InitIO; END ulmIO. diff --git a/src/library/ulm/ulmSYSTEM.Mod b/src/library/ulm/ulmSYSTEM.Mod index 838548f0..bbd054b8 100644 --- a/src/library/ulm/ulmSYSTEM.Mod +++ b/src/library/ulm/ulmSYSTEM.Mod @@ -50,23 +50,25 @@ TYPE pchar = POINTER TO ARRAY 1 OF CHAR; END TAS; PROCEDURE UNIXCALL*(syscall: LONGINT; VAR d0, d1: LONGINT; (* in ulm version both LONGINT and INTEGER are 4 byte size *) - arg1, arg2, arg3: LONGINT) : BOOLEAN; + arg1, arg2, arg3: LONGINT) : BOOLEAN; VAR n: LONGINT; ch: CHAR; pch: pchar; - pstr: pstring; + pstr: pstring; h: Platform.FileHandle; (* pst : pstatus; *) BEGIN - + IF syscall = Sys.read THEN - RETURN Platform.Read(arg1, arg2, arg3, n) = 0; + d0 := Platform.Read(arg1, arg2, arg3, n); + IF d0 >= 0 THEN d0 := n END; + RETURN d0 >= 0; (*NEW(pch); pch := SYSTEM.VAL(pchar, arg2); ch := pch^[0]; n := read(ch); - IF n # 1 THEN + IF n # 1 THEN ch := 0X; RETURN FALSE ELSE @@ -81,7 +83,7 @@ TYPE pchar = POINTER TO ARRAY 1 OF CHAR; n := Write(SYSTEM.VAL(LONGINT, pch), 1); IF n # 1 THEN RETURN FALSE ELSE RETURN TRUE END *) - ELSIF syscall = Sys.open THEN + ELSIF syscall = Sys.open THEN pstr := SYSTEM.VAL(pstring, arg1); IF SYSTEM.VAL(SET, arg3) * {0,1} # {} THEN RETURN Platform.OldRW(pstr^, d0) = 0 diff --git a/src/system/Console.Mod b/src/system/Console.Mod index 8e2be161..430519df 100644 --- a/src/system/Console.Mod +++ b/src/system/Console.Mod @@ -10,7 +10,7 @@ MODULE Console; (* J. Templ, 29-June-96 *) PROCEDURE Flush*; VAR error: Platform.ErrorCode; BEGIN - error := Platform.Write(Platform.StdOut, SYSTEM.ADR(line), pos); + error := Platform.Write(Platform.StdOut, SYSTEM.ADR(line), pos); pos := 0; END Flush; @@ -53,9 +53,9 @@ MODULE Console; (* J. Templ, 29-June-96 *) END Bool; PROCEDURE Hex*(i: LONGINT); - VAR k, n: LONGINT; + VAR k: INTEGER; n: SYSTEM.INT64; BEGIN - k := -28; + k := 4 - 8 * SIZE(LONGINT); WHILE k <= 0 DO n := ASH(i, k) MOD 16; IF n <= 9 THEN Char(CHR(ORD("0") + n)) ELSE Char(CHR(ORD("A") - 10 + n)) END ; From 21964471d8058bb6759f31aa17c9e2cbfa7cd289 Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 15 Sep 2016 17:39:30 +0100 Subject: [PATCH 233/580] Fix import of SYSTEM.INT64 type on 32 bit platforms. --- bootstrap/unix-44/OPS.c | 10 +++++----- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 9 ++++++--- bootstrap/unix-48/OPS.c | 10 +++++----- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 9 ++++++--- bootstrap/unix-88/OPT.c | 9 ++++++--- bootstrap/windows-48/OPS.c | 10 +++++----- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 9 ++++++--- bootstrap/windows-88/OPT.c | 9 ++++++--- src/compiler/OPS.Mod | 2 +- src/compiler/OPT.Mod | 6 ++++-- 13 files changed, 53 insertions(+), 36 deletions(-) diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index 5243ea65..29ea2414 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -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); } diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index af53d634..57cf06d3 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -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; diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index a12c1a7f..62ff8882 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -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) diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index 5243ea65..29ea2414 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -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); } diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index af53d634..57cf06d3 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -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; diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index a12c1a7f..62ff8882 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -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) diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index 82c2df59..d9b211df 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -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) diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index 5243ea65..29ea2414 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -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); } diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index af53d634..57cf06d3 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -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; diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index a12c1a7f..62ff8882 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -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) diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index 82c2df59..d9b211df 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -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) diff --git a/src/compiler/OPS.Mod b/src/compiler/OPS.Mod index 909cdee2..e386e538 100644 --- a/src/compiler/OPS.Mod +++ b/src/compiler/OPS.Mod @@ -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; diff --git a/src/compiler/OPT.Mod b/src/compiler/OPT.Mod index 8b21b9a5..cd1eae8b 100644 --- a/src/compiler/OPT.Mod +++ b/src/compiler/OPT.Mod @@ -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; From 636c128d14a90538013127740e638cf225dced5a Mon Sep 17 00:00:00 2001 From: David Brown Date: Sun, 18 Sep 2016 10:55:14 +0100 Subject: [PATCH 234/580] Fix import of SYSTEM.INT64 on 32 bit builds. --- bootstrap/unix-44/Configuration.c | 4 +- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Console.c | 2 +- bootstrap/unix-44/Console.h | 2 +- bootstrap/unix-44/Files.c | 2 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 2 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 2 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 2 +- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 161 ++++++++++++++++----------- bootstrap/unix-44/OPT.h | 3 +- bootstrap/unix-44/OPV.c | 8 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/Vishap.c | 16 ++- bootstrap/unix-44/errors.c | 2 +- bootstrap/unix-44/errors.h | 2 +- bootstrap/unix-44/extTools.c | 2 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-44/vt100.c | 2 +- bootstrap/unix-44/vt100.h | 2 +- bootstrap/unix-48/Configuration.c | 4 +- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Console.c | 2 +- bootstrap/unix-48/Console.h | 2 +- bootstrap/unix-48/Files.c | 2 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 2 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 2 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 2 +- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 161 ++++++++++++++++----------- bootstrap/unix-48/OPT.h | 3 +- bootstrap/unix-48/OPV.c | 8 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/Vishap.c | 16 ++- bootstrap/unix-48/errors.c | 2 +- bootstrap/unix-48/errors.h | 2 +- bootstrap/unix-48/extTools.c | 2 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-48/vt100.c | 2 +- bootstrap/unix-48/vt100.h | 2 +- bootstrap/unix-88/Configuration.c | 4 +- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Console.c | 2 +- bootstrap/unix-88/Console.h | 2 +- bootstrap/unix-88/Files.c | 2 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 2 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 2 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 2 +- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 161 ++++++++++++++++----------- bootstrap/unix-88/OPT.h | 3 +- bootstrap/unix-88/OPV.c | 8 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/Vishap.c | 16 ++- bootstrap/unix-88/errors.c | 2 +- bootstrap/unix-88/errors.h | 2 +- bootstrap/unix-88/extTools.c | 2 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/unix-88/vt100.c | 2 +- bootstrap/unix-88/vt100.h | 2 +- bootstrap/windows-48/Configuration.c | 4 +- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Console.c | 2 +- bootstrap/windows-48/Console.h | 2 +- bootstrap/windows-48/Files.c | 2 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 2 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 2 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 2 +- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 161 ++++++++++++++++----------- bootstrap/windows-48/OPT.h | 3 +- bootstrap/windows-48/OPV.c | 8 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/Vishap.c | 16 ++- bootstrap/windows-48/errors.c | 2 +- bootstrap/windows-48/errors.h | 2 +- bootstrap/windows-48/extTools.c | 2 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-48/vt100.c | 2 +- bootstrap/windows-48/vt100.h | 2 +- bootstrap/windows-88/Configuration.c | 4 +- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Console.c | 2 +- bootstrap/windows-88/Console.h | 2 +- bootstrap/windows-88/Files.c | 2 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 2 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 2 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 2 +- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 161 ++++++++++++++++----------- bootstrap/windows-88/OPT.h | 3 +- bootstrap/windows-88/OPV.c | 8 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Platform.c | 2 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/Vishap.c | 16 ++- bootstrap/windows-88/errors.c | 2 +- bootstrap/windows-88/errors.h | 2 +- bootstrap/windows-88/extTools.c | 2 +- bootstrap/windows-88/extTools.h | 2 +- bootstrap/windows-88/vt100.c | 2 +- bootstrap/windows-88/vt100.h | 2 +- src/compiler/OPT.Mod | 72 ++++++------ src/compiler/OPV.Mod | 7 +- src/compiler/Vishap.Mod | 17 ++- 198 files changed, 823 insertions(+), 573 deletions(-) diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index 06ec0ed7..1a0e2ffe 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/15] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/18] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index 9276e796..e5d79317 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Console.c b/bootstrap/unix-44/Console.c index 4007101f..168abb08 100644 --- a/bootstrap/unix-44/Console.c +++ b/bootstrap/unix-44/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Console.h b/bootstrap/unix-44/Console.h index 23ec5930..cca2c91e 100644 --- a/bootstrap/unix-44/Console.h +++ b/bootstrap/unix-44/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 17a56a1d..a37ffdd3 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index 81a5660b..c86d1186 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index c3422d37..b80b6666 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tskSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index 2a231c6e..50308888 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index 74cb4e47..142b60f4 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index ba7f2930..2dc36a9b 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index 5bc128d1..90e93aed 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index 8579409b..183a5f32 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index c1a7d45a..17690465 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index 576bdf18..34d9ebc2 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index ffc05a37..18478d1e 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index 56b587e9..a36522a1 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index 7c0b62db..8db5ef60 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index e578b0bd..22557b29 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index 29ea2414..fb0f2237 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index 57cf06d3..d2b5dfb4 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index 62ff8882..83a2652b 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -89,11 +89,11 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +export OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj; export int8 OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; export BOOLEAN OPT_SYSimported; -static OPT_Struct OPT_IntTypes[20]; static OPT_Object OPT_universe, OPT_syslink; static OPT_ImpCtxt OPT_impCtxt; static OPT_ExpCtxt OPT_expCtxt; @@ -113,6 +113,7 @@ static void OPT_DebugStruct (OPT_Struct btyp); static void OPT_EnterBoolConst (OPS_Name name, int32 value); static void OPT_EnterProc (OPS_Name name, int16 num); static void OPT_EnterTyp (OPS_Name name, int8 form, int16 size, OPT_Struct *res); +static void OPT_EnterTypeAlias (OPS_Name name, OPT_Object *res); export void OPT_Export (BOOLEAN *ext, BOOLEAN *new); export void OPT_FPrintErr (OPT_Object obj, int16 errcode); static void OPT_FPrintName (int32 *fp, CHAR *name, LONGINT name__len); @@ -165,16 +166,20 @@ static void OPT_err (int16 n) OPT_Struct OPT_IntType (int32 size) { OPT_Struct _o_result; - int16 i; - i = 1; - 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; + if (size <= OPT_int8typ->size) { + _o_result = OPT_int8typ; + return _o_result; } - __RETCHK; + if (size <= OPT_int16typ->size) { + _o_result = OPT_int16typ; + return _o_result; + } + if (size <= OPT_int32typ->size) { + _o_result = OPT_int32typ; + return _o_result; + } + _o_result = OPT_int64typ; + return _o_result; } OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir) @@ -182,15 +187,40 @@ OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir) OPT_Struct _o_result; int16 i; __ASSERT(x->form == 4, 0); - __ASSERT(dir == 1 || dir == -1, 0); __ASSERT(x->BaseTyp == OPT_undftyp, 0); - i = 0; - while ((OPT_IntTypes[__X(i, 20)] != x && i < 20)) { - i += 1; + __ASSERT(dir == 1 || dir == -1, 0); + if (dir > 0) { + if (x->size < OPT_sinttyp->size) { + _o_result = OPT_sinttyp; + return _o_result; + } + if (x->size < OPT_inttyp->size) { + _o_result = OPT_inttyp; + return _o_result; + } + if (x->size < OPT_linttyp->size) { + _o_result = OPT_linttyp; + return _o_result; + } + _o_result = OPT_int64typ; + return _o_result; + } else { + if (x->size > OPT_linttyp->size) { + _o_result = OPT_linttyp; + return _o_result; + } + if (x->size > OPT_inttyp->size) { + _o_result = OPT_inttyp; + return _o_result; + } + if (x->size > OPT_sinttyp->size) { + _o_result = OPT_sinttyp; + return _o_result; + } + _o_result = OPT_int8typ; + return _o_result; } - __ASSERT(i < 19, 0); - _o_result = OPT_IntTypes[__X(i + dir, 20)]; - return _o_result; + __RETCHK; } OPT_Const OPT_NewConst (void) @@ -505,21 +535,21 @@ void OPT_IdFPrint (OPT_Struct typ) } } -static struct FPrintStr__12 { +static struct FPrintStr__13 { int32 *pbfp, *pvfp; - struct FPrintStr__12 *lnk; -} *FPrintStr__12_s; + struct FPrintStr__13 *lnk; +} *FPrintStr__13_s; -static void FPrintFlds__13 (OPT_Object fld, int32 adr, BOOLEAN visible); -static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, int32 adr); -static void FPrintTProcs__17 (OPT_Object obj); +static void FPrintFlds__14 (OPT_Object fld, int32 adr, BOOLEAN visible); +static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, int32 adr); +static void FPrintTProcs__18 (OPT_Object obj); -static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, int32 adr) +static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, int32 adr) { int32 i, j, n; OPT_Struct btyp = NIL; if (typ->comp == 4) { - FPrintFlds__13(typ->link, adr, 0); + FPrintFlds__14(typ->link, adr, 0); } else if (typ->comp == 2) { btyp = typ->BaseTyp; n = typ->n; @@ -529,53 +559,53 @@ static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, int32 adr) } if (btyp->form == 11 || btyp->comp == 4) { j = OPT_nofhdfld; - FPrintHdFld__15(btyp, fld, adr); + FPrintHdFld__16(btyp, fld, adr); if (j != OPT_nofhdfld) { i = 1; while ((i < n && OPT_nofhdfld <= 2048)) { adr += btyp->size; - FPrintHdFld__15(btyp, fld, adr); + FPrintHdFld__16(btyp, fld, adr); i += 1; } } } } else if (typ->form == 11 || __STRCMP(fld->name, "@ptr") == 0) { - OPM_FPrint(&*FPrintStr__12_s->pvfp, 11); - OPM_FPrint(&*FPrintStr__12_s->pvfp, adr); + OPM_FPrint(&*FPrintStr__13_s->pvfp, 11); + OPM_FPrint(&*FPrintStr__13_s->pvfp, adr); OPT_nofhdfld += 1; } } -static void FPrintFlds__13 (OPT_Object fld, int32 adr, BOOLEAN visible) +static void FPrintFlds__14 (OPT_Object fld, int32 adr, BOOLEAN visible) { while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { - OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->vis); - OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)fld->name, 256); - OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->adr); + OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->vis); + OPT_FPrintName(&*FPrintStr__13_s->pbfp, (void*)fld->name, 256); + OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->adr); OPT_FPrintStr(fld->typ); - OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->typ->pbfp); - OPM_FPrint(&*FPrintStr__12_s->pvfp, fld->typ->pvfp); + OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->typ->pbfp); + OPM_FPrint(&*FPrintStr__13_s->pvfp, fld->typ->pvfp); } else { - FPrintHdFld__15(fld->typ, fld, fld->adr + adr); + FPrintHdFld__16(fld->typ, fld, fld->adr + adr); } fld = fld->link; } } -static void FPrintTProcs__17 (OPT_Object obj) +static void FPrintTProcs__18 (OPT_Object obj) { if (obj != NIL) { - FPrintTProcs__17(obj->left); + FPrintTProcs__18(obj->left); if (obj->mode == 13) { if (obj->vis != 0) { - OPM_FPrint(&*FPrintStr__12_s->pbfp, 13); - OPM_FPrint(&*FPrintStr__12_s->pbfp, __ASHR(obj->adr, 16)); - OPT_FPrintSign(&*FPrintStr__12_s->pbfp, obj->typ, obj->link); - OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)obj->name, 256); + OPM_FPrint(&*FPrintStr__13_s->pbfp, 13); + OPM_FPrint(&*FPrintStr__13_s->pbfp, __ASHR(obj->adr, 16)); + OPT_FPrintSign(&*FPrintStr__13_s->pbfp, obj->typ, obj->link); + OPT_FPrintName(&*FPrintStr__13_s->pbfp, (void*)obj->name, 256); } } - FPrintTProcs__17(obj->right); + FPrintTProcs__18(obj->right); } } @@ -585,11 +615,11 @@ void OPT_FPrintStr (OPT_Struct typ) OPT_Struct btyp = NIL; OPT_Object strobj = NIL, bstrobj = NIL; int32 pbfp, pvfp; - struct FPrintStr__12 _s; + struct FPrintStr__13 _s; _s.pbfp = &pbfp; _s.pvfp = &pvfp; - _s.lnk = FPrintStr__12_s; - FPrintStr__12_s = &_s; + _s.lnk = FPrintStr__13_s; + FPrintStr__13_s = &_s; if (!typ->fpdone) { OPT_IdFPrint(typ); pbfp = typ->idfp; @@ -626,11 +656,11 @@ void OPT_FPrintStr (OPT_Struct typ) OPM_FPrint(&pvfp, typ->align); OPM_FPrint(&pvfp, typ->n); OPT_nofhdfld = 0; - FPrintFlds__13(typ->link, 0, 1); + FPrintFlds__14(typ->link, 0, 1); if (OPT_nofhdfld > 2048) { OPM_Mark(225, typ->txtpos); } - FPrintTProcs__17(typ->link); + FPrintTProcs__18(typ->link); OPM_FPrint(&pvfp, pbfp); strobj = typ->strobj; if (strobj == NIL || strobj->name[0] == 0x00) { @@ -640,7 +670,7 @@ void OPT_FPrintStr (OPT_Struct typ) typ->pbfp = pbfp; typ->pvfp = pvfp; } - FPrintStr__12_s = _s.lnk; + FPrintStr__13_s = _s.lnk; } void OPT_FPrintObj (OPT_Object obj) @@ -1754,6 +1784,18 @@ static void OPT_EnterTyp (OPS_Name name, int8 form, int16 size, OPT_Struct *res) *res = typ; } +static void OPT_EnterTypeAlias (OPS_Name name, OPT_Object *res) +{ + OPT_Object obj = NIL; + OPS_Name name__copy; + __DUPARR(name, OPS_Name); + OPT_Insert(name, &obj); + obj->mode = 5; + obj->typ = NIL; + obj->vis = 1; + *res = obj; +} + static void OPT_EnterProc (OPS_Name name, int16 num) { OPT_Object obj = NIL; @@ -1787,8 +1829,10 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_niltyp); P(OPT_notyp); P(OPT_sysptrtyp); + P(OPT_sintobj); + P(OPT_intobj); + P(OPT_lintobj); __ENUMP(OPT_GlbMod, 64, P); - __ENUMP(OPT_IntTypes, 20, P); P(OPT_universe); P(OPT_syslink); __ENUMR(&OPT_impCtxt, OPT_ImpCtxt__typ, 3140, 1, P); @@ -1881,10 +1925,10 @@ export void *OPT__init(void) OPT_EnterTyp((CHAR*)"CHAR", 3, OPM_CharSize, &OPT_chartyp); OPT_EnterTyp((CHAR*)"SET", 7, OPM_SetSize, &OPT_settyp); OPT_EnterTyp((CHAR*)"REAL", 5, OPM_RealSize, &OPT_realtyp); - OPT_EnterTyp((CHAR*)"INTEGER", 4, OPM_IntSize, &OPT_inttyp); - OPT_EnterTyp((CHAR*)"LONGINT", 4, OPM_LIntSize, &OPT_linttyp); OPT_EnterTyp((CHAR*)"LONGREAL", 6, OPM_LRealSize, &OPT_lrltyp); - OPT_EnterTyp((CHAR*)"SHORTINT", 4, OPM_SIntSize, &OPT_sinttyp); + OPT_EnterTypeAlias((CHAR*)"SHORTINT", &OPT_sintobj); + OPT_EnterTypeAlias((CHAR*)"INTEGER", &OPT_intobj); + OPT_EnterTypeAlias((CHAR*)"LONGINT", &OPT_lintobj); OPT_EnterBoolConst((CHAR*)"FALSE", 0); OPT_EnterBoolConst((CHAR*)"TRUE", 1); OPT_EnterProc((CHAR*)"HALT", 0); @@ -1912,7 +1956,7 @@ export void *OPT__init(void) OPT_impCtxt.ref[1] = OPT_bytetyp; OPT_impCtxt.ref[2] = OPT_booltyp; OPT_impCtxt.ref[3] = OPT_chartyp; - OPT_impCtxt.ref[4] = OPT_inttyp; + OPT_impCtxt.ref[4] = OPT_int32typ; OPT_impCtxt.ref[5] = OPT_realtyp; OPT_impCtxt.ref[6] = OPT_lrltyp; OPT_impCtxt.ref[7] = OPT_settyp; @@ -1920,12 +1964,5 @@ export void *OPT__init(void) OPT_impCtxt.ref[9] = OPT_niltyp; OPT_impCtxt.ref[10] = OPT_notyp; OPT_impCtxt.ref[11] = OPT_sysptrtyp; - OPT_IntTypes[1] = OPT_sinttyp; - OPT_IntTypes[2] = OPT_inttyp; - OPT_IntTypes[3] = OPT_linttyp; - OPT_IntTypes[5] = OPT_int8typ; - OPT_IntTypes[6] = OPT_int16typ; - OPT_IntTypes[7] = OPT_int32typ; - OPT_IntTypes[8] = OPT_int64typ; __ENDMOD; } diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index dff6a509..d4b49da8 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h @@ -68,6 +68,7 @@ typedef import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +import OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj; import int8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index b34d16d0..a32351aa 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -258,6 +258,9 @@ static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exporte void OPV_AdrAndSize (OPT_Object topScope) { + __ASSERT(OPT_sinttyp != NIL, 0); + __ASSERT(OPT_inttyp != NIL, 0); + __ASSERT(OPT_linttyp != NIL, 0); OPM_errpos = topScope->adr; topScope->leaf = 1; OPV_Traverse(topScope->right, topScope, 1); @@ -265,15 +268,12 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_chartyp->strobj->linkadr = 2; OPT_settyp->strobj->linkadr = 2; OPT_realtyp->strobj->linkadr = 2; - OPT_inttyp->strobj->linkadr = 2; - OPT_linttyp->strobj->linkadr = 2; OPT_adrtyp->strobj->linkadr = 2; OPT_int8typ->strobj->linkadr = 2; OPT_int16typ->strobj->linkadr = 2; OPT_int32typ->strobj->linkadr = 2; OPT_int64typ->strobj->linkadr = 2; OPT_lrltyp->strobj->linkadr = 2; - OPT_sinttyp->strobj->linkadr = 2; OPT_booltyp->strobj->linkadr = 2; OPT_bytetyp->strobj->linkadr = 2; OPT_sysptrtyp->strobj->linkadr = 2; diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index 0716a62f..937f0ba6 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index a7b7d28a..cdb47dd1 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index 574abdf6..6e372559 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 30d7462f..8b263757 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index 034d0e43..6ff22ad6 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index a4ed943e..8758a988 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index 226b6aeb..36e01e6c 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index 9ae78a2d..994ef48a 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index af7ba940..033c5c1a 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/Vishap.c b/bootstrap/unix-44/Vishap.c index 93bbfaf4..1f322c5e 100644 --- a/bootstrap/unix-44/Vishap.c +++ b/bootstrap/unix-44/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkamSf */ #define INTEGER int16 #define LONGINT int32 @@ -84,12 +84,20 @@ static void Vishap_PropagateElementaryTypeSizes (void) OPT_chartyp->size = OPM_CharSize; OPT_settyp->size = OPM_SetSize; OPT_realtyp->size = OPM_RealSize; - OPT_inttyp->size = OPM_IntSize; - OPT_linttyp->size = OPM_LIntSize; OPT_adrtyp->size = OPM_PointerSize; OPT_lrltyp->size = OPM_LRealSize; - OPT_sinttyp->size = OPM_SIntSize; OPT_booltyp->size = OPM_BoolSize; + OPT_sinttyp = OPT_int8typ; + if (OPM_IntSize == 2) { + OPT_inttyp = OPT_int16typ; + OPT_linttyp = OPT_int32typ; + } else { + OPT_inttyp = OPT_int32typ; + OPT_linttyp = OPT_int64typ; + } + OPT_sintobj->typ = OPT_sinttyp; + OPT_intobj->typ = OPT_inttyp; + OPT_lintobj->typ = OPT_linttyp; } void Vishap_Translate (void) diff --git a/bootstrap/unix-44/errors.c b/bootstrap/unix-44/errors.c index 330d0f79..689e3cdd 100644 --- a/bootstrap/unix-44/errors.c +++ b/bootstrap/unix-44/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/errors.h b/bootstrap/unix-44/errors.h index f916c173..f5c1a708 100644 --- a/bootstrap/unix-44/errors.h +++ b/bootstrap/unix-44/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index a0370292..c2339121 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index 04a7b8d6..6815aacb 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-44/vt100.c b/bootstrap/unix-44/vt100.c index 7e16410c..341502ec 100644 --- a/bootstrap/unix-44/vt100.c +++ b/bootstrap/unix-44/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/vt100.h b/bootstrap/unix-44/vt100.h index c1c3c8fa..f7615911 100644 --- a/bootstrap/unix-44/vt100.h +++ b/bootstrap/unix-44/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index 06ec0ed7..1a0e2ffe 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/15] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/18] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index 9276e796..e5d79317 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Console.c b/bootstrap/unix-48/Console.c index 4007101f..168abb08 100644 --- a/bootstrap/unix-48/Console.c +++ b/bootstrap/unix-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Console.h b/bootstrap/unix-48/Console.h index 23ec5930..cca2c91e 100644 --- a/bootstrap/unix-48/Console.h +++ b/bootstrap/unix-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 17a56a1d..a37ffdd3 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index 81a5660b..c86d1186 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index c3422d37..b80b6666 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tskSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index 2a231c6e..50308888 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index 74cb4e47..142b60f4 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index ba7f2930..2dc36a9b 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index 5bc128d1..90e93aed 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index 8579409b..183a5f32 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index c1a7d45a..17690465 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index 576bdf18..34d9ebc2 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index ffc05a37..18478d1e 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index 56b587e9..a36522a1 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index 7c0b62db..8db5ef60 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index e578b0bd..22557b29 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index 29ea2414..fb0f2237 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index 57cf06d3..d2b5dfb4 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 62ff8882..83a2652b 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -89,11 +89,11 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +export OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj; export int8 OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; export BOOLEAN OPT_SYSimported; -static OPT_Struct OPT_IntTypes[20]; static OPT_Object OPT_universe, OPT_syslink; static OPT_ImpCtxt OPT_impCtxt; static OPT_ExpCtxt OPT_expCtxt; @@ -113,6 +113,7 @@ static void OPT_DebugStruct (OPT_Struct btyp); static void OPT_EnterBoolConst (OPS_Name name, int32 value); static void OPT_EnterProc (OPS_Name name, int16 num); static void OPT_EnterTyp (OPS_Name name, int8 form, int16 size, OPT_Struct *res); +static void OPT_EnterTypeAlias (OPS_Name name, OPT_Object *res); export void OPT_Export (BOOLEAN *ext, BOOLEAN *new); export void OPT_FPrintErr (OPT_Object obj, int16 errcode); static void OPT_FPrintName (int32 *fp, CHAR *name, LONGINT name__len); @@ -165,16 +166,20 @@ static void OPT_err (int16 n) OPT_Struct OPT_IntType (int32 size) { OPT_Struct _o_result; - int16 i; - i = 1; - 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; + if (size <= OPT_int8typ->size) { + _o_result = OPT_int8typ; + return _o_result; } - __RETCHK; + if (size <= OPT_int16typ->size) { + _o_result = OPT_int16typ; + return _o_result; + } + if (size <= OPT_int32typ->size) { + _o_result = OPT_int32typ; + return _o_result; + } + _o_result = OPT_int64typ; + return _o_result; } OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir) @@ -182,15 +187,40 @@ OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir) OPT_Struct _o_result; int16 i; __ASSERT(x->form == 4, 0); - __ASSERT(dir == 1 || dir == -1, 0); __ASSERT(x->BaseTyp == OPT_undftyp, 0); - i = 0; - while ((OPT_IntTypes[__X(i, 20)] != x && i < 20)) { - i += 1; + __ASSERT(dir == 1 || dir == -1, 0); + if (dir > 0) { + if (x->size < OPT_sinttyp->size) { + _o_result = OPT_sinttyp; + return _o_result; + } + if (x->size < OPT_inttyp->size) { + _o_result = OPT_inttyp; + return _o_result; + } + if (x->size < OPT_linttyp->size) { + _o_result = OPT_linttyp; + return _o_result; + } + _o_result = OPT_int64typ; + return _o_result; + } else { + if (x->size > OPT_linttyp->size) { + _o_result = OPT_linttyp; + return _o_result; + } + if (x->size > OPT_inttyp->size) { + _o_result = OPT_inttyp; + return _o_result; + } + if (x->size > OPT_sinttyp->size) { + _o_result = OPT_sinttyp; + return _o_result; + } + _o_result = OPT_int8typ; + return _o_result; } - __ASSERT(i < 19, 0); - _o_result = OPT_IntTypes[__X(i + dir, 20)]; - return _o_result; + __RETCHK; } OPT_Const OPT_NewConst (void) @@ -505,21 +535,21 @@ void OPT_IdFPrint (OPT_Struct typ) } } -static struct FPrintStr__12 { +static struct FPrintStr__13 { int32 *pbfp, *pvfp; - struct FPrintStr__12 *lnk; -} *FPrintStr__12_s; + struct FPrintStr__13 *lnk; +} *FPrintStr__13_s; -static void FPrintFlds__13 (OPT_Object fld, int32 adr, BOOLEAN visible); -static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, int32 adr); -static void FPrintTProcs__17 (OPT_Object obj); +static void FPrintFlds__14 (OPT_Object fld, int32 adr, BOOLEAN visible); +static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, int32 adr); +static void FPrintTProcs__18 (OPT_Object obj); -static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, int32 adr) +static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, int32 adr) { int32 i, j, n; OPT_Struct btyp = NIL; if (typ->comp == 4) { - FPrintFlds__13(typ->link, adr, 0); + FPrintFlds__14(typ->link, adr, 0); } else if (typ->comp == 2) { btyp = typ->BaseTyp; n = typ->n; @@ -529,53 +559,53 @@ static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, int32 adr) } if (btyp->form == 11 || btyp->comp == 4) { j = OPT_nofhdfld; - FPrintHdFld__15(btyp, fld, adr); + FPrintHdFld__16(btyp, fld, adr); if (j != OPT_nofhdfld) { i = 1; while ((i < n && OPT_nofhdfld <= 2048)) { adr += btyp->size; - FPrintHdFld__15(btyp, fld, adr); + FPrintHdFld__16(btyp, fld, adr); i += 1; } } } } else if (typ->form == 11 || __STRCMP(fld->name, "@ptr") == 0) { - OPM_FPrint(&*FPrintStr__12_s->pvfp, 11); - OPM_FPrint(&*FPrintStr__12_s->pvfp, adr); + OPM_FPrint(&*FPrintStr__13_s->pvfp, 11); + OPM_FPrint(&*FPrintStr__13_s->pvfp, adr); OPT_nofhdfld += 1; } } -static void FPrintFlds__13 (OPT_Object fld, int32 adr, BOOLEAN visible) +static void FPrintFlds__14 (OPT_Object fld, int32 adr, BOOLEAN visible) { while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { - OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->vis); - OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)fld->name, 256); - OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->adr); + OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->vis); + OPT_FPrintName(&*FPrintStr__13_s->pbfp, (void*)fld->name, 256); + OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->adr); OPT_FPrintStr(fld->typ); - OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->typ->pbfp); - OPM_FPrint(&*FPrintStr__12_s->pvfp, fld->typ->pvfp); + OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->typ->pbfp); + OPM_FPrint(&*FPrintStr__13_s->pvfp, fld->typ->pvfp); } else { - FPrintHdFld__15(fld->typ, fld, fld->adr + adr); + FPrintHdFld__16(fld->typ, fld, fld->adr + adr); } fld = fld->link; } } -static void FPrintTProcs__17 (OPT_Object obj) +static void FPrintTProcs__18 (OPT_Object obj) { if (obj != NIL) { - FPrintTProcs__17(obj->left); + FPrintTProcs__18(obj->left); if (obj->mode == 13) { if (obj->vis != 0) { - OPM_FPrint(&*FPrintStr__12_s->pbfp, 13); - OPM_FPrint(&*FPrintStr__12_s->pbfp, __ASHR(obj->adr, 16)); - OPT_FPrintSign(&*FPrintStr__12_s->pbfp, obj->typ, obj->link); - OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)obj->name, 256); + OPM_FPrint(&*FPrintStr__13_s->pbfp, 13); + OPM_FPrint(&*FPrintStr__13_s->pbfp, __ASHR(obj->adr, 16)); + OPT_FPrintSign(&*FPrintStr__13_s->pbfp, obj->typ, obj->link); + OPT_FPrintName(&*FPrintStr__13_s->pbfp, (void*)obj->name, 256); } } - FPrintTProcs__17(obj->right); + FPrintTProcs__18(obj->right); } } @@ -585,11 +615,11 @@ void OPT_FPrintStr (OPT_Struct typ) OPT_Struct btyp = NIL; OPT_Object strobj = NIL, bstrobj = NIL; int32 pbfp, pvfp; - struct FPrintStr__12 _s; + struct FPrintStr__13 _s; _s.pbfp = &pbfp; _s.pvfp = &pvfp; - _s.lnk = FPrintStr__12_s; - FPrintStr__12_s = &_s; + _s.lnk = FPrintStr__13_s; + FPrintStr__13_s = &_s; if (!typ->fpdone) { OPT_IdFPrint(typ); pbfp = typ->idfp; @@ -626,11 +656,11 @@ void OPT_FPrintStr (OPT_Struct typ) OPM_FPrint(&pvfp, typ->align); OPM_FPrint(&pvfp, typ->n); OPT_nofhdfld = 0; - FPrintFlds__13(typ->link, 0, 1); + FPrintFlds__14(typ->link, 0, 1); if (OPT_nofhdfld > 2048) { OPM_Mark(225, typ->txtpos); } - FPrintTProcs__17(typ->link); + FPrintTProcs__18(typ->link); OPM_FPrint(&pvfp, pbfp); strobj = typ->strobj; if (strobj == NIL || strobj->name[0] == 0x00) { @@ -640,7 +670,7 @@ void OPT_FPrintStr (OPT_Struct typ) typ->pbfp = pbfp; typ->pvfp = pvfp; } - FPrintStr__12_s = _s.lnk; + FPrintStr__13_s = _s.lnk; } void OPT_FPrintObj (OPT_Object obj) @@ -1754,6 +1784,18 @@ static void OPT_EnterTyp (OPS_Name name, int8 form, int16 size, OPT_Struct *res) *res = typ; } +static void OPT_EnterTypeAlias (OPS_Name name, OPT_Object *res) +{ + OPT_Object obj = NIL; + OPS_Name name__copy; + __DUPARR(name, OPS_Name); + OPT_Insert(name, &obj); + obj->mode = 5; + obj->typ = NIL; + obj->vis = 1; + *res = obj; +} + static void OPT_EnterProc (OPS_Name name, int16 num) { OPT_Object obj = NIL; @@ -1787,8 +1829,10 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_niltyp); P(OPT_notyp); P(OPT_sysptrtyp); + P(OPT_sintobj); + P(OPT_intobj); + P(OPT_lintobj); __ENUMP(OPT_GlbMod, 64, P); - __ENUMP(OPT_IntTypes, 20, P); P(OPT_universe); P(OPT_syslink); __ENUMR(&OPT_impCtxt, OPT_ImpCtxt__typ, 3140, 1, P); @@ -1881,10 +1925,10 @@ export void *OPT__init(void) OPT_EnterTyp((CHAR*)"CHAR", 3, OPM_CharSize, &OPT_chartyp); OPT_EnterTyp((CHAR*)"SET", 7, OPM_SetSize, &OPT_settyp); OPT_EnterTyp((CHAR*)"REAL", 5, OPM_RealSize, &OPT_realtyp); - OPT_EnterTyp((CHAR*)"INTEGER", 4, OPM_IntSize, &OPT_inttyp); - OPT_EnterTyp((CHAR*)"LONGINT", 4, OPM_LIntSize, &OPT_linttyp); OPT_EnterTyp((CHAR*)"LONGREAL", 6, OPM_LRealSize, &OPT_lrltyp); - OPT_EnterTyp((CHAR*)"SHORTINT", 4, OPM_SIntSize, &OPT_sinttyp); + OPT_EnterTypeAlias((CHAR*)"SHORTINT", &OPT_sintobj); + OPT_EnterTypeAlias((CHAR*)"INTEGER", &OPT_intobj); + OPT_EnterTypeAlias((CHAR*)"LONGINT", &OPT_lintobj); OPT_EnterBoolConst((CHAR*)"FALSE", 0); OPT_EnterBoolConst((CHAR*)"TRUE", 1); OPT_EnterProc((CHAR*)"HALT", 0); @@ -1912,7 +1956,7 @@ export void *OPT__init(void) OPT_impCtxt.ref[1] = OPT_bytetyp; OPT_impCtxt.ref[2] = OPT_booltyp; OPT_impCtxt.ref[3] = OPT_chartyp; - OPT_impCtxt.ref[4] = OPT_inttyp; + OPT_impCtxt.ref[4] = OPT_int32typ; OPT_impCtxt.ref[5] = OPT_realtyp; OPT_impCtxt.ref[6] = OPT_lrltyp; OPT_impCtxt.ref[7] = OPT_settyp; @@ -1920,12 +1964,5 @@ export void *OPT__init(void) OPT_impCtxt.ref[9] = OPT_niltyp; OPT_impCtxt.ref[10] = OPT_notyp; OPT_impCtxt.ref[11] = OPT_sysptrtyp; - OPT_IntTypes[1] = OPT_sinttyp; - OPT_IntTypes[2] = OPT_inttyp; - OPT_IntTypes[3] = OPT_linttyp; - OPT_IntTypes[5] = OPT_int8typ; - OPT_IntTypes[6] = OPT_int16typ; - OPT_IntTypes[7] = OPT_int32typ; - OPT_IntTypes[8] = OPT_int64typ; __ENDMOD; } diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index dff6a509..d4b49da8 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h @@ -68,6 +68,7 @@ typedef import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +import OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj; import int8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index b34d16d0..a32351aa 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -258,6 +258,9 @@ static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exporte void OPV_AdrAndSize (OPT_Object topScope) { + __ASSERT(OPT_sinttyp != NIL, 0); + __ASSERT(OPT_inttyp != NIL, 0); + __ASSERT(OPT_linttyp != NIL, 0); OPM_errpos = topScope->adr; topScope->leaf = 1; OPV_Traverse(topScope->right, topScope, 1); @@ -265,15 +268,12 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_chartyp->strobj->linkadr = 2; OPT_settyp->strobj->linkadr = 2; OPT_realtyp->strobj->linkadr = 2; - OPT_inttyp->strobj->linkadr = 2; - OPT_linttyp->strobj->linkadr = 2; OPT_adrtyp->strobj->linkadr = 2; OPT_int8typ->strobj->linkadr = 2; OPT_int16typ->strobj->linkadr = 2; OPT_int32typ->strobj->linkadr = 2; OPT_int64typ->strobj->linkadr = 2; OPT_lrltyp->strobj->linkadr = 2; - OPT_sinttyp->strobj->linkadr = 2; OPT_booltyp->strobj->linkadr = 2; OPT_bytetyp->strobj->linkadr = 2; OPT_sysptrtyp->strobj->linkadr = 2; diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index 0716a62f..937f0ba6 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index a7b7d28a..cdb47dd1 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index 574abdf6..6e372559 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 30d7462f..8b263757 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index 034d0e43..6ff22ad6 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index a4ed943e..8758a988 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index 226b6aeb..36e01e6c 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index 660559f5..e14d923b 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index 5ac796d7..45ca0bb5 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/Vishap.c b/bootstrap/unix-48/Vishap.c index 93bbfaf4..1f322c5e 100644 --- a/bootstrap/unix-48/Vishap.c +++ b/bootstrap/unix-48/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkamSf */ #define INTEGER int16 #define LONGINT int32 @@ -84,12 +84,20 @@ static void Vishap_PropagateElementaryTypeSizes (void) OPT_chartyp->size = OPM_CharSize; OPT_settyp->size = OPM_SetSize; OPT_realtyp->size = OPM_RealSize; - OPT_inttyp->size = OPM_IntSize; - OPT_linttyp->size = OPM_LIntSize; OPT_adrtyp->size = OPM_PointerSize; OPT_lrltyp->size = OPM_LRealSize; - OPT_sinttyp->size = OPM_SIntSize; OPT_booltyp->size = OPM_BoolSize; + OPT_sinttyp = OPT_int8typ; + if (OPM_IntSize == 2) { + OPT_inttyp = OPT_int16typ; + OPT_linttyp = OPT_int32typ; + } else { + OPT_inttyp = OPT_int32typ; + OPT_linttyp = OPT_int64typ; + } + OPT_sintobj->typ = OPT_sinttyp; + OPT_intobj->typ = OPT_inttyp; + OPT_lintobj->typ = OPT_linttyp; } void Vishap_Translate (void) diff --git a/bootstrap/unix-48/errors.c b/bootstrap/unix-48/errors.c index 330d0f79..689e3cdd 100644 --- a/bootstrap/unix-48/errors.c +++ b/bootstrap/unix-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/errors.h b/bootstrap/unix-48/errors.h index f916c173..f5c1a708 100644 --- a/bootstrap/unix-48/errors.h +++ b/bootstrap/unix-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index a0370292..c2339121 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index 04a7b8d6..6815aacb 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/vt100.c b/bootstrap/unix-48/vt100.c index 7e16410c..341502ec 100644 --- a/bootstrap/unix-48/vt100.c +++ b/bootstrap/unix-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/vt100.h b/bootstrap/unix-48/vt100.h index c1c3c8fa..f7615911 100644 --- a/bootstrap/unix-48/vt100.h +++ b/bootstrap/unix-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index e936fb1b..ec75a6df 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/15] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/18] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index 9276e796..e5d79317 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Console.c b/bootstrap/unix-88/Console.c index c25651d5..f7769827 100644 --- a/bootstrap/unix-88/Console.c +++ b/bootstrap/unix-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Console.h b/bootstrap/unix-88/Console.h index 288d9e0a..23f894db 100644 --- a/bootstrap/unix-88/Console.h +++ b/bootstrap/unix-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 79b77102..4c6982cc 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 048e6c0f..a5641b0c 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index fa10e8c0..c99a229c 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tskSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index ecebdfeb..f9b4a041 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 66df0a5c..662b84f9 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index 86580ab4..9f3d713d 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index 5a6a8dda..2f005fc6 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index 94ff6cbf..185aa968 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index a4e6388c..689dfff4 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index 185ac689..bf22de26 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 6b30d07b..23017356 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index 9c71f996..7472bed7 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index dce9eaec..63191e02 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index e578b0bd..22557b29 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index 61d3ad08..7caa7493 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index eef23e1f..6d67036e 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index d9b211df..b588c3f1 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -89,11 +89,11 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +export OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj; export int8 OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; export BOOLEAN OPT_SYSimported; -static OPT_Struct OPT_IntTypes[20]; static OPT_Object OPT_universe, OPT_syslink; static OPT_ImpCtxt OPT_impCtxt; static OPT_ExpCtxt OPT_expCtxt; @@ -113,6 +113,7 @@ static void OPT_DebugStruct (OPT_Struct btyp); static void OPT_EnterBoolConst (OPS_Name name, int64 value); static void OPT_EnterProc (OPS_Name name, int32 num); static void OPT_EnterTyp (OPS_Name name, int8 form, int32 size, OPT_Struct *res); +static void OPT_EnterTypeAlias (OPS_Name name, OPT_Object *res); export void OPT_Export (BOOLEAN *ext, BOOLEAN *new); export void OPT_FPrintErr (OPT_Object obj, int32 errcode); static void OPT_FPrintName (int64 *fp, CHAR *name, LONGINT name__len); @@ -165,16 +166,20 @@ static void OPT_err (int32 n) OPT_Struct OPT_IntType (int64 size) { OPT_Struct _o_result; - int32 i; - i = 1; - 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; + if (size <= OPT_int8typ->size) { + _o_result = OPT_int8typ; + return _o_result; } - __RETCHK; + if (size <= OPT_int16typ->size) { + _o_result = OPT_int16typ; + return _o_result; + } + if (size <= OPT_int32typ->size) { + _o_result = OPT_int32typ; + return _o_result; + } + _o_result = OPT_int64typ; + return _o_result; } OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int32 dir) @@ -182,15 +187,40 @@ OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int32 dir) OPT_Struct _o_result; int32 i; __ASSERT(x->form == 4, 0); - __ASSERT(dir == 1 || dir == -1, 0); __ASSERT(x->BaseTyp == OPT_undftyp, 0); - i = 0; - while ((OPT_IntTypes[__X(i, 20)] != x && i < 20)) { - i += 1; + __ASSERT(dir == 1 || dir == -1, 0); + if (dir > 0) { + if (x->size < OPT_sinttyp->size) { + _o_result = OPT_sinttyp; + return _o_result; + } + if (x->size < OPT_inttyp->size) { + _o_result = OPT_inttyp; + return _o_result; + } + if (x->size < OPT_linttyp->size) { + _o_result = OPT_linttyp; + return _o_result; + } + _o_result = OPT_int64typ; + return _o_result; + } else { + if (x->size > OPT_linttyp->size) { + _o_result = OPT_linttyp; + return _o_result; + } + if (x->size > OPT_inttyp->size) { + _o_result = OPT_inttyp; + return _o_result; + } + if (x->size > OPT_sinttyp->size) { + _o_result = OPT_sinttyp; + return _o_result; + } + _o_result = OPT_int8typ; + return _o_result; } - __ASSERT(i < 19, 0); - _o_result = OPT_IntTypes[__X(i + dir, 20)]; - return _o_result; + __RETCHK; } OPT_Const OPT_NewConst (void) @@ -505,21 +535,21 @@ void OPT_IdFPrint (OPT_Struct typ) } } -static struct FPrintStr__12 { +static struct FPrintStr__13 { int64 *pbfp, *pvfp; - struct FPrintStr__12 *lnk; -} *FPrintStr__12_s; + struct FPrintStr__13 *lnk; +} *FPrintStr__13_s; -static void FPrintFlds__13 (OPT_Object fld, int64 adr, BOOLEAN visible); -static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, int64 adr); -static void FPrintTProcs__17 (OPT_Object obj); +static void FPrintFlds__14 (OPT_Object fld, int64 adr, BOOLEAN visible); +static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, int64 adr); +static void FPrintTProcs__18 (OPT_Object obj); -static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, int64 adr) +static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, int64 adr) { int64 i, j, n; OPT_Struct btyp = NIL; if (typ->comp == 4) { - FPrintFlds__13(typ->link, adr, 0); + FPrintFlds__14(typ->link, adr, 0); } else if (typ->comp == 2) { btyp = typ->BaseTyp; n = typ->n; @@ -529,53 +559,53 @@ static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, int64 adr) } if (btyp->form == 11 || btyp->comp == 4) { j = OPT_nofhdfld; - FPrintHdFld__15(btyp, fld, adr); + FPrintHdFld__16(btyp, fld, adr); if (j != OPT_nofhdfld) { i = 1; while ((i < n && OPT_nofhdfld <= 2048)) { adr += btyp->size; - FPrintHdFld__15(btyp, fld, adr); + FPrintHdFld__16(btyp, fld, adr); i += 1; } } } } else if (typ->form == 11 || __STRCMP(fld->name, "@ptr") == 0) { - OPM_FPrint(&*FPrintStr__12_s->pvfp, 11); - OPM_FPrint(&*FPrintStr__12_s->pvfp, adr); + OPM_FPrint(&*FPrintStr__13_s->pvfp, 11); + OPM_FPrint(&*FPrintStr__13_s->pvfp, adr); OPT_nofhdfld += 1; } } -static void FPrintFlds__13 (OPT_Object fld, int64 adr, BOOLEAN visible) +static void FPrintFlds__14 (OPT_Object fld, int64 adr, BOOLEAN visible) { while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { - OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->vis); - OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)fld->name, 256); - OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->adr); + OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->vis); + OPT_FPrintName(&*FPrintStr__13_s->pbfp, (void*)fld->name, 256); + OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->adr); OPT_FPrintStr(fld->typ); - OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->typ->pbfp); - OPM_FPrint(&*FPrintStr__12_s->pvfp, fld->typ->pvfp); + OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->typ->pbfp); + OPM_FPrint(&*FPrintStr__13_s->pvfp, fld->typ->pvfp); } else { - FPrintHdFld__15(fld->typ, fld, fld->adr + adr); + FPrintHdFld__16(fld->typ, fld, fld->adr + adr); } fld = fld->link; } } -static void FPrintTProcs__17 (OPT_Object obj) +static void FPrintTProcs__18 (OPT_Object obj) { if (obj != NIL) { - FPrintTProcs__17(obj->left); + FPrintTProcs__18(obj->left); if (obj->mode == 13) { if (obj->vis != 0) { - OPM_FPrint(&*FPrintStr__12_s->pbfp, 13); - OPM_FPrint(&*FPrintStr__12_s->pbfp, __ASHR(obj->adr, 16)); - OPT_FPrintSign(&*FPrintStr__12_s->pbfp, obj->typ, obj->link); - OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)obj->name, 256); + OPM_FPrint(&*FPrintStr__13_s->pbfp, 13); + OPM_FPrint(&*FPrintStr__13_s->pbfp, __ASHR(obj->adr, 16)); + OPT_FPrintSign(&*FPrintStr__13_s->pbfp, obj->typ, obj->link); + OPT_FPrintName(&*FPrintStr__13_s->pbfp, (void*)obj->name, 256); } } - FPrintTProcs__17(obj->right); + FPrintTProcs__18(obj->right); } } @@ -585,11 +615,11 @@ void OPT_FPrintStr (OPT_Struct typ) OPT_Struct btyp = NIL; OPT_Object strobj = NIL, bstrobj = NIL; int64 pbfp, pvfp; - struct FPrintStr__12 _s; + struct FPrintStr__13 _s; _s.pbfp = &pbfp; _s.pvfp = &pvfp; - _s.lnk = FPrintStr__12_s; - FPrintStr__12_s = &_s; + _s.lnk = FPrintStr__13_s; + FPrintStr__13_s = &_s; if (!typ->fpdone) { OPT_IdFPrint(typ); pbfp = typ->idfp; @@ -626,11 +656,11 @@ void OPT_FPrintStr (OPT_Struct typ) OPM_FPrint(&pvfp, typ->align); OPM_FPrint(&pvfp, typ->n); OPT_nofhdfld = 0; - FPrintFlds__13(typ->link, 0, 1); + FPrintFlds__14(typ->link, 0, 1); if (OPT_nofhdfld > 2048) { OPM_Mark(225, typ->txtpos); } - FPrintTProcs__17(typ->link); + FPrintTProcs__18(typ->link); OPM_FPrint(&pvfp, pbfp); strobj = typ->strobj; if (strobj == NIL || strobj->name[0] == 0x00) { @@ -640,7 +670,7 @@ void OPT_FPrintStr (OPT_Struct typ) typ->pbfp = pbfp; typ->pvfp = pvfp; } - FPrintStr__12_s = _s.lnk; + FPrintStr__13_s = _s.lnk; } void OPT_FPrintObj (OPT_Object obj) @@ -1754,6 +1784,18 @@ static void OPT_EnterTyp (OPS_Name name, int8 form, int32 size, OPT_Struct *res) *res = typ; } +static void OPT_EnterTypeAlias (OPS_Name name, OPT_Object *res) +{ + OPT_Object obj = NIL; + OPS_Name name__copy; + __DUPARR(name, OPS_Name); + OPT_Insert(name, &obj); + obj->mode = 5; + obj->typ = NIL; + obj->vis = 1; + *res = obj; +} + static void OPT_EnterProc (OPS_Name name, int32 num) { OPT_Object obj = NIL; @@ -1787,8 +1829,10 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_niltyp); P(OPT_notyp); P(OPT_sysptrtyp); + P(OPT_sintobj); + P(OPT_intobj); + P(OPT_lintobj); __ENUMP(OPT_GlbMod, 64, P); - __ENUMP(OPT_IntTypes, 20, P); P(OPT_universe); P(OPT_syslink); __ENUMR(&OPT_impCtxt, OPT_ImpCtxt__typ, 6216, 1, P); @@ -1881,10 +1925,10 @@ export void *OPT__init(void) OPT_EnterTyp((CHAR*)"CHAR", 3, OPM_CharSize, &OPT_chartyp); OPT_EnterTyp((CHAR*)"SET", 7, OPM_SetSize, &OPT_settyp); OPT_EnterTyp((CHAR*)"REAL", 5, OPM_RealSize, &OPT_realtyp); - OPT_EnterTyp((CHAR*)"INTEGER", 4, OPM_IntSize, &OPT_inttyp); - OPT_EnterTyp((CHAR*)"LONGINT", 4, OPM_LIntSize, &OPT_linttyp); OPT_EnterTyp((CHAR*)"LONGREAL", 6, OPM_LRealSize, &OPT_lrltyp); - OPT_EnterTyp((CHAR*)"SHORTINT", 4, OPM_SIntSize, &OPT_sinttyp); + OPT_EnterTypeAlias((CHAR*)"SHORTINT", &OPT_sintobj); + OPT_EnterTypeAlias((CHAR*)"INTEGER", &OPT_intobj); + OPT_EnterTypeAlias((CHAR*)"LONGINT", &OPT_lintobj); OPT_EnterBoolConst((CHAR*)"FALSE", 0); OPT_EnterBoolConst((CHAR*)"TRUE", 1); OPT_EnterProc((CHAR*)"HALT", 0); @@ -1912,7 +1956,7 @@ export void *OPT__init(void) OPT_impCtxt.ref[1] = OPT_bytetyp; OPT_impCtxt.ref[2] = OPT_booltyp; OPT_impCtxt.ref[3] = OPT_chartyp; - OPT_impCtxt.ref[4] = OPT_inttyp; + OPT_impCtxt.ref[4] = OPT_int32typ; OPT_impCtxt.ref[5] = OPT_realtyp; OPT_impCtxt.ref[6] = OPT_lrltyp; OPT_impCtxt.ref[7] = OPT_settyp; @@ -1920,12 +1964,5 @@ export void *OPT__init(void) OPT_impCtxt.ref[9] = OPT_niltyp; OPT_impCtxt.ref[10] = OPT_notyp; OPT_impCtxt.ref[11] = OPT_sysptrtyp; - OPT_IntTypes[1] = OPT_sinttyp; - OPT_IntTypes[2] = OPT_inttyp; - OPT_IntTypes[3] = OPT_linttyp; - OPT_IntTypes[5] = OPT_int8typ; - OPT_IntTypes[6] = OPT_int16typ; - OPT_IntTypes[7] = OPT_int32typ; - OPT_IntTypes[8] = OPT_int64typ; __ENDMOD; } diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 7b529043..504e70b7 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h @@ -68,6 +68,7 @@ typedef import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +import OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj; import int8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 023ee089..46abf128 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -258,6 +258,9 @@ static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exporte void OPV_AdrAndSize (OPT_Object topScope) { + __ASSERT(OPT_sinttyp != NIL, 0); + __ASSERT(OPT_inttyp != NIL, 0); + __ASSERT(OPT_linttyp != NIL, 0); OPM_errpos = topScope->adr; topScope->leaf = 1; OPV_Traverse(topScope->right, topScope, 1); @@ -265,15 +268,12 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_chartyp->strobj->linkadr = 2; OPT_settyp->strobj->linkadr = 2; OPT_realtyp->strobj->linkadr = 2; - OPT_inttyp->strobj->linkadr = 2; - OPT_linttyp->strobj->linkadr = 2; OPT_adrtyp->strobj->linkadr = 2; OPT_int8typ->strobj->linkadr = 2; OPT_int16typ->strobj->linkadr = 2; OPT_int32typ->strobj->linkadr = 2; OPT_int64typ->strobj->linkadr = 2; OPT_lrltyp->strobj->linkadr = 2; - OPT_sinttyp->strobj->linkadr = 2; OPT_booltyp->strobj->linkadr = 2; OPT_bytetyp->strobj->linkadr = 2; OPT_sysptrtyp->strobj->linkadr = 2; diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index 0716a62f..937f0ba6 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 8bbc2357..874e4d6d 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index 077cb445..86dbc3cb 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index b4890fa9..08445989 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index 37f91340..44e13bae 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index 4f6767e1..ad3ef185 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index 235891d2..23e3adb8 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index 7a6726a6..5a607fdd 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index ea9dde4b..f18817ff 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/Vishap.c b/bootstrap/unix-88/Vishap.c index fef94478..1bc7e5ed 100644 --- a/bootstrap/unix-88/Vishap.c +++ b/bootstrap/unix-88/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkamSf */ #define INTEGER int32 #define LONGINT int64 @@ -84,12 +84,20 @@ static void Vishap_PropagateElementaryTypeSizes (void) OPT_chartyp->size = OPM_CharSize; OPT_settyp->size = OPM_SetSize; OPT_realtyp->size = OPM_RealSize; - OPT_inttyp->size = OPM_IntSize; - OPT_linttyp->size = OPM_LIntSize; OPT_adrtyp->size = OPM_PointerSize; OPT_lrltyp->size = OPM_LRealSize; - OPT_sinttyp->size = OPM_SIntSize; OPT_booltyp->size = OPM_BoolSize; + OPT_sinttyp = OPT_int8typ; + if (OPM_IntSize == 2) { + OPT_inttyp = OPT_int16typ; + OPT_linttyp = OPT_int32typ; + } else { + OPT_inttyp = OPT_int32typ; + OPT_linttyp = OPT_int64typ; + } + OPT_sintobj->typ = OPT_sinttyp; + OPT_intobj->typ = OPT_inttyp; + OPT_lintobj->typ = OPT_linttyp; } void Vishap_Translate (void) diff --git a/bootstrap/unix-88/errors.c b/bootstrap/unix-88/errors.c index 88cb5688..8d3792df 100644 --- a/bootstrap/unix-88/errors.c +++ b/bootstrap/unix-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/errors.h b/bootstrap/unix-88/errors.h index f916c173..f5c1a708 100644 --- a/bootstrap/unix-88/errors.h +++ b/bootstrap/unix-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index 08e242e0..d7c28163 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index 04a7b8d6..6815aacb 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/vt100.c b/bootstrap/unix-88/vt100.c index 96358c5b..a575d688 100644 --- a/bootstrap/unix-88/vt100.c +++ b/bootstrap/unix-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/vt100.h b/bootstrap/unix-88/vt100.h index b9c5430c..f0786605 100644 --- a/bootstrap/unix-88/vt100.h +++ b/bootstrap/unix-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index 06ec0ed7..1a0e2ffe 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/15] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/18] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index 9276e796..e5d79317 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Console.c b/bootstrap/windows-48/Console.c index 931e8e9b..f1978da4 100644 --- a/bootstrap/windows-48/Console.c +++ b/bootstrap/windows-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Console.h b/bootstrap/windows-48/Console.h index 23ec5930..cca2c91e 100644 --- a/bootstrap/windows-48/Console.h +++ b/bootstrap/windows-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 50b625ff..8c0d8fd5 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index f680e056..4a28825a 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index c3422d37..b80b6666 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tskSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index 2a231c6e..50308888 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index 74cb4e47..142b60f4 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index ba7f2930..2dc36a9b 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index 5bc128d1..90e93aed 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index 8579409b..183a5f32 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index c1a7d45a..17690465 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index 576bdf18..34d9ebc2 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index ffc05a37..18478d1e 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index 56b587e9..a36522a1 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index 7c0b62db..8db5ef60 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index e578b0bd..22557b29 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index 29ea2414..fb0f2237 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index 57cf06d3..d2b5dfb4 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 62ff8882..83a2652b 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -89,11 +89,11 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +export OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj; export int8 OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; export BOOLEAN OPT_SYSimported; -static OPT_Struct OPT_IntTypes[20]; static OPT_Object OPT_universe, OPT_syslink; static OPT_ImpCtxt OPT_impCtxt; static OPT_ExpCtxt OPT_expCtxt; @@ -113,6 +113,7 @@ static void OPT_DebugStruct (OPT_Struct btyp); static void OPT_EnterBoolConst (OPS_Name name, int32 value); static void OPT_EnterProc (OPS_Name name, int16 num); static void OPT_EnterTyp (OPS_Name name, int8 form, int16 size, OPT_Struct *res); +static void OPT_EnterTypeAlias (OPS_Name name, OPT_Object *res); export void OPT_Export (BOOLEAN *ext, BOOLEAN *new); export void OPT_FPrintErr (OPT_Object obj, int16 errcode); static void OPT_FPrintName (int32 *fp, CHAR *name, LONGINT name__len); @@ -165,16 +166,20 @@ static void OPT_err (int16 n) OPT_Struct OPT_IntType (int32 size) { OPT_Struct _o_result; - int16 i; - i = 1; - 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; + if (size <= OPT_int8typ->size) { + _o_result = OPT_int8typ; + return _o_result; } - __RETCHK; + if (size <= OPT_int16typ->size) { + _o_result = OPT_int16typ; + return _o_result; + } + if (size <= OPT_int32typ->size) { + _o_result = OPT_int32typ; + return _o_result; + } + _o_result = OPT_int64typ; + return _o_result; } OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir) @@ -182,15 +187,40 @@ OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir) OPT_Struct _o_result; int16 i; __ASSERT(x->form == 4, 0); - __ASSERT(dir == 1 || dir == -1, 0); __ASSERT(x->BaseTyp == OPT_undftyp, 0); - i = 0; - while ((OPT_IntTypes[__X(i, 20)] != x && i < 20)) { - i += 1; + __ASSERT(dir == 1 || dir == -1, 0); + if (dir > 0) { + if (x->size < OPT_sinttyp->size) { + _o_result = OPT_sinttyp; + return _o_result; + } + if (x->size < OPT_inttyp->size) { + _o_result = OPT_inttyp; + return _o_result; + } + if (x->size < OPT_linttyp->size) { + _o_result = OPT_linttyp; + return _o_result; + } + _o_result = OPT_int64typ; + return _o_result; + } else { + if (x->size > OPT_linttyp->size) { + _o_result = OPT_linttyp; + return _o_result; + } + if (x->size > OPT_inttyp->size) { + _o_result = OPT_inttyp; + return _o_result; + } + if (x->size > OPT_sinttyp->size) { + _o_result = OPT_sinttyp; + return _o_result; + } + _o_result = OPT_int8typ; + return _o_result; } - __ASSERT(i < 19, 0); - _o_result = OPT_IntTypes[__X(i + dir, 20)]; - return _o_result; + __RETCHK; } OPT_Const OPT_NewConst (void) @@ -505,21 +535,21 @@ void OPT_IdFPrint (OPT_Struct typ) } } -static struct FPrintStr__12 { +static struct FPrintStr__13 { int32 *pbfp, *pvfp; - struct FPrintStr__12 *lnk; -} *FPrintStr__12_s; + struct FPrintStr__13 *lnk; +} *FPrintStr__13_s; -static void FPrintFlds__13 (OPT_Object fld, int32 adr, BOOLEAN visible); -static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, int32 adr); -static void FPrintTProcs__17 (OPT_Object obj); +static void FPrintFlds__14 (OPT_Object fld, int32 adr, BOOLEAN visible); +static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, int32 adr); +static void FPrintTProcs__18 (OPT_Object obj); -static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, int32 adr) +static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, int32 adr) { int32 i, j, n; OPT_Struct btyp = NIL; if (typ->comp == 4) { - FPrintFlds__13(typ->link, adr, 0); + FPrintFlds__14(typ->link, adr, 0); } else if (typ->comp == 2) { btyp = typ->BaseTyp; n = typ->n; @@ -529,53 +559,53 @@ static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, int32 adr) } if (btyp->form == 11 || btyp->comp == 4) { j = OPT_nofhdfld; - FPrintHdFld__15(btyp, fld, adr); + FPrintHdFld__16(btyp, fld, adr); if (j != OPT_nofhdfld) { i = 1; while ((i < n && OPT_nofhdfld <= 2048)) { adr += btyp->size; - FPrintHdFld__15(btyp, fld, adr); + FPrintHdFld__16(btyp, fld, adr); i += 1; } } } } else if (typ->form == 11 || __STRCMP(fld->name, "@ptr") == 0) { - OPM_FPrint(&*FPrintStr__12_s->pvfp, 11); - OPM_FPrint(&*FPrintStr__12_s->pvfp, adr); + OPM_FPrint(&*FPrintStr__13_s->pvfp, 11); + OPM_FPrint(&*FPrintStr__13_s->pvfp, adr); OPT_nofhdfld += 1; } } -static void FPrintFlds__13 (OPT_Object fld, int32 adr, BOOLEAN visible) +static void FPrintFlds__14 (OPT_Object fld, int32 adr, BOOLEAN visible) { while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { - OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->vis); - OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)fld->name, 256); - OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->adr); + OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->vis); + OPT_FPrintName(&*FPrintStr__13_s->pbfp, (void*)fld->name, 256); + OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->adr); OPT_FPrintStr(fld->typ); - OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->typ->pbfp); - OPM_FPrint(&*FPrintStr__12_s->pvfp, fld->typ->pvfp); + OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->typ->pbfp); + OPM_FPrint(&*FPrintStr__13_s->pvfp, fld->typ->pvfp); } else { - FPrintHdFld__15(fld->typ, fld, fld->adr + adr); + FPrintHdFld__16(fld->typ, fld, fld->adr + adr); } fld = fld->link; } } -static void FPrintTProcs__17 (OPT_Object obj) +static void FPrintTProcs__18 (OPT_Object obj) { if (obj != NIL) { - FPrintTProcs__17(obj->left); + FPrintTProcs__18(obj->left); if (obj->mode == 13) { if (obj->vis != 0) { - OPM_FPrint(&*FPrintStr__12_s->pbfp, 13); - OPM_FPrint(&*FPrintStr__12_s->pbfp, __ASHR(obj->adr, 16)); - OPT_FPrintSign(&*FPrintStr__12_s->pbfp, obj->typ, obj->link); - OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)obj->name, 256); + OPM_FPrint(&*FPrintStr__13_s->pbfp, 13); + OPM_FPrint(&*FPrintStr__13_s->pbfp, __ASHR(obj->adr, 16)); + OPT_FPrintSign(&*FPrintStr__13_s->pbfp, obj->typ, obj->link); + OPT_FPrintName(&*FPrintStr__13_s->pbfp, (void*)obj->name, 256); } } - FPrintTProcs__17(obj->right); + FPrintTProcs__18(obj->right); } } @@ -585,11 +615,11 @@ void OPT_FPrintStr (OPT_Struct typ) OPT_Struct btyp = NIL; OPT_Object strobj = NIL, bstrobj = NIL; int32 pbfp, pvfp; - struct FPrintStr__12 _s; + struct FPrintStr__13 _s; _s.pbfp = &pbfp; _s.pvfp = &pvfp; - _s.lnk = FPrintStr__12_s; - FPrintStr__12_s = &_s; + _s.lnk = FPrintStr__13_s; + FPrintStr__13_s = &_s; if (!typ->fpdone) { OPT_IdFPrint(typ); pbfp = typ->idfp; @@ -626,11 +656,11 @@ void OPT_FPrintStr (OPT_Struct typ) OPM_FPrint(&pvfp, typ->align); OPM_FPrint(&pvfp, typ->n); OPT_nofhdfld = 0; - FPrintFlds__13(typ->link, 0, 1); + FPrintFlds__14(typ->link, 0, 1); if (OPT_nofhdfld > 2048) { OPM_Mark(225, typ->txtpos); } - FPrintTProcs__17(typ->link); + FPrintTProcs__18(typ->link); OPM_FPrint(&pvfp, pbfp); strobj = typ->strobj; if (strobj == NIL || strobj->name[0] == 0x00) { @@ -640,7 +670,7 @@ void OPT_FPrintStr (OPT_Struct typ) typ->pbfp = pbfp; typ->pvfp = pvfp; } - FPrintStr__12_s = _s.lnk; + FPrintStr__13_s = _s.lnk; } void OPT_FPrintObj (OPT_Object obj) @@ -1754,6 +1784,18 @@ static void OPT_EnterTyp (OPS_Name name, int8 form, int16 size, OPT_Struct *res) *res = typ; } +static void OPT_EnterTypeAlias (OPS_Name name, OPT_Object *res) +{ + OPT_Object obj = NIL; + OPS_Name name__copy; + __DUPARR(name, OPS_Name); + OPT_Insert(name, &obj); + obj->mode = 5; + obj->typ = NIL; + obj->vis = 1; + *res = obj; +} + static void OPT_EnterProc (OPS_Name name, int16 num) { OPT_Object obj = NIL; @@ -1787,8 +1829,10 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_niltyp); P(OPT_notyp); P(OPT_sysptrtyp); + P(OPT_sintobj); + P(OPT_intobj); + P(OPT_lintobj); __ENUMP(OPT_GlbMod, 64, P); - __ENUMP(OPT_IntTypes, 20, P); P(OPT_universe); P(OPT_syslink); __ENUMR(&OPT_impCtxt, OPT_ImpCtxt__typ, 3140, 1, P); @@ -1881,10 +1925,10 @@ export void *OPT__init(void) OPT_EnterTyp((CHAR*)"CHAR", 3, OPM_CharSize, &OPT_chartyp); OPT_EnterTyp((CHAR*)"SET", 7, OPM_SetSize, &OPT_settyp); OPT_EnterTyp((CHAR*)"REAL", 5, OPM_RealSize, &OPT_realtyp); - OPT_EnterTyp((CHAR*)"INTEGER", 4, OPM_IntSize, &OPT_inttyp); - OPT_EnterTyp((CHAR*)"LONGINT", 4, OPM_LIntSize, &OPT_linttyp); OPT_EnterTyp((CHAR*)"LONGREAL", 6, OPM_LRealSize, &OPT_lrltyp); - OPT_EnterTyp((CHAR*)"SHORTINT", 4, OPM_SIntSize, &OPT_sinttyp); + OPT_EnterTypeAlias((CHAR*)"SHORTINT", &OPT_sintobj); + OPT_EnterTypeAlias((CHAR*)"INTEGER", &OPT_intobj); + OPT_EnterTypeAlias((CHAR*)"LONGINT", &OPT_lintobj); OPT_EnterBoolConst((CHAR*)"FALSE", 0); OPT_EnterBoolConst((CHAR*)"TRUE", 1); OPT_EnterProc((CHAR*)"HALT", 0); @@ -1912,7 +1956,7 @@ export void *OPT__init(void) OPT_impCtxt.ref[1] = OPT_bytetyp; OPT_impCtxt.ref[2] = OPT_booltyp; OPT_impCtxt.ref[3] = OPT_chartyp; - OPT_impCtxt.ref[4] = OPT_inttyp; + OPT_impCtxt.ref[4] = OPT_int32typ; OPT_impCtxt.ref[5] = OPT_realtyp; OPT_impCtxt.ref[6] = OPT_lrltyp; OPT_impCtxt.ref[7] = OPT_settyp; @@ -1920,12 +1964,5 @@ export void *OPT__init(void) OPT_impCtxt.ref[9] = OPT_niltyp; OPT_impCtxt.ref[10] = OPT_notyp; OPT_impCtxt.ref[11] = OPT_sysptrtyp; - OPT_IntTypes[1] = OPT_sinttyp; - OPT_IntTypes[2] = OPT_inttyp; - OPT_IntTypes[3] = OPT_linttyp; - OPT_IntTypes[5] = OPT_int8typ; - OPT_IntTypes[6] = OPT_int16typ; - OPT_IntTypes[7] = OPT_int32typ; - OPT_IntTypes[8] = OPT_int64typ; __ENDMOD; } diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index dff6a509..d4b49da8 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h @@ -68,6 +68,7 @@ typedef import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +import OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj; import int8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index b34d16d0..a32351aa 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -258,6 +258,9 @@ static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exporte void OPV_AdrAndSize (OPT_Object topScope) { + __ASSERT(OPT_sinttyp != NIL, 0); + __ASSERT(OPT_inttyp != NIL, 0); + __ASSERT(OPT_linttyp != NIL, 0); OPM_errpos = topScope->adr; topScope->leaf = 1; OPV_Traverse(topScope->right, topScope, 1); @@ -265,15 +268,12 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_chartyp->strobj->linkadr = 2; OPT_settyp->strobj->linkadr = 2; OPT_realtyp->strobj->linkadr = 2; - OPT_inttyp->strobj->linkadr = 2; - OPT_linttyp->strobj->linkadr = 2; OPT_adrtyp->strobj->linkadr = 2; OPT_int8typ->strobj->linkadr = 2; OPT_int16typ->strobj->linkadr = 2; OPT_int32typ->strobj->linkadr = 2; OPT_int64typ->strobj->linkadr = 2; OPT_lrltyp->strobj->linkadr = 2; - OPT_sinttyp->strobj->linkadr = 2; OPT_booltyp->strobj->linkadr = 2; OPT_bytetyp->strobj->linkadr = 2; OPT_sysptrtyp->strobj->linkadr = 2; diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index 0716a62f..937f0ba6 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index afc6f96c..614e2cb6 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index 2d3185ce..cfea54a7 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 30d7462f..8b263757 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index 034d0e43..6ff22ad6 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index a4ed943e..8758a988 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index 226b6aeb..36e01e6c 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index 660559f5..e14d923b 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index 5ac796d7..45ca0bb5 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/Vishap.c b/bootstrap/windows-48/Vishap.c index 93bbfaf4..1f322c5e 100644 --- a/bootstrap/windows-48/Vishap.c +++ b/bootstrap/windows-48/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkamSf */ #define INTEGER int16 #define LONGINT int32 @@ -84,12 +84,20 @@ static void Vishap_PropagateElementaryTypeSizes (void) OPT_chartyp->size = OPM_CharSize; OPT_settyp->size = OPM_SetSize; OPT_realtyp->size = OPM_RealSize; - OPT_inttyp->size = OPM_IntSize; - OPT_linttyp->size = OPM_LIntSize; OPT_adrtyp->size = OPM_PointerSize; OPT_lrltyp->size = OPM_LRealSize; - OPT_sinttyp->size = OPM_SIntSize; OPT_booltyp->size = OPM_BoolSize; + OPT_sinttyp = OPT_int8typ; + if (OPM_IntSize == 2) { + OPT_inttyp = OPT_int16typ; + OPT_linttyp = OPT_int32typ; + } else { + OPT_inttyp = OPT_int32typ; + OPT_linttyp = OPT_int64typ; + } + OPT_sintobj->typ = OPT_sinttyp; + OPT_intobj->typ = OPT_inttyp; + OPT_lintobj->typ = OPT_linttyp; } void Vishap_Translate (void) diff --git a/bootstrap/windows-48/errors.c b/bootstrap/windows-48/errors.c index 330d0f79..689e3cdd 100644 --- a/bootstrap/windows-48/errors.c +++ b/bootstrap/windows-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/errors.h b/bootstrap/windows-48/errors.h index f916c173..f5c1a708 100644 --- a/bootstrap/windows-48/errors.h +++ b/bootstrap/windows-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index a0370292..c2339121 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index 04a7b8d6..6815aacb 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/vt100.c b/bootstrap/windows-48/vt100.c index 7e16410c..341502ec 100644 --- a/bootstrap/windows-48/vt100.c +++ b/bootstrap/windows-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/vt100.h b/bootstrap/windows-48/vt100.h index c1c3c8fa..f7615911 100644 --- a/bootstrap/windows-48/vt100.h +++ b/bootstrap/windows-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index e936fb1b..ec75a6df 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/15] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/18] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index 9276e796..e5d79317 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Console.c b/bootstrap/windows-88/Console.c index ef385b37..32408370 100644 --- a/bootstrap/windows-88/Console.c +++ b/bootstrap/windows-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Console.h b/bootstrap/windows-88/Console.h index 288d9e0a..23f894db 100644 --- a/bootstrap/windows-88/Console.h +++ b/bootstrap/windows-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 6b890417..c2097ffb 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index ab570a35..c98b006a 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index fa10e8c0..c99a229c 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tskSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index ecebdfeb..f9b4a041 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 66df0a5c..662b84f9 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index 86580ab4..9f3d713d 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index 5a6a8dda..2f005fc6 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index 94ff6cbf..185aa968 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index a4e6388c..689dfff4 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index 185ac689..bf22de26 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 6b30d07b..23017356 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index 9c71f996..7472bed7 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index dce9eaec..63191e02 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index e578b0bd..22557b29 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index 61d3ad08..7caa7493 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index eef23e1f..6d67036e 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index d9b211df..b588c3f1 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -89,11 +89,11 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +export OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj; export int8 OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; export BOOLEAN OPT_SYSimported; -static OPT_Struct OPT_IntTypes[20]; static OPT_Object OPT_universe, OPT_syslink; static OPT_ImpCtxt OPT_impCtxt; static OPT_ExpCtxt OPT_expCtxt; @@ -113,6 +113,7 @@ static void OPT_DebugStruct (OPT_Struct btyp); static void OPT_EnterBoolConst (OPS_Name name, int64 value); static void OPT_EnterProc (OPS_Name name, int32 num); static void OPT_EnterTyp (OPS_Name name, int8 form, int32 size, OPT_Struct *res); +static void OPT_EnterTypeAlias (OPS_Name name, OPT_Object *res); export void OPT_Export (BOOLEAN *ext, BOOLEAN *new); export void OPT_FPrintErr (OPT_Object obj, int32 errcode); static void OPT_FPrintName (int64 *fp, CHAR *name, LONGINT name__len); @@ -165,16 +166,20 @@ static void OPT_err (int32 n) OPT_Struct OPT_IntType (int64 size) { OPT_Struct _o_result; - int32 i; - i = 1; - 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; + if (size <= OPT_int8typ->size) { + _o_result = OPT_int8typ; + return _o_result; } - __RETCHK; + if (size <= OPT_int16typ->size) { + _o_result = OPT_int16typ; + return _o_result; + } + if (size <= OPT_int32typ->size) { + _o_result = OPT_int32typ; + return _o_result; + } + _o_result = OPT_int64typ; + return _o_result; } OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int32 dir) @@ -182,15 +187,40 @@ OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int32 dir) OPT_Struct _o_result; int32 i; __ASSERT(x->form == 4, 0); - __ASSERT(dir == 1 || dir == -1, 0); __ASSERT(x->BaseTyp == OPT_undftyp, 0); - i = 0; - while ((OPT_IntTypes[__X(i, 20)] != x && i < 20)) { - i += 1; + __ASSERT(dir == 1 || dir == -1, 0); + if (dir > 0) { + if (x->size < OPT_sinttyp->size) { + _o_result = OPT_sinttyp; + return _o_result; + } + if (x->size < OPT_inttyp->size) { + _o_result = OPT_inttyp; + return _o_result; + } + if (x->size < OPT_linttyp->size) { + _o_result = OPT_linttyp; + return _o_result; + } + _o_result = OPT_int64typ; + return _o_result; + } else { + if (x->size > OPT_linttyp->size) { + _o_result = OPT_linttyp; + return _o_result; + } + if (x->size > OPT_inttyp->size) { + _o_result = OPT_inttyp; + return _o_result; + } + if (x->size > OPT_sinttyp->size) { + _o_result = OPT_sinttyp; + return _o_result; + } + _o_result = OPT_int8typ; + return _o_result; } - __ASSERT(i < 19, 0); - _o_result = OPT_IntTypes[__X(i + dir, 20)]; - return _o_result; + __RETCHK; } OPT_Const OPT_NewConst (void) @@ -505,21 +535,21 @@ void OPT_IdFPrint (OPT_Struct typ) } } -static struct FPrintStr__12 { +static struct FPrintStr__13 { int64 *pbfp, *pvfp; - struct FPrintStr__12 *lnk; -} *FPrintStr__12_s; + struct FPrintStr__13 *lnk; +} *FPrintStr__13_s; -static void FPrintFlds__13 (OPT_Object fld, int64 adr, BOOLEAN visible); -static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, int64 adr); -static void FPrintTProcs__17 (OPT_Object obj); +static void FPrintFlds__14 (OPT_Object fld, int64 adr, BOOLEAN visible); +static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, int64 adr); +static void FPrintTProcs__18 (OPT_Object obj); -static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, int64 adr) +static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, int64 adr) { int64 i, j, n; OPT_Struct btyp = NIL; if (typ->comp == 4) { - FPrintFlds__13(typ->link, adr, 0); + FPrintFlds__14(typ->link, adr, 0); } else if (typ->comp == 2) { btyp = typ->BaseTyp; n = typ->n; @@ -529,53 +559,53 @@ static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, int64 adr) } if (btyp->form == 11 || btyp->comp == 4) { j = OPT_nofhdfld; - FPrintHdFld__15(btyp, fld, adr); + FPrintHdFld__16(btyp, fld, adr); if (j != OPT_nofhdfld) { i = 1; while ((i < n && OPT_nofhdfld <= 2048)) { adr += btyp->size; - FPrintHdFld__15(btyp, fld, adr); + FPrintHdFld__16(btyp, fld, adr); i += 1; } } } } else if (typ->form == 11 || __STRCMP(fld->name, "@ptr") == 0) { - OPM_FPrint(&*FPrintStr__12_s->pvfp, 11); - OPM_FPrint(&*FPrintStr__12_s->pvfp, adr); + OPM_FPrint(&*FPrintStr__13_s->pvfp, 11); + OPM_FPrint(&*FPrintStr__13_s->pvfp, adr); OPT_nofhdfld += 1; } } -static void FPrintFlds__13 (OPT_Object fld, int64 adr, BOOLEAN visible) +static void FPrintFlds__14 (OPT_Object fld, int64 adr, BOOLEAN visible) { while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { - OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->vis); - OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)fld->name, 256); - OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->adr); + OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->vis); + OPT_FPrintName(&*FPrintStr__13_s->pbfp, (void*)fld->name, 256); + OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->adr); OPT_FPrintStr(fld->typ); - OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->typ->pbfp); - OPM_FPrint(&*FPrintStr__12_s->pvfp, fld->typ->pvfp); + OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->typ->pbfp); + OPM_FPrint(&*FPrintStr__13_s->pvfp, fld->typ->pvfp); } else { - FPrintHdFld__15(fld->typ, fld, fld->adr + adr); + FPrintHdFld__16(fld->typ, fld, fld->adr + adr); } fld = fld->link; } } -static void FPrintTProcs__17 (OPT_Object obj) +static void FPrintTProcs__18 (OPT_Object obj) { if (obj != NIL) { - FPrintTProcs__17(obj->left); + FPrintTProcs__18(obj->left); if (obj->mode == 13) { if (obj->vis != 0) { - OPM_FPrint(&*FPrintStr__12_s->pbfp, 13); - OPM_FPrint(&*FPrintStr__12_s->pbfp, __ASHR(obj->adr, 16)); - OPT_FPrintSign(&*FPrintStr__12_s->pbfp, obj->typ, obj->link); - OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)obj->name, 256); + OPM_FPrint(&*FPrintStr__13_s->pbfp, 13); + OPM_FPrint(&*FPrintStr__13_s->pbfp, __ASHR(obj->adr, 16)); + OPT_FPrintSign(&*FPrintStr__13_s->pbfp, obj->typ, obj->link); + OPT_FPrintName(&*FPrintStr__13_s->pbfp, (void*)obj->name, 256); } } - FPrintTProcs__17(obj->right); + FPrintTProcs__18(obj->right); } } @@ -585,11 +615,11 @@ void OPT_FPrintStr (OPT_Struct typ) OPT_Struct btyp = NIL; OPT_Object strobj = NIL, bstrobj = NIL; int64 pbfp, pvfp; - struct FPrintStr__12 _s; + struct FPrintStr__13 _s; _s.pbfp = &pbfp; _s.pvfp = &pvfp; - _s.lnk = FPrintStr__12_s; - FPrintStr__12_s = &_s; + _s.lnk = FPrintStr__13_s; + FPrintStr__13_s = &_s; if (!typ->fpdone) { OPT_IdFPrint(typ); pbfp = typ->idfp; @@ -626,11 +656,11 @@ void OPT_FPrintStr (OPT_Struct typ) OPM_FPrint(&pvfp, typ->align); OPM_FPrint(&pvfp, typ->n); OPT_nofhdfld = 0; - FPrintFlds__13(typ->link, 0, 1); + FPrintFlds__14(typ->link, 0, 1); if (OPT_nofhdfld > 2048) { OPM_Mark(225, typ->txtpos); } - FPrintTProcs__17(typ->link); + FPrintTProcs__18(typ->link); OPM_FPrint(&pvfp, pbfp); strobj = typ->strobj; if (strobj == NIL || strobj->name[0] == 0x00) { @@ -640,7 +670,7 @@ void OPT_FPrintStr (OPT_Struct typ) typ->pbfp = pbfp; typ->pvfp = pvfp; } - FPrintStr__12_s = _s.lnk; + FPrintStr__13_s = _s.lnk; } void OPT_FPrintObj (OPT_Object obj) @@ -1754,6 +1784,18 @@ static void OPT_EnterTyp (OPS_Name name, int8 form, int32 size, OPT_Struct *res) *res = typ; } +static void OPT_EnterTypeAlias (OPS_Name name, OPT_Object *res) +{ + OPT_Object obj = NIL; + OPS_Name name__copy; + __DUPARR(name, OPS_Name); + OPT_Insert(name, &obj); + obj->mode = 5; + obj->typ = NIL; + obj->vis = 1; + *res = obj; +} + static void OPT_EnterProc (OPS_Name name, int32 num) { OPT_Object obj = NIL; @@ -1787,8 +1829,10 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_niltyp); P(OPT_notyp); P(OPT_sysptrtyp); + P(OPT_sintobj); + P(OPT_intobj); + P(OPT_lintobj); __ENUMP(OPT_GlbMod, 64, P); - __ENUMP(OPT_IntTypes, 20, P); P(OPT_universe); P(OPT_syslink); __ENUMR(&OPT_impCtxt, OPT_ImpCtxt__typ, 6216, 1, P); @@ -1881,10 +1925,10 @@ export void *OPT__init(void) OPT_EnterTyp((CHAR*)"CHAR", 3, OPM_CharSize, &OPT_chartyp); OPT_EnterTyp((CHAR*)"SET", 7, OPM_SetSize, &OPT_settyp); OPT_EnterTyp((CHAR*)"REAL", 5, OPM_RealSize, &OPT_realtyp); - OPT_EnterTyp((CHAR*)"INTEGER", 4, OPM_IntSize, &OPT_inttyp); - OPT_EnterTyp((CHAR*)"LONGINT", 4, OPM_LIntSize, &OPT_linttyp); OPT_EnterTyp((CHAR*)"LONGREAL", 6, OPM_LRealSize, &OPT_lrltyp); - OPT_EnterTyp((CHAR*)"SHORTINT", 4, OPM_SIntSize, &OPT_sinttyp); + OPT_EnterTypeAlias((CHAR*)"SHORTINT", &OPT_sintobj); + OPT_EnterTypeAlias((CHAR*)"INTEGER", &OPT_intobj); + OPT_EnterTypeAlias((CHAR*)"LONGINT", &OPT_lintobj); OPT_EnterBoolConst((CHAR*)"FALSE", 0); OPT_EnterBoolConst((CHAR*)"TRUE", 1); OPT_EnterProc((CHAR*)"HALT", 0); @@ -1912,7 +1956,7 @@ export void *OPT__init(void) OPT_impCtxt.ref[1] = OPT_bytetyp; OPT_impCtxt.ref[2] = OPT_booltyp; OPT_impCtxt.ref[3] = OPT_chartyp; - OPT_impCtxt.ref[4] = OPT_inttyp; + OPT_impCtxt.ref[4] = OPT_int32typ; OPT_impCtxt.ref[5] = OPT_realtyp; OPT_impCtxt.ref[6] = OPT_lrltyp; OPT_impCtxt.ref[7] = OPT_settyp; @@ -1920,12 +1964,5 @@ export void *OPT__init(void) OPT_impCtxt.ref[9] = OPT_niltyp; OPT_impCtxt.ref[10] = OPT_notyp; OPT_impCtxt.ref[11] = OPT_sysptrtyp; - OPT_IntTypes[1] = OPT_sinttyp; - OPT_IntTypes[2] = OPT_inttyp; - OPT_IntTypes[3] = OPT_linttyp; - OPT_IntTypes[5] = OPT_int8typ; - OPT_IntTypes[6] = OPT_int16typ; - OPT_IntTypes[7] = OPT_int32typ; - OPT_IntTypes[8] = OPT_int64typ; __ENDMOD; } diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 7b529043..504e70b7 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h @@ -68,6 +68,7 @@ typedef import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +import OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj; import int8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 023ee089..46abf128 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -258,6 +258,9 @@ static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exporte void OPV_AdrAndSize (OPT_Object topScope) { + __ASSERT(OPT_sinttyp != NIL, 0); + __ASSERT(OPT_inttyp != NIL, 0); + __ASSERT(OPT_linttyp != NIL, 0); OPM_errpos = topScope->adr; topScope->leaf = 1; OPV_Traverse(topScope->right, topScope, 1); @@ -265,15 +268,12 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_chartyp->strobj->linkadr = 2; OPT_settyp->strobj->linkadr = 2; OPT_realtyp->strobj->linkadr = 2; - OPT_inttyp->strobj->linkadr = 2; - OPT_linttyp->strobj->linkadr = 2; OPT_adrtyp->strobj->linkadr = 2; OPT_int8typ->strobj->linkadr = 2; OPT_int16typ->strobj->linkadr = 2; OPT_int32typ->strobj->linkadr = 2; OPT_int64typ->strobj->linkadr = 2; OPT_lrltyp->strobj->linkadr = 2; - OPT_sinttyp->strobj->linkadr = 2; OPT_booltyp->strobj->linkadr = 2; OPT_bytetyp->strobj->linkadr = 2; OPT_sysptrtyp->strobj->linkadr = 2; diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index 0716a62f..937f0ba6 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index a8579af5..5af3b5f2 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index a016f061..a94b93a8 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index b4890fa9..08445989 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index 37f91340..44e13bae 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index 4f6767e1..ad3ef185 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index 235891d2..23e3adb8 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index 7a6726a6..5a607fdd 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index ea9dde4b..f18817ff 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/Vishap.c b/bootstrap/windows-88/Vishap.c index fef94478..1bc7e5ed 100644 --- a/bootstrap/windows-88/Vishap.c +++ b/bootstrap/windows-88/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkamSf */ #define INTEGER int32 #define LONGINT int64 @@ -84,12 +84,20 @@ static void Vishap_PropagateElementaryTypeSizes (void) OPT_chartyp->size = OPM_CharSize; OPT_settyp->size = OPM_SetSize; OPT_realtyp->size = OPM_RealSize; - OPT_inttyp->size = OPM_IntSize; - OPT_linttyp->size = OPM_LIntSize; OPT_adrtyp->size = OPM_PointerSize; OPT_lrltyp->size = OPM_LRealSize; - OPT_sinttyp->size = OPM_SIntSize; OPT_booltyp->size = OPM_BoolSize; + OPT_sinttyp = OPT_int8typ; + if (OPM_IntSize == 2) { + OPT_inttyp = OPT_int16typ; + OPT_linttyp = OPT_int32typ; + } else { + OPT_inttyp = OPT_int32typ; + OPT_linttyp = OPT_int64typ; + } + OPT_sintobj->typ = OPT_sinttyp; + OPT_intobj->typ = OPT_inttyp; + OPT_lintobj->typ = OPT_linttyp; } void Vishap_Translate (void) diff --git a/bootstrap/windows-88/errors.c b/bootstrap/windows-88/errors.c index 88cb5688..8d3792df 100644 --- a/bootstrap/windows-88/errors.c +++ b/bootstrap/windows-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/errors.h b/bootstrap/windows-88/errors.h index f916c173..f5c1a708 100644 --- a/bootstrap/windows-88/errors.h +++ b/bootstrap/windows-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index 08e242e0..d7c28163 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index 04a7b8d6..6815aacb 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/vt100.c b/bootstrap/windows-88/vt100.c index 96358c5b..a575d688 100644 --- a/bootstrap/windows-88/vt100.c +++ b/bootstrap/windows-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/vt100.h b/bootstrap/windows-88/vt100.h index b9c5430c..f0786605 100644 --- a/bootstrap/windows-88/vt100.h +++ b/bootstrap/windows-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/src/compiler/OPT.Mod b/src/compiler/OPT.Mod index cd1eae8b..3f8e884e 100644 --- a/src/compiler/OPT.Mod +++ b/src/compiler/OPT.Mod @@ -160,18 +160,18 @@ VAR realtyp*, lrltyp*, settyp*, stringtyp*, niltyp*, notyp*, sysptrtyp*: Struct; + sintobj*, intobj*, lintobj*: Object; + nofGmod*: SHORTINT; (*nof imports*) GlbMod*: ARRAY maxImps OF Object; (* ^.right = first object, ^.name = module import name (not alias) *) SelfName*: OPS.Name; (* name of module being compiled *) SYSimported*: BOOLEAN; - IntTypes: ARRAY 20 OF Struct; (* Lists integer types in SHORT/LONG ordering *) + CONST - - (* Symbol file items *) Smname* = 16; Send* = 18; Stype* = 19; Salias* = 20; Svar* = 21; Srvar* = 22; Svalpar* = 23; Svarpar* = 24; Sfld* = 25; Srfld* = 26; @@ -209,34 +209,36 @@ VAR -PROCEDURE err(n: INTEGER); -BEGIN OPM.err(n) -END err; +PROCEDURE err(n: INTEGER); BEGIN OPM.err(n) END err; + + PROCEDURE IntType*(size: LONGINT): Struct; (* Selects smallest standard integer type for given size in bytes *) - VAR i: INTEGER; BEGIN - 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; + IF size <= int8typ.size THEN RETURN int8typ END; + IF size <= int16typ.size THEN RETURN int16typ END; + IF size <= int32typ.size THEN RETURN int32typ END; + RETURN int64typ END IntType; PROCEDURE ShorterOrLongerType*(x: Struct; dir: INTEGER): Struct; VAR i: INTEGER; BEGIN ASSERT(x.form = Int); - ASSERT((dir = 1) OR (dir = -1)); - (* Not sure if StPar0 (which calls this) always gets the baseiest type. This - ASSERT will tell me. *) ASSERT(x.BaseTyp = undftyp); - (* - WHILE x.BaseTyp # undftyp DO ASSERT(x # x.BaseTyp); ASSERT(x.BaseTyp # NIL); x := x.BaseTyp END; - *) - i := 0; WHILE (IntTypes[i] # x) & (i < LEN(IntTypes)) DO INC(i) END; - ASSERT(i < LEN(IntTypes)-1); - RETURN IntTypes[i+dir] + ASSERT((dir = 1) OR (dir = -1)); + IF dir > 0 THEN + IF x.size < sinttyp.size THEN RETURN sinttyp END; + IF x.size < inttyp.size THEN RETURN inttyp END; + IF x.size < linttyp.size THEN RETURN linttyp END; + RETURN int64typ + ELSE + IF x.size > linttyp.size THEN RETURN linttyp END; + IF x.size > inttyp.size THEN RETURN inttyp END; + IF x.size > sinttyp.size THEN RETURN sinttyp END; + RETURN int8typ + END END ShorterOrLongerType; @@ -1175,12 +1177,21 @@ END Import; typ^.idfp := form; typ^.idfpdone := TRUE; res := typ END EnterTyp; + PROCEDURE EnterTypeAlias(name: OPS.Name; VAR res: Object); + VAR obj: Object; + BEGIN + Insert(name, obj); obj^.mode := Typ; obj^.typ := NIL; obj^.vis := external; + res := obj + END EnterTypeAlias; + PROCEDURE EnterProc(name: OPS.Name; num: INTEGER); VAR obj: Object; BEGIN Insert(name, obj); obj^.mode := SProc; obj^.typ := notyp; obj^.adr := num END EnterProc; + + BEGIN topScope := NIL; OpenScope(0, NIL); OPM.errpos := 0; InitStruct(undftyp, Undef); undftyp^.BaseTyp := undftyp; InitStruct(notyp, NoTyp); @@ -1195,6 +1206,7 @@ BEGIN topScope := NIL; OpenScope(0, NIL); OPM.errpos := 0; EnterTyp("INT16", Int, 2, int16typ); EnterTyp("INT32", Int, 4, int32typ); EnterTyp("INT64", Int, 8, int64typ); + EnterProc("ADR", adrfn); EnterProc("CC", ccfn); EnterProc("LSH", lshfn); @@ -1207,17 +1219,20 @@ BEGIN topScope := NIL; OpenScope(0, NIL); OPM.errpos := 0; EnterProc("VAL", valfn); EnterProc("NEW", sysnewfn); EnterProc("MOVE", movefn); + syslink := topScope^.right; universe := topScope; topScope^.right := NIL; + EnterTyp("BOOLEAN", Bool, OPM.BoolSize, booltyp); EnterTyp("CHAR", Char, OPM.CharSize, chartyp); EnterTyp("SET", Set, OPM.SetSize, settyp); EnterTyp("REAL", Real, OPM.RealSize, realtyp); - EnterTyp("INTEGER", Int, OPM.IntSize, inttyp); - EnterTyp("LONGINT", Int, OPM.LIntSize, linttyp); EnterTyp("LONGREAL", LReal, OPM.LRealSize, lrltyp); - EnterTyp("SHORTINT", Int, OPM.SIntSize, sinttyp); + + EnterTypeAlias("SHORTINT", sintobj); + EnterTypeAlias("INTEGER", intobj); + EnterTypeAlias("LONGINT", lintobj); EnterBoolConst("FALSE", 0); (* 0 and 1 are compiler internal representation only *) EnterBoolConst("TRUE", 1); @@ -1248,7 +1263,7 @@ BEGIN topScope := NIL; OpenScope(0, NIL); OPM.errpos := 0; impCtxt.ref[Byte] := bytetyp; impCtxt.ref[Bool] := booltyp; impCtxt.ref[Char] := chartyp; - impCtxt.ref[Int] := inttyp; + impCtxt.ref[Int] := int32typ; impCtxt.ref[Real] := realtyp; impCtxt.ref[LReal] := lrltyp; impCtxt.ref[Set] := settyp; @@ -1257,15 +1272,6 @@ BEGIN topScope := NIL; OpenScope(0, NIL); OPM.errpos := 0; impCtxt.ref[NoTyp] := notyp; impCtxt.ref[Pointer] := sysptrtyp; - IntTypes[1] := sinttyp; - IntTypes[2] := inttyp; - IntTypes[3] := linttyp; - - IntTypes[5] := int8typ; - IntTypes[6] := int16typ; - IntTypes[7] := int32typ; - IntTypes[8] := int64typ - END OPT. Objects: diff --git a/src/compiler/OPV.Mod b/src/compiler/OPV.Mod index f4a82ca5..fa20523b 100644 --- a/src/compiler/OPV.Mod +++ b/src/compiler/OPV.Mod @@ -181,6 +181,8 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 PROCEDURE AdrAndSize* (topScope: OPT.Object); BEGIN + ASSERT(OPT.sinttyp # NIL); ASSERT(OPT.inttyp # NIL); ASSERT(OPT.linttyp # NIL); + OPM.errpos := topScope^.adr; (* text position of scope used if error *) topScope^.leaf := TRUE; Traverse(topScope^.right, topScope, TRUE); (* first pass only on exported types and procedures *) @@ -189,15 +191,18 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 OPT.chartyp^.strobj^.linkadr := PredefinedType; OPT.settyp^.strobj^.linkadr := PredefinedType; OPT.realtyp^.strobj^.linkadr := PredefinedType; + + (* SHORTINT, INTEGER and LONGINT are alternate names for INT8, INT16, INT32 and INT64 and have not been set up yet. + OPT.sinttyp^.strobj^.linkadr := PredefinedType; OPT.inttyp^.strobj^.linkadr := PredefinedType; OPT.linttyp^.strobj^.linkadr := PredefinedType; + *) OPT.adrtyp^.strobj^.linkadr := PredefinedType; OPT.int8typ^.strobj^.linkadr := PredefinedType; OPT.int16typ^.strobj^.linkadr := PredefinedType; OPT.int32typ^.strobj^.linkadr := PredefinedType; OPT.int64typ^.strobj^.linkadr := PredefinedType; OPT.lrltyp^.strobj^.linkadr := PredefinedType; - OPT.sinttyp^.strobj^.linkadr := PredefinedType; OPT.booltyp^.strobj^.linkadr := PredefinedType; OPT.bytetyp^.strobj^.linkadr := PredefinedType; OPT.sysptrtyp^.strobj^.linkadr := PredefinedType; diff --git a/src/compiler/Vishap.Mod b/src/compiler/Vishap.Mod index 3323883d..33481260 100644 --- a/src/compiler/Vishap.Mod +++ b/src/compiler/Vishap.Mod @@ -56,12 +56,21 @@ MODULE Vishap; (* J. Templ 3.2.95 *) OPT.chartyp.size := OPM.CharSize; OPT.settyp.size := OPM.SetSize; OPT.realtyp.size := OPM.RealSize; - OPT.inttyp.size := OPM.IntSize; - OPT.linttyp.size := OPM.LIntSize; OPT.adrtyp.size := OPM.PointerSize; OPT.lrltyp.size := OPM.LRealSize; - OPT.sinttyp.size := OPM.SIntSize; - OPT.booltyp.size := OPM.BoolSize + OPT.booltyp.size := OPM.BoolSize; + + OPT.sinttyp := OPT.int8typ; + IF OPM.IntSize = 2 THEN + OPT.inttyp := OPT.int16typ; + OPT.linttyp := OPT.int32typ + ELSE + OPT.inttyp := OPT.int32typ; + OPT.linttyp := OPT.int64typ + END; + OPT.sintobj.typ := OPT.sinttyp; + OPT.intobj.typ := OPT.inttyp; + OPT.lintobj.typ := OPT.linttyp END PropagateElementaryTypeSizes; From 210870f968fccfb8bfd5a9a4f059c2cf8b22f26a Mon Sep 17 00:00:00 2001 From: David Brown Date: Sun, 18 Sep 2016 11:06:16 +0100 Subject: [PATCH 235/580] Use SYSTEM.INT64 for literal and related values. --- src/compiler/OPB.Mod | 45 +++++++++++----------- src/compiler/OPC.Mod | 8 ++-- src/compiler/OPM.cmdln.Mod | 46 ++++++++++++++--------- src/compiler/OPP.Mod | 16 ++++---- src/compiler/OPS.Mod | 2 +- src/compiler/OPT.Mod | 76 ++++++++++++++++++++------------------ src/compiler/OPV.Mod | 19 ++++++---- src/compiler/Vishap.Mod | 17 +++++++-- src/system/Console.Mod | 5 ++- src/system/Files.Mod | 18 +++++++++ 10 files changed, 150 insertions(+), 102 deletions(-) diff --git a/src/compiler/OPB.Mod b/src/compiler/OPB.Mod index ee6dc10a..09805f14 100644 --- a/src/compiler/OPB.Mod +++ b/src/compiler/OPB.Mod @@ -10,8 +10,8 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) VAR typSize*: PROCEDURE(typ: OPT.Struct); - exp: INTEGER; (*side effect of log*) - maxExp: LONGINT; (* max n in ASH(1, n) on this machine *) + exp: INTEGER; (* side effect of log*) + maxExp: SYSTEM.INT64; (* max n in ASH(1, n) on this machine *) PROCEDURE err(n: INTEGER); @@ -57,9 +57,8 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) IF b THEN RETURN 1 ELSE RETURN 0 END END BoolToInt; - PROCEDURE IntToBool(i: LONGINT): BOOLEAN; - BEGIN - IF i = 0 THEN RETURN FALSE ELSE RETURN TRUE END + PROCEDURE IntToBool(i: SYSTEM.INT64): BOOLEAN; + BEGIN RETURN i # 0 END IntToBool; PROCEDURE NewBoolConst*(boolval: BOOLEAN): OPT.Node; @@ -106,7 +105,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) END EmptySet; PROCEDURE SetIntType(node: OPT.Node); - VAR b: INTEGER; n: LONGINT; + VAR b: INTEGER; n: SYSTEM.INT64; BEGIN (* Determine number of bytes required to represent constant value *) IF node.conval.intval >= 0 THEN n := node.conval.intval ELSE n := -(node.conval.intval+1) END; @@ -114,7 +113,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) node.typ := OPT.IntType(b) END SetIntType; - PROCEDURE NewIntConst*(intval: LONGINT): OPT.Node; + PROCEDURE NewIntConst*(intval: SYSTEM.INT64): OPT.Node; VAR x: OPT.Node; BEGIN x := OPT.NewNode(OPT.Nconst); x^.conval := OPT.NewConst(); @@ -129,11 +128,11 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) RETURN x END NewRealConst; - PROCEDURE NewString*(VAR str: OPS.String; len: LONGINT): OPT.Node; + PROCEDURE NewString*(VAR str: OPS.String; len: SYSTEM.INT64): OPT.Node; VAR x: OPT.Node; BEGIN x := OPT.NewNode(OPT.Nconst); x^.conval := OPT.NewConst(); x^.typ := OPT.stringtyp; - x^.conval^.intval := OPM.ConstNotAlloc; x^.conval^.intval2 := len; + x^.conval^.intval := OPM.ConstNotAlloc; x^.conval^.intval2 := OPM.Longint(len); x^.conval^.ext := OPT.NewExt(); x^.conval^.ext^ := str; RETURN x END NewString; @@ -238,7 +237,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) END TypTest; PROCEDURE In*(VAR x: OPT.Node; y: OPT.Node); - VAR f: INTEGER; k: LONGINT; + VAR f: INTEGER; k: SYSTEM.INT64; BEGIN f := x^.typ^.form; IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) OR (y^.class = OPT.Ntype) OR (y^.class = OPT.Nproc) THEN err(126) ELSIF (f = OPT.Int) & (y^.typ^.form = OPT.Set) THEN @@ -255,7 +254,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) x^.typ := OPT.booltyp END In; - PROCEDURE log(x: LONGINT): LONGINT; + PROCEDURE log(x: SYSTEM.INT64): SYSTEM.INT64; BEGIN exp := 0; IF x > 0 THEN WHILE ~ODD(x) DO x := x DIV 2; INC(exp) END @@ -302,7 +301,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) |OPS.minus: IF f IN {OPT.Int, OPT.Set} + OPT.realSet THEN IF z^.class = OPT.Nconst THEN IF f = OPT.Int THEN - IF z^.conval^.intval = MIN(LONGINT) THEN err(203) + IF z^.conval^.intval = MIN(SYSTEM.INT64) THEN err(203) ELSE z^.conval^.intval := -z^.conval^.intval; SetIntType(z) END ELSIF f IN OPT.realSet THEN z^.conval^.realval := -z^.conval^.realval @@ -316,7 +315,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) |OPT.abs: IF f IN {OPT.Int} + OPT.realSet THEN IF z^.class = OPT.Nconst THEN IF f = OPT.Int THEN - IF z^.conval^.intval = MIN(LONGINT) THEN err(203) + IF z^.conval^.intval = MIN(SYSTEM.INT64) THEN err(203) ELSE z^.conval^.intval := ABS(z^.conval^.intval); SetIntType(z) END ELSE z^.conval^.realval := ABS(z^.conval^.realval) @@ -416,7 +415,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) END CheckProc; PROCEDURE ConstOp(op: INTEGER; x, y: OPT.Node); - VAR f, g: INTEGER; xval, yval: OPT.Const; xv, yv: LONGINT; + VAR f, g: INTEGER; xval, yval: OPT.Const; xv, yv: SYSTEM.INT64; temp: BOOLEAN; (* temp avoids err 215 *) PROCEDURE ConstCmp(): INTEGER; @@ -597,7 +596,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) END ConstOp; PROCEDURE Convert(VAR x: OPT.Node; typ: OPT.Struct); (* Convert node x to new type typ *) - VAR node: OPT.Node; f, g: INTEGER; k: LONGINT; r: LONGREAL; + VAR node: OPT.Node; f, g: INTEGER; k: SYSTEM.INT64; r: LONGREAL; BEGIN f := x^.typ^.form; g := typ^.form; (* f: old form, g: new form *) IF x^.class = OPT.Nconst THEN IF f = OPT.Int THEN @@ -628,7 +627,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) END Convert; PROCEDURE Op*(op: SHORTINT; VAR x: OPT.Node; y: OPT.Node); - VAR f, g: INTEGER; t, z: OPT.Node; typ: OPT.Struct; do: BOOLEAN; val: LONGINT; + VAR f, g: INTEGER; t, z: OPT.Node; typ: OPT.Struct; do: BOOLEAN; val: SYSTEM.INT64; PROCEDURE NewOp(op: SHORTINT; typ: OPT.Struct; VAR x: OPT.Node; y: OPT.Node); VAR node: OPT.Node; @@ -788,7 +787,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) END Op; PROCEDURE SetRange*(VAR x: OPT.Node; y: OPT.Node); - VAR k, l: LONGINT; + VAR k, l: SYSTEM.INT64; BEGIN IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) OR (y^.class = OPT.Ntype) OR (y^.class = OPT.Nproc) THEN err(126) ELSIF (x^.typ^.form = OPT.Int) & (y^.typ^.form = OPT.Int) THEN @@ -814,7 +813,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) END SetRange; PROCEDURE SetElem*(VAR x: OPT.Node); - VAR k: LONGINT; + VAR k: SYSTEM.INT64; BEGIN IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) ELSIF x^.typ^.form # OPT.Int THEN err(93) @@ -1034,7 +1033,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) |OPT.ashfn: (*ASH*) IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) ELSIF f = OPT.Int THEN - IF x.typ.size # OPT.linttyp.size THEN Convert(x, OPT.linttyp) END + IF x.typ.size < OPT.linttyp.size THEN Convert(x, OPT.linttyp) END ELSE err(111); x^.typ := OPT.linttyp END |OPT.adrfn: (*SYSTEM.ADR*) @@ -1124,7 +1123,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) |OPT.lenfn: (*LEN*) IF ~(f = OPT.Int) OR (x^.class # OPT.Nconst) THEN err(69) ELSIF x.typ.size = 1 THEN (* Hard limit of 127 dimensions *) - L := SHORT(x^.conval^.intval); typ := p^.typ; + L := OPM.Integer(x^.conval^.intval); typ := p^.typ; WHILE (L > 0) & (typ^.comp IN {OPT.DynArr, OPT.Array}) DO typ := typ^.BaseTyp; DEC(L) END ; IF (L # 0) OR ~(typ^.comp IN {OPT.DynArr, OPT.Array}) THEN err(132) ELSE x^.obj := NIL; @@ -1150,14 +1149,14 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) IF (p^.class = OPT.Nconst) & (x^.class = OPT.Nconst) THEN IF (-maxExp > x^.conval^.intval) OR (x^.conval^.intval > maxExp) THEN err(208); p^.conval^.intval := 1 ELSIF x^.conval^.intval >= 0 THEN - IF ABS(p^.conval^.intval) <= MAX(LONGINT) DIV ASH(1, x^.conval^.intval) THEN + IF ABS(p^.conval^.intval) <= MAX(SYSTEM.INT64) DIV ASH(1, x^.conval^.intval) THEN p^.conval^.intval := p^.conval^.intval * ASH(1, x^.conval^.intval) ELSE err(208); p^.conval^.intval := 1 END ELSE p^.conval^.intval := ASH(p^.conval^.intval, x^.conval^.intval) END ; p^.obj := NIL - ELSE p := NewOp(OPT.Ndop, OPT.ash, p, x); p^.typ := OPT.linttyp + ELSE p := NewOp(OPT.Ndop, OPT.ash, p, x); p^.typ := p.left.typ (* LONGINT, or INT64 if larger *) END ELSE err(111) END @@ -1482,5 +1481,5 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) END Inittd; BEGIN - maxExp := log(MAX(LONGINT) DIV 2 + 1); maxExp := exp + maxExp := log(MAX(SYSTEM.INT64) DIV 2 + 1); maxExp := exp END OPB. diff --git a/src/compiler/OPC.Mod b/src/compiler/OPC.Mod index c5b16ad0..9febea62 100644 --- a/src/compiler/OPC.Mod +++ b/src/compiler/OPC.Mod @@ -1218,7 +1218,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) END; END Cmp; - PROCEDURE CharacterLiteral(c: LONGINT); + PROCEDURE CharacterLiteral(c: SYSTEM.INT64); BEGIN IF (c < 32) OR (c > 126) THEN OPM.WriteString("0x"); OPM.WriteHex(c) @@ -1258,7 +1258,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) OPM.Write(DoubleQuote) END StringLiteral; - PROCEDURE Case*(caseVal: LONGINT; form: INTEGER); + PROCEDURE Case*(caseVal: SYSTEM.INT64; form: INTEGER); VAR ch: CHAR; BEGIN @@ -1286,7 +1286,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) Str1("__HALT(#)", n) END Halt; - PROCEDURE IntLiteral*(n, size: LONGINT); + PROCEDURE IntLiteral*(n: SYSTEM.INT64; size: LONGINT); BEGIN IF (size > OPM.CIntSize) & (n <= OPM.CIntMax) & (n > OPM.CIntMin) THEN OPM.WriteString("((int"); OPM.WriteInt(size*8); OPM.WriteString(")("); @@ -1296,7 +1296,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) END END IntLiteral; - PROCEDURE Len* (obj: OPT.Object; array: OPT.Struct; dim: LONGINT); + PROCEDURE Len* (obj: OPT.Object; array: OPT.Struct; dim: SYSTEM.INT64); BEGIN IF array^.comp = OPT.DynArr THEN CompleteIdent(obj); OPM.WriteString(LenExt); diff --git a/src/compiler/OPM.cmdln.Mod b/src/compiler/OPM.cmdln.Mod index a7810f0c..b497829f 100644 --- a/src/compiler/OPM.cmdln.Mod +++ b/src/compiler/OPM.cmdln.Mod @@ -110,7 +110,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) ErrorLineStartPos, ErrorLineLimitPos, ErrorLineNumber: LONGINT; (* Limit = start of next line *) - lasterrpos: LONGINT; + lasterrpos: SYSTEM.INT64; inR: Texts.Reader; Log: Texts.Text; W: Texts.Writer; @@ -129,12 +129,17 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) (* ------------------------- Log Output ------------------------- *) - PROCEDURE LogW*(ch: CHAR); BEGIN Console.Char(ch) END LogW; - PROCEDURE LogWStr*(s: ARRAY OF CHAR); BEGIN Console.String(s) END LogWStr; - PROCEDURE LogWNum*(i, len: LONGINT); BEGIN Console.Int(i, len) END LogWNum; - PROCEDURE LogWLn*; BEGIN Console.Ln END LogWLn; + PROCEDURE LogW*(ch: CHAR); BEGIN Console.Char(ch) END LogW; + PROCEDURE LogWStr*(s: ARRAY OF CHAR); BEGIN Console.String(s) END LogWStr; + PROCEDURE LogWNum*(i, len: SYSTEM.INT64); BEGIN Console.Int(i, len) END LogWNum; + PROCEDURE LogWLn*; BEGIN Console.Ln END LogWLn; + + + PROCEDURE Longint* (n: SYSTEM.INT64): LONGINT; BEGIN RETURN SYSTEM.VAL(LONGINT, n) END Longint; + PROCEDURE Integer* (n: SYSTEM.INT64): INTEGER; BEGIN RETURN SYSTEM.VAL(INTEGER, n) END Integer; + (* ------------------------- parameter handling -------------------------*) PROCEDURE ScanOptions(VAR s: ARRAY OF CHAR; VAR opt: SET); @@ -354,7 +359,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) END LogErrMsg; - PROCEDURE FindLine(f: Files.File; VAR r: Files.Rider; pos: LONGINT); + PROCEDURE FindLine(f: Files.File; VAR r: Files.Rider; pos: SYSTEM.INT64); (* Updates ErrorLineStartPos, ErrorLineLimitPos, ErrorLineNumber to describe the line containing pos. Exits with the rider set to the start of the line conaining pos. *) @@ -386,7 +391,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) END FindLine; - PROCEDURE ShowLine(pos: LONGINT); + PROCEDURE ShowLine(pos: SYSTEM.INT64); VAR f: Files.File; r: Files.Rider; @@ -408,7 +413,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) LogWStr(" "); IF pos >= ErrorLineLimitPos THEN pos := ErrorLineLimitPos-1 END; - i := SHORT(pos - ErrorLineStartPos); + i := SHORT(Longint(pos - ErrorLineStartPos)); WHILE i > 0 DO LogW(" "); DEC(i) END; IF ~notColorOutput THEN vt100.SetAttr(vt100.Green) END; @@ -419,7 +424,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) END ShowLine; - PROCEDURE Mark*(n: INTEGER; pos: LONGINT); + PROCEDURE Mark*(n: INTEGER; pos: SYSTEM.INT64); BEGIN IF pos = -1 THEN pos := 0 END; IF n >= 0 THEN @@ -450,7 +455,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) END err; - PROCEDURE FPrint*(VAR fp: LONGINT; val: LONGINT); + PROCEDURE FPrint*(VAR fp: LONGINT; val: SYSTEM.INT64); BEGIN fp := SYSTEM.ROT(SYSTEM.VAL(LONGINT, SYSTEM.VAL(SET, fp) / SYSTEM.VAL(SET, val)), 1) END FPrint; @@ -612,6 +617,11 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) BEGIN Files.ReadNum(oldSF, k); RETURN k END SymRInt; + PROCEDURE SymRInt64*(): SYSTEM.INT64; + VAR k: SYSTEM.INT64; + BEGIN Files.ReadNum64(oldSF, k); RETURN k + END SymRInt64; + PROCEDURE SymRSet*(VAR s: SET); BEGIN Files.ReadNum(oldSF, SYSTEM.VAL(LONGINT, s)) END SymRSet; @@ -653,8 +663,8 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) BEGIN Files.Write(newSF, ch) END SymWCh; - PROCEDURE SymWInt*(i: LONGINT); - BEGIN Files.WriteNum(newSF, i) + PROCEDURE SymWInt*(i: SYSTEM.INT64); + BEGIN Files.WriteNum64(newSF, i) END SymWInt; PROCEDURE SymWSet*(s: SET); @@ -709,9 +719,9 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) Files.WriteBytes(R[currFile], s, i) END WriteStringVar; - PROCEDURE WriteHex* (i: LONGINT); + PROCEDURE WriteHex* (i: SYSTEM.INT64); VAR s: ARRAY 3 OF CHAR; - digit : INTEGER; + digit : SYSTEM.INT32; BEGIN digit := SHORT(i) DIV 16; IF digit < 10 THEN s[0] := CHR (ORD ("0") + digit); ELSE s[0] := CHR (ORD ("a") - 10 + digit ); END; @@ -721,10 +731,12 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) WriteString(s) END WriteHex; - PROCEDURE WriteInt* (i: LONGINT); - VAR s: ARRAY 20 OF CHAR; i1, k: LONGINT; + PROCEDURE WriteInt* (i: SYSTEM.INT64); + VAR s: ARRAY 24 OF CHAR; i1, k: SYSTEM.INT64; BEGIN - IF (i = SignedMinimum(IntSize)) OR (i = SignedMinimum(LIntSize)) THEN + IF (i = SignedMinimum(IntSize)) + OR (i = SignedMinimum(LIntSize)) + OR (i = SignedMinimum(8)) THEN (* abs(minint) is one more than maxint, causing problems representing the value as a minus sign followed by absoute value. Therefore represent as -maxint - 1. For INTEGER this avoids a compiler warning 'this decimal constant is unsigned only in ISO C90', for LONGINT it is the diff --git a/src/compiler/OPP.Mod b/src/compiler/OPP.Mod index 84966442..72b6701d 100644 --- a/src/compiler/OPP.Mod +++ b/src/compiler/OPP.Mod @@ -1,7 +1,7 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) IMPORT - OPB, OPT, OPS, OPM; + OPB, OPT, OPS, OPM, SYSTEM; TYPE CaseTable = ARRAY OPM.MaxCases OF @@ -69,7 +69,7 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) END CheckMark; PROCEDURE CheckSysFlag(VAR sysflag: INTEGER; default: INTEGER); - VAR x: OPT.Node; sf: LONGINT; + VAR x: OPT.Node; sf: SYSTEM.INT64; BEGIN IF sym = OPS.lbrak THEN OPS.Get(sym); IF ~OPT.SYSimported THEN err(135) END; @@ -78,7 +78,7 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) IF (sf < 0) OR (sf > OPM.MaxSysFlag) THEN err(220); sf := 0 END ELSE err(51); sf := 0 END ; - sysflag := SHORT(sf); CheckSym(OPS.rbrak) + sysflag := OPM.Integer(sf); CheckSym(OPS.rbrak) ELSE sysflag := default END END CheckSysFlag; @@ -141,7 +141,7 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) END RecordType; PROCEDURE ArrayType(VAR typ, banned: OPT.Struct); - VAR x: OPT.Node; n: LONGINT; sysflag: INTEGER; + VAR x: OPT.Node; n: SYSTEM.INT64; sysflag: INTEGER; BEGIN CheckSysFlag(sysflag, 0); IF sym = OPS.of THEN (*dynamic array*) typ := OPT.NewStr(OPT.Comp, OPT.DynArr); typ^.mno := 0; typ^.sysflag := sysflag; @@ -156,7 +156,7 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) IF (n <= 0) OR (n > OPM.MaxIndex) THEN err(63); n := 1 END ELSE err(51); n := 1 END ; - typ^.n := n; + typ^.n := OPM.Longint(n); IF sym = OPS.of THEN OPS.Get(sym); Type(typ^.BaseTyp, banned); typ^.BaseTyp^.pvused := TRUE @@ -530,7 +530,7 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) forward: BOOLEAN; PROCEDURE GetCode; - VAR ext: OPT.ConstExt; n: INTEGER; c: LONGINT; + VAR ext: OPT.ConstExt; n: INTEGER; c: SYSTEM.INT64; BEGIN ext := OPT.NewExt(); proc^.conval^.ext := ext; n := 0; IF sym = OPS.string THEN @@ -669,7 +669,7 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) VAR x, y, lastlab: OPT.Node; i, f: INTEGER; xval, yval: LONGINT; BEGIN lab := NIL; lastlab := NIL; LOOP ConstExpression(x); f := x^.typ^.form; - IF f IN {OPT.Int, OPT.Char} THEN xval := x^.conval^.intval + IF f IN {OPT.Int, OPT.Char} THEN xval := OPM.Longint(x^.conval^.intval) ELSE err(61); xval := 1 END; IF f = OPT.Int THEN @@ -677,7 +677,7 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) ELSIF LabelTyp.form # f THEN err(60) END ; IF sym = OPS.upto THEN - OPS.Get(sym); ConstExpression(y); yval := y^.conval^.intval; + OPS.Get(sym); ConstExpression(y); yval := OPM.Longint(y^.conval^.intval); IF (y^.typ^.form # f) & ~((f = OPT.Int) & (y^.typ^.form = OPT.Int)) THEN err(60) END ; IF yval < xval THEN err(63); yval := xval END ELSE yval := xval diff --git a/src/compiler/OPS.Mod b/src/compiler/OPS.Mod index e386e538..909cdee2 100644 --- a/src/compiler/OPS.Mod +++ b/src/compiler/OPS.Mod @@ -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*: LONGINT (* todo SYSTEM.INT64 *); (* integer value or string length *) + intval*: SYSTEM.INT64; (* integer value or string length *) realval*: REAL; lrlval*: LONGREAL; diff --git a/src/compiler/OPT.Mod b/src/compiler/OPT.Mod index cd1eae8b..a97b3876 100644 --- a/src/compiler/OPT.Mod +++ b/src/compiler/OPT.Mod @@ -4,7 +4,7 @@ MODULE OPT; (* NW, RC 6.3.89 / 23.1.92 *) (* object model 24.2.94 *) 2002-08-20 jt: NewStr: txtpos remains 0 for structs read from symbol file *) -IMPORT OPS, OPM; +IMPORT OPS, OPM, SYSTEM; (* Constants - value of literals *) @@ -12,11 +12,11 @@ TYPE Const* = POINTER TO ConstDesc; ConstExt* = POINTER TO OPS.String; ConstDesc* = RECORD - ext*: ConstExt; (* string or code for code proc *) - intval*: LONGINT; (* constant value or adr, proc par size, text position or least case label *) - intval2*: LONGINT; (* string length, proc var size or larger case label *) - setval*: SET; (* constant value, procedure body present or "ELSE" present in case *) - realval*: LONGREAL (* real or longreal constant value *) + ext*: ConstExt; (* string or code for code proc *) + intval*: SYSTEM.INT64; (* constant value or adr, proc par size, text position or least case label *) + intval2*: LONGINT; (* string length, proc var size or larger case label *) + setval*: SET; (* constant value, procedure body present or "ELSE" present in case *) + realval*: LONGREAL (* real or longreal constant value *) END; CONST @@ -160,18 +160,18 @@ VAR realtyp*, lrltyp*, settyp*, stringtyp*, niltyp*, notyp*, sysptrtyp*: Struct; + sintobj*, intobj*, lintobj*: Object; + nofGmod*: SHORTINT; (*nof imports*) GlbMod*: ARRAY maxImps OF Object; (* ^.right = first object, ^.name = module import name (not alias) *) SelfName*: OPS.Name; (* name of module being compiled *) SYSimported*: BOOLEAN; - IntTypes: ARRAY 20 OF Struct; (* Lists integer types in SHORT/LONG ordering *) + CONST - - (* Symbol file items *) Smname* = 16; Send* = 18; Stype* = 19; Salias* = 20; Svar* = 21; Srvar* = 22; Svalpar* = 23; Svarpar* = 24; Sfld* = 25; Srfld* = 26; @@ -215,28 +215,30 @@ END err; PROCEDURE IntType*(size: LONGINT): Struct; (* Selects smallest standard integer type for given size in bytes *) - VAR i: INTEGER; BEGIN - 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; + IF size <= int8typ.size THEN RETURN int8typ END; + IF size <= int16typ.size THEN RETURN int16typ END; + IF size <= int32typ.size THEN RETURN int32typ END; + RETURN int64typ END IntType; PROCEDURE ShorterOrLongerType*(x: Struct; dir: INTEGER): Struct; VAR i: INTEGER; BEGIN ASSERT(x.form = Int); - ASSERT((dir = 1) OR (dir = -1)); - (* Not sure if StPar0 (which calls this) always gets the baseiest type. This - ASSERT will tell me. *) ASSERT(x.BaseTyp = undftyp); - (* - WHILE x.BaseTyp # undftyp DO ASSERT(x # x.BaseTyp); ASSERT(x.BaseTyp # NIL); x := x.BaseTyp END; - *) - i := 0; WHILE (IntTypes[i] # x) & (i < LEN(IntTypes)) DO INC(i) END; - ASSERT(i < LEN(IntTypes)-1); - RETURN IntTypes[i+dir] + ASSERT((dir = 1) OR (dir = -1)); + IF dir > 0 THEN + IF x.size < sinttyp.size THEN RETURN sinttyp END; + IF x.size < inttyp.size THEN RETURN inttyp END; + IF x.size < linttyp.size THEN RETURN linttyp END; + RETURN int64typ + ELSE + IF x.size > linttyp.size THEN RETURN linttyp END; + IF x.size > inttyp.size THEN RETURN inttyp END; + IF x.size > sinttyp.size THEN RETURN sinttyp END; + RETURN int8typ + END END ShorterOrLongerType; @@ -1175,6 +1177,13 @@ END Import; typ^.idfp := form; typ^.idfpdone := TRUE; res := typ END EnterTyp; + PROCEDURE EnterTypeAlias(name: OPS.Name; VAR res: Object); + VAR obj: Object; + BEGIN + Insert(name, obj); obj^.mode := Typ; obj^.typ := NIL; obj^.vis := external; + res := obj + END EnterTypeAlias; + PROCEDURE EnterProc(name: OPS.Name; num: INTEGER); VAR obj: Object; BEGIN Insert(name, obj); @@ -1195,6 +1204,7 @@ BEGIN topScope := NIL; OpenScope(0, NIL); OPM.errpos := 0; EnterTyp("INT16", Int, 2, int16typ); EnterTyp("INT32", Int, 4, int32typ); EnterTyp("INT64", Int, 8, int64typ); + EnterProc("ADR", adrfn); EnterProc("CC", ccfn); EnterProc("LSH", lshfn); @@ -1207,17 +1217,20 @@ BEGIN topScope := NIL; OpenScope(0, NIL); OPM.errpos := 0; EnterProc("VAL", valfn); EnterProc("NEW", sysnewfn); EnterProc("MOVE", movefn); + syslink := topScope^.right; universe := topScope; topScope^.right := NIL; + EnterTyp("BOOLEAN", Bool, OPM.BoolSize, booltyp); EnterTyp("CHAR", Char, OPM.CharSize, chartyp); EnterTyp("SET", Set, OPM.SetSize, settyp); EnterTyp("REAL", Real, OPM.RealSize, realtyp); - EnterTyp("INTEGER", Int, OPM.IntSize, inttyp); - EnterTyp("LONGINT", Int, OPM.LIntSize, linttyp); EnterTyp("LONGREAL", LReal, OPM.LRealSize, lrltyp); - EnterTyp("SHORTINT", Int, OPM.SIntSize, sinttyp); + + EnterTypeAlias("SHORTINT", sintobj); + EnterTypeAlias("INTEGER", intobj); + EnterTypeAlias("LONGINT", lintobj); EnterBoolConst("FALSE", 0); (* 0 and 1 are compiler internal representation only *) EnterBoolConst("TRUE", 1); @@ -1248,7 +1261,7 @@ BEGIN topScope := NIL; OpenScope(0, NIL); OPM.errpos := 0; impCtxt.ref[Byte] := bytetyp; impCtxt.ref[Bool] := booltyp; impCtxt.ref[Char] := chartyp; - impCtxt.ref[Int] := inttyp; + impCtxt.ref[Int] := int32typ; impCtxt.ref[Real] := realtyp; impCtxt.ref[LReal] := lrltyp; impCtxt.ref[Set] := settyp; @@ -1257,15 +1270,6 @@ BEGIN topScope := NIL; OpenScope(0, NIL); OPM.errpos := 0; impCtxt.ref[NoTyp] := notyp; impCtxt.ref[Pointer] := sysptrtyp; - IntTypes[1] := sinttyp; - IntTypes[2] := inttyp; - IntTypes[3] := linttyp; - - IntTypes[5] := int8typ; - IntTypes[6] := int16typ; - IntTypes[7] := int32typ; - IntTypes[8] := int64typ - END OPT. Objects: diff --git a/src/compiler/OPV.Mod b/src/compiler/OPV.Mod index f4a82ca5..d8486ca9 100644 --- a/src/compiler/OPV.Mod +++ b/src/compiler/OPV.Mod @@ -5,7 +5,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 various promotion rules changed (long) => (LONGINT), xxxL avoided *) - IMPORT OPT, OPC, OPM, OPS; + IMPORT OPT, OPC, OPM, OPS, SYSTEM; CONST UndefinedType = 0; (* named type not yet defined *) @@ -181,6 +181,8 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 PROCEDURE AdrAndSize* (topScope: OPT.Object); BEGIN + ASSERT(OPT.sinttyp # NIL); ASSERT(OPT.inttyp # NIL); ASSERT(OPT.linttyp # NIL); + OPM.errpos := topScope^.adr; (* text position of scope used if error *) topScope^.leaf := TRUE; Traverse(topScope^.right, topScope, TRUE); (* first pass only on exported types and procedures *) @@ -189,15 +191,18 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 OPT.chartyp^.strobj^.linkadr := PredefinedType; OPT.settyp^.strobj^.linkadr := PredefinedType; OPT.realtyp^.strobj^.linkadr := PredefinedType; + + (* SHORTINT, INTEGER and LONGINT are alternate names for INT8, INT16, INT32 and INT64 and have not been set up yet. + OPT.sinttyp^.strobj^.linkadr := PredefinedType; OPT.inttyp^.strobj^.linkadr := PredefinedType; OPT.linttyp^.strobj^.linkadr := PredefinedType; + *) OPT.adrtyp^.strobj^.linkadr := PredefinedType; OPT.int8typ^.strobj^.linkadr := PredefinedType; OPT.int16typ^.strobj^.linkadr := PredefinedType; OPT.int32typ^.strobj^.linkadr := PredefinedType; OPT.int64typ^.strobj^.linkadr := PredefinedType; OPT.lrltyp^.strobj^.linkadr := PredefinedType; - OPT.sinttyp^.strobj^.linkadr := PredefinedType; OPT.booltyp^.strobj^.linkadr := PredefinedType; OPT.bytetyp^.strobj^.linkadr := PredefinedType; OPT.sysptrtyp^.strobj^.linkadr := PredefinedType; @@ -256,7 +261,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 PROCEDURE^ expr (n: OPT.Node; prec: INTEGER); PROCEDURE^ design(n: OPT.Node; prec: INTEGER); - PROCEDURE Len(n: OPT.Node; dim: LONGINT); + PROCEDURE Len(n: OPT.Node; dim: SYSTEM.INT64); BEGIN WHILE (n^.class = OPT.Nindex) & (n^.typ^.comp = OPT.DynArr(*26.7.2002*)) DO INC(dim); n := n^.left END ; IF (n^.class = OPT.Nderef) & (n^.typ^.comp = OPT.DynArr) THEN @@ -430,7 +435,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 IF prec > designPrec THEN OPM.Write(CloseParen) END END design; - PROCEDURE ParIntLiteral(n, size: LONGINT); + PROCEDURE ParIntLiteral(n: SYSTEM.INT64; size: LONGINT); BEGIN (* Literal parameters (other than varargs) do not need an explicit size cast on ansi C compilers. *) IF ansi THEN OPM.WriteInt(n) ELSE OPC.IntLiteral(n, size) END @@ -723,7 +728,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 PROCEDURE CaseStat(n: OPT.Node; outerProc: OPT.Object); VAR switchCase, label: OPT.Node; - low, high: LONGINT; form, i: INTEGER; + low, high: SYSTEM.INT64; form, i: INTEGER; BEGIN OPM.WriteString("switch "); expr(n^.left, MaxPrec); OPM.Write(Blank); OPC.BegBlk; @@ -812,7 +817,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 VAR proc: OPT.Object; saved: ExitInfo; l, r: OPT.Node; BEGIN WHILE (n # NIL) & OPM.noerr DO - OPM.errpos := n^.conval^.intval; + OPM.errpos := OPM.Longint(n^.conval^.intval); IF n^.class # OPT.Ninittd THEN OPC.BegStat END; CASE n^.class OF | OPT.Nenter: IF n^.obj = NIL THEN (* enter module *) @@ -942,7 +947,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 END END | OPT.Nwith: IfStat(n, n^.subcl = 0, outerProc) - | OPT.Ntrap: OPC.Halt(n^.right^.conval^.intval) + | OPT.Ntrap: OPC.Halt(OPM.Longint(n^.right^.conval^.intval)) ELSE OPM.LogWStr("unhandled case in OPV.expr, n^.class = "); OPM.LogWNum(n^.class, 0); OPM.LogWLn; END; IF ~(n^.class IN {OPT.Nenter, OPT.Ninittd, OPT.Nifelse, OPT.Nwith, OPT.Ncase, OPT.Nwhile, OPT.Nloop}) THEN OPC.EndStat END ; diff --git a/src/compiler/Vishap.Mod b/src/compiler/Vishap.Mod index 3323883d..33481260 100644 --- a/src/compiler/Vishap.Mod +++ b/src/compiler/Vishap.Mod @@ -56,12 +56,21 @@ MODULE Vishap; (* J. Templ 3.2.95 *) OPT.chartyp.size := OPM.CharSize; OPT.settyp.size := OPM.SetSize; OPT.realtyp.size := OPM.RealSize; - OPT.inttyp.size := OPM.IntSize; - OPT.linttyp.size := OPM.LIntSize; OPT.adrtyp.size := OPM.PointerSize; OPT.lrltyp.size := OPM.LRealSize; - OPT.sinttyp.size := OPM.SIntSize; - OPT.booltyp.size := OPM.BoolSize + OPT.booltyp.size := OPM.BoolSize; + + OPT.sinttyp := OPT.int8typ; + IF OPM.IntSize = 2 THEN + OPT.inttyp := OPT.int16typ; + OPT.linttyp := OPT.int32typ + ELSE + OPT.inttyp := OPT.int32typ; + OPT.linttyp := OPT.int64typ + END; + OPT.sintobj.typ := OPT.sinttyp; + OPT.intobj.typ := OPT.inttyp; + OPT.lintobj.typ := OPT.linttyp END PropagateElementaryTypeSizes; diff --git a/src/system/Console.Mod b/src/system/Console.Mod index 430519df..6b35a090 100644 --- a/src/system/Console.Mod +++ b/src/system/Console.Mod @@ -27,7 +27,8 @@ MODULE Console; (* J. Templ, 29-June-96 *) WHILE s[i] # 0X DO Char(s[i]); INC(i) END END String; - PROCEDURE Int*(i, n: LONGINT); +(* todo. support int64 properly *) + PROCEDURE Int*(i, n: SYSTEM.INT64); VAR s: ARRAY 32 OF CHAR; i1, k: LONGINT; BEGIN IF i = SYSTEM.LSH(LONG(LONG(1)), SIZE(LONGINT)*8 - 1) THEN @@ -35,7 +36,7 @@ MODULE Console; (* J. Templ, 29-June-96 *) ELSE s := "8463847412"; k := 10 END ELSE - i1 := ABS(i); + i1 := ABS(SYSTEM.VAL(LONGINT,i)); s[0] := CHR(i1 MOD 10 + ORD("0")); i1 := i1 DIV 10; k := 1; WHILE i1 > 0 DO s[k] := CHR(i1 MOD 10 + ORD("0")); i1 := i1 DIV 10; INC(k) END END ; diff --git a/src/system/Files.Mod b/src/system/Files.Mod index 7aeee5ac..fb9fc421 100644 --- a/src/system/Files.Mod +++ b/src/system/Files.Mod @@ -663,6 +663,18 @@ Especially Length would become fairly complex. x := n END ReadNum; + PROCEDURE ReadNum64* (VAR R: Rider; VAR x: SYSTEM.INT64); + (* todo. use proper code when INC/ASH properly support INT64 on 32 bit platforms + VAR s: SHORTINT; ch: CHAR; n: SYSTEM.INT64; + BEGIN s := 0; n := 0; Read(R, ch); + WHILE ORD(ch) >= 128 DO INC(n, ASH(ORD(ch) - 128, s) ); INC(s, 7); Read(R, ch) END; + INC(n, ASH(ORD(ch) MOD 64 - ORD(ch) DIV 64 * 64, s) ); + x := n + *) + VAR n: LONGINT; + BEGIN ReadNum(R, n); x := n + END ReadNum64; + PROCEDURE WriteBool* (VAR R: Rider; x: BOOLEAN); BEGIN Write(R, SYSTEM.VAL(CHAR, x)) END WriteBool; @@ -710,6 +722,12 @@ Especially Length would become fairly complex. Write(R, CHR(x MOD 128)) END WriteNum; + PROCEDURE WriteNum64* (VAR R: Rider; x: SYSTEM.INT64); + BEGIN + WHILE (x < - 64) OR (x > 63) DO Write(R, CHR(x MOD 128 + 128)); x := x DIV 128 END; + Write(R, CHR(x MOD 128)) + END WriteNum64; + PROCEDURE GetName*(f: File; VAR name: ARRAY OF CHAR); BEGIN COPY (f.workName, name); From 9971e5645143771ca9cab388405ca4cf01323700 Mon Sep 17 00:00:00 2001 From: David Brown Date: Sun, 18 Sep 2016 15:52:11 +0100 Subject: [PATCH 236/580] INT64 support in the interface browser. --- bootstrap/unix-44/Console.c | 10 +- bootstrap/unix-44/Console.h | 2 +- bootstrap/unix-44/Files.c | 18 +++ bootstrap/unix-44/Files.h | 2 + bootstrap/unix-44/OPB.c | 80 +++++------ bootstrap/unix-44/OPB.h | 4 +- bootstrap/unix-44/OPC.c | 16 +-- bootstrap/unix-44/OPC.h | 6 +- bootstrap/unix-44/OPM.c | 95 ++++++++----- bootstrap/unix-44/OPM.h | 15 +- bootstrap/unix-44/OPP.c | 16 +-- bootstrap/unix-44/OPS.c | 10 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 5 +- bootstrap/unix-44/OPT.h | 3 +- bootstrap/unix-44/OPV.c | 14 +- bootstrap/unix-48/Console.c | 10 +- bootstrap/unix-48/Console.h | 2 +- bootstrap/unix-48/Files.c | 18 +++ bootstrap/unix-48/Files.h | 2 + bootstrap/unix-48/OPB.c | 80 +++++------ bootstrap/unix-48/OPB.h | 4 +- bootstrap/unix-48/OPC.c | 16 +-- bootstrap/unix-48/OPC.h | 6 +- bootstrap/unix-48/OPM.c | 95 ++++++++----- bootstrap/unix-48/OPM.h | 15 +- bootstrap/unix-48/OPP.c | 16 +-- bootstrap/unix-48/OPS.c | 10 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 5 +- bootstrap/unix-48/OPT.h | 3 +- bootstrap/unix-48/OPV.c | 14 +- bootstrap/unix-88/Console.c | 2 +- bootstrap/unix-88/Files.c | 18 +++ bootstrap/unix-88/Files.h | 2 + bootstrap/unix-88/OPB.c | 18 +-- bootstrap/unix-88/OPM.c | 40 +++++- bootstrap/unix-88/OPM.h | 3 + bootstrap/unix-88/OPP.c | 8 +- bootstrap/unix-88/OPV.c | 4 +- bootstrap/windows-48/Console.c | 10 +- bootstrap/windows-48/Console.h | 2 +- bootstrap/windows-48/Files.c | 18 +++ bootstrap/windows-48/Files.h | 2 + bootstrap/windows-48/OPB.c | 80 +++++------ bootstrap/windows-48/OPB.h | 4 +- bootstrap/windows-48/OPC.c | 16 +-- bootstrap/windows-48/OPC.h | 6 +- bootstrap/windows-48/OPM.c | 95 ++++++++----- bootstrap/windows-48/OPM.h | 15 +- bootstrap/windows-48/OPP.c | 16 +-- bootstrap/windows-48/OPS.c | 10 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 5 +- bootstrap/windows-48/OPT.h | 3 +- bootstrap/windows-48/OPV.c | 14 +- bootstrap/windows-88/Console.c | 2 +- bootstrap/windows-88/Files.c | 18 +++ bootstrap/windows-88/Files.h | 2 + bootstrap/windows-88/OPB.c | 18 +-- bootstrap/windows-88/OPM.c | 40 +++++- bootstrap/windows-88/OPM.h | 3 + bootstrap/windows-88/OPP.c | 8 +- bootstrap/windows-88/OPV.c | 4 +- src/library/s3/ethMD5.Mod | 2 +- src/library/v4/Texts.Mod | 16 +-- src/tools/browser/BrowserCmd.Mod | 226 +++++++++++++------------------ src/tools/make/vishap.make | 2 +- 68 files changed, 756 insertions(+), 574 deletions(-) diff --git a/bootstrap/unix-44/Console.c b/bootstrap/unix-44/Console.c index 168abb08..10d0a39b 100644 --- a/bootstrap/unix-44/Console.c +++ b/bootstrap/unix-44/Console.c @@ -16,7 +16,7 @@ export void Console_Bool (BOOLEAN b); export void Console_Char (CHAR ch); export void Console_Flush (void); export void Console_Hex (int32 i); -export void Console_Int (int32 i, int32 n); +export void Console_Int (int64 i, int64 n); export void Console_Ln (void); export void Console_Read (CHAR *ch); export void Console_ReadLine (CHAR *line, LONGINT line__len); @@ -54,15 +54,15 @@ void Console_String (CHAR *s, LONGINT s__len) __DEL(s); } -void Console_Int (int32 i, int32 n) +void Console_Int (int64 i, int64 n) { CHAR s[32]; int32 i1, k; - if (i == __LSHL(1, 31, 32)) { + if (i == (int64)__LSHL(1, 31, 32)) { __MOVE("8463847412", s, 11); k = 10; } else { - i1 = __ABS(i); + i1 = __ABS(__VAL(int32, i)); s[0] = (CHAR)((int)__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k = 1; @@ -76,7 +76,7 @@ void Console_Int (int32 i, int32 n) s[__X(k, 32)] = '-'; k += 1; } - while (n > k) { + while (n > (int64)k) { Console_Char(' '); n -= 1; } diff --git a/bootstrap/unix-44/Console.h b/bootstrap/unix-44/Console.h index cca2c91e..e5dc1566 100644 --- a/bootstrap/unix-44/Console.h +++ b/bootstrap/unix-44/Console.h @@ -12,7 +12,7 @@ import void Console_Bool (BOOLEAN b); import void Console_Char (CHAR ch); import void Console_Flush (void); import void Console_Hex (int32 i); -import void Console_Int (int32 i, int32 n); +import void Console_Int (int64 i, int64 n); import void Console_Ln (void); import void Console_Read (CHAR *ch); import void Console_ReadLine (CHAR *line, LONGINT line__len); diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index a37ffdd3..6c934210 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -90,6 +90,7 @@ export void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, int32 *x); export void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x); export void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); export void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int32 *x); +export void Files_ReadNum64 (Files_Rider *R, LONGINT *R__typ, int64 *x); export void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x); export void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x); export void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); @@ -105,6 +106,7 @@ export void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, int16 x); export void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, int32 x); export void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x); export void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int32 x); +export void Files_WriteNum64 (Files_Rider *R, LONGINT *R__typ, int64 x); export void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x); export void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x); export void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); @@ -936,6 +938,13 @@ void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int32 *x) *x = n; } +void Files_ReadNum64 (Files_Rider *R, LONGINT *R__typ, int64 *x) +{ + int32 n; + Files_ReadNum(&*R, R__typ, &n); + *x = n; +} + void Files_WriteBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN x) { Files_Write(&*R, R__typ, __VAL(CHAR, x)); @@ -1004,6 +1013,15 @@ void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int32 x) Files_Write(&*R, R__typ, (CHAR)__MASK(x, -128)); } +void Files_WriteNum64 (Files_Rider *R, LONGINT *R__typ, int64 x) +{ + while (x < -64 || x > 63) { + Files_Write(&*R, R__typ, (CHAR)(__MASK(x, -128) + 128)); + x = __ASHR(x, 7); + } + Files_Write(&*R, R__typ, (CHAR)__MASK(x, -128)); +} + void Files_GetName (Files_File f, CHAR *name, LONGINT name__len) { __COPY(f->workName, name, name__len); diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index c86d1186..0187d33f 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -47,6 +47,7 @@ import void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, int32 *x); import void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x); import void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); import void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int32 *x); +import void Files_ReadNum64 (Files_Rider *R, LONGINT *R__typ, int64 *x); import void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x); import void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x); import void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); @@ -61,6 +62,7 @@ import void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, int16 x); import void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, int32 x); import void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x); import void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int32 x); +import void Files_WriteNum64 (Files_Rider *R, LONGINT *R__typ, int64 x); import void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x); import void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x); import void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index 90e93aed..47f2de21 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -12,7 +12,7 @@ export void (*OPB_typSize)(OPT_Struct); static int16 OPB_exp; -static int32 OPB_maxExp; +static int64 OPB_maxExp; export void OPB_Assign (OPT_Node *x, OPT_Node y); @@ -38,14 +38,14 @@ export void OPB_Field (OPT_Node *x, OPT_Object y); export void OPB_In (OPT_Node *x, OPT_Node y); export void OPB_Index (OPT_Node *x, OPT_Node y); export void OPB_Inittd (OPT_Node *inittd, OPT_Node *last, OPT_Struct typ); -static BOOLEAN OPB_IntToBool (int32 i); +static BOOLEAN OPB_IntToBool (int64 i); export void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y); export void OPB_MOp (int8 op, OPT_Node *x); export OPT_Node OPB_NewBoolConst (BOOLEAN boolval); -export OPT_Node OPB_NewIntConst (int32 intval); +export OPT_Node OPB_NewIntConst (int64 intval); export OPT_Node OPB_NewLeaf (OPT_Object obj); export OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ); -export OPT_Node OPB_NewString (OPS_String str, int32 len); +export OPT_Node OPB_NewString (OPS_String str, int64 len); export OPT_Node OPB_Nil (void); static BOOLEAN OPB_NotVar (OPT_Node x); export void OPB_Op (int8 op, OPT_Node *x, OPT_Node y); @@ -63,7 +63,7 @@ export void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n); export void OPB_StaticLink (int8 dlev); export void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard); static void OPB_err (int16 n); -static int32 OPB_log (int32 x); +static int64 OPB_log (int64 x); static void OPB_err (int16 n) @@ -141,17 +141,11 @@ static int32 OPB_BoolToInt (BOOLEAN b) __RETCHK; } -static BOOLEAN OPB_IntToBool (int32 i) +static BOOLEAN OPB_IntToBool (int64 i) { BOOLEAN _o_result; - if (i == 0) { - _o_result = 0; - return _o_result; - } else { - _o_result = 1; - return _o_result; - } - __RETCHK; + _o_result = i != 0; + return _o_result; } OPT_Node OPB_NewBoolConst (BOOLEAN boolval) @@ -228,7 +222,7 @@ OPT_Node OPB_EmptySet (void) static void OPB_SetIntType (OPT_Node node) { int16 b; - int32 n; + int64 n; if (node->conval->intval >= 0) { n = node->conval->intval; } else { @@ -241,7 +235,7 @@ static void OPB_SetIntType (OPT_Node node) node->typ = OPT_IntType(b); } -OPT_Node OPB_NewIntConst (int32 intval) +OPT_Node OPB_NewIntConst (int64 intval) { OPT_Node _o_result; OPT_Node x = NIL; @@ -266,7 +260,7 @@ OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ) return _o_result; } -OPT_Node OPB_NewString (OPS_String str, int32 len) +OPT_Node OPB_NewString (OPS_String str, int64 len) { OPT_Node _o_result; OPT_Node x = NIL; @@ -274,7 +268,7 @@ OPT_Node OPB_NewString (OPS_String str, int32 len) x->conval = OPT_NewConst(); x->typ = OPT_stringtyp; x->conval->intval = -1; - x->conval->intval2 = len; + x->conval->intval2 = OPM_Longint(len); x->conval->ext = OPT_NewExt(); __COPY(str, *x->conval->ext, 256); _o_result = x; @@ -351,7 +345,7 @@ void OPB_Index (OPT_Node *x, OPT_Node y) } if ((*x)->typ->comp == 2) { typ = (*x)->typ->BaseTyp; - if ((y->class == 7 && (y->conval->intval < 0 || y->conval->intval >= (*x)->typ->n))) { + if ((y->class == 7 && (y->conval->intval < 0 || y->conval->intval >= (int64)(*x)->typ->n))) { OPB_err(81); } } else if ((*x)->typ->comp == 3) { @@ -466,14 +460,14 @@ void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) void OPB_In (OPT_Node *x, OPT_Node y) { int16 f; - int32 k; + int64 k; f = (*x)->typ->form; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); } else if ((f == 4 && y->typ->form == 7)) { if ((*x)->class == 7) { k = (*x)->conval->intval; - if (k < 0 || k > OPM_MaxSet) { + if (k < 0 || k > (int64)OPM_MaxSet) { OPB_err(202); } else if (y->class == 7) { (*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval, 32)); @@ -492,9 +486,9 @@ void OPB_In (OPT_Node *x, OPT_Node y) (*x)->typ = OPT_booltyp; } -static int32 OPB_log (int32 x) +static int64 OPB_log (int64 x) { - int32 _o_result; + int64 _o_result; OPB_exp = 0; if (x > 0) { while (!__ODD(x)) { @@ -580,7 +574,7 @@ void OPB_MOp (int8 op, OPT_Node *x) if (__IN(f, 0xf0, 32)) { if (z->class == 7) { if (f == 4) { - if (z->conval->intval == (-2147483647-1)) { + if (z->conval->intval == (-9223372036854775807-1)) { OPB_err(203); } else { z->conval->intval = -z->conval->intval; @@ -603,7 +597,7 @@ void OPB_MOp (int8 op, OPT_Node *x) if (__IN(f, 0x70, 32)) { if (z->class == 7) { if (f == 4) { - if (z->conval->intval == (-2147483647-1)) { + if (z->conval->intval == (-9223372036854775807-1)) { OPB_err(203); } else { z->conval->intval = __ABS(z->conval->intval); @@ -845,7 +839,7 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) { int16 f, g; OPT_Const xval = NIL, yval = NIL; - int32 xv, yv; + int64 xv, yv; BOOLEAN temp; struct ConstOp__13 _s; _s.x = &x; @@ -1007,7 +1001,7 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) case 4: if (f == 4) { if (yval->intval != 0) { - xval->intval = (int)__MOD(xval->intval, yval->intval); + xval->intval = __MOD(xval->intval, yval->intval); OPB_SetIntType(x); } else { OPB_err(205); @@ -1122,7 +1116,7 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) { OPT_Node node = NIL; int16 f, g; - int32 k; + int64 k; LONGREAL r; f = (*x)->typ->form; g = typ->form; @@ -1229,7 +1223,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) OPT_Node t = NIL, z = NIL; OPT_Struct typ = NIL; BOOLEAN do_; - int32 val; + int64 val; struct Op__38 _s; _s.f = &f; _s.g = &g; @@ -1500,19 +1494,19 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) void OPB_SetRange (OPT_Node *x, OPT_Node y) { - int32 k, l; + int64 k, l; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); } else if (((*x)->typ->form == 4 && y->typ->form == 4)) { if ((*x)->class == 7) { k = (*x)->conval->intval; - if (0 > k || k > OPM_MaxSet) { + if (0 > k || k > (int64)OPM_MaxSet) { OPB_err(202); } } if (y->class == 7) { l = y->conval->intval; - if (0 > l || l > OPM_MaxSet) { + if (0 > l || l > (int64)OPM_MaxSet) { OPB_err(202); } } @@ -1535,14 +1529,14 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y) void OPB_SetElem (OPT_Node *x) { - int32 k; + int64 k; if ((*x)->class == 8 || (*x)->class == 9) { OPB_err(126); } else if ((*x)->typ->form != 4) { OPB_err(93); } else if ((*x)->class == 7) { k = (*x)->conval->intval; - if ((0 <= k && k <= OPM_MaxSet)) { + if ((0 <= k && k <= (int64)OPM_MaxSet)) { (*x)->conval->setval = __SETOF(k,32); } else { OPB_err(202); @@ -1917,7 +1911,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (f == 4) { - if (x->typ->size != OPT_linttyp->size) { + if (x->typ->size < OPT_linttyp->size) { OPB_Convert(&x, OPT_linttyp); } } else { @@ -2055,7 +2049,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (f == 4) { - if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > OPM_MaxSet))) { + if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > (int64)OPM_MaxSet))) { OPB_err(202); } p = NewOp__53(19, fctno, p, x); @@ -2068,7 +2062,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) if (!(f == 4) || x->class != 7) { OPB_err(69); } else if (x->typ->size == 1) { - L = (int16)x->conval->intval; + L = OPM_Integer(x->conval->intval); typ = p->typ; while ((L > 0 && __IN(typ->comp, 0x0c, 32))) { typ = typ->BaseTyp; @@ -2120,8 +2114,8 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) OPB_err(208); p->conval->intval = 1; } else if (x->conval->intval >= 0) { - if (__ABS(p->conval->intval) <= __DIV(2147483647, __ASH(1, x->conval->intval))) { - p->conval->intval = p->conval->intval * __ASH(1, x->conval->intval); + if (__ABS(p->conval->intval) <= __DIV(9223372036854775807, (int64)__ASH(1, x->conval->intval))) { + p->conval->intval = p->conval->intval * (int64)__ASH(1, x->conval->intval); } else { OPB_err(208); p->conval->intval = 1; @@ -2132,7 +2126,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) p->obj = NIL; } else { p = NewOp__53(12, 17, p, x); - p->typ = OPT_linttyp; + p->typ = p->left->typ; } } else { OPB_err(111); @@ -2143,7 +2137,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) OPB_err(126); } else if (p->typ->comp == 3) { if (f == 4) { - if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > OPM_MaxIndex))) { + if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > (int64)OPM_MaxIndex))) { OPB_err(63); } } else { @@ -2281,7 +2275,7 @@ void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n) } else if (p->typ->comp != 3) { OPB_err(64); } else if (f == 4) { - if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > OPM_MaxIndex))) { + if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > (int64)OPM_MaxIndex))) { OPB_err(63); } node = p->right; @@ -2622,7 +2616,7 @@ export void *OPB__init(void) __MODULE_IMPORT(OPT); __REGMOD("OPB", 0); /* BEGIN */ - OPB_maxExp = OPB_log(1073741824); + OPB_maxExp = OPB_log(4611686018427387904); OPB_maxExp = OPB_exp; __ENDMOD; } diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index 183a5f32..08d025bf 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -25,10 +25,10 @@ import void OPB_Inittd (OPT_Node *inittd, OPT_Node *last, OPT_Struct typ); import void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y); import void OPB_MOp (int8 op, OPT_Node *x); import OPT_Node OPB_NewBoolConst (BOOLEAN boolval); -import OPT_Node OPB_NewIntConst (int32 intval); +import OPT_Node OPB_NewIntConst (int64 intval); import OPT_Node OPB_NewLeaf (OPT_Object obj); import OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ); -import OPT_Node OPB_NewString (OPS_String str, int32 len); +import OPT_Node OPB_NewString (OPS_String str, int64 len); import OPT_Node OPB_Nil (void); import void OPB_Op (int8 op, OPT_Node *x, OPT_Node y); import void OPB_OptIf (OPT_Node *x); diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 17690465..c21e44a4 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -26,8 +26,8 @@ export OPT_Object OPC_BaseTProc (OPT_Object obj); export void OPC_BegBlk (void); export void OPC_BegStat (void); static void OPC_CProcDefs (OPT_Object obj, int16 vis); -export void OPC_Case (int32 caseVal, int16 form); -static void OPC_CharacterLiteral (int32 c); +export void OPC_Case (int64 caseVal, int16 form); +static void OPC_CharacterLiteral (int64 c); export void OPC_Cmp (int16 rel); export void OPC_CompleteIdent (OPT_Object obj); export void OPC_Constant (OPT_Const con, int16 form); @@ -67,8 +67,8 @@ static void OPC_InitImports (OPT_Object obj); static void OPC_InitKeywords (void); export void OPC_InitTDesc (OPT_Struct typ); static void OPC_InitTProcs (OPT_Object typ, OPT_Object obj); -export void OPC_IntLiteral (int32 n, int32 size); -export void OPC_Len (OPT_Object obj, OPT_Struct array, int32 dim); +export void OPC_IntLiteral (int64 n, int32 size); +export void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim); static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName); static int16 OPC_Length (CHAR *s, LONGINT s__len); export int32 OPC_NofPtrs (OPT_Struct typ); @@ -1851,7 +1851,7 @@ void OPC_Cmp (int16 rel) } } -static void OPC_CharacterLiteral (int32 c) +static void OPC_CharacterLiteral (int64 c) { if (c < 32 || c > 126) { OPM_WriteString((CHAR*)"0x", 3); @@ -1894,7 +1894,7 @@ static void OPC_StringLiteral (CHAR *s, LONGINT s__len, int32 l) __DEL(s); } -void OPC_Case (int32 caseVal, int16 form) +void OPC_Case (int64 caseVal, int16 form) { CHAR ch; OPM_WriteString((CHAR*)"case ", 6); @@ -1937,7 +1937,7 @@ void OPC_Halt (int32 n) OPC_Str1((CHAR*)"__HALT(#)", 10, n); } -void OPC_IntLiteral (int32 n, int32 size) +void OPC_IntLiteral (int64 n, int32 size) { if ((((size > 4 && n <= 2147483647)) && n > (-2147483647-1))) { OPM_WriteString((CHAR*)"((int", 6); @@ -1950,7 +1950,7 @@ void OPC_IntLiteral (int32 n, int32 size) } } -void OPC_Len (OPT_Object obj, OPT_Struct array, int32 dim) +void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim) { if (array->comp == 3) { OPC_CompleteIdent(obj); diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index 34d9ebc2..9e1ec652 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -15,7 +15,7 @@ import int32 OPC_BaseAlignment (OPT_Struct typ); import OPT_Object OPC_BaseTProc (OPT_Object obj); import void OPC_BegBlk (void); import void OPC_BegStat (void); -import void OPC_Case (int32 caseVal, int16 form); +import void OPC_Case (int64 caseVal, int16 form); import void OPC_Cmp (int16 rel); import void OPC_CompleteIdent (OPT_Object obj); import void OPC_Constant (OPT_Const con, int16 form); @@ -37,8 +37,8 @@ import void OPC_Increment (BOOLEAN decrement); import void OPC_Indent (int16 count); import void OPC_Init (void); import void OPC_InitTDesc (OPT_Struct typ); -import void OPC_IntLiteral (int32 n, int32 size); -import void OPC_Len (OPT_Object obj, OPT_Struct array, int32 dim); +import void OPC_IntLiteral (int64 n, int32 size); +import void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim); import int32 OPC_NofPtrs (OPT_Struct typ); import void OPC_SetInclude (BOOLEAN exclude); import int32 OPC_SizeAlignment (int32 size); diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 18478d1e..ba86c00a 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -28,7 +28,8 @@ export int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; export CHAR OPM_modName[32]; export CHAR OPM_objname[64]; export SET OPM_opt, OPM_glbopt; -static int32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; +static int32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber; +static int64 OPM_lasterrpos; static Texts_Reader OPM_inR; static Texts_Text OPM_Log; static Texts_Writer OPM_W; @@ -45,46 +46,49 @@ static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F); export void OPM_CloseFiles (void); export void OPM_CloseOldSym (void); export void OPM_DeleteNewSym (void); -export void OPM_FPrint (int32 *fp, int32 val); +export void OPM_FPrint (int32 *fp, int64 val); export void OPM_FPrintLReal (int32 *fp, LONGREAL lr); export void OPM_FPrintReal (int32 *fp, REAL real); export void OPM_FPrintSet (int32 *fp, SET set); -static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, int32 pos); +static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, int64 pos); export void OPM_Get (CHAR *ch); static void OPM_GetProperties (void); static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONGINT name__len, int16 *size, int16 *align); export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); export void OPM_InitOptions (void); +export int16 OPM_Integer (int64 n); static void OPM_LogErrMsg (int16 n); export void OPM_LogW (CHAR ch); export void OPM_LogWLn (void); -export void OPM_LogWNum (int32 i, int32 len); +export void OPM_LogWNum (int64 i, int64 len); export void OPM_LogWStr (CHAR *s, LONGINT s__len); +export int32 OPM_Longint (int64 n); static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len); -export void OPM_Mark (int16 n, int32 pos); +export void OPM_Mark (int16 n, int64 pos); export void OPM_NewSym (CHAR *modName, LONGINT modName__len); export void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); export void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); export BOOLEAN OPM_OpenPar (void); export void OPM_RegisterNewSym (void); static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt); -static void OPM_ShowLine (int32 pos); +static void OPM_ShowLine (int64 pos); export int32 OPM_SignedMaximum (int32 bytecount); export int32 OPM_SignedMinimum (int32 bytecount); export void OPM_SymRCh (CHAR *ch); export int32 OPM_SymRInt (void); +export int64 OPM_SymRInt64 (void); export void OPM_SymRLReal (LONGREAL *lr); export void OPM_SymRReal (REAL *r); export void OPM_SymRSet (SET *s); export void OPM_SymWCh (CHAR ch); -export void OPM_SymWInt (int32 i); +export void OPM_SymWInt (int64 i); export void OPM_SymWLReal (LONGREAL lr); export void OPM_SymWReal (REAL r); export void OPM_SymWSet (SET s); static void OPM_VerboseListSizes (void); export void OPM_Write (CHAR ch); -export void OPM_WriteHex (int32 i); -export void OPM_WriteInt (int32 i); +export void OPM_WriteHex (int64 i); +export void OPM_WriteInt (int64 i); export void OPM_WriteLn (void); export void OPM_WriteReal (LONGREAL r, CHAR suffx); export void OPM_WriteString (CHAR *s, LONGINT s__len); @@ -107,7 +111,7 @@ void OPM_LogWStr (CHAR *s, LONGINT s__len) __DEL(s); } -void OPM_LogWNum (int32 i, int32 len) +void OPM_LogWNum (int64 i, int64 len) { Console_Int(i, len); } @@ -117,6 +121,20 @@ void OPM_LogWLn (void) Console_Ln(); } +int32 OPM_Longint (int64 n) +{ + int32 _o_result; + _o_result = __VAL(int32, n); + return _o_result; +} + +int16 OPM_Integer (int64 n) +{ + int16 _o_result; + _o_result = __VAL(int16, n); + return _o_result; +} + static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) { int16 i; @@ -404,21 +422,21 @@ static void OPM_LogErrMsg (int16 n) OPM_LogWStr(errors_errors[__X(n, 350)], 128); } -static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, int32 pos) +static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, int64 pos) { CHAR ch, cheol; - if (pos < OPM_ErrorLineStartPos) { + if (pos < (int64)OPM_ErrorLineStartPos) { OPM_ErrorLineStartPos = 0; OPM_ErrorLineLimitPos = 0; OPM_ErrorLineNumber = 0; } - if (pos < OPM_ErrorLineLimitPos) { + if (pos < (int64)OPM_ErrorLineLimitPos) { Files_Set(&*r, r__typ, f, OPM_ErrorLineStartPos); return; } Files_Set(&*r, r__typ, f, OPM_ErrorLineLimitPos); Files_Read(&*r, r__typ, (void*)&ch); - while ((OPM_ErrorLineLimitPos < pos && !(*r).eof)) { + while (((int64)OPM_ErrorLineLimitPos < pos && !(*r).eof)) { OPM_ErrorLineStartPos = OPM_ErrorLineLimitPos; OPM_ErrorLineNumber += 1; while ((((ch != 0x00 && ch != 0x0d)) && ch != 0x0a)) { @@ -436,7 +454,7 @@ static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, int32 p Files_Set(&*r, r__typ, f, OPM_ErrorLineStartPos); } -static void OPM_ShowLine (int32 pos) +static void OPM_ShowLine (int64 pos) { Files_File f = NIL; Files_Rider r; @@ -460,10 +478,10 @@ static void OPM_ShowLine (int32 pos) OPM_LogWStr(line, 1023); OPM_LogWLn(); OPM_LogWStr((CHAR*)" ", 7); - if (pos >= OPM_ErrorLineLimitPos) { + if (pos >= (int64)OPM_ErrorLineLimitPos) { pos = OPM_ErrorLineLimitPos - 1; } - i = (int16)(pos - OPM_ErrorLineStartPos); + i = (int16)OPM_Longint(pos - (int64)OPM_ErrorLineStartPos); while (i > 0) { OPM_LogW(' '); i -= 1; @@ -478,7 +496,7 @@ static void OPM_ShowLine (int32 pos) Files_Close(f); } -void OPM_Mark (int16 n, int32 pos) +void OPM_Mark (int16 n, int64 pos) { if (pos == -1) { pos = 0; @@ -535,9 +553,9 @@ void OPM_err (int16 n) OPM_Mark(n, OPM_errpos); } -void OPM_FPrint (int32 *fp, int32 val) +void OPM_FPrint (int32 *fp, int64 val) { - *fp = __ROTL((int32)((SET)*fp ^ (SET)val), 1, 32); + *fp = __ROTL((int32)((SET)*fp ^ __VAL(SET, val)), 1, 32); } void OPM_FPrintSet (int32 *fp, SET set) @@ -702,6 +720,15 @@ int32 OPM_SymRInt (void) return _o_result; } +int64 OPM_SymRInt64 (void) +{ + int64 _o_result; + int64 k; + Files_ReadNum64(&OPM_oldSF, Files_Rider__typ, &k); + _o_result = k; + return _o_result; +} + void OPM_SymRSet (SET *s) { Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (int32*)&*s); @@ -751,9 +778,9 @@ void OPM_SymWCh (CHAR ch) Files_Write(&OPM_newSF, Files_Rider__typ, ch); } -void OPM_SymWInt (int32 i) +void OPM_SymWInt (int64 i) { - Files_WriteNum(&OPM_newSF, Files_Rider__typ, i); + Files_WriteNum64(&OPM_newSF, Files_Rider__typ, i); } void OPM_SymWSet (SET s) @@ -820,17 +847,17 @@ void OPM_WriteStringVar (CHAR *s, LONGINT s__len) Files_WriteBytes(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, (void*)s, s__len * 1, i); } -void OPM_WriteHex (int32 i) +void OPM_WriteHex (int64 i) { CHAR s[3]; - int16 digit; - digit = __ASHR((int16)i, 4); + int32 digit; + digit = __ASHR((int32)i, 4); if (digit < 10) { s[0] = (CHAR)(48 + digit); } else { s[0] = (CHAR)(87 + digit); } - digit = __MASK((int16)i, -16); + digit = __MASK((int32)i, -16); if (digit < 10) { s[1] = (CHAR)(48 + digit); } else { @@ -840,31 +867,31 @@ void OPM_WriteHex (int32 i) OPM_WriteString(s, 3); } -void OPM_WriteInt (int32 i) +void OPM_WriteInt (int64 i) { - CHAR s[20]; - int32 i1, k; - if (i == OPM_SignedMinimum(OPM_IntSize) || i == OPM_SignedMinimum(OPM_LIntSize)) { + CHAR s[24]; + int64 i1, k; + if ((i == (int64)OPM_SignedMinimum(OPM_IntSize) || i == (int64)OPM_SignedMinimum(OPM_LIntSize)) || i == (int64)OPM_SignedMinimum(8)) { OPM_Write('('); OPM_WriteInt(i + 1); OPM_WriteString((CHAR*)"-1)", 4); } else { i1 = __ABS(i); - s[0] = (CHAR)((int)__MOD(i1, 10) + 48); + s[0] = (CHAR)(__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k = 1; while (i1 > 0) { - s[__X(k, 20)] = (CHAR)((int)__MOD(i1, 10) + 48); + s[__X(k, 24)] = (CHAR)(__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k += 1; } if (i < 0) { - s[__X(k, 20)] = '-'; + s[__X(k, 24)] = '-'; k += 1; } while (k > 0) { k -= 1; - OPM_Write(s[__X(k, 20)]); + OPM_Write(s[__X(k, 24)]); } } } diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index a36522a1..504519da 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -21,18 +21,20 @@ import BOOLEAN OPM_dontAsm, OPM_dontLink, OPM_mainProg, OPM_mainLinkStat, OPM_no import void OPM_CloseFiles (void); import void OPM_CloseOldSym (void); import void OPM_DeleteNewSym (void); -import void OPM_FPrint (int32 *fp, int32 val); +import void OPM_FPrint (int32 *fp, int64 val); import void OPM_FPrintLReal (int32 *fp, LONGREAL lr); import void OPM_FPrintReal (int32 *fp, REAL real); import void OPM_FPrintSet (int32 *fp, SET set); import void OPM_Get (CHAR *ch); import void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); import void OPM_InitOptions (void); +import int16 OPM_Integer (int64 n); import void OPM_LogW (CHAR ch); import void OPM_LogWLn (void); -import void OPM_LogWNum (int32 i, int32 len); +import void OPM_LogWNum (int64 i, int64 len); import void OPM_LogWStr (CHAR *s, LONGINT s__len); -import void OPM_Mark (int16 n, int32 pos); +import int32 OPM_Longint (int64 n); +import void OPM_Mark (int16 n, int64 pos); import void OPM_NewSym (CHAR *modName, LONGINT modName__len); import void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); import void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); @@ -42,17 +44,18 @@ import int32 OPM_SignedMaximum (int32 bytecount); import int32 OPM_SignedMinimum (int32 bytecount); import void OPM_SymRCh (CHAR *ch); import int32 OPM_SymRInt (void); +import int64 OPM_SymRInt64 (void); import void OPM_SymRLReal (LONGREAL *lr); import void OPM_SymRReal (REAL *r); import void OPM_SymRSet (SET *s); import void OPM_SymWCh (CHAR ch); -import void OPM_SymWInt (int32 i); +import void OPM_SymWInt (int64 i); import void OPM_SymWLReal (LONGREAL lr); import void OPM_SymWReal (REAL r); import void OPM_SymWSet (SET s); import void OPM_Write (CHAR ch); -import void OPM_WriteHex (int32 i); -import void OPM_WriteInt (int32 i); +import void OPM_WriteHex (int64 i); +import void OPM_WriteInt (int64 i); import void OPM_WriteLn (void); import void OPM_WriteReal (LONGREAL r, CHAR suffx); import void OPM_WriteString (CHAR *s, LONGINT s__len); diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index 8db5ef60..44ce8ff1 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -134,7 +134,7 @@ static void OPP_CheckMark (int8 *vis) static void OPP_CheckSysFlag (int16 *sysflag, int16 default_) { OPT_Node x = NIL; - int32 sf; + int64 sf; if (OPP_sym == 31) { OPS_Get(&OPP_sym); if (!OPT_SYSimported) { @@ -151,7 +151,7 @@ static void OPP_CheckSysFlag (int16 *sysflag, int16 default_) OPP_err(51); sf = 0; } - *sysflag = (int16)sf; + *sysflag = OPM_Integer(sf); OPP_CheckSym(23); } else { *sysflag = default_; @@ -254,7 +254,7 @@ static void OPP_RecordType (OPT_Struct *typ, OPT_Struct *banned) static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) { OPT_Node x = NIL; - int32 n; + int64 n; int16 sysflag; OPP_CheckSysFlag(&sysflag, 0); if (OPP_sym == 25) { @@ -275,7 +275,7 @@ static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) OPP_ConstExpression(&x); if (x->typ->form == 4) { n = x->conval->intval; - if (n <= 0 || n > OPM_MaxIndex) { + if (n <= 0 || n > (int64)OPM_MaxIndex) { OPP_err(63); n = 1; } @@ -283,7 +283,7 @@ static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) OPP_err(51); n = 1; } - (*typ)->n = n; + (*typ)->n = OPM_Longint(n); if (OPP_sym == 25) { OPS_Get(&OPP_sym); OPP_Type(&(*typ)->BaseTyp, &*banned); @@ -932,7 +932,7 @@ static void GetCode__19 (void) { OPT_ConstExt ext = NIL; int16 n; - int32 c; + int64 c; ext = OPT_NewExt(); (*ProcedureDeclaration__16_s->proc)->conval->ext = ext; n = 0; @@ -1179,7 +1179,7 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int16 *n, OPP OPP_ConstExpression(&x); f = x->typ->form; if (__IN(f, 0x18, 32)) { - xval = x->conval->intval; + xval = OPM_Longint(x->conval->intval); } else { OPP_err(61); xval = 1; @@ -1194,7 +1194,7 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int16 *n, OPP if (OPP_sym == 21) { OPS_Get(&OPP_sym); OPP_ConstExpression(&y); - yval = y->conval->intval; + yval = OPM_Longint(y->conval->intval); if (((int16)y->typ->form != f && !((f == 4 && y->typ->form == 4)))) { OPP_err(60); } diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index fb0f2237..f80ca2b1 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -17,7 +17,7 @@ typedef export OPS_Name OPS_name; export OPS_String OPS_str; export int16 OPS_numtyp; -export int32 OPS_intval; +export int64 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) + Ord__7(dig[i], 1); + OPS_intval = __ASHL(OPS_intval, 4) + (int64)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) + Ord__7(dig[i], 1); + OPS_intval = __ASHL(OPS_intval, 4) + (int64)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 ((int64)OPS_intval <= __DIV(9223372036854775807 - (int64)d, 10)) { - OPS_intval = OPS_intval * 10 + d; + if (OPS_intval <= __DIV(9223372036854775807 - (int64)d, 10)) { + OPS_intval = OPS_intval * 10 + (int64)d; } else { OPS_err(203); } diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index d2b5dfb4..d33103c1 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -15,7 +15,7 @@ typedef import OPS_Name OPS_name; import OPS_String OPS_str; import int16 OPS_numtyp; -import int32 OPS_intval; +import int64 OPS_intval; import REAL OPS_realval; import LONGREAL OPS_lrlval; diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index 83a2652b..c7f21138 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -17,7 +17,8 @@ typedef typedef struct OPT_ConstDesc { OPT_ConstExt ext; - int32 intval, intval2; + int64 intval; + int32 intval2; SET setval; LONGREAL realval; } OPT_ConstDesc; @@ -1838,7 +1839,7 @@ static void EnumPtrs(void (*P)(void*)) __ENUMR(&OPT_impCtxt, OPT_ImpCtxt__typ, 3140, 1, P); } -__TDESC(OPT_ConstDesc, 1, 1) = {__TDFLDS("ConstDesc", 24), {0, -8}}; +__TDESC(OPT_ConstDesc, 1, 1) = {__TDFLDS("ConstDesc", 28), {0, -8}}; __TDESC(OPT_ObjDesc, 1, 6) = {__TDFLDS("ObjDesc", 304), {0, 4, 8, 12, 284, 288, -28}}; __TDESC(OPT_StrDesc, 1, 3) = {__TDFLDS("StrDesc", 56), {44, 48, 52, -16}}; __TDESC(OPT_NodeDesc, 1, 6) = {__TDFLDS("NodeDesc", 28), {0, 4, 8, 16, 20, 24, -28}}; diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index d4b49da8..b6566702 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -15,7 +15,8 @@ typedef typedef struct OPT_ConstDesc { OPT_ConstExt ext; - int32 intval, intval2; + int64 intval; + int32 intval2; SET setval; LONGREAL realval; } OPT_ConstDesc; diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index a32351aa..cddb737c 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -36,10 +36,10 @@ static BOOLEAN OPV_ImplicitReturn (OPT_Node n); static void OPV_Index (OPT_Node n, OPT_Node d, int16 prec, int16 dim); export void OPV_Init (void); static void OPV_InitTDescs (OPT_Node n); -static void OPV_Len (OPT_Node n, int32 dim); +static void OPV_Len (OPT_Node n, int64 dim); export void OPV_Module (OPT_Node prog); static void OPV_NewArr (OPT_Node d, OPT_Node x); -static void OPV_ParIntLiteral (int32 n, int32 size); +static void OPV_ParIntLiteral (int64 n, int32 size); static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp); static BOOLEAN OPV_SideEffects (OPT_Node n); static void OPV_SizeCast (int32 from, int32 to); @@ -414,7 +414,7 @@ static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp __RETCHK; } -static void OPV_Len (OPT_Node n, int32 dim) +static void OPV_Len (OPT_Node n, int64 dim) { while ((n->class == 4 && n->typ->comp == 3)) { dim += 1; @@ -725,7 +725,7 @@ static void OPV_design (OPT_Node n, int16 prec) } } -static void OPV_ParIntLiteral (int32 n, int32 size) +static void OPV_ParIntLiteral (int64 n, int32 size) { if (OPV_ansi) { OPM_WriteInt(n); @@ -1210,7 +1210,7 @@ static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc) { OPT_Node switchCase = NIL, label = NIL; - int32 low, high; + int64 low, high; int16 form, i; OPM_WriteString((CHAR*)"switch ", 8); OPV_expr(n->left, 12); @@ -1351,7 +1351,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPV_ExitInfo saved; OPT_Node l = NIL, r = NIL; while ((n != NIL && OPM_noerr)) { - OPM_errpos = n->conval->intval; + OPM_errpos = OPM_Longint(n->conval->intval); if (n->class != 14) { OPC_BegStat(); } @@ -1625,7 +1625,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPV_IfStat(n, n->subcl == 0, outerProc); break; case 28: - OPC_Halt(n->right->conval->intval); + OPC_Halt(OPM_Longint(n->right->conval->intval)); break; default: OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, n^.class = ", 40); diff --git a/bootstrap/unix-48/Console.c b/bootstrap/unix-48/Console.c index 168abb08..10d0a39b 100644 --- a/bootstrap/unix-48/Console.c +++ b/bootstrap/unix-48/Console.c @@ -16,7 +16,7 @@ export void Console_Bool (BOOLEAN b); export void Console_Char (CHAR ch); export void Console_Flush (void); export void Console_Hex (int32 i); -export void Console_Int (int32 i, int32 n); +export void Console_Int (int64 i, int64 n); export void Console_Ln (void); export void Console_Read (CHAR *ch); export void Console_ReadLine (CHAR *line, LONGINT line__len); @@ -54,15 +54,15 @@ void Console_String (CHAR *s, LONGINT s__len) __DEL(s); } -void Console_Int (int32 i, int32 n) +void Console_Int (int64 i, int64 n) { CHAR s[32]; int32 i1, k; - if (i == __LSHL(1, 31, 32)) { + if (i == (int64)__LSHL(1, 31, 32)) { __MOVE("8463847412", s, 11); k = 10; } else { - i1 = __ABS(i); + i1 = __ABS(__VAL(int32, i)); s[0] = (CHAR)((int)__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k = 1; @@ -76,7 +76,7 @@ void Console_Int (int32 i, int32 n) s[__X(k, 32)] = '-'; k += 1; } - while (n > k) { + while (n > (int64)k) { Console_Char(' '); n -= 1; } diff --git a/bootstrap/unix-48/Console.h b/bootstrap/unix-48/Console.h index cca2c91e..e5dc1566 100644 --- a/bootstrap/unix-48/Console.h +++ b/bootstrap/unix-48/Console.h @@ -12,7 +12,7 @@ import void Console_Bool (BOOLEAN b); import void Console_Char (CHAR ch); import void Console_Flush (void); import void Console_Hex (int32 i); -import void Console_Int (int32 i, int32 n); +import void Console_Int (int64 i, int64 n); import void Console_Ln (void); import void Console_Read (CHAR *ch); import void Console_ReadLine (CHAR *line, LONGINT line__len); diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index a37ffdd3..6c934210 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -90,6 +90,7 @@ export void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, int32 *x); export void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x); export void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); export void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int32 *x); +export void Files_ReadNum64 (Files_Rider *R, LONGINT *R__typ, int64 *x); export void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x); export void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x); export void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); @@ -105,6 +106,7 @@ export void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, int16 x); export void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, int32 x); export void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x); export void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int32 x); +export void Files_WriteNum64 (Files_Rider *R, LONGINT *R__typ, int64 x); export void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x); export void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x); export void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); @@ -936,6 +938,13 @@ void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int32 *x) *x = n; } +void Files_ReadNum64 (Files_Rider *R, LONGINT *R__typ, int64 *x) +{ + int32 n; + Files_ReadNum(&*R, R__typ, &n); + *x = n; +} + void Files_WriteBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN x) { Files_Write(&*R, R__typ, __VAL(CHAR, x)); @@ -1004,6 +1013,15 @@ void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int32 x) Files_Write(&*R, R__typ, (CHAR)__MASK(x, -128)); } +void Files_WriteNum64 (Files_Rider *R, LONGINT *R__typ, int64 x) +{ + while (x < -64 || x > 63) { + Files_Write(&*R, R__typ, (CHAR)(__MASK(x, -128) + 128)); + x = __ASHR(x, 7); + } + Files_Write(&*R, R__typ, (CHAR)__MASK(x, -128)); +} + void Files_GetName (Files_File f, CHAR *name, LONGINT name__len) { __COPY(f->workName, name, name__len); diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index c86d1186..0187d33f 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -47,6 +47,7 @@ import void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, int32 *x); import void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x); import void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); import void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int32 *x); +import void Files_ReadNum64 (Files_Rider *R, LONGINT *R__typ, int64 *x); import void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x); import void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x); import void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); @@ -61,6 +62,7 @@ import void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, int16 x); import void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, int32 x); import void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x); import void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int32 x); +import void Files_WriteNum64 (Files_Rider *R, LONGINT *R__typ, int64 x); import void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x); import void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x); import void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index 90e93aed..47f2de21 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -12,7 +12,7 @@ export void (*OPB_typSize)(OPT_Struct); static int16 OPB_exp; -static int32 OPB_maxExp; +static int64 OPB_maxExp; export void OPB_Assign (OPT_Node *x, OPT_Node y); @@ -38,14 +38,14 @@ export void OPB_Field (OPT_Node *x, OPT_Object y); export void OPB_In (OPT_Node *x, OPT_Node y); export void OPB_Index (OPT_Node *x, OPT_Node y); export void OPB_Inittd (OPT_Node *inittd, OPT_Node *last, OPT_Struct typ); -static BOOLEAN OPB_IntToBool (int32 i); +static BOOLEAN OPB_IntToBool (int64 i); export void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y); export void OPB_MOp (int8 op, OPT_Node *x); export OPT_Node OPB_NewBoolConst (BOOLEAN boolval); -export OPT_Node OPB_NewIntConst (int32 intval); +export OPT_Node OPB_NewIntConst (int64 intval); export OPT_Node OPB_NewLeaf (OPT_Object obj); export OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ); -export OPT_Node OPB_NewString (OPS_String str, int32 len); +export OPT_Node OPB_NewString (OPS_String str, int64 len); export OPT_Node OPB_Nil (void); static BOOLEAN OPB_NotVar (OPT_Node x); export void OPB_Op (int8 op, OPT_Node *x, OPT_Node y); @@ -63,7 +63,7 @@ export void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n); export void OPB_StaticLink (int8 dlev); export void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard); static void OPB_err (int16 n); -static int32 OPB_log (int32 x); +static int64 OPB_log (int64 x); static void OPB_err (int16 n) @@ -141,17 +141,11 @@ static int32 OPB_BoolToInt (BOOLEAN b) __RETCHK; } -static BOOLEAN OPB_IntToBool (int32 i) +static BOOLEAN OPB_IntToBool (int64 i) { BOOLEAN _o_result; - if (i == 0) { - _o_result = 0; - return _o_result; - } else { - _o_result = 1; - return _o_result; - } - __RETCHK; + _o_result = i != 0; + return _o_result; } OPT_Node OPB_NewBoolConst (BOOLEAN boolval) @@ -228,7 +222,7 @@ OPT_Node OPB_EmptySet (void) static void OPB_SetIntType (OPT_Node node) { int16 b; - int32 n; + int64 n; if (node->conval->intval >= 0) { n = node->conval->intval; } else { @@ -241,7 +235,7 @@ static void OPB_SetIntType (OPT_Node node) node->typ = OPT_IntType(b); } -OPT_Node OPB_NewIntConst (int32 intval) +OPT_Node OPB_NewIntConst (int64 intval) { OPT_Node _o_result; OPT_Node x = NIL; @@ -266,7 +260,7 @@ OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ) return _o_result; } -OPT_Node OPB_NewString (OPS_String str, int32 len) +OPT_Node OPB_NewString (OPS_String str, int64 len) { OPT_Node _o_result; OPT_Node x = NIL; @@ -274,7 +268,7 @@ OPT_Node OPB_NewString (OPS_String str, int32 len) x->conval = OPT_NewConst(); x->typ = OPT_stringtyp; x->conval->intval = -1; - x->conval->intval2 = len; + x->conval->intval2 = OPM_Longint(len); x->conval->ext = OPT_NewExt(); __COPY(str, *x->conval->ext, 256); _o_result = x; @@ -351,7 +345,7 @@ void OPB_Index (OPT_Node *x, OPT_Node y) } if ((*x)->typ->comp == 2) { typ = (*x)->typ->BaseTyp; - if ((y->class == 7 && (y->conval->intval < 0 || y->conval->intval >= (*x)->typ->n))) { + if ((y->class == 7 && (y->conval->intval < 0 || y->conval->intval >= (int64)(*x)->typ->n))) { OPB_err(81); } } else if ((*x)->typ->comp == 3) { @@ -466,14 +460,14 @@ void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) void OPB_In (OPT_Node *x, OPT_Node y) { int16 f; - int32 k; + int64 k; f = (*x)->typ->form; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); } else if ((f == 4 && y->typ->form == 7)) { if ((*x)->class == 7) { k = (*x)->conval->intval; - if (k < 0 || k > OPM_MaxSet) { + if (k < 0 || k > (int64)OPM_MaxSet) { OPB_err(202); } else if (y->class == 7) { (*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval, 32)); @@ -492,9 +486,9 @@ void OPB_In (OPT_Node *x, OPT_Node y) (*x)->typ = OPT_booltyp; } -static int32 OPB_log (int32 x) +static int64 OPB_log (int64 x) { - int32 _o_result; + int64 _o_result; OPB_exp = 0; if (x > 0) { while (!__ODD(x)) { @@ -580,7 +574,7 @@ void OPB_MOp (int8 op, OPT_Node *x) if (__IN(f, 0xf0, 32)) { if (z->class == 7) { if (f == 4) { - if (z->conval->intval == (-2147483647-1)) { + if (z->conval->intval == (-9223372036854775807-1)) { OPB_err(203); } else { z->conval->intval = -z->conval->intval; @@ -603,7 +597,7 @@ void OPB_MOp (int8 op, OPT_Node *x) if (__IN(f, 0x70, 32)) { if (z->class == 7) { if (f == 4) { - if (z->conval->intval == (-2147483647-1)) { + if (z->conval->intval == (-9223372036854775807-1)) { OPB_err(203); } else { z->conval->intval = __ABS(z->conval->intval); @@ -845,7 +839,7 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) { int16 f, g; OPT_Const xval = NIL, yval = NIL; - int32 xv, yv; + int64 xv, yv; BOOLEAN temp; struct ConstOp__13 _s; _s.x = &x; @@ -1007,7 +1001,7 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) case 4: if (f == 4) { if (yval->intval != 0) { - xval->intval = (int)__MOD(xval->intval, yval->intval); + xval->intval = __MOD(xval->intval, yval->intval); OPB_SetIntType(x); } else { OPB_err(205); @@ -1122,7 +1116,7 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) { OPT_Node node = NIL; int16 f, g; - int32 k; + int64 k; LONGREAL r; f = (*x)->typ->form; g = typ->form; @@ -1229,7 +1223,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) OPT_Node t = NIL, z = NIL; OPT_Struct typ = NIL; BOOLEAN do_; - int32 val; + int64 val; struct Op__38 _s; _s.f = &f; _s.g = &g; @@ -1500,19 +1494,19 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) void OPB_SetRange (OPT_Node *x, OPT_Node y) { - int32 k, l; + int64 k, l; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); } else if (((*x)->typ->form == 4 && y->typ->form == 4)) { if ((*x)->class == 7) { k = (*x)->conval->intval; - if (0 > k || k > OPM_MaxSet) { + if (0 > k || k > (int64)OPM_MaxSet) { OPB_err(202); } } if (y->class == 7) { l = y->conval->intval; - if (0 > l || l > OPM_MaxSet) { + if (0 > l || l > (int64)OPM_MaxSet) { OPB_err(202); } } @@ -1535,14 +1529,14 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y) void OPB_SetElem (OPT_Node *x) { - int32 k; + int64 k; if ((*x)->class == 8 || (*x)->class == 9) { OPB_err(126); } else if ((*x)->typ->form != 4) { OPB_err(93); } else if ((*x)->class == 7) { k = (*x)->conval->intval; - if ((0 <= k && k <= OPM_MaxSet)) { + if ((0 <= k && k <= (int64)OPM_MaxSet)) { (*x)->conval->setval = __SETOF(k,32); } else { OPB_err(202); @@ -1917,7 +1911,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (f == 4) { - if (x->typ->size != OPT_linttyp->size) { + if (x->typ->size < OPT_linttyp->size) { OPB_Convert(&x, OPT_linttyp); } } else { @@ -2055,7 +2049,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (f == 4) { - if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > OPM_MaxSet))) { + if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > (int64)OPM_MaxSet))) { OPB_err(202); } p = NewOp__53(19, fctno, p, x); @@ -2068,7 +2062,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) if (!(f == 4) || x->class != 7) { OPB_err(69); } else if (x->typ->size == 1) { - L = (int16)x->conval->intval; + L = OPM_Integer(x->conval->intval); typ = p->typ; while ((L > 0 && __IN(typ->comp, 0x0c, 32))) { typ = typ->BaseTyp; @@ -2120,8 +2114,8 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) OPB_err(208); p->conval->intval = 1; } else if (x->conval->intval >= 0) { - if (__ABS(p->conval->intval) <= __DIV(2147483647, __ASH(1, x->conval->intval))) { - p->conval->intval = p->conval->intval * __ASH(1, x->conval->intval); + if (__ABS(p->conval->intval) <= __DIV(9223372036854775807, (int64)__ASH(1, x->conval->intval))) { + p->conval->intval = p->conval->intval * (int64)__ASH(1, x->conval->intval); } else { OPB_err(208); p->conval->intval = 1; @@ -2132,7 +2126,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) p->obj = NIL; } else { p = NewOp__53(12, 17, p, x); - p->typ = OPT_linttyp; + p->typ = p->left->typ; } } else { OPB_err(111); @@ -2143,7 +2137,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) OPB_err(126); } else if (p->typ->comp == 3) { if (f == 4) { - if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > OPM_MaxIndex))) { + if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > (int64)OPM_MaxIndex))) { OPB_err(63); } } else { @@ -2281,7 +2275,7 @@ void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n) } else if (p->typ->comp != 3) { OPB_err(64); } else if (f == 4) { - if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > OPM_MaxIndex))) { + if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > (int64)OPM_MaxIndex))) { OPB_err(63); } node = p->right; @@ -2622,7 +2616,7 @@ export void *OPB__init(void) __MODULE_IMPORT(OPT); __REGMOD("OPB", 0); /* BEGIN */ - OPB_maxExp = OPB_log(1073741824); + OPB_maxExp = OPB_log(4611686018427387904); OPB_maxExp = OPB_exp; __ENDMOD; } diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index 183a5f32..08d025bf 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -25,10 +25,10 @@ import void OPB_Inittd (OPT_Node *inittd, OPT_Node *last, OPT_Struct typ); import void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y); import void OPB_MOp (int8 op, OPT_Node *x); import OPT_Node OPB_NewBoolConst (BOOLEAN boolval); -import OPT_Node OPB_NewIntConst (int32 intval); +import OPT_Node OPB_NewIntConst (int64 intval); import OPT_Node OPB_NewLeaf (OPT_Object obj); import OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ); -import OPT_Node OPB_NewString (OPS_String str, int32 len); +import OPT_Node OPB_NewString (OPS_String str, int64 len); import OPT_Node OPB_Nil (void); import void OPB_Op (int8 op, OPT_Node *x, OPT_Node y); import void OPB_OptIf (OPT_Node *x); diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 17690465..c21e44a4 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -26,8 +26,8 @@ export OPT_Object OPC_BaseTProc (OPT_Object obj); export void OPC_BegBlk (void); export void OPC_BegStat (void); static void OPC_CProcDefs (OPT_Object obj, int16 vis); -export void OPC_Case (int32 caseVal, int16 form); -static void OPC_CharacterLiteral (int32 c); +export void OPC_Case (int64 caseVal, int16 form); +static void OPC_CharacterLiteral (int64 c); export void OPC_Cmp (int16 rel); export void OPC_CompleteIdent (OPT_Object obj); export void OPC_Constant (OPT_Const con, int16 form); @@ -67,8 +67,8 @@ static void OPC_InitImports (OPT_Object obj); static void OPC_InitKeywords (void); export void OPC_InitTDesc (OPT_Struct typ); static void OPC_InitTProcs (OPT_Object typ, OPT_Object obj); -export void OPC_IntLiteral (int32 n, int32 size); -export void OPC_Len (OPT_Object obj, OPT_Struct array, int32 dim); +export void OPC_IntLiteral (int64 n, int32 size); +export void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim); static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName); static int16 OPC_Length (CHAR *s, LONGINT s__len); export int32 OPC_NofPtrs (OPT_Struct typ); @@ -1851,7 +1851,7 @@ void OPC_Cmp (int16 rel) } } -static void OPC_CharacterLiteral (int32 c) +static void OPC_CharacterLiteral (int64 c) { if (c < 32 || c > 126) { OPM_WriteString((CHAR*)"0x", 3); @@ -1894,7 +1894,7 @@ static void OPC_StringLiteral (CHAR *s, LONGINT s__len, int32 l) __DEL(s); } -void OPC_Case (int32 caseVal, int16 form) +void OPC_Case (int64 caseVal, int16 form) { CHAR ch; OPM_WriteString((CHAR*)"case ", 6); @@ -1937,7 +1937,7 @@ void OPC_Halt (int32 n) OPC_Str1((CHAR*)"__HALT(#)", 10, n); } -void OPC_IntLiteral (int32 n, int32 size) +void OPC_IntLiteral (int64 n, int32 size) { if ((((size > 4 && n <= 2147483647)) && n > (-2147483647-1))) { OPM_WriteString((CHAR*)"((int", 6); @@ -1950,7 +1950,7 @@ void OPC_IntLiteral (int32 n, int32 size) } } -void OPC_Len (OPT_Object obj, OPT_Struct array, int32 dim) +void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim) { if (array->comp == 3) { OPC_CompleteIdent(obj); diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index 34d9ebc2..9e1ec652 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -15,7 +15,7 @@ import int32 OPC_BaseAlignment (OPT_Struct typ); import OPT_Object OPC_BaseTProc (OPT_Object obj); import void OPC_BegBlk (void); import void OPC_BegStat (void); -import void OPC_Case (int32 caseVal, int16 form); +import void OPC_Case (int64 caseVal, int16 form); import void OPC_Cmp (int16 rel); import void OPC_CompleteIdent (OPT_Object obj); import void OPC_Constant (OPT_Const con, int16 form); @@ -37,8 +37,8 @@ import void OPC_Increment (BOOLEAN decrement); import void OPC_Indent (int16 count); import void OPC_Init (void); import void OPC_InitTDesc (OPT_Struct typ); -import void OPC_IntLiteral (int32 n, int32 size); -import void OPC_Len (OPT_Object obj, OPT_Struct array, int32 dim); +import void OPC_IntLiteral (int64 n, int32 size); +import void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim); import int32 OPC_NofPtrs (OPT_Struct typ); import void OPC_SetInclude (BOOLEAN exclude); import int32 OPC_SizeAlignment (int32 size); diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 18478d1e..ba86c00a 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -28,7 +28,8 @@ export int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; export CHAR OPM_modName[32]; export CHAR OPM_objname[64]; export SET OPM_opt, OPM_glbopt; -static int32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; +static int32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber; +static int64 OPM_lasterrpos; static Texts_Reader OPM_inR; static Texts_Text OPM_Log; static Texts_Writer OPM_W; @@ -45,46 +46,49 @@ static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F); export void OPM_CloseFiles (void); export void OPM_CloseOldSym (void); export void OPM_DeleteNewSym (void); -export void OPM_FPrint (int32 *fp, int32 val); +export void OPM_FPrint (int32 *fp, int64 val); export void OPM_FPrintLReal (int32 *fp, LONGREAL lr); export void OPM_FPrintReal (int32 *fp, REAL real); export void OPM_FPrintSet (int32 *fp, SET set); -static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, int32 pos); +static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, int64 pos); export void OPM_Get (CHAR *ch); static void OPM_GetProperties (void); static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONGINT name__len, int16 *size, int16 *align); export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); export void OPM_InitOptions (void); +export int16 OPM_Integer (int64 n); static void OPM_LogErrMsg (int16 n); export void OPM_LogW (CHAR ch); export void OPM_LogWLn (void); -export void OPM_LogWNum (int32 i, int32 len); +export void OPM_LogWNum (int64 i, int64 len); export void OPM_LogWStr (CHAR *s, LONGINT s__len); +export int32 OPM_Longint (int64 n); static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len); -export void OPM_Mark (int16 n, int32 pos); +export void OPM_Mark (int16 n, int64 pos); export void OPM_NewSym (CHAR *modName, LONGINT modName__len); export void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); export void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); export BOOLEAN OPM_OpenPar (void); export void OPM_RegisterNewSym (void); static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt); -static void OPM_ShowLine (int32 pos); +static void OPM_ShowLine (int64 pos); export int32 OPM_SignedMaximum (int32 bytecount); export int32 OPM_SignedMinimum (int32 bytecount); export void OPM_SymRCh (CHAR *ch); export int32 OPM_SymRInt (void); +export int64 OPM_SymRInt64 (void); export void OPM_SymRLReal (LONGREAL *lr); export void OPM_SymRReal (REAL *r); export void OPM_SymRSet (SET *s); export void OPM_SymWCh (CHAR ch); -export void OPM_SymWInt (int32 i); +export void OPM_SymWInt (int64 i); export void OPM_SymWLReal (LONGREAL lr); export void OPM_SymWReal (REAL r); export void OPM_SymWSet (SET s); static void OPM_VerboseListSizes (void); export void OPM_Write (CHAR ch); -export void OPM_WriteHex (int32 i); -export void OPM_WriteInt (int32 i); +export void OPM_WriteHex (int64 i); +export void OPM_WriteInt (int64 i); export void OPM_WriteLn (void); export void OPM_WriteReal (LONGREAL r, CHAR suffx); export void OPM_WriteString (CHAR *s, LONGINT s__len); @@ -107,7 +111,7 @@ void OPM_LogWStr (CHAR *s, LONGINT s__len) __DEL(s); } -void OPM_LogWNum (int32 i, int32 len) +void OPM_LogWNum (int64 i, int64 len) { Console_Int(i, len); } @@ -117,6 +121,20 @@ void OPM_LogWLn (void) Console_Ln(); } +int32 OPM_Longint (int64 n) +{ + int32 _o_result; + _o_result = __VAL(int32, n); + return _o_result; +} + +int16 OPM_Integer (int64 n) +{ + int16 _o_result; + _o_result = __VAL(int16, n); + return _o_result; +} + static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) { int16 i; @@ -404,21 +422,21 @@ static void OPM_LogErrMsg (int16 n) OPM_LogWStr(errors_errors[__X(n, 350)], 128); } -static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, int32 pos) +static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, int64 pos) { CHAR ch, cheol; - if (pos < OPM_ErrorLineStartPos) { + if (pos < (int64)OPM_ErrorLineStartPos) { OPM_ErrorLineStartPos = 0; OPM_ErrorLineLimitPos = 0; OPM_ErrorLineNumber = 0; } - if (pos < OPM_ErrorLineLimitPos) { + if (pos < (int64)OPM_ErrorLineLimitPos) { Files_Set(&*r, r__typ, f, OPM_ErrorLineStartPos); return; } Files_Set(&*r, r__typ, f, OPM_ErrorLineLimitPos); Files_Read(&*r, r__typ, (void*)&ch); - while ((OPM_ErrorLineLimitPos < pos && !(*r).eof)) { + while (((int64)OPM_ErrorLineLimitPos < pos && !(*r).eof)) { OPM_ErrorLineStartPos = OPM_ErrorLineLimitPos; OPM_ErrorLineNumber += 1; while ((((ch != 0x00 && ch != 0x0d)) && ch != 0x0a)) { @@ -436,7 +454,7 @@ static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, int32 p Files_Set(&*r, r__typ, f, OPM_ErrorLineStartPos); } -static void OPM_ShowLine (int32 pos) +static void OPM_ShowLine (int64 pos) { Files_File f = NIL; Files_Rider r; @@ -460,10 +478,10 @@ static void OPM_ShowLine (int32 pos) OPM_LogWStr(line, 1023); OPM_LogWLn(); OPM_LogWStr((CHAR*)" ", 7); - if (pos >= OPM_ErrorLineLimitPos) { + if (pos >= (int64)OPM_ErrorLineLimitPos) { pos = OPM_ErrorLineLimitPos - 1; } - i = (int16)(pos - OPM_ErrorLineStartPos); + i = (int16)OPM_Longint(pos - (int64)OPM_ErrorLineStartPos); while (i > 0) { OPM_LogW(' '); i -= 1; @@ -478,7 +496,7 @@ static void OPM_ShowLine (int32 pos) Files_Close(f); } -void OPM_Mark (int16 n, int32 pos) +void OPM_Mark (int16 n, int64 pos) { if (pos == -1) { pos = 0; @@ -535,9 +553,9 @@ void OPM_err (int16 n) OPM_Mark(n, OPM_errpos); } -void OPM_FPrint (int32 *fp, int32 val) +void OPM_FPrint (int32 *fp, int64 val) { - *fp = __ROTL((int32)((SET)*fp ^ (SET)val), 1, 32); + *fp = __ROTL((int32)((SET)*fp ^ __VAL(SET, val)), 1, 32); } void OPM_FPrintSet (int32 *fp, SET set) @@ -702,6 +720,15 @@ int32 OPM_SymRInt (void) return _o_result; } +int64 OPM_SymRInt64 (void) +{ + int64 _o_result; + int64 k; + Files_ReadNum64(&OPM_oldSF, Files_Rider__typ, &k); + _o_result = k; + return _o_result; +} + void OPM_SymRSet (SET *s) { Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (int32*)&*s); @@ -751,9 +778,9 @@ void OPM_SymWCh (CHAR ch) Files_Write(&OPM_newSF, Files_Rider__typ, ch); } -void OPM_SymWInt (int32 i) +void OPM_SymWInt (int64 i) { - Files_WriteNum(&OPM_newSF, Files_Rider__typ, i); + Files_WriteNum64(&OPM_newSF, Files_Rider__typ, i); } void OPM_SymWSet (SET s) @@ -820,17 +847,17 @@ void OPM_WriteStringVar (CHAR *s, LONGINT s__len) Files_WriteBytes(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, (void*)s, s__len * 1, i); } -void OPM_WriteHex (int32 i) +void OPM_WriteHex (int64 i) { CHAR s[3]; - int16 digit; - digit = __ASHR((int16)i, 4); + int32 digit; + digit = __ASHR((int32)i, 4); if (digit < 10) { s[0] = (CHAR)(48 + digit); } else { s[0] = (CHAR)(87 + digit); } - digit = __MASK((int16)i, -16); + digit = __MASK((int32)i, -16); if (digit < 10) { s[1] = (CHAR)(48 + digit); } else { @@ -840,31 +867,31 @@ void OPM_WriteHex (int32 i) OPM_WriteString(s, 3); } -void OPM_WriteInt (int32 i) +void OPM_WriteInt (int64 i) { - CHAR s[20]; - int32 i1, k; - if (i == OPM_SignedMinimum(OPM_IntSize) || i == OPM_SignedMinimum(OPM_LIntSize)) { + CHAR s[24]; + int64 i1, k; + if ((i == (int64)OPM_SignedMinimum(OPM_IntSize) || i == (int64)OPM_SignedMinimum(OPM_LIntSize)) || i == (int64)OPM_SignedMinimum(8)) { OPM_Write('('); OPM_WriteInt(i + 1); OPM_WriteString((CHAR*)"-1)", 4); } else { i1 = __ABS(i); - s[0] = (CHAR)((int)__MOD(i1, 10) + 48); + s[0] = (CHAR)(__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k = 1; while (i1 > 0) { - s[__X(k, 20)] = (CHAR)((int)__MOD(i1, 10) + 48); + s[__X(k, 24)] = (CHAR)(__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k += 1; } if (i < 0) { - s[__X(k, 20)] = '-'; + s[__X(k, 24)] = '-'; k += 1; } while (k > 0) { k -= 1; - OPM_Write(s[__X(k, 20)]); + OPM_Write(s[__X(k, 24)]); } } } diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index a36522a1..504519da 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -21,18 +21,20 @@ import BOOLEAN OPM_dontAsm, OPM_dontLink, OPM_mainProg, OPM_mainLinkStat, OPM_no import void OPM_CloseFiles (void); import void OPM_CloseOldSym (void); import void OPM_DeleteNewSym (void); -import void OPM_FPrint (int32 *fp, int32 val); +import void OPM_FPrint (int32 *fp, int64 val); import void OPM_FPrintLReal (int32 *fp, LONGREAL lr); import void OPM_FPrintReal (int32 *fp, REAL real); import void OPM_FPrintSet (int32 *fp, SET set); import void OPM_Get (CHAR *ch); import void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); import void OPM_InitOptions (void); +import int16 OPM_Integer (int64 n); import void OPM_LogW (CHAR ch); import void OPM_LogWLn (void); -import void OPM_LogWNum (int32 i, int32 len); +import void OPM_LogWNum (int64 i, int64 len); import void OPM_LogWStr (CHAR *s, LONGINT s__len); -import void OPM_Mark (int16 n, int32 pos); +import int32 OPM_Longint (int64 n); +import void OPM_Mark (int16 n, int64 pos); import void OPM_NewSym (CHAR *modName, LONGINT modName__len); import void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); import void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); @@ -42,17 +44,18 @@ import int32 OPM_SignedMaximum (int32 bytecount); import int32 OPM_SignedMinimum (int32 bytecount); import void OPM_SymRCh (CHAR *ch); import int32 OPM_SymRInt (void); +import int64 OPM_SymRInt64 (void); import void OPM_SymRLReal (LONGREAL *lr); import void OPM_SymRReal (REAL *r); import void OPM_SymRSet (SET *s); import void OPM_SymWCh (CHAR ch); -import void OPM_SymWInt (int32 i); +import void OPM_SymWInt (int64 i); import void OPM_SymWLReal (LONGREAL lr); import void OPM_SymWReal (REAL r); import void OPM_SymWSet (SET s); import void OPM_Write (CHAR ch); -import void OPM_WriteHex (int32 i); -import void OPM_WriteInt (int32 i); +import void OPM_WriteHex (int64 i); +import void OPM_WriteInt (int64 i); import void OPM_WriteLn (void); import void OPM_WriteReal (LONGREAL r, CHAR suffx); import void OPM_WriteString (CHAR *s, LONGINT s__len); diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index 8db5ef60..44ce8ff1 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -134,7 +134,7 @@ static void OPP_CheckMark (int8 *vis) static void OPP_CheckSysFlag (int16 *sysflag, int16 default_) { OPT_Node x = NIL; - int32 sf; + int64 sf; if (OPP_sym == 31) { OPS_Get(&OPP_sym); if (!OPT_SYSimported) { @@ -151,7 +151,7 @@ static void OPP_CheckSysFlag (int16 *sysflag, int16 default_) OPP_err(51); sf = 0; } - *sysflag = (int16)sf; + *sysflag = OPM_Integer(sf); OPP_CheckSym(23); } else { *sysflag = default_; @@ -254,7 +254,7 @@ static void OPP_RecordType (OPT_Struct *typ, OPT_Struct *banned) static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) { OPT_Node x = NIL; - int32 n; + int64 n; int16 sysflag; OPP_CheckSysFlag(&sysflag, 0); if (OPP_sym == 25) { @@ -275,7 +275,7 @@ static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) OPP_ConstExpression(&x); if (x->typ->form == 4) { n = x->conval->intval; - if (n <= 0 || n > OPM_MaxIndex) { + if (n <= 0 || n > (int64)OPM_MaxIndex) { OPP_err(63); n = 1; } @@ -283,7 +283,7 @@ static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) OPP_err(51); n = 1; } - (*typ)->n = n; + (*typ)->n = OPM_Longint(n); if (OPP_sym == 25) { OPS_Get(&OPP_sym); OPP_Type(&(*typ)->BaseTyp, &*banned); @@ -932,7 +932,7 @@ static void GetCode__19 (void) { OPT_ConstExt ext = NIL; int16 n; - int32 c; + int64 c; ext = OPT_NewExt(); (*ProcedureDeclaration__16_s->proc)->conval->ext = ext; n = 0; @@ -1179,7 +1179,7 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int16 *n, OPP OPP_ConstExpression(&x); f = x->typ->form; if (__IN(f, 0x18, 32)) { - xval = x->conval->intval; + xval = OPM_Longint(x->conval->intval); } else { OPP_err(61); xval = 1; @@ -1194,7 +1194,7 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int16 *n, OPP if (OPP_sym == 21) { OPS_Get(&OPP_sym); OPP_ConstExpression(&y); - yval = y->conval->intval; + yval = OPM_Longint(y->conval->intval); if (((int16)y->typ->form != f && !((f == 4 && y->typ->form == 4)))) { OPP_err(60); } diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index fb0f2237..f80ca2b1 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -17,7 +17,7 @@ typedef export OPS_Name OPS_name; export OPS_String OPS_str; export int16 OPS_numtyp; -export int32 OPS_intval; +export int64 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) + Ord__7(dig[i], 1); + OPS_intval = __ASHL(OPS_intval, 4) + (int64)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) + Ord__7(dig[i], 1); + OPS_intval = __ASHL(OPS_intval, 4) + (int64)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 ((int64)OPS_intval <= __DIV(9223372036854775807 - (int64)d, 10)) { - OPS_intval = OPS_intval * 10 + d; + if (OPS_intval <= __DIV(9223372036854775807 - (int64)d, 10)) { + OPS_intval = OPS_intval * 10 + (int64)d; } else { OPS_err(203); } diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index d2b5dfb4..d33103c1 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -15,7 +15,7 @@ typedef import OPS_Name OPS_name; import OPS_String OPS_str; import int16 OPS_numtyp; -import int32 OPS_intval; +import int64 OPS_intval; import REAL OPS_realval; import LONGREAL OPS_lrlval; diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 83a2652b..fa5401ee 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -17,7 +17,8 @@ typedef typedef struct OPT_ConstDesc { OPT_ConstExt ext; - int32 intval, intval2; + int64 intval; + int32 intval2; SET setval; LONGREAL realval; } OPT_ConstDesc; @@ -1838,7 +1839,7 @@ static void EnumPtrs(void (*P)(void*)) __ENUMR(&OPT_impCtxt, OPT_ImpCtxt__typ, 3140, 1, P); } -__TDESC(OPT_ConstDesc, 1, 1) = {__TDFLDS("ConstDesc", 24), {0, -8}}; +__TDESC(OPT_ConstDesc, 1, 1) = {__TDFLDS("ConstDesc", 32), {0, -8}}; __TDESC(OPT_ObjDesc, 1, 6) = {__TDFLDS("ObjDesc", 304), {0, 4, 8, 12, 284, 288, -28}}; __TDESC(OPT_StrDesc, 1, 3) = {__TDFLDS("StrDesc", 56), {44, 48, 52, -16}}; __TDESC(OPT_NodeDesc, 1, 6) = {__TDFLDS("NodeDesc", 28), {0, 4, 8, 16, 20, 24, -28}}; diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index d4b49da8..b6566702 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -15,7 +15,8 @@ typedef typedef struct OPT_ConstDesc { OPT_ConstExt ext; - int32 intval, intval2; + int64 intval; + int32 intval2; SET setval; LONGREAL realval; } OPT_ConstDesc; diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index a32351aa..cddb737c 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -36,10 +36,10 @@ static BOOLEAN OPV_ImplicitReturn (OPT_Node n); static void OPV_Index (OPT_Node n, OPT_Node d, int16 prec, int16 dim); export void OPV_Init (void); static void OPV_InitTDescs (OPT_Node n); -static void OPV_Len (OPT_Node n, int32 dim); +static void OPV_Len (OPT_Node n, int64 dim); export void OPV_Module (OPT_Node prog); static void OPV_NewArr (OPT_Node d, OPT_Node x); -static void OPV_ParIntLiteral (int32 n, int32 size); +static void OPV_ParIntLiteral (int64 n, int32 size); static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp); static BOOLEAN OPV_SideEffects (OPT_Node n); static void OPV_SizeCast (int32 from, int32 to); @@ -414,7 +414,7 @@ static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp __RETCHK; } -static void OPV_Len (OPT_Node n, int32 dim) +static void OPV_Len (OPT_Node n, int64 dim) { while ((n->class == 4 && n->typ->comp == 3)) { dim += 1; @@ -725,7 +725,7 @@ static void OPV_design (OPT_Node n, int16 prec) } } -static void OPV_ParIntLiteral (int32 n, int32 size) +static void OPV_ParIntLiteral (int64 n, int32 size) { if (OPV_ansi) { OPM_WriteInt(n); @@ -1210,7 +1210,7 @@ static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc) { OPT_Node switchCase = NIL, label = NIL; - int32 low, high; + int64 low, high; int16 form, i; OPM_WriteString((CHAR*)"switch ", 8); OPV_expr(n->left, 12); @@ -1351,7 +1351,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPV_ExitInfo saved; OPT_Node l = NIL, r = NIL; while ((n != NIL && OPM_noerr)) { - OPM_errpos = n->conval->intval; + OPM_errpos = OPM_Longint(n->conval->intval); if (n->class != 14) { OPC_BegStat(); } @@ -1625,7 +1625,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPV_IfStat(n, n->subcl == 0, outerProc); break; case 28: - OPC_Halt(n->right->conval->intval); + OPC_Halt(OPM_Longint(n->right->conval->intval)); break; default: OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, n^.class = ", 40); diff --git a/bootstrap/unix-88/Console.c b/bootstrap/unix-88/Console.c index f7769827..845cce11 100644 --- a/bootstrap/unix-88/Console.c +++ b/bootstrap/unix-88/Console.c @@ -62,7 +62,7 @@ void Console_Int (int64 i, int64 n) __MOVE("8085774586302733229", s, 20); k = 19; } else { - i1 = __ABS(i); + i1 = __ABS((int64)i); s[0] = (CHAR)(__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k = 1; diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 4c6982cc..2b23754f 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -90,6 +90,7 @@ export void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, int64 *x); export void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x); export void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); export void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int64 *x); +export void Files_ReadNum64 (Files_Rider *R, LONGINT *R__typ, int64 *x); export void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x); export void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x); export void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); @@ -105,6 +106,7 @@ export void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, int32 x); export void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, int64 x); export void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x); export void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int64 x); +export void Files_WriteNum64 (Files_Rider *R, LONGINT *R__typ, int64 x); export void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x); export void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x); export void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); @@ -936,6 +938,13 @@ void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int64 *x) *x = n; } +void Files_ReadNum64 (Files_Rider *R, LONGINT *R__typ, int64 *x) +{ + int64 n; + Files_ReadNum(&*R, R__typ, &n); + *x = n; +} + void Files_WriteBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN x) { Files_Write(&*R, R__typ, __VAL(CHAR, x)); @@ -1004,6 +1013,15 @@ void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int64 x) Files_Write(&*R, R__typ, (CHAR)__MASK(x, -128)); } +void Files_WriteNum64 (Files_Rider *R, LONGINT *R__typ, int64 x) +{ + while (x < -64 || x > 63) { + Files_Write(&*R, R__typ, (CHAR)(__MASK(x, -128) + 128)); + x = __ASHR(x, 7); + } + Files_Write(&*R, R__typ, (CHAR)__MASK(x, -128)); +} + void Files_GetName (Files_File f, CHAR *name, LONGINT name__len) { __COPY(f->workName, name, name__len); diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index a5641b0c..51065265 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -47,6 +47,7 @@ import void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, int64 *x); import void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x); import void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); import void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int64 *x); +import void Files_ReadNum64 (Files_Rider *R, LONGINT *R__typ, int64 *x); import void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x); import void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x); import void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); @@ -61,6 +62,7 @@ import void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, int32 x); import void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, int64 x); import void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x); import void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int64 x); +import void Files_WriteNum64 (Files_Rider *R, LONGINT *R__typ, int64 x); import void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x); import void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x); import void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index 2f005fc6..b271fa53 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -144,14 +144,8 @@ static int64 OPB_BoolToInt (BOOLEAN b) static BOOLEAN OPB_IntToBool (int64 i) { BOOLEAN _o_result; - if (i == 0) { - _o_result = 0; - return _o_result; - } else { - _o_result = 1; - return _o_result; - } - __RETCHK; + _o_result = i != 0; + return _o_result; } OPT_Node OPB_NewBoolConst (BOOLEAN boolval) @@ -274,7 +268,7 @@ OPT_Node OPB_NewString (OPS_String str, int64 len) x->conval = OPT_NewConst(); x->typ = OPT_stringtyp; x->conval->intval = -1; - x->conval->intval2 = len; + x->conval->intval2 = OPM_Longint(len); x->conval->ext = OPT_NewExt(); __COPY(str, *x->conval->ext, 256); _o_result = x; @@ -1917,7 +1911,7 @@ void OPB_StPar0 (OPT_Node *par0, int32 fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (f == 4) { - if (x->typ->size != OPT_linttyp->size) { + if (x->typ->size < OPT_linttyp->size) { OPB_Convert(&x, OPT_linttyp); } } else { @@ -2068,7 +2062,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) if (!(f == 4) || x->class != 7) { OPB_err(69); } else if (x->typ->size == 1) { - L = (int32)x->conval->intval; + L = OPM_Integer(x->conval->intval); typ = p->typ; while ((L > 0 && __IN(typ->comp, 0x0c, 64))) { typ = typ->BaseTyp; @@ -2132,7 +2126,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) p->obj = NIL; } else { p = NewOp__53(12, 17, p, x); - p->typ = OPT_linttyp; + p->typ = p->left->typ; } } else { OPB_err(111); diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 23017356..47c8a9be 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -55,11 +55,13 @@ static void OPM_GetProperties (void); static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONGINT name__len, int32 *size, int32 *align); export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); export void OPM_InitOptions (void); +export int32 OPM_Integer (int64 n); static void OPM_LogErrMsg (int32 n); export void OPM_LogW (CHAR ch); export void OPM_LogWLn (void); export void OPM_LogWNum (int64 i, int64 len); export void OPM_LogWStr (CHAR *s, LONGINT s__len); +export int64 OPM_Longint (int64 n); static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len); export void OPM_Mark (int32 n, int64 pos); export void OPM_NewSym (CHAR *modName, LONGINT modName__len); @@ -73,6 +75,7 @@ export int64 OPM_SignedMaximum (int64 bytecount); export int64 OPM_SignedMinimum (int64 bytecount); export void OPM_SymRCh (CHAR *ch); export int64 OPM_SymRInt (void); +export int64 OPM_SymRInt64 (void); export void OPM_SymRLReal (LONGREAL *lr); export void OPM_SymRReal (REAL *r); export void OPM_SymRSet (SET *s); @@ -117,6 +120,20 @@ void OPM_LogWLn (void) Console_Ln(); } +int64 OPM_Longint (int64 n) +{ + int64 _o_result; + _o_result = (int64)n; + return _o_result; +} + +int32 OPM_Integer (int64 n) +{ + int32 _o_result; + _o_result = __VAL(int32, n); + return _o_result; +} + static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) { int32 i; @@ -463,7 +480,7 @@ static void OPM_ShowLine (int64 pos) if (pos >= OPM_ErrorLineLimitPos) { pos = OPM_ErrorLineLimitPos - 1; } - i = (int32)(pos - OPM_ErrorLineStartPos); + i = (int32)OPM_Longint(pos - OPM_ErrorLineStartPos); while (i > 0) { OPM_LogW(' '); i -= 1; @@ -700,6 +717,15 @@ int64 OPM_SymRInt (void) return _o_result; } +int64 OPM_SymRInt64 (void) +{ + int64 _o_result; + int64 k; + Files_ReadNum64(&OPM_oldSF, Files_Rider__typ, &k); + _o_result = k; + return _o_result; +} + void OPM_SymRSet (SET *s) { Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (int64*)&*s); @@ -751,7 +777,7 @@ void OPM_SymWCh (CHAR ch) void OPM_SymWInt (int64 i) { - Files_WriteNum(&OPM_newSF, Files_Rider__typ, i); + Files_WriteNum64(&OPM_newSF, Files_Rider__typ, i); } void OPM_SymWSet (SET s) @@ -840,9 +866,9 @@ void OPM_WriteHex (int64 i) void OPM_WriteInt (int64 i) { - CHAR s[20]; + CHAR s[24]; int64 i1, k; - if (i == OPM_SignedMinimum(OPM_IntSize) || i == OPM_SignedMinimum(OPM_LIntSize)) { + if ((i == OPM_SignedMinimum(OPM_IntSize) || i == OPM_SignedMinimum(OPM_LIntSize)) || i == OPM_SignedMinimum(8)) { OPM_Write('('); OPM_WriteInt(i + 1); OPM_WriteString((CHAR*)"-1)", 4); @@ -852,17 +878,17 @@ void OPM_WriteInt (int64 i) i1 = __DIV(i1, 10); k = 1; while (i1 > 0) { - s[__X(k, 20)] = (CHAR)(__MOD(i1, 10) + 48); + s[__X(k, 24)] = (CHAR)(__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k += 1; } if (i < 0) { - s[__X(k, 20)] = '-'; + s[__X(k, 24)] = '-'; k += 1; } while (k > 0) { k -= 1; - OPM_Write(s[__X(k, 20)]); + OPM_Write(s[__X(k, 24)]); } } } diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index 7472bed7..9d977ff8 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -28,10 +28,12 @@ import void OPM_FPrintSet (int64 *fp, SET set); import void OPM_Get (CHAR *ch); import void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); import void OPM_InitOptions (void); +import int32 OPM_Integer (int64 n); import void OPM_LogW (CHAR ch); import void OPM_LogWLn (void); import void OPM_LogWNum (int64 i, int64 len); import void OPM_LogWStr (CHAR *s, LONGINT s__len); +import int64 OPM_Longint (int64 n); import void OPM_Mark (int32 n, int64 pos); import void OPM_NewSym (CHAR *modName, LONGINT modName__len); import void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); @@ -42,6 +44,7 @@ import int64 OPM_SignedMaximum (int64 bytecount); import int64 OPM_SignedMinimum (int64 bytecount); import void OPM_SymRCh (CHAR *ch); import int64 OPM_SymRInt (void); +import int64 OPM_SymRInt64 (void); import void OPM_SymRLReal (LONGREAL *lr); import void OPM_SymRReal (REAL *r); import void OPM_SymRSet (SET *s); diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index 63191e02..5150cdbe 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -151,7 +151,7 @@ static void OPP_CheckSysFlag (int32 *sysflag, int32 default_) OPP_err(51); sf = 0; } - *sysflag = (int32)sf; + *sysflag = OPM_Integer(sf); OPP_CheckSym(23); } else { *sysflag = default_; @@ -283,7 +283,7 @@ static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) OPP_err(51); n = 1; } - (*typ)->n = n; + (*typ)->n = OPM_Longint(n); if (OPP_sym == 25) { OPS_Get(&OPP_sym); OPP_Type(&(*typ)->BaseTyp, &*banned); @@ -1179,7 +1179,7 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int32 *n, OPP OPP_ConstExpression(&x); f = x->typ->form; if (__IN(f, 0x18, 64)) { - xval = x->conval->intval; + xval = OPM_Longint(x->conval->intval); } else { OPP_err(61); xval = 1; @@ -1194,7 +1194,7 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int32 *n, OPP if (OPP_sym == 21) { OPS_Get(&OPP_sym); OPP_ConstExpression(&y); - yval = y->conval->intval; + yval = OPM_Longint(y->conval->intval); if ((y->typ->form != f && !((f == 4 && y->typ->form == 4)))) { OPP_err(60); } diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 46abf128..04c24f09 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1351,7 +1351,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPV_ExitInfo saved; OPT_Node l = NIL, r = NIL; while ((n != NIL && OPM_noerr)) { - OPM_errpos = n->conval->intval; + OPM_errpos = OPM_Longint(n->conval->intval); if (n->class != 14) { OPC_BegStat(); } @@ -1625,7 +1625,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPV_IfStat(n, n->subcl == 0, outerProc); break; case 28: - OPC_Halt(n->right->conval->intval); + OPC_Halt(OPM_Longint(n->right->conval->intval)); break; default: OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, n^.class = ", 40); diff --git a/bootstrap/windows-48/Console.c b/bootstrap/windows-48/Console.c index f1978da4..ebbcbb49 100644 --- a/bootstrap/windows-48/Console.c +++ b/bootstrap/windows-48/Console.c @@ -16,7 +16,7 @@ export void Console_Bool (BOOLEAN b); export void Console_Char (CHAR ch); export void Console_Flush (void); export void Console_Hex (int32 i); -export void Console_Int (int32 i, int32 n); +export void Console_Int (int64 i, int64 n); export void Console_Ln (void); export void Console_Read (CHAR *ch); export void Console_ReadLine (CHAR *line, LONGINT line__len); @@ -54,15 +54,15 @@ void Console_String (CHAR *s, LONGINT s__len) __DEL(s); } -void Console_Int (int32 i, int32 n) +void Console_Int (int64 i, int64 n) { CHAR s[32]; int32 i1, k; - if (i == __LSHL(1, 31, 32)) { + if (i == (int64)__LSHL(1, 31, 32)) { __MOVE("8463847412", s, 11); k = 10; } else { - i1 = __ABS(i); + i1 = __ABS(__VAL(int32, i)); s[0] = (CHAR)((int)__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k = 1; @@ -76,7 +76,7 @@ void Console_Int (int32 i, int32 n) s[__X(k, 32)] = '-'; k += 1; } - while (n > k) { + while (n > (int64)k) { Console_Char(' '); n -= 1; } diff --git a/bootstrap/windows-48/Console.h b/bootstrap/windows-48/Console.h index cca2c91e..e5dc1566 100644 --- a/bootstrap/windows-48/Console.h +++ b/bootstrap/windows-48/Console.h @@ -12,7 +12,7 @@ import void Console_Bool (BOOLEAN b); import void Console_Char (CHAR ch); import void Console_Flush (void); import void Console_Hex (int32 i); -import void Console_Int (int32 i, int32 n); +import void Console_Int (int64 i, int64 n); import void Console_Ln (void); import void Console_Read (CHAR *ch); import void Console_ReadLine (CHAR *line, LONGINT line__len); diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 8c0d8fd5..25e50dd9 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -90,6 +90,7 @@ export void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, int32 *x); export void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x); export void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); export void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int32 *x); +export void Files_ReadNum64 (Files_Rider *R, LONGINT *R__typ, int64 *x); export void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x); export void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x); export void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); @@ -105,6 +106,7 @@ export void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, int16 x); export void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, int32 x); export void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x); export void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int32 x); +export void Files_WriteNum64 (Files_Rider *R, LONGINT *R__typ, int64 x); export void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x); export void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x); export void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); @@ -936,6 +938,13 @@ void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int32 *x) *x = n; } +void Files_ReadNum64 (Files_Rider *R, LONGINT *R__typ, int64 *x) +{ + int32 n; + Files_ReadNum(&*R, R__typ, &n); + *x = n; +} + void Files_WriteBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN x) { Files_Write(&*R, R__typ, __VAL(CHAR, x)); @@ -1004,6 +1013,15 @@ void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int32 x) Files_Write(&*R, R__typ, (CHAR)__MASK(x, -128)); } +void Files_WriteNum64 (Files_Rider *R, LONGINT *R__typ, int64 x) +{ + while (x < -64 || x > 63) { + Files_Write(&*R, R__typ, (CHAR)(__MASK(x, -128) + 128)); + x = __ASHR(x, 7); + } + Files_Write(&*R, R__typ, (CHAR)__MASK(x, -128)); +} + void Files_GetName (Files_File f, CHAR *name, LONGINT name__len) { __COPY(f->workName, name, name__len); diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index 4a28825a..b499ee0a 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -47,6 +47,7 @@ import void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, int32 *x); import void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x); import void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); import void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int32 *x); +import void Files_ReadNum64 (Files_Rider *R, LONGINT *R__typ, int64 *x); import void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x); import void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x); import void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); @@ -61,6 +62,7 @@ import void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, int16 x); import void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, int32 x); import void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x); import void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int32 x); +import void Files_WriteNum64 (Files_Rider *R, LONGINT *R__typ, int64 x); import void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x); import void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x); import void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index 90e93aed..47f2de21 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -12,7 +12,7 @@ export void (*OPB_typSize)(OPT_Struct); static int16 OPB_exp; -static int32 OPB_maxExp; +static int64 OPB_maxExp; export void OPB_Assign (OPT_Node *x, OPT_Node y); @@ -38,14 +38,14 @@ export void OPB_Field (OPT_Node *x, OPT_Object y); export void OPB_In (OPT_Node *x, OPT_Node y); export void OPB_Index (OPT_Node *x, OPT_Node y); export void OPB_Inittd (OPT_Node *inittd, OPT_Node *last, OPT_Struct typ); -static BOOLEAN OPB_IntToBool (int32 i); +static BOOLEAN OPB_IntToBool (int64 i); export void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y); export void OPB_MOp (int8 op, OPT_Node *x); export OPT_Node OPB_NewBoolConst (BOOLEAN boolval); -export OPT_Node OPB_NewIntConst (int32 intval); +export OPT_Node OPB_NewIntConst (int64 intval); export OPT_Node OPB_NewLeaf (OPT_Object obj); export OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ); -export OPT_Node OPB_NewString (OPS_String str, int32 len); +export OPT_Node OPB_NewString (OPS_String str, int64 len); export OPT_Node OPB_Nil (void); static BOOLEAN OPB_NotVar (OPT_Node x); export void OPB_Op (int8 op, OPT_Node *x, OPT_Node y); @@ -63,7 +63,7 @@ export void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n); export void OPB_StaticLink (int8 dlev); export void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard); static void OPB_err (int16 n); -static int32 OPB_log (int32 x); +static int64 OPB_log (int64 x); static void OPB_err (int16 n) @@ -141,17 +141,11 @@ static int32 OPB_BoolToInt (BOOLEAN b) __RETCHK; } -static BOOLEAN OPB_IntToBool (int32 i) +static BOOLEAN OPB_IntToBool (int64 i) { BOOLEAN _o_result; - if (i == 0) { - _o_result = 0; - return _o_result; - } else { - _o_result = 1; - return _o_result; - } - __RETCHK; + _o_result = i != 0; + return _o_result; } OPT_Node OPB_NewBoolConst (BOOLEAN boolval) @@ -228,7 +222,7 @@ OPT_Node OPB_EmptySet (void) static void OPB_SetIntType (OPT_Node node) { int16 b; - int32 n; + int64 n; if (node->conval->intval >= 0) { n = node->conval->intval; } else { @@ -241,7 +235,7 @@ static void OPB_SetIntType (OPT_Node node) node->typ = OPT_IntType(b); } -OPT_Node OPB_NewIntConst (int32 intval) +OPT_Node OPB_NewIntConst (int64 intval) { OPT_Node _o_result; OPT_Node x = NIL; @@ -266,7 +260,7 @@ OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ) return _o_result; } -OPT_Node OPB_NewString (OPS_String str, int32 len) +OPT_Node OPB_NewString (OPS_String str, int64 len) { OPT_Node _o_result; OPT_Node x = NIL; @@ -274,7 +268,7 @@ OPT_Node OPB_NewString (OPS_String str, int32 len) x->conval = OPT_NewConst(); x->typ = OPT_stringtyp; x->conval->intval = -1; - x->conval->intval2 = len; + x->conval->intval2 = OPM_Longint(len); x->conval->ext = OPT_NewExt(); __COPY(str, *x->conval->ext, 256); _o_result = x; @@ -351,7 +345,7 @@ void OPB_Index (OPT_Node *x, OPT_Node y) } if ((*x)->typ->comp == 2) { typ = (*x)->typ->BaseTyp; - if ((y->class == 7 && (y->conval->intval < 0 || y->conval->intval >= (*x)->typ->n))) { + if ((y->class == 7 && (y->conval->intval < 0 || y->conval->intval >= (int64)(*x)->typ->n))) { OPB_err(81); } } else if ((*x)->typ->comp == 3) { @@ -466,14 +460,14 @@ void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) void OPB_In (OPT_Node *x, OPT_Node y) { int16 f; - int32 k; + int64 k; f = (*x)->typ->form; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); } else if ((f == 4 && y->typ->form == 7)) { if ((*x)->class == 7) { k = (*x)->conval->intval; - if (k < 0 || k > OPM_MaxSet) { + if (k < 0 || k > (int64)OPM_MaxSet) { OPB_err(202); } else if (y->class == 7) { (*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval, 32)); @@ -492,9 +486,9 @@ void OPB_In (OPT_Node *x, OPT_Node y) (*x)->typ = OPT_booltyp; } -static int32 OPB_log (int32 x) +static int64 OPB_log (int64 x) { - int32 _o_result; + int64 _o_result; OPB_exp = 0; if (x > 0) { while (!__ODD(x)) { @@ -580,7 +574,7 @@ void OPB_MOp (int8 op, OPT_Node *x) if (__IN(f, 0xf0, 32)) { if (z->class == 7) { if (f == 4) { - if (z->conval->intval == (-2147483647-1)) { + if (z->conval->intval == (-9223372036854775807-1)) { OPB_err(203); } else { z->conval->intval = -z->conval->intval; @@ -603,7 +597,7 @@ void OPB_MOp (int8 op, OPT_Node *x) if (__IN(f, 0x70, 32)) { if (z->class == 7) { if (f == 4) { - if (z->conval->intval == (-2147483647-1)) { + if (z->conval->intval == (-9223372036854775807-1)) { OPB_err(203); } else { z->conval->intval = __ABS(z->conval->intval); @@ -845,7 +839,7 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) { int16 f, g; OPT_Const xval = NIL, yval = NIL; - int32 xv, yv; + int64 xv, yv; BOOLEAN temp; struct ConstOp__13 _s; _s.x = &x; @@ -1007,7 +1001,7 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) case 4: if (f == 4) { if (yval->intval != 0) { - xval->intval = (int)__MOD(xval->intval, yval->intval); + xval->intval = __MOD(xval->intval, yval->intval); OPB_SetIntType(x); } else { OPB_err(205); @@ -1122,7 +1116,7 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) { OPT_Node node = NIL; int16 f, g; - int32 k; + int64 k; LONGREAL r; f = (*x)->typ->form; g = typ->form; @@ -1229,7 +1223,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) OPT_Node t = NIL, z = NIL; OPT_Struct typ = NIL; BOOLEAN do_; - int32 val; + int64 val; struct Op__38 _s; _s.f = &f; _s.g = &g; @@ -1500,19 +1494,19 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) void OPB_SetRange (OPT_Node *x, OPT_Node y) { - int32 k, l; + int64 k, l; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); } else if (((*x)->typ->form == 4 && y->typ->form == 4)) { if ((*x)->class == 7) { k = (*x)->conval->intval; - if (0 > k || k > OPM_MaxSet) { + if (0 > k || k > (int64)OPM_MaxSet) { OPB_err(202); } } if (y->class == 7) { l = y->conval->intval; - if (0 > l || l > OPM_MaxSet) { + if (0 > l || l > (int64)OPM_MaxSet) { OPB_err(202); } } @@ -1535,14 +1529,14 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y) void OPB_SetElem (OPT_Node *x) { - int32 k; + int64 k; if ((*x)->class == 8 || (*x)->class == 9) { OPB_err(126); } else if ((*x)->typ->form != 4) { OPB_err(93); } else if ((*x)->class == 7) { k = (*x)->conval->intval; - if ((0 <= k && k <= OPM_MaxSet)) { + if ((0 <= k && k <= (int64)OPM_MaxSet)) { (*x)->conval->setval = __SETOF(k,32); } else { OPB_err(202); @@ -1917,7 +1911,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (f == 4) { - if (x->typ->size != OPT_linttyp->size) { + if (x->typ->size < OPT_linttyp->size) { OPB_Convert(&x, OPT_linttyp); } } else { @@ -2055,7 +2049,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (f == 4) { - if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > OPM_MaxSet))) { + if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > (int64)OPM_MaxSet))) { OPB_err(202); } p = NewOp__53(19, fctno, p, x); @@ -2068,7 +2062,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) if (!(f == 4) || x->class != 7) { OPB_err(69); } else if (x->typ->size == 1) { - L = (int16)x->conval->intval; + L = OPM_Integer(x->conval->intval); typ = p->typ; while ((L > 0 && __IN(typ->comp, 0x0c, 32))) { typ = typ->BaseTyp; @@ -2120,8 +2114,8 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) OPB_err(208); p->conval->intval = 1; } else if (x->conval->intval >= 0) { - if (__ABS(p->conval->intval) <= __DIV(2147483647, __ASH(1, x->conval->intval))) { - p->conval->intval = p->conval->intval * __ASH(1, x->conval->intval); + if (__ABS(p->conval->intval) <= __DIV(9223372036854775807, (int64)__ASH(1, x->conval->intval))) { + p->conval->intval = p->conval->intval * (int64)__ASH(1, x->conval->intval); } else { OPB_err(208); p->conval->intval = 1; @@ -2132,7 +2126,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) p->obj = NIL; } else { p = NewOp__53(12, 17, p, x); - p->typ = OPT_linttyp; + p->typ = p->left->typ; } } else { OPB_err(111); @@ -2143,7 +2137,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) OPB_err(126); } else if (p->typ->comp == 3) { if (f == 4) { - if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > OPM_MaxIndex))) { + if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > (int64)OPM_MaxIndex))) { OPB_err(63); } } else { @@ -2281,7 +2275,7 @@ void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n) } else if (p->typ->comp != 3) { OPB_err(64); } else if (f == 4) { - if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > OPM_MaxIndex))) { + if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > (int64)OPM_MaxIndex))) { OPB_err(63); } node = p->right; @@ -2622,7 +2616,7 @@ export void *OPB__init(void) __MODULE_IMPORT(OPT); __REGMOD("OPB", 0); /* BEGIN */ - OPB_maxExp = OPB_log(1073741824); + OPB_maxExp = OPB_log(4611686018427387904); OPB_maxExp = OPB_exp; __ENDMOD; } diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index 183a5f32..08d025bf 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -25,10 +25,10 @@ import void OPB_Inittd (OPT_Node *inittd, OPT_Node *last, OPT_Struct typ); import void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y); import void OPB_MOp (int8 op, OPT_Node *x); import OPT_Node OPB_NewBoolConst (BOOLEAN boolval); -import OPT_Node OPB_NewIntConst (int32 intval); +import OPT_Node OPB_NewIntConst (int64 intval); import OPT_Node OPB_NewLeaf (OPT_Object obj); import OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ); -import OPT_Node OPB_NewString (OPS_String str, int32 len); +import OPT_Node OPB_NewString (OPS_String str, int64 len); import OPT_Node OPB_Nil (void); import void OPB_Op (int8 op, OPT_Node *x, OPT_Node y); import void OPB_OptIf (OPT_Node *x); diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 17690465..c21e44a4 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -26,8 +26,8 @@ export OPT_Object OPC_BaseTProc (OPT_Object obj); export void OPC_BegBlk (void); export void OPC_BegStat (void); static void OPC_CProcDefs (OPT_Object obj, int16 vis); -export void OPC_Case (int32 caseVal, int16 form); -static void OPC_CharacterLiteral (int32 c); +export void OPC_Case (int64 caseVal, int16 form); +static void OPC_CharacterLiteral (int64 c); export void OPC_Cmp (int16 rel); export void OPC_CompleteIdent (OPT_Object obj); export void OPC_Constant (OPT_Const con, int16 form); @@ -67,8 +67,8 @@ static void OPC_InitImports (OPT_Object obj); static void OPC_InitKeywords (void); export void OPC_InitTDesc (OPT_Struct typ); static void OPC_InitTProcs (OPT_Object typ, OPT_Object obj); -export void OPC_IntLiteral (int32 n, int32 size); -export void OPC_Len (OPT_Object obj, OPT_Struct array, int32 dim); +export void OPC_IntLiteral (int64 n, int32 size); +export void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim); static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName); static int16 OPC_Length (CHAR *s, LONGINT s__len); export int32 OPC_NofPtrs (OPT_Struct typ); @@ -1851,7 +1851,7 @@ void OPC_Cmp (int16 rel) } } -static void OPC_CharacterLiteral (int32 c) +static void OPC_CharacterLiteral (int64 c) { if (c < 32 || c > 126) { OPM_WriteString((CHAR*)"0x", 3); @@ -1894,7 +1894,7 @@ static void OPC_StringLiteral (CHAR *s, LONGINT s__len, int32 l) __DEL(s); } -void OPC_Case (int32 caseVal, int16 form) +void OPC_Case (int64 caseVal, int16 form) { CHAR ch; OPM_WriteString((CHAR*)"case ", 6); @@ -1937,7 +1937,7 @@ void OPC_Halt (int32 n) OPC_Str1((CHAR*)"__HALT(#)", 10, n); } -void OPC_IntLiteral (int32 n, int32 size) +void OPC_IntLiteral (int64 n, int32 size) { if ((((size > 4 && n <= 2147483647)) && n > (-2147483647-1))) { OPM_WriteString((CHAR*)"((int", 6); @@ -1950,7 +1950,7 @@ void OPC_IntLiteral (int32 n, int32 size) } } -void OPC_Len (OPT_Object obj, OPT_Struct array, int32 dim) +void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim) { if (array->comp == 3) { OPC_CompleteIdent(obj); diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index 34d9ebc2..9e1ec652 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -15,7 +15,7 @@ import int32 OPC_BaseAlignment (OPT_Struct typ); import OPT_Object OPC_BaseTProc (OPT_Object obj); import void OPC_BegBlk (void); import void OPC_BegStat (void); -import void OPC_Case (int32 caseVal, int16 form); +import void OPC_Case (int64 caseVal, int16 form); import void OPC_Cmp (int16 rel); import void OPC_CompleteIdent (OPT_Object obj); import void OPC_Constant (OPT_Const con, int16 form); @@ -37,8 +37,8 @@ import void OPC_Increment (BOOLEAN decrement); import void OPC_Indent (int16 count); import void OPC_Init (void); import void OPC_InitTDesc (OPT_Struct typ); -import void OPC_IntLiteral (int32 n, int32 size); -import void OPC_Len (OPT_Object obj, OPT_Struct array, int32 dim); +import void OPC_IntLiteral (int64 n, int32 size); +import void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim); import int32 OPC_NofPtrs (OPT_Struct typ); import void OPC_SetInclude (BOOLEAN exclude); import int32 OPC_SizeAlignment (int32 size); diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 18478d1e..ba86c00a 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -28,7 +28,8 @@ export int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; export CHAR OPM_modName[32]; export CHAR OPM_objname[64]; export SET OPM_opt, OPM_glbopt; -static int32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; +static int32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber; +static int64 OPM_lasterrpos; static Texts_Reader OPM_inR; static Texts_Text OPM_Log; static Texts_Writer OPM_W; @@ -45,46 +46,49 @@ static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F); export void OPM_CloseFiles (void); export void OPM_CloseOldSym (void); export void OPM_DeleteNewSym (void); -export void OPM_FPrint (int32 *fp, int32 val); +export void OPM_FPrint (int32 *fp, int64 val); export void OPM_FPrintLReal (int32 *fp, LONGREAL lr); export void OPM_FPrintReal (int32 *fp, REAL real); export void OPM_FPrintSet (int32 *fp, SET set); -static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, int32 pos); +static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, int64 pos); export void OPM_Get (CHAR *ch); static void OPM_GetProperties (void); static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONGINT name__len, int16 *size, int16 *align); export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); export void OPM_InitOptions (void); +export int16 OPM_Integer (int64 n); static void OPM_LogErrMsg (int16 n); export void OPM_LogW (CHAR ch); export void OPM_LogWLn (void); -export void OPM_LogWNum (int32 i, int32 len); +export void OPM_LogWNum (int64 i, int64 len); export void OPM_LogWStr (CHAR *s, LONGINT s__len); +export int32 OPM_Longint (int64 n); static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len); -export void OPM_Mark (int16 n, int32 pos); +export void OPM_Mark (int16 n, int64 pos); export void OPM_NewSym (CHAR *modName, LONGINT modName__len); export void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); export void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); export BOOLEAN OPM_OpenPar (void); export void OPM_RegisterNewSym (void); static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt); -static void OPM_ShowLine (int32 pos); +static void OPM_ShowLine (int64 pos); export int32 OPM_SignedMaximum (int32 bytecount); export int32 OPM_SignedMinimum (int32 bytecount); export void OPM_SymRCh (CHAR *ch); export int32 OPM_SymRInt (void); +export int64 OPM_SymRInt64 (void); export void OPM_SymRLReal (LONGREAL *lr); export void OPM_SymRReal (REAL *r); export void OPM_SymRSet (SET *s); export void OPM_SymWCh (CHAR ch); -export void OPM_SymWInt (int32 i); +export void OPM_SymWInt (int64 i); export void OPM_SymWLReal (LONGREAL lr); export void OPM_SymWReal (REAL r); export void OPM_SymWSet (SET s); static void OPM_VerboseListSizes (void); export void OPM_Write (CHAR ch); -export void OPM_WriteHex (int32 i); -export void OPM_WriteInt (int32 i); +export void OPM_WriteHex (int64 i); +export void OPM_WriteInt (int64 i); export void OPM_WriteLn (void); export void OPM_WriteReal (LONGREAL r, CHAR suffx); export void OPM_WriteString (CHAR *s, LONGINT s__len); @@ -107,7 +111,7 @@ void OPM_LogWStr (CHAR *s, LONGINT s__len) __DEL(s); } -void OPM_LogWNum (int32 i, int32 len) +void OPM_LogWNum (int64 i, int64 len) { Console_Int(i, len); } @@ -117,6 +121,20 @@ void OPM_LogWLn (void) Console_Ln(); } +int32 OPM_Longint (int64 n) +{ + int32 _o_result; + _o_result = __VAL(int32, n); + return _o_result; +} + +int16 OPM_Integer (int64 n) +{ + int16 _o_result; + _o_result = __VAL(int16, n); + return _o_result; +} + static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) { int16 i; @@ -404,21 +422,21 @@ static void OPM_LogErrMsg (int16 n) OPM_LogWStr(errors_errors[__X(n, 350)], 128); } -static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, int32 pos) +static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, int64 pos) { CHAR ch, cheol; - if (pos < OPM_ErrorLineStartPos) { + if (pos < (int64)OPM_ErrorLineStartPos) { OPM_ErrorLineStartPos = 0; OPM_ErrorLineLimitPos = 0; OPM_ErrorLineNumber = 0; } - if (pos < OPM_ErrorLineLimitPos) { + if (pos < (int64)OPM_ErrorLineLimitPos) { Files_Set(&*r, r__typ, f, OPM_ErrorLineStartPos); return; } Files_Set(&*r, r__typ, f, OPM_ErrorLineLimitPos); Files_Read(&*r, r__typ, (void*)&ch); - while ((OPM_ErrorLineLimitPos < pos && !(*r).eof)) { + while (((int64)OPM_ErrorLineLimitPos < pos && !(*r).eof)) { OPM_ErrorLineStartPos = OPM_ErrorLineLimitPos; OPM_ErrorLineNumber += 1; while ((((ch != 0x00 && ch != 0x0d)) && ch != 0x0a)) { @@ -436,7 +454,7 @@ static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, int32 p Files_Set(&*r, r__typ, f, OPM_ErrorLineStartPos); } -static void OPM_ShowLine (int32 pos) +static void OPM_ShowLine (int64 pos) { Files_File f = NIL; Files_Rider r; @@ -460,10 +478,10 @@ static void OPM_ShowLine (int32 pos) OPM_LogWStr(line, 1023); OPM_LogWLn(); OPM_LogWStr((CHAR*)" ", 7); - if (pos >= OPM_ErrorLineLimitPos) { + if (pos >= (int64)OPM_ErrorLineLimitPos) { pos = OPM_ErrorLineLimitPos - 1; } - i = (int16)(pos - OPM_ErrorLineStartPos); + i = (int16)OPM_Longint(pos - (int64)OPM_ErrorLineStartPos); while (i > 0) { OPM_LogW(' '); i -= 1; @@ -478,7 +496,7 @@ static void OPM_ShowLine (int32 pos) Files_Close(f); } -void OPM_Mark (int16 n, int32 pos) +void OPM_Mark (int16 n, int64 pos) { if (pos == -1) { pos = 0; @@ -535,9 +553,9 @@ void OPM_err (int16 n) OPM_Mark(n, OPM_errpos); } -void OPM_FPrint (int32 *fp, int32 val) +void OPM_FPrint (int32 *fp, int64 val) { - *fp = __ROTL((int32)((SET)*fp ^ (SET)val), 1, 32); + *fp = __ROTL((int32)((SET)*fp ^ __VAL(SET, val)), 1, 32); } void OPM_FPrintSet (int32 *fp, SET set) @@ -702,6 +720,15 @@ int32 OPM_SymRInt (void) return _o_result; } +int64 OPM_SymRInt64 (void) +{ + int64 _o_result; + int64 k; + Files_ReadNum64(&OPM_oldSF, Files_Rider__typ, &k); + _o_result = k; + return _o_result; +} + void OPM_SymRSet (SET *s) { Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (int32*)&*s); @@ -751,9 +778,9 @@ void OPM_SymWCh (CHAR ch) Files_Write(&OPM_newSF, Files_Rider__typ, ch); } -void OPM_SymWInt (int32 i) +void OPM_SymWInt (int64 i) { - Files_WriteNum(&OPM_newSF, Files_Rider__typ, i); + Files_WriteNum64(&OPM_newSF, Files_Rider__typ, i); } void OPM_SymWSet (SET s) @@ -820,17 +847,17 @@ void OPM_WriteStringVar (CHAR *s, LONGINT s__len) Files_WriteBytes(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, (void*)s, s__len * 1, i); } -void OPM_WriteHex (int32 i) +void OPM_WriteHex (int64 i) { CHAR s[3]; - int16 digit; - digit = __ASHR((int16)i, 4); + int32 digit; + digit = __ASHR((int32)i, 4); if (digit < 10) { s[0] = (CHAR)(48 + digit); } else { s[0] = (CHAR)(87 + digit); } - digit = __MASK((int16)i, -16); + digit = __MASK((int32)i, -16); if (digit < 10) { s[1] = (CHAR)(48 + digit); } else { @@ -840,31 +867,31 @@ void OPM_WriteHex (int32 i) OPM_WriteString(s, 3); } -void OPM_WriteInt (int32 i) +void OPM_WriteInt (int64 i) { - CHAR s[20]; - int32 i1, k; - if (i == OPM_SignedMinimum(OPM_IntSize) || i == OPM_SignedMinimum(OPM_LIntSize)) { + CHAR s[24]; + int64 i1, k; + if ((i == (int64)OPM_SignedMinimum(OPM_IntSize) || i == (int64)OPM_SignedMinimum(OPM_LIntSize)) || i == (int64)OPM_SignedMinimum(8)) { OPM_Write('('); OPM_WriteInt(i + 1); OPM_WriteString((CHAR*)"-1)", 4); } else { i1 = __ABS(i); - s[0] = (CHAR)((int)__MOD(i1, 10) + 48); + s[0] = (CHAR)(__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k = 1; while (i1 > 0) { - s[__X(k, 20)] = (CHAR)((int)__MOD(i1, 10) + 48); + s[__X(k, 24)] = (CHAR)(__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k += 1; } if (i < 0) { - s[__X(k, 20)] = '-'; + s[__X(k, 24)] = '-'; k += 1; } while (k > 0) { k -= 1; - OPM_Write(s[__X(k, 20)]); + OPM_Write(s[__X(k, 24)]); } } } diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index a36522a1..504519da 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -21,18 +21,20 @@ import BOOLEAN OPM_dontAsm, OPM_dontLink, OPM_mainProg, OPM_mainLinkStat, OPM_no import void OPM_CloseFiles (void); import void OPM_CloseOldSym (void); import void OPM_DeleteNewSym (void); -import void OPM_FPrint (int32 *fp, int32 val); +import void OPM_FPrint (int32 *fp, int64 val); import void OPM_FPrintLReal (int32 *fp, LONGREAL lr); import void OPM_FPrintReal (int32 *fp, REAL real); import void OPM_FPrintSet (int32 *fp, SET set); import void OPM_Get (CHAR *ch); import void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); import void OPM_InitOptions (void); +import int16 OPM_Integer (int64 n); import void OPM_LogW (CHAR ch); import void OPM_LogWLn (void); -import void OPM_LogWNum (int32 i, int32 len); +import void OPM_LogWNum (int64 i, int64 len); import void OPM_LogWStr (CHAR *s, LONGINT s__len); -import void OPM_Mark (int16 n, int32 pos); +import int32 OPM_Longint (int64 n); +import void OPM_Mark (int16 n, int64 pos); import void OPM_NewSym (CHAR *modName, LONGINT modName__len); import void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); import void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); @@ -42,17 +44,18 @@ import int32 OPM_SignedMaximum (int32 bytecount); import int32 OPM_SignedMinimum (int32 bytecount); import void OPM_SymRCh (CHAR *ch); import int32 OPM_SymRInt (void); +import int64 OPM_SymRInt64 (void); import void OPM_SymRLReal (LONGREAL *lr); import void OPM_SymRReal (REAL *r); import void OPM_SymRSet (SET *s); import void OPM_SymWCh (CHAR ch); -import void OPM_SymWInt (int32 i); +import void OPM_SymWInt (int64 i); import void OPM_SymWLReal (LONGREAL lr); import void OPM_SymWReal (REAL r); import void OPM_SymWSet (SET s); import void OPM_Write (CHAR ch); -import void OPM_WriteHex (int32 i); -import void OPM_WriteInt (int32 i); +import void OPM_WriteHex (int64 i); +import void OPM_WriteInt (int64 i); import void OPM_WriteLn (void); import void OPM_WriteReal (LONGREAL r, CHAR suffx); import void OPM_WriteString (CHAR *s, LONGINT s__len); diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index 8db5ef60..44ce8ff1 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -134,7 +134,7 @@ static void OPP_CheckMark (int8 *vis) static void OPP_CheckSysFlag (int16 *sysflag, int16 default_) { OPT_Node x = NIL; - int32 sf; + int64 sf; if (OPP_sym == 31) { OPS_Get(&OPP_sym); if (!OPT_SYSimported) { @@ -151,7 +151,7 @@ static void OPP_CheckSysFlag (int16 *sysflag, int16 default_) OPP_err(51); sf = 0; } - *sysflag = (int16)sf; + *sysflag = OPM_Integer(sf); OPP_CheckSym(23); } else { *sysflag = default_; @@ -254,7 +254,7 @@ static void OPP_RecordType (OPT_Struct *typ, OPT_Struct *banned) static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) { OPT_Node x = NIL; - int32 n; + int64 n; int16 sysflag; OPP_CheckSysFlag(&sysflag, 0); if (OPP_sym == 25) { @@ -275,7 +275,7 @@ static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) OPP_ConstExpression(&x); if (x->typ->form == 4) { n = x->conval->intval; - if (n <= 0 || n > OPM_MaxIndex) { + if (n <= 0 || n > (int64)OPM_MaxIndex) { OPP_err(63); n = 1; } @@ -283,7 +283,7 @@ static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) OPP_err(51); n = 1; } - (*typ)->n = n; + (*typ)->n = OPM_Longint(n); if (OPP_sym == 25) { OPS_Get(&OPP_sym); OPP_Type(&(*typ)->BaseTyp, &*banned); @@ -932,7 +932,7 @@ static void GetCode__19 (void) { OPT_ConstExt ext = NIL; int16 n; - int32 c; + int64 c; ext = OPT_NewExt(); (*ProcedureDeclaration__16_s->proc)->conval->ext = ext; n = 0; @@ -1179,7 +1179,7 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int16 *n, OPP OPP_ConstExpression(&x); f = x->typ->form; if (__IN(f, 0x18, 32)) { - xval = x->conval->intval; + xval = OPM_Longint(x->conval->intval); } else { OPP_err(61); xval = 1; @@ -1194,7 +1194,7 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int16 *n, OPP if (OPP_sym == 21) { OPS_Get(&OPP_sym); OPP_ConstExpression(&y); - yval = y->conval->intval; + yval = OPM_Longint(y->conval->intval); if (((int16)y->typ->form != f && !((f == 4 && y->typ->form == 4)))) { OPP_err(60); } diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index fb0f2237..f80ca2b1 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -17,7 +17,7 @@ typedef export OPS_Name OPS_name; export OPS_String OPS_str; export int16 OPS_numtyp; -export int32 OPS_intval; +export int64 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) + Ord__7(dig[i], 1); + OPS_intval = __ASHL(OPS_intval, 4) + (int64)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) + Ord__7(dig[i], 1); + OPS_intval = __ASHL(OPS_intval, 4) + (int64)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 ((int64)OPS_intval <= __DIV(9223372036854775807 - (int64)d, 10)) { - OPS_intval = OPS_intval * 10 + d; + if (OPS_intval <= __DIV(9223372036854775807 - (int64)d, 10)) { + OPS_intval = OPS_intval * 10 + (int64)d; } else { OPS_err(203); } diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index d2b5dfb4..d33103c1 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -15,7 +15,7 @@ typedef import OPS_Name OPS_name; import OPS_String OPS_str; import int16 OPS_numtyp; -import int32 OPS_intval; +import int64 OPS_intval; import REAL OPS_realval; import LONGREAL OPS_lrlval; diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 83a2652b..fa5401ee 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -17,7 +17,8 @@ typedef typedef struct OPT_ConstDesc { OPT_ConstExt ext; - int32 intval, intval2; + int64 intval; + int32 intval2; SET setval; LONGREAL realval; } OPT_ConstDesc; @@ -1838,7 +1839,7 @@ static void EnumPtrs(void (*P)(void*)) __ENUMR(&OPT_impCtxt, OPT_ImpCtxt__typ, 3140, 1, P); } -__TDESC(OPT_ConstDesc, 1, 1) = {__TDFLDS("ConstDesc", 24), {0, -8}}; +__TDESC(OPT_ConstDesc, 1, 1) = {__TDFLDS("ConstDesc", 32), {0, -8}}; __TDESC(OPT_ObjDesc, 1, 6) = {__TDFLDS("ObjDesc", 304), {0, 4, 8, 12, 284, 288, -28}}; __TDESC(OPT_StrDesc, 1, 3) = {__TDFLDS("StrDesc", 56), {44, 48, 52, -16}}; __TDESC(OPT_NodeDesc, 1, 6) = {__TDFLDS("NodeDesc", 28), {0, 4, 8, 16, 20, 24, -28}}; diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index d4b49da8..b6566702 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -15,7 +15,8 @@ typedef typedef struct OPT_ConstDesc { OPT_ConstExt ext; - int32 intval, intval2; + int64 intval; + int32 intval2; SET setval; LONGREAL realval; } OPT_ConstDesc; diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index a32351aa..cddb737c 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -36,10 +36,10 @@ static BOOLEAN OPV_ImplicitReturn (OPT_Node n); static void OPV_Index (OPT_Node n, OPT_Node d, int16 prec, int16 dim); export void OPV_Init (void); static void OPV_InitTDescs (OPT_Node n); -static void OPV_Len (OPT_Node n, int32 dim); +static void OPV_Len (OPT_Node n, int64 dim); export void OPV_Module (OPT_Node prog); static void OPV_NewArr (OPT_Node d, OPT_Node x); -static void OPV_ParIntLiteral (int32 n, int32 size); +static void OPV_ParIntLiteral (int64 n, int32 size); static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp); static BOOLEAN OPV_SideEffects (OPT_Node n); static void OPV_SizeCast (int32 from, int32 to); @@ -414,7 +414,7 @@ static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp __RETCHK; } -static void OPV_Len (OPT_Node n, int32 dim) +static void OPV_Len (OPT_Node n, int64 dim) { while ((n->class == 4 && n->typ->comp == 3)) { dim += 1; @@ -725,7 +725,7 @@ static void OPV_design (OPT_Node n, int16 prec) } } -static void OPV_ParIntLiteral (int32 n, int32 size) +static void OPV_ParIntLiteral (int64 n, int32 size) { if (OPV_ansi) { OPM_WriteInt(n); @@ -1210,7 +1210,7 @@ static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc) { OPT_Node switchCase = NIL, label = NIL; - int32 low, high; + int64 low, high; int16 form, i; OPM_WriteString((CHAR*)"switch ", 8); OPV_expr(n->left, 12); @@ -1351,7 +1351,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPV_ExitInfo saved; OPT_Node l = NIL, r = NIL; while ((n != NIL && OPM_noerr)) { - OPM_errpos = n->conval->intval; + OPM_errpos = OPM_Longint(n->conval->intval); if (n->class != 14) { OPC_BegStat(); } @@ -1625,7 +1625,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPV_IfStat(n, n->subcl == 0, outerProc); break; case 28: - OPC_Halt(n->right->conval->intval); + OPC_Halt(OPM_Longint(n->right->conval->intval)); break; default: OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, n^.class = ", 40); diff --git a/bootstrap/windows-88/Console.c b/bootstrap/windows-88/Console.c index 32408370..1f28b96d 100644 --- a/bootstrap/windows-88/Console.c +++ b/bootstrap/windows-88/Console.c @@ -62,7 +62,7 @@ void Console_Int (int64 i, int64 n) __MOVE("8085774586302733229", s, 20); k = 19; } else { - i1 = __ABS(i); + i1 = __ABS((int64)i); s[0] = (CHAR)(__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k = 1; diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index c2097ffb..d94e42ad 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -90,6 +90,7 @@ export void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, int64 *x); export void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x); export void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); export void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int64 *x); +export void Files_ReadNum64 (Files_Rider *R, LONGINT *R__typ, int64 *x); export void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x); export void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x); export void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); @@ -105,6 +106,7 @@ export void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, int32 x); export void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, int64 x); export void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x); export void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int64 x); +export void Files_WriteNum64 (Files_Rider *R, LONGINT *R__typ, int64 x); export void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x); export void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x); export void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); @@ -936,6 +938,13 @@ void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int64 *x) *x = n; } +void Files_ReadNum64 (Files_Rider *R, LONGINT *R__typ, int64 *x) +{ + int64 n; + Files_ReadNum(&*R, R__typ, &n); + *x = n; +} + void Files_WriteBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN x) { Files_Write(&*R, R__typ, __VAL(CHAR, x)); @@ -1004,6 +1013,15 @@ void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int64 x) Files_Write(&*R, R__typ, (CHAR)__MASK(x, -128)); } +void Files_WriteNum64 (Files_Rider *R, LONGINT *R__typ, int64 x) +{ + while (x < -64 || x > 63) { + Files_Write(&*R, R__typ, (CHAR)(__MASK(x, -128) + 128)); + x = __ASHR(x, 7); + } + Files_Write(&*R, R__typ, (CHAR)__MASK(x, -128)); +} + void Files_GetName (Files_File f, CHAR *name, LONGINT name__len) { __COPY(f->workName, name, name__len); diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index c98b006a..9ea6ac78 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -47,6 +47,7 @@ import void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, int64 *x); import void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x); import void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); import void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int64 *x); +import void Files_ReadNum64 (Files_Rider *R, LONGINT *R__typ, int64 *x); import void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x); import void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x); import void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); @@ -61,6 +62,7 @@ import void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, int32 x); import void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, int64 x); import void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x); import void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int64 x); +import void Files_WriteNum64 (Files_Rider *R, LONGINT *R__typ, int64 x); import void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x); import void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x); import void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index 2f005fc6..b271fa53 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -144,14 +144,8 @@ static int64 OPB_BoolToInt (BOOLEAN b) static BOOLEAN OPB_IntToBool (int64 i) { BOOLEAN _o_result; - if (i == 0) { - _o_result = 0; - return _o_result; - } else { - _o_result = 1; - return _o_result; - } - __RETCHK; + _o_result = i != 0; + return _o_result; } OPT_Node OPB_NewBoolConst (BOOLEAN boolval) @@ -274,7 +268,7 @@ OPT_Node OPB_NewString (OPS_String str, int64 len) x->conval = OPT_NewConst(); x->typ = OPT_stringtyp; x->conval->intval = -1; - x->conval->intval2 = len; + x->conval->intval2 = OPM_Longint(len); x->conval->ext = OPT_NewExt(); __COPY(str, *x->conval->ext, 256); _o_result = x; @@ -1917,7 +1911,7 @@ void OPB_StPar0 (OPT_Node *par0, int32 fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (f == 4) { - if (x->typ->size != OPT_linttyp->size) { + if (x->typ->size < OPT_linttyp->size) { OPB_Convert(&x, OPT_linttyp); } } else { @@ -2068,7 +2062,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) if (!(f == 4) || x->class != 7) { OPB_err(69); } else if (x->typ->size == 1) { - L = (int32)x->conval->intval; + L = OPM_Integer(x->conval->intval); typ = p->typ; while ((L > 0 && __IN(typ->comp, 0x0c, 64))) { typ = typ->BaseTyp; @@ -2132,7 +2126,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) p->obj = NIL; } else { p = NewOp__53(12, 17, p, x); - p->typ = OPT_linttyp; + p->typ = p->left->typ; } } else { OPB_err(111); diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 23017356..47c8a9be 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -55,11 +55,13 @@ static void OPM_GetProperties (void); static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONGINT name__len, int32 *size, int32 *align); export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); export void OPM_InitOptions (void); +export int32 OPM_Integer (int64 n); static void OPM_LogErrMsg (int32 n); export void OPM_LogW (CHAR ch); export void OPM_LogWLn (void); export void OPM_LogWNum (int64 i, int64 len); export void OPM_LogWStr (CHAR *s, LONGINT s__len); +export int64 OPM_Longint (int64 n); static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len); export void OPM_Mark (int32 n, int64 pos); export void OPM_NewSym (CHAR *modName, LONGINT modName__len); @@ -73,6 +75,7 @@ export int64 OPM_SignedMaximum (int64 bytecount); export int64 OPM_SignedMinimum (int64 bytecount); export void OPM_SymRCh (CHAR *ch); export int64 OPM_SymRInt (void); +export int64 OPM_SymRInt64 (void); export void OPM_SymRLReal (LONGREAL *lr); export void OPM_SymRReal (REAL *r); export void OPM_SymRSet (SET *s); @@ -117,6 +120,20 @@ void OPM_LogWLn (void) Console_Ln(); } +int64 OPM_Longint (int64 n) +{ + int64 _o_result; + _o_result = (int64)n; + return _o_result; +} + +int32 OPM_Integer (int64 n) +{ + int32 _o_result; + _o_result = __VAL(int32, n); + return _o_result; +} + static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) { int32 i; @@ -463,7 +480,7 @@ static void OPM_ShowLine (int64 pos) if (pos >= OPM_ErrorLineLimitPos) { pos = OPM_ErrorLineLimitPos - 1; } - i = (int32)(pos - OPM_ErrorLineStartPos); + i = (int32)OPM_Longint(pos - OPM_ErrorLineStartPos); while (i > 0) { OPM_LogW(' '); i -= 1; @@ -700,6 +717,15 @@ int64 OPM_SymRInt (void) return _o_result; } +int64 OPM_SymRInt64 (void) +{ + int64 _o_result; + int64 k; + Files_ReadNum64(&OPM_oldSF, Files_Rider__typ, &k); + _o_result = k; + return _o_result; +} + void OPM_SymRSet (SET *s) { Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (int64*)&*s); @@ -751,7 +777,7 @@ void OPM_SymWCh (CHAR ch) void OPM_SymWInt (int64 i) { - Files_WriteNum(&OPM_newSF, Files_Rider__typ, i); + Files_WriteNum64(&OPM_newSF, Files_Rider__typ, i); } void OPM_SymWSet (SET s) @@ -840,9 +866,9 @@ void OPM_WriteHex (int64 i) void OPM_WriteInt (int64 i) { - CHAR s[20]; + CHAR s[24]; int64 i1, k; - if (i == OPM_SignedMinimum(OPM_IntSize) || i == OPM_SignedMinimum(OPM_LIntSize)) { + if ((i == OPM_SignedMinimum(OPM_IntSize) || i == OPM_SignedMinimum(OPM_LIntSize)) || i == OPM_SignedMinimum(8)) { OPM_Write('('); OPM_WriteInt(i + 1); OPM_WriteString((CHAR*)"-1)", 4); @@ -852,17 +878,17 @@ void OPM_WriteInt (int64 i) i1 = __DIV(i1, 10); k = 1; while (i1 > 0) { - s[__X(k, 20)] = (CHAR)(__MOD(i1, 10) + 48); + s[__X(k, 24)] = (CHAR)(__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k += 1; } if (i < 0) { - s[__X(k, 20)] = '-'; + s[__X(k, 24)] = '-'; k += 1; } while (k > 0) { k -= 1; - OPM_Write(s[__X(k, 20)]); + OPM_Write(s[__X(k, 24)]); } } } diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index 7472bed7..9d977ff8 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -28,10 +28,12 @@ import void OPM_FPrintSet (int64 *fp, SET set); import void OPM_Get (CHAR *ch); import void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); import void OPM_InitOptions (void); +import int32 OPM_Integer (int64 n); import void OPM_LogW (CHAR ch); import void OPM_LogWLn (void); import void OPM_LogWNum (int64 i, int64 len); import void OPM_LogWStr (CHAR *s, LONGINT s__len); +import int64 OPM_Longint (int64 n); import void OPM_Mark (int32 n, int64 pos); import void OPM_NewSym (CHAR *modName, LONGINT modName__len); import void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); @@ -42,6 +44,7 @@ import int64 OPM_SignedMaximum (int64 bytecount); import int64 OPM_SignedMinimum (int64 bytecount); import void OPM_SymRCh (CHAR *ch); import int64 OPM_SymRInt (void); +import int64 OPM_SymRInt64 (void); import void OPM_SymRLReal (LONGREAL *lr); import void OPM_SymRReal (REAL *r); import void OPM_SymRSet (SET *s); diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index 63191e02..5150cdbe 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -151,7 +151,7 @@ static void OPP_CheckSysFlag (int32 *sysflag, int32 default_) OPP_err(51); sf = 0; } - *sysflag = (int32)sf; + *sysflag = OPM_Integer(sf); OPP_CheckSym(23); } else { *sysflag = default_; @@ -283,7 +283,7 @@ static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) OPP_err(51); n = 1; } - (*typ)->n = n; + (*typ)->n = OPM_Longint(n); if (OPP_sym == 25) { OPS_Get(&OPP_sym); OPP_Type(&(*typ)->BaseTyp, &*banned); @@ -1179,7 +1179,7 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int32 *n, OPP OPP_ConstExpression(&x); f = x->typ->form; if (__IN(f, 0x18, 64)) { - xval = x->conval->intval; + xval = OPM_Longint(x->conval->intval); } else { OPP_err(61); xval = 1; @@ -1194,7 +1194,7 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int32 *n, OPP if (OPP_sym == 21) { OPS_Get(&OPP_sym); OPP_ConstExpression(&y); - yval = y->conval->intval; + yval = OPM_Longint(y->conval->intval); if ((y->typ->form != f && !((f == 4 && y->typ->form == 4)))) { OPP_err(60); } diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 46abf128..04c24f09 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1351,7 +1351,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPV_ExitInfo saved; OPT_Node l = NIL, r = NIL; while ((n != NIL && OPM_noerr)) { - OPM_errpos = n->conval->intval; + OPM_errpos = OPM_Longint(n->conval->intval); if (n->class != 14) { OPC_BegStat(); } @@ -1625,7 +1625,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPV_IfStat(n, n->subcl == 0, outerProc); break; case 28: - OPC_Halt(n->right->conval->intval); + OPC_Halt(OPM_Longint(n->right->conval->intval)); break; default: OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, n^.class = ", 40); diff --git a/src/library/s3/ethMD5.Mod b/src/library/s3/ethMD5.Mod index 57975454..32c31bd8 100644 --- a/src/library/s3/ethMD5.Mod +++ b/src/library/s3/ethMD5.Mod @@ -231,7 +231,7 @@ under a public-key cryptosystem such as RSA. *) SYSTEM.MOVE(SYSTEM.ADR(buf[beg]), SYSTEM.ADR(context.in[0]), 64); ByteReverse(context.in, in, 16); Transform(context.buf, in); - INC(beg, 64); DEC(len, 64) + INC(beg, 64); DEC(len, 64) END; IF len > 0 THEN SYSTEM.MOVE(SYSTEM.ADR(buf[beg]), SYSTEM.ADR(context.in[0]), len) diff --git a/src/library/v4/Texts.Mod b/src/library/v4/Texts.Mod index 26b13c81..ecca315d 100644 --- a/src/library/v4/Texts.Mod +++ b/src/library/v4/Texts.Mod @@ -1,6 +1,6 @@ MODULE Texts; (** CAS/HM 23.9.93 -- interface based on Texts by JG/NW 6.12.91**) (* << RC, MB, JT *) IMPORT - Files, Modules, Reals; + Files, Modules, Reals, SYSTEM; (*--- insert field e: Elem into Texts.Scanner and change Texts.Scan to set it in case of class=6 *) @@ -545,19 +545,13 @@ MODULE Texts; (** CAS/HM 23.9.93 -- interface based on Texts by JG/NW 6.12.91** WHILE s[i] >= " " DO Write(W, s[i]); INC(i) END END WriteString; - PROCEDURE WriteInt* (VAR W: Writer; x, n: LONGINT); + PROCEDURE WriteInt* (VAR W: Writer; x, n: SYSTEM.INT64); VAR - i: INTEGER; x0: LONGINT; - a: ARRAY 22 OF CHAR; + i: INTEGER; x0: SYSTEM.INT64; + a: ARRAY 24 OF CHAR; BEGIN i := 0; IF x < 0 THEN - IF x = MIN(LONGINT) THEN - IF SIZE(LONGINT) = 4 THEN - WriteString(W, " -2147483648") - ELSE - WriteString(W, " -9223372036854775808") - END; - RETURN + IF x = MIN(SYSTEM.INT64) THEN WriteString(W, " -9223372036854775808"); RETURN ELSE DEC(n); x0 := -x END ELSE x0 := x diff --git a/src/tools/browser/BrowserCmd.Mod b/src/tools/browser/BrowserCmd.Mod index 55b6c192..564b29b3 100644 --- a/src/tools/browser/BrowserCmd.Mod +++ b/src/tools/browser/BrowserCmd.Mod @@ -1,39 +1,20 @@ MODULE BrowserCmd; (* RC 29.10.93 *) (* object model 4.12.93, command line version jt 4.4.95 *) IMPORT - OPM, OPS, OPT, OPV, Texts, Console, Platform; + OPM, OPS, OPT, OPV, Texts, Console, Platform, SYSTEM; CONST OptionChar = "-"; - (* object modes *) - Var = 1; VarPar = 2; Con = 3; Fld = 4; Typ = 5; LProc = 6; XProc = 7; - SProc = 8; CProc = 9; IProc = 10; Mod = 11; Head = 12; TProc = 13; - - (* structure forms *) - Undef = 0; Byte = 1; Bool = 2; Char = 3; SInt = 4; Int = 5; LInt = 6; - Real = 7; LReal = 8; Set = 9; String = 10; NilTyp = 11; NoTyp = 12; - Pointer = 13; ProcTyp = 14; Comp = 15; - - (* composite structure forms *) - Basic = 1; Array = 2; DynArr = 3; Record = 4; - - (* module visibility of objects *) - internal = 0; external = 1; externalR = 2; - - (* symbol file items *) - Smname = 16; Send = 18; Stype = 19; Salias = 20; Svar = 21; Srvar = 22; - Svalpar = 23; Svarpar = 24; Sfld = 25; Srfld = 26; Shdptr = 27; Shdpro = 28; Stpro = 29; Shdtpro = 30; - Sxpro = 31; Sipro = 32; Scpro = 33; Sstruct = 34; Ssys = 35; Sptr = 36; Sarr = 37; Sdarr = 38; Srec = 39; Spro = 40; VAR W: Texts.Writer; option: CHAR; PROCEDURE Ws(s: ARRAY OF CHAR); BEGIN Texts.WriteString(W, s) END Ws; - PROCEDURE Wch(ch: CHAR); BEGIN Texts.Write(W, ch) END Wch; - PROCEDURE Wi(i: LONGINT); BEGIN Texts.WriteInt(W, i, 0) END Wi; - PROCEDURE Wln; BEGIN Texts.WriteLn(W) END Wln; + PROCEDURE Wch(ch: CHAR); BEGIN Texts.Write(W, ch) END Wch; + PROCEDURE Wi(i: SYSTEM.INT64); BEGIN Texts.WriteInt(W, i, 0) END Wi; + PROCEDURE Wln; BEGIN Texts.WriteLn(W) END Wln; PROCEDURE Indent(i: INTEGER); BEGIN WHILE i > 0 DO Wch(" "); Wch(" "); DEC(i) END @@ -51,7 +32,7 @@ MODULE BrowserCmd; (* RC 29.10.93 *) (* object model 4.12.93, command line ver WHILE par # NIL DO IF ~first THEN Ws("; ") ELSE first := FALSE END ; IF option = "x" THEN Wi(par^.adr); Wch(" ") END ; - IF par^.mode = VarPar THEN Ws("VAR ") END ; + IF par^.mode = OPT.VarPar THEN Ws("VAR ") END ; Ws(par^.name); Ws(": "); Wtype(par^.typ); par := par^.link END ; @@ -60,75 +41,65 @@ MODULE BrowserCmd; (* RC 29.10.93 *) (* object model 4.12.93, command line ver END Wsign; PROCEDURE Objects(obj: OPT.Object; mode: SET); - VAR i: LONGINT; m: INTEGER; s: SET; ext: OPT.ConstExt; + VAR i: SYSTEM.INT64; m: INTEGER; s: SET; ext: OPT.ConstExt; BEGIN IF obj # NIL THEN Objects(obj^.left, mode); IF obj^.mode IN mode THEN CASE obj^.mode OF - | Con: - Indent(2); Ws(obj^.name); Ws(" = "); - CASE obj^.typ^.form OF - | Bool: - IF obj^.conval^.intval = 1 THEN Ws("TRUE") ELSE Ws("FALSE") END - | Char: - IF (obj^.conval^.intval >= 32) & (obj^.conval^.intval <= 126) THEN - Wch(22X); Wch(CHR(obj^.conval^.intval)); Wch(22X) - ELSE - i := obj^.conval^.intval DIV 16; - IF i > 9 THEN Wch(CHR(55 + i)) ELSE Wch(CHR(48 + i)) END ; - i := obj^.conval^.intval MOD 16; - IF i > 9 THEN Wch(CHR(55 + i)) ELSE Wch(CHR(48 + i)) END ; - Wch("X") - END - | SInt, Int, LInt: - Wi(obj^.conval^.intval) - | Set: - Wch("{"); i := 0; s := obj^.conval^.setval; - WHILE i <= MAX(SET) DO - IF i IN s THEN Wi(i); EXCL(s, i); - IF s # {} THEN Ws(", ") END - END ; - INC(i) - END ; - Wch("}") - | Real: - Texts.WriteReal(W, SHORT(obj^.conval^.realval), 16) - | LReal: - Texts.WriteLongReal(W, obj^.conval^.realval, 23) - | String: - Ws(obj^.conval^.ext^) - | NilTyp: - Ws("NIL") - ELSE (* Ignore other forms *) - END ; - Wch(";"); Wln - | Typ: - IF obj^.name # "" THEN Indent(2); - IF obj^.typ^.strobj = obj THEN (* canonical name *) - Wtype(obj^.typ); Ws(" = "); Wstruct(obj^.typ) - ELSE (* alias *) - Ws(obj^.name); Ws(" = "); Wtype(obj^.typ) - END ; - Wch(";"); Wln - END - | Var: - Indent(2); Ws(obj^.name); - IF obj^.vis = externalR THEN Ws("-: ") ELSE Ws(": ") END ; - Wtype(obj^.typ); Wch(";"); Wln - | XProc, CProc, IProc: - Indent(1); Ws("PROCEDURE "); - IF obj^.mode = IProc THEN Wch("+") - ELSIF obj^.mode = CProc THEN Wch("-") - END ; - Ws(obj^.name); - Wsign(obj^.typ, obj^.link); - IF obj^.mode = CProc THEN - ext := obj^.conval^.ext; m := ORD(ext^[0]); i := 1; Ws(' "'); - WHILE i <= m DO Wch(ext^[i]); INC(i) END ; - Wch('"'); - END ; - Wch(";"); Wln + |OPT.Con: Indent(2); Ws(obj^.name); Ws(" = "); + CASE obj^.typ^.form OF + |OPT.Bool: IF obj^.conval^.intval = 1 THEN Ws("TRUE") ELSE Ws("FALSE") END + |OPT.Char: IF (obj^.conval^.intval >= 32) & (obj^.conval^.intval <= 126) THEN + Wch(22X); Wch(CHR(obj^.conval^.intval)); Wch(22X) + ELSE + i := obj^.conval^.intval DIV 16; + IF i > 9 THEN Wch(CHR(55 + i)) ELSE Wch(CHR(48 + i)) END ; + i := obj^.conval^.intval MOD 16; + IF i > 9 THEN Wch(CHR(55 + i)) ELSE Wch(CHR(48 + i)) END ; + Wch("X") + END + |OPT.Int: Wi(obj^.conval^.intval) + |OPT.Set: Wch("{"); i := 0; s := obj^.conval^.setval; + WHILE i <= MAX(SET) DO + IF i IN s THEN Wi(i); EXCL(s, i); + IF s # {} THEN Ws(", ") END + END ; + INC(i) + END ; + Wch("}") + |OPT.Real: Texts.WriteReal(W, SHORT(obj^.conval^.realval), 16) + |OPT.LReal: Texts.WriteLongReal(W, obj^.conval^.realval, 23) + |OPT.String: Ws(obj^.conval^.ext^) + |OPT.NilTyp: Ws("NIL") + ELSE (* Ignore other forms *) + END ; + Wch(";"); Wln + |OPT.Typ: IF obj^.name # "" THEN Indent(2); + IF obj^.typ^.strobj = obj THEN (* canonical name *) + Wtype(obj^.typ); Ws(" = "); Wstruct(obj^.typ) + ELSE (* alias *) + Ws(obj^.name); Ws(" = "); Wtype(obj^.typ) + END ; + Wch(";"); Wln + END + |OPT.Var: Indent(2); Ws(obj^.name); + IF obj^.vis = OPT.externalR THEN Ws("-: ") ELSE Ws(": ") END ; + Wtype(obj^.typ); Wch(";"); Wln + |OPT.XProc, + OPT.CProc, + OPT.IProc: Indent(1); Ws("PROCEDURE "); + IF obj^.mode = OPT.IProc THEN Wch("+") + ELSIF obj^.mode = OPT.CProc THEN Wch("-") + END ; + Ws(obj^.name); + Wsign(obj^.typ, obj^.link); + IF obj^.mode = OPT.CProc THEN + ext := obj^.conval^.ext; m := ORD(ext^[0]); i := 1; Ws(' "'); + WHILE i <= m DO Wch(ext^[i]); INC(i) END ; + Wch('"'); + END ; + Wch(";"); Wln ELSE (* Ignore other modes *) END END ; @@ -141,10 +112,10 @@ MODULE BrowserCmd; (* RC 29.10.93 *) (* object model 4.12.93, command line ver BEGIN IF obj # NIL THEN Wmthd(obj^.left); - IF (obj^.mode = TProc) & ((obj^.name # OPM.HdTProcName) OR (option = "x")) THEN + IF (obj^.mode = OPT.TProc) & ((obj^.name # OPM.HdTProcName) OR (option = "x")) THEN Indent(3); Ws("PROCEDURE ("); IF obj^.name # OPM.HdTProcName THEN - IF obj^.link^.mode = VarPar THEN Ws("VAR ") END ; + IF obj^.link^.mode = OPT.VarPar THEN Ws("VAR ") END ; Ws(obj^.link^.name); Ws(": "); Wtype(obj^.link^.typ) END ; Ws(") "); Ws(obj^.name); @@ -171,40 +142,33 @@ MODULE BrowserCmd; (* RC 29.10.93 *) (* object model 4.12.93, command line ver BEGIN CASE typ^.form OF - | Undef: - Ws("Undef") - | Pointer: - Ws("POINTER "); SysFlag; Ws("TO "); Wtype(typ^.BaseTyp) - | ProcTyp: - Ws("PROCEDURE "); SysFlag; Wsign(typ^.BaseTyp, typ^.link) - | Comp: - CASE typ^.comp OF - | Array: - Ws("ARRAY "); SysFlag; Wi(typ^.n); Ws(" OF "); Wtype(typ^.BaseTyp) - | DynArr: - Ws("ARRAY "); SysFlag; Ws("OF "); Wtype(typ^.BaseTyp) - | Record: - Ws("RECORD ");SysFlag; - IF typ^.BaseTyp # NIL THEN Wch("("); Wtype(typ^.BaseTyp); Wch(")") END ; - Wln; fld := typ^.link; - WHILE (fld # NIL) & (fld^.mode = Fld) DO - IF (option = "x") OR (fld^.name[0] # "@") THEN Indent(3); - IF option = "x" THEN Wi(fld^.adr); Wch(" ") END ; - Ws(fld^.name); - IF fld^.vis = externalR THEN Wch("-") END ; - Ws(": "); Wtype(fld^.typ); Wch(";"); - Wln - END ; - fld := fld^.link - END ; - Wmthd(typ^.link); - Indent(2); Ws("END "); - IF option = "x" THEN Indent(1); - Ws("(* size: "); Wi(typ^.size); Ws(" align: "); Wi(typ^.align); - Ws(" nofm: "); Wi(typ^.n); Ws(" *)") - END - ELSE (* Ignore other comps *) - END + |OPT.Undef: Ws("Undef") + |OPT.Pointer: Ws("POINTER "); SysFlag; Ws("TO "); Wtype(typ^.BaseTyp) + |OPT.ProcTyp: Ws("PROCEDURE "); SysFlag; Wsign(typ^.BaseTyp, typ^.link) + |OPT.Comp: CASE typ^.comp OF + |OPT.Array: Ws("ARRAY "); SysFlag; Wi(typ^.n); Ws(" OF "); Wtype(typ^.BaseTyp) + |OPT.DynArr: Ws("ARRAY "); SysFlag; Ws("OF "); Wtype(typ^.BaseTyp) + |OPT.Record: Ws("RECORD ");SysFlag; + IF typ^.BaseTyp # NIL THEN Wch("("); Wtype(typ^.BaseTyp); Wch(")") END ; + Wln; fld := typ^.link; + WHILE (fld # NIL) & (fld^.mode = OPT.Fld) DO + IF (option = "x") OR (fld^.name[0] # "@") THEN Indent(3); + IF option = "x" THEN Wi(fld^.adr); Wch(" ") END ; + Ws(fld^.name); + IF fld^.vis = OPT.externalR THEN Wch("-") END ; + Ws(": "); Wtype(fld^.typ); Wch(";"); + Wln + END ; + fld := fld^.link + END ; + Wmthd(typ^.link); + Indent(2); Ws("END "); + IF option = "x" THEN Indent(1); + Ws("(* size: "); Wi(typ^.size); Ws(" align: "); Wi(typ^.align); + Ws(" nofm: "); Wi(typ^.n); Ws(" *)") + END + ELSE (* Ignore other comps *) + END ELSE (* Ignore other froms *) END END Wstruct; @@ -216,7 +180,7 @@ MODULE BrowserCmd; (* RC 29.10.93 *) (* object model 4.12.93, command line ver IF obj^.name # "" THEN IF typ^.mno # 0 THEN Ws(OPT.GlbMod[typ^.mno].name); Wch(".") ELSIF (typ = OPT.bytetyp) OR (typ = OPT.sysptrtyp) THEN Ws("SYSTEM.") - ELSIF obj^.vis = internal THEN Wch("#") + ELSIF obj^.vis = OPT.internal THEN Wch("#") END ; Ws(obj^.name) ELSE @@ -242,7 +206,7 @@ MODULE BrowserCmd; (* RC 29.10.93 *) (* object model 4.12.93, command line ver ELSE Wln END END CheckHeader; - + BEGIN OPT.Import("@notself", name, done); IF done THEN @@ -255,10 +219,10 @@ MODULE BrowserCmd; (* RC 29.10.93 *) (* object model 4.12.93, command line ver END ; IF ~first THEN Wch(";"); Wln END ; CheckHeader; - Header("CONST"); Objects(OPT.GlbMod[0].right, {Con}); CheckHeader; - Header("TYPE"); Objects(OPT.GlbMod[0].right, {Typ}); CheckHeader; - Header("VAR"); Objects(OPT.GlbMod[0].right, {Var}); CheckHeader; - Objects(OPT.GlbMod[0].right, {XProc, IProc, CProc}); + Header("CONST"); Objects(OPT.GlbMod[0].right, {OPT.Con}); CheckHeader; + Header("TYPE"); Objects(OPT.GlbMod[0].right, {OPT.Typ}); CheckHeader; + Header("VAR"); Objects(OPT.GlbMod[0].right, {OPT.Var}); CheckHeader; + Objects(OPT.GlbMod[0].right, {OPT.XProc, OPT.IProc, OPT.CProc}); Wln; Ws("END "); Ws(name); Wch("."); Wln; Texts.Append(T, W.buf) ELSE @@ -266,7 +230,7 @@ MODULE BrowserCmd; (* RC 29.10.93 *) (* object model 4.12.93, command line ver Texts.WriteLn(W); Texts.Append(T, W.buf) END END WModule; - + PROCEDURE Ident(VAR name, first: ARRAY OF CHAR); VAR i, j: INTEGER; ch: CHAR; BEGIN i := 0; diff --git a/src/tools/make/vishap.make b/src/tools/make/vishap.make index faacf33f..008180cb 100644 --- a/src/tools/make/vishap.make +++ b/src/tools/make/vishap.make @@ -335,7 +335,7 @@ misc: s3: @printf "\nMaking s3 library\n" cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/s3/ethBTrees.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/s3/ethMD5.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/s3/ethMD5.Mod cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/s3/ethSets.Mod cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/s3/ethZlib.Mod cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/s3/ethZlibBuffers.Mod From 1a83167d5a5b87cdbc64cc586aad0dcb5af40cd0 Mon Sep 17 00:00:00 2001 From: David Brown Date: Tue, 20 Sep 2016 16:43:34 +0100 Subject: [PATCH 237/580] Fix ethMD5 build. May need more work to be correct on 64 bit builds. --- bootstrap/unix-44/Configuration.c | 4 +- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Console.c | 2 +- bootstrap/unix-44/Console.h | 2 +- bootstrap/unix-44/Files.c | 2 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 2 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 15 +-- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 2 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 2 +- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 18 ++- bootstrap/unix-44/OPT.h | 3 +- bootstrap/unix-44/OPV.c | 2 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 20 ++-- bootstrap/unix-44/Texts.h | 4 +- bootstrap/unix-44/Vishap.c | 2 +- bootstrap/unix-44/errors.c | 2 +- bootstrap/unix-44/errors.h | 2 +- bootstrap/unix-44/extTools.c | 2 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-44/vt100.c | 2 +- bootstrap/unix-44/vt100.h | 2 +- bootstrap/unix-48/Configuration.c | 4 +- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Console.c | 2 +- bootstrap/unix-48/Console.h | 2 +- bootstrap/unix-48/Files.c | 2 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 2 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 15 +-- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 2 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 2 +- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 18 ++- bootstrap/unix-48/OPT.h | 3 +- bootstrap/unix-48/OPV.c | 2 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 20 ++-- bootstrap/unix-48/Texts.h | 4 +- bootstrap/unix-48/Vishap.c | 2 +- bootstrap/unix-48/errors.c | 2 +- bootstrap/unix-48/errors.h | 2 +- bootstrap/unix-48/extTools.c | 2 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-48/vt100.c | 2 +- bootstrap/unix-48/vt100.h | 2 +- bootstrap/unix-88/Configuration.c | 4 +- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Console.c | 2 +- bootstrap/unix-88/Console.h | 2 +- bootstrap/unix-88/Files.c | 2 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 2 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 15 +-- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 2 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 2 +- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 18 ++- bootstrap/unix-88/OPT.h | 3 +- bootstrap/unix-88/OPV.c | 2 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 8 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/Vishap.c | 2 +- bootstrap/unix-88/errors.c | 2 +- bootstrap/unix-88/errors.h | 2 +- bootstrap/unix-88/extTools.c | 2 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/unix-88/vt100.c | 2 +- bootstrap/unix-88/vt100.h | 2 +- bootstrap/windows-48/Configuration.c | 4 +- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Console.c | 2 +- bootstrap/windows-48/Console.h | 2 +- bootstrap/windows-48/Files.c | 2 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 2 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 15 +-- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 2 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 2 +- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 18 ++- bootstrap/windows-48/OPT.h | 3 +- bootstrap/windows-48/OPV.c | 2 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 20 ++-- bootstrap/windows-48/Texts.h | 4 +- bootstrap/windows-48/Vishap.c | 2 +- bootstrap/windows-48/errors.c | 2 +- bootstrap/windows-48/errors.h | 2 +- bootstrap/windows-48/extTools.c | 2 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-48/vt100.c | 2 +- bootstrap/windows-48/vt100.h | 2 +- bootstrap/windows-88/Configuration.c | 4 +- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Console.c | 2 +- bootstrap/windows-88/Console.h | 2 +- bootstrap/windows-88/Files.c | 2 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 2 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 15 +-- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 2 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 2 +- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 18 ++- bootstrap/windows-88/OPT.h | 3 +- bootstrap/windows-88/OPV.c | 2 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Platform.c | 2 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 8 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/Vishap.c | 2 +- bootstrap/windows-88/errors.c | 2 +- bootstrap/windows-88/errors.h | 2 +- bootstrap/windows-88/extTools.c | 2 +- bootstrap/windows-88/extTools.h | 2 +- bootstrap/windows-88/vt100.c | 2 +- bootstrap/windows-88/vt100.h | 2 +- src/compiler/OPB.Mod | 7 +- src/compiler/OPT.Mod | 8 ++ src/library/s3/ethMD5.Mod | 138 +++++++++++----------- src/test/confidence/planned-binary-change | 2 +- src/tools/make/vishap.make | 2 +- 200 files changed, 407 insertions(+), 372 deletions(-) diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index 1a0e2ffe..4ea29c15 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/18] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/20] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index e5d79317..6b8f5d99 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Console.c b/bootstrap/unix-44/Console.c index 10d0a39b..a3acbd98 100644 --- a/bootstrap/unix-44/Console.c +++ b/bootstrap/unix-44/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Console.h b/bootstrap/unix-44/Console.h index e5dc1566..8f5a2a2a 100644 --- a/bootstrap/unix-44/Console.h +++ b/bootstrap/unix-44/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 6c934210..32971286 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index 0187d33f..2dfc3018 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index b80b6666..08a21c58 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tskSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index 50308888..65b6b0b1 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index 142b60f4..f61acc40 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index 2dc36a9b..6841c244 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index 47f2de21..13c64396 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -221,18 +221,7 @@ OPT_Node OPB_EmptySet (void) static void OPB_SetIntType (OPT_Node node) { - int16 b; - int64 n; - if (node->conval->intval >= 0) { - n = node->conval->intval; - } else { - n = -(node->conval->intval + 1); - } - b = 1; - while ((b < 8 && __ASH(n, -(__ASHL(b, 3) - 1)) != 0)) { - b += 1; - } - node->typ = OPT_IntType(b); + node->typ = OPT_IntType(OPT_IntSize(node->conval->intval)); } OPT_Node OPB_NewIntConst (int64 intval) diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index 08d025bf..a57ace75 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index c21e44a4..9923ccbc 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index 9e1ec652..83153512 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index ba86c00a..558dde61 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index 504519da..c5298326 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index 44ce8ff1..5351781f 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index 22557b29..7cbdb873 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index f80ca2b1..67bca013 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index d33103c1..3f106d0c 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index c7f21138..a18e6768 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -139,6 +139,7 @@ export void OPT_Init (OPS_Name name, SET opt); static void OPT_InitStruct (OPT_Struct *typ, int8 form); export void OPT_Insert (OPS_Name name, OPT_Object *obj); export void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); +export int16 OPT_IntSize (int64 n); export OPT_Struct OPT_IntType (int32 size); export OPT_Const OPT_NewConst (void); export OPT_ConstExt OPT_NewExt (void); @@ -164,6 +165,21 @@ static void OPT_err (int16 n) OPM_err(n); } +int16 OPT_IntSize (int64 n) +{ + int16 _o_result; + int16 bytes; + if (n < 0) { + n = -(n + 1); + } + bytes = 1; + while ((bytes < 8 && __ASH(n, -(__ASHL(bytes, 3) - 1)) != 0)) { + bytes += 1; + } + _o_result = bytes; + return _o_result; +} + OPT_Struct OPT_IntType (int32 size) { OPT_Struct _o_result; diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index b6566702..fd0a538e 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h @@ -94,6 +94,7 @@ import void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); import void OPT_Init (OPS_Name name, SET opt); import void OPT_Insert (OPS_Name name, OPT_Object *obj); import void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); +import int16 OPT_IntSize (int64 n); import OPT_Struct OPT_IntType (int32 size); import OPT_Const OPT_NewConst (void); import OPT_ConstExt OPT_NewExt (void); diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index cddb737c..ffe3eb71 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index 937f0ba6..33c1eeeb 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index cdb47dd1..10d2ba41 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index 6e372559..57c87f55 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 8b263757..6982b582 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index 6ff22ad6..e79f35d7 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index 8758a988..b2d5f19a 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index 36e01e6c..ea987a3e 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index 994ef48a..0339cbdb 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -221,7 +221,7 @@ export void Texts_Write (Texts_Writer *W, LONGINT *W__typ, CHAR ch); export void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, int32 t, int32 d); export void Texts_WriteElem (Texts_Writer *W, LONGINT *W__typ, Texts_Elem e); export void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, int32 x); -export void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int32 x, int32 n); +export void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int64 x, int64 n); export void Texts_WriteLn (Texts_Writer *W, LONGINT *W__typ); export void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, int16 n); export void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x); @@ -1050,15 +1050,15 @@ void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__le __DEL(s); } -void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int32 x, int32 n) +void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int64 x, int64 n) { int16 i; - int32 x0; - CHAR a[22]; + int64 x0; + CHAR a[24]; i = 0; if (x < 0) { - if (x == (-2147483647-1)) { - Texts_WriteString(&*W, W__typ, (CHAR*)" -2147483648", 13); + if (x == (-9223372036854775807-1)) { + Texts_WriteString(&*W, W__typ, (CHAR*)" -9223372036854775808", 22); return; } else { n -= 1; @@ -1068,11 +1068,11 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int32 x, int32 n) x0 = x; } do { - a[__X(i, 22)] = (CHAR)((int)__MOD(x0, 10) + 48); + a[__X(i, 24)] = (CHAR)(__MOD(x0, 10) + 48); x0 = __DIV(x0, 10); i += 1; } while (!(x0 == 0)); - while (n > i) { + while (n > (int64)i) { Texts_Write(&*W, W__typ, ' '); n -= 1; } @@ -1081,7 +1081,7 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int32 x, int32 n) } do { i -= 1; - Texts_Write(&*W, W__typ, a[__X(i, 22)]); + Texts_Write(&*W, W__typ, a[__X(i, 24)]); } while (!(i == 0)); } diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index 033c5c1a..6d3f7c1e 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h @@ -158,7 +158,7 @@ import void Texts_Write (Texts_Writer *W, LONGINT *W__typ, CHAR ch); import void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, int32 t, int32 d); import void Texts_WriteElem (Texts_Writer *W, LONGINT *W__typ, Texts_Elem e); import void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, int32 x); -import void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int32 x, int32 n); +import void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int64 x, int64 n); import void Texts_WriteLn (Texts_Writer *W, LONGINT *W__typ); import void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, int16 n); import void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x); diff --git a/bootstrap/unix-44/Vishap.c b/bootstrap/unix-44/Vishap.c index 1f322c5e..2d0b9dee 100644 --- a/bootstrap/unix-44/Vishap.c +++ b/bootstrap/unix-44/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkamSf */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/errors.c b/bootstrap/unix-44/errors.c index 689e3cdd..2bdf2af6 100644 --- a/bootstrap/unix-44/errors.c +++ b/bootstrap/unix-44/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/errors.h b/bootstrap/unix-44/errors.h index f5c1a708..b3535e92 100644 --- a/bootstrap/unix-44/errors.h +++ b/bootstrap/unix-44/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index c2339121..5245f35d 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index 6815aacb..414a05f0 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-44/vt100.c b/bootstrap/unix-44/vt100.c index 341502ec..4d312413 100644 --- a/bootstrap/unix-44/vt100.c +++ b/bootstrap/unix-44/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/vt100.h b/bootstrap/unix-44/vt100.h index f7615911..1ecf99b1 100644 --- a/bootstrap/unix-44/vt100.h +++ b/bootstrap/unix-44/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index 1a0e2ffe..4ea29c15 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/18] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/20] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index e5d79317..6b8f5d99 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Console.c b/bootstrap/unix-48/Console.c index 10d0a39b..a3acbd98 100644 --- a/bootstrap/unix-48/Console.c +++ b/bootstrap/unix-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Console.h b/bootstrap/unix-48/Console.h index e5dc1566..8f5a2a2a 100644 --- a/bootstrap/unix-48/Console.h +++ b/bootstrap/unix-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 6c934210..32971286 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index 0187d33f..2dfc3018 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index b80b6666..08a21c58 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tskSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index 50308888..65b6b0b1 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index 142b60f4..f61acc40 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index 2dc36a9b..6841c244 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index 47f2de21..13c64396 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -221,18 +221,7 @@ OPT_Node OPB_EmptySet (void) static void OPB_SetIntType (OPT_Node node) { - int16 b; - int64 n; - if (node->conval->intval >= 0) { - n = node->conval->intval; - } else { - n = -(node->conval->intval + 1); - } - b = 1; - while ((b < 8 && __ASH(n, -(__ASHL(b, 3) - 1)) != 0)) { - b += 1; - } - node->typ = OPT_IntType(b); + node->typ = OPT_IntType(OPT_IntSize(node->conval->intval)); } OPT_Node OPB_NewIntConst (int64 intval) diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index 08d025bf..a57ace75 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index c21e44a4..9923ccbc 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index 9e1ec652..83153512 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index ba86c00a..558dde61 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index 504519da..c5298326 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index 44ce8ff1..5351781f 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index 22557b29..7cbdb873 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index f80ca2b1..67bca013 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index d33103c1..3f106d0c 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index fa5401ee..c1bc93b1 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -139,6 +139,7 @@ export void OPT_Init (OPS_Name name, SET opt); static void OPT_InitStruct (OPT_Struct *typ, int8 form); export void OPT_Insert (OPS_Name name, OPT_Object *obj); export void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); +export int16 OPT_IntSize (int64 n); export OPT_Struct OPT_IntType (int32 size); export OPT_Const OPT_NewConst (void); export OPT_ConstExt OPT_NewExt (void); @@ -164,6 +165,21 @@ static void OPT_err (int16 n) OPM_err(n); } +int16 OPT_IntSize (int64 n) +{ + int16 _o_result; + int16 bytes; + if (n < 0) { + n = -(n + 1); + } + bytes = 1; + while ((bytes < 8 && __ASH(n, -(__ASHL(bytes, 3) - 1)) != 0)) { + bytes += 1; + } + _o_result = bytes; + return _o_result; +} + OPT_Struct OPT_IntType (int32 size) { OPT_Struct _o_result; diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index b6566702..fd0a538e 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h @@ -94,6 +94,7 @@ import void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); import void OPT_Init (OPS_Name name, SET opt); import void OPT_Insert (OPS_Name name, OPT_Object *obj); import void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); +import int16 OPT_IntSize (int64 n); import OPT_Struct OPT_IntType (int32 size); import OPT_Const OPT_NewConst (void); import OPT_ConstExt OPT_NewExt (void); diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index cddb737c..ffe3eb71 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index 937f0ba6..33c1eeeb 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index cdb47dd1..10d2ba41 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index 6e372559..57c87f55 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 8b263757..6982b582 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index 6ff22ad6..e79f35d7 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index 8758a988..b2d5f19a 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index 36e01e6c..ea987a3e 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index e14d923b..f277a856 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -221,7 +221,7 @@ export void Texts_Write (Texts_Writer *W, LONGINT *W__typ, CHAR ch); export void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, int32 t, int32 d); export void Texts_WriteElem (Texts_Writer *W, LONGINT *W__typ, Texts_Elem e); export void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, int32 x); -export void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int32 x, int32 n); +export void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int64 x, int64 n); export void Texts_WriteLn (Texts_Writer *W, LONGINT *W__typ); export void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, int16 n); export void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x); @@ -1050,15 +1050,15 @@ void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__le __DEL(s); } -void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int32 x, int32 n) +void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int64 x, int64 n) { int16 i; - int32 x0; - CHAR a[22]; + int64 x0; + CHAR a[24]; i = 0; if (x < 0) { - if (x == (-2147483647-1)) { - Texts_WriteString(&*W, W__typ, (CHAR*)" -2147483648", 13); + if (x == (-9223372036854775807-1)) { + Texts_WriteString(&*W, W__typ, (CHAR*)" -9223372036854775808", 22); return; } else { n -= 1; @@ -1068,11 +1068,11 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int32 x, int32 n) x0 = x; } do { - a[__X(i, 22)] = (CHAR)((int)__MOD(x0, 10) + 48); + a[__X(i, 24)] = (CHAR)(__MOD(x0, 10) + 48); x0 = __DIV(x0, 10); i += 1; } while (!(x0 == 0)); - while (n > i) { + while (n > (int64)i) { Texts_Write(&*W, W__typ, ' '); n -= 1; } @@ -1081,7 +1081,7 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int32 x, int32 n) } do { i -= 1; - Texts_Write(&*W, W__typ, a[__X(i, 22)]); + Texts_Write(&*W, W__typ, a[__X(i, 24)]); } while (!(i == 0)); } diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index 45ca0bb5..b2a965f8 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h @@ -159,7 +159,7 @@ import void Texts_Write (Texts_Writer *W, LONGINT *W__typ, CHAR ch); import void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, int32 t, int32 d); import void Texts_WriteElem (Texts_Writer *W, LONGINT *W__typ, Texts_Elem e); import void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, int32 x); -import void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int32 x, int32 n); +import void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int64 x, int64 n); import void Texts_WriteLn (Texts_Writer *W, LONGINT *W__typ); import void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, int16 n); import void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x); diff --git a/bootstrap/unix-48/Vishap.c b/bootstrap/unix-48/Vishap.c index 1f322c5e..2d0b9dee 100644 --- a/bootstrap/unix-48/Vishap.c +++ b/bootstrap/unix-48/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkamSf */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/errors.c b/bootstrap/unix-48/errors.c index 689e3cdd..2bdf2af6 100644 --- a/bootstrap/unix-48/errors.c +++ b/bootstrap/unix-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/errors.h b/bootstrap/unix-48/errors.h index f5c1a708..b3535e92 100644 --- a/bootstrap/unix-48/errors.h +++ b/bootstrap/unix-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index c2339121..5245f35d 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index 6815aacb..414a05f0 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/vt100.c b/bootstrap/unix-48/vt100.c index 341502ec..4d312413 100644 --- a/bootstrap/unix-48/vt100.c +++ b/bootstrap/unix-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/vt100.h b/bootstrap/unix-48/vt100.h index f7615911..1ecf99b1 100644 --- a/bootstrap/unix-48/vt100.h +++ b/bootstrap/unix-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index ec75a6df..a5c4087d 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/18] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/20] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index e5d79317..6b8f5d99 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Console.c b/bootstrap/unix-88/Console.c index 845cce11..dea88004 100644 --- a/bootstrap/unix-88/Console.c +++ b/bootstrap/unix-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Console.h b/bootstrap/unix-88/Console.h index 23f894db..a1322efe 100644 --- a/bootstrap/unix-88/Console.h +++ b/bootstrap/unix-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 2b23754f..7ace9c7c 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 51065265..2040560d 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index c99a229c..02dc0bbd 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tskSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index f9b4a041..aa22df29 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 662b84f9..60382d3c 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index 9f3d713d..4ef50204 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index b271fa53..d94f4b29 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -221,18 +221,7 @@ OPT_Node OPB_EmptySet (void) static void OPB_SetIntType (OPT_Node node) { - int32 b; - int64 n; - if (node->conval->intval >= 0) { - n = node->conval->intval; - } else { - n = -(node->conval->intval + 1); - } - b = 1; - while ((b < 8 && __ASH(n, -(__ASHL(b, 3) - 1)) != 0)) { - b += 1; - } - node->typ = OPT_IntType(b); + node->typ = OPT_IntType(OPT_IntSize(node->conval->intval)); } OPT_Node OPB_NewIntConst (int64 intval) diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index 185aa968..1330baf1 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index 689dfff4..b33dc59f 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index bf22de26..e749f6b6 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 47c8a9be..39c62389 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index 9d977ff8..908a80ad 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index 5150cdbe..8573d6b1 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index 22557b29..7cbdb873 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index 7caa7493..a92e1feb 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index 6d67036e..d7c08330 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index b588c3f1..6928030e 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -138,6 +138,7 @@ export void OPT_Init (OPS_Name name, SET opt); static void OPT_InitStruct (OPT_Struct *typ, int8 form); export void OPT_Insert (OPS_Name name, OPT_Object *obj); export void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); +export int32 OPT_IntSize (int64 n); export OPT_Struct OPT_IntType (int64 size); export OPT_Const OPT_NewConst (void); export OPT_ConstExt OPT_NewExt (void); @@ -163,6 +164,21 @@ static void OPT_err (int32 n) OPM_err(n); } +int32 OPT_IntSize (int64 n) +{ + int32 _o_result; + int32 bytes; + if (n < 0) { + n = -(n + 1); + } + bytes = 1; + while ((bytes < 8 && __ASH(n, -(__ASHL(bytes, 3) - 1)) != 0)) { + bytes += 1; + } + _o_result = bytes; + return _o_result; +} + OPT_Struct OPT_IntType (int64 size) { OPT_Struct _o_result; diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 504e70b7..abb49dda 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h @@ -93,6 +93,7 @@ import void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); import void OPT_Init (OPS_Name name, SET opt); import void OPT_Insert (OPS_Name name, OPT_Object *obj); import void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); +import int32 OPT_IntSize (int64 n); import OPT_Struct OPT_IntType (int64 size); import OPT_Const OPT_NewConst (void); import OPT_ConstExt OPT_NewExt (void); diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 04c24f09..48080e50 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index 937f0ba6..33c1eeeb 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 874e4d6d..55230bcc 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index 86dbc3cb..d5e89ca2 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 08445989..e81db820 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index 44e13bae..dec142cf 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index ad3ef185..6aa3846a 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index 23e3adb8..d1c9f056 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index 5a607fdd..37fac00b 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -1054,7 +1054,7 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int64 x, int64 n) { int32 i; int64 x0; - CHAR a[22]; + CHAR a[24]; i = 0; if (x < 0) { if (x == (-9223372036854775807-1)) { @@ -1068,7 +1068,7 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int64 x, int64 n) x0 = x; } do { - a[__X(i, 22)] = (CHAR)(__MOD(x0, 10) + 48); + a[__X(i, 24)] = (CHAR)(__MOD(x0, 10) + 48); x0 = __DIV(x0, 10); i += 1; } while (!(x0 == 0)); @@ -1081,7 +1081,7 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int64 x, int64 n) } do { i -= 1; - Texts_Write(&*W, W__typ, a[__X(i, 22)]); + Texts_Write(&*W, W__typ, a[__X(i, 24)]); } while (!(i == 0)); } diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index f18817ff..0f195ce8 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/Vishap.c b/bootstrap/unix-88/Vishap.c index 1bc7e5ed..00f0ac1a 100644 --- a/bootstrap/unix-88/Vishap.c +++ b/bootstrap/unix-88/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkamSf */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/errors.c b/bootstrap/unix-88/errors.c index 8d3792df..8396896b 100644 --- a/bootstrap/unix-88/errors.c +++ b/bootstrap/unix-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/errors.h b/bootstrap/unix-88/errors.h index f5c1a708..b3535e92 100644 --- a/bootstrap/unix-88/errors.h +++ b/bootstrap/unix-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index d7c28163..a4fbedda 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index 6815aacb..414a05f0 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/vt100.c b/bootstrap/unix-88/vt100.c index a575d688..04503b55 100644 --- a/bootstrap/unix-88/vt100.c +++ b/bootstrap/unix-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/vt100.h b/bootstrap/unix-88/vt100.h index f0786605..c27f0ae1 100644 --- a/bootstrap/unix-88/vt100.h +++ b/bootstrap/unix-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index 1a0e2ffe..4ea29c15 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/18] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/20] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index e5d79317..6b8f5d99 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Console.c b/bootstrap/windows-48/Console.c index ebbcbb49..6409cfb5 100644 --- a/bootstrap/windows-48/Console.c +++ b/bootstrap/windows-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Console.h b/bootstrap/windows-48/Console.h index e5dc1566..8f5a2a2a 100644 --- a/bootstrap/windows-48/Console.h +++ b/bootstrap/windows-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 25e50dd9..d55dffcd 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index b499ee0a..8b2d7bab 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index b80b6666..08a21c58 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tskSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index 50308888..65b6b0b1 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index 142b60f4..f61acc40 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index 2dc36a9b..6841c244 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index 47f2de21..13c64396 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -221,18 +221,7 @@ OPT_Node OPB_EmptySet (void) static void OPB_SetIntType (OPT_Node node) { - int16 b; - int64 n; - if (node->conval->intval >= 0) { - n = node->conval->intval; - } else { - n = -(node->conval->intval + 1); - } - b = 1; - while ((b < 8 && __ASH(n, -(__ASHL(b, 3) - 1)) != 0)) { - b += 1; - } - node->typ = OPT_IntType(b); + node->typ = OPT_IntType(OPT_IntSize(node->conval->intval)); } OPT_Node OPB_NewIntConst (int64 intval) diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index 08d025bf..a57ace75 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index c21e44a4..9923ccbc 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index 9e1ec652..83153512 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index ba86c00a..558dde61 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index 504519da..c5298326 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index 44ce8ff1..5351781f 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index 22557b29..7cbdb873 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index f80ca2b1..67bca013 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index d33103c1..3f106d0c 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index fa5401ee..c1bc93b1 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -139,6 +139,7 @@ export void OPT_Init (OPS_Name name, SET opt); static void OPT_InitStruct (OPT_Struct *typ, int8 form); export void OPT_Insert (OPS_Name name, OPT_Object *obj); export void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); +export int16 OPT_IntSize (int64 n); export OPT_Struct OPT_IntType (int32 size); export OPT_Const OPT_NewConst (void); export OPT_ConstExt OPT_NewExt (void); @@ -164,6 +165,21 @@ static void OPT_err (int16 n) OPM_err(n); } +int16 OPT_IntSize (int64 n) +{ + int16 _o_result; + int16 bytes; + if (n < 0) { + n = -(n + 1); + } + bytes = 1; + while ((bytes < 8 && __ASH(n, -(__ASHL(bytes, 3) - 1)) != 0)) { + bytes += 1; + } + _o_result = bytes; + return _o_result; +} + OPT_Struct OPT_IntType (int32 size) { OPT_Struct _o_result; diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index b6566702..fd0a538e 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h @@ -94,6 +94,7 @@ import void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); import void OPT_Init (OPS_Name name, SET opt); import void OPT_Insert (OPS_Name name, OPT_Object *obj); import void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); +import int16 OPT_IntSize (int64 n); import OPT_Struct OPT_IntType (int32 size); import OPT_Const OPT_NewConst (void); import OPT_ConstExt OPT_NewExt (void); diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index cddb737c..ffe3eb71 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index 937f0ba6..33c1eeeb 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 614e2cb6..35849e85 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index cfea54a7..84dc9bd1 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 8b263757..6982b582 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index 6ff22ad6..e79f35d7 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index 8758a988..b2d5f19a 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index 36e01e6c..ea987a3e 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index e14d923b..f277a856 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -221,7 +221,7 @@ export void Texts_Write (Texts_Writer *W, LONGINT *W__typ, CHAR ch); export void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, int32 t, int32 d); export void Texts_WriteElem (Texts_Writer *W, LONGINT *W__typ, Texts_Elem e); export void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, int32 x); -export void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int32 x, int32 n); +export void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int64 x, int64 n); export void Texts_WriteLn (Texts_Writer *W, LONGINT *W__typ); export void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, int16 n); export void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x); @@ -1050,15 +1050,15 @@ void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__le __DEL(s); } -void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int32 x, int32 n) +void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int64 x, int64 n) { int16 i; - int32 x0; - CHAR a[22]; + int64 x0; + CHAR a[24]; i = 0; if (x < 0) { - if (x == (-2147483647-1)) { - Texts_WriteString(&*W, W__typ, (CHAR*)" -2147483648", 13); + if (x == (-9223372036854775807-1)) { + Texts_WriteString(&*W, W__typ, (CHAR*)" -9223372036854775808", 22); return; } else { n -= 1; @@ -1068,11 +1068,11 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int32 x, int32 n) x0 = x; } do { - a[__X(i, 22)] = (CHAR)((int)__MOD(x0, 10) + 48); + a[__X(i, 24)] = (CHAR)(__MOD(x0, 10) + 48); x0 = __DIV(x0, 10); i += 1; } while (!(x0 == 0)); - while (n > i) { + while (n > (int64)i) { Texts_Write(&*W, W__typ, ' '); n -= 1; } @@ -1081,7 +1081,7 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int32 x, int32 n) } do { i -= 1; - Texts_Write(&*W, W__typ, a[__X(i, 22)]); + Texts_Write(&*W, W__typ, a[__X(i, 24)]); } while (!(i == 0)); } diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index 45ca0bb5..b2a965f8 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h @@ -159,7 +159,7 @@ import void Texts_Write (Texts_Writer *W, LONGINT *W__typ, CHAR ch); import void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, int32 t, int32 d); import void Texts_WriteElem (Texts_Writer *W, LONGINT *W__typ, Texts_Elem e); import void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, int32 x); -import void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int32 x, int32 n); +import void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int64 x, int64 n); import void Texts_WriteLn (Texts_Writer *W, LONGINT *W__typ); import void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, int16 n); import void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x); diff --git a/bootstrap/windows-48/Vishap.c b/bootstrap/windows-48/Vishap.c index 1f322c5e..2d0b9dee 100644 --- a/bootstrap/windows-48/Vishap.c +++ b/bootstrap/windows-48/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkamSf */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/errors.c b/bootstrap/windows-48/errors.c index 689e3cdd..2bdf2af6 100644 --- a/bootstrap/windows-48/errors.c +++ b/bootstrap/windows-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/errors.h b/bootstrap/windows-48/errors.h index f5c1a708..b3535e92 100644 --- a/bootstrap/windows-48/errors.h +++ b/bootstrap/windows-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index c2339121..5245f35d 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index 6815aacb..414a05f0 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/vt100.c b/bootstrap/windows-48/vt100.c index 341502ec..4d312413 100644 --- a/bootstrap/windows-48/vt100.c +++ b/bootstrap/windows-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/vt100.h b/bootstrap/windows-48/vt100.h index f7615911..1ecf99b1 100644 --- a/bootstrap/windows-48/vt100.h +++ b/bootstrap/windows-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index ec75a6df..a5c4087d 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/18] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/20] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index e5d79317..6b8f5d99 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Console.c b/bootstrap/windows-88/Console.c index 1f28b96d..a18275f8 100644 --- a/bootstrap/windows-88/Console.c +++ b/bootstrap/windows-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Console.h b/bootstrap/windows-88/Console.h index 23f894db..a1322efe 100644 --- a/bootstrap/windows-88/Console.h +++ b/bootstrap/windows-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index d94e42ad..ead58244 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 9ea6ac78..94cf47a0 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index c99a229c..02dc0bbd 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tskSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index f9b4a041..aa22df29 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 662b84f9..60382d3c 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index 9f3d713d..4ef50204 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index b271fa53..d94f4b29 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -221,18 +221,7 @@ OPT_Node OPB_EmptySet (void) static void OPB_SetIntType (OPT_Node node) { - int32 b; - int64 n; - if (node->conval->intval >= 0) { - n = node->conval->intval; - } else { - n = -(node->conval->intval + 1); - } - b = 1; - while ((b < 8 && __ASH(n, -(__ASHL(b, 3) - 1)) != 0)) { - b += 1; - } - node->typ = OPT_IntType(b); + node->typ = OPT_IntType(OPT_IntSize(node->conval->intval)); } OPT_Node OPB_NewIntConst (int64 intval) diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index 185aa968..1330baf1 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index 689dfff4..b33dc59f 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index bf22de26..e749f6b6 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 47c8a9be..39c62389 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index 9d977ff8..908a80ad 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index 5150cdbe..8573d6b1 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index 22557b29..7cbdb873 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index 7caa7493..a92e1feb 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index 6d67036e..d7c08330 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index b588c3f1..6928030e 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -138,6 +138,7 @@ export void OPT_Init (OPS_Name name, SET opt); static void OPT_InitStruct (OPT_Struct *typ, int8 form); export void OPT_Insert (OPS_Name name, OPT_Object *obj); export void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); +export int32 OPT_IntSize (int64 n); export OPT_Struct OPT_IntType (int64 size); export OPT_Const OPT_NewConst (void); export OPT_ConstExt OPT_NewExt (void); @@ -163,6 +164,21 @@ static void OPT_err (int32 n) OPM_err(n); } +int32 OPT_IntSize (int64 n) +{ + int32 _o_result; + int32 bytes; + if (n < 0) { + n = -(n + 1); + } + bytes = 1; + while ((bytes < 8 && __ASH(n, -(__ASHL(bytes, 3) - 1)) != 0)) { + bytes += 1; + } + _o_result = bytes; + return _o_result; +} + OPT_Struct OPT_IntType (int64 size) { OPT_Struct _o_result; diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 504e70b7..abb49dda 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h @@ -93,6 +93,7 @@ import void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); import void OPT_Init (OPS_Name name, SET opt); import void OPT_Insert (OPS_Name name, OPT_Object *obj); import void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); +import int32 OPT_IntSize (int64 n); import OPT_Struct OPT_IntType (int64 size); import OPT_Const OPT_NewConst (void); import OPT_ConstExt OPT_NewExt (void); diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 04c24f09..48080e50 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index 937f0ba6..33c1eeeb 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 5af3b5f2..a576c90e 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index a94b93a8..7832ec0f 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 08445989..e81db820 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index 44e13bae..dec142cf 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index ad3ef185..6aa3846a 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index 23e3adb8..d1c9f056 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index 5a607fdd..37fac00b 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -1054,7 +1054,7 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int64 x, int64 n) { int32 i; int64 x0; - CHAR a[22]; + CHAR a[24]; i = 0; if (x < 0) { if (x == (-9223372036854775807-1)) { @@ -1068,7 +1068,7 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int64 x, int64 n) x0 = x; } do { - a[__X(i, 22)] = (CHAR)(__MOD(x0, 10) + 48); + a[__X(i, 24)] = (CHAR)(__MOD(x0, 10) + 48); x0 = __DIV(x0, 10); i += 1; } while (!(x0 == 0)); @@ -1081,7 +1081,7 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int64 x, int64 n) } do { i -= 1; - Texts_Write(&*W, W__typ, a[__X(i, 22)]); + Texts_Write(&*W, W__typ, a[__X(i, 24)]); } while (!(i == 0)); } diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index f18817ff..0f195ce8 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/Vishap.c b/bootstrap/windows-88/Vishap.c index 1bc7e5ed..00f0ac1a 100644 --- a/bootstrap/windows-88/Vishap.c +++ b/bootstrap/windows-88/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkamSf */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/errors.c b/bootstrap/windows-88/errors.c index 8d3792df..8396896b 100644 --- a/bootstrap/windows-88/errors.c +++ b/bootstrap/windows-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/errors.h b/bootstrap/windows-88/errors.h index f5c1a708..b3535e92 100644 --- a/bootstrap/windows-88/errors.h +++ b/bootstrap/windows-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index d7c28163..a4fbedda 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index 6815aacb..414a05f0 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/vt100.c b/bootstrap/windows-88/vt100.c index a575d688..04503b55 100644 --- a/bootstrap/windows-88/vt100.c +++ b/bootstrap/windows-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/vt100.h b/bootstrap/windows-88/vt100.h index f0786605..c27f0ae1 100644 --- a/bootstrap/windows-88/vt100.h +++ b/bootstrap/windows-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/src/compiler/OPB.Mod b/src/compiler/OPB.Mod index 09805f14..79c81b1c 100644 --- a/src/compiler/OPB.Mod +++ b/src/compiler/OPB.Mod @@ -105,12 +105,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) END EmptySet; PROCEDURE SetIntType(node: OPT.Node); - VAR b: INTEGER; n: SYSTEM.INT64; - BEGIN - (* Determine number of bytes required to represent constant value *) - IF node.conval.intval >= 0 THEN n := node.conval.intval ELSE n := -(node.conval.intval+1) END; - b := 1; WHILE (b < 8) & (ASH(n, -(8*b-1)) # 0) DO INC(b) END; - node.typ := OPT.IntType(b) + BEGIN node.typ := OPT.IntType(OPT.IntSize(node.conval.intval)) END SetIntType; PROCEDURE NewIntConst*(intval: SYSTEM.INT64): OPT.Node; diff --git a/src/compiler/OPT.Mod b/src/compiler/OPT.Mod index c4b30065..7d67c2b5 100644 --- a/src/compiler/OPT.Mod +++ b/src/compiler/OPT.Mod @@ -212,6 +212,14 @@ VAR PROCEDURE err(n: INTEGER); BEGIN OPM.err(n) END err; +PROCEDURE IntSize*(n: SYSTEM.INT64):INTEGER; +(* Determines number of bytes required to store signed value n. *) + VAR bytes: INTEGER; +BEGIN + IF n < 0 THEN n := -(n+1) END; + bytes := 1; WHILE (bytes < 8) & (ASH(n, -(8*bytes-1)) # 0) DO INC(bytes) END; + RETURN bytes +END IntSize; PROCEDURE IntType*(size: LONGINT): Struct; (* Selects smallest standard integer type for given size in bytes *) diff --git a/src/library/s3/ethMD5.Mod b/src/library/s3/ethMD5.Mod index 32c31bd8..07a605cb 100644 --- a/src/library/s3/ethMD5.Mod +++ b/src/library/s3/ethMD5.Mod @@ -4,6 +4,8 @@ Refer to the "General ETH Oberon System Source License" contract available at: h MODULE ethMD5; (** portable *) (* ejz *) IMPORT SYSTEM; +(* todo. Use fixed size integers and sets. *) + (** The MD5 Message-Digest Algorithm (RFC1321) The algorithm takes as input a message of arbitrary length and produces @@ -29,10 +31,10 @@ under a public-key cryptosystem such as RSA. *) VAR cont: Context; BEGIN NEW(cont); - cont.buf[0] := 067452301H; - cont.buf[1] := 0EFCDAB89H; - cont.buf[2] := 098BADCFEH; - cont.buf[3] := 010325476H; + cont.buf[0] := 00000000067452301H; + cont.buf[1] := 0FFFFFFFFEFCDAB89H; + cont.buf[2] := 0FFFFFFFF98BADCFEH; + cont.buf[3] := 00000000010325476H; cont.bits := 0; RETURN cont END New; @@ -107,73 +109,73 @@ under a public-key cryptosystem such as RSA. *) BEGIN a := buf[0]; b := buf[1]; c := buf[2]; d := buf[3]; - STEP1(a, b, c, d, in[0]+0D76AA478H, 7); - STEP1(d, a, b, c, in[1]+0E8C7B756H, 12); - STEP1(c, d, a, b, in[2]+0242070DBH, 17); - STEP1(b, c, d, a, in[3]+0C1BDCEEEH, 22); - STEP1(a, b, c, d, in[4]+0F57C0FAFH, 7); - STEP1(d, a, b, c, in[5]+04787C62AH, 12); - STEP1(c, d, a, b, in[6]+0A8304613H, 17); - STEP1(b, c, d, a, in[7]+0FD469501H, 22); - STEP1(a, b, c, d, in[8]+0698098D8H, 7); - STEP1(d, a, b, c, in[9]+08B44F7AFH, 12); - STEP1(c, d, a, b, in[10]+0FFFF5BB1H, 17); - STEP1(b, c, d, a, in[11]+0895CD7BEH, 22); - STEP1(a, b, c, d, in[12]+06B901122H, 7); - STEP1(d, a, b, c, in[13]+0FD987193H, 12); - STEP1(c, d, a, b, in[14]+0A679438EH, 17); - STEP1(b, c, d, a, in[15]+049B40821H, 22); + STEP1(a, b, c, d, in[0] + 0FFFFFFFFD76AA478H, 7); + STEP1(d, a, b, c, in[1] + 0FFFFFFFFE8C7B756H, 12); + STEP1(c, d, a, b, in[2] + 000000000242070DBH, 17); + STEP1(b, c, d, a, in[3] + 0FFFFFFFFC1BDCEEEH, 22); + STEP1(a, b, c, d, in[4] + 0FFFFFFFFF57C0FAFH, 7); + STEP1(d, a, b, c, in[5] + 0000000004787C62AH, 12); + STEP1(c, d, a, b, in[6] + 0FFFFFFFFA8304613H, 17); + STEP1(b, c, d, a, in[7] + 0FFFFFFFFFD469501H, 22); + STEP1(a, b, c, d, in[8] + 000000000698098D8H, 7); + STEP1(d, a, b, c, in[9] + 0FFFFFFFF8B44F7AFH, 12); + STEP1(c, d, a, b, in[10] + 0FFFFFFFFFFFF5BB1H, 17); + STEP1(b, c, d, a, in[11] + 0FFFFFFFF895CD7BEH, 22); + STEP1(a, b, c, d, in[12] + 0000000006B901122H, 7); + STEP1(d, a, b, c, in[13] + 0FFFFFFFFFD987193H, 12); + STEP1(c, d, a, b, in[14] + 0FFFFFFFFA679438EH, 17); + STEP1(b, c, d, a, in[15] + 00000000049B40821H, 22); - STEP2(a, b, c, d, in[1]+0F61E2562H, 5); - STEP2(d, a, b, c, in[6]+0C040B340H, 9); - STEP2(c, d, a, b, in[11]+0265E5A51H, 14); - STEP2(b, c, d, a, in[0]+0E9B6C7AAH, 20); - STEP2(a, b, c, d, in[5]+0D62F105DH, 5); - STEP2(d, a, b, c, in[10]+02441453H, 9); - STEP2(c, d, a, b, in[15]+0D8A1E681H, 14); - STEP2(b, c, d, a, in[4]+0E7D3FBC8H, 20); - STEP2(a, b, c, d, in[9]+021E1CDE6H, 5); - STEP2(d, a, b, c, in[14]+0C33707D6H, 9); - STEP2(c, d, a, b, in[3]+0F4D50D87H, 14); - STEP2(b, c, d, a, in[8]+0455A14EDH, 20); - STEP2(a, b, c, d, in[13]+0A9E3E905H, 5); - STEP2(d, a, b, c, in[2]+0FCEFA3F8H, 9); - STEP2(c, d, a, b, in[7]+0676F02D9H, 14); - STEP2(b, c, d, a, in[12]+08D2A4C8AH, 20); + STEP2(a, b, c, d, in[1] + 0FFFFFFFFF61E2562H, 5); + STEP2(d, a, b, c, in[6] + 0FFFFFFFFC040B340H, 9); + STEP2(c, d, a, b, in[11] + 000000000265E5A51H, 14); + STEP2(b, c, d, a, in[0] + 0FFFFFFFFE9B6C7AAH, 20); + STEP2(a, b, c, d, in[5] + 0FFFFFFFFD62F105DH, 5); + STEP2(d, a, b, c, in[10] + 00000000002441453H, 9); + STEP2(c, d, a, b, in[15] + 0FFFFFFFFD8A1E681H, 14); + STEP2(b, c, d, a, in[4] + 0FFFFFFFFE7D3FBC8H, 20); + STEP2(a, b, c, d, in[9] + 00000000021E1CDE6H, 5); + STEP2(d, a, b, c, in[14] + 0FFFFFFFFC33707D6H, 9); + STEP2(c, d, a, b, in[3] + 0FFFFFFFFF4D50D87H, 14); + STEP2(b, c, d, a, in[8] + 000000000455A14EDH, 20); + STEP2(a, b, c, d, in[13] + 0FFFFFFFFA9E3E905H, 5); + STEP2(d, a, b, c, in[2] + 0FFFFFFFFFCEFA3F8H, 9); + STEP2(c, d, a, b, in[7] + 000000000676F02D9H, 14); + STEP2(b, c, d, a, in[12] + 0FFFFFFFF8D2A4C8AH, 20); - STEP3(a, b, c, d, in[5]+0FFFA3942H, 4); - STEP3(d, a, b, c, in[8]+08771F681H, 11); - STEP3(c, d, a, b, in[11]+06D9D6122H, 16); - STEP3(b, c, d, a, in[14]+0FDE5380CH, 23); - STEP3(a, b, c, d, in[1]+0A4BEEA44H, 4); - STEP3(d, a, b, c, in[4]+04BDECFA9H, 11); - STEP3(c, d, a, b, in[7]+0F6BB4B60H, 16); - STEP3(b, c, d, a, in[10]+0BEBFBC70H, 23); - STEP3(a, b, c, d, in[13]+0289B7EC6H, 4); - STEP3(d, a, b, c, in[0]+0EAA127FAH, 11); - STEP3(c, d, a, b, in[3]+0D4EF3085H, 16); - STEP3(b, c, d, a, in[6]+04881D05H, 23); - STEP3(a, b, c, d, in[9]+0D9D4D039H, 4); - STEP3(d, a, b, c, in[12]+0E6DB99E5H, 11); - STEP3(c, d, a, b, in[15]+01FA27CF8H, 16); - STEP3(b, c, d, a, in[2]+0C4AC5665H, 23); + STEP3(a, b, c, d, in[5] + 0FFFFFFFFFFFA3942H, 4); + STEP3(d, a, b, c, in[8] + 0FFFFFFFF8771F681H, 11); + STEP3(c, d, a, b, in[11] + 0000000006D9D6122H, 16); + STEP3(b, c, d, a, in[14] + 0FFFFFFFFFDE5380CH, 23); + STEP3(a, b, c, d, in[1] + 0FFFFFFFFA4BEEA44H, 4); + STEP3(d, a, b, c, in[4] + 0000000004BDECFA9H, 11); + STEP3(c, d, a, b, in[7] + 0FFFFFFFFF6BB4B60H, 16); + STEP3(b, c, d, a, in[10] + 0FFFFFFFFBEBFBC70H, 23); + STEP3(a, b, c, d, in[13] + 000000000289B7EC6H, 4); + STEP3(d, a, b, c, in[0] + 0FFFFFFFFEAA127FAH, 11); + STEP3(c, d, a, b, in[3] + 0FFFFFFFFD4EF3085H, 16); + STEP3(b, c, d, a, in[6] + 00000000004881D05H, 23); + STEP3(a, b, c, d, in[9] + 0FFFFFFFFD9D4D039H, 4); + STEP3(d, a, b, c, in[12] + 0FFFFFFFFE6DB99E5H, 11); + STEP3(c, d, a, b, in[15] + 0000000001FA27CF8H, 16); + STEP3(b, c, d, a, in[2] + 0FFFFFFFFC4AC5665H, 23); - STEP4(a, b, c, d, in[0]+0F4292244H, 6); - STEP4(d, a, b, c, in[7]+0432AFF97H, 10); - STEP4(c, d, a, b, in[14]+0AB9423A7H, 15); - STEP4(b, c, d, a, in[5]+0FC93A039H, 21); - STEP4(a, b, c, d, in[12]+0655B59C3H, 6); - STEP4(d, a, b, c, in[3]+08F0CCC92H, 10); - STEP4(c, d, a, b, in[10]+0FFEFF47DH, 15); - STEP4(b, c, d, a, in[1]+085845DD1H, 21); - STEP4(a, b, c, d, in[8]+06FA87E4FH, 6); - STEP4(d, a, b, c, in[15]+0FE2CE6E0H, 10); - STEP4(c, d, a, b, in[6]+0A3014314H, 15); - STEP4(b, c, d, a, in[13]+04E0811A1H, 21); - STEP4(a, b, c, d, in[4]+0F7537E82H, 6); - STEP4(d, a, b, c, in[11]+ 0BD3AF235H, 10); - STEP4(c, d, a, b, in[2]+02AD7D2BBH, 15); - STEP4(b, c, d, a, in[9]+0EB86D391H, 21); + STEP4(a, b, c, d, in[0] + 0FFFFFFFFF4292244H, 6); + STEP4(d, a, b, c, in[7] + 000000000432AFF97H, 10); + STEP4(c, d, a, b, in[14] + 0FFFFFFFFAB9423A7H, 15); + STEP4(b, c, d, a, in[5] + 0FFFFFFFFFC93A039H, 21); + STEP4(a, b, c, d, in[12] + 000000000655B59C3H, 6); + STEP4(d, a, b, c, in[3] + 0FFFFFFFF8F0CCC92H, 10); + STEP4(c, d, a, b, in[10] + 0FFFFFFFFFFEFF47DH, 15); + STEP4(b, c, d, a, in[1] + 0FFFFFFFF85845DD1H, 21); + STEP4(a, b, c, d, in[8] + 0000000006FA87E4FH, 6); + STEP4(d, a, b, c, in[15] + 0FFFFFFFFFE2CE6E0H, 10); + STEP4(c, d, a, b, in[6] + 0FFFFFFFFA3014314H, 15); + STEP4(b, c, d, a, in[13] + 0000000004E0811A1H, 21); + STEP4(a, b, c, d, in[4] + 0FFFFFFFFF7537E82H, 6); + STEP4(d, a, b, c, in[11] + 0FFFFFFFFBD3AF235H, 10); + STEP4(c, d, a, b, in[2] + 0000000002AD7D2BBH, 15); + STEP4(b, c, d, a, in[9] + 0FFFFFFFFEB86D391H, 21); INC(buf[0], a); INC(buf[1], b); INC(buf[2], c); INC(buf[3], d) diff --git a/src/test/confidence/planned-binary-change b/src/test/confidence/planned-binary-change index 9613b179..5a45ccfe 100644 --- a/src/test/confidence/planned-binary-change +++ b/src/test/confidence/planned-binary-change @@ -1 +1 @@ -14 Sep 2016 13:59:08 +20 Sep 2016 16:42:29 diff --git a/src/tools/make/vishap.make b/src/tools/make/vishap.make index 008180cb..faacf33f 100644 --- a/src/tools/make/vishap.make +++ b/src/tools/make/vishap.make @@ -335,7 +335,7 @@ misc: s3: @printf "\nMaking s3 library\n" cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/s3/ethBTrees.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/s3/ethMD5.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/s3/ethMD5.Mod cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/s3/ethSets.Mod cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/s3/ethZlib.Mod cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/s3/ethZlibBuffers.Mod From 0ea077814f5e67422d2ee106e2aa0f25d75b978e Mon Sep 17 00:00:00 2001 From: David Brown Date: Tue, 20 Sep 2016 17:51:14 +0100 Subject: [PATCH 238/580] More LONGINT changes to INT64. Hopefully fixes android and pi builds. --- bootstrap/unix-44/OPB.c | 20 ++++++++++---------- bootstrap/unix-44/OPM.c | 20 ++++++++++---------- bootstrap/unix-44/OPM.h | 6 +++--- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-48/OPB.c | 20 ++++++++++---------- bootstrap/unix-48/OPM.c | 20 ++++++++++---------- bootstrap/unix-48/OPM.h | 6 +++--- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-88/OPB.c | 6 +++--- bootstrap/windows-48/OPB.c | 20 ++++++++++---------- bootstrap/windows-48/OPM.c | 20 ++++++++++---------- bootstrap/windows-48/OPM.h | 6 +++--- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-88/OPB.c | 6 +++--- makefile | 19 +++++++++++++++++++ src/compiler/OPB.Mod | 22 +++++++++++----------- src/compiler/OPM.cmdln.Mod | 8 ++++---- src/tools/make/vishap.make | 2 +- 18 files changed, 113 insertions(+), 94 deletions(-) diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index 13c64396..3ec5dfc2 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -17,7 +17,7 @@ static int64 OPB_maxExp; export void OPB_Assign (OPT_Node *x, OPT_Node y); static void OPB_BindNodes (int8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y); -static int32 OPB_BoolToInt (BOOLEAN b); +static int16 OPB_BoolToInt (BOOLEAN b); export void OPB_Call (OPT_Node *x, OPT_Node apar, OPT_Object fp); static void OPB_CharToString (OPT_Node n); static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode); @@ -128,9 +128,9 @@ void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y) *last = y; } -static int32 OPB_BoolToInt (BOOLEAN b) +static int16 OPB_BoolToInt (BOOLEAN b) { - int32 _o_result; + int16 _o_result; if (b) { _o_result = 1; return _o_result; @@ -931,7 +931,7 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) if (f == 4) { xv = xval->intval; yv = yval->intval; - if (((((xv == 0 || yv == 0) || (((xv > 0 && yv > 0)) && yv <= __DIV(2147483647, xv))) || (((xv > 0 && yv < 0)) && yv >= __DIV((-2147483647-1), xv))) || (((xv < 0 && yv > 0)) && xv >= __DIV((-2147483647-1), yv))) || (((((((xv < 0 && yv < 0)) && xv != (-2147483647-1))) && yv != (-2147483647-1))) && -xv <= __DIV(2147483647, -yv))) { + if (((((xv == 0 || yv == 0) || (((xv > 0 && yv > 0)) && yv <= __DIV(9223372036854775807, xv))) || (((xv > 0 && yv < 0)) && yv >= __DIV((-9223372036854775807-1), xv))) || (((xv < 0 && yv > 0)) && xv >= __DIV((-9223372036854775807-1), yv))) || (((((((xv < 0 && yv < 0)) && xv != (-9223372036854775807-1))) && yv != (-9223372036854775807-1))) && -xv <= __DIV(9223372036854775807, -yv))) { xval->intval = xv * yv; OPB_SetIntType(x); } else { @@ -1008,8 +1008,8 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) break; case 6: if (f == 4) { - temp = (yval->intval >= 0 && xval->intval <= 2147483647 - yval->intval); - if (temp || (yval->intval < 0 && xval->intval >= (-2147483647-1) - yval->intval)) { + temp = (yval->intval >= 0 && xval->intval <= 9223372036854775807 - yval->intval); + if (temp || (yval->intval < 0 && xval->intval >= (-9223372036854775807-1) - yval->intval)) { xval->intval += yval->intval; OPB_SetIntType(x); } else { @@ -1031,7 +1031,7 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) break; case 7: if (f == 4) { - if ((yval->intval >= 0 && xval->intval >= (-2147483647-1) + yval->intval) || (yval->intval < 0 && xval->intval <= 2147483647 + yval->intval)) { + if ((yval->intval >= 0 && xval->intval >= (-9223372036854775807-1) + yval->intval) || (yval->intval < 0 && xval->intval <= 9223372036854775807 + yval->intval)) { xval->intval -= yval->intval; OPB_SetIntType(x); } else { @@ -1133,7 +1133,7 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) OPB_CheckRealType(g, 203, (*x)->conval); } else { r = (*x)->conval->realval; - if (r < -2.14748364800000e+009 || r > 2.14748364700000e+009) { + if (r < -9.22337203685478e+018 || r > 9.22337203685478e+018) { OPB_err(203); r = (LONGREAL)1; } @@ -2126,7 +2126,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) OPB_err(126); } else if (p->typ->comp == 3) { if (f == 4) { - if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > (int64)OPM_MaxIndex))) { + if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > OPM_MaxIndex))) { OPB_err(63); } } else { @@ -2264,7 +2264,7 @@ void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n) } else if (p->typ->comp != 3) { OPB_err(64); } else if (f == 4) { - if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > (int64)OPM_MaxIndex))) { + if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > OPM_MaxIndex))) { OPB_err(63); } node = p->right; diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 558dde61..775776f4 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -20,7 +20,7 @@ typedef static CHAR OPM_SourceFileName[256]; export int16 OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet; -export int32 OPM_MaxIndex; +export int64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; export int32 OPM_curpos, OPM_errpos, OPM_breakpc; @@ -72,8 +72,8 @@ export BOOLEAN OPM_OpenPar (void); export void OPM_RegisterNewSym (void); static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt); static void OPM_ShowLine (int64 pos); -export int32 OPM_SignedMaximum (int32 bytecount); -export int32 OPM_SignedMinimum (int32 bytecount); +export int64 OPM_SignedMaximum (int32 bytecount); +export int64 OPM_SignedMinimum (int32 bytecount); export void OPM_SymRCh (CHAR *ch); export int32 OPM_SymRInt (void); export int64 OPM_SymRInt64 (void); @@ -665,19 +665,19 @@ static void OPM_VerboseListSizes (void) OPM_LogWLn(); } -int32 OPM_SignedMaximum (int32 bytecount) +int64 OPM_SignedMaximum (int32 bytecount) { - int32 _o_result; - int32 result; + int64 _o_result; + int64 result; result = 1; - result = __LSH(result, __ASHL(bytecount, 3) - 1, 32); + result = __LSH(result, __ASHL(bytecount, 3) - 1, 64); _o_result = result - 1; return _o_result; } -int32 OPM_SignedMinimum (int32 bytecount) +int64 OPM_SignedMinimum (int32 bytecount) { - int32 _o_result; + int64 _o_result; _o_result = -OPM_SignedMaximum(bytecount) - 1; return _o_result; } @@ -871,7 +871,7 @@ void OPM_WriteInt (int64 i) { CHAR s[24]; int64 i1, k; - if ((i == (int64)OPM_SignedMinimum(OPM_IntSize) || i == (int64)OPM_SignedMinimum(OPM_LIntSize)) || i == (int64)OPM_SignedMinimum(8)) { + if ((i == OPM_SignedMinimum(OPM_IntSize) || i == OPM_SignedMinimum(OPM_LIntSize)) || i == OPM_SignedMinimum(8)) { OPM_Write('('); OPM_WriteInt(i + 1); OPM_WriteString((CHAR*)"-1)", 4); diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index c5298326..9d7661c6 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -7,7 +7,7 @@ import int16 OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet; -import int32 OPM_MaxIndex; +import int64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; import int32 OPM_curpos, OPM_errpos, OPM_breakpc; @@ -40,8 +40,8 @@ import void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); import void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); import BOOLEAN OPM_OpenPar (void); import void OPM_RegisterNewSym (void); -import int32 OPM_SignedMaximum (int32 bytecount); -import int32 OPM_SignedMinimum (int32 bytecount); +import int64 OPM_SignedMaximum (int32 bytecount); +import int64 OPM_SignedMinimum (int32 bytecount); import void OPM_SymRCh (CHAR *ch); import int32 OPM_SymRInt (void); import int64 OPM_SymRInt64 (void); diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index 5351781f..86101b2b 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -275,7 +275,7 @@ static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) OPP_ConstExpression(&x); if (x->typ->form == 4) { n = x->conval->intval; - if (n <= 0 || n > (int64)OPM_MaxIndex) { + if (n <= 0 || n > OPM_MaxIndex) { OPP_err(63); n = 1; } diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index 13c64396..3ec5dfc2 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -17,7 +17,7 @@ static int64 OPB_maxExp; export void OPB_Assign (OPT_Node *x, OPT_Node y); static void OPB_BindNodes (int8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y); -static int32 OPB_BoolToInt (BOOLEAN b); +static int16 OPB_BoolToInt (BOOLEAN b); export void OPB_Call (OPT_Node *x, OPT_Node apar, OPT_Object fp); static void OPB_CharToString (OPT_Node n); static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode); @@ -128,9 +128,9 @@ void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y) *last = y; } -static int32 OPB_BoolToInt (BOOLEAN b) +static int16 OPB_BoolToInt (BOOLEAN b) { - int32 _o_result; + int16 _o_result; if (b) { _o_result = 1; return _o_result; @@ -931,7 +931,7 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) if (f == 4) { xv = xval->intval; yv = yval->intval; - if (((((xv == 0 || yv == 0) || (((xv > 0 && yv > 0)) && yv <= __DIV(2147483647, xv))) || (((xv > 0 && yv < 0)) && yv >= __DIV((-2147483647-1), xv))) || (((xv < 0 && yv > 0)) && xv >= __DIV((-2147483647-1), yv))) || (((((((xv < 0 && yv < 0)) && xv != (-2147483647-1))) && yv != (-2147483647-1))) && -xv <= __DIV(2147483647, -yv))) { + if (((((xv == 0 || yv == 0) || (((xv > 0 && yv > 0)) && yv <= __DIV(9223372036854775807, xv))) || (((xv > 0 && yv < 0)) && yv >= __DIV((-9223372036854775807-1), xv))) || (((xv < 0 && yv > 0)) && xv >= __DIV((-9223372036854775807-1), yv))) || (((((((xv < 0 && yv < 0)) && xv != (-9223372036854775807-1))) && yv != (-9223372036854775807-1))) && -xv <= __DIV(9223372036854775807, -yv))) { xval->intval = xv * yv; OPB_SetIntType(x); } else { @@ -1008,8 +1008,8 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) break; case 6: if (f == 4) { - temp = (yval->intval >= 0 && xval->intval <= 2147483647 - yval->intval); - if (temp || (yval->intval < 0 && xval->intval >= (-2147483647-1) - yval->intval)) { + temp = (yval->intval >= 0 && xval->intval <= 9223372036854775807 - yval->intval); + if (temp || (yval->intval < 0 && xval->intval >= (-9223372036854775807-1) - yval->intval)) { xval->intval += yval->intval; OPB_SetIntType(x); } else { @@ -1031,7 +1031,7 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) break; case 7: if (f == 4) { - if ((yval->intval >= 0 && xval->intval >= (-2147483647-1) + yval->intval) || (yval->intval < 0 && xval->intval <= 2147483647 + yval->intval)) { + if ((yval->intval >= 0 && xval->intval >= (-9223372036854775807-1) + yval->intval) || (yval->intval < 0 && xval->intval <= 9223372036854775807 + yval->intval)) { xval->intval -= yval->intval; OPB_SetIntType(x); } else { @@ -1133,7 +1133,7 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) OPB_CheckRealType(g, 203, (*x)->conval); } else { r = (*x)->conval->realval; - if (r < -2.14748364800000e+009 || r > 2.14748364700000e+009) { + if (r < -9.22337203685478e+018 || r > 9.22337203685478e+018) { OPB_err(203); r = (LONGREAL)1; } @@ -2126,7 +2126,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) OPB_err(126); } else if (p->typ->comp == 3) { if (f == 4) { - if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > (int64)OPM_MaxIndex))) { + if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > OPM_MaxIndex))) { OPB_err(63); } } else { @@ -2264,7 +2264,7 @@ void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n) } else if (p->typ->comp != 3) { OPB_err(64); } else if (f == 4) { - if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > (int64)OPM_MaxIndex))) { + if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > OPM_MaxIndex))) { OPB_err(63); } node = p->right; diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 558dde61..775776f4 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -20,7 +20,7 @@ typedef static CHAR OPM_SourceFileName[256]; export int16 OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet; -export int32 OPM_MaxIndex; +export int64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; export int32 OPM_curpos, OPM_errpos, OPM_breakpc; @@ -72,8 +72,8 @@ export BOOLEAN OPM_OpenPar (void); export void OPM_RegisterNewSym (void); static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt); static void OPM_ShowLine (int64 pos); -export int32 OPM_SignedMaximum (int32 bytecount); -export int32 OPM_SignedMinimum (int32 bytecount); +export int64 OPM_SignedMaximum (int32 bytecount); +export int64 OPM_SignedMinimum (int32 bytecount); export void OPM_SymRCh (CHAR *ch); export int32 OPM_SymRInt (void); export int64 OPM_SymRInt64 (void); @@ -665,19 +665,19 @@ static void OPM_VerboseListSizes (void) OPM_LogWLn(); } -int32 OPM_SignedMaximum (int32 bytecount) +int64 OPM_SignedMaximum (int32 bytecount) { - int32 _o_result; - int32 result; + int64 _o_result; + int64 result; result = 1; - result = __LSH(result, __ASHL(bytecount, 3) - 1, 32); + result = __LSH(result, __ASHL(bytecount, 3) - 1, 64); _o_result = result - 1; return _o_result; } -int32 OPM_SignedMinimum (int32 bytecount) +int64 OPM_SignedMinimum (int32 bytecount) { - int32 _o_result; + int64 _o_result; _o_result = -OPM_SignedMaximum(bytecount) - 1; return _o_result; } @@ -871,7 +871,7 @@ void OPM_WriteInt (int64 i) { CHAR s[24]; int64 i1, k; - if ((i == (int64)OPM_SignedMinimum(OPM_IntSize) || i == (int64)OPM_SignedMinimum(OPM_LIntSize)) || i == (int64)OPM_SignedMinimum(8)) { + if ((i == OPM_SignedMinimum(OPM_IntSize) || i == OPM_SignedMinimum(OPM_LIntSize)) || i == OPM_SignedMinimum(8)) { OPM_Write('('); OPM_WriteInt(i + 1); OPM_WriteString((CHAR*)"-1)", 4); diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index c5298326..9d7661c6 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -7,7 +7,7 @@ import int16 OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet; -import int32 OPM_MaxIndex; +import int64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; import int32 OPM_curpos, OPM_errpos, OPM_breakpc; @@ -40,8 +40,8 @@ import void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); import void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); import BOOLEAN OPM_OpenPar (void); import void OPM_RegisterNewSym (void); -import int32 OPM_SignedMaximum (int32 bytecount); -import int32 OPM_SignedMinimum (int32 bytecount); +import int64 OPM_SignedMaximum (int32 bytecount); +import int64 OPM_SignedMinimum (int32 bytecount); import void OPM_SymRCh (CHAR *ch); import int32 OPM_SymRInt (void); import int64 OPM_SymRInt64 (void); diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index 5351781f..86101b2b 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -275,7 +275,7 @@ static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) OPP_ConstExpression(&x); if (x->typ->form == 4) { n = x->conval->intval; - if (n <= 0 || n > (int64)OPM_MaxIndex) { + if (n <= 0 || n > OPM_MaxIndex) { OPP_err(63); n = 1; } diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index d94f4b29..bd641a09 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -17,7 +17,7 @@ static int64 OPB_maxExp; export void OPB_Assign (OPT_Node *x, OPT_Node y); static void OPB_BindNodes (int8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y); -static int64 OPB_BoolToInt (BOOLEAN b); +static int32 OPB_BoolToInt (BOOLEAN b); export void OPB_Call (OPT_Node *x, OPT_Node apar, OPT_Object fp); static void OPB_CharToString (OPT_Node n); static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode); @@ -128,9 +128,9 @@ void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y) *last = y; } -static int64 OPB_BoolToInt (BOOLEAN b) +static int32 OPB_BoolToInt (BOOLEAN b) { - int64 _o_result; + int32 _o_result; if (b) { _o_result = 1; return _o_result; diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index 13c64396..3ec5dfc2 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -17,7 +17,7 @@ static int64 OPB_maxExp; export void OPB_Assign (OPT_Node *x, OPT_Node y); static void OPB_BindNodes (int8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y); -static int32 OPB_BoolToInt (BOOLEAN b); +static int16 OPB_BoolToInt (BOOLEAN b); export void OPB_Call (OPT_Node *x, OPT_Node apar, OPT_Object fp); static void OPB_CharToString (OPT_Node n); static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode); @@ -128,9 +128,9 @@ void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y) *last = y; } -static int32 OPB_BoolToInt (BOOLEAN b) +static int16 OPB_BoolToInt (BOOLEAN b) { - int32 _o_result; + int16 _o_result; if (b) { _o_result = 1; return _o_result; @@ -931,7 +931,7 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) if (f == 4) { xv = xval->intval; yv = yval->intval; - if (((((xv == 0 || yv == 0) || (((xv > 0 && yv > 0)) && yv <= __DIV(2147483647, xv))) || (((xv > 0 && yv < 0)) && yv >= __DIV((-2147483647-1), xv))) || (((xv < 0 && yv > 0)) && xv >= __DIV((-2147483647-1), yv))) || (((((((xv < 0 && yv < 0)) && xv != (-2147483647-1))) && yv != (-2147483647-1))) && -xv <= __DIV(2147483647, -yv))) { + if (((((xv == 0 || yv == 0) || (((xv > 0 && yv > 0)) && yv <= __DIV(9223372036854775807, xv))) || (((xv > 0 && yv < 0)) && yv >= __DIV((-9223372036854775807-1), xv))) || (((xv < 0 && yv > 0)) && xv >= __DIV((-9223372036854775807-1), yv))) || (((((((xv < 0 && yv < 0)) && xv != (-9223372036854775807-1))) && yv != (-9223372036854775807-1))) && -xv <= __DIV(9223372036854775807, -yv))) { xval->intval = xv * yv; OPB_SetIntType(x); } else { @@ -1008,8 +1008,8 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) break; case 6: if (f == 4) { - temp = (yval->intval >= 0 && xval->intval <= 2147483647 - yval->intval); - if (temp || (yval->intval < 0 && xval->intval >= (-2147483647-1) - yval->intval)) { + temp = (yval->intval >= 0 && xval->intval <= 9223372036854775807 - yval->intval); + if (temp || (yval->intval < 0 && xval->intval >= (-9223372036854775807-1) - yval->intval)) { xval->intval += yval->intval; OPB_SetIntType(x); } else { @@ -1031,7 +1031,7 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) break; case 7: if (f == 4) { - if ((yval->intval >= 0 && xval->intval >= (-2147483647-1) + yval->intval) || (yval->intval < 0 && xval->intval <= 2147483647 + yval->intval)) { + if ((yval->intval >= 0 && xval->intval >= (-9223372036854775807-1) + yval->intval) || (yval->intval < 0 && xval->intval <= 9223372036854775807 + yval->intval)) { xval->intval -= yval->intval; OPB_SetIntType(x); } else { @@ -1133,7 +1133,7 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) OPB_CheckRealType(g, 203, (*x)->conval); } else { r = (*x)->conval->realval; - if (r < -2.14748364800000e+009 || r > 2.14748364700000e+009) { + if (r < -9.22337203685478e+018 || r > 9.22337203685478e+018) { OPB_err(203); r = (LONGREAL)1; } @@ -2126,7 +2126,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) OPB_err(126); } else if (p->typ->comp == 3) { if (f == 4) { - if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > (int64)OPM_MaxIndex))) { + if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > OPM_MaxIndex))) { OPB_err(63); } } else { @@ -2264,7 +2264,7 @@ void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n) } else if (p->typ->comp != 3) { OPB_err(64); } else if (f == 4) { - if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > (int64)OPM_MaxIndex))) { + if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > OPM_MaxIndex))) { OPB_err(63); } node = p->right; diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 558dde61..775776f4 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -20,7 +20,7 @@ typedef static CHAR OPM_SourceFileName[256]; export int16 OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet; -export int32 OPM_MaxIndex; +export int64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; export int32 OPM_curpos, OPM_errpos, OPM_breakpc; @@ -72,8 +72,8 @@ export BOOLEAN OPM_OpenPar (void); export void OPM_RegisterNewSym (void); static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt); static void OPM_ShowLine (int64 pos); -export int32 OPM_SignedMaximum (int32 bytecount); -export int32 OPM_SignedMinimum (int32 bytecount); +export int64 OPM_SignedMaximum (int32 bytecount); +export int64 OPM_SignedMinimum (int32 bytecount); export void OPM_SymRCh (CHAR *ch); export int32 OPM_SymRInt (void); export int64 OPM_SymRInt64 (void); @@ -665,19 +665,19 @@ static void OPM_VerboseListSizes (void) OPM_LogWLn(); } -int32 OPM_SignedMaximum (int32 bytecount) +int64 OPM_SignedMaximum (int32 bytecount) { - int32 _o_result; - int32 result; + int64 _o_result; + int64 result; result = 1; - result = __LSH(result, __ASHL(bytecount, 3) - 1, 32); + result = __LSH(result, __ASHL(bytecount, 3) - 1, 64); _o_result = result - 1; return _o_result; } -int32 OPM_SignedMinimum (int32 bytecount) +int64 OPM_SignedMinimum (int32 bytecount) { - int32 _o_result; + int64 _o_result; _o_result = -OPM_SignedMaximum(bytecount) - 1; return _o_result; } @@ -871,7 +871,7 @@ void OPM_WriteInt (int64 i) { CHAR s[24]; int64 i1, k; - if ((i == (int64)OPM_SignedMinimum(OPM_IntSize) || i == (int64)OPM_SignedMinimum(OPM_LIntSize)) || i == (int64)OPM_SignedMinimum(8)) { + if ((i == OPM_SignedMinimum(OPM_IntSize) || i == OPM_SignedMinimum(OPM_LIntSize)) || i == OPM_SignedMinimum(8)) { OPM_Write('('); OPM_WriteInt(i + 1); OPM_WriteString((CHAR*)"-1)", 4); diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index c5298326..9d7661c6 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -7,7 +7,7 @@ import int16 OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet; -import int32 OPM_MaxIndex; +import int64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; import int32 OPM_curpos, OPM_errpos, OPM_breakpc; @@ -40,8 +40,8 @@ import void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); import void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); import BOOLEAN OPM_OpenPar (void); import void OPM_RegisterNewSym (void); -import int32 OPM_SignedMaximum (int32 bytecount); -import int32 OPM_SignedMinimum (int32 bytecount); +import int64 OPM_SignedMaximum (int32 bytecount); +import int64 OPM_SignedMinimum (int32 bytecount); import void OPM_SymRCh (CHAR *ch); import int32 OPM_SymRInt (void); import int64 OPM_SymRInt64 (void); diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index 5351781f..86101b2b 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -275,7 +275,7 @@ static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) OPP_ConstExpression(&x); if (x->typ->form == 4) { n = x->conval->intval; - if (n <= 0 || n > (int64)OPM_MaxIndex) { + if (n <= 0 || n > OPM_MaxIndex) { OPP_err(63); n = 1; } diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index d94f4b29..bd641a09 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -17,7 +17,7 @@ static int64 OPB_maxExp; export void OPB_Assign (OPT_Node *x, OPT_Node y); static void OPB_BindNodes (int8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y); -static int64 OPB_BoolToInt (BOOLEAN b); +static int32 OPB_BoolToInt (BOOLEAN b); export void OPB_Call (OPT_Node *x, OPT_Node apar, OPT_Object fp); static void OPB_CharToString (OPT_Node n); static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode); @@ -128,9 +128,9 @@ void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y) *last = y; } -static int64 OPB_BoolToInt (BOOLEAN b) +static int32 OPB_BoolToInt (BOOLEAN b) { - int64 _o_result; + int32 _o_result; if (b) { _o_result = 1; return _o_result; diff --git a/makefile b/makefile index ade812e7..7f335f34 100644 --- a/makefile +++ b/makefile @@ -157,6 +157,25 @@ full: configuration @make -f src/tools/make/vishap.make -s showpath +# short - like make full, but omitting most libraries +# Convenient for testing changes to the compilersource but not a shippable result +short: configuration + @make -f src/tools/make/vishap.make -s installable + @-make -f src/tools/make/vishap.make -s uninstall + @make -f src/tools/make/vishap.make -s clean +# Make bootstrap compiler from source suitable for current data model + @printf "\n\n--- Compiler build started ---\n\n" + @make -f src/tools/make/vishap.make -s compilerfromsavedsource +# Use bootstrap compiler to make compiler binary from latest compiler sources + @make -f src/tools/make/vishap.make -s translate + @make -f src/tools/make/vishap.make -s assemble +# Use latest compiler to make compiler binary from latest compiler sources + @make -f src/tools/make/vishap.make -s translate + @make -f src/tools/make/vishap.make -s assemble + @printf "\n\n--- Compiler build successfull ---\n\n" + @make -f src/tools/make/vishap.make -s v4 + @make -f src/tools/make/vishap.make -s misc + assemble: @make -f src/tools/make/vishap.make -s assemble diff --git a/src/compiler/OPB.Mod b/src/compiler/OPB.Mod index 79c81b1c..0d840821 100644 --- a/src/compiler/OPB.Mod +++ b/src/compiler/OPB.Mod @@ -52,7 +52,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) last := y END Link; - PROCEDURE BoolToInt(b: BOOLEAN): LONGINT; + PROCEDURE BoolToInt(b: BOOLEAN): INTEGER; BEGIN IF b THEN RETURN 1 ELSE RETURN 0 END END BoolToInt; @@ -484,10 +484,10 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) CASE op OF |OPS.times: IF f = OPT.Int THEN xv := xval^.intval; yv := yval^.intval; IF (xv = 0) OR (yv = 0) OR (* division with negative numbers is not defined *) - (xv > 0) & (yv > 0) & (yv <= MAX(LONGINT) DIV xv) OR - (xv > 0) & (yv < 0) & (yv >= MIN(LONGINT) DIV xv) OR - (xv < 0) & (yv > 0) & (xv >= MIN(LONGINT) DIV yv) OR - (xv < 0) & (yv < 0) & (xv # MIN(LONGINT)) & (yv # MIN(LONGINT)) & (-xv <= MAX(LONGINT) DIV (-yv)) THEN + (xv > 0) & (yv > 0) & (yv <= MAX(SYSTEM.INT64) DIV xv) OR + (xv > 0) & (yv < 0) & (yv >= MIN(SYSTEM.INT64) DIV xv) OR + (xv < 0) & (yv > 0) & (xv >= MIN(SYSTEM.INT64) DIV yv) OR + (xv < 0) & (yv < 0) & (xv # MIN(SYSTEM.INT64)) & (yv # MIN(SYSTEM.INT64)) & (-xv <= MAX(SYSTEM.INT64) DIV (-yv)) THEN xval^.intval := xv * yv; SetIntType(x) ELSE err(204) END @@ -536,8 +536,8 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) ELSE err(94) END |OPS.plus: IF f = OPT.Int THEN - temp := (yval^.intval >= 0) & (xval^.intval <= MAX(LONGINT) - yval^.intval); - IF temp OR (yval^.intval < 0) & (xval^.intval >= MIN(LONGINT) - yval^.intval) THEN + temp := (yval^.intval >= 0) & (xval^.intval <= MAX(SYSTEM.INT64) - yval^.intval); + IF temp OR (yval^.intval < 0) & (xval^.intval >= MIN(SYSTEM.INT64) - yval^.intval) THEN INC(xval^.intval, yval^.intval); SetIntType(x) ELSE err(206) END @@ -552,8 +552,8 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) ELSIF f # OPT.Undef THEN err(105) END |OPS.minus: IF f = OPT.Int THEN - IF (yval^.intval >= 0) & (xval^.intval >= MIN(LONGINT) + yval^.intval) OR - (yval^.intval < 0) & (xval^.intval <= MAX(LONGINT) + yval^.intval) THEN + IF (yval^.intval >= 0) & (xval^.intval >= MIN(SYSTEM.INT64) + yval^.intval) OR + (yval^.intval < 0) & (xval^.intval <= MAX(SYSTEM.INT64) + yval^.intval) THEN DEC(xval^.intval, yval^.intval); SetIntType(x) ELSE err(207) END @@ -605,9 +605,9 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) END ELSIF f IN OPT.realSet THEN IF g IN OPT.realSet THEN CheckRealType(g, 203, x^.conval) - ELSE (*g = OPT.LInt*) + ELSE (* g = OPT.Int *) r := x^.conval^.realval; - IF (r < MIN(LONGINT)) OR (r > MAX(LONGINT)) THEN err(203); r := 1 END ; + IF (r < MIN(SYSTEM.INT64)) OR (r > MAX(SYSTEM.INT64)) THEN err(203); r := 1 END ; x^.conval^.intval := ENTIER(r); SetIntType(x) END ELSE (* (f IN {OPT.Char, OPT.Byte}) & (g IN {OPT.Byte} + OPT.intSet) OR (f = OPT.Undef) *) diff --git a/src/compiler/OPM.cmdln.Mod b/src/compiler/OPM.cmdln.Mod index b497829f..b70b8474 100644 --- a/src/compiler/OPM.cmdln.Mod +++ b/src/compiler/OPM.cmdln.Mod @@ -94,7 +94,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) LIntSize*, SetSize*, RealSize*, LRealSize*, PointerSize*, ProcSize*, RecSize*, MaxSet*: INTEGER; - MaxIndex*: LONGINT; + MaxIndex*: SYSTEM.INT64; MinReal*, MaxReal*, MinLReal*, MaxLReal*: LONGREAL; @@ -557,15 +557,15 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) (* Integer size support *) - PROCEDURE SignedMaximum*(bytecount: LONGINT): LONGINT; - VAR result: LONGINT; + PROCEDURE SignedMaximum*(bytecount: LONGINT): SYSTEM.INT64; + VAR result: SYSTEM.INT64; BEGIN result := 1; result := SYSTEM.LSH(result, bytecount*8-1); RETURN result - 1; END SignedMaximum; - PROCEDURE SignedMinimum*(bytecount: LONGINT): LONGINT; + PROCEDURE SignedMinimum*(bytecount: LONGINT): SYSTEM.INT64; BEGIN RETURN -SignedMaximum(bytecount) - 1 END SignedMinimum; diff --git a/src/tools/make/vishap.make b/src/tools/make/vishap.make index faacf33f..5b854fa2 100644 --- a/src/tools/make/vishap.make +++ b/src/tools/make/vishap.make @@ -225,7 +225,7 @@ TODO: Comment disabled lines contain use of VAL that reads beyond source variabl ooc: @printf "\nMaking ooc library\n" cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocLowReal.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocLowLReal.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocLowLReal.Mod # cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocRealMath.Mod # cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocOakMath.Mod # cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocLRealMath.Mod From 20a97bb570e84520e33c84bcadddbcb8a6df6c63 Mon Sep 17 00:00:00 2001 From: David Brown Date: Wed, 21 Sep 2016 11:56:21 +0100 Subject: [PATCH 239/580] Add check that double and long long (both 64 bit) have same alignment. --- src/library/ooc/oocLowLReal.Mod | 164 ++++++++++++++++---------------- src/tools/make/configure.c | 1 + 2 files changed, 84 insertions(+), 81 deletions(-) diff --git a/src/library/ooc/oocLowLReal.Mod b/src/library/ooc/oocLowLReal.Mod index 0a15f6dd..e28e13cf 100644 --- a/src/library/ooc/oocLowLReal.Mod +++ b/src/library/ooc/oocLowLReal.Mod @@ -1,21 +1,23 @@ (* $Id: LowLReal.Mod,v 1.6 1999/09/02 13:15:35 acken Exp $ *) MODULE oocLowLReal; +(* ToDo. support 64 bit builds *) + (* - LowLReal - Gives access to the underlying properties of the type LONGREAL - for IEEE double-precision numbers. + LowLReal - Gives access to the underlying properties of the type LONGREAL + for IEEE double-precision numbers. Copyright (C) 1996 Michael Griebling - + This module is free software; you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as + it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This module is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. - + You should have received a copy of the GNU Lesser General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA @@ -26,7 +28,7 @@ MODULE oocLowLReal; IMPORT Low := oocLowReal, S := SYSTEM; (* - + Real number properties are defined as follows: radix--The whole number value of the radix used to represent the @@ -44,50 +46,50 @@ IMPORT Low := oocLowReal, S := SYSTEM; small--The smallest positive value of the corresponding real number type, represented to maximal precision. - IEC559--A Boolean value that is TRUE if and only if the implementation - of the corresponding real number type conforms to IEC 559:1989 + IEC559--A Boolean value that is TRUE if and only if the implementation + of the corresponding real number type conforms to IEC 559:1989 (IEEE 754:1987) in all regards. NOTES 6 -- If `IEC559' is TRUE, the value of `radix' is 2. - 7 -- If LowReal.IEC559 is TRUE, the 32-bit format of IEC 559:1989 + 7 -- If LowReal.IEC559 is TRUE, the 32-bit format of IEC 559:1989 is used for the type REAL. - 7 -- If LowLong.IEC559 is TRUE, the 64-bit format of IEC 559:1989 + 7 -- If LowLong.IEC559 is TRUE, the 64-bit format of IEC 559:1989 is used for the type REAL. - LIA1--A Boolean value that is TRUE if and only if the implementation of - the corresponding real number type conforms to ISO/IEC 10967-1:199x - (LIA-1) in all regards: parameters, arithmetic, exceptions, and + LIA1--A Boolean value that is TRUE if and only if the implementation of + the corresponding real number type conforms to ISO/IEC 10967-1:199x + (LIA-1) in all regards: parameters, arithmetic, exceptions, and notification. - rounds--A Boolean value that is TRUE if and only if each operation produces - a result that is one of the values of the corresponding real number + rounds--A Boolean value that is TRUE if and only if each operation produces + a result that is one of the values of the corresponding real number type nearest to the mathematical result. - gUnderflow--A Boolean value that is TRUE if and only if there are values of - the corresponding real number type between 0.0 and `small'. + gUnderflow--A Boolean value that is TRUE if and only if there are values of + the corresponding real number type between 0.0 and `small'. - exception--A Boolean value that is TRUE if and only if every operation that + exception--A Boolean value that is TRUE if and only if every operation that attempts to produce a real value out of range raises an exception. - extend--A Boolean value that is TRUE if and only if expressions of the - corresponding real number type are computed to higher precision than + extend--A Boolean value that is TRUE if and only if expressions of the + corresponding real number type are computed to higher precision than the stored values. - nModes--The whole number value giving the number of bit positions needed for + nModes--The whole number value giving the number of bit positions needed for the status flags for mode control. - + *) CONST radix*= 2; - places*= 53; - expoMax*= 1023; + places*= 53; + expoMax*= 1023; expoMin*= 1-expoMax; large*= MAX(LONGREAL); (*1.7976931348623157D+308;*) (* MAX(LONGREAL) *) (*small*= 2.2250738585072014D-308;*) small*= 2.2250738585072014/9.9999999999999981D307(*/10^308)*); - IEC559*= TRUE; + IEC559*= TRUE; LIA1*= FALSE; rounds*= FALSE; gUnderflow*= TRUE; (* there are IEEE numbers smaller than `small' *) @@ -97,23 +99,23 @@ CONST ONE=1.0D0; (* some commonly-used constants *) ZERO=0.0D0; TEN=1.0D1; - + DEBUG = TRUE; - expOffset=expoMax; - hiBit=19; + expOffset=expoMax; + hiBit=19; expBit=hiBit+1; nMask={0..hiBit,31}; (* number mask *) expMask={expBit..30}; (* exponent mask *) - + TYPE Modes*= SET; LongInt=ARRAY 2 OF LONGINT; - LongSet=ARRAY 2 OF SET; - + LongSet=ARRAY 2 OF SET; + VAR (*sml* : LONGREAL; tmp: LONGREAL;*) (* this was a test to get small as a variable at runtime. obviously, compile time preferred; -- noch *) - isBigEndian-: BOOLEAN; (* set when target is big endian *) + isBigEndian-: BOOLEAN; (* set when target is big endian *) (* PROCEDURE power0(i, j : INTEGER) : LONGREAL; (* used to calculate sml at runtime; -- noch *) VAR k : INTEGER; @@ -139,7 +141,7 @@ END err; PROCEDURE ClearError*; BEGIN Low.ClearError -END ClearError; +END ClearError; PROCEDURE ErrorHandler*(err: INTEGER); BEGIN @@ -185,26 +187,26 @@ BEGIN RETURN x END ToReal; (*<* POP *> *) - + PROCEDURE exponent*(x: LONGREAL): INTEGER; -(* +(* The value of the call exponent(x) shall be the exponent value of `x' that lies between `expoMin' and `expoMax'. An exception shall occur and may be raised if `x' is equal to 0.0. - *) + *) VAR ra: LongInt; BEGIN (* NOTE: x=0.0 should raise exception *) IF x=ZERO THEN RETURN 0 - ELSE Move(x, ra); - RETURN SHORT(S.LSH(ra[0],-expBit) MOD 2048)-expOffset + ELSE Move(x, ra); + RETURN SHORT(S.LSH(ra[0],-expBit) MOD 2048)-expOffset END END exponent; PROCEDURE exponent10*(x: LONGREAL): INTEGER; -(* - The value of the call exponent10(x) shall be the base 10 exponent - value of `x'. An exception shall occur and may be raised if `x' is +(* + The value of the call exponent10(x) shall be the base 10 exponent + value of `x'. An exception shall occur and may be raised if `x' is equal to 0.0. *) VAR exp: INTEGER; @@ -215,19 +217,19 @@ BEGIN WHILE x<1 DO x:=x*TEN; DEC(exp) END; RETURN exp END exponent10; - + PROCEDURE fraction*(x: LONGREAL): LONGREAL; (* The value of the call fraction(x) shall be the significand (or significant) part of `x'. Hence the following relationship shall - hold: x = scale(fraction(x), exponent(x)). + hold: x = scale(fraction(x), exponent(x)). *) CONST eZero={(hiBit+2)..29}; VAR ra: LongInt; BEGIN - IF x=ZERO THEN RETURN ZERO + IF x=ZERO THEN RETURN ZERO ELSE Move(x, ra); - ra[0]:=S.VAL(LONGINT, S.VAL(SET,ra[0])*nMask+eZero); + ra[0]:=S.VAL(LONGINT, S.VAL(SET,ra[0])*nMask+eZero); RETURN Real(ra)*2.0D0 END END fraction; @@ -246,13 +248,13 @@ PROCEDURE IsNaN * (real: LONGREAL) : BOOLEAN; BEGIN MoveSet(real, ra); RETURN (ra[0]*expMask=expMask) & ((ra[1]#{}) OR (ra[0]*fracMask#{})) -END IsNaN; +END IsNaN; PROCEDURE sign*(x: LONGREAL): LONGREAL; (* The value of the call sign(x) shall be 1.0 if `x' is greater than 0.0, or shall be -1.0 if `x' is less than 0.0, or shall be either 1.0 or - -1.0 if `x' is equal to 0.0. + -1.0 if `x' is equal to 0.0. *) BEGIN IF x Date: Wed, 21 Sep 2016 14:28:53 +0100 Subject: [PATCH 240/580] Simplify parameterisable memory model variables. --- bootstrap/unix-44/Configuration.c | 4 +- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Console.c | 2 +- bootstrap/unix-44/Console.h | 2 +- bootstrap/unix-44/Files.c | 2 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 2 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 6 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 6 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 85 ++++++++++----------------- bootstrap/unix-44/OPM.h | 4 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 28 ++++----- bootstrap/unix-44/OPT.h | 4 +- bootstrap/unix-44/OPV.c | 17 +++--- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/Vishap.c | 22 ++----- bootstrap/unix-44/errors.c | 2 +- bootstrap/unix-44/errors.h | 2 +- bootstrap/unix-44/extTools.c | 2 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-44/vt100.c | 2 +- bootstrap/unix-44/vt100.h | 2 +- bootstrap/unix-48/Configuration.c | 4 +- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Console.c | 2 +- bootstrap/unix-48/Console.h | 2 +- bootstrap/unix-48/Files.c | 2 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 2 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 6 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 6 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 85 ++++++++++----------------- bootstrap/unix-48/OPM.h | 4 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 28 ++++----- bootstrap/unix-48/OPT.h | 4 +- bootstrap/unix-48/OPV.c | 17 +++--- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/Vishap.c | 22 ++----- bootstrap/unix-48/errors.c | 2 +- bootstrap/unix-48/errors.h | 2 +- bootstrap/unix-48/extTools.c | 2 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-48/vt100.c | 2 +- bootstrap/unix-48/vt100.h | 2 +- bootstrap/unix-88/Configuration.c | 4 +- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Console.c | 2 +- bootstrap/unix-88/Console.h | 2 +- bootstrap/unix-88/Files.c | 2 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 2 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 6 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 6 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 85 ++++++++++----------------- bootstrap/unix-88/OPM.h | 4 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 28 ++++----- bootstrap/unix-88/OPT.h | 4 +- bootstrap/unix-88/OPV.c | 17 +++--- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/Vishap.c | 22 ++----- bootstrap/unix-88/errors.c | 2 +- bootstrap/unix-88/errors.h | 2 +- bootstrap/unix-88/extTools.c | 2 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/unix-88/vt100.c | 2 +- bootstrap/unix-88/vt100.h | 2 +- bootstrap/windows-48/Configuration.c | 4 +- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Console.c | 2 +- bootstrap/windows-48/Console.h | 2 +- bootstrap/windows-48/Files.c | 2 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 2 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 6 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 6 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 85 ++++++++++----------------- bootstrap/windows-48/OPM.h | 4 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 28 ++++----- bootstrap/windows-48/OPT.h | 4 +- bootstrap/windows-48/OPV.c | 17 +++--- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/Vishap.c | 22 ++----- bootstrap/windows-48/errors.c | 2 +- bootstrap/windows-48/errors.h | 2 +- bootstrap/windows-48/extTools.c | 2 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-48/vt100.c | 2 +- bootstrap/windows-48/vt100.h | 2 +- bootstrap/windows-88/Configuration.c | 4 +- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Console.c | 2 +- bootstrap/windows-88/Console.h | 2 +- bootstrap/windows-88/Files.c | 2 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 2 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 6 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 6 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 85 ++++++++++----------------- bootstrap/windows-88/OPM.h | 4 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 28 ++++----- bootstrap/windows-88/OPT.h | 4 +- bootstrap/windows-88/OPV.c | 17 +++--- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Platform.c | 2 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/Vishap.c | 22 ++----- bootstrap/windows-88/errors.c | 2 +- bootstrap/windows-88/errors.h | 2 +- bootstrap/windows-88/extTools.c | 2 +- bootstrap/windows-88/extTools.h | 2 +- bootstrap/windows-88/vt100.c | 2 +- bootstrap/windows-88/vt100.h | 2 +- src/compiler/OPB.Mod | 4 +- src/compiler/OPC.Mod | 4 +- src/compiler/OPM.cmdln.Mod | 86 +++++++++++++++------------- src/compiler/OPT.Mod | 53 ++++++++--------- src/compiler/OPV.Mod | 22 +++---- src/compiler/Vishap.Mod | 21 ++----- 201 files changed, 607 insertions(+), 763 deletions(-) diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index 4ea29c15..6db18d8a 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/20] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/21] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index 6b8f5d99..831281d6 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Console.c b/bootstrap/unix-44/Console.c index a3acbd98..dea5d7a8 100644 --- a/bootstrap/unix-44/Console.c +++ b/bootstrap/unix-44/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Console.h b/bootstrap/unix-44/Console.h index 8f5a2a2a..b18bf88a 100644 --- a/bootstrap/unix-44/Console.h +++ b/bootstrap/unix-44/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 32971286..3a826a34 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index 2dfc3018..17077aa8 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index 08a21c58..63b8e488 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tskSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index 65b6b0b1..d150f1cf 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index f61acc40..a74b13a3 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index 6841c244..d570a488 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index 3ec5dfc2..a4070347 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -1940,7 +1940,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) OPB_err(126); } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x0810, 32) && x->typ->size == OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x0810, 32) && x->typ->size == OPM_AddressSize))) { OPB_err(111); x->typ = OPT_linttyp; } @@ -2213,7 +2213,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) OPB_err(126); } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x0810, 32) && x->typ->size == OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x0810, 32) && x->typ->size == OPM_AddressSize))) { OPB_err(111); x->typ = OPT_linttyp; } diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index a57ace75..a39fd352 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 9923ccbc..f3b40759 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -839,7 +839,7 @@ void OPC_TDescDecl (OPT_Struct typ) OPC_Str1((CHAR*)", #), {", 8, typ->size); nofptrs = 0; OPC_PutPtrOffsets(typ, 0, &nofptrs); - OPC_Str1((CHAR*)"#}}", 4, -((nofptrs + 1) * OPM_PointerSize)); + OPC_Str1((CHAR*)"#}}", 4, -((nofptrs + 1) * OPM_AddressSize)); OPC_EndStat(); } @@ -1966,7 +1966,7 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim) if (OPC_ansi) { OPM_WriteInt(array->n); } else { - OPC_IntLiteral(array->n, OPM_PointerSize); + OPC_IntLiteral(array->n, OPM_AddressSize); } } } diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index 83153512..1ac87c2d 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 775776f4..e5b7fc83 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -19,7 +19,7 @@ typedef static CHAR OPM_SourceFileName[256]; -export int16 OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet; +export int16 OPM_Alignment, OPM_AddressSize, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; export int64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; @@ -177,19 +177,26 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) case 'B': if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_IntSize = (int16)s[__X(i, s__len)] - 48; + OPM_IntegerSize = (int16)s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_PointerSize = (int16)s[__X(i, s__len)] - 48; + OPM_AddressSize = (int16)s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; OPM_Alignment = (int16)s[__X(i, s__len)] - 48; } - __ASSERT(OPM_IntSize == 2 || OPM_IntSize == 4, 0); - __ASSERT(OPM_PointerSize == 4 || OPM_PointerSize == 8, 0); + __ASSERT(OPM_IntegerSize == 2 || OPM_IntegerSize == 4, 0); + __ASSERT(OPM_AddressSize == 4 || OPM_AddressSize == 8, 0); __ASSERT(OPM_Alignment == 4 || OPM_Alignment == 8, 0); + if (OPM_IntegerSize == 2) { + OPM_LongintSize = 4; + OPM_SetSize = 4; + } else { + OPM_LongintSize = 8; + OPM_SetSize = 8; + } Files_SetSearchPath((CHAR*)"", 1); break; case 'F': @@ -627,41 +634,26 @@ static int32 OPM_power0 (int32 i, int32 j) static void OPM_VerboseListSizes (void) { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Type Size Alignement", 29); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"CHAR ", 14); - OPM_LogWNum(OPM_CharSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"BOOLEAN ", 14); - OPM_LogWNum(OPM_BoolSize, 4); + OPM_LogWStr((CHAR*)"Type Size", 17); OPM_LogWLn(); OPM_LogWStr((CHAR*)"SHORTINT ", 14); - OPM_LogWNum(OPM_SIntSize, 4); + OPM_LogWNum(OPM_ShortintSize, 4); OPM_LogWLn(); OPM_LogWStr((CHAR*)"INTEGER ", 14); - OPM_LogWNum(OPM_IntSize, 4); + OPM_LogWNum(OPM_IntegerSize, 4); OPM_LogWLn(); OPM_LogWStr((CHAR*)"LONGINT ", 14); - OPM_LogWNum(OPM_LIntSize, 4); + OPM_LogWNum(OPM_LongintSize, 4); OPM_LogWLn(); OPM_LogWStr((CHAR*)"SET ", 14); OPM_LogWNum(OPM_SetSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"REAL ", 14); - OPM_LogWNum(OPM_RealSize, 4); + OPM_LogWStr((CHAR*)"ADDRESS ", 14); + OPM_LogWNum(OPM_AddressSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"LONGREAL ", 14); - OPM_LogWNum(OPM_LRealSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"PTR ", 14); - OPM_LogWNum(OPM_PointerSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"PROC ", 14); - OPM_LogWNum(OPM_ProcSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"RECORD ", 14); - OPM_LogWNum(OPM_RecSize, 4); OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Alignment: ", 12); + OPM_LogWNum(OPM_Alignment, 4); OPM_LogWLn(); } @@ -684,23 +676,12 @@ int64 OPM_SignedMinimum (int32 bytecount) static void OPM_GetProperties (void) { - OPM_ProcSize = OPM_PointerSize; - OPM_LIntSize = __ASHL(OPM_IntSize, 1); - OPM_SetSize = OPM_LIntSize; - if (OPM_RealSize == 4) { - OPM_MaxReal = 3.40282346000000e+038; - } else if (OPM_RealSize == 8) { - OPM_MaxReal = 1.79769296342094e+308; - } - if (OPM_LRealSize == 4) { - OPM_MaxLReal = 3.40282346000000e+038; - } else if (OPM_LRealSize == 8) { - OPM_MaxLReal = 1.79769296342094e+308; - } + OPM_MaxReal = 3.40282346000000e+038; + OPM_MaxLReal = 1.79769296342094e+308; OPM_MinReal = -OPM_MaxReal; OPM_MinLReal = -OPM_MaxLReal; OPM_MaxSet = __ASHL(OPM_SetSize, 3) - 1; - OPM_MaxIndex = OPM_SignedMaximum(OPM_PointerSize); + OPM_MaxIndex = OPM_SignedMaximum(OPM_AddressSize); if (OPM_Verbose) { OPM_VerboseListSizes(); } @@ -871,7 +852,7 @@ void OPM_WriteInt (int64 i) { CHAR s[24]; int64 i1, k; - if ((i == OPM_SignedMinimum(OPM_IntSize) || i == OPM_SignedMinimum(OPM_LIntSize)) || i == OPM_SignedMinimum(8)) { + if ((i == OPM_SignedMinimum(2) || i == OPM_SignedMinimum(4)) || i == OPM_SignedMinimum(8)) { OPM_Write('('); OPM_WriteInt(i + 1); OPM_WriteString((CHAR*)"-1)", 4); @@ -904,7 +885,7 @@ void OPM_WriteReal (LONGREAL r, CHAR suffx) CHAR s[32]; CHAR ch; int16 i; - if ((((r < OPM_SignedMaximum(OPM_LIntSize) && r > OPM_SignedMinimum(OPM_LIntSize))) && r == ((int32)__ENTIER(r)))) { + if ((((r < OPM_SignedMaximum(OPM_LongintSize) && r > OPM_SignedMinimum(OPM_LongintSize))) && r == ((int32)__ENTIER(r)))) { if (suffx == 'f') { OPM_WriteString((CHAR*)"(REAL)", 7); } else { @@ -1073,15 +1054,11 @@ export void *OPM__init(void) Strings_Append((CHAR*)"/opt/voc", 9, (void*)OPM_OBERON, 1024); Strings_Append((CHAR*)"/sym;", 6, (void*)OPM_OBERON, 1024); Files_SetSearchPath(OPM_OBERON, 1024); - OPM_CharSize = 1; - OPM_BoolSize = 1; - OPM_SIntSize = 1; - OPM_RecSize = 1; - OPM_ByteSize = 1; - OPM_RealSize = 4; - OPM_LRealSize = 8; - OPM_PointerSize = 8; + OPM_AddressSize = 8; OPM_Alignment = 8; - OPM_IntSize = 4; + OPM_ShortintSize = 1; + OPM_IntegerSize = 4; + OPM_LongintSize = 8; + OPM_SetSize = 8; __ENDMOD; } diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index 9d7661c6..1835a2b8 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h @@ -6,7 +6,7 @@ #include "SYSTEM.h" -import int16 OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet; +import int16 OPM_Alignment, OPM_AddressSize, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; import int64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index 86101b2b..f62551cc 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index 7cbdb873..9ae7712a 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index 67bca013..f04f47ad 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index 3f106d0c..3ff9b0b3 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index a18e6768..693eb714 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -89,7 +89,7 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; -export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; export OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj; export int8 OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; @@ -1110,7 +1110,7 @@ static void OPT_InStruct (OPT_Struct *typ) switch (tag) { case 36: (*typ)->form = 11; - (*typ)->size = OPM_PointerSize; + (*typ)->size = OPM_AddressSize; (*typ)->n = 0; OPT_InStruct(&(*typ)->BaseTyp); break; @@ -1168,7 +1168,7 @@ static void OPT_InStruct (OPT_Struct *typ) break; case 40: (*typ)->form = 12; - (*typ)->size = OPM_ProcSize; + (*typ)->size = OPM_AddressSize; OPT_InSign(mno, &(*typ)->BaseTyp, &(*typ)->link); break; default: @@ -1756,7 +1756,7 @@ static void OPT_InitStruct (OPT_Struct *typ, int8 form) { *typ = OPT_NewStr(form, 1); (*typ)->ref = form; - (*typ)->size = OPM_ByteSize; + (*typ)->size = 1; (*typ)->allocated = 1; (*typ)->strobj = OPT_NewObj(); (*typ)->pbfp = form; @@ -1834,6 +1834,7 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_sinttyp); P(OPT_inttyp); P(OPT_linttyp); + P(OPT_hinttyp); P(OPT_adrtyp); P(OPT_int8typ); P(OPT_int16typ); @@ -1916,9 +1917,9 @@ export void *OPT__init(void) OPT_InitStruct(&OPT_notyp, 10); OPT_InitStruct(&OPT_stringtyp, 8); OPT_InitStruct(&OPT_niltyp, 9); - OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp); - OPT_EnterTyp((CHAR*)"PTR", 11, OPM_PointerSize, &OPT_sysptrtyp); - OPT_EnterTyp((CHAR*)"ADDRESS", 4, OPM_PointerSize, &OPT_adrtyp); + OPT_EnterTyp((CHAR*)"BYTE", 1, 1, &OPT_bytetyp); + OPT_EnterTyp((CHAR*)"PTR", 11, -1, &OPT_sysptrtyp); + OPT_EnterTyp((CHAR*)"ADDRESS", 4, -1, &OPT_adrtyp); OPT_EnterTyp((CHAR*)"INT8", 4, 1, &OPT_int8typ); OPT_EnterTyp((CHAR*)"INT16", 4, 2, &OPT_int16typ); OPT_EnterTyp((CHAR*)"INT32", 4, 4, &OPT_int32typ); @@ -1938,11 +1939,12 @@ export void *OPT__init(void) OPT_syslink = OPT_topScope->right; OPT_universe = OPT_topScope; OPT_topScope->right = NIL; - OPT_EnterTyp((CHAR*)"BOOLEAN", 2, OPM_BoolSize, &OPT_booltyp); - OPT_EnterTyp((CHAR*)"CHAR", 3, OPM_CharSize, &OPT_chartyp); - OPT_EnterTyp((CHAR*)"SET", 7, OPM_SetSize, &OPT_settyp); - OPT_EnterTyp((CHAR*)"REAL", 5, OPM_RealSize, &OPT_realtyp); - OPT_EnterTyp((CHAR*)"LONGREAL", 6, OPM_LRealSize, &OPT_lrltyp); + OPT_EnterTyp((CHAR*)"BOOLEAN", 2, 1, &OPT_booltyp); + OPT_EnterTyp((CHAR*)"CHAR", 3, 1, &OPT_chartyp); + OPT_EnterTyp((CHAR*)"SET", 7, -1, &OPT_settyp); + OPT_EnterTyp((CHAR*)"REAL", 5, 4, &OPT_realtyp); + OPT_EnterTyp((CHAR*)"LONGREAL", 6, 8, &OPT_lrltyp); + OPT_EnterTyp((CHAR*)"HUGEINT", 4, 8, &OPT_hinttyp); OPT_EnterTypeAlias((CHAR*)"SHORTINT", &OPT_sintobj); OPT_EnterTypeAlias((CHAR*)"INTEGER", &OPT_intobj); OPT_EnterTypeAlias((CHAR*)"LONGINT", &OPT_lintobj); diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index fd0a538e..9ee5643f 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h @@ -68,7 +68,7 @@ typedef import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; -import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; import OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj; import int8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index ffe3eb71..2146d7c2 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -69,7 +69,7 @@ void OPV_TypSize (OPT_Struct typ) btyp = typ->BaseTyp; if (btyp == NIL) { offset = 0; - base = OPC_SizeAlignment(OPM_RecSize); + base = 1; } else { OPV_TypSize(btyp); offset = btyp->size - __ASHR(btyp->sysflag, 8); @@ -105,14 +105,14 @@ void OPV_TypSize (OPT_Struct typ) OPV_TypSize(typ->BaseTyp); typ->size = typ->n * typ->BaseTyp->size; } else if (f == 11) { - typ->size = OPM_PointerSize; + typ->size = OPM_AddressSize; if (typ->BaseTyp == OPT_undftyp) { OPM_Mark(128, typ->n); } else { OPV_TypSize(typ->BaseTyp); } } else if (f == 12) { - typ->size = OPM_ProcSize; + typ->size = OPM_AddressSize; } else if (c == 3) { btyp = typ->BaseTyp; OPV_TypSize(btyp); @@ -273,6 +273,7 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_int16typ->strobj->linkadr = 2; OPT_int32typ->strobj->linkadr = 2; OPT_int64typ->strobj->linkadr = 2; + OPT_hinttyp->strobj->linkadr = 2; OPT_lrltyp->strobj->linkadr = 2; OPT_booltyp->strobj->linkadr = 2; OPT_bytetyp->strobj->linkadr = 2; @@ -790,7 +791,7 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) } else if (comp == 3) { if (n->class == 7) { OPM_WriteString((CHAR*)", ", 3); - OPV_ParIntLiteral(n->conval->intval2, OPM_PointerSize); + OPV_ParIntLiteral(n->conval->intval2, OPM_AddressSize); } else { aptyp = n->typ; dim = 0; @@ -809,7 +810,7 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) dim += 1; aptyp = aptyp->BaseTyp; } - OPV_ParIntLiteral(aptyp->size, OPM_PointerSize); + OPV_ParIntLiteral(aptyp->size, OPM_AddressSize); } } } @@ -1314,7 +1315,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) OPM_WriteString((CHAR*)", ", 3); if (typ->comp == 3) { if (x->class == 7) { - OPC_IntLiteral(x->conval->intval, OPM_PointerSize); + OPC_IntLiteral(x->conval->intval, OPM_AddressSize); } else { OPM_WriteString((CHAR*)"((address)(", 12); OPV_expr(x, 10); @@ -1322,7 +1323,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) } x = x->link; } else { - OPC_IntLiteral(typ->n, OPM_PointerSize); + OPC_IntLiteral(typ->n, OPM_AddressSize); } typ = typ->BaseTyp; } diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index 33c1eeeb..f78267d0 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 10d2ba41..a42034f5 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index 57c87f55..99b78a56 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 6982b582..c032a4a5 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index e79f35d7..b4469c3a 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index b2d5f19a..db9dbf02 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index ea987a3e..9d2d3b44 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index 0339cbdb..faa47731 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index 6d3f7c1e..e0fc1bc4 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/Vishap.c b/bootstrap/unix-44/Vishap.c index 2d0b9dee..c3405c16 100644 --- a/bootstrap/unix-44/Vishap.c +++ b/bootstrap/unix-44/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkamSf */ #define INTEGER int16 #define LONGINT int32 @@ -79,22 +79,12 @@ void Vishap_Module (BOOLEAN *done) static void Vishap_PropagateElementaryTypeSizes (void) { - OPT_bytetyp->size = OPM_ByteSize; - OPT_sysptrtyp->size = OPM_PointerSize; - OPT_chartyp->size = OPM_CharSize; + OPT_sysptrtyp->size = OPM_AddressSize; + OPT_adrtyp->size = OPM_AddressSize; OPT_settyp->size = OPM_SetSize; - OPT_realtyp->size = OPM_RealSize; - OPT_adrtyp->size = OPM_PointerSize; - OPT_lrltyp->size = OPM_LRealSize; - OPT_booltyp->size = OPM_BoolSize; - OPT_sinttyp = OPT_int8typ; - if (OPM_IntSize == 2) { - OPT_inttyp = OPT_int16typ; - OPT_linttyp = OPT_int32typ; - } else { - OPT_inttyp = OPT_int32typ; - OPT_linttyp = OPT_int64typ; - } + OPT_sinttyp = OPT_IntType(OPM_ShortintSize); + OPT_inttyp = OPT_IntType(OPM_IntegerSize); + OPT_linttyp = OPT_IntType(OPM_LongintSize); OPT_sintobj->typ = OPT_sinttyp; OPT_intobj->typ = OPT_inttyp; OPT_lintobj->typ = OPT_linttyp; diff --git a/bootstrap/unix-44/errors.c b/bootstrap/unix-44/errors.c index 2bdf2af6..2e61c724 100644 --- a/bootstrap/unix-44/errors.c +++ b/bootstrap/unix-44/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/errors.h b/bootstrap/unix-44/errors.h index b3535e92..99f4c6b0 100644 --- a/bootstrap/unix-44/errors.h +++ b/bootstrap/unix-44/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index 5245f35d..8838dd7b 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index 414a05f0..d4f0c474 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-44/vt100.c b/bootstrap/unix-44/vt100.c index 4d312413..5d050112 100644 --- a/bootstrap/unix-44/vt100.c +++ b/bootstrap/unix-44/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/vt100.h b/bootstrap/unix-44/vt100.h index 1ecf99b1..11aabb2a 100644 --- a/bootstrap/unix-44/vt100.h +++ b/bootstrap/unix-44/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index 4ea29c15..6db18d8a 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/20] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/21] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index 6b8f5d99..831281d6 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Console.c b/bootstrap/unix-48/Console.c index a3acbd98..dea5d7a8 100644 --- a/bootstrap/unix-48/Console.c +++ b/bootstrap/unix-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Console.h b/bootstrap/unix-48/Console.h index 8f5a2a2a..b18bf88a 100644 --- a/bootstrap/unix-48/Console.h +++ b/bootstrap/unix-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 32971286..3a826a34 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index 2dfc3018..17077aa8 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index 08a21c58..63b8e488 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tskSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index 65b6b0b1..d150f1cf 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index f61acc40..a74b13a3 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index 6841c244..d570a488 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index 3ec5dfc2..a4070347 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -1940,7 +1940,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) OPB_err(126); } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x0810, 32) && x->typ->size == OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x0810, 32) && x->typ->size == OPM_AddressSize))) { OPB_err(111); x->typ = OPT_linttyp; } @@ -2213,7 +2213,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) OPB_err(126); } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x0810, 32) && x->typ->size == OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x0810, 32) && x->typ->size == OPM_AddressSize))) { OPB_err(111); x->typ = OPT_linttyp; } diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index a57ace75..a39fd352 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 9923ccbc..f3b40759 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -839,7 +839,7 @@ void OPC_TDescDecl (OPT_Struct typ) OPC_Str1((CHAR*)", #), {", 8, typ->size); nofptrs = 0; OPC_PutPtrOffsets(typ, 0, &nofptrs); - OPC_Str1((CHAR*)"#}}", 4, -((nofptrs + 1) * OPM_PointerSize)); + OPC_Str1((CHAR*)"#}}", 4, -((nofptrs + 1) * OPM_AddressSize)); OPC_EndStat(); } @@ -1966,7 +1966,7 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim) if (OPC_ansi) { OPM_WriteInt(array->n); } else { - OPC_IntLiteral(array->n, OPM_PointerSize); + OPC_IntLiteral(array->n, OPM_AddressSize); } } } diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index 83153512..1ac87c2d 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 775776f4..e5b7fc83 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -19,7 +19,7 @@ typedef static CHAR OPM_SourceFileName[256]; -export int16 OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet; +export int16 OPM_Alignment, OPM_AddressSize, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; export int64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; @@ -177,19 +177,26 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) case 'B': if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_IntSize = (int16)s[__X(i, s__len)] - 48; + OPM_IntegerSize = (int16)s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_PointerSize = (int16)s[__X(i, s__len)] - 48; + OPM_AddressSize = (int16)s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; OPM_Alignment = (int16)s[__X(i, s__len)] - 48; } - __ASSERT(OPM_IntSize == 2 || OPM_IntSize == 4, 0); - __ASSERT(OPM_PointerSize == 4 || OPM_PointerSize == 8, 0); + __ASSERT(OPM_IntegerSize == 2 || OPM_IntegerSize == 4, 0); + __ASSERT(OPM_AddressSize == 4 || OPM_AddressSize == 8, 0); __ASSERT(OPM_Alignment == 4 || OPM_Alignment == 8, 0); + if (OPM_IntegerSize == 2) { + OPM_LongintSize = 4; + OPM_SetSize = 4; + } else { + OPM_LongintSize = 8; + OPM_SetSize = 8; + } Files_SetSearchPath((CHAR*)"", 1); break; case 'F': @@ -627,41 +634,26 @@ static int32 OPM_power0 (int32 i, int32 j) static void OPM_VerboseListSizes (void) { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Type Size Alignement", 29); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"CHAR ", 14); - OPM_LogWNum(OPM_CharSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"BOOLEAN ", 14); - OPM_LogWNum(OPM_BoolSize, 4); + OPM_LogWStr((CHAR*)"Type Size", 17); OPM_LogWLn(); OPM_LogWStr((CHAR*)"SHORTINT ", 14); - OPM_LogWNum(OPM_SIntSize, 4); + OPM_LogWNum(OPM_ShortintSize, 4); OPM_LogWLn(); OPM_LogWStr((CHAR*)"INTEGER ", 14); - OPM_LogWNum(OPM_IntSize, 4); + OPM_LogWNum(OPM_IntegerSize, 4); OPM_LogWLn(); OPM_LogWStr((CHAR*)"LONGINT ", 14); - OPM_LogWNum(OPM_LIntSize, 4); + OPM_LogWNum(OPM_LongintSize, 4); OPM_LogWLn(); OPM_LogWStr((CHAR*)"SET ", 14); OPM_LogWNum(OPM_SetSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"REAL ", 14); - OPM_LogWNum(OPM_RealSize, 4); + OPM_LogWStr((CHAR*)"ADDRESS ", 14); + OPM_LogWNum(OPM_AddressSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"LONGREAL ", 14); - OPM_LogWNum(OPM_LRealSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"PTR ", 14); - OPM_LogWNum(OPM_PointerSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"PROC ", 14); - OPM_LogWNum(OPM_ProcSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"RECORD ", 14); - OPM_LogWNum(OPM_RecSize, 4); OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Alignment: ", 12); + OPM_LogWNum(OPM_Alignment, 4); OPM_LogWLn(); } @@ -684,23 +676,12 @@ int64 OPM_SignedMinimum (int32 bytecount) static void OPM_GetProperties (void) { - OPM_ProcSize = OPM_PointerSize; - OPM_LIntSize = __ASHL(OPM_IntSize, 1); - OPM_SetSize = OPM_LIntSize; - if (OPM_RealSize == 4) { - OPM_MaxReal = 3.40282346000000e+038; - } else if (OPM_RealSize == 8) { - OPM_MaxReal = 1.79769296342094e+308; - } - if (OPM_LRealSize == 4) { - OPM_MaxLReal = 3.40282346000000e+038; - } else if (OPM_LRealSize == 8) { - OPM_MaxLReal = 1.79769296342094e+308; - } + OPM_MaxReal = 3.40282346000000e+038; + OPM_MaxLReal = 1.79769296342094e+308; OPM_MinReal = -OPM_MaxReal; OPM_MinLReal = -OPM_MaxLReal; OPM_MaxSet = __ASHL(OPM_SetSize, 3) - 1; - OPM_MaxIndex = OPM_SignedMaximum(OPM_PointerSize); + OPM_MaxIndex = OPM_SignedMaximum(OPM_AddressSize); if (OPM_Verbose) { OPM_VerboseListSizes(); } @@ -871,7 +852,7 @@ void OPM_WriteInt (int64 i) { CHAR s[24]; int64 i1, k; - if ((i == OPM_SignedMinimum(OPM_IntSize) || i == OPM_SignedMinimum(OPM_LIntSize)) || i == OPM_SignedMinimum(8)) { + if ((i == OPM_SignedMinimum(2) || i == OPM_SignedMinimum(4)) || i == OPM_SignedMinimum(8)) { OPM_Write('('); OPM_WriteInt(i + 1); OPM_WriteString((CHAR*)"-1)", 4); @@ -904,7 +885,7 @@ void OPM_WriteReal (LONGREAL r, CHAR suffx) CHAR s[32]; CHAR ch; int16 i; - if ((((r < OPM_SignedMaximum(OPM_LIntSize) && r > OPM_SignedMinimum(OPM_LIntSize))) && r == ((int32)__ENTIER(r)))) { + if ((((r < OPM_SignedMaximum(OPM_LongintSize) && r > OPM_SignedMinimum(OPM_LongintSize))) && r == ((int32)__ENTIER(r)))) { if (suffx == 'f') { OPM_WriteString((CHAR*)"(REAL)", 7); } else { @@ -1073,15 +1054,11 @@ export void *OPM__init(void) Strings_Append((CHAR*)"/opt/voc", 9, (void*)OPM_OBERON, 1024); Strings_Append((CHAR*)"/sym;", 6, (void*)OPM_OBERON, 1024); Files_SetSearchPath(OPM_OBERON, 1024); - OPM_CharSize = 1; - OPM_BoolSize = 1; - OPM_SIntSize = 1; - OPM_RecSize = 1; - OPM_ByteSize = 1; - OPM_RealSize = 4; - OPM_LRealSize = 8; - OPM_PointerSize = 8; + OPM_AddressSize = 8; OPM_Alignment = 8; - OPM_IntSize = 4; + OPM_ShortintSize = 1; + OPM_IntegerSize = 4; + OPM_LongintSize = 8; + OPM_SetSize = 8; __ENDMOD; } diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index 9d7661c6..1835a2b8 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h @@ -6,7 +6,7 @@ #include "SYSTEM.h" -import int16 OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet; +import int16 OPM_Alignment, OPM_AddressSize, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; import int64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index 86101b2b..f62551cc 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index 7cbdb873..9ae7712a 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index 67bca013..f04f47ad 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index 3f106d0c..3ff9b0b3 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index c1bc93b1..acdca9f2 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -89,7 +89,7 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; -export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; export OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj; export int8 OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; @@ -1110,7 +1110,7 @@ static void OPT_InStruct (OPT_Struct *typ) switch (tag) { case 36: (*typ)->form = 11; - (*typ)->size = OPM_PointerSize; + (*typ)->size = OPM_AddressSize; (*typ)->n = 0; OPT_InStruct(&(*typ)->BaseTyp); break; @@ -1168,7 +1168,7 @@ static void OPT_InStruct (OPT_Struct *typ) break; case 40: (*typ)->form = 12; - (*typ)->size = OPM_ProcSize; + (*typ)->size = OPM_AddressSize; OPT_InSign(mno, &(*typ)->BaseTyp, &(*typ)->link); break; default: @@ -1756,7 +1756,7 @@ static void OPT_InitStruct (OPT_Struct *typ, int8 form) { *typ = OPT_NewStr(form, 1); (*typ)->ref = form; - (*typ)->size = OPM_ByteSize; + (*typ)->size = 1; (*typ)->allocated = 1; (*typ)->strobj = OPT_NewObj(); (*typ)->pbfp = form; @@ -1834,6 +1834,7 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_sinttyp); P(OPT_inttyp); P(OPT_linttyp); + P(OPT_hinttyp); P(OPT_adrtyp); P(OPT_int8typ); P(OPT_int16typ); @@ -1916,9 +1917,9 @@ export void *OPT__init(void) OPT_InitStruct(&OPT_notyp, 10); OPT_InitStruct(&OPT_stringtyp, 8); OPT_InitStruct(&OPT_niltyp, 9); - OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp); - OPT_EnterTyp((CHAR*)"PTR", 11, OPM_PointerSize, &OPT_sysptrtyp); - OPT_EnterTyp((CHAR*)"ADDRESS", 4, OPM_PointerSize, &OPT_adrtyp); + OPT_EnterTyp((CHAR*)"BYTE", 1, 1, &OPT_bytetyp); + OPT_EnterTyp((CHAR*)"PTR", 11, -1, &OPT_sysptrtyp); + OPT_EnterTyp((CHAR*)"ADDRESS", 4, -1, &OPT_adrtyp); OPT_EnterTyp((CHAR*)"INT8", 4, 1, &OPT_int8typ); OPT_EnterTyp((CHAR*)"INT16", 4, 2, &OPT_int16typ); OPT_EnterTyp((CHAR*)"INT32", 4, 4, &OPT_int32typ); @@ -1938,11 +1939,12 @@ export void *OPT__init(void) OPT_syslink = OPT_topScope->right; OPT_universe = OPT_topScope; OPT_topScope->right = NIL; - OPT_EnterTyp((CHAR*)"BOOLEAN", 2, OPM_BoolSize, &OPT_booltyp); - OPT_EnterTyp((CHAR*)"CHAR", 3, OPM_CharSize, &OPT_chartyp); - OPT_EnterTyp((CHAR*)"SET", 7, OPM_SetSize, &OPT_settyp); - OPT_EnterTyp((CHAR*)"REAL", 5, OPM_RealSize, &OPT_realtyp); - OPT_EnterTyp((CHAR*)"LONGREAL", 6, OPM_LRealSize, &OPT_lrltyp); + OPT_EnterTyp((CHAR*)"BOOLEAN", 2, 1, &OPT_booltyp); + OPT_EnterTyp((CHAR*)"CHAR", 3, 1, &OPT_chartyp); + OPT_EnterTyp((CHAR*)"SET", 7, -1, &OPT_settyp); + OPT_EnterTyp((CHAR*)"REAL", 5, 4, &OPT_realtyp); + OPT_EnterTyp((CHAR*)"LONGREAL", 6, 8, &OPT_lrltyp); + OPT_EnterTyp((CHAR*)"HUGEINT", 4, 8, &OPT_hinttyp); OPT_EnterTypeAlias((CHAR*)"SHORTINT", &OPT_sintobj); OPT_EnterTypeAlias((CHAR*)"INTEGER", &OPT_intobj); OPT_EnterTypeAlias((CHAR*)"LONGINT", &OPT_lintobj); diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index fd0a538e..9ee5643f 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h @@ -68,7 +68,7 @@ typedef import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; -import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; import OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj; import int8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index ffe3eb71..2146d7c2 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -69,7 +69,7 @@ void OPV_TypSize (OPT_Struct typ) btyp = typ->BaseTyp; if (btyp == NIL) { offset = 0; - base = OPC_SizeAlignment(OPM_RecSize); + base = 1; } else { OPV_TypSize(btyp); offset = btyp->size - __ASHR(btyp->sysflag, 8); @@ -105,14 +105,14 @@ void OPV_TypSize (OPT_Struct typ) OPV_TypSize(typ->BaseTyp); typ->size = typ->n * typ->BaseTyp->size; } else if (f == 11) { - typ->size = OPM_PointerSize; + typ->size = OPM_AddressSize; if (typ->BaseTyp == OPT_undftyp) { OPM_Mark(128, typ->n); } else { OPV_TypSize(typ->BaseTyp); } } else if (f == 12) { - typ->size = OPM_ProcSize; + typ->size = OPM_AddressSize; } else if (c == 3) { btyp = typ->BaseTyp; OPV_TypSize(btyp); @@ -273,6 +273,7 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_int16typ->strobj->linkadr = 2; OPT_int32typ->strobj->linkadr = 2; OPT_int64typ->strobj->linkadr = 2; + OPT_hinttyp->strobj->linkadr = 2; OPT_lrltyp->strobj->linkadr = 2; OPT_booltyp->strobj->linkadr = 2; OPT_bytetyp->strobj->linkadr = 2; @@ -790,7 +791,7 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) } else if (comp == 3) { if (n->class == 7) { OPM_WriteString((CHAR*)", ", 3); - OPV_ParIntLiteral(n->conval->intval2, OPM_PointerSize); + OPV_ParIntLiteral(n->conval->intval2, OPM_AddressSize); } else { aptyp = n->typ; dim = 0; @@ -809,7 +810,7 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) dim += 1; aptyp = aptyp->BaseTyp; } - OPV_ParIntLiteral(aptyp->size, OPM_PointerSize); + OPV_ParIntLiteral(aptyp->size, OPM_AddressSize); } } } @@ -1314,7 +1315,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) OPM_WriteString((CHAR*)", ", 3); if (typ->comp == 3) { if (x->class == 7) { - OPC_IntLiteral(x->conval->intval, OPM_PointerSize); + OPC_IntLiteral(x->conval->intval, OPM_AddressSize); } else { OPM_WriteString((CHAR*)"((address)(", 12); OPV_expr(x, 10); @@ -1322,7 +1323,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) } x = x->link; } else { - OPC_IntLiteral(typ->n, OPM_PointerSize); + OPC_IntLiteral(typ->n, OPM_AddressSize); } typ = typ->BaseTyp; } diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index 33c1eeeb..f78267d0 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 10d2ba41..a42034f5 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index 57c87f55..99b78a56 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 6982b582..c032a4a5 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index e79f35d7..b4469c3a 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index b2d5f19a..db9dbf02 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index ea987a3e..9d2d3b44 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index f277a856..5ae009bd 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index b2a965f8..299cfde9 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/Vishap.c b/bootstrap/unix-48/Vishap.c index 2d0b9dee..c3405c16 100644 --- a/bootstrap/unix-48/Vishap.c +++ b/bootstrap/unix-48/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkamSf */ #define INTEGER int16 #define LONGINT int32 @@ -79,22 +79,12 @@ void Vishap_Module (BOOLEAN *done) static void Vishap_PropagateElementaryTypeSizes (void) { - OPT_bytetyp->size = OPM_ByteSize; - OPT_sysptrtyp->size = OPM_PointerSize; - OPT_chartyp->size = OPM_CharSize; + OPT_sysptrtyp->size = OPM_AddressSize; + OPT_adrtyp->size = OPM_AddressSize; OPT_settyp->size = OPM_SetSize; - OPT_realtyp->size = OPM_RealSize; - OPT_adrtyp->size = OPM_PointerSize; - OPT_lrltyp->size = OPM_LRealSize; - OPT_booltyp->size = OPM_BoolSize; - OPT_sinttyp = OPT_int8typ; - if (OPM_IntSize == 2) { - OPT_inttyp = OPT_int16typ; - OPT_linttyp = OPT_int32typ; - } else { - OPT_inttyp = OPT_int32typ; - OPT_linttyp = OPT_int64typ; - } + OPT_sinttyp = OPT_IntType(OPM_ShortintSize); + OPT_inttyp = OPT_IntType(OPM_IntegerSize); + OPT_linttyp = OPT_IntType(OPM_LongintSize); OPT_sintobj->typ = OPT_sinttyp; OPT_intobj->typ = OPT_inttyp; OPT_lintobj->typ = OPT_linttyp; diff --git a/bootstrap/unix-48/errors.c b/bootstrap/unix-48/errors.c index 2bdf2af6..2e61c724 100644 --- a/bootstrap/unix-48/errors.c +++ b/bootstrap/unix-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/errors.h b/bootstrap/unix-48/errors.h index b3535e92..99f4c6b0 100644 --- a/bootstrap/unix-48/errors.h +++ b/bootstrap/unix-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index 5245f35d..8838dd7b 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index 414a05f0..d4f0c474 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/vt100.c b/bootstrap/unix-48/vt100.c index 4d312413..5d050112 100644 --- a/bootstrap/unix-48/vt100.c +++ b/bootstrap/unix-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/vt100.h b/bootstrap/unix-48/vt100.h index 1ecf99b1..11aabb2a 100644 --- a/bootstrap/unix-48/vt100.h +++ b/bootstrap/unix-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index a5c4087d..9db9e691 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/20] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/21] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index 6b8f5d99..831281d6 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Console.c b/bootstrap/unix-88/Console.c index dea88004..7e051e81 100644 --- a/bootstrap/unix-88/Console.c +++ b/bootstrap/unix-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Console.h b/bootstrap/unix-88/Console.h index a1322efe..be8ab870 100644 --- a/bootstrap/unix-88/Console.h +++ b/bootstrap/unix-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 7ace9c7c..efed2605 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 2040560d..64f39a5b 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index 02dc0bbd..68a02b24 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tskSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index aa22df29..04b1a4f9 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 60382d3c..0e60d59f 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index 4ef50204..5fec9a72 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index bd641a09..fedc1751 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -1940,7 +1940,7 @@ void OPB_StPar0 (OPT_Node *par0, int32 fctno) OPB_err(126); } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x0810, 64) && x->typ->size == (int64)OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x0810, 64) && x->typ->size == (int64)OPM_AddressSize))) { OPB_err(111); x->typ = OPT_linttyp; } @@ -2213,7 +2213,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) OPB_err(126); } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x0810, 64) && x->typ->size == (int64)OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x0810, 64) && x->typ->size == (int64)OPM_AddressSize))) { OPB_err(111); x->typ = OPT_linttyp; } diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index 1330baf1..72ea3c62 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index b33dc59f..2c8127e1 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -839,7 +839,7 @@ void OPC_TDescDecl (OPT_Struct typ) OPC_Str1((CHAR*)", #), {", 8, typ->size); nofptrs = 0; OPC_PutPtrOffsets(typ, 0, &nofptrs); - OPC_Str1((CHAR*)"#}}", 4, -((nofptrs + 1) * (int64)OPM_PointerSize)); + OPC_Str1((CHAR*)"#}}", 4, -((nofptrs + 1) * (int64)OPM_AddressSize)); OPC_EndStat(); } @@ -1966,7 +1966,7 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim) if (OPC_ansi) { OPM_WriteInt(array->n); } else { - OPC_IntLiteral(array->n, OPM_PointerSize); + OPC_IntLiteral(array->n, OPM_AddressSize); } } } diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index e749f6b6..30f3fd48 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 39c62389..391613fb 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -19,7 +19,7 @@ typedef static CHAR OPM_SourceFileName[256]; -export int32 OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet; +export int32 OPM_Alignment, OPM_AddressSize, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; export int64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; @@ -176,19 +176,26 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) case 'B': if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_IntSize = s[__X(i, s__len)] - 48; + OPM_IntegerSize = s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_PointerSize = s[__X(i, s__len)] - 48; + OPM_AddressSize = s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; OPM_Alignment = s[__X(i, s__len)] - 48; } - __ASSERT(OPM_IntSize == 2 || OPM_IntSize == 4, 0); - __ASSERT(OPM_PointerSize == 4 || OPM_PointerSize == 8, 0); + __ASSERT(OPM_IntegerSize == 2 || OPM_IntegerSize == 4, 0); + __ASSERT(OPM_AddressSize == 4 || OPM_AddressSize == 8, 0); __ASSERT(OPM_Alignment == 4 || OPM_Alignment == 8, 0); + if (OPM_IntegerSize == 2) { + OPM_LongintSize = 4; + OPM_SetSize = 4; + } else { + OPM_LongintSize = 8; + OPM_SetSize = 8; + } Files_SetSearchPath((CHAR*)"", 1); break; case 'F': @@ -624,41 +631,26 @@ static int64 OPM_power0 (int64 i, int64 j) static void OPM_VerboseListSizes (void) { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Type Size Alignement", 29); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"CHAR ", 14); - OPM_LogWNum(OPM_CharSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"BOOLEAN ", 14); - OPM_LogWNum(OPM_BoolSize, 4); + OPM_LogWStr((CHAR*)"Type Size", 17); OPM_LogWLn(); OPM_LogWStr((CHAR*)"SHORTINT ", 14); - OPM_LogWNum(OPM_SIntSize, 4); + OPM_LogWNum(OPM_ShortintSize, 4); OPM_LogWLn(); OPM_LogWStr((CHAR*)"INTEGER ", 14); - OPM_LogWNum(OPM_IntSize, 4); + OPM_LogWNum(OPM_IntegerSize, 4); OPM_LogWLn(); OPM_LogWStr((CHAR*)"LONGINT ", 14); - OPM_LogWNum(OPM_LIntSize, 4); + OPM_LogWNum(OPM_LongintSize, 4); OPM_LogWLn(); OPM_LogWStr((CHAR*)"SET ", 14); OPM_LogWNum(OPM_SetSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"REAL ", 14); - OPM_LogWNum(OPM_RealSize, 4); + OPM_LogWStr((CHAR*)"ADDRESS ", 14); + OPM_LogWNum(OPM_AddressSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"LONGREAL ", 14); - OPM_LogWNum(OPM_LRealSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"PTR ", 14); - OPM_LogWNum(OPM_PointerSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"PROC ", 14); - OPM_LogWNum(OPM_ProcSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"RECORD ", 14); - OPM_LogWNum(OPM_RecSize, 4); OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Alignment: ", 12); + OPM_LogWNum(OPM_Alignment, 4); OPM_LogWLn(); } @@ -681,23 +673,12 @@ int64 OPM_SignedMinimum (int64 bytecount) static void OPM_GetProperties (void) { - OPM_ProcSize = OPM_PointerSize; - OPM_LIntSize = __ASHL(OPM_IntSize, 1); - OPM_SetSize = OPM_LIntSize; - if (OPM_RealSize == 4) { - OPM_MaxReal = 3.40282346000000e+038; - } else if (OPM_RealSize == 8) { - OPM_MaxReal = 1.79769296342094e+308; - } - if (OPM_LRealSize == 4) { - OPM_MaxLReal = 3.40282346000000e+038; - } else if (OPM_LRealSize == 8) { - OPM_MaxLReal = 1.79769296342094e+308; - } + OPM_MaxReal = 3.40282346000000e+038; + OPM_MaxLReal = 1.79769296342094e+308; OPM_MinReal = -OPM_MaxReal; OPM_MinLReal = -OPM_MaxLReal; OPM_MaxSet = __ASHL(OPM_SetSize, 3) - 1; - OPM_MaxIndex = OPM_SignedMaximum(OPM_PointerSize); + OPM_MaxIndex = OPM_SignedMaximum(OPM_AddressSize); if (OPM_Verbose) { OPM_VerboseListSizes(); } @@ -868,7 +849,7 @@ void OPM_WriteInt (int64 i) { CHAR s[24]; int64 i1, k; - if ((i == OPM_SignedMinimum(OPM_IntSize) || i == OPM_SignedMinimum(OPM_LIntSize)) || i == OPM_SignedMinimum(8)) { + if ((i == OPM_SignedMinimum(2) || i == OPM_SignedMinimum(4)) || i == OPM_SignedMinimum(8)) { OPM_Write('('); OPM_WriteInt(i + 1); OPM_WriteString((CHAR*)"-1)", 4); @@ -901,7 +882,7 @@ void OPM_WriteReal (LONGREAL r, CHAR suffx) CHAR s[32]; CHAR ch; int32 i; - if ((((r < OPM_SignedMaximum(OPM_LIntSize) && r > OPM_SignedMinimum(OPM_LIntSize))) && r == (__ENTIER(r)))) { + if ((((r < OPM_SignedMaximum(OPM_LongintSize) && r > OPM_SignedMinimum(OPM_LongintSize))) && r == (__ENTIER(r)))) { if (suffx == 'f') { OPM_WriteString((CHAR*)"(REAL)", 7); } else { @@ -1070,15 +1051,11 @@ export void *OPM__init(void) Strings_Append((CHAR*)"/opt/voc", 9, (void*)OPM_OBERON, 1024); Strings_Append((CHAR*)"/sym;", 6, (void*)OPM_OBERON, 1024); Files_SetSearchPath(OPM_OBERON, 1024); - OPM_CharSize = 1; - OPM_BoolSize = 1; - OPM_SIntSize = 1; - OPM_RecSize = 1; - OPM_ByteSize = 1; - OPM_RealSize = 4; - OPM_LRealSize = 8; - OPM_PointerSize = 8; + OPM_AddressSize = 8; OPM_Alignment = 8; - OPM_IntSize = 4; + OPM_ShortintSize = 1; + OPM_IntegerSize = 4; + OPM_LongintSize = 8; + OPM_SetSize = 8; __ENDMOD; } diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index 908a80ad..4a9253cf 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h @@ -6,7 +6,7 @@ #include "SYSTEM.h" -import int32 OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet; +import int32 OPM_Alignment, OPM_AddressSize, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; import int64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index 8573d6b1..ff86118c 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index 7cbdb873..9ae7712a 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index a92e1feb..c811b3cc 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index d7c08330..1c9ae6a4 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index 6928030e..5fbe3b87 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -88,7 +88,7 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; -export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; export OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj; export int8 OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; @@ -1109,7 +1109,7 @@ static void OPT_InStruct (OPT_Struct *typ) switch (tag) { case 36: (*typ)->form = 11; - (*typ)->size = OPM_PointerSize; + (*typ)->size = OPM_AddressSize; (*typ)->n = 0; OPT_InStruct(&(*typ)->BaseTyp); break; @@ -1167,7 +1167,7 @@ static void OPT_InStruct (OPT_Struct *typ) break; case 40: (*typ)->form = 12; - (*typ)->size = OPM_ProcSize; + (*typ)->size = OPM_AddressSize; OPT_InSign(mno, &(*typ)->BaseTyp, &(*typ)->link); break; default: @@ -1755,7 +1755,7 @@ static void OPT_InitStruct (OPT_Struct *typ, int8 form) { *typ = OPT_NewStr(form, 1); (*typ)->ref = form; - (*typ)->size = OPM_ByteSize; + (*typ)->size = 1; (*typ)->allocated = 1; (*typ)->strobj = OPT_NewObj(); (*typ)->pbfp = form; @@ -1833,6 +1833,7 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_sinttyp); P(OPT_inttyp); P(OPT_linttyp); + P(OPT_hinttyp); P(OPT_adrtyp); P(OPT_int8typ); P(OPT_int16typ); @@ -1915,9 +1916,9 @@ export void *OPT__init(void) OPT_InitStruct(&OPT_notyp, 10); OPT_InitStruct(&OPT_stringtyp, 8); OPT_InitStruct(&OPT_niltyp, 9); - OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp); - OPT_EnterTyp((CHAR*)"PTR", 11, OPM_PointerSize, &OPT_sysptrtyp); - OPT_EnterTyp((CHAR*)"ADDRESS", 4, OPM_PointerSize, &OPT_adrtyp); + OPT_EnterTyp((CHAR*)"BYTE", 1, 1, &OPT_bytetyp); + OPT_EnterTyp((CHAR*)"PTR", 11, -1, &OPT_sysptrtyp); + OPT_EnterTyp((CHAR*)"ADDRESS", 4, -1, &OPT_adrtyp); OPT_EnterTyp((CHAR*)"INT8", 4, 1, &OPT_int8typ); OPT_EnterTyp((CHAR*)"INT16", 4, 2, &OPT_int16typ); OPT_EnterTyp((CHAR*)"INT32", 4, 4, &OPT_int32typ); @@ -1937,11 +1938,12 @@ export void *OPT__init(void) OPT_syslink = OPT_topScope->right; OPT_universe = OPT_topScope; OPT_topScope->right = NIL; - OPT_EnterTyp((CHAR*)"BOOLEAN", 2, OPM_BoolSize, &OPT_booltyp); - OPT_EnterTyp((CHAR*)"CHAR", 3, OPM_CharSize, &OPT_chartyp); - OPT_EnterTyp((CHAR*)"SET", 7, OPM_SetSize, &OPT_settyp); - OPT_EnterTyp((CHAR*)"REAL", 5, OPM_RealSize, &OPT_realtyp); - OPT_EnterTyp((CHAR*)"LONGREAL", 6, OPM_LRealSize, &OPT_lrltyp); + OPT_EnterTyp((CHAR*)"BOOLEAN", 2, 1, &OPT_booltyp); + OPT_EnterTyp((CHAR*)"CHAR", 3, 1, &OPT_chartyp); + OPT_EnterTyp((CHAR*)"SET", 7, -1, &OPT_settyp); + OPT_EnterTyp((CHAR*)"REAL", 5, 4, &OPT_realtyp); + OPT_EnterTyp((CHAR*)"LONGREAL", 6, 8, &OPT_lrltyp); + OPT_EnterTyp((CHAR*)"HUGEINT", 4, 8, &OPT_hinttyp); OPT_EnterTypeAlias((CHAR*)"SHORTINT", &OPT_sintobj); OPT_EnterTypeAlias((CHAR*)"INTEGER", &OPT_intobj); OPT_EnterTypeAlias((CHAR*)"LONGINT", &OPT_lintobj); diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index abb49dda..66686a2c 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h @@ -67,7 +67,7 @@ typedef import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; -import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; import OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj; import int8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 48080e50..965f7b61 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -69,7 +69,7 @@ void OPV_TypSize (OPT_Struct typ) btyp = typ->BaseTyp; if (btyp == NIL) { offset = 0; - base = OPC_SizeAlignment(OPM_RecSize); + base = 1; } else { OPV_TypSize(btyp); offset = btyp->size - (int64)__ASHR(btyp->sysflag, 8); @@ -105,14 +105,14 @@ void OPV_TypSize (OPT_Struct typ) OPV_TypSize(typ->BaseTyp); typ->size = typ->n * typ->BaseTyp->size; } else if (f == 11) { - typ->size = OPM_PointerSize; + typ->size = OPM_AddressSize; if (typ->BaseTyp == OPT_undftyp) { OPM_Mark(128, typ->n); } else { OPV_TypSize(typ->BaseTyp); } } else if (f == 12) { - typ->size = OPM_ProcSize; + typ->size = OPM_AddressSize; } else if (c == 3) { btyp = typ->BaseTyp; OPV_TypSize(btyp); @@ -273,6 +273,7 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_int16typ->strobj->linkadr = 2; OPT_int32typ->strobj->linkadr = 2; OPT_int64typ->strobj->linkadr = 2; + OPT_hinttyp->strobj->linkadr = 2; OPT_lrltyp->strobj->linkadr = 2; OPT_booltyp->strobj->linkadr = 2; OPT_bytetyp->strobj->linkadr = 2; @@ -790,7 +791,7 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) } else if (comp == 3) { if (n->class == 7) { OPM_WriteString((CHAR*)", ", 3); - OPV_ParIntLiteral(n->conval->intval2, OPM_PointerSize); + OPV_ParIntLiteral(n->conval->intval2, OPM_AddressSize); } else { aptyp = n->typ; dim = 0; @@ -809,7 +810,7 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) dim += 1; aptyp = aptyp->BaseTyp; } - OPV_ParIntLiteral(aptyp->size, OPM_PointerSize); + OPV_ParIntLiteral(aptyp->size, OPM_AddressSize); } } } @@ -1314,7 +1315,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) OPM_WriteString((CHAR*)", ", 3); if (typ->comp == 3) { if (x->class == 7) { - OPC_IntLiteral(x->conval->intval, OPM_PointerSize); + OPC_IntLiteral(x->conval->intval, OPM_AddressSize); } else { OPM_WriteString((CHAR*)"((address)(", 12); OPV_expr(x, 10); @@ -1322,7 +1323,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) } x = x->link; } else { - OPC_IntLiteral(typ->n, OPM_PointerSize); + OPC_IntLiteral(typ->n, OPM_AddressSize); } typ = typ->BaseTyp; } diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index 33c1eeeb..f78267d0 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 55230bcc..e2180e5d 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index d5e89ca2..6a8cce4b 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index e81db820..e9e84723 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index dec142cf..116d9c93 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index 6aa3846a..8dc35935 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index d1c9f056..0487b70c 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index 37fac00b..54254c51 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index 0f195ce8..40d02918 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/Vishap.c b/bootstrap/unix-88/Vishap.c index 00f0ac1a..7cd188f2 100644 --- a/bootstrap/unix-88/Vishap.c +++ b/bootstrap/unix-88/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkamSf */ #define INTEGER int32 #define LONGINT int64 @@ -79,22 +79,12 @@ void Vishap_Module (BOOLEAN *done) static void Vishap_PropagateElementaryTypeSizes (void) { - OPT_bytetyp->size = OPM_ByteSize; - OPT_sysptrtyp->size = OPM_PointerSize; - OPT_chartyp->size = OPM_CharSize; + OPT_sysptrtyp->size = OPM_AddressSize; + OPT_adrtyp->size = OPM_AddressSize; OPT_settyp->size = OPM_SetSize; - OPT_realtyp->size = OPM_RealSize; - OPT_adrtyp->size = OPM_PointerSize; - OPT_lrltyp->size = OPM_LRealSize; - OPT_booltyp->size = OPM_BoolSize; - OPT_sinttyp = OPT_int8typ; - if (OPM_IntSize == 2) { - OPT_inttyp = OPT_int16typ; - OPT_linttyp = OPT_int32typ; - } else { - OPT_inttyp = OPT_int32typ; - OPT_linttyp = OPT_int64typ; - } + OPT_sinttyp = OPT_IntType(OPM_ShortintSize); + OPT_inttyp = OPT_IntType(OPM_IntegerSize); + OPT_linttyp = OPT_IntType(OPM_LongintSize); OPT_sintobj->typ = OPT_sinttyp; OPT_intobj->typ = OPT_inttyp; OPT_lintobj->typ = OPT_linttyp; diff --git a/bootstrap/unix-88/errors.c b/bootstrap/unix-88/errors.c index 8396896b..04b9504d 100644 --- a/bootstrap/unix-88/errors.c +++ b/bootstrap/unix-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/errors.h b/bootstrap/unix-88/errors.h index b3535e92..99f4c6b0 100644 --- a/bootstrap/unix-88/errors.h +++ b/bootstrap/unix-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index a4fbedda..2eef1f18 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index 414a05f0..d4f0c474 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/vt100.c b/bootstrap/unix-88/vt100.c index 04503b55..3b56b4b1 100644 --- a/bootstrap/unix-88/vt100.c +++ b/bootstrap/unix-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/vt100.h b/bootstrap/unix-88/vt100.h index c27f0ae1..b574976e 100644 --- a/bootstrap/unix-88/vt100.h +++ b/bootstrap/unix-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index 4ea29c15..6db18d8a 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/20] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/21] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index 6b8f5d99..831281d6 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Console.c b/bootstrap/windows-48/Console.c index 6409cfb5..94c1e086 100644 --- a/bootstrap/windows-48/Console.c +++ b/bootstrap/windows-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Console.h b/bootstrap/windows-48/Console.h index 8f5a2a2a..b18bf88a 100644 --- a/bootstrap/windows-48/Console.h +++ b/bootstrap/windows-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index d55dffcd..0c320187 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index 8b2d7bab..febb2814 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index 08a21c58..63b8e488 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tskSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index 65b6b0b1..d150f1cf 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index f61acc40..a74b13a3 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index 6841c244..d570a488 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index 3ec5dfc2..a4070347 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -1940,7 +1940,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) OPB_err(126); } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x0810, 32) && x->typ->size == OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x0810, 32) && x->typ->size == OPM_AddressSize))) { OPB_err(111); x->typ = OPT_linttyp; } @@ -2213,7 +2213,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) OPB_err(126); } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x0810, 32) && x->typ->size == OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x0810, 32) && x->typ->size == OPM_AddressSize))) { OPB_err(111); x->typ = OPT_linttyp; } diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index a57ace75..a39fd352 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 9923ccbc..f3b40759 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -839,7 +839,7 @@ void OPC_TDescDecl (OPT_Struct typ) OPC_Str1((CHAR*)", #), {", 8, typ->size); nofptrs = 0; OPC_PutPtrOffsets(typ, 0, &nofptrs); - OPC_Str1((CHAR*)"#}}", 4, -((nofptrs + 1) * OPM_PointerSize)); + OPC_Str1((CHAR*)"#}}", 4, -((nofptrs + 1) * OPM_AddressSize)); OPC_EndStat(); } @@ -1966,7 +1966,7 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim) if (OPC_ansi) { OPM_WriteInt(array->n); } else { - OPC_IntLiteral(array->n, OPM_PointerSize); + OPC_IntLiteral(array->n, OPM_AddressSize); } } } diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index 83153512..1ac87c2d 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 775776f4..e5b7fc83 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -19,7 +19,7 @@ typedef static CHAR OPM_SourceFileName[256]; -export int16 OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet; +export int16 OPM_Alignment, OPM_AddressSize, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; export int64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; @@ -177,19 +177,26 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) case 'B': if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_IntSize = (int16)s[__X(i, s__len)] - 48; + OPM_IntegerSize = (int16)s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_PointerSize = (int16)s[__X(i, s__len)] - 48; + OPM_AddressSize = (int16)s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; OPM_Alignment = (int16)s[__X(i, s__len)] - 48; } - __ASSERT(OPM_IntSize == 2 || OPM_IntSize == 4, 0); - __ASSERT(OPM_PointerSize == 4 || OPM_PointerSize == 8, 0); + __ASSERT(OPM_IntegerSize == 2 || OPM_IntegerSize == 4, 0); + __ASSERT(OPM_AddressSize == 4 || OPM_AddressSize == 8, 0); __ASSERT(OPM_Alignment == 4 || OPM_Alignment == 8, 0); + if (OPM_IntegerSize == 2) { + OPM_LongintSize = 4; + OPM_SetSize = 4; + } else { + OPM_LongintSize = 8; + OPM_SetSize = 8; + } Files_SetSearchPath((CHAR*)"", 1); break; case 'F': @@ -627,41 +634,26 @@ static int32 OPM_power0 (int32 i, int32 j) static void OPM_VerboseListSizes (void) { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Type Size Alignement", 29); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"CHAR ", 14); - OPM_LogWNum(OPM_CharSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"BOOLEAN ", 14); - OPM_LogWNum(OPM_BoolSize, 4); + OPM_LogWStr((CHAR*)"Type Size", 17); OPM_LogWLn(); OPM_LogWStr((CHAR*)"SHORTINT ", 14); - OPM_LogWNum(OPM_SIntSize, 4); + OPM_LogWNum(OPM_ShortintSize, 4); OPM_LogWLn(); OPM_LogWStr((CHAR*)"INTEGER ", 14); - OPM_LogWNum(OPM_IntSize, 4); + OPM_LogWNum(OPM_IntegerSize, 4); OPM_LogWLn(); OPM_LogWStr((CHAR*)"LONGINT ", 14); - OPM_LogWNum(OPM_LIntSize, 4); + OPM_LogWNum(OPM_LongintSize, 4); OPM_LogWLn(); OPM_LogWStr((CHAR*)"SET ", 14); OPM_LogWNum(OPM_SetSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"REAL ", 14); - OPM_LogWNum(OPM_RealSize, 4); + OPM_LogWStr((CHAR*)"ADDRESS ", 14); + OPM_LogWNum(OPM_AddressSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"LONGREAL ", 14); - OPM_LogWNum(OPM_LRealSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"PTR ", 14); - OPM_LogWNum(OPM_PointerSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"PROC ", 14); - OPM_LogWNum(OPM_ProcSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"RECORD ", 14); - OPM_LogWNum(OPM_RecSize, 4); OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Alignment: ", 12); + OPM_LogWNum(OPM_Alignment, 4); OPM_LogWLn(); } @@ -684,23 +676,12 @@ int64 OPM_SignedMinimum (int32 bytecount) static void OPM_GetProperties (void) { - OPM_ProcSize = OPM_PointerSize; - OPM_LIntSize = __ASHL(OPM_IntSize, 1); - OPM_SetSize = OPM_LIntSize; - if (OPM_RealSize == 4) { - OPM_MaxReal = 3.40282346000000e+038; - } else if (OPM_RealSize == 8) { - OPM_MaxReal = 1.79769296342094e+308; - } - if (OPM_LRealSize == 4) { - OPM_MaxLReal = 3.40282346000000e+038; - } else if (OPM_LRealSize == 8) { - OPM_MaxLReal = 1.79769296342094e+308; - } + OPM_MaxReal = 3.40282346000000e+038; + OPM_MaxLReal = 1.79769296342094e+308; OPM_MinReal = -OPM_MaxReal; OPM_MinLReal = -OPM_MaxLReal; OPM_MaxSet = __ASHL(OPM_SetSize, 3) - 1; - OPM_MaxIndex = OPM_SignedMaximum(OPM_PointerSize); + OPM_MaxIndex = OPM_SignedMaximum(OPM_AddressSize); if (OPM_Verbose) { OPM_VerboseListSizes(); } @@ -871,7 +852,7 @@ void OPM_WriteInt (int64 i) { CHAR s[24]; int64 i1, k; - if ((i == OPM_SignedMinimum(OPM_IntSize) || i == OPM_SignedMinimum(OPM_LIntSize)) || i == OPM_SignedMinimum(8)) { + if ((i == OPM_SignedMinimum(2) || i == OPM_SignedMinimum(4)) || i == OPM_SignedMinimum(8)) { OPM_Write('('); OPM_WriteInt(i + 1); OPM_WriteString((CHAR*)"-1)", 4); @@ -904,7 +885,7 @@ void OPM_WriteReal (LONGREAL r, CHAR suffx) CHAR s[32]; CHAR ch; int16 i; - if ((((r < OPM_SignedMaximum(OPM_LIntSize) && r > OPM_SignedMinimum(OPM_LIntSize))) && r == ((int32)__ENTIER(r)))) { + if ((((r < OPM_SignedMaximum(OPM_LongintSize) && r > OPM_SignedMinimum(OPM_LongintSize))) && r == ((int32)__ENTIER(r)))) { if (suffx == 'f') { OPM_WriteString((CHAR*)"(REAL)", 7); } else { @@ -1073,15 +1054,11 @@ export void *OPM__init(void) Strings_Append((CHAR*)"/opt/voc", 9, (void*)OPM_OBERON, 1024); Strings_Append((CHAR*)"/sym;", 6, (void*)OPM_OBERON, 1024); Files_SetSearchPath(OPM_OBERON, 1024); - OPM_CharSize = 1; - OPM_BoolSize = 1; - OPM_SIntSize = 1; - OPM_RecSize = 1; - OPM_ByteSize = 1; - OPM_RealSize = 4; - OPM_LRealSize = 8; - OPM_PointerSize = 8; + OPM_AddressSize = 8; OPM_Alignment = 8; - OPM_IntSize = 4; + OPM_ShortintSize = 1; + OPM_IntegerSize = 4; + OPM_LongintSize = 8; + OPM_SetSize = 8; __ENDMOD; } diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index 9d7661c6..1835a2b8 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h @@ -6,7 +6,7 @@ #include "SYSTEM.h" -import int16 OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet; +import int16 OPM_Alignment, OPM_AddressSize, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; import int64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index 86101b2b..f62551cc 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index 7cbdb873..9ae7712a 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index 67bca013..f04f47ad 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index 3f106d0c..3ff9b0b3 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index c1bc93b1..acdca9f2 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -89,7 +89,7 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; -export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; export OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj; export int8 OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; @@ -1110,7 +1110,7 @@ static void OPT_InStruct (OPT_Struct *typ) switch (tag) { case 36: (*typ)->form = 11; - (*typ)->size = OPM_PointerSize; + (*typ)->size = OPM_AddressSize; (*typ)->n = 0; OPT_InStruct(&(*typ)->BaseTyp); break; @@ -1168,7 +1168,7 @@ static void OPT_InStruct (OPT_Struct *typ) break; case 40: (*typ)->form = 12; - (*typ)->size = OPM_ProcSize; + (*typ)->size = OPM_AddressSize; OPT_InSign(mno, &(*typ)->BaseTyp, &(*typ)->link); break; default: @@ -1756,7 +1756,7 @@ static void OPT_InitStruct (OPT_Struct *typ, int8 form) { *typ = OPT_NewStr(form, 1); (*typ)->ref = form; - (*typ)->size = OPM_ByteSize; + (*typ)->size = 1; (*typ)->allocated = 1; (*typ)->strobj = OPT_NewObj(); (*typ)->pbfp = form; @@ -1834,6 +1834,7 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_sinttyp); P(OPT_inttyp); P(OPT_linttyp); + P(OPT_hinttyp); P(OPT_adrtyp); P(OPT_int8typ); P(OPT_int16typ); @@ -1916,9 +1917,9 @@ export void *OPT__init(void) OPT_InitStruct(&OPT_notyp, 10); OPT_InitStruct(&OPT_stringtyp, 8); OPT_InitStruct(&OPT_niltyp, 9); - OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp); - OPT_EnterTyp((CHAR*)"PTR", 11, OPM_PointerSize, &OPT_sysptrtyp); - OPT_EnterTyp((CHAR*)"ADDRESS", 4, OPM_PointerSize, &OPT_adrtyp); + OPT_EnterTyp((CHAR*)"BYTE", 1, 1, &OPT_bytetyp); + OPT_EnterTyp((CHAR*)"PTR", 11, -1, &OPT_sysptrtyp); + OPT_EnterTyp((CHAR*)"ADDRESS", 4, -1, &OPT_adrtyp); OPT_EnterTyp((CHAR*)"INT8", 4, 1, &OPT_int8typ); OPT_EnterTyp((CHAR*)"INT16", 4, 2, &OPT_int16typ); OPT_EnterTyp((CHAR*)"INT32", 4, 4, &OPT_int32typ); @@ -1938,11 +1939,12 @@ export void *OPT__init(void) OPT_syslink = OPT_topScope->right; OPT_universe = OPT_topScope; OPT_topScope->right = NIL; - OPT_EnterTyp((CHAR*)"BOOLEAN", 2, OPM_BoolSize, &OPT_booltyp); - OPT_EnterTyp((CHAR*)"CHAR", 3, OPM_CharSize, &OPT_chartyp); - OPT_EnterTyp((CHAR*)"SET", 7, OPM_SetSize, &OPT_settyp); - OPT_EnterTyp((CHAR*)"REAL", 5, OPM_RealSize, &OPT_realtyp); - OPT_EnterTyp((CHAR*)"LONGREAL", 6, OPM_LRealSize, &OPT_lrltyp); + OPT_EnterTyp((CHAR*)"BOOLEAN", 2, 1, &OPT_booltyp); + OPT_EnterTyp((CHAR*)"CHAR", 3, 1, &OPT_chartyp); + OPT_EnterTyp((CHAR*)"SET", 7, -1, &OPT_settyp); + OPT_EnterTyp((CHAR*)"REAL", 5, 4, &OPT_realtyp); + OPT_EnterTyp((CHAR*)"LONGREAL", 6, 8, &OPT_lrltyp); + OPT_EnterTyp((CHAR*)"HUGEINT", 4, 8, &OPT_hinttyp); OPT_EnterTypeAlias((CHAR*)"SHORTINT", &OPT_sintobj); OPT_EnterTypeAlias((CHAR*)"INTEGER", &OPT_intobj); OPT_EnterTypeAlias((CHAR*)"LONGINT", &OPT_lintobj); diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index fd0a538e..9ee5643f 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h @@ -68,7 +68,7 @@ typedef import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; -import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; import OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj; import int8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index ffe3eb71..2146d7c2 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -69,7 +69,7 @@ void OPV_TypSize (OPT_Struct typ) btyp = typ->BaseTyp; if (btyp == NIL) { offset = 0; - base = OPC_SizeAlignment(OPM_RecSize); + base = 1; } else { OPV_TypSize(btyp); offset = btyp->size - __ASHR(btyp->sysflag, 8); @@ -105,14 +105,14 @@ void OPV_TypSize (OPT_Struct typ) OPV_TypSize(typ->BaseTyp); typ->size = typ->n * typ->BaseTyp->size; } else if (f == 11) { - typ->size = OPM_PointerSize; + typ->size = OPM_AddressSize; if (typ->BaseTyp == OPT_undftyp) { OPM_Mark(128, typ->n); } else { OPV_TypSize(typ->BaseTyp); } } else if (f == 12) { - typ->size = OPM_ProcSize; + typ->size = OPM_AddressSize; } else if (c == 3) { btyp = typ->BaseTyp; OPV_TypSize(btyp); @@ -273,6 +273,7 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_int16typ->strobj->linkadr = 2; OPT_int32typ->strobj->linkadr = 2; OPT_int64typ->strobj->linkadr = 2; + OPT_hinttyp->strobj->linkadr = 2; OPT_lrltyp->strobj->linkadr = 2; OPT_booltyp->strobj->linkadr = 2; OPT_bytetyp->strobj->linkadr = 2; @@ -790,7 +791,7 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) } else if (comp == 3) { if (n->class == 7) { OPM_WriteString((CHAR*)", ", 3); - OPV_ParIntLiteral(n->conval->intval2, OPM_PointerSize); + OPV_ParIntLiteral(n->conval->intval2, OPM_AddressSize); } else { aptyp = n->typ; dim = 0; @@ -809,7 +810,7 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) dim += 1; aptyp = aptyp->BaseTyp; } - OPV_ParIntLiteral(aptyp->size, OPM_PointerSize); + OPV_ParIntLiteral(aptyp->size, OPM_AddressSize); } } } @@ -1314,7 +1315,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) OPM_WriteString((CHAR*)", ", 3); if (typ->comp == 3) { if (x->class == 7) { - OPC_IntLiteral(x->conval->intval, OPM_PointerSize); + OPC_IntLiteral(x->conval->intval, OPM_AddressSize); } else { OPM_WriteString((CHAR*)"((address)(", 12); OPV_expr(x, 10); @@ -1322,7 +1323,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) } x = x->link; } else { - OPC_IntLiteral(typ->n, OPM_PointerSize); + OPC_IntLiteral(typ->n, OPM_AddressSize); } typ = typ->BaseTyp; } diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index 33c1eeeb..f78267d0 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 35849e85..89bc758a 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index 84dc9bd1..9a1147dc 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 6982b582..c032a4a5 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index e79f35d7..b4469c3a 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index b2d5f19a..db9dbf02 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index ea987a3e..9d2d3b44 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index f277a856..5ae009bd 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index b2a965f8..299cfde9 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/Vishap.c b/bootstrap/windows-48/Vishap.c index 2d0b9dee..c3405c16 100644 --- a/bootstrap/windows-48/Vishap.c +++ b/bootstrap/windows-48/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkamSf */ #define INTEGER int16 #define LONGINT int32 @@ -79,22 +79,12 @@ void Vishap_Module (BOOLEAN *done) static void Vishap_PropagateElementaryTypeSizes (void) { - OPT_bytetyp->size = OPM_ByteSize; - OPT_sysptrtyp->size = OPM_PointerSize; - OPT_chartyp->size = OPM_CharSize; + OPT_sysptrtyp->size = OPM_AddressSize; + OPT_adrtyp->size = OPM_AddressSize; OPT_settyp->size = OPM_SetSize; - OPT_realtyp->size = OPM_RealSize; - OPT_adrtyp->size = OPM_PointerSize; - OPT_lrltyp->size = OPM_LRealSize; - OPT_booltyp->size = OPM_BoolSize; - OPT_sinttyp = OPT_int8typ; - if (OPM_IntSize == 2) { - OPT_inttyp = OPT_int16typ; - OPT_linttyp = OPT_int32typ; - } else { - OPT_inttyp = OPT_int32typ; - OPT_linttyp = OPT_int64typ; - } + OPT_sinttyp = OPT_IntType(OPM_ShortintSize); + OPT_inttyp = OPT_IntType(OPM_IntegerSize); + OPT_linttyp = OPT_IntType(OPM_LongintSize); OPT_sintobj->typ = OPT_sinttyp; OPT_intobj->typ = OPT_inttyp; OPT_lintobj->typ = OPT_linttyp; diff --git a/bootstrap/windows-48/errors.c b/bootstrap/windows-48/errors.c index 2bdf2af6..2e61c724 100644 --- a/bootstrap/windows-48/errors.c +++ b/bootstrap/windows-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/errors.h b/bootstrap/windows-48/errors.h index b3535e92..99f4c6b0 100644 --- a/bootstrap/windows-48/errors.h +++ b/bootstrap/windows-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index 5245f35d..8838dd7b 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index 414a05f0..d4f0c474 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/vt100.c b/bootstrap/windows-48/vt100.c index 4d312413..5d050112 100644 --- a/bootstrap/windows-48/vt100.c +++ b/bootstrap/windows-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/vt100.h b/bootstrap/windows-48/vt100.h index 1ecf99b1..11aabb2a 100644 --- a/bootstrap/windows-48/vt100.h +++ b/bootstrap/windows-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index a5c4087d..9db9e691 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/20] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/21] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index 6b8f5d99..831281d6 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Console.c b/bootstrap/windows-88/Console.c index a18275f8..b0a79723 100644 --- a/bootstrap/windows-88/Console.c +++ b/bootstrap/windows-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Console.h b/bootstrap/windows-88/Console.h index a1322efe..be8ab870 100644 --- a/bootstrap/windows-88/Console.h +++ b/bootstrap/windows-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index ead58244..de0e2164 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 94cf47a0..f0ec05c1 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index 02dc0bbd..68a02b24 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tskSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index aa22df29..04b1a4f9 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 60382d3c..0e60d59f 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index 4ef50204..5fec9a72 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index bd641a09..fedc1751 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -1940,7 +1940,7 @@ void OPB_StPar0 (OPT_Node *par0, int32 fctno) OPB_err(126); } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x0810, 64) && x->typ->size == (int64)OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x0810, 64) && x->typ->size == (int64)OPM_AddressSize))) { OPB_err(111); x->typ = OPT_linttyp; } @@ -2213,7 +2213,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) OPB_err(126); } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x0810, 64) && x->typ->size == (int64)OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x0810, 64) && x->typ->size == (int64)OPM_AddressSize))) { OPB_err(111); x->typ = OPT_linttyp; } diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index 1330baf1..72ea3c62 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index b33dc59f..2c8127e1 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -839,7 +839,7 @@ void OPC_TDescDecl (OPT_Struct typ) OPC_Str1((CHAR*)", #), {", 8, typ->size); nofptrs = 0; OPC_PutPtrOffsets(typ, 0, &nofptrs); - OPC_Str1((CHAR*)"#}}", 4, -((nofptrs + 1) * (int64)OPM_PointerSize)); + OPC_Str1((CHAR*)"#}}", 4, -((nofptrs + 1) * (int64)OPM_AddressSize)); OPC_EndStat(); } @@ -1966,7 +1966,7 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim) if (OPC_ansi) { OPM_WriteInt(array->n); } else { - OPC_IntLiteral(array->n, OPM_PointerSize); + OPC_IntLiteral(array->n, OPM_AddressSize); } } } diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index e749f6b6..30f3fd48 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 39c62389..391613fb 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -19,7 +19,7 @@ typedef static CHAR OPM_SourceFileName[256]; -export int32 OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet; +export int32 OPM_Alignment, OPM_AddressSize, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; export int64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; @@ -176,19 +176,26 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) case 'B': if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_IntSize = s[__X(i, s__len)] - 48; + OPM_IntegerSize = s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_PointerSize = s[__X(i, s__len)] - 48; + OPM_AddressSize = s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; OPM_Alignment = s[__X(i, s__len)] - 48; } - __ASSERT(OPM_IntSize == 2 || OPM_IntSize == 4, 0); - __ASSERT(OPM_PointerSize == 4 || OPM_PointerSize == 8, 0); + __ASSERT(OPM_IntegerSize == 2 || OPM_IntegerSize == 4, 0); + __ASSERT(OPM_AddressSize == 4 || OPM_AddressSize == 8, 0); __ASSERT(OPM_Alignment == 4 || OPM_Alignment == 8, 0); + if (OPM_IntegerSize == 2) { + OPM_LongintSize = 4; + OPM_SetSize = 4; + } else { + OPM_LongintSize = 8; + OPM_SetSize = 8; + } Files_SetSearchPath((CHAR*)"", 1); break; case 'F': @@ -624,41 +631,26 @@ static int64 OPM_power0 (int64 i, int64 j) static void OPM_VerboseListSizes (void) { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Type Size Alignement", 29); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"CHAR ", 14); - OPM_LogWNum(OPM_CharSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"BOOLEAN ", 14); - OPM_LogWNum(OPM_BoolSize, 4); + OPM_LogWStr((CHAR*)"Type Size", 17); OPM_LogWLn(); OPM_LogWStr((CHAR*)"SHORTINT ", 14); - OPM_LogWNum(OPM_SIntSize, 4); + OPM_LogWNum(OPM_ShortintSize, 4); OPM_LogWLn(); OPM_LogWStr((CHAR*)"INTEGER ", 14); - OPM_LogWNum(OPM_IntSize, 4); + OPM_LogWNum(OPM_IntegerSize, 4); OPM_LogWLn(); OPM_LogWStr((CHAR*)"LONGINT ", 14); - OPM_LogWNum(OPM_LIntSize, 4); + OPM_LogWNum(OPM_LongintSize, 4); OPM_LogWLn(); OPM_LogWStr((CHAR*)"SET ", 14); OPM_LogWNum(OPM_SetSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"REAL ", 14); - OPM_LogWNum(OPM_RealSize, 4); + OPM_LogWStr((CHAR*)"ADDRESS ", 14); + OPM_LogWNum(OPM_AddressSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"LONGREAL ", 14); - OPM_LogWNum(OPM_LRealSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"PTR ", 14); - OPM_LogWNum(OPM_PointerSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"PROC ", 14); - OPM_LogWNum(OPM_ProcSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"RECORD ", 14); - OPM_LogWNum(OPM_RecSize, 4); OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Alignment: ", 12); + OPM_LogWNum(OPM_Alignment, 4); OPM_LogWLn(); } @@ -681,23 +673,12 @@ int64 OPM_SignedMinimum (int64 bytecount) static void OPM_GetProperties (void) { - OPM_ProcSize = OPM_PointerSize; - OPM_LIntSize = __ASHL(OPM_IntSize, 1); - OPM_SetSize = OPM_LIntSize; - if (OPM_RealSize == 4) { - OPM_MaxReal = 3.40282346000000e+038; - } else if (OPM_RealSize == 8) { - OPM_MaxReal = 1.79769296342094e+308; - } - if (OPM_LRealSize == 4) { - OPM_MaxLReal = 3.40282346000000e+038; - } else if (OPM_LRealSize == 8) { - OPM_MaxLReal = 1.79769296342094e+308; - } + OPM_MaxReal = 3.40282346000000e+038; + OPM_MaxLReal = 1.79769296342094e+308; OPM_MinReal = -OPM_MaxReal; OPM_MinLReal = -OPM_MaxLReal; OPM_MaxSet = __ASHL(OPM_SetSize, 3) - 1; - OPM_MaxIndex = OPM_SignedMaximum(OPM_PointerSize); + OPM_MaxIndex = OPM_SignedMaximum(OPM_AddressSize); if (OPM_Verbose) { OPM_VerboseListSizes(); } @@ -868,7 +849,7 @@ void OPM_WriteInt (int64 i) { CHAR s[24]; int64 i1, k; - if ((i == OPM_SignedMinimum(OPM_IntSize) || i == OPM_SignedMinimum(OPM_LIntSize)) || i == OPM_SignedMinimum(8)) { + if ((i == OPM_SignedMinimum(2) || i == OPM_SignedMinimum(4)) || i == OPM_SignedMinimum(8)) { OPM_Write('('); OPM_WriteInt(i + 1); OPM_WriteString((CHAR*)"-1)", 4); @@ -901,7 +882,7 @@ void OPM_WriteReal (LONGREAL r, CHAR suffx) CHAR s[32]; CHAR ch; int32 i; - if ((((r < OPM_SignedMaximum(OPM_LIntSize) && r > OPM_SignedMinimum(OPM_LIntSize))) && r == (__ENTIER(r)))) { + if ((((r < OPM_SignedMaximum(OPM_LongintSize) && r > OPM_SignedMinimum(OPM_LongintSize))) && r == (__ENTIER(r)))) { if (suffx == 'f') { OPM_WriteString((CHAR*)"(REAL)", 7); } else { @@ -1070,15 +1051,11 @@ export void *OPM__init(void) Strings_Append((CHAR*)"/opt/voc", 9, (void*)OPM_OBERON, 1024); Strings_Append((CHAR*)"/sym;", 6, (void*)OPM_OBERON, 1024); Files_SetSearchPath(OPM_OBERON, 1024); - OPM_CharSize = 1; - OPM_BoolSize = 1; - OPM_SIntSize = 1; - OPM_RecSize = 1; - OPM_ByteSize = 1; - OPM_RealSize = 4; - OPM_LRealSize = 8; - OPM_PointerSize = 8; + OPM_AddressSize = 8; OPM_Alignment = 8; - OPM_IntSize = 4; + OPM_ShortintSize = 1; + OPM_IntegerSize = 4; + OPM_LongintSize = 8; + OPM_SetSize = 8; __ENDMOD; } diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index 908a80ad..4a9253cf 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h @@ -6,7 +6,7 @@ #include "SYSTEM.h" -import int32 OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet; +import int32 OPM_Alignment, OPM_AddressSize, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; import int64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index 8573d6b1..ff86118c 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index 7cbdb873..9ae7712a 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index a92e1feb..c811b3cc 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index d7c08330..1c9ae6a4 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index 6928030e..5fbe3b87 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -88,7 +88,7 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; -export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; export OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj; export int8 OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; @@ -1109,7 +1109,7 @@ static void OPT_InStruct (OPT_Struct *typ) switch (tag) { case 36: (*typ)->form = 11; - (*typ)->size = OPM_PointerSize; + (*typ)->size = OPM_AddressSize; (*typ)->n = 0; OPT_InStruct(&(*typ)->BaseTyp); break; @@ -1167,7 +1167,7 @@ static void OPT_InStruct (OPT_Struct *typ) break; case 40: (*typ)->form = 12; - (*typ)->size = OPM_ProcSize; + (*typ)->size = OPM_AddressSize; OPT_InSign(mno, &(*typ)->BaseTyp, &(*typ)->link); break; default: @@ -1755,7 +1755,7 @@ static void OPT_InitStruct (OPT_Struct *typ, int8 form) { *typ = OPT_NewStr(form, 1); (*typ)->ref = form; - (*typ)->size = OPM_ByteSize; + (*typ)->size = 1; (*typ)->allocated = 1; (*typ)->strobj = OPT_NewObj(); (*typ)->pbfp = form; @@ -1833,6 +1833,7 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_sinttyp); P(OPT_inttyp); P(OPT_linttyp); + P(OPT_hinttyp); P(OPT_adrtyp); P(OPT_int8typ); P(OPT_int16typ); @@ -1915,9 +1916,9 @@ export void *OPT__init(void) OPT_InitStruct(&OPT_notyp, 10); OPT_InitStruct(&OPT_stringtyp, 8); OPT_InitStruct(&OPT_niltyp, 9); - OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp); - OPT_EnterTyp((CHAR*)"PTR", 11, OPM_PointerSize, &OPT_sysptrtyp); - OPT_EnterTyp((CHAR*)"ADDRESS", 4, OPM_PointerSize, &OPT_adrtyp); + OPT_EnterTyp((CHAR*)"BYTE", 1, 1, &OPT_bytetyp); + OPT_EnterTyp((CHAR*)"PTR", 11, -1, &OPT_sysptrtyp); + OPT_EnterTyp((CHAR*)"ADDRESS", 4, -1, &OPT_adrtyp); OPT_EnterTyp((CHAR*)"INT8", 4, 1, &OPT_int8typ); OPT_EnterTyp((CHAR*)"INT16", 4, 2, &OPT_int16typ); OPT_EnterTyp((CHAR*)"INT32", 4, 4, &OPT_int32typ); @@ -1937,11 +1938,12 @@ export void *OPT__init(void) OPT_syslink = OPT_topScope->right; OPT_universe = OPT_topScope; OPT_topScope->right = NIL; - OPT_EnterTyp((CHAR*)"BOOLEAN", 2, OPM_BoolSize, &OPT_booltyp); - OPT_EnterTyp((CHAR*)"CHAR", 3, OPM_CharSize, &OPT_chartyp); - OPT_EnterTyp((CHAR*)"SET", 7, OPM_SetSize, &OPT_settyp); - OPT_EnterTyp((CHAR*)"REAL", 5, OPM_RealSize, &OPT_realtyp); - OPT_EnterTyp((CHAR*)"LONGREAL", 6, OPM_LRealSize, &OPT_lrltyp); + OPT_EnterTyp((CHAR*)"BOOLEAN", 2, 1, &OPT_booltyp); + OPT_EnterTyp((CHAR*)"CHAR", 3, 1, &OPT_chartyp); + OPT_EnterTyp((CHAR*)"SET", 7, -1, &OPT_settyp); + OPT_EnterTyp((CHAR*)"REAL", 5, 4, &OPT_realtyp); + OPT_EnterTyp((CHAR*)"LONGREAL", 6, 8, &OPT_lrltyp); + OPT_EnterTyp((CHAR*)"HUGEINT", 4, 8, &OPT_hinttyp); OPT_EnterTypeAlias((CHAR*)"SHORTINT", &OPT_sintobj); OPT_EnterTypeAlias((CHAR*)"INTEGER", &OPT_intobj); OPT_EnterTypeAlias((CHAR*)"LONGINT", &OPT_lintobj); diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index abb49dda..66686a2c 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h @@ -67,7 +67,7 @@ typedef import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; -import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; import OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj; import int8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 48080e50..965f7b61 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -69,7 +69,7 @@ void OPV_TypSize (OPT_Struct typ) btyp = typ->BaseTyp; if (btyp == NIL) { offset = 0; - base = OPC_SizeAlignment(OPM_RecSize); + base = 1; } else { OPV_TypSize(btyp); offset = btyp->size - (int64)__ASHR(btyp->sysflag, 8); @@ -105,14 +105,14 @@ void OPV_TypSize (OPT_Struct typ) OPV_TypSize(typ->BaseTyp); typ->size = typ->n * typ->BaseTyp->size; } else if (f == 11) { - typ->size = OPM_PointerSize; + typ->size = OPM_AddressSize; if (typ->BaseTyp == OPT_undftyp) { OPM_Mark(128, typ->n); } else { OPV_TypSize(typ->BaseTyp); } } else if (f == 12) { - typ->size = OPM_ProcSize; + typ->size = OPM_AddressSize; } else if (c == 3) { btyp = typ->BaseTyp; OPV_TypSize(btyp); @@ -273,6 +273,7 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_int16typ->strobj->linkadr = 2; OPT_int32typ->strobj->linkadr = 2; OPT_int64typ->strobj->linkadr = 2; + OPT_hinttyp->strobj->linkadr = 2; OPT_lrltyp->strobj->linkadr = 2; OPT_booltyp->strobj->linkadr = 2; OPT_bytetyp->strobj->linkadr = 2; @@ -790,7 +791,7 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) } else if (comp == 3) { if (n->class == 7) { OPM_WriteString((CHAR*)", ", 3); - OPV_ParIntLiteral(n->conval->intval2, OPM_PointerSize); + OPV_ParIntLiteral(n->conval->intval2, OPM_AddressSize); } else { aptyp = n->typ; dim = 0; @@ -809,7 +810,7 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) dim += 1; aptyp = aptyp->BaseTyp; } - OPV_ParIntLiteral(aptyp->size, OPM_PointerSize); + OPV_ParIntLiteral(aptyp->size, OPM_AddressSize); } } } @@ -1314,7 +1315,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) OPM_WriteString((CHAR*)", ", 3); if (typ->comp == 3) { if (x->class == 7) { - OPC_IntLiteral(x->conval->intval, OPM_PointerSize); + OPC_IntLiteral(x->conval->intval, OPM_AddressSize); } else { OPM_WriteString((CHAR*)"((address)(", 12); OPV_expr(x, 10); @@ -1322,7 +1323,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) } x = x->link; } else { - OPC_IntLiteral(typ->n, OPM_PointerSize); + OPC_IntLiteral(typ->n, OPM_AddressSize); } typ = typ->BaseTyp; } diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index 33c1eeeb..f78267d0 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index a576c90e..0093f826 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index 7832ec0f..7faaa2a6 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index e81db820..e9e84723 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index dec142cf..116d9c93 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index 6aa3846a..8dc35935 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index d1c9f056..0487b70c 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index 37fac00b..54254c51 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index 0f195ce8..40d02918 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/Vishap.c b/bootstrap/windows-88/Vishap.c index 00f0ac1a..7cd188f2 100644 --- a/bootstrap/windows-88/Vishap.c +++ b/bootstrap/windows-88/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkamSf */ #define INTEGER int32 #define LONGINT int64 @@ -79,22 +79,12 @@ void Vishap_Module (BOOLEAN *done) static void Vishap_PropagateElementaryTypeSizes (void) { - OPT_bytetyp->size = OPM_ByteSize; - OPT_sysptrtyp->size = OPM_PointerSize; - OPT_chartyp->size = OPM_CharSize; + OPT_sysptrtyp->size = OPM_AddressSize; + OPT_adrtyp->size = OPM_AddressSize; OPT_settyp->size = OPM_SetSize; - OPT_realtyp->size = OPM_RealSize; - OPT_adrtyp->size = OPM_PointerSize; - OPT_lrltyp->size = OPM_LRealSize; - OPT_booltyp->size = OPM_BoolSize; - OPT_sinttyp = OPT_int8typ; - if (OPM_IntSize == 2) { - OPT_inttyp = OPT_int16typ; - OPT_linttyp = OPT_int32typ; - } else { - OPT_inttyp = OPT_int32typ; - OPT_linttyp = OPT_int64typ; - } + OPT_sinttyp = OPT_IntType(OPM_ShortintSize); + OPT_inttyp = OPT_IntType(OPM_IntegerSize); + OPT_linttyp = OPT_IntType(OPM_LongintSize); OPT_sintobj->typ = OPT_sinttyp; OPT_intobj->typ = OPT_inttyp; OPT_lintobj->typ = OPT_linttyp; diff --git a/bootstrap/windows-88/errors.c b/bootstrap/windows-88/errors.c index 8396896b..04b9504d 100644 --- a/bootstrap/windows-88/errors.c +++ b/bootstrap/windows-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/errors.h b/bootstrap/windows-88/errors.h index b3535e92..99f4c6b0 100644 --- a/bootstrap/windows-88/errors.h +++ b/bootstrap/windows-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index a4fbedda..2eef1f18 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index 414a05f0..d4f0c474 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/vt100.c b/bootstrap/windows-88/vt100.c index 04503b55..3b56b4b1 100644 --- a/bootstrap/windows-88/vt100.c +++ b/bootstrap/windows-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/vt100.h b/bootstrap/windows-88/vt100.h index c27f0ae1..b574976e 100644 --- a/bootstrap/windows-88/vt100.h +++ b/bootstrap/windows-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/src/compiler/OPB.Mod b/src/compiler/OPB.Mod index 0d840821..6fc81fe1 100644 --- a/src/compiler/OPB.Mod +++ b/src/compiler/OPB.Mod @@ -1053,7 +1053,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) OPT.movefn: (*SYSTEM.GET, SYSTEM.PUT, SYSTEM.BIT, SYSTEM.MOVE*) IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) ELSIF (x^.class = OPT.Nconst) & (f = OPT.Int) & (x.typ.size < OPT.linttyp.size) THEN Convert(x, OPT.linttyp) - ELSIF ~((x.typ.form IN {OPT.Pointer, OPT.Int}) & (x.typ.size = OPM.PointerSize)) THEN err(111); x^.typ := OPT.linttyp + ELSIF ~((x.typ.form IN {OPT.Pointer, OPT.Int}) & (x.typ.size = OPM.AddressSize)) THEN err(111); x^.typ := OPT.linttyp END |OPT.getrfn, OPT.putrfn: (*SYSTEM.GETREG, SYSTEM.PUTREG*) @@ -1230,7 +1230,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) |OPT.movefn: (*SYSTEM.MOVE*) IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) ELSIF (x^.class = OPT.Nconst) & (f = OPT.Int) & (x.typ.size < OPT.linttyp.size) THEN Convert(x, OPT.linttyp) - ELSIF ~((x.typ.form IN {OPT.Pointer, OPT.Int}) & (x.typ.size = OPM.PointerSize)) THEN err(111); x^.typ := OPT.linttyp + ELSIF ~((x.typ.form IN {OPT.Pointer, OPT.Int}) & (x.typ.size = OPM.AddressSize)) THEN err(111); x^.typ := OPT.linttyp END; p^.link := x |OPT.assertfn: (*ASSERT*) diff --git a/src/compiler/OPC.Mod b/src/compiler/OPC.Mod index 9febea62..bc84b8ad 100644 --- a/src/compiler/OPC.Mod +++ b/src/compiler/OPC.Mod @@ -552,7 +552,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) IF typ^.strobj # NIL THEN OPM.WriteStringVar(typ^.strobj^.name) END ; OPM.Write(DoubleQuote); Str1(', #), {', typ^.size); - nofptrs := 0; PutPtrOffsets(typ, 0, nofptrs); Str1("#}}", -(nofptrs + 1) * OPM.PointerSize); + nofptrs := 0; PutPtrOffsets(typ, 0, nofptrs); Str1("#}}", -(nofptrs + 1) * OPM.AddressSize); EndStat END TDescDecl; @@ -1303,7 +1303,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) IF dim # 0 THEN OPM.WriteInt(dim) END ELSE (* array *) WHILE dim > 0 DO array := array^.BaseTyp; DEC(dim) END; - IF ansi THEN OPM.WriteInt(array.n) ELSE IntLiteral(array.n, OPM.PointerSize) END + IF ansi THEN OPM.WriteInt(array.n) ELSE IntLiteral(array.n, OPM.AddressSize) END END END Len; diff --git a/src/compiler/OPM.cmdln.Mod b/src/compiler/OPM.cmdln.Mod index b70b8474..952ea9e5 100644 --- a/src/compiler/OPM.cmdln.Mod +++ b/src/compiler/OPM.cmdln.Mod @@ -88,10 +88,11 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) VAR SourceFileName : ARRAY 256 OF CHAR; - Alignment*: INTEGER; + (* Parameter selectable sizes *) + Alignment*, + AddressSize*, SetSize*, + ShortintSize*, IntegerSize*, LongintSize*: INTEGER; - ByteSize*, CharSize*, BoolSize*, SIntSize*, IntSize*, - LIntSize*, SetSize*, RealSize*, LRealSize*, PointerSize*, ProcSize*, RecSize*, MaxSet*: INTEGER; MaxIndex*: SYSTEM.INT64; @@ -161,13 +162,21 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) | "t": opt := opt / {typchk} | "x": opt := opt / {inxchk} - | "B": IF s[i+1] # 0X THEN INC(i); IntSize := ORD(s[i]) - ORD('0') END; - IF s[i+1] # 0X THEN INC(i); PointerSize := ORD(s[i]) - ORD('0') END; + | "B": IF s[i+1] # 0X THEN INC(i); IntegerSize := ORD(s[i]) - ORD('0') END; + IF s[i+1] # 0X THEN INC(i); AddressSize := ORD(s[i]) - ORD('0') END; IF s[i+1] # 0X THEN INC(i); Alignment := ORD(s[i]) - ORD('0') END; - ASSERT((IntSize = 2) OR (IntSize = 4)); - ASSERT((PointerSize = 4) OR (PointerSize = 8)); + ASSERT((IntegerSize = 2) OR (IntegerSize = 4)); + ASSERT((AddressSize = 4) OR (AddressSize = 8)); ASSERT((Alignment = 4) OR (Alignment = 8)); + IF IntegerSize = 2 THEN + LongintSize := 4; + SetSize := 4; + ELSE + LongintSize := 8; + SetSize := 8; + END; Files.SetSearchPath("") + | "F": opt := opt / {forcenewsym} | "M": opt := opt / {mainlinkstat} | "S": opt := opt / {dontasm} @@ -529,20 +538,24 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) PROCEDURE VerboseListSizes; BEGIN LogWLn; - LogWStr("Type Size Alignement"); LogWLn; + (*LogWStr("Type Size Alignement"); LogWLn;*) + LogWStr("Type Size"); LogWLn; + (* LogWStr("CHAR "); LogWNum(CharSize, 4); (* LogWNum(CharAlign, 5); *) LogWLn; LogWStr("BOOLEAN "); LogWNum(BoolSize, 4); (* LogWNum(BoolAlign, 5); *) LogWLn; - LogWStr("SHORTINT "); LogWNum(SIntSize, 4); (* LogWNum(SIntAlign, 5); *) LogWLn; - LogWStr("INTEGER "); LogWNum(IntSize, 4); (* LogWNum(IntAlign, 5); *) LogWLn; - LogWStr("LONGINT "); LogWNum(LIntSize, 4); (* LogWNum(LIntAlign, 5); *) LogWLn; - LogWStr("SET "); LogWNum(SetSize, 4); (* LogWNum(SetAlign, 5); *) LogWLn; LogWStr("REAL "); LogWNum(RealSize, 4); (* LogWNum(RealAlign, 5); *) LogWLn; LogWStr("LONGREAL "); LogWNum(LRealSize, 4); (* LogWNum(LRealAlign, 5); *) LogWLn; - LogWStr("PTR "); LogWNum(PointerSize, 4); (* LogWNum(PointerAlign, 5); *) LogWLn; - LogWStr("PROC "); LogWNum(ProcSize, 4); (* LogWNum(ProcAlign, 5); *) LogWLn; LogWStr("RECORD "); LogWNum(RecSize, 4); (* LogWNum(RecAlign, 5); *) LogWLn; - (*LogWStr("ENDIAN "); LogWNum(ByteOrder, 4); LogWNum(BitOrder, 5); LogWLn;*) + LogWStr("PROC "); LogWNum(ProcSize, 4); (* LogWNum(ProcAlign, 5); *) LogWLn; + LogWStr("ENDIAN "); LogWNum(ByteOrder, 4); LogWNum(BitOrder, 5); LogWLn; + *) + LogWStr("SHORTINT "); LogWNum(ShortintSize, 4); (* LogWNum(SIntAlign, 5); *) LogWLn; + LogWStr("INTEGER "); LogWNum(IntegerSize, 4); (* LogWNum(IntAlign, 5); *) LogWLn; + LogWStr("LONGINT "); LogWNum(LongintSize, 4); (* LogWNum(LIntAlign, 5); *) LogWLn; + LogWStr("SET "); LogWNum(SetSize, 4); (* LogWNum(SetAlign, 5); *) LogWLn; + LogWStr("ADDRESS "); LogWNum(AddressSize, 4); (* LogWNum(PointerAlign, 5); *) LogWLn; LogWLn; + LogWStr("Alignment: "); LogWNum(Alignment, 4); LogWLn; (* LogWStr("Min shortint "); LogWNum(MinSInt, 4); LogWLn; LogWStr("Max shortint "); LogWNum(MaxSInt, 4); LogWLn; @@ -582,25 +595,14 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) the module startup code, and maybe overridden by the -Bnnn bootstrap parameter *) - (* Derived sizes *) - ProcSize := PointerSize; - LIntSize := IntSize * 2; - SetSize := LIntSize; - - IF RealSize = 4 THEN MaxReal := 3.40282346D38 - ELSIF RealSize = 8 THEN MaxReal := 1.7976931348623157D307 * 9.999999 + MaxReal := 3.40282346D38; (* REAL is 4 bytes *) + MaxLReal := 1.7976931348623157D307 * 9.999999; (* LONGREAL is 8 bytes *) (*should be 1.7976931348623157D308 *) - END ; - - IF LRealSize = 4 THEN MaxLReal := 3.40282346D38 - ELSIF LRealSize = 8 THEN MaxLReal := 1.7976931348623157D307 * 9.999999 - (*should be 1.7976931348623157D308 *) - END ; MinReal := -MaxReal; MinLReal := -MaxLReal; MaxSet := SetSize * 8 - 1; - MaxIndex := SignedMaximum(PointerSize); + MaxIndex := SignedMaximum(AddressSize); IF Verbose THEN VerboseListSizes END; END GetProperties; @@ -734,9 +736,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) PROCEDURE WriteInt* (i: SYSTEM.INT64); VAR s: ARRAY 24 OF CHAR; i1, k: SYSTEM.INT64; BEGIN - IF (i = SignedMinimum(IntSize)) - OR (i = SignedMinimum(LIntSize)) - OR (i = SignedMinimum(8)) THEN + IF (i = SignedMinimum(2)) OR (i = SignedMinimum(4)) OR (i = SignedMinimum(8)) THEN (* abs(minint) is one more than maxint, causing problems representing the value as a minus sign followed by absoute value. Therefore represent as -maxint - 1. For INTEGER this avoids a compiler warning 'this decimal constant is unsigned only in ISO C90', for LONGINT it is the @@ -754,7 +754,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) VAR W: Texts.Writer; T: Texts.Text; R: Texts.Reader; s: ARRAY 32 OF CHAR; ch: CHAR; i: INTEGER; BEGIN (*should be improved *) - IF (r < SignedMaximum(LIntSize)) & (r > SignedMinimum(LIntSize)) & (r = ENTIER(r)) THEN + IF (r < SignedMaximum(LongintSize)) & (r > SignedMinimum(LongintSize)) & (r = ENTIER(r)) THEN IF suffx = "f" THEN WriteString("(REAL)") ELSE WriteString("(LONGREAL)") END ; WriteInt(ENTIER(r)) ELSE @@ -839,13 +839,19 @@ BEGIN Files.SetSearchPath(OBERON); - (* Fixed type sizes *) - CharSize := 1; BoolSize := 1; SIntSize := 1; RecSize := 1; ByteSize := 1; - RealSize := 4; LRealSize := 8; - (* type sizes with configuration based defaults *) - PointerSize := Configuration.addressSize; - Alignment := Configuration.alignment; - IntSize := Configuration.intsize; + AddressSize := Configuration.addressSize; + Alignment := Configuration.alignment; + ShortintSize := 1; + + IF Configuration.intsize = 2 THEN + IntegerSize := 2; + LongintSize := 4; + SetSize := 4; + ELSE + IntegerSize := 4; + LongintSize := 8; + SetSize := 8; + END; END OPM. diff --git a/src/compiler/OPT.Mod b/src/compiler/OPT.Mod index 7d67c2b5..6793a233 100644 --- a/src/compiler/OPT.Mod +++ b/src/compiler/OPT.Mod @@ -154,7 +154,7 @@ VAR undftyp*, bytetyp*, booltyp*, chartyp*, - sinttyp*, inttyp*, linttyp*, + sinttyp*, inttyp*, linttyp*, hinttyp*, adrtyp*, int8typ*, int16typ*, int32typ*, int64typ*, realtyp*, lrltyp*, settyp*, stringtyp*, @@ -762,7 +762,7 @@ BEGIN tag := OPM.SymRInt(); IF tag = Ssys THEN typ^.sysflag := SHORT(OPM.SymRInt()); tag := OPM.SymRInt() END; CASE tag OF - | Sptr: typ^.form := Pointer; typ^.size := OPM.PointerSize; + | Sptr: typ^.form := Pointer; typ^.size := OPM.AddressSize; typ^.n := 0; InStruct(typ^.BaseTyp) | Sarr: typ^.form := Comp; typ^.comp := Array; InStruct(typ^.BaseTyp); typ^.n := OPM.SymRInt(); @@ -796,7 +796,7 @@ BEGIN InsertImport(fld, typ^.link, dummy); impCtxt.nextTag := OPM.SymRInt() END - | Spro: typ^.form := ProcTyp; typ^.size := OPM.ProcSize; + | Spro: typ^.form := ProcTyp; typ^.size := OPM.AddressSize; InSign(mno, typ^.BaseTyp, typ^.link) ELSE OPM.LogWStr("unhandled case at InStruct, tag = "); OPM.LogWNum(tag, 0); OPM.LogWLn; END; @@ -1163,7 +1163,7 @@ END Import; PROCEDURE InitStruct(VAR typ: Struct; form: SHORTINT); BEGIN - typ := NewStr(form, Basic); typ^.ref := form; typ^.size := OPM.ByteSize; typ^.allocated := TRUE; + typ := NewStr(form, Basic); typ^.ref := form; typ^.size := 1; typ^.allocated := TRUE; typ^.strobj := NewObj(); typ^.pbfp := form; typ^.pvfp := form; typ^.fpdone := TRUE; typ^.idfp := form; typ^.idfpdone := TRUE END InitStruct; @@ -1207,36 +1207,37 @@ BEGIN topScope := NIL; OpenScope(0, NIL); OPM.errpos := 0; InitStruct(niltyp, NilTyp); (*initialization of module SYSTEM*) - EnterTyp("BYTE", Byte, OPM.ByteSize, bytetyp); - EnterTyp("PTR", Pointer, OPM.PointerSize, sysptrtyp); - EnterTyp("ADDRESS", Int, OPM.PointerSize, adrtyp); - EnterTyp("INT8", Int, 1, int8typ); - EnterTyp("INT16", Int, 2, int16typ); - EnterTyp("INT32", Int, 4, int32typ); - EnterTyp("INT64", Int, 8, int64typ); + EnterTyp("BYTE", Byte, 1, bytetyp); + EnterTyp("PTR", Pointer, -1, sysptrtyp); (* Size set in Vishap.PropagateElementaryTypeSize *) + EnterTyp("ADDRESS", Int, -1, adrtyp); (* Size set in Vishap.PropagateElementaryTypeSize *) + EnterTyp("INT8", Int, 1, int8typ); + EnterTyp("INT16", Int, 2, int16typ); + EnterTyp("INT32", Int, 4, int32typ); + EnterTyp("INT64", Int, 8, int64typ); - EnterProc("ADR", adrfn); - EnterProc("CC", ccfn); - EnterProc("LSH", lshfn); - EnterProc("ROT", rotfn); - EnterProc("GET", getfn); - EnterProc("PUT", putfn); + EnterProc("ADR", adrfn); + EnterProc("CC", ccfn); + EnterProc("LSH", lshfn); + EnterProc("ROT", rotfn); + EnterProc("GET", getfn); + EnterProc("PUT", putfn); EnterProc("GETREG", getrfn); EnterProc("PUTREG", putrfn); - EnterProc("BIT", bitfn); - EnterProc("VAL", valfn); - EnterProc("NEW", sysnewfn); - EnterProc("MOVE", movefn); + EnterProc("BIT", bitfn); + EnterProc("VAL", valfn); + EnterProc("NEW", sysnewfn); + EnterProc("MOVE", movefn); syslink := topScope^.right; universe := topScope; topScope^.right := NIL; - EnterTyp("BOOLEAN", Bool, OPM.BoolSize, booltyp); - EnterTyp("CHAR", Char, OPM.CharSize, chartyp); - EnterTyp("SET", Set, OPM.SetSize, settyp); - EnterTyp("REAL", Real, OPM.RealSize, realtyp); - EnterTyp("LONGREAL", LReal, OPM.LRealSize, lrltyp); + EnterTyp("BOOLEAN", Bool, 1, booltyp); + EnterTyp("CHAR", Char, 1, chartyp); + EnterTyp("SET", Set, -1, settyp); (* Size set in Vishap.PropagateElementaryTypeSize *) + EnterTyp("REAL", Real, 4, realtyp); + EnterTyp("LONGREAL", LReal, 8, lrltyp); + EnterTyp("HUGEINT", Int, 8, hinttyp); EnterTypeAlias("SHORTINT", sintobj); EnterTypeAlias("INTEGER", intobj); diff --git a/src/compiler/OPV.Mod b/src/compiler/OPV.Mod index d8486ca9..7c7e7464 100644 --- a/src/compiler/OPV.Mod +++ b/src/compiler/OPV.Mod @@ -62,7 +62,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 ELSIF typ^.size = -1 THEN f := typ^.form; c := typ^.comp; IF c = OPT.Record THEN btyp := typ^.BaseTyp; - IF btyp = NIL THEN offset := 0; base := (*OPM.RecAlign*)OPC.SizeAlignment(OPM.RecSize); + IF btyp = NIL THEN offset := 0; base := 1; ELSE TypSize(btyp); offset := btyp^.size - btyp^.sysflag DIV 100H; base := btyp^.align; END; fld := typ^.link; @@ -86,12 +86,12 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 TypSize(typ^.BaseTyp); typ^.size := typ^.n * typ^.BaseTyp^.size; ELSIF f = OPT.Pointer THEN - typ^.size := OPM.PointerSize; + typ^.size := OPM.AddressSize; IF typ^.BaseTyp = OPT.undftyp THEN OPM.Mark(128, typ^.n) ELSE TypSize(typ^.BaseTyp) END ELSIF f = OPT.ProcTyp THEN - typ^.size := OPM.ProcSize; + typ^.size := OPM.AddressSize; ELSIF c = OPT.DynArr THEN btyp := typ^.BaseTyp; TypSize(btyp); IF btyp^.comp = OPT.DynArr THEN typ^.size := btyp^.size + 4 (* describes dim not size *) @@ -187,21 +187,17 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 topScope^.leaf := TRUE; Traverse(topScope^.right, topScope, TRUE); (* first pass only on exported types and procedures *) Traverse(topScope^.right, topScope, FALSE); (* second pass *) + (* mark basic types as predefined, OPC.Ident can avoid qualification*) OPT.chartyp^.strobj^.linkadr := PredefinedType; OPT.settyp^.strobj^.linkadr := PredefinedType; OPT.realtyp^.strobj^.linkadr := PredefinedType; - - (* SHORTINT, INTEGER and LONGINT are alternate names for INT8, INT16, INT32 and INT64 and have not been set up yet. - OPT.sinttyp^.strobj^.linkadr := PredefinedType; - OPT.inttyp^.strobj^.linkadr := PredefinedType; - OPT.linttyp^.strobj^.linkadr := PredefinedType; - *) OPT.adrtyp^.strobj^.linkadr := PredefinedType; OPT.int8typ^.strobj^.linkadr := PredefinedType; OPT.int16typ^.strobj^.linkadr := PredefinedType; OPT.int32typ^.strobj^.linkadr := PredefinedType; OPT.int64typ^.strobj^.linkadr := PredefinedType; + OPT.hinttyp.strobj.linkadr := PredefinedType; OPT.lrltyp^.strobj^.linkadr := PredefinedType; OPT.booltyp^.strobj^.linkadr := PredefinedType; OPT.bytetyp^.strobj^.linkadr := PredefinedType; @@ -482,7 +478,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 OPM.WriteString(", "); TypeOf(n) ELSIF comp = OPT.DynArr THEN IF n^.class = OPT.Nconst THEN (* ap is string constant *) - OPM.WriteString(Comma); ParIntLiteral(n.conval.intval2, OPM.PointerSize) + OPM.WriteString(Comma); ParIntLiteral(n.conval.intval2, OPM.AddressSize) ELSE aptyp := n^.typ; dim := 0; WHILE (typ^.comp = OPT.DynArr) & (typ^.BaseTyp^.form # OPT.Byte) DO @@ -495,7 +491,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 Len(n, dim); OPM.WriteString(" * "); INC(dim); aptyp := aptyp^.BaseTyp END ; (*OPM.WriteString("((LONGINT)("); OPM.WriteInt(aptyp^.size); OPM.WriteString("))");*) - ParIntLiteral(aptyp.size, OPM.PointerSize) + ParIntLiteral(aptyp.size, OPM.AddressSize) END END END ; @@ -791,12 +787,12 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 OPM.WriteString(", "); IF typ^.comp = OPT.DynArr THEN IF x^.class = OPT.Nconst THEN - OPC.IntLiteral(x.conval.intval, OPM.PointerSize) + OPC.IntLiteral(x.conval.intval, OPM.AddressSize) ELSE OPM.WriteString("((address)("); expr(x, 10); OPM.WriteString("))") END ; x := x^.link ELSE - OPC.IntLiteral(typ.n, OPM.PointerSize) + OPC.IntLiteral(typ.n, OPM.AddressSize) END ; typ := typ^.BaseTyp END ; diff --git a/src/compiler/Vishap.Mod b/src/compiler/Vishap.Mod index 33481260..c4b06e9c 100644 --- a/src/compiler/Vishap.Mod +++ b/src/compiler/Vishap.Mod @@ -51,23 +51,14 @@ MODULE Vishap; (* J. Templ 3.2.95 *) PROCEDURE PropagateElementaryTypeSizes; BEGIN - OPT.bytetyp.size := OPM.ByteSize; - OPT.sysptrtyp.size := OPM.PointerSize; - OPT.chartyp.size := OPM.CharSize; + OPT.sysptrtyp.size := OPM.AddressSize; + OPT.adrtyp.size := OPM.AddressSize; OPT.settyp.size := OPM.SetSize; - OPT.realtyp.size := OPM.RealSize; - OPT.adrtyp.size := OPM.PointerSize; - OPT.lrltyp.size := OPM.LRealSize; - OPT.booltyp.size := OPM.BoolSize; - OPT.sinttyp := OPT.int8typ; - IF OPM.IntSize = 2 THEN - OPT.inttyp := OPT.int16typ; - OPT.linttyp := OPT.int32typ - ELSE - OPT.inttyp := OPT.int32typ; - OPT.linttyp := OPT.int64typ - END; + OPT.sinttyp := OPT.IntType(OPM.ShortintSize); + OPT.inttyp := OPT.IntType(OPM.IntegerSize); + OPT.linttyp := OPT.IntType(OPM.LongintSize); + OPT.sintobj.typ := OPT.sinttyp; OPT.intobj.typ := OPT.inttyp; OPT.lintobj.typ := OPT.linttyp From 76b6a8fc2328d000fe32f99dea380287ec956250 Mon Sep 17 00:00:00 2001 From: David Brown Date: Wed, 21 Sep 2016 18:28:17 +0100 Subject: [PATCH 241/580] Clean option handling and add size model and target machine options. --- bootstrap/unix-44/Configuration.c | 2 +- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Console.c | 2 +- bootstrap/unix-44/Console.h | 2 +- bootstrap/unix-44/Files.c | 2 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 2 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 6 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 113 ++++----------- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 197 ++++++++++++++++++--------- bootstrap/unix-44/OPM.h | 3 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 7 +- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 34 ++--- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/Vishap.c | 20 +-- bootstrap/unix-44/errors.c | 2 +- bootstrap/unix-44/errors.h | 2 +- bootstrap/unix-44/extTools.c | 4 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-44/vt100.c | 2 +- bootstrap/unix-44/vt100.h | 2 +- bootstrap/unix-48/Configuration.c | 2 +- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Console.c | 2 +- bootstrap/unix-48/Console.h | 2 +- bootstrap/unix-48/Files.c | 2 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 2 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 6 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 113 ++++----------- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 197 ++++++++++++++++++--------- bootstrap/unix-48/OPM.h | 3 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 7 +- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 34 ++--- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/Vishap.c | 20 +-- bootstrap/unix-48/errors.c | 2 +- bootstrap/unix-48/errors.h | 2 +- bootstrap/unix-48/extTools.c | 4 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-48/vt100.c | 2 +- bootstrap/unix-48/vt100.h | 2 +- bootstrap/unix-88/Configuration.c | 2 +- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Console.c | 2 +- bootstrap/unix-88/Console.h | 2 +- bootstrap/unix-88/Files.c | 2 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 2 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 6 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 113 ++++----------- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 197 ++++++++++++++++++--------- bootstrap/unix-88/OPM.h | 3 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 7 +- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 34 ++--- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/Vishap.c | 20 +-- bootstrap/unix-88/errors.c | 2 +- bootstrap/unix-88/errors.h | 2 +- bootstrap/unix-88/extTools.c | 4 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/unix-88/vt100.c | 2 +- bootstrap/unix-88/vt100.h | 2 +- bootstrap/windows-48/Configuration.c | 2 +- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Console.c | 2 +- bootstrap/windows-48/Console.h | 2 +- bootstrap/windows-48/Files.c | 2 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 2 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 6 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 113 ++++----------- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 197 ++++++++++++++++++--------- bootstrap/windows-48/OPM.h | 3 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 7 +- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 34 ++--- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/Vishap.c | 20 +-- bootstrap/windows-48/errors.c | 2 +- bootstrap/windows-48/errors.h | 2 +- bootstrap/windows-48/extTools.c | 4 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-48/vt100.c | 2 +- bootstrap/windows-48/vt100.h | 2 +- bootstrap/windows-88/Configuration.c | 2 +- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Console.c | 2 +- bootstrap/windows-88/Console.h | 2 +- bootstrap/windows-88/Files.c | 2 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 2 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 6 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 113 ++++----------- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 197 ++++++++++++++++++--------- bootstrap/windows-88/OPM.h | 3 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 7 +- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 34 ++--- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Platform.c | 2 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/Vishap.c | 20 +-- bootstrap/windows-88/errors.c | 2 +- bootstrap/windows-88/errors.h | 2 +- bootstrap/windows-88/extTools.c | 4 +- bootstrap/windows-88/extTools.h | 2 +- bootstrap/windows-88/vt100.c | 2 +- bootstrap/windows-88/vt100.h | 2 +- src/compiler/OPB.Mod | 4 +- src/compiler/OPC.Mod | 76 +++-------- src/compiler/OPM.cmdln.Mod | 125 +++++++++++------ src/compiler/OPT.Mod | 6 +- src/compiler/OPV.Mod | 28 ++-- src/compiler/Vishap.Mod | 18 +-- src/compiler/extTools.Mod | 4 +- 202 files changed, 1178 insertions(+), 1313 deletions(-) diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index 6db18d8a..c780cc96 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index 831281d6..7fdf5f78 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Console.c b/bootstrap/unix-44/Console.c index dea5d7a8..eaa862b2 100644 --- a/bootstrap/unix-44/Console.c +++ b/bootstrap/unix-44/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Console.h b/bootstrap/unix-44/Console.h index b18bf88a..c8de3606 100644 --- a/bootstrap/unix-44/Console.h +++ b/bootstrap/unix-44/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 3a826a34..6e15e6b7 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index 17077aa8..960fca06 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index 63b8e488..50823221 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tsSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index d150f1cf..57904466 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index a74b13a3..1c66c8e5 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index d570a488..13b6dbed 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index a4070347..c9ebd8f5 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -1542,7 +1542,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPT_Struct y = NIL; int16 f, g; OPT_Struct p = NIL, q = NIL; - if (OPM_Verbose) { + if (__IN(18, OPM_opt, 32)) { OPM_LogWLn(); OPM_LogWStr((CHAR*)"PROCEDURE CheckAssign", 22); OPM_LogWLn(); @@ -1550,7 +1550,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) y = ynode->typ; f = x->form; g = y->form; - if (OPM_Verbose) { + if (__IN(18, OPM_opt, 32)) { OPM_LogWStr((CHAR*)"y.form = ", 10); OPM_LogWNum(y->form, 0); OPM_LogWLn(); diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index a39fd352..cdd33f1b 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index f3b40759..6b7d1b01 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -11,7 +11,6 @@ static int16 OPC_indentLevel; -static BOOLEAN OPC_ptrinit, OPC_mainprog, OPC_ansi; static int8 OPC_hashtab[105]; static CHAR OPC_keytab[50][9]; static BOOLEAN OPC_GlbPtrs; @@ -93,14 +92,7 @@ static BOOLEAN OPC_Undefined (OPT_Object obj); void OPC_Init (void) { OPC_indentLevel = 0; - OPC_ptrinit = __IN(5, OPM_opt, 32); - OPC_mainprog = OPM_mainProg || OPM_mainLinkStat; - OPC_ansi = __IN(6, OPM_opt, 32); - if (OPC_ansi) { - __MOVE("__init(void)", OPC_BodyNameExt, 13); - } else { - __MOVE("__init()", OPC_BodyNameExt, 9); - } + __MOVE("__init(void)", OPC_BodyNameExt, 13); } void OPC_Indent (int16 count) @@ -299,12 +291,8 @@ static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef) openClause = 0; } if (form == 12) { - if (OPC_ansi) { - OPM_Write(')'); - OPC_AnsiParamList(typ->link, 0); - } else { - OPM_WriteString((CHAR*)")()", 4); - } + OPM_Write(')'); + OPC_AnsiParamList(typ->link, 0); break; } else if (comp == 2) { OPM_Write('['); @@ -579,12 +567,10 @@ static void OPC_DefineTProcTypes (OPT_Object obj) if (obj->typ != OPT_notyp) { OPC_DefineType(obj->typ); } - if (OPC_ansi) { - par = obj->link; - while (par != NIL) { - OPC_DefineType(par->typ); - par = par->link; - } + par = obj->link; + while (par != NIL) { + OPC_DefineType(par->typ); + par = par->link; } } @@ -662,11 +648,7 @@ static void OPC_DefineTProcMacros (OPT_Object obj, BOOLEAN *empty) OPC_Ident(obj->typ->strobj); } OPM_WriteString((CHAR*)"(*)", 4); - if (OPC_ansi) { - OPC_AnsiParamList(obj->link, 0); - } else { - OPM_WriteString((CHAR*)"()", 3); - } + OPC_AnsiParamList(obj->link, 0); OPM_WriteString((CHAR*)", ", 3); OPC_DeclareParams(obj->link, 1); OPM_Write(')'); @@ -1063,7 +1045,7 @@ static void OPC_IdentList (OPT_Object obj, int16 vis) OPC_Ident(obj); OPM_WriteString((CHAR*)"__typ", 6); base = NIL; - } else if ((((((OPC_ptrinit && vis == 0)) && obj->mnolev > 0)) && obj->typ->form == 11)) { + } else if ((((((__IN(5, OPM_opt, 32) && vis == 0)) && obj->mnolev > 0)) && obj->typ->form == 11)) { OPM_WriteString((CHAR*)" = NIL", 7); } } @@ -1122,22 +1104,11 @@ static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define) OPM_Write(' '); OPC_Ident(proc); OPM_Write(' '); - if (OPC_ansi) { - OPC_AnsiParamList(proc->link, 1); - if (!define) { - OPM_Write(';'); - } - OPM_WriteLn(); - } else if (define) { - OPC_DeclareParams(proc->link, 0); - OPM_WriteLn(); - OPC_Indent(1); - OPC_IdentList(proc->link, 2); - OPC_Indent(-1); - } else { - OPM_WriteString((CHAR*)"();", 4); - OPM_WriteLn(); + OPC_AnsiParamList(proc->link, 1); + if (!define) { + OPM_Write(';'); } + OPM_WriteLn(); } static void OPC_ProcPredefs (OPT_Object obj, int8 vis) @@ -1255,9 +1226,6 @@ static void OPC_GenHeaderMsg (void) case 5: OPM_Write('p'); break; - case 6: - OPM_Write('k'); - break; case 7: OPM_Write('a'); break; @@ -1391,15 +1359,7 @@ void OPC_GenEnumPtrs (OPT_Object var) if (OPC_NofPtrs(typ) > 0) { if (!OPC_GlbPtrs) { OPC_GlbPtrs = 1; - OPM_WriteString((CHAR*)"static ", 8); - if (OPC_ansi) { - OPM_WriteString((CHAR*)"void EnumPtrs(void (*P)(void*))", 32); - } else { - OPM_WriteString((CHAR*)"void EnumPtrs(P)", 17); - OPM_WriteLn(); - OPM_Write(0x09); - OPM_WriteString((CHAR*)"void (*P)();", 13); - } + OPM_WriteString((CHAR*)"static void EnumPtrs(void (*P)(void*))", 39); OPM_WriteLn(); OPC_BegBlk(); } @@ -1451,17 +1411,9 @@ void OPC_EnterBody (void) { OPM_WriteLn(); OPM_WriteString((CHAR*)"export ", 8); - if (OPC_mainprog) { - if (OPC_ansi) { - OPM_WriteString((CHAR*)"int main(int argc, char **argv)", 32); - OPM_WriteLn(); - } else { - OPM_WriteString((CHAR*)"main(argc, argv)", 17); - OPM_WriteLn(); - OPM_Write(0x09); - OPM_WriteString((CHAR*)"int argc; char **argv;", 23); - OPM_WriteLn(); - } + if (__IN(10, OPM_opt, 32)) { + OPM_WriteString((CHAR*)"int main(int argc, char **argv)", 32); + OPM_WriteLn(); } else { OPM_WriteString((CHAR*)"void *", 7); OPM_WriteString(OPM_modName, 32); @@ -1470,20 +1422,20 @@ void OPC_EnterBody (void) } OPC_BegBlk(); OPC_BegStat(); - if (OPC_mainprog) { + if (__IN(10, OPM_opt, 32)) { OPM_WriteString((CHAR*)"__INIT(argc, argv)", 19); } else { OPM_WriteString((CHAR*)"__DEFMOD", 9); } OPC_EndStat(); - if ((OPC_mainprog && 0)) { + if ((__IN(10, OPM_opt, 32) && 0)) { OPC_BegStat(); OPM_WriteString((CHAR*)"/*don`t do it!*/ printf(\"DEMO VERSION: DO NOT USE THIS PROGRAM FOR ANY COMMERCIAL PURPOSE\\n\")", 94); OPC_EndStat(); } OPC_InitImports(OPT_topScope->right); OPC_BegStat(); - if (OPC_mainprog) { + if (__IN(10, OPM_opt, 32)) { OPM_WriteString((CHAR*)"__REGMAIN(\"", 12); } else { OPM_WriteString((CHAR*)"__REGMOD(\"", 11); @@ -1503,7 +1455,7 @@ void OPC_EnterBody (void) void OPC_ExitBody (void) { OPC_BegStat(); - if (OPC_mainprog) { + if (__IN(10, OPM_opt, 32)) { OPM_WriteString((CHAR*)"__FINI;", 8); } else { OPM_WriteString((CHAR*)"__ENDMOD;", 10); @@ -1583,21 +1535,6 @@ void OPC_EnterProc (OPT_Object proc) } var = var->link; } - if (!OPC_ansi) { - var = proc->link; - while (var != NIL) { - if ((var->typ->form == 5 && var->mode == 1)) { - OPC_BegStat(); - OPC_Ident(var->typ->strobj); - OPM_Write(' '); - OPC_Ident(var); - OPM_WriteString((CHAR*)" = _", 5); - OPC_Ident(var); - OPC_EndStat(); - } - var = var->link; - } - } var = proc->link; while (var != NIL) { if ((((__IN(var->typ->comp, 0x0c, 32) && var->mode == 1)) && var->typ->sysflag == 0)) { @@ -1963,11 +1900,7 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim) array = array->BaseTyp; dim -= 1; } - if (OPC_ansi) { - OPM_WriteInt(array->n); - } else { - OPC_IntLiteral(array->n, OPM_AddressSize); - } + OPM_WriteInt(array->n); } } diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index 1ac87c2d..b398282e 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index e5b7fc83..0086ff0f 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -37,7 +37,6 @@ static Files_Rider OPM_oldSF, OPM_newSF; static Files_Rider OPM_R[3]; static Files_File OPM_oldSFile, OPM_newSFile, OPM_HFile, OPM_BFile, OPM_HIFile; static int16 OPM_S; -export BOOLEAN OPM_dontAsm, OPM_dontLink, OPM_mainProg, OPM_mainLinkStat, OPM_notColorOutput, OPM_forceNewSym, OPM_Verbose; static CHAR OPM_OBERON[1024]; static CHAR OPM_MODULES[1024]; @@ -138,42 +137,94 @@ int16 OPM_Integer (int64 n) static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) { int16 i; + __DUP(s, s__len, CHAR); i = 1; while (s[__X(i, s__len)] != 0x00) { switch (s[__X(i, s__len)]) { - case 'a': - *opt = *opt ^ 0x80; - break; - case 'c': - *opt = *opt ^ 0x4000; - break; - case 'e': - *opt = *opt ^ 0x0200; - break; - case 'f': - *opt = *opt ^ 0x010000; - break; - case 'k': - *opt = *opt ^ 0x40; - break; - case 'm': - *opt = *opt ^ 0x0400; - break; case 'p': *opt = *opt ^ 0x20; break; + case 'a': + *opt = *opt ^ 0x80; + break; case 'r': *opt = *opt ^ 0x04; break; - case 's': - *opt = *opt ^ 0x10; - break; case 't': *opt = *opt ^ 0x08; break; case 'x': *opt = *opt ^ 0x01; break; + case 'e': + *opt = *opt ^ 0x0200; + break; + case 's': + *opt = *opt ^ 0x10; + break; + case 'F': + *opt = *opt ^ 0x020000; + break; + case 'm': + *opt = *opt ^ 0x0400; + break; + case 'M': + *opt = *opt ^ 0x8000; + break; + case 'S': + *opt = *opt ^ 0x2000; + break; + case 'c': + *opt = *opt ^ 0x4000; + break; + case 'f': + *opt = *opt ^ 0x010000; + break; + case 'V': + *opt = *opt ^ 0x040000; + break; + case 'O': + if (i + 1 >= Strings_Length(s, s__len)) { + OPM_LogWStr((CHAR*)"-O option requires following size model character.", 51); + OPM_LogWLn(); + } else { + switch (s[__X(i + 1, s__len)]) { + case '2': + OPM_ShortintSize = 1; + OPM_IntegerSize = 2; + OPM_LongintSize = 4; + OPM_SetSize = 4; + break; + case 'V': + OPM_ShortintSize = 1; + OPM_IntegerSize = 4; + OPM_LongintSize = 8; + OPM_SetSize = 8; + break; + case 'C': + OPM_ShortintSize = 2; + OPM_IntegerSize = 4; + OPM_LongintSize = 8; + OPM_SetSize = 8; + break; + default: + OPM_LogWStr((CHAR*)"Unrecognised size model character following -O.", 48); + OPM_LogWLn(); + break; + } + i += 1; + } + break; + case 'A': + if (i + 2 >= Strings_Length(s, s__len)) { + OPM_LogWStr((CHAR*)"-M option requires two following digits.", 41); + OPM_LogWLn(); + } else { + OPM_AddressSize = (int16)s[__X(i + 1, s__len)] - 48; + OPM_Alignment = (int16)s[__X(i + 2, s__len)] - 48; + i += 2; + } + break; case 'B': if (s[__X(i + 1, s__len)] != 0x00) { i += 1; @@ -199,18 +250,6 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) } Files_SetSearchPath((CHAR*)"", 1); break; - case 'F': - *opt = *opt ^ 0x020000; - break; - case 'M': - *opt = *opt ^ 0x8000; - break; - case 'S': - *opt = *opt ^ 0x2000; - break; - case 'V': - *opt = *opt ^ 0x040000; - break; default: OPM_LogWStr((CHAR*)" warning: option ", 19); OPM_LogW('-'); @@ -221,6 +260,7 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) } i += 1; } + __DEL(s); } BOOLEAN OPM_OpenPar (void) @@ -247,33 +287,62 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWStr((CHAR*)"Where options = [\"-\" {option} ].", 33); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" m - generate code for main module", 36); + OPM_LogWStr((CHAR*)" Run time safety", 18); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" M - generate code for main module and link object statically", 63); + OPM_LogWStr((CHAR*)" -p Initialise pointers to NIL.", 37); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" s - generate new symbol file", 31); + OPM_LogWStr((CHAR*)" -a Halt on assertion failures.", 37); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" e - allow extending the module interface", 43); + OPM_LogWStr((CHAR*)" -r Halt on range check failures.", 39); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" r - check value ranges", 25); + OPM_LogWStr((CHAR*)" -t Halt on type guad failure.", 36); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" x - turn off array indices check", 35); + OPM_LogWStr((CHAR*)" -x Halt on index out of range.", 37); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" a - don't check ASSERTs at runtime, use this option in tested production code", 80); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" p - turn off automatic pointer initialization", 48); + OPM_LogWStr((CHAR*)" Symbol file management", 25); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" t - don't check type guards (use in rare cases such as low-level modules where every cycle counts)", 101); + OPM_LogWStr((CHAR*)" -e Allow extension of old symbol file.", 45); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" S - don't call external assembler/compiler, only generate C code", 67); + OPM_LogWStr((CHAR*)" -s Allow generation of new symbol file.", 46); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" c - don't call linker", 24); + OPM_LogWStr((CHAR*)" -F Force generation of new symbol file.", 46); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" f - don't use color output", 29); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" F - force writing new symbol file in current directory", 57); + OPM_LogWStr((CHAR*)" C compiler and linker control", 32); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" V - verbose output", 21); + OPM_LogWStr((CHAR*)" -m This module is main. Link dynamically.", 48); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -M This module is main. Link statically.", 47); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -S Don't call C compiler", 31); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -c Don't link.", 21); + OPM_LogWLn(); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" Miscellaneous", 16); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -f Disable vt100 control characters in status output.", 60); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -V Display compiler debugging messages.", 46); + OPM_LogWLn(); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" Size model for elementary types", 34); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -O2 Original Oberon / Oberon-2: 8 bit SHORTINT, 16 bit INTEGER, 32 bit LONGINT and SET.", 94); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -OC Component Pascal: 16 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET.", 94); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -OV Alternate large model: 8 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET.", 94); + OPM_LogWLn(); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" Target machine address size and alignment", 44); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -A44 32 bit addresses, 32 bit alignment (e.g. Unix/linux 32 bit on x86).", 79); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -A48 32 bit addresses, 64 bit alignment (e.g. Windows 32 bit on x86, linux 32 bit on arm).", 97); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -A88 66 bit addresses, 64 bit alignment (e.g. 64 bit platforms).", 71); OPM_LogWLn(); OPM_LogWLn(); OPM_LogWStr((CHAR*)"Initial options specify defaults for all files.", 48); @@ -288,9 +357,9 @@ BOOLEAN OPM_OpenPar (void) OPM_S = 1; s[0] = 0x00; Platform_GetArg(OPM_S, (void*)s, 256); - OPM_glbopt = 0xe9; + OPM_glbopt = 0xa9; while (s[0] == '-') { - OPM_ScanOptions((void*)s, 256, &OPM_glbopt); + OPM_ScanOptions(s, 256, &OPM_glbopt); OPM_S += 1; s[0] = 0x00; Platform_GetArg(OPM_S, (void*)s, 256); @@ -308,20 +377,14 @@ void OPM_InitOptions (void) s[0] = 0x00; Platform_GetArg(OPM_S, (void*)s, 256); while (s[0] == '-') { - OPM_ScanOptions((void*)s, 256, &OPM_opt); + OPM_ScanOptions(s, 256, &OPM_opt); OPM_S += 1; s[0] = 0x00; Platform_GetArg(OPM_S, (void*)s, 256); } - OPM_dontAsm = __IN(13, OPM_opt, 32); - OPM_dontLink = __IN(14, OPM_opt, 32); - OPM_mainProg = __IN(10, OPM_opt, 32); - OPM_mainLinkStat = __IN(15, OPM_opt, 32); - OPM_notColorOutput = __IN(16, OPM_opt, 32); - OPM_forceNewSym = __IN(17, OPM_opt, 32); - OPM_Verbose = __IN(18, OPM_opt, 32); - if (OPM_mainLinkStat) { + if (__IN(15, OPM_opt, 32)) { OPM_glbopt |= __SETOF(10,32); + OPM_opt |= __SETOF(10,32); } OPM_GetProperties(); } @@ -407,20 +470,20 @@ static void OPM_LogErrMsg (int16 n) int16 i; CHAR buf[1024]; if (n >= 0) { - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"31m", 4); } OPM_LogWStr((CHAR*)" err ", 7); - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } } else { - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"35m", 4); } OPM_LogWStr((CHAR*)" warning ", 11); n = -n; - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } } @@ -493,11 +556,11 @@ static void OPM_ShowLine (int64 pos) OPM_LogW(' '); i -= 1; } - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"32m", 4); } OPM_LogW('^'); - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } Files_Close(f); @@ -682,7 +745,7 @@ static void OPM_GetProperties (void) OPM_MinLReal = -OPM_MaxLReal; OPM_MaxSet = __ASHL(OPM_SetSize, 3) - 1; OPM_MaxIndex = OPM_SignedMaximum(OPM_AddressSize); - if (OPM_Verbose) { + if (__IN(18, OPM_opt, 32)) { OPM_VerboseListSizes(); } } diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index 1835a2b8..b32da345 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPM__h #define OPM__h @@ -15,7 +15,6 @@ import int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; import CHAR OPM_modName[32]; import CHAR OPM_objname[64]; import SET OPM_opt, OPM_glbopt; -import BOOLEAN OPM_dontAsm, OPM_dontLink, OPM_mainProg, OPM_mainLinkStat, OPM_notColorOutput, OPM_forceNewSym, OPM_Verbose; import void OPM_CloseFiles (void); diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index f62551cc..af0d37db 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index 9ae7712a..6dd03161 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index f04f47ad..f37bbc27 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index 3ff9b0b3..1b60944c 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index 693eb714..147fdc5c 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -1733,10 +1733,7 @@ void OPT_Export (BOOLEAN *ext, BOOLEAN *new) } OPT_OutObj(OPT_topScope->right); *ext = (OPT_sfpresent && OPT_symExtended); - *new = !OPT_sfpresent || OPT_symNew; - if (OPM_forceNewSym) { - *new = 1; - } + *new = (!OPT_sfpresent || OPT_symNew) || __IN(17, OPM_opt, 32); if ((((OPM_noerr && OPT_sfpresent)) && OPT_impCtxt.reffp != OPT_expCtxt.reffp)) { *new = 1; if (!OPT_extsf) { diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index 9ee5643f..d999d4ec 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index 2146d7c2..edb84f81 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -16,7 +16,6 @@ typedef } OPV_ExitInfo; -static BOOLEAN OPV_assert, OPV_inxchk, OPV_mainprog, OPV_ansi; static int16 OPV_stamp; static int32 OPV_recno; static OPV_ExitInfo OPV_exit; @@ -130,10 +129,6 @@ void OPV_Init (void) OPV_stamp = 0; OPV_recno = 0; OPV_nofExitLabels = 0; - OPV_assert = __IN(7, OPM_opt, 32); - OPV_inxchk = __IN(0, OPM_opt, 32); - OPV_mainprog = __IN(10, OPM_opt, 32); - OPV_ansi = __IN(6, OPM_opt, 32); } static void OPV_GetTProcNum (OPT_Object obj) @@ -532,7 +527,7 @@ static void OPV_TypeOf (OPT_Node n) static void OPV_Index (OPT_Node n, OPT_Node d, int16 prec, int16 dim) { - if (!OPV_inxchk || (n->right->class == 7 && (n->right->conval->intval == 0 || n->left->typ->comp != 3))) { + if (!__IN(0, OPM_opt, 32) || (n->right->class == 7 && (n->right->conval->intval == 0 || n->left->typ->comp != 3))) { OPV_expr(n->right, prec); } else { if (OPV_SideEffects(n->right)) { @@ -728,11 +723,7 @@ static void OPV_design (OPT_Node n, int16 prec) static void OPV_ParIntLiteral (int64 n, int32 size) { - if (OPV_ansi) { - OPM_WriteInt(n); - } else { - OPC_IntLiteral(n, size); - } + OPM_WriteInt(n); } static void OPV_ActualPar (OPT_Node n, OPT_Object fp) @@ -754,26 +745,19 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) } if (!__IN(n->typ->comp, 0x0c, 32)) { if (mode == 2) { - if ((OPV_ansi && typ != n->typ)) { + if (typ != n->typ) { OPM_WriteString((CHAR*)"(void*)", 8); } OPM_Write('&'); prec = 9; - } else if (OPV_ansi) { + } else { if ((__IN(comp, 0x0c, 32) && n->class == 7)) { OPM_WriteString((CHAR*)"(CHAR*)", 8); } else if ((((form == 11 && typ != n->typ)) && n->typ != OPT_niltyp)) { OPM_WriteString((CHAR*)"(void*)", 8); } - } else { - if ((__IN(form, 0x60, 32) && n->typ->form == 4)) { - OPM_WriteString((CHAR*)"(double)", 9); - prec = 9; - } else if (form == 4) { - OPV_SizeCast(n->typ->size, typ->size); - } } - } else if (OPV_ansi) { + } else { if ((((mode == 2 && typ != n->typ)) && prec == -1)) { OPM_WriteString((CHAR*)"(void*)", 8); } @@ -1532,7 +1516,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) case 20: if (n->subcl != 32) { OPV_IfStat(n, 0, outerProc); - } else if (OPV_assert) { + } else if (__IN(7, OPM_opt, 32)) { OPM_WriteString((CHAR*)"__ASSERT(", 10); OPV_expr(n->left->left->left, -1); OPM_WriteString((CHAR*)", ", 3); @@ -1598,7 +1582,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) break; case 26: if (OPM_level == 0) { - if (OPV_mainprog) { + if (__IN(10, OPM_opt, 32)) { OPM_WriteString((CHAR*)"__FINI", 7); } else { OPM_WriteString((CHAR*)"__ENDMOD", 9); @@ -1643,7 +1627,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) void OPV_Module (OPT_Node prog) { - if (!OPV_mainprog) { + if (!__IN(10, OPM_opt, 32)) { OPC_GenHdr(prog->right); OPC_GenHdrIncludes(); } diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index f78267d0..a89aa61a 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index a42034f5..2f652641 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index 99b78a56..adbbe116 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index c032a4a5..dec0e0b4 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index b4469c3a..0b779857 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index db9dbf02..69612295 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index 9d2d3b44..b4d5f201 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index faa47731..df1eacae 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index e0fc1bc4..1702769b 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/Vishap.c b/bootstrap/unix-44/Vishap.c index c3405c16..17b498b8 100644 --- a/bootstrap/unix-44/Vishap.c +++ b/bootstrap/unix-44/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspamSf */ #define INTEGER int16 #define LONGINT int32 @@ -42,22 +42,22 @@ void Vishap_Module (BOOLEAN *done) OPC_Init(); OPV_Module(p); if (OPM_noerr) { - if (((OPM_mainProg || OPM_mainLinkStat) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { + if ((__IN(10, OPM_opt, 32) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { OPM_DeleteNewSym(); - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"32m", 4); } OPM_LogWStr((CHAR*)" Main program.", 16); - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } } else { if (new) { - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"32m", 4); } OPM_LogWStr((CHAR*)" New symbol file.", 19); - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } OPM_RegisterNewSym(); @@ -111,17 +111,17 @@ void Vishap_Translate (void) OPM_LogWLn(); Platform_Exit(1); } - if (!OPM_dontAsm) { - if (OPM_dontLink) { + if (!__IN(13, OPM_opt, 32)) { + if (__IN(14, OPM_opt, 32)) { extTools_Assemble(OPM_modName, 32); } else { - if (!(OPM_mainProg || OPM_mainLinkStat)) { + if (!__IN(10, OPM_opt, 32)) { extTools_Assemble(OPM_modName, 32); Strings_Append((CHAR*)" ", 2, (void*)modulesobj, 2048); Strings_Append(OPM_modName, 32, (void*)modulesobj, 2048); Strings_Append((CHAR*)".o", 3, (void*)modulesobj, 2048); } else { - extTools_LinkMain((void*)OPM_modName, 32, OPM_mainLinkStat, modulesobj, 2048); + extTools_LinkMain((void*)OPM_modName, 32, __IN(15, OPM_opt, 32), modulesobj, 2048); } } } diff --git a/bootstrap/unix-44/errors.c b/bootstrap/unix-44/errors.c index 2e61c724..95868540 100644 --- a/bootstrap/unix-44/errors.c +++ b/bootstrap/unix-44/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/errors.h b/bootstrap/unix-44/errors.h index 99f4c6b0..d574008d 100644 --- a/bootstrap/unix-44/errors.h +++ b/bootstrap/unix-44/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index 8838dd7b..9047ebcc 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -25,7 +25,7 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN int16 r, status, exitcode; __DUP(title, title__len, CHAR); __DUP(cmd, cmd__len, CHAR); - if (OPM_Verbose) { + if (__IN(18, OPM_opt, 32)) { Console_String(title, title__len); Console_String(cmd, cmd__len); Console_Ln(); diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index d4f0c474..847e440e 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-44/vt100.c b/bootstrap/unix-44/vt100.c index 5d050112..a14f3ee0 100644 --- a/bootstrap/unix-44/vt100.c +++ b/bootstrap/unix-44/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/vt100.h b/bootstrap/unix-44/vt100.h index 11aabb2a..1402af8c 100644 --- a/bootstrap/unix-44/vt100.h +++ b/bootstrap/unix-44/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index 6db18d8a..c780cc96 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index 831281d6..7fdf5f78 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Console.c b/bootstrap/unix-48/Console.c index dea5d7a8..eaa862b2 100644 --- a/bootstrap/unix-48/Console.c +++ b/bootstrap/unix-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Console.h b/bootstrap/unix-48/Console.h index b18bf88a..c8de3606 100644 --- a/bootstrap/unix-48/Console.h +++ b/bootstrap/unix-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 3a826a34..6e15e6b7 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index 17077aa8..960fca06 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index 63b8e488..50823221 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tsSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index d150f1cf..57904466 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index a74b13a3..1c66c8e5 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index d570a488..13b6dbed 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index a4070347..c9ebd8f5 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -1542,7 +1542,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPT_Struct y = NIL; int16 f, g; OPT_Struct p = NIL, q = NIL; - if (OPM_Verbose) { + if (__IN(18, OPM_opt, 32)) { OPM_LogWLn(); OPM_LogWStr((CHAR*)"PROCEDURE CheckAssign", 22); OPM_LogWLn(); @@ -1550,7 +1550,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) y = ynode->typ; f = x->form; g = y->form; - if (OPM_Verbose) { + if (__IN(18, OPM_opt, 32)) { OPM_LogWStr((CHAR*)"y.form = ", 10); OPM_LogWNum(y->form, 0); OPM_LogWLn(); diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index a39fd352..cdd33f1b 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index f3b40759..6b7d1b01 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -11,7 +11,6 @@ static int16 OPC_indentLevel; -static BOOLEAN OPC_ptrinit, OPC_mainprog, OPC_ansi; static int8 OPC_hashtab[105]; static CHAR OPC_keytab[50][9]; static BOOLEAN OPC_GlbPtrs; @@ -93,14 +92,7 @@ static BOOLEAN OPC_Undefined (OPT_Object obj); void OPC_Init (void) { OPC_indentLevel = 0; - OPC_ptrinit = __IN(5, OPM_opt, 32); - OPC_mainprog = OPM_mainProg || OPM_mainLinkStat; - OPC_ansi = __IN(6, OPM_opt, 32); - if (OPC_ansi) { - __MOVE("__init(void)", OPC_BodyNameExt, 13); - } else { - __MOVE("__init()", OPC_BodyNameExt, 9); - } + __MOVE("__init(void)", OPC_BodyNameExt, 13); } void OPC_Indent (int16 count) @@ -299,12 +291,8 @@ static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef) openClause = 0; } if (form == 12) { - if (OPC_ansi) { - OPM_Write(')'); - OPC_AnsiParamList(typ->link, 0); - } else { - OPM_WriteString((CHAR*)")()", 4); - } + OPM_Write(')'); + OPC_AnsiParamList(typ->link, 0); break; } else if (comp == 2) { OPM_Write('['); @@ -579,12 +567,10 @@ static void OPC_DefineTProcTypes (OPT_Object obj) if (obj->typ != OPT_notyp) { OPC_DefineType(obj->typ); } - if (OPC_ansi) { - par = obj->link; - while (par != NIL) { - OPC_DefineType(par->typ); - par = par->link; - } + par = obj->link; + while (par != NIL) { + OPC_DefineType(par->typ); + par = par->link; } } @@ -662,11 +648,7 @@ static void OPC_DefineTProcMacros (OPT_Object obj, BOOLEAN *empty) OPC_Ident(obj->typ->strobj); } OPM_WriteString((CHAR*)"(*)", 4); - if (OPC_ansi) { - OPC_AnsiParamList(obj->link, 0); - } else { - OPM_WriteString((CHAR*)"()", 3); - } + OPC_AnsiParamList(obj->link, 0); OPM_WriteString((CHAR*)", ", 3); OPC_DeclareParams(obj->link, 1); OPM_Write(')'); @@ -1063,7 +1045,7 @@ static void OPC_IdentList (OPT_Object obj, int16 vis) OPC_Ident(obj); OPM_WriteString((CHAR*)"__typ", 6); base = NIL; - } else if ((((((OPC_ptrinit && vis == 0)) && obj->mnolev > 0)) && obj->typ->form == 11)) { + } else if ((((((__IN(5, OPM_opt, 32) && vis == 0)) && obj->mnolev > 0)) && obj->typ->form == 11)) { OPM_WriteString((CHAR*)" = NIL", 7); } } @@ -1122,22 +1104,11 @@ static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define) OPM_Write(' '); OPC_Ident(proc); OPM_Write(' '); - if (OPC_ansi) { - OPC_AnsiParamList(proc->link, 1); - if (!define) { - OPM_Write(';'); - } - OPM_WriteLn(); - } else if (define) { - OPC_DeclareParams(proc->link, 0); - OPM_WriteLn(); - OPC_Indent(1); - OPC_IdentList(proc->link, 2); - OPC_Indent(-1); - } else { - OPM_WriteString((CHAR*)"();", 4); - OPM_WriteLn(); + OPC_AnsiParamList(proc->link, 1); + if (!define) { + OPM_Write(';'); } + OPM_WriteLn(); } static void OPC_ProcPredefs (OPT_Object obj, int8 vis) @@ -1255,9 +1226,6 @@ static void OPC_GenHeaderMsg (void) case 5: OPM_Write('p'); break; - case 6: - OPM_Write('k'); - break; case 7: OPM_Write('a'); break; @@ -1391,15 +1359,7 @@ void OPC_GenEnumPtrs (OPT_Object var) if (OPC_NofPtrs(typ) > 0) { if (!OPC_GlbPtrs) { OPC_GlbPtrs = 1; - OPM_WriteString((CHAR*)"static ", 8); - if (OPC_ansi) { - OPM_WriteString((CHAR*)"void EnumPtrs(void (*P)(void*))", 32); - } else { - OPM_WriteString((CHAR*)"void EnumPtrs(P)", 17); - OPM_WriteLn(); - OPM_Write(0x09); - OPM_WriteString((CHAR*)"void (*P)();", 13); - } + OPM_WriteString((CHAR*)"static void EnumPtrs(void (*P)(void*))", 39); OPM_WriteLn(); OPC_BegBlk(); } @@ -1451,17 +1411,9 @@ void OPC_EnterBody (void) { OPM_WriteLn(); OPM_WriteString((CHAR*)"export ", 8); - if (OPC_mainprog) { - if (OPC_ansi) { - OPM_WriteString((CHAR*)"int main(int argc, char **argv)", 32); - OPM_WriteLn(); - } else { - OPM_WriteString((CHAR*)"main(argc, argv)", 17); - OPM_WriteLn(); - OPM_Write(0x09); - OPM_WriteString((CHAR*)"int argc; char **argv;", 23); - OPM_WriteLn(); - } + if (__IN(10, OPM_opt, 32)) { + OPM_WriteString((CHAR*)"int main(int argc, char **argv)", 32); + OPM_WriteLn(); } else { OPM_WriteString((CHAR*)"void *", 7); OPM_WriteString(OPM_modName, 32); @@ -1470,20 +1422,20 @@ void OPC_EnterBody (void) } OPC_BegBlk(); OPC_BegStat(); - if (OPC_mainprog) { + if (__IN(10, OPM_opt, 32)) { OPM_WriteString((CHAR*)"__INIT(argc, argv)", 19); } else { OPM_WriteString((CHAR*)"__DEFMOD", 9); } OPC_EndStat(); - if ((OPC_mainprog && 0)) { + if ((__IN(10, OPM_opt, 32) && 0)) { OPC_BegStat(); OPM_WriteString((CHAR*)"/*don`t do it!*/ printf(\"DEMO VERSION: DO NOT USE THIS PROGRAM FOR ANY COMMERCIAL PURPOSE\\n\")", 94); OPC_EndStat(); } OPC_InitImports(OPT_topScope->right); OPC_BegStat(); - if (OPC_mainprog) { + if (__IN(10, OPM_opt, 32)) { OPM_WriteString((CHAR*)"__REGMAIN(\"", 12); } else { OPM_WriteString((CHAR*)"__REGMOD(\"", 11); @@ -1503,7 +1455,7 @@ void OPC_EnterBody (void) void OPC_ExitBody (void) { OPC_BegStat(); - if (OPC_mainprog) { + if (__IN(10, OPM_opt, 32)) { OPM_WriteString((CHAR*)"__FINI;", 8); } else { OPM_WriteString((CHAR*)"__ENDMOD;", 10); @@ -1583,21 +1535,6 @@ void OPC_EnterProc (OPT_Object proc) } var = var->link; } - if (!OPC_ansi) { - var = proc->link; - while (var != NIL) { - if ((var->typ->form == 5 && var->mode == 1)) { - OPC_BegStat(); - OPC_Ident(var->typ->strobj); - OPM_Write(' '); - OPC_Ident(var); - OPM_WriteString((CHAR*)" = _", 5); - OPC_Ident(var); - OPC_EndStat(); - } - var = var->link; - } - } var = proc->link; while (var != NIL) { if ((((__IN(var->typ->comp, 0x0c, 32) && var->mode == 1)) && var->typ->sysflag == 0)) { @@ -1963,11 +1900,7 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim) array = array->BaseTyp; dim -= 1; } - if (OPC_ansi) { - OPM_WriteInt(array->n); - } else { - OPC_IntLiteral(array->n, OPM_AddressSize); - } + OPM_WriteInt(array->n); } } diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index 1ac87c2d..b398282e 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index e5b7fc83..0086ff0f 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -37,7 +37,6 @@ static Files_Rider OPM_oldSF, OPM_newSF; static Files_Rider OPM_R[3]; static Files_File OPM_oldSFile, OPM_newSFile, OPM_HFile, OPM_BFile, OPM_HIFile; static int16 OPM_S; -export BOOLEAN OPM_dontAsm, OPM_dontLink, OPM_mainProg, OPM_mainLinkStat, OPM_notColorOutput, OPM_forceNewSym, OPM_Verbose; static CHAR OPM_OBERON[1024]; static CHAR OPM_MODULES[1024]; @@ -138,42 +137,94 @@ int16 OPM_Integer (int64 n) static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) { int16 i; + __DUP(s, s__len, CHAR); i = 1; while (s[__X(i, s__len)] != 0x00) { switch (s[__X(i, s__len)]) { - case 'a': - *opt = *opt ^ 0x80; - break; - case 'c': - *opt = *opt ^ 0x4000; - break; - case 'e': - *opt = *opt ^ 0x0200; - break; - case 'f': - *opt = *opt ^ 0x010000; - break; - case 'k': - *opt = *opt ^ 0x40; - break; - case 'm': - *opt = *opt ^ 0x0400; - break; case 'p': *opt = *opt ^ 0x20; break; + case 'a': + *opt = *opt ^ 0x80; + break; case 'r': *opt = *opt ^ 0x04; break; - case 's': - *opt = *opt ^ 0x10; - break; case 't': *opt = *opt ^ 0x08; break; case 'x': *opt = *opt ^ 0x01; break; + case 'e': + *opt = *opt ^ 0x0200; + break; + case 's': + *opt = *opt ^ 0x10; + break; + case 'F': + *opt = *opt ^ 0x020000; + break; + case 'm': + *opt = *opt ^ 0x0400; + break; + case 'M': + *opt = *opt ^ 0x8000; + break; + case 'S': + *opt = *opt ^ 0x2000; + break; + case 'c': + *opt = *opt ^ 0x4000; + break; + case 'f': + *opt = *opt ^ 0x010000; + break; + case 'V': + *opt = *opt ^ 0x040000; + break; + case 'O': + if (i + 1 >= Strings_Length(s, s__len)) { + OPM_LogWStr((CHAR*)"-O option requires following size model character.", 51); + OPM_LogWLn(); + } else { + switch (s[__X(i + 1, s__len)]) { + case '2': + OPM_ShortintSize = 1; + OPM_IntegerSize = 2; + OPM_LongintSize = 4; + OPM_SetSize = 4; + break; + case 'V': + OPM_ShortintSize = 1; + OPM_IntegerSize = 4; + OPM_LongintSize = 8; + OPM_SetSize = 8; + break; + case 'C': + OPM_ShortintSize = 2; + OPM_IntegerSize = 4; + OPM_LongintSize = 8; + OPM_SetSize = 8; + break; + default: + OPM_LogWStr((CHAR*)"Unrecognised size model character following -O.", 48); + OPM_LogWLn(); + break; + } + i += 1; + } + break; + case 'A': + if (i + 2 >= Strings_Length(s, s__len)) { + OPM_LogWStr((CHAR*)"-M option requires two following digits.", 41); + OPM_LogWLn(); + } else { + OPM_AddressSize = (int16)s[__X(i + 1, s__len)] - 48; + OPM_Alignment = (int16)s[__X(i + 2, s__len)] - 48; + i += 2; + } + break; case 'B': if (s[__X(i + 1, s__len)] != 0x00) { i += 1; @@ -199,18 +250,6 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) } Files_SetSearchPath((CHAR*)"", 1); break; - case 'F': - *opt = *opt ^ 0x020000; - break; - case 'M': - *opt = *opt ^ 0x8000; - break; - case 'S': - *opt = *opt ^ 0x2000; - break; - case 'V': - *opt = *opt ^ 0x040000; - break; default: OPM_LogWStr((CHAR*)" warning: option ", 19); OPM_LogW('-'); @@ -221,6 +260,7 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) } i += 1; } + __DEL(s); } BOOLEAN OPM_OpenPar (void) @@ -247,33 +287,62 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWStr((CHAR*)"Where options = [\"-\" {option} ].", 33); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" m - generate code for main module", 36); + OPM_LogWStr((CHAR*)" Run time safety", 18); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" M - generate code for main module and link object statically", 63); + OPM_LogWStr((CHAR*)" -p Initialise pointers to NIL.", 37); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" s - generate new symbol file", 31); + OPM_LogWStr((CHAR*)" -a Halt on assertion failures.", 37); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" e - allow extending the module interface", 43); + OPM_LogWStr((CHAR*)" -r Halt on range check failures.", 39); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" r - check value ranges", 25); + OPM_LogWStr((CHAR*)" -t Halt on type guad failure.", 36); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" x - turn off array indices check", 35); + OPM_LogWStr((CHAR*)" -x Halt on index out of range.", 37); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" a - don't check ASSERTs at runtime, use this option in tested production code", 80); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" p - turn off automatic pointer initialization", 48); + OPM_LogWStr((CHAR*)" Symbol file management", 25); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" t - don't check type guards (use in rare cases such as low-level modules where every cycle counts)", 101); + OPM_LogWStr((CHAR*)" -e Allow extension of old symbol file.", 45); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" S - don't call external assembler/compiler, only generate C code", 67); + OPM_LogWStr((CHAR*)" -s Allow generation of new symbol file.", 46); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" c - don't call linker", 24); + OPM_LogWStr((CHAR*)" -F Force generation of new symbol file.", 46); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" f - don't use color output", 29); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" F - force writing new symbol file in current directory", 57); + OPM_LogWStr((CHAR*)" C compiler and linker control", 32); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" V - verbose output", 21); + OPM_LogWStr((CHAR*)" -m This module is main. Link dynamically.", 48); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -M This module is main. Link statically.", 47); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -S Don't call C compiler", 31); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -c Don't link.", 21); + OPM_LogWLn(); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" Miscellaneous", 16); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -f Disable vt100 control characters in status output.", 60); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -V Display compiler debugging messages.", 46); + OPM_LogWLn(); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" Size model for elementary types", 34); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -O2 Original Oberon / Oberon-2: 8 bit SHORTINT, 16 bit INTEGER, 32 bit LONGINT and SET.", 94); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -OC Component Pascal: 16 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET.", 94); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -OV Alternate large model: 8 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET.", 94); + OPM_LogWLn(); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" Target machine address size and alignment", 44); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -A44 32 bit addresses, 32 bit alignment (e.g. Unix/linux 32 bit on x86).", 79); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -A48 32 bit addresses, 64 bit alignment (e.g. Windows 32 bit on x86, linux 32 bit on arm).", 97); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -A88 66 bit addresses, 64 bit alignment (e.g. 64 bit platforms).", 71); OPM_LogWLn(); OPM_LogWLn(); OPM_LogWStr((CHAR*)"Initial options specify defaults for all files.", 48); @@ -288,9 +357,9 @@ BOOLEAN OPM_OpenPar (void) OPM_S = 1; s[0] = 0x00; Platform_GetArg(OPM_S, (void*)s, 256); - OPM_glbopt = 0xe9; + OPM_glbopt = 0xa9; while (s[0] == '-') { - OPM_ScanOptions((void*)s, 256, &OPM_glbopt); + OPM_ScanOptions(s, 256, &OPM_glbopt); OPM_S += 1; s[0] = 0x00; Platform_GetArg(OPM_S, (void*)s, 256); @@ -308,20 +377,14 @@ void OPM_InitOptions (void) s[0] = 0x00; Platform_GetArg(OPM_S, (void*)s, 256); while (s[0] == '-') { - OPM_ScanOptions((void*)s, 256, &OPM_opt); + OPM_ScanOptions(s, 256, &OPM_opt); OPM_S += 1; s[0] = 0x00; Platform_GetArg(OPM_S, (void*)s, 256); } - OPM_dontAsm = __IN(13, OPM_opt, 32); - OPM_dontLink = __IN(14, OPM_opt, 32); - OPM_mainProg = __IN(10, OPM_opt, 32); - OPM_mainLinkStat = __IN(15, OPM_opt, 32); - OPM_notColorOutput = __IN(16, OPM_opt, 32); - OPM_forceNewSym = __IN(17, OPM_opt, 32); - OPM_Verbose = __IN(18, OPM_opt, 32); - if (OPM_mainLinkStat) { + if (__IN(15, OPM_opt, 32)) { OPM_glbopt |= __SETOF(10,32); + OPM_opt |= __SETOF(10,32); } OPM_GetProperties(); } @@ -407,20 +470,20 @@ static void OPM_LogErrMsg (int16 n) int16 i; CHAR buf[1024]; if (n >= 0) { - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"31m", 4); } OPM_LogWStr((CHAR*)" err ", 7); - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } } else { - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"35m", 4); } OPM_LogWStr((CHAR*)" warning ", 11); n = -n; - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } } @@ -493,11 +556,11 @@ static void OPM_ShowLine (int64 pos) OPM_LogW(' '); i -= 1; } - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"32m", 4); } OPM_LogW('^'); - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } Files_Close(f); @@ -682,7 +745,7 @@ static void OPM_GetProperties (void) OPM_MinLReal = -OPM_MaxLReal; OPM_MaxSet = __ASHL(OPM_SetSize, 3) - 1; OPM_MaxIndex = OPM_SignedMaximum(OPM_AddressSize); - if (OPM_Verbose) { + if (__IN(18, OPM_opt, 32)) { OPM_VerboseListSizes(); } } diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index 1835a2b8..b32da345 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPM__h #define OPM__h @@ -15,7 +15,6 @@ import int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; import CHAR OPM_modName[32]; import CHAR OPM_objname[64]; import SET OPM_opt, OPM_glbopt; -import BOOLEAN OPM_dontAsm, OPM_dontLink, OPM_mainProg, OPM_mainLinkStat, OPM_notColorOutput, OPM_forceNewSym, OPM_Verbose; import void OPM_CloseFiles (void); diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index f62551cc..af0d37db 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index 9ae7712a..6dd03161 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index f04f47ad..f37bbc27 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index 3ff9b0b3..1b60944c 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index acdca9f2..148fbecb 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -1733,10 +1733,7 @@ void OPT_Export (BOOLEAN *ext, BOOLEAN *new) } OPT_OutObj(OPT_topScope->right); *ext = (OPT_sfpresent && OPT_symExtended); - *new = !OPT_sfpresent || OPT_symNew; - if (OPM_forceNewSym) { - *new = 1; - } + *new = (!OPT_sfpresent || OPT_symNew) || __IN(17, OPM_opt, 32); if ((((OPM_noerr && OPT_sfpresent)) && OPT_impCtxt.reffp != OPT_expCtxt.reffp)) { *new = 1; if (!OPT_extsf) { diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index 9ee5643f..d999d4ec 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index 2146d7c2..edb84f81 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -16,7 +16,6 @@ typedef } OPV_ExitInfo; -static BOOLEAN OPV_assert, OPV_inxchk, OPV_mainprog, OPV_ansi; static int16 OPV_stamp; static int32 OPV_recno; static OPV_ExitInfo OPV_exit; @@ -130,10 +129,6 @@ void OPV_Init (void) OPV_stamp = 0; OPV_recno = 0; OPV_nofExitLabels = 0; - OPV_assert = __IN(7, OPM_opt, 32); - OPV_inxchk = __IN(0, OPM_opt, 32); - OPV_mainprog = __IN(10, OPM_opt, 32); - OPV_ansi = __IN(6, OPM_opt, 32); } static void OPV_GetTProcNum (OPT_Object obj) @@ -532,7 +527,7 @@ static void OPV_TypeOf (OPT_Node n) static void OPV_Index (OPT_Node n, OPT_Node d, int16 prec, int16 dim) { - if (!OPV_inxchk || (n->right->class == 7 && (n->right->conval->intval == 0 || n->left->typ->comp != 3))) { + if (!__IN(0, OPM_opt, 32) || (n->right->class == 7 && (n->right->conval->intval == 0 || n->left->typ->comp != 3))) { OPV_expr(n->right, prec); } else { if (OPV_SideEffects(n->right)) { @@ -728,11 +723,7 @@ static void OPV_design (OPT_Node n, int16 prec) static void OPV_ParIntLiteral (int64 n, int32 size) { - if (OPV_ansi) { - OPM_WriteInt(n); - } else { - OPC_IntLiteral(n, size); - } + OPM_WriteInt(n); } static void OPV_ActualPar (OPT_Node n, OPT_Object fp) @@ -754,26 +745,19 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) } if (!__IN(n->typ->comp, 0x0c, 32)) { if (mode == 2) { - if ((OPV_ansi && typ != n->typ)) { + if (typ != n->typ) { OPM_WriteString((CHAR*)"(void*)", 8); } OPM_Write('&'); prec = 9; - } else if (OPV_ansi) { + } else { if ((__IN(comp, 0x0c, 32) && n->class == 7)) { OPM_WriteString((CHAR*)"(CHAR*)", 8); } else if ((((form == 11 && typ != n->typ)) && n->typ != OPT_niltyp)) { OPM_WriteString((CHAR*)"(void*)", 8); } - } else { - if ((__IN(form, 0x60, 32) && n->typ->form == 4)) { - OPM_WriteString((CHAR*)"(double)", 9); - prec = 9; - } else if (form == 4) { - OPV_SizeCast(n->typ->size, typ->size); - } } - } else if (OPV_ansi) { + } else { if ((((mode == 2 && typ != n->typ)) && prec == -1)) { OPM_WriteString((CHAR*)"(void*)", 8); } @@ -1532,7 +1516,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) case 20: if (n->subcl != 32) { OPV_IfStat(n, 0, outerProc); - } else if (OPV_assert) { + } else if (__IN(7, OPM_opt, 32)) { OPM_WriteString((CHAR*)"__ASSERT(", 10); OPV_expr(n->left->left->left, -1); OPM_WriteString((CHAR*)", ", 3); @@ -1598,7 +1582,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) break; case 26: if (OPM_level == 0) { - if (OPV_mainprog) { + if (__IN(10, OPM_opt, 32)) { OPM_WriteString((CHAR*)"__FINI", 7); } else { OPM_WriteString((CHAR*)"__ENDMOD", 9); @@ -1643,7 +1627,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) void OPV_Module (OPT_Node prog) { - if (!OPV_mainprog) { + if (!__IN(10, OPM_opt, 32)) { OPC_GenHdr(prog->right); OPC_GenHdrIncludes(); } diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index f78267d0..a89aa61a 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index a42034f5..2f652641 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index 99b78a56..adbbe116 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index c032a4a5..dec0e0b4 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index b4469c3a..0b779857 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index db9dbf02..69612295 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index 9d2d3b44..b4d5f201 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index 5ae009bd..c02becc4 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index 299cfde9..fbb113f7 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/Vishap.c b/bootstrap/unix-48/Vishap.c index c3405c16..17b498b8 100644 --- a/bootstrap/unix-48/Vishap.c +++ b/bootstrap/unix-48/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspamSf */ #define INTEGER int16 #define LONGINT int32 @@ -42,22 +42,22 @@ void Vishap_Module (BOOLEAN *done) OPC_Init(); OPV_Module(p); if (OPM_noerr) { - if (((OPM_mainProg || OPM_mainLinkStat) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { + if ((__IN(10, OPM_opt, 32) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { OPM_DeleteNewSym(); - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"32m", 4); } OPM_LogWStr((CHAR*)" Main program.", 16); - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } } else { if (new) { - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"32m", 4); } OPM_LogWStr((CHAR*)" New symbol file.", 19); - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } OPM_RegisterNewSym(); @@ -111,17 +111,17 @@ void Vishap_Translate (void) OPM_LogWLn(); Platform_Exit(1); } - if (!OPM_dontAsm) { - if (OPM_dontLink) { + if (!__IN(13, OPM_opt, 32)) { + if (__IN(14, OPM_opt, 32)) { extTools_Assemble(OPM_modName, 32); } else { - if (!(OPM_mainProg || OPM_mainLinkStat)) { + if (!__IN(10, OPM_opt, 32)) { extTools_Assemble(OPM_modName, 32); Strings_Append((CHAR*)" ", 2, (void*)modulesobj, 2048); Strings_Append(OPM_modName, 32, (void*)modulesobj, 2048); Strings_Append((CHAR*)".o", 3, (void*)modulesobj, 2048); } else { - extTools_LinkMain((void*)OPM_modName, 32, OPM_mainLinkStat, modulesobj, 2048); + extTools_LinkMain((void*)OPM_modName, 32, __IN(15, OPM_opt, 32), modulesobj, 2048); } } } diff --git a/bootstrap/unix-48/errors.c b/bootstrap/unix-48/errors.c index 2e61c724..95868540 100644 --- a/bootstrap/unix-48/errors.c +++ b/bootstrap/unix-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/errors.h b/bootstrap/unix-48/errors.h index 99f4c6b0..d574008d 100644 --- a/bootstrap/unix-48/errors.h +++ b/bootstrap/unix-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index 8838dd7b..9047ebcc 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -25,7 +25,7 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN int16 r, status, exitcode; __DUP(title, title__len, CHAR); __DUP(cmd, cmd__len, CHAR); - if (OPM_Verbose) { + if (__IN(18, OPM_opt, 32)) { Console_String(title, title__len); Console_String(cmd, cmd__len); Console_Ln(); diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index d4f0c474..847e440e 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/vt100.c b/bootstrap/unix-48/vt100.c index 5d050112..a14f3ee0 100644 --- a/bootstrap/unix-48/vt100.c +++ b/bootstrap/unix-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/vt100.h b/bootstrap/unix-48/vt100.h index 11aabb2a..1402af8c 100644 --- a/bootstrap/unix-48/vt100.h +++ b/bootstrap/unix-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index 9db9e691..122d2b82 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index 831281d6..7fdf5f78 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Console.c b/bootstrap/unix-88/Console.c index 7e051e81..d489489e 100644 --- a/bootstrap/unix-88/Console.c +++ b/bootstrap/unix-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Console.h b/bootstrap/unix-88/Console.h index be8ab870..255cb17c 100644 --- a/bootstrap/unix-88/Console.h +++ b/bootstrap/unix-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index efed2605..1e1dea21 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 64f39a5b..08a62623 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index 68a02b24..85664851 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tsSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index 04b1a4f9..b11a81ee 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 0e60d59f..24319ad6 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index 5fec9a72..4c14134c 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index fedc1751..fab97f6a 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -1542,7 +1542,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPT_Struct y = NIL; int32 f, g; OPT_Struct p = NIL, q = NIL; - if (OPM_Verbose) { + if (__IN(18, OPM_opt, 64)) { OPM_LogWLn(); OPM_LogWStr((CHAR*)"PROCEDURE CheckAssign", 22); OPM_LogWLn(); @@ -1550,7 +1550,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) y = ynode->typ; f = x->form; g = y->form; - if (OPM_Verbose) { + if (__IN(18, OPM_opt, 64)) { OPM_LogWStr((CHAR*)"y.form = ", 10); OPM_LogWNum(y->form, 0); OPM_LogWLn(); diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index 72ea3c62..deb651aa 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index 2c8127e1..dd9e2a18 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -11,7 +11,6 @@ static int32 OPC_indentLevel; -static BOOLEAN OPC_ptrinit, OPC_mainprog, OPC_ansi; static int8 OPC_hashtab[105]; static CHAR OPC_keytab[50][9]; static BOOLEAN OPC_GlbPtrs; @@ -93,14 +92,7 @@ static BOOLEAN OPC_Undefined (OPT_Object obj); void OPC_Init (void) { OPC_indentLevel = 0; - OPC_ptrinit = __IN(5, OPM_opt, 64); - OPC_mainprog = OPM_mainProg || OPM_mainLinkStat; - OPC_ansi = __IN(6, OPM_opt, 64); - if (OPC_ansi) { - __MOVE("__init(void)", OPC_BodyNameExt, 13); - } else { - __MOVE("__init()", OPC_BodyNameExt, 9); - } + __MOVE("__init(void)", OPC_BodyNameExt, 13); } void OPC_Indent (int32 count) @@ -299,12 +291,8 @@ static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef) openClause = 0; } if (form == 12) { - if (OPC_ansi) { - OPM_Write(')'); - OPC_AnsiParamList(typ->link, 0); - } else { - OPM_WriteString((CHAR*)")()", 4); - } + OPM_Write(')'); + OPC_AnsiParamList(typ->link, 0); break; } else if (comp == 2) { OPM_Write('['); @@ -579,12 +567,10 @@ static void OPC_DefineTProcTypes (OPT_Object obj) if (obj->typ != OPT_notyp) { OPC_DefineType(obj->typ); } - if (OPC_ansi) { - par = obj->link; - while (par != NIL) { - OPC_DefineType(par->typ); - par = par->link; - } + par = obj->link; + while (par != NIL) { + OPC_DefineType(par->typ); + par = par->link; } } @@ -662,11 +648,7 @@ static void OPC_DefineTProcMacros (OPT_Object obj, BOOLEAN *empty) OPC_Ident(obj->typ->strobj); } OPM_WriteString((CHAR*)"(*)", 4); - if (OPC_ansi) { - OPC_AnsiParamList(obj->link, 0); - } else { - OPM_WriteString((CHAR*)"()", 3); - } + OPC_AnsiParamList(obj->link, 0); OPM_WriteString((CHAR*)", ", 3); OPC_DeclareParams(obj->link, 1); OPM_Write(')'); @@ -1063,7 +1045,7 @@ static void OPC_IdentList (OPT_Object obj, int32 vis) OPC_Ident(obj); OPM_WriteString((CHAR*)"__typ", 6); base = NIL; - } else if ((((((OPC_ptrinit && vis == 0)) && obj->mnolev > 0)) && obj->typ->form == 11)) { + } else if ((((((__IN(5, OPM_opt, 64) && vis == 0)) && obj->mnolev > 0)) && obj->typ->form == 11)) { OPM_WriteString((CHAR*)" = NIL", 7); } } @@ -1122,22 +1104,11 @@ static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define) OPM_Write(' '); OPC_Ident(proc); OPM_Write(' '); - if (OPC_ansi) { - OPC_AnsiParamList(proc->link, 1); - if (!define) { - OPM_Write(';'); - } - OPM_WriteLn(); - } else if (define) { - OPC_DeclareParams(proc->link, 0); - OPM_WriteLn(); - OPC_Indent(1); - OPC_IdentList(proc->link, 2); - OPC_Indent(-1); - } else { - OPM_WriteString((CHAR*)"();", 4); - OPM_WriteLn(); + OPC_AnsiParamList(proc->link, 1); + if (!define) { + OPM_Write(';'); } + OPM_WriteLn(); } static void OPC_ProcPredefs (OPT_Object obj, int8 vis) @@ -1255,9 +1226,6 @@ static void OPC_GenHeaderMsg (void) case 5: OPM_Write('p'); break; - case 6: - OPM_Write('k'); - break; case 7: OPM_Write('a'); break; @@ -1391,15 +1359,7 @@ void OPC_GenEnumPtrs (OPT_Object var) if (OPC_NofPtrs(typ) > 0) { if (!OPC_GlbPtrs) { OPC_GlbPtrs = 1; - OPM_WriteString((CHAR*)"static ", 8); - if (OPC_ansi) { - OPM_WriteString((CHAR*)"void EnumPtrs(void (*P)(void*))", 32); - } else { - OPM_WriteString((CHAR*)"void EnumPtrs(P)", 17); - OPM_WriteLn(); - OPM_Write(0x09); - OPM_WriteString((CHAR*)"void (*P)();", 13); - } + OPM_WriteString((CHAR*)"static void EnumPtrs(void (*P)(void*))", 39); OPM_WriteLn(); OPC_BegBlk(); } @@ -1451,17 +1411,9 @@ void OPC_EnterBody (void) { OPM_WriteLn(); OPM_WriteString((CHAR*)"export ", 8); - if (OPC_mainprog) { - if (OPC_ansi) { - OPM_WriteString((CHAR*)"int main(int argc, char **argv)", 32); - OPM_WriteLn(); - } else { - OPM_WriteString((CHAR*)"main(argc, argv)", 17); - OPM_WriteLn(); - OPM_Write(0x09); - OPM_WriteString((CHAR*)"int argc; char **argv;", 23); - OPM_WriteLn(); - } + if (__IN(10, OPM_opt, 64)) { + OPM_WriteString((CHAR*)"int main(int argc, char **argv)", 32); + OPM_WriteLn(); } else { OPM_WriteString((CHAR*)"void *", 7); OPM_WriteString(OPM_modName, 32); @@ -1470,20 +1422,20 @@ void OPC_EnterBody (void) } OPC_BegBlk(); OPC_BegStat(); - if (OPC_mainprog) { + if (__IN(10, OPM_opt, 64)) { OPM_WriteString((CHAR*)"__INIT(argc, argv)", 19); } else { OPM_WriteString((CHAR*)"__DEFMOD", 9); } OPC_EndStat(); - if ((OPC_mainprog && 0)) { + if ((__IN(10, OPM_opt, 64) && 0)) { OPC_BegStat(); OPM_WriteString((CHAR*)"/*don`t do it!*/ printf(\"DEMO VERSION: DO NOT USE THIS PROGRAM FOR ANY COMMERCIAL PURPOSE\\n\")", 94); OPC_EndStat(); } OPC_InitImports(OPT_topScope->right); OPC_BegStat(); - if (OPC_mainprog) { + if (__IN(10, OPM_opt, 64)) { OPM_WriteString((CHAR*)"__REGMAIN(\"", 12); } else { OPM_WriteString((CHAR*)"__REGMOD(\"", 11); @@ -1503,7 +1455,7 @@ void OPC_EnterBody (void) void OPC_ExitBody (void) { OPC_BegStat(); - if (OPC_mainprog) { + if (__IN(10, OPM_opt, 64)) { OPM_WriteString((CHAR*)"__FINI;", 8); } else { OPM_WriteString((CHAR*)"__ENDMOD;", 10); @@ -1583,21 +1535,6 @@ void OPC_EnterProc (OPT_Object proc) } var = var->link; } - if (!OPC_ansi) { - var = proc->link; - while (var != NIL) { - if ((var->typ->form == 5 && var->mode == 1)) { - OPC_BegStat(); - OPC_Ident(var->typ->strobj); - OPM_Write(' '); - OPC_Ident(var); - OPM_WriteString((CHAR*)" = _", 5); - OPC_Ident(var); - OPC_EndStat(); - } - var = var->link; - } - } var = proc->link; while (var != NIL) { if ((((__IN(var->typ->comp, 0x0c, 64) && var->mode == 1)) && var->typ->sysflag == 0)) { @@ -1963,11 +1900,7 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim) array = array->BaseTyp; dim -= 1; } - if (OPC_ansi) { - OPM_WriteInt(array->n); - } else { - OPC_IntLiteral(array->n, OPM_AddressSize); - } + OPM_WriteInt(array->n); } } diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index 30f3fd48..ae8e7035 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 391613fb..1b8dca0d 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -36,7 +36,6 @@ static Files_Rider OPM_oldSF, OPM_newSF; static Files_Rider OPM_R[3]; static Files_File OPM_oldSFile, OPM_newSFile, OPM_HFile, OPM_BFile, OPM_HIFile; static int32 OPM_S; -export BOOLEAN OPM_dontAsm, OPM_dontLink, OPM_mainProg, OPM_mainLinkStat, OPM_notColorOutput, OPM_forceNewSym, OPM_Verbose; static CHAR OPM_OBERON[1024]; static CHAR OPM_MODULES[1024]; @@ -137,42 +136,94 @@ int32 OPM_Integer (int64 n) static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) { int32 i; + __DUP(s, s__len, CHAR); i = 1; while (s[__X(i, s__len)] != 0x00) { switch (s[__X(i, s__len)]) { - case 'a': - *opt = *opt ^ 0x80; - break; - case 'c': - *opt = *opt ^ 0x4000; - break; - case 'e': - *opt = *opt ^ 0x0200; - break; - case 'f': - *opt = *opt ^ 0x010000; - break; - case 'k': - *opt = *opt ^ 0x40; - break; - case 'm': - *opt = *opt ^ 0x0400; - break; case 'p': *opt = *opt ^ 0x20; break; + case 'a': + *opt = *opt ^ 0x80; + break; case 'r': *opt = *opt ^ 0x04; break; - case 's': - *opt = *opt ^ 0x10; - break; case 't': *opt = *opt ^ 0x08; break; case 'x': *opt = *opt ^ 0x01; break; + case 'e': + *opt = *opt ^ 0x0200; + break; + case 's': + *opt = *opt ^ 0x10; + break; + case 'F': + *opt = *opt ^ 0x020000; + break; + case 'm': + *opt = *opt ^ 0x0400; + break; + case 'M': + *opt = *opt ^ 0x8000; + break; + case 'S': + *opt = *opt ^ 0x2000; + break; + case 'c': + *opt = *opt ^ 0x4000; + break; + case 'f': + *opt = *opt ^ 0x010000; + break; + case 'V': + *opt = *opt ^ 0x040000; + break; + case 'O': + if (i + 1 >= Strings_Length(s, s__len)) { + OPM_LogWStr((CHAR*)"-O option requires following size model character.", 51); + OPM_LogWLn(); + } else { + switch (s[__X(i + 1, s__len)]) { + case '2': + OPM_ShortintSize = 1; + OPM_IntegerSize = 2; + OPM_LongintSize = 4; + OPM_SetSize = 4; + break; + case 'V': + OPM_ShortintSize = 1; + OPM_IntegerSize = 4; + OPM_LongintSize = 8; + OPM_SetSize = 8; + break; + case 'C': + OPM_ShortintSize = 2; + OPM_IntegerSize = 4; + OPM_LongintSize = 8; + OPM_SetSize = 8; + break; + default: + OPM_LogWStr((CHAR*)"Unrecognised size model character following -O.", 48); + OPM_LogWLn(); + break; + } + i += 1; + } + break; + case 'A': + if (i + 2 >= Strings_Length(s, s__len)) { + OPM_LogWStr((CHAR*)"-M option requires two following digits.", 41); + OPM_LogWLn(); + } else { + OPM_AddressSize = s[__X(i + 1, s__len)] - 48; + OPM_Alignment = s[__X(i + 2, s__len)] - 48; + i += 2; + } + break; case 'B': if (s[__X(i + 1, s__len)] != 0x00) { i += 1; @@ -198,18 +249,6 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) } Files_SetSearchPath((CHAR*)"", 1); break; - case 'F': - *opt = *opt ^ 0x020000; - break; - case 'M': - *opt = *opt ^ 0x8000; - break; - case 'S': - *opt = *opt ^ 0x2000; - break; - case 'V': - *opt = *opt ^ 0x040000; - break; default: OPM_LogWStr((CHAR*)" warning: option ", 19); OPM_LogW('-'); @@ -220,6 +259,7 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) } i += 1; } + __DEL(s); } BOOLEAN OPM_OpenPar (void) @@ -246,33 +286,62 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWStr((CHAR*)"Where options = [\"-\" {option} ].", 33); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" m - generate code for main module", 36); + OPM_LogWStr((CHAR*)" Run time safety", 18); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" M - generate code for main module and link object statically", 63); + OPM_LogWStr((CHAR*)" -p Initialise pointers to NIL.", 37); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" s - generate new symbol file", 31); + OPM_LogWStr((CHAR*)" -a Halt on assertion failures.", 37); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" e - allow extending the module interface", 43); + OPM_LogWStr((CHAR*)" -r Halt on range check failures.", 39); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" r - check value ranges", 25); + OPM_LogWStr((CHAR*)" -t Halt on type guad failure.", 36); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" x - turn off array indices check", 35); + OPM_LogWStr((CHAR*)" -x Halt on index out of range.", 37); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" a - don't check ASSERTs at runtime, use this option in tested production code", 80); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" p - turn off automatic pointer initialization", 48); + OPM_LogWStr((CHAR*)" Symbol file management", 25); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" t - don't check type guards (use in rare cases such as low-level modules where every cycle counts)", 101); + OPM_LogWStr((CHAR*)" -e Allow extension of old symbol file.", 45); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" S - don't call external assembler/compiler, only generate C code", 67); + OPM_LogWStr((CHAR*)" -s Allow generation of new symbol file.", 46); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" c - don't call linker", 24); + OPM_LogWStr((CHAR*)" -F Force generation of new symbol file.", 46); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" f - don't use color output", 29); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" F - force writing new symbol file in current directory", 57); + OPM_LogWStr((CHAR*)" C compiler and linker control", 32); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" V - verbose output", 21); + OPM_LogWStr((CHAR*)" -m This module is main. Link dynamically.", 48); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -M This module is main. Link statically.", 47); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -S Don't call C compiler", 31); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -c Don't link.", 21); + OPM_LogWLn(); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" Miscellaneous", 16); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -f Disable vt100 control characters in status output.", 60); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -V Display compiler debugging messages.", 46); + OPM_LogWLn(); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" Size model for elementary types", 34); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -O2 Original Oberon / Oberon-2: 8 bit SHORTINT, 16 bit INTEGER, 32 bit LONGINT and SET.", 94); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -OC Component Pascal: 16 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET.", 94); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -OV Alternate large model: 8 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET.", 94); + OPM_LogWLn(); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" Target machine address size and alignment", 44); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -A44 32 bit addresses, 32 bit alignment (e.g. Unix/linux 32 bit on x86).", 79); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -A48 32 bit addresses, 64 bit alignment (e.g. Windows 32 bit on x86, linux 32 bit on arm).", 97); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -A88 66 bit addresses, 64 bit alignment (e.g. 64 bit platforms).", 71); OPM_LogWLn(); OPM_LogWLn(); OPM_LogWStr((CHAR*)"Initial options specify defaults for all files.", 48); @@ -287,9 +356,9 @@ BOOLEAN OPM_OpenPar (void) OPM_S = 1; s[0] = 0x00; Platform_GetArg(OPM_S, (void*)s, 256); - OPM_glbopt = 0xe9; + OPM_glbopt = 0xa9; while (s[0] == '-') { - OPM_ScanOptions((void*)s, 256, &OPM_glbopt); + OPM_ScanOptions(s, 256, &OPM_glbopt); OPM_S += 1; s[0] = 0x00; Platform_GetArg(OPM_S, (void*)s, 256); @@ -307,20 +376,14 @@ void OPM_InitOptions (void) s[0] = 0x00; Platform_GetArg(OPM_S, (void*)s, 256); while (s[0] == '-') { - OPM_ScanOptions((void*)s, 256, &OPM_opt); + OPM_ScanOptions(s, 256, &OPM_opt); OPM_S += 1; s[0] = 0x00; Platform_GetArg(OPM_S, (void*)s, 256); } - OPM_dontAsm = __IN(13, OPM_opt, 64); - OPM_dontLink = __IN(14, OPM_opt, 64); - OPM_mainProg = __IN(10, OPM_opt, 64); - OPM_mainLinkStat = __IN(15, OPM_opt, 64); - OPM_notColorOutput = __IN(16, OPM_opt, 64); - OPM_forceNewSym = __IN(17, OPM_opt, 64); - OPM_Verbose = __IN(18, OPM_opt, 64); - if (OPM_mainLinkStat) { + if (__IN(15, OPM_opt, 64)) { OPM_glbopt |= __SETOF(10,64); + OPM_opt |= __SETOF(10,64); } OPM_GetProperties(); } @@ -406,20 +469,20 @@ static void OPM_LogErrMsg (int32 n) int32 i; CHAR buf[1024]; if (n >= 0) { - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 64)) { vt100_SetAttr((CHAR*)"31m", 4); } OPM_LogWStr((CHAR*)" err ", 7); - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 64)) { vt100_SetAttr((CHAR*)"0m", 3); } } else { - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 64)) { vt100_SetAttr((CHAR*)"35m", 4); } OPM_LogWStr((CHAR*)" warning ", 11); n = -n; - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 64)) { vt100_SetAttr((CHAR*)"0m", 3); } } @@ -492,11 +555,11 @@ static void OPM_ShowLine (int64 pos) OPM_LogW(' '); i -= 1; } - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 64)) { vt100_SetAttr((CHAR*)"32m", 4); } OPM_LogW('^'); - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 64)) { vt100_SetAttr((CHAR*)"0m", 3); } Files_Close(f); @@ -679,7 +742,7 @@ static void OPM_GetProperties (void) OPM_MinLReal = -OPM_MaxLReal; OPM_MaxSet = __ASHL(OPM_SetSize, 3) - 1; OPM_MaxIndex = OPM_SignedMaximum(OPM_AddressSize); - if (OPM_Verbose) { + if (__IN(18, OPM_opt, 64)) { OPM_VerboseListSizes(); } } diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index 4a9253cf..e2737249 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPM__h #define OPM__h @@ -15,7 +15,6 @@ import int32 OPM_currFile, OPM_level, OPM_pc, OPM_entno; import CHAR OPM_modName[32]; import CHAR OPM_objname[64]; import SET OPM_opt, OPM_glbopt; -import BOOLEAN OPM_dontAsm, OPM_dontLink, OPM_mainProg, OPM_mainLinkStat, OPM_notColorOutput, OPM_forceNewSym, OPM_Verbose; import void OPM_CloseFiles (void); diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index ff86118c..e9fcba89 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index 9ae7712a..6dd03161 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index c811b3cc..d79e207f 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index 1c9ae6a4..40853589 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index 5fbe3b87..63b773cd 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -1732,10 +1732,7 @@ void OPT_Export (BOOLEAN *ext, BOOLEAN *new) } OPT_OutObj(OPT_topScope->right); *ext = (OPT_sfpresent && OPT_symExtended); - *new = !OPT_sfpresent || OPT_symNew; - if (OPM_forceNewSym) { - *new = 1; - } + *new = (!OPT_sfpresent || OPT_symNew) || __IN(17, OPM_opt, 64); if ((((OPM_noerr && OPT_sfpresent)) && OPT_impCtxt.reffp != OPT_expCtxt.reffp)) { *new = 1; if (!OPT_extsf) { diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 66686a2c..0cc86a01 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 965f7b61..8026831f 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -16,7 +16,6 @@ typedef } OPV_ExitInfo; -static BOOLEAN OPV_assert, OPV_inxchk, OPV_mainprog, OPV_ansi; static int32 OPV_stamp; static int64 OPV_recno; static OPV_ExitInfo OPV_exit; @@ -130,10 +129,6 @@ void OPV_Init (void) OPV_stamp = 0; OPV_recno = 0; OPV_nofExitLabels = 0; - OPV_assert = __IN(7, OPM_opt, 64); - OPV_inxchk = __IN(0, OPM_opt, 64); - OPV_mainprog = __IN(10, OPM_opt, 64); - OPV_ansi = __IN(6, OPM_opt, 64); } static void OPV_GetTProcNum (OPT_Object obj) @@ -532,7 +527,7 @@ static void OPV_TypeOf (OPT_Node n) static void OPV_Index (OPT_Node n, OPT_Node d, int32 prec, int32 dim) { - if (!OPV_inxchk || (n->right->class == 7 && (n->right->conval->intval == 0 || n->left->typ->comp != 3))) { + if (!__IN(0, OPM_opt, 64) || (n->right->class == 7 && (n->right->conval->intval == 0 || n->left->typ->comp != 3))) { OPV_expr(n->right, prec); } else { if (OPV_SideEffects(n->right)) { @@ -728,11 +723,7 @@ static void OPV_design (OPT_Node n, int32 prec) static void OPV_ParIntLiteral (int64 n, int64 size) { - if (OPV_ansi) { - OPM_WriteInt(n); - } else { - OPC_IntLiteral(n, size); - } + OPM_WriteInt(n); } static void OPV_ActualPar (OPT_Node n, OPT_Object fp) @@ -754,26 +745,19 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) } if (!__IN(n->typ->comp, 0x0c, 64)) { if (mode == 2) { - if ((OPV_ansi && typ != n->typ)) { + if (typ != n->typ) { OPM_WriteString((CHAR*)"(void*)", 8); } OPM_Write('&'); prec = 9; - } else if (OPV_ansi) { + } else { if ((__IN(comp, 0x0c, 64) && n->class == 7)) { OPM_WriteString((CHAR*)"(CHAR*)", 8); } else if ((((form == 11 && typ != n->typ)) && n->typ != OPT_niltyp)) { OPM_WriteString((CHAR*)"(void*)", 8); } - } else { - if ((__IN(form, 0x60, 64) && n->typ->form == 4)) { - OPM_WriteString((CHAR*)"(double)", 9); - prec = 9; - } else if (form == 4) { - OPV_SizeCast(n->typ->size, typ->size); - } } - } else if (OPV_ansi) { + } else { if ((((mode == 2 && typ != n->typ)) && prec == -1)) { OPM_WriteString((CHAR*)"(void*)", 8); } @@ -1532,7 +1516,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) case 20: if (n->subcl != 32) { OPV_IfStat(n, 0, outerProc); - } else if (OPV_assert) { + } else if (__IN(7, OPM_opt, 64)) { OPM_WriteString((CHAR*)"__ASSERT(", 10); OPV_expr(n->left->left->left, -1); OPM_WriteString((CHAR*)", ", 3); @@ -1598,7 +1582,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) break; case 26: if (OPM_level == 0) { - if (OPV_mainprog) { + if (__IN(10, OPM_opt, 64)) { OPM_WriteString((CHAR*)"__FINI", 7); } else { OPM_WriteString((CHAR*)"__ENDMOD", 9); @@ -1643,7 +1627,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) void OPV_Module (OPT_Node prog) { - if (!OPV_mainprog) { + if (!__IN(10, OPM_opt, 64)) { OPC_GenHdr(prog->right); OPC_GenHdrIncludes(); } diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index f78267d0..a89aa61a 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index e2180e5d..99577840 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index 6a8cce4b..06414b7c 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index e9e84723..f2623b03 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index 116d9c93..05b31bee 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index 8dc35935..4226bdb9 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index 0487b70c..b13ba079 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index 54254c51..4cdaa6b9 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index 40d02918..10d0a9bb 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/Vishap.c b/bootstrap/unix-88/Vishap.c index 7cd188f2..e1d112ec 100644 --- a/bootstrap/unix-88/Vishap.c +++ b/bootstrap/unix-88/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspamSf */ #define INTEGER int32 #define LONGINT int64 @@ -42,22 +42,22 @@ void Vishap_Module (BOOLEAN *done) OPC_Init(); OPV_Module(p); if (OPM_noerr) { - if (((OPM_mainProg || OPM_mainLinkStat) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { + if ((__IN(10, OPM_opt, 64) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { OPM_DeleteNewSym(); - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 64)) { vt100_SetAttr((CHAR*)"32m", 4); } OPM_LogWStr((CHAR*)" Main program.", 16); - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 64)) { vt100_SetAttr((CHAR*)"0m", 3); } } else { if (new) { - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 64)) { vt100_SetAttr((CHAR*)"32m", 4); } OPM_LogWStr((CHAR*)" New symbol file.", 19); - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 64)) { vt100_SetAttr((CHAR*)"0m", 3); } OPM_RegisterNewSym(); @@ -111,17 +111,17 @@ void Vishap_Translate (void) OPM_LogWLn(); Platform_Exit(1); } - if (!OPM_dontAsm) { - if (OPM_dontLink) { + if (!__IN(13, OPM_opt, 64)) { + if (__IN(14, OPM_opt, 64)) { extTools_Assemble(OPM_modName, 32); } else { - if (!(OPM_mainProg || OPM_mainLinkStat)) { + if (!__IN(10, OPM_opt, 64)) { extTools_Assemble(OPM_modName, 32); Strings_Append((CHAR*)" ", 2, (void*)modulesobj, 2048); Strings_Append(OPM_modName, 32, (void*)modulesobj, 2048); Strings_Append((CHAR*)".o", 3, (void*)modulesobj, 2048); } else { - extTools_LinkMain((void*)OPM_modName, 32, OPM_mainLinkStat, modulesobj, 2048); + extTools_LinkMain((void*)OPM_modName, 32, __IN(15, OPM_opt, 64), modulesobj, 2048); } } } diff --git a/bootstrap/unix-88/errors.c b/bootstrap/unix-88/errors.c index 04b9504d..ca898552 100644 --- a/bootstrap/unix-88/errors.c +++ b/bootstrap/unix-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/errors.h b/bootstrap/unix-88/errors.h index 99f4c6b0..d574008d 100644 --- a/bootstrap/unix-88/errors.h +++ b/bootstrap/unix-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index 2eef1f18..db3aec30 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -25,7 +25,7 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN int32 r, status, exitcode; __DUP(title, title__len, CHAR); __DUP(cmd, cmd__len, CHAR); - if (OPM_Verbose) { + if (__IN(18, OPM_opt, 64)) { Console_String(title, title__len); Console_String(cmd, cmd__len); Console_Ln(); diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index d4f0c474..847e440e 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/vt100.c b/bootstrap/unix-88/vt100.c index 3b56b4b1..ac832261 100644 --- a/bootstrap/unix-88/vt100.c +++ b/bootstrap/unix-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/vt100.h b/bootstrap/unix-88/vt100.h index b574976e..054f6ddd 100644 --- a/bootstrap/unix-88/vt100.h +++ b/bootstrap/unix-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index 6db18d8a..c780cc96 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index 831281d6..7fdf5f78 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Console.c b/bootstrap/windows-48/Console.c index 94c1e086..9c3127a1 100644 --- a/bootstrap/windows-48/Console.c +++ b/bootstrap/windows-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Console.h b/bootstrap/windows-48/Console.h index b18bf88a..c8de3606 100644 --- a/bootstrap/windows-48/Console.h +++ b/bootstrap/windows-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 0c320187..80926272 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index febb2814..ade97ac7 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index 63b8e488..50823221 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tsSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index d150f1cf..57904466 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index a74b13a3..1c66c8e5 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index d570a488..13b6dbed 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index a4070347..c9ebd8f5 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -1542,7 +1542,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPT_Struct y = NIL; int16 f, g; OPT_Struct p = NIL, q = NIL; - if (OPM_Verbose) { + if (__IN(18, OPM_opt, 32)) { OPM_LogWLn(); OPM_LogWStr((CHAR*)"PROCEDURE CheckAssign", 22); OPM_LogWLn(); @@ -1550,7 +1550,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) y = ynode->typ; f = x->form; g = y->form; - if (OPM_Verbose) { + if (__IN(18, OPM_opt, 32)) { OPM_LogWStr((CHAR*)"y.form = ", 10); OPM_LogWNum(y->form, 0); OPM_LogWLn(); diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index a39fd352..cdd33f1b 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index f3b40759..6b7d1b01 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -11,7 +11,6 @@ static int16 OPC_indentLevel; -static BOOLEAN OPC_ptrinit, OPC_mainprog, OPC_ansi; static int8 OPC_hashtab[105]; static CHAR OPC_keytab[50][9]; static BOOLEAN OPC_GlbPtrs; @@ -93,14 +92,7 @@ static BOOLEAN OPC_Undefined (OPT_Object obj); void OPC_Init (void) { OPC_indentLevel = 0; - OPC_ptrinit = __IN(5, OPM_opt, 32); - OPC_mainprog = OPM_mainProg || OPM_mainLinkStat; - OPC_ansi = __IN(6, OPM_opt, 32); - if (OPC_ansi) { - __MOVE("__init(void)", OPC_BodyNameExt, 13); - } else { - __MOVE("__init()", OPC_BodyNameExt, 9); - } + __MOVE("__init(void)", OPC_BodyNameExt, 13); } void OPC_Indent (int16 count) @@ -299,12 +291,8 @@ static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef) openClause = 0; } if (form == 12) { - if (OPC_ansi) { - OPM_Write(')'); - OPC_AnsiParamList(typ->link, 0); - } else { - OPM_WriteString((CHAR*)")()", 4); - } + OPM_Write(')'); + OPC_AnsiParamList(typ->link, 0); break; } else if (comp == 2) { OPM_Write('['); @@ -579,12 +567,10 @@ static void OPC_DefineTProcTypes (OPT_Object obj) if (obj->typ != OPT_notyp) { OPC_DefineType(obj->typ); } - if (OPC_ansi) { - par = obj->link; - while (par != NIL) { - OPC_DefineType(par->typ); - par = par->link; - } + par = obj->link; + while (par != NIL) { + OPC_DefineType(par->typ); + par = par->link; } } @@ -662,11 +648,7 @@ static void OPC_DefineTProcMacros (OPT_Object obj, BOOLEAN *empty) OPC_Ident(obj->typ->strobj); } OPM_WriteString((CHAR*)"(*)", 4); - if (OPC_ansi) { - OPC_AnsiParamList(obj->link, 0); - } else { - OPM_WriteString((CHAR*)"()", 3); - } + OPC_AnsiParamList(obj->link, 0); OPM_WriteString((CHAR*)", ", 3); OPC_DeclareParams(obj->link, 1); OPM_Write(')'); @@ -1063,7 +1045,7 @@ static void OPC_IdentList (OPT_Object obj, int16 vis) OPC_Ident(obj); OPM_WriteString((CHAR*)"__typ", 6); base = NIL; - } else if ((((((OPC_ptrinit && vis == 0)) && obj->mnolev > 0)) && obj->typ->form == 11)) { + } else if ((((((__IN(5, OPM_opt, 32) && vis == 0)) && obj->mnolev > 0)) && obj->typ->form == 11)) { OPM_WriteString((CHAR*)" = NIL", 7); } } @@ -1122,22 +1104,11 @@ static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define) OPM_Write(' '); OPC_Ident(proc); OPM_Write(' '); - if (OPC_ansi) { - OPC_AnsiParamList(proc->link, 1); - if (!define) { - OPM_Write(';'); - } - OPM_WriteLn(); - } else if (define) { - OPC_DeclareParams(proc->link, 0); - OPM_WriteLn(); - OPC_Indent(1); - OPC_IdentList(proc->link, 2); - OPC_Indent(-1); - } else { - OPM_WriteString((CHAR*)"();", 4); - OPM_WriteLn(); + OPC_AnsiParamList(proc->link, 1); + if (!define) { + OPM_Write(';'); } + OPM_WriteLn(); } static void OPC_ProcPredefs (OPT_Object obj, int8 vis) @@ -1255,9 +1226,6 @@ static void OPC_GenHeaderMsg (void) case 5: OPM_Write('p'); break; - case 6: - OPM_Write('k'); - break; case 7: OPM_Write('a'); break; @@ -1391,15 +1359,7 @@ void OPC_GenEnumPtrs (OPT_Object var) if (OPC_NofPtrs(typ) > 0) { if (!OPC_GlbPtrs) { OPC_GlbPtrs = 1; - OPM_WriteString((CHAR*)"static ", 8); - if (OPC_ansi) { - OPM_WriteString((CHAR*)"void EnumPtrs(void (*P)(void*))", 32); - } else { - OPM_WriteString((CHAR*)"void EnumPtrs(P)", 17); - OPM_WriteLn(); - OPM_Write(0x09); - OPM_WriteString((CHAR*)"void (*P)();", 13); - } + OPM_WriteString((CHAR*)"static void EnumPtrs(void (*P)(void*))", 39); OPM_WriteLn(); OPC_BegBlk(); } @@ -1451,17 +1411,9 @@ void OPC_EnterBody (void) { OPM_WriteLn(); OPM_WriteString((CHAR*)"export ", 8); - if (OPC_mainprog) { - if (OPC_ansi) { - OPM_WriteString((CHAR*)"int main(int argc, char **argv)", 32); - OPM_WriteLn(); - } else { - OPM_WriteString((CHAR*)"main(argc, argv)", 17); - OPM_WriteLn(); - OPM_Write(0x09); - OPM_WriteString((CHAR*)"int argc; char **argv;", 23); - OPM_WriteLn(); - } + if (__IN(10, OPM_opt, 32)) { + OPM_WriteString((CHAR*)"int main(int argc, char **argv)", 32); + OPM_WriteLn(); } else { OPM_WriteString((CHAR*)"void *", 7); OPM_WriteString(OPM_modName, 32); @@ -1470,20 +1422,20 @@ void OPC_EnterBody (void) } OPC_BegBlk(); OPC_BegStat(); - if (OPC_mainprog) { + if (__IN(10, OPM_opt, 32)) { OPM_WriteString((CHAR*)"__INIT(argc, argv)", 19); } else { OPM_WriteString((CHAR*)"__DEFMOD", 9); } OPC_EndStat(); - if ((OPC_mainprog && 0)) { + if ((__IN(10, OPM_opt, 32) && 0)) { OPC_BegStat(); OPM_WriteString((CHAR*)"/*don`t do it!*/ printf(\"DEMO VERSION: DO NOT USE THIS PROGRAM FOR ANY COMMERCIAL PURPOSE\\n\")", 94); OPC_EndStat(); } OPC_InitImports(OPT_topScope->right); OPC_BegStat(); - if (OPC_mainprog) { + if (__IN(10, OPM_opt, 32)) { OPM_WriteString((CHAR*)"__REGMAIN(\"", 12); } else { OPM_WriteString((CHAR*)"__REGMOD(\"", 11); @@ -1503,7 +1455,7 @@ void OPC_EnterBody (void) void OPC_ExitBody (void) { OPC_BegStat(); - if (OPC_mainprog) { + if (__IN(10, OPM_opt, 32)) { OPM_WriteString((CHAR*)"__FINI;", 8); } else { OPM_WriteString((CHAR*)"__ENDMOD;", 10); @@ -1583,21 +1535,6 @@ void OPC_EnterProc (OPT_Object proc) } var = var->link; } - if (!OPC_ansi) { - var = proc->link; - while (var != NIL) { - if ((var->typ->form == 5 && var->mode == 1)) { - OPC_BegStat(); - OPC_Ident(var->typ->strobj); - OPM_Write(' '); - OPC_Ident(var); - OPM_WriteString((CHAR*)" = _", 5); - OPC_Ident(var); - OPC_EndStat(); - } - var = var->link; - } - } var = proc->link; while (var != NIL) { if ((((__IN(var->typ->comp, 0x0c, 32) && var->mode == 1)) && var->typ->sysflag == 0)) { @@ -1963,11 +1900,7 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim) array = array->BaseTyp; dim -= 1; } - if (OPC_ansi) { - OPM_WriteInt(array->n); - } else { - OPC_IntLiteral(array->n, OPM_AddressSize); - } + OPM_WriteInt(array->n); } } diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index 1ac87c2d..b398282e 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index e5b7fc83..0086ff0f 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -37,7 +37,6 @@ static Files_Rider OPM_oldSF, OPM_newSF; static Files_Rider OPM_R[3]; static Files_File OPM_oldSFile, OPM_newSFile, OPM_HFile, OPM_BFile, OPM_HIFile; static int16 OPM_S; -export BOOLEAN OPM_dontAsm, OPM_dontLink, OPM_mainProg, OPM_mainLinkStat, OPM_notColorOutput, OPM_forceNewSym, OPM_Verbose; static CHAR OPM_OBERON[1024]; static CHAR OPM_MODULES[1024]; @@ -138,42 +137,94 @@ int16 OPM_Integer (int64 n) static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) { int16 i; + __DUP(s, s__len, CHAR); i = 1; while (s[__X(i, s__len)] != 0x00) { switch (s[__X(i, s__len)]) { - case 'a': - *opt = *opt ^ 0x80; - break; - case 'c': - *opt = *opt ^ 0x4000; - break; - case 'e': - *opt = *opt ^ 0x0200; - break; - case 'f': - *opt = *opt ^ 0x010000; - break; - case 'k': - *opt = *opt ^ 0x40; - break; - case 'm': - *opt = *opt ^ 0x0400; - break; case 'p': *opt = *opt ^ 0x20; break; + case 'a': + *opt = *opt ^ 0x80; + break; case 'r': *opt = *opt ^ 0x04; break; - case 's': - *opt = *opt ^ 0x10; - break; case 't': *opt = *opt ^ 0x08; break; case 'x': *opt = *opt ^ 0x01; break; + case 'e': + *opt = *opt ^ 0x0200; + break; + case 's': + *opt = *opt ^ 0x10; + break; + case 'F': + *opt = *opt ^ 0x020000; + break; + case 'm': + *opt = *opt ^ 0x0400; + break; + case 'M': + *opt = *opt ^ 0x8000; + break; + case 'S': + *opt = *opt ^ 0x2000; + break; + case 'c': + *opt = *opt ^ 0x4000; + break; + case 'f': + *opt = *opt ^ 0x010000; + break; + case 'V': + *opt = *opt ^ 0x040000; + break; + case 'O': + if (i + 1 >= Strings_Length(s, s__len)) { + OPM_LogWStr((CHAR*)"-O option requires following size model character.", 51); + OPM_LogWLn(); + } else { + switch (s[__X(i + 1, s__len)]) { + case '2': + OPM_ShortintSize = 1; + OPM_IntegerSize = 2; + OPM_LongintSize = 4; + OPM_SetSize = 4; + break; + case 'V': + OPM_ShortintSize = 1; + OPM_IntegerSize = 4; + OPM_LongintSize = 8; + OPM_SetSize = 8; + break; + case 'C': + OPM_ShortintSize = 2; + OPM_IntegerSize = 4; + OPM_LongintSize = 8; + OPM_SetSize = 8; + break; + default: + OPM_LogWStr((CHAR*)"Unrecognised size model character following -O.", 48); + OPM_LogWLn(); + break; + } + i += 1; + } + break; + case 'A': + if (i + 2 >= Strings_Length(s, s__len)) { + OPM_LogWStr((CHAR*)"-M option requires two following digits.", 41); + OPM_LogWLn(); + } else { + OPM_AddressSize = (int16)s[__X(i + 1, s__len)] - 48; + OPM_Alignment = (int16)s[__X(i + 2, s__len)] - 48; + i += 2; + } + break; case 'B': if (s[__X(i + 1, s__len)] != 0x00) { i += 1; @@ -199,18 +250,6 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) } Files_SetSearchPath((CHAR*)"", 1); break; - case 'F': - *opt = *opt ^ 0x020000; - break; - case 'M': - *opt = *opt ^ 0x8000; - break; - case 'S': - *opt = *opt ^ 0x2000; - break; - case 'V': - *opt = *opt ^ 0x040000; - break; default: OPM_LogWStr((CHAR*)" warning: option ", 19); OPM_LogW('-'); @@ -221,6 +260,7 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) } i += 1; } + __DEL(s); } BOOLEAN OPM_OpenPar (void) @@ -247,33 +287,62 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWStr((CHAR*)"Where options = [\"-\" {option} ].", 33); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" m - generate code for main module", 36); + OPM_LogWStr((CHAR*)" Run time safety", 18); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" M - generate code for main module and link object statically", 63); + OPM_LogWStr((CHAR*)" -p Initialise pointers to NIL.", 37); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" s - generate new symbol file", 31); + OPM_LogWStr((CHAR*)" -a Halt on assertion failures.", 37); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" e - allow extending the module interface", 43); + OPM_LogWStr((CHAR*)" -r Halt on range check failures.", 39); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" r - check value ranges", 25); + OPM_LogWStr((CHAR*)" -t Halt on type guad failure.", 36); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" x - turn off array indices check", 35); + OPM_LogWStr((CHAR*)" -x Halt on index out of range.", 37); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" a - don't check ASSERTs at runtime, use this option in tested production code", 80); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" p - turn off automatic pointer initialization", 48); + OPM_LogWStr((CHAR*)" Symbol file management", 25); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" t - don't check type guards (use in rare cases such as low-level modules where every cycle counts)", 101); + OPM_LogWStr((CHAR*)" -e Allow extension of old symbol file.", 45); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" S - don't call external assembler/compiler, only generate C code", 67); + OPM_LogWStr((CHAR*)" -s Allow generation of new symbol file.", 46); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" c - don't call linker", 24); + OPM_LogWStr((CHAR*)" -F Force generation of new symbol file.", 46); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" f - don't use color output", 29); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" F - force writing new symbol file in current directory", 57); + OPM_LogWStr((CHAR*)" C compiler and linker control", 32); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" V - verbose output", 21); + OPM_LogWStr((CHAR*)" -m This module is main. Link dynamically.", 48); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -M This module is main. Link statically.", 47); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -S Don't call C compiler", 31); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -c Don't link.", 21); + OPM_LogWLn(); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" Miscellaneous", 16); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -f Disable vt100 control characters in status output.", 60); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -V Display compiler debugging messages.", 46); + OPM_LogWLn(); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" Size model for elementary types", 34); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -O2 Original Oberon / Oberon-2: 8 bit SHORTINT, 16 bit INTEGER, 32 bit LONGINT and SET.", 94); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -OC Component Pascal: 16 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET.", 94); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -OV Alternate large model: 8 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET.", 94); + OPM_LogWLn(); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" Target machine address size and alignment", 44); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -A44 32 bit addresses, 32 bit alignment (e.g. Unix/linux 32 bit on x86).", 79); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -A48 32 bit addresses, 64 bit alignment (e.g. Windows 32 bit on x86, linux 32 bit on arm).", 97); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -A88 66 bit addresses, 64 bit alignment (e.g. 64 bit platforms).", 71); OPM_LogWLn(); OPM_LogWLn(); OPM_LogWStr((CHAR*)"Initial options specify defaults for all files.", 48); @@ -288,9 +357,9 @@ BOOLEAN OPM_OpenPar (void) OPM_S = 1; s[0] = 0x00; Platform_GetArg(OPM_S, (void*)s, 256); - OPM_glbopt = 0xe9; + OPM_glbopt = 0xa9; while (s[0] == '-') { - OPM_ScanOptions((void*)s, 256, &OPM_glbopt); + OPM_ScanOptions(s, 256, &OPM_glbopt); OPM_S += 1; s[0] = 0x00; Platform_GetArg(OPM_S, (void*)s, 256); @@ -308,20 +377,14 @@ void OPM_InitOptions (void) s[0] = 0x00; Platform_GetArg(OPM_S, (void*)s, 256); while (s[0] == '-') { - OPM_ScanOptions((void*)s, 256, &OPM_opt); + OPM_ScanOptions(s, 256, &OPM_opt); OPM_S += 1; s[0] = 0x00; Platform_GetArg(OPM_S, (void*)s, 256); } - OPM_dontAsm = __IN(13, OPM_opt, 32); - OPM_dontLink = __IN(14, OPM_opt, 32); - OPM_mainProg = __IN(10, OPM_opt, 32); - OPM_mainLinkStat = __IN(15, OPM_opt, 32); - OPM_notColorOutput = __IN(16, OPM_opt, 32); - OPM_forceNewSym = __IN(17, OPM_opt, 32); - OPM_Verbose = __IN(18, OPM_opt, 32); - if (OPM_mainLinkStat) { + if (__IN(15, OPM_opt, 32)) { OPM_glbopt |= __SETOF(10,32); + OPM_opt |= __SETOF(10,32); } OPM_GetProperties(); } @@ -407,20 +470,20 @@ static void OPM_LogErrMsg (int16 n) int16 i; CHAR buf[1024]; if (n >= 0) { - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"31m", 4); } OPM_LogWStr((CHAR*)" err ", 7); - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } } else { - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"35m", 4); } OPM_LogWStr((CHAR*)" warning ", 11); n = -n; - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } } @@ -493,11 +556,11 @@ static void OPM_ShowLine (int64 pos) OPM_LogW(' '); i -= 1; } - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"32m", 4); } OPM_LogW('^'); - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } Files_Close(f); @@ -682,7 +745,7 @@ static void OPM_GetProperties (void) OPM_MinLReal = -OPM_MaxLReal; OPM_MaxSet = __ASHL(OPM_SetSize, 3) - 1; OPM_MaxIndex = OPM_SignedMaximum(OPM_AddressSize); - if (OPM_Verbose) { + if (__IN(18, OPM_opt, 32)) { OPM_VerboseListSizes(); } } diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index 1835a2b8..b32da345 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPM__h #define OPM__h @@ -15,7 +15,6 @@ import int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; import CHAR OPM_modName[32]; import CHAR OPM_objname[64]; import SET OPM_opt, OPM_glbopt; -import BOOLEAN OPM_dontAsm, OPM_dontLink, OPM_mainProg, OPM_mainLinkStat, OPM_notColorOutput, OPM_forceNewSym, OPM_Verbose; import void OPM_CloseFiles (void); diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index f62551cc..af0d37db 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index 9ae7712a..6dd03161 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index f04f47ad..f37bbc27 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index 3ff9b0b3..1b60944c 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index acdca9f2..148fbecb 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -1733,10 +1733,7 @@ void OPT_Export (BOOLEAN *ext, BOOLEAN *new) } OPT_OutObj(OPT_topScope->right); *ext = (OPT_sfpresent && OPT_symExtended); - *new = !OPT_sfpresent || OPT_symNew; - if (OPM_forceNewSym) { - *new = 1; - } + *new = (!OPT_sfpresent || OPT_symNew) || __IN(17, OPM_opt, 32); if ((((OPM_noerr && OPT_sfpresent)) && OPT_impCtxt.reffp != OPT_expCtxt.reffp)) { *new = 1; if (!OPT_extsf) { diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index 9ee5643f..d999d4ec 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index 2146d7c2..edb84f81 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -16,7 +16,6 @@ typedef } OPV_ExitInfo; -static BOOLEAN OPV_assert, OPV_inxchk, OPV_mainprog, OPV_ansi; static int16 OPV_stamp; static int32 OPV_recno; static OPV_ExitInfo OPV_exit; @@ -130,10 +129,6 @@ void OPV_Init (void) OPV_stamp = 0; OPV_recno = 0; OPV_nofExitLabels = 0; - OPV_assert = __IN(7, OPM_opt, 32); - OPV_inxchk = __IN(0, OPM_opt, 32); - OPV_mainprog = __IN(10, OPM_opt, 32); - OPV_ansi = __IN(6, OPM_opt, 32); } static void OPV_GetTProcNum (OPT_Object obj) @@ -532,7 +527,7 @@ static void OPV_TypeOf (OPT_Node n) static void OPV_Index (OPT_Node n, OPT_Node d, int16 prec, int16 dim) { - if (!OPV_inxchk || (n->right->class == 7 && (n->right->conval->intval == 0 || n->left->typ->comp != 3))) { + if (!__IN(0, OPM_opt, 32) || (n->right->class == 7 && (n->right->conval->intval == 0 || n->left->typ->comp != 3))) { OPV_expr(n->right, prec); } else { if (OPV_SideEffects(n->right)) { @@ -728,11 +723,7 @@ static void OPV_design (OPT_Node n, int16 prec) static void OPV_ParIntLiteral (int64 n, int32 size) { - if (OPV_ansi) { - OPM_WriteInt(n); - } else { - OPC_IntLiteral(n, size); - } + OPM_WriteInt(n); } static void OPV_ActualPar (OPT_Node n, OPT_Object fp) @@ -754,26 +745,19 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) } if (!__IN(n->typ->comp, 0x0c, 32)) { if (mode == 2) { - if ((OPV_ansi && typ != n->typ)) { + if (typ != n->typ) { OPM_WriteString((CHAR*)"(void*)", 8); } OPM_Write('&'); prec = 9; - } else if (OPV_ansi) { + } else { if ((__IN(comp, 0x0c, 32) && n->class == 7)) { OPM_WriteString((CHAR*)"(CHAR*)", 8); } else if ((((form == 11 && typ != n->typ)) && n->typ != OPT_niltyp)) { OPM_WriteString((CHAR*)"(void*)", 8); } - } else { - if ((__IN(form, 0x60, 32) && n->typ->form == 4)) { - OPM_WriteString((CHAR*)"(double)", 9); - prec = 9; - } else if (form == 4) { - OPV_SizeCast(n->typ->size, typ->size); - } } - } else if (OPV_ansi) { + } else { if ((((mode == 2 && typ != n->typ)) && prec == -1)) { OPM_WriteString((CHAR*)"(void*)", 8); } @@ -1532,7 +1516,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) case 20: if (n->subcl != 32) { OPV_IfStat(n, 0, outerProc); - } else if (OPV_assert) { + } else if (__IN(7, OPM_opt, 32)) { OPM_WriteString((CHAR*)"__ASSERT(", 10); OPV_expr(n->left->left->left, -1); OPM_WriteString((CHAR*)", ", 3); @@ -1598,7 +1582,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) break; case 26: if (OPM_level == 0) { - if (OPV_mainprog) { + if (__IN(10, OPM_opt, 32)) { OPM_WriteString((CHAR*)"__FINI", 7); } else { OPM_WriteString((CHAR*)"__ENDMOD", 9); @@ -1643,7 +1627,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) void OPV_Module (OPT_Node prog) { - if (!OPV_mainprog) { + if (!__IN(10, OPM_opt, 32)) { OPC_GenHdr(prog->right); OPC_GenHdrIncludes(); } diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index f78267d0..a89aa61a 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 89bc758a..12ced558 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index 9a1147dc..75f53fa0 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index c032a4a5..dec0e0b4 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index b4469c3a..0b779857 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index db9dbf02..69612295 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index 9d2d3b44..b4d5f201 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index 5ae009bd..c02becc4 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index 299cfde9..fbb113f7 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/Vishap.c b/bootstrap/windows-48/Vishap.c index c3405c16..17b498b8 100644 --- a/bootstrap/windows-48/Vishap.c +++ b/bootstrap/windows-48/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspamSf */ #define INTEGER int16 #define LONGINT int32 @@ -42,22 +42,22 @@ void Vishap_Module (BOOLEAN *done) OPC_Init(); OPV_Module(p); if (OPM_noerr) { - if (((OPM_mainProg || OPM_mainLinkStat) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { + if ((__IN(10, OPM_opt, 32) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { OPM_DeleteNewSym(); - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"32m", 4); } OPM_LogWStr((CHAR*)" Main program.", 16); - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } } else { if (new) { - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"32m", 4); } OPM_LogWStr((CHAR*)" New symbol file.", 19); - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } OPM_RegisterNewSym(); @@ -111,17 +111,17 @@ void Vishap_Translate (void) OPM_LogWLn(); Platform_Exit(1); } - if (!OPM_dontAsm) { - if (OPM_dontLink) { + if (!__IN(13, OPM_opt, 32)) { + if (__IN(14, OPM_opt, 32)) { extTools_Assemble(OPM_modName, 32); } else { - if (!(OPM_mainProg || OPM_mainLinkStat)) { + if (!__IN(10, OPM_opt, 32)) { extTools_Assemble(OPM_modName, 32); Strings_Append((CHAR*)" ", 2, (void*)modulesobj, 2048); Strings_Append(OPM_modName, 32, (void*)modulesobj, 2048); Strings_Append((CHAR*)".o", 3, (void*)modulesobj, 2048); } else { - extTools_LinkMain((void*)OPM_modName, 32, OPM_mainLinkStat, modulesobj, 2048); + extTools_LinkMain((void*)OPM_modName, 32, __IN(15, OPM_opt, 32), modulesobj, 2048); } } } diff --git a/bootstrap/windows-48/errors.c b/bootstrap/windows-48/errors.c index 2e61c724..95868540 100644 --- a/bootstrap/windows-48/errors.c +++ b/bootstrap/windows-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/errors.h b/bootstrap/windows-48/errors.h index 99f4c6b0..d574008d 100644 --- a/bootstrap/windows-48/errors.h +++ b/bootstrap/windows-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index 8838dd7b..9047ebcc 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -25,7 +25,7 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN int16 r, status, exitcode; __DUP(title, title__len, CHAR); __DUP(cmd, cmd__len, CHAR); - if (OPM_Verbose) { + if (__IN(18, OPM_opt, 32)) { Console_String(title, title__len); Console_String(cmd, cmd__len); Console_Ln(); diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index d4f0c474..847e440e 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/vt100.c b/bootstrap/windows-48/vt100.c index 5d050112..a14f3ee0 100644 --- a/bootstrap/windows-48/vt100.c +++ b/bootstrap/windows-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/vt100.h b/bootstrap/windows-48/vt100.h index 11aabb2a..1402af8c 100644 --- a/bootstrap/windows-48/vt100.h +++ b/bootstrap/windows-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index 9db9e691..122d2b82 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index 831281d6..7fdf5f78 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Console.c b/bootstrap/windows-88/Console.c index b0a79723..6a1cec2c 100644 --- a/bootstrap/windows-88/Console.c +++ b/bootstrap/windows-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Console.h b/bootstrap/windows-88/Console.h index be8ab870..255cb17c 100644 --- a/bootstrap/windows-88/Console.h +++ b/bootstrap/windows-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index de0e2164..546f8b08 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index f0ec05c1..0aae236a 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index 68a02b24..85664851 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tsSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index 04b1a4f9..b11a81ee 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 0e60d59f..24319ad6 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index 5fec9a72..4c14134c 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index fedc1751..fab97f6a 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -1542,7 +1542,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPT_Struct y = NIL; int32 f, g; OPT_Struct p = NIL, q = NIL; - if (OPM_Verbose) { + if (__IN(18, OPM_opt, 64)) { OPM_LogWLn(); OPM_LogWStr((CHAR*)"PROCEDURE CheckAssign", 22); OPM_LogWLn(); @@ -1550,7 +1550,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) y = ynode->typ; f = x->form; g = y->form; - if (OPM_Verbose) { + if (__IN(18, OPM_opt, 64)) { OPM_LogWStr((CHAR*)"y.form = ", 10); OPM_LogWNum(y->form, 0); OPM_LogWLn(); diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index 72ea3c62..deb651aa 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index 2c8127e1..dd9e2a18 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -11,7 +11,6 @@ static int32 OPC_indentLevel; -static BOOLEAN OPC_ptrinit, OPC_mainprog, OPC_ansi; static int8 OPC_hashtab[105]; static CHAR OPC_keytab[50][9]; static BOOLEAN OPC_GlbPtrs; @@ -93,14 +92,7 @@ static BOOLEAN OPC_Undefined (OPT_Object obj); void OPC_Init (void) { OPC_indentLevel = 0; - OPC_ptrinit = __IN(5, OPM_opt, 64); - OPC_mainprog = OPM_mainProg || OPM_mainLinkStat; - OPC_ansi = __IN(6, OPM_opt, 64); - if (OPC_ansi) { - __MOVE("__init(void)", OPC_BodyNameExt, 13); - } else { - __MOVE("__init()", OPC_BodyNameExt, 9); - } + __MOVE("__init(void)", OPC_BodyNameExt, 13); } void OPC_Indent (int32 count) @@ -299,12 +291,8 @@ static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef) openClause = 0; } if (form == 12) { - if (OPC_ansi) { - OPM_Write(')'); - OPC_AnsiParamList(typ->link, 0); - } else { - OPM_WriteString((CHAR*)")()", 4); - } + OPM_Write(')'); + OPC_AnsiParamList(typ->link, 0); break; } else if (comp == 2) { OPM_Write('['); @@ -579,12 +567,10 @@ static void OPC_DefineTProcTypes (OPT_Object obj) if (obj->typ != OPT_notyp) { OPC_DefineType(obj->typ); } - if (OPC_ansi) { - par = obj->link; - while (par != NIL) { - OPC_DefineType(par->typ); - par = par->link; - } + par = obj->link; + while (par != NIL) { + OPC_DefineType(par->typ); + par = par->link; } } @@ -662,11 +648,7 @@ static void OPC_DefineTProcMacros (OPT_Object obj, BOOLEAN *empty) OPC_Ident(obj->typ->strobj); } OPM_WriteString((CHAR*)"(*)", 4); - if (OPC_ansi) { - OPC_AnsiParamList(obj->link, 0); - } else { - OPM_WriteString((CHAR*)"()", 3); - } + OPC_AnsiParamList(obj->link, 0); OPM_WriteString((CHAR*)", ", 3); OPC_DeclareParams(obj->link, 1); OPM_Write(')'); @@ -1063,7 +1045,7 @@ static void OPC_IdentList (OPT_Object obj, int32 vis) OPC_Ident(obj); OPM_WriteString((CHAR*)"__typ", 6); base = NIL; - } else if ((((((OPC_ptrinit && vis == 0)) && obj->mnolev > 0)) && obj->typ->form == 11)) { + } else if ((((((__IN(5, OPM_opt, 64) && vis == 0)) && obj->mnolev > 0)) && obj->typ->form == 11)) { OPM_WriteString((CHAR*)" = NIL", 7); } } @@ -1122,22 +1104,11 @@ static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define) OPM_Write(' '); OPC_Ident(proc); OPM_Write(' '); - if (OPC_ansi) { - OPC_AnsiParamList(proc->link, 1); - if (!define) { - OPM_Write(';'); - } - OPM_WriteLn(); - } else if (define) { - OPC_DeclareParams(proc->link, 0); - OPM_WriteLn(); - OPC_Indent(1); - OPC_IdentList(proc->link, 2); - OPC_Indent(-1); - } else { - OPM_WriteString((CHAR*)"();", 4); - OPM_WriteLn(); + OPC_AnsiParamList(proc->link, 1); + if (!define) { + OPM_Write(';'); } + OPM_WriteLn(); } static void OPC_ProcPredefs (OPT_Object obj, int8 vis) @@ -1255,9 +1226,6 @@ static void OPC_GenHeaderMsg (void) case 5: OPM_Write('p'); break; - case 6: - OPM_Write('k'); - break; case 7: OPM_Write('a'); break; @@ -1391,15 +1359,7 @@ void OPC_GenEnumPtrs (OPT_Object var) if (OPC_NofPtrs(typ) > 0) { if (!OPC_GlbPtrs) { OPC_GlbPtrs = 1; - OPM_WriteString((CHAR*)"static ", 8); - if (OPC_ansi) { - OPM_WriteString((CHAR*)"void EnumPtrs(void (*P)(void*))", 32); - } else { - OPM_WriteString((CHAR*)"void EnumPtrs(P)", 17); - OPM_WriteLn(); - OPM_Write(0x09); - OPM_WriteString((CHAR*)"void (*P)();", 13); - } + OPM_WriteString((CHAR*)"static void EnumPtrs(void (*P)(void*))", 39); OPM_WriteLn(); OPC_BegBlk(); } @@ -1451,17 +1411,9 @@ void OPC_EnterBody (void) { OPM_WriteLn(); OPM_WriteString((CHAR*)"export ", 8); - if (OPC_mainprog) { - if (OPC_ansi) { - OPM_WriteString((CHAR*)"int main(int argc, char **argv)", 32); - OPM_WriteLn(); - } else { - OPM_WriteString((CHAR*)"main(argc, argv)", 17); - OPM_WriteLn(); - OPM_Write(0x09); - OPM_WriteString((CHAR*)"int argc; char **argv;", 23); - OPM_WriteLn(); - } + if (__IN(10, OPM_opt, 64)) { + OPM_WriteString((CHAR*)"int main(int argc, char **argv)", 32); + OPM_WriteLn(); } else { OPM_WriteString((CHAR*)"void *", 7); OPM_WriteString(OPM_modName, 32); @@ -1470,20 +1422,20 @@ void OPC_EnterBody (void) } OPC_BegBlk(); OPC_BegStat(); - if (OPC_mainprog) { + if (__IN(10, OPM_opt, 64)) { OPM_WriteString((CHAR*)"__INIT(argc, argv)", 19); } else { OPM_WriteString((CHAR*)"__DEFMOD", 9); } OPC_EndStat(); - if ((OPC_mainprog && 0)) { + if ((__IN(10, OPM_opt, 64) && 0)) { OPC_BegStat(); OPM_WriteString((CHAR*)"/*don`t do it!*/ printf(\"DEMO VERSION: DO NOT USE THIS PROGRAM FOR ANY COMMERCIAL PURPOSE\\n\")", 94); OPC_EndStat(); } OPC_InitImports(OPT_topScope->right); OPC_BegStat(); - if (OPC_mainprog) { + if (__IN(10, OPM_opt, 64)) { OPM_WriteString((CHAR*)"__REGMAIN(\"", 12); } else { OPM_WriteString((CHAR*)"__REGMOD(\"", 11); @@ -1503,7 +1455,7 @@ void OPC_EnterBody (void) void OPC_ExitBody (void) { OPC_BegStat(); - if (OPC_mainprog) { + if (__IN(10, OPM_opt, 64)) { OPM_WriteString((CHAR*)"__FINI;", 8); } else { OPM_WriteString((CHAR*)"__ENDMOD;", 10); @@ -1583,21 +1535,6 @@ void OPC_EnterProc (OPT_Object proc) } var = var->link; } - if (!OPC_ansi) { - var = proc->link; - while (var != NIL) { - if ((var->typ->form == 5 && var->mode == 1)) { - OPC_BegStat(); - OPC_Ident(var->typ->strobj); - OPM_Write(' '); - OPC_Ident(var); - OPM_WriteString((CHAR*)" = _", 5); - OPC_Ident(var); - OPC_EndStat(); - } - var = var->link; - } - } var = proc->link; while (var != NIL) { if ((((__IN(var->typ->comp, 0x0c, 64) && var->mode == 1)) && var->typ->sysflag == 0)) { @@ -1963,11 +1900,7 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim) array = array->BaseTyp; dim -= 1; } - if (OPC_ansi) { - OPM_WriteInt(array->n); - } else { - OPC_IntLiteral(array->n, OPM_AddressSize); - } + OPM_WriteInt(array->n); } } diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index 30f3fd48..ae8e7035 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 391613fb..1b8dca0d 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -36,7 +36,6 @@ static Files_Rider OPM_oldSF, OPM_newSF; static Files_Rider OPM_R[3]; static Files_File OPM_oldSFile, OPM_newSFile, OPM_HFile, OPM_BFile, OPM_HIFile; static int32 OPM_S; -export BOOLEAN OPM_dontAsm, OPM_dontLink, OPM_mainProg, OPM_mainLinkStat, OPM_notColorOutput, OPM_forceNewSym, OPM_Verbose; static CHAR OPM_OBERON[1024]; static CHAR OPM_MODULES[1024]; @@ -137,42 +136,94 @@ int32 OPM_Integer (int64 n) static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) { int32 i; + __DUP(s, s__len, CHAR); i = 1; while (s[__X(i, s__len)] != 0x00) { switch (s[__X(i, s__len)]) { - case 'a': - *opt = *opt ^ 0x80; - break; - case 'c': - *opt = *opt ^ 0x4000; - break; - case 'e': - *opt = *opt ^ 0x0200; - break; - case 'f': - *opt = *opt ^ 0x010000; - break; - case 'k': - *opt = *opt ^ 0x40; - break; - case 'm': - *opt = *opt ^ 0x0400; - break; case 'p': *opt = *opt ^ 0x20; break; + case 'a': + *opt = *opt ^ 0x80; + break; case 'r': *opt = *opt ^ 0x04; break; - case 's': - *opt = *opt ^ 0x10; - break; case 't': *opt = *opt ^ 0x08; break; case 'x': *opt = *opt ^ 0x01; break; + case 'e': + *opt = *opt ^ 0x0200; + break; + case 's': + *opt = *opt ^ 0x10; + break; + case 'F': + *opt = *opt ^ 0x020000; + break; + case 'm': + *opt = *opt ^ 0x0400; + break; + case 'M': + *opt = *opt ^ 0x8000; + break; + case 'S': + *opt = *opt ^ 0x2000; + break; + case 'c': + *opt = *opt ^ 0x4000; + break; + case 'f': + *opt = *opt ^ 0x010000; + break; + case 'V': + *opt = *opt ^ 0x040000; + break; + case 'O': + if (i + 1 >= Strings_Length(s, s__len)) { + OPM_LogWStr((CHAR*)"-O option requires following size model character.", 51); + OPM_LogWLn(); + } else { + switch (s[__X(i + 1, s__len)]) { + case '2': + OPM_ShortintSize = 1; + OPM_IntegerSize = 2; + OPM_LongintSize = 4; + OPM_SetSize = 4; + break; + case 'V': + OPM_ShortintSize = 1; + OPM_IntegerSize = 4; + OPM_LongintSize = 8; + OPM_SetSize = 8; + break; + case 'C': + OPM_ShortintSize = 2; + OPM_IntegerSize = 4; + OPM_LongintSize = 8; + OPM_SetSize = 8; + break; + default: + OPM_LogWStr((CHAR*)"Unrecognised size model character following -O.", 48); + OPM_LogWLn(); + break; + } + i += 1; + } + break; + case 'A': + if (i + 2 >= Strings_Length(s, s__len)) { + OPM_LogWStr((CHAR*)"-M option requires two following digits.", 41); + OPM_LogWLn(); + } else { + OPM_AddressSize = s[__X(i + 1, s__len)] - 48; + OPM_Alignment = s[__X(i + 2, s__len)] - 48; + i += 2; + } + break; case 'B': if (s[__X(i + 1, s__len)] != 0x00) { i += 1; @@ -198,18 +249,6 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) } Files_SetSearchPath((CHAR*)"", 1); break; - case 'F': - *opt = *opt ^ 0x020000; - break; - case 'M': - *opt = *opt ^ 0x8000; - break; - case 'S': - *opt = *opt ^ 0x2000; - break; - case 'V': - *opt = *opt ^ 0x040000; - break; default: OPM_LogWStr((CHAR*)" warning: option ", 19); OPM_LogW('-'); @@ -220,6 +259,7 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) } i += 1; } + __DEL(s); } BOOLEAN OPM_OpenPar (void) @@ -246,33 +286,62 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWStr((CHAR*)"Where options = [\"-\" {option} ].", 33); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" m - generate code for main module", 36); + OPM_LogWStr((CHAR*)" Run time safety", 18); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" M - generate code for main module and link object statically", 63); + OPM_LogWStr((CHAR*)" -p Initialise pointers to NIL.", 37); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" s - generate new symbol file", 31); + OPM_LogWStr((CHAR*)" -a Halt on assertion failures.", 37); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" e - allow extending the module interface", 43); + OPM_LogWStr((CHAR*)" -r Halt on range check failures.", 39); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" r - check value ranges", 25); + OPM_LogWStr((CHAR*)" -t Halt on type guad failure.", 36); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" x - turn off array indices check", 35); + OPM_LogWStr((CHAR*)" -x Halt on index out of range.", 37); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" a - don't check ASSERTs at runtime, use this option in tested production code", 80); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" p - turn off automatic pointer initialization", 48); + OPM_LogWStr((CHAR*)" Symbol file management", 25); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" t - don't check type guards (use in rare cases such as low-level modules where every cycle counts)", 101); + OPM_LogWStr((CHAR*)" -e Allow extension of old symbol file.", 45); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" S - don't call external assembler/compiler, only generate C code", 67); + OPM_LogWStr((CHAR*)" -s Allow generation of new symbol file.", 46); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" c - don't call linker", 24); + OPM_LogWStr((CHAR*)" -F Force generation of new symbol file.", 46); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" f - don't use color output", 29); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" F - force writing new symbol file in current directory", 57); + OPM_LogWStr((CHAR*)" C compiler and linker control", 32); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" V - verbose output", 21); + OPM_LogWStr((CHAR*)" -m This module is main. Link dynamically.", 48); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -M This module is main. Link statically.", 47); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -S Don't call C compiler", 31); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -c Don't link.", 21); + OPM_LogWLn(); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" Miscellaneous", 16); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -f Disable vt100 control characters in status output.", 60); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -V Display compiler debugging messages.", 46); + OPM_LogWLn(); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" Size model for elementary types", 34); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -O2 Original Oberon / Oberon-2: 8 bit SHORTINT, 16 bit INTEGER, 32 bit LONGINT and SET.", 94); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -OC Component Pascal: 16 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET.", 94); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -OV Alternate large model: 8 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET.", 94); + OPM_LogWLn(); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" Target machine address size and alignment", 44); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -A44 32 bit addresses, 32 bit alignment (e.g. Unix/linux 32 bit on x86).", 79); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -A48 32 bit addresses, 64 bit alignment (e.g. Windows 32 bit on x86, linux 32 bit on arm).", 97); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -A88 66 bit addresses, 64 bit alignment (e.g. 64 bit platforms).", 71); OPM_LogWLn(); OPM_LogWLn(); OPM_LogWStr((CHAR*)"Initial options specify defaults for all files.", 48); @@ -287,9 +356,9 @@ BOOLEAN OPM_OpenPar (void) OPM_S = 1; s[0] = 0x00; Platform_GetArg(OPM_S, (void*)s, 256); - OPM_glbopt = 0xe9; + OPM_glbopt = 0xa9; while (s[0] == '-') { - OPM_ScanOptions((void*)s, 256, &OPM_glbopt); + OPM_ScanOptions(s, 256, &OPM_glbopt); OPM_S += 1; s[0] = 0x00; Platform_GetArg(OPM_S, (void*)s, 256); @@ -307,20 +376,14 @@ void OPM_InitOptions (void) s[0] = 0x00; Platform_GetArg(OPM_S, (void*)s, 256); while (s[0] == '-') { - OPM_ScanOptions((void*)s, 256, &OPM_opt); + OPM_ScanOptions(s, 256, &OPM_opt); OPM_S += 1; s[0] = 0x00; Platform_GetArg(OPM_S, (void*)s, 256); } - OPM_dontAsm = __IN(13, OPM_opt, 64); - OPM_dontLink = __IN(14, OPM_opt, 64); - OPM_mainProg = __IN(10, OPM_opt, 64); - OPM_mainLinkStat = __IN(15, OPM_opt, 64); - OPM_notColorOutput = __IN(16, OPM_opt, 64); - OPM_forceNewSym = __IN(17, OPM_opt, 64); - OPM_Verbose = __IN(18, OPM_opt, 64); - if (OPM_mainLinkStat) { + if (__IN(15, OPM_opt, 64)) { OPM_glbopt |= __SETOF(10,64); + OPM_opt |= __SETOF(10,64); } OPM_GetProperties(); } @@ -406,20 +469,20 @@ static void OPM_LogErrMsg (int32 n) int32 i; CHAR buf[1024]; if (n >= 0) { - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 64)) { vt100_SetAttr((CHAR*)"31m", 4); } OPM_LogWStr((CHAR*)" err ", 7); - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 64)) { vt100_SetAttr((CHAR*)"0m", 3); } } else { - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 64)) { vt100_SetAttr((CHAR*)"35m", 4); } OPM_LogWStr((CHAR*)" warning ", 11); n = -n; - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 64)) { vt100_SetAttr((CHAR*)"0m", 3); } } @@ -492,11 +555,11 @@ static void OPM_ShowLine (int64 pos) OPM_LogW(' '); i -= 1; } - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 64)) { vt100_SetAttr((CHAR*)"32m", 4); } OPM_LogW('^'); - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 64)) { vt100_SetAttr((CHAR*)"0m", 3); } Files_Close(f); @@ -679,7 +742,7 @@ static void OPM_GetProperties (void) OPM_MinLReal = -OPM_MaxLReal; OPM_MaxSet = __ASHL(OPM_SetSize, 3) - 1; OPM_MaxIndex = OPM_SignedMaximum(OPM_AddressSize); - if (OPM_Verbose) { + if (__IN(18, OPM_opt, 64)) { OPM_VerboseListSizes(); } } diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index 4a9253cf..e2737249 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPM__h #define OPM__h @@ -15,7 +15,6 @@ import int32 OPM_currFile, OPM_level, OPM_pc, OPM_entno; import CHAR OPM_modName[32]; import CHAR OPM_objname[64]; import SET OPM_opt, OPM_glbopt; -import BOOLEAN OPM_dontAsm, OPM_dontLink, OPM_mainProg, OPM_mainLinkStat, OPM_notColorOutput, OPM_forceNewSym, OPM_Verbose; import void OPM_CloseFiles (void); diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index ff86118c..e9fcba89 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index 9ae7712a..6dd03161 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index c811b3cc..d79e207f 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index 1c9ae6a4..40853589 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index 5fbe3b87..63b773cd 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -1732,10 +1732,7 @@ void OPT_Export (BOOLEAN *ext, BOOLEAN *new) } OPT_OutObj(OPT_topScope->right); *ext = (OPT_sfpresent && OPT_symExtended); - *new = !OPT_sfpresent || OPT_symNew; - if (OPM_forceNewSym) { - *new = 1; - } + *new = (!OPT_sfpresent || OPT_symNew) || __IN(17, OPM_opt, 64); if ((((OPM_noerr && OPT_sfpresent)) && OPT_impCtxt.reffp != OPT_expCtxt.reffp)) { *new = 1; if (!OPT_extsf) { diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 66686a2c..0cc86a01 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 965f7b61..8026831f 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -16,7 +16,6 @@ typedef } OPV_ExitInfo; -static BOOLEAN OPV_assert, OPV_inxchk, OPV_mainprog, OPV_ansi; static int32 OPV_stamp; static int64 OPV_recno; static OPV_ExitInfo OPV_exit; @@ -130,10 +129,6 @@ void OPV_Init (void) OPV_stamp = 0; OPV_recno = 0; OPV_nofExitLabels = 0; - OPV_assert = __IN(7, OPM_opt, 64); - OPV_inxchk = __IN(0, OPM_opt, 64); - OPV_mainprog = __IN(10, OPM_opt, 64); - OPV_ansi = __IN(6, OPM_opt, 64); } static void OPV_GetTProcNum (OPT_Object obj) @@ -532,7 +527,7 @@ static void OPV_TypeOf (OPT_Node n) static void OPV_Index (OPT_Node n, OPT_Node d, int32 prec, int32 dim) { - if (!OPV_inxchk || (n->right->class == 7 && (n->right->conval->intval == 0 || n->left->typ->comp != 3))) { + if (!__IN(0, OPM_opt, 64) || (n->right->class == 7 && (n->right->conval->intval == 0 || n->left->typ->comp != 3))) { OPV_expr(n->right, prec); } else { if (OPV_SideEffects(n->right)) { @@ -728,11 +723,7 @@ static void OPV_design (OPT_Node n, int32 prec) static void OPV_ParIntLiteral (int64 n, int64 size) { - if (OPV_ansi) { - OPM_WriteInt(n); - } else { - OPC_IntLiteral(n, size); - } + OPM_WriteInt(n); } static void OPV_ActualPar (OPT_Node n, OPT_Object fp) @@ -754,26 +745,19 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) } if (!__IN(n->typ->comp, 0x0c, 64)) { if (mode == 2) { - if ((OPV_ansi && typ != n->typ)) { + if (typ != n->typ) { OPM_WriteString((CHAR*)"(void*)", 8); } OPM_Write('&'); prec = 9; - } else if (OPV_ansi) { + } else { if ((__IN(comp, 0x0c, 64) && n->class == 7)) { OPM_WriteString((CHAR*)"(CHAR*)", 8); } else if ((((form == 11 && typ != n->typ)) && n->typ != OPT_niltyp)) { OPM_WriteString((CHAR*)"(void*)", 8); } - } else { - if ((__IN(form, 0x60, 64) && n->typ->form == 4)) { - OPM_WriteString((CHAR*)"(double)", 9); - prec = 9; - } else if (form == 4) { - OPV_SizeCast(n->typ->size, typ->size); - } } - } else if (OPV_ansi) { + } else { if ((((mode == 2 && typ != n->typ)) && prec == -1)) { OPM_WriteString((CHAR*)"(void*)", 8); } @@ -1532,7 +1516,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) case 20: if (n->subcl != 32) { OPV_IfStat(n, 0, outerProc); - } else if (OPV_assert) { + } else if (__IN(7, OPM_opt, 64)) { OPM_WriteString((CHAR*)"__ASSERT(", 10); OPV_expr(n->left->left->left, -1); OPM_WriteString((CHAR*)", ", 3); @@ -1598,7 +1582,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) break; case 26: if (OPM_level == 0) { - if (OPV_mainprog) { + if (__IN(10, OPM_opt, 64)) { OPM_WriteString((CHAR*)"__FINI", 7); } else { OPM_WriteString((CHAR*)"__ENDMOD", 9); @@ -1643,7 +1627,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) void OPV_Module (OPT_Node prog) { - if (!OPV_mainprog) { + if (!__IN(10, OPM_opt, 64)) { OPC_GenHdr(prog->right); OPC_GenHdrIncludes(); } diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index f78267d0..a89aa61a 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 0093f826..0a24d4e9 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index 7faaa2a6..0c4c2127 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index e9e84723..f2623b03 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index 116d9c93..05b31bee 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index 8dc35935..4226bdb9 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index 0487b70c..b13ba079 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index 54254c51..4cdaa6b9 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index 40d02918..10d0a9bb 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/Vishap.c b/bootstrap/windows-88/Vishap.c index 7cd188f2..e1d112ec 100644 --- a/bootstrap/windows-88/Vishap.c +++ b/bootstrap/windows-88/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspamSf */ #define INTEGER int32 #define LONGINT int64 @@ -42,22 +42,22 @@ void Vishap_Module (BOOLEAN *done) OPC_Init(); OPV_Module(p); if (OPM_noerr) { - if (((OPM_mainProg || OPM_mainLinkStat) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { + if ((__IN(10, OPM_opt, 64) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { OPM_DeleteNewSym(); - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 64)) { vt100_SetAttr((CHAR*)"32m", 4); } OPM_LogWStr((CHAR*)" Main program.", 16); - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 64)) { vt100_SetAttr((CHAR*)"0m", 3); } } else { if (new) { - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 64)) { vt100_SetAttr((CHAR*)"32m", 4); } OPM_LogWStr((CHAR*)" New symbol file.", 19); - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 64)) { vt100_SetAttr((CHAR*)"0m", 3); } OPM_RegisterNewSym(); @@ -111,17 +111,17 @@ void Vishap_Translate (void) OPM_LogWLn(); Platform_Exit(1); } - if (!OPM_dontAsm) { - if (OPM_dontLink) { + if (!__IN(13, OPM_opt, 64)) { + if (__IN(14, OPM_opt, 64)) { extTools_Assemble(OPM_modName, 32); } else { - if (!(OPM_mainProg || OPM_mainLinkStat)) { + if (!__IN(10, OPM_opt, 64)) { extTools_Assemble(OPM_modName, 32); Strings_Append((CHAR*)" ", 2, (void*)modulesobj, 2048); Strings_Append(OPM_modName, 32, (void*)modulesobj, 2048); Strings_Append((CHAR*)".o", 3, (void*)modulesobj, 2048); } else { - extTools_LinkMain((void*)OPM_modName, 32, OPM_mainLinkStat, modulesobj, 2048); + extTools_LinkMain((void*)OPM_modName, 32, __IN(15, OPM_opt, 64), modulesobj, 2048); } } } diff --git a/bootstrap/windows-88/errors.c b/bootstrap/windows-88/errors.c index 04b9504d..ca898552 100644 --- a/bootstrap/windows-88/errors.c +++ b/bootstrap/windows-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/errors.h b/bootstrap/windows-88/errors.h index 99f4c6b0..d574008d 100644 --- a/bootstrap/windows-88/errors.h +++ b/bootstrap/windows-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index 2eef1f18..db3aec30 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -25,7 +25,7 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN int32 r, status, exitcode; __DUP(title, title__len, CHAR); __DUP(cmd, cmd__len, CHAR); - if (OPM_Verbose) { + if (__IN(18, OPM_opt, 64)) { Console_String(title, title__len); Console_String(cmd, cmd__len); Console_Ln(); diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index d4f0c474..847e440e 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/vt100.c b/bootstrap/windows-88/vt100.c index 3b56b4b1..ac832261 100644 --- a/bootstrap/windows-88/vt100.c +++ b/bootstrap/windows-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/vt100.h b/bootstrap/windows-88/vt100.h index b574976e..054f6ddd 100644 --- a/bootstrap/windows-88/vt100.h +++ b/bootstrap/windows-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/src/compiler/OPB.Mod b/src/compiler/OPB.Mod index 6fc81fe1..32520266 100644 --- a/src/compiler/OPB.Mod +++ b/src/compiler/OPB.Mod @@ -830,11 +830,11 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) g: INTEGER; (* expression (source) form *) p, q: OPT.Struct; BEGIN - IF OPM.Verbose THEN + IF OPM.verbose IN OPM.opt THEN OPM.LogWLn; OPM.LogWStr("PROCEDURE CheckAssign"); OPM.LogWLn; END; y := ynode^.typ; f := x^.form; g := y^.form; - IF OPM.Verbose THEN + IF OPM.verbose IN OPM.opt THEN OPM.LogWStr("y.form = "); OPM.LogWNum(y.form, 0); OPM.LogWLn; OPM.LogWStr("f = "); OPM.LogWNum(f, 0); OPM.LogWLn; OPM.LogWStr("g = "); OPM.LogWNum(g, 0); OPM.LogWLn; diff --git a/src/compiler/OPC.Mod b/src/compiler/OPC.Mod index bc84b8ad..29b8c302 100644 --- a/src/compiler/OPC.Mod +++ b/src/compiler/OPC.Mod @@ -38,7 +38,6 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) VAR indentLevel: INTEGER; - ptrinit, mainprog, ansi: BOOLEAN; hashtab: ARRAY 105 OF SHORTINT; keytab: ARRAY 50, 9 OF CHAR; GlbPtrs: BOOLEAN; @@ -48,11 +47,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) PROCEDURE Init*; BEGIN indentLevel := 0; - ptrinit := OPM.ptrinit IN OPM.opt; - (*mainprog := OPM.mainprog IN OPM.opt;*) - mainprog := OPM.mainProg OR OPM.mainLinkStat; - ansi := OPM.ansi IN OPM.opt; - IF ansi THEN BodyNameExt := "__init(void)" ELSE BodyNameExt := "__init()" END + BodyNameExt := "__init(void)" END Init; PROCEDURE Indent* (count: INTEGER); @@ -189,9 +184,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) ELSIF (form = OPT.ProcTyp) OR (comp IN {OPT.Array, OPT.DynArr}) THEN IF openClause THEN OPM.Write(')'); openClause := FALSE END ; IF form = OPT.ProcTyp THEN - IF ansi THEN OPM.Write(")"); AnsiParamList(typ^.link, FALSE) - ELSE OPM.WriteString(")()") - END ; + OPM.Write(")"); AnsiParamList(typ^.link, FALSE); EXIT ELSIF comp = OPT.Array THEN OPM.Write('['); OPM.WriteInt(typ^.n); OPM.Write(']') @@ -373,9 +366,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) VAR par: OPT.Object; BEGIN IF obj^.typ # OPT.notyp THEN DefineType(obj^.typ) END ; - IF ansi THEN par := obj^.link; - WHILE par # NIL DO DefineType(par^.typ); par := par^.link END - END + par := obj^.link; WHILE par # NIL DO DefineType(par^.typ); par := par^.link END END DefineTProcTypes; PROCEDURE DeclareTProcs(obj: OPT.Object; VAR empty: BOOLEAN); @@ -428,11 +419,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) Str1(", #, ", obj^.adr DIV 10000H); IF obj^.typ = OPT.notyp THEN OPM.WriteString('void') ELSE Ident(obj^.typ^.strobj) END ; OPM.WriteString("(*)"); - IF ansi THEN - AnsiParamList(obj^.link, FALSE); - ELSE - OPM.WriteString("()"); - END ; + AnsiParamList(obj^.link, FALSE); OPM.WriteString(", "); DeclareParams(obj^.link, TRUE); OPM.Write(")"); OPM.WriteLn @@ -713,7 +700,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) EndStat; BegStat; OPM.WriteString("LONGINT *"); Ident(obj); OPM.WriteString(TagExt); base := NIL - ELSIF ptrinit & (vis = 0) & (obj^.mnolev > 0) & (obj^.typ^.form = OPT.Pointer) THEN + ELSIF (OPM.ptrinit IN OPM.opt) & (vis = 0) & (obj^.mnolev > 0) & (obj^.typ^.form = OPT.Pointer) THEN OPM.WriteString(" = NIL") END END ; @@ -754,16 +741,9 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) BEGIN IF proc^.typ = OPT.notyp THEN OPM.WriteString('void') ELSE Ident(proc^.typ^.strobj) END ; OPM.Write(' '); Ident(proc); OPM.Write(' '); - IF ansi THEN - AnsiParamList(proc^.link, TRUE); - IF ~define THEN OPM.Write(";") END ; - OPM.WriteLn; - ELSIF define THEN - DeclareParams(proc^.link, FALSE); - OPM.WriteLn; - Indent(1); IdentList(proc^.link, 2(* map REAL to double *)); Indent(-1) - ELSE OPM.WriteString("();"); OPM.WriteLn - END + AnsiParamList(proc^.link, TRUE); + IF ~define THEN OPM.Write(";") END ; + OPM.WriteLn END ProcHeader; PROCEDURE ProcPredefs (obj: OPT.Object; vis: SHORTINT); (* forward declaration of procedures *) @@ -846,7 +826,6 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) | OPM.typchk: OPM.Write("t") | OPM.newsf: OPM.Write("s") | OPM.ptrinit: OPM.Write("p") - | OPM.ansi: OPM.Write("k") | OPM.assert: OPM.Write("a") | OPM.extsf: OPM.Write("e") | OPM.mainprog: OPM.Write("m") @@ -932,14 +911,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) typ := var^.typ; IF NofPtrs(typ) > 0 THEN IF ~GlbPtrs THEN GlbPtrs := TRUE; - OPM.WriteString('static '); - IF ansi THEN - OPM.WriteString("void EnumPtrs(void (*P)(void*))") - ELSE - OPM.WriteString("void EnumPtrs(P)"); OPM.WriteLn; - OPM.Write(Tab); OPM.WriteString("void (*P)();"); - END ; - OPM.WriteLn; + OPM.WriteString("static void EnumPtrs(void (*P)(void*))"); OPM.WriteLn; BegBlk END ; BegStat; @@ -970,27 +942,22 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) PROCEDURE EnterBody*; BEGIN OPM.WriteLn; OPM.WriteString(Export); - IF mainprog THEN - IF ansi THEN - OPM.WriteString("int main(int argc, char **argv)"); OPM.WriteLn; - ELSE - OPM.WriteString("main(argc, argv)"); OPM.WriteLn; - OPM.Write(Tab); OPM.WriteString("int argc; char **argv;"); OPM.WriteLn - END + IF OPM.mainprog IN OPM.opt THEN + OPM.WriteString("int main(int argc, char **argv)"); OPM.WriteLn; ELSE OPM.WriteString("void *"); OPM.WriteString(OPM.modName); OPM.WriteString(BodyNameExt); OPM.WriteLn; END ; BegBlk; BegStat; - IF mainprog THEN OPM.WriteString("__INIT(argc, argv)") ELSE OPM.WriteString("__DEFMOD") END ; + IF OPM.mainprog IN OPM.opt THEN OPM.WriteString("__INIT(argc, argv)") ELSE OPM.WriteString("__DEFMOD") END ; EndStat; - IF mainprog & demoVersion THEN BegStat; + IF (OPM.mainprog IN OPM.opt) & demoVersion THEN BegStat; OPM.WriteString('/*don`t do it!*/ printf("DEMO VERSION: DO NOT USE THIS PROGRAM FOR ANY COMMERCIAL PURPOSE\n")'); EndStat END ; InitImports(OPT.topScope^.right); BegStat; - IF mainprog THEN OPM.WriteString('__REGMAIN("') ELSE OPM.WriteString('__REGMOD("') END ; + IF OPM.mainprog IN OPM.opt THEN OPM.WriteString('__REGMAIN("') ELSE OPM.WriteString('__REGMOD("') END ; OPM.WriteString(OPM.modName); IF GlbPtrs THEN OPM.WriteString('", EnumPtrs)') ELSE OPM.WriteString('", 0)') END ; EndStat; @@ -1000,7 +967,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) PROCEDURE ExitBody*; BEGIN BegStat; - IF mainprog THEN OPM.WriteString("__FINI;") ELSE OPM.WriteString("__ENDMOD;") END ; + IF OPM.mainprog IN OPM.opt THEN OPM.WriteString("__FINI;") ELSE OPM.WriteString("__ENDMOD;") END ; OPM.WriteLn; EndBlk END ExitBody; @@ -1052,17 +1019,6 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) END ; var := var^.link END ; - IF ~ansi THEN - var := proc^.link; - WHILE var # NIL DO (* "unpromote" value real parameters *) - IF (var^.typ^.form = OPT.Real) & (var^.mode = OPT.Var) THEN - BegStat; - Ident(var^.typ^.strobj); OPM.Write(' '); Ident(var); OPM.WriteString(" = _"); Ident(var); - EndStat - END ; - var := var^.link - END - END ; var := proc^.link; WHILE var # NIL DO (* copy value array parameters *) IF (var^.typ^.comp IN {OPT.Array, OPT.DynArr}) & (var^.mode = OPT.Var) & (var^.typ^.sysflag = 0) THEN @@ -1303,7 +1259,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) IF dim # 0 THEN OPM.WriteInt(dim) END ELSE (* array *) WHILE dim > 0 DO array := array^.BaseTyp; DEC(dim) END; - IF ansi THEN OPM.WriteInt(array.n) ELSE IntLiteral(array.n, OPM.AddressSize) END + OPM.WriteInt(array.n) END END Len; diff --git a/src/compiler/OPM.cmdln.Mod b/src/compiler/OPM.cmdln.Mod index 952ea9e5..33965ece 100644 --- a/src/compiler/OPM.cmdln.Mod +++ b/src/compiler/OPM.cmdln.Mod @@ -15,7 +15,6 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) typchk* = 3; (* type check on *) newsf* = 4; (* generation of new symbol file allowed *) ptrinit* = 5; (* pointer initialization *) - ansi* = 6; (* ANSI or K&R style prototypes *) assert* = 7; (* assert evaluation *) extsf* = 9; (* extension of old symbol file allowed *) mainprog* = 10; (* translate module body into C main function *) @@ -25,7 +24,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) notcoloroutput* = 16; (* turn off color output *) forcenewsym* = 17; (* force new symbol file *) verbose* = 18; (* verbose *) - defopt* = {inxchk, typchk, ptrinit, ansi, assert}; (* default options *) + defopt* = {inxchk, typchk, ptrinit, assert}; (* default options *) nilval* = 0; @@ -122,8 +121,6 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) S: INTEGER; - dontAsm-, dontLink-, mainProg-, mainLinkStat-, notColorOutput-, forceNewSym-, Verbose-: BOOLEAN; - OBERON: ARRAY 1024 OF CHAR; MODULES: ARRAY 1024 OF CHAR; @@ -143,25 +140,53 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) (* ------------------------- parameter handling -------------------------*) - PROCEDURE ScanOptions(VAR s: ARRAY OF CHAR; VAR opt: SET); + PROCEDURE ScanOptions(s: ARRAY OF CHAR; VAR opt: SET); VAR i: INTEGER; BEGIN i := 1; (* skip - *) WHILE s[i] # 0X DO CASE s[i] OF - | "a": opt := opt / {assert} - | "c": opt := opt / {dontlink} - | "e": opt := opt / {extsf} - | "f": opt := opt / {notcoloroutput} - | "k": opt := opt / {ansi} (* undocumented *) - | "m": opt := opt / {mainprog} - | "p": opt := opt / {ptrinit} - | "r": opt := opt / {ranchk} - | "s": opt := opt / {newsf} - | "t": opt := opt / {typchk} - | "x": opt := opt / {inxchk} + (* Run time safety *) + | "p": opt := opt / {ptrinit} (* Initialise pointers to NIL. *) + | "a": opt := opt / {assert} (* Halt on assertion failures. *) + | "r": opt := opt / {ranchk} (* Halt on range check failures. *) + | "t": opt := opt / {typchk} (* Halt on type guad failure. *) + | "x": opt := opt / {inxchk} (* Halt on index out of range. *) + (* Symbol file management *) + | "e": opt := opt / {extsf} (* Allow extension of old symbol file. *) + | "s": opt := opt / {newsf} (* Allow generation of new symbol file. *) + | "F": opt := opt / {forcenewsym} (* Force generation of new symbol file. *) + + (* C compiler and linker control *) + | "m": opt := opt / {mainprog} (* This module is main. Link dynamically. *) + | "M": opt := opt / {mainlinkstat} (* This module is main. Link statically. *) + | "S": opt := opt / {dontasm} (* Don't call C compiler *) + | "c": opt := opt / {dontlink} (* Don't link. *) + + (* Miscellaneous *) + | "f": opt := opt / {notcoloroutput} (* Disable vt100 control characters in status output. *) + | "V": opt := opt / {verbose} + + (* Elementary type size model *) + | "O": IF i+1 >= Strings.Length(s) THEN LogWStr("-O option requires following size model character."); LogWLn ELSE + CASE s[i+1] OF + |'2': ShortintSize := 1; IntegerSize := 2; LongintSize := 4; SetSize := 4 (* Original Oberon / Oberon 2 *) + |'V': ShortintSize := 1; IntegerSize := 4; LongintSize := 8; SetSize := 8 (* Vishap 64 bit *) + |'C': ShortintSize := 2; IntegerSize := 4; LongintSize := 8; SetSize := 8 (* Component Pascal *) + ELSE LogWStr("Unrecognised size model character following -O."); LogWLn + END; + INC(i) + END + + (* Target machine address size and alignment *) + | "A": IF i+2 >= Strings.Length(s) THEN LogWStr("-M option requires two following digits."); LogWLn ELSE + AddressSize := ORD(s[i+1]) - ORD('0'); Alignment := ORD(s[i+2]) - ORD('0'); + INC(i, 2) + END + + (* Temporary build control option - remove when makefile updated to new options. *) | "B": IF s[i+1] # 0X THEN INC(i); IntegerSize := ORD(s[i]) - ORD('0') END; IF s[i+1] # 0X THEN INC(i); AddressSize := ORD(s[i]) - ORD('0') END; IF s[i+1] # 0X THEN INC(i); Alignment := ORD(s[i]) - ORD('0') END; @@ -176,11 +201,6 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) SetSize := 8; END; Files.SetSearchPath("") - - | "F": opt := opt / {forcenewsym} - | "M": opt := opt / {mainlinkstat} - | "S": opt := opt / {dontasm} - | "V": opt := opt / {verbose} ELSE LogWStr(" warning: option "); LogW(OptionChar); @@ -223,20 +243,37 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) LogWStr(' '); LogWStr(Configuration.name); LogWStr(' options {files {options}}.'); LogWLn; LogWLn; LogWStr('Where options = ["-" {option} ].'); LogWLn; LogWLn; - LogWStr(" m - generate code for main module"); LogWLn; - LogWStr(" M - generate code for main module and link object statically"); LogWLn; - LogWStr(" s - generate new symbol file"); LogWLn; - LogWStr(" e - allow extending the module interface"); LogWLn; - LogWStr(" r - check value ranges"); LogWLn; - LogWStr(" x - turn off array indices check"); LogWLn; - LogWStr(" a - don't check ASSERTs at runtime, use this option in tested production code"); LogWLn; - LogWStr(" p - turn off automatic pointer initialization"); LogWLn; - LogWStr(" t - don't check type guards (use in rare cases such as low-level modules where every cycle counts)"); LogWLn; - LogWStr(" S - don't call external assembler/compiler, only generate C code"); LogWLn; - LogWStr(" c - don't call linker"); LogWLn; - LogWStr(" f - don't use color output"); LogWLn; - LogWStr(" F - force writing new symbol file in current directory"); LogWLn; - LogWStr(" V - verbose output"); LogWLn; + LogWStr(" Run time safety"); LogWLn; + LogWStr(" -p Initialise pointers to NIL."); LogWLn; + LogWStr(" -a Halt on assertion failures."); LogWLn; + LogWStr(" -r Halt on range check failures."); LogWLn; + LogWStr(" -t Halt on type guad failure."); LogWLn; + LogWStr(" -x Halt on index out of range."); LogWLn; + LogWLn; + LogWStr(" Symbol file management"); LogWLn; + LogWStr(" -e Allow extension of old symbol file."); LogWLn; + LogWStr(" -s Allow generation of new symbol file."); LogWLn; + LogWStr(" -F Force generation of new symbol file."); LogWLn; + LogWLn; + LogWStr(" C compiler and linker control"); LogWLn; + LogWStr(" -m This module is main. Link dynamically."); LogWLn; + LogWStr(" -M This module is main. Link statically."); LogWLn; + LogWStr(" -S Don't call C compiler"); LogWLn; + LogWStr(" -c Don't link."); LogWLn; + LogWLn; + LogWStr(" Miscellaneous"); LogWLn; + LogWStr(" -f Disable vt100 control characters in status output."); LogWLn; + LogWStr(" -V Display compiler debugging messages."); LogWLn; + LogWLn; + LogWStr(" Size model for elementary types"); LogWLn; + LogWStr(" -O2 Original Oberon / Oberon-2: 8 bit SHORTINT, 16 bit INTEGER, 32 bit LONGINT and SET."); LogWLn; + LogWStr(" -OC Component Pascal: 16 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET."); LogWLn; + LogWStr(" -OV Alternate large model: 8 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET."); LogWLn; + LogWLn; + LogWStr(" Target machine address size and alignment"); LogWLn; + LogWStr(" -A44 32 bit addresses, 32 bit alignment (e.g. Unix/linux 32 bit on x86)."); LogWLn; + LogWStr(" -A48 32 bit addresses, 64 bit alignment (e.g. Windows 32 bit on x86, linux 32 bit on arm)."); LogWLn; + LogWStr(" -A88 66 bit addresses, 64 bit alignment (e.g. 64 bit platforms)."); LogWLn; LogWLn; LogWStr('Initial options specify defaults for all files.'); LogWLn; LogWStr('Options following a filename are specific to that file.'); LogWLn; @@ -267,6 +304,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) INC(S); s:=""; Platform.GetArg(S, s) END; + (* dontAsm := dontasm IN opt; dontLink := dontlink IN opt; mainProg := mainprog IN opt; @@ -274,8 +312,9 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) notColorOutput := notcoloroutput IN opt; forceNewSym := forcenewsym IN opt; Verbose := verbose IN opt; + *) - IF mainLinkStat THEN INCL(glbopt, mainprog) END; (* sic *) + IF mainlinkstat IN opt THEN INCL(glbopt, mainprog); INCL(opt, mainprog) END; GetProperties; END InitOptions; @@ -346,13 +385,13 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) buf: ARRAY 1024 OF CHAR; BEGIN IF n >= 0 THEN - IF ~notColorOutput THEN vt100.SetAttr(vt100.Red) END; + IF ~(notcoloroutput IN opt) THEN vt100.SetAttr(vt100.Red) END; LogWStr(" err "); - IF ~notColorOutput THEN vt100.SetAttr(vt100.ResetAll) END; + IF ~(notcoloroutput IN opt) THEN vt100.SetAttr(vt100.ResetAll) END; ELSE - IF ~notColorOutput THEN vt100.SetAttr(vt100.Magenta) END; + IF ~(notcoloroutput IN opt) THEN vt100.SetAttr(vt100.Magenta) END; LogWStr(" warning "); n := -n; - IF ~notColorOutput THEN vt100.SetAttr(vt100.ResetAll) END; + IF ~(notcoloroutput IN opt) THEN vt100.SetAttr(vt100.ResetAll) END; END ; LogWNum(n, 1); LogWStr(" "); @@ -425,9 +464,9 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) i := SHORT(Longint(pos - ErrorLineStartPos)); WHILE i > 0 DO LogW(" "); DEC(i) END; - IF ~notColorOutput THEN vt100.SetAttr(vt100.Green) END; + IF ~(notcoloroutput IN opt) THEN vt100.SetAttr(vt100.Green) END; LogW("^"); - IF ~notColorOutput THEN vt100.SetAttr(vt100.ResetAll) END; + IF ~(notcoloroutput IN opt) THEN vt100.SetAttr(vt100.ResetAll) END; Files.Close(f); END ShowLine; @@ -604,7 +643,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) MaxSet := SetSize * 8 - 1; MaxIndex := SignedMaximum(AddressSize); - IF Verbose THEN VerboseListSizes END; + IF verbose IN opt THEN VerboseListSizes END; END GetProperties; (* ------------------------- Read Symbol File ------------------------- *) diff --git a/src/compiler/OPT.Mod b/src/compiler/OPT.Mod index 6793a233..7648fcec 100644 --- a/src/compiler/OPT.Mod +++ b/src/compiler/OPT.Mod @@ -1143,10 +1143,8 @@ END Import; expCtxt.nofm := 1; expCtxt.locmno[0] := 0; i := 1; WHILE i < maxImps DO expCtxt.locmno[i] := -1; INC(i) END; OutObj(topScope^.right); - ext := sfpresent & symExtended; new := ~sfpresent OR symNew; - IF OPM.forceNewSym THEN - new := TRUE - END; (* for bootstrapping -- noch *) + ext := sfpresent & symExtended; + new := ~sfpresent OR symNew OR (OPM.forcenewsym IN OPM.opt); IF OPM.noerr & sfpresent & (impCtxt.reffp # expCtxt.reffp) THEN new := TRUE; IF ~extsf THEN err(155) END diff --git a/src/compiler/OPV.Mod b/src/compiler/OPV.Mod index 7c7e7464..04da5f09 100644 --- a/src/compiler/OPV.Mod +++ b/src/compiler/OPV.Mod @@ -46,7 +46,6 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 VAR - assert, inxchk, mainprog, ansi: BOOLEAN; stamp: INTEGER; (* unique number for nested objects *) recno: LONGINT; (* number of anonymous record types *) @@ -104,10 +103,6 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 PROCEDURE Init*; BEGIN stamp := 0; recno := 0; nofExitLabels := 0; - assert := OPM.assert IN OPM.opt; - inxchk := OPM.inxchk IN OPM.opt; - mainprog := OPM.mainprog IN OPM.opt; - ansi := OPM.ansi IN OPM.opt END Init; PROCEDURE ^Traverse (obj, outerScope: OPT.Object; exported: BOOLEAN); @@ -333,7 +328,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 PROCEDURE Index(n, d: OPT.Node; prec, dim: INTEGER); BEGIN - IF ~inxchk + IF ~(OPM.inxchk IN OPM.opt) OR (n^.right^.class = OPT.Nconst) & ((n^.right^.conval^.intval = 0) OR (n^.left^.typ^.comp # OPT.DynArr)) THEN expr(n^.right, prec) ELSE @@ -434,7 +429,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 PROCEDURE ParIntLiteral(n: SYSTEM.INT64; size: LONGINT); BEGIN (* Literal parameters (other than varargs) do not need an explicit size cast on ansi C compilers. *) - IF ansi THEN OPM.WriteInt(n) ELSE OPC.IntLiteral(n, size) END + OPM.WriteInt(n) END ParIntLiteral; PROCEDURE ActualPar(n: OPT.Node; fp: OPT.Object); @@ -448,22 +443,16 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 END ; IF ~(n^.typ^.comp IN {OPT.Array, OPT.DynArr}) THEN IF mode = OPT.VarPar THEN - IF ansi & (typ # n^.typ) THEN OPM.WriteString("(void*)") END ; + IF typ # n^.typ THEN OPM.WriteString("(void*)") END; OPM.Write("&"); prec := 9 - ELSIF ansi THEN + ELSE IF (comp IN {OPT.Array, OPT.DynArr}) & (n^.class = OPT.Nconst) THEN OPM.WriteString("(CHAR*)") (* force to unsigned char *) ELSIF (form = OPT.Pointer) & (typ # n^.typ) & (n^.typ # OPT.niltyp) THEN OPM.WriteString("(void*)") (* type extension *) END - ELSE - IF (form IN {OPT.Real, OPT.LReal}) & (n^.typ^.form = OPT.Int) THEN (* real promotion *) - OPM.WriteString("(double)"); prec := 9 - ELSIF form = OPT.Int THEN - SizeCast(n.typ.size, typ.size) - END END - ELSIF ansi THEN + ELSE (* casting of params should be simplified eventually *) IF (mode = OPT.VarPar) & (typ # n^.typ) & (prec = MinPrec) THEN OPM.WriteString("(void*)") END END; @@ -903,7 +892,8 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 END ; ActualPar(n^.right, n^.obj) | OPT.Nifelse: IF n^.subcl # OPT.assertfn THEN IfStat(n, FALSE, outerProc) - ELSIF assert THEN OPM.WriteString("__ASSERT("); expr(n^.left^.left^.left, MinPrec); OPM.WriteString(Comma); + ELSIF OPM.assert IN OPM.opt THEN + OPM.WriteString("__ASSERT("); expr(n^.left^.left^.left, MinPrec); OPM.WriteString(Comma); OPM.WriteInt(n^.left^.right^.right^.conval^.intval); OPM.Write(CloseParen); OPC.EndStat END | OPT.Ncase: INC(exit.level); CaseStat(n, outerProc); DEC(exit.level) @@ -925,7 +915,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 OPM.WriteString("goto exit__"); OPM.WriteInt(exit.label) END | OPT.Nreturn: IF OPM.level = 0 THEN - IF mainprog THEN OPM.WriteString("__FINI") ELSE OPM.WriteString("__ENDMOD") END + IF OPM.mainprog IN OPM.opt THEN OPM.WriteString("__FINI") ELSE OPM.WriteString("__ENDMOD") END ELSE IF n^.left # NIL THEN (* Make local copy of result before ExitProc deletes dynamic vars *) @@ -953,7 +943,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 PROCEDURE Module*(prog: OPT.Node); BEGIN - IF ~mainprog THEN OPC.GenHdr(prog^.right); OPC.GenHdrIncludes END ; + IF ~(OPM.mainprog IN OPM.opt) THEN OPC.GenHdr(prog^.right); OPC.GenHdrIncludes END ; OPC.GenBdy(prog^.right); stat(prog, NIL) END Module; diff --git a/src/compiler/Vishap.Mod b/src/compiler/Vishap.Mod index c4b06e9c..b6ca8bf2 100644 --- a/src/compiler/Vishap.Mod +++ b/src/compiler/Vishap.Mod @@ -22,16 +22,16 @@ MODULE Vishap; (* J. Templ 3.2.95 *) OPC.Init; OPV.Module(p); IF OPM.noerr THEN - IF (OPM.mainProg OR OPM.mainLinkStat) & (OPM.modName # "SYSTEM") THEN + IF (OPM.mainprog IN OPM.opt) & (OPM.modName # "SYSTEM") THEN OPM.DeleteNewSym; - IF ~OPM.notColorOutput THEN vt100.SetAttr(vt100.Green) END; + IF ~(OPM.notcoloroutput IN OPM.opt) THEN vt100.SetAttr(vt100.Green) END; OPM.LogWStr(" Main program."); - IF ~OPM.notColorOutput THEN vt100.SetAttr(vt100.ResetAll) END; + IF ~(OPM.notcoloroutput IN OPM.opt) THEN vt100.SetAttr(vt100.ResetAll) END; ELSE IF new THEN - IF ~OPM.notColorOutput THEN vt100.SetAttr(vt100.Green) END; + IF ~(OPM.notcoloroutput IN OPM.opt) THEN vt100.SetAttr(vt100.Green) END; OPM.LogWStr(" New symbol file."); - IF ~OPM.notColorOutput THEN vt100.SetAttr(vt100.ResetAll) END; + IF ~(OPM.notcoloroutput IN OPM.opt) THEN vt100.SetAttr(vt100.ResetAll) END; OPM.RegisterNewSym ELSIF ext THEN OPM.LogWStr(" Extended symbol file."); @@ -90,12 +90,12 @@ MODULE Vishap; (* J. Templ 3.2.95 *) END; (* 'assemble' (i.e. c compile) .c to object or executable. *) - IF ~OPM.dontAsm THEN - IF OPM.dontLink THEN + IF ~(OPM.dontasm IN OPM.opt) THEN + IF OPM.dontlink IN OPM.opt THEN (* If not linking, just assemble each module. *) extTools.Assemble(OPM.modName) ELSE - IF ~(OPM.mainProg OR OPM.mainLinkStat) THEN + IF ~(OPM.mainprog IN OPM.opt) THEN (* Assemble non main rogram and add object name to link list *) extTools.Assemble(OPM.modName); Strings.Append(" ", modulesobj); @@ -103,7 +103,7 @@ MODULE Vishap; (* J. Templ 3.2.95 *) Strings.Append(Configuration.objext, modulesobj) ELSE (* Assemble and link main program *) - extTools.LinkMain (OPM.modName, OPM.mainLinkStat, modulesobj) + extTools.LinkMain(OPM.modName, OPM.mainlinkstat IN OPM.opt, modulesobj) END END END diff --git a/src/compiler/extTools.Mod b/src/compiler/extTools.Mod index 515c13e4..22752d9b 100644 --- a/src/compiler/extTools.Mod +++ b/src/compiler/extTools.Mod @@ -8,7 +8,9 @@ VAR compilationOptions, CFLAGS: ARRAY 1023 OF CHAR; PROCEDURE execute(title: ARRAY OF CHAR; cmd: ARRAY OF CHAR); VAR r, status, exitcode: INTEGER; BEGIN - IF OPM.Verbose THEN Console.String(title); Console.String(cmd); Console.Ln END; + IF OPM.verbose IN OPM.opt THEN + Console.String(title); Console.String(cmd); Console.Ln + END; r := Platform.System(cmd); status := r MOD 128; exitcode := r DIV 256; From 246a961055ecf3cb3f38858210c0204dd700c13d Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 22 Sep 2016 15:03:08 +0100 Subject: [PATCH 242/580] Tidy OPM, update usage display. --- bootstrap/unix-44/Configuration.c | 4 +- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Console.c | 2 +- bootstrap/unix-44/Console.h | 2 +- bootstrap/unix-44/Files.c | 2 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 2 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 2 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 28 +++++----- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 2 +- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 2 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/Vishap.c | 2 +- bootstrap/unix-44/errors.c | 2 +- bootstrap/unix-44/errors.h | 2 +- bootstrap/unix-44/extTools.c | 2 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-44/vt100.c | 2 +- bootstrap/unix-44/vt100.h | 2 +- bootstrap/unix-48/Configuration.c | 4 +- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Console.c | 2 +- bootstrap/unix-48/Console.h | 2 +- bootstrap/unix-48/Files.c | 2 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 2 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 2 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 28 +++++----- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 2 +- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 2 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/Vishap.c | 2 +- bootstrap/unix-48/errors.c | 2 +- bootstrap/unix-48/errors.h | 2 +- bootstrap/unix-48/extTools.c | 2 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-48/vt100.c | 2 +- bootstrap/unix-48/vt100.h | 2 +- bootstrap/unix-88/Configuration.c | 4 +- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Console.c | 2 +- bootstrap/unix-88/Console.h | 2 +- bootstrap/unix-88/Files.c | 2 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 2 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 2 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 28 +++++----- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 2 +- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 2 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/Vishap.c | 2 +- bootstrap/unix-88/errors.c | 2 +- bootstrap/unix-88/errors.h | 2 +- bootstrap/unix-88/extTools.c | 2 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/unix-88/vt100.c | 2 +- bootstrap/unix-88/vt100.h | 2 +- bootstrap/windows-48/Configuration.c | 4 +- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Console.c | 2 +- bootstrap/windows-48/Console.h | 2 +- bootstrap/windows-48/Files.c | 2 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 2 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 2 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 28 +++++----- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 2 +- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 2 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/Vishap.c | 2 +- bootstrap/windows-48/errors.c | 2 +- bootstrap/windows-48/errors.h | 2 +- bootstrap/windows-48/extTools.c | 2 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-48/vt100.c | 2 +- bootstrap/windows-48/vt100.h | 2 +- bootstrap/windows-88/Configuration.c | 4 +- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Console.c | 2 +- bootstrap/windows-88/Console.h | 2 +- bootstrap/windows-88/Files.c | 2 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 2 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 2 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 28 +++++----- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 2 +- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 2 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Platform.c | 2 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/Vishap.c | 2 +- bootstrap/windows-88/errors.c | 2 +- bootstrap/windows-88/errors.h | 2 +- bootstrap/windows-88/extTools.c | 2 +- bootstrap/windows-88/extTools.h | 2 +- bootstrap/windows-88/vt100.c | 2 +- bootstrap/windows-88/vt100.h | 2 +- src/compiler/OPM.cmdln.Mod | 79 ++++++++++++---------------- 196 files changed, 310 insertions(+), 299 deletions(-) diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index c780cc96..b17dc344 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/21] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/22] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index 7fdf5f78..dca477a6 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Console.c b/bootstrap/unix-44/Console.c index eaa862b2..f330b900 100644 --- a/bootstrap/unix-44/Console.c +++ b/bootstrap/unix-44/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Console.h b/bootstrap/unix-44/Console.h index c8de3606..6837ab77 100644 --- a/bootstrap/unix-44/Console.h +++ b/bootstrap/unix-44/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 6e15e6b7..22fabbc7 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index 960fca06..4fd2efd8 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index 50823221..17784d67 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tsSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tsSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index 57904466..b1c745df 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tsSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index 1c66c8e5..1564f5e0 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index 13b6dbed..dbc243c8 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index c9ebd8f5..99ca6ea0 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index cdd33f1b..434172a2 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 6b7d1b01..11f64b59 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index b398282e..09952648 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 0086ff0f..2122bed9 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -269,11 +269,13 @@ BOOLEAN OPM_OpenPar (void) CHAR s[256]; if (Platform_ArgCount == 1) { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Vishap Oberon-2 compiler v", 27); + OPM_LogWStr((CHAR*)"Oberon-2 compiler v", 20); OPM_LogWStr(Configuration_versionLong, 41); OPM_LogW('.'); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Based on Ofront by Software Templ OEG, continued by Norayr Chilingarian and others.", 84); + OPM_LogWStr((CHAR*)"Based on Ofront by Software Templ OEG.", 39); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Further development by Norayr Chilingarian, David Brown and others.", 68); OPM_LogWLn(); OPM_LogWLn(); OPM_LogWStr((CHAR*)"Usage:", 7); @@ -289,15 +291,15 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWLn(); OPM_LogWStr((CHAR*)" Run time safety", 18); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -p Initialise pointers to NIL.", 37); + OPM_LogWStr((CHAR*)" -p Initialise pointers to NIL. On by default.", 52); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -a Halt on assertion failures.", 37); + OPM_LogWStr((CHAR*)" -a Halt on assertion failures. On by default.", 52); OPM_LogWLn(); OPM_LogWStr((CHAR*)" -r Halt on range check failures.", 39); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -t Halt on type guad failure.", 36); + OPM_LogWStr((CHAR*)" -t Halt on type guard failure. On by default.", 52); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -x Halt on index out of range.", 37); + OPM_LogWStr((CHAR*)" -x Halt on index out of range. On by default.", 52); OPM_LogWLn(); OPM_LogWLn(); OPM_LogWStr((CHAR*)" Symbol file management", 25); @@ -327,16 +329,16 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWStr((CHAR*)" -V Display compiler debugging messages.", 46); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" Size model for elementary types", 34); + OPM_LogWStr((CHAR*)" Size model for elementary types (default O2 on 32 bit builds, OV on 64 bits)", 79); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -O2 Original Oberon / Oberon-2: 8 bit SHORTINT, 16 bit INTEGER, 32 bit LONGINT and SET.", 94); + OPM_LogWStr((CHAR*)" -O2 Original Oberon / Oberon-2: 8 bit SHORTINT, 16 bit INTEGER, 32 bit LONGINT and SET.", 95); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -OC Component Pascal: 16 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET.", 94); + OPM_LogWStr((CHAR*)" -OC Component Pascal: 16 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET.", 95); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -OV Alternate large model: 8 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET.", 94); + OPM_LogWStr((CHAR*)" -OV Alternate large model: 8 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET.", 95); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" Target machine address size and alignment", 44); + OPM_LogWStr((CHAR*)" Target machine address size and alignment (default is that of the running compiler binary)", 93); OPM_LogWLn(); OPM_LogWStr((CHAR*)" -A44 32 bit addresses, 32 bit alignment (e.g. Unix/linux 32 bit on x86).", 79); OPM_LogWLn(); @@ -345,6 +347,8 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWStr((CHAR*)" -A88 66 bit addresses, 64 bit alignment (e.g. 64 bit platforms).", 71); OPM_LogWLn(); OPM_LogWLn(); + OPM_LogWStr((CHAR*)"All options are off by default, except where noted above.", 58); + OPM_LogWLn(); OPM_LogWStr((CHAR*)"Initial options specify defaults for all files.", 48); OPM_LogWLn(); OPM_LogWStr((CHAR*)"Options following a filename are specific to that file.", 56); diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index b32da345..8ca21351 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index af0d37db..d2b3e83f 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index 6dd03161..28045a86 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index f37bbc27..99aba006 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index 1b60944c..f7dd1d10 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index 147fdc5c..bd7bde13 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index d999d4ec..5de02c8b 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index edb84f81..efddd202 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index a89aa61a..4a3f9d07 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 2f652641..2bb80b77 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index adbbe116..2b954508 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index dec0e0b4..c1ffff0a 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index 0b779857..0ccc7989 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index 69612295..0f221fe7 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index b4d5f201..9fdb55fb 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index df1eacae..b29595be 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index 1702769b..59498ab9 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/Vishap.c b/bootstrap/unix-44/Vishap.c index 17b498b8..7b2dcd23 100644 --- a/bootstrap/unix-44/Vishap.c +++ b/bootstrap/unix-44/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspamSf */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspamSf */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/errors.c b/bootstrap/unix-44/errors.c index 95868540..3a4b1ce7 100644 --- a/bootstrap/unix-44/errors.c +++ b/bootstrap/unix-44/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/errors.h b/bootstrap/unix-44/errors.h index d574008d..6ca6c961 100644 --- a/bootstrap/unix-44/errors.h +++ b/bootstrap/unix-44/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index 9047ebcc..2167c7f8 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index 847e440e..0b905427 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-44/vt100.c b/bootstrap/unix-44/vt100.c index a14f3ee0..c337a9e2 100644 --- a/bootstrap/unix-44/vt100.c +++ b/bootstrap/unix-44/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/vt100.h b/bootstrap/unix-44/vt100.h index 1402af8c..2428fce4 100644 --- a/bootstrap/unix-44/vt100.h +++ b/bootstrap/unix-44/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index c780cc96..b17dc344 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/21] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/22] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index 7fdf5f78..dca477a6 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Console.c b/bootstrap/unix-48/Console.c index eaa862b2..f330b900 100644 --- a/bootstrap/unix-48/Console.c +++ b/bootstrap/unix-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Console.h b/bootstrap/unix-48/Console.h index c8de3606..6837ab77 100644 --- a/bootstrap/unix-48/Console.h +++ b/bootstrap/unix-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 6e15e6b7..22fabbc7 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index 960fca06..4fd2efd8 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index 50823221..17784d67 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tsSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tsSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index 57904466..b1c745df 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tsSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index 1c66c8e5..1564f5e0 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index 13b6dbed..dbc243c8 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index c9ebd8f5..99ca6ea0 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index cdd33f1b..434172a2 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 6b7d1b01..11f64b59 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index b398282e..09952648 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 0086ff0f..2122bed9 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -269,11 +269,13 @@ BOOLEAN OPM_OpenPar (void) CHAR s[256]; if (Platform_ArgCount == 1) { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Vishap Oberon-2 compiler v", 27); + OPM_LogWStr((CHAR*)"Oberon-2 compiler v", 20); OPM_LogWStr(Configuration_versionLong, 41); OPM_LogW('.'); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Based on Ofront by Software Templ OEG, continued by Norayr Chilingarian and others.", 84); + OPM_LogWStr((CHAR*)"Based on Ofront by Software Templ OEG.", 39); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Further development by Norayr Chilingarian, David Brown and others.", 68); OPM_LogWLn(); OPM_LogWLn(); OPM_LogWStr((CHAR*)"Usage:", 7); @@ -289,15 +291,15 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWLn(); OPM_LogWStr((CHAR*)" Run time safety", 18); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -p Initialise pointers to NIL.", 37); + OPM_LogWStr((CHAR*)" -p Initialise pointers to NIL. On by default.", 52); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -a Halt on assertion failures.", 37); + OPM_LogWStr((CHAR*)" -a Halt on assertion failures. On by default.", 52); OPM_LogWLn(); OPM_LogWStr((CHAR*)" -r Halt on range check failures.", 39); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -t Halt on type guad failure.", 36); + OPM_LogWStr((CHAR*)" -t Halt on type guard failure. On by default.", 52); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -x Halt on index out of range.", 37); + OPM_LogWStr((CHAR*)" -x Halt on index out of range. On by default.", 52); OPM_LogWLn(); OPM_LogWLn(); OPM_LogWStr((CHAR*)" Symbol file management", 25); @@ -327,16 +329,16 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWStr((CHAR*)" -V Display compiler debugging messages.", 46); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" Size model for elementary types", 34); + OPM_LogWStr((CHAR*)" Size model for elementary types (default O2 on 32 bit builds, OV on 64 bits)", 79); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -O2 Original Oberon / Oberon-2: 8 bit SHORTINT, 16 bit INTEGER, 32 bit LONGINT and SET.", 94); + OPM_LogWStr((CHAR*)" -O2 Original Oberon / Oberon-2: 8 bit SHORTINT, 16 bit INTEGER, 32 bit LONGINT and SET.", 95); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -OC Component Pascal: 16 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET.", 94); + OPM_LogWStr((CHAR*)" -OC Component Pascal: 16 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET.", 95); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -OV Alternate large model: 8 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET.", 94); + OPM_LogWStr((CHAR*)" -OV Alternate large model: 8 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET.", 95); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" Target machine address size and alignment", 44); + OPM_LogWStr((CHAR*)" Target machine address size and alignment (default is that of the running compiler binary)", 93); OPM_LogWLn(); OPM_LogWStr((CHAR*)" -A44 32 bit addresses, 32 bit alignment (e.g. Unix/linux 32 bit on x86).", 79); OPM_LogWLn(); @@ -345,6 +347,8 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWStr((CHAR*)" -A88 66 bit addresses, 64 bit alignment (e.g. 64 bit platforms).", 71); OPM_LogWLn(); OPM_LogWLn(); + OPM_LogWStr((CHAR*)"All options are off by default, except where noted above.", 58); + OPM_LogWLn(); OPM_LogWStr((CHAR*)"Initial options specify defaults for all files.", 48); OPM_LogWLn(); OPM_LogWStr((CHAR*)"Options following a filename are specific to that file.", 56); diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index b32da345..8ca21351 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index af0d37db..d2b3e83f 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index 6dd03161..28045a86 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index f37bbc27..99aba006 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index 1b60944c..f7dd1d10 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 148fbecb..abd3934b 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index d999d4ec..5de02c8b 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index edb84f81..efddd202 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index a89aa61a..4a3f9d07 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 2f652641..2bb80b77 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index adbbe116..2b954508 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index dec0e0b4..c1ffff0a 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index 0b779857..0ccc7989 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index 69612295..0f221fe7 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index b4d5f201..9fdb55fb 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index c02becc4..f69de03d 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index fbb113f7..e3ed3241 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/Vishap.c b/bootstrap/unix-48/Vishap.c index 17b498b8..7b2dcd23 100644 --- a/bootstrap/unix-48/Vishap.c +++ b/bootstrap/unix-48/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspamSf */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspamSf */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/errors.c b/bootstrap/unix-48/errors.c index 95868540..3a4b1ce7 100644 --- a/bootstrap/unix-48/errors.c +++ b/bootstrap/unix-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/errors.h b/bootstrap/unix-48/errors.h index d574008d..6ca6c961 100644 --- a/bootstrap/unix-48/errors.h +++ b/bootstrap/unix-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index 9047ebcc..2167c7f8 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index 847e440e..0b905427 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/vt100.c b/bootstrap/unix-48/vt100.c index a14f3ee0..c337a9e2 100644 --- a/bootstrap/unix-48/vt100.c +++ b/bootstrap/unix-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/vt100.h b/bootstrap/unix-48/vt100.h index 1402af8c..2428fce4 100644 --- a/bootstrap/unix-48/vt100.h +++ b/bootstrap/unix-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index 122d2b82..8945bf88 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/21] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/22] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index 7fdf5f78..dca477a6 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Console.c b/bootstrap/unix-88/Console.c index d489489e..260915fb 100644 --- a/bootstrap/unix-88/Console.c +++ b/bootstrap/unix-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Console.h b/bootstrap/unix-88/Console.h index 255cb17c..02fad3c1 100644 --- a/bootstrap/unix-88/Console.h +++ b/bootstrap/unix-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 1e1dea21..4ce28c47 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 08a62623..c2270808 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index 85664851..8d65bb87 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tsSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tsSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index b11a81ee..516a3aca 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tsSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 24319ad6..3d3d4700 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index 4c14134c..46624045 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index fab97f6a..c8d64313 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index deb651aa..66bdcc6c 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index dd9e2a18..a01fcde9 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index ae8e7035..4a7c8523 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 1b8dca0d..22131ab9 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -268,11 +268,13 @@ BOOLEAN OPM_OpenPar (void) CHAR s[256]; if (Platform_ArgCount == 1) { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Vishap Oberon-2 compiler v", 27); + OPM_LogWStr((CHAR*)"Oberon-2 compiler v", 20); OPM_LogWStr(Configuration_versionLong, 41); OPM_LogW('.'); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Based on Ofront by Software Templ OEG, continued by Norayr Chilingarian and others.", 84); + OPM_LogWStr((CHAR*)"Based on Ofront by Software Templ OEG.", 39); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Further development by Norayr Chilingarian, David Brown and others.", 68); OPM_LogWLn(); OPM_LogWLn(); OPM_LogWStr((CHAR*)"Usage:", 7); @@ -288,15 +290,15 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWLn(); OPM_LogWStr((CHAR*)" Run time safety", 18); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -p Initialise pointers to NIL.", 37); + OPM_LogWStr((CHAR*)" -p Initialise pointers to NIL. On by default.", 52); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -a Halt on assertion failures.", 37); + OPM_LogWStr((CHAR*)" -a Halt on assertion failures. On by default.", 52); OPM_LogWLn(); OPM_LogWStr((CHAR*)" -r Halt on range check failures.", 39); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -t Halt on type guad failure.", 36); + OPM_LogWStr((CHAR*)" -t Halt on type guard failure. On by default.", 52); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -x Halt on index out of range.", 37); + OPM_LogWStr((CHAR*)" -x Halt on index out of range. On by default.", 52); OPM_LogWLn(); OPM_LogWLn(); OPM_LogWStr((CHAR*)" Symbol file management", 25); @@ -326,16 +328,16 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWStr((CHAR*)" -V Display compiler debugging messages.", 46); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" Size model for elementary types", 34); + OPM_LogWStr((CHAR*)" Size model for elementary types (default O2 on 32 bit builds, OV on 64 bits)", 79); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -O2 Original Oberon / Oberon-2: 8 bit SHORTINT, 16 bit INTEGER, 32 bit LONGINT and SET.", 94); + OPM_LogWStr((CHAR*)" -O2 Original Oberon / Oberon-2: 8 bit SHORTINT, 16 bit INTEGER, 32 bit LONGINT and SET.", 95); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -OC Component Pascal: 16 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET.", 94); + OPM_LogWStr((CHAR*)" -OC Component Pascal: 16 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET.", 95); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -OV Alternate large model: 8 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET.", 94); + OPM_LogWStr((CHAR*)" -OV Alternate large model: 8 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET.", 95); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" Target machine address size and alignment", 44); + OPM_LogWStr((CHAR*)" Target machine address size and alignment (default is that of the running compiler binary)", 93); OPM_LogWLn(); OPM_LogWStr((CHAR*)" -A44 32 bit addresses, 32 bit alignment (e.g. Unix/linux 32 bit on x86).", 79); OPM_LogWLn(); @@ -344,6 +346,8 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWStr((CHAR*)" -A88 66 bit addresses, 64 bit alignment (e.g. 64 bit platforms).", 71); OPM_LogWLn(); OPM_LogWLn(); + OPM_LogWStr((CHAR*)"All options are off by default, except where noted above.", 58); + OPM_LogWLn(); OPM_LogWStr((CHAR*)"Initial options specify defaults for all files.", 48); OPM_LogWLn(); OPM_LogWStr((CHAR*)"Options following a filename are specific to that file.", 56); diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index e2737249..b1fab659 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index e9fcba89..8c85929d 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index 6dd03161..28045a86 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index d79e207f..869dfa4b 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index 40853589..7de91cb4 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index 63b773cd..2dd48c74 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 0cc86a01..a1956589 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 8026831f..22d0def4 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index a89aa61a..4a3f9d07 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 99577840..c318921f 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index 06414b7c..e4145b85 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index f2623b03..039a3b6d 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index 05b31bee..e27d5dca 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index 4226bdb9..2f1a7062 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index b13ba079..90baacae 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index 4cdaa6b9..ee371c4e 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index 10d0a9bb..32047663 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/Vishap.c b/bootstrap/unix-88/Vishap.c index e1d112ec..87812cc2 100644 --- a/bootstrap/unix-88/Vishap.c +++ b/bootstrap/unix-88/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspamSf */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspamSf */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/errors.c b/bootstrap/unix-88/errors.c index ca898552..897999f4 100644 --- a/bootstrap/unix-88/errors.c +++ b/bootstrap/unix-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/errors.h b/bootstrap/unix-88/errors.h index d574008d..6ca6c961 100644 --- a/bootstrap/unix-88/errors.h +++ b/bootstrap/unix-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index db3aec30..1647c4fe 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index 847e440e..0b905427 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/vt100.c b/bootstrap/unix-88/vt100.c index ac832261..8b57066f 100644 --- a/bootstrap/unix-88/vt100.c +++ b/bootstrap/unix-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/vt100.h b/bootstrap/unix-88/vt100.h index 054f6ddd..e8809371 100644 --- a/bootstrap/unix-88/vt100.h +++ b/bootstrap/unix-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index c780cc96..b17dc344 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/21] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/22] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index 7fdf5f78..dca477a6 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Console.c b/bootstrap/windows-48/Console.c index 9c3127a1..8a36bd2f 100644 --- a/bootstrap/windows-48/Console.c +++ b/bootstrap/windows-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Console.h b/bootstrap/windows-48/Console.h index c8de3606..6837ab77 100644 --- a/bootstrap/windows-48/Console.h +++ b/bootstrap/windows-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 80926272..3c273102 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index ade97ac7..1e8c0d89 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index 50823221..17784d67 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tsSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tsSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index 57904466..b1c745df 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tsSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index 1c66c8e5..1564f5e0 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index 13b6dbed..dbc243c8 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index c9ebd8f5..99ca6ea0 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index cdd33f1b..434172a2 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 6b7d1b01..11f64b59 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index b398282e..09952648 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 0086ff0f..2122bed9 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -269,11 +269,13 @@ BOOLEAN OPM_OpenPar (void) CHAR s[256]; if (Platform_ArgCount == 1) { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Vishap Oberon-2 compiler v", 27); + OPM_LogWStr((CHAR*)"Oberon-2 compiler v", 20); OPM_LogWStr(Configuration_versionLong, 41); OPM_LogW('.'); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Based on Ofront by Software Templ OEG, continued by Norayr Chilingarian and others.", 84); + OPM_LogWStr((CHAR*)"Based on Ofront by Software Templ OEG.", 39); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Further development by Norayr Chilingarian, David Brown and others.", 68); OPM_LogWLn(); OPM_LogWLn(); OPM_LogWStr((CHAR*)"Usage:", 7); @@ -289,15 +291,15 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWLn(); OPM_LogWStr((CHAR*)" Run time safety", 18); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -p Initialise pointers to NIL.", 37); + OPM_LogWStr((CHAR*)" -p Initialise pointers to NIL. On by default.", 52); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -a Halt on assertion failures.", 37); + OPM_LogWStr((CHAR*)" -a Halt on assertion failures. On by default.", 52); OPM_LogWLn(); OPM_LogWStr((CHAR*)" -r Halt on range check failures.", 39); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -t Halt on type guad failure.", 36); + OPM_LogWStr((CHAR*)" -t Halt on type guard failure. On by default.", 52); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -x Halt on index out of range.", 37); + OPM_LogWStr((CHAR*)" -x Halt on index out of range. On by default.", 52); OPM_LogWLn(); OPM_LogWLn(); OPM_LogWStr((CHAR*)" Symbol file management", 25); @@ -327,16 +329,16 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWStr((CHAR*)" -V Display compiler debugging messages.", 46); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" Size model for elementary types", 34); + OPM_LogWStr((CHAR*)" Size model for elementary types (default O2 on 32 bit builds, OV on 64 bits)", 79); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -O2 Original Oberon / Oberon-2: 8 bit SHORTINT, 16 bit INTEGER, 32 bit LONGINT and SET.", 94); + OPM_LogWStr((CHAR*)" -O2 Original Oberon / Oberon-2: 8 bit SHORTINT, 16 bit INTEGER, 32 bit LONGINT and SET.", 95); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -OC Component Pascal: 16 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET.", 94); + OPM_LogWStr((CHAR*)" -OC Component Pascal: 16 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET.", 95); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -OV Alternate large model: 8 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET.", 94); + OPM_LogWStr((CHAR*)" -OV Alternate large model: 8 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET.", 95); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" Target machine address size and alignment", 44); + OPM_LogWStr((CHAR*)" Target machine address size and alignment (default is that of the running compiler binary)", 93); OPM_LogWLn(); OPM_LogWStr((CHAR*)" -A44 32 bit addresses, 32 bit alignment (e.g. Unix/linux 32 bit on x86).", 79); OPM_LogWLn(); @@ -345,6 +347,8 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWStr((CHAR*)" -A88 66 bit addresses, 64 bit alignment (e.g. 64 bit platforms).", 71); OPM_LogWLn(); OPM_LogWLn(); + OPM_LogWStr((CHAR*)"All options are off by default, except where noted above.", 58); + OPM_LogWLn(); OPM_LogWStr((CHAR*)"Initial options specify defaults for all files.", 48); OPM_LogWLn(); OPM_LogWStr((CHAR*)"Options following a filename are specific to that file.", 56); diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index b32da345..8ca21351 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index af0d37db..d2b3e83f 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index 6dd03161..28045a86 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index f37bbc27..99aba006 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index 1b60944c..f7dd1d10 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 148fbecb..abd3934b 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index d999d4ec..5de02c8b 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index edb84f81..efddd202 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index a89aa61a..4a3f9d07 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 12ced558..f8d3f76c 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index 75f53fa0..c93c79ce 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index dec0e0b4..c1ffff0a 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index 0b779857..0ccc7989 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index 69612295..0f221fe7 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index b4d5f201..9fdb55fb 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index c02becc4..f69de03d 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index fbb113f7..e3ed3241 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/Vishap.c b/bootstrap/windows-48/Vishap.c index 17b498b8..7b2dcd23 100644 --- a/bootstrap/windows-48/Vishap.c +++ b/bootstrap/windows-48/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspamSf */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspamSf */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/errors.c b/bootstrap/windows-48/errors.c index 95868540..3a4b1ce7 100644 --- a/bootstrap/windows-48/errors.c +++ b/bootstrap/windows-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/errors.h b/bootstrap/windows-48/errors.h index d574008d..6ca6c961 100644 --- a/bootstrap/windows-48/errors.h +++ b/bootstrap/windows-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index 9047ebcc..2167c7f8 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index 847e440e..0b905427 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/vt100.c b/bootstrap/windows-48/vt100.c index a14f3ee0..c337a9e2 100644 --- a/bootstrap/windows-48/vt100.c +++ b/bootstrap/windows-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/vt100.h b/bootstrap/windows-48/vt100.h index 1402af8c..2428fce4 100644 --- a/bootstrap/windows-48/vt100.h +++ b/bootstrap/windows-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index 122d2b82..8945bf88 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/21] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/22] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index 7fdf5f78..dca477a6 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Console.c b/bootstrap/windows-88/Console.c index 6a1cec2c..23f25bda 100644 --- a/bootstrap/windows-88/Console.c +++ b/bootstrap/windows-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Console.h b/bootstrap/windows-88/Console.h index 255cb17c..02fad3c1 100644 --- a/bootstrap/windows-88/Console.h +++ b/bootstrap/windows-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 546f8b08..ea935dee 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 0aae236a..1fa0bb84 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index 85664851..8d65bb87 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tsSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tsSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index b11a81ee..516a3aca 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tsSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 24319ad6..3d3d4700 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index 4c14134c..46624045 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index fab97f6a..c8d64313 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index deb651aa..66bdcc6c 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index dd9e2a18..a01fcde9 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index ae8e7035..4a7c8523 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 1b8dca0d..22131ab9 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -268,11 +268,13 @@ BOOLEAN OPM_OpenPar (void) CHAR s[256]; if (Platform_ArgCount == 1) { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Vishap Oberon-2 compiler v", 27); + OPM_LogWStr((CHAR*)"Oberon-2 compiler v", 20); OPM_LogWStr(Configuration_versionLong, 41); OPM_LogW('.'); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Based on Ofront by Software Templ OEG, continued by Norayr Chilingarian and others.", 84); + OPM_LogWStr((CHAR*)"Based on Ofront by Software Templ OEG.", 39); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Further development by Norayr Chilingarian, David Brown and others.", 68); OPM_LogWLn(); OPM_LogWLn(); OPM_LogWStr((CHAR*)"Usage:", 7); @@ -288,15 +290,15 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWLn(); OPM_LogWStr((CHAR*)" Run time safety", 18); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -p Initialise pointers to NIL.", 37); + OPM_LogWStr((CHAR*)" -p Initialise pointers to NIL. On by default.", 52); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -a Halt on assertion failures.", 37); + OPM_LogWStr((CHAR*)" -a Halt on assertion failures. On by default.", 52); OPM_LogWLn(); OPM_LogWStr((CHAR*)" -r Halt on range check failures.", 39); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -t Halt on type guad failure.", 36); + OPM_LogWStr((CHAR*)" -t Halt on type guard failure. On by default.", 52); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -x Halt on index out of range.", 37); + OPM_LogWStr((CHAR*)" -x Halt on index out of range. On by default.", 52); OPM_LogWLn(); OPM_LogWLn(); OPM_LogWStr((CHAR*)" Symbol file management", 25); @@ -326,16 +328,16 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWStr((CHAR*)" -V Display compiler debugging messages.", 46); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" Size model for elementary types", 34); + OPM_LogWStr((CHAR*)" Size model for elementary types (default O2 on 32 bit builds, OV on 64 bits)", 79); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -O2 Original Oberon / Oberon-2: 8 bit SHORTINT, 16 bit INTEGER, 32 bit LONGINT and SET.", 94); + OPM_LogWStr((CHAR*)" -O2 Original Oberon / Oberon-2: 8 bit SHORTINT, 16 bit INTEGER, 32 bit LONGINT and SET.", 95); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -OC Component Pascal: 16 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET.", 94); + OPM_LogWStr((CHAR*)" -OC Component Pascal: 16 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET.", 95); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -OV Alternate large model: 8 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET.", 94); + OPM_LogWStr((CHAR*)" -OV Alternate large model: 8 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET.", 95); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" Target machine address size and alignment", 44); + OPM_LogWStr((CHAR*)" Target machine address size and alignment (default is that of the running compiler binary)", 93); OPM_LogWLn(); OPM_LogWStr((CHAR*)" -A44 32 bit addresses, 32 bit alignment (e.g. Unix/linux 32 bit on x86).", 79); OPM_LogWLn(); @@ -344,6 +346,8 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWStr((CHAR*)" -A88 66 bit addresses, 64 bit alignment (e.g. 64 bit platforms).", 71); OPM_LogWLn(); OPM_LogWLn(); + OPM_LogWStr((CHAR*)"All options are off by default, except where noted above.", 58); + OPM_LogWLn(); OPM_LogWStr((CHAR*)"Initial options specify defaults for all files.", 48); OPM_LogWLn(); OPM_LogWStr((CHAR*)"Options following a filename are specific to that file.", 56); diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index e2737249..b1fab659 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index e9fcba89..8c85929d 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index 6dd03161..28045a86 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index d79e207f..869dfa4b 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index 40853589..7de91cb4 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index 63b773cd..2dd48c74 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 0cc86a01..a1956589 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 8026831f..22d0def4 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index a89aa61a..4a3f9d07 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 0a24d4e9..6651ddd3 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index 0c4c2127..8fd37cdd 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index f2623b03..039a3b6d 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index 05b31bee..e27d5dca 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index 4226bdb9..2f1a7062 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index b13ba079..90baacae 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index 4cdaa6b9..ee371c4e 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index 10d0a9bb..32047663 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/Vishap.c b/bootstrap/windows-88/Vishap.c index e1d112ec..87812cc2 100644 --- a/bootstrap/windows-88/Vishap.c +++ b/bootstrap/windows-88/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspamSf */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspamSf */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/errors.c b/bootstrap/windows-88/errors.c index ca898552..897999f4 100644 --- a/bootstrap/windows-88/errors.c +++ b/bootstrap/windows-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/errors.h b/bootstrap/windows-88/errors.h index d574008d..6ca6c961 100644 --- a/bootstrap/windows-88/errors.h +++ b/bootstrap/windows-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index db3aec30..1647c4fe 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index 847e440e..0b905427 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/vt100.c b/bootstrap/windows-88/vt100.c index ac832261..8b57066f 100644 --- a/bootstrap/windows-88/vt100.c +++ b/bootstrap/windows-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/vt100.h b/bootstrap/windows-88/vt100.h index 054f6ddd..e8809371 100644 --- a/bootstrap/windows-88/vt100.h +++ b/bootstrap/windows-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/src/compiler/OPM.cmdln.Mod b/src/compiler/OPM.cmdln.Mod index 33965ece..b3298aed 100644 --- a/src/compiler/OPM.cmdln.Mod +++ b/src/compiler/OPM.cmdln.Mod @@ -218,6 +218,9 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) (* Undocumented options used by the build system: + Todo - this is obsoleted by the -A and -O options. Remove when the build system + has been updated. + The following parameter overrides the integer size, pointer size and alignment settings compiled into the binary. They are used when bootstrapping to generate the C source for a compiler with different sizes to the current compiler. @@ -236,19 +239,22 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) BEGIN IF Platform.ArgCount = 1 THEN LogWLn; - LogWStr("Vishap Oberon-2 compiler v"); LogWStr(Configuration.versionLong); LogW("."); LogWLn; - LogWStr("Based on Ofront by Software Templ OEG, continued by Norayr Chilingarian and others."); LogWLn; + LogWStr("Oberon-2 compiler v"); LogWStr(Configuration.versionLong); LogW("."); LogWLn; + LogWStr("Based on Ofront by Software Templ OEG."); LogWLn; + LogWStr("Further development by Norayr Chilingarian, David Brown and others."); LogWLn; LogWLn; - LogWStr('Usage:'); LogWLn; LogWLn; - LogWStr(' '); LogWStr(Configuration.name); LogWStr(' options {files {options}}.'); LogWLn; LogWLn; - LogWStr('Where options = ["-" {option} ].'); LogWLn; + LogWStr("Usage:"); LogWLn; + LogWLn; + LogWStr(" "); LogWStr(Configuration.name); LogWStr(" options {files {options}}."); LogWLn; + LogWLn; + LogWStr('Where options = ["-" {option} ].'); LogWLn; LogWLn; LogWStr(" Run time safety"); LogWLn; - LogWStr(" -p Initialise pointers to NIL."); LogWLn; - LogWStr(" -a Halt on assertion failures."); LogWLn; + LogWStr(" -p Initialise pointers to NIL. On by default."); LogWLn; + LogWStr(" -a Halt on assertion failures. On by default."); LogWLn; LogWStr(" -r Halt on range check failures."); LogWLn; - LogWStr(" -t Halt on type guad failure."); LogWLn; - LogWStr(" -x Halt on index out of range."); LogWLn; + LogWStr(" -t Halt on type guard failure. On by default."); LogWLn; + LogWStr(" -x Halt on index out of range. On by default."); LogWLn; LogWLn; LogWStr(" Symbol file management"); LogWLn; LogWStr(" -e Allow extension of old symbol file."); LogWLn; @@ -265,19 +271,20 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) LogWStr(" -f Disable vt100 control characters in status output."); LogWLn; LogWStr(" -V Display compiler debugging messages."); LogWLn; LogWLn; - LogWStr(" Size model for elementary types"); LogWLn; - LogWStr(" -O2 Original Oberon / Oberon-2: 8 bit SHORTINT, 16 bit INTEGER, 32 bit LONGINT and SET."); LogWLn; - LogWStr(" -OC Component Pascal: 16 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET."); LogWLn; - LogWStr(" -OV Alternate large model: 8 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET."); LogWLn; + LogWStr(" Size model for elementary types (default O2 on 32 bit builds, OV on 64 bits)"); LogWLn; + LogWStr(" -O2 Original Oberon / Oberon-2: 8 bit SHORTINT, 16 bit INTEGER, 32 bit LONGINT and SET."); LogWLn; + LogWStr(" -OC Component Pascal: 16 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET."); LogWLn; + LogWStr(" -OV Alternate large model: 8 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET."); LogWLn; LogWLn; - LogWStr(" Target machine address size and alignment"); LogWLn; + LogWStr(" Target machine address size and alignment (default is that of the running compiler binary)"); LogWLn; LogWStr(" -A44 32 bit addresses, 32 bit alignment (e.g. Unix/linux 32 bit on x86)."); LogWLn; LogWStr(" -A48 32 bit addresses, 64 bit alignment (e.g. Windows 32 bit on x86, linux 32 bit on arm)."); LogWLn; LogWStr(" -A88 66 bit addresses, 64 bit alignment (e.g. 64 bit platforms)."); LogWLn; LogWLn; - LogWStr('Initial options specify defaults for all files.'); LogWLn; - LogWStr('Options following a filename are specific to that file.'); LogWLn; - LogWStr('Repeating an option toggles its value.'); LogWLn; + LogWStr("All options are off by default, except where noted above."); LogWLn; + LogWStr("Initial options specify defaults for all files."); LogWLn; + LogWStr("Options following a filename are specific to that file."); LogWLn; + LogWStr("Repeating an option toggles its value."); LogWLn; RETURN FALSE ELSE S:=1; s:=""; Platform.GetArg(S, s); @@ -577,17 +584,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) PROCEDURE VerboseListSizes; BEGIN LogWLn; - (*LogWStr("Type Size Alignement"); LogWLn;*) LogWStr("Type Size"); LogWLn; - (* - LogWStr("CHAR "); LogWNum(CharSize, 4); (* LogWNum(CharAlign, 5); *) LogWLn; - LogWStr("BOOLEAN "); LogWNum(BoolSize, 4); (* LogWNum(BoolAlign, 5); *) LogWLn; - LogWStr("REAL "); LogWNum(RealSize, 4); (* LogWNum(RealAlign, 5); *) LogWLn; - LogWStr("LONGREAL "); LogWNum(LRealSize, 4); (* LogWNum(LRealAlign, 5); *) LogWLn; - LogWStr("RECORD "); LogWNum(RecSize, 4); (* LogWNum(RecAlign, 5); *) LogWLn; - LogWStr("PROC "); LogWNum(ProcSize, 4); (* LogWNum(ProcAlign, 5); *) LogWLn; - LogWStr("ENDIAN "); LogWNum(ByteOrder, 4); LogWNum(BitOrder, 5); LogWLn; - *) LogWStr("SHORTINT "); LogWNum(ShortintSize, 4); (* LogWNum(SIntAlign, 5); *) LogWLn; LogWStr("INTEGER "); LogWNum(IntegerSize, 4); (* LogWNum(IntAlign, 5); *) LogWLn; LogWStr("LONGINT "); LogWNum(LongintSize, 4); (* LogWNum(LIntAlign, 5); *) LogWLn; @@ -595,13 +592,6 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) LogWStr("ADDRESS "); LogWNum(AddressSize, 4); (* LogWNum(PointerAlign, 5); *) LogWLn; LogWLn; LogWStr("Alignment: "); LogWNum(Alignment, 4); LogWLn; - (* - LogWStr("Min shortint "); LogWNum(MinSInt, 4); LogWLn; - LogWStr("Max shortint "); LogWNum(MaxSInt, 4); LogWLn; - LogWStr("Min integer "); LogWNum(MinInt, 4); LogWLn; - LogWStr("Max integer "); LogWNum(MaxInt, 4); LogWLn; - LogWStr("Min longint "); LogWNum(MinLInt, 4); LogWLn; - *) END VerboseListSizes; @@ -864,7 +854,6 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) BEGIN - Texts.OpenWriter(W); MODULES := ""; Platform.GetEnv("MODULES", MODULES); @@ -881,16 +870,18 @@ BEGIN (* type sizes with configuration based defaults *) AddressSize := Configuration.addressSize; Alignment := Configuration.alignment; - ShortintSize := 1; IF Configuration.intsize = 2 THEN - IntegerSize := 2; - LongintSize := 4; - SetSize := 4; + (* Original Oberon-2 implementation sizes (-O2) *) + ShortintSize := 1; + IntegerSize := 2; + LongintSize := 4; + SetSize := 4; ELSE - IntegerSize := 4; - LongintSize := 8; - SetSize := 8; - END; - + (* Legacy Vishap 64 bit build sizes (-OV) *) + ShortintSize := 1; + IntegerSize := 4; + LongintSize := 8; + SetSize := 8; + END END OPM. From b158671cf80643c1d90c75d8fb6f0ecc06cbc9ad Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 22 Sep 2016 18:40:35 +0100 Subject: [PATCH 243/580] SYSTEM.ADR and LEN both return SYSTEM.ADDRESS. --- src/compiler/OPB.Mod | 20 ++- src/system/Platformunix.Mod | 2 +- src/tools/make/vishap.make | 315 ++++++++++++++++-------------------- 3 files changed, 156 insertions(+), 181 deletions(-) diff --git a/src/compiler/OPB.Mod b/src/compiler/OPB.Mod index 32520266..cd3ae496 100644 --- a/src/compiler/OPB.Mod +++ b/src/compiler/OPB.Mod @@ -341,7 +341,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) IF (z^.class < OPT.Nconst) OR (f = OPT.String) THEN z := NewOp(op, typ, z) ELSE err(127) END ; - z^.typ := OPT.linttyp + z^.typ := OPT.adrtyp |OPT.cc: IF (f = OPT.Int) & (z^.class = OPT.Nconst) THEN (*SYSTEM.CC*) IF (0 <= z^.conval^.intval) & (z^.conval^.intval <= OPM.MaxCC) THEN z := NewOp(op, typ, z) ELSE err(219) END ELSE err(69) @@ -1052,8 +1052,8 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) OPT.bitfn, OPT.movefn: (*SYSTEM.GET, SYSTEM.PUT, SYSTEM.BIT, SYSTEM.MOVE*) IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) - ELSIF (x^.class = OPT.Nconst) & (f = OPT.Int) & (x.typ.size < OPT.linttyp.size) THEN Convert(x, OPT.linttyp) - ELSIF ~((x.typ.form IN {OPT.Pointer, OPT.Int}) & (x.typ.size = OPM.AddressSize)) THEN err(111); x^.typ := OPT.linttyp + ELSIF (x^.class = OPT.Nconst) & (f = OPT.Int) & (x.typ.size < OPT.adrtyp.size) THEN Convert(x, OPT.adrtyp) + ELSIF ~((x.typ.form IN {OPT.Pointer, OPT.Int}) & (x.typ.size = OPM.AddressSize)) THEN err(111); x^.typ := OPT.adrtyp END |OPT.getrfn, OPT.putrfn: (*SYSTEM.GETREG, SYSTEM.PUTREG*) @@ -1124,7 +1124,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) ELSE x^.obj := NIL; IF typ^.comp = OPT.DynArr THEN WHILE p^.class = OPT.Nindex DO p := p^.left; INC(x^.conval^.intval) END ; (* possible side effect ignored *) - p := NewOp(OPT.Ndop, OPT.len, p, x); p^.typ := OPT.linttyp + p := NewOp(OPT.Ndop, OPT.len, p, x); p^.typ := OPT.adrtyp ELSE p := x; p^.conval^.intval := typ^.n; SetIntType(p) END END @@ -1229,8 +1229,8 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) p^.typ := OPT.notyp |OPT.movefn: (*SYSTEM.MOVE*) IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) - ELSIF (x^.class = OPT.Nconst) & (f = OPT.Int) & (x.typ.size < OPT.linttyp.size) THEN Convert(x, OPT.linttyp) - ELSIF ~((x.typ.form IN {OPT.Pointer, OPT.Int}) & (x.typ.size = OPM.AddressSize)) THEN err(111); x^.typ := OPT.linttyp + ELSIF (x^.class = OPT.Nconst) & (f = OPT.Int) & (x.typ.size < OPT.adrtyp.size) THEN Convert(x, OPT.adrtyp) + ELSIF ~((x.typ.form IN {OPT.Pointer, OPT.Int}) & (x.typ.size = OPM.AddressSize)) THEN err(111); x^.typ := OPT.adrtyp END; p^.link := x |OPT.assertfn: (*ASSERT*) @@ -1293,7 +1293,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) ELSIF (fctno = OPT.lenfn) & (parno = 1) THEN (*LEN*) IF p^.typ^.comp = OPT.DynArr THEN dim := 0; WHILE p^.class = OPT.Nindex DO p := p^.left; INC(dim) END ; (* possible side effect ignored *) - BindNodes(OPT.Ndop, OPT.linttyp, p, NewIntConst(dim)); p^.subcl := OPT.len + BindNodes(OPT.Ndop, OPT.adrtyp, p, NewIntConst(dim)); p^.subcl := OPT.len ELSE p := NewIntConst(p^.typ^.n) END @@ -1379,7 +1379,11 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) WHILE (q # fp^.typ) & (q # NIL) & (q # OPT.undftyp) DO q := q^.BaseTyp END ; IF q = NIL THEN err(111) END ELSIF (fp^.typ = OPT.sysptrtyp) & (ap^.typ^.form = OPT.Pointer) THEN (* ok *) - ELSIF (ap^.typ # fp^.typ) & ~((fp^.typ^.form = OPT.Byte) & ((ap.typ.form IN {OPT.Byte..OPT.Char, OPT.Int}) & (ap.typ.size = 1))) THEN err(123) + ELSIF (ap^.typ # fp^.typ) THEN + IF (fp^.typ^.form = OPT.Byte) & ((ap.typ.form IN {OPT.Byte..OPT.Char, OPT.Int}) & (ap.typ.size = 1)) THEN (* OK *) + ELSIF (ap.typ = OPT.adrtyp) & (fp.typ = OPT.IntType(ap.typ.size)) THEN (* OK (ADDRESS is changed to INTnn in symbol file) *) + ELSE err(123) + END ELSIF (fp^.typ^.form = OPT.Pointer) & (ap^.class = OPT.Nguard) THEN err(123) END ELSIF fp^.typ^.comp = OPT.DynArr THEN diff --git a/src/system/Platformunix.Mod b/src/system/Platformunix.Mod index 6c86de7c..78daad35 100644 --- a/src/system/Platformunix.Mod +++ b/src/system/Platformunix.Mod @@ -22,7 +22,7 @@ TYPE EnvPtr = POINTER TO ARRAY 1024 OF CHAR; ArgPtr = POINTER TO ARRAY 1024 OF CHAR; ArgVec = POINTER TO ARRAY 1024 OF ArgPtr; - ArgVecPtr = POINTER TO ARRAY 1 OF LONGINT; + ArgVecPtr = POINTER TO ARRAY 1 OF SYSTEM.ADDRESS; VAR diff --git a/src/tools/make/vishap.make b/src/tools/make/vishap.make index 5b854fa2..9e9dec60 100644 --- a/src/tools/make/vishap.make +++ b/src/tools/make/vishap.make @@ -102,26 +102,26 @@ translate: @mkdir -p $(BUILDDIR) @rm -f $(BUILDDIR)/*.sym - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -B$(INTSIZE)$(ADRSIZE)$(ALIGNMENT) ../../Configuration.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -B$(INTSIZE)$(ADRSIZE)$(ALIGNMENT) ../../src/system/Platform$(PLATFORM).Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfFapx -B$(INTSIZE)$(ADRSIZE)$(ALIGNMENT) ../../src/system/Heap.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -B$(INTSIZE)$(ADRSIZE)$(ALIGNMENT) ../../src/system/Console.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -B$(INTSIZE)$(ADRSIZE)$(ALIGNMENT) ../../src/library/v4/Strings.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -B$(INTSIZE)$(ADRSIZE)$(ALIGNMENT) ../../src/library/v4/Modules.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfFx -B$(INTSIZE)$(ADRSIZE)$(ALIGNMENT) ../../src/system/Files.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -B$(INTSIZE)$(ADRSIZE)$(ALIGNMENT) ../../src/library/v4/Reals.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -B$(INTSIZE)$(ADRSIZE)$(ALIGNMENT) ../../src/library/v4/Texts.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -B$(INTSIZE)$(ADRSIZE)$(ALIGNMENT) ../../src/library/misc/vt100.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -B$(INTSIZE)$(ADRSIZE)$(ALIGNMENT) ../../src/compiler/errors.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -B$(INTSIZE)$(ADRSIZE)$(ALIGNMENT) ../../src/compiler/OPM.cmdln.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -B$(INTSIZE)$(ADRSIZE)$(ALIGNMENT) ../../src/compiler/extTools.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfFx -B$(INTSIZE)$(ADRSIZE)$(ALIGNMENT) ../../src/compiler/OPS.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -B$(INTSIZE)$(ADRSIZE)$(ALIGNMENT) ../../src/compiler/OPT.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -B$(INTSIZE)$(ADRSIZE)$(ALIGNMENT) ../../src/compiler/OPC.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -B$(INTSIZE)$(ADRSIZE)$(ALIGNMENT) ../../src/compiler/OPV.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -B$(INTSIZE)$(ADRSIZE)$(ALIGNMENT) ../../src/compiler/OPB.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -B$(INTSIZE)$(ADRSIZE)$(ALIGNMENT) ../../src/compiler/OPP.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ssfm -B$(INTSIZE)$(ADRSIZE)$(ALIGNMENT) ../../src/compiler/Vishap.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../Configuration.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../src/system/Platform$(PLATFORM).Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfFapx -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../src/system/Heap.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../src/system/Console.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../src/library/v4/Strings.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../src/library/v4/Modules.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfFx -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../src/system/Files.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../src/library/v4/Reals.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../src/library/v4/Texts.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../src/library/misc/vt100.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../src/compiler/errors.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../src/compiler/OPM.cmdln.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../src/compiler/extTools.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfFx -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../src/compiler/OPS.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../src/compiler/OPT.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../src/compiler/OPC.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../src/compiler/OPV.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../src/compiler/OPB.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../src/compiler/OPP.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ssfm -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../src/compiler/Vishap.Mod @printf "$(BUILDDIR) filled with compiler C source.\n" @@ -130,7 +130,7 @@ translate: browsercmd: @printf "\nMaking symbol browser\n" - @cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -fSm ../../src/tools/browser/BrowserCmd.Mod + @cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -fSm $(MODEL) ../../src/tools/browser/BrowserCmd.Mod @cd $(BUILDDIR); $(COMPILE) BrowserCmd.c -o showdef \ Platform.o Texts.o OPT.o Heap.o Console.o SYSTEM.o OPM.o OPS.o OPV.o \ Files.o Reals.o Modules.o vt100.o errors.o Configuration.o Strings.o \ @@ -141,25 +141,6 @@ browsercmd: FORCE: -testcoordinator: FORCE - @rm -f testcoordinator.exe testclient.exe - @make -f src/tools/make/vishap.make -s testtools - - -testtools: - @printf "\nMaking test coordinator\n" - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SfFs ../../src/tools/testcoordinator/IP.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Sfsm ../../src/tools/testcoordinator/TestCoordinator.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Sfsm ../../src/tools/testcoordinator/TestClient.Mod - cd $(BUILDDIR); $(COMPILE) -c IP.c - cd $(BUILDDIR); $(COMPILE) TestCoordinator.c -o $(ROOTDIR)/testcoordinator \ - Platform.o SYSTEM.o Heap.o Console.o Strings.o IP.o - cd $(BUILDDIR); $(COMPILE) TestClient.c -o $(ROOTDIR)/testclient \ - Platform.o SYSTEM.o Heap.o Console.o Strings.o IP.o - - - - # installable: Check for access to the installation directory installable: @@ -205,152 +186,152 @@ uninstall: v4: @printf "\nMaking v4 library\n" - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/v4/Args.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/v4/Printer.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/v4/Sets.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/v4/Args.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/v4/Printer.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/v4/Sets.Mod ooc2: @printf "\nMaking ooc2 library\n" - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc2/ooc2Strings.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc2/ooc2Ascii.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc2/ooc2CharClass.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc2/ooc2ConvTypes.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc2/ooc2IntConv.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc2/ooc2IntStr.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc2/ooc2Real0.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc2/ooc2Strings.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc2/ooc2Ascii.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc2/ooc2CharClass.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc2/ooc2ConvTypes.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc2/ooc2IntConv.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc2/ooc2IntStr.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc2/ooc2Real0.Mod TODO: Comment disabled lines contain use of VAL that reads beyond source variable ooc: @printf "\nMaking ooc library\n" - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocLowReal.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocLowLReal.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocRealMath.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocOakMath.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocLRealMath.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocLongInts.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocComplexMath.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocLComplexMath.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocAscii.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocCharClass.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocStrings.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocConvTypes.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocLRealConv.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocLRealStr.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocRealConv.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocRealStr.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocIntConv.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocIntStr.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocMsg.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocSysClock.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocTime.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocChannel.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocStrings2.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocRts.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocFilenames.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocTextRider.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocBinaryRider.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocJulianDay.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocFilenames.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocwrapperlibc.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocC$(DATAMODEL).Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocLowReal.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocLowLReal.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocRealMath.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocOakMath.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocLRealMath.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocLongInts.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocComplexMath.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocLComplexMath.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocAscii.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocCharClass.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocStrings.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocConvTypes.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocLRealConv.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocLRealStr.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocRealConv.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocRealStr.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocIntConv.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocIntStr.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocMsg.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocSysClock.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocTime.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocChannel.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocStrings2.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocRts.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocFilenames.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocTextRider.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocBinaryRider.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocJulianDay.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocFilenames.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocwrapperlibc.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocC$(DATAMODEL).Mod oocX11: @printf "\nMaking oocX11 library\n" - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/oocX11/oocX11.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/oocX11/oocXutil.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/oocX11/oocXYplane.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/oocX11/oocX11.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/oocX11/oocXutil.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/oocX11/oocXYplane.Mod ulm: @printf "\nMaking ulm library\n" - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmObjects.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmPriorities.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmDisciplines.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmServices.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmSys.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmSYSTEM.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmEvents.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmProcess.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmResources.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmForwarders.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmRelatedEvents.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmTypes.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmStreams.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmStrings.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmSysTypes.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmTexts.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmSysConversions.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmErrors.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmSysErrors.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmSysStat.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmASCII.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmSets.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmIO.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmAssertions.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmIndirectDisciplines.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmStreamDisciplines.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmIEEE.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmMC68881.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmReals.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmPrint.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmWrite.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmConstStrings.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmPlotters.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmSysIO.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmLoader.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmNetIO.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmPersistentObjects.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmPersistentDisciplines.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmOperations.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmScales.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmTimes.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmClocks.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmTimers.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmConditions.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmStreamConditions.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmTimeConditions.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmCiphers.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmCipherOps.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmBlockCiphers.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmAsymmetricCiphers.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmConclusions.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmRandomGenerators.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmTCrypt.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmIntOperations.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmObjects.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmPriorities.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmDisciplines.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmServices.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmSys.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmSYSTEM.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmEvents.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmProcess.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmResources.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmForwarders.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmRelatedEvents.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmTypes.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmStreams.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmStrings.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmSysTypes.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmTexts.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmSysConversions.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmErrors.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmSysErrors.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmSysStat.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmASCII.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmSets.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmIO.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmAssertions.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmIndirectDisciplines.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmStreamDisciplines.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmIEEE.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmMC68881.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmReals.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmPrint.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmWrite.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmConstStrings.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmPlotters.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmSysIO.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmLoader.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmNetIO.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmPersistentObjects.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmPersistentDisciplines.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmOperations.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmScales.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmTimes.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmClocks.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmTimers.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmConditions.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmStreamConditions.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmTimeConditions.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmCiphers.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmCipherOps.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmBlockCiphers.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmAsymmetricCiphers.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmConclusions.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmRandomGenerators.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmTCrypt.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmIntOperations.Mod pow32: @printf "\nMaking pow library\n" - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/pow/powStrings.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/pow/powStrings.Mod misc: @printf "\nMaking misc library\n" - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/system/Oberon.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/misc/crt.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/misc/Listen.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/misc/MersenneTwister.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/misc/MultiArrays.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/misc/MultiArrayRiders.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/system/Oberon.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/misc/crt.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/misc/Listen.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/misc/MersenneTwister.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/misc/MultiArrays.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/misc/MultiArrayRiders.Mod s3: @printf "\nMaking s3 library\n" - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/s3/ethBTrees.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/s3/ethMD5.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/s3/ethSets.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/s3/ethZlib.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/s3/ethZlibBuffers.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/s3/ethZlibInflate.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/s3/ethZlibDeflate.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/s3/ethZlibReaders.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/s3/ethZlibWriters.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/s3/ethZip.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/s3/ethRandomNumbers.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/s3/ethGZReaders.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/s3/ethGZWriters.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/s3/ethUnicode.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/s3/ethDates.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/s3/ethReals.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/s3/ethStrings.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/s3/ethBTrees.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/s3/ethMD5.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/s3/ethSets.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/s3/ethZlib.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/s3/ethZlibBuffers.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/s3/ethZlibInflate.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/s3/ethZlibDeflate.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/s3/ethZlibReaders.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/s3/ethZlibWriters.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/s3/ethZip.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/s3/ethRandomNumbers.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/s3/ethGZReaders.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/s3/ethGZWriters.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/s3/ethUnicode.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/s3/ethDates.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/s3/ethReals.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/s3/ethStrings.Mod librarybinary: @printf "\nMaking lib$(ONAME)\n" @@ -394,13 +375,3 @@ confidence: cd src/test/confidence/arrayassignment; $(RUNTEST) if [ "$(PLATFORM)" != "windows" ] ; then cd src/test/confidence/signal; $(RUNTEST); fi @printf "\n\n--- Confidence tests passed ---\n\n" - - - -# auto: A full build started from a central machine running TestCoordinator. -auto: - @make -f src/tools/make/vishap.make -s clean - @make -f src/tools/make/vishap.make -s translate - @make -f src/tools/make/vishap.make -s assemble - @make -f src/tools/make/vishap.make -s testtools - while cmd=$$(./testclient -w "$(FLAVOUR)"); do $$cmd 2>&1 | ./testclient -s "$(FLAVOUR)"; done From b40dc4e2f80cecfe875d1abc8883c391d7196445 Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 22 Sep 2016 20:02:46 +0100 Subject: [PATCH 244/580] Some support in makefile for 32 bit model. --- bootstrap/unix-44/Console.c | 4 ++-- bootstrap/unix-44/Files.c | 4 ++-- bootstrap/unix-44/OPB.c | 26 +++++++++++++++----------- bootstrap/unix-44/Platform.c | 8 ++++---- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-48/Console.c | 4 ++-- bootstrap/unix-48/Files.c | 4 ++-- bootstrap/unix-48/OPB.c | 26 +++++++++++++++----------- bootstrap/unix-48/Platform.c | 8 ++++---- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-88/Console.c | 4 ++-- bootstrap/unix-88/Files.c | 4 ++-- bootstrap/unix-88/OPB.c | 26 +++++++++++++++----------- bootstrap/unix-88/Platform.c | 8 ++++---- bootstrap/unix-88/Platform.h | 2 +- bootstrap/windows-48/Console.c | 4 ++-- bootstrap/windows-48/Files.c | 4 ++-- bootstrap/windows-48/OPB.c | 26 +++++++++++++++----------- bootstrap/windows-88/Console.c | 4 ++-- bootstrap/windows-88/Files.c | 4 ++-- bootstrap/windows-88/OPB.c | 26 +++++++++++++++----------- makefile | 20 ++++++++++---------- src/system/Console.Mod | 2 +- src/system/Files.Mod | 29 ++++++++++++++++------------- src/system/Platformunix.Mod | 4 ++-- src/tools/make/configure.c | 1 + src/tools/make/vishap.make | 1 + 27 files changed, 141 insertions(+), 116 deletions(-) diff --git a/bootstrap/unix-44/Console.c b/bootstrap/unix-44/Console.c index f330b900..3f691a07 100644 --- a/bootstrap/unix-44/Console.c +++ b/bootstrap/unix-44/Console.c @@ -118,10 +118,10 @@ void Console_Hex (int32 i) void Console_Read (CHAR *ch) { - int32 n; + address n; int16 error; Console_Flush(); - error = Platform_ReadBuf(0, (void*)&*ch, 1, &n); + error = Platform_ReadBuf(0, (void*)&*ch, 1, (void*)&n); if (n != 1) { *ch = 0x00; } diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 22fabbc7..3ff2fa83 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -663,7 +663,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x } else { min = n; } - __MOVE((address)buf->data + offset, (address)x + xpos, min); + __MOVE(((address)buf->data) + offset, ((address)x) + xpos, min); offset += min; (*r).offset = offset; xpos += min; @@ -728,7 +728,7 @@ void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT } else { min = n; } - __MOVE((address)x + xpos, (address)buf->data + offset, min); + __MOVE(((address)x) + xpos, ((address)buf->data) + offset, min); offset += min; (*r).offset = offset; if (offset > buf->size) { diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index 99ca6ea0..4c60257b 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -639,7 +639,7 @@ void OPB_MOp (int8 op, OPT_Node *x) } else { OPB_err(127); } - z->typ = OPT_linttyp; + z->typ = OPT_adrtyp; break; case 25: if ((f == 4 && z->class == 7)) { @@ -1938,11 +1938,11 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) case 24: case 25: case 28: case 31: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { - OPB_Convert(&x, OPT_linttyp); + } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_adrtyp->size)) { + OPB_Convert(&x, OPT_adrtyp); } else if (!((__IN(x->typ->form, 0x0810, 32) && x->typ->size == OPM_AddressSize))) { OPB_err(111); - x->typ = OPT_linttyp; + x->typ = OPT_adrtyp; } break; case 26: case 27: @@ -2067,7 +2067,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) x->conval->intval += 1; } p = NewOp__53(12, 19, p, x); - p->typ = OPT_linttyp; + p->typ = OPT_adrtyp; } else { p = x; p->conval->intval = typ->n; @@ -2211,11 +2211,11 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) case 31: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { - OPB_Convert(&x, OPT_linttyp); + } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_adrtyp->size)) { + OPB_Convert(&x, OPT_adrtyp); } else if (!((__IN(x->typ->form, 0x0810, 32) && x->typ->size == OPM_AddressSize))) { OPB_err(111); - x->typ = OPT_linttyp; + x->typ = OPT_adrtyp; } p->link = x; break; @@ -2323,7 +2323,7 @@ void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno) p = p->left; dim += 1; } - OPB_BindNodes(12, OPT_linttyp, &p, OPB_NewIntConst(dim)); + OPB_BindNodes(12, OPT_adrtyp, &p, OPB_NewIntConst(dim)); p->subcl = 19; } else { p = OPB_NewIntConst(p->typ->n); @@ -2450,8 +2450,12 @@ void OPB_Param (OPT_Node ap, OPT_Object fp) OPB_err(111); } } else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 11)) { - } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x1e, 32) && ap->typ->size == 1)))))) { - OPB_err(123); + } else if (ap->typ != fp->typ) { + if ((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x1e, 32) && ap->typ->size == 1)))) { + } else if ((ap->typ == OPT_adrtyp && fp->typ == OPT_IntType(ap->typ->size))) { + } else { + OPB_err(123); + } } else if ((fp->typ->form == 11 && ap->class == 5)) { OPB_err(123); } diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 2bb80b77..e2eb0c80 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -13,7 +13,7 @@ typedef Platform_ArgPtr (*Platform_ArgVec)[1024]; typedef - int32 (*Platform_ArgVecPtr)[1]; + address (*Platform_ArgVecPtr)[1]; typedef CHAR (*Platform_EnvPtr)[1024]; @@ -83,7 +83,7 @@ export void Platform_SetHalt (Platform_HaltProcedure p); export void Platform_SetInterruptHandler (Platform_SignalHandler handler); export void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Platform_FileIdentity source); export void Platform_SetQuitHandler (Platform_SignalHandler handler); -export int16 Platform_Size (int32 h, int32 *l); +export int16 Platform_Size (int32 h, address *l); export int16 Platform_Sync (int32 h); export int16 Platform_System (CHAR *cmd, LONGINT cmd__len); static void Platform_TestLittleEndian (void); @@ -155,7 +155,7 @@ extern void Heap_InitHeap(); #define Platform_statdev() (LONGINT)s.st_dev #define Platform_statino() (LONGINT)s.st_ino #define Platform_statmtime() (LONGINT)s.st_mtime -#define Platform_statsize() (LONGINT)s.st_size +#define Platform_statsize() (address)s.st_size #define Platform_structstats() struct stat s #define Platform_system(str, str__len) system((char*)str) #define Platform_tmhour() (LONGINT)time->tm_hour @@ -504,7 +504,7 @@ void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d) Platform_YMDHMStoClock(Platform_tmyear(), Platform_tmmon(), Platform_tmmday(), Platform_tmhour(), Platform_tmmin(), Platform_tmsec(), &*t, &*d); } -int16 Platform_Size (int32 h, int32 *l) +int16 Platform_Size (int32 h, address *l) { int16 _o_result; Platform_structstats(); diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index 2b954508..d024c4ed 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -67,7 +67,7 @@ import void Platform_SetHalt (Platform_HaltProcedure p); import void Platform_SetInterruptHandler (Platform_SignalHandler handler); import void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Platform_FileIdentity source); import void Platform_SetQuitHandler (Platform_SignalHandler handler); -import int16 Platform_Size (int32 h, int32 *l); +import int16 Platform_Size (int32 h, address *l); import int16 Platform_Sync (int32 h); import int16 Platform_System (CHAR *cmd, LONGINT cmd__len); import int32 Platform_Time (void); diff --git a/bootstrap/unix-48/Console.c b/bootstrap/unix-48/Console.c index f330b900..3f691a07 100644 --- a/bootstrap/unix-48/Console.c +++ b/bootstrap/unix-48/Console.c @@ -118,10 +118,10 @@ void Console_Hex (int32 i) void Console_Read (CHAR *ch) { - int32 n; + address n; int16 error; Console_Flush(); - error = Platform_ReadBuf(0, (void*)&*ch, 1, &n); + error = Platform_ReadBuf(0, (void*)&*ch, 1, (void*)&n); if (n != 1) { *ch = 0x00; } diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 22fabbc7..3ff2fa83 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -663,7 +663,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x } else { min = n; } - __MOVE((address)buf->data + offset, (address)x + xpos, min); + __MOVE(((address)buf->data) + offset, ((address)x) + xpos, min); offset += min; (*r).offset = offset; xpos += min; @@ -728,7 +728,7 @@ void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT } else { min = n; } - __MOVE((address)x + xpos, (address)buf->data + offset, min); + __MOVE(((address)x) + xpos, ((address)buf->data) + offset, min); offset += min; (*r).offset = offset; if (offset > buf->size) { diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index 99ca6ea0..4c60257b 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -639,7 +639,7 @@ void OPB_MOp (int8 op, OPT_Node *x) } else { OPB_err(127); } - z->typ = OPT_linttyp; + z->typ = OPT_adrtyp; break; case 25: if ((f == 4 && z->class == 7)) { @@ -1938,11 +1938,11 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) case 24: case 25: case 28: case 31: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { - OPB_Convert(&x, OPT_linttyp); + } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_adrtyp->size)) { + OPB_Convert(&x, OPT_adrtyp); } else if (!((__IN(x->typ->form, 0x0810, 32) && x->typ->size == OPM_AddressSize))) { OPB_err(111); - x->typ = OPT_linttyp; + x->typ = OPT_adrtyp; } break; case 26: case 27: @@ -2067,7 +2067,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) x->conval->intval += 1; } p = NewOp__53(12, 19, p, x); - p->typ = OPT_linttyp; + p->typ = OPT_adrtyp; } else { p = x; p->conval->intval = typ->n; @@ -2211,11 +2211,11 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) case 31: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { - OPB_Convert(&x, OPT_linttyp); + } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_adrtyp->size)) { + OPB_Convert(&x, OPT_adrtyp); } else if (!((__IN(x->typ->form, 0x0810, 32) && x->typ->size == OPM_AddressSize))) { OPB_err(111); - x->typ = OPT_linttyp; + x->typ = OPT_adrtyp; } p->link = x; break; @@ -2323,7 +2323,7 @@ void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno) p = p->left; dim += 1; } - OPB_BindNodes(12, OPT_linttyp, &p, OPB_NewIntConst(dim)); + OPB_BindNodes(12, OPT_adrtyp, &p, OPB_NewIntConst(dim)); p->subcl = 19; } else { p = OPB_NewIntConst(p->typ->n); @@ -2450,8 +2450,12 @@ void OPB_Param (OPT_Node ap, OPT_Object fp) OPB_err(111); } } else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 11)) { - } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x1e, 32) && ap->typ->size == 1)))))) { - OPB_err(123); + } else if (ap->typ != fp->typ) { + if ((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x1e, 32) && ap->typ->size == 1)))) { + } else if ((ap->typ == OPT_adrtyp && fp->typ == OPT_IntType(ap->typ->size))) { + } else { + OPB_err(123); + } } else if ((fp->typ->form == 11 && ap->class == 5)) { OPB_err(123); } diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 2bb80b77..e2eb0c80 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -13,7 +13,7 @@ typedef Platform_ArgPtr (*Platform_ArgVec)[1024]; typedef - int32 (*Platform_ArgVecPtr)[1]; + address (*Platform_ArgVecPtr)[1]; typedef CHAR (*Platform_EnvPtr)[1024]; @@ -83,7 +83,7 @@ export void Platform_SetHalt (Platform_HaltProcedure p); export void Platform_SetInterruptHandler (Platform_SignalHandler handler); export void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Platform_FileIdentity source); export void Platform_SetQuitHandler (Platform_SignalHandler handler); -export int16 Platform_Size (int32 h, int32 *l); +export int16 Platform_Size (int32 h, address *l); export int16 Platform_Sync (int32 h); export int16 Platform_System (CHAR *cmd, LONGINT cmd__len); static void Platform_TestLittleEndian (void); @@ -155,7 +155,7 @@ extern void Heap_InitHeap(); #define Platform_statdev() (LONGINT)s.st_dev #define Platform_statino() (LONGINT)s.st_ino #define Platform_statmtime() (LONGINT)s.st_mtime -#define Platform_statsize() (LONGINT)s.st_size +#define Platform_statsize() (address)s.st_size #define Platform_structstats() struct stat s #define Platform_system(str, str__len) system((char*)str) #define Platform_tmhour() (LONGINT)time->tm_hour @@ -504,7 +504,7 @@ void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d) Platform_YMDHMStoClock(Platform_tmyear(), Platform_tmmon(), Platform_tmmday(), Platform_tmhour(), Platform_tmmin(), Platform_tmsec(), &*t, &*d); } -int16 Platform_Size (int32 h, int32 *l) +int16 Platform_Size (int32 h, address *l) { int16 _o_result; Platform_structstats(); diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index 2b954508..d024c4ed 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -67,7 +67,7 @@ import void Platform_SetHalt (Platform_HaltProcedure p); import void Platform_SetInterruptHandler (Platform_SignalHandler handler); import void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Platform_FileIdentity source); import void Platform_SetQuitHandler (Platform_SignalHandler handler); -import int16 Platform_Size (int32 h, int32 *l); +import int16 Platform_Size (int32 h, address *l); import int16 Platform_Sync (int32 h); import int16 Platform_System (CHAR *cmd, LONGINT cmd__len); import int32 Platform_Time (void); diff --git a/bootstrap/unix-88/Console.c b/bootstrap/unix-88/Console.c index 260915fb..e86ee126 100644 --- a/bootstrap/unix-88/Console.c +++ b/bootstrap/unix-88/Console.c @@ -118,10 +118,10 @@ void Console_Hex (int64 i) void Console_Read (CHAR *ch) { - int64 n; + address n; int32 error; Console_Flush(); - error = Platform_ReadBuf(0, (void*)&*ch, 1, &n); + error = Platform_ReadBuf(0, (void*)&*ch, 1, (void*)&n); if (n != 1) { *ch = 0x00; } diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 4ce28c47..076eb5a8 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -663,7 +663,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x } else { min = n; } - __MOVE((address)buf->data + offset, (address)x + xpos, min); + __MOVE(((address)buf->data) + offset, ((address)x) + xpos, min); offset += min; (*r).offset = offset; xpos += min; @@ -728,7 +728,7 @@ void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT } else { min = n; } - __MOVE((address)x + xpos, (address)buf->data + offset, min); + __MOVE(((address)x) + xpos, ((address)buf->data) + offset, min); offset += min; (*r).offset = offset; if (offset > buf->size) { diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index c8d64313..a3870901 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -639,7 +639,7 @@ void OPB_MOp (int8 op, OPT_Node *x) } else { OPB_err(127); } - z->typ = OPT_linttyp; + z->typ = OPT_adrtyp; break; case 25: if ((f == 4 && z->class == 7)) { @@ -1938,11 +1938,11 @@ void OPB_StPar0 (OPT_Node *par0, int32 fctno) case 24: case 25: case 28: case 31: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { - OPB_Convert(&x, OPT_linttyp); + } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_adrtyp->size)) { + OPB_Convert(&x, OPT_adrtyp); } else if (!((__IN(x->typ->form, 0x0810, 64) && x->typ->size == (int64)OPM_AddressSize))) { OPB_err(111); - x->typ = OPT_linttyp; + x->typ = OPT_adrtyp; } break; case 26: case 27: @@ -2067,7 +2067,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) x->conval->intval += 1; } p = NewOp__53(12, 19, p, x); - p->typ = OPT_linttyp; + p->typ = OPT_adrtyp; } else { p = x; p->conval->intval = typ->n; @@ -2211,11 +2211,11 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) case 31: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { - OPB_Convert(&x, OPT_linttyp); + } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_adrtyp->size)) { + OPB_Convert(&x, OPT_adrtyp); } else if (!((__IN(x->typ->form, 0x0810, 64) && x->typ->size == (int64)OPM_AddressSize))) { OPB_err(111); - x->typ = OPT_linttyp; + x->typ = OPT_adrtyp; } p->link = x; break; @@ -2323,7 +2323,7 @@ void OPB_StFct (OPT_Node *par0, int8 fctno, int32 parno) p = p->left; dim += 1; } - OPB_BindNodes(12, OPT_linttyp, &p, OPB_NewIntConst(dim)); + OPB_BindNodes(12, OPT_adrtyp, &p, OPB_NewIntConst(dim)); p->subcl = 19; } else { p = OPB_NewIntConst(p->typ->n); @@ -2450,8 +2450,12 @@ void OPB_Param (OPT_Node ap, OPT_Object fp) OPB_err(111); } } else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 11)) { - } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x1e, 64) && ap->typ->size == 1)))))) { - OPB_err(123); + } else if (ap->typ != fp->typ) { + if ((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x1e, 64) && ap->typ->size == 1)))) { + } else if ((ap->typ == OPT_adrtyp && fp->typ == OPT_IntType(ap->typ->size))) { + } else { + OPB_err(123); + } } else if ((fp->typ->form == 11 && ap->class == 5)) { OPB_err(123); } diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index c318921f..733b53ef 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -13,7 +13,7 @@ typedef Platform_ArgPtr (*Platform_ArgVec)[1024]; typedef - int64 (*Platform_ArgVecPtr)[1]; + address (*Platform_ArgVecPtr)[1]; typedef CHAR (*Platform_EnvPtr)[1024]; @@ -83,7 +83,7 @@ export void Platform_SetHalt (Platform_HaltProcedure p); export void Platform_SetInterruptHandler (Platform_SignalHandler handler); export void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Platform_FileIdentity source); export void Platform_SetQuitHandler (Platform_SignalHandler handler); -export int32 Platform_Size (int64 h, int64 *l); +export int32 Platform_Size (int64 h, address *l); export int32 Platform_Sync (int64 h); export int32 Platform_System (CHAR *cmd, LONGINT cmd__len); static void Platform_TestLittleEndian (void); @@ -155,7 +155,7 @@ extern void Heap_InitHeap(); #define Platform_statdev() (LONGINT)s.st_dev #define Platform_statino() (LONGINT)s.st_ino #define Platform_statmtime() (LONGINT)s.st_mtime -#define Platform_statsize() (LONGINT)s.st_size +#define Platform_statsize() (address)s.st_size #define Platform_structstats() struct stat s #define Platform_system(str, str__len) system((char*)str) #define Platform_tmhour() (LONGINT)time->tm_hour @@ -504,7 +504,7 @@ void Platform_MTimeAsClock (Platform_FileIdentity i, int64 *t, int64 *d) Platform_YMDHMStoClock(Platform_tmyear(), Platform_tmmon(), Platform_tmmday(), Platform_tmhour(), Platform_tmmin(), Platform_tmsec(), &*t, &*d); } -int32 Platform_Size (int64 h, int64 *l) +int32 Platform_Size (int64 h, address *l) { int32 _o_result; Platform_structstats(); diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index e4145b85..97c6cb2a 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -67,7 +67,7 @@ import void Platform_SetHalt (Platform_HaltProcedure p); import void Platform_SetInterruptHandler (Platform_SignalHandler handler); import void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Platform_FileIdentity source); import void Platform_SetQuitHandler (Platform_SignalHandler handler); -import int32 Platform_Size (int64 h, int64 *l); +import int32 Platform_Size (int64 h, address *l); import int32 Platform_Sync (int64 h); import int32 Platform_System (CHAR *cmd, LONGINT cmd__len); import int64 Platform_Time (void); diff --git a/bootstrap/windows-48/Console.c b/bootstrap/windows-48/Console.c index 8a36bd2f..2e0565e9 100644 --- a/bootstrap/windows-48/Console.c +++ b/bootstrap/windows-48/Console.c @@ -118,10 +118,10 @@ void Console_Hex (int32 i) void Console_Read (CHAR *ch) { - int32 n; + address n; int16 error; Console_Flush(); - error = Platform_ReadBuf(Platform_StdIn, (void*)&*ch, 1, &n); + error = Platform_ReadBuf(Platform_StdIn, (void*)&*ch, 1, (void*)&n); if (n != 1) { *ch = 0x00; } diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 3c273102..4b2bb492 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -663,7 +663,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x } else { min = n; } - __MOVE((address)buf->data + offset, (address)x + xpos, min); + __MOVE(((address)buf->data) + offset, ((address)x) + xpos, min); offset += min; (*r).offset = offset; xpos += min; @@ -728,7 +728,7 @@ void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT } else { min = n; } - __MOVE((address)x + xpos, (address)buf->data + offset, min); + __MOVE(((address)x) + xpos, ((address)buf->data) + offset, min); offset += min; (*r).offset = offset; if (offset > buf->size) { diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index 99ca6ea0..4c60257b 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -639,7 +639,7 @@ void OPB_MOp (int8 op, OPT_Node *x) } else { OPB_err(127); } - z->typ = OPT_linttyp; + z->typ = OPT_adrtyp; break; case 25: if ((f == 4 && z->class == 7)) { @@ -1938,11 +1938,11 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) case 24: case 25: case 28: case 31: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { - OPB_Convert(&x, OPT_linttyp); + } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_adrtyp->size)) { + OPB_Convert(&x, OPT_adrtyp); } else if (!((__IN(x->typ->form, 0x0810, 32) && x->typ->size == OPM_AddressSize))) { OPB_err(111); - x->typ = OPT_linttyp; + x->typ = OPT_adrtyp; } break; case 26: case 27: @@ -2067,7 +2067,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) x->conval->intval += 1; } p = NewOp__53(12, 19, p, x); - p->typ = OPT_linttyp; + p->typ = OPT_adrtyp; } else { p = x; p->conval->intval = typ->n; @@ -2211,11 +2211,11 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) case 31: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { - OPB_Convert(&x, OPT_linttyp); + } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_adrtyp->size)) { + OPB_Convert(&x, OPT_adrtyp); } else if (!((__IN(x->typ->form, 0x0810, 32) && x->typ->size == OPM_AddressSize))) { OPB_err(111); - x->typ = OPT_linttyp; + x->typ = OPT_adrtyp; } p->link = x; break; @@ -2323,7 +2323,7 @@ void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno) p = p->left; dim += 1; } - OPB_BindNodes(12, OPT_linttyp, &p, OPB_NewIntConst(dim)); + OPB_BindNodes(12, OPT_adrtyp, &p, OPB_NewIntConst(dim)); p->subcl = 19; } else { p = OPB_NewIntConst(p->typ->n); @@ -2450,8 +2450,12 @@ void OPB_Param (OPT_Node ap, OPT_Object fp) OPB_err(111); } } else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 11)) { - } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x1e, 32) && ap->typ->size == 1)))))) { - OPB_err(123); + } else if (ap->typ != fp->typ) { + if ((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x1e, 32) && ap->typ->size == 1)))) { + } else if ((ap->typ == OPT_adrtyp && fp->typ == OPT_IntType(ap->typ->size))) { + } else { + OPB_err(123); + } } else if ((fp->typ->form == 11 && ap->class == 5)) { OPB_err(123); } diff --git a/bootstrap/windows-88/Console.c b/bootstrap/windows-88/Console.c index 23f25bda..84cb998f 100644 --- a/bootstrap/windows-88/Console.c +++ b/bootstrap/windows-88/Console.c @@ -118,10 +118,10 @@ void Console_Hex (int64 i) void Console_Read (CHAR *ch) { - int64 n; + address n; int32 error; Console_Flush(); - error = Platform_ReadBuf(Platform_StdIn, (void*)&*ch, 1, &n); + error = Platform_ReadBuf(Platform_StdIn, (void*)&*ch, 1, (void*)&n); if (n != 1) { *ch = 0x00; } diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index ea935dee..8336cb0e 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -663,7 +663,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x } else { min = n; } - __MOVE((address)buf->data + offset, (address)x + xpos, min); + __MOVE(((address)buf->data) + offset, ((address)x) + xpos, min); offset += min; (*r).offset = offset; xpos += min; @@ -728,7 +728,7 @@ void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT } else { min = n; } - __MOVE((address)x + xpos, (address)buf->data + offset, min); + __MOVE(((address)x) + xpos, ((address)buf->data) + offset, min); offset += min; (*r).offset = offset; if (offset > buf->size) { diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index c8d64313..a3870901 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -639,7 +639,7 @@ void OPB_MOp (int8 op, OPT_Node *x) } else { OPB_err(127); } - z->typ = OPT_linttyp; + z->typ = OPT_adrtyp; break; case 25: if ((f == 4 && z->class == 7)) { @@ -1938,11 +1938,11 @@ void OPB_StPar0 (OPT_Node *par0, int32 fctno) case 24: case 25: case 28: case 31: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { - OPB_Convert(&x, OPT_linttyp); + } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_adrtyp->size)) { + OPB_Convert(&x, OPT_adrtyp); } else if (!((__IN(x->typ->form, 0x0810, 64) && x->typ->size == (int64)OPM_AddressSize))) { OPB_err(111); - x->typ = OPT_linttyp; + x->typ = OPT_adrtyp; } break; case 26: case 27: @@ -2067,7 +2067,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) x->conval->intval += 1; } p = NewOp__53(12, 19, p, x); - p->typ = OPT_linttyp; + p->typ = OPT_adrtyp; } else { p = x; p->conval->intval = typ->n; @@ -2211,11 +2211,11 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) case 31: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { - OPB_Convert(&x, OPT_linttyp); + } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_adrtyp->size)) { + OPB_Convert(&x, OPT_adrtyp); } else if (!((__IN(x->typ->form, 0x0810, 64) && x->typ->size == (int64)OPM_AddressSize))) { OPB_err(111); - x->typ = OPT_linttyp; + x->typ = OPT_adrtyp; } p->link = x; break; @@ -2323,7 +2323,7 @@ void OPB_StFct (OPT_Node *par0, int8 fctno, int32 parno) p = p->left; dim += 1; } - OPB_BindNodes(12, OPT_linttyp, &p, OPB_NewIntConst(dim)); + OPB_BindNodes(12, OPT_adrtyp, &p, OPB_NewIntConst(dim)); p->subcl = 19; } else { p = OPB_NewIntConst(p->typ->n); @@ -2450,8 +2450,12 @@ void OPB_Param (OPT_Node ap, OPT_Object fp) OPB_err(111); } } else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 11)) { - } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x1e, 64) && ap->typ->size == 1)))))) { - OPB_err(123); + } else if (ap->typ != fp->typ) { + if ((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x1e, 64) && ap->typ->size == 1)))) { + } else if ((ap->typ == OPT_adrtyp && fp->typ == OPT_IntType(ap->typ->size))) { + } else { + OPB_err(123); + } } else if ((fp->typ->form == 11 && ap->class == 5)) { OPB_err(123); } diff --git a/makefile b/makefile index 7f335f34..37fa64a0 100644 --- a/makefile +++ b/makefile @@ -262,21 +262,21 @@ bootstrap: configuration @make -f src/tools/make/vishap.make -s translate @make -f src/tools/make/vishap.make -s assemble rm -rf bootstrap/* - make -f src/tools/make/vishap.make -s translate INTSIZE=2 ADRSIZE=4 ALIGNMENT=4 PLATFORM=unix BUILDDIR=bootstrap/unix-44 && rm bootstrap/unix-44/*.sym - make -f src/tools/make/vishap.make -s translate INTSIZE=2 ADRSIZE=4 ALIGNMENT=8 PLATFORM=unix BUILDDIR=bootstrap/unix-48 && rm bootstrap/unix-48/*.sym - make -f src/tools/make/vishap.make -s translate INTSIZE=4 ADRSIZE=8 ALIGNMENT=8 PLATFORM=unix BUILDDIR=bootstrap/unix-88 && rm bootstrap/unix-88/*.sym - make -f src/tools/make/vishap.make -s translate INTSIZE=2 ADRSIZE=4 ALIGNMENT=8 PLATFORM=windows BUILDDIR=bootstrap/windows-48 && rm bootstrap/windows-48/*.sym - make -f src/tools/make/vishap.make -s translate INTSIZE=4 ADRSIZE=8 ALIGNMENT=8 PLATFORM=windows BUILDDIR=bootstrap/windows-88 && rm bootstrap/windows-88/*.sym + make -f src/tools/make/vishap.make -s translate MODEL=-O2 INTSIZE=2 ADRSIZE=4 ALIGNMENT=4 PLATFORM=unix BUILDDIR=bootstrap/unix-44 && rm bootstrap/unix-44/*.sym + make -f src/tools/make/vishap.make -s translate MODEL=-O2 INTSIZE=2 ADRSIZE=4 ALIGNMENT=8 PLATFORM=unix BUILDDIR=bootstrap/unix-48 && rm bootstrap/unix-48/*.sym + make -f src/tools/make/vishap.make -s translate MODEL=-OV INTSIZE=4 ADRSIZE=8 ALIGNMENT=8 PLATFORM=unix BUILDDIR=bootstrap/unix-88 && rm bootstrap/unix-88/*.sym + make -f src/tools/make/vishap.make -s translate MODEL=-O2 INTSIZE=2 ADRSIZE=4 ALIGNMENT=8 PLATFORM=windows BUILDDIR=bootstrap/windows-48 && rm bootstrap/windows-48/*.sym + make -f src/tools/make/vishap.make -s translate MODEL=-OV INTSIZE=4 ADRSIZE=8 ALIGNMENT=8 PLATFORM=windows BUILDDIR=bootstrap/windows-88 && rm bootstrap/windows-88/*.sym cp src/system/*.[ch] bootstrap bootstrapunclean: rm -rf bootstrap/* - make -f src/tools/make/vishap.make -s translate INTSIZE=2 ADRSIZE=4 ALIGNMENT=4 PLATFORM=unix BUILDDIR=bootstrap/unix-44 && rm bootstrap/unix-44/*.sym - make -f src/tools/make/vishap.make -s translate INTSIZE=2 ADRSIZE=4 ALIGNMENT=8 PLATFORM=unix BUILDDIR=bootstrap/unix-48 && rm bootstrap/unix-48/*.sym - make -f src/tools/make/vishap.make -s translate INTSIZE=4 ADRSIZE=8 ALIGNMENT=8 PLATFORM=unix BUILDDIR=bootstrap/unix-88 && rm bootstrap/unix-88/*.sym - make -f src/tools/make/vishap.make -s translate INTSIZE=2 ADRSIZE=4 ALIGNMENT=8 PLATFORM=windows BUILDDIR=bootstrap/windows-48 && rm bootstrap/windows-48/*.sym - make -f src/tools/make/vishap.make -s translate INTSIZE=4 ADRSIZE=8 ALIGNMENT=8 PLATFORM=windows BUILDDIR=bootstrap/windows-88 && rm bootstrap/windows-88/*.sym + make -f src/tools/make/vishap.make -s translate MODEL=-O2 INTSIZE=2 ADRSIZE=4 ALIGNMENT=4 PLATFORM=unix BUILDDIR=bootstrap/unix-44 && rm bootstrap/unix-44/*.sym + make -f src/tools/make/vishap.make -s translate MODEL=-O2 INTSIZE=2 ADRSIZE=4 ALIGNMENT=8 PLATFORM=unix BUILDDIR=bootstrap/unix-48 && rm bootstrap/unix-48/*.sym + make -f src/tools/make/vishap.make -s translate MODEL=-OV INTSIZE=4 ADRSIZE=8 ALIGNMENT=8 PLATFORM=unix BUILDDIR=bootstrap/unix-88 && rm bootstrap/unix-88/*.sym + make -f src/tools/make/vishap.make -s translate MODEL=-O2 INTSIZE=2 ADRSIZE=4 ALIGNMENT=8 PLATFORM=windows BUILDDIR=bootstrap/windows-48 && rm bootstrap/windows-48/*.sym + make -f src/tools/make/vishap.make -s translate MODEL=-OV INTSIZE=4 ADRSIZE=8 ALIGNMENT=8 PLATFORM=windows BUILDDIR=bootstrap/windows-88 && rm bootstrap/windows-88/*.sym cp src/system/*.[ch] bootstrap diff --git a/src/system/Console.Mod b/src/system/Console.Mod index 6b35a090..bf1c9a1d 100644 --- a/src/system/Console.Mod +++ b/src/system/Console.Mod @@ -65,7 +65,7 @@ MODULE Console; (* J. Templ, 29-June-96 *) END Hex; PROCEDURE Read*(VAR ch: CHAR); - VAR n: LONGINT; error: Platform.ErrorCode; + VAR n: SYSTEM.ADDRESS; error: Platform.ErrorCode; BEGIN Flush(); error := Platform.ReadBuf(Platform.StdIn, ch, n); IF n # 1 THEN ch := 0X END diff --git a/src/system/Files.Mod b/src/system/Files.Mod index fb9fc421..388b3a95 100644 --- a/src/system/Files.Mod +++ b/src/system/Files.Mod @@ -34,14 +34,16 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files Buffer = POINTER TO BufDesc; FileDesc = RECORD - workName, registerName: FileName; - tempFile: BOOLEAN; - identity: Platform.FileIdentity; - fd-: Platform.FileHandle; - len, pos: LONGINT; - bufs: ARRAY nofbufs OF Buffer; - swapper, state: INTEGER; - next: File; + workName: FileName; + registerName: FileName; + tempFile: BOOLEAN; + identity: Platform.FileIdentity; + fd-: Platform.FileHandle; + len, pos: LONGINT; + bufs: ARRAY nofbufs OF Buffer; + swapper: INTEGER; + state: INTEGER; + next: File; END; BufDesc = RECORD @@ -52,11 +54,12 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files data: ARRAY bufsize OF SYSTEM.BYTE END; - Rider* = RECORD - res*: LONGINT; - eof*: BOOLEAN; - buf: Buffer; - org, offset: LONGINT + Rider* = RECORD + res*: LONGINT; + eof*: BOOLEAN; + buf: Buffer; + org: LONGINT; + offset: LONGINT END; diff --git a/src/system/Platformunix.Mod b/src/system/Platformunix.Mod index 78daad35..a6e5d399 100644 --- a/src/system/Platformunix.Mod +++ b/src/system/Platformunix.Mod @@ -316,7 +316,7 @@ PROCEDURE -structstats "struct stat s"; PROCEDURE -statdev(): LONGINT "(LONGINT)s.st_dev"; PROCEDURE -statino(): LONGINT "(LONGINT)s.st_ino"; PROCEDURE -statmtime(): LONGINT "(LONGINT)s.st_mtime"; -PROCEDURE -statsize(): LONGINT "(LONGINT)s.st_size"; +PROCEDURE -statsize(): SYSTEM.ADDRESS "(address)s.st_size"; PROCEDURE Identify*(h: FileHandle; VAR identity: FileIdentity): ErrorCode; BEGIN @@ -358,7 +358,7 @@ BEGIN END MTimeAsClock; -PROCEDURE Size*(h: FileHandle; VAR l: LONGINT): ErrorCode; +PROCEDURE Size*(h: FileHandle; VAR l: SYSTEM.ADDRESS): ErrorCode; BEGIN structstats; IF fstat(h) < 0 THEN RETURN err() END; diff --git a/src/tools/make/configure.c b/src/tools/make/configure.c index cd535c97..c000b68b 100644 --- a/src/tools/make/configure.c +++ b/src/tools/make/configure.c @@ -379,6 +379,7 @@ void writeMakeParameters() { fprintf(fd, "ONAME=%s\n", oname); fprintf(fd, "DATAMODEL=%s\n", dataModel); fprintf(fd, "INTSIZE=%d\n", intsize); + fprintf(fd, "MODEL=-O%c\n", intsize == 2 ? '2' : 'V'); fprintf(fd, "ADRSIZE=%d\n", addressSize); fprintf(fd, "ALIGNMENT=%d\n", alignment); fprintf(fd, "INSTALLDIR=%s\n", installdir); diff --git a/src/tools/make/vishap.make b/src/tools/make/vishap.make index 9e9dec60..a56bebea 100644 --- a/src/tools/make/vishap.make +++ b/src/tools/make/vishap.make @@ -97,6 +97,7 @@ translate: @printf "\nmake translate - translating compiler source from Oberon to C:\n" @printf " PLATFORM: %s\n" $(PLATFORM) @printf " INTSIZE: %s\n" $(INTSIZE) + @printf " MODEL: %s\n" $(MODEL) @printf " ADRSIZE: %s\n" $(ADRSIZE) @printf " ALIGNMENT: %s\n" $(ALIGNMENT) @mkdir -p $(BUILDDIR) From 7b8eed99931942e52c11f803f4be6b3f3c8c5cc0 Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 22 Sep 2016 20:48:13 +0100 Subject: [PATCH 245/580] Revert LEN() to returnng LONGINT --- bootstrap/unix-44/OPB.c | 4 ++-- bootstrap/unix-48/OPB.c | 4 ++-- bootstrap/unix-88/OPB.c | 4 ++-- bootstrap/windows-48/OPB.c | 4 ++-- bootstrap/windows-88/OPB.c | 4 ++-- src/compiler/OPB.Mod | 4 ++-- src/tools/make/vishap.make | 1 + 7 files changed, 13 insertions(+), 12 deletions(-) diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index 4c60257b..d0336349 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -2067,7 +2067,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) x->conval->intval += 1; } p = NewOp__53(12, 19, p, x); - p->typ = OPT_adrtyp; + p->typ = OPT_linttyp; } else { p = x; p->conval->intval = typ->n; @@ -2323,7 +2323,7 @@ void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno) p = p->left; dim += 1; } - OPB_BindNodes(12, OPT_adrtyp, &p, OPB_NewIntConst(dim)); + OPB_BindNodes(12, OPT_linttyp, &p, OPB_NewIntConst(dim)); p->subcl = 19; } else { p = OPB_NewIntConst(p->typ->n); diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index 4c60257b..d0336349 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -2067,7 +2067,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) x->conval->intval += 1; } p = NewOp__53(12, 19, p, x); - p->typ = OPT_adrtyp; + p->typ = OPT_linttyp; } else { p = x; p->conval->intval = typ->n; @@ -2323,7 +2323,7 @@ void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno) p = p->left; dim += 1; } - OPB_BindNodes(12, OPT_adrtyp, &p, OPB_NewIntConst(dim)); + OPB_BindNodes(12, OPT_linttyp, &p, OPB_NewIntConst(dim)); p->subcl = 19; } else { p = OPB_NewIntConst(p->typ->n); diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index a3870901..5cea943a 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -2067,7 +2067,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) x->conval->intval += 1; } p = NewOp__53(12, 19, p, x); - p->typ = OPT_adrtyp; + p->typ = OPT_linttyp; } else { p = x; p->conval->intval = typ->n; @@ -2323,7 +2323,7 @@ void OPB_StFct (OPT_Node *par0, int8 fctno, int32 parno) p = p->left; dim += 1; } - OPB_BindNodes(12, OPT_adrtyp, &p, OPB_NewIntConst(dim)); + OPB_BindNodes(12, OPT_linttyp, &p, OPB_NewIntConst(dim)); p->subcl = 19; } else { p = OPB_NewIntConst(p->typ->n); diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index 4c60257b..d0336349 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -2067,7 +2067,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) x->conval->intval += 1; } p = NewOp__53(12, 19, p, x); - p->typ = OPT_adrtyp; + p->typ = OPT_linttyp; } else { p = x; p->conval->intval = typ->n; @@ -2323,7 +2323,7 @@ void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno) p = p->left; dim += 1; } - OPB_BindNodes(12, OPT_adrtyp, &p, OPB_NewIntConst(dim)); + OPB_BindNodes(12, OPT_linttyp, &p, OPB_NewIntConst(dim)); p->subcl = 19; } else { p = OPB_NewIntConst(p->typ->n); diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index a3870901..5cea943a 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -2067,7 +2067,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) x->conval->intval += 1; } p = NewOp__53(12, 19, p, x); - p->typ = OPT_adrtyp; + p->typ = OPT_linttyp; } else { p = x; p->conval->intval = typ->n; @@ -2323,7 +2323,7 @@ void OPB_StFct (OPT_Node *par0, int8 fctno, int32 parno) p = p->left; dim += 1; } - OPB_BindNodes(12, OPT_adrtyp, &p, OPB_NewIntConst(dim)); + OPB_BindNodes(12, OPT_linttyp, &p, OPB_NewIntConst(dim)); p->subcl = 19; } else { p = OPB_NewIntConst(p->typ->n); diff --git a/src/compiler/OPB.Mod b/src/compiler/OPB.Mod index cd3ae496..408eeaeb 100644 --- a/src/compiler/OPB.Mod +++ b/src/compiler/OPB.Mod @@ -1124,7 +1124,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) ELSE x^.obj := NIL; IF typ^.comp = OPT.DynArr THEN WHILE p^.class = OPT.Nindex DO p := p^.left; INC(x^.conval^.intval) END ; (* possible side effect ignored *) - p := NewOp(OPT.Ndop, OPT.len, p, x); p^.typ := OPT.adrtyp + p := NewOp(OPT.Ndop, OPT.len, p, x); p^.typ := OPT.linttyp ELSE p := x; p^.conval^.intval := typ^.n; SetIntType(p) END END @@ -1293,7 +1293,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) ELSIF (fctno = OPT.lenfn) & (parno = 1) THEN (*LEN*) IF p^.typ^.comp = OPT.DynArr THEN dim := 0; WHILE p^.class = OPT.Nindex DO p := p^.left; INC(dim) END ; (* possible side effect ignored *) - BindNodes(OPT.Ndop, OPT.adrtyp, p, NewIntConst(dim)); p^.subcl := OPT.len + BindNodes(OPT.Ndop, OPT.linttyp, p, NewIntConst(dim)); p^.subcl := OPT.len ELSE p := NewIntConst(p^.typ^.n) END diff --git a/src/tools/make/vishap.make b/src/tools/make/vishap.make index a56bebea..99e12608 100644 --- a/src/tools/make/vishap.make +++ b/src/tools/make/vishap.make @@ -20,6 +20,7 @@ FLAVOUR = $(OS).$(DATAMODEL).$(COMPILER) BUILDDIR = build/$(FLAVOUR) VISHAP = $(ONAME)$(BINEXT) +# MODEL=-O2 # Override model - build everything as S8,I16,L32. From cca132d7842840bfdd0703693e14fcf9955c6751 Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 23 Sep 2016 10:53:24 +0100 Subject: [PATCH 246/580] More adjustments to ADDRESS vs LONGINT. An -O2 on 64 bit compiler has worked once! --- bootstrap/SYSTEM.h | 10 +- bootstrap/unix-44/Configuration.c | 4 +- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Console.c | 6 +- bootstrap/unix-44/Console.h | 2 +- bootstrap/unix-44/Files.c | 116 ++++++++++---------- bootstrap/unix-44/Files.h | 60 +++++------ bootstrap/unix-44/Heap.c | 10 +- bootstrap/unix-44/Heap.h | 4 +- bootstrap/unix-44/Modules.c | 6 +- bootstrap/unix-44/Modules.h | 6 +- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 8 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 14 +-- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 4 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 14 +-- bootstrap/unix-44/OPT.h | 10 +- bootstrap/unix-44/OPV.c | 4 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Platform.c | 28 ++--- bootstrap/unix-44/Platform.h | 16 +-- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 154 +++++++++++++-------------- bootstrap/unix-44/Texts.h | 78 +++++++------- bootstrap/unix-44/Vishap.c | 2 +- bootstrap/unix-44/errors.c | 2 +- bootstrap/unix-44/errors.h | 2 +- bootstrap/unix-44/extTools.c | 2 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-44/vt100.c | 2 +- bootstrap/unix-44/vt100.h | 2 +- bootstrap/unix-48/Configuration.c | 4 +- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Console.c | 6 +- bootstrap/unix-48/Console.h | 2 +- bootstrap/unix-48/Files.c | 116 ++++++++++---------- bootstrap/unix-48/Files.h | 60 +++++------ bootstrap/unix-48/Heap.c | 10 +- bootstrap/unix-48/Heap.h | 4 +- bootstrap/unix-48/Modules.c | 6 +- bootstrap/unix-48/Modules.h | 6 +- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 8 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 14 +-- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 4 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 14 +-- bootstrap/unix-48/OPT.h | 10 +- bootstrap/unix-48/OPV.c | 4 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Platform.c | 28 ++--- bootstrap/unix-48/Platform.h | 16 +-- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 154 +++++++++++++-------------- bootstrap/unix-48/Texts.h | 78 +++++++------- bootstrap/unix-48/Vishap.c | 2 +- bootstrap/unix-48/errors.c | 2 +- bootstrap/unix-48/errors.h | 2 +- bootstrap/unix-48/extTools.c | 2 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-48/vt100.c | 2 +- bootstrap/unix-48/vt100.h | 2 +- bootstrap/unix-88/Configuration.c | 4 +- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Console.c | 6 +- bootstrap/unix-88/Console.h | 2 +- bootstrap/unix-88/Files.c | 116 ++++++++++---------- bootstrap/unix-88/Files.h | 60 +++++------ bootstrap/unix-88/Heap.c | 10 +- bootstrap/unix-88/Heap.h | 4 +- bootstrap/unix-88/Modules.c | 6 +- bootstrap/unix-88/Modules.h | 6 +- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 8 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 14 +-- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 4 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 14 +-- bootstrap/unix-88/OPT.h | 10 +- bootstrap/unix-88/OPV.c | 4 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Platform.c | 28 ++--- bootstrap/unix-88/Platform.h | 16 +-- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 154 +++++++++++++-------------- bootstrap/unix-88/Texts.h | 78 +++++++------- bootstrap/unix-88/Vishap.c | 2 +- bootstrap/unix-88/errors.c | 2 +- bootstrap/unix-88/errors.h | 2 +- bootstrap/unix-88/extTools.c | 2 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/unix-88/vt100.c | 2 +- bootstrap/unix-88/vt100.h | 2 +- bootstrap/windows-48/Configuration.c | 4 +- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Console.c | 6 +- bootstrap/windows-48/Console.h | 2 +- bootstrap/windows-48/Files.c | 116 ++++++++++---------- bootstrap/windows-48/Files.h | 60 +++++------ bootstrap/windows-48/Heap.c | 10 +- bootstrap/windows-48/Heap.h | 4 +- bootstrap/windows-48/Modules.c | 6 +- bootstrap/windows-48/Modules.h | 6 +- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 8 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 14 +-- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 4 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 14 +-- bootstrap/windows-48/OPT.h | 10 +- bootstrap/windows-48/OPV.c | 4 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Platform.c | 16 +-- bootstrap/windows-48/Platform.h | 10 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 154 +++++++++++++-------------- bootstrap/windows-48/Texts.h | 78 +++++++------- bootstrap/windows-48/Vishap.c | 2 +- bootstrap/windows-48/errors.c | 2 +- bootstrap/windows-48/errors.h | 2 +- bootstrap/windows-48/extTools.c | 2 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-48/vt100.c | 2 +- bootstrap/windows-48/vt100.h | 2 +- bootstrap/windows-88/Configuration.c | 4 +- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Console.c | 6 +- bootstrap/windows-88/Console.h | 2 +- bootstrap/windows-88/Files.c | 116 ++++++++++---------- bootstrap/windows-88/Files.h | 60 +++++------ bootstrap/windows-88/Heap.c | 10 +- bootstrap/windows-88/Heap.h | 4 +- bootstrap/windows-88/Modules.c | 6 +- bootstrap/windows-88/Modules.h | 6 +- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 8 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 14 +-- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 4 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 14 +-- bootstrap/windows-88/OPT.h | 10 +- bootstrap/windows-88/OPV.c | 4 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Platform.c | 16 +-- bootstrap/windows-88/Platform.h | 10 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 154 +++++++++++++-------------- bootstrap/windows-88/Texts.h | 78 +++++++------- bootstrap/windows-88/Vishap.c | 2 +- bootstrap/windows-88/errors.c | 2 +- bootstrap/windows-88/errors.h | 2 +- bootstrap/windows-88/extTools.c | 2 +- bootstrap/windows-88/extTools.h | 2 +- bootstrap/windows-88/vt100.c | 2 +- bootstrap/windows-88/vt100.h | 2 +- src/compiler/OPC.Mod | 6 +- src/system/Console.Mod | 2 +- src/system/Platformunix.Mod | 10 +- src/system/SYSTEM.h | 10 +- src/tools/make/vishap.make | 2 +- 201 files changed, 1468 insertions(+), 1456 deletions(-) diff --git a/bootstrap/SYSTEM.h b/bootstrap/SYSTEM.h index ddd85144..6ddf909a 100644 --- a/bootstrap/SYSTEM.h +++ b/bootstrap/SYSTEM.h @@ -243,10 +243,16 @@ static inline double SYSTEM_ABSD(double i) {return i >= 0.0 ? i : -i;} #define __CASECHK __HALT(-4) #define __WITHCHK __HALT(-7) -#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(address)typ##__typ) -#define __TYPEOF(p) ((LONGINT*)(address)(*(((LONGINT*)(p))-1))) + +//#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(address)typ##__typ) +//#define __TYPEOF(p) ((address*)(address)(*(((LONGINT*)(p))-1))) +//#define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) + +#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(address)typ##__typ) +#define __TYPEOF(p) ((address*)(address)(*(((address*)(p))-1))) #define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) + #define __GUARDP(p, typ, level) ((typ*)(__ISP(p,typ,level)?p:(__HALT(-5),p))) #define __GUARDR(r, typ, level) (*((typ*)(__IS(r##__typ,typ,level)?r:(__HALT(-5),r)))) #define __GUARDA(p, typ, level) ((struct typ*)(__IS(__TYPEOF(p),typ,level)?p:(__HALT(-5),p))) diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index b17dc344..abdf151b 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/22] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/23] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index dca477a6..f51f63f2 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Console.c b/bootstrap/unix-44/Console.c index 3f691a07..115e60f5 100644 --- a/bootstrap/unix-44/Console.c +++ b/bootstrap/unix-44/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -118,10 +118,10 @@ void Console_Hex (int32 i) void Console_Read (CHAR *ch) { - address n; + int32 n; int16 error; Console_Flush(); - error = Platform_ReadBuf(0, (void*)&*ch, 1, (void*)&n); + error = Platform_ReadBuf(0, (void*)&*ch, 1, &n); if (n != 1) { *ch = 0x00; } diff --git a/bootstrap/unix-44/Console.h b/bootstrap/unix-44/Console.h index 6837ab77..b08c93ea 100644 --- a/bootstrap/unix-44/Console.h +++ b/bootstrap/unix-44/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 3ff2fa83..0a7ac692 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -56,11 +56,11 @@ static struct { CHAR data[1]; } *Files_SearchPath; -export LONGINT *Files_FileDesc__typ; -export LONGINT *Files_BufDesc__typ; -export LONGINT *Files_Rider__typ; +export address *Files_FileDesc__typ; +export address *Files_BufDesc__typ; +export address *Files_Rider__typ; -export Files_File Files_Base (Files_Rider *r, LONGINT *r__typ); +export Files_File Files_Base (Files_Rider *r, address *r__typ); static Files_File Files_CacheEntry (Platform_FileIdentity identity); export void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int16 *res); export void Files_Close (Files_File f); @@ -79,37 +79,37 @@ export int32 Files_Length (Files_File f); static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT name__len, CHAR *dest, LONGINT dest__len); export Files_File Files_New (CHAR *name, LONGINT name__len); export Files_File Files_Old (CHAR *name, LONGINT name__len); -export int32 Files_Pos (Files_Rider *r, LONGINT *r__typ); +export int32 Files_Pos (Files_Rider *r, address *r__typ); export void Files_Purge (Files_File f); -export void Files_Read (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x); -export void Files_ReadBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN *x); -export void Files_ReadByte (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len); -export void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); -export void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, int16 *x); -export void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, int32 *x); -export void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x); -export void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); -export void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int32 *x); -export void Files_ReadNum64 (Files_Rider *R, LONGINT *R__typ, int64 *x); -export void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x); -export void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x); -export void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); +export void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x); +export void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x); +export void Files_ReadByte (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len); +export void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); +export void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x); +export void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); +export void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); +export void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); +export void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x); +export void Files_ReadNum64 (Files_Rider *R, address *R__typ, int64 *x); +export void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); +export void Files_ReadSet (Files_Rider *R, address *R__typ, SET *x); +export void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); export void Files_Register (Files_File f); export void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res); static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len); -export void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, int32 pos); +export void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos); export void Files_SetSearchPath (CHAR *path, LONGINT path__len); -export void Files_Write (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE x); -export void Files_WriteBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN x); -export void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); -export void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, int16 x); -export void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, int32 x); -export void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x); -export void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int32 x); -export void Files_WriteNum64 (Files_Rider *R, LONGINT *R__typ, int64 x); -export void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x); -export void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x); -export void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); +export void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x); +export void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x); +export void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); +export void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x); +export void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x); +export void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x); +export void Files_WriteNum (Files_Rider *R, address *R__typ, int32 x); +export void Files_WriteNum64 (Files_Rider *R, address *R__typ, int64 x); +export void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x); +export void Files_WriteSet (Files_Rider *R, address *R__typ, SET x); +export void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); #define Files_IdxTrap() __HALT(-1) @@ -544,14 +544,14 @@ void Files_GetDate (Files_File f, int32 *t, int32 *d) Platform_MTimeAsClock(identity, &*t, &*d); } -int32 Files_Pos (Files_Rider *r, LONGINT *r__typ) +int32 Files_Pos (Files_Rider *r, address *r__typ) { int32 _o_result; _o_result = (*r).org + (*r).offset; return _o_result; } -void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, int32 pos) +void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos) { int32 org, offset, i, n; Files_Buffer buf = NIL; @@ -613,7 +613,7 @@ void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, int32 pos) (*r).res = 0; } -void Files_Read (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x) +void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x) { int32 offset; Files_Buffer buf = NIL; @@ -637,7 +637,7 @@ void Files_Read (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x) } } -void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n) +void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n) { int32 xpos, min, restInBuf, offset; Files_Buffer buf = NIL; @@ -673,19 +673,19 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x (*r).eof = 0; } -void Files_ReadByte (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len) +void Files_ReadByte (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len) { Files_ReadBytes(&*r, r__typ, (void*)x, x__len * 1, 1); } -Files_File Files_Base (Files_Rider *r, LONGINT *r__typ) +Files_File Files_Base (Files_Rider *r, address *r__typ) { Files_File _o_result; _o_result = (*r).buf->f; return _o_result; } -void Files_Write (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE x) +void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x) { Files_Buffer buf = NIL; int32 offset; @@ -706,7 +706,7 @@ void Files_Write (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE x) (*r).res = 0; } -void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n) +void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n) { int32 xpos, min, restInBuf, offset; Files_Buffer buf = NIL; @@ -849,26 +849,26 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *de } } -void Files_ReadBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN *x) +void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x) { Files_Read(&*R, R__typ, (CHAR*)(void*)&*x); } -void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, int16 *x) +void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x) { CHAR b[2]; Files_ReadBytes(&*R, R__typ, (void*)b, 2, 2); *x = (int16)b[0] + __ASHL((int16)b[1], 8); } -void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, int32 *x) +void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x) { CHAR b[4]; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); *x = (((int16)b[0] + __ASHL((int16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); } -void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x) +void Files_ReadSet (Files_Rider *R, address *R__typ, SET *x) { CHAR b[4]; int32 l; @@ -877,21 +877,21 @@ void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x) *x = (SET)l; } -void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x) +void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x) { CHAR b[4]; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); Files_FlipBytes((void*)b, 4, (void*)&*x, 4); } -void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x) +void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x) { CHAR b[8]; Files_ReadBytes(&*R, R__typ, (void*)b, 8, 8); Files_FlipBytes((void*)b, 8, (void*)&*x, 8); } -void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) +void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) { int16 i; CHAR ch; @@ -903,7 +903,7 @@ void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) } while (!(ch == 0x00)); } -void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) +void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) { int16 i; CHAR ch; @@ -921,7 +921,7 @@ void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) } while (!b); } -void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int32 *x) +void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x) { int8 s; CHAR ch; @@ -938,19 +938,19 @@ void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int32 *x) *x = n; } -void Files_ReadNum64 (Files_Rider *R, LONGINT *R__typ, int64 *x) +void Files_ReadNum64 (Files_Rider *R, address *R__typ, int64 *x) { int32 n; Files_ReadNum(&*R, R__typ, &n); *x = n; } -void Files_WriteBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN x) +void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x) { Files_Write(&*R, R__typ, __VAL(CHAR, x)); } -void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, int16 x) +void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x) { CHAR b[2]; b[0] = (CHAR)x; @@ -958,7 +958,7 @@ void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, int16 x) Files_WriteBytes(&*R, R__typ, (void*)b, 2, 2); } -void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, int32 x) +void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x) { CHAR b[4]; b[0] = (CHAR)x; @@ -968,7 +968,7 @@ void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, int32 x) Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } -void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x) +void Files_WriteSet (Files_Rider *R, address *R__typ, SET x) { CHAR b[4]; int32 i; @@ -980,21 +980,21 @@ void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x) Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } -void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x) +void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x) { CHAR b[4]; Files_FlipBytes((void*)&x, 4, (void*)b, 4); Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } -void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x) +void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x) { CHAR b[8]; Files_FlipBytes((void*)&x, 8, (void*)b, 8); Files_WriteBytes(&*R, R__typ, (void*)b, 8, 8); } -void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) +void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) { int16 i; i = 0; @@ -1004,7 +1004,7 @@ void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len Files_WriteBytes(&*R, R__typ, (void*)x, x__len * 1, i + 1); } -void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int32 x) +void Files_WriteNum (Files_Rider *R, address *R__typ, int32 x) { while (x < -64 || x > 63) { Files_Write(&*R, R__typ, (CHAR)(__MASK(x, -128) + 128)); @@ -1013,7 +1013,7 @@ void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int32 x) Files_Write(&*R, R__typ, (CHAR)__MASK(x, -128)); } -void Files_WriteNum64 (Files_Rider *R, LONGINT *R__typ, int64 x) +void Files_WriteNum64 (Files_Rider *R, address *R__typ, int64 x) { while (x < -64 || x > 63) { Files_Write(&*R, R__typ, (CHAR)(__MASK(x, -128) + 128)); diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index 4fd2efd8..e2b7a3bb 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tspaSfF */ #ifndef Files__h #define Files__h @@ -24,10 +24,10 @@ typedef -import LONGINT *Files_FileDesc__typ; -import LONGINT *Files_Rider__typ; +import address *Files_FileDesc__typ; +import address *Files_Rider__typ; -import Files_File Files_Base (Files_Rider *r, LONGINT *r__typ); +import Files_File Files_Base (Files_Rider *r, address *r__typ); import void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int16 *res); import void Files_Close (Files_File f); import void Files_Delete (CHAR *name, LONGINT name__len, int16 *res); @@ -36,36 +36,36 @@ import void Files_GetName (Files_File f, CHAR *name, LONGINT name__len); import int32 Files_Length (Files_File f); import Files_File Files_New (CHAR *name, LONGINT name__len); import Files_File Files_Old (CHAR *name, LONGINT name__len); -import int32 Files_Pos (Files_Rider *r, LONGINT *r__typ); +import int32 Files_Pos (Files_Rider *r, address *r__typ); import void Files_Purge (Files_File f); -import void Files_Read (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x); -import void Files_ReadBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN *x); -import void Files_ReadByte (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len); -import void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); -import void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, int16 *x); -import void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, int32 *x); -import void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x); -import void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); -import void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int32 *x); -import void Files_ReadNum64 (Files_Rider *R, LONGINT *R__typ, int64 *x); -import void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x); -import void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x); -import void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); +import void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x); +import void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x); +import void Files_ReadByte (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len); +import void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); +import void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x); +import void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); +import void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); +import void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); +import void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x); +import void Files_ReadNum64 (Files_Rider *R, address *R__typ, int64 *x); +import void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); +import void Files_ReadSet (Files_Rider *R, address *R__typ, SET *x); +import void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); import void Files_Register (Files_File f); import void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res); -import void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, int32 pos); +import void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos); import void Files_SetSearchPath (CHAR *path, LONGINT path__len); -import void Files_Write (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE x); -import void Files_WriteBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN x); -import void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); -import void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, int16 x); -import void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, int32 x); -import void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x); -import void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int32 x); -import void Files_WriteNum64 (Files_Rider *R, LONGINT *R__typ, int64 x); -import void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x); -import void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x); -import void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); +import void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x); +import void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x); +import void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); +import void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x); +import void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x); +import void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x); +import void Files_WriteNum (Files_Rider *R, address *R__typ, int32 x); +import void Files_WriteNum64 (Files_Rider *R, address *R__typ, int64 x); +import void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x); +import void Files_WriteSet (Files_Rider *R, address *R__typ, SET x); +import void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); import void *Files__init(void); diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index 17784d67..b7c8c827 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tsSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tsSfF */ #define INTEGER int16 #define LONGINT int32 @@ -74,10 +74,10 @@ static int16 Heap_lockdepth; static BOOLEAN Heap_interrupted; export int16 Heap_FileCount; -export LONGINT *Heap_ModuleDesc__typ; -export LONGINT *Heap_CmdDesc__typ; -export LONGINT *Heap_FinDesc__typ; -export LONGINT *Heap__1__typ; +export address *Heap_ModuleDesc__typ; +export address *Heap_CmdDesc__typ; +export address *Heap_FinDesc__typ; +export address *Heap__1__typ; static void Heap_CheckFin (void); static void Heap_ExtendHeap (address blksz); diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index b1c745df..6ad4813e 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tsSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tsSfF */ #ifndef Heap__h #define Heap__h @@ -34,7 +34,7 @@ import SYSTEM_PTR Heap_modules; import address Heap_allocated, Heap_heapsize; import int16 Heap_FileCount; -import LONGINT *Heap_ModuleDesc__typ; +import address *Heap_ModuleDesc__typ; import void Heap_FINALL (void); import void Heap_GC (BOOLEAN markStack); diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index 1564f5e0..7704f005 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -43,8 +43,8 @@ export int16 Modules_res; export CHAR Modules_resMsg[256]; export Modules_ModuleName Modules_imported, Modules_importing; -export LONGINT *Modules_ModuleDesc__typ; -export LONGINT *Modules_CmdDesc__typ; +export address *Modules_ModuleDesc__typ; +export address *Modules_CmdDesc__typ; static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len); export void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all); diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index dbc243c8..060208c6 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef Modules__h #define Modules__h @@ -40,8 +40,8 @@ import int16 Modules_res; import CHAR Modules_resMsg[256]; import Modules_ModuleName Modules_imported, Modules_importing; -import LONGINT *Modules_ModuleDesc__typ; -import LONGINT *Modules_CmdDesc__typ; +import address *Modules_ModuleDesc__typ; +import address *Modules_CmdDesc__typ; import void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all); import Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len); diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index d0336349..af4f4fc4 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index 434172a2..dc0085af 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 11f64b59..99353400 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -1041,7 +1041,7 @@ static void OPC_IdentList (OPT_Object obj, int16 vis) } else if ((obj->mode == 2 && obj->typ->comp == 4)) { OPC_EndStat(); OPC_BegStat(); - OPM_WriteString((CHAR*)"LONGINT *", 10); + OPM_WriteString((CHAR*)"address *", 10); OPC_Ident(obj); OPM_WriteString((CHAR*)"__typ", 6); base = NIL; @@ -1078,7 +1078,7 @@ static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames) OPM_WriteString((CHAR*)", LONGINT ", 11); OPC_LenList(obj, 1, showParamNames); } else if ((obj->mode == 2 && obj->typ->comp == 4)) { - OPM_WriteString((CHAR*)", LONGINT *", 12); + OPM_WriteString((CHAR*)", address *", 12); if (showParamNames) { OPC_Ident(obj); OPM_WriteString((CHAR*)"__typ", 6); @@ -1166,7 +1166,7 @@ static void OPC_GenDynTypes (OPT_Node n, int16 vis) } else { OPM_WriteString((CHAR*)"export ", 8); } - OPM_WriteString((CHAR*)"LONGINT *", 10); + OPM_WriteString((CHAR*)"address *", 10); OPC_Andent(typ); OPM_WriteString((CHAR*)"__typ", 6); OPC_EndStat(); diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index 09952648..4215947f 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 2122bed9..039d1c77 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -41,7 +41,7 @@ static CHAR OPM_OBERON[1024]; static CHAR OPM_MODULES[1024]; -static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F); +static void OPM_Append (Files_Rider *R, address *R__typ, Files_File F); export void OPM_CloseFiles (void); export void OPM_CloseOldSym (void); export void OPM_DeleteNewSym (void); @@ -49,10 +49,10 @@ export void OPM_FPrint (int32 *fp, int64 val); export void OPM_FPrintLReal (int32 *fp, LONGREAL lr); export void OPM_FPrintReal (int32 *fp, REAL real); export void OPM_FPrintSet (int32 *fp, SET set); -static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, int64 pos); +static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 pos); export void OPM_Get (CHAR *ch); static void OPM_GetProperties (void); -static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONGINT name__len, int16 *size, int16 *align); +static void OPM_GetProperty (Texts_Scanner *S, address *S__typ, CHAR *name, LONGINT name__len, int16 *size, int16 *align); export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); export void OPM_InitOptions (void); export int16 OPM_Integer (int64 n); @@ -496,7 +496,7 @@ static void OPM_LogErrMsg (int16 n) OPM_LogWStr(errors_errors[__X(n, 350)], 128); } -static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, int64 pos) +static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 pos) { CHAR ch, cheol; if (pos < (int64)OPM_ErrorLineStartPos) { @@ -654,7 +654,7 @@ void OPM_FPrintLReal (int32 *fp, LONGREAL lr) OPM_FPrint(&*fp, h); } -static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONGINT name__len, int16 *size, int16 *align) +static void OPM_GetProperty (Texts_Scanner *S, address *S__typ, CHAR *name, LONGINT name__len, int16 *size, int16 *align) { __DUP(name, name__len, CHAR); if (((*S).class == 1 && __STRCMP((*S).s, name) == 0)) { @@ -996,7 +996,7 @@ void OPM_WriteLn (void) Files_Write(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, 0x0a); } -static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F) +static void OPM_Append (Files_Rider *R, address *R__typ, Files_File F) { Files_Rider R1; CHAR buffer[4096]; diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index 8ca21351..a6b7990c 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index d2b3e83f..a3ab1dd3 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -24,7 +24,7 @@ static OPT_Node OPP_TDinit, OPP_lastTDinit; static int16 OPP_nofFwdPtr; static OPT_Struct OPP_FwdPtr[64]; -export LONGINT *OPP__1__typ; +export address *OPP__1__typ; static void OPP_ActualParameters (OPT_Node *aparlist, OPT_Object fpar); static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned); diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index 28045a86..e5a59f6c 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index 99aba006..0cac83bd 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index f7dd1d10..caef45f4 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index bd7bde13..8e7d9b8d 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -101,12 +101,12 @@ static OPT_ExpCtxt OPT_expCtxt; static int32 OPT_nofhdfld; static BOOLEAN OPT_newsf, OPT_findpc, OPT_extsf, OPT_sfpresent, OPT_symExtended, OPT_symNew; -export LONGINT *OPT_ConstDesc__typ; -export LONGINT *OPT_ObjDesc__typ; -export LONGINT *OPT_StrDesc__typ; -export LONGINT *OPT_NodeDesc__typ; -export LONGINT *OPT_ImpCtxt__typ; -export LONGINT *OPT_ExpCtxt__typ; +export address *OPT_ConstDesc__typ; +export address *OPT_ObjDesc__typ; +export address *OPT_StrDesc__typ; +export address *OPT_NodeDesc__typ; +export address *OPT_ImpCtxt__typ; +export address *OPT_ExpCtxt__typ; export void OPT_Close (void); export void OPT_CloseScope (void); diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index 5de02c8b..0bd1f189 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPT__h #define OPT__h @@ -75,10 +75,10 @@ import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; import BOOLEAN OPT_SYSimported; -import LONGINT *OPT_ConstDesc__typ; -import LONGINT *OPT_ObjDesc__typ; -import LONGINT *OPT_StrDesc__typ; -import LONGINT *OPT_NodeDesc__typ; +import address *OPT_ConstDesc__typ; +import address *OPT_ObjDesc__typ; +import address *OPT_StrDesc__typ; +import address *OPT_NodeDesc__typ; import void OPT_Close (void); import void OPT_CloseScope (void); diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index efddd202..8bb5ec32 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -21,7 +21,7 @@ static int32 OPV_recno; static OPV_ExitInfo OPV_exit; static int16 OPV_nofExitLabels; -export LONGINT *OPV_ExitInfo__typ; +export address *OPV_ExitInfo__typ; static void OPV_ActualPar (OPT_Node n, OPT_Object fp); export void OPV_AdrAndSize (OPT_Object topScope); diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index 4a3f9d07..c309d63c 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index e2eb0c80..9de57a27 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -42,7 +42,7 @@ static int32 Platform_TimeStart; export int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; export CHAR Platform_nl[3]; -export LONGINT *Platform_FileIdentity__typ; +export address *Platform_FileIdentity__typ; export BOOLEAN Platform_Absent (int16 e); export int16 Platform_ArgPos (CHAR *s, LONGINT s__len); @@ -61,8 +61,8 @@ export void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val export void Platform_GetIntArg (int16 n, int32 *val); export void Platform_GetTimeOfDay (int32 *sec, int32 *usec); export void Platform_Halt (int32 code); -export int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, LONGINT *identity__typ); -export int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); +export int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ); +export int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); export BOOLEAN Platform_Inaccessible (int16 e); export void Platform_Init (int16 argc, address argvadr); export void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); @@ -72,8 +72,8 @@ export address Platform_OSAllocate (address size); export void Platform_OSFree (address address); export int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); export int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); -export int16 Platform_Read (int32 h, address p, address l, address *n); -export int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, address *n); +export int16 Platform_Read (int32 h, address p, int32 l, int32 *n); +export int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n); export int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); export BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); export BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); @@ -81,9 +81,9 @@ export int16 Platform_Seek (int32 h, int32 offset, int16 whence); export void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); export void Platform_SetHalt (Platform_HaltProcedure p); export void Platform_SetInterruptHandler (Platform_SignalHandler handler); -export void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Platform_FileIdentity source); +export void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Platform_FileIdentity source); export void Platform_SetQuitHandler (Platform_SignalHandler handler); -export int16 Platform_Size (int32 h, address *l); +export int16 Platform_Size (int32 h, int32 *l); export int16 Platform_Sync (int32 h); export int16 Platform_System (CHAR *cmd, LONGINT cmd__len); static void Platform_TestLittleEndian (void); @@ -446,7 +446,7 @@ int16 Platform_Close (int32 h) __RETCHK; } -int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, LONGINT *identity__typ) +int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ) { int16 _o_result; Platform_structstats(); @@ -461,7 +461,7 @@ int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, LONGINT *iden return _o_result; } -int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ) +int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ) { int16 _o_result; __DUP(n, n__len, CHAR); @@ -493,7 +493,7 @@ BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i return _o_result; } -void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Platform_FileIdentity source) +void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Platform_FileIdentity source) { (*target).mtime = source.mtime; } @@ -504,7 +504,7 @@ void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d) Platform_YMDHMStoClock(Platform_tmyear(), Platform_tmmon(), Platform_tmmday(), Platform_tmhour(), Platform_tmmin(), Platform_tmsec(), &*t, &*d); } -int16 Platform_Size (int32 h, address *l) +int16 Platform_Size (int32 h, int32 *l) { int16 _o_result; Platform_structstats(); @@ -517,7 +517,7 @@ int16 Platform_Size (int32 h, address *l) return _o_result; } -int16 Platform_Read (int32 h, address p, address l, address *n) +int16 Platform_Read (int32 h, address p, int32 l, int32 *n) { int16 _o_result; *n = Platform_readfile(h, p, l); @@ -532,7 +532,7 @@ int16 Platform_Read (int32 h, address p, address l, address *n) __RETCHK; } -int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, address *n) +int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n) { int16 _o_result; *n = Platform_readfile(h, (address)b, b__len); diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index d024c4ed..bc487769 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef Platform__h #define Platform__h @@ -27,7 +27,7 @@ import address Platform_ArgVector; import int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; import CHAR Platform_nl[3]; -import LONGINT *Platform_FileIdentity__typ; +import address *Platform_FileIdentity__typ; import BOOLEAN Platform_Absent (int16 e); import int16 Platform_ArgPos (CHAR *s, LONGINT s__len); @@ -45,8 +45,8 @@ import void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val import void Platform_GetIntArg (int16 n, int32 *val); import void Platform_GetTimeOfDay (int32 *sec, int32 *usec); import void Platform_Halt (int32 code); -import int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, LONGINT *identity__typ); -import int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); +import int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ); +import int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); import BOOLEAN Platform_Inaccessible (int16 e); import void Platform_Init (int16 argc, address argvadr); import void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); @@ -56,8 +56,8 @@ import address Platform_OSAllocate (address size); import void Platform_OSFree (address address); import int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); import int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); -import int16 Platform_Read (int32 h, address p, address l, address *n); -import int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, address *n); +import int16 Platform_Read (int32 h, address p, int32 l, int32 *n); +import int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n); import int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); import BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); import BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); @@ -65,9 +65,9 @@ import int16 Platform_Seek (int32 h, int32 offset, int16 whence); import void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); import void Platform_SetHalt (Platform_HaltProcedure p); import void Platform_SetInterruptHandler (Platform_SignalHandler handler); -import void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Platform_FileIdentity source); +import void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Platform_FileIdentity source); import void Platform_SetQuitHandler (Platform_SignalHandler handler); -import int16 Platform_Size (int32 h, address *l); +import int16 Platform_Size (int32 h, int32 *l); import int16 Platform_Sync (int32 h); import int16 Platform_System (CHAR *cmd, LONGINT cmd__len); import int32 Platform_Time (void); diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index c1ffff0a..fe93e8be 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index 0ccc7989..e7cba0d8 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index 0f221fe7..427a0cc4 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index 9fdb55fb..44c51b2a 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index b29595be..f63a7cb6 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -33,7 +33,7 @@ typedef } Texts_ElemMsg; typedef - void (*Texts_Handler)(Texts_Elem, Texts_ElemMsg*, LONGINT *); + void (*Texts_Handler)(Texts_Elem, Texts_ElemMsg*, address *); typedef struct Texts_TextDesc *Texts_Text; @@ -167,20 +167,20 @@ export Texts_Elem Texts_new; static Texts_Buffer Texts_del; static Texts_FontsFont Texts_FontsDefault; -export LONGINT *Texts_FontDesc__typ; -export LONGINT *Texts_RunDesc__typ; -export LONGINT *Texts_PieceDesc__typ; -export LONGINT *Texts_ElemMsg__typ; -export LONGINT *Texts_ElemDesc__typ; -export LONGINT *Texts_FileMsg__typ; -export LONGINT *Texts_CopyMsg__typ; -export LONGINT *Texts_IdentifyMsg__typ; -export LONGINT *Texts_BufDesc__typ; -export LONGINT *Texts_TextDesc__typ; -export LONGINT *Texts_Reader__typ; -export LONGINT *Texts_Scanner__typ; -export LONGINT *Texts_Writer__typ; -export LONGINT *Texts__1__typ; +export address *Texts_FontDesc__typ; +export address *Texts_RunDesc__typ; +export address *Texts_PieceDesc__typ; +export address *Texts_ElemMsg__typ; +export address *Texts_ElemDesc__typ; +export address *Texts_FileMsg__typ; +export address *Texts_CopyMsg__typ; +export address *Texts_IdentifyMsg__typ; +export address *Texts_BufDesc__typ; +export address *Texts_TextDesc__typ; +export address *Texts_Reader__typ; +export address *Texts_Scanner__typ; +export address *Texts_Writer__typ; +export address *Texts__1__typ; export void Texts_Append (Texts_Text T, Texts_Buffer B); export void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff); @@ -194,41 +194,41 @@ export Texts_Text Texts_ElemBase (Texts_Elem E); export int32 Texts_ElemPos (Texts_Elem E); static void Texts_Find (Texts_Text T, int32 *pos, Texts_Run *u, int32 *org, int32 *off); static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len); -static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, LONGINT *msg__typ); +static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, address *msg__typ); export void Texts_Insert (Texts_Text T, int32 pos, Texts_Buffer B); -export void Texts_Load (Files_Rider *r, LONGINT *r__typ, Texts_Text T); -static void Texts_Load0 (Files_Rider *r, LONGINT *r__typ, Texts_Text T); +export void Texts_Load (Files_Rider *r, address *r__typ, Texts_Text T); +static void Texts_Load0 (Files_Rider *r, address *r__typ, Texts_Text T); static void Texts_Merge (Texts_Text T, Texts_Run u, Texts_Run *v); export void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len); export void Texts_OpenBuf (Texts_Buffer B); -export void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, int32 pos); -export void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, int32 pos); -export void Texts_OpenWriter (Texts_Writer *W, LONGINT *W__typ); -export int32 Texts_Pos (Texts_Reader *R, LONGINT *R__typ); -export void Texts_Read (Texts_Reader *R, LONGINT *R__typ, CHAR *ch); -export void Texts_ReadElem (Texts_Reader *R, LONGINT *R__typ); -export void Texts_ReadPrevElem (Texts_Reader *R, LONGINT *R__typ); +export void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int32 pos); +export void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int32 pos); +export void Texts_OpenWriter (Texts_Writer *W, address *W__typ); +export int32 Texts_Pos (Texts_Reader *R, address *R__typ); +export void Texts_Read (Texts_Reader *R, address *R__typ, CHAR *ch); +export void Texts_ReadElem (Texts_Reader *R, address *R__typ); +export void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ); export void Texts_Recall (Texts_Buffer *B); export void Texts_Save (Texts_Text T, int32 beg, int32 end, Texts_Buffer B); -export void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ); -export void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, int8 col); -export void Texts_SetFont (Texts_Writer *W, LONGINT *W__typ, Texts_FontsFont fnt); -export void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, int8 voff); +export void Texts_Scan (Texts_Scanner *S, address *S__typ); +export void Texts_SetColor (Texts_Writer *W, address *W__typ, int8 col); +export void Texts_SetFont (Texts_Writer *W, address *W__typ, Texts_FontsFont fnt); +export void Texts_SetOffset (Texts_Writer *W, address *W__typ, int8 voff); static void Texts_Splice (Texts_Run un, Texts_Run v, Texts_Run w, Texts_Text base); static void Texts_Split (int32 off, Texts_Run *u, Texts_Run *un); -export void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T); -export void Texts_Write (Texts_Writer *W, LONGINT *W__typ, CHAR ch); -export void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, int32 t, int32 d); -export void Texts_WriteElem (Texts_Writer *W, LONGINT *W__typ, Texts_Elem e); -export void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, int32 x); -export void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int64 x, int64 n); -export void Texts_WriteLn (Texts_Writer *W, LONGINT *W__typ); -export void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, int16 n); -export void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x); -export void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, int16 n); -export void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, int16 n, int16 k); -export void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x); -export void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__len); +export void Texts_Store (Files_Rider *r, address *r__typ, Texts_Text T); +export void Texts_Write (Texts_Writer *W, address *W__typ, CHAR ch); +export void Texts_WriteDate (Texts_Writer *W, address *W__typ, int32 t, int32 d); +export void Texts_WriteElem (Texts_Writer *W, address *W__typ, Texts_Elem e); +export void Texts_WriteHex (Texts_Writer *W, address *W__typ, int32 x); +export void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n); +export void Texts_WriteLn (Texts_Writer *W, address *W__typ); +export void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int16 n); +export void Texts_WriteLongRealHex (Texts_Writer *W, address *W__typ, LONGREAL x); +export void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int16 n); +export void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int16 n, int16 k); +export void Texts_WriteRealHex (Texts_Writer *W, address *W__typ, REAL x); +export void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGINT s__len); static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len) @@ -388,7 +388,7 @@ int32 Texts_ElemPos (Texts_Elem E) return _o_result; } -static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, LONGINT *msg__typ) +static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, address *msg__typ) { Texts_Alien e = NIL; Files_Rider r; @@ -604,7 +604,7 @@ void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, SET sel, Texts_Fonts } } -void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, int32 pos) +void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int32 pos) { Texts_Run u = NIL; if (pos >= T->len) { @@ -618,7 +618,7 @@ void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, int32 pos } } -void Texts_Read (Texts_Reader *R, LONGINT *R__typ, CHAR *ch) +void Texts_Read (Texts_Reader *R, address *R__typ, CHAR *ch) { Texts_Run u = NIL; int32 pos; @@ -663,7 +663,7 @@ void Texts_Read (Texts_Reader *R, LONGINT *R__typ, CHAR *ch) } } -void Texts_ReadElem (Texts_Reader *R, LONGINT *R__typ) +void Texts_ReadElem (Texts_Reader *R, address *R__typ) { Texts_Run u = NIL, un = NIL; u = (*R).run; @@ -691,7 +691,7 @@ void Texts_ReadElem (Texts_Reader *R, LONGINT *R__typ) } } -void Texts_ReadPrevElem (Texts_Reader *R, LONGINT *R__typ) +void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ) { Texts_Run u = NIL; u = (*R).run->prev; @@ -713,14 +713,14 @@ void Texts_ReadPrevElem (Texts_Reader *R, LONGINT *R__typ) } } -int32 Texts_Pos (Texts_Reader *R, LONGINT *R__typ) +int32 Texts_Pos (Texts_Reader *R, address *R__typ) { int32 _o_result; _o_result = (*R).org + (*R).off; return _o_result; } -void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, int32 pos) +void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int32 pos) { Texts_OpenReader((void*)&*S, S__typ, T, pos); (*S).line = 0; @@ -729,7 +729,7 @@ void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, int32 p static struct Scan__31 { Texts_Scanner *S; - LONGINT *S__typ; + address *S__typ; CHAR *ch; BOOLEAN *negE; int16 *e; @@ -756,7 +756,7 @@ static void ReadScaleFactor__32 (void) } } -void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) +void Texts_Scan (Texts_Scanner *S, address *S__typ) { CHAR ch, term; BOOLEAN neg, negE, hex; @@ -962,7 +962,7 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) Scan__31_s = _s.lnk; } -void Texts_OpenWriter (Texts_Writer *W, LONGINT *W__typ) +void Texts_OpenWriter (Texts_Writer *W, address *W__typ) { __NEW((*W).buf, Texts_BufDesc); Texts_OpenBuf((*W).buf); @@ -973,22 +973,22 @@ void Texts_OpenWriter (Texts_Writer *W, LONGINT *W__typ) Files_Set(&(*W).rider, Files_Rider__typ, (*W).file, 0); } -void Texts_SetFont (Texts_Writer *W, LONGINT *W__typ, Texts_FontsFont fnt) +void Texts_SetFont (Texts_Writer *W, address *W__typ, Texts_FontsFont fnt) { (*W).fnt = fnt; } -void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, int8 col) +void Texts_SetColor (Texts_Writer *W, address *W__typ, int8 col) { (*W).col = col; } -void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, int8 voff) +void Texts_SetOffset (Texts_Writer *W, address *W__typ, int8 voff) { (*W).voff = voff; } -void Texts_Write (Texts_Writer *W, LONGINT *W__typ, CHAR ch) +void Texts_Write (Texts_Writer *W, address *W__typ, CHAR ch) { Texts_Run u = NIL, un = NIL; Texts_Piece p = NIL; @@ -1014,7 +1014,7 @@ void Texts_Write (Texts_Writer *W, LONGINT *W__typ, CHAR ch) } } -void Texts_WriteElem (Texts_Writer *W, LONGINT *W__typ, Texts_Elem e) +void Texts_WriteElem (Texts_Writer *W, address *W__typ, Texts_Elem e) { Texts_Run u = NIL, un = NIL; if (e->base != NIL) { @@ -1033,12 +1033,12 @@ void Texts_WriteElem (Texts_Writer *W, LONGINT *W__typ, Texts_Elem e) un->prev = (Texts_Run)e; } -void Texts_WriteLn (Texts_Writer *W, LONGINT *W__typ) +void Texts_WriteLn (Texts_Writer *W, address *W__typ) { Texts_Write(&*W, W__typ, 0x0d); } -void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__len) +void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGINT s__len) { int16 i; __DUP(s, s__len, CHAR); @@ -1050,7 +1050,7 @@ void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__le __DEL(s); } -void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int64 x, int64 n) +void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n) { int16 i; int64 x0; @@ -1085,7 +1085,7 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int64 x, int64 n) } while (!(i == 0)); } -void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, int32 x) +void Texts_WriteHex (Texts_Writer *W, address *W__typ, int32 x) { int16 i; int32 y; @@ -1108,7 +1108,7 @@ void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, int32 x) } while (!(i == 0)); } -void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, int16 n) +void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int16 n) { int16 e; REAL x0; @@ -1180,7 +1180,7 @@ void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, int16 n) static struct WriteRealFix__53 { Texts_Writer *W; - LONGINT *W__typ; + address *W__typ; int16 *i; CHAR (*d)[9]; struct WriteRealFix__53 *lnk; @@ -1206,7 +1206,7 @@ static void dig__54 (int16 n) } } -void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, int16 n, int16 k) +void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int16 n, int16 k) { int16 e, i; CHAR sign; @@ -1278,7 +1278,7 @@ void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, int16 n, int1 WriteRealFix__53_s = _s.lnk; } -void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x) +void Texts_WriteRealHex (Texts_Writer *W, address *W__typ, REAL x) { int16 i; CHAR d[8]; @@ -1290,7 +1290,7 @@ void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x) } while (!(i == 8)); } -void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, int16 n) +void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int16 n) { int16 e; LONGREAL x0; @@ -1362,7 +1362,7 @@ void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, int16 n) } } -void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x) +void Texts_WriteLongRealHex (Texts_Writer *W, address *W__typ, LONGREAL x) { int16 i; CHAR d[16]; @@ -1376,7 +1376,7 @@ void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x) static struct WriteDate__43 { Texts_Writer *W; - LONGINT *W__typ; + address *W__typ; struct WriteDate__43 *lnk; } *WriteDate__43_s; @@ -1389,7 +1389,7 @@ static void WritePair__44 (CHAR ch, int32 x) Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)((int)__MOD(x, 10) + 48)); } -void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, int32 t, int32 d) +void Texts_WriteDate (Texts_Writer *W, address *W__typ, int32 t, int32 d) { struct WriteDate__43 _s; _s.W = W; _s.W__typ = W__typ; @@ -1413,9 +1413,9 @@ static struct Load0__16 { struct Load0__16 *lnk; } *Load0__16_s; -static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, int32 pos, int32 span, Texts_Elem *e); +static void LoadElem__17 (Files_Rider *r, address *r__typ, int32 pos, int32 span, Texts_Elem *e); -static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, int32 pos, int32 span, Texts_Elem *e) +static void LoadElem__17 (Files_Rider *r, address *r__typ, int32 pos, int32 span, Texts_Elem *e) { Modules_Module M = NIL; Modules_Command Cmd; @@ -1466,7 +1466,7 @@ static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, int32 pos, int32 span } } -static void Texts_Load0 (Files_Rider *r, LONGINT *r__typ, Texts_Text T) +static void Texts_Load0 (Files_Rider *r, address *r__typ, Texts_Text T) { Texts_Run u = NIL, un = NIL; Texts_Piece p = NIL; @@ -1540,7 +1540,7 @@ static void Texts_Load0 (Files_Rider *r, LONGINT *r__typ, Texts_Text T) Load0__16_s = _s.lnk; } -void Texts_Load (Files_Rider *r, LONGINT *r__typ, Texts_Text T) +void Texts_Load (Files_Rider *r, address *r__typ, Texts_Text T) { int16 tag; Files_ReadInt(&*r, r__typ, &tag); @@ -1614,9 +1614,9 @@ static struct Store__39 { struct Store__39 *lnk; } *Store__39_s; -static void StoreElem__40 (Files_Rider *r, LONGINT *r__typ, int32 pos, Texts_Elem e); +static void StoreElem__40 (Files_Rider *r, address *r__typ, int32 pos, Texts_Elem e); -static void StoreElem__40 (Files_Rider *r, LONGINT *r__typ, int32 pos, Texts_Elem e) +static void StoreElem__40 (Files_Rider *r, address *r__typ, int32 pos, Texts_Elem e) { Files_Rider r1; int32 org, span; @@ -1646,7 +1646,7 @@ static void StoreElem__40 (Files_Rider *r, LONGINT *r__typ, int32 pos, Texts_Ele Files_WriteLInt(&r1, Files_Rider__typ, e->H); } -void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T) +void Texts_Store (Files_Rider *r, address *r__typ, Texts_Text T) { Files_Rider r1; Texts_Run u = NIL, un = NIL; diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index 59498ab9..1a87761b 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef Texts__h #define Texts__h @@ -35,7 +35,7 @@ typedef } Texts_RunDesc; typedef - void (*Texts_Handler)(Texts_Elem, Texts_ElemMsg*, LONGINT *); + void (*Texts_Handler)(Texts_Elem, Texts_ElemMsg*, address *); typedef struct Texts_ElemDesc { @@ -115,18 +115,18 @@ typedef import Texts_Elem Texts_new; -import LONGINT *Texts_FontDesc__typ; -import LONGINT *Texts_RunDesc__typ; -import LONGINT *Texts_ElemMsg__typ; -import LONGINT *Texts_ElemDesc__typ; -import LONGINT *Texts_FileMsg__typ; -import LONGINT *Texts_CopyMsg__typ; -import LONGINT *Texts_IdentifyMsg__typ; -import LONGINT *Texts_BufDesc__typ; -import LONGINT *Texts_TextDesc__typ; -import LONGINT *Texts_Reader__typ; -import LONGINT *Texts_Scanner__typ; -import LONGINT *Texts_Writer__typ; +import address *Texts_FontDesc__typ; +import address *Texts_RunDesc__typ; +import address *Texts_ElemMsg__typ; +import address *Texts_ElemDesc__typ; +import address *Texts_FileMsg__typ; +import address *Texts_CopyMsg__typ; +import address *Texts_IdentifyMsg__typ; +import address *Texts_BufDesc__typ; +import address *Texts_TextDesc__typ; +import address *Texts_Reader__typ; +import address *Texts_Scanner__typ; +import address *Texts_Writer__typ; import void Texts_Append (Texts_Text T, Texts_Buffer B); import void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff); @@ -137,35 +137,35 @@ import void Texts_Delete (Texts_Text T, int32 beg, int32 end); import Texts_Text Texts_ElemBase (Texts_Elem E); import int32 Texts_ElemPos (Texts_Elem E); import void Texts_Insert (Texts_Text T, int32 pos, Texts_Buffer B); -import void Texts_Load (Files_Rider *r, LONGINT *r__typ, Texts_Text T); +import void Texts_Load (Files_Rider *r, address *r__typ, Texts_Text T); import void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len); import void Texts_OpenBuf (Texts_Buffer B); -import void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, int32 pos); -import void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, int32 pos); -import void Texts_OpenWriter (Texts_Writer *W, LONGINT *W__typ); -import int32 Texts_Pos (Texts_Reader *R, LONGINT *R__typ); -import void Texts_Read (Texts_Reader *R, LONGINT *R__typ, CHAR *ch); -import void Texts_ReadElem (Texts_Reader *R, LONGINT *R__typ); -import void Texts_ReadPrevElem (Texts_Reader *R, LONGINT *R__typ); +import void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int32 pos); +import void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int32 pos); +import void Texts_OpenWriter (Texts_Writer *W, address *W__typ); +import int32 Texts_Pos (Texts_Reader *R, address *R__typ); +import void Texts_Read (Texts_Reader *R, address *R__typ, CHAR *ch); +import void Texts_ReadElem (Texts_Reader *R, address *R__typ); +import void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ); import void Texts_Recall (Texts_Buffer *B); import void Texts_Save (Texts_Text T, int32 beg, int32 end, Texts_Buffer B); -import void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ); -import void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, int8 col); -import void Texts_SetFont (Texts_Writer *W, LONGINT *W__typ, Texts_FontsFont fnt); -import void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, int8 voff); -import void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T); -import void Texts_Write (Texts_Writer *W, LONGINT *W__typ, CHAR ch); -import void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, int32 t, int32 d); -import void Texts_WriteElem (Texts_Writer *W, LONGINT *W__typ, Texts_Elem e); -import void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, int32 x); -import void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int64 x, int64 n); -import void Texts_WriteLn (Texts_Writer *W, LONGINT *W__typ); -import void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, int16 n); -import void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x); -import void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, int16 n); -import void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, int16 n, int16 k); -import void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x); -import void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__len); +import void Texts_Scan (Texts_Scanner *S, address *S__typ); +import void Texts_SetColor (Texts_Writer *W, address *W__typ, int8 col); +import void Texts_SetFont (Texts_Writer *W, address *W__typ, Texts_FontsFont fnt); +import void Texts_SetOffset (Texts_Writer *W, address *W__typ, int8 voff); +import void Texts_Store (Files_Rider *r, address *r__typ, Texts_Text T); +import void Texts_Write (Texts_Writer *W, address *W__typ, CHAR ch); +import void Texts_WriteDate (Texts_Writer *W, address *W__typ, int32 t, int32 d); +import void Texts_WriteElem (Texts_Writer *W, address *W__typ, Texts_Elem e); +import void Texts_WriteHex (Texts_Writer *W, address *W__typ, int32 x); +import void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n); +import void Texts_WriteLn (Texts_Writer *W, address *W__typ); +import void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int16 n); +import void Texts_WriteLongRealHex (Texts_Writer *W, address *W__typ, LONGREAL x); +import void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int16 n); +import void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int16 n, int16 k); +import void Texts_WriteRealHex (Texts_Writer *W, address *W__typ, REAL x); +import void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGINT s__len); import void *Texts__init(void); diff --git a/bootstrap/unix-44/Vishap.c b/bootstrap/unix-44/Vishap.c index 7b2dcd23..1ec89e33 100644 --- a/bootstrap/unix-44/Vishap.c +++ b/bootstrap/unix-44/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspamSf */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspamSf */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/errors.c b/bootstrap/unix-44/errors.c index 3a4b1ce7..0a40d5e9 100644 --- a/bootstrap/unix-44/errors.c +++ b/bootstrap/unix-44/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/errors.h b/bootstrap/unix-44/errors.h index 6ca6c961..759b613e 100644 --- a/bootstrap/unix-44/errors.h +++ b/bootstrap/unix-44/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index 2167c7f8..8be0b63d 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index 0b905427..bff1c62c 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-44/vt100.c b/bootstrap/unix-44/vt100.c index c337a9e2..4f6a6c9d 100644 --- a/bootstrap/unix-44/vt100.c +++ b/bootstrap/unix-44/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/vt100.h b/bootstrap/unix-44/vt100.h index 2428fce4..94f8add4 100644 --- a/bootstrap/unix-44/vt100.h +++ b/bootstrap/unix-44/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index b17dc344..abdf151b 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/22] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/23] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index dca477a6..f51f63f2 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Console.c b/bootstrap/unix-48/Console.c index 3f691a07..115e60f5 100644 --- a/bootstrap/unix-48/Console.c +++ b/bootstrap/unix-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -118,10 +118,10 @@ void Console_Hex (int32 i) void Console_Read (CHAR *ch) { - address n; + int32 n; int16 error; Console_Flush(); - error = Platform_ReadBuf(0, (void*)&*ch, 1, (void*)&n); + error = Platform_ReadBuf(0, (void*)&*ch, 1, &n); if (n != 1) { *ch = 0x00; } diff --git a/bootstrap/unix-48/Console.h b/bootstrap/unix-48/Console.h index 6837ab77..b08c93ea 100644 --- a/bootstrap/unix-48/Console.h +++ b/bootstrap/unix-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 3ff2fa83..0a7ac692 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -56,11 +56,11 @@ static struct { CHAR data[1]; } *Files_SearchPath; -export LONGINT *Files_FileDesc__typ; -export LONGINT *Files_BufDesc__typ; -export LONGINT *Files_Rider__typ; +export address *Files_FileDesc__typ; +export address *Files_BufDesc__typ; +export address *Files_Rider__typ; -export Files_File Files_Base (Files_Rider *r, LONGINT *r__typ); +export Files_File Files_Base (Files_Rider *r, address *r__typ); static Files_File Files_CacheEntry (Platform_FileIdentity identity); export void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int16 *res); export void Files_Close (Files_File f); @@ -79,37 +79,37 @@ export int32 Files_Length (Files_File f); static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT name__len, CHAR *dest, LONGINT dest__len); export Files_File Files_New (CHAR *name, LONGINT name__len); export Files_File Files_Old (CHAR *name, LONGINT name__len); -export int32 Files_Pos (Files_Rider *r, LONGINT *r__typ); +export int32 Files_Pos (Files_Rider *r, address *r__typ); export void Files_Purge (Files_File f); -export void Files_Read (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x); -export void Files_ReadBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN *x); -export void Files_ReadByte (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len); -export void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); -export void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, int16 *x); -export void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, int32 *x); -export void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x); -export void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); -export void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int32 *x); -export void Files_ReadNum64 (Files_Rider *R, LONGINT *R__typ, int64 *x); -export void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x); -export void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x); -export void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); +export void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x); +export void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x); +export void Files_ReadByte (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len); +export void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); +export void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x); +export void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); +export void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); +export void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); +export void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x); +export void Files_ReadNum64 (Files_Rider *R, address *R__typ, int64 *x); +export void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); +export void Files_ReadSet (Files_Rider *R, address *R__typ, SET *x); +export void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); export void Files_Register (Files_File f); export void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res); static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len); -export void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, int32 pos); +export void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos); export void Files_SetSearchPath (CHAR *path, LONGINT path__len); -export void Files_Write (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE x); -export void Files_WriteBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN x); -export void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); -export void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, int16 x); -export void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, int32 x); -export void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x); -export void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int32 x); -export void Files_WriteNum64 (Files_Rider *R, LONGINT *R__typ, int64 x); -export void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x); -export void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x); -export void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); +export void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x); +export void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x); +export void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); +export void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x); +export void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x); +export void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x); +export void Files_WriteNum (Files_Rider *R, address *R__typ, int32 x); +export void Files_WriteNum64 (Files_Rider *R, address *R__typ, int64 x); +export void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x); +export void Files_WriteSet (Files_Rider *R, address *R__typ, SET x); +export void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); #define Files_IdxTrap() __HALT(-1) @@ -544,14 +544,14 @@ void Files_GetDate (Files_File f, int32 *t, int32 *d) Platform_MTimeAsClock(identity, &*t, &*d); } -int32 Files_Pos (Files_Rider *r, LONGINT *r__typ) +int32 Files_Pos (Files_Rider *r, address *r__typ) { int32 _o_result; _o_result = (*r).org + (*r).offset; return _o_result; } -void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, int32 pos) +void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos) { int32 org, offset, i, n; Files_Buffer buf = NIL; @@ -613,7 +613,7 @@ void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, int32 pos) (*r).res = 0; } -void Files_Read (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x) +void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x) { int32 offset; Files_Buffer buf = NIL; @@ -637,7 +637,7 @@ void Files_Read (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x) } } -void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n) +void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n) { int32 xpos, min, restInBuf, offset; Files_Buffer buf = NIL; @@ -673,19 +673,19 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x (*r).eof = 0; } -void Files_ReadByte (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len) +void Files_ReadByte (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len) { Files_ReadBytes(&*r, r__typ, (void*)x, x__len * 1, 1); } -Files_File Files_Base (Files_Rider *r, LONGINT *r__typ) +Files_File Files_Base (Files_Rider *r, address *r__typ) { Files_File _o_result; _o_result = (*r).buf->f; return _o_result; } -void Files_Write (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE x) +void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x) { Files_Buffer buf = NIL; int32 offset; @@ -706,7 +706,7 @@ void Files_Write (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE x) (*r).res = 0; } -void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n) +void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n) { int32 xpos, min, restInBuf, offset; Files_Buffer buf = NIL; @@ -849,26 +849,26 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *de } } -void Files_ReadBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN *x) +void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x) { Files_Read(&*R, R__typ, (CHAR*)(void*)&*x); } -void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, int16 *x) +void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x) { CHAR b[2]; Files_ReadBytes(&*R, R__typ, (void*)b, 2, 2); *x = (int16)b[0] + __ASHL((int16)b[1], 8); } -void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, int32 *x) +void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x) { CHAR b[4]; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); *x = (((int16)b[0] + __ASHL((int16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); } -void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x) +void Files_ReadSet (Files_Rider *R, address *R__typ, SET *x) { CHAR b[4]; int32 l; @@ -877,21 +877,21 @@ void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x) *x = (SET)l; } -void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x) +void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x) { CHAR b[4]; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); Files_FlipBytes((void*)b, 4, (void*)&*x, 4); } -void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x) +void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x) { CHAR b[8]; Files_ReadBytes(&*R, R__typ, (void*)b, 8, 8); Files_FlipBytes((void*)b, 8, (void*)&*x, 8); } -void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) +void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) { int16 i; CHAR ch; @@ -903,7 +903,7 @@ void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) } while (!(ch == 0x00)); } -void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) +void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) { int16 i; CHAR ch; @@ -921,7 +921,7 @@ void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) } while (!b); } -void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int32 *x) +void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x) { int8 s; CHAR ch; @@ -938,19 +938,19 @@ void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int32 *x) *x = n; } -void Files_ReadNum64 (Files_Rider *R, LONGINT *R__typ, int64 *x) +void Files_ReadNum64 (Files_Rider *R, address *R__typ, int64 *x) { int32 n; Files_ReadNum(&*R, R__typ, &n); *x = n; } -void Files_WriteBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN x) +void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x) { Files_Write(&*R, R__typ, __VAL(CHAR, x)); } -void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, int16 x) +void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x) { CHAR b[2]; b[0] = (CHAR)x; @@ -958,7 +958,7 @@ void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, int16 x) Files_WriteBytes(&*R, R__typ, (void*)b, 2, 2); } -void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, int32 x) +void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x) { CHAR b[4]; b[0] = (CHAR)x; @@ -968,7 +968,7 @@ void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, int32 x) Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } -void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x) +void Files_WriteSet (Files_Rider *R, address *R__typ, SET x) { CHAR b[4]; int32 i; @@ -980,21 +980,21 @@ void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x) Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } -void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x) +void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x) { CHAR b[4]; Files_FlipBytes((void*)&x, 4, (void*)b, 4); Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } -void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x) +void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x) { CHAR b[8]; Files_FlipBytes((void*)&x, 8, (void*)b, 8); Files_WriteBytes(&*R, R__typ, (void*)b, 8, 8); } -void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) +void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) { int16 i; i = 0; @@ -1004,7 +1004,7 @@ void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len Files_WriteBytes(&*R, R__typ, (void*)x, x__len * 1, i + 1); } -void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int32 x) +void Files_WriteNum (Files_Rider *R, address *R__typ, int32 x) { while (x < -64 || x > 63) { Files_Write(&*R, R__typ, (CHAR)(__MASK(x, -128) + 128)); @@ -1013,7 +1013,7 @@ void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int32 x) Files_Write(&*R, R__typ, (CHAR)__MASK(x, -128)); } -void Files_WriteNum64 (Files_Rider *R, LONGINT *R__typ, int64 x) +void Files_WriteNum64 (Files_Rider *R, address *R__typ, int64 x) { while (x < -64 || x > 63) { Files_Write(&*R, R__typ, (CHAR)(__MASK(x, -128) + 128)); diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index 4fd2efd8..e2b7a3bb 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tspaSfF */ #ifndef Files__h #define Files__h @@ -24,10 +24,10 @@ typedef -import LONGINT *Files_FileDesc__typ; -import LONGINT *Files_Rider__typ; +import address *Files_FileDesc__typ; +import address *Files_Rider__typ; -import Files_File Files_Base (Files_Rider *r, LONGINT *r__typ); +import Files_File Files_Base (Files_Rider *r, address *r__typ); import void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int16 *res); import void Files_Close (Files_File f); import void Files_Delete (CHAR *name, LONGINT name__len, int16 *res); @@ -36,36 +36,36 @@ import void Files_GetName (Files_File f, CHAR *name, LONGINT name__len); import int32 Files_Length (Files_File f); import Files_File Files_New (CHAR *name, LONGINT name__len); import Files_File Files_Old (CHAR *name, LONGINT name__len); -import int32 Files_Pos (Files_Rider *r, LONGINT *r__typ); +import int32 Files_Pos (Files_Rider *r, address *r__typ); import void Files_Purge (Files_File f); -import void Files_Read (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x); -import void Files_ReadBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN *x); -import void Files_ReadByte (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len); -import void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); -import void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, int16 *x); -import void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, int32 *x); -import void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x); -import void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); -import void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int32 *x); -import void Files_ReadNum64 (Files_Rider *R, LONGINT *R__typ, int64 *x); -import void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x); -import void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x); -import void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); +import void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x); +import void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x); +import void Files_ReadByte (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len); +import void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); +import void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x); +import void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); +import void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); +import void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); +import void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x); +import void Files_ReadNum64 (Files_Rider *R, address *R__typ, int64 *x); +import void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); +import void Files_ReadSet (Files_Rider *R, address *R__typ, SET *x); +import void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); import void Files_Register (Files_File f); import void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res); -import void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, int32 pos); +import void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos); import void Files_SetSearchPath (CHAR *path, LONGINT path__len); -import void Files_Write (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE x); -import void Files_WriteBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN x); -import void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); -import void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, int16 x); -import void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, int32 x); -import void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x); -import void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int32 x); -import void Files_WriteNum64 (Files_Rider *R, LONGINT *R__typ, int64 x); -import void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x); -import void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x); -import void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); +import void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x); +import void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x); +import void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); +import void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x); +import void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x); +import void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x); +import void Files_WriteNum (Files_Rider *R, address *R__typ, int32 x); +import void Files_WriteNum64 (Files_Rider *R, address *R__typ, int64 x); +import void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x); +import void Files_WriteSet (Files_Rider *R, address *R__typ, SET x); +import void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); import void *Files__init(void); diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index 17784d67..b7c8c827 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tsSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tsSfF */ #define INTEGER int16 #define LONGINT int32 @@ -74,10 +74,10 @@ static int16 Heap_lockdepth; static BOOLEAN Heap_interrupted; export int16 Heap_FileCount; -export LONGINT *Heap_ModuleDesc__typ; -export LONGINT *Heap_CmdDesc__typ; -export LONGINT *Heap_FinDesc__typ; -export LONGINT *Heap__1__typ; +export address *Heap_ModuleDesc__typ; +export address *Heap_CmdDesc__typ; +export address *Heap_FinDesc__typ; +export address *Heap__1__typ; static void Heap_CheckFin (void); static void Heap_ExtendHeap (address blksz); diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index b1c745df..6ad4813e 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tsSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tsSfF */ #ifndef Heap__h #define Heap__h @@ -34,7 +34,7 @@ import SYSTEM_PTR Heap_modules; import address Heap_allocated, Heap_heapsize; import int16 Heap_FileCount; -import LONGINT *Heap_ModuleDesc__typ; +import address *Heap_ModuleDesc__typ; import void Heap_FINALL (void); import void Heap_GC (BOOLEAN markStack); diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index 1564f5e0..7704f005 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -43,8 +43,8 @@ export int16 Modules_res; export CHAR Modules_resMsg[256]; export Modules_ModuleName Modules_imported, Modules_importing; -export LONGINT *Modules_ModuleDesc__typ; -export LONGINT *Modules_CmdDesc__typ; +export address *Modules_ModuleDesc__typ; +export address *Modules_CmdDesc__typ; static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len); export void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all); diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index dbc243c8..060208c6 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef Modules__h #define Modules__h @@ -40,8 +40,8 @@ import int16 Modules_res; import CHAR Modules_resMsg[256]; import Modules_ModuleName Modules_imported, Modules_importing; -import LONGINT *Modules_ModuleDesc__typ; -import LONGINT *Modules_CmdDesc__typ; +import address *Modules_ModuleDesc__typ; +import address *Modules_CmdDesc__typ; import void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all); import Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len); diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index d0336349..af4f4fc4 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index 434172a2..dc0085af 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 11f64b59..99353400 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -1041,7 +1041,7 @@ static void OPC_IdentList (OPT_Object obj, int16 vis) } else if ((obj->mode == 2 && obj->typ->comp == 4)) { OPC_EndStat(); OPC_BegStat(); - OPM_WriteString((CHAR*)"LONGINT *", 10); + OPM_WriteString((CHAR*)"address *", 10); OPC_Ident(obj); OPM_WriteString((CHAR*)"__typ", 6); base = NIL; @@ -1078,7 +1078,7 @@ static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames) OPM_WriteString((CHAR*)", LONGINT ", 11); OPC_LenList(obj, 1, showParamNames); } else if ((obj->mode == 2 && obj->typ->comp == 4)) { - OPM_WriteString((CHAR*)", LONGINT *", 12); + OPM_WriteString((CHAR*)", address *", 12); if (showParamNames) { OPC_Ident(obj); OPM_WriteString((CHAR*)"__typ", 6); @@ -1166,7 +1166,7 @@ static void OPC_GenDynTypes (OPT_Node n, int16 vis) } else { OPM_WriteString((CHAR*)"export ", 8); } - OPM_WriteString((CHAR*)"LONGINT *", 10); + OPM_WriteString((CHAR*)"address *", 10); OPC_Andent(typ); OPM_WriteString((CHAR*)"__typ", 6); OPC_EndStat(); diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index 09952648..4215947f 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 2122bed9..039d1c77 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -41,7 +41,7 @@ static CHAR OPM_OBERON[1024]; static CHAR OPM_MODULES[1024]; -static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F); +static void OPM_Append (Files_Rider *R, address *R__typ, Files_File F); export void OPM_CloseFiles (void); export void OPM_CloseOldSym (void); export void OPM_DeleteNewSym (void); @@ -49,10 +49,10 @@ export void OPM_FPrint (int32 *fp, int64 val); export void OPM_FPrintLReal (int32 *fp, LONGREAL lr); export void OPM_FPrintReal (int32 *fp, REAL real); export void OPM_FPrintSet (int32 *fp, SET set); -static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, int64 pos); +static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 pos); export void OPM_Get (CHAR *ch); static void OPM_GetProperties (void); -static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONGINT name__len, int16 *size, int16 *align); +static void OPM_GetProperty (Texts_Scanner *S, address *S__typ, CHAR *name, LONGINT name__len, int16 *size, int16 *align); export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); export void OPM_InitOptions (void); export int16 OPM_Integer (int64 n); @@ -496,7 +496,7 @@ static void OPM_LogErrMsg (int16 n) OPM_LogWStr(errors_errors[__X(n, 350)], 128); } -static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, int64 pos) +static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 pos) { CHAR ch, cheol; if (pos < (int64)OPM_ErrorLineStartPos) { @@ -654,7 +654,7 @@ void OPM_FPrintLReal (int32 *fp, LONGREAL lr) OPM_FPrint(&*fp, h); } -static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONGINT name__len, int16 *size, int16 *align) +static void OPM_GetProperty (Texts_Scanner *S, address *S__typ, CHAR *name, LONGINT name__len, int16 *size, int16 *align) { __DUP(name, name__len, CHAR); if (((*S).class == 1 && __STRCMP((*S).s, name) == 0)) { @@ -996,7 +996,7 @@ void OPM_WriteLn (void) Files_Write(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, 0x0a); } -static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F) +static void OPM_Append (Files_Rider *R, address *R__typ, Files_File F) { Files_Rider R1; CHAR buffer[4096]; diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index 8ca21351..a6b7990c 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index d2b3e83f..a3ab1dd3 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -24,7 +24,7 @@ static OPT_Node OPP_TDinit, OPP_lastTDinit; static int16 OPP_nofFwdPtr; static OPT_Struct OPP_FwdPtr[64]; -export LONGINT *OPP__1__typ; +export address *OPP__1__typ; static void OPP_ActualParameters (OPT_Node *aparlist, OPT_Object fpar); static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned); diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index 28045a86..e5a59f6c 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index 99aba006..0cac83bd 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index f7dd1d10..caef45f4 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index abd3934b..c52efac6 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -101,12 +101,12 @@ static OPT_ExpCtxt OPT_expCtxt; static int32 OPT_nofhdfld; static BOOLEAN OPT_newsf, OPT_findpc, OPT_extsf, OPT_sfpresent, OPT_symExtended, OPT_symNew; -export LONGINT *OPT_ConstDesc__typ; -export LONGINT *OPT_ObjDesc__typ; -export LONGINT *OPT_StrDesc__typ; -export LONGINT *OPT_NodeDesc__typ; -export LONGINT *OPT_ImpCtxt__typ; -export LONGINT *OPT_ExpCtxt__typ; +export address *OPT_ConstDesc__typ; +export address *OPT_ObjDesc__typ; +export address *OPT_StrDesc__typ; +export address *OPT_NodeDesc__typ; +export address *OPT_ImpCtxt__typ; +export address *OPT_ExpCtxt__typ; export void OPT_Close (void); export void OPT_CloseScope (void); diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index 5de02c8b..0bd1f189 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPT__h #define OPT__h @@ -75,10 +75,10 @@ import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; import BOOLEAN OPT_SYSimported; -import LONGINT *OPT_ConstDesc__typ; -import LONGINT *OPT_ObjDesc__typ; -import LONGINT *OPT_StrDesc__typ; -import LONGINT *OPT_NodeDesc__typ; +import address *OPT_ConstDesc__typ; +import address *OPT_ObjDesc__typ; +import address *OPT_StrDesc__typ; +import address *OPT_NodeDesc__typ; import void OPT_Close (void); import void OPT_CloseScope (void); diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index efddd202..8bb5ec32 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -21,7 +21,7 @@ static int32 OPV_recno; static OPV_ExitInfo OPV_exit; static int16 OPV_nofExitLabels; -export LONGINT *OPV_ExitInfo__typ; +export address *OPV_ExitInfo__typ; static void OPV_ActualPar (OPT_Node n, OPT_Object fp); export void OPV_AdrAndSize (OPT_Object topScope); diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index 4a3f9d07..c309d63c 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index e2eb0c80..9de57a27 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -42,7 +42,7 @@ static int32 Platform_TimeStart; export int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; export CHAR Platform_nl[3]; -export LONGINT *Platform_FileIdentity__typ; +export address *Platform_FileIdentity__typ; export BOOLEAN Platform_Absent (int16 e); export int16 Platform_ArgPos (CHAR *s, LONGINT s__len); @@ -61,8 +61,8 @@ export void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val export void Platform_GetIntArg (int16 n, int32 *val); export void Platform_GetTimeOfDay (int32 *sec, int32 *usec); export void Platform_Halt (int32 code); -export int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, LONGINT *identity__typ); -export int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); +export int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ); +export int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); export BOOLEAN Platform_Inaccessible (int16 e); export void Platform_Init (int16 argc, address argvadr); export void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); @@ -72,8 +72,8 @@ export address Platform_OSAllocate (address size); export void Platform_OSFree (address address); export int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); export int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); -export int16 Platform_Read (int32 h, address p, address l, address *n); -export int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, address *n); +export int16 Platform_Read (int32 h, address p, int32 l, int32 *n); +export int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n); export int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); export BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); export BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); @@ -81,9 +81,9 @@ export int16 Platform_Seek (int32 h, int32 offset, int16 whence); export void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); export void Platform_SetHalt (Platform_HaltProcedure p); export void Platform_SetInterruptHandler (Platform_SignalHandler handler); -export void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Platform_FileIdentity source); +export void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Platform_FileIdentity source); export void Platform_SetQuitHandler (Platform_SignalHandler handler); -export int16 Platform_Size (int32 h, address *l); +export int16 Platform_Size (int32 h, int32 *l); export int16 Platform_Sync (int32 h); export int16 Platform_System (CHAR *cmd, LONGINT cmd__len); static void Platform_TestLittleEndian (void); @@ -446,7 +446,7 @@ int16 Platform_Close (int32 h) __RETCHK; } -int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, LONGINT *identity__typ) +int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ) { int16 _o_result; Platform_structstats(); @@ -461,7 +461,7 @@ int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, LONGINT *iden return _o_result; } -int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ) +int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ) { int16 _o_result; __DUP(n, n__len, CHAR); @@ -493,7 +493,7 @@ BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i return _o_result; } -void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Platform_FileIdentity source) +void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Platform_FileIdentity source) { (*target).mtime = source.mtime; } @@ -504,7 +504,7 @@ void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d) Platform_YMDHMStoClock(Platform_tmyear(), Platform_tmmon(), Platform_tmmday(), Platform_tmhour(), Platform_tmmin(), Platform_tmsec(), &*t, &*d); } -int16 Platform_Size (int32 h, address *l) +int16 Platform_Size (int32 h, int32 *l) { int16 _o_result; Platform_structstats(); @@ -517,7 +517,7 @@ int16 Platform_Size (int32 h, address *l) return _o_result; } -int16 Platform_Read (int32 h, address p, address l, address *n) +int16 Platform_Read (int32 h, address p, int32 l, int32 *n) { int16 _o_result; *n = Platform_readfile(h, p, l); @@ -532,7 +532,7 @@ int16 Platform_Read (int32 h, address p, address l, address *n) __RETCHK; } -int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, address *n) +int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n) { int16 _o_result; *n = Platform_readfile(h, (address)b, b__len); diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index d024c4ed..bc487769 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef Platform__h #define Platform__h @@ -27,7 +27,7 @@ import address Platform_ArgVector; import int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; import CHAR Platform_nl[3]; -import LONGINT *Platform_FileIdentity__typ; +import address *Platform_FileIdentity__typ; import BOOLEAN Platform_Absent (int16 e); import int16 Platform_ArgPos (CHAR *s, LONGINT s__len); @@ -45,8 +45,8 @@ import void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val import void Platform_GetIntArg (int16 n, int32 *val); import void Platform_GetTimeOfDay (int32 *sec, int32 *usec); import void Platform_Halt (int32 code); -import int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, LONGINT *identity__typ); -import int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); +import int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ); +import int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); import BOOLEAN Platform_Inaccessible (int16 e); import void Platform_Init (int16 argc, address argvadr); import void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); @@ -56,8 +56,8 @@ import address Platform_OSAllocate (address size); import void Platform_OSFree (address address); import int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); import int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); -import int16 Platform_Read (int32 h, address p, address l, address *n); -import int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, address *n); +import int16 Platform_Read (int32 h, address p, int32 l, int32 *n); +import int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n); import int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); import BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); import BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); @@ -65,9 +65,9 @@ import int16 Platform_Seek (int32 h, int32 offset, int16 whence); import void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); import void Platform_SetHalt (Platform_HaltProcedure p); import void Platform_SetInterruptHandler (Platform_SignalHandler handler); -import void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Platform_FileIdentity source); +import void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Platform_FileIdentity source); import void Platform_SetQuitHandler (Platform_SignalHandler handler); -import int16 Platform_Size (int32 h, address *l); +import int16 Platform_Size (int32 h, int32 *l); import int16 Platform_Sync (int32 h); import int16 Platform_System (CHAR *cmd, LONGINT cmd__len); import int32 Platform_Time (void); diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index c1ffff0a..fe93e8be 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index 0ccc7989..e7cba0d8 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index 0f221fe7..427a0cc4 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index 9fdb55fb..44c51b2a 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index f69de03d..60a7ea7a 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -33,7 +33,7 @@ typedef } Texts_ElemMsg; typedef - void (*Texts_Handler)(Texts_Elem, Texts_ElemMsg*, LONGINT *); + void (*Texts_Handler)(Texts_Elem, Texts_ElemMsg*, address *); typedef struct Texts_TextDesc *Texts_Text; @@ -167,20 +167,20 @@ export Texts_Elem Texts_new; static Texts_Buffer Texts_del; static Texts_FontsFont Texts_FontsDefault; -export LONGINT *Texts_FontDesc__typ; -export LONGINT *Texts_RunDesc__typ; -export LONGINT *Texts_PieceDesc__typ; -export LONGINT *Texts_ElemMsg__typ; -export LONGINT *Texts_ElemDesc__typ; -export LONGINT *Texts_FileMsg__typ; -export LONGINT *Texts_CopyMsg__typ; -export LONGINT *Texts_IdentifyMsg__typ; -export LONGINT *Texts_BufDesc__typ; -export LONGINT *Texts_TextDesc__typ; -export LONGINT *Texts_Reader__typ; -export LONGINT *Texts_Scanner__typ; -export LONGINT *Texts_Writer__typ; -export LONGINT *Texts__1__typ; +export address *Texts_FontDesc__typ; +export address *Texts_RunDesc__typ; +export address *Texts_PieceDesc__typ; +export address *Texts_ElemMsg__typ; +export address *Texts_ElemDesc__typ; +export address *Texts_FileMsg__typ; +export address *Texts_CopyMsg__typ; +export address *Texts_IdentifyMsg__typ; +export address *Texts_BufDesc__typ; +export address *Texts_TextDesc__typ; +export address *Texts_Reader__typ; +export address *Texts_Scanner__typ; +export address *Texts_Writer__typ; +export address *Texts__1__typ; export void Texts_Append (Texts_Text T, Texts_Buffer B); export void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff); @@ -194,41 +194,41 @@ export Texts_Text Texts_ElemBase (Texts_Elem E); export int32 Texts_ElemPos (Texts_Elem E); static void Texts_Find (Texts_Text T, int32 *pos, Texts_Run *u, int32 *org, int32 *off); static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len); -static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, LONGINT *msg__typ); +static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, address *msg__typ); export void Texts_Insert (Texts_Text T, int32 pos, Texts_Buffer B); -export void Texts_Load (Files_Rider *r, LONGINT *r__typ, Texts_Text T); -static void Texts_Load0 (Files_Rider *r, LONGINT *r__typ, Texts_Text T); +export void Texts_Load (Files_Rider *r, address *r__typ, Texts_Text T); +static void Texts_Load0 (Files_Rider *r, address *r__typ, Texts_Text T); static void Texts_Merge (Texts_Text T, Texts_Run u, Texts_Run *v); export void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len); export void Texts_OpenBuf (Texts_Buffer B); -export void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, int32 pos); -export void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, int32 pos); -export void Texts_OpenWriter (Texts_Writer *W, LONGINT *W__typ); -export int32 Texts_Pos (Texts_Reader *R, LONGINT *R__typ); -export void Texts_Read (Texts_Reader *R, LONGINT *R__typ, CHAR *ch); -export void Texts_ReadElem (Texts_Reader *R, LONGINT *R__typ); -export void Texts_ReadPrevElem (Texts_Reader *R, LONGINT *R__typ); +export void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int32 pos); +export void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int32 pos); +export void Texts_OpenWriter (Texts_Writer *W, address *W__typ); +export int32 Texts_Pos (Texts_Reader *R, address *R__typ); +export void Texts_Read (Texts_Reader *R, address *R__typ, CHAR *ch); +export void Texts_ReadElem (Texts_Reader *R, address *R__typ); +export void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ); export void Texts_Recall (Texts_Buffer *B); export void Texts_Save (Texts_Text T, int32 beg, int32 end, Texts_Buffer B); -export void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ); -export void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, int8 col); -export void Texts_SetFont (Texts_Writer *W, LONGINT *W__typ, Texts_FontsFont fnt); -export void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, int8 voff); +export void Texts_Scan (Texts_Scanner *S, address *S__typ); +export void Texts_SetColor (Texts_Writer *W, address *W__typ, int8 col); +export void Texts_SetFont (Texts_Writer *W, address *W__typ, Texts_FontsFont fnt); +export void Texts_SetOffset (Texts_Writer *W, address *W__typ, int8 voff); static void Texts_Splice (Texts_Run un, Texts_Run v, Texts_Run w, Texts_Text base); static void Texts_Split (int32 off, Texts_Run *u, Texts_Run *un); -export void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T); -export void Texts_Write (Texts_Writer *W, LONGINT *W__typ, CHAR ch); -export void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, int32 t, int32 d); -export void Texts_WriteElem (Texts_Writer *W, LONGINT *W__typ, Texts_Elem e); -export void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, int32 x); -export void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int64 x, int64 n); -export void Texts_WriteLn (Texts_Writer *W, LONGINT *W__typ); -export void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, int16 n); -export void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x); -export void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, int16 n); -export void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, int16 n, int16 k); -export void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x); -export void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__len); +export void Texts_Store (Files_Rider *r, address *r__typ, Texts_Text T); +export void Texts_Write (Texts_Writer *W, address *W__typ, CHAR ch); +export void Texts_WriteDate (Texts_Writer *W, address *W__typ, int32 t, int32 d); +export void Texts_WriteElem (Texts_Writer *W, address *W__typ, Texts_Elem e); +export void Texts_WriteHex (Texts_Writer *W, address *W__typ, int32 x); +export void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n); +export void Texts_WriteLn (Texts_Writer *W, address *W__typ); +export void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int16 n); +export void Texts_WriteLongRealHex (Texts_Writer *W, address *W__typ, LONGREAL x); +export void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int16 n); +export void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int16 n, int16 k); +export void Texts_WriteRealHex (Texts_Writer *W, address *W__typ, REAL x); +export void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGINT s__len); static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len) @@ -388,7 +388,7 @@ int32 Texts_ElemPos (Texts_Elem E) return _o_result; } -static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, LONGINT *msg__typ) +static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, address *msg__typ) { Texts_Alien e = NIL; Files_Rider r; @@ -604,7 +604,7 @@ void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, SET sel, Texts_Fonts } } -void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, int32 pos) +void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int32 pos) { Texts_Run u = NIL; if (pos >= T->len) { @@ -618,7 +618,7 @@ void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, int32 pos } } -void Texts_Read (Texts_Reader *R, LONGINT *R__typ, CHAR *ch) +void Texts_Read (Texts_Reader *R, address *R__typ, CHAR *ch) { Texts_Run u = NIL; int32 pos; @@ -663,7 +663,7 @@ void Texts_Read (Texts_Reader *R, LONGINT *R__typ, CHAR *ch) } } -void Texts_ReadElem (Texts_Reader *R, LONGINT *R__typ) +void Texts_ReadElem (Texts_Reader *R, address *R__typ) { Texts_Run u = NIL, un = NIL; u = (*R).run; @@ -691,7 +691,7 @@ void Texts_ReadElem (Texts_Reader *R, LONGINT *R__typ) } } -void Texts_ReadPrevElem (Texts_Reader *R, LONGINT *R__typ) +void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ) { Texts_Run u = NIL; u = (*R).run->prev; @@ -713,14 +713,14 @@ void Texts_ReadPrevElem (Texts_Reader *R, LONGINT *R__typ) } } -int32 Texts_Pos (Texts_Reader *R, LONGINT *R__typ) +int32 Texts_Pos (Texts_Reader *R, address *R__typ) { int32 _o_result; _o_result = (*R).org + (*R).off; return _o_result; } -void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, int32 pos) +void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int32 pos) { Texts_OpenReader((void*)&*S, S__typ, T, pos); (*S).line = 0; @@ -729,7 +729,7 @@ void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, int32 p static struct Scan__31 { Texts_Scanner *S; - LONGINT *S__typ; + address *S__typ; CHAR *ch; BOOLEAN *negE; int16 *e; @@ -756,7 +756,7 @@ static void ReadScaleFactor__32 (void) } } -void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) +void Texts_Scan (Texts_Scanner *S, address *S__typ) { CHAR ch, term; BOOLEAN neg, negE, hex; @@ -962,7 +962,7 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) Scan__31_s = _s.lnk; } -void Texts_OpenWriter (Texts_Writer *W, LONGINT *W__typ) +void Texts_OpenWriter (Texts_Writer *W, address *W__typ) { __NEW((*W).buf, Texts_BufDesc); Texts_OpenBuf((*W).buf); @@ -973,22 +973,22 @@ void Texts_OpenWriter (Texts_Writer *W, LONGINT *W__typ) Files_Set(&(*W).rider, Files_Rider__typ, (*W).file, 0); } -void Texts_SetFont (Texts_Writer *W, LONGINT *W__typ, Texts_FontsFont fnt) +void Texts_SetFont (Texts_Writer *W, address *W__typ, Texts_FontsFont fnt) { (*W).fnt = fnt; } -void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, int8 col) +void Texts_SetColor (Texts_Writer *W, address *W__typ, int8 col) { (*W).col = col; } -void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, int8 voff) +void Texts_SetOffset (Texts_Writer *W, address *W__typ, int8 voff) { (*W).voff = voff; } -void Texts_Write (Texts_Writer *W, LONGINT *W__typ, CHAR ch) +void Texts_Write (Texts_Writer *W, address *W__typ, CHAR ch) { Texts_Run u = NIL, un = NIL; Texts_Piece p = NIL; @@ -1014,7 +1014,7 @@ void Texts_Write (Texts_Writer *W, LONGINT *W__typ, CHAR ch) } } -void Texts_WriteElem (Texts_Writer *W, LONGINT *W__typ, Texts_Elem e) +void Texts_WriteElem (Texts_Writer *W, address *W__typ, Texts_Elem e) { Texts_Run u = NIL, un = NIL; if (e->base != NIL) { @@ -1033,12 +1033,12 @@ void Texts_WriteElem (Texts_Writer *W, LONGINT *W__typ, Texts_Elem e) un->prev = (Texts_Run)e; } -void Texts_WriteLn (Texts_Writer *W, LONGINT *W__typ) +void Texts_WriteLn (Texts_Writer *W, address *W__typ) { Texts_Write(&*W, W__typ, 0x0d); } -void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__len) +void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGINT s__len) { int16 i; __DUP(s, s__len, CHAR); @@ -1050,7 +1050,7 @@ void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__le __DEL(s); } -void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int64 x, int64 n) +void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n) { int16 i; int64 x0; @@ -1085,7 +1085,7 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int64 x, int64 n) } while (!(i == 0)); } -void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, int32 x) +void Texts_WriteHex (Texts_Writer *W, address *W__typ, int32 x) { int16 i; int32 y; @@ -1108,7 +1108,7 @@ void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, int32 x) } while (!(i == 0)); } -void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, int16 n) +void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int16 n) { int16 e; REAL x0; @@ -1180,7 +1180,7 @@ void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, int16 n) static struct WriteRealFix__53 { Texts_Writer *W; - LONGINT *W__typ; + address *W__typ; int16 *i; CHAR (*d)[9]; struct WriteRealFix__53 *lnk; @@ -1206,7 +1206,7 @@ static void dig__54 (int16 n) } } -void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, int16 n, int16 k) +void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int16 n, int16 k) { int16 e, i; CHAR sign; @@ -1278,7 +1278,7 @@ void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, int16 n, int1 WriteRealFix__53_s = _s.lnk; } -void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x) +void Texts_WriteRealHex (Texts_Writer *W, address *W__typ, REAL x) { int16 i; CHAR d[8]; @@ -1290,7 +1290,7 @@ void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x) } while (!(i == 8)); } -void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, int16 n) +void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int16 n) { int16 e; LONGREAL x0; @@ -1362,7 +1362,7 @@ void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, int16 n) } } -void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x) +void Texts_WriteLongRealHex (Texts_Writer *W, address *W__typ, LONGREAL x) { int16 i; CHAR d[16]; @@ -1376,7 +1376,7 @@ void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x) static struct WriteDate__43 { Texts_Writer *W; - LONGINT *W__typ; + address *W__typ; struct WriteDate__43 *lnk; } *WriteDate__43_s; @@ -1389,7 +1389,7 @@ static void WritePair__44 (CHAR ch, int32 x) Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)((int)__MOD(x, 10) + 48)); } -void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, int32 t, int32 d) +void Texts_WriteDate (Texts_Writer *W, address *W__typ, int32 t, int32 d) { struct WriteDate__43 _s; _s.W = W; _s.W__typ = W__typ; @@ -1413,9 +1413,9 @@ static struct Load0__16 { struct Load0__16 *lnk; } *Load0__16_s; -static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, int32 pos, int32 span, Texts_Elem *e); +static void LoadElem__17 (Files_Rider *r, address *r__typ, int32 pos, int32 span, Texts_Elem *e); -static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, int32 pos, int32 span, Texts_Elem *e) +static void LoadElem__17 (Files_Rider *r, address *r__typ, int32 pos, int32 span, Texts_Elem *e) { Modules_Module M = NIL; Modules_Command Cmd; @@ -1466,7 +1466,7 @@ static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, int32 pos, int32 span } } -static void Texts_Load0 (Files_Rider *r, LONGINT *r__typ, Texts_Text T) +static void Texts_Load0 (Files_Rider *r, address *r__typ, Texts_Text T) { Texts_Run u = NIL, un = NIL; Texts_Piece p = NIL; @@ -1540,7 +1540,7 @@ static void Texts_Load0 (Files_Rider *r, LONGINT *r__typ, Texts_Text T) Load0__16_s = _s.lnk; } -void Texts_Load (Files_Rider *r, LONGINT *r__typ, Texts_Text T) +void Texts_Load (Files_Rider *r, address *r__typ, Texts_Text T) { int16 tag; Files_ReadInt(&*r, r__typ, &tag); @@ -1614,9 +1614,9 @@ static struct Store__39 { struct Store__39 *lnk; } *Store__39_s; -static void StoreElem__40 (Files_Rider *r, LONGINT *r__typ, int32 pos, Texts_Elem e); +static void StoreElem__40 (Files_Rider *r, address *r__typ, int32 pos, Texts_Elem e); -static void StoreElem__40 (Files_Rider *r, LONGINT *r__typ, int32 pos, Texts_Elem e) +static void StoreElem__40 (Files_Rider *r, address *r__typ, int32 pos, Texts_Elem e) { Files_Rider r1; int32 org, span; @@ -1646,7 +1646,7 @@ static void StoreElem__40 (Files_Rider *r, LONGINT *r__typ, int32 pos, Texts_Ele Files_WriteLInt(&r1, Files_Rider__typ, e->H); } -void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T) +void Texts_Store (Files_Rider *r, address *r__typ, Texts_Text T) { Files_Rider r1; Texts_Run u = NIL, un = NIL; diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index e3ed3241..df86e814 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef Texts__h #define Texts__h @@ -35,7 +35,7 @@ typedef } Texts_RunDesc; typedef - void (*Texts_Handler)(Texts_Elem, Texts_ElemMsg*, LONGINT *); + void (*Texts_Handler)(Texts_Elem, Texts_ElemMsg*, address *); typedef struct Texts_ElemDesc { @@ -116,18 +116,18 @@ typedef import Texts_Elem Texts_new; -import LONGINT *Texts_FontDesc__typ; -import LONGINT *Texts_RunDesc__typ; -import LONGINT *Texts_ElemMsg__typ; -import LONGINT *Texts_ElemDesc__typ; -import LONGINT *Texts_FileMsg__typ; -import LONGINT *Texts_CopyMsg__typ; -import LONGINT *Texts_IdentifyMsg__typ; -import LONGINT *Texts_BufDesc__typ; -import LONGINT *Texts_TextDesc__typ; -import LONGINT *Texts_Reader__typ; -import LONGINT *Texts_Scanner__typ; -import LONGINT *Texts_Writer__typ; +import address *Texts_FontDesc__typ; +import address *Texts_RunDesc__typ; +import address *Texts_ElemMsg__typ; +import address *Texts_ElemDesc__typ; +import address *Texts_FileMsg__typ; +import address *Texts_CopyMsg__typ; +import address *Texts_IdentifyMsg__typ; +import address *Texts_BufDesc__typ; +import address *Texts_TextDesc__typ; +import address *Texts_Reader__typ; +import address *Texts_Scanner__typ; +import address *Texts_Writer__typ; import void Texts_Append (Texts_Text T, Texts_Buffer B); import void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff); @@ -138,35 +138,35 @@ import void Texts_Delete (Texts_Text T, int32 beg, int32 end); import Texts_Text Texts_ElemBase (Texts_Elem E); import int32 Texts_ElemPos (Texts_Elem E); import void Texts_Insert (Texts_Text T, int32 pos, Texts_Buffer B); -import void Texts_Load (Files_Rider *r, LONGINT *r__typ, Texts_Text T); +import void Texts_Load (Files_Rider *r, address *r__typ, Texts_Text T); import void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len); import void Texts_OpenBuf (Texts_Buffer B); -import void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, int32 pos); -import void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, int32 pos); -import void Texts_OpenWriter (Texts_Writer *W, LONGINT *W__typ); -import int32 Texts_Pos (Texts_Reader *R, LONGINT *R__typ); -import void Texts_Read (Texts_Reader *R, LONGINT *R__typ, CHAR *ch); -import void Texts_ReadElem (Texts_Reader *R, LONGINT *R__typ); -import void Texts_ReadPrevElem (Texts_Reader *R, LONGINT *R__typ); +import void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int32 pos); +import void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int32 pos); +import void Texts_OpenWriter (Texts_Writer *W, address *W__typ); +import int32 Texts_Pos (Texts_Reader *R, address *R__typ); +import void Texts_Read (Texts_Reader *R, address *R__typ, CHAR *ch); +import void Texts_ReadElem (Texts_Reader *R, address *R__typ); +import void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ); import void Texts_Recall (Texts_Buffer *B); import void Texts_Save (Texts_Text T, int32 beg, int32 end, Texts_Buffer B); -import void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ); -import void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, int8 col); -import void Texts_SetFont (Texts_Writer *W, LONGINT *W__typ, Texts_FontsFont fnt); -import void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, int8 voff); -import void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T); -import void Texts_Write (Texts_Writer *W, LONGINT *W__typ, CHAR ch); -import void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, int32 t, int32 d); -import void Texts_WriteElem (Texts_Writer *W, LONGINT *W__typ, Texts_Elem e); -import void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, int32 x); -import void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int64 x, int64 n); -import void Texts_WriteLn (Texts_Writer *W, LONGINT *W__typ); -import void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, int16 n); -import void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x); -import void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, int16 n); -import void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, int16 n, int16 k); -import void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x); -import void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__len); +import void Texts_Scan (Texts_Scanner *S, address *S__typ); +import void Texts_SetColor (Texts_Writer *W, address *W__typ, int8 col); +import void Texts_SetFont (Texts_Writer *W, address *W__typ, Texts_FontsFont fnt); +import void Texts_SetOffset (Texts_Writer *W, address *W__typ, int8 voff); +import void Texts_Store (Files_Rider *r, address *r__typ, Texts_Text T); +import void Texts_Write (Texts_Writer *W, address *W__typ, CHAR ch); +import void Texts_WriteDate (Texts_Writer *W, address *W__typ, int32 t, int32 d); +import void Texts_WriteElem (Texts_Writer *W, address *W__typ, Texts_Elem e); +import void Texts_WriteHex (Texts_Writer *W, address *W__typ, int32 x); +import void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n); +import void Texts_WriteLn (Texts_Writer *W, address *W__typ); +import void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int16 n); +import void Texts_WriteLongRealHex (Texts_Writer *W, address *W__typ, LONGREAL x); +import void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int16 n); +import void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int16 n, int16 k); +import void Texts_WriteRealHex (Texts_Writer *W, address *W__typ, REAL x); +import void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGINT s__len); import void *Texts__init(void); diff --git a/bootstrap/unix-48/Vishap.c b/bootstrap/unix-48/Vishap.c index 7b2dcd23..1ec89e33 100644 --- a/bootstrap/unix-48/Vishap.c +++ b/bootstrap/unix-48/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspamSf */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspamSf */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/errors.c b/bootstrap/unix-48/errors.c index 3a4b1ce7..0a40d5e9 100644 --- a/bootstrap/unix-48/errors.c +++ b/bootstrap/unix-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/errors.h b/bootstrap/unix-48/errors.h index 6ca6c961..759b613e 100644 --- a/bootstrap/unix-48/errors.h +++ b/bootstrap/unix-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index 2167c7f8..8be0b63d 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index 0b905427..bff1c62c 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/vt100.c b/bootstrap/unix-48/vt100.c index c337a9e2..4f6a6c9d 100644 --- a/bootstrap/unix-48/vt100.c +++ b/bootstrap/unix-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/vt100.h b/bootstrap/unix-48/vt100.h index 2428fce4..94f8add4 100644 --- a/bootstrap/unix-48/vt100.h +++ b/bootstrap/unix-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index 8945bf88..fa5765f3 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/22] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/23] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index dca477a6..f51f63f2 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Console.c b/bootstrap/unix-88/Console.c index e86ee126..9d23b9fd 100644 --- a/bootstrap/unix-88/Console.c +++ b/bootstrap/unix-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -118,10 +118,10 @@ void Console_Hex (int64 i) void Console_Read (CHAR *ch) { - address n; + int64 n; int32 error; Console_Flush(); - error = Platform_ReadBuf(0, (void*)&*ch, 1, (void*)&n); + error = Platform_ReadBuf(0, (void*)&*ch, 1, &n); if (n != 1) { *ch = 0x00; } diff --git a/bootstrap/unix-88/Console.h b/bootstrap/unix-88/Console.h index 02fad3c1..64d39044 100644 --- a/bootstrap/unix-88/Console.h +++ b/bootstrap/unix-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 076eb5a8..c63ea9c4 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tspaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -56,11 +56,11 @@ static struct { CHAR data[1]; } *Files_SearchPath; -export LONGINT *Files_FileDesc__typ; -export LONGINT *Files_BufDesc__typ; -export LONGINT *Files_Rider__typ; +export address *Files_FileDesc__typ; +export address *Files_BufDesc__typ; +export address *Files_Rider__typ; -export Files_File Files_Base (Files_Rider *r, LONGINT *r__typ); +export Files_File Files_Base (Files_Rider *r, address *r__typ); static Files_File Files_CacheEntry (Platform_FileIdentity identity); export void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int32 *res); export void Files_Close (Files_File f); @@ -79,37 +79,37 @@ export int64 Files_Length (Files_File f); static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT name__len, CHAR *dest, LONGINT dest__len); export Files_File Files_New (CHAR *name, LONGINT name__len); export Files_File Files_Old (CHAR *name, LONGINT name__len); -export int64 Files_Pos (Files_Rider *r, LONGINT *r__typ); +export int64 Files_Pos (Files_Rider *r, address *r__typ); export void Files_Purge (Files_File f); -export void Files_Read (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x); -export void Files_ReadBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN *x); -export void Files_ReadByte (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len); -export void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int64 n); -export void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, int32 *x); -export void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, int64 *x); -export void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x); -export void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); -export void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int64 *x); -export void Files_ReadNum64 (Files_Rider *R, LONGINT *R__typ, int64 *x); -export void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x); -export void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x); -export void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); +export void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x); +export void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x); +export void Files_ReadByte (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len); +export void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int64 n); +export void Files_ReadInt (Files_Rider *R, address *R__typ, int32 *x); +export void Files_ReadLInt (Files_Rider *R, address *R__typ, int64 *x); +export void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); +export void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); +export void Files_ReadNum (Files_Rider *R, address *R__typ, int64 *x); +export void Files_ReadNum64 (Files_Rider *R, address *R__typ, int64 *x); +export void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); +export void Files_ReadSet (Files_Rider *R, address *R__typ, SET *x); +export void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); export void Files_Register (Files_File f); export void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int32 *res); static void Files_ScanPath (int32 *pos, CHAR *dir, LONGINT dir__len); -export void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, int64 pos); +export void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int64 pos); export void Files_SetSearchPath (CHAR *path, LONGINT path__len); -export void Files_Write (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE x); -export void Files_WriteBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN x); -export void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int64 n); -export void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, int32 x); -export void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, int64 x); -export void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x); -export void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int64 x); -export void Files_WriteNum64 (Files_Rider *R, LONGINT *R__typ, int64 x); -export void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x); -export void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x); -export void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); +export void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x); +export void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x); +export void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int64 n); +export void Files_WriteInt (Files_Rider *R, address *R__typ, int32 x); +export void Files_WriteLInt (Files_Rider *R, address *R__typ, int64 x); +export void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x); +export void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x); +export void Files_WriteNum64 (Files_Rider *R, address *R__typ, int64 x); +export void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x); +export void Files_WriteSet (Files_Rider *R, address *R__typ, SET x); +export void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); #define Files_IdxTrap() __HALT(-1) @@ -544,14 +544,14 @@ void Files_GetDate (Files_File f, int64 *t, int64 *d) Platform_MTimeAsClock(identity, &*t, &*d); } -int64 Files_Pos (Files_Rider *r, LONGINT *r__typ) +int64 Files_Pos (Files_Rider *r, address *r__typ) { int64 _o_result; _o_result = (*r).org + (*r).offset; return _o_result; } -void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, int64 pos) +void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int64 pos) { int64 org, offset, i, n; Files_Buffer buf = NIL; @@ -613,7 +613,7 @@ void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, int64 pos) (*r).res = 0; } -void Files_Read (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x) +void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x) { int64 offset; Files_Buffer buf = NIL; @@ -637,7 +637,7 @@ void Files_Read (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x) } } -void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int64 n) +void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int64 n) { int64 xpos, min, restInBuf, offset; Files_Buffer buf = NIL; @@ -673,19 +673,19 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x (*r).eof = 0; } -void Files_ReadByte (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len) +void Files_ReadByte (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len) { Files_ReadBytes(&*r, r__typ, (void*)x, x__len * 1, 1); } -Files_File Files_Base (Files_Rider *r, LONGINT *r__typ) +Files_File Files_Base (Files_Rider *r, address *r__typ) { Files_File _o_result; _o_result = (*r).buf->f; return _o_result; } -void Files_Write (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE x) +void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x) { Files_Buffer buf = NIL; int64 offset; @@ -706,7 +706,7 @@ void Files_Write (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE x) (*r).res = 0; } -void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int64 n) +void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int64 n) { int64 xpos, min, restInBuf, offset; Files_Buffer buf = NIL; @@ -849,26 +849,26 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *de } } -void Files_ReadBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN *x) +void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x) { Files_Read(&*R, R__typ, (CHAR*)(void*)&*x); } -void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, int32 *x) +void Files_ReadInt (Files_Rider *R, address *R__typ, int32 *x) { CHAR b[2]; Files_ReadBytes(&*R, R__typ, (void*)b, 2, 2); *x = b[0] + __ASHL(b[1], 8); } -void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, int64 *x) +void Files_ReadLInt (Files_Rider *R, address *R__typ, int64 *x) { CHAR b[4]; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); *x = ((b[0] + __ASHL(b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); } -void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x) +void Files_ReadSet (Files_Rider *R, address *R__typ, SET *x) { CHAR b[4]; int64 l; @@ -877,21 +877,21 @@ void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x) *x = (SET)l; } -void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x) +void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x) { CHAR b[4]; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); Files_FlipBytes((void*)b, 4, (void*)&*x, 4); } -void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x) +void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x) { CHAR b[8]; Files_ReadBytes(&*R, R__typ, (void*)b, 8, 8); Files_FlipBytes((void*)b, 8, (void*)&*x, 8); } -void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) +void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) { int32 i; CHAR ch; @@ -903,7 +903,7 @@ void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) } while (!(ch == 0x00)); } -void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) +void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) { int32 i; CHAR ch; @@ -921,7 +921,7 @@ void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) } while (!b); } -void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int64 *x) +void Files_ReadNum (Files_Rider *R, address *R__typ, int64 *x) { int8 s; CHAR ch; @@ -938,19 +938,19 @@ void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int64 *x) *x = n; } -void Files_ReadNum64 (Files_Rider *R, LONGINT *R__typ, int64 *x) +void Files_ReadNum64 (Files_Rider *R, address *R__typ, int64 *x) { int64 n; Files_ReadNum(&*R, R__typ, &n); *x = n; } -void Files_WriteBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN x) +void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x) { Files_Write(&*R, R__typ, __VAL(CHAR, x)); } -void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, int32 x) +void Files_WriteInt (Files_Rider *R, address *R__typ, int32 x) { CHAR b[2]; b[0] = (CHAR)x; @@ -958,7 +958,7 @@ void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, int32 x) Files_WriteBytes(&*R, R__typ, (void*)b, 2, 2); } -void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, int64 x) +void Files_WriteLInt (Files_Rider *R, address *R__typ, int64 x) { CHAR b[4]; b[0] = (CHAR)x; @@ -968,7 +968,7 @@ void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, int64 x) Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } -void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x) +void Files_WriteSet (Files_Rider *R, address *R__typ, SET x) { CHAR b[4]; int64 i; @@ -980,21 +980,21 @@ void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x) Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } -void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x) +void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x) { CHAR b[4]; Files_FlipBytes((void*)&x, 4, (void*)b, 4); Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } -void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x) +void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x) { CHAR b[8]; Files_FlipBytes((void*)&x, 8, (void*)b, 8); Files_WriteBytes(&*R, R__typ, (void*)b, 8, 8); } -void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) +void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) { int32 i; i = 0; @@ -1004,7 +1004,7 @@ void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len Files_WriteBytes(&*R, R__typ, (void*)x, x__len * 1, i + 1); } -void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int64 x) +void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x) { while (x < -64 || x > 63) { Files_Write(&*R, R__typ, (CHAR)(__MASK(x, -128) + 128)); @@ -1013,7 +1013,7 @@ void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int64 x) Files_Write(&*R, R__typ, (CHAR)__MASK(x, -128)); } -void Files_WriteNum64 (Files_Rider *R, LONGINT *R__typ, int64 x) +void Files_WriteNum64 (Files_Rider *R, address *R__typ, int64 x) { while (x < -64 || x > 63) { Files_Write(&*R, R__typ, (CHAR)(__MASK(x, -128) + 128)); diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index c2270808..645bc846 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tspaSfF */ #ifndef Files__h #define Files__h @@ -24,10 +24,10 @@ typedef -import LONGINT *Files_FileDesc__typ; -import LONGINT *Files_Rider__typ; +import address *Files_FileDesc__typ; +import address *Files_Rider__typ; -import Files_File Files_Base (Files_Rider *r, LONGINT *r__typ); +import Files_File Files_Base (Files_Rider *r, address *r__typ); import void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int32 *res); import void Files_Close (Files_File f); import void Files_Delete (CHAR *name, LONGINT name__len, int32 *res); @@ -36,36 +36,36 @@ import void Files_GetName (Files_File f, CHAR *name, LONGINT name__len); import int64 Files_Length (Files_File f); import Files_File Files_New (CHAR *name, LONGINT name__len); import Files_File Files_Old (CHAR *name, LONGINT name__len); -import int64 Files_Pos (Files_Rider *r, LONGINT *r__typ); +import int64 Files_Pos (Files_Rider *r, address *r__typ); import void Files_Purge (Files_File f); -import void Files_Read (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x); -import void Files_ReadBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN *x); -import void Files_ReadByte (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len); -import void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int64 n); -import void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, int32 *x); -import void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, int64 *x); -import void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x); -import void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); -import void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int64 *x); -import void Files_ReadNum64 (Files_Rider *R, LONGINT *R__typ, int64 *x); -import void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x); -import void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x); -import void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); +import void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x); +import void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x); +import void Files_ReadByte (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len); +import void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int64 n); +import void Files_ReadInt (Files_Rider *R, address *R__typ, int32 *x); +import void Files_ReadLInt (Files_Rider *R, address *R__typ, int64 *x); +import void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); +import void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); +import void Files_ReadNum (Files_Rider *R, address *R__typ, int64 *x); +import void Files_ReadNum64 (Files_Rider *R, address *R__typ, int64 *x); +import void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); +import void Files_ReadSet (Files_Rider *R, address *R__typ, SET *x); +import void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); import void Files_Register (Files_File f); import void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int32 *res); -import void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, int64 pos); +import void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int64 pos); import void Files_SetSearchPath (CHAR *path, LONGINT path__len); -import void Files_Write (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE x); -import void Files_WriteBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN x); -import void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int64 n); -import void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, int32 x); -import void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, int64 x); -import void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x); -import void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int64 x); -import void Files_WriteNum64 (Files_Rider *R, LONGINT *R__typ, int64 x); -import void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x); -import void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x); -import void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); +import void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x); +import void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x); +import void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int64 n); +import void Files_WriteInt (Files_Rider *R, address *R__typ, int32 x); +import void Files_WriteLInt (Files_Rider *R, address *R__typ, int64 x); +import void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x); +import void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x); +import void Files_WriteNum64 (Files_Rider *R, address *R__typ, int64 x); +import void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x); +import void Files_WriteSet (Files_Rider *R, address *R__typ, SET x); +import void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); import void *Files__init(void); diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index 8d65bb87..c87cfd6d 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tsSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tsSfF */ #define INTEGER int32 #define LONGINT int64 @@ -74,10 +74,10 @@ static int32 Heap_lockdepth; static BOOLEAN Heap_interrupted; export int32 Heap_FileCount; -export LONGINT *Heap_ModuleDesc__typ; -export LONGINT *Heap_CmdDesc__typ; -export LONGINT *Heap_FinDesc__typ; -export LONGINT *Heap__1__typ; +export address *Heap_ModuleDesc__typ; +export address *Heap_CmdDesc__typ; +export address *Heap_FinDesc__typ; +export address *Heap__1__typ; static void Heap_CheckFin (void); static void Heap_ExtendHeap (address blksz); diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index 516a3aca..b4829f2f 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tsSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tsSfF */ #ifndef Heap__h #define Heap__h @@ -34,7 +34,7 @@ import SYSTEM_PTR Heap_modules; import address Heap_allocated, Heap_heapsize; import int32 Heap_FileCount; -import LONGINT *Heap_ModuleDesc__typ; +import address *Heap_ModuleDesc__typ; import void Heap_FINALL (void); import void Heap_GC (BOOLEAN markStack); diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 3d3d4700..23fec310 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -43,8 +43,8 @@ export int32 Modules_res; export CHAR Modules_resMsg[256]; export Modules_ModuleName Modules_imported, Modules_importing; -export LONGINT *Modules_ModuleDesc__typ; -export LONGINT *Modules_CmdDesc__typ; +export address *Modules_ModuleDesc__typ; +export address *Modules_CmdDesc__typ; static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len); export void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all); diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index 46624045..7cafac5f 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef Modules__h #define Modules__h @@ -40,8 +40,8 @@ import int32 Modules_res; import CHAR Modules_resMsg[256]; import Modules_ModuleName Modules_imported, Modules_importing; -import LONGINT *Modules_ModuleDesc__typ; -import LONGINT *Modules_CmdDesc__typ; +import address *Modules_ModuleDesc__typ; +import address *Modules_CmdDesc__typ; import void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all); import Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len); diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index 5cea943a..81077606 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index 66bdcc6c..6863fee8 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index a01fcde9..ee7f4baa 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -1041,7 +1041,7 @@ static void OPC_IdentList (OPT_Object obj, int32 vis) } else if ((obj->mode == 2 && obj->typ->comp == 4)) { OPC_EndStat(); OPC_BegStat(); - OPM_WriteString((CHAR*)"LONGINT *", 10); + OPM_WriteString((CHAR*)"address *", 10); OPC_Ident(obj); OPM_WriteString((CHAR*)"__typ", 6); base = NIL; @@ -1078,7 +1078,7 @@ static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames) OPM_WriteString((CHAR*)", LONGINT ", 11); OPC_LenList(obj, 1, showParamNames); } else if ((obj->mode == 2 && obj->typ->comp == 4)) { - OPM_WriteString((CHAR*)", LONGINT *", 12); + OPM_WriteString((CHAR*)", address *", 12); if (showParamNames) { OPC_Ident(obj); OPM_WriteString((CHAR*)"__typ", 6); @@ -1166,7 +1166,7 @@ static void OPC_GenDynTypes (OPT_Node n, int32 vis) } else { OPM_WriteString((CHAR*)"export ", 8); } - OPM_WriteString((CHAR*)"LONGINT *", 10); + OPM_WriteString((CHAR*)"address *", 10); OPC_Andent(typ); OPM_WriteString((CHAR*)"__typ", 6); OPC_EndStat(); diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index 4a7c8523..6fe30a31 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 22131ab9..3f07341b 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -40,7 +40,7 @@ static CHAR OPM_OBERON[1024]; static CHAR OPM_MODULES[1024]; -static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F); +static void OPM_Append (Files_Rider *R, address *R__typ, Files_File F); export void OPM_CloseFiles (void); export void OPM_CloseOldSym (void); export void OPM_DeleteNewSym (void); @@ -48,10 +48,10 @@ export void OPM_FPrint (int64 *fp, int64 val); export void OPM_FPrintLReal (int64 *fp, LONGREAL lr); export void OPM_FPrintReal (int64 *fp, REAL real); export void OPM_FPrintSet (int64 *fp, SET set); -static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, int64 pos); +static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 pos); export void OPM_Get (CHAR *ch); static void OPM_GetProperties (void); -static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONGINT name__len, int32 *size, int32 *align); +static void OPM_GetProperty (Texts_Scanner *S, address *S__typ, CHAR *name, LONGINT name__len, int32 *size, int32 *align); export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); export void OPM_InitOptions (void); export int32 OPM_Integer (int64 n); @@ -495,7 +495,7 @@ static void OPM_LogErrMsg (int32 n) OPM_LogWStr(errors_errors[__X(n, 350)], 128); } -static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, int64 pos) +static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 pos) { CHAR ch, cheol; if (pos < OPM_ErrorLineStartPos) { @@ -651,7 +651,7 @@ void OPM_FPrintLReal (int64 *fp, LONGREAL lr) OPM_FPrint(&*fp, __VAL(int64, lr)); } -static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONGINT name__len, int32 *size, int32 *align) +static void OPM_GetProperty (Texts_Scanner *S, address *S__typ, CHAR *name, LONGINT name__len, int32 *size, int32 *align) { __DUP(name, name__len, CHAR); if (((*S).class == 1 && __STRCMP((*S).s, name) == 0)) { @@ -993,7 +993,7 @@ void OPM_WriteLn (void) Files_Write(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, 0x0a); } -static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F) +static void OPM_Append (Files_Rider *R, address *R__typ, Files_File F) { Files_Rider R1; CHAR buffer[4096]; diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index b1fab659..765b9680 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index 8c85929d..9b25c35f 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -24,7 +24,7 @@ static OPT_Node OPP_TDinit, OPP_lastTDinit; static int32 OPP_nofFwdPtr; static OPT_Struct OPP_FwdPtr[64]; -export LONGINT *OPP__1__typ; +export address *OPP__1__typ; static void OPP_ActualParameters (OPT_Node *aparlist, OPT_Object fpar); static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned); diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index 28045a86..e5a59f6c 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index 869dfa4b..cd24b8ee 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index 7de91cb4..bcc2ae4d 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index 2dd48c74..41686385 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -100,12 +100,12 @@ static OPT_ExpCtxt OPT_expCtxt; static int64 OPT_nofhdfld; static BOOLEAN OPT_newsf, OPT_findpc, OPT_extsf, OPT_sfpresent, OPT_symExtended, OPT_symNew; -export LONGINT *OPT_ConstDesc__typ; -export LONGINT *OPT_ObjDesc__typ; -export LONGINT *OPT_StrDesc__typ; -export LONGINT *OPT_NodeDesc__typ; -export LONGINT *OPT_ImpCtxt__typ; -export LONGINT *OPT_ExpCtxt__typ; +export address *OPT_ConstDesc__typ; +export address *OPT_ObjDesc__typ; +export address *OPT_StrDesc__typ; +export address *OPT_NodeDesc__typ; +export address *OPT_ImpCtxt__typ; +export address *OPT_ExpCtxt__typ; export void OPT_Close (void); export void OPT_CloseScope (void); diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index a1956589..697eb2c9 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPT__h #define OPT__h @@ -74,10 +74,10 @@ import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; import BOOLEAN OPT_SYSimported; -import LONGINT *OPT_ConstDesc__typ; -import LONGINT *OPT_ObjDesc__typ; -import LONGINT *OPT_StrDesc__typ; -import LONGINT *OPT_NodeDesc__typ; +import address *OPT_ConstDesc__typ; +import address *OPT_ObjDesc__typ; +import address *OPT_StrDesc__typ; +import address *OPT_NodeDesc__typ; import void OPT_Close (void); import void OPT_CloseScope (void); diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 22d0def4..b57b2868 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -21,7 +21,7 @@ static int64 OPV_recno; static OPV_ExitInfo OPV_exit; static int32 OPV_nofExitLabels; -export LONGINT *OPV_ExitInfo__typ; +export address *OPV_ExitInfo__typ; static void OPV_ActualPar (OPT_Node n, OPT_Object fp); export void OPV_AdrAndSize (OPT_Object topScope); diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index 4a3f9d07..c309d63c 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 733b53ef..27df644a 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -42,7 +42,7 @@ static int64 Platform_TimeStart; export int32 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; export CHAR Platform_nl[3]; -export LONGINT *Platform_FileIdentity__typ; +export address *Platform_FileIdentity__typ; export BOOLEAN Platform_Absent (int32 e); export int32 Platform_ArgPos (CHAR *s, LONGINT s__len); @@ -61,8 +61,8 @@ export void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val export void Platform_GetIntArg (int32 n, int64 *val); export void Platform_GetTimeOfDay (int64 *sec, int64 *usec); export void Platform_Halt (int64 code); -export int32 Platform_Identify (int64 h, Platform_FileIdentity *identity, LONGINT *identity__typ); -export int32 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); +export int32 Platform_Identify (int64 h, Platform_FileIdentity *identity, address *identity__typ); +export int32 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); export BOOLEAN Platform_Inaccessible (int32 e); export void Platform_Init (int32 argc, address argvadr); export void Platform_MTimeAsClock (Platform_FileIdentity i, int64 *t, int64 *d); @@ -72,8 +72,8 @@ export address Platform_OSAllocate (address size); export void Platform_OSFree (address address); export int32 Platform_OldRO (CHAR *n, LONGINT n__len, int64 *h); export int32 Platform_OldRW (CHAR *n, LONGINT n__len, int64 *h); -export int32 Platform_Read (int64 h, address p, address l, address *n); -export int32 Platform_ReadBuf (int64 h, SYSTEM_BYTE *b, LONGINT b__len, address *n); +export int32 Platform_Read (int64 h, address p, int64 l, int64 *n); +export int32 Platform_ReadBuf (int64 h, SYSTEM_BYTE *b, LONGINT b__len, int64 *n); export int32 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); export BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); export BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); @@ -81,9 +81,9 @@ export int32 Platform_Seek (int64 h, int64 offset, int32 whence); export void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); export void Platform_SetHalt (Platform_HaltProcedure p); export void Platform_SetInterruptHandler (Platform_SignalHandler handler); -export void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Platform_FileIdentity source); +export void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Platform_FileIdentity source); export void Platform_SetQuitHandler (Platform_SignalHandler handler); -export int32 Platform_Size (int64 h, address *l); +export int32 Platform_Size (int64 h, int64 *l); export int32 Platform_Sync (int64 h); export int32 Platform_System (CHAR *cmd, LONGINT cmd__len); static void Platform_TestLittleEndian (void); @@ -446,7 +446,7 @@ int32 Platform_Close (int64 h) __RETCHK; } -int32 Platform_Identify (int64 h, Platform_FileIdentity *identity, LONGINT *identity__typ) +int32 Platform_Identify (int64 h, Platform_FileIdentity *identity, address *identity__typ) { int32 _o_result; Platform_structstats(); @@ -461,7 +461,7 @@ int32 Platform_Identify (int64 h, Platform_FileIdentity *identity, LONGINT *iden return _o_result; } -int32 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ) +int32 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ) { int32 _o_result; __DUP(n, n__len, CHAR); @@ -493,7 +493,7 @@ BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i return _o_result; } -void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Platform_FileIdentity source) +void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Platform_FileIdentity source) { (*target).mtime = source.mtime; } @@ -504,7 +504,7 @@ void Platform_MTimeAsClock (Platform_FileIdentity i, int64 *t, int64 *d) Platform_YMDHMStoClock(Platform_tmyear(), Platform_tmmon(), Platform_tmmday(), Platform_tmhour(), Platform_tmmin(), Platform_tmsec(), &*t, &*d); } -int32 Platform_Size (int64 h, address *l) +int32 Platform_Size (int64 h, int64 *l) { int32 _o_result; Platform_structstats(); @@ -517,7 +517,7 @@ int32 Platform_Size (int64 h, address *l) return _o_result; } -int32 Platform_Read (int64 h, address p, address l, address *n) +int32 Platform_Read (int64 h, address p, int64 l, int64 *n) { int32 _o_result; *n = Platform_readfile(h, p, l); @@ -532,7 +532,7 @@ int32 Platform_Read (int64 h, address p, address l, address *n) __RETCHK; } -int32 Platform_ReadBuf (int64 h, SYSTEM_BYTE *b, LONGINT b__len, address *n) +int32 Platform_ReadBuf (int64 h, SYSTEM_BYTE *b, LONGINT b__len, int64 *n) { int32 _o_result; *n = Platform_readfile(h, (address)b, b__len); diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index 97c6cb2a..f44cd9e8 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef Platform__h #define Platform__h @@ -27,7 +27,7 @@ import address Platform_ArgVector; import int32 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; import CHAR Platform_nl[3]; -import LONGINT *Platform_FileIdentity__typ; +import address *Platform_FileIdentity__typ; import BOOLEAN Platform_Absent (int32 e); import int32 Platform_ArgPos (CHAR *s, LONGINT s__len); @@ -45,8 +45,8 @@ import void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val import void Platform_GetIntArg (int32 n, int64 *val); import void Platform_GetTimeOfDay (int64 *sec, int64 *usec); import void Platform_Halt (int64 code); -import int32 Platform_Identify (int64 h, Platform_FileIdentity *identity, LONGINT *identity__typ); -import int32 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); +import int32 Platform_Identify (int64 h, Platform_FileIdentity *identity, address *identity__typ); +import int32 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); import BOOLEAN Platform_Inaccessible (int32 e); import void Platform_Init (int32 argc, address argvadr); import void Platform_MTimeAsClock (Platform_FileIdentity i, int64 *t, int64 *d); @@ -56,8 +56,8 @@ import address Platform_OSAllocate (address size); import void Platform_OSFree (address address); import int32 Platform_OldRO (CHAR *n, LONGINT n__len, int64 *h); import int32 Platform_OldRW (CHAR *n, LONGINT n__len, int64 *h); -import int32 Platform_Read (int64 h, address p, address l, address *n); -import int32 Platform_ReadBuf (int64 h, SYSTEM_BYTE *b, LONGINT b__len, address *n); +import int32 Platform_Read (int64 h, address p, int64 l, int64 *n); +import int32 Platform_ReadBuf (int64 h, SYSTEM_BYTE *b, LONGINT b__len, int64 *n); import int32 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); import BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); import BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); @@ -65,9 +65,9 @@ import int32 Platform_Seek (int64 h, int64 offset, int32 whence); import void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); import void Platform_SetHalt (Platform_HaltProcedure p); import void Platform_SetInterruptHandler (Platform_SignalHandler handler); -import void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Platform_FileIdentity source); +import void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Platform_FileIdentity source); import void Platform_SetQuitHandler (Platform_SignalHandler handler); -import int32 Platform_Size (int64 h, address *l); +import int32 Platform_Size (int64 h, int64 *l); import int32 Platform_Sync (int64 h); import int32 Platform_System (CHAR *cmd, LONGINT cmd__len); import int64 Platform_Time (void); diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 039a3b6d..7678a81e 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index e27d5dca..4de192c6 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index 2f1a7062..49fbdd21 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index 90baacae..4dd0d2c3 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index ee371c4e..6403ce33 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -33,7 +33,7 @@ typedef } Texts_ElemMsg; typedef - void (*Texts_Handler)(Texts_Elem, Texts_ElemMsg*, LONGINT *); + void (*Texts_Handler)(Texts_Elem, Texts_ElemMsg*, address *); typedef struct Texts_TextDesc *Texts_Text; @@ -167,20 +167,20 @@ export Texts_Elem Texts_new; static Texts_Buffer Texts_del; static Texts_FontsFont Texts_FontsDefault; -export LONGINT *Texts_FontDesc__typ; -export LONGINT *Texts_RunDesc__typ; -export LONGINT *Texts_PieceDesc__typ; -export LONGINT *Texts_ElemMsg__typ; -export LONGINT *Texts_ElemDesc__typ; -export LONGINT *Texts_FileMsg__typ; -export LONGINT *Texts_CopyMsg__typ; -export LONGINT *Texts_IdentifyMsg__typ; -export LONGINT *Texts_BufDesc__typ; -export LONGINT *Texts_TextDesc__typ; -export LONGINT *Texts_Reader__typ; -export LONGINT *Texts_Scanner__typ; -export LONGINT *Texts_Writer__typ; -export LONGINT *Texts__1__typ; +export address *Texts_FontDesc__typ; +export address *Texts_RunDesc__typ; +export address *Texts_PieceDesc__typ; +export address *Texts_ElemMsg__typ; +export address *Texts_ElemDesc__typ; +export address *Texts_FileMsg__typ; +export address *Texts_CopyMsg__typ; +export address *Texts_IdentifyMsg__typ; +export address *Texts_BufDesc__typ; +export address *Texts_TextDesc__typ; +export address *Texts_Reader__typ; +export address *Texts_Scanner__typ; +export address *Texts_Writer__typ; +export address *Texts__1__typ; export void Texts_Append (Texts_Text T, Texts_Buffer B); export void Texts_ChangeLooks (Texts_Text T, int64 beg, int64 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff); @@ -194,41 +194,41 @@ export Texts_Text Texts_ElemBase (Texts_Elem E); export int64 Texts_ElemPos (Texts_Elem E); static void Texts_Find (Texts_Text T, int64 *pos, Texts_Run *u, int64 *org, int64 *off); static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len); -static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, LONGINT *msg__typ); +static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, address *msg__typ); export void Texts_Insert (Texts_Text T, int64 pos, Texts_Buffer B); -export void Texts_Load (Files_Rider *r, LONGINT *r__typ, Texts_Text T); -static void Texts_Load0 (Files_Rider *r, LONGINT *r__typ, Texts_Text T); +export void Texts_Load (Files_Rider *r, address *r__typ, Texts_Text T); +static void Texts_Load0 (Files_Rider *r, address *r__typ, Texts_Text T); static void Texts_Merge (Texts_Text T, Texts_Run u, Texts_Run *v); export void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len); export void Texts_OpenBuf (Texts_Buffer B); -export void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, int64 pos); -export void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, int64 pos); -export void Texts_OpenWriter (Texts_Writer *W, LONGINT *W__typ); -export int64 Texts_Pos (Texts_Reader *R, LONGINT *R__typ); -export void Texts_Read (Texts_Reader *R, LONGINT *R__typ, CHAR *ch); -export void Texts_ReadElem (Texts_Reader *R, LONGINT *R__typ); -export void Texts_ReadPrevElem (Texts_Reader *R, LONGINT *R__typ); +export void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int64 pos); +export void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int64 pos); +export void Texts_OpenWriter (Texts_Writer *W, address *W__typ); +export int64 Texts_Pos (Texts_Reader *R, address *R__typ); +export void Texts_Read (Texts_Reader *R, address *R__typ, CHAR *ch); +export void Texts_ReadElem (Texts_Reader *R, address *R__typ); +export void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ); export void Texts_Recall (Texts_Buffer *B); export void Texts_Save (Texts_Text T, int64 beg, int64 end, Texts_Buffer B); -export void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ); -export void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, int8 col); -export void Texts_SetFont (Texts_Writer *W, LONGINT *W__typ, Texts_FontsFont fnt); -export void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, int8 voff); +export void Texts_Scan (Texts_Scanner *S, address *S__typ); +export void Texts_SetColor (Texts_Writer *W, address *W__typ, int8 col); +export void Texts_SetFont (Texts_Writer *W, address *W__typ, Texts_FontsFont fnt); +export void Texts_SetOffset (Texts_Writer *W, address *W__typ, int8 voff); static void Texts_Splice (Texts_Run un, Texts_Run v, Texts_Run w, Texts_Text base); static void Texts_Split (int64 off, Texts_Run *u, Texts_Run *un); -export void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T); -export void Texts_Write (Texts_Writer *W, LONGINT *W__typ, CHAR ch); -export void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, int64 t, int64 d); -export void Texts_WriteElem (Texts_Writer *W, LONGINT *W__typ, Texts_Elem e); -export void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, int64 x); -export void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int64 x, int64 n); -export void Texts_WriteLn (Texts_Writer *W, LONGINT *W__typ); -export void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, int32 n); -export void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x); -export void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, int32 n); -export void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, int32 n, int32 k); -export void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x); -export void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__len); +export void Texts_Store (Files_Rider *r, address *r__typ, Texts_Text T); +export void Texts_Write (Texts_Writer *W, address *W__typ, CHAR ch); +export void Texts_WriteDate (Texts_Writer *W, address *W__typ, int64 t, int64 d); +export void Texts_WriteElem (Texts_Writer *W, address *W__typ, Texts_Elem e); +export void Texts_WriteHex (Texts_Writer *W, address *W__typ, int64 x); +export void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n); +export void Texts_WriteLn (Texts_Writer *W, address *W__typ); +export void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int32 n); +export void Texts_WriteLongRealHex (Texts_Writer *W, address *W__typ, LONGREAL x); +export void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int32 n); +export void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int32 n, int32 k); +export void Texts_WriteRealHex (Texts_Writer *W, address *W__typ, REAL x); +export void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGINT s__len); static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len) @@ -388,7 +388,7 @@ int64 Texts_ElemPos (Texts_Elem E) return _o_result; } -static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, LONGINT *msg__typ) +static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, address *msg__typ) { Texts_Alien e = NIL; Files_Rider r; @@ -604,7 +604,7 @@ void Texts_ChangeLooks (Texts_Text T, int64 beg, int64 end, SET sel, Texts_Fonts } } -void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, int64 pos) +void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int64 pos) { Texts_Run u = NIL; if (pos >= T->len) { @@ -618,7 +618,7 @@ void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, int64 pos } } -void Texts_Read (Texts_Reader *R, LONGINT *R__typ, CHAR *ch) +void Texts_Read (Texts_Reader *R, address *R__typ, CHAR *ch) { Texts_Run u = NIL; int64 pos; @@ -663,7 +663,7 @@ void Texts_Read (Texts_Reader *R, LONGINT *R__typ, CHAR *ch) } } -void Texts_ReadElem (Texts_Reader *R, LONGINT *R__typ) +void Texts_ReadElem (Texts_Reader *R, address *R__typ) { Texts_Run u = NIL, un = NIL; u = (*R).run; @@ -691,7 +691,7 @@ void Texts_ReadElem (Texts_Reader *R, LONGINT *R__typ) } } -void Texts_ReadPrevElem (Texts_Reader *R, LONGINT *R__typ) +void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ) { Texts_Run u = NIL; u = (*R).run->prev; @@ -713,14 +713,14 @@ void Texts_ReadPrevElem (Texts_Reader *R, LONGINT *R__typ) } } -int64 Texts_Pos (Texts_Reader *R, LONGINT *R__typ) +int64 Texts_Pos (Texts_Reader *R, address *R__typ) { int64 _o_result; _o_result = (*R).org + (*R).off; return _o_result; } -void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, int64 pos) +void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int64 pos) { Texts_OpenReader((void*)&*S, S__typ, T, pos); (*S).line = 0; @@ -729,7 +729,7 @@ void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, int64 p static struct Scan__31 { Texts_Scanner *S; - LONGINT *S__typ; + address *S__typ; CHAR *ch; BOOLEAN *negE; int32 *e; @@ -756,7 +756,7 @@ static void ReadScaleFactor__32 (void) } } -void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) +void Texts_Scan (Texts_Scanner *S, address *S__typ) { CHAR ch, term; BOOLEAN neg, negE, hex; @@ -962,7 +962,7 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) Scan__31_s = _s.lnk; } -void Texts_OpenWriter (Texts_Writer *W, LONGINT *W__typ) +void Texts_OpenWriter (Texts_Writer *W, address *W__typ) { __NEW((*W).buf, Texts_BufDesc); Texts_OpenBuf((*W).buf); @@ -973,22 +973,22 @@ void Texts_OpenWriter (Texts_Writer *W, LONGINT *W__typ) Files_Set(&(*W).rider, Files_Rider__typ, (*W).file, 0); } -void Texts_SetFont (Texts_Writer *W, LONGINT *W__typ, Texts_FontsFont fnt) +void Texts_SetFont (Texts_Writer *W, address *W__typ, Texts_FontsFont fnt) { (*W).fnt = fnt; } -void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, int8 col) +void Texts_SetColor (Texts_Writer *W, address *W__typ, int8 col) { (*W).col = col; } -void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, int8 voff) +void Texts_SetOffset (Texts_Writer *W, address *W__typ, int8 voff) { (*W).voff = voff; } -void Texts_Write (Texts_Writer *W, LONGINT *W__typ, CHAR ch) +void Texts_Write (Texts_Writer *W, address *W__typ, CHAR ch) { Texts_Run u = NIL, un = NIL; Texts_Piece p = NIL; @@ -1014,7 +1014,7 @@ void Texts_Write (Texts_Writer *W, LONGINT *W__typ, CHAR ch) } } -void Texts_WriteElem (Texts_Writer *W, LONGINT *W__typ, Texts_Elem e) +void Texts_WriteElem (Texts_Writer *W, address *W__typ, Texts_Elem e) { Texts_Run u = NIL, un = NIL; if (e->base != NIL) { @@ -1033,12 +1033,12 @@ void Texts_WriteElem (Texts_Writer *W, LONGINT *W__typ, Texts_Elem e) un->prev = (Texts_Run)e; } -void Texts_WriteLn (Texts_Writer *W, LONGINT *W__typ) +void Texts_WriteLn (Texts_Writer *W, address *W__typ) { Texts_Write(&*W, W__typ, 0x0d); } -void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__len) +void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGINT s__len) { int32 i; __DUP(s, s__len, CHAR); @@ -1050,7 +1050,7 @@ void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__le __DEL(s); } -void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int64 x, int64 n) +void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n) { int32 i; int64 x0; @@ -1085,7 +1085,7 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int64 x, int64 n) } while (!(i == 0)); } -void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, int64 x) +void Texts_WriteHex (Texts_Writer *W, address *W__typ, int64 x) { int32 i; int64 y; @@ -1108,7 +1108,7 @@ void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, int64 x) } while (!(i == 0)); } -void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, int32 n) +void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int32 n) { int32 e; REAL x0; @@ -1180,7 +1180,7 @@ void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, int32 n) static struct WriteRealFix__53 { Texts_Writer *W; - LONGINT *W__typ; + address *W__typ; int32 *i; CHAR (*d)[9]; struct WriteRealFix__53 *lnk; @@ -1206,7 +1206,7 @@ static void dig__54 (int32 n) } } -void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, int32 n, int32 k) +void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int32 n, int32 k) { int32 e, i; CHAR sign; @@ -1278,7 +1278,7 @@ void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, int32 n, int3 WriteRealFix__53_s = _s.lnk; } -void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x) +void Texts_WriteRealHex (Texts_Writer *W, address *W__typ, REAL x) { int32 i; CHAR d[8]; @@ -1290,7 +1290,7 @@ void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x) } while (!(i == 8)); } -void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, int32 n) +void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int32 n) { int32 e; LONGREAL x0; @@ -1362,7 +1362,7 @@ void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, int32 n) } } -void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x) +void Texts_WriteLongRealHex (Texts_Writer *W, address *W__typ, LONGREAL x) { int32 i; CHAR d[16]; @@ -1376,7 +1376,7 @@ void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x) static struct WriteDate__43 { Texts_Writer *W; - LONGINT *W__typ; + address *W__typ; struct WriteDate__43 *lnk; } *WriteDate__43_s; @@ -1389,7 +1389,7 @@ static void WritePair__44 (CHAR ch, int64 x) Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)(__MOD(x, 10) + 48)); } -void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, int64 t, int64 d) +void Texts_WriteDate (Texts_Writer *W, address *W__typ, int64 t, int64 d) { struct WriteDate__43 _s; _s.W = W; _s.W__typ = W__typ; @@ -1413,9 +1413,9 @@ static struct Load0__16 { struct Load0__16 *lnk; } *Load0__16_s; -static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, int64 pos, int64 span, Texts_Elem *e); +static void LoadElem__17 (Files_Rider *r, address *r__typ, int64 pos, int64 span, Texts_Elem *e); -static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, int64 pos, int64 span, Texts_Elem *e) +static void LoadElem__17 (Files_Rider *r, address *r__typ, int64 pos, int64 span, Texts_Elem *e) { Modules_Module M = NIL; Modules_Command Cmd; @@ -1466,7 +1466,7 @@ static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, int64 pos, int64 span } } -static void Texts_Load0 (Files_Rider *r, LONGINT *r__typ, Texts_Text T) +static void Texts_Load0 (Files_Rider *r, address *r__typ, Texts_Text T) { Texts_Run u = NIL, un = NIL; Texts_Piece p = NIL; @@ -1540,7 +1540,7 @@ static void Texts_Load0 (Files_Rider *r, LONGINT *r__typ, Texts_Text T) Load0__16_s = _s.lnk; } -void Texts_Load (Files_Rider *r, LONGINT *r__typ, Texts_Text T) +void Texts_Load (Files_Rider *r, address *r__typ, Texts_Text T) { int32 tag; Files_ReadInt(&*r, r__typ, &tag); @@ -1614,9 +1614,9 @@ static struct Store__39 { struct Store__39 *lnk; } *Store__39_s; -static void StoreElem__40 (Files_Rider *r, LONGINT *r__typ, int64 pos, Texts_Elem e); +static void StoreElem__40 (Files_Rider *r, address *r__typ, int64 pos, Texts_Elem e); -static void StoreElem__40 (Files_Rider *r, LONGINT *r__typ, int64 pos, Texts_Elem e) +static void StoreElem__40 (Files_Rider *r, address *r__typ, int64 pos, Texts_Elem e) { Files_Rider r1; int64 org, span; @@ -1646,7 +1646,7 @@ static void StoreElem__40 (Files_Rider *r, LONGINT *r__typ, int64 pos, Texts_Ele Files_WriteLInt(&r1, Files_Rider__typ, e->H); } -void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T) +void Texts_Store (Files_Rider *r, address *r__typ, Texts_Text T) { Files_Rider r1; Texts_Run u = NIL, un = NIL; diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index 32047663..e85157ed 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef Texts__h #define Texts__h @@ -35,7 +35,7 @@ typedef } Texts_RunDesc; typedef - void (*Texts_Handler)(Texts_Elem, Texts_ElemMsg*, LONGINT *); + void (*Texts_Handler)(Texts_Elem, Texts_ElemMsg*, address *); typedef struct Texts_ElemDesc { @@ -115,18 +115,18 @@ typedef import Texts_Elem Texts_new; -import LONGINT *Texts_FontDesc__typ; -import LONGINT *Texts_RunDesc__typ; -import LONGINT *Texts_ElemMsg__typ; -import LONGINT *Texts_ElemDesc__typ; -import LONGINT *Texts_FileMsg__typ; -import LONGINT *Texts_CopyMsg__typ; -import LONGINT *Texts_IdentifyMsg__typ; -import LONGINT *Texts_BufDesc__typ; -import LONGINT *Texts_TextDesc__typ; -import LONGINT *Texts_Reader__typ; -import LONGINT *Texts_Scanner__typ; -import LONGINT *Texts_Writer__typ; +import address *Texts_FontDesc__typ; +import address *Texts_RunDesc__typ; +import address *Texts_ElemMsg__typ; +import address *Texts_ElemDesc__typ; +import address *Texts_FileMsg__typ; +import address *Texts_CopyMsg__typ; +import address *Texts_IdentifyMsg__typ; +import address *Texts_BufDesc__typ; +import address *Texts_TextDesc__typ; +import address *Texts_Reader__typ; +import address *Texts_Scanner__typ; +import address *Texts_Writer__typ; import void Texts_Append (Texts_Text T, Texts_Buffer B); import void Texts_ChangeLooks (Texts_Text T, int64 beg, int64 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff); @@ -137,35 +137,35 @@ import void Texts_Delete (Texts_Text T, int64 beg, int64 end); import Texts_Text Texts_ElemBase (Texts_Elem E); import int64 Texts_ElemPos (Texts_Elem E); import void Texts_Insert (Texts_Text T, int64 pos, Texts_Buffer B); -import void Texts_Load (Files_Rider *r, LONGINT *r__typ, Texts_Text T); +import void Texts_Load (Files_Rider *r, address *r__typ, Texts_Text T); import void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len); import void Texts_OpenBuf (Texts_Buffer B); -import void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, int64 pos); -import void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, int64 pos); -import void Texts_OpenWriter (Texts_Writer *W, LONGINT *W__typ); -import int64 Texts_Pos (Texts_Reader *R, LONGINT *R__typ); -import void Texts_Read (Texts_Reader *R, LONGINT *R__typ, CHAR *ch); -import void Texts_ReadElem (Texts_Reader *R, LONGINT *R__typ); -import void Texts_ReadPrevElem (Texts_Reader *R, LONGINT *R__typ); +import void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int64 pos); +import void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int64 pos); +import void Texts_OpenWriter (Texts_Writer *W, address *W__typ); +import int64 Texts_Pos (Texts_Reader *R, address *R__typ); +import void Texts_Read (Texts_Reader *R, address *R__typ, CHAR *ch); +import void Texts_ReadElem (Texts_Reader *R, address *R__typ); +import void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ); import void Texts_Recall (Texts_Buffer *B); import void Texts_Save (Texts_Text T, int64 beg, int64 end, Texts_Buffer B); -import void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ); -import void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, int8 col); -import void Texts_SetFont (Texts_Writer *W, LONGINT *W__typ, Texts_FontsFont fnt); -import void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, int8 voff); -import void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T); -import void Texts_Write (Texts_Writer *W, LONGINT *W__typ, CHAR ch); -import void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, int64 t, int64 d); -import void Texts_WriteElem (Texts_Writer *W, LONGINT *W__typ, Texts_Elem e); -import void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, int64 x); -import void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int64 x, int64 n); -import void Texts_WriteLn (Texts_Writer *W, LONGINT *W__typ); -import void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, int32 n); -import void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x); -import void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, int32 n); -import void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, int32 n, int32 k); -import void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x); -import void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__len); +import void Texts_Scan (Texts_Scanner *S, address *S__typ); +import void Texts_SetColor (Texts_Writer *W, address *W__typ, int8 col); +import void Texts_SetFont (Texts_Writer *W, address *W__typ, Texts_FontsFont fnt); +import void Texts_SetOffset (Texts_Writer *W, address *W__typ, int8 voff); +import void Texts_Store (Files_Rider *r, address *r__typ, Texts_Text T); +import void Texts_Write (Texts_Writer *W, address *W__typ, CHAR ch); +import void Texts_WriteDate (Texts_Writer *W, address *W__typ, int64 t, int64 d); +import void Texts_WriteElem (Texts_Writer *W, address *W__typ, Texts_Elem e); +import void Texts_WriteHex (Texts_Writer *W, address *W__typ, int64 x); +import void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n); +import void Texts_WriteLn (Texts_Writer *W, address *W__typ); +import void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int32 n); +import void Texts_WriteLongRealHex (Texts_Writer *W, address *W__typ, LONGREAL x); +import void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int32 n); +import void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int32 n, int32 k); +import void Texts_WriteRealHex (Texts_Writer *W, address *W__typ, REAL x); +import void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGINT s__len); import void *Texts__init(void); diff --git a/bootstrap/unix-88/Vishap.c b/bootstrap/unix-88/Vishap.c index 87812cc2..5c6cada1 100644 --- a/bootstrap/unix-88/Vishap.c +++ b/bootstrap/unix-88/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspamSf */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspamSf */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/errors.c b/bootstrap/unix-88/errors.c index 897999f4..4bb09433 100644 --- a/bootstrap/unix-88/errors.c +++ b/bootstrap/unix-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/errors.h b/bootstrap/unix-88/errors.h index 6ca6c961..759b613e 100644 --- a/bootstrap/unix-88/errors.h +++ b/bootstrap/unix-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index 1647c4fe..d6bc2194 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index 0b905427..bff1c62c 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/vt100.c b/bootstrap/unix-88/vt100.c index 8b57066f..bb55d599 100644 --- a/bootstrap/unix-88/vt100.c +++ b/bootstrap/unix-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/vt100.h b/bootstrap/unix-88/vt100.h index e8809371..2bc7d18f 100644 --- a/bootstrap/unix-88/vt100.h +++ b/bootstrap/unix-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index b17dc344..abdf151b 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/22] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/23] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index dca477a6..f51f63f2 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Console.c b/bootstrap/windows-48/Console.c index 2e0565e9..7b492ced 100644 --- a/bootstrap/windows-48/Console.c +++ b/bootstrap/windows-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -118,10 +118,10 @@ void Console_Hex (int32 i) void Console_Read (CHAR *ch) { - address n; + int32 n; int16 error; Console_Flush(); - error = Platform_ReadBuf(Platform_StdIn, (void*)&*ch, 1, (void*)&n); + error = Platform_ReadBuf(Platform_StdIn, (void*)&*ch, 1, &n); if (n != 1) { *ch = 0x00; } diff --git a/bootstrap/windows-48/Console.h b/bootstrap/windows-48/Console.h index 6837ab77..b08c93ea 100644 --- a/bootstrap/windows-48/Console.h +++ b/bootstrap/windows-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 4b2bb492..98974743 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -56,11 +56,11 @@ static struct { CHAR data[1]; } *Files_SearchPath; -export LONGINT *Files_FileDesc__typ; -export LONGINT *Files_BufDesc__typ; -export LONGINT *Files_Rider__typ; +export address *Files_FileDesc__typ; +export address *Files_BufDesc__typ; +export address *Files_Rider__typ; -export Files_File Files_Base (Files_Rider *r, LONGINT *r__typ); +export Files_File Files_Base (Files_Rider *r, address *r__typ); static Files_File Files_CacheEntry (Platform_FileIdentity identity); export void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int16 *res); export void Files_Close (Files_File f); @@ -79,37 +79,37 @@ export int32 Files_Length (Files_File f); static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT name__len, CHAR *dest, LONGINT dest__len); export Files_File Files_New (CHAR *name, LONGINT name__len); export Files_File Files_Old (CHAR *name, LONGINT name__len); -export int32 Files_Pos (Files_Rider *r, LONGINT *r__typ); +export int32 Files_Pos (Files_Rider *r, address *r__typ); export void Files_Purge (Files_File f); -export void Files_Read (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x); -export void Files_ReadBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN *x); -export void Files_ReadByte (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len); -export void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); -export void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, int16 *x); -export void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, int32 *x); -export void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x); -export void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); -export void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int32 *x); -export void Files_ReadNum64 (Files_Rider *R, LONGINT *R__typ, int64 *x); -export void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x); -export void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x); -export void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); +export void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x); +export void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x); +export void Files_ReadByte (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len); +export void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); +export void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x); +export void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); +export void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); +export void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); +export void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x); +export void Files_ReadNum64 (Files_Rider *R, address *R__typ, int64 *x); +export void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); +export void Files_ReadSet (Files_Rider *R, address *R__typ, SET *x); +export void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); export void Files_Register (Files_File f); export void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res); static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len); -export void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, int32 pos); +export void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos); export void Files_SetSearchPath (CHAR *path, LONGINT path__len); -export void Files_Write (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE x); -export void Files_WriteBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN x); -export void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); -export void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, int16 x); -export void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, int32 x); -export void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x); -export void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int32 x); -export void Files_WriteNum64 (Files_Rider *R, LONGINT *R__typ, int64 x); -export void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x); -export void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x); -export void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); +export void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x); +export void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x); +export void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); +export void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x); +export void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x); +export void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x); +export void Files_WriteNum (Files_Rider *R, address *R__typ, int32 x); +export void Files_WriteNum64 (Files_Rider *R, address *R__typ, int64 x); +export void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x); +export void Files_WriteSet (Files_Rider *R, address *R__typ, SET x); +export void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); #define Files_IdxTrap() __HALT(-1) @@ -544,14 +544,14 @@ void Files_GetDate (Files_File f, int32 *t, int32 *d) Platform_MTimeAsClock(identity, &*t, &*d); } -int32 Files_Pos (Files_Rider *r, LONGINT *r__typ) +int32 Files_Pos (Files_Rider *r, address *r__typ) { int32 _o_result; _o_result = (*r).org + (*r).offset; return _o_result; } -void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, int32 pos) +void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos) { int32 org, offset, i, n; Files_Buffer buf = NIL; @@ -613,7 +613,7 @@ void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, int32 pos) (*r).res = 0; } -void Files_Read (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x) +void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x) { int32 offset; Files_Buffer buf = NIL; @@ -637,7 +637,7 @@ void Files_Read (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x) } } -void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n) +void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n) { int32 xpos, min, restInBuf, offset; Files_Buffer buf = NIL; @@ -673,19 +673,19 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x (*r).eof = 0; } -void Files_ReadByte (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len) +void Files_ReadByte (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len) { Files_ReadBytes(&*r, r__typ, (void*)x, x__len * 1, 1); } -Files_File Files_Base (Files_Rider *r, LONGINT *r__typ) +Files_File Files_Base (Files_Rider *r, address *r__typ) { Files_File _o_result; _o_result = (*r).buf->f; return _o_result; } -void Files_Write (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE x) +void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x) { Files_Buffer buf = NIL; int32 offset; @@ -706,7 +706,7 @@ void Files_Write (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE x) (*r).res = 0; } -void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n) +void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n) { int32 xpos, min, restInBuf, offset; Files_Buffer buf = NIL; @@ -849,26 +849,26 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *de } } -void Files_ReadBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN *x) +void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x) { Files_Read(&*R, R__typ, (CHAR*)(void*)&*x); } -void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, int16 *x) +void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x) { CHAR b[2]; Files_ReadBytes(&*R, R__typ, (void*)b, 2, 2); *x = (int16)b[0] + __ASHL((int16)b[1], 8); } -void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, int32 *x) +void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x) { CHAR b[4]; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); *x = (((int16)b[0] + __ASHL((int16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); } -void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x) +void Files_ReadSet (Files_Rider *R, address *R__typ, SET *x) { CHAR b[4]; int32 l; @@ -877,21 +877,21 @@ void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x) *x = (SET)l; } -void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x) +void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x) { CHAR b[4]; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); Files_FlipBytes((void*)b, 4, (void*)&*x, 4); } -void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x) +void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x) { CHAR b[8]; Files_ReadBytes(&*R, R__typ, (void*)b, 8, 8); Files_FlipBytes((void*)b, 8, (void*)&*x, 8); } -void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) +void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) { int16 i; CHAR ch; @@ -903,7 +903,7 @@ void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) } while (!(ch == 0x00)); } -void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) +void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) { int16 i; CHAR ch; @@ -921,7 +921,7 @@ void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) } while (!b); } -void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int32 *x) +void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x) { int8 s; CHAR ch; @@ -938,19 +938,19 @@ void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int32 *x) *x = n; } -void Files_ReadNum64 (Files_Rider *R, LONGINT *R__typ, int64 *x) +void Files_ReadNum64 (Files_Rider *R, address *R__typ, int64 *x) { int32 n; Files_ReadNum(&*R, R__typ, &n); *x = n; } -void Files_WriteBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN x) +void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x) { Files_Write(&*R, R__typ, __VAL(CHAR, x)); } -void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, int16 x) +void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x) { CHAR b[2]; b[0] = (CHAR)x; @@ -958,7 +958,7 @@ void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, int16 x) Files_WriteBytes(&*R, R__typ, (void*)b, 2, 2); } -void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, int32 x) +void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x) { CHAR b[4]; b[0] = (CHAR)x; @@ -968,7 +968,7 @@ void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, int32 x) Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } -void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x) +void Files_WriteSet (Files_Rider *R, address *R__typ, SET x) { CHAR b[4]; int32 i; @@ -980,21 +980,21 @@ void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x) Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } -void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x) +void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x) { CHAR b[4]; Files_FlipBytes((void*)&x, 4, (void*)b, 4); Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } -void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x) +void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x) { CHAR b[8]; Files_FlipBytes((void*)&x, 8, (void*)b, 8); Files_WriteBytes(&*R, R__typ, (void*)b, 8, 8); } -void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) +void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) { int16 i; i = 0; @@ -1004,7 +1004,7 @@ void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len Files_WriteBytes(&*R, R__typ, (void*)x, x__len * 1, i + 1); } -void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int32 x) +void Files_WriteNum (Files_Rider *R, address *R__typ, int32 x) { while (x < -64 || x > 63) { Files_Write(&*R, R__typ, (CHAR)(__MASK(x, -128) + 128)); @@ -1013,7 +1013,7 @@ void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int32 x) Files_Write(&*R, R__typ, (CHAR)__MASK(x, -128)); } -void Files_WriteNum64 (Files_Rider *R, LONGINT *R__typ, int64 x) +void Files_WriteNum64 (Files_Rider *R, address *R__typ, int64 x) { while (x < -64 || x > 63) { Files_Write(&*R, R__typ, (CHAR)(__MASK(x, -128) + 128)); diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index 1e8c0d89..80684752 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tspaSfF */ #ifndef Files__h #define Files__h @@ -24,10 +24,10 @@ typedef -import LONGINT *Files_FileDesc__typ; -import LONGINT *Files_Rider__typ; +import address *Files_FileDesc__typ; +import address *Files_Rider__typ; -import Files_File Files_Base (Files_Rider *r, LONGINT *r__typ); +import Files_File Files_Base (Files_Rider *r, address *r__typ); import void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int16 *res); import void Files_Close (Files_File f); import void Files_Delete (CHAR *name, LONGINT name__len, int16 *res); @@ -36,36 +36,36 @@ import void Files_GetName (Files_File f, CHAR *name, LONGINT name__len); import int32 Files_Length (Files_File f); import Files_File Files_New (CHAR *name, LONGINT name__len); import Files_File Files_Old (CHAR *name, LONGINT name__len); -import int32 Files_Pos (Files_Rider *r, LONGINT *r__typ); +import int32 Files_Pos (Files_Rider *r, address *r__typ); import void Files_Purge (Files_File f); -import void Files_Read (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x); -import void Files_ReadBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN *x); -import void Files_ReadByte (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len); -import void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); -import void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, int16 *x); -import void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, int32 *x); -import void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x); -import void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); -import void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int32 *x); -import void Files_ReadNum64 (Files_Rider *R, LONGINT *R__typ, int64 *x); -import void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x); -import void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x); -import void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); +import void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x); +import void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x); +import void Files_ReadByte (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len); +import void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); +import void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x); +import void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); +import void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); +import void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); +import void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x); +import void Files_ReadNum64 (Files_Rider *R, address *R__typ, int64 *x); +import void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); +import void Files_ReadSet (Files_Rider *R, address *R__typ, SET *x); +import void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); import void Files_Register (Files_File f); import void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res); -import void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, int32 pos); +import void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos); import void Files_SetSearchPath (CHAR *path, LONGINT path__len); -import void Files_Write (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE x); -import void Files_WriteBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN x); -import void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); -import void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, int16 x); -import void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, int32 x); -import void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x); -import void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int32 x); -import void Files_WriteNum64 (Files_Rider *R, LONGINT *R__typ, int64 x); -import void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x); -import void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x); -import void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); +import void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x); +import void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x); +import void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); +import void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x); +import void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x); +import void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x); +import void Files_WriteNum (Files_Rider *R, address *R__typ, int32 x); +import void Files_WriteNum64 (Files_Rider *R, address *R__typ, int64 x); +import void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x); +import void Files_WriteSet (Files_Rider *R, address *R__typ, SET x); +import void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); import void *Files__init(void); diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index 17784d67..b7c8c827 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tsSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tsSfF */ #define INTEGER int16 #define LONGINT int32 @@ -74,10 +74,10 @@ static int16 Heap_lockdepth; static BOOLEAN Heap_interrupted; export int16 Heap_FileCount; -export LONGINT *Heap_ModuleDesc__typ; -export LONGINT *Heap_CmdDesc__typ; -export LONGINT *Heap_FinDesc__typ; -export LONGINT *Heap__1__typ; +export address *Heap_ModuleDesc__typ; +export address *Heap_CmdDesc__typ; +export address *Heap_FinDesc__typ; +export address *Heap__1__typ; static void Heap_CheckFin (void); static void Heap_ExtendHeap (address blksz); diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index b1c745df..6ad4813e 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tsSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tsSfF */ #ifndef Heap__h #define Heap__h @@ -34,7 +34,7 @@ import SYSTEM_PTR Heap_modules; import address Heap_allocated, Heap_heapsize; import int16 Heap_FileCount; -import LONGINT *Heap_ModuleDesc__typ; +import address *Heap_ModuleDesc__typ; import void Heap_FINALL (void); import void Heap_GC (BOOLEAN markStack); diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index 1564f5e0..7704f005 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -43,8 +43,8 @@ export int16 Modules_res; export CHAR Modules_resMsg[256]; export Modules_ModuleName Modules_imported, Modules_importing; -export LONGINT *Modules_ModuleDesc__typ; -export LONGINT *Modules_CmdDesc__typ; +export address *Modules_ModuleDesc__typ; +export address *Modules_CmdDesc__typ; static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len); export void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all); diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index dbc243c8..060208c6 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef Modules__h #define Modules__h @@ -40,8 +40,8 @@ import int16 Modules_res; import CHAR Modules_resMsg[256]; import Modules_ModuleName Modules_imported, Modules_importing; -import LONGINT *Modules_ModuleDesc__typ; -import LONGINT *Modules_CmdDesc__typ; +import address *Modules_ModuleDesc__typ; +import address *Modules_CmdDesc__typ; import void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all); import Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len); diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index d0336349..af4f4fc4 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index 434172a2..dc0085af 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 11f64b59..99353400 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -1041,7 +1041,7 @@ static void OPC_IdentList (OPT_Object obj, int16 vis) } else if ((obj->mode == 2 && obj->typ->comp == 4)) { OPC_EndStat(); OPC_BegStat(); - OPM_WriteString((CHAR*)"LONGINT *", 10); + OPM_WriteString((CHAR*)"address *", 10); OPC_Ident(obj); OPM_WriteString((CHAR*)"__typ", 6); base = NIL; @@ -1078,7 +1078,7 @@ static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames) OPM_WriteString((CHAR*)", LONGINT ", 11); OPC_LenList(obj, 1, showParamNames); } else if ((obj->mode == 2 && obj->typ->comp == 4)) { - OPM_WriteString((CHAR*)", LONGINT *", 12); + OPM_WriteString((CHAR*)", address *", 12); if (showParamNames) { OPC_Ident(obj); OPM_WriteString((CHAR*)"__typ", 6); @@ -1166,7 +1166,7 @@ static void OPC_GenDynTypes (OPT_Node n, int16 vis) } else { OPM_WriteString((CHAR*)"export ", 8); } - OPM_WriteString((CHAR*)"LONGINT *", 10); + OPM_WriteString((CHAR*)"address *", 10); OPC_Andent(typ); OPM_WriteString((CHAR*)"__typ", 6); OPC_EndStat(); diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index 09952648..4215947f 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 2122bed9..039d1c77 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -41,7 +41,7 @@ static CHAR OPM_OBERON[1024]; static CHAR OPM_MODULES[1024]; -static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F); +static void OPM_Append (Files_Rider *R, address *R__typ, Files_File F); export void OPM_CloseFiles (void); export void OPM_CloseOldSym (void); export void OPM_DeleteNewSym (void); @@ -49,10 +49,10 @@ export void OPM_FPrint (int32 *fp, int64 val); export void OPM_FPrintLReal (int32 *fp, LONGREAL lr); export void OPM_FPrintReal (int32 *fp, REAL real); export void OPM_FPrintSet (int32 *fp, SET set); -static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, int64 pos); +static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 pos); export void OPM_Get (CHAR *ch); static void OPM_GetProperties (void); -static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONGINT name__len, int16 *size, int16 *align); +static void OPM_GetProperty (Texts_Scanner *S, address *S__typ, CHAR *name, LONGINT name__len, int16 *size, int16 *align); export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); export void OPM_InitOptions (void); export int16 OPM_Integer (int64 n); @@ -496,7 +496,7 @@ static void OPM_LogErrMsg (int16 n) OPM_LogWStr(errors_errors[__X(n, 350)], 128); } -static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, int64 pos) +static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 pos) { CHAR ch, cheol; if (pos < (int64)OPM_ErrorLineStartPos) { @@ -654,7 +654,7 @@ void OPM_FPrintLReal (int32 *fp, LONGREAL lr) OPM_FPrint(&*fp, h); } -static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONGINT name__len, int16 *size, int16 *align) +static void OPM_GetProperty (Texts_Scanner *S, address *S__typ, CHAR *name, LONGINT name__len, int16 *size, int16 *align) { __DUP(name, name__len, CHAR); if (((*S).class == 1 && __STRCMP((*S).s, name) == 0)) { @@ -996,7 +996,7 @@ void OPM_WriteLn (void) Files_Write(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, 0x0a); } -static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F) +static void OPM_Append (Files_Rider *R, address *R__typ, Files_File F) { Files_Rider R1; CHAR buffer[4096]; diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index 8ca21351..a6b7990c 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index d2b3e83f..a3ab1dd3 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -24,7 +24,7 @@ static OPT_Node OPP_TDinit, OPP_lastTDinit; static int16 OPP_nofFwdPtr; static OPT_Struct OPP_FwdPtr[64]; -export LONGINT *OPP__1__typ; +export address *OPP__1__typ; static void OPP_ActualParameters (OPT_Node *aparlist, OPT_Object fpar); static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned); diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index 28045a86..e5a59f6c 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index 99aba006..0cac83bd 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index f7dd1d10..caef45f4 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index abd3934b..c52efac6 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -101,12 +101,12 @@ static OPT_ExpCtxt OPT_expCtxt; static int32 OPT_nofhdfld; static BOOLEAN OPT_newsf, OPT_findpc, OPT_extsf, OPT_sfpresent, OPT_symExtended, OPT_symNew; -export LONGINT *OPT_ConstDesc__typ; -export LONGINT *OPT_ObjDesc__typ; -export LONGINT *OPT_StrDesc__typ; -export LONGINT *OPT_NodeDesc__typ; -export LONGINT *OPT_ImpCtxt__typ; -export LONGINT *OPT_ExpCtxt__typ; +export address *OPT_ConstDesc__typ; +export address *OPT_ObjDesc__typ; +export address *OPT_StrDesc__typ; +export address *OPT_NodeDesc__typ; +export address *OPT_ImpCtxt__typ; +export address *OPT_ExpCtxt__typ; export void OPT_Close (void); export void OPT_CloseScope (void); diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index 5de02c8b..0bd1f189 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPT__h #define OPT__h @@ -75,10 +75,10 @@ import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; import BOOLEAN OPT_SYSimported; -import LONGINT *OPT_ConstDesc__typ; -import LONGINT *OPT_ObjDesc__typ; -import LONGINT *OPT_StrDesc__typ; -import LONGINT *OPT_NodeDesc__typ; +import address *OPT_ConstDesc__typ; +import address *OPT_ObjDesc__typ; +import address *OPT_StrDesc__typ; +import address *OPT_NodeDesc__typ; import void OPT_Close (void); import void OPT_CloseScope (void); diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index efddd202..8bb5ec32 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -21,7 +21,7 @@ static int32 OPV_recno; static OPV_ExitInfo OPV_exit; static int16 OPV_nofExitLabels; -export LONGINT *OPV_ExitInfo__typ; +export address *OPV_ExitInfo__typ; static void OPV_ActualPar (OPT_Node n, OPT_Object fp); export void OPV_AdrAndSize (OPT_Object topScope); diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index 4a3f9d07..c309d63c 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index f8d3f76c..54a94ae8 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -44,7 +44,7 @@ export int32 Platform_StdIn, Platform_StdOut, Platform_StdErr; static Platform_SignalHandler Platform_InterruptHandler; export CHAR Platform_nl[3]; -export LONGINT *Platform_FileIdentity__typ; +export address *Platform_FileIdentity__typ; export BOOLEAN Platform_Absent (int16 e); export int16 Platform_ArgPos (CHAR *s, LONGINT s__len); @@ -63,8 +63,8 @@ export void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val export void Platform_GetIntArg (int16 n, int32 *val); export void Platform_GetTimeOfDay (int32 *sec, int32 *usec); export void Platform_Halt (int32 code); -export int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, LONGINT *identity__typ); -export int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); +export int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ); +export int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); export BOOLEAN Platform_Inaccessible (int16 e); export void Platform_Init (int16 argc, address argvadr); export void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); @@ -82,7 +82,7 @@ export BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIde export int16 Platform_Seek (int32 h, int32 o, int16 r); export void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); export void Platform_SetHalt (Platform_HaltProcedure p); -export void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Platform_FileIdentity source); +export void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Platform_FileIdentity source); export int16 Platform_Size (int32 h, int32 *l); export int16 Platform_Sync (int32 h); export int16 Platform_System (CHAR *cmd, LONGINT cmd__len); @@ -467,7 +467,7 @@ int16 Platform_Close (int32 h) __RETCHK; } -int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, LONGINT *identity__typ) +int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ) { int16 _o_result; Platform_byHandleFileInformation(); @@ -484,7 +484,7 @@ int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, LONGINT *iden return _o_result; } -int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ) +int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ) { int16 _o_result; int32 h; @@ -517,7 +517,7 @@ BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i return _o_result; } -void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Platform_FileIdentity source) +void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Platform_FileIdentity source) { (*target).mtimehigh = source.mtimehigh; (*target).mtimelow = source.mtimelow; diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index c93c79ce..18ca5267 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef Platform__h #define Platform__h @@ -29,7 +29,7 @@ import int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; import int32 Platform_StdIn, Platform_StdOut, Platform_StdErr; import CHAR Platform_nl[3]; -import LONGINT *Platform_FileIdentity__typ; +import address *Platform_FileIdentity__typ; import BOOLEAN Platform_Absent (int16 e); import int16 Platform_ArgPos (CHAR *s, LONGINT s__len); @@ -47,8 +47,8 @@ import void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val import void Platform_GetIntArg (int16 n, int32 *val); import void Platform_GetTimeOfDay (int32 *sec, int32 *usec); import void Platform_Halt (int32 code); -import int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, LONGINT *identity__typ); -import int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); +import int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ); +import int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); import BOOLEAN Platform_Inaccessible (int16 e); import void Platform_Init (int16 argc, address argvadr); import void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); @@ -66,7 +66,7 @@ import BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIde import int16 Platform_Seek (int32 h, int32 o, int16 r); import void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); import void Platform_SetHalt (Platform_HaltProcedure p); -import void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Platform_FileIdentity source); +import void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Platform_FileIdentity source); import int16 Platform_Size (int32 h, int32 *l); import int16 Platform_Sync (int32 h); import int16 Platform_System (CHAR *cmd, LONGINT cmd__len); diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index c1ffff0a..fe93e8be 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index 0ccc7989..e7cba0d8 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index 0f221fe7..427a0cc4 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index 9fdb55fb..44c51b2a 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index f69de03d..60a7ea7a 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -33,7 +33,7 @@ typedef } Texts_ElemMsg; typedef - void (*Texts_Handler)(Texts_Elem, Texts_ElemMsg*, LONGINT *); + void (*Texts_Handler)(Texts_Elem, Texts_ElemMsg*, address *); typedef struct Texts_TextDesc *Texts_Text; @@ -167,20 +167,20 @@ export Texts_Elem Texts_new; static Texts_Buffer Texts_del; static Texts_FontsFont Texts_FontsDefault; -export LONGINT *Texts_FontDesc__typ; -export LONGINT *Texts_RunDesc__typ; -export LONGINT *Texts_PieceDesc__typ; -export LONGINT *Texts_ElemMsg__typ; -export LONGINT *Texts_ElemDesc__typ; -export LONGINT *Texts_FileMsg__typ; -export LONGINT *Texts_CopyMsg__typ; -export LONGINT *Texts_IdentifyMsg__typ; -export LONGINT *Texts_BufDesc__typ; -export LONGINT *Texts_TextDesc__typ; -export LONGINT *Texts_Reader__typ; -export LONGINT *Texts_Scanner__typ; -export LONGINT *Texts_Writer__typ; -export LONGINT *Texts__1__typ; +export address *Texts_FontDesc__typ; +export address *Texts_RunDesc__typ; +export address *Texts_PieceDesc__typ; +export address *Texts_ElemMsg__typ; +export address *Texts_ElemDesc__typ; +export address *Texts_FileMsg__typ; +export address *Texts_CopyMsg__typ; +export address *Texts_IdentifyMsg__typ; +export address *Texts_BufDesc__typ; +export address *Texts_TextDesc__typ; +export address *Texts_Reader__typ; +export address *Texts_Scanner__typ; +export address *Texts_Writer__typ; +export address *Texts__1__typ; export void Texts_Append (Texts_Text T, Texts_Buffer B); export void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff); @@ -194,41 +194,41 @@ export Texts_Text Texts_ElemBase (Texts_Elem E); export int32 Texts_ElemPos (Texts_Elem E); static void Texts_Find (Texts_Text T, int32 *pos, Texts_Run *u, int32 *org, int32 *off); static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len); -static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, LONGINT *msg__typ); +static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, address *msg__typ); export void Texts_Insert (Texts_Text T, int32 pos, Texts_Buffer B); -export void Texts_Load (Files_Rider *r, LONGINT *r__typ, Texts_Text T); -static void Texts_Load0 (Files_Rider *r, LONGINT *r__typ, Texts_Text T); +export void Texts_Load (Files_Rider *r, address *r__typ, Texts_Text T); +static void Texts_Load0 (Files_Rider *r, address *r__typ, Texts_Text T); static void Texts_Merge (Texts_Text T, Texts_Run u, Texts_Run *v); export void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len); export void Texts_OpenBuf (Texts_Buffer B); -export void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, int32 pos); -export void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, int32 pos); -export void Texts_OpenWriter (Texts_Writer *W, LONGINT *W__typ); -export int32 Texts_Pos (Texts_Reader *R, LONGINT *R__typ); -export void Texts_Read (Texts_Reader *R, LONGINT *R__typ, CHAR *ch); -export void Texts_ReadElem (Texts_Reader *R, LONGINT *R__typ); -export void Texts_ReadPrevElem (Texts_Reader *R, LONGINT *R__typ); +export void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int32 pos); +export void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int32 pos); +export void Texts_OpenWriter (Texts_Writer *W, address *W__typ); +export int32 Texts_Pos (Texts_Reader *R, address *R__typ); +export void Texts_Read (Texts_Reader *R, address *R__typ, CHAR *ch); +export void Texts_ReadElem (Texts_Reader *R, address *R__typ); +export void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ); export void Texts_Recall (Texts_Buffer *B); export void Texts_Save (Texts_Text T, int32 beg, int32 end, Texts_Buffer B); -export void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ); -export void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, int8 col); -export void Texts_SetFont (Texts_Writer *W, LONGINT *W__typ, Texts_FontsFont fnt); -export void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, int8 voff); +export void Texts_Scan (Texts_Scanner *S, address *S__typ); +export void Texts_SetColor (Texts_Writer *W, address *W__typ, int8 col); +export void Texts_SetFont (Texts_Writer *W, address *W__typ, Texts_FontsFont fnt); +export void Texts_SetOffset (Texts_Writer *W, address *W__typ, int8 voff); static void Texts_Splice (Texts_Run un, Texts_Run v, Texts_Run w, Texts_Text base); static void Texts_Split (int32 off, Texts_Run *u, Texts_Run *un); -export void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T); -export void Texts_Write (Texts_Writer *W, LONGINT *W__typ, CHAR ch); -export void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, int32 t, int32 d); -export void Texts_WriteElem (Texts_Writer *W, LONGINT *W__typ, Texts_Elem e); -export void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, int32 x); -export void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int64 x, int64 n); -export void Texts_WriteLn (Texts_Writer *W, LONGINT *W__typ); -export void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, int16 n); -export void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x); -export void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, int16 n); -export void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, int16 n, int16 k); -export void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x); -export void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__len); +export void Texts_Store (Files_Rider *r, address *r__typ, Texts_Text T); +export void Texts_Write (Texts_Writer *W, address *W__typ, CHAR ch); +export void Texts_WriteDate (Texts_Writer *W, address *W__typ, int32 t, int32 d); +export void Texts_WriteElem (Texts_Writer *W, address *W__typ, Texts_Elem e); +export void Texts_WriteHex (Texts_Writer *W, address *W__typ, int32 x); +export void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n); +export void Texts_WriteLn (Texts_Writer *W, address *W__typ); +export void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int16 n); +export void Texts_WriteLongRealHex (Texts_Writer *W, address *W__typ, LONGREAL x); +export void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int16 n); +export void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int16 n, int16 k); +export void Texts_WriteRealHex (Texts_Writer *W, address *W__typ, REAL x); +export void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGINT s__len); static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len) @@ -388,7 +388,7 @@ int32 Texts_ElemPos (Texts_Elem E) return _o_result; } -static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, LONGINT *msg__typ) +static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, address *msg__typ) { Texts_Alien e = NIL; Files_Rider r; @@ -604,7 +604,7 @@ void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, SET sel, Texts_Fonts } } -void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, int32 pos) +void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int32 pos) { Texts_Run u = NIL; if (pos >= T->len) { @@ -618,7 +618,7 @@ void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, int32 pos } } -void Texts_Read (Texts_Reader *R, LONGINT *R__typ, CHAR *ch) +void Texts_Read (Texts_Reader *R, address *R__typ, CHAR *ch) { Texts_Run u = NIL; int32 pos; @@ -663,7 +663,7 @@ void Texts_Read (Texts_Reader *R, LONGINT *R__typ, CHAR *ch) } } -void Texts_ReadElem (Texts_Reader *R, LONGINT *R__typ) +void Texts_ReadElem (Texts_Reader *R, address *R__typ) { Texts_Run u = NIL, un = NIL; u = (*R).run; @@ -691,7 +691,7 @@ void Texts_ReadElem (Texts_Reader *R, LONGINT *R__typ) } } -void Texts_ReadPrevElem (Texts_Reader *R, LONGINT *R__typ) +void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ) { Texts_Run u = NIL; u = (*R).run->prev; @@ -713,14 +713,14 @@ void Texts_ReadPrevElem (Texts_Reader *R, LONGINT *R__typ) } } -int32 Texts_Pos (Texts_Reader *R, LONGINT *R__typ) +int32 Texts_Pos (Texts_Reader *R, address *R__typ) { int32 _o_result; _o_result = (*R).org + (*R).off; return _o_result; } -void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, int32 pos) +void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int32 pos) { Texts_OpenReader((void*)&*S, S__typ, T, pos); (*S).line = 0; @@ -729,7 +729,7 @@ void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, int32 p static struct Scan__31 { Texts_Scanner *S; - LONGINT *S__typ; + address *S__typ; CHAR *ch; BOOLEAN *negE; int16 *e; @@ -756,7 +756,7 @@ static void ReadScaleFactor__32 (void) } } -void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) +void Texts_Scan (Texts_Scanner *S, address *S__typ) { CHAR ch, term; BOOLEAN neg, negE, hex; @@ -962,7 +962,7 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) Scan__31_s = _s.lnk; } -void Texts_OpenWriter (Texts_Writer *W, LONGINT *W__typ) +void Texts_OpenWriter (Texts_Writer *W, address *W__typ) { __NEW((*W).buf, Texts_BufDesc); Texts_OpenBuf((*W).buf); @@ -973,22 +973,22 @@ void Texts_OpenWriter (Texts_Writer *W, LONGINT *W__typ) Files_Set(&(*W).rider, Files_Rider__typ, (*W).file, 0); } -void Texts_SetFont (Texts_Writer *W, LONGINT *W__typ, Texts_FontsFont fnt) +void Texts_SetFont (Texts_Writer *W, address *W__typ, Texts_FontsFont fnt) { (*W).fnt = fnt; } -void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, int8 col) +void Texts_SetColor (Texts_Writer *W, address *W__typ, int8 col) { (*W).col = col; } -void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, int8 voff) +void Texts_SetOffset (Texts_Writer *W, address *W__typ, int8 voff) { (*W).voff = voff; } -void Texts_Write (Texts_Writer *W, LONGINT *W__typ, CHAR ch) +void Texts_Write (Texts_Writer *W, address *W__typ, CHAR ch) { Texts_Run u = NIL, un = NIL; Texts_Piece p = NIL; @@ -1014,7 +1014,7 @@ void Texts_Write (Texts_Writer *W, LONGINT *W__typ, CHAR ch) } } -void Texts_WriteElem (Texts_Writer *W, LONGINT *W__typ, Texts_Elem e) +void Texts_WriteElem (Texts_Writer *W, address *W__typ, Texts_Elem e) { Texts_Run u = NIL, un = NIL; if (e->base != NIL) { @@ -1033,12 +1033,12 @@ void Texts_WriteElem (Texts_Writer *W, LONGINT *W__typ, Texts_Elem e) un->prev = (Texts_Run)e; } -void Texts_WriteLn (Texts_Writer *W, LONGINT *W__typ) +void Texts_WriteLn (Texts_Writer *W, address *W__typ) { Texts_Write(&*W, W__typ, 0x0d); } -void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__len) +void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGINT s__len) { int16 i; __DUP(s, s__len, CHAR); @@ -1050,7 +1050,7 @@ void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__le __DEL(s); } -void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int64 x, int64 n) +void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n) { int16 i; int64 x0; @@ -1085,7 +1085,7 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int64 x, int64 n) } while (!(i == 0)); } -void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, int32 x) +void Texts_WriteHex (Texts_Writer *W, address *W__typ, int32 x) { int16 i; int32 y; @@ -1108,7 +1108,7 @@ void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, int32 x) } while (!(i == 0)); } -void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, int16 n) +void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int16 n) { int16 e; REAL x0; @@ -1180,7 +1180,7 @@ void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, int16 n) static struct WriteRealFix__53 { Texts_Writer *W; - LONGINT *W__typ; + address *W__typ; int16 *i; CHAR (*d)[9]; struct WriteRealFix__53 *lnk; @@ -1206,7 +1206,7 @@ static void dig__54 (int16 n) } } -void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, int16 n, int16 k) +void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int16 n, int16 k) { int16 e, i; CHAR sign; @@ -1278,7 +1278,7 @@ void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, int16 n, int1 WriteRealFix__53_s = _s.lnk; } -void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x) +void Texts_WriteRealHex (Texts_Writer *W, address *W__typ, REAL x) { int16 i; CHAR d[8]; @@ -1290,7 +1290,7 @@ void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x) } while (!(i == 8)); } -void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, int16 n) +void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int16 n) { int16 e; LONGREAL x0; @@ -1362,7 +1362,7 @@ void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, int16 n) } } -void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x) +void Texts_WriteLongRealHex (Texts_Writer *W, address *W__typ, LONGREAL x) { int16 i; CHAR d[16]; @@ -1376,7 +1376,7 @@ void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x) static struct WriteDate__43 { Texts_Writer *W; - LONGINT *W__typ; + address *W__typ; struct WriteDate__43 *lnk; } *WriteDate__43_s; @@ -1389,7 +1389,7 @@ static void WritePair__44 (CHAR ch, int32 x) Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)((int)__MOD(x, 10) + 48)); } -void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, int32 t, int32 d) +void Texts_WriteDate (Texts_Writer *W, address *W__typ, int32 t, int32 d) { struct WriteDate__43 _s; _s.W = W; _s.W__typ = W__typ; @@ -1413,9 +1413,9 @@ static struct Load0__16 { struct Load0__16 *lnk; } *Load0__16_s; -static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, int32 pos, int32 span, Texts_Elem *e); +static void LoadElem__17 (Files_Rider *r, address *r__typ, int32 pos, int32 span, Texts_Elem *e); -static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, int32 pos, int32 span, Texts_Elem *e) +static void LoadElem__17 (Files_Rider *r, address *r__typ, int32 pos, int32 span, Texts_Elem *e) { Modules_Module M = NIL; Modules_Command Cmd; @@ -1466,7 +1466,7 @@ static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, int32 pos, int32 span } } -static void Texts_Load0 (Files_Rider *r, LONGINT *r__typ, Texts_Text T) +static void Texts_Load0 (Files_Rider *r, address *r__typ, Texts_Text T) { Texts_Run u = NIL, un = NIL; Texts_Piece p = NIL; @@ -1540,7 +1540,7 @@ static void Texts_Load0 (Files_Rider *r, LONGINT *r__typ, Texts_Text T) Load0__16_s = _s.lnk; } -void Texts_Load (Files_Rider *r, LONGINT *r__typ, Texts_Text T) +void Texts_Load (Files_Rider *r, address *r__typ, Texts_Text T) { int16 tag; Files_ReadInt(&*r, r__typ, &tag); @@ -1614,9 +1614,9 @@ static struct Store__39 { struct Store__39 *lnk; } *Store__39_s; -static void StoreElem__40 (Files_Rider *r, LONGINT *r__typ, int32 pos, Texts_Elem e); +static void StoreElem__40 (Files_Rider *r, address *r__typ, int32 pos, Texts_Elem e); -static void StoreElem__40 (Files_Rider *r, LONGINT *r__typ, int32 pos, Texts_Elem e) +static void StoreElem__40 (Files_Rider *r, address *r__typ, int32 pos, Texts_Elem e) { Files_Rider r1; int32 org, span; @@ -1646,7 +1646,7 @@ static void StoreElem__40 (Files_Rider *r, LONGINT *r__typ, int32 pos, Texts_Ele Files_WriteLInt(&r1, Files_Rider__typ, e->H); } -void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T) +void Texts_Store (Files_Rider *r, address *r__typ, Texts_Text T) { Files_Rider r1; Texts_Run u = NIL, un = NIL; diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index e3ed3241..df86e814 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef Texts__h #define Texts__h @@ -35,7 +35,7 @@ typedef } Texts_RunDesc; typedef - void (*Texts_Handler)(Texts_Elem, Texts_ElemMsg*, LONGINT *); + void (*Texts_Handler)(Texts_Elem, Texts_ElemMsg*, address *); typedef struct Texts_ElemDesc { @@ -116,18 +116,18 @@ typedef import Texts_Elem Texts_new; -import LONGINT *Texts_FontDesc__typ; -import LONGINT *Texts_RunDesc__typ; -import LONGINT *Texts_ElemMsg__typ; -import LONGINT *Texts_ElemDesc__typ; -import LONGINT *Texts_FileMsg__typ; -import LONGINT *Texts_CopyMsg__typ; -import LONGINT *Texts_IdentifyMsg__typ; -import LONGINT *Texts_BufDesc__typ; -import LONGINT *Texts_TextDesc__typ; -import LONGINT *Texts_Reader__typ; -import LONGINT *Texts_Scanner__typ; -import LONGINT *Texts_Writer__typ; +import address *Texts_FontDesc__typ; +import address *Texts_RunDesc__typ; +import address *Texts_ElemMsg__typ; +import address *Texts_ElemDesc__typ; +import address *Texts_FileMsg__typ; +import address *Texts_CopyMsg__typ; +import address *Texts_IdentifyMsg__typ; +import address *Texts_BufDesc__typ; +import address *Texts_TextDesc__typ; +import address *Texts_Reader__typ; +import address *Texts_Scanner__typ; +import address *Texts_Writer__typ; import void Texts_Append (Texts_Text T, Texts_Buffer B); import void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff); @@ -138,35 +138,35 @@ import void Texts_Delete (Texts_Text T, int32 beg, int32 end); import Texts_Text Texts_ElemBase (Texts_Elem E); import int32 Texts_ElemPos (Texts_Elem E); import void Texts_Insert (Texts_Text T, int32 pos, Texts_Buffer B); -import void Texts_Load (Files_Rider *r, LONGINT *r__typ, Texts_Text T); +import void Texts_Load (Files_Rider *r, address *r__typ, Texts_Text T); import void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len); import void Texts_OpenBuf (Texts_Buffer B); -import void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, int32 pos); -import void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, int32 pos); -import void Texts_OpenWriter (Texts_Writer *W, LONGINT *W__typ); -import int32 Texts_Pos (Texts_Reader *R, LONGINT *R__typ); -import void Texts_Read (Texts_Reader *R, LONGINT *R__typ, CHAR *ch); -import void Texts_ReadElem (Texts_Reader *R, LONGINT *R__typ); -import void Texts_ReadPrevElem (Texts_Reader *R, LONGINT *R__typ); +import void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int32 pos); +import void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int32 pos); +import void Texts_OpenWriter (Texts_Writer *W, address *W__typ); +import int32 Texts_Pos (Texts_Reader *R, address *R__typ); +import void Texts_Read (Texts_Reader *R, address *R__typ, CHAR *ch); +import void Texts_ReadElem (Texts_Reader *R, address *R__typ); +import void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ); import void Texts_Recall (Texts_Buffer *B); import void Texts_Save (Texts_Text T, int32 beg, int32 end, Texts_Buffer B); -import void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ); -import void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, int8 col); -import void Texts_SetFont (Texts_Writer *W, LONGINT *W__typ, Texts_FontsFont fnt); -import void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, int8 voff); -import void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T); -import void Texts_Write (Texts_Writer *W, LONGINT *W__typ, CHAR ch); -import void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, int32 t, int32 d); -import void Texts_WriteElem (Texts_Writer *W, LONGINT *W__typ, Texts_Elem e); -import void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, int32 x); -import void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int64 x, int64 n); -import void Texts_WriteLn (Texts_Writer *W, LONGINT *W__typ); -import void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, int16 n); -import void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x); -import void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, int16 n); -import void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, int16 n, int16 k); -import void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x); -import void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__len); +import void Texts_Scan (Texts_Scanner *S, address *S__typ); +import void Texts_SetColor (Texts_Writer *W, address *W__typ, int8 col); +import void Texts_SetFont (Texts_Writer *W, address *W__typ, Texts_FontsFont fnt); +import void Texts_SetOffset (Texts_Writer *W, address *W__typ, int8 voff); +import void Texts_Store (Files_Rider *r, address *r__typ, Texts_Text T); +import void Texts_Write (Texts_Writer *W, address *W__typ, CHAR ch); +import void Texts_WriteDate (Texts_Writer *W, address *W__typ, int32 t, int32 d); +import void Texts_WriteElem (Texts_Writer *W, address *W__typ, Texts_Elem e); +import void Texts_WriteHex (Texts_Writer *W, address *W__typ, int32 x); +import void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n); +import void Texts_WriteLn (Texts_Writer *W, address *W__typ); +import void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int16 n); +import void Texts_WriteLongRealHex (Texts_Writer *W, address *W__typ, LONGREAL x); +import void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int16 n); +import void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int16 n, int16 k); +import void Texts_WriteRealHex (Texts_Writer *W, address *W__typ, REAL x); +import void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGINT s__len); import void *Texts__init(void); diff --git a/bootstrap/windows-48/Vishap.c b/bootstrap/windows-48/Vishap.c index 7b2dcd23..1ec89e33 100644 --- a/bootstrap/windows-48/Vishap.c +++ b/bootstrap/windows-48/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspamSf */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspamSf */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/errors.c b/bootstrap/windows-48/errors.c index 3a4b1ce7..0a40d5e9 100644 --- a/bootstrap/windows-48/errors.c +++ b/bootstrap/windows-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/errors.h b/bootstrap/windows-48/errors.h index 6ca6c961..759b613e 100644 --- a/bootstrap/windows-48/errors.h +++ b/bootstrap/windows-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index 2167c7f8..8be0b63d 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index 0b905427..bff1c62c 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/vt100.c b/bootstrap/windows-48/vt100.c index c337a9e2..4f6a6c9d 100644 --- a/bootstrap/windows-48/vt100.c +++ b/bootstrap/windows-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/vt100.h b/bootstrap/windows-48/vt100.h index 2428fce4..94f8add4 100644 --- a/bootstrap/windows-48/vt100.h +++ b/bootstrap/windows-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index 8945bf88..fa5765f3 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/22] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/23] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index dca477a6..f51f63f2 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Console.c b/bootstrap/windows-88/Console.c index 84cb998f..939de5cc 100644 --- a/bootstrap/windows-88/Console.c +++ b/bootstrap/windows-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -118,10 +118,10 @@ void Console_Hex (int64 i) void Console_Read (CHAR *ch) { - address n; + int64 n; int32 error; Console_Flush(); - error = Platform_ReadBuf(Platform_StdIn, (void*)&*ch, 1, (void*)&n); + error = Platform_ReadBuf(Platform_StdIn, (void*)&*ch, 1, &n); if (n != 1) { *ch = 0x00; } diff --git a/bootstrap/windows-88/Console.h b/bootstrap/windows-88/Console.h index 02fad3c1..64d39044 100644 --- a/bootstrap/windows-88/Console.h +++ b/bootstrap/windows-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 8336cb0e..27fb9031 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tspaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -56,11 +56,11 @@ static struct { CHAR data[1]; } *Files_SearchPath; -export LONGINT *Files_FileDesc__typ; -export LONGINT *Files_BufDesc__typ; -export LONGINT *Files_Rider__typ; +export address *Files_FileDesc__typ; +export address *Files_BufDesc__typ; +export address *Files_Rider__typ; -export Files_File Files_Base (Files_Rider *r, LONGINT *r__typ); +export Files_File Files_Base (Files_Rider *r, address *r__typ); static Files_File Files_CacheEntry (Platform_FileIdentity identity); export void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int32 *res); export void Files_Close (Files_File f); @@ -79,37 +79,37 @@ export int64 Files_Length (Files_File f); static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT name__len, CHAR *dest, LONGINT dest__len); export Files_File Files_New (CHAR *name, LONGINT name__len); export Files_File Files_Old (CHAR *name, LONGINT name__len); -export int64 Files_Pos (Files_Rider *r, LONGINT *r__typ); +export int64 Files_Pos (Files_Rider *r, address *r__typ); export void Files_Purge (Files_File f); -export void Files_Read (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x); -export void Files_ReadBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN *x); -export void Files_ReadByte (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len); -export void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int64 n); -export void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, int32 *x); -export void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, int64 *x); -export void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x); -export void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); -export void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int64 *x); -export void Files_ReadNum64 (Files_Rider *R, LONGINT *R__typ, int64 *x); -export void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x); -export void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x); -export void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); +export void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x); +export void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x); +export void Files_ReadByte (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len); +export void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int64 n); +export void Files_ReadInt (Files_Rider *R, address *R__typ, int32 *x); +export void Files_ReadLInt (Files_Rider *R, address *R__typ, int64 *x); +export void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); +export void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); +export void Files_ReadNum (Files_Rider *R, address *R__typ, int64 *x); +export void Files_ReadNum64 (Files_Rider *R, address *R__typ, int64 *x); +export void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); +export void Files_ReadSet (Files_Rider *R, address *R__typ, SET *x); +export void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); export void Files_Register (Files_File f); export void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int32 *res); static void Files_ScanPath (int32 *pos, CHAR *dir, LONGINT dir__len); -export void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, int64 pos); +export void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int64 pos); export void Files_SetSearchPath (CHAR *path, LONGINT path__len); -export void Files_Write (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE x); -export void Files_WriteBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN x); -export void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int64 n); -export void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, int32 x); -export void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, int64 x); -export void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x); -export void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int64 x); -export void Files_WriteNum64 (Files_Rider *R, LONGINT *R__typ, int64 x); -export void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x); -export void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x); -export void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); +export void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x); +export void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x); +export void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int64 n); +export void Files_WriteInt (Files_Rider *R, address *R__typ, int32 x); +export void Files_WriteLInt (Files_Rider *R, address *R__typ, int64 x); +export void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x); +export void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x); +export void Files_WriteNum64 (Files_Rider *R, address *R__typ, int64 x); +export void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x); +export void Files_WriteSet (Files_Rider *R, address *R__typ, SET x); +export void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); #define Files_IdxTrap() __HALT(-1) @@ -544,14 +544,14 @@ void Files_GetDate (Files_File f, int64 *t, int64 *d) Platform_MTimeAsClock(identity, &*t, &*d); } -int64 Files_Pos (Files_Rider *r, LONGINT *r__typ) +int64 Files_Pos (Files_Rider *r, address *r__typ) { int64 _o_result; _o_result = (*r).org + (*r).offset; return _o_result; } -void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, int64 pos) +void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int64 pos) { int64 org, offset, i, n; Files_Buffer buf = NIL; @@ -613,7 +613,7 @@ void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, int64 pos) (*r).res = 0; } -void Files_Read (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x) +void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x) { int64 offset; Files_Buffer buf = NIL; @@ -637,7 +637,7 @@ void Files_Read (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x) } } -void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int64 n) +void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int64 n) { int64 xpos, min, restInBuf, offset; Files_Buffer buf = NIL; @@ -673,19 +673,19 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x (*r).eof = 0; } -void Files_ReadByte (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len) +void Files_ReadByte (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len) { Files_ReadBytes(&*r, r__typ, (void*)x, x__len * 1, 1); } -Files_File Files_Base (Files_Rider *r, LONGINT *r__typ) +Files_File Files_Base (Files_Rider *r, address *r__typ) { Files_File _o_result; _o_result = (*r).buf->f; return _o_result; } -void Files_Write (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE x) +void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x) { Files_Buffer buf = NIL; int64 offset; @@ -706,7 +706,7 @@ void Files_Write (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE x) (*r).res = 0; } -void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int64 n) +void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int64 n) { int64 xpos, min, restInBuf, offset; Files_Buffer buf = NIL; @@ -849,26 +849,26 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *de } } -void Files_ReadBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN *x) +void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x) { Files_Read(&*R, R__typ, (CHAR*)(void*)&*x); } -void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, int32 *x) +void Files_ReadInt (Files_Rider *R, address *R__typ, int32 *x) { CHAR b[2]; Files_ReadBytes(&*R, R__typ, (void*)b, 2, 2); *x = b[0] + __ASHL(b[1], 8); } -void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, int64 *x) +void Files_ReadLInt (Files_Rider *R, address *R__typ, int64 *x) { CHAR b[4]; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); *x = ((b[0] + __ASHL(b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); } -void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x) +void Files_ReadSet (Files_Rider *R, address *R__typ, SET *x) { CHAR b[4]; int64 l; @@ -877,21 +877,21 @@ void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x) *x = (SET)l; } -void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x) +void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x) { CHAR b[4]; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); Files_FlipBytes((void*)b, 4, (void*)&*x, 4); } -void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x) +void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x) { CHAR b[8]; Files_ReadBytes(&*R, R__typ, (void*)b, 8, 8); Files_FlipBytes((void*)b, 8, (void*)&*x, 8); } -void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) +void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) { int32 i; CHAR ch; @@ -903,7 +903,7 @@ void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) } while (!(ch == 0x00)); } -void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) +void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) { int32 i; CHAR ch; @@ -921,7 +921,7 @@ void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) } while (!b); } -void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int64 *x) +void Files_ReadNum (Files_Rider *R, address *R__typ, int64 *x) { int8 s; CHAR ch; @@ -938,19 +938,19 @@ void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int64 *x) *x = n; } -void Files_ReadNum64 (Files_Rider *R, LONGINT *R__typ, int64 *x) +void Files_ReadNum64 (Files_Rider *R, address *R__typ, int64 *x) { int64 n; Files_ReadNum(&*R, R__typ, &n); *x = n; } -void Files_WriteBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN x) +void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x) { Files_Write(&*R, R__typ, __VAL(CHAR, x)); } -void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, int32 x) +void Files_WriteInt (Files_Rider *R, address *R__typ, int32 x) { CHAR b[2]; b[0] = (CHAR)x; @@ -958,7 +958,7 @@ void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, int32 x) Files_WriteBytes(&*R, R__typ, (void*)b, 2, 2); } -void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, int64 x) +void Files_WriteLInt (Files_Rider *R, address *R__typ, int64 x) { CHAR b[4]; b[0] = (CHAR)x; @@ -968,7 +968,7 @@ void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, int64 x) Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } -void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x) +void Files_WriteSet (Files_Rider *R, address *R__typ, SET x) { CHAR b[4]; int64 i; @@ -980,21 +980,21 @@ void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x) Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } -void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x) +void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x) { CHAR b[4]; Files_FlipBytes((void*)&x, 4, (void*)b, 4); Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } -void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x) +void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x) { CHAR b[8]; Files_FlipBytes((void*)&x, 8, (void*)b, 8); Files_WriteBytes(&*R, R__typ, (void*)b, 8, 8); } -void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) +void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) { int32 i; i = 0; @@ -1004,7 +1004,7 @@ void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len Files_WriteBytes(&*R, R__typ, (void*)x, x__len * 1, i + 1); } -void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int64 x) +void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x) { while (x < -64 || x > 63) { Files_Write(&*R, R__typ, (CHAR)(__MASK(x, -128) + 128)); @@ -1013,7 +1013,7 @@ void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int64 x) Files_Write(&*R, R__typ, (CHAR)__MASK(x, -128)); } -void Files_WriteNum64 (Files_Rider *R, LONGINT *R__typ, int64 x) +void Files_WriteNum64 (Files_Rider *R, address *R__typ, int64 x) { while (x < -64 || x > 63) { Files_Write(&*R, R__typ, (CHAR)(__MASK(x, -128) + 128)); diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 1fa0bb84..399f2137 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tspaSfF */ #ifndef Files__h #define Files__h @@ -24,10 +24,10 @@ typedef -import LONGINT *Files_FileDesc__typ; -import LONGINT *Files_Rider__typ; +import address *Files_FileDesc__typ; +import address *Files_Rider__typ; -import Files_File Files_Base (Files_Rider *r, LONGINT *r__typ); +import Files_File Files_Base (Files_Rider *r, address *r__typ); import void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int32 *res); import void Files_Close (Files_File f); import void Files_Delete (CHAR *name, LONGINT name__len, int32 *res); @@ -36,36 +36,36 @@ import void Files_GetName (Files_File f, CHAR *name, LONGINT name__len); import int64 Files_Length (Files_File f); import Files_File Files_New (CHAR *name, LONGINT name__len); import Files_File Files_Old (CHAR *name, LONGINT name__len); -import int64 Files_Pos (Files_Rider *r, LONGINT *r__typ); +import int64 Files_Pos (Files_Rider *r, address *r__typ); import void Files_Purge (Files_File f); -import void Files_Read (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x); -import void Files_ReadBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN *x); -import void Files_ReadByte (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len); -import void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int64 n); -import void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, int32 *x); -import void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, int64 *x); -import void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x); -import void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); -import void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int64 *x); -import void Files_ReadNum64 (Files_Rider *R, LONGINT *R__typ, int64 *x); -import void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x); -import void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x); -import void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); +import void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x); +import void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x); +import void Files_ReadByte (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len); +import void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int64 n); +import void Files_ReadInt (Files_Rider *R, address *R__typ, int32 *x); +import void Files_ReadLInt (Files_Rider *R, address *R__typ, int64 *x); +import void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); +import void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); +import void Files_ReadNum (Files_Rider *R, address *R__typ, int64 *x); +import void Files_ReadNum64 (Files_Rider *R, address *R__typ, int64 *x); +import void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); +import void Files_ReadSet (Files_Rider *R, address *R__typ, SET *x); +import void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); import void Files_Register (Files_File f); import void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int32 *res); -import void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, int64 pos); +import void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int64 pos); import void Files_SetSearchPath (CHAR *path, LONGINT path__len); -import void Files_Write (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE x); -import void Files_WriteBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN x); -import void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int64 n); -import void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, int32 x); -import void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, int64 x); -import void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x); -import void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int64 x); -import void Files_WriteNum64 (Files_Rider *R, LONGINT *R__typ, int64 x); -import void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x); -import void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x); -import void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); +import void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x); +import void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x); +import void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int64 n); +import void Files_WriteInt (Files_Rider *R, address *R__typ, int32 x); +import void Files_WriteLInt (Files_Rider *R, address *R__typ, int64 x); +import void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x); +import void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x); +import void Files_WriteNum64 (Files_Rider *R, address *R__typ, int64 x); +import void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x); +import void Files_WriteSet (Files_Rider *R, address *R__typ, SET x); +import void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); import void *Files__init(void); diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index 8d65bb87..c87cfd6d 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tsSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tsSfF */ #define INTEGER int32 #define LONGINT int64 @@ -74,10 +74,10 @@ static int32 Heap_lockdepth; static BOOLEAN Heap_interrupted; export int32 Heap_FileCount; -export LONGINT *Heap_ModuleDesc__typ; -export LONGINT *Heap_CmdDesc__typ; -export LONGINT *Heap_FinDesc__typ; -export LONGINT *Heap__1__typ; +export address *Heap_ModuleDesc__typ; +export address *Heap_CmdDesc__typ; +export address *Heap_FinDesc__typ; +export address *Heap__1__typ; static void Heap_CheckFin (void); static void Heap_ExtendHeap (address blksz); diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index 516a3aca..b4829f2f 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tsSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tsSfF */ #ifndef Heap__h #define Heap__h @@ -34,7 +34,7 @@ import SYSTEM_PTR Heap_modules; import address Heap_allocated, Heap_heapsize; import int32 Heap_FileCount; -import LONGINT *Heap_ModuleDesc__typ; +import address *Heap_ModuleDesc__typ; import void Heap_FINALL (void); import void Heap_GC (BOOLEAN markStack); diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 3d3d4700..23fec310 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -43,8 +43,8 @@ export int32 Modules_res; export CHAR Modules_resMsg[256]; export Modules_ModuleName Modules_imported, Modules_importing; -export LONGINT *Modules_ModuleDesc__typ; -export LONGINT *Modules_CmdDesc__typ; +export address *Modules_ModuleDesc__typ; +export address *Modules_CmdDesc__typ; static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len); export void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all); diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index 46624045..7cafac5f 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef Modules__h #define Modules__h @@ -40,8 +40,8 @@ import int32 Modules_res; import CHAR Modules_resMsg[256]; import Modules_ModuleName Modules_imported, Modules_importing; -import LONGINT *Modules_ModuleDesc__typ; -import LONGINT *Modules_CmdDesc__typ; +import address *Modules_ModuleDesc__typ; +import address *Modules_CmdDesc__typ; import void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all); import Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len); diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index 5cea943a..81077606 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index 66bdcc6c..6863fee8 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index a01fcde9..ee7f4baa 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -1041,7 +1041,7 @@ static void OPC_IdentList (OPT_Object obj, int32 vis) } else if ((obj->mode == 2 && obj->typ->comp == 4)) { OPC_EndStat(); OPC_BegStat(); - OPM_WriteString((CHAR*)"LONGINT *", 10); + OPM_WriteString((CHAR*)"address *", 10); OPC_Ident(obj); OPM_WriteString((CHAR*)"__typ", 6); base = NIL; @@ -1078,7 +1078,7 @@ static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames) OPM_WriteString((CHAR*)", LONGINT ", 11); OPC_LenList(obj, 1, showParamNames); } else if ((obj->mode == 2 && obj->typ->comp == 4)) { - OPM_WriteString((CHAR*)", LONGINT *", 12); + OPM_WriteString((CHAR*)", address *", 12); if (showParamNames) { OPC_Ident(obj); OPM_WriteString((CHAR*)"__typ", 6); @@ -1166,7 +1166,7 @@ static void OPC_GenDynTypes (OPT_Node n, int32 vis) } else { OPM_WriteString((CHAR*)"export ", 8); } - OPM_WriteString((CHAR*)"LONGINT *", 10); + OPM_WriteString((CHAR*)"address *", 10); OPC_Andent(typ); OPM_WriteString((CHAR*)"__typ", 6); OPC_EndStat(); diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index 4a7c8523..6fe30a31 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 22131ab9..3f07341b 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -40,7 +40,7 @@ static CHAR OPM_OBERON[1024]; static CHAR OPM_MODULES[1024]; -static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F); +static void OPM_Append (Files_Rider *R, address *R__typ, Files_File F); export void OPM_CloseFiles (void); export void OPM_CloseOldSym (void); export void OPM_DeleteNewSym (void); @@ -48,10 +48,10 @@ export void OPM_FPrint (int64 *fp, int64 val); export void OPM_FPrintLReal (int64 *fp, LONGREAL lr); export void OPM_FPrintReal (int64 *fp, REAL real); export void OPM_FPrintSet (int64 *fp, SET set); -static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, int64 pos); +static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 pos); export void OPM_Get (CHAR *ch); static void OPM_GetProperties (void); -static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONGINT name__len, int32 *size, int32 *align); +static void OPM_GetProperty (Texts_Scanner *S, address *S__typ, CHAR *name, LONGINT name__len, int32 *size, int32 *align); export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); export void OPM_InitOptions (void); export int32 OPM_Integer (int64 n); @@ -495,7 +495,7 @@ static void OPM_LogErrMsg (int32 n) OPM_LogWStr(errors_errors[__X(n, 350)], 128); } -static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, int64 pos) +static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 pos) { CHAR ch, cheol; if (pos < OPM_ErrorLineStartPos) { @@ -651,7 +651,7 @@ void OPM_FPrintLReal (int64 *fp, LONGREAL lr) OPM_FPrint(&*fp, __VAL(int64, lr)); } -static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONGINT name__len, int32 *size, int32 *align) +static void OPM_GetProperty (Texts_Scanner *S, address *S__typ, CHAR *name, LONGINT name__len, int32 *size, int32 *align) { __DUP(name, name__len, CHAR); if (((*S).class == 1 && __STRCMP((*S).s, name) == 0)) { @@ -993,7 +993,7 @@ void OPM_WriteLn (void) Files_Write(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, 0x0a); } -static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F) +static void OPM_Append (Files_Rider *R, address *R__typ, Files_File F) { Files_Rider R1; CHAR buffer[4096]; diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index b1fab659..765b9680 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index 8c85929d..9b25c35f 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -24,7 +24,7 @@ static OPT_Node OPP_TDinit, OPP_lastTDinit; static int32 OPP_nofFwdPtr; static OPT_Struct OPP_FwdPtr[64]; -export LONGINT *OPP__1__typ; +export address *OPP__1__typ; static void OPP_ActualParameters (OPT_Node *aparlist, OPT_Object fpar); static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned); diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index 28045a86..e5a59f6c 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index 869dfa4b..cd24b8ee 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index 7de91cb4..bcc2ae4d 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index 2dd48c74..41686385 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -100,12 +100,12 @@ static OPT_ExpCtxt OPT_expCtxt; static int64 OPT_nofhdfld; static BOOLEAN OPT_newsf, OPT_findpc, OPT_extsf, OPT_sfpresent, OPT_symExtended, OPT_symNew; -export LONGINT *OPT_ConstDesc__typ; -export LONGINT *OPT_ObjDesc__typ; -export LONGINT *OPT_StrDesc__typ; -export LONGINT *OPT_NodeDesc__typ; -export LONGINT *OPT_ImpCtxt__typ; -export LONGINT *OPT_ExpCtxt__typ; +export address *OPT_ConstDesc__typ; +export address *OPT_ObjDesc__typ; +export address *OPT_StrDesc__typ; +export address *OPT_NodeDesc__typ; +export address *OPT_ImpCtxt__typ; +export address *OPT_ExpCtxt__typ; export void OPT_Close (void); export void OPT_CloseScope (void); diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index a1956589..697eb2c9 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPT__h #define OPT__h @@ -74,10 +74,10 @@ import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; import BOOLEAN OPT_SYSimported; -import LONGINT *OPT_ConstDesc__typ; -import LONGINT *OPT_ObjDesc__typ; -import LONGINT *OPT_StrDesc__typ; -import LONGINT *OPT_NodeDesc__typ; +import address *OPT_ConstDesc__typ; +import address *OPT_ObjDesc__typ; +import address *OPT_StrDesc__typ; +import address *OPT_NodeDesc__typ; import void OPT_Close (void); import void OPT_CloseScope (void); diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 22d0def4..b57b2868 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -21,7 +21,7 @@ static int64 OPV_recno; static OPV_ExitInfo OPV_exit; static int32 OPV_nofExitLabels; -export LONGINT *OPV_ExitInfo__typ; +export address *OPV_ExitInfo__typ; static void OPV_ActualPar (OPT_Node n, OPT_Object fp); export void OPV_AdrAndSize (OPT_Object topScope); diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index 4a3f9d07..c309d63c 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 6651ddd3..363a0045 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -44,7 +44,7 @@ export int64 Platform_StdIn, Platform_StdOut, Platform_StdErr; static Platform_SignalHandler Platform_InterruptHandler; export CHAR Platform_nl[3]; -export LONGINT *Platform_FileIdentity__typ; +export address *Platform_FileIdentity__typ; export BOOLEAN Platform_Absent (int32 e); export int32 Platform_ArgPos (CHAR *s, LONGINT s__len); @@ -63,8 +63,8 @@ export void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val export void Platform_GetIntArg (int32 n, int64 *val); export void Platform_GetTimeOfDay (int64 *sec, int64 *usec); export void Platform_Halt (int64 code); -export int32 Platform_Identify (int64 h, Platform_FileIdentity *identity, LONGINT *identity__typ); -export int32 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); +export int32 Platform_Identify (int64 h, Platform_FileIdentity *identity, address *identity__typ); +export int32 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); export BOOLEAN Platform_Inaccessible (int32 e); export void Platform_Init (int32 argc, address argvadr); export void Platform_MTimeAsClock (Platform_FileIdentity i, int64 *t, int64 *d); @@ -82,7 +82,7 @@ export BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIde export int32 Platform_Seek (int64 h, int64 o, int32 r); export void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); export void Platform_SetHalt (Platform_HaltProcedure p); -export void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Platform_FileIdentity source); +export void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Platform_FileIdentity source); export int32 Platform_Size (int64 h, int64 *l); export int32 Platform_Sync (int64 h); export int32 Platform_System (CHAR *cmd, LONGINT cmd__len); @@ -467,7 +467,7 @@ int32 Platform_Close (int64 h) __RETCHK; } -int32 Platform_Identify (int64 h, Platform_FileIdentity *identity, LONGINT *identity__typ) +int32 Platform_Identify (int64 h, Platform_FileIdentity *identity, address *identity__typ) { int32 _o_result; Platform_byHandleFileInformation(); @@ -484,7 +484,7 @@ int32 Platform_Identify (int64 h, Platform_FileIdentity *identity, LONGINT *iden return _o_result; } -int32 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ) +int32 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ) { int32 _o_result; int64 h; @@ -517,7 +517,7 @@ BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i return _o_result; } -void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Platform_FileIdentity source) +void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Platform_FileIdentity source) { (*target).mtimehigh = source.mtimehigh; (*target).mtimelow = source.mtimelow; diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index 8fd37cdd..6cab3690 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef Platform__h #define Platform__h @@ -29,7 +29,7 @@ import int32 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; import int64 Platform_StdIn, Platform_StdOut, Platform_StdErr; import CHAR Platform_nl[3]; -import LONGINT *Platform_FileIdentity__typ; +import address *Platform_FileIdentity__typ; import BOOLEAN Platform_Absent (int32 e); import int32 Platform_ArgPos (CHAR *s, LONGINT s__len); @@ -47,8 +47,8 @@ import void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val import void Platform_GetIntArg (int32 n, int64 *val); import void Platform_GetTimeOfDay (int64 *sec, int64 *usec); import void Platform_Halt (int64 code); -import int32 Platform_Identify (int64 h, Platform_FileIdentity *identity, LONGINT *identity__typ); -import int32 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); +import int32 Platform_Identify (int64 h, Platform_FileIdentity *identity, address *identity__typ); +import int32 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); import BOOLEAN Platform_Inaccessible (int32 e); import void Platform_Init (int32 argc, address argvadr); import void Platform_MTimeAsClock (Platform_FileIdentity i, int64 *t, int64 *d); @@ -66,7 +66,7 @@ import BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIde import int32 Platform_Seek (int64 h, int64 o, int32 r); import void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); import void Platform_SetHalt (Platform_HaltProcedure p); -import void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Platform_FileIdentity source); +import void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Platform_FileIdentity source); import int32 Platform_Size (int64 h, int64 *l); import int32 Platform_Sync (int64 h); import int32 Platform_System (CHAR *cmd, LONGINT cmd__len); diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 039a3b6d..7678a81e 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index e27d5dca..4de192c6 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index 2f1a7062..49fbdd21 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index 90baacae..4dd0d2c3 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index ee371c4e..6403ce33 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -33,7 +33,7 @@ typedef } Texts_ElemMsg; typedef - void (*Texts_Handler)(Texts_Elem, Texts_ElemMsg*, LONGINT *); + void (*Texts_Handler)(Texts_Elem, Texts_ElemMsg*, address *); typedef struct Texts_TextDesc *Texts_Text; @@ -167,20 +167,20 @@ export Texts_Elem Texts_new; static Texts_Buffer Texts_del; static Texts_FontsFont Texts_FontsDefault; -export LONGINT *Texts_FontDesc__typ; -export LONGINT *Texts_RunDesc__typ; -export LONGINT *Texts_PieceDesc__typ; -export LONGINT *Texts_ElemMsg__typ; -export LONGINT *Texts_ElemDesc__typ; -export LONGINT *Texts_FileMsg__typ; -export LONGINT *Texts_CopyMsg__typ; -export LONGINT *Texts_IdentifyMsg__typ; -export LONGINT *Texts_BufDesc__typ; -export LONGINT *Texts_TextDesc__typ; -export LONGINT *Texts_Reader__typ; -export LONGINT *Texts_Scanner__typ; -export LONGINT *Texts_Writer__typ; -export LONGINT *Texts__1__typ; +export address *Texts_FontDesc__typ; +export address *Texts_RunDesc__typ; +export address *Texts_PieceDesc__typ; +export address *Texts_ElemMsg__typ; +export address *Texts_ElemDesc__typ; +export address *Texts_FileMsg__typ; +export address *Texts_CopyMsg__typ; +export address *Texts_IdentifyMsg__typ; +export address *Texts_BufDesc__typ; +export address *Texts_TextDesc__typ; +export address *Texts_Reader__typ; +export address *Texts_Scanner__typ; +export address *Texts_Writer__typ; +export address *Texts__1__typ; export void Texts_Append (Texts_Text T, Texts_Buffer B); export void Texts_ChangeLooks (Texts_Text T, int64 beg, int64 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff); @@ -194,41 +194,41 @@ export Texts_Text Texts_ElemBase (Texts_Elem E); export int64 Texts_ElemPos (Texts_Elem E); static void Texts_Find (Texts_Text T, int64 *pos, Texts_Run *u, int64 *org, int64 *off); static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len); -static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, LONGINT *msg__typ); +static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, address *msg__typ); export void Texts_Insert (Texts_Text T, int64 pos, Texts_Buffer B); -export void Texts_Load (Files_Rider *r, LONGINT *r__typ, Texts_Text T); -static void Texts_Load0 (Files_Rider *r, LONGINT *r__typ, Texts_Text T); +export void Texts_Load (Files_Rider *r, address *r__typ, Texts_Text T); +static void Texts_Load0 (Files_Rider *r, address *r__typ, Texts_Text T); static void Texts_Merge (Texts_Text T, Texts_Run u, Texts_Run *v); export void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len); export void Texts_OpenBuf (Texts_Buffer B); -export void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, int64 pos); -export void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, int64 pos); -export void Texts_OpenWriter (Texts_Writer *W, LONGINT *W__typ); -export int64 Texts_Pos (Texts_Reader *R, LONGINT *R__typ); -export void Texts_Read (Texts_Reader *R, LONGINT *R__typ, CHAR *ch); -export void Texts_ReadElem (Texts_Reader *R, LONGINT *R__typ); -export void Texts_ReadPrevElem (Texts_Reader *R, LONGINT *R__typ); +export void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int64 pos); +export void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int64 pos); +export void Texts_OpenWriter (Texts_Writer *W, address *W__typ); +export int64 Texts_Pos (Texts_Reader *R, address *R__typ); +export void Texts_Read (Texts_Reader *R, address *R__typ, CHAR *ch); +export void Texts_ReadElem (Texts_Reader *R, address *R__typ); +export void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ); export void Texts_Recall (Texts_Buffer *B); export void Texts_Save (Texts_Text T, int64 beg, int64 end, Texts_Buffer B); -export void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ); -export void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, int8 col); -export void Texts_SetFont (Texts_Writer *W, LONGINT *W__typ, Texts_FontsFont fnt); -export void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, int8 voff); +export void Texts_Scan (Texts_Scanner *S, address *S__typ); +export void Texts_SetColor (Texts_Writer *W, address *W__typ, int8 col); +export void Texts_SetFont (Texts_Writer *W, address *W__typ, Texts_FontsFont fnt); +export void Texts_SetOffset (Texts_Writer *W, address *W__typ, int8 voff); static void Texts_Splice (Texts_Run un, Texts_Run v, Texts_Run w, Texts_Text base); static void Texts_Split (int64 off, Texts_Run *u, Texts_Run *un); -export void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T); -export void Texts_Write (Texts_Writer *W, LONGINT *W__typ, CHAR ch); -export void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, int64 t, int64 d); -export void Texts_WriteElem (Texts_Writer *W, LONGINT *W__typ, Texts_Elem e); -export void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, int64 x); -export void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int64 x, int64 n); -export void Texts_WriteLn (Texts_Writer *W, LONGINT *W__typ); -export void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, int32 n); -export void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x); -export void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, int32 n); -export void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, int32 n, int32 k); -export void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x); -export void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__len); +export void Texts_Store (Files_Rider *r, address *r__typ, Texts_Text T); +export void Texts_Write (Texts_Writer *W, address *W__typ, CHAR ch); +export void Texts_WriteDate (Texts_Writer *W, address *W__typ, int64 t, int64 d); +export void Texts_WriteElem (Texts_Writer *W, address *W__typ, Texts_Elem e); +export void Texts_WriteHex (Texts_Writer *W, address *W__typ, int64 x); +export void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n); +export void Texts_WriteLn (Texts_Writer *W, address *W__typ); +export void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int32 n); +export void Texts_WriteLongRealHex (Texts_Writer *W, address *W__typ, LONGREAL x); +export void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int32 n); +export void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int32 n, int32 k); +export void Texts_WriteRealHex (Texts_Writer *W, address *W__typ, REAL x); +export void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGINT s__len); static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len) @@ -388,7 +388,7 @@ int64 Texts_ElemPos (Texts_Elem E) return _o_result; } -static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, LONGINT *msg__typ) +static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, address *msg__typ) { Texts_Alien e = NIL; Files_Rider r; @@ -604,7 +604,7 @@ void Texts_ChangeLooks (Texts_Text T, int64 beg, int64 end, SET sel, Texts_Fonts } } -void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, int64 pos) +void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int64 pos) { Texts_Run u = NIL; if (pos >= T->len) { @@ -618,7 +618,7 @@ void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, int64 pos } } -void Texts_Read (Texts_Reader *R, LONGINT *R__typ, CHAR *ch) +void Texts_Read (Texts_Reader *R, address *R__typ, CHAR *ch) { Texts_Run u = NIL; int64 pos; @@ -663,7 +663,7 @@ void Texts_Read (Texts_Reader *R, LONGINT *R__typ, CHAR *ch) } } -void Texts_ReadElem (Texts_Reader *R, LONGINT *R__typ) +void Texts_ReadElem (Texts_Reader *R, address *R__typ) { Texts_Run u = NIL, un = NIL; u = (*R).run; @@ -691,7 +691,7 @@ void Texts_ReadElem (Texts_Reader *R, LONGINT *R__typ) } } -void Texts_ReadPrevElem (Texts_Reader *R, LONGINT *R__typ) +void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ) { Texts_Run u = NIL; u = (*R).run->prev; @@ -713,14 +713,14 @@ void Texts_ReadPrevElem (Texts_Reader *R, LONGINT *R__typ) } } -int64 Texts_Pos (Texts_Reader *R, LONGINT *R__typ) +int64 Texts_Pos (Texts_Reader *R, address *R__typ) { int64 _o_result; _o_result = (*R).org + (*R).off; return _o_result; } -void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, int64 pos) +void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int64 pos) { Texts_OpenReader((void*)&*S, S__typ, T, pos); (*S).line = 0; @@ -729,7 +729,7 @@ void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, int64 p static struct Scan__31 { Texts_Scanner *S; - LONGINT *S__typ; + address *S__typ; CHAR *ch; BOOLEAN *negE; int32 *e; @@ -756,7 +756,7 @@ static void ReadScaleFactor__32 (void) } } -void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) +void Texts_Scan (Texts_Scanner *S, address *S__typ) { CHAR ch, term; BOOLEAN neg, negE, hex; @@ -962,7 +962,7 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) Scan__31_s = _s.lnk; } -void Texts_OpenWriter (Texts_Writer *W, LONGINT *W__typ) +void Texts_OpenWriter (Texts_Writer *W, address *W__typ) { __NEW((*W).buf, Texts_BufDesc); Texts_OpenBuf((*W).buf); @@ -973,22 +973,22 @@ void Texts_OpenWriter (Texts_Writer *W, LONGINT *W__typ) Files_Set(&(*W).rider, Files_Rider__typ, (*W).file, 0); } -void Texts_SetFont (Texts_Writer *W, LONGINT *W__typ, Texts_FontsFont fnt) +void Texts_SetFont (Texts_Writer *W, address *W__typ, Texts_FontsFont fnt) { (*W).fnt = fnt; } -void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, int8 col) +void Texts_SetColor (Texts_Writer *W, address *W__typ, int8 col) { (*W).col = col; } -void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, int8 voff) +void Texts_SetOffset (Texts_Writer *W, address *W__typ, int8 voff) { (*W).voff = voff; } -void Texts_Write (Texts_Writer *W, LONGINT *W__typ, CHAR ch) +void Texts_Write (Texts_Writer *W, address *W__typ, CHAR ch) { Texts_Run u = NIL, un = NIL; Texts_Piece p = NIL; @@ -1014,7 +1014,7 @@ void Texts_Write (Texts_Writer *W, LONGINT *W__typ, CHAR ch) } } -void Texts_WriteElem (Texts_Writer *W, LONGINT *W__typ, Texts_Elem e) +void Texts_WriteElem (Texts_Writer *W, address *W__typ, Texts_Elem e) { Texts_Run u = NIL, un = NIL; if (e->base != NIL) { @@ -1033,12 +1033,12 @@ void Texts_WriteElem (Texts_Writer *W, LONGINT *W__typ, Texts_Elem e) un->prev = (Texts_Run)e; } -void Texts_WriteLn (Texts_Writer *W, LONGINT *W__typ) +void Texts_WriteLn (Texts_Writer *W, address *W__typ) { Texts_Write(&*W, W__typ, 0x0d); } -void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__len) +void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGINT s__len) { int32 i; __DUP(s, s__len, CHAR); @@ -1050,7 +1050,7 @@ void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__le __DEL(s); } -void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int64 x, int64 n) +void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n) { int32 i; int64 x0; @@ -1085,7 +1085,7 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int64 x, int64 n) } while (!(i == 0)); } -void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, int64 x) +void Texts_WriteHex (Texts_Writer *W, address *W__typ, int64 x) { int32 i; int64 y; @@ -1108,7 +1108,7 @@ void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, int64 x) } while (!(i == 0)); } -void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, int32 n) +void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int32 n) { int32 e; REAL x0; @@ -1180,7 +1180,7 @@ void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, int32 n) static struct WriteRealFix__53 { Texts_Writer *W; - LONGINT *W__typ; + address *W__typ; int32 *i; CHAR (*d)[9]; struct WriteRealFix__53 *lnk; @@ -1206,7 +1206,7 @@ static void dig__54 (int32 n) } } -void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, int32 n, int32 k) +void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int32 n, int32 k) { int32 e, i; CHAR sign; @@ -1278,7 +1278,7 @@ void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, int32 n, int3 WriteRealFix__53_s = _s.lnk; } -void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x) +void Texts_WriteRealHex (Texts_Writer *W, address *W__typ, REAL x) { int32 i; CHAR d[8]; @@ -1290,7 +1290,7 @@ void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x) } while (!(i == 8)); } -void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, int32 n) +void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int32 n) { int32 e; LONGREAL x0; @@ -1362,7 +1362,7 @@ void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, int32 n) } } -void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x) +void Texts_WriteLongRealHex (Texts_Writer *W, address *W__typ, LONGREAL x) { int32 i; CHAR d[16]; @@ -1376,7 +1376,7 @@ void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x) static struct WriteDate__43 { Texts_Writer *W; - LONGINT *W__typ; + address *W__typ; struct WriteDate__43 *lnk; } *WriteDate__43_s; @@ -1389,7 +1389,7 @@ static void WritePair__44 (CHAR ch, int64 x) Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)(__MOD(x, 10) + 48)); } -void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, int64 t, int64 d) +void Texts_WriteDate (Texts_Writer *W, address *W__typ, int64 t, int64 d) { struct WriteDate__43 _s; _s.W = W; _s.W__typ = W__typ; @@ -1413,9 +1413,9 @@ static struct Load0__16 { struct Load0__16 *lnk; } *Load0__16_s; -static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, int64 pos, int64 span, Texts_Elem *e); +static void LoadElem__17 (Files_Rider *r, address *r__typ, int64 pos, int64 span, Texts_Elem *e); -static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, int64 pos, int64 span, Texts_Elem *e) +static void LoadElem__17 (Files_Rider *r, address *r__typ, int64 pos, int64 span, Texts_Elem *e) { Modules_Module M = NIL; Modules_Command Cmd; @@ -1466,7 +1466,7 @@ static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, int64 pos, int64 span } } -static void Texts_Load0 (Files_Rider *r, LONGINT *r__typ, Texts_Text T) +static void Texts_Load0 (Files_Rider *r, address *r__typ, Texts_Text T) { Texts_Run u = NIL, un = NIL; Texts_Piece p = NIL; @@ -1540,7 +1540,7 @@ static void Texts_Load0 (Files_Rider *r, LONGINT *r__typ, Texts_Text T) Load0__16_s = _s.lnk; } -void Texts_Load (Files_Rider *r, LONGINT *r__typ, Texts_Text T) +void Texts_Load (Files_Rider *r, address *r__typ, Texts_Text T) { int32 tag; Files_ReadInt(&*r, r__typ, &tag); @@ -1614,9 +1614,9 @@ static struct Store__39 { struct Store__39 *lnk; } *Store__39_s; -static void StoreElem__40 (Files_Rider *r, LONGINT *r__typ, int64 pos, Texts_Elem e); +static void StoreElem__40 (Files_Rider *r, address *r__typ, int64 pos, Texts_Elem e); -static void StoreElem__40 (Files_Rider *r, LONGINT *r__typ, int64 pos, Texts_Elem e) +static void StoreElem__40 (Files_Rider *r, address *r__typ, int64 pos, Texts_Elem e) { Files_Rider r1; int64 org, span; @@ -1646,7 +1646,7 @@ static void StoreElem__40 (Files_Rider *r, LONGINT *r__typ, int64 pos, Texts_Ele Files_WriteLInt(&r1, Files_Rider__typ, e->H); } -void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T) +void Texts_Store (Files_Rider *r, address *r__typ, Texts_Text T) { Files_Rider r1; Texts_Run u = NIL, un = NIL; diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index 32047663..e85157ed 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef Texts__h #define Texts__h @@ -35,7 +35,7 @@ typedef } Texts_RunDesc; typedef - void (*Texts_Handler)(Texts_Elem, Texts_ElemMsg*, LONGINT *); + void (*Texts_Handler)(Texts_Elem, Texts_ElemMsg*, address *); typedef struct Texts_ElemDesc { @@ -115,18 +115,18 @@ typedef import Texts_Elem Texts_new; -import LONGINT *Texts_FontDesc__typ; -import LONGINT *Texts_RunDesc__typ; -import LONGINT *Texts_ElemMsg__typ; -import LONGINT *Texts_ElemDesc__typ; -import LONGINT *Texts_FileMsg__typ; -import LONGINT *Texts_CopyMsg__typ; -import LONGINT *Texts_IdentifyMsg__typ; -import LONGINT *Texts_BufDesc__typ; -import LONGINT *Texts_TextDesc__typ; -import LONGINT *Texts_Reader__typ; -import LONGINT *Texts_Scanner__typ; -import LONGINT *Texts_Writer__typ; +import address *Texts_FontDesc__typ; +import address *Texts_RunDesc__typ; +import address *Texts_ElemMsg__typ; +import address *Texts_ElemDesc__typ; +import address *Texts_FileMsg__typ; +import address *Texts_CopyMsg__typ; +import address *Texts_IdentifyMsg__typ; +import address *Texts_BufDesc__typ; +import address *Texts_TextDesc__typ; +import address *Texts_Reader__typ; +import address *Texts_Scanner__typ; +import address *Texts_Writer__typ; import void Texts_Append (Texts_Text T, Texts_Buffer B); import void Texts_ChangeLooks (Texts_Text T, int64 beg, int64 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff); @@ -137,35 +137,35 @@ import void Texts_Delete (Texts_Text T, int64 beg, int64 end); import Texts_Text Texts_ElemBase (Texts_Elem E); import int64 Texts_ElemPos (Texts_Elem E); import void Texts_Insert (Texts_Text T, int64 pos, Texts_Buffer B); -import void Texts_Load (Files_Rider *r, LONGINT *r__typ, Texts_Text T); +import void Texts_Load (Files_Rider *r, address *r__typ, Texts_Text T); import void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len); import void Texts_OpenBuf (Texts_Buffer B); -import void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, int64 pos); -import void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, int64 pos); -import void Texts_OpenWriter (Texts_Writer *W, LONGINT *W__typ); -import int64 Texts_Pos (Texts_Reader *R, LONGINT *R__typ); -import void Texts_Read (Texts_Reader *R, LONGINT *R__typ, CHAR *ch); -import void Texts_ReadElem (Texts_Reader *R, LONGINT *R__typ); -import void Texts_ReadPrevElem (Texts_Reader *R, LONGINT *R__typ); +import void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int64 pos); +import void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int64 pos); +import void Texts_OpenWriter (Texts_Writer *W, address *W__typ); +import int64 Texts_Pos (Texts_Reader *R, address *R__typ); +import void Texts_Read (Texts_Reader *R, address *R__typ, CHAR *ch); +import void Texts_ReadElem (Texts_Reader *R, address *R__typ); +import void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ); import void Texts_Recall (Texts_Buffer *B); import void Texts_Save (Texts_Text T, int64 beg, int64 end, Texts_Buffer B); -import void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ); -import void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, int8 col); -import void Texts_SetFont (Texts_Writer *W, LONGINT *W__typ, Texts_FontsFont fnt); -import void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, int8 voff); -import void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T); -import void Texts_Write (Texts_Writer *W, LONGINT *W__typ, CHAR ch); -import void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, int64 t, int64 d); -import void Texts_WriteElem (Texts_Writer *W, LONGINT *W__typ, Texts_Elem e); -import void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, int64 x); -import void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int64 x, int64 n); -import void Texts_WriteLn (Texts_Writer *W, LONGINT *W__typ); -import void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, int32 n); -import void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x); -import void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, int32 n); -import void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, int32 n, int32 k); -import void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x); -import void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__len); +import void Texts_Scan (Texts_Scanner *S, address *S__typ); +import void Texts_SetColor (Texts_Writer *W, address *W__typ, int8 col); +import void Texts_SetFont (Texts_Writer *W, address *W__typ, Texts_FontsFont fnt); +import void Texts_SetOffset (Texts_Writer *W, address *W__typ, int8 voff); +import void Texts_Store (Files_Rider *r, address *r__typ, Texts_Text T); +import void Texts_Write (Texts_Writer *W, address *W__typ, CHAR ch); +import void Texts_WriteDate (Texts_Writer *W, address *W__typ, int64 t, int64 d); +import void Texts_WriteElem (Texts_Writer *W, address *W__typ, Texts_Elem e); +import void Texts_WriteHex (Texts_Writer *W, address *W__typ, int64 x); +import void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n); +import void Texts_WriteLn (Texts_Writer *W, address *W__typ); +import void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int32 n); +import void Texts_WriteLongRealHex (Texts_Writer *W, address *W__typ, LONGREAL x); +import void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int32 n); +import void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int32 n, int32 k); +import void Texts_WriteRealHex (Texts_Writer *W, address *W__typ, REAL x); +import void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGINT s__len); import void *Texts__init(void); diff --git a/bootstrap/windows-88/Vishap.c b/bootstrap/windows-88/Vishap.c index 87812cc2..5c6cada1 100644 --- a/bootstrap/windows-88/Vishap.c +++ b/bootstrap/windows-88/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspamSf */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspamSf */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/errors.c b/bootstrap/windows-88/errors.c index 897999f4..4bb09433 100644 --- a/bootstrap/windows-88/errors.c +++ b/bootstrap/windows-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/errors.h b/bootstrap/windows-88/errors.h index 6ca6c961..759b613e 100644 --- a/bootstrap/windows-88/errors.h +++ b/bootstrap/windows-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index 1647c4fe..d6bc2194 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index 0b905427..bff1c62c 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/vt100.c b/bootstrap/windows-88/vt100.c index 8b57066f..bb55d599 100644 --- a/bootstrap/windows-88/vt100.c +++ b/bootstrap/windows-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/vt100.h b/bootstrap/windows-88/vt100.h index e8809371..2bc7d18f 100644 --- a/bootstrap/windows-88/vt100.h +++ b/bootstrap/windows-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/src/compiler/OPC.Mod b/src/compiler/OPC.Mod index 29b8c302..8059d5fb 100644 --- a/src/compiler/OPC.Mod +++ b/src/compiler/OPC.Mod @@ -698,7 +698,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) OPM.WriteString("LONGINT "); LenList(obj, FALSE, TRUE) ELSIF (obj^.mode = OPT.VarPar) & (obj^.typ^.comp = OPT.Record) THEN EndStat; BegStat; - OPM.WriteString("LONGINT *"); Ident(obj); OPM.WriteString(TagExt); + OPM.WriteString("address *"); Ident(obj); OPM.WriteString(TagExt); base := NIL ELSIF (OPM.ptrinit IN OPM.opt) & (vis = 0) & (obj^.mnolev > 0) & (obj^.typ^.form = OPT.Pointer) THEN OPM.WriteString(" = NIL") @@ -726,7 +726,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) OPM.WriteString(", LONGINT "); LenList(obj, TRUE, showParamNames) ELSIF (obj^.mode = OPT.VarPar) & (obj^.typ^.comp = OPT.Record) THEN - OPM.WriteString(", LONGINT *"); + OPM.WriteString(", address *"); IF showParamNames THEN Ident(obj); OPM.WriteString(TagExt) END END ; IF (obj^.link = NIL) OR (obj^.link.mode = OPT.TProc) THEN EXIT END ; @@ -790,7 +790,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) ELSIF (typ^.strobj # NIL) & (typ^.strobj^.mnolev > 0) THEN OPM.WriteString('static ') ELSE OPM.WriteString(Export) END ; - OPM.WriteString("LONGINT *"); Andent(typ); OPM.WriteString(DynTypExt); + OPM.WriteString("address *"); Andent(typ); OPM.WriteString(DynTypExt); EndStat END ; n := n^.link diff --git a/src/system/Console.Mod b/src/system/Console.Mod index bf1c9a1d..6b35a090 100644 --- a/src/system/Console.Mod +++ b/src/system/Console.Mod @@ -65,7 +65,7 @@ MODULE Console; (* J. Templ, 29-June-96 *) END Hex; PROCEDURE Read*(VAR ch: CHAR); - VAR n: SYSTEM.ADDRESS; error: Platform.ErrorCode; + VAR n: LONGINT; error: Platform.ErrorCode; BEGIN Flush(); error := Platform.ReadBuf(Platform.StdIn, ch, n); IF n # 1 THEN ch := 0X END diff --git a/src/system/Platformunix.Mod b/src/system/Platformunix.Mod index a6e5d399..f514c9cf 100644 --- a/src/system/Platformunix.Mod +++ b/src/system/Platformunix.Mod @@ -316,7 +316,7 @@ PROCEDURE -structstats "struct stat s"; PROCEDURE -statdev(): LONGINT "(LONGINT)s.st_dev"; PROCEDURE -statino(): LONGINT "(LONGINT)s.st_ino"; PROCEDURE -statmtime(): LONGINT "(LONGINT)s.st_mtime"; -PROCEDURE -statsize(): SYSTEM.ADDRESS "(address)s.st_size"; +PROCEDURE -statsize(): LONGINT "(address)s.st_size"; PROCEDURE Identify*(h: FileHandle; VAR identity: FileIdentity): ErrorCode; BEGIN @@ -358,7 +358,7 @@ BEGIN END MTimeAsClock; -PROCEDURE Size*(h: FileHandle; VAR l: SYSTEM.ADDRESS): ErrorCode; +PROCEDURE Size*(h: FileHandle; VAR l: LONGINT): ErrorCode; BEGIN structstats; IF fstat(h) < 0 THEN RETURN err() END; @@ -368,16 +368,16 @@ END Size; -PROCEDURE -readfile (fd: LONGINT; p: SYSTEM.ADDRESS; l: SYSTEM.ADDRESS): SYSTEM.ADDRESS +PROCEDURE -readfile (fd: LONGINT; p: SYSTEM.ADDRESS; l: LONGINT): LONGINT "read(fd, (void*)(address)(p), l)"; -PROCEDURE Read*(h: FileHandle; p: SYSTEM.ADDRESS; l: SYSTEM.ADDRESS; VAR n: SYSTEM.ADDRESS): ErrorCode; +PROCEDURE Read*(h: FileHandle; p: SYSTEM.ADDRESS; l: LONGINT; VAR n: LONGINT): ErrorCode; BEGIN n := readfile(h, p, l); IF n < 0 THEN n := 0; RETURN err() ELSE RETURN 0 END END Read; -PROCEDURE ReadBuf*(h: FileHandle; VAR b: ARRAY OF SYSTEM.BYTE; VAR n: SYSTEM.ADDRESS): ErrorCode; +PROCEDURE ReadBuf*(h: FileHandle; VAR b: ARRAY OF SYSTEM.BYTE; VAR n: LONGINT): ErrorCode; BEGIN n := readfile(h, SYSTEM.ADR(b), LEN(b)); IF n < 0 THEN n := 0; RETURN err() ELSE RETURN 0 END diff --git a/src/system/SYSTEM.h b/src/system/SYSTEM.h index ddd85144..6ddf909a 100644 --- a/src/system/SYSTEM.h +++ b/src/system/SYSTEM.h @@ -243,10 +243,16 @@ static inline double SYSTEM_ABSD(double i) {return i >= 0.0 ? i : -i;} #define __CASECHK __HALT(-4) #define __WITHCHK __HALT(-7) -#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(address)typ##__typ) -#define __TYPEOF(p) ((LONGINT*)(address)(*(((LONGINT*)(p))-1))) + +//#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(address)typ##__typ) +//#define __TYPEOF(p) ((address*)(address)(*(((LONGINT*)(p))-1))) +//#define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) + +#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(address)typ##__typ) +#define __TYPEOF(p) ((address*)(address)(*(((address*)(p))-1))) #define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) + #define __GUARDP(p, typ, level) ((typ*)(__ISP(p,typ,level)?p:(__HALT(-5),p))) #define __GUARDR(r, typ, level) (*((typ*)(__IS(r##__typ,typ,level)?r:(__HALT(-5),r)))) #define __GUARDA(p, typ, level) ((struct typ*)(__IS(__TYPEOF(p),typ,level)?p:(__HALT(-5),p))) diff --git a/src/tools/make/vishap.make b/src/tools/make/vishap.make index 99e12608..260ca57c 100644 --- a/src/tools/make/vishap.make +++ b/src/tools/make/vishap.make @@ -20,7 +20,7 @@ FLAVOUR = $(OS).$(DATAMODEL).$(COMPILER) BUILDDIR = build/$(FLAVOUR) VISHAP = $(ONAME)$(BINEXT) -# MODEL=-O2 # Override model - build everything as S8,I16,L32. +#MODEL=-O2 # Override model - build everything as S8,I16,L32. From f1cbbdba285414314e76ede7516f7210d16e3cef Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 23 Sep 2016 11:10:33 +0100 Subject: [PATCH 247/580] Simplify __TYPEOF. --- bootstrap/SYSTEM.h | 6 +----- src/system/SYSTEM.h | 6 +----- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/bootstrap/SYSTEM.h b/bootstrap/SYSTEM.h index 6ddf909a..7c55807b 100644 --- a/bootstrap/SYSTEM.h +++ b/bootstrap/SYSTEM.h @@ -244,12 +244,8 @@ static inline double SYSTEM_ABSD(double i) {return i >= 0.0 ? i : -i;} #define __WITHCHK __HALT(-7) -//#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(address)typ##__typ) -//#define __TYPEOF(p) ((address*)(address)(*(((LONGINT*)(p))-1))) -//#define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) - #define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(address)typ##__typ) -#define __TYPEOF(p) ((address*)(address)(*(((address*)(p))-1))) +#define __TYPEOF(p) (*(((address**)(p))-1)) #define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) diff --git a/src/system/SYSTEM.h b/src/system/SYSTEM.h index 6ddf909a..7c55807b 100644 --- a/src/system/SYSTEM.h +++ b/src/system/SYSTEM.h @@ -244,12 +244,8 @@ static inline double SYSTEM_ABSD(double i) {return i >= 0.0 ? i : -i;} #define __WITHCHK __HALT(-7) -//#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(address)typ##__typ) -//#define __TYPEOF(p) ((address*)(address)(*(((LONGINT*)(p))-1))) -//#define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) - #define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(address)typ##__typ) -#define __TYPEOF(p) ((address*)(address)(*(((address*)(p))-1))) +#define __TYPEOF(p) (*(((address**)(p))-1)) #define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) From 22a4f8e263cff9e49a9748e1db0f767f70ab8875 Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 23 Sep 2016 13:04:24 +0100 Subject: [PATCH 248/580] Use SYSTEM.ADDRESS in libraries. Build all with -O2. Support INC(a,b) for any int a,b that support a:=a+b. --- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPM.c | 6 +- bootstrap/unix-44/Platform.c | 6 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPM.c | 6 +- bootstrap/unix-48/Platform.c | 6 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-88/Configuration.c | 6 +- bootstrap/unix-88/Console.c | 42 ++-- bootstrap/unix-88/Console.h | 2 +- bootstrap/unix-88/Files.c | 186 ++++++++--------- bootstrap/unix-88/Files.h | 42 ++-- bootstrap/unix-88/Heap.c | 20 +- bootstrap/unix-88/Heap.h | 4 +- bootstrap/unix-88/Modules.c | 20 +- bootstrap/unix-88/Modules.h | 10 +- bootstrap/unix-88/OPB.c | 222 ++++++++++---------- bootstrap/unix-88/OPB.h | 6 +- bootstrap/unix-88/OPC.c | 228 ++++++++++----------- bootstrap/unix-88/OPC.h | 22 +- bootstrap/unix-88/OPM.c | 209 +++++++++---------- bootstrap/unix-88/OPM.h | 28 +-- bootstrap/unix-88/OPP.c | 88 ++++---- bootstrap/unix-88/OPS.c | 36 ++-- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 261 ++++++++++++------------ bootstrap/unix-88/OPT.h | 23 ++- bootstrap/unix-88/OPV.c | 144 ++++++------- bootstrap/unix-88/Platform.c | 266 ++++++++++++------------ bootstrap/unix-88/Platform.h | 88 ++++---- bootstrap/unix-88/Reals.c | 85 ++++---- bootstrap/unix-88/Reals.h | 14 +- bootstrap/unix-88/Strings.c | 68 +++---- bootstrap/unix-88/Strings.h | 12 +- bootstrap/unix-88/Texts.c | 230 ++++++++++----------- bootstrap/unix-88/Texts.h | 57 +++--- bootstrap/unix-88/Vishap.c | 28 +-- bootstrap/unix-88/errors.c | 6 +- bootstrap/unix-88/extTools.c | 10 +- bootstrap/unix-88/vt100.c | 102 +++++----- bootstrap/unix-88/vt100.h | 34 ++-- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPM.c | 6 +- bootstrap/windows-48/Platform.c | 24 ++- bootstrap/windows-48/Platform.h | 6 +- bootstrap/windows-88/Configuration.c | 6 +- bootstrap/windows-88/Console.c | 42 ++-- bootstrap/windows-88/Console.h | 2 +- bootstrap/windows-88/Files.c | 186 ++++++++--------- bootstrap/windows-88/Files.h | 42 ++-- bootstrap/windows-88/Heap.c | 20 +- bootstrap/windows-88/Heap.h | 4 +- bootstrap/windows-88/Modules.c | 20 +- bootstrap/windows-88/Modules.h | 10 +- bootstrap/windows-88/OPB.c | 222 ++++++++++---------- bootstrap/windows-88/OPB.h | 6 +- bootstrap/windows-88/OPC.c | 228 ++++++++++----------- bootstrap/windows-88/OPC.h | 22 +- bootstrap/windows-88/OPM.c | 209 +++++++++---------- bootstrap/windows-88/OPM.h | 28 +-- bootstrap/windows-88/OPP.c | 88 ++++---- bootstrap/windows-88/OPS.c | 36 ++-- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 261 ++++++++++++------------ bootstrap/windows-88/OPT.h | 23 ++- bootstrap/windows-88/OPV.c | 144 ++++++------- bootstrap/windows-88/Platform.c | 292 ++++++++++++++------------- bootstrap/windows-88/Platform.h | 92 ++++----- bootstrap/windows-88/Reals.c | 85 ++++---- bootstrap/windows-88/Reals.h | 14 +- bootstrap/windows-88/Strings.c | 68 +++---- bootstrap/windows-88/Strings.h | 12 +- bootstrap/windows-88/Texts.c | 230 ++++++++++----------- bootstrap/windows-88/Texts.h | 57 +++--- bootstrap/windows-88/Vishap.c | 28 +-- bootstrap/windows-88/errors.c | 6 +- bootstrap/windows-88/extTools.c | 10 +- bootstrap/windows-88/vt100.c | 102 +++++----- bootstrap/windows-88/vt100.h | 34 ++-- makefile | 8 +- src/compiler/OPB.Mod | 4 +- src/compiler/OPM.cmdln.Mod | 18 +- src/library/s3/ethMD5.Mod | 3 +- src/library/s3/ethZlibBuffers.Mod | 22 +- src/library/ulm/ulmIO.Mod | 20 +- src/library/ulm/ulmSYSTEM.Mod | 6 +- src/library/v4/Args.Mod | 8 +- src/library/v4/Printer.Mod | 24 +-- src/system/Platformunix.Mod | 4 +- src/system/Platformwindows.Mod | 26 ++- src/tools/make/vishap.make | 2 +- 92 files changed, 2752 insertions(+), 2695 deletions(-) diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index af4f4fc4..e09bf1b4 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -2024,7 +2024,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) p->typ = OPT_notyp; } else { if (x->typ != p->typ) { - if ((x->class == 7 && f == 4)) { + if ((f == 4 && (x->class == 7 || (p->typ->form == 4 && x->typ->size <= p->typ->size)))) { OPB_Convert(&x, p->typ); } else { OPB_err(111); diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 039d1c77..2769f708 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1124,8 +1124,8 @@ export void *OPM__init(void) OPM_AddressSize = 8; OPM_Alignment = 8; OPM_ShortintSize = 1; - OPM_IntegerSize = 4; - OPM_LongintSize = 8; - OPM_SetSize = 8; + OPM_IntegerSize = 2; + OPM_LongintSize = 4; + OPM_SetSize = 4; __ENDMOD; } diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 9de57a27..2dacc4b8 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -92,7 +92,7 @@ export BOOLEAN Platform_TimedOut (int16 e); export BOOLEAN Platform_TooManyFiles (int16 e); export int16 Platform_Truncate (int32 h, int32 l); export int16 Platform_Unlink (CHAR *n, LONGINT n__len); -export int16 Platform_Write (int32 h, address p, address l); +export int16 Platform_Write (int32 h, address p, int32 l); static void Platform_YMDHMStoClock (int32 ye, int32 mo, int32 da, int32 ho, int32 mi, int32 se, int32 *t, int32 *d); static void Platform_errch (CHAR c); static void Platform_errint (int32 l); @@ -144,7 +144,7 @@ extern void Heap_InitHeap(); #define Platform_opennew(n, n__len) open((char*)n, O_CREAT | O_TRUNC | O_RDWR, 0664) #define Platform_openro(n, n__len) open((char*)n, O_RDONLY) #define Platform_openrw(n, n__len) open((char*)n, O_RDWR) -#define Platform_readfile(fd, p, l) read(fd, (void*)(address)(p), l) +#define Platform_readfile(fd, p, l) (LONGINT)read(fd, (void*)(address)(p), l) #define Platform_rename(o, o__len, n, n__len) rename((char*)o, (char*)n) #define Platform_sectotm(s) struct tm *time = localtime((time_t*)&s) #define Platform_seekcur() SEEK_CUR @@ -547,7 +547,7 @@ int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n) __RETCHK; } -int16 Platform_Write (int32 h, address p, address l) +int16 Platform_Write (int32 h, address p, int32 l) { int16 _o_result; address written; diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index bc487769..32d37057 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -75,7 +75,7 @@ import BOOLEAN Platform_TimedOut (int16 e); import BOOLEAN Platform_TooManyFiles (int16 e); import int16 Platform_Truncate (int32 h, int32 l); import int16 Platform_Unlink (CHAR *n, LONGINT n__len); -import int16 Platform_Write (int32 h, address p, address l); +import int16 Platform_Write (int32 h, address p, int32 l); import BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); import void *Platform__init(void); diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index af4f4fc4..e09bf1b4 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -2024,7 +2024,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) p->typ = OPT_notyp; } else { if (x->typ != p->typ) { - if ((x->class == 7 && f == 4)) { + if ((f == 4 && (x->class == 7 || (p->typ->form == 4 && x->typ->size <= p->typ->size)))) { OPB_Convert(&x, p->typ); } else { OPB_err(111); diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 039d1c77..2769f708 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1124,8 +1124,8 @@ export void *OPM__init(void) OPM_AddressSize = 8; OPM_Alignment = 8; OPM_ShortintSize = 1; - OPM_IntegerSize = 4; - OPM_LongintSize = 8; - OPM_SetSize = 8; + OPM_IntegerSize = 2; + OPM_LongintSize = 4; + OPM_SetSize = 4; __ENDMOD; } diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 9de57a27..2dacc4b8 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -92,7 +92,7 @@ export BOOLEAN Platform_TimedOut (int16 e); export BOOLEAN Platform_TooManyFiles (int16 e); export int16 Platform_Truncate (int32 h, int32 l); export int16 Platform_Unlink (CHAR *n, LONGINT n__len); -export int16 Platform_Write (int32 h, address p, address l); +export int16 Platform_Write (int32 h, address p, int32 l); static void Platform_YMDHMStoClock (int32 ye, int32 mo, int32 da, int32 ho, int32 mi, int32 se, int32 *t, int32 *d); static void Platform_errch (CHAR c); static void Platform_errint (int32 l); @@ -144,7 +144,7 @@ extern void Heap_InitHeap(); #define Platform_opennew(n, n__len) open((char*)n, O_CREAT | O_TRUNC | O_RDWR, 0664) #define Platform_openro(n, n__len) open((char*)n, O_RDONLY) #define Platform_openrw(n, n__len) open((char*)n, O_RDWR) -#define Platform_readfile(fd, p, l) read(fd, (void*)(address)(p), l) +#define Platform_readfile(fd, p, l) (LONGINT)read(fd, (void*)(address)(p), l) #define Platform_rename(o, o__len, n, n__len) rename((char*)o, (char*)n) #define Platform_sectotm(s) struct tm *time = localtime((time_t*)&s) #define Platform_seekcur() SEEK_CUR @@ -547,7 +547,7 @@ int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n) __RETCHK; } -int16 Platform_Write (int32 h, address p, address l) +int16 Platform_Write (int32 h, address p, int32 l) { int16 _o_result; address written; diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index bc487769..32d37057 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -75,7 +75,7 @@ import BOOLEAN Platform_TimedOut (int16 e); import BOOLEAN Platform_TooManyFiles (int16 e); import int16 Platform_Truncate (int32 h, int32 l); import int16 Platform_Unlink (CHAR *n, LONGINT n__len); -import int16 Platform_Write (int32 h, address p, address l); +import int16 Platform_Write (int32 h, address p, int32 l); import BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); import void *Platform__init(void); diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index fa5765f3..abdf151b 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,8 +1,8 @@ /* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ -#define INTEGER int32 -#define LONGINT int64 -#define SET uint64 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" diff --git a/bootstrap/unix-88/Console.c b/bootstrap/unix-88/Console.c index 9d23b9fd..115e60f5 100644 --- a/bootstrap/unix-88/Console.c +++ b/bootstrap/unix-88/Console.c @@ -1,21 +1,21 @@ /* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ -#define INTEGER int32 -#define LONGINT int64 -#define SET uint64 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Platform.h" static CHAR Console_line[128]; -static int32 Console_pos; +static int16 Console_pos; export void Console_Bool (BOOLEAN b); export void Console_Char (CHAR ch); export void Console_Flush (void); -export void Console_Hex (int64 i); +export void Console_Hex (int32 i); export void Console_Int (int64 i, int64 n); export void Console_Ln (void); export void Console_Read (CHAR *ch); @@ -25,7 +25,7 @@ export void Console_String (CHAR *s, LONGINT s__len); void Console_Flush (void) { - int32 error; + int16 error; error = Platform_Write(1, (address)Console_line, Console_pos); Console_pos = 0; } @@ -44,7 +44,7 @@ void Console_Char (CHAR ch) void Console_String (CHAR *s, LONGINT s__len) { - int32 i; + int16 i; __DUP(s, s__len, CHAR); i = 0; while (s[__X(i, s__len)] != 0x00) { @@ -57,17 +57,17 @@ void Console_String (CHAR *s, LONGINT s__len) void Console_Int (int64 i, int64 n) { CHAR s[32]; - int64 i1, k; - if (i == __LSHL(1, 63, 64)) { - __MOVE("8085774586302733229", s, 20); - k = 19; + int32 i1, k; + if (i == (int64)__LSHL(1, 31, 32)) { + __MOVE("8463847412", s, 11); + k = 10; } else { - i1 = __ABS((int64)i); - s[0] = (CHAR)(__MOD(i1, 10) + 48); + i1 = __ABS(__VAL(int32, i)); + s[0] = (CHAR)((int)__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k = 1; while (i1 > 0) { - s[__X(k, 32)] = (CHAR)(__MOD(i1, 10) + 48); + s[__X(k, 32)] = (CHAR)((int)__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k += 1; } @@ -76,7 +76,7 @@ void Console_Int (int64 i, int64 n) s[__X(k, 32)] = '-'; k += 1; } - while (n > k) { + while (n > (int64)k) { Console_Char(' '); n -= 1; } @@ -100,11 +100,11 @@ void Console_Bool (BOOLEAN b) } } -void Console_Hex (int64 i) +void Console_Hex (int32 i) { - int32 k; + int16 k; int64 n; - k = -60; + k = -28; while (k <= 0) { n = __MASK(__ASH(i, k), -16); if (n <= 9) { @@ -118,8 +118,8 @@ void Console_Hex (int64 i) void Console_Read (CHAR *ch) { - int64 n; - int32 error; + int32 n; + int16 error; Console_Flush(); error = Platform_ReadBuf(0, (void*)&*ch, 1, &n); if (n != 1) { @@ -129,7 +129,7 @@ void Console_Read (CHAR *ch) void Console_ReadLine (CHAR *line, LONGINT line__len) { - int64 i; + int32 i; CHAR ch; Console_Flush(); i = 0; diff --git a/bootstrap/unix-88/Console.h b/bootstrap/unix-88/Console.h index 64d39044..b08c93ea 100644 --- a/bootstrap/unix-88/Console.h +++ b/bootstrap/unix-88/Console.h @@ -11,7 +11,7 @@ import void Console_Bool (BOOLEAN b); import void Console_Char (CHAR ch); import void Console_Flush (void); -import void Console_Hex (int64 i); +import void Console_Hex (int32 i); import void Console_Int (int64 i, int64 n); import void Console_Ln (void); import void Console_Read (CHAR *ch); diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index c63ea9c4..e7eb30f3 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,8 +1,8 @@ /* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tspaSfF */ -#define INTEGER int32 -#define LONGINT int64 -#define SET uint64 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Configuration.h" @@ -18,7 +18,7 @@ typedef struct Files_BufDesc { Files_File f; BOOLEAN chg; - int64 org, size; + int32 org, size; SYSTEM_BYTE data[4096]; } Files_BufDesc; @@ -33,23 +33,23 @@ typedef Files_FileName workName, registerName; BOOLEAN tempFile; Platform_FileIdentity identity; - int64 fd, len, pos; + int32 fd, len, pos; Files_Buffer bufs[4]; - int32 swapper, state; + int16 swapper, state; Files_File next; } Files_FileDesc; typedef struct Files_Rider { - int64 res; + int32 res; BOOLEAN eof; Files_Buffer buf; - int64 org, offset; + int32 org, offset; } Files_Rider; static Files_File Files_files; -static int32 Files_tempno; +static int16 Files_tempno; static CHAR Files_HOME[1024]; static struct { LONGINT len[1]; @@ -62,50 +62,50 @@ export address *Files_Rider__typ; export Files_File Files_Base (Files_Rider *r, address *r__typ); static Files_File Files_CacheEntry (Platform_FileIdentity identity); -export void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int32 *res); +export void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int16 *res); export void Files_Close (Files_File f); static void Files_CloseOSFile (Files_File f); static void Files_Create (Files_File f); -export void Files_Delete (CHAR *name, LONGINT name__len, int32 *res); -static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int32 errcode); +export void Files_Delete (CHAR *name, LONGINT name__len, int16 *res); +static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int16 errcode); static void Files_Finalize (SYSTEM_PTR o); static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *dest, LONGINT dest__len); static void Files_Flush (Files_Buffer buf); -export void Files_GetDate (Files_File f, int64 *t, int64 *d); +export void Files_GetDate (Files_File f, int32 *t, int32 *d); export void Files_GetName (Files_File f, CHAR *name, LONGINT name__len); static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *name, LONGINT name__len); static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len); -export int64 Files_Length (Files_File f); +export int32 Files_Length (Files_File f); static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT name__len, CHAR *dest, LONGINT dest__len); export Files_File Files_New (CHAR *name, LONGINT name__len); export Files_File Files_Old (CHAR *name, LONGINT name__len); -export int64 Files_Pos (Files_Rider *r, address *r__typ); +export int32 Files_Pos (Files_Rider *r, address *r__typ); export void Files_Purge (Files_File f); export void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x); export void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x); export void Files_ReadByte (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len); -export void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int64 n); -export void Files_ReadInt (Files_Rider *R, address *R__typ, int32 *x); -export void Files_ReadLInt (Files_Rider *R, address *R__typ, int64 *x); +export void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); +export void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x); +export void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); export void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); export void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); -export void Files_ReadNum (Files_Rider *R, address *R__typ, int64 *x); +export void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x); export void Files_ReadNum64 (Files_Rider *R, address *R__typ, int64 *x); export void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); export void Files_ReadSet (Files_Rider *R, address *R__typ, SET *x); export void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); export void Files_Register (Files_File f); -export void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int32 *res); -static void Files_ScanPath (int32 *pos, CHAR *dir, LONGINT dir__len); -export void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int64 pos); +export void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res); +static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len); +export void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos); export void Files_SetSearchPath (CHAR *path, LONGINT path__len); export void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x); export void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x); -export void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int64 n); -export void Files_WriteInt (Files_Rider *R, address *R__typ, int32 x); -export void Files_WriteLInt (Files_Rider *R, address *R__typ, int64 x); +export void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); +export void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x); +export void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x); export void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x); -export void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x); +export void Files_WriteNum (Files_Rider *R, address *R__typ, int32 x); export void Files_WriteNum64 (Files_Rider *R, address *R__typ, int64 x); export void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x); export void Files_WriteSet (Files_Rider *R, address *R__typ, SET x); @@ -113,7 +113,7 @@ export void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT #define Files_IdxTrap() __HALT(-1) -static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int32 errcode) +static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int16 errcode) { __DUP(s, s__len, CHAR); Console_Ln(); @@ -142,7 +142,7 @@ static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int32 errcode) static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT name__len, CHAR *dest, LONGINT dest__len) { - int32 i, j; + int16 i, j; __DUP(dir, dir__len, CHAR); __DUP(name, name__len, CHAR); i = 0; @@ -167,7 +167,7 @@ static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *name, LONGINT name__len) { - int64 n, i, j; + int32 n, i, j; __DUP(finalName, finalName__len, CHAR); Files_tempno += 1; n = Files_tempno; @@ -199,7 +199,7 @@ static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *na name[i + 5] = '.'; i += 6; while (n > 0) { - name[i] = (CHAR)(__MOD(n, 10) + 48); + name[i] = (CHAR)((int)__MOD(n, 10) + 48); n = __DIV(n, 10); i += 1; } @@ -207,7 +207,7 @@ static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *na i += 1; n = Platform_PID; while (n > 0) { - name[i] = (CHAR)(__MOD(n, 10) + 48); + name[i] = (CHAR)((int)__MOD(n, 10) + 48); n = __DIV(n, 10); i += 1; } @@ -219,7 +219,7 @@ static void Files_Create (Files_File f) { Platform_FileIdentity identity; BOOLEAN done; - int32 error; + int16 error; CHAR err[32]; if (f->fd == -1) { if (f->state == 1) { @@ -256,7 +256,7 @@ static void Files_Create (Files_File f) static void Files_Flush (Files_Buffer buf) { - int32 error; + int16 error; Files_File f = NIL; if (buf->chg) { f = buf->f; @@ -280,7 +280,7 @@ static void Files_Flush (Files_Buffer buf) static void Files_CloseOSFile (Files_File f) { Files_File prev = NIL; - int32 error; + int16 error; if (Files_files == f) { Files_files = f->next; } else { @@ -300,8 +300,8 @@ static void Files_CloseOSFile (Files_File f) void Files_Close (Files_File f) { - int64 i; - int32 error; + int32 i; + int16 error; if (f->state != 1 || f->registerName[0] != 0x00) { Files_Create(f); i = 0; @@ -317,9 +317,9 @@ void Files_Close (Files_File f) } } -int64 Files_Length (Files_File f) +int32 Files_Length (Files_File f) { - int64 _o_result; + int32 _o_result; _o_result = f->len; return _o_result; } @@ -342,9 +342,9 @@ Files_File Files_New (CHAR *name, LONGINT name__len) return _o_result; } -static void Files_ScanPath (int32 *pos, CHAR *dir, LONGINT dir__len) +static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len) { - int32 i; + int16 i; CHAR ch; i = 0; if (Files_SearchPath == NIL) { @@ -388,7 +388,7 @@ static void Files_ScanPath (int32 *pos, CHAR *dir, LONGINT dir__len) static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len) { BOOLEAN _o_result; - int32 i; + int16 i; CHAR ch; i = 0; ch = name[0]; @@ -404,7 +404,7 @@ static Files_File Files_CacheEntry (Platform_FileIdentity identity) { Files_File _o_result; Files_File f = NIL; - int32 i, error; + int16 i, error; f = Files_files; while (f != NIL) { if (Platform_SameFile(identity, f->identity)) { @@ -434,11 +434,11 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) { Files_File _o_result; Files_File f = NIL; - int64 fd; - int32 pos; + int32 fd; + int16 pos; BOOLEAN done; CHAR dir[256], path[256]; - int32 error; + int16 error; Platform_FileIdentity identity; __DUP(name, name__len, CHAR); if (name[0] != 0x00) { @@ -513,9 +513,9 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) void Files_Purge (Files_File f) { - int32 i; + int16 i; Platform_FileIdentity identity; - int32 error; + int16 error; i = 0; while (i < 4) { if (f->bufs[i] != NIL) { @@ -535,27 +535,27 @@ void Files_Purge (Files_File f) Platform_SetMTime(&f->identity, Platform_FileIdentity__typ, identity); } -void Files_GetDate (Files_File f, int64 *t, int64 *d) +void Files_GetDate (Files_File f, int32 *t, int32 *d) { Platform_FileIdentity identity; - int32 error; + int16 error; Files_Create(f); error = Platform_Identify(f->fd, &identity, Platform_FileIdentity__typ); Platform_MTimeAsClock(identity, &*t, &*d); } -int64 Files_Pos (Files_Rider *r, address *r__typ) +int32 Files_Pos (Files_Rider *r, address *r__typ) { - int64 _o_result; + int32 _o_result; _o_result = (*r).org + (*r).offset; return _o_result; } -void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int64 pos) +void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos) { - int64 org, offset, i, n; + int32 org, offset, i, n; Files_Buffer buf = NIL; - int32 error; + int16 error; if (f != NIL) { if (pos > f->len) { pos = f->len; @@ -615,7 +615,7 @@ void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int64 pos) void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x) { - int64 offset; + int32 offset; Files_Buffer buf = NIL; buf = (*r).buf; offset = (*r).offset; @@ -637,9 +637,9 @@ void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x) } } -void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int64 n) +void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n) { - int64 xpos, min, restInBuf, offset; + int32 xpos, min, restInBuf, offset; Files_Buffer buf = NIL; if (n > x__len) { Files_IdxTrap(); @@ -663,7 +663,7 @@ void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x } else { min = n; } - __MOVE(((address)buf->data) + offset, ((address)x) + xpos, min); + __MOVE((address)buf->data + (int64)offset, (address)x + (int64)xpos, min); offset += min; (*r).offset = offset; xpos += min; @@ -688,7 +688,7 @@ Files_File Files_Base (Files_Rider *r, address *r__typ) void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x) { Files_Buffer buf = NIL; - int64 offset; + int32 offset; buf = (*r).buf; offset = (*r).offset; if ((*r).org != buf->org || offset >= 4096) { @@ -706,9 +706,9 @@ void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x) (*r).res = 0; } -void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int64 n) +void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n) { - int64 xpos, min, restInBuf, offset; + int32 xpos, min, restInBuf, offset; Files_Buffer buf = NIL; if (n > x__len) { Files_IdxTrap(); @@ -728,7 +728,7 @@ void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT } else { min = n; } - __MOVE(((address)x) + xpos, ((address)buf->data) + offset, min); + __MOVE((address)x + (int64)xpos, (address)buf->data + (int64)offset, min); offset += min; (*r).offset = offset; if (offset > buf->size) { @@ -742,17 +742,17 @@ void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT (*r).res = 0; } -void Files_Delete (CHAR *name, LONGINT name__len, int32 *res) +void Files_Delete (CHAR *name, LONGINT name__len, int16 *res) { __DUP(name, name__len, CHAR); *res = Platform_Unlink((void*)name, name__len); __DEL(name); } -void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int32 *res) +void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res) { - int64 fdold, fdnew, n; - int32 error, ignore; + int32 fdold, fdnew, n; + int16 error, ignore; Platform_FileIdentity oldidentity, newidentity; CHAR buf[4096]; __DUP(old, old__len, CHAR); @@ -807,7 +807,7 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int void Files_Register (Files_File f) { - int32 idx, errcode; + int16 idx, errcode; Files_File f1 = NIL; CHAR file[104]; if ((f->state == 1 && f->registerName[0] != 0x00)) { @@ -826,7 +826,7 @@ void Files_Register (Files_File f) } } -void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int32 *res) +void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int16 *res) { __DUP(path, path__len, CHAR); *res = Platform_Chdir((void*)path, path__len); @@ -835,7 +835,7 @@ void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int32 *res) static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *dest, LONGINT dest__len) { - int64 i, j; + int32 i, j; if (!Platform_LittleEndian) { i = src__len; j = 0; @@ -854,26 +854,26 @@ void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x) Files_Read(&*R, R__typ, (CHAR*)(void*)&*x); } -void Files_ReadInt (Files_Rider *R, address *R__typ, int32 *x) +void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x) { CHAR b[2]; Files_ReadBytes(&*R, R__typ, (void*)b, 2, 2); - *x = b[0] + __ASHL(b[1], 8); + *x = (int16)b[0] + __ASHL((int16)b[1], 8); } -void Files_ReadLInt (Files_Rider *R, address *R__typ, int64 *x) +void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x) { CHAR b[4]; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); - *x = ((b[0] + __ASHL(b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); + *x = (((int16)b[0] + __ASHL((int16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); } void Files_ReadSet (Files_Rider *R, address *R__typ, SET *x) { CHAR b[4]; - int64 l; + int32 l; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); - l = ((b[0] + __ASHL(b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); + l = (((int16)b[0] + __ASHL((int16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); *x = (SET)l; } @@ -893,7 +893,7 @@ void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x) void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) { - int32 i; + int16 i; CHAR ch; i = 0; do { @@ -905,7 +905,7 @@ void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) { - int32 i; + int16 i; CHAR ch; BOOLEAN b; i = 0; @@ -921,26 +921,26 @@ void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) } while (!b); } -void Files_ReadNum (Files_Rider *R, address *R__typ, int64 *x) +void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x) { int8 s; CHAR ch; - int64 n; + int32 n; s = 0; n = 0; Files_Read(&*R, R__typ, (void*)&ch); - while (ch >= 128) { - n += __ASH((int64)(ch - 128), s); + while ((int16)ch >= 128) { + n += __ASH(((int16)ch - 128), s); s += 7; Files_Read(&*R, R__typ, (void*)&ch); } - n += __ASH((int64)(__MASK(ch, -64) - __ASHL(__ASHR(ch, 6), 6)), s); + n += __ASH((__MASK((int16)ch, -64) - __ASHL(__ASHR((int16)ch, 6), 6)), s); *x = n; } void Files_ReadNum64 (Files_Rider *R, address *R__typ, int64 *x) { - int64 n; + int32 n; Files_ReadNum(&*R, R__typ, &n); *x = n; } @@ -950,7 +950,7 @@ void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x) Files_Write(&*R, R__typ, __VAL(CHAR, x)); } -void Files_WriteInt (Files_Rider *R, address *R__typ, int32 x) +void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x) { CHAR b[2]; b[0] = (CHAR)x; @@ -958,7 +958,7 @@ void Files_WriteInt (Files_Rider *R, address *R__typ, int32 x) Files_WriteBytes(&*R, R__typ, (void*)b, 2, 2); } -void Files_WriteLInt (Files_Rider *R, address *R__typ, int64 x) +void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x) { CHAR b[4]; b[0] = (CHAR)x; @@ -971,8 +971,8 @@ void Files_WriteLInt (Files_Rider *R, address *R__typ, int64 x) void Files_WriteSet (Files_Rider *R, address *R__typ, SET x) { CHAR b[4]; - int64 i; - i = (int64)x; + int32 i; + i = (int32)x; b[0] = (CHAR)i; b[1] = (CHAR)__ASHR(i, 8); b[2] = (CHAR)__ASHR(i, 16); @@ -996,7 +996,7 @@ void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x) void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) { - int32 i; + int16 i; i = 0; while (x[i] != 0x00) { i += 1; @@ -1004,7 +1004,7 @@ void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len Files_WriteBytes(&*R, R__typ, (void*)x, x__len * 1, i + 1); } -void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x) +void Files_WriteNum (Files_Rider *R, address *R__typ, int32 x) { while (x < -64 || x > 63) { Files_Write(&*R, R__typ, (CHAR)(__MASK(x, -128) + 128)); @@ -1030,7 +1030,7 @@ void Files_GetName (Files_File f, CHAR *name, LONGINT name__len) static void Files_Finalize (SYSTEM_PTR o) { Files_File f = NIL; - int64 res; + int32 res; f = (Files_File)(address)o; if (f->fd >= 0) { Files_CloseOSFile(f); @@ -1058,9 +1058,9 @@ static void EnumPtrs(void (*P)(void*)) P(Files_SearchPath); } -__TDESC(Files_FileDesc, 1, 5) = {__TDFLDS("FileDesc", 304), {256, 264, 272, 280, 296, -48}}; -__TDESC(Files_BufDesc, 1, 1) = {__TDFLDS("BufDesc", 4128), {0, -16}}; -__TDESC(Files_Rider, 1, 1) = {__TDFLDS("Rider", 40), {16, -16}}; +__TDESC(Files_FileDesc, 1, 5) = {__TDFLDS("FileDesc", 280), {232, 240, 248, 256, 272, -48}}; +__TDESC(Files_BufDesc, 1, 1) = {__TDFLDS("BufDesc", 4120), {0, -16}}; +__TDESC(Files_Rider, 1, 1) = {__TDFLDS("Rider", 24), {8, -16}}; export void *Files__init(void) { diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 645bc846..a371a423 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -10,16 +10,18 @@ typedef typedef struct Files_FileDesc { - char _prvt0[232]; - int64 fd; - char _prvt1[64]; + int64 _prvt0; + char _prvt1[208]; + int32 fd; + char _prvt2[60]; } Files_FileDesc; typedef struct Files_Rider { - int64 res; + int32 res; BOOLEAN eof; - char _prvt0[31]; + int64 _prvt0; + char _prvt1[8]; } Files_Rider; @@ -28,40 +30,40 @@ import address *Files_FileDesc__typ; import address *Files_Rider__typ; import Files_File Files_Base (Files_Rider *r, address *r__typ); -import void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int32 *res); +import void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int16 *res); import void Files_Close (Files_File f); -import void Files_Delete (CHAR *name, LONGINT name__len, int32 *res); -import void Files_GetDate (Files_File f, int64 *t, int64 *d); +import void Files_Delete (CHAR *name, LONGINT name__len, int16 *res); +import void Files_GetDate (Files_File f, int32 *t, int32 *d); import void Files_GetName (Files_File f, CHAR *name, LONGINT name__len); -import int64 Files_Length (Files_File f); +import int32 Files_Length (Files_File f); import Files_File Files_New (CHAR *name, LONGINT name__len); import Files_File Files_Old (CHAR *name, LONGINT name__len); -import int64 Files_Pos (Files_Rider *r, address *r__typ); +import int32 Files_Pos (Files_Rider *r, address *r__typ); import void Files_Purge (Files_File f); import void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x); import void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x); import void Files_ReadByte (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len); -import void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int64 n); -import void Files_ReadInt (Files_Rider *R, address *R__typ, int32 *x); -import void Files_ReadLInt (Files_Rider *R, address *R__typ, int64 *x); +import void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); +import void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x); +import void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); import void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); import void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); -import void Files_ReadNum (Files_Rider *R, address *R__typ, int64 *x); +import void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x); import void Files_ReadNum64 (Files_Rider *R, address *R__typ, int64 *x); import void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); import void Files_ReadSet (Files_Rider *R, address *R__typ, SET *x); import void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); import void Files_Register (Files_File f); -import void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int32 *res); -import void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int64 pos); +import void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res); +import void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos); import void Files_SetSearchPath (CHAR *path, LONGINT path__len); import void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x); import void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x); -import void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int64 n); -import void Files_WriteInt (Files_Rider *R, address *R__typ, int32 x); -import void Files_WriteLInt (Files_Rider *R, address *R__typ, int64 x); +import void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); +import void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x); +import void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x); import void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x); -import void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x); +import void Files_WriteNum (Files_Rider *R, address *R__typ, int32 x); import void Files_WriteNum64 (Files_Rider *R, address *R__typ, int64 x); import void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x); import void Files_WriteSet (Files_Rider *R, address *R__typ, SET x); diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index c87cfd6d..16ae9ffd 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,8 +1,8 @@ /* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tsSfF */ -#define INTEGER int32 -#define LONGINT int64 -#define SET uint64 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" @@ -54,11 +54,11 @@ typedef struct Heap_ModuleDesc { Heap_Module next; Heap_ModuleName name; - int64 refcnt; + int32 refcnt; Heap_Cmd cmds; address types; Heap_EnumProc enumPtrs; - int64 reserved1, reserved2; + int32 reserved1, reserved2; } Heap_ModuleDesc; @@ -70,9 +70,9 @@ static BOOLEAN Heap_firstTry; static address Heap_heap, Heap_heapend; export address Heap_heapsize; static Heap_FinNode Heap_fin; -static int32 Heap_lockdepth; +static int16 Heap_lockdepth; static BOOLEAN Heap_interrupted; -export int32 Heap_FileCount; +export int16 Heap_FileCount; export address *Heap_ModuleDesc__typ; export address *Heap_CmdDesc__typ; @@ -129,7 +129,7 @@ SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) SYSTEM_PTR _o_result; Heap_Module m; if (__STRCMP(name, "Heap") == 0) { - __SYSNEW(m, 80); + __SYSNEW(m, 64); } else { __NEW(m, Heap_ModuleDesc); } @@ -602,7 +602,7 @@ static void Heap_MarkStack (address n, address *cand, LONGINT cand__len) while (sp != stack0) { __GET(sp, p, address); if ((p > Heap_heap && p < Heap_heapend)) { - if (nofcand == cand__len) { + if (nofcand == (int64)cand__len) { Heap_HeapSort(nofcand, (void*)cand, cand__len); Heap_MarkCandidates(nofcand, (void*)cand, cand__len); nofcand = 0; @@ -734,7 +734,7 @@ static void EnumPtrs(void (*P)(void*)) P(Heap_fin); } -__TDESC(Heap_ModuleDesc, 1, 2) = {__TDFLDS("ModuleDesc", 80), {0, 40, -24}}; +__TDESC(Heap_ModuleDesc, 1, 2) = {__TDFLDS("ModuleDesc", 64), {0, 32, -24}}; __TDESC(Heap_CmdDesc, 1, 1) = {__TDFLDS("CmdDesc", 40), {0, -16}}; __TDESC(Heap_FinDesc, 1, 1) = {__TDFLDS("FinDesc", 32), {0, -16}}; __TDESC(Heap__1, 1, 1) = {__TDFLDS("", 16), {8, -16}}; diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index b4829f2f..151a2d59 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -23,7 +23,7 @@ typedef typedef struct Heap_ModuleDesc { int64 _prvt0; - char _prvt1[72]; + char _prvt1[56]; } Heap_ModuleDesc; typedef @@ -32,7 +32,7 @@ typedef import SYSTEM_PTR Heap_modules; import address Heap_allocated, Heap_heapsize; -import int32 Heap_FileCount; +import int16 Heap_FileCount; import address *Heap_ModuleDesc__typ; diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 23fec310..f844dfa9 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,8 +1,8 @@ /* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ -#define INTEGER int32 -#define LONGINT int64 -#define SET uint64 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Console.h" @@ -31,15 +31,15 @@ typedef struct Modules_ModuleDesc { Modules_Module next; Modules_ModuleName name; - int64 refcnt; + int32 refcnt; Modules_Cmd cmds; - int64 types; - void (*enumPtrs)(void(*)(int64)); - int64 reserved1, reserved2; + int32 types; + void (*enumPtrs)(void(*)(int32)); + int32 reserved1, reserved2; } Modules_ModuleDesc; -export int32 Modules_res; +export int16 Modules_res; export CHAR Modules_resMsg[256]; export Modules_ModuleName Modules_imported, Modules_importing; @@ -56,7 +56,7 @@ export Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len); static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len) { - int32 i, j; + int16 i, j; __DUP(b, b__len, CHAR); i = 0; while (a[__X(i, a__len)] != 0x00) { @@ -160,7 +160,7 @@ void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all) __DEL(name); } -__TDESC(Modules_ModuleDesc, 1, 2) = {__TDFLDS("ModuleDesc", 80), {0, 40, -24}}; +__TDESC(Modules_ModuleDesc, 1, 2) = {__TDFLDS("ModuleDesc", 64), {0, 32, -24}}; __TDESC(Modules_CmdDesc, 1, 1) = {__TDFLDS("CmdDesc", 40), {0, -16}}; export void *Modules__init(void) diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index 7cafac5f..060208c6 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -28,15 +28,15 @@ typedef struct Modules_ModuleDesc { Modules_Module next; Modules_ModuleName name; - int64 refcnt; + int32 refcnt; Modules_Cmd cmds; - int64 types; - void (*enumPtrs)(void(*)(int64)); - char _prvt0[16]; + int32 types; + void (*enumPtrs)(void(*)(int32)); + char _prvt0[8]; } Modules_ModuleDesc; -import int32 Modules_res; +import int16 Modules_res; import CHAR Modules_resMsg[256]; import Modules_ModuleName Modules_imported, Modules_importing; diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index 81077606..e09bf1b4 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,8 +1,8 @@ /* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ -#define INTEGER int32 -#define LONGINT int64 -#define SET uint64 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "OPM.h" @@ -11,13 +11,13 @@ export void (*OPB_typSize)(OPT_Struct); -static int32 OPB_exp; +static int16 OPB_exp; static int64 OPB_maxExp; export void OPB_Assign (OPT_Node *x, OPT_Node y); static void OPB_BindNodes (int8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y); -static int32 OPB_BoolToInt (BOOLEAN b); +static int16 OPB_BoolToInt (BOOLEAN b); export void OPB_Call (OPT_Node *x, OPT_Node apar, OPT_Object fp); static void OPB_CharToString (OPT_Node n); static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode); @@ -25,9 +25,9 @@ static void OPB_CheckLeaf (OPT_Node x, BOOLEAN dynArrToo); export void OPB_CheckParameters (OPT_Object fp, OPT_Object ap, BOOLEAN checkNames); static void OPB_CheckProc (OPT_Struct x, OPT_Object y); static void OPB_CheckPtr (OPT_Node x, OPT_Node y); -static void OPB_CheckRealType (int32 f, int32 nr, OPT_Const x); +static void OPB_CheckRealType (int16 f, int16 nr, OPT_Const x); static void OPB_CheckReceiver (OPT_Node *x, OPT_Object fp); -static void OPB_ConstOp (int32 op, OPT_Node x, OPT_Node y); +static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y); export void OPB_Construct (int8 class, OPT_Node *x, OPT_Node y); static void OPB_Convert (OPT_Node *x, OPT_Struct typ); export void OPB_DeRef (OPT_Node *x); @@ -56,17 +56,17 @@ export void OPB_Return (OPT_Node *x, OPT_Object proc); export void OPB_SetElem (OPT_Node *x); static void OPB_SetIntType (OPT_Node node); export void OPB_SetRange (OPT_Node *x, OPT_Node y); -export void OPB_StFct (OPT_Node *par0, int8 fctno, int32 parno); -export void OPB_StPar0 (OPT_Node *par0, int32 fctno); +export void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno); +export void OPB_StPar0 (OPT_Node *par0, int16 fctno); export void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno); -export void OPB_StParN (OPT_Node *par0, OPT_Node x, int32 fctno, int32 n); +export void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n); export void OPB_StaticLink (int8 dlev); export void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard); -static void OPB_err (int32 n); +static void OPB_err (int16 n); static int64 OPB_log (int64 x); -static void OPB_err (int32 n) +static void OPB_err (int16 n) { OPM_err(n); } @@ -128,9 +128,9 @@ void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y) *last = y; } -static int32 OPB_BoolToInt (BOOLEAN b) +static int16 OPB_BoolToInt (BOOLEAN b) { - int32 _o_result; + int16 _o_result; if (b) { _o_result = 1; return _o_result; @@ -323,18 +323,18 @@ void OPB_DeRef (OPT_Node *x) void OPB_Index (OPT_Node *x, OPT_Node y) { - int32 f; + int16 f; OPT_Struct typ = NIL; f = y->typ->form; if ((*x)->class >= 7) { OPB_err(79); - } else if (f != 4 || __IN(y->class, 0x0300, 64)) { + } else if (f != 4 || __IN(y->class, 0x0300, 32)) { OPB_err(80); y->typ = OPT_inttyp; } if ((*x)->typ->comp == 2) { typ = (*x)->typ->BaseTyp; - if ((y->class == 7 && (y->conval->intval < 0 || y->conval->intval >= (*x)->typ->n))) { + if ((y->class == 7 && (y->conval->intval < 0 || y->conval->intval >= (int64)(*x)->typ->n))) { OPB_err(81); } } else if ((*x)->typ->comp == 3) { @@ -355,7 +355,7 @@ void OPB_Field (OPT_Node *x, OPT_Object y) if ((*x)->class >= 7) { OPB_err(77); } - if ((y != NIL && __IN(y->mode, 0x2010, 64))) { + if ((y != NIL && __IN(y->mode, 0x2010, 32))) { OPB_BindNodes(2, y->typ, &*x, NIL); (*x)->obj = y; (*x)->readonly = (*x)->left->readonly || (y->vis == 2 && y->mnolev < 0); @@ -448,7 +448,7 @@ void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) void OPB_In (OPT_Node *x, OPT_Node y) { - int32 f; + int16 f; int64 k; f = (*x)->typ->form; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { @@ -459,7 +459,7 @@ void OPB_In (OPT_Node *x, OPT_Node y) if (k < 0 || k > (int64)OPM_MaxSet) { OPB_err(202); } else if (y->class == 7) { - (*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval, 64)); + (*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval, 32)); (*x)->obj = NIL; } else { OPB_BindNodes(12, OPT_booltyp, &*x, y); @@ -489,7 +489,7 @@ static int64 OPB_log (int64 x) return _o_result; } -static void OPB_CheckRealType (int32 f, int32 nr, OPT_Const x) +static void OPB_CheckRealType (int16 f, int16 nr, OPT_Const x) { LONGREAL min, max, r; if (f == 5) { @@ -529,7 +529,7 @@ static OPT_Node NewOp__29 (int8 op, OPT_Struct typ, OPT_Node z) void OPB_MOp (int8 op, OPT_Node *x) { - int32 f; + int16 f; OPT_Struct typ = NIL; OPT_Node z = NIL; struct MOp__28 _s; @@ -555,12 +555,12 @@ void OPB_MOp (int8 op, OPT_Node *x) } break; case 6: - if (!__IN(f, 0x70, 64)) { + if (!__IN(f, 0x70, 32)) { OPB_err(96); } break; case 7: - if (__IN(f, 0xf0, 64)) { + if (__IN(f, 0xf0, 32)) { if (z->class == 7) { if (f == 4) { if (z->conval->intval == (-9223372036854775807-1)) { @@ -569,7 +569,7 @@ void OPB_MOp (int8 op, OPT_Node *x) z->conval->intval = -z->conval->intval; OPB_SetIntType(z); } - } else if (__IN(f, 0x60, 64)) { + } else if (__IN(f, 0x60, 32)) { z->conval->realval = -z->conval->realval; } else { z->conval->setval = ~z->conval->setval; @@ -583,7 +583,7 @@ void OPB_MOp (int8 op, OPT_Node *x) } break; case 21: - if (__IN(f, 0x70, 64)) { + if (__IN(f, 0x70, 32)) { if (z->class == 7) { if (f == 4) { if (z->conval->intval == (-9223372036854775807-1)) { @@ -606,7 +606,7 @@ void OPB_MOp (int8 op, OPT_Node *x) case 22: if (f == 3) { if (z->class == 7) { - z->conval->intval = __CAP((CHAR)z->conval->intval); + z->conval->intval = (int16)__CAP((CHAR)z->conval->intval); z->obj = NIL; } else { z = NewOp__29(op, typ, z); @@ -666,7 +666,7 @@ void OPB_MOp (int8 op, OPT_Node *x) static void OPB_CheckPtr (OPT_Node x, OPT_Node y) { - int32 g; + int16 g; OPT_Struct p = NIL, q = NIL, t = NIL; g = y->typ->form; if (g == 11) { @@ -730,7 +730,7 @@ void OPB_CheckParameters (OPT_Object fp, OPT_Object ap, BOOLEAN checkNames) static void OPB_CheckProc (OPT_Struct x, OPT_Object y) { - if (__IN(y->mode, 0x04c0, 64)) { + if (__IN(y->mode, 0x04c0, 32)) { if (y->mode == 6) { if (y->mnolev == 0) { y->mode = 7; @@ -750,17 +750,17 @@ static void OPB_CheckProc (OPT_Struct x, OPT_Object y) static struct ConstOp__13 { OPT_Node *x; - int32 *f; + int16 *f; OPT_Const *xval, *yval; struct ConstOp__13 *lnk; } *ConstOp__13_s; -static int32 ConstCmp__14 (void); +static int16 ConstCmp__14 (void); -static int32 ConstCmp__14 (void) +static int16 ConstCmp__14 (void) { - int32 _o_result; - int32 res; + int16 _o_result; + int16 res; switch (*ConstOp__13_s->f) { case 0: res = 9; @@ -824,9 +824,9 @@ static int32 ConstCmp__14 (void) return _o_result; } -static void OPB_ConstOp (int32 op, OPT_Node x, OPT_Node y) +static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) { - int32 f, g; + int16 f, g; OPT_Const xval = NIL, yval = NIL; int64 xv, yv; BOOLEAN temp; @@ -906,7 +906,7 @@ static void OPB_ConstOp (int32 op, OPT_Node x, OPT_Node y) } break; case 9: - if (!__IN(g, 0x1800, 64)) { + if (!__IN(g, 0x1800, 32)) { OPB_err(100); } break; @@ -937,7 +937,7 @@ static void OPB_ConstOp (int32 op, OPT_Node x, OPT_Node y) } else { OPB_err(204); } - } else if (__IN(f, 0x60, 64)) { + } else if (__IN(f, 0x60, 32)) { temp = __ABS(yval->realval) <= (LONGREAL)1; if (temp || __ABS(xval->realval) <= 1.79769296342094e+308 / (LONGREAL)__ABS(yval->realval)) { xval->realval = xval->realval * yval->realval; @@ -961,7 +961,7 @@ static void OPB_ConstOp (int32 op, OPT_Node x, OPT_Node y) xval->realval = (LONGREAL)1; } x->typ = OPT_realtyp; - } else if (__IN(f, 0x60, 64)) { + } else if (__IN(f, 0x60, 32)) { temp = __ABS(yval->realval) >= (LONGREAL)1; if (temp || __ABS(xval->realval) <= 1.79769296342094e+308 * __ABS(yval->realval)) { xval->realval = xval->realval / yval->realval; @@ -1015,7 +1015,7 @@ static void OPB_ConstOp (int32 op, OPT_Node x, OPT_Node y) } else { OPB_err(206); } - } else if (__IN(f, 0x60, 64)) { + } else if (__IN(f, 0x60, 32)) { temp = (yval->realval >= (LONGREAL)0 && xval->realval <= 1.79769296342094e+308 - yval->realval); if (temp || (yval->realval < (LONGREAL)0 && xval->realval >= -1.79769296342094e+308 - yval->realval)) { xval->realval = xval->realval + yval->realval; @@ -1037,7 +1037,7 @@ static void OPB_ConstOp (int32 op, OPT_Node x, OPT_Node y) } else { OPB_err(207); } - } else if (__IN(f, 0x60, 64)) { + } else if (__IN(f, 0x60, 32)) { temp = (yval->realval >= (LONGREAL)0 && xval->realval >= -1.79769296342094e+308 + yval->realval); if (temp || (yval->realval < (LONGREAL)0 && xval->realval <= 1.79769296342094e+308 + yval->realval)) { xval->realval = xval->realval - yval->realval; @@ -1065,28 +1065,28 @@ static void OPB_ConstOp (int32 op, OPT_Node x, OPT_Node y) xval->intval = OPB_BoolToInt(ConstCmp__14() != 9); break; case 11: - if (__IN(f, 0x0a84, 64)) { + if (__IN(f, 0x0a84, 32)) { OPB_err(108); } else { xval->intval = OPB_BoolToInt(ConstCmp__14() == 11); } break; case 12: - if (__IN(f, 0x0a84, 64)) { + if (__IN(f, 0x0a84, 32)) { OPB_err(108); } else { xval->intval = OPB_BoolToInt(ConstCmp__14() != 13); } break; case 13: - if (__IN(f, 0x0a84, 64)) { + if (__IN(f, 0x0a84, 32)) { OPB_err(108); } else { xval->intval = OPB_BoolToInt(ConstCmp__14() == 13); } break; case 14: - if (__IN(f, 0x0a84, 64)) { + if (__IN(f, 0x0a84, 32)) { OPB_err(108); } else { xval->intval = OPB_BoolToInt(ConstCmp__14() != 11); @@ -1104,7 +1104,7 @@ static void OPB_ConstOp (int32 op, OPT_Node x, OPT_Node y) static void OPB_Convert (OPT_Node *x, OPT_Struct typ) { OPT_Node node = NIL; - int32 f, g; + int16 f, g; int64 k; LONGREAL r; f = (*x)->typ->form; @@ -1119,7 +1119,7 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) (*x)->conval->intval = 1; } } - } else if (__IN(g, 0x60, 64)) { + } else if (__IN(g, 0x60, 32)) { (*x)->conval->realval = (*x)->conval->intval; (*x)->conval->intval = -1; } else { @@ -1128,8 +1128,8 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) OPB_err(220); } } - } else if (__IN(f, 0x60, 64)) { - if (__IN(g, 0x60, 64)) { + } else if (__IN(f, 0x60, 32)) { + if (__IN(g, 0x60, 32)) { OPB_CheckRealType(g, 203, (*x)->conval); } else { r = (*x)->conval->realval; @@ -1137,12 +1137,12 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) OPB_err(203); r = (LONGREAL)1; } - (*x)->conval->intval = __ENTIER(r); + (*x)->conval->intval = (int32)__ENTIER(r); OPB_SetIntType(*x); } } (*x)->obj = NIL; - } else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((*x)->left->typ->form < f || f > g))) { + } else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((int16)(*x)->left->typ->form < f || f > g))) { if ((*x)->left->typ == typ) { *x = (*x)->left; } @@ -1156,7 +1156,7 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) } static struct Op__38 { - int32 *f, *g; + int16 *f, *g; struct Op__38 *lnk; } *Op__38_s; @@ -1178,8 +1178,8 @@ static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) { BOOLEAN _o_result; BOOLEAN ok, xCharArr, yCharArr; - xCharArr = (__IN((*x)->typ->comp, 0x0c, 64) && (*x)->typ->BaseTyp->form == 3) || *Op__38_s->f == 8; - yCharArr = (__IN((*y)->typ->comp, 0x0c, 64) && (*y)->typ->BaseTyp->form == 3) || *Op__38_s->g == 8; + xCharArr = (__IN((*x)->typ->comp, 0x0c, 32) && (*x)->typ->BaseTyp->form == 3) || *Op__38_s->f == 8; + yCharArr = (__IN((*y)->typ->comp, 0x0c, 32) && (*y)->typ->BaseTyp->form == 3) || *Op__38_s->g == 8; if ((((xCharArr && *Op__38_s->g == 3)) && (*y)->class == 7)) { OPB_CharToString(*y); *Op__38_s->g = 8; @@ -1208,7 +1208,7 @@ static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) { - int32 f, g; + int16 f, g; OPT_Node t = NIL, z = NIL; OPT_Struct typ = NIL; BOOLEAN do_; @@ -1238,7 +1238,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) case 4: if ((g == 4 && y->typ->size < z->typ->size)) { OPB_Convert(&y, z->typ); - } else if (__IN(g, 0x70, 64)) { + } else if (__IN(g, 0x70, 32)) { OPB_Convert(&z, y->typ); } else { OPB_err(100); @@ -1247,23 +1247,23 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) case 5: if (g == 4) { OPB_Convert(&y, z->typ); - } else if (__IN(g, 0x60, 64)) { + } else if (__IN(g, 0x60, 32)) { OPB_Convert(&z, y->typ); } else { OPB_err(100); } break; case 6: - if (__IN(g, 0x70, 64)) { + if (__IN(g, 0x70, 32)) { OPB_Convert(&y, z->typ); - } else if (__IN(g, 0x60, 64)) { + } else if (__IN(g, 0x60, 32)) { OPB_Convert(&y, z->typ); } else { OPB_err(100); } break; case 9: - if (!__IN(g, 0x1800, 64)) { + if (!__IN(g, 0x1800, 32)) { OPB_err(100); } break; @@ -1324,7 +1324,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) y->obj = NIL; } } - } else if (!__IN(f, 0xe1, 64)) { + } else if (!__IN(f, 0xe1, 32)) { OPB_err(105); typ = OPT_undftyp; } @@ -1340,7 +1340,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) OPB_Convert(&z, OPT_realtyp); OPB_Convert(&y, OPT_realtyp); typ = OPT_realtyp; - } else if (__IN(f, 0x60, 64)) { + } else if (__IN(f, 0x60, 32)) { if ((y->class == 7 && y->conval->realval == (LONGREAL)0)) { OPB_err(205); } @@ -1407,7 +1407,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) } break; case 6: - if (!__IN(f, 0xf1, 64)) { + if (!__IN(f, 0xf1, 32)) { OPB_err(105); typ = OPT_undftyp; } @@ -1426,7 +1426,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) } break; case 7: - if (!__IN(f, 0xf1, 64)) { + if (!__IN(f, 0xf1, 32)) { OPB_err(106); typ = OPT_undftyp; } @@ -1450,7 +1450,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) } break; case 9: case 10: - if (__IN(f, 0x1aff, 64) || strings__41(&z, &y)) { + if (__IN(f, 0x1aff, 32) || strings__41(&z, &y)) { typ = OPT_booltyp; } else { OPB_err(107); @@ -1459,7 +1459,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) NewOp__39(op, typ, &z, y); break; case 11: case 12: case 13: case 14: - if (__IN(f, 0x79, 64) || strings__41(&z, &y)) { + if (__IN(f, 0x79, 32) || strings__41(&z, &y)) { typ = OPT_booltyp; } else { OPM_LogWLn(); @@ -1501,10 +1501,10 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y) } if (((*x)->class == 7 && y->class == 7)) { if (k <= l) { - (*x)->conval->setval = __SETRNG(k, l, 64); + (*x)->conval->setval = __SETRNG(k, l, 32); } else { OPB_err(201); - (*x)->conval->setval = __SETRNG(l, k, 64); + (*x)->conval->setval = __SETRNG(l, k, 32); } (*x)->obj = NIL; } else { @@ -1526,7 +1526,7 @@ void OPB_SetElem (OPT_Node *x) } else if ((*x)->class == 7) { k = (*x)->conval->intval; if ((0 <= k && k <= (int64)OPM_MaxSet)) { - (*x)->conval->setval = __SETOF(k,64); + (*x)->conval->setval = __SETOF(k,32); } else { OPB_err(202); } @@ -1540,9 +1540,9 @@ void OPB_SetElem (OPT_Node *x) static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) { OPT_Struct y = NIL; - int32 f, g; + int16 f, g; OPT_Struct p = NIL, q = NIL; - if (__IN(18, OPM_opt, 64)) { + if (__IN(18, OPM_opt, 32)) { OPM_LogWLn(); OPM_LogWStr((CHAR*)"PROCEDURE CheckAssign", 22); OPM_LogWLn(); @@ -1550,7 +1550,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) y = ynode->typ; f = x->form; g = y->form; - if (__IN(18, OPM_opt, 64)) { + if (__IN(18, OPM_opt, 32)) { OPM_LogWStr((CHAR*)"y.form = ", 10); OPM_LogWNum(y->form, 0); OPM_LogWLn(); @@ -1571,7 +1571,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) case 0: case 8: break; case 1: - if (!((__IN(g, 0x1a, 64) && y->size == 1))) { + if (!((__IN(g, 0x1a, 32) && y->size == 1))) { OPB_err(113); } break; @@ -1586,12 +1586,12 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) } break; case 5: - if (!__IN(g, 0x30, 64)) { + if (!__IN(g, 0x30, 32)) { OPB_err(113); } break; case 6: - if (!__IN(g, 0x70, 64)) { + if (!__IN(g, 0x70, 32)) { OPB_err(113); } break; @@ -1639,7 +1639,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) if (ynode->conval->intval2 > x->n) { OPB_err(114); } - } else if ((__IN(y->comp, 0x0c, 64) && y->BaseTyp == OPT_chartyp)) { + } else if ((__IN(y->comp, 0x0c, 32) && y->BaseTyp == OPT_chartyp)) { } else { OPB_err(113); } @@ -1647,7 +1647,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPB_err(113); } } else if ((x->comp == 3 && x->BaseTyp == OPT_chartyp)) { - if ((__IN(y->comp, 0x0c, 64) && y->BaseTyp == OPT_chartyp)) { + if ((__IN(y->comp, 0x0c, 32) && y->BaseTyp == OPT_chartyp)) { } else { OPB_err(113); } @@ -1674,7 +1674,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPM_LogWLn(); break; } - if ((((((ynode->class == 7 && g < f)) && __IN(g, 0x30, 64))) && __IN(f, 0x70, 64))) { + if ((((((ynode->class == 7 && g < f)) && __IN(g, 0x30, 32))) && __IN(f, 0x70, 32))) { OPB_Convert(&ynode, x); } } @@ -1683,9 +1683,9 @@ static void OPB_CheckLeaf (OPT_Node x, BOOLEAN dynArrToo) { } -void OPB_StPar0 (OPT_Node *par0, int32 fctno) +void OPB_StPar0 (OPT_Node *par0, int16 fctno) { - int32 f; + int16 f; OPT_Struct typ = NIL; OPT_Node x = NIL; x = *par0; @@ -1712,7 +1712,7 @@ void OPB_StPar0 (OPT_Node *par0, int32 fctno) OPB_err(76); } f = x->typ->BaseTyp->comp; - if (__IN(f, 0x1c, 64)) { + if (__IN(f, 0x1c, 32)) { if (f == 3) { typ = x->typ->BaseTyp; } @@ -1745,7 +1745,7 @@ void OPB_StPar0 (OPT_Node *par0, int32 fctno) case 5: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x60, 64)) { + } else if (__IN(f, 0x60, 32)) { OPB_Convert(&x, OPT_linttyp); } else { OPB_err(111); @@ -1820,7 +1820,7 @@ void OPB_StPar0 (OPT_Node *par0, int32 fctno) case 9: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x11, 64)) { + } else if (__IN(f, 0x11, 32)) { OPB_Convert(&x, OPT_chartyp); } else { OPB_err(111); @@ -1881,7 +1881,7 @@ void OPB_StPar0 (OPT_Node *par0, int32 fctno) } break; case 17: - if (!__IN(x->typ->comp, 0x0c, 64)) { + if (!__IN(x->typ->comp, 0x0c, 32)) { OPB_err(131); } break; @@ -1892,7 +1892,7 @@ void OPB_StPar0 (OPT_Node *par0, int32 fctno) } if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (((!__IN(x->typ->comp, 0x0c, 64) || x->typ->BaseTyp->form != 3) && f != 8)) { + } else if (((!__IN(x->typ->comp, 0x0c, 32) || x->typ->BaseTyp->form != 3) && f != 8)) { OPB_err(111); } break; @@ -1916,7 +1916,7 @@ void OPB_StPar0 (OPT_Node *par0, int32 fctno) if (x->class != 8) { OPB_err(110); x = OPB_NewIntConst(1); - } else if (__IN(f, 0x18fe, 64) || __IN(x->typ->comp, 0x14, 64)) { + } else if (__IN(f, 0x18fe, 32) || __IN(x->typ->comp, 0x14, 32)) { (*OPB_typSize)(x->typ); x->typ->pvused = 1; x = OPB_NewIntConst(x->typ->size); @@ -1931,7 +1931,7 @@ void OPB_StPar0 (OPT_Node *par0, int32 fctno) case 22: case 23: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (!__IN(f, 0x9a, 64)) { + } else if (!__IN(f, 0x9a, 32)) { OPB_err(111); } break; @@ -1940,7 +1940,7 @@ void OPB_StPar0 (OPT_Node *par0, int32 fctno) OPB_err(126); } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_adrtyp->size)) { OPB_Convert(&x, OPT_adrtyp); - } else if (!((__IN(x->typ->form, 0x0810, 64) && x->typ->size == (int64)OPM_AddressSize))) { + } else if (!((__IN(x->typ->form, 0x0810, 32) && x->typ->size == OPM_AddressSize))) { OPB_err(111); x->typ = OPT_adrtyp; } @@ -1957,7 +1957,7 @@ void OPB_StPar0 (OPT_Node *par0, int32 fctno) case 29: if (x->class != 8) { OPB_err(110); - } else if (__IN(f, 0x0501, 64) || x->typ->comp == 3) { + } else if (__IN(f, 0x0501, 32) || x->typ->comp == 3) { OPB_err(111); } break; @@ -2009,7 +2009,7 @@ static OPT_Node NewOp__53 (int8 class, int8 subcl, OPT_Node left, OPT_Node right void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) { - int32 f, L; + int16 f, L; OPT_Struct typ = NIL; OPT_Node p = NIL, t = NIL; struct StPar1__52 _s; @@ -2024,7 +2024,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) p->typ = OPT_notyp; } else { if (x->typ != p->typ) { - if ((x->class == 7 && f == 4)) { + if ((f == 4 && (x->class == 7 || (p->typ->form == 4 && x->typ->size <= p->typ->size)))) { OPB_Convert(&x, p->typ); } else { OPB_err(111); @@ -2053,11 +2053,11 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) } else if (x->typ->size == 1) { L = OPM_Integer(x->conval->intval); typ = p->typ; - while ((L > 0 && __IN(typ->comp, 0x0c, 64))) { + while ((L > 0 && __IN(typ->comp, 0x0c, 32))) { typ = typ->BaseTyp; L -= 1; } - if (L != 0 || !__IN(typ->comp, 0x0c, 64)) { + if (L != 0 || !__IN(typ->comp, 0x0c, 32)) { OPB_err(132); } else { x->obj = NIL; @@ -2081,7 +2081,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) case 18: if (OPB_NotVar(x)) { OPB_err(112); - } else if ((__IN(x->typ->comp, 0x0c, 64) && x->typ->BaseTyp->form == 3)) { + } else if ((__IN(x->typ->comp, 0x0c, 32) && x->typ->BaseTyp->form == 3)) { if (x->readonly) { OPB_err(76); } @@ -2103,8 +2103,8 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) OPB_err(208); p->conval->intval = 1; } else if (x->conval->intval >= 0) { - if (__ABS(p->conval->intval) <= __DIV(9223372036854775807, __ASH(1, x->conval->intval))) { - p->conval->intval = p->conval->intval * __ASH(1, x->conval->intval); + if (__ABS(p->conval->intval) <= __DIV(9223372036854775807, (int64)__ASH(1, x->conval->intval))) { + p->conval->intval = p->conval->intval * (int64)__ASH(1, x->conval->intval); } else { OPB_err(208); p->conval->intval = 1; @@ -2155,7 +2155,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) case 24: case 25: case 26: case 27: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x18ff, 64)) { + } else if (__IN(f, 0x18ff, 32)) { if (fctno == 24 || fctno == 26) { if (OPB_NotVar(x)) { OPB_err(112); @@ -2181,7 +2181,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) p->typ = OPT_booltyp; break; case 29: - if (((x->class == 8 || x->class == 9) || __IN(f, 0x0501, 64)) || x->typ->comp == 3) { + if (((x->class == 8 || x->class == 9) || __IN(f, 0x0501, 32)) || x->typ->comp == 3) { OPB_err(126); } if ((x->class != 7 && x->typ->size < p->typ->size)) { @@ -2213,7 +2213,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) OPB_err(126); } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_adrtyp->size)) { OPB_Convert(&x, OPT_adrtyp); - } else if (!((__IN(x->typ->form, 0x0810, 64) && x->typ->size == (int64)OPM_AddressSize))) { + } else if (!((__IN(x->typ->form, 0x0810, 32) && x->typ->size == OPM_AddressSize))) { OPB_err(111); x->typ = OPT_adrtyp; } @@ -2251,10 +2251,10 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) StPar1__52_s = _s.lnk; } -void OPB_StParN (OPT_Node *par0, OPT_Node x, int32 fctno, int32 n) +void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n) { OPT_Node node = NIL; - int32 f; + int16 f; OPT_Node p = NIL; p = *par0; f = x->typ->form; @@ -2296,9 +2296,9 @@ void OPB_StParN (OPT_Node *par0, OPT_Node x, int32 fctno, int32 n) *par0 = p; } -void OPB_StFct (OPT_Node *par0, int8 fctno, int32 parno) +void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno) { - int32 dim; + int16 dim; OPT_Node x = NIL, p = NIL; p = *par0; if (fctno <= 19) { @@ -2362,17 +2362,17 @@ void OPB_StFct (OPT_Node *par0, int8 fctno, int32 parno) static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpar) { - int32 f; + int16 f; f = atyp->comp; ftyp = ftyp->BaseTyp; atyp = atyp->BaseTyp; if ((fvarpar && ftyp == OPT_bytetyp)) { - if (!__IN(f, 0x0c, 64) || !((__IN(atyp->form, 0x1e, 64) && atyp->size == 1))) { - if (__IN(18, OPM_opt, 64)) { + if (!__IN(f, 0x0c, 32) || !((__IN(atyp->form, 0x1e, 32) && atyp->size == 1))) { + if (__IN(18, OPM_opt, 32)) { OPB_err(-301); } } - } else if (__IN(f, 0x0c, 64)) { + } else if (__IN(f, 0x0c, 32)) { if (ftyp->comp == 3) { OPB_DynArrParCheck(ftyp, atyp, fvarpar); } else if (ftyp != atyp) { @@ -2411,7 +2411,7 @@ static void OPB_CheckReceiver (OPT_Node *x, OPT_Object fp) void OPB_PrepCall (OPT_Node *x, OPT_Object *fpar) { - if (((*x)->obj != NIL && __IN((*x)->obj->mode, 0x22c0, 64))) { + if (((*x)->obj != NIL && __IN((*x)->obj->mode, 0x22c0, 32))) { *fpar = (*x)->obj->link; if ((*x)->obj->mode == 13) { OPB_CheckReceiver(&(*x)->left, *fpar); @@ -2451,7 +2451,7 @@ void OPB_Param (OPT_Node ap, OPT_Object fp) } } else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 11)) { } else if (ap->typ != fp->typ) { - if ((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x1e, 64) && ap->typ->size == 1)))) { + if ((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x1e, 32) && ap->typ->size == 1)))) { } else if ((ap->typ == OPT_adrtyp && fp->typ == OPT_IntType(ap->typ->size))) { } else { OPB_err(123); @@ -2481,7 +2481,7 @@ void OPB_StaticLink (int8 dlev) scope = OPT_topScope; while (dlev > 0) { dlev -= 1; - scope->link->conval->setval |= __SETOF(3,64); + scope->link->conval->setval |= __SETOF(3,32); scope = scope->left; } } @@ -2576,7 +2576,7 @@ void OPB_Assign (OPT_Node *x, OPT_Node y) y->conval->intval = 0; OPB_Index(&*x, OPB_NewIntConst(0)); } - if ((((((__IN((*x)->typ->comp, 0x0c, 64) && (*x)->typ->BaseTyp == OPT_chartyp)) && __IN(y->typ->comp, 0x0c, 64))) && y->typ->BaseTyp == OPT_chartyp)) { + if ((((((__IN((*x)->typ->comp, 0x0c, 32) && (*x)->typ->BaseTyp == OPT_chartyp)) && __IN(y->typ->comp, 0x0c, 32))) && y->typ->BaseTyp == OPT_chartyp)) { subcl = 18; } else { subcl = 0; diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index 6863fee8..dc0085af 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -37,10 +37,10 @@ import void OPB_PrepCall (OPT_Node *x, OPT_Object *fpar); import void OPB_Return (OPT_Node *x, OPT_Object proc); import void OPB_SetElem (OPT_Node *x); import void OPB_SetRange (OPT_Node *x, OPT_Node y); -import void OPB_StFct (OPT_Node *par0, int8 fctno, int32 parno); -import void OPB_StPar0 (OPT_Node *par0, int32 fctno); +import void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno); +import void OPB_StPar0 (OPT_Node *par0, int16 fctno); import void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno); -import void OPB_StParN (OPT_Node *par0, OPT_Node x, int32 fctno, int32 n); +import void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n); import void OPB_StaticLink (int8 dlev); import void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard); import void *OPB__init(void); diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index ee7f4baa..99353400 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,8 +1,8 @@ /* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ -#define INTEGER int32 -#define LONGINT int64 -#define SET uint64 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Configuration.h" @@ -10,26 +10,26 @@ #include "OPT.h" -static int32 OPC_indentLevel; +static int16 OPC_indentLevel; static int8 OPC_hashtab[105]; static CHAR OPC_keytab[50][9]; static BOOLEAN OPC_GlbPtrs; static CHAR OPC_BodyNameExt[13]; -export void OPC_Align (int64 *adr, int64 base); +export void OPC_Align (int32 *adr, int32 base); export void OPC_Andent (OPT_Struct typ); static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames); -export int64 OPC_BaseAlignment (OPT_Struct typ); +export int32 OPC_BaseAlignment (OPT_Struct typ); export OPT_Object OPC_BaseTProc (OPT_Object obj); export void OPC_BegBlk (void); export void OPC_BegStat (void); -static void OPC_CProcDefs (OPT_Object obj, int32 vis); -export void OPC_Case (int64 caseVal, int32 form); +static void OPC_CProcDefs (OPT_Object obj, int16 vis); +export void OPC_Case (int64 caseVal, int16 form); static void OPC_CharacterLiteral (int64 c); -export void OPC_Cmp (int32 rel); +export void OPC_Cmp (int16 rel); export void OPC_CompleteIdent (OPT_Object obj); -export void OPC_Constant (OPT_Const con, int32 form); +export void OPC_Constant (OPT_Const con, int16 form); static void OPC_DeclareBase (OPT_Object dcl); static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef); static void OPC_DeclareParams (OPT_Object par, BOOLEAN macro); @@ -46,45 +46,45 @@ export void OPC_EnterBody (void); export void OPC_EnterProc (OPT_Object proc); export void OPC_ExitBody (void); export void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet); -static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, int64 *off, int64 *n, int64 *curAlign); -static void OPC_FillGap (int64 gap, int64 off, int64 align, int64 *n, int64 *curAlign); +static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, int32 *off, int32 *n, int32 *curAlign); +static void OPC_FillGap (int32 gap, int32 off, int32 align, int32 *n, int32 *curAlign); export void OPC_GenBdy (OPT_Node n); -static void OPC_GenDynTypes (OPT_Node n, int32 vis); +static void OPC_GenDynTypes (OPT_Node n, int16 vis); export void OPC_GenEnumPtrs (OPT_Object var); export void OPC_GenHdr (OPT_Node n); export void OPC_GenHdrIncludes (void); static void OPC_GenHeaderMsg (void); -export void OPC_Halt (int64 n); +export void OPC_Halt (int32 n); export void OPC_Ident (OPT_Object obj); -static void OPC_IdentList (OPT_Object obj, int32 vis); +static void OPC_IdentList (OPT_Object obj, int16 vis); static void OPC_Include (CHAR *name, LONGINT name__len); -static void OPC_IncludeImports (OPT_Object obj, int32 vis); +static void OPC_IncludeImports (OPT_Object obj, int16 vis); export void OPC_Increment (BOOLEAN decrement); -export void OPC_Indent (int32 count); +export void OPC_Indent (int16 count); export void OPC_Init (void); static void OPC_InitImports (OPT_Object obj); static void OPC_InitKeywords (void); export void OPC_InitTDesc (OPT_Struct typ); static void OPC_InitTProcs (OPT_Object typ, OPT_Object obj); -export void OPC_IntLiteral (int64 n, int64 size); +export void OPC_IntLiteral (int64 n, int32 size); export void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim); static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName); -static int32 OPC_Length (CHAR *s, LONGINT s__len); -export int64 OPC_NofPtrs (OPT_Struct typ); -static int32 OPC_PerfectHash (CHAR *s, LONGINT s__len); +static int16 OPC_Length (CHAR *s, LONGINT s__len); +export int32 OPC_NofPtrs (OPT_Struct typ); +static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len); static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len); static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define); static void OPC_ProcPredefs (OPT_Object obj, int8 vis); static void OPC_PutBase (OPT_Struct typ); -static void OPC_PutPtrOffsets (OPT_Struct typ, int64 adr, int64 *cnt); +static void OPC_PutPtrOffsets (OPT_Struct typ, int32 adr, int32 *cnt); static void OPC_RegCmds (OPT_Object obj); export void OPC_SetInclude (BOOLEAN exclude); -export int64 OPC_SizeAlignment (int64 size); +export int32 OPC_SizeAlignment (int32 size); static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause); -static void OPC_Str1 (CHAR *s, LONGINT s__len, int64 x); -static void OPC_StringLiteral (CHAR *s, LONGINT s__len, int64 l); +static void OPC_Str1 (CHAR *s, LONGINT s__len, int32 x); +static void OPC_StringLiteral (CHAR *s, LONGINT s__len, int32 l); export void OPC_TDescDecl (OPT_Struct typ); -export void OPC_TypeDefs (OPT_Object obj, int32 vis); +export void OPC_TypeDefs (OPT_Object obj, int16 vis); export void OPC_TypeOf (OPT_Object ap); static BOOLEAN OPC_Undefined (OPT_Object obj); @@ -95,14 +95,14 @@ void OPC_Init (void) __MOVE("__init(void)", OPC_BodyNameExt, 13); } -void OPC_Indent (int32 count) +void OPC_Indent (int16 count) { OPC_indentLevel += count; } void OPC_BegStat (void) { - int32 i; + int16 i; i = OPC_indentLevel; while (i > 0) { OPM_Write(0x09); @@ -138,10 +138,10 @@ void OPC_EndBlk0 (void) OPM_Write('}'); } -static void OPC_Str1 (CHAR *s, LONGINT s__len, int64 x) +static void OPC_Str1 (CHAR *s, LONGINT s__len, int32 x) { CHAR ch; - int32 i; + int16 i; __DUP(s, s__len, CHAR); ch = s[0]; i = 0; @@ -157,10 +157,10 @@ static void OPC_Str1 (CHAR *s, LONGINT s__len, int64 x) __DEL(s); } -static int32 OPC_Length (CHAR *s, LONGINT s__len) +static int16 OPC_Length (CHAR *s, LONGINT s__len) { - int32 _o_result; - int32 i; + int16 _o_result; + int16 i; i = 0; while (s[__X(i, s__len)] != 0x00) { i += 1; @@ -169,14 +169,14 @@ static int32 OPC_Length (CHAR *s, LONGINT s__len) return _o_result; } -static int32 OPC_PerfectHash (CHAR *s, LONGINT s__len) +static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len) { - int32 _o_result; - int32 i, h; + int16 _o_result; + int16 i, h; i = 0; h = 0; while ((s[__X(i, s__len)] != 0x00 && i < 5)) { - h = 3 * h + s[__X(i, s__len)]; + h = 3 * h + (int16)s[__X(i, s__len)]; i += 1; } _o_result = (int)__MOD(h, 105); @@ -185,10 +185,10 @@ static int32 OPC_PerfectHash (CHAR *s, LONGINT s__len) void OPC_Ident (OPT_Object obj) { - int32 mode, level, h; + int16 mode, level, h; mode = obj->mode; level = obj->mnolev; - if ((__IN(mode, 0x62, 64) && level > 0) || __IN(mode, 0x14, 64)) { + if ((__IN(mode, 0x62, 32) && level > 0) || __IN(mode, 0x14, 32)) { OPM_WriteStringVar((void*)obj->name, 256); h = OPC_PerfectHash((void*)obj->name, 256); if (OPC_hashtab[__X(h, 105)] >= 0) { @@ -225,10 +225,10 @@ void OPC_Ident (OPT_Object obj) static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause) { - int32 pointers; + int16 pointers; *openClause = 0; if (((typ->strobj == NIL || typ->strobj->name[0] == 0x00) && typ->comp != 4)) { - if (__IN(typ->comp, 0x0c, 64)) { + if (__IN(typ->comp, 0x0c, 32)) { OPC_Stars(typ->BaseTyp, &*openClause); *openClause = typ->comp == 2; } else if (typ->form == 12) { @@ -261,7 +261,7 @@ static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef) { OPT_Struct typ = NIL; BOOLEAN varPar, openClause; - int32 form, comp; + int16 form, comp; typ = dcl->typ; varPar = ((dcl->mode == 2 && typ->comp != 2) || typ->comp == 3) || scopeDef; OPC_Stars(typ, &openClause); @@ -285,7 +285,7 @@ static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef) break; } else if ((form == 11 && typ->BaseTyp->comp != 3)) { openClause = 1; - } else if (form == 12 || __IN(comp, 0x0c, 64)) { + } else if (form == 12 || __IN(comp, 0x0c, 32)) { if (openClause) { OPM_Write(')'); openClause = 0; @@ -319,7 +319,7 @@ void OPC_Andent (OPT_Struct typ) static BOOLEAN OPC_Undefined (OPT_Object obj) { BOOLEAN _o_result; - _o_result = obj->name[0] == 0x00 || (((obj->mnolev >= 0 && obj->linkadr != (int64)(3 + OPM_currFile))) && obj->linkadr != 2); + _o_result = obj->name[0] == 0x00 || (((obj->mnolev >= 0 && obj->linkadr != (3 + OPM_currFile))) && obj->linkadr != 2); return _o_result; } @@ -327,8 +327,8 @@ static void OPC_DeclareBase (OPT_Object dcl) { OPT_Struct typ = NIL, prev = NIL; OPT_Object obj = NIL; - int32 nofdims; - int64 off, n, dummy; + int16 nofdims; + int32 off, n, dummy; typ = dcl->typ; prev = typ; while ((((((((typ->strobj == NIL || typ->comp == 3) || OPC_Undefined(typ->strobj)) && typ->comp != 4)) && typ->form != 10)) && !((typ->form == 11 && typ->BaseTyp->comp == 3)))) { @@ -387,12 +387,12 @@ static void OPC_DeclareBase (OPT_Object dcl) } } -int64 OPC_NofPtrs (OPT_Struct typ) +int32 OPC_NofPtrs (OPT_Struct typ) { - int64 _o_result; + int32 _o_result; OPT_Object fld = NIL; OPT_Struct btyp = NIL; - int64 n; + int32 n; if ((typ->form == 11 && typ->sysflag == 0)) { _o_result = 1; return _o_result; @@ -430,11 +430,11 @@ int64 OPC_NofPtrs (OPT_Struct typ) __RETCHK; } -static void OPC_PutPtrOffsets (OPT_Struct typ, int64 adr, int64 *cnt) +static void OPC_PutPtrOffsets (OPT_Struct typ, int32 adr, int32 *cnt) { OPT_Object fld = NIL; OPT_Struct btyp = NIL; - int64 n, i; + int32 n, i; if ((typ->form == 11 && typ->sysflag == 0)) { OPM_WriteInt(adr); OPM_WriteString((CHAR*)", ", 3); @@ -510,7 +510,7 @@ static void OPC_PutBase (OPT_Struct typ) static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName) { OPT_Struct typ = NIL; - int32 dim; + int16 dim; if (showParamName) { OPC_Ident(par); OPM_WriteString((CHAR*)"__len", 6); @@ -608,7 +608,7 @@ OPT_Object OPC_BaseTProc (OPT_Object obj) { OPT_Object _o_result; OPT_Struct typ = NIL, base = NIL; - int64 mno; + int32 mno; typ = obj->link->typ; if (typ->form == 11) { typ = typ->BaseTyp; @@ -690,7 +690,7 @@ static void OPC_DefineType (OPT_Struct str) if (str->BaseTyp->comp != 4) { OPC_DefineType(str->BaseTyp); } - } else if (__IN(str->comp, 0x0c, 64)) { + } else if (__IN(str->comp, 0x0c, 32)) { OPC_DefineType(str->BaseTyp); } else if (str->form == 12) { if (str->BaseTyp != OPT_notyp) { @@ -733,7 +733,7 @@ static void OPC_DefineType (OPT_Struct str) static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len) { BOOLEAN _o_result; - int32 i; + int16 i; BOOLEAN r; __DUP(y, y__len, CHAR); i = 0; @@ -746,14 +746,14 @@ static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len) return _o_result; } -static void OPC_CProcDefs (OPT_Object obj, int32 vis) +static void OPC_CProcDefs (OPT_Object obj, int16 vis) { - int32 i; + int16 i; OPT_ConstExt ext = NIL; - int32 _for__9; + int16 _for__9; if (obj != NIL) { OPC_CProcDefs(obj->left, vis); - if ((((obj->mode == 9 && obj->vis >= vis)) && obj->adr == 1)) { + if ((((obj->mode == 9 && (int16)obj->vis >= vis)) && obj->adr == 1)) { ext = obj->conval->ext; i = 1; if (((*ext)[1] != '#' && !(OPC_Prefixed(ext, (CHAR*)"extern ", 8) || OPC_Prefixed(ext, (CHAR*)"import ", 8)))) { @@ -762,7 +762,7 @@ static void OPC_CProcDefs (OPT_Object obj, int32 vis) OPC_DeclareParams(obj->link, 1); OPM_Write(0x09); } - _for__9 = (*obj->conval->ext)[0]; + _for__9 = (int16)(*obj->conval->ext)[0]; i = i; while (i <= _for__9) { OPM_Write((*obj->conval->ext)[__X(i, 256)]); @@ -774,7 +774,7 @@ static void OPC_CProcDefs (OPT_Object obj, int32 vis) } } -void OPC_TypeDefs (OPT_Object obj, int32 vis) +void OPC_TypeDefs (OPT_Object obj, int16 vis) { if (obj != NIL) { OPC_TypeDefs(obj->left, vis); @@ -806,7 +806,7 @@ static void OPC_DefAnonRecs (OPT_Node n) void OPC_TDescDecl (OPT_Struct typ) { - int64 nofptrs; + int32 nofptrs; OPT_Object o = NIL; OPC_BegStat(); OPM_WriteString((CHAR*)"__TDESC(", 9); @@ -821,7 +821,7 @@ void OPC_TDescDecl (OPT_Struct typ) OPC_Str1((CHAR*)", #), {", 8, typ->size); nofptrs = 0; OPC_PutPtrOffsets(typ, 0, &nofptrs); - OPC_Str1((CHAR*)"#}}", 4, -((nofptrs + 1) * (int64)OPM_AddressSize)); + OPC_Str1((CHAR*)"#}}", 4, -((nofptrs + 1) * OPM_AddressSize)); OPC_EndStat(); } @@ -843,7 +843,7 @@ void OPC_InitTDesc (OPT_Struct typ) } } -void OPC_Align (int64 *adr, int64 base) +void OPC_Align (int32 *adr, int32 base) { switch (base) { case 2: @@ -863,11 +863,11 @@ void OPC_Align (int64 *adr, int64 base) } } -int64 OPC_SizeAlignment (int64 size) +int32 OPC_SizeAlignment (int32 size) { - int64 _o_result; - int64 alignment; - if (size < (int64)OPM_Alignment) { + int32 _o_result; + int32 alignment; + if (size < OPM_Alignment) { alignment = 1; while (alignment < size) { alignment = __ASHL(alignment, 1); @@ -879,10 +879,10 @@ int64 OPC_SizeAlignment (int64 size) return _o_result; } -int64 OPC_BaseAlignment (OPT_Struct typ) +int32 OPC_BaseAlignment (OPT_Struct typ) { - int64 _o_result; - int64 alignment; + int32 _o_result; + int32 alignment; if (typ->form == 13) { if (typ->comp == 4) { alignment = __MASK(typ->align, -65536); @@ -896,9 +896,9 @@ int64 OPC_BaseAlignment (OPT_Struct typ) return _o_result; } -static void OPC_FillGap (int64 gap, int64 off, int64 align, int64 *n, int64 *curAlign) +static void OPC_FillGap (int32 gap, int32 off, int32 align, int32 *n, int32 *curAlign) { - int64 adr; + int32 adr; adr = off; OPC_Align(&adr, align); if ((*curAlign < align && gap - (adr - off) >= align)) { @@ -933,11 +933,11 @@ static void OPC_FillGap (int64 gap, int64 off, int64 align, int64 *n, int64 *cur } } -static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, int64 *off, int64 *n, int64 *curAlign) +static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, int32 *off, int32 *n, int32 *curAlign) { OPT_Object fld = NIL; OPT_Struct base = NIL; - int64 gap, adr, align, fldAlign; + int32 gap, adr, align, fldAlign; fld = typ->link; align = __MASK(typ->align, -65536); if (typ->BaseTyp != NIL) { @@ -981,7 +981,7 @@ static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, int64 *off, int64 *n, i } } if (last) { - adr = typ->size - (int64)__ASHR(typ->sysflag, 8); + adr = typ->size - __ASHR(typ->sysflag, 8); if (adr == 0) { gap = 1; } else { @@ -993,16 +993,16 @@ static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, int64 *off, int64 *n, i } } -static void OPC_IdentList (OPT_Object obj, int32 vis) +static void OPC_IdentList (OPT_Object obj, int16 vis) { OPT_Struct base = NIL; BOOLEAN first; - int32 lastvis; + int16 lastvis; base = NIL; first = 1; while ((obj != NIL && obj->mode != 13)) { - if ((__IN(vis, 0x05, 64) || (vis == 1 && obj->vis != 0)) || (vis == 3 && !obj->leaf)) { - if (obj->typ != base || obj->vis != lastvis) { + if ((__IN(vis, 0x05, 32) || (vis == 1 && obj->vis != 0)) || (vis == 3 && !obj->leaf)) { + if (obj->typ != base || (int16)obj->vis != lastvis) { if (!first) { OPC_EndStat(); } @@ -1045,7 +1045,7 @@ static void OPC_IdentList (OPT_Object obj, int32 vis) OPC_Ident(obj); OPM_WriteString((CHAR*)"__typ", 6); base = NIL; - } else if ((((((__IN(5, OPM_opt, 64) && vis == 0)) && obj->mnolev > 0)) && obj->typ->form == 11)) { + } else if ((((((__IN(5, OPM_opt, 32) && vis == 0)) && obj->mnolev > 0)) && obj->typ->form == 11)) { OPM_WriteString((CHAR*)" = NIL", 7); } } @@ -1115,7 +1115,7 @@ static void OPC_ProcPredefs (OPT_Object obj, int8 vis) { if (obj != NIL) { OPC_ProcPredefs(obj->left, vis); - if ((((__IN(obj->mode, 0xc0, 64) && obj->vis >= vis)) && (obj->history != 4 || obj->mode == 6))) { + if ((((__IN(obj->mode, 0xc0, 32) && obj->vis >= vis)) && (obj->history != 4 || obj->mode == 6))) { if (vis == 1) { OPM_WriteString((CHAR*)"import ", 8); } else if (obj->vis == 0) { @@ -1141,18 +1141,18 @@ static void OPC_Include (CHAR *name, LONGINT name__len) __DEL(name); } -static void OPC_IncludeImports (OPT_Object obj, int32 vis) +static void OPC_IncludeImports (OPT_Object obj, int16 vis) { if (obj != NIL) { OPC_IncludeImports(obj->left, vis); - if ((((obj->mode == 11 && obj->mnolev != 0)) && OPT_GlbMod[__X(-obj->mnolev, 64)]->vis >= vis)) { + if ((((obj->mode == 11 && obj->mnolev != 0)) && (int16)OPT_GlbMod[__X(-obj->mnolev, 64)]->vis >= vis)) { OPC_Include(OPT_GlbMod[__X(-obj->mnolev, 64)]->name, 256); } OPC_IncludeImports(obj->right, vis); } } -static void OPC_GenDynTypes (OPT_Node n, int32 vis) +static void OPC_GenDynTypes (OPT_Node n, int16 vis) { OPT_Struct typ = NIL; while ((n != NIL && n->class == 14)) { @@ -1201,15 +1201,15 @@ void OPC_GenHdr (OPT_Node n) static void OPC_GenHeaderMsg (void) { - int32 i; + int16 i; OPM_WriteString((CHAR*)"/* ", 4); OPM_WriteString((CHAR*)"voc", 4); OPM_Write(' '); OPM_WriteString(Configuration_versionLong, 41); OPM_Write(' '); i = 0; - while (i <= 63) { - if (__IN(i, OPM_glbopt, 64)) { + while (i <= 31) { + if (__IN(i, OPM_glbopt, 32)) { switch (i) { case 0: OPM_Write('x'); @@ -1352,7 +1352,7 @@ static void OPC_InitImports (OPT_Object obj) void OPC_GenEnumPtrs (OPT_Object var) { OPT_Struct typ = NIL; - int64 n; + int32 n; OPC_GlbPtrs = 0; while (var != NIL) { typ = var->typ; @@ -1411,7 +1411,7 @@ void OPC_EnterBody (void) { OPM_WriteLn(); OPM_WriteString((CHAR*)"export ", 8); - if (__IN(10, OPM_opt, 64)) { + if (__IN(10, OPM_opt, 32)) { OPM_WriteString((CHAR*)"int main(int argc, char **argv)", 32); OPM_WriteLn(); } else { @@ -1422,20 +1422,20 @@ void OPC_EnterBody (void) } OPC_BegBlk(); OPC_BegStat(); - if (__IN(10, OPM_opt, 64)) { + if (__IN(10, OPM_opt, 32)) { OPM_WriteString((CHAR*)"__INIT(argc, argv)", 19); } else { OPM_WriteString((CHAR*)"__DEFMOD", 9); } OPC_EndStat(); - if ((__IN(10, OPM_opt, 64) && 0)) { + if ((__IN(10, OPM_opt, 32) && 0)) { OPC_BegStat(); OPM_WriteString((CHAR*)"/*don`t do it!*/ printf(\"DEMO VERSION: DO NOT USE THIS PROGRAM FOR ANY COMMERCIAL PURPOSE\\n\")", 94); OPC_EndStat(); } OPC_InitImports(OPT_topScope->right); OPC_BegStat(); - if (__IN(10, OPM_opt, 64)) { + if (__IN(10, OPM_opt, 32)) { OPM_WriteString((CHAR*)"__REGMAIN(\"", 12); } else { OPM_WriteString((CHAR*)"__REGMOD(\"", 11); @@ -1455,7 +1455,7 @@ void OPC_EnterBody (void) void OPC_ExitBody (void) { OPC_BegStat(); - if (__IN(10, OPM_opt, 64)) { + if (__IN(10, OPM_opt, 32)) { OPM_WriteString((CHAR*)"__FINI;", 8); } else { OPM_WriteString((CHAR*)"__ENDMOD;", 10); @@ -1497,7 +1497,7 @@ void OPC_EnterProc (OPT_Object proc) { OPT_Object var = NIL, scope = NIL; OPT_Struct typ = NIL; - int32 dim; + int16 dim; if (proc->vis != 1) { OPM_WriteString((CHAR*)"static ", 8); } @@ -1537,7 +1537,7 @@ void OPC_EnterProc (OPT_Object proc) } var = proc->link; while (var != NIL) { - if ((((__IN(var->typ->comp, 0x0c, 64) && var->mode == 1)) && var->typ->sysflag == 0)) { + if ((((__IN(var->typ->comp, 0x0c, 32) && var->mode == 1)) && var->typ->sysflag == 0)) { OPC_BegStat(); if (var->typ->comp == 2) { OPM_WriteString((CHAR*)"__DUPARR(", 10); @@ -1585,7 +1585,7 @@ void OPC_EnterProc (OPT_Object proc) OPM_Write('.'); OPC_Ident(var); OPM_WriteString((CHAR*)" = ", 4); - if (__IN(var->typ->comp, 0x0c, 64)) { + if (__IN(var->typ->comp, 0x0c, 32)) { OPM_WriteString((CHAR*)"(void*)", 8); } else if (var->mode != 2) { OPM_Write('&'); @@ -1711,7 +1711,7 @@ void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet) void OPC_CompleteIdent (OPT_Object obj) { - int32 comp, level; + int16 comp, level; level = obj->mnolev; if (obj->adr == 1) { if (obj->typ->comp == 4) { @@ -1740,10 +1740,10 @@ void OPC_CompleteIdent (OPT_Object obj) void OPC_TypeOf (OPT_Object ap) { - int32 i; + int16 i; __ASSERT(ap->typ->comp == 4, 0); if (ap->mode == 2) { - if (ap->mnolev != OPM_level) { + if ((int16)ap->mnolev != OPM_level) { OPM_WriteStringVar((void*)ap->scope->name, 256); OPM_WriteString((CHAR*)"_s->", 5); OPC_Ident(ap); @@ -1759,7 +1759,7 @@ void OPC_TypeOf (OPT_Object ap) } } -void OPC_Cmp (int32 rel) +void OPC_Cmp (int16 rel) { switch (rel) { case 9: @@ -1803,15 +1803,15 @@ static void OPC_CharacterLiteral (int64 c) } } -static void OPC_StringLiteral (CHAR *s, LONGINT s__len, int64 l) +static void OPC_StringLiteral (CHAR *s, LONGINT s__len, int32 l) { - int64 i; - int32 c; + int32 i; + int16 c; __DUP(s, s__len, CHAR); OPM_Write('"'); i = 0; while (i < l) { - c = s[__X(i, s__len)]; + c = (int16)s[__X(i, s__len)]; if (c < 32 || c > 126) { OPM_Write('\\'); OPM_Write((CHAR)(48 + __ASHR(c, 6))); @@ -1831,7 +1831,7 @@ static void OPC_StringLiteral (CHAR *s, LONGINT s__len, int64 l) __DEL(s); } -void OPC_Case (int64 caseVal, int32 form) +void OPC_Case (int64 caseVal, int16 form) { CHAR ch; OPM_WriteString((CHAR*)"case ", 6); @@ -1869,12 +1869,12 @@ void OPC_Increment (BOOLEAN decrement) } } -void OPC_Halt (int64 n) +void OPC_Halt (int32 n) { OPC_Str1((CHAR*)"__HALT(#)", 10, n); } -void OPC_IntLiteral (int64 n, int64 size) +void OPC_IntLiteral (int64 n, int32 size) { if ((((size > 4 && n <= 2147483647)) && n > (-2147483647-1))) { OPM_WriteString((CHAR*)"((int", 6); @@ -1904,11 +1904,11 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim) } } -void OPC_Constant (OPT_Const con, int32 form) +void OPC_Constant (OPT_Const con, int16 form) { - int32 i; + int16 i; SET s; - int64 hex; + int32 hex; BOOLEAN skipLeading; switch (form) { case 1: @@ -1933,13 +1933,13 @@ void OPC_Constant (OPT_Const con, int32 form) OPM_WriteString((CHAR*)"0x", 3); skipLeading = 1; s = con->setval; - i = 64; + i = 32; do { hex = 0; do { i -= 1; hex = __ASHL(hex, 1); - if (__IN(i, s, 64)) { + if (__IN(i, s, 32)) { hex += 1; } } while (!(__MASK(i, -8) == 0)); @@ -1975,7 +1975,7 @@ static void Enter__49 (CHAR *s, LONGINT s__len); static void Enter__49 (CHAR *s, LONGINT s__len) { - int32 h; + int16 h; __DUP(s, s__len, CHAR); h = OPC_PerfectHash((void*)s, s__len); OPC_hashtab[__X(h, 105)] = *InitKeywords__48_s->n; diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index 6fe30a31..4215947f 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -9,16 +9,16 @@ -import void OPC_Align (int64 *adr, int64 base); +import void OPC_Align (int32 *adr, int32 base); import void OPC_Andent (OPT_Struct typ); -import int64 OPC_BaseAlignment (OPT_Struct typ); +import int32 OPC_BaseAlignment (OPT_Struct typ); import OPT_Object OPC_BaseTProc (OPT_Object obj); import void OPC_BegBlk (void); import void OPC_BegStat (void); -import void OPC_Case (int64 caseVal, int32 form); -import void OPC_Cmp (int32 rel); +import void OPC_Case (int64 caseVal, int16 form); +import void OPC_Cmp (int16 rel); import void OPC_CompleteIdent (OPT_Object obj); -import void OPC_Constant (OPT_Const con, int32 form); +import void OPC_Constant (OPT_Const con, int16 form); import void OPC_DefineInter (OPT_Object proc); import void OPC_EndBlk (void); import void OPC_EndBlk0 (void); @@ -31,19 +31,19 @@ import void OPC_GenBdy (OPT_Node n); import void OPC_GenEnumPtrs (OPT_Object var); import void OPC_GenHdr (OPT_Node n); import void OPC_GenHdrIncludes (void); -import void OPC_Halt (int64 n); +import void OPC_Halt (int32 n); import void OPC_Ident (OPT_Object obj); import void OPC_Increment (BOOLEAN decrement); -import void OPC_Indent (int32 count); +import void OPC_Indent (int16 count); import void OPC_Init (void); import void OPC_InitTDesc (OPT_Struct typ); -import void OPC_IntLiteral (int64 n, int64 size); +import void OPC_IntLiteral (int64 n, int32 size); import void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim); -import int64 OPC_NofPtrs (OPT_Struct typ); +import int32 OPC_NofPtrs (OPT_Struct typ); import void OPC_SetInclude (BOOLEAN exclude); -import int64 OPC_SizeAlignment (int64 size); +import int32 OPC_SizeAlignment (int32 size); import void OPC_TDescDecl (OPT_Struct typ); -import void OPC_TypeDefs (OPT_Object obj, int32 vis); +import void OPC_TypeDefs (OPT_Object obj, int16 vis); import void OPC_TypeOf (OPT_Object ap); import void *OPC__init(void); diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 3f07341b..366d6522 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,8 +1,8 @@ /* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ -#define INTEGER int32 -#define LONGINT int64 -#define SET uint64 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Configuration.h" @@ -19,23 +19,24 @@ typedef static CHAR OPM_SourceFileName[256]; -export int32 OPM_Alignment, OPM_AddressSize, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; +export int16 OPM_Alignment, OPM_AddressSize, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; export int64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; -export int64 OPM_curpos, OPM_errpos, OPM_breakpc; -export int32 OPM_currFile, OPM_level, OPM_pc, OPM_entno; +export int32 OPM_curpos, OPM_errpos, OPM_breakpc; +export int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; export CHAR OPM_modName[32]; export CHAR OPM_objname[64]; export SET OPM_opt, OPM_glbopt; -static int64 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; +static int32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber; +static int64 OPM_lasterrpos; static Texts_Reader OPM_inR; static Texts_Text OPM_Log; static Texts_Writer OPM_W; static Files_Rider OPM_oldSF, OPM_newSF; static Files_Rider OPM_R[3]; static Files_File OPM_oldSFile, OPM_newSFile, OPM_HFile, OPM_BFile, OPM_HIFile; -static int32 OPM_S; +static int16 OPM_S; static CHAR OPM_OBERON[1024]; static CHAR OPM_MODULES[1024]; @@ -44,25 +45,25 @@ static void OPM_Append (Files_Rider *R, address *R__typ, Files_File F); export void OPM_CloseFiles (void); export void OPM_CloseOldSym (void); export void OPM_DeleteNewSym (void); -export void OPM_FPrint (int64 *fp, int64 val); -export void OPM_FPrintLReal (int64 *fp, LONGREAL lr); -export void OPM_FPrintReal (int64 *fp, REAL real); -export void OPM_FPrintSet (int64 *fp, SET set); +export void OPM_FPrint (int32 *fp, int64 val); +export void OPM_FPrintLReal (int32 *fp, LONGREAL lr); +export void OPM_FPrintReal (int32 *fp, REAL real); +export void OPM_FPrintSet (int32 *fp, SET set); static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 pos); export void OPM_Get (CHAR *ch); static void OPM_GetProperties (void); -static void OPM_GetProperty (Texts_Scanner *S, address *S__typ, CHAR *name, LONGINT name__len, int32 *size, int32 *align); +static void OPM_GetProperty (Texts_Scanner *S, address *S__typ, CHAR *name, LONGINT name__len, int16 *size, int16 *align); export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); export void OPM_InitOptions (void); -export int32 OPM_Integer (int64 n); -static void OPM_LogErrMsg (int32 n); +export int16 OPM_Integer (int64 n); +static void OPM_LogErrMsg (int16 n); export void OPM_LogW (CHAR ch); export void OPM_LogWLn (void); export void OPM_LogWNum (int64 i, int64 len); export void OPM_LogWStr (CHAR *s, LONGINT s__len); -export int64 OPM_Longint (int64 n); +export int32 OPM_Longint (int64 n); static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len); -export void OPM_Mark (int32 n, int64 pos); +export void OPM_Mark (int16 n, int64 pos); export void OPM_NewSym (CHAR *modName, LONGINT modName__len); export void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); export void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); @@ -70,10 +71,10 @@ export BOOLEAN OPM_OpenPar (void); export void OPM_RegisterNewSym (void); static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt); static void OPM_ShowLine (int64 pos); -export int64 OPM_SignedMaximum (int64 bytecount); -export int64 OPM_SignedMinimum (int64 bytecount); +export int64 OPM_SignedMaximum (int32 bytecount); +export int64 OPM_SignedMinimum (int32 bytecount); export void OPM_SymRCh (CHAR *ch); -export int64 OPM_SymRInt (void); +export int32 OPM_SymRInt (void); export int64 OPM_SymRInt64 (void); export void OPM_SymRLReal (LONGREAL *lr); export void OPM_SymRReal (REAL *r); @@ -92,9 +93,9 @@ export void OPM_WriteReal (LONGREAL r, CHAR suffx); export void OPM_WriteString (CHAR *s, LONGINT s__len); export void OPM_WriteStringVar (CHAR *s, LONGINT s__len); export BOOLEAN OPM_eofSF (void); -export void OPM_err (int32 n); -static int64 OPM_minusop (int64 i); -static int64 OPM_power0 (int64 i, int64 j); +export void OPM_err (int16 n); +static int32 OPM_minusop (int32 i); +static int32 OPM_power0 (int32 i, int32 j); void OPM_LogW (CHAR ch) @@ -119,23 +120,23 @@ void OPM_LogWLn (void) Console_Ln(); } -int64 OPM_Longint (int64 n) -{ - int64 _o_result; - _o_result = (int64)n; - return _o_result; -} - -int32 OPM_Integer (int64 n) +int32 OPM_Longint (int64 n) { int32 _o_result; _o_result = __VAL(int32, n); return _o_result; } +int16 OPM_Integer (int64 n) +{ + int16 _o_result; + _o_result = __VAL(int16, n); + return _o_result; +} + static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) { - int32 i; + int16 i; __DUP(s, s__len, CHAR); i = 1; while (s[__X(i, s__len)] != 0x00) { @@ -219,23 +220,23 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) OPM_LogWStr((CHAR*)"-M option requires two following digits.", 41); OPM_LogWLn(); } else { - OPM_AddressSize = s[__X(i + 1, s__len)] - 48; - OPM_Alignment = s[__X(i + 2, s__len)] - 48; + OPM_AddressSize = (int16)s[__X(i + 1, s__len)] - 48; + OPM_Alignment = (int16)s[__X(i + 2, s__len)] - 48; i += 2; } break; case 'B': if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_IntegerSize = s[__X(i, s__len)] - 48; + OPM_IntegerSize = (int16)s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_AddressSize = s[__X(i, s__len)] - 48; + OPM_AddressSize = (int16)s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_Alignment = s[__X(i, s__len)] - 48; + OPM_Alignment = (int16)s[__X(i, s__len)] - 48; } __ASSERT(OPM_IntegerSize == 2 || OPM_IntegerSize == 4, 0); __ASSERT(OPM_AddressSize == 4 || OPM_AddressSize == 8, 0); @@ -385,9 +386,9 @@ void OPM_InitOptions (void) s[0] = 0x00; Platform_GetArg(OPM_S, (void*)s, 256); } - if (__IN(15, OPM_opt, 64)) { - OPM_glbopt |= __SETOF(10,64); - OPM_opt |= __SETOF(10,64); + if (__IN(15, OPM_opt, 32)) { + OPM_glbopt |= __SETOF(10,32); + OPM_opt |= __SETOF(10,32); } OPM_GetProperties(); } @@ -395,7 +396,7 @@ void OPM_InitOptions (void) void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len) { Texts_Text T = NIL; - int64 beg, end, time; + int32 beg, end, time; CHAR s[256]; *done = 0; OPM_curpos = 0; @@ -443,7 +444,7 @@ void OPM_Get (CHAR *ch) static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len) { - int32 i, j; + int16 i, j; CHAR ch; __DUP(ext, ext__len, CHAR); i = 0; @@ -465,28 +466,28 @@ static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGIN __DEL(ext); } -static void OPM_LogErrMsg (int32 n) +static void OPM_LogErrMsg (int16 n) { Texts_Scanner S; Texts_Text T = NIL; CHAR ch; - int32 i; + int16 i; CHAR buf[1024]; if (n >= 0) { - if (!__IN(16, OPM_opt, 64)) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"31m", 4); } OPM_LogWStr((CHAR*)" err ", 7); - if (!__IN(16, OPM_opt, 64)) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } } else { - if (!__IN(16, OPM_opt, 64)) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"35m", 4); } OPM_LogWStr((CHAR*)" warning ", 11); n = -n; - if (!__IN(16, OPM_opt, 64)) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } } @@ -498,18 +499,18 @@ static void OPM_LogErrMsg (int32 n) static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 pos) { CHAR ch, cheol; - if (pos < OPM_ErrorLineStartPos) { + if (pos < (int64)OPM_ErrorLineStartPos) { OPM_ErrorLineStartPos = 0; OPM_ErrorLineLimitPos = 0; OPM_ErrorLineNumber = 0; } - if (pos < OPM_ErrorLineLimitPos) { + if (pos < (int64)OPM_ErrorLineLimitPos) { Files_Set(&*r, r__typ, f, OPM_ErrorLineStartPos); return; } Files_Set(&*r, r__typ, f, OPM_ErrorLineLimitPos); Files_Read(&*r, r__typ, (void*)&ch); - while ((OPM_ErrorLineLimitPos < pos && !(*r).eof)) { + while (((int64)OPM_ErrorLineLimitPos < pos && !(*r).eof)) { OPM_ErrorLineStartPos = OPM_ErrorLineLimitPos; OPM_ErrorLineNumber += 1; while ((((ch != 0x00 && ch != 0x0d)) && ch != 0x0a)) { @@ -532,7 +533,7 @@ static void OPM_ShowLine (int64 pos) Files_File f = NIL; Files_Rider r; CHAR line[1023]; - int32 i; + int16 i; CHAR ch; f = Files_Old(OPM_SourceFileName, 256); OPM_FindLine(f, &r, Files_Rider__typ, pos); @@ -551,25 +552,25 @@ static void OPM_ShowLine (int64 pos) OPM_LogWStr(line, 1023); OPM_LogWLn(); OPM_LogWStr((CHAR*)" ", 7); - if (pos >= OPM_ErrorLineLimitPos) { + if (pos >= (int64)OPM_ErrorLineLimitPos) { pos = OPM_ErrorLineLimitPos - 1; } - i = (int32)OPM_Longint(pos - OPM_ErrorLineStartPos); + i = (int16)OPM_Longint(pos - (int64)OPM_ErrorLineStartPos); while (i > 0) { OPM_LogW(' '); i -= 1; } - if (!__IN(16, OPM_opt, 64)) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"32m", 4); } OPM_LogW('^'); - if (!__IN(16, OPM_opt, 64)) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } Files_Close(f); } -void OPM_Mark (int32 n, int64 pos) +void OPM_Mark (int16 n, int64 pos) { if (pos == -1) { pos = 0; @@ -621,49 +622,51 @@ void OPM_Mark (int32 n, int64 pos) } } -void OPM_err (int32 n) +void OPM_err (int16 n) { OPM_Mark(n, OPM_errpos); } -void OPM_FPrint (int64 *fp, int64 val) +void OPM_FPrint (int32 *fp, int64 val) { - *fp = __ROTL((int64)((SET)*fp ^ (SET)val), 1, 64); + *fp = __ROTL((int32)((SET)*fp ^ __VAL(SET, val)), 1, 32); } -void OPM_FPrintSet (int64 *fp, SET set) +void OPM_FPrintSet (int32 *fp, SET set) { - OPM_FPrint(&*fp, (int64)set); + OPM_FPrint(&*fp, (int32)set); } -void OPM_FPrintReal (int64 *fp, REAL real) +void OPM_FPrintReal (int32 *fp, REAL real) { - int32 i; - int64 l; - __GET((address)&real, i, int32); - l = i; + int16 i; + int32 l; + __GET((address)&real, l, int32); OPM_FPrint(&*fp, l); } -void OPM_FPrintLReal (int64 *fp, LONGREAL lr) +void OPM_FPrintLReal (int32 *fp, LONGREAL lr) { - int64 l, h; - OPM_FPrint(&*fp, __VAL(int64, lr)); + int32 l, h; + __GET((address)&lr, l, int32); + __GET((address)&lr + 4, h, int32); + OPM_FPrint(&*fp, l); + OPM_FPrint(&*fp, h); } -static void OPM_GetProperty (Texts_Scanner *S, address *S__typ, CHAR *name, LONGINT name__len, int32 *size, int32 *align) +static void OPM_GetProperty (Texts_Scanner *S, address *S__typ, CHAR *name, LONGINT name__len, int16 *size, int16 *align) { __DUP(name, name__len, CHAR); if (((*S).class == 1 && __STRCMP((*S).s, name) == 0)) { Texts_Scan(&*S, S__typ); if ((*S).class == 3) { - *size = (int32)(*S).i; + *size = (int16)(*S).i; Texts_Scan(&*S, S__typ); } else { OPM_Mark(-157, -1); } if ((*S).class == 3) { - *align = (int32)(*S).i; + *align = (int16)(*S).i; Texts_Scan(&*S, S__typ); } else { OPM_Mark(-157, -1); @@ -674,17 +677,17 @@ static void OPM_GetProperty (Texts_Scanner *S, address *S__typ, CHAR *name, LONG __DEL(name); } -static int64 OPM_minusop (int64 i) +static int32 OPM_minusop (int32 i) { - int64 _o_result; + int32 _o_result; _o_result = -i; return _o_result; } -static int64 OPM_power0 (int64 i, int64 j) +static int32 OPM_power0 (int32 i, int32 j) { - int64 _o_result; - int64 k, p; + int32 _o_result; + int32 k, p; k = 1; p = i; do { @@ -721,7 +724,7 @@ static void OPM_VerboseListSizes (void) OPM_LogWLn(); } -int64 OPM_SignedMaximum (int64 bytecount) +int64 OPM_SignedMaximum (int32 bytecount) { int64 _o_result; int64 result; @@ -731,7 +734,7 @@ int64 OPM_SignedMaximum (int64 bytecount) return _o_result; } -int64 OPM_SignedMinimum (int64 bytecount) +int64 OPM_SignedMinimum (int32 bytecount) { int64 _o_result; _o_result = -OPM_SignedMaximum(bytecount) - 1; @@ -746,7 +749,7 @@ static void OPM_GetProperties (void) OPM_MinLReal = -OPM_MaxLReal; OPM_MaxSet = __ASHL(OPM_SetSize, 3) - 1; OPM_MaxIndex = OPM_SignedMaximum(OPM_AddressSize); - if (__IN(18, OPM_opt, 64)) { + if (__IN(18, OPM_opt, 32)) { OPM_VerboseListSizes(); } } @@ -756,10 +759,10 @@ void OPM_SymRCh (CHAR *ch) Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&*ch); } -int64 OPM_SymRInt (void) +int32 OPM_SymRInt (void) { - int64 _o_result; - int64 k; + int32 _o_result; + int32 k; Files_ReadNum(&OPM_oldSF, Files_Rider__typ, &k); _o_result = k; return _o_result; @@ -776,7 +779,7 @@ int64 OPM_SymRInt64 (void) void OPM_SymRSet (SET *s) { - Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (int64*)&*s); + Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (int32*)&*s); } void OPM_SymRReal (REAL *r) @@ -830,7 +833,7 @@ void OPM_SymWInt (int64 i) void OPM_SymWSet (SET s) { - Files_WriteNum(&OPM_newSF, Files_Rider__typ, (int64)s); + Files_WriteNum(&OPM_newSF, Files_Rider__typ, (int32)s); } void OPM_SymWReal (REAL r) @@ -845,7 +848,7 @@ void OPM_SymWLReal (LONGREAL lr) void OPM_RegisterNewSym (void) { - if (__STRCMP(OPM_modName, "SYSTEM") != 0 || __IN(10, OPM_opt, 64)) { + if (__STRCMP(OPM_modName, "SYSTEM") != 0 || __IN(10, OPM_opt, 32)) { Files_Register(OPM_newSFile); } } @@ -874,7 +877,7 @@ void OPM_Write (CHAR ch) void OPM_WriteString (CHAR *s, LONGINT s__len) { - int32 i; + int16 i; i = 0; while (s[__X(i, s__len)] != 0x00) { i += 1; @@ -884,7 +887,7 @@ void OPM_WriteString (CHAR *s, LONGINT s__len) void OPM_WriteStringVar (CHAR *s, LONGINT s__len) { - int32 i; + int16 i; i = 0; while (s[__X(i, s__len)] != 0x00) { i += 1; @@ -948,14 +951,14 @@ void OPM_WriteReal (LONGREAL r, CHAR suffx) Texts_Reader R; CHAR s[32]; CHAR ch; - int32 i; - if ((((r < OPM_SignedMaximum(OPM_LongintSize) && r > OPM_SignedMinimum(OPM_LongintSize))) && r == (__ENTIER(r)))) { + int16 i; + if ((((r < OPM_SignedMaximum(OPM_LongintSize) && r > OPM_SignedMinimum(OPM_LongintSize))) && r == ((int32)__ENTIER(r)))) { if (suffx == 'f') { OPM_WriteString((CHAR*)"(REAL)", 7); } else { OPM_WriteString((CHAR*)"(LONGREAL)", 11); } - OPM_WriteInt(__ENTIER(r)); + OPM_WriteInt((int32)__ENTIER(r)); } else { Texts_OpenWriter(&W, Texts_Writer__typ); if (suffx == 'f') { @@ -1036,7 +1039,7 @@ void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len) void OPM_CloseFiles (void) { CHAR FName[32]; - int32 res; + int16 res; if (OPM_noerr) { OPM_LogWStr((CHAR*)" ", 3); OPM_LogWNum(Files_Pos(&OPM_R[1], Files_Rider__typ), 0); @@ -1044,10 +1047,10 @@ void OPM_CloseFiles (void) } if (OPM_noerr) { if (__STRCMP(OPM_modName, "SYSTEM") == 0) { - if (!__IN(10, OPM_opt, 64)) { + if (!__IN(10, OPM_opt, 32)) { Files_Register(OPM_BFile); } - } else if (!__IN(10, OPM_opt, 64)) { + } else if (!__IN(10, OPM_opt, 32)) { OPM_Append(&OPM_R[2], Files_Rider__typ, OPM_HFile); Files_Register(OPM_HIFile); Files_Register(OPM_BFile); @@ -1073,12 +1076,12 @@ void OPM_CloseFiles (void) static void EnumPtrs(void (*P)(void*)) { - __ENUMR(&OPM_inR, Texts_Reader__typ, 96, 1, P); + __ENUMR(&OPM_inR, Texts_Reader__typ, 72, 1, P); P(OPM_Log); - __ENUMR(&OPM_W, Texts_Writer__typ, 72, 1, P); - __ENUMR(&OPM_oldSF, Files_Rider__typ, 40, 1, P); - __ENUMR(&OPM_newSF, Files_Rider__typ, 40, 1, P); - __ENUMR(OPM_R, Files_Rider__typ, 40, 3, P); + __ENUMR(&OPM_W, Texts_Writer__typ, 56, 1, P); + __ENUMR(&OPM_oldSF, Files_Rider__typ, 24, 1, P); + __ENUMR(&OPM_newSF, Files_Rider__typ, 24, 1, P); + __ENUMR(OPM_R, Files_Rider__typ, 24, 3, P); P(OPM_oldSFile); P(OPM_newSFile); P(OPM_HFile); @@ -1121,8 +1124,8 @@ export void *OPM__init(void) OPM_AddressSize = 8; OPM_Alignment = 8; OPM_ShortintSize = 1; - OPM_IntegerSize = 4; - OPM_LongintSize = 8; - OPM_SetSize = 8; + OPM_IntegerSize = 2; + OPM_LongintSize = 4; + OPM_SetSize = 4; __ENDMOD; } diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index 765b9680..a6b7990c 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -6,12 +6,12 @@ #include "SYSTEM.h" -import int32 OPM_Alignment, OPM_AddressSize, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; +import int16 OPM_Alignment, OPM_AddressSize, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; import int64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; -import int64 OPM_curpos, OPM_errpos, OPM_breakpc; -import int32 OPM_currFile, OPM_level, OPM_pc, OPM_entno; +import int32 OPM_curpos, OPM_errpos, OPM_breakpc; +import int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; import CHAR OPM_modName[32]; import CHAR OPM_objname[64]; import SET OPM_opt, OPM_glbopt; @@ -20,29 +20,29 @@ import SET OPM_opt, OPM_glbopt; import void OPM_CloseFiles (void); import void OPM_CloseOldSym (void); import void OPM_DeleteNewSym (void); -import void OPM_FPrint (int64 *fp, int64 val); -import void OPM_FPrintLReal (int64 *fp, LONGREAL lr); -import void OPM_FPrintReal (int64 *fp, REAL real); -import void OPM_FPrintSet (int64 *fp, SET set); +import void OPM_FPrint (int32 *fp, int64 val); +import void OPM_FPrintLReal (int32 *fp, LONGREAL lr); +import void OPM_FPrintReal (int32 *fp, REAL real); +import void OPM_FPrintSet (int32 *fp, SET set); import void OPM_Get (CHAR *ch); import void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); import void OPM_InitOptions (void); -import int32 OPM_Integer (int64 n); +import int16 OPM_Integer (int64 n); import void OPM_LogW (CHAR ch); import void OPM_LogWLn (void); import void OPM_LogWNum (int64 i, int64 len); import void OPM_LogWStr (CHAR *s, LONGINT s__len); -import int64 OPM_Longint (int64 n); -import void OPM_Mark (int32 n, int64 pos); +import int32 OPM_Longint (int64 n); +import void OPM_Mark (int16 n, int64 pos); import void OPM_NewSym (CHAR *modName, LONGINT modName__len); import void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); import void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); import BOOLEAN OPM_OpenPar (void); import void OPM_RegisterNewSym (void); -import int64 OPM_SignedMaximum (int64 bytecount); -import int64 OPM_SignedMinimum (int64 bytecount); +import int64 OPM_SignedMaximum (int32 bytecount); +import int64 OPM_SignedMinimum (int32 bytecount); import void OPM_SymRCh (CHAR *ch); -import int64 OPM_SymRInt (void); +import int32 OPM_SymRInt (void); import int64 OPM_SymRInt64 (void); import void OPM_SymRLReal (LONGREAL *lr); import void OPM_SymRReal (REAL *r); @@ -60,7 +60,7 @@ import void OPM_WriteReal (LONGREAL r, CHAR suffx); import void OPM_WriteString (CHAR *s, LONGINT s__len); import void OPM_WriteStringVar (CHAR *s, LONGINT s__len); import BOOLEAN OPM_eofSF (void); -import void OPM_err (int32 n); +import void OPM_err (int16 n); import void *OPM__init(void); diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index 9b25c35f..74f93e77 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,8 +1,8 @@ /* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ -#define INTEGER int32 -#define LONGINT int64 -#define SET uint64 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "OPB.h" @@ -11,7 +11,7 @@ #include "OPT.h" struct OPP__1 { - int64 low, high; + int32 low, high; }; typedef @@ -19,9 +19,9 @@ typedef static int8 OPP_sym, OPP_level; -static int32 OPP_LoopLevel; +static int16 OPP_LoopLevel; static OPT_Node OPP_TDinit, OPP_lastTDinit; -static int32 OPP_nofFwdPtr; +static int16 OPP_nofFwdPtr; static OPT_Struct OPP_FwdPtr[64]; export address *OPP__1__typ; @@ -29,10 +29,10 @@ export address *OPP__1__typ; static void OPP_ActualParameters (OPT_Node *aparlist, OPT_Object fpar); static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned); static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq); -static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int32 *n, OPP_CaseTable tab); +static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int16 *n, OPP_CaseTable tab); static void OPP_CheckMark (int8 *vis); -static void OPP_CheckSym (int32 s); -static void OPP_CheckSysFlag (int32 *sysflag, int32 default_); +static void OPP_CheckSym (int16 s); +static void OPP_CheckSysFlag (int16 *sysflag, int16 default_); static void OPP_ConstExpression (OPT_Node *x); static void OPP_Element (OPT_Node *x); static void OPP_Expression (OPT_Node *x); @@ -51,19 +51,19 @@ static void OPP_StatSeq (OPT_Node *stat); static void OPP_Term (OPT_Node *x); static void OPP_Type (OPT_Struct *typ, OPT_Struct *banned); static void OPP_TypeDecl (OPT_Struct *typ, OPT_Struct *banned); -static void OPP_err (int32 n); +static void OPP_err (int16 n); static void OPP_qualident (OPT_Object *id); static void OPP_selector (OPT_Node *x); -static void OPP_err (int32 n) +static void OPP_err (int16 n) { OPM_err(n); } -static void OPP_CheckSym (int32 s) +static void OPP_CheckSym (int16 s) { - if (OPP_sym == s) { + if ((int16)OPP_sym == s) { OPS_Get(&OPP_sym); } else { OPM_err(s); @@ -94,7 +94,7 @@ static void OPP_qualident (OPT_Object *id) obj->adr = 0; } else { lev = obj->mnolev; - if ((__IN(obj->mode, 0x06, 64) && lev != OPP_level)) { + if ((__IN(obj->mode, 0x06, 32) && lev != OPP_level)) { obj->leaf = 0; if (lev > 0) { OPB_StaticLink(OPP_level - lev); @@ -131,7 +131,7 @@ static void OPP_CheckMark (int8 *vis) } } -static void OPP_CheckSysFlag (int32 *sysflag, int32 default_) +static void OPP_CheckSysFlag (int16 *sysflag, int16 default_) { OPT_Node x = NIL; int64 sf; @@ -162,7 +162,7 @@ static void OPP_RecordType (OPT_Struct *typ, OPT_Struct *banned) { OPT_Object fld = NIL, first = NIL, last = NIL, base = NIL; OPT_Struct ftyp = NIL; - int32 sysflag; + int16 sysflag; *typ = OPT_NewStr(13, 4); (*typ)->BaseTyp = NIL; OPP_CheckSysFlag(&sysflag, -1); @@ -255,7 +255,7 @@ static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) { OPT_Node x = NIL; int64 n; - int32 sysflag; + int16 sysflag; OPP_CheckSysFlag(&sysflag, 0); if (OPP_sym == 25) { *typ = OPT_NewStr(13, 3); @@ -325,7 +325,7 @@ static void OPP_PointerType (OPT_Struct *typ) } else { OPP_qualident(&id); if (id->mode == 5) { - if (__IN(id->typ->comp, 0x1c, 64)) { + if (__IN(id->typ->comp, 0x1c, 32)) { (*typ)->BaseTyp = id->typ; } else { (*typ)->BaseTyp = OPT_undftyp; @@ -338,7 +338,7 @@ static void OPP_PointerType (OPT_Struct *typ) } } else { OPP_Type(&(*typ)->BaseTyp, &OPT_notyp); - if (!__IN((*typ)->BaseTyp->comp, 0x1c, 64)) { + if (!__IN((*typ)->BaseTyp->comp, 0x1c, 32)) { (*typ)->BaseTyp = OPT_undftyp; OPP_err(57); } @@ -629,8 +629,8 @@ static void OPP_StandProcCall (OPT_Node *x) { OPT_Node y = NIL; int8 m; - int32 n; - m = (int8)((int32)(*x)->obj->adr); + int16 n; + m = (int8)((int16)(*x)->obj->adr); n = 0; if (OPP_sym == 30) { OPS_Get(&OPP_sym); @@ -931,7 +931,7 @@ static void TProcDecl__23 (void); static void GetCode__19 (void) { OPT_ConstExt ext = NIL; - int32 n; + int16 n; int64 c; ext = OPT_NewExt(); (*ProcedureDeclaration__16_s->proc)->conval->ext = ext; @@ -966,7 +966,7 @@ static void GetCode__19 (void) } } } - (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1,64); + (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1,32); } static void GetParams__21 (void) @@ -996,9 +996,9 @@ static void GetParams__21 (void) static void Body__17 (void) { OPT_Node procdec = NIL, statseq = NIL; - int64 c; + int32 c; c = OPM_errpos; - (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1,64); + (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1,32); OPP_CheckSym(39); OPP_Block(&procdec, &statseq); OPB_Enter(&procdec, statseq, *ProcedureDeclaration__16_s->proc); @@ -1041,7 +1041,7 @@ static void TProcDecl__23 (void) if ((*ProcedureDeclaration__16_s->fwd != NIL && (*ProcedureDeclaration__16_s->fwd)->mnolev != OPP_level)) { *ProcedureDeclaration__16_s->fwd = NIL; } - if ((((*ProcedureDeclaration__16_s->fwd != NIL && (*ProcedureDeclaration__16_s->fwd)->mode == 13)) && !__IN(1, (*ProcedureDeclaration__16_s->fwd)->conval->setval, 64))) { + if ((((*ProcedureDeclaration__16_s->fwd != NIL && (*ProcedureDeclaration__16_s->fwd)->mode == 13)) && !__IN(1, (*ProcedureDeclaration__16_s->fwd)->conval->setval, 32))) { *ProcedureDeclaration__16_s->proc = OPT_NewObj(); (*ProcedureDeclaration__16_s->proc)->leaf = 1; if ((*ProcedureDeclaration__16_s->fwd)->vis != *ProcedureDeclaration__16_s->vis) { @@ -1075,7 +1075,7 @@ static void TProcDecl__23 (void) if ((((((baseProc->vis == 1 && (*ProcedureDeclaration__16_s->proc)->vis == 0)) && recTyp->strobj != NIL)) && recTyp->strobj->vis == 1)) { OPP_err(109); } - (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(2,64); + (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(2,32); } if (!*ProcedureDeclaration__16_s->forward) { Body__17(); @@ -1118,7 +1118,7 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) } else { OPP_err(38); } - if ((__IN(mode, 0x0600, 64) && !OPT_SYSimported)) { + if ((__IN(mode, 0x0600, 32) && !OPT_SYSimported)) { OPP_err(135); } OPS_Get(&OPP_sym); @@ -1135,7 +1135,7 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) if ((fwd != NIL && (fwd->mnolev != OPP_level || fwd->mode == 8))) { fwd = NIL; } - if ((((fwd != NIL && __IN(fwd->mode, 0xc0, 64))) && !__IN(1, fwd->conval->setval, 64))) { + if ((((fwd != NIL && __IN(fwd->mode, 0xc0, 32))) && !__IN(1, fwd->conval->setval, 32))) { proc = OPT_NewObj(); proc->leaf = 1; if (fwd->vis != vis) { @@ -1168,17 +1168,17 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) ProcedureDeclaration__16_s = _s.lnk; } -static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int32 *n, OPP_CaseTable tab) +static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int16 *n, OPP_CaseTable tab) { OPT_Node x = NIL, y = NIL, lastlab = NIL; - int32 i, f; - int64 xval, yval; + int16 i, f; + int32 xval, yval; *lab = NIL; lastlab = NIL; for (;;) { OPP_ConstExpression(&x); f = x->typ->form; - if (__IN(f, 0x18, 64)) { + if (__IN(f, 0x18, 32)) { xval = OPM_Longint(x->conval->intval); } else { OPP_err(61); @@ -1188,14 +1188,14 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int32 *n, OPP if (!(LabelTyp->form == 4) || LabelTyp->size < x->typ->size) { OPP_err(60); } - } else if (LabelTyp->form != f) { + } else if ((int16)LabelTyp->form != f) { OPP_err(60); } if (OPP_sym == 21) { OPS_Get(&OPP_sym); OPP_ConstExpression(&y); yval = OPM_Longint(y->conval->intval); - if ((y->typ->form != f && !((f == 4 && y->typ->form == 4)))) { + if (((int16)y->typ->form != f && !((f == 4 && y->typ->form == 4)))) { OPP_err(60); } if (yval < xval) { @@ -1239,7 +1239,7 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int32 *n, OPP } static struct StatSeq__30 { - int64 *pos; + int32 *pos; struct StatSeq__30 *lnk; } *StatSeq__30_s; @@ -1249,8 +1249,8 @@ static void SetPos__35 (OPT_Node x); static void CasePart__31 (OPT_Node *x) { - int32 n; - int64 low, high; + int16 n; + int32 low, high; BOOLEAN e; OPP_CaseTable tab; OPT_Node cases = NIL, lab = NIL, y = NIL, lastcase = NIL; @@ -1258,7 +1258,7 @@ static void CasePart__31 (OPT_Node *x) *StatSeq__30_s->pos = OPM_errpos; if ((*x)->class == 8 || (*x)->class == 9) { OPP_err(126); - } else if (!__IN((*x)->typ->form, 0x18, 64)) { + } else if (!__IN((*x)->typ->form, 0x18, 32)) { OPP_err(125); } OPP_CheckSym(25); @@ -1333,7 +1333,7 @@ static void OPP_StatSeq (OPT_Node *stat) OPT_Struct idtyp = NIL; BOOLEAN e; OPT_Node s = NIL, x = NIL, y = NIL, z = NIL, apar = NIL, last = NIL, lastif = NIL; - int64 pos; + int32 pos; OPS_Name name; struct StatSeq__30 _s; _s.pos = &pos; @@ -1626,7 +1626,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) OPT_Struct typ = NIL; OPT_Object obj = NIL, first = NIL, last = NIL; OPT_Node x = NIL, lastdec = NIL; - int32 i; + int16 i; first = NIL; last = NIL; OPP_nofFwdPtr = 0; @@ -1675,7 +1675,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) if (obj->typ->strobj == NIL) { obj->typ->strobj = obj; } - if (__IN(obj->typ->comp, 0x1c, 64)) { + if (__IN(obj->typ->comp, 0x1c, 32)) { i = 0; while (i < OPP_nofFwdPtr) { typ = OPP_FwdPtr[__X(i, 64)]; @@ -1779,7 +1779,7 @@ void OPP_Module (OPT_Node *prog, SET opt) { OPS_Name impName, aliasName; OPT_Node procdec = NIL, statseq = NIL; - int64 c; + int32 c; BOOLEAN done; OPS_Init(); OPP_LoopLevel = 0; @@ -1880,7 +1880,7 @@ static void EnumPtrs(void (*P)(void*)) __ENUMP(OPP_FwdPtr, 64, P); } -__TDESC(OPP__1, 1, 0) = {__TDFLDS("", 16), {-8}}; +__TDESC(OPP__1, 1, 0) = {__TDFLDS("", 8), {-8}}; export void *OPP__init(void) { diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index cd24b8ee..0cac83bd 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,8 +1,8 @@ /* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tspaSfF */ -#define INTEGER int32 -#define LONGINT int64 -#define SET uint64 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "OPM.h" @@ -16,7 +16,7 @@ typedef export OPS_Name OPS_name; export OPS_String OPS_str; -export int32 OPS_numtyp; +export int16 OPS_numtyp; export int64 OPS_intval; export REAL OPS_realval; export LONGREAL OPS_lrlval; @@ -28,17 +28,17 @@ static void OPS_Identifier (int8 *sym); export void OPS_Init (void); static void OPS_Number (void); static void OPS_Str (int8 *sym); -static void OPS_err (int32 n); +static void OPS_err (int16 n); -static void OPS_err (int32 n) +static void OPS_err (int16 n) { OPM_err(n); } static void OPS_Str (int8 *sym) { - int32 i; + int16 i; CHAR och; i = 0; och = OPS_ch; @@ -64,7 +64,7 @@ static void OPS_Str (int8 *sym) if (OPS_intval == 2) { *sym = 35; OPS_numtyp = 1; - OPS_intval = OPS_str[0]; + OPS_intval = (int16)OPS_str[0]; } else { *sym = 37; } @@ -72,7 +72,7 @@ static void OPS_Str (int8 *sym) static void OPS_Identifier (int8 *sym) { - int32 i; + int16 i; i = 0; do { OPS_name[i] = OPS_ch; @@ -91,10 +91,10 @@ static struct Number__6 { struct Number__6 *lnk; } *Number__6_s; -static int32 Ord__7 (CHAR ch, BOOLEAN hex); -static LONGREAL Ten__9 (int32 e); +static int16 Ord__7 (CHAR ch, BOOLEAN hex); +static LONGREAL Ten__9 (int16 e); -static LONGREAL Ten__9 (int32 e) +static LONGREAL Ten__9 (int16 e) { LONGREAL _o_result; LONGREAL x, p; @@ -113,14 +113,14 @@ static LONGREAL Ten__9 (int32 e) return _o_result; } -static int32 Ord__7 (CHAR ch, BOOLEAN hex) +static int16 Ord__7 (CHAR ch, BOOLEAN hex) { - int32 _o_result; + int16 _o_result; if (ch <= '9') { - _o_result = ch - 48; + _o_result = (int16)ch - 48; return _o_result; } else if (hex) { - _o_result = (ch - 65) + 10; + _o_result = ((int16)ch - 65) + 10; return _o_result; } else { OPS_err(2); @@ -132,7 +132,7 @@ static int32 Ord__7 (CHAR ch, BOOLEAN hex) static void OPS_Number (void) { - int32 i, m, n, d, e; + int16 i, m, n, d, e; CHAR dig[24]; LONGREAL f; CHAR expCh; @@ -235,7 +235,7 @@ static void OPS_Number (void) do { n = Ord__7(OPS_ch, 0); OPM_Get(&OPS_ch); - if (e <= __DIV(2147483647 - n, 10)) { + if (e <= __DIV(32767 - n, 10)) { e = e * 10 + n; } else { OPS_err(203); diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index bcc2ae4d..caef45f4 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -14,7 +14,7 @@ typedef import OPS_Name OPS_name; import OPS_String OPS_str; -import int32 OPS_numtyp; +import int16 OPS_numtyp; import int64 OPS_intval; import REAL OPS_realval; import LONGREAL OPS_lrlval; diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index 41686385..d40808d2 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,8 +1,8 @@ /* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ -#define INTEGER int32 -#define LONGINT int64 -#define SET uint64 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "OPM.h" @@ -17,15 +17,16 @@ typedef typedef struct OPT_ConstDesc { OPT_ConstExt ext; - int64 intval, intval2; + int64 intval; + int32 intval2; SET setval; LONGREAL realval; } OPT_ConstDesc; typedef struct OPT_ExpCtxt { - int64 reffp; - int32 ref; + int32 reffp; + int16 ref; int8 nofm; int8 locmno[64]; } OPT_ExpCtxt; @@ -38,12 +39,12 @@ typedef typedef struct OPT_ImpCtxt { - int64 nextTag, reffp; - int32 nofr, minr, nofm; + int32 nextTag, reffp; + int16 nofr, minr, nofm; BOOLEAN self; OPT_Struct ref[255]; OPT_Object old[255]; - int64 pvfp[255]; + int32 pvfp[255]; int8 glbmno[64]; } OPT_ImpCtxt; @@ -67,20 +68,20 @@ typedef BOOLEAN leaf; int8 mode, mnolev, vis, history; BOOLEAN used, fpdone; - int64 fprint; + int32 fprint; OPT_Struct typ; OPT_Const conval; - int64 adr, linkadr; - int32 x; + int32 adr, linkadr; + int16 x; } OPT_ObjDesc; typedef struct OPT_StrDesc { int8 form, comp, mno, extlev; - int32 ref, sysflag; - int64 n, size, align, txtpos; + int16 ref, sysflag; + int32 n, size, align, txtpos; BOOLEAN allocated, pbused, pvused, fpdone, idfpdone; - int64 idfp, pbfp, pvfp; + int32 idfp, pbfp, pvfp; OPT_Struct BaseTyp; OPT_Object link, strobj; } OPT_StrDesc; @@ -97,7 +98,7 @@ export BOOLEAN OPT_SYSimported; static OPT_Object OPT_universe, OPT_syslink; static OPT_ImpCtxt OPT_impCtxt; static OPT_ExpCtxt OPT_expCtxt; -static int64 OPT_nofhdfld; +static int32 OPT_nofhdfld; static BOOLEAN OPT_newsf, OPT_findpc, OPT_extsf, OPT_sfpresent, OPT_symExtended, OPT_symNew; export address *OPT_ConstDesc__typ; @@ -110,22 +111,22 @@ export address *OPT_ExpCtxt__typ; export void OPT_Close (void); export void OPT_CloseScope (void); static void OPT_DebugStruct (OPT_Struct btyp); -static void OPT_EnterBoolConst (OPS_Name name, int64 value); -static void OPT_EnterProc (OPS_Name name, int32 num); -static void OPT_EnterTyp (OPS_Name name, int8 form, int32 size, OPT_Struct *res); +static void OPT_EnterBoolConst (OPS_Name name, int32 value); +static void OPT_EnterProc (OPS_Name name, int16 num); +static void OPT_EnterTyp (OPS_Name name, int8 form, int16 size, OPT_Struct *res); static void OPT_EnterTypeAlias (OPS_Name name, OPT_Object *res); export void OPT_Export (BOOLEAN *ext, BOOLEAN *new); -export void OPT_FPrintErr (OPT_Object obj, int32 errcode); -static void OPT_FPrintName (int64 *fp, CHAR *name, LONGINT name__len); +export void OPT_FPrintErr (OPT_Object obj, int16 errcode); +static void OPT_FPrintName (int32 *fp, CHAR *name, LONGINT name__len); export void OPT_FPrintObj (OPT_Object obj); -static void OPT_FPrintSign (int64 *fp, OPT_Struct result, OPT_Object par); +static void OPT_FPrintSign (int32 *fp, OPT_Struct result, OPT_Object par); export void OPT_FPrintStr (OPT_Struct typ); export void OPT_Find (OPT_Object *res); export void OPT_FindField (OPS_Name name, OPT_Struct typ, OPT_Object *res); export void OPT_FindImport (OPT_Object mod, OPT_Object *res); export void OPT_IdFPrint (OPT_Struct typ); export void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); -static void OPT_InConstant (int64 f, OPT_Const conval); +static void OPT_InConstant (int32 f, OPT_Const conval); static OPT_Object OPT_InFld (void); static void OPT_InMod (int8 *mno); static void OPT_InName (CHAR *name, LONGINT name__len); @@ -133,13 +134,13 @@ static OPT_Object OPT_InObj (int8 mno); static void OPT_InSign (int8 mno, OPT_Struct *res, OPT_Object *par); static void OPT_InStruct (OPT_Struct *typ); static OPT_Object OPT_InTProc (int8 mno); -static OPT_Struct OPT_InTyp (int64 tag); +static OPT_Struct OPT_InTyp (int32 tag); export void OPT_Init (OPS_Name name, SET opt); static void OPT_InitStruct (OPT_Struct *typ, int8 form); export void OPT_Insert (OPS_Name name, OPT_Object *obj); export void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); -export int32 OPT_IntSize (int64 n); -export OPT_Struct OPT_IntType (int64 size); +export int16 OPT_IntSize (int64 n); +export OPT_Struct OPT_IntType (int32 size); export OPT_Const OPT_NewConst (void); export OPT_ConstExt OPT_NewExt (void); export OPT_Node OPT_NewNode (int8 class); @@ -147,27 +148,27 @@ export OPT_Object OPT_NewObj (void); export OPT_Struct OPT_NewStr (int8 form, int8 comp); export void OPT_OpenScope (int8 level, OPT_Object owner); static void OPT_OutConstant (OPT_Object obj); -static void OPT_OutFlds (OPT_Object fld, int64 adr, BOOLEAN visible); -static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, int64 adr); -static void OPT_OutMod (int32 mno); +static void OPT_OutFlds (OPT_Object fld, int32 adr, BOOLEAN visible); +static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, int32 adr); +static void OPT_OutMod (int16 mno); static void OPT_OutName (CHAR *name, LONGINT name__len); static void OPT_OutObj (OPT_Object obj); static void OPT_OutSign (OPT_Struct result, OPT_Object par); static void OPT_OutStr (OPT_Struct typ); static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj); -export OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int32 dir); -static void OPT_err (int32 n); +export OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir); +static void OPT_err (int16 n); -static void OPT_err (int32 n) +static void OPT_err (int16 n) { OPM_err(n); } -int32 OPT_IntSize (int64 n) +int16 OPT_IntSize (int64 n) { - int32 _o_result; - int32 bytes; + int16 _o_result; + int16 bytes; if (n < 0) { n = -(n + 1); } @@ -179,7 +180,7 @@ int32 OPT_IntSize (int64 n) return _o_result; } -OPT_Struct OPT_IntType (int64 size) +OPT_Struct OPT_IntType (int32 size) { OPT_Struct _o_result; if (size <= OPT_int8typ->size) { @@ -198,10 +199,10 @@ OPT_Struct OPT_IntType (int64 size) return _o_result; } -OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int32 dir) +OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir) { OPT_Struct _o_result; - int32 i; + int16 i; __ASSERT(x->form == 4, 0); __ASSERT(x->BaseTyp == OPT_undftyp, 0); __ASSERT(dir == 1 || dir == -1, 0); @@ -323,15 +324,15 @@ void OPT_Init (OPS_Name name, SET opt) __COPY(name, OPT_topScope->name, 256); OPT_GlbMod[0] = OPT_topScope; OPT_nofGmod = 1; - OPT_newsf = __IN(4, opt, 64); - OPT_findpc = __IN(8, opt, 64); - OPT_extsf = OPT_newsf || __IN(9, opt, 64); + OPT_newsf = __IN(4, opt, 32); + OPT_findpc = __IN(8, opt, 32); + OPT_extsf = OPT_newsf || __IN(9, opt, 32); OPT_sfpresent = 1; } void OPT_Close (void) { - int32 i; + int16 i; OPT_CloseScope(); i = 0; while (i < 64) { @@ -461,14 +462,14 @@ void OPT_Insert (OPS_Name name, OPT_Object *obj) *obj = ob1; } -static void OPT_FPrintName (int64 *fp, CHAR *name, LONGINT name__len) +static void OPT_FPrintName (int32 *fp, CHAR *name, LONGINT name__len) { - int32 i; + int16 i; CHAR ch; i = 0; do { ch = name[__X(i, name__len)]; - OPM_FPrint(&*fp, ch); + OPM_FPrint(&*fp, (int16)ch); i += 1; } while (!(ch == 0x00)); } @@ -506,7 +507,7 @@ static void OPT_DebugStruct (OPT_Struct btyp) OPM_LogWLn(); } -static void OPT_FPrintSign (int64 *fp, OPT_Struct result, OPT_Object par) +static void OPT_FPrintSign (int32 *fp, OPT_Struct result, OPT_Object par) { OPT_IdFPrint(result); OPM_FPrint(&*fp, result->idfp); @@ -522,8 +523,8 @@ void OPT_IdFPrint (OPT_Struct typ) { OPT_Struct btyp = NIL; OPT_Object strobj = NIL; - int64 idfp; - int32 f, c; + int32 idfp; + int16 f, c; if (!typ->idfpdone) { typ->idfpdone = 1; idfp = 0; @@ -552,17 +553,17 @@ void OPT_IdFPrint (OPT_Struct typ) } static struct FPrintStr__13 { - int64 *pbfp, *pvfp; + int32 *pbfp, *pvfp; struct FPrintStr__13 *lnk; } *FPrintStr__13_s; -static void FPrintFlds__14 (OPT_Object fld, int64 adr, BOOLEAN visible); -static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, int64 adr); +static void FPrintFlds__14 (OPT_Object fld, int32 adr, BOOLEAN visible); +static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, int32 adr); static void FPrintTProcs__18 (OPT_Object obj); -static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, int64 adr) +static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, int32 adr) { - int64 i, j, n; + int32 i, j, n; OPT_Struct btyp = NIL; if (typ->comp == 4) { FPrintFlds__14(typ->link, adr, 0); @@ -592,7 +593,7 @@ static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, int64 adr) } } -static void FPrintFlds__14 (OPT_Object fld, int64 adr, BOOLEAN visible) +static void FPrintFlds__14 (OPT_Object fld, int32 adr, BOOLEAN visible) { while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { @@ -627,10 +628,10 @@ static void FPrintTProcs__18 (OPT_Object obj) void OPT_FPrintStr (OPT_Struct typ) { - int32 f, c; + int16 f, c; OPT_Struct btyp = NIL; OPT_Object strobj = NIL, bstrobj = NIL; - int64 pbfp, pvfp; + int32 pbfp, pvfp; struct FPrintStr__13 _s; _s.pbfp = &pbfp; _s.pvfp = &pvfp; @@ -658,7 +659,7 @@ void OPT_FPrintStr (OPT_Struct typ) pvfp = pbfp; } } else if (f == 12) { - } else if (__IN(c, 0x0c, 64)) { + } else if (__IN(c, 0x0c, 32)) { OPT_FPrintStr(btyp); OPM_FPrint(&pbfp, btyp->pvfp); pvfp = pbfp; @@ -691,8 +692,8 @@ void OPT_FPrintStr (OPT_Struct typ) void OPT_FPrintObj (OPT_Object obj) { - int64 fprint; - int32 f, m; + int32 fprint; + int16 f, m; REAL rval; OPT_ConstExt ext = NIL; if (!obj->fpdone) { @@ -729,16 +730,16 @@ void OPT_FPrintObj (OPT_Object obj) OPM_FPrint(&fprint, obj->vis); OPT_FPrintStr(obj->typ); OPM_FPrint(&fprint, obj->typ->pbfp); - } else if (__IN(obj->mode, 0x0480, 64)) { + } else if (__IN(obj->mode, 0x0480, 32)) { OPT_FPrintSign(&fprint, obj->typ, obj->link); } else if (obj->mode == 9) { OPT_FPrintSign(&fprint, obj->typ, obj->link); ext = obj->conval->ext; - m = (*ext)[0]; + m = (int16)(*ext)[0]; f = 1; OPM_FPrint(&fprint, m); while (f <= m) { - OPM_FPrint(&fprint, (*ext)[__X(f, 256)]); + OPM_FPrint(&fprint, (int16)(*ext)[__X(f, 256)]); f += 1; } } else if (obj->mode == 5) { @@ -749,9 +750,9 @@ void OPT_FPrintObj (OPT_Object obj) } } -void OPT_FPrintErr (OPT_Object obj, int32 errcode) +void OPT_FPrintErr (OPT_Object obj, int16 errcode) { - int32 i, j; + int16 i, j; CHAR ch; if (obj->mnolev != 0) { __COPY(OPT_GlbMod[__X(-obj->mnolev, 64)]->name, OPM_objname, 64); @@ -841,7 +842,7 @@ void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old) static void OPT_InName (CHAR *name, LONGINT name__len) { - int32 i; + int16 i; CHAR ch; i = 0; do { @@ -855,7 +856,7 @@ static void OPT_InMod (int8 *mno) { OPT_Object head = NIL; OPS_Name name; - int64 mn; + int32 mn; int8 i; mn = OPM_SymRInt(); if (mn == 0) { @@ -893,16 +894,16 @@ static void OPT_InMod (int8 *mno) } } -static void OPT_InConstant (int64 f, OPT_Const conval) +static void OPT_InConstant (int32 f, OPT_Const conval) { CHAR ch; - int32 i; + int16 i; OPT_ConstExt ext = NIL; REAL rval; switch (f) { case 1: case 3: case 2: OPM_SymRCh(&ch); - conval->intval = ch; + conval->intval = (int16)ch; break; case 4: conval->intval = OPM_SymRInt(); @@ -945,7 +946,7 @@ static void OPT_InConstant (int64 f, OPT_Const conval) static void OPT_InSign (int8 mno, OPT_Struct *res, OPT_Object *par) { OPT_Object last = NIL, new = NIL; - int64 tag; + int32 tag; OPT_InStruct(&*res); tag = OPM_SymRInt(); last = NIL; @@ -973,7 +974,7 @@ static void OPT_InSign (int8 mno, OPT_Struct *res, OPT_Object *par) static OPT_Object OPT_InFld (void) { OPT_Object _o_result; - int64 tag; + int32 tag; OPT_Object obj = NIL; tag = OPT_impCtxt.nextTag; obj = OPT_NewObj(); @@ -1005,7 +1006,7 @@ static OPT_Object OPT_InFld (void) static OPT_Object OPT_InTProc (int8 mno) { OPT_Object _o_result; - int64 tag; + int32 tag; OPT_Object obj = NIL; tag = OPT_impCtxt.nextTag; obj = OPT_NewObj(); @@ -1030,7 +1031,7 @@ static OPT_Object OPT_InTProc (int8 mno) return _o_result; } -static OPT_Struct OPT_InTyp (int64 tag) +static OPT_Struct OPT_InTyp (int32 tag) { OPT_Struct _o_result; if (tag == 4) { @@ -1046,8 +1047,8 @@ static OPT_Struct OPT_InTyp (int64 tag) static void OPT_InStruct (OPT_Struct *typ) { int8 mno; - int32 ref; - int64 tag; + int16 ref; + int32 tag; OPS_Name name; OPT_Struct t = NIL; OPT_Object obj = NIL, last = NIL, fld = NIL, old = NIL, dummy = NIL; @@ -1103,7 +1104,7 @@ static void OPT_InStruct (OPT_Struct *typ) obj->vis = 0; tag = OPM_SymRInt(); if (tag == 35) { - (*typ)->sysflag = (int32)OPM_SymRInt(); + (*typ)->sysflag = (int16)OPM_SymRInt(); tag = OPM_SymRInt(); } switch (tag) { @@ -1228,11 +1229,11 @@ static void OPT_InStruct (OPT_Struct *typ) static OPT_Object OPT_InObj (int8 mno) { OPT_Object _o_result; - int32 i, s; + int16 i, s; CHAR ch; OPT_Object obj = NIL, old = NIL; OPT_Struct typ = NIL; - int64 tag; + int32 tag; OPT_ConstExt ext = NIL; tag = OPT_impCtxt.nextTag; if (tag == 19) { @@ -1265,7 +1266,7 @@ static OPT_Object OPT_InObj (int8 mno) obj->mode = 9; ext = OPT_NewExt(); obj->conval->ext = ext; - s = (int32)OPM_SymRInt(); + s = (int16)OPM_SymRInt(); (*ext)[0] = (CHAR)s; i = 1; while (i <= s) { @@ -1374,7 +1375,7 @@ void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) static void OPT_OutName (CHAR *name, LONGINT name__len) { - int32 i; + int16 i; CHAR ch; i = 0; do { @@ -1384,7 +1385,7 @@ static void OPT_OutName (CHAR *name, LONGINT name__len) } while (!(ch == 0x00)); } -static void OPT_OutMod (int32 mno) +static void OPT_OutMod (int16 mno) { if (OPT_expCtxt.locmno[__X(mno, 64)] < 0) { OPM_SymWInt(16); @@ -1396,9 +1397,9 @@ static void OPT_OutMod (int32 mno) } } -static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, int64 adr) +static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, int32 adr) { - int64 i, j, n; + int32 i, j, n; OPT_Struct btyp = NIL; if (typ->comp == 4) { OPT_OutFlds(typ->link, adr, 0); @@ -1428,7 +1429,7 @@ static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, int64 adr) } } -static void OPT_OutFlds (OPT_Object fld, int64 adr, BOOLEAN visible) +static void OPT_OutFlds (OPT_Object fld, int32 adr, BOOLEAN visible) { while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { @@ -1583,7 +1584,7 @@ static void OPT_OutStr (OPT_Struct typ) static void OPT_OutConstant (OPT_Object obj) { - int32 f; + int16 f; REAL rval; f = obj->typ->form; OPM_SymWInt(f); @@ -1618,11 +1619,11 @@ static void OPT_OutConstant (OPT_Object obj) static void OPT_OutObj (OPT_Object obj) { - int32 i, j; + int16 i, j; OPT_ConstExt ext = NIL; if (obj != NIL) { OPT_OutObj(obj->left); - if (__IN(obj->mode, 0x06ea, 64)) { + if (__IN(obj->mode, 0x06ea, 32)) { if (obj->history == 4) { OPT_FPrintErr(obj, 250); } else if (obj->vis != 0) { @@ -1685,7 +1686,7 @@ static void OPT_OutObj (OPT_Object obj) OPM_SymWInt(33); OPT_OutSign(obj->typ, obj->link); ext = obj->conval->ext; - j = (*ext)[0]; + j = (int16)(*ext)[0]; i = 1; OPM_SymWInt(j); while (i <= j) { @@ -1708,7 +1709,7 @@ static void OPT_OutObj (OPT_Object obj) void OPT_Export (BOOLEAN *ext, BOOLEAN *new) { - int32 i; + int16 i; int8 nofmod; BOOLEAN done; OPT_symExtended = 0; @@ -1732,7 +1733,7 @@ void OPT_Export (BOOLEAN *ext, BOOLEAN *new) } OPT_OutObj(OPT_topScope->right); *ext = (OPT_sfpresent && OPT_symExtended); - *new = (!OPT_sfpresent || OPT_symNew) || __IN(17, OPM_opt, 64); + *new = (!OPT_sfpresent || OPT_symNew) || __IN(17, OPM_opt, 32); if ((((OPM_noerr && OPT_sfpresent)) && OPT_impCtxt.reffp != OPT_expCtxt.reffp)) { *new = 1; if (!OPT_extsf) { @@ -1762,7 +1763,7 @@ static void OPT_InitStruct (OPT_Struct *typ, int8 form) (*typ)->idfpdone = 1; } -static void OPT_EnterBoolConst (OPS_Name name, int64 value) +static void OPT_EnterBoolConst (OPS_Name name, int32 value) { OPT_Object obj = NIL; OPS_Name name__copy; @@ -1774,7 +1775,7 @@ static void OPT_EnterBoolConst (OPS_Name name, int64 value) obj->conval->intval = value; } -static void OPT_EnterTyp (OPS_Name name, int8 form, int32 size, OPT_Struct *res) +static void OPT_EnterTyp (OPS_Name name, int8 form, int16 size, OPT_Struct *res) { OPT_Object obj = NIL; OPT_Struct typ = NIL; @@ -1809,7 +1810,7 @@ static void OPT_EnterTypeAlias (OPS_Name name, OPT_Object *res) *res = obj; } -static void OPT_EnterProc (OPS_Name name, int32 num) +static void OPT_EnterProc (OPS_Name name, int16 num) { OPT_Object obj = NIL; OPS_Name name__copy; @@ -1849,46 +1850,46 @@ static void EnumPtrs(void (*P)(void*)) __ENUMP(OPT_GlbMod, 64, P); P(OPT_universe); P(OPT_syslink); - __ENUMR(&OPT_impCtxt, OPT_ImpCtxt__typ, 6216, 1, P); + __ENUMR(&OPT_impCtxt, OPT_ImpCtxt__typ, 5184, 1, P); } -__TDESC(OPT_ConstDesc, 1, 1) = {__TDFLDS("ConstDesc", 40), {0, -16}}; -__TDESC(OPT_ObjDesc, 1, 6) = {__TDFLDS("ObjDesc", 344), {0, 8, 16, 24, 304, 312, -56}}; -__TDESC(OPT_StrDesc, 1, 3) = {__TDFLDS("StrDesc", 104), {80, 88, 96, -32}}; +__TDESC(OPT_ConstDesc, 1, 1) = {__TDFLDS("ConstDesc", 32), {0, -16}}; +__TDESC(OPT_ObjDesc, 1, 6) = {__TDFLDS("ObjDesc", 336), {0, 8, 16, 24, 304, 312, -56}}; +__TDESC(OPT_StrDesc, 1, 3) = {__TDFLDS("StrDesc", 72), {48, 56, 64, -32}}; __TDESC(OPT_NodeDesc, 1, 6) = {__TDFLDS("NodeDesc", 56), {0, 8, 16, 32, 40, 48, -56}}; -__TDESC(OPT_ImpCtxt, 1, 510) = {__TDFLDS("ImpCtxt", 6216), {32, 40, 48, 56, 64, 72, 80, 88, 96, 104, 112, 120, 128, 136, 144, 152, - 160, 168, 176, 184, 192, 200, 208, 216, 224, 232, 240, 248, 256, 264, 272, 280, - 288, 296, 304, 312, 320, 328, 336, 344, 352, 360, 368, 376, 384, 392, 400, 408, - 416, 424, 432, 440, 448, 456, 464, 472, 480, 488, 496, 504, 512, 520, 528, 536, - 544, 552, 560, 568, 576, 584, 592, 600, 608, 616, 624, 632, 640, 648, 656, 664, - 672, 680, 688, 696, 704, 712, 720, 728, 736, 744, 752, 760, 768, 776, 784, 792, - 800, 808, 816, 824, 832, 840, 848, 856, 864, 872, 880, 888, 896, 904, 912, 920, - 928, 936, 944, 952, 960, 968, 976, 984, 992, 1000, 1008, 1016, 1024, 1032, 1040, 1048, - 1056, 1064, 1072, 1080, 1088, 1096, 1104, 1112, 1120, 1128, 1136, 1144, 1152, 1160, 1168, 1176, - 1184, 1192, 1200, 1208, 1216, 1224, 1232, 1240, 1248, 1256, 1264, 1272, 1280, 1288, 1296, 1304, - 1312, 1320, 1328, 1336, 1344, 1352, 1360, 1368, 1376, 1384, 1392, 1400, 1408, 1416, 1424, 1432, - 1440, 1448, 1456, 1464, 1472, 1480, 1488, 1496, 1504, 1512, 1520, 1528, 1536, 1544, 1552, 1560, - 1568, 1576, 1584, 1592, 1600, 1608, 1616, 1624, 1632, 1640, 1648, 1656, 1664, 1672, 1680, 1688, - 1696, 1704, 1712, 1720, 1728, 1736, 1744, 1752, 1760, 1768, 1776, 1784, 1792, 1800, 1808, 1816, - 1824, 1832, 1840, 1848, 1856, 1864, 1872, 1880, 1888, 1896, 1904, 1912, 1920, 1928, 1936, 1944, - 1952, 1960, 1968, 1976, 1984, 1992, 2000, 2008, 2016, 2024, 2032, 2040, 2048, 2056, 2064, 2072, - 2080, 2088, 2096, 2104, 2112, 2120, 2128, 2136, 2144, 2152, 2160, 2168, 2176, 2184, 2192, 2200, - 2208, 2216, 2224, 2232, 2240, 2248, 2256, 2264, 2272, 2280, 2288, 2296, 2304, 2312, 2320, 2328, - 2336, 2344, 2352, 2360, 2368, 2376, 2384, 2392, 2400, 2408, 2416, 2424, 2432, 2440, 2448, 2456, - 2464, 2472, 2480, 2488, 2496, 2504, 2512, 2520, 2528, 2536, 2544, 2552, 2560, 2568, 2576, 2584, - 2592, 2600, 2608, 2616, 2624, 2632, 2640, 2648, 2656, 2664, 2672, 2680, 2688, 2696, 2704, 2712, - 2720, 2728, 2736, 2744, 2752, 2760, 2768, 2776, 2784, 2792, 2800, 2808, 2816, 2824, 2832, 2840, - 2848, 2856, 2864, 2872, 2880, 2888, 2896, 2904, 2912, 2920, 2928, 2936, 2944, 2952, 2960, 2968, - 2976, 2984, 2992, 3000, 3008, 3016, 3024, 3032, 3040, 3048, 3056, 3064, 3072, 3080, 3088, 3096, - 3104, 3112, 3120, 3128, 3136, 3144, 3152, 3160, 3168, 3176, 3184, 3192, 3200, 3208, 3216, 3224, - 3232, 3240, 3248, 3256, 3264, 3272, 3280, 3288, 3296, 3304, 3312, 3320, 3328, 3336, 3344, 3352, - 3360, 3368, 3376, 3384, 3392, 3400, 3408, 3416, 3424, 3432, 3440, 3448, 3456, 3464, 3472, 3480, - 3488, 3496, 3504, 3512, 3520, 3528, 3536, 3544, 3552, 3560, 3568, 3576, 3584, 3592, 3600, 3608, - 3616, 3624, 3632, 3640, 3648, 3656, 3664, 3672, 3680, 3688, 3696, 3704, 3712, 3720, 3728, 3736, - 3744, 3752, 3760, 3768, 3776, 3784, 3792, 3800, 3808, 3816, 3824, 3832, 3840, 3848, 3856, 3864, - 3872, 3880, 3888, 3896, 3904, 3912, 3920, 3928, 3936, 3944, 3952, 3960, 3968, 3976, 3984, 3992, - 4000, 4008, 4016, 4024, 4032, 4040, 4048, 4056, 4064, 4072, 4080, 4088, 4096, 4104, -4088}}; -__TDESC(OPT_ExpCtxt, 1, 0) = {__TDFLDS("ExpCtxt", 80), {-8}}; +__TDESC(OPT_ImpCtxt, 1, 510) = {__TDFLDS("ImpCtxt", 5184), {16, 24, 32, 40, 48, 56, 64, 72, 80, 88, 96, 104, 112, 120, 128, 136, + 144, 152, 160, 168, 176, 184, 192, 200, 208, 216, 224, 232, 240, 248, 256, 264, + 272, 280, 288, 296, 304, 312, 320, 328, 336, 344, 352, 360, 368, 376, 384, 392, + 400, 408, 416, 424, 432, 440, 448, 456, 464, 472, 480, 488, 496, 504, 512, 520, + 528, 536, 544, 552, 560, 568, 576, 584, 592, 600, 608, 616, 624, 632, 640, 648, + 656, 664, 672, 680, 688, 696, 704, 712, 720, 728, 736, 744, 752, 760, 768, 776, + 784, 792, 800, 808, 816, 824, 832, 840, 848, 856, 864, 872, 880, 888, 896, 904, + 912, 920, 928, 936, 944, 952, 960, 968, 976, 984, 992, 1000, 1008, 1016, 1024, 1032, + 1040, 1048, 1056, 1064, 1072, 1080, 1088, 1096, 1104, 1112, 1120, 1128, 1136, 1144, 1152, 1160, + 1168, 1176, 1184, 1192, 1200, 1208, 1216, 1224, 1232, 1240, 1248, 1256, 1264, 1272, 1280, 1288, + 1296, 1304, 1312, 1320, 1328, 1336, 1344, 1352, 1360, 1368, 1376, 1384, 1392, 1400, 1408, 1416, + 1424, 1432, 1440, 1448, 1456, 1464, 1472, 1480, 1488, 1496, 1504, 1512, 1520, 1528, 1536, 1544, + 1552, 1560, 1568, 1576, 1584, 1592, 1600, 1608, 1616, 1624, 1632, 1640, 1648, 1656, 1664, 1672, + 1680, 1688, 1696, 1704, 1712, 1720, 1728, 1736, 1744, 1752, 1760, 1768, 1776, 1784, 1792, 1800, + 1808, 1816, 1824, 1832, 1840, 1848, 1856, 1864, 1872, 1880, 1888, 1896, 1904, 1912, 1920, 1928, + 1936, 1944, 1952, 1960, 1968, 1976, 1984, 1992, 2000, 2008, 2016, 2024, 2032, 2040, 2048, 2056, + 2064, 2072, 2080, 2088, 2096, 2104, 2112, 2120, 2128, 2136, 2144, 2152, 2160, 2168, 2176, 2184, + 2192, 2200, 2208, 2216, 2224, 2232, 2240, 2248, 2256, 2264, 2272, 2280, 2288, 2296, 2304, 2312, + 2320, 2328, 2336, 2344, 2352, 2360, 2368, 2376, 2384, 2392, 2400, 2408, 2416, 2424, 2432, 2440, + 2448, 2456, 2464, 2472, 2480, 2488, 2496, 2504, 2512, 2520, 2528, 2536, 2544, 2552, 2560, 2568, + 2576, 2584, 2592, 2600, 2608, 2616, 2624, 2632, 2640, 2648, 2656, 2664, 2672, 2680, 2688, 2696, + 2704, 2712, 2720, 2728, 2736, 2744, 2752, 2760, 2768, 2776, 2784, 2792, 2800, 2808, 2816, 2824, + 2832, 2840, 2848, 2856, 2864, 2872, 2880, 2888, 2896, 2904, 2912, 2920, 2928, 2936, 2944, 2952, + 2960, 2968, 2976, 2984, 2992, 3000, 3008, 3016, 3024, 3032, 3040, 3048, 3056, 3064, 3072, 3080, + 3088, 3096, 3104, 3112, 3120, 3128, 3136, 3144, 3152, 3160, 3168, 3176, 3184, 3192, 3200, 3208, + 3216, 3224, 3232, 3240, 3248, 3256, 3264, 3272, 3280, 3288, 3296, 3304, 3312, 3320, 3328, 3336, + 3344, 3352, 3360, 3368, 3376, 3384, 3392, 3400, 3408, 3416, 3424, 3432, 3440, 3448, 3456, 3464, + 3472, 3480, 3488, 3496, 3504, 3512, 3520, 3528, 3536, 3544, 3552, 3560, 3568, 3576, 3584, 3592, + 3600, 3608, 3616, 3624, 3632, 3640, 3648, 3656, 3664, 3672, 3680, 3688, 3696, 3704, 3712, 3720, + 3728, 3736, 3744, 3752, 3760, 3768, 3776, 3784, 3792, 3800, 3808, 3816, 3824, 3832, 3840, 3848, + 3856, 3864, 3872, 3880, 3888, 3896, 3904, 3912, 3920, 3928, 3936, 3944, 3952, 3960, 3968, 3976, + 3984, 3992, 4000, 4008, 4016, 4024, 4032, 4040, 4048, 4056, 4064, 4072, 4080, 4088, -4088}}; +__TDESC(OPT_ExpCtxt, 1, 0) = {__TDFLDS("ExpCtxt", 72), {-8}}; export void *OPT__init(void) { diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 697eb2c9..0bd1f189 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -15,7 +15,8 @@ typedef typedef struct OPT_ConstDesc { OPT_ConstExt ext; - int64 intval, intval2; + int64 intval; + int32 intval2; SET setval; LONGREAL realval; } OPT_ConstDesc; @@ -46,20 +47,20 @@ typedef BOOLEAN leaf; int8 mode, mnolev, vis, history; BOOLEAN used, fpdone; - int64 fprint; + int32 fprint; OPT_Struct typ; OPT_Const conval; - int64 adr, linkadr; - int32 x; + int32 adr, linkadr; + int16 x; } OPT_ObjDesc; typedef struct OPT_StrDesc { int8 form, comp, mno, extlev; - int32 ref, sysflag; - int64 n, size, align, txtpos; + int16 ref, sysflag; + int32 n, size, align, txtpos; BOOLEAN allocated, pbused, pvused; - char _prvt0[24]; + char _prvt0[16]; OPT_Struct BaseTyp; OPT_Object link, strobj; } OPT_StrDesc; @@ -82,7 +83,7 @@ import address *OPT_NodeDesc__typ; import void OPT_Close (void); import void OPT_CloseScope (void); import void OPT_Export (BOOLEAN *ext, BOOLEAN *new); -import void OPT_FPrintErr (OPT_Object obj, int32 errcode); +import void OPT_FPrintErr (OPT_Object obj, int16 errcode); import void OPT_FPrintObj (OPT_Object obj); import void OPT_FPrintStr (OPT_Struct typ); import void OPT_Find (OPT_Object *res); @@ -93,15 +94,15 @@ import void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); import void OPT_Init (OPS_Name name, SET opt); import void OPT_Insert (OPS_Name name, OPT_Object *obj); import void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); -import int32 OPT_IntSize (int64 n); -import OPT_Struct OPT_IntType (int64 size); +import int16 OPT_IntSize (int64 n); +import OPT_Struct OPT_IntType (int32 size); import OPT_Const OPT_NewConst (void); import OPT_ConstExt OPT_NewExt (void); import OPT_Node OPT_NewNode (int8 class); import OPT_Object OPT_NewObj (void); import OPT_Struct OPT_NewStr (int8 form, int8 comp); import void OPT_OpenScope (int8 level, OPT_Object owner); -import OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int32 dir); +import OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir); import void *OPT__init(void); diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index b57b2868..8ef2c450 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,8 +1,8 @@ /* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ -#define INTEGER int32 -#define LONGINT int64 -#define SET uint64 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "OPC.h" @@ -12,51 +12,51 @@ typedef struct OPV_ExitInfo { - int32 level, label; + int16 level, label; } OPV_ExitInfo; -static int32 OPV_stamp; -static int64 OPV_recno; +static int16 OPV_stamp; +static int32 OPV_recno; static OPV_ExitInfo OPV_exit; -static int32 OPV_nofExitLabels; +static int16 OPV_nofExitLabels; export address *OPV_ExitInfo__typ; static void OPV_ActualPar (OPT_Node n, OPT_Object fp); export void OPV_AdrAndSize (OPT_Object topScope); static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc); -static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int32 prec); +static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int16 prec); static void OPV_DefineTDescs (OPT_Node n); -static void OPV_Entier (OPT_Node n, int32 prec); +static void OPV_Entier (OPT_Node n, int16 prec); static void OPV_GetTProcNum (OPT_Object obj); static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc); static BOOLEAN OPV_ImplicitReturn (OPT_Node n); -static void OPV_Index (OPT_Node n, OPT_Node d, int32 prec, int32 dim); +static void OPV_Index (OPT_Node n, OPT_Node d, int16 prec, int16 dim); export void OPV_Init (void); static void OPV_InitTDescs (OPT_Node n); static void OPV_Len (OPT_Node n, int64 dim); export void OPV_Module (OPT_Node prog); static void OPV_NewArr (OPT_Node d, OPT_Node x); -static void OPV_ParIntLiteral (int64 n, int64 size); -static int32 OPV_Precedence (int32 class, int32 subclass, int32 form, int32 comp); +static void OPV_ParIntLiteral (int64 n, int32 size); +static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp); static BOOLEAN OPV_SideEffects (OPT_Node n); -static void OPV_SizeCast (int64 from, int64 to); +static void OPV_SizeCast (int32 from, int32 to); static void OPV_Stamp (OPS_Name s); static OPT_Object OPV_SuperProc (OPT_Node n); static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported); static void OPV_TraverseRecord (OPT_Struct typ); export void OPV_TypSize (OPT_Struct typ); static void OPV_TypeOf (OPT_Node n); -static void OPV_design (OPT_Node n, int32 prec); -static void OPV_expr (OPT_Node n, int32 prec); +static void OPV_design (OPT_Node n, int16 prec); +static void OPV_expr (OPT_Node n, int16 prec); static void OPV_stat (OPT_Node n, OPT_Object outerProc); void OPV_TypSize (OPT_Struct typ) { - int32 f, c; - int64 offset, size, base, fbase, off0; + int16 f, c; + int32 offset, size, base, fbase, off0; OPT_Object fld = NIL; OPT_Struct btyp = NIL; if (typ == OPT_undftyp) { @@ -71,7 +71,7 @@ void OPV_TypSize (OPT_Struct typ) base = 1; } else { OPV_TypSize(btyp); - offset = btyp->size - (int64)__ASHR(btyp->sysflag, 8); + offset = btyp->size - __ASHR(btyp->sysflag, 8); base = btyp->align; } fld = typ->link; @@ -99,7 +99,7 @@ void OPV_TypSize (OPT_Struct typ) } typ->size = offset; typ->align = base; - typ->sysflag = __MASK(typ->sysflag, -256) + (int32)__ASHL(offset - off0, 8); + typ->sysflag = __MASK(typ->sysflag, -256) + (int16)__ASHL(offset - off0, 8); } else if (c == 2) { OPV_TypSize(typ->BaseTyp); typ->size = typ->n * typ->BaseTyp->size; @@ -133,7 +133,7 @@ void OPV_Init (void) static void OPV_GetTProcNum (OPT_Object obj) { - int64 oldPos; + int32 oldPos; OPT_Struct typ = NIL; OPT_Object redef = NIL; oldPos = OPM_errpos; @@ -145,7 +145,7 @@ static void OPV_GetTProcNum (OPT_Object obj) OPT_FindField(obj->name, typ->BaseTyp, &redef); if (redef != NIL) { obj->adr = __ASHL(__ASHR(redef->adr, 16), 16); - if (!__IN(2, obj->conval->setval, 64)) { + if (!__IN(2, obj->conval->setval, 32)) { OPM_err(119); } } else { @@ -169,7 +169,7 @@ static void OPV_TraverseRecord (OPT_Struct typ) static void OPV_Stamp (OPS_Name s) { - int32 i, j, k; + int16 i, j, k; CHAR n[10]; OPV_stamp += 1; i = 0; @@ -199,7 +199,7 @@ static void OPV_Stamp (OPS_Name s) static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported) { - int32 mode; + int16 mode; OPT_Object scope = NIL; OPT_Struct typ = NIL; if (obj != NIL) { @@ -225,12 +225,12 @@ static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exporte OPV_TypSize(obj->typ); } if (!exported) { - if ((__IN(mode, 0x60, 64) && obj->mnolev > 0)) { + if ((__IN(mode, 0x60, 32) && obj->mnolev > 0)) { OPV_Stamp(obj->name); } - if (__IN(mode, 0x26, 64)) { + if (__IN(mode, 0x26, 32)) { obj->scope = outerScope; - } else if (__IN(mode, 0x26c0, 64)) { + } else if (__IN(mode, 0x26c0, 32)) { if (obj->conval->setval == 0x0) { OPM_err(129); } @@ -275,9 +275,9 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_sysptrtyp->strobj->linkadr = 2; } -static int32 OPV_Precedence (int32 class, int32 subclass, int32 form, int32 comp) +static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp) { - int32 _o_result; + int16 _o_result; switch (class) { case 7: case 0: case 2: case 4: case 9: case 13: @@ -285,7 +285,7 @@ static int32 OPV_Precedence (int32 class, int32 subclass, int32 form, int32 comp return _o_result; break; case 5: - if (__IN(3, OPM_opt, 64)) { + if (__IN(3, OPM_opt, 32)) { _o_result = 10; return _o_result; } else { @@ -294,7 +294,7 @@ static int32 OPV_Precedence (int32 class, int32 subclass, int32 form, int32 comp } break; case 1: - if (__IN(comp, 0x0c, 64)) { + if (__IN(comp, 0x0c, 32)) { _o_result = 10; return _o_result; } else { @@ -439,9 +439,9 @@ static BOOLEAN OPV_SideEffects (OPT_Node n) __RETCHK; } -static void OPV_Entier (OPT_Node n, int32 prec) +static void OPV_Entier (OPT_Node n, int16 prec) { - if (__IN(n->typ->form, 0x60, 64)) { + if (__IN(n->typ->form, 0x60, 32)) { OPM_WriteString((CHAR*)"__ENTIER(", 10); OPV_expr(n, -1); OPM_Write(')'); @@ -450,7 +450,7 @@ static void OPV_Entier (OPT_Node n, int32 prec) } } -static void OPV_SizeCast (int64 from, int64 to) +static void OPV_SizeCast (int32 from, int32 to) { if ((from != to && (from > 4 || to != 4))) { OPM_WriteString((CHAR*)"(int", 5); @@ -459,9 +459,9 @@ static void OPV_SizeCast (int64 from, int64 to) } } -static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int32 prec) +static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int16 prec) { - int32 from, to; + int16 from, to; from = n->typ->form; to = newtype->form; if (to == 7) { @@ -471,7 +471,7 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int32 prec) OPM_WriteInt(__ASHL(newtype->size, 3)); OPM_Write(')'); } else if (to == 4) { - if ((newtype->size < n->typ->size && __IN(2, OPM_opt, 64))) { + if ((newtype->size < n->typ->size && __IN(2, OPM_opt, 32))) { OPM_WriteString((CHAR*)"__SHORT", 8); if (OPV_SideEffects(n)) { OPM_Write('F'); @@ -486,7 +486,7 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int32 prec) OPV_Entier(n, 9); } } else if (to == 3) { - if (__IN(2, OPM_opt, 64)) { + if (__IN(2, OPM_opt, 32)) { OPM_WriteString((CHAR*)"__CHR", 6); if (OPV_SideEffects(n)) { OPM_Write('F'); @@ -509,7 +509,7 @@ static void OPV_TypeOf (OPT_Node n) OPM_WriteString((CHAR*)"__TYPEOF(", 10); OPV_expr(n, -1); OPM_Write(')'); - } else if (__IN(n->class, 0x15, 64)) { + } else if (__IN(n->class, 0x15, 32)) { OPC_Andent(n->typ); OPM_WriteString((CHAR*)"__typ", 6); } else if (n->class == 3) { @@ -525,9 +525,9 @@ static void OPV_TypeOf (OPT_Node n) } } -static void OPV_Index (OPT_Node n, OPT_Node d, int32 prec, int32 dim) +static void OPV_Index (OPT_Node n, OPT_Node d, int16 prec, int16 dim) { - if (!__IN(0, OPM_opt, 64) || (n->right->class == 7 && (n->right->conval->intval == 0 || n->left->typ->comp != 3))) { + if (!__IN(0, OPM_opt, 32) || (n->right->class == 7 && (n->right->conval->intval == 0 || n->left->typ->comp != 3))) { OPV_expr(n->right, prec); } else { if (OPV_SideEffects(n->right)) { @@ -542,18 +542,18 @@ static void OPV_Index (OPT_Node n, OPT_Node d, int32 prec, int32 dim) } } -static void OPV_design (OPT_Node n, int32 prec) +static void OPV_design (OPT_Node n, int16 prec) { OPT_Object obj = NIL; OPT_Struct typ = NIL; - int32 class, designPrec, comp; + int16 class, designPrec, comp; OPT_Node d = NIL, x = NIL; - int32 dims, i, _for__27; + int16 dims, i, _for__27; comp = n->typ->comp; obj = n->obj; class = n->class; designPrec = OPV_Precedence(class, n->subcl, n->typ->form, comp); - if ((((((class == 0 && obj->mnolev > 0)) && obj->mnolev != OPM_level)) && prec == 10)) { + if ((((((class == 0 && obj->mnolev > 0)) && (int16)obj->mnolev != OPM_level)) && prec == 10)) { designPrec = 9; } if (prec > designPrec) { @@ -570,7 +570,7 @@ static void OPV_design (OPT_Node n, int32 prec) OPC_CompleteIdent(n->obj); break; case 1: - if (!__IN(comp, 0x0c, 64)) { + if (!__IN(comp, 0x0c, 32)) { OPM_Write('*'); } OPC_CompleteIdent(n->obj); @@ -632,7 +632,7 @@ static void OPV_design (OPT_Node n, int32 prec) } if (n->typ->comp == 3) { OPM_Write(')'); - while ((int64)i < __ASHR(d->typ->size - 4, 2)) { + while (i < __ASHR(d->typ->size - 4, 2)) { OPM_WriteString((CHAR*)" * ", 4); OPV_Len(d, i); i += 1; @@ -649,10 +649,10 @@ static void OPV_design (OPT_Node n, int32 prec) case 5: typ = n->typ; obj = n->left->obj; - if (__IN(3, OPM_opt, 64)) { + if (__IN(3, OPM_opt, 32)) { if (typ->comp == 4) { OPM_WriteString((CHAR*)"__GUARDR(", 10); - if (obj->mnolev != OPM_level) { + if ((int16)obj->mnolev != OPM_level) { OPM_WriteStringVar((void*)obj->scope->name, 256); OPM_WriteString((CHAR*)"__curr->", 9); OPC_Ident(obj); @@ -688,7 +688,7 @@ static void OPV_design (OPT_Node n, int32 prec) } break; case 6: - if (__IN(3, OPM_opt, 64)) { + if (__IN(3, OPM_opt, 32)) { if (n->left->class == 1) { OPM_WriteString((CHAR*)"__GUARDEQR(", 12); OPC_CompleteIdent(n->left->obj); @@ -721,7 +721,7 @@ static void OPV_design (OPT_Node n, int32 prec) } } -static void OPV_ParIntLiteral (int64 n, int64 size) +static void OPV_ParIntLiteral (int64 n, int32 size) { OPM_WriteInt(n); } @@ -729,7 +729,7 @@ static void OPV_ParIntLiteral (int64 n, int64 size) static void OPV_ActualPar (OPT_Node n, OPT_Object fp) { OPT_Struct typ = NIL, aptyp = NIL; - int32 comp, form, mode, prec, dim; + int16 comp, form, mode, prec, dim; OPM_Write('('); while (n != NIL) { typ = fp->typ; @@ -743,7 +743,7 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) OPM_WriteString((CHAR*)"*)", 3); prec = 10; } - if (!__IN(n->typ->comp, 0x0c, 64)) { + if (!__IN(n->typ->comp, 0x0c, 32)) { if (mode == 2) { if (typ != n->typ) { OPM_WriteString((CHAR*)"(void*)", 8); @@ -751,7 +751,7 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) OPM_Write('&'); prec = 9; } else { - if ((__IN(comp, 0x0c, 64) && n->class == 7)) { + if ((__IN(comp, 0x0c, 32) && n->class == 7)) { OPM_WriteString((CHAR*)"(CHAR*)", 8); } else if ((((form == 11 && typ != n->typ)) && n->typ != OPT_niltyp)) { OPM_WriteString((CHAR*)"(void*)", 8); @@ -821,9 +821,9 @@ static OPT_Object OPV_SuperProc (OPT_Node n) return _o_result; } -static void OPV_expr (OPT_Node n, int32 prec) +static void OPV_expr (OPT_Node n, int16 prec) { - int32 class, subclass, form, exprPrec; + int16 class, subclass, form, exprPrec; OPT_Struct typ = NIL; OPT_Node l = NIL, r = NIL; OPT_Object proc = NIL; @@ -833,7 +833,7 @@ static void OPV_expr (OPT_Node n, int32 prec) l = n->left; r = n->right; exprPrec = OPV_Precedence(class, subclass, form, n->typ->comp); - if ((exprPrec <= prec && __IN(class, 0x3ce0, 64))) { + if ((exprPrec <= prec && __IN(class, 0x3ce0, 32))) { OPM_Write('('); } switch (class) { @@ -913,18 +913,18 @@ static void OPV_expr (OPT_Node n, int32 prec) if (l->class == 1) { OPC_CompleteIdent(l->obj); } else { - if ((l->typ->form != 8 && !__IN(l->typ->comp, 0x0c, 64))) { + if ((l->typ->form != 8 && !__IN(l->typ->comp, 0x0c, 32))) { OPM_Write('&'); } OPV_expr(l, exprPrec); } break; case 29: - if (!__IN(l->class, 0x17, 64) || (((__IN(n->typ->form, 0x1890, 64) && __IN(l->typ->form, 0x1890, 64))) && n->typ->size == l->typ->size)) { + if (!__IN(l->class, 0x17, 32) || (((__IN(n->typ->form, 0x1890, 32) && __IN(l->typ->form, 0x1890, 32))) && n->typ->size == l->typ->size)) { OPM_Write('('); OPC_Ident(n->typ->strobj); OPM_Write(')'); - if (__IN(n->typ->form, 0x1800, 64) || __IN(l->typ->form, 0x1800, 64)) { + if (__IN(n->typ->form, 0x1800, 32) || __IN(l->typ->form, 0x1800, 32)) { OPM_WriteString((CHAR*)"(address)", 10); } OPV_expr(l, exprPrec); @@ -1021,12 +1021,12 @@ static void OPV_expr (OPT_Node n, int32 prec) } OPV_expr(l, -1); OPM_WriteString((CHAR*)", ", 3); - if ((((__IN(subclass, 0x18020000, 64) && r->class == 7)) && r->conval->intval < 0)) { + if ((((__IN(subclass, 0x18020000, 32) && r->class == 7)) && r->conval->intval < 0)) { OPM_WriteInt(-r->conval->intval); } else { OPV_expr(r, -1); } - if (__IN(subclass, 0x18008000, 64)) { + if (__IN(subclass, 0x18008000, 32)) { OPM_WriteString((CHAR*)", ", 3); if (subclass == 15) { OPM_WriteInt(__ASHL(r->typ->size, 3)); @@ -1038,7 +1038,7 @@ static void OPV_expr (OPT_Node n, int32 prec) break; case 9: case 10: case 11: case 12: case 13: case 14: - if (__IN(l->typ->form, 0x2100, 64)) { + if (__IN(l->typ->form, 0x2100, 32)) { OPM_WriteString((CHAR*)"__STRCMP(", 10); OPV_expr(l, -1); OPM_WriteString((CHAR*)", ", 3); @@ -1135,7 +1135,7 @@ static void OPV_expr (OPT_Node n, int32 prec) OPV_design(n, prec); break; } - if ((exprPrec <= prec && __IN(class, 0x3ca0, 64))) { + if ((exprPrec <= prec && __IN(class, 0x3ca0, 32))) { OPM_Write(')'); } } @@ -1145,7 +1145,7 @@ static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) OPT_Node if_ = NIL; OPT_Object obj = NIL; OPT_Struct typ = NIL; - int64 adr; + int32 adr; if_ = n->left; while (if_ != NIL) { OPM_WriteString((CHAR*)"if ", 4); @@ -1196,7 +1196,7 @@ static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc) { OPT_Node switchCase = NIL, label = NIL; int64 low, high; - int32 form, i; + int16 form, i; OPM_WriteString((CHAR*)"switch ", 8); OPV_expr(n->left, 12); OPM_Write(' '); @@ -1263,7 +1263,7 @@ static BOOLEAN OPV_ImplicitReturn (OPT_Node n) static void OPV_NewArr (OPT_Node d, OPT_Node x) { OPT_Struct typ = NIL, base = NIL; - int32 nofdim, nofdyn; + int16 nofdim, nofdyn; typ = d->typ->BaseTyp; base = typ; nofdim = 0; @@ -1425,7 +1425,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPM_WriteString((CHAR*)", ", 3); OPC_Andent(n->left->typ->BaseTyp); OPM_WriteString((CHAR*)")", 2); - } else if (__IN(n->left->typ->BaseTyp->comp, 0x0c, 64)) { + } else if (__IN(n->left->typ->BaseTyp->comp, 0x0c, 32)) { OPV_NewArr(n->left, n->right); } break; @@ -1516,7 +1516,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) case 20: if (n->subcl != 32) { OPV_IfStat(n, 0, outerProc); - } else if (__IN(7, OPM_opt, 64)) { + } else if (__IN(7, OPM_opt, 32)) { OPM_WriteString((CHAR*)"__ASSERT(", 10); OPV_expr(n->left->left->left, -1); OPM_WriteString((CHAR*)", ", 3); @@ -1582,7 +1582,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) break; case 26: if (OPM_level == 0) { - if (__IN(10, OPM_opt, 64)) { + if (__IN(10, OPM_opt, 32)) { OPM_WriteString((CHAR*)"__FINI", 7); } else { OPM_WriteString((CHAR*)"__ENDMOD", 9); @@ -1618,7 +1618,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPM_LogWLn(); break; } - if (!__IN(n->class, 0x09744000, 64)) { + if (!__IN(n->class, 0x09744000, 32)) { OPC_EndStat(); } n = n->link; @@ -1627,7 +1627,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) void OPV_Module (OPT_Node prog) { - if (!__IN(10, OPM_opt, 64)) { + if (!__IN(10, OPM_opt, 32)) { OPC_GenHdr(prog->right); OPC_GenHdrIncludes(); } @@ -1635,7 +1635,7 @@ void OPV_Module (OPT_Node prog) OPV_stat(prog, NIL); } -__TDESC(OPV_ExitInfo, 1, 0) = {__TDFLDS("ExitInfo", 8), {-8}}; +__TDESC(OPV_ExitInfo, 1, 0) = {__TDFLDS("ExitInfo", 4), {-8}}; export void *OPV__init(void) { diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 27df644a..016d1d64 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,8 +1,8 @@ /* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ -#define INTEGER int32 -#define LONGINT int64 -#define SET uint64 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" @@ -20,84 +20,84 @@ typedef typedef struct Platform_FileIdentity { - int64 volume, index, mtime; + int32 volume, index, mtime; } Platform_FileIdentity; typedef - void (*Platform_HaltProcedure)(int64); + void (*Platform_HaltProcedure)(int32); typedef - void (*Platform_SignalHandler)(int32); + void (*Platform_SignalHandler)(int16); export BOOLEAN Platform_LittleEndian; export address Platform_MainStackFrame; -export int64 Platform_HaltCode; -export int32 Platform_PID; +export int32 Platform_HaltCode; +export int16 Platform_PID; export CHAR Platform_CWD[256]; -export int32 Platform_ArgCount; +export int16 Platform_ArgCount; export address Platform_ArgVector; static Platform_HaltProcedure Platform_HaltHandler; -static int64 Platform_TimeStart; -export int32 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; +static int32 Platform_TimeStart; +export int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; export CHAR Platform_nl[3]; export address *Platform_FileIdentity__typ; -export BOOLEAN Platform_Absent (int32 e); -export int32 Platform_ArgPos (CHAR *s, LONGINT s__len); -export void Platform_AssertFail (int64 code); -export int32 Platform_Chdir (CHAR *n, LONGINT n__len); -export int32 Platform_Close (int64 h); -export BOOLEAN Platform_ConnectionFailed (int32 e); -export void Platform_Delay (int64 ms); -export BOOLEAN Platform_DifferentFilesystems (int32 e); -static void Platform_DisplayHaltCode (int64 code); -export int32 Platform_Error (void); -export void Platform_Exit (int32 code); -export void Platform_GetArg (int32 n, CHAR *val, LONGINT val__len); -export void Platform_GetClock (int64 *t, int64 *d); +export BOOLEAN Platform_Absent (int16 e); +export int16 Platform_ArgPos (CHAR *s, LONGINT s__len); +export void Platform_AssertFail (int32 code); +export int16 Platform_Chdir (CHAR *n, LONGINT n__len); +export int16 Platform_Close (int32 h); +export BOOLEAN Platform_ConnectionFailed (int16 e); +export void Platform_Delay (int32 ms); +export BOOLEAN Platform_DifferentFilesystems (int16 e); +static void Platform_DisplayHaltCode (int32 code); +export int16 Platform_Error (void); +export void Platform_Exit (int16 code); +export void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len); +export void Platform_GetClock (int32 *t, int32 *d); export void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); -export void Platform_GetIntArg (int32 n, int64 *val); -export void Platform_GetTimeOfDay (int64 *sec, int64 *usec); -export void Platform_Halt (int64 code); -export int32 Platform_Identify (int64 h, Platform_FileIdentity *identity, address *identity__typ); -export int32 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); -export BOOLEAN Platform_Inaccessible (int32 e); -export void Platform_Init (int32 argc, address argvadr); -export void Platform_MTimeAsClock (Platform_FileIdentity i, int64 *t, int64 *d); -export int32 Platform_New (CHAR *n, LONGINT n__len, int64 *h); -export BOOLEAN Platform_NoSuchDirectory (int32 e); +export void Platform_GetIntArg (int16 n, int32 *val); +export void Platform_GetTimeOfDay (int32 *sec, int32 *usec); +export void Platform_Halt (int32 code); +export int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ); +export int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); +export BOOLEAN Platform_Inaccessible (int16 e); +export void Platform_Init (int16 argc, address argvadr); +export void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); +export int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); +export BOOLEAN Platform_NoSuchDirectory (int16 e); export address Platform_OSAllocate (address size); export void Platform_OSFree (address address); -export int32 Platform_OldRO (CHAR *n, LONGINT n__len, int64 *h); -export int32 Platform_OldRW (CHAR *n, LONGINT n__len, int64 *h); -export int32 Platform_Read (int64 h, address p, int64 l, int64 *n); -export int32 Platform_ReadBuf (int64 h, SYSTEM_BYTE *b, LONGINT b__len, int64 *n); -export int32 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); +export int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); +export int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); +export int16 Platform_Read (int32 h, address p, int32 l, int32 *n); +export int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n); +export int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); export BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); export BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); -export int32 Platform_Seek (int64 h, int64 offset, int32 whence); +export int16 Platform_Seek (int32 h, int32 offset, int16 whence); export void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); export void Platform_SetHalt (Platform_HaltProcedure p); export void Platform_SetInterruptHandler (Platform_SignalHandler handler); export void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Platform_FileIdentity source); export void Platform_SetQuitHandler (Platform_SignalHandler handler); -export int32 Platform_Size (int64 h, int64 *l); -export int32 Platform_Sync (int64 h); -export int32 Platform_System (CHAR *cmd, LONGINT cmd__len); +export int16 Platform_Size (int32 h, int32 *l); +export int16 Platform_Sync (int32 h); +export int16 Platform_System (CHAR *cmd, LONGINT cmd__len); static void Platform_TestLittleEndian (void); -export int64 Platform_Time (void); -export BOOLEAN Platform_TimedOut (int32 e); -export BOOLEAN Platform_TooManyFiles (int32 e); -export int32 Platform_Truncate (int64 h, int64 l); -export int32 Platform_Unlink (CHAR *n, LONGINT n__len); -export int32 Platform_Write (int64 h, address p, address l); -static void Platform_YMDHMStoClock (int64 ye, int64 mo, int64 da, int64 ho, int64 mi, int64 se, int64 *t, int64 *d); +export int32 Platform_Time (void); +export BOOLEAN Platform_TimedOut (int16 e); +export BOOLEAN Platform_TooManyFiles (int16 e); +export int16 Platform_Truncate (int32 h, int32 l); +export int16 Platform_Unlink (CHAR *n, LONGINT n__len); +export int16 Platform_Write (int32 h, address p, int32 l); +static void Platform_YMDHMStoClock (int32 ye, int32 mo, int32 da, int32 ho, int32 mi, int32 se, int32 *t, int32 *d); static void Platform_errch (CHAR c); -static void Platform_errint (int64 l); +static void Platform_errint (int32 l); static void Platform_errln (void); -static void Platform_errposint (int64 l); +static void Platform_errposint (int32 l); export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); #include @@ -144,7 +144,7 @@ extern void Heap_InitHeap(); #define Platform_opennew(n, n__len) open((char*)n, O_CREAT | O_TRUNC | O_RDWR, 0664) #define Platform_openro(n, n__len) open((char*)n, O_RDONLY) #define Platform_openrw(n, n__len) open((char*)n, O_RDWR) -#define Platform_readfile(fd, p, l) read(fd, (void*)(address)(p), l) +#define Platform_readfile(fd, p, l) (LONGINT)read(fd, (void*)(address)(p), l) #define Platform_rename(o, o__len, n, n__len) rename((char*)o, (char*)n) #define Platform_sectotm(s) struct tm *time = localtime((time_t*)&s) #define Platform_seekcur() SEEK_CUR @@ -169,49 +169,49 @@ extern void Heap_InitHeap(); #define Platform_unlink(n, n__len) unlink((char*)n) #define Platform_writefile(fd, p, l) write(fd, (void*)(address)(p), l) -BOOLEAN Platform_TooManyFiles (int32 e) +BOOLEAN Platform_TooManyFiles (int16 e) { BOOLEAN _o_result; _o_result = e == Platform_EMFILE() || e == Platform_ENFILE(); return _o_result; } -BOOLEAN Platform_NoSuchDirectory (int32 e) +BOOLEAN Platform_NoSuchDirectory (int16 e) { BOOLEAN _o_result; _o_result = e == Platform_ENOENT(); return _o_result; } -BOOLEAN Platform_DifferentFilesystems (int32 e) +BOOLEAN Platform_DifferentFilesystems (int16 e) { BOOLEAN _o_result; _o_result = e == Platform_EXDEV(); return _o_result; } -BOOLEAN Platform_Inaccessible (int32 e) +BOOLEAN Platform_Inaccessible (int16 e) { BOOLEAN _o_result; _o_result = (e == Platform_EACCES() || e == Platform_EROFS()) || e == Platform_EAGAIN(); return _o_result; } -BOOLEAN Platform_Absent (int32 e) +BOOLEAN Platform_Absent (int16 e) { BOOLEAN _o_result; _o_result = e == Platform_ENOENT(); return _o_result; } -BOOLEAN Platform_TimedOut (int32 e) +BOOLEAN Platform_TimedOut (int16 e) { BOOLEAN _o_result; _o_result = e == Platform_ETIMEDOUT(); return _o_result; } -BOOLEAN Platform_ConnectionFailed (int32 e) +BOOLEAN Platform_ConnectionFailed (int16 e) { BOOLEAN _o_result; _o_result = ((e == Platform_ECONNREFUSED() || e == Platform_ECONNABORTED()) || e == Platform_ENETUNREACH()) || e == Platform_EHOSTUNREACH(); @@ -230,7 +230,7 @@ void Platform_OSFree (address address) Platform_free(address); } -void Platform_Init (int32 argc, address argvadr) +void Platform_Init (int16 argc, address argvadr) { Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; @@ -264,7 +264,7 @@ void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len) __DEL(var); } -void Platform_GetArg (int32 n, CHAR *val, LONGINT val__len) +void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { @@ -273,10 +273,10 @@ void Platform_GetArg (int32 n, CHAR *val, LONGINT val__len) } } -void Platform_GetIntArg (int32 n, int64 *val) +void Platform_GetIntArg (int16 n, int32 *val) { CHAR s[64]; - int64 k, d, i; + int32 k, d, i; s[0] = 0x00; Platform_GetArg(n, (void*)s, 64); i = 0; @@ -284,11 +284,11 @@ void Platform_GetIntArg (int32 n, int64 *val) i = 1; } k = 0; - d = s[__X(i, 64)] - 48; + d = (int16)s[__X(i, 64)] - 48; while ((d >= 0 && d <= 9)) { k = k * 10 + d; i += 1; - d = s[__X(i, 64)] - 48; + d = (int16)s[__X(i, 64)] - 48; } if (s[0] == '-') { k = -k; @@ -299,10 +299,10 @@ void Platform_GetIntArg (int32 n, int64 *val) } } -int32 Platform_ArgPos (CHAR *s, LONGINT s__len) +int16 Platform_ArgPos (CHAR *s, LONGINT s__len) { - int32 _o_result; - int32 i; + int16 _o_result; + int16 i; CHAR arg[256]; __DUP(s, s__len, CHAR); i = 0; @@ -331,64 +331,64 @@ void Platform_SetBadInstructionHandler (Platform_SignalHandler handler) Platform_sethandler(4, handler); } -static void Platform_YMDHMStoClock (int64 ye, int64 mo, int64 da, int64 ho, int64 mi, int64 se, int64 *t, int64 *d) +static void Platform_YMDHMStoClock (int32 ye, int32 mo, int32 da, int32 ho, int32 mi, int32 se, int32 *t, int32 *d) { - *d = (__ASHL(__MOD(ye, 100), 9) + __ASHL(mo + 1, 5)) + da; + *d = (__ASHL((int)__MOD(ye, 100), 9) + __ASHL(mo + 1, 5)) + da; *t = (__ASHL(ho, 12) + __ASHL(mi, 6)) + se; } -void Platform_GetClock (int64 *t, int64 *d) +void Platform_GetClock (int32 *t, int32 *d) { Platform_gettimeval(); Platform_sectotm(Platform_tvsec()); Platform_YMDHMStoClock(Platform_tmyear(), Platform_tmmon(), Platform_tmmday(), Platform_tmhour(), Platform_tmmin(), Platform_tmsec(), &*t, &*d); } -void Platform_GetTimeOfDay (int64 *sec, int64 *usec) +void Platform_GetTimeOfDay (int32 *sec, int32 *usec) { Platform_gettimeval(); *sec = Platform_tvsec(); *usec = Platform_tvusec(); } -int64 Platform_Time (void) +int32 Platform_Time (void) { - int64 _o_result; - int64 ms; + int32 _o_result; + int32 ms; Platform_gettimeval(); - ms = __DIVF(Platform_tvusec(), 1000) + Platform_tvsec() * 1000; - _o_result = __MOD(ms - Platform_TimeStart, 2147483647); + ms = (int)__DIVF(Platform_tvusec(), 1000) + Platform_tvsec() * 1000; + _o_result = (int)__MOD(ms - Platform_TimeStart, 2147483647); return _o_result; } -void Platform_Delay (int64 ms) +void Platform_Delay (int32 ms) { - int64 s, ns; + int32 s, ns; s = __DIV(ms, 1000); - ns = __MOD(ms, 1000) * 1000000; + ns = (int)__MOD(ms, 1000) * 1000000; Platform_nanosleep(s, ns); } -int32 Platform_System (CHAR *cmd, LONGINT cmd__len) +int16 Platform_System (CHAR *cmd, LONGINT cmd__len) { - int32 _o_result; + int16 _o_result; __DUP(cmd, cmd__len, CHAR); _o_result = Platform_system(cmd, cmd__len); __DEL(cmd); return _o_result; } -int32 Platform_Error (void) +int16 Platform_Error (void) { - int32 _o_result; + int16 _o_result; _o_result = Platform_err(); return _o_result; } -int32 Platform_OldRO (CHAR *n, LONGINT n__len, int64 *h) +int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h) { - int32 _o_result; - int32 fd; + int16 _o_result; + int16 fd; fd = Platform_openro(n, n__len); if (fd < 0) { _o_result = Platform_err(); @@ -401,10 +401,10 @@ int32 Platform_OldRO (CHAR *n, LONGINT n__len, int64 *h) __RETCHK; } -int32 Platform_OldRW (CHAR *n, LONGINT n__len, int64 *h) +int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h) { - int32 _o_result; - int32 fd; + int16 _o_result; + int16 fd; fd = Platform_openrw(n, n__len); if (fd < 0) { _o_result = Platform_err(); @@ -417,10 +417,10 @@ int32 Platform_OldRW (CHAR *n, LONGINT n__len, int64 *h) __RETCHK; } -int32 Platform_New (CHAR *n, LONGINT n__len, int64 *h) +int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h) { - int32 _o_result; - int32 fd; + int16 _o_result; + int16 fd; fd = Platform_opennew(n, n__len); if (fd < 0) { _o_result = Platform_err(); @@ -433,9 +433,9 @@ int32 Platform_New (CHAR *n, LONGINT n__len, int64 *h) __RETCHK; } -int32 Platform_Close (int64 h) +int16 Platform_Close (int32 h) { - int32 _o_result; + int16 _o_result; if (Platform_closefile(h) < 0) { _o_result = Platform_err(); return _o_result; @@ -446,9 +446,9 @@ int32 Platform_Close (int64 h) __RETCHK; } -int32 Platform_Identify (int64 h, Platform_FileIdentity *identity, address *identity__typ) +int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ) { - int32 _o_result; + int16 _o_result; Platform_structstats(); if (Platform_fstat(h) < 0) { _o_result = Platform_err(); @@ -461,9 +461,9 @@ int32 Platform_Identify (int64 h, Platform_FileIdentity *identity, address *iden return _o_result; } -int32 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ) +int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ) { - int32 _o_result; + int16 _o_result; __DUP(n, n__len, CHAR); Platform_structstats(); if (Platform_stat(n, n__len) < 0) { @@ -498,15 +498,15 @@ void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Pla (*target).mtime = source.mtime; } -void Platform_MTimeAsClock (Platform_FileIdentity i, int64 *t, int64 *d) +void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d) { Platform_sectotm(i.mtime); Platform_YMDHMStoClock(Platform_tmyear(), Platform_tmmon(), Platform_tmmday(), Platform_tmhour(), Platform_tmmin(), Platform_tmsec(), &*t, &*d); } -int32 Platform_Size (int64 h, int64 *l) +int16 Platform_Size (int32 h, int32 *l) { - int32 _o_result; + int16 _o_result; Platform_structstats(); if (Platform_fstat(h) < 0) { _o_result = Platform_err(); @@ -517,9 +517,9 @@ int32 Platform_Size (int64 h, int64 *l) return _o_result; } -int32 Platform_Read (int64 h, address p, int64 l, int64 *n) +int16 Platform_Read (int32 h, address p, int32 l, int32 *n) { - int32 _o_result; + int16 _o_result; *n = Platform_readfile(h, p, l); if (*n < 0) { *n = 0; @@ -532,9 +532,9 @@ int32 Platform_Read (int64 h, address p, int64 l, int64 *n) __RETCHK; } -int32 Platform_ReadBuf (int64 h, SYSTEM_BYTE *b, LONGINT b__len, int64 *n) +int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n) { - int32 _o_result; + int16 _o_result; *n = Platform_readfile(h, (address)b, b__len); if (*n < 0) { *n = 0; @@ -547,9 +547,9 @@ int32 Platform_ReadBuf (int64 h, SYSTEM_BYTE *b, LONGINT b__len, int64 *n) __RETCHK; } -int32 Platform_Write (int64 h, address p, address l) +int16 Platform_Write (int32 h, address p, int32 l) { - int32 _o_result; + int16 _o_result; address written; written = Platform_writefile(h, p, l); if (written < 0) { @@ -562,9 +562,9 @@ int32 Platform_Write (int64 h, address p, address l) __RETCHK; } -int32 Platform_Sync (int64 h) +int16 Platform_Sync (int32 h) { - int32 _o_result; + int16 _o_result; if (Platform_fsync(h) < 0) { _o_result = Platform_err(); return _o_result; @@ -575,9 +575,9 @@ int32 Platform_Sync (int64 h) __RETCHK; } -int32 Platform_Seek (int64 h, int64 offset, int32 whence) +int16 Platform_Seek (int32 h, int32 offset, int16 whence) { - int32 _o_result; + int16 _o_result; if (Platform_lseek(h, offset, whence) < 0) { _o_result = Platform_err(); return _o_result; @@ -588,9 +588,9 @@ int32 Platform_Seek (int64 h, int64 offset, int32 whence) __RETCHK; } -int32 Platform_Truncate (int64 h, int64 l) +int16 Platform_Truncate (int32 h, int32 l) { - int32 _o_result; + int16 _o_result; if (Platform_ftruncate(h, l) < 0) { _o_result = Platform_err(); return _o_result; @@ -601,9 +601,9 @@ int32 Platform_Truncate (int64 h, int64 l) __RETCHK; } -int32 Platform_Unlink (CHAR *n, LONGINT n__len) +int16 Platform_Unlink (CHAR *n, LONGINT n__len) { - int32 _o_result; + int16 _o_result; if (Platform_unlink(n, n__len) < 0) { _o_result = Platform_err(); return _o_result; @@ -614,10 +614,10 @@ int32 Platform_Unlink (CHAR *n, LONGINT n__len) __RETCHK; } -int32 Platform_Chdir (CHAR *n, LONGINT n__len) +int16 Platform_Chdir (CHAR *n, LONGINT n__len) { - int32 _o_result; - int32 r; + int16 _o_result; + int16 r; r = Platform_chdir(n, n__len); Platform_getcwd((void*)Platform_CWD, 256); if (r < 0) { @@ -630,9 +630,9 @@ int32 Platform_Chdir (CHAR *n, LONGINT n__len) __RETCHK; } -int32 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) +int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) { - int32 _o_result; + int16 _o_result; if (Platform_rename(o, o__len, n, n__len) < 0) { _o_result = Platform_err(); return _o_result; @@ -643,7 +643,7 @@ int32 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) __RETCHK; } -void Platform_Exit (int32 code) +void Platform_Exit (int16 code) { Platform_exit(code); } @@ -658,15 +658,15 @@ static void Platform_errln (void) Platform_errch(0x0a); } -static void Platform_errposint (int64 l) +static void Platform_errposint (int32 l) { if (l > 10) { Platform_errposint(__DIV(l, 10)); } - Platform_errch((CHAR)(48 + __MOD(l, 10))); + Platform_errch((CHAR)(48 + (int)__MOD(l, 10))); } -static void Platform_errint (int64 l) +static void Platform_errint (int32 l) { if (l < 0) { Platform_errch('-'); @@ -675,7 +675,7 @@ static void Platform_errint (int64 l) Platform_errposint(l); } -static void Platform_DisplayHaltCode (int64 code) +static void Platform_DisplayHaltCode (int32 code) { switch (code) { case -1: @@ -731,7 +731,7 @@ static void Platform_DisplayHaltCode (int64 code) } } -void Platform_Halt (int64 code) +void Platform_Halt (int32 code) { Platform_HaltCode = code; if (Platform_HaltHandler != NIL) { @@ -744,10 +744,10 @@ void Platform_Halt (int64 code) Platform_DisplayHaltCode(code); } Platform_errln(); - Platform_exit(__VAL(int32, code)); + Platform_exit(__VAL(int16, code)); } -void Platform_AssertFail (int64 code) +void Platform_AssertFail (int32 code) { Platform_errstring((CHAR*)"Assertion failure.", 19); if (code != 0) { @@ -756,7 +756,7 @@ void Platform_AssertFail (int64 code) Platform_errstring((CHAR*)".", 2); } Platform_errln(); - Platform_exit(__VAL(int32, code)); + Platform_exit(__VAL(int16, code)); } void Platform_SetHalt (Platform_HaltProcedure p) @@ -766,12 +766,12 @@ void Platform_SetHalt (Platform_HaltProcedure p) static void Platform_TestLittleEndian (void) { - int32 i; + int16 i; i = 1; __GET((address)&i, Platform_LittleEndian, BOOLEAN); } -__TDESC(Platform_FileIdentity, 1, 0) = {__TDFLDS("FileIdentity", 24), {-8}}; +__TDESC(Platform_FileIdentity, 1, 0) = {__TDFLDS("FileIdentity", 12), {-8}}; export void *Platform__init(void) { diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index f44cd9e8..32d37057 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -7,75 +7,75 @@ typedef struct Platform_FileIdentity { - int64 volume, index, mtime; + int32 volume, index, mtime; } Platform_FileIdentity; typedef - void (*Platform_HaltProcedure)(int64); + void (*Platform_HaltProcedure)(int32); typedef - void (*Platform_SignalHandler)(int32); + void (*Platform_SignalHandler)(int16); import BOOLEAN Platform_LittleEndian; import address Platform_MainStackFrame; -import int64 Platform_HaltCode; -import int32 Platform_PID; +import int32 Platform_HaltCode; +import int16 Platform_PID; import CHAR Platform_CWD[256]; -import int32 Platform_ArgCount; +import int16 Platform_ArgCount; import address Platform_ArgVector; -import int32 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; +import int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; import CHAR Platform_nl[3]; import address *Platform_FileIdentity__typ; -import BOOLEAN Platform_Absent (int32 e); -import int32 Platform_ArgPos (CHAR *s, LONGINT s__len); -import void Platform_AssertFail (int64 code); -import int32 Platform_Chdir (CHAR *n, LONGINT n__len); -import int32 Platform_Close (int64 h); -import BOOLEAN Platform_ConnectionFailed (int32 e); -import void Platform_Delay (int64 ms); -import BOOLEAN Platform_DifferentFilesystems (int32 e); -import int32 Platform_Error (void); -import void Platform_Exit (int32 code); -import void Platform_GetArg (int32 n, CHAR *val, LONGINT val__len); -import void Platform_GetClock (int64 *t, int64 *d); +import BOOLEAN Platform_Absent (int16 e); +import int16 Platform_ArgPos (CHAR *s, LONGINT s__len); +import void Platform_AssertFail (int32 code); +import int16 Platform_Chdir (CHAR *n, LONGINT n__len); +import int16 Platform_Close (int32 h); +import BOOLEAN Platform_ConnectionFailed (int16 e); +import void Platform_Delay (int32 ms); +import BOOLEAN Platform_DifferentFilesystems (int16 e); +import int16 Platform_Error (void); +import void Platform_Exit (int16 code); +import void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len); +import void Platform_GetClock (int32 *t, int32 *d); import void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); -import void Platform_GetIntArg (int32 n, int64 *val); -import void Platform_GetTimeOfDay (int64 *sec, int64 *usec); -import void Platform_Halt (int64 code); -import int32 Platform_Identify (int64 h, Platform_FileIdentity *identity, address *identity__typ); -import int32 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); -import BOOLEAN Platform_Inaccessible (int32 e); -import void Platform_Init (int32 argc, address argvadr); -import void Platform_MTimeAsClock (Platform_FileIdentity i, int64 *t, int64 *d); -import int32 Platform_New (CHAR *n, LONGINT n__len, int64 *h); -import BOOLEAN Platform_NoSuchDirectory (int32 e); +import void Platform_GetIntArg (int16 n, int32 *val); +import void Platform_GetTimeOfDay (int32 *sec, int32 *usec); +import void Platform_Halt (int32 code); +import int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ); +import int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); +import BOOLEAN Platform_Inaccessible (int16 e); +import void Platform_Init (int16 argc, address argvadr); +import void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); +import int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); +import BOOLEAN Platform_NoSuchDirectory (int16 e); import address Platform_OSAllocate (address size); import void Platform_OSFree (address address); -import int32 Platform_OldRO (CHAR *n, LONGINT n__len, int64 *h); -import int32 Platform_OldRW (CHAR *n, LONGINT n__len, int64 *h); -import int32 Platform_Read (int64 h, address p, int64 l, int64 *n); -import int32 Platform_ReadBuf (int64 h, SYSTEM_BYTE *b, LONGINT b__len, int64 *n); -import int32 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); +import int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); +import int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); +import int16 Platform_Read (int32 h, address p, int32 l, int32 *n); +import int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n); +import int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); import BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); import BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); -import int32 Platform_Seek (int64 h, int64 offset, int32 whence); +import int16 Platform_Seek (int32 h, int32 offset, int16 whence); import void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); import void Platform_SetHalt (Platform_HaltProcedure p); import void Platform_SetInterruptHandler (Platform_SignalHandler handler); import void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Platform_FileIdentity source); import void Platform_SetQuitHandler (Platform_SignalHandler handler); -import int32 Platform_Size (int64 h, int64 *l); -import int32 Platform_Sync (int64 h); -import int32 Platform_System (CHAR *cmd, LONGINT cmd__len); -import int64 Platform_Time (void); -import BOOLEAN Platform_TimedOut (int32 e); -import BOOLEAN Platform_TooManyFiles (int32 e); -import int32 Platform_Truncate (int64 h, int64 l); -import int32 Platform_Unlink (CHAR *n, LONGINT n__len); -import int32 Platform_Write (int64 h, address p, address l); +import int16 Platform_Size (int32 h, int32 *l); +import int16 Platform_Sync (int32 h); +import int16 Platform_System (CHAR *cmd, LONGINT cmd__len); +import int32 Platform_Time (void); +import BOOLEAN Platform_TimedOut (int16 e); +import BOOLEAN Platform_TooManyFiles (int16 e); +import int16 Platform_Truncate (int32 h, int32 l); +import int16 Platform_Unlink (CHAR *n, LONGINT n__len); +import int16 Platform_Write (int32 h, address p, int32 l); import BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); import void *Platform__init(void); diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 7678a81e..fe93e8be 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,8 +1,8 @@ /* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ -#define INTEGER int32 -#define LONGINT int64 -#define SET uint64 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" @@ -10,19 +10,19 @@ static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LONGINT d__len); -export void Reals_Convert (REAL x, int32 n, CHAR *d, LONGINT d__len); +export void Reals_Convert (REAL x, int16 n, CHAR *d, LONGINT d__len); export void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len); export void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len); -export void Reals_ConvertL (LONGREAL x, int32 n, CHAR *d, LONGINT d__len); -export int32 Reals_Expo (REAL x); -export int32 Reals_ExpoL (LONGREAL x); -export void Reals_SetExpo (REAL *x, int32 ex); -export REAL Reals_Ten (int32 e); -export LONGREAL Reals_TenL (int32 e); -static CHAR Reals_ToHex (int32 i); +export void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len); +export int16 Reals_Expo (REAL x); +export int16 Reals_ExpoL (LONGREAL x); +export void Reals_SetExpo (REAL *x, int16 ex); +export REAL Reals_Ten (int16 e); +export LONGREAL Reals_TenL (int16 e); +static CHAR Reals_ToHex (int16 i); -REAL Reals_Ten (int32 e) +REAL Reals_Ten (int16 e) { REAL _o_result; LONGREAL r, power; @@ -39,7 +39,7 @@ REAL Reals_Ten (int32 e) return _o_result; } -LONGREAL Reals_TenL (int32 e) +LONGREAL Reals_TenL (int16 e) { LONGREAL _o_result; LONGREAL r, power; @@ -59,54 +59,67 @@ LONGREAL Reals_TenL (int32 e) __RETCHK; } -int32 Reals_Expo (REAL x) +int16 Reals_Expo (REAL x) { - int32 _o_result; - int32 i; - __GET((address)&x + 2, i, int32); + int16 _o_result; + int16 i; + __GET((address)&x + 2, i, int16); _o_result = __MASK(__ASHR(i, 7), -256); return _o_result; } -void Reals_SetExpo (REAL *x, int32 ex) +void Reals_SetExpo (REAL *x, int16 ex) { CHAR c; __GET((address)x + 3, c, CHAR); - __PUT((address)x + 3, (CHAR)(__ASHL(__ASHR(c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __PUT((address)x + 3, (CHAR)(__ASHL(__ASHR((int16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); __GET((address)x + 2, c, CHAR); - __PUT((address)x + 2, (CHAR)(__MASK(c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); + __PUT((address)x + 2, (CHAR)(__MASK((int16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } -int32 Reals_ExpoL (LONGREAL x) +int16 Reals_ExpoL (LONGREAL x) { - int32 _o_result; - int32 i; - __GET((address)&x + 6, i, int32); + int16 _o_result; + int16 i; + __GET((address)&x + 6, i, int16); _o_result = __MASK(__ASHR(i, 4), -2048); return _o_result; } -void Reals_ConvertL (LONGREAL x, int32 n, CHAR *d, LONGINT d__len) +void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len) { - int64 i, j, k; + int32 i, j, k; if (x < (LONGREAL)0) { x = -x; } k = 0; - i = __ENTIER(x); - while (k < (int64)n) { - d[__X(k, d__len)] = (CHAR)(__MOD(i, 10) + 48); + if (n > 9) { + i = (int32)__ENTIER(x / (LONGREAL)(LONGREAL)1000000000); + j = (int32)__ENTIER(x - i * (LONGREAL)1000000000); + if (j < 0) { + j = 0; + } + while (k < 9) { + d[__X(k, d__len)] = (CHAR)((int)__MOD(j, 10) + 48); + j = __DIV(j, 10); + k += 1; + } + } else { + i = (int32)__ENTIER(x); + } + while (k < n) { + d[__X(k, d__len)] = (CHAR)((int)__MOD(i, 10) + 48); i = __DIV(i, 10); k += 1; } } -void Reals_Convert (REAL x, int32 n, CHAR *d, LONGINT d__len) +void Reals_Convert (REAL x, int16 n, CHAR *d, LONGINT d__len) { Reals_ConvertL(x, n, (void*)d, d__len); } -static CHAR Reals_ToHex (int32 i) +static CHAR Reals_ToHex (int16 i) { CHAR _o_result; if (i < 10) { @@ -121,15 +134,15 @@ static CHAR Reals_ToHex (int32 i) static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LONGINT d__len) { - int32 i; - int64 l; + int16 i; + int32 l; CHAR by; i = 0; l = b__len; - while ((int64)i < l) { + while (i < l) { by = __VAL(CHAR, b[__X(i, b__len)]); - d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR(by, 4)); - d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK(by, -16)); + d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((int16)by, 4)); + d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((int16)by, -16)); i += 1; } } diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index 4de192c6..e7cba0d8 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -8,15 +8,15 @@ -import void Reals_Convert (REAL x, int32 n, CHAR *d, LONGINT d__len); +import void Reals_Convert (REAL x, int16 n, CHAR *d, LONGINT d__len); import void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len); import void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len); -import void Reals_ConvertL (LONGREAL x, int32 n, CHAR *d, LONGINT d__len); -import int32 Reals_Expo (REAL x); -import int32 Reals_ExpoL (LONGREAL x); -import void Reals_SetExpo (REAL *x, int32 ex); -import REAL Reals_Ten (int32 e); -import LONGREAL Reals_TenL (int32 e); +import void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len); +import int16 Reals_Expo (REAL x); +import int16 Reals_ExpoL (LONGREAL x); +import void Reals_SetExpo (REAL *x, int16 ex); +import REAL Reals_Ten (int16 e); +import LONGREAL Reals_TenL (int16 e); import void *Reals__init(void); diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index 49fbdd21..427a0cc4 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,8 +1,8 @@ /* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ -#define INTEGER int32 -#define LONGINT int64 -#define SET uint64 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" @@ -11,22 +11,22 @@ export void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len); export void Strings_Cap (CHAR *s, LONGINT s__len); -export void Strings_Delete (CHAR *s, LONGINT s__len, int32 pos, int32 n); -export void Strings_Extract (CHAR *source, LONGINT source__len, int32 pos, int32 n, CHAR *dest, LONGINT dest__len); -export void Strings_Insert (CHAR *source, LONGINT source__len, int32 pos, CHAR *dest, LONGINT dest__len); -export int32 Strings_Length (CHAR *s, LONGINT s__len); +export void Strings_Delete (CHAR *s, LONGINT s__len, int16 pos, int16 n); +export void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHAR *dest, LONGINT dest__len); +export void Strings_Insert (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len); +export int16 Strings_Length (CHAR *s, LONGINT s__len); export BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len); -export int32 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int32 pos); -export void Strings_Replace (CHAR *source, LONGINT source__len, int32 pos, CHAR *dest, LONGINT dest__len); +export int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int16 pos); +export void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len); -int32 Strings_Length (CHAR *s, LONGINT s__len) +int16 Strings_Length (CHAR *s, LONGINT s__len) { - int32 _o_result; - int32 i; + int16 _o_result; + int16 i; __DUP(s, s__len, CHAR); i = 0; - while (((int64)i < s__len && s[__X(i, s__len)] != 0x00)) { + while ((i < s__len && s[__X(i, s__len)] != 0x00)) { i += 1; } _o_result = i; @@ -36,24 +36,24 @@ int32 Strings_Length (CHAR *s, LONGINT s__len) void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len) { - int32 n1, n2, i; + int16 n1, n2, i; __DUP(extra, extra__len, CHAR); n1 = Strings_Length(dest, dest__len); n2 = Strings_Length(extra, extra__len); i = 0; - while ((i < n2 && (int64)(i + n1) < dest__len)) { + while ((i < n2 && (i + n1) < dest__len)) { dest[__X(i + n1, dest__len)] = extra[__X(i, extra__len)]; i += 1; } - if ((int64)(i + n1) < dest__len) { + if ((i + n1) < dest__len) { dest[__X(i + n1, dest__len)] = 0x00; } __DEL(extra); } -void Strings_Insert (CHAR *source, LONGINT source__len, int32 pos, CHAR *dest, LONGINT dest__len) +void Strings_Insert (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len) { - int32 n1, n2, i; + int16 n1, n2, i; __DUP(source, source__len, CHAR); n1 = Strings_Length(dest, dest__len); n2 = Strings_Length(source, source__len); @@ -64,10 +64,10 @@ void Strings_Insert (CHAR *source, LONGINT source__len, int32 pos, CHAR *dest, L Strings_Append(dest, dest__len, (void*)source, source__len); return; } - if ((int64)(pos + n2) < dest__len) { + if ((pos + n2) < dest__len) { i = n1; while (i >= pos) { - if ((int64)(i + n2) < dest__len) { + if ((i + n2) < dest__len) { dest[__X(i + n2, dest__len)] = dest[__X(i, dest__len)]; } i -= 1; @@ -81,9 +81,9 @@ void Strings_Insert (CHAR *source, LONGINT source__len, int32 pos, CHAR *dest, L __DEL(source); } -void Strings_Delete (CHAR *s, LONGINT s__len, int32 pos, int32 n) +void Strings_Delete (CHAR *s, LONGINT s__len, int16 pos, int16 n) { - int32 len, i; + int16 len, i; len = Strings_Length(s, s__len); if (pos < 0) { pos = 0; @@ -96,7 +96,7 @@ void Strings_Delete (CHAR *s, LONGINT s__len, int32 pos, int32 n) s[__X(i - n, s__len)] = s[__X(i, s__len)]; i += 1; } - if ((int64)(i - n) < s__len) { + if ((i - n) < s__len) { s[__X(i - n, s__len)] = 0x00; } } else { @@ -104,7 +104,7 @@ void Strings_Delete (CHAR *s, LONGINT s__len, int32 pos, int32 n) } } -void Strings_Replace (CHAR *source, LONGINT source__len, int32 pos, CHAR *dest, LONGINT dest__len) +void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len) { __DUP(source, source__len, CHAR); Strings_Delete((void*)dest, dest__len, pos, pos + Strings_Length(source, source__len)); @@ -112,12 +112,12 @@ void Strings_Replace (CHAR *source, LONGINT source__len, int32 pos, CHAR *dest, __DEL(source); } -void Strings_Extract (CHAR *source, LONGINT source__len, int32 pos, int32 n, CHAR *dest, LONGINT dest__len) +void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHAR *dest, LONGINT dest__len) { - int32 len, destLen, i; + int16 len, destLen, i; __DUP(source, source__len, CHAR); len = Strings_Length(source, source__len); - destLen = (int32)dest__len - 1; + destLen = (int16)dest__len - 1; if (pos < 0) { pos = 0; } @@ -126,7 +126,7 @@ void Strings_Extract (CHAR *source, LONGINT source__len, int32 pos, int32 n, CHA return; } i = 0; - while (((((int64)(pos + i) <= source__len && source[__X(pos + i, source__len)] != 0x00)) && i < n)) { + while (((((pos + i) <= source__len && source[__X(pos + i, source__len)] != 0x00)) && i < n)) { if (i < destLen) { dest[__X(i, dest__len)] = source[__X(pos + i, source__len)]; } @@ -136,10 +136,10 @@ void Strings_Extract (CHAR *source, LONGINT source__len, int32 pos, int32 n, CHA __DEL(source); } -int32 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int32 pos) +int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int16 pos) { - int32 _o_result; - int32 n1, n2, i, j; + int16 _o_result; + int16 n1, n2, i, j; __DUP(pattern, pattern__len, CHAR); __DUP(s, s__len, CHAR); n1 = Strings_Length(s, s__len); @@ -174,7 +174,7 @@ int32 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, void Strings_Cap (CHAR *s, LONGINT s__len) { - int32 i; + int16 i; i = 0; while (s[__X(i, s__len)] != 0x00) { if (('a' <= s[__X(i, s__len)] && s[__X(i, s__len)] <= 'z')) { @@ -188,9 +188,9 @@ static struct Match__7 { struct Match__7 *lnk; } *Match__7_s; -static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, int32 n, int32 m); +static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, int16 n, int16 m); -static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, int32 n, int32 m) +static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, int16 n, int16 m) { BOOLEAN _o_result; while ((((n >= 0 && m >= 0)) && mask[__X(m, mask__len)] != '*')) { diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index 4dd0d2c3..44c51b2a 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -10,13 +10,13 @@ import void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len); import void Strings_Cap (CHAR *s, LONGINT s__len); -import void Strings_Delete (CHAR *s, LONGINT s__len, int32 pos, int32 n); -import void Strings_Extract (CHAR *source, LONGINT source__len, int32 pos, int32 n, CHAR *dest, LONGINT dest__len); -import void Strings_Insert (CHAR *source, LONGINT source__len, int32 pos, CHAR *dest, LONGINT dest__len); -import int32 Strings_Length (CHAR *s, LONGINT s__len); +import void Strings_Delete (CHAR *s, LONGINT s__len, int16 pos, int16 n); +import void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHAR *dest, LONGINT dest__len); +import void Strings_Insert (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len); +import int16 Strings_Length (CHAR *s, LONGINT s__len); import BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len); -import int32 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int32 pos); -import void Strings_Replace (CHAR *source, LONGINT source__len, int32 pos, CHAR *dest, LONGINT dest__len); +import int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int16 pos); +import void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len); import void *Strings__init(void); diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index 6403ce33..8c41a062 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,8 +1,8 @@ /* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ -#define INTEGER int32 -#define LONGINT int64 -#define SET uint64 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Files.h" @@ -18,7 +18,7 @@ typedef typedef struct Texts_RunDesc { Texts_Run prev, next; - int64 len; + int32 len; Texts_FontsFont fnt; int8 col, voff; BOOLEAN ascii; @@ -41,26 +41,26 @@ typedef typedef struct Texts_ElemDesc { Texts_Run prev, next; - int64 len; + int32 len; Texts_FontsFont fnt; int8 col, voff; BOOLEAN ascii; - int64 W, H; + int32 W, H; Texts_Handler handle; Texts_Text base; } Texts_ElemDesc; struct Texts__1 { /* Texts_ElemDesc */ Texts_Run prev, next; - int64 len; + int32 len; Texts_FontsFont fnt; int8 col, voff; BOOLEAN ascii; - int64 W, H; + int32 W, H; Texts_Handler handle; Texts_Text base; Files_File file; - int64 org, span; + int32 org, span; CHAR mod[32], proc[32]; }; @@ -69,7 +69,7 @@ typedef typedef struct Texts_BufDesc { - int64 len; + int32 len; Texts_Run head; } Texts_BufDesc; @@ -83,8 +83,8 @@ typedef typedef struct Texts_FileMsg { /* Texts_ElemMsg */ - int32 id; - int64 pos; + int16 id; + int32 pos; Files_Rider r; } Texts_FileMsg; @@ -99,7 +99,7 @@ typedef } Texts_IdentifyMsg; typedef - void (*Texts_Notifier)(Texts_Text, int32, int64, int64); + void (*Texts_Notifier)(Texts_Text, int16, int32, int32); typedef struct Texts_PieceDesc *Texts_Piece; @@ -107,12 +107,12 @@ typedef typedef struct Texts_PieceDesc { Texts_Run prev, next; - int64 len; + int32 len; Texts_FontsFont fnt; int8 col, voff; BOOLEAN ascii; Files_File file; - int64 org; + int32 org; } Texts_PieceDesc; typedef @@ -123,7 +123,7 @@ typedef Texts_Elem elem; Files_Rider rider; Texts_Run run; - int64 org, off; + int32 org, off; } Texts_Reader; typedef @@ -134,10 +134,10 @@ typedef Texts_Elem elem; Files_Rider rider; Texts_Run run; - int64 org, off; + int32 org, off; CHAR nextCh; - int32 line, class; - int64 i; + int16 line, class; + int32 i; REAL x; LONGREAL y; CHAR c; @@ -147,10 +147,10 @@ typedef typedef struct Texts_TextDesc { - int64 len; + int32 len; Texts_Notifier notify; Texts_Run head, cache; - int64 corg; + int32 corg; } Texts_TextDesc; typedef @@ -183,50 +183,50 @@ export address *Texts_Writer__typ; export address *Texts__1__typ; export void Texts_Append (Texts_Text T, Texts_Buffer B); -export void Texts_ChangeLooks (Texts_Text T, int64 beg, int64 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff); +export void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff); static Texts_Elem Texts_CloneElem (Texts_Elem e); static Texts_Piece Texts_ClonePiece (Texts_Piece p); export void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len); export void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); export void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); -export void Texts_Delete (Texts_Text T, int64 beg, int64 end); +export void Texts_Delete (Texts_Text T, int32 beg, int32 end); export Texts_Text Texts_ElemBase (Texts_Elem E); -export int64 Texts_ElemPos (Texts_Elem E); -static void Texts_Find (Texts_Text T, int64 *pos, Texts_Run *u, int64 *org, int64 *off); +export int32 Texts_ElemPos (Texts_Elem E); +static void Texts_Find (Texts_Text T, int32 *pos, Texts_Run *u, int32 *org, int32 *off); static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len); static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, address *msg__typ); -export void Texts_Insert (Texts_Text T, int64 pos, Texts_Buffer B); +export void Texts_Insert (Texts_Text T, int32 pos, Texts_Buffer B); export void Texts_Load (Files_Rider *r, address *r__typ, Texts_Text T); static void Texts_Load0 (Files_Rider *r, address *r__typ, Texts_Text T); static void Texts_Merge (Texts_Text T, Texts_Run u, Texts_Run *v); export void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len); export void Texts_OpenBuf (Texts_Buffer B); -export void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int64 pos); -export void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int64 pos); +export void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int32 pos); +export void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int32 pos); export void Texts_OpenWriter (Texts_Writer *W, address *W__typ); -export int64 Texts_Pos (Texts_Reader *R, address *R__typ); +export int32 Texts_Pos (Texts_Reader *R, address *R__typ); export void Texts_Read (Texts_Reader *R, address *R__typ, CHAR *ch); export void Texts_ReadElem (Texts_Reader *R, address *R__typ); export void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ); export void Texts_Recall (Texts_Buffer *B); -export void Texts_Save (Texts_Text T, int64 beg, int64 end, Texts_Buffer B); +export void Texts_Save (Texts_Text T, int32 beg, int32 end, Texts_Buffer B); export void Texts_Scan (Texts_Scanner *S, address *S__typ); export void Texts_SetColor (Texts_Writer *W, address *W__typ, int8 col); export void Texts_SetFont (Texts_Writer *W, address *W__typ, Texts_FontsFont fnt); export void Texts_SetOffset (Texts_Writer *W, address *W__typ, int8 voff); static void Texts_Splice (Texts_Run un, Texts_Run v, Texts_Run w, Texts_Text base); -static void Texts_Split (int64 off, Texts_Run *u, Texts_Run *un); +static void Texts_Split (int32 off, Texts_Run *u, Texts_Run *un); export void Texts_Store (Files_Rider *r, address *r__typ, Texts_Text T); export void Texts_Write (Texts_Writer *W, address *W__typ, CHAR ch); -export void Texts_WriteDate (Texts_Writer *W, address *W__typ, int64 t, int64 d); +export void Texts_WriteDate (Texts_Writer *W, address *W__typ, int32 t, int32 d); export void Texts_WriteElem (Texts_Writer *W, address *W__typ, Texts_Elem e); -export void Texts_WriteHex (Texts_Writer *W, address *W__typ, int64 x); +export void Texts_WriteHex (Texts_Writer *W, address *W__typ, int32 x); export void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n); export void Texts_WriteLn (Texts_Writer *W, address *W__typ); -export void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int32 n); +export void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int16 n); export void Texts_WriteLongRealHex (Texts_Writer *W, address *W__typ, LONGREAL x); -export void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int32 n); -export void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int32 n, int32 k); +export void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int16 n); +export void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int16 n, int16 k); export void Texts_WriteRealHex (Texts_Writer *W, address *W__typ, REAL x); export void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGINT s__len); @@ -241,10 +241,10 @@ static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len) return _o_result; } -static void Texts_Find (Texts_Text T, int64 *pos, Texts_Run *u, int64 *org, int64 *off) +static void Texts_Find (Texts_Text T, int32 *pos, Texts_Run *u, int32 *org, int32 *off) { Texts_Run v = NIL; - int64 m; + int32 m; if (*pos >= T->len) { *pos = T->len; *u = T->head; @@ -274,7 +274,7 @@ static void Texts_Find (Texts_Text T, int64 *pos, Texts_Run *u, int64 *org, int6 } } -static void Texts_Split (int64 off, Texts_Run *u, Texts_Run *un) +static void Texts_Split (int32 off, Texts_Run *u, Texts_Run *un) { Texts_Piece p = NIL, U = NIL; if (off == 0) { @@ -373,11 +373,11 @@ Texts_Text Texts_ElemBase (Texts_Elem E) return _o_result; } -int64 Texts_ElemPos (Texts_Elem E) +int32 Texts_ElemPos (Texts_Elem E) { - int64 _o_result; + int32 _o_result; Texts_Run u = NIL; - int64 pos; + int32 pos; u = E->base->head->next; pos = 0; while (u != (void *) E) { @@ -392,7 +392,7 @@ static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, address *msg__t { Texts_Alien e = NIL; Files_Rider r; - int64 i; + int32 i; CHAR ch; if (__ISP(E, Texts__1, 2)) { if (__IS(msg__typ, Texts_CopyMsg, 1)) { @@ -468,10 +468,10 @@ void Texts_Recall (Texts_Buffer *B) Texts_del = NIL; } -void Texts_Save (Texts_Text T, int64 beg, int64 end, Texts_Buffer B) +void Texts_Save (Texts_Text T, int32 beg, int32 end, Texts_Buffer B) { Texts_Run u = NIL, v = NIL, w = NIL, wn = NIL; - int64 uo, ud, vo, vd; + int32 uo, ud, vo, vd; Texts_Find(T, &beg, &u, &uo, &ud); Texts_Find(T, &end, &v, &vo, &vd); w = B->head->prev; @@ -502,11 +502,11 @@ void Texts_Save (Texts_Text T, int64 beg, int64 end, Texts_Buffer B) B->len += end - beg; } -void Texts_Insert (Texts_Text T, int64 pos, Texts_Buffer B) +void Texts_Insert (Texts_Text T, int32 pos, Texts_Buffer B) { Texts_Run u = NIL, un = NIL, v = NIL; Texts_Piece p = NIL, q = NIL; - int64 uo, ud, len; + int32 uo, ud, len; Texts_Find(T, &pos, &u, &uo, &ud); Texts_Split(ud, &u, &un); len = B->len; @@ -525,7 +525,7 @@ void Texts_Insert (Texts_Text T, int64 pos, Texts_Buffer B) void Texts_Append (Texts_Text T, Texts_Buffer B) { Texts_Run v = NIL; - int64 pos, len; + int32 pos, len; pos = T->len; len = B->len; v = B->head->next; @@ -540,10 +540,10 @@ void Texts_Append (Texts_Text T, Texts_Buffer B) } } -void Texts_Delete (Texts_Text T, int64 beg, int64 end) +void Texts_Delete (Texts_Text T, int32 beg, int32 end) { Texts_Run c = NIL, u = NIL, un = NIL, v = NIL, vn = NIL; - int64 co, uo, ud, vo, vd; + int32 co, uo, ud, vo, vd; Texts_Find(T, &beg, &u, &uo, &ud); Texts_Split(ud, &u, &un); c = T->cache; @@ -565,10 +565,10 @@ void Texts_Delete (Texts_Text T, int64 beg, int64 end) } } -void Texts_ChangeLooks (Texts_Text T, int64 beg, int64 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff) +void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff) { Texts_Run c = NIL, u = NIL, un = NIL, v = NIL, vn = NIL; - int64 co, uo, ud, vo, vd; + int32 co, uo, ud, vo, vd; Texts_Find(T, &beg, &u, &uo, &ud); Texts_Split(ud, &u, &un); c = T->cache; @@ -578,13 +578,13 @@ void Texts_ChangeLooks (Texts_Text T, int64 beg, int64 end, SET sel, Texts_Fonts T->cache = c; T->corg = co; while (un != vn) { - if ((__IN(0, sel, 64) && fnt != NIL)) { + if ((__IN(0, sel, 32) && fnt != NIL)) { un->fnt = fnt; } - if (__IN(1, sel, 64)) { + if (__IN(1, sel, 32)) { un->col = col; } - if (__IN(2, sel, 64)) { + if (__IN(2, sel, 32)) { un->voff = voff; } Texts_Merge(T, u, &un); @@ -604,7 +604,7 @@ void Texts_ChangeLooks (Texts_Text T, int64 beg, int64 end, SET sel, Texts_Fonts } } -void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int64 pos) +void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int32 pos) { Texts_Run u = NIL; if (pos >= T->len) { @@ -621,7 +621,7 @@ void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int64 pos void Texts_Read (Texts_Reader *R, address *R__typ, CHAR *ch) { Texts_Run u = NIL; - int64 pos; + int32 pos; CHAR nextch; u = (*R).run; (*R).fnt = u->fnt; @@ -713,14 +713,14 @@ void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ) } } -int64 Texts_Pos (Texts_Reader *R, address *R__typ) +int32 Texts_Pos (Texts_Reader *R, address *R__typ) { - int64 _o_result; + int32 _o_result; _o_result = (*R).org + (*R).off; return _o_result; } -void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int64 pos) +void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int32 pos) { Texts_OpenReader((void*)&*S, S__typ, T, pos); (*S).line = 0; @@ -732,7 +732,7 @@ static struct Scan__31 { address *S__typ; CHAR *ch; BOOLEAN *negE; - int32 *e; + int16 *e; struct Scan__31 *lnk; } *Scan__31_s; @@ -751,7 +751,7 @@ static void ReadScaleFactor__32 (void) } } while (('0' <= *Scan__31_s->ch && *Scan__31_s->ch <= '9')) { - *Scan__31_s->e = (*Scan__31_s->e * 10 + *Scan__31_s->ch) - 48; + *Scan__31_s->e = (*Scan__31_s->e * 10 + (int16)*Scan__31_s->ch) - 48; Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); } } @@ -761,8 +761,8 @@ void Texts_Scan (Texts_Scanner *S, address *S__typ) CHAR ch, term; BOOLEAN neg, negE, hex; int8 i, j, h; - int32 e; - int64 k; + int16 e; + int32 k; REAL x, f; LONGREAL y, g; CHAR d[32]; @@ -823,10 +823,10 @@ void Texts_Scan (Texts_Scanner *S, address *S__typ) if ('9' < ch) { if (('A' <= ch && ch <= 'F')) { hex = 1; - ch = (CHAR)(ch - 7); + ch = (CHAR)((int16)ch - 7); } else if (('a' <= ch && ch <= 'f')) { hex = 1; - ch = (CHAR)(ch - 39); + ch = (CHAR)((int16)ch - 39); } else { break; } @@ -838,13 +838,13 @@ void Texts_Scan (Texts_Scanner *S, address *S__typ) if (i - j > 8) { j = i - 8; } - k = d[__X(j, 32)] - 48; + k = (int16)d[__X(j, 32)] - 48; j += 1; if ((i - j == 7 && k >= 8)) { k -= 16; } while (j < i) { - k = __ASHL(k, 4) + (int64)(d[__X(j, 32)] - 48); + k = __ASHL(k, 4) + ((int16)d[__X(j, 32)] - 48); j += 1; } if (neg) { @@ -865,12 +865,12 @@ void Texts_Scan (Texts_Scanner *S, address *S__typ) y = (LONGREAL)0; g = (LONGREAL)1; do { - y = y * (LONGREAL)10 + (d[__X(j, 32)] - 48); + y = y * (LONGREAL)10 + ((int16)d[__X(j, 32)] - 48); j += 1; } while (!(j == h)); while (j < i) { g = g / (LONGREAL)(LONGREAL)10; - y = (d[__X(j, 32)] - 48) * g + y; + y = ((int16)d[__X(j, 32)] - 48) * g + y; j += 1; } ReadScaleFactor__32(); @@ -897,12 +897,12 @@ void Texts_Scan (Texts_Scanner *S, address *S__typ) x = (REAL)0; f = (REAL)1; do { - x = x * (REAL)10 + (d[__X(j, 32)] - 48); + x = x * (REAL)10 + ((int16)d[__X(j, 32)] - 48); j += 1; } while (!(j == h)); while (j < i) { f = f / (REAL)(REAL)10; - x = (d[__X(j, 32)] - 48) * f + x; + x = ((int16)d[__X(j, 32)] - 48) * f + x; j += 1; } if (ch == 'E') { @@ -934,7 +934,7 @@ void Texts_Scan (Texts_Scanner *S, address *S__typ) (*S).class = 3; k = 0; do { - k = k * 10 + (int64)(d[__X(j, 32)] - 48); + k = k * 10 + ((int16)d[__X(j, 32)] - 48); j += 1; } while (!(j == i)); if (neg) { @@ -1040,7 +1040,7 @@ void Texts_WriteLn (Texts_Writer *W, address *W__typ) void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGINT s__len) { - int32 i; + int16 i; __DUP(s, s__len, CHAR); i = 0; while (s[__X(i, s__len)] >= ' ') { @@ -1052,7 +1052,7 @@ void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGINT s__le void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n) { - int32 i; + int16 i; int64 x0; CHAR a[24]; i = 0; @@ -1085,10 +1085,10 @@ void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n) } while (!(i == 0)); } -void Texts_WriteHex (Texts_Writer *W, address *W__typ, int64 x) +void Texts_WriteHex (Texts_Writer *W, address *W__typ, int32 x) { - int32 i; - int64 y; + int16 i; + int32 y; CHAR a[20]; i = 0; Texts_Write(&*W, W__typ, ' '); @@ -1108,9 +1108,9 @@ void Texts_WriteHex (Texts_Writer *W, address *W__typ, int64 x) } while (!(i == 0)); } -void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int32 n) +void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int16 n) { - int32 e; + int16 e; REAL x0; CHAR d[9]; e = Reals_Expo(x); @@ -1181,15 +1181,15 @@ void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int32 n) static struct WriteRealFix__53 { Texts_Writer *W; address *W__typ; - int32 *i; + int16 *i; CHAR (*d)[9]; struct WriteRealFix__53 *lnk; } *WriteRealFix__53_s; -static void dig__54 (int32 n); -static void seq__56 (CHAR ch, int32 n); +static void dig__54 (int16 n); +static void seq__56 (CHAR ch, int16 n); -static void seq__56 (CHAR ch, int32 n) +static void seq__56 (CHAR ch, int16 n) { while (n > 0) { Texts_Write(&*WriteRealFix__53_s->W, WriteRealFix__53_s->W__typ, ch); @@ -1197,7 +1197,7 @@ static void seq__56 (CHAR ch, int32 n) } } -static void dig__54 (int32 n) +static void dig__54 (int16 n) { while (n > 0) { *WriteRealFix__53_s->i -= 1; @@ -1206,9 +1206,9 @@ static void dig__54 (int32 n) } } -void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int32 n, int32 k) +void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int16 n, int16 k) { - int32 e, i; + int16 e, i; CHAR sign; REAL x0; CHAR d[9]; @@ -1280,7 +1280,7 @@ void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int32 n, int3 void Texts_WriteRealHex (Texts_Writer *W, address *W__typ, REAL x) { - int32 i; + int16 i; CHAR d[8]; Reals_ConvertH(x, (void*)d, 8); i = 0; @@ -1290,9 +1290,9 @@ void Texts_WriteRealHex (Texts_Writer *W, address *W__typ, REAL x) } while (!(i == 8)); } -void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int32 n) +void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int16 n) { - int32 e; + int16 e; LONGREAL x0; CHAR d[16]; e = Reals_ExpoL(x); @@ -1324,7 +1324,7 @@ void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int32 n) } else { Texts_Write(&*W, W__typ, ' '); } - e = (int32)__ASHR((int64)(e - 1023) * 77, 8); + e = (int16)__ASHR((e - 1023) * 77, 8); if (e >= 0) { x = x / (LONGREAL)Reals_TenL(e); } else { @@ -1364,7 +1364,7 @@ void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int32 n) void Texts_WriteLongRealHex (Texts_Writer *W, address *W__typ, LONGREAL x) { - int32 i; + int16 i; CHAR d[16]; Reals_ConvertHL(x, (void*)d, 16); i = 0; @@ -1380,16 +1380,16 @@ static struct WriteDate__43 { struct WriteDate__43 *lnk; } *WriteDate__43_s; -static void WritePair__44 (CHAR ch, int64 x); +static void WritePair__44 (CHAR ch, int32 x); -static void WritePair__44 (CHAR ch, int64 x) +static void WritePair__44 (CHAR ch, int32 x) { Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, ch); Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)(__DIV(x, 10) + 48)); - Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)(__MOD(x, 10) + 48)); + Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)((int)__MOD(x, 10) + 48)); } -void Texts_WriteDate (Texts_Writer *W, address *W__typ, int64 t, int64 d) +void Texts_WriteDate (Texts_Writer *W, address *W__typ, int32 t, int32 d) { struct WriteDate__43 _s; _s.W = W; _s.W__typ = W__typ; @@ -1413,14 +1413,14 @@ static struct Load0__16 { struct Load0__16 *lnk; } *Load0__16_s; -static void LoadElem__17 (Files_Rider *r, address *r__typ, int64 pos, int64 span, Texts_Elem *e); +static void LoadElem__17 (Files_Rider *r, address *r__typ, int32 pos, int32 span, Texts_Elem *e); -static void LoadElem__17 (Files_Rider *r, address *r__typ, int64 pos, int64 span, Texts_Elem *e) +static void LoadElem__17 (Files_Rider *r, address *r__typ, int32 pos, int32 span, Texts_Elem *e) { Modules_Module M = NIL; Modules_Command Cmd; Texts_Alien a = NIL; - int64 org, ew, eh; + int32 org, ew, eh; int8 eno; Texts_new = NIL; Files_ReadLInt(&*r, r__typ, &ew); @@ -1471,7 +1471,7 @@ static void Texts_Load0 (Files_Rider *r, address *r__typ, Texts_Text T) Texts_Run u = NIL, un = NIL; Texts_Piece p = NIL; Texts_Elem e = NIL; - int64 org, pos, hlen, plen; + int32 org, pos, hlen, plen; int8 ecnt, fno, fcnt, col, voff; Files_File f = NIL; Texts_FileMsg msg; @@ -1490,7 +1490,7 @@ static void Texts_Load0 (Files_Rider *r, address *r__typ, Texts_Text T) pos = Files_Pos(&*r, r__typ); f = Files_Base(&*r, r__typ); __NEW(u, Texts_RunDesc); - u->len = 9223372036854775807; + u->len = 2147483647; u->fnt = NIL; u->col = 15; T->head = u; @@ -1542,7 +1542,7 @@ static void Texts_Load0 (Files_Rider *r, address *r__typ, Texts_Text T) void Texts_Load (Files_Rider *r, address *r__typ, Texts_Text T) { - int32 tag; + int16 tag; Files_ReadInt(&*r, r__typ, &tag); if (tag != -4095) { Files_Set(&*r, r__typ, Files_Base(&*r, r__typ), Files_Pos(&*r, r__typ) - 2); @@ -1557,7 +1557,7 @@ void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len) Texts_Run u = NIL; Texts_Piece p = NIL; CHAR tag, version; - int64 hlen; + int32 hlen; __DUP(name, name__len, CHAR); f = Files_Old(name, name__len); if (f == NIL) { @@ -1570,7 +1570,7 @@ void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len) Texts_Load0(&r, Files_Rider__typ, T); } else { __NEW(u, Texts_RunDesc); - u->len = 9223372036854775807; + u->len = 2147483647; u->fnt = NIL; u->col = 15; __NEW(p, Texts_PieceDesc); @@ -1614,12 +1614,12 @@ static struct Store__39 { struct Store__39 *lnk; } *Store__39_s; -static void StoreElem__40 (Files_Rider *r, address *r__typ, int64 pos, Texts_Elem e); +static void StoreElem__40 (Files_Rider *r, address *r__typ, int32 pos, Texts_Elem e); -static void StoreElem__40 (Files_Rider *r, address *r__typ, int64 pos, Texts_Elem e) +static void StoreElem__40 (Files_Rider *r, address *r__typ, int32 pos, Texts_Elem e) { Files_Rider r1; - int64 org, span; + int32 org, span; int8 eno; __COPY((*Store__39_s->iden).mod, (*Store__39_s->mods)[__X(*Store__39_s->ecnt, 64)], 32); __COPY((*Store__39_s->iden).proc, (*Store__39_s->procs)[__X(*Store__39_s->ecnt, 64)], 32); @@ -1651,7 +1651,7 @@ void Texts_Store (Files_Rider *r, address *r__typ, Texts_Text T) Files_Rider r1; Texts_Run u = NIL, un = NIL; Texts_Elem e = NIL; - int64 org, pos, delta, hlen, rlen; + int32 org, pos, delta, hlen, rlen; int8 ecnt, fno, fcnt; CHAR ch; Texts_FileMsg msg; @@ -1769,7 +1769,7 @@ void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len) { Files_File f = NIL; Files_Rider r; - int32 i, res; + int16 i, res; CHAR bak[64]; __DUP(name, name__len, CHAR); f = Files_New(name, name__len); @@ -1803,16 +1803,16 @@ __TDESC(Texts_FontDesc, 1, 0) = {__TDFLDS("FontDesc", 32), {-8}}; __TDESC(Texts_RunDesc, 1, 3) = {__TDFLDS("RunDesc", 40), {0, 8, 24, -32}}; __TDESC(Texts_PieceDesc, 1, 4) = {__TDFLDS("PieceDesc", 56), {0, 8, 24, 40, -40}}; __TDESC(Texts_ElemMsg, 1, 0) = {__TDFLDS("ElemMsg", 1), {-8}}; -__TDESC(Texts_ElemDesc, 1, 4) = {__TDFLDS("ElemDesc", 72), {0, 8, 24, 64, -40}}; -__TDESC(Texts_FileMsg, 1, 1) = {__TDFLDS("FileMsg", 56), {32, -16}}; +__TDESC(Texts_ElemDesc, 1, 4) = {__TDFLDS("ElemDesc", 64), {0, 8, 24, 56, -40}}; +__TDESC(Texts_FileMsg, 1, 1) = {__TDFLDS("FileMsg", 32), {16, -16}}; __TDESC(Texts_CopyMsg, 1, 1) = {__TDFLDS("CopyMsg", 8), {0, -16}}; __TDESC(Texts_IdentifyMsg, 1, 0) = {__TDFLDS("IdentifyMsg", 64), {-8}}; __TDESC(Texts_BufDesc, 1, 1) = {__TDFLDS("BufDesc", 16), {8, -16}}; __TDESC(Texts_TextDesc, 1, 2) = {__TDFLDS("TextDesc", 40), {16, 24, -24}}; -__TDESC(Texts_Reader, 1, 4) = {__TDFLDS("Reader", 96), {8, 24, 48, 72, -40}}; -__TDESC(Texts_Scanner, 1, 4) = {__TDFLDS("Scanner", 208), {8, 24, 48, 72, -40}}; -__TDESC(Texts_Writer, 1, 4) = {__TDFLDS("Writer", 72), {0, 8, 40, 64, -40}}; -__TDESC(Texts__1, 1, 5) = {__TDFLDS("", 160), {0, 8, 24, 64, 72, -48}}; +__TDESC(Texts_Reader, 1, 4) = {__TDFLDS("Reader", 72), {8, 24, 40, 56, -40}}; +__TDESC(Texts_Scanner, 1, 4) = {__TDFLDS("Scanner", 168), {8, 24, 40, 56, -40}}; +__TDESC(Texts_Writer, 1, 4) = {__TDFLDS("Writer", 56), {0, 8, 32, 48, -40}}; +__TDESC(Texts__1, 1, 5) = {__TDFLDS("", 144), {0, 8, 24, 56, 64, -48}}; export void *Texts__init(void) { diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index e85157ed..fa080b7f 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -8,8 +8,8 @@ typedef struct Texts_BufDesc { - int64 len; - char _prvt0[8]; + int32 len; + int64 _prvt0; } Texts_BufDesc; typedef @@ -39,16 +39,17 @@ typedef typedef struct Texts_ElemDesc { - char _prvt0[40]; - int64 W, H; + int64 _prvt0; + char _prvt1[28]; + int32 W, H; Texts_Handler handle; - char _prvt1[8]; + char _prvt2[8]; } Texts_ElemDesc; typedef struct Texts_FileMsg { /* Texts_ElemMsg */ - int32 id; - int64 pos; + int16 id; + int32 pos; Files_Rider r; } Texts_FileMsg; @@ -69,7 +70,7 @@ typedef struct Texts_TextDesc *Texts_Text; typedef - void (*Texts_Notifier)(Texts_Text, int32, int64, int64); + void (*Texts_Notifier)(Texts_Text, int16, int32, int32); typedef struct Texts_Reader { @@ -77,7 +78,7 @@ typedef Texts_FontsFont fnt; int8 col, voff; Texts_Elem elem; - char _prvt0[64]; + char _prvt0[40]; } Texts_Reader; typedef @@ -86,10 +87,10 @@ typedef Texts_FontsFont fnt; int8 col, voff; Texts_Elem elem; - char _prvt0[64]; + char _prvt0[40]; CHAR nextCh; - int32 line, class; - int64 i; + int16 line, class; + int32 i; REAL x; LONGREAL y; CHAR c; @@ -99,9 +100,9 @@ typedef typedef struct Texts_TextDesc { - int64 len; + int32 len; Texts_Notifier notify; - char _prvt0[24]; + char _prvt0[20]; } Texts_TextDesc; typedef @@ -109,7 +110,7 @@ typedef Texts_Buffer buf; Texts_FontsFont fnt; int8 col, voff; - char _prvt0[54]; + char _prvt0[38]; } Texts_Writer; @@ -129,41 +130,41 @@ import address *Texts_Scanner__typ; import address *Texts_Writer__typ; import void Texts_Append (Texts_Text T, Texts_Buffer B); -import void Texts_ChangeLooks (Texts_Text T, int64 beg, int64 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff); +import void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff); import void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len); import void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); import void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); -import void Texts_Delete (Texts_Text T, int64 beg, int64 end); +import void Texts_Delete (Texts_Text T, int32 beg, int32 end); import Texts_Text Texts_ElemBase (Texts_Elem E); -import int64 Texts_ElemPos (Texts_Elem E); -import void Texts_Insert (Texts_Text T, int64 pos, Texts_Buffer B); +import int32 Texts_ElemPos (Texts_Elem E); +import void Texts_Insert (Texts_Text T, int32 pos, Texts_Buffer B); import void Texts_Load (Files_Rider *r, address *r__typ, Texts_Text T); import void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len); import void Texts_OpenBuf (Texts_Buffer B); -import void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int64 pos); -import void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int64 pos); +import void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int32 pos); +import void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int32 pos); import void Texts_OpenWriter (Texts_Writer *W, address *W__typ); -import int64 Texts_Pos (Texts_Reader *R, address *R__typ); +import int32 Texts_Pos (Texts_Reader *R, address *R__typ); import void Texts_Read (Texts_Reader *R, address *R__typ, CHAR *ch); import void Texts_ReadElem (Texts_Reader *R, address *R__typ); import void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ); import void Texts_Recall (Texts_Buffer *B); -import void Texts_Save (Texts_Text T, int64 beg, int64 end, Texts_Buffer B); +import void Texts_Save (Texts_Text T, int32 beg, int32 end, Texts_Buffer B); import void Texts_Scan (Texts_Scanner *S, address *S__typ); import void Texts_SetColor (Texts_Writer *W, address *W__typ, int8 col); import void Texts_SetFont (Texts_Writer *W, address *W__typ, Texts_FontsFont fnt); import void Texts_SetOffset (Texts_Writer *W, address *W__typ, int8 voff); import void Texts_Store (Files_Rider *r, address *r__typ, Texts_Text T); import void Texts_Write (Texts_Writer *W, address *W__typ, CHAR ch); -import void Texts_WriteDate (Texts_Writer *W, address *W__typ, int64 t, int64 d); +import void Texts_WriteDate (Texts_Writer *W, address *W__typ, int32 t, int32 d); import void Texts_WriteElem (Texts_Writer *W, address *W__typ, Texts_Elem e); -import void Texts_WriteHex (Texts_Writer *W, address *W__typ, int64 x); +import void Texts_WriteHex (Texts_Writer *W, address *W__typ, int32 x); import void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n); import void Texts_WriteLn (Texts_Writer *W, address *W__typ); -import void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int32 n); +import void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int16 n); import void Texts_WriteLongRealHex (Texts_Writer *W, address *W__typ, LONGREAL x); -import void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int32 n); -import void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int32 n, int32 k); +import void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int16 n); +import void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int16 n, int16 k); import void Texts_WriteRealHex (Texts_Writer *W, address *W__typ, REAL x); import void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGINT s__len); import void *Texts__init(void); diff --git a/bootstrap/unix-88/Vishap.c b/bootstrap/unix-88/Vishap.c index 5c6cada1..1ec89e33 100644 --- a/bootstrap/unix-88/Vishap.c +++ b/bootstrap/unix-88/Vishap.c @@ -1,8 +1,8 @@ /* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspamSf */ -#define INTEGER int32 -#define LONGINT int64 -#define SET uint64 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Configuration.h" @@ -25,7 +25,7 @@ static CHAR Vishap_mname[256]; export void Vishap_Module (BOOLEAN *done); static void Vishap_PropagateElementaryTypeSizes (void); export void Vishap_Translate (void); -static void Vishap_Trap (int32 sig); +static void Vishap_Trap (int16 sig); void Vishap_Module (BOOLEAN *done) @@ -42,22 +42,22 @@ void Vishap_Module (BOOLEAN *done) OPC_Init(); OPV_Module(p); if (OPM_noerr) { - if ((__IN(10, OPM_opt, 64) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { + if ((__IN(10, OPM_opt, 32) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { OPM_DeleteNewSym(); - if (!__IN(16, OPM_opt, 64)) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"32m", 4); } OPM_LogWStr((CHAR*)" Main program.", 16); - if (!__IN(16, OPM_opt, 64)) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } } else { if (new) { - if (!__IN(16, OPM_opt, 64)) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"32m", 4); } OPM_LogWStr((CHAR*)" New symbol file.", 19); - if (!__IN(16, OPM_opt, 64)) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } OPM_RegisterNewSym(); @@ -111,17 +111,17 @@ void Vishap_Translate (void) OPM_LogWLn(); Platform_Exit(1); } - if (!__IN(13, OPM_opt, 64)) { - if (__IN(14, OPM_opt, 64)) { + if (!__IN(13, OPM_opt, 32)) { + if (__IN(14, OPM_opt, 32)) { extTools_Assemble(OPM_modName, 32); } else { - if (!__IN(10, OPM_opt, 64)) { + if (!__IN(10, OPM_opt, 32)) { extTools_Assemble(OPM_modName, 32); Strings_Append((CHAR*)" ", 2, (void*)modulesobj, 2048); Strings_Append(OPM_modName, 32, (void*)modulesobj, 2048); Strings_Append((CHAR*)".o", 3, (void*)modulesobj, 2048); } else { - extTools_LinkMain((void*)OPM_modName, 32, __IN(15, OPM_opt, 64), modulesobj, 2048); + extTools_LinkMain((void*)OPM_modName, 32, __IN(15, OPM_opt, 32), modulesobj, 2048); } } } @@ -129,7 +129,7 @@ void Vishap_Translate (void) } } -static void Vishap_Trap (int32 sig) +static void Vishap_Trap (int16 sig) { Heap_FINALL(); if (sig == 3) { diff --git a/bootstrap/unix-88/errors.c b/bootstrap/unix-88/errors.c index 4bb09433..0a40d5e9 100644 --- a/bootstrap/unix-88/errors.c +++ b/bootstrap/unix-88/errors.c @@ -1,8 +1,8 @@ /* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ -#define INTEGER int32 -#define LONGINT int64 -#define SET uint64 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index d6bc2194..8be0b63d 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,8 +1,8 @@ /* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ -#define INTEGER int32 -#define LONGINT int64 -#define SET uint64 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Configuration.h" @@ -22,10 +22,10 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGINT cmd__len) { - int32 r, status, exitcode; + int16 r, status, exitcode; __DUP(title, title__len, CHAR); __DUP(cmd, cmd__len, CHAR); - if (__IN(18, OPM_opt, 64)) { + if (__IN(18, OPM_opt, 32)) { Console_String(title, title__len); Console_String(cmd, cmd__len); Console_Ln(); diff --git a/bootstrap/unix-88/vt100.c b/bootstrap/unix-88/vt100.c index bb55d599..4f6a6c9d 100644 --- a/bootstrap/unix-88/vt100.c +++ b/bootstrap/unix-88/vt100.c @@ -1,8 +1,8 @@ /* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ -#define INTEGER int32 -#define LONGINT int64 -#define SET uint64 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Console.h" @@ -13,36 +13,36 @@ export CHAR vt100_CSI[5]; static CHAR vt100_tmpstr[32]; -export void vt100_CHA (int32 n); -export void vt100_CNL (int32 n); -export void vt100_CPL (int32 n); -export void vt100_CUB (int32 n); -export void vt100_CUD (int32 n); -export void vt100_CUF (int32 n); -export void vt100_CUP (int32 n, int32 m); -export void vt100_CUU (int32 n); +export void vt100_CHA (int16 n); +export void vt100_CNL (int16 n); +export void vt100_CPL (int16 n); +export void vt100_CUB (int16 n); +export void vt100_CUD (int16 n); +export void vt100_CUF (int16 n); +export void vt100_CUP (int16 n, int16 m); +export void vt100_CUU (int16 n); export void vt100_DECTCEMh (void); export void vt100_DECTCEMl (void); -export void vt100_DSR (int32 n); -export void vt100_ED (int32 n); -export void vt100_EL (int32 n); -static void vt100_EscSeq (int32 n, CHAR *letter, LONGINT letter__len); +export void vt100_DSR (int16 n); +export void vt100_ED (int16 n); +export void vt100_EL (int16 n); +static void vt100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len); static void vt100_EscSeq0 (CHAR *letter, LONGINT letter__len); -static void vt100_EscSeq2 (int32 n, int32 m, CHAR *letter, LONGINT letter__len); -static void vt100_EscSeqSwapped (int32 n, CHAR *letter, LONGINT letter__len); -export void vt100_HVP (int32 n, int32 m); -export void vt100_IntToStr (int64 int_, CHAR *str, LONGINT str__len); +static void vt100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len); +static void vt100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len); +export void vt100_HVP (int16 n, int16 m); +export void vt100_IntToStr (int32 int_, CHAR *str, LONGINT str__len); export void vt100_RCP (void); -static void vt100_Reverse0 (CHAR *str, LONGINT str__len, int32 start, int32 end); +static void vt100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end); export void vt100_SCP (void); -export void vt100_SD (int32 n); -export void vt100_SGR (int32 n); -export void vt100_SGR2 (int32 n, int32 m); -export void vt100_SU (int32 n); +export void vt100_SD (int16 n); +export void vt100_SGR (int16 n); +export void vt100_SGR2 (int16 n, int16 m); +export void vt100_SU (int16 n); export void vt100_SetAttr (CHAR *attr, LONGINT attr__len); -static void vt100_Reverse0 (CHAR *str, LONGINT str__len, int32 start, int32 end) +static void vt100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end) { CHAR h; while (start < end) { @@ -54,15 +54,15 @@ static void vt100_Reverse0 (CHAR *str, LONGINT str__len, int32 start, int32 end) } } -void vt100_IntToStr (int64 int_, CHAR *str, LONGINT str__len) +void vt100_IntToStr (int32 int_, CHAR *str, LONGINT str__len) { CHAR b[21]; - int32 s, e; + int16 s, e; int8 maxLength; - maxLength = 20; - if (int_ == (-9223372036854775807-1)) { - __MOVE("-9223372036854775808", b, 21); - e = 20; + maxLength = 11; + if (int_ == (-2147483647-1)) { + __MOVE("-2147483648", b, 12); + e = 11; } else { if (int_ < 0) { b[0] = '-'; @@ -73,7 +73,7 @@ void vt100_IntToStr (int64 int_, CHAR *str, LONGINT str__len) } e = s; do { - b[__X(e, 21)] = (CHAR)(__MOD(int_, 10) + 48); + b[__X(e, 21)] = (CHAR)((int)__MOD(int_, 10) + 48); int_ = __DIV(int_, 10); e += 1; } while (!(int_ == 0)); @@ -93,7 +93,7 @@ static void vt100_EscSeq0 (CHAR *letter, LONGINT letter__len) __DEL(letter); } -static void vt100_EscSeq (int32 n, CHAR *letter, LONGINT letter__len) +static void vt100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len) { CHAR nstr[2]; CHAR cmd[7]; @@ -106,7 +106,7 @@ static void vt100_EscSeq (int32 n, CHAR *letter, LONGINT letter__len) __DEL(letter); } -static void vt100_EscSeqSwapped (int32 n, CHAR *letter, LONGINT letter__len) +static void vt100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len) { CHAR nstr[2]; CHAR cmd[7]; @@ -119,7 +119,7 @@ static void vt100_EscSeqSwapped (int32 n, CHAR *letter, LONGINT letter__len) __DEL(letter); } -static void vt100_EscSeq2 (int32 n, int32 m, CHAR *letter, LONGINT letter__len) +static void vt100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len) { CHAR nstr[5], mstr[5]; CHAR cmd[12]; @@ -135,82 +135,82 @@ static void vt100_EscSeq2 (int32 n, int32 m, CHAR *letter, LONGINT letter__len) __DEL(letter); } -void vt100_CUU (int32 n) +void vt100_CUU (int16 n) { vt100_EscSeq(n, (CHAR*)"A", 2); } -void vt100_CUD (int32 n) +void vt100_CUD (int16 n) { vt100_EscSeq(n, (CHAR*)"B", 2); } -void vt100_CUF (int32 n) +void vt100_CUF (int16 n) { vt100_EscSeq(n, (CHAR*)"C", 2); } -void vt100_CUB (int32 n) +void vt100_CUB (int16 n) { vt100_EscSeq(n, (CHAR*)"D", 2); } -void vt100_CNL (int32 n) +void vt100_CNL (int16 n) { vt100_EscSeq(n, (CHAR*)"E", 2); } -void vt100_CPL (int32 n) +void vt100_CPL (int16 n) { vt100_EscSeq(n, (CHAR*)"F", 2); } -void vt100_CHA (int32 n) +void vt100_CHA (int16 n) { vt100_EscSeq(n, (CHAR*)"G", 2); } -void vt100_CUP (int32 n, int32 m) +void vt100_CUP (int16 n, int16 m) { vt100_EscSeq2(n, m, (CHAR*)"H", 2); } -void vt100_ED (int32 n) +void vt100_ED (int16 n) { vt100_EscSeq(n, (CHAR*)"J", 2); } -void vt100_EL (int32 n) +void vt100_EL (int16 n) { vt100_EscSeq(n, (CHAR*)"K", 2); } -void vt100_SU (int32 n) +void vt100_SU (int16 n) { vt100_EscSeq(n, (CHAR*)"S", 2); } -void vt100_SD (int32 n) +void vt100_SD (int16 n) { vt100_EscSeq(n, (CHAR*)"T", 2); } -void vt100_HVP (int32 n, int32 m) +void vt100_HVP (int16 n, int16 m) { vt100_EscSeq2(n, m, (CHAR*)"f", 2); } -void vt100_SGR (int32 n) +void vt100_SGR (int16 n) { vt100_EscSeq(n, (CHAR*)"m", 2); } -void vt100_SGR2 (int32 n, int32 m) +void vt100_SGR2 (int16 n, int16 m) { vt100_EscSeq2(n, m, (CHAR*)"m", 2); } -void vt100_DSR (int32 n) +void vt100_DSR (int16 n) { vt100_EscSeq(6, (CHAR*)"n", 2); } diff --git a/bootstrap/unix-88/vt100.h b/bootstrap/unix-88/vt100.h index 2bc7d18f..94f8add4 100644 --- a/bootstrap/unix-88/vt100.h +++ b/bootstrap/unix-88/vt100.h @@ -9,27 +9,27 @@ import CHAR vt100_CSI[5]; -import void vt100_CHA (int32 n); -import void vt100_CNL (int32 n); -import void vt100_CPL (int32 n); -import void vt100_CUB (int32 n); -import void vt100_CUD (int32 n); -import void vt100_CUF (int32 n); -import void vt100_CUP (int32 n, int32 m); -import void vt100_CUU (int32 n); +import void vt100_CHA (int16 n); +import void vt100_CNL (int16 n); +import void vt100_CPL (int16 n); +import void vt100_CUB (int16 n); +import void vt100_CUD (int16 n); +import void vt100_CUF (int16 n); +import void vt100_CUP (int16 n, int16 m); +import void vt100_CUU (int16 n); import void vt100_DECTCEMh (void); import void vt100_DECTCEMl (void); -import void vt100_DSR (int32 n); -import void vt100_ED (int32 n); -import void vt100_EL (int32 n); -import void vt100_HVP (int32 n, int32 m); -import void vt100_IntToStr (int64 int_, CHAR *str, LONGINT str__len); +import void vt100_DSR (int16 n); +import void vt100_ED (int16 n); +import void vt100_EL (int16 n); +import void vt100_HVP (int16 n, int16 m); +import void vt100_IntToStr (int32 int_, CHAR *str, LONGINT str__len); import void vt100_RCP (void); import void vt100_SCP (void); -import void vt100_SD (int32 n); -import void vt100_SGR (int32 n); -import void vt100_SGR2 (int32 n, int32 m); -import void vt100_SU (int32 n); +import void vt100_SD (int16 n); +import void vt100_SGR (int16 n); +import void vt100_SGR2 (int16 n, int16 m); +import void vt100_SU (int16 n); import void vt100_SetAttr (CHAR *attr, LONGINT attr__len); import void *vt100__init(void); diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index af4f4fc4..e09bf1b4 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -2024,7 +2024,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) p->typ = OPT_notyp; } else { if (x->typ != p->typ) { - if ((x->class == 7 && f == 4)) { + if ((f == 4 && (x->class == 7 || (p->typ->form == 4 && x->typ->size <= p->typ->size)))) { OPB_Convert(&x, p->typ); } else { OPB_err(111); diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 039d1c77..2769f708 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1124,8 +1124,8 @@ export void *OPM__init(void) OPM_AddressSize = 8; OPM_Alignment = 8; OPM_ShortintSize = 1; - OPM_IntegerSize = 4; - OPM_LongintSize = 8; - OPM_SetSize = 8; + OPM_IntegerSize = 2; + OPM_LongintSize = 4; + OPM_SetSize = 4; __ENDMOD; } diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 54a94ae8..8aeae1b8 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -13,7 +13,7 @@ typedef Platform_ArgPtr (*Platform_ArgVec)[1024]; typedef - int32 (*Platform_ArgVecPtr)[1]; + address (*Platform_ArgVecPtr)[1]; typedef CHAR (*Platform_EnvPtr)[1024]; @@ -74,8 +74,8 @@ export address Platform_OSAllocate (address size); export void Platform_OSFree (address address); export int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); export int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); -export int16 Platform_Read (int32 h, address p, address l, address *n); -export int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, address *n); +export int16 Platform_Read (int32 h, address p, int32 l, int32 *n); +export int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n); export int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); export BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); export BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); @@ -92,7 +92,7 @@ export BOOLEAN Platform_TimedOut (int16 e); export BOOLEAN Platform_TooManyFiles (int16 e); export int16 Platform_Truncate (int32 h, int32 limit); export int16 Platform_Unlink (CHAR *n, LONGINT n__len); -export int16 Platform_Write (int32 h, int32 p, int32 l); +export int16 Platform_Write (int32 h, address p, int32 l); static void Platform_YMDHMStoClock (int16 ye, int16 mo, int16 da, int16 ho, int16 mi, int16 se, int32 *t, int32 *d); static void Platform_errch (CHAR c); static void Platform_errint (int32 l); @@ -543,41 +543,43 @@ int16 Platform_Size (int32 h, int32 *l) return _o_result; } -int16 Platform_Read (int32 h, address p, address l, address *n) +int16 Platform_Read (int32 h, address p, int32 l, int32 *n) { int16 _o_result; int16 result; - *n = 0; - result = Platform_readfile(h, p, l, &*n); + int32 lengthread; + result = Platform_readfile(h, p, l, &lengthread); if (result == 0) { *n = 0; _o_result = Platform_err(); return _o_result; } else { + *n = lengthread; _o_result = 0; return _o_result; } __RETCHK; } -int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, address *n) +int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n) { int16 _o_result; int16 result; - *n = 0; - result = Platform_readfile(h, (address)b, b__len, &*n); + int32 lengthread; + result = Platform_readfile(h, (address)b, b__len, &lengthread); if (result == 0) { *n = 0; _o_result = Platform_err(); return _o_result; } else { + *n = lengthread; _o_result = 0; return _o_result; } __RETCHK; } -int16 Platform_Write (int32 h, int32 p, int32 l) +int16 Platform_Write (int32 h, address p, int32 l) { int16 _o_result; if (Platform_writefile(h, p, l) == 0) { diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index 18ca5267..d62dd343 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -58,8 +58,8 @@ import address Platform_OSAllocate (address size); import void Platform_OSFree (address address); import int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); import int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); -import int16 Platform_Read (int32 h, address p, address l, address *n); -import int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, address *n); +import int16 Platform_Read (int32 h, address p, int32 l, int32 *n); +import int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n); import int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); import BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); import BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); @@ -75,7 +75,7 @@ import BOOLEAN Platform_TimedOut (int16 e); import BOOLEAN Platform_TooManyFiles (int16 e); import int16 Platform_Truncate (int32 h, int32 limit); import int16 Platform_Unlink (CHAR *n, LONGINT n__len); -import int16 Platform_Write (int32 h, int32 p, int32 l); +import int16 Platform_Write (int32 h, address p, int32 l); import BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); import void *Platform__init(void); diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index fa5765f3..abdf151b 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,8 +1,8 @@ /* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ -#define INTEGER int32 -#define LONGINT int64 -#define SET uint64 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" diff --git a/bootstrap/windows-88/Console.c b/bootstrap/windows-88/Console.c index 939de5cc..7b492ced 100644 --- a/bootstrap/windows-88/Console.c +++ b/bootstrap/windows-88/Console.c @@ -1,21 +1,21 @@ /* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ -#define INTEGER int32 -#define LONGINT int64 -#define SET uint64 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Platform.h" static CHAR Console_line[128]; -static int32 Console_pos; +static int16 Console_pos; export void Console_Bool (BOOLEAN b); export void Console_Char (CHAR ch); export void Console_Flush (void); -export void Console_Hex (int64 i); +export void Console_Hex (int32 i); export void Console_Int (int64 i, int64 n); export void Console_Ln (void); export void Console_Read (CHAR *ch); @@ -25,7 +25,7 @@ export void Console_String (CHAR *s, LONGINT s__len); void Console_Flush (void) { - int32 error; + int16 error; error = Platform_Write(Platform_StdOut, (address)Console_line, Console_pos); Console_pos = 0; } @@ -44,7 +44,7 @@ void Console_Char (CHAR ch) void Console_String (CHAR *s, LONGINT s__len) { - int32 i; + int16 i; __DUP(s, s__len, CHAR); i = 0; while (s[__X(i, s__len)] != 0x00) { @@ -57,17 +57,17 @@ void Console_String (CHAR *s, LONGINT s__len) void Console_Int (int64 i, int64 n) { CHAR s[32]; - int64 i1, k; - if (i == __LSHL(1, 63, 64)) { - __MOVE("8085774586302733229", s, 20); - k = 19; + int32 i1, k; + if (i == (int64)__LSHL(1, 31, 32)) { + __MOVE("8463847412", s, 11); + k = 10; } else { - i1 = __ABS((int64)i); - s[0] = (CHAR)(__MOD(i1, 10) + 48); + i1 = __ABS(__VAL(int32, i)); + s[0] = (CHAR)((int)__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k = 1; while (i1 > 0) { - s[__X(k, 32)] = (CHAR)(__MOD(i1, 10) + 48); + s[__X(k, 32)] = (CHAR)((int)__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k += 1; } @@ -76,7 +76,7 @@ void Console_Int (int64 i, int64 n) s[__X(k, 32)] = '-'; k += 1; } - while (n > k) { + while (n > (int64)k) { Console_Char(' '); n -= 1; } @@ -100,11 +100,11 @@ void Console_Bool (BOOLEAN b) } } -void Console_Hex (int64 i) +void Console_Hex (int32 i) { - int32 k; + int16 k; int64 n; - k = -60; + k = -28; while (k <= 0) { n = __MASK(__ASH(i, k), -16); if (n <= 9) { @@ -118,8 +118,8 @@ void Console_Hex (int64 i) void Console_Read (CHAR *ch) { - int64 n; - int32 error; + int32 n; + int16 error; Console_Flush(); error = Platform_ReadBuf(Platform_StdIn, (void*)&*ch, 1, &n); if (n != 1) { @@ -129,7 +129,7 @@ void Console_Read (CHAR *ch) void Console_ReadLine (CHAR *line, LONGINT line__len) { - int64 i; + int32 i; CHAR ch; Console_Flush(); i = 0; diff --git a/bootstrap/windows-88/Console.h b/bootstrap/windows-88/Console.h index 64d39044..b08c93ea 100644 --- a/bootstrap/windows-88/Console.h +++ b/bootstrap/windows-88/Console.h @@ -11,7 +11,7 @@ import void Console_Bool (BOOLEAN b); import void Console_Char (CHAR ch); import void Console_Flush (void); -import void Console_Hex (int64 i); +import void Console_Hex (int32 i); import void Console_Int (int64 i, int64 n); import void Console_Ln (void); import void Console_Read (CHAR *ch); diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 27fb9031..c30a1491 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,8 +1,8 @@ /* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tspaSfF */ -#define INTEGER int32 -#define LONGINT int64 -#define SET uint64 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Configuration.h" @@ -18,7 +18,7 @@ typedef struct Files_BufDesc { Files_File f; BOOLEAN chg; - int64 org, size; + int32 org, size; SYSTEM_BYTE data[4096]; } Files_BufDesc; @@ -33,23 +33,23 @@ typedef Files_FileName workName, registerName; BOOLEAN tempFile; Platform_FileIdentity identity; - int64 fd, len, pos; + int32 fd, len, pos; Files_Buffer bufs[4]; - int32 swapper, state; + int16 swapper, state; Files_File next; } Files_FileDesc; typedef struct Files_Rider { - int64 res; + int32 res; BOOLEAN eof; Files_Buffer buf; - int64 org, offset; + int32 org, offset; } Files_Rider; static Files_File Files_files; -static int32 Files_tempno; +static int16 Files_tempno; static CHAR Files_HOME[1024]; static struct { LONGINT len[1]; @@ -62,50 +62,50 @@ export address *Files_Rider__typ; export Files_File Files_Base (Files_Rider *r, address *r__typ); static Files_File Files_CacheEntry (Platform_FileIdentity identity); -export void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int32 *res); +export void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int16 *res); export void Files_Close (Files_File f); static void Files_CloseOSFile (Files_File f); static void Files_Create (Files_File f); -export void Files_Delete (CHAR *name, LONGINT name__len, int32 *res); -static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int32 errcode); +export void Files_Delete (CHAR *name, LONGINT name__len, int16 *res); +static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int16 errcode); static void Files_Finalize (SYSTEM_PTR o); static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *dest, LONGINT dest__len); static void Files_Flush (Files_Buffer buf); -export void Files_GetDate (Files_File f, int64 *t, int64 *d); +export void Files_GetDate (Files_File f, int32 *t, int32 *d); export void Files_GetName (Files_File f, CHAR *name, LONGINT name__len); static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *name, LONGINT name__len); static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len); -export int64 Files_Length (Files_File f); +export int32 Files_Length (Files_File f); static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT name__len, CHAR *dest, LONGINT dest__len); export Files_File Files_New (CHAR *name, LONGINT name__len); export Files_File Files_Old (CHAR *name, LONGINT name__len); -export int64 Files_Pos (Files_Rider *r, address *r__typ); +export int32 Files_Pos (Files_Rider *r, address *r__typ); export void Files_Purge (Files_File f); export void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x); export void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x); export void Files_ReadByte (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len); -export void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int64 n); -export void Files_ReadInt (Files_Rider *R, address *R__typ, int32 *x); -export void Files_ReadLInt (Files_Rider *R, address *R__typ, int64 *x); +export void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); +export void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x); +export void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); export void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); export void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); -export void Files_ReadNum (Files_Rider *R, address *R__typ, int64 *x); +export void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x); export void Files_ReadNum64 (Files_Rider *R, address *R__typ, int64 *x); export void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); export void Files_ReadSet (Files_Rider *R, address *R__typ, SET *x); export void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); export void Files_Register (Files_File f); -export void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int32 *res); -static void Files_ScanPath (int32 *pos, CHAR *dir, LONGINT dir__len); -export void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int64 pos); +export void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res); +static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len); +export void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos); export void Files_SetSearchPath (CHAR *path, LONGINT path__len); export void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x); export void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x); -export void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int64 n); -export void Files_WriteInt (Files_Rider *R, address *R__typ, int32 x); -export void Files_WriteLInt (Files_Rider *R, address *R__typ, int64 x); +export void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); +export void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x); +export void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x); export void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x); -export void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x); +export void Files_WriteNum (Files_Rider *R, address *R__typ, int32 x); export void Files_WriteNum64 (Files_Rider *R, address *R__typ, int64 x); export void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x); export void Files_WriteSet (Files_Rider *R, address *R__typ, SET x); @@ -113,7 +113,7 @@ export void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT #define Files_IdxTrap() __HALT(-1) -static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int32 errcode) +static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int16 errcode) { __DUP(s, s__len, CHAR); Console_Ln(); @@ -142,7 +142,7 @@ static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int32 errcode) static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT name__len, CHAR *dest, LONGINT dest__len) { - int32 i, j; + int16 i, j; __DUP(dir, dir__len, CHAR); __DUP(name, name__len, CHAR); i = 0; @@ -167,7 +167,7 @@ static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *name, LONGINT name__len) { - int64 n, i, j; + int32 n, i, j; __DUP(finalName, finalName__len, CHAR); Files_tempno += 1; n = Files_tempno; @@ -199,7 +199,7 @@ static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *na name[i + 5] = '.'; i += 6; while (n > 0) { - name[i] = (CHAR)(__MOD(n, 10) + 48); + name[i] = (CHAR)((int)__MOD(n, 10) + 48); n = __DIV(n, 10); i += 1; } @@ -207,7 +207,7 @@ static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *na i += 1; n = Platform_PID; while (n > 0) { - name[i] = (CHAR)(__MOD(n, 10) + 48); + name[i] = (CHAR)((int)__MOD(n, 10) + 48); n = __DIV(n, 10); i += 1; } @@ -219,7 +219,7 @@ static void Files_Create (Files_File f) { Platform_FileIdentity identity; BOOLEAN done; - int32 error; + int16 error; CHAR err[32]; if (f->fd == -1) { if (f->state == 1) { @@ -256,7 +256,7 @@ static void Files_Create (Files_File f) static void Files_Flush (Files_Buffer buf) { - int32 error; + int16 error; Files_File f = NIL; if (buf->chg) { f = buf->f; @@ -280,7 +280,7 @@ static void Files_Flush (Files_Buffer buf) static void Files_CloseOSFile (Files_File f) { Files_File prev = NIL; - int32 error; + int16 error; if (Files_files == f) { Files_files = f->next; } else { @@ -300,8 +300,8 @@ static void Files_CloseOSFile (Files_File f) void Files_Close (Files_File f) { - int64 i; - int32 error; + int32 i; + int16 error; if (f->state != 1 || f->registerName[0] != 0x00) { Files_Create(f); i = 0; @@ -317,9 +317,9 @@ void Files_Close (Files_File f) } } -int64 Files_Length (Files_File f) +int32 Files_Length (Files_File f) { - int64 _o_result; + int32 _o_result; _o_result = f->len; return _o_result; } @@ -342,9 +342,9 @@ Files_File Files_New (CHAR *name, LONGINT name__len) return _o_result; } -static void Files_ScanPath (int32 *pos, CHAR *dir, LONGINT dir__len) +static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len) { - int32 i; + int16 i; CHAR ch; i = 0; if (Files_SearchPath == NIL) { @@ -388,7 +388,7 @@ static void Files_ScanPath (int32 *pos, CHAR *dir, LONGINT dir__len) static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len) { BOOLEAN _o_result; - int32 i; + int16 i; CHAR ch; i = 0; ch = name[0]; @@ -404,7 +404,7 @@ static Files_File Files_CacheEntry (Platform_FileIdentity identity) { Files_File _o_result; Files_File f = NIL; - int32 i, error; + int16 i, error; f = Files_files; while (f != NIL) { if (Platform_SameFile(identity, f->identity)) { @@ -434,11 +434,11 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) { Files_File _o_result; Files_File f = NIL; - int64 fd; - int32 pos; + int32 fd; + int16 pos; BOOLEAN done; CHAR dir[256], path[256]; - int32 error; + int16 error; Platform_FileIdentity identity; __DUP(name, name__len, CHAR); if (name[0] != 0x00) { @@ -513,9 +513,9 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) void Files_Purge (Files_File f) { - int32 i; + int16 i; Platform_FileIdentity identity; - int32 error; + int16 error; i = 0; while (i < 4) { if (f->bufs[i] != NIL) { @@ -535,27 +535,27 @@ void Files_Purge (Files_File f) Platform_SetMTime(&f->identity, Platform_FileIdentity__typ, identity); } -void Files_GetDate (Files_File f, int64 *t, int64 *d) +void Files_GetDate (Files_File f, int32 *t, int32 *d) { Platform_FileIdentity identity; - int32 error; + int16 error; Files_Create(f); error = Platform_Identify(f->fd, &identity, Platform_FileIdentity__typ); Platform_MTimeAsClock(identity, &*t, &*d); } -int64 Files_Pos (Files_Rider *r, address *r__typ) +int32 Files_Pos (Files_Rider *r, address *r__typ) { - int64 _o_result; + int32 _o_result; _o_result = (*r).org + (*r).offset; return _o_result; } -void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int64 pos) +void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos) { - int64 org, offset, i, n; + int32 org, offset, i, n; Files_Buffer buf = NIL; - int32 error; + int16 error; if (f != NIL) { if (pos > f->len) { pos = f->len; @@ -615,7 +615,7 @@ void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int64 pos) void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x) { - int64 offset; + int32 offset; Files_Buffer buf = NIL; buf = (*r).buf; offset = (*r).offset; @@ -637,9 +637,9 @@ void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x) } } -void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int64 n) +void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n) { - int64 xpos, min, restInBuf, offset; + int32 xpos, min, restInBuf, offset; Files_Buffer buf = NIL; if (n > x__len) { Files_IdxTrap(); @@ -663,7 +663,7 @@ void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x } else { min = n; } - __MOVE(((address)buf->data) + offset, ((address)x) + xpos, min); + __MOVE((address)buf->data + (int64)offset, (address)x + (int64)xpos, min); offset += min; (*r).offset = offset; xpos += min; @@ -688,7 +688,7 @@ Files_File Files_Base (Files_Rider *r, address *r__typ) void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x) { Files_Buffer buf = NIL; - int64 offset; + int32 offset; buf = (*r).buf; offset = (*r).offset; if ((*r).org != buf->org || offset >= 4096) { @@ -706,9 +706,9 @@ void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x) (*r).res = 0; } -void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int64 n) +void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n) { - int64 xpos, min, restInBuf, offset; + int32 xpos, min, restInBuf, offset; Files_Buffer buf = NIL; if (n > x__len) { Files_IdxTrap(); @@ -728,7 +728,7 @@ void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT } else { min = n; } - __MOVE(((address)x) + xpos, ((address)buf->data) + offset, min); + __MOVE((address)x + (int64)xpos, (address)buf->data + (int64)offset, min); offset += min; (*r).offset = offset; if (offset > buf->size) { @@ -742,17 +742,17 @@ void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT (*r).res = 0; } -void Files_Delete (CHAR *name, LONGINT name__len, int32 *res) +void Files_Delete (CHAR *name, LONGINT name__len, int16 *res) { __DUP(name, name__len, CHAR); *res = Platform_Unlink((void*)name, name__len); __DEL(name); } -void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int32 *res) +void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res) { - int64 fdold, fdnew, n; - int32 error, ignore; + int32 fdold, fdnew, n; + int16 error, ignore; Platform_FileIdentity oldidentity, newidentity; CHAR buf[4096]; __DUP(old, old__len, CHAR); @@ -807,7 +807,7 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int void Files_Register (Files_File f) { - int32 idx, errcode; + int16 idx, errcode; Files_File f1 = NIL; CHAR file[104]; if ((f->state == 1 && f->registerName[0] != 0x00)) { @@ -826,7 +826,7 @@ void Files_Register (Files_File f) } } -void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int32 *res) +void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int16 *res) { __DUP(path, path__len, CHAR); *res = Platform_Chdir((void*)path, path__len); @@ -835,7 +835,7 @@ void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int32 *res) static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *dest, LONGINT dest__len) { - int64 i, j; + int32 i, j; if (!Platform_LittleEndian) { i = src__len; j = 0; @@ -854,26 +854,26 @@ void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x) Files_Read(&*R, R__typ, (CHAR*)(void*)&*x); } -void Files_ReadInt (Files_Rider *R, address *R__typ, int32 *x) +void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x) { CHAR b[2]; Files_ReadBytes(&*R, R__typ, (void*)b, 2, 2); - *x = b[0] + __ASHL(b[1], 8); + *x = (int16)b[0] + __ASHL((int16)b[1], 8); } -void Files_ReadLInt (Files_Rider *R, address *R__typ, int64 *x) +void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x) { CHAR b[4]; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); - *x = ((b[0] + __ASHL(b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); + *x = (((int16)b[0] + __ASHL((int16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); } void Files_ReadSet (Files_Rider *R, address *R__typ, SET *x) { CHAR b[4]; - int64 l; + int32 l; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); - l = ((b[0] + __ASHL(b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); + l = (((int16)b[0] + __ASHL((int16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); *x = (SET)l; } @@ -893,7 +893,7 @@ void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x) void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) { - int32 i; + int16 i; CHAR ch; i = 0; do { @@ -905,7 +905,7 @@ void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) { - int32 i; + int16 i; CHAR ch; BOOLEAN b; i = 0; @@ -921,26 +921,26 @@ void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) } while (!b); } -void Files_ReadNum (Files_Rider *R, address *R__typ, int64 *x) +void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x) { int8 s; CHAR ch; - int64 n; + int32 n; s = 0; n = 0; Files_Read(&*R, R__typ, (void*)&ch); - while (ch >= 128) { - n += __ASH((int64)(ch - 128), s); + while ((int16)ch >= 128) { + n += __ASH(((int16)ch - 128), s); s += 7; Files_Read(&*R, R__typ, (void*)&ch); } - n += __ASH((int64)(__MASK(ch, -64) - __ASHL(__ASHR(ch, 6), 6)), s); + n += __ASH((__MASK((int16)ch, -64) - __ASHL(__ASHR((int16)ch, 6), 6)), s); *x = n; } void Files_ReadNum64 (Files_Rider *R, address *R__typ, int64 *x) { - int64 n; + int32 n; Files_ReadNum(&*R, R__typ, &n); *x = n; } @@ -950,7 +950,7 @@ void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x) Files_Write(&*R, R__typ, __VAL(CHAR, x)); } -void Files_WriteInt (Files_Rider *R, address *R__typ, int32 x) +void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x) { CHAR b[2]; b[0] = (CHAR)x; @@ -958,7 +958,7 @@ void Files_WriteInt (Files_Rider *R, address *R__typ, int32 x) Files_WriteBytes(&*R, R__typ, (void*)b, 2, 2); } -void Files_WriteLInt (Files_Rider *R, address *R__typ, int64 x) +void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x) { CHAR b[4]; b[0] = (CHAR)x; @@ -971,8 +971,8 @@ void Files_WriteLInt (Files_Rider *R, address *R__typ, int64 x) void Files_WriteSet (Files_Rider *R, address *R__typ, SET x) { CHAR b[4]; - int64 i; - i = (int64)x; + int32 i; + i = (int32)x; b[0] = (CHAR)i; b[1] = (CHAR)__ASHR(i, 8); b[2] = (CHAR)__ASHR(i, 16); @@ -996,7 +996,7 @@ void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x) void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) { - int32 i; + int16 i; i = 0; while (x[i] != 0x00) { i += 1; @@ -1004,7 +1004,7 @@ void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len Files_WriteBytes(&*R, R__typ, (void*)x, x__len * 1, i + 1); } -void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x) +void Files_WriteNum (Files_Rider *R, address *R__typ, int32 x) { while (x < -64 || x > 63) { Files_Write(&*R, R__typ, (CHAR)(__MASK(x, -128) + 128)); @@ -1030,7 +1030,7 @@ void Files_GetName (Files_File f, CHAR *name, LONGINT name__len) static void Files_Finalize (SYSTEM_PTR o) { Files_File f = NIL; - int64 res; + int32 res; f = (Files_File)(address)o; if (f->fd >= 0) { Files_CloseOSFile(f); @@ -1058,9 +1058,9 @@ static void EnumPtrs(void (*P)(void*)) P(Files_SearchPath); } -__TDESC(Files_FileDesc, 1, 5) = {__TDFLDS("FileDesc", 320), {272, 280, 288, 296, 312, -48}}; -__TDESC(Files_BufDesc, 1, 1) = {__TDFLDS("BufDesc", 4128), {0, -16}}; -__TDESC(Files_Rider, 1, 1) = {__TDFLDS("Rider", 40), {16, -16}}; +__TDESC(Files_FileDesc, 1, 5) = {__TDFLDS("FileDesc", 288), {240, 248, 256, 264, 280, -48}}; +__TDESC(Files_BufDesc, 1, 1) = {__TDFLDS("BufDesc", 4120), {0, -16}}; +__TDESC(Files_Rider, 1, 1) = {__TDFLDS("Rider", 24), {8, -16}}; export void *Files__init(void) { diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 399f2137..13fccd9a 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -10,16 +10,18 @@ typedef typedef struct Files_FileDesc { - char _prvt0[248]; - int64 fd; - char _prvt1[64]; + int64 _prvt0; + char _prvt1[216]; + int32 fd; + char _prvt2[60]; } Files_FileDesc; typedef struct Files_Rider { - int64 res; + int32 res; BOOLEAN eof; - char _prvt0[31]; + int64 _prvt0; + char _prvt1[8]; } Files_Rider; @@ -28,40 +30,40 @@ import address *Files_FileDesc__typ; import address *Files_Rider__typ; import Files_File Files_Base (Files_Rider *r, address *r__typ); -import void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int32 *res); +import void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int16 *res); import void Files_Close (Files_File f); -import void Files_Delete (CHAR *name, LONGINT name__len, int32 *res); -import void Files_GetDate (Files_File f, int64 *t, int64 *d); +import void Files_Delete (CHAR *name, LONGINT name__len, int16 *res); +import void Files_GetDate (Files_File f, int32 *t, int32 *d); import void Files_GetName (Files_File f, CHAR *name, LONGINT name__len); -import int64 Files_Length (Files_File f); +import int32 Files_Length (Files_File f); import Files_File Files_New (CHAR *name, LONGINT name__len); import Files_File Files_Old (CHAR *name, LONGINT name__len); -import int64 Files_Pos (Files_Rider *r, address *r__typ); +import int32 Files_Pos (Files_Rider *r, address *r__typ); import void Files_Purge (Files_File f); import void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x); import void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x); import void Files_ReadByte (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len); -import void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int64 n); -import void Files_ReadInt (Files_Rider *R, address *R__typ, int32 *x); -import void Files_ReadLInt (Files_Rider *R, address *R__typ, int64 *x); +import void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); +import void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x); +import void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); import void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); import void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); -import void Files_ReadNum (Files_Rider *R, address *R__typ, int64 *x); +import void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x); import void Files_ReadNum64 (Files_Rider *R, address *R__typ, int64 *x); import void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); import void Files_ReadSet (Files_Rider *R, address *R__typ, SET *x); import void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); import void Files_Register (Files_File f); -import void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int32 *res); -import void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int64 pos); +import void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res); +import void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos); import void Files_SetSearchPath (CHAR *path, LONGINT path__len); import void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x); import void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x); -import void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int64 n); -import void Files_WriteInt (Files_Rider *R, address *R__typ, int32 x); -import void Files_WriteLInt (Files_Rider *R, address *R__typ, int64 x); +import void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); +import void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x); +import void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x); import void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x); -import void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x); +import void Files_WriteNum (Files_Rider *R, address *R__typ, int32 x); import void Files_WriteNum64 (Files_Rider *R, address *R__typ, int64 x); import void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x); import void Files_WriteSet (Files_Rider *R, address *R__typ, SET x); diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index c87cfd6d..16ae9ffd 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,8 +1,8 @@ /* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tsSfF */ -#define INTEGER int32 -#define LONGINT int64 -#define SET uint64 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" @@ -54,11 +54,11 @@ typedef struct Heap_ModuleDesc { Heap_Module next; Heap_ModuleName name; - int64 refcnt; + int32 refcnt; Heap_Cmd cmds; address types; Heap_EnumProc enumPtrs; - int64 reserved1, reserved2; + int32 reserved1, reserved2; } Heap_ModuleDesc; @@ -70,9 +70,9 @@ static BOOLEAN Heap_firstTry; static address Heap_heap, Heap_heapend; export address Heap_heapsize; static Heap_FinNode Heap_fin; -static int32 Heap_lockdepth; +static int16 Heap_lockdepth; static BOOLEAN Heap_interrupted; -export int32 Heap_FileCount; +export int16 Heap_FileCount; export address *Heap_ModuleDesc__typ; export address *Heap_CmdDesc__typ; @@ -129,7 +129,7 @@ SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) SYSTEM_PTR _o_result; Heap_Module m; if (__STRCMP(name, "Heap") == 0) { - __SYSNEW(m, 80); + __SYSNEW(m, 64); } else { __NEW(m, Heap_ModuleDesc); } @@ -602,7 +602,7 @@ static void Heap_MarkStack (address n, address *cand, LONGINT cand__len) while (sp != stack0) { __GET(sp, p, address); if ((p > Heap_heap && p < Heap_heapend)) { - if (nofcand == cand__len) { + if (nofcand == (int64)cand__len) { Heap_HeapSort(nofcand, (void*)cand, cand__len); Heap_MarkCandidates(nofcand, (void*)cand, cand__len); nofcand = 0; @@ -734,7 +734,7 @@ static void EnumPtrs(void (*P)(void*)) P(Heap_fin); } -__TDESC(Heap_ModuleDesc, 1, 2) = {__TDFLDS("ModuleDesc", 80), {0, 40, -24}}; +__TDESC(Heap_ModuleDesc, 1, 2) = {__TDFLDS("ModuleDesc", 64), {0, 32, -24}}; __TDESC(Heap_CmdDesc, 1, 1) = {__TDFLDS("CmdDesc", 40), {0, -16}}; __TDESC(Heap_FinDesc, 1, 1) = {__TDFLDS("FinDesc", 32), {0, -16}}; __TDESC(Heap__1, 1, 1) = {__TDFLDS("", 16), {8, -16}}; diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index b4829f2f..151a2d59 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -23,7 +23,7 @@ typedef typedef struct Heap_ModuleDesc { int64 _prvt0; - char _prvt1[72]; + char _prvt1[56]; } Heap_ModuleDesc; typedef @@ -32,7 +32,7 @@ typedef import SYSTEM_PTR Heap_modules; import address Heap_allocated, Heap_heapsize; -import int32 Heap_FileCount; +import int16 Heap_FileCount; import address *Heap_ModuleDesc__typ; diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 23fec310..f844dfa9 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,8 +1,8 @@ /* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ -#define INTEGER int32 -#define LONGINT int64 -#define SET uint64 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Console.h" @@ -31,15 +31,15 @@ typedef struct Modules_ModuleDesc { Modules_Module next; Modules_ModuleName name; - int64 refcnt; + int32 refcnt; Modules_Cmd cmds; - int64 types; - void (*enumPtrs)(void(*)(int64)); - int64 reserved1, reserved2; + int32 types; + void (*enumPtrs)(void(*)(int32)); + int32 reserved1, reserved2; } Modules_ModuleDesc; -export int32 Modules_res; +export int16 Modules_res; export CHAR Modules_resMsg[256]; export Modules_ModuleName Modules_imported, Modules_importing; @@ -56,7 +56,7 @@ export Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len); static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len) { - int32 i, j; + int16 i, j; __DUP(b, b__len, CHAR); i = 0; while (a[__X(i, a__len)] != 0x00) { @@ -160,7 +160,7 @@ void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all) __DEL(name); } -__TDESC(Modules_ModuleDesc, 1, 2) = {__TDFLDS("ModuleDesc", 80), {0, 40, -24}}; +__TDESC(Modules_ModuleDesc, 1, 2) = {__TDFLDS("ModuleDesc", 64), {0, 32, -24}}; __TDESC(Modules_CmdDesc, 1, 1) = {__TDFLDS("CmdDesc", 40), {0, -16}}; export void *Modules__init(void) diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index 7cafac5f..060208c6 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -28,15 +28,15 @@ typedef struct Modules_ModuleDesc { Modules_Module next; Modules_ModuleName name; - int64 refcnt; + int32 refcnt; Modules_Cmd cmds; - int64 types; - void (*enumPtrs)(void(*)(int64)); - char _prvt0[16]; + int32 types; + void (*enumPtrs)(void(*)(int32)); + char _prvt0[8]; } Modules_ModuleDesc; -import int32 Modules_res; +import int16 Modules_res; import CHAR Modules_resMsg[256]; import Modules_ModuleName Modules_imported, Modules_importing; diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index 81077606..e09bf1b4 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,8 +1,8 @@ /* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ -#define INTEGER int32 -#define LONGINT int64 -#define SET uint64 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "OPM.h" @@ -11,13 +11,13 @@ export void (*OPB_typSize)(OPT_Struct); -static int32 OPB_exp; +static int16 OPB_exp; static int64 OPB_maxExp; export void OPB_Assign (OPT_Node *x, OPT_Node y); static void OPB_BindNodes (int8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y); -static int32 OPB_BoolToInt (BOOLEAN b); +static int16 OPB_BoolToInt (BOOLEAN b); export void OPB_Call (OPT_Node *x, OPT_Node apar, OPT_Object fp); static void OPB_CharToString (OPT_Node n); static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode); @@ -25,9 +25,9 @@ static void OPB_CheckLeaf (OPT_Node x, BOOLEAN dynArrToo); export void OPB_CheckParameters (OPT_Object fp, OPT_Object ap, BOOLEAN checkNames); static void OPB_CheckProc (OPT_Struct x, OPT_Object y); static void OPB_CheckPtr (OPT_Node x, OPT_Node y); -static void OPB_CheckRealType (int32 f, int32 nr, OPT_Const x); +static void OPB_CheckRealType (int16 f, int16 nr, OPT_Const x); static void OPB_CheckReceiver (OPT_Node *x, OPT_Object fp); -static void OPB_ConstOp (int32 op, OPT_Node x, OPT_Node y); +static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y); export void OPB_Construct (int8 class, OPT_Node *x, OPT_Node y); static void OPB_Convert (OPT_Node *x, OPT_Struct typ); export void OPB_DeRef (OPT_Node *x); @@ -56,17 +56,17 @@ export void OPB_Return (OPT_Node *x, OPT_Object proc); export void OPB_SetElem (OPT_Node *x); static void OPB_SetIntType (OPT_Node node); export void OPB_SetRange (OPT_Node *x, OPT_Node y); -export void OPB_StFct (OPT_Node *par0, int8 fctno, int32 parno); -export void OPB_StPar0 (OPT_Node *par0, int32 fctno); +export void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno); +export void OPB_StPar0 (OPT_Node *par0, int16 fctno); export void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno); -export void OPB_StParN (OPT_Node *par0, OPT_Node x, int32 fctno, int32 n); +export void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n); export void OPB_StaticLink (int8 dlev); export void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard); -static void OPB_err (int32 n); +static void OPB_err (int16 n); static int64 OPB_log (int64 x); -static void OPB_err (int32 n) +static void OPB_err (int16 n) { OPM_err(n); } @@ -128,9 +128,9 @@ void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y) *last = y; } -static int32 OPB_BoolToInt (BOOLEAN b) +static int16 OPB_BoolToInt (BOOLEAN b) { - int32 _o_result; + int16 _o_result; if (b) { _o_result = 1; return _o_result; @@ -323,18 +323,18 @@ void OPB_DeRef (OPT_Node *x) void OPB_Index (OPT_Node *x, OPT_Node y) { - int32 f; + int16 f; OPT_Struct typ = NIL; f = y->typ->form; if ((*x)->class >= 7) { OPB_err(79); - } else if (f != 4 || __IN(y->class, 0x0300, 64)) { + } else if (f != 4 || __IN(y->class, 0x0300, 32)) { OPB_err(80); y->typ = OPT_inttyp; } if ((*x)->typ->comp == 2) { typ = (*x)->typ->BaseTyp; - if ((y->class == 7 && (y->conval->intval < 0 || y->conval->intval >= (*x)->typ->n))) { + if ((y->class == 7 && (y->conval->intval < 0 || y->conval->intval >= (int64)(*x)->typ->n))) { OPB_err(81); } } else if ((*x)->typ->comp == 3) { @@ -355,7 +355,7 @@ void OPB_Field (OPT_Node *x, OPT_Object y) if ((*x)->class >= 7) { OPB_err(77); } - if ((y != NIL && __IN(y->mode, 0x2010, 64))) { + if ((y != NIL && __IN(y->mode, 0x2010, 32))) { OPB_BindNodes(2, y->typ, &*x, NIL); (*x)->obj = y; (*x)->readonly = (*x)->left->readonly || (y->vis == 2 && y->mnolev < 0); @@ -448,7 +448,7 @@ void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) void OPB_In (OPT_Node *x, OPT_Node y) { - int32 f; + int16 f; int64 k; f = (*x)->typ->form; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { @@ -459,7 +459,7 @@ void OPB_In (OPT_Node *x, OPT_Node y) if (k < 0 || k > (int64)OPM_MaxSet) { OPB_err(202); } else if (y->class == 7) { - (*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval, 64)); + (*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval, 32)); (*x)->obj = NIL; } else { OPB_BindNodes(12, OPT_booltyp, &*x, y); @@ -489,7 +489,7 @@ static int64 OPB_log (int64 x) return _o_result; } -static void OPB_CheckRealType (int32 f, int32 nr, OPT_Const x) +static void OPB_CheckRealType (int16 f, int16 nr, OPT_Const x) { LONGREAL min, max, r; if (f == 5) { @@ -529,7 +529,7 @@ static OPT_Node NewOp__29 (int8 op, OPT_Struct typ, OPT_Node z) void OPB_MOp (int8 op, OPT_Node *x) { - int32 f; + int16 f; OPT_Struct typ = NIL; OPT_Node z = NIL; struct MOp__28 _s; @@ -555,12 +555,12 @@ void OPB_MOp (int8 op, OPT_Node *x) } break; case 6: - if (!__IN(f, 0x70, 64)) { + if (!__IN(f, 0x70, 32)) { OPB_err(96); } break; case 7: - if (__IN(f, 0xf0, 64)) { + if (__IN(f, 0xf0, 32)) { if (z->class == 7) { if (f == 4) { if (z->conval->intval == (-9223372036854775807-1)) { @@ -569,7 +569,7 @@ void OPB_MOp (int8 op, OPT_Node *x) z->conval->intval = -z->conval->intval; OPB_SetIntType(z); } - } else if (__IN(f, 0x60, 64)) { + } else if (__IN(f, 0x60, 32)) { z->conval->realval = -z->conval->realval; } else { z->conval->setval = ~z->conval->setval; @@ -583,7 +583,7 @@ void OPB_MOp (int8 op, OPT_Node *x) } break; case 21: - if (__IN(f, 0x70, 64)) { + if (__IN(f, 0x70, 32)) { if (z->class == 7) { if (f == 4) { if (z->conval->intval == (-9223372036854775807-1)) { @@ -606,7 +606,7 @@ void OPB_MOp (int8 op, OPT_Node *x) case 22: if (f == 3) { if (z->class == 7) { - z->conval->intval = __CAP((CHAR)z->conval->intval); + z->conval->intval = (int16)__CAP((CHAR)z->conval->intval); z->obj = NIL; } else { z = NewOp__29(op, typ, z); @@ -666,7 +666,7 @@ void OPB_MOp (int8 op, OPT_Node *x) static void OPB_CheckPtr (OPT_Node x, OPT_Node y) { - int32 g; + int16 g; OPT_Struct p = NIL, q = NIL, t = NIL; g = y->typ->form; if (g == 11) { @@ -730,7 +730,7 @@ void OPB_CheckParameters (OPT_Object fp, OPT_Object ap, BOOLEAN checkNames) static void OPB_CheckProc (OPT_Struct x, OPT_Object y) { - if (__IN(y->mode, 0x04c0, 64)) { + if (__IN(y->mode, 0x04c0, 32)) { if (y->mode == 6) { if (y->mnolev == 0) { y->mode = 7; @@ -750,17 +750,17 @@ static void OPB_CheckProc (OPT_Struct x, OPT_Object y) static struct ConstOp__13 { OPT_Node *x; - int32 *f; + int16 *f; OPT_Const *xval, *yval; struct ConstOp__13 *lnk; } *ConstOp__13_s; -static int32 ConstCmp__14 (void); +static int16 ConstCmp__14 (void); -static int32 ConstCmp__14 (void) +static int16 ConstCmp__14 (void) { - int32 _o_result; - int32 res; + int16 _o_result; + int16 res; switch (*ConstOp__13_s->f) { case 0: res = 9; @@ -824,9 +824,9 @@ static int32 ConstCmp__14 (void) return _o_result; } -static void OPB_ConstOp (int32 op, OPT_Node x, OPT_Node y) +static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) { - int32 f, g; + int16 f, g; OPT_Const xval = NIL, yval = NIL; int64 xv, yv; BOOLEAN temp; @@ -906,7 +906,7 @@ static void OPB_ConstOp (int32 op, OPT_Node x, OPT_Node y) } break; case 9: - if (!__IN(g, 0x1800, 64)) { + if (!__IN(g, 0x1800, 32)) { OPB_err(100); } break; @@ -937,7 +937,7 @@ static void OPB_ConstOp (int32 op, OPT_Node x, OPT_Node y) } else { OPB_err(204); } - } else if (__IN(f, 0x60, 64)) { + } else if (__IN(f, 0x60, 32)) { temp = __ABS(yval->realval) <= (LONGREAL)1; if (temp || __ABS(xval->realval) <= 1.79769296342094e+308 / (LONGREAL)__ABS(yval->realval)) { xval->realval = xval->realval * yval->realval; @@ -961,7 +961,7 @@ static void OPB_ConstOp (int32 op, OPT_Node x, OPT_Node y) xval->realval = (LONGREAL)1; } x->typ = OPT_realtyp; - } else if (__IN(f, 0x60, 64)) { + } else if (__IN(f, 0x60, 32)) { temp = __ABS(yval->realval) >= (LONGREAL)1; if (temp || __ABS(xval->realval) <= 1.79769296342094e+308 * __ABS(yval->realval)) { xval->realval = xval->realval / yval->realval; @@ -1015,7 +1015,7 @@ static void OPB_ConstOp (int32 op, OPT_Node x, OPT_Node y) } else { OPB_err(206); } - } else if (__IN(f, 0x60, 64)) { + } else if (__IN(f, 0x60, 32)) { temp = (yval->realval >= (LONGREAL)0 && xval->realval <= 1.79769296342094e+308 - yval->realval); if (temp || (yval->realval < (LONGREAL)0 && xval->realval >= -1.79769296342094e+308 - yval->realval)) { xval->realval = xval->realval + yval->realval; @@ -1037,7 +1037,7 @@ static void OPB_ConstOp (int32 op, OPT_Node x, OPT_Node y) } else { OPB_err(207); } - } else if (__IN(f, 0x60, 64)) { + } else if (__IN(f, 0x60, 32)) { temp = (yval->realval >= (LONGREAL)0 && xval->realval >= -1.79769296342094e+308 + yval->realval); if (temp || (yval->realval < (LONGREAL)0 && xval->realval <= 1.79769296342094e+308 + yval->realval)) { xval->realval = xval->realval - yval->realval; @@ -1065,28 +1065,28 @@ static void OPB_ConstOp (int32 op, OPT_Node x, OPT_Node y) xval->intval = OPB_BoolToInt(ConstCmp__14() != 9); break; case 11: - if (__IN(f, 0x0a84, 64)) { + if (__IN(f, 0x0a84, 32)) { OPB_err(108); } else { xval->intval = OPB_BoolToInt(ConstCmp__14() == 11); } break; case 12: - if (__IN(f, 0x0a84, 64)) { + if (__IN(f, 0x0a84, 32)) { OPB_err(108); } else { xval->intval = OPB_BoolToInt(ConstCmp__14() != 13); } break; case 13: - if (__IN(f, 0x0a84, 64)) { + if (__IN(f, 0x0a84, 32)) { OPB_err(108); } else { xval->intval = OPB_BoolToInt(ConstCmp__14() == 13); } break; case 14: - if (__IN(f, 0x0a84, 64)) { + if (__IN(f, 0x0a84, 32)) { OPB_err(108); } else { xval->intval = OPB_BoolToInt(ConstCmp__14() != 11); @@ -1104,7 +1104,7 @@ static void OPB_ConstOp (int32 op, OPT_Node x, OPT_Node y) static void OPB_Convert (OPT_Node *x, OPT_Struct typ) { OPT_Node node = NIL; - int32 f, g; + int16 f, g; int64 k; LONGREAL r; f = (*x)->typ->form; @@ -1119,7 +1119,7 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) (*x)->conval->intval = 1; } } - } else if (__IN(g, 0x60, 64)) { + } else if (__IN(g, 0x60, 32)) { (*x)->conval->realval = (*x)->conval->intval; (*x)->conval->intval = -1; } else { @@ -1128,8 +1128,8 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) OPB_err(220); } } - } else if (__IN(f, 0x60, 64)) { - if (__IN(g, 0x60, 64)) { + } else if (__IN(f, 0x60, 32)) { + if (__IN(g, 0x60, 32)) { OPB_CheckRealType(g, 203, (*x)->conval); } else { r = (*x)->conval->realval; @@ -1137,12 +1137,12 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) OPB_err(203); r = (LONGREAL)1; } - (*x)->conval->intval = __ENTIER(r); + (*x)->conval->intval = (int32)__ENTIER(r); OPB_SetIntType(*x); } } (*x)->obj = NIL; - } else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((*x)->left->typ->form < f || f > g))) { + } else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((int16)(*x)->left->typ->form < f || f > g))) { if ((*x)->left->typ == typ) { *x = (*x)->left; } @@ -1156,7 +1156,7 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) } static struct Op__38 { - int32 *f, *g; + int16 *f, *g; struct Op__38 *lnk; } *Op__38_s; @@ -1178,8 +1178,8 @@ static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) { BOOLEAN _o_result; BOOLEAN ok, xCharArr, yCharArr; - xCharArr = (__IN((*x)->typ->comp, 0x0c, 64) && (*x)->typ->BaseTyp->form == 3) || *Op__38_s->f == 8; - yCharArr = (__IN((*y)->typ->comp, 0x0c, 64) && (*y)->typ->BaseTyp->form == 3) || *Op__38_s->g == 8; + xCharArr = (__IN((*x)->typ->comp, 0x0c, 32) && (*x)->typ->BaseTyp->form == 3) || *Op__38_s->f == 8; + yCharArr = (__IN((*y)->typ->comp, 0x0c, 32) && (*y)->typ->BaseTyp->form == 3) || *Op__38_s->g == 8; if ((((xCharArr && *Op__38_s->g == 3)) && (*y)->class == 7)) { OPB_CharToString(*y); *Op__38_s->g = 8; @@ -1208,7 +1208,7 @@ static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) { - int32 f, g; + int16 f, g; OPT_Node t = NIL, z = NIL; OPT_Struct typ = NIL; BOOLEAN do_; @@ -1238,7 +1238,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) case 4: if ((g == 4 && y->typ->size < z->typ->size)) { OPB_Convert(&y, z->typ); - } else if (__IN(g, 0x70, 64)) { + } else if (__IN(g, 0x70, 32)) { OPB_Convert(&z, y->typ); } else { OPB_err(100); @@ -1247,23 +1247,23 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) case 5: if (g == 4) { OPB_Convert(&y, z->typ); - } else if (__IN(g, 0x60, 64)) { + } else if (__IN(g, 0x60, 32)) { OPB_Convert(&z, y->typ); } else { OPB_err(100); } break; case 6: - if (__IN(g, 0x70, 64)) { + if (__IN(g, 0x70, 32)) { OPB_Convert(&y, z->typ); - } else if (__IN(g, 0x60, 64)) { + } else if (__IN(g, 0x60, 32)) { OPB_Convert(&y, z->typ); } else { OPB_err(100); } break; case 9: - if (!__IN(g, 0x1800, 64)) { + if (!__IN(g, 0x1800, 32)) { OPB_err(100); } break; @@ -1324,7 +1324,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) y->obj = NIL; } } - } else if (!__IN(f, 0xe1, 64)) { + } else if (!__IN(f, 0xe1, 32)) { OPB_err(105); typ = OPT_undftyp; } @@ -1340,7 +1340,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) OPB_Convert(&z, OPT_realtyp); OPB_Convert(&y, OPT_realtyp); typ = OPT_realtyp; - } else if (__IN(f, 0x60, 64)) { + } else if (__IN(f, 0x60, 32)) { if ((y->class == 7 && y->conval->realval == (LONGREAL)0)) { OPB_err(205); } @@ -1407,7 +1407,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) } break; case 6: - if (!__IN(f, 0xf1, 64)) { + if (!__IN(f, 0xf1, 32)) { OPB_err(105); typ = OPT_undftyp; } @@ -1426,7 +1426,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) } break; case 7: - if (!__IN(f, 0xf1, 64)) { + if (!__IN(f, 0xf1, 32)) { OPB_err(106); typ = OPT_undftyp; } @@ -1450,7 +1450,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) } break; case 9: case 10: - if (__IN(f, 0x1aff, 64) || strings__41(&z, &y)) { + if (__IN(f, 0x1aff, 32) || strings__41(&z, &y)) { typ = OPT_booltyp; } else { OPB_err(107); @@ -1459,7 +1459,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) NewOp__39(op, typ, &z, y); break; case 11: case 12: case 13: case 14: - if (__IN(f, 0x79, 64) || strings__41(&z, &y)) { + if (__IN(f, 0x79, 32) || strings__41(&z, &y)) { typ = OPT_booltyp; } else { OPM_LogWLn(); @@ -1501,10 +1501,10 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y) } if (((*x)->class == 7 && y->class == 7)) { if (k <= l) { - (*x)->conval->setval = __SETRNG(k, l, 64); + (*x)->conval->setval = __SETRNG(k, l, 32); } else { OPB_err(201); - (*x)->conval->setval = __SETRNG(l, k, 64); + (*x)->conval->setval = __SETRNG(l, k, 32); } (*x)->obj = NIL; } else { @@ -1526,7 +1526,7 @@ void OPB_SetElem (OPT_Node *x) } else if ((*x)->class == 7) { k = (*x)->conval->intval; if ((0 <= k && k <= (int64)OPM_MaxSet)) { - (*x)->conval->setval = __SETOF(k,64); + (*x)->conval->setval = __SETOF(k,32); } else { OPB_err(202); } @@ -1540,9 +1540,9 @@ void OPB_SetElem (OPT_Node *x) static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) { OPT_Struct y = NIL; - int32 f, g; + int16 f, g; OPT_Struct p = NIL, q = NIL; - if (__IN(18, OPM_opt, 64)) { + if (__IN(18, OPM_opt, 32)) { OPM_LogWLn(); OPM_LogWStr((CHAR*)"PROCEDURE CheckAssign", 22); OPM_LogWLn(); @@ -1550,7 +1550,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) y = ynode->typ; f = x->form; g = y->form; - if (__IN(18, OPM_opt, 64)) { + if (__IN(18, OPM_opt, 32)) { OPM_LogWStr((CHAR*)"y.form = ", 10); OPM_LogWNum(y->form, 0); OPM_LogWLn(); @@ -1571,7 +1571,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) case 0: case 8: break; case 1: - if (!((__IN(g, 0x1a, 64) && y->size == 1))) { + if (!((__IN(g, 0x1a, 32) && y->size == 1))) { OPB_err(113); } break; @@ -1586,12 +1586,12 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) } break; case 5: - if (!__IN(g, 0x30, 64)) { + if (!__IN(g, 0x30, 32)) { OPB_err(113); } break; case 6: - if (!__IN(g, 0x70, 64)) { + if (!__IN(g, 0x70, 32)) { OPB_err(113); } break; @@ -1639,7 +1639,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) if (ynode->conval->intval2 > x->n) { OPB_err(114); } - } else if ((__IN(y->comp, 0x0c, 64) && y->BaseTyp == OPT_chartyp)) { + } else if ((__IN(y->comp, 0x0c, 32) && y->BaseTyp == OPT_chartyp)) { } else { OPB_err(113); } @@ -1647,7 +1647,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPB_err(113); } } else if ((x->comp == 3 && x->BaseTyp == OPT_chartyp)) { - if ((__IN(y->comp, 0x0c, 64) && y->BaseTyp == OPT_chartyp)) { + if ((__IN(y->comp, 0x0c, 32) && y->BaseTyp == OPT_chartyp)) { } else { OPB_err(113); } @@ -1674,7 +1674,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPM_LogWLn(); break; } - if ((((((ynode->class == 7 && g < f)) && __IN(g, 0x30, 64))) && __IN(f, 0x70, 64))) { + if ((((((ynode->class == 7 && g < f)) && __IN(g, 0x30, 32))) && __IN(f, 0x70, 32))) { OPB_Convert(&ynode, x); } } @@ -1683,9 +1683,9 @@ static void OPB_CheckLeaf (OPT_Node x, BOOLEAN dynArrToo) { } -void OPB_StPar0 (OPT_Node *par0, int32 fctno) +void OPB_StPar0 (OPT_Node *par0, int16 fctno) { - int32 f; + int16 f; OPT_Struct typ = NIL; OPT_Node x = NIL; x = *par0; @@ -1712,7 +1712,7 @@ void OPB_StPar0 (OPT_Node *par0, int32 fctno) OPB_err(76); } f = x->typ->BaseTyp->comp; - if (__IN(f, 0x1c, 64)) { + if (__IN(f, 0x1c, 32)) { if (f == 3) { typ = x->typ->BaseTyp; } @@ -1745,7 +1745,7 @@ void OPB_StPar0 (OPT_Node *par0, int32 fctno) case 5: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x60, 64)) { + } else if (__IN(f, 0x60, 32)) { OPB_Convert(&x, OPT_linttyp); } else { OPB_err(111); @@ -1820,7 +1820,7 @@ void OPB_StPar0 (OPT_Node *par0, int32 fctno) case 9: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x11, 64)) { + } else if (__IN(f, 0x11, 32)) { OPB_Convert(&x, OPT_chartyp); } else { OPB_err(111); @@ -1881,7 +1881,7 @@ void OPB_StPar0 (OPT_Node *par0, int32 fctno) } break; case 17: - if (!__IN(x->typ->comp, 0x0c, 64)) { + if (!__IN(x->typ->comp, 0x0c, 32)) { OPB_err(131); } break; @@ -1892,7 +1892,7 @@ void OPB_StPar0 (OPT_Node *par0, int32 fctno) } if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (((!__IN(x->typ->comp, 0x0c, 64) || x->typ->BaseTyp->form != 3) && f != 8)) { + } else if (((!__IN(x->typ->comp, 0x0c, 32) || x->typ->BaseTyp->form != 3) && f != 8)) { OPB_err(111); } break; @@ -1916,7 +1916,7 @@ void OPB_StPar0 (OPT_Node *par0, int32 fctno) if (x->class != 8) { OPB_err(110); x = OPB_NewIntConst(1); - } else if (__IN(f, 0x18fe, 64) || __IN(x->typ->comp, 0x14, 64)) { + } else if (__IN(f, 0x18fe, 32) || __IN(x->typ->comp, 0x14, 32)) { (*OPB_typSize)(x->typ); x->typ->pvused = 1; x = OPB_NewIntConst(x->typ->size); @@ -1931,7 +1931,7 @@ void OPB_StPar0 (OPT_Node *par0, int32 fctno) case 22: case 23: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (!__IN(f, 0x9a, 64)) { + } else if (!__IN(f, 0x9a, 32)) { OPB_err(111); } break; @@ -1940,7 +1940,7 @@ void OPB_StPar0 (OPT_Node *par0, int32 fctno) OPB_err(126); } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_adrtyp->size)) { OPB_Convert(&x, OPT_adrtyp); - } else if (!((__IN(x->typ->form, 0x0810, 64) && x->typ->size == (int64)OPM_AddressSize))) { + } else if (!((__IN(x->typ->form, 0x0810, 32) && x->typ->size == OPM_AddressSize))) { OPB_err(111); x->typ = OPT_adrtyp; } @@ -1957,7 +1957,7 @@ void OPB_StPar0 (OPT_Node *par0, int32 fctno) case 29: if (x->class != 8) { OPB_err(110); - } else if (__IN(f, 0x0501, 64) || x->typ->comp == 3) { + } else if (__IN(f, 0x0501, 32) || x->typ->comp == 3) { OPB_err(111); } break; @@ -2009,7 +2009,7 @@ static OPT_Node NewOp__53 (int8 class, int8 subcl, OPT_Node left, OPT_Node right void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) { - int32 f, L; + int16 f, L; OPT_Struct typ = NIL; OPT_Node p = NIL, t = NIL; struct StPar1__52 _s; @@ -2024,7 +2024,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) p->typ = OPT_notyp; } else { if (x->typ != p->typ) { - if ((x->class == 7 && f == 4)) { + if ((f == 4 && (x->class == 7 || (p->typ->form == 4 && x->typ->size <= p->typ->size)))) { OPB_Convert(&x, p->typ); } else { OPB_err(111); @@ -2053,11 +2053,11 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) } else if (x->typ->size == 1) { L = OPM_Integer(x->conval->intval); typ = p->typ; - while ((L > 0 && __IN(typ->comp, 0x0c, 64))) { + while ((L > 0 && __IN(typ->comp, 0x0c, 32))) { typ = typ->BaseTyp; L -= 1; } - if (L != 0 || !__IN(typ->comp, 0x0c, 64)) { + if (L != 0 || !__IN(typ->comp, 0x0c, 32)) { OPB_err(132); } else { x->obj = NIL; @@ -2081,7 +2081,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) case 18: if (OPB_NotVar(x)) { OPB_err(112); - } else if ((__IN(x->typ->comp, 0x0c, 64) && x->typ->BaseTyp->form == 3)) { + } else if ((__IN(x->typ->comp, 0x0c, 32) && x->typ->BaseTyp->form == 3)) { if (x->readonly) { OPB_err(76); } @@ -2103,8 +2103,8 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) OPB_err(208); p->conval->intval = 1; } else if (x->conval->intval >= 0) { - if (__ABS(p->conval->intval) <= __DIV(9223372036854775807, __ASH(1, x->conval->intval))) { - p->conval->intval = p->conval->intval * __ASH(1, x->conval->intval); + if (__ABS(p->conval->intval) <= __DIV(9223372036854775807, (int64)__ASH(1, x->conval->intval))) { + p->conval->intval = p->conval->intval * (int64)__ASH(1, x->conval->intval); } else { OPB_err(208); p->conval->intval = 1; @@ -2155,7 +2155,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) case 24: case 25: case 26: case 27: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x18ff, 64)) { + } else if (__IN(f, 0x18ff, 32)) { if (fctno == 24 || fctno == 26) { if (OPB_NotVar(x)) { OPB_err(112); @@ -2181,7 +2181,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) p->typ = OPT_booltyp; break; case 29: - if (((x->class == 8 || x->class == 9) || __IN(f, 0x0501, 64)) || x->typ->comp == 3) { + if (((x->class == 8 || x->class == 9) || __IN(f, 0x0501, 32)) || x->typ->comp == 3) { OPB_err(126); } if ((x->class != 7 && x->typ->size < p->typ->size)) { @@ -2213,7 +2213,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) OPB_err(126); } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_adrtyp->size)) { OPB_Convert(&x, OPT_adrtyp); - } else if (!((__IN(x->typ->form, 0x0810, 64) && x->typ->size == (int64)OPM_AddressSize))) { + } else if (!((__IN(x->typ->form, 0x0810, 32) && x->typ->size == OPM_AddressSize))) { OPB_err(111); x->typ = OPT_adrtyp; } @@ -2251,10 +2251,10 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) StPar1__52_s = _s.lnk; } -void OPB_StParN (OPT_Node *par0, OPT_Node x, int32 fctno, int32 n) +void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n) { OPT_Node node = NIL; - int32 f; + int16 f; OPT_Node p = NIL; p = *par0; f = x->typ->form; @@ -2296,9 +2296,9 @@ void OPB_StParN (OPT_Node *par0, OPT_Node x, int32 fctno, int32 n) *par0 = p; } -void OPB_StFct (OPT_Node *par0, int8 fctno, int32 parno) +void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno) { - int32 dim; + int16 dim; OPT_Node x = NIL, p = NIL; p = *par0; if (fctno <= 19) { @@ -2362,17 +2362,17 @@ void OPB_StFct (OPT_Node *par0, int8 fctno, int32 parno) static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpar) { - int32 f; + int16 f; f = atyp->comp; ftyp = ftyp->BaseTyp; atyp = atyp->BaseTyp; if ((fvarpar && ftyp == OPT_bytetyp)) { - if (!__IN(f, 0x0c, 64) || !((__IN(atyp->form, 0x1e, 64) && atyp->size == 1))) { - if (__IN(18, OPM_opt, 64)) { + if (!__IN(f, 0x0c, 32) || !((__IN(atyp->form, 0x1e, 32) && atyp->size == 1))) { + if (__IN(18, OPM_opt, 32)) { OPB_err(-301); } } - } else if (__IN(f, 0x0c, 64)) { + } else if (__IN(f, 0x0c, 32)) { if (ftyp->comp == 3) { OPB_DynArrParCheck(ftyp, atyp, fvarpar); } else if (ftyp != atyp) { @@ -2411,7 +2411,7 @@ static void OPB_CheckReceiver (OPT_Node *x, OPT_Object fp) void OPB_PrepCall (OPT_Node *x, OPT_Object *fpar) { - if (((*x)->obj != NIL && __IN((*x)->obj->mode, 0x22c0, 64))) { + if (((*x)->obj != NIL && __IN((*x)->obj->mode, 0x22c0, 32))) { *fpar = (*x)->obj->link; if ((*x)->obj->mode == 13) { OPB_CheckReceiver(&(*x)->left, *fpar); @@ -2451,7 +2451,7 @@ void OPB_Param (OPT_Node ap, OPT_Object fp) } } else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 11)) { } else if (ap->typ != fp->typ) { - if ((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x1e, 64) && ap->typ->size == 1)))) { + if ((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x1e, 32) && ap->typ->size == 1)))) { } else if ((ap->typ == OPT_adrtyp && fp->typ == OPT_IntType(ap->typ->size))) { } else { OPB_err(123); @@ -2481,7 +2481,7 @@ void OPB_StaticLink (int8 dlev) scope = OPT_topScope; while (dlev > 0) { dlev -= 1; - scope->link->conval->setval |= __SETOF(3,64); + scope->link->conval->setval |= __SETOF(3,32); scope = scope->left; } } @@ -2576,7 +2576,7 @@ void OPB_Assign (OPT_Node *x, OPT_Node y) y->conval->intval = 0; OPB_Index(&*x, OPB_NewIntConst(0)); } - if ((((((__IN((*x)->typ->comp, 0x0c, 64) && (*x)->typ->BaseTyp == OPT_chartyp)) && __IN(y->typ->comp, 0x0c, 64))) && y->typ->BaseTyp == OPT_chartyp)) { + if ((((((__IN((*x)->typ->comp, 0x0c, 32) && (*x)->typ->BaseTyp == OPT_chartyp)) && __IN(y->typ->comp, 0x0c, 32))) && y->typ->BaseTyp == OPT_chartyp)) { subcl = 18; } else { subcl = 0; diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index 6863fee8..dc0085af 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -37,10 +37,10 @@ import void OPB_PrepCall (OPT_Node *x, OPT_Object *fpar); import void OPB_Return (OPT_Node *x, OPT_Object proc); import void OPB_SetElem (OPT_Node *x); import void OPB_SetRange (OPT_Node *x, OPT_Node y); -import void OPB_StFct (OPT_Node *par0, int8 fctno, int32 parno); -import void OPB_StPar0 (OPT_Node *par0, int32 fctno); +import void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno); +import void OPB_StPar0 (OPT_Node *par0, int16 fctno); import void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno); -import void OPB_StParN (OPT_Node *par0, OPT_Node x, int32 fctno, int32 n); +import void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n); import void OPB_StaticLink (int8 dlev); import void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard); import void *OPB__init(void); diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index ee7f4baa..99353400 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,8 +1,8 @@ /* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ -#define INTEGER int32 -#define LONGINT int64 -#define SET uint64 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Configuration.h" @@ -10,26 +10,26 @@ #include "OPT.h" -static int32 OPC_indentLevel; +static int16 OPC_indentLevel; static int8 OPC_hashtab[105]; static CHAR OPC_keytab[50][9]; static BOOLEAN OPC_GlbPtrs; static CHAR OPC_BodyNameExt[13]; -export void OPC_Align (int64 *adr, int64 base); +export void OPC_Align (int32 *adr, int32 base); export void OPC_Andent (OPT_Struct typ); static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames); -export int64 OPC_BaseAlignment (OPT_Struct typ); +export int32 OPC_BaseAlignment (OPT_Struct typ); export OPT_Object OPC_BaseTProc (OPT_Object obj); export void OPC_BegBlk (void); export void OPC_BegStat (void); -static void OPC_CProcDefs (OPT_Object obj, int32 vis); -export void OPC_Case (int64 caseVal, int32 form); +static void OPC_CProcDefs (OPT_Object obj, int16 vis); +export void OPC_Case (int64 caseVal, int16 form); static void OPC_CharacterLiteral (int64 c); -export void OPC_Cmp (int32 rel); +export void OPC_Cmp (int16 rel); export void OPC_CompleteIdent (OPT_Object obj); -export void OPC_Constant (OPT_Const con, int32 form); +export void OPC_Constant (OPT_Const con, int16 form); static void OPC_DeclareBase (OPT_Object dcl); static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef); static void OPC_DeclareParams (OPT_Object par, BOOLEAN macro); @@ -46,45 +46,45 @@ export void OPC_EnterBody (void); export void OPC_EnterProc (OPT_Object proc); export void OPC_ExitBody (void); export void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet); -static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, int64 *off, int64 *n, int64 *curAlign); -static void OPC_FillGap (int64 gap, int64 off, int64 align, int64 *n, int64 *curAlign); +static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, int32 *off, int32 *n, int32 *curAlign); +static void OPC_FillGap (int32 gap, int32 off, int32 align, int32 *n, int32 *curAlign); export void OPC_GenBdy (OPT_Node n); -static void OPC_GenDynTypes (OPT_Node n, int32 vis); +static void OPC_GenDynTypes (OPT_Node n, int16 vis); export void OPC_GenEnumPtrs (OPT_Object var); export void OPC_GenHdr (OPT_Node n); export void OPC_GenHdrIncludes (void); static void OPC_GenHeaderMsg (void); -export void OPC_Halt (int64 n); +export void OPC_Halt (int32 n); export void OPC_Ident (OPT_Object obj); -static void OPC_IdentList (OPT_Object obj, int32 vis); +static void OPC_IdentList (OPT_Object obj, int16 vis); static void OPC_Include (CHAR *name, LONGINT name__len); -static void OPC_IncludeImports (OPT_Object obj, int32 vis); +static void OPC_IncludeImports (OPT_Object obj, int16 vis); export void OPC_Increment (BOOLEAN decrement); -export void OPC_Indent (int32 count); +export void OPC_Indent (int16 count); export void OPC_Init (void); static void OPC_InitImports (OPT_Object obj); static void OPC_InitKeywords (void); export void OPC_InitTDesc (OPT_Struct typ); static void OPC_InitTProcs (OPT_Object typ, OPT_Object obj); -export void OPC_IntLiteral (int64 n, int64 size); +export void OPC_IntLiteral (int64 n, int32 size); export void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim); static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName); -static int32 OPC_Length (CHAR *s, LONGINT s__len); -export int64 OPC_NofPtrs (OPT_Struct typ); -static int32 OPC_PerfectHash (CHAR *s, LONGINT s__len); +static int16 OPC_Length (CHAR *s, LONGINT s__len); +export int32 OPC_NofPtrs (OPT_Struct typ); +static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len); static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len); static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define); static void OPC_ProcPredefs (OPT_Object obj, int8 vis); static void OPC_PutBase (OPT_Struct typ); -static void OPC_PutPtrOffsets (OPT_Struct typ, int64 adr, int64 *cnt); +static void OPC_PutPtrOffsets (OPT_Struct typ, int32 adr, int32 *cnt); static void OPC_RegCmds (OPT_Object obj); export void OPC_SetInclude (BOOLEAN exclude); -export int64 OPC_SizeAlignment (int64 size); +export int32 OPC_SizeAlignment (int32 size); static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause); -static void OPC_Str1 (CHAR *s, LONGINT s__len, int64 x); -static void OPC_StringLiteral (CHAR *s, LONGINT s__len, int64 l); +static void OPC_Str1 (CHAR *s, LONGINT s__len, int32 x); +static void OPC_StringLiteral (CHAR *s, LONGINT s__len, int32 l); export void OPC_TDescDecl (OPT_Struct typ); -export void OPC_TypeDefs (OPT_Object obj, int32 vis); +export void OPC_TypeDefs (OPT_Object obj, int16 vis); export void OPC_TypeOf (OPT_Object ap); static BOOLEAN OPC_Undefined (OPT_Object obj); @@ -95,14 +95,14 @@ void OPC_Init (void) __MOVE("__init(void)", OPC_BodyNameExt, 13); } -void OPC_Indent (int32 count) +void OPC_Indent (int16 count) { OPC_indentLevel += count; } void OPC_BegStat (void) { - int32 i; + int16 i; i = OPC_indentLevel; while (i > 0) { OPM_Write(0x09); @@ -138,10 +138,10 @@ void OPC_EndBlk0 (void) OPM_Write('}'); } -static void OPC_Str1 (CHAR *s, LONGINT s__len, int64 x) +static void OPC_Str1 (CHAR *s, LONGINT s__len, int32 x) { CHAR ch; - int32 i; + int16 i; __DUP(s, s__len, CHAR); ch = s[0]; i = 0; @@ -157,10 +157,10 @@ static void OPC_Str1 (CHAR *s, LONGINT s__len, int64 x) __DEL(s); } -static int32 OPC_Length (CHAR *s, LONGINT s__len) +static int16 OPC_Length (CHAR *s, LONGINT s__len) { - int32 _o_result; - int32 i; + int16 _o_result; + int16 i; i = 0; while (s[__X(i, s__len)] != 0x00) { i += 1; @@ -169,14 +169,14 @@ static int32 OPC_Length (CHAR *s, LONGINT s__len) return _o_result; } -static int32 OPC_PerfectHash (CHAR *s, LONGINT s__len) +static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len) { - int32 _o_result; - int32 i, h; + int16 _o_result; + int16 i, h; i = 0; h = 0; while ((s[__X(i, s__len)] != 0x00 && i < 5)) { - h = 3 * h + s[__X(i, s__len)]; + h = 3 * h + (int16)s[__X(i, s__len)]; i += 1; } _o_result = (int)__MOD(h, 105); @@ -185,10 +185,10 @@ static int32 OPC_PerfectHash (CHAR *s, LONGINT s__len) void OPC_Ident (OPT_Object obj) { - int32 mode, level, h; + int16 mode, level, h; mode = obj->mode; level = obj->mnolev; - if ((__IN(mode, 0x62, 64) && level > 0) || __IN(mode, 0x14, 64)) { + if ((__IN(mode, 0x62, 32) && level > 0) || __IN(mode, 0x14, 32)) { OPM_WriteStringVar((void*)obj->name, 256); h = OPC_PerfectHash((void*)obj->name, 256); if (OPC_hashtab[__X(h, 105)] >= 0) { @@ -225,10 +225,10 @@ void OPC_Ident (OPT_Object obj) static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause) { - int32 pointers; + int16 pointers; *openClause = 0; if (((typ->strobj == NIL || typ->strobj->name[0] == 0x00) && typ->comp != 4)) { - if (__IN(typ->comp, 0x0c, 64)) { + if (__IN(typ->comp, 0x0c, 32)) { OPC_Stars(typ->BaseTyp, &*openClause); *openClause = typ->comp == 2; } else if (typ->form == 12) { @@ -261,7 +261,7 @@ static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef) { OPT_Struct typ = NIL; BOOLEAN varPar, openClause; - int32 form, comp; + int16 form, comp; typ = dcl->typ; varPar = ((dcl->mode == 2 && typ->comp != 2) || typ->comp == 3) || scopeDef; OPC_Stars(typ, &openClause); @@ -285,7 +285,7 @@ static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef) break; } else if ((form == 11 && typ->BaseTyp->comp != 3)) { openClause = 1; - } else if (form == 12 || __IN(comp, 0x0c, 64)) { + } else if (form == 12 || __IN(comp, 0x0c, 32)) { if (openClause) { OPM_Write(')'); openClause = 0; @@ -319,7 +319,7 @@ void OPC_Andent (OPT_Struct typ) static BOOLEAN OPC_Undefined (OPT_Object obj) { BOOLEAN _o_result; - _o_result = obj->name[0] == 0x00 || (((obj->mnolev >= 0 && obj->linkadr != (int64)(3 + OPM_currFile))) && obj->linkadr != 2); + _o_result = obj->name[0] == 0x00 || (((obj->mnolev >= 0 && obj->linkadr != (3 + OPM_currFile))) && obj->linkadr != 2); return _o_result; } @@ -327,8 +327,8 @@ static void OPC_DeclareBase (OPT_Object dcl) { OPT_Struct typ = NIL, prev = NIL; OPT_Object obj = NIL; - int32 nofdims; - int64 off, n, dummy; + int16 nofdims; + int32 off, n, dummy; typ = dcl->typ; prev = typ; while ((((((((typ->strobj == NIL || typ->comp == 3) || OPC_Undefined(typ->strobj)) && typ->comp != 4)) && typ->form != 10)) && !((typ->form == 11 && typ->BaseTyp->comp == 3)))) { @@ -387,12 +387,12 @@ static void OPC_DeclareBase (OPT_Object dcl) } } -int64 OPC_NofPtrs (OPT_Struct typ) +int32 OPC_NofPtrs (OPT_Struct typ) { - int64 _o_result; + int32 _o_result; OPT_Object fld = NIL; OPT_Struct btyp = NIL; - int64 n; + int32 n; if ((typ->form == 11 && typ->sysflag == 0)) { _o_result = 1; return _o_result; @@ -430,11 +430,11 @@ int64 OPC_NofPtrs (OPT_Struct typ) __RETCHK; } -static void OPC_PutPtrOffsets (OPT_Struct typ, int64 adr, int64 *cnt) +static void OPC_PutPtrOffsets (OPT_Struct typ, int32 adr, int32 *cnt) { OPT_Object fld = NIL; OPT_Struct btyp = NIL; - int64 n, i; + int32 n, i; if ((typ->form == 11 && typ->sysflag == 0)) { OPM_WriteInt(adr); OPM_WriteString((CHAR*)", ", 3); @@ -510,7 +510,7 @@ static void OPC_PutBase (OPT_Struct typ) static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName) { OPT_Struct typ = NIL; - int32 dim; + int16 dim; if (showParamName) { OPC_Ident(par); OPM_WriteString((CHAR*)"__len", 6); @@ -608,7 +608,7 @@ OPT_Object OPC_BaseTProc (OPT_Object obj) { OPT_Object _o_result; OPT_Struct typ = NIL, base = NIL; - int64 mno; + int32 mno; typ = obj->link->typ; if (typ->form == 11) { typ = typ->BaseTyp; @@ -690,7 +690,7 @@ static void OPC_DefineType (OPT_Struct str) if (str->BaseTyp->comp != 4) { OPC_DefineType(str->BaseTyp); } - } else if (__IN(str->comp, 0x0c, 64)) { + } else if (__IN(str->comp, 0x0c, 32)) { OPC_DefineType(str->BaseTyp); } else if (str->form == 12) { if (str->BaseTyp != OPT_notyp) { @@ -733,7 +733,7 @@ static void OPC_DefineType (OPT_Struct str) static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len) { BOOLEAN _o_result; - int32 i; + int16 i; BOOLEAN r; __DUP(y, y__len, CHAR); i = 0; @@ -746,14 +746,14 @@ static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len) return _o_result; } -static void OPC_CProcDefs (OPT_Object obj, int32 vis) +static void OPC_CProcDefs (OPT_Object obj, int16 vis) { - int32 i; + int16 i; OPT_ConstExt ext = NIL; - int32 _for__9; + int16 _for__9; if (obj != NIL) { OPC_CProcDefs(obj->left, vis); - if ((((obj->mode == 9 && obj->vis >= vis)) && obj->adr == 1)) { + if ((((obj->mode == 9 && (int16)obj->vis >= vis)) && obj->adr == 1)) { ext = obj->conval->ext; i = 1; if (((*ext)[1] != '#' && !(OPC_Prefixed(ext, (CHAR*)"extern ", 8) || OPC_Prefixed(ext, (CHAR*)"import ", 8)))) { @@ -762,7 +762,7 @@ static void OPC_CProcDefs (OPT_Object obj, int32 vis) OPC_DeclareParams(obj->link, 1); OPM_Write(0x09); } - _for__9 = (*obj->conval->ext)[0]; + _for__9 = (int16)(*obj->conval->ext)[0]; i = i; while (i <= _for__9) { OPM_Write((*obj->conval->ext)[__X(i, 256)]); @@ -774,7 +774,7 @@ static void OPC_CProcDefs (OPT_Object obj, int32 vis) } } -void OPC_TypeDefs (OPT_Object obj, int32 vis) +void OPC_TypeDefs (OPT_Object obj, int16 vis) { if (obj != NIL) { OPC_TypeDefs(obj->left, vis); @@ -806,7 +806,7 @@ static void OPC_DefAnonRecs (OPT_Node n) void OPC_TDescDecl (OPT_Struct typ) { - int64 nofptrs; + int32 nofptrs; OPT_Object o = NIL; OPC_BegStat(); OPM_WriteString((CHAR*)"__TDESC(", 9); @@ -821,7 +821,7 @@ void OPC_TDescDecl (OPT_Struct typ) OPC_Str1((CHAR*)", #), {", 8, typ->size); nofptrs = 0; OPC_PutPtrOffsets(typ, 0, &nofptrs); - OPC_Str1((CHAR*)"#}}", 4, -((nofptrs + 1) * (int64)OPM_AddressSize)); + OPC_Str1((CHAR*)"#}}", 4, -((nofptrs + 1) * OPM_AddressSize)); OPC_EndStat(); } @@ -843,7 +843,7 @@ void OPC_InitTDesc (OPT_Struct typ) } } -void OPC_Align (int64 *adr, int64 base) +void OPC_Align (int32 *adr, int32 base) { switch (base) { case 2: @@ -863,11 +863,11 @@ void OPC_Align (int64 *adr, int64 base) } } -int64 OPC_SizeAlignment (int64 size) +int32 OPC_SizeAlignment (int32 size) { - int64 _o_result; - int64 alignment; - if (size < (int64)OPM_Alignment) { + int32 _o_result; + int32 alignment; + if (size < OPM_Alignment) { alignment = 1; while (alignment < size) { alignment = __ASHL(alignment, 1); @@ -879,10 +879,10 @@ int64 OPC_SizeAlignment (int64 size) return _o_result; } -int64 OPC_BaseAlignment (OPT_Struct typ) +int32 OPC_BaseAlignment (OPT_Struct typ) { - int64 _o_result; - int64 alignment; + int32 _o_result; + int32 alignment; if (typ->form == 13) { if (typ->comp == 4) { alignment = __MASK(typ->align, -65536); @@ -896,9 +896,9 @@ int64 OPC_BaseAlignment (OPT_Struct typ) return _o_result; } -static void OPC_FillGap (int64 gap, int64 off, int64 align, int64 *n, int64 *curAlign) +static void OPC_FillGap (int32 gap, int32 off, int32 align, int32 *n, int32 *curAlign) { - int64 adr; + int32 adr; adr = off; OPC_Align(&adr, align); if ((*curAlign < align && gap - (adr - off) >= align)) { @@ -933,11 +933,11 @@ static void OPC_FillGap (int64 gap, int64 off, int64 align, int64 *n, int64 *cur } } -static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, int64 *off, int64 *n, int64 *curAlign) +static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, int32 *off, int32 *n, int32 *curAlign) { OPT_Object fld = NIL; OPT_Struct base = NIL; - int64 gap, adr, align, fldAlign; + int32 gap, adr, align, fldAlign; fld = typ->link; align = __MASK(typ->align, -65536); if (typ->BaseTyp != NIL) { @@ -981,7 +981,7 @@ static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, int64 *off, int64 *n, i } } if (last) { - adr = typ->size - (int64)__ASHR(typ->sysflag, 8); + adr = typ->size - __ASHR(typ->sysflag, 8); if (adr == 0) { gap = 1; } else { @@ -993,16 +993,16 @@ static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, int64 *off, int64 *n, i } } -static void OPC_IdentList (OPT_Object obj, int32 vis) +static void OPC_IdentList (OPT_Object obj, int16 vis) { OPT_Struct base = NIL; BOOLEAN first; - int32 lastvis; + int16 lastvis; base = NIL; first = 1; while ((obj != NIL && obj->mode != 13)) { - if ((__IN(vis, 0x05, 64) || (vis == 1 && obj->vis != 0)) || (vis == 3 && !obj->leaf)) { - if (obj->typ != base || obj->vis != lastvis) { + if ((__IN(vis, 0x05, 32) || (vis == 1 && obj->vis != 0)) || (vis == 3 && !obj->leaf)) { + if (obj->typ != base || (int16)obj->vis != lastvis) { if (!first) { OPC_EndStat(); } @@ -1045,7 +1045,7 @@ static void OPC_IdentList (OPT_Object obj, int32 vis) OPC_Ident(obj); OPM_WriteString((CHAR*)"__typ", 6); base = NIL; - } else if ((((((__IN(5, OPM_opt, 64) && vis == 0)) && obj->mnolev > 0)) && obj->typ->form == 11)) { + } else if ((((((__IN(5, OPM_opt, 32) && vis == 0)) && obj->mnolev > 0)) && obj->typ->form == 11)) { OPM_WriteString((CHAR*)" = NIL", 7); } } @@ -1115,7 +1115,7 @@ static void OPC_ProcPredefs (OPT_Object obj, int8 vis) { if (obj != NIL) { OPC_ProcPredefs(obj->left, vis); - if ((((__IN(obj->mode, 0xc0, 64) && obj->vis >= vis)) && (obj->history != 4 || obj->mode == 6))) { + if ((((__IN(obj->mode, 0xc0, 32) && obj->vis >= vis)) && (obj->history != 4 || obj->mode == 6))) { if (vis == 1) { OPM_WriteString((CHAR*)"import ", 8); } else if (obj->vis == 0) { @@ -1141,18 +1141,18 @@ static void OPC_Include (CHAR *name, LONGINT name__len) __DEL(name); } -static void OPC_IncludeImports (OPT_Object obj, int32 vis) +static void OPC_IncludeImports (OPT_Object obj, int16 vis) { if (obj != NIL) { OPC_IncludeImports(obj->left, vis); - if ((((obj->mode == 11 && obj->mnolev != 0)) && OPT_GlbMod[__X(-obj->mnolev, 64)]->vis >= vis)) { + if ((((obj->mode == 11 && obj->mnolev != 0)) && (int16)OPT_GlbMod[__X(-obj->mnolev, 64)]->vis >= vis)) { OPC_Include(OPT_GlbMod[__X(-obj->mnolev, 64)]->name, 256); } OPC_IncludeImports(obj->right, vis); } } -static void OPC_GenDynTypes (OPT_Node n, int32 vis) +static void OPC_GenDynTypes (OPT_Node n, int16 vis) { OPT_Struct typ = NIL; while ((n != NIL && n->class == 14)) { @@ -1201,15 +1201,15 @@ void OPC_GenHdr (OPT_Node n) static void OPC_GenHeaderMsg (void) { - int32 i; + int16 i; OPM_WriteString((CHAR*)"/* ", 4); OPM_WriteString((CHAR*)"voc", 4); OPM_Write(' '); OPM_WriteString(Configuration_versionLong, 41); OPM_Write(' '); i = 0; - while (i <= 63) { - if (__IN(i, OPM_glbopt, 64)) { + while (i <= 31) { + if (__IN(i, OPM_glbopt, 32)) { switch (i) { case 0: OPM_Write('x'); @@ -1352,7 +1352,7 @@ static void OPC_InitImports (OPT_Object obj) void OPC_GenEnumPtrs (OPT_Object var) { OPT_Struct typ = NIL; - int64 n; + int32 n; OPC_GlbPtrs = 0; while (var != NIL) { typ = var->typ; @@ -1411,7 +1411,7 @@ void OPC_EnterBody (void) { OPM_WriteLn(); OPM_WriteString((CHAR*)"export ", 8); - if (__IN(10, OPM_opt, 64)) { + if (__IN(10, OPM_opt, 32)) { OPM_WriteString((CHAR*)"int main(int argc, char **argv)", 32); OPM_WriteLn(); } else { @@ -1422,20 +1422,20 @@ void OPC_EnterBody (void) } OPC_BegBlk(); OPC_BegStat(); - if (__IN(10, OPM_opt, 64)) { + if (__IN(10, OPM_opt, 32)) { OPM_WriteString((CHAR*)"__INIT(argc, argv)", 19); } else { OPM_WriteString((CHAR*)"__DEFMOD", 9); } OPC_EndStat(); - if ((__IN(10, OPM_opt, 64) && 0)) { + if ((__IN(10, OPM_opt, 32) && 0)) { OPC_BegStat(); OPM_WriteString((CHAR*)"/*don`t do it!*/ printf(\"DEMO VERSION: DO NOT USE THIS PROGRAM FOR ANY COMMERCIAL PURPOSE\\n\")", 94); OPC_EndStat(); } OPC_InitImports(OPT_topScope->right); OPC_BegStat(); - if (__IN(10, OPM_opt, 64)) { + if (__IN(10, OPM_opt, 32)) { OPM_WriteString((CHAR*)"__REGMAIN(\"", 12); } else { OPM_WriteString((CHAR*)"__REGMOD(\"", 11); @@ -1455,7 +1455,7 @@ void OPC_EnterBody (void) void OPC_ExitBody (void) { OPC_BegStat(); - if (__IN(10, OPM_opt, 64)) { + if (__IN(10, OPM_opt, 32)) { OPM_WriteString((CHAR*)"__FINI;", 8); } else { OPM_WriteString((CHAR*)"__ENDMOD;", 10); @@ -1497,7 +1497,7 @@ void OPC_EnterProc (OPT_Object proc) { OPT_Object var = NIL, scope = NIL; OPT_Struct typ = NIL; - int32 dim; + int16 dim; if (proc->vis != 1) { OPM_WriteString((CHAR*)"static ", 8); } @@ -1537,7 +1537,7 @@ void OPC_EnterProc (OPT_Object proc) } var = proc->link; while (var != NIL) { - if ((((__IN(var->typ->comp, 0x0c, 64) && var->mode == 1)) && var->typ->sysflag == 0)) { + if ((((__IN(var->typ->comp, 0x0c, 32) && var->mode == 1)) && var->typ->sysflag == 0)) { OPC_BegStat(); if (var->typ->comp == 2) { OPM_WriteString((CHAR*)"__DUPARR(", 10); @@ -1585,7 +1585,7 @@ void OPC_EnterProc (OPT_Object proc) OPM_Write('.'); OPC_Ident(var); OPM_WriteString((CHAR*)" = ", 4); - if (__IN(var->typ->comp, 0x0c, 64)) { + if (__IN(var->typ->comp, 0x0c, 32)) { OPM_WriteString((CHAR*)"(void*)", 8); } else if (var->mode != 2) { OPM_Write('&'); @@ -1711,7 +1711,7 @@ void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet) void OPC_CompleteIdent (OPT_Object obj) { - int32 comp, level; + int16 comp, level; level = obj->mnolev; if (obj->adr == 1) { if (obj->typ->comp == 4) { @@ -1740,10 +1740,10 @@ void OPC_CompleteIdent (OPT_Object obj) void OPC_TypeOf (OPT_Object ap) { - int32 i; + int16 i; __ASSERT(ap->typ->comp == 4, 0); if (ap->mode == 2) { - if (ap->mnolev != OPM_level) { + if ((int16)ap->mnolev != OPM_level) { OPM_WriteStringVar((void*)ap->scope->name, 256); OPM_WriteString((CHAR*)"_s->", 5); OPC_Ident(ap); @@ -1759,7 +1759,7 @@ void OPC_TypeOf (OPT_Object ap) } } -void OPC_Cmp (int32 rel) +void OPC_Cmp (int16 rel) { switch (rel) { case 9: @@ -1803,15 +1803,15 @@ static void OPC_CharacterLiteral (int64 c) } } -static void OPC_StringLiteral (CHAR *s, LONGINT s__len, int64 l) +static void OPC_StringLiteral (CHAR *s, LONGINT s__len, int32 l) { - int64 i; - int32 c; + int32 i; + int16 c; __DUP(s, s__len, CHAR); OPM_Write('"'); i = 0; while (i < l) { - c = s[__X(i, s__len)]; + c = (int16)s[__X(i, s__len)]; if (c < 32 || c > 126) { OPM_Write('\\'); OPM_Write((CHAR)(48 + __ASHR(c, 6))); @@ -1831,7 +1831,7 @@ static void OPC_StringLiteral (CHAR *s, LONGINT s__len, int64 l) __DEL(s); } -void OPC_Case (int64 caseVal, int32 form) +void OPC_Case (int64 caseVal, int16 form) { CHAR ch; OPM_WriteString((CHAR*)"case ", 6); @@ -1869,12 +1869,12 @@ void OPC_Increment (BOOLEAN decrement) } } -void OPC_Halt (int64 n) +void OPC_Halt (int32 n) { OPC_Str1((CHAR*)"__HALT(#)", 10, n); } -void OPC_IntLiteral (int64 n, int64 size) +void OPC_IntLiteral (int64 n, int32 size) { if ((((size > 4 && n <= 2147483647)) && n > (-2147483647-1))) { OPM_WriteString((CHAR*)"((int", 6); @@ -1904,11 +1904,11 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim) } } -void OPC_Constant (OPT_Const con, int32 form) +void OPC_Constant (OPT_Const con, int16 form) { - int32 i; + int16 i; SET s; - int64 hex; + int32 hex; BOOLEAN skipLeading; switch (form) { case 1: @@ -1933,13 +1933,13 @@ void OPC_Constant (OPT_Const con, int32 form) OPM_WriteString((CHAR*)"0x", 3); skipLeading = 1; s = con->setval; - i = 64; + i = 32; do { hex = 0; do { i -= 1; hex = __ASHL(hex, 1); - if (__IN(i, s, 64)) { + if (__IN(i, s, 32)) { hex += 1; } } while (!(__MASK(i, -8) == 0)); @@ -1975,7 +1975,7 @@ static void Enter__49 (CHAR *s, LONGINT s__len); static void Enter__49 (CHAR *s, LONGINT s__len) { - int32 h; + int16 h; __DUP(s, s__len, CHAR); h = OPC_PerfectHash((void*)s, s__len); OPC_hashtab[__X(h, 105)] = *InitKeywords__48_s->n; diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index 6fe30a31..4215947f 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -9,16 +9,16 @@ -import void OPC_Align (int64 *adr, int64 base); +import void OPC_Align (int32 *adr, int32 base); import void OPC_Andent (OPT_Struct typ); -import int64 OPC_BaseAlignment (OPT_Struct typ); +import int32 OPC_BaseAlignment (OPT_Struct typ); import OPT_Object OPC_BaseTProc (OPT_Object obj); import void OPC_BegBlk (void); import void OPC_BegStat (void); -import void OPC_Case (int64 caseVal, int32 form); -import void OPC_Cmp (int32 rel); +import void OPC_Case (int64 caseVal, int16 form); +import void OPC_Cmp (int16 rel); import void OPC_CompleteIdent (OPT_Object obj); -import void OPC_Constant (OPT_Const con, int32 form); +import void OPC_Constant (OPT_Const con, int16 form); import void OPC_DefineInter (OPT_Object proc); import void OPC_EndBlk (void); import void OPC_EndBlk0 (void); @@ -31,19 +31,19 @@ import void OPC_GenBdy (OPT_Node n); import void OPC_GenEnumPtrs (OPT_Object var); import void OPC_GenHdr (OPT_Node n); import void OPC_GenHdrIncludes (void); -import void OPC_Halt (int64 n); +import void OPC_Halt (int32 n); import void OPC_Ident (OPT_Object obj); import void OPC_Increment (BOOLEAN decrement); -import void OPC_Indent (int32 count); +import void OPC_Indent (int16 count); import void OPC_Init (void); import void OPC_InitTDesc (OPT_Struct typ); -import void OPC_IntLiteral (int64 n, int64 size); +import void OPC_IntLiteral (int64 n, int32 size); import void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim); -import int64 OPC_NofPtrs (OPT_Struct typ); +import int32 OPC_NofPtrs (OPT_Struct typ); import void OPC_SetInclude (BOOLEAN exclude); -import int64 OPC_SizeAlignment (int64 size); +import int32 OPC_SizeAlignment (int32 size); import void OPC_TDescDecl (OPT_Struct typ); -import void OPC_TypeDefs (OPT_Object obj, int32 vis); +import void OPC_TypeDefs (OPT_Object obj, int16 vis); import void OPC_TypeOf (OPT_Object ap); import void *OPC__init(void); diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 3f07341b..366d6522 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,8 +1,8 @@ /* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ -#define INTEGER int32 -#define LONGINT int64 -#define SET uint64 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Configuration.h" @@ -19,23 +19,24 @@ typedef static CHAR OPM_SourceFileName[256]; -export int32 OPM_Alignment, OPM_AddressSize, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; +export int16 OPM_Alignment, OPM_AddressSize, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; export int64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; -export int64 OPM_curpos, OPM_errpos, OPM_breakpc; -export int32 OPM_currFile, OPM_level, OPM_pc, OPM_entno; +export int32 OPM_curpos, OPM_errpos, OPM_breakpc; +export int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; export CHAR OPM_modName[32]; export CHAR OPM_objname[64]; export SET OPM_opt, OPM_glbopt; -static int64 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; +static int32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber; +static int64 OPM_lasterrpos; static Texts_Reader OPM_inR; static Texts_Text OPM_Log; static Texts_Writer OPM_W; static Files_Rider OPM_oldSF, OPM_newSF; static Files_Rider OPM_R[3]; static Files_File OPM_oldSFile, OPM_newSFile, OPM_HFile, OPM_BFile, OPM_HIFile; -static int32 OPM_S; +static int16 OPM_S; static CHAR OPM_OBERON[1024]; static CHAR OPM_MODULES[1024]; @@ -44,25 +45,25 @@ static void OPM_Append (Files_Rider *R, address *R__typ, Files_File F); export void OPM_CloseFiles (void); export void OPM_CloseOldSym (void); export void OPM_DeleteNewSym (void); -export void OPM_FPrint (int64 *fp, int64 val); -export void OPM_FPrintLReal (int64 *fp, LONGREAL lr); -export void OPM_FPrintReal (int64 *fp, REAL real); -export void OPM_FPrintSet (int64 *fp, SET set); +export void OPM_FPrint (int32 *fp, int64 val); +export void OPM_FPrintLReal (int32 *fp, LONGREAL lr); +export void OPM_FPrintReal (int32 *fp, REAL real); +export void OPM_FPrintSet (int32 *fp, SET set); static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 pos); export void OPM_Get (CHAR *ch); static void OPM_GetProperties (void); -static void OPM_GetProperty (Texts_Scanner *S, address *S__typ, CHAR *name, LONGINT name__len, int32 *size, int32 *align); +static void OPM_GetProperty (Texts_Scanner *S, address *S__typ, CHAR *name, LONGINT name__len, int16 *size, int16 *align); export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); export void OPM_InitOptions (void); -export int32 OPM_Integer (int64 n); -static void OPM_LogErrMsg (int32 n); +export int16 OPM_Integer (int64 n); +static void OPM_LogErrMsg (int16 n); export void OPM_LogW (CHAR ch); export void OPM_LogWLn (void); export void OPM_LogWNum (int64 i, int64 len); export void OPM_LogWStr (CHAR *s, LONGINT s__len); -export int64 OPM_Longint (int64 n); +export int32 OPM_Longint (int64 n); static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len); -export void OPM_Mark (int32 n, int64 pos); +export void OPM_Mark (int16 n, int64 pos); export void OPM_NewSym (CHAR *modName, LONGINT modName__len); export void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); export void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); @@ -70,10 +71,10 @@ export BOOLEAN OPM_OpenPar (void); export void OPM_RegisterNewSym (void); static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt); static void OPM_ShowLine (int64 pos); -export int64 OPM_SignedMaximum (int64 bytecount); -export int64 OPM_SignedMinimum (int64 bytecount); +export int64 OPM_SignedMaximum (int32 bytecount); +export int64 OPM_SignedMinimum (int32 bytecount); export void OPM_SymRCh (CHAR *ch); -export int64 OPM_SymRInt (void); +export int32 OPM_SymRInt (void); export int64 OPM_SymRInt64 (void); export void OPM_SymRLReal (LONGREAL *lr); export void OPM_SymRReal (REAL *r); @@ -92,9 +93,9 @@ export void OPM_WriteReal (LONGREAL r, CHAR suffx); export void OPM_WriteString (CHAR *s, LONGINT s__len); export void OPM_WriteStringVar (CHAR *s, LONGINT s__len); export BOOLEAN OPM_eofSF (void); -export void OPM_err (int32 n); -static int64 OPM_minusop (int64 i); -static int64 OPM_power0 (int64 i, int64 j); +export void OPM_err (int16 n); +static int32 OPM_minusop (int32 i); +static int32 OPM_power0 (int32 i, int32 j); void OPM_LogW (CHAR ch) @@ -119,23 +120,23 @@ void OPM_LogWLn (void) Console_Ln(); } -int64 OPM_Longint (int64 n) -{ - int64 _o_result; - _o_result = (int64)n; - return _o_result; -} - -int32 OPM_Integer (int64 n) +int32 OPM_Longint (int64 n) { int32 _o_result; _o_result = __VAL(int32, n); return _o_result; } +int16 OPM_Integer (int64 n) +{ + int16 _o_result; + _o_result = __VAL(int16, n); + return _o_result; +} + static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) { - int32 i; + int16 i; __DUP(s, s__len, CHAR); i = 1; while (s[__X(i, s__len)] != 0x00) { @@ -219,23 +220,23 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) OPM_LogWStr((CHAR*)"-M option requires two following digits.", 41); OPM_LogWLn(); } else { - OPM_AddressSize = s[__X(i + 1, s__len)] - 48; - OPM_Alignment = s[__X(i + 2, s__len)] - 48; + OPM_AddressSize = (int16)s[__X(i + 1, s__len)] - 48; + OPM_Alignment = (int16)s[__X(i + 2, s__len)] - 48; i += 2; } break; case 'B': if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_IntegerSize = s[__X(i, s__len)] - 48; + OPM_IntegerSize = (int16)s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_AddressSize = s[__X(i, s__len)] - 48; + OPM_AddressSize = (int16)s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_Alignment = s[__X(i, s__len)] - 48; + OPM_Alignment = (int16)s[__X(i, s__len)] - 48; } __ASSERT(OPM_IntegerSize == 2 || OPM_IntegerSize == 4, 0); __ASSERT(OPM_AddressSize == 4 || OPM_AddressSize == 8, 0); @@ -385,9 +386,9 @@ void OPM_InitOptions (void) s[0] = 0x00; Platform_GetArg(OPM_S, (void*)s, 256); } - if (__IN(15, OPM_opt, 64)) { - OPM_glbopt |= __SETOF(10,64); - OPM_opt |= __SETOF(10,64); + if (__IN(15, OPM_opt, 32)) { + OPM_glbopt |= __SETOF(10,32); + OPM_opt |= __SETOF(10,32); } OPM_GetProperties(); } @@ -395,7 +396,7 @@ void OPM_InitOptions (void) void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len) { Texts_Text T = NIL; - int64 beg, end, time; + int32 beg, end, time; CHAR s[256]; *done = 0; OPM_curpos = 0; @@ -443,7 +444,7 @@ void OPM_Get (CHAR *ch) static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len) { - int32 i, j; + int16 i, j; CHAR ch; __DUP(ext, ext__len, CHAR); i = 0; @@ -465,28 +466,28 @@ static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGIN __DEL(ext); } -static void OPM_LogErrMsg (int32 n) +static void OPM_LogErrMsg (int16 n) { Texts_Scanner S; Texts_Text T = NIL; CHAR ch; - int32 i; + int16 i; CHAR buf[1024]; if (n >= 0) { - if (!__IN(16, OPM_opt, 64)) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"31m", 4); } OPM_LogWStr((CHAR*)" err ", 7); - if (!__IN(16, OPM_opt, 64)) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } } else { - if (!__IN(16, OPM_opt, 64)) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"35m", 4); } OPM_LogWStr((CHAR*)" warning ", 11); n = -n; - if (!__IN(16, OPM_opt, 64)) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } } @@ -498,18 +499,18 @@ static void OPM_LogErrMsg (int32 n) static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 pos) { CHAR ch, cheol; - if (pos < OPM_ErrorLineStartPos) { + if (pos < (int64)OPM_ErrorLineStartPos) { OPM_ErrorLineStartPos = 0; OPM_ErrorLineLimitPos = 0; OPM_ErrorLineNumber = 0; } - if (pos < OPM_ErrorLineLimitPos) { + if (pos < (int64)OPM_ErrorLineLimitPos) { Files_Set(&*r, r__typ, f, OPM_ErrorLineStartPos); return; } Files_Set(&*r, r__typ, f, OPM_ErrorLineLimitPos); Files_Read(&*r, r__typ, (void*)&ch); - while ((OPM_ErrorLineLimitPos < pos && !(*r).eof)) { + while (((int64)OPM_ErrorLineLimitPos < pos && !(*r).eof)) { OPM_ErrorLineStartPos = OPM_ErrorLineLimitPos; OPM_ErrorLineNumber += 1; while ((((ch != 0x00 && ch != 0x0d)) && ch != 0x0a)) { @@ -532,7 +533,7 @@ static void OPM_ShowLine (int64 pos) Files_File f = NIL; Files_Rider r; CHAR line[1023]; - int32 i; + int16 i; CHAR ch; f = Files_Old(OPM_SourceFileName, 256); OPM_FindLine(f, &r, Files_Rider__typ, pos); @@ -551,25 +552,25 @@ static void OPM_ShowLine (int64 pos) OPM_LogWStr(line, 1023); OPM_LogWLn(); OPM_LogWStr((CHAR*)" ", 7); - if (pos >= OPM_ErrorLineLimitPos) { + if (pos >= (int64)OPM_ErrorLineLimitPos) { pos = OPM_ErrorLineLimitPos - 1; } - i = (int32)OPM_Longint(pos - OPM_ErrorLineStartPos); + i = (int16)OPM_Longint(pos - (int64)OPM_ErrorLineStartPos); while (i > 0) { OPM_LogW(' '); i -= 1; } - if (!__IN(16, OPM_opt, 64)) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"32m", 4); } OPM_LogW('^'); - if (!__IN(16, OPM_opt, 64)) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } Files_Close(f); } -void OPM_Mark (int32 n, int64 pos) +void OPM_Mark (int16 n, int64 pos) { if (pos == -1) { pos = 0; @@ -621,49 +622,51 @@ void OPM_Mark (int32 n, int64 pos) } } -void OPM_err (int32 n) +void OPM_err (int16 n) { OPM_Mark(n, OPM_errpos); } -void OPM_FPrint (int64 *fp, int64 val) +void OPM_FPrint (int32 *fp, int64 val) { - *fp = __ROTL((int64)((SET)*fp ^ (SET)val), 1, 64); + *fp = __ROTL((int32)((SET)*fp ^ __VAL(SET, val)), 1, 32); } -void OPM_FPrintSet (int64 *fp, SET set) +void OPM_FPrintSet (int32 *fp, SET set) { - OPM_FPrint(&*fp, (int64)set); + OPM_FPrint(&*fp, (int32)set); } -void OPM_FPrintReal (int64 *fp, REAL real) +void OPM_FPrintReal (int32 *fp, REAL real) { - int32 i; - int64 l; - __GET((address)&real, i, int32); - l = i; + int16 i; + int32 l; + __GET((address)&real, l, int32); OPM_FPrint(&*fp, l); } -void OPM_FPrintLReal (int64 *fp, LONGREAL lr) +void OPM_FPrintLReal (int32 *fp, LONGREAL lr) { - int64 l, h; - OPM_FPrint(&*fp, __VAL(int64, lr)); + int32 l, h; + __GET((address)&lr, l, int32); + __GET((address)&lr + 4, h, int32); + OPM_FPrint(&*fp, l); + OPM_FPrint(&*fp, h); } -static void OPM_GetProperty (Texts_Scanner *S, address *S__typ, CHAR *name, LONGINT name__len, int32 *size, int32 *align) +static void OPM_GetProperty (Texts_Scanner *S, address *S__typ, CHAR *name, LONGINT name__len, int16 *size, int16 *align) { __DUP(name, name__len, CHAR); if (((*S).class == 1 && __STRCMP((*S).s, name) == 0)) { Texts_Scan(&*S, S__typ); if ((*S).class == 3) { - *size = (int32)(*S).i; + *size = (int16)(*S).i; Texts_Scan(&*S, S__typ); } else { OPM_Mark(-157, -1); } if ((*S).class == 3) { - *align = (int32)(*S).i; + *align = (int16)(*S).i; Texts_Scan(&*S, S__typ); } else { OPM_Mark(-157, -1); @@ -674,17 +677,17 @@ static void OPM_GetProperty (Texts_Scanner *S, address *S__typ, CHAR *name, LONG __DEL(name); } -static int64 OPM_minusop (int64 i) +static int32 OPM_minusop (int32 i) { - int64 _o_result; + int32 _o_result; _o_result = -i; return _o_result; } -static int64 OPM_power0 (int64 i, int64 j) +static int32 OPM_power0 (int32 i, int32 j) { - int64 _o_result; - int64 k, p; + int32 _o_result; + int32 k, p; k = 1; p = i; do { @@ -721,7 +724,7 @@ static void OPM_VerboseListSizes (void) OPM_LogWLn(); } -int64 OPM_SignedMaximum (int64 bytecount) +int64 OPM_SignedMaximum (int32 bytecount) { int64 _o_result; int64 result; @@ -731,7 +734,7 @@ int64 OPM_SignedMaximum (int64 bytecount) return _o_result; } -int64 OPM_SignedMinimum (int64 bytecount) +int64 OPM_SignedMinimum (int32 bytecount) { int64 _o_result; _o_result = -OPM_SignedMaximum(bytecount) - 1; @@ -746,7 +749,7 @@ static void OPM_GetProperties (void) OPM_MinLReal = -OPM_MaxLReal; OPM_MaxSet = __ASHL(OPM_SetSize, 3) - 1; OPM_MaxIndex = OPM_SignedMaximum(OPM_AddressSize); - if (__IN(18, OPM_opt, 64)) { + if (__IN(18, OPM_opt, 32)) { OPM_VerboseListSizes(); } } @@ -756,10 +759,10 @@ void OPM_SymRCh (CHAR *ch) Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&*ch); } -int64 OPM_SymRInt (void) +int32 OPM_SymRInt (void) { - int64 _o_result; - int64 k; + int32 _o_result; + int32 k; Files_ReadNum(&OPM_oldSF, Files_Rider__typ, &k); _o_result = k; return _o_result; @@ -776,7 +779,7 @@ int64 OPM_SymRInt64 (void) void OPM_SymRSet (SET *s) { - Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (int64*)&*s); + Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (int32*)&*s); } void OPM_SymRReal (REAL *r) @@ -830,7 +833,7 @@ void OPM_SymWInt (int64 i) void OPM_SymWSet (SET s) { - Files_WriteNum(&OPM_newSF, Files_Rider__typ, (int64)s); + Files_WriteNum(&OPM_newSF, Files_Rider__typ, (int32)s); } void OPM_SymWReal (REAL r) @@ -845,7 +848,7 @@ void OPM_SymWLReal (LONGREAL lr) void OPM_RegisterNewSym (void) { - if (__STRCMP(OPM_modName, "SYSTEM") != 0 || __IN(10, OPM_opt, 64)) { + if (__STRCMP(OPM_modName, "SYSTEM") != 0 || __IN(10, OPM_opt, 32)) { Files_Register(OPM_newSFile); } } @@ -874,7 +877,7 @@ void OPM_Write (CHAR ch) void OPM_WriteString (CHAR *s, LONGINT s__len) { - int32 i; + int16 i; i = 0; while (s[__X(i, s__len)] != 0x00) { i += 1; @@ -884,7 +887,7 @@ void OPM_WriteString (CHAR *s, LONGINT s__len) void OPM_WriteStringVar (CHAR *s, LONGINT s__len) { - int32 i; + int16 i; i = 0; while (s[__X(i, s__len)] != 0x00) { i += 1; @@ -948,14 +951,14 @@ void OPM_WriteReal (LONGREAL r, CHAR suffx) Texts_Reader R; CHAR s[32]; CHAR ch; - int32 i; - if ((((r < OPM_SignedMaximum(OPM_LongintSize) && r > OPM_SignedMinimum(OPM_LongintSize))) && r == (__ENTIER(r)))) { + int16 i; + if ((((r < OPM_SignedMaximum(OPM_LongintSize) && r > OPM_SignedMinimum(OPM_LongintSize))) && r == ((int32)__ENTIER(r)))) { if (suffx == 'f') { OPM_WriteString((CHAR*)"(REAL)", 7); } else { OPM_WriteString((CHAR*)"(LONGREAL)", 11); } - OPM_WriteInt(__ENTIER(r)); + OPM_WriteInt((int32)__ENTIER(r)); } else { Texts_OpenWriter(&W, Texts_Writer__typ); if (suffx == 'f') { @@ -1036,7 +1039,7 @@ void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len) void OPM_CloseFiles (void) { CHAR FName[32]; - int32 res; + int16 res; if (OPM_noerr) { OPM_LogWStr((CHAR*)" ", 3); OPM_LogWNum(Files_Pos(&OPM_R[1], Files_Rider__typ), 0); @@ -1044,10 +1047,10 @@ void OPM_CloseFiles (void) } if (OPM_noerr) { if (__STRCMP(OPM_modName, "SYSTEM") == 0) { - if (!__IN(10, OPM_opt, 64)) { + if (!__IN(10, OPM_opt, 32)) { Files_Register(OPM_BFile); } - } else if (!__IN(10, OPM_opt, 64)) { + } else if (!__IN(10, OPM_opt, 32)) { OPM_Append(&OPM_R[2], Files_Rider__typ, OPM_HFile); Files_Register(OPM_HIFile); Files_Register(OPM_BFile); @@ -1073,12 +1076,12 @@ void OPM_CloseFiles (void) static void EnumPtrs(void (*P)(void*)) { - __ENUMR(&OPM_inR, Texts_Reader__typ, 96, 1, P); + __ENUMR(&OPM_inR, Texts_Reader__typ, 72, 1, P); P(OPM_Log); - __ENUMR(&OPM_W, Texts_Writer__typ, 72, 1, P); - __ENUMR(&OPM_oldSF, Files_Rider__typ, 40, 1, P); - __ENUMR(&OPM_newSF, Files_Rider__typ, 40, 1, P); - __ENUMR(OPM_R, Files_Rider__typ, 40, 3, P); + __ENUMR(&OPM_W, Texts_Writer__typ, 56, 1, P); + __ENUMR(&OPM_oldSF, Files_Rider__typ, 24, 1, P); + __ENUMR(&OPM_newSF, Files_Rider__typ, 24, 1, P); + __ENUMR(OPM_R, Files_Rider__typ, 24, 3, P); P(OPM_oldSFile); P(OPM_newSFile); P(OPM_HFile); @@ -1121,8 +1124,8 @@ export void *OPM__init(void) OPM_AddressSize = 8; OPM_Alignment = 8; OPM_ShortintSize = 1; - OPM_IntegerSize = 4; - OPM_LongintSize = 8; - OPM_SetSize = 8; + OPM_IntegerSize = 2; + OPM_LongintSize = 4; + OPM_SetSize = 4; __ENDMOD; } diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index 765b9680..a6b7990c 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -6,12 +6,12 @@ #include "SYSTEM.h" -import int32 OPM_Alignment, OPM_AddressSize, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; +import int16 OPM_Alignment, OPM_AddressSize, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; import int64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; -import int64 OPM_curpos, OPM_errpos, OPM_breakpc; -import int32 OPM_currFile, OPM_level, OPM_pc, OPM_entno; +import int32 OPM_curpos, OPM_errpos, OPM_breakpc; +import int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; import CHAR OPM_modName[32]; import CHAR OPM_objname[64]; import SET OPM_opt, OPM_glbopt; @@ -20,29 +20,29 @@ import SET OPM_opt, OPM_glbopt; import void OPM_CloseFiles (void); import void OPM_CloseOldSym (void); import void OPM_DeleteNewSym (void); -import void OPM_FPrint (int64 *fp, int64 val); -import void OPM_FPrintLReal (int64 *fp, LONGREAL lr); -import void OPM_FPrintReal (int64 *fp, REAL real); -import void OPM_FPrintSet (int64 *fp, SET set); +import void OPM_FPrint (int32 *fp, int64 val); +import void OPM_FPrintLReal (int32 *fp, LONGREAL lr); +import void OPM_FPrintReal (int32 *fp, REAL real); +import void OPM_FPrintSet (int32 *fp, SET set); import void OPM_Get (CHAR *ch); import void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); import void OPM_InitOptions (void); -import int32 OPM_Integer (int64 n); +import int16 OPM_Integer (int64 n); import void OPM_LogW (CHAR ch); import void OPM_LogWLn (void); import void OPM_LogWNum (int64 i, int64 len); import void OPM_LogWStr (CHAR *s, LONGINT s__len); -import int64 OPM_Longint (int64 n); -import void OPM_Mark (int32 n, int64 pos); +import int32 OPM_Longint (int64 n); +import void OPM_Mark (int16 n, int64 pos); import void OPM_NewSym (CHAR *modName, LONGINT modName__len); import void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); import void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); import BOOLEAN OPM_OpenPar (void); import void OPM_RegisterNewSym (void); -import int64 OPM_SignedMaximum (int64 bytecount); -import int64 OPM_SignedMinimum (int64 bytecount); +import int64 OPM_SignedMaximum (int32 bytecount); +import int64 OPM_SignedMinimum (int32 bytecount); import void OPM_SymRCh (CHAR *ch); -import int64 OPM_SymRInt (void); +import int32 OPM_SymRInt (void); import int64 OPM_SymRInt64 (void); import void OPM_SymRLReal (LONGREAL *lr); import void OPM_SymRReal (REAL *r); @@ -60,7 +60,7 @@ import void OPM_WriteReal (LONGREAL r, CHAR suffx); import void OPM_WriteString (CHAR *s, LONGINT s__len); import void OPM_WriteStringVar (CHAR *s, LONGINT s__len); import BOOLEAN OPM_eofSF (void); -import void OPM_err (int32 n); +import void OPM_err (int16 n); import void *OPM__init(void); diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index 9b25c35f..74f93e77 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,8 +1,8 @@ /* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ -#define INTEGER int32 -#define LONGINT int64 -#define SET uint64 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "OPB.h" @@ -11,7 +11,7 @@ #include "OPT.h" struct OPP__1 { - int64 low, high; + int32 low, high; }; typedef @@ -19,9 +19,9 @@ typedef static int8 OPP_sym, OPP_level; -static int32 OPP_LoopLevel; +static int16 OPP_LoopLevel; static OPT_Node OPP_TDinit, OPP_lastTDinit; -static int32 OPP_nofFwdPtr; +static int16 OPP_nofFwdPtr; static OPT_Struct OPP_FwdPtr[64]; export address *OPP__1__typ; @@ -29,10 +29,10 @@ export address *OPP__1__typ; static void OPP_ActualParameters (OPT_Node *aparlist, OPT_Object fpar); static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned); static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq); -static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int32 *n, OPP_CaseTable tab); +static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int16 *n, OPP_CaseTable tab); static void OPP_CheckMark (int8 *vis); -static void OPP_CheckSym (int32 s); -static void OPP_CheckSysFlag (int32 *sysflag, int32 default_); +static void OPP_CheckSym (int16 s); +static void OPP_CheckSysFlag (int16 *sysflag, int16 default_); static void OPP_ConstExpression (OPT_Node *x); static void OPP_Element (OPT_Node *x); static void OPP_Expression (OPT_Node *x); @@ -51,19 +51,19 @@ static void OPP_StatSeq (OPT_Node *stat); static void OPP_Term (OPT_Node *x); static void OPP_Type (OPT_Struct *typ, OPT_Struct *banned); static void OPP_TypeDecl (OPT_Struct *typ, OPT_Struct *banned); -static void OPP_err (int32 n); +static void OPP_err (int16 n); static void OPP_qualident (OPT_Object *id); static void OPP_selector (OPT_Node *x); -static void OPP_err (int32 n) +static void OPP_err (int16 n) { OPM_err(n); } -static void OPP_CheckSym (int32 s) +static void OPP_CheckSym (int16 s) { - if (OPP_sym == s) { + if ((int16)OPP_sym == s) { OPS_Get(&OPP_sym); } else { OPM_err(s); @@ -94,7 +94,7 @@ static void OPP_qualident (OPT_Object *id) obj->adr = 0; } else { lev = obj->mnolev; - if ((__IN(obj->mode, 0x06, 64) && lev != OPP_level)) { + if ((__IN(obj->mode, 0x06, 32) && lev != OPP_level)) { obj->leaf = 0; if (lev > 0) { OPB_StaticLink(OPP_level - lev); @@ -131,7 +131,7 @@ static void OPP_CheckMark (int8 *vis) } } -static void OPP_CheckSysFlag (int32 *sysflag, int32 default_) +static void OPP_CheckSysFlag (int16 *sysflag, int16 default_) { OPT_Node x = NIL; int64 sf; @@ -162,7 +162,7 @@ static void OPP_RecordType (OPT_Struct *typ, OPT_Struct *banned) { OPT_Object fld = NIL, first = NIL, last = NIL, base = NIL; OPT_Struct ftyp = NIL; - int32 sysflag; + int16 sysflag; *typ = OPT_NewStr(13, 4); (*typ)->BaseTyp = NIL; OPP_CheckSysFlag(&sysflag, -1); @@ -255,7 +255,7 @@ static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) { OPT_Node x = NIL; int64 n; - int32 sysflag; + int16 sysflag; OPP_CheckSysFlag(&sysflag, 0); if (OPP_sym == 25) { *typ = OPT_NewStr(13, 3); @@ -325,7 +325,7 @@ static void OPP_PointerType (OPT_Struct *typ) } else { OPP_qualident(&id); if (id->mode == 5) { - if (__IN(id->typ->comp, 0x1c, 64)) { + if (__IN(id->typ->comp, 0x1c, 32)) { (*typ)->BaseTyp = id->typ; } else { (*typ)->BaseTyp = OPT_undftyp; @@ -338,7 +338,7 @@ static void OPP_PointerType (OPT_Struct *typ) } } else { OPP_Type(&(*typ)->BaseTyp, &OPT_notyp); - if (!__IN((*typ)->BaseTyp->comp, 0x1c, 64)) { + if (!__IN((*typ)->BaseTyp->comp, 0x1c, 32)) { (*typ)->BaseTyp = OPT_undftyp; OPP_err(57); } @@ -629,8 +629,8 @@ static void OPP_StandProcCall (OPT_Node *x) { OPT_Node y = NIL; int8 m; - int32 n; - m = (int8)((int32)(*x)->obj->adr); + int16 n; + m = (int8)((int16)(*x)->obj->adr); n = 0; if (OPP_sym == 30) { OPS_Get(&OPP_sym); @@ -931,7 +931,7 @@ static void TProcDecl__23 (void); static void GetCode__19 (void) { OPT_ConstExt ext = NIL; - int32 n; + int16 n; int64 c; ext = OPT_NewExt(); (*ProcedureDeclaration__16_s->proc)->conval->ext = ext; @@ -966,7 +966,7 @@ static void GetCode__19 (void) } } } - (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1,64); + (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1,32); } static void GetParams__21 (void) @@ -996,9 +996,9 @@ static void GetParams__21 (void) static void Body__17 (void) { OPT_Node procdec = NIL, statseq = NIL; - int64 c; + int32 c; c = OPM_errpos; - (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1,64); + (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1,32); OPP_CheckSym(39); OPP_Block(&procdec, &statseq); OPB_Enter(&procdec, statseq, *ProcedureDeclaration__16_s->proc); @@ -1041,7 +1041,7 @@ static void TProcDecl__23 (void) if ((*ProcedureDeclaration__16_s->fwd != NIL && (*ProcedureDeclaration__16_s->fwd)->mnolev != OPP_level)) { *ProcedureDeclaration__16_s->fwd = NIL; } - if ((((*ProcedureDeclaration__16_s->fwd != NIL && (*ProcedureDeclaration__16_s->fwd)->mode == 13)) && !__IN(1, (*ProcedureDeclaration__16_s->fwd)->conval->setval, 64))) { + if ((((*ProcedureDeclaration__16_s->fwd != NIL && (*ProcedureDeclaration__16_s->fwd)->mode == 13)) && !__IN(1, (*ProcedureDeclaration__16_s->fwd)->conval->setval, 32))) { *ProcedureDeclaration__16_s->proc = OPT_NewObj(); (*ProcedureDeclaration__16_s->proc)->leaf = 1; if ((*ProcedureDeclaration__16_s->fwd)->vis != *ProcedureDeclaration__16_s->vis) { @@ -1075,7 +1075,7 @@ static void TProcDecl__23 (void) if ((((((baseProc->vis == 1 && (*ProcedureDeclaration__16_s->proc)->vis == 0)) && recTyp->strobj != NIL)) && recTyp->strobj->vis == 1)) { OPP_err(109); } - (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(2,64); + (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(2,32); } if (!*ProcedureDeclaration__16_s->forward) { Body__17(); @@ -1118,7 +1118,7 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) } else { OPP_err(38); } - if ((__IN(mode, 0x0600, 64) && !OPT_SYSimported)) { + if ((__IN(mode, 0x0600, 32) && !OPT_SYSimported)) { OPP_err(135); } OPS_Get(&OPP_sym); @@ -1135,7 +1135,7 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) if ((fwd != NIL && (fwd->mnolev != OPP_level || fwd->mode == 8))) { fwd = NIL; } - if ((((fwd != NIL && __IN(fwd->mode, 0xc0, 64))) && !__IN(1, fwd->conval->setval, 64))) { + if ((((fwd != NIL && __IN(fwd->mode, 0xc0, 32))) && !__IN(1, fwd->conval->setval, 32))) { proc = OPT_NewObj(); proc->leaf = 1; if (fwd->vis != vis) { @@ -1168,17 +1168,17 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) ProcedureDeclaration__16_s = _s.lnk; } -static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int32 *n, OPP_CaseTable tab) +static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int16 *n, OPP_CaseTable tab) { OPT_Node x = NIL, y = NIL, lastlab = NIL; - int32 i, f; - int64 xval, yval; + int16 i, f; + int32 xval, yval; *lab = NIL; lastlab = NIL; for (;;) { OPP_ConstExpression(&x); f = x->typ->form; - if (__IN(f, 0x18, 64)) { + if (__IN(f, 0x18, 32)) { xval = OPM_Longint(x->conval->intval); } else { OPP_err(61); @@ -1188,14 +1188,14 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int32 *n, OPP if (!(LabelTyp->form == 4) || LabelTyp->size < x->typ->size) { OPP_err(60); } - } else if (LabelTyp->form != f) { + } else if ((int16)LabelTyp->form != f) { OPP_err(60); } if (OPP_sym == 21) { OPS_Get(&OPP_sym); OPP_ConstExpression(&y); yval = OPM_Longint(y->conval->intval); - if ((y->typ->form != f && !((f == 4 && y->typ->form == 4)))) { + if (((int16)y->typ->form != f && !((f == 4 && y->typ->form == 4)))) { OPP_err(60); } if (yval < xval) { @@ -1239,7 +1239,7 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int32 *n, OPP } static struct StatSeq__30 { - int64 *pos; + int32 *pos; struct StatSeq__30 *lnk; } *StatSeq__30_s; @@ -1249,8 +1249,8 @@ static void SetPos__35 (OPT_Node x); static void CasePart__31 (OPT_Node *x) { - int32 n; - int64 low, high; + int16 n; + int32 low, high; BOOLEAN e; OPP_CaseTable tab; OPT_Node cases = NIL, lab = NIL, y = NIL, lastcase = NIL; @@ -1258,7 +1258,7 @@ static void CasePart__31 (OPT_Node *x) *StatSeq__30_s->pos = OPM_errpos; if ((*x)->class == 8 || (*x)->class == 9) { OPP_err(126); - } else if (!__IN((*x)->typ->form, 0x18, 64)) { + } else if (!__IN((*x)->typ->form, 0x18, 32)) { OPP_err(125); } OPP_CheckSym(25); @@ -1333,7 +1333,7 @@ static void OPP_StatSeq (OPT_Node *stat) OPT_Struct idtyp = NIL; BOOLEAN e; OPT_Node s = NIL, x = NIL, y = NIL, z = NIL, apar = NIL, last = NIL, lastif = NIL; - int64 pos; + int32 pos; OPS_Name name; struct StatSeq__30 _s; _s.pos = &pos; @@ -1626,7 +1626,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) OPT_Struct typ = NIL; OPT_Object obj = NIL, first = NIL, last = NIL; OPT_Node x = NIL, lastdec = NIL; - int32 i; + int16 i; first = NIL; last = NIL; OPP_nofFwdPtr = 0; @@ -1675,7 +1675,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) if (obj->typ->strobj == NIL) { obj->typ->strobj = obj; } - if (__IN(obj->typ->comp, 0x1c, 64)) { + if (__IN(obj->typ->comp, 0x1c, 32)) { i = 0; while (i < OPP_nofFwdPtr) { typ = OPP_FwdPtr[__X(i, 64)]; @@ -1779,7 +1779,7 @@ void OPP_Module (OPT_Node *prog, SET opt) { OPS_Name impName, aliasName; OPT_Node procdec = NIL, statseq = NIL; - int64 c; + int32 c; BOOLEAN done; OPS_Init(); OPP_LoopLevel = 0; @@ -1880,7 +1880,7 @@ static void EnumPtrs(void (*P)(void*)) __ENUMP(OPP_FwdPtr, 64, P); } -__TDESC(OPP__1, 1, 0) = {__TDFLDS("", 16), {-8}}; +__TDESC(OPP__1, 1, 0) = {__TDFLDS("", 8), {-8}}; export void *OPP__init(void) { diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index cd24b8ee..0cac83bd 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,8 +1,8 @@ /* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tspaSfF */ -#define INTEGER int32 -#define LONGINT int64 -#define SET uint64 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "OPM.h" @@ -16,7 +16,7 @@ typedef export OPS_Name OPS_name; export OPS_String OPS_str; -export int32 OPS_numtyp; +export int16 OPS_numtyp; export int64 OPS_intval; export REAL OPS_realval; export LONGREAL OPS_lrlval; @@ -28,17 +28,17 @@ static void OPS_Identifier (int8 *sym); export void OPS_Init (void); static void OPS_Number (void); static void OPS_Str (int8 *sym); -static void OPS_err (int32 n); +static void OPS_err (int16 n); -static void OPS_err (int32 n) +static void OPS_err (int16 n) { OPM_err(n); } static void OPS_Str (int8 *sym) { - int32 i; + int16 i; CHAR och; i = 0; och = OPS_ch; @@ -64,7 +64,7 @@ static void OPS_Str (int8 *sym) if (OPS_intval == 2) { *sym = 35; OPS_numtyp = 1; - OPS_intval = OPS_str[0]; + OPS_intval = (int16)OPS_str[0]; } else { *sym = 37; } @@ -72,7 +72,7 @@ static void OPS_Str (int8 *sym) static void OPS_Identifier (int8 *sym) { - int32 i; + int16 i; i = 0; do { OPS_name[i] = OPS_ch; @@ -91,10 +91,10 @@ static struct Number__6 { struct Number__6 *lnk; } *Number__6_s; -static int32 Ord__7 (CHAR ch, BOOLEAN hex); -static LONGREAL Ten__9 (int32 e); +static int16 Ord__7 (CHAR ch, BOOLEAN hex); +static LONGREAL Ten__9 (int16 e); -static LONGREAL Ten__9 (int32 e) +static LONGREAL Ten__9 (int16 e) { LONGREAL _o_result; LONGREAL x, p; @@ -113,14 +113,14 @@ static LONGREAL Ten__9 (int32 e) return _o_result; } -static int32 Ord__7 (CHAR ch, BOOLEAN hex) +static int16 Ord__7 (CHAR ch, BOOLEAN hex) { - int32 _o_result; + int16 _o_result; if (ch <= '9') { - _o_result = ch - 48; + _o_result = (int16)ch - 48; return _o_result; } else if (hex) { - _o_result = (ch - 65) + 10; + _o_result = ((int16)ch - 65) + 10; return _o_result; } else { OPS_err(2); @@ -132,7 +132,7 @@ static int32 Ord__7 (CHAR ch, BOOLEAN hex) static void OPS_Number (void) { - int32 i, m, n, d, e; + int16 i, m, n, d, e; CHAR dig[24]; LONGREAL f; CHAR expCh; @@ -235,7 +235,7 @@ static void OPS_Number (void) do { n = Ord__7(OPS_ch, 0); OPM_Get(&OPS_ch); - if (e <= __DIV(2147483647 - n, 10)) { + if (e <= __DIV(32767 - n, 10)) { e = e * 10 + n; } else { OPS_err(203); diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index bcc2ae4d..caef45f4 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -14,7 +14,7 @@ typedef import OPS_Name OPS_name; import OPS_String OPS_str; -import int32 OPS_numtyp; +import int16 OPS_numtyp; import int64 OPS_intval; import REAL OPS_realval; import LONGREAL OPS_lrlval; diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index 41686385..d40808d2 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,8 +1,8 @@ /* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ -#define INTEGER int32 -#define LONGINT int64 -#define SET uint64 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "OPM.h" @@ -17,15 +17,16 @@ typedef typedef struct OPT_ConstDesc { OPT_ConstExt ext; - int64 intval, intval2; + int64 intval; + int32 intval2; SET setval; LONGREAL realval; } OPT_ConstDesc; typedef struct OPT_ExpCtxt { - int64 reffp; - int32 ref; + int32 reffp; + int16 ref; int8 nofm; int8 locmno[64]; } OPT_ExpCtxt; @@ -38,12 +39,12 @@ typedef typedef struct OPT_ImpCtxt { - int64 nextTag, reffp; - int32 nofr, minr, nofm; + int32 nextTag, reffp; + int16 nofr, minr, nofm; BOOLEAN self; OPT_Struct ref[255]; OPT_Object old[255]; - int64 pvfp[255]; + int32 pvfp[255]; int8 glbmno[64]; } OPT_ImpCtxt; @@ -67,20 +68,20 @@ typedef BOOLEAN leaf; int8 mode, mnolev, vis, history; BOOLEAN used, fpdone; - int64 fprint; + int32 fprint; OPT_Struct typ; OPT_Const conval; - int64 adr, linkadr; - int32 x; + int32 adr, linkadr; + int16 x; } OPT_ObjDesc; typedef struct OPT_StrDesc { int8 form, comp, mno, extlev; - int32 ref, sysflag; - int64 n, size, align, txtpos; + int16 ref, sysflag; + int32 n, size, align, txtpos; BOOLEAN allocated, pbused, pvused, fpdone, idfpdone; - int64 idfp, pbfp, pvfp; + int32 idfp, pbfp, pvfp; OPT_Struct BaseTyp; OPT_Object link, strobj; } OPT_StrDesc; @@ -97,7 +98,7 @@ export BOOLEAN OPT_SYSimported; static OPT_Object OPT_universe, OPT_syslink; static OPT_ImpCtxt OPT_impCtxt; static OPT_ExpCtxt OPT_expCtxt; -static int64 OPT_nofhdfld; +static int32 OPT_nofhdfld; static BOOLEAN OPT_newsf, OPT_findpc, OPT_extsf, OPT_sfpresent, OPT_symExtended, OPT_symNew; export address *OPT_ConstDesc__typ; @@ -110,22 +111,22 @@ export address *OPT_ExpCtxt__typ; export void OPT_Close (void); export void OPT_CloseScope (void); static void OPT_DebugStruct (OPT_Struct btyp); -static void OPT_EnterBoolConst (OPS_Name name, int64 value); -static void OPT_EnterProc (OPS_Name name, int32 num); -static void OPT_EnterTyp (OPS_Name name, int8 form, int32 size, OPT_Struct *res); +static void OPT_EnterBoolConst (OPS_Name name, int32 value); +static void OPT_EnterProc (OPS_Name name, int16 num); +static void OPT_EnterTyp (OPS_Name name, int8 form, int16 size, OPT_Struct *res); static void OPT_EnterTypeAlias (OPS_Name name, OPT_Object *res); export void OPT_Export (BOOLEAN *ext, BOOLEAN *new); -export void OPT_FPrintErr (OPT_Object obj, int32 errcode); -static void OPT_FPrintName (int64 *fp, CHAR *name, LONGINT name__len); +export void OPT_FPrintErr (OPT_Object obj, int16 errcode); +static void OPT_FPrintName (int32 *fp, CHAR *name, LONGINT name__len); export void OPT_FPrintObj (OPT_Object obj); -static void OPT_FPrintSign (int64 *fp, OPT_Struct result, OPT_Object par); +static void OPT_FPrintSign (int32 *fp, OPT_Struct result, OPT_Object par); export void OPT_FPrintStr (OPT_Struct typ); export void OPT_Find (OPT_Object *res); export void OPT_FindField (OPS_Name name, OPT_Struct typ, OPT_Object *res); export void OPT_FindImport (OPT_Object mod, OPT_Object *res); export void OPT_IdFPrint (OPT_Struct typ); export void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); -static void OPT_InConstant (int64 f, OPT_Const conval); +static void OPT_InConstant (int32 f, OPT_Const conval); static OPT_Object OPT_InFld (void); static void OPT_InMod (int8 *mno); static void OPT_InName (CHAR *name, LONGINT name__len); @@ -133,13 +134,13 @@ static OPT_Object OPT_InObj (int8 mno); static void OPT_InSign (int8 mno, OPT_Struct *res, OPT_Object *par); static void OPT_InStruct (OPT_Struct *typ); static OPT_Object OPT_InTProc (int8 mno); -static OPT_Struct OPT_InTyp (int64 tag); +static OPT_Struct OPT_InTyp (int32 tag); export void OPT_Init (OPS_Name name, SET opt); static void OPT_InitStruct (OPT_Struct *typ, int8 form); export void OPT_Insert (OPS_Name name, OPT_Object *obj); export void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); -export int32 OPT_IntSize (int64 n); -export OPT_Struct OPT_IntType (int64 size); +export int16 OPT_IntSize (int64 n); +export OPT_Struct OPT_IntType (int32 size); export OPT_Const OPT_NewConst (void); export OPT_ConstExt OPT_NewExt (void); export OPT_Node OPT_NewNode (int8 class); @@ -147,27 +148,27 @@ export OPT_Object OPT_NewObj (void); export OPT_Struct OPT_NewStr (int8 form, int8 comp); export void OPT_OpenScope (int8 level, OPT_Object owner); static void OPT_OutConstant (OPT_Object obj); -static void OPT_OutFlds (OPT_Object fld, int64 adr, BOOLEAN visible); -static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, int64 adr); -static void OPT_OutMod (int32 mno); +static void OPT_OutFlds (OPT_Object fld, int32 adr, BOOLEAN visible); +static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, int32 adr); +static void OPT_OutMod (int16 mno); static void OPT_OutName (CHAR *name, LONGINT name__len); static void OPT_OutObj (OPT_Object obj); static void OPT_OutSign (OPT_Struct result, OPT_Object par); static void OPT_OutStr (OPT_Struct typ); static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj); -export OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int32 dir); -static void OPT_err (int32 n); +export OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir); +static void OPT_err (int16 n); -static void OPT_err (int32 n) +static void OPT_err (int16 n) { OPM_err(n); } -int32 OPT_IntSize (int64 n) +int16 OPT_IntSize (int64 n) { - int32 _o_result; - int32 bytes; + int16 _o_result; + int16 bytes; if (n < 0) { n = -(n + 1); } @@ -179,7 +180,7 @@ int32 OPT_IntSize (int64 n) return _o_result; } -OPT_Struct OPT_IntType (int64 size) +OPT_Struct OPT_IntType (int32 size) { OPT_Struct _o_result; if (size <= OPT_int8typ->size) { @@ -198,10 +199,10 @@ OPT_Struct OPT_IntType (int64 size) return _o_result; } -OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int32 dir) +OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir) { OPT_Struct _o_result; - int32 i; + int16 i; __ASSERT(x->form == 4, 0); __ASSERT(x->BaseTyp == OPT_undftyp, 0); __ASSERT(dir == 1 || dir == -1, 0); @@ -323,15 +324,15 @@ void OPT_Init (OPS_Name name, SET opt) __COPY(name, OPT_topScope->name, 256); OPT_GlbMod[0] = OPT_topScope; OPT_nofGmod = 1; - OPT_newsf = __IN(4, opt, 64); - OPT_findpc = __IN(8, opt, 64); - OPT_extsf = OPT_newsf || __IN(9, opt, 64); + OPT_newsf = __IN(4, opt, 32); + OPT_findpc = __IN(8, opt, 32); + OPT_extsf = OPT_newsf || __IN(9, opt, 32); OPT_sfpresent = 1; } void OPT_Close (void) { - int32 i; + int16 i; OPT_CloseScope(); i = 0; while (i < 64) { @@ -461,14 +462,14 @@ void OPT_Insert (OPS_Name name, OPT_Object *obj) *obj = ob1; } -static void OPT_FPrintName (int64 *fp, CHAR *name, LONGINT name__len) +static void OPT_FPrintName (int32 *fp, CHAR *name, LONGINT name__len) { - int32 i; + int16 i; CHAR ch; i = 0; do { ch = name[__X(i, name__len)]; - OPM_FPrint(&*fp, ch); + OPM_FPrint(&*fp, (int16)ch); i += 1; } while (!(ch == 0x00)); } @@ -506,7 +507,7 @@ static void OPT_DebugStruct (OPT_Struct btyp) OPM_LogWLn(); } -static void OPT_FPrintSign (int64 *fp, OPT_Struct result, OPT_Object par) +static void OPT_FPrintSign (int32 *fp, OPT_Struct result, OPT_Object par) { OPT_IdFPrint(result); OPM_FPrint(&*fp, result->idfp); @@ -522,8 +523,8 @@ void OPT_IdFPrint (OPT_Struct typ) { OPT_Struct btyp = NIL; OPT_Object strobj = NIL; - int64 idfp; - int32 f, c; + int32 idfp; + int16 f, c; if (!typ->idfpdone) { typ->idfpdone = 1; idfp = 0; @@ -552,17 +553,17 @@ void OPT_IdFPrint (OPT_Struct typ) } static struct FPrintStr__13 { - int64 *pbfp, *pvfp; + int32 *pbfp, *pvfp; struct FPrintStr__13 *lnk; } *FPrintStr__13_s; -static void FPrintFlds__14 (OPT_Object fld, int64 adr, BOOLEAN visible); -static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, int64 adr); +static void FPrintFlds__14 (OPT_Object fld, int32 adr, BOOLEAN visible); +static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, int32 adr); static void FPrintTProcs__18 (OPT_Object obj); -static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, int64 adr) +static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, int32 adr) { - int64 i, j, n; + int32 i, j, n; OPT_Struct btyp = NIL; if (typ->comp == 4) { FPrintFlds__14(typ->link, adr, 0); @@ -592,7 +593,7 @@ static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, int64 adr) } } -static void FPrintFlds__14 (OPT_Object fld, int64 adr, BOOLEAN visible) +static void FPrintFlds__14 (OPT_Object fld, int32 adr, BOOLEAN visible) { while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { @@ -627,10 +628,10 @@ static void FPrintTProcs__18 (OPT_Object obj) void OPT_FPrintStr (OPT_Struct typ) { - int32 f, c; + int16 f, c; OPT_Struct btyp = NIL; OPT_Object strobj = NIL, bstrobj = NIL; - int64 pbfp, pvfp; + int32 pbfp, pvfp; struct FPrintStr__13 _s; _s.pbfp = &pbfp; _s.pvfp = &pvfp; @@ -658,7 +659,7 @@ void OPT_FPrintStr (OPT_Struct typ) pvfp = pbfp; } } else if (f == 12) { - } else if (__IN(c, 0x0c, 64)) { + } else if (__IN(c, 0x0c, 32)) { OPT_FPrintStr(btyp); OPM_FPrint(&pbfp, btyp->pvfp); pvfp = pbfp; @@ -691,8 +692,8 @@ void OPT_FPrintStr (OPT_Struct typ) void OPT_FPrintObj (OPT_Object obj) { - int64 fprint; - int32 f, m; + int32 fprint; + int16 f, m; REAL rval; OPT_ConstExt ext = NIL; if (!obj->fpdone) { @@ -729,16 +730,16 @@ void OPT_FPrintObj (OPT_Object obj) OPM_FPrint(&fprint, obj->vis); OPT_FPrintStr(obj->typ); OPM_FPrint(&fprint, obj->typ->pbfp); - } else if (__IN(obj->mode, 0x0480, 64)) { + } else if (__IN(obj->mode, 0x0480, 32)) { OPT_FPrintSign(&fprint, obj->typ, obj->link); } else if (obj->mode == 9) { OPT_FPrintSign(&fprint, obj->typ, obj->link); ext = obj->conval->ext; - m = (*ext)[0]; + m = (int16)(*ext)[0]; f = 1; OPM_FPrint(&fprint, m); while (f <= m) { - OPM_FPrint(&fprint, (*ext)[__X(f, 256)]); + OPM_FPrint(&fprint, (int16)(*ext)[__X(f, 256)]); f += 1; } } else if (obj->mode == 5) { @@ -749,9 +750,9 @@ void OPT_FPrintObj (OPT_Object obj) } } -void OPT_FPrintErr (OPT_Object obj, int32 errcode) +void OPT_FPrintErr (OPT_Object obj, int16 errcode) { - int32 i, j; + int16 i, j; CHAR ch; if (obj->mnolev != 0) { __COPY(OPT_GlbMod[__X(-obj->mnolev, 64)]->name, OPM_objname, 64); @@ -841,7 +842,7 @@ void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old) static void OPT_InName (CHAR *name, LONGINT name__len) { - int32 i; + int16 i; CHAR ch; i = 0; do { @@ -855,7 +856,7 @@ static void OPT_InMod (int8 *mno) { OPT_Object head = NIL; OPS_Name name; - int64 mn; + int32 mn; int8 i; mn = OPM_SymRInt(); if (mn == 0) { @@ -893,16 +894,16 @@ static void OPT_InMod (int8 *mno) } } -static void OPT_InConstant (int64 f, OPT_Const conval) +static void OPT_InConstant (int32 f, OPT_Const conval) { CHAR ch; - int32 i; + int16 i; OPT_ConstExt ext = NIL; REAL rval; switch (f) { case 1: case 3: case 2: OPM_SymRCh(&ch); - conval->intval = ch; + conval->intval = (int16)ch; break; case 4: conval->intval = OPM_SymRInt(); @@ -945,7 +946,7 @@ static void OPT_InConstant (int64 f, OPT_Const conval) static void OPT_InSign (int8 mno, OPT_Struct *res, OPT_Object *par) { OPT_Object last = NIL, new = NIL; - int64 tag; + int32 tag; OPT_InStruct(&*res); tag = OPM_SymRInt(); last = NIL; @@ -973,7 +974,7 @@ static void OPT_InSign (int8 mno, OPT_Struct *res, OPT_Object *par) static OPT_Object OPT_InFld (void) { OPT_Object _o_result; - int64 tag; + int32 tag; OPT_Object obj = NIL; tag = OPT_impCtxt.nextTag; obj = OPT_NewObj(); @@ -1005,7 +1006,7 @@ static OPT_Object OPT_InFld (void) static OPT_Object OPT_InTProc (int8 mno) { OPT_Object _o_result; - int64 tag; + int32 tag; OPT_Object obj = NIL; tag = OPT_impCtxt.nextTag; obj = OPT_NewObj(); @@ -1030,7 +1031,7 @@ static OPT_Object OPT_InTProc (int8 mno) return _o_result; } -static OPT_Struct OPT_InTyp (int64 tag) +static OPT_Struct OPT_InTyp (int32 tag) { OPT_Struct _o_result; if (tag == 4) { @@ -1046,8 +1047,8 @@ static OPT_Struct OPT_InTyp (int64 tag) static void OPT_InStruct (OPT_Struct *typ) { int8 mno; - int32 ref; - int64 tag; + int16 ref; + int32 tag; OPS_Name name; OPT_Struct t = NIL; OPT_Object obj = NIL, last = NIL, fld = NIL, old = NIL, dummy = NIL; @@ -1103,7 +1104,7 @@ static void OPT_InStruct (OPT_Struct *typ) obj->vis = 0; tag = OPM_SymRInt(); if (tag == 35) { - (*typ)->sysflag = (int32)OPM_SymRInt(); + (*typ)->sysflag = (int16)OPM_SymRInt(); tag = OPM_SymRInt(); } switch (tag) { @@ -1228,11 +1229,11 @@ static void OPT_InStruct (OPT_Struct *typ) static OPT_Object OPT_InObj (int8 mno) { OPT_Object _o_result; - int32 i, s; + int16 i, s; CHAR ch; OPT_Object obj = NIL, old = NIL; OPT_Struct typ = NIL; - int64 tag; + int32 tag; OPT_ConstExt ext = NIL; tag = OPT_impCtxt.nextTag; if (tag == 19) { @@ -1265,7 +1266,7 @@ static OPT_Object OPT_InObj (int8 mno) obj->mode = 9; ext = OPT_NewExt(); obj->conval->ext = ext; - s = (int32)OPM_SymRInt(); + s = (int16)OPM_SymRInt(); (*ext)[0] = (CHAR)s; i = 1; while (i <= s) { @@ -1374,7 +1375,7 @@ void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) static void OPT_OutName (CHAR *name, LONGINT name__len) { - int32 i; + int16 i; CHAR ch; i = 0; do { @@ -1384,7 +1385,7 @@ static void OPT_OutName (CHAR *name, LONGINT name__len) } while (!(ch == 0x00)); } -static void OPT_OutMod (int32 mno) +static void OPT_OutMod (int16 mno) { if (OPT_expCtxt.locmno[__X(mno, 64)] < 0) { OPM_SymWInt(16); @@ -1396,9 +1397,9 @@ static void OPT_OutMod (int32 mno) } } -static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, int64 adr) +static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, int32 adr) { - int64 i, j, n; + int32 i, j, n; OPT_Struct btyp = NIL; if (typ->comp == 4) { OPT_OutFlds(typ->link, adr, 0); @@ -1428,7 +1429,7 @@ static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, int64 adr) } } -static void OPT_OutFlds (OPT_Object fld, int64 adr, BOOLEAN visible) +static void OPT_OutFlds (OPT_Object fld, int32 adr, BOOLEAN visible) { while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { @@ -1583,7 +1584,7 @@ static void OPT_OutStr (OPT_Struct typ) static void OPT_OutConstant (OPT_Object obj) { - int32 f; + int16 f; REAL rval; f = obj->typ->form; OPM_SymWInt(f); @@ -1618,11 +1619,11 @@ static void OPT_OutConstant (OPT_Object obj) static void OPT_OutObj (OPT_Object obj) { - int32 i, j; + int16 i, j; OPT_ConstExt ext = NIL; if (obj != NIL) { OPT_OutObj(obj->left); - if (__IN(obj->mode, 0x06ea, 64)) { + if (__IN(obj->mode, 0x06ea, 32)) { if (obj->history == 4) { OPT_FPrintErr(obj, 250); } else if (obj->vis != 0) { @@ -1685,7 +1686,7 @@ static void OPT_OutObj (OPT_Object obj) OPM_SymWInt(33); OPT_OutSign(obj->typ, obj->link); ext = obj->conval->ext; - j = (*ext)[0]; + j = (int16)(*ext)[0]; i = 1; OPM_SymWInt(j); while (i <= j) { @@ -1708,7 +1709,7 @@ static void OPT_OutObj (OPT_Object obj) void OPT_Export (BOOLEAN *ext, BOOLEAN *new) { - int32 i; + int16 i; int8 nofmod; BOOLEAN done; OPT_symExtended = 0; @@ -1732,7 +1733,7 @@ void OPT_Export (BOOLEAN *ext, BOOLEAN *new) } OPT_OutObj(OPT_topScope->right); *ext = (OPT_sfpresent && OPT_symExtended); - *new = (!OPT_sfpresent || OPT_symNew) || __IN(17, OPM_opt, 64); + *new = (!OPT_sfpresent || OPT_symNew) || __IN(17, OPM_opt, 32); if ((((OPM_noerr && OPT_sfpresent)) && OPT_impCtxt.reffp != OPT_expCtxt.reffp)) { *new = 1; if (!OPT_extsf) { @@ -1762,7 +1763,7 @@ static void OPT_InitStruct (OPT_Struct *typ, int8 form) (*typ)->idfpdone = 1; } -static void OPT_EnterBoolConst (OPS_Name name, int64 value) +static void OPT_EnterBoolConst (OPS_Name name, int32 value) { OPT_Object obj = NIL; OPS_Name name__copy; @@ -1774,7 +1775,7 @@ static void OPT_EnterBoolConst (OPS_Name name, int64 value) obj->conval->intval = value; } -static void OPT_EnterTyp (OPS_Name name, int8 form, int32 size, OPT_Struct *res) +static void OPT_EnterTyp (OPS_Name name, int8 form, int16 size, OPT_Struct *res) { OPT_Object obj = NIL; OPT_Struct typ = NIL; @@ -1809,7 +1810,7 @@ static void OPT_EnterTypeAlias (OPS_Name name, OPT_Object *res) *res = obj; } -static void OPT_EnterProc (OPS_Name name, int32 num) +static void OPT_EnterProc (OPS_Name name, int16 num) { OPT_Object obj = NIL; OPS_Name name__copy; @@ -1849,46 +1850,46 @@ static void EnumPtrs(void (*P)(void*)) __ENUMP(OPT_GlbMod, 64, P); P(OPT_universe); P(OPT_syslink); - __ENUMR(&OPT_impCtxt, OPT_ImpCtxt__typ, 6216, 1, P); + __ENUMR(&OPT_impCtxt, OPT_ImpCtxt__typ, 5184, 1, P); } -__TDESC(OPT_ConstDesc, 1, 1) = {__TDFLDS("ConstDesc", 40), {0, -16}}; -__TDESC(OPT_ObjDesc, 1, 6) = {__TDFLDS("ObjDesc", 344), {0, 8, 16, 24, 304, 312, -56}}; -__TDESC(OPT_StrDesc, 1, 3) = {__TDFLDS("StrDesc", 104), {80, 88, 96, -32}}; +__TDESC(OPT_ConstDesc, 1, 1) = {__TDFLDS("ConstDesc", 32), {0, -16}}; +__TDESC(OPT_ObjDesc, 1, 6) = {__TDFLDS("ObjDesc", 336), {0, 8, 16, 24, 304, 312, -56}}; +__TDESC(OPT_StrDesc, 1, 3) = {__TDFLDS("StrDesc", 72), {48, 56, 64, -32}}; __TDESC(OPT_NodeDesc, 1, 6) = {__TDFLDS("NodeDesc", 56), {0, 8, 16, 32, 40, 48, -56}}; -__TDESC(OPT_ImpCtxt, 1, 510) = {__TDFLDS("ImpCtxt", 6216), {32, 40, 48, 56, 64, 72, 80, 88, 96, 104, 112, 120, 128, 136, 144, 152, - 160, 168, 176, 184, 192, 200, 208, 216, 224, 232, 240, 248, 256, 264, 272, 280, - 288, 296, 304, 312, 320, 328, 336, 344, 352, 360, 368, 376, 384, 392, 400, 408, - 416, 424, 432, 440, 448, 456, 464, 472, 480, 488, 496, 504, 512, 520, 528, 536, - 544, 552, 560, 568, 576, 584, 592, 600, 608, 616, 624, 632, 640, 648, 656, 664, - 672, 680, 688, 696, 704, 712, 720, 728, 736, 744, 752, 760, 768, 776, 784, 792, - 800, 808, 816, 824, 832, 840, 848, 856, 864, 872, 880, 888, 896, 904, 912, 920, - 928, 936, 944, 952, 960, 968, 976, 984, 992, 1000, 1008, 1016, 1024, 1032, 1040, 1048, - 1056, 1064, 1072, 1080, 1088, 1096, 1104, 1112, 1120, 1128, 1136, 1144, 1152, 1160, 1168, 1176, - 1184, 1192, 1200, 1208, 1216, 1224, 1232, 1240, 1248, 1256, 1264, 1272, 1280, 1288, 1296, 1304, - 1312, 1320, 1328, 1336, 1344, 1352, 1360, 1368, 1376, 1384, 1392, 1400, 1408, 1416, 1424, 1432, - 1440, 1448, 1456, 1464, 1472, 1480, 1488, 1496, 1504, 1512, 1520, 1528, 1536, 1544, 1552, 1560, - 1568, 1576, 1584, 1592, 1600, 1608, 1616, 1624, 1632, 1640, 1648, 1656, 1664, 1672, 1680, 1688, - 1696, 1704, 1712, 1720, 1728, 1736, 1744, 1752, 1760, 1768, 1776, 1784, 1792, 1800, 1808, 1816, - 1824, 1832, 1840, 1848, 1856, 1864, 1872, 1880, 1888, 1896, 1904, 1912, 1920, 1928, 1936, 1944, - 1952, 1960, 1968, 1976, 1984, 1992, 2000, 2008, 2016, 2024, 2032, 2040, 2048, 2056, 2064, 2072, - 2080, 2088, 2096, 2104, 2112, 2120, 2128, 2136, 2144, 2152, 2160, 2168, 2176, 2184, 2192, 2200, - 2208, 2216, 2224, 2232, 2240, 2248, 2256, 2264, 2272, 2280, 2288, 2296, 2304, 2312, 2320, 2328, - 2336, 2344, 2352, 2360, 2368, 2376, 2384, 2392, 2400, 2408, 2416, 2424, 2432, 2440, 2448, 2456, - 2464, 2472, 2480, 2488, 2496, 2504, 2512, 2520, 2528, 2536, 2544, 2552, 2560, 2568, 2576, 2584, - 2592, 2600, 2608, 2616, 2624, 2632, 2640, 2648, 2656, 2664, 2672, 2680, 2688, 2696, 2704, 2712, - 2720, 2728, 2736, 2744, 2752, 2760, 2768, 2776, 2784, 2792, 2800, 2808, 2816, 2824, 2832, 2840, - 2848, 2856, 2864, 2872, 2880, 2888, 2896, 2904, 2912, 2920, 2928, 2936, 2944, 2952, 2960, 2968, - 2976, 2984, 2992, 3000, 3008, 3016, 3024, 3032, 3040, 3048, 3056, 3064, 3072, 3080, 3088, 3096, - 3104, 3112, 3120, 3128, 3136, 3144, 3152, 3160, 3168, 3176, 3184, 3192, 3200, 3208, 3216, 3224, - 3232, 3240, 3248, 3256, 3264, 3272, 3280, 3288, 3296, 3304, 3312, 3320, 3328, 3336, 3344, 3352, - 3360, 3368, 3376, 3384, 3392, 3400, 3408, 3416, 3424, 3432, 3440, 3448, 3456, 3464, 3472, 3480, - 3488, 3496, 3504, 3512, 3520, 3528, 3536, 3544, 3552, 3560, 3568, 3576, 3584, 3592, 3600, 3608, - 3616, 3624, 3632, 3640, 3648, 3656, 3664, 3672, 3680, 3688, 3696, 3704, 3712, 3720, 3728, 3736, - 3744, 3752, 3760, 3768, 3776, 3784, 3792, 3800, 3808, 3816, 3824, 3832, 3840, 3848, 3856, 3864, - 3872, 3880, 3888, 3896, 3904, 3912, 3920, 3928, 3936, 3944, 3952, 3960, 3968, 3976, 3984, 3992, - 4000, 4008, 4016, 4024, 4032, 4040, 4048, 4056, 4064, 4072, 4080, 4088, 4096, 4104, -4088}}; -__TDESC(OPT_ExpCtxt, 1, 0) = {__TDFLDS("ExpCtxt", 80), {-8}}; +__TDESC(OPT_ImpCtxt, 1, 510) = {__TDFLDS("ImpCtxt", 5184), {16, 24, 32, 40, 48, 56, 64, 72, 80, 88, 96, 104, 112, 120, 128, 136, + 144, 152, 160, 168, 176, 184, 192, 200, 208, 216, 224, 232, 240, 248, 256, 264, + 272, 280, 288, 296, 304, 312, 320, 328, 336, 344, 352, 360, 368, 376, 384, 392, + 400, 408, 416, 424, 432, 440, 448, 456, 464, 472, 480, 488, 496, 504, 512, 520, + 528, 536, 544, 552, 560, 568, 576, 584, 592, 600, 608, 616, 624, 632, 640, 648, + 656, 664, 672, 680, 688, 696, 704, 712, 720, 728, 736, 744, 752, 760, 768, 776, + 784, 792, 800, 808, 816, 824, 832, 840, 848, 856, 864, 872, 880, 888, 896, 904, + 912, 920, 928, 936, 944, 952, 960, 968, 976, 984, 992, 1000, 1008, 1016, 1024, 1032, + 1040, 1048, 1056, 1064, 1072, 1080, 1088, 1096, 1104, 1112, 1120, 1128, 1136, 1144, 1152, 1160, + 1168, 1176, 1184, 1192, 1200, 1208, 1216, 1224, 1232, 1240, 1248, 1256, 1264, 1272, 1280, 1288, + 1296, 1304, 1312, 1320, 1328, 1336, 1344, 1352, 1360, 1368, 1376, 1384, 1392, 1400, 1408, 1416, + 1424, 1432, 1440, 1448, 1456, 1464, 1472, 1480, 1488, 1496, 1504, 1512, 1520, 1528, 1536, 1544, + 1552, 1560, 1568, 1576, 1584, 1592, 1600, 1608, 1616, 1624, 1632, 1640, 1648, 1656, 1664, 1672, + 1680, 1688, 1696, 1704, 1712, 1720, 1728, 1736, 1744, 1752, 1760, 1768, 1776, 1784, 1792, 1800, + 1808, 1816, 1824, 1832, 1840, 1848, 1856, 1864, 1872, 1880, 1888, 1896, 1904, 1912, 1920, 1928, + 1936, 1944, 1952, 1960, 1968, 1976, 1984, 1992, 2000, 2008, 2016, 2024, 2032, 2040, 2048, 2056, + 2064, 2072, 2080, 2088, 2096, 2104, 2112, 2120, 2128, 2136, 2144, 2152, 2160, 2168, 2176, 2184, + 2192, 2200, 2208, 2216, 2224, 2232, 2240, 2248, 2256, 2264, 2272, 2280, 2288, 2296, 2304, 2312, + 2320, 2328, 2336, 2344, 2352, 2360, 2368, 2376, 2384, 2392, 2400, 2408, 2416, 2424, 2432, 2440, + 2448, 2456, 2464, 2472, 2480, 2488, 2496, 2504, 2512, 2520, 2528, 2536, 2544, 2552, 2560, 2568, + 2576, 2584, 2592, 2600, 2608, 2616, 2624, 2632, 2640, 2648, 2656, 2664, 2672, 2680, 2688, 2696, + 2704, 2712, 2720, 2728, 2736, 2744, 2752, 2760, 2768, 2776, 2784, 2792, 2800, 2808, 2816, 2824, + 2832, 2840, 2848, 2856, 2864, 2872, 2880, 2888, 2896, 2904, 2912, 2920, 2928, 2936, 2944, 2952, + 2960, 2968, 2976, 2984, 2992, 3000, 3008, 3016, 3024, 3032, 3040, 3048, 3056, 3064, 3072, 3080, + 3088, 3096, 3104, 3112, 3120, 3128, 3136, 3144, 3152, 3160, 3168, 3176, 3184, 3192, 3200, 3208, + 3216, 3224, 3232, 3240, 3248, 3256, 3264, 3272, 3280, 3288, 3296, 3304, 3312, 3320, 3328, 3336, + 3344, 3352, 3360, 3368, 3376, 3384, 3392, 3400, 3408, 3416, 3424, 3432, 3440, 3448, 3456, 3464, + 3472, 3480, 3488, 3496, 3504, 3512, 3520, 3528, 3536, 3544, 3552, 3560, 3568, 3576, 3584, 3592, + 3600, 3608, 3616, 3624, 3632, 3640, 3648, 3656, 3664, 3672, 3680, 3688, 3696, 3704, 3712, 3720, + 3728, 3736, 3744, 3752, 3760, 3768, 3776, 3784, 3792, 3800, 3808, 3816, 3824, 3832, 3840, 3848, + 3856, 3864, 3872, 3880, 3888, 3896, 3904, 3912, 3920, 3928, 3936, 3944, 3952, 3960, 3968, 3976, + 3984, 3992, 4000, 4008, 4016, 4024, 4032, 4040, 4048, 4056, 4064, 4072, 4080, 4088, -4088}}; +__TDESC(OPT_ExpCtxt, 1, 0) = {__TDFLDS("ExpCtxt", 72), {-8}}; export void *OPT__init(void) { diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 697eb2c9..0bd1f189 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -15,7 +15,8 @@ typedef typedef struct OPT_ConstDesc { OPT_ConstExt ext; - int64 intval, intval2; + int64 intval; + int32 intval2; SET setval; LONGREAL realval; } OPT_ConstDesc; @@ -46,20 +47,20 @@ typedef BOOLEAN leaf; int8 mode, mnolev, vis, history; BOOLEAN used, fpdone; - int64 fprint; + int32 fprint; OPT_Struct typ; OPT_Const conval; - int64 adr, linkadr; - int32 x; + int32 adr, linkadr; + int16 x; } OPT_ObjDesc; typedef struct OPT_StrDesc { int8 form, comp, mno, extlev; - int32 ref, sysflag; - int64 n, size, align, txtpos; + int16 ref, sysflag; + int32 n, size, align, txtpos; BOOLEAN allocated, pbused, pvused; - char _prvt0[24]; + char _prvt0[16]; OPT_Struct BaseTyp; OPT_Object link, strobj; } OPT_StrDesc; @@ -82,7 +83,7 @@ import address *OPT_NodeDesc__typ; import void OPT_Close (void); import void OPT_CloseScope (void); import void OPT_Export (BOOLEAN *ext, BOOLEAN *new); -import void OPT_FPrintErr (OPT_Object obj, int32 errcode); +import void OPT_FPrintErr (OPT_Object obj, int16 errcode); import void OPT_FPrintObj (OPT_Object obj); import void OPT_FPrintStr (OPT_Struct typ); import void OPT_Find (OPT_Object *res); @@ -93,15 +94,15 @@ import void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); import void OPT_Init (OPS_Name name, SET opt); import void OPT_Insert (OPS_Name name, OPT_Object *obj); import void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); -import int32 OPT_IntSize (int64 n); -import OPT_Struct OPT_IntType (int64 size); +import int16 OPT_IntSize (int64 n); +import OPT_Struct OPT_IntType (int32 size); import OPT_Const OPT_NewConst (void); import OPT_ConstExt OPT_NewExt (void); import OPT_Node OPT_NewNode (int8 class); import OPT_Object OPT_NewObj (void); import OPT_Struct OPT_NewStr (int8 form, int8 comp); import void OPT_OpenScope (int8 level, OPT_Object owner); -import OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int32 dir); +import OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir); import void *OPT__init(void); diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index b57b2868..8ef2c450 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,8 +1,8 @@ /* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ -#define INTEGER int32 -#define LONGINT int64 -#define SET uint64 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "OPC.h" @@ -12,51 +12,51 @@ typedef struct OPV_ExitInfo { - int32 level, label; + int16 level, label; } OPV_ExitInfo; -static int32 OPV_stamp; -static int64 OPV_recno; +static int16 OPV_stamp; +static int32 OPV_recno; static OPV_ExitInfo OPV_exit; -static int32 OPV_nofExitLabels; +static int16 OPV_nofExitLabels; export address *OPV_ExitInfo__typ; static void OPV_ActualPar (OPT_Node n, OPT_Object fp); export void OPV_AdrAndSize (OPT_Object topScope); static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc); -static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int32 prec); +static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int16 prec); static void OPV_DefineTDescs (OPT_Node n); -static void OPV_Entier (OPT_Node n, int32 prec); +static void OPV_Entier (OPT_Node n, int16 prec); static void OPV_GetTProcNum (OPT_Object obj); static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc); static BOOLEAN OPV_ImplicitReturn (OPT_Node n); -static void OPV_Index (OPT_Node n, OPT_Node d, int32 prec, int32 dim); +static void OPV_Index (OPT_Node n, OPT_Node d, int16 prec, int16 dim); export void OPV_Init (void); static void OPV_InitTDescs (OPT_Node n); static void OPV_Len (OPT_Node n, int64 dim); export void OPV_Module (OPT_Node prog); static void OPV_NewArr (OPT_Node d, OPT_Node x); -static void OPV_ParIntLiteral (int64 n, int64 size); -static int32 OPV_Precedence (int32 class, int32 subclass, int32 form, int32 comp); +static void OPV_ParIntLiteral (int64 n, int32 size); +static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp); static BOOLEAN OPV_SideEffects (OPT_Node n); -static void OPV_SizeCast (int64 from, int64 to); +static void OPV_SizeCast (int32 from, int32 to); static void OPV_Stamp (OPS_Name s); static OPT_Object OPV_SuperProc (OPT_Node n); static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported); static void OPV_TraverseRecord (OPT_Struct typ); export void OPV_TypSize (OPT_Struct typ); static void OPV_TypeOf (OPT_Node n); -static void OPV_design (OPT_Node n, int32 prec); -static void OPV_expr (OPT_Node n, int32 prec); +static void OPV_design (OPT_Node n, int16 prec); +static void OPV_expr (OPT_Node n, int16 prec); static void OPV_stat (OPT_Node n, OPT_Object outerProc); void OPV_TypSize (OPT_Struct typ) { - int32 f, c; - int64 offset, size, base, fbase, off0; + int16 f, c; + int32 offset, size, base, fbase, off0; OPT_Object fld = NIL; OPT_Struct btyp = NIL; if (typ == OPT_undftyp) { @@ -71,7 +71,7 @@ void OPV_TypSize (OPT_Struct typ) base = 1; } else { OPV_TypSize(btyp); - offset = btyp->size - (int64)__ASHR(btyp->sysflag, 8); + offset = btyp->size - __ASHR(btyp->sysflag, 8); base = btyp->align; } fld = typ->link; @@ -99,7 +99,7 @@ void OPV_TypSize (OPT_Struct typ) } typ->size = offset; typ->align = base; - typ->sysflag = __MASK(typ->sysflag, -256) + (int32)__ASHL(offset - off0, 8); + typ->sysflag = __MASK(typ->sysflag, -256) + (int16)__ASHL(offset - off0, 8); } else if (c == 2) { OPV_TypSize(typ->BaseTyp); typ->size = typ->n * typ->BaseTyp->size; @@ -133,7 +133,7 @@ void OPV_Init (void) static void OPV_GetTProcNum (OPT_Object obj) { - int64 oldPos; + int32 oldPos; OPT_Struct typ = NIL; OPT_Object redef = NIL; oldPos = OPM_errpos; @@ -145,7 +145,7 @@ static void OPV_GetTProcNum (OPT_Object obj) OPT_FindField(obj->name, typ->BaseTyp, &redef); if (redef != NIL) { obj->adr = __ASHL(__ASHR(redef->adr, 16), 16); - if (!__IN(2, obj->conval->setval, 64)) { + if (!__IN(2, obj->conval->setval, 32)) { OPM_err(119); } } else { @@ -169,7 +169,7 @@ static void OPV_TraverseRecord (OPT_Struct typ) static void OPV_Stamp (OPS_Name s) { - int32 i, j, k; + int16 i, j, k; CHAR n[10]; OPV_stamp += 1; i = 0; @@ -199,7 +199,7 @@ static void OPV_Stamp (OPS_Name s) static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported) { - int32 mode; + int16 mode; OPT_Object scope = NIL; OPT_Struct typ = NIL; if (obj != NIL) { @@ -225,12 +225,12 @@ static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exporte OPV_TypSize(obj->typ); } if (!exported) { - if ((__IN(mode, 0x60, 64) && obj->mnolev > 0)) { + if ((__IN(mode, 0x60, 32) && obj->mnolev > 0)) { OPV_Stamp(obj->name); } - if (__IN(mode, 0x26, 64)) { + if (__IN(mode, 0x26, 32)) { obj->scope = outerScope; - } else if (__IN(mode, 0x26c0, 64)) { + } else if (__IN(mode, 0x26c0, 32)) { if (obj->conval->setval == 0x0) { OPM_err(129); } @@ -275,9 +275,9 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_sysptrtyp->strobj->linkadr = 2; } -static int32 OPV_Precedence (int32 class, int32 subclass, int32 form, int32 comp) +static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp) { - int32 _o_result; + int16 _o_result; switch (class) { case 7: case 0: case 2: case 4: case 9: case 13: @@ -285,7 +285,7 @@ static int32 OPV_Precedence (int32 class, int32 subclass, int32 form, int32 comp return _o_result; break; case 5: - if (__IN(3, OPM_opt, 64)) { + if (__IN(3, OPM_opt, 32)) { _o_result = 10; return _o_result; } else { @@ -294,7 +294,7 @@ static int32 OPV_Precedence (int32 class, int32 subclass, int32 form, int32 comp } break; case 1: - if (__IN(comp, 0x0c, 64)) { + if (__IN(comp, 0x0c, 32)) { _o_result = 10; return _o_result; } else { @@ -439,9 +439,9 @@ static BOOLEAN OPV_SideEffects (OPT_Node n) __RETCHK; } -static void OPV_Entier (OPT_Node n, int32 prec) +static void OPV_Entier (OPT_Node n, int16 prec) { - if (__IN(n->typ->form, 0x60, 64)) { + if (__IN(n->typ->form, 0x60, 32)) { OPM_WriteString((CHAR*)"__ENTIER(", 10); OPV_expr(n, -1); OPM_Write(')'); @@ -450,7 +450,7 @@ static void OPV_Entier (OPT_Node n, int32 prec) } } -static void OPV_SizeCast (int64 from, int64 to) +static void OPV_SizeCast (int32 from, int32 to) { if ((from != to && (from > 4 || to != 4))) { OPM_WriteString((CHAR*)"(int", 5); @@ -459,9 +459,9 @@ static void OPV_SizeCast (int64 from, int64 to) } } -static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int32 prec) +static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int16 prec) { - int32 from, to; + int16 from, to; from = n->typ->form; to = newtype->form; if (to == 7) { @@ -471,7 +471,7 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int32 prec) OPM_WriteInt(__ASHL(newtype->size, 3)); OPM_Write(')'); } else if (to == 4) { - if ((newtype->size < n->typ->size && __IN(2, OPM_opt, 64))) { + if ((newtype->size < n->typ->size && __IN(2, OPM_opt, 32))) { OPM_WriteString((CHAR*)"__SHORT", 8); if (OPV_SideEffects(n)) { OPM_Write('F'); @@ -486,7 +486,7 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int32 prec) OPV_Entier(n, 9); } } else if (to == 3) { - if (__IN(2, OPM_opt, 64)) { + if (__IN(2, OPM_opt, 32)) { OPM_WriteString((CHAR*)"__CHR", 6); if (OPV_SideEffects(n)) { OPM_Write('F'); @@ -509,7 +509,7 @@ static void OPV_TypeOf (OPT_Node n) OPM_WriteString((CHAR*)"__TYPEOF(", 10); OPV_expr(n, -1); OPM_Write(')'); - } else if (__IN(n->class, 0x15, 64)) { + } else if (__IN(n->class, 0x15, 32)) { OPC_Andent(n->typ); OPM_WriteString((CHAR*)"__typ", 6); } else if (n->class == 3) { @@ -525,9 +525,9 @@ static void OPV_TypeOf (OPT_Node n) } } -static void OPV_Index (OPT_Node n, OPT_Node d, int32 prec, int32 dim) +static void OPV_Index (OPT_Node n, OPT_Node d, int16 prec, int16 dim) { - if (!__IN(0, OPM_opt, 64) || (n->right->class == 7 && (n->right->conval->intval == 0 || n->left->typ->comp != 3))) { + if (!__IN(0, OPM_opt, 32) || (n->right->class == 7 && (n->right->conval->intval == 0 || n->left->typ->comp != 3))) { OPV_expr(n->right, prec); } else { if (OPV_SideEffects(n->right)) { @@ -542,18 +542,18 @@ static void OPV_Index (OPT_Node n, OPT_Node d, int32 prec, int32 dim) } } -static void OPV_design (OPT_Node n, int32 prec) +static void OPV_design (OPT_Node n, int16 prec) { OPT_Object obj = NIL; OPT_Struct typ = NIL; - int32 class, designPrec, comp; + int16 class, designPrec, comp; OPT_Node d = NIL, x = NIL; - int32 dims, i, _for__27; + int16 dims, i, _for__27; comp = n->typ->comp; obj = n->obj; class = n->class; designPrec = OPV_Precedence(class, n->subcl, n->typ->form, comp); - if ((((((class == 0 && obj->mnolev > 0)) && obj->mnolev != OPM_level)) && prec == 10)) { + if ((((((class == 0 && obj->mnolev > 0)) && (int16)obj->mnolev != OPM_level)) && prec == 10)) { designPrec = 9; } if (prec > designPrec) { @@ -570,7 +570,7 @@ static void OPV_design (OPT_Node n, int32 prec) OPC_CompleteIdent(n->obj); break; case 1: - if (!__IN(comp, 0x0c, 64)) { + if (!__IN(comp, 0x0c, 32)) { OPM_Write('*'); } OPC_CompleteIdent(n->obj); @@ -632,7 +632,7 @@ static void OPV_design (OPT_Node n, int32 prec) } if (n->typ->comp == 3) { OPM_Write(')'); - while ((int64)i < __ASHR(d->typ->size - 4, 2)) { + while (i < __ASHR(d->typ->size - 4, 2)) { OPM_WriteString((CHAR*)" * ", 4); OPV_Len(d, i); i += 1; @@ -649,10 +649,10 @@ static void OPV_design (OPT_Node n, int32 prec) case 5: typ = n->typ; obj = n->left->obj; - if (__IN(3, OPM_opt, 64)) { + if (__IN(3, OPM_opt, 32)) { if (typ->comp == 4) { OPM_WriteString((CHAR*)"__GUARDR(", 10); - if (obj->mnolev != OPM_level) { + if ((int16)obj->mnolev != OPM_level) { OPM_WriteStringVar((void*)obj->scope->name, 256); OPM_WriteString((CHAR*)"__curr->", 9); OPC_Ident(obj); @@ -688,7 +688,7 @@ static void OPV_design (OPT_Node n, int32 prec) } break; case 6: - if (__IN(3, OPM_opt, 64)) { + if (__IN(3, OPM_opt, 32)) { if (n->left->class == 1) { OPM_WriteString((CHAR*)"__GUARDEQR(", 12); OPC_CompleteIdent(n->left->obj); @@ -721,7 +721,7 @@ static void OPV_design (OPT_Node n, int32 prec) } } -static void OPV_ParIntLiteral (int64 n, int64 size) +static void OPV_ParIntLiteral (int64 n, int32 size) { OPM_WriteInt(n); } @@ -729,7 +729,7 @@ static void OPV_ParIntLiteral (int64 n, int64 size) static void OPV_ActualPar (OPT_Node n, OPT_Object fp) { OPT_Struct typ = NIL, aptyp = NIL; - int32 comp, form, mode, prec, dim; + int16 comp, form, mode, prec, dim; OPM_Write('('); while (n != NIL) { typ = fp->typ; @@ -743,7 +743,7 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) OPM_WriteString((CHAR*)"*)", 3); prec = 10; } - if (!__IN(n->typ->comp, 0x0c, 64)) { + if (!__IN(n->typ->comp, 0x0c, 32)) { if (mode == 2) { if (typ != n->typ) { OPM_WriteString((CHAR*)"(void*)", 8); @@ -751,7 +751,7 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) OPM_Write('&'); prec = 9; } else { - if ((__IN(comp, 0x0c, 64) && n->class == 7)) { + if ((__IN(comp, 0x0c, 32) && n->class == 7)) { OPM_WriteString((CHAR*)"(CHAR*)", 8); } else if ((((form == 11 && typ != n->typ)) && n->typ != OPT_niltyp)) { OPM_WriteString((CHAR*)"(void*)", 8); @@ -821,9 +821,9 @@ static OPT_Object OPV_SuperProc (OPT_Node n) return _o_result; } -static void OPV_expr (OPT_Node n, int32 prec) +static void OPV_expr (OPT_Node n, int16 prec) { - int32 class, subclass, form, exprPrec; + int16 class, subclass, form, exprPrec; OPT_Struct typ = NIL; OPT_Node l = NIL, r = NIL; OPT_Object proc = NIL; @@ -833,7 +833,7 @@ static void OPV_expr (OPT_Node n, int32 prec) l = n->left; r = n->right; exprPrec = OPV_Precedence(class, subclass, form, n->typ->comp); - if ((exprPrec <= prec && __IN(class, 0x3ce0, 64))) { + if ((exprPrec <= prec && __IN(class, 0x3ce0, 32))) { OPM_Write('('); } switch (class) { @@ -913,18 +913,18 @@ static void OPV_expr (OPT_Node n, int32 prec) if (l->class == 1) { OPC_CompleteIdent(l->obj); } else { - if ((l->typ->form != 8 && !__IN(l->typ->comp, 0x0c, 64))) { + if ((l->typ->form != 8 && !__IN(l->typ->comp, 0x0c, 32))) { OPM_Write('&'); } OPV_expr(l, exprPrec); } break; case 29: - if (!__IN(l->class, 0x17, 64) || (((__IN(n->typ->form, 0x1890, 64) && __IN(l->typ->form, 0x1890, 64))) && n->typ->size == l->typ->size)) { + if (!__IN(l->class, 0x17, 32) || (((__IN(n->typ->form, 0x1890, 32) && __IN(l->typ->form, 0x1890, 32))) && n->typ->size == l->typ->size)) { OPM_Write('('); OPC_Ident(n->typ->strobj); OPM_Write(')'); - if (__IN(n->typ->form, 0x1800, 64) || __IN(l->typ->form, 0x1800, 64)) { + if (__IN(n->typ->form, 0x1800, 32) || __IN(l->typ->form, 0x1800, 32)) { OPM_WriteString((CHAR*)"(address)", 10); } OPV_expr(l, exprPrec); @@ -1021,12 +1021,12 @@ static void OPV_expr (OPT_Node n, int32 prec) } OPV_expr(l, -1); OPM_WriteString((CHAR*)", ", 3); - if ((((__IN(subclass, 0x18020000, 64) && r->class == 7)) && r->conval->intval < 0)) { + if ((((__IN(subclass, 0x18020000, 32) && r->class == 7)) && r->conval->intval < 0)) { OPM_WriteInt(-r->conval->intval); } else { OPV_expr(r, -1); } - if (__IN(subclass, 0x18008000, 64)) { + if (__IN(subclass, 0x18008000, 32)) { OPM_WriteString((CHAR*)", ", 3); if (subclass == 15) { OPM_WriteInt(__ASHL(r->typ->size, 3)); @@ -1038,7 +1038,7 @@ static void OPV_expr (OPT_Node n, int32 prec) break; case 9: case 10: case 11: case 12: case 13: case 14: - if (__IN(l->typ->form, 0x2100, 64)) { + if (__IN(l->typ->form, 0x2100, 32)) { OPM_WriteString((CHAR*)"__STRCMP(", 10); OPV_expr(l, -1); OPM_WriteString((CHAR*)", ", 3); @@ -1135,7 +1135,7 @@ static void OPV_expr (OPT_Node n, int32 prec) OPV_design(n, prec); break; } - if ((exprPrec <= prec && __IN(class, 0x3ca0, 64))) { + if ((exprPrec <= prec && __IN(class, 0x3ca0, 32))) { OPM_Write(')'); } } @@ -1145,7 +1145,7 @@ static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) OPT_Node if_ = NIL; OPT_Object obj = NIL; OPT_Struct typ = NIL; - int64 adr; + int32 adr; if_ = n->left; while (if_ != NIL) { OPM_WriteString((CHAR*)"if ", 4); @@ -1196,7 +1196,7 @@ static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc) { OPT_Node switchCase = NIL, label = NIL; int64 low, high; - int32 form, i; + int16 form, i; OPM_WriteString((CHAR*)"switch ", 8); OPV_expr(n->left, 12); OPM_Write(' '); @@ -1263,7 +1263,7 @@ static BOOLEAN OPV_ImplicitReturn (OPT_Node n) static void OPV_NewArr (OPT_Node d, OPT_Node x) { OPT_Struct typ = NIL, base = NIL; - int32 nofdim, nofdyn; + int16 nofdim, nofdyn; typ = d->typ->BaseTyp; base = typ; nofdim = 0; @@ -1425,7 +1425,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPM_WriteString((CHAR*)", ", 3); OPC_Andent(n->left->typ->BaseTyp); OPM_WriteString((CHAR*)")", 2); - } else if (__IN(n->left->typ->BaseTyp->comp, 0x0c, 64)) { + } else if (__IN(n->left->typ->BaseTyp->comp, 0x0c, 32)) { OPV_NewArr(n->left, n->right); } break; @@ -1516,7 +1516,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) case 20: if (n->subcl != 32) { OPV_IfStat(n, 0, outerProc); - } else if (__IN(7, OPM_opt, 64)) { + } else if (__IN(7, OPM_opt, 32)) { OPM_WriteString((CHAR*)"__ASSERT(", 10); OPV_expr(n->left->left->left, -1); OPM_WriteString((CHAR*)", ", 3); @@ -1582,7 +1582,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) break; case 26: if (OPM_level == 0) { - if (__IN(10, OPM_opt, 64)) { + if (__IN(10, OPM_opt, 32)) { OPM_WriteString((CHAR*)"__FINI", 7); } else { OPM_WriteString((CHAR*)"__ENDMOD", 9); @@ -1618,7 +1618,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPM_LogWLn(); break; } - if (!__IN(n->class, 0x09744000, 64)) { + if (!__IN(n->class, 0x09744000, 32)) { OPC_EndStat(); } n = n->link; @@ -1627,7 +1627,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) void OPV_Module (OPT_Node prog) { - if (!__IN(10, OPM_opt, 64)) { + if (!__IN(10, OPM_opt, 32)) { OPC_GenHdr(prog->right); OPC_GenHdrIncludes(); } @@ -1635,7 +1635,7 @@ void OPV_Module (OPT_Node prog) OPV_stat(prog, NIL); } -__TDESC(OPV_ExitInfo, 1, 0) = {__TDFLDS("ExitInfo", 8), {-8}}; +__TDESC(OPV_ExitInfo, 1, 0) = {__TDFLDS("ExitInfo", 4), {-8}}; export void *OPV__init(void) { diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 363a0045..59f9cfeb 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,8 +1,8 @@ /* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ -#define INTEGER int32 -#define LONGINT int64 -#define SET uint64 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" @@ -13,91 +13,91 @@ typedef Platform_ArgPtr (*Platform_ArgVec)[1024]; typedef - int64 (*Platform_ArgVecPtr)[1]; + address (*Platform_ArgVecPtr)[1]; typedef CHAR (*Platform_EnvPtr)[1024]; typedef struct Platform_FileIdentity { - int64 volume, indexhigh, indexlow, mtimehigh, mtimelow; + int32 volume, indexhigh, indexlow, mtimehigh, mtimelow; } Platform_FileIdentity; typedef - void (*Platform_HaltProcedure)(int64); + void (*Platform_HaltProcedure)(int32); typedef - void (*Platform_SignalHandler)(int32); + void (*Platform_SignalHandler)(int16); export BOOLEAN Platform_LittleEndian; export address Platform_MainStackFrame; -export int64 Platform_HaltCode; -export int32 Platform_PID; +export int32 Platform_HaltCode; +export int16 Platform_PID; export CHAR Platform_CWD[4096]; -export int32 Platform_ArgCount; +export int16 Platform_ArgCount; export address Platform_ArgVector; static Platform_HaltProcedure Platform_HaltHandler; -static int64 Platform_TimeStart; -export int32 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; -export int64 Platform_StdIn, Platform_StdOut, Platform_StdErr; +static int32 Platform_TimeStart; +export int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; +export int32 Platform_StdIn, Platform_StdOut, Platform_StdErr; static Platform_SignalHandler Platform_InterruptHandler; export CHAR Platform_nl[3]; export address *Platform_FileIdentity__typ; -export BOOLEAN Platform_Absent (int32 e); -export int32 Platform_ArgPos (CHAR *s, LONGINT s__len); -export void Platform_AssertFail (int64 code); -export int32 Platform_Chdir (CHAR *n, LONGINT n__len); -export int32 Platform_Close (int64 h); -export BOOLEAN Platform_ConnectionFailed (int32 e); -export void Platform_Delay (int64 ms); -export BOOLEAN Platform_DifferentFilesystems (int32 e); -static void Platform_DisplayHaltCode (int64 code); -export int32 Platform_Error (void); -export void Platform_Exit (int32 code); -export void Platform_GetArg (int32 n, CHAR *val, LONGINT val__len); -export void Platform_GetClock (int64 *t, int64 *d); +export BOOLEAN Platform_Absent (int16 e); +export int16 Platform_ArgPos (CHAR *s, LONGINT s__len); +export void Platform_AssertFail (int32 code); +export int16 Platform_Chdir (CHAR *n, LONGINT n__len); +export int16 Platform_Close (int32 h); +export BOOLEAN Platform_ConnectionFailed (int16 e); +export void Platform_Delay (int32 ms); +export BOOLEAN Platform_DifferentFilesystems (int16 e); +static void Platform_DisplayHaltCode (int32 code); +export int16 Platform_Error (void); +export void Platform_Exit (int16 code); +export void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len); +export void Platform_GetClock (int32 *t, int32 *d); export void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); -export void Platform_GetIntArg (int32 n, int64 *val); -export void Platform_GetTimeOfDay (int64 *sec, int64 *usec); -export void Platform_Halt (int64 code); -export int32 Platform_Identify (int64 h, Platform_FileIdentity *identity, address *identity__typ); -export int32 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); -export BOOLEAN Platform_Inaccessible (int32 e); -export void Platform_Init (int32 argc, address argvadr); -export void Platform_MTimeAsClock (Platform_FileIdentity i, int64 *t, int64 *d); -export int32 Platform_New (CHAR *n, LONGINT n__len, int64 *h); -export BOOLEAN Platform_NoSuchDirectory (int32 e); +export void Platform_GetIntArg (int16 n, int32 *val); +export void Platform_GetTimeOfDay (int32 *sec, int32 *usec); +export void Platform_Halt (int32 code); +export int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ); +export int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); +export BOOLEAN Platform_Inaccessible (int16 e); +export void Platform_Init (int16 argc, address argvadr); +export void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); +export int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); +export BOOLEAN Platform_NoSuchDirectory (int16 e); export address Platform_OSAllocate (address size); export void Platform_OSFree (address address); -export int32 Platform_OldRO (CHAR *n, LONGINT n__len, int64 *h); -export int32 Platform_OldRW (CHAR *n, LONGINT n__len, int64 *h); -export int32 Platform_Read (int64 h, address p, address l, address *n); -export int32 Platform_ReadBuf (int64 h, SYSTEM_BYTE *b, LONGINT b__len, address *n); -export int32 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); +export int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); +export int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); +export int16 Platform_Read (int32 h, address p, int32 l, int32 *n); +export int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n); +export int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); export BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); export BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); -export int32 Platform_Seek (int64 h, int64 o, int32 r); +export int16 Platform_Seek (int32 h, int32 o, int16 r); export void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); export void Platform_SetHalt (Platform_HaltProcedure p); export void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Platform_FileIdentity source); -export int32 Platform_Size (int64 h, int64 *l); -export int32 Platform_Sync (int64 h); -export int32 Platform_System (CHAR *cmd, LONGINT cmd__len); +export int16 Platform_Size (int32 h, int32 *l); +export int16 Platform_Sync (int32 h); +export int16 Platform_System (CHAR *cmd, LONGINT cmd__len); static void Platform_TestLittleEndian (void); -export int64 Platform_Time (void); -export BOOLEAN Platform_TimedOut (int32 e); -export BOOLEAN Platform_TooManyFiles (int32 e); -export int32 Platform_Truncate (int64 h, int64 limit); -export int32 Platform_Unlink (CHAR *n, LONGINT n__len); -export int32 Platform_Write (int64 h, int64 p, int64 l); -static void Platform_YMDHMStoClock (int32 ye, int32 mo, int32 da, int32 ho, int32 mi, int32 se, int64 *t, int64 *d); +export int32 Platform_Time (void); +export BOOLEAN Platform_TimedOut (int16 e); +export BOOLEAN Platform_TooManyFiles (int16 e); +export int16 Platform_Truncate (int32 h, int32 limit); +export int16 Platform_Unlink (CHAR *n, LONGINT n__len); +export int16 Platform_Write (int32 h, address p, int32 l); +static void Platform_YMDHMStoClock (int16 ye, int16 mo, int16 da, int16 ho, int16 mi, int16 se, int32 *t, int32 *d); static void Platform_errch (CHAR c); -static void Platform_errint (int64 l); +static void Platform_errint (int32 l); static void Platform_errln (void); -static void Platform_errposint (int64 l); +static void Platform_errposint (int32 l); export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); #include "WindowsWrapper.h" @@ -181,49 +181,49 @@ extern void Heap_InitHeap(); #define Platform_waitForProcess() (INTEGER)WaitForSingleObject(pi.hProcess, INFINITE) #define Platform_writefile(fd, p, l) (INTEGER)WriteFile((HANDLE)fd, (void*)(p), (DWORD)l, 0,0) -BOOLEAN Platform_TooManyFiles (int32 e) +BOOLEAN Platform_TooManyFiles (int16 e) { BOOLEAN _o_result; _o_result = e == Platform_ERRORTOOMANYOPENFILES(); return _o_result; } -BOOLEAN Platform_NoSuchDirectory (int32 e) +BOOLEAN Platform_NoSuchDirectory (int16 e) { BOOLEAN _o_result; _o_result = e == Platform_ERRORPATHNOTFOUND(); return _o_result; } -BOOLEAN Platform_DifferentFilesystems (int32 e) +BOOLEAN Platform_DifferentFilesystems (int16 e) { BOOLEAN _o_result; _o_result = e == Platform_ERRORNOTSAMEDEVICE(); return _o_result; } -BOOLEAN Platform_Inaccessible (int32 e) +BOOLEAN Platform_Inaccessible (int16 e) { BOOLEAN _o_result; _o_result = ((e == Platform_ERRORACCESSDENIED() || e == Platform_ERRORWRITEPROTECT()) || e == Platform_ERRORNOTREADY()) || e == Platform_ERRORSHARINGVIOLATION(); return _o_result; } -BOOLEAN Platform_Absent (int32 e) +BOOLEAN Platform_Absent (int16 e) { BOOLEAN _o_result; _o_result = e == Platform_ERRORFILENOTFOUND() || e == Platform_ERRORPATHNOTFOUND(); return _o_result; } -BOOLEAN Platform_TimedOut (int32 e) +BOOLEAN Platform_TimedOut (int16 e) { BOOLEAN _o_result; _o_result = e == Platform_ETIMEDOUT(); return _o_result; } -BOOLEAN Platform_ConnectionFailed (int32 e) +BOOLEAN Platform_ConnectionFailed (int16 e) { BOOLEAN _o_result; _o_result = ((e == Platform_ECONNREFUSED() || e == Platform_ECONNABORTED()) || e == Platform_ENETUNREACH()) || e == Platform_EHOSTUNREACH(); @@ -242,7 +242,7 @@ void Platform_OSFree (address address) Platform_free(address); } -void Platform_Init (int32 argc, address argvadr) +void Platform_Init (int16 argc, address argvadr) { Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; @@ -257,7 +257,7 @@ BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__le { BOOLEAN _o_result; CHAR buf[4096]; - int32 res; + int16 res; __DUP(var, var__len, CHAR); res = Platform_getenv(var, var__len, (void*)buf, 4096); if ((res > 0 && res < 4096)) { @@ -282,7 +282,7 @@ void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len) __DEL(var); } -void Platform_GetArg (int32 n, CHAR *val, LONGINT val__len) +void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { @@ -291,10 +291,10 @@ void Platform_GetArg (int32 n, CHAR *val, LONGINT val__len) } } -void Platform_GetIntArg (int32 n, int64 *val) +void Platform_GetIntArg (int16 n, int32 *val) { CHAR s[64]; - int64 k, d, i; + int32 k, d, i; s[0] = 0x00; Platform_GetArg(n, (void*)s, 64); i = 0; @@ -302,11 +302,11 @@ void Platform_GetIntArg (int32 n, int64 *val) i = 1; } k = 0; - d = s[__X(i, 64)] - 48; + d = (int16)s[__X(i, 64)] - 48; while ((d >= 0 && d <= 9)) { k = k * 10 + d; i += 1; - d = s[__X(i, 64)] - 48; + d = (int16)s[__X(i, 64)] - 48; } if (s[0] == '-') { k = -k; @@ -317,10 +317,10 @@ void Platform_GetIntArg (int32 n, int64 *val) } } -int32 Platform_ArgPos (CHAR *s, LONGINT s__len) +int16 Platform_ArgPos (CHAR *s, LONGINT s__len) { - int32 _o_result; - int32 i; + int16 _o_result; + int16 i; CHAR arg[256]; __DUP(s, s__len, CHAR); i = 0; @@ -338,28 +338,28 @@ void Platform_SetBadInstructionHandler (Platform_SignalHandler handler) { } -static void Platform_YMDHMStoClock (int32 ye, int32 mo, int32 da, int32 ho, int32 mi, int32 se, int64 *t, int64 *d) +static void Platform_YMDHMStoClock (int16 ye, int16 mo, int16 da, int16 ho, int16 mi, int16 se, int32 *t, int32 *d) { - *d = (__ASHL((int64)(int)__MOD(ye, 100), 9) + __ASHL((int64)(mo + 1), 5)) + (int64)da; - *t = (__ASHL((int64)ho, 12) + __ASHL((int64)mi, 6)) + (int64)se; + *d = (__ASHL((int)__MOD(ye, 100), 9) + __ASHL((mo + 1), 5)) + da; + *t = (__ASHL(ho, 12) + __ASHL(mi, 6)) + se; } -void Platform_GetClock (int64 *t, int64 *d) +void Platform_GetClock (int32 *t, int32 *d) { Platform_getLocalTime(); Platform_YMDHMStoClock(Platform_styear(), Platform_stmon(), Platform_stmday(), Platform_sthour(), Platform_stmin(), Platform_stsec(), &*t, &*d); } -int64 Platform_Time (void) +int32 Platform_Time (void) { - int64 _o_result; - int64 ms; + int32 _o_result; + int32 ms; ms = Platform_GetTickCount(); - _o_result = __MOD(ms - Platform_TimeStart, 2147483647); + _o_result = (int)__MOD(ms - Platform_TimeStart, 2147483647); return _o_result; } -void Platform_Delay (int64 ms) +void Platform_Delay (int32 ms) { while (ms > 30000) { Platform_sleep(30000); @@ -370,7 +370,7 @@ void Platform_Delay (int64 ms) } } -void Platform_GetTimeOfDay (int64 *sec, int64 *usec) +void Platform_GetTimeOfDay (int32 *sec, int32 *usec) { Platform_getLocalTime(); Platform_stToFt(); @@ -380,10 +380,10 @@ void Platform_GetTimeOfDay (int64 *sec, int64 *usec) *usec = Platform_uluSec(); } -int32 Platform_System (CHAR *cmd, LONGINT cmd__len) +int16 Platform_System (CHAR *cmd, LONGINT cmd__len) { - int32 _o_result; - int32 result; + int16 _o_result; + int16 result; __DUP(cmd, cmd__len, CHAR); result = 127; Platform_startupInfo(); @@ -399,17 +399,17 @@ int32 Platform_System (CHAR *cmd, LONGINT cmd__len) return _o_result; } -int32 Platform_Error (void) +int16 Platform_Error (void) { - int32 _o_result; + int16 _o_result; _o_result = Platform_err(); return _o_result; } -int32 Platform_OldRO (CHAR *n, LONGINT n__len, int64 *h) +int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h) { - int32 _o_result; - int64 fd; + int16 _o_result; + int32 fd; fd = Platform_openro(n, n__len); if (fd == Platform_invalidHandleValue()) { _o_result = Platform_err(); @@ -422,10 +422,10 @@ int32 Platform_OldRO (CHAR *n, LONGINT n__len, int64 *h) __RETCHK; } -int32 Platform_OldRW (CHAR *n, LONGINT n__len, int64 *h) +int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h) { - int32 _o_result; - int64 fd; + int16 _o_result; + int32 fd; fd = Platform_openrw(n, n__len); if (fd == Platform_invalidHandleValue()) { _o_result = Platform_err(); @@ -438,10 +438,10 @@ int32 Platform_OldRW (CHAR *n, LONGINT n__len, int64 *h) __RETCHK; } -int32 Platform_New (CHAR *n, LONGINT n__len, int64 *h) +int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h) { - int32 _o_result; - int64 fd; + int16 _o_result; + int32 fd; fd = Platform_opennew(n, n__len); if (fd == Platform_invalidHandleValue()) { _o_result = Platform_err(); @@ -454,9 +454,9 @@ int32 Platform_New (CHAR *n, LONGINT n__len, int64 *h) __RETCHK; } -int32 Platform_Close (int64 h) +int16 Platform_Close (int32 h) { - int32 _o_result; + int16 _o_result; if (Platform_closeHandle(h) == 0) { _o_result = Platform_err(); return _o_result; @@ -467,9 +467,9 @@ int32 Platform_Close (int64 h) __RETCHK; } -int32 Platform_Identify (int64 h, Platform_FileIdentity *identity, address *identity__typ) +int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ) { - int32 _o_result; + int16 _o_result; Platform_byHandleFileInformation(); if (Platform_getFileInformationByHandle(h) == 0) { _o_result = Platform_err(); @@ -484,11 +484,11 @@ int32 Platform_Identify (int64 h, Platform_FileIdentity *identity, address *iden return _o_result; } -int32 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ) +int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ) { - int32 _o_result; - int64 h; - int32 e, i; + int16 _o_result; + int32 h; + int16 e, i; __DUP(n, n__len, CHAR); e = Platform_OldRO((void*)n, n__len, &h); if (e != 0) { @@ -523,16 +523,16 @@ void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Pla (*target).mtimelow = source.mtimelow; } -void Platform_MTimeAsClock (Platform_FileIdentity i, int64 *t, int64 *d) +void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d) { Platform_identityToFileTime(i); Platform_fileTimeToSysTime(); Platform_YMDHMStoClock(Platform_styear(), Platform_stmon(), Platform_stmday(), Platform_sthour(), Platform_stmin(), Platform_stsec(), &*t, &*d); } -int32 Platform_Size (int64 h, int64 *l) +int16 Platform_Size (int32 h, int32 *l) { - int32 _o_result; + int16 _o_result; Platform_largeInteger(); if (Platform_getFileSize(h) == 0) { _o_result = Platform_err(); @@ -543,43 +543,45 @@ int32 Platform_Size (int64 h, int64 *l) return _o_result; } -int32 Platform_Read (int64 h, address p, address l, address *n) +int16 Platform_Read (int32 h, address p, int32 l, int32 *n) { - int32 _o_result; - int32 result; - *n = 0; - result = Platform_readfile(h, p, l, &*n); + int16 _o_result; + int16 result; + int32 lengthread; + result = Platform_readfile(h, p, l, &lengthread); if (result == 0) { *n = 0; _o_result = Platform_err(); return _o_result; } else { + *n = lengthread; _o_result = 0; return _o_result; } __RETCHK; } -int32 Platform_ReadBuf (int64 h, SYSTEM_BYTE *b, LONGINT b__len, address *n) +int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n) { - int32 _o_result; - int32 result; - *n = 0; - result = Platform_readfile(h, (address)b, b__len, &*n); + int16 _o_result; + int16 result; + int32 lengthread; + result = Platform_readfile(h, (address)b, b__len, &lengthread); if (result == 0) { *n = 0; _o_result = Platform_err(); return _o_result; } else { + *n = lengthread; _o_result = 0; return _o_result; } __RETCHK; } -int32 Platform_Write (int64 h, int64 p, int64 l) +int16 Platform_Write (int32 h, address p, int32 l) { - int32 _o_result; + int16 _o_result; if (Platform_writefile(h, p, l) == 0) { _o_result = Platform_err(); return _o_result; @@ -590,9 +592,9 @@ int32 Platform_Write (int64 h, int64 p, int64 l) __RETCHK; } -int32 Platform_Sync (int64 h) +int16 Platform_Sync (int32 h) { - int32 _o_result; + int16 _o_result; if (Platform_flushFileBuffers(h) == 0) { _o_result = Platform_err(); return _o_result; @@ -603,10 +605,10 @@ int32 Platform_Sync (int64 h) __RETCHK; } -int32 Platform_Seek (int64 h, int64 o, int32 r) +int16 Platform_Seek (int32 h, int32 o, int16 r) { - int32 _o_result; - int32 rc; + int16 _o_result; + int16 rc; Platform_largeInteger(); Platform_setFilePointerEx(h, o, r, &rc); if (rc == 0) { @@ -619,11 +621,11 @@ int32 Platform_Seek (int64 h, int64 o, int32 r) __RETCHK; } -int32 Platform_Truncate (int64 h, int64 limit) +int16 Platform_Truncate (int32 h, int32 limit) { - int32 _o_result; - int32 rc; - int64 oldpos; + int16 _o_result; + int16 rc; + int32 oldpos; Platform_largeInteger(); Platform_getFilePos(h, &oldpos, &rc); if (rc == 0) { @@ -648,9 +650,9 @@ int32 Platform_Truncate (int64 h, int64 limit) return _o_result; } -int32 Platform_Unlink (CHAR *n, LONGINT n__len) +int16 Platform_Unlink (CHAR *n, LONGINT n__len) { - int32 _o_result; + int16 _o_result; if (Platform_deleteFile(n, n__len) == 0) { _o_result = Platform_err(); return _o_result; @@ -661,10 +663,10 @@ int32 Platform_Unlink (CHAR *n, LONGINT n__len) __RETCHK; } -int32 Platform_Chdir (CHAR *n, LONGINT n__len) +int16 Platform_Chdir (CHAR *n, LONGINT n__len) { - int32 _o_result; - int32 r; + int16 _o_result; + int16 r; r = Platform_setCurrentDirectory(n, n__len); if (r == 0) { _o_result = Platform_err(); @@ -675,9 +677,9 @@ int32 Platform_Chdir (CHAR *n, LONGINT n__len) return _o_result; } -int32 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) +int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) { - int32 _o_result; + int16 _o_result; if (Platform_moveFile(o, o__len, n, n__len) == 0) { _o_result = Platform_err(); return _o_result; @@ -688,7 +690,7 @@ int32 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) __RETCHK; } -void Platform_Exit (int32 code) +void Platform_Exit (int16 code) { Platform_exit(code); } @@ -704,15 +706,15 @@ static void Platform_errln (void) Platform_errch(0x0a); } -static void Platform_errposint (int64 l) +static void Platform_errposint (int32 l) { if (l > 10) { Platform_errposint(__DIV(l, 10)); } - Platform_errch((CHAR)(48 + __MOD(l, 10))); + Platform_errch((CHAR)(48 + (int)__MOD(l, 10))); } -static void Platform_errint (int64 l) +static void Platform_errint (int32 l) { if (l < 0) { Platform_errch('-'); @@ -721,7 +723,7 @@ static void Platform_errint (int64 l) Platform_errposint(l); } -static void Platform_DisplayHaltCode (int64 code) +static void Platform_DisplayHaltCode (int32 code) { switch (code) { case -1: @@ -777,7 +779,7 @@ static void Platform_DisplayHaltCode (int64 code) } } -void Platform_Halt (int64 code) +void Platform_Halt (int32 code) { Platform_HaltCode = code; if (Platform_HaltHandler != NIL) { @@ -790,10 +792,10 @@ void Platform_Halt (int64 code) Platform_DisplayHaltCode(code); } Platform_errln(); - Platform_exit(__VAL(int32, code)); + Platform_exit(__VAL(int16, code)); } -void Platform_AssertFail (int64 code) +void Platform_AssertFail (int32 code) { Platform_errstring((CHAR*)"Assertion failure.", 19); if (code != 0) { @@ -802,7 +804,7 @@ void Platform_AssertFail (int64 code) Platform_errstring((CHAR*)".", 2); } Platform_errln(); - Platform_exit(__VAL(int32, code)); + Platform_exit(__VAL(int16, code)); } void Platform_SetHalt (Platform_HaltProcedure p) @@ -812,12 +814,12 @@ void Platform_SetHalt (Platform_HaltProcedure p) static void Platform_TestLittleEndian (void) { - int32 i; + int16 i; i = 1; __GET((address)&i, Platform_LittleEndian, BOOLEAN); } -__TDESC(Platform_FileIdentity, 1, 0) = {__TDFLDS("FileIdentity", 40), {-8}}; +__TDESC(Platform_FileIdentity, 1, 0) = {__TDFLDS("FileIdentity", 20), {-8}}; export void *Platform__init(void) { diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index 6cab3690..d62dd343 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -7,75 +7,75 @@ typedef struct Platform_FileIdentity { - int64 _prvt0; - char _prvt1[32]; + int32 _prvt0; + char _prvt1[16]; } Platform_FileIdentity; typedef - void (*Platform_HaltProcedure)(int64); + void (*Platform_HaltProcedure)(int32); typedef - void (*Platform_SignalHandler)(int32); + void (*Platform_SignalHandler)(int16); import BOOLEAN Platform_LittleEndian; import address Platform_MainStackFrame; -import int64 Platform_HaltCode; -import int32 Platform_PID; +import int32 Platform_HaltCode; +import int16 Platform_PID; import CHAR Platform_CWD[4096]; -import int32 Platform_ArgCount; +import int16 Platform_ArgCount; import address Platform_ArgVector; -import int32 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; -import int64 Platform_StdIn, Platform_StdOut, Platform_StdErr; +import int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; +import int32 Platform_StdIn, Platform_StdOut, Platform_StdErr; import CHAR Platform_nl[3]; import address *Platform_FileIdentity__typ; -import BOOLEAN Platform_Absent (int32 e); -import int32 Platform_ArgPos (CHAR *s, LONGINT s__len); -import void Platform_AssertFail (int64 code); -import int32 Platform_Chdir (CHAR *n, LONGINT n__len); -import int32 Platform_Close (int64 h); -import BOOLEAN Platform_ConnectionFailed (int32 e); -import void Platform_Delay (int64 ms); -import BOOLEAN Platform_DifferentFilesystems (int32 e); -import int32 Platform_Error (void); -import void Platform_Exit (int32 code); -import void Platform_GetArg (int32 n, CHAR *val, LONGINT val__len); -import void Platform_GetClock (int64 *t, int64 *d); +import BOOLEAN Platform_Absent (int16 e); +import int16 Platform_ArgPos (CHAR *s, LONGINT s__len); +import void Platform_AssertFail (int32 code); +import int16 Platform_Chdir (CHAR *n, LONGINT n__len); +import int16 Platform_Close (int32 h); +import BOOLEAN Platform_ConnectionFailed (int16 e); +import void Platform_Delay (int32 ms); +import BOOLEAN Platform_DifferentFilesystems (int16 e); +import int16 Platform_Error (void); +import void Platform_Exit (int16 code); +import void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len); +import void Platform_GetClock (int32 *t, int32 *d); import void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); -import void Platform_GetIntArg (int32 n, int64 *val); -import void Platform_GetTimeOfDay (int64 *sec, int64 *usec); -import void Platform_Halt (int64 code); -import int32 Platform_Identify (int64 h, Platform_FileIdentity *identity, address *identity__typ); -import int32 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); -import BOOLEAN Platform_Inaccessible (int32 e); -import void Platform_Init (int32 argc, address argvadr); -import void Platform_MTimeAsClock (Platform_FileIdentity i, int64 *t, int64 *d); -import int32 Platform_New (CHAR *n, LONGINT n__len, int64 *h); -import BOOLEAN Platform_NoSuchDirectory (int32 e); +import void Platform_GetIntArg (int16 n, int32 *val); +import void Platform_GetTimeOfDay (int32 *sec, int32 *usec); +import void Platform_Halt (int32 code); +import int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ); +import int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); +import BOOLEAN Platform_Inaccessible (int16 e); +import void Platform_Init (int16 argc, address argvadr); +import void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); +import int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); +import BOOLEAN Platform_NoSuchDirectory (int16 e); import address Platform_OSAllocate (address size); import void Platform_OSFree (address address); -import int32 Platform_OldRO (CHAR *n, LONGINT n__len, int64 *h); -import int32 Platform_OldRW (CHAR *n, LONGINT n__len, int64 *h); -import int32 Platform_Read (int64 h, address p, address l, address *n); -import int32 Platform_ReadBuf (int64 h, SYSTEM_BYTE *b, LONGINT b__len, address *n); -import int32 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); +import int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); +import int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); +import int16 Platform_Read (int32 h, address p, int32 l, int32 *n); +import int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n); +import int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); import BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); import BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); -import int32 Platform_Seek (int64 h, int64 o, int32 r); +import int16 Platform_Seek (int32 h, int32 o, int16 r); import void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); import void Platform_SetHalt (Platform_HaltProcedure p); import void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Platform_FileIdentity source); -import int32 Platform_Size (int64 h, int64 *l); -import int32 Platform_Sync (int64 h); -import int32 Platform_System (CHAR *cmd, LONGINT cmd__len); -import int64 Platform_Time (void); -import BOOLEAN Platform_TimedOut (int32 e); -import BOOLEAN Platform_TooManyFiles (int32 e); -import int32 Platform_Truncate (int64 h, int64 limit); -import int32 Platform_Unlink (CHAR *n, LONGINT n__len); -import int32 Platform_Write (int64 h, int64 p, int64 l); +import int16 Platform_Size (int32 h, int32 *l); +import int16 Platform_Sync (int32 h); +import int16 Platform_System (CHAR *cmd, LONGINT cmd__len); +import int32 Platform_Time (void); +import BOOLEAN Platform_TimedOut (int16 e); +import BOOLEAN Platform_TooManyFiles (int16 e); +import int16 Platform_Truncate (int32 h, int32 limit); +import int16 Platform_Unlink (CHAR *n, LONGINT n__len); +import int16 Platform_Write (int32 h, address p, int32 l); import BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); import void *Platform__init(void); diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 7678a81e..fe93e8be 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,8 +1,8 @@ /* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ -#define INTEGER int32 -#define LONGINT int64 -#define SET uint64 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" @@ -10,19 +10,19 @@ static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LONGINT d__len); -export void Reals_Convert (REAL x, int32 n, CHAR *d, LONGINT d__len); +export void Reals_Convert (REAL x, int16 n, CHAR *d, LONGINT d__len); export void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len); export void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len); -export void Reals_ConvertL (LONGREAL x, int32 n, CHAR *d, LONGINT d__len); -export int32 Reals_Expo (REAL x); -export int32 Reals_ExpoL (LONGREAL x); -export void Reals_SetExpo (REAL *x, int32 ex); -export REAL Reals_Ten (int32 e); -export LONGREAL Reals_TenL (int32 e); -static CHAR Reals_ToHex (int32 i); +export void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len); +export int16 Reals_Expo (REAL x); +export int16 Reals_ExpoL (LONGREAL x); +export void Reals_SetExpo (REAL *x, int16 ex); +export REAL Reals_Ten (int16 e); +export LONGREAL Reals_TenL (int16 e); +static CHAR Reals_ToHex (int16 i); -REAL Reals_Ten (int32 e) +REAL Reals_Ten (int16 e) { REAL _o_result; LONGREAL r, power; @@ -39,7 +39,7 @@ REAL Reals_Ten (int32 e) return _o_result; } -LONGREAL Reals_TenL (int32 e) +LONGREAL Reals_TenL (int16 e) { LONGREAL _o_result; LONGREAL r, power; @@ -59,54 +59,67 @@ LONGREAL Reals_TenL (int32 e) __RETCHK; } -int32 Reals_Expo (REAL x) +int16 Reals_Expo (REAL x) { - int32 _o_result; - int32 i; - __GET((address)&x + 2, i, int32); + int16 _o_result; + int16 i; + __GET((address)&x + 2, i, int16); _o_result = __MASK(__ASHR(i, 7), -256); return _o_result; } -void Reals_SetExpo (REAL *x, int32 ex) +void Reals_SetExpo (REAL *x, int16 ex) { CHAR c; __GET((address)x + 3, c, CHAR); - __PUT((address)x + 3, (CHAR)(__ASHL(__ASHR(c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __PUT((address)x + 3, (CHAR)(__ASHL(__ASHR((int16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); __GET((address)x + 2, c, CHAR); - __PUT((address)x + 2, (CHAR)(__MASK(c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); + __PUT((address)x + 2, (CHAR)(__MASK((int16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } -int32 Reals_ExpoL (LONGREAL x) +int16 Reals_ExpoL (LONGREAL x) { - int32 _o_result; - int32 i; - __GET((address)&x + 6, i, int32); + int16 _o_result; + int16 i; + __GET((address)&x + 6, i, int16); _o_result = __MASK(__ASHR(i, 4), -2048); return _o_result; } -void Reals_ConvertL (LONGREAL x, int32 n, CHAR *d, LONGINT d__len) +void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len) { - int64 i, j, k; + int32 i, j, k; if (x < (LONGREAL)0) { x = -x; } k = 0; - i = __ENTIER(x); - while (k < (int64)n) { - d[__X(k, d__len)] = (CHAR)(__MOD(i, 10) + 48); + if (n > 9) { + i = (int32)__ENTIER(x / (LONGREAL)(LONGREAL)1000000000); + j = (int32)__ENTIER(x - i * (LONGREAL)1000000000); + if (j < 0) { + j = 0; + } + while (k < 9) { + d[__X(k, d__len)] = (CHAR)((int)__MOD(j, 10) + 48); + j = __DIV(j, 10); + k += 1; + } + } else { + i = (int32)__ENTIER(x); + } + while (k < n) { + d[__X(k, d__len)] = (CHAR)((int)__MOD(i, 10) + 48); i = __DIV(i, 10); k += 1; } } -void Reals_Convert (REAL x, int32 n, CHAR *d, LONGINT d__len) +void Reals_Convert (REAL x, int16 n, CHAR *d, LONGINT d__len) { Reals_ConvertL(x, n, (void*)d, d__len); } -static CHAR Reals_ToHex (int32 i) +static CHAR Reals_ToHex (int16 i) { CHAR _o_result; if (i < 10) { @@ -121,15 +134,15 @@ static CHAR Reals_ToHex (int32 i) static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LONGINT d__len) { - int32 i; - int64 l; + int16 i; + int32 l; CHAR by; i = 0; l = b__len; - while ((int64)i < l) { + while (i < l) { by = __VAL(CHAR, b[__X(i, b__len)]); - d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR(by, 4)); - d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK(by, -16)); + d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((int16)by, 4)); + d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((int16)by, -16)); i += 1; } } diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index 4de192c6..e7cba0d8 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -8,15 +8,15 @@ -import void Reals_Convert (REAL x, int32 n, CHAR *d, LONGINT d__len); +import void Reals_Convert (REAL x, int16 n, CHAR *d, LONGINT d__len); import void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len); import void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len); -import void Reals_ConvertL (LONGREAL x, int32 n, CHAR *d, LONGINT d__len); -import int32 Reals_Expo (REAL x); -import int32 Reals_ExpoL (LONGREAL x); -import void Reals_SetExpo (REAL *x, int32 ex); -import REAL Reals_Ten (int32 e); -import LONGREAL Reals_TenL (int32 e); +import void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len); +import int16 Reals_Expo (REAL x); +import int16 Reals_ExpoL (LONGREAL x); +import void Reals_SetExpo (REAL *x, int16 ex); +import REAL Reals_Ten (int16 e); +import LONGREAL Reals_TenL (int16 e); import void *Reals__init(void); diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index 49fbdd21..427a0cc4 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,8 +1,8 @@ /* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ -#define INTEGER int32 -#define LONGINT int64 -#define SET uint64 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" @@ -11,22 +11,22 @@ export void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len); export void Strings_Cap (CHAR *s, LONGINT s__len); -export void Strings_Delete (CHAR *s, LONGINT s__len, int32 pos, int32 n); -export void Strings_Extract (CHAR *source, LONGINT source__len, int32 pos, int32 n, CHAR *dest, LONGINT dest__len); -export void Strings_Insert (CHAR *source, LONGINT source__len, int32 pos, CHAR *dest, LONGINT dest__len); -export int32 Strings_Length (CHAR *s, LONGINT s__len); +export void Strings_Delete (CHAR *s, LONGINT s__len, int16 pos, int16 n); +export void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHAR *dest, LONGINT dest__len); +export void Strings_Insert (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len); +export int16 Strings_Length (CHAR *s, LONGINT s__len); export BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len); -export int32 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int32 pos); -export void Strings_Replace (CHAR *source, LONGINT source__len, int32 pos, CHAR *dest, LONGINT dest__len); +export int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int16 pos); +export void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len); -int32 Strings_Length (CHAR *s, LONGINT s__len) +int16 Strings_Length (CHAR *s, LONGINT s__len) { - int32 _o_result; - int32 i; + int16 _o_result; + int16 i; __DUP(s, s__len, CHAR); i = 0; - while (((int64)i < s__len && s[__X(i, s__len)] != 0x00)) { + while ((i < s__len && s[__X(i, s__len)] != 0x00)) { i += 1; } _o_result = i; @@ -36,24 +36,24 @@ int32 Strings_Length (CHAR *s, LONGINT s__len) void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len) { - int32 n1, n2, i; + int16 n1, n2, i; __DUP(extra, extra__len, CHAR); n1 = Strings_Length(dest, dest__len); n2 = Strings_Length(extra, extra__len); i = 0; - while ((i < n2 && (int64)(i + n1) < dest__len)) { + while ((i < n2 && (i + n1) < dest__len)) { dest[__X(i + n1, dest__len)] = extra[__X(i, extra__len)]; i += 1; } - if ((int64)(i + n1) < dest__len) { + if ((i + n1) < dest__len) { dest[__X(i + n1, dest__len)] = 0x00; } __DEL(extra); } -void Strings_Insert (CHAR *source, LONGINT source__len, int32 pos, CHAR *dest, LONGINT dest__len) +void Strings_Insert (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len) { - int32 n1, n2, i; + int16 n1, n2, i; __DUP(source, source__len, CHAR); n1 = Strings_Length(dest, dest__len); n2 = Strings_Length(source, source__len); @@ -64,10 +64,10 @@ void Strings_Insert (CHAR *source, LONGINT source__len, int32 pos, CHAR *dest, L Strings_Append(dest, dest__len, (void*)source, source__len); return; } - if ((int64)(pos + n2) < dest__len) { + if ((pos + n2) < dest__len) { i = n1; while (i >= pos) { - if ((int64)(i + n2) < dest__len) { + if ((i + n2) < dest__len) { dest[__X(i + n2, dest__len)] = dest[__X(i, dest__len)]; } i -= 1; @@ -81,9 +81,9 @@ void Strings_Insert (CHAR *source, LONGINT source__len, int32 pos, CHAR *dest, L __DEL(source); } -void Strings_Delete (CHAR *s, LONGINT s__len, int32 pos, int32 n) +void Strings_Delete (CHAR *s, LONGINT s__len, int16 pos, int16 n) { - int32 len, i; + int16 len, i; len = Strings_Length(s, s__len); if (pos < 0) { pos = 0; @@ -96,7 +96,7 @@ void Strings_Delete (CHAR *s, LONGINT s__len, int32 pos, int32 n) s[__X(i - n, s__len)] = s[__X(i, s__len)]; i += 1; } - if ((int64)(i - n) < s__len) { + if ((i - n) < s__len) { s[__X(i - n, s__len)] = 0x00; } } else { @@ -104,7 +104,7 @@ void Strings_Delete (CHAR *s, LONGINT s__len, int32 pos, int32 n) } } -void Strings_Replace (CHAR *source, LONGINT source__len, int32 pos, CHAR *dest, LONGINT dest__len) +void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len) { __DUP(source, source__len, CHAR); Strings_Delete((void*)dest, dest__len, pos, pos + Strings_Length(source, source__len)); @@ -112,12 +112,12 @@ void Strings_Replace (CHAR *source, LONGINT source__len, int32 pos, CHAR *dest, __DEL(source); } -void Strings_Extract (CHAR *source, LONGINT source__len, int32 pos, int32 n, CHAR *dest, LONGINT dest__len) +void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHAR *dest, LONGINT dest__len) { - int32 len, destLen, i; + int16 len, destLen, i; __DUP(source, source__len, CHAR); len = Strings_Length(source, source__len); - destLen = (int32)dest__len - 1; + destLen = (int16)dest__len - 1; if (pos < 0) { pos = 0; } @@ -126,7 +126,7 @@ void Strings_Extract (CHAR *source, LONGINT source__len, int32 pos, int32 n, CHA return; } i = 0; - while (((((int64)(pos + i) <= source__len && source[__X(pos + i, source__len)] != 0x00)) && i < n)) { + while (((((pos + i) <= source__len && source[__X(pos + i, source__len)] != 0x00)) && i < n)) { if (i < destLen) { dest[__X(i, dest__len)] = source[__X(pos + i, source__len)]; } @@ -136,10 +136,10 @@ void Strings_Extract (CHAR *source, LONGINT source__len, int32 pos, int32 n, CHA __DEL(source); } -int32 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int32 pos) +int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int16 pos) { - int32 _o_result; - int32 n1, n2, i, j; + int16 _o_result; + int16 n1, n2, i, j; __DUP(pattern, pattern__len, CHAR); __DUP(s, s__len, CHAR); n1 = Strings_Length(s, s__len); @@ -174,7 +174,7 @@ int32 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, void Strings_Cap (CHAR *s, LONGINT s__len) { - int32 i; + int16 i; i = 0; while (s[__X(i, s__len)] != 0x00) { if (('a' <= s[__X(i, s__len)] && s[__X(i, s__len)] <= 'z')) { @@ -188,9 +188,9 @@ static struct Match__7 { struct Match__7 *lnk; } *Match__7_s; -static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, int32 n, int32 m); +static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, int16 n, int16 m); -static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, int32 n, int32 m) +static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, int16 n, int16 m) { BOOLEAN _o_result; while ((((n >= 0 && m >= 0)) && mask[__X(m, mask__len)] != '*')) { diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index 4dd0d2c3..44c51b2a 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -10,13 +10,13 @@ import void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len); import void Strings_Cap (CHAR *s, LONGINT s__len); -import void Strings_Delete (CHAR *s, LONGINT s__len, int32 pos, int32 n); -import void Strings_Extract (CHAR *source, LONGINT source__len, int32 pos, int32 n, CHAR *dest, LONGINT dest__len); -import void Strings_Insert (CHAR *source, LONGINT source__len, int32 pos, CHAR *dest, LONGINT dest__len); -import int32 Strings_Length (CHAR *s, LONGINT s__len); +import void Strings_Delete (CHAR *s, LONGINT s__len, int16 pos, int16 n); +import void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHAR *dest, LONGINT dest__len); +import void Strings_Insert (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len); +import int16 Strings_Length (CHAR *s, LONGINT s__len); import BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len); -import int32 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int32 pos); -import void Strings_Replace (CHAR *source, LONGINT source__len, int32 pos, CHAR *dest, LONGINT dest__len); +import int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int16 pos); +import void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len); import void *Strings__init(void); diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index 6403ce33..8c41a062 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,8 +1,8 @@ /* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ -#define INTEGER int32 -#define LONGINT int64 -#define SET uint64 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Files.h" @@ -18,7 +18,7 @@ typedef typedef struct Texts_RunDesc { Texts_Run prev, next; - int64 len; + int32 len; Texts_FontsFont fnt; int8 col, voff; BOOLEAN ascii; @@ -41,26 +41,26 @@ typedef typedef struct Texts_ElemDesc { Texts_Run prev, next; - int64 len; + int32 len; Texts_FontsFont fnt; int8 col, voff; BOOLEAN ascii; - int64 W, H; + int32 W, H; Texts_Handler handle; Texts_Text base; } Texts_ElemDesc; struct Texts__1 { /* Texts_ElemDesc */ Texts_Run prev, next; - int64 len; + int32 len; Texts_FontsFont fnt; int8 col, voff; BOOLEAN ascii; - int64 W, H; + int32 W, H; Texts_Handler handle; Texts_Text base; Files_File file; - int64 org, span; + int32 org, span; CHAR mod[32], proc[32]; }; @@ -69,7 +69,7 @@ typedef typedef struct Texts_BufDesc { - int64 len; + int32 len; Texts_Run head; } Texts_BufDesc; @@ -83,8 +83,8 @@ typedef typedef struct Texts_FileMsg { /* Texts_ElemMsg */ - int32 id; - int64 pos; + int16 id; + int32 pos; Files_Rider r; } Texts_FileMsg; @@ -99,7 +99,7 @@ typedef } Texts_IdentifyMsg; typedef - void (*Texts_Notifier)(Texts_Text, int32, int64, int64); + void (*Texts_Notifier)(Texts_Text, int16, int32, int32); typedef struct Texts_PieceDesc *Texts_Piece; @@ -107,12 +107,12 @@ typedef typedef struct Texts_PieceDesc { Texts_Run prev, next; - int64 len; + int32 len; Texts_FontsFont fnt; int8 col, voff; BOOLEAN ascii; Files_File file; - int64 org; + int32 org; } Texts_PieceDesc; typedef @@ -123,7 +123,7 @@ typedef Texts_Elem elem; Files_Rider rider; Texts_Run run; - int64 org, off; + int32 org, off; } Texts_Reader; typedef @@ -134,10 +134,10 @@ typedef Texts_Elem elem; Files_Rider rider; Texts_Run run; - int64 org, off; + int32 org, off; CHAR nextCh; - int32 line, class; - int64 i; + int16 line, class; + int32 i; REAL x; LONGREAL y; CHAR c; @@ -147,10 +147,10 @@ typedef typedef struct Texts_TextDesc { - int64 len; + int32 len; Texts_Notifier notify; Texts_Run head, cache; - int64 corg; + int32 corg; } Texts_TextDesc; typedef @@ -183,50 +183,50 @@ export address *Texts_Writer__typ; export address *Texts__1__typ; export void Texts_Append (Texts_Text T, Texts_Buffer B); -export void Texts_ChangeLooks (Texts_Text T, int64 beg, int64 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff); +export void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff); static Texts_Elem Texts_CloneElem (Texts_Elem e); static Texts_Piece Texts_ClonePiece (Texts_Piece p); export void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len); export void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); export void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); -export void Texts_Delete (Texts_Text T, int64 beg, int64 end); +export void Texts_Delete (Texts_Text T, int32 beg, int32 end); export Texts_Text Texts_ElemBase (Texts_Elem E); -export int64 Texts_ElemPos (Texts_Elem E); -static void Texts_Find (Texts_Text T, int64 *pos, Texts_Run *u, int64 *org, int64 *off); +export int32 Texts_ElemPos (Texts_Elem E); +static void Texts_Find (Texts_Text T, int32 *pos, Texts_Run *u, int32 *org, int32 *off); static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len); static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, address *msg__typ); -export void Texts_Insert (Texts_Text T, int64 pos, Texts_Buffer B); +export void Texts_Insert (Texts_Text T, int32 pos, Texts_Buffer B); export void Texts_Load (Files_Rider *r, address *r__typ, Texts_Text T); static void Texts_Load0 (Files_Rider *r, address *r__typ, Texts_Text T); static void Texts_Merge (Texts_Text T, Texts_Run u, Texts_Run *v); export void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len); export void Texts_OpenBuf (Texts_Buffer B); -export void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int64 pos); -export void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int64 pos); +export void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int32 pos); +export void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int32 pos); export void Texts_OpenWriter (Texts_Writer *W, address *W__typ); -export int64 Texts_Pos (Texts_Reader *R, address *R__typ); +export int32 Texts_Pos (Texts_Reader *R, address *R__typ); export void Texts_Read (Texts_Reader *R, address *R__typ, CHAR *ch); export void Texts_ReadElem (Texts_Reader *R, address *R__typ); export void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ); export void Texts_Recall (Texts_Buffer *B); -export void Texts_Save (Texts_Text T, int64 beg, int64 end, Texts_Buffer B); +export void Texts_Save (Texts_Text T, int32 beg, int32 end, Texts_Buffer B); export void Texts_Scan (Texts_Scanner *S, address *S__typ); export void Texts_SetColor (Texts_Writer *W, address *W__typ, int8 col); export void Texts_SetFont (Texts_Writer *W, address *W__typ, Texts_FontsFont fnt); export void Texts_SetOffset (Texts_Writer *W, address *W__typ, int8 voff); static void Texts_Splice (Texts_Run un, Texts_Run v, Texts_Run w, Texts_Text base); -static void Texts_Split (int64 off, Texts_Run *u, Texts_Run *un); +static void Texts_Split (int32 off, Texts_Run *u, Texts_Run *un); export void Texts_Store (Files_Rider *r, address *r__typ, Texts_Text T); export void Texts_Write (Texts_Writer *W, address *W__typ, CHAR ch); -export void Texts_WriteDate (Texts_Writer *W, address *W__typ, int64 t, int64 d); +export void Texts_WriteDate (Texts_Writer *W, address *W__typ, int32 t, int32 d); export void Texts_WriteElem (Texts_Writer *W, address *W__typ, Texts_Elem e); -export void Texts_WriteHex (Texts_Writer *W, address *W__typ, int64 x); +export void Texts_WriteHex (Texts_Writer *W, address *W__typ, int32 x); export void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n); export void Texts_WriteLn (Texts_Writer *W, address *W__typ); -export void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int32 n); +export void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int16 n); export void Texts_WriteLongRealHex (Texts_Writer *W, address *W__typ, LONGREAL x); -export void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int32 n); -export void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int32 n, int32 k); +export void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int16 n); +export void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int16 n, int16 k); export void Texts_WriteRealHex (Texts_Writer *W, address *W__typ, REAL x); export void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGINT s__len); @@ -241,10 +241,10 @@ static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len) return _o_result; } -static void Texts_Find (Texts_Text T, int64 *pos, Texts_Run *u, int64 *org, int64 *off) +static void Texts_Find (Texts_Text T, int32 *pos, Texts_Run *u, int32 *org, int32 *off) { Texts_Run v = NIL; - int64 m; + int32 m; if (*pos >= T->len) { *pos = T->len; *u = T->head; @@ -274,7 +274,7 @@ static void Texts_Find (Texts_Text T, int64 *pos, Texts_Run *u, int64 *org, int6 } } -static void Texts_Split (int64 off, Texts_Run *u, Texts_Run *un) +static void Texts_Split (int32 off, Texts_Run *u, Texts_Run *un) { Texts_Piece p = NIL, U = NIL; if (off == 0) { @@ -373,11 +373,11 @@ Texts_Text Texts_ElemBase (Texts_Elem E) return _o_result; } -int64 Texts_ElemPos (Texts_Elem E) +int32 Texts_ElemPos (Texts_Elem E) { - int64 _o_result; + int32 _o_result; Texts_Run u = NIL; - int64 pos; + int32 pos; u = E->base->head->next; pos = 0; while (u != (void *) E) { @@ -392,7 +392,7 @@ static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, address *msg__t { Texts_Alien e = NIL; Files_Rider r; - int64 i; + int32 i; CHAR ch; if (__ISP(E, Texts__1, 2)) { if (__IS(msg__typ, Texts_CopyMsg, 1)) { @@ -468,10 +468,10 @@ void Texts_Recall (Texts_Buffer *B) Texts_del = NIL; } -void Texts_Save (Texts_Text T, int64 beg, int64 end, Texts_Buffer B) +void Texts_Save (Texts_Text T, int32 beg, int32 end, Texts_Buffer B) { Texts_Run u = NIL, v = NIL, w = NIL, wn = NIL; - int64 uo, ud, vo, vd; + int32 uo, ud, vo, vd; Texts_Find(T, &beg, &u, &uo, &ud); Texts_Find(T, &end, &v, &vo, &vd); w = B->head->prev; @@ -502,11 +502,11 @@ void Texts_Save (Texts_Text T, int64 beg, int64 end, Texts_Buffer B) B->len += end - beg; } -void Texts_Insert (Texts_Text T, int64 pos, Texts_Buffer B) +void Texts_Insert (Texts_Text T, int32 pos, Texts_Buffer B) { Texts_Run u = NIL, un = NIL, v = NIL; Texts_Piece p = NIL, q = NIL; - int64 uo, ud, len; + int32 uo, ud, len; Texts_Find(T, &pos, &u, &uo, &ud); Texts_Split(ud, &u, &un); len = B->len; @@ -525,7 +525,7 @@ void Texts_Insert (Texts_Text T, int64 pos, Texts_Buffer B) void Texts_Append (Texts_Text T, Texts_Buffer B) { Texts_Run v = NIL; - int64 pos, len; + int32 pos, len; pos = T->len; len = B->len; v = B->head->next; @@ -540,10 +540,10 @@ void Texts_Append (Texts_Text T, Texts_Buffer B) } } -void Texts_Delete (Texts_Text T, int64 beg, int64 end) +void Texts_Delete (Texts_Text T, int32 beg, int32 end) { Texts_Run c = NIL, u = NIL, un = NIL, v = NIL, vn = NIL; - int64 co, uo, ud, vo, vd; + int32 co, uo, ud, vo, vd; Texts_Find(T, &beg, &u, &uo, &ud); Texts_Split(ud, &u, &un); c = T->cache; @@ -565,10 +565,10 @@ void Texts_Delete (Texts_Text T, int64 beg, int64 end) } } -void Texts_ChangeLooks (Texts_Text T, int64 beg, int64 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff) +void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff) { Texts_Run c = NIL, u = NIL, un = NIL, v = NIL, vn = NIL; - int64 co, uo, ud, vo, vd; + int32 co, uo, ud, vo, vd; Texts_Find(T, &beg, &u, &uo, &ud); Texts_Split(ud, &u, &un); c = T->cache; @@ -578,13 +578,13 @@ void Texts_ChangeLooks (Texts_Text T, int64 beg, int64 end, SET sel, Texts_Fonts T->cache = c; T->corg = co; while (un != vn) { - if ((__IN(0, sel, 64) && fnt != NIL)) { + if ((__IN(0, sel, 32) && fnt != NIL)) { un->fnt = fnt; } - if (__IN(1, sel, 64)) { + if (__IN(1, sel, 32)) { un->col = col; } - if (__IN(2, sel, 64)) { + if (__IN(2, sel, 32)) { un->voff = voff; } Texts_Merge(T, u, &un); @@ -604,7 +604,7 @@ void Texts_ChangeLooks (Texts_Text T, int64 beg, int64 end, SET sel, Texts_Fonts } } -void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int64 pos) +void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int32 pos) { Texts_Run u = NIL; if (pos >= T->len) { @@ -621,7 +621,7 @@ void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int64 pos void Texts_Read (Texts_Reader *R, address *R__typ, CHAR *ch) { Texts_Run u = NIL; - int64 pos; + int32 pos; CHAR nextch; u = (*R).run; (*R).fnt = u->fnt; @@ -713,14 +713,14 @@ void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ) } } -int64 Texts_Pos (Texts_Reader *R, address *R__typ) +int32 Texts_Pos (Texts_Reader *R, address *R__typ) { - int64 _o_result; + int32 _o_result; _o_result = (*R).org + (*R).off; return _o_result; } -void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int64 pos) +void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int32 pos) { Texts_OpenReader((void*)&*S, S__typ, T, pos); (*S).line = 0; @@ -732,7 +732,7 @@ static struct Scan__31 { address *S__typ; CHAR *ch; BOOLEAN *negE; - int32 *e; + int16 *e; struct Scan__31 *lnk; } *Scan__31_s; @@ -751,7 +751,7 @@ static void ReadScaleFactor__32 (void) } } while (('0' <= *Scan__31_s->ch && *Scan__31_s->ch <= '9')) { - *Scan__31_s->e = (*Scan__31_s->e * 10 + *Scan__31_s->ch) - 48; + *Scan__31_s->e = (*Scan__31_s->e * 10 + (int16)*Scan__31_s->ch) - 48; Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); } } @@ -761,8 +761,8 @@ void Texts_Scan (Texts_Scanner *S, address *S__typ) CHAR ch, term; BOOLEAN neg, negE, hex; int8 i, j, h; - int32 e; - int64 k; + int16 e; + int32 k; REAL x, f; LONGREAL y, g; CHAR d[32]; @@ -823,10 +823,10 @@ void Texts_Scan (Texts_Scanner *S, address *S__typ) if ('9' < ch) { if (('A' <= ch && ch <= 'F')) { hex = 1; - ch = (CHAR)(ch - 7); + ch = (CHAR)((int16)ch - 7); } else if (('a' <= ch && ch <= 'f')) { hex = 1; - ch = (CHAR)(ch - 39); + ch = (CHAR)((int16)ch - 39); } else { break; } @@ -838,13 +838,13 @@ void Texts_Scan (Texts_Scanner *S, address *S__typ) if (i - j > 8) { j = i - 8; } - k = d[__X(j, 32)] - 48; + k = (int16)d[__X(j, 32)] - 48; j += 1; if ((i - j == 7 && k >= 8)) { k -= 16; } while (j < i) { - k = __ASHL(k, 4) + (int64)(d[__X(j, 32)] - 48); + k = __ASHL(k, 4) + ((int16)d[__X(j, 32)] - 48); j += 1; } if (neg) { @@ -865,12 +865,12 @@ void Texts_Scan (Texts_Scanner *S, address *S__typ) y = (LONGREAL)0; g = (LONGREAL)1; do { - y = y * (LONGREAL)10 + (d[__X(j, 32)] - 48); + y = y * (LONGREAL)10 + ((int16)d[__X(j, 32)] - 48); j += 1; } while (!(j == h)); while (j < i) { g = g / (LONGREAL)(LONGREAL)10; - y = (d[__X(j, 32)] - 48) * g + y; + y = ((int16)d[__X(j, 32)] - 48) * g + y; j += 1; } ReadScaleFactor__32(); @@ -897,12 +897,12 @@ void Texts_Scan (Texts_Scanner *S, address *S__typ) x = (REAL)0; f = (REAL)1; do { - x = x * (REAL)10 + (d[__X(j, 32)] - 48); + x = x * (REAL)10 + ((int16)d[__X(j, 32)] - 48); j += 1; } while (!(j == h)); while (j < i) { f = f / (REAL)(REAL)10; - x = (d[__X(j, 32)] - 48) * f + x; + x = ((int16)d[__X(j, 32)] - 48) * f + x; j += 1; } if (ch == 'E') { @@ -934,7 +934,7 @@ void Texts_Scan (Texts_Scanner *S, address *S__typ) (*S).class = 3; k = 0; do { - k = k * 10 + (int64)(d[__X(j, 32)] - 48); + k = k * 10 + ((int16)d[__X(j, 32)] - 48); j += 1; } while (!(j == i)); if (neg) { @@ -1040,7 +1040,7 @@ void Texts_WriteLn (Texts_Writer *W, address *W__typ) void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGINT s__len) { - int32 i; + int16 i; __DUP(s, s__len, CHAR); i = 0; while (s[__X(i, s__len)] >= ' ') { @@ -1052,7 +1052,7 @@ void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGINT s__le void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n) { - int32 i; + int16 i; int64 x0; CHAR a[24]; i = 0; @@ -1085,10 +1085,10 @@ void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n) } while (!(i == 0)); } -void Texts_WriteHex (Texts_Writer *W, address *W__typ, int64 x) +void Texts_WriteHex (Texts_Writer *W, address *W__typ, int32 x) { - int32 i; - int64 y; + int16 i; + int32 y; CHAR a[20]; i = 0; Texts_Write(&*W, W__typ, ' '); @@ -1108,9 +1108,9 @@ void Texts_WriteHex (Texts_Writer *W, address *W__typ, int64 x) } while (!(i == 0)); } -void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int32 n) +void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int16 n) { - int32 e; + int16 e; REAL x0; CHAR d[9]; e = Reals_Expo(x); @@ -1181,15 +1181,15 @@ void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int32 n) static struct WriteRealFix__53 { Texts_Writer *W; address *W__typ; - int32 *i; + int16 *i; CHAR (*d)[9]; struct WriteRealFix__53 *lnk; } *WriteRealFix__53_s; -static void dig__54 (int32 n); -static void seq__56 (CHAR ch, int32 n); +static void dig__54 (int16 n); +static void seq__56 (CHAR ch, int16 n); -static void seq__56 (CHAR ch, int32 n) +static void seq__56 (CHAR ch, int16 n) { while (n > 0) { Texts_Write(&*WriteRealFix__53_s->W, WriteRealFix__53_s->W__typ, ch); @@ -1197,7 +1197,7 @@ static void seq__56 (CHAR ch, int32 n) } } -static void dig__54 (int32 n) +static void dig__54 (int16 n) { while (n > 0) { *WriteRealFix__53_s->i -= 1; @@ -1206,9 +1206,9 @@ static void dig__54 (int32 n) } } -void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int32 n, int32 k) +void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int16 n, int16 k) { - int32 e, i; + int16 e, i; CHAR sign; REAL x0; CHAR d[9]; @@ -1280,7 +1280,7 @@ void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int32 n, int3 void Texts_WriteRealHex (Texts_Writer *W, address *W__typ, REAL x) { - int32 i; + int16 i; CHAR d[8]; Reals_ConvertH(x, (void*)d, 8); i = 0; @@ -1290,9 +1290,9 @@ void Texts_WriteRealHex (Texts_Writer *W, address *W__typ, REAL x) } while (!(i == 8)); } -void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int32 n) +void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int16 n) { - int32 e; + int16 e; LONGREAL x0; CHAR d[16]; e = Reals_ExpoL(x); @@ -1324,7 +1324,7 @@ void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int32 n) } else { Texts_Write(&*W, W__typ, ' '); } - e = (int32)__ASHR((int64)(e - 1023) * 77, 8); + e = (int16)__ASHR((e - 1023) * 77, 8); if (e >= 0) { x = x / (LONGREAL)Reals_TenL(e); } else { @@ -1364,7 +1364,7 @@ void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int32 n) void Texts_WriteLongRealHex (Texts_Writer *W, address *W__typ, LONGREAL x) { - int32 i; + int16 i; CHAR d[16]; Reals_ConvertHL(x, (void*)d, 16); i = 0; @@ -1380,16 +1380,16 @@ static struct WriteDate__43 { struct WriteDate__43 *lnk; } *WriteDate__43_s; -static void WritePair__44 (CHAR ch, int64 x); +static void WritePair__44 (CHAR ch, int32 x); -static void WritePair__44 (CHAR ch, int64 x) +static void WritePair__44 (CHAR ch, int32 x) { Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, ch); Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)(__DIV(x, 10) + 48)); - Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)(__MOD(x, 10) + 48)); + Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)((int)__MOD(x, 10) + 48)); } -void Texts_WriteDate (Texts_Writer *W, address *W__typ, int64 t, int64 d) +void Texts_WriteDate (Texts_Writer *W, address *W__typ, int32 t, int32 d) { struct WriteDate__43 _s; _s.W = W; _s.W__typ = W__typ; @@ -1413,14 +1413,14 @@ static struct Load0__16 { struct Load0__16 *lnk; } *Load0__16_s; -static void LoadElem__17 (Files_Rider *r, address *r__typ, int64 pos, int64 span, Texts_Elem *e); +static void LoadElem__17 (Files_Rider *r, address *r__typ, int32 pos, int32 span, Texts_Elem *e); -static void LoadElem__17 (Files_Rider *r, address *r__typ, int64 pos, int64 span, Texts_Elem *e) +static void LoadElem__17 (Files_Rider *r, address *r__typ, int32 pos, int32 span, Texts_Elem *e) { Modules_Module M = NIL; Modules_Command Cmd; Texts_Alien a = NIL; - int64 org, ew, eh; + int32 org, ew, eh; int8 eno; Texts_new = NIL; Files_ReadLInt(&*r, r__typ, &ew); @@ -1471,7 +1471,7 @@ static void Texts_Load0 (Files_Rider *r, address *r__typ, Texts_Text T) Texts_Run u = NIL, un = NIL; Texts_Piece p = NIL; Texts_Elem e = NIL; - int64 org, pos, hlen, plen; + int32 org, pos, hlen, plen; int8 ecnt, fno, fcnt, col, voff; Files_File f = NIL; Texts_FileMsg msg; @@ -1490,7 +1490,7 @@ static void Texts_Load0 (Files_Rider *r, address *r__typ, Texts_Text T) pos = Files_Pos(&*r, r__typ); f = Files_Base(&*r, r__typ); __NEW(u, Texts_RunDesc); - u->len = 9223372036854775807; + u->len = 2147483647; u->fnt = NIL; u->col = 15; T->head = u; @@ -1542,7 +1542,7 @@ static void Texts_Load0 (Files_Rider *r, address *r__typ, Texts_Text T) void Texts_Load (Files_Rider *r, address *r__typ, Texts_Text T) { - int32 tag; + int16 tag; Files_ReadInt(&*r, r__typ, &tag); if (tag != -4095) { Files_Set(&*r, r__typ, Files_Base(&*r, r__typ), Files_Pos(&*r, r__typ) - 2); @@ -1557,7 +1557,7 @@ void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len) Texts_Run u = NIL; Texts_Piece p = NIL; CHAR tag, version; - int64 hlen; + int32 hlen; __DUP(name, name__len, CHAR); f = Files_Old(name, name__len); if (f == NIL) { @@ -1570,7 +1570,7 @@ void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len) Texts_Load0(&r, Files_Rider__typ, T); } else { __NEW(u, Texts_RunDesc); - u->len = 9223372036854775807; + u->len = 2147483647; u->fnt = NIL; u->col = 15; __NEW(p, Texts_PieceDesc); @@ -1614,12 +1614,12 @@ static struct Store__39 { struct Store__39 *lnk; } *Store__39_s; -static void StoreElem__40 (Files_Rider *r, address *r__typ, int64 pos, Texts_Elem e); +static void StoreElem__40 (Files_Rider *r, address *r__typ, int32 pos, Texts_Elem e); -static void StoreElem__40 (Files_Rider *r, address *r__typ, int64 pos, Texts_Elem e) +static void StoreElem__40 (Files_Rider *r, address *r__typ, int32 pos, Texts_Elem e) { Files_Rider r1; - int64 org, span; + int32 org, span; int8 eno; __COPY((*Store__39_s->iden).mod, (*Store__39_s->mods)[__X(*Store__39_s->ecnt, 64)], 32); __COPY((*Store__39_s->iden).proc, (*Store__39_s->procs)[__X(*Store__39_s->ecnt, 64)], 32); @@ -1651,7 +1651,7 @@ void Texts_Store (Files_Rider *r, address *r__typ, Texts_Text T) Files_Rider r1; Texts_Run u = NIL, un = NIL; Texts_Elem e = NIL; - int64 org, pos, delta, hlen, rlen; + int32 org, pos, delta, hlen, rlen; int8 ecnt, fno, fcnt; CHAR ch; Texts_FileMsg msg; @@ -1769,7 +1769,7 @@ void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len) { Files_File f = NIL; Files_Rider r; - int32 i, res; + int16 i, res; CHAR bak[64]; __DUP(name, name__len, CHAR); f = Files_New(name, name__len); @@ -1803,16 +1803,16 @@ __TDESC(Texts_FontDesc, 1, 0) = {__TDFLDS("FontDesc", 32), {-8}}; __TDESC(Texts_RunDesc, 1, 3) = {__TDFLDS("RunDesc", 40), {0, 8, 24, -32}}; __TDESC(Texts_PieceDesc, 1, 4) = {__TDFLDS("PieceDesc", 56), {0, 8, 24, 40, -40}}; __TDESC(Texts_ElemMsg, 1, 0) = {__TDFLDS("ElemMsg", 1), {-8}}; -__TDESC(Texts_ElemDesc, 1, 4) = {__TDFLDS("ElemDesc", 72), {0, 8, 24, 64, -40}}; -__TDESC(Texts_FileMsg, 1, 1) = {__TDFLDS("FileMsg", 56), {32, -16}}; +__TDESC(Texts_ElemDesc, 1, 4) = {__TDFLDS("ElemDesc", 64), {0, 8, 24, 56, -40}}; +__TDESC(Texts_FileMsg, 1, 1) = {__TDFLDS("FileMsg", 32), {16, -16}}; __TDESC(Texts_CopyMsg, 1, 1) = {__TDFLDS("CopyMsg", 8), {0, -16}}; __TDESC(Texts_IdentifyMsg, 1, 0) = {__TDFLDS("IdentifyMsg", 64), {-8}}; __TDESC(Texts_BufDesc, 1, 1) = {__TDFLDS("BufDesc", 16), {8, -16}}; __TDESC(Texts_TextDesc, 1, 2) = {__TDFLDS("TextDesc", 40), {16, 24, -24}}; -__TDESC(Texts_Reader, 1, 4) = {__TDFLDS("Reader", 96), {8, 24, 48, 72, -40}}; -__TDESC(Texts_Scanner, 1, 4) = {__TDFLDS("Scanner", 208), {8, 24, 48, 72, -40}}; -__TDESC(Texts_Writer, 1, 4) = {__TDFLDS("Writer", 72), {0, 8, 40, 64, -40}}; -__TDESC(Texts__1, 1, 5) = {__TDFLDS("", 160), {0, 8, 24, 64, 72, -48}}; +__TDESC(Texts_Reader, 1, 4) = {__TDFLDS("Reader", 72), {8, 24, 40, 56, -40}}; +__TDESC(Texts_Scanner, 1, 4) = {__TDFLDS("Scanner", 168), {8, 24, 40, 56, -40}}; +__TDESC(Texts_Writer, 1, 4) = {__TDFLDS("Writer", 56), {0, 8, 32, 48, -40}}; +__TDESC(Texts__1, 1, 5) = {__TDFLDS("", 144), {0, 8, 24, 56, 64, -48}}; export void *Texts__init(void) { diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index e85157ed..fa080b7f 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -8,8 +8,8 @@ typedef struct Texts_BufDesc { - int64 len; - char _prvt0[8]; + int32 len; + int64 _prvt0; } Texts_BufDesc; typedef @@ -39,16 +39,17 @@ typedef typedef struct Texts_ElemDesc { - char _prvt0[40]; - int64 W, H; + int64 _prvt0; + char _prvt1[28]; + int32 W, H; Texts_Handler handle; - char _prvt1[8]; + char _prvt2[8]; } Texts_ElemDesc; typedef struct Texts_FileMsg { /* Texts_ElemMsg */ - int32 id; - int64 pos; + int16 id; + int32 pos; Files_Rider r; } Texts_FileMsg; @@ -69,7 +70,7 @@ typedef struct Texts_TextDesc *Texts_Text; typedef - void (*Texts_Notifier)(Texts_Text, int32, int64, int64); + void (*Texts_Notifier)(Texts_Text, int16, int32, int32); typedef struct Texts_Reader { @@ -77,7 +78,7 @@ typedef Texts_FontsFont fnt; int8 col, voff; Texts_Elem elem; - char _prvt0[64]; + char _prvt0[40]; } Texts_Reader; typedef @@ -86,10 +87,10 @@ typedef Texts_FontsFont fnt; int8 col, voff; Texts_Elem elem; - char _prvt0[64]; + char _prvt0[40]; CHAR nextCh; - int32 line, class; - int64 i; + int16 line, class; + int32 i; REAL x; LONGREAL y; CHAR c; @@ -99,9 +100,9 @@ typedef typedef struct Texts_TextDesc { - int64 len; + int32 len; Texts_Notifier notify; - char _prvt0[24]; + char _prvt0[20]; } Texts_TextDesc; typedef @@ -109,7 +110,7 @@ typedef Texts_Buffer buf; Texts_FontsFont fnt; int8 col, voff; - char _prvt0[54]; + char _prvt0[38]; } Texts_Writer; @@ -129,41 +130,41 @@ import address *Texts_Scanner__typ; import address *Texts_Writer__typ; import void Texts_Append (Texts_Text T, Texts_Buffer B); -import void Texts_ChangeLooks (Texts_Text T, int64 beg, int64 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff); +import void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff); import void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len); import void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); import void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); -import void Texts_Delete (Texts_Text T, int64 beg, int64 end); +import void Texts_Delete (Texts_Text T, int32 beg, int32 end); import Texts_Text Texts_ElemBase (Texts_Elem E); -import int64 Texts_ElemPos (Texts_Elem E); -import void Texts_Insert (Texts_Text T, int64 pos, Texts_Buffer B); +import int32 Texts_ElemPos (Texts_Elem E); +import void Texts_Insert (Texts_Text T, int32 pos, Texts_Buffer B); import void Texts_Load (Files_Rider *r, address *r__typ, Texts_Text T); import void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len); import void Texts_OpenBuf (Texts_Buffer B); -import void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int64 pos); -import void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int64 pos); +import void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int32 pos); +import void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int32 pos); import void Texts_OpenWriter (Texts_Writer *W, address *W__typ); -import int64 Texts_Pos (Texts_Reader *R, address *R__typ); +import int32 Texts_Pos (Texts_Reader *R, address *R__typ); import void Texts_Read (Texts_Reader *R, address *R__typ, CHAR *ch); import void Texts_ReadElem (Texts_Reader *R, address *R__typ); import void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ); import void Texts_Recall (Texts_Buffer *B); -import void Texts_Save (Texts_Text T, int64 beg, int64 end, Texts_Buffer B); +import void Texts_Save (Texts_Text T, int32 beg, int32 end, Texts_Buffer B); import void Texts_Scan (Texts_Scanner *S, address *S__typ); import void Texts_SetColor (Texts_Writer *W, address *W__typ, int8 col); import void Texts_SetFont (Texts_Writer *W, address *W__typ, Texts_FontsFont fnt); import void Texts_SetOffset (Texts_Writer *W, address *W__typ, int8 voff); import void Texts_Store (Files_Rider *r, address *r__typ, Texts_Text T); import void Texts_Write (Texts_Writer *W, address *W__typ, CHAR ch); -import void Texts_WriteDate (Texts_Writer *W, address *W__typ, int64 t, int64 d); +import void Texts_WriteDate (Texts_Writer *W, address *W__typ, int32 t, int32 d); import void Texts_WriteElem (Texts_Writer *W, address *W__typ, Texts_Elem e); -import void Texts_WriteHex (Texts_Writer *W, address *W__typ, int64 x); +import void Texts_WriteHex (Texts_Writer *W, address *W__typ, int32 x); import void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n); import void Texts_WriteLn (Texts_Writer *W, address *W__typ); -import void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int32 n); +import void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int16 n); import void Texts_WriteLongRealHex (Texts_Writer *W, address *W__typ, LONGREAL x); -import void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int32 n); -import void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int32 n, int32 k); +import void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int16 n); +import void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int16 n, int16 k); import void Texts_WriteRealHex (Texts_Writer *W, address *W__typ, REAL x); import void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGINT s__len); import void *Texts__init(void); diff --git a/bootstrap/windows-88/Vishap.c b/bootstrap/windows-88/Vishap.c index 5c6cada1..1ec89e33 100644 --- a/bootstrap/windows-88/Vishap.c +++ b/bootstrap/windows-88/Vishap.c @@ -1,8 +1,8 @@ /* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspamSf */ -#define INTEGER int32 -#define LONGINT int64 -#define SET uint64 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Configuration.h" @@ -25,7 +25,7 @@ static CHAR Vishap_mname[256]; export void Vishap_Module (BOOLEAN *done); static void Vishap_PropagateElementaryTypeSizes (void); export void Vishap_Translate (void); -static void Vishap_Trap (int32 sig); +static void Vishap_Trap (int16 sig); void Vishap_Module (BOOLEAN *done) @@ -42,22 +42,22 @@ void Vishap_Module (BOOLEAN *done) OPC_Init(); OPV_Module(p); if (OPM_noerr) { - if ((__IN(10, OPM_opt, 64) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { + if ((__IN(10, OPM_opt, 32) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { OPM_DeleteNewSym(); - if (!__IN(16, OPM_opt, 64)) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"32m", 4); } OPM_LogWStr((CHAR*)" Main program.", 16); - if (!__IN(16, OPM_opt, 64)) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } } else { if (new) { - if (!__IN(16, OPM_opt, 64)) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"32m", 4); } OPM_LogWStr((CHAR*)" New symbol file.", 19); - if (!__IN(16, OPM_opt, 64)) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } OPM_RegisterNewSym(); @@ -111,17 +111,17 @@ void Vishap_Translate (void) OPM_LogWLn(); Platform_Exit(1); } - if (!__IN(13, OPM_opt, 64)) { - if (__IN(14, OPM_opt, 64)) { + if (!__IN(13, OPM_opt, 32)) { + if (__IN(14, OPM_opt, 32)) { extTools_Assemble(OPM_modName, 32); } else { - if (!__IN(10, OPM_opt, 64)) { + if (!__IN(10, OPM_opt, 32)) { extTools_Assemble(OPM_modName, 32); Strings_Append((CHAR*)" ", 2, (void*)modulesobj, 2048); Strings_Append(OPM_modName, 32, (void*)modulesobj, 2048); Strings_Append((CHAR*)".o", 3, (void*)modulesobj, 2048); } else { - extTools_LinkMain((void*)OPM_modName, 32, __IN(15, OPM_opt, 64), modulesobj, 2048); + extTools_LinkMain((void*)OPM_modName, 32, __IN(15, OPM_opt, 32), modulesobj, 2048); } } } @@ -129,7 +129,7 @@ void Vishap_Translate (void) } } -static void Vishap_Trap (int32 sig) +static void Vishap_Trap (int16 sig) { Heap_FINALL(); if (sig == 3) { diff --git a/bootstrap/windows-88/errors.c b/bootstrap/windows-88/errors.c index 4bb09433..0a40d5e9 100644 --- a/bootstrap/windows-88/errors.c +++ b/bootstrap/windows-88/errors.c @@ -1,8 +1,8 @@ /* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ -#define INTEGER int32 -#define LONGINT int64 -#define SET uint64 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index d6bc2194..8be0b63d 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,8 +1,8 @@ /* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ -#define INTEGER int32 -#define LONGINT int64 -#define SET uint64 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Configuration.h" @@ -22,10 +22,10 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGINT cmd__len) { - int32 r, status, exitcode; + int16 r, status, exitcode; __DUP(title, title__len, CHAR); __DUP(cmd, cmd__len, CHAR); - if (__IN(18, OPM_opt, 64)) { + if (__IN(18, OPM_opt, 32)) { Console_String(title, title__len); Console_String(cmd, cmd__len); Console_Ln(); diff --git a/bootstrap/windows-88/vt100.c b/bootstrap/windows-88/vt100.c index bb55d599..4f6a6c9d 100644 --- a/bootstrap/windows-88/vt100.c +++ b/bootstrap/windows-88/vt100.c @@ -1,8 +1,8 @@ /* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ -#define INTEGER int32 -#define LONGINT int64 -#define SET uint64 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Console.h" @@ -13,36 +13,36 @@ export CHAR vt100_CSI[5]; static CHAR vt100_tmpstr[32]; -export void vt100_CHA (int32 n); -export void vt100_CNL (int32 n); -export void vt100_CPL (int32 n); -export void vt100_CUB (int32 n); -export void vt100_CUD (int32 n); -export void vt100_CUF (int32 n); -export void vt100_CUP (int32 n, int32 m); -export void vt100_CUU (int32 n); +export void vt100_CHA (int16 n); +export void vt100_CNL (int16 n); +export void vt100_CPL (int16 n); +export void vt100_CUB (int16 n); +export void vt100_CUD (int16 n); +export void vt100_CUF (int16 n); +export void vt100_CUP (int16 n, int16 m); +export void vt100_CUU (int16 n); export void vt100_DECTCEMh (void); export void vt100_DECTCEMl (void); -export void vt100_DSR (int32 n); -export void vt100_ED (int32 n); -export void vt100_EL (int32 n); -static void vt100_EscSeq (int32 n, CHAR *letter, LONGINT letter__len); +export void vt100_DSR (int16 n); +export void vt100_ED (int16 n); +export void vt100_EL (int16 n); +static void vt100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len); static void vt100_EscSeq0 (CHAR *letter, LONGINT letter__len); -static void vt100_EscSeq2 (int32 n, int32 m, CHAR *letter, LONGINT letter__len); -static void vt100_EscSeqSwapped (int32 n, CHAR *letter, LONGINT letter__len); -export void vt100_HVP (int32 n, int32 m); -export void vt100_IntToStr (int64 int_, CHAR *str, LONGINT str__len); +static void vt100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len); +static void vt100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len); +export void vt100_HVP (int16 n, int16 m); +export void vt100_IntToStr (int32 int_, CHAR *str, LONGINT str__len); export void vt100_RCP (void); -static void vt100_Reverse0 (CHAR *str, LONGINT str__len, int32 start, int32 end); +static void vt100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end); export void vt100_SCP (void); -export void vt100_SD (int32 n); -export void vt100_SGR (int32 n); -export void vt100_SGR2 (int32 n, int32 m); -export void vt100_SU (int32 n); +export void vt100_SD (int16 n); +export void vt100_SGR (int16 n); +export void vt100_SGR2 (int16 n, int16 m); +export void vt100_SU (int16 n); export void vt100_SetAttr (CHAR *attr, LONGINT attr__len); -static void vt100_Reverse0 (CHAR *str, LONGINT str__len, int32 start, int32 end) +static void vt100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end) { CHAR h; while (start < end) { @@ -54,15 +54,15 @@ static void vt100_Reverse0 (CHAR *str, LONGINT str__len, int32 start, int32 end) } } -void vt100_IntToStr (int64 int_, CHAR *str, LONGINT str__len) +void vt100_IntToStr (int32 int_, CHAR *str, LONGINT str__len) { CHAR b[21]; - int32 s, e; + int16 s, e; int8 maxLength; - maxLength = 20; - if (int_ == (-9223372036854775807-1)) { - __MOVE("-9223372036854775808", b, 21); - e = 20; + maxLength = 11; + if (int_ == (-2147483647-1)) { + __MOVE("-2147483648", b, 12); + e = 11; } else { if (int_ < 0) { b[0] = '-'; @@ -73,7 +73,7 @@ void vt100_IntToStr (int64 int_, CHAR *str, LONGINT str__len) } e = s; do { - b[__X(e, 21)] = (CHAR)(__MOD(int_, 10) + 48); + b[__X(e, 21)] = (CHAR)((int)__MOD(int_, 10) + 48); int_ = __DIV(int_, 10); e += 1; } while (!(int_ == 0)); @@ -93,7 +93,7 @@ static void vt100_EscSeq0 (CHAR *letter, LONGINT letter__len) __DEL(letter); } -static void vt100_EscSeq (int32 n, CHAR *letter, LONGINT letter__len) +static void vt100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len) { CHAR nstr[2]; CHAR cmd[7]; @@ -106,7 +106,7 @@ static void vt100_EscSeq (int32 n, CHAR *letter, LONGINT letter__len) __DEL(letter); } -static void vt100_EscSeqSwapped (int32 n, CHAR *letter, LONGINT letter__len) +static void vt100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len) { CHAR nstr[2]; CHAR cmd[7]; @@ -119,7 +119,7 @@ static void vt100_EscSeqSwapped (int32 n, CHAR *letter, LONGINT letter__len) __DEL(letter); } -static void vt100_EscSeq2 (int32 n, int32 m, CHAR *letter, LONGINT letter__len) +static void vt100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len) { CHAR nstr[5], mstr[5]; CHAR cmd[12]; @@ -135,82 +135,82 @@ static void vt100_EscSeq2 (int32 n, int32 m, CHAR *letter, LONGINT letter__len) __DEL(letter); } -void vt100_CUU (int32 n) +void vt100_CUU (int16 n) { vt100_EscSeq(n, (CHAR*)"A", 2); } -void vt100_CUD (int32 n) +void vt100_CUD (int16 n) { vt100_EscSeq(n, (CHAR*)"B", 2); } -void vt100_CUF (int32 n) +void vt100_CUF (int16 n) { vt100_EscSeq(n, (CHAR*)"C", 2); } -void vt100_CUB (int32 n) +void vt100_CUB (int16 n) { vt100_EscSeq(n, (CHAR*)"D", 2); } -void vt100_CNL (int32 n) +void vt100_CNL (int16 n) { vt100_EscSeq(n, (CHAR*)"E", 2); } -void vt100_CPL (int32 n) +void vt100_CPL (int16 n) { vt100_EscSeq(n, (CHAR*)"F", 2); } -void vt100_CHA (int32 n) +void vt100_CHA (int16 n) { vt100_EscSeq(n, (CHAR*)"G", 2); } -void vt100_CUP (int32 n, int32 m) +void vt100_CUP (int16 n, int16 m) { vt100_EscSeq2(n, m, (CHAR*)"H", 2); } -void vt100_ED (int32 n) +void vt100_ED (int16 n) { vt100_EscSeq(n, (CHAR*)"J", 2); } -void vt100_EL (int32 n) +void vt100_EL (int16 n) { vt100_EscSeq(n, (CHAR*)"K", 2); } -void vt100_SU (int32 n) +void vt100_SU (int16 n) { vt100_EscSeq(n, (CHAR*)"S", 2); } -void vt100_SD (int32 n) +void vt100_SD (int16 n) { vt100_EscSeq(n, (CHAR*)"T", 2); } -void vt100_HVP (int32 n, int32 m) +void vt100_HVP (int16 n, int16 m) { vt100_EscSeq2(n, m, (CHAR*)"f", 2); } -void vt100_SGR (int32 n) +void vt100_SGR (int16 n) { vt100_EscSeq(n, (CHAR*)"m", 2); } -void vt100_SGR2 (int32 n, int32 m) +void vt100_SGR2 (int16 n, int16 m) { vt100_EscSeq2(n, m, (CHAR*)"m", 2); } -void vt100_DSR (int32 n) +void vt100_DSR (int16 n) { vt100_EscSeq(6, (CHAR*)"n", 2); } diff --git a/bootstrap/windows-88/vt100.h b/bootstrap/windows-88/vt100.h index 2bc7d18f..94f8add4 100644 --- a/bootstrap/windows-88/vt100.h +++ b/bootstrap/windows-88/vt100.h @@ -9,27 +9,27 @@ import CHAR vt100_CSI[5]; -import void vt100_CHA (int32 n); -import void vt100_CNL (int32 n); -import void vt100_CPL (int32 n); -import void vt100_CUB (int32 n); -import void vt100_CUD (int32 n); -import void vt100_CUF (int32 n); -import void vt100_CUP (int32 n, int32 m); -import void vt100_CUU (int32 n); +import void vt100_CHA (int16 n); +import void vt100_CNL (int16 n); +import void vt100_CPL (int16 n); +import void vt100_CUB (int16 n); +import void vt100_CUD (int16 n); +import void vt100_CUF (int16 n); +import void vt100_CUP (int16 n, int16 m); +import void vt100_CUU (int16 n); import void vt100_DECTCEMh (void); import void vt100_DECTCEMl (void); -import void vt100_DSR (int32 n); -import void vt100_ED (int32 n); -import void vt100_EL (int32 n); -import void vt100_HVP (int32 n, int32 m); -import void vt100_IntToStr (int64 int_, CHAR *str, LONGINT str__len); +import void vt100_DSR (int16 n); +import void vt100_ED (int16 n); +import void vt100_EL (int16 n); +import void vt100_HVP (int16 n, int16 m); +import void vt100_IntToStr (int32 int_, CHAR *str, LONGINT str__len); import void vt100_RCP (void); import void vt100_SCP (void); -import void vt100_SD (int32 n); -import void vt100_SGR (int32 n); -import void vt100_SGR2 (int32 n, int32 m); -import void vt100_SU (int32 n); +import void vt100_SD (int16 n); +import void vt100_SGR (int16 n); +import void vt100_SGR2 (int16 n, int16 m); +import void vt100_SU (int16 n); import void vt100_SetAttr (CHAR *attr, LONGINT attr__len); import void *vt100__init(void); diff --git a/makefile b/makefile index 37fa64a0..491b28f1 100644 --- a/makefile +++ b/makefile @@ -264,9 +264,9 @@ bootstrap: configuration rm -rf bootstrap/* make -f src/tools/make/vishap.make -s translate MODEL=-O2 INTSIZE=2 ADRSIZE=4 ALIGNMENT=4 PLATFORM=unix BUILDDIR=bootstrap/unix-44 && rm bootstrap/unix-44/*.sym make -f src/tools/make/vishap.make -s translate MODEL=-O2 INTSIZE=2 ADRSIZE=4 ALIGNMENT=8 PLATFORM=unix BUILDDIR=bootstrap/unix-48 && rm bootstrap/unix-48/*.sym - make -f src/tools/make/vishap.make -s translate MODEL=-OV INTSIZE=4 ADRSIZE=8 ALIGNMENT=8 PLATFORM=unix BUILDDIR=bootstrap/unix-88 && rm bootstrap/unix-88/*.sym + make -f src/tools/make/vishap.make -s translate MODEL=-O2 INTSIZE=4 ADRSIZE=8 ALIGNMENT=8 PLATFORM=unix BUILDDIR=bootstrap/unix-88 && rm bootstrap/unix-88/*.sym make -f src/tools/make/vishap.make -s translate MODEL=-O2 INTSIZE=2 ADRSIZE=4 ALIGNMENT=8 PLATFORM=windows BUILDDIR=bootstrap/windows-48 && rm bootstrap/windows-48/*.sym - make -f src/tools/make/vishap.make -s translate MODEL=-OV INTSIZE=4 ADRSIZE=8 ALIGNMENT=8 PLATFORM=windows BUILDDIR=bootstrap/windows-88 && rm bootstrap/windows-88/*.sym + make -f src/tools/make/vishap.make -s translate MODEL=-O2 INTSIZE=4 ADRSIZE=8 ALIGNMENT=8 PLATFORM=windows BUILDDIR=bootstrap/windows-88 && rm bootstrap/windows-88/*.sym cp src/system/*.[ch] bootstrap @@ -274,9 +274,9 @@ bootstrapunclean: rm -rf bootstrap/* make -f src/tools/make/vishap.make -s translate MODEL=-O2 INTSIZE=2 ADRSIZE=4 ALIGNMENT=4 PLATFORM=unix BUILDDIR=bootstrap/unix-44 && rm bootstrap/unix-44/*.sym make -f src/tools/make/vishap.make -s translate MODEL=-O2 INTSIZE=2 ADRSIZE=4 ALIGNMENT=8 PLATFORM=unix BUILDDIR=bootstrap/unix-48 && rm bootstrap/unix-48/*.sym - make -f src/tools/make/vishap.make -s translate MODEL=-OV INTSIZE=4 ADRSIZE=8 ALIGNMENT=8 PLATFORM=unix BUILDDIR=bootstrap/unix-88 && rm bootstrap/unix-88/*.sym + make -f src/tools/make/vishap.make -s translate MODEL=-O2 INTSIZE=4 ADRSIZE=8 ALIGNMENT=8 PLATFORM=unix BUILDDIR=bootstrap/unix-88 && rm bootstrap/unix-88/*.sym make -f src/tools/make/vishap.make -s translate MODEL=-O2 INTSIZE=2 ADRSIZE=4 ALIGNMENT=8 PLATFORM=windows BUILDDIR=bootstrap/windows-48 && rm bootstrap/windows-48/*.sym - make -f src/tools/make/vishap.make -s translate MODEL=-OV INTSIZE=4 ADRSIZE=8 ALIGNMENT=8 PLATFORM=windows BUILDDIR=bootstrap/windows-88 && rm bootstrap/windows-88/*.sym + make -f src/tools/make/vishap.make -s translate MODEL=-O2 INTSIZE=4 ADRSIZE=8 ALIGNMENT=8 PLATFORM=windows BUILDDIR=bootstrap/windows-88 && rm bootstrap/windows-88/*.sym cp src/system/*.[ch] bootstrap diff --git a/src/compiler/OPB.Mod b/src/compiler/OPB.Mod index 408eeaeb..e1ed3aa0 100644 --- a/src/compiler/OPB.Mod +++ b/src/compiler/OPB.Mod @@ -1098,7 +1098,9 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126); p^.typ := OPT.notyp ELSE IF x^.typ # p^.typ THEN - IF (x^.class = OPT.Nconst) & (f = OPT.Int) THEN Convert(x, p^.typ) + IF (f = OPT.Int) + & ( (x^.class = OPT.Nconst) + OR (p.typ.form = OPT.Int) & (x.typ.size <= p.typ.size)) THEN Convert(x, p^.typ) ELSE err(111) END END ; diff --git a/src/compiler/OPM.cmdln.Mod b/src/compiler/OPM.cmdln.Mod index b3298aed..ded87d02 100644 --- a/src/compiler/OPM.cmdln.Mod +++ b/src/compiler/OPM.cmdln.Mod @@ -871,17 +871,9 @@ BEGIN AddressSize := Configuration.addressSize; Alignment := Configuration.alignment; - IF Configuration.intsize = 2 THEN - (* Original Oberon-2 implementation sizes (-O2) *) - ShortintSize := 1; - IntegerSize := 2; - LongintSize := 4; - SetSize := 4; - ELSE - (* Legacy Vishap 64 bit build sizes (-OV) *) - ShortintSize := 1; - IntegerSize := 4; - LongintSize := 8; - SetSize := 8; - END + (* Default type size model is that of the original Oberon-2 implementation (-O2) *) + ShortintSize := 1; + IntegerSize := 2; + LongintSize := 4; + SetSize := 4 END OPM. diff --git a/src/library/s3/ethMD5.Mod b/src/library/s3/ethMD5.Mod index 07a605cb..4d33a026 100644 --- a/src/library/s3/ethMD5.Mod +++ b/src/library/s3/ethMD5.Mod @@ -41,7 +41,8 @@ under a public-key cryptosystem such as RSA. *) PROCEDURE ByteReverse(VAR in: ARRAY OF SYSTEM.BYTE; VAR out: ARRAY OF LONGINT; longs: LONGINT); VAR - adr, t, i: LONGINT; + adr: SYSTEM.ADDRESS; + t, i: LONGINT; bytes: ARRAY 4 OF CHAR; BEGIN adr := SYSTEM.ADR(in[0]); i := 0; diff --git a/src/library/s3/ethZlibBuffers.Mod b/src/library/s3/ethZlibBuffers.Mod index 9db0736c..f484a980 100644 --- a/src/library/s3/ethZlibBuffers.Mod +++ b/src/library/s3/ethZlibBuffers.Mod @@ -3,8 +3,7 @@ Refer to the "General ETH Oberon System Source License" contract available at: h MODULE ethZlibBuffers; (** Stefan Walthert **) -IMPORT - SYSTEM; +IMPORT SYSTEM; (* should be portable even if SYSTEM is imported: - PUT and GET only with byte sized operands @@ -13,13 +12,14 @@ IMPORT TYPE (** input/output buffer **) - Address = LONGINT; + Address = SYSTEM.ADDRESS; Buffer* = RECORD - avail-: LONGINT; (** number of bytes that can be produced/consumed **) - size-: LONGINT; (** total number of bytes in buffer memory **) - totalOut-, totalIn-: LONGINT; (** total number of bytes produced/consumed **) - next: Address; (* address of next byte to produce/consume **) - adr: Address; (* buffer memory *) + avail-: LONGINT; (** number of bytes that can be produced/consumed **) + size-: LONGINT; (** total number of bytes in buffer memory **) + totalOut-: LONGINT; (** total number of bytes produced **) + totalIn-: LONGINT; (** total number of bytes consumed **) + next: Address; (* address of next byte to produce/consume **) + adr: Address; (* buffer memory *) END; @@ -50,9 +50,9 @@ PROCEDURE ReadBytes* (VAR buf: Buffer; VAR dst: ARRAY OF CHAR; offset, len: LONG BEGIN ASSERT((0 <= offset) & (0 < len) & (offset + len <= LEN(dst)) & (len <= buf.avail), 100); SYSTEM.MOVE(buf.next, SYSTEM.ADR(dst[offset]), len); - INC(buf.next, len); DEC(buf.avail, len); INC(buf.totalIn, len) + INC(buf.next, len); DEC(buf.avail, len); INC(buf.totalIn, len) END ReadBytes; - + (** write byte into (output) buffer **) PROCEDURE Write* (VAR buf: Buffer; ch: CHAR); BEGIN @@ -89,7 +89,7 @@ PROCEDURE Rewrite* (VAR buf: Buffer); BEGIN buf.next := buf.adr; buf.avail := buf.size END Rewrite; - + (** fill input buffer with new bytes to consume **) PROCEDURE Fill* (VAR buf: Buffer; VAR src: ARRAY OF CHAR; offset, size: LONGINT); BEGIN diff --git a/src/library/ulm/ulmIO.Mod b/src/library/ulm/ulmIO.Mod index 87ff46fa..04bc3bcb 100644 --- a/src/library/ulm/ulmIO.Mod +++ b/src/library/ulm/ulmIO.Mod @@ -1,6 +1,6 @@ MODULE ulmIO; - IMPORT SYS := ulmSYSTEM, SYSTEM; + IMPORT SYS := ulmSYSTEM, SYSTEM, Platform; CONST nl = 0AX; @@ -118,6 +118,7 @@ MODULE ulmIO; (* ========================= terminal ============================ *) +(* PROCEDURE ReadChar(VAR ch: CHAR) : BOOLEAN; CONST read = 3; (*VAR r0, r1: INTEGER;*) @@ -125,7 +126,17 @@ MODULE ulmIO; BEGIN RETURN SYS.UNIXCALL(read, r0, r1, 0, SYSTEM.ADR(ch), 1) & (r0 > 0) END ReadChar; +*) + PROCEDURE ReadChar(VAR ch: CHAR) : BOOLEAN; + (* Read one byte, returning success flag *) + VAR error: Platform.ErrorCode; readcount: LONGINT; + BEGIN + error := Platform.ReadBuf(Platform.StdIn, ch, readcount); + RETURN readcount > 0 + END ReadChar; + +(* PROCEDURE WriteChar(ch: CHAR) : BOOLEAN; CONST write = 4; (*VAR r0, r1: INTEGER;*) @@ -133,6 +144,13 @@ MODULE ulmIO; BEGIN RETURN SYS.UNIXCALL(write, r0, r1, 1, SYSTEM.ADR(ch), 1) END WriteChar; +*) + + PROCEDURE WriteChar(ch: CHAR) : BOOLEAN; + (* Write one byte, returning success flag *) + BEGIN + RETURN Platform.Write(Platform.StdOut, SYSTEM.ADR(ch), 1) = 0 + END WriteChar; PROCEDURE Read*(VAR ch: CHAR); BEGIN diff --git a/src/library/ulm/ulmSYSTEM.Mod b/src/library/ulm/ulmSYSTEM.Mod index bbd054b8..ece334a7 100644 --- a/src/library/ulm/ulmSYSTEM.Mod +++ b/src/library/ulm/ulmSYSTEM.Mod @@ -49,6 +49,7 @@ TYPE pchar = POINTER TO ARRAY 1 OF CHAR; RETURN oldflag; END TAS; +(* PROCEDURE UNIXCALL*(syscall: LONGINT; VAR d0, d1: LONGINT; (* in ulm version both LONGINT and INTEGER are 4 byte size *) arg1, arg2, arg3: LONGINT) : BOOLEAN; VAR @@ -122,7 +123,7 @@ TYPE pchar = POINTER TO ARRAY 1 OF CHAR; END END UNIXCALL; - +*) PROCEDURE UNIXFORK(VAR pid: LONGINT) : BOOLEAN; BEGIN @@ -135,8 +136,7 @@ TYPE pchar = POINTER TO ARRAY 1 OF CHAR; END UNIXSIGNAL; - PROCEDURE WMOVE*(from, to, n : LONGINT); - VAR l : LONGINT; + PROCEDURE WMOVE*(from, to, n : SYSTEM.ADDRESS); BEGIN SYSTEM.MOVE(from, to, n); END WMOVE; diff --git a/src/library/v4/Args.Mod b/src/library/v4/Args.Mod index 0d4ff925..a196b5c5 100644 --- a/src/library/v4/Args.Mod +++ b/src/library/v4/Args.Mod @@ -3,7 +3,7 @@ MODULE Args; (* jt, 8.12.94 *) (* command line argument handling for voc (jet backend) *) - IMPORT Platform; + IMPORT Platform, SYSTEM; TYPE ArgPtr = POINTER TO ARRAY 1024 OF CHAR; @@ -11,17 +11,17 @@ MODULE Args; (* jt, 8.12.94 *) VAR argc-: LONGINT; - argv-: LONGINT; + argv-: SYSTEM.ADDRESS; PROCEDURE Get* (n: INTEGER; VAR val: ARRAY OF CHAR); BEGIN Platform.GetArg(n, val) END Get; PROCEDURE GetInt*(n: INTEGER; VAR val: LONGINT); BEGIN Platform.GetIntArg(n, val) END GetInt; PROCEDURE Pos* (s: ARRAY OF CHAR): INTEGER; BEGIN RETURN Platform.ArgPos(s) END Pos; -PROCEDURE GetEnv*(var: ARRAY OF CHAR; VAR val: ARRAY OF CHAR); +PROCEDURE GetEnv*(var: ARRAY OF CHAR; VAR val: ARRAY OF CHAR); BEGIN Platform.GetEnv(var, val) END GetEnv; -PROCEDURE getEnv*(var: ARRAY OF CHAR; VAR val: ARRAY OF CHAR): BOOLEAN; +PROCEDURE getEnv*(var: ARRAY OF CHAR; VAR val: ARRAY OF CHAR): BOOLEAN; BEGIN RETURN Platform.getEnv(var, val) END getEnv; diff --git a/src/library/v4/Printer.Mod b/src/library/v4/Printer.Mod index 39b06c0c..803b567f 100644 --- a/src/library/v4/Printer.Mod +++ b/src/library/v4/Printer.Mod @@ -87,7 +87,7 @@ MODULE Printer; (*UNIX version: JT 11.5.90, RC 2.7.93, JS 29.4.94, JT 14.4.95 VAR family: ARRAY 7 OF CHAR; BEGIN COPY(fname, family); - Ch(fontR, "/"); Str(fontR, fname); + Ch(fontR, "/"); Str(fontR, fname); IF family = "Syntax" THEN Str(fontR, " DefineSMapFont") ELSE Str(fontR, " DefineMapFont") END; Ln(fontR); Ln(fontR); END SetMappedFont; @@ -161,7 +161,7 @@ MODULE Printer; (*UNIX version: JT 11.5.90, RC 2.7.93, JS 29.4.94, JT 14.4.95 | 92: Str(fontR, "backslash") | 93: Str(fontR, "bracketright") | 94: Str(fontR, "arrowup") - | 95: Str(fontR, "underscore") + | 95: Str(fontR, "underscore") | 96: Str(fontR, "grave") | 97..122: Ch(fontR, CHR(m)) | 123: Str(fontR, "braceleft") @@ -205,8 +205,8 @@ MODULE Printer; (*UNIX version: JT 11.5.90, RC 2.7.93, JS 29.4.94, JT 14.4.95 Str(fontR, "% Conversion of the Oberon font "); Str(fontR, fd.name); Ln(fontR); Files.Read(R, ch); IF ch = fontFileId THEN - Files.Read(R, ch); Str(fontR, "% abstraction: "); Int(fontR, ORD(ch)); - Files.Read(R, ch); Str(fontR, ", family: "); Ch(fontR, ch); + Files.Read(R, ch); Str(fontR, "% abstraction: "); Int(fontR, ORD(ch)); + Files.Read(R, ch); Str(fontR, ", family: "); Ch(fontR, ch); Files.Read(R, ch); Str(fontR, ", variant: "); Int(fontR, ORD(ch)); Ln(fontR); Files.ReadInt(R, height); Str(fontR, "% height: "); Int(fontR, height); Ln(fontR); Ln(fontR); Files.ReadInt(R, minX); Files.ReadInt(R, maxX); @@ -223,7 +223,7 @@ MODULE Printer; (*UNIX version: JT 11.5.90, RC 2.7.93, JS 29.4.94, JT 14.4.95 Str(fontR, "/FontMatrix [ 72 "); Int(fontR, pRes); Str(fontR, " div "); Str(fontR, " .24 div 0 0 "); Str(fontR, "72 "); Int(fontR, pRes); Str(fontR, " div "); Str(fontR, " .24 div 0 0"); Str(fontR, "] def"); Ln(fontR); - Str(fontR, "/FontBBox ["); + Str(fontR, "/FontBBox ["); Int(fontR, minX); Ch(fontR, " "); Int(fontR, minY); Ch(fontR, " "); Int(fontR, maxX); Ch(fontR, " "); @@ -339,7 +339,7 @@ END; Error("file not found", headerFileName) END END Open; - + PROCEDURE UseListFont*(VAR name: ARRAY OF CHAR); BEGIN COPY(name, listFont); curFont := -1 @@ -368,7 +368,7 @@ END; IF fname = listFont THEN fontname := "Courier8.Scn.Fnt" ELSE COPY(fname, fontname) END ; IF (curFont < 0) OR (fontTable[curFont].name # fontname) THEN COPY(fontname, fontTable[fontIndex+1].name); - i := 0; WHILE i < 8 DO fontTable[fontIndex+1].used[i] := {}; INC(i) END; + i := 0; WHILE i < 8 DO fontTable[fontIndex+1].used[i] := {}; INC(i) END; fNo := 0; WHILE fontTable[fNo].name # fontname DO INC(fNo) END; IF fNo > fontIndex THEN (* DefineFont(fontname); *) fontIndex := fNo END; @@ -394,7 +394,7 @@ END; END; Str(bodyR, ") s"); Ln(bodyR) END ContString; - + PROCEDURE String*(x, y: INTEGER; VAR s, fname: ARRAY OF CHAR); BEGIN Int(bodyR, x); Ch(bodyR, " "); @@ -410,7 +410,7 @@ END; Int(bodyR, col); Str(bodyR, " b"); Ln(bodyR); END ReplPattern; - PROCEDURE Picture*(x, y, w, h, mode: INTEGER; adr: LONGINT); + PROCEDURE Picture*(x, y, w, h, mode: INTEGER; adr: SYSTEM.ADDRESS); VAR n, i, v: INTEGER; ch: CHAR; BEGIN Int(bodyR, x); Ch(bodyR, " "); @@ -517,7 +517,7 @@ END; a[i] := 2.0*b[i-1] + hn; d[i] := d1 + dn; w[i] := 1.0; i := 0; WHILE i < n-2 DO c[i] := c[i]/a[i]; a[i+1] := a[i+1] - c[i]*b[i]; INC(i) END ; - SolveTriDiag(a, b, c, d, n-1); SolveTriDiag(a, b, c, w, n-1); + SolveTriDiag(a, b, c, d, n-1); SolveTriDiag(a, b, c, w, n-1); d1 := (d[0] + d[i])/(w[0] + w[i] + x[i+1] - x[i]); i := 0; WHILE i < n-1 DO d[i] := d[i] - d1*w[i]; INC(i) END ; d[i] := d[0] @@ -582,7 +582,7 @@ END; END Spline; PROCEDURE Page*(nofcopies: INTEGER); - BEGIN + BEGIN curR := 0; curG := 0; curB := 0; curFont := -1; INC(pno); ppos := Files.Pos(bodyR); PrintCopies := nofcopies; IF PrintMode[1] # ":" THEN @@ -639,7 +639,7 @@ END; IF PrinterName # "none" THEN Files.Write(printR, 4X) (*force reset postscript*) END ; Files.Register(printF); IF PrinterName # "none" THEN - cmd := "lp -c -s "; + cmd := "lp -c -s "; IF PrinterName # "Pluto" THEN Append(cmd, "-d "); Append(cmd, PrinterName) END ; Append(cmd, " "); Append(cmd, printFileName); i := Platform.System(cmd); diff --git a/src/system/Platformunix.Mod b/src/system/Platformunix.Mod index f514c9cf..2a908c99 100644 --- a/src/system/Platformunix.Mod +++ b/src/system/Platformunix.Mod @@ -369,7 +369,7 @@ END Size; PROCEDURE -readfile (fd: LONGINT; p: SYSTEM.ADDRESS; l: LONGINT): LONGINT -"read(fd, (void*)(address)(p), l)"; +"(LONGINT)read(fd, (void*)(address)(p), l)"; PROCEDURE Read*(h: FileHandle; p: SYSTEM.ADDRESS; l: LONGINT; VAR n: LONGINT): ErrorCode; BEGIN @@ -388,7 +388,7 @@ END ReadBuf; PROCEDURE -writefile(fd: LONGINT; p: SYSTEM.ADDRESS; l: SYSTEM.ADDRESS): SYSTEM.ADDRESS "write(fd, (void*)(address)(p), l)"; -PROCEDURE Write*(h: FileHandle; p: SYSTEM.ADDRESS; l: SYSTEM.ADDRESS): ErrorCode; +PROCEDURE Write*(h: FileHandle; p: SYSTEM.ADDRESS; l: LONGINT): ErrorCode; VAR written: SYSTEM.ADDRESS; BEGIN written := writefile(h, p, l); diff --git a/src/system/Platformwindows.Mod b/src/system/Platformwindows.Mod index a81507d9..f91415c5 100644 --- a/src/system/Platformwindows.Mod +++ b/src/system/Platformwindows.Mod @@ -25,7 +25,7 @@ TYPE EnvPtr = POINTER TO ARRAY 1024 OF CHAR; ArgPtr = POINTER TO ARRAY 1024 OF CHAR; ArgVec = POINTER TO ARRAY 1024 OF ArgPtr; - ArgVecPtr = POINTER TO ARRAY 1 OF LONGINT; + ArgVecPtr = POINTER TO ARRAY 1 OF SYSTEM.ADDRESS; VAR @@ -412,31 +412,29 @@ BEGIN END Size; -PROCEDURE -readfile (fd: LONGINT; p: SYSTEM.ADDRESS; l: SYSTEM.ADDRESS; VAR n: SYSTEM.ADDRESS): INTEGER +PROCEDURE -readfile (fd: LONGINT; p: SYSTEM.ADDRESS; l: LONGINT; VAR n: SYSTEM.INT32): INTEGER "(INTEGER)ReadFile((HANDLE)fd, (void*)p, (DWORD)l, (DWORD*)n, 0)"; -PROCEDURE Read*(h: FileHandle; p: SYSTEM.ADDRESS; l: SYSTEM.ADDRESS; VAR n: SYSTEM.ADDRESS): ErrorCode; -VAR result: INTEGER; +PROCEDURE Read*(h: FileHandle; p: SYSTEM.ADDRESS; l: LONGINT; VAR n: LONGINT): ErrorCode; +VAR result: INTEGER; lengthread: SYSTEM.INT32; BEGIN - n := 0; (* Clear n because readfile takes a LONGINT but only updates the bottom 32 bits *) - result := readfile(h, p, l, n); - IF result = 0 THEN n := 0; RETURN err() ELSE RETURN 0 END + result := readfile(h, p, l, lengthread); + IF result = 0 THEN n := 0; RETURN err() ELSE n := lengthread; RETURN 0 END END Read; -PROCEDURE ReadBuf*(h: FileHandle; VAR b: ARRAY OF SYSTEM.BYTE; VAR n: SYSTEM.ADDRESS): ErrorCode; -VAR result: INTEGER; +PROCEDURE ReadBuf*(h: FileHandle; VAR b: ARRAY OF SYSTEM.BYTE; VAR n: LONGINT): ErrorCode; +VAR result: INTEGER; lengthread: SYSTEM.INT32; BEGIN - n := 0; (* Clear n because readfile takes a SYSTEM.ADDRESS but only updates the bottom 32 bits *) - result := readfile(h, SYSTEM.ADR(b), LEN(b), n); - IF result = 0 THEN n := 0; RETURN err() ELSE RETURN 0 END + result := readfile(h, SYSTEM.ADR(b), LEN(b), lengthread); + IF result = 0 THEN n := 0; RETURN err() ELSE n := lengthread; RETURN 0 END END ReadBuf; -PROCEDURE -writefile(fd: LONGINT; p: SYSTEM.ADDRESS; l: SYSTEM.ADDRESS): INTEGER +PROCEDURE -writefile(fd: LONGINT; p: SYSTEM.ADDRESS; l: LONGINT): INTEGER "(INTEGER)WriteFile((HANDLE)fd, (void*)(p), (DWORD)l, 0,0)"; -PROCEDURE Write*(h: FileHandle; p: LONGINT; l: LONGINT): ErrorCode; +PROCEDURE Write*(h: FileHandle; p: SYSTEM.ADDRESS; l: LONGINT): ErrorCode; BEGIN IF writefile(h, p, l) = 0 THEN RETURN err() ELSE RETURN 0 END END Write; diff --git a/src/tools/make/vishap.make b/src/tools/make/vishap.make index 260ca57c..b863944a 100644 --- a/src/tools/make/vishap.make +++ b/src/tools/make/vishap.make @@ -20,7 +20,7 @@ FLAVOUR = $(OS).$(DATAMODEL).$(COMPILER) BUILDDIR = build/$(FLAVOUR) VISHAP = $(ONAME)$(BINEXT) -#MODEL=-O2 # Override model - build everything as S8,I16,L32. +MODEL=-O2 # Override model - build everything as S8,I16,L32. From 8017aa445c8503388fa131a81d411c94ad85533f Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 23 Sep 2016 17:12:02 +0100 Subject: [PATCH 249/580] Beginning to simplify build process --- bootstrap/unix-44/OPM.c | 14 +++++++------- bootstrap/unix-44/OPM.h | 4 ++-- bootstrap/unix-48/OPM.c | 14 +++++++------- bootstrap/unix-48/OPM.h | 4 ++-- bootstrap/unix-88/OPM.c | 12 ++++++------ bootstrap/unix-88/OPM.h | 4 ++-- bootstrap/windows-48/OPM.c | 14 +++++++------- bootstrap/windows-48/OPM.h | 4 ++-- bootstrap/windows-88/OPM.c | 12 ++++++------ bootstrap/windows-88/OPM.h | 4 ++-- src/compiler/OPM.cmdln.Mod | 21 ++++++++++++--------- src/compiler/Vishap.Mod | 2 +- src/tools/make/configure.c | 4 ---- 13 files changed, 56 insertions(+), 57 deletions(-) diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 2769f708..8b1f6805 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -19,7 +19,7 @@ typedef static CHAR OPM_SourceFileName[256]; -export int16 OPM_Alignment, OPM_AddressSize, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; +export int16 OPM_AddressSize, OPM_Alignment, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; export int64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; @@ -28,8 +28,7 @@ export int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; export CHAR OPM_modName[32]; export CHAR OPM_objname[64]; export SET OPM_opt, OPM_glbopt; -static int32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber; -static int64 OPM_lasterrpos; +static int32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; static Texts_Reader OPM_inR; static Texts_Text OPM_Log; static Texts_Writer OPM_W; @@ -63,7 +62,7 @@ export void OPM_LogWNum (int64 i, int64 len); export void OPM_LogWStr (CHAR *s, LONGINT s__len); export int32 OPM_Longint (int64 n); static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len); -export void OPM_Mark (int16 n, int64 pos); +export void OPM_Mark (int16 n, int32 pos); export void OPM_NewSym (CHAR *modName, LONGINT modName__len); export void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); export void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); @@ -97,6 +96,7 @@ export void OPM_err (int16 n); static int32 OPM_minusop (int32 i); static int32 OPM_power0 (int32 i, int32 j); +#define OPM_GetAlignment(a) struct {char c; long long l;} s; *a = (char*)&s.l - (char*)&s void OPM_LogW (CHAR ch) { @@ -570,7 +570,7 @@ static void OPM_ShowLine (int64 pos) Files_Close(f); } -void OPM_Mark (int16 n, int64 pos) +void OPM_Mark (int16 n, int32 pos) { if (pos == -1) { pos = 0; @@ -1121,8 +1121,8 @@ export void *OPM__init(void) Strings_Append((CHAR*)"/opt/voc", 9, (void*)OPM_OBERON, 1024); Strings_Append((CHAR*)"/sym;", 6, (void*)OPM_OBERON, 1024); Files_SetSearchPath(OPM_OBERON, 1024); - OPM_AddressSize = 8; - OPM_Alignment = 8; + OPM_AddressSize = 4; + OPM_GetAlignment(&OPM_Alignment); OPM_ShortintSize = 1; OPM_IntegerSize = 2; OPM_LongintSize = 4; diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index a6b7990c..96af4022 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -6,7 +6,7 @@ #include "SYSTEM.h" -import int16 OPM_Alignment, OPM_AddressSize, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; +import int16 OPM_AddressSize, OPM_Alignment, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; import int64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; @@ -33,7 +33,7 @@ import void OPM_LogWLn (void); import void OPM_LogWNum (int64 i, int64 len); import void OPM_LogWStr (CHAR *s, LONGINT s__len); import int32 OPM_Longint (int64 n); -import void OPM_Mark (int16 n, int64 pos); +import void OPM_Mark (int16 n, int32 pos); import void OPM_NewSym (CHAR *modName, LONGINT modName__len); import void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); import void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 2769f708..8b1f6805 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -19,7 +19,7 @@ typedef static CHAR OPM_SourceFileName[256]; -export int16 OPM_Alignment, OPM_AddressSize, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; +export int16 OPM_AddressSize, OPM_Alignment, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; export int64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; @@ -28,8 +28,7 @@ export int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; export CHAR OPM_modName[32]; export CHAR OPM_objname[64]; export SET OPM_opt, OPM_glbopt; -static int32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber; -static int64 OPM_lasterrpos; +static int32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; static Texts_Reader OPM_inR; static Texts_Text OPM_Log; static Texts_Writer OPM_W; @@ -63,7 +62,7 @@ export void OPM_LogWNum (int64 i, int64 len); export void OPM_LogWStr (CHAR *s, LONGINT s__len); export int32 OPM_Longint (int64 n); static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len); -export void OPM_Mark (int16 n, int64 pos); +export void OPM_Mark (int16 n, int32 pos); export void OPM_NewSym (CHAR *modName, LONGINT modName__len); export void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); export void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); @@ -97,6 +96,7 @@ export void OPM_err (int16 n); static int32 OPM_minusop (int32 i); static int32 OPM_power0 (int32 i, int32 j); +#define OPM_GetAlignment(a) struct {char c; long long l;} s; *a = (char*)&s.l - (char*)&s void OPM_LogW (CHAR ch) { @@ -570,7 +570,7 @@ static void OPM_ShowLine (int64 pos) Files_Close(f); } -void OPM_Mark (int16 n, int64 pos) +void OPM_Mark (int16 n, int32 pos) { if (pos == -1) { pos = 0; @@ -1121,8 +1121,8 @@ export void *OPM__init(void) Strings_Append((CHAR*)"/opt/voc", 9, (void*)OPM_OBERON, 1024); Strings_Append((CHAR*)"/sym;", 6, (void*)OPM_OBERON, 1024); Files_SetSearchPath(OPM_OBERON, 1024); - OPM_AddressSize = 8; - OPM_Alignment = 8; + OPM_AddressSize = 4; + OPM_GetAlignment(&OPM_Alignment); OPM_ShortintSize = 1; OPM_IntegerSize = 2; OPM_LongintSize = 4; diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index a6b7990c..96af4022 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -6,7 +6,7 @@ #include "SYSTEM.h" -import int16 OPM_Alignment, OPM_AddressSize, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; +import int16 OPM_AddressSize, OPM_Alignment, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; import int64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; @@ -33,7 +33,7 @@ import void OPM_LogWLn (void); import void OPM_LogWNum (int64 i, int64 len); import void OPM_LogWStr (CHAR *s, LONGINT s__len); import int32 OPM_Longint (int64 n); -import void OPM_Mark (int16 n, int64 pos); +import void OPM_Mark (int16 n, int32 pos); import void OPM_NewSym (CHAR *modName, LONGINT modName__len); import void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); import void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 366d6522..931ecb18 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -19,7 +19,7 @@ typedef static CHAR OPM_SourceFileName[256]; -export int16 OPM_Alignment, OPM_AddressSize, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; +export int16 OPM_AddressSize, OPM_Alignment, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; export int64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; @@ -28,8 +28,7 @@ export int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; export CHAR OPM_modName[32]; export CHAR OPM_objname[64]; export SET OPM_opt, OPM_glbopt; -static int32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber; -static int64 OPM_lasterrpos; +static int32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; static Texts_Reader OPM_inR; static Texts_Text OPM_Log; static Texts_Writer OPM_W; @@ -63,7 +62,7 @@ export void OPM_LogWNum (int64 i, int64 len); export void OPM_LogWStr (CHAR *s, LONGINT s__len); export int32 OPM_Longint (int64 n); static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len); -export void OPM_Mark (int16 n, int64 pos); +export void OPM_Mark (int16 n, int32 pos); export void OPM_NewSym (CHAR *modName, LONGINT modName__len); export void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); export void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); @@ -97,6 +96,7 @@ export void OPM_err (int16 n); static int32 OPM_minusop (int32 i); static int32 OPM_power0 (int32 i, int32 j); +#define OPM_GetAlignment(a) struct {char c; long long l;} s; *a = (char*)&s.l - (char*)&s void OPM_LogW (CHAR ch) { @@ -570,7 +570,7 @@ static void OPM_ShowLine (int64 pos) Files_Close(f); } -void OPM_Mark (int16 n, int64 pos) +void OPM_Mark (int16 n, int32 pos) { if (pos == -1) { pos = 0; @@ -1122,7 +1122,7 @@ export void *OPM__init(void) Strings_Append((CHAR*)"/sym;", 6, (void*)OPM_OBERON, 1024); Files_SetSearchPath(OPM_OBERON, 1024); OPM_AddressSize = 8; - OPM_Alignment = 8; + OPM_GetAlignment(&OPM_Alignment); OPM_ShortintSize = 1; OPM_IntegerSize = 2; OPM_LongintSize = 4; diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index a6b7990c..96af4022 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -6,7 +6,7 @@ #include "SYSTEM.h" -import int16 OPM_Alignment, OPM_AddressSize, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; +import int16 OPM_AddressSize, OPM_Alignment, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; import int64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; @@ -33,7 +33,7 @@ import void OPM_LogWLn (void); import void OPM_LogWNum (int64 i, int64 len); import void OPM_LogWStr (CHAR *s, LONGINT s__len); import int32 OPM_Longint (int64 n); -import void OPM_Mark (int16 n, int64 pos); +import void OPM_Mark (int16 n, int32 pos); import void OPM_NewSym (CHAR *modName, LONGINT modName__len); import void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); import void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 2769f708..8b1f6805 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -19,7 +19,7 @@ typedef static CHAR OPM_SourceFileName[256]; -export int16 OPM_Alignment, OPM_AddressSize, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; +export int16 OPM_AddressSize, OPM_Alignment, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; export int64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; @@ -28,8 +28,7 @@ export int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; export CHAR OPM_modName[32]; export CHAR OPM_objname[64]; export SET OPM_opt, OPM_glbopt; -static int32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber; -static int64 OPM_lasterrpos; +static int32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; static Texts_Reader OPM_inR; static Texts_Text OPM_Log; static Texts_Writer OPM_W; @@ -63,7 +62,7 @@ export void OPM_LogWNum (int64 i, int64 len); export void OPM_LogWStr (CHAR *s, LONGINT s__len); export int32 OPM_Longint (int64 n); static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len); -export void OPM_Mark (int16 n, int64 pos); +export void OPM_Mark (int16 n, int32 pos); export void OPM_NewSym (CHAR *modName, LONGINT modName__len); export void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); export void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); @@ -97,6 +96,7 @@ export void OPM_err (int16 n); static int32 OPM_minusop (int32 i); static int32 OPM_power0 (int32 i, int32 j); +#define OPM_GetAlignment(a) struct {char c; long long l;} s; *a = (char*)&s.l - (char*)&s void OPM_LogW (CHAR ch) { @@ -570,7 +570,7 @@ static void OPM_ShowLine (int64 pos) Files_Close(f); } -void OPM_Mark (int16 n, int64 pos) +void OPM_Mark (int16 n, int32 pos) { if (pos == -1) { pos = 0; @@ -1121,8 +1121,8 @@ export void *OPM__init(void) Strings_Append((CHAR*)"/opt/voc", 9, (void*)OPM_OBERON, 1024); Strings_Append((CHAR*)"/sym;", 6, (void*)OPM_OBERON, 1024); Files_SetSearchPath(OPM_OBERON, 1024); - OPM_AddressSize = 8; - OPM_Alignment = 8; + OPM_AddressSize = 4; + OPM_GetAlignment(&OPM_Alignment); OPM_ShortintSize = 1; OPM_IntegerSize = 2; OPM_LongintSize = 4; diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index a6b7990c..96af4022 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -6,7 +6,7 @@ #include "SYSTEM.h" -import int16 OPM_Alignment, OPM_AddressSize, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; +import int16 OPM_AddressSize, OPM_Alignment, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; import int64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; @@ -33,7 +33,7 @@ import void OPM_LogWLn (void); import void OPM_LogWNum (int64 i, int64 len); import void OPM_LogWStr (CHAR *s, LONGINT s__len); import int32 OPM_Longint (int64 n); -import void OPM_Mark (int16 n, int64 pos); +import void OPM_Mark (int16 n, int32 pos); import void OPM_NewSym (CHAR *modName, LONGINT modName__len); import void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); import void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 366d6522..931ecb18 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -19,7 +19,7 @@ typedef static CHAR OPM_SourceFileName[256]; -export int16 OPM_Alignment, OPM_AddressSize, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; +export int16 OPM_AddressSize, OPM_Alignment, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; export int64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; @@ -28,8 +28,7 @@ export int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; export CHAR OPM_modName[32]; export CHAR OPM_objname[64]; export SET OPM_opt, OPM_glbopt; -static int32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber; -static int64 OPM_lasterrpos; +static int32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; static Texts_Reader OPM_inR; static Texts_Text OPM_Log; static Texts_Writer OPM_W; @@ -63,7 +62,7 @@ export void OPM_LogWNum (int64 i, int64 len); export void OPM_LogWStr (CHAR *s, LONGINT s__len); export int32 OPM_Longint (int64 n); static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len); -export void OPM_Mark (int16 n, int64 pos); +export void OPM_Mark (int16 n, int32 pos); export void OPM_NewSym (CHAR *modName, LONGINT modName__len); export void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); export void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); @@ -97,6 +96,7 @@ export void OPM_err (int16 n); static int32 OPM_minusop (int32 i); static int32 OPM_power0 (int32 i, int32 j); +#define OPM_GetAlignment(a) struct {char c; long long l;} s; *a = (char*)&s.l - (char*)&s void OPM_LogW (CHAR ch) { @@ -570,7 +570,7 @@ static void OPM_ShowLine (int64 pos) Files_Close(f); } -void OPM_Mark (int16 n, int64 pos) +void OPM_Mark (int16 n, int32 pos) { if (pos == -1) { pos = 0; @@ -1122,7 +1122,7 @@ export void *OPM__init(void) Strings_Append((CHAR*)"/sym;", 6, (void*)OPM_OBERON, 1024); Files_SetSearchPath(OPM_OBERON, 1024); OPM_AddressSize = 8; - OPM_Alignment = 8; + OPM_GetAlignment(&OPM_Alignment); OPM_ShortintSize = 1; OPM_IntegerSize = 2; OPM_LongintSize = 4; diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index a6b7990c..96af4022 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -6,7 +6,7 @@ #include "SYSTEM.h" -import int16 OPM_Alignment, OPM_AddressSize, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; +import int16 OPM_AddressSize, OPM_Alignment, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; import int64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; @@ -33,7 +33,7 @@ import void OPM_LogWLn (void); import void OPM_LogWNum (int64 i, int64 len); import void OPM_LogWStr (CHAR *s, LONGINT s__len); import int32 OPM_Longint (int64 n); -import void OPM_Mark (int16 n, int64 pos); +import void OPM_Mark (int16 n, int32 pos); import void OPM_NewSym (CHAR *modName, LONGINT modName__len); import void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); import void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); diff --git a/src/compiler/OPM.cmdln.Mod b/src/compiler/OPM.cmdln.Mod index ded87d02..e954ea63 100644 --- a/src/compiler/OPM.cmdln.Mod +++ b/src/compiler/OPM.cmdln.Mod @@ -67,7 +67,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) BodyFile* = 1; HeaderInclude* = 2; - (* C default expression integral size details. Const for now, will be var with avr_gcc/sdcc support *) + (* C default expression integral size details. Const for now, should be var for avr_gcc/sdcc support *) CIntSize* = 4; CIntMax* = 7FFFFFFFH; CIntMin* = -CIntMax - 1; @@ -88,12 +88,11 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) SourceFileName : ARRAY 256 OF CHAR; (* Parameter selectable sizes *) - Alignment*, - AddressSize*, SetSize*, + AddressSize*, Alignment*, + SetSize*, ShortintSize*, IntegerSize*, LongintSize*: INTEGER; MaxSet*: INTEGER; - MaxIndex*: SYSTEM.INT64; MinReal*, MaxReal*, MinLReal*, MaxLReal*: LONGREAL; @@ -110,7 +109,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) ErrorLineStartPos, ErrorLineLimitPos, ErrorLineNumber: LONGINT; (* Limit = start of next line *) - lasterrpos: SYSTEM.INT64; + lasterrpos: LONGINT; inR: Texts.Reader; Log: Texts.Text; W: Texts.Writer; @@ -479,7 +478,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) END ShowLine; - PROCEDURE Mark*(n: INTEGER; pos: SYSTEM.INT64); + PROCEDURE Mark*(n: INTEGER; pos: LONGINT); BEGIN IF pos = -1 THEN pos := 0 END; IF n >= 0 THEN @@ -853,6 +852,10 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) END CloseFiles; + + +PROCEDURE -GetAlignment(VAR a: INTEGER) "struct {char c; long long l;} s; *a = (char*)&s.l - (char*)&s"; + BEGIN Texts.OpenWriter(W); @@ -867,9 +870,9 @@ BEGIN Files.SetSearchPath(OBERON); - (* type sizes with configuration based defaults *) - AddressSize := Configuration.addressSize; - Alignment := Configuration.alignment; + (* Default address size and alignment are those of this compiler *) + AddressSize := SIZE(SYSTEM.ADDRESS); + GetAlignment(Alignment); (* Default type size model is that of the original Oberon-2 implementation (-O2) *) ShortintSize := 1; diff --git a/src/compiler/Vishap.Mod b/src/compiler/Vishap.Mod index b6ca8bf2..a898c9a4 100644 --- a/src/compiler/Vishap.Mod +++ b/src/compiler/Vishap.Mod @@ -96,7 +96,7 @@ MODULE Vishap; (* J. Templ 3.2.95 *) extTools.Assemble(OPM.modName) ELSE IF ~(OPM.mainprog IN OPM.opt) THEN - (* Assemble non main rogram and add object name to link list *) + (* Assemble non main program and add object name to link list *) extTools.Assemble(OPM.modName); Strings.Append(" ", modulesobj); Strings.Append(OPM.modName, modulesobj); diff --git a/src/tools/make/configure.c b/src/tools/make/configure.c index c000b68b..936c71bb 100644 --- a/src/tools/make/configure.c +++ b/src/tools/make/configure.c @@ -401,15 +401,11 @@ void writeConfigurationMod() { fprintf(fd, "MODULE Configuration;\n"); fprintf(fd, "CONST\n"); fprintf(fd, " name* = '%s';\n", oname); - fprintf(fd, " intsize* = %d;\n", intsize); - fprintf(fd, " addressSize* = %d;\n", addressSize); - fprintf(fd, " alignment* = %d;\n", alignment); fprintf(fd, " objext* = '%s';\n", objext); fprintf(fd, " objflag* = '%s';\n", objflag); fprintf(fd, " linkflags* = '%s';\n", linkflags); fprintf(fd, " libspec* = '%s';\n", libspec); fprintf(fd, " compile* = '%s';\n", cc); - fprintf(fd, " dataModel* = '%s';\n", dataModel); fprintf(fd, " installdir* = '%s';\n", installdir); fprintf(fd, " staticLink* = '%s';\n", staticlink); fprintf(fd, "VAR\n"); From fb002de0dd35fd69a44d13670b21e40efaadad3c Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 23 Sep 2016 19:04:26 +0100 Subject: [PATCH 250/580] Move alignment and type size code from OPC to OPT. Remove search path in bootstrap compiler. --- bootstrap/unix-44/Configuration.c | 6 +- bootstrap/unix-44/Configuration.h | 4 +- bootstrap/unix-44/Console.c | 2 +- bootstrap/unix-44/Console.h | 2 +- bootstrap/unix-44/Files.c | 2 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 2 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 5 +- bootstrap/unix-44/OPB.h | 3 +- bootstrap/unix-44/OPC.c | 188 +++++++++--------------- bootstrap/unix-44/OPC.h | 5 +- bootstrap/unix-44/OPM.c | 7 +- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 207 ++++++++++++++++++++++----- bootstrap/unix-44/OPT.h | 8 +- bootstrap/unix-44/OPV.c | 88 +----------- bootstrap/unix-44/OPV.h | 3 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/Vishap.c | 5 +- bootstrap/unix-44/errors.c | 2 +- bootstrap/unix-44/errors.h | 2 +- bootstrap/unix-44/extTools.c | 6 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-44/vt100.c | 2 +- bootstrap/unix-44/vt100.h | 2 +- bootstrap/unix-48/Configuration.c | 6 +- bootstrap/unix-48/Configuration.h | 4 +- bootstrap/unix-48/Console.c | 2 +- bootstrap/unix-48/Console.h | 2 +- bootstrap/unix-48/Files.c | 2 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 2 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 5 +- bootstrap/unix-48/OPB.h | 3 +- bootstrap/unix-48/OPC.c | 188 +++++++++--------------- bootstrap/unix-48/OPC.h | 5 +- bootstrap/unix-48/OPM.c | 7 +- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 207 ++++++++++++++++++++++----- bootstrap/unix-48/OPT.h | 8 +- bootstrap/unix-48/OPV.c | 88 +----------- bootstrap/unix-48/OPV.h | 3 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/Vishap.c | 5 +- bootstrap/unix-48/errors.c | 2 +- bootstrap/unix-48/errors.h | 2 +- bootstrap/unix-48/extTools.c | 6 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-48/vt100.c | 2 +- bootstrap/unix-48/vt100.h | 2 +- bootstrap/unix-88/Configuration.c | 6 +- bootstrap/unix-88/Configuration.h | 4 +- bootstrap/unix-88/Console.c | 2 +- bootstrap/unix-88/Console.h | 2 +- bootstrap/unix-88/Files.c | 2 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 2 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 5 +- bootstrap/unix-88/OPB.h | 3 +- bootstrap/unix-88/OPC.c | 188 +++++++++--------------- bootstrap/unix-88/OPC.h | 5 +- bootstrap/unix-88/OPM.c | 7 +- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 207 ++++++++++++++++++++++----- bootstrap/unix-88/OPT.h | 8 +- bootstrap/unix-88/OPV.c | 88 +----------- bootstrap/unix-88/OPV.h | 3 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/Vishap.c | 5 +- bootstrap/unix-88/errors.c | 2 +- bootstrap/unix-88/errors.h | 2 +- bootstrap/unix-88/extTools.c | 6 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/unix-88/vt100.c | 2 +- bootstrap/unix-88/vt100.h | 2 +- bootstrap/windows-48/Configuration.c | 6 +- bootstrap/windows-48/Configuration.h | 4 +- bootstrap/windows-48/Console.c | 2 +- bootstrap/windows-48/Console.h | 2 +- bootstrap/windows-48/Files.c | 2 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 2 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 5 +- bootstrap/windows-48/OPB.h | 3 +- bootstrap/windows-48/OPC.c | 188 +++++++++--------------- bootstrap/windows-48/OPC.h | 5 +- bootstrap/windows-48/OPM.c | 7 +- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 207 ++++++++++++++++++++++----- bootstrap/windows-48/OPT.h | 8 +- bootstrap/windows-48/OPV.c | 88 +----------- bootstrap/windows-48/OPV.h | 3 +- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/Vishap.c | 5 +- bootstrap/windows-48/errors.c | 2 +- bootstrap/windows-48/errors.h | 2 +- bootstrap/windows-48/extTools.c | 6 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-48/vt100.c | 2 +- bootstrap/windows-48/vt100.h | 2 +- bootstrap/windows-88/Configuration.c | 6 +- bootstrap/windows-88/Configuration.h | 4 +- bootstrap/windows-88/Console.c | 2 +- bootstrap/windows-88/Console.h | 2 +- bootstrap/windows-88/Files.c | 2 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 2 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 5 +- bootstrap/windows-88/OPB.h | 3 +- bootstrap/windows-88/OPC.c | 188 +++++++++--------------- bootstrap/windows-88/OPC.h | 5 +- bootstrap/windows-88/OPM.c | 7 +- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 207 ++++++++++++++++++++++----- bootstrap/windows-88/OPT.h | 8 +- bootstrap/windows-88/OPV.c | 88 +----------- bootstrap/windows-88/OPV.h | 3 +- bootstrap/windows-88/Platform.c | 2 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/Vishap.c | 5 +- bootstrap/windows-88/errors.c | 2 +- bootstrap/windows-88/errors.h | 2 +- bootstrap/windows-88/extTools.c | 6 +- bootstrap/windows-88/extTools.h | 2 +- bootstrap/windows-88/vt100.c | 2 +- bootstrap/windows-88/vt100.h | 2 +- makefile | 12 +- src/compiler/OPB.Mod | 3 +- src/compiler/OPC.Mod | 46 +----- src/compiler/OPT.Mod | 98 ++++++++++++- src/compiler/OPV.Mod | 56 +------- src/compiler/Vishap.Mod | 3 +- src/tools/make/configure.c | 65 +++++---- 202 files changed, 1628 insertions(+), 1590 deletions(-) diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index abdf151b..7f7f4b26 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -7,7 +7,7 @@ #include "SYSTEM.h" -export CHAR Configuration_versionLong[41]; +export CHAR Configuration_versionLong[75]; @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/23] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index f51f63f2..618bc77f 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h @@ -6,7 +6,7 @@ #include "SYSTEM.h" -import CHAR Configuration_versionLong[41]; +import CHAR Configuration_versionLong[75]; import void *Configuration__init(void); diff --git a/bootstrap/unix-44/Console.c b/bootstrap/unix-44/Console.c index 115e60f5..f9e5e585 100644 --- a/bootstrap/unix-44/Console.c +++ b/bootstrap/unix-44/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Console.h b/bootstrap/unix-44/Console.h index b08c93ea..d645f05c 100644 --- a/bootstrap/unix-44/Console.h +++ b/bootstrap/unix-44/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 0a7ac692..ad002606 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index e2b7a3bb..0518133f 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index b7c8c827..905fcb24 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tsSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index 6ad4813e..3ea975a7 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tsSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index 7704f005..21d62e05 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index 060208c6..d2d0a476 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index e09bf1b4..6c15aa17 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -10,7 +10,6 @@ #include "OPT.h" -export void (*OPB_typSize)(OPT_Struct); static int16 OPB_exp; static int64 OPB_maxExp; @@ -1917,7 +1916,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) OPB_err(110); x = OPB_NewIntConst(1); } else if (__IN(f, 0x18fe, 32) || __IN(x->typ->comp, 0x14, 32)) { - (*OPB_typSize)(x->typ); + OPT_TypSize(x->typ); x->typ->pvused = 1; x = OPB_NewIntConst(x->typ->size); } else { diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index dc0085af..8395741b 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h @@ -8,7 +8,6 @@ #include "OPT.h" -import void (*OPB_typSize)(OPT_Struct); import void OPB_Assign (OPT_Node *x, OPT_Node y); diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 99353400..9104c5c4 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -17,10 +17,8 @@ static BOOLEAN OPC_GlbPtrs; static CHAR OPC_BodyNameExt[13]; -export void OPC_Align (int32 *adr, int32 base); export void OPC_Andent (OPT_Struct typ); static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames); -export int32 OPC_BaseAlignment (OPT_Struct typ); export OPT_Object OPC_BaseTProc (OPT_Object obj); export void OPC_BegBlk (void); export void OPC_BegStat (void); @@ -79,7 +77,6 @@ static void OPC_PutBase (OPT_Struct typ); static void OPC_PutPtrOffsets (OPT_Struct typ, int32 adr, int32 *cnt); static void OPC_RegCmds (OPT_Object obj); export void OPC_SetInclude (BOOLEAN exclude); -export int32 OPC_SizeAlignment (int32 size); static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause); static void OPC_Str1 (CHAR *s, LONGINT s__len, int32 x); static void OPC_StringLiteral (CHAR *s, LONGINT s__len, int32 l); @@ -750,7 +747,7 @@ static void OPC_CProcDefs (OPT_Object obj, int16 vis) { int16 i; OPT_ConstExt ext = NIL; - int16 _for__9; + int16 _for__7; if (obj != NIL) { OPC_CProcDefs(obj->left, vis); if ((((obj->mode == 9 && (int16)obj->vis >= vis)) && obj->adr == 1)) { @@ -762,9 +759,9 @@ static void OPC_CProcDefs (OPT_Object obj, int16 vis) OPC_DeclareParams(obj->link, 1); OPM_Write(0x09); } - _for__9 = (int16)(*obj->conval->ext)[0]; + _for__7 = (int16)(*obj->conval->ext)[0]; i = i; - while (i <= _for__9) { + while (i <= _for__7) { OPM_Write((*obj->conval->ext)[__X(i, 256)]); i += 1; } @@ -843,64 +840,11 @@ void OPC_InitTDesc (OPT_Struct typ) } } -void OPC_Align (int32 *adr, int32 base) -{ - switch (base) { - case 2: - *adr += __MASK(*adr, -2); - break; - case 4: - *adr += __MASK(-*adr, -4); - break; - case 8: - *adr += __MASK(-*adr, -8); - break; - case 16: - *adr += __MASK(-*adr, -16); - break; - default: - break; - } -} - -int32 OPC_SizeAlignment (int32 size) -{ - int32 _o_result; - int32 alignment; - if (size < OPM_Alignment) { - alignment = 1; - while (alignment < size) { - alignment = __ASHL(alignment, 1); - } - } else { - alignment = OPM_Alignment; - } - _o_result = alignment; - return _o_result; -} - -int32 OPC_BaseAlignment (OPT_Struct typ) -{ - int32 _o_result; - int32 alignment; - if (typ->form == 13) { - if (typ->comp == 4) { - alignment = __MASK(typ->align, -65536); - } else { - alignment = OPC_BaseAlignment(typ->BaseTyp); - } - } else { - alignment = OPC_SizeAlignment(typ->size); - } - _o_result = alignment; - return _o_result; -} - static void OPC_FillGap (int32 gap, int32 off, int32 align, int32 *n, int32 *curAlign) { int32 adr; adr = off; - OPC_Align(&adr, align); + OPT_Align(&adr, align); if ((*curAlign < align && gap - (adr - off) >= align)) { gap -= (adr - off) + align; OPC_BegStat(); @@ -955,8 +899,8 @@ static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, int32 *off, int32 *n, i } } else { adr = *off; - fldAlign = OPC_BaseAlignment(fld->typ); - OPC_Align(&adr, fldAlign); + fldAlign = OPT_BaseAlignment(fld->typ); + OPT_Align(&adr, fldAlign); gap = fld->adr - adr; if (fldAlign > *curAlign) { *curAlign = fldAlign; @@ -1205,7 +1149,7 @@ static void OPC_GenHeaderMsg (void) OPM_WriteString((CHAR*)"/* ", 4); OPM_WriteString((CHAR*)"voc", 4); OPM_Write(' '); - OPM_WriteString(Configuration_versionLong, 41); + OPM_WriteString(Configuration_versionLong, 75); OPM_Write(' '); i = 0; while (i <= 31) { @@ -1966,84 +1910,84 @@ void OPC_Constant (OPT_Const con, int16 form) } } -static struct InitKeywords__48 { +static struct InitKeywords__46 { int8 *n; - struct InitKeywords__48 *lnk; -} *InitKeywords__48_s; + struct InitKeywords__46 *lnk; +} *InitKeywords__46_s; -static void Enter__49 (CHAR *s, LONGINT s__len); +static void Enter__47 (CHAR *s, LONGINT s__len); -static void Enter__49 (CHAR *s, LONGINT s__len) +static void Enter__47 (CHAR *s, LONGINT s__len) { int16 h; __DUP(s, s__len, CHAR); h = OPC_PerfectHash((void*)s, s__len); - OPC_hashtab[__X(h, 105)] = *InitKeywords__48_s->n; - __COPY(s, OPC_keytab[__X(*InitKeywords__48_s->n, 50)], 9); - *InitKeywords__48_s->n += 1; + OPC_hashtab[__X(h, 105)] = *InitKeywords__46_s->n; + __COPY(s, OPC_keytab[__X(*InitKeywords__46_s->n, 50)], 9); + *InitKeywords__46_s->n += 1; __DEL(s); } static void OPC_InitKeywords (void) { int8 n, i; - struct InitKeywords__48 _s; + struct InitKeywords__46 _s; _s.n = &n; - _s.lnk = InitKeywords__48_s; - InitKeywords__48_s = &_s; + _s.lnk = InitKeywords__46_s; + InitKeywords__46_s = &_s; n = 0; i = 0; while (i <= 104) { OPC_hashtab[__X(i, 105)] = -1; i += 1; } - Enter__49((CHAR*)"address", 8); - Enter__49((CHAR*)"asm", 4); - Enter__49((CHAR*)"auto", 5); - Enter__49((CHAR*)"break", 6); - Enter__49((CHAR*)"case", 5); - Enter__49((CHAR*)"char", 5); - Enter__49((CHAR*)"const", 6); - Enter__49((CHAR*)"continue", 9); - Enter__49((CHAR*)"default", 8); - Enter__49((CHAR*)"do", 3); - Enter__49((CHAR*)"double", 7); - Enter__49((CHAR*)"else", 5); - Enter__49((CHAR*)"enum", 5); - Enter__49((CHAR*)"extern", 7); - Enter__49((CHAR*)"export", 7); - Enter__49((CHAR*)"float", 6); - Enter__49((CHAR*)"for", 4); - Enter__49((CHAR*)"fortran", 8); - Enter__49((CHAR*)"goto", 5); - Enter__49((CHAR*)"if", 3); - Enter__49((CHAR*)"import", 7); - Enter__49((CHAR*)"int", 4); - Enter__49((CHAR*)"int16", 6); - Enter__49((CHAR*)"int32", 6); - Enter__49((CHAR*)"int64", 6); - Enter__49((CHAR*)"int8", 5); - Enter__49((CHAR*)"long", 5); - Enter__49((CHAR*)"register", 9); - Enter__49((CHAR*)"return", 7); - Enter__49((CHAR*)"short", 6); - Enter__49((CHAR*)"signed", 7); - Enter__49((CHAR*)"sizeof", 7); - Enter__49((CHAR*)"size_t", 7); - Enter__49((CHAR*)"static", 7); - Enter__49((CHAR*)"struct", 7); - Enter__49((CHAR*)"switch", 7); - Enter__49((CHAR*)"typedef", 8); - Enter__49((CHAR*)"uint16", 7); - Enter__49((CHAR*)"uint32", 7); - Enter__49((CHAR*)"uint64", 7); - Enter__49((CHAR*)"uint8", 6); - Enter__49((CHAR*)"union", 6); - Enter__49((CHAR*)"unsigned", 9); - Enter__49((CHAR*)"void", 5); - Enter__49((CHAR*)"volatile", 9); - Enter__49((CHAR*)"while", 6); - InitKeywords__48_s = _s.lnk; + Enter__47((CHAR*)"address", 8); + Enter__47((CHAR*)"asm", 4); + Enter__47((CHAR*)"auto", 5); + Enter__47((CHAR*)"break", 6); + Enter__47((CHAR*)"case", 5); + Enter__47((CHAR*)"char", 5); + Enter__47((CHAR*)"const", 6); + Enter__47((CHAR*)"continue", 9); + Enter__47((CHAR*)"default", 8); + Enter__47((CHAR*)"do", 3); + Enter__47((CHAR*)"double", 7); + Enter__47((CHAR*)"else", 5); + Enter__47((CHAR*)"enum", 5); + Enter__47((CHAR*)"extern", 7); + Enter__47((CHAR*)"export", 7); + Enter__47((CHAR*)"float", 6); + Enter__47((CHAR*)"for", 4); + Enter__47((CHAR*)"fortran", 8); + Enter__47((CHAR*)"goto", 5); + Enter__47((CHAR*)"if", 3); + Enter__47((CHAR*)"import", 7); + Enter__47((CHAR*)"int", 4); + Enter__47((CHAR*)"int16", 6); + Enter__47((CHAR*)"int32", 6); + Enter__47((CHAR*)"int64", 6); + Enter__47((CHAR*)"int8", 5); + Enter__47((CHAR*)"long", 5); + Enter__47((CHAR*)"register", 9); + Enter__47((CHAR*)"return", 7); + Enter__47((CHAR*)"short", 6); + Enter__47((CHAR*)"signed", 7); + Enter__47((CHAR*)"sizeof", 7); + Enter__47((CHAR*)"size_t", 7); + Enter__47((CHAR*)"static", 7); + Enter__47((CHAR*)"struct", 7); + Enter__47((CHAR*)"switch", 7); + Enter__47((CHAR*)"typedef", 8); + Enter__47((CHAR*)"uint16", 7); + Enter__47((CHAR*)"uint32", 7); + Enter__47((CHAR*)"uint64", 7); + Enter__47((CHAR*)"uint8", 6); + Enter__47((CHAR*)"union", 6); + Enter__47((CHAR*)"unsigned", 9); + Enter__47((CHAR*)"void", 5); + Enter__47((CHAR*)"volatile", 9); + Enter__47((CHAR*)"while", 6); + InitKeywords__46_s = _s.lnk; } diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index 4215947f..6236cd73 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h @@ -9,9 +9,7 @@ -import void OPC_Align (int32 *adr, int32 base); import void OPC_Andent (OPT_Struct typ); -import int32 OPC_BaseAlignment (OPT_Struct typ); import OPT_Object OPC_BaseTProc (OPT_Object obj); import void OPC_BegBlk (void); import void OPC_BegStat (void); @@ -41,7 +39,6 @@ import void OPC_IntLiteral (int64 n, int32 size); import void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim); import int32 OPC_NofPtrs (OPT_Struct typ); import void OPC_SetInclude (BOOLEAN exclude); -import int32 OPC_SizeAlignment (int32 size); import void OPC_TDescDecl (OPT_Struct typ); import void OPC_TypeDefs (OPT_Object obj, int16 vis); import void OPC_TypeOf (OPT_Object ap); diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 8b1f6805..9297c0a3 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -223,6 +223,7 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) OPM_AddressSize = (int16)s[__X(i + 1, s__len)] - 48; OPM_Alignment = (int16)s[__X(i + 2, s__len)] - 48; i += 2; + Files_SetSearchPath((CHAR*)"", 1); } break; case 'B': @@ -270,7 +271,7 @@ BOOLEAN OPM_OpenPar (void) if (Platform_ArgCount == 1) { OPM_LogWLn(); OPM_LogWStr((CHAR*)"Oberon-2 compiler v", 20); - OPM_LogWStr(Configuration_versionLong, 41); + OPM_LogWStr(Configuration_versionLong, 75); OPM_LogW('.'); OPM_LogWLn(); OPM_LogWStr((CHAR*)"Based on Ofront by Software Templ OEG.", 39); @@ -1118,7 +1119,7 @@ export void *OPM__init(void) Strings_Append((CHAR*)";.;", 4, (void*)OPM_OBERON, 1024); Strings_Append(OPM_MODULES, 1024, (void*)OPM_OBERON, 1024); Strings_Append((CHAR*)";", 2, (void*)OPM_OBERON, 1024); - Strings_Append((CHAR*)"/opt/voc", 9, (void*)OPM_OBERON, 1024); + Strings_Append((CHAR*)"", 1, (void*)OPM_OBERON, 1024); Strings_Append((CHAR*)"/sym;", 6, (void*)OPM_OBERON, 1024); Files_SetSearchPath(OPM_OBERON, 1024); OPM_AddressSize = 4; diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index 96af4022..b62666db 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index a3ab1dd3..66b821d2 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index e5a59f6c..ea6663ba 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index 0cac83bd..2b449cae 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index caef45f4..8d90d974 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index 8e7d9b8d..7405b27f 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -87,7 +87,6 @@ typedef } OPT_StrDesc; -export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; export OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj; @@ -100,6 +99,7 @@ static OPT_ImpCtxt OPT_impCtxt; static OPT_ExpCtxt OPT_expCtxt; static int32 OPT_nofhdfld; static BOOLEAN OPT_newsf, OPT_findpc, OPT_extsf, OPT_sfpresent, OPT_symExtended, OPT_symNew; +static int32 OPT_recno; export address *OPT_ConstDesc__typ; export address *OPT_ObjDesc__typ; @@ -108,6 +108,8 @@ export address *OPT_NodeDesc__typ; export address *OPT_ImpCtxt__typ; export address *OPT_ExpCtxt__typ; +export void OPT_Align (int32 *adr, int32 base); +export int32 OPT_BaseAlignment (OPT_Struct typ); export void OPT_Close (void); export void OPT_CloseScope (void); static void OPT_DebugStruct (OPT_Struct btyp); @@ -136,6 +138,7 @@ static void OPT_InStruct (OPT_Struct *typ); static OPT_Object OPT_InTProc (int8 mno); static OPT_Struct OPT_InTyp (int32 tag); export void OPT_Init (OPS_Name name, SET opt); +export void OPT_InitRecno (void); static void OPT_InitStruct (OPT_Struct *typ, int8 form); export void OPT_Insert (OPS_Name name, OPT_Object *obj); export void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); @@ -157,9 +160,16 @@ static void OPT_OutSign (OPT_Struct result, OPT_Object par); static void OPT_OutStr (OPT_Struct typ); static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj); export OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir); +export int32 OPT_SizeAlignment (int32 size); +export void OPT_TypSize (OPT_Struct typ); static void OPT_err (int16 n); +void OPT_InitRecno (void) +{ + OPT_recno = 0; +} + static void OPT_err (int16 n) { OPM_err(n); @@ -240,6 +250,130 @@ OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir) __RETCHK; } +void OPT_Align (int32 *adr, int32 base) +{ + switch (base) { + case 2: + *adr += __MASK(*adr, -2); + break; + case 4: + *adr += __MASK(-*adr, -4); + break; + case 8: + *adr += __MASK(-*adr, -8); + break; + case 16: + *adr += __MASK(-*adr, -16); + break; + default: + break; + } +} + +int32 OPT_SizeAlignment (int32 size) +{ + int32 _o_result; + int32 alignment; + if (size < OPM_Alignment) { + alignment = 1; + while (alignment < size) { + alignment = __ASHL(alignment, 1); + } + } else { + alignment = OPM_Alignment; + } + _o_result = alignment; + return _o_result; +} + +int32 OPT_BaseAlignment (OPT_Struct typ) +{ + int32 _o_result; + int32 alignment; + if (typ->form == 13) { + if (typ->comp == 4) { + alignment = __MASK(typ->align, -65536); + } else { + alignment = OPT_BaseAlignment(typ->BaseTyp); + } + } else { + alignment = OPT_SizeAlignment(typ->size); + } + _o_result = alignment; + return _o_result; +} + +void OPT_TypSize (OPT_Struct typ) +{ + int16 f, c; + int32 offset, size, base, fbase, off0; + OPT_Object fld = NIL; + OPT_Struct btyp = NIL; + if (typ == OPT_undftyp) { + OPM_err(58); + } else if (typ->size == -1) { + f = typ->form; + c = typ->comp; + if (c == 4) { + btyp = typ->BaseTyp; + if (btyp == NIL) { + offset = 0; + base = 1; + } else { + OPT_TypSize(btyp); + offset = btyp->size - __ASHR(btyp->sysflag, 8); + base = btyp->align; + } + fld = typ->link; + while ((fld != NIL && fld->mode == 4)) { + btyp = fld->typ; + OPT_TypSize(btyp); + size = btyp->size; + fbase = OPT_BaseAlignment(btyp); + OPT_Align(&offset, fbase); + fld->adr = offset; + offset += size; + if (fbase > base) { + base = fbase; + } + fld = fld->link; + } + off0 = offset; + if (offset == 0) { + offset = 1; + } + OPT_Align(&offset, base); + if ((typ->strobj == NIL && __MASK(typ->align, -65536) == 0)) { + OPT_recno += 1; + base += __ASHL(OPT_recno, 16); + } + typ->size = offset; + typ->align = base; + typ->sysflag = __MASK(typ->sysflag, -256) + (int16)__ASHL(offset - off0, 8); + } else if (c == 2) { + OPT_TypSize(typ->BaseTyp); + typ->size = typ->n * typ->BaseTyp->size; + } else if (f == 11) { + typ->size = OPM_AddressSize; + if (typ->BaseTyp == OPT_undftyp) { + OPM_Mark(128, typ->n); + } else { + OPT_TypSize(typ->BaseTyp); + } + } else if (f == 12) { + typ->size = OPM_AddressSize; + } else if (c == 3) { + btyp = typ->BaseTyp; + OPT_TypSize(btyp); + if (btyp->comp == 3) { + typ->size = btyp->size + 4; + } else { + typ->size = 8; + } + } + } +} + OPT_Const OPT_NewConst (void) { OPT_Const _o_result; @@ -552,21 +686,21 @@ void OPT_IdFPrint (OPT_Struct typ) } } -static struct FPrintStr__13 { +static struct FPrintStr__15 { int32 *pbfp, *pvfp; - struct FPrintStr__13 *lnk; -} *FPrintStr__13_s; + struct FPrintStr__15 *lnk; +} *FPrintStr__15_s; -static void FPrintFlds__14 (OPT_Object fld, int32 adr, BOOLEAN visible); -static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, int32 adr); -static void FPrintTProcs__18 (OPT_Object obj); +static void FPrintFlds__16 (OPT_Object fld, int32 adr, BOOLEAN visible); +static void FPrintHdFld__18 (OPT_Struct typ, OPT_Object fld, int32 adr); +static void FPrintTProcs__20 (OPT_Object obj); -static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, int32 adr) +static void FPrintHdFld__18 (OPT_Struct typ, OPT_Object fld, int32 adr) { int32 i, j, n; OPT_Struct btyp = NIL; if (typ->comp == 4) { - FPrintFlds__14(typ->link, adr, 0); + FPrintFlds__16(typ->link, adr, 0); } else if (typ->comp == 2) { btyp = typ->BaseTyp; n = typ->n; @@ -576,53 +710,53 @@ static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, int32 adr) } if (btyp->form == 11 || btyp->comp == 4) { j = OPT_nofhdfld; - FPrintHdFld__16(btyp, fld, adr); + FPrintHdFld__18(btyp, fld, adr); if (j != OPT_nofhdfld) { i = 1; while ((i < n && OPT_nofhdfld <= 2048)) { adr += btyp->size; - FPrintHdFld__16(btyp, fld, adr); + FPrintHdFld__18(btyp, fld, adr); i += 1; } } } } else if (typ->form == 11 || __STRCMP(fld->name, "@ptr") == 0) { - OPM_FPrint(&*FPrintStr__13_s->pvfp, 11); - OPM_FPrint(&*FPrintStr__13_s->pvfp, adr); + OPM_FPrint(&*FPrintStr__15_s->pvfp, 11); + OPM_FPrint(&*FPrintStr__15_s->pvfp, adr); OPT_nofhdfld += 1; } } -static void FPrintFlds__14 (OPT_Object fld, int32 adr, BOOLEAN visible) +static void FPrintFlds__16 (OPT_Object fld, int32 adr, BOOLEAN visible) { while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { - OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->vis); - OPT_FPrintName(&*FPrintStr__13_s->pbfp, (void*)fld->name, 256); - OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->adr); + OPM_FPrint(&*FPrintStr__15_s->pbfp, fld->vis); + OPT_FPrintName(&*FPrintStr__15_s->pbfp, (void*)fld->name, 256); + OPM_FPrint(&*FPrintStr__15_s->pbfp, fld->adr); OPT_FPrintStr(fld->typ); - OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->typ->pbfp); - OPM_FPrint(&*FPrintStr__13_s->pvfp, fld->typ->pvfp); + OPM_FPrint(&*FPrintStr__15_s->pbfp, fld->typ->pbfp); + OPM_FPrint(&*FPrintStr__15_s->pvfp, fld->typ->pvfp); } else { - FPrintHdFld__16(fld->typ, fld, fld->adr + adr); + FPrintHdFld__18(fld->typ, fld, fld->adr + adr); } fld = fld->link; } } -static void FPrintTProcs__18 (OPT_Object obj) +static void FPrintTProcs__20 (OPT_Object obj) { if (obj != NIL) { - FPrintTProcs__18(obj->left); + FPrintTProcs__20(obj->left); if (obj->mode == 13) { if (obj->vis != 0) { - OPM_FPrint(&*FPrintStr__13_s->pbfp, 13); - OPM_FPrint(&*FPrintStr__13_s->pbfp, __ASHR(obj->adr, 16)); - OPT_FPrintSign(&*FPrintStr__13_s->pbfp, obj->typ, obj->link); - OPT_FPrintName(&*FPrintStr__13_s->pbfp, (void*)obj->name, 256); + OPM_FPrint(&*FPrintStr__15_s->pbfp, 13); + OPM_FPrint(&*FPrintStr__15_s->pbfp, __ASHR(obj->adr, 16)); + OPT_FPrintSign(&*FPrintStr__15_s->pbfp, obj->typ, obj->link); + OPT_FPrintName(&*FPrintStr__15_s->pbfp, (void*)obj->name, 256); } } - FPrintTProcs__18(obj->right); + FPrintTProcs__20(obj->right); } } @@ -632,11 +766,11 @@ void OPT_FPrintStr (OPT_Struct typ) OPT_Struct btyp = NIL; OPT_Object strobj = NIL, bstrobj = NIL; int32 pbfp, pvfp; - struct FPrintStr__13 _s; + struct FPrintStr__15 _s; _s.pbfp = &pbfp; _s.pvfp = &pvfp; - _s.lnk = FPrintStr__13_s; - FPrintStr__13_s = &_s; + _s.lnk = FPrintStr__15_s; + FPrintStr__15_s = &_s; if (!typ->fpdone) { OPT_IdFPrint(typ); pbfp = typ->idfp; @@ -673,11 +807,11 @@ void OPT_FPrintStr (OPT_Struct typ) OPM_FPrint(&pvfp, typ->align); OPM_FPrint(&pvfp, typ->n); OPT_nofhdfld = 0; - FPrintFlds__14(typ->link, 0, 1); + FPrintFlds__16(typ->link, 0, 1); if (OPT_nofhdfld > 2048) { OPM_Mark(225, typ->txtpos); } - FPrintTProcs__18(typ->link); + FPrintTProcs__20(typ->link); OPM_FPrint(&pvfp, pbfp); strobj = typ->strobj; if (strobj == NIL || strobj->name[0] == 0x00) { @@ -687,7 +821,7 @@ void OPT_FPrintStr (OPT_Struct typ) typ->pbfp = pbfp; typ->pvfp = pvfp; } - FPrintStr__13_s = _s.lnk; + FPrintStr__15_s = _s.lnk; } void OPT_FPrintObj (OPT_Object obj) @@ -1119,7 +1253,7 @@ static void OPT_InStruct (OPT_Struct *typ) (*typ)->comp = 2; OPT_InStruct(&(*typ)->BaseTyp); (*typ)->n = OPM_SymRInt(); - (*OPT_typSize)(*typ); + OPT_TypSize(*typ); break; case 38: (*typ)->form = 13; @@ -1130,7 +1264,7 @@ static void OPT_InStruct (OPT_Struct *typ) } else { (*typ)->n = 0; } - (*OPT_typSize)(*typ); + OPT_TypSize(*typ); break; case 39: (*typ)->form = 13; @@ -1899,6 +2033,7 @@ export void *OPT__init(void) __REGMOD("OPT", EnumPtrs); __REGCMD("Close", OPT_Close); __REGCMD("CloseScope", OPT_CloseScope); + __REGCMD("InitRecno", OPT_InitRecno); __INITYP(OPT_ConstDesc, OPT_ConstDesc, 0); __INITYP(OPT_ObjDesc, OPT_ObjDesc, 0); __INITYP(OPT_StrDesc, OPT_StrDesc, 0); diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index 0bd1f189..1a525fcb 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h @@ -66,7 +66,6 @@ typedef } OPT_StrDesc; -import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; import OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj; @@ -80,6 +79,8 @@ import address *OPT_ObjDesc__typ; import address *OPT_StrDesc__typ; import address *OPT_NodeDesc__typ; +import void OPT_Align (int32 *adr, int32 base); +import int32 OPT_BaseAlignment (OPT_Struct typ); import void OPT_Close (void); import void OPT_CloseScope (void); import void OPT_Export (BOOLEAN *ext, BOOLEAN *new); @@ -92,6 +93,7 @@ import void OPT_FindImport (OPT_Object mod, OPT_Object *res); import void OPT_IdFPrint (OPT_Struct typ); import void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); import void OPT_Init (OPS_Name name, SET opt); +import void OPT_InitRecno (void); import void OPT_Insert (OPS_Name name, OPT_Object *obj); import void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); import int16 OPT_IntSize (int64 n); @@ -103,6 +105,8 @@ import OPT_Object OPT_NewObj (void); import OPT_Struct OPT_NewStr (int8 form, int8 comp); import void OPT_OpenScope (int8 level, OPT_Object owner); import OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir); +import int32 OPT_SizeAlignment (int32 size); +import void OPT_TypSize (OPT_Struct typ); import void *OPT__init(void); diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index 8bb5ec32..cdb2ab50 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -17,7 +17,6 @@ typedef static int16 OPV_stamp; -static int32 OPV_recno; static OPV_ExitInfo OPV_exit; static int16 OPV_nofExitLabels; @@ -46,88 +45,15 @@ static void OPV_Stamp (OPS_Name s); static OPT_Object OPV_SuperProc (OPT_Node n); static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported); static void OPV_TraverseRecord (OPT_Struct typ); -export void OPV_TypSize (OPT_Struct typ); static void OPV_TypeOf (OPT_Node n); static void OPV_design (OPT_Node n, int16 prec); static void OPV_expr (OPT_Node n, int16 prec); static void OPV_stat (OPT_Node n, OPT_Object outerProc); -void OPV_TypSize (OPT_Struct typ) -{ - int16 f, c; - int32 offset, size, base, fbase, off0; - OPT_Object fld = NIL; - OPT_Struct btyp = NIL; - if (typ == OPT_undftyp) { - OPM_err(58); - } else if (typ->size == -1) { - f = typ->form; - c = typ->comp; - if (c == 4) { - btyp = typ->BaseTyp; - if (btyp == NIL) { - offset = 0; - base = 1; - } else { - OPV_TypSize(btyp); - offset = btyp->size - __ASHR(btyp->sysflag, 8); - base = btyp->align; - } - fld = typ->link; - while ((fld != NIL && fld->mode == 4)) { - btyp = fld->typ; - OPV_TypSize(btyp); - size = btyp->size; - fbase = OPC_BaseAlignment(btyp); - OPC_Align(&offset, fbase); - fld->adr = offset; - offset += size; - if (fbase > base) { - base = fbase; - } - fld = fld->link; - } - off0 = offset; - if (offset == 0) { - offset = 1; - } - OPC_Align(&offset, base); - if ((typ->strobj == NIL && __MASK(typ->align, -65536) == 0)) { - OPV_recno += 1; - base += __ASHL(OPV_recno, 16); - } - typ->size = offset; - typ->align = base; - typ->sysflag = __MASK(typ->sysflag, -256) + (int16)__ASHL(offset - off0, 8); - } else if (c == 2) { - OPV_TypSize(typ->BaseTyp); - typ->size = typ->n * typ->BaseTyp->size; - } else if (f == 11) { - typ->size = OPM_AddressSize; - if (typ->BaseTyp == OPT_undftyp) { - OPM_Mark(128, typ->n); - } else { - OPV_TypSize(typ->BaseTyp); - } - } else if (f == 12) { - typ->size = OPM_AddressSize; - } else if (c == 3) { - btyp = typ->BaseTyp; - OPV_TypSize(btyp); - if (btyp->comp == 3) { - typ->size = btyp->size + 4; - } else { - typ->size = 8; - } - } - } -} - void OPV_Init (void) { OPV_stamp = 0; - OPV_recno = 0; OPV_nofExitLabels = 0; } @@ -212,7 +138,7 @@ static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exporte mode = obj->mode; if ((mode == 5 && (obj->vis != 0) == exported)) { typ = obj->typ; - OPV_TypSize(obj->typ); + OPT_TypSize(obj->typ); if (typ->form == 11) { typ = typ->BaseTyp; } @@ -222,7 +148,7 @@ static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exporte } else if (mode == 13) { OPV_GetTProcNum(obj); } else if (mode == 1) { - OPV_TypSize(obj->typ); + OPT_TypSize(obj->typ); } if (!exported) { if ((__IN(mode, 0x60, 32) && obj->mnolev > 0)) { @@ -548,7 +474,7 @@ static void OPV_design (OPT_Node n, int16 prec) OPT_Struct typ = NIL; int16 class, designPrec, comp; OPT_Node d = NIL, x = NIL; - int16 dims, i, _for__27; + int16 dims, i, _for__26; comp = n->typ->comp; obj = n->obj; class = n->class; @@ -624,9 +550,9 @@ static void OPV_design (OPT_Node n, int16 prec) } x = x->left; } - _for__27 = dims; + _for__26 = dims; i = 1; - while (i <= _for__27) { + while (i <= _for__26) { OPM_Write(')'); i += 1; } @@ -1290,7 +1216,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(base->size); OPM_WriteString((CHAR*)", ", 3); - OPM_WriteInt(OPC_BaseAlignment(base)); + OPM_WriteInt(OPT_BaseAlignment(base)); OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(nofdim); OPM_WriteString((CHAR*)", ", 3); diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index c309d63c..09931dda 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h @@ -12,7 +12,6 @@ import void OPV_AdrAndSize (OPT_Object topScope); import void OPV_Init (void); import void OPV_Module (OPT_Node prog); -import void OPV_TypSize (OPT_Struct typ); import void *OPV__init(void); diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 2dacc4b8..e95203ed 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index 32d37057..d76d7ed5 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index fe93e8be..4b72fbe3 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index e7cba0d8..4a4c73b0 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index 427a0cc4..f765b98f 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index 44c51b2a..be1e7d7f 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index f63a7cb6..28dd23c6 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index 1a87761b..56d3fd40 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/Vishap.c b/bootstrap/unix-44/Vishap.c index 1ec89e33..30b81ac7 100644 --- a/bootstrap/unix-44/Vishap.c +++ b/bootstrap/unix-44/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspamSf */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define INTEGER int16 #define LONGINT int32 @@ -35,6 +35,7 @@ void Vishap_Module (BOOLEAN *done) OPP_Module(&p, OPM_opt); if (OPM_noerr) { OPV_Init(); + OPT_InitRecno(); OPV_AdrAndSize(OPT_topScope); OPT_Export(&ext, &new); if (OPM_noerr) { @@ -165,8 +166,6 @@ export int main(int argc, char **argv) Platform_SetInterruptHandler(Vishap_Trap); Platform_SetQuitHandler(Vishap_Trap); Platform_SetBadInstructionHandler(Vishap_Trap); - OPB_typSize = OPV_TypSize; - OPT_typSize = OPV_TypSize; Vishap_Translate(); __FINI; } diff --git a/bootstrap/unix-44/errors.c b/bootstrap/unix-44/errors.c index 0a40d5e9..d465624d 100644 --- a/bootstrap/unix-44/errors.c +++ b/bootstrap/unix-44/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/errors.h b/bootstrap/unix-44/errors.h index 759b613e..cf093ab3 100644 --- a/bootstrap/unix-44/errors.h +++ b/bootstrap/unix-44/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index 8be0b63d..46f8ac7e 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -89,7 +89,7 @@ void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN stati Strings_Append((CHAR*)" -o ", 5, (void*)cmd, 1023); Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); Strings_Append((CHAR*)" -L\"", 5, (void*)cmd, 1023); - Strings_Append((CHAR*)"/opt/voc", 9, (void*)cmd, 1023); + Strings_Append((CHAR*)"", 1, (void*)cmd, 1023); Strings_Append((CHAR*)"/lib\"", 6, (void*)cmd, 1023); Strings_Append((CHAR*)" -l voc", 8, (void*)cmd, 1023); extTools_execute((CHAR*)"Assemble and link: ", 20, cmd, 1023); @@ -108,7 +108,7 @@ export void *extTools__init(void) __REGMOD("extTools", 0); /* BEGIN */ Strings_Append((CHAR*)" -I \"", 6, (void*)extTools_compilationOptions, 1023); - Strings_Append((CHAR*)"/opt/voc", 9, (void*)extTools_compilationOptions, 1023); + Strings_Append((CHAR*)"", 1, (void*)extTools_compilationOptions, 1023); Strings_Append((CHAR*)"/include\" ", 11, (void*)extTools_compilationOptions, 1023); Platform_GetEnv((CHAR*)"CFLAGS", 7, (void*)extTools_CFLAGS, 1023); Strings_Append(extTools_CFLAGS, 1023, (void*)extTools_compilationOptions, 1023); diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index bff1c62c..700e6b39 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-44/vt100.c b/bootstrap/unix-44/vt100.c index 4f6a6c9d..8d4cbdfc 100644 --- a/bootstrap/unix-44/vt100.c +++ b/bootstrap/unix-44/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/vt100.h b/bootstrap/unix-44/vt100.h index 94f8add4..da86e98b 100644 --- a/bootstrap/unix-44/vt100.h +++ b/bootstrap/unix-44/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index abdf151b..7f7f4b26 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -7,7 +7,7 @@ #include "SYSTEM.h" -export CHAR Configuration_versionLong[41]; +export CHAR Configuration_versionLong[75]; @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/23] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index f51f63f2..618bc77f 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h @@ -6,7 +6,7 @@ #include "SYSTEM.h" -import CHAR Configuration_versionLong[41]; +import CHAR Configuration_versionLong[75]; import void *Configuration__init(void); diff --git a/bootstrap/unix-48/Console.c b/bootstrap/unix-48/Console.c index 115e60f5..f9e5e585 100644 --- a/bootstrap/unix-48/Console.c +++ b/bootstrap/unix-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Console.h b/bootstrap/unix-48/Console.h index b08c93ea..d645f05c 100644 --- a/bootstrap/unix-48/Console.h +++ b/bootstrap/unix-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 0a7ac692..ad002606 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index e2b7a3bb..0518133f 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index b7c8c827..905fcb24 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tsSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index 6ad4813e..3ea975a7 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tsSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index 7704f005..21d62e05 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index 060208c6..d2d0a476 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index e09bf1b4..6c15aa17 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -10,7 +10,6 @@ #include "OPT.h" -export void (*OPB_typSize)(OPT_Struct); static int16 OPB_exp; static int64 OPB_maxExp; @@ -1917,7 +1916,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) OPB_err(110); x = OPB_NewIntConst(1); } else if (__IN(f, 0x18fe, 32) || __IN(x->typ->comp, 0x14, 32)) { - (*OPB_typSize)(x->typ); + OPT_TypSize(x->typ); x->typ->pvused = 1; x = OPB_NewIntConst(x->typ->size); } else { diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index dc0085af..8395741b 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h @@ -8,7 +8,6 @@ #include "OPT.h" -import void (*OPB_typSize)(OPT_Struct); import void OPB_Assign (OPT_Node *x, OPT_Node y); diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 99353400..9104c5c4 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -17,10 +17,8 @@ static BOOLEAN OPC_GlbPtrs; static CHAR OPC_BodyNameExt[13]; -export void OPC_Align (int32 *adr, int32 base); export void OPC_Andent (OPT_Struct typ); static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames); -export int32 OPC_BaseAlignment (OPT_Struct typ); export OPT_Object OPC_BaseTProc (OPT_Object obj); export void OPC_BegBlk (void); export void OPC_BegStat (void); @@ -79,7 +77,6 @@ static void OPC_PutBase (OPT_Struct typ); static void OPC_PutPtrOffsets (OPT_Struct typ, int32 adr, int32 *cnt); static void OPC_RegCmds (OPT_Object obj); export void OPC_SetInclude (BOOLEAN exclude); -export int32 OPC_SizeAlignment (int32 size); static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause); static void OPC_Str1 (CHAR *s, LONGINT s__len, int32 x); static void OPC_StringLiteral (CHAR *s, LONGINT s__len, int32 l); @@ -750,7 +747,7 @@ static void OPC_CProcDefs (OPT_Object obj, int16 vis) { int16 i; OPT_ConstExt ext = NIL; - int16 _for__9; + int16 _for__7; if (obj != NIL) { OPC_CProcDefs(obj->left, vis); if ((((obj->mode == 9 && (int16)obj->vis >= vis)) && obj->adr == 1)) { @@ -762,9 +759,9 @@ static void OPC_CProcDefs (OPT_Object obj, int16 vis) OPC_DeclareParams(obj->link, 1); OPM_Write(0x09); } - _for__9 = (int16)(*obj->conval->ext)[0]; + _for__7 = (int16)(*obj->conval->ext)[0]; i = i; - while (i <= _for__9) { + while (i <= _for__7) { OPM_Write((*obj->conval->ext)[__X(i, 256)]); i += 1; } @@ -843,64 +840,11 @@ void OPC_InitTDesc (OPT_Struct typ) } } -void OPC_Align (int32 *adr, int32 base) -{ - switch (base) { - case 2: - *adr += __MASK(*adr, -2); - break; - case 4: - *adr += __MASK(-*adr, -4); - break; - case 8: - *adr += __MASK(-*adr, -8); - break; - case 16: - *adr += __MASK(-*adr, -16); - break; - default: - break; - } -} - -int32 OPC_SizeAlignment (int32 size) -{ - int32 _o_result; - int32 alignment; - if (size < OPM_Alignment) { - alignment = 1; - while (alignment < size) { - alignment = __ASHL(alignment, 1); - } - } else { - alignment = OPM_Alignment; - } - _o_result = alignment; - return _o_result; -} - -int32 OPC_BaseAlignment (OPT_Struct typ) -{ - int32 _o_result; - int32 alignment; - if (typ->form == 13) { - if (typ->comp == 4) { - alignment = __MASK(typ->align, -65536); - } else { - alignment = OPC_BaseAlignment(typ->BaseTyp); - } - } else { - alignment = OPC_SizeAlignment(typ->size); - } - _o_result = alignment; - return _o_result; -} - static void OPC_FillGap (int32 gap, int32 off, int32 align, int32 *n, int32 *curAlign) { int32 adr; adr = off; - OPC_Align(&adr, align); + OPT_Align(&adr, align); if ((*curAlign < align && gap - (adr - off) >= align)) { gap -= (adr - off) + align; OPC_BegStat(); @@ -955,8 +899,8 @@ static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, int32 *off, int32 *n, i } } else { adr = *off; - fldAlign = OPC_BaseAlignment(fld->typ); - OPC_Align(&adr, fldAlign); + fldAlign = OPT_BaseAlignment(fld->typ); + OPT_Align(&adr, fldAlign); gap = fld->adr - adr; if (fldAlign > *curAlign) { *curAlign = fldAlign; @@ -1205,7 +1149,7 @@ static void OPC_GenHeaderMsg (void) OPM_WriteString((CHAR*)"/* ", 4); OPM_WriteString((CHAR*)"voc", 4); OPM_Write(' '); - OPM_WriteString(Configuration_versionLong, 41); + OPM_WriteString(Configuration_versionLong, 75); OPM_Write(' '); i = 0; while (i <= 31) { @@ -1966,84 +1910,84 @@ void OPC_Constant (OPT_Const con, int16 form) } } -static struct InitKeywords__48 { +static struct InitKeywords__46 { int8 *n; - struct InitKeywords__48 *lnk; -} *InitKeywords__48_s; + struct InitKeywords__46 *lnk; +} *InitKeywords__46_s; -static void Enter__49 (CHAR *s, LONGINT s__len); +static void Enter__47 (CHAR *s, LONGINT s__len); -static void Enter__49 (CHAR *s, LONGINT s__len) +static void Enter__47 (CHAR *s, LONGINT s__len) { int16 h; __DUP(s, s__len, CHAR); h = OPC_PerfectHash((void*)s, s__len); - OPC_hashtab[__X(h, 105)] = *InitKeywords__48_s->n; - __COPY(s, OPC_keytab[__X(*InitKeywords__48_s->n, 50)], 9); - *InitKeywords__48_s->n += 1; + OPC_hashtab[__X(h, 105)] = *InitKeywords__46_s->n; + __COPY(s, OPC_keytab[__X(*InitKeywords__46_s->n, 50)], 9); + *InitKeywords__46_s->n += 1; __DEL(s); } static void OPC_InitKeywords (void) { int8 n, i; - struct InitKeywords__48 _s; + struct InitKeywords__46 _s; _s.n = &n; - _s.lnk = InitKeywords__48_s; - InitKeywords__48_s = &_s; + _s.lnk = InitKeywords__46_s; + InitKeywords__46_s = &_s; n = 0; i = 0; while (i <= 104) { OPC_hashtab[__X(i, 105)] = -1; i += 1; } - Enter__49((CHAR*)"address", 8); - Enter__49((CHAR*)"asm", 4); - Enter__49((CHAR*)"auto", 5); - Enter__49((CHAR*)"break", 6); - Enter__49((CHAR*)"case", 5); - Enter__49((CHAR*)"char", 5); - Enter__49((CHAR*)"const", 6); - Enter__49((CHAR*)"continue", 9); - Enter__49((CHAR*)"default", 8); - Enter__49((CHAR*)"do", 3); - Enter__49((CHAR*)"double", 7); - Enter__49((CHAR*)"else", 5); - Enter__49((CHAR*)"enum", 5); - Enter__49((CHAR*)"extern", 7); - Enter__49((CHAR*)"export", 7); - Enter__49((CHAR*)"float", 6); - Enter__49((CHAR*)"for", 4); - Enter__49((CHAR*)"fortran", 8); - Enter__49((CHAR*)"goto", 5); - Enter__49((CHAR*)"if", 3); - Enter__49((CHAR*)"import", 7); - Enter__49((CHAR*)"int", 4); - Enter__49((CHAR*)"int16", 6); - Enter__49((CHAR*)"int32", 6); - Enter__49((CHAR*)"int64", 6); - Enter__49((CHAR*)"int8", 5); - Enter__49((CHAR*)"long", 5); - Enter__49((CHAR*)"register", 9); - Enter__49((CHAR*)"return", 7); - Enter__49((CHAR*)"short", 6); - Enter__49((CHAR*)"signed", 7); - Enter__49((CHAR*)"sizeof", 7); - Enter__49((CHAR*)"size_t", 7); - Enter__49((CHAR*)"static", 7); - Enter__49((CHAR*)"struct", 7); - Enter__49((CHAR*)"switch", 7); - Enter__49((CHAR*)"typedef", 8); - Enter__49((CHAR*)"uint16", 7); - Enter__49((CHAR*)"uint32", 7); - Enter__49((CHAR*)"uint64", 7); - Enter__49((CHAR*)"uint8", 6); - Enter__49((CHAR*)"union", 6); - Enter__49((CHAR*)"unsigned", 9); - Enter__49((CHAR*)"void", 5); - Enter__49((CHAR*)"volatile", 9); - Enter__49((CHAR*)"while", 6); - InitKeywords__48_s = _s.lnk; + Enter__47((CHAR*)"address", 8); + Enter__47((CHAR*)"asm", 4); + Enter__47((CHAR*)"auto", 5); + Enter__47((CHAR*)"break", 6); + Enter__47((CHAR*)"case", 5); + Enter__47((CHAR*)"char", 5); + Enter__47((CHAR*)"const", 6); + Enter__47((CHAR*)"continue", 9); + Enter__47((CHAR*)"default", 8); + Enter__47((CHAR*)"do", 3); + Enter__47((CHAR*)"double", 7); + Enter__47((CHAR*)"else", 5); + Enter__47((CHAR*)"enum", 5); + Enter__47((CHAR*)"extern", 7); + Enter__47((CHAR*)"export", 7); + Enter__47((CHAR*)"float", 6); + Enter__47((CHAR*)"for", 4); + Enter__47((CHAR*)"fortran", 8); + Enter__47((CHAR*)"goto", 5); + Enter__47((CHAR*)"if", 3); + Enter__47((CHAR*)"import", 7); + Enter__47((CHAR*)"int", 4); + Enter__47((CHAR*)"int16", 6); + Enter__47((CHAR*)"int32", 6); + Enter__47((CHAR*)"int64", 6); + Enter__47((CHAR*)"int8", 5); + Enter__47((CHAR*)"long", 5); + Enter__47((CHAR*)"register", 9); + Enter__47((CHAR*)"return", 7); + Enter__47((CHAR*)"short", 6); + Enter__47((CHAR*)"signed", 7); + Enter__47((CHAR*)"sizeof", 7); + Enter__47((CHAR*)"size_t", 7); + Enter__47((CHAR*)"static", 7); + Enter__47((CHAR*)"struct", 7); + Enter__47((CHAR*)"switch", 7); + Enter__47((CHAR*)"typedef", 8); + Enter__47((CHAR*)"uint16", 7); + Enter__47((CHAR*)"uint32", 7); + Enter__47((CHAR*)"uint64", 7); + Enter__47((CHAR*)"uint8", 6); + Enter__47((CHAR*)"union", 6); + Enter__47((CHAR*)"unsigned", 9); + Enter__47((CHAR*)"void", 5); + Enter__47((CHAR*)"volatile", 9); + Enter__47((CHAR*)"while", 6); + InitKeywords__46_s = _s.lnk; } diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index 4215947f..6236cd73 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h @@ -9,9 +9,7 @@ -import void OPC_Align (int32 *adr, int32 base); import void OPC_Andent (OPT_Struct typ); -import int32 OPC_BaseAlignment (OPT_Struct typ); import OPT_Object OPC_BaseTProc (OPT_Object obj); import void OPC_BegBlk (void); import void OPC_BegStat (void); @@ -41,7 +39,6 @@ import void OPC_IntLiteral (int64 n, int32 size); import void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim); import int32 OPC_NofPtrs (OPT_Struct typ); import void OPC_SetInclude (BOOLEAN exclude); -import int32 OPC_SizeAlignment (int32 size); import void OPC_TDescDecl (OPT_Struct typ); import void OPC_TypeDefs (OPT_Object obj, int16 vis); import void OPC_TypeOf (OPT_Object ap); diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 8b1f6805..9297c0a3 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -223,6 +223,7 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) OPM_AddressSize = (int16)s[__X(i + 1, s__len)] - 48; OPM_Alignment = (int16)s[__X(i + 2, s__len)] - 48; i += 2; + Files_SetSearchPath((CHAR*)"", 1); } break; case 'B': @@ -270,7 +271,7 @@ BOOLEAN OPM_OpenPar (void) if (Platform_ArgCount == 1) { OPM_LogWLn(); OPM_LogWStr((CHAR*)"Oberon-2 compiler v", 20); - OPM_LogWStr(Configuration_versionLong, 41); + OPM_LogWStr(Configuration_versionLong, 75); OPM_LogW('.'); OPM_LogWLn(); OPM_LogWStr((CHAR*)"Based on Ofront by Software Templ OEG.", 39); @@ -1118,7 +1119,7 @@ export void *OPM__init(void) Strings_Append((CHAR*)";.;", 4, (void*)OPM_OBERON, 1024); Strings_Append(OPM_MODULES, 1024, (void*)OPM_OBERON, 1024); Strings_Append((CHAR*)";", 2, (void*)OPM_OBERON, 1024); - Strings_Append((CHAR*)"/opt/voc", 9, (void*)OPM_OBERON, 1024); + Strings_Append((CHAR*)"", 1, (void*)OPM_OBERON, 1024); Strings_Append((CHAR*)"/sym;", 6, (void*)OPM_OBERON, 1024); Files_SetSearchPath(OPM_OBERON, 1024); OPM_AddressSize = 4; diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index 96af4022..b62666db 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index a3ab1dd3..66b821d2 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index e5a59f6c..ea6663ba 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index 0cac83bd..2b449cae 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index caef45f4..8d90d974 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index c52efac6..1b69128c 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -87,7 +87,6 @@ typedef } OPT_StrDesc; -export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; export OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj; @@ -100,6 +99,7 @@ static OPT_ImpCtxt OPT_impCtxt; static OPT_ExpCtxt OPT_expCtxt; static int32 OPT_nofhdfld; static BOOLEAN OPT_newsf, OPT_findpc, OPT_extsf, OPT_sfpresent, OPT_symExtended, OPT_symNew; +static int32 OPT_recno; export address *OPT_ConstDesc__typ; export address *OPT_ObjDesc__typ; @@ -108,6 +108,8 @@ export address *OPT_NodeDesc__typ; export address *OPT_ImpCtxt__typ; export address *OPT_ExpCtxt__typ; +export void OPT_Align (int32 *adr, int32 base); +export int32 OPT_BaseAlignment (OPT_Struct typ); export void OPT_Close (void); export void OPT_CloseScope (void); static void OPT_DebugStruct (OPT_Struct btyp); @@ -136,6 +138,7 @@ static void OPT_InStruct (OPT_Struct *typ); static OPT_Object OPT_InTProc (int8 mno); static OPT_Struct OPT_InTyp (int32 tag); export void OPT_Init (OPS_Name name, SET opt); +export void OPT_InitRecno (void); static void OPT_InitStruct (OPT_Struct *typ, int8 form); export void OPT_Insert (OPS_Name name, OPT_Object *obj); export void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); @@ -157,9 +160,16 @@ static void OPT_OutSign (OPT_Struct result, OPT_Object par); static void OPT_OutStr (OPT_Struct typ); static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj); export OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir); +export int32 OPT_SizeAlignment (int32 size); +export void OPT_TypSize (OPT_Struct typ); static void OPT_err (int16 n); +void OPT_InitRecno (void) +{ + OPT_recno = 0; +} + static void OPT_err (int16 n) { OPM_err(n); @@ -240,6 +250,130 @@ OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir) __RETCHK; } +void OPT_Align (int32 *adr, int32 base) +{ + switch (base) { + case 2: + *adr += __MASK(*adr, -2); + break; + case 4: + *adr += __MASK(-*adr, -4); + break; + case 8: + *adr += __MASK(-*adr, -8); + break; + case 16: + *adr += __MASK(-*adr, -16); + break; + default: + break; + } +} + +int32 OPT_SizeAlignment (int32 size) +{ + int32 _o_result; + int32 alignment; + if (size < OPM_Alignment) { + alignment = 1; + while (alignment < size) { + alignment = __ASHL(alignment, 1); + } + } else { + alignment = OPM_Alignment; + } + _o_result = alignment; + return _o_result; +} + +int32 OPT_BaseAlignment (OPT_Struct typ) +{ + int32 _o_result; + int32 alignment; + if (typ->form == 13) { + if (typ->comp == 4) { + alignment = __MASK(typ->align, -65536); + } else { + alignment = OPT_BaseAlignment(typ->BaseTyp); + } + } else { + alignment = OPT_SizeAlignment(typ->size); + } + _o_result = alignment; + return _o_result; +} + +void OPT_TypSize (OPT_Struct typ) +{ + int16 f, c; + int32 offset, size, base, fbase, off0; + OPT_Object fld = NIL; + OPT_Struct btyp = NIL; + if (typ == OPT_undftyp) { + OPM_err(58); + } else if (typ->size == -1) { + f = typ->form; + c = typ->comp; + if (c == 4) { + btyp = typ->BaseTyp; + if (btyp == NIL) { + offset = 0; + base = 1; + } else { + OPT_TypSize(btyp); + offset = btyp->size - __ASHR(btyp->sysflag, 8); + base = btyp->align; + } + fld = typ->link; + while ((fld != NIL && fld->mode == 4)) { + btyp = fld->typ; + OPT_TypSize(btyp); + size = btyp->size; + fbase = OPT_BaseAlignment(btyp); + OPT_Align(&offset, fbase); + fld->adr = offset; + offset += size; + if (fbase > base) { + base = fbase; + } + fld = fld->link; + } + off0 = offset; + if (offset == 0) { + offset = 1; + } + OPT_Align(&offset, base); + if ((typ->strobj == NIL && __MASK(typ->align, -65536) == 0)) { + OPT_recno += 1; + base += __ASHL(OPT_recno, 16); + } + typ->size = offset; + typ->align = base; + typ->sysflag = __MASK(typ->sysflag, -256) + (int16)__ASHL(offset - off0, 8); + } else if (c == 2) { + OPT_TypSize(typ->BaseTyp); + typ->size = typ->n * typ->BaseTyp->size; + } else if (f == 11) { + typ->size = OPM_AddressSize; + if (typ->BaseTyp == OPT_undftyp) { + OPM_Mark(128, typ->n); + } else { + OPT_TypSize(typ->BaseTyp); + } + } else if (f == 12) { + typ->size = OPM_AddressSize; + } else if (c == 3) { + btyp = typ->BaseTyp; + OPT_TypSize(btyp); + if (btyp->comp == 3) { + typ->size = btyp->size + 4; + } else { + typ->size = 8; + } + } + } +} + OPT_Const OPT_NewConst (void) { OPT_Const _o_result; @@ -552,21 +686,21 @@ void OPT_IdFPrint (OPT_Struct typ) } } -static struct FPrintStr__13 { +static struct FPrintStr__15 { int32 *pbfp, *pvfp; - struct FPrintStr__13 *lnk; -} *FPrintStr__13_s; + struct FPrintStr__15 *lnk; +} *FPrintStr__15_s; -static void FPrintFlds__14 (OPT_Object fld, int32 adr, BOOLEAN visible); -static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, int32 adr); -static void FPrintTProcs__18 (OPT_Object obj); +static void FPrintFlds__16 (OPT_Object fld, int32 adr, BOOLEAN visible); +static void FPrintHdFld__18 (OPT_Struct typ, OPT_Object fld, int32 adr); +static void FPrintTProcs__20 (OPT_Object obj); -static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, int32 adr) +static void FPrintHdFld__18 (OPT_Struct typ, OPT_Object fld, int32 adr) { int32 i, j, n; OPT_Struct btyp = NIL; if (typ->comp == 4) { - FPrintFlds__14(typ->link, adr, 0); + FPrintFlds__16(typ->link, adr, 0); } else if (typ->comp == 2) { btyp = typ->BaseTyp; n = typ->n; @@ -576,53 +710,53 @@ static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, int32 adr) } if (btyp->form == 11 || btyp->comp == 4) { j = OPT_nofhdfld; - FPrintHdFld__16(btyp, fld, adr); + FPrintHdFld__18(btyp, fld, adr); if (j != OPT_nofhdfld) { i = 1; while ((i < n && OPT_nofhdfld <= 2048)) { adr += btyp->size; - FPrintHdFld__16(btyp, fld, adr); + FPrintHdFld__18(btyp, fld, adr); i += 1; } } } } else if (typ->form == 11 || __STRCMP(fld->name, "@ptr") == 0) { - OPM_FPrint(&*FPrintStr__13_s->pvfp, 11); - OPM_FPrint(&*FPrintStr__13_s->pvfp, adr); + OPM_FPrint(&*FPrintStr__15_s->pvfp, 11); + OPM_FPrint(&*FPrintStr__15_s->pvfp, adr); OPT_nofhdfld += 1; } } -static void FPrintFlds__14 (OPT_Object fld, int32 adr, BOOLEAN visible) +static void FPrintFlds__16 (OPT_Object fld, int32 adr, BOOLEAN visible) { while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { - OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->vis); - OPT_FPrintName(&*FPrintStr__13_s->pbfp, (void*)fld->name, 256); - OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->adr); + OPM_FPrint(&*FPrintStr__15_s->pbfp, fld->vis); + OPT_FPrintName(&*FPrintStr__15_s->pbfp, (void*)fld->name, 256); + OPM_FPrint(&*FPrintStr__15_s->pbfp, fld->adr); OPT_FPrintStr(fld->typ); - OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->typ->pbfp); - OPM_FPrint(&*FPrintStr__13_s->pvfp, fld->typ->pvfp); + OPM_FPrint(&*FPrintStr__15_s->pbfp, fld->typ->pbfp); + OPM_FPrint(&*FPrintStr__15_s->pvfp, fld->typ->pvfp); } else { - FPrintHdFld__16(fld->typ, fld, fld->adr + adr); + FPrintHdFld__18(fld->typ, fld, fld->adr + adr); } fld = fld->link; } } -static void FPrintTProcs__18 (OPT_Object obj) +static void FPrintTProcs__20 (OPT_Object obj) { if (obj != NIL) { - FPrintTProcs__18(obj->left); + FPrintTProcs__20(obj->left); if (obj->mode == 13) { if (obj->vis != 0) { - OPM_FPrint(&*FPrintStr__13_s->pbfp, 13); - OPM_FPrint(&*FPrintStr__13_s->pbfp, __ASHR(obj->adr, 16)); - OPT_FPrintSign(&*FPrintStr__13_s->pbfp, obj->typ, obj->link); - OPT_FPrintName(&*FPrintStr__13_s->pbfp, (void*)obj->name, 256); + OPM_FPrint(&*FPrintStr__15_s->pbfp, 13); + OPM_FPrint(&*FPrintStr__15_s->pbfp, __ASHR(obj->adr, 16)); + OPT_FPrintSign(&*FPrintStr__15_s->pbfp, obj->typ, obj->link); + OPT_FPrintName(&*FPrintStr__15_s->pbfp, (void*)obj->name, 256); } } - FPrintTProcs__18(obj->right); + FPrintTProcs__20(obj->right); } } @@ -632,11 +766,11 @@ void OPT_FPrintStr (OPT_Struct typ) OPT_Struct btyp = NIL; OPT_Object strobj = NIL, bstrobj = NIL; int32 pbfp, pvfp; - struct FPrintStr__13 _s; + struct FPrintStr__15 _s; _s.pbfp = &pbfp; _s.pvfp = &pvfp; - _s.lnk = FPrintStr__13_s; - FPrintStr__13_s = &_s; + _s.lnk = FPrintStr__15_s; + FPrintStr__15_s = &_s; if (!typ->fpdone) { OPT_IdFPrint(typ); pbfp = typ->idfp; @@ -673,11 +807,11 @@ void OPT_FPrintStr (OPT_Struct typ) OPM_FPrint(&pvfp, typ->align); OPM_FPrint(&pvfp, typ->n); OPT_nofhdfld = 0; - FPrintFlds__14(typ->link, 0, 1); + FPrintFlds__16(typ->link, 0, 1); if (OPT_nofhdfld > 2048) { OPM_Mark(225, typ->txtpos); } - FPrintTProcs__18(typ->link); + FPrintTProcs__20(typ->link); OPM_FPrint(&pvfp, pbfp); strobj = typ->strobj; if (strobj == NIL || strobj->name[0] == 0x00) { @@ -687,7 +821,7 @@ void OPT_FPrintStr (OPT_Struct typ) typ->pbfp = pbfp; typ->pvfp = pvfp; } - FPrintStr__13_s = _s.lnk; + FPrintStr__15_s = _s.lnk; } void OPT_FPrintObj (OPT_Object obj) @@ -1119,7 +1253,7 @@ static void OPT_InStruct (OPT_Struct *typ) (*typ)->comp = 2; OPT_InStruct(&(*typ)->BaseTyp); (*typ)->n = OPM_SymRInt(); - (*OPT_typSize)(*typ); + OPT_TypSize(*typ); break; case 38: (*typ)->form = 13; @@ -1130,7 +1264,7 @@ static void OPT_InStruct (OPT_Struct *typ) } else { (*typ)->n = 0; } - (*OPT_typSize)(*typ); + OPT_TypSize(*typ); break; case 39: (*typ)->form = 13; @@ -1899,6 +2033,7 @@ export void *OPT__init(void) __REGMOD("OPT", EnumPtrs); __REGCMD("Close", OPT_Close); __REGCMD("CloseScope", OPT_CloseScope); + __REGCMD("InitRecno", OPT_InitRecno); __INITYP(OPT_ConstDesc, OPT_ConstDesc, 0); __INITYP(OPT_ObjDesc, OPT_ObjDesc, 0); __INITYP(OPT_StrDesc, OPT_StrDesc, 0); diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index 0bd1f189..1a525fcb 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h @@ -66,7 +66,6 @@ typedef } OPT_StrDesc; -import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; import OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj; @@ -80,6 +79,8 @@ import address *OPT_ObjDesc__typ; import address *OPT_StrDesc__typ; import address *OPT_NodeDesc__typ; +import void OPT_Align (int32 *adr, int32 base); +import int32 OPT_BaseAlignment (OPT_Struct typ); import void OPT_Close (void); import void OPT_CloseScope (void); import void OPT_Export (BOOLEAN *ext, BOOLEAN *new); @@ -92,6 +93,7 @@ import void OPT_FindImport (OPT_Object mod, OPT_Object *res); import void OPT_IdFPrint (OPT_Struct typ); import void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); import void OPT_Init (OPS_Name name, SET opt); +import void OPT_InitRecno (void); import void OPT_Insert (OPS_Name name, OPT_Object *obj); import void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); import int16 OPT_IntSize (int64 n); @@ -103,6 +105,8 @@ import OPT_Object OPT_NewObj (void); import OPT_Struct OPT_NewStr (int8 form, int8 comp); import void OPT_OpenScope (int8 level, OPT_Object owner); import OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir); +import int32 OPT_SizeAlignment (int32 size); +import void OPT_TypSize (OPT_Struct typ); import void *OPT__init(void); diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index 8bb5ec32..cdb2ab50 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -17,7 +17,6 @@ typedef static int16 OPV_stamp; -static int32 OPV_recno; static OPV_ExitInfo OPV_exit; static int16 OPV_nofExitLabels; @@ -46,88 +45,15 @@ static void OPV_Stamp (OPS_Name s); static OPT_Object OPV_SuperProc (OPT_Node n); static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported); static void OPV_TraverseRecord (OPT_Struct typ); -export void OPV_TypSize (OPT_Struct typ); static void OPV_TypeOf (OPT_Node n); static void OPV_design (OPT_Node n, int16 prec); static void OPV_expr (OPT_Node n, int16 prec); static void OPV_stat (OPT_Node n, OPT_Object outerProc); -void OPV_TypSize (OPT_Struct typ) -{ - int16 f, c; - int32 offset, size, base, fbase, off0; - OPT_Object fld = NIL; - OPT_Struct btyp = NIL; - if (typ == OPT_undftyp) { - OPM_err(58); - } else if (typ->size == -1) { - f = typ->form; - c = typ->comp; - if (c == 4) { - btyp = typ->BaseTyp; - if (btyp == NIL) { - offset = 0; - base = 1; - } else { - OPV_TypSize(btyp); - offset = btyp->size - __ASHR(btyp->sysflag, 8); - base = btyp->align; - } - fld = typ->link; - while ((fld != NIL && fld->mode == 4)) { - btyp = fld->typ; - OPV_TypSize(btyp); - size = btyp->size; - fbase = OPC_BaseAlignment(btyp); - OPC_Align(&offset, fbase); - fld->adr = offset; - offset += size; - if (fbase > base) { - base = fbase; - } - fld = fld->link; - } - off0 = offset; - if (offset == 0) { - offset = 1; - } - OPC_Align(&offset, base); - if ((typ->strobj == NIL && __MASK(typ->align, -65536) == 0)) { - OPV_recno += 1; - base += __ASHL(OPV_recno, 16); - } - typ->size = offset; - typ->align = base; - typ->sysflag = __MASK(typ->sysflag, -256) + (int16)__ASHL(offset - off0, 8); - } else if (c == 2) { - OPV_TypSize(typ->BaseTyp); - typ->size = typ->n * typ->BaseTyp->size; - } else if (f == 11) { - typ->size = OPM_AddressSize; - if (typ->BaseTyp == OPT_undftyp) { - OPM_Mark(128, typ->n); - } else { - OPV_TypSize(typ->BaseTyp); - } - } else if (f == 12) { - typ->size = OPM_AddressSize; - } else if (c == 3) { - btyp = typ->BaseTyp; - OPV_TypSize(btyp); - if (btyp->comp == 3) { - typ->size = btyp->size + 4; - } else { - typ->size = 8; - } - } - } -} - void OPV_Init (void) { OPV_stamp = 0; - OPV_recno = 0; OPV_nofExitLabels = 0; } @@ -212,7 +138,7 @@ static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exporte mode = obj->mode; if ((mode == 5 && (obj->vis != 0) == exported)) { typ = obj->typ; - OPV_TypSize(obj->typ); + OPT_TypSize(obj->typ); if (typ->form == 11) { typ = typ->BaseTyp; } @@ -222,7 +148,7 @@ static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exporte } else if (mode == 13) { OPV_GetTProcNum(obj); } else if (mode == 1) { - OPV_TypSize(obj->typ); + OPT_TypSize(obj->typ); } if (!exported) { if ((__IN(mode, 0x60, 32) && obj->mnolev > 0)) { @@ -548,7 +474,7 @@ static void OPV_design (OPT_Node n, int16 prec) OPT_Struct typ = NIL; int16 class, designPrec, comp; OPT_Node d = NIL, x = NIL; - int16 dims, i, _for__27; + int16 dims, i, _for__26; comp = n->typ->comp; obj = n->obj; class = n->class; @@ -624,9 +550,9 @@ static void OPV_design (OPT_Node n, int16 prec) } x = x->left; } - _for__27 = dims; + _for__26 = dims; i = 1; - while (i <= _for__27) { + while (i <= _for__26) { OPM_Write(')'); i += 1; } @@ -1290,7 +1216,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(base->size); OPM_WriteString((CHAR*)", ", 3); - OPM_WriteInt(OPC_BaseAlignment(base)); + OPM_WriteInt(OPT_BaseAlignment(base)); OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(nofdim); OPM_WriteString((CHAR*)", ", 3); diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index c309d63c..09931dda 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h @@ -12,7 +12,6 @@ import void OPV_AdrAndSize (OPT_Object topScope); import void OPV_Init (void); import void OPV_Module (OPT_Node prog); -import void OPV_TypSize (OPT_Struct typ); import void *OPV__init(void); diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 2dacc4b8..e95203ed 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index 32d37057..d76d7ed5 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index fe93e8be..4b72fbe3 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index e7cba0d8..4a4c73b0 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index 427a0cc4..f765b98f 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index 44c51b2a..be1e7d7f 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index 60a7ea7a..779daa7a 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index df86e814..07f53445 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/Vishap.c b/bootstrap/unix-48/Vishap.c index 1ec89e33..30b81ac7 100644 --- a/bootstrap/unix-48/Vishap.c +++ b/bootstrap/unix-48/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspamSf */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define INTEGER int16 #define LONGINT int32 @@ -35,6 +35,7 @@ void Vishap_Module (BOOLEAN *done) OPP_Module(&p, OPM_opt); if (OPM_noerr) { OPV_Init(); + OPT_InitRecno(); OPV_AdrAndSize(OPT_topScope); OPT_Export(&ext, &new); if (OPM_noerr) { @@ -165,8 +166,6 @@ export int main(int argc, char **argv) Platform_SetInterruptHandler(Vishap_Trap); Platform_SetQuitHandler(Vishap_Trap); Platform_SetBadInstructionHandler(Vishap_Trap); - OPB_typSize = OPV_TypSize; - OPT_typSize = OPV_TypSize; Vishap_Translate(); __FINI; } diff --git a/bootstrap/unix-48/errors.c b/bootstrap/unix-48/errors.c index 0a40d5e9..d465624d 100644 --- a/bootstrap/unix-48/errors.c +++ b/bootstrap/unix-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/errors.h b/bootstrap/unix-48/errors.h index 759b613e..cf093ab3 100644 --- a/bootstrap/unix-48/errors.h +++ b/bootstrap/unix-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index 8be0b63d..46f8ac7e 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -89,7 +89,7 @@ void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN stati Strings_Append((CHAR*)" -o ", 5, (void*)cmd, 1023); Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); Strings_Append((CHAR*)" -L\"", 5, (void*)cmd, 1023); - Strings_Append((CHAR*)"/opt/voc", 9, (void*)cmd, 1023); + Strings_Append((CHAR*)"", 1, (void*)cmd, 1023); Strings_Append((CHAR*)"/lib\"", 6, (void*)cmd, 1023); Strings_Append((CHAR*)" -l voc", 8, (void*)cmd, 1023); extTools_execute((CHAR*)"Assemble and link: ", 20, cmd, 1023); @@ -108,7 +108,7 @@ export void *extTools__init(void) __REGMOD("extTools", 0); /* BEGIN */ Strings_Append((CHAR*)" -I \"", 6, (void*)extTools_compilationOptions, 1023); - Strings_Append((CHAR*)"/opt/voc", 9, (void*)extTools_compilationOptions, 1023); + Strings_Append((CHAR*)"", 1, (void*)extTools_compilationOptions, 1023); Strings_Append((CHAR*)"/include\" ", 11, (void*)extTools_compilationOptions, 1023); Platform_GetEnv((CHAR*)"CFLAGS", 7, (void*)extTools_CFLAGS, 1023); Strings_Append(extTools_CFLAGS, 1023, (void*)extTools_compilationOptions, 1023); diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index bff1c62c..700e6b39 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/vt100.c b/bootstrap/unix-48/vt100.c index 4f6a6c9d..8d4cbdfc 100644 --- a/bootstrap/unix-48/vt100.c +++ b/bootstrap/unix-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/vt100.h b/bootstrap/unix-48/vt100.h index 94f8add4..da86e98b 100644 --- a/bootstrap/unix-48/vt100.h +++ b/bootstrap/unix-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index abdf151b..7f7f4b26 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -7,7 +7,7 @@ #include "SYSTEM.h" -export CHAR Configuration_versionLong[41]; +export CHAR Configuration_versionLong[75]; @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/23] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index f51f63f2..618bc77f 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h @@ -6,7 +6,7 @@ #include "SYSTEM.h" -import CHAR Configuration_versionLong[41]; +import CHAR Configuration_versionLong[75]; import void *Configuration__init(void); diff --git a/bootstrap/unix-88/Console.c b/bootstrap/unix-88/Console.c index 115e60f5..f9e5e585 100644 --- a/bootstrap/unix-88/Console.c +++ b/bootstrap/unix-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-88/Console.h b/bootstrap/unix-88/Console.h index b08c93ea..d645f05c 100644 --- a/bootstrap/unix-88/Console.h +++ b/bootstrap/unix-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index e7eb30f3..d7e16dab 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index a371a423..64d47c3f 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index 16ae9ffd..785efa1a 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tsSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index 151a2d59..cfa2ab6f 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tsSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index f844dfa9..b6890cfe 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index 060208c6..d2d0a476 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index e09bf1b4..6c15aa17 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -10,7 +10,6 @@ #include "OPT.h" -export void (*OPB_typSize)(OPT_Struct); static int16 OPB_exp; static int64 OPB_maxExp; @@ -1917,7 +1916,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) OPB_err(110); x = OPB_NewIntConst(1); } else if (__IN(f, 0x18fe, 32) || __IN(x->typ->comp, 0x14, 32)) { - (*OPB_typSize)(x->typ); + OPT_TypSize(x->typ); x->typ->pvused = 1; x = OPB_NewIntConst(x->typ->size); } else { diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index dc0085af..8395741b 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h @@ -8,7 +8,6 @@ #include "OPT.h" -import void (*OPB_typSize)(OPT_Struct); import void OPB_Assign (OPT_Node *x, OPT_Node y); diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index 99353400..9104c5c4 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -17,10 +17,8 @@ static BOOLEAN OPC_GlbPtrs; static CHAR OPC_BodyNameExt[13]; -export void OPC_Align (int32 *adr, int32 base); export void OPC_Andent (OPT_Struct typ); static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames); -export int32 OPC_BaseAlignment (OPT_Struct typ); export OPT_Object OPC_BaseTProc (OPT_Object obj); export void OPC_BegBlk (void); export void OPC_BegStat (void); @@ -79,7 +77,6 @@ static void OPC_PutBase (OPT_Struct typ); static void OPC_PutPtrOffsets (OPT_Struct typ, int32 adr, int32 *cnt); static void OPC_RegCmds (OPT_Object obj); export void OPC_SetInclude (BOOLEAN exclude); -export int32 OPC_SizeAlignment (int32 size); static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause); static void OPC_Str1 (CHAR *s, LONGINT s__len, int32 x); static void OPC_StringLiteral (CHAR *s, LONGINT s__len, int32 l); @@ -750,7 +747,7 @@ static void OPC_CProcDefs (OPT_Object obj, int16 vis) { int16 i; OPT_ConstExt ext = NIL; - int16 _for__9; + int16 _for__7; if (obj != NIL) { OPC_CProcDefs(obj->left, vis); if ((((obj->mode == 9 && (int16)obj->vis >= vis)) && obj->adr == 1)) { @@ -762,9 +759,9 @@ static void OPC_CProcDefs (OPT_Object obj, int16 vis) OPC_DeclareParams(obj->link, 1); OPM_Write(0x09); } - _for__9 = (int16)(*obj->conval->ext)[0]; + _for__7 = (int16)(*obj->conval->ext)[0]; i = i; - while (i <= _for__9) { + while (i <= _for__7) { OPM_Write((*obj->conval->ext)[__X(i, 256)]); i += 1; } @@ -843,64 +840,11 @@ void OPC_InitTDesc (OPT_Struct typ) } } -void OPC_Align (int32 *adr, int32 base) -{ - switch (base) { - case 2: - *adr += __MASK(*adr, -2); - break; - case 4: - *adr += __MASK(-*adr, -4); - break; - case 8: - *adr += __MASK(-*adr, -8); - break; - case 16: - *adr += __MASK(-*adr, -16); - break; - default: - break; - } -} - -int32 OPC_SizeAlignment (int32 size) -{ - int32 _o_result; - int32 alignment; - if (size < OPM_Alignment) { - alignment = 1; - while (alignment < size) { - alignment = __ASHL(alignment, 1); - } - } else { - alignment = OPM_Alignment; - } - _o_result = alignment; - return _o_result; -} - -int32 OPC_BaseAlignment (OPT_Struct typ) -{ - int32 _o_result; - int32 alignment; - if (typ->form == 13) { - if (typ->comp == 4) { - alignment = __MASK(typ->align, -65536); - } else { - alignment = OPC_BaseAlignment(typ->BaseTyp); - } - } else { - alignment = OPC_SizeAlignment(typ->size); - } - _o_result = alignment; - return _o_result; -} - static void OPC_FillGap (int32 gap, int32 off, int32 align, int32 *n, int32 *curAlign) { int32 adr; adr = off; - OPC_Align(&adr, align); + OPT_Align(&adr, align); if ((*curAlign < align && gap - (adr - off) >= align)) { gap -= (adr - off) + align; OPC_BegStat(); @@ -955,8 +899,8 @@ static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, int32 *off, int32 *n, i } } else { adr = *off; - fldAlign = OPC_BaseAlignment(fld->typ); - OPC_Align(&adr, fldAlign); + fldAlign = OPT_BaseAlignment(fld->typ); + OPT_Align(&adr, fldAlign); gap = fld->adr - adr; if (fldAlign > *curAlign) { *curAlign = fldAlign; @@ -1205,7 +1149,7 @@ static void OPC_GenHeaderMsg (void) OPM_WriteString((CHAR*)"/* ", 4); OPM_WriteString((CHAR*)"voc", 4); OPM_Write(' '); - OPM_WriteString(Configuration_versionLong, 41); + OPM_WriteString(Configuration_versionLong, 75); OPM_Write(' '); i = 0; while (i <= 31) { @@ -1966,84 +1910,84 @@ void OPC_Constant (OPT_Const con, int16 form) } } -static struct InitKeywords__48 { +static struct InitKeywords__46 { int8 *n; - struct InitKeywords__48 *lnk; -} *InitKeywords__48_s; + struct InitKeywords__46 *lnk; +} *InitKeywords__46_s; -static void Enter__49 (CHAR *s, LONGINT s__len); +static void Enter__47 (CHAR *s, LONGINT s__len); -static void Enter__49 (CHAR *s, LONGINT s__len) +static void Enter__47 (CHAR *s, LONGINT s__len) { int16 h; __DUP(s, s__len, CHAR); h = OPC_PerfectHash((void*)s, s__len); - OPC_hashtab[__X(h, 105)] = *InitKeywords__48_s->n; - __COPY(s, OPC_keytab[__X(*InitKeywords__48_s->n, 50)], 9); - *InitKeywords__48_s->n += 1; + OPC_hashtab[__X(h, 105)] = *InitKeywords__46_s->n; + __COPY(s, OPC_keytab[__X(*InitKeywords__46_s->n, 50)], 9); + *InitKeywords__46_s->n += 1; __DEL(s); } static void OPC_InitKeywords (void) { int8 n, i; - struct InitKeywords__48 _s; + struct InitKeywords__46 _s; _s.n = &n; - _s.lnk = InitKeywords__48_s; - InitKeywords__48_s = &_s; + _s.lnk = InitKeywords__46_s; + InitKeywords__46_s = &_s; n = 0; i = 0; while (i <= 104) { OPC_hashtab[__X(i, 105)] = -1; i += 1; } - Enter__49((CHAR*)"address", 8); - Enter__49((CHAR*)"asm", 4); - Enter__49((CHAR*)"auto", 5); - Enter__49((CHAR*)"break", 6); - Enter__49((CHAR*)"case", 5); - Enter__49((CHAR*)"char", 5); - Enter__49((CHAR*)"const", 6); - Enter__49((CHAR*)"continue", 9); - Enter__49((CHAR*)"default", 8); - Enter__49((CHAR*)"do", 3); - Enter__49((CHAR*)"double", 7); - Enter__49((CHAR*)"else", 5); - Enter__49((CHAR*)"enum", 5); - Enter__49((CHAR*)"extern", 7); - Enter__49((CHAR*)"export", 7); - Enter__49((CHAR*)"float", 6); - Enter__49((CHAR*)"for", 4); - Enter__49((CHAR*)"fortran", 8); - Enter__49((CHAR*)"goto", 5); - Enter__49((CHAR*)"if", 3); - Enter__49((CHAR*)"import", 7); - Enter__49((CHAR*)"int", 4); - Enter__49((CHAR*)"int16", 6); - Enter__49((CHAR*)"int32", 6); - Enter__49((CHAR*)"int64", 6); - Enter__49((CHAR*)"int8", 5); - Enter__49((CHAR*)"long", 5); - Enter__49((CHAR*)"register", 9); - Enter__49((CHAR*)"return", 7); - Enter__49((CHAR*)"short", 6); - Enter__49((CHAR*)"signed", 7); - Enter__49((CHAR*)"sizeof", 7); - Enter__49((CHAR*)"size_t", 7); - Enter__49((CHAR*)"static", 7); - Enter__49((CHAR*)"struct", 7); - Enter__49((CHAR*)"switch", 7); - Enter__49((CHAR*)"typedef", 8); - Enter__49((CHAR*)"uint16", 7); - Enter__49((CHAR*)"uint32", 7); - Enter__49((CHAR*)"uint64", 7); - Enter__49((CHAR*)"uint8", 6); - Enter__49((CHAR*)"union", 6); - Enter__49((CHAR*)"unsigned", 9); - Enter__49((CHAR*)"void", 5); - Enter__49((CHAR*)"volatile", 9); - Enter__49((CHAR*)"while", 6); - InitKeywords__48_s = _s.lnk; + Enter__47((CHAR*)"address", 8); + Enter__47((CHAR*)"asm", 4); + Enter__47((CHAR*)"auto", 5); + Enter__47((CHAR*)"break", 6); + Enter__47((CHAR*)"case", 5); + Enter__47((CHAR*)"char", 5); + Enter__47((CHAR*)"const", 6); + Enter__47((CHAR*)"continue", 9); + Enter__47((CHAR*)"default", 8); + Enter__47((CHAR*)"do", 3); + Enter__47((CHAR*)"double", 7); + Enter__47((CHAR*)"else", 5); + Enter__47((CHAR*)"enum", 5); + Enter__47((CHAR*)"extern", 7); + Enter__47((CHAR*)"export", 7); + Enter__47((CHAR*)"float", 6); + Enter__47((CHAR*)"for", 4); + Enter__47((CHAR*)"fortran", 8); + Enter__47((CHAR*)"goto", 5); + Enter__47((CHAR*)"if", 3); + Enter__47((CHAR*)"import", 7); + Enter__47((CHAR*)"int", 4); + Enter__47((CHAR*)"int16", 6); + Enter__47((CHAR*)"int32", 6); + Enter__47((CHAR*)"int64", 6); + Enter__47((CHAR*)"int8", 5); + Enter__47((CHAR*)"long", 5); + Enter__47((CHAR*)"register", 9); + Enter__47((CHAR*)"return", 7); + Enter__47((CHAR*)"short", 6); + Enter__47((CHAR*)"signed", 7); + Enter__47((CHAR*)"sizeof", 7); + Enter__47((CHAR*)"size_t", 7); + Enter__47((CHAR*)"static", 7); + Enter__47((CHAR*)"struct", 7); + Enter__47((CHAR*)"switch", 7); + Enter__47((CHAR*)"typedef", 8); + Enter__47((CHAR*)"uint16", 7); + Enter__47((CHAR*)"uint32", 7); + Enter__47((CHAR*)"uint64", 7); + Enter__47((CHAR*)"uint8", 6); + Enter__47((CHAR*)"union", 6); + Enter__47((CHAR*)"unsigned", 9); + Enter__47((CHAR*)"void", 5); + Enter__47((CHAR*)"volatile", 9); + Enter__47((CHAR*)"while", 6); + InitKeywords__46_s = _s.lnk; } diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index 4215947f..6236cd73 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h @@ -9,9 +9,7 @@ -import void OPC_Align (int32 *adr, int32 base); import void OPC_Andent (OPT_Struct typ); -import int32 OPC_BaseAlignment (OPT_Struct typ); import OPT_Object OPC_BaseTProc (OPT_Object obj); import void OPC_BegBlk (void); import void OPC_BegStat (void); @@ -41,7 +39,6 @@ import void OPC_IntLiteral (int64 n, int32 size); import void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim); import int32 OPC_NofPtrs (OPT_Struct typ); import void OPC_SetInclude (BOOLEAN exclude); -import int32 OPC_SizeAlignment (int32 size); import void OPC_TDescDecl (OPT_Struct typ); import void OPC_TypeDefs (OPT_Object obj, int16 vis); import void OPC_TypeOf (OPT_Object ap); diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 931ecb18..7b566324 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -223,6 +223,7 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) OPM_AddressSize = (int16)s[__X(i + 1, s__len)] - 48; OPM_Alignment = (int16)s[__X(i + 2, s__len)] - 48; i += 2; + Files_SetSearchPath((CHAR*)"", 1); } break; case 'B': @@ -270,7 +271,7 @@ BOOLEAN OPM_OpenPar (void) if (Platform_ArgCount == 1) { OPM_LogWLn(); OPM_LogWStr((CHAR*)"Oberon-2 compiler v", 20); - OPM_LogWStr(Configuration_versionLong, 41); + OPM_LogWStr(Configuration_versionLong, 75); OPM_LogW('.'); OPM_LogWLn(); OPM_LogWStr((CHAR*)"Based on Ofront by Software Templ OEG.", 39); @@ -1118,7 +1119,7 @@ export void *OPM__init(void) Strings_Append((CHAR*)";.;", 4, (void*)OPM_OBERON, 1024); Strings_Append(OPM_MODULES, 1024, (void*)OPM_OBERON, 1024); Strings_Append((CHAR*)";", 2, (void*)OPM_OBERON, 1024); - Strings_Append((CHAR*)"/opt/voc", 9, (void*)OPM_OBERON, 1024); + Strings_Append((CHAR*)"", 1, (void*)OPM_OBERON, 1024); Strings_Append((CHAR*)"/sym;", 6, (void*)OPM_OBERON, 1024); Files_SetSearchPath(OPM_OBERON, 1024); OPM_AddressSize = 8; diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index 96af4022..b62666db 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index 74f93e77..03366726 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index e5a59f6c..ea6663ba 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index 0cac83bd..2b449cae 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index caef45f4..8d90d974 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index d40808d2..c9ff5430 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -87,7 +87,6 @@ typedef } OPT_StrDesc; -export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; export OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj; @@ -100,6 +99,7 @@ static OPT_ImpCtxt OPT_impCtxt; static OPT_ExpCtxt OPT_expCtxt; static int32 OPT_nofhdfld; static BOOLEAN OPT_newsf, OPT_findpc, OPT_extsf, OPT_sfpresent, OPT_symExtended, OPT_symNew; +static int32 OPT_recno; export address *OPT_ConstDesc__typ; export address *OPT_ObjDesc__typ; @@ -108,6 +108,8 @@ export address *OPT_NodeDesc__typ; export address *OPT_ImpCtxt__typ; export address *OPT_ExpCtxt__typ; +export void OPT_Align (int32 *adr, int32 base); +export int32 OPT_BaseAlignment (OPT_Struct typ); export void OPT_Close (void); export void OPT_CloseScope (void); static void OPT_DebugStruct (OPT_Struct btyp); @@ -136,6 +138,7 @@ static void OPT_InStruct (OPT_Struct *typ); static OPT_Object OPT_InTProc (int8 mno); static OPT_Struct OPT_InTyp (int32 tag); export void OPT_Init (OPS_Name name, SET opt); +export void OPT_InitRecno (void); static void OPT_InitStruct (OPT_Struct *typ, int8 form); export void OPT_Insert (OPS_Name name, OPT_Object *obj); export void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); @@ -157,9 +160,16 @@ static void OPT_OutSign (OPT_Struct result, OPT_Object par); static void OPT_OutStr (OPT_Struct typ); static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj); export OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir); +export int32 OPT_SizeAlignment (int32 size); +export void OPT_TypSize (OPT_Struct typ); static void OPT_err (int16 n); +void OPT_InitRecno (void) +{ + OPT_recno = 0; +} + static void OPT_err (int16 n) { OPM_err(n); @@ -240,6 +250,130 @@ OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir) __RETCHK; } +void OPT_Align (int32 *adr, int32 base) +{ + switch (base) { + case 2: + *adr += __MASK(*adr, -2); + break; + case 4: + *adr += __MASK(-*adr, -4); + break; + case 8: + *adr += __MASK(-*adr, -8); + break; + case 16: + *adr += __MASK(-*adr, -16); + break; + default: + break; + } +} + +int32 OPT_SizeAlignment (int32 size) +{ + int32 _o_result; + int32 alignment; + if (size < OPM_Alignment) { + alignment = 1; + while (alignment < size) { + alignment = __ASHL(alignment, 1); + } + } else { + alignment = OPM_Alignment; + } + _o_result = alignment; + return _o_result; +} + +int32 OPT_BaseAlignment (OPT_Struct typ) +{ + int32 _o_result; + int32 alignment; + if (typ->form == 13) { + if (typ->comp == 4) { + alignment = __MASK(typ->align, -65536); + } else { + alignment = OPT_BaseAlignment(typ->BaseTyp); + } + } else { + alignment = OPT_SizeAlignment(typ->size); + } + _o_result = alignment; + return _o_result; +} + +void OPT_TypSize (OPT_Struct typ) +{ + int16 f, c; + int32 offset, size, base, fbase, off0; + OPT_Object fld = NIL; + OPT_Struct btyp = NIL; + if (typ == OPT_undftyp) { + OPM_err(58); + } else if (typ->size == -1) { + f = typ->form; + c = typ->comp; + if (c == 4) { + btyp = typ->BaseTyp; + if (btyp == NIL) { + offset = 0; + base = 1; + } else { + OPT_TypSize(btyp); + offset = btyp->size - __ASHR(btyp->sysflag, 8); + base = btyp->align; + } + fld = typ->link; + while ((fld != NIL && fld->mode == 4)) { + btyp = fld->typ; + OPT_TypSize(btyp); + size = btyp->size; + fbase = OPT_BaseAlignment(btyp); + OPT_Align(&offset, fbase); + fld->adr = offset; + offset += size; + if (fbase > base) { + base = fbase; + } + fld = fld->link; + } + off0 = offset; + if (offset == 0) { + offset = 1; + } + OPT_Align(&offset, base); + if ((typ->strobj == NIL && __MASK(typ->align, -65536) == 0)) { + OPT_recno += 1; + base += __ASHL(OPT_recno, 16); + } + typ->size = offset; + typ->align = base; + typ->sysflag = __MASK(typ->sysflag, -256) + (int16)__ASHL(offset - off0, 8); + } else if (c == 2) { + OPT_TypSize(typ->BaseTyp); + typ->size = typ->n * typ->BaseTyp->size; + } else if (f == 11) { + typ->size = OPM_AddressSize; + if (typ->BaseTyp == OPT_undftyp) { + OPM_Mark(128, typ->n); + } else { + OPT_TypSize(typ->BaseTyp); + } + } else if (f == 12) { + typ->size = OPM_AddressSize; + } else if (c == 3) { + btyp = typ->BaseTyp; + OPT_TypSize(btyp); + if (btyp->comp == 3) { + typ->size = btyp->size + 4; + } else { + typ->size = 8; + } + } + } +} + OPT_Const OPT_NewConst (void) { OPT_Const _o_result; @@ -552,21 +686,21 @@ void OPT_IdFPrint (OPT_Struct typ) } } -static struct FPrintStr__13 { +static struct FPrintStr__15 { int32 *pbfp, *pvfp; - struct FPrintStr__13 *lnk; -} *FPrintStr__13_s; + struct FPrintStr__15 *lnk; +} *FPrintStr__15_s; -static void FPrintFlds__14 (OPT_Object fld, int32 adr, BOOLEAN visible); -static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, int32 adr); -static void FPrintTProcs__18 (OPT_Object obj); +static void FPrintFlds__16 (OPT_Object fld, int32 adr, BOOLEAN visible); +static void FPrintHdFld__18 (OPT_Struct typ, OPT_Object fld, int32 adr); +static void FPrintTProcs__20 (OPT_Object obj); -static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, int32 adr) +static void FPrintHdFld__18 (OPT_Struct typ, OPT_Object fld, int32 adr) { int32 i, j, n; OPT_Struct btyp = NIL; if (typ->comp == 4) { - FPrintFlds__14(typ->link, adr, 0); + FPrintFlds__16(typ->link, adr, 0); } else if (typ->comp == 2) { btyp = typ->BaseTyp; n = typ->n; @@ -576,53 +710,53 @@ static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, int32 adr) } if (btyp->form == 11 || btyp->comp == 4) { j = OPT_nofhdfld; - FPrintHdFld__16(btyp, fld, adr); + FPrintHdFld__18(btyp, fld, adr); if (j != OPT_nofhdfld) { i = 1; while ((i < n && OPT_nofhdfld <= 2048)) { adr += btyp->size; - FPrintHdFld__16(btyp, fld, adr); + FPrintHdFld__18(btyp, fld, adr); i += 1; } } } } else if (typ->form == 11 || __STRCMP(fld->name, "@ptr") == 0) { - OPM_FPrint(&*FPrintStr__13_s->pvfp, 11); - OPM_FPrint(&*FPrintStr__13_s->pvfp, adr); + OPM_FPrint(&*FPrintStr__15_s->pvfp, 11); + OPM_FPrint(&*FPrintStr__15_s->pvfp, adr); OPT_nofhdfld += 1; } } -static void FPrintFlds__14 (OPT_Object fld, int32 adr, BOOLEAN visible) +static void FPrintFlds__16 (OPT_Object fld, int32 adr, BOOLEAN visible) { while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { - OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->vis); - OPT_FPrintName(&*FPrintStr__13_s->pbfp, (void*)fld->name, 256); - OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->adr); + OPM_FPrint(&*FPrintStr__15_s->pbfp, fld->vis); + OPT_FPrintName(&*FPrintStr__15_s->pbfp, (void*)fld->name, 256); + OPM_FPrint(&*FPrintStr__15_s->pbfp, fld->adr); OPT_FPrintStr(fld->typ); - OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->typ->pbfp); - OPM_FPrint(&*FPrintStr__13_s->pvfp, fld->typ->pvfp); + OPM_FPrint(&*FPrintStr__15_s->pbfp, fld->typ->pbfp); + OPM_FPrint(&*FPrintStr__15_s->pvfp, fld->typ->pvfp); } else { - FPrintHdFld__16(fld->typ, fld, fld->adr + adr); + FPrintHdFld__18(fld->typ, fld, fld->adr + adr); } fld = fld->link; } } -static void FPrintTProcs__18 (OPT_Object obj) +static void FPrintTProcs__20 (OPT_Object obj) { if (obj != NIL) { - FPrintTProcs__18(obj->left); + FPrintTProcs__20(obj->left); if (obj->mode == 13) { if (obj->vis != 0) { - OPM_FPrint(&*FPrintStr__13_s->pbfp, 13); - OPM_FPrint(&*FPrintStr__13_s->pbfp, __ASHR(obj->adr, 16)); - OPT_FPrintSign(&*FPrintStr__13_s->pbfp, obj->typ, obj->link); - OPT_FPrintName(&*FPrintStr__13_s->pbfp, (void*)obj->name, 256); + OPM_FPrint(&*FPrintStr__15_s->pbfp, 13); + OPM_FPrint(&*FPrintStr__15_s->pbfp, __ASHR(obj->adr, 16)); + OPT_FPrintSign(&*FPrintStr__15_s->pbfp, obj->typ, obj->link); + OPT_FPrintName(&*FPrintStr__15_s->pbfp, (void*)obj->name, 256); } } - FPrintTProcs__18(obj->right); + FPrintTProcs__20(obj->right); } } @@ -632,11 +766,11 @@ void OPT_FPrintStr (OPT_Struct typ) OPT_Struct btyp = NIL; OPT_Object strobj = NIL, bstrobj = NIL; int32 pbfp, pvfp; - struct FPrintStr__13 _s; + struct FPrintStr__15 _s; _s.pbfp = &pbfp; _s.pvfp = &pvfp; - _s.lnk = FPrintStr__13_s; - FPrintStr__13_s = &_s; + _s.lnk = FPrintStr__15_s; + FPrintStr__15_s = &_s; if (!typ->fpdone) { OPT_IdFPrint(typ); pbfp = typ->idfp; @@ -673,11 +807,11 @@ void OPT_FPrintStr (OPT_Struct typ) OPM_FPrint(&pvfp, typ->align); OPM_FPrint(&pvfp, typ->n); OPT_nofhdfld = 0; - FPrintFlds__14(typ->link, 0, 1); + FPrintFlds__16(typ->link, 0, 1); if (OPT_nofhdfld > 2048) { OPM_Mark(225, typ->txtpos); } - FPrintTProcs__18(typ->link); + FPrintTProcs__20(typ->link); OPM_FPrint(&pvfp, pbfp); strobj = typ->strobj; if (strobj == NIL || strobj->name[0] == 0x00) { @@ -687,7 +821,7 @@ void OPT_FPrintStr (OPT_Struct typ) typ->pbfp = pbfp; typ->pvfp = pvfp; } - FPrintStr__13_s = _s.lnk; + FPrintStr__15_s = _s.lnk; } void OPT_FPrintObj (OPT_Object obj) @@ -1119,7 +1253,7 @@ static void OPT_InStruct (OPT_Struct *typ) (*typ)->comp = 2; OPT_InStruct(&(*typ)->BaseTyp); (*typ)->n = OPM_SymRInt(); - (*OPT_typSize)(*typ); + OPT_TypSize(*typ); break; case 38: (*typ)->form = 13; @@ -1130,7 +1264,7 @@ static void OPT_InStruct (OPT_Struct *typ) } else { (*typ)->n = 0; } - (*OPT_typSize)(*typ); + OPT_TypSize(*typ); break; case 39: (*typ)->form = 13; @@ -1899,6 +2033,7 @@ export void *OPT__init(void) __REGMOD("OPT", EnumPtrs); __REGCMD("Close", OPT_Close); __REGCMD("CloseScope", OPT_CloseScope); + __REGCMD("InitRecno", OPT_InitRecno); __INITYP(OPT_ConstDesc, OPT_ConstDesc, 0); __INITYP(OPT_ObjDesc, OPT_ObjDesc, 0); __INITYP(OPT_StrDesc, OPT_StrDesc, 0); diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 0bd1f189..1a525fcb 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h @@ -66,7 +66,6 @@ typedef } OPT_StrDesc; -import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; import OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj; @@ -80,6 +79,8 @@ import address *OPT_ObjDesc__typ; import address *OPT_StrDesc__typ; import address *OPT_NodeDesc__typ; +import void OPT_Align (int32 *adr, int32 base); +import int32 OPT_BaseAlignment (OPT_Struct typ); import void OPT_Close (void); import void OPT_CloseScope (void); import void OPT_Export (BOOLEAN *ext, BOOLEAN *new); @@ -92,6 +93,7 @@ import void OPT_FindImport (OPT_Object mod, OPT_Object *res); import void OPT_IdFPrint (OPT_Struct typ); import void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); import void OPT_Init (OPS_Name name, SET opt); +import void OPT_InitRecno (void); import void OPT_Insert (OPS_Name name, OPT_Object *obj); import void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); import int16 OPT_IntSize (int64 n); @@ -103,6 +105,8 @@ import OPT_Object OPT_NewObj (void); import OPT_Struct OPT_NewStr (int8 form, int8 comp); import void OPT_OpenScope (int8 level, OPT_Object owner); import OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir); +import int32 OPT_SizeAlignment (int32 size); +import void OPT_TypSize (OPT_Struct typ); import void *OPT__init(void); diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 8ef2c450..f9e7c27c 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -17,7 +17,6 @@ typedef static int16 OPV_stamp; -static int32 OPV_recno; static OPV_ExitInfo OPV_exit; static int16 OPV_nofExitLabels; @@ -46,88 +45,15 @@ static void OPV_Stamp (OPS_Name s); static OPT_Object OPV_SuperProc (OPT_Node n); static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported); static void OPV_TraverseRecord (OPT_Struct typ); -export void OPV_TypSize (OPT_Struct typ); static void OPV_TypeOf (OPT_Node n); static void OPV_design (OPT_Node n, int16 prec); static void OPV_expr (OPT_Node n, int16 prec); static void OPV_stat (OPT_Node n, OPT_Object outerProc); -void OPV_TypSize (OPT_Struct typ) -{ - int16 f, c; - int32 offset, size, base, fbase, off0; - OPT_Object fld = NIL; - OPT_Struct btyp = NIL; - if (typ == OPT_undftyp) { - OPM_err(58); - } else if (typ->size == -1) { - f = typ->form; - c = typ->comp; - if (c == 4) { - btyp = typ->BaseTyp; - if (btyp == NIL) { - offset = 0; - base = 1; - } else { - OPV_TypSize(btyp); - offset = btyp->size - __ASHR(btyp->sysflag, 8); - base = btyp->align; - } - fld = typ->link; - while ((fld != NIL && fld->mode == 4)) { - btyp = fld->typ; - OPV_TypSize(btyp); - size = btyp->size; - fbase = OPC_BaseAlignment(btyp); - OPC_Align(&offset, fbase); - fld->adr = offset; - offset += size; - if (fbase > base) { - base = fbase; - } - fld = fld->link; - } - off0 = offset; - if (offset == 0) { - offset = 1; - } - OPC_Align(&offset, base); - if ((typ->strobj == NIL && __MASK(typ->align, -65536) == 0)) { - OPV_recno += 1; - base += __ASHL(OPV_recno, 16); - } - typ->size = offset; - typ->align = base; - typ->sysflag = __MASK(typ->sysflag, -256) + (int16)__ASHL(offset - off0, 8); - } else if (c == 2) { - OPV_TypSize(typ->BaseTyp); - typ->size = typ->n * typ->BaseTyp->size; - } else if (f == 11) { - typ->size = OPM_AddressSize; - if (typ->BaseTyp == OPT_undftyp) { - OPM_Mark(128, typ->n); - } else { - OPV_TypSize(typ->BaseTyp); - } - } else if (f == 12) { - typ->size = OPM_AddressSize; - } else if (c == 3) { - btyp = typ->BaseTyp; - OPV_TypSize(btyp); - if (btyp->comp == 3) { - typ->size = btyp->size + 4; - } else { - typ->size = 8; - } - } - } -} - void OPV_Init (void) { OPV_stamp = 0; - OPV_recno = 0; OPV_nofExitLabels = 0; } @@ -212,7 +138,7 @@ static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exporte mode = obj->mode; if ((mode == 5 && (obj->vis != 0) == exported)) { typ = obj->typ; - OPV_TypSize(obj->typ); + OPT_TypSize(obj->typ); if (typ->form == 11) { typ = typ->BaseTyp; } @@ -222,7 +148,7 @@ static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exporte } else if (mode == 13) { OPV_GetTProcNum(obj); } else if (mode == 1) { - OPV_TypSize(obj->typ); + OPT_TypSize(obj->typ); } if (!exported) { if ((__IN(mode, 0x60, 32) && obj->mnolev > 0)) { @@ -548,7 +474,7 @@ static void OPV_design (OPT_Node n, int16 prec) OPT_Struct typ = NIL; int16 class, designPrec, comp; OPT_Node d = NIL, x = NIL; - int16 dims, i, _for__27; + int16 dims, i, _for__26; comp = n->typ->comp; obj = n->obj; class = n->class; @@ -624,9 +550,9 @@ static void OPV_design (OPT_Node n, int16 prec) } x = x->left; } - _for__27 = dims; + _for__26 = dims; i = 1; - while (i <= _for__27) { + while (i <= _for__26) { OPM_Write(')'); i += 1; } @@ -1290,7 +1216,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(base->size); OPM_WriteString((CHAR*)", ", 3); - OPM_WriteInt(OPC_BaseAlignment(base)); + OPM_WriteInt(OPT_BaseAlignment(base)); OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(nofdim); OPM_WriteString((CHAR*)", ", 3); diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index c309d63c..09931dda 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h @@ -12,7 +12,6 @@ import void OPV_AdrAndSize (OPT_Object topScope); import void OPV_Init (void); import void OPV_Module (OPT_Node prog); -import void OPV_TypSize (OPT_Struct typ); import void *OPV__init(void); diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 016d1d64..8df906c3 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index 32d37057..d76d7ed5 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index fe93e8be..4b72fbe3 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index e7cba0d8..4a4c73b0 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index 427a0cc4..f765b98f 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index 44c51b2a..be1e7d7f 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index 8c41a062..6cb415b9 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index fa080b7f..dc456f77 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/Vishap.c b/bootstrap/unix-88/Vishap.c index 1ec89e33..30b81ac7 100644 --- a/bootstrap/unix-88/Vishap.c +++ b/bootstrap/unix-88/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspamSf */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define INTEGER int16 #define LONGINT int32 @@ -35,6 +35,7 @@ void Vishap_Module (BOOLEAN *done) OPP_Module(&p, OPM_opt); if (OPM_noerr) { OPV_Init(); + OPT_InitRecno(); OPV_AdrAndSize(OPT_topScope); OPT_Export(&ext, &new); if (OPM_noerr) { @@ -165,8 +166,6 @@ export int main(int argc, char **argv) Platform_SetInterruptHandler(Vishap_Trap); Platform_SetQuitHandler(Vishap_Trap); Platform_SetBadInstructionHandler(Vishap_Trap); - OPB_typSize = OPV_TypSize; - OPT_typSize = OPV_TypSize; Vishap_Translate(); __FINI; } diff --git a/bootstrap/unix-88/errors.c b/bootstrap/unix-88/errors.c index 0a40d5e9..d465624d 100644 --- a/bootstrap/unix-88/errors.c +++ b/bootstrap/unix-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-88/errors.h b/bootstrap/unix-88/errors.h index 759b613e..cf093ab3 100644 --- a/bootstrap/unix-88/errors.h +++ b/bootstrap/unix-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index 8be0b63d..46f8ac7e 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -89,7 +89,7 @@ void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN stati Strings_Append((CHAR*)" -o ", 5, (void*)cmd, 1023); Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); Strings_Append((CHAR*)" -L\"", 5, (void*)cmd, 1023); - Strings_Append((CHAR*)"/opt/voc", 9, (void*)cmd, 1023); + Strings_Append((CHAR*)"", 1, (void*)cmd, 1023); Strings_Append((CHAR*)"/lib\"", 6, (void*)cmd, 1023); Strings_Append((CHAR*)" -l voc", 8, (void*)cmd, 1023); extTools_execute((CHAR*)"Assemble and link: ", 20, cmd, 1023); @@ -108,7 +108,7 @@ export void *extTools__init(void) __REGMOD("extTools", 0); /* BEGIN */ Strings_Append((CHAR*)" -I \"", 6, (void*)extTools_compilationOptions, 1023); - Strings_Append((CHAR*)"/opt/voc", 9, (void*)extTools_compilationOptions, 1023); + Strings_Append((CHAR*)"", 1, (void*)extTools_compilationOptions, 1023); Strings_Append((CHAR*)"/include\" ", 11, (void*)extTools_compilationOptions, 1023); Platform_GetEnv((CHAR*)"CFLAGS", 7, (void*)extTools_CFLAGS, 1023); Strings_Append(extTools_CFLAGS, 1023, (void*)extTools_compilationOptions, 1023); diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index bff1c62c..700e6b39 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/vt100.c b/bootstrap/unix-88/vt100.c index 4f6a6c9d..8d4cbdfc 100644 --- a/bootstrap/unix-88/vt100.c +++ b/bootstrap/unix-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-88/vt100.h b/bootstrap/unix-88/vt100.h index 94f8add4..da86e98b 100644 --- a/bootstrap/unix-88/vt100.h +++ b/bootstrap/unix-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index abdf151b..7f7f4b26 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -7,7 +7,7 @@ #include "SYSTEM.h" -export CHAR Configuration_versionLong[41]; +export CHAR Configuration_versionLong[75]; @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/23] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index f51f63f2..618bc77f 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h @@ -6,7 +6,7 @@ #include "SYSTEM.h" -import CHAR Configuration_versionLong[41]; +import CHAR Configuration_versionLong[75]; import void *Configuration__init(void); diff --git a/bootstrap/windows-48/Console.c b/bootstrap/windows-48/Console.c index 7b492ced..8b55dc14 100644 --- a/bootstrap/windows-48/Console.c +++ b/bootstrap/windows-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Console.h b/bootstrap/windows-48/Console.h index b08c93ea..d645f05c 100644 --- a/bootstrap/windows-48/Console.h +++ b/bootstrap/windows-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 98974743..9a5d7c98 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index 80684752..3e6db0f2 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index b7c8c827..905fcb24 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tsSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index 6ad4813e..3ea975a7 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tsSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index 7704f005..21d62e05 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index 060208c6..d2d0a476 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index e09bf1b4..6c15aa17 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -10,7 +10,6 @@ #include "OPT.h" -export void (*OPB_typSize)(OPT_Struct); static int16 OPB_exp; static int64 OPB_maxExp; @@ -1917,7 +1916,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) OPB_err(110); x = OPB_NewIntConst(1); } else if (__IN(f, 0x18fe, 32) || __IN(x->typ->comp, 0x14, 32)) { - (*OPB_typSize)(x->typ); + OPT_TypSize(x->typ); x->typ->pvused = 1; x = OPB_NewIntConst(x->typ->size); } else { diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index dc0085af..8395741b 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h @@ -8,7 +8,6 @@ #include "OPT.h" -import void (*OPB_typSize)(OPT_Struct); import void OPB_Assign (OPT_Node *x, OPT_Node y); diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 99353400..9104c5c4 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -17,10 +17,8 @@ static BOOLEAN OPC_GlbPtrs; static CHAR OPC_BodyNameExt[13]; -export void OPC_Align (int32 *adr, int32 base); export void OPC_Andent (OPT_Struct typ); static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames); -export int32 OPC_BaseAlignment (OPT_Struct typ); export OPT_Object OPC_BaseTProc (OPT_Object obj); export void OPC_BegBlk (void); export void OPC_BegStat (void); @@ -79,7 +77,6 @@ static void OPC_PutBase (OPT_Struct typ); static void OPC_PutPtrOffsets (OPT_Struct typ, int32 adr, int32 *cnt); static void OPC_RegCmds (OPT_Object obj); export void OPC_SetInclude (BOOLEAN exclude); -export int32 OPC_SizeAlignment (int32 size); static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause); static void OPC_Str1 (CHAR *s, LONGINT s__len, int32 x); static void OPC_StringLiteral (CHAR *s, LONGINT s__len, int32 l); @@ -750,7 +747,7 @@ static void OPC_CProcDefs (OPT_Object obj, int16 vis) { int16 i; OPT_ConstExt ext = NIL; - int16 _for__9; + int16 _for__7; if (obj != NIL) { OPC_CProcDefs(obj->left, vis); if ((((obj->mode == 9 && (int16)obj->vis >= vis)) && obj->adr == 1)) { @@ -762,9 +759,9 @@ static void OPC_CProcDefs (OPT_Object obj, int16 vis) OPC_DeclareParams(obj->link, 1); OPM_Write(0x09); } - _for__9 = (int16)(*obj->conval->ext)[0]; + _for__7 = (int16)(*obj->conval->ext)[0]; i = i; - while (i <= _for__9) { + while (i <= _for__7) { OPM_Write((*obj->conval->ext)[__X(i, 256)]); i += 1; } @@ -843,64 +840,11 @@ void OPC_InitTDesc (OPT_Struct typ) } } -void OPC_Align (int32 *adr, int32 base) -{ - switch (base) { - case 2: - *adr += __MASK(*adr, -2); - break; - case 4: - *adr += __MASK(-*adr, -4); - break; - case 8: - *adr += __MASK(-*adr, -8); - break; - case 16: - *adr += __MASK(-*adr, -16); - break; - default: - break; - } -} - -int32 OPC_SizeAlignment (int32 size) -{ - int32 _o_result; - int32 alignment; - if (size < OPM_Alignment) { - alignment = 1; - while (alignment < size) { - alignment = __ASHL(alignment, 1); - } - } else { - alignment = OPM_Alignment; - } - _o_result = alignment; - return _o_result; -} - -int32 OPC_BaseAlignment (OPT_Struct typ) -{ - int32 _o_result; - int32 alignment; - if (typ->form == 13) { - if (typ->comp == 4) { - alignment = __MASK(typ->align, -65536); - } else { - alignment = OPC_BaseAlignment(typ->BaseTyp); - } - } else { - alignment = OPC_SizeAlignment(typ->size); - } - _o_result = alignment; - return _o_result; -} - static void OPC_FillGap (int32 gap, int32 off, int32 align, int32 *n, int32 *curAlign) { int32 adr; adr = off; - OPC_Align(&adr, align); + OPT_Align(&adr, align); if ((*curAlign < align && gap - (adr - off) >= align)) { gap -= (adr - off) + align; OPC_BegStat(); @@ -955,8 +899,8 @@ static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, int32 *off, int32 *n, i } } else { adr = *off; - fldAlign = OPC_BaseAlignment(fld->typ); - OPC_Align(&adr, fldAlign); + fldAlign = OPT_BaseAlignment(fld->typ); + OPT_Align(&adr, fldAlign); gap = fld->adr - adr; if (fldAlign > *curAlign) { *curAlign = fldAlign; @@ -1205,7 +1149,7 @@ static void OPC_GenHeaderMsg (void) OPM_WriteString((CHAR*)"/* ", 4); OPM_WriteString((CHAR*)"voc", 4); OPM_Write(' '); - OPM_WriteString(Configuration_versionLong, 41); + OPM_WriteString(Configuration_versionLong, 75); OPM_Write(' '); i = 0; while (i <= 31) { @@ -1966,84 +1910,84 @@ void OPC_Constant (OPT_Const con, int16 form) } } -static struct InitKeywords__48 { +static struct InitKeywords__46 { int8 *n; - struct InitKeywords__48 *lnk; -} *InitKeywords__48_s; + struct InitKeywords__46 *lnk; +} *InitKeywords__46_s; -static void Enter__49 (CHAR *s, LONGINT s__len); +static void Enter__47 (CHAR *s, LONGINT s__len); -static void Enter__49 (CHAR *s, LONGINT s__len) +static void Enter__47 (CHAR *s, LONGINT s__len) { int16 h; __DUP(s, s__len, CHAR); h = OPC_PerfectHash((void*)s, s__len); - OPC_hashtab[__X(h, 105)] = *InitKeywords__48_s->n; - __COPY(s, OPC_keytab[__X(*InitKeywords__48_s->n, 50)], 9); - *InitKeywords__48_s->n += 1; + OPC_hashtab[__X(h, 105)] = *InitKeywords__46_s->n; + __COPY(s, OPC_keytab[__X(*InitKeywords__46_s->n, 50)], 9); + *InitKeywords__46_s->n += 1; __DEL(s); } static void OPC_InitKeywords (void) { int8 n, i; - struct InitKeywords__48 _s; + struct InitKeywords__46 _s; _s.n = &n; - _s.lnk = InitKeywords__48_s; - InitKeywords__48_s = &_s; + _s.lnk = InitKeywords__46_s; + InitKeywords__46_s = &_s; n = 0; i = 0; while (i <= 104) { OPC_hashtab[__X(i, 105)] = -1; i += 1; } - Enter__49((CHAR*)"address", 8); - Enter__49((CHAR*)"asm", 4); - Enter__49((CHAR*)"auto", 5); - Enter__49((CHAR*)"break", 6); - Enter__49((CHAR*)"case", 5); - Enter__49((CHAR*)"char", 5); - Enter__49((CHAR*)"const", 6); - Enter__49((CHAR*)"continue", 9); - Enter__49((CHAR*)"default", 8); - Enter__49((CHAR*)"do", 3); - Enter__49((CHAR*)"double", 7); - Enter__49((CHAR*)"else", 5); - Enter__49((CHAR*)"enum", 5); - Enter__49((CHAR*)"extern", 7); - Enter__49((CHAR*)"export", 7); - Enter__49((CHAR*)"float", 6); - Enter__49((CHAR*)"for", 4); - Enter__49((CHAR*)"fortran", 8); - Enter__49((CHAR*)"goto", 5); - Enter__49((CHAR*)"if", 3); - Enter__49((CHAR*)"import", 7); - Enter__49((CHAR*)"int", 4); - Enter__49((CHAR*)"int16", 6); - Enter__49((CHAR*)"int32", 6); - Enter__49((CHAR*)"int64", 6); - Enter__49((CHAR*)"int8", 5); - Enter__49((CHAR*)"long", 5); - Enter__49((CHAR*)"register", 9); - Enter__49((CHAR*)"return", 7); - Enter__49((CHAR*)"short", 6); - Enter__49((CHAR*)"signed", 7); - Enter__49((CHAR*)"sizeof", 7); - Enter__49((CHAR*)"size_t", 7); - Enter__49((CHAR*)"static", 7); - Enter__49((CHAR*)"struct", 7); - Enter__49((CHAR*)"switch", 7); - Enter__49((CHAR*)"typedef", 8); - Enter__49((CHAR*)"uint16", 7); - Enter__49((CHAR*)"uint32", 7); - Enter__49((CHAR*)"uint64", 7); - Enter__49((CHAR*)"uint8", 6); - Enter__49((CHAR*)"union", 6); - Enter__49((CHAR*)"unsigned", 9); - Enter__49((CHAR*)"void", 5); - Enter__49((CHAR*)"volatile", 9); - Enter__49((CHAR*)"while", 6); - InitKeywords__48_s = _s.lnk; + Enter__47((CHAR*)"address", 8); + Enter__47((CHAR*)"asm", 4); + Enter__47((CHAR*)"auto", 5); + Enter__47((CHAR*)"break", 6); + Enter__47((CHAR*)"case", 5); + Enter__47((CHAR*)"char", 5); + Enter__47((CHAR*)"const", 6); + Enter__47((CHAR*)"continue", 9); + Enter__47((CHAR*)"default", 8); + Enter__47((CHAR*)"do", 3); + Enter__47((CHAR*)"double", 7); + Enter__47((CHAR*)"else", 5); + Enter__47((CHAR*)"enum", 5); + Enter__47((CHAR*)"extern", 7); + Enter__47((CHAR*)"export", 7); + Enter__47((CHAR*)"float", 6); + Enter__47((CHAR*)"for", 4); + Enter__47((CHAR*)"fortran", 8); + Enter__47((CHAR*)"goto", 5); + Enter__47((CHAR*)"if", 3); + Enter__47((CHAR*)"import", 7); + Enter__47((CHAR*)"int", 4); + Enter__47((CHAR*)"int16", 6); + Enter__47((CHAR*)"int32", 6); + Enter__47((CHAR*)"int64", 6); + Enter__47((CHAR*)"int8", 5); + Enter__47((CHAR*)"long", 5); + Enter__47((CHAR*)"register", 9); + Enter__47((CHAR*)"return", 7); + Enter__47((CHAR*)"short", 6); + Enter__47((CHAR*)"signed", 7); + Enter__47((CHAR*)"sizeof", 7); + Enter__47((CHAR*)"size_t", 7); + Enter__47((CHAR*)"static", 7); + Enter__47((CHAR*)"struct", 7); + Enter__47((CHAR*)"switch", 7); + Enter__47((CHAR*)"typedef", 8); + Enter__47((CHAR*)"uint16", 7); + Enter__47((CHAR*)"uint32", 7); + Enter__47((CHAR*)"uint64", 7); + Enter__47((CHAR*)"uint8", 6); + Enter__47((CHAR*)"union", 6); + Enter__47((CHAR*)"unsigned", 9); + Enter__47((CHAR*)"void", 5); + Enter__47((CHAR*)"volatile", 9); + Enter__47((CHAR*)"while", 6); + InitKeywords__46_s = _s.lnk; } diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index 4215947f..6236cd73 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h @@ -9,9 +9,7 @@ -import void OPC_Align (int32 *adr, int32 base); import void OPC_Andent (OPT_Struct typ); -import int32 OPC_BaseAlignment (OPT_Struct typ); import OPT_Object OPC_BaseTProc (OPT_Object obj); import void OPC_BegBlk (void); import void OPC_BegStat (void); @@ -41,7 +39,6 @@ import void OPC_IntLiteral (int64 n, int32 size); import void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim); import int32 OPC_NofPtrs (OPT_Struct typ); import void OPC_SetInclude (BOOLEAN exclude); -import int32 OPC_SizeAlignment (int32 size); import void OPC_TDescDecl (OPT_Struct typ); import void OPC_TypeDefs (OPT_Object obj, int16 vis); import void OPC_TypeOf (OPT_Object ap); diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 8b1f6805..9297c0a3 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -223,6 +223,7 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) OPM_AddressSize = (int16)s[__X(i + 1, s__len)] - 48; OPM_Alignment = (int16)s[__X(i + 2, s__len)] - 48; i += 2; + Files_SetSearchPath((CHAR*)"", 1); } break; case 'B': @@ -270,7 +271,7 @@ BOOLEAN OPM_OpenPar (void) if (Platform_ArgCount == 1) { OPM_LogWLn(); OPM_LogWStr((CHAR*)"Oberon-2 compiler v", 20); - OPM_LogWStr(Configuration_versionLong, 41); + OPM_LogWStr(Configuration_versionLong, 75); OPM_LogW('.'); OPM_LogWLn(); OPM_LogWStr((CHAR*)"Based on Ofront by Software Templ OEG.", 39); @@ -1118,7 +1119,7 @@ export void *OPM__init(void) Strings_Append((CHAR*)";.;", 4, (void*)OPM_OBERON, 1024); Strings_Append(OPM_MODULES, 1024, (void*)OPM_OBERON, 1024); Strings_Append((CHAR*)";", 2, (void*)OPM_OBERON, 1024); - Strings_Append((CHAR*)"/opt/voc", 9, (void*)OPM_OBERON, 1024); + Strings_Append((CHAR*)"", 1, (void*)OPM_OBERON, 1024); Strings_Append((CHAR*)"/sym;", 6, (void*)OPM_OBERON, 1024); Files_SetSearchPath(OPM_OBERON, 1024); OPM_AddressSize = 4; diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index 96af4022..b62666db 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index a3ab1dd3..66b821d2 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index e5a59f6c..ea6663ba 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index 0cac83bd..2b449cae 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index caef45f4..8d90d974 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index c52efac6..1b69128c 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -87,7 +87,6 @@ typedef } OPT_StrDesc; -export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; export OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj; @@ -100,6 +99,7 @@ static OPT_ImpCtxt OPT_impCtxt; static OPT_ExpCtxt OPT_expCtxt; static int32 OPT_nofhdfld; static BOOLEAN OPT_newsf, OPT_findpc, OPT_extsf, OPT_sfpresent, OPT_symExtended, OPT_symNew; +static int32 OPT_recno; export address *OPT_ConstDesc__typ; export address *OPT_ObjDesc__typ; @@ -108,6 +108,8 @@ export address *OPT_NodeDesc__typ; export address *OPT_ImpCtxt__typ; export address *OPT_ExpCtxt__typ; +export void OPT_Align (int32 *adr, int32 base); +export int32 OPT_BaseAlignment (OPT_Struct typ); export void OPT_Close (void); export void OPT_CloseScope (void); static void OPT_DebugStruct (OPT_Struct btyp); @@ -136,6 +138,7 @@ static void OPT_InStruct (OPT_Struct *typ); static OPT_Object OPT_InTProc (int8 mno); static OPT_Struct OPT_InTyp (int32 tag); export void OPT_Init (OPS_Name name, SET opt); +export void OPT_InitRecno (void); static void OPT_InitStruct (OPT_Struct *typ, int8 form); export void OPT_Insert (OPS_Name name, OPT_Object *obj); export void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); @@ -157,9 +160,16 @@ static void OPT_OutSign (OPT_Struct result, OPT_Object par); static void OPT_OutStr (OPT_Struct typ); static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj); export OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir); +export int32 OPT_SizeAlignment (int32 size); +export void OPT_TypSize (OPT_Struct typ); static void OPT_err (int16 n); +void OPT_InitRecno (void) +{ + OPT_recno = 0; +} + static void OPT_err (int16 n) { OPM_err(n); @@ -240,6 +250,130 @@ OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir) __RETCHK; } +void OPT_Align (int32 *adr, int32 base) +{ + switch (base) { + case 2: + *adr += __MASK(*adr, -2); + break; + case 4: + *adr += __MASK(-*adr, -4); + break; + case 8: + *adr += __MASK(-*adr, -8); + break; + case 16: + *adr += __MASK(-*adr, -16); + break; + default: + break; + } +} + +int32 OPT_SizeAlignment (int32 size) +{ + int32 _o_result; + int32 alignment; + if (size < OPM_Alignment) { + alignment = 1; + while (alignment < size) { + alignment = __ASHL(alignment, 1); + } + } else { + alignment = OPM_Alignment; + } + _o_result = alignment; + return _o_result; +} + +int32 OPT_BaseAlignment (OPT_Struct typ) +{ + int32 _o_result; + int32 alignment; + if (typ->form == 13) { + if (typ->comp == 4) { + alignment = __MASK(typ->align, -65536); + } else { + alignment = OPT_BaseAlignment(typ->BaseTyp); + } + } else { + alignment = OPT_SizeAlignment(typ->size); + } + _o_result = alignment; + return _o_result; +} + +void OPT_TypSize (OPT_Struct typ) +{ + int16 f, c; + int32 offset, size, base, fbase, off0; + OPT_Object fld = NIL; + OPT_Struct btyp = NIL; + if (typ == OPT_undftyp) { + OPM_err(58); + } else if (typ->size == -1) { + f = typ->form; + c = typ->comp; + if (c == 4) { + btyp = typ->BaseTyp; + if (btyp == NIL) { + offset = 0; + base = 1; + } else { + OPT_TypSize(btyp); + offset = btyp->size - __ASHR(btyp->sysflag, 8); + base = btyp->align; + } + fld = typ->link; + while ((fld != NIL && fld->mode == 4)) { + btyp = fld->typ; + OPT_TypSize(btyp); + size = btyp->size; + fbase = OPT_BaseAlignment(btyp); + OPT_Align(&offset, fbase); + fld->adr = offset; + offset += size; + if (fbase > base) { + base = fbase; + } + fld = fld->link; + } + off0 = offset; + if (offset == 0) { + offset = 1; + } + OPT_Align(&offset, base); + if ((typ->strobj == NIL && __MASK(typ->align, -65536) == 0)) { + OPT_recno += 1; + base += __ASHL(OPT_recno, 16); + } + typ->size = offset; + typ->align = base; + typ->sysflag = __MASK(typ->sysflag, -256) + (int16)__ASHL(offset - off0, 8); + } else if (c == 2) { + OPT_TypSize(typ->BaseTyp); + typ->size = typ->n * typ->BaseTyp->size; + } else if (f == 11) { + typ->size = OPM_AddressSize; + if (typ->BaseTyp == OPT_undftyp) { + OPM_Mark(128, typ->n); + } else { + OPT_TypSize(typ->BaseTyp); + } + } else if (f == 12) { + typ->size = OPM_AddressSize; + } else if (c == 3) { + btyp = typ->BaseTyp; + OPT_TypSize(btyp); + if (btyp->comp == 3) { + typ->size = btyp->size + 4; + } else { + typ->size = 8; + } + } + } +} + OPT_Const OPT_NewConst (void) { OPT_Const _o_result; @@ -552,21 +686,21 @@ void OPT_IdFPrint (OPT_Struct typ) } } -static struct FPrintStr__13 { +static struct FPrintStr__15 { int32 *pbfp, *pvfp; - struct FPrintStr__13 *lnk; -} *FPrintStr__13_s; + struct FPrintStr__15 *lnk; +} *FPrintStr__15_s; -static void FPrintFlds__14 (OPT_Object fld, int32 adr, BOOLEAN visible); -static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, int32 adr); -static void FPrintTProcs__18 (OPT_Object obj); +static void FPrintFlds__16 (OPT_Object fld, int32 adr, BOOLEAN visible); +static void FPrintHdFld__18 (OPT_Struct typ, OPT_Object fld, int32 adr); +static void FPrintTProcs__20 (OPT_Object obj); -static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, int32 adr) +static void FPrintHdFld__18 (OPT_Struct typ, OPT_Object fld, int32 adr) { int32 i, j, n; OPT_Struct btyp = NIL; if (typ->comp == 4) { - FPrintFlds__14(typ->link, adr, 0); + FPrintFlds__16(typ->link, adr, 0); } else if (typ->comp == 2) { btyp = typ->BaseTyp; n = typ->n; @@ -576,53 +710,53 @@ static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, int32 adr) } if (btyp->form == 11 || btyp->comp == 4) { j = OPT_nofhdfld; - FPrintHdFld__16(btyp, fld, adr); + FPrintHdFld__18(btyp, fld, adr); if (j != OPT_nofhdfld) { i = 1; while ((i < n && OPT_nofhdfld <= 2048)) { adr += btyp->size; - FPrintHdFld__16(btyp, fld, adr); + FPrintHdFld__18(btyp, fld, adr); i += 1; } } } } else if (typ->form == 11 || __STRCMP(fld->name, "@ptr") == 0) { - OPM_FPrint(&*FPrintStr__13_s->pvfp, 11); - OPM_FPrint(&*FPrintStr__13_s->pvfp, adr); + OPM_FPrint(&*FPrintStr__15_s->pvfp, 11); + OPM_FPrint(&*FPrintStr__15_s->pvfp, adr); OPT_nofhdfld += 1; } } -static void FPrintFlds__14 (OPT_Object fld, int32 adr, BOOLEAN visible) +static void FPrintFlds__16 (OPT_Object fld, int32 adr, BOOLEAN visible) { while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { - OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->vis); - OPT_FPrintName(&*FPrintStr__13_s->pbfp, (void*)fld->name, 256); - OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->adr); + OPM_FPrint(&*FPrintStr__15_s->pbfp, fld->vis); + OPT_FPrintName(&*FPrintStr__15_s->pbfp, (void*)fld->name, 256); + OPM_FPrint(&*FPrintStr__15_s->pbfp, fld->adr); OPT_FPrintStr(fld->typ); - OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->typ->pbfp); - OPM_FPrint(&*FPrintStr__13_s->pvfp, fld->typ->pvfp); + OPM_FPrint(&*FPrintStr__15_s->pbfp, fld->typ->pbfp); + OPM_FPrint(&*FPrintStr__15_s->pvfp, fld->typ->pvfp); } else { - FPrintHdFld__16(fld->typ, fld, fld->adr + adr); + FPrintHdFld__18(fld->typ, fld, fld->adr + adr); } fld = fld->link; } } -static void FPrintTProcs__18 (OPT_Object obj) +static void FPrintTProcs__20 (OPT_Object obj) { if (obj != NIL) { - FPrintTProcs__18(obj->left); + FPrintTProcs__20(obj->left); if (obj->mode == 13) { if (obj->vis != 0) { - OPM_FPrint(&*FPrintStr__13_s->pbfp, 13); - OPM_FPrint(&*FPrintStr__13_s->pbfp, __ASHR(obj->adr, 16)); - OPT_FPrintSign(&*FPrintStr__13_s->pbfp, obj->typ, obj->link); - OPT_FPrintName(&*FPrintStr__13_s->pbfp, (void*)obj->name, 256); + OPM_FPrint(&*FPrintStr__15_s->pbfp, 13); + OPM_FPrint(&*FPrintStr__15_s->pbfp, __ASHR(obj->adr, 16)); + OPT_FPrintSign(&*FPrintStr__15_s->pbfp, obj->typ, obj->link); + OPT_FPrintName(&*FPrintStr__15_s->pbfp, (void*)obj->name, 256); } } - FPrintTProcs__18(obj->right); + FPrintTProcs__20(obj->right); } } @@ -632,11 +766,11 @@ void OPT_FPrintStr (OPT_Struct typ) OPT_Struct btyp = NIL; OPT_Object strobj = NIL, bstrobj = NIL; int32 pbfp, pvfp; - struct FPrintStr__13 _s; + struct FPrintStr__15 _s; _s.pbfp = &pbfp; _s.pvfp = &pvfp; - _s.lnk = FPrintStr__13_s; - FPrintStr__13_s = &_s; + _s.lnk = FPrintStr__15_s; + FPrintStr__15_s = &_s; if (!typ->fpdone) { OPT_IdFPrint(typ); pbfp = typ->idfp; @@ -673,11 +807,11 @@ void OPT_FPrintStr (OPT_Struct typ) OPM_FPrint(&pvfp, typ->align); OPM_FPrint(&pvfp, typ->n); OPT_nofhdfld = 0; - FPrintFlds__14(typ->link, 0, 1); + FPrintFlds__16(typ->link, 0, 1); if (OPT_nofhdfld > 2048) { OPM_Mark(225, typ->txtpos); } - FPrintTProcs__18(typ->link); + FPrintTProcs__20(typ->link); OPM_FPrint(&pvfp, pbfp); strobj = typ->strobj; if (strobj == NIL || strobj->name[0] == 0x00) { @@ -687,7 +821,7 @@ void OPT_FPrintStr (OPT_Struct typ) typ->pbfp = pbfp; typ->pvfp = pvfp; } - FPrintStr__13_s = _s.lnk; + FPrintStr__15_s = _s.lnk; } void OPT_FPrintObj (OPT_Object obj) @@ -1119,7 +1253,7 @@ static void OPT_InStruct (OPT_Struct *typ) (*typ)->comp = 2; OPT_InStruct(&(*typ)->BaseTyp); (*typ)->n = OPM_SymRInt(); - (*OPT_typSize)(*typ); + OPT_TypSize(*typ); break; case 38: (*typ)->form = 13; @@ -1130,7 +1264,7 @@ static void OPT_InStruct (OPT_Struct *typ) } else { (*typ)->n = 0; } - (*OPT_typSize)(*typ); + OPT_TypSize(*typ); break; case 39: (*typ)->form = 13; @@ -1899,6 +2033,7 @@ export void *OPT__init(void) __REGMOD("OPT", EnumPtrs); __REGCMD("Close", OPT_Close); __REGCMD("CloseScope", OPT_CloseScope); + __REGCMD("InitRecno", OPT_InitRecno); __INITYP(OPT_ConstDesc, OPT_ConstDesc, 0); __INITYP(OPT_ObjDesc, OPT_ObjDesc, 0); __INITYP(OPT_StrDesc, OPT_StrDesc, 0); diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index 0bd1f189..1a525fcb 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h @@ -66,7 +66,6 @@ typedef } OPT_StrDesc; -import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; import OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj; @@ -80,6 +79,8 @@ import address *OPT_ObjDesc__typ; import address *OPT_StrDesc__typ; import address *OPT_NodeDesc__typ; +import void OPT_Align (int32 *adr, int32 base); +import int32 OPT_BaseAlignment (OPT_Struct typ); import void OPT_Close (void); import void OPT_CloseScope (void); import void OPT_Export (BOOLEAN *ext, BOOLEAN *new); @@ -92,6 +93,7 @@ import void OPT_FindImport (OPT_Object mod, OPT_Object *res); import void OPT_IdFPrint (OPT_Struct typ); import void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); import void OPT_Init (OPS_Name name, SET opt); +import void OPT_InitRecno (void); import void OPT_Insert (OPS_Name name, OPT_Object *obj); import void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); import int16 OPT_IntSize (int64 n); @@ -103,6 +105,8 @@ import OPT_Object OPT_NewObj (void); import OPT_Struct OPT_NewStr (int8 form, int8 comp); import void OPT_OpenScope (int8 level, OPT_Object owner); import OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir); +import int32 OPT_SizeAlignment (int32 size); +import void OPT_TypSize (OPT_Struct typ); import void *OPT__init(void); diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index 8bb5ec32..cdb2ab50 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -17,7 +17,6 @@ typedef static int16 OPV_stamp; -static int32 OPV_recno; static OPV_ExitInfo OPV_exit; static int16 OPV_nofExitLabels; @@ -46,88 +45,15 @@ static void OPV_Stamp (OPS_Name s); static OPT_Object OPV_SuperProc (OPT_Node n); static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported); static void OPV_TraverseRecord (OPT_Struct typ); -export void OPV_TypSize (OPT_Struct typ); static void OPV_TypeOf (OPT_Node n); static void OPV_design (OPT_Node n, int16 prec); static void OPV_expr (OPT_Node n, int16 prec); static void OPV_stat (OPT_Node n, OPT_Object outerProc); -void OPV_TypSize (OPT_Struct typ) -{ - int16 f, c; - int32 offset, size, base, fbase, off0; - OPT_Object fld = NIL; - OPT_Struct btyp = NIL; - if (typ == OPT_undftyp) { - OPM_err(58); - } else if (typ->size == -1) { - f = typ->form; - c = typ->comp; - if (c == 4) { - btyp = typ->BaseTyp; - if (btyp == NIL) { - offset = 0; - base = 1; - } else { - OPV_TypSize(btyp); - offset = btyp->size - __ASHR(btyp->sysflag, 8); - base = btyp->align; - } - fld = typ->link; - while ((fld != NIL && fld->mode == 4)) { - btyp = fld->typ; - OPV_TypSize(btyp); - size = btyp->size; - fbase = OPC_BaseAlignment(btyp); - OPC_Align(&offset, fbase); - fld->adr = offset; - offset += size; - if (fbase > base) { - base = fbase; - } - fld = fld->link; - } - off0 = offset; - if (offset == 0) { - offset = 1; - } - OPC_Align(&offset, base); - if ((typ->strobj == NIL && __MASK(typ->align, -65536) == 0)) { - OPV_recno += 1; - base += __ASHL(OPV_recno, 16); - } - typ->size = offset; - typ->align = base; - typ->sysflag = __MASK(typ->sysflag, -256) + (int16)__ASHL(offset - off0, 8); - } else if (c == 2) { - OPV_TypSize(typ->BaseTyp); - typ->size = typ->n * typ->BaseTyp->size; - } else if (f == 11) { - typ->size = OPM_AddressSize; - if (typ->BaseTyp == OPT_undftyp) { - OPM_Mark(128, typ->n); - } else { - OPV_TypSize(typ->BaseTyp); - } - } else if (f == 12) { - typ->size = OPM_AddressSize; - } else if (c == 3) { - btyp = typ->BaseTyp; - OPV_TypSize(btyp); - if (btyp->comp == 3) { - typ->size = btyp->size + 4; - } else { - typ->size = 8; - } - } - } -} - void OPV_Init (void) { OPV_stamp = 0; - OPV_recno = 0; OPV_nofExitLabels = 0; } @@ -212,7 +138,7 @@ static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exporte mode = obj->mode; if ((mode == 5 && (obj->vis != 0) == exported)) { typ = obj->typ; - OPV_TypSize(obj->typ); + OPT_TypSize(obj->typ); if (typ->form == 11) { typ = typ->BaseTyp; } @@ -222,7 +148,7 @@ static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exporte } else if (mode == 13) { OPV_GetTProcNum(obj); } else if (mode == 1) { - OPV_TypSize(obj->typ); + OPT_TypSize(obj->typ); } if (!exported) { if ((__IN(mode, 0x60, 32) && obj->mnolev > 0)) { @@ -548,7 +474,7 @@ static void OPV_design (OPT_Node n, int16 prec) OPT_Struct typ = NIL; int16 class, designPrec, comp; OPT_Node d = NIL, x = NIL; - int16 dims, i, _for__27; + int16 dims, i, _for__26; comp = n->typ->comp; obj = n->obj; class = n->class; @@ -624,9 +550,9 @@ static void OPV_design (OPT_Node n, int16 prec) } x = x->left; } - _for__27 = dims; + _for__26 = dims; i = 1; - while (i <= _for__27) { + while (i <= _for__26) { OPM_Write(')'); i += 1; } @@ -1290,7 +1216,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(base->size); OPM_WriteString((CHAR*)", ", 3); - OPM_WriteInt(OPC_BaseAlignment(base)); + OPM_WriteInt(OPT_BaseAlignment(base)); OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(nofdim); OPM_WriteString((CHAR*)", ", 3); diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index c309d63c..09931dda 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h @@ -12,7 +12,6 @@ import void OPV_AdrAndSize (OPT_Object topScope); import void OPV_Init (void); import void OPV_Module (OPT_Node prog); -import void OPV_TypSize (OPT_Struct typ); import void *OPV__init(void); diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 8aeae1b8..21a73e4d 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index d62dd343..d697acd7 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index fe93e8be..4b72fbe3 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index e7cba0d8..4a4c73b0 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index 427a0cc4..f765b98f 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index 44c51b2a..be1e7d7f 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index 60a7ea7a..779daa7a 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index df86e814..07f53445 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/Vishap.c b/bootstrap/windows-48/Vishap.c index 1ec89e33..30b81ac7 100644 --- a/bootstrap/windows-48/Vishap.c +++ b/bootstrap/windows-48/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspamSf */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define INTEGER int16 #define LONGINT int32 @@ -35,6 +35,7 @@ void Vishap_Module (BOOLEAN *done) OPP_Module(&p, OPM_opt); if (OPM_noerr) { OPV_Init(); + OPT_InitRecno(); OPV_AdrAndSize(OPT_topScope); OPT_Export(&ext, &new); if (OPM_noerr) { @@ -165,8 +166,6 @@ export int main(int argc, char **argv) Platform_SetInterruptHandler(Vishap_Trap); Platform_SetQuitHandler(Vishap_Trap); Platform_SetBadInstructionHandler(Vishap_Trap); - OPB_typSize = OPV_TypSize; - OPT_typSize = OPV_TypSize; Vishap_Translate(); __FINI; } diff --git a/bootstrap/windows-48/errors.c b/bootstrap/windows-48/errors.c index 0a40d5e9..d465624d 100644 --- a/bootstrap/windows-48/errors.c +++ b/bootstrap/windows-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/errors.h b/bootstrap/windows-48/errors.h index 759b613e..cf093ab3 100644 --- a/bootstrap/windows-48/errors.h +++ b/bootstrap/windows-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index 8be0b63d..46f8ac7e 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -89,7 +89,7 @@ void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN stati Strings_Append((CHAR*)" -o ", 5, (void*)cmd, 1023); Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); Strings_Append((CHAR*)" -L\"", 5, (void*)cmd, 1023); - Strings_Append((CHAR*)"/opt/voc", 9, (void*)cmd, 1023); + Strings_Append((CHAR*)"", 1, (void*)cmd, 1023); Strings_Append((CHAR*)"/lib\"", 6, (void*)cmd, 1023); Strings_Append((CHAR*)" -l voc", 8, (void*)cmd, 1023); extTools_execute((CHAR*)"Assemble and link: ", 20, cmd, 1023); @@ -108,7 +108,7 @@ export void *extTools__init(void) __REGMOD("extTools", 0); /* BEGIN */ Strings_Append((CHAR*)" -I \"", 6, (void*)extTools_compilationOptions, 1023); - Strings_Append((CHAR*)"/opt/voc", 9, (void*)extTools_compilationOptions, 1023); + Strings_Append((CHAR*)"", 1, (void*)extTools_compilationOptions, 1023); Strings_Append((CHAR*)"/include\" ", 11, (void*)extTools_compilationOptions, 1023); Platform_GetEnv((CHAR*)"CFLAGS", 7, (void*)extTools_CFLAGS, 1023); Strings_Append(extTools_CFLAGS, 1023, (void*)extTools_compilationOptions, 1023); diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index bff1c62c..700e6b39 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/vt100.c b/bootstrap/windows-48/vt100.c index 4f6a6c9d..8d4cbdfc 100644 --- a/bootstrap/windows-48/vt100.c +++ b/bootstrap/windows-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/vt100.h b/bootstrap/windows-48/vt100.h index 94f8add4..da86e98b 100644 --- a/bootstrap/windows-48/vt100.h +++ b/bootstrap/windows-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index abdf151b..7f7f4b26 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -7,7 +7,7 @@ #include "SYSTEM.h" -export CHAR Configuration_versionLong[41]; +export CHAR Configuration_versionLong[75]; @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/23] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index f51f63f2..618bc77f 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h @@ -6,7 +6,7 @@ #include "SYSTEM.h" -import CHAR Configuration_versionLong[41]; +import CHAR Configuration_versionLong[75]; import void *Configuration__init(void); diff --git a/bootstrap/windows-88/Console.c b/bootstrap/windows-88/Console.c index 7b492ced..8b55dc14 100644 --- a/bootstrap/windows-88/Console.c +++ b/bootstrap/windows-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-88/Console.h b/bootstrap/windows-88/Console.h index b08c93ea..d645f05c 100644 --- a/bootstrap/windows-88/Console.h +++ b/bootstrap/windows-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index c30a1491..1071d452 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 13fccd9a..1a73a6ec 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index 16ae9ffd..785efa1a 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tsSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index 151a2d59..cfa2ab6f 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tsSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index f844dfa9..b6890cfe 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index 060208c6..d2d0a476 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index e09bf1b4..6c15aa17 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -10,7 +10,6 @@ #include "OPT.h" -export void (*OPB_typSize)(OPT_Struct); static int16 OPB_exp; static int64 OPB_maxExp; @@ -1917,7 +1916,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) OPB_err(110); x = OPB_NewIntConst(1); } else if (__IN(f, 0x18fe, 32) || __IN(x->typ->comp, 0x14, 32)) { - (*OPB_typSize)(x->typ); + OPT_TypSize(x->typ); x->typ->pvused = 1; x = OPB_NewIntConst(x->typ->size); } else { diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index dc0085af..8395741b 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h @@ -8,7 +8,6 @@ #include "OPT.h" -import void (*OPB_typSize)(OPT_Struct); import void OPB_Assign (OPT_Node *x, OPT_Node y); diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index 99353400..9104c5c4 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -17,10 +17,8 @@ static BOOLEAN OPC_GlbPtrs; static CHAR OPC_BodyNameExt[13]; -export void OPC_Align (int32 *adr, int32 base); export void OPC_Andent (OPT_Struct typ); static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames); -export int32 OPC_BaseAlignment (OPT_Struct typ); export OPT_Object OPC_BaseTProc (OPT_Object obj); export void OPC_BegBlk (void); export void OPC_BegStat (void); @@ -79,7 +77,6 @@ static void OPC_PutBase (OPT_Struct typ); static void OPC_PutPtrOffsets (OPT_Struct typ, int32 adr, int32 *cnt); static void OPC_RegCmds (OPT_Object obj); export void OPC_SetInclude (BOOLEAN exclude); -export int32 OPC_SizeAlignment (int32 size); static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause); static void OPC_Str1 (CHAR *s, LONGINT s__len, int32 x); static void OPC_StringLiteral (CHAR *s, LONGINT s__len, int32 l); @@ -750,7 +747,7 @@ static void OPC_CProcDefs (OPT_Object obj, int16 vis) { int16 i; OPT_ConstExt ext = NIL; - int16 _for__9; + int16 _for__7; if (obj != NIL) { OPC_CProcDefs(obj->left, vis); if ((((obj->mode == 9 && (int16)obj->vis >= vis)) && obj->adr == 1)) { @@ -762,9 +759,9 @@ static void OPC_CProcDefs (OPT_Object obj, int16 vis) OPC_DeclareParams(obj->link, 1); OPM_Write(0x09); } - _for__9 = (int16)(*obj->conval->ext)[0]; + _for__7 = (int16)(*obj->conval->ext)[0]; i = i; - while (i <= _for__9) { + while (i <= _for__7) { OPM_Write((*obj->conval->ext)[__X(i, 256)]); i += 1; } @@ -843,64 +840,11 @@ void OPC_InitTDesc (OPT_Struct typ) } } -void OPC_Align (int32 *adr, int32 base) -{ - switch (base) { - case 2: - *adr += __MASK(*adr, -2); - break; - case 4: - *adr += __MASK(-*adr, -4); - break; - case 8: - *adr += __MASK(-*adr, -8); - break; - case 16: - *adr += __MASK(-*adr, -16); - break; - default: - break; - } -} - -int32 OPC_SizeAlignment (int32 size) -{ - int32 _o_result; - int32 alignment; - if (size < OPM_Alignment) { - alignment = 1; - while (alignment < size) { - alignment = __ASHL(alignment, 1); - } - } else { - alignment = OPM_Alignment; - } - _o_result = alignment; - return _o_result; -} - -int32 OPC_BaseAlignment (OPT_Struct typ) -{ - int32 _o_result; - int32 alignment; - if (typ->form == 13) { - if (typ->comp == 4) { - alignment = __MASK(typ->align, -65536); - } else { - alignment = OPC_BaseAlignment(typ->BaseTyp); - } - } else { - alignment = OPC_SizeAlignment(typ->size); - } - _o_result = alignment; - return _o_result; -} - static void OPC_FillGap (int32 gap, int32 off, int32 align, int32 *n, int32 *curAlign) { int32 adr; adr = off; - OPC_Align(&adr, align); + OPT_Align(&adr, align); if ((*curAlign < align && gap - (adr - off) >= align)) { gap -= (adr - off) + align; OPC_BegStat(); @@ -955,8 +899,8 @@ static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, int32 *off, int32 *n, i } } else { adr = *off; - fldAlign = OPC_BaseAlignment(fld->typ); - OPC_Align(&adr, fldAlign); + fldAlign = OPT_BaseAlignment(fld->typ); + OPT_Align(&adr, fldAlign); gap = fld->adr - adr; if (fldAlign > *curAlign) { *curAlign = fldAlign; @@ -1205,7 +1149,7 @@ static void OPC_GenHeaderMsg (void) OPM_WriteString((CHAR*)"/* ", 4); OPM_WriteString((CHAR*)"voc", 4); OPM_Write(' '); - OPM_WriteString(Configuration_versionLong, 41); + OPM_WriteString(Configuration_versionLong, 75); OPM_Write(' '); i = 0; while (i <= 31) { @@ -1966,84 +1910,84 @@ void OPC_Constant (OPT_Const con, int16 form) } } -static struct InitKeywords__48 { +static struct InitKeywords__46 { int8 *n; - struct InitKeywords__48 *lnk; -} *InitKeywords__48_s; + struct InitKeywords__46 *lnk; +} *InitKeywords__46_s; -static void Enter__49 (CHAR *s, LONGINT s__len); +static void Enter__47 (CHAR *s, LONGINT s__len); -static void Enter__49 (CHAR *s, LONGINT s__len) +static void Enter__47 (CHAR *s, LONGINT s__len) { int16 h; __DUP(s, s__len, CHAR); h = OPC_PerfectHash((void*)s, s__len); - OPC_hashtab[__X(h, 105)] = *InitKeywords__48_s->n; - __COPY(s, OPC_keytab[__X(*InitKeywords__48_s->n, 50)], 9); - *InitKeywords__48_s->n += 1; + OPC_hashtab[__X(h, 105)] = *InitKeywords__46_s->n; + __COPY(s, OPC_keytab[__X(*InitKeywords__46_s->n, 50)], 9); + *InitKeywords__46_s->n += 1; __DEL(s); } static void OPC_InitKeywords (void) { int8 n, i; - struct InitKeywords__48 _s; + struct InitKeywords__46 _s; _s.n = &n; - _s.lnk = InitKeywords__48_s; - InitKeywords__48_s = &_s; + _s.lnk = InitKeywords__46_s; + InitKeywords__46_s = &_s; n = 0; i = 0; while (i <= 104) { OPC_hashtab[__X(i, 105)] = -1; i += 1; } - Enter__49((CHAR*)"address", 8); - Enter__49((CHAR*)"asm", 4); - Enter__49((CHAR*)"auto", 5); - Enter__49((CHAR*)"break", 6); - Enter__49((CHAR*)"case", 5); - Enter__49((CHAR*)"char", 5); - Enter__49((CHAR*)"const", 6); - Enter__49((CHAR*)"continue", 9); - Enter__49((CHAR*)"default", 8); - Enter__49((CHAR*)"do", 3); - Enter__49((CHAR*)"double", 7); - Enter__49((CHAR*)"else", 5); - Enter__49((CHAR*)"enum", 5); - Enter__49((CHAR*)"extern", 7); - Enter__49((CHAR*)"export", 7); - Enter__49((CHAR*)"float", 6); - Enter__49((CHAR*)"for", 4); - Enter__49((CHAR*)"fortran", 8); - Enter__49((CHAR*)"goto", 5); - Enter__49((CHAR*)"if", 3); - Enter__49((CHAR*)"import", 7); - Enter__49((CHAR*)"int", 4); - Enter__49((CHAR*)"int16", 6); - Enter__49((CHAR*)"int32", 6); - Enter__49((CHAR*)"int64", 6); - Enter__49((CHAR*)"int8", 5); - Enter__49((CHAR*)"long", 5); - Enter__49((CHAR*)"register", 9); - Enter__49((CHAR*)"return", 7); - Enter__49((CHAR*)"short", 6); - Enter__49((CHAR*)"signed", 7); - Enter__49((CHAR*)"sizeof", 7); - Enter__49((CHAR*)"size_t", 7); - Enter__49((CHAR*)"static", 7); - Enter__49((CHAR*)"struct", 7); - Enter__49((CHAR*)"switch", 7); - Enter__49((CHAR*)"typedef", 8); - Enter__49((CHAR*)"uint16", 7); - Enter__49((CHAR*)"uint32", 7); - Enter__49((CHAR*)"uint64", 7); - Enter__49((CHAR*)"uint8", 6); - Enter__49((CHAR*)"union", 6); - Enter__49((CHAR*)"unsigned", 9); - Enter__49((CHAR*)"void", 5); - Enter__49((CHAR*)"volatile", 9); - Enter__49((CHAR*)"while", 6); - InitKeywords__48_s = _s.lnk; + Enter__47((CHAR*)"address", 8); + Enter__47((CHAR*)"asm", 4); + Enter__47((CHAR*)"auto", 5); + Enter__47((CHAR*)"break", 6); + Enter__47((CHAR*)"case", 5); + Enter__47((CHAR*)"char", 5); + Enter__47((CHAR*)"const", 6); + Enter__47((CHAR*)"continue", 9); + Enter__47((CHAR*)"default", 8); + Enter__47((CHAR*)"do", 3); + Enter__47((CHAR*)"double", 7); + Enter__47((CHAR*)"else", 5); + Enter__47((CHAR*)"enum", 5); + Enter__47((CHAR*)"extern", 7); + Enter__47((CHAR*)"export", 7); + Enter__47((CHAR*)"float", 6); + Enter__47((CHAR*)"for", 4); + Enter__47((CHAR*)"fortran", 8); + Enter__47((CHAR*)"goto", 5); + Enter__47((CHAR*)"if", 3); + Enter__47((CHAR*)"import", 7); + Enter__47((CHAR*)"int", 4); + Enter__47((CHAR*)"int16", 6); + Enter__47((CHAR*)"int32", 6); + Enter__47((CHAR*)"int64", 6); + Enter__47((CHAR*)"int8", 5); + Enter__47((CHAR*)"long", 5); + Enter__47((CHAR*)"register", 9); + Enter__47((CHAR*)"return", 7); + Enter__47((CHAR*)"short", 6); + Enter__47((CHAR*)"signed", 7); + Enter__47((CHAR*)"sizeof", 7); + Enter__47((CHAR*)"size_t", 7); + Enter__47((CHAR*)"static", 7); + Enter__47((CHAR*)"struct", 7); + Enter__47((CHAR*)"switch", 7); + Enter__47((CHAR*)"typedef", 8); + Enter__47((CHAR*)"uint16", 7); + Enter__47((CHAR*)"uint32", 7); + Enter__47((CHAR*)"uint64", 7); + Enter__47((CHAR*)"uint8", 6); + Enter__47((CHAR*)"union", 6); + Enter__47((CHAR*)"unsigned", 9); + Enter__47((CHAR*)"void", 5); + Enter__47((CHAR*)"volatile", 9); + Enter__47((CHAR*)"while", 6); + InitKeywords__46_s = _s.lnk; } diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index 4215947f..6236cd73 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h @@ -9,9 +9,7 @@ -import void OPC_Align (int32 *adr, int32 base); import void OPC_Andent (OPT_Struct typ); -import int32 OPC_BaseAlignment (OPT_Struct typ); import OPT_Object OPC_BaseTProc (OPT_Object obj); import void OPC_BegBlk (void); import void OPC_BegStat (void); @@ -41,7 +39,6 @@ import void OPC_IntLiteral (int64 n, int32 size); import void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim); import int32 OPC_NofPtrs (OPT_Struct typ); import void OPC_SetInclude (BOOLEAN exclude); -import int32 OPC_SizeAlignment (int32 size); import void OPC_TDescDecl (OPT_Struct typ); import void OPC_TypeDefs (OPT_Object obj, int16 vis); import void OPC_TypeOf (OPT_Object ap); diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 931ecb18..7b566324 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -223,6 +223,7 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) OPM_AddressSize = (int16)s[__X(i + 1, s__len)] - 48; OPM_Alignment = (int16)s[__X(i + 2, s__len)] - 48; i += 2; + Files_SetSearchPath((CHAR*)"", 1); } break; case 'B': @@ -270,7 +271,7 @@ BOOLEAN OPM_OpenPar (void) if (Platform_ArgCount == 1) { OPM_LogWLn(); OPM_LogWStr((CHAR*)"Oberon-2 compiler v", 20); - OPM_LogWStr(Configuration_versionLong, 41); + OPM_LogWStr(Configuration_versionLong, 75); OPM_LogW('.'); OPM_LogWLn(); OPM_LogWStr((CHAR*)"Based on Ofront by Software Templ OEG.", 39); @@ -1118,7 +1119,7 @@ export void *OPM__init(void) Strings_Append((CHAR*)";.;", 4, (void*)OPM_OBERON, 1024); Strings_Append(OPM_MODULES, 1024, (void*)OPM_OBERON, 1024); Strings_Append((CHAR*)";", 2, (void*)OPM_OBERON, 1024); - Strings_Append((CHAR*)"/opt/voc", 9, (void*)OPM_OBERON, 1024); + Strings_Append((CHAR*)"", 1, (void*)OPM_OBERON, 1024); Strings_Append((CHAR*)"/sym;", 6, (void*)OPM_OBERON, 1024); Files_SetSearchPath(OPM_OBERON, 1024); OPM_AddressSize = 8; diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index 96af4022..b62666db 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index 74f93e77..03366726 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index e5a59f6c..ea6663ba 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index 0cac83bd..2b449cae 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index caef45f4..8d90d974 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index d40808d2..c9ff5430 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -87,7 +87,6 @@ typedef } OPT_StrDesc; -export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; export OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj; @@ -100,6 +99,7 @@ static OPT_ImpCtxt OPT_impCtxt; static OPT_ExpCtxt OPT_expCtxt; static int32 OPT_nofhdfld; static BOOLEAN OPT_newsf, OPT_findpc, OPT_extsf, OPT_sfpresent, OPT_symExtended, OPT_symNew; +static int32 OPT_recno; export address *OPT_ConstDesc__typ; export address *OPT_ObjDesc__typ; @@ -108,6 +108,8 @@ export address *OPT_NodeDesc__typ; export address *OPT_ImpCtxt__typ; export address *OPT_ExpCtxt__typ; +export void OPT_Align (int32 *adr, int32 base); +export int32 OPT_BaseAlignment (OPT_Struct typ); export void OPT_Close (void); export void OPT_CloseScope (void); static void OPT_DebugStruct (OPT_Struct btyp); @@ -136,6 +138,7 @@ static void OPT_InStruct (OPT_Struct *typ); static OPT_Object OPT_InTProc (int8 mno); static OPT_Struct OPT_InTyp (int32 tag); export void OPT_Init (OPS_Name name, SET opt); +export void OPT_InitRecno (void); static void OPT_InitStruct (OPT_Struct *typ, int8 form); export void OPT_Insert (OPS_Name name, OPT_Object *obj); export void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); @@ -157,9 +160,16 @@ static void OPT_OutSign (OPT_Struct result, OPT_Object par); static void OPT_OutStr (OPT_Struct typ); static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj); export OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir); +export int32 OPT_SizeAlignment (int32 size); +export void OPT_TypSize (OPT_Struct typ); static void OPT_err (int16 n); +void OPT_InitRecno (void) +{ + OPT_recno = 0; +} + static void OPT_err (int16 n) { OPM_err(n); @@ -240,6 +250,130 @@ OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir) __RETCHK; } +void OPT_Align (int32 *adr, int32 base) +{ + switch (base) { + case 2: + *adr += __MASK(*adr, -2); + break; + case 4: + *adr += __MASK(-*adr, -4); + break; + case 8: + *adr += __MASK(-*adr, -8); + break; + case 16: + *adr += __MASK(-*adr, -16); + break; + default: + break; + } +} + +int32 OPT_SizeAlignment (int32 size) +{ + int32 _o_result; + int32 alignment; + if (size < OPM_Alignment) { + alignment = 1; + while (alignment < size) { + alignment = __ASHL(alignment, 1); + } + } else { + alignment = OPM_Alignment; + } + _o_result = alignment; + return _o_result; +} + +int32 OPT_BaseAlignment (OPT_Struct typ) +{ + int32 _o_result; + int32 alignment; + if (typ->form == 13) { + if (typ->comp == 4) { + alignment = __MASK(typ->align, -65536); + } else { + alignment = OPT_BaseAlignment(typ->BaseTyp); + } + } else { + alignment = OPT_SizeAlignment(typ->size); + } + _o_result = alignment; + return _o_result; +} + +void OPT_TypSize (OPT_Struct typ) +{ + int16 f, c; + int32 offset, size, base, fbase, off0; + OPT_Object fld = NIL; + OPT_Struct btyp = NIL; + if (typ == OPT_undftyp) { + OPM_err(58); + } else if (typ->size == -1) { + f = typ->form; + c = typ->comp; + if (c == 4) { + btyp = typ->BaseTyp; + if (btyp == NIL) { + offset = 0; + base = 1; + } else { + OPT_TypSize(btyp); + offset = btyp->size - __ASHR(btyp->sysflag, 8); + base = btyp->align; + } + fld = typ->link; + while ((fld != NIL && fld->mode == 4)) { + btyp = fld->typ; + OPT_TypSize(btyp); + size = btyp->size; + fbase = OPT_BaseAlignment(btyp); + OPT_Align(&offset, fbase); + fld->adr = offset; + offset += size; + if (fbase > base) { + base = fbase; + } + fld = fld->link; + } + off0 = offset; + if (offset == 0) { + offset = 1; + } + OPT_Align(&offset, base); + if ((typ->strobj == NIL && __MASK(typ->align, -65536) == 0)) { + OPT_recno += 1; + base += __ASHL(OPT_recno, 16); + } + typ->size = offset; + typ->align = base; + typ->sysflag = __MASK(typ->sysflag, -256) + (int16)__ASHL(offset - off0, 8); + } else if (c == 2) { + OPT_TypSize(typ->BaseTyp); + typ->size = typ->n * typ->BaseTyp->size; + } else if (f == 11) { + typ->size = OPM_AddressSize; + if (typ->BaseTyp == OPT_undftyp) { + OPM_Mark(128, typ->n); + } else { + OPT_TypSize(typ->BaseTyp); + } + } else if (f == 12) { + typ->size = OPM_AddressSize; + } else if (c == 3) { + btyp = typ->BaseTyp; + OPT_TypSize(btyp); + if (btyp->comp == 3) { + typ->size = btyp->size + 4; + } else { + typ->size = 8; + } + } + } +} + OPT_Const OPT_NewConst (void) { OPT_Const _o_result; @@ -552,21 +686,21 @@ void OPT_IdFPrint (OPT_Struct typ) } } -static struct FPrintStr__13 { +static struct FPrintStr__15 { int32 *pbfp, *pvfp; - struct FPrintStr__13 *lnk; -} *FPrintStr__13_s; + struct FPrintStr__15 *lnk; +} *FPrintStr__15_s; -static void FPrintFlds__14 (OPT_Object fld, int32 adr, BOOLEAN visible); -static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, int32 adr); -static void FPrintTProcs__18 (OPT_Object obj); +static void FPrintFlds__16 (OPT_Object fld, int32 adr, BOOLEAN visible); +static void FPrintHdFld__18 (OPT_Struct typ, OPT_Object fld, int32 adr); +static void FPrintTProcs__20 (OPT_Object obj); -static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, int32 adr) +static void FPrintHdFld__18 (OPT_Struct typ, OPT_Object fld, int32 adr) { int32 i, j, n; OPT_Struct btyp = NIL; if (typ->comp == 4) { - FPrintFlds__14(typ->link, adr, 0); + FPrintFlds__16(typ->link, adr, 0); } else if (typ->comp == 2) { btyp = typ->BaseTyp; n = typ->n; @@ -576,53 +710,53 @@ static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, int32 adr) } if (btyp->form == 11 || btyp->comp == 4) { j = OPT_nofhdfld; - FPrintHdFld__16(btyp, fld, adr); + FPrintHdFld__18(btyp, fld, adr); if (j != OPT_nofhdfld) { i = 1; while ((i < n && OPT_nofhdfld <= 2048)) { adr += btyp->size; - FPrintHdFld__16(btyp, fld, adr); + FPrintHdFld__18(btyp, fld, adr); i += 1; } } } } else if (typ->form == 11 || __STRCMP(fld->name, "@ptr") == 0) { - OPM_FPrint(&*FPrintStr__13_s->pvfp, 11); - OPM_FPrint(&*FPrintStr__13_s->pvfp, adr); + OPM_FPrint(&*FPrintStr__15_s->pvfp, 11); + OPM_FPrint(&*FPrintStr__15_s->pvfp, adr); OPT_nofhdfld += 1; } } -static void FPrintFlds__14 (OPT_Object fld, int32 adr, BOOLEAN visible) +static void FPrintFlds__16 (OPT_Object fld, int32 adr, BOOLEAN visible) { while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { - OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->vis); - OPT_FPrintName(&*FPrintStr__13_s->pbfp, (void*)fld->name, 256); - OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->adr); + OPM_FPrint(&*FPrintStr__15_s->pbfp, fld->vis); + OPT_FPrintName(&*FPrintStr__15_s->pbfp, (void*)fld->name, 256); + OPM_FPrint(&*FPrintStr__15_s->pbfp, fld->adr); OPT_FPrintStr(fld->typ); - OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->typ->pbfp); - OPM_FPrint(&*FPrintStr__13_s->pvfp, fld->typ->pvfp); + OPM_FPrint(&*FPrintStr__15_s->pbfp, fld->typ->pbfp); + OPM_FPrint(&*FPrintStr__15_s->pvfp, fld->typ->pvfp); } else { - FPrintHdFld__16(fld->typ, fld, fld->adr + adr); + FPrintHdFld__18(fld->typ, fld, fld->adr + adr); } fld = fld->link; } } -static void FPrintTProcs__18 (OPT_Object obj) +static void FPrintTProcs__20 (OPT_Object obj) { if (obj != NIL) { - FPrintTProcs__18(obj->left); + FPrintTProcs__20(obj->left); if (obj->mode == 13) { if (obj->vis != 0) { - OPM_FPrint(&*FPrintStr__13_s->pbfp, 13); - OPM_FPrint(&*FPrintStr__13_s->pbfp, __ASHR(obj->adr, 16)); - OPT_FPrintSign(&*FPrintStr__13_s->pbfp, obj->typ, obj->link); - OPT_FPrintName(&*FPrintStr__13_s->pbfp, (void*)obj->name, 256); + OPM_FPrint(&*FPrintStr__15_s->pbfp, 13); + OPM_FPrint(&*FPrintStr__15_s->pbfp, __ASHR(obj->adr, 16)); + OPT_FPrintSign(&*FPrintStr__15_s->pbfp, obj->typ, obj->link); + OPT_FPrintName(&*FPrintStr__15_s->pbfp, (void*)obj->name, 256); } } - FPrintTProcs__18(obj->right); + FPrintTProcs__20(obj->right); } } @@ -632,11 +766,11 @@ void OPT_FPrintStr (OPT_Struct typ) OPT_Struct btyp = NIL; OPT_Object strobj = NIL, bstrobj = NIL; int32 pbfp, pvfp; - struct FPrintStr__13 _s; + struct FPrintStr__15 _s; _s.pbfp = &pbfp; _s.pvfp = &pvfp; - _s.lnk = FPrintStr__13_s; - FPrintStr__13_s = &_s; + _s.lnk = FPrintStr__15_s; + FPrintStr__15_s = &_s; if (!typ->fpdone) { OPT_IdFPrint(typ); pbfp = typ->idfp; @@ -673,11 +807,11 @@ void OPT_FPrintStr (OPT_Struct typ) OPM_FPrint(&pvfp, typ->align); OPM_FPrint(&pvfp, typ->n); OPT_nofhdfld = 0; - FPrintFlds__14(typ->link, 0, 1); + FPrintFlds__16(typ->link, 0, 1); if (OPT_nofhdfld > 2048) { OPM_Mark(225, typ->txtpos); } - FPrintTProcs__18(typ->link); + FPrintTProcs__20(typ->link); OPM_FPrint(&pvfp, pbfp); strobj = typ->strobj; if (strobj == NIL || strobj->name[0] == 0x00) { @@ -687,7 +821,7 @@ void OPT_FPrintStr (OPT_Struct typ) typ->pbfp = pbfp; typ->pvfp = pvfp; } - FPrintStr__13_s = _s.lnk; + FPrintStr__15_s = _s.lnk; } void OPT_FPrintObj (OPT_Object obj) @@ -1119,7 +1253,7 @@ static void OPT_InStruct (OPT_Struct *typ) (*typ)->comp = 2; OPT_InStruct(&(*typ)->BaseTyp); (*typ)->n = OPM_SymRInt(); - (*OPT_typSize)(*typ); + OPT_TypSize(*typ); break; case 38: (*typ)->form = 13; @@ -1130,7 +1264,7 @@ static void OPT_InStruct (OPT_Struct *typ) } else { (*typ)->n = 0; } - (*OPT_typSize)(*typ); + OPT_TypSize(*typ); break; case 39: (*typ)->form = 13; @@ -1899,6 +2033,7 @@ export void *OPT__init(void) __REGMOD("OPT", EnumPtrs); __REGCMD("Close", OPT_Close); __REGCMD("CloseScope", OPT_CloseScope); + __REGCMD("InitRecno", OPT_InitRecno); __INITYP(OPT_ConstDesc, OPT_ConstDesc, 0); __INITYP(OPT_ObjDesc, OPT_ObjDesc, 0); __INITYP(OPT_StrDesc, OPT_StrDesc, 0); diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 0bd1f189..1a525fcb 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h @@ -66,7 +66,6 @@ typedef } OPT_StrDesc; -import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; import OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj; @@ -80,6 +79,8 @@ import address *OPT_ObjDesc__typ; import address *OPT_StrDesc__typ; import address *OPT_NodeDesc__typ; +import void OPT_Align (int32 *adr, int32 base); +import int32 OPT_BaseAlignment (OPT_Struct typ); import void OPT_Close (void); import void OPT_CloseScope (void); import void OPT_Export (BOOLEAN *ext, BOOLEAN *new); @@ -92,6 +93,7 @@ import void OPT_FindImport (OPT_Object mod, OPT_Object *res); import void OPT_IdFPrint (OPT_Struct typ); import void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); import void OPT_Init (OPS_Name name, SET opt); +import void OPT_InitRecno (void); import void OPT_Insert (OPS_Name name, OPT_Object *obj); import void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); import int16 OPT_IntSize (int64 n); @@ -103,6 +105,8 @@ import OPT_Object OPT_NewObj (void); import OPT_Struct OPT_NewStr (int8 form, int8 comp); import void OPT_OpenScope (int8 level, OPT_Object owner); import OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir); +import int32 OPT_SizeAlignment (int32 size); +import void OPT_TypSize (OPT_Struct typ); import void *OPT__init(void); diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 8ef2c450..f9e7c27c 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -17,7 +17,6 @@ typedef static int16 OPV_stamp; -static int32 OPV_recno; static OPV_ExitInfo OPV_exit; static int16 OPV_nofExitLabels; @@ -46,88 +45,15 @@ static void OPV_Stamp (OPS_Name s); static OPT_Object OPV_SuperProc (OPT_Node n); static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported); static void OPV_TraverseRecord (OPT_Struct typ); -export void OPV_TypSize (OPT_Struct typ); static void OPV_TypeOf (OPT_Node n); static void OPV_design (OPT_Node n, int16 prec); static void OPV_expr (OPT_Node n, int16 prec); static void OPV_stat (OPT_Node n, OPT_Object outerProc); -void OPV_TypSize (OPT_Struct typ) -{ - int16 f, c; - int32 offset, size, base, fbase, off0; - OPT_Object fld = NIL; - OPT_Struct btyp = NIL; - if (typ == OPT_undftyp) { - OPM_err(58); - } else if (typ->size == -1) { - f = typ->form; - c = typ->comp; - if (c == 4) { - btyp = typ->BaseTyp; - if (btyp == NIL) { - offset = 0; - base = 1; - } else { - OPV_TypSize(btyp); - offset = btyp->size - __ASHR(btyp->sysflag, 8); - base = btyp->align; - } - fld = typ->link; - while ((fld != NIL && fld->mode == 4)) { - btyp = fld->typ; - OPV_TypSize(btyp); - size = btyp->size; - fbase = OPC_BaseAlignment(btyp); - OPC_Align(&offset, fbase); - fld->adr = offset; - offset += size; - if (fbase > base) { - base = fbase; - } - fld = fld->link; - } - off0 = offset; - if (offset == 0) { - offset = 1; - } - OPC_Align(&offset, base); - if ((typ->strobj == NIL && __MASK(typ->align, -65536) == 0)) { - OPV_recno += 1; - base += __ASHL(OPV_recno, 16); - } - typ->size = offset; - typ->align = base; - typ->sysflag = __MASK(typ->sysflag, -256) + (int16)__ASHL(offset - off0, 8); - } else if (c == 2) { - OPV_TypSize(typ->BaseTyp); - typ->size = typ->n * typ->BaseTyp->size; - } else if (f == 11) { - typ->size = OPM_AddressSize; - if (typ->BaseTyp == OPT_undftyp) { - OPM_Mark(128, typ->n); - } else { - OPV_TypSize(typ->BaseTyp); - } - } else if (f == 12) { - typ->size = OPM_AddressSize; - } else if (c == 3) { - btyp = typ->BaseTyp; - OPV_TypSize(btyp); - if (btyp->comp == 3) { - typ->size = btyp->size + 4; - } else { - typ->size = 8; - } - } - } -} - void OPV_Init (void) { OPV_stamp = 0; - OPV_recno = 0; OPV_nofExitLabels = 0; } @@ -212,7 +138,7 @@ static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exporte mode = obj->mode; if ((mode == 5 && (obj->vis != 0) == exported)) { typ = obj->typ; - OPV_TypSize(obj->typ); + OPT_TypSize(obj->typ); if (typ->form == 11) { typ = typ->BaseTyp; } @@ -222,7 +148,7 @@ static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exporte } else if (mode == 13) { OPV_GetTProcNum(obj); } else if (mode == 1) { - OPV_TypSize(obj->typ); + OPT_TypSize(obj->typ); } if (!exported) { if ((__IN(mode, 0x60, 32) && obj->mnolev > 0)) { @@ -548,7 +474,7 @@ static void OPV_design (OPT_Node n, int16 prec) OPT_Struct typ = NIL; int16 class, designPrec, comp; OPT_Node d = NIL, x = NIL; - int16 dims, i, _for__27; + int16 dims, i, _for__26; comp = n->typ->comp; obj = n->obj; class = n->class; @@ -624,9 +550,9 @@ static void OPV_design (OPT_Node n, int16 prec) } x = x->left; } - _for__27 = dims; + _for__26 = dims; i = 1; - while (i <= _for__27) { + while (i <= _for__26) { OPM_Write(')'); i += 1; } @@ -1290,7 +1216,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(base->size); OPM_WriteString((CHAR*)", ", 3); - OPM_WriteInt(OPC_BaseAlignment(base)); + OPM_WriteInt(OPT_BaseAlignment(base)); OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(nofdim); OPM_WriteString((CHAR*)", ", 3); diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index c309d63c..09931dda 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h @@ -12,7 +12,6 @@ import void OPV_AdrAndSize (OPT_Object topScope); import void OPV_Init (void); import void OPV_Module (OPT_Node prog); -import void OPV_TypSize (OPT_Struct typ); import void *OPV__init(void); diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 59f9cfeb..8dc2c83e 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index d62dd343..d697acd7 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index fe93e8be..4b72fbe3 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index e7cba0d8..4a4c73b0 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index 427a0cc4..f765b98f 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index 44c51b2a..be1e7d7f 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index 8c41a062..6cb415b9 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index fa080b7f..dc456f77 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/Vishap.c b/bootstrap/windows-88/Vishap.c index 1ec89e33..30b81ac7 100644 --- a/bootstrap/windows-88/Vishap.c +++ b/bootstrap/windows-88/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspamSf */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define INTEGER int16 #define LONGINT int32 @@ -35,6 +35,7 @@ void Vishap_Module (BOOLEAN *done) OPP_Module(&p, OPM_opt); if (OPM_noerr) { OPV_Init(); + OPT_InitRecno(); OPV_AdrAndSize(OPT_topScope); OPT_Export(&ext, &new); if (OPM_noerr) { @@ -165,8 +166,6 @@ export int main(int argc, char **argv) Platform_SetInterruptHandler(Vishap_Trap); Platform_SetQuitHandler(Vishap_Trap); Platform_SetBadInstructionHandler(Vishap_Trap); - OPB_typSize = OPV_TypSize; - OPT_typSize = OPV_TypSize; Vishap_Translate(); __FINI; } diff --git a/bootstrap/windows-88/errors.c b/bootstrap/windows-88/errors.c index 0a40d5e9..d465624d 100644 --- a/bootstrap/windows-88/errors.c +++ b/bootstrap/windows-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-88/errors.h b/bootstrap/windows-88/errors.h index 759b613e..cf093ab3 100644 --- a/bootstrap/windows-88/errors.h +++ b/bootstrap/windows-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index 8be0b63d..46f8ac7e 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -89,7 +89,7 @@ void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN stati Strings_Append((CHAR*)" -o ", 5, (void*)cmd, 1023); Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); Strings_Append((CHAR*)" -L\"", 5, (void*)cmd, 1023); - Strings_Append((CHAR*)"/opt/voc", 9, (void*)cmd, 1023); + Strings_Append((CHAR*)"", 1, (void*)cmd, 1023); Strings_Append((CHAR*)"/lib\"", 6, (void*)cmd, 1023); Strings_Append((CHAR*)" -l voc", 8, (void*)cmd, 1023); extTools_execute((CHAR*)"Assemble and link: ", 20, cmd, 1023); @@ -108,7 +108,7 @@ export void *extTools__init(void) __REGMOD("extTools", 0); /* BEGIN */ Strings_Append((CHAR*)" -I \"", 6, (void*)extTools_compilationOptions, 1023); - Strings_Append((CHAR*)"/opt/voc", 9, (void*)extTools_compilationOptions, 1023); + Strings_Append((CHAR*)"", 1, (void*)extTools_compilationOptions, 1023); Strings_Append((CHAR*)"/include\" ", 11, (void*)extTools_compilationOptions, 1023); Platform_GetEnv((CHAR*)"CFLAGS", 7, (void*)extTools_CFLAGS, 1023); Strings_Append(extTools_CFLAGS, 1023, (void*)extTools_compilationOptions, 1023); diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index bff1c62c..700e6b39 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/vt100.c b/bootstrap/windows-88/vt100.c index 4f6a6c9d..8d4cbdfc 100644 --- a/bootstrap/windows-88/vt100.c +++ b/bootstrap/windows-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-88/vt100.h b/bootstrap/windows-88/vt100.h index 94f8add4..da86e98b 100644 --- a/bootstrap/windows-88/vt100.h +++ b/bootstrap/windows-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/makefile b/makefile index 491b28f1..c9feb82b 100644 --- a/makefile +++ b/makefile @@ -109,6 +109,14 @@ configuration: FORCE @echo Branch: $$(git rev-parse --abbrev-ref HEAD). +bootstrapconfiguration: FORCE + @$(CC) -I src/system -o a.o src/tools/make/configure.c + @./a.o bootstrap + @rm a.o + @echo BRANCH=$$(git rev-parse --abbrev-ref HEAD)>>Configuration.Make + @echo Branch: $$(git rev-parse --abbrev-ref HEAD). + + reportsizes: FORCE @@ -257,7 +265,7 @@ planned-binary-change: # bootstrap: Rebuild the bootstrap directories # If the bootstrap directories are broken or only partially # built then run 'make revertbootstrap' first. -bootstrap: configuration +bootstrap: bootstrapconfiguration @make -f src/tools/make/vishap.make -s clean @make -f src/tools/make/vishap.make -s translate @make -f src/tools/make/vishap.make -s assemble @@ -270,7 +278,7 @@ bootstrap: configuration cp src/system/*.[ch] bootstrap -bootstrapunclean: +bootstrapunclean: bootstrapconfiguration rm -rf bootstrap/* make -f src/tools/make/vishap.make -s translate MODEL=-O2 INTSIZE=2 ADRSIZE=4 ALIGNMENT=4 PLATFORM=unix BUILDDIR=bootstrap/unix-44 && rm bootstrap/unix-44/*.sym make -f src/tools/make/vishap.make -s translate MODEL=-O2 INTSIZE=2 ADRSIZE=4 ALIGNMENT=8 PLATFORM=unix BUILDDIR=bootstrap/unix-48 && rm bootstrap/unix-48/*.sym diff --git a/src/compiler/OPB.Mod b/src/compiler/OPB.Mod index e1ed3aa0..8382c965 100644 --- a/src/compiler/OPB.Mod +++ b/src/compiler/OPB.Mod @@ -9,7 +9,6 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) VAR - typSize*: PROCEDURE(typ: OPT.Struct); exp: INTEGER; (* side effect of log*) maxExp: SYSTEM.INT64; (* max n in ASH(1, n) on this machine *) @@ -1037,7 +1036,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) IF x^.class # OPT.Ntype THEN err(110); x := NewIntConst(1) ELSIF (f IN {OPT.Byte..OPT.Set, OPT.Pointer, OPT.ProcTyp}) OR (x^.typ^.comp IN {OPT.Array, OPT.Record}) THEN - typSize(x^.typ); x^.typ^.pvused := TRUE; x := NewIntConst(x^.typ^.size) + OPT.TypSize(x^.typ); x^.typ^.pvused := TRUE; x := NewIntConst(x^.typ^.size) ELSE err(111); x := NewIntConst(1) END |OPT.ccfn: (*SYSTEM.CC*) diff --git a/src/compiler/OPC.Mod b/src/compiler/OPC.Mod index 8059d5fb..456bcf87 100644 --- a/src/compiler/OPC.Mod +++ b/src/compiler/OPC.Mod @@ -553,46 +553,6 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) IF typ^.strobj # NIL THEN InitTProcs(typ^.strobj, typ^.link) END END InitTDesc; - PROCEDURE Align*(VAR adr: LONGINT; base: LONGINT); - BEGIN - CASE base OF - | 2: INC(adr, adr MOD 2) - | 4: INC(adr, (-adr) MOD 4) - | 8: INC(adr, (-adr) MOD 8) - | 16: INC(adr, (-adr) MOD 16) - ELSE (*1*) (*OPM.LogWStr("unhandled case at OPC.Align, base = "); OPM.LogWNum(base, 0); OPM.LogWLn;*) - END - END Align; - - PROCEDURE SizeAlignment*(size: LONGINT): LONGINT; - VAR alignment: LONGINT; - BEGIN - IF size < OPM.Alignment THEN - (* Round up to next power of 2 *) - alignment := 1; WHILE alignment < size DO alignment := alignment * 2 END; - ELSE - alignment := OPM.Alignment - END; - RETURN alignment - END SizeAlignment; - - - PROCEDURE BaseAlignment*(typ: OPT.Struct): LONGINT; - VAR alignment: LONGINT; - BEGIN - IF typ.form = OPT.Comp THEN - IF typ.comp = OPT.Record THEN - alignment := typ.align MOD 10000H - ELSE - alignment := BaseAlignment(typ.BaseTyp) - END - ELSE - alignment := SizeAlignment(typ.size) - END; - RETURN alignment - END BaseAlignment; - - PROCEDURE FillGap(gap, off, align: LONGINT; VAR n, curAlign: LONGINT); (* gap: Required gap - already calculated based on alignment requirements off: Current offset - where gap begins @@ -602,7 +562,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) *) VAR adr: LONGINT; BEGIN - adr := off; Align(adr, align); + adr := off; OPT.Align(adr, align); IF (curAlign < align) & (gap - (adr - off) >= align) THEN (* preserve alignment of the enclosing struct! *) DEC(gap, (adr - off) + align); BegStat; @@ -640,8 +600,8 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) ELSE (* mimic OPV.TypSize to detect gaps caused by private fields *) adr := off; - fldAlign := BaseAlignment(fld^.typ); - Align(adr, fldAlign); + fldAlign := OPT.BaseAlignment(fld^.typ); + OPT.Align(adr, fldAlign); gap := fld.adr - adr; IF fldAlign > curAlign THEN curAlign := fldAlign END; IF gap > 0 THEN diff --git a/src/compiler/OPT.Mod b/src/compiler/OPT.Mod index 7648fcec..bd95c80f 100644 --- a/src/compiler/OPT.Mod +++ b/src/compiler/OPT.Mod @@ -149,7 +149,6 @@ CONST FirstRef = Comp + 1; VAR - typSize*: PROCEDURE(typ: Struct); topScope*: Object; undftyp*, @@ -205,10 +204,11 @@ VAR newsf, findpc: BOOLEAN; extsf, sfpresent: BOOLEAN; symExtended, symNew: BOOLEAN; + recno: LONGINT; (* number of anonymous record types *) - +PROCEDURE InitRecno*; BEGIN recno := 0 END InitRecno; PROCEDURE err(n: INTEGER); BEGIN OPM.err(n) END err; @@ -250,6 +250,96 @@ BEGIN END ShorterOrLongerType; +PROCEDURE Align*(VAR adr: LONGINT; base: LONGINT); +BEGIN + CASE base OF + | 2: INC(adr, adr MOD 2) + | 4: INC(adr, (-adr) MOD 4) + | 8: INC(adr, (-adr) MOD 8) + | 16: INC(adr, (-adr) MOD 16) + ELSE (*1*) (*OPM.LogWStr("unhandled case at OPC.Align, base = "); OPM.LogWNum(base, 0); OPM.LogWLn;*) + END +END Align; + +PROCEDURE SizeAlignment*(size: LONGINT): LONGINT; + VAR alignment: LONGINT; +BEGIN + IF size < OPM.Alignment THEN + (* Round up to next power of 2 *) + alignment := 1; WHILE alignment < size DO alignment := alignment * 2 END; + ELSE + alignment := OPM.Alignment + END; + RETURN alignment +END SizeAlignment; + +PROCEDURE BaseAlignment*(typ: Struct): LONGINT; + VAR alignment: LONGINT; +BEGIN + IF typ.form = Comp THEN + IF typ.comp = Record THEN + alignment := typ.align MOD 10000H + ELSE + alignment := BaseAlignment(typ.BaseTyp) + END + ELSE + alignment := SizeAlignment(typ.size) + END; + RETURN alignment +END BaseAlignment; + +PROCEDURE TypSize*(typ: Struct); + VAR + f, c: INTEGER; + offset, size, base, fbase, off0: LONGINT; + fld: Object; btyp: Struct; +BEGIN + IF typ = undftyp THEN OPM.err(58) + ELSIF typ.size = -1 THEN + f := typ.form; + c := typ.comp; + IF c = Record THEN btyp := typ.BaseTyp; + IF btyp = NIL THEN offset := 0; base := 1; + ELSE TypSize(btyp); offset := btyp.size - btyp.sysflag DIV 100H; base := btyp.align; + END; + fld := typ.link; + WHILE (fld # NIL) & (fld.mode = Fld) DO + btyp := fld.typ; TypSize(btyp); + size := btyp.size; + fbase := BaseAlignment(btyp); + Align(offset, fbase); + fld.adr := offset; INC(offset, size); + IF fbase > base THEN base := fbase END; + fld := fld.link + END; + (* base is now the largest alignment of any field *) + off0 := offset; + IF offset = 0 THEN offset := 1 END; (* 1 byte filler to avoid empty struct *) + Align(offset, base); + IF (typ^.strobj = NIL) & (typ^.align MOD 10000H = 0) THEN INC(recno); INC(base, recno * 10000H) END; + typ.size := offset; + typ.align := base; + (* encode the trailing gap into the symbol table to allow dense packing of extended records *) + typ^.sysflag := typ^.sysflag MOD 100H + SHORT((offset - off0)*100H) + ELSIF c = Array THEN + TypSize(typ.BaseTyp); + typ.size := typ.n * typ.BaseTyp.size; + ELSIF f = Pointer THEN + typ.size := OPM.AddressSize; + IF typ.BaseTyp = undftyp THEN OPM.Mark(128, typ.n) + ELSE TypSize(typ.BaseTyp) + END + ELSIF f = ProcTyp THEN + typ.size := OPM.AddressSize; + ELSIF c = DynArr THEN + btyp := typ.BaseTyp; TypSize(btyp); + IF btyp.comp = DynArr THEN typ.size := btyp.size + 4 (* describes dim not size *) + ELSE typ.size := 8 + END + END + END +END TypSize; + PROCEDURE NewConst*(): Const; VAR const: Const; @@ -766,14 +856,14 @@ BEGIN typ^.n := 0; InStruct(typ^.BaseTyp) | Sarr: typ^.form := Comp; typ^.comp := Array; InStruct(typ^.BaseTyp); typ^.n := OPM.SymRInt(); - typSize(typ) (* no bounds address !! *) + TypSize(typ) (* no bounds address !! *) | Sdarr: typ^.form := Comp; typ^.comp := DynArr; InStruct(typ^.BaseTyp); IF typ^.BaseTyp^.comp = DynArr THEN typ^.n := typ^.BaseTyp^.n + 1 ELSE typ^.n := 0 END; - typSize(typ) + TypSize(typ) | Srec: typ^.form := Comp; typ^.comp := Record; InStruct(typ^.BaseTyp); IF typ^.BaseTyp = notyp THEN typ^.BaseTyp := NIL END; diff --git a/src/compiler/OPV.Mod b/src/compiler/OPV.Mod index 04da5f09..dafedf3d 100644 --- a/src/compiler/OPV.Mod +++ b/src/compiler/OPV.Mod @@ -47,62 +47,14 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 VAR stamp: INTEGER; (* unique number for nested objects *) - recno: LONGINT; (* number of anonymous record types *) exit: ExitInfo; (* to check if EXIT is simply a break *) nofExitLabels: INTEGER; - PROCEDURE TypSize*(typ: OPT.Struct); - VAR f, c: INTEGER; offset, size, base, fbase, off0: LONGINT; - fld: OPT.Object; btyp: OPT.Struct; - BEGIN - IF typ = OPT.undftyp THEN OPM.err(58) - ELSIF typ^.size = -1 THEN - f := typ^.form; c := typ^.comp; - IF c = OPT.Record THEN btyp := typ^.BaseTyp; - IF btyp = NIL THEN offset := 0; base := 1; - ELSE TypSize(btyp); offset := btyp^.size - btyp^.sysflag DIV 100H; base := btyp^.align; - END; - fld := typ^.link; - WHILE (fld # NIL) & (fld^.mode = OPT.Fld) DO - btyp := fld^.typ; TypSize(btyp); - size := btyp^.size; fbase := OPC.BaseAlignment(btyp); - OPC.Align(offset, fbase); - fld^.adr := offset; INC(offset, size); - IF fbase > base THEN base := fbase END ; - fld := fld^.link - END; - (* base is now the largest alignment of any field *) - off0 := offset; - IF offset = 0 THEN offset := 1 END ; (* 1 byte filler to avoid empty struct *) - OPC.Align(offset, base); - IF (typ^.strobj = NIL) & (typ^.align MOD 10000H = 0) THEN INC(recno); INC(base, recno * 10000H) END ; - typ^.size := offset; typ^.align := base; - (* encode the trailing gap into the symbol table to allow dense packing of extended records *) - typ^.sysflag := typ^.sysflag MOD 100H + SHORT((offset - off0)*100H) - ELSIF c = OPT.Array THEN - TypSize(typ^.BaseTyp); - typ^.size := typ^.n * typ^.BaseTyp^.size; - ELSIF f = OPT.Pointer THEN - typ^.size := OPM.AddressSize; - IF typ^.BaseTyp = OPT.undftyp THEN OPM.Mark(128, typ^.n) - ELSE TypSize(typ^.BaseTyp) - END - ELSIF f = OPT.ProcTyp THEN - typ^.size := OPM.AddressSize; - ELSIF c = OPT.DynArr THEN - btyp := typ^.BaseTyp; TypSize(btyp); - IF btyp^.comp = OPT.DynArr THEN typ^.size := btyp^.size + 4 (* describes dim not size *) - ELSE typ^.size := 8 - END - END - END - END TypSize; - PROCEDURE Init*; BEGIN - stamp := 0; recno := 0; nofExitLabels := 0; + stamp := 0; nofExitLabels := 0; END Init; PROCEDURE ^Traverse (obj, outerScope: OPT.Object; exported: BOOLEAN); @@ -150,11 +102,11 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 obj^.linkadr := UndefinedType; mode := obj^.mode; IF (mode = OPT.Typ) & ((obj^.vis # OPT.internal) = exported) THEN - typ := obj^.typ; TypSize(obj^.typ); + typ := obj^.typ; OPT.TypSize(obj^.typ); IF typ^.form = OPT.Pointer THEN typ := typ^.BaseTyp END ; IF typ^.comp = OPT.Record THEN TraverseRecord(typ) END ELSIF mode = OPT.TProc THEN GetTProcNum(obj) - ELSIF mode = OPT.Var THEN TypSize(obj^.typ) + ELSIF mode = OPT.Var THEN OPT.TypSize(obj^.typ) END ; IF ~exported THEN (* do this only once *) IF (mode IN {OPT.LProc, OPT.Typ}) & (obj^.mnolev > 0) THEN Stamp(obj^.name) END ; @@ -769,7 +721,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 ELSE OPM.WriteString("NIL") END ; OPM.WriteString(", "); OPM.WriteInt(base.size); - OPM.WriteString(", "); OPM.WriteInt(OPC.BaseAlignment(base)); (* element alignment *) + OPM.WriteString(", "); OPM.WriteInt(OPT.BaseAlignment(base)); (* element alignment *) OPM.WriteString(", "); OPM.WriteInt(nofdim); (* total number of dimensions = number of additional parameters *) OPM.WriteString(", "); OPM.WriteInt(nofdyn); (* number of dynamic dimensions *) WHILE typ # base DO diff --git a/src/compiler/Vishap.Mod b/src/compiler/Vishap.Mod index a898c9a4..12dc0a93 100644 --- a/src/compiler/Vishap.Mod +++ b/src/compiler/Vishap.Mod @@ -15,6 +15,7 @@ MODULE Vishap; (* J. Templ 3.2.95 *) OPP.Module(p, OPM.opt); IF OPM.noerr THEN OPV.Init; + OPT.InitRecno; OPV.AdrAndSize(OPT.topScope); OPT.Export(ext, new); IF OPM.noerr THEN @@ -129,7 +130,5 @@ BEGIN Platform.SetInterruptHandler(Trap); Platform.SetQuitHandler(Trap); Platform.SetBadInstructionHandler(Trap); - OPB.typSize := OPV.TypSize; - OPT.typSize := OPV.TypSize; Translate END Vishap. diff --git a/src/tools/make/configure.c b/src/tools/make/configure.c index 936c71bb..3cc542d4 100644 --- a/src/tools/make/configure.c +++ b/src/tools/make/configure.c @@ -69,6 +69,7 @@ int addressSize = 0; int intsize = 0; int bsd = 0; int termux = 0; +int bootstrap = 0; // 1 iff generating a bootstrap compiler. @@ -161,28 +162,32 @@ void determineCCompiler() { void determineInstallDirectory() { - char *env = getenv("INSTALLDIR"); - if (env) { - strncpy(installdir, env, sizeof(installdir)); + if (bootstrap) { + installdir[0] = 0; } else { - #if defined(_MSC_VER) || defined(__MINGW32__) - if (sizeof (void*) == 8) { - snprintf(installdir, sizeof(installdir), "%s\\%s", getenv("ProgramFiles"), oname); - } else { - snprintf(installdir, sizeof(installdir), "%s\\%s", getenv("ProgramFiles(x86)"), oname); - } - #if defined(__MINGW32__) - int i; for(i=0; installdir[i]; i++) if (installdir[i] == '\\') installdir[i] = '/'; + char *env = getenv("INSTALLDIR"); + if (env) { + strncpy(installdir, env, sizeof(installdir)); + } else { + #if defined(_MSC_VER) || defined(__MINGW32__) + if (sizeof (void*) == 8) { + snprintf(installdir, sizeof(installdir), "%s\\%s", getenv("ProgramFiles"), oname); + } else { + snprintf(installdir, sizeof(installdir), "%s\\%s", getenv("ProgramFiles(x86)"), oname); + } + #if defined(__MINGW32__) + int i; for(i=0; installdir[i]; i++) if (installdir[i] == '\\') installdir[i] = '/'; + #endif + #else + if (bsd) { + snprintf(installdir, sizeof(installdir), "/usr/local/share/%s", oname); + } else if (termux) { + snprintf(installdir, sizeof(installdir), "/data/data/com.termux/files/opt/%s", oname); + } else { + snprintf(installdir, sizeof(installdir), "/opt/%s", oname); + } #endif - #else - if (bsd) { - snprintf(installdir, sizeof(installdir), "/usr/local/share/%s", oname); - } else if (termux) { - snprintf(installdir, sizeof(installdir), "/data/data/com.termux/files/opt/%s", oname); - } else { - snprintf(installdir, sizeof(installdir), "/opt/%s", oname); - } - #endif + } } } @@ -431,8 +436,12 @@ int main(int argc, char *argv[]) oname = getenv("ONAME"); if (!oname) oname = macrotostring(O_NAME); if (argc>1) { - ReportSizesAndAlignments(); - exit(0); + if (strncasecmp(argv[1], "rep", 3) == 0) { + ReportSizesAndAlignments(); + exit(0); + } else { + bootstrap = 1; + } } getcwd(cwd, sizeof(cwd)); @@ -447,9 +456,15 @@ int main(int argc, char *argv[]) testSystemDotH(); - snprintf(versionstring, sizeof(versionstring), - "%s [%s] for %s %s on %s", - version, builddate, compiler, dataModel, os); + if (bootstrap) { + snprintf(versionstring, sizeof(versionstring), + "%s [%s]. Bootstrapping compiler for address size %d, alignment %d.", + version, builddate, addressSize, alignment); + } else { + snprintf(versionstring, sizeof(versionstring), + "%s [%s] for %s %s on %s", + version, builddate, compiler, dataModel, os); + } writeConfigurationMod(); writeMakeParameters(); From d683df3e72d6bacf92d7c020e4016b4587ec7614 Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 23 Sep 2016 19:34:18 +0100 Subject: [PATCH 251/580] Fix browser command following TypSize move. --- bootstrap/unix-44/OPM.c | 1 - bootstrap/unix-48/OPM.c | 1 - bootstrap/unix-88/OPM.c | 1 - bootstrap/windows-48/OPM.c | 1 - bootstrap/windows-88/OPM.c | 1 - src/tools/browser/BrowserCmd.Mod | 2 +- 6 files changed, 1 insertion(+), 6 deletions(-) diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 9297c0a3..abb5a584 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -223,7 +223,6 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) OPM_AddressSize = (int16)s[__X(i + 1, s__len)] - 48; OPM_Alignment = (int16)s[__X(i + 2, s__len)] - 48; i += 2; - Files_SetSearchPath((CHAR*)"", 1); } break; case 'B': diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 9297c0a3..abb5a584 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -223,7 +223,6 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) OPM_AddressSize = (int16)s[__X(i + 1, s__len)] - 48; OPM_Alignment = (int16)s[__X(i + 2, s__len)] - 48; i += 2; - Files_SetSearchPath((CHAR*)"", 1); } break; case 'B': diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 7b566324..18e25b0f 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -223,7 +223,6 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) OPM_AddressSize = (int16)s[__X(i + 1, s__len)] - 48; OPM_Alignment = (int16)s[__X(i + 2, s__len)] - 48; i += 2; - Files_SetSearchPath((CHAR*)"", 1); } break; case 'B': diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 9297c0a3..abb5a584 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -223,7 +223,6 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) OPM_AddressSize = (int16)s[__X(i + 1, s__len)] - 48; OPM_Alignment = (int16)s[__X(i + 2, s__len)] - 48; i += 2; - Files_SetSearchPath((CHAR*)"", 1); } break; case 'B': diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 7b566324..18e25b0f 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -223,7 +223,6 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) OPM_AddressSize = (int16)s[__X(i + 1, s__len)] - 48; OPM_Alignment = (int16)s[__X(i + 2, s__len)] - 48; i += 2; - Files_SetSearchPath((CHAR*)"", 1); } break; case 'B': diff --git a/src/tools/browser/BrowserCmd.Mod b/src/tools/browser/BrowserCmd.Mod index 564b29b3..28573293 100644 --- a/src/tools/browser/BrowserCmd.Mod +++ b/src/tools/browser/BrowserCmd.Mod @@ -267,5 +267,5 @@ MODULE BrowserCmd; (* RC 29.10.93 *) (* object model 4.12.93, command line ver END ShowDef; BEGIN - OPT.typSize := OPV.TypSize; Texts.OpenWriter(W); ShowDef + Texts.OpenWriter(W); ShowDef END BrowserCmd. From 8ab4057a10d97b5e51e7b0130db8386d4fb8322a Mon Sep 17 00:00:00 2001 From: David Brown Date: Sat, 24 Sep 2016 12:13:26 +0100 Subject: [PATCH 252/580] Make address strobj be equiv int type and remove param checking hack. --- src/compiler/OPB.Mod | 9 ++++----- src/compiler/Vishap.Mod | 4 ++++ src/tools/make/configure.c | 11 ++++++----- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/src/compiler/OPB.Mod b/src/compiler/OPB.Mod index 8382c965..260280e5 100644 --- a/src/compiler/OPB.Mod +++ b/src/compiler/OPB.Mod @@ -1380,11 +1380,10 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) WHILE (q # fp^.typ) & (q # NIL) & (q # OPT.undftyp) DO q := q^.BaseTyp END ; IF q = NIL THEN err(111) END ELSIF (fp^.typ = OPT.sysptrtyp) & (ap^.typ^.form = OPT.Pointer) THEN (* ok *) - ELSIF (ap^.typ # fp^.typ) THEN - IF (fp^.typ^.form = OPT.Byte) & ((ap.typ.form IN {OPT.Byte..OPT.Char, OPT.Int}) & (ap.typ.size = 1)) THEN (* OK *) - ELSIF (ap.typ = OPT.adrtyp) & (fp.typ = OPT.IntType(ap.typ.size)) THEN (* OK (ADDRESS is changed to INTnn in symbol file) *) - ELSE err(123) - END + ELSIF (ap^.typ # fp^.typ) + & ~( (fp^.typ^.form = OPT.Byte) + & (ap.typ.form IN {OPT.Byte..OPT.Char, OPT.Int}) + & (ap.typ.size = 1)) THEN err(123) ELSIF (fp^.typ^.form = OPT.Pointer) & (ap^.class = OPT.Nguard) THEN err(123) END ELSIF fp^.typ^.comp = OPT.DynArr THEN diff --git a/src/compiler/Vishap.Mod b/src/compiler/Vishap.Mod index 12dc0a93..0b1e4830 100644 --- a/src/compiler/Vishap.Mod +++ b/src/compiler/Vishap.Mod @@ -51,11 +51,15 @@ MODULE Vishap; (* J. Templ 3.2.95 *) PROCEDURE PropagateElementaryTypeSizes; + VAR adrinttyp: OPT.Struct; BEGIN OPT.sysptrtyp.size := OPM.AddressSize; OPT.adrtyp.size := OPM.AddressSize; OPT.settyp.size := OPM.SetSize; + adrinttyp := OPT.IntType(OPM.AddressSize); + OPT.adrtyp.strobj := adrinttyp.strobj; + OPT.sinttyp := OPT.IntType(OPM.ShortintSize); OPT.inttyp := OPT.IntType(OPM.IntegerSize); OPT.linttyp := OPT.IntType(OPM.LongintSize); diff --git a/src/tools/make/configure.c b/src/tools/make/configure.c index 3cc542d4..5e6e518b 100644 --- a/src/tools/make/configure.c +++ b/src/tools/make/configure.c @@ -126,26 +126,27 @@ void determineOS() { #endif } +#define optimize " -O1" void determineCCompiler() { snprintf(libspec, sizeof(libspec), " -l %s", oname); #if defined(__MINGW32__) compiler = "mingw"; if (sizeof (void*) == 4) { - cc = "i686-w64-mingw32-gcc -g -O1"; + cc = "i686-w64-mingw32-gcc -g" optimize; } else { - cc = "x86_64-w64-mingw32-gcc -g -O1"; + cc = "x86_64-w64-mingw32-gcc -g" optimize; } #elif defined(__clang__) compiler = "clang"; - cc = "clang -fPIC -g -O1"; + cc = "clang -fPIC -g" optimize; #elif defined(__GNUC__) compiler = "gcc"; if (strncasecmp(os, "cygwin", 6) == 0) { // Avoid cygwin specific warning that -fPIC is ignored. - cc = "gcc -g -O1"; + cc = "gcc -g" optimize; } else { - cc = "gcc -fPIC -g -O1"; + cc = "gcc -fPIC -g" optimize; } #elif defined(_MSC_VER) compiler = "MSC"; From 41bf2c037d2a0b2e35cde73fb40a74965b2a6b15 Mon Sep 17 00:00:00 2001 From: David Brown Date: Sun, 25 Sep 2016 15:26:04 +0100 Subject: [PATCH 253/580] Separate install subdirs for diff size models. Lots of tidying and renaming. --- bootstrap/unix-44/Configuration.c | 4 +- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Console.c | 2 +- bootstrap/unix-44/Console.h | 2 +- bootstrap/unix-44/Files.c | 8 +- bootstrap/unix-44/Files.h | 3 +- bootstrap/unix-44/Heap.c | 244 +++++++------- bootstrap/unix-44/Heap.h | 10 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 10 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 2 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 2 +- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 2 +- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 2 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Platform.c | 32 +- bootstrap/unix-44/Platform.h | 19 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/Vishap.c | 171 ---------- bootstrap/unix-44/errors.c | 2 +- bootstrap/unix-44/errors.h | 2 +- bootstrap/unix-44/extTools.c | 2 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-44/vt100.c | 2 +- bootstrap/unix-44/vt100.h | 2 +- bootstrap/unix-48/Configuration.c | 4 +- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Console.c | 2 +- bootstrap/unix-48/Console.h | 2 +- bootstrap/unix-48/Files.c | 8 +- bootstrap/unix-48/Files.h | 3 +- bootstrap/unix-48/Heap.c | 244 +++++++------- bootstrap/unix-48/Heap.h | 10 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 10 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 2 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 2 +- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 2 +- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 2 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Platform.c | 32 +- bootstrap/unix-48/Platform.h | 19 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/Vishap.c | 171 ---------- bootstrap/unix-48/errors.c | 2 +- bootstrap/unix-48/errors.h | 2 +- bootstrap/unix-48/extTools.c | 2 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-48/vt100.c | 2 +- bootstrap/unix-48/vt100.h | 2 +- bootstrap/unix-88/Configuration.c | 4 +- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Console.c | 2 +- bootstrap/unix-88/Console.h | 2 +- bootstrap/unix-88/Files.c | 8 +- bootstrap/unix-88/Files.h | 3 +- bootstrap/unix-88/Heap.c | 244 +++++++------- bootstrap/unix-88/Heap.h | 10 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 10 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 2 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 2 +- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 2 +- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 2 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Platform.c | 32 +- bootstrap/unix-88/Platform.h | 19 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/Vishap.c | 171 ---------- bootstrap/unix-88/errors.c | 2 +- bootstrap/unix-88/errors.h | 2 +- bootstrap/unix-88/extTools.c | 2 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/unix-88/vt100.c | 2 +- bootstrap/unix-88/vt100.h | 2 +- bootstrap/windows-48/Configuration.c | 4 +- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Console.c | 2 +- bootstrap/windows-48/Console.h | 2 +- bootstrap/windows-48/Files.c | 8 +- bootstrap/windows-48/Files.h | 3 +- bootstrap/windows-48/Heap.c | 244 +++++++------- bootstrap/windows-48/Heap.h | 10 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 10 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 2 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 2 +- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 2 +- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 2 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Platform.c | 30 +- bootstrap/windows-48/Platform.h | 16 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/Vishap.c | 171 ---------- bootstrap/windows-48/errors.c | 2 +- bootstrap/windows-48/errors.h | 2 +- bootstrap/windows-48/extTools.c | 2 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-48/vt100.c | 2 +- bootstrap/windows-48/vt100.h | 2 +- bootstrap/windows-88/Configuration.c | 4 +- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Console.c | 2 +- bootstrap/windows-88/Console.h | 2 +- bootstrap/windows-88/Files.c | 8 +- bootstrap/windows-88/Files.h | 3 +- bootstrap/windows-88/Heap.c | 244 +++++++------- bootstrap/windows-88/Heap.h | 10 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 10 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 2 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 2 +- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 2 +- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 2 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Platform.c | 30 +- bootstrap/windows-88/Platform.h | 16 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/Vishap.c | 171 ---------- bootstrap/windows-88/errors.c | 2 +- bootstrap/windows-88/errors.h | 2 +- bootstrap/windows-88/extTools.c | 2 +- bootstrap/windows-88/extTools.h | 2 +- bootstrap/windows-88/vt100.c | 2 +- bootstrap/windows-88/vt100.h | 2 +- makefile | 126 +++---- src/compiler/{Vishap.Mod => Compiler.Mod} | 26 +- src/compiler/OPB.Mod | 10 +- src/compiler/OPC.Mod | 14 +- src/compiler/{OPM.cmdln.Mod => OPM.Mod} | 306 +++++++---------- src/compiler/OPT.Mod | 8 +- src/compiler/OPV.Mod | 18 +- src/compiler/extTools.Mod | 41 +-- src/system/Files.Mod | 5 - src/system/Platformunix.Mod | 6 +- src/tools/make/configure.c | 2 - src/tools/make/oberon.mk | 379 ++++++++++++++++++++++ src/tools/make/vishap.make | 379 ---------------------- 208 files changed, 1559 insertions(+), 2556 deletions(-) delete mode 100644 bootstrap/unix-44/Vishap.c delete mode 100644 bootstrap/unix-48/Vishap.c delete mode 100644 bootstrap/unix-88/Vishap.c delete mode 100644 bootstrap/windows-48/Vishap.c delete mode 100644 bootstrap/windows-88/Vishap.c rename src/compiler/{Vishap.Mod => Compiler.Mod} (82%) rename src/compiler/{OPM.cmdln.Mod => OPM.Mod} (78%) create mode 100644 src/tools/make/oberon.mk delete mode 100644 src/tools/make/vishap.make diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index 7f7f4b26..28528f64 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index 618bc77f..d9030dbe 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Console.c b/bootstrap/unix-44/Console.c index f9e5e585..5bf17489 100644 --- a/bootstrap/unix-44/Console.c +++ b/bootstrap/unix-44/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Console.h b/bootstrap/unix-44/Console.h index d645f05c..4eb27c8b 100644 --- a/bootstrap/unix-44/Console.h +++ b/bootstrap/unix-44/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index ad002606..6f5eb201 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -83,7 +83,6 @@ export int32 Files_Pos (Files_Rider *r, address *r__typ); export void Files_Purge (Files_File f); export void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x); export void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x); -export void Files_ReadByte (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len); export void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); export void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x); export void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); @@ -673,11 +672,6 @@ void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x (*r).eof = 0; } -void Files_ReadByte (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len) -{ - Files_ReadBytes(&*r, r__typ, (void*)x, x__len * 1, 1); -} - Files_File Files_Base (Files_Rider *r, address *r__typ) { Files_File _o_result; diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index 0518133f..c75a1073 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h @@ -40,7 +40,6 @@ import int32 Files_Pos (Files_Rider *r, address *r__typ); import void Files_Purge (Files_File f); import void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x); import void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x); -import void Files_ReadByte (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len); import void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); import void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x); import void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index 905fcb24..945fbff7 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define INTEGER int16 #define LONGINT int32 @@ -39,7 +39,7 @@ typedef typedef struct Heap_FinDesc { Heap_FinNode next; - address obj; + int32 obj; BOOLEAN marked; Heap_Finalizer finalize; } Heap_FinDesc; @@ -56,19 +56,19 @@ typedef Heap_ModuleName name; int32 refcnt; Heap_Cmd cmds; - address types; + int32 types; Heap_EnumProc enumPtrs; int32 reserved1, reserved2; } Heap_ModuleDesc; export SYSTEM_PTR Heap_modules; -static address Heap_freeList[10]; -static address Heap_bigBlocks; -export address Heap_allocated; +static int32 Heap_freeList[10]; +static int32 Heap_bigBlocks; +export int32 Heap_allocated; static BOOLEAN Heap_firstTry; -static address Heap_heap, Heap_heapend; -export address Heap_heapsize; +static int32 Heap_heap, Heap_heapend; +export int32 Heap_heapsize; static Heap_FinNode Heap_fin; static int16 Heap_lockdepth; static BOOLEAN Heap_interrupted; @@ -80,27 +80,27 @@ export address *Heap_FinDesc__typ; export address *Heap__1__typ; static void Heap_CheckFin (void); -static void Heap_ExtendHeap (address blksz); +static void Heap_ExtendHeap (int32 blksz); export void Heap_FINALL (void); static void Heap_Finalize (void); export void Heap_GC (BOOLEAN markStack); -static void Heap_HeapSort (address n, address *a, LONGINT a__len); +static void Heap_HeapSort (int32 n, int32 *a, LONGINT a__len); export void Heap_INCREF (Heap_Module m); export void Heap_InitHeap (void); export void Heap_Lock (void); -static void Heap_Mark (address q); -static void Heap_MarkCandidates (address n, address *cand, LONGINT cand__len); +static void Heap_Mark (int32 q); +static void Heap_MarkCandidates (int32 n, int32 *cand, LONGINT cand__len); static void Heap_MarkP (SYSTEM_PTR p); -static void Heap_MarkStack (address n, address *cand, LONGINT cand__len); -export SYSTEM_PTR Heap_NEWBLK (address size); -export SYSTEM_PTR Heap_NEWREC (address tag); -static address Heap_NewChunk (address blksz); +static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len); +export SYSTEM_PTR Heap_NEWBLK (int32 size); +export SYSTEM_PTR Heap_NEWREC (int32 tag); +static int32 Heap_NewChunk (int32 blksz); export void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); export SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -export void Heap_REGTYP (Heap_Module m, address typ); +export void Heap_REGTYP (Heap_Module m, int32 typ); export void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); static void Heap_Scan (void); -static void Heap_Sift (address l, address r, address *a, LONGINT a__len); +static void Heap_Sift (int32 l, int32 r, int32 *a, LONGINT a__len); export void Heap_Unlock (void); extern void *Heap__init(); @@ -158,9 +158,9 @@ void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) m->cmds = c; } -void Heap_REGTYP (Heap_Module m, address typ) +void Heap_REGTYP (Heap_Module m, int32 typ) { - __PUT(typ, m->types, address); + __PUT(typ, m->types, int32); m->types = typ; } @@ -169,17 +169,17 @@ void Heap_INCREF (Heap_Module m) m->refcnt += 1; } -static address Heap_NewChunk (address blksz) +static int32 Heap_NewChunk (int32 blksz) { - address _o_result; - address chnk; + int32 _o_result; + int32 chnk; chnk = Heap_OSAllocate(blksz + 12); if (chnk != 0) { - __PUT(chnk + 4, chnk + (12 + blksz), address); - __PUT(chnk + 12, chnk + 16, address); - __PUT(chnk + 16, blksz, address); - __PUT(chnk + 20, -4, address); - __PUT(chnk + 24, Heap_bigBlocks, address); + __PUT(chnk + 4, chnk + (12 + blksz), int32); + __PUT(chnk + 12, chnk + 16, int32); + __PUT(chnk + 16, blksz, int32); + __PUT(chnk + 20, -4, int32); + __PUT(chnk + 24, Heap_bigBlocks, int32); Heap_bigBlocks = chnk + 12; Heap_heapsize += blksz; } @@ -187,9 +187,9 @@ static address Heap_NewChunk (address blksz) return _o_result; } -static void Heap_ExtendHeap (address blksz) +static void Heap_ExtendHeap (int32 blksz) { - address size, chnk, j, next; + int32 size, chnk, j, next; if (blksz > 160000) { size = blksz; } else { @@ -198,31 +198,31 @@ static void Heap_ExtendHeap (address blksz) chnk = Heap_NewChunk(size); if (chnk != 0) { if (chnk < Heap_heap) { - __PUT(chnk, Heap_heap, address); + __PUT(chnk, Heap_heap, int32); Heap_heap = chnk; } else { j = Heap_heap; - __GET(j, next, address); + __GET(j, next, int32); while ((next != 0 && chnk > next)) { j = next; - __GET(j, next, address); + __GET(j, next, int32); } - __PUT(chnk, next, address); - __PUT(j, chnk, address); + __PUT(chnk, next, int32); + __PUT(j, chnk, int32); } if (next == 0) { - __GET(chnk + 4, Heap_heapend, address); + __GET(chnk + 4, Heap_heapend, int32); } } } -SYSTEM_PTR Heap_NEWREC (address tag) +SYSTEM_PTR Heap_NEWREC (int32 tag) { SYSTEM_PTR _o_result; - address i, i0, di, blksz, restsize, t, adr, end, next, prev; + int32 i, i0, di, blksz, restsize, t, adr, end, next, prev; SYSTEM_PTR new; Heap_Lock(); - __GET(tag, blksz, address); + __GET(tag, blksz, int32); i0 = __ASHR(blksz, 4); i = i0; if (i < 9) { @@ -233,17 +233,17 @@ SYSTEM_PTR Heap_NEWREC (address tag) } } if (i < 9) { - __GET(adr + 12, next, address); + __GET(adr + 12, next, int32); Heap_freeList[i] = next; if (i != i0) { di = i - i0; restsize = __ASHL(di, 4); end = adr + restsize; - __PUT(end + 4, blksz, address); - __PUT(end + 8, -4, address); - __PUT(end, end + 4, address); - __PUT(adr + 4, restsize, address); - __PUT(adr + 12, Heap_freeList[di], address); + __PUT(end + 4, blksz, int32); + __PUT(end + 8, -4, int32); + __PUT(end, end + 4, int32); + __PUT(adr + 4, restsize, int32); + __PUT(adr + 12, Heap_freeList[di], int32); Heap_freeList[di] = adr; adr += restsize; } @@ -274,31 +274,31 @@ SYSTEM_PTR Heap_NEWREC (address tag) return _o_result; } } - __GET(adr + 4, t, address); + __GET(adr + 4, t, int32); if (t >= blksz) { break; } prev = adr; - __GET(adr + 12, adr, address); + __GET(adr + 12, adr, int32); } restsize = t - blksz; end = adr + restsize; - __PUT(end + 4, blksz, address); - __PUT(end + 8, -4, address); - __PUT(end, end + 4, address); + __PUT(end + 4, blksz, int32); + __PUT(end + 8, -4, int32); + __PUT(end, end + 4, int32); if (restsize > 144) { - __PUT(adr + 4, restsize, address); + __PUT(adr + 4, restsize, int32); } else { - __GET(adr + 12, next, address); + __GET(adr + 12, next, int32); if (prev == 0) { Heap_bigBlocks = next; } else { - __PUT(prev + 12, next, address); + __PUT(prev + 12, next, int32); } if (restsize > 0) { di = __ASHR(restsize, 4); - __PUT(adr + 4, restsize, address); - __PUT(adr + 12, Heap_freeList[di], address); + __PUT(adr + 4, restsize, int32); + __PUT(adr + 12, Heap_freeList[di], int32); Heap_freeList[di] = adr; } } @@ -307,72 +307,72 @@ SYSTEM_PTR Heap_NEWREC (address tag) i = adr + 16; end = adr + blksz; while (i < end) { - __PUT(i, 0, address); - __PUT(i + 4, 0, address); - __PUT(i + 8, 0, address); - __PUT(i + 12, 0, address); + __PUT(i, 0, int32); + __PUT(i + 4, 0, int32); + __PUT(i + 8, 0, int32); + __PUT(i + 12, 0, int32); i += 16; } - __PUT(adr + 12, 0, address); - __PUT(adr, tag, address); - __PUT(adr + 4, 0, address); - __PUT(adr + 8, 0, address); + __PUT(adr + 12, 0, int32); + __PUT(adr, tag, int32); + __PUT(adr + 4, 0, int32); + __PUT(adr + 8, 0, int32); Heap_allocated += blksz; Heap_Unlock(); _o_result = (SYSTEM_PTR)(address)(adr + 4); return _o_result; } -SYSTEM_PTR Heap_NEWBLK (address size) +SYSTEM_PTR Heap_NEWBLK (int32 size) { SYSTEM_PTR _o_result; - address blksz, tag; + int32 blksz, tag; SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 31, 4), 4); new = Heap_NEWREC((address)&blksz); - tag = ((address)(address)new + blksz) - 12; - __PUT(tag - 4, 0, address); - __PUT(tag, blksz, address); - __PUT(tag + 4, -4, address); - __PUT((address)(address)new - 4, tag, address); + tag = ((int32)(address)new + blksz) - 12; + __PUT(tag - 4, 0, int32); + __PUT(tag, blksz, int32); + __PUT(tag + 4, -4, int32); + __PUT((int32)(address)new - 4, tag, int32); Heap_Unlock(); _o_result = new; return _o_result; } -static void Heap_Mark (address q) +static void Heap_Mark (int32 q) { - address p, tag, offset, fld, n, tagbits; + int32 p, tag, offset, fld, n, tagbits; if (q != 0) { - __GET(q - 4, tagbits, address); + __GET(q - 4, tagbits, int32); if (!__ODD(tagbits)) { - __PUT(q - 4, tagbits + 1, address); + __PUT(q - 4, tagbits + 1, int32); p = 0; tag = tagbits + 4; for (;;) { - __GET(tag, offset, address); + __GET(tag, offset, int32); if (offset < 0) { - __PUT(q - 4, (tag + offset) + 1, address); + __PUT(q - 4, (tag + offset) + 1, int32); if (p == 0) { break; } n = q; q = p; - __GET(q - 4, tag, address); + __GET(q - 4, tag, int32); tag -= 1; - __GET(tag, offset, address); + __GET(tag, offset, int32); fld = q + offset; - __GET(fld, p, address); + __GET(fld, p, int32); __PUT(fld, (SYSTEM_PTR)(address)n, SYSTEM_PTR); } else { fld = q + offset; - __GET(fld, n, address); + __GET(fld, n, int32); if (n != 0) { - __GET(n - 4, tagbits, address); + __GET(n - 4, tagbits, int32); if (!__ODD(tagbits)) { - __PUT(n - 4, tagbits + 1, address); - __PUT(q - 4, tag + 1, address); + __PUT(n - 4, tagbits + 1, int32); + __PUT(q - 4, tag + 1, int32); __PUT(fld, (SYSTEM_PTR)(address)p, SYSTEM_PTR); p = q; q = n; @@ -388,12 +388,12 @@ static void Heap_Mark (address q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((address)(address)p); + Heap_Mark((int32)(address)p); } static void Heap_Scan (void) { - address chnk, adr, end, start, tag, i, size, freesize; + int32 chnk, adr, end, start, tag, i, size, freesize; Heap_bigBlocks = 0; i = 1; while (i < 9) { @@ -405,58 +405,58 @@ static void Heap_Scan (void) chnk = Heap_heap; while (chnk != 0) { adr = chnk + 12; - __GET(chnk + 4, end, address); + __GET(chnk + 4, end, int32); while (adr < end) { - __GET(adr, tag, address); + __GET(adr, tag, int32); if (__ODD(tag)) { if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 4, address); - __PUT(start + 4, freesize, address); - __PUT(start + 8, -4, address); + __PUT(start, start + 4, int32); + __PUT(start + 4, freesize, int32); + __PUT(start + 8, -4, int32); i = __ASHR(freesize, 4); freesize = 0; if (i < 9) { - __PUT(start + 12, Heap_freeList[i], address); + __PUT(start + 12, Heap_freeList[i], int32); Heap_freeList[i] = start; } else { - __PUT(start + 12, Heap_bigBlocks, address); + __PUT(start + 12, Heap_bigBlocks, int32); Heap_bigBlocks = start; } } tag -= 1; - __PUT(adr, tag, address); - __GET(tag, size, address); + __PUT(adr, tag, int32); + __GET(tag, size, int32); Heap_allocated += size; adr += size; } else { - __GET(tag, size, address); + __GET(tag, size, int32); freesize += size; adr += size; } } if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 4, address); - __PUT(start + 4, freesize, address); - __PUT(start + 8, -4, address); + __PUT(start, start + 4, int32); + __PUT(start + 4, freesize, int32); + __PUT(start + 8, -4, int32); i = __ASHR(freesize, 4); freesize = 0; if (i < 9) { - __PUT(start + 12, Heap_freeList[i], address); + __PUT(start + 12, Heap_freeList[i], int32); Heap_freeList[i] = start; } else { - __PUT(start + 12, Heap_bigBlocks, address); + __PUT(start + 12, Heap_bigBlocks, int32); Heap_bigBlocks = start; } } - __GET(chnk, chnk, address); + __GET(chnk, chnk, int32); } } -static void Heap_Sift (address l, address r, address *a, LONGINT a__len) +static void Heap_Sift (int32 l, int32 r, int32 *a, LONGINT a__len) { - address i, j, x; + int32 i, j, x; j = l; x = a[j]; for (;;) { @@ -473,9 +473,9 @@ static void Heap_Sift (address l, address r, address *a, LONGINT a__len) a[i] = x; } -static void Heap_HeapSort (address n, address *a, LONGINT a__len) +static void Heap_HeapSort (int32 n, int32 *a, LONGINT a__len) { - address l, r, x; + int32 l, r, x; l = __ASHR(n, 1); r = n - 1; while (l > 0) { @@ -491,25 +491,25 @@ static void Heap_HeapSort (address n, address *a, LONGINT a__len) } } -static void Heap_MarkCandidates (address n, address *cand, LONGINT cand__len) +static void Heap_MarkCandidates (int32 n, int32 *cand, LONGINT cand__len) { - address chnk, adr, tag, next, lim, lim1, i, ptr, size; + int32 chnk, adr, tag, next, lim, lim1, i, ptr, size; chnk = Heap_heap; i = 0; lim = cand[n - 1]; while ((chnk != 0 && chnk < lim)) { adr = chnk + 12; - __GET(chnk + 4, lim1, address); + __GET(chnk + 4, lim1, int32); if (lim < lim1) { lim1 = lim; } while (adr < lim1) { - __GET(adr, tag, address); + __GET(adr, tag, int32); if (__ODD(tag)) { - __GET(tag - 1, size, address); + __GET(tag - 1, size, int32); adr += size; } else { - __GET(tag, size, address); + __GET(tag, size, int32); ptr = adr + 4; while (cand[i] < ptr) { i += 1; @@ -524,17 +524,17 @@ static void Heap_MarkCandidates (address n, address *cand, LONGINT cand__len) adr = next; } } - __GET(chnk, chnk, address); + __GET(chnk, chnk, int32); } } static void Heap_CheckFin (void) { Heap_FinNode n; - address tag; + int32 tag; n = Heap_fin; while (n != NIL) { - __GET(n->obj - 4, tag, address); + __GET(n->obj - 4, tag, int32); if (!__ODD(tag)) { n->marked = 0; Heap_Mark(n->obj); @@ -580,10 +580,10 @@ void Heap_FINALL (void) } } -static void Heap_MarkStack (address n, address *cand, LONGINT cand__len) +static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len) { SYSTEM_PTR frame; - address inc, nofcand, sp, p, stack0; + int32 inc, nofcand, sp, p, stack0; struct Heap__1 align; if (n > 0) { Heap_MarkStack(n - 1, cand, cand__len); @@ -600,7 +600,7 @@ static void Heap_MarkStack (address n, address *cand, LONGINT cand__len) inc = -inc; } while (sp != stack0) { - __GET(sp, p, address); + __GET(sp, p, int32); if ((p > Heap_heap && p < Heap_heapend)) { if (nofcand == cand__len) { Heap_HeapSort(nofcand, (void*)cand, cand__len); @@ -622,8 +622,8 @@ static void Heap_MarkStack (address n, address *cand, LONGINT cand__len) void Heap_GC (BOOLEAN markStack) { Heap_Module m; - address i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; - address cand[10000]; + int32 i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; + int32 cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); m = (Heap_Module)(address)Heap_modules; @@ -703,7 +703,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (address)(address)obj; + f->obj = (int32)(address)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; @@ -713,8 +713,8 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) void Heap_InitHeap (void) { Heap_heap = Heap_NewChunk(128000); - __GET(Heap_heap + 4, Heap_heapend, address); - __PUT(Heap_heap, 0, address); + __GET(Heap_heap + 4, Heap_heapend, int32); + __PUT(Heap_heap, 0, int32); Heap_allocated = 0; Heap_firstTry = 1; Heap_freeList[9] = 1; diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index 3ea975a7..eccb5d85 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h @@ -31,7 +31,7 @@ typedef import SYSTEM_PTR Heap_modules; -import address Heap_allocated, Heap_heapsize; +import int32 Heap_allocated, Heap_heapsize; import int16 Heap_FileCount; import address *Heap_ModuleDesc__typ; @@ -41,11 +41,11 @@ import void Heap_GC (BOOLEAN markStack); import void Heap_INCREF (Heap_Module m); import void Heap_InitHeap (void); import void Heap_Lock (void); -import SYSTEM_PTR Heap_NEWBLK (address size); -import SYSTEM_PTR Heap_NEWREC (address tag); +import SYSTEM_PTR Heap_NEWBLK (int32 size); +import SYSTEM_PTR Heap_NEWREC (int32 tag); import void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); import SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -import void Heap_REGTYP (Heap_Module m, address typ); +import void Heap_REGTYP (Heap_Module m, int32 typ); import void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); import void Heap_Unlock (void); import void *Heap__init(void); diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index 21d62e05..a87d0732 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index d2d0a476..93e2105b 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index 6c15aa17..d211135a 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -2449,12 +2449,8 @@ void OPB_Param (OPT_Node ap, OPT_Object fp) OPB_err(111); } } else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 11)) { - } else if (ap->typ != fp->typ) { - if ((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x1e, 32) && ap->typ->size == 1)))) { - } else if ((ap->typ == OPT_adrtyp && fp->typ == OPT_IntType(ap->typ->size))) { - } else { - OPB_err(123); - } + } else if ((ap->typ != fp->typ && !((((fp->typ->form == 1 && __IN(ap->typ->form, 0x1e, 32))) && ap->typ->size == 1)))) { + OPB_err(123); } else if ((fp->typ->form == 11 && ap->class == 5)) { OPB_err(123); } diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index 8395741b..97860bfc 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 9104c5c4..e4c0eb06 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index 6236cd73..3325aded 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index abb5a584..7234f518 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index b62666db..e249edd5 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index 66b821d2..1e5c6674 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index ea6663ba..3b9acd86 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index 2b449cae..ee182741 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index 8d90d974..1514d9eb 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index 7405b27f..c1b4cb67 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index 1a525fcb..d4f953ba 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index cdb2ab50..a70a40bf 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index 09931dda..0a9135f5 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index e95203ed..ef0c0dbe 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -13,7 +13,7 @@ typedef Platform_ArgPtr (*Platform_ArgVec)[1024]; typedef - address (*Platform_ArgVecPtr)[1]; + int32 (*Platform_ArgVecPtr)[1]; typedef CHAR (*Platform_EnvPtr)[1024]; @@ -31,12 +31,12 @@ typedef export BOOLEAN Platform_LittleEndian; -export address Platform_MainStackFrame; +export int32 Platform_MainStackFrame; export int32 Platform_HaltCode; export int16 Platform_PID; export CHAR Platform_CWD[256]; export int16 Platform_ArgCount; -export address Platform_ArgVector; +export int32 Platform_ArgVector; static Platform_HaltProcedure Platform_HaltHandler; static int32 Platform_TimeStart; export int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; @@ -64,15 +64,15 @@ export void Platform_Halt (int32 code); export int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ); export int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); export BOOLEAN Platform_Inaccessible (int16 e); -export void Platform_Init (int16 argc, address argvadr); +export void Platform_Init (int16 argc, int32 argvadr); export void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); export int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); export BOOLEAN Platform_NoSuchDirectory (int16 e); -export address Platform_OSAllocate (address size); -export void Platform_OSFree (address address); +export int32 Platform_OSAllocate (int32 size); +export void Platform_OSFree (int32 address); export int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); export int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); -export int16 Platform_Read (int32 h, address p, int32 l, int32 *n); +export int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n); export int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n); export int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); export BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); @@ -92,7 +92,7 @@ export BOOLEAN Platform_TimedOut (int16 e); export BOOLEAN Platform_TooManyFiles (int16 e); export int16 Platform_Truncate (int32 h, int32 l); export int16 Platform_Unlink (CHAR *n, LONGINT n__len); -export int16 Platform_Write (int32 h, address p, int32 l); +export int16 Platform_Write (int32 h, int32 p, int32 l); static void Platform_YMDHMStoClock (int32 ye, int32 mo, int32 da, int32 ho, int32 mi, int32 se, int32 *t, int32 *d); static void Platform_errch (CHAR c); static void Platform_errint (int32 l); @@ -218,19 +218,19 @@ BOOLEAN Platform_ConnectionFailed (int16 e) return _o_result; } -address Platform_OSAllocate (address size) +int32 Platform_OSAllocate (int32 size) { - address _o_result; + int32 _o_result; _o_result = Platform_allocate(size); return _o_result; } -void Platform_OSFree (address address) +void Platform_OSFree (int32 address) { Platform_free(address); } -void Platform_Init (int16 argc, address argvadr) +void Platform_Init (int16 argc, int32 argvadr) { Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; @@ -517,7 +517,7 @@ int16 Platform_Size (int32 h, int32 *l) return _o_result; } -int16 Platform_Read (int32 h, address p, int32 l, int32 *n) +int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n) { int16 _o_result; *n = Platform_readfile(h, p, l); @@ -547,10 +547,10 @@ int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n) __RETCHK; } -int16 Platform_Write (int32 h, address p, int32 l) +int16 Platform_Write (int32 h, int32 p, int32 l) { int16 _o_result; - address written; + int32 written; written = Platform_writefile(h, p, l); if (written < 0) { _o_result = Platform_err(); diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index d76d7ed5..986a65ef 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h @@ -7,7 +7,8 @@ typedef struct Platform_FileIdentity { - int32 volume, index, mtime; + int32 _prvt0; + char _prvt1[8]; } Platform_FileIdentity; typedef @@ -18,12 +19,12 @@ typedef import BOOLEAN Platform_LittleEndian; -import address Platform_MainStackFrame; +import int32 Platform_MainStackFrame; import int32 Platform_HaltCode; import int16 Platform_PID; import CHAR Platform_CWD[256]; import int16 Platform_ArgCount; -import address Platform_ArgVector; +import int32 Platform_ArgVector; import int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; import CHAR Platform_nl[3]; @@ -48,15 +49,15 @@ import void Platform_Halt (int32 code); import int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ); import int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); import BOOLEAN Platform_Inaccessible (int16 e); -import void Platform_Init (int16 argc, address argvadr); +import void Platform_Init (int16 argc, int32 argvadr); import void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); import int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); import BOOLEAN Platform_NoSuchDirectory (int16 e); -import address Platform_OSAllocate (address size); -import void Platform_OSFree (address address); +import int32 Platform_OSAllocate (int32 size); +import void Platform_OSFree (int32 address); import int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); import int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); -import int16 Platform_Read (int32 h, address p, int32 l, int32 *n); +import int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n); import int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n); import int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); import BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); @@ -75,7 +76,7 @@ import BOOLEAN Platform_TimedOut (int16 e); import BOOLEAN Platform_TooManyFiles (int16 e); import int16 Platform_Truncate (int32 h, int32 l); import int16 Platform_Unlink (CHAR *n, LONGINT n__len); -import int16 Platform_Write (int32 h, address p, int32 l); +import int16 Platform_Write (int32 h, int32 p, int32 l); import BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); import void *Platform__init(void); diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 4b72fbe3..e75d35ff 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index 4a4c73b0..8a42b39b 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index f765b98f..9f9562db 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index be1e7d7f..da213d81 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index 28dd23c6..9d981ce0 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index 56d3fd40..1faae4d6 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/Vishap.c b/bootstrap/unix-44/Vishap.c deleted file mode 100644 index 30b81ac7..00000000 --- a/bootstrap/unix-44/Vishap.c +++ /dev/null @@ -1,171 +0,0 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ - -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 - -#include "SYSTEM.h" -#include "Configuration.h" -#include "Heap.h" -#include "OPB.h" -#include "OPC.h" -#include "OPM.h" -#include "OPP.h" -#include "OPT.h" -#include "OPV.h" -#include "Platform.h" -#include "Strings.h" -#include "extTools.h" -#include "vt100.h" - - -static CHAR Vishap_mname[256]; - - -export void Vishap_Module (BOOLEAN *done); -static void Vishap_PropagateElementaryTypeSizes (void); -export void Vishap_Translate (void); -static void Vishap_Trap (int16 sig); - - -void Vishap_Module (BOOLEAN *done) -{ - BOOLEAN ext, new; - OPT_Node p = NIL; - OPP_Module(&p, OPM_opt); - if (OPM_noerr) { - OPV_Init(); - OPT_InitRecno(); - OPV_AdrAndSize(OPT_topScope); - OPT_Export(&ext, &new); - if (OPM_noerr) { - OPM_OpenFiles((void*)OPT_SelfName, 256); - OPC_Init(); - OPV_Module(p); - if (OPM_noerr) { - if ((__IN(10, OPM_opt, 32) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { - OPM_DeleteNewSym(); - if (!__IN(16, OPM_opt, 32)) { - vt100_SetAttr((CHAR*)"32m", 4); - } - OPM_LogWStr((CHAR*)" Main program.", 16); - if (!__IN(16, OPM_opt, 32)) { - vt100_SetAttr((CHAR*)"0m", 3); - } - } else { - if (new) { - if (!__IN(16, OPM_opt, 32)) { - vt100_SetAttr((CHAR*)"32m", 4); - } - OPM_LogWStr((CHAR*)" New symbol file.", 19); - if (!__IN(16, OPM_opt, 32)) { - vt100_SetAttr((CHAR*)"0m", 3); - } - OPM_RegisterNewSym(); - } else if (ext) { - OPM_LogWStr((CHAR*)" Extended symbol file.", 24); - OPM_RegisterNewSym(); - } - } - } else { - OPM_DeleteNewSym(); - } - } - } - OPM_CloseFiles(); - OPT_Close(); - OPM_LogWLn(); - *done = OPM_noerr; -} - -static void Vishap_PropagateElementaryTypeSizes (void) -{ - OPT_sysptrtyp->size = OPM_AddressSize; - OPT_adrtyp->size = OPM_AddressSize; - OPT_settyp->size = OPM_SetSize; - OPT_sinttyp = OPT_IntType(OPM_ShortintSize); - OPT_inttyp = OPT_IntType(OPM_IntegerSize); - OPT_linttyp = OPT_IntType(OPM_LongintSize); - OPT_sintobj->typ = OPT_sinttyp; - OPT_intobj->typ = OPT_inttyp; - OPT_lintobj->typ = OPT_linttyp; -} - -void Vishap_Translate (void) -{ - BOOLEAN done; - CHAR modulesobj[2048]; - modulesobj[0] = 0x00; - if (OPM_OpenPar()) { - for (;;) { - OPM_Init(&done, (void*)Vishap_mname, 256); - if (!done) { - return; - } - OPM_InitOptions(); - Vishap_PropagateElementaryTypeSizes(); - Heap_GC(0); - Vishap_Module(&done); - if (!done) { - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Module compilation failed.", 27); - OPM_LogWLn(); - Platform_Exit(1); - } - if (!__IN(13, OPM_opt, 32)) { - if (__IN(14, OPM_opt, 32)) { - extTools_Assemble(OPM_modName, 32); - } else { - if (!__IN(10, OPM_opt, 32)) { - extTools_Assemble(OPM_modName, 32); - Strings_Append((CHAR*)" ", 2, (void*)modulesobj, 2048); - Strings_Append(OPM_modName, 32, (void*)modulesobj, 2048); - Strings_Append((CHAR*)".o", 3, (void*)modulesobj, 2048); - } else { - extTools_LinkMain((void*)OPM_modName, 32, __IN(15, OPM_opt, 32), modulesobj, 2048); - } - } - } - } - } -} - -static void Vishap_Trap (int16 sig) -{ - Heap_FINALL(); - if (sig == 3) { - Platform_Exit(0); - } else { - if ((sig == 4 && Platform_HaltCode == -15)) { - OPM_LogWStr((CHAR*)" --- Vishap Oberon: internal error", 35); - OPM_LogWLn(); - } - Platform_Exit(2); - } -} - - -export int main(int argc, char **argv) -{ - __INIT(argc, argv); - __MODULE_IMPORT(Configuration); - __MODULE_IMPORT(Heap); - __MODULE_IMPORT(OPB); - __MODULE_IMPORT(OPC); - __MODULE_IMPORT(OPM); - __MODULE_IMPORT(OPP); - __MODULE_IMPORT(OPT); - __MODULE_IMPORT(OPV); - __MODULE_IMPORT(Platform); - __MODULE_IMPORT(Strings); - __MODULE_IMPORT(extTools); - __MODULE_IMPORT(vt100); - __REGMAIN("Vishap", 0); - __REGCMD("Translate", Vishap_Translate); -/* BEGIN */ - Platform_SetInterruptHandler(Vishap_Trap); - Platform_SetQuitHandler(Vishap_Trap); - Platform_SetBadInstructionHandler(Vishap_Trap); - Vishap_Translate(); - __FINI; -} diff --git a/bootstrap/unix-44/errors.c b/bootstrap/unix-44/errors.c index d465624d..34e6fae3 100644 --- a/bootstrap/unix-44/errors.c +++ b/bootstrap/unix-44/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/errors.h b/bootstrap/unix-44/errors.h index cf093ab3..ce275b8c 100644 --- a/bootstrap/unix-44/errors.h +++ b/bootstrap/unix-44/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index 46f8ac7e..fd7974da 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index 700e6b39..f87adfac 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-44/vt100.c b/bootstrap/unix-44/vt100.c index 8d4cbdfc..ca56f466 100644 --- a/bootstrap/unix-44/vt100.c +++ b/bootstrap/unix-44/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/vt100.h b/bootstrap/unix-44/vt100.h index da86e98b..f5b8588f 100644 --- a/bootstrap/unix-44/vt100.h +++ b/bootstrap/unix-44/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index 7f7f4b26..28528f64 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index 618bc77f..d9030dbe 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Console.c b/bootstrap/unix-48/Console.c index f9e5e585..5bf17489 100644 --- a/bootstrap/unix-48/Console.c +++ b/bootstrap/unix-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Console.h b/bootstrap/unix-48/Console.h index d645f05c..4eb27c8b 100644 --- a/bootstrap/unix-48/Console.h +++ b/bootstrap/unix-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index ad002606..6f5eb201 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -83,7 +83,6 @@ export int32 Files_Pos (Files_Rider *r, address *r__typ); export void Files_Purge (Files_File f); export void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x); export void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x); -export void Files_ReadByte (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len); export void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); export void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x); export void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); @@ -673,11 +672,6 @@ void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x (*r).eof = 0; } -void Files_ReadByte (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len) -{ - Files_ReadBytes(&*r, r__typ, (void*)x, x__len * 1, 1); -} - Files_File Files_Base (Files_Rider *r, address *r__typ) { Files_File _o_result; diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index 0518133f..c75a1073 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h @@ -40,7 +40,6 @@ import int32 Files_Pos (Files_Rider *r, address *r__typ); import void Files_Purge (Files_File f); import void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x); import void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x); -import void Files_ReadByte (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len); import void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); import void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x); import void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index 905fcb24..945fbff7 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define INTEGER int16 #define LONGINT int32 @@ -39,7 +39,7 @@ typedef typedef struct Heap_FinDesc { Heap_FinNode next; - address obj; + int32 obj; BOOLEAN marked; Heap_Finalizer finalize; } Heap_FinDesc; @@ -56,19 +56,19 @@ typedef Heap_ModuleName name; int32 refcnt; Heap_Cmd cmds; - address types; + int32 types; Heap_EnumProc enumPtrs; int32 reserved1, reserved2; } Heap_ModuleDesc; export SYSTEM_PTR Heap_modules; -static address Heap_freeList[10]; -static address Heap_bigBlocks; -export address Heap_allocated; +static int32 Heap_freeList[10]; +static int32 Heap_bigBlocks; +export int32 Heap_allocated; static BOOLEAN Heap_firstTry; -static address Heap_heap, Heap_heapend; -export address Heap_heapsize; +static int32 Heap_heap, Heap_heapend; +export int32 Heap_heapsize; static Heap_FinNode Heap_fin; static int16 Heap_lockdepth; static BOOLEAN Heap_interrupted; @@ -80,27 +80,27 @@ export address *Heap_FinDesc__typ; export address *Heap__1__typ; static void Heap_CheckFin (void); -static void Heap_ExtendHeap (address blksz); +static void Heap_ExtendHeap (int32 blksz); export void Heap_FINALL (void); static void Heap_Finalize (void); export void Heap_GC (BOOLEAN markStack); -static void Heap_HeapSort (address n, address *a, LONGINT a__len); +static void Heap_HeapSort (int32 n, int32 *a, LONGINT a__len); export void Heap_INCREF (Heap_Module m); export void Heap_InitHeap (void); export void Heap_Lock (void); -static void Heap_Mark (address q); -static void Heap_MarkCandidates (address n, address *cand, LONGINT cand__len); +static void Heap_Mark (int32 q); +static void Heap_MarkCandidates (int32 n, int32 *cand, LONGINT cand__len); static void Heap_MarkP (SYSTEM_PTR p); -static void Heap_MarkStack (address n, address *cand, LONGINT cand__len); -export SYSTEM_PTR Heap_NEWBLK (address size); -export SYSTEM_PTR Heap_NEWREC (address tag); -static address Heap_NewChunk (address blksz); +static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len); +export SYSTEM_PTR Heap_NEWBLK (int32 size); +export SYSTEM_PTR Heap_NEWREC (int32 tag); +static int32 Heap_NewChunk (int32 blksz); export void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); export SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -export void Heap_REGTYP (Heap_Module m, address typ); +export void Heap_REGTYP (Heap_Module m, int32 typ); export void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); static void Heap_Scan (void); -static void Heap_Sift (address l, address r, address *a, LONGINT a__len); +static void Heap_Sift (int32 l, int32 r, int32 *a, LONGINT a__len); export void Heap_Unlock (void); extern void *Heap__init(); @@ -158,9 +158,9 @@ void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) m->cmds = c; } -void Heap_REGTYP (Heap_Module m, address typ) +void Heap_REGTYP (Heap_Module m, int32 typ) { - __PUT(typ, m->types, address); + __PUT(typ, m->types, int32); m->types = typ; } @@ -169,17 +169,17 @@ void Heap_INCREF (Heap_Module m) m->refcnt += 1; } -static address Heap_NewChunk (address blksz) +static int32 Heap_NewChunk (int32 blksz) { - address _o_result; - address chnk; + int32 _o_result; + int32 chnk; chnk = Heap_OSAllocate(blksz + 12); if (chnk != 0) { - __PUT(chnk + 4, chnk + (12 + blksz), address); - __PUT(chnk + 12, chnk + 16, address); - __PUT(chnk + 16, blksz, address); - __PUT(chnk + 20, -4, address); - __PUT(chnk + 24, Heap_bigBlocks, address); + __PUT(chnk + 4, chnk + (12 + blksz), int32); + __PUT(chnk + 12, chnk + 16, int32); + __PUT(chnk + 16, blksz, int32); + __PUT(chnk + 20, -4, int32); + __PUT(chnk + 24, Heap_bigBlocks, int32); Heap_bigBlocks = chnk + 12; Heap_heapsize += blksz; } @@ -187,9 +187,9 @@ static address Heap_NewChunk (address blksz) return _o_result; } -static void Heap_ExtendHeap (address blksz) +static void Heap_ExtendHeap (int32 blksz) { - address size, chnk, j, next; + int32 size, chnk, j, next; if (blksz > 160000) { size = blksz; } else { @@ -198,31 +198,31 @@ static void Heap_ExtendHeap (address blksz) chnk = Heap_NewChunk(size); if (chnk != 0) { if (chnk < Heap_heap) { - __PUT(chnk, Heap_heap, address); + __PUT(chnk, Heap_heap, int32); Heap_heap = chnk; } else { j = Heap_heap; - __GET(j, next, address); + __GET(j, next, int32); while ((next != 0 && chnk > next)) { j = next; - __GET(j, next, address); + __GET(j, next, int32); } - __PUT(chnk, next, address); - __PUT(j, chnk, address); + __PUT(chnk, next, int32); + __PUT(j, chnk, int32); } if (next == 0) { - __GET(chnk + 4, Heap_heapend, address); + __GET(chnk + 4, Heap_heapend, int32); } } } -SYSTEM_PTR Heap_NEWREC (address tag) +SYSTEM_PTR Heap_NEWREC (int32 tag) { SYSTEM_PTR _o_result; - address i, i0, di, blksz, restsize, t, adr, end, next, prev; + int32 i, i0, di, blksz, restsize, t, adr, end, next, prev; SYSTEM_PTR new; Heap_Lock(); - __GET(tag, blksz, address); + __GET(tag, blksz, int32); i0 = __ASHR(blksz, 4); i = i0; if (i < 9) { @@ -233,17 +233,17 @@ SYSTEM_PTR Heap_NEWREC (address tag) } } if (i < 9) { - __GET(adr + 12, next, address); + __GET(adr + 12, next, int32); Heap_freeList[i] = next; if (i != i0) { di = i - i0; restsize = __ASHL(di, 4); end = adr + restsize; - __PUT(end + 4, blksz, address); - __PUT(end + 8, -4, address); - __PUT(end, end + 4, address); - __PUT(adr + 4, restsize, address); - __PUT(adr + 12, Heap_freeList[di], address); + __PUT(end + 4, blksz, int32); + __PUT(end + 8, -4, int32); + __PUT(end, end + 4, int32); + __PUT(adr + 4, restsize, int32); + __PUT(adr + 12, Heap_freeList[di], int32); Heap_freeList[di] = adr; adr += restsize; } @@ -274,31 +274,31 @@ SYSTEM_PTR Heap_NEWREC (address tag) return _o_result; } } - __GET(adr + 4, t, address); + __GET(adr + 4, t, int32); if (t >= blksz) { break; } prev = adr; - __GET(adr + 12, adr, address); + __GET(adr + 12, adr, int32); } restsize = t - blksz; end = adr + restsize; - __PUT(end + 4, blksz, address); - __PUT(end + 8, -4, address); - __PUT(end, end + 4, address); + __PUT(end + 4, blksz, int32); + __PUT(end + 8, -4, int32); + __PUT(end, end + 4, int32); if (restsize > 144) { - __PUT(adr + 4, restsize, address); + __PUT(adr + 4, restsize, int32); } else { - __GET(adr + 12, next, address); + __GET(adr + 12, next, int32); if (prev == 0) { Heap_bigBlocks = next; } else { - __PUT(prev + 12, next, address); + __PUT(prev + 12, next, int32); } if (restsize > 0) { di = __ASHR(restsize, 4); - __PUT(adr + 4, restsize, address); - __PUT(adr + 12, Heap_freeList[di], address); + __PUT(adr + 4, restsize, int32); + __PUT(adr + 12, Heap_freeList[di], int32); Heap_freeList[di] = adr; } } @@ -307,72 +307,72 @@ SYSTEM_PTR Heap_NEWREC (address tag) i = adr + 16; end = adr + blksz; while (i < end) { - __PUT(i, 0, address); - __PUT(i + 4, 0, address); - __PUT(i + 8, 0, address); - __PUT(i + 12, 0, address); + __PUT(i, 0, int32); + __PUT(i + 4, 0, int32); + __PUT(i + 8, 0, int32); + __PUT(i + 12, 0, int32); i += 16; } - __PUT(adr + 12, 0, address); - __PUT(adr, tag, address); - __PUT(adr + 4, 0, address); - __PUT(adr + 8, 0, address); + __PUT(adr + 12, 0, int32); + __PUT(adr, tag, int32); + __PUT(adr + 4, 0, int32); + __PUT(adr + 8, 0, int32); Heap_allocated += blksz; Heap_Unlock(); _o_result = (SYSTEM_PTR)(address)(adr + 4); return _o_result; } -SYSTEM_PTR Heap_NEWBLK (address size) +SYSTEM_PTR Heap_NEWBLK (int32 size) { SYSTEM_PTR _o_result; - address blksz, tag; + int32 blksz, tag; SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 31, 4), 4); new = Heap_NEWREC((address)&blksz); - tag = ((address)(address)new + blksz) - 12; - __PUT(tag - 4, 0, address); - __PUT(tag, blksz, address); - __PUT(tag + 4, -4, address); - __PUT((address)(address)new - 4, tag, address); + tag = ((int32)(address)new + blksz) - 12; + __PUT(tag - 4, 0, int32); + __PUT(tag, blksz, int32); + __PUT(tag + 4, -4, int32); + __PUT((int32)(address)new - 4, tag, int32); Heap_Unlock(); _o_result = new; return _o_result; } -static void Heap_Mark (address q) +static void Heap_Mark (int32 q) { - address p, tag, offset, fld, n, tagbits; + int32 p, tag, offset, fld, n, tagbits; if (q != 0) { - __GET(q - 4, tagbits, address); + __GET(q - 4, tagbits, int32); if (!__ODD(tagbits)) { - __PUT(q - 4, tagbits + 1, address); + __PUT(q - 4, tagbits + 1, int32); p = 0; tag = tagbits + 4; for (;;) { - __GET(tag, offset, address); + __GET(tag, offset, int32); if (offset < 0) { - __PUT(q - 4, (tag + offset) + 1, address); + __PUT(q - 4, (tag + offset) + 1, int32); if (p == 0) { break; } n = q; q = p; - __GET(q - 4, tag, address); + __GET(q - 4, tag, int32); tag -= 1; - __GET(tag, offset, address); + __GET(tag, offset, int32); fld = q + offset; - __GET(fld, p, address); + __GET(fld, p, int32); __PUT(fld, (SYSTEM_PTR)(address)n, SYSTEM_PTR); } else { fld = q + offset; - __GET(fld, n, address); + __GET(fld, n, int32); if (n != 0) { - __GET(n - 4, tagbits, address); + __GET(n - 4, tagbits, int32); if (!__ODD(tagbits)) { - __PUT(n - 4, tagbits + 1, address); - __PUT(q - 4, tag + 1, address); + __PUT(n - 4, tagbits + 1, int32); + __PUT(q - 4, tag + 1, int32); __PUT(fld, (SYSTEM_PTR)(address)p, SYSTEM_PTR); p = q; q = n; @@ -388,12 +388,12 @@ static void Heap_Mark (address q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((address)(address)p); + Heap_Mark((int32)(address)p); } static void Heap_Scan (void) { - address chnk, adr, end, start, tag, i, size, freesize; + int32 chnk, adr, end, start, tag, i, size, freesize; Heap_bigBlocks = 0; i = 1; while (i < 9) { @@ -405,58 +405,58 @@ static void Heap_Scan (void) chnk = Heap_heap; while (chnk != 0) { adr = chnk + 12; - __GET(chnk + 4, end, address); + __GET(chnk + 4, end, int32); while (adr < end) { - __GET(adr, tag, address); + __GET(adr, tag, int32); if (__ODD(tag)) { if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 4, address); - __PUT(start + 4, freesize, address); - __PUT(start + 8, -4, address); + __PUT(start, start + 4, int32); + __PUT(start + 4, freesize, int32); + __PUT(start + 8, -4, int32); i = __ASHR(freesize, 4); freesize = 0; if (i < 9) { - __PUT(start + 12, Heap_freeList[i], address); + __PUT(start + 12, Heap_freeList[i], int32); Heap_freeList[i] = start; } else { - __PUT(start + 12, Heap_bigBlocks, address); + __PUT(start + 12, Heap_bigBlocks, int32); Heap_bigBlocks = start; } } tag -= 1; - __PUT(adr, tag, address); - __GET(tag, size, address); + __PUT(adr, tag, int32); + __GET(tag, size, int32); Heap_allocated += size; adr += size; } else { - __GET(tag, size, address); + __GET(tag, size, int32); freesize += size; adr += size; } } if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 4, address); - __PUT(start + 4, freesize, address); - __PUT(start + 8, -4, address); + __PUT(start, start + 4, int32); + __PUT(start + 4, freesize, int32); + __PUT(start + 8, -4, int32); i = __ASHR(freesize, 4); freesize = 0; if (i < 9) { - __PUT(start + 12, Heap_freeList[i], address); + __PUT(start + 12, Heap_freeList[i], int32); Heap_freeList[i] = start; } else { - __PUT(start + 12, Heap_bigBlocks, address); + __PUT(start + 12, Heap_bigBlocks, int32); Heap_bigBlocks = start; } } - __GET(chnk, chnk, address); + __GET(chnk, chnk, int32); } } -static void Heap_Sift (address l, address r, address *a, LONGINT a__len) +static void Heap_Sift (int32 l, int32 r, int32 *a, LONGINT a__len) { - address i, j, x; + int32 i, j, x; j = l; x = a[j]; for (;;) { @@ -473,9 +473,9 @@ static void Heap_Sift (address l, address r, address *a, LONGINT a__len) a[i] = x; } -static void Heap_HeapSort (address n, address *a, LONGINT a__len) +static void Heap_HeapSort (int32 n, int32 *a, LONGINT a__len) { - address l, r, x; + int32 l, r, x; l = __ASHR(n, 1); r = n - 1; while (l > 0) { @@ -491,25 +491,25 @@ static void Heap_HeapSort (address n, address *a, LONGINT a__len) } } -static void Heap_MarkCandidates (address n, address *cand, LONGINT cand__len) +static void Heap_MarkCandidates (int32 n, int32 *cand, LONGINT cand__len) { - address chnk, adr, tag, next, lim, lim1, i, ptr, size; + int32 chnk, adr, tag, next, lim, lim1, i, ptr, size; chnk = Heap_heap; i = 0; lim = cand[n - 1]; while ((chnk != 0 && chnk < lim)) { adr = chnk + 12; - __GET(chnk + 4, lim1, address); + __GET(chnk + 4, lim1, int32); if (lim < lim1) { lim1 = lim; } while (adr < lim1) { - __GET(adr, tag, address); + __GET(adr, tag, int32); if (__ODD(tag)) { - __GET(tag - 1, size, address); + __GET(tag - 1, size, int32); adr += size; } else { - __GET(tag, size, address); + __GET(tag, size, int32); ptr = adr + 4; while (cand[i] < ptr) { i += 1; @@ -524,17 +524,17 @@ static void Heap_MarkCandidates (address n, address *cand, LONGINT cand__len) adr = next; } } - __GET(chnk, chnk, address); + __GET(chnk, chnk, int32); } } static void Heap_CheckFin (void) { Heap_FinNode n; - address tag; + int32 tag; n = Heap_fin; while (n != NIL) { - __GET(n->obj - 4, tag, address); + __GET(n->obj - 4, tag, int32); if (!__ODD(tag)) { n->marked = 0; Heap_Mark(n->obj); @@ -580,10 +580,10 @@ void Heap_FINALL (void) } } -static void Heap_MarkStack (address n, address *cand, LONGINT cand__len) +static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len) { SYSTEM_PTR frame; - address inc, nofcand, sp, p, stack0; + int32 inc, nofcand, sp, p, stack0; struct Heap__1 align; if (n > 0) { Heap_MarkStack(n - 1, cand, cand__len); @@ -600,7 +600,7 @@ static void Heap_MarkStack (address n, address *cand, LONGINT cand__len) inc = -inc; } while (sp != stack0) { - __GET(sp, p, address); + __GET(sp, p, int32); if ((p > Heap_heap && p < Heap_heapend)) { if (nofcand == cand__len) { Heap_HeapSort(nofcand, (void*)cand, cand__len); @@ -622,8 +622,8 @@ static void Heap_MarkStack (address n, address *cand, LONGINT cand__len) void Heap_GC (BOOLEAN markStack) { Heap_Module m; - address i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; - address cand[10000]; + int32 i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; + int32 cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); m = (Heap_Module)(address)Heap_modules; @@ -703,7 +703,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (address)(address)obj; + f->obj = (int32)(address)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; @@ -713,8 +713,8 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) void Heap_InitHeap (void) { Heap_heap = Heap_NewChunk(128000); - __GET(Heap_heap + 4, Heap_heapend, address); - __PUT(Heap_heap, 0, address); + __GET(Heap_heap + 4, Heap_heapend, int32); + __PUT(Heap_heap, 0, int32); Heap_allocated = 0; Heap_firstTry = 1; Heap_freeList[9] = 1; diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index 3ea975a7..eccb5d85 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h @@ -31,7 +31,7 @@ typedef import SYSTEM_PTR Heap_modules; -import address Heap_allocated, Heap_heapsize; +import int32 Heap_allocated, Heap_heapsize; import int16 Heap_FileCount; import address *Heap_ModuleDesc__typ; @@ -41,11 +41,11 @@ import void Heap_GC (BOOLEAN markStack); import void Heap_INCREF (Heap_Module m); import void Heap_InitHeap (void); import void Heap_Lock (void); -import SYSTEM_PTR Heap_NEWBLK (address size); -import SYSTEM_PTR Heap_NEWREC (address tag); +import SYSTEM_PTR Heap_NEWBLK (int32 size); +import SYSTEM_PTR Heap_NEWREC (int32 tag); import void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); import SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -import void Heap_REGTYP (Heap_Module m, address typ); +import void Heap_REGTYP (Heap_Module m, int32 typ); import void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); import void Heap_Unlock (void); import void *Heap__init(void); diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index 21d62e05..a87d0732 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index d2d0a476..93e2105b 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index 6c15aa17..d211135a 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -2449,12 +2449,8 @@ void OPB_Param (OPT_Node ap, OPT_Object fp) OPB_err(111); } } else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 11)) { - } else if (ap->typ != fp->typ) { - if ((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x1e, 32) && ap->typ->size == 1)))) { - } else if ((ap->typ == OPT_adrtyp && fp->typ == OPT_IntType(ap->typ->size))) { - } else { - OPB_err(123); - } + } else if ((ap->typ != fp->typ && !((((fp->typ->form == 1 && __IN(ap->typ->form, 0x1e, 32))) && ap->typ->size == 1)))) { + OPB_err(123); } else if ((fp->typ->form == 11 && ap->class == 5)) { OPB_err(123); } diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index 8395741b..97860bfc 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 9104c5c4..e4c0eb06 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index 6236cd73..3325aded 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index abb5a584..7234f518 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index b62666db..e249edd5 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index 66b821d2..1e5c6674 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index ea6663ba..3b9acd86 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index 2b449cae..ee182741 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index 8d90d974..1514d9eb 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 1b69128c..0a1f8f54 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index 1a525fcb..d4f953ba 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index cdb2ab50..a70a40bf 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index 09931dda..0a9135f5 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index e95203ed..ef0c0dbe 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -13,7 +13,7 @@ typedef Platform_ArgPtr (*Platform_ArgVec)[1024]; typedef - address (*Platform_ArgVecPtr)[1]; + int32 (*Platform_ArgVecPtr)[1]; typedef CHAR (*Platform_EnvPtr)[1024]; @@ -31,12 +31,12 @@ typedef export BOOLEAN Platform_LittleEndian; -export address Platform_MainStackFrame; +export int32 Platform_MainStackFrame; export int32 Platform_HaltCode; export int16 Platform_PID; export CHAR Platform_CWD[256]; export int16 Platform_ArgCount; -export address Platform_ArgVector; +export int32 Platform_ArgVector; static Platform_HaltProcedure Platform_HaltHandler; static int32 Platform_TimeStart; export int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; @@ -64,15 +64,15 @@ export void Platform_Halt (int32 code); export int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ); export int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); export BOOLEAN Platform_Inaccessible (int16 e); -export void Platform_Init (int16 argc, address argvadr); +export void Platform_Init (int16 argc, int32 argvadr); export void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); export int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); export BOOLEAN Platform_NoSuchDirectory (int16 e); -export address Platform_OSAllocate (address size); -export void Platform_OSFree (address address); +export int32 Platform_OSAllocate (int32 size); +export void Platform_OSFree (int32 address); export int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); export int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); -export int16 Platform_Read (int32 h, address p, int32 l, int32 *n); +export int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n); export int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n); export int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); export BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); @@ -92,7 +92,7 @@ export BOOLEAN Platform_TimedOut (int16 e); export BOOLEAN Platform_TooManyFiles (int16 e); export int16 Platform_Truncate (int32 h, int32 l); export int16 Platform_Unlink (CHAR *n, LONGINT n__len); -export int16 Platform_Write (int32 h, address p, int32 l); +export int16 Platform_Write (int32 h, int32 p, int32 l); static void Platform_YMDHMStoClock (int32 ye, int32 mo, int32 da, int32 ho, int32 mi, int32 se, int32 *t, int32 *d); static void Platform_errch (CHAR c); static void Platform_errint (int32 l); @@ -218,19 +218,19 @@ BOOLEAN Platform_ConnectionFailed (int16 e) return _o_result; } -address Platform_OSAllocate (address size) +int32 Platform_OSAllocate (int32 size) { - address _o_result; + int32 _o_result; _o_result = Platform_allocate(size); return _o_result; } -void Platform_OSFree (address address) +void Platform_OSFree (int32 address) { Platform_free(address); } -void Platform_Init (int16 argc, address argvadr) +void Platform_Init (int16 argc, int32 argvadr) { Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; @@ -517,7 +517,7 @@ int16 Platform_Size (int32 h, int32 *l) return _o_result; } -int16 Platform_Read (int32 h, address p, int32 l, int32 *n) +int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n) { int16 _o_result; *n = Platform_readfile(h, p, l); @@ -547,10 +547,10 @@ int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n) __RETCHK; } -int16 Platform_Write (int32 h, address p, int32 l) +int16 Platform_Write (int32 h, int32 p, int32 l) { int16 _o_result; - address written; + int32 written; written = Platform_writefile(h, p, l); if (written < 0) { _o_result = Platform_err(); diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index d76d7ed5..986a65ef 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h @@ -7,7 +7,8 @@ typedef struct Platform_FileIdentity { - int32 volume, index, mtime; + int32 _prvt0; + char _prvt1[8]; } Platform_FileIdentity; typedef @@ -18,12 +19,12 @@ typedef import BOOLEAN Platform_LittleEndian; -import address Platform_MainStackFrame; +import int32 Platform_MainStackFrame; import int32 Platform_HaltCode; import int16 Platform_PID; import CHAR Platform_CWD[256]; import int16 Platform_ArgCount; -import address Platform_ArgVector; +import int32 Platform_ArgVector; import int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; import CHAR Platform_nl[3]; @@ -48,15 +49,15 @@ import void Platform_Halt (int32 code); import int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ); import int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); import BOOLEAN Platform_Inaccessible (int16 e); -import void Platform_Init (int16 argc, address argvadr); +import void Platform_Init (int16 argc, int32 argvadr); import void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); import int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); import BOOLEAN Platform_NoSuchDirectory (int16 e); -import address Platform_OSAllocate (address size); -import void Platform_OSFree (address address); +import int32 Platform_OSAllocate (int32 size); +import void Platform_OSFree (int32 address); import int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); import int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); -import int16 Platform_Read (int32 h, address p, int32 l, int32 *n); +import int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n); import int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n); import int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); import BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); @@ -75,7 +76,7 @@ import BOOLEAN Platform_TimedOut (int16 e); import BOOLEAN Platform_TooManyFiles (int16 e); import int16 Platform_Truncate (int32 h, int32 l); import int16 Platform_Unlink (CHAR *n, LONGINT n__len); -import int16 Platform_Write (int32 h, address p, int32 l); +import int16 Platform_Write (int32 h, int32 p, int32 l); import BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); import void *Platform__init(void); diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 4b72fbe3..e75d35ff 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index 4a4c73b0..8a42b39b 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index f765b98f..9f9562db 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index be1e7d7f..da213d81 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index 779daa7a..ab510cdb 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index 07f53445..64e78861 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/Vishap.c b/bootstrap/unix-48/Vishap.c deleted file mode 100644 index 30b81ac7..00000000 --- a/bootstrap/unix-48/Vishap.c +++ /dev/null @@ -1,171 +0,0 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ - -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 - -#include "SYSTEM.h" -#include "Configuration.h" -#include "Heap.h" -#include "OPB.h" -#include "OPC.h" -#include "OPM.h" -#include "OPP.h" -#include "OPT.h" -#include "OPV.h" -#include "Platform.h" -#include "Strings.h" -#include "extTools.h" -#include "vt100.h" - - -static CHAR Vishap_mname[256]; - - -export void Vishap_Module (BOOLEAN *done); -static void Vishap_PropagateElementaryTypeSizes (void); -export void Vishap_Translate (void); -static void Vishap_Trap (int16 sig); - - -void Vishap_Module (BOOLEAN *done) -{ - BOOLEAN ext, new; - OPT_Node p = NIL; - OPP_Module(&p, OPM_opt); - if (OPM_noerr) { - OPV_Init(); - OPT_InitRecno(); - OPV_AdrAndSize(OPT_topScope); - OPT_Export(&ext, &new); - if (OPM_noerr) { - OPM_OpenFiles((void*)OPT_SelfName, 256); - OPC_Init(); - OPV_Module(p); - if (OPM_noerr) { - if ((__IN(10, OPM_opt, 32) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { - OPM_DeleteNewSym(); - if (!__IN(16, OPM_opt, 32)) { - vt100_SetAttr((CHAR*)"32m", 4); - } - OPM_LogWStr((CHAR*)" Main program.", 16); - if (!__IN(16, OPM_opt, 32)) { - vt100_SetAttr((CHAR*)"0m", 3); - } - } else { - if (new) { - if (!__IN(16, OPM_opt, 32)) { - vt100_SetAttr((CHAR*)"32m", 4); - } - OPM_LogWStr((CHAR*)" New symbol file.", 19); - if (!__IN(16, OPM_opt, 32)) { - vt100_SetAttr((CHAR*)"0m", 3); - } - OPM_RegisterNewSym(); - } else if (ext) { - OPM_LogWStr((CHAR*)" Extended symbol file.", 24); - OPM_RegisterNewSym(); - } - } - } else { - OPM_DeleteNewSym(); - } - } - } - OPM_CloseFiles(); - OPT_Close(); - OPM_LogWLn(); - *done = OPM_noerr; -} - -static void Vishap_PropagateElementaryTypeSizes (void) -{ - OPT_sysptrtyp->size = OPM_AddressSize; - OPT_adrtyp->size = OPM_AddressSize; - OPT_settyp->size = OPM_SetSize; - OPT_sinttyp = OPT_IntType(OPM_ShortintSize); - OPT_inttyp = OPT_IntType(OPM_IntegerSize); - OPT_linttyp = OPT_IntType(OPM_LongintSize); - OPT_sintobj->typ = OPT_sinttyp; - OPT_intobj->typ = OPT_inttyp; - OPT_lintobj->typ = OPT_linttyp; -} - -void Vishap_Translate (void) -{ - BOOLEAN done; - CHAR modulesobj[2048]; - modulesobj[0] = 0x00; - if (OPM_OpenPar()) { - for (;;) { - OPM_Init(&done, (void*)Vishap_mname, 256); - if (!done) { - return; - } - OPM_InitOptions(); - Vishap_PropagateElementaryTypeSizes(); - Heap_GC(0); - Vishap_Module(&done); - if (!done) { - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Module compilation failed.", 27); - OPM_LogWLn(); - Platform_Exit(1); - } - if (!__IN(13, OPM_opt, 32)) { - if (__IN(14, OPM_opt, 32)) { - extTools_Assemble(OPM_modName, 32); - } else { - if (!__IN(10, OPM_opt, 32)) { - extTools_Assemble(OPM_modName, 32); - Strings_Append((CHAR*)" ", 2, (void*)modulesobj, 2048); - Strings_Append(OPM_modName, 32, (void*)modulesobj, 2048); - Strings_Append((CHAR*)".o", 3, (void*)modulesobj, 2048); - } else { - extTools_LinkMain((void*)OPM_modName, 32, __IN(15, OPM_opt, 32), modulesobj, 2048); - } - } - } - } - } -} - -static void Vishap_Trap (int16 sig) -{ - Heap_FINALL(); - if (sig == 3) { - Platform_Exit(0); - } else { - if ((sig == 4 && Platform_HaltCode == -15)) { - OPM_LogWStr((CHAR*)" --- Vishap Oberon: internal error", 35); - OPM_LogWLn(); - } - Platform_Exit(2); - } -} - - -export int main(int argc, char **argv) -{ - __INIT(argc, argv); - __MODULE_IMPORT(Configuration); - __MODULE_IMPORT(Heap); - __MODULE_IMPORT(OPB); - __MODULE_IMPORT(OPC); - __MODULE_IMPORT(OPM); - __MODULE_IMPORT(OPP); - __MODULE_IMPORT(OPT); - __MODULE_IMPORT(OPV); - __MODULE_IMPORT(Platform); - __MODULE_IMPORT(Strings); - __MODULE_IMPORT(extTools); - __MODULE_IMPORT(vt100); - __REGMAIN("Vishap", 0); - __REGCMD("Translate", Vishap_Translate); -/* BEGIN */ - Platform_SetInterruptHandler(Vishap_Trap); - Platform_SetQuitHandler(Vishap_Trap); - Platform_SetBadInstructionHandler(Vishap_Trap); - Vishap_Translate(); - __FINI; -} diff --git a/bootstrap/unix-48/errors.c b/bootstrap/unix-48/errors.c index d465624d..34e6fae3 100644 --- a/bootstrap/unix-48/errors.c +++ b/bootstrap/unix-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/errors.h b/bootstrap/unix-48/errors.h index cf093ab3..ce275b8c 100644 --- a/bootstrap/unix-48/errors.h +++ b/bootstrap/unix-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index 46f8ac7e..fd7974da 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index 700e6b39..f87adfac 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/vt100.c b/bootstrap/unix-48/vt100.c index 8d4cbdfc..ca56f466 100644 --- a/bootstrap/unix-48/vt100.c +++ b/bootstrap/unix-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/vt100.h b/bootstrap/unix-48/vt100.h index da86e98b..f5b8588f 100644 --- a/bootstrap/unix-48/vt100.h +++ b/bootstrap/unix-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index 7f7f4b26..28528f64 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index 618bc77f..d9030dbe 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Console.c b/bootstrap/unix-88/Console.c index f9e5e585..5bf17489 100644 --- a/bootstrap/unix-88/Console.c +++ b/bootstrap/unix-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-88/Console.h b/bootstrap/unix-88/Console.h index d645f05c..4eb27c8b 100644 --- a/bootstrap/unix-88/Console.h +++ b/bootstrap/unix-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index d7e16dab..5b82978c 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -83,7 +83,6 @@ export int32 Files_Pos (Files_Rider *r, address *r__typ); export void Files_Purge (Files_File f); export void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x); export void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x); -export void Files_ReadByte (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len); export void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); export void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x); export void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); @@ -673,11 +672,6 @@ void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x (*r).eof = 0; } -void Files_ReadByte (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len) -{ - Files_ReadBytes(&*r, r__typ, (void*)x, x__len * 1, 1); -} - Files_File Files_Base (Files_Rider *r, address *r__typ) { Files_File _o_result; diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 64d47c3f..75495244 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h @@ -42,7 +42,6 @@ import int32 Files_Pos (Files_Rider *r, address *r__typ); import void Files_Purge (Files_File f); import void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x); import void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x); -import void Files_ReadByte (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len); import void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); import void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x); import void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index 785efa1a..ca208a31 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define INTEGER int16 #define LONGINT int32 @@ -39,7 +39,7 @@ typedef typedef struct Heap_FinDesc { Heap_FinNode next; - address obj; + int64 obj; BOOLEAN marked; Heap_Finalizer finalize; } Heap_FinDesc; @@ -56,19 +56,19 @@ typedef Heap_ModuleName name; int32 refcnt; Heap_Cmd cmds; - address types; + int64 types; Heap_EnumProc enumPtrs; int32 reserved1, reserved2; } Heap_ModuleDesc; export SYSTEM_PTR Heap_modules; -static address Heap_freeList[10]; -static address Heap_bigBlocks; -export address Heap_allocated; +static int64 Heap_freeList[10]; +static int64 Heap_bigBlocks; +export int64 Heap_allocated; static BOOLEAN Heap_firstTry; -static address Heap_heap, Heap_heapend; -export address Heap_heapsize; +static int64 Heap_heap, Heap_heapend; +export int64 Heap_heapsize; static Heap_FinNode Heap_fin; static int16 Heap_lockdepth; static BOOLEAN Heap_interrupted; @@ -80,27 +80,27 @@ export address *Heap_FinDesc__typ; export address *Heap__1__typ; static void Heap_CheckFin (void); -static void Heap_ExtendHeap (address blksz); +static void Heap_ExtendHeap (int64 blksz); export void Heap_FINALL (void); static void Heap_Finalize (void); export void Heap_GC (BOOLEAN markStack); -static void Heap_HeapSort (address n, address *a, LONGINT a__len); +static void Heap_HeapSort (int64 n, int64 *a, LONGINT a__len); export void Heap_INCREF (Heap_Module m); export void Heap_InitHeap (void); export void Heap_Lock (void); -static void Heap_Mark (address q); -static void Heap_MarkCandidates (address n, address *cand, LONGINT cand__len); +static void Heap_Mark (int64 q); +static void Heap_MarkCandidates (int64 n, int64 *cand, LONGINT cand__len); static void Heap_MarkP (SYSTEM_PTR p); -static void Heap_MarkStack (address n, address *cand, LONGINT cand__len); -export SYSTEM_PTR Heap_NEWBLK (address size); -export SYSTEM_PTR Heap_NEWREC (address tag); -static address Heap_NewChunk (address blksz); +static void Heap_MarkStack (int64 n, int64 *cand, LONGINT cand__len); +export SYSTEM_PTR Heap_NEWBLK (int64 size); +export SYSTEM_PTR Heap_NEWREC (int64 tag); +static int64 Heap_NewChunk (int64 blksz); export void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); export SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -export void Heap_REGTYP (Heap_Module m, address typ); +export void Heap_REGTYP (Heap_Module m, int64 typ); export void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); static void Heap_Scan (void); -static void Heap_Sift (address l, address r, address *a, LONGINT a__len); +static void Heap_Sift (int64 l, int64 r, int64 *a, LONGINT a__len); export void Heap_Unlock (void); extern void *Heap__init(); @@ -158,9 +158,9 @@ void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) m->cmds = c; } -void Heap_REGTYP (Heap_Module m, address typ) +void Heap_REGTYP (Heap_Module m, int64 typ) { - __PUT(typ, m->types, address); + __PUT(typ, m->types, int64); m->types = typ; } @@ -169,17 +169,17 @@ void Heap_INCREF (Heap_Module m) m->refcnt += 1; } -static address Heap_NewChunk (address blksz) +static int64 Heap_NewChunk (int64 blksz) { - address _o_result; - address chnk; + int64 _o_result; + int64 chnk; chnk = Heap_OSAllocate(blksz + 24); if (chnk != 0) { - __PUT(chnk + 8, chnk + (24 + blksz), address); - __PUT(chnk + 24, chnk + 32, address); - __PUT(chnk + 32, blksz, address); - __PUT(chnk + 40, -8, address); - __PUT(chnk + 48, Heap_bigBlocks, address); + __PUT(chnk + 8, chnk + (24 + blksz), int64); + __PUT(chnk + 24, chnk + 32, int64); + __PUT(chnk + 32, blksz, int64); + __PUT(chnk + 40, -8, int64); + __PUT(chnk + 48, Heap_bigBlocks, int64); Heap_bigBlocks = chnk + 24; Heap_heapsize += blksz; } @@ -187,9 +187,9 @@ static address Heap_NewChunk (address blksz) return _o_result; } -static void Heap_ExtendHeap (address blksz) +static void Heap_ExtendHeap (int64 blksz) { - address size, chnk, j, next; + int64 size, chnk, j, next; if (blksz > 320000) { size = blksz; } else { @@ -198,31 +198,31 @@ static void Heap_ExtendHeap (address blksz) chnk = Heap_NewChunk(size); if (chnk != 0) { if (chnk < Heap_heap) { - __PUT(chnk, Heap_heap, address); + __PUT(chnk, Heap_heap, int64); Heap_heap = chnk; } else { j = Heap_heap; - __GET(j, next, address); + __GET(j, next, int64); while ((next != 0 && chnk > next)) { j = next; - __GET(j, next, address); + __GET(j, next, int64); } - __PUT(chnk, next, address); - __PUT(j, chnk, address); + __PUT(chnk, next, int64); + __PUT(j, chnk, int64); } if (next == 0) { - __GET(chnk + 8, Heap_heapend, address); + __GET(chnk + 8, Heap_heapend, int64); } } } -SYSTEM_PTR Heap_NEWREC (address tag) +SYSTEM_PTR Heap_NEWREC (int64 tag) { SYSTEM_PTR _o_result; - address i, i0, di, blksz, restsize, t, adr, end, next, prev; + int64 i, i0, di, blksz, restsize, t, adr, end, next, prev; SYSTEM_PTR new; Heap_Lock(); - __GET(tag, blksz, address); + __GET(tag, blksz, int64); i0 = __ASHR(blksz, 5); i = i0; if (i < 9) { @@ -233,17 +233,17 @@ SYSTEM_PTR Heap_NEWREC (address tag) } } if (i < 9) { - __GET(adr + 24, next, address); + __GET(adr + 24, next, int64); Heap_freeList[i] = next; if (i != i0) { di = i - i0; restsize = __ASHL(di, 5); end = adr + restsize; - __PUT(end + 8, blksz, address); - __PUT(end + 16, -8, address); - __PUT(end, end + 8, address); - __PUT(adr + 8, restsize, address); - __PUT(adr + 24, Heap_freeList[di], address); + __PUT(end + 8, blksz, int64); + __PUT(end + 16, -8, int64); + __PUT(end, end + 8, int64); + __PUT(adr + 8, restsize, int64); + __PUT(adr + 24, Heap_freeList[di], int64); Heap_freeList[di] = adr; adr += restsize; } @@ -274,31 +274,31 @@ SYSTEM_PTR Heap_NEWREC (address tag) return _o_result; } } - __GET(adr + 8, t, address); + __GET(adr + 8, t, int64); if (t >= blksz) { break; } prev = adr; - __GET(adr + 24, adr, address); + __GET(adr + 24, adr, int64); } restsize = t - blksz; end = adr + restsize; - __PUT(end + 8, blksz, address); - __PUT(end + 16, -8, address); - __PUT(end, end + 8, address); + __PUT(end + 8, blksz, int64); + __PUT(end + 16, -8, int64); + __PUT(end, end + 8, int64); if (restsize > 288) { - __PUT(adr + 8, restsize, address); + __PUT(adr + 8, restsize, int64); } else { - __GET(adr + 24, next, address); + __GET(adr + 24, next, int64); if (prev == 0) { Heap_bigBlocks = next; } else { - __PUT(prev + 24, next, address); + __PUT(prev + 24, next, int64); } if (restsize > 0) { di = __ASHR(restsize, 5); - __PUT(adr + 8, restsize, address); - __PUT(adr + 24, Heap_freeList[di], address); + __PUT(adr + 8, restsize, int64); + __PUT(adr + 24, Heap_freeList[di], int64); Heap_freeList[di] = adr; } } @@ -307,72 +307,72 @@ SYSTEM_PTR Heap_NEWREC (address tag) i = adr + 32; end = adr + blksz; while (i < end) { - __PUT(i, 0, address); - __PUT(i + 8, 0, address); - __PUT(i + 16, 0, address); - __PUT(i + 24, 0, address); + __PUT(i, 0, int64); + __PUT(i + 8, 0, int64); + __PUT(i + 16, 0, int64); + __PUT(i + 24, 0, int64); i += 32; } - __PUT(adr + 24, 0, address); - __PUT(adr, tag, address); - __PUT(adr + 8, 0, address); - __PUT(adr + 16, 0, address); + __PUT(adr + 24, 0, int64); + __PUT(adr, tag, int64); + __PUT(adr + 8, 0, int64); + __PUT(adr + 16, 0, int64); Heap_allocated += blksz; Heap_Unlock(); _o_result = (SYSTEM_PTR)(address)(adr + 8); return _o_result; } -SYSTEM_PTR Heap_NEWBLK (address size) +SYSTEM_PTR Heap_NEWBLK (int64 size) { SYSTEM_PTR _o_result; - address blksz, tag; + int64 blksz, tag; SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 63, 5), 5); new = Heap_NEWREC((address)&blksz); - tag = ((address)(address)new + blksz) - 24; - __PUT(tag - 8, 0, address); - __PUT(tag, blksz, address); - __PUT(tag + 8, -8, address); - __PUT((address)(address)new - 8, tag, address); + tag = ((int64)(address)new + blksz) - 24; + __PUT(tag - 8, 0, int64); + __PUT(tag, blksz, int64); + __PUT(tag + 8, -8, int64); + __PUT((int64)(address)new - 8, tag, int64); Heap_Unlock(); _o_result = new; return _o_result; } -static void Heap_Mark (address q) +static void Heap_Mark (int64 q) { - address p, tag, offset, fld, n, tagbits; + int64 p, tag, offset, fld, n, tagbits; if (q != 0) { - __GET(q - 8, tagbits, address); + __GET(q - 8, tagbits, int64); if (!__ODD(tagbits)) { - __PUT(q - 8, tagbits + 1, address); + __PUT(q - 8, tagbits + 1, int64); p = 0; tag = tagbits + 8; for (;;) { - __GET(tag, offset, address); + __GET(tag, offset, int64); if (offset < 0) { - __PUT(q - 8, (tag + offset) + 1, address); + __PUT(q - 8, (tag + offset) + 1, int64); if (p == 0) { break; } n = q; q = p; - __GET(q - 8, tag, address); + __GET(q - 8, tag, int64); tag -= 1; - __GET(tag, offset, address); + __GET(tag, offset, int64); fld = q + offset; - __GET(fld, p, address); + __GET(fld, p, int64); __PUT(fld, (SYSTEM_PTR)(address)n, SYSTEM_PTR); } else { fld = q + offset; - __GET(fld, n, address); + __GET(fld, n, int64); if (n != 0) { - __GET(n - 8, tagbits, address); + __GET(n - 8, tagbits, int64); if (!__ODD(tagbits)) { - __PUT(n - 8, tagbits + 1, address); - __PUT(q - 8, tag + 1, address); + __PUT(n - 8, tagbits + 1, int64); + __PUT(q - 8, tag + 1, int64); __PUT(fld, (SYSTEM_PTR)(address)p, SYSTEM_PTR); p = q; q = n; @@ -388,12 +388,12 @@ static void Heap_Mark (address q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((address)(address)p); + Heap_Mark((int64)(address)p); } static void Heap_Scan (void) { - address chnk, adr, end, start, tag, i, size, freesize; + int64 chnk, adr, end, start, tag, i, size, freesize; Heap_bigBlocks = 0; i = 1; while (i < 9) { @@ -405,58 +405,58 @@ static void Heap_Scan (void) chnk = Heap_heap; while (chnk != 0) { adr = chnk + 24; - __GET(chnk + 8, end, address); + __GET(chnk + 8, end, int64); while (adr < end) { - __GET(adr, tag, address); + __GET(adr, tag, int64); if (__ODD(tag)) { if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 8, address); - __PUT(start + 8, freesize, address); - __PUT(start + 16, -8, address); + __PUT(start, start + 8, int64); + __PUT(start + 8, freesize, int64); + __PUT(start + 16, -8, int64); i = __ASHR(freesize, 5); freesize = 0; if (i < 9) { - __PUT(start + 24, Heap_freeList[i], address); + __PUT(start + 24, Heap_freeList[i], int64); Heap_freeList[i] = start; } else { - __PUT(start + 24, Heap_bigBlocks, address); + __PUT(start + 24, Heap_bigBlocks, int64); Heap_bigBlocks = start; } } tag -= 1; - __PUT(adr, tag, address); - __GET(tag, size, address); + __PUT(adr, tag, int64); + __GET(tag, size, int64); Heap_allocated += size; adr += size; } else { - __GET(tag, size, address); + __GET(tag, size, int64); freesize += size; adr += size; } } if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 8, address); - __PUT(start + 8, freesize, address); - __PUT(start + 16, -8, address); + __PUT(start, start + 8, int64); + __PUT(start + 8, freesize, int64); + __PUT(start + 16, -8, int64); i = __ASHR(freesize, 5); freesize = 0; if (i < 9) { - __PUT(start + 24, Heap_freeList[i], address); + __PUT(start + 24, Heap_freeList[i], int64); Heap_freeList[i] = start; } else { - __PUT(start + 24, Heap_bigBlocks, address); + __PUT(start + 24, Heap_bigBlocks, int64); Heap_bigBlocks = start; } } - __GET(chnk, chnk, address); + __GET(chnk, chnk, int64); } } -static void Heap_Sift (address l, address r, address *a, LONGINT a__len) +static void Heap_Sift (int64 l, int64 r, int64 *a, LONGINT a__len) { - address i, j, x; + int64 i, j, x; j = l; x = a[j]; for (;;) { @@ -473,9 +473,9 @@ static void Heap_Sift (address l, address r, address *a, LONGINT a__len) a[i] = x; } -static void Heap_HeapSort (address n, address *a, LONGINT a__len) +static void Heap_HeapSort (int64 n, int64 *a, LONGINT a__len) { - address l, r, x; + int64 l, r, x; l = __ASHR(n, 1); r = n - 1; while (l > 0) { @@ -491,25 +491,25 @@ static void Heap_HeapSort (address n, address *a, LONGINT a__len) } } -static void Heap_MarkCandidates (address n, address *cand, LONGINT cand__len) +static void Heap_MarkCandidates (int64 n, int64 *cand, LONGINT cand__len) { - address chnk, adr, tag, next, lim, lim1, i, ptr, size; + int64 chnk, adr, tag, next, lim, lim1, i, ptr, size; chnk = Heap_heap; i = 0; lim = cand[n - 1]; while ((chnk != 0 && chnk < lim)) { adr = chnk + 24; - __GET(chnk + 8, lim1, address); + __GET(chnk + 8, lim1, int64); if (lim < lim1) { lim1 = lim; } while (adr < lim1) { - __GET(adr, tag, address); + __GET(adr, tag, int64); if (__ODD(tag)) { - __GET(tag - 1, size, address); + __GET(tag - 1, size, int64); adr += size; } else { - __GET(tag, size, address); + __GET(tag, size, int64); ptr = adr + 8; while (cand[i] < ptr) { i += 1; @@ -524,17 +524,17 @@ static void Heap_MarkCandidates (address n, address *cand, LONGINT cand__len) adr = next; } } - __GET(chnk, chnk, address); + __GET(chnk, chnk, int64); } } static void Heap_CheckFin (void) { Heap_FinNode n; - address tag; + int64 tag; n = Heap_fin; while (n != NIL) { - __GET(n->obj - 8, tag, address); + __GET(n->obj - 8, tag, int64); if (!__ODD(tag)) { n->marked = 0; Heap_Mark(n->obj); @@ -580,10 +580,10 @@ void Heap_FINALL (void) } } -static void Heap_MarkStack (address n, address *cand, LONGINT cand__len) +static void Heap_MarkStack (int64 n, int64 *cand, LONGINT cand__len) { SYSTEM_PTR frame; - address inc, nofcand, sp, p, stack0; + int64 inc, nofcand, sp, p, stack0; struct Heap__1 align; if (n > 0) { Heap_MarkStack(n - 1, cand, cand__len); @@ -600,7 +600,7 @@ static void Heap_MarkStack (address n, address *cand, LONGINT cand__len) inc = -inc; } while (sp != stack0) { - __GET(sp, p, address); + __GET(sp, p, int64); if ((p > Heap_heap && p < Heap_heapend)) { if (nofcand == (int64)cand__len) { Heap_HeapSort(nofcand, (void*)cand, cand__len); @@ -622,8 +622,8 @@ static void Heap_MarkStack (address n, address *cand, LONGINT cand__len) void Heap_GC (BOOLEAN markStack) { Heap_Module m; - address i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; - address cand[10000]; + int64 i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; + int64 cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); m = (Heap_Module)(address)Heap_modules; @@ -703,7 +703,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (address)(address)obj; + f->obj = (int64)(address)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; @@ -713,8 +713,8 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) void Heap_InitHeap (void) { Heap_heap = Heap_NewChunk(256000); - __GET(Heap_heap + 8, Heap_heapend, address); - __PUT(Heap_heap, 0, address); + __GET(Heap_heap + 8, Heap_heapend, int64); + __PUT(Heap_heap, 0, int64); Heap_allocated = 0; Heap_firstTry = 1; Heap_freeList[9] = 1; diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index cfa2ab6f..3fcd0b28 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h @@ -31,7 +31,7 @@ typedef import SYSTEM_PTR Heap_modules; -import address Heap_allocated, Heap_heapsize; +import int64 Heap_allocated, Heap_heapsize; import int16 Heap_FileCount; import address *Heap_ModuleDesc__typ; @@ -41,11 +41,11 @@ import void Heap_GC (BOOLEAN markStack); import void Heap_INCREF (Heap_Module m); import void Heap_InitHeap (void); import void Heap_Lock (void); -import SYSTEM_PTR Heap_NEWBLK (address size); -import SYSTEM_PTR Heap_NEWREC (address tag); +import SYSTEM_PTR Heap_NEWBLK (int64 size); +import SYSTEM_PTR Heap_NEWREC (int64 tag); import void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); import SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -import void Heap_REGTYP (Heap_Module m, address typ); +import void Heap_REGTYP (Heap_Module m, int64 typ); import void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); import void Heap_Unlock (void); import void *Heap__init(void); diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index b6890cfe..e3ff56bd 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index d2d0a476..93e2105b 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index 6c15aa17..d211135a 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -2449,12 +2449,8 @@ void OPB_Param (OPT_Node ap, OPT_Object fp) OPB_err(111); } } else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 11)) { - } else if (ap->typ != fp->typ) { - if ((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x1e, 32) && ap->typ->size == 1)))) { - } else if ((ap->typ == OPT_adrtyp && fp->typ == OPT_IntType(ap->typ->size))) { - } else { - OPB_err(123); - } + } else if ((ap->typ != fp->typ && !((((fp->typ->form == 1 && __IN(ap->typ->form, 0x1e, 32))) && ap->typ->size == 1)))) { + OPB_err(123); } else if ((fp->typ->form == 11 && ap->class == 5)) { OPB_err(123); } diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index 8395741b..97860bfc 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index 9104c5c4..e4c0eb06 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index 6236cd73..3325aded 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 18e25b0f..4710b95f 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index b62666db..e249edd5 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index 03366726..f6a8dfc5 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index ea6663ba..3b9acd86 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index 2b449cae..ee182741 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index 8d90d974..1514d9eb 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index c9ff5430..ad18ebdb 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 1a525fcb..d4f953ba 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index f9e7c27c..09f3d249 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index 09931dda..0a9135f5 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 8df906c3..5bad2591 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -13,7 +13,7 @@ typedef Platform_ArgPtr (*Platform_ArgVec)[1024]; typedef - address (*Platform_ArgVecPtr)[1]; + int64 (*Platform_ArgVecPtr)[1]; typedef CHAR (*Platform_EnvPtr)[1024]; @@ -31,12 +31,12 @@ typedef export BOOLEAN Platform_LittleEndian; -export address Platform_MainStackFrame; +export int64 Platform_MainStackFrame; export int32 Platform_HaltCode; export int16 Platform_PID; export CHAR Platform_CWD[256]; export int16 Platform_ArgCount; -export address Platform_ArgVector; +export int64 Platform_ArgVector; static Platform_HaltProcedure Platform_HaltHandler; static int32 Platform_TimeStart; export int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; @@ -64,15 +64,15 @@ export void Platform_Halt (int32 code); export int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ); export int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); export BOOLEAN Platform_Inaccessible (int16 e); -export void Platform_Init (int16 argc, address argvadr); +export void Platform_Init (int16 argc, int64 argvadr); export void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); export int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); export BOOLEAN Platform_NoSuchDirectory (int16 e); -export address Platform_OSAllocate (address size); -export void Platform_OSFree (address address); +export int64 Platform_OSAllocate (int64 size); +export void Platform_OSFree (int64 address); export int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); export int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); -export int16 Platform_Read (int32 h, address p, int32 l, int32 *n); +export int16 Platform_Read (int32 h, int64 p, int32 l, int32 *n); export int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n); export int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); export BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); @@ -92,7 +92,7 @@ export BOOLEAN Platform_TimedOut (int16 e); export BOOLEAN Platform_TooManyFiles (int16 e); export int16 Platform_Truncate (int32 h, int32 l); export int16 Platform_Unlink (CHAR *n, LONGINT n__len); -export int16 Platform_Write (int32 h, address p, int32 l); +export int16 Platform_Write (int32 h, int64 p, int32 l); static void Platform_YMDHMStoClock (int32 ye, int32 mo, int32 da, int32 ho, int32 mi, int32 se, int32 *t, int32 *d); static void Platform_errch (CHAR c); static void Platform_errint (int32 l); @@ -218,19 +218,19 @@ BOOLEAN Platform_ConnectionFailed (int16 e) return _o_result; } -address Platform_OSAllocate (address size) +int64 Platform_OSAllocate (int64 size) { - address _o_result; + int64 _o_result; _o_result = Platform_allocate(size); return _o_result; } -void Platform_OSFree (address address) +void Platform_OSFree (int64 address) { Platform_free(address); } -void Platform_Init (int16 argc, address argvadr) +void Platform_Init (int16 argc, int64 argvadr) { Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; @@ -517,7 +517,7 @@ int16 Platform_Size (int32 h, int32 *l) return _o_result; } -int16 Platform_Read (int32 h, address p, int32 l, int32 *n) +int16 Platform_Read (int32 h, int64 p, int32 l, int32 *n) { int16 _o_result; *n = Platform_readfile(h, p, l); @@ -547,10 +547,10 @@ int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n) __RETCHK; } -int16 Platform_Write (int32 h, address p, int32 l) +int16 Platform_Write (int32 h, int64 p, int32 l) { int16 _o_result; - address written; + int64 written; written = Platform_writefile(h, p, l); if (written < 0) { _o_result = Platform_err(); diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index d76d7ed5..2402b996 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h @@ -7,7 +7,8 @@ typedef struct Platform_FileIdentity { - int32 volume, index, mtime; + int32 _prvt0; + char _prvt1[8]; } Platform_FileIdentity; typedef @@ -18,12 +19,12 @@ typedef import BOOLEAN Platform_LittleEndian; -import address Platform_MainStackFrame; +import int64 Platform_MainStackFrame; import int32 Platform_HaltCode; import int16 Platform_PID; import CHAR Platform_CWD[256]; import int16 Platform_ArgCount; -import address Platform_ArgVector; +import int64 Platform_ArgVector; import int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; import CHAR Platform_nl[3]; @@ -48,15 +49,15 @@ import void Platform_Halt (int32 code); import int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ); import int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); import BOOLEAN Platform_Inaccessible (int16 e); -import void Platform_Init (int16 argc, address argvadr); +import void Platform_Init (int16 argc, int64 argvadr); import void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); import int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); import BOOLEAN Platform_NoSuchDirectory (int16 e); -import address Platform_OSAllocate (address size); -import void Platform_OSFree (address address); +import int64 Platform_OSAllocate (int64 size); +import void Platform_OSFree (int64 address); import int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); import int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); -import int16 Platform_Read (int32 h, address p, int32 l, int32 *n); +import int16 Platform_Read (int32 h, int64 p, int32 l, int32 *n); import int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n); import int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); import BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); @@ -75,7 +76,7 @@ import BOOLEAN Platform_TimedOut (int16 e); import BOOLEAN Platform_TooManyFiles (int16 e); import int16 Platform_Truncate (int32 h, int32 l); import int16 Platform_Unlink (CHAR *n, LONGINT n__len); -import int16 Platform_Write (int32 h, address p, int32 l); +import int16 Platform_Write (int32 h, int64 p, int32 l); import BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); import void *Platform__init(void); diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 4b72fbe3..e75d35ff 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index 4a4c73b0..8a42b39b 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index f765b98f..9f9562db 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index be1e7d7f..da213d81 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index 6cb415b9..2590cb27 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index dc456f77..7800b252 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/Vishap.c b/bootstrap/unix-88/Vishap.c deleted file mode 100644 index 30b81ac7..00000000 --- a/bootstrap/unix-88/Vishap.c +++ /dev/null @@ -1,171 +0,0 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ - -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 - -#include "SYSTEM.h" -#include "Configuration.h" -#include "Heap.h" -#include "OPB.h" -#include "OPC.h" -#include "OPM.h" -#include "OPP.h" -#include "OPT.h" -#include "OPV.h" -#include "Platform.h" -#include "Strings.h" -#include "extTools.h" -#include "vt100.h" - - -static CHAR Vishap_mname[256]; - - -export void Vishap_Module (BOOLEAN *done); -static void Vishap_PropagateElementaryTypeSizes (void); -export void Vishap_Translate (void); -static void Vishap_Trap (int16 sig); - - -void Vishap_Module (BOOLEAN *done) -{ - BOOLEAN ext, new; - OPT_Node p = NIL; - OPP_Module(&p, OPM_opt); - if (OPM_noerr) { - OPV_Init(); - OPT_InitRecno(); - OPV_AdrAndSize(OPT_topScope); - OPT_Export(&ext, &new); - if (OPM_noerr) { - OPM_OpenFiles((void*)OPT_SelfName, 256); - OPC_Init(); - OPV_Module(p); - if (OPM_noerr) { - if ((__IN(10, OPM_opt, 32) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { - OPM_DeleteNewSym(); - if (!__IN(16, OPM_opt, 32)) { - vt100_SetAttr((CHAR*)"32m", 4); - } - OPM_LogWStr((CHAR*)" Main program.", 16); - if (!__IN(16, OPM_opt, 32)) { - vt100_SetAttr((CHAR*)"0m", 3); - } - } else { - if (new) { - if (!__IN(16, OPM_opt, 32)) { - vt100_SetAttr((CHAR*)"32m", 4); - } - OPM_LogWStr((CHAR*)" New symbol file.", 19); - if (!__IN(16, OPM_opt, 32)) { - vt100_SetAttr((CHAR*)"0m", 3); - } - OPM_RegisterNewSym(); - } else if (ext) { - OPM_LogWStr((CHAR*)" Extended symbol file.", 24); - OPM_RegisterNewSym(); - } - } - } else { - OPM_DeleteNewSym(); - } - } - } - OPM_CloseFiles(); - OPT_Close(); - OPM_LogWLn(); - *done = OPM_noerr; -} - -static void Vishap_PropagateElementaryTypeSizes (void) -{ - OPT_sysptrtyp->size = OPM_AddressSize; - OPT_adrtyp->size = OPM_AddressSize; - OPT_settyp->size = OPM_SetSize; - OPT_sinttyp = OPT_IntType(OPM_ShortintSize); - OPT_inttyp = OPT_IntType(OPM_IntegerSize); - OPT_linttyp = OPT_IntType(OPM_LongintSize); - OPT_sintobj->typ = OPT_sinttyp; - OPT_intobj->typ = OPT_inttyp; - OPT_lintobj->typ = OPT_linttyp; -} - -void Vishap_Translate (void) -{ - BOOLEAN done; - CHAR modulesobj[2048]; - modulesobj[0] = 0x00; - if (OPM_OpenPar()) { - for (;;) { - OPM_Init(&done, (void*)Vishap_mname, 256); - if (!done) { - return; - } - OPM_InitOptions(); - Vishap_PropagateElementaryTypeSizes(); - Heap_GC(0); - Vishap_Module(&done); - if (!done) { - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Module compilation failed.", 27); - OPM_LogWLn(); - Platform_Exit(1); - } - if (!__IN(13, OPM_opt, 32)) { - if (__IN(14, OPM_opt, 32)) { - extTools_Assemble(OPM_modName, 32); - } else { - if (!__IN(10, OPM_opt, 32)) { - extTools_Assemble(OPM_modName, 32); - Strings_Append((CHAR*)" ", 2, (void*)modulesobj, 2048); - Strings_Append(OPM_modName, 32, (void*)modulesobj, 2048); - Strings_Append((CHAR*)".o", 3, (void*)modulesobj, 2048); - } else { - extTools_LinkMain((void*)OPM_modName, 32, __IN(15, OPM_opt, 32), modulesobj, 2048); - } - } - } - } - } -} - -static void Vishap_Trap (int16 sig) -{ - Heap_FINALL(); - if (sig == 3) { - Platform_Exit(0); - } else { - if ((sig == 4 && Platform_HaltCode == -15)) { - OPM_LogWStr((CHAR*)" --- Vishap Oberon: internal error", 35); - OPM_LogWLn(); - } - Platform_Exit(2); - } -} - - -export int main(int argc, char **argv) -{ - __INIT(argc, argv); - __MODULE_IMPORT(Configuration); - __MODULE_IMPORT(Heap); - __MODULE_IMPORT(OPB); - __MODULE_IMPORT(OPC); - __MODULE_IMPORT(OPM); - __MODULE_IMPORT(OPP); - __MODULE_IMPORT(OPT); - __MODULE_IMPORT(OPV); - __MODULE_IMPORT(Platform); - __MODULE_IMPORT(Strings); - __MODULE_IMPORT(extTools); - __MODULE_IMPORT(vt100); - __REGMAIN("Vishap", 0); - __REGCMD("Translate", Vishap_Translate); -/* BEGIN */ - Platform_SetInterruptHandler(Vishap_Trap); - Platform_SetQuitHandler(Vishap_Trap); - Platform_SetBadInstructionHandler(Vishap_Trap); - Vishap_Translate(); - __FINI; -} diff --git a/bootstrap/unix-88/errors.c b/bootstrap/unix-88/errors.c index d465624d..34e6fae3 100644 --- a/bootstrap/unix-88/errors.c +++ b/bootstrap/unix-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-88/errors.h b/bootstrap/unix-88/errors.h index cf093ab3..ce275b8c 100644 --- a/bootstrap/unix-88/errors.h +++ b/bootstrap/unix-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index 46f8ac7e..fd7974da 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index 700e6b39..f87adfac 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/vt100.c b/bootstrap/unix-88/vt100.c index 8d4cbdfc..ca56f466 100644 --- a/bootstrap/unix-88/vt100.c +++ b/bootstrap/unix-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-88/vt100.h b/bootstrap/unix-88/vt100.h index da86e98b..f5b8588f 100644 --- a/bootstrap/unix-88/vt100.h +++ b/bootstrap/unix-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index 7f7f4b26..28528f64 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index 618bc77f..d9030dbe 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Console.c b/bootstrap/windows-48/Console.c index 8b55dc14..11937ee4 100644 --- a/bootstrap/windows-48/Console.c +++ b/bootstrap/windows-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Console.h b/bootstrap/windows-48/Console.h index d645f05c..4eb27c8b 100644 --- a/bootstrap/windows-48/Console.h +++ b/bootstrap/windows-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 9a5d7c98..7c1ea1bd 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -83,7 +83,6 @@ export int32 Files_Pos (Files_Rider *r, address *r__typ); export void Files_Purge (Files_File f); export void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x); export void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x); -export void Files_ReadByte (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len); export void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); export void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x); export void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); @@ -673,11 +672,6 @@ void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x (*r).eof = 0; } -void Files_ReadByte (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len) -{ - Files_ReadBytes(&*r, r__typ, (void*)x, x__len * 1, 1); -} - Files_File Files_Base (Files_Rider *r, address *r__typ) { Files_File _o_result; diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index 3e6db0f2..a7de696c 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h @@ -40,7 +40,6 @@ import int32 Files_Pos (Files_Rider *r, address *r__typ); import void Files_Purge (Files_File f); import void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x); import void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x); -import void Files_ReadByte (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len); import void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); import void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x); import void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index 905fcb24..945fbff7 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define INTEGER int16 #define LONGINT int32 @@ -39,7 +39,7 @@ typedef typedef struct Heap_FinDesc { Heap_FinNode next; - address obj; + int32 obj; BOOLEAN marked; Heap_Finalizer finalize; } Heap_FinDesc; @@ -56,19 +56,19 @@ typedef Heap_ModuleName name; int32 refcnt; Heap_Cmd cmds; - address types; + int32 types; Heap_EnumProc enumPtrs; int32 reserved1, reserved2; } Heap_ModuleDesc; export SYSTEM_PTR Heap_modules; -static address Heap_freeList[10]; -static address Heap_bigBlocks; -export address Heap_allocated; +static int32 Heap_freeList[10]; +static int32 Heap_bigBlocks; +export int32 Heap_allocated; static BOOLEAN Heap_firstTry; -static address Heap_heap, Heap_heapend; -export address Heap_heapsize; +static int32 Heap_heap, Heap_heapend; +export int32 Heap_heapsize; static Heap_FinNode Heap_fin; static int16 Heap_lockdepth; static BOOLEAN Heap_interrupted; @@ -80,27 +80,27 @@ export address *Heap_FinDesc__typ; export address *Heap__1__typ; static void Heap_CheckFin (void); -static void Heap_ExtendHeap (address blksz); +static void Heap_ExtendHeap (int32 blksz); export void Heap_FINALL (void); static void Heap_Finalize (void); export void Heap_GC (BOOLEAN markStack); -static void Heap_HeapSort (address n, address *a, LONGINT a__len); +static void Heap_HeapSort (int32 n, int32 *a, LONGINT a__len); export void Heap_INCREF (Heap_Module m); export void Heap_InitHeap (void); export void Heap_Lock (void); -static void Heap_Mark (address q); -static void Heap_MarkCandidates (address n, address *cand, LONGINT cand__len); +static void Heap_Mark (int32 q); +static void Heap_MarkCandidates (int32 n, int32 *cand, LONGINT cand__len); static void Heap_MarkP (SYSTEM_PTR p); -static void Heap_MarkStack (address n, address *cand, LONGINT cand__len); -export SYSTEM_PTR Heap_NEWBLK (address size); -export SYSTEM_PTR Heap_NEWREC (address tag); -static address Heap_NewChunk (address blksz); +static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len); +export SYSTEM_PTR Heap_NEWBLK (int32 size); +export SYSTEM_PTR Heap_NEWREC (int32 tag); +static int32 Heap_NewChunk (int32 blksz); export void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); export SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -export void Heap_REGTYP (Heap_Module m, address typ); +export void Heap_REGTYP (Heap_Module m, int32 typ); export void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); static void Heap_Scan (void); -static void Heap_Sift (address l, address r, address *a, LONGINT a__len); +static void Heap_Sift (int32 l, int32 r, int32 *a, LONGINT a__len); export void Heap_Unlock (void); extern void *Heap__init(); @@ -158,9 +158,9 @@ void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) m->cmds = c; } -void Heap_REGTYP (Heap_Module m, address typ) +void Heap_REGTYP (Heap_Module m, int32 typ) { - __PUT(typ, m->types, address); + __PUT(typ, m->types, int32); m->types = typ; } @@ -169,17 +169,17 @@ void Heap_INCREF (Heap_Module m) m->refcnt += 1; } -static address Heap_NewChunk (address blksz) +static int32 Heap_NewChunk (int32 blksz) { - address _o_result; - address chnk; + int32 _o_result; + int32 chnk; chnk = Heap_OSAllocate(blksz + 12); if (chnk != 0) { - __PUT(chnk + 4, chnk + (12 + blksz), address); - __PUT(chnk + 12, chnk + 16, address); - __PUT(chnk + 16, blksz, address); - __PUT(chnk + 20, -4, address); - __PUT(chnk + 24, Heap_bigBlocks, address); + __PUT(chnk + 4, chnk + (12 + blksz), int32); + __PUT(chnk + 12, chnk + 16, int32); + __PUT(chnk + 16, blksz, int32); + __PUT(chnk + 20, -4, int32); + __PUT(chnk + 24, Heap_bigBlocks, int32); Heap_bigBlocks = chnk + 12; Heap_heapsize += blksz; } @@ -187,9 +187,9 @@ static address Heap_NewChunk (address blksz) return _o_result; } -static void Heap_ExtendHeap (address blksz) +static void Heap_ExtendHeap (int32 blksz) { - address size, chnk, j, next; + int32 size, chnk, j, next; if (blksz > 160000) { size = blksz; } else { @@ -198,31 +198,31 @@ static void Heap_ExtendHeap (address blksz) chnk = Heap_NewChunk(size); if (chnk != 0) { if (chnk < Heap_heap) { - __PUT(chnk, Heap_heap, address); + __PUT(chnk, Heap_heap, int32); Heap_heap = chnk; } else { j = Heap_heap; - __GET(j, next, address); + __GET(j, next, int32); while ((next != 0 && chnk > next)) { j = next; - __GET(j, next, address); + __GET(j, next, int32); } - __PUT(chnk, next, address); - __PUT(j, chnk, address); + __PUT(chnk, next, int32); + __PUT(j, chnk, int32); } if (next == 0) { - __GET(chnk + 4, Heap_heapend, address); + __GET(chnk + 4, Heap_heapend, int32); } } } -SYSTEM_PTR Heap_NEWREC (address tag) +SYSTEM_PTR Heap_NEWREC (int32 tag) { SYSTEM_PTR _o_result; - address i, i0, di, blksz, restsize, t, adr, end, next, prev; + int32 i, i0, di, blksz, restsize, t, adr, end, next, prev; SYSTEM_PTR new; Heap_Lock(); - __GET(tag, blksz, address); + __GET(tag, blksz, int32); i0 = __ASHR(blksz, 4); i = i0; if (i < 9) { @@ -233,17 +233,17 @@ SYSTEM_PTR Heap_NEWREC (address tag) } } if (i < 9) { - __GET(adr + 12, next, address); + __GET(adr + 12, next, int32); Heap_freeList[i] = next; if (i != i0) { di = i - i0; restsize = __ASHL(di, 4); end = adr + restsize; - __PUT(end + 4, blksz, address); - __PUT(end + 8, -4, address); - __PUT(end, end + 4, address); - __PUT(adr + 4, restsize, address); - __PUT(adr + 12, Heap_freeList[di], address); + __PUT(end + 4, blksz, int32); + __PUT(end + 8, -4, int32); + __PUT(end, end + 4, int32); + __PUT(adr + 4, restsize, int32); + __PUT(adr + 12, Heap_freeList[di], int32); Heap_freeList[di] = adr; adr += restsize; } @@ -274,31 +274,31 @@ SYSTEM_PTR Heap_NEWREC (address tag) return _o_result; } } - __GET(adr + 4, t, address); + __GET(adr + 4, t, int32); if (t >= blksz) { break; } prev = adr; - __GET(adr + 12, adr, address); + __GET(adr + 12, adr, int32); } restsize = t - blksz; end = adr + restsize; - __PUT(end + 4, blksz, address); - __PUT(end + 8, -4, address); - __PUT(end, end + 4, address); + __PUT(end + 4, blksz, int32); + __PUT(end + 8, -4, int32); + __PUT(end, end + 4, int32); if (restsize > 144) { - __PUT(adr + 4, restsize, address); + __PUT(adr + 4, restsize, int32); } else { - __GET(adr + 12, next, address); + __GET(adr + 12, next, int32); if (prev == 0) { Heap_bigBlocks = next; } else { - __PUT(prev + 12, next, address); + __PUT(prev + 12, next, int32); } if (restsize > 0) { di = __ASHR(restsize, 4); - __PUT(adr + 4, restsize, address); - __PUT(adr + 12, Heap_freeList[di], address); + __PUT(adr + 4, restsize, int32); + __PUT(adr + 12, Heap_freeList[di], int32); Heap_freeList[di] = adr; } } @@ -307,72 +307,72 @@ SYSTEM_PTR Heap_NEWREC (address tag) i = adr + 16; end = adr + blksz; while (i < end) { - __PUT(i, 0, address); - __PUT(i + 4, 0, address); - __PUT(i + 8, 0, address); - __PUT(i + 12, 0, address); + __PUT(i, 0, int32); + __PUT(i + 4, 0, int32); + __PUT(i + 8, 0, int32); + __PUT(i + 12, 0, int32); i += 16; } - __PUT(adr + 12, 0, address); - __PUT(adr, tag, address); - __PUT(adr + 4, 0, address); - __PUT(adr + 8, 0, address); + __PUT(adr + 12, 0, int32); + __PUT(adr, tag, int32); + __PUT(adr + 4, 0, int32); + __PUT(adr + 8, 0, int32); Heap_allocated += blksz; Heap_Unlock(); _o_result = (SYSTEM_PTR)(address)(adr + 4); return _o_result; } -SYSTEM_PTR Heap_NEWBLK (address size) +SYSTEM_PTR Heap_NEWBLK (int32 size) { SYSTEM_PTR _o_result; - address blksz, tag; + int32 blksz, tag; SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 31, 4), 4); new = Heap_NEWREC((address)&blksz); - tag = ((address)(address)new + blksz) - 12; - __PUT(tag - 4, 0, address); - __PUT(tag, blksz, address); - __PUT(tag + 4, -4, address); - __PUT((address)(address)new - 4, tag, address); + tag = ((int32)(address)new + blksz) - 12; + __PUT(tag - 4, 0, int32); + __PUT(tag, blksz, int32); + __PUT(tag + 4, -4, int32); + __PUT((int32)(address)new - 4, tag, int32); Heap_Unlock(); _o_result = new; return _o_result; } -static void Heap_Mark (address q) +static void Heap_Mark (int32 q) { - address p, tag, offset, fld, n, tagbits; + int32 p, tag, offset, fld, n, tagbits; if (q != 0) { - __GET(q - 4, tagbits, address); + __GET(q - 4, tagbits, int32); if (!__ODD(tagbits)) { - __PUT(q - 4, tagbits + 1, address); + __PUT(q - 4, tagbits + 1, int32); p = 0; tag = tagbits + 4; for (;;) { - __GET(tag, offset, address); + __GET(tag, offset, int32); if (offset < 0) { - __PUT(q - 4, (tag + offset) + 1, address); + __PUT(q - 4, (tag + offset) + 1, int32); if (p == 0) { break; } n = q; q = p; - __GET(q - 4, tag, address); + __GET(q - 4, tag, int32); tag -= 1; - __GET(tag, offset, address); + __GET(tag, offset, int32); fld = q + offset; - __GET(fld, p, address); + __GET(fld, p, int32); __PUT(fld, (SYSTEM_PTR)(address)n, SYSTEM_PTR); } else { fld = q + offset; - __GET(fld, n, address); + __GET(fld, n, int32); if (n != 0) { - __GET(n - 4, tagbits, address); + __GET(n - 4, tagbits, int32); if (!__ODD(tagbits)) { - __PUT(n - 4, tagbits + 1, address); - __PUT(q - 4, tag + 1, address); + __PUT(n - 4, tagbits + 1, int32); + __PUT(q - 4, tag + 1, int32); __PUT(fld, (SYSTEM_PTR)(address)p, SYSTEM_PTR); p = q; q = n; @@ -388,12 +388,12 @@ static void Heap_Mark (address q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((address)(address)p); + Heap_Mark((int32)(address)p); } static void Heap_Scan (void) { - address chnk, adr, end, start, tag, i, size, freesize; + int32 chnk, adr, end, start, tag, i, size, freesize; Heap_bigBlocks = 0; i = 1; while (i < 9) { @@ -405,58 +405,58 @@ static void Heap_Scan (void) chnk = Heap_heap; while (chnk != 0) { adr = chnk + 12; - __GET(chnk + 4, end, address); + __GET(chnk + 4, end, int32); while (adr < end) { - __GET(adr, tag, address); + __GET(adr, tag, int32); if (__ODD(tag)) { if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 4, address); - __PUT(start + 4, freesize, address); - __PUT(start + 8, -4, address); + __PUT(start, start + 4, int32); + __PUT(start + 4, freesize, int32); + __PUT(start + 8, -4, int32); i = __ASHR(freesize, 4); freesize = 0; if (i < 9) { - __PUT(start + 12, Heap_freeList[i], address); + __PUT(start + 12, Heap_freeList[i], int32); Heap_freeList[i] = start; } else { - __PUT(start + 12, Heap_bigBlocks, address); + __PUT(start + 12, Heap_bigBlocks, int32); Heap_bigBlocks = start; } } tag -= 1; - __PUT(adr, tag, address); - __GET(tag, size, address); + __PUT(adr, tag, int32); + __GET(tag, size, int32); Heap_allocated += size; adr += size; } else { - __GET(tag, size, address); + __GET(tag, size, int32); freesize += size; adr += size; } } if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 4, address); - __PUT(start + 4, freesize, address); - __PUT(start + 8, -4, address); + __PUT(start, start + 4, int32); + __PUT(start + 4, freesize, int32); + __PUT(start + 8, -4, int32); i = __ASHR(freesize, 4); freesize = 0; if (i < 9) { - __PUT(start + 12, Heap_freeList[i], address); + __PUT(start + 12, Heap_freeList[i], int32); Heap_freeList[i] = start; } else { - __PUT(start + 12, Heap_bigBlocks, address); + __PUT(start + 12, Heap_bigBlocks, int32); Heap_bigBlocks = start; } } - __GET(chnk, chnk, address); + __GET(chnk, chnk, int32); } } -static void Heap_Sift (address l, address r, address *a, LONGINT a__len) +static void Heap_Sift (int32 l, int32 r, int32 *a, LONGINT a__len) { - address i, j, x; + int32 i, j, x; j = l; x = a[j]; for (;;) { @@ -473,9 +473,9 @@ static void Heap_Sift (address l, address r, address *a, LONGINT a__len) a[i] = x; } -static void Heap_HeapSort (address n, address *a, LONGINT a__len) +static void Heap_HeapSort (int32 n, int32 *a, LONGINT a__len) { - address l, r, x; + int32 l, r, x; l = __ASHR(n, 1); r = n - 1; while (l > 0) { @@ -491,25 +491,25 @@ static void Heap_HeapSort (address n, address *a, LONGINT a__len) } } -static void Heap_MarkCandidates (address n, address *cand, LONGINT cand__len) +static void Heap_MarkCandidates (int32 n, int32 *cand, LONGINT cand__len) { - address chnk, adr, tag, next, lim, lim1, i, ptr, size; + int32 chnk, adr, tag, next, lim, lim1, i, ptr, size; chnk = Heap_heap; i = 0; lim = cand[n - 1]; while ((chnk != 0 && chnk < lim)) { adr = chnk + 12; - __GET(chnk + 4, lim1, address); + __GET(chnk + 4, lim1, int32); if (lim < lim1) { lim1 = lim; } while (adr < lim1) { - __GET(adr, tag, address); + __GET(adr, tag, int32); if (__ODD(tag)) { - __GET(tag - 1, size, address); + __GET(tag - 1, size, int32); adr += size; } else { - __GET(tag, size, address); + __GET(tag, size, int32); ptr = adr + 4; while (cand[i] < ptr) { i += 1; @@ -524,17 +524,17 @@ static void Heap_MarkCandidates (address n, address *cand, LONGINT cand__len) adr = next; } } - __GET(chnk, chnk, address); + __GET(chnk, chnk, int32); } } static void Heap_CheckFin (void) { Heap_FinNode n; - address tag; + int32 tag; n = Heap_fin; while (n != NIL) { - __GET(n->obj - 4, tag, address); + __GET(n->obj - 4, tag, int32); if (!__ODD(tag)) { n->marked = 0; Heap_Mark(n->obj); @@ -580,10 +580,10 @@ void Heap_FINALL (void) } } -static void Heap_MarkStack (address n, address *cand, LONGINT cand__len) +static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len) { SYSTEM_PTR frame; - address inc, nofcand, sp, p, stack0; + int32 inc, nofcand, sp, p, stack0; struct Heap__1 align; if (n > 0) { Heap_MarkStack(n - 1, cand, cand__len); @@ -600,7 +600,7 @@ static void Heap_MarkStack (address n, address *cand, LONGINT cand__len) inc = -inc; } while (sp != stack0) { - __GET(sp, p, address); + __GET(sp, p, int32); if ((p > Heap_heap && p < Heap_heapend)) { if (nofcand == cand__len) { Heap_HeapSort(nofcand, (void*)cand, cand__len); @@ -622,8 +622,8 @@ static void Heap_MarkStack (address n, address *cand, LONGINT cand__len) void Heap_GC (BOOLEAN markStack) { Heap_Module m; - address i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; - address cand[10000]; + int32 i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; + int32 cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); m = (Heap_Module)(address)Heap_modules; @@ -703,7 +703,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (address)(address)obj; + f->obj = (int32)(address)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; @@ -713,8 +713,8 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) void Heap_InitHeap (void) { Heap_heap = Heap_NewChunk(128000); - __GET(Heap_heap + 4, Heap_heapend, address); - __PUT(Heap_heap, 0, address); + __GET(Heap_heap + 4, Heap_heapend, int32); + __PUT(Heap_heap, 0, int32); Heap_allocated = 0; Heap_firstTry = 1; Heap_freeList[9] = 1; diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index 3ea975a7..eccb5d85 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h @@ -31,7 +31,7 @@ typedef import SYSTEM_PTR Heap_modules; -import address Heap_allocated, Heap_heapsize; +import int32 Heap_allocated, Heap_heapsize; import int16 Heap_FileCount; import address *Heap_ModuleDesc__typ; @@ -41,11 +41,11 @@ import void Heap_GC (BOOLEAN markStack); import void Heap_INCREF (Heap_Module m); import void Heap_InitHeap (void); import void Heap_Lock (void); -import SYSTEM_PTR Heap_NEWBLK (address size); -import SYSTEM_PTR Heap_NEWREC (address tag); +import SYSTEM_PTR Heap_NEWBLK (int32 size); +import SYSTEM_PTR Heap_NEWREC (int32 tag); import void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); import SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -import void Heap_REGTYP (Heap_Module m, address typ); +import void Heap_REGTYP (Heap_Module m, int32 typ); import void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); import void Heap_Unlock (void); import void *Heap__init(void); diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index 21d62e05..a87d0732 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index d2d0a476..93e2105b 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index 6c15aa17..d211135a 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -2449,12 +2449,8 @@ void OPB_Param (OPT_Node ap, OPT_Object fp) OPB_err(111); } } else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 11)) { - } else if (ap->typ != fp->typ) { - if ((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x1e, 32) && ap->typ->size == 1)))) { - } else if ((ap->typ == OPT_adrtyp && fp->typ == OPT_IntType(ap->typ->size))) { - } else { - OPB_err(123); - } + } else if ((ap->typ != fp->typ && !((((fp->typ->form == 1 && __IN(ap->typ->form, 0x1e, 32))) && ap->typ->size == 1)))) { + OPB_err(123); } else if ((fp->typ->form == 11 && ap->class == 5)) { OPB_err(123); } diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index 8395741b..97860bfc 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 9104c5c4..e4c0eb06 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index 6236cd73..3325aded 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index abb5a584..7234f518 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index b62666db..e249edd5 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index 66b821d2..1e5c6674 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index ea6663ba..3b9acd86 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index 2b449cae..ee182741 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index 8d90d974..1514d9eb 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 1b69128c..0a1f8f54 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index 1a525fcb..d4f953ba 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index cdb2ab50..a70a40bf 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index 09931dda..0a9135f5 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 21a73e4d..51a62ed7 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -13,7 +13,7 @@ typedef Platform_ArgPtr (*Platform_ArgVec)[1024]; typedef - address (*Platform_ArgVecPtr)[1]; + int32 (*Platform_ArgVecPtr)[1]; typedef CHAR (*Platform_EnvPtr)[1024]; @@ -31,12 +31,12 @@ typedef export BOOLEAN Platform_LittleEndian; -export address Platform_MainStackFrame; +export int32 Platform_MainStackFrame; export int32 Platform_HaltCode; export int16 Platform_PID; export CHAR Platform_CWD[4096]; export int16 Platform_ArgCount; -export address Platform_ArgVector; +export int32 Platform_ArgVector; static Platform_HaltProcedure Platform_HaltHandler; static int32 Platform_TimeStart; export int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; @@ -66,15 +66,15 @@ export void Platform_Halt (int32 code); export int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ); export int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); export BOOLEAN Platform_Inaccessible (int16 e); -export void Platform_Init (int16 argc, address argvadr); +export void Platform_Init (int16 argc, int32 argvadr); export void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); export int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); export BOOLEAN Platform_NoSuchDirectory (int16 e); -export address Platform_OSAllocate (address size); -export void Platform_OSFree (address address); +export int32 Platform_OSAllocate (int32 size); +export void Platform_OSFree (int32 address); export int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); export int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); -export int16 Platform_Read (int32 h, address p, int32 l, int32 *n); +export int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n); export int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n); export int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); export BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); @@ -92,7 +92,7 @@ export BOOLEAN Platform_TimedOut (int16 e); export BOOLEAN Platform_TooManyFiles (int16 e); export int16 Platform_Truncate (int32 h, int32 limit); export int16 Platform_Unlink (CHAR *n, LONGINT n__len); -export int16 Platform_Write (int32 h, address p, int32 l); +export int16 Platform_Write (int32 h, int32 p, int32 l); static void Platform_YMDHMStoClock (int16 ye, int16 mo, int16 da, int16 ho, int16 mi, int16 se, int32 *t, int32 *d); static void Platform_errch (CHAR c); static void Platform_errint (int32 l); @@ -230,19 +230,19 @@ BOOLEAN Platform_ConnectionFailed (int16 e) return _o_result; } -address Platform_OSAllocate (address size) +int32 Platform_OSAllocate (int32 size) { - address _o_result; + int32 _o_result; _o_result = Platform_allocate(size); return _o_result; } -void Platform_OSFree (address address) +void Platform_OSFree (int32 address) { Platform_free(address); } -void Platform_Init (int16 argc, address argvadr) +void Platform_Init (int16 argc, int32 argvadr) { Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; @@ -543,7 +543,7 @@ int16 Platform_Size (int32 h, int32 *l) return _o_result; } -int16 Platform_Read (int32 h, address p, int32 l, int32 *n) +int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n) { int16 _o_result; int16 result; @@ -579,7 +579,7 @@ int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n) __RETCHK; } -int16 Platform_Write (int32 h, address p, int32 l) +int16 Platform_Write (int32 h, int32 p, int32 l) { int16 _o_result; if (Platform_writefile(h, p, l) == 0) { diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index d697acd7..fff5ea74 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h @@ -19,12 +19,12 @@ typedef import BOOLEAN Platform_LittleEndian; -import address Platform_MainStackFrame; +import int32 Platform_MainStackFrame; import int32 Platform_HaltCode; import int16 Platform_PID; import CHAR Platform_CWD[4096]; import int16 Platform_ArgCount; -import address Platform_ArgVector; +import int32 Platform_ArgVector; import int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; import int32 Platform_StdIn, Platform_StdOut, Platform_StdErr; import CHAR Platform_nl[3]; @@ -50,15 +50,15 @@ import void Platform_Halt (int32 code); import int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ); import int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); import BOOLEAN Platform_Inaccessible (int16 e); -import void Platform_Init (int16 argc, address argvadr); +import void Platform_Init (int16 argc, int32 argvadr); import void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); import int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); import BOOLEAN Platform_NoSuchDirectory (int16 e); -import address Platform_OSAllocate (address size); -import void Platform_OSFree (address address); +import int32 Platform_OSAllocate (int32 size); +import void Platform_OSFree (int32 address); import int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); import int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); -import int16 Platform_Read (int32 h, address p, int32 l, int32 *n); +import int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n); import int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n); import int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); import BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); @@ -75,7 +75,7 @@ import BOOLEAN Platform_TimedOut (int16 e); import BOOLEAN Platform_TooManyFiles (int16 e); import int16 Platform_Truncate (int32 h, int32 limit); import int16 Platform_Unlink (CHAR *n, LONGINT n__len); -import int16 Platform_Write (int32 h, address p, int32 l); +import int16 Platform_Write (int32 h, int32 p, int32 l); import BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); import void *Platform__init(void); diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 4b72fbe3..e75d35ff 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index 4a4c73b0..8a42b39b 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index f765b98f..9f9562db 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index be1e7d7f..da213d81 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index 779daa7a..ab510cdb 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index 07f53445..64e78861 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/Vishap.c b/bootstrap/windows-48/Vishap.c deleted file mode 100644 index 30b81ac7..00000000 --- a/bootstrap/windows-48/Vishap.c +++ /dev/null @@ -1,171 +0,0 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ - -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 - -#include "SYSTEM.h" -#include "Configuration.h" -#include "Heap.h" -#include "OPB.h" -#include "OPC.h" -#include "OPM.h" -#include "OPP.h" -#include "OPT.h" -#include "OPV.h" -#include "Platform.h" -#include "Strings.h" -#include "extTools.h" -#include "vt100.h" - - -static CHAR Vishap_mname[256]; - - -export void Vishap_Module (BOOLEAN *done); -static void Vishap_PropagateElementaryTypeSizes (void); -export void Vishap_Translate (void); -static void Vishap_Trap (int16 sig); - - -void Vishap_Module (BOOLEAN *done) -{ - BOOLEAN ext, new; - OPT_Node p = NIL; - OPP_Module(&p, OPM_opt); - if (OPM_noerr) { - OPV_Init(); - OPT_InitRecno(); - OPV_AdrAndSize(OPT_topScope); - OPT_Export(&ext, &new); - if (OPM_noerr) { - OPM_OpenFiles((void*)OPT_SelfName, 256); - OPC_Init(); - OPV_Module(p); - if (OPM_noerr) { - if ((__IN(10, OPM_opt, 32) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { - OPM_DeleteNewSym(); - if (!__IN(16, OPM_opt, 32)) { - vt100_SetAttr((CHAR*)"32m", 4); - } - OPM_LogWStr((CHAR*)" Main program.", 16); - if (!__IN(16, OPM_opt, 32)) { - vt100_SetAttr((CHAR*)"0m", 3); - } - } else { - if (new) { - if (!__IN(16, OPM_opt, 32)) { - vt100_SetAttr((CHAR*)"32m", 4); - } - OPM_LogWStr((CHAR*)" New symbol file.", 19); - if (!__IN(16, OPM_opt, 32)) { - vt100_SetAttr((CHAR*)"0m", 3); - } - OPM_RegisterNewSym(); - } else if (ext) { - OPM_LogWStr((CHAR*)" Extended symbol file.", 24); - OPM_RegisterNewSym(); - } - } - } else { - OPM_DeleteNewSym(); - } - } - } - OPM_CloseFiles(); - OPT_Close(); - OPM_LogWLn(); - *done = OPM_noerr; -} - -static void Vishap_PropagateElementaryTypeSizes (void) -{ - OPT_sysptrtyp->size = OPM_AddressSize; - OPT_adrtyp->size = OPM_AddressSize; - OPT_settyp->size = OPM_SetSize; - OPT_sinttyp = OPT_IntType(OPM_ShortintSize); - OPT_inttyp = OPT_IntType(OPM_IntegerSize); - OPT_linttyp = OPT_IntType(OPM_LongintSize); - OPT_sintobj->typ = OPT_sinttyp; - OPT_intobj->typ = OPT_inttyp; - OPT_lintobj->typ = OPT_linttyp; -} - -void Vishap_Translate (void) -{ - BOOLEAN done; - CHAR modulesobj[2048]; - modulesobj[0] = 0x00; - if (OPM_OpenPar()) { - for (;;) { - OPM_Init(&done, (void*)Vishap_mname, 256); - if (!done) { - return; - } - OPM_InitOptions(); - Vishap_PropagateElementaryTypeSizes(); - Heap_GC(0); - Vishap_Module(&done); - if (!done) { - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Module compilation failed.", 27); - OPM_LogWLn(); - Platform_Exit(1); - } - if (!__IN(13, OPM_opt, 32)) { - if (__IN(14, OPM_opt, 32)) { - extTools_Assemble(OPM_modName, 32); - } else { - if (!__IN(10, OPM_opt, 32)) { - extTools_Assemble(OPM_modName, 32); - Strings_Append((CHAR*)" ", 2, (void*)modulesobj, 2048); - Strings_Append(OPM_modName, 32, (void*)modulesobj, 2048); - Strings_Append((CHAR*)".o", 3, (void*)modulesobj, 2048); - } else { - extTools_LinkMain((void*)OPM_modName, 32, __IN(15, OPM_opt, 32), modulesobj, 2048); - } - } - } - } - } -} - -static void Vishap_Trap (int16 sig) -{ - Heap_FINALL(); - if (sig == 3) { - Platform_Exit(0); - } else { - if ((sig == 4 && Platform_HaltCode == -15)) { - OPM_LogWStr((CHAR*)" --- Vishap Oberon: internal error", 35); - OPM_LogWLn(); - } - Platform_Exit(2); - } -} - - -export int main(int argc, char **argv) -{ - __INIT(argc, argv); - __MODULE_IMPORT(Configuration); - __MODULE_IMPORT(Heap); - __MODULE_IMPORT(OPB); - __MODULE_IMPORT(OPC); - __MODULE_IMPORT(OPM); - __MODULE_IMPORT(OPP); - __MODULE_IMPORT(OPT); - __MODULE_IMPORT(OPV); - __MODULE_IMPORT(Platform); - __MODULE_IMPORT(Strings); - __MODULE_IMPORT(extTools); - __MODULE_IMPORT(vt100); - __REGMAIN("Vishap", 0); - __REGCMD("Translate", Vishap_Translate); -/* BEGIN */ - Platform_SetInterruptHandler(Vishap_Trap); - Platform_SetQuitHandler(Vishap_Trap); - Platform_SetBadInstructionHandler(Vishap_Trap); - Vishap_Translate(); - __FINI; -} diff --git a/bootstrap/windows-48/errors.c b/bootstrap/windows-48/errors.c index d465624d..34e6fae3 100644 --- a/bootstrap/windows-48/errors.c +++ b/bootstrap/windows-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/errors.h b/bootstrap/windows-48/errors.h index cf093ab3..ce275b8c 100644 --- a/bootstrap/windows-48/errors.h +++ b/bootstrap/windows-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index 46f8ac7e..fd7974da 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index 700e6b39..f87adfac 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/vt100.c b/bootstrap/windows-48/vt100.c index 8d4cbdfc..ca56f466 100644 --- a/bootstrap/windows-48/vt100.c +++ b/bootstrap/windows-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/vt100.h b/bootstrap/windows-48/vt100.h index da86e98b..f5b8588f 100644 --- a/bootstrap/windows-48/vt100.h +++ b/bootstrap/windows-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index 7f7f4b26..28528f64 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index 618bc77f..d9030dbe 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Console.c b/bootstrap/windows-88/Console.c index 8b55dc14..11937ee4 100644 --- a/bootstrap/windows-88/Console.c +++ b/bootstrap/windows-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-88/Console.h b/bootstrap/windows-88/Console.h index d645f05c..4eb27c8b 100644 --- a/bootstrap/windows-88/Console.h +++ b/bootstrap/windows-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 1071d452..7d407820 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -83,7 +83,6 @@ export int32 Files_Pos (Files_Rider *r, address *r__typ); export void Files_Purge (Files_File f); export void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x); export void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x); -export void Files_ReadByte (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len); export void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); export void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x); export void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); @@ -673,11 +672,6 @@ void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x (*r).eof = 0; } -void Files_ReadByte (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len) -{ - Files_ReadBytes(&*r, r__typ, (void*)x, x__len * 1, 1); -} - Files_File Files_Base (Files_Rider *r, address *r__typ) { Files_File _o_result; diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 1a73a6ec..1391c541 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h @@ -42,7 +42,6 @@ import int32 Files_Pos (Files_Rider *r, address *r__typ); import void Files_Purge (Files_File f); import void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x); import void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x); -import void Files_ReadByte (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len); import void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); import void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x); import void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index 785efa1a..ca208a31 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define INTEGER int16 #define LONGINT int32 @@ -39,7 +39,7 @@ typedef typedef struct Heap_FinDesc { Heap_FinNode next; - address obj; + int64 obj; BOOLEAN marked; Heap_Finalizer finalize; } Heap_FinDesc; @@ -56,19 +56,19 @@ typedef Heap_ModuleName name; int32 refcnt; Heap_Cmd cmds; - address types; + int64 types; Heap_EnumProc enumPtrs; int32 reserved1, reserved2; } Heap_ModuleDesc; export SYSTEM_PTR Heap_modules; -static address Heap_freeList[10]; -static address Heap_bigBlocks; -export address Heap_allocated; +static int64 Heap_freeList[10]; +static int64 Heap_bigBlocks; +export int64 Heap_allocated; static BOOLEAN Heap_firstTry; -static address Heap_heap, Heap_heapend; -export address Heap_heapsize; +static int64 Heap_heap, Heap_heapend; +export int64 Heap_heapsize; static Heap_FinNode Heap_fin; static int16 Heap_lockdepth; static BOOLEAN Heap_interrupted; @@ -80,27 +80,27 @@ export address *Heap_FinDesc__typ; export address *Heap__1__typ; static void Heap_CheckFin (void); -static void Heap_ExtendHeap (address blksz); +static void Heap_ExtendHeap (int64 blksz); export void Heap_FINALL (void); static void Heap_Finalize (void); export void Heap_GC (BOOLEAN markStack); -static void Heap_HeapSort (address n, address *a, LONGINT a__len); +static void Heap_HeapSort (int64 n, int64 *a, LONGINT a__len); export void Heap_INCREF (Heap_Module m); export void Heap_InitHeap (void); export void Heap_Lock (void); -static void Heap_Mark (address q); -static void Heap_MarkCandidates (address n, address *cand, LONGINT cand__len); +static void Heap_Mark (int64 q); +static void Heap_MarkCandidates (int64 n, int64 *cand, LONGINT cand__len); static void Heap_MarkP (SYSTEM_PTR p); -static void Heap_MarkStack (address n, address *cand, LONGINT cand__len); -export SYSTEM_PTR Heap_NEWBLK (address size); -export SYSTEM_PTR Heap_NEWREC (address tag); -static address Heap_NewChunk (address blksz); +static void Heap_MarkStack (int64 n, int64 *cand, LONGINT cand__len); +export SYSTEM_PTR Heap_NEWBLK (int64 size); +export SYSTEM_PTR Heap_NEWREC (int64 tag); +static int64 Heap_NewChunk (int64 blksz); export void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); export SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -export void Heap_REGTYP (Heap_Module m, address typ); +export void Heap_REGTYP (Heap_Module m, int64 typ); export void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); static void Heap_Scan (void); -static void Heap_Sift (address l, address r, address *a, LONGINT a__len); +static void Heap_Sift (int64 l, int64 r, int64 *a, LONGINT a__len); export void Heap_Unlock (void); extern void *Heap__init(); @@ -158,9 +158,9 @@ void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) m->cmds = c; } -void Heap_REGTYP (Heap_Module m, address typ) +void Heap_REGTYP (Heap_Module m, int64 typ) { - __PUT(typ, m->types, address); + __PUT(typ, m->types, int64); m->types = typ; } @@ -169,17 +169,17 @@ void Heap_INCREF (Heap_Module m) m->refcnt += 1; } -static address Heap_NewChunk (address blksz) +static int64 Heap_NewChunk (int64 blksz) { - address _o_result; - address chnk; + int64 _o_result; + int64 chnk; chnk = Heap_OSAllocate(blksz + 24); if (chnk != 0) { - __PUT(chnk + 8, chnk + (24 + blksz), address); - __PUT(chnk + 24, chnk + 32, address); - __PUT(chnk + 32, blksz, address); - __PUT(chnk + 40, -8, address); - __PUT(chnk + 48, Heap_bigBlocks, address); + __PUT(chnk + 8, chnk + (24 + blksz), int64); + __PUT(chnk + 24, chnk + 32, int64); + __PUT(chnk + 32, blksz, int64); + __PUT(chnk + 40, -8, int64); + __PUT(chnk + 48, Heap_bigBlocks, int64); Heap_bigBlocks = chnk + 24; Heap_heapsize += blksz; } @@ -187,9 +187,9 @@ static address Heap_NewChunk (address blksz) return _o_result; } -static void Heap_ExtendHeap (address blksz) +static void Heap_ExtendHeap (int64 blksz) { - address size, chnk, j, next; + int64 size, chnk, j, next; if (blksz > 320000) { size = blksz; } else { @@ -198,31 +198,31 @@ static void Heap_ExtendHeap (address blksz) chnk = Heap_NewChunk(size); if (chnk != 0) { if (chnk < Heap_heap) { - __PUT(chnk, Heap_heap, address); + __PUT(chnk, Heap_heap, int64); Heap_heap = chnk; } else { j = Heap_heap; - __GET(j, next, address); + __GET(j, next, int64); while ((next != 0 && chnk > next)) { j = next; - __GET(j, next, address); + __GET(j, next, int64); } - __PUT(chnk, next, address); - __PUT(j, chnk, address); + __PUT(chnk, next, int64); + __PUT(j, chnk, int64); } if (next == 0) { - __GET(chnk + 8, Heap_heapend, address); + __GET(chnk + 8, Heap_heapend, int64); } } } -SYSTEM_PTR Heap_NEWREC (address tag) +SYSTEM_PTR Heap_NEWREC (int64 tag) { SYSTEM_PTR _o_result; - address i, i0, di, blksz, restsize, t, adr, end, next, prev; + int64 i, i0, di, blksz, restsize, t, adr, end, next, prev; SYSTEM_PTR new; Heap_Lock(); - __GET(tag, blksz, address); + __GET(tag, blksz, int64); i0 = __ASHR(blksz, 5); i = i0; if (i < 9) { @@ -233,17 +233,17 @@ SYSTEM_PTR Heap_NEWREC (address tag) } } if (i < 9) { - __GET(adr + 24, next, address); + __GET(adr + 24, next, int64); Heap_freeList[i] = next; if (i != i0) { di = i - i0; restsize = __ASHL(di, 5); end = adr + restsize; - __PUT(end + 8, blksz, address); - __PUT(end + 16, -8, address); - __PUT(end, end + 8, address); - __PUT(adr + 8, restsize, address); - __PUT(adr + 24, Heap_freeList[di], address); + __PUT(end + 8, blksz, int64); + __PUT(end + 16, -8, int64); + __PUT(end, end + 8, int64); + __PUT(adr + 8, restsize, int64); + __PUT(adr + 24, Heap_freeList[di], int64); Heap_freeList[di] = adr; adr += restsize; } @@ -274,31 +274,31 @@ SYSTEM_PTR Heap_NEWREC (address tag) return _o_result; } } - __GET(adr + 8, t, address); + __GET(adr + 8, t, int64); if (t >= blksz) { break; } prev = adr; - __GET(adr + 24, adr, address); + __GET(adr + 24, adr, int64); } restsize = t - blksz; end = adr + restsize; - __PUT(end + 8, blksz, address); - __PUT(end + 16, -8, address); - __PUT(end, end + 8, address); + __PUT(end + 8, blksz, int64); + __PUT(end + 16, -8, int64); + __PUT(end, end + 8, int64); if (restsize > 288) { - __PUT(adr + 8, restsize, address); + __PUT(adr + 8, restsize, int64); } else { - __GET(adr + 24, next, address); + __GET(adr + 24, next, int64); if (prev == 0) { Heap_bigBlocks = next; } else { - __PUT(prev + 24, next, address); + __PUT(prev + 24, next, int64); } if (restsize > 0) { di = __ASHR(restsize, 5); - __PUT(adr + 8, restsize, address); - __PUT(adr + 24, Heap_freeList[di], address); + __PUT(adr + 8, restsize, int64); + __PUT(adr + 24, Heap_freeList[di], int64); Heap_freeList[di] = adr; } } @@ -307,72 +307,72 @@ SYSTEM_PTR Heap_NEWREC (address tag) i = adr + 32; end = adr + blksz; while (i < end) { - __PUT(i, 0, address); - __PUT(i + 8, 0, address); - __PUT(i + 16, 0, address); - __PUT(i + 24, 0, address); + __PUT(i, 0, int64); + __PUT(i + 8, 0, int64); + __PUT(i + 16, 0, int64); + __PUT(i + 24, 0, int64); i += 32; } - __PUT(adr + 24, 0, address); - __PUT(adr, tag, address); - __PUT(adr + 8, 0, address); - __PUT(adr + 16, 0, address); + __PUT(adr + 24, 0, int64); + __PUT(adr, tag, int64); + __PUT(adr + 8, 0, int64); + __PUT(adr + 16, 0, int64); Heap_allocated += blksz; Heap_Unlock(); _o_result = (SYSTEM_PTR)(address)(adr + 8); return _o_result; } -SYSTEM_PTR Heap_NEWBLK (address size) +SYSTEM_PTR Heap_NEWBLK (int64 size) { SYSTEM_PTR _o_result; - address blksz, tag; + int64 blksz, tag; SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 63, 5), 5); new = Heap_NEWREC((address)&blksz); - tag = ((address)(address)new + blksz) - 24; - __PUT(tag - 8, 0, address); - __PUT(tag, blksz, address); - __PUT(tag + 8, -8, address); - __PUT((address)(address)new - 8, tag, address); + tag = ((int64)(address)new + blksz) - 24; + __PUT(tag - 8, 0, int64); + __PUT(tag, blksz, int64); + __PUT(tag + 8, -8, int64); + __PUT((int64)(address)new - 8, tag, int64); Heap_Unlock(); _o_result = new; return _o_result; } -static void Heap_Mark (address q) +static void Heap_Mark (int64 q) { - address p, tag, offset, fld, n, tagbits; + int64 p, tag, offset, fld, n, tagbits; if (q != 0) { - __GET(q - 8, tagbits, address); + __GET(q - 8, tagbits, int64); if (!__ODD(tagbits)) { - __PUT(q - 8, tagbits + 1, address); + __PUT(q - 8, tagbits + 1, int64); p = 0; tag = tagbits + 8; for (;;) { - __GET(tag, offset, address); + __GET(tag, offset, int64); if (offset < 0) { - __PUT(q - 8, (tag + offset) + 1, address); + __PUT(q - 8, (tag + offset) + 1, int64); if (p == 0) { break; } n = q; q = p; - __GET(q - 8, tag, address); + __GET(q - 8, tag, int64); tag -= 1; - __GET(tag, offset, address); + __GET(tag, offset, int64); fld = q + offset; - __GET(fld, p, address); + __GET(fld, p, int64); __PUT(fld, (SYSTEM_PTR)(address)n, SYSTEM_PTR); } else { fld = q + offset; - __GET(fld, n, address); + __GET(fld, n, int64); if (n != 0) { - __GET(n - 8, tagbits, address); + __GET(n - 8, tagbits, int64); if (!__ODD(tagbits)) { - __PUT(n - 8, tagbits + 1, address); - __PUT(q - 8, tag + 1, address); + __PUT(n - 8, tagbits + 1, int64); + __PUT(q - 8, tag + 1, int64); __PUT(fld, (SYSTEM_PTR)(address)p, SYSTEM_PTR); p = q; q = n; @@ -388,12 +388,12 @@ static void Heap_Mark (address q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((address)(address)p); + Heap_Mark((int64)(address)p); } static void Heap_Scan (void) { - address chnk, adr, end, start, tag, i, size, freesize; + int64 chnk, adr, end, start, tag, i, size, freesize; Heap_bigBlocks = 0; i = 1; while (i < 9) { @@ -405,58 +405,58 @@ static void Heap_Scan (void) chnk = Heap_heap; while (chnk != 0) { adr = chnk + 24; - __GET(chnk + 8, end, address); + __GET(chnk + 8, end, int64); while (adr < end) { - __GET(adr, tag, address); + __GET(adr, tag, int64); if (__ODD(tag)) { if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 8, address); - __PUT(start + 8, freesize, address); - __PUT(start + 16, -8, address); + __PUT(start, start + 8, int64); + __PUT(start + 8, freesize, int64); + __PUT(start + 16, -8, int64); i = __ASHR(freesize, 5); freesize = 0; if (i < 9) { - __PUT(start + 24, Heap_freeList[i], address); + __PUT(start + 24, Heap_freeList[i], int64); Heap_freeList[i] = start; } else { - __PUT(start + 24, Heap_bigBlocks, address); + __PUT(start + 24, Heap_bigBlocks, int64); Heap_bigBlocks = start; } } tag -= 1; - __PUT(adr, tag, address); - __GET(tag, size, address); + __PUT(adr, tag, int64); + __GET(tag, size, int64); Heap_allocated += size; adr += size; } else { - __GET(tag, size, address); + __GET(tag, size, int64); freesize += size; adr += size; } } if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 8, address); - __PUT(start + 8, freesize, address); - __PUT(start + 16, -8, address); + __PUT(start, start + 8, int64); + __PUT(start + 8, freesize, int64); + __PUT(start + 16, -8, int64); i = __ASHR(freesize, 5); freesize = 0; if (i < 9) { - __PUT(start + 24, Heap_freeList[i], address); + __PUT(start + 24, Heap_freeList[i], int64); Heap_freeList[i] = start; } else { - __PUT(start + 24, Heap_bigBlocks, address); + __PUT(start + 24, Heap_bigBlocks, int64); Heap_bigBlocks = start; } } - __GET(chnk, chnk, address); + __GET(chnk, chnk, int64); } } -static void Heap_Sift (address l, address r, address *a, LONGINT a__len) +static void Heap_Sift (int64 l, int64 r, int64 *a, LONGINT a__len) { - address i, j, x; + int64 i, j, x; j = l; x = a[j]; for (;;) { @@ -473,9 +473,9 @@ static void Heap_Sift (address l, address r, address *a, LONGINT a__len) a[i] = x; } -static void Heap_HeapSort (address n, address *a, LONGINT a__len) +static void Heap_HeapSort (int64 n, int64 *a, LONGINT a__len) { - address l, r, x; + int64 l, r, x; l = __ASHR(n, 1); r = n - 1; while (l > 0) { @@ -491,25 +491,25 @@ static void Heap_HeapSort (address n, address *a, LONGINT a__len) } } -static void Heap_MarkCandidates (address n, address *cand, LONGINT cand__len) +static void Heap_MarkCandidates (int64 n, int64 *cand, LONGINT cand__len) { - address chnk, adr, tag, next, lim, lim1, i, ptr, size; + int64 chnk, adr, tag, next, lim, lim1, i, ptr, size; chnk = Heap_heap; i = 0; lim = cand[n - 1]; while ((chnk != 0 && chnk < lim)) { adr = chnk + 24; - __GET(chnk + 8, lim1, address); + __GET(chnk + 8, lim1, int64); if (lim < lim1) { lim1 = lim; } while (adr < lim1) { - __GET(adr, tag, address); + __GET(adr, tag, int64); if (__ODD(tag)) { - __GET(tag - 1, size, address); + __GET(tag - 1, size, int64); adr += size; } else { - __GET(tag, size, address); + __GET(tag, size, int64); ptr = adr + 8; while (cand[i] < ptr) { i += 1; @@ -524,17 +524,17 @@ static void Heap_MarkCandidates (address n, address *cand, LONGINT cand__len) adr = next; } } - __GET(chnk, chnk, address); + __GET(chnk, chnk, int64); } } static void Heap_CheckFin (void) { Heap_FinNode n; - address tag; + int64 tag; n = Heap_fin; while (n != NIL) { - __GET(n->obj - 8, tag, address); + __GET(n->obj - 8, tag, int64); if (!__ODD(tag)) { n->marked = 0; Heap_Mark(n->obj); @@ -580,10 +580,10 @@ void Heap_FINALL (void) } } -static void Heap_MarkStack (address n, address *cand, LONGINT cand__len) +static void Heap_MarkStack (int64 n, int64 *cand, LONGINT cand__len) { SYSTEM_PTR frame; - address inc, nofcand, sp, p, stack0; + int64 inc, nofcand, sp, p, stack0; struct Heap__1 align; if (n > 0) { Heap_MarkStack(n - 1, cand, cand__len); @@ -600,7 +600,7 @@ static void Heap_MarkStack (address n, address *cand, LONGINT cand__len) inc = -inc; } while (sp != stack0) { - __GET(sp, p, address); + __GET(sp, p, int64); if ((p > Heap_heap && p < Heap_heapend)) { if (nofcand == (int64)cand__len) { Heap_HeapSort(nofcand, (void*)cand, cand__len); @@ -622,8 +622,8 @@ static void Heap_MarkStack (address n, address *cand, LONGINT cand__len) void Heap_GC (BOOLEAN markStack) { Heap_Module m; - address i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; - address cand[10000]; + int64 i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; + int64 cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); m = (Heap_Module)(address)Heap_modules; @@ -703,7 +703,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (address)(address)obj; + f->obj = (int64)(address)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; @@ -713,8 +713,8 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) void Heap_InitHeap (void) { Heap_heap = Heap_NewChunk(256000); - __GET(Heap_heap + 8, Heap_heapend, address); - __PUT(Heap_heap, 0, address); + __GET(Heap_heap + 8, Heap_heapend, int64); + __PUT(Heap_heap, 0, int64); Heap_allocated = 0; Heap_firstTry = 1; Heap_freeList[9] = 1; diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index cfa2ab6f..3fcd0b28 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h @@ -31,7 +31,7 @@ typedef import SYSTEM_PTR Heap_modules; -import address Heap_allocated, Heap_heapsize; +import int64 Heap_allocated, Heap_heapsize; import int16 Heap_FileCount; import address *Heap_ModuleDesc__typ; @@ -41,11 +41,11 @@ import void Heap_GC (BOOLEAN markStack); import void Heap_INCREF (Heap_Module m); import void Heap_InitHeap (void); import void Heap_Lock (void); -import SYSTEM_PTR Heap_NEWBLK (address size); -import SYSTEM_PTR Heap_NEWREC (address tag); +import SYSTEM_PTR Heap_NEWBLK (int64 size); +import SYSTEM_PTR Heap_NEWREC (int64 tag); import void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); import SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -import void Heap_REGTYP (Heap_Module m, address typ); +import void Heap_REGTYP (Heap_Module m, int64 typ); import void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); import void Heap_Unlock (void); import void *Heap__init(void); diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index b6890cfe..e3ff56bd 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index d2d0a476..93e2105b 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index 6c15aa17..d211135a 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -2449,12 +2449,8 @@ void OPB_Param (OPT_Node ap, OPT_Object fp) OPB_err(111); } } else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 11)) { - } else if (ap->typ != fp->typ) { - if ((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x1e, 32) && ap->typ->size == 1)))) { - } else if ((ap->typ == OPT_adrtyp && fp->typ == OPT_IntType(ap->typ->size))) { - } else { - OPB_err(123); - } + } else if ((ap->typ != fp->typ && !((((fp->typ->form == 1 && __IN(ap->typ->form, 0x1e, 32))) && ap->typ->size == 1)))) { + OPB_err(123); } else if ((fp->typ->form == 11 && ap->class == 5)) { OPB_err(123); } diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index 8395741b..97860bfc 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index 9104c5c4..e4c0eb06 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index 6236cd73..3325aded 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 18e25b0f..4710b95f 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index b62666db..e249edd5 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index 03366726..f6a8dfc5 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index ea6663ba..3b9acd86 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index 2b449cae..ee182741 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index 8d90d974..1514d9eb 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index c9ff5430..ad18ebdb 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 1a525fcb..d4f953ba 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index f9e7c27c..09f3d249 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index 09931dda..0a9135f5 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 8dc2c83e..c0accb85 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -13,7 +13,7 @@ typedef Platform_ArgPtr (*Platform_ArgVec)[1024]; typedef - address (*Platform_ArgVecPtr)[1]; + int64 (*Platform_ArgVecPtr)[1]; typedef CHAR (*Platform_EnvPtr)[1024]; @@ -31,12 +31,12 @@ typedef export BOOLEAN Platform_LittleEndian; -export address Platform_MainStackFrame; +export int64 Platform_MainStackFrame; export int32 Platform_HaltCode; export int16 Platform_PID; export CHAR Platform_CWD[4096]; export int16 Platform_ArgCount; -export address Platform_ArgVector; +export int64 Platform_ArgVector; static Platform_HaltProcedure Platform_HaltHandler; static int32 Platform_TimeStart; export int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; @@ -66,15 +66,15 @@ export void Platform_Halt (int32 code); export int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ); export int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); export BOOLEAN Platform_Inaccessible (int16 e); -export void Platform_Init (int16 argc, address argvadr); +export void Platform_Init (int16 argc, int64 argvadr); export void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); export int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); export BOOLEAN Platform_NoSuchDirectory (int16 e); -export address Platform_OSAllocate (address size); -export void Platform_OSFree (address address); +export int64 Platform_OSAllocate (int64 size); +export void Platform_OSFree (int64 address); export int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); export int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); -export int16 Platform_Read (int32 h, address p, int32 l, int32 *n); +export int16 Platform_Read (int32 h, int64 p, int32 l, int32 *n); export int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n); export int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); export BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); @@ -92,7 +92,7 @@ export BOOLEAN Platform_TimedOut (int16 e); export BOOLEAN Platform_TooManyFiles (int16 e); export int16 Platform_Truncate (int32 h, int32 limit); export int16 Platform_Unlink (CHAR *n, LONGINT n__len); -export int16 Platform_Write (int32 h, address p, int32 l); +export int16 Platform_Write (int32 h, int64 p, int32 l); static void Platform_YMDHMStoClock (int16 ye, int16 mo, int16 da, int16 ho, int16 mi, int16 se, int32 *t, int32 *d); static void Platform_errch (CHAR c); static void Platform_errint (int32 l); @@ -230,19 +230,19 @@ BOOLEAN Platform_ConnectionFailed (int16 e) return _o_result; } -address Platform_OSAllocate (address size) +int64 Platform_OSAllocate (int64 size) { - address _o_result; + int64 _o_result; _o_result = Platform_allocate(size); return _o_result; } -void Platform_OSFree (address address) +void Platform_OSFree (int64 address) { Platform_free(address); } -void Platform_Init (int16 argc, address argvadr) +void Platform_Init (int16 argc, int64 argvadr) { Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; @@ -543,7 +543,7 @@ int16 Platform_Size (int32 h, int32 *l) return _o_result; } -int16 Platform_Read (int32 h, address p, int32 l, int32 *n) +int16 Platform_Read (int32 h, int64 p, int32 l, int32 *n) { int16 _o_result; int16 result; @@ -579,7 +579,7 @@ int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n) __RETCHK; } -int16 Platform_Write (int32 h, address p, int32 l) +int16 Platform_Write (int32 h, int64 p, int32 l) { int16 _o_result; if (Platform_writefile(h, p, l) == 0) { diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index d697acd7..dcdb5e82 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h @@ -19,12 +19,12 @@ typedef import BOOLEAN Platform_LittleEndian; -import address Platform_MainStackFrame; +import int64 Platform_MainStackFrame; import int32 Platform_HaltCode; import int16 Platform_PID; import CHAR Platform_CWD[4096]; import int16 Platform_ArgCount; -import address Platform_ArgVector; +import int64 Platform_ArgVector; import int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; import int32 Platform_StdIn, Platform_StdOut, Platform_StdErr; import CHAR Platform_nl[3]; @@ -50,15 +50,15 @@ import void Platform_Halt (int32 code); import int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ); import int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); import BOOLEAN Platform_Inaccessible (int16 e); -import void Platform_Init (int16 argc, address argvadr); +import void Platform_Init (int16 argc, int64 argvadr); import void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); import int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); import BOOLEAN Platform_NoSuchDirectory (int16 e); -import address Platform_OSAllocate (address size); -import void Platform_OSFree (address address); +import int64 Platform_OSAllocate (int64 size); +import void Platform_OSFree (int64 address); import int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); import int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); -import int16 Platform_Read (int32 h, address p, int32 l, int32 *n); +import int16 Platform_Read (int32 h, int64 p, int32 l, int32 *n); import int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n); import int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); import BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); @@ -75,7 +75,7 @@ import BOOLEAN Platform_TimedOut (int16 e); import BOOLEAN Platform_TooManyFiles (int16 e); import int16 Platform_Truncate (int32 h, int32 limit); import int16 Platform_Unlink (CHAR *n, LONGINT n__len); -import int16 Platform_Write (int32 h, address p, int32 l); +import int16 Platform_Write (int32 h, int64 p, int32 l); import BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); import void *Platform__init(void); diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 4b72fbe3..e75d35ff 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index 4a4c73b0..8a42b39b 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index f765b98f..9f9562db 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index be1e7d7f..da213d81 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index 6cb415b9..2590cb27 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index dc456f77..7800b252 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/Vishap.c b/bootstrap/windows-88/Vishap.c deleted file mode 100644 index 30b81ac7..00000000 --- a/bootstrap/windows-88/Vishap.c +++ /dev/null @@ -1,171 +0,0 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ - -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 - -#include "SYSTEM.h" -#include "Configuration.h" -#include "Heap.h" -#include "OPB.h" -#include "OPC.h" -#include "OPM.h" -#include "OPP.h" -#include "OPT.h" -#include "OPV.h" -#include "Platform.h" -#include "Strings.h" -#include "extTools.h" -#include "vt100.h" - - -static CHAR Vishap_mname[256]; - - -export void Vishap_Module (BOOLEAN *done); -static void Vishap_PropagateElementaryTypeSizes (void); -export void Vishap_Translate (void); -static void Vishap_Trap (int16 sig); - - -void Vishap_Module (BOOLEAN *done) -{ - BOOLEAN ext, new; - OPT_Node p = NIL; - OPP_Module(&p, OPM_opt); - if (OPM_noerr) { - OPV_Init(); - OPT_InitRecno(); - OPV_AdrAndSize(OPT_topScope); - OPT_Export(&ext, &new); - if (OPM_noerr) { - OPM_OpenFiles((void*)OPT_SelfName, 256); - OPC_Init(); - OPV_Module(p); - if (OPM_noerr) { - if ((__IN(10, OPM_opt, 32) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { - OPM_DeleteNewSym(); - if (!__IN(16, OPM_opt, 32)) { - vt100_SetAttr((CHAR*)"32m", 4); - } - OPM_LogWStr((CHAR*)" Main program.", 16); - if (!__IN(16, OPM_opt, 32)) { - vt100_SetAttr((CHAR*)"0m", 3); - } - } else { - if (new) { - if (!__IN(16, OPM_opt, 32)) { - vt100_SetAttr((CHAR*)"32m", 4); - } - OPM_LogWStr((CHAR*)" New symbol file.", 19); - if (!__IN(16, OPM_opt, 32)) { - vt100_SetAttr((CHAR*)"0m", 3); - } - OPM_RegisterNewSym(); - } else if (ext) { - OPM_LogWStr((CHAR*)" Extended symbol file.", 24); - OPM_RegisterNewSym(); - } - } - } else { - OPM_DeleteNewSym(); - } - } - } - OPM_CloseFiles(); - OPT_Close(); - OPM_LogWLn(); - *done = OPM_noerr; -} - -static void Vishap_PropagateElementaryTypeSizes (void) -{ - OPT_sysptrtyp->size = OPM_AddressSize; - OPT_adrtyp->size = OPM_AddressSize; - OPT_settyp->size = OPM_SetSize; - OPT_sinttyp = OPT_IntType(OPM_ShortintSize); - OPT_inttyp = OPT_IntType(OPM_IntegerSize); - OPT_linttyp = OPT_IntType(OPM_LongintSize); - OPT_sintobj->typ = OPT_sinttyp; - OPT_intobj->typ = OPT_inttyp; - OPT_lintobj->typ = OPT_linttyp; -} - -void Vishap_Translate (void) -{ - BOOLEAN done; - CHAR modulesobj[2048]; - modulesobj[0] = 0x00; - if (OPM_OpenPar()) { - for (;;) { - OPM_Init(&done, (void*)Vishap_mname, 256); - if (!done) { - return; - } - OPM_InitOptions(); - Vishap_PropagateElementaryTypeSizes(); - Heap_GC(0); - Vishap_Module(&done); - if (!done) { - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Module compilation failed.", 27); - OPM_LogWLn(); - Platform_Exit(1); - } - if (!__IN(13, OPM_opt, 32)) { - if (__IN(14, OPM_opt, 32)) { - extTools_Assemble(OPM_modName, 32); - } else { - if (!__IN(10, OPM_opt, 32)) { - extTools_Assemble(OPM_modName, 32); - Strings_Append((CHAR*)" ", 2, (void*)modulesobj, 2048); - Strings_Append(OPM_modName, 32, (void*)modulesobj, 2048); - Strings_Append((CHAR*)".o", 3, (void*)modulesobj, 2048); - } else { - extTools_LinkMain((void*)OPM_modName, 32, __IN(15, OPM_opt, 32), modulesobj, 2048); - } - } - } - } - } -} - -static void Vishap_Trap (int16 sig) -{ - Heap_FINALL(); - if (sig == 3) { - Platform_Exit(0); - } else { - if ((sig == 4 && Platform_HaltCode == -15)) { - OPM_LogWStr((CHAR*)" --- Vishap Oberon: internal error", 35); - OPM_LogWLn(); - } - Platform_Exit(2); - } -} - - -export int main(int argc, char **argv) -{ - __INIT(argc, argv); - __MODULE_IMPORT(Configuration); - __MODULE_IMPORT(Heap); - __MODULE_IMPORT(OPB); - __MODULE_IMPORT(OPC); - __MODULE_IMPORT(OPM); - __MODULE_IMPORT(OPP); - __MODULE_IMPORT(OPT); - __MODULE_IMPORT(OPV); - __MODULE_IMPORT(Platform); - __MODULE_IMPORT(Strings); - __MODULE_IMPORT(extTools); - __MODULE_IMPORT(vt100); - __REGMAIN("Vishap", 0); - __REGCMD("Translate", Vishap_Translate); -/* BEGIN */ - Platform_SetInterruptHandler(Vishap_Trap); - Platform_SetQuitHandler(Vishap_Trap); - Platform_SetBadInstructionHandler(Vishap_Trap); - Vishap_Translate(); - __FINI; -} diff --git a/bootstrap/windows-88/errors.c b/bootstrap/windows-88/errors.c index d465624d..34e6fae3 100644 --- a/bootstrap/windows-88/errors.c +++ b/bootstrap/windows-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-88/errors.h b/bootstrap/windows-88/errors.h index cf093ab3..ce275b8c 100644 --- a/bootstrap/windows-88/errors.h +++ b/bootstrap/windows-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index 46f8ac7e..fd7974da 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index 700e6b39..f87adfac 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/vt100.c b/bootstrap/windows-88/vt100.c index 8d4cbdfc..ca56f466 100644 --- a/bootstrap/windows-88/vt100.c +++ b/bootstrap/windows-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-88/vt100.h b/bootstrap/windows-88/vt100.h index da86e98b..f5b8588f 100644 --- a/bootstrap/windows-88/vt100.h +++ b/bootstrap/windows-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/makefile b/makefile index c9feb82b..893e59bc 100644 --- a/makefile +++ b/makefile @@ -1,7 +1,7 @@ # Vishap Oberon master makefile. # # Makes sure configuration parameters are up to date and then hands off -# to src/tools/make/vishap.make. +# to src/tools/make/oberon.mk. @@ -134,124 +134,104 @@ reportsizes: FORCE # clean - clean out the bulid directory clean: configuration - @make -f src/tools/make/vishap.make -s clean + @make -f src/tools/make/oberon.mk -s clean # full: Full build of compiler and libarary. full: configuration - @make -f src/tools/make/vishap.make -s installable - @-make -f src/tools/make/vishap.make -s uninstall - @make -f src/tools/make/vishap.make -s clean + @make -f src/tools/make/oberon.mk -s installable + @-make -f src/tools/make/oberon.mk -s uninstall + @make -f src/tools/make/oberon.mk -s clean # Make bootstrap compiler from source suitable for current data model @printf "\n\n--- Compiler build started ---\n\n" - @make -f src/tools/make/vishap.make -s compilerfromsavedsource + @make -f src/tools/make/oberon.mk -s compilerfromsavedsource MODEL=2 # Use bootstrap compiler to make compiler binary from latest compiler sources - @make -f src/tools/make/vishap.make -s translate - @make -f src/tools/make/vishap.make -s assemble + @make -f src/tools/make/oberon.mk -s translate MODEL=2 + @make -f src/tools/make/oberon.mk -s assemble MODEL=2 # Use latest compiler to make compiler binary from latest compiler sources - @make -f src/tools/make/vishap.make -s translate - @make -f src/tools/make/vishap.make -s assemble + @make -f src/tools/make/oberon.mk -s translate MODEL=2 + @make -f src/tools/make/oberon.mk -s assemble MODEL=2 @printf "\n\n--- Compiler build successfull ---\n\n" - @make -f src/tools/make/vishap.make -s browsercmd + @make -f src/tools/make/oberon.mk -s browsercmd MODEL=2 @printf "\n\n--- Library build started ---\n\n" - @make -f src/tools/make/vishap.make -s library + @make -f src/tools/make/oberon.mk -s library MODEL=2 @printf "\n\n--- Library build successfull ---\n\n" - @make -f src/tools/make/vishap.make -s sourcechanges - @make -f src/tools/make/vishap.make -s install + @make -f src/tools/make/oberon.mk -s sourcechanges + @make -f src/tools/make/oberon.mk -s install MODEL=2 @printf "\n\n--- Confidence tests started ---\n\n" - @make -f src/tools/make/vishap.make -s confidence - @make -f src/tools/make/vishap.make -s showpath - - -# short - like make full, but omitting most libraries -# Convenient for testing changes to the compilersource but not a shippable result -short: configuration - @make -f src/tools/make/vishap.make -s installable - @-make -f src/tools/make/vishap.make -s uninstall - @make -f src/tools/make/vishap.make -s clean -# Make bootstrap compiler from source suitable for current data model - @printf "\n\n--- Compiler build started ---\n\n" - @make -f src/tools/make/vishap.make -s compilerfromsavedsource -# Use bootstrap compiler to make compiler binary from latest compiler sources - @make -f src/tools/make/vishap.make -s translate - @make -f src/tools/make/vishap.make -s assemble -# Use latest compiler to make compiler binary from latest compiler sources - @make -f src/tools/make/vishap.make -s translate - @make -f src/tools/make/vishap.make -s assemble - @printf "\n\n--- Compiler build successfull ---\n\n" - @make -f src/tools/make/vishap.make -s v4 - @make -f src/tools/make/vishap.make -s misc + @make -f src/tools/make/oberon.mk -s confidence MODEL=2 + @make -f src/tools/make/oberon.mk -s showpath MODEL=2 assemble: - @make -f src/tools/make/vishap.make -s assemble + @make -f src/tools/make/oberon.mk -s assemble MODEL=2 # compile: compiler only, without cleaning compiler: configuration - @make -f src/tools/make/vishap.make -s translate - @make -f src/tools/make/vishap.make -s assemble + @make -f src/tools/make/oberon.mk -s translate MODEL=2 + @make -f src/tools/make/oberon.mk -s assemble MODEL=2 # Report changes to compiler source relative to bootstrap compiler sourcechanges: - @make -f src/tools/make/vishap.make -s sourcechanges + @make -f src/tools/make/oberon.mk -s sourcechanges # browsercmd: build the 'showdef' command browsercmd: configuration - @make -f src/tools/make/vishap.make -s browsercmd + @make -f src/tools/make/oberon.mk -s browsercmd # library: build all directories under src/library library: configuration - @make -f src/tools/make/vishap.make -s library + @make -f src/tools/make/oberon.mk -s library # Individual library components v4: configuration - @make -f src/tools/make/vishap.make -s v4 + @make -f src/tools/make/oberon.mk -s v4 ooc2: configuration - @make -f src/tools/make/vishap.make -s ooc2 + @make -f src/tools/make/oberon.mk -s ooc2 ooc: configuration - @make -f src/tools/make/vishap.make -s ooc + @make -f src/tools/make/oberon.mk -s ooc ulm: configuration - @make -f src/tools/make/vishap.make -s ulm + @make -f src/tools/make/oberon.mk -s ulm pow32: configuration - @make -f src/tools/make/vishap.make -s pow32 + @make -f src/tools/make/oberon.mk -s pow32 misc: configuration - @make -f src/tools/make/vishap.make -s misc + @make -f src/tools/make/oberon.mk -s misc s3: configuration - @make -f src/tools/make/vishap.make -s s3 + @make -f src/tools/make/oberon.mk -s s3 # install: Copy built files to install directory install: configuration - @make -f src/tools/make/vishap.make -s installable - @make -f src/tools/make/vishap.make -s install - @make -f src/tools/make/vishap.make -s showpath + @make -f src/tools/make/oberon.mk -s installable + @make -f src/tools/make/oberon.mk -s install MODEL=2 + @make -f src/tools/make/oberon.mk -s showpath MODEL=2 uninstall: configuration - @make -f src/tools/make/vishap.make -s installable - @make -f src/tools/make/vishap.make -s uninstall + @make -f src/tools/make/oberon.mk -s installable + @make -f src/tools/make/oberon.mk -s uninstall # confidence: Run a set of confidence tests confidence: configuration - @make -f src/tools/make/vishap.make -s confidence + @make -f src/tools/make/oberon.mk -s confidence planned-binary-change: @date >src/test/confidence/planned-binary-change @@ -266,25 +246,25 @@ planned-binary-change: # If the bootstrap directories are broken or only partially # built then run 'make revertbootstrap' first. bootstrap: bootstrapconfiguration - @make -f src/tools/make/vishap.make -s clean - @make -f src/tools/make/vishap.make -s translate - @make -f src/tools/make/vishap.make -s assemble + @make -f src/tools/make/oberon.mk -s clean + @make -f src/tools/make/oberon.mk -s translate + @make -f src/tools/make/oberon.mk -s assemble rm -rf bootstrap/* - make -f src/tools/make/vishap.make -s translate MODEL=-O2 INTSIZE=2 ADRSIZE=4 ALIGNMENT=4 PLATFORM=unix BUILDDIR=bootstrap/unix-44 && rm bootstrap/unix-44/*.sym - make -f src/tools/make/vishap.make -s translate MODEL=-O2 INTSIZE=2 ADRSIZE=4 ALIGNMENT=8 PLATFORM=unix BUILDDIR=bootstrap/unix-48 && rm bootstrap/unix-48/*.sym - make -f src/tools/make/vishap.make -s translate MODEL=-O2 INTSIZE=4 ADRSIZE=8 ALIGNMENT=8 PLATFORM=unix BUILDDIR=bootstrap/unix-88 && rm bootstrap/unix-88/*.sym - make -f src/tools/make/vishap.make -s translate MODEL=-O2 INTSIZE=2 ADRSIZE=4 ALIGNMENT=8 PLATFORM=windows BUILDDIR=bootstrap/windows-48 && rm bootstrap/windows-48/*.sym - make -f src/tools/make/vishap.make -s translate MODEL=-O2 INTSIZE=4 ADRSIZE=8 ALIGNMENT=8 PLATFORM=windows BUILDDIR=bootstrap/windows-88 && rm bootstrap/windows-88/*.sym + make -f src/tools/make/oberon.mk -s translate MODEL=2 INTSIZE=2 ADRSIZE=4 ALIGNMENT=4 PLATFORM=unix BUILDDIR=bootstrap/unix-44 && rm bootstrap/unix-44/*.sym + make -f src/tools/make/oberon.mk -s translate MODEL=2 INTSIZE=2 ADRSIZE=4 ALIGNMENT=8 PLATFORM=unix BUILDDIR=bootstrap/unix-48 && rm bootstrap/unix-48/*.sym + make -f src/tools/make/oberon.mk -s translate MODEL=2 INTSIZE=4 ADRSIZE=8 ALIGNMENT=8 PLATFORM=unix BUILDDIR=bootstrap/unix-88 && rm bootstrap/unix-88/*.sym + make -f src/tools/make/oberon.mk -s translate MODEL=2 INTSIZE=2 ADRSIZE=4 ALIGNMENT=8 PLATFORM=windows BUILDDIR=bootstrap/windows-48 && rm bootstrap/windows-48/*.sym + make -f src/tools/make/oberon.mk -s translate MODEL=2 INTSIZE=4 ADRSIZE=8 ALIGNMENT=8 PLATFORM=windows BUILDDIR=bootstrap/windows-88 && rm bootstrap/windows-88/*.sym cp src/system/*.[ch] bootstrap bootstrapunclean: bootstrapconfiguration rm -rf bootstrap/* - make -f src/tools/make/vishap.make -s translate MODEL=-O2 INTSIZE=2 ADRSIZE=4 ALIGNMENT=4 PLATFORM=unix BUILDDIR=bootstrap/unix-44 && rm bootstrap/unix-44/*.sym - make -f src/tools/make/vishap.make -s translate MODEL=-O2 INTSIZE=2 ADRSIZE=4 ALIGNMENT=8 PLATFORM=unix BUILDDIR=bootstrap/unix-48 && rm bootstrap/unix-48/*.sym - make -f src/tools/make/vishap.make -s translate MODEL=-O2 INTSIZE=4 ADRSIZE=8 ALIGNMENT=8 PLATFORM=unix BUILDDIR=bootstrap/unix-88 && rm bootstrap/unix-88/*.sym - make -f src/tools/make/vishap.make -s translate MODEL=-O2 INTSIZE=2 ADRSIZE=4 ALIGNMENT=8 PLATFORM=windows BUILDDIR=bootstrap/windows-48 && rm bootstrap/windows-48/*.sym - make -f src/tools/make/vishap.make -s translate MODEL=-O2 INTSIZE=4 ADRSIZE=8 ALIGNMENT=8 PLATFORM=windows BUILDDIR=bootstrap/windows-88 && rm bootstrap/windows-88/*.sym + make -f src/tools/make/oberon.mk -s translate MODEL=2 INTSIZE=2 ADRSIZE=4 ALIGNMENT=4 PLATFORM=unix BUILDDIR=bootstrap/unix-44 && rm bootstrap/unix-44/*.sym + make -f src/tools/make/oberon.mk -s translate MODEL=2 INTSIZE=2 ADRSIZE=4 ALIGNMENT=8 PLATFORM=unix BUILDDIR=bootstrap/unix-48 && rm bootstrap/unix-48/*.sym + make -f src/tools/make/oberon.mk -s translate MODEL=2 INTSIZE=4 ADRSIZE=8 ALIGNMENT=8 PLATFORM=unix BUILDDIR=bootstrap/unix-88 && rm bootstrap/unix-88/*.sym + make -f src/tools/make/oberon.mk -s translate MODEL=2 INTSIZE=2 ADRSIZE=4 ALIGNMENT=8 PLATFORM=windows BUILDDIR=bootstrap/windows-48 && rm bootstrap/windows-48/*.sym + make -f src/tools/make/oberon.mk -s translate MODEL=2 INTSIZE=4 ADRSIZE=8 ALIGNMENT=8 PLATFORM=windows BUILDDIR=bootstrap/windows-88 && rm bootstrap/windows-88/*.sym cp src/system/*.[ch] bootstrap @@ -304,10 +284,10 @@ revertbootstrap: # coordinator: Start the test machine coordinator coordinator: configuration - @make -f src/tools/make/vishap.make -s clean - @make -f src/tools/make/vishap.make -s translate - @make -f src/tools/make/vishap.make -s assemble - @make -f src/tools/make/vishap.make -s testtools + @make -f src/tools/make/oberon.mk -s clean + @make -f src/tools/make/oberon.mk -s translate + @make -f src/tools/make/oberon.mk -s assemble + @make -f src/tools/make/oberon.mk -s testtools @rm -f "build/*.log" cd build && ../testcoordinator.exe @@ -316,7 +296,7 @@ coordinator: configuration # auto: machine specific build server auto: configuration - @make -f src/tools/make/vishap.make -s auto + @make -f src/tools/make/oberon.mk -s auto diff --git a/src/compiler/Vishap.Mod b/src/compiler/Compiler.Mod similarity index 82% rename from src/compiler/Vishap.Mod rename to src/compiler/Compiler.Mod index 0b1e4830..f27fd578 100644 --- a/src/compiler/Vishap.Mod +++ b/src/compiler/Compiler.Mod @@ -1,4 +1,4 @@ -MODULE Vishap; (* J. Templ 3.2.95 *) +MODULE Compiler; (* J. Templ 3.2.95 *) IMPORT SYSTEM, Heap, Platform, Configuration, @@ -12,7 +12,7 @@ MODULE Vishap; (* J. Templ 3.2.95 *) PROCEDURE Module*(VAR done: BOOLEAN); VAR ext, new: BOOLEAN; p: OPT.Node; BEGIN - OPP.Module(p, OPM.opt); + OPP.Module(p, OPM.Options); IF OPM.noerr THEN OPV.Init; OPT.InitRecno; @@ -23,16 +23,16 @@ MODULE Vishap; (* J. Templ 3.2.95 *) OPC.Init; OPV.Module(p); IF OPM.noerr THEN - IF (OPM.mainprog IN OPM.opt) & (OPM.modName # "SYSTEM") THEN + IF (OPM.mainprog IN OPM.Options) & (OPM.modName # "SYSTEM") THEN OPM.DeleteNewSym; - IF ~(OPM.notcoloroutput IN OPM.opt) THEN vt100.SetAttr(vt100.Green) END; + IF ~(OPM.notcoloroutput IN OPM.Options) THEN vt100.SetAttr(vt100.Green) END; OPM.LogWStr(" Main program."); - IF ~(OPM.notcoloroutput IN OPM.opt) THEN vt100.SetAttr(vt100.ResetAll) END; + IF ~(OPM.notcoloroutput IN OPM.Options) THEN vt100.SetAttr(vt100.ResetAll) END; ELSE IF new THEN - IF ~(OPM.notcoloroutput IN OPM.opt) THEN vt100.SetAttr(vt100.Green) END; + IF ~(OPM.notcoloroutput IN OPM.Options) THEN vt100.SetAttr(vt100.Green) END; OPM.LogWStr(" New symbol file."); - IF ~(OPM.notcoloroutput IN OPM.opt) THEN vt100.SetAttr(vt100.ResetAll) END; + IF ~(OPM.notcoloroutput IN OPM.Options) THEN vt100.SetAttr(vt100.ResetAll) END; OPM.RegisterNewSym ELSIF ext THEN OPM.LogWStr(" Extended symbol file."); @@ -95,12 +95,12 @@ MODULE Vishap; (* J. Templ 3.2.95 *) END; (* 'assemble' (i.e. c compile) .c to object or executable. *) - IF ~(OPM.dontasm IN OPM.opt) THEN - IF OPM.dontlink IN OPM.opt THEN + IF ~(OPM.dontasm IN OPM.Options) THEN + IF OPM.dontlink IN OPM.Options THEN (* If not linking, just assemble each module. *) extTools.Assemble(OPM.modName) ELSE - IF ~(OPM.mainprog IN OPM.opt) THEN + IF ~(OPM.mainprog IN OPM.Options) THEN (* Assemble non main program and add object name to link list *) extTools.Assemble(OPM.modName); Strings.Append(" ", modulesobj); @@ -108,7 +108,7 @@ MODULE Vishap; (* J. Templ 3.2.95 *) Strings.Append(Configuration.objext, modulesobj) ELSE (* Assemble and link main program *) - extTools.LinkMain(OPM.modName, OPM.mainlinkstat IN OPM.opt, modulesobj) + extTools.LinkMain(OPM.modName, OPM.mainlinkstat IN OPM.Options, modulesobj) END END END @@ -123,7 +123,7 @@ MODULE Vishap; (* J. Templ 3.2.95 *) Platform.Exit(0) ELSE IF (sig = 4) & (Platform.HaltCode = -15) THEN - OPM.LogWStr(" --- Vishap Oberon: internal error"); + OPM.LogWStr(" --- Oberon compiler internal error"); OPM.LogWLn END ; Platform.Exit(2) @@ -135,4 +135,4 @@ BEGIN Platform.SetQuitHandler(Trap); Platform.SetBadInstructionHandler(Trap); Translate -END Vishap. +END Compiler. diff --git a/src/compiler/OPB.Mod b/src/compiler/OPB.Mod index 260280e5..547f2521 100644 --- a/src/compiler/OPB.Mod +++ b/src/compiler/OPB.Mod @@ -829,16 +829,18 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) g: INTEGER; (* expression (source) form *) p, q: OPT.Struct; BEGIN - IF OPM.verbose IN OPM.opt THEN + y := ynode^.typ; f := x^.form; g := y^.form; + (* + IF OPM.verbose IN OPM.Options THEN OPM.LogWLn; OPM.LogWStr("PROCEDURE CheckAssign"); OPM.LogWLn; END; - y := ynode^.typ; f := x^.form; g := y^.form; - IF OPM.verbose IN OPM.opt THEN + IF OPM.verbose IN OPM.Options THEN OPM.LogWStr("y.form = "); OPM.LogWNum(y.form, 0); OPM.LogWLn; OPM.LogWStr("f = "); OPM.LogWNum(f, 0); OPM.LogWLn; OPM.LogWStr("g = "); OPM.LogWNum(g, 0); OPM.LogWLn; OPM.LogWStr("ynode.typ.syze = "); OPM.LogWNum(ynode.typ.size, 0); OPM.LogWLn; END; + *) IF (ynode^.class = OPT.Ntype) OR (ynode^.class = OPT.Nproc) & (f # OPT.ProcTyp) THEN err(126) END ; CASE f OF OPT.Undef, @@ -1328,7 +1330,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) f := atyp^.comp; ftyp := ftyp^.BaseTyp; atyp := atyp^.BaseTyp; IF fvarpar & (ftyp = OPT.bytetyp) THEN (* ok, but ... *) IF ~(f IN {OPT.Array, OPT.DynArr}) OR ~((atyp.form IN {OPT.Byte..OPT.Char, OPT.Int}) & (atyp.size = 1)) THEN - IF OPM.verbose IN OPM.opt THEN err(-301) END + IF OPM.verbose IN OPM.Options THEN err(-301) END END ELSIF f IN {OPT.Array, OPT.DynArr} THEN IF ftyp^.comp = OPT.DynArr THEN DynArrParCheck(ftyp, atyp, fvarpar) diff --git a/src/compiler/OPC.Mod b/src/compiler/OPC.Mod index 456bcf87..4f4839c5 100644 --- a/src/compiler/OPC.Mod +++ b/src/compiler/OPC.Mod @@ -660,7 +660,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) EndStat; BegStat; OPM.WriteString("address *"); Ident(obj); OPM.WriteString(TagExt); base := NIL - ELSIF (OPM.ptrinit IN OPM.opt) & (vis = 0) & (obj^.mnolev > 0) & (obj^.typ^.form = OPT.Pointer) THEN + ELSIF (OPM.ptrinit IN OPM.Options) & (vis = 0) & (obj^.mnolev > 0) & (obj^.typ^.form = OPT.Pointer) THEN OPM.WriteString(" = NIL") END END ; @@ -779,7 +779,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) OPM.WriteString("/* "); OPM.WriteString(Configuration.name); OPM.Write(" "); OPM.WriteString(Configuration.versionLong); OPM.Write (" "); (* noch *) FOR i := 0 TO MAX(SET) DO - IF i IN OPM.glbopt THEN + IF i IN OPM.Options THEN CASE i OF (* c.f. ScanOptions in OPM *) | OPM.inxchk: OPM.Write("x") | OPM.ranchk: OPM.Write("r") @@ -902,22 +902,22 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) PROCEDURE EnterBody*; BEGIN OPM.WriteLn; OPM.WriteString(Export); - IF OPM.mainprog IN OPM.opt THEN + IF OPM.mainprog IN OPM.Options THEN OPM.WriteString("int main(int argc, char **argv)"); OPM.WriteLn; ELSE OPM.WriteString("void *"); OPM.WriteString(OPM.modName); OPM.WriteString(BodyNameExt); OPM.WriteLn; END ; BegBlk; BegStat; - IF OPM.mainprog IN OPM.opt THEN OPM.WriteString("__INIT(argc, argv)") ELSE OPM.WriteString("__DEFMOD") END ; + IF OPM.mainprog IN OPM.Options THEN OPM.WriteString("__INIT(argc, argv)") ELSE OPM.WriteString("__DEFMOD") END ; EndStat; - IF (OPM.mainprog IN OPM.opt) & demoVersion THEN BegStat; + IF (OPM.mainprog IN OPM.Options) & demoVersion THEN BegStat; OPM.WriteString('/*don`t do it!*/ printf("DEMO VERSION: DO NOT USE THIS PROGRAM FOR ANY COMMERCIAL PURPOSE\n")'); EndStat END ; InitImports(OPT.topScope^.right); BegStat; - IF OPM.mainprog IN OPM.opt THEN OPM.WriteString('__REGMAIN("') ELSE OPM.WriteString('__REGMOD("') END ; + IF OPM.mainprog IN OPM.Options THEN OPM.WriteString('__REGMAIN("') ELSE OPM.WriteString('__REGMOD("') END ; OPM.WriteString(OPM.modName); IF GlbPtrs THEN OPM.WriteString('", EnumPtrs)') ELSE OPM.WriteString('", 0)') END ; EndStat; @@ -927,7 +927,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) PROCEDURE ExitBody*; BEGIN BegStat; - IF OPM.mainprog IN OPM.opt THEN OPM.WriteString("__FINI;") ELSE OPM.WriteString("__ENDMOD;") END ; + IF OPM.mainprog IN OPM.Options THEN OPM.WriteString("__FINI;") ELSE OPM.WriteString("__ENDMOD;") END ; OPM.WriteLn; EndBlk END ExitBody; diff --git a/src/compiler/OPM.cmdln.Mod b/src/compiler/OPM.Mod similarity index 78% rename from src/compiler/OPM.cmdln.Mod rename to src/compiler/OPM.Mod index e954ea63..f7a171aa 100644 --- a/src/compiler/OPM.cmdln.Mod +++ b/src/compiler/OPM.Mod @@ -24,7 +24,6 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) notcoloroutput* = 16; (* turn off color output *) forcenewsym* = 17; (* force new symbol file *) verbose* = 18; (* verbose *) - defopt* = {inxchk, typchk, ptrinit, assert}; (* default options *) nilval* = 0; @@ -87,10 +86,12 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) VAR SourceFileName : ARRAY 256 OF CHAR; - (* Parameter selectable sizes *) - AddressSize*, Alignment*, - SetSize*, - ShortintSize*, IntegerSize*, LongintSize*: INTEGER; + GlobalModel, Model*: CHAR; (* 2: S8/I16/L32, C: S16/I32/L64, V:S8/I32/L64 *) + GlobalAddressSize, AddressSize*: INTEGER; + GlobalAlignment, Alignment*: INTEGER; + GlobalOptions*, Options*: SET; + + ShortintSize*, IntegerSize*, LongintSize*, SetSize*: INTEGER; MaxSet*: INTEGER; MaxIndex*: SYSTEM.INT64; @@ -105,7 +106,6 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) pc*, entno*: INTEGER; (* entry number *) modName*: ARRAY 32 OF CHAR; objname*: ARRAY 64 OF CHAR; - opt*, glbopt*: SET; ErrorLineStartPos, ErrorLineLimitPos, ErrorLineNumber: LONGINT; (* Limit = start of next line *) @@ -120,8 +120,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) S: INTEGER; - OBERON: ARRAY 1024 OF CHAR; - MODULES: ARRAY 1024 OF CHAR; + ResourceDir*: ARRAY 1024 OF CHAR; (* ------------------------- Log Output ------------------------- *) @@ -134,12 +133,32 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) + (* Integer size support *) + + PROCEDURE SignedMaximum*(bytecount: LONGINT): SYSTEM.INT64; + VAR result: SYSTEM.INT64; + BEGIN + result := 1; + result := SYSTEM.LSH(result, bytecount*8-1); + RETURN result - 1; + END SignedMaximum; + + PROCEDURE SignedMinimum*(bytecount: LONGINT): SYSTEM.INT64; + BEGIN RETURN -SignedMaximum(bytecount) - 1 + END SignedMinimum; + + + (* Unchecked conversion of any size integer to INTEGER or LONGINT *) + PROCEDURE Longint* (n: SYSTEM.INT64): LONGINT; BEGIN RETURN SYSTEM.VAL(LONGINT, n) END Longint; PROCEDURE Integer* (n: SYSTEM.INT64): INTEGER; BEGIN RETURN SYSTEM.VAL(INTEGER, n) END Integer; - (* ------------------------- parameter handling -------------------------*) - PROCEDURE ScanOptions(s: ARRAY OF CHAR; VAR opt: SET); + + + (* --------------- Initialisation and parameter handling ---------------*) + + PROCEDURE ScanOptions(s: ARRAY OF CHAR); VAR i: INTEGER; BEGIN i := 1; (* skip - *) @@ -147,34 +166,32 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) CASE s[i] OF (* Run time safety *) - | "p": opt := opt / {ptrinit} (* Initialise pointers to NIL. *) - | "a": opt := opt / {assert} (* Halt on assertion failures. *) - | "r": opt := opt / {ranchk} (* Halt on range check failures. *) - | "t": opt := opt / {typchk} (* Halt on type guad failure. *) - | "x": opt := opt / {inxchk} (* Halt on index out of range. *) + | "p": Options := Options / {ptrinit} (* Initialise pointers to NIL. *) + | "a": Options := Options / {assert} (* Halt on assertion failures. *) + | "r": Options := Options / {ranchk} (* Halt on range check failures. *) + | "t": Options := Options / {typchk} (* Halt on type guad failure. *) + | "x": Options := Options / {inxchk} (* Halt on index out of range. *) (* Symbol file management *) - | "e": opt := opt / {extsf} (* Allow extension of old symbol file. *) - | "s": opt := opt / {newsf} (* Allow generation of new symbol file. *) - | "F": opt := opt / {forcenewsym} (* Force generation of new symbol file. *) + | "e": Options := Options / {extsf} (* Allow extension of old symbol file. *) + | "s": Options := Options / {newsf} (* Allow generation of new symbol file. *) + | "F": Options := Options / {forcenewsym} (* Force generation of new symbol file. *) (* C compiler and linker control *) - | "m": opt := opt / {mainprog} (* This module is main. Link dynamically. *) - | "M": opt := opt / {mainlinkstat} (* This module is main. Link statically. *) - | "S": opt := opt / {dontasm} (* Don't call C compiler *) - | "c": opt := opt / {dontlink} (* Don't link. *) + | "m": Options := Options / {mainprog} (* This module is main. Link dynamically. *) + | "M": Options := Options / {mainlinkstat} (* This module is main. Link statically. *) + | "S": Options := Options / {dontasm} (* Don't call C compiler *) + | "c": Options := Options / {dontlink} (* Don't link. *) (* Miscellaneous *) - | "f": opt := opt / {notcoloroutput} (* Disable vt100 control characters in status output. *) - | "V": opt := opt / {verbose} + | "f": Options := Options / {notcoloroutput} (* Disable vt100 control characters in status output. *) + | "V": Options := Options / {verbose} (* Elementary type size model *) | "O": IF i+1 >= Strings.Length(s) THEN LogWStr("-O option requires following size model character."); LogWLn ELSE - CASE s[i+1] OF - |'2': ShortintSize := 1; IntegerSize := 2; LongintSize := 4; SetSize := 4 (* Original Oberon / Oberon 2 *) - |'V': ShortintSize := 1; IntegerSize := 4; LongintSize := 8; SetSize := 8 (* Vishap 64 bit *) - |'C': ShortintSize := 2; IntegerSize := 4; LongintSize := 8; SetSize := 8 (* Component Pascal *) - ELSE LogWStr("Unrecognised size model character following -O."); LogWLn + Model := s[i+1]; + IF (Model # '2') & (Model # 'C') & (Model # 'V') THEN + LogWStr("Unrecognised size model character following -O."); LogWLn END; INC(i) END @@ -212,26 +229,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) END ScanOptions; - PROCEDURE ^GetProperties; - - - (* Undocumented options used by the build system: - - Todo - this is obsoleted by the -A and -O options. Remove when the build system - has been updated. - - The following parameter overrides the integer size, pointer size and alignment - settings compiled into the binary. They are used when bootstrapping to generate - the C source for a compiler with different sizes to the current compiler. - - -Bnnn Where each n is a single digit specifying the integer size, pointer size - and alignment in bytes. - - An alignment of n means that types smaller than n align to their - own size, types larger than n align to n bytes. - - LONGINT size will be set to twice the integer size. - *) + PROCEDURE -GetAlignment(VAR a: INTEGER) "struct {char c; long long l;} _s; *a = (char*)&_s.l - (char*)&_s"; PROCEDURE OpenPar*(): BOOLEAN; (* prepare for a sequence of translations *) VAR s: ARRAY 256 OF CHAR; @@ -286,43 +284,82 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) LogWStr("Repeating an option toggles its value."); LogWLn; RETURN FALSE ELSE + (* Set options to initial defaults *) + AddressSize := SIZE(SYSTEM.ADDRESS); (* This compilers address size *) + GetAlignment(Alignment); (* This compilers alignment *) + Model := '2'; (* Size model of common Oberon-2 implementations: S8/I16/L32 *) + Options := {inxchk, typchk, ptrinit, assert}; (* Default options *) + + (* Pick up global option changes from start of command line *) S:=1; s:=""; Platform.GetArg(S, s); - - glbopt := defopt; - WHILE s[0] = OptionChar DO - ScanOptions(s, glbopt); + ScanOptions(s); INC(S); s:=""; Platform.GetArg(S, s) END; + (* Record global option settings for this command line *) + GlobalAddressSize := AddressSize; + GlobalAlignment := Alignment; + GlobalModel := Model; + GlobalOptions := Options; + RETURN TRUE END; END OpenPar; - PROCEDURE InitOptions*; (* get the options for one translation *) - VAR s: ARRAY 256 OF CHAR; + PROCEDURE VerboseListSizes; BEGIN - opt := glbopt; + LogWLn; + LogWStr("Type Size"); LogWLn; + LogWStr("SHORTINT "); LogWNum(ShortintSize, 4); (* LogWNum(SIntAlign, 5); *) LogWLn; + LogWStr("INTEGER "); LogWNum(IntegerSize, 4); (* LogWNum(IntAlign, 5); *) LogWLn; + LogWStr("LONGINT "); LogWNum(LongintSize, 4); (* LogWNum(LIntAlign, 5); *) LogWLn; + LogWStr("SET "); LogWNum(SetSize, 4); (* LogWNum(SetAlign, 5); *) LogWLn; + LogWStr("ADDRESS "); LogWNum(AddressSize, 4); (* LogWNum(PointerAlign, 5); *) LogWLn; + LogWLn; + LogWStr("Alignment: "); LogWNum(Alignment, 4); LogWLn; + END VerboseListSizes; + + + PROCEDURE InitOptions*; (* get the options for one translation *) + VAR s: ARRAY 256 OF CHAR; searchpath, modules: ARRAY 1024 OF CHAR; + MODULES: ARRAY 1024 OF CHAR; + + BEGIN + Options := GlobalOptions; Model:=GlobalModel; Alignment := GlobalAlignment; AddressSize := GlobalAddressSize; + s:=""; Platform.GetArg(S, s); WHILE s[0] = OptionChar DO - ScanOptions(s, opt); + ScanOptions(s); INC(S); s:=""; Platform.GetArg(S, s) END; - (* - dontAsm := dontasm IN opt; - dontLink := dontlink IN opt; - mainProg := mainprog IN opt; - mainLinkStat := mainlinkstat IN opt; - notColorOutput := notcoloroutput IN opt; - forceNewSym := forcenewsym IN opt; - Verbose := verbose IN opt; - *) + IF mainlinkstat IN Options THEN INCL(Options, mainprog) END; - IF mainlinkstat IN opt THEN INCL(glbopt, mainprog); INCL(opt, mainprog) END; + MaxIndex := SignedMaximum(AddressSize); + CASE Model OF + |'2': ShortintSize := 1; IntegerSize := 2; LongintSize := 4; SetSize := 4 + |'C': ShortintSize := 2; IntegerSize := 4; LongintSize := 8; SetSize := 8 + |'V': ShortintSize := 1; IntegerSize := 4; LongintSize := 8; SetSize := 8 + ELSE ShortintSize := 1; IntegerSize := 2; LongintSize := 4; SetSize := 4 + END; + MaxSet := SetSize * 8 - 1; - GetProperties; + IF verbose IN Options THEN VerboseListSizes END; + + ResourceDir := Configuration.installdir; + Strings.Append("/ ", ResourceDir); + ResourceDir[Strings.Length(ResourceDir)-1] := Model; + + modules := ""; Platform.GetEnv("MODULES", modules); + searchpath := "."; Platform.GetEnv("OBERON", searchpath); + Strings.Append(";.;", searchpath); + Strings.Append(modules, searchpath); + Strings.Append(";", searchpath); + Strings.Append(ResourceDir, searchpath); + Strings.Append("/sym;", searchpath); + Files.SetSearchPath(searchpath); END InitOptions; @@ -391,13 +428,13 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) buf: ARRAY 1024 OF CHAR; BEGIN IF n >= 0 THEN - IF ~(notcoloroutput IN opt) THEN vt100.SetAttr(vt100.Red) END; + IF ~(notcoloroutput IN Options) THEN vt100.SetAttr(vt100.Red) END; LogWStr(" err "); - IF ~(notcoloroutput IN opt) THEN vt100.SetAttr(vt100.ResetAll) END; + IF ~(notcoloroutput IN Options) THEN vt100.SetAttr(vt100.ResetAll) END; ELSE - IF ~(notcoloroutput IN opt) THEN vt100.SetAttr(vt100.Magenta) END; + IF ~(notcoloroutput IN Options) THEN vt100.SetAttr(vt100.Magenta) END; LogWStr(" warning "); n := -n; - IF ~(notcoloroutput IN opt) THEN vt100.SetAttr(vt100.ResetAll) END; + IF ~(notcoloroutput IN Options) THEN vt100.SetAttr(vt100.ResetAll) END; END ; LogWNum(n, 1); LogWStr(" "); @@ -470,9 +507,9 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) i := SHORT(Longint(pos - ErrorLineStartPos)); WHILE i > 0 DO LogW(" "); DEC(i) END; - IF ~(notcoloroutput IN opt) THEN vt100.SetAttr(vt100.Green) END; + IF ~(notcoloroutput IN Options) THEN vt100.SetAttr(vt100.Green) END; LogW("^"); - IF ~(notcoloroutput IN opt) THEN vt100.SetAttr(vt100.ResetAll) END; + IF ~(notcoloroutput IN Options) THEN vt100.SetAttr(vt100.ResetAll) END; Files.Close(f); END ShowLine; @@ -548,93 +585,6 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) - (* ------------------------- initialization ------------------------- *) - - PROCEDURE GetProperty(VAR S: Texts.Scanner; name: ARRAY OF CHAR; VAR size, align: INTEGER); - BEGIN - IF (S.class = Texts.Name) & (S.s = name) THEN Texts.Scan(S); - IF S.class = Texts.Int THEN size := SHORT(S.i); Texts.Scan(S) ELSE Mark(-157, -1) END ; - IF S.class = Texts.Int THEN align := SHORT(S.i); Texts.Scan(S) ELSE Mark(-157, -1) END - ELSE Mark(-157, -1) - END - END GetProperty; - - - PROCEDURE minusop(i: LONGINT): LONGINT; - BEGIN - RETURN -i; - END minusop; - - - PROCEDURE power0(i, j : LONGINT) : LONGINT; (* we would like to calculate exact Min Max values in GetProperties, not hardcode em, noch *) - VAR k : LONGINT; - p : LONGINT; - BEGIN - k := 1; - p := i; - REPEAT - p := p * i; - INC(k); - UNTIL k=j; - RETURN p; - END power0; - - - PROCEDURE VerboseListSizes; - BEGIN - LogWLn; - LogWStr("Type Size"); LogWLn; - LogWStr("SHORTINT "); LogWNum(ShortintSize, 4); (* LogWNum(SIntAlign, 5); *) LogWLn; - LogWStr("INTEGER "); LogWNum(IntegerSize, 4); (* LogWNum(IntAlign, 5); *) LogWLn; - LogWStr("LONGINT "); LogWNum(LongintSize, 4); (* LogWNum(LIntAlign, 5); *) LogWLn; - LogWStr("SET "); LogWNum(SetSize, 4); (* LogWNum(SetAlign, 5); *) LogWLn; - LogWStr("ADDRESS "); LogWNum(AddressSize, 4); (* LogWNum(PointerAlign, 5); *) LogWLn; - LogWLn; - LogWStr("Alignment: "); LogWNum(Alignment, 4); LogWLn; - END VerboseListSizes; - - - - - (* Integer size support *) - - PROCEDURE SignedMaximum*(bytecount: LONGINT): SYSTEM.INT64; - VAR result: SYSTEM.INT64; - BEGIN - result := 1; - result := SYSTEM.LSH(result, bytecount*8-1); - RETURN result - 1; - END SignedMaximum; - - PROCEDURE SignedMinimum*(bytecount: LONGINT): SYSTEM.INT64; - BEGIN RETURN -SignedMaximum(bytecount) - 1 - END SignedMinimum; - - - - - - - - PROCEDURE GetProperties(); - (* VAR base: LONGINT; *) - BEGIN - (* Fixed and Configuration.Mod based sizes have been initialised in - the module startup code, and maybe overridden by the -Bnnn bootstrap - parameter *) - - MaxReal := 3.40282346D38; (* REAL is 4 bytes *) - MaxLReal := 1.7976931348623157D307 * 9.999999; (* LONGREAL is 8 bytes *) - (*should be 1.7976931348623157D308 *) - - MinReal := -MaxReal; - MinLReal := -MaxLReal; - MaxSet := SetSize * 8 - 1; - MaxIndex := SignedMaximum(AddressSize); - - IF verbose IN opt THEN VerboseListSizes END; - END GetProperties; - (* ------------------------- Read Symbol File ------------------------- *) @@ -711,7 +661,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) PROCEDURE RegisterNewSym*; BEGIN - IF (modName # "SYSTEM") OR (mainprog IN opt) THEN Files.Register(newSFile) END + IF (modName # "SYSTEM") OR (mainprog IN Options) THEN Files.Register(newSFile) END END RegisterNewSym; PROCEDURE DeleteNewSym*; @@ -837,8 +787,8 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) IF noerr THEN LogWStr(" "); LogWNum(Files.Pos(R[BodyFile]), 0); LogWStr(" chars.") END; IF noerr THEN IF modName = "SYSTEM" THEN - IF ~(mainprog IN opt) THEN Files.Register(BFile) END - ELSIF ~(mainprog IN opt) THEN + IF ~(mainprog IN Options) THEN Files.Register(BFile) END + ELSIF ~(mainprog IN Options) THEN Append(R[HeaderInclude], HFile); Files.Register(HIFile); Files.Register(BFile) ELSE @@ -854,29 +804,11 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) -PROCEDURE -GetAlignment(VAR a: INTEGER) "struct {char c; long long l;} s; *a = (char*)&s.l - (char*)&s"; - BEGIN + MaxReal := 3.40282346D38; (* REAL is 4 bytes *) + MaxLReal := 1.7976931348623157D307 * 9.999999; (* LONGREAL is 8 bytes, should be 1.7976931348623157D308 *) + MinReal := -MaxReal; + MinLReal := -MaxLReal; + Texts.OpenWriter(W); - - MODULES := ""; Platform.GetEnv("MODULES", MODULES); - - OBERON := "."; Platform.GetEnv("OBERON", OBERON); - Strings.Append(";.;", OBERON); - Strings.Append(MODULES, OBERON); - Strings.Append(";", OBERON); - Strings.Append(Configuration.installdir, OBERON); - Strings.Append("/sym;", OBERON); - - Files.SetSearchPath(OBERON); - - (* Default address size and alignment are those of this compiler *) - AddressSize := SIZE(SYSTEM.ADDRESS); - GetAlignment(Alignment); - - (* Default type size model is that of the original Oberon-2 implementation (-O2) *) - ShortintSize := 1; - IntegerSize := 2; - LongintSize := 4; - SetSize := 4 END OPM. diff --git a/src/compiler/OPT.Mod b/src/compiler/OPT.Mod index bd95c80f..ad3afe73 100644 --- a/src/compiler/OPT.Mod +++ b/src/compiler/OPT.Mod @@ -1234,7 +1234,7 @@ END Import; i := 1; WHILE i < maxImps DO expCtxt.locmno[i] := -1; INC(i) END; OutObj(topScope^.right); ext := sfpresent & symExtended; - new := ~sfpresent OR symNew OR (OPM.forcenewsym IN OPM.opt); + new := ~sfpresent OR symNew OR (OPM.forcenewsym IN OPM.Options); IF OPM.noerr & sfpresent & (impCtxt.reffp # expCtxt.reffp) THEN new := TRUE; IF ~extsf THEN err(155) END @@ -1296,8 +1296,8 @@ BEGIN topScope := NIL; OpenScope(0, NIL); OPM.errpos := 0; (*initialization of module SYSTEM*) EnterTyp("BYTE", Byte, 1, bytetyp); - EnterTyp("PTR", Pointer, -1, sysptrtyp); (* Size set in Vishap.PropagateElementaryTypeSize *) - EnterTyp("ADDRESS", Int, -1, adrtyp); (* Size set in Vishap.PropagateElementaryTypeSize *) + EnterTyp("PTR", Pointer, -1, sysptrtyp); (* Size set in Compiler.PropagateElementaryTypeSize *) + EnterTyp("ADDRESS", Int, -1, adrtyp); (* Size set in Compiler.PropagateElementaryTypeSize *) EnterTyp("INT8", Int, 1, int8typ); EnterTyp("INT16", Int, 2, int16typ); EnterTyp("INT32", Int, 4, int32typ); @@ -1322,7 +1322,7 @@ BEGIN topScope := NIL; OpenScope(0, NIL); OPM.errpos := 0; EnterTyp("BOOLEAN", Bool, 1, booltyp); EnterTyp("CHAR", Char, 1, chartyp); - EnterTyp("SET", Set, -1, settyp); (* Size set in Vishap.PropagateElementaryTypeSize *) + EnterTyp("SET", Set, -1, settyp); (* Size set in Compiler.PropagateElementaryTypeSize *) EnterTyp("REAL", Real, 4, realtyp); EnterTyp("LONGREAL", LReal, 8, lrltyp); EnterTyp("HUGEINT", Int, 8, hinttyp); diff --git a/src/compiler/OPV.Mod b/src/compiler/OPV.Mod index dafedf3d..34d1ef34 100644 --- a/src/compiler/OPV.Mod +++ b/src/compiler/OPV.Mod @@ -162,7 +162,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 OPT.Nindex, OPT.Nproc, OPT.Ncall: RETURN 10 - | OPT.Nguard: IF OPM.typchk IN OPM.opt THEN RETURN 10 ELSE RETURN 9 (*cast*) END + | OPT.Nguard: IF OPM.typchk IN OPM.Options THEN RETURN 10 ELSE RETURN 9 (*cast*) END | OPT.Nvarpar: IF comp IN {OPT.Array, OPT.DynArr} THEN RETURN 10 ELSE RETURN 9 END (* arrays don't need deref *) | OPT.Nderef: RETURN 9 | OPT.Nmop: CASE subclass OF @@ -243,7 +243,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 OPM.WriteString("__SETOF("); Entier(n, MinPrec); OPM.WriteString(","); OPM.WriteInt(newtype.size*8); OPM.Write(CloseParen) ELSIF to = OPT.Int THEN - IF (newtype.size < n.typ.size) & (OPM.ranchk IN OPM.opt) THEN + IF (newtype.size < n.typ.size) & (OPM.ranchk IN OPM.Options) THEN OPM.WriteString("__SHORT"); IF SideEffects(n) THEN OPM.Write("F") END; OPM.Write(OpenParen); Entier(n, MinPrec); OPM.WriteString(Comma); OPM.WriteInt(OPM.SignedMaximum(newtype.size) + 1); OPM.Write(CloseParen) @@ -251,7 +251,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 SizeCast(n.typ.size, newtype.size); Entier(n, 9) END ELSIF to = OPT.Char THEN - IF OPM.ranchk IN OPM.opt THEN OPM.WriteString("__CHR"); + IF OPM.ranchk IN OPM.Options THEN OPM.WriteString("__CHR"); IF SideEffects(n) THEN OPM.Write("F") END ; OPM.Write(OpenParen); Entier(n, MinPrec); OPM.Write(CloseParen) ELSE OPM.WriteString("(CHAR)"); Entier(n, 9) @@ -280,7 +280,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 PROCEDURE Index(n, d: OPT.Node; prec, dim: INTEGER); BEGIN - IF ~(OPM.inxchk IN OPM.opt) + IF ~(OPM.inxchk IN OPM.Options) OR (n^.right^.class = OPT.Nconst) & ((n^.right^.conval^.intval = 0) OR (n^.left^.typ^.comp # OPT.DynArr)) THEN expr(n^.right, prec) ELSE @@ -342,7 +342,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 OPM.Write(CloseBracket) END | OPT.Nguard: typ := n^.typ; obj := n^.left^.obj; - IF OPM.typchk IN OPM.opt THEN + IF OPM.typchk IN OPM.Options THEN IF typ^.comp = OPT.Record THEN OPM.WriteString(GuardRecFunc); IF obj^.mnolev # OPM.level THEN (*intermediate level var-par record*) OPM.WriteStringVar(obj^.scope^.name); OPM.WriteString("__curr->"); OPC.Ident(obj) @@ -363,7 +363,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 OPM.Write("("); OPC.Ident(typ^.strobj); OPM.Write(")"); expr(n^.left, designPrec) END END - | OPT.Neguard: IF OPM.typchk IN OPM.opt THEN + | OPT.Neguard: IF OPM.typchk IN OPM.Options THEN IF n^.left^.class = OPT.Nvarpar THEN OPM.WriteString("__GUARDEQR("); OPC.CompleteIdent(n^.left^.obj); OPM.WriteString(Comma); TypeOf(n^.left); ELSE OPM.WriteString("__GUARDEQP("); expr(n^.left^.left, MinPrec) @@ -844,7 +844,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 END ; ActualPar(n^.right, n^.obj) | OPT.Nifelse: IF n^.subcl # OPT.assertfn THEN IfStat(n, FALSE, outerProc) - ELSIF OPM.assert IN OPM.opt THEN + ELSIF OPM.assert IN OPM.Options THEN OPM.WriteString("__ASSERT("); expr(n^.left^.left^.left, MinPrec); OPM.WriteString(Comma); OPM.WriteInt(n^.left^.right^.right^.conval^.intval); OPM.Write(CloseParen); OPC.EndStat END @@ -867,7 +867,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 OPM.WriteString("goto exit__"); OPM.WriteInt(exit.label) END | OPT.Nreturn: IF OPM.level = 0 THEN - IF OPM.mainprog IN OPM.opt THEN OPM.WriteString("__FINI") ELSE OPM.WriteString("__ENDMOD") END + IF OPM.mainprog IN OPM.Options THEN OPM.WriteString("__FINI") ELSE OPM.WriteString("__ENDMOD") END ELSE IF n^.left # NIL THEN (* Make local copy of result before ExitProc deletes dynamic vars *) @@ -895,7 +895,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 PROCEDURE Module*(prog: OPT.Node); BEGIN - IF ~(OPM.mainprog IN OPM.opt) THEN OPC.GenHdr(prog^.right); OPC.GenHdrIncludes END ; + IF ~(OPM.mainprog IN OPM.Options) THEN OPC.GenHdr(prog^.right); OPC.GenHdrIncludes END ; OPC.GenBdy(prog^.right); stat(prog, NIL) END Module; diff --git a/src/compiler/extTools.Mod b/src/compiler/extTools.Mod index 22752d9b..b4f6ca95 100644 --- a/src/compiler/extTools.Mod +++ b/src/compiler/extTools.Mod @@ -2,13 +2,13 @@ MODULE extTools; IMPORT Strings, Console, Configuration, Platform, OPM; -VAR compilationOptions, CFLAGS: ARRAY 1023 OF CHAR; +VAR CFLAGS: ARRAY 1023 OF CHAR; PROCEDURE execute(title: ARRAY OF CHAR; cmd: ARRAY OF CHAR); VAR r, status, exitcode: INTEGER; BEGIN - IF OPM.verbose IN OPM.opt THEN + IF OPM.verbose IN OPM.Options THEN Console.String(title); Console.String(cmd); Console.Ln END; r := Platform.System(cmd); @@ -29,16 +29,27 @@ BEGIN END execute; +PROCEDURE InitialiseCompilerCommand(VAR s: ARRAY OF CHAR); +BEGIN + COPY(Configuration.compile, s); + Strings.Append(' -I "', s); + Strings.Append(OPM.ResourceDir, s); + Strings.Append('/include" ', s); + Platform.GetEnv("CFLAGS", CFLAGS); + Strings.Append (CFLAGS, s); + Strings.Append (" ", s); +END InitialiseCompilerCommand; + + PROCEDURE Assemble*(moduleName: ARRAY OF CHAR); VAR cmd: ARRAY 1023 OF CHAR; BEGIN - cmd := Configuration.compile; - Strings.Append(compilationOptions, cmd); - Strings.Append("-c ", cmd); - Strings.Append(moduleName, cmd); - Strings.Append(".c", cmd); - execute("Assemble: ", cmd); + InitialiseCompilerCommand(cmd); + Strings.Append("-c ", cmd); + Strings.Append(moduleName, cmd); + Strings.Append(".c", cmd); + execute("Assemble: ", cmd); END Assemble; @@ -46,9 +57,7 @@ PROCEDURE LinkMain*(VAR moduleName: ARRAY OF CHAR; statically: BOOLEAN; addition VAR cmd: ARRAY 1023 OF CHAR; BEGIN - cmd := Configuration.compile; - Strings.Append(" ", cmd); - Strings.Append(compilationOptions, cmd); + InitialiseCompilerCommand(cmd); Strings.Append(moduleName, cmd); Strings.Append(".c ", cmd); Strings.Append(additionalopts, cmd); @@ -58,7 +67,7 @@ PROCEDURE LinkMain*(VAR moduleName: ARRAY OF CHAR; statically: BOOLEAN; addition Strings.Append(Configuration.objflag, cmd); Strings.Append(moduleName, cmd); Strings.Append(Configuration.linkflags, cmd); - Strings.Append(Configuration.installdir, cmd); + Strings.Append(OPM.ResourceDir, cmd); Strings.Append('/lib"', cmd); Strings.Append(Configuration.libspec, cmd); @@ -66,11 +75,5 @@ PROCEDURE LinkMain*(VAR moduleName: ARRAY OF CHAR; statically: BOOLEAN; addition END LinkMain; -BEGIN - Strings.Append(' -I "', compilationOptions); - Strings.Append(Configuration.installdir, compilationOptions); - Strings.Append('/include" ', compilationOptions); - Platform.GetEnv("CFLAGS", CFLAGS); - Strings.Append (CFLAGS, compilationOptions); - Strings.Append (" ", compilationOptions); END extTools. +, \ No newline at end of file diff --git a/src/system/Files.Mod b/src/system/Files.Mod index 388b3a95..76732ebc 100644 --- a/src/system/Files.Mod +++ b/src/system/Files.Mod @@ -433,11 +433,6 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files r.res := 0; r.eof := FALSE END ReadBytes; - PROCEDURE ReadByte* (VAR r : Rider; VAR x : ARRAY OF SYSTEM.BYTE); - BEGIN - ReadBytes(r, x, 1); - END ReadByte; - PROCEDURE Base* (VAR r: Rider): File; BEGIN RETURN r.buf.f END Base; diff --git a/src/system/Platformunix.Mod b/src/system/Platformunix.Mod index 2a908c99..2db3669c 100644 --- a/src/system/Platformunix.Mod +++ b/src/system/Platformunix.Mod @@ -14,9 +14,9 @@ TYPE FileHandle* = LONGINT; FileIdentity* = RECORD - volume*: LONGINT; (* dev on Unix filesystems, volume serial number on NTFS *) - index*: LONGINT; (* inode on Unix filesystems, file id on NTFS *) - mtime*: LONGINT; (* File modification time, value is system dependent *) + volume: LONGINT; (* dev on Unix filesystems, volume serial number on NTFS *) + index: LONGINT; (* inode on Unix filesystems, file id on NTFS *) + mtime: LONGINT; (* File modification time, value is system dependent *) END; EnvPtr = POINTER TO ARRAY 1024 OF CHAR; diff --git a/src/tools/make/configure.c b/src/tools/make/configure.c index 5e6e518b..b8d261dd 100644 --- a/src/tools/make/configure.c +++ b/src/tools/make/configure.c @@ -384,8 +384,6 @@ void writeMakeParameters() { fprintf(fd, "VERSION=%s\n", version); fprintf(fd, "ONAME=%s\n", oname); fprintf(fd, "DATAMODEL=%s\n", dataModel); - fprintf(fd, "INTSIZE=%d\n", intsize); - fprintf(fd, "MODEL=-O%c\n", intsize == 2 ? '2' : 'V'); fprintf(fd, "ADRSIZE=%d\n", addressSize); fprintf(fd, "ALIGNMENT=%d\n", alignment); fprintf(fd, "INSTALLDIR=%s\n", installdir); diff --git a/src/tools/make/oberon.mk b/src/tools/make/oberon.mk new file mode 100644 index 00000000..baf784c0 --- /dev/null +++ b/src/tools/make/oberon.mk @@ -0,0 +1,379 @@ +# DO NOT RUN THIS MAKEFILE DIRECTLY. +# +# Always use the makefile in the root of the enlistment. This makefile +# depends on up to date configuration files generated by the root makefile. + + + + +# Be independent of any CFLAGS settings in the calling environment +CFLAGS = + +# Gnu make has the make initial directory in CURDIR, BSD make has it in .CURDIR. +ROOTDIR = $(CURDIR)$(.CURDIR) + +# Configuration.Make is created by src/tools/make/configure.c, which is run on +# *every* build by the makefile in the enlistment root. +include ./Configuration.Make + +FLAVOUR = $(OS).$(DATAMODEL).$(COMPILER) +BUILDDIR = build/$(FLAVOUR) +OBECOMP = $(ONAME)$(BINEXT) + + + +# Default make target - explain usage +usage: + @echo "" + @echo Do not run this makefile directly, always run the makefile in + @echo the root of the enlistment. + + + + +clean: + @printf "\n\n--- Cleaning branch $(BRANCH) $(OS) $(COMPILER) $(DATAMODEL) ---\n\n" + rm -rf $(BUILDDIR) + rm -f $(OBECOMP) + + + + +# Assemble: Generate the Vishap Oberon compiler binary by compiling the C sources in the build directory + +assemble: + @printf "\nmake assemble - compiling Oberon compiler c source:\n" + @printf " VERSION: %s\n" "$(VERSION)" + @printf " BRANCH: %s\n" "$(BRANCH)" + @printf " Target characteristics:\n" + @printf " PLATFORM: %s\n" "$(PLATFORM)" + @printf " OS: %s\n" "$(OS)" + @printf " BUILDDIR: %s\n" "$(BUILDDIR)" + @printf " INSTALLDIR: %s\n" "$(INSTALLDIR)" + @printf " Oberon characteristics:\n" + @printf " MODEL: %s\n" "$(MODEL)" + @printf " ADRSIZE: %s\n" "$(ADRSIZE)" + @printf " ALIGNMENT: %s\n" "$(ALIGNMENT)" + @printf " C compiler:\n" + @printf " COMPILER: %s\n" "$(COMPILER)" + @printf " COMPILE: %s\n" "$(COMPILE)" + @printf " DATAMODEL: %s\n" "$(DATAMODEL)" + + cd $(BUILDDIR) && $(COMPILE) -c SYSTEM.c Configuration.c Platform.c Heap.c + cd $(BUILDDIR) && $(COMPILE) -c Console.c Strings.c Modules.c Files.c + cd $(BUILDDIR) && $(COMPILE) -c Reals.c Texts.c vt100.c errors.c + cd $(BUILDDIR) && $(COMPILE) -c OPM.c extTools.c OPS.c OPT.c + cd $(BUILDDIR) && $(COMPILE) -c OPC.c OPV.c OPB.c OPP.c + + cd $(BUILDDIR) && $(COMPILE) $(STATICLINK) Compiler.c -o $(ROOTDIR)/$(OBECOMP) \ + SYSTEM.o Configuration.o Platform.o Heap.o Console.o Strings.o Modules.o Files.o \ + Reals.o Texts.o vt100.o errors.o OPM.o extTools.o OPS.o OPT.o \ + OPC.o OPV.o OPB.o OPP.o + + cp src/system/*.[ch] $(BUILDDIR) + @printf "$(OBECOMP) created.\n" + + + + +compilerfromsavedsource: + @echo Populating clean build directory from bootstrap C sources $(PLATFORM)-$(ADRSIZE)$(ALIGNMENT). + @mkdir -p $(BUILDDIR) + @cp bootstrap/$(PLATFORM)-$(ADRSIZE)$(ALIGNMENT)/* $(BUILDDIR) + @cp bootstrap/*.[ch] $(BUILDDIR) + @make -f src/tools/make/oberon.mk -s assemble + @cp bootstrap/*.[ch] $(BUILDDIR) + + + + +translate: +# Make sure we have an oberon compiler binary: if we built one earlier we'll use it, +# otherwise use one of the pre-prepared sets of C sources in the bootstrap directory. + + if [ ! -e $(OBECOMP) ]; then make -f src/tools/make/oberon.mk -s compilerfromsavedsource; fi + + @printf "\nmake translate - translating compiler source from Oberon to C:\n" + @printf " PLATFORM: %s\n" $(PLATFORM) + @printf " MODEL: %s\n" $(MODEL) + @printf " ADRSIZE: %s\n" $(ADRSIZE) + @printf " ALIGNMENT: %s\n" $(ALIGNMENT) + @mkdir -p $(BUILDDIR) + @rm -f $(BUILDDIR)/*.sym + + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../Configuration.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/system/Platform$(PLATFORM).Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfFapx -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/system/Heap.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/system/Console.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/library/v4/Strings.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/library/v4/Modules.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfFx -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/system/Files.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/library/v4/Reals.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/library/v4/Texts.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/library/misc/vt100.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/errors.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/OPM.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/extTools.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfFx -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/OPS.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/OPT.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/OPC.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/OPV.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/OPB.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/OPP.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ssfm -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/Compiler.Mod + + @printf "$(BUILDDIR) filled with compiler C source.\n" + + + + +browsercmd: + @printf "\nMaking symbol browser\n" + @cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -fSm -O$(MODEL) ../../src/tools/browser/BrowserCmd.Mod + @cd $(BUILDDIR); $(COMPILE) BrowserCmd.c -o showdef \ + Platform.o Texts.o OPT.o Heap.o Console.o SYSTEM.o OPM.o OPS.o OPV.o \ + Files.o Reals.o Modules.o vt100.o errors.o Configuration.o Strings.o \ + OPC.o + + + + +FORCE: + +# installable: Check for access to the installation directory + +installable: + @rm -rf "S(INSTALLDIR)/test-access-qqq" + @if ! mkdir -p "$(INSTALLDIR)/test-access-qqq";then echo "\\n\\n Cannot write to install directory.\\n Please use sudo or run as root/administrator.\\n\\n"; exit 1;fi + @rm -rf "S(INSTALLDIR)/test-access-qqq" + + + + +# install: Use only after a successful full build. Installs the compiler +# and libraries in /opt/$(ONAME). +# May require root access. +install: + @printf "\nInstalling into \"$(INSTALLDIR)\"\n" + @rm -rf "$(INSTALLDIR)/bin" "$(INSTALLDIR)/$(MODEL)" + @mkdir -p "$(INSTALLDIR)/bin" + @mkdir -p "$(INSTALLDIR)/$(MODEL)/include" + @mkdir -p "$(INSTALLDIR)/$(MODEL)/sym" + @mkdir -p "$(INSTALLDIR)/$(MODEL)/lib" + @cp $(BUILDDIR)/*.h "$(INSTALLDIR)/$(MODEL)/include/" + @cp $(BUILDDIR)/*.sym "$(INSTALLDIR)/$(MODEL)/sym/" + @cp $(OBECOMP) "$(INSTALLDIR)/bin/$(OBECOMP)" + @-cp $(BUILDDIR)/showdef$(BINEXT) "$(INSTALLDIR)/bin" + @cp $(BUILDDIR)/lib$(ONAME)* "$(INSTALLDIR)/$(MODEL)/lib/" + @if which ldconfig >/dev/null 2>&1; then $(LDCONFIG); fi + + +# showpath: Describe how to set the PATH variable +showpath: + @printf "\nNow add $(INSTALLDIR)/bin to your path, for example with the command:\n" + @printf "export PATH=\"$(INSTALLDIR)/bin:\$$PATH\"\n" + @printf "\n" + + + + +uninstall: + @printf "\nUninstalling from \"$(INSTALLDIR)\"\n" + rm -rf "$(INSTALLDIR)" + rm -f /etc/ld.so.conf/lib$(ONAME) + if which ldconfig >/dev/null 2>&1; then ldconfig; fi + + + + +v4: + @printf "\nMaking v4 library\n" + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/v4/Args.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/v4/Printer.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/v4/Sets.Mod + +ooc2: + @printf "\nMaking ooc2 library\n" + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc2/ooc2Strings.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc2/ooc2Ascii.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc2/ooc2CharClass.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc2/ooc2ConvTypes.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc2/ooc2IntConv.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc2/ooc2IntStr.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc2/ooc2Real0.Mod + + +TODO: Comment disabled lines contain use of VAL that reads beyond source variable + +ooc: + @printf "\nMaking ooc library\n" + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocLowReal.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocLowLReal.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocRealMath.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocOakMath.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocLRealMath.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocLongInts.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocComplexMath.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocLComplexMath.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocAscii.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocCharClass.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocStrings.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocConvTypes.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocLRealConv.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocLRealStr.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocRealConv.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocRealStr.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocIntConv.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocIntStr.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocMsg.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocSysClock.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocTime.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocChannel.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocStrings2.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocRts.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocFilenames.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocTextRider.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocBinaryRider.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocJulianDay.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocFilenames.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocwrapperlibc.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocC$(DATAMODEL).Mod + +oocX11: + @printf "\nMaking oocX11 library\n" + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/oocX11/oocX11.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/oocX11/oocXutil.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/oocX11/oocXYplane.Mod + +ulm: + @printf "\nMaking ulm library\n" + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmObjects.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmPriorities.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmDisciplines.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmServices.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmSys.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmSYSTEM.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmEvents.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmProcess.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmResources.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmForwarders.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmRelatedEvents.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmTypes.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmStreams.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmStrings.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmSysTypes.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmTexts.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmSysConversions.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmErrors.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmSysErrors.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmSysStat.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmASCII.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmSets.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmIO.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmAssertions.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmIndirectDisciplines.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmStreamDisciplines.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmIEEE.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmMC68881.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmReals.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmPrint.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmWrite.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmConstStrings.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmPlotters.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmSysIO.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmLoader.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmNetIO.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmPersistentObjects.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmPersistentDisciplines.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmOperations.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmScales.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmTimes.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmClocks.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmTimers.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmConditions.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmStreamConditions.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmTimeConditions.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmCiphers.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmCipherOps.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmBlockCiphers.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmAsymmetricCiphers.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmConclusions.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmRandomGenerators.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmTCrypt.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmIntOperations.Mod + +pow32: + @printf "\nMaking pow library\n" + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/pow/powStrings.Mod + +misc: + @printf "\nMaking misc library\n" + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/system/Oberon.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/misc/crt.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/misc/Listen.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/misc/MersenneTwister.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/misc/MultiArrays.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/misc/MultiArrayRiders.Mod + +s3: + @printf "\nMaking s3 library\n" + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethBTrees.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethMD5.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethSets.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethZlib.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethZlibBuffers.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethZlibInflate.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethZlibDeflate.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethZlibReaders.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethZlibWriters.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethZip.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethRandomNumbers.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethGZReaders.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethGZWriters.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethUnicode.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethDates.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethReals.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethStrings.Mod + +librarybinary: + @printf "\nMaking lib$(ONAME)\n" + +# Remove objects that should not be part of the library + rm -f $(BUILDDIR)/Compiler.o + +# Note: remining compiler files are retained in the library allowing the building +# of utilities like BrowserCmd.Mod (aka showdef). + +# Make static library + ar rcs "$(BUILDDIR)/lib$(ONAME).a" $(BUILDDIR)/*.o + +# Make shared library + @cd $(BUILDDIR) && $(COMPILE) -shared -o lib$(ONAME).so *.o + + + + +library: v4 ooc2 ooc ulm pow32 misc s3 librarybinary + + + + +sourcechanges: + @cd $(BUILDDIR) && sh $(ROOTDIR)/src/tools/make/sourcechanges.sh $(ROOTDIR)/bootstrap/$(PLATFORM)-$(ADRSIZE)$(ALIGNMENT) + + + + +RUNTEST = COMPILER=$(COMPILER) OBECOMP="$(OBECOMP) -O$(MODEL)" FLAVOUR=$(FLAVOUR) BRANCH=$(BRANCH) sh ./test.sh "$(INSTALLDIR)" + +confidence: + @printf "\n\n--- Confidence tests ---\n\n" + cd src/test/confidence/hello; $(RUNTEST) + cd src/test/confidence/intsyntax; $(RUNTEST) + cd src/test/confidence/language; $(RUNTEST) + cd src/test/confidence/texts; $(RUNTEST) + cd src/test/confidence/library; $(RUNTEST) + cd src/test/confidence/lola; $(RUNTEST) + cd src/test/confidence/arrayassignment; $(RUNTEST) + if [ "$(PLATFORM)" != "windows" ] ; then cd src/test/confidence/signal; $(RUNTEST); fi + @printf "\n\n--- Confidence tests passed ---\n\n" diff --git a/src/tools/make/vishap.make b/src/tools/make/vishap.make deleted file mode 100644 index b863944a..00000000 --- a/src/tools/make/vishap.make +++ /dev/null @@ -1,379 +0,0 @@ -# DO NOT RUN THIS MAKEFILE DIRECTLY. -# -# Always use the makefile in the root of the enlistment. This makefile -# depends on up to date configuration files generated by the root makefile. - - - - -# Be independent of any CFLAGS settings in the calling environment -CFLAGS = - -# Gnu make has the make initial directory in CURDIR, BSD make has it in .CURDIR. -ROOTDIR = $(CURDIR)$(.CURDIR) - -# Configuration.Make is created by src/tools/make/configure.c, which is run on -# *every* build by the makefile in the enlistment root. -include ./Configuration.Make - -FLAVOUR = $(OS).$(DATAMODEL).$(COMPILER) -BUILDDIR = build/$(FLAVOUR) -VISHAP = $(ONAME)$(BINEXT) - -MODEL=-O2 # Override model - build everything as S8,I16,L32. - - - -# Default make target - explain usage -usage: - @echo "" - @echo Do not run this makefile directly, always run the makefile in - @echo the root of the enlistment. - - - - -clean: - @printf "\n\n--- Cleaning branch $(BRANCH) $(OS) $(COMPILER) $(DATAMODEL) ---\n\n" - rm -rf $(BUILDDIR) - rm -f $(VISHAP) - - - - -# Assemble: Generate the Vishap Oberon compiler binary by compiling the C sources in the build directory - -assemble: - @printf "\nmake assemble - compiling Oberon compiler c source:\n" - @printf " VERSION: %s\n" "$(VERSION)" - @printf " BRANCH: %s\n" "$(BRANCH)" - @printf " Target characteristics:\n" - @printf " PLATFORM: %s\n" "$(PLATFORM)" - @printf " OS: %s\n" "$(OS)" - @printf " BUILDDIR: %s\n" "$(BUILDDIR)" - @printf " INSTALLDIR: %s\n" "$(INSTALLDIR)" - @printf " Oberon characteristics:\n" - @printf " INTSIZE: %s\n" "$(INTSIZE)" - @printf " ADRSIZE: %s\n" "$(ADRSIZE)" - @printf " ALIGNMENT: %s\n" "$(ALIGNMENT)" - @printf " C compiler:\n" - @printf " COMPILER: %s\n" "$(COMPILER)" - @printf " COMPILE: %s\n" "$(COMPILE)" - @printf " DATAMODEL: %s\n" "$(DATAMODEL)" - - cd $(BUILDDIR) && $(COMPILE) -c SYSTEM.c Configuration.c Platform.c Heap.c - cd $(BUILDDIR) && $(COMPILE) -c Console.c Strings.c Modules.c Files.c - cd $(BUILDDIR) && $(COMPILE) -c Reals.c Texts.c vt100.c errors.c - cd $(BUILDDIR) && $(COMPILE) -c OPM.c extTools.c OPS.c OPT.c - cd $(BUILDDIR) && $(COMPILE) -c OPC.c OPV.c OPB.c OPP.c - - cd $(BUILDDIR) && $(COMPILE) $(STATICLINK) Vishap.c -o $(ROOTDIR)/$(VISHAP) \ - SYSTEM.o Configuration.o Platform.o Heap.o Console.o Strings.o Modules.o Files.o \ - Reals.o Texts.o vt100.o errors.o OPM.o extTools.o OPS.o OPT.o \ - OPC.o OPV.o OPB.o OPP.o - - cp src/system/*.[ch] $(BUILDDIR) - @printf "$(VISHAP) created.\n" - - - - -compilerfromsavedsource: - @echo Populating clean build directory from bootstrap C sources. - @mkdir -p $(BUILDDIR) - @cp bootstrap/$(PLATFORM)-$(ADRSIZE)$(ALIGNMENT)/* $(BUILDDIR) - @cp bootstrap/*.[ch] $(BUILDDIR) - @make -f src/tools/make/vishap.make -s assemble - @cp bootstrap/*.[ch] $(BUILDDIR) - - - - -translate: -# Make sure we have an oberon compiler binary: if we built one earlier we'll use it, -# otherwise use one of the pre-prepared sets of C sources in the bootstrap directory. - - if [ ! -e $(VISHAP) ]; then make -f src/tools/make/vishap.make -s compilerfromsavedsource; fi - - @printf "\nmake translate - translating compiler source from Oberon to C:\n" - @printf " PLATFORM: %s\n" $(PLATFORM) - @printf " INTSIZE: %s\n" $(INTSIZE) - @printf " MODEL: %s\n" $(MODEL) - @printf " ADRSIZE: %s\n" $(ADRSIZE) - @printf " ALIGNMENT: %s\n" $(ALIGNMENT) - @mkdir -p $(BUILDDIR) - @rm -f $(BUILDDIR)/*.sym - - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../Configuration.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../src/system/Platform$(PLATFORM).Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfFapx -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../src/system/Heap.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../src/system/Console.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../src/library/v4/Strings.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../src/library/v4/Modules.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfFx -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../src/system/Files.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../src/library/v4/Reals.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../src/library/v4/Texts.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../src/library/misc/vt100.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../src/compiler/errors.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../src/compiler/OPM.cmdln.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../src/compiler/extTools.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfFx -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../src/compiler/OPS.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../src/compiler/OPT.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../src/compiler/OPC.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../src/compiler/OPV.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../src/compiler/OPB.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../src/compiler/OPP.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ssfm -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../src/compiler/Vishap.Mod - - @printf "$(BUILDDIR) filled with compiler C source.\n" - - - - -browsercmd: - @printf "\nMaking symbol browser\n" - @cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -fSm $(MODEL) ../../src/tools/browser/BrowserCmd.Mod - @cd $(BUILDDIR); $(COMPILE) BrowserCmd.c -o showdef \ - Platform.o Texts.o OPT.o Heap.o Console.o SYSTEM.o OPM.o OPS.o OPV.o \ - Files.o Reals.o Modules.o vt100.o errors.o Configuration.o Strings.o \ - OPC.o - - - - -FORCE: - -# installable: Check for access to the installation directory - -installable: - @rm -rf "S(INSTALLDIR)/test-access-qqq" - @if ! mkdir -p "$(INSTALLDIR)/test-access-qqq";then echo "\\n\\n Cannot write to install directory.\\n Please use sudo or run as root/administrator.\\n\\n"; exit 1;fi - @rm -rf "S(INSTALLDIR)/test-access-qqq" - - - - -# install: Use only after a successful full build. Installs the compiler -# and libraries in /opt/$(ONAME). -# May require root access. -install: - @printf "\nInstalling into \"$(INSTALLDIR)\"\n" - @rm -rf "$(INSTALLDIR)" - @mkdir -p "$(INSTALLDIR)/bin" "$(INSTALLDIR)/include" "$(INSTALLDIR)/sym" "$(INSTALLDIR)/lib" - @cp $(BUILDDIR)/*.h "$(INSTALLDIR)/include/" - @cp $(BUILDDIR)/*.sym "$(INSTALLDIR)/sym/" - @cp $(VISHAP) "$(INSTALLDIR)/bin/$(VISHAP)" - @-cp $(BUILDDIR)/showdef$(BINEXT) "$(INSTALLDIR)/bin" - @cp $(BUILDDIR)/lib$(ONAME).* "$(INSTALLDIR)/lib/" - @if which ldconfig >/dev/null 2>&1; then $(LDCONFIG); fi - - -# showpath: Describe how to set the PATH variable -showpath: - @printf "\nNow add $(INSTALLDIR)/bin to your path, for example with the command:\n" - @printf "export PATH=\"$(INSTALLDIR)/bin:\$$PATH\"\n" - @printf "\n" - - - - -uninstall: - @printf "\nUninstalling from \"$(INSTALLDIR)\"\n" - rm -rf "$(INSTALLDIR)" - rm -f /etc/ld.so.conf/lib$(ONAME) - if which ldconfig >/dev/null 2>&1; then ldconfig; fi - - - - -v4: - @printf "\nMaking v4 library\n" - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/v4/Args.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/v4/Printer.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/v4/Sets.Mod - -ooc2: - @printf "\nMaking ooc2 library\n" - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc2/ooc2Strings.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc2/ooc2Ascii.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc2/ooc2CharClass.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc2/ooc2ConvTypes.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc2/ooc2IntConv.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc2/ooc2IntStr.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc2/ooc2Real0.Mod - - -TODO: Comment disabled lines contain use of VAL that reads beyond source variable - -ooc: - @printf "\nMaking ooc library\n" - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocLowReal.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocLowLReal.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocRealMath.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocOakMath.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocLRealMath.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocLongInts.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocComplexMath.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocLComplexMath.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocAscii.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocCharClass.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocStrings.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocConvTypes.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocLRealConv.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocLRealStr.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocRealConv.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocRealStr.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocIntConv.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocIntStr.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocMsg.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocSysClock.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocTime.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocChannel.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocStrings2.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocRts.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocFilenames.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocTextRider.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocBinaryRider.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocJulianDay.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocFilenames.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocwrapperlibc.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocC$(DATAMODEL).Mod - -oocX11: - @printf "\nMaking oocX11 library\n" - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/oocX11/oocX11.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/oocX11/oocXutil.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/oocX11/oocXYplane.Mod - -ulm: - @printf "\nMaking ulm library\n" - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmObjects.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmPriorities.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmDisciplines.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmServices.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmSys.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmSYSTEM.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmEvents.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmProcess.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmResources.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmForwarders.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmRelatedEvents.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmTypes.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmStreams.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmStrings.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmSysTypes.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmTexts.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmSysConversions.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmErrors.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmSysErrors.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmSysStat.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmASCII.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmSets.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmIO.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmAssertions.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmIndirectDisciplines.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmStreamDisciplines.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmIEEE.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmMC68881.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmReals.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmPrint.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmWrite.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmConstStrings.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmPlotters.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmSysIO.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmLoader.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmNetIO.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmPersistentObjects.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmPersistentDisciplines.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmOperations.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmScales.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmTimes.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmClocks.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmTimers.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmConditions.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmStreamConditions.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmTimeConditions.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmCiphers.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmCipherOps.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmBlockCiphers.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmAsymmetricCiphers.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmConclusions.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmRandomGenerators.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmTCrypt.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmIntOperations.Mod - -pow32: - @printf "\nMaking pow library\n" - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/pow/powStrings.Mod - -misc: - @printf "\nMaking misc library\n" - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/system/Oberon.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/misc/crt.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/misc/Listen.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/misc/MersenneTwister.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/misc/MultiArrays.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/misc/MultiArrayRiders.Mod - -s3: - @printf "\nMaking s3 library\n" - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/s3/ethBTrees.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/s3/ethMD5.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/s3/ethSets.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/s3/ethZlib.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/s3/ethZlibBuffers.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/s3/ethZlibInflate.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/s3/ethZlibDeflate.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/s3/ethZlibReaders.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/s3/ethZlibWriters.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/s3/ethZip.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/s3/ethRandomNumbers.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/s3/ethGZReaders.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/s3/ethGZWriters.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/s3/ethUnicode.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/s3/ethDates.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/s3/ethReals.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/s3/ethStrings.Mod - -librarybinary: - @printf "\nMaking lib$(ONAME)\n" - -# Remove objects that should not be part of the library - rm -f $(BUILDDIR)/vishap.o - -# Note: remining compiler files are retained in the library allowing the building -# of utilities like BrowserCmd.Mod (aka showdef). - -# Make static library - ar rcs "$(BUILDDIR)/lib$(ONAME).a" $(BUILDDIR)/*.o - -# Make shared library - @cd $(BUILDDIR) && $(COMPILE) -shared -o lib$(ONAME).so *.o - - - - -library: v4 ooc2 ooc ulm pow32 misc s3 librarybinary - - - - -sourcechanges: - @cd $(BUILDDIR) && sh $(ROOTDIR)/src/tools/make/sourcechanges.sh $(ROOTDIR)/bootstrap/$(PLATFORM)-$(ADRSIZE)$(ALIGNMENT) - - - - -RUNTEST = COMPILER=$(COMPILER) OBECOMP=$(VISHAP) FLAVOUR=$(FLAVOUR) BRANCH=$(BRANCH) sh ./test.sh "$(INSTALLDIR)" - -confidence: - @printf "\n\n--- Confidence tests ---\n\n" - cd src/test/confidence/hello; $(RUNTEST) - cd src/test/confidence/intsyntax; $(RUNTEST) - cd src/test/confidence/language; $(RUNTEST) - cd src/test/confidence/texts; $(RUNTEST) - cd src/test/confidence/library; $(RUNTEST) - cd src/test/confidence/lola; $(RUNTEST) - cd src/test/confidence/arrayassignment; $(RUNTEST) - if [ "$(PLATFORM)" != "windows" ] ; then cd src/test/confidence/signal; $(RUNTEST); fi - @printf "\n\n--- Confidence tests passed ---\n\n" From 4bc697f49da652c38b43af2198cb6f03ea3bd613 Mon Sep 17 00:00:00 2001 From: David Brown Date: Sun, 25 Sep 2016 15:36:00 +0100 Subject: [PATCH 254/580] Add files missed on last commit. --- bootstrap/unix-44/Compiler.c | 174 ++++++++++++++++++++++++++++++++ bootstrap/unix-48/Compiler.c | 174 ++++++++++++++++++++++++++++++++ bootstrap/unix-88/Compiler.c | 174 ++++++++++++++++++++++++++++++++ bootstrap/windows-48/Compiler.c | 174 ++++++++++++++++++++++++++++++++ bootstrap/windows-88/Compiler.c | 174 ++++++++++++++++++++++++++++++++ 5 files changed, 870 insertions(+) create mode 100644 bootstrap/unix-44/Compiler.c create mode 100644 bootstrap/unix-48/Compiler.c create mode 100644 bootstrap/unix-88/Compiler.c create mode 100644 bootstrap/windows-48/Compiler.c create mode 100644 bootstrap/windows-88/Compiler.c diff --git a/bootstrap/unix-44/Compiler.c b/bootstrap/unix-44/Compiler.c new file mode 100644 index 00000000..6444021c --- /dev/null +++ b/bootstrap/unix-44/Compiler.c @@ -0,0 +1,174 @@ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + +#include "SYSTEM.h" +#include "Configuration.h" +#include "Heap.h" +#include "OPB.h" +#include "OPC.h" +#include "OPM.h" +#include "OPP.h" +#include "OPT.h" +#include "OPV.h" +#include "Platform.h" +#include "Strings.h" +#include "extTools.h" +#include "vt100.h" + + +static CHAR Compiler_mname[256]; + + +export void Compiler_Module (BOOLEAN *done); +static void Compiler_PropagateElementaryTypeSizes (void); +export void Compiler_Translate (void); +static void Compiler_Trap (int16 sig); + + +void Compiler_Module (BOOLEAN *done) +{ + BOOLEAN ext, new; + OPT_Node p = NIL; + OPP_Module(&p, OPM_opt); + if (OPM_noerr) { + OPV_Init(); + OPT_InitRecno(); + OPV_AdrAndSize(OPT_topScope); + OPT_Export(&ext, &new); + if (OPM_noerr) { + OPM_OpenFiles((void*)OPT_SelfName, 256); + OPC_Init(); + OPV_Module(p); + if (OPM_noerr) { + if ((__IN(10, OPM_opt, 32) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { + OPM_DeleteNewSym(); + if (!__IN(16, OPM_opt, 32)) { + vt100_SetAttr((CHAR*)"32m", 4); + } + OPM_LogWStr((CHAR*)" Main program.", 16); + if (!__IN(16, OPM_opt, 32)) { + vt100_SetAttr((CHAR*)"0m", 3); + } + } else { + if (new) { + if (!__IN(16, OPM_opt, 32)) { + vt100_SetAttr((CHAR*)"32m", 4); + } + OPM_LogWStr((CHAR*)" New symbol file.", 19); + if (!__IN(16, OPM_opt, 32)) { + vt100_SetAttr((CHAR*)"0m", 3); + } + OPM_RegisterNewSym(); + } else if (ext) { + OPM_LogWStr((CHAR*)" Extended symbol file.", 24); + OPM_RegisterNewSym(); + } + } + } else { + OPM_DeleteNewSym(); + } + } + } + OPM_CloseFiles(); + OPT_Close(); + OPM_LogWLn(); + *done = OPM_noerr; +} + +static void Compiler_PropagateElementaryTypeSizes (void) +{ + OPT_Struct adrinttyp = NIL; + OPT_sysptrtyp->size = OPM_AddressSize; + OPT_adrtyp->size = OPM_AddressSize; + OPT_settyp->size = OPM_SetSize; + adrinttyp = OPT_IntType(OPM_AddressSize); + OPT_adrtyp->strobj = adrinttyp->strobj; + OPT_sinttyp = OPT_IntType(OPM_ShortintSize); + OPT_inttyp = OPT_IntType(OPM_IntegerSize); + OPT_linttyp = OPT_IntType(OPM_LongintSize); + OPT_sintobj->typ = OPT_sinttyp; + OPT_intobj->typ = OPT_inttyp; + OPT_lintobj->typ = OPT_linttyp; +} + +void Compiler_Translate (void) +{ + BOOLEAN done; + CHAR modulesobj[2048]; + modulesobj[0] = 0x00; + if (OPM_OpenPar()) { + for (;;) { + OPM_Init(&done, (void*)Compiler_mname, 256); + if (!done) { + return; + } + OPM_InitOptions(); + Compiler_PropagateElementaryTypeSizes(); + Heap_GC(0); + Compiler_Module(&done); + if (!done) { + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Module compilation failed.", 27); + OPM_LogWLn(); + Platform_Exit(1); + } + if (!__IN(13, OPM_opt, 32)) { + if (__IN(14, OPM_opt, 32)) { + extTools_Assemble(OPM_modName, 32); + } else { + if (!__IN(10, OPM_opt, 32)) { + extTools_Assemble(OPM_modName, 32); + Strings_Append((CHAR*)" ", 2, (void*)modulesobj, 2048); + Strings_Append(OPM_modName, 32, (void*)modulesobj, 2048); + Strings_Append((CHAR*)".o", 3, (void*)modulesobj, 2048); + } else { + extTools_LinkMain((void*)OPM_modName, 32, __IN(15, OPM_opt, 32), modulesobj, 2048); + } + } + } + } + } +} + +static void Compiler_Trap (int16 sig) +{ + Heap_FINALL(); + if (sig == 3) { + Platform_Exit(0); + } else { + if ((sig == 4 && Platform_HaltCode == -15)) { + OPM_LogWStr((CHAR*)" --- Oberon compiler internal error", 36); + OPM_LogWLn(); + } + Platform_Exit(2); + } +} + + +export int main(int argc, char **argv) +{ + __INIT(argc, argv); + __MODULE_IMPORT(Configuration); + __MODULE_IMPORT(Heap); + __MODULE_IMPORT(OPB); + __MODULE_IMPORT(OPC); + __MODULE_IMPORT(OPM); + __MODULE_IMPORT(OPP); + __MODULE_IMPORT(OPT); + __MODULE_IMPORT(OPV); + __MODULE_IMPORT(Platform); + __MODULE_IMPORT(Strings); + __MODULE_IMPORT(extTools); + __MODULE_IMPORT(vt100); + __REGMAIN("Compiler", 0); + __REGCMD("Translate", Compiler_Translate); +/* BEGIN */ + Platform_SetInterruptHandler(Compiler_Trap); + Platform_SetQuitHandler(Compiler_Trap); + Platform_SetBadInstructionHandler(Compiler_Trap); + Compiler_Translate(); + __FINI; +} diff --git a/bootstrap/unix-48/Compiler.c b/bootstrap/unix-48/Compiler.c new file mode 100644 index 00000000..6444021c --- /dev/null +++ b/bootstrap/unix-48/Compiler.c @@ -0,0 +1,174 @@ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + +#include "SYSTEM.h" +#include "Configuration.h" +#include "Heap.h" +#include "OPB.h" +#include "OPC.h" +#include "OPM.h" +#include "OPP.h" +#include "OPT.h" +#include "OPV.h" +#include "Platform.h" +#include "Strings.h" +#include "extTools.h" +#include "vt100.h" + + +static CHAR Compiler_mname[256]; + + +export void Compiler_Module (BOOLEAN *done); +static void Compiler_PropagateElementaryTypeSizes (void); +export void Compiler_Translate (void); +static void Compiler_Trap (int16 sig); + + +void Compiler_Module (BOOLEAN *done) +{ + BOOLEAN ext, new; + OPT_Node p = NIL; + OPP_Module(&p, OPM_opt); + if (OPM_noerr) { + OPV_Init(); + OPT_InitRecno(); + OPV_AdrAndSize(OPT_topScope); + OPT_Export(&ext, &new); + if (OPM_noerr) { + OPM_OpenFiles((void*)OPT_SelfName, 256); + OPC_Init(); + OPV_Module(p); + if (OPM_noerr) { + if ((__IN(10, OPM_opt, 32) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { + OPM_DeleteNewSym(); + if (!__IN(16, OPM_opt, 32)) { + vt100_SetAttr((CHAR*)"32m", 4); + } + OPM_LogWStr((CHAR*)" Main program.", 16); + if (!__IN(16, OPM_opt, 32)) { + vt100_SetAttr((CHAR*)"0m", 3); + } + } else { + if (new) { + if (!__IN(16, OPM_opt, 32)) { + vt100_SetAttr((CHAR*)"32m", 4); + } + OPM_LogWStr((CHAR*)" New symbol file.", 19); + if (!__IN(16, OPM_opt, 32)) { + vt100_SetAttr((CHAR*)"0m", 3); + } + OPM_RegisterNewSym(); + } else if (ext) { + OPM_LogWStr((CHAR*)" Extended symbol file.", 24); + OPM_RegisterNewSym(); + } + } + } else { + OPM_DeleteNewSym(); + } + } + } + OPM_CloseFiles(); + OPT_Close(); + OPM_LogWLn(); + *done = OPM_noerr; +} + +static void Compiler_PropagateElementaryTypeSizes (void) +{ + OPT_Struct adrinttyp = NIL; + OPT_sysptrtyp->size = OPM_AddressSize; + OPT_adrtyp->size = OPM_AddressSize; + OPT_settyp->size = OPM_SetSize; + adrinttyp = OPT_IntType(OPM_AddressSize); + OPT_adrtyp->strobj = adrinttyp->strobj; + OPT_sinttyp = OPT_IntType(OPM_ShortintSize); + OPT_inttyp = OPT_IntType(OPM_IntegerSize); + OPT_linttyp = OPT_IntType(OPM_LongintSize); + OPT_sintobj->typ = OPT_sinttyp; + OPT_intobj->typ = OPT_inttyp; + OPT_lintobj->typ = OPT_linttyp; +} + +void Compiler_Translate (void) +{ + BOOLEAN done; + CHAR modulesobj[2048]; + modulesobj[0] = 0x00; + if (OPM_OpenPar()) { + for (;;) { + OPM_Init(&done, (void*)Compiler_mname, 256); + if (!done) { + return; + } + OPM_InitOptions(); + Compiler_PropagateElementaryTypeSizes(); + Heap_GC(0); + Compiler_Module(&done); + if (!done) { + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Module compilation failed.", 27); + OPM_LogWLn(); + Platform_Exit(1); + } + if (!__IN(13, OPM_opt, 32)) { + if (__IN(14, OPM_opt, 32)) { + extTools_Assemble(OPM_modName, 32); + } else { + if (!__IN(10, OPM_opt, 32)) { + extTools_Assemble(OPM_modName, 32); + Strings_Append((CHAR*)" ", 2, (void*)modulesobj, 2048); + Strings_Append(OPM_modName, 32, (void*)modulesobj, 2048); + Strings_Append((CHAR*)".o", 3, (void*)modulesobj, 2048); + } else { + extTools_LinkMain((void*)OPM_modName, 32, __IN(15, OPM_opt, 32), modulesobj, 2048); + } + } + } + } + } +} + +static void Compiler_Trap (int16 sig) +{ + Heap_FINALL(); + if (sig == 3) { + Platform_Exit(0); + } else { + if ((sig == 4 && Platform_HaltCode == -15)) { + OPM_LogWStr((CHAR*)" --- Oberon compiler internal error", 36); + OPM_LogWLn(); + } + Platform_Exit(2); + } +} + + +export int main(int argc, char **argv) +{ + __INIT(argc, argv); + __MODULE_IMPORT(Configuration); + __MODULE_IMPORT(Heap); + __MODULE_IMPORT(OPB); + __MODULE_IMPORT(OPC); + __MODULE_IMPORT(OPM); + __MODULE_IMPORT(OPP); + __MODULE_IMPORT(OPT); + __MODULE_IMPORT(OPV); + __MODULE_IMPORT(Platform); + __MODULE_IMPORT(Strings); + __MODULE_IMPORT(extTools); + __MODULE_IMPORT(vt100); + __REGMAIN("Compiler", 0); + __REGCMD("Translate", Compiler_Translate); +/* BEGIN */ + Platform_SetInterruptHandler(Compiler_Trap); + Platform_SetQuitHandler(Compiler_Trap); + Platform_SetBadInstructionHandler(Compiler_Trap); + Compiler_Translate(); + __FINI; +} diff --git a/bootstrap/unix-88/Compiler.c b/bootstrap/unix-88/Compiler.c new file mode 100644 index 00000000..6444021c --- /dev/null +++ b/bootstrap/unix-88/Compiler.c @@ -0,0 +1,174 @@ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + +#include "SYSTEM.h" +#include "Configuration.h" +#include "Heap.h" +#include "OPB.h" +#include "OPC.h" +#include "OPM.h" +#include "OPP.h" +#include "OPT.h" +#include "OPV.h" +#include "Platform.h" +#include "Strings.h" +#include "extTools.h" +#include "vt100.h" + + +static CHAR Compiler_mname[256]; + + +export void Compiler_Module (BOOLEAN *done); +static void Compiler_PropagateElementaryTypeSizes (void); +export void Compiler_Translate (void); +static void Compiler_Trap (int16 sig); + + +void Compiler_Module (BOOLEAN *done) +{ + BOOLEAN ext, new; + OPT_Node p = NIL; + OPP_Module(&p, OPM_opt); + if (OPM_noerr) { + OPV_Init(); + OPT_InitRecno(); + OPV_AdrAndSize(OPT_topScope); + OPT_Export(&ext, &new); + if (OPM_noerr) { + OPM_OpenFiles((void*)OPT_SelfName, 256); + OPC_Init(); + OPV_Module(p); + if (OPM_noerr) { + if ((__IN(10, OPM_opt, 32) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { + OPM_DeleteNewSym(); + if (!__IN(16, OPM_opt, 32)) { + vt100_SetAttr((CHAR*)"32m", 4); + } + OPM_LogWStr((CHAR*)" Main program.", 16); + if (!__IN(16, OPM_opt, 32)) { + vt100_SetAttr((CHAR*)"0m", 3); + } + } else { + if (new) { + if (!__IN(16, OPM_opt, 32)) { + vt100_SetAttr((CHAR*)"32m", 4); + } + OPM_LogWStr((CHAR*)" New symbol file.", 19); + if (!__IN(16, OPM_opt, 32)) { + vt100_SetAttr((CHAR*)"0m", 3); + } + OPM_RegisterNewSym(); + } else if (ext) { + OPM_LogWStr((CHAR*)" Extended symbol file.", 24); + OPM_RegisterNewSym(); + } + } + } else { + OPM_DeleteNewSym(); + } + } + } + OPM_CloseFiles(); + OPT_Close(); + OPM_LogWLn(); + *done = OPM_noerr; +} + +static void Compiler_PropagateElementaryTypeSizes (void) +{ + OPT_Struct adrinttyp = NIL; + OPT_sysptrtyp->size = OPM_AddressSize; + OPT_adrtyp->size = OPM_AddressSize; + OPT_settyp->size = OPM_SetSize; + adrinttyp = OPT_IntType(OPM_AddressSize); + OPT_adrtyp->strobj = adrinttyp->strobj; + OPT_sinttyp = OPT_IntType(OPM_ShortintSize); + OPT_inttyp = OPT_IntType(OPM_IntegerSize); + OPT_linttyp = OPT_IntType(OPM_LongintSize); + OPT_sintobj->typ = OPT_sinttyp; + OPT_intobj->typ = OPT_inttyp; + OPT_lintobj->typ = OPT_linttyp; +} + +void Compiler_Translate (void) +{ + BOOLEAN done; + CHAR modulesobj[2048]; + modulesobj[0] = 0x00; + if (OPM_OpenPar()) { + for (;;) { + OPM_Init(&done, (void*)Compiler_mname, 256); + if (!done) { + return; + } + OPM_InitOptions(); + Compiler_PropagateElementaryTypeSizes(); + Heap_GC(0); + Compiler_Module(&done); + if (!done) { + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Module compilation failed.", 27); + OPM_LogWLn(); + Platform_Exit(1); + } + if (!__IN(13, OPM_opt, 32)) { + if (__IN(14, OPM_opt, 32)) { + extTools_Assemble(OPM_modName, 32); + } else { + if (!__IN(10, OPM_opt, 32)) { + extTools_Assemble(OPM_modName, 32); + Strings_Append((CHAR*)" ", 2, (void*)modulesobj, 2048); + Strings_Append(OPM_modName, 32, (void*)modulesobj, 2048); + Strings_Append((CHAR*)".o", 3, (void*)modulesobj, 2048); + } else { + extTools_LinkMain((void*)OPM_modName, 32, __IN(15, OPM_opt, 32), modulesobj, 2048); + } + } + } + } + } +} + +static void Compiler_Trap (int16 sig) +{ + Heap_FINALL(); + if (sig == 3) { + Platform_Exit(0); + } else { + if ((sig == 4 && Platform_HaltCode == -15)) { + OPM_LogWStr((CHAR*)" --- Oberon compiler internal error", 36); + OPM_LogWLn(); + } + Platform_Exit(2); + } +} + + +export int main(int argc, char **argv) +{ + __INIT(argc, argv); + __MODULE_IMPORT(Configuration); + __MODULE_IMPORT(Heap); + __MODULE_IMPORT(OPB); + __MODULE_IMPORT(OPC); + __MODULE_IMPORT(OPM); + __MODULE_IMPORT(OPP); + __MODULE_IMPORT(OPT); + __MODULE_IMPORT(OPV); + __MODULE_IMPORT(Platform); + __MODULE_IMPORT(Strings); + __MODULE_IMPORT(extTools); + __MODULE_IMPORT(vt100); + __REGMAIN("Compiler", 0); + __REGCMD("Translate", Compiler_Translate); +/* BEGIN */ + Platform_SetInterruptHandler(Compiler_Trap); + Platform_SetQuitHandler(Compiler_Trap); + Platform_SetBadInstructionHandler(Compiler_Trap); + Compiler_Translate(); + __FINI; +} diff --git a/bootstrap/windows-48/Compiler.c b/bootstrap/windows-48/Compiler.c new file mode 100644 index 00000000..6444021c --- /dev/null +++ b/bootstrap/windows-48/Compiler.c @@ -0,0 +1,174 @@ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + +#include "SYSTEM.h" +#include "Configuration.h" +#include "Heap.h" +#include "OPB.h" +#include "OPC.h" +#include "OPM.h" +#include "OPP.h" +#include "OPT.h" +#include "OPV.h" +#include "Platform.h" +#include "Strings.h" +#include "extTools.h" +#include "vt100.h" + + +static CHAR Compiler_mname[256]; + + +export void Compiler_Module (BOOLEAN *done); +static void Compiler_PropagateElementaryTypeSizes (void); +export void Compiler_Translate (void); +static void Compiler_Trap (int16 sig); + + +void Compiler_Module (BOOLEAN *done) +{ + BOOLEAN ext, new; + OPT_Node p = NIL; + OPP_Module(&p, OPM_opt); + if (OPM_noerr) { + OPV_Init(); + OPT_InitRecno(); + OPV_AdrAndSize(OPT_topScope); + OPT_Export(&ext, &new); + if (OPM_noerr) { + OPM_OpenFiles((void*)OPT_SelfName, 256); + OPC_Init(); + OPV_Module(p); + if (OPM_noerr) { + if ((__IN(10, OPM_opt, 32) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { + OPM_DeleteNewSym(); + if (!__IN(16, OPM_opt, 32)) { + vt100_SetAttr((CHAR*)"32m", 4); + } + OPM_LogWStr((CHAR*)" Main program.", 16); + if (!__IN(16, OPM_opt, 32)) { + vt100_SetAttr((CHAR*)"0m", 3); + } + } else { + if (new) { + if (!__IN(16, OPM_opt, 32)) { + vt100_SetAttr((CHAR*)"32m", 4); + } + OPM_LogWStr((CHAR*)" New symbol file.", 19); + if (!__IN(16, OPM_opt, 32)) { + vt100_SetAttr((CHAR*)"0m", 3); + } + OPM_RegisterNewSym(); + } else if (ext) { + OPM_LogWStr((CHAR*)" Extended symbol file.", 24); + OPM_RegisterNewSym(); + } + } + } else { + OPM_DeleteNewSym(); + } + } + } + OPM_CloseFiles(); + OPT_Close(); + OPM_LogWLn(); + *done = OPM_noerr; +} + +static void Compiler_PropagateElementaryTypeSizes (void) +{ + OPT_Struct adrinttyp = NIL; + OPT_sysptrtyp->size = OPM_AddressSize; + OPT_adrtyp->size = OPM_AddressSize; + OPT_settyp->size = OPM_SetSize; + adrinttyp = OPT_IntType(OPM_AddressSize); + OPT_adrtyp->strobj = adrinttyp->strobj; + OPT_sinttyp = OPT_IntType(OPM_ShortintSize); + OPT_inttyp = OPT_IntType(OPM_IntegerSize); + OPT_linttyp = OPT_IntType(OPM_LongintSize); + OPT_sintobj->typ = OPT_sinttyp; + OPT_intobj->typ = OPT_inttyp; + OPT_lintobj->typ = OPT_linttyp; +} + +void Compiler_Translate (void) +{ + BOOLEAN done; + CHAR modulesobj[2048]; + modulesobj[0] = 0x00; + if (OPM_OpenPar()) { + for (;;) { + OPM_Init(&done, (void*)Compiler_mname, 256); + if (!done) { + return; + } + OPM_InitOptions(); + Compiler_PropagateElementaryTypeSizes(); + Heap_GC(0); + Compiler_Module(&done); + if (!done) { + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Module compilation failed.", 27); + OPM_LogWLn(); + Platform_Exit(1); + } + if (!__IN(13, OPM_opt, 32)) { + if (__IN(14, OPM_opt, 32)) { + extTools_Assemble(OPM_modName, 32); + } else { + if (!__IN(10, OPM_opt, 32)) { + extTools_Assemble(OPM_modName, 32); + Strings_Append((CHAR*)" ", 2, (void*)modulesobj, 2048); + Strings_Append(OPM_modName, 32, (void*)modulesobj, 2048); + Strings_Append((CHAR*)".o", 3, (void*)modulesobj, 2048); + } else { + extTools_LinkMain((void*)OPM_modName, 32, __IN(15, OPM_opt, 32), modulesobj, 2048); + } + } + } + } + } +} + +static void Compiler_Trap (int16 sig) +{ + Heap_FINALL(); + if (sig == 3) { + Platform_Exit(0); + } else { + if ((sig == 4 && Platform_HaltCode == -15)) { + OPM_LogWStr((CHAR*)" --- Oberon compiler internal error", 36); + OPM_LogWLn(); + } + Platform_Exit(2); + } +} + + +export int main(int argc, char **argv) +{ + __INIT(argc, argv); + __MODULE_IMPORT(Configuration); + __MODULE_IMPORT(Heap); + __MODULE_IMPORT(OPB); + __MODULE_IMPORT(OPC); + __MODULE_IMPORT(OPM); + __MODULE_IMPORT(OPP); + __MODULE_IMPORT(OPT); + __MODULE_IMPORT(OPV); + __MODULE_IMPORT(Platform); + __MODULE_IMPORT(Strings); + __MODULE_IMPORT(extTools); + __MODULE_IMPORT(vt100); + __REGMAIN("Compiler", 0); + __REGCMD("Translate", Compiler_Translate); +/* BEGIN */ + Platform_SetInterruptHandler(Compiler_Trap); + Platform_SetQuitHandler(Compiler_Trap); + Platform_SetBadInstructionHandler(Compiler_Trap); + Compiler_Translate(); + __FINI; +} diff --git a/bootstrap/windows-88/Compiler.c b/bootstrap/windows-88/Compiler.c new file mode 100644 index 00000000..6444021c --- /dev/null +++ b/bootstrap/windows-88/Compiler.c @@ -0,0 +1,174 @@ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + +#include "SYSTEM.h" +#include "Configuration.h" +#include "Heap.h" +#include "OPB.h" +#include "OPC.h" +#include "OPM.h" +#include "OPP.h" +#include "OPT.h" +#include "OPV.h" +#include "Platform.h" +#include "Strings.h" +#include "extTools.h" +#include "vt100.h" + + +static CHAR Compiler_mname[256]; + + +export void Compiler_Module (BOOLEAN *done); +static void Compiler_PropagateElementaryTypeSizes (void); +export void Compiler_Translate (void); +static void Compiler_Trap (int16 sig); + + +void Compiler_Module (BOOLEAN *done) +{ + BOOLEAN ext, new; + OPT_Node p = NIL; + OPP_Module(&p, OPM_opt); + if (OPM_noerr) { + OPV_Init(); + OPT_InitRecno(); + OPV_AdrAndSize(OPT_topScope); + OPT_Export(&ext, &new); + if (OPM_noerr) { + OPM_OpenFiles((void*)OPT_SelfName, 256); + OPC_Init(); + OPV_Module(p); + if (OPM_noerr) { + if ((__IN(10, OPM_opt, 32) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { + OPM_DeleteNewSym(); + if (!__IN(16, OPM_opt, 32)) { + vt100_SetAttr((CHAR*)"32m", 4); + } + OPM_LogWStr((CHAR*)" Main program.", 16); + if (!__IN(16, OPM_opt, 32)) { + vt100_SetAttr((CHAR*)"0m", 3); + } + } else { + if (new) { + if (!__IN(16, OPM_opt, 32)) { + vt100_SetAttr((CHAR*)"32m", 4); + } + OPM_LogWStr((CHAR*)" New symbol file.", 19); + if (!__IN(16, OPM_opt, 32)) { + vt100_SetAttr((CHAR*)"0m", 3); + } + OPM_RegisterNewSym(); + } else if (ext) { + OPM_LogWStr((CHAR*)" Extended symbol file.", 24); + OPM_RegisterNewSym(); + } + } + } else { + OPM_DeleteNewSym(); + } + } + } + OPM_CloseFiles(); + OPT_Close(); + OPM_LogWLn(); + *done = OPM_noerr; +} + +static void Compiler_PropagateElementaryTypeSizes (void) +{ + OPT_Struct adrinttyp = NIL; + OPT_sysptrtyp->size = OPM_AddressSize; + OPT_adrtyp->size = OPM_AddressSize; + OPT_settyp->size = OPM_SetSize; + adrinttyp = OPT_IntType(OPM_AddressSize); + OPT_adrtyp->strobj = adrinttyp->strobj; + OPT_sinttyp = OPT_IntType(OPM_ShortintSize); + OPT_inttyp = OPT_IntType(OPM_IntegerSize); + OPT_linttyp = OPT_IntType(OPM_LongintSize); + OPT_sintobj->typ = OPT_sinttyp; + OPT_intobj->typ = OPT_inttyp; + OPT_lintobj->typ = OPT_linttyp; +} + +void Compiler_Translate (void) +{ + BOOLEAN done; + CHAR modulesobj[2048]; + modulesobj[0] = 0x00; + if (OPM_OpenPar()) { + for (;;) { + OPM_Init(&done, (void*)Compiler_mname, 256); + if (!done) { + return; + } + OPM_InitOptions(); + Compiler_PropagateElementaryTypeSizes(); + Heap_GC(0); + Compiler_Module(&done); + if (!done) { + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Module compilation failed.", 27); + OPM_LogWLn(); + Platform_Exit(1); + } + if (!__IN(13, OPM_opt, 32)) { + if (__IN(14, OPM_opt, 32)) { + extTools_Assemble(OPM_modName, 32); + } else { + if (!__IN(10, OPM_opt, 32)) { + extTools_Assemble(OPM_modName, 32); + Strings_Append((CHAR*)" ", 2, (void*)modulesobj, 2048); + Strings_Append(OPM_modName, 32, (void*)modulesobj, 2048); + Strings_Append((CHAR*)".o", 3, (void*)modulesobj, 2048); + } else { + extTools_LinkMain((void*)OPM_modName, 32, __IN(15, OPM_opt, 32), modulesobj, 2048); + } + } + } + } + } +} + +static void Compiler_Trap (int16 sig) +{ + Heap_FINALL(); + if (sig == 3) { + Platform_Exit(0); + } else { + if ((sig == 4 && Platform_HaltCode == -15)) { + OPM_LogWStr((CHAR*)" --- Oberon compiler internal error", 36); + OPM_LogWLn(); + } + Platform_Exit(2); + } +} + + +export int main(int argc, char **argv) +{ + __INIT(argc, argv); + __MODULE_IMPORT(Configuration); + __MODULE_IMPORT(Heap); + __MODULE_IMPORT(OPB); + __MODULE_IMPORT(OPC); + __MODULE_IMPORT(OPM); + __MODULE_IMPORT(OPP); + __MODULE_IMPORT(OPT); + __MODULE_IMPORT(OPV); + __MODULE_IMPORT(Platform); + __MODULE_IMPORT(Strings); + __MODULE_IMPORT(extTools); + __MODULE_IMPORT(vt100); + __REGMAIN("Compiler", 0); + __REGCMD("Translate", Compiler_Translate); +/* BEGIN */ + Platform_SetInterruptHandler(Compiler_Trap); + Platform_SetQuitHandler(Compiler_Trap); + Platform_SetBadInstructionHandler(Compiler_Trap); + Compiler_Translate(); + __FINI; +} From a6f0088299f3edae28bf86eb67998e074b27a899 Mon Sep 17 00:00:00 2001 From: David Brown Date: Sun, 25 Sep 2016 15:50:24 +0100 Subject: [PATCH 255/580] Trigger build --- src/test/confidence/planned-binary-change | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/confidence/planned-binary-change b/src/test/confidence/planned-binary-change index 5a45ccfe..0a38b805 100644 --- a/src/test/confidence/planned-binary-change +++ b/src/test/confidence/planned-binary-change @@ -1 +1 @@ -20 Sep 2016 16:42:29 +25 Sep 2016 15:50:01 From ef0a447a68b98e9b15002bf60215b13ff934d82f Mon Sep 17 00:00:00 2001 From: David Brown Date: Sun, 25 Sep 2016 16:32:44 +0100 Subject: [PATCH 256/580] Fix shared library naming, and getcwd warning. --- src/compiler/OPM.Mod | 14 +++++++------- src/compiler/extTools.Mod | 4 ++-- src/system/Platformunix.Mod | 8 ++++---- src/tools/make/oberon.mk | 16 ++++++++-------- 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/compiler/OPM.Mod b/src/compiler/OPM.Mod index f7a171aa..c0f59250 100644 --- a/src/compiler/OPM.Mod +++ b/src/compiler/OPM.Mod @@ -86,7 +86,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) VAR SourceFileName : ARRAY 256 OF CHAR; - GlobalModel, Model*: CHAR; (* 2: S8/I16/L32, C: S16/I32/L64, V:S8/I32/L64 *) + GlobalModel, Model*: ARRAY 10 OF CHAR; (* 2: S8/I16/L32, C: S16/I32/L64, V:S8/I32/L64 *) GlobalAddressSize, AddressSize*: INTEGER; GlobalAlignment, Alignment*: INTEGER; GlobalOptions*, Options*: SET; @@ -189,8 +189,8 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) (* Elementary type size model *) | "O": IF i+1 >= Strings.Length(s) THEN LogWStr("-O option requires following size model character."); LogWLn ELSE - Model := s[i+1]; - IF (Model # '2') & (Model # 'C') & (Model # 'V') THEN + Model[0] := s[i+1]; Model[1] := 0X; + IF (Model[0] # '2') & (Model[0] # 'C') & (Model[0] # 'V') THEN LogWStr("Unrecognised size model character following -O."); LogWLn END; INC(i) @@ -287,7 +287,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) (* Set options to initial defaults *) AddressSize := SIZE(SYSTEM.ADDRESS); (* This compilers address size *) GetAlignment(Alignment); (* This compilers alignment *) - Model := '2'; (* Size model of common Oberon-2 implementations: S8/I16/L32 *) + Model := "2"; (* Size model of common Oberon-2 implementations: S8/I16/L32 *) Options := {inxchk, typchk, ptrinit, assert}; (* Default options *) (* Pick up global option changes from start of command line *) @@ -338,7 +338,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) IF mainlinkstat IN Options THEN INCL(Options, mainprog) END; MaxIndex := SignedMaximum(AddressSize); - CASE Model OF + CASE Model[0] OF |'2': ShortintSize := 1; IntegerSize := 2; LongintSize := 4; SetSize := 4 |'C': ShortintSize := 2; IntegerSize := 4; LongintSize := 8; SetSize := 8 |'V': ShortintSize := 1; IntegerSize := 4; LongintSize := 8; SetSize := 8 @@ -349,8 +349,8 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) IF verbose IN Options THEN VerboseListSizes END; ResourceDir := Configuration.installdir; - Strings.Append("/ ", ResourceDir); - ResourceDir[Strings.Length(ResourceDir)-1] := Model; + Strings.Append("/", ResourceDir); + Strings.Append(Model, ResourceDir); modules := ""; Platform.GetEnv("MODULES", modules); searchpath := "."; Platform.GetEnv("OBERON", searchpath); diff --git a/src/compiler/extTools.Mod b/src/compiler/extTools.Mod index b4f6ca95..f158fd60 100644 --- a/src/compiler/extTools.Mod +++ b/src/compiler/extTools.Mod @@ -67,10 +67,10 @@ PROCEDURE LinkMain*(VAR moduleName: ARRAY OF CHAR; statically: BOOLEAN; addition Strings.Append(Configuration.objflag, cmd); Strings.Append(moduleName, cmd); Strings.Append(Configuration.linkflags, cmd); - Strings.Append(OPM.ResourceDir, cmd); + Strings.Append(Configuration.installdir, cmd); Strings.Append('/lib"', cmd); Strings.Append(Configuration.libspec, cmd); - + Strings.Append(OPM.Model, cmd); execute("Assemble and link: ", cmd); END LinkMain; diff --git a/src/system/Platformunix.Mod b/src/system/Platformunix.Mod index 2db3669c..1ef21940 100644 --- a/src/system/Platformunix.Mod +++ b/src/system/Platformunix.Mod @@ -437,13 +437,13 @@ END Unlink; PROCEDURE -chdir(n: ARRAY OF CHAR): INTEGER "chdir((char*)n)"; -PROCEDURE -getcwd(VAR cwd: ARRAY OF CHAR) "getcwd((char*)cwd, cwd__len)"; +PROCEDURE -getcwd(VAR cwd: ARRAY OF CHAR): SYSTEM.PTR "getcwd((char*)cwd, cwd__len)"; PROCEDURE Chdir*(VAR n: ARRAY OF CHAR): ErrorCode; VAR r: INTEGER; BEGIN - r := chdir(n); getcwd(CWD); - IF r < 0 THEN RETURN err() ELSE RETURN 0 END + IF (chdir(n) >= 0) & (getcwd(CWD) # NIL) THEN RETURN 0 + ELSE RETURN err() END END Chdir; @@ -536,8 +536,8 @@ BEGIN HaltCode := -128; HaltHandler := NIL; TimeStart := 0; TimeStart := Time(); - CWD := ""; getcwd(CWD); PID := getpid(); + IF getcwd(CWD) = NIL THEN CWD := "" END; SeekSet := seekset(); SeekCur := seekcur(); diff --git a/src/tools/make/oberon.mk b/src/tools/make/oberon.mk index baf784c0..1d3fd191 100644 --- a/src/tools/make/oberon.mk +++ b/src/tools/make/oberon.mk @@ -157,14 +157,14 @@ install: @printf "\nInstalling into \"$(INSTALLDIR)\"\n" @rm -rf "$(INSTALLDIR)/bin" "$(INSTALLDIR)/$(MODEL)" @mkdir -p "$(INSTALLDIR)/bin" + @mkdir -p "$(INSTALLDIR)/lib" @mkdir -p "$(INSTALLDIR)/$(MODEL)/include" @mkdir -p "$(INSTALLDIR)/$(MODEL)/sym" - @mkdir -p "$(INSTALLDIR)/$(MODEL)/lib" - @cp $(BUILDDIR)/*.h "$(INSTALLDIR)/$(MODEL)/include/" - @cp $(BUILDDIR)/*.sym "$(INSTALLDIR)/$(MODEL)/sym/" - @cp $(OBECOMP) "$(INSTALLDIR)/bin/$(OBECOMP)" - @-cp $(BUILDDIR)/showdef$(BINEXT) "$(INSTALLDIR)/bin" - @cp $(BUILDDIR)/lib$(ONAME)* "$(INSTALLDIR)/$(MODEL)/lib/" + @cp $(BUILDDIR)/*.h "$(INSTALLDIR)/$(MODEL)/include/" + @cp $(BUILDDIR)/*.sym "$(INSTALLDIR)/$(MODEL)/sym/" + @cp $(OBECOMP) "$(INSTALLDIR)/bin/$(OBECOMP)" + @-cp $(BUILDDIR)/showdef$(BINEXT) "$(INSTALLDIR)/bin" + @cp $(BUILDDIR)/lib$(ONAME)* "$(INSTALLDIR)/lib/" @if which ldconfig >/dev/null 2>&1; then $(LDCONFIG); fi @@ -345,10 +345,10 @@ librarybinary: # of utilities like BrowserCmd.Mod (aka showdef). # Make static library - ar rcs "$(BUILDDIR)/lib$(ONAME).a" $(BUILDDIR)/*.o + ar rcs "$(BUILDDIR)/lib$(ONAME)$(MODEL).a" $(BUILDDIR)/*.o # Make shared library - @cd $(BUILDDIR) && $(COMPILE) -shared -o lib$(ONAME).so *.o + @cd $(BUILDDIR) && $(COMPILE) -shared -o lib$(ONAME)$(MODEL).so *.o From 9ffafc59b4002ab55c7bafc1aa8639916004b185 Mon Sep 17 00:00:00 2001 From: David Brown Date: Mon, 26 Sep 2016 19:01:59 +0100 Subject: [PATCH 257/580] Reenable library files, fix LONGREAL constants and type casts. --- bootstrap/unix-44/Compiler.c | 22 +- bootstrap/unix-44/Configuration.c | 4 +- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Console.c | 2 +- bootstrap/unix-44/Console.h | 2 +- bootstrap/unix-44/Files.c | 2 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 2 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 23 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 16 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 332 +- bootstrap/unix-44/OPM.h | 9 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 4 +- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 20 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Platform.c | 24 +- bootstrap/unix-44/Platform.h | 3 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/errors.c | 2 +- bootstrap/unix-44/errors.h | 2 +- bootstrap/unix-44/extTools.c | 32 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-44/vt100.c | 2 +- bootstrap/unix-44/vt100.h | 2 +- bootstrap/unix-48/Compiler.c | 22 +- bootstrap/unix-48/Configuration.c | 4 +- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Console.c | 2 +- bootstrap/unix-48/Console.h | 2 +- bootstrap/unix-48/Files.c | 2 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 2 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 23 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 16 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 332 +- bootstrap/unix-48/OPM.h | 9 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 4 +- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 20 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Platform.c | 24 +- bootstrap/unix-48/Platform.h | 3 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/errors.c | 2 +- bootstrap/unix-48/errors.h | 2 +- bootstrap/unix-48/extTools.c | 32 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-48/vt100.c | 2 +- bootstrap/unix-48/vt100.h | 2 +- bootstrap/unix-88/Compiler.c | 22 +- bootstrap/unix-88/Configuration.c | 4 +- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Console.c | 2 +- bootstrap/unix-88/Console.h | 2 +- bootstrap/unix-88/Files.c | 2 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 2 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 23 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 16 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 332 +- bootstrap/unix-88/OPM.h | 9 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 4 +- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 20 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Platform.c | 24 +- bootstrap/unix-88/Platform.h | 3 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/errors.c | 2 +- bootstrap/unix-88/errors.h | 2 +- bootstrap/unix-88/extTools.c | 32 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/unix-88/vt100.c | 2 +- bootstrap/unix-88/vt100.h | 2 +- bootstrap/windows-48/Compiler.c | 22 +- bootstrap/windows-48/Configuration.c | 4 +- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Console.c | 2 +- bootstrap/windows-48/Console.h | 2 +- bootstrap/windows-48/Files.c | 2 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 2 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 23 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 16 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 332 +- bootstrap/windows-48/OPM.h | 9 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 4 +- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 20 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Platform.c | 11 +- bootstrap/windows-48/Platform.h | 3 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/errors.c | 2 +- bootstrap/windows-48/errors.h | 2 +- bootstrap/windows-48/extTools.c | 32 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-48/vt100.c | 2 +- bootstrap/windows-48/vt100.h | 2 +- bootstrap/windows-88/Compiler.c | 22 +- bootstrap/windows-88/Configuration.c | 4 +- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Console.c | 2 +- bootstrap/windows-88/Console.h | 2 +- bootstrap/windows-88/Files.c | 2 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 2 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 23 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 16 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 332 +- bootstrap/windows-88/OPM.h | 9 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 4 +- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 20 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Platform.c | 11 +- bootstrap/windows-88/Platform.h | 3 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/errors.c | 2 +- bootstrap/windows-88/errors.h | 2 +- bootstrap/windows-88/extTools.c | 32 +- bootstrap/windows-88/extTools.h | 2 +- bootstrap/windows-88/vt100.c | 2 +- bootstrap/windows-88/vt100.h | 2 +- makefile | 20 +- src/library/ooc/oocLRealMath.Mod | 290 +- src/library/ooc/oocLowReal.Mod | 4 +- src/library/s3/ethReals.Mod | 138 +- src/library/ulm/ulmCipherOps.Mod | 106 +- src/library/ulm/ulmCiphers.Mod | 28 +- src/library/ulm/ulmDisciplines.Mod | 238 +- src/library/ulm/ulmErrors.Mod | 281 +- src/library/ulm/ulmEvents.Mod | 346 +- src/library/ulm/ulmForwarders.Mod | 434 +- src/library/ulm/ulmIO.Mod | 4 +- src/library/ulm/ulmIndirectDisciplines.Mod | 62 +- src/library/ulm/ulmIntOperations.Mod | 144 +- src/library/ulm/ulmNetIO.Mod | 1040 ++--- src/library/ulm/ulmOperations.Mod | 428 +- src/library/ulm/ulmPersistentDisciplines.Mod | 709 +-- src/library/ulm/ulmPersistentObjects.Mod | 1995 ++++----- src/library/ulm/ulmRandomGenerators.Mod | 764 ++-- src/library/ulm/ulmRelatedEvents.Mod | 773 ++-- src/library/ulm/ulmResources.Mod | 16 +- src/library/ulm/ulmScales.Mod | 822 ++-- src/library/ulm/ulmServices.Mod | 950 ++-- src/library/ulm/ulmStreamDisciplines.Mod | 455 +- src/library/ulm/ulmStreams.Mod | 4110 +++++++++--------- src/library/ulm/ulmSysIO.Mod | 79 +- src/library/ulm/ulmSysTypes.Mod | 12 +- src/library/ulm/ulmTCrypt.Mod | 3300 +++++++------- src/library/ulm/ulmTimeConditions.Mod | 742 ++-- src/library/ulm/ulmTimers.Mod | 592 +-- src/library/ulm/ulmTimes.Mod | 727 ++-- src/library/ulm/ulmTypes.Mod | 11 +- src/system/Platformunix.Mod | 8 +- src/system/Platformwindows.Mod | 4 + src/tools/make/oberon.mk | 104 +- 229 files changed, 11147 insertions(+), 11288 deletions(-) diff --git a/bootstrap/unix-44/Compiler.c b/bootstrap/unix-44/Compiler.c index 6444021c..1b3b14f1 100644 --- a/bootstrap/unix-44/Compiler.c +++ b/bootstrap/unix-44/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define INTEGER int16 #define LONGINT int32 @@ -32,7 +32,7 @@ void Compiler_Module (BOOLEAN *done) { BOOLEAN ext, new; OPT_Node p = NIL; - OPP_Module(&p, OPM_opt); + OPP_Module(&p, OPM_Options); if (OPM_noerr) { OPV_Init(); OPT_InitRecno(); @@ -43,22 +43,22 @@ void Compiler_Module (BOOLEAN *done) OPC_Init(); OPV_Module(p); if (OPM_noerr) { - if ((__IN(10, OPM_opt, 32) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { + if ((__IN(10, OPM_Options, 32) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { OPM_DeleteNewSym(); - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"32m", 4); } OPM_LogWStr((CHAR*)" Main program.", 16); - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } } else { if (new) { - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"32m", 4); } OPM_LogWStr((CHAR*)" New symbol file.", 19); - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } OPM_RegisterNewSym(); @@ -115,17 +115,17 @@ void Compiler_Translate (void) OPM_LogWLn(); Platform_Exit(1); } - if (!__IN(13, OPM_opt, 32)) { - if (__IN(14, OPM_opt, 32)) { + if (!__IN(13, OPM_Options, 32)) { + if (__IN(14, OPM_Options, 32)) { extTools_Assemble(OPM_modName, 32); } else { - if (!__IN(10, OPM_opt, 32)) { + if (!__IN(10, OPM_Options, 32)) { extTools_Assemble(OPM_modName, 32); Strings_Append((CHAR*)" ", 2, (void*)modulesobj, 2048); Strings_Append(OPM_modName, 32, (void*)modulesobj, 2048); Strings_Append((CHAR*)".o", 3, (void*)modulesobj, 2048); } else { - extTools_LinkMain((void*)OPM_modName, 32, __IN(15, OPM_opt, 32), modulesobj, 2048); + extTools_LinkMain((void*)OPM_modName, 32, __IN(15, OPM_Options, 32), modulesobj, 2048); } } } diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index 28528f64..85c8cf89 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index d9030dbe..a365d693 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Console.c b/bootstrap/unix-44/Console.c index 5bf17489..c2089f05 100644 --- a/bootstrap/unix-44/Console.c +++ b/bootstrap/unix-44/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Console.h b/bootstrap/unix-44/Console.h index 4eb27c8b..08f4e38e 100644 --- a/bootstrap/unix-44/Console.h +++ b/bootstrap/unix-44/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 6f5eb201..4800d53c 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index c75a1073..55e5fa16 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index 945fbff7..1f66b283 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index eccb5d85..9e9400e1 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index a87d0732..f165488e 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index 93e2105b..a2ceebdf 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index d211135a..e370e621 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -1541,28 +1541,9 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPT_Struct y = NIL; int16 f, g; OPT_Struct p = NIL, q = NIL; - if (__IN(18, OPM_opt, 32)) { - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"PROCEDURE CheckAssign", 22); - OPM_LogWLn(); - } y = ynode->typ; f = x->form; g = y->form; - if (__IN(18, OPM_opt, 32)) { - OPM_LogWStr((CHAR*)"y.form = ", 10); - OPM_LogWNum(y->form, 0); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"f = ", 5); - OPM_LogWNum(f, 0); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"g = ", 5); - OPM_LogWNum(g, 0); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"ynode.typ.syze = ", 18); - OPM_LogWNum(ynode->typ->size, 0); - OPM_LogWLn(); - } if (ynode->class == 8 || (ynode->class == 9 && f != 12)) { OPB_err(126); } @@ -2367,7 +2348,7 @@ static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpa atyp = atyp->BaseTyp; if ((fvarpar && ftyp == OPT_bytetyp)) { if (!__IN(f, 0x0c, 32) || !((__IN(atyp->form, 0x1e, 32) && atyp->size == 1))) { - if (__IN(18, OPM_opt, 32)) { + if (__IN(18, OPM_Options, 32)) { OPB_err(-301); } } diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index 97860bfc..8c0fd594 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index e4c0eb06..4c9ae495 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -989,7 +989,7 @@ static void OPC_IdentList (OPT_Object obj, int16 vis) OPC_Ident(obj); OPM_WriteString((CHAR*)"__typ", 6); base = NIL; - } else if ((((((__IN(5, OPM_opt, 32) && vis == 0)) && obj->mnolev > 0)) && obj->typ->form == 11)) { + } else if ((((((__IN(5, OPM_Options, 32) && vis == 0)) && obj->mnolev > 0)) && obj->typ->form == 11)) { OPM_WriteString((CHAR*)" = NIL", 7); } } @@ -1153,7 +1153,7 @@ static void OPC_GenHeaderMsg (void) OPM_Write(' '); i = 0; while (i <= 31) { - if (__IN(i, OPM_glbopt, 32)) { + if (__IN(i, OPM_Options, 32)) { switch (i) { case 0: OPM_Write('x'); @@ -1355,7 +1355,7 @@ void OPC_EnterBody (void) { OPM_WriteLn(); OPM_WriteString((CHAR*)"export ", 8); - if (__IN(10, OPM_opt, 32)) { + if (__IN(10, OPM_Options, 32)) { OPM_WriteString((CHAR*)"int main(int argc, char **argv)", 32); OPM_WriteLn(); } else { @@ -1366,20 +1366,20 @@ void OPC_EnterBody (void) } OPC_BegBlk(); OPC_BegStat(); - if (__IN(10, OPM_opt, 32)) { + if (__IN(10, OPM_Options, 32)) { OPM_WriteString((CHAR*)"__INIT(argc, argv)", 19); } else { OPM_WriteString((CHAR*)"__DEFMOD", 9); } OPC_EndStat(); - if ((__IN(10, OPM_opt, 32) && 0)) { + if ((__IN(10, OPM_Options, 32) && 0)) { OPC_BegStat(); OPM_WriteString((CHAR*)"/*don`t do it!*/ printf(\"DEMO VERSION: DO NOT USE THIS PROGRAM FOR ANY COMMERCIAL PURPOSE\\n\")", 94); OPC_EndStat(); } OPC_InitImports(OPT_topScope->right); OPC_BegStat(); - if (__IN(10, OPM_opt, 32)) { + if (__IN(10, OPM_Options, 32)) { OPM_WriteString((CHAR*)"__REGMAIN(\"", 12); } else { OPM_WriteString((CHAR*)"__REGMOD(\"", 11); @@ -1399,7 +1399,7 @@ void OPC_EnterBody (void) void OPC_ExitBody (void) { OPC_BegStat(); - if (__IN(10, OPM_opt, 32)) { + if (__IN(10, OPM_Options, 32)) { OPM_WriteString((CHAR*)"__FINI;", 8); } else { OPM_WriteString((CHAR*)"__ENDMOD;", 10); diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index 3325aded..e681f43d 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 7234f518..534a5c0d 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -19,7 +19,14 @@ typedef static CHAR OPM_SourceFileName[256]; -export int16 OPM_AddressSize, OPM_Alignment, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; +static CHAR OPM_GlobalModel[10]; +export CHAR OPM_Model[10]; +static int16 OPM_GlobalAddressSize; +export int16 OPM_AddressSize; +static int16 OPM_GlobalAlignment; +export int16 OPM_Alignment; +export SET OPM_GlobalOptions, OPM_Options; +export int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize, OPM_MaxSet; export int64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; @@ -27,7 +34,6 @@ export int32 OPM_curpos, OPM_errpos, OPM_breakpc; export int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; export CHAR OPM_modName[32]; export CHAR OPM_objname[64]; -export SET OPM_opt, OPM_glbopt; static int32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; static Texts_Reader OPM_inR; static Texts_Text OPM_Log; @@ -36,8 +42,7 @@ static Files_Rider OPM_oldSF, OPM_newSF; static Files_Rider OPM_R[3]; static Files_File OPM_oldSFile, OPM_newSFile, OPM_HFile, OPM_BFile, OPM_HIFile; static int16 OPM_S; -static CHAR OPM_OBERON[1024]; -static CHAR OPM_MODULES[1024]; +export CHAR OPM_ResourceDir[1024]; static void OPM_Append (Files_Rider *R, address *R__typ, Files_File F); @@ -50,8 +55,6 @@ export void OPM_FPrintReal (int32 *fp, REAL real); export void OPM_FPrintSet (int32 *fp, SET set); static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 pos); export void OPM_Get (CHAR *ch); -static void OPM_GetProperties (void); -static void OPM_GetProperty (Texts_Scanner *S, address *S__typ, CHAR *name, LONGINT name__len, int16 *size, int16 *align); export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); export void OPM_InitOptions (void); export int16 OPM_Integer (int64 n); @@ -68,7 +71,7 @@ export void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); export void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); export BOOLEAN OPM_OpenPar (void); export void OPM_RegisterNewSym (void); -static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt); +static void OPM_ScanOptions (CHAR *s, LONGINT s__len); static void OPM_ShowLine (int64 pos); export int64 OPM_SignedMaximum (int32 bytecount); export int64 OPM_SignedMinimum (int32 bytecount); @@ -93,10 +96,8 @@ export void OPM_WriteString (CHAR *s, LONGINT s__len); export void OPM_WriteStringVar (CHAR *s, LONGINT s__len); export BOOLEAN OPM_eofSF (void); export void OPM_err (int16 n); -static int32 OPM_minusop (int32 i); -static int32 OPM_power0 (int32 i, int32 j); -#define OPM_GetAlignment(a) struct {char c; long long l;} s; *a = (char*)&s.l - (char*)&s +#define OPM_GetAlignment(a) struct {char c; long long l;} _s; *a = (char*)&_s.l - (char*)&_s void OPM_LogW (CHAR ch) { @@ -120,6 +121,23 @@ void OPM_LogWLn (void) Console_Ln(); } +int64 OPM_SignedMaximum (int32 bytecount) +{ + int64 _o_result; + int64 result; + result = 1; + result = __LSH(result, __ASHL(bytecount, 3) - 1, 64); + _o_result = result - 1; + return _o_result; +} + +int64 OPM_SignedMinimum (int32 bytecount) +{ + int64 _o_result; + _o_result = -OPM_SignedMaximum(bytecount) - 1; + return _o_result; +} + int32 OPM_Longint (int64 n) { int32 _o_result; @@ -134,7 +152,7 @@ int16 OPM_Integer (int64 n) return _o_result; } -static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) +static void OPM_ScanOptions (CHAR *s, LONGINT s__len) { int16 i; __DUP(s, s__len, CHAR); @@ -142,75 +160,57 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) while (s[__X(i, s__len)] != 0x00) { switch (s[__X(i, s__len)]) { case 'p': - *opt = *opt ^ 0x20; + OPM_Options = OPM_Options ^ 0x20; break; case 'a': - *opt = *opt ^ 0x80; + OPM_Options = OPM_Options ^ 0x80; break; case 'r': - *opt = *opt ^ 0x04; + OPM_Options = OPM_Options ^ 0x04; break; case 't': - *opt = *opt ^ 0x08; + OPM_Options = OPM_Options ^ 0x08; break; case 'x': - *opt = *opt ^ 0x01; + OPM_Options = OPM_Options ^ 0x01; break; case 'e': - *opt = *opt ^ 0x0200; + OPM_Options = OPM_Options ^ 0x0200; break; case 's': - *opt = *opt ^ 0x10; + OPM_Options = OPM_Options ^ 0x10; break; case 'F': - *opt = *opt ^ 0x020000; + OPM_Options = OPM_Options ^ 0x020000; break; case 'm': - *opt = *opt ^ 0x0400; + OPM_Options = OPM_Options ^ 0x0400; break; case 'M': - *opt = *opt ^ 0x8000; + OPM_Options = OPM_Options ^ 0x8000; break; case 'S': - *opt = *opt ^ 0x2000; + OPM_Options = OPM_Options ^ 0x2000; break; case 'c': - *opt = *opt ^ 0x4000; + OPM_Options = OPM_Options ^ 0x4000; break; case 'f': - *opt = *opt ^ 0x010000; + OPM_Options = OPM_Options ^ 0x010000; break; case 'V': - *opt = *opt ^ 0x040000; + OPM_Options = OPM_Options ^ 0x040000; break; case 'O': if (i + 1 >= Strings_Length(s, s__len)) { OPM_LogWStr((CHAR*)"-O option requires following size model character.", 51); OPM_LogWLn(); } else { - switch (s[__X(i + 1, s__len)]) { - case '2': - OPM_ShortintSize = 1; - OPM_IntegerSize = 2; - OPM_LongintSize = 4; - OPM_SetSize = 4; - break; - case 'V': - OPM_ShortintSize = 1; - OPM_IntegerSize = 4; - OPM_LongintSize = 8; - OPM_SetSize = 8; - break; - case 'C': - OPM_ShortintSize = 2; - OPM_IntegerSize = 4; - OPM_LongintSize = 8; - OPM_SetSize = 8; - break; - default: - OPM_LogWStr((CHAR*)"Unrecognised size model character following -O.", 48); - OPM_LogWLn(); - break; + OPM_Model[0] = s[__X(i + 1, s__len)]; + OPM_Model[1] = 0x00; + if ((((OPM_Model[0] != '2' && OPM_Model[0] != 'C')) && OPM_Model[0] != 'V')) { + OPM_LogWStr((CHAR*)"Unrecognised size model character following -O.", 48); + OPM_LogWLn(); } i += 1; } @@ -358,39 +358,119 @@ BOOLEAN OPM_OpenPar (void) _o_result = 0; return _o_result; } else { + OPM_AddressSize = 4; + OPM_GetAlignment(&OPM_Alignment); + __MOVE("2", OPM_Model, 2); + OPM_Options = 0xa9; OPM_S = 1; s[0] = 0x00; Platform_GetArg(OPM_S, (void*)s, 256); - OPM_glbopt = 0xa9; while (s[0] == '-') { - OPM_ScanOptions(s, 256, &OPM_glbopt); + OPM_ScanOptions(s, 256); OPM_S += 1; s[0] = 0x00; Platform_GetArg(OPM_S, (void*)s, 256); } + OPM_GlobalAddressSize = OPM_AddressSize; + OPM_GlobalAlignment = OPM_Alignment; + __COPY(OPM_Model, OPM_GlobalModel, 10); + OPM_GlobalOptions = OPM_Options; _o_result = 1; return _o_result; } __RETCHK; } +static void OPM_VerboseListSizes (void) +{ + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Type Size", 15); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"SHORTINT ", 12); + OPM_LogWNum(OPM_ShortintSize, 4); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"INTEGER ", 12); + OPM_LogWNum(OPM_IntegerSize, 4); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"LONGINT ", 12); + OPM_LogWNum(OPM_LongintSize, 4); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"SET ", 12); + OPM_LogWNum(OPM_SetSize, 4); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"ADDRESS ", 12); + OPM_LogWNum(OPM_AddressSize, 4); + OPM_LogWLn(); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Alignment: ", 12); + OPM_LogWNum(OPM_Alignment, 4); + OPM_LogWLn(); +} + void OPM_InitOptions (void) { CHAR s[256]; - OPM_opt = OPM_glbopt; + CHAR searchpath[1024], modules[1024]; + CHAR MODULES[1024]; + OPM_Options = OPM_GlobalOptions; + __COPY(OPM_GlobalModel, OPM_Model, 10); + OPM_Alignment = OPM_GlobalAlignment; + OPM_AddressSize = OPM_GlobalAddressSize; s[0] = 0x00; Platform_GetArg(OPM_S, (void*)s, 256); while (s[0] == '-') { - OPM_ScanOptions(s, 256, &OPM_opt); + OPM_ScanOptions(s, 256); OPM_S += 1; s[0] = 0x00; Platform_GetArg(OPM_S, (void*)s, 256); } - if (__IN(15, OPM_opt, 32)) { - OPM_glbopt |= __SETOF(10,32); - OPM_opt |= __SETOF(10,32); + if (__IN(15, OPM_Options, 32)) { + OPM_Options |= __SETOF(10,32); } - OPM_GetProperties(); + OPM_MaxIndex = OPM_SignedMaximum(OPM_AddressSize); + switch (OPM_Model[0]) { + case '2': + OPM_ShortintSize = 1; + OPM_IntegerSize = 2; + OPM_LongintSize = 4; + OPM_SetSize = 4; + break; + case 'C': + OPM_ShortintSize = 2; + OPM_IntegerSize = 4; + OPM_LongintSize = 8; + OPM_SetSize = 8; + break; + case 'V': + OPM_ShortintSize = 1; + OPM_IntegerSize = 4; + OPM_LongintSize = 8; + OPM_SetSize = 8; + break; + default: + OPM_ShortintSize = 1; + OPM_IntegerSize = 2; + OPM_LongintSize = 4; + OPM_SetSize = 4; + break; + } + OPM_MaxSet = __ASHL(OPM_SetSize, 3) - 1; + if (__IN(18, OPM_Options, 32)) { + OPM_VerboseListSizes(); + } + OPM_ResourceDir[0] = 0x00; + Strings_Append((CHAR*)"/", 2, (void*)OPM_ResourceDir, 1024); + Strings_Append(OPM_Model, 10, (void*)OPM_ResourceDir, 1024); + modules[0] = 0x00; + Platform_GetEnv((CHAR*)"MODULES", 8, (void*)modules, 1024); + __MOVE(".", searchpath, 2); + Platform_GetEnv((CHAR*)"OBERON", 7, (void*)searchpath, 1024); + Strings_Append((CHAR*)";.;", 4, (void*)searchpath, 1024); + Strings_Append(modules, 1024, (void*)searchpath, 1024); + Strings_Append((CHAR*)";", 2, (void*)searchpath, 1024); + Strings_Append(OPM_ResourceDir, 1024, (void*)searchpath, 1024); + Strings_Append((CHAR*)"/sym;", 6, (void*)searchpath, 1024); + Files_SetSearchPath(searchpath, 1024); } void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len) @@ -474,20 +554,20 @@ static void OPM_LogErrMsg (int16 n) int16 i; CHAR buf[1024]; if (n >= 0) { - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"31m", 4); } OPM_LogWStr((CHAR*)" err ", 7); - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } } else { - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"35m", 4); } OPM_LogWStr((CHAR*)" warning ", 11); n = -n; - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } } @@ -560,11 +640,11 @@ static void OPM_ShowLine (int64 pos) OPM_LogW(' '); i -= 1; } - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"32m", 4); } OPM_LogW('^'); - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } Files_Close(f); @@ -654,106 +734,6 @@ void OPM_FPrintLReal (int32 *fp, LONGREAL lr) OPM_FPrint(&*fp, h); } -static void OPM_GetProperty (Texts_Scanner *S, address *S__typ, CHAR *name, LONGINT name__len, int16 *size, int16 *align) -{ - __DUP(name, name__len, CHAR); - if (((*S).class == 1 && __STRCMP((*S).s, name) == 0)) { - Texts_Scan(&*S, S__typ); - if ((*S).class == 3) { - *size = (int16)(*S).i; - Texts_Scan(&*S, S__typ); - } else { - OPM_Mark(-157, -1); - } - if ((*S).class == 3) { - *align = (int16)(*S).i; - Texts_Scan(&*S, S__typ); - } else { - OPM_Mark(-157, -1); - } - } else { - OPM_Mark(-157, -1); - } - __DEL(name); -} - -static int32 OPM_minusop (int32 i) -{ - int32 _o_result; - _o_result = -i; - return _o_result; -} - -static int32 OPM_power0 (int32 i, int32 j) -{ - int32 _o_result; - int32 k, p; - k = 1; - p = i; - do { - p = p * i; - k += 1; - } while (!(k == j)); - _o_result = p; - return _o_result; -} - -static void OPM_VerboseListSizes (void) -{ - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Type Size", 17); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"SHORTINT ", 14); - OPM_LogWNum(OPM_ShortintSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"INTEGER ", 14); - OPM_LogWNum(OPM_IntegerSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"LONGINT ", 14); - OPM_LogWNum(OPM_LongintSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"SET ", 14); - OPM_LogWNum(OPM_SetSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"ADDRESS ", 14); - OPM_LogWNum(OPM_AddressSize, 4); - OPM_LogWLn(); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Alignment: ", 12); - OPM_LogWNum(OPM_Alignment, 4); - OPM_LogWLn(); -} - -int64 OPM_SignedMaximum (int32 bytecount) -{ - int64 _o_result; - int64 result; - result = 1; - result = __LSH(result, __ASHL(bytecount, 3) - 1, 64); - _o_result = result - 1; - return _o_result; -} - -int64 OPM_SignedMinimum (int32 bytecount) -{ - int64 _o_result; - _o_result = -OPM_SignedMaximum(bytecount) - 1; - return _o_result; -} - -static void OPM_GetProperties (void) -{ - OPM_MaxReal = 3.40282346000000e+038; - OPM_MaxLReal = 1.79769296342094e+308; - OPM_MinReal = -OPM_MaxReal; - OPM_MinLReal = -OPM_MaxLReal; - OPM_MaxSet = __ASHL(OPM_SetSize, 3) - 1; - OPM_MaxIndex = OPM_SignedMaximum(OPM_AddressSize); - if (__IN(18, OPM_opt, 32)) { - OPM_VerboseListSizes(); - } -} - void OPM_SymRCh (CHAR *ch) { Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&*ch); @@ -848,7 +828,7 @@ void OPM_SymWLReal (LONGREAL lr) void OPM_RegisterNewSym (void) { - if (__STRCMP(OPM_modName, "SYSTEM") != 0 || __IN(10, OPM_opt, 32)) { + if (__STRCMP(OPM_modName, "SYSTEM") != 0 || __IN(10, OPM_Options, 32)) { Files_Register(OPM_newSFile); } } @@ -1047,10 +1027,10 @@ void OPM_CloseFiles (void) } if (OPM_noerr) { if (__STRCMP(OPM_modName, "SYSTEM") == 0) { - if (!__IN(10, OPM_opt, 32)) { + if (!__IN(10, OPM_Options, 32)) { Files_Register(OPM_BFile); } - } else if (!__IN(10, OPM_opt, 32)) { + } else if (!__IN(10, OPM_Options, 32)) { OPM_Append(&OPM_R[2], Files_Rider__typ, OPM_HFile); Files_Register(OPM_HIFile); Files_Register(OPM_BFile); @@ -1110,22 +1090,10 @@ export void *OPM__init(void) __REGCMD("RegisterNewSym", OPM_RegisterNewSym); __REGCMD("WriteLn", OPM_WriteLn); /* BEGIN */ + OPM_MaxReal = 3.40282346000000e+038; + OPM_MaxLReal = 1.79769296342094e+308; + OPM_MinReal = -OPM_MaxReal; + OPM_MinLReal = -OPM_MaxLReal; Texts_OpenWriter(&OPM_W, Texts_Writer__typ); - OPM_MODULES[0] = 0x00; - Platform_GetEnv((CHAR*)"MODULES", 8, (void*)OPM_MODULES, 1024); - __MOVE(".", OPM_OBERON, 2); - Platform_GetEnv((CHAR*)"OBERON", 7, (void*)OPM_OBERON, 1024); - Strings_Append((CHAR*)";.;", 4, (void*)OPM_OBERON, 1024); - Strings_Append(OPM_MODULES, 1024, (void*)OPM_OBERON, 1024); - Strings_Append((CHAR*)";", 2, (void*)OPM_OBERON, 1024); - Strings_Append((CHAR*)"", 1, (void*)OPM_OBERON, 1024); - Strings_Append((CHAR*)"/sym;", 6, (void*)OPM_OBERON, 1024); - Files_SetSearchPath(OPM_OBERON, 1024); - OPM_AddressSize = 4; - OPM_GetAlignment(&OPM_Alignment); - OPM_ShortintSize = 1; - OPM_IntegerSize = 2; - OPM_LongintSize = 4; - OPM_SetSize = 4; __ENDMOD; } diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index e249edd5..933ef1b5 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h @@ -6,7 +6,10 @@ #include "SYSTEM.h" -import int16 OPM_AddressSize, OPM_Alignment, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; +import CHAR OPM_Model[10]; +import int16 OPM_AddressSize, OPM_Alignment; +import SET OPM_GlobalOptions, OPM_Options; +import int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize, OPM_MaxSet; import int64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; @@ -14,7 +17,7 @@ import int32 OPM_curpos, OPM_errpos, OPM_breakpc; import int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; import CHAR OPM_modName[32]; import CHAR OPM_objname[64]; -import SET OPM_opt, OPM_glbopt; +import CHAR OPM_ResourceDir[1024]; import void OPM_CloseFiles (void); diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index 1e5c6674..010efab1 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index 3b9acd86..373d8daa 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index ee182741..f8ed61bf 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index 1514d9eb..1f02668b 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index c1b4cb67..7efc4cc4 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -1867,7 +1867,7 @@ void OPT_Export (BOOLEAN *ext, BOOLEAN *new) } OPT_OutObj(OPT_topScope->right); *ext = (OPT_sfpresent && OPT_symExtended); - *new = (!OPT_sfpresent || OPT_symNew) || __IN(17, OPM_opt, 32); + *new = (!OPT_sfpresent || OPT_symNew) || __IN(17, OPM_Options, 32); if ((((OPM_noerr && OPT_sfpresent)) && OPT_impCtxt.reffp != OPT_expCtxt.reffp)) { *new = 1; if (!OPT_extsf) { diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index d4f953ba..202c8278 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index a70a40bf..ff99f665 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -211,7 +211,7 @@ static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp return _o_result; break; case 5: - if (__IN(3, OPM_opt, 32)) { + if (__IN(3, OPM_Options, 32)) { _o_result = 10; return _o_result; } else { @@ -397,7 +397,7 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int16 prec) OPM_WriteInt(__ASHL(newtype->size, 3)); OPM_Write(')'); } else if (to == 4) { - if ((newtype->size < n->typ->size && __IN(2, OPM_opt, 32))) { + if ((newtype->size < n->typ->size && __IN(2, OPM_Options, 32))) { OPM_WriteString((CHAR*)"__SHORT", 8); if (OPV_SideEffects(n)) { OPM_Write('F'); @@ -412,7 +412,7 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int16 prec) OPV_Entier(n, 9); } } else if (to == 3) { - if (__IN(2, OPM_opt, 32)) { + if (__IN(2, OPM_Options, 32)) { OPM_WriteString((CHAR*)"__CHR", 6); if (OPV_SideEffects(n)) { OPM_Write('F'); @@ -453,7 +453,7 @@ static void OPV_TypeOf (OPT_Node n) static void OPV_Index (OPT_Node n, OPT_Node d, int16 prec, int16 dim) { - if (!__IN(0, OPM_opt, 32) || (n->right->class == 7 && (n->right->conval->intval == 0 || n->left->typ->comp != 3))) { + if (!__IN(0, OPM_Options, 32) || (n->right->class == 7 && (n->right->conval->intval == 0 || n->left->typ->comp != 3))) { OPV_expr(n->right, prec); } else { if (OPV_SideEffects(n->right)) { @@ -575,7 +575,7 @@ static void OPV_design (OPT_Node n, int16 prec) case 5: typ = n->typ; obj = n->left->obj; - if (__IN(3, OPM_opt, 32)) { + if (__IN(3, OPM_Options, 32)) { if (typ->comp == 4) { OPM_WriteString((CHAR*)"__GUARDR(", 10); if ((int16)obj->mnolev != OPM_level) { @@ -614,7 +614,7 @@ static void OPV_design (OPT_Node n, int16 prec) } break; case 6: - if (__IN(3, OPM_opt, 32)) { + if (__IN(3, OPM_Options, 32)) { if (n->left->class == 1) { OPM_WriteString((CHAR*)"__GUARDEQR(", 12); OPC_CompleteIdent(n->left->obj); @@ -1442,7 +1442,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) case 20: if (n->subcl != 32) { OPV_IfStat(n, 0, outerProc); - } else if (__IN(7, OPM_opt, 32)) { + } else if (__IN(7, OPM_Options, 32)) { OPM_WriteString((CHAR*)"__ASSERT(", 10); OPV_expr(n->left->left->left, -1); OPM_WriteString((CHAR*)", ", 3); @@ -1508,7 +1508,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) break; case 26: if (OPM_level == 0) { - if (__IN(10, OPM_opt, 32)) { + if (__IN(10, OPM_Options, 32)) { OPM_WriteString((CHAR*)"__FINI", 7); } else { OPM_WriteString((CHAR*)"__ENDMOD", 9); @@ -1553,7 +1553,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) void OPV_Module (OPT_Node prog) { - if (!__IN(10, OPM_opt, 32)) { + if (!__IN(10, OPM_Options, 32)) { OPC_GenHdr(prog->right); OPC_GenHdrIncludes(); } diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index 0a9135f5..a44fb5b5 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index ef0c0dbe..18c66534 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -65,6 +65,7 @@ export int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, addres export int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); export BOOLEAN Platform_Inaccessible (int16 e); export void Platform_Init (int16 argc, int32 argvadr); +export BOOLEAN Platform_Interrupted (int16 e); export void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); export int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); export BOOLEAN Platform_NoSuchDirectory (int16 e); @@ -115,6 +116,7 @@ export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT #define Platform_ECONNABORTED() ECONNABORTED #define Platform_ECONNREFUSED() ECONNREFUSED #define Platform_EHOSTUNREACH() EHOSTUNREACH +#define Platform_EINTR() EINTR #define Platform_EMFILE() EMFILE #define Platform_ENETUNREACH() ENETUNREACH #define Platform_ENFILE() ENFILE @@ -218,6 +220,13 @@ BOOLEAN Platform_ConnectionFailed (int16 e) return _o_result; } +BOOLEAN Platform_Interrupted (int16 e) +{ + BOOLEAN _o_result; + _o_result = e == Platform_EINTR(); + return _o_result; +} + int32 Platform_OSAllocate (int32 size) { int32 _o_result; @@ -618,13 +627,11 @@ int16 Platform_Chdir (CHAR *n, LONGINT n__len) { int16 _o_result; int16 r; - r = Platform_chdir(n, n__len); - Platform_getcwd((void*)Platform_CWD, 256); - if (r < 0) { - _o_result = Platform_err(); + if ((Platform_chdir(n, n__len) >= 0 && Platform_getcwd((void*)Platform_CWD, 256) != NIL)) { + _o_result = 0; return _o_result; } else { - _o_result = 0; + _o_result = Platform_err(); return _o_result; } __RETCHK; @@ -784,9 +791,10 @@ export void *Platform__init(void) Platform_HaltHandler = NIL; Platform_TimeStart = 0; Platform_TimeStart = Platform_Time(); - Platform_CWD[0] = 0x00; - Platform_getcwd((void*)Platform_CWD, 256); Platform_PID = Platform_getpid(); + if (Platform_getcwd((void*)Platform_CWD, 256) == NIL) { + Platform_CWD[0] = 0x00; + } Platform_SeekSet = Platform_seekset(); Platform_SeekCur = Platform_seekcur(); Platform_SeekEnd = Platform_seekend(); diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index 986a65ef..158cb341 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h @@ -50,6 +50,7 @@ import int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, addres import int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); import BOOLEAN Platform_Inaccessible (int16 e); import void Platform_Init (int16 argc, int32 argvadr); +import BOOLEAN Platform_Interrupted (int16 e); import void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); import int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); import BOOLEAN Platform_NoSuchDirectory (int16 e); diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index e75d35ff..57e22100 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index 8a42b39b..f3404dda 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index 9f9562db..bcf3cb9b 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index da213d81..9418692a 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index 9d981ce0..efc9fd98 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index 1faae4d6..e402259d 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/errors.c b/bootstrap/unix-44/errors.c index 34e6fae3..ba890a17 100644 --- a/bootstrap/unix-44/errors.c +++ b/bootstrap/unix-44/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/errors.h b/bootstrap/unix-44/errors.h index ce275b8c..d8124792 100644 --- a/bootstrap/unix-44/errors.h +++ b/bootstrap/unix-44/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index fd7974da..76fdc084 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -12,10 +12,11 @@ #include "Strings.h" -static CHAR extTools_compilationOptions[1023], extTools_CFLAGS[1023]; +static CHAR extTools_CFLAGS[1023]; export void extTools_Assemble (CHAR *moduleName, LONGINT moduleName__len); +static void extTools_InitialiseCompilerCommand (CHAR *s, LONGINT s__len); export void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN statically, CHAR *additionalopts, LONGINT additionalopts__len); static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGINT cmd__len); @@ -25,7 +26,7 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN int16 r, status, exitcode; __DUP(title, title__len, CHAR); __DUP(cmd, cmd__len, CHAR); - if (__IN(18, OPM_opt, 32)) { + if (__IN(18, OPM_Options, 32)) { Console_String(title, title__len); Console_String(cmd, cmd__len); Console_Ln(); @@ -60,12 +61,22 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN __DEL(cmd); } +static void extTools_InitialiseCompilerCommand (CHAR *s, LONGINT s__len) +{ + __COPY("gcc -g -O1", s, s__len); + Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); + Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); + Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); + Platform_GetEnv((CHAR*)"CFLAGS", 7, (void*)extTools_CFLAGS, 1023); + Strings_Append(extTools_CFLAGS, 1023, (void*)s, s__len); + Strings_Append((CHAR*)" ", 2, (void*)s, s__len); +} + void extTools_Assemble (CHAR *moduleName, LONGINT moduleName__len) { CHAR cmd[1023]; __DUP(moduleName, moduleName__len, CHAR); - __MOVE("gcc -g -O1", cmd, 11); - Strings_Append(extTools_compilationOptions, 1023, (void*)cmd, 1023); + extTools_InitialiseCompilerCommand((void*)cmd, 1023); Strings_Append((CHAR*)"-c ", 4, (void*)cmd, 1023); Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); Strings_Append((CHAR*)".c", 3, (void*)cmd, 1023); @@ -77,9 +88,7 @@ void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN stati { CHAR cmd[1023]; __DUP(additionalopts, additionalopts__len, CHAR); - __MOVE("gcc -g -O1", cmd, 11); - Strings_Append((CHAR*)" ", 2, (void*)cmd, 1023); - Strings_Append(extTools_compilationOptions, 1023, (void*)cmd, 1023); + extTools_InitialiseCompilerCommand((void*)cmd, 1023); Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); Strings_Append((CHAR*)".c ", 4, (void*)cmd, 1023); Strings_Append(additionalopts, additionalopts__len, (void*)cmd, 1023); @@ -92,6 +101,7 @@ void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN stati Strings_Append((CHAR*)"", 1, (void*)cmd, 1023); Strings_Append((CHAR*)"/lib\"", 6, (void*)cmd, 1023); Strings_Append((CHAR*)" -l voc", 8, (void*)cmd, 1023); + Strings_Append(OPM_Model, 10, (void*)cmd, 1023); extTools_execute((CHAR*)"Assemble and link: ", 20, cmd, 1023); __DEL(additionalopts); } @@ -107,11 +117,5 @@ export void *extTools__init(void) __MODULE_IMPORT(Strings); __REGMOD("extTools", 0); /* BEGIN */ - Strings_Append((CHAR*)" -I \"", 6, (void*)extTools_compilationOptions, 1023); - Strings_Append((CHAR*)"", 1, (void*)extTools_compilationOptions, 1023); - Strings_Append((CHAR*)"/include\" ", 11, (void*)extTools_compilationOptions, 1023); - Platform_GetEnv((CHAR*)"CFLAGS", 7, (void*)extTools_CFLAGS, 1023); - Strings_Append(extTools_CFLAGS, 1023, (void*)extTools_compilationOptions, 1023); - Strings_Append((CHAR*)" ", 2, (void*)extTools_compilationOptions, 1023); __ENDMOD; } diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index f87adfac..bb5be954 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-44/vt100.c b/bootstrap/unix-44/vt100.c index ca56f466..c44586d2 100644 --- a/bootstrap/unix-44/vt100.c +++ b/bootstrap/unix-44/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/vt100.h b/bootstrap/unix-44/vt100.h index f5b8588f..c9a01a7c 100644 --- a/bootstrap/unix-44/vt100.h +++ b/bootstrap/unix-44/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-48/Compiler.c b/bootstrap/unix-48/Compiler.c index 6444021c..1b3b14f1 100644 --- a/bootstrap/unix-48/Compiler.c +++ b/bootstrap/unix-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define INTEGER int16 #define LONGINT int32 @@ -32,7 +32,7 @@ void Compiler_Module (BOOLEAN *done) { BOOLEAN ext, new; OPT_Node p = NIL; - OPP_Module(&p, OPM_opt); + OPP_Module(&p, OPM_Options); if (OPM_noerr) { OPV_Init(); OPT_InitRecno(); @@ -43,22 +43,22 @@ void Compiler_Module (BOOLEAN *done) OPC_Init(); OPV_Module(p); if (OPM_noerr) { - if ((__IN(10, OPM_opt, 32) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { + if ((__IN(10, OPM_Options, 32) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { OPM_DeleteNewSym(); - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"32m", 4); } OPM_LogWStr((CHAR*)" Main program.", 16); - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } } else { if (new) { - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"32m", 4); } OPM_LogWStr((CHAR*)" New symbol file.", 19); - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } OPM_RegisterNewSym(); @@ -115,17 +115,17 @@ void Compiler_Translate (void) OPM_LogWLn(); Platform_Exit(1); } - if (!__IN(13, OPM_opt, 32)) { - if (__IN(14, OPM_opt, 32)) { + if (!__IN(13, OPM_Options, 32)) { + if (__IN(14, OPM_Options, 32)) { extTools_Assemble(OPM_modName, 32); } else { - if (!__IN(10, OPM_opt, 32)) { + if (!__IN(10, OPM_Options, 32)) { extTools_Assemble(OPM_modName, 32); Strings_Append((CHAR*)" ", 2, (void*)modulesobj, 2048); Strings_Append(OPM_modName, 32, (void*)modulesobj, 2048); Strings_Append((CHAR*)".o", 3, (void*)modulesobj, 2048); } else { - extTools_LinkMain((void*)OPM_modName, 32, __IN(15, OPM_opt, 32), modulesobj, 2048); + extTools_LinkMain((void*)OPM_modName, 32, __IN(15, OPM_Options, 32), modulesobj, 2048); } } } diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index 28528f64..85c8cf89 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index d9030dbe..a365d693 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Console.c b/bootstrap/unix-48/Console.c index 5bf17489..c2089f05 100644 --- a/bootstrap/unix-48/Console.c +++ b/bootstrap/unix-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Console.h b/bootstrap/unix-48/Console.h index 4eb27c8b..08f4e38e 100644 --- a/bootstrap/unix-48/Console.h +++ b/bootstrap/unix-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 6f5eb201..4800d53c 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index c75a1073..55e5fa16 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index 945fbff7..1f66b283 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index eccb5d85..9e9400e1 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index a87d0732..f165488e 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index 93e2105b..a2ceebdf 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index d211135a..e370e621 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -1541,28 +1541,9 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPT_Struct y = NIL; int16 f, g; OPT_Struct p = NIL, q = NIL; - if (__IN(18, OPM_opt, 32)) { - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"PROCEDURE CheckAssign", 22); - OPM_LogWLn(); - } y = ynode->typ; f = x->form; g = y->form; - if (__IN(18, OPM_opt, 32)) { - OPM_LogWStr((CHAR*)"y.form = ", 10); - OPM_LogWNum(y->form, 0); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"f = ", 5); - OPM_LogWNum(f, 0); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"g = ", 5); - OPM_LogWNum(g, 0); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"ynode.typ.syze = ", 18); - OPM_LogWNum(ynode->typ->size, 0); - OPM_LogWLn(); - } if (ynode->class == 8 || (ynode->class == 9 && f != 12)) { OPB_err(126); } @@ -2367,7 +2348,7 @@ static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpa atyp = atyp->BaseTyp; if ((fvarpar && ftyp == OPT_bytetyp)) { if (!__IN(f, 0x0c, 32) || !((__IN(atyp->form, 0x1e, 32) && atyp->size == 1))) { - if (__IN(18, OPM_opt, 32)) { + if (__IN(18, OPM_Options, 32)) { OPB_err(-301); } } diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index 97860bfc..8c0fd594 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index e4c0eb06..4c9ae495 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -989,7 +989,7 @@ static void OPC_IdentList (OPT_Object obj, int16 vis) OPC_Ident(obj); OPM_WriteString((CHAR*)"__typ", 6); base = NIL; - } else if ((((((__IN(5, OPM_opt, 32) && vis == 0)) && obj->mnolev > 0)) && obj->typ->form == 11)) { + } else if ((((((__IN(5, OPM_Options, 32) && vis == 0)) && obj->mnolev > 0)) && obj->typ->form == 11)) { OPM_WriteString((CHAR*)" = NIL", 7); } } @@ -1153,7 +1153,7 @@ static void OPC_GenHeaderMsg (void) OPM_Write(' '); i = 0; while (i <= 31) { - if (__IN(i, OPM_glbopt, 32)) { + if (__IN(i, OPM_Options, 32)) { switch (i) { case 0: OPM_Write('x'); @@ -1355,7 +1355,7 @@ void OPC_EnterBody (void) { OPM_WriteLn(); OPM_WriteString((CHAR*)"export ", 8); - if (__IN(10, OPM_opt, 32)) { + if (__IN(10, OPM_Options, 32)) { OPM_WriteString((CHAR*)"int main(int argc, char **argv)", 32); OPM_WriteLn(); } else { @@ -1366,20 +1366,20 @@ void OPC_EnterBody (void) } OPC_BegBlk(); OPC_BegStat(); - if (__IN(10, OPM_opt, 32)) { + if (__IN(10, OPM_Options, 32)) { OPM_WriteString((CHAR*)"__INIT(argc, argv)", 19); } else { OPM_WriteString((CHAR*)"__DEFMOD", 9); } OPC_EndStat(); - if ((__IN(10, OPM_opt, 32) && 0)) { + if ((__IN(10, OPM_Options, 32) && 0)) { OPC_BegStat(); OPM_WriteString((CHAR*)"/*don`t do it!*/ printf(\"DEMO VERSION: DO NOT USE THIS PROGRAM FOR ANY COMMERCIAL PURPOSE\\n\")", 94); OPC_EndStat(); } OPC_InitImports(OPT_topScope->right); OPC_BegStat(); - if (__IN(10, OPM_opt, 32)) { + if (__IN(10, OPM_Options, 32)) { OPM_WriteString((CHAR*)"__REGMAIN(\"", 12); } else { OPM_WriteString((CHAR*)"__REGMOD(\"", 11); @@ -1399,7 +1399,7 @@ void OPC_EnterBody (void) void OPC_ExitBody (void) { OPC_BegStat(); - if (__IN(10, OPM_opt, 32)) { + if (__IN(10, OPM_Options, 32)) { OPM_WriteString((CHAR*)"__FINI;", 8); } else { OPM_WriteString((CHAR*)"__ENDMOD;", 10); diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index 3325aded..e681f43d 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 7234f518..534a5c0d 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -19,7 +19,14 @@ typedef static CHAR OPM_SourceFileName[256]; -export int16 OPM_AddressSize, OPM_Alignment, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; +static CHAR OPM_GlobalModel[10]; +export CHAR OPM_Model[10]; +static int16 OPM_GlobalAddressSize; +export int16 OPM_AddressSize; +static int16 OPM_GlobalAlignment; +export int16 OPM_Alignment; +export SET OPM_GlobalOptions, OPM_Options; +export int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize, OPM_MaxSet; export int64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; @@ -27,7 +34,6 @@ export int32 OPM_curpos, OPM_errpos, OPM_breakpc; export int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; export CHAR OPM_modName[32]; export CHAR OPM_objname[64]; -export SET OPM_opt, OPM_glbopt; static int32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; static Texts_Reader OPM_inR; static Texts_Text OPM_Log; @@ -36,8 +42,7 @@ static Files_Rider OPM_oldSF, OPM_newSF; static Files_Rider OPM_R[3]; static Files_File OPM_oldSFile, OPM_newSFile, OPM_HFile, OPM_BFile, OPM_HIFile; static int16 OPM_S; -static CHAR OPM_OBERON[1024]; -static CHAR OPM_MODULES[1024]; +export CHAR OPM_ResourceDir[1024]; static void OPM_Append (Files_Rider *R, address *R__typ, Files_File F); @@ -50,8 +55,6 @@ export void OPM_FPrintReal (int32 *fp, REAL real); export void OPM_FPrintSet (int32 *fp, SET set); static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 pos); export void OPM_Get (CHAR *ch); -static void OPM_GetProperties (void); -static void OPM_GetProperty (Texts_Scanner *S, address *S__typ, CHAR *name, LONGINT name__len, int16 *size, int16 *align); export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); export void OPM_InitOptions (void); export int16 OPM_Integer (int64 n); @@ -68,7 +71,7 @@ export void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); export void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); export BOOLEAN OPM_OpenPar (void); export void OPM_RegisterNewSym (void); -static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt); +static void OPM_ScanOptions (CHAR *s, LONGINT s__len); static void OPM_ShowLine (int64 pos); export int64 OPM_SignedMaximum (int32 bytecount); export int64 OPM_SignedMinimum (int32 bytecount); @@ -93,10 +96,8 @@ export void OPM_WriteString (CHAR *s, LONGINT s__len); export void OPM_WriteStringVar (CHAR *s, LONGINT s__len); export BOOLEAN OPM_eofSF (void); export void OPM_err (int16 n); -static int32 OPM_minusop (int32 i); -static int32 OPM_power0 (int32 i, int32 j); -#define OPM_GetAlignment(a) struct {char c; long long l;} s; *a = (char*)&s.l - (char*)&s +#define OPM_GetAlignment(a) struct {char c; long long l;} _s; *a = (char*)&_s.l - (char*)&_s void OPM_LogW (CHAR ch) { @@ -120,6 +121,23 @@ void OPM_LogWLn (void) Console_Ln(); } +int64 OPM_SignedMaximum (int32 bytecount) +{ + int64 _o_result; + int64 result; + result = 1; + result = __LSH(result, __ASHL(bytecount, 3) - 1, 64); + _o_result = result - 1; + return _o_result; +} + +int64 OPM_SignedMinimum (int32 bytecount) +{ + int64 _o_result; + _o_result = -OPM_SignedMaximum(bytecount) - 1; + return _o_result; +} + int32 OPM_Longint (int64 n) { int32 _o_result; @@ -134,7 +152,7 @@ int16 OPM_Integer (int64 n) return _o_result; } -static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) +static void OPM_ScanOptions (CHAR *s, LONGINT s__len) { int16 i; __DUP(s, s__len, CHAR); @@ -142,75 +160,57 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) while (s[__X(i, s__len)] != 0x00) { switch (s[__X(i, s__len)]) { case 'p': - *opt = *opt ^ 0x20; + OPM_Options = OPM_Options ^ 0x20; break; case 'a': - *opt = *opt ^ 0x80; + OPM_Options = OPM_Options ^ 0x80; break; case 'r': - *opt = *opt ^ 0x04; + OPM_Options = OPM_Options ^ 0x04; break; case 't': - *opt = *opt ^ 0x08; + OPM_Options = OPM_Options ^ 0x08; break; case 'x': - *opt = *opt ^ 0x01; + OPM_Options = OPM_Options ^ 0x01; break; case 'e': - *opt = *opt ^ 0x0200; + OPM_Options = OPM_Options ^ 0x0200; break; case 's': - *opt = *opt ^ 0x10; + OPM_Options = OPM_Options ^ 0x10; break; case 'F': - *opt = *opt ^ 0x020000; + OPM_Options = OPM_Options ^ 0x020000; break; case 'm': - *opt = *opt ^ 0x0400; + OPM_Options = OPM_Options ^ 0x0400; break; case 'M': - *opt = *opt ^ 0x8000; + OPM_Options = OPM_Options ^ 0x8000; break; case 'S': - *opt = *opt ^ 0x2000; + OPM_Options = OPM_Options ^ 0x2000; break; case 'c': - *opt = *opt ^ 0x4000; + OPM_Options = OPM_Options ^ 0x4000; break; case 'f': - *opt = *opt ^ 0x010000; + OPM_Options = OPM_Options ^ 0x010000; break; case 'V': - *opt = *opt ^ 0x040000; + OPM_Options = OPM_Options ^ 0x040000; break; case 'O': if (i + 1 >= Strings_Length(s, s__len)) { OPM_LogWStr((CHAR*)"-O option requires following size model character.", 51); OPM_LogWLn(); } else { - switch (s[__X(i + 1, s__len)]) { - case '2': - OPM_ShortintSize = 1; - OPM_IntegerSize = 2; - OPM_LongintSize = 4; - OPM_SetSize = 4; - break; - case 'V': - OPM_ShortintSize = 1; - OPM_IntegerSize = 4; - OPM_LongintSize = 8; - OPM_SetSize = 8; - break; - case 'C': - OPM_ShortintSize = 2; - OPM_IntegerSize = 4; - OPM_LongintSize = 8; - OPM_SetSize = 8; - break; - default: - OPM_LogWStr((CHAR*)"Unrecognised size model character following -O.", 48); - OPM_LogWLn(); - break; + OPM_Model[0] = s[__X(i + 1, s__len)]; + OPM_Model[1] = 0x00; + if ((((OPM_Model[0] != '2' && OPM_Model[0] != 'C')) && OPM_Model[0] != 'V')) { + OPM_LogWStr((CHAR*)"Unrecognised size model character following -O.", 48); + OPM_LogWLn(); } i += 1; } @@ -358,39 +358,119 @@ BOOLEAN OPM_OpenPar (void) _o_result = 0; return _o_result; } else { + OPM_AddressSize = 4; + OPM_GetAlignment(&OPM_Alignment); + __MOVE("2", OPM_Model, 2); + OPM_Options = 0xa9; OPM_S = 1; s[0] = 0x00; Platform_GetArg(OPM_S, (void*)s, 256); - OPM_glbopt = 0xa9; while (s[0] == '-') { - OPM_ScanOptions(s, 256, &OPM_glbopt); + OPM_ScanOptions(s, 256); OPM_S += 1; s[0] = 0x00; Platform_GetArg(OPM_S, (void*)s, 256); } + OPM_GlobalAddressSize = OPM_AddressSize; + OPM_GlobalAlignment = OPM_Alignment; + __COPY(OPM_Model, OPM_GlobalModel, 10); + OPM_GlobalOptions = OPM_Options; _o_result = 1; return _o_result; } __RETCHK; } +static void OPM_VerboseListSizes (void) +{ + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Type Size", 15); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"SHORTINT ", 12); + OPM_LogWNum(OPM_ShortintSize, 4); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"INTEGER ", 12); + OPM_LogWNum(OPM_IntegerSize, 4); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"LONGINT ", 12); + OPM_LogWNum(OPM_LongintSize, 4); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"SET ", 12); + OPM_LogWNum(OPM_SetSize, 4); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"ADDRESS ", 12); + OPM_LogWNum(OPM_AddressSize, 4); + OPM_LogWLn(); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Alignment: ", 12); + OPM_LogWNum(OPM_Alignment, 4); + OPM_LogWLn(); +} + void OPM_InitOptions (void) { CHAR s[256]; - OPM_opt = OPM_glbopt; + CHAR searchpath[1024], modules[1024]; + CHAR MODULES[1024]; + OPM_Options = OPM_GlobalOptions; + __COPY(OPM_GlobalModel, OPM_Model, 10); + OPM_Alignment = OPM_GlobalAlignment; + OPM_AddressSize = OPM_GlobalAddressSize; s[0] = 0x00; Platform_GetArg(OPM_S, (void*)s, 256); while (s[0] == '-') { - OPM_ScanOptions(s, 256, &OPM_opt); + OPM_ScanOptions(s, 256); OPM_S += 1; s[0] = 0x00; Platform_GetArg(OPM_S, (void*)s, 256); } - if (__IN(15, OPM_opt, 32)) { - OPM_glbopt |= __SETOF(10,32); - OPM_opt |= __SETOF(10,32); + if (__IN(15, OPM_Options, 32)) { + OPM_Options |= __SETOF(10,32); } - OPM_GetProperties(); + OPM_MaxIndex = OPM_SignedMaximum(OPM_AddressSize); + switch (OPM_Model[0]) { + case '2': + OPM_ShortintSize = 1; + OPM_IntegerSize = 2; + OPM_LongintSize = 4; + OPM_SetSize = 4; + break; + case 'C': + OPM_ShortintSize = 2; + OPM_IntegerSize = 4; + OPM_LongintSize = 8; + OPM_SetSize = 8; + break; + case 'V': + OPM_ShortintSize = 1; + OPM_IntegerSize = 4; + OPM_LongintSize = 8; + OPM_SetSize = 8; + break; + default: + OPM_ShortintSize = 1; + OPM_IntegerSize = 2; + OPM_LongintSize = 4; + OPM_SetSize = 4; + break; + } + OPM_MaxSet = __ASHL(OPM_SetSize, 3) - 1; + if (__IN(18, OPM_Options, 32)) { + OPM_VerboseListSizes(); + } + OPM_ResourceDir[0] = 0x00; + Strings_Append((CHAR*)"/", 2, (void*)OPM_ResourceDir, 1024); + Strings_Append(OPM_Model, 10, (void*)OPM_ResourceDir, 1024); + modules[0] = 0x00; + Platform_GetEnv((CHAR*)"MODULES", 8, (void*)modules, 1024); + __MOVE(".", searchpath, 2); + Platform_GetEnv((CHAR*)"OBERON", 7, (void*)searchpath, 1024); + Strings_Append((CHAR*)";.;", 4, (void*)searchpath, 1024); + Strings_Append(modules, 1024, (void*)searchpath, 1024); + Strings_Append((CHAR*)";", 2, (void*)searchpath, 1024); + Strings_Append(OPM_ResourceDir, 1024, (void*)searchpath, 1024); + Strings_Append((CHAR*)"/sym;", 6, (void*)searchpath, 1024); + Files_SetSearchPath(searchpath, 1024); } void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len) @@ -474,20 +554,20 @@ static void OPM_LogErrMsg (int16 n) int16 i; CHAR buf[1024]; if (n >= 0) { - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"31m", 4); } OPM_LogWStr((CHAR*)" err ", 7); - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } } else { - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"35m", 4); } OPM_LogWStr((CHAR*)" warning ", 11); n = -n; - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } } @@ -560,11 +640,11 @@ static void OPM_ShowLine (int64 pos) OPM_LogW(' '); i -= 1; } - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"32m", 4); } OPM_LogW('^'); - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } Files_Close(f); @@ -654,106 +734,6 @@ void OPM_FPrintLReal (int32 *fp, LONGREAL lr) OPM_FPrint(&*fp, h); } -static void OPM_GetProperty (Texts_Scanner *S, address *S__typ, CHAR *name, LONGINT name__len, int16 *size, int16 *align) -{ - __DUP(name, name__len, CHAR); - if (((*S).class == 1 && __STRCMP((*S).s, name) == 0)) { - Texts_Scan(&*S, S__typ); - if ((*S).class == 3) { - *size = (int16)(*S).i; - Texts_Scan(&*S, S__typ); - } else { - OPM_Mark(-157, -1); - } - if ((*S).class == 3) { - *align = (int16)(*S).i; - Texts_Scan(&*S, S__typ); - } else { - OPM_Mark(-157, -1); - } - } else { - OPM_Mark(-157, -1); - } - __DEL(name); -} - -static int32 OPM_minusop (int32 i) -{ - int32 _o_result; - _o_result = -i; - return _o_result; -} - -static int32 OPM_power0 (int32 i, int32 j) -{ - int32 _o_result; - int32 k, p; - k = 1; - p = i; - do { - p = p * i; - k += 1; - } while (!(k == j)); - _o_result = p; - return _o_result; -} - -static void OPM_VerboseListSizes (void) -{ - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Type Size", 17); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"SHORTINT ", 14); - OPM_LogWNum(OPM_ShortintSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"INTEGER ", 14); - OPM_LogWNum(OPM_IntegerSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"LONGINT ", 14); - OPM_LogWNum(OPM_LongintSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"SET ", 14); - OPM_LogWNum(OPM_SetSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"ADDRESS ", 14); - OPM_LogWNum(OPM_AddressSize, 4); - OPM_LogWLn(); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Alignment: ", 12); - OPM_LogWNum(OPM_Alignment, 4); - OPM_LogWLn(); -} - -int64 OPM_SignedMaximum (int32 bytecount) -{ - int64 _o_result; - int64 result; - result = 1; - result = __LSH(result, __ASHL(bytecount, 3) - 1, 64); - _o_result = result - 1; - return _o_result; -} - -int64 OPM_SignedMinimum (int32 bytecount) -{ - int64 _o_result; - _o_result = -OPM_SignedMaximum(bytecount) - 1; - return _o_result; -} - -static void OPM_GetProperties (void) -{ - OPM_MaxReal = 3.40282346000000e+038; - OPM_MaxLReal = 1.79769296342094e+308; - OPM_MinReal = -OPM_MaxReal; - OPM_MinLReal = -OPM_MaxLReal; - OPM_MaxSet = __ASHL(OPM_SetSize, 3) - 1; - OPM_MaxIndex = OPM_SignedMaximum(OPM_AddressSize); - if (__IN(18, OPM_opt, 32)) { - OPM_VerboseListSizes(); - } -} - void OPM_SymRCh (CHAR *ch) { Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&*ch); @@ -848,7 +828,7 @@ void OPM_SymWLReal (LONGREAL lr) void OPM_RegisterNewSym (void) { - if (__STRCMP(OPM_modName, "SYSTEM") != 0 || __IN(10, OPM_opt, 32)) { + if (__STRCMP(OPM_modName, "SYSTEM") != 0 || __IN(10, OPM_Options, 32)) { Files_Register(OPM_newSFile); } } @@ -1047,10 +1027,10 @@ void OPM_CloseFiles (void) } if (OPM_noerr) { if (__STRCMP(OPM_modName, "SYSTEM") == 0) { - if (!__IN(10, OPM_opt, 32)) { + if (!__IN(10, OPM_Options, 32)) { Files_Register(OPM_BFile); } - } else if (!__IN(10, OPM_opt, 32)) { + } else if (!__IN(10, OPM_Options, 32)) { OPM_Append(&OPM_R[2], Files_Rider__typ, OPM_HFile); Files_Register(OPM_HIFile); Files_Register(OPM_BFile); @@ -1110,22 +1090,10 @@ export void *OPM__init(void) __REGCMD("RegisterNewSym", OPM_RegisterNewSym); __REGCMD("WriteLn", OPM_WriteLn); /* BEGIN */ + OPM_MaxReal = 3.40282346000000e+038; + OPM_MaxLReal = 1.79769296342094e+308; + OPM_MinReal = -OPM_MaxReal; + OPM_MinLReal = -OPM_MaxLReal; Texts_OpenWriter(&OPM_W, Texts_Writer__typ); - OPM_MODULES[0] = 0x00; - Platform_GetEnv((CHAR*)"MODULES", 8, (void*)OPM_MODULES, 1024); - __MOVE(".", OPM_OBERON, 2); - Platform_GetEnv((CHAR*)"OBERON", 7, (void*)OPM_OBERON, 1024); - Strings_Append((CHAR*)";.;", 4, (void*)OPM_OBERON, 1024); - Strings_Append(OPM_MODULES, 1024, (void*)OPM_OBERON, 1024); - Strings_Append((CHAR*)";", 2, (void*)OPM_OBERON, 1024); - Strings_Append((CHAR*)"", 1, (void*)OPM_OBERON, 1024); - Strings_Append((CHAR*)"/sym;", 6, (void*)OPM_OBERON, 1024); - Files_SetSearchPath(OPM_OBERON, 1024); - OPM_AddressSize = 4; - OPM_GetAlignment(&OPM_Alignment); - OPM_ShortintSize = 1; - OPM_IntegerSize = 2; - OPM_LongintSize = 4; - OPM_SetSize = 4; __ENDMOD; } diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index e249edd5..933ef1b5 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h @@ -6,7 +6,10 @@ #include "SYSTEM.h" -import int16 OPM_AddressSize, OPM_Alignment, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; +import CHAR OPM_Model[10]; +import int16 OPM_AddressSize, OPM_Alignment; +import SET OPM_GlobalOptions, OPM_Options; +import int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize, OPM_MaxSet; import int64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; @@ -14,7 +17,7 @@ import int32 OPM_curpos, OPM_errpos, OPM_breakpc; import int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; import CHAR OPM_modName[32]; import CHAR OPM_objname[64]; -import SET OPM_opt, OPM_glbopt; +import CHAR OPM_ResourceDir[1024]; import void OPM_CloseFiles (void); diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index 1e5c6674..010efab1 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index 3b9acd86..373d8daa 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index ee182741..f8ed61bf 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index 1514d9eb..1f02668b 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 0a1f8f54..3f54ed72 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -1867,7 +1867,7 @@ void OPT_Export (BOOLEAN *ext, BOOLEAN *new) } OPT_OutObj(OPT_topScope->right); *ext = (OPT_sfpresent && OPT_symExtended); - *new = (!OPT_sfpresent || OPT_symNew) || __IN(17, OPM_opt, 32); + *new = (!OPT_sfpresent || OPT_symNew) || __IN(17, OPM_Options, 32); if ((((OPM_noerr && OPT_sfpresent)) && OPT_impCtxt.reffp != OPT_expCtxt.reffp)) { *new = 1; if (!OPT_extsf) { diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index d4f953ba..202c8278 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index a70a40bf..ff99f665 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -211,7 +211,7 @@ static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp return _o_result; break; case 5: - if (__IN(3, OPM_opt, 32)) { + if (__IN(3, OPM_Options, 32)) { _o_result = 10; return _o_result; } else { @@ -397,7 +397,7 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int16 prec) OPM_WriteInt(__ASHL(newtype->size, 3)); OPM_Write(')'); } else if (to == 4) { - if ((newtype->size < n->typ->size && __IN(2, OPM_opt, 32))) { + if ((newtype->size < n->typ->size && __IN(2, OPM_Options, 32))) { OPM_WriteString((CHAR*)"__SHORT", 8); if (OPV_SideEffects(n)) { OPM_Write('F'); @@ -412,7 +412,7 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int16 prec) OPV_Entier(n, 9); } } else if (to == 3) { - if (__IN(2, OPM_opt, 32)) { + if (__IN(2, OPM_Options, 32)) { OPM_WriteString((CHAR*)"__CHR", 6); if (OPV_SideEffects(n)) { OPM_Write('F'); @@ -453,7 +453,7 @@ static void OPV_TypeOf (OPT_Node n) static void OPV_Index (OPT_Node n, OPT_Node d, int16 prec, int16 dim) { - if (!__IN(0, OPM_opt, 32) || (n->right->class == 7 && (n->right->conval->intval == 0 || n->left->typ->comp != 3))) { + if (!__IN(0, OPM_Options, 32) || (n->right->class == 7 && (n->right->conval->intval == 0 || n->left->typ->comp != 3))) { OPV_expr(n->right, prec); } else { if (OPV_SideEffects(n->right)) { @@ -575,7 +575,7 @@ static void OPV_design (OPT_Node n, int16 prec) case 5: typ = n->typ; obj = n->left->obj; - if (__IN(3, OPM_opt, 32)) { + if (__IN(3, OPM_Options, 32)) { if (typ->comp == 4) { OPM_WriteString((CHAR*)"__GUARDR(", 10); if ((int16)obj->mnolev != OPM_level) { @@ -614,7 +614,7 @@ static void OPV_design (OPT_Node n, int16 prec) } break; case 6: - if (__IN(3, OPM_opt, 32)) { + if (__IN(3, OPM_Options, 32)) { if (n->left->class == 1) { OPM_WriteString((CHAR*)"__GUARDEQR(", 12); OPC_CompleteIdent(n->left->obj); @@ -1442,7 +1442,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) case 20: if (n->subcl != 32) { OPV_IfStat(n, 0, outerProc); - } else if (__IN(7, OPM_opt, 32)) { + } else if (__IN(7, OPM_Options, 32)) { OPM_WriteString((CHAR*)"__ASSERT(", 10); OPV_expr(n->left->left->left, -1); OPM_WriteString((CHAR*)", ", 3); @@ -1508,7 +1508,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) break; case 26: if (OPM_level == 0) { - if (__IN(10, OPM_opt, 32)) { + if (__IN(10, OPM_Options, 32)) { OPM_WriteString((CHAR*)"__FINI", 7); } else { OPM_WriteString((CHAR*)"__ENDMOD", 9); @@ -1553,7 +1553,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) void OPV_Module (OPT_Node prog) { - if (!__IN(10, OPM_opt, 32)) { + if (!__IN(10, OPM_Options, 32)) { OPC_GenHdr(prog->right); OPC_GenHdrIncludes(); } diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index 0a9135f5..a44fb5b5 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index ef0c0dbe..18c66534 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -65,6 +65,7 @@ export int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, addres export int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); export BOOLEAN Platform_Inaccessible (int16 e); export void Platform_Init (int16 argc, int32 argvadr); +export BOOLEAN Platform_Interrupted (int16 e); export void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); export int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); export BOOLEAN Platform_NoSuchDirectory (int16 e); @@ -115,6 +116,7 @@ export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT #define Platform_ECONNABORTED() ECONNABORTED #define Platform_ECONNREFUSED() ECONNREFUSED #define Platform_EHOSTUNREACH() EHOSTUNREACH +#define Platform_EINTR() EINTR #define Platform_EMFILE() EMFILE #define Platform_ENETUNREACH() ENETUNREACH #define Platform_ENFILE() ENFILE @@ -218,6 +220,13 @@ BOOLEAN Platform_ConnectionFailed (int16 e) return _o_result; } +BOOLEAN Platform_Interrupted (int16 e) +{ + BOOLEAN _o_result; + _o_result = e == Platform_EINTR(); + return _o_result; +} + int32 Platform_OSAllocate (int32 size) { int32 _o_result; @@ -618,13 +627,11 @@ int16 Platform_Chdir (CHAR *n, LONGINT n__len) { int16 _o_result; int16 r; - r = Platform_chdir(n, n__len); - Platform_getcwd((void*)Platform_CWD, 256); - if (r < 0) { - _o_result = Platform_err(); + if ((Platform_chdir(n, n__len) >= 0 && Platform_getcwd((void*)Platform_CWD, 256) != NIL)) { + _o_result = 0; return _o_result; } else { - _o_result = 0; + _o_result = Platform_err(); return _o_result; } __RETCHK; @@ -784,9 +791,10 @@ export void *Platform__init(void) Platform_HaltHandler = NIL; Platform_TimeStart = 0; Platform_TimeStart = Platform_Time(); - Platform_CWD[0] = 0x00; - Platform_getcwd((void*)Platform_CWD, 256); Platform_PID = Platform_getpid(); + if (Platform_getcwd((void*)Platform_CWD, 256) == NIL) { + Platform_CWD[0] = 0x00; + } Platform_SeekSet = Platform_seekset(); Platform_SeekCur = Platform_seekcur(); Platform_SeekEnd = Platform_seekend(); diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index 986a65ef..158cb341 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h @@ -50,6 +50,7 @@ import int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, addres import int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); import BOOLEAN Platform_Inaccessible (int16 e); import void Platform_Init (int16 argc, int32 argvadr); +import BOOLEAN Platform_Interrupted (int16 e); import void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); import int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); import BOOLEAN Platform_NoSuchDirectory (int16 e); diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index e75d35ff..57e22100 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index 8a42b39b..f3404dda 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index 9f9562db..bcf3cb9b 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index da213d81..9418692a 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index ab510cdb..28f099a4 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index 64e78861..0afd65f7 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/errors.c b/bootstrap/unix-48/errors.c index 34e6fae3..ba890a17 100644 --- a/bootstrap/unix-48/errors.c +++ b/bootstrap/unix-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/errors.h b/bootstrap/unix-48/errors.h index ce275b8c..d8124792 100644 --- a/bootstrap/unix-48/errors.h +++ b/bootstrap/unix-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index fd7974da..76fdc084 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -12,10 +12,11 @@ #include "Strings.h" -static CHAR extTools_compilationOptions[1023], extTools_CFLAGS[1023]; +static CHAR extTools_CFLAGS[1023]; export void extTools_Assemble (CHAR *moduleName, LONGINT moduleName__len); +static void extTools_InitialiseCompilerCommand (CHAR *s, LONGINT s__len); export void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN statically, CHAR *additionalopts, LONGINT additionalopts__len); static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGINT cmd__len); @@ -25,7 +26,7 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN int16 r, status, exitcode; __DUP(title, title__len, CHAR); __DUP(cmd, cmd__len, CHAR); - if (__IN(18, OPM_opt, 32)) { + if (__IN(18, OPM_Options, 32)) { Console_String(title, title__len); Console_String(cmd, cmd__len); Console_Ln(); @@ -60,12 +61,22 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN __DEL(cmd); } +static void extTools_InitialiseCompilerCommand (CHAR *s, LONGINT s__len) +{ + __COPY("gcc -g -O1", s, s__len); + Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); + Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); + Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); + Platform_GetEnv((CHAR*)"CFLAGS", 7, (void*)extTools_CFLAGS, 1023); + Strings_Append(extTools_CFLAGS, 1023, (void*)s, s__len); + Strings_Append((CHAR*)" ", 2, (void*)s, s__len); +} + void extTools_Assemble (CHAR *moduleName, LONGINT moduleName__len) { CHAR cmd[1023]; __DUP(moduleName, moduleName__len, CHAR); - __MOVE("gcc -g -O1", cmd, 11); - Strings_Append(extTools_compilationOptions, 1023, (void*)cmd, 1023); + extTools_InitialiseCompilerCommand((void*)cmd, 1023); Strings_Append((CHAR*)"-c ", 4, (void*)cmd, 1023); Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); Strings_Append((CHAR*)".c", 3, (void*)cmd, 1023); @@ -77,9 +88,7 @@ void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN stati { CHAR cmd[1023]; __DUP(additionalopts, additionalopts__len, CHAR); - __MOVE("gcc -g -O1", cmd, 11); - Strings_Append((CHAR*)" ", 2, (void*)cmd, 1023); - Strings_Append(extTools_compilationOptions, 1023, (void*)cmd, 1023); + extTools_InitialiseCompilerCommand((void*)cmd, 1023); Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); Strings_Append((CHAR*)".c ", 4, (void*)cmd, 1023); Strings_Append(additionalopts, additionalopts__len, (void*)cmd, 1023); @@ -92,6 +101,7 @@ void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN stati Strings_Append((CHAR*)"", 1, (void*)cmd, 1023); Strings_Append((CHAR*)"/lib\"", 6, (void*)cmd, 1023); Strings_Append((CHAR*)" -l voc", 8, (void*)cmd, 1023); + Strings_Append(OPM_Model, 10, (void*)cmd, 1023); extTools_execute((CHAR*)"Assemble and link: ", 20, cmd, 1023); __DEL(additionalopts); } @@ -107,11 +117,5 @@ export void *extTools__init(void) __MODULE_IMPORT(Strings); __REGMOD("extTools", 0); /* BEGIN */ - Strings_Append((CHAR*)" -I \"", 6, (void*)extTools_compilationOptions, 1023); - Strings_Append((CHAR*)"", 1, (void*)extTools_compilationOptions, 1023); - Strings_Append((CHAR*)"/include\" ", 11, (void*)extTools_compilationOptions, 1023); - Platform_GetEnv((CHAR*)"CFLAGS", 7, (void*)extTools_CFLAGS, 1023); - Strings_Append(extTools_CFLAGS, 1023, (void*)extTools_compilationOptions, 1023); - Strings_Append((CHAR*)" ", 2, (void*)extTools_compilationOptions, 1023); __ENDMOD; } diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index f87adfac..bb5be954 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/vt100.c b/bootstrap/unix-48/vt100.c index ca56f466..c44586d2 100644 --- a/bootstrap/unix-48/vt100.c +++ b/bootstrap/unix-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/vt100.h b/bootstrap/unix-48/vt100.h index f5b8588f..c9a01a7c 100644 --- a/bootstrap/unix-48/vt100.h +++ b/bootstrap/unix-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-88/Compiler.c b/bootstrap/unix-88/Compiler.c index 6444021c..1b3b14f1 100644 --- a/bootstrap/unix-88/Compiler.c +++ b/bootstrap/unix-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define INTEGER int16 #define LONGINT int32 @@ -32,7 +32,7 @@ void Compiler_Module (BOOLEAN *done) { BOOLEAN ext, new; OPT_Node p = NIL; - OPP_Module(&p, OPM_opt); + OPP_Module(&p, OPM_Options); if (OPM_noerr) { OPV_Init(); OPT_InitRecno(); @@ -43,22 +43,22 @@ void Compiler_Module (BOOLEAN *done) OPC_Init(); OPV_Module(p); if (OPM_noerr) { - if ((__IN(10, OPM_opt, 32) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { + if ((__IN(10, OPM_Options, 32) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { OPM_DeleteNewSym(); - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"32m", 4); } OPM_LogWStr((CHAR*)" Main program.", 16); - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } } else { if (new) { - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"32m", 4); } OPM_LogWStr((CHAR*)" New symbol file.", 19); - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } OPM_RegisterNewSym(); @@ -115,17 +115,17 @@ void Compiler_Translate (void) OPM_LogWLn(); Platform_Exit(1); } - if (!__IN(13, OPM_opt, 32)) { - if (__IN(14, OPM_opt, 32)) { + if (!__IN(13, OPM_Options, 32)) { + if (__IN(14, OPM_Options, 32)) { extTools_Assemble(OPM_modName, 32); } else { - if (!__IN(10, OPM_opt, 32)) { + if (!__IN(10, OPM_Options, 32)) { extTools_Assemble(OPM_modName, 32); Strings_Append((CHAR*)" ", 2, (void*)modulesobj, 2048); Strings_Append(OPM_modName, 32, (void*)modulesobj, 2048); Strings_Append((CHAR*)".o", 3, (void*)modulesobj, 2048); } else { - extTools_LinkMain((void*)OPM_modName, 32, __IN(15, OPM_opt, 32), modulesobj, 2048); + extTools_LinkMain((void*)OPM_modName, 32, __IN(15, OPM_Options, 32), modulesobj, 2048); } } } diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index 28528f64..85c8cf89 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index d9030dbe..a365d693 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Console.c b/bootstrap/unix-88/Console.c index 5bf17489..c2089f05 100644 --- a/bootstrap/unix-88/Console.c +++ b/bootstrap/unix-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-88/Console.h b/bootstrap/unix-88/Console.h index 4eb27c8b..08f4e38e 100644 --- a/bootstrap/unix-88/Console.h +++ b/bootstrap/unix-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 5b82978c..efa49511 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 75495244..5aebf125 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index ca208a31..71ad15a1 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index 3fcd0b28..0cd62e2b 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index e3ff56bd..0e05b5aa 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index 93e2105b..a2ceebdf 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index d211135a..e370e621 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -1541,28 +1541,9 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPT_Struct y = NIL; int16 f, g; OPT_Struct p = NIL, q = NIL; - if (__IN(18, OPM_opt, 32)) { - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"PROCEDURE CheckAssign", 22); - OPM_LogWLn(); - } y = ynode->typ; f = x->form; g = y->form; - if (__IN(18, OPM_opt, 32)) { - OPM_LogWStr((CHAR*)"y.form = ", 10); - OPM_LogWNum(y->form, 0); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"f = ", 5); - OPM_LogWNum(f, 0); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"g = ", 5); - OPM_LogWNum(g, 0); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"ynode.typ.syze = ", 18); - OPM_LogWNum(ynode->typ->size, 0); - OPM_LogWLn(); - } if (ynode->class == 8 || (ynode->class == 9 && f != 12)) { OPB_err(126); } @@ -2367,7 +2348,7 @@ static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpa atyp = atyp->BaseTyp; if ((fvarpar && ftyp == OPT_bytetyp)) { if (!__IN(f, 0x0c, 32) || !((__IN(atyp->form, 0x1e, 32) && atyp->size == 1))) { - if (__IN(18, OPM_opt, 32)) { + if (__IN(18, OPM_Options, 32)) { OPB_err(-301); } } diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index 97860bfc..8c0fd594 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index e4c0eb06..4c9ae495 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -989,7 +989,7 @@ static void OPC_IdentList (OPT_Object obj, int16 vis) OPC_Ident(obj); OPM_WriteString((CHAR*)"__typ", 6); base = NIL; - } else if ((((((__IN(5, OPM_opt, 32) && vis == 0)) && obj->mnolev > 0)) && obj->typ->form == 11)) { + } else if ((((((__IN(5, OPM_Options, 32) && vis == 0)) && obj->mnolev > 0)) && obj->typ->form == 11)) { OPM_WriteString((CHAR*)" = NIL", 7); } } @@ -1153,7 +1153,7 @@ static void OPC_GenHeaderMsg (void) OPM_Write(' '); i = 0; while (i <= 31) { - if (__IN(i, OPM_glbopt, 32)) { + if (__IN(i, OPM_Options, 32)) { switch (i) { case 0: OPM_Write('x'); @@ -1355,7 +1355,7 @@ void OPC_EnterBody (void) { OPM_WriteLn(); OPM_WriteString((CHAR*)"export ", 8); - if (__IN(10, OPM_opt, 32)) { + if (__IN(10, OPM_Options, 32)) { OPM_WriteString((CHAR*)"int main(int argc, char **argv)", 32); OPM_WriteLn(); } else { @@ -1366,20 +1366,20 @@ void OPC_EnterBody (void) } OPC_BegBlk(); OPC_BegStat(); - if (__IN(10, OPM_opt, 32)) { + if (__IN(10, OPM_Options, 32)) { OPM_WriteString((CHAR*)"__INIT(argc, argv)", 19); } else { OPM_WriteString((CHAR*)"__DEFMOD", 9); } OPC_EndStat(); - if ((__IN(10, OPM_opt, 32) && 0)) { + if ((__IN(10, OPM_Options, 32) && 0)) { OPC_BegStat(); OPM_WriteString((CHAR*)"/*don`t do it!*/ printf(\"DEMO VERSION: DO NOT USE THIS PROGRAM FOR ANY COMMERCIAL PURPOSE\\n\")", 94); OPC_EndStat(); } OPC_InitImports(OPT_topScope->right); OPC_BegStat(); - if (__IN(10, OPM_opt, 32)) { + if (__IN(10, OPM_Options, 32)) { OPM_WriteString((CHAR*)"__REGMAIN(\"", 12); } else { OPM_WriteString((CHAR*)"__REGMOD(\"", 11); @@ -1399,7 +1399,7 @@ void OPC_EnterBody (void) void OPC_ExitBody (void) { OPC_BegStat(); - if (__IN(10, OPM_opt, 32)) { + if (__IN(10, OPM_Options, 32)) { OPM_WriteString((CHAR*)"__FINI;", 8); } else { OPM_WriteString((CHAR*)"__ENDMOD;", 10); diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index 3325aded..e681f43d 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 4710b95f..297ade25 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -19,7 +19,14 @@ typedef static CHAR OPM_SourceFileName[256]; -export int16 OPM_AddressSize, OPM_Alignment, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; +static CHAR OPM_GlobalModel[10]; +export CHAR OPM_Model[10]; +static int16 OPM_GlobalAddressSize; +export int16 OPM_AddressSize; +static int16 OPM_GlobalAlignment; +export int16 OPM_Alignment; +export SET OPM_GlobalOptions, OPM_Options; +export int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize, OPM_MaxSet; export int64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; @@ -27,7 +34,6 @@ export int32 OPM_curpos, OPM_errpos, OPM_breakpc; export int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; export CHAR OPM_modName[32]; export CHAR OPM_objname[64]; -export SET OPM_opt, OPM_glbopt; static int32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; static Texts_Reader OPM_inR; static Texts_Text OPM_Log; @@ -36,8 +42,7 @@ static Files_Rider OPM_oldSF, OPM_newSF; static Files_Rider OPM_R[3]; static Files_File OPM_oldSFile, OPM_newSFile, OPM_HFile, OPM_BFile, OPM_HIFile; static int16 OPM_S; -static CHAR OPM_OBERON[1024]; -static CHAR OPM_MODULES[1024]; +export CHAR OPM_ResourceDir[1024]; static void OPM_Append (Files_Rider *R, address *R__typ, Files_File F); @@ -50,8 +55,6 @@ export void OPM_FPrintReal (int32 *fp, REAL real); export void OPM_FPrintSet (int32 *fp, SET set); static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 pos); export void OPM_Get (CHAR *ch); -static void OPM_GetProperties (void); -static void OPM_GetProperty (Texts_Scanner *S, address *S__typ, CHAR *name, LONGINT name__len, int16 *size, int16 *align); export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); export void OPM_InitOptions (void); export int16 OPM_Integer (int64 n); @@ -68,7 +71,7 @@ export void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); export void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); export BOOLEAN OPM_OpenPar (void); export void OPM_RegisterNewSym (void); -static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt); +static void OPM_ScanOptions (CHAR *s, LONGINT s__len); static void OPM_ShowLine (int64 pos); export int64 OPM_SignedMaximum (int32 bytecount); export int64 OPM_SignedMinimum (int32 bytecount); @@ -93,10 +96,8 @@ export void OPM_WriteString (CHAR *s, LONGINT s__len); export void OPM_WriteStringVar (CHAR *s, LONGINT s__len); export BOOLEAN OPM_eofSF (void); export void OPM_err (int16 n); -static int32 OPM_minusop (int32 i); -static int32 OPM_power0 (int32 i, int32 j); -#define OPM_GetAlignment(a) struct {char c; long long l;} s; *a = (char*)&s.l - (char*)&s +#define OPM_GetAlignment(a) struct {char c; long long l;} _s; *a = (char*)&_s.l - (char*)&_s void OPM_LogW (CHAR ch) { @@ -120,6 +121,23 @@ void OPM_LogWLn (void) Console_Ln(); } +int64 OPM_SignedMaximum (int32 bytecount) +{ + int64 _o_result; + int64 result; + result = 1; + result = __LSH(result, __ASHL(bytecount, 3) - 1, 64); + _o_result = result - 1; + return _o_result; +} + +int64 OPM_SignedMinimum (int32 bytecount) +{ + int64 _o_result; + _o_result = -OPM_SignedMaximum(bytecount) - 1; + return _o_result; +} + int32 OPM_Longint (int64 n) { int32 _o_result; @@ -134,7 +152,7 @@ int16 OPM_Integer (int64 n) return _o_result; } -static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) +static void OPM_ScanOptions (CHAR *s, LONGINT s__len) { int16 i; __DUP(s, s__len, CHAR); @@ -142,75 +160,57 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) while (s[__X(i, s__len)] != 0x00) { switch (s[__X(i, s__len)]) { case 'p': - *opt = *opt ^ 0x20; + OPM_Options = OPM_Options ^ 0x20; break; case 'a': - *opt = *opt ^ 0x80; + OPM_Options = OPM_Options ^ 0x80; break; case 'r': - *opt = *opt ^ 0x04; + OPM_Options = OPM_Options ^ 0x04; break; case 't': - *opt = *opt ^ 0x08; + OPM_Options = OPM_Options ^ 0x08; break; case 'x': - *opt = *opt ^ 0x01; + OPM_Options = OPM_Options ^ 0x01; break; case 'e': - *opt = *opt ^ 0x0200; + OPM_Options = OPM_Options ^ 0x0200; break; case 's': - *opt = *opt ^ 0x10; + OPM_Options = OPM_Options ^ 0x10; break; case 'F': - *opt = *opt ^ 0x020000; + OPM_Options = OPM_Options ^ 0x020000; break; case 'm': - *opt = *opt ^ 0x0400; + OPM_Options = OPM_Options ^ 0x0400; break; case 'M': - *opt = *opt ^ 0x8000; + OPM_Options = OPM_Options ^ 0x8000; break; case 'S': - *opt = *opt ^ 0x2000; + OPM_Options = OPM_Options ^ 0x2000; break; case 'c': - *opt = *opt ^ 0x4000; + OPM_Options = OPM_Options ^ 0x4000; break; case 'f': - *opt = *opt ^ 0x010000; + OPM_Options = OPM_Options ^ 0x010000; break; case 'V': - *opt = *opt ^ 0x040000; + OPM_Options = OPM_Options ^ 0x040000; break; case 'O': if (i + 1 >= Strings_Length(s, s__len)) { OPM_LogWStr((CHAR*)"-O option requires following size model character.", 51); OPM_LogWLn(); } else { - switch (s[__X(i + 1, s__len)]) { - case '2': - OPM_ShortintSize = 1; - OPM_IntegerSize = 2; - OPM_LongintSize = 4; - OPM_SetSize = 4; - break; - case 'V': - OPM_ShortintSize = 1; - OPM_IntegerSize = 4; - OPM_LongintSize = 8; - OPM_SetSize = 8; - break; - case 'C': - OPM_ShortintSize = 2; - OPM_IntegerSize = 4; - OPM_LongintSize = 8; - OPM_SetSize = 8; - break; - default: - OPM_LogWStr((CHAR*)"Unrecognised size model character following -O.", 48); - OPM_LogWLn(); - break; + OPM_Model[0] = s[__X(i + 1, s__len)]; + OPM_Model[1] = 0x00; + if ((((OPM_Model[0] != '2' && OPM_Model[0] != 'C')) && OPM_Model[0] != 'V')) { + OPM_LogWStr((CHAR*)"Unrecognised size model character following -O.", 48); + OPM_LogWLn(); } i += 1; } @@ -358,39 +358,119 @@ BOOLEAN OPM_OpenPar (void) _o_result = 0; return _o_result; } else { + OPM_AddressSize = 8; + OPM_GetAlignment(&OPM_Alignment); + __MOVE("2", OPM_Model, 2); + OPM_Options = 0xa9; OPM_S = 1; s[0] = 0x00; Platform_GetArg(OPM_S, (void*)s, 256); - OPM_glbopt = 0xa9; while (s[0] == '-') { - OPM_ScanOptions(s, 256, &OPM_glbopt); + OPM_ScanOptions(s, 256); OPM_S += 1; s[0] = 0x00; Platform_GetArg(OPM_S, (void*)s, 256); } + OPM_GlobalAddressSize = OPM_AddressSize; + OPM_GlobalAlignment = OPM_Alignment; + __COPY(OPM_Model, OPM_GlobalModel, 10); + OPM_GlobalOptions = OPM_Options; _o_result = 1; return _o_result; } __RETCHK; } +static void OPM_VerboseListSizes (void) +{ + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Type Size", 15); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"SHORTINT ", 12); + OPM_LogWNum(OPM_ShortintSize, 4); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"INTEGER ", 12); + OPM_LogWNum(OPM_IntegerSize, 4); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"LONGINT ", 12); + OPM_LogWNum(OPM_LongintSize, 4); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"SET ", 12); + OPM_LogWNum(OPM_SetSize, 4); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"ADDRESS ", 12); + OPM_LogWNum(OPM_AddressSize, 4); + OPM_LogWLn(); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Alignment: ", 12); + OPM_LogWNum(OPM_Alignment, 4); + OPM_LogWLn(); +} + void OPM_InitOptions (void) { CHAR s[256]; - OPM_opt = OPM_glbopt; + CHAR searchpath[1024], modules[1024]; + CHAR MODULES[1024]; + OPM_Options = OPM_GlobalOptions; + __COPY(OPM_GlobalModel, OPM_Model, 10); + OPM_Alignment = OPM_GlobalAlignment; + OPM_AddressSize = OPM_GlobalAddressSize; s[0] = 0x00; Platform_GetArg(OPM_S, (void*)s, 256); while (s[0] == '-') { - OPM_ScanOptions(s, 256, &OPM_opt); + OPM_ScanOptions(s, 256); OPM_S += 1; s[0] = 0x00; Platform_GetArg(OPM_S, (void*)s, 256); } - if (__IN(15, OPM_opt, 32)) { - OPM_glbopt |= __SETOF(10,32); - OPM_opt |= __SETOF(10,32); + if (__IN(15, OPM_Options, 32)) { + OPM_Options |= __SETOF(10,32); } - OPM_GetProperties(); + OPM_MaxIndex = OPM_SignedMaximum(OPM_AddressSize); + switch (OPM_Model[0]) { + case '2': + OPM_ShortintSize = 1; + OPM_IntegerSize = 2; + OPM_LongintSize = 4; + OPM_SetSize = 4; + break; + case 'C': + OPM_ShortintSize = 2; + OPM_IntegerSize = 4; + OPM_LongintSize = 8; + OPM_SetSize = 8; + break; + case 'V': + OPM_ShortintSize = 1; + OPM_IntegerSize = 4; + OPM_LongintSize = 8; + OPM_SetSize = 8; + break; + default: + OPM_ShortintSize = 1; + OPM_IntegerSize = 2; + OPM_LongintSize = 4; + OPM_SetSize = 4; + break; + } + OPM_MaxSet = __ASHL(OPM_SetSize, 3) - 1; + if (__IN(18, OPM_Options, 32)) { + OPM_VerboseListSizes(); + } + OPM_ResourceDir[0] = 0x00; + Strings_Append((CHAR*)"/", 2, (void*)OPM_ResourceDir, 1024); + Strings_Append(OPM_Model, 10, (void*)OPM_ResourceDir, 1024); + modules[0] = 0x00; + Platform_GetEnv((CHAR*)"MODULES", 8, (void*)modules, 1024); + __MOVE(".", searchpath, 2); + Platform_GetEnv((CHAR*)"OBERON", 7, (void*)searchpath, 1024); + Strings_Append((CHAR*)";.;", 4, (void*)searchpath, 1024); + Strings_Append(modules, 1024, (void*)searchpath, 1024); + Strings_Append((CHAR*)";", 2, (void*)searchpath, 1024); + Strings_Append(OPM_ResourceDir, 1024, (void*)searchpath, 1024); + Strings_Append((CHAR*)"/sym;", 6, (void*)searchpath, 1024); + Files_SetSearchPath(searchpath, 1024); } void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len) @@ -474,20 +554,20 @@ static void OPM_LogErrMsg (int16 n) int16 i; CHAR buf[1024]; if (n >= 0) { - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"31m", 4); } OPM_LogWStr((CHAR*)" err ", 7); - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } } else { - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"35m", 4); } OPM_LogWStr((CHAR*)" warning ", 11); n = -n; - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } } @@ -560,11 +640,11 @@ static void OPM_ShowLine (int64 pos) OPM_LogW(' '); i -= 1; } - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"32m", 4); } OPM_LogW('^'); - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } Files_Close(f); @@ -654,106 +734,6 @@ void OPM_FPrintLReal (int32 *fp, LONGREAL lr) OPM_FPrint(&*fp, h); } -static void OPM_GetProperty (Texts_Scanner *S, address *S__typ, CHAR *name, LONGINT name__len, int16 *size, int16 *align) -{ - __DUP(name, name__len, CHAR); - if (((*S).class == 1 && __STRCMP((*S).s, name) == 0)) { - Texts_Scan(&*S, S__typ); - if ((*S).class == 3) { - *size = (int16)(*S).i; - Texts_Scan(&*S, S__typ); - } else { - OPM_Mark(-157, -1); - } - if ((*S).class == 3) { - *align = (int16)(*S).i; - Texts_Scan(&*S, S__typ); - } else { - OPM_Mark(-157, -1); - } - } else { - OPM_Mark(-157, -1); - } - __DEL(name); -} - -static int32 OPM_minusop (int32 i) -{ - int32 _o_result; - _o_result = -i; - return _o_result; -} - -static int32 OPM_power0 (int32 i, int32 j) -{ - int32 _o_result; - int32 k, p; - k = 1; - p = i; - do { - p = p * i; - k += 1; - } while (!(k == j)); - _o_result = p; - return _o_result; -} - -static void OPM_VerboseListSizes (void) -{ - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Type Size", 17); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"SHORTINT ", 14); - OPM_LogWNum(OPM_ShortintSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"INTEGER ", 14); - OPM_LogWNum(OPM_IntegerSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"LONGINT ", 14); - OPM_LogWNum(OPM_LongintSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"SET ", 14); - OPM_LogWNum(OPM_SetSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"ADDRESS ", 14); - OPM_LogWNum(OPM_AddressSize, 4); - OPM_LogWLn(); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Alignment: ", 12); - OPM_LogWNum(OPM_Alignment, 4); - OPM_LogWLn(); -} - -int64 OPM_SignedMaximum (int32 bytecount) -{ - int64 _o_result; - int64 result; - result = 1; - result = __LSH(result, __ASHL(bytecount, 3) - 1, 64); - _o_result = result - 1; - return _o_result; -} - -int64 OPM_SignedMinimum (int32 bytecount) -{ - int64 _o_result; - _o_result = -OPM_SignedMaximum(bytecount) - 1; - return _o_result; -} - -static void OPM_GetProperties (void) -{ - OPM_MaxReal = 3.40282346000000e+038; - OPM_MaxLReal = 1.79769296342094e+308; - OPM_MinReal = -OPM_MaxReal; - OPM_MinLReal = -OPM_MaxLReal; - OPM_MaxSet = __ASHL(OPM_SetSize, 3) - 1; - OPM_MaxIndex = OPM_SignedMaximum(OPM_AddressSize); - if (__IN(18, OPM_opt, 32)) { - OPM_VerboseListSizes(); - } -} - void OPM_SymRCh (CHAR *ch) { Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&*ch); @@ -848,7 +828,7 @@ void OPM_SymWLReal (LONGREAL lr) void OPM_RegisterNewSym (void) { - if (__STRCMP(OPM_modName, "SYSTEM") != 0 || __IN(10, OPM_opt, 32)) { + if (__STRCMP(OPM_modName, "SYSTEM") != 0 || __IN(10, OPM_Options, 32)) { Files_Register(OPM_newSFile); } } @@ -1047,10 +1027,10 @@ void OPM_CloseFiles (void) } if (OPM_noerr) { if (__STRCMP(OPM_modName, "SYSTEM") == 0) { - if (!__IN(10, OPM_opt, 32)) { + if (!__IN(10, OPM_Options, 32)) { Files_Register(OPM_BFile); } - } else if (!__IN(10, OPM_opt, 32)) { + } else if (!__IN(10, OPM_Options, 32)) { OPM_Append(&OPM_R[2], Files_Rider__typ, OPM_HFile); Files_Register(OPM_HIFile); Files_Register(OPM_BFile); @@ -1110,22 +1090,10 @@ export void *OPM__init(void) __REGCMD("RegisterNewSym", OPM_RegisterNewSym); __REGCMD("WriteLn", OPM_WriteLn); /* BEGIN */ + OPM_MaxReal = 3.40282346000000e+038; + OPM_MaxLReal = 1.79769296342094e+308; + OPM_MinReal = -OPM_MaxReal; + OPM_MinLReal = -OPM_MaxLReal; Texts_OpenWriter(&OPM_W, Texts_Writer__typ); - OPM_MODULES[0] = 0x00; - Platform_GetEnv((CHAR*)"MODULES", 8, (void*)OPM_MODULES, 1024); - __MOVE(".", OPM_OBERON, 2); - Platform_GetEnv((CHAR*)"OBERON", 7, (void*)OPM_OBERON, 1024); - Strings_Append((CHAR*)";.;", 4, (void*)OPM_OBERON, 1024); - Strings_Append(OPM_MODULES, 1024, (void*)OPM_OBERON, 1024); - Strings_Append((CHAR*)";", 2, (void*)OPM_OBERON, 1024); - Strings_Append((CHAR*)"", 1, (void*)OPM_OBERON, 1024); - Strings_Append((CHAR*)"/sym;", 6, (void*)OPM_OBERON, 1024); - Files_SetSearchPath(OPM_OBERON, 1024); - OPM_AddressSize = 8; - OPM_GetAlignment(&OPM_Alignment); - OPM_ShortintSize = 1; - OPM_IntegerSize = 2; - OPM_LongintSize = 4; - OPM_SetSize = 4; __ENDMOD; } diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index e249edd5..933ef1b5 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h @@ -6,7 +6,10 @@ #include "SYSTEM.h" -import int16 OPM_AddressSize, OPM_Alignment, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; +import CHAR OPM_Model[10]; +import int16 OPM_AddressSize, OPM_Alignment; +import SET OPM_GlobalOptions, OPM_Options; +import int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize, OPM_MaxSet; import int64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; @@ -14,7 +17,7 @@ import int32 OPM_curpos, OPM_errpos, OPM_breakpc; import int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; import CHAR OPM_modName[32]; import CHAR OPM_objname[64]; -import SET OPM_opt, OPM_glbopt; +import CHAR OPM_ResourceDir[1024]; import void OPM_CloseFiles (void); diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index f6a8dfc5..c9986e20 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index 3b9acd86..373d8daa 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index ee182741..f8ed61bf 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index 1514d9eb..1f02668b 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index ad18ebdb..b0a12a18 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -1867,7 +1867,7 @@ void OPT_Export (BOOLEAN *ext, BOOLEAN *new) } OPT_OutObj(OPT_topScope->right); *ext = (OPT_sfpresent && OPT_symExtended); - *new = (!OPT_sfpresent || OPT_symNew) || __IN(17, OPM_opt, 32); + *new = (!OPT_sfpresent || OPT_symNew) || __IN(17, OPM_Options, 32); if ((((OPM_noerr && OPT_sfpresent)) && OPT_impCtxt.reffp != OPT_expCtxt.reffp)) { *new = 1; if (!OPT_extsf) { diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index d4f953ba..202c8278 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 09f3d249..07fa214f 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -211,7 +211,7 @@ static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp return _o_result; break; case 5: - if (__IN(3, OPM_opt, 32)) { + if (__IN(3, OPM_Options, 32)) { _o_result = 10; return _o_result; } else { @@ -397,7 +397,7 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int16 prec) OPM_WriteInt(__ASHL(newtype->size, 3)); OPM_Write(')'); } else if (to == 4) { - if ((newtype->size < n->typ->size && __IN(2, OPM_opt, 32))) { + if ((newtype->size < n->typ->size && __IN(2, OPM_Options, 32))) { OPM_WriteString((CHAR*)"__SHORT", 8); if (OPV_SideEffects(n)) { OPM_Write('F'); @@ -412,7 +412,7 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int16 prec) OPV_Entier(n, 9); } } else if (to == 3) { - if (__IN(2, OPM_opt, 32)) { + if (__IN(2, OPM_Options, 32)) { OPM_WriteString((CHAR*)"__CHR", 6); if (OPV_SideEffects(n)) { OPM_Write('F'); @@ -453,7 +453,7 @@ static void OPV_TypeOf (OPT_Node n) static void OPV_Index (OPT_Node n, OPT_Node d, int16 prec, int16 dim) { - if (!__IN(0, OPM_opt, 32) || (n->right->class == 7 && (n->right->conval->intval == 0 || n->left->typ->comp != 3))) { + if (!__IN(0, OPM_Options, 32) || (n->right->class == 7 && (n->right->conval->intval == 0 || n->left->typ->comp != 3))) { OPV_expr(n->right, prec); } else { if (OPV_SideEffects(n->right)) { @@ -575,7 +575,7 @@ static void OPV_design (OPT_Node n, int16 prec) case 5: typ = n->typ; obj = n->left->obj; - if (__IN(3, OPM_opt, 32)) { + if (__IN(3, OPM_Options, 32)) { if (typ->comp == 4) { OPM_WriteString((CHAR*)"__GUARDR(", 10); if ((int16)obj->mnolev != OPM_level) { @@ -614,7 +614,7 @@ static void OPV_design (OPT_Node n, int16 prec) } break; case 6: - if (__IN(3, OPM_opt, 32)) { + if (__IN(3, OPM_Options, 32)) { if (n->left->class == 1) { OPM_WriteString((CHAR*)"__GUARDEQR(", 12); OPC_CompleteIdent(n->left->obj); @@ -1442,7 +1442,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) case 20: if (n->subcl != 32) { OPV_IfStat(n, 0, outerProc); - } else if (__IN(7, OPM_opt, 32)) { + } else if (__IN(7, OPM_Options, 32)) { OPM_WriteString((CHAR*)"__ASSERT(", 10); OPV_expr(n->left->left->left, -1); OPM_WriteString((CHAR*)", ", 3); @@ -1508,7 +1508,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) break; case 26: if (OPM_level == 0) { - if (__IN(10, OPM_opt, 32)) { + if (__IN(10, OPM_Options, 32)) { OPM_WriteString((CHAR*)"__FINI", 7); } else { OPM_WriteString((CHAR*)"__ENDMOD", 9); @@ -1553,7 +1553,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) void OPV_Module (OPT_Node prog) { - if (!__IN(10, OPM_opt, 32)) { + if (!__IN(10, OPM_Options, 32)) { OPC_GenHdr(prog->right); OPC_GenHdrIncludes(); } diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index 0a9135f5..a44fb5b5 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 5bad2591..26dc3ce5 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -65,6 +65,7 @@ export int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, addres export int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); export BOOLEAN Platform_Inaccessible (int16 e); export void Platform_Init (int16 argc, int64 argvadr); +export BOOLEAN Platform_Interrupted (int16 e); export void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); export int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); export BOOLEAN Platform_NoSuchDirectory (int16 e); @@ -115,6 +116,7 @@ export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT #define Platform_ECONNABORTED() ECONNABORTED #define Platform_ECONNREFUSED() ECONNREFUSED #define Platform_EHOSTUNREACH() EHOSTUNREACH +#define Platform_EINTR() EINTR #define Platform_EMFILE() EMFILE #define Platform_ENETUNREACH() ENETUNREACH #define Platform_ENFILE() ENFILE @@ -218,6 +220,13 @@ BOOLEAN Platform_ConnectionFailed (int16 e) return _o_result; } +BOOLEAN Platform_Interrupted (int16 e) +{ + BOOLEAN _o_result; + _o_result = e == Platform_EINTR(); + return _o_result; +} + int64 Platform_OSAllocate (int64 size) { int64 _o_result; @@ -618,13 +627,11 @@ int16 Platform_Chdir (CHAR *n, LONGINT n__len) { int16 _o_result; int16 r; - r = Platform_chdir(n, n__len); - Platform_getcwd((void*)Platform_CWD, 256); - if (r < 0) { - _o_result = Platform_err(); + if ((Platform_chdir(n, n__len) >= 0 && Platform_getcwd((void*)Platform_CWD, 256) != NIL)) { + _o_result = 0; return _o_result; } else { - _o_result = 0; + _o_result = Platform_err(); return _o_result; } __RETCHK; @@ -784,9 +791,10 @@ export void *Platform__init(void) Platform_HaltHandler = NIL; Platform_TimeStart = 0; Platform_TimeStart = Platform_Time(); - Platform_CWD[0] = 0x00; - Platform_getcwd((void*)Platform_CWD, 256); Platform_PID = Platform_getpid(); + if (Platform_getcwd((void*)Platform_CWD, 256) == NIL) { + Platform_CWD[0] = 0x00; + } Platform_SeekSet = Platform_seekset(); Platform_SeekCur = Platform_seekcur(); Platform_SeekEnd = Platform_seekend(); diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index 2402b996..c9b53f3c 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h @@ -50,6 +50,7 @@ import int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, addres import int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); import BOOLEAN Platform_Inaccessible (int16 e); import void Platform_Init (int16 argc, int64 argvadr); +import BOOLEAN Platform_Interrupted (int16 e); import void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); import int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); import BOOLEAN Platform_NoSuchDirectory (int16 e); diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index e75d35ff..57e22100 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index 8a42b39b..f3404dda 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index 9f9562db..bcf3cb9b 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index da213d81..9418692a 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index 2590cb27..a71cf72a 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index 7800b252..47f1e428 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/errors.c b/bootstrap/unix-88/errors.c index 34e6fae3..ba890a17 100644 --- a/bootstrap/unix-88/errors.c +++ b/bootstrap/unix-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-88/errors.h b/bootstrap/unix-88/errors.h index ce275b8c..d8124792 100644 --- a/bootstrap/unix-88/errors.h +++ b/bootstrap/unix-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index fd7974da..76fdc084 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -12,10 +12,11 @@ #include "Strings.h" -static CHAR extTools_compilationOptions[1023], extTools_CFLAGS[1023]; +static CHAR extTools_CFLAGS[1023]; export void extTools_Assemble (CHAR *moduleName, LONGINT moduleName__len); +static void extTools_InitialiseCompilerCommand (CHAR *s, LONGINT s__len); export void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN statically, CHAR *additionalopts, LONGINT additionalopts__len); static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGINT cmd__len); @@ -25,7 +26,7 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN int16 r, status, exitcode; __DUP(title, title__len, CHAR); __DUP(cmd, cmd__len, CHAR); - if (__IN(18, OPM_opt, 32)) { + if (__IN(18, OPM_Options, 32)) { Console_String(title, title__len); Console_String(cmd, cmd__len); Console_Ln(); @@ -60,12 +61,22 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN __DEL(cmd); } +static void extTools_InitialiseCompilerCommand (CHAR *s, LONGINT s__len) +{ + __COPY("gcc -g -O1", s, s__len); + Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); + Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); + Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); + Platform_GetEnv((CHAR*)"CFLAGS", 7, (void*)extTools_CFLAGS, 1023); + Strings_Append(extTools_CFLAGS, 1023, (void*)s, s__len); + Strings_Append((CHAR*)" ", 2, (void*)s, s__len); +} + void extTools_Assemble (CHAR *moduleName, LONGINT moduleName__len) { CHAR cmd[1023]; __DUP(moduleName, moduleName__len, CHAR); - __MOVE("gcc -g -O1", cmd, 11); - Strings_Append(extTools_compilationOptions, 1023, (void*)cmd, 1023); + extTools_InitialiseCompilerCommand((void*)cmd, 1023); Strings_Append((CHAR*)"-c ", 4, (void*)cmd, 1023); Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); Strings_Append((CHAR*)".c", 3, (void*)cmd, 1023); @@ -77,9 +88,7 @@ void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN stati { CHAR cmd[1023]; __DUP(additionalopts, additionalopts__len, CHAR); - __MOVE("gcc -g -O1", cmd, 11); - Strings_Append((CHAR*)" ", 2, (void*)cmd, 1023); - Strings_Append(extTools_compilationOptions, 1023, (void*)cmd, 1023); + extTools_InitialiseCompilerCommand((void*)cmd, 1023); Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); Strings_Append((CHAR*)".c ", 4, (void*)cmd, 1023); Strings_Append(additionalopts, additionalopts__len, (void*)cmd, 1023); @@ -92,6 +101,7 @@ void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN stati Strings_Append((CHAR*)"", 1, (void*)cmd, 1023); Strings_Append((CHAR*)"/lib\"", 6, (void*)cmd, 1023); Strings_Append((CHAR*)" -l voc", 8, (void*)cmd, 1023); + Strings_Append(OPM_Model, 10, (void*)cmd, 1023); extTools_execute((CHAR*)"Assemble and link: ", 20, cmd, 1023); __DEL(additionalopts); } @@ -107,11 +117,5 @@ export void *extTools__init(void) __MODULE_IMPORT(Strings); __REGMOD("extTools", 0); /* BEGIN */ - Strings_Append((CHAR*)" -I \"", 6, (void*)extTools_compilationOptions, 1023); - Strings_Append((CHAR*)"", 1, (void*)extTools_compilationOptions, 1023); - Strings_Append((CHAR*)"/include\" ", 11, (void*)extTools_compilationOptions, 1023); - Platform_GetEnv((CHAR*)"CFLAGS", 7, (void*)extTools_CFLAGS, 1023); - Strings_Append(extTools_CFLAGS, 1023, (void*)extTools_compilationOptions, 1023); - Strings_Append((CHAR*)" ", 2, (void*)extTools_compilationOptions, 1023); __ENDMOD; } diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index f87adfac..bb5be954 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/vt100.c b/bootstrap/unix-88/vt100.c index ca56f466..c44586d2 100644 --- a/bootstrap/unix-88/vt100.c +++ b/bootstrap/unix-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-88/vt100.h b/bootstrap/unix-88/vt100.h index f5b8588f..c9a01a7c 100644 --- a/bootstrap/unix-88/vt100.h +++ b/bootstrap/unix-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-48/Compiler.c b/bootstrap/windows-48/Compiler.c index 6444021c..1b3b14f1 100644 --- a/bootstrap/windows-48/Compiler.c +++ b/bootstrap/windows-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define INTEGER int16 #define LONGINT int32 @@ -32,7 +32,7 @@ void Compiler_Module (BOOLEAN *done) { BOOLEAN ext, new; OPT_Node p = NIL; - OPP_Module(&p, OPM_opt); + OPP_Module(&p, OPM_Options); if (OPM_noerr) { OPV_Init(); OPT_InitRecno(); @@ -43,22 +43,22 @@ void Compiler_Module (BOOLEAN *done) OPC_Init(); OPV_Module(p); if (OPM_noerr) { - if ((__IN(10, OPM_opt, 32) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { + if ((__IN(10, OPM_Options, 32) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { OPM_DeleteNewSym(); - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"32m", 4); } OPM_LogWStr((CHAR*)" Main program.", 16); - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } } else { if (new) { - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"32m", 4); } OPM_LogWStr((CHAR*)" New symbol file.", 19); - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } OPM_RegisterNewSym(); @@ -115,17 +115,17 @@ void Compiler_Translate (void) OPM_LogWLn(); Platform_Exit(1); } - if (!__IN(13, OPM_opt, 32)) { - if (__IN(14, OPM_opt, 32)) { + if (!__IN(13, OPM_Options, 32)) { + if (__IN(14, OPM_Options, 32)) { extTools_Assemble(OPM_modName, 32); } else { - if (!__IN(10, OPM_opt, 32)) { + if (!__IN(10, OPM_Options, 32)) { extTools_Assemble(OPM_modName, 32); Strings_Append((CHAR*)" ", 2, (void*)modulesobj, 2048); Strings_Append(OPM_modName, 32, (void*)modulesobj, 2048); Strings_Append((CHAR*)".o", 3, (void*)modulesobj, 2048); } else { - extTools_LinkMain((void*)OPM_modName, 32, __IN(15, OPM_opt, 32), modulesobj, 2048); + extTools_LinkMain((void*)OPM_modName, 32, __IN(15, OPM_Options, 32), modulesobj, 2048); } } } diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index 28528f64..85c8cf89 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index d9030dbe..a365d693 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Console.c b/bootstrap/windows-48/Console.c index 11937ee4..7d63057e 100644 --- a/bootstrap/windows-48/Console.c +++ b/bootstrap/windows-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Console.h b/bootstrap/windows-48/Console.h index 4eb27c8b..08f4e38e 100644 --- a/bootstrap/windows-48/Console.h +++ b/bootstrap/windows-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 7c1ea1bd..ef927317 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index a7de696c..8d274283 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index 945fbff7..1f66b283 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index eccb5d85..9e9400e1 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index a87d0732..f165488e 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index 93e2105b..a2ceebdf 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index d211135a..e370e621 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -1541,28 +1541,9 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPT_Struct y = NIL; int16 f, g; OPT_Struct p = NIL, q = NIL; - if (__IN(18, OPM_opt, 32)) { - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"PROCEDURE CheckAssign", 22); - OPM_LogWLn(); - } y = ynode->typ; f = x->form; g = y->form; - if (__IN(18, OPM_opt, 32)) { - OPM_LogWStr((CHAR*)"y.form = ", 10); - OPM_LogWNum(y->form, 0); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"f = ", 5); - OPM_LogWNum(f, 0); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"g = ", 5); - OPM_LogWNum(g, 0); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"ynode.typ.syze = ", 18); - OPM_LogWNum(ynode->typ->size, 0); - OPM_LogWLn(); - } if (ynode->class == 8 || (ynode->class == 9 && f != 12)) { OPB_err(126); } @@ -2367,7 +2348,7 @@ static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpa atyp = atyp->BaseTyp; if ((fvarpar && ftyp == OPT_bytetyp)) { if (!__IN(f, 0x0c, 32) || !((__IN(atyp->form, 0x1e, 32) && atyp->size == 1))) { - if (__IN(18, OPM_opt, 32)) { + if (__IN(18, OPM_Options, 32)) { OPB_err(-301); } } diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index 97860bfc..8c0fd594 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index e4c0eb06..4c9ae495 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -989,7 +989,7 @@ static void OPC_IdentList (OPT_Object obj, int16 vis) OPC_Ident(obj); OPM_WriteString((CHAR*)"__typ", 6); base = NIL; - } else if ((((((__IN(5, OPM_opt, 32) && vis == 0)) && obj->mnolev > 0)) && obj->typ->form == 11)) { + } else if ((((((__IN(5, OPM_Options, 32) && vis == 0)) && obj->mnolev > 0)) && obj->typ->form == 11)) { OPM_WriteString((CHAR*)" = NIL", 7); } } @@ -1153,7 +1153,7 @@ static void OPC_GenHeaderMsg (void) OPM_Write(' '); i = 0; while (i <= 31) { - if (__IN(i, OPM_glbopt, 32)) { + if (__IN(i, OPM_Options, 32)) { switch (i) { case 0: OPM_Write('x'); @@ -1355,7 +1355,7 @@ void OPC_EnterBody (void) { OPM_WriteLn(); OPM_WriteString((CHAR*)"export ", 8); - if (__IN(10, OPM_opt, 32)) { + if (__IN(10, OPM_Options, 32)) { OPM_WriteString((CHAR*)"int main(int argc, char **argv)", 32); OPM_WriteLn(); } else { @@ -1366,20 +1366,20 @@ void OPC_EnterBody (void) } OPC_BegBlk(); OPC_BegStat(); - if (__IN(10, OPM_opt, 32)) { + if (__IN(10, OPM_Options, 32)) { OPM_WriteString((CHAR*)"__INIT(argc, argv)", 19); } else { OPM_WriteString((CHAR*)"__DEFMOD", 9); } OPC_EndStat(); - if ((__IN(10, OPM_opt, 32) && 0)) { + if ((__IN(10, OPM_Options, 32) && 0)) { OPC_BegStat(); OPM_WriteString((CHAR*)"/*don`t do it!*/ printf(\"DEMO VERSION: DO NOT USE THIS PROGRAM FOR ANY COMMERCIAL PURPOSE\\n\")", 94); OPC_EndStat(); } OPC_InitImports(OPT_topScope->right); OPC_BegStat(); - if (__IN(10, OPM_opt, 32)) { + if (__IN(10, OPM_Options, 32)) { OPM_WriteString((CHAR*)"__REGMAIN(\"", 12); } else { OPM_WriteString((CHAR*)"__REGMOD(\"", 11); @@ -1399,7 +1399,7 @@ void OPC_EnterBody (void) void OPC_ExitBody (void) { OPC_BegStat(); - if (__IN(10, OPM_opt, 32)) { + if (__IN(10, OPM_Options, 32)) { OPM_WriteString((CHAR*)"__FINI;", 8); } else { OPM_WriteString((CHAR*)"__ENDMOD;", 10); diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index 3325aded..e681f43d 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 7234f518..534a5c0d 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -19,7 +19,14 @@ typedef static CHAR OPM_SourceFileName[256]; -export int16 OPM_AddressSize, OPM_Alignment, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; +static CHAR OPM_GlobalModel[10]; +export CHAR OPM_Model[10]; +static int16 OPM_GlobalAddressSize; +export int16 OPM_AddressSize; +static int16 OPM_GlobalAlignment; +export int16 OPM_Alignment; +export SET OPM_GlobalOptions, OPM_Options; +export int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize, OPM_MaxSet; export int64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; @@ -27,7 +34,6 @@ export int32 OPM_curpos, OPM_errpos, OPM_breakpc; export int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; export CHAR OPM_modName[32]; export CHAR OPM_objname[64]; -export SET OPM_opt, OPM_glbopt; static int32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; static Texts_Reader OPM_inR; static Texts_Text OPM_Log; @@ -36,8 +42,7 @@ static Files_Rider OPM_oldSF, OPM_newSF; static Files_Rider OPM_R[3]; static Files_File OPM_oldSFile, OPM_newSFile, OPM_HFile, OPM_BFile, OPM_HIFile; static int16 OPM_S; -static CHAR OPM_OBERON[1024]; -static CHAR OPM_MODULES[1024]; +export CHAR OPM_ResourceDir[1024]; static void OPM_Append (Files_Rider *R, address *R__typ, Files_File F); @@ -50,8 +55,6 @@ export void OPM_FPrintReal (int32 *fp, REAL real); export void OPM_FPrintSet (int32 *fp, SET set); static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 pos); export void OPM_Get (CHAR *ch); -static void OPM_GetProperties (void); -static void OPM_GetProperty (Texts_Scanner *S, address *S__typ, CHAR *name, LONGINT name__len, int16 *size, int16 *align); export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); export void OPM_InitOptions (void); export int16 OPM_Integer (int64 n); @@ -68,7 +71,7 @@ export void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); export void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); export BOOLEAN OPM_OpenPar (void); export void OPM_RegisterNewSym (void); -static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt); +static void OPM_ScanOptions (CHAR *s, LONGINT s__len); static void OPM_ShowLine (int64 pos); export int64 OPM_SignedMaximum (int32 bytecount); export int64 OPM_SignedMinimum (int32 bytecount); @@ -93,10 +96,8 @@ export void OPM_WriteString (CHAR *s, LONGINT s__len); export void OPM_WriteStringVar (CHAR *s, LONGINT s__len); export BOOLEAN OPM_eofSF (void); export void OPM_err (int16 n); -static int32 OPM_minusop (int32 i); -static int32 OPM_power0 (int32 i, int32 j); -#define OPM_GetAlignment(a) struct {char c; long long l;} s; *a = (char*)&s.l - (char*)&s +#define OPM_GetAlignment(a) struct {char c; long long l;} _s; *a = (char*)&_s.l - (char*)&_s void OPM_LogW (CHAR ch) { @@ -120,6 +121,23 @@ void OPM_LogWLn (void) Console_Ln(); } +int64 OPM_SignedMaximum (int32 bytecount) +{ + int64 _o_result; + int64 result; + result = 1; + result = __LSH(result, __ASHL(bytecount, 3) - 1, 64); + _o_result = result - 1; + return _o_result; +} + +int64 OPM_SignedMinimum (int32 bytecount) +{ + int64 _o_result; + _o_result = -OPM_SignedMaximum(bytecount) - 1; + return _o_result; +} + int32 OPM_Longint (int64 n) { int32 _o_result; @@ -134,7 +152,7 @@ int16 OPM_Integer (int64 n) return _o_result; } -static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) +static void OPM_ScanOptions (CHAR *s, LONGINT s__len) { int16 i; __DUP(s, s__len, CHAR); @@ -142,75 +160,57 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) while (s[__X(i, s__len)] != 0x00) { switch (s[__X(i, s__len)]) { case 'p': - *opt = *opt ^ 0x20; + OPM_Options = OPM_Options ^ 0x20; break; case 'a': - *opt = *opt ^ 0x80; + OPM_Options = OPM_Options ^ 0x80; break; case 'r': - *opt = *opt ^ 0x04; + OPM_Options = OPM_Options ^ 0x04; break; case 't': - *opt = *opt ^ 0x08; + OPM_Options = OPM_Options ^ 0x08; break; case 'x': - *opt = *opt ^ 0x01; + OPM_Options = OPM_Options ^ 0x01; break; case 'e': - *opt = *opt ^ 0x0200; + OPM_Options = OPM_Options ^ 0x0200; break; case 's': - *opt = *opt ^ 0x10; + OPM_Options = OPM_Options ^ 0x10; break; case 'F': - *opt = *opt ^ 0x020000; + OPM_Options = OPM_Options ^ 0x020000; break; case 'm': - *opt = *opt ^ 0x0400; + OPM_Options = OPM_Options ^ 0x0400; break; case 'M': - *opt = *opt ^ 0x8000; + OPM_Options = OPM_Options ^ 0x8000; break; case 'S': - *opt = *opt ^ 0x2000; + OPM_Options = OPM_Options ^ 0x2000; break; case 'c': - *opt = *opt ^ 0x4000; + OPM_Options = OPM_Options ^ 0x4000; break; case 'f': - *opt = *opt ^ 0x010000; + OPM_Options = OPM_Options ^ 0x010000; break; case 'V': - *opt = *opt ^ 0x040000; + OPM_Options = OPM_Options ^ 0x040000; break; case 'O': if (i + 1 >= Strings_Length(s, s__len)) { OPM_LogWStr((CHAR*)"-O option requires following size model character.", 51); OPM_LogWLn(); } else { - switch (s[__X(i + 1, s__len)]) { - case '2': - OPM_ShortintSize = 1; - OPM_IntegerSize = 2; - OPM_LongintSize = 4; - OPM_SetSize = 4; - break; - case 'V': - OPM_ShortintSize = 1; - OPM_IntegerSize = 4; - OPM_LongintSize = 8; - OPM_SetSize = 8; - break; - case 'C': - OPM_ShortintSize = 2; - OPM_IntegerSize = 4; - OPM_LongintSize = 8; - OPM_SetSize = 8; - break; - default: - OPM_LogWStr((CHAR*)"Unrecognised size model character following -O.", 48); - OPM_LogWLn(); - break; + OPM_Model[0] = s[__X(i + 1, s__len)]; + OPM_Model[1] = 0x00; + if ((((OPM_Model[0] != '2' && OPM_Model[0] != 'C')) && OPM_Model[0] != 'V')) { + OPM_LogWStr((CHAR*)"Unrecognised size model character following -O.", 48); + OPM_LogWLn(); } i += 1; } @@ -358,39 +358,119 @@ BOOLEAN OPM_OpenPar (void) _o_result = 0; return _o_result; } else { + OPM_AddressSize = 4; + OPM_GetAlignment(&OPM_Alignment); + __MOVE("2", OPM_Model, 2); + OPM_Options = 0xa9; OPM_S = 1; s[0] = 0x00; Platform_GetArg(OPM_S, (void*)s, 256); - OPM_glbopt = 0xa9; while (s[0] == '-') { - OPM_ScanOptions(s, 256, &OPM_glbopt); + OPM_ScanOptions(s, 256); OPM_S += 1; s[0] = 0x00; Platform_GetArg(OPM_S, (void*)s, 256); } + OPM_GlobalAddressSize = OPM_AddressSize; + OPM_GlobalAlignment = OPM_Alignment; + __COPY(OPM_Model, OPM_GlobalModel, 10); + OPM_GlobalOptions = OPM_Options; _o_result = 1; return _o_result; } __RETCHK; } +static void OPM_VerboseListSizes (void) +{ + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Type Size", 15); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"SHORTINT ", 12); + OPM_LogWNum(OPM_ShortintSize, 4); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"INTEGER ", 12); + OPM_LogWNum(OPM_IntegerSize, 4); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"LONGINT ", 12); + OPM_LogWNum(OPM_LongintSize, 4); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"SET ", 12); + OPM_LogWNum(OPM_SetSize, 4); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"ADDRESS ", 12); + OPM_LogWNum(OPM_AddressSize, 4); + OPM_LogWLn(); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Alignment: ", 12); + OPM_LogWNum(OPM_Alignment, 4); + OPM_LogWLn(); +} + void OPM_InitOptions (void) { CHAR s[256]; - OPM_opt = OPM_glbopt; + CHAR searchpath[1024], modules[1024]; + CHAR MODULES[1024]; + OPM_Options = OPM_GlobalOptions; + __COPY(OPM_GlobalModel, OPM_Model, 10); + OPM_Alignment = OPM_GlobalAlignment; + OPM_AddressSize = OPM_GlobalAddressSize; s[0] = 0x00; Platform_GetArg(OPM_S, (void*)s, 256); while (s[0] == '-') { - OPM_ScanOptions(s, 256, &OPM_opt); + OPM_ScanOptions(s, 256); OPM_S += 1; s[0] = 0x00; Platform_GetArg(OPM_S, (void*)s, 256); } - if (__IN(15, OPM_opt, 32)) { - OPM_glbopt |= __SETOF(10,32); - OPM_opt |= __SETOF(10,32); + if (__IN(15, OPM_Options, 32)) { + OPM_Options |= __SETOF(10,32); } - OPM_GetProperties(); + OPM_MaxIndex = OPM_SignedMaximum(OPM_AddressSize); + switch (OPM_Model[0]) { + case '2': + OPM_ShortintSize = 1; + OPM_IntegerSize = 2; + OPM_LongintSize = 4; + OPM_SetSize = 4; + break; + case 'C': + OPM_ShortintSize = 2; + OPM_IntegerSize = 4; + OPM_LongintSize = 8; + OPM_SetSize = 8; + break; + case 'V': + OPM_ShortintSize = 1; + OPM_IntegerSize = 4; + OPM_LongintSize = 8; + OPM_SetSize = 8; + break; + default: + OPM_ShortintSize = 1; + OPM_IntegerSize = 2; + OPM_LongintSize = 4; + OPM_SetSize = 4; + break; + } + OPM_MaxSet = __ASHL(OPM_SetSize, 3) - 1; + if (__IN(18, OPM_Options, 32)) { + OPM_VerboseListSizes(); + } + OPM_ResourceDir[0] = 0x00; + Strings_Append((CHAR*)"/", 2, (void*)OPM_ResourceDir, 1024); + Strings_Append(OPM_Model, 10, (void*)OPM_ResourceDir, 1024); + modules[0] = 0x00; + Platform_GetEnv((CHAR*)"MODULES", 8, (void*)modules, 1024); + __MOVE(".", searchpath, 2); + Platform_GetEnv((CHAR*)"OBERON", 7, (void*)searchpath, 1024); + Strings_Append((CHAR*)";.;", 4, (void*)searchpath, 1024); + Strings_Append(modules, 1024, (void*)searchpath, 1024); + Strings_Append((CHAR*)";", 2, (void*)searchpath, 1024); + Strings_Append(OPM_ResourceDir, 1024, (void*)searchpath, 1024); + Strings_Append((CHAR*)"/sym;", 6, (void*)searchpath, 1024); + Files_SetSearchPath(searchpath, 1024); } void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len) @@ -474,20 +554,20 @@ static void OPM_LogErrMsg (int16 n) int16 i; CHAR buf[1024]; if (n >= 0) { - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"31m", 4); } OPM_LogWStr((CHAR*)" err ", 7); - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } } else { - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"35m", 4); } OPM_LogWStr((CHAR*)" warning ", 11); n = -n; - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } } @@ -560,11 +640,11 @@ static void OPM_ShowLine (int64 pos) OPM_LogW(' '); i -= 1; } - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"32m", 4); } OPM_LogW('^'); - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } Files_Close(f); @@ -654,106 +734,6 @@ void OPM_FPrintLReal (int32 *fp, LONGREAL lr) OPM_FPrint(&*fp, h); } -static void OPM_GetProperty (Texts_Scanner *S, address *S__typ, CHAR *name, LONGINT name__len, int16 *size, int16 *align) -{ - __DUP(name, name__len, CHAR); - if (((*S).class == 1 && __STRCMP((*S).s, name) == 0)) { - Texts_Scan(&*S, S__typ); - if ((*S).class == 3) { - *size = (int16)(*S).i; - Texts_Scan(&*S, S__typ); - } else { - OPM_Mark(-157, -1); - } - if ((*S).class == 3) { - *align = (int16)(*S).i; - Texts_Scan(&*S, S__typ); - } else { - OPM_Mark(-157, -1); - } - } else { - OPM_Mark(-157, -1); - } - __DEL(name); -} - -static int32 OPM_minusop (int32 i) -{ - int32 _o_result; - _o_result = -i; - return _o_result; -} - -static int32 OPM_power0 (int32 i, int32 j) -{ - int32 _o_result; - int32 k, p; - k = 1; - p = i; - do { - p = p * i; - k += 1; - } while (!(k == j)); - _o_result = p; - return _o_result; -} - -static void OPM_VerboseListSizes (void) -{ - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Type Size", 17); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"SHORTINT ", 14); - OPM_LogWNum(OPM_ShortintSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"INTEGER ", 14); - OPM_LogWNum(OPM_IntegerSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"LONGINT ", 14); - OPM_LogWNum(OPM_LongintSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"SET ", 14); - OPM_LogWNum(OPM_SetSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"ADDRESS ", 14); - OPM_LogWNum(OPM_AddressSize, 4); - OPM_LogWLn(); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Alignment: ", 12); - OPM_LogWNum(OPM_Alignment, 4); - OPM_LogWLn(); -} - -int64 OPM_SignedMaximum (int32 bytecount) -{ - int64 _o_result; - int64 result; - result = 1; - result = __LSH(result, __ASHL(bytecount, 3) - 1, 64); - _o_result = result - 1; - return _o_result; -} - -int64 OPM_SignedMinimum (int32 bytecount) -{ - int64 _o_result; - _o_result = -OPM_SignedMaximum(bytecount) - 1; - return _o_result; -} - -static void OPM_GetProperties (void) -{ - OPM_MaxReal = 3.40282346000000e+038; - OPM_MaxLReal = 1.79769296342094e+308; - OPM_MinReal = -OPM_MaxReal; - OPM_MinLReal = -OPM_MaxLReal; - OPM_MaxSet = __ASHL(OPM_SetSize, 3) - 1; - OPM_MaxIndex = OPM_SignedMaximum(OPM_AddressSize); - if (__IN(18, OPM_opt, 32)) { - OPM_VerboseListSizes(); - } -} - void OPM_SymRCh (CHAR *ch) { Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&*ch); @@ -848,7 +828,7 @@ void OPM_SymWLReal (LONGREAL lr) void OPM_RegisterNewSym (void) { - if (__STRCMP(OPM_modName, "SYSTEM") != 0 || __IN(10, OPM_opt, 32)) { + if (__STRCMP(OPM_modName, "SYSTEM") != 0 || __IN(10, OPM_Options, 32)) { Files_Register(OPM_newSFile); } } @@ -1047,10 +1027,10 @@ void OPM_CloseFiles (void) } if (OPM_noerr) { if (__STRCMP(OPM_modName, "SYSTEM") == 0) { - if (!__IN(10, OPM_opt, 32)) { + if (!__IN(10, OPM_Options, 32)) { Files_Register(OPM_BFile); } - } else if (!__IN(10, OPM_opt, 32)) { + } else if (!__IN(10, OPM_Options, 32)) { OPM_Append(&OPM_R[2], Files_Rider__typ, OPM_HFile); Files_Register(OPM_HIFile); Files_Register(OPM_BFile); @@ -1110,22 +1090,10 @@ export void *OPM__init(void) __REGCMD("RegisterNewSym", OPM_RegisterNewSym); __REGCMD("WriteLn", OPM_WriteLn); /* BEGIN */ + OPM_MaxReal = 3.40282346000000e+038; + OPM_MaxLReal = 1.79769296342094e+308; + OPM_MinReal = -OPM_MaxReal; + OPM_MinLReal = -OPM_MaxLReal; Texts_OpenWriter(&OPM_W, Texts_Writer__typ); - OPM_MODULES[0] = 0x00; - Platform_GetEnv((CHAR*)"MODULES", 8, (void*)OPM_MODULES, 1024); - __MOVE(".", OPM_OBERON, 2); - Platform_GetEnv((CHAR*)"OBERON", 7, (void*)OPM_OBERON, 1024); - Strings_Append((CHAR*)";.;", 4, (void*)OPM_OBERON, 1024); - Strings_Append(OPM_MODULES, 1024, (void*)OPM_OBERON, 1024); - Strings_Append((CHAR*)";", 2, (void*)OPM_OBERON, 1024); - Strings_Append((CHAR*)"", 1, (void*)OPM_OBERON, 1024); - Strings_Append((CHAR*)"/sym;", 6, (void*)OPM_OBERON, 1024); - Files_SetSearchPath(OPM_OBERON, 1024); - OPM_AddressSize = 4; - OPM_GetAlignment(&OPM_Alignment); - OPM_ShortintSize = 1; - OPM_IntegerSize = 2; - OPM_LongintSize = 4; - OPM_SetSize = 4; __ENDMOD; } diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index e249edd5..933ef1b5 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h @@ -6,7 +6,10 @@ #include "SYSTEM.h" -import int16 OPM_AddressSize, OPM_Alignment, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; +import CHAR OPM_Model[10]; +import int16 OPM_AddressSize, OPM_Alignment; +import SET OPM_GlobalOptions, OPM_Options; +import int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize, OPM_MaxSet; import int64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; @@ -14,7 +17,7 @@ import int32 OPM_curpos, OPM_errpos, OPM_breakpc; import int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; import CHAR OPM_modName[32]; import CHAR OPM_objname[64]; -import SET OPM_opt, OPM_glbopt; +import CHAR OPM_ResourceDir[1024]; import void OPM_CloseFiles (void); diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index 1e5c6674..010efab1 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index 3b9acd86..373d8daa 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index ee182741..f8ed61bf 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index 1514d9eb..1f02668b 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 0a1f8f54..3f54ed72 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -1867,7 +1867,7 @@ void OPT_Export (BOOLEAN *ext, BOOLEAN *new) } OPT_OutObj(OPT_topScope->right); *ext = (OPT_sfpresent && OPT_symExtended); - *new = (!OPT_sfpresent || OPT_symNew) || __IN(17, OPM_opt, 32); + *new = (!OPT_sfpresent || OPT_symNew) || __IN(17, OPM_Options, 32); if ((((OPM_noerr && OPT_sfpresent)) && OPT_impCtxt.reffp != OPT_expCtxt.reffp)) { *new = 1; if (!OPT_extsf) { diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index d4f953ba..202c8278 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index a70a40bf..ff99f665 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -211,7 +211,7 @@ static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp return _o_result; break; case 5: - if (__IN(3, OPM_opt, 32)) { + if (__IN(3, OPM_Options, 32)) { _o_result = 10; return _o_result; } else { @@ -397,7 +397,7 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int16 prec) OPM_WriteInt(__ASHL(newtype->size, 3)); OPM_Write(')'); } else if (to == 4) { - if ((newtype->size < n->typ->size && __IN(2, OPM_opt, 32))) { + if ((newtype->size < n->typ->size && __IN(2, OPM_Options, 32))) { OPM_WriteString((CHAR*)"__SHORT", 8); if (OPV_SideEffects(n)) { OPM_Write('F'); @@ -412,7 +412,7 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int16 prec) OPV_Entier(n, 9); } } else if (to == 3) { - if (__IN(2, OPM_opt, 32)) { + if (__IN(2, OPM_Options, 32)) { OPM_WriteString((CHAR*)"__CHR", 6); if (OPV_SideEffects(n)) { OPM_Write('F'); @@ -453,7 +453,7 @@ static void OPV_TypeOf (OPT_Node n) static void OPV_Index (OPT_Node n, OPT_Node d, int16 prec, int16 dim) { - if (!__IN(0, OPM_opt, 32) || (n->right->class == 7 && (n->right->conval->intval == 0 || n->left->typ->comp != 3))) { + if (!__IN(0, OPM_Options, 32) || (n->right->class == 7 && (n->right->conval->intval == 0 || n->left->typ->comp != 3))) { OPV_expr(n->right, prec); } else { if (OPV_SideEffects(n->right)) { @@ -575,7 +575,7 @@ static void OPV_design (OPT_Node n, int16 prec) case 5: typ = n->typ; obj = n->left->obj; - if (__IN(3, OPM_opt, 32)) { + if (__IN(3, OPM_Options, 32)) { if (typ->comp == 4) { OPM_WriteString((CHAR*)"__GUARDR(", 10); if ((int16)obj->mnolev != OPM_level) { @@ -614,7 +614,7 @@ static void OPV_design (OPT_Node n, int16 prec) } break; case 6: - if (__IN(3, OPM_opt, 32)) { + if (__IN(3, OPM_Options, 32)) { if (n->left->class == 1) { OPM_WriteString((CHAR*)"__GUARDEQR(", 12); OPC_CompleteIdent(n->left->obj); @@ -1442,7 +1442,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) case 20: if (n->subcl != 32) { OPV_IfStat(n, 0, outerProc); - } else if (__IN(7, OPM_opt, 32)) { + } else if (__IN(7, OPM_Options, 32)) { OPM_WriteString((CHAR*)"__ASSERT(", 10); OPV_expr(n->left->left->left, -1); OPM_WriteString((CHAR*)", ", 3); @@ -1508,7 +1508,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) break; case 26: if (OPM_level == 0) { - if (__IN(10, OPM_opt, 32)) { + if (__IN(10, OPM_Options, 32)) { OPM_WriteString((CHAR*)"__FINI", 7); } else { OPM_WriteString((CHAR*)"__ENDMOD", 9); @@ -1553,7 +1553,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) void OPV_Module (OPT_Node prog) { - if (!__IN(10, OPM_opt, 32)) { + if (!__IN(10, OPM_Options, 32)) { OPC_GenHdr(prog->right); OPC_GenHdrIncludes(); } diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index 0a9135f5..a44fb5b5 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 51a62ed7..41a1da42 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -67,6 +67,7 @@ export int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, addres export int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); export BOOLEAN Platform_Inaccessible (int16 e); export void Platform_Init (int16 argc, int32 argvadr); +export BOOLEAN Platform_Interrupted (int16 e); export void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); export int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); export BOOLEAN Platform_NoSuchDirectory (int16 e); @@ -104,6 +105,7 @@ export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT #define Platform_ECONNABORTED() WSAECONNABORTED #define Platform_ECONNREFUSED() WSAECONNREFUSED #define Platform_EHOSTUNREACH() WSAEHOSTUNREACH +#define Platform_EINTR() WSAEINTR #define Platform_ENETUNREACH() WSAENETUNREACH #define Platform_ERRORACCESSDENIED() ERROR_ACCESS_DENIED #define Platform_ERRORFILENOTFOUND() ERROR_FILE_NOT_FOUND @@ -230,6 +232,13 @@ BOOLEAN Platform_ConnectionFailed (int16 e) return _o_result; } +BOOLEAN Platform_Interrupted (int16 e) +{ + BOOLEAN _o_result; + _o_result = e == Platform_EINTR(); + return _o_result; +} + int32 Platform_OSAllocate (int32 size) { int32 _o_result; diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index fff5ea74..7917d958 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h @@ -51,6 +51,7 @@ import int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, addres import int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); import BOOLEAN Platform_Inaccessible (int16 e); import void Platform_Init (int16 argc, int32 argvadr); +import BOOLEAN Platform_Interrupted (int16 e); import void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); import int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); import BOOLEAN Platform_NoSuchDirectory (int16 e); diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index e75d35ff..57e22100 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index 8a42b39b..f3404dda 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index 9f9562db..bcf3cb9b 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index da213d81..9418692a 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index ab510cdb..28f099a4 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index 64e78861..0afd65f7 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/errors.c b/bootstrap/windows-48/errors.c index 34e6fae3..ba890a17 100644 --- a/bootstrap/windows-48/errors.c +++ b/bootstrap/windows-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/errors.h b/bootstrap/windows-48/errors.h index ce275b8c..d8124792 100644 --- a/bootstrap/windows-48/errors.h +++ b/bootstrap/windows-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index fd7974da..76fdc084 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -12,10 +12,11 @@ #include "Strings.h" -static CHAR extTools_compilationOptions[1023], extTools_CFLAGS[1023]; +static CHAR extTools_CFLAGS[1023]; export void extTools_Assemble (CHAR *moduleName, LONGINT moduleName__len); +static void extTools_InitialiseCompilerCommand (CHAR *s, LONGINT s__len); export void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN statically, CHAR *additionalopts, LONGINT additionalopts__len); static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGINT cmd__len); @@ -25,7 +26,7 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN int16 r, status, exitcode; __DUP(title, title__len, CHAR); __DUP(cmd, cmd__len, CHAR); - if (__IN(18, OPM_opt, 32)) { + if (__IN(18, OPM_Options, 32)) { Console_String(title, title__len); Console_String(cmd, cmd__len); Console_Ln(); @@ -60,12 +61,22 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN __DEL(cmd); } +static void extTools_InitialiseCompilerCommand (CHAR *s, LONGINT s__len) +{ + __COPY("gcc -g -O1", s, s__len); + Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); + Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); + Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); + Platform_GetEnv((CHAR*)"CFLAGS", 7, (void*)extTools_CFLAGS, 1023); + Strings_Append(extTools_CFLAGS, 1023, (void*)s, s__len); + Strings_Append((CHAR*)" ", 2, (void*)s, s__len); +} + void extTools_Assemble (CHAR *moduleName, LONGINT moduleName__len) { CHAR cmd[1023]; __DUP(moduleName, moduleName__len, CHAR); - __MOVE("gcc -g -O1", cmd, 11); - Strings_Append(extTools_compilationOptions, 1023, (void*)cmd, 1023); + extTools_InitialiseCompilerCommand((void*)cmd, 1023); Strings_Append((CHAR*)"-c ", 4, (void*)cmd, 1023); Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); Strings_Append((CHAR*)".c", 3, (void*)cmd, 1023); @@ -77,9 +88,7 @@ void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN stati { CHAR cmd[1023]; __DUP(additionalopts, additionalopts__len, CHAR); - __MOVE("gcc -g -O1", cmd, 11); - Strings_Append((CHAR*)" ", 2, (void*)cmd, 1023); - Strings_Append(extTools_compilationOptions, 1023, (void*)cmd, 1023); + extTools_InitialiseCompilerCommand((void*)cmd, 1023); Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); Strings_Append((CHAR*)".c ", 4, (void*)cmd, 1023); Strings_Append(additionalopts, additionalopts__len, (void*)cmd, 1023); @@ -92,6 +101,7 @@ void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN stati Strings_Append((CHAR*)"", 1, (void*)cmd, 1023); Strings_Append((CHAR*)"/lib\"", 6, (void*)cmd, 1023); Strings_Append((CHAR*)" -l voc", 8, (void*)cmd, 1023); + Strings_Append(OPM_Model, 10, (void*)cmd, 1023); extTools_execute((CHAR*)"Assemble and link: ", 20, cmd, 1023); __DEL(additionalopts); } @@ -107,11 +117,5 @@ export void *extTools__init(void) __MODULE_IMPORT(Strings); __REGMOD("extTools", 0); /* BEGIN */ - Strings_Append((CHAR*)" -I \"", 6, (void*)extTools_compilationOptions, 1023); - Strings_Append((CHAR*)"", 1, (void*)extTools_compilationOptions, 1023); - Strings_Append((CHAR*)"/include\" ", 11, (void*)extTools_compilationOptions, 1023); - Platform_GetEnv((CHAR*)"CFLAGS", 7, (void*)extTools_CFLAGS, 1023); - Strings_Append(extTools_CFLAGS, 1023, (void*)extTools_compilationOptions, 1023); - Strings_Append((CHAR*)" ", 2, (void*)extTools_compilationOptions, 1023); __ENDMOD; } diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index f87adfac..bb5be954 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/vt100.c b/bootstrap/windows-48/vt100.c index ca56f466..c44586d2 100644 --- a/bootstrap/windows-48/vt100.c +++ b/bootstrap/windows-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/vt100.h b/bootstrap/windows-48/vt100.h index f5b8588f..c9a01a7c 100644 --- a/bootstrap/windows-48/vt100.h +++ b/bootstrap/windows-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-88/Compiler.c b/bootstrap/windows-88/Compiler.c index 6444021c..1b3b14f1 100644 --- a/bootstrap/windows-88/Compiler.c +++ b/bootstrap/windows-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define INTEGER int16 #define LONGINT int32 @@ -32,7 +32,7 @@ void Compiler_Module (BOOLEAN *done) { BOOLEAN ext, new; OPT_Node p = NIL; - OPP_Module(&p, OPM_opt); + OPP_Module(&p, OPM_Options); if (OPM_noerr) { OPV_Init(); OPT_InitRecno(); @@ -43,22 +43,22 @@ void Compiler_Module (BOOLEAN *done) OPC_Init(); OPV_Module(p); if (OPM_noerr) { - if ((__IN(10, OPM_opt, 32) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { + if ((__IN(10, OPM_Options, 32) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { OPM_DeleteNewSym(); - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"32m", 4); } OPM_LogWStr((CHAR*)" Main program.", 16); - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } } else { if (new) { - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"32m", 4); } OPM_LogWStr((CHAR*)" New symbol file.", 19); - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } OPM_RegisterNewSym(); @@ -115,17 +115,17 @@ void Compiler_Translate (void) OPM_LogWLn(); Platform_Exit(1); } - if (!__IN(13, OPM_opt, 32)) { - if (__IN(14, OPM_opt, 32)) { + if (!__IN(13, OPM_Options, 32)) { + if (__IN(14, OPM_Options, 32)) { extTools_Assemble(OPM_modName, 32); } else { - if (!__IN(10, OPM_opt, 32)) { + if (!__IN(10, OPM_Options, 32)) { extTools_Assemble(OPM_modName, 32); Strings_Append((CHAR*)" ", 2, (void*)modulesobj, 2048); Strings_Append(OPM_modName, 32, (void*)modulesobj, 2048); Strings_Append((CHAR*)".o", 3, (void*)modulesobj, 2048); } else { - extTools_LinkMain((void*)OPM_modName, 32, __IN(15, OPM_opt, 32), modulesobj, 2048); + extTools_LinkMain((void*)OPM_modName, 32, __IN(15, OPM_Options, 32), modulesobj, 2048); } } } diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index 28528f64..85c8cf89 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index d9030dbe..a365d693 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Console.c b/bootstrap/windows-88/Console.c index 11937ee4..7d63057e 100644 --- a/bootstrap/windows-88/Console.c +++ b/bootstrap/windows-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-88/Console.h b/bootstrap/windows-88/Console.h index 4eb27c8b..08f4e38e 100644 --- a/bootstrap/windows-88/Console.h +++ b/bootstrap/windows-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 7d407820..72ef67df 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 1391c541..668d8ebf 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index ca208a31..71ad15a1 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index 3fcd0b28..0cd62e2b 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index e3ff56bd..0e05b5aa 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index 93e2105b..a2ceebdf 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index d211135a..e370e621 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -1541,28 +1541,9 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPT_Struct y = NIL; int16 f, g; OPT_Struct p = NIL, q = NIL; - if (__IN(18, OPM_opt, 32)) { - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"PROCEDURE CheckAssign", 22); - OPM_LogWLn(); - } y = ynode->typ; f = x->form; g = y->form; - if (__IN(18, OPM_opt, 32)) { - OPM_LogWStr((CHAR*)"y.form = ", 10); - OPM_LogWNum(y->form, 0); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"f = ", 5); - OPM_LogWNum(f, 0); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"g = ", 5); - OPM_LogWNum(g, 0); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"ynode.typ.syze = ", 18); - OPM_LogWNum(ynode->typ->size, 0); - OPM_LogWLn(); - } if (ynode->class == 8 || (ynode->class == 9 && f != 12)) { OPB_err(126); } @@ -2367,7 +2348,7 @@ static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpa atyp = atyp->BaseTyp; if ((fvarpar && ftyp == OPT_bytetyp)) { if (!__IN(f, 0x0c, 32) || !((__IN(atyp->form, 0x1e, 32) && atyp->size == 1))) { - if (__IN(18, OPM_opt, 32)) { + if (__IN(18, OPM_Options, 32)) { OPB_err(-301); } } diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index 97860bfc..8c0fd594 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index e4c0eb06..4c9ae495 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -989,7 +989,7 @@ static void OPC_IdentList (OPT_Object obj, int16 vis) OPC_Ident(obj); OPM_WriteString((CHAR*)"__typ", 6); base = NIL; - } else if ((((((__IN(5, OPM_opt, 32) && vis == 0)) && obj->mnolev > 0)) && obj->typ->form == 11)) { + } else if ((((((__IN(5, OPM_Options, 32) && vis == 0)) && obj->mnolev > 0)) && obj->typ->form == 11)) { OPM_WriteString((CHAR*)" = NIL", 7); } } @@ -1153,7 +1153,7 @@ static void OPC_GenHeaderMsg (void) OPM_Write(' '); i = 0; while (i <= 31) { - if (__IN(i, OPM_glbopt, 32)) { + if (__IN(i, OPM_Options, 32)) { switch (i) { case 0: OPM_Write('x'); @@ -1355,7 +1355,7 @@ void OPC_EnterBody (void) { OPM_WriteLn(); OPM_WriteString((CHAR*)"export ", 8); - if (__IN(10, OPM_opt, 32)) { + if (__IN(10, OPM_Options, 32)) { OPM_WriteString((CHAR*)"int main(int argc, char **argv)", 32); OPM_WriteLn(); } else { @@ -1366,20 +1366,20 @@ void OPC_EnterBody (void) } OPC_BegBlk(); OPC_BegStat(); - if (__IN(10, OPM_opt, 32)) { + if (__IN(10, OPM_Options, 32)) { OPM_WriteString((CHAR*)"__INIT(argc, argv)", 19); } else { OPM_WriteString((CHAR*)"__DEFMOD", 9); } OPC_EndStat(); - if ((__IN(10, OPM_opt, 32) && 0)) { + if ((__IN(10, OPM_Options, 32) && 0)) { OPC_BegStat(); OPM_WriteString((CHAR*)"/*don`t do it!*/ printf(\"DEMO VERSION: DO NOT USE THIS PROGRAM FOR ANY COMMERCIAL PURPOSE\\n\")", 94); OPC_EndStat(); } OPC_InitImports(OPT_topScope->right); OPC_BegStat(); - if (__IN(10, OPM_opt, 32)) { + if (__IN(10, OPM_Options, 32)) { OPM_WriteString((CHAR*)"__REGMAIN(\"", 12); } else { OPM_WriteString((CHAR*)"__REGMOD(\"", 11); @@ -1399,7 +1399,7 @@ void OPC_EnterBody (void) void OPC_ExitBody (void) { OPC_BegStat(); - if (__IN(10, OPM_opt, 32)) { + if (__IN(10, OPM_Options, 32)) { OPM_WriteString((CHAR*)"__FINI;", 8); } else { OPM_WriteString((CHAR*)"__ENDMOD;", 10); diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index 3325aded..e681f43d 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 4710b95f..297ade25 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -19,7 +19,14 @@ typedef static CHAR OPM_SourceFileName[256]; -export int16 OPM_AddressSize, OPM_Alignment, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; +static CHAR OPM_GlobalModel[10]; +export CHAR OPM_Model[10]; +static int16 OPM_GlobalAddressSize; +export int16 OPM_AddressSize; +static int16 OPM_GlobalAlignment; +export int16 OPM_Alignment; +export SET OPM_GlobalOptions, OPM_Options; +export int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize, OPM_MaxSet; export int64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; @@ -27,7 +34,6 @@ export int32 OPM_curpos, OPM_errpos, OPM_breakpc; export int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; export CHAR OPM_modName[32]; export CHAR OPM_objname[64]; -export SET OPM_opt, OPM_glbopt; static int32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; static Texts_Reader OPM_inR; static Texts_Text OPM_Log; @@ -36,8 +42,7 @@ static Files_Rider OPM_oldSF, OPM_newSF; static Files_Rider OPM_R[3]; static Files_File OPM_oldSFile, OPM_newSFile, OPM_HFile, OPM_BFile, OPM_HIFile; static int16 OPM_S; -static CHAR OPM_OBERON[1024]; -static CHAR OPM_MODULES[1024]; +export CHAR OPM_ResourceDir[1024]; static void OPM_Append (Files_Rider *R, address *R__typ, Files_File F); @@ -50,8 +55,6 @@ export void OPM_FPrintReal (int32 *fp, REAL real); export void OPM_FPrintSet (int32 *fp, SET set); static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 pos); export void OPM_Get (CHAR *ch); -static void OPM_GetProperties (void); -static void OPM_GetProperty (Texts_Scanner *S, address *S__typ, CHAR *name, LONGINT name__len, int16 *size, int16 *align); export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); export void OPM_InitOptions (void); export int16 OPM_Integer (int64 n); @@ -68,7 +71,7 @@ export void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); export void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); export BOOLEAN OPM_OpenPar (void); export void OPM_RegisterNewSym (void); -static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt); +static void OPM_ScanOptions (CHAR *s, LONGINT s__len); static void OPM_ShowLine (int64 pos); export int64 OPM_SignedMaximum (int32 bytecount); export int64 OPM_SignedMinimum (int32 bytecount); @@ -93,10 +96,8 @@ export void OPM_WriteString (CHAR *s, LONGINT s__len); export void OPM_WriteStringVar (CHAR *s, LONGINT s__len); export BOOLEAN OPM_eofSF (void); export void OPM_err (int16 n); -static int32 OPM_minusop (int32 i); -static int32 OPM_power0 (int32 i, int32 j); -#define OPM_GetAlignment(a) struct {char c; long long l;} s; *a = (char*)&s.l - (char*)&s +#define OPM_GetAlignment(a) struct {char c; long long l;} _s; *a = (char*)&_s.l - (char*)&_s void OPM_LogW (CHAR ch) { @@ -120,6 +121,23 @@ void OPM_LogWLn (void) Console_Ln(); } +int64 OPM_SignedMaximum (int32 bytecount) +{ + int64 _o_result; + int64 result; + result = 1; + result = __LSH(result, __ASHL(bytecount, 3) - 1, 64); + _o_result = result - 1; + return _o_result; +} + +int64 OPM_SignedMinimum (int32 bytecount) +{ + int64 _o_result; + _o_result = -OPM_SignedMaximum(bytecount) - 1; + return _o_result; +} + int32 OPM_Longint (int64 n) { int32 _o_result; @@ -134,7 +152,7 @@ int16 OPM_Integer (int64 n) return _o_result; } -static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) +static void OPM_ScanOptions (CHAR *s, LONGINT s__len) { int16 i; __DUP(s, s__len, CHAR); @@ -142,75 +160,57 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) while (s[__X(i, s__len)] != 0x00) { switch (s[__X(i, s__len)]) { case 'p': - *opt = *opt ^ 0x20; + OPM_Options = OPM_Options ^ 0x20; break; case 'a': - *opt = *opt ^ 0x80; + OPM_Options = OPM_Options ^ 0x80; break; case 'r': - *opt = *opt ^ 0x04; + OPM_Options = OPM_Options ^ 0x04; break; case 't': - *opt = *opt ^ 0x08; + OPM_Options = OPM_Options ^ 0x08; break; case 'x': - *opt = *opt ^ 0x01; + OPM_Options = OPM_Options ^ 0x01; break; case 'e': - *opt = *opt ^ 0x0200; + OPM_Options = OPM_Options ^ 0x0200; break; case 's': - *opt = *opt ^ 0x10; + OPM_Options = OPM_Options ^ 0x10; break; case 'F': - *opt = *opt ^ 0x020000; + OPM_Options = OPM_Options ^ 0x020000; break; case 'm': - *opt = *opt ^ 0x0400; + OPM_Options = OPM_Options ^ 0x0400; break; case 'M': - *opt = *opt ^ 0x8000; + OPM_Options = OPM_Options ^ 0x8000; break; case 'S': - *opt = *opt ^ 0x2000; + OPM_Options = OPM_Options ^ 0x2000; break; case 'c': - *opt = *opt ^ 0x4000; + OPM_Options = OPM_Options ^ 0x4000; break; case 'f': - *opt = *opt ^ 0x010000; + OPM_Options = OPM_Options ^ 0x010000; break; case 'V': - *opt = *opt ^ 0x040000; + OPM_Options = OPM_Options ^ 0x040000; break; case 'O': if (i + 1 >= Strings_Length(s, s__len)) { OPM_LogWStr((CHAR*)"-O option requires following size model character.", 51); OPM_LogWLn(); } else { - switch (s[__X(i + 1, s__len)]) { - case '2': - OPM_ShortintSize = 1; - OPM_IntegerSize = 2; - OPM_LongintSize = 4; - OPM_SetSize = 4; - break; - case 'V': - OPM_ShortintSize = 1; - OPM_IntegerSize = 4; - OPM_LongintSize = 8; - OPM_SetSize = 8; - break; - case 'C': - OPM_ShortintSize = 2; - OPM_IntegerSize = 4; - OPM_LongintSize = 8; - OPM_SetSize = 8; - break; - default: - OPM_LogWStr((CHAR*)"Unrecognised size model character following -O.", 48); - OPM_LogWLn(); - break; + OPM_Model[0] = s[__X(i + 1, s__len)]; + OPM_Model[1] = 0x00; + if ((((OPM_Model[0] != '2' && OPM_Model[0] != 'C')) && OPM_Model[0] != 'V')) { + OPM_LogWStr((CHAR*)"Unrecognised size model character following -O.", 48); + OPM_LogWLn(); } i += 1; } @@ -358,39 +358,119 @@ BOOLEAN OPM_OpenPar (void) _o_result = 0; return _o_result; } else { + OPM_AddressSize = 8; + OPM_GetAlignment(&OPM_Alignment); + __MOVE("2", OPM_Model, 2); + OPM_Options = 0xa9; OPM_S = 1; s[0] = 0x00; Platform_GetArg(OPM_S, (void*)s, 256); - OPM_glbopt = 0xa9; while (s[0] == '-') { - OPM_ScanOptions(s, 256, &OPM_glbopt); + OPM_ScanOptions(s, 256); OPM_S += 1; s[0] = 0x00; Platform_GetArg(OPM_S, (void*)s, 256); } + OPM_GlobalAddressSize = OPM_AddressSize; + OPM_GlobalAlignment = OPM_Alignment; + __COPY(OPM_Model, OPM_GlobalModel, 10); + OPM_GlobalOptions = OPM_Options; _o_result = 1; return _o_result; } __RETCHK; } +static void OPM_VerboseListSizes (void) +{ + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Type Size", 15); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"SHORTINT ", 12); + OPM_LogWNum(OPM_ShortintSize, 4); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"INTEGER ", 12); + OPM_LogWNum(OPM_IntegerSize, 4); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"LONGINT ", 12); + OPM_LogWNum(OPM_LongintSize, 4); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"SET ", 12); + OPM_LogWNum(OPM_SetSize, 4); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"ADDRESS ", 12); + OPM_LogWNum(OPM_AddressSize, 4); + OPM_LogWLn(); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Alignment: ", 12); + OPM_LogWNum(OPM_Alignment, 4); + OPM_LogWLn(); +} + void OPM_InitOptions (void) { CHAR s[256]; - OPM_opt = OPM_glbopt; + CHAR searchpath[1024], modules[1024]; + CHAR MODULES[1024]; + OPM_Options = OPM_GlobalOptions; + __COPY(OPM_GlobalModel, OPM_Model, 10); + OPM_Alignment = OPM_GlobalAlignment; + OPM_AddressSize = OPM_GlobalAddressSize; s[0] = 0x00; Platform_GetArg(OPM_S, (void*)s, 256); while (s[0] == '-') { - OPM_ScanOptions(s, 256, &OPM_opt); + OPM_ScanOptions(s, 256); OPM_S += 1; s[0] = 0x00; Platform_GetArg(OPM_S, (void*)s, 256); } - if (__IN(15, OPM_opt, 32)) { - OPM_glbopt |= __SETOF(10,32); - OPM_opt |= __SETOF(10,32); + if (__IN(15, OPM_Options, 32)) { + OPM_Options |= __SETOF(10,32); } - OPM_GetProperties(); + OPM_MaxIndex = OPM_SignedMaximum(OPM_AddressSize); + switch (OPM_Model[0]) { + case '2': + OPM_ShortintSize = 1; + OPM_IntegerSize = 2; + OPM_LongintSize = 4; + OPM_SetSize = 4; + break; + case 'C': + OPM_ShortintSize = 2; + OPM_IntegerSize = 4; + OPM_LongintSize = 8; + OPM_SetSize = 8; + break; + case 'V': + OPM_ShortintSize = 1; + OPM_IntegerSize = 4; + OPM_LongintSize = 8; + OPM_SetSize = 8; + break; + default: + OPM_ShortintSize = 1; + OPM_IntegerSize = 2; + OPM_LongintSize = 4; + OPM_SetSize = 4; + break; + } + OPM_MaxSet = __ASHL(OPM_SetSize, 3) - 1; + if (__IN(18, OPM_Options, 32)) { + OPM_VerboseListSizes(); + } + OPM_ResourceDir[0] = 0x00; + Strings_Append((CHAR*)"/", 2, (void*)OPM_ResourceDir, 1024); + Strings_Append(OPM_Model, 10, (void*)OPM_ResourceDir, 1024); + modules[0] = 0x00; + Platform_GetEnv((CHAR*)"MODULES", 8, (void*)modules, 1024); + __MOVE(".", searchpath, 2); + Platform_GetEnv((CHAR*)"OBERON", 7, (void*)searchpath, 1024); + Strings_Append((CHAR*)";.;", 4, (void*)searchpath, 1024); + Strings_Append(modules, 1024, (void*)searchpath, 1024); + Strings_Append((CHAR*)";", 2, (void*)searchpath, 1024); + Strings_Append(OPM_ResourceDir, 1024, (void*)searchpath, 1024); + Strings_Append((CHAR*)"/sym;", 6, (void*)searchpath, 1024); + Files_SetSearchPath(searchpath, 1024); } void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len) @@ -474,20 +554,20 @@ static void OPM_LogErrMsg (int16 n) int16 i; CHAR buf[1024]; if (n >= 0) { - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"31m", 4); } OPM_LogWStr((CHAR*)" err ", 7); - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } } else { - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"35m", 4); } OPM_LogWStr((CHAR*)" warning ", 11); n = -n; - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } } @@ -560,11 +640,11 @@ static void OPM_ShowLine (int64 pos) OPM_LogW(' '); i -= 1; } - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"32m", 4); } OPM_LogW('^'); - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } Files_Close(f); @@ -654,106 +734,6 @@ void OPM_FPrintLReal (int32 *fp, LONGREAL lr) OPM_FPrint(&*fp, h); } -static void OPM_GetProperty (Texts_Scanner *S, address *S__typ, CHAR *name, LONGINT name__len, int16 *size, int16 *align) -{ - __DUP(name, name__len, CHAR); - if (((*S).class == 1 && __STRCMP((*S).s, name) == 0)) { - Texts_Scan(&*S, S__typ); - if ((*S).class == 3) { - *size = (int16)(*S).i; - Texts_Scan(&*S, S__typ); - } else { - OPM_Mark(-157, -1); - } - if ((*S).class == 3) { - *align = (int16)(*S).i; - Texts_Scan(&*S, S__typ); - } else { - OPM_Mark(-157, -1); - } - } else { - OPM_Mark(-157, -1); - } - __DEL(name); -} - -static int32 OPM_minusop (int32 i) -{ - int32 _o_result; - _o_result = -i; - return _o_result; -} - -static int32 OPM_power0 (int32 i, int32 j) -{ - int32 _o_result; - int32 k, p; - k = 1; - p = i; - do { - p = p * i; - k += 1; - } while (!(k == j)); - _o_result = p; - return _o_result; -} - -static void OPM_VerboseListSizes (void) -{ - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Type Size", 17); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"SHORTINT ", 14); - OPM_LogWNum(OPM_ShortintSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"INTEGER ", 14); - OPM_LogWNum(OPM_IntegerSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"LONGINT ", 14); - OPM_LogWNum(OPM_LongintSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"SET ", 14); - OPM_LogWNum(OPM_SetSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"ADDRESS ", 14); - OPM_LogWNum(OPM_AddressSize, 4); - OPM_LogWLn(); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Alignment: ", 12); - OPM_LogWNum(OPM_Alignment, 4); - OPM_LogWLn(); -} - -int64 OPM_SignedMaximum (int32 bytecount) -{ - int64 _o_result; - int64 result; - result = 1; - result = __LSH(result, __ASHL(bytecount, 3) - 1, 64); - _o_result = result - 1; - return _o_result; -} - -int64 OPM_SignedMinimum (int32 bytecount) -{ - int64 _o_result; - _o_result = -OPM_SignedMaximum(bytecount) - 1; - return _o_result; -} - -static void OPM_GetProperties (void) -{ - OPM_MaxReal = 3.40282346000000e+038; - OPM_MaxLReal = 1.79769296342094e+308; - OPM_MinReal = -OPM_MaxReal; - OPM_MinLReal = -OPM_MaxLReal; - OPM_MaxSet = __ASHL(OPM_SetSize, 3) - 1; - OPM_MaxIndex = OPM_SignedMaximum(OPM_AddressSize); - if (__IN(18, OPM_opt, 32)) { - OPM_VerboseListSizes(); - } -} - void OPM_SymRCh (CHAR *ch) { Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&*ch); @@ -848,7 +828,7 @@ void OPM_SymWLReal (LONGREAL lr) void OPM_RegisterNewSym (void) { - if (__STRCMP(OPM_modName, "SYSTEM") != 0 || __IN(10, OPM_opt, 32)) { + if (__STRCMP(OPM_modName, "SYSTEM") != 0 || __IN(10, OPM_Options, 32)) { Files_Register(OPM_newSFile); } } @@ -1047,10 +1027,10 @@ void OPM_CloseFiles (void) } if (OPM_noerr) { if (__STRCMP(OPM_modName, "SYSTEM") == 0) { - if (!__IN(10, OPM_opt, 32)) { + if (!__IN(10, OPM_Options, 32)) { Files_Register(OPM_BFile); } - } else if (!__IN(10, OPM_opt, 32)) { + } else if (!__IN(10, OPM_Options, 32)) { OPM_Append(&OPM_R[2], Files_Rider__typ, OPM_HFile); Files_Register(OPM_HIFile); Files_Register(OPM_BFile); @@ -1110,22 +1090,10 @@ export void *OPM__init(void) __REGCMD("RegisterNewSym", OPM_RegisterNewSym); __REGCMD("WriteLn", OPM_WriteLn); /* BEGIN */ + OPM_MaxReal = 3.40282346000000e+038; + OPM_MaxLReal = 1.79769296342094e+308; + OPM_MinReal = -OPM_MaxReal; + OPM_MinLReal = -OPM_MaxLReal; Texts_OpenWriter(&OPM_W, Texts_Writer__typ); - OPM_MODULES[0] = 0x00; - Platform_GetEnv((CHAR*)"MODULES", 8, (void*)OPM_MODULES, 1024); - __MOVE(".", OPM_OBERON, 2); - Platform_GetEnv((CHAR*)"OBERON", 7, (void*)OPM_OBERON, 1024); - Strings_Append((CHAR*)";.;", 4, (void*)OPM_OBERON, 1024); - Strings_Append(OPM_MODULES, 1024, (void*)OPM_OBERON, 1024); - Strings_Append((CHAR*)";", 2, (void*)OPM_OBERON, 1024); - Strings_Append((CHAR*)"", 1, (void*)OPM_OBERON, 1024); - Strings_Append((CHAR*)"/sym;", 6, (void*)OPM_OBERON, 1024); - Files_SetSearchPath(OPM_OBERON, 1024); - OPM_AddressSize = 8; - OPM_GetAlignment(&OPM_Alignment); - OPM_ShortintSize = 1; - OPM_IntegerSize = 2; - OPM_LongintSize = 4; - OPM_SetSize = 4; __ENDMOD; } diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index e249edd5..933ef1b5 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h @@ -6,7 +6,10 @@ #include "SYSTEM.h" -import int16 OPM_AddressSize, OPM_Alignment, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; +import CHAR OPM_Model[10]; +import int16 OPM_AddressSize, OPM_Alignment; +import SET OPM_GlobalOptions, OPM_Options; +import int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize, OPM_MaxSet; import int64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; @@ -14,7 +17,7 @@ import int32 OPM_curpos, OPM_errpos, OPM_breakpc; import int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; import CHAR OPM_modName[32]; import CHAR OPM_objname[64]; -import SET OPM_opt, OPM_glbopt; +import CHAR OPM_ResourceDir[1024]; import void OPM_CloseFiles (void); diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index f6a8dfc5..c9986e20 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index 3b9acd86..373d8daa 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index ee182741..f8ed61bf 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index 1514d9eb..1f02668b 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index ad18ebdb..b0a12a18 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -1867,7 +1867,7 @@ void OPT_Export (BOOLEAN *ext, BOOLEAN *new) } OPT_OutObj(OPT_topScope->right); *ext = (OPT_sfpresent && OPT_symExtended); - *new = (!OPT_sfpresent || OPT_symNew) || __IN(17, OPM_opt, 32); + *new = (!OPT_sfpresent || OPT_symNew) || __IN(17, OPM_Options, 32); if ((((OPM_noerr && OPT_sfpresent)) && OPT_impCtxt.reffp != OPT_expCtxt.reffp)) { *new = 1; if (!OPT_extsf) { diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index d4f953ba..202c8278 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 09f3d249..07fa214f 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -211,7 +211,7 @@ static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp return _o_result; break; case 5: - if (__IN(3, OPM_opt, 32)) { + if (__IN(3, OPM_Options, 32)) { _o_result = 10; return _o_result; } else { @@ -397,7 +397,7 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int16 prec) OPM_WriteInt(__ASHL(newtype->size, 3)); OPM_Write(')'); } else if (to == 4) { - if ((newtype->size < n->typ->size && __IN(2, OPM_opt, 32))) { + if ((newtype->size < n->typ->size && __IN(2, OPM_Options, 32))) { OPM_WriteString((CHAR*)"__SHORT", 8); if (OPV_SideEffects(n)) { OPM_Write('F'); @@ -412,7 +412,7 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int16 prec) OPV_Entier(n, 9); } } else if (to == 3) { - if (__IN(2, OPM_opt, 32)) { + if (__IN(2, OPM_Options, 32)) { OPM_WriteString((CHAR*)"__CHR", 6); if (OPV_SideEffects(n)) { OPM_Write('F'); @@ -453,7 +453,7 @@ static void OPV_TypeOf (OPT_Node n) static void OPV_Index (OPT_Node n, OPT_Node d, int16 prec, int16 dim) { - if (!__IN(0, OPM_opt, 32) || (n->right->class == 7 && (n->right->conval->intval == 0 || n->left->typ->comp != 3))) { + if (!__IN(0, OPM_Options, 32) || (n->right->class == 7 && (n->right->conval->intval == 0 || n->left->typ->comp != 3))) { OPV_expr(n->right, prec); } else { if (OPV_SideEffects(n->right)) { @@ -575,7 +575,7 @@ static void OPV_design (OPT_Node n, int16 prec) case 5: typ = n->typ; obj = n->left->obj; - if (__IN(3, OPM_opt, 32)) { + if (__IN(3, OPM_Options, 32)) { if (typ->comp == 4) { OPM_WriteString((CHAR*)"__GUARDR(", 10); if ((int16)obj->mnolev != OPM_level) { @@ -614,7 +614,7 @@ static void OPV_design (OPT_Node n, int16 prec) } break; case 6: - if (__IN(3, OPM_opt, 32)) { + if (__IN(3, OPM_Options, 32)) { if (n->left->class == 1) { OPM_WriteString((CHAR*)"__GUARDEQR(", 12); OPC_CompleteIdent(n->left->obj); @@ -1442,7 +1442,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) case 20: if (n->subcl != 32) { OPV_IfStat(n, 0, outerProc); - } else if (__IN(7, OPM_opt, 32)) { + } else if (__IN(7, OPM_Options, 32)) { OPM_WriteString((CHAR*)"__ASSERT(", 10); OPV_expr(n->left->left->left, -1); OPM_WriteString((CHAR*)", ", 3); @@ -1508,7 +1508,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) break; case 26: if (OPM_level == 0) { - if (__IN(10, OPM_opt, 32)) { + if (__IN(10, OPM_Options, 32)) { OPM_WriteString((CHAR*)"__FINI", 7); } else { OPM_WriteString((CHAR*)"__ENDMOD", 9); @@ -1553,7 +1553,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) void OPV_Module (OPT_Node prog) { - if (!__IN(10, OPM_opt, 32)) { + if (!__IN(10, OPM_Options, 32)) { OPC_GenHdr(prog->right); OPC_GenHdrIncludes(); } diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index 0a9135f5..a44fb5b5 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index c0accb85..95dd629a 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -67,6 +67,7 @@ export int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, addres export int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); export BOOLEAN Platform_Inaccessible (int16 e); export void Platform_Init (int16 argc, int64 argvadr); +export BOOLEAN Platform_Interrupted (int16 e); export void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); export int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); export BOOLEAN Platform_NoSuchDirectory (int16 e); @@ -104,6 +105,7 @@ export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT #define Platform_ECONNABORTED() WSAECONNABORTED #define Platform_ECONNREFUSED() WSAECONNREFUSED #define Platform_EHOSTUNREACH() WSAEHOSTUNREACH +#define Platform_EINTR() WSAEINTR #define Platform_ENETUNREACH() WSAENETUNREACH #define Platform_ERRORACCESSDENIED() ERROR_ACCESS_DENIED #define Platform_ERRORFILENOTFOUND() ERROR_FILE_NOT_FOUND @@ -230,6 +232,13 @@ BOOLEAN Platform_ConnectionFailed (int16 e) return _o_result; } +BOOLEAN Platform_Interrupted (int16 e) +{ + BOOLEAN _o_result; + _o_result = e == Platform_EINTR(); + return _o_result; +} + int64 Platform_OSAllocate (int64 size) { int64 _o_result; diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index dcdb5e82..b99b4747 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h @@ -51,6 +51,7 @@ import int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, addres import int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); import BOOLEAN Platform_Inaccessible (int16 e); import void Platform_Init (int16 argc, int64 argvadr); +import BOOLEAN Platform_Interrupted (int16 e); import void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); import int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); import BOOLEAN Platform_NoSuchDirectory (int16 e); diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index e75d35ff..57e22100 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index 8a42b39b..f3404dda 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index 9f9562db..bcf3cb9b 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index da213d81..9418692a 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index 2590cb27..a71cf72a 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index 7800b252..47f1e428 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/errors.c b/bootstrap/windows-88/errors.c index 34e6fae3..ba890a17 100644 --- a/bootstrap/windows-88/errors.c +++ b/bootstrap/windows-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-88/errors.h b/bootstrap/windows-88/errors.h index ce275b8c..d8124792 100644 --- a/bootstrap/windows-88/errors.h +++ b/bootstrap/windows-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index fd7974da..76fdc084 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -12,10 +12,11 @@ #include "Strings.h" -static CHAR extTools_compilationOptions[1023], extTools_CFLAGS[1023]; +static CHAR extTools_CFLAGS[1023]; export void extTools_Assemble (CHAR *moduleName, LONGINT moduleName__len); +static void extTools_InitialiseCompilerCommand (CHAR *s, LONGINT s__len); export void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN statically, CHAR *additionalopts, LONGINT additionalopts__len); static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGINT cmd__len); @@ -25,7 +26,7 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN int16 r, status, exitcode; __DUP(title, title__len, CHAR); __DUP(cmd, cmd__len, CHAR); - if (__IN(18, OPM_opt, 32)) { + if (__IN(18, OPM_Options, 32)) { Console_String(title, title__len); Console_String(cmd, cmd__len); Console_Ln(); @@ -60,12 +61,22 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN __DEL(cmd); } +static void extTools_InitialiseCompilerCommand (CHAR *s, LONGINT s__len) +{ + __COPY("gcc -g -O1", s, s__len); + Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); + Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); + Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); + Platform_GetEnv((CHAR*)"CFLAGS", 7, (void*)extTools_CFLAGS, 1023); + Strings_Append(extTools_CFLAGS, 1023, (void*)s, s__len); + Strings_Append((CHAR*)" ", 2, (void*)s, s__len); +} + void extTools_Assemble (CHAR *moduleName, LONGINT moduleName__len) { CHAR cmd[1023]; __DUP(moduleName, moduleName__len, CHAR); - __MOVE("gcc -g -O1", cmd, 11); - Strings_Append(extTools_compilationOptions, 1023, (void*)cmd, 1023); + extTools_InitialiseCompilerCommand((void*)cmd, 1023); Strings_Append((CHAR*)"-c ", 4, (void*)cmd, 1023); Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); Strings_Append((CHAR*)".c", 3, (void*)cmd, 1023); @@ -77,9 +88,7 @@ void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN stati { CHAR cmd[1023]; __DUP(additionalopts, additionalopts__len, CHAR); - __MOVE("gcc -g -O1", cmd, 11); - Strings_Append((CHAR*)" ", 2, (void*)cmd, 1023); - Strings_Append(extTools_compilationOptions, 1023, (void*)cmd, 1023); + extTools_InitialiseCompilerCommand((void*)cmd, 1023); Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); Strings_Append((CHAR*)".c ", 4, (void*)cmd, 1023); Strings_Append(additionalopts, additionalopts__len, (void*)cmd, 1023); @@ -92,6 +101,7 @@ void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN stati Strings_Append((CHAR*)"", 1, (void*)cmd, 1023); Strings_Append((CHAR*)"/lib\"", 6, (void*)cmd, 1023); Strings_Append((CHAR*)" -l voc", 8, (void*)cmd, 1023); + Strings_Append(OPM_Model, 10, (void*)cmd, 1023); extTools_execute((CHAR*)"Assemble and link: ", 20, cmd, 1023); __DEL(additionalopts); } @@ -107,11 +117,5 @@ export void *extTools__init(void) __MODULE_IMPORT(Strings); __REGMOD("extTools", 0); /* BEGIN */ - Strings_Append((CHAR*)" -I \"", 6, (void*)extTools_compilationOptions, 1023); - Strings_Append((CHAR*)"", 1, (void*)extTools_compilationOptions, 1023); - Strings_Append((CHAR*)"/include\" ", 11, (void*)extTools_compilationOptions, 1023); - Platform_GetEnv((CHAR*)"CFLAGS", 7, (void*)extTools_CFLAGS, 1023); - Strings_Append(extTools_CFLAGS, 1023, (void*)extTools_compilationOptions, 1023); - Strings_Append((CHAR*)" ", 2, (void*)extTools_compilationOptions, 1023); __ENDMOD; } diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index f87adfac..bb5be954 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/vt100.c b/bootstrap/windows-88/vt100.c index ca56f466..c44586d2 100644 --- a/bootstrap/windows-88/vt100.c +++ b/bootstrap/windows-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-88/vt100.h b/bootstrap/windows-88/vt100.h index f5b8588f..c9a01a7c 100644 --- a/bootstrap/windows-88/vt100.h +++ b/bootstrap/windows-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/makefile b/makefile index 893e59bc..df72a78b 100644 --- a/makefile +++ b/makefile @@ -190,29 +190,29 @@ browsercmd: configuration # library: build all directories under src/library library: configuration - @make -f src/tools/make/oberon.mk -s library + @make -f src/tools/make/oberon.mk -s library MODEL=2 # Individual library components v4: configuration - @make -f src/tools/make/oberon.mk -s v4 + @make -f src/tools/make/oberon.mk -s v4 MODEL=2 ooc2: configuration - @make -f src/tools/make/oberon.mk -s ooc2 + @make -f src/tools/make/oberon.mk -s ooc2 MODEL=2 ooc: configuration - @make -f src/tools/make/oberon.mk -s ooc + @make -f src/tools/make/oberon.mk -s ooc MODEL=2 ulm: configuration - @make -f src/tools/make/oberon.mk -s ulm + @make -f src/tools/make/oberon.mk -s ulm MODEL=2 pow32: configuration - @make -f src/tools/make/oberon.mk -s pow32 + @make -f src/tools/make/oberon.mk -s pow32 MODEL=2 misc: configuration - @make -f src/tools/make/oberon.mk -s misc + @make -f src/tools/make/oberon.mk -s misc MODEL=2 s3: configuration - @make -f src/tools/make/oberon.mk -s s3 + @make -f src/tools/make/oberon.mk -s s3 MODEL=2 @@ -247,8 +247,8 @@ planned-binary-change: # built then run 'make revertbootstrap' first. bootstrap: bootstrapconfiguration @make -f src/tools/make/oberon.mk -s clean - @make -f src/tools/make/oberon.mk -s translate - @make -f src/tools/make/oberon.mk -s assemble + @make -f src/tools/make/oberon.mk -s translate MODEL=2 + @make -f src/tools/make/oberon.mk -s assemble MODEL=2 rm -rf bootstrap/* make -f src/tools/make/oberon.mk -s translate MODEL=2 INTSIZE=2 ADRSIZE=4 ALIGNMENT=4 PLATFORM=unix BUILDDIR=bootstrap/unix-44 && rm bootstrap/unix-44/*.sym make -f src/tools/make/oberon.mk -s translate MODEL=2 INTSIZE=2 ADRSIZE=4 ALIGNMENT=8 PLATFORM=unix BUILDDIR=bootstrap/unix-48 && rm bootstrap/unix-48/*.sym diff --git a/src/library/ooc/oocLRealMath.Mod b/src/library/ooc/oocLRealMath.Mod index 3da0cf96..552f8c20 100644 --- a/src/library/ooc/oocLRealMath.Mod +++ b/src/library/ooc/oocLRealMath.Mod @@ -1,42 +1,42 @@ MODULE oocLRealMath; (* - LRealMath - Target independent mathematical functions for LONGREAL + LRealMath - Target independent mathematical functions for LONGREAL (IEEE double-precision) numbers. - + Numerical approximations are taken from "Software Manual for the Elementary Functions" by Cody & Waite and "Computer Approximations" - by Hart et al. - + by Hart et al. + Copyright (C) 1996-1998 Michael Griebling - + This module is free software; you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as + it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This module is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. - + You should have received a copy of the GNU Lesser General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *) -IMPORT l := oocLowLReal, m := oocRealMath; - +IMPORT l := oocLowLReal, m := oocRealMath, SYSTEM; + CONST pi* = 3.1415926535897932384626433832795028841972D0; exp1* = 2.7182818284590452353602874713526624977572D0; - ZERO=0.0D0; ONE=1.0D0; HALF=0.5D0; TWO=2.0D0; (* local constants *) - + ZERO=0.0D0; ONE=1.0D0; HALF=0.5D0; TWO=2.0D0; (* local constants *) + (* internally-used constants *) huge=l.large; (* largest number this package accepts *) - miny=l.small; (* smallest number this package accepts *) + miny=l.small; (* smallest number this package accepts *) sqrtHalf=0.70710678118654752440D0; Limit=1.0536712D-8; (* 2**(-MantBits/2) *) eps=5.5511151D-17; (* 2**(-MantBits-1) *) @@ -44,30 +44,30 @@ CONST piByTwo=1.57079632679489661923D0; lnv=0.6931610107421875D0; (* should be exact *) vbytwo=0.13830277879601902638D-4; (* used in sinh/cosh *) - ln2Inv=1.44269504088896340735992468100189213D0; - + ln2Inv=1.44269504088896340735992468100189213D0; + (* error/exception codes *) - NoError*=m.NoError; IllegalRoot*=m.IllegalRoot; IllegalLog*=m.IllegalLog; Overflow*=m.Overflow; - IllegalPower*=m.IllegalPower; IllegalLogBase*=m.IllegalLogBase; IllegalTrig*=m.IllegalTrig; - IllegalInvTrig*=m.IllegalInvTrig; HypInvTrigClipped*=m.HypInvTrigClipped; + NoError*=m.NoError; IllegalRoot*=m.IllegalRoot; IllegalLog*=m.IllegalLog; Overflow*=m.Overflow; + IllegalPower*=m.IllegalPower; IllegalLogBase*=m.IllegalLogBase; IllegalTrig*=m.IllegalTrig; + IllegalInvTrig*=m.IllegalInvTrig; HypInvTrigClipped*=m.HypInvTrigClipped; IllegalHypInvTrig*=m.IllegalHypInvTrig; LossOfAccuracy*=m.LossOfAccuracy; - + VAR a1: ARRAY 18 OF LONGREAL; (* lookup table for power function *) - a2: ARRAY 9 OF LONGREAL; (* lookup table for power function *) - em: LONGREAL; (* largest number such that 1+epsilon > 1.0 *) + a2: ARRAY 9 OF LONGREAL; (* lookup table for power function *) + em: LONGREAL; (* largest number such that 1+epsilon > 1.0 *) LnInfinity: LONGREAL; (* natural log of infinity *) LnSmall: LONGREAL; (* natural log of very small number *) SqrtInfinity: LONGREAL; (* square root of infinity *) TanhMax: LONGREAL; (* maximum Tanh value *) t: LONGREAL; (* internal variables *) - + (* internally used support routines *) PROCEDURE SinCos (x, y, sign: LONGREAL): LONGREAL; CONST ymax=210828714; (* ENTIER(pi*2**(MantBits/2)) *) - c1=3.1416015625D0; + c1=3.1416015625D0; c2=-8.908910206761537356617D-6; r1=-0.16666666666666665052D+0; r2= 0.83333333333331650314D-2; @@ -77,24 +77,24 @@ PROCEDURE SinCos (x, y, sign: LONGREAL): LONGREAL; r6= 0.16058936490371589114D-9; r7=-0.76429178068910467734D-12; r8= 0.27204790957888846175D-14; - VAR - n: LONGINT; xn, f, x1, g: LONGREAL; + VAR + n: LONGINT; xn, f, x1, g: LONGREAL; BEGIN IF y>=ymax THEN l.ErrorHandler(LossOfAccuracy); RETURN ZERO END; - + (* determine the reduced number *) n:=ENTIER(y*piInv+HALF); xn:=n; IF ODD(n) THEN sign:=-sign END; x:=ABS(x); IF x#y THEN xn:=xn-HALF END; - + (* fractional part of reduced number *) x1:=ENTIER(x); f:=((x1-xn*c1)+(x-x1))-xn*c2; - + (* Pre: |f| <= pi/2 *) IF ABS(f)= 0 *) - CONST + CONST P0=0.41731; P1=0.59016; - VAR - xMant, yEst, z: LONGREAL; xExp: INTEGER; + VAR + xMant, yEst, z: LONGREAL; xExp: INTEGER; BEGIN (* optimize zeros and check for illegal negative roots *) IF x=ZERO THEN RETURN ZERO END; IF x=ZERO THEN n:=SHORT(ENTIER(ln2Inv*x+HALF)) ELSE n:=SHORT(ENTIER(ln2Inv*x-HALF)) END; xn:=n; g:=(x-xn*c1)-xn*c2; - + (* Calculate exp(g)/2 from "Software Manual for the Elementary Functions" *) z:=g*g; p:=((P2*z+P1)*z+P0)*g; q:=(Q2*z+Q1)*z+HALF; RETURN l.scale(HALF+p/(q-p), n+1) END exp; - + PROCEDURE ln*(x: LONGREAL): LONGREAL; (* Returns the natural logarithm of x for x > 0 *) CONST @@ -175,27 +175,27 @@ PROCEDURE ln*(x: LONGREAL): LONGREAL; BEGIN (* ensure illegal inputs are trapped and handled *) IF x<=ZERO THEN l.ErrorHandler(IllegalLog); RETURN -huge END; - + (* reduce the range of the input *) f:=l.fraction(x)*HALF; n:=l.exponent(x)+1; IF f>sqrtHalf THEN zn:=(f-HALF)-HALF; zd:=f*HALF+HALF - ELSE zn:=f-HALF; zd:=zn*HALF+HALF; DEC(n) + ELSE zn:=f-HALF; zd:=zn*HALF+HALF; DEC(n) END; - + (* evaluate rational approximation from "Software Manual for the Elementary Functions" *) z:=zn/zd; w:=z*z; q:=((w+Q2)*w+Q1)*w+Q0; p:=w*((P2*w+P1)*w+P0); r:=z+z*(p/q); - + (* scale the output *) - xn:=n; + xn:=n; RETURN (xn*c2+r)+xn*c1 END ln; - + (* The angle in all trigonometric functions is measured in radians *) - + PROCEDURE sin* (x: LONGREAL): LONGREAL; BEGIN - IF x 0 *) - CONST - P1=0.83333333333333211405D-1; P2=0.12500000000503799174D-1; - P3=0.22321421285924258967D-2; P4=0.43445775672163119635D-3; - K=0.44269504088896340736D0; - Q1=0.69314718055994529629D+0; Q2=0.24022650695909537056D+0; + CONST + P1=0.83333333333333211405D-1; P2=0.12500000000503799174D-1; + P3=0.22321421285924258967D-2; P4=0.43445775672163119635D-3; + K=0.44269504088896340736D0; + Q1=0.69314718055994529629D+0; Q2=0.24022650695909537056D+0; Q3=0.55504108664085595326D-1; Q4=0.96181290595172416964D-2; Q5=0.13333541313585784703D-2; Q6=0.15400290440989764601D-3; Q7=0.14928852680595608186D-4; OneOver16=0.0625D0; XMAX=16*l.expoMax-1; (*XMIN=16*l.expoMin+1;*) XMIN=-16351; (* noch *) - VAR z, g, R, v, u2, u1, w1, w2, y1, y2, w: LONGREAL; m, p, i: INTEGER; mp, pp, iw1: LONGINT; + VAR z, g, R, v, u2, u1, w1, w2, y1, y2, w: LONGREAL; m, p, i: INTEGER; mp, pp, iw1: LONGINT; BEGIN (* handle all possible error conditions *) IF ABS(exponent)ZERO THEN RETURN ZERO ELSE l.ErrorHandler(Overflow); RETURN -huge END END; - + (* extract the exponent of base to m and clear exponent of base in g *) g:=l.fraction(base)*HALF; m:=l.exponent(base)+1; - + (* determine p table offset with an unrolled binary search *) p:=1; IF g<=a1[9] THEN p:=9 END; IF g<=a1[p+4] THEN INC(p, 4) END; IF g<=a1[p+2] THEN INC(p, 2) END; - + (* compute scaled z so that |z| <= 0.044 *) z:=((g-a1[p+1])-a2[(p+1) DIV 2])/(g+a1[p+1]); z:=z+z; (* approximation for log2(z) from "Software Manual for the Elementary Functions" *) - v:=z*z; R:=(((P4*v+P3)*v+P2)*v+P1)*v*z; R:=R+K*R; u2:=(R+z*K)+z; u1:=(m*16-p)*OneOver16; - + v:=z*z; R:=(((P4*v+P3)*v+P2)*v+P1)*v*z; R:=R+K*R; u2:=(R+z*K)+z; u1:=(m*16-p)*OneOver16; + (* generate w with extra precision calculations *) y1:=ENTIER(16*exponent)*OneOver16; y2:=exponent-y1; w:=u2*exponent+u1*y2; w1:=ENTIER(16*w)*OneOver16; w2:=w-w1; w:=w1+u1*y1; @@ -283,14 +283,14 @@ BEGIN IF iw1>XMAX THEN l.ErrorHandler(Overflow); RETURN huge ELSIF iw1ZERO THEN INC(iw1); w2:=w2-OneOver16 END; IF iw1<0 THEN i:=0 ELSE i:=1 END; - mp:=div(iw1, 16)+i; pp:=16*mp-iw1; - z:=((((((Q7*w2+Q6)*w2+Q5)*w2+Q4)*w2+Q3)*w2+Q2)*w2+Q1)*w2; z:=a1[pp+1]+a1[pp+1]*z; + mp:=div(iw1, 16)+i; pp:=16*mp-iw1; + z:=((((((Q7*w2+Q6)*w2+Q5)*w2+Q4)*w2+Q3)*w2+Q2)*w2+Q1)*w2; z:=a1[pp+1]+a1[pp+1]*z; RETURN l.scale(z, SHORT(mp)) END power; - + PROCEDURE round*(x: LONGREAL): LONGINT; (* Returns the value of x rounded to the nearest integer *) BEGIN @@ -298,7 +298,7 @@ BEGIN ELSE RETURN ENTIER(x+HALF) END END round; - + PROCEDURE IsRMathException*(): BOOLEAN; (* Returns TRUE if the current coroutine is in the exceptional execution state because of the raising of the RealMath exception; otherwise returns FALSE. @@ -307,15 +307,15 @@ BEGIN RETURN FALSE END IsRMathException; - -(* + +(* Following routines are provided as extensions to the ISO standard. They are either used as the basis of other functions or provide - useful functions which are not part of the ISO standard. + useful functions which are not part of the ISO standard. *) PROCEDURE log* (x, base: LONGREAL): LONGREAL; -(* log(x,base) is the logarithm of x base b. All positive arguments are +(* log(x,base) is the logarithm of x base b. All positive arguments are allowed but base > 0 and base # 1. *) BEGIN (* log(x, base) = log2(x) / log2(base) *) @@ -324,9 +324,9 @@ BEGIN END END log; -PROCEDURE ipower* (x: LONGREAL; base: INTEGER): LONGREAL; +PROCEDURE ipower* (x: LONGREAL; base: INTEGER): LONGREAL; (* ipower(x, base) returns the x to the integer power base where base*Log2(x) < Log2(Max) *) - VAR y: LONGREAL; neg: BOOLEAN; Exp: LONGINT; + VAR y: LONGREAL; neg: BOOLEAN; Exp: LONGINT; PROCEDURE Adjust(xadj: LONGREAL): LONGREAL; BEGIN @@ -336,17 +336,17 @@ PROCEDURE ipower* (x: LONGREAL; base: INTEGER): LONGREAL; BEGIN (* handle all possible error conditions *) IF base=0 THEN RETURN ONE (* x**0 = 1 *) - ELSIF ABS(x)0 THEN RETURN ZERO ELSE l.ErrorHandler(Overflow); RETURN Adjust(huge) END END; (* trap potential overflows and underflows *) - Exp:=(l.exponent(x)+1)*base; y:=LnInfinity*ln2Inv; + Exp:=(l.exponent(x)+1)*base; y:=LnInfinity*ln2Inv; IF Exp>y THEN l.ErrorHandler(Overflow); RETURN Adjust(huge) ELSIF Exp<-y THEN RETURN ZERO - END; - - (* compute x**base using an optimised algorithm from Knuth, slightly + END; + + (* compute x**base using an optimised algorithm from Knuth, slightly altered : p442, The Art Of Computer Programming, Vol 2 *) y:=ONE; IF base<0 THEN neg:=TRUE; base := -base ELSE neg:= FALSE END; LOOP @@ -355,19 +355,19 @@ BEGIN x:=x*x; END; IF neg THEN RETURN ONE/y ELSE RETURN y END -END ipower; +END ipower; PROCEDURE sincos* (x: LONGREAL; VAR Sin, Cos: LONGREAL); (* More efficient sin/cos implementation if both values are needed. *) BEGIN Sin:=sin(x); Cos:=sqrt(ONE-Sin*Sin) -END sincos; +END sincos; PROCEDURE arctan2* (xn, xd: LONGREAL): LONGREAL; -(* arctan2(xn,xd) is the quadrant-correct arc tangent atan(xn/xd). If the +(* arctan2(xn,xd) is the quadrant-correct arc tangent atan(xn/xd). If the denominator xd is zero, then the numerator xn must not be zero. All arguments are legal except xn = xd = 0. *) - CONST + CONST P0=0.216062307897242551884D+3; P1=0.3226620700132512059245D+3; P2=0.13270239816397674701D+3; P3=0.1288838303415727934D+2; Q0=0.2160623078972426128957D+3; Q1=0.3946828393122829592162D+3; @@ -387,15 +387,15 @@ BEGIN IF ABS(xn)>ABS(xd) THEN z:=ABS(xd/xn); Quadrant:=2 ELSE z:=ABS(xn/xd); Quadrant:=0 END; - + (* further reduce range to within 0 to 2-sqrt(3) *) IF z>TWO-Sqrt3 THEN z:=(z*Sqrt3-ONE)/(Sqrt3+z); INC(Quadrant) END; - + (* approximation from "Computer Approximations" table ARCTN 5075 *) IF ABS(z)1 THEN atan:=-atan END; CASE Quadrant OF @@ -405,20 +405,20 @@ BEGIN | ELSE (* angle is correct *) END END; - + (* map negative xds into the correct quadrant *) IF xdLnInfinity THEN (* handle exp overflows *) y:=y-lnv; - IF y>LnInfinity-lnv+0.69 THEN l.ErrorHandler(Overflow); + IF y>LnInfinity-lnv+0.69 THEN l.ErrorHandler(Overflow); IF x>ZERO THEN RETURN huge ELSE RETURN -huge END ELSE f:=exp(y); f:=f+f*vbytwo (* don't change to f(1+vbytwo) *) END ELSE f:=exp(y); f:=(f-ONE/f)*HALF END; - - (* reach here when 1 < ABS(x) < LnInfinity-lnv+0.69 *) - IF x>ZERO THEN RETURN f ELSE RETURN -f END + + (* reach here when 1 < ABS(x) < LnInfinity-lnv+0.69 *) + IF x>ZERO THEN RETURN f ELSE RETURN -f END END sinh; - + PROCEDURE cosh* (x: LONGREAL): LONGREAL; (* cosh(x) is the hyperbolic cosine of x. The argument x must not be so large - that exp(|x|) overflows. *) + that exp(|x|) overflows. *) VAR y, f: LONGREAL; BEGIN y:=ABS(x); IF y>LnInfinity THEN (* handle exp overflows *) y:=y-lnv; - IF y>LnInfinity-lnv+0.69 THEN l.ErrorHandler(Overflow); + IF y>LnInfinity-lnv+0.69 THEN l.ErrorHandler(Overflow); IF x>ZERO THEN RETURN huge ELSE RETURN -huge END ELSE f:=exp(y); RETURN f+f*vbytwo (* don't change to f(1+vbytwo) *) END ELSE f:=exp(y); RETURN (f+ONE/f)*HALF END END cosh; - + PROCEDURE tanh* (x: LONGREAL): LONGREAL; (* tanh(x) is the hyperbolic tangent of x. All arguments are legal. *) - CONST - P0=-0.16134119023996228053D+4; P1=-0.99225929672236083313D+2; P2=-0.96437492777225469787D+0; + CONST + P0=-0.16134119023996228053D+4; P1=-0.99225929672236083313D+2; P2=-0.96437492777225469787D+0; Q0= 0.48402357071988688686D+4; Q1= 0.22337720718962312926D+4; Q2= 0.11274474380534949335D+3; - ln3over2=0.54930614433405484570D0; + ln3over2=0.54930614433405484570D0; BIG=19.06154747D0; (* (ln(2)+(t+1)*ln(B))/2 where t=mantissa bits, B=base *) VAR f, t: LONGREAL; BEGIN f:=ABS(x); @@ -487,7 +487,7 @@ BEGIN END arcsinh; PROCEDURE arccosh* (x: LONGREAL): LONGREAL; -(* arccosh(x) is the arc hyperbolic cosine of x. All arguments greater than +(* arccosh(x) is the arc hyperbolic cosine of x. All arguments greater than or equal to 1 are legal. *) BEGIN IF x*) - a1[ 1]:=ONE; - a1[ 2]:=ToLONGREAL(3FEEA4AFH, 0A2A490DAH); - a1[ 3]:=ToLONGREAL(3FED5818H, 0DCFBA487H); - a1[ 4]:=ToLONGREAL(3FEC199BH, 0DD85529CH); - a1[ 5]:=ToLONGREAL(3FEAE89FH, 0995AD3ADH); - a1[ 6]:=ToLONGREAL(3FE9C491H, 082A3F090H); - a1[ 7]:=ToLONGREAL(3FE8ACE5H, 0422AA0DBH); - a1[ 8]:=ToLONGREAL(3FE7A114H, 073EB0186H); - a1[ 9]:=ToLONGREAL(3FE6A09EH, 0667F3BCCH); - a1[10]:=ToLONGREAL(3FE5AB07H, 0DD485429H); - a1[11]:=ToLONGREAL(3FE4BFDAH, 0D5362A27H); - a1[12]:=ToLONGREAL(3FE3DEA6H, 04C123422H); - a1[13]:=ToLONGREAL(3FE306FEH, 00A31B715H); - a1[14]:=ToLONGREAL(3FE2387AH, 06E756238H); - a1[15]:=ToLONGREAL(3FE172B8H, 03C7D517AH); - a1[16]:=ToLONGREAL(3FE0B558H, 06CF9890FH); - a1[17]:=HALF; + a1[ 1] := ONE; + a1[ 2] := ToLONGREAL(3FEEA4AFA2A490DAH); (* ToLONGREAL(3FEEA4AFH, 0A2A490DAH); *) + a1[ 3] := ToLONGREAL(3FED5818DCFBA487H); (* ToLONGREAL(3FED5818H, 0DCFBA487H); *) + a1[ 4] := ToLONGREAL(3FEC199BDD85529CH); (* ToLONGREAL(3FEC199BH, 0DD85529CH); *) + a1[ 5] := ToLONGREAL(3FEAE89F995AD3ADH); (* ToLONGREAL(3FEAE89FH, 0995AD3ADH); *) + a1[ 6] := ToLONGREAL(3FE9C49182A3F090H); (* ToLONGREAL(3FE9C491H, 082A3F090H); *) + a1[ 7] := ToLONGREAL(3FE8ACE5422AA0DBH); (* ToLONGREAL(3FE8ACE5H, 0422AA0DBH); *) + a1[ 8] := ToLONGREAL(3FE7A11473EB0186H); (* ToLONGREAL(3FE7A114H, 073EB0186H); *) + a1[ 9] := ToLONGREAL(3FE6A09E667F3BCCH); (* ToLONGREAL(3FE6A09EH, 0667F3BCCH); *) + a1[10] := ToLONGREAL(3FE5AB07DD485429H); (* ToLONGREAL(3FE5AB07H, 0DD485429H); *) + a1[11] := ToLONGREAL(3FE4BFDAD5362A27H); (* ToLONGREAL(3FE4BFDAH, 0D5362A27H); *) + a1[12] := ToLONGREAL(3FE3DEA64C123422H); (* ToLONGREAL(3FE3DEA6H, 04C123422H); *) + a1[13] := ToLONGREAL(3FE306FE0A31B715H); (* ToLONGREAL(3FE306FEH, 00A31B715H); *) + a1[14] := ToLONGREAL(3FE2387A6E756238H); (* ToLONGREAL(3FE2387AH, 06E756238H); *) + a1[15] := ToLONGREAL(3FE172B83C7D517AH); (* ToLONGREAL(3FE172B8H, 03C7D517AH); *) + a1[16] := ToLONGREAL(3FE0B5586CF9890FH); (* ToLONGREAL(3FE0B558H, 06CF9890FH); *) + a1[17] := HALF; (* a2[i]=2**[(1-2i)/16] - a1[2i]; delta resolution *) - a2[1]:=ToLONGREAL(3C90B1EEH, 074320000H); - a2[2]:=ToLONGREAL(3C711065H, 089500000H); - a2[3]:=ToLONGREAL(3C6C7C46H, 0B0700000H); - a2[4]:=ToLONGREAL(3C9AFAA2H, 0047F0000H); - a2[5]:=ToLONGREAL(3C86324CH, 005460000H); - a2[6]:=ToLONGREAL(3C7ADA09H, 011F00000H); - a2[7]:=ToLONGREAL(3C89B07EH, 0B6C80000H); - a2[8]:=ToLONGREAL(3C88A62EH, 04ADC0000H); - + a2[1] := ToLONGREAL(3C90B1EE74320000H); (* ToLONGREAL(3C90B1EEH, 074320000H); *) + a2[2] := ToLONGREAL(3C71106589500000H); (* ToLONGREAL(3C711065H, 089500000H); *) + a2[3] := ToLONGREAL(3C6C7C46B0700000H); (* ToLONGREAL(3C6C7C46H, 0B0700000H); *) + a2[4] := ToLONGREAL(3C9AFAA2047F0000H); (* ToLONGREAL(3C9AFAA2H, 0047F0000H); *) + a2[5] := ToLONGREAL(3C86324C05460000H); (* ToLONGREAL(3C86324CH, 005460000H); *) + a2[6] := ToLONGREAL(3C7ADA0911F00000H); (* ToLONGREAL(3C7ADA09H, 011F00000H); *) + a2[7] := ToLONGREAL(3C89B07EB6C80000H); (* ToLONGREAL(3C89B07EH, 0B6C80000H); *) + a2[8] := ToLONGREAL(3C88A62E4ADC0000H); (* ToLONGREAL(3C88A62EH, 04ADC0000H); *) + (* reenable compiler warnings *) (*<* POP *>*) END oocLRealMath. diff --git a/src/library/ooc/oocLowReal.Mod b/src/library/ooc/oocLowReal.Mod index 83ae8e32..7319794f 100644 --- a/src/library/ooc/oocLowReal.Mod +++ b/src/library/ooc/oocLowReal.Mod @@ -216,7 +216,7 @@ BEGIN IF x 0) DO + IF Streams.ReadByte(in1, b1) & Streams.ReadByte(in2, b2) THEN + res := XorByte(b1, b2); + IF ~Streams.WriteByte(out, res) THEN + RETURN FALSE + END; ELSE - wholeStream := FALSE; + RETURN wholeStream END; - WHILE wholeStream OR (length > 0) DO - IF Streams.ReadByte(in1, b1) & Streams.ReadByte(in2, b2) THEN - res := XorByte(b1, b2); - IF ~Streams.WriteByte(out, res) THEN - RETURN FALSE - END; - ELSE - RETURN wholeStream - END; - DEC(length); - END; - RETURN TRUE - END XorStream; + DEC(length); + END; + RETURN TRUE + END XorStream; END ulmCipherOps. diff --git a/src/library/ulm/ulmCiphers.Mod b/src/library/ulm/ulmCiphers.Mod index bc881c83..95d66aa8 100644 --- a/src/library/ulm/ulmCiphers.Mod +++ b/src/library/ulm/ulmCiphers.Mod @@ -29,15 +29,15 @@ (* abstraction for the use of ciphers and cryptographic methods *) MODULE ulmCiphers; -IMPORT Objects := ulmObjects, PersistentObjects := ulmPersistentObjects, PersistentDisciplines := ulmPersistentDisciplines, Services := ulmServices, +IMPORT Objects := ulmObjects, PersistentObjects := ulmPersistentObjects, PersistentDisciplines := ulmPersistentDisciplines, Services := ulmServices, Streams := ulmStreams, Write := ulmWrite; TYPE Cipher* = POINTER TO CipherRec; -TYPE - CryptProc* = PROCEDURE (in: Streams.Stream; key: Cipher; - length: INTEGER; out: Streams.Stream) : BOOLEAN; +TYPE + CryptProc* = PROCEDURE (in: Streams.Stream; key: Cipher; + length: INTEGER; out: Streams.Stream) : BOOLEAN; TYPE Interface* = POINTER TO InterfaceRec; @@ -48,7 +48,7 @@ TYPE END; TYPE - CipherRec* = RECORD + CipherRec* = RECORD (PersistentDisciplines.ObjectRec) (* private *) if : Interface @@ -64,31 +64,31 @@ BEGIN key.if := if; END Init; -PROCEDURE Encrypt*(in: Streams.Stream; key: Cipher; - out: Streams.Stream) : BOOLEAN; +PROCEDURE Encrypt*(in: Streams.Stream; key: Cipher; + out: Streams.Stream) : BOOLEAN; BEGIN RETURN key.if.encrypt(in, key, -1, out); END Encrypt; -PROCEDURE Decrypt*(in: Streams.Stream; key: Cipher; - out: Streams.Stream) : BOOLEAN; +PROCEDURE Decrypt*(in: Streams.Stream; key: Cipher; + out: Streams.Stream) : BOOLEAN; BEGIN RETURN key.if.decrypt(in, key, -1, out); END Decrypt; -PROCEDURE EncryptPart*(in: Streams.Stream; key: Cipher; - length: INTEGER; out: Streams.Stream) : BOOLEAN; +PROCEDURE EncryptPart*(in: Streams.Stream; key: Cipher; + length: INTEGER; out: Streams.Stream) : BOOLEAN; BEGIN RETURN key.if.encrypt(in, key, length, out); END EncryptPart; -PROCEDURE DecryptPart*(in: Streams.Stream; key: Cipher; - length: INTEGER; out: Streams.Stream) : BOOLEAN; +PROCEDURE DecryptPart*(in: Streams.Stream; key: Cipher; + length: INTEGER; out: Streams.Stream) : BOOLEAN; BEGIN RETURN key.if.decrypt(in, key, length, out); END DecryptPart; BEGIN - PersistentObjects.RegisterType(cipherType, "Ciphers.Cipher", + PersistentObjects.RegisterType(cipherType, "Ciphers.Cipher", "PersistentDisciplines.Object", NIL); END ulmCiphers. diff --git a/src/library/ulm/ulmDisciplines.Mod b/src/library/ulm/ulmDisciplines.Mod index 913f7c03..d96617a6 100644 --- a/src/library/ulm/ulmDisciplines.Mod +++ b/src/library/ulm/ulmDisciplines.Mod @@ -1,140 +1,140 @@ (* Ulm's Oberon Library - Copyright (C) 1989-1994 by University of Ulm, SAI, D-89069 Ulm, Germany - ---------------------------------------------------------------------------- - Ulm's Oberon Library is free software; you can redistribute it - and/or modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either version - 2 of the License, or (at your option) any later version. + Copyright (C) 1989-1994 by University of Ulm, SAI, D-89069 Ulm, Germany + ---------------------------------------------------------------------------- + Ulm's Oberon Library is free software; you can redistribute it + and/or modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either version + 2 of the License, or (at your option) any later version. - Ulm's Oberon Library is distributed in the hope that it will be - useful, but WITHOUT ANY WARRANTY; without even the implied warranty - of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. + Ulm's Oberon Library is distributed in the hope that it will be + useful, but WITHOUT ANY WARRANTY; without even the implied warranty + of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - ---------------------------------------------------------------------------- - E-mail contact: oberon@mathematik.uni-ulm.de - ---------------------------------------------------------------------------- - $Id: Disciplines.om,v 1.1 1994/02/22 20:07:03 borchert Exp $ - ---------------------------------------------------------------------------- - $Log: Disciplines.om,v $ - Revision 1.1 1994/02/22 20:07:03 borchert - Initial revision + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + ---------------------------------------------------------------------------- + E-mail contact: oberon@mathematik.uni-ulm.de + ---------------------------------------------------------------------------- + $Id: Disciplines.om,v 1.1 1994/02/22 20:07:03 borchert Exp $ + ---------------------------------------------------------------------------- + $Log: Disciplines.om,v $ + Revision 1.1 1994/02/22 20:07:03 borchert + Initial revision - ---------------------------------------------------------------------------- - AFB 5/91 - ---------------------------------------------------------------------------- + ---------------------------------------------------------------------------- + AFB 5/91 + ---------------------------------------------------------------------------- *) MODULE ulmDisciplines; - (* Disciplines allows to attach additional data structures to - abstract datatypes like Streams; - these added data structures permit to parametrize operations - which are provided by other modules (e.g. Read or Write for Streams) - *) + (* Disciplines allows to attach additional data structures to + abstract datatypes like Streams; + these added data structures permit to parametrize operations + which are provided by other modules (e.g. Read or Write for Streams) + *) - IMPORT Objects := ulmObjects; + IMPORT Objects := ulmObjects; - TYPE - Identifier* = LONGINT; + TYPE + Identifier* = LONGINT; - Discipline* = POINTER TO DisciplineRec; - DisciplineRec* = - RECORD - (Objects.ObjectRec) - id*: Identifier; (* should be unique for all types of disciplines *) - END; - - DisciplineList = POINTER TO DisciplineListRec; - DisciplineListRec = - RECORD - discipline: Discipline; - id: Identifier; (* copied from discipline.id *) - next: DisciplineList; - END; - - Object* = POINTER TO ObjectRec; - ObjectRec* = - RECORD - (Objects.ObjectRec) - (* private part *) - list: DisciplineList; (* set of disciplines *) - END; - - VAR - unique: Identifier; - - PROCEDURE Unique*() : Identifier; - (* returns a unique identifier; - this procedure should be called during initialization by - all modules defining a discipline type - *) - BEGIN - INC(unique); - RETURN unique - END Unique; - - PROCEDURE Remove*(object: Object; id: Identifier); - (* remove the discipline with the given id from object, if it exists *) - VAR - prev, dl: DisciplineList; - BEGIN - prev := NIL; - dl := object.list; - WHILE (dl # NIL) & (dl.id # id) DO - prev := dl; dl := dl.next; + Discipline* = POINTER TO DisciplineRec; + DisciplineRec* = + RECORD + (Objects.ObjectRec) + id*: Identifier; (* should be unique for all types of disciplines *) END; - IF dl # NIL THEN - IF prev = NIL THEN - object.list := dl.next; - ELSE - prev.next := dl.next; - END; - END; - END Remove; - PROCEDURE Add*(object: Object; discipline: Discipline); - (* adds a new discipline to the given object; - if already a discipline with the same identifier exist - it is deleted first - *) - VAR - dl: DisciplineList; - BEGIN - dl := object.list; - WHILE (dl # NIL) & (dl.id # discipline.id) DO - dl := dl.next; + DisciplineList = POINTER TO DisciplineListRec; + DisciplineListRec = + RECORD + discipline: Discipline; + id: Identifier; (* copied from discipline.id *) + next: DisciplineList; END; - IF dl = NIL THEN - NEW(dl); - dl.id := discipline.id; - dl.next := object.list; - object.list := dl; - END; - dl.discipline := discipline; - END Add; - PROCEDURE Seek*(object: Object; id: Identifier; - VAR discipline: Discipline) : BOOLEAN; - (* returns TRUE if a discipline with the given id is found *) - VAR - dl: DisciplineList; - BEGIN - dl := object.list; - WHILE (dl # NIL) & (dl.id # id) DO - dl := dl.next; + Object* = POINTER TO ObjectRec; + ObjectRec* = + RECORD + (Objects.ObjectRec) + (* private part *) + list: DisciplineList; (* set of disciplines *) END; - IF dl # NIL THEN - discipline := dl.discipline; + + VAR + unique: Identifier; + + PROCEDURE Unique*() : Identifier; + (* returns a unique identifier; + this procedure should be called during initialization by + all modules defining a discipline type + *) + BEGIN + INC(unique); + RETURN unique + END Unique; + + PROCEDURE Remove*(object: Object; id: Identifier); + (* remove the discipline with the given id from object, if it exists *) + VAR + prev, dl: DisciplineList; + BEGIN + prev := NIL; + dl := object.list; + WHILE (dl # NIL) & (dl.id # id) DO + prev := dl; dl := dl.next; + END; + IF dl # NIL THEN + IF prev = NIL THEN + object.list := dl.next; ELSE - discipline := NIL; + prev.next := dl.next; END; - RETURN discipline # NIL - END Seek; + END; + END Remove; + + PROCEDURE Add*(object: Object; discipline: Discipline); + (* adds a new discipline to the given object; + if already a discipline with the same identifier exist + it is deleted first + *) + VAR + dl: DisciplineList; + BEGIN + dl := object.list; + WHILE (dl # NIL) & (dl.id # discipline.id) DO + dl := dl.next; + END; + IF dl = NIL THEN + NEW(dl); + dl.id := discipline.id; + dl.next := object.list; + object.list := dl; + END; + dl.discipline := discipline; + END Add; + + PROCEDURE Seek*(object: Object; id: Identifier; + VAR discipline: Discipline) : BOOLEAN; + (* returns TRUE if a discipline with the given id is found *) + VAR + dl: DisciplineList; + BEGIN + dl := object.list; + WHILE (dl # NIL) & (dl.id # id) DO + dl := dl.next; + END; + IF dl # NIL THEN + discipline := dl.discipline; + ELSE + discipline := NIL; + END; + RETURN discipline # NIL + END Seek; BEGIN - unique := 0; + unique := 0; END ulmDisciplines. diff --git a/src/library/ulm/ulmErrors.Mod b/src/library/ulm/ulmErrors.Mod index edb1cb6f..7336bca2 100644 --- a/src/library/ulm/ulmErrors.Mod +++ b/src/library/ulm/ulmErrors.Mod @@ -1,158 +1,161 @@ (* Ulm's Oberon Library - Copyright (C) 1989-1994 by University of Ulm, SAI, D-89069 Ulm, Germany - ---------------------------------------------------------------------------- - Ulm's Oberon Library is free software; you can redistribute it - and/or modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either version - 2 of the License, or (at your option) any later version. + Copyright (C) 1989-1994 by University of Ulm, SAI, D-89069 Ulm, Germany + ---------------------------------------------------------------------------- + Ulm's Oberon Library is free software; you can redistribute it + and/or modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either version + 2 of the License, or (at your option) any later version. - Ulm's Oberon Library is distributed in the hope that it will be - useful, but WITHOUT ANY WARRANTY; without even the implied warranty - of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. + Ulm's Oberon Library is distributed in the hope that it will be + useful, but WITHOUT ANY WARRANTY; without even the implied warranty + of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - ---------------------------------------------------------------------------- - E-mail contact: oberon@mathematik.uni-ulm.de - ---------------------------------------------------------------------------- - $Id: Errors.om,v 1.2 1994/07/18 14:16:33 borchert Exp $ - ---------------------------------------------------------------------------- - $Log: Errors.om,v $ - Revision 1.2 1994/07/18 14:16:33 borchert - unused variables of Write (ch & index) removed + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + ---------------------------------------------------------------------------- + E-mail contact: oberon@mathematik.uni-ulm.de + ---------------------------------------------------------------------------- + $Id: Errors.om,v 1.2 1994/07/18 14:16:33 borchert Exp $ + ---------------------------------------------------------------------------- + $Log: Errors.om,v $ + Revision 1.2 1994/07/18 14:16:33 borchert + unused variables of Write (ch & index) removed - Revision 1.1 1994/02/22 20:07:15 borchert - Initial revision + Revision 1.1 1994/02/22 20:07:15 borchert + Initial revision - ---------------------------------------------------------------------------- - AFB 11/91 - ---------------------------------------------------------------------------- + ---------------------------------------------------------------------------- + AFB 11/91 + ---------------------------------------------------------------------------- *) MODULE ulmErrors; - (* translate events to errors *) + (* translate events to errors *) - IMPORT Disciplines := ulmDisciplines, Events := ulmEvents, Objects := ulmObjects, RelatedEvents := ulmRelatedEvents, Streams := ulmStreams, Strings := ulmStrings, - SYS := SYSTEM; + IMPORT Disciplines := ulmDisciplines, Events := ulmEvents, Objects := ulmObjects, RelatedEvents := ulmRelatedEvents, Streams := ulmStreams, Strings := ulmStrings, + SYS := SYSTEM; - CONST - (* Kind = (debug, message, warning, error, fatal, bug) *) - debug* = 0; - message* = 1; - warning* = 2; - error* = 3; - fatal* = 4; - bug* = 5; - nkinds* = 6; - TYPE - Kind* = SHORTINT; (* debug..bug *) - VAR - kindText*: ARRAY nkinds OF ARRAY 12 OF CHAR; + CONST + (* Kind = (debug, message, warning, error, fatal, bug) *) + debug* = 0; + message* = 1; + warning* = 2; + error* = 3; + fatal* = 4; + bug* = 5; + nkinds* = 6; + TYPE + Kind* = SHORTINT; (* debug..bug *) + VAR + kindText*: ARRAY nkinds OF ARRAY 12 OF CHAR; - TYPE - Handler* = PROCEDURE (event: Events.Event; kind: Kind); - HandlerSet* = POINTER TO HandlerSetRec; - HandlerSetRec* = - RECORD - (Disciplines.ObjectRec) - (* private components *) - handlerSet: SET; (* set of installed handlers *) - handler: ARRAY nkinds OF Handler; - END; - - (* ========== write discipline ========================================= *) - TYPE - WriteProcedure* = PROCEDURE (s: Streams.Stream; event: Events.Event); - WriteDiscipline = POINTER TO WriteDisciplineRec; - WriteDisciplineRec = - RECORD - (Disciplines.DisciplineRec) - write: WriteProcedure; - END; - VAR - writeDiscId: Disciplines.Identifier; - - (* ========== handler discipline ======================================= *) - TYPE - HandlerDiscipline = POINTER TO HandlerDisciplineRec; - HandlerDisciplineRec = - RECORD - (Disciplines.DisciplineRec) - hs: HandlerSet; - kind: Kind; - END; - VAR - handlerDiscId: Disciplines.Identifier; - - VAR - null*: HandlerSet; (* empty handler set *) - - PROCEDURE CreateHandlerSet*(VAR hs: HandlerSet); - BEGIN - NEW(hs); hs.handlerSet := {}; - END CreateHandlerSet; - - PROCEDURE InstallHandler*(hs: HandlerSet; kind: Kind; handler: Handler); - BEGIN - hs.handler[kind] := handler; - INCL(hs.handlerSet, kind); - END InstallHandler; - - PROCEDURE AssignWriteProcedure*(eventType: Events.EventType; - write: WriteProcedure); - VAR - writeDiscipline: WriteDiscipline; - BEGIN - NEW(writeDiscipline); - writeDiscipline.id := writeDiscId; - writeDiscipline.write := write; - Disciplines.Add(eventType, writeDiscipline); - END AssignWriteProcedure; - - PROCEDURE Write*(s: Streams.Stream; event: Events.Event); - VAR - writeDiscipline: WriteDiscipline; - BEGIN - IF Disciplines.Seek(event.type, writeDiscId, SYS.VAL(Disciplines.Discipline, writeDiscipline)) THEN - writeDiscipline.write(s, event); - ELSE - IF ~Streams.WritePart(s, event.message, 0, - Strings.Len(event.message)) THEN - END; + TYPE + Handler* = PROCEDURE (event: Events.Event; kind: Kind); + HandlerSet* = POINTER TO HandlerSetRec; + HandlerSetRec* = + RECORD + (Disciplines.ObjectRec) + (* private components *) + handlerSet: SET; (* set of installed handlers *) + handler: ARRAY nkinds OF Handler; END; - END Write; - PROCEDURE GeneralEventHandler(event: Events.Event); - VAR - disc: HandlerDiscipline; - BEGIN - IF Disciplines.Seek(event.type, handlerDiscId, SYS.VAL(Disciplines.Discipline, disc)) & - (disc.kind IN disc.hs.handlerSet) THEN - disc.hs.handler[disc.kind](event, disc.kind); + (* ========== write discipline ========================================= *) + TYPE + WriteProcedure* = PROCEDURE (s: Streams.Stream; event: Events.Event); + WriteDiscipline = POINTER TO WriteDisciplineRec; + WriteDisciplineRec = + RECORD + (Disciplines.DisciplineRec) + write: WriteProcedure; END; - END GeneralEventHandler; + VAR + writeDiscId: Disciplines.Identifier; - PROCEDURE CatchEvent*(hs: HandlerSet; kind: Kind; type: Events.EventType); - VAR - handlerDiscipline: HandlerDiscipline; - BEGIN - NEW(handlerDiscipline); handlerDiscipline.id := handlerDiscId; - handlerDiscipline.hs := hs; handlerDiscipline.kind := kind; - Disciplines.Add(type, handlerDiscipline); - Events.Handler(type, GeneralEventHandler); - END CatchEvent; + (* ========== handler discipline ======================================= *) + TYPE + HandlerDiscipline = POINTER TO HandlerDisciplineRec; + HandlerDisciplineRec = + RECORD + (Disciplines.DisciplineRec) + hs: HandlerSet; + kind: Kind; + END; + VAR + handlerDiscId: Disciplines.Identifier; + + VAR + null*: HandlerSet; (* empty handler set *) + + PROCEDURE CreateHandlerSet*(VAR hs: HandlerSet); + BEGIN + NEW(hs); hs.handlerSet := {}; + END CreateHandlerSet; + + PROCEDURE InstallHandler*(hs: HandlerSet; kind: Kind; handler: Handler); + BEGIN + hs.handler[kind] := handler; + INCL(hs.handlerSet, kind); + END InstallHandler; + + PROCEDURE AssignWriteProcedure*(eventType: Events.EventType; + write: WriteProcedure); + VAR + writeDiscipline: WriteDiscipline; + BEGIN + NEW(writeDiscipline); + writeDiscipline.id := writeDiscId; + writeDiscipline.write := write; + Disciplines.Add(eventType, writeDiscipline); + END AssignWriteProcedure; + + PROCEDURE Write*(s: Streams.Stream; event: Events.Event); + VAR + writeDiscipline: Disciplines.Discipline; + BEGIN + IF Disciplines.Seek(event.type, writeDiscId, writeDiscipline) THEN + writeDiscipline(WriteDiscipline).write(s, event); + ELSE + IF ~Streams.WritePart(s, event.message, 0, + Strings.Len(event.message)) THEN + END; + END; + END Write; + + PROCEDURE GeneralEventHandler(event: Events.Event); + VAR + disc: Disciplines.Discipline; + hdisc: HandlerDiscipline; + BEGIN + IF Disciplines.Seek(event.type, handlerDiscId, disc) THEN + hdisc := disc(HandlerDiscipline); + IF hdisc.kind IN hdisc.hs.handlerSet THEN + hdisc.hs.handler[hdisc.kind](event, hdisc.kind) + END + END; + END GeneralEventHandler; + + PROCEDURE CatchEvent*(hs: HandlerSet; kind: Kind; type: Events.EventType); + VAR + handlerDiscipline: HandlerDiscipline; + BEGIN + NEW(handlerDiscipline); handlerDiscipline.id := handlerDiscId; + handlerDiscipline.hs := hs; handlerDiscipline.kind := kind; + Disciplines.Add(type, handlerDiscipline); + Events.Handler(type, GeneralEventHandler); + END CatchEvent; BEGIN - writeDiscId := Disciplines.Unique(); - handlerDiscId := Disciplines.Unique(); - CreateHandlerSet(null); - kindText[debug] := "debug"; - kindText[message] := "message"; - kindText[warning] := "warning"; - kindText[error] := "error"; - kindText[fatal] := "fatal"; - kindText[bug] := "bug"; + writeDiscId := Disciplines.Unique(); + handlerDiscId := Disciplines.Unique(); + CreateHandlerSet(null); + kindText[debug] := "debug"; + kindText[message] := "message"; + kindText[warning] := "warning"; + kindText[error] := "error"; + kindText[fatal] := "fatal"; + kindText[bug] := "bug"; END ulmErrors. diff --git a/src/library/ulm/ulmEvents.Mod b/src/library/ulm/ulmEvents.Mod index 6016f8b0..52695762 100644 --- a/src/library/ulm/ulmEvents.Mod +++ b/src/library/ulm/ulmEvents.Mod @@ -46,88 +46,88 @@ MODULE ulmEvents; CONST (* possibilities on receipt of an event: *) - default* = 0; (* causes abortion *) - ignore* = 1; (* ignore event *) - funcs* = 2; (* call associated event handlers *) + default* = 0; (* causes abortion *) + ignore* = 1; (* ignore event *) + funcs* = 2; (* call associated event handlers *) TYPE - Reaction* = INTEGER; (* one of default, ignore, or funcs *) + Reaction* = INTEGER; (* one of default, ignore, or funcs *) Message* = ARRAY 80 OF CHAR; Event* = POINTER TO EventRec; EventRec* = - RECORD - (Objects.ObjectRec) - type*: EventType; - message*: Message; - (* private part *) - next: Event; (* queue *) - END; + RECORD + (Objects.ObjectRec) + type*: EventType; + message*: Message; + (* private part *) + next: Event; (* queue *) + END; EventHandler = PROCEDURE (event: Event); (* event managers are needed if there is any action necessary - on changing the kind of reaction + on changing the kind of reaction *) EventManager = PROCEDURE (type: EventType; reaction: Reaction); Priority = INTEGER; (* must be non-negative *) (* every event with reaction `funcs' has a handler list; - the list is in calling order which is reverse to - the order of `Handler'-calls + the list is in calling order which is reverse to + the order of `Handler'-calls *) HandlerList = POINTER TO HandlerRec; HandlerRec* = - RECORD - (Objects.ObjectRec) - handler*: EventHandler; - next*: HandlerList; - END; + RECORD + (Objects.ObjectRec) + handler*: EventHandler; + next*: HandlerList; + END; SaveList = POINTER TO SaveRec; SaveRec = - RECORD - reaction: Reaction; - handlers: HandlerList; - next: SaveList; - END; + RECORD + reaction: Reaction; + handlers: HandlerList; + next: SaveList; + END; EventTypeRec* = - RECORD - (Services.ObjectRec) - (* private components *) - handlers: HandlerList; - priority: Priority; - reaction: Reaction; - manager: EventManager; - savelist: SaveList; - END; + RECORD + (Services.ObjectRec) + (* private components *) + handlers: HandlerList; + priority: Priority; + reaction: Reaction; + manager: EventManager; + savelist: SaveList; + END; Queue = POINTER TO QueueRec; QueueRec = - RECORD - priority: INTEGER; (* queue for this priority *) - head, tail: Event; - next: Queue; (* queue with lower priority *) - END; + RECORD + priority: INTEGER; (* queue for this priority *) + head, tail: Event; + next: Queue; (* queue with lower priority *) + END; VAR eventTypeType: Services.Type; - + CONST - priotabsize = 256; (* size of a priority table *) - maxnestlevel = 1024; (* of Raise-calls (avoids endless recursion) *) + priotabsize = 256; (* size of a priority table *) + maxnestlevel = 1024; (* of Raise-calls (avoids endless recursion) *) TYPE (* in some cases coroutines uses local priority systems *) PrioritySystem* = POINTER TO PrioritySystemRec; PrioritySystemRec* = - RECORD - (Objects.ObjectRec) - (* private part *) - currentPriority: Priority; - priotab: ARRAY priotabsize OF Priority; - priotop: INTEGER; - overflow: INTEGER; (* of priority table *) - END; + RECORD + (Objects.ObjectRec) + (* private part *) + currentPriority: Priority; + priotab: ARRAY priotabsize OF Priority; + priotop: INTEGER; + overflow: INTEGER; (* of priority table *) + END; CONST priorityViolation* = 0; (* priority violation (EnterPriority *) @@ -139,10 +139,10 @@ MODULE ulmEvents; TYPE ErrorEvent* = POINTER TO ErrorEventRec; ErrorEventRec* = - RECORD - (EventRec) - errorcode*: SHORTINT; - END; + RECORD + (EventRec) + errorcode*: SHORTINT; + END; VAR errormsg*: ARRAY errorcodes OF Message; @@ -151,10 +151,10 @@ MODULE ulmEvents; VAR (* private part *) abort, log, queueHandler: EventHandler; - nestlevel: INTEGER; (* of Raise calls *) + nestlevel: INTEGER; (* of Raise calls *) queue: Queue; - lock: BOOLEAN; (* lock critical operations *) - psys: PrioritySystem; (* current priority system *) + lock: BOOLEAN; (* lock critical operations *) + psys: PrioritySystem; (* current priority system *) PROCEDURE ^ Define*(VAR type: EventType); PROCEDURE ^ SetPriority*(type: EventType; priority: Priority); @@ -164,13 +164,13 @@ MODULE ulmEvents; BEGIN Define(error); SetPriority(error, Priorities.liberrors); errormsg[priorityViolation] := - "priority violation (Events.EnterPriority)"; + "priority violation (Events.EnterPriority)"; errormsg[unbalancedExitPriority] := - "unbalanced call of Events.ExitPriority"; + "unbalanced call of Events.ExitPriority"; errormsg[unbalancedRestoreReaction] := - "unbalanced call of Events.RestoreReaction"; + "unbalanced call of Events.RestoreReaction"; errormsg[negPriority] := - "negative priority given to Events.SetPriority"; + "negative priority given to Events.SetPriority"; END InitErrorHandling; PROCEDURE Error(code: SHORTINT); @@ -187,7 +187,7 @@ MODULE ulmEvents; PROCEDURE Init*(type: EventType); VAR - stype: Services.Type; + stype: Services.Type; BEGIN Services.GetType(type, stype); ASSERT(stype # NIL); type.handlers := NIL; @@ -199,8 +199,8 @@ MODULE ulmEvents; PROCEDURE Define*(VAR type: EventType); (* definition of a new event; - an unique event number is returned; - the reaction on receipt of `type' is defined to be `default' + an unique event number is returned; + the reaction on receipt of `type' is defined to be `default' *) BEGIN NEW(type); @@ -218,9 +218,9 @@ MODULE ulmEvents; (* (re-)defines the priority of an event *) BEGIN IF priority <= 0 THEN - Error(negPriority); + Error(negPriority); ELSE - type.priority := priority; + type.priority := priority; END; END SetPriority; @@ -238,42 +238,42 @@ MODULE ulmEvents; PROCEDURE Handler*(type: EventType; handler: EventHandler); (* add `handler' to the list of handlers for event `type' *) VAR - newhandler: HandlerList; + newhandler: HandlerList; BEGIN NEW(newhandler); newhandler.handler := handler; newhandler.next := type.handlers; type.handlers := newhandler; IF type.reaction # funcs THEN - type.reaction := funcs; type.manager(type, funcs); + type.reaction := funcs; type.manager(type, funcs); END; END Handler; PROCEDURE RemoveHandlers*(type: EventType); (* remove list of handlers for event `type'; - implies default reaction (abortion) on - receipt of `type' + implies default reaction (abortion) on + receipt of `type' *) BEGIN type.handlers := NIL; IF type.reaction # default THEN - type.reaction := default; type.manager(type, default); + type.reaction := default; type.manager(type, default); END; END RemoveHandlers; PROCEDURE Ignore*(type: EventType); (* implies RemoveHandlers(type) and causes receipt - of `type' to be ignored + of `type' to be ignored *) BEGIN type.handlers := NIL; IF type.reaction # ignore THEN - type.reaction := ignore; type.manager(type, ignore); + type.reaction := ignore; type.manager(type, ignore); END; END Ignore; PROCEDURE GetHandlers*(type: EventType; handlers: HandlerList); (* returns the list of handlers in `handlers'; - the reaction of `type' must be `funcs' + the reaction of `type' must be `funcs' *) BEGIN handlers := type.handlers; @@ -281,8 +281,8 @@ MODULE ulmEvents; PROCEDURE Log*(loghandler: EventHandler); (* call `loghandler' for every event; - subsequent calls of `Log' replace the loghandler; - the loghandler is not called on default and ignore + subsequent calls of `Log' replace the loghandler; + the loghandler is not called on default and ignore *) BEGIN log := loghandler; @@ -311,8 +311,8 @@ MODULE ulmEvents; PROCEDURE QueueHandler*(handler: EventHandler); (* setup an alternative handler of events - that cannot be processed now because - of their unsufficient priority + that cannot be processed now because + of their unsufficient priority *) VAR b : BOOLEAN; (* noch *) tmphandler : EventHandler; @@ -345,93 +345,93 @@ MODULE ulmEvents; PROCEDURE WorkupQueue; VAR - ptr: Event; + ptr: Event; BEGIN WHILE (queue # NIL) & (queue.priority > psys.currentPriority) DO - IF SYS.TAS(lock) THEN RETURN END; - ptr := queue.head; queue := queue.next; - lock := FALSE; - WHILE ptr # NIL DO - CallHandlers(ptr); - ptr := ptr.next; - END; + IF SYS.TAS(lock) THEN RETURN END; + ptr := queue.head; queue := queue.next; + lock := FALSE; + WHILE ptr # NIL DO + CallHandlers(ptr); + ptr := ptr.next; + END; END; END WorkupQueue; PROCEDURE CallHandlers(event: Event); VAR - ptr: HandlerList; - oldPriority: Priority; + ptr: HandlerList; + oldPriority: Priority; BEGIN CASE event.type.reaction OF | default: abort(event); | ignore: | funcs: oldPriority := psys.currentPriority; - psys.currentPriority := event.type.priority; - log(event); - ptr := event.type.handlers; - WHILE ptr # NIL DO - ptr.handler(event); - ptr := ptr.next; - END; - psys.currentPriority := oldPriority; + psys.currentPriority := event.type.priority; + log(event); + ptr := event.type.handlers; + WHILE ptr # NIL DO + ptr.handler(event); + ptr := ptr.next; + END; + psys.currentPriority := oldPriority; ELSE (* Explicitly ignore unhandled even type reactions *) END; END CallHandlers; PROCEDURE Raise*(event: Event); (* call all event handlers (in reverse order) - associated with event.type; - abort if there are none; - some system events may abort in another way - (i.e. they do not cause the abortion handler to be called) + associated with event.type; + abort if there are none; + some system events may abort in another way + (i.e. they do not cause the abortion handler to be called) *) VAR - priority: Priority; + priority: Priority; PROCEDURE AddToQueue(event: Event); - VAR - prev, ptr: Queue; + VAR + prev, ptr: Queue; BEGIN - event.next := NIL; - ptr := queue; prev := NIL; - WHILE (ptr # NIL) & (ptr.priority > priority) DO - prev := ptr; - ptr := ptr.next; - END; - IF (ptr # NIL) & (ptr.priority = priority) THEN - ptr.tail.next := event; - ptr.tail := event; - ELSE - NEW(ptr); - ptr.priority := priority; - ptr.head := event; ptr.tail := event; - IF prev = NIL THEN - ptr.next := queue; - queue := ptr; - ELSE - ptr.next := prev.next; - prev.next := ptr; - END; - END; + event.next := NIL; + ptr := queue; prev := NIL; + WHILE (ptr # NIL) & (ptr.priority > priority) DO + prev := ptr; + ptr := ptr.next; + END; + IF (ptr # NIL) & (ptr.priority = priority) THEN + ptr.tail.next := event; + ptr.tail := event; + ELSE + NEW(ptr); + ptr.priority := priority; + ptr.head := event; ptr.tail := event; + IF prev = NIL THEN + ptr.next := queue; + queue := ptr; + ELSE + ptr.next := prev.next; + prev.next := ptr; + END; + END; END AddToQueue; BEGIN (* Raise *) INC(nestlevel); IF nestlevel >= maxnestlevel THEN - abort(event); + abort(event); ELSE - IF event.type.reaction # ignore THEN - priority := event.type.priority; - IF psys.currentPriority < priority THEN - CallHandlers(event); WorkupQueue; - ELSIF queueHandler # NIL THEN - queueHandler(event); - ELSIF ~SYS.TAS(lock) THEN - AddToQueue(event); - lock := FALSE; - END; - END; + IF event.type.reaction # ignore THEN + priority := event.type.priority; + IF psys.currentPriority < priority THEN + CallHandlers(event); WorkupQueue; + ELSIF queueHandler # NIL THEN + queueHandler(event); + ELSIF ~SYS.TAS(lock) THEN + AddToQueue(event); + lock := FALSE; + END; + END; END; DEC(nestlevel); END Raise; @@ -452,7 +452,7 @@ MODULE ulmEvents; PROCEDURE SwitchPrioritySystem*(prioritySystem: PrioritySystem); (* switch to another priority system; this is typically - done in case of task switches + done in case of task switches *) BEGIN psys := prioritySystem; @@ -460,52 +460,52 @@ MODULE ulmEvents; PROCEDURE EnterPriority*(priority: Priority); (* sets the current priority to `priority'; - it is an error to give a priority less than - the current priority (event `badpriority') + it is an error to give a priority less than + the current priority (event `badpriority') *) BEGIN IF psys.currentPriority <= priority THEN - IF (psys.overflow = 0) & (psys.priotop < priotabsize) THEN - psys.priotab[psys.priotop] := psys.currentPriority; - INC(psys.priotop); - psys.currentPriority := priority; - ELSE - INC(psys.overflow); - END; + IF (psys.overflow = 0) & (psys.priotop < priotabsize) THEN + psys.priotab[psys.priotop] := psys.currentPriority; + INC(psys.priotop); + psys.currentPriority := priority; + ELSE + INC(psys.overflow); + END; ELSE - Error(priorityViolation); - INC(psys.overflow); + Error(priorityViolation); + INC(psys.overflow); END; END EnterPriority; PROCEDURE AssertPriority*(priority: Priority); (* current priority - < priority: set the current priority to `priority' - >= priority: the current priority remains unchanged + < priority: set the current priority to `priority' + >= priority: the current priority remains unchanged *) BEGIN IF (psys.overflow = 0) & (psys.priotop < priotabsize) THEN - psys.priotab[psys.priotop] := psys.currentPriority; INC(psys.priotop); - IF psys.currentPriority < priority THEN - psys.currentPriority := priority; - END; + psys.priotab[psys.priotop] := psys.currentPriority; INC(psys.priotop); + IF psys.currentPriority < priority THEN + psys.currentPriority := priority; + END; ELSE - INC(psys.overflow); + INC(psys.overflow); END; END AssertPriority; PROCEDURE ExitPriority*; (* causes the priority before the last effective call - of SetPriority or AssertPriority to be restored + of SetPriority or AssertPriority to be restored *) BEGIN IF psys.overflow > 0 THEN - DEC(psys.overflow); + DEC(psys.overflow); ELSIF psys.priotop = 0 THEN - Error(unbalancedExitPriority); + Error(unbalancedExitPriority); ELSE - DEC(psys.priotop); psys.currentPriority := psys.priotab[psys.priotop]; - WorkupQueue; + DEC(psys.priotop); psys.currentPriority := psys.priotab[psys.priotop]; + WorkupQueue; END; END ExitPriority; @@ -517,11 +517,11 @@ MODULE ulmEvents; PROCEDURE SaveReaction*(type: EventType); (* saves current reaction until call of RestoreReaction; - the new reaction of `type' is defined to be `ignore' - but can be changed by Events.Handler or Events.RemoveHandlers + the new reaction of `type' is defined to be `ignore' + but can be changed by Events.Handler or Events.RemoveHandlers *) VAR - savelist: SaveList; + savelist: SaveList; BEGIN NEW(savelist); savelist.reaction := type.reaction; @@ -530,27 +530,27 @@ MODULE ulmEvents; type.savelist := savelist; type.handlers := NIL; IF type.reaction # ignore THEN - type.reaction := ignore; type.manager(type, ignore); + type.reaction := ignore; type.manager(type, ignore); END; END SaveReaction; PROCEDURE RestoreReaction*(type: EventType); (* restores old reaction; - must be properly nested + must be properly nested *) VAR - savelist: SaveList; + savelist: SaveList; BEGIN IF type.savelist = NIL THEN - Error(unbalancedRestoreReaction); + Error(unbalancedRestoreReaction); ELSE - savelist := type.savelist; - type.savelist := savelist.next; - type.handlers := savelist.handlers; - IF type.reaction # savelist.reaction THEN - type.reaction := savelist.reaction; - type.manager(type, savelist.reaction); - END; + savelist := type.savelist; + type.savelist := savelist.next; + type.handlers := savelist.handlers; + IF type.reaction # savelist.reaction THEN + type.reaction := savelist.reaction; + type.manager(type, savelist.reaction); + END; END; END RestoreReaction; diff --git a/src/library/ulm/ulmForwarders.Mod b/src/library/ulm/ulmForwarders.Mod index ac4fa0b8..27f68104 100644 --- a/src/library/ulm/ulmForwarders.Mod +++ b/src/library/ulm/ulmForwarders.Mod @@ -1,244 +1,252 @@ (* Ulm's Oberon Library - Copyright (C) 1989-1995 by University of Ulm, SAI, D-89069 Ulm, Germany - ---------------------------------------------------------------------------- - Ulm's Oberon Library is free software; you can redistribute it - and/or modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either version - 2 of the License, or (at your option) any later version. + Copyright (C) 1989-1995 by University of Ulm, SAI, D-89069 Ulm, Germany + ---------------------------------------------------------------------------- + Ulm's Oberon Library is free software; you can redistribute it + and/or modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either version + 2 of the License, or (at your option) any later version. - Ulm's Oberon Library is distributed in the hope that it will be - useful, but WITHOUT ANY WARRANTY; without even the implied warranty - of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. + Ulm's Oberon Library is distributed in the hope that it will be + useful, but WITHOUT ANY WARRANTY; without even the implied warranty + of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - ---------------------------------------------------------------------------- - E-mail contact: oberon@mathematik.uni-ulm.de - ---------------------------------------------------------------------------- - $Id: Forwarders.om,v 1.1 1996/01/04 16:40:57 borchert Exp $ - ---------------------------------------------------------------------------- - $Log: Forwarders.om,v $ - Revision 1.1 1996/01/04 16:40:57 borchert - Initial revision + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + ---------------------------------------------------------------------------- + E-mail contact: oberon@mathematik.uni-ulm.de + ---------------------------------------------------------------------------- + $Id: Forwarders.om,v 1.1 1996/01/04 16:40:57 borchert Exp $ + ---------------------------------------------------------------------------- + $Log: Forwarders.om,v $ + Revision 1.1 1996/01/04 16:40:57 borchert + Initial revision - ---------------------------------------------------------------------------- + ---------------------------------------------------------------------------- *) MODULE ulmForwarders; (* AFB 3/95 *) - IMPORT Disciplines := ulmDisciplines, Events := ulmEvents, Resources := ulmResources, Services := ulmServices, SYSTEM; - (* SYSTEM is necessary to cast to Disciplines.Discipline; noch *) + IMPORT Disciplines := ulmDisciplines, Events := ulmEvents, Resources := ulmResources, Services := ulmServices; - TYPE - Object* = Services.Object; - ForwardProc* = PROCEDURE (from, to: Object); + TYPE + Object* = Services.Object; + ForwardProc* = PROCEDURE (from, to: Object); - TYPE - ListOfForwarders = POINTER TO ListOfForwardersRec; - ListOfForwardersRec = - RECORD - forward: ForwardProc; - next: ListOfForwarders; - END; - ListOfDependants = POINTER TO ListOfDependantsRec; - ListOfDependantsRec = - RECORD - dependant: Object; - next: ListOfDependants; - END; - TypeDiscipline = POINTER TO TypeDisciplineRec; - TypeDisciplineRec = - RECORD - (Disciplines.DisciplineRec) - list: ListOfForwarders; - END; - ObjectDiscipline = POINTER TO ObjectDisciplineRec; - ObjectDisciplineRec = - RECORD - (Disciplines.DisciplineRec) - dependants: ListOfDependants; - forwarders: ListOfForwarders; - dependsOn: Object; - END; - VAR - genlist: ListOfForwarders; (* list which applies to all types *) - typeDiscID: Disciplines.Identifier; - objectDiscID: Disciplines.Identifier; - - (* === private procedures ============================================ *) - - PROCEDURE RemoveDependant(VAR list: ListOfDependants; dependant: Object); - VAR - prev, p: ListOfDependants; - BEGIN - prev := NIL; p := list; - WHILE (p # NIL) & (p.dependant # dependant) DO - prev := p; p := p.next; + TYPE + ListOfForwarders = POINTER TO ListOfForwardersRec; + ListOfForwardersRec = + RECORD + forward: ForwardProc; + next: ListOfForwarders; END; - IF p # NIL THEN - IF prev = NIL THEN - list := p.next; - ELSE - prev.next := p.next; - END; + ListOfDependants = POINTER TO ListOfDependantsRec; + ListOfDependantsRec = + RECORD + dependant: Object; + next: ListOfDependants; END; - END RemoveDependant; - - PROCEDURE TerminationHandler(event: Events.Event); - (* remove list of dependants in case of termination and - remove event.resource from the list of dependants of that - object it depends on - *) - VAR - odisc: ObjectDiscipline; - dependsOn: Object; - BEGIN - WITH event: Resources.Event DO - IF event.change = Resources.terminated THEN - IF Disciplines.Seek(event.resource, objectDiscID, SYSTEM.VAL(Disciplines.Discipline, odisc)) THEN (* noch *) - Disciplines.Remove(event.resource, objectDiscID); - dependsOn := odisc.dependsOn; - IF (dependsOn # NIL) & ~Resources.Terminated(dependsOn) & - Disciplines.Seek(dependsOn, objectDiscID, SYSTEM.VAL(Disciplines.Discipline, odisc)) THEN (* noch *) - RemoveDependant(odisc.dependants, event.resource(Object)); - END; - END; - END; + TypeDiscipline = POINTER TO TypeDisciplineRec; + TypeDisciplineRec = + RECORD + (Disciplines.DisciplineRec) + list: ListOfForwarders; END; - END TerminationHandler; - - PROCEDURE Insert(VAR list: ListOfForwarders; forward: ForwardProc); - VAR - member: ListOfForwarders; - BEGIN - NEW(member); member.forward := forward; - member.next := list; list := member; - END Insert; - - PROCEDURE GetObjectDiscipline(object: Object; VAR odisc: ObjectDiscipline); - VAR - resourceNotification: Events.EventType; - BEGIN - IF ~Disciplines.Seek(object, objectDiscID, SYSTEM.VAL(Disciplines.Discipline, odisc)) THEN (* noch *) - NEW(odisc); odisc.id := objectDiscID; odisc.dependants := NIL; - odisc.forwarders := NIL; odisc.dependsOn := NIL; - (* let's state our interest in termination of `object' if - we see this object the first time - *) - Resources.TakeInterest(object, resourceNotification); - Events.Handler(resourceNotification, TerminationHandler); - Disciplines.Add(object, odisc); + ObjectDiscipline = POINTER TO ObjectDisciplineRec; + ObjectDisciplineRec = + RECORD + (Disciplines.DisciplineRec) + dependants: ListOfDependants; + forwarders: ListOfForwarders; + dependsOn: Object; END; - END GetObjectDiscipline; + VAR + genlist: ListOfForwarders; (* list which applies to all types *) + typeDiscID: Disciplines.Identifier; + objectDiscID: Disciplines.Identifier; - (* === exported procedures =========================================== *) + (* === private procedures ============================================ *) - PROCEDURE Register*(for: ARRAY OF CHAR; forward: ForwardProc); - (* register a forwarder which is to be called for all - forward operations which affects extensions of `for'; - "" may be given for Services.Object - *) - - VAR - type: Services.Type; - tdisc: TypeDiscipline; - - BEGIN (* Register *) - IF for = "" THEN - Insert(genlist, forward); + PROCEDURE RemoveDependant(VAR list: ListOfDependants; dependant: Object); + VAR + prev, p: ListOfDependants; + BEGIN + prev := NIL; p := list; + WHILE (p # NIL) & (p.dependant # dependant) DO + prev := p; p := p.next; + END; + IF p # NIL THEN + IF prev = NIL THEN + list := p.next; ELSE - Services.SeekType(for, type); - ASSERT(type # NIL); - IF ~Disciplines.Seek(type, typeDiscID, SYSTEM.VAL(Disciplines.Discipline, tdisc)) THEN - NEW(tdisc); tdisc.id := typeDiscID; tdisc.list := NIL; - END; - Insert(tdisc.list, forward); - Disciplines.Add(type, tdisc); + prev.next := p.next; END; - END Register; + END; + END RemoveDependant; - PROCEDURE RegisterObject*(object: Object; forward: ForwardProc); - (* to be called instead of Register if specific objects - are supported only and not all extensions of a type + PROCEDURE TerminationHandler(event: Events.Event); + (* remove list of dependants in case of termination and + remove event.resource from the list of dependants of that + object it depends on + *) + VAR + odisc: Disciplines.Discipline; + dependsOn: Object; + BEGIN + WITH event: Resources.Event DO + IF event.change = Resources.terminated THEN + IF Disciplines.Seek(event.resource, objectDiscID, odisc) THEN + Disciplines.Remove(event.resource, objectDiscID); + dependsOn := odisc(ObjectDiscipline).dependsOn; + IF (dependsOn # NIL) & ~Resources.Terminated(dependsOn) & + Disciplines.Seek(dependsOn, objectDiscID, odisc) THEN + RemoveDependant(odisc(ObjectDiscipline).dependants, event.resource(Object)); + END; + END; + END; + END; + END TerminationHandler; + + PROCEDURE Insert(VAR list: ListOfForwarders; forward: ForwardProc); + VAR + member: ListOfForwarders; + BEGIN + NEW(member); member.forward := forward; + member.next := list; list := member; + END Insert; + + PROCEDURE GetObjectDiscipline(object: Object; VAR odisc: ObjectDiscipline); + VAR + disc: Disciplines.Discipline; + resourceNotification: Events.EventType; + BEGIN + IF Disciplines.Seek(object, objectDiscID, disc) THEN + odisc := disc(ObjectDiscipline) + ELSE + NEW(odisc); odisc.id := objectDiscID; odisc.dependants := NIL; + odisc.forwarders := NIL; odisc.dependsOn := NIL; + (* let's state our interest in termination of `object' if + we see this object the first time *) - VAR - odisc: ObjectDiscipline; - BEGIN - GetObjectDiscipline(object, odisc); - Insert(odisc.forwarders, forward); - END RegisterObject; + Resources.TakeInterest(object, resourceNotification); + Events.Handler(resourceNotification, TerminationHandler); + Disciplines.Add(object, odisc); + END; + END GetObjectDiscipline; - PROCEDURE Update*(object: Object; forward: ForwardProc); - (* is to be called by one of the registered forwarders if - an interface for object has been newly installed or changed - in a way which needs forward to be called for each of - the filter objects which delegate to `object' - *) - VAR - odisc: ObjectDiscipline; - client: ListOfDependants; - BEGIN - IF Disciplines.Seek(object, objectDiscID, SYSTEM.VAL(Disciplines.Discipline, odisc)) THEN (* noch *) - client := odisc.dependants; - WHILE client # NIL DO - forward(client.dependant, object); - client := client.next; - END; + (* === exported procedures =========================================== *) + + PROCEDURE Register*(for: ARRAY OF CHAR; forward: ForwardProc); + (* register a forwarder which is to be called for all + forward operations which affects extensions of `for'; + "" may be given for Services.Object + *) + + VAR + type: Services.Type; + tdisc: TypeDiscipline; + disc: Disciplines.Discipline; + + BEGIN (* Register *) + IF for = "" THEN + Insert(genlist, forward); + ELSE + Services.SeekType(for, type); + ASSERT(type # NIL); + IF Disciplines.Seek(type, typeDiscID, disc) THEN + tdisc := disc(TypeDiscipline) + ELSE + NEW(tdisc); tdisc.id := typeDiscID; tdisc.list := NIL; END; - END Update; + Insert(tdisc.list, forward); + Disciplines.Add(type, tdisc); + END; + END Register; - PROCEDURE Forward*(from, to: Object); - (* forward (as far as supported) all operations from `from' to `to' *) - VAR - type, otherType, baseType: Services.Type; - tdisc: TypeDiscipline; - odisc: ObjectDiscipline; - client: ListOfDependants; - forwarder: ListOfForwarders; + PROCEDURE RegisterObject*(object: Object; forward: ForwardProc); + (* to be called instead of Register if specific objects + are supported only and not all extensions of a type + *) + VAR + odisc: ObjectDiscipline; + BEGIN + GetObjectDiscipline(object, odisc); + Insert(odisc.forwarders, forward); + END RegisterObject; - PROCEDURE CallForwarders(list: ListOfForwarders); - BEGIN - WHILE list # NIL DO - list.forward(from, to); - list := list.next; - END; - END CallForwarders; - - BEGIN (* Forward *) - Services.GetType(from, type); - Services.GetType(to, otherType); - ASSERT((type # NIL) & (otherType # NIL)); - - IF Resources.Terminated(to) OR Resources.Terminated(from) THEN - (* forwarding operations is no longer useful *) - RETURN + PROCEDURE Update*(object: Object; forward: ForwardProc); + (* is to be called by one of the registered forwarders if + an interface for object has been newly installed or changed + in a way which needs forward to be called for each of + the filter objects which delegate to `object' + *) + VAR + odisc: ObjectDiscipline; + disc: Disciplines.Discipline; + client: ListOfDependants; + BEGIN + IF Disciplines.Seek(object, objectDiscID, disc) THEN + odisc := disc(ObjectDiscipline); + client := odisc.dependants; + WHILE client # NIL DO + forward(client.dependant, object); + client := client.next; END; - Resources.DependsOn(from, to); + END; + END Update; - (* update the list of dependants for `to' *) - GetObjectDiscipline(to, odisc); - NEW(client); client.dependant := from; - client.next := odisc.dependants; odisc.dependants := client; + PROCEDURE Forward*(from, to: Object); + (* forward (as far as supported) all operations from `from' to `to' *) + VAR + type, otherType, baseType: Services.Type; + disc: Disciplines.Discipline; + tdisc: TypeDiscipline; + odisc: ObjectDiscipline; + client: ListOfDependants; + forwarder: ListOfForwarders; - (* call object-specific forwarders *) - CallForwarders(odisc.forwarders); - - LOOP (* go through the list of base types in descending order *) - IF Disciplines.Seek(type, typeDiscID, SYSTEM.VAL(Disciplines.Discipline, tdisc)) & (* noch *) - Services.IsExtensionOf(otherType, type) THEN - CallForwarders(tdisc.list); - END; - Services.GetBaseType(type, baseType); - IF baseType = NIL THEN EXIT END; - type := baseType; + PROCEDURE CallForwarders(list: ListOfForwarders); + BEGIN + WHILE list # NIL DO + list.forward(from, to); + list := list.next; END; - CallForwarders(genlist); - END Forward; + END CallForwarders; + + BEGIN (* Forward *) + Services.GetType(from, type); + Services.GetType(to, otherType); + ASSERT((type # NIL) & (otherType # NIL)); + + IF Resources.Terminated(to) OR Resources.Terminated(from) THEN + (* forwarding operations is no longer useful *) + RETURN + END; + Resources.DependsOn(from, to); + + (* update the list of dependants for `to' *) + GetObjectDiscipline(to, odisc); + NEW(client); client.dependant := from; + client.next := odisc.dependants; odisc.dependants := client; + + (* call object-specific forwarders *) + CallForwarders(odisc.forwarders); + + LOOP (* go through the list of base types in descending order *) + IF Disciplines.Seek(type, typeDiscID, disc) & Services.IsExtensionOf(otherType, type) THEN + tdisc := disc(TypeDiscipline); + CallForwarders(tdisc.list); + END; + Services.GetBaseType(type, baseType); + IF baseType = NIL THEN EXIT END; + type := baseType; + END; + CallForwarders(genlist); + END Forward; BEGIN - genlist := NIL; - typeDiscID := Disciplines.Unique(); - objectDiscID := Disciplines.Unique(); + genlist := NIL; + typeDiscID := Disciplines.Unique(); + objectDiscID := Disciplines.Unique(); END ulmForwarders. diff --git a/src/library/ulm/ulmIO.Mod b/src/library/ulm/ulmIO.Mod index 04bc3bcb..162aa127 100644 --- a/src/library/ulm/ulmIO.Mod +++ b/src/library/ulm/ulmIO.Mod @@ -42,9 +42,7 @@ MODULE ulmIO; dig : LONGINT; NumberLen : SHORTINT; BEGIN - IF SIZE(LONGINT) = 4 THEN - NumberLen := 11 - ELSIF SIZE(LONGINT) = 8 THEN + IF SIZE(LONGINT) = 8 THEN NumberLen := 21 ELSE NumberLen := 11 (* default value, corresponds to 32 bit *) diff --git a/src/library/ulm/ulmIndirectDisciplines.Mod b/src/library/ulm/ulmIndirectDisciplines.Mod index 3118852e..22e06b14 100644 --- a/src/library/ulm/ulmIndirectDisciplines.Mod +++ b/src/library/ulm/ulmIndirectDisciplines.Mod @@ -43,23 +43,24 @@ MODULE ulmIndirectDisciplines; TYPE IndDiscipline = POINTER TO IndDisciplineRec; IndDisciplineRec = - RECORD - (DisciplineRec) - forwardTo: Object; - END; + RECORD + (DisciplineRec) + forwardTo: Object; + END; + VAR discID: Identifier; PROCEDURE Forward*(from, to: Object); VAR - disc: IndDiscipline; + disc: IndDiscipline; BEGIN IF to = NIL THEN - Disciplines.Remove(from, discID); + Disciplines.Remove(from, discID); ELSE - NEW(disc); disc.id := discID; - disc.forwardTo := to; - Disciplines.Add(from, disc); + NEW(disc); disc.id := discID; + disc.forwardTo := to; + Disciplines.Add(from, disc); END; END Forward; @@ -70,44 +71,43 @@ MODULE ulmIndirectDisciplines; PROCEDURE Add*(object: Object; discipline: Discipline); VAR - disc: IndDiscipline; + disc: Discipline; BEGIN - WHILE Disciplines.Seek(object, discID, SYSTEM.VAL(Disciplines.Discipline, disc)) DO - object := disc.forwardTo; + WHILE Disciplines.Seek(object, discID, disc) DO + object := disc(IndDiscipline).forwardTo; END; Disciplines.Add(object, discipline); END Add; PROCEDURE Remove*(object: Object; id: Identifier); VAR - dummy: Discipline; - disc: IndDiscipline; + dummy, disc: Discipline; BEGIN LOOP - IF Disciplines.Seek(object, id, dummy) THEN - Disciplines.Remove(object, id); - EXIT - END; - IF ~Disciplines.Seek(object, discID, SYSTEM.VAL(Disciplines.Discipline, disc)) THEN - EXIT - END; - object := disc.forwardTo; + IF Disciplines.Seek(object, id, dummy) THEN + Disciplines.Remove(object, id); + EXIT + END; + IF ~Disciplines.Seek(object, discID, disc) THEN + EXIT + END; + object := disc(IndDiscipline).forwardTo; END; END Remove; PROCEDURE Seek*(object: Object; id: Identifier; - VAR discipline: Discipline) : BOOLEAN; + VAR discipline: Discipline) : BOOLEAN; VAR - disc: IndDiscipline; + disc: Discipline; BEGIN LOOP - IF Disciplines.Seek(object, id, discipline) THEN - RETURN TRUE - END; - IF ~Disciplines.Seek(object, discID, SYSTEM.VAL(Disciplines.Discipline, disc)) THEN - RETURN FALSE - END; - object := disc.forwardTo; + IF Disciplines.Seek(object, id, discipline) THEN + RETURN TRUE + END; + IF ~Disciplines.Seek(object, discID, disc) THEN + RETURN FALSE + END; + object := disc(IndDiscipline).forwardTo; END; END Seek; diff --git a/src/library/ulm/ulmIntOperations.Mod b/src/library/ulm/ulmIntOperations.Mod index 33ec3161..3f1799aa 100644 --- a/src/library/ulm/ulmIntOperations.Mod +++ b/src/library/ulm/ulmIntOperations.Mod @@ -28,52 +28,53 @@ MODULE ulmIntOperations; (* Frank B.J. Fischer *) - IMPORT Operations := ulmOperations, PersistentObjects := ulmPersistentObjects, Services := ulmServices, Streams := ulmStreams, Types := ulmTypes, SYSTEM; + IMPORT + Operations := ulmOperations, PersistentObjects := ulmPersistentObjects, + Services := ulmServices, Streams := ulmStreams, + Types := ulmTypes; -(* SYSTEM added to make casts necessary to port ulm library because ulm compiler is not as strict (read it's wrong) as it had to be --noch *) - - CONST + CONST mod* = 5; pow* = 6; inc* = 7; dec* = 8; mmul* = 9; mpow* = 10; odd* = 11; shift* = 12; - TYPE + TYPE Operation* = Operations.Operation; (* Operations.add..mpow *) Operand* = POINTER TO OperandRec; TYPE - CapabilitySet* = Operations.CapabilitySet; - (* SET of [Operations.add..shift] *) + CapabilitySet* = Operations.CapabilitySet; + (* SET of [Operations.add..shift] *) IsLargeEnoughForProc* = PROCEDURE (op: Operations.Operand; - n: LONGINT): BOOLEAN; + n: LONGINT): BOOLEAN; UnsignedProc* = PROCEDURE (op: Operations.Operand): BOOLEAN; IntToOpProc* = PROCEDURE (int32: Types.Int32; VAR op: Operations.Operand); OpToIntProc* = PROCEDURE (op: Operations.Operand; VAR int32: Types.Int32); Log2Proc* = PROCEDURE (op: Operations.Operand): LONGINT; OddProc* = PROCEDURE (op: Operations.Operand): BOOLEAN; - ShiftProc* = PROCEDURE (op: Operations.Operand; - n: INTEGER): Operations.Operand; - IntOperatorProc* = PROCEDURE(op: Operation; - op1, op2, op3: Operations.Operand; - VAR result: Operations.Operand); + ShiftProc* = PROCEDURE (op: Operations.Operand; + n: INTEGER): Operations.Operand; + IntOperatorProc* = PROCEDURE(op: Operation; + op1, op2, op3: Operations.Operand; + VAR result: Operations.Operand); Interface* = POINTER TO InterfaceRec; InterfaceRec* = RECORD - (Operations.InterfaceRec) - isLargeEnoughFor*: IsLargeEnoughForProc; - unsigned* : UnsignedProc; - intToOp* : IntToOpProc; - opToInt* : OpToIntProc; - log2* : Log2Proc; - odd* : OddProc; - shift* : ShiftProc; - intOp* : IntOperatorProc; + (Operations.InterfaceRec) + isLargeEnoughFor*: IsLargeEnoughForProc; + unsigned* : UnsignedProc; + intToOp* : IntToOpProc; + opToInt* : OpToIntProc; + log2* : Log2Proc; + odd* : OddProc; + shift* : ShiftProc; + intOp* : IntOperatorProc; END; TYPE OperandRec* = RECORD - (Operations.OperandRec); - (* private components *) - if : Interface; - caps: CapabilitySet; + (Operations.OperandRec); + (* private components *) + if : Interface; + caps: CapabilitySet; END; VAR @@ -97,7 +98,7 @@ MODULE ulmIntOperations; (* Frank B.J. Fischer *) PROCEDURE IsLargeEnoughFor*(op: Operations.Operand; n: LONGINT): BOOLEAN; BEGIN WITH op: Operand DO - RETURN op.if.isLargeEnoughFor(op, n) + RETURN op.if.isLargeEnoughFor(op, n) END; END IsLargeEnoughFor; @@ -105,34 +106,18 @@ MODULE ulmIntOperations; (* Frank B.J. Fischer *) PROCEDURE Unsigned*(op: Operations.Operand): BOOLEAN; BEGIN WITH op: Operand DO - RETURN op.if.unsigned(op) + RETURN op.if.unsigned(op) END; END Unsigned; PROCEDURE IntToOp*(int32: Types.Int32; VAR op: Operations.Operand); (* converts int32 into operand type, and stores result in already - initialized op + initialized op *) BEGIN - (*WITH op: Operand DO*) - (* - with original ulm source we were getting: - - WITH op: Operand DO - ^ - pos 4101 err 245 guarded pointer variable may be manipulated by non-local operations; use auxiliary pointer variable - - thus we considered changing WITH op: Operand by op(Operand) - - -- noch - - *) - (*ASSERT(op.if # NIL);*) - ASSERT(op(Operand).if # NIL); - (*op.if.intToOp(int32, op);*) - op(Operand).if.intToOp(int32, op(Operations.Operand)); - (*END;*) + ASSERT(op(Operand).if # NIL); + op(Operand).if.intToOp(int32, op); END IntToOp; @@ -140,7 +125,7 @@ MODULE ulmIntOperations; (* Frank B.J. Fischer *) (* converts op into int32 *) BEGIN WITH op: Operand DO - op.if.opToInt(op, int32); + op.if.opToInt(op, int32); END; END OpToInt; @@ -148,7 +133,7 @@ MODULE ulmIntOperations; (* Frank B.J. Fischer *) PROCEDURE Log2*(op: Operations.Operand): LONGINT; BEGIN WITH op: Operand DO - RETURN op.if.log2(op) + RETURN op.if.log2(op) END; END Log2; @@ -162,22 +147,22 @@ MODULE ulmIntOperations; (* Frank B.J. Fischer *) END Odd; - PROCEDURE Op(op: Operation; op1, op2, op3: Operations.Operand; - VAR result: Operations.Operand); + PROCEDURE Op(op: Operation; op1, op2, op3: Operations.Operand; + VAR result: Operations.Operand); VAR tmpresult: Operations.Operand; BEGIN WITH op1: Operand DO - IF (op2#NIL) & (op3#NIL) THEN - ASSERT((op1.if = op2(Operand).if) & - (op2(Operand).if = op3(Operand).if)); - ELSIF (op2#NIL) THEN - ASSERT(op1.if = op2(Operand).if); - END; - ASSERT(op IN op1.caps); - op1.if.create(tmpresult); - op1.if.intOp(op, op1, op2, op3, tmpresult); - result := tmpresult; + IF (op2#NIL) & (op3#NIL) THEN + ASSERT((op1.if = op2(Operand).if) & + (op2(Operand).if = op3(Operand).if)); + ELSIF (op2#NIL) THEN + ASSERT(op1.if = op2(Operand).if); + END; + ASSERT(op IN op1.caps); + op1.if.create(tmpresult); + op1.if.intOp(op, op1, op2, op3, tmpresult); + result := tmpresult; END; END Op; @@ -197,15 +182,15 @@ MODULE ulmIntOperations; (* Frank B.J. Fischer *) END Shift2; - PROCEDURE Shift3*(VAR result: Operations.Operand; op1: Operations.Operand; - n : INTEGER); + PROCEDURE Shift3*(VAR result: Operations.Operand; op1: Operations.Operand; + n : INTEGER); VAR tmpresult: Operations.Operand; BEGIN WITH op1: Operand DO - op1.if.create(tmpresult); - tmpresult := Shift(op1, n); - result := tmpresult; + op1.if.create(tmpresult); + tmpresult := Shift(op1, n); + result := tmpresult; END; END Shift3; @@ -230,7 +215,7 @@ MODULE ulmIntOperations; (* Frank B.J. Fischer *) BEGIN Op(inc,op1,NIL,NIL,result); END Inc3; - + PROCEDURE Dec*(op1: Operations.Operand): Operations.Operand; VAR @@ -252,7 +237,7 @@ MODULE ulmIntOperations; (* Frank B.J. Fischer *) BEGIN Op(dec,op1,NIL,NIL,result); END Dec3; - + PROCEDURE Mod*(op1, op2: Operations.Operand): Operations.Operand; VAR @@ -278,11 +263,10 @@ MODULE ulmIntOperations; (* Frank B.J. Fischer *) PROCEDURE Pow*(op1, op2: Operations.Operand): Operations.Operand; VAR - result : Operand; + result: Operations.Operand; BEGIN result := NIL; - (*Op(pow, op1, op2, NIL, result);*) - Op(pow, op1, op2, NIL, SYSTEM.VAL(Operations.Operand, result)); (* -- noch *) + Op(pow, op1, op2, NIL, result); RETURN result END Pow; @@ -301,11 +285,10 @@ MODULE ulmIntOperations; (* Frank B.J. Fischer *) PROCEDURE MMul*(op1, op2, op3: Operations.Operand): Operations.Operand; VAR - result : Operand; + result : Operations.Operand; BEGIN result := NIL; - (*Op(mmul, op1, op2, op3, result); *) - Op(mmul, op1, op2, op3, SYSTEM.VAL(Operations.Operand, result)); (* --noch*) + Op(mmul, op1, op2, op3, result); RETURN result END MMul; @@ -316,8 +299,8 @@ MODULE ulmIntOperations; (* Frank B.J. Fischer *) END MMul2; - PROCEDURE MMul3*(VAR result: Operations.Operand; - op1, op2, op3: Operations.Operand); + PROCEDURE MMul3*(VAR result: Operations.Operand; + op1, op2, op3: Operations.Operand); BEGIN Op(mmul, op1, op2, op3, result); END MMul3; @@ -325,11 +308,10 @@ MODULE ulmIntOperations; (* Frank B.J. Fischer *) PROCEDURE MPow*(op1, op2, op3: Operations.Operand): Operations.Operand; VAR - result : Operand; + result : Operations.Operand; BEGIN result := NIL; - (*Op(mpow, op1, op2, op3, result); *) - Op(mpow, op1, op2, op3, SYSTEM.VAL(Operations.Operand, result)); (* -- noch*) + Op(mpow, op1, op2, op3, result); RETURN result END MPow; @@ -340,8 +322,8 @@ MODULE ulmIntOperations; (* Frank B.J. Fischer *) END MPow2; - PROCEDURE MPow3*(VAR result: Operations.Operand; - op1, op2, op3: Operations.Operand); + PROCEDURE MPow3*(VAR result: Operations.Operand; + op1, op2, op3: Operations.Operand); BEGIN Op(mpow, op1, op2, op3, result); END MPow3; diff --git a/src/library/ulm/ulmNetIO.Mod b/src/library/ulm/ulmNetIO.Mod index 0d0d44a0..b9741f30 100644 --- a/src/library/ulm/ulmNetIO.Mod +++ b/src/library/ulm/ulmNetIO.Mod @@ -1,546 +1,554 @@ (* Ulm's Oberon Library - Copyright (C) 1989-1994 by University of Ulm, SAI, D-89069 Ulm, Germany - ---------------------------------------------------------------------------- - Ulm's Oberon Library is free software; you can redistribute it - and/or modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either version - 2 of the License, or (at your option) any later version. + Copyright (C) 1989-1994 by University of Ulm, SAI, D-89069 Ulm, Germany + ---------------------------------------------------------------------------- + Ulm's Oberon Library is free software; you can redistribute it + and/or modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either version + 2 of the License, or (at your option) any later version. - Ulm's Oberon Library is distributed in the hope that it will be - useful, but WITHOUT ANY WARRANTY; without even the implied warranty - of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. + Ulm's Oberon Library is distributed in the hope that it will be + useful, but WITHOUT ANY WARRANTY; without even the implied warranty + of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - ---------------------------------------------------------------------------- - E-mail contact: oberon@mathematik.uni-ulm.de - ---------------------------------------------------------------------------- - $Id: NetIO.om,v 1.4 2004/05/21 15:19:03 borchert Exp $ - ---------------------------------------------------------------------------- - $Log: NetIO.om,v $ - Revision 1.4 2004/05/21 15:19:03 borchert - performance improvements: - - ReadConstStringD prefers Streams.ReadPart and ConstStrings.CreateD, - if possible - (based on code by Christian Ehrhardt) - - WriteConstString uses Streams.Copy instead of a loop that uses - Streams.ReadByte and Streams.WriteByte + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + ---------------------------------------------------------------------------- + E-mail contact: oberon@mathematik.uni-ulm.de + ---------------------------------------------------------------------------- + $Id: NetIO.om,v 1.4 2004/05/21 15:19:03 borchert Exp $ + ---------------------------------------------------------------------------- + $Log: NetIO.om,v $ + Revision 1.4 2004/05/21 15:19:03 borchert + performance improvements: + - ReadConstStringD prefers Streams.ReadPart and ConstStrings.CreateD, + if possible + (based on code by Christian Ehrhardt) + - WriteConstString uses Streams.Copy instead of a loop that uses + Streams.ReadByte and Streams.WriteByte - Revision 1.3 1995/03/17 16:28:20 borchert - - SizeOf stuff removed - - support of const strings added - - support of Forwarders added + Revision 1.3 1995/03/17 16:28:20 borchert + - SizeOf stuff removed + - support of const strings added + - support of Forwarders added - Revision 1.2 1994/07/18 14:18:37 borchert - unused variables of WriteString (ch + index) removed + Revision 1.2 1994/07/18 14:18:37 borchert + unused variables of WriteString (ch + index) removed - Revision 1.1 1994/02/22 20:08:43 borchert - Initial revision + Revision 1.1 1994/02/22 20:08:43 borchert + Initial revision - ---------------------------------------------------------------------------- - AFB 6/93 - ---------------------------------------------------------------------------- + ---------------------------------------------------------------------------- + AFB 6/93 + ---------------------------------------------------------------------------- *) MODULE ulmNetIO; - (* abstraction for the exchange of Oberon base types which - are components of persistent data structures - *) + (* abstraction for the exchange of Oberon base types which + are components of persistent data structures + *) - IMPORT ConstStrings := ulmConstStrings, Disciplines := ulmDisciplines, Forwarders := ulmForwarders, Streams := ulmStreams, Strings := ulmStrings, - SYS := SYSTEM, Types := ulmTypes; + IMPORT ConstStrings := ulmConstStrings, Disciplines := ulmDisciplines, Forwarders := ulmForwarders, Streams := ulmStreams, Strings := ulmStrings, + SYS := SYSTEM, Types := ulmTypes; - TYPE - Byte* = Types.Byte; + TYPE + Byte* = Types.Byte; - TYPE - ReadByteProc* = - PROCEDURE (s: Streams.Stream; VAR byte: Byte) : BOOLEAN; - ReadCharProc* = - PROCEDURE (s: Streams.Stream; VAR char: CHAR) : BOOLEAN; - ReadBooleanProc* = - PROCEDURE (s: Streams.Stream; VAR boolean: BOOLEAN) : BOOLEAN; - ReadShortIntProc* = - PROCEDURE (s: Streams.Stream; VAR shortint: SHORTINT) : BOOLEAN; - ReadIntegerProc* = - PROCEDURE (s: Streams.Stream; VAR integer: INTEGER) : BOOLEAN; - ReadLongIntProc* = - PROCEDURE (s: Streams.Stream; VAR longint: LONGINT) : BOOLEAN; - ReadRealProc* = - PROCEDURE (s: Streams.Stream; VAR real: REAL) : BOOLEAN; - ReadLongRealProc* = - PROCEDURE (s: Streams.Stream; VAR longreal: LONGREAL) : BOOLEAN; - ReadSetProc* = - PROCEDURE (s: Streams.Stream; VAR set: SET) : BOOLEAN; - ReadStringProc* = - PROCEDURE (s: Streams.Stream; VAR string: ARRAY OF CHAR) : BOOLEAN; - ReadConstStringProc* = - PROCEDURE (s: Streams.Stream; domain: ConstStrings.Domain; - VAR string: ConstStrings.String) : BOOLEAN; + TYPE + ReadByteProc* = + PROCEDURE (s: Streams.Stream; VAR byte: Byte) : BOOLEAN; + ReadCharProc* = + PROCEDURE (s: Streams.Stream; VAR char: CHAR) : BOOLEAN; + ReadBooleanProc* = + PROCEDURE (s: Streams.Stream; VAR boolean: BOOLEAN) : BOOLEAN; + ReadShortIntProc* = + PROCEDURE (s: Streams.Stream; VAR shortint: SHORTINT) : BOOLEAN; + ReadIntegerProc* = + PROCEDURE (s: Streams.Stream; VAR integer: INTEGER) : BOOLEAN; + ReadLongIntProc* = + PROCEDURE (s: Streams.Stream; VAR longint: LONGINT) : BOOLEAN; + ReadRealProc* = + PROCEDURE (s: Streams.Stream; VAR real: REAL) : BOOLEAN; + ReadLongRealProc* = + PROCEDURE (s: Streams.Stream; VAR longreal: LONGREAL) : BOOLEAN; + ReadSetProc* = + PROCEDURE (s: Streams.Stream; VAR set: SET) : BOOLEAN; + ReadStringProc* = + PROCEDURE (s: Streams.Stream; VAR string: ARRAY OF CHAR) : BOOLEAN; + ReadConstStringProc* = + PROCEDURE (s: Streams.Stream; domain: ConstStrings.Domain; + VAR string: ConstStrings.String) : BOOLEAN; - WriteByteProc* = - PROCEDURE (s: Streams.Stream; byte: Byte) : BOOLEAN; - WriteCharProc* = - PROCEDURE (s: Streams.Stream; char: CHAR) : BOOLEAN; - WriteBooleanProc* = - PROCEDURE (s: Streams.Stream; boolean: BOOLEAN) : BOOLEAN; - WriteShortIntProc* = - PROCEDURE (s: Streams.Stream; shortint: SHORTINT) : BOOLEAN; - WriteIntegerProc* = - PROCEDURE (s: Streams.Stream; integer: INTEGER) : BOOLEAN; - WriteLongIntProc* = - PROCEDURE (s: Streams.Stream; longint: LONGINT) : BOOLEAN; - WriteRealProc* = - PROCEDURE (s: Streams.Stream; real: REAL) : BOOLEAN; - WriteLongRealProc* = - PROCEDURE (s: Streams.Stream; longreal: LONGREAL) : BOOLEAN; - WriteSetProc* = - PROCEDURE (s: Streams.Stream; set: SET) : BOOLEAN; - WriteStringProc* = - PROCEDURE (s: Streams.Stream; string: ARRAY OF CHAR) : BOOLEAN; - WriteConstStringProc* = - PROCEDURE (s: Streams.Stream; - string: ConstStrings.String) : BOOLEAN; + WriteByteProc* = + PROCEDURE (s: Streams.Stream; byte: Byte) : BOOLEAN; + WriteCharProc* = + PROCEDURE (s: Streams.Stream; char: CHAR) : BOOLEAN; + WriteBooleanProc* = + PROCEDURE (s: Streams.Stream; boolean: BOOLEAN) : BOOLEAN; + WriteShortIntProc* = + PROCEDURE (s: Streams.Stream; shortint: SHORTINT) : BOOLEAN; + WriteIntegerProc* = + PROCEDURE (s: Streams.Stream; integer: INTEGER) : BOOLEAN; + WriteLongIntProc* = + PROCEDURE (s: Streams.Stream; longint: LONGINT) : BOOLEAN; + WriteRealProc* = + PROCEDURE (s: Streams.Stream; real: REAL) : BOOLEAN; + WriteLongRealProc* = + PROCEDURE (s: Streams.Stream; longreal: LONGREAL) : BOOLEAN; + WriteSetProc* = + PROCEDURE (s: Streams.Stream; set: SET) : BOOLEAN; + WriteStringProc* = + PROCEDURE (s: Streams.Stream; string: ARRAY OF CHAR) : BOOLEAN; + WriteConstStringProc* = + PROCEDURE (s: Streams.Stream; + string: ConstStrings.String) : BOOLEAN; - Interface* = POINTER TO InterfaceRec; - InterfaceRec* = - RECORD - readByte*: ReadByteProc; - readChar*: ReadCharProc; - readBoolean*: ReadBooleanProc; - readShortInt*: ReadShortIntProc; - readInteger*: ReadIntegerProc; - readLongInt*: ReadLongIntProc; - readReal*: ReadRealProc; - readLongReal*: ReadLongRealProc; - readSet*: ReadSetProc; - readString*: ReadStringProc; - readConstString*: ReadConstStringProc; + Interface* = POINTER TO InterfaceRec; + InterfaceRec* = + RECORD + readByte*: ReadByteProc; + readChar*: ReadCharProc; + readBoolean*: ReadBooleanProc; + readShortInt*: ReadShortIntProc; + readInteger*: ReadIntegerProc; + readLongInt*: ReadLongIntProc; + readReal*: ReadRealProc; + readLongReal*: ReadLongRealProc; + readSet*: ReadSetProc; + readString*: ReadStringProc; + readConstString*: ReadConstStringProc; - writeByte*: WriteByteProc; - writeChar*: WriteCharProc; - writeBoolean*: WriteBooleanProc; - writeShortInt*: WriteShortIntProc; - writeInteger*: WriteIntegerProc; - writeLongInt*: WriteLongIntProc; - writeReal*: WriteRealProc; - writeLongReal*: WriteLongRealProc; - writeSet*: WriteSetProc; - writeString*: WriteStringProc; - writeConstString*: WriteConstStringProc; - END; - - (* private data structures *) - TYPE - Discipline = POINTER TO DisciplineRec; - DisciplineRec = - RECORD - (Disciplines.DisciplineRec) - if: Interface; - END; - VAR - discID: Disciplines.Identifier; - - PROCEDURE Swap (VAR a : ARRAY OF SYS.BYTE); - VAR - i,j : LONGINT; - tmp : SYS.BYTE; - BEGIN - i := 0; j := LEN (a) - 1; - WHILE i < j DO - tmp := a[i]; a[i] := a[j]; a[j] := tmp; - INC (i); DEC (j); + writeByte*: WriteByteProc; + writeChar*: WriteCharProc; + writeBoolean*: WriteBooleanProc; + writeShortInt*: WriteShortIntProc; + writeInteger*: WriteIntegerProc; + writeLongInt*: WriteLongIntProc; + writeReal*: WriteRealProc; + writeLongReal*: WriteLongRealProc; + writeSet*: WriteSetProc; + writeString*: WriteStringProc; + writeConstString*: WriteConstStringProc; END; - END Swap; - PROCEDURE BitSwap (VAR a : ARRAY OF SYS.BYTE); - VAR - i,old, bit : LONGINT; - new : LONGINT; - - BEGIN - i := 0; - WHILE i < LEN (a) DO - old := ORD (SYS.VAL (CHAR, a[i])); - new := 0; bit := 080H; - WHILE old # 0 DO - IF ODD (old) THEN - INC (new, bit); - END; - bit := ASH (bit, -1);; - old := ASH (old, -1); - END; - a[i] := SYS.VAL (SYS.BYTE, new); - INC (i); + (* private data structures *) + TYPE + Discipline = POINTER TO DisciplineRec; + DisciplineRec = + RECORD + (Disciplines.DisciplineRec) + if: Interface; END; - END BitSwap; + VAR + discID: Disciplines.Identifier; - PROCEDURE ^ Forward(from, to: Forwarders.Object); + PROCEDURE Seek(s: Streams.Stream; id: Disciplines.Identifier; disc: Discipline): BOOLEAN; + VAR d: Disciplines.Discipline; result: BOOLEAN; + BEGIN + result := Disciplines.Seek(s, id, d); + IF result THEN disc := d(Discipline) ELSE disc := NIL END; + RETURN result + END Seek; - PROCEDURE AttachInterface*(s: Streams.Stream; if: Interface); - VAR - disc: Discipline; - BEGIN - IF if # NIL THEN - NEW(disc); disc.id := discID; disc.if := if; - Disciplines.Add(s, disc); + PROCEDURE Swap (VAR a : ARRAY OF SYS.BYTE); + VAR + i,j : LONGINT; + tmp : SYS.BYTE; + BEGIN + i := 0; j := LEN (a) - 1; + WHILE i < j DO + tmp := a[i]; a[i] := a[j]; a[j] := tmp; + INC (i); DEC (j); + END; + END Swap; + + PROCEDURE BitSwap (VAR a : ARRAY OF SYS.BYTE); + VAR + i,old, bit : LONGINT; + new : LONGINT; + + BEGIN + i := 0; + WHILE i < LEN (a) DO + old := ORD (SYS.VAL (CHAR, a[i])); + new := 0; bit := 080H; + WHILE old # 0 DO + IF ODD (old) THEN + INC (new, bit); + END; + bit := ASH (bit, -1);; + old := ASH (old, -1); + END; + a[i] := SYS.VAL (SYS.BYTE, new); + INC (i); + END; + END BitSwap; + + PROCEDURE ^ Forward(from, to: Forwarders.Object); + + PROCEDURE AttachInterface*(s: Streams.Stream; if: Interface); + VAR + disc: Discipline; + BEGIN + IF if # NIL THEN + NEW(disc); disc.id := discID; disc.if := if; + Disciplines.Add(s, disc); + ELSE + Disciplines.Remove(s, discID); + END; + Forwarders.Update(s, Forward); + END AttachInterface; + + PROCEDURE GetInterface(s: Streams.Stream; VAR if: Interface); + VAR + disc: Discipline; + BEGIN + IF Seek(s, discID, disc) THEN + if := disc.if; + ELSE + if := NIL; + END; + END GetInterface; + + PROCEDURE CopyInterface*(from, to: Streams.Stream); + VAR + if: Interface; + BEGIN + GetInterface(from, if); + AttachInterface(to, if); + END CopyInterface; + + PROCEDURE Forward(from, to: Forwarders.Object); + BEGIN + (* this check is necessary because of Forwarders.Update *) + IF ~(from IS Streams.Stream) OR ~(to IS Streams.Stream) THEN + RETURN + END; + + WITH from: Streams.Stream DO WITH to: Streams.Stream DO + (* be careful here, from & to must be reversed *) + CopyInterface(to, from); + END; END; + END Forward; + + PROCEDURE ReadByte*(s: Streams.Stream; VAR byte: Byte) : BOOLEAN; + VAR + disc: Discipline; + BEGIN + IF Seek(s, discID, disc) THEN + RETURN disc.if.readByte(s, byte) + ELSE + RETURN Streams.ReadByte(s, byte) + END; + END ReadByte; + + PROCEDURE ReadChar*(s: Streams.Stream; VAR char: CHAR) : BOOLEAN; + VAR + disc: Discipline; + BEGIN + IF Seek(s, discID, disc) THEN + RETURN disc.if.readChar(s, char) + ELSE + RETURN Streams.ReadByte(s, char) + END; + END ReadChar; + + PROCEDURE ReadBoolean*(s: Streams.Stream; VAR boolean: BOOLEAN) : BOOLEAN; + VAR + disc: Discipline; + BEGIN + IF Seek(s, discID, disc) THEN + RETURN disc.if.readBoolean(s, boolean) + ELSE + RETURN Streams.Read(s, boolean) + END; + END ReadBoolean; + + PROCEDURE ReadShortInt*(s: Streams.Stream; VAR shortint: SHORTINT) : BOOLEAN; + VAR + disc: Discipline; + BEGIN + IF Seek(s, discID, disc) THEN + RETURN disc.if.readShortInt(s, shortint) + ELSE + RETURN Streams.ReadByte(s, shortint) + END; + END ReadShortInt; + + PROCEDURE ReadInteger*(s: Streams.Stream; VAR integer: INTEGER) : BOOLEAN; + VAR + disc: Discipline; + ret : BOOLEAN; + BEGIN + IF Seek(s, discID, disc) THEN + RETURN disc.if.readInteger(s, integer) + ELSE + ret := Streams.Read(s, integer); + IF Types.byteorder = Types.littleEndian THEN + Swap (integer); + END; + RETURN ret; + END; + END ReadInteger; + + PROCEDURE ReadLongInt*(s: Streams.Stream; VAR longint: LONGINT) : BOOLEAN; + VAR + disc: Discipline; + ret : BOOLEAN; + BEGIN + IF Seek(s, discID, disc) THEN + RETURN disc.if.readLongInt(s, longint) + ELSE + ret := Streams.Read(s, longint); + IF Types.byteorder = Types.littleEndian THEN + Swap (longint); + END; + RETURN ret; + END; + END ReadLongInt; + + PROCEDURE ReadReal*(s: Streams.Stream; VAR real: REAL) : BOOLEAN; + VAR + disc: Discipline; + BEGIN + IF Seek(s, discID, disc) THEN + RETURN disc.if.readReal(s, real) + ELSE + RETURN Streams.Read(s, real) + END; + END ReadReal; + + PROCEDURE ReadLongReal*(s: Streams.Stream; VAR longreal: LONGREAL) : BOOLEAN; + VAR + disc: Discipline; + BEGIN + IF Seek(s, discID, disc) THEN + RETURN disc.if.readLongReal(s, longreal) + ELSE + RETURN Streams.Read(s, longreal) + END; + END ReadLongReal; + + PROCEDURE ReadSet*(s: Streams.Stream; VAR set: SET) : BOOLEAN; + VAR + disc: Discipline; + ret : BOOLEAN; + BEGIN + IF Seek(s, discID, disc) THEN + RETURN disc.if.readSet(s, set) + ELSE + ret := Streams.Read(s, set); + IF Types.byteorder = Types.littleEndian THEN + BitSwap (set); + END; + RETURN ret; + END; + END ReadSet; + + PROCEDURE ReadString*(s: Streams.Stream; VAR string: ARRAY OF CHAR) : BOOLEAN; + VAR + disc: Discipline; + ch: CHAR; index: LONGINT; + BEGIN + IF Seek(s, discID, disc) THEN + RETURN disc.if.readString(s, string) + ELSE + index := 0; + WHILE Streams.ReadByte(s, ch) & (ch # 0X) DO + IF index + 1 < LEN(string) THEN + string[index] := ch; INC(index); + END; + END; + string[index] := 0X; + RETURN ~s.error + END; + END ReadString; + + PROCEDURE ReadConstStringD*(s: Streams.Stream; + domain: ConstStrings.Domain; + VAR string: ConstStrings.String) : BOOLEAN; + CONST + bufsize = 512; + VAR + length: LONGINT; + buf: Streams.Stream; + ch: CHAR; + disc: Discipline; + stringbuf: ARRAY bufsize OF CHAR; + BEGIN + IF Seek(s, discID, disc) THEN + RETURN disc.if.readConstString(s, domain, string) + ELSE + IF ReadLongInt(s, length) THEN + IF length >= bufsize THEN + ConstStrings.Init(buf); + IF ~Streams.Copy(s, buf, length) THEN + RETURN FALSE + END; + ConstStrings.CloseD(buf, domain, string); + RETURN length = s.count; + ELSE + IF ~Streams.ReadPart(s, stringbuf, 0, length) THEN + RETURN FALSE + END; + stringbuf[length] := 0X; + ConstStrings.CreateD(string, domain, stringbuf); + RETURN TRUE + END; ELSE - Disciplines.Remove(s, discID); + RETURN FALSE END; - Forwarders.Update(s, Forward); - END AttachInterface; + END; + END ReadConstStringD; - PROCEDURE GetInterface(s: Streams.Stream; VAR if: Interface); - VAR - disc: Discipline; - BEGIN - IF Disciplines.Seek(s, discID, SYS.VAL(Disciplines.Discipline, disc)) THEN - if := disc.if; + PROCEDURE ReadConstString*(s: Streams.Stream; + VAR string: ConstStrings.String) : BOOLEAN; + BEGIN + RETURN ReadConstStringD(s, ConstStrings.std, string) + END ReadConstString; + + PROCEDURE WriteByte*(s: Streams.Stream; byte: Byte) : BOOLEAN; + VAR + disc: Discipline; + BEGIN + IF Seek(s, discID, disc) THEN + RETURN disc.if.writeByte(s, byte) + ELSE + RETURN Streams.WriteByte(s, byte) + END; + END WriteByte; + + PROCEDURE WriteChar*(s: Streams.Stream; char: CHAR) : BOOLEAN; + VAR + disc: Discipline; + BEGIN + IF Seek(s, discID, disc) THEN + RETURN disc.if.writeChar(s, char) + ELSE + RETURN Streams.WriteByte(s, char) + END; + END WriteChar; + + PROCEDURE WriteBoolean*(s: Streams.Stream; boolean: BOOLEAN) : BOOLEAN; + VAR + disc: Discipline; + BEGIN + IF Seek(s, discID, disc) THEN + RETURN disc.if.writeBoolean(s, boolean) + ELSE + RETURN Streams.Write(s, boolean) + END; + END WriteBoolean; + + PROCEDURE WriteShortInt*(s: Streams.Stream; shortint: SHORTINT) : BOOLEAN; + VAR + disc: Discipline; + BEGIN + IF Seek(s, discID, disc) THEN + RETURN disc.if.writeShortInt(s, shortint) + ELSE + RETURN Streams.WriteByte(s, shortint) + END; + END WriteShortInt; + + PROCEDURE WriteInteger*(s: Streams.Stream; integer: INTEGER) : BOOLEAN; + VAR + disc: Discipline; + BEGIN + IF Seek(s, discID, disc) THEN + RETURN disc.if.writeInteger(s, integer) + ELSE + IF Types.byteorder = Types.littleEndian THEN + Swap (integer); + END; + RETURN Streams.Write(s, integer); + END; + END WriteInteger; + + PROCEDURE WriteLongInt*(s: Streams.Stream; longint: LONGINT) : BOOLEAN; + VAR + disc: Discipline; + BEGIN + IF Seek(s, discID, disc) THEN + RETURN disc.if.writeLongInt(s, longint) + ELSE + IF Types.byteorder = Types.littleEndian THEN + Swap (longint); + END; + RETURN Streams.Write(s, longint); + END; + END WriteLongInt; + + PROCEDURE WriteReal*(s: Streams.Stream; real: REAL) : BOOLEAN; + VAR + disc: Discipline; + BEGIN + IF Seek(s, discID, disc) THEN + RETURN disc.if.writeReal(s, real) + ELSE + RETURN Streams.Write(s, real) + END; + END WriteReal; + + PROCEDURE WriteLongReal*(s: Streams.Stream; longreal: LONGREAL) : BOOLEAN; + VAR + disc: Discipline; + BEGIN + IF Seek(s, discID, disc) THEN + RETURN disc.if.writeLongReal(s, longreal) + ELSE + RETURN Streams.Write(s, longreal) + END; + END WriteLongReal; + + PROCEDURE WriteSet*(s: Streams.Stream; set: SET) : BOOLEAN; + VAR + disc: Discipline; + BEGIN + IF Seek(s, discID, disc) THEN + RETURN disc.if.writeSet(s, set) + ELSE + IF Types.byteorder = Types.littleEndian THEN + BitSwap (set); + END; + RETURN Streams.Write(s, set) + END; + END WriteSet; + + PROCEDURE WriteString*(s: Streams.Stream; string: ARRAY OF CHAR) : BOOLEAN; + VAR + disc: Discipline; + BEGIN + IF Seek(s, discID, disc) THEN + RETURN disc.if.writeString(s, string) + ELSE + RETURN Streams.WritePart(s, string, 0, Strings.Len(string)) & + Streams.WriteByte(s, 0X) + END; + END WriteString; + + PROCEDURE WriteConstString*(s: Streams.Stream; + string: ConstStrings.String) : BOOLEAN; + VAR + ch: CHAR; + buf: Streams.Stream; + disc: Discipline; + BEGIN + IF Seek(s, discID, disc) THEN + RETURN disc.if.writeConstString(s, string) + ELSE + IF WriteLongInt(s, string.len) THEN + ConstStrings.Open(buf, string); + RETURN Streams.Copy(buf, s, string.len) ELSE - if := NIL; + RETURN FALSE END; - END GetInterface; - - PROCEDURE CopyInterface*(from, to: Streams.Stream); - VAR - if: Interface; - BEGIN - GetInterface(from, if); - AttachInterface(to, if); - END CopyInterface; - - PROCEDURE Forward(from, to: Forwarders.Object); - BEGIN - (* this check is necessary because of Forwarders.Update *) - IF ~(from IS Streams.Stream) OR ~(to IS Streams.Stream) THEN - RETURN - END; - - WITH from: Streams.Stream DO WITH to: Streams.Stream DO - (* be careful here, from & to must be reversed *) - CopyInterface(to, from); - END; END; - END Forward; - - PROCEDURE ReadByte*(s: Streams.Stream; VAR byte: Byte) : BOOLEAN; - VAR - disc: Discipline; - BEGIN - IF Disciplines.Seek(s, discID, SYS.VAL(Disciplines.Discipline, disc)) THEN - RETURN disc.if.readByte(s, byte) - ELSE - RETURN Streams.ReadByte(s, byte) - END; - END ReadByte; - - PROCEDURE ReadChar*(s: Streams.Stream; VAR char: CHAR) : BOOLEAN; - VAR - disc: Discipline; - BEGIN - IF Disciplines.Seek(s, discID, SYS.VAL(Disciplines.Discipline, disc)) THEN - RETURN disc.if.readChar(s, char) - ELSE - RETURN Streams.ReadByte(s, char) - END; - END ReadChar; - - PROCEDURE ReadBoolean*(s: Streams.Stream; VAR boolean: BOOLEAN) : BOOLEAN; - VAR - disc: Discipline; - BEGIN - IF Disciplines.Seek(s, discID, SYS.VAL(Disciplines.Discipline, disc)) THEN - RETURN disc.if.readBoolean(s, boolean) - ELSE - RETURN Streams.Read(s, boolean) - END; - END ReadBoolean; - - PROCEDURE ReadShortInt*(s: Streams.Stream; VAR shortint: SHORTINT) : BOOLEAN; - VAR - disc: Discipline; - BEGIN - IF Disciplines.Seek(s, discID, SYS.VAL(Disciplines.Discipline, disc)) THEN - RETURN disc.if.readShortInt(s, shortint) - ELSE - RETURN Streams.ReadByte(s, shortint) - END; - END ReadShortInt; - - PROCEDURE ReadInteger*(s: Streams.Stream; VAR integer: INTEGER) : BOOLEAN; - VAR - disc: Discipline; - ret : BOOLEAN; - BEGIN - IF Disciplines.Seek(s, discID, SYS.VAL(Disciplines.Discipline, disc)) THEN - RETURN disc.if.readInteger(s, integer) - ELSE - ret := Streams.Read(s, integer); - IF Types.byteorder = Types.littleEndian THEN - Swap (integer); - END; - RETURN ret; - END; - END ReadInteger; - - PROCEDURE ReadLongInt*(s: Streams.Stream; VAR longint: LONGINT) : BOOLEAN; - VAR - disc: Discipline; - ret : BOOLEAN; - BEGIN - IF Disciplines.Seek(s, discID, SYS.VAL(Disciplines.Discipline, disc)) THEN - RETURN disc.if.readLongInt(s, longint) - ELSE - ret := Streams.Read(s, longint); - IF Types.byteorder = Types.littleEndian THEN - Swap (longint); - END; - RETURN ret; - END; - END ReadLongInt; - - PROCEDURE ReadReal*(s: Streams.Stream; VAR real: REAL) : BOOLEAN; - VAR - disc: Discipline; - BEGIN - IF Disciplines.Seek(s, discID, SYS.VAL(Disciplines.Discipline, disc)) THEN - RETURN disc.if.readReal(s, real) - ELSE - RETURN Streams.Read(s, real) - END; - END ReadReal; - - PROCEDURE ReadLongReal*(s: Streams.Stream; VAR longreal: LONGREAL) : BOOLEAN; - VAR - disc: Discipline; - BEGIN - IF Disciplines.Seek(s, discID, SYS.VAL(Disciplines.Discipline, disc)) THEN - RETURN disc.if.readLongReal(s, longreal) - ELSE - RETURN Streams.Read(s, longreal) - END; - END ReadLongReal; - - PROCEDURE ReadSet*(s: Streams.Stream; VAR set: SET) : BOOLEAN; - VAR - disc: Discipline; - ret : BOOLEAN; - BEGIN - IF Disciplines.Seek(s, discID, SYS.VAL(Disciplines.Discipline, disc)) THEN - RETURN disc.if.readSet(s, set) - ELSE - ret := Streams.Read(s, set); - IF Types.byteorder = Types.littleEndian THEN - BitSwap (set); - END; - RETURN ret; - END; - END ReadSet; - - PROCEDURE ReadString*(s: Streams.Stream; VAR string: ARRAY OF CHAR) : BOOLEAN; - VAR - disc: Discipline; - ch: CHAR; index: LONGINT; - BEGIN - IF Disciplines.Seek(s, discID, SYS.VAL(Disciplines.Discipline, disc)) THEN - RETURN disc.if.readString(s, string) - ELSE - index := 0; - WHILE Streams.ReadByte(s, ch) & (ch # 0X) DO - IF index + 1 < LEN(string) THEN - string[index] := ch; INC(index); - END; - END; - string[index] := 0X; - RETURN ~s.error - END; - END ReadString; - - PROCEDURE ReadConstStringD*(s: Streams.Stream; - domain: ConstStrings.Domain; - VAR string: ConstStrings.String) : BOOLEAN; - CONST - bufsize = 512; - VAR - length: LONGINT; - buf: Streams.Stream; - ch: CHAR; - disc: Discipline; - stringbuf: ARRAY bufsize OF CHAR; - BEGIN - IF Disciplines.Seek(s, discID, SYS.VAL(Disciplines.Discipline, disc)) THEN - RETURN disc.if.readConstString(s, domain, string) - ELSE - IF ReadLongInt(s, length) THEN - IF length >= bufsize THEN - ConstStrings.Init(buf); - IF ~Streams.Copy(s, buf, length) THEN - RETURN FALSE - END; - ConstStrings.CloseD(buf, domain, string); - RETURN length = s.count; - ELSE - IF ~Streams.ReadPart(s, stringbuf, 0, length) THEN - RETURN FALSE - END; - stringbuf[length] := 0X; - ConstStrings.CreateD(string, domain, stringbuf); - RETURN TRUE - END; - ELSE - RETURN FALSE - END; - END; - END ReadConstStringD; - - PROCEDURE ReadConstString*(s: Streams.Stream; - VAR string: ConstStrings.String) : BOOLEAN; - BEGIN - RETURN ReadConstStringD(s, ConstStrings.std, string) - END ReadConstString; - - PROCEDURE WriteByte*(s: Streams.Stream; byte: Byte) : BOOLEAN; - VAR - disc: Discipline; - BEGIN - IF Disciplines.Seek(s, discID, SYS.VAL(Disciplines.Discipline, disc)) THEN - RETURN disc.if.writeByte(s, byte) - ELSE - RETURN Streams.WriteByte(s, byte) - END; - END WriteByte; - - PROCEDURE WriteChar*(s: Streams.Stream; char: CHAR) : BOOLEAN; - VAR - disc: Discipline; - BEGIN - IF Disciplines.Seek(s, discID, SYS.VAL(Disciplines.Discipline, disc)) THEN - RETURN disc.if.writeChar(s, char) - ELSE - RETURN Streams.WriteByte(s, char) - END; - END WriteChar; - - PROCEDURE WriteBoolean*(s: Streams.Stream; boolean: BOOLEAN) : BOOLEAN; - VAR - disc: Discipline; - BEGIN - IF Disciplines.Seek(s, discID, SYS.VAL(Disciplines.Discipline, disc)) THEN - RETURN disc.if.writeBoolean(s, boolean) - ELSE - RETURN Streams.Write(s, boolean) - END; - END WriteBoolean; - - PROCEDURE WriteShortInt*(s: Streams.Stream; shortint: SHORTINT) : BOOLEAN; - VAR - disc: Discipline; - BEGIN - IF Disciplines.Seek(s, discID, SYS.VAL(Disciplines.Discipline, disc)) THEN - RETURN disc.if.writeShortInt(s, shortint) - ELSE - RETURN Streams.WriteByte(s, shortint) - END; - END WriteShortInt; - - PROCEDURE WriteInteger*(s: Streams.Stream; integer: INTEGER) : BOOLEAN; - VAR - disc: Discipline; - BEGIN - IF Disciplines.Seek(s, discID, SYS.VAL(Disciplines.Discipline, disc)) THEN - RETURN disc.if.writeInteger(s, integer) - ELSE - IF Types.byteorder = Types.littleEndian THEN - Swap (integer); - END; - RETURN Streams.Write(s, integer); - END; - END WriteInteger; - - PROCEDURE WriteLongInt*(s: Streams.Stream; longint: LONGINT) : BOOLEAN; - VAR - disc: Discipline; - BEGIN - IF Disciplines.Seek(s, discID, SYS.VAL(Disciplines.Discipline, disc)) THEN - RETURN disc.if.writeLongInt(s, longint) - ELSE - IF Types.byteorder = Types.littleEndian THEN - Swap (longint); - END; - RETURN Streams.Write(s, longint); - END; - END WriteLongInt; - - PROCEDURE WriteReal*(s: Streams.Stream; real: REAL) : BOOLEAN; - VAR - disc: Discipline; - BEGIN - IF Disciplines.Seek(s, discID, SYS.VAL(Disciplines.Discipline, disc)) THEN - RETURN disc.if.writeReal(s, real) - ELSE - RETURN Streams.Write(s, real) - END; - END WriteReal; - - PROCEDURE WriteLongReal*(s: Streams.Stream; longreal: LONGREAL) : BOOLEAN; - VAR - disc: Discipline; - BEGIN - IF Disciplines.Seek(s, discID, SYS.VAL(Disciplines.Discipline, disc)) THEN - RETURN disc.if.writeLongReal(s, longreal) - ELSE - RETURN Streams.Write(s, longreal) - END; - END WriteLongReal; - - PROCEDURE WriteSet*(s: Streams.Stream; set: SET) : BOOLEAN; - VAR - disc: Discipline; - BEGIN - IF Disciplines.Seek(s, discID, SYS.VAL(Disciplines.Discipline, disc)) THEN - RETURN disc.if.writeSet(s, set) - ELSE - IF Types.byteorder = Types.littleEndian THEN - BitSwap (set); - END; - RETURN Streams.Write(s, set) - END; - END WriteSet; - - PROCEDURE WriteString*(s: Streams.Stream; string: ARRAY OF CHAR) : BOOLEAN; - VAR - disc: Discipline; - BEGIN - IF Disciplines.Seek(s, discID, SYS.VAL(Disciplines.Discipline, disc)) THEN - RETURN disc.if.writeString(s, string) - ELSE - RETURN Streams.WritePart(s, string, 0, Strings.Len(string)) & - Streams.WriteByte(s, 0X) - END; - END WriteString; - - PROCEDURE WriteConstString*(s: Streams.Stream; - string: ConstStrings.String) : BOOLEAN; - VAR - ch: CHAR; - buf: Streams.Stream; - disc: Discipline; - BEGIN - IF Disciplines.Seek(s, discID, SYS.VAL(Disciplines.Discipline, disc)) THEN - RETURN disc.if.writeConstString(s, string) - ELSE - IF WriteLongInt(s, string.len) THEN - ConstStrings.Open(buf, string); - RETURN Streams.Copy(buf, s, string.len) - ELSE - RETURN FALSE - END; - END; - END WriteConstString; + END; + END WriteConstString; BEGIN - discID := Disciplines.Unique(); - Forwarders.Register("Streams.Stream", Forward); + discID := Disciplines.Unique(); + Forwarders.Register("Streams.Stream", Forward); END ulmNetIO. diff --git a/src/library/ulm/ulmOperations.Mod b/src/library/ulm/ulmOperations.Mod index 4f74cc61..617b9808 100644 --- a/src/library/ulm/ulmOperations.Mod +++ b/src/library/ulm/ulmOperations.Mod @@ -1,234 +1,234 @@ (* Ulm's Oberon Library - Copyright (C) 1989-1994 by University of Ulm, SAI, D-89069 Ulm, Germany - ---------------------------------------------------------------------------- - Ulm's Oberon Library is free software; you can redistribute it - and/or modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either version - 2 of the License, or (at your option) any later version. + Copyright (C) 1989-1994 by University of Ulm, SAI, D-89069 Ulm, Germany + ---------------------------------------------------------------------------- + Ulm's Oberon Library is free software; you can redistribute it + and/or modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either version + 2 of the License, or (at your option) any later version. - Ulm's Oberon Library is distributed in the hope that it will be - useful, but WITHOUT ANY WARRANTY; without even the implied warranty - of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. + Ulm's Oberon Library is distributed in the hope that it will be + useful, but WITHOUT ANY WARRANTY; without even the implied warranty + of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - ---------------------------------------------------------------------------- - E-mail contact: oberon@mathematik.uni-ulm.de - ---------------------------------------------------------------------------- - $Id: Operations.om,v 1.4 2004/09/16 18:31:54 borchert Exp $ - ---------------------------------------------------------------------------- - $Log: Operations.om,v $ - Revision 1.4 2004/09/16 18:31:54 borchert - optimization for Assign added in case of a non-NIL target - and identical types for target and source + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + ---------------------------------------------------------------------------- + E-mail contact: oberon@mathematik.uni-ulm.de + ---------------------------------------------------------------------------- + $Id: Operations.om,v 1.4 2004/09/16 18:31:54 borchert Exp $ + ---------------------------------------------------------------------------- + $Log: Operations.om,v $ + Revision 1.4 2004/09/16 18:31:54 borchert + optimization for Assign added in case of a non-NIL target + and identical types for target and source - Revision 1.3 1997/02/05 16:27:45 borchert - Init asserts now that Services.Init hat been called previously - for ``op'' + Revision 1.3 1997/02/05 16:27:45 borchert + Init asserts now that Services.Init hat been called previously + for ``op'' - Revision 1.2 1995/01/16 21:39:50 borchert - - assertions of Assertions have been converted into real assertions - - some fixes due to changes of PersistentObjects + Revision 1.2 1995/01/16 21:39:50 borchert + - assertions of Assertions have been converted into real assertions + - some fixes due to changes of PersistentObjects - Revision 1.1 1994/02/22 20:09:03 borchert - Initial revision + Revision 1.1 1994/02/22 20:09:03 borchert + Initial revision - ---------------------------------------------------------------------------- - AFB 12/91 - ---------------------------------------------------------------------------- + ---------------------------------------------------------------------------- + AFB 12/91 + ---------------------------------------------------------------------------- *) MODULE ulmOperations; - (* generic support of arithmetic operations *) + (* generic support of arithmetic operations *) - IMPORT Events := ulmEvents, Objects := ulmObjects, PersistentDisciplines := ulmPersistentDisciplines, PersistentObjects := ulmPersistentObjects, Services := ulmServices; + IMPORT Events := ulmEvents, Objects := ulmObjects, PersistentDisciplines := ulmPersistentDisciplines, PersistentObjects := ulmPersistentObjects, Services := ulmServices; - CONST - add* = 0; sub* = 1; mul* = 2; div* = 3; cmp* = 4; - TYPE - Operation* = SHORTINT; (* add..cmp *) - Operand* = POINTER TO OperandRec; + CONST + add* = 0; sub* = 1; mul* = 2; div* = 3; cmp* = 4; + TYPE + Operation* = SHORTINT; (* add..cmp *) + Operand* = POINTER TO OperandRec; - TYPE - CapabilitySet* = SET; (* SET OF [add..cmp] *) - CreateProc* = PROCEDURE (VAR op: Operand); - (* should call Operations.Init for op *) - OperatorProc* = PROCEDURE (op: Operation; op1, op2: Operand; - VAR result: Operand); - AssignProc* = PROCEDURE (VAR target: Operand; source: Operand); - CompareProc* = PROCEDURE (op1, op2: Operand) : INTEGER; - Interface* = POINTER TO InterfaceRec; - InterfaceRec* = - RECORD - (Objects.ObjectRec) - create*: CreateProc; - assign*: AssignProc; - op*: OperatorProc; - compare*: CompareProc; - END; - - TYPE - OperandRec* = - RECORD - (PersistentDisciplines.ObjectRec) - if: Interface; - caps: CapabilitySet; - END; - VAR - operandType: Services.Type; - - PROCEDURE Init*(op: Operand; if: Interface; caps: CapabilitySet); - VAR - type: Services.Type; - BEGIN - Services.GetType(op, type); ASSERT(type # NIL); - op.if := if; op.caps := caps; - END Init; - - PROCEDURE Capabilities*(op: Operand) : CapabilitySet; - BEGIN - RETURN op.caps - END Capabilities; - - PROCEDURE Compatible*(op1, op2: Operand) : BOOLEAN; - (* return TRUE if both operands have the same interface *) - BEGIN - RETURN op1.if = op2.if - END Compatible; - - (* the interface of the first operand must match the interface - of all other operands; - the result parameter must be either NIL or already initialized - with the same interface - *) - - PROCEDURE Op(op: Operation; op1, op2: Operand; VAR result: Operand); - - VAR - tmpresult: Operand; - BEGIN - ASSERT(op1.if = op2.if); - ASSERT(op IN op1.caps); - (* we are very defensive here because the type of tmpresult - is perhaps not identical to result or an extension of it; - op1.if.create(result) will not work in all cases - because of type guard failures - *) - op1.if.create(tmpresult); - op1.if.op(op, op1, op2, tmpresult); - result := tmpresult; - END Op; - - PROCEDURE Add*(op1, op2: Operand) : Operand; - VAR result: Operand; - BEGIN - result := NIL; - Op(add, op1, op2, result); - RETURN result - END Add; - - PROCEDURE Add2*(VAR op1: Operand; op2: Operand); - BEGIN - Op(add, op1, op2, op1); - END Add2; - - PROCEDURE Add3*(VAR result: Operand; op1, op2: Operand); - BEGIN - Op(add, op1, op2, result); - END Add3; - - PROCEDURE Sub*(op1, op2: Operand) : Operand; - VAR result: Operand; - BEGIN - result := NIL; - Op(sub, op1, op2, result); - RETURN result - END Sub; - - PROCEDURE Sub2*(VAR op1: Operand; op2: Operand); - BEGIN - Op(sub, op1, op2, op1); - END Sub2; - - PROCEDURE Sub3*(VAR result: Operand; op1, op2: Operand); - BEGIN - Op(sub, op1, op2, result); - END Sub3; - - PROCEDURE Mul*(op1, op2: Operand) : Operand; - VAR result: Operand; - BEGIN - result := NIL; - Op(mul, op1, op2, result); - RETURN result - END Mul; - - PROCEDURE Mul2*(VAR op1: Operand; op2: Operand); - BEGIN - Op(mul, op1, op2, op1); - END Mul2; - - PROCEDURE Mul3*(VAR result: Operand; op1, op2: Operand); - BEGIN - Op(mul, op1, op2, result); - END Mul3; - - PROCEDURE Div*(op1, op2: Operand) : Operand; - VAR result: Operand; - BEGIN - result := NIL; - Op(div, op1, op2, result); - RETURN result - END Div; - - PROCEDURE Div2*(VAR op1: Operand; op2: Operand); - BEGIN - Op(div, op1, op2, op1); - END Div2; - - PROCEDURE Div3*(VAR result: Operand; op1, op2: Operand); - BEGIN - Op(div, op1, op2, result); - END Div3; - - PROCEDURE Compare*(op1, op2: Operand) : INTEGER; - BEGIN - ASSERT(op1.if = op2.if); - ASSERT(cmp IN op1.caps); - RETURN op1.if.compare(op1, op2) - END Compare; - - PROCEDURE Assign*(VAR target: Operand; source: Operand); - VAR - tmpTarget: Operand; - typesIdentical: BOOLEAN; - targetType, sourceType: Services.Type; - BEGIN - IF (target # NIL) & (target.if = source.if) THEN - Services.GetType(target, targetType); - Services.GetType(source, sourceType); - typesIdentical := targetType = sourceType; - ELSE - typesIdentical := FALSE; + TYPE + CapabilitySet* = SET; (* SET OF [add..cmp] *) + CreateProc* = PROCEDURE (VAR op: Operand); + (* should call Operations.Init for op *) + OperatorProc* = PROCEDURE (op: Operation; op1, op2: Operand; + VAR result: Operand); + AssignProc* = PROCEDURE (VAR target: Operand; source: Operand); + CompareProc* = PROCEDURE (op1, op2: Operand) : INTEGER; + Interface* = POINTER TO InterfaceRec; + InterfaceRec* = + RECORD + (Objects.ObjectRec) + create*: CreateProc; + assign*: AssignProc; + op*: OperatorProc; + compare*: CompareProc; END; - IF typesIdentical THEN - source.if.assign(target, source); - ELSE - source.if.create(tmpTarget); - source.if.assign(tmpTarget, source); - target := tmpTarget; - END; - END Assign; - PROCEDURE Copy*(source, target: Operand); - BEGIN + TYPE + OperandRec* = + RECORD + (PersistentDisciplines.ObjectRec) + if: Interface; + caps: CapabilitySet; + END; + VAR + operandType: Services.Type; + + PROCEDURE Init*(op: Operand; if: Interface; caps: CapabilitySet); + VAR + type: Services.Type; + BEGIN + Services.GetType(op, type); ASSERT(type # NIL); + op.if := if; op.caps := caps; + END Init; + + PROCEDURE Capabilities*(op: Operand) : CapabilitySet; + BEGIN + RETURN op.caps + END Capabilities; + + PROCEDURE Compatible*(op1, op2: Operand) : BOOLEAN; + (* return TRUE if both operands have the same interface *) + BEGIN + RETURN op1.if = op2.if + END Compatible; + + (* the interface of the first operand must match the interface + of all other operands; + the result parameter must be either NIL or already initialized + with the same interface + *) + + PROCEDURE Op(op: Operation; op1, op2: Operand; VAR result: Operand); + + VAR + tmpresult: Operand; + BEGIN + ASSERT(op1.if = op2.if); + ASSERT(op IN op1.caps); + (* we are very defensive here because the type of tmpresult + is perhaps not identical to result or an extension of it; + op1.if.create(result) will not work in all cases + because of type guard failures + *) + op1.if.create(tmpresult); + op1.if.op(op, op1, op2, tmpresult); + result := tmpresult; + END Op; + + PROCEDURE Add*(op1, op2: Operand) : Operand; + VAR result: Operand; + BEGIN + result := NIL; + Op(add, op1, op2, result); + RETURN result + END Add; + + PROCEDURE Add2*(VAR op1: Operand; op2: Operand); + BEGIN + Op(add, op1, op2, op1); + END Add2; + + PROCEDURE Add3*(VAR result: Operand; op1, op2: Operand); + BEGIN + Op(add, op1, op2, result); + END Add3; + + PROCEDURE Sub*(op1, op2: Operand) : Operand; + VAR result: Operand; + BEGIN + result := NIL; + Op(sub, op1, op2, result); + RETURN result + END Sub; + + PROCEDURE Sub2*(VAR op1: Operand; op2: Operand); + BEGIN + Op(sub, op1, op2, op1); + END Sub2; + + PROCEDURE Sub3*(VAR result: Operand; op1, op2: Operand); + BEGIN + Op(sub, op1, op2, result); + END Sub3; + + PROCEDURE Mul*(op1, op2: Operand) : Operand; + VAR result: Operand; + BEGIN + result := NIL; + Op(mul, op1, op2, result); + RETURN result + END Mul; + + PROCEDURE Mul2*(VAR op1: Operand; op2: Operand); + BEGIN + Op(mul, op1, op2, op1); + END Mul2; + + PROCEDURE Mul3*(VAR result: Operand; op1, op2: Operand); + BEGIN + Op(mul, op1, op2, result); + END Mul3; + + PROCEDURE Div*(op1, op2: Operand) : Operand; + VAR result: Operand; + BEGIN + result := NIL; + Op(div, op1, op2, result); + RETURN result + END Div; + + PROCEDURE Div2*(VAR op1: Operand; op2: Operand); + BEGIN + Op(div, op1, op2, op1); + END Div2; + + PROCEDURE Div3*(VAR result: Operand; op1, op2: Operand); + BEGIN + Op(div, op1, op2, result); + END Div3; + + PROCEDURE Compare*(op1, op2: Operand) : INTEGER; + BEGIN + ASSERT(op1.if = op2.if); + ASSERT(cmp IN op1.caps); + RETURN op1.if.compare(op1, op2) + END Compare; + + PROCEDURE Assign*(VAR target: Operand; source: Operand); + VAR + tmpTarget: Operand; + typesIdentical: BOOLEAN; + targetType, sourceType: Services.Type; + BEGIN + IF (target # NIL) & (target.if = source.if) THEN + Services.GetType(target, targetType); + Services.GetType(source, sourceType); + typesIdentical := targetType = sourceType; + ELSE + typesIdentical := FALSE; + END; + IF typesIdentical THEN source.if.assign(target, source); - END Copy; + ELSE + source.if.create(tmpTarget); + source.if.assign(tmpTarget, source); + target := tmpTarget; + END; + END Assign; + + PROCEDURE Copy*(source, target: Operand); + BEGIN + source.if.assign(target, source); + END Copy; BEGIN - PersistentObjects.RegisterType(operandType, - "Operations.Operand", "PersistentDisciplines.Object", NIL); + PersistentObjects.RegisterType(operandType, + "Operations.Operand", "PersistentDisciplines.Object", NIL); END ulmOperations. diff --git a/src/library/ulm/ulmPersistentDisciplines.Mod b/src/library/ulm/ulmPersistentDisciplines.Mod index 8f37d4ce..538b8de6 100644 --- a/src/library/ulm/ulmPersistentDisciplines.Mod +++ b/src/library/ulm/ulmPersistentDisciplines.Mod @@ -1,391 +1,392 @@ (* Ulm's Oberon Library - Copyright (C) 1989-1994 by University of Ulm, SAI, D-89069 Ulm, Germany - ---------------------------------------------------------------------------- - Ulm's Oberon Library is free software; you can redistribute it - and/or modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either version - 2 of the License, or (at your option) any later version. + Copyright (C) 1989-1994 by University of Ulm, SAI, D-89069 Ulm, Germany + ---------------------------------------------------------------------------- + Ulm's Oberon Library is free software; you can redistribute it + and/or modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either version + 2 of the License, or (at your option) any later version. - Ulm's Oberon Library is distributed in the hope that it will be - useful, but WITHOUT ANY WARRANTY; without even the implied warranty - of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. + Ulm's Oberon Library is distributed in the hope that it will be + useful, but WITHOUT ANY WARRANTY; without even the implied warranty + of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - ---------------------------------------------------------------------------- - E-mail contact: oberon@mathematik.uni-ulm.de - ---------------------------------------------------------------------------- - $Id: PersistentD.om,v 1.4 1998/02/22 10:25:22 borchert Exp $ - ---------------------------------------------------------------------------- - $Log: PersistentD.om,v $ - Revision 1.4 1998/02/22 10:25:22 borchert - bug fix in GetObject: Disciplines.Add was missing if the main object - is just an extension of Disciplines.Object and not of - PersistentDisciplines.Object + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + ---------------------------------------------------------------------------- + E-mail contact: oberon@mathematik.uni-ulm.de + ---------------------------------------------------------------------------- + $Id: PersistentD.om,v 1.4 1998/02/22 10:25:22 borchert Exp $ + ---------------------------------------------------------------------------- + $Log: PersistentD.om,v $ + Revision 1.4 1998/02/22 10:25:22 borchert + bug fix in GetObject: Disciplines.Add was missing if the main object + is just an extension of Disciplines.Object and not of + PersistentDisciplines.Object - Revision 1.3 1996/07/24 07:41:28 borchert - bug fix: count component was not initialized (with the - exception of CreateObject) -- detected by Martin Hasch + Revision 1.3 1996/07/24 07:41:28 borchert + bug fix: count component was not initialized (with the + exception of CreateObject) -- detected by Martin Hasch - Revision 1.2 1995/03/17 16:13:33 borchert - - persistent disciplines may now be attached to non-persistent objects - - some fixes due to changes of PersistentObjects + Revision 1.2 1995/03/17 16:13:33 borchert + - persistent disciplines may now be attached to non-persistent objects + - some fixes due to changes of PersistentObjects - Revision 1.1 1994/02/22 20:09:12 borchert - Initial revision + Revision 1.1 1994/02/22 20:09:12 borchert + Initial revision - ---------------------------------------------------------------------------- + ---------------------------------------------------------------------------- *) MODULE ulmPersistentDisciplines; - IMPORT Disciplines := ulmDisciplines, Forwarders := ulmForwarders, NetIO := ulmNetIO, Objects := ulmObjects, PersistentObjects := ulmPersistentObjects, - Services := ulmServices, Streams := ulmStreams, SYS := SYSTEM; + IMPORT Disciplines := ulmDisciplines, Forwarders := ulmForwarders, NetIO := ulmNetIO, Objects := ulmObjects, PersistentObjects := ulmPersistentObjects, + Services := ulmServices, Streams := ulmStreams; - CONST - objectName = "PersistentDisciplines.Object"; - disciplineName = "PersistentDisciplines.Discipline"; + CONST + objectName = "PersistentDisciplines.Object"; + disciplineName = "PersistentDisciplines.Discipline"; - TYPE - Identifier* = LONGINT; + TYPE + Identifier* = LONGINT; - Discipline* = POINTER TO DisciplineRec; - DisciplineRec* = - RECORD - (PersistentObjects.ObjectRec) - id*: Identifier; (* should be unique for all types of disciplines *) - END; + Discipline* = POINTER TO DisciplineRec; + DisciplineRec* = + RECORD + (PersistentObjects.ObjectRec) + id*: Identifier; (* should be unique for all types of disciplines *) + END; - DisciplineList = POINTER TO DisciplineListRec; - DisciplineListRec = - RECORD - discipline: Discipline; - id: Identifier; (* copied from discipline.id *) - next: DisciplineList; - END; + DisciplineList = POINTER TO DisciplineListRec; + DisciplineListRec = + RECORD + discipline: Discipline; + id: Identifier; (* copied from discipline.id *) + next: DisciplineList; + END; - Interface = POINTER TO InterfaceRec; - Object = POINTER TO ObjectRec; - ObjectRec* = - RECORD - (PersistentObjects.ObjectRec) - (* private part *) - count: LONGINT; (* number of attached disciplines *) - list: DisciplineList; (* set of disciplines *) - if: Interface; (* overrides builtins if # NIL *) - forwardTo: Object; - usedBy: Object; (* used as target of UseInterfaceOf *) - (* very restrictive way of avoiding reference cycles: - forwardTo references must be built from inner to - outer objects and not vice versa - *) - END; + Interface = POINTER TO InterfaceRec; + Object = POINTER TO ObjectRec; + ObjectRec* = + RECORD + (PersistentObjects.ObjectRec) + (* private part *) + count: LONGINT; (* number of attached disciplines *) + list: DisciplineList; (* set of disciplines *) + if: Interface; (* overrides builtins if # NIL *) + forwardTo: Object; + usedBy: Object; (* used as target of UseInterfaceOf *) + (* very restrictive way of avoiding reference cycles: + forwardTo references must be built from inner to + outer objects and not vice versa + *) + END; - TYPE - VolatileDiscipline = POINTER TO VolatileDisciplineRec; - VolatileDisciplineRec = - RECORD - (Disciplines.DisciplineRec) - object: Object; - END; - VAR - volDiscID: Disciplines.Identifier; + TYPE + VolatileDiscipline = POINTER TO VolatileDisciplineRec; + VolatileDisciplineRec = + RECORD + (Disciplines.DisciplineRec) + object: Object; + END; + VAR + volDiscID: Disciplines.Identifier; - TYPE - AddProc* = PROCEDURE (object: Disciplines.Object; discipline: Discipline); - RemoveProc* = PROCEDURE (object: Disciplines.Object; id: Identifier); - SeekProc* = PROCEDURE (object: Disciplines.Object; id: Identifier; - VAR discipline: Discipline) : BOOLEAN; - InterfaceRec* = - RECORD - (Objects.ObjectRec) - add*: AddProc; - remove*: RemoveProc; - seek*: SeekProc; - END; + TYPE + AddProc* = PROCEDURE (object: Disciplines.Object; discipline: Discipline); + RemoveProc* = PROCEDURE (object: Disciplines.Object; id: Identifier); + SeekProc* = PROCEDURE (object: Disciplines.Object; id: Identifier; + VAR discipline: Discipline) : BOOLEAN; + InterfaceRec* = + RECORD + (Objects.ObjectRec) + add*: AddProc; + remove*: RemoveProc; + seek*: SeekProc; + END; - VAR - unique: Identifier; - objIf: PersistentObjects.Interface; - objDatatype, discDatatype: Services.Type; + VAR + unique: Identifier; + objIf: PersistentObjects.Interface; + objDatatype, discDatatype: Services.Type; - CONST - hashtabsize = 32; - TYPE - Sample = POINTER TO SampleRec; - SampleRec = - RECORD - id: Identifier; - sample: Discipline; - next: Sample; - END; - BucketTable = ARRAY hashtabsize OF Sample; - VAR - samples: BucketTable; + CONST + hashtabsize = 32; + TYPE + Sample = POINTER TO SampleRec; + SampleRec = + RECORD + id: Identifier; + sample: Discipline; + next: Sample; + END; + BucketTable = ARRAY hashtabsize OF Sample; + VAR + samples: BucketTable; - PROCEDURE CreateObject*(VAR object: Object); - (* creates a new object; this procedures should be called instead of - NEW for objects of type `Object' + PROCEDURE CreateObject*(VAR object: Object); + (* creates a new object; this procedures should be called instead of + NEW for objects of type `Object' + *) + BEGIN + NEW(object); + object.count := 0; (* up to now, there are no attached disciplines *) + object.list := NIL; + object.if := NIL; + PersistentObjects.Init(object, objDatatype); + END CreateObject; + + PROCEDURE GetObject(obj: Disciplines.Object; VAR object: Object); + VAR + disc: Disciplines.Discipline; + vdisc: VolatileDiscipline; + BEGIN + IF obj IS Object THEN + object := obj(Object); + (* initialize private components now if not done already; + we assume here that pointers which have not been + initialized yet are defined to be NIL + (because of the garbage collection); + a similar assumption does not necessarily hold for + other types (e.g. integers) *) - BEGIN - NEW(object); - object.count := 0; (* up to now, there are no attached disciplines *) - object.list := NIL; - object.if := NIL; - PersistentObjects.Init(object, objDatatype); - END CreateObject; + IF object.list = NIL THEN + object.count := 0; + END; + ELSIF Disciplines.Seek(obj, volDiscID, disc) THEN + object := disc(VolatileDiscipline).object; + ELSE + CreateObject(object); + NEW(vdisc); vdisc.id := volDiscID; vdisc.object := object; + Disciplines.Add(obj, vdisc); + END; + END GetObject; - PROCEDURE GetObject(obj: Disciplines.Object; VAR object: Object); - VAR - disc: VolatileDiscipline; - BEGIN - IF obj IS Object THEN - object := obj(Object); - (* initialize private components now if not done already; - we assume here that pointers which have not been - initialized yet are defined to be NIL - (because of the garbage collection); - a similar assumption does not necessarily hold for - other types (e.g. integers) - *) - IF object.list = NIL THEN - object.count := 0; - END; - ELSIF Disciplines.Seek(obj, volDiscID, SYS.VAL(Disciplines.Discipline, disc)) THEN - object := disc.object; + (* === normal stuff for disciplines ===================================== *) + + PROCEDURE Unique*(sample: Discipline) : Identifier; + (* returns a unique identifier; + this procedure should be called during initialization by + all modules defining a discipline type; + a sample of the associated discipline has to be provided + *) + VAR + hashval: Identifier; + entry: Sample; + BEGIN + INC(unique); + NEW(entry); entry.id := unique; entry.sample := sample; + hashval := unique MOD hashtabsize; + entry.next := samples[hashval]; samples[hashval] := entry; + RETURN unique + END Unique; + + PROCEDURE GetSample*(id: Identifier) : Discipline; + (* return sample for the given identifier; + NIL will be returned if id has not yet been returned by Unique + *) + VAR + hashval: Identifier; + ptr: Sample; + BEGIN + hashval := id MOD hashtabsize; + ptr := samples[hashval]; + WHILE (ptr # NIL) & (ptr.id # id) DO + ptr := ptr.next; + END; + IF ptr # NIL THEN + RETURN ptr.sample + ELSE + RETURN NIL + END; + END GetSample; + + PROCEDURE AttachInterface*(object: Disciplines.Object; if: Interface); + (* override the builtin implementations of Add, Remove and + Seek for `object' with the implementations given by `if' + *) + VAR + po: Object; + BEGIN + GetObject(object, po); + IF (po.list = NIL) & (po.forwardTo = NIL) THEN + po.if := if; + END; + END AttachInterface; + + PROCEDURE UseInterfaceOf*(object, host: Disciplines.Object); + (* forward Add, Remove and Seek operations from object to host *) + VAR + po, phost: Object; + BEGIN + GetObject(object, po); GetObject(host, phost); + IF (po.list = NIL) & (po.forwardTo = NIL) & + (po.usedBy = NIL) THEN + po.forwardTo := phost; + phost.usedBy := po; (* avoid reference cycles *) + END; + END UseInterfaceOf; + + PROCEDURE Forward(from, to: Forwarders.Object); + BEGIN + UseInterfaceOf(from, to); + END Forward; + + PROCEDURE Remove*(object: Disciplines.Object; id: Identifier); + (* remove the discipline with the given id from object, if it exists *) + VAR + po: Object; + prev, dl: DisciplineList; + BEGIN + GetObject(object, po); + WHILE po.forwardTo # NIL DO + po := po.forwardTo; + END; + IF po.if = NIL THEN + prev := NIL; + dl := po.list; + WHILE (dl # NIL) & (dl.id # id) DO + prev := dl; dl := dl.next; + END; + IF dl # NIL THEN + IF prev = NIL THEN + po.list := dl.next; + ELSE + prev.next := dl.next; + END; + DEC(po.count); (* discipline removed *) + END; + ELSE + po.if.remove(po, id); + END; + END Remove; + + PROCEDURE Add*(object: Disciplines.Object; discipline: Discipline); + (* adds a new discipline to the given object; + if already a discipline with the same identifier exist + it is deleted first + *) + VAR + po: Object; + dl: DisciplineList; + BEGIN + GetObject(object, po); + WHILE po.forwardTo # NIL DO + po := po.forwardTo; + END; + IF po.if = NIL THEN + dl := po.list; + WHILE (dl # NIL) & (dl.id # discipline.id) DO + dl := dl.next; + END; + IF dl = NIL THEN + NEW(dl); + dl.id := discipline.id; + dl.next := po.list; + po.list := dl; + INC(po.count); (* discipline added *) + END; + dl.discipline := discipline; + ELSE + po.if.add(po, discipline); + END; + END Add; + + PROCEDURE Seek*(object: Disciplines.Object; id: Identifier; + VAR discipline: Discipline) : BOOLEAN; + (* returns TRUE if a discipline with the given id is found *) + VAR + po: Object; + dl: DisciplineList; + BEGIN + GetObject(object, po); + WHILE po.forwardTo # NIL DO + po := po.forwardTo; + END; + IF po.if = NIL THEN + dl := po.list; + WHILE (dl # NIL) & (dl.id # id) DO + dl := dl.next; + END; + IF dl # NIL THEN + discipline := dl.discipline; ELSE - CreateObject(object); - NEW(disc); disc.id := volDiscID; disc.object := object; - Disciplines.Add(obj, disc); + discipline := NIL; END; - END GetObject; + RETURN discipline # NIL + ELSE + RETURN po.if.seek(po, id, discipline) + END; + END Seek; - (* === normal stuff for disciplines ===================================== *) + (* === interface procedures for PersistentObjects for Object === *) - PROCEDURE Unique*(sample: Discipline) : Identifier; - (* returns a unique identifier; - this procedure should be called during initialization by - all modules defining a discipline type; - a sample of the associated discipline has to be provided - *) - VAR - hashval: Identifier; - entry: Sample; - BEGIN - INC(unique); - NEW(entry); entry.id := unique; entry.sample := sample; - hashval := unique MOD hashtabsize; - entry.next := samples[hashval]; samples[hashval] := entry; - RETURN unique - END Unique; + PROCEDURE ReadObjectData(stream: Streams.Stream; + object: PersistentObjects.Object) : BOOLEAN; + (* read data and attached disciplines of given object from stream *) + VAR + discipline: PersistentObjects.Object; (* Discipline *) + count: LONGINT; + BEGIN + (* get number of attached disciplines *) + IF ~NetIO.ReadLongInt(stream, count) THEN + RETURN FALSE; + END; + (* read all disciplines from `stream' and attach them to `object' *) + WHILE count > 0 DO + IF ~PersistentObjects.Read(stream, discipline) THEN + RETURN FALSE; + END; + Add(object(Object), discipline(Discipline)); + DEC(count); + END; + RETURN TRUE; + END ReadObjectData; - PROCEDURE GetSample*(id: Identifier) : Discipline; - (* return sample for the given identifier; - NIL will be returned if id has not yet been returned by Unique - *) - VAR - hashval: Identifier; - ptr: Sample; - BEGIN - hashval := id MOD hashtabsize; - ptr := samples[hashval]; - WHILE (ptr # NIL) & (ptr.id # id) DO - ptr := ptr.next; + PROCEDURE WriteObjectData(stream: Streams.Stream; + object: PersistentObjects.Object) : BOOLEAN; + (* write data and attached disciplines of given object to stream *) + VAR + dl: DisciplineList; + BEGIN + WITH object: Object DO + (* write number of attached disciplines to `stream' *) + IF ~NetIO.WriteLongInt(stream, object.count) THEN + RETURN FALSE; END; - IF ptr # NIL THEN - RETURN ptr.sample - ELSE - RETURN NIL + (* write all attached disciplines to the stream *) + dl := object.list; + WHILE dl # NIL DO + IF ~PersistentObjects.Write(stream, dl.discipline) THEN + RETURN FALSE; + END; + dl := dl.next; END; - END GetSample; + END; + RETURN TRUE; + END WriteObjectData; - PROCEDURE AttachInterface*(object: Disciplines.Object; if: Interface); - (* override the builtin implementations of Add, Remove and - Seek for `object' with the implementations given by `if' - *) - VAR - po: Object; - BEGIN - GetObject(object, po); - IF (po.list = NIL) & (po.forwardTo = NIL) THEN - po.if := if; - END; - END AttachInterface; - - PROCEDURE UseInterfaceOf*(object, host: Disciplines.Object); - (* forward Add, Remove and Seek operations from object to host *) - VAR - po, phost: Object; - BEGIN - GetObject(object, po); GetObject(host, phost); - IF (po.list = NIL) & (po.forwardTo = NIL) & - (po.usedBy = NIL) THEN - po.forwardTo := phost; - phost.usedBy := po; (* avoid reference cycles *) - END; - END UseInterfaceOf; - - PROCEDURE Forward(from, to: Forwarders.Object); - BEGIN - UseInterfaceOf(from, to); - END Forward; - - PROCEDURE Remove*(object: Disciplines.Object; id: Identifier); - (* remove the discipline with the given id from object, if it exists *) - VAR - po: Object; - prev, dl: DisciplineList; - BEGIN - GetObject(object, po); - WHILE po.forwardTo # NIL DO - po := po.forwardTo; - END; - IF po.if = NIL THEN - prev := NIL; - dl := po.list; - WHILE (dl # NIL) & (dl.id # id) DO - prev := dl; dl := dl.next; - END; - IF dl # NIL THEN - IF prev = NIL THEN - po.list := dl.next; - ELSE - prev.next := dl.next; - END; - DEC(po.count); (* discipline removed *) - END; - ELSE - po.if.remove(po, id); - END; - END Remove; - - PROCEDURE Add*(object: Disciplines.Object; discipline: Discipline); - (* adds a new discipline to the given object; - if already a discipline with the same identifier exist - it is deleted first - *) - VAR - po: Object; - dl: DisciplineList; - BEGIN - GetObject(object, po); - WHILE po.forwardTo # NIL DO - po := po.forwardTo; - END; - IF po.if = NIL THEN - dl := po.list; - WHILE (dl # NIL) & (dl.id # discipline.id) DO - dl := dl.next; - END; - IF dl = NIL THEN - NEW(dl); - dl.id := discipline.id; - dl.next := po.list; - po.list := dl; - INC(po.count); (* discipline added *) - END; - dl.discipline := discipline; - ELSE - po.if.add(po, discipline); - END; - END Add; - - PROCEDURE Seek*(object: Disciplines.Object; id: Identifier; - VAR discipline: Discipline) : BOOLEAN; - (* returns TRUE if a discipline with the given id is found *) - VAR - po: Object; - dl: DisciplineList; - BEGIN - GetObject(object, po); - WHILE po.forwardTo # NIL DO - po := po.forwardTo; - END; - IF po.if = NIL THEN - dl := po.list; - WHILE (dl # NIL) & (dl.id # id) DO - dl := dl.next; - END; - IF dl # NIL THEN - discipline := dl.discipline; - ELSE - discipline := NIL; - END; - RETURN discipline # NIL - ELSE - RETURN po.if.seek(po, id, discipline) - END; - END Seek; - - (* === interface procedures for PersistentObjects for Object === *) - - PROCEDURE ReadObjectData(stream: Streams.Stream; - object: PersistentObjects.Object) : BOOLEAN; - (* read data and attached disciplines of given object from stream *) - VAR - discipline: Discipline; - count: LONGINT; - BEGIN - (* get number of attached disciplines *) - IF ~NetIO.ReadLongInt(stream, count) THEN - RETURN FALSE; - END; - (* read all disciplines from `stream' and attach them to `object' *) - WHILE count > 0 DO - IF ~PersistentObjects.Read(stream, SYS.VAL(PersistentObjects.Object, discipline)) THEN - RETURN FALSE; - END; - Add(object(Object), discipline); - DEC(count); - END; - RETURN TRUE; - END ReadObjectData; - - PROCEDURE WriteObjectData(stream: Streams.Stream; - object: PersistentObjects.Object) : BOOLEAN; - (* write data and attached disciplines of given object to stream *) - VAR - dl: DisciplineList; - BEGIN - WITH object: Object DO - (* write number of attached disciplines to `stream' *) - IF ~NetIO.WriteLongInt(stream, object.count) THEN - RETURN FALSE; - END; - (* write all attached disciplines to the stream *) - dl := object.list; - WHILE dl # NIL DO - IF ~PersistentObjects.Write(stream, dl.discipline) THEN - RETURN FALSE; - END; - dl := dl.next; - END; - END; - RETURN TRUE; - END WriteObjectData; - - PROCEDURE InternalCreate(VAR obj: PersistentObjects.Object); - VAR - myObject: Object; - BEGIN - CreateObject(myObject); - obj := myObject; - END InternalCreate; + PROCEDURE InternalCreate(VAR obj: PersistentObjects.Object); + VAR + myObject: Object; + BEGIN + CreateObject(myObject); + obj := myObject; + END InternalCreate; BEGIN - unique := 0; + unique := 0; - NEW(objIf); - objIf.read := ReadObjectData; - objIf.write := WriteObjectData; - objIf.create := InternalCreate; - objIf.createAndRead := NIL; - PersistentObjects.RegisterType(objDatatype, objectName, "", objIf); - PersistentObjects.RegisterType(discDatatype, disciplineName, "", NIL); + NEW(objIf); + objIf.read := ReadObjectData; + objIf.write := WriteObjectData; + objIf.create := InternalCreate; + objIf.createAndRead := NIL; + PersistentObjects.RegisterType(objDatatype, objectName, "", objIf); + PersistentObjects.RegisterType(discDatatype, disciplineName, "", NIL); - volDiscID := Disciplines.Unique(); + volDiscID := Disciplines.Unique(); - Forwarders.Register("", Forward); + Forwarders.Register("", Forward); END ulmPersistentDisciplines. diff --git a/src/library/ulm/ulmPersistentObjects.Mod b/src/library/ulm/ulmPersistentObjects.Mod index 3f82e089..c64b4fc0 100644 --- a/src/library/ulm/ulmPersistentObjects.Mod +++ b/src/library/ulm/ulmPersistentObjects.Mod @@ -1,1079 +1,1086 @@ (* Ulm's Oberon Library - Copyright (C) 1989-1994 by University of Ulm, SAI, D-89069 Ulm, Germany - ---------------------------------------------------------------------------- - Ulm's Oberon Library is free software; you can redistribute it - and/or modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either version - 2 of the License, or (at your option) any later version. + Copyright (C) 1989-1994 by University of Ulm, SAI, D-89069 Ulm, Germany + ---------------------------------------------------------------------------- + Ulm's Oberon Library is free software; you can redistribute it + and/or modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either version + 2 of the License, or (at your option) any later version. - Ulm's Oberon Library is distributed in the hope that it will be - useful, but WITHOUT ANY WARRANTY; without even the implied warranty - of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. + Ulm's Oberon Library is distributed in the hope that it will be + useful, but WITHOUT ANY WARRANTY; without even the implied warranty + of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - ---------------------------------------------------------------------------- - E-mail contact: oberon@mathematik.uni-ulm.de - ---------------------------------------------------------------------------- - $Id: PersistentO.om,v 1.8 2004/03/30 13:14:16 borchert Exp $ - ---------------------------------------------------------------------------- - $Log: PersistentO.om,v $ - Revision 1.8 2004/03/30 13:14:16 borchert - introduced more elaborate error events for cannotReadData + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + ---------------------------------------------------------------------------- + E-mail contact: oberon@mathematik.uni-ulm.de + ---------------------------------------------------------------------------- + $Id: PersistentO.om,v 1.8 2004/03/30 13:14:16 borchert Exp $ + ---------------------------------------------------------------------------- + $Log: PersistentO.om,v $ + Revision 1.8 2004/03/30 13:14:16 borchert + introduced more elaborate error events for cannotReadData - Revision 1.7 1998/04/09 16:55:48 borchert - bug fix: ReadTypeInfo failed on hierarchical mode if none of the - types were known by returning TRUE with type set to NIL + Revision 1.7 1998/04/09 16:55:48 borchert + bug fix: ReadTypeInfo failed on hierarchical mode if none of the + types were known by returning TRUE with type set to NIL - Revision 1.6 1998/03/24 22:42:28 borchert - improvements: - - it is now acceptable that read and write if procedures are given - but neither create nor createAndRead -- this is fine for - abstractions that maintain some components - - Read operates now immediately on the given object to support - LinearizedStructures -- otherwise it would be nearly impossible - to reconstruct self-referential data structures; - note that this is *not supported* by GuardedRead + Revision 1.6 1998/03/24 22:42:28 borchert + improvements: + - it is now acceptable that read and write if procedures are given + but neither create nor createAndRead -- this is fine for + abstractions that maintain some components + - Read operates now immediately on the given object to support + LinearizedStructures -- otherwise it would be nearly impossible + to reconstruct self-referential data structures; + note that this is *not supported* by GuardedRead - Revision 1.5 1995/04/04 12:36:39 borchert - major redesign of PersistentObjects: - - new type encoding schemes - - size if proc removed - - support for NIL and guards added + Revision 1.5 1995/04/04 12:36:39 borchert + major redesign of PersistentObjects: + - new type encoding schemes + - size if proc removed + - support for NIL and guards added - Revision 1.4 1994/07/18 14:19:13 borchert - bug fix: SizeOf used uninitialized variable (name) and added the - length of all type names of the hierarchy to the sum + Revision 1.4 1994/07/18 14:19:13 borchert + bug fix: SizeOf used uninitialized variable (name) and added the + length of all type names of the hierarchy to the sum - Revision 1.3 1994/07/05 08:47:26 borchert - bug fix: modifications due to last bug fix didn't work correctly in - in all cases - code cleaned up at several locations + Revision 1.3 1994/07/05 08:47:26 borchert + bug fix: modifications due to last bug fix didn't work correctly in + in all cases + code cleaned up at several locations - Revision 1.2 1994/03/25 15:54:09 borchert - bug fix: the complete type hierarchy together with all abstract types - was written -- this caused a NIL-procedure to be called in - case of projections. Now, we write shorter type hierarchies and - GetCreate checks the create-procedure against NIL + Revision 1.2 1994/03/25 15:54:09 borchert + bug fix: the complete type hierarchy together with all abstract types + was written -- this caused a NIL-procedure to be called in + case of projections. Now, we write shorter type hierarchies and + GetCreate checks the create-procedure against NIL - Revision 1.1 1994/02/22 20:09:21 borchert - Initial revision + Revision 1.1 1994/02/22 20:09:21 borchert + Initial revision - ---------------------------------------------------------------------------- - DB 7/93 - ---------------------------------------------------------------------------- + ---------------------------------------------------------------------------- + DB 7/93 + ---------------------------------------------------------------------------- *) MODULE ulmPersistentObjects; - (* handling of persistent objects *) + (* handling of persistent objects *) - IMPORT ASCII := ulmASCII, ConstStrings := ulmConstStrings, Disciplines := ulmDisciplines, Errors := ulmErrors, Events := ulmEvents, Forwarders := ulmForwarders, - IndirectDisciplines := ulmIndirectDisciplines, Loader := ulmLoader, NetIO := ulmNetIO, Objects := ulmObjects, Priorities := ulmPriorities, - RelatedEvents := ulmRelatedEvents, Services := ulmServices, StreamDisciplines := ulmStreamDisciplines, Streams := ulmStreams, Strings := ulmStrings, Texts := ulmTexts, SYS := SYSTEM; + IMPORT ASCII := ulmASCII, ConstStrings := ulmConstStrings, Disciplines := ulmDisciplines, Errors := ulmErrors, Events := ulmEvents, Forwarders := ulmForwarders, + IndirectDisciplines := ulmIndirectDisciplines, Loader := ulmLoader, NetIO := ulmNetIO, Objects := ulmObjects, Priorities := ulmPriorities, + RelatedEvents := ulmRelatedEvents, Services := ulmServices, StreamDisciplines := ulmStreamDisciplines, Streams := ulmStreams, Strings := ulmStrings, Texts := ulmTexts, SYS := SYSTEM; - CONST - maxNameLen = 128; (* max length of data type names *) - TYPE - TypeName = ARRAY maxNameLen OF CHAR; (* for temporary use only *) - ShortTypeName = ARRAY 32 OF CHAR; (* for error messages only *) + CONST + maxNameLen = 128; (* max length of data type names *) + TYPE + TypeName = ARRAY maxNameLen OF CHAR; (* for temporary use only *) + ShortTypeName = ARRAY 32 OF CHAR; (* for error messages only *) - CONST - cannotReadData* = 0; - cannotWriteData* = 1; - cannotReadType* = 2; - cannotWriteType* = 3; - invalidType* = 4; - unknownType* = 5; - otherTypeHier* = 6; - eofReached* = 7; - cannotSkip* = 8; - typeGuardFailure* = 9; (* GuardedRead failed to type guard failure *) - errorcodes* = 10; (* number of error codes *) + CONST + cannotReadData* = 0; + cannotWriteData* = 1; + cannotReadType* = 2; + cannotWriteType* = 3; + invalidType* = 4; + unknownType* = 5; + otherTypeHier* = 6; + eofReached* = 7; + cannotSkip* = 8; + typeGuardFailure* = 9; (* GuardedRead failed to type guard failure *) + errorcodes* = 10; (* number of error codes *) - (* how are types specified: fullTypeName, typeCode, incrTypeCode - with or without size info: withSize, withoutSize - with or without type hier: withHier, withoutHier + (* how are types specified: fullTypeName, typeCode, incrTypeCode + with or without size info: withSize, withoutSize + with or without type hier: withHier, withoutHier - combinations are given as additions, - e.g. typeCode + withSize + withHier - *) - fullTypeName* = 1; typeCode* = 2; incrTypeCode* = 3; - withSize* = 4; withoutSize* = 0; - withHier* = 8; withoutHier* = 0; + combinations are given as additions, + e.g. typeCode + withSize + withHier + *) + fullTypeName* = 1; typeCode* = 2; incrTypeCode* = 3; + withSize* = 4; withoutSize* = 0; + withHier* = 8; withoutHier* = 0; - defaultMode = fullTypeName + withSize + withHier; - (* provide all informations on default *) + defaultMode = fullTypeName + withSize + withHier; + (* provide all informations on default *) - (* forms: - type spec: codeF | incrF | nameF | incrhierF | hierF - size spec: sizeF | noSizeF - add specs, eg. codeF + sizeF - *) - codeF = 1; (* just a type code *) - incrF = 2; (* type name + code given *) - nameF = 3; (* type name given *) - incrhierF = 4; (* type hierarchy with codes *) - hierF = 5; (* type hierarchy without codes *) - sizeF = 8; (* size information given *) - noSizeF = 0; (* no size information given *) - maskF = 8; - maxF = 13; (* maximal valid form code *) + (* forms: + type spec: codeF | incrF | nameF | incrhierF | hierF + size spec: sizeF | noSizeF + add specs, eg. codeF + sizeF + *) + codeF = 1; (* just a type code *) + incrF = 2; (* type name + code given *) + nameF = 3; (* type name given *) + incrhierF = 4; (* type hierarchy with codes *) + hierF = 5; (* type hierarchy without codes *) + sizeF = 8; (* size information given *) + noSizeF = 0; (* no size information given *) + maskF = 8; + maxF = 13; (* maximal valid form code *) - TYPE - Mode* = SHORTINT; - Form = SHORTINT; + TYPE + Mode* = SHORTINT; + Form = SHORTINT; - Object* = POINTER TO ObjectRec; - Type = POINTER TO TypeRec; + Object* = POINTER TO ObjectRec; + Type = POINTER TO TypeRec; - ReadProc* = PROCEDURE (s: Streams.Stream; o: Object) : BOOLEAN; - WriteProc* = PROCEDURE (s: Streams.Stream; o: Object) : BOOLEAN; - CreateProc* = PROCEDURE (VAR o: Object); - CreateAndReadProc* = PROCEDURE (s: Streams.Stream; - create: BOOLEAN; - VAR o: Object) : BOOLEAN; + ReadProc* = PROCEDURE (s: Streams.Stream; o: Object) : BOOLEAN; + WriteProc* = PROCEDURE (s: Streams.Stream; o: Object) : BOOLEAN; + CreateProc* = PROCEDURE (VAR o: Object); + CreateAndReadProc* = PROCEDURE (s: Streams.Stream; + create: BOOLEAN; + VAR o: Object) : BOOLEAN; - Interface* = POINTER TO InterfaceRec; - InterfaceRec* = - RECORD - (Objects.ObjectRec) - create*: CreateProc; (* create object *) - read*: ReadProc; (* read data from stream *) - write*: WriteProc; (* write data to stream *) - createAndRead*: CreateAndReadProc; (* replaces create & read *) - END; + Interface* = POINTER TO InterfaceRec; + InterfaceRec* = + RECORD + (Objects.ObjectRec) + create*: CreateProc; (* create object *) + read*: ReadProc; (* read data from stream *) + write*: WriteProc; (* write data to stream *) + createAndRead*: CreateAndReadProc; (* replaces create & read *) + END; - ObjectRec* = - RECORD - (Services.ObjectRec) - (* private data *) - type: Type; - projected: BOOLEAN; (* set after Read *) - END; + ObjectRec* = + RECORD + (Services.ObjectRec) + (* private data *) + type: Type; + projected: BOOLEAN; (* set after Read *) + END; - CONST - ttlen = 16; - TYPE - TypeEntry = POINTER TO TypeEntryRec; - TypeEntryRec = - RECORD - code: LONGINT; - type: Type; - next: TypeEntry; - END; - TypeTable = ARRAY ttlen OF TypeEntry; - StreamDiscipline = POINTER TO StreamDisciplineRec; - StreamDisciplineRec = - RECORD - (Disciplines.DisciplineRec) - mode: Mode; (* type encoding mode for the stream *) - rtypes, wtypes: TypeTable; - END; + CONST + ttlen = 16; + TYPE + TypeEntry = POINTER TO TypeEntryRec; + TypeEntryRec = + RECORD + code: LONGINT; + type: Type; + next: TypeEntry; + END; + TypeTable = ARRAY ttlen OF TypeEntry; + StreamDiscipline = POINTER TO StreamDisciplineRec; + StreamDisciplineRec = + RECORD + (Disciplines.DisciplineRec) + mode: Mode; (* type encoding mode for the stream *) + rtypes, wtypes: TypeTable; + END; - InterfaceList = POINTER TO InterfaceListRec; - InterfaceListRec = - RECORD - if: Interface; - next: InterfaceList; (* points to next extension *) - END; - TypeRec = - RECORD - (Services.TypeRec) - baseType: Type; (* the next non-abstract base type *) - if: Interface; (* may be = NIL for abstract types *) - ifs: InterfaceList; (* list of interfaces in reverse order *) - code: LONGINT; (* unique number *) - END; + InterfaceList = POINTER TO InterfaceListRec; + InterfaceListRec = + RECORD + if: Interface; + next: InterfaceList; (* points to next extension *) + END; + TypeRec = + RECORD + (Services.TypeRec) + baseType: Type; (* the next non-abstract base type *) + if: Interface; (* may be = NIL for abstract types *) + ifs: InterfaceList; (* list of interfaces in reverse order *) + code: LONGINT; (* unique number *) + END; - (* this list is used for storing the base type list of an object during - reading this object - *) - BaseTypeList = POINTER TO BaseTypeRec; - BaseTypeRec = - RECORD - name: ConstStrings.String; (* name of the base type *) - next: BaseTypeList; - END; + (* this list is used for storing the base type list of an object during + reading this object + *) + BaseTypeList = POINTER TO BaseTypeRec; + BaseTypeRec = + RECORD + name: ConstStrings.String; (* name of the base type *) + next: BaseTypeList; + END; - (* each error causes an event; the error number is stored in - event.errorcode; the associated text can be taken from event.message - *) - ErrorCode = SHORTINT; - Event = POINTER TO EventRec; - EventRec* = - RECORD - (Events.EventRec) - stream*: Streams.Stream; - errorcode*: ErrorCode; - END; - UnknownTypeEvent = POINTER TO UnknownTypeEventRec; - UnknownTypeEventRec = - RECORD - (EventRec) - typeName: ARRAY 80 OF CHAR; - END; - DecodeFailureEvent = POINTER TO DecodeFailureEventRec; - DecodeFailureEventRec = - RECORD - (EventRec) - objectType: Services.Type; - END; - TypeGuardFailureEvent = POINTER TO TypeGuardFailureEventRec; - TypeGuardFailureEventRec = - RECORD - (EventRec) - found, expected: Services.Type; - END; + (* each error causes an event; the error number is stored in + event.errorcode; the associated text can be taken from event.message + *) + ErrorCode = SHORTINT; + Event = POINTER TO EventRec; + EventRec* = + RECORD + (Events.EventRec) + stream*: Streams.Stream; + errorcode*: ErrorCode; + END; + UnknownTypeEvent = POINTER TO UnknownTypeEventRec; + UnknownTypeEventRec = + RECORD + (EventRec) + typeName: ARRAY 80 OF CHAR; + END; + DecodeFailureEvent = POINTER TO DecodeFailureEventRec; + DecodeFailureEventRec = + RECORD + (EventRec) + objectType: Services.Type; + END; + TypeGuardFailureEvent = POINTER TO TypeGuardFailureEventRec; + TypeGuardFailureEventRec = + RECORD + (EventRec) + found, expected: Services.Type; + END; - VAR - id: Disciplines.Identifier; - nextTypeCode: LONGINT; (* for the generation of unique numbers *) - potype: Services.Type; + VAR + id: Disciplines.Identifier; + nextTypeCode: LONGINT; (* for the generation of unique numbers *) + potype: Services.Type; - errormsg*: ARRAY errorcodes OF Events.Message; - (* readable text for error codes *) - error*: Events.EventType; - (* raised on failed stream operations; ignored by default *) + errormsg*: ARRAY errorcodes OF Events.Message; + (* readable text for error codes *) + error*: Events.EventType; + (* raised on failed stream operations; ignored by default *) - (* ===== for internal use only ========================================== *) + (* ===== for internal use only ========================================== *) - PROCEDURE Error(stream: Streams.Stream; code: ErrorCode); - (* raise an error event with the error code `code' *) + PROCEDURE Error(stream: Streams.Stream; code: ErrorCode); + (* raise an error event with the error code `code' *) + VAR + event: Event; + BEGIN + stream.count := 0; + NEW(event); + event.type := error; + event.message := errormsg[code]; + event.stream := stream; + event.errorcode := code; + RelatedEvents.Raise(stream, event); + END Error; + + PROCEDURE UnknownType(stream: Streams.Stream; typeName: ARRAY OF CHAR); + VAR + event: UnknownTypeEvent; + BEGIN + stream.count := 0; + NEW(event); + event.type := error; + event.message := errormsg[unknownType]; + event.stream := stream; + event.errorcode := unknownType; + COPY(typeName, event.typeName); + RelatedEvents.Raise(stream, event); + END UnknownType; + + PROCEDURE TypeGuardFailure(stream: Streams.Stream; + found, expected: Services.Type); + VAR + event: TypeGuardFailureEvent; + BEGIN + stream.count := 0; + NEW(event); + event.type := error; + event.message := errormsg[typeGuardFailure]; + event.stream := stream; + event.errorcode := typeGuardFailure; + event.found := found; + event.expected := expected; + RelatedEvents.Raise(stream, event); + END TypeGuardFailure; + + PROCEDURE WriteEvent(s: Streams.Stream; event: Events.Event); + + VAR + typename: ARRAY 128 OF CHAR; + + PROCEDURE WriteString(s: Streams.Stream; + string: ARRAY OF CHAR) : BOOLEAN; + BEGIN + RETURN Streams.WritePart(s, string, 0, Strings.Len(string)) + END WriteString; + + PROCEDURE WriteLn(s: Streams.Stream) : BOOLEAN; VAR - event: Event; - BEGIN - stream.count := 0; + lineterm: StreamDisciplines.LineTerminator; + width: INTEGER; + BEGIN + StreamDisciplines.GetLineTerm(s, lineterm); + IF ~WriteString(s, lineterm) THEN RETURN FALSE END; + StreamDisciplines.GetIndentationWidth(s, width); + WHILE width > 0 DO + IF ~Streams.WriteByte(s, " ") THEN RETURN FALSE END; + DEC(width); + END; + RETURN TRUE + END WriteLn; + + PROCEDURE WriteType(s: Streams.Stream; + type: Services.Type) : BOOLEAN; + VAR + name: TypeName; + BEGIN + Services.GetTypeName(type, name); + RETURN Streams.WriteByte(s, ASCII.quote) & + WriteString(s, name) & + Streams.WriteByte(s, ASCII.quote) + END WriteType; + + BEGIN + IF event IS UnknownTypeEvent THEN + WITH event: UnknownTypeEvent DO + IF WriteString(s, event.message) & + WriteString(s, ": ") & + Streams.WriteByte(s, ASCII.quote) & + WriteString(s, event.typeName) & + Streams.WriteByte(s, ASCII.quote) THEN + END; + END; + ELSIF event IS TypeGuardFailureEvent THEN + WITH event: TypeGuardFailureEvent DO + IF WriteString(s, event.message) & + WriteString(s, ":") & + WriteLn(s) & + WriteString(s, "expected extension of ") & + WriteType(s, event.expected) & + WriteString(s, " but got ") & + WriteType(s, event.found) THEN + END; + END; + ELSIF event IS DecodeFailureEvent THEN + WITH event: DecodeFailureEvent DO + Services.GetTypeName(event.objectType, typename); + IF WriteString(s, event.message) & + WriteString(s, ":") & + WriteLn(s) & + WriteString(s, "unable to parse object of type ") & + Streams.WriteByte(s, ASCII.quote) & + WriteString(s, typename) & + Streams.WriteByte(s, ASCII.quote) THEN + END; + END; + ELSE + IF WriteString(s, event.message) THEN END; + END; + END WriteEvent; + + PROCEDURE InitErrorHandling; + BEGIN + errormsg[cannotReadData] := "cannot read data part of persistent object"; + errormsg[cannotWriteData] := "cannot write data part of persistent object"; + errormsg[cannotReadType] := "cannot read type of persistent object"; + errormsg[cannotWriteType] := "cannot write type of persistent object"; + errormsg[invalidType] := "invalid type form read"; + errormsg[unknownType] := "unknown type information found"; + errormsg[otherTypeHier] := "different & nonconforming type hierarchy found"; + errormsg[eofReached] := "unexpected EOF encountered during reading"; + errormsg[cannotSkip] := "unable to skip unknown data parts"; + errormsg[typeGuardFailure] := "read object is of unexpected type"; + + Events.Define(error); + Events.SetPriority(error, Priorities.liberrors); + Events.Ignore(error); + Errors.AssignWriteProcedure(error, WriteEvent); + END InitErrorHandling; + + (* ==== marshalling procedures ======================================== *) + + (* encoding scheme: + + Object = Form Type Size ObjectInfo . + Form = SHORTINT; + Type = Code (* codeF *) | + Code TypeName (* incrF *) | + TypeName (* nameF *) | + Code TypeName { Code TypeName } 0 (* incrhierF *) | + TypeName { TypeName } 0X (* hierF *) . + Size = (* noSizeF *) | + Size (* sizeF *) . (* size of object info in bytes *) + ObjectInfo = { Byte } . + *) + + PROCEDURE DecodeForm(form: Form; + VAR nameGiven, codeGiven, hier, size: BOOLEAN); + VAR + typeform: SHORTINT; + sizeform: SHORTINT; + BEGIN + typeform := form MOD maskF; sizeform := form DIV maskF; + nameGiven := typeform IN {incrF, nameF, hierF, incrhierF}; + codeGiven := typeform IN {codeF, incrF, incrhierF}; + hier := (typeform = incrhierF) OR (typeform = hierF); + size := (sizeform = sizeF); + END DecodeForm; + + PROCEDURE GetModule(name: ARRAY OF CHAR; VAR module: ARRAY OF CHAR); + (* get the name of the module where 'name' was defined *) + VAR + index: INTEGER; + BEGIN + index := 0; + WHILE (name[index] # ".") & (name[index] # 0X) & + (index < LEN(module)-1) DO + module[index] := name[index]; INC(index); + END; + module[index] := 0X; + END GetModule; + + PROCEDURE Failure(s: Streams.Stream; code: ErrorCode); + BEGIN + IF s.eof THEN + Error(s, eofReached); + ELSE + Error(s, code); + END; + END Failure; + + PROCEDURE DecodeFailure(s: Streams.Stream; type: Services.Type); + VAR + event: DecodeFailureEvent; + BEGIN + IF s.eof THEN + Error(s, eofReached); + ELSE NEW(event); event.type := error; - event.message := errormsg[code]; - event.stream := stream; - event.errorcode := code; - RelatedEvents.Raise(stream, event); - END Error; + event.message := errormsg[cannotReadData]; + event.stream := s; + event.errorcode := cannotReadData; + event.objectType := type; + RelatedEvents.Raise(s, event); + END; + END DecodeFailure; - PROCEDURE UnknownType(stream: Streams.Stream; typeName: ARRAY OF CHAR); + PROCEDURE GetStreamDisc(s: Streams.Stream; VAR disc: StreamDiscipline); + VAR d: IndirectDisciplines.Discipline; + BEGIN + IF IndirectDisciplines.Seek(s, id, d) THEN + disc := d(StreamDiscipline) + ELSE + NEW(disc); disc.id := id; disc.mode := defaultMode; + IndirectDisciplines.Add(s, disc); + END; + END GetStreamDisc; + + PROCEDURE ReadTypeInfo(s: Streams.Stream; VAR type: Type; + VAR projection: BOOLEAN; + VAR size: Streams.Count) : BOOLEAN; + VAR + form: Form; + btype: Type; + nameGiven, codeGiven, hier, sizeGiven: BOOLEAN; + disc: StreamDiscipline; + sentinelFound, unknownTypeFound: BOOLEAN; + lastType: Type; + + PROCEDURE ReadType(s: Streams.Stream; VAR type: Type; + VAR sentinelFound, unknownTypeFound: BOOLEAN) : BOOLEAN; VAR - event: UnknownTypeEvent; - BEGIN - stream.count := 0; - NEW(event); - event.type := error; - event.message := errormsg[unknownType]; - event.stream := stream; - event.errorcode := unknownType; - COPY(typeName, event.typeName); - RelatedEvents.Raise(stream, event); - END UnknownType; + code: LONGINT; + entry: TypeEntry; + typeName: TypeName; + btype: Type; - PROCEDURE TypeGuardFailure(stream: Streams.Stream; - found, expected: Services.Type); - VAR - event: TypeGuardFailureEvent; - BEGIN - stream.count := 0; - NEW(event); - event.type := error; - event.message := errormsg[typeGuardFailure]; - event.stream := stream; - event.errorcode := typeGuardFailure; - event.found := found; - event.expected := expected; - RelatedEvents.Raise(stream, event); - END TypeGuardFailure; - - PROCEDURE WriteEvent(s: Streams.Stream; event: Events.Event); - - VAR - typename: ARRAY 128 OF CHAR; - - PROCEDURE WriteString(s: Streams.Stream; - string: ARRAY OF CHAR) : BOOLEAN; + PROCEDURE SeekType(typeName: ARRAY OF CHAR; + VAR type: Type) : BOOLEAN; + VAR + t: Services.Type; + module: TypeName; BEGIN - RETURN Streams.WritePart(s, string, 0, Strings.Len(string)) - END WriteString; + Services.SeekType(typeName, t); + IF t = NIL THEN + GetModule(typeName, module); + IF Loader.Load(module, s) THEN + (* maybe the type is now registered *) + Services.SeekType(typeName, t); + END; + END; + IF (t # NIL) & (t IS Type) THEN + type := t(Type); RETURN TRUE + END; + RETURN FALSE + END SeekType; - PROCEDURE WriteLn(s: Streams.Stream) : BOOLEAN; - VAR - lineterm: StreamDisciplines.LineTerminator; - width: INTEGER; - BEGIN - StreamDisciplines.GetLineTerm(s, lineterm); - IF ~WriteString(s, lineterm) THEN RETURN FALSE END; - StreamDisciplines.GetIndentationWidth(s, width); - WHILE width > 0 DO - IF ~Streams.WriteByte(s, " ") THEN RETURN FALSE END; - DEC(width); - END; - RETURN TRUE - END WriteLn; - - PROCEDURE WriteType(s: Streams.Stream; - type: Services.Type) : BOOLEAN; - VAR - name: TypeName; - BEGIN - Services.GetTypeName(type, name); - RETURN Streams.WriteByte(s, ASCII.quote) & - WriteString(s, name) & - Streams.WriteByte(s, ASCII.quote) - END WriteType; - - BEGIN - IF event IS UnknownTypeEvent THEN - WITH event: UnknownTypeEvent DO - IF WriteString(s, event.message) & - WriteString(s, ": ") & - Streams.WriteByte(s, ASCII.quote) & - WriteString(s, event.typeName) & - Streams.WriteByte(s, ASCII.quote) THEN - END; - END; - ELSIF event IS TypeGuardFailureEvent THEN - WITH event: TypeGuardFailureEvent DO - IF WriteString(s, event.message) & - WriteString(s, ":") & - WriteLn(s) & - WriteString(s, "expected extension of ") & - WriteType(s, event.expected) & - WriteString(s, " but got ") & - WriteType(s, event.found) THEN - END; - END; - ELSIF event IS DecodeFailureEvent THEN - WITH event: DecodeFailureEvent DO - Services.GetTypeName(event.objectType, typename); - IF WriteString(s, event.message) & - WriteString(s, ":") & - WriteLn(s) & - WriteString(s, "unable to parse object of type ") & - Streams.WriteByte(s, ASCII.quote) & - WriteString(s, typename) & - Streams.WriteByte(s, ASCII.quote) THEN - END; - END; - ELSE - IF WriteString(s, event.message) THEN END; - END; - END WriteEvent; - - PROCEDURE InitErrorHandling; - BEGIN - errormsg[cannotReadData] := "cannot read data part of persistent object"; - errormsg[cannotWriteData] := "cannot write data part of persistent object"; - errormsg[cannotReadType] := "cannot read type of persistent object"; - errormsg[cannotWriteType] := "cannot write type of persistent object"; - errormsg[invalidType] := "invalid type form read"; - errormsg[unknownType] := "unknown type information found"; - errormsg[otherTypeHier] := "different & nonconforming type hierarchy found"; - errormsg[eofReached] := "unexpected EOF encountered during reading"; - errormsg[cannotSkip] := "unable to skip unknown data parts"; - errormsg[typeGuardFailure] := "read object is of unexpected type"; - - Events.Define(error); - Events.SetPriority(error, Priorities.liberrors); - Events.Ignore(error); - Errors.AssignWriteProcedure(error, WriteEvent); - END InitErrorHandling; - - (* ==== marshalling procedures ======================================== *) - - (* encoding scheme: - - Object = Form Type Size ObjectInfo . - Form = SHORTINT; - Type = Code (* codeF *) | - Code TypeName (* incrF *) | - TypeName (* nameF *) | - Code TypeName { Code TypeName } 0 (* incrhierF *) | - TypeName { TypeName } 0X (* hierF *) . - Size = (* noSizeF *) | - Size (* sizeF *) . (* size of object info in bytes *) - ObjectInfo = { Byte } . - *) - - PROCEDURE DecodeForm(form: Form; - VAR nameGiven, codeGiven, hier, size: BOOLEAN); - VAR - typeform: SHORTINT; - sizeform: SHORTINT; - BEGIN - typeform := form MOD maskF; sizeform := form DIV maskF; - nameGiven := typeform IN {incrF, nameF, hierF, incrhierF}; - codeGiven := typeform IN {codeF, incrF, incrhierF}; - hier := (typeform = incrhierF) OR (typeform = hierF); - size := (sizeform = sizeF); - END DecodeForm; - - PROCEDURE GetModule(name: ARRAY OF CHAR; VAR module: ARRAY OF CHAR); - (* get the name of the module where 'name' was defined *) - VAR - index: INTEGER; - BEGIN - index := 0; - WHILE (name[index] # ".") & (name[index] # 0X) & - (index < LEN(module)-1) DO - module[index] := name[index]; INC(index); - END; - module[index] := 0X; - END GetModule; - - PROCEDURE Failure(s: Streams.Stream; code: ErrorCode); - BEGIN - IF s.eof THEN - Error(s, eofReached); - ELSE - Error(s, code); - END; - END Failure; - - PROCEDURE DecodeFailure(s: Streams.Stream; type: Services.Type); - VAR - event: DecodeFailureEvent; - BEGIN - IF s.eof THEN - Error(s, eofReached); - ELSE - NEW(event); - event.type := error; - event.message := errormsg[cannotReadData]; - event.stream := s; - event.errorcode := cannotReadData; - event.objectType := type; - RelatedEvents.Raise(s, event); - END; - END DecodeFailure; - - PROCEDURE GetStreamDisc(s: Streams.Stream; VAR disc: StreamDiscipline); - BEGIN - IF ~IndirectDisciplines.Seek(s, id, SYS.VAL(IndirectDisciplines.Discipline, disc)) THEN - NEW(disc); disc.id := id; disc.mode := defaultMode; - IndirectDisciplines.Add(s, disc); - END; - END GetStreamDisc; - - PROCEDURE ReadTypeInfo(s: Streams.Stream; VAR type: Type; - VAR projection: BOOLEAN; - VAR size: Streams.Count) : BOOLEAN; - VAR - form: Form; - btype: Type; - nameGiven, codeGiven, hier, sizeGiven: BOOLEAN; - disc: StreamDiscipline; - sentinelFound, unknownTypeFound: BOOLEAN; - lastType: Type; - - PROCEDURE ReadType(s: Streams.Stream; VAR type: Type; - VAR sentinelFound, unknownTypeFound: BOOLEAN) : BOOLEAN; - VAR - code: LONGINT; - entry: TypeEntry; - typeName: TypeName; - btype: Type; - - PROCEDURE SeekType(typeName: ARRAY OF CHAR; - VAR type: Type) : BOOLEAN; - VAR - t: Services.Type; - module: TypeName; - BEGIN - Services.SeekType(typeName, t); - IF t = NIL THEN - GetModule(typeName, module); - IF Loader.Load(module, s) THEN - (* maybe the type is now registered *) - Services.SeekType(typeName, t); - END; - END; - IF (t # NIL) & (t IS Type) THEN - type := t(Type); RETURN TRUE - END; - RETURN FALSE - END SeekType; - - BEGIN (* ReadType *) - sentinelFound := FALSE; unknownTypeFound := FALSE; - type := NIL; - IF codeGiven THEN - IF ~NetIO.ReadLongInt(s, code) THEN - Failure(s, cannotReadType); RETURN FALSE - END; - IF code = 0 THEN sentinelFound := TRUE; RETURN FALSE END; - entry := disc.rtypes[code MOD ttlen]; - WHILE (entry # NIL) & (entry.code # code) DO - entry := entry.next; - END; - IF entry # NIL THEN - type := entry.type; - END; - IF (entry = NIL) & ~nameGiven THEN - Failure(s, unknownType); unknownTypeFound := TRUE; RETURN FALSE - END; - END; - IF nameGiven THEN - IF ~NetIO.ReadString(s, typeName) THEN - Failure(s, cannotReadType); RETURN FALSE - END; - IF typeName[0] = 0X THEN sentinelFound := TRUE; RETURN FALSE END; - IF (type = NIL) & ~SeekType(typeName, type) THEN - UnknownType(s, typeName); unknownTypeFound := TRUE; RETURN FALSE - END; - END; - IF codeGiven & (entry = NIL) THEN - NEW(entry); - entry.code := code; - entry.type := type; - entry.next := disc.rtypes[code MOD ttlen]; - disc.rtypes[code MOD ttlen] := entry; - END; - RETURN TRUE - END ReadType; - - BEGIN (* ReadTypeInfo *) - (* read & check form of type info *) - IF ~NetIO.ReadShortInt(s, form) THEN - Failure(s, cannotReadType); RETURN FALSE - END; - IF (form <= 0) OR (form > maxF) THEN - Failure(s, invalidType); RETURN FALSE - END; - DecodeForm(form, nameGiven, codeGiven, hier, sizeGiven); + BEGIN (* ReadType *) + sentinelFound := FALSE; unknownTypeFound := FALSE; + type := NIL; IF codeGiven THEN - GetStreamDisc(s, disc); + IF ~NetIO.ReadLongInt(s, code) THEN + Failure(s, cannotReadType); RETURN FALSE + END; + IF code = 0 THEN sentinelFound := TRUE; RETURN FALSE END; + entry := disc.rtypes[code MOD ttlen]; + WHILE (entry # NIL) & (entry.code # code) DO + entry := entry.next; + END; + IF entry # NIL THEN + type := entry.type; + END; + IF (entry = NIL) & ~nameGiven THEN + Failure(s, unknownType); unknownTypeFound := TRUE; RETURN FALSE + END; END; - - (* read first type information *) - IF ~ReadType(s, type, sentinelFound, unknownTypeFound) & ~hier THEN - RETURN FALSE + IF nameGiven THEN + IF ~NetIO.ReadString(s, typeName) THEN + Failure(s, cannotReadType); RETURN FALSE + END; + IF typeName[0] = 0X THEN sentinelFound := TRUE; RETURN FALSE END; + IF (type = NIL) & ~SeekType(typeName, type) THEN + UnknownType(s, typeName); unknownTypeFound := TRUE; RETURN FALSE + END; END; - - (* read type hierarchy, if any *) - projection := FALSE; - IF hier THEN - IF sentinelFound THEN - Failure(s, invalidType); RETURN FALSE - END; - lastType := type; - LOOP (* until type hierarchy is read *) - IF ReadType(s, btype, sentinelFound, unknownTypeFound) THEN - IF (lastType # NIL) & (lastType.baseType # btype) THEN - Failure(s, otherTypeHier); RETURN FALSE - END; - IF type = NIL THEN - projection := TRUE; - type := btype; - END; - lastType := btype; - ELSIF sentinelFound THEN - EXIT - ELSIF unknownTypeFound THEN - IF lastType # NIL THEN - Failure(s, otherTypeHier); RETURN FALSE - END; - ELSE - RETURN FALSE - END; - END; - IF type = NIL THEN - (* error events already generated by ReadType *) - RETURN FALSE - END; - END; - - (* read size information, if any *) - IF sizeGiven THEN - IF ~NetIO.ReadLongInt(s, size) THEN - Failure(s, cannotReadType); RETURN FALSE - END; - IF size < 0 THEN - Failure(s, invalidType); RETURN FALSE - END; - ELSE - size := -1; + IF codeGiven & (entry = NIL) THEN + NEW(entry); + entry.code := code; + entry.type := type; + entry.next := disc.rtypes[code MOD ttlen]; + disc.rtypes[code MOD ttlen] := entry; END; RETURN TRUE - END ReadTypeInfo; + END ReadType; - PROCEDURE ReadData(s: Streams.Stream; VAR object: Object) : BOOLEAN; - (* use the interface list to read all data in the right order *) + BEGIN (* ReadTypeInfo *) + (* read & check form of type info *) + IF ~NetIO.ReadShortInt(s, form) THEN + Failure(s, cannotReadType); RETURN FALSE + END; + IF (form <= 0) OR (form > maxF) THEN + Failure(s, invalidType); RETURN FALSE + END; + DecodeForm(form, nameGiven, codeGiven, hier, sizeGiven); + IF codeGiven THEN + GetStreamDisc(s, disc); + END; + + (* read first type information *) + IF ~ReadType(s, type, sentinelFound, unknownTypeFound) & ~hier THEN + RETURN FALSE + END; + + (* read type hierarchy, if any *) + projection := FALSE; + IF hier THEN + IF sentinelFound THEN + Failure(s, invalidType); RETURN FALSE + END; + lastType := type; + LOOP (* until type hierarchy is read *) + IF ReadType(s, btype, sentinelFound, unknownTypeFound) THEN + IF (lastType # NIL) & (lastType.baseType # btype) THEN + Failure(s, otherTypeHier); RETURN FALSE + END; + IF type = NIL THEN + projection := TRUE; + type := btype; + END; + lastType := btype; + ELSIF sentinelFound THEN + EXIT + ELSIF unknownTypeFound THEN + IF lastType # NIL THEN + Failure(s, otherTypeHier); RETURN FALSE + END; + ELSE + RETURN FALSE + END; + END; + IF type = NIL THEN + (* error events already generated by ReadType *) + RETURN FALSE + END; + END; + + (* read size information, if any *) + IF sizeGiven THEN + IF ~NetIO.ReadLongInt(s, size) THEN + Failure(s, cannotReadType); RETURN FALSE + END; + IF size < 0 THEN + Failure(s, invalidType); RETURN FALSE + END; + ELSE + size := -1; + END; + RETURN TRUE + END ReadTypeInfo; + + PROCEDURE ReadData(s: Streams.Stream; VAR object: Object) : BOOLEAN; + (* use the interface list to read all data in the right order *) + VAR + ifList: InterfaceList; + BEGIN + ifList := object.type.ifs; + WHILE ifList # NIL DO + IF ~ifList.if.read(s, object) THEN + (* error handling is done by the calling procedure *) + RETURN FALSE + END; + ifList := ifList.next; + END; + RETURN (object.type.if.read = NIL) OR object.type.if.read(s, object) + END ReadData; + + PROCEDURE EncodeForm(s: Streams.Stream; type: Type; VAR form: Form); + VAR + mode: Mode; + disc: IndirectDisciplines.Discipline; + hier: BOOLEAN; + + PROCEDURE KnownType() : BOOLEAN; VAR - ifList: InterfaceList; - BEGIN - ifList := object.type.ifs; - WHILE ifList # NIL DO - IF ~ifList.if.read(s, object) THEN - (* error handling is done by the calling procedure *) - RETURN FALSE - END; - ifList := ifList.next; + p: TypeEntry; + BEGIN + p := disc(StreamDiscipline).wtypes[type.code MOD ttlen]; + WHILE (p # NIL) & (p.type # type) DO + p := p.next; END; - RETURN (object.type.if.read = NIL) OR object.type.if.read(s, object) - END ReadData; + RETURN p # NIL + END KnownType; - PROCEDURE EncodeForm(s: Streams.Stream; type: Type; VAR form: Form); + BEGIN + IF ~IndirectDisciplines.Seek(s, id, disc) THEN + mode := defaultMode; disc := NIL; + ELSE + mode := disc(StreamDiscipline).mode; + END; + form := 0; + hier := mode DIV 8 MOD 2 > 0; + CASE mode MOD 4 OF + | fullTypeName: IF hier THEN form := hierF ELSE form := nameF END; + | typeCode: form := codeF; ASSERT(~hier); + | incrTypeCode: IF KnownType() THEN + form := codeF; + ELSIF hier THEN + form := incrhierF; + ELSE + form := incrF; + END; + ELSE + END; + IF mode DIV 4 MOD 2 > 0 THEN + INC(form, sizeF); + ELSE + INC(form, noSizeF); + END; + END EncodeForm; + + PROCEDURE WriteTypeInfo(s: Streams.Stream; type: Type; + VAR giveSize: BOOLEAN) : BOOLEAN; + (* write type information without size *) + VAR + form: Form; + giveName, giveCode, hier: BOOLEAN; + mode: Mode; incr: BOOLEAN; + disc: IndirectDisciplines.Discipline; + btype: Type; + + PROCEDURE WriteType(s: Streams.Stream; type: Type) : BOOLEAN; VAR - mode: Mode; - disc: StreamDiscipline; - hier: BOOLEAN; - - PROCEDURE KnownType() : BOOLEAN; - VAR - p: TypeEntry; - BEGIN - p := disc.wtypes[type.code MOD ttlen]; - WHILE (p # NIL) & (p.type # type) DO - p := p.next; - END; - RETURN p # NIL - END KnownType; - - BEGIN - IF ~IndirectDisciplines.Seek(s, id, SYS.VAL(IndirectDisciplines.Discipline, disc)) THEN - mode := defaultMode; disc := NIL; - ELSE - mode := disc.mode; + typeName: TypeName; + entry: TypeEntry; + BEGIN + IF giveCode THEN + IF ~NetIO.WriteLongInt(s, type.code) THEN + Error(s, cannotWriteType); RETURN FALSE + END; END; - form := 0; - hier := mode DIV 8 MOD 2 > 0; - CASE mode MOD 4 OF - | fullTypeName: IF hier THEN form := hierF ELSE form := nameF END; - | typeCode: form := codeF; ASSERT(~hier); - | incrTypeCode: IF KnownType() THEN - form := codeF; - ELSIF hier THEN - form := incrhierF; - ELSE - form := incrF; - END; - ELSE + IF giveName THEN + Services.GetTypeName(type, typeName); + IF ~NetIO.WriteString(s, typeName) THEN + Error(s, cannotWriteType); RETURN FALSE + END; END; - IF mode DIV 4 MOD 2 > 0 THEN - INC(form, sizeF); - ELSE - INC(form, noSizeF); + IF incr THEN + NEW(entry); entry.type := type; entry.code := type.code; + entry.next := disc(StreamDiscipline).wtypes[type.code MOD ttlen]; + disc(StreamDiscipline).wtypes[type.code MOD ttlen] := entry; END; - END EncodeForm; - - PROCEDURE WriteTypeInfo(s: Streams.Stream; type: Type; - VAR giveSize: BOOLEAN) : BOOLEAN; - (* write type information without size *) - VAR - form: Form; - giveName, giveCode, hier: BOOLEAN; - mode: Mode; incr: BOOLEAN; - disc: StreamDiscipline; - btype: Type; - - PROCEDURE WriteType(s: Streams.Stream; type: Type) : BOOLEAN; - VAR - typeName: TypeName; - entry: TypeEntry; - BEGIN - IF giveCode THEN - IF ~NetIO.WriteLongInt(s, type.code) THEN - Error(s, cannotWriteType); RETURN FALSE - END; - END; - IF giveName THEN - Services.GetTypeName(type, typeName); - IF ~NetIO.WriteString(s, typeName) THEN - Error(s, cannotWriteType); RETURN FALSE - END; - END; - IF incr THEN - NEW(entry); entry.type := type; entry.code := type.code; - entry.next := disc.wtypes[type.code MOD ttlen]; - disc.wtypes[type.code MOD ttlen] := entry; - END; - RETURN TRUE - END WriteType; - - BEGIN (* WriteTypeInfo *) - EncodeForm(s, type, form); - IF ~NetIO.WriteShortInt(s, form) THEN - Error(s, cannotWriteType); - END; - DecodeForm(form, giveName, giveCode, hier, giveSize); - IF ~IndirectDisciplines.Seek(s, id, SYS.VAL(IndirectDisciplines.Discipline, disc)) THEN - mode := defaultMode; - END; - incr := giveName & giveCode; - - IF ~WriteType(s, type) THEN RETURN FALSE END; - - IF hier THEN - btype := type.baseType; - WHILE btype # NIL DO - IF ~WriteType(s, btype) THEN RETURN FALSE END; - btype := btype.baseType; - END; - (* write sentinel *) - IF giveCode THEN - IF ~NetIO.WriteLongInt(s, 0) THEN - Error(s, cannotWriteType); - RETURN FALSE - END; - ELSE - IF ~NetIO.WriteString(s, "") THEN - Error(s, cannotWriteType); - RETURN FALSE - END; - END; - END; - RETURN TRUE - END WriteTypeInfo; + END WriteType; - PROCEDURE WriteData(s: Streams.Stream; object: Object) : BOOLEAN; - (* use the interface list to write all data in the right order *) - VAR - ifList: InterfaceList; - BEGIN - ifList := object.type.ifs; - WHILE ifList # NIL DO - IF ~ifList.if.write(s, object) THEN - (* error handling is done by the calling procedure *) - RETURN FALSE - END; - ifList := ifList.next; + BEGIN (* WriteTypeInfo *) + EncodeForm(s, type, form); + IF ~NetIO.WriteShortInt(s, form) THEN + Error(s, cannotWriteType); + END; + DecodeForm(form, giveName, giveCode, hier, giveSize); + IF ~IndirectDisciplines.Seek(s, id, disc) THEN + mode := defaultMode; + END; + incr := giveName & giveCode; + + IF ~WriteType(s, type) THEN RETURN FALSE END; + + IF hier THEN + btype := type.baseType; + WHILE btype # NIL DO + IF ~WriteType(s, btype) THEN RETURN FALSE END; + btype := btype.baseType; END; - RETURN (object.type.if.write = NIL) OR object.type.if.write(s, object) - END WriteData; - - (* ===== exported procedures ============================================ *) - - PROCEDURE RegisterType*(VAR type: Services.Type; - name, baseName: ARRAY OF CHAR; - if: Interface); - VAR - newtype: Type; - baseType: Services.Type; - member: InterfaceList; - bt: Type; - ifval: INTEGER; - BEGIN - (* check the parameters *) - ASSERT(name[0] # 0X); - IF if # NIL THEN - ifval := 0; - IF if.create # NIL THEN INC(ifval, 1) END; - IF if.read # NIL THEN INC(ifval, 2) END; - IF if.write # NIL THEN INC(ifval, 4) END; - IF if.createAndRead # NIL THEN INC(ifval, 8) END; - (* legal variants: - - if = NIL abstract data type - - create read write createAndRead - #NIL NIL NIL NIL 1 empty data type - NIL #NIL #NIL NIL 6 abstract data type - #NIL #NIL #NIL NIL 7 normal case - NIL NIL #NIL #NIL 12 special case - - note that the special case must not be given as base type! - *) - ASSERT(ifval IN {1, 6, 7, 12}); - END; - - (* create type and determine next non-abstract base type *) - NEW(newtype); - newtype.code := nextTypeCode; INC(nextTypeCode); - newtype.if := if; - IF baseName = "" THEN - Services.InitType(newtype, name, "PersistentObjects.Object"); + (* write sentinel *) + IF giveCode THEN + IF ~NetIO.WriteLongInt(s, 0) THEN + Error(s, cannotWriteType); + RETURN FALSE + END; ELSE - Services.InitType(newtype, name, baseName); + IF ~NetIO.WriteString(s, "") THEN + Error(s, cannotWriteType); + RETURN FALSE + END; END; - IF baseName = "" THEN - newtype.baseType := NIL; - ELSE - Services.GetBaseType(newtype, baseType); - ASSERT((baseType # NIL) & (baseType IS Type)); - WHILE (baseType # NIL) & (baseType IS Type) & - (baseType(Type).if = NIL) DO - Services.GetBaseType(baseType, baseType); - END; - IF (baseType = NIL) OR ~(baseType IS Type) THEN - newtype.baseType := NIL; - ELSE - newtype.baseType := baseType(Type); - ASSERT(newtype.baseType.if.createAndRead = NIL); - END; + END; + + RETURN TRUE + END WriteTypeInfo; + + PROCEDURE WriteData(s: Streams.Stream; object: Object) : BOOLEAN; + (* use the interface list to write all data in the right order *) + VAR + ifList: InterfaceList; + BEGIN + ifList := object.type.ifs; + WHILE ifList # NIL DO + IF ~ifList.if.write(s, object) THEN + (* error handling is done by the calling procedure *) + RETURN FALSE END; + ifList := ifList.next; + END; + RETURN (object.type.if.write = NIL) OR object.type.if.write(s, object) + END WriteData; - (* build up list of interfaces *) - newtype.ifs := NIL; bt := newtype.baseType; - WHILE bt # NIL DO - NEW(member); member.if := bt.if; - member.next := newtype.ifs; newtype.ifs := member; - bt := bt.baseType; - END; + (* ===== exported procedures ============================================ *) - type := newtype; - END RegisterType; + PROCEDURE RegisterType*(VAR type: Services.Type; + name, baseName: ARRAY OF CHAR; + if: Interface); + VAR + newtype: Type; + baseType: Services.Type; + member: InterfaceList; + bt: Type; + ifval: INTEGER; + BEGIN + (* check the parameters *) + ASSERT(name[0] # 0X); + IF if # NIL THEN + ifval := 0; + IF if.create # NIL THEN INC(ifval, 1) END; + IF if.read # NIL THEN INC(ifval, 2) END; + IF if.write # NIL THEN INC(ifval, 4) END; + IF if.createAndRead # NIL THEN INC(ifval, 8) END; + (* legal variants: - PROCEDURE Init*(object: Object; type: Services.Type); - BEGIN - ASSERT(type IS Type); - WITH type: Type DO - ASSERT((type.if.create # NIL) OR (type.if.createAndRead # NIL)); - object.type := type; - object.projected := FALSE; - Services.Init(object, type); - END; - END Init; + if = NIL abstract data type - PROCEDURE SetMode*(s: Streams.Stream; mode: Mode); - VAR - disc: StreamDiscipline; - BEGIN - IF ~Disciplines.Seek(s, id, SYS.VAL(Disciplines.Discipline, disc)) THEN - NEW(disc); disc.id := id; - END; - disc.mode := mode; - Disciplines.Add(s, disc); - END SetMode; + create read write createAndRead + #NIL NIL NIL NIL 1 empty data type + NIL #NIL #NIL NIL 6 abstract data type + #NIL #NIL #NIL NIL 7 normal case + NIL NIL #NIL #NIL 12 special case - PROCEDURE GetMode*(s: Streams.Stream; VAR mode: Mode); - (* return the current mode for the given stream *) - VAR - disc: StreamDiscipline; - BEGIN - IF Disciplines.Seek(s, id, SYS.VAL(Disciplines.Discipline, disc)) THEN - mode := disc.mode; - ELSE - mode := defaultMode; - END; - END GetMode; - - PROCEDURE IsProjected*(object: Object) : BOOLEAN; - (* show whether the object was a victim of projection or not *) - BEGIN - RETURN object.projected - END IsProjected; - - PROCEDURE InternalRead(s: Streams.Stream; create: BOOLEAN; - VAR object: Object) : BOOLEAN; - (* read `object' from `s'; - note that we have to operate on `object' directly because - LinearizedStructures relies on this in case of cyclic - references + note that the special case must not be given as base type! *) - VAR - streamCaps: Streams.CapabilitySet; - type, objectType: Type; - projection: BOOLEAN; (* necessary due to unknown types? *) - size: Streams.Count; (* size information, if unknown it equals -1 *) - skipUnknownParts: BOOLEAN; (* are we able to skip data if necessary? *) + ASSERT(ifval IN {1, 6, 7, 12}); + END; - (* these vars are used for skipping unknown data areas *) - oldPos, newPos: Streams.Count; - textbuf: Texts.Text; - - BEGIN (* InternalRead *) - IF ~ReadTypeInfo(s, type, projection, size) THEN RETURN FALSE END; - IF ~create & (type.if.createAndRead = NIL) THEN - (* projection necessary due to target object? *) - Services.GetType(object, SYS.VAL(Services.Type, objectType)); - IF ~Services.IsExtensionOf(type, objectType) THEN - TypeGuardFailure(s, type, objectType); RETURN FALSE - END; - projection := projection OR (type # objectType); + (* create type and determine next non-abstract base type *) + NEW(newtype); + newtype.code := nextTypeCode; INC(nextTypeCode); + newtype.if := if; + IF baseName = "" THEN + Services.InitType(newtype, name, "PersistentObjects.Object"); + ELSE + Services.InitType(newtype, name, baseName); + END; + IF baseName = "" THEN + newtype.baseType := NIL; + ELSE + Services.GetBaseType(newtype, baseType); + ASSERT((baseType # NIL) & (baseType IS Type)); + WHILE (baseType # NIL) & (baseType IS Type) & + (baseType(Type).if = NIL) DO + Services.GetBaseType(baseType, baseType); END; - skipUnknownParts := projection & (size > 0); + IF (baseType = NIL) OR ~(baseType IS Type) THEN + newtype.baseType := NIL; + ELSE + newtype.baseType := baseType(Type); + ASSERT(newtype.baseType.if.createAndRead = NIL); + END; + END; + + (* build up list of interfaces *) + newtype.ifs := NIL; bt := newtype.baseType; + WHILE bt # NIL DO + NEW(member); member.if := bt.if; + member.next := newtype.ifs; newtype.ifs := member; + bt := bt.baseType; + END; + + type := newtype; + END RegisterType; + + PROCEDURE Init*(object: Object; type: Services.Type); + BEGIN + ASSERT(type IS Type); + WITH type: Type DO + ASSERT((type.if.create # NIL) OR (type.if.createAndRead # NIL)); + object.type := type; + object.projected := FALSE; + Services.Init(object, type); + END; + END Init; + + PROCEDURE SetMode*(s: Streams.Stream; mode: Mode); + VAR + disc: StreamDiscipline; + d: Disciplines.Discipline; + BEGIN + IF Disciplines.Seek(s, id, d) THEN + disc := d(StreamDiscipline) + ELSE + NEW(disc); disc.id := id; + END; + disc.mode := mode; + Disciplines.Add(s, disc); + END SetMode; + + PROCEDURE GetMode*(s: Streams.Stream; VAR mode: Mode); + (* return the current mode for the given stream *) + VAR + disc: Disciplines.Discipline; + BEGIN + IF Disciplines.Seek(s, id, disc) THEN + mode := disc(StreamDiscipline).mode; + ELSE + mode := defaultMode; + END; + END GetMode; + + PROCEDURE IsProjected*(object: Object) : BOOLEAN; + (* show whether the object was a victim of projection or not *) + BEGIN + RETURN object.projected + END IsProjected; + + PROCEDURE InternalRead(s: Streams.Stream; create: BOOLEAN; + VAR object: Object) : BOOLEAN; + (* read `object' from `s'; + note that we have to operate on `object' directly because + LinearizedStructures relies on this in case of cyclic + references + *) + VAR + streamCaps: Streams.CapabilitySet; + type: Type; + objectType: Services.Type; + projection: BOOLEAN; (* necessary due to unknown types? *) + size: Streams.Count; (* size information, if unknown it equals -1 *) + skipUnknownParts: BOOLEAN; (* are we able to skip data if necessary? *) + + (* these vars are used for skipping unknown data areas *) + oldPos, newPos: Streams.Count; + textbuf: Texts.Text; + + BEGIN (* InternalRead *) + IF ~ReadTypeInfo(s, type, projection, size) THEN RETURN FALSE END; + IF ~create & (type.if.createAndRead = NIL) THEN + (* projection necessary due to target object? *) + Services.GetType(object, objectType); + IF ~Services.IsExtensionOf(type, objectType) THEN + TypeGuardFailure(s, type, objectType); RETURN FALSE + END; + projection := projection OR (type # objectType); + END; + skipUnknownParts := projection & (size > 0); + streamCaps := Streams.Capabilities(s); + IF skipUnknownParts THEN + IF Streams.tell IN streamCaps THEN + Streams.GetPos(s, oldPos); + ELSE + Texts.Open(SYS.VAL(Streams.Stream, textbuf)); + IF ~Streams.Copy(s, textbuf, size) THEN + Failure(s, cannotReadData); RETURN FALSE + END; + Forwarders.Forward(textbuf, s); + RelatedEvents.Forward(textbuf, s); + s := textbuf; + skipUnknownParts := FALSE; + END; + END; + + IF type.if.createAndRead # NIL THEN + IF ~type.if.createAndRead(s, create, object) THEN + DecodeFailure(s, type); object := NIL; RETURN FALSE + END; + ELSE + IF create THEN + type.if.create(object); + END; + IF ~ReadData(s, object) THEN + DecodeFailure(s, type); + object := NIL; + RETURN FALSE + END; + END; + + (* store information about projection into object *) + object.projected := projection; + + IF skipUnknownParts THEN + IF Streams.seek IN streamCaps THEN + Streams.SetPos(s, oldPos + size); + ELSE + Streams.GetPos(s, newPos); + IF ~Streams.Copy(s, Streams.null, size - newPos + oldPos) THEN + Failure(s, cannotSkip); RETURN FALSE + END; + END; + ELSIF projection & (size < 0) THEN + Error(s, cannotSkip); RETURN FALSE + END; + + s.count := 1; (* show success *) + RETURN TRUE + END InternalRead; + + PROCEDURE Read*(s: Streams.Stream; VAR object: Object) : BOOLEAN; + (* read `object' from `s'; object # NIL on success *) + BEGIN + RETURN InternalRead(s, (* create = *) TRUE, object) + END Read; + + PROCEDURE ReadInto*(s: Streams.Stream; object: Object) : BOOLEAN; + (* read an object from `s' and assign it to `object'; + this fails if `object' doesn't has the IDENTICAL type + (thus projections are not supported here) + *) + BEGIN + RETURN InternalRead(s, (* create = *) FALSE, object) + END ReadInto; + + PROCEDURE GuardedRead*(s: Streams.Stream; guard: Services.Type; + VAR object: Object) : BOOLEAN; + (* read an object from `s' and return it, provided + the type of the read object is an extension of `guard' + *) + VAR + testObject: Object; + type: Services.Type; + BEGIN + IF ~Read(s, testObject) THEN RETURN FALSE END; + Services.GetType(testObject, type); + IF Services.IsExtensionOf(type, guard) THEN + object := testObject; RETURN TRUE + ELSE + TypeGuardFailure(s, type, guard); + RETURN FALSE + END; + END GuardedRead; + + PROCEDURE Write*(s: Streams.Stream; object: Object) : BOOLEAN; + (* write `obj' to `s' *) + VAR + giveSize: BOOLEAN; + streamCaps: Streams.CapabilitySet; + patchSize: BOOLEAN; + sizePos, beginPos, endPos: Streams.Count; + textbuf, origStream: Streams.Stream; + mode: Mode; + BEGIN + IF ~WriteTypeInfo(s, object.type, giveSize) THEN RETURN FALSE END; + IF giveSize THEN streamCaps := Streams.Capabilities(s); - IF skipUnknownParts THEN - IF Streams.tell IN streamCaps THEN - Streams.GetPos(s, oldPos); - ELSE - Texts.Open(SYS.VAL(Streams.Stream, textbuf)); - IF ~Streams.Copy(s, textbuf, size) THEN - Failure(s, cannotReadData); RETURN FALSE - END; - Forwarders.Forward(textbuf, s); - RelatedEvents.Forward(textbuf, s); - s := textbuf; - skipUnknownParts := FALSE; - END; - END; - - IF type.if.createAndRead # NIL THEN - IF ~type.if.createAndRead(s, create, object) THEN - DecodeFailure(s, type); object := NIL; RETURN FALSE - END; + patchSize := ({Streams.tell, Streams.seek} - streamCaps = {}) & + Streams.Tell(s, sizePos); + IF patchSize THEN + IF ~NetIO.WriteLongInt(s, 0) THEN + Error(s, cannotWriteData); RETURN FALSE + END; + Streams.GetPos(s, beginPos); ELSE - IF create THEN - type.if.create(object); - END; - IF ~ReadData(s, object) THEN - DecodeFailure(s, type); - object := NIL; - RETURN FALSE - END; + Texts.Open(textbuf); + Forwarders.Forward(textbuf, s); + RelatedEvents.Forward(textbuf, s); + GetMode(s, mode); SetMode(textbuf, mode); + origStream := s; s := textbuf; END; + END; - (* store information about projection into object *) - object.projected := projection; - - IF skipUnknownParts THEN - IF Streams.seek IN streamCaps THEN - Streams.SetPos(s, oldPos + size); - ELSE - Streams.GetPos(s, newPos); - IF ~Streams.Copy(s, Streams.null, size - newPos + oldPos) THEN - Failure(s, cannotSkip); RETURN FALSE - END; - END; - ELSIF projection & (size < 0) THEN - Error(s, cannotSkip); RETURN FALSE + IF object.type.if.createAndRead # NIL THEN + IF ~object.type.if.write(s, object) THEN + Error(s, cannotWriteData); RETURN FALSE END; + ELSE + IF ~WriteData(s, object) THEN + Error(s, cannotWriteData); RETURN FALSE + END; + END; - s.count := 1; (* show success *) - RETURN TRUE - END InternalRead; - - PROCEDURE Read*(s: Streams.Stream; VAR object: Object) : BOOLEAN; - (* read `object' from `s'; object # NIL on success *) - BEGIN - RETURN InternalRead(s, (* create = *) TRUE, object) - END Read; - - PROCEDURE ReadInto*(s: Streams.Stream; object: Object) : BOOLEAN; - (* read an object from `s' and assign it to `object'; - this fails if `object' doesn't has the IDENTICAL type - (thus projections are not supported here) - *) - BEGIN - RETURN InternalRead(s, (* create = *) FALSE, object) - END ReadInto; - - PROCEDURE GuardedRead*(s: Streams.Stream; guard: Services.Type; - VAR object: Object) : BOOLEAN; - (* read an object from `s' and return it, provided - the type of the read object is an extension of `guard' - *) - VAR - testObject: Object; - type: Services.Type; - BEGIN - IF ~Read(s, testObject) THEN RETURN FALSE END; - Services.GetType(testObject, type); - IF Services.IsExtensionOf(type, guard) THEN - object := testObject; RETURN TRUE + IF giveSize THEN + IF patchSize THEN + Streams.GetPos(s, endPos); + Streams.SetPos(s, sizePos); + IF ~NetIO.WriteLongInt(s, endPos - beginPos) THEN + Streams.SetPos(s, endPos); + Error(s, cannotWriteData); + RETURN FALSE + END; + Streams.SetPos(s, endPos); ELSE - TypeGuardFailure(s, type, guard); - RETURN FALSE + Streams.GetPos(textbuf, endPos); + Streams.SetPos(textbuf, 0); + s := origStream; + IF ~NetIO.WriteLongInt(s, endPos) OR + ~Streams.Copy(textbuf, s, endPos) THEN + Error(s, cannotWriteData); + END; END; - END GuardedRead; + END; + s.count := 1; + RETURN TRUE + END Write; - PROCEDURE Write*(s: Streams.Stream; object: Object) : BOOLEAN; - (* write `obj' to `s' *) - VAR - giveSize: BOOLEAN; - streamCaps: Streams.CapabilitySet; - patchSize: BOOLEAN; - sizePos, beginPos, endPos: Streams.Count; - textbuf, origStream: Streams.Stream; - mode: Mode; - BEGIN - IF ~WriteTypeInfo(s, object.type, giveSize) THEN RETURN FALSE END; - IF giveSize THEN - streamCaps := Streams.Capabilities(s); - patchSize := ({Streams.tell, Streams.seek} - streamCaps = {}) & - Streams.Tell(s, sizePos); - IF patchSize THEN - IF ~NetIO.WriteLongInt(s, 0) THEN - Error(s, cannotWriteData); RETURN FALSE - END; - Streams.GetPos(s, beginPos); - ELSE - Texts.Open(textbuf); - Forwarders.Forward(textbuf, s); - RelatedEvents.Forward(textbuf, s); - GetMode(s, mode); SetMode(textbuf, mode); - origStream := s; s := textbuf; - END; - END; + PROCEDURE ReadObjectOrNIL*(s: Streams.Stream; VAR object: Object) : BOOLEAN; + VAR + nil: BOOLEAN; + BEGIN + object := NIL; + RETURN NetIO.ReadBoolean(s, nil) & (nil OR Read(s, object)) + END ReadObjectOrNIL; - IF object.type.if.createAndRead # NIL THEN - IF ~object.type.if.write(s, object) THEN - Error(s, cannotWriteData); RETURN FALSE - END; - ELSE - IF ~WriteData(s, object) THEN - Error(s, cannotWriteData); RETURN FALSE - END; - END; - - IF giveSize THEN - IF patchSize THEN - Streams.GetPos(s, endPos); - Streams.SetPos(s, sizePos); - IF ~NetIO.WriteLongInt(s, endPos - beginPos) THEN - Streams.SetPos(s, endPos); - Error(s, cannotWriteData); - RETURN FALSE - END; - Streams.SetPos(s, endPos); - ELSE - Streams.GetPos(textbuf, endPos); - Streams.SetPos(textbuf, 0); - s := origStream; - IF ~NetIO.WriteLongInt(s, endPos) OR - ~Streams.Copy(textbuf, s, endPos) THEN - Error(s, cannotWriteData); - END; - END; - END; - s.count := 1; - RETURN TRUE - END Write; - - PROCEDURE ReadObjectOrNIL*(s: Streams.Stream; VAR object: Object) : BOOLEAN; - VAR - nil: BOOLEAN; - BEGIN + PROCEDURE GuardedReadObjectOrNIL*(s: Streams.Stream; guard: Services.Type; + VAR object: Object) : BOOLEAN; + (* may be used instead of ReadObjectOrNIL *) + VAR + testObject: Object; + type: Services.Type; + nil: BOOLEAN; + BEGIN + IF ~NetIO.ReadBoolean(s, nil) THEN RETURN FALSE END; + IF nil THEN object := NIL; - RETURN NetIO.ReadBoolean(s, nil) & (nil OR Read(s, object)) - END ReadObjectOrNIL; + RETURN TRUE + END; + IF ~Read(s, testObject) THEN RETURN FALSE END; + IF testObject = NIL THEN RETURN TRUE END; + Services.GetType(testObject, type); + IF Services.IsExtensionOf(type, guard) THEN + object := testObject; RETURN TRUE + ELSE + TypeGuardFailure(s, type, guard); + RETURN FALSE + END; + END GuardedReadObjectOrNIL; - PROCEDURE GuardedReadObjectOrNIL*(s: Streams.Stream; guard: Services.Type; - VAR object: Object) : BOOLEAN; - (* may be used instead of ReadObjectOrNIL *) - VAR - testObject: Object; - type: Services.Type; - nil: BOOLEAN; - BEGIN - IF ~NetIO.ReadBoolean(s, nil) THEN RETURN FALSE END; - IF nil THEN - object := NIL; - RETURN TRUE - END; - IF ~Read(s, testObject) THEN RETURN FALSE END; - IF testObject = NIL THEN RETURN TRUE END; - Services.GetType(testObject, type); - IF Services.IsExtensionOf(type, guard) THEN - object := testObject; RETURN TRUE - ELSE - TypeGuardFailure(s, type, guard); - RETURN FALSE - END; - END GuardedReadObjectOrNIL; - - PROCEDURE WriteObjectOrNIL*(s: Streams.Stream; object: Object) : BOOLEAN; - VAR - nil: BOOLEAN; - BEGIN - nil := object = NIL; - RETURN NetIO.WriteBoolean(s, nil) & (nil OR Write(s, object)) - END WriteObjectOrNIL; + PROCEDURE WriteObjectOrNIL*(s: Streams.Stream; object: Object) : BOOLEAN; + VAR + nil: BOOLEAN; + BEGIN + nil := object = NIL; + RETURN NetIO.WriteBoolean(s, nil) & (nil OR Write(s, object)) + END WriteObjectOrNIL; BEGIN - id := Disciplines.Unique(); - nextTypeCode := 1; - InitErrorHandling; - Services.CreateType(potype, "PersistentObjects.Object", ""); + id := Disciplines.Unique(); + nextTypeCode := 1; + InitErrorHandling; + Services.CreateType(potype, "PersistentObjects.Object", ""); END ulmPersistentObjects. diff --git a/src/library/ulm/ulmRandomGenerators.Mod b/src/library/ulm/ulmRandomGenerators.Mod index cb63a9a5..f1aa36de 100644 --- a/src/library/ulm/ulmRandomGenerators.Mod +++ b/src/library/ulm/ulmRandomGenerators.Mod @@ -1,419 +1,421 @@ (* Ulm's Oberon Library - Copyright (C) 1989-1994 by University of Ulm, SAI, D-89069 Ulm, Germany - ---------------------------------------------------------------------------- - Ulm's Oberon Library is free software; you can redistribute it - and/or modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either version - 2 of the License, or (at your option) any later version. + Copyright (C) 1989-1994 by University of Ulm, SAI, D-89069 Ulm, Germany + ---------------------------------------------------------------------------- + Ulm's Oberon Library is free software; you can redistribute it + and/or modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either version + 2 of the License, or (at your option) any later version. - Ulm's Oberon Library is distributed in the hope that it will be - useful, but WITHOUT ANY WARRANTY; without even the implied warranty - of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. + Ulm's Oberon Library is distributed in the hope that it will be + useful, but WITHOUT ANY WARRANTY; without even the implied warranty + of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - ---------------------------------------------------------------------------- - E-mail contact: oberon@mathematik.uni-ulm.de - ---------------------------------------------------------------------------- - $Id: RandomGener.om,v 1.9 2004/03/09 21:44:12 borchert Exp $ - ---------------------------------------------------------------------------- - $Log: RandomGener.om,v $ - Revision 1.9 2004/03/09 21:44:12 borchert - unpredictable added to the standard set of PRNGs + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + ---------------------------------------------------------------------------- + E-mail contact: oberon@mathematik.uni-ulm.de + ---------------------------------------------------------------------------- + $Id: RandomGener.om,v 1.9 2004/03/09 21:44:12 borchert Exp $ + ---------------------------------------------------------------------------- + $Log: RandomGener.om,v $ + Revision 1.9 2004/03/09 21:44:12 borchert + unpredictable added to the standard set of PRNGs - Revision 1.8 2004/03/06 07:22:09 borchert - Init asserts that the sequence has been registered at Services + Revision 1.8 2004/03/06 07:22:09 borchert + Init asserts that the sequence has been registered at Services - Revision 1.7 1998/02/14 22:04:09 martin - Missing calls of Services.Init and Services.CreateType added. + Revision 1.7 1998/02/14 22:04:09 martin + Missing calls of Services.Init and Services.CreateType added. - Revision 1.6 1997/10/11 21:22:03 martin - assertion in ValS added, obsolete variable removed + Revision 1.6 1997/10/11 21:22:03 martin + assertion in ValS added, obsolete variable removed - Revision 1.5 1997/10/10 16:26:49 martin - RestartSequence added, range conversions improved, - default implementation replaced. + Revision 1.5 1997/10/10 16:26:49 martin + RestartSequence added, range conversions improved, + default implementation replaced. - Revision 1.4 1997/04/01 16:33:41 borchert - major revision of Random: - - module renamed to RandomGenerators - - abstraction instead of simple implementation (work by Frank Fischer) + Revision 1.4 1997/04/01 16:33:41 borchert + major revision of Random: + - module renamed to RandomGenerators + - abstraction instead of simple implementation (work by Frank Fischer) - Revision 1.3 1994/09/01 18:15:41 borchert - bug fix: avoid arithmetic overflow in ValS + Revision 1.3 1994/09/01 18:15:41 borchert + bug fix: avoid arithmetic overflow in ValS - Revision 1.2 1994/08/30 09:48:00 borchert - sequences added + Revision 1.2 1994/08/30 09:48:00 borchert + sequences added - Revision 1.1 1994/02/23 07:25:30 borchert - Initial revision + Revision 1.1 1994/02/23 07:25:30 borchert + Initial revision - ---------------------------------------------------------------------------- - original implementation by AFB 2/90 - conversion to abstraction by Frank B.J. Fischer 3/97 - ---------------------------------------------------------------------------- + ---------------------------------------------------------------------------- + original implementation by AFB 2/90 + conversion to abstraction by Frank B.J. Fischer 3/97 + ---------------------------------------------------------------------------- *) MODULE ulmRandomGenerators; - (* Anyone who considers arithmetical - methods of producing random digits - is, of course, in a state of sin. - - John von Neumann (1951) - *) + (* Anyone who considers arithmetical + methods of producing random digits + is, of course, in a state of sin. + - John von Neumann (1951) + *) - IMPORT - Clocks := ulmClocks, Disciplines := ulmDisciplines, Objects := ulmObjects, Operations := ulmOperations, Process := ulmProcess, Services := ulmServices, Times := ulmTimes, - Types := ulmTypes, S := SYSTEM; + IMPORT + Clocks := ulmClocks, Disciplines := ulmDisciplines, + Objects := ulmObjects, Operations := ulmOperations, + Process := ulmProcess, Services := ulmServices, + Times := ulmTimes, Types := ulmTypes; - TYPE - Sequence* = POINTER TO SequenceRec; + TYPE + Sequence* = POINTER TO SequenceRec; - Int32ValSProc* = PROCEDURE (sequence: Sequence): Types.Int32; - LongRealValSProc* = PROCEDURE (sequence: Sequence): LONGREAL; - RewindSequenceProc* = PROCEDURE (sequence: Sequence); - RestartSequenceProc* = PROCEDURE (sequence, seed: Sequence); - SetValSProc* = PROCEDURE (sequence: Sequence; value: Operations.Operand); + Int32ValSProc* = PROCEDURE (sequence: Sequence): Types.Int32; + LongRealValSProc* = PROCEDURE (sequence: Sequence): LONGREAL; + RewindSequenceProc* = PROCEDURE (sequence: Sequence); + RestartSequenceProc* = PROCEDURE (sequence, seed: Sequence); + SetValSProc* = PROCEDURE (sequence: Sequence; value: Operations.Operand); - CONST - int32ValS* = 0; longRealValS* = 1; rewindSequence* = 2; restartSequence* = 3; + CONST + int32ValS* = 0; longRealValS* = 1; rewindSequence* = 2; restartSequence* = 3; - TYPE - CapabilitySet* = SET; (* of [int32ValS..restartSequence] *) - Interface* = POINTER TO InterfaceRec; - InterfaceRec* = - RECORD - (Objects.ObjectRec) - int32ValS* : Int32ValSProc; (* at least one of ... *) - longRealValS* : LongRealValSProc; (* ... these required *) - rewindSequence* : RewindSequenceProc; (* optional *) - restartSequence*: RestartSequenceProc; (* optional *) - END; + TYPE + CapabilitySet* = SET; (* of [int32ValS..restartSequence] *) + Interface* = POINTER TO InterfaceRec; + InterfaceRec* = + RECORD + (Objects.ObjectRec) + int32ValS* : Int32ValSProc; (* at least one of ... *) + longRealValS* : LongRealValSProc; (* ... these required *) + rewindSequence* : RewindSequenceProc; (* optional *) + restartSequence*: RestartSequenceProc; (* optional *) + END; - SequenceRec* = - RECORD - (Services.ObjectRec) - (* private components *) - if : Interface; - caps: CapabilitySet; - END; + SequenceRec* = + RECORD + (Services.ObjectRec) + (* private components *) + if : Interface; + caps: CapabilitySet; + END; - VAR - std* : Sequence; (* default sequence *) - seed*: Sequence; (* sequence of seed values *) - unpredictable*: Sequence; - (* reasonably fast sequence of unpredictable values; - is initially NIL - *) + VAR + std* : Sequence; (* default sequence *) + seed*: Sequence; (* sequence of seed values *) + unpredictable*: Sequence; + (* reasonably fast sequence of unpredictable values; + is initially NIL + *) - (* ----- private definitions ----- *) + (* ----- private definitions ----- *) - CONST - modulus1 = 2147483647; (* a Mersenne prime *) - factor1 = 48271; (* passes spectral test *) - quotient1 = modulus1 DIV factor1; (* 44488 *) - remainder1 = modulus1 MOD factor1; (* 3399; must be < quotient1 *) - modulus2 = 2147483399; (* a non-Mersenne prime *) - factor2 = 40692; (* also passes spectral test *) - quotient2 = modulus2 DIV factor2; (* 52774 *) - remainder2 = modulus2 MOD factor2; (* 3791; must be < quotient2 *) + CONST + modulus1 = 2147483647; (* a Mersenne prime *) + factor1 = 48271; (* passes spectral test *) + quotient1 = modulus1 DIV factor1; (* 44488 *) + remainder1 = modulus1 MOD factor1; (* 3399; must be < quotient1 *) + modulus2 = 2147483399; (* a non-Mersenne prime *) + factor2 = 40692; (* also passes spectral test *) + quotient2 = modulus2 DIV factor2; (* 52774 *) + remainder2 = modulus2 MOD factor2; (* 3791; must be < quotient2 *) - TYPE - DefaultSequence = POINTER TO DefaultSequenceRec; - DefaultSequenceRec = - RECORD - (SequenceRec) - seed1, seed2: LONGINT; - value1, value2: LONGINT; - END; + TYPE + DefaultSequence = POINTER TO DefaultSequenceRec; + DefaultSequenceRec = + RECORD + (SequenceRec) + seed1, seed2: LONGINT; + value1, value2: LONGINT; + END; - ServiceDiscipline = POINTER TO ServiceDisciplineRec; - ServiceDisciplineRec = - RECORD - (Disciplines.DisciplineRec) - setValS: SetValSProc; - END; + ServiceDiscipline = POINTER TO ServiceDisciplineRec; + ServiceDisciplineRec = + RECORD + (Disciplines.DisciplineRec) + setValS: SetValSProc; + END; - VAR - service : Services.Service; - serviceDiscID: Disciplines.Identifier; - sequenceType, - defaultSequenceType: Services.Type; + VAR + service : Services.Service; + serviceDiscID: Disciplines.Identifier; + sequenceType, + defaultSequenceType: Services.Type; - (* ----- bug workaround ----- *) + (* ----- bug workaround ----- *) - PROCEDURE Entier(value: LONGREAL): LONGINT; + PROCEDURE Entier(value: LONGREAL): LONGINT; + VAR + result: LONGINT; + BEGIN + result := ENTIER(value); + IF result > value THEN + DEC(result); + END; + RETURN result + END Entier; + + (* ----- exported procedures ----- *) + + PROCEDURE Init*(sequence: Sequence; if: Interface; caps: CapabilitySet); + (* initialize sequence *) + VAR + type: Services.Type; + BEGIN + ASSERT((if.int32ValS # NIL) OR (if.longRealValS # NIL)); + ASSERT(~(int32ValS IN caps) OR (if.int32ValS # NIL)); + ASSERT(~(longRealValS IN caps) OR (if.longRealValS # NIL)); + ASSERT(~(rewindSequence IN caps) OR (if.rewindSequence # NIL)); + Services.GetType(sequence, type); ASSERT(type # NIL); + sequence.if := if; + sequence.caps := caps; + END Init; + + PROCEDURE Capabilities*(sequence: Sequence): CapabilitySet; + (* tell which procedures are implemented *) + BEGIN + RETURN sequence.caps + END Capabilities; + + PROCEDURE RewindSequence*(sequence: Sequence); + (* re-examine sequence *) + BEGIN + ASSERT(rewindSequence IN sequence.caps); + sequence.if.rewindSequence(sequence); + END RewindSequence; + + PROCEDURE RestartSequence*(sequence, seed: Sequence); + (* restart sequence with new seed values *) + BEGIN + ASSERT(restartSequence IN sequence.caps); + sequence.if.restartSequence(sequence, seed); + END RestartSequence; + + PROCEDURE ^ LongRealValS*(sequence: Sequence): LONGREAL; + + PROCEDURE Int32ValS*(sequence: Sequence): Types.Int32; + (* get random 32-bit value from sequence *) + VAR + real: LONGREAL; + BEGIN + IF int32ValS IN sequence.caps THEN + RETURN sequence.if.int32ValS(sequence) + ELSE + real := LongRealValS(sequence); + RETURN SHORT(Entier( (1. - real - real) * MIN(Types.Int32) )) + END; + END Int32ValS; + + PROCEDURE Int32Val*(): Types.Int32; + (* get random 32-bit value from std sequence *) + BEGIN + RETURN Int32ValS(std); + END Int32Val; + + PROCEDURE LongRealValS*(sequence: Sequence): LONGREAL; + (* get a uniformly distributed longreal value in [0..1) *) + BEGIN + IF longRealValS IN sequence.caps THEN + RETURN sequence.if.longRealValS(sequence) + ELSE + RETURN 0.5 + + Int32ValS(sequence) / (0. - MIN(Types.Int32) - MIN(Types.Int32)) + END; + END LongRealValS; + + PROCEDURE LongRealVal*(): LONGREAL; + (* get a uniformly distributed longreal value in [0..1) *) + BEGIN + RETURN LongRealValS(std) + END LongRealVal; + + PROCEDURE RealValS*(sequence: Sequence): REAL; + (* get a uniformly distributed real value in [0..1) *) + BEGIN + RETURN SHORT(LongRealValS(sequence)) + END RealValS; + + PROCEDURE RealVal*(): REAL; + (* get a uniformly distributed real value in [0..1) *) + BEGIN + RETURN SHORT(LongRealValS(std)) + END RealVal; + + PROCEDURE ValS*(sequence: Sequence; low, high: LONGINT): LONGINT; + (* get a uniformly distributed integer in [low..high] *) + BEGIN + ASSERT(low <= high); + RETURN Entier( low + LongRealValS(sequence) * (1. + high - low) ) + END ValS; + + PROCEDURE Val*(low, high: LONGINT): LONGINT; + (* get a uniformly distributed integer in [low..high] *) + BEGIN + RETURN ValS(std, low, high) + END Val; + + PROCEDURE FlipS*(sequence: Sequence): BOOLEAN; + (* return TRUE or FALSE *) + BEGIN + IF int32ValS IN sequence.caps THEN + RETURN sequence.if.int32ValS(sequence) >= 0 + ELSE + RETURN sequence.if.longRealValS(sequence) >= 0.5 + END; + END FlipS; + + PROCEDURE Flip*(): BOOLEAN; + (* return TRUE or FALSE *) + BEGIN + RETURN FlipS(std) + END Flip; + + PROCEDURE Support*(type: Services.Type; setValS: SetValSProc); + (* support service for type *) + VAR + serviceDisc: ServiceDiscipline; + BEGIN + NEW(serviceDisc); + serviceDisc.id := serviceDiscID; + serviceDisc.setValS := setValS; + Disciplines.Add(type, serviceDisc); + Services.Define(type, service, NIL); + END Support; + + PROCEDURE SetValS*(sequence: Sequence; value: Operations.Operand); + (* store random value from sequence into already initialized value *) + VAR + baseType : Services.Type; + serviceDisc: Disciplines.Discipline; (* ServiceDiscipline *) + ok : BOOLEAN; + BEGIN + Services.GetSupportedBaseType(value, service, baseType); + ok := Disciplines.Seek(baseType, serviceDiscID, serviceDisc); + ASSERT(ok); + serviceDisc(ServiceDiscipline).setValS(sequence, value); + END SetValS; + + PROCEDURE SetVal*(value: Operations.Operand); + (* store random value from std sequence into already initialized value *) + BEGIN + SetValS(std, value); + END SetVal; + + (* ----- DefaultSequence ----- *) + + PROCEDURE CongruentialStep(VAR value1, value2: LONGINT); + BEGIN + value1 := + factor1 * (value1 MOD quotient1) - remainder1 * (value1 DIV quotient1); + IF value1 < 0 THEN + INC(value1, modulus1); + END; + value2 := + factor2 * (value2 MOD quotient2) - remainder2 * (value2 DIV quotient2); + IF value2 < 0 THEN + INC(value2, modulus2); + END; + END CongruentialStep; + + PROCEDURE DefaultSequenceValue(sequence: Sequence): LONGREAL; + VAR + value: LONGINT; + BEGIN + WITH sequence: DefaultSequence DO + CongruentialStep(sequence.value1, sequence.value2); + value := sequence.value1 - sequence.value2; + IF value <= 0 THEN + INC(value, modulus1); + END; + RETURN (value - 1.) / (modulus1 - 1.) + END; + END DefaultSequenceValue; + + PROCEDURE DefaultSequenceRewind(sequence: Sequence); + BEGIN + WITH sequence: DefaultSequence DO + sequence.value1 := sequence.seed1; + sequence.value2 := sequence.seed2; + END; + END DefaultSequenceRewind; + + PROCEDURE DefaultSequenceRestart(sequence, seed: Sequence); + BEGIN + WITH sequence: DefaultSequence DO + sequence.seed1 := ValS(seed, 1, modulus1-1); + sequence.seed2 := ValS(seed, 1, modulus2-1); + sequence.value1 := sequence.seed1; + sequence.value2 := sequence.seed2; + END; + END DefaultSequenceRestart; + + PROCEDURE CreateDefaultSequences; + VAR + mySeed, myStd: DefaultSequence; + if: Interface; + daytime: Times.Time; + timeval: Times.TimeValueRec; + count: LONGINT; + + PROCEDURE Hash(str: ARRAY OF CHAR): LONGINT; VAR - result: LONGINT; - BEGIN - result := ENTIER(value); - IF result > value THEN - DEC(result); - END; - RETURN result - END Entier; + index, + val: LONGINT; + BEGIN + val := 27567352; + index := 0; + WHILE str[index] # 0X DO + val := (val MOD 16777216) * 128 + + (val DIV 16777216 + ORD(str[index])) MOD 128; + INC(index); + END; (*WHILE*) + RETURN val + END Hash; - (* ----- exported procedures ----- *) + BEGIN + (* define interface for all default sequences *) + NEW(if); + if.longRealValS := DefaultSequenceValue; + if.rewindSequence := DefaultSequenceRewind; + if.restartSequence := DefaultSequenceRestart; - PROCEDURE Init*(sequence: Sequence; if: Interface; caps: CapabilitySet); - (* initialize sequence *) - VAR - type: Services.Type; - BEGIN - ASSERT((if.int32ValS # NIL) OR (if.longRealValS # NIL)); - ASSERT(~(int32ValS IN caps) OR (if.int32ValS # NIL)); - ASSERT(~(longRealValS IN caps) OR (if.longRealValS # NIL)); - ASSERT(~(rewindSequence IN caps) OR (if.rewindSequence # NIL)); - Services.GetType(sequence, type); ASSERT(type # NIL); - sequence.if := if; - sequence.caps := caps; - END Init; + (* fake initial randomness using some portably accessible sources *) + NEW(mySeed); + Services.Init(mySeed, defaultSequenceType); + Init(mySeed, if, {longRealValS}); + Clocks.GetTime(Clocks.system, daytime); + Times.GetValue(daytime, timeval); + (* extract those 31 bits from daytime that are most likely to vary *) + mySeed.value1 := timeval.usec * 2048 + timeval.second MOD 65536 + 1; + (* generate 31 more bits from the process name *) + mySeed.value2 := Hash(Process.name) MOD (modulus2 - 1) + 1; + (* scramble these values *) + count := 0; + WHILE count < 4 DO + CongruentialStep(mySeed.value1, mySeed.value2); + INC(count); + END; + (* mix them together *) + DefaultSequenceRestart(mySeed, mySeed); + seed := mySeed; - PROCEDURE Capabilities*(sequence: Sequence): CapabilitySet; - (* tell which procedures are implemented *) - BEGIN - RETURN sequence.caps - END Capabilities; + (* now use our seed to initialize std sequence *) + NEW(myStd); + Services.Init(myStd, defaultSequenceType); + Init(myStd, if, {longRealValS, rewindSequence, restartSequence}); + DefaultSequenceRestart(myStd, mySeed); + std := myStd; - PROCEDURE RewindSequence*(sequence: Sequence); - (* re-examine sequence *) - BEGIN - ASSERT(rewindSequence IN sequence.caps); - sequence.if.rewindSequence(sequence); - END RewindSequence; - - PROCEDURE RestartSequence*(sequence, seed: Sequence); - (* restart sequence with new seed values *) - BEGIN - ASSERT(restartSequence IN sequence.caps); - sequence.if.restartSequence(sequence, seed); - END RestartSequence; - - PROCEDURE ^ LongRealValS*(sequence: Sequence): LONGREAL; - - PROCEDURE Int32ValS*(sequence: Sequence): Types.Int32; - (* get random 32-bit value from sequence *) - VAR - real: LONGREAL; - BEGIN - IF int32ValS IN sequence.caps THEN - RETURN sequence.if.int32ValS(sequence) - ELSE - real := LongRealValS(sequence); - RETURN SHORT(Entier( (1. - real - real) * MIN(Types.Int32) )) - END; - END Int32ValS; - - PROCEDURE Int32Val*(): Types.Int32; - (* get random 32-bit value from std sequence *) - BEGIN - RETURN Int32ValS(std); - END Int32Val; - - PROCEDURE LongRealValS*(sequence: Sequence): LONGREAL; - (* get a uniformly distributed longreal value in [0..1) *) - BEGIN - IF longRealValS IN sequence.caps THEN - RETURN sequence.if.longRealValS(sequence) - ELSE - RETURN 0.5 + - Int32ValS(sequence) / (0. - MIN(Types.Int32) - MIN(Types.Int32)) - END; - END LongRealValS; - - PROCEDURE LongRealVal*(): LONGREAL; - (* get a uniformly distributed longreal value in [0..1) *) - BEGIN - RETURN LongRealValS(std) - END LongRealVal; - - PROCEDURE RealValS*(sequence: Sequence): REAL; - (* get a uniformly distributed real value in [0..1) *) - BEGIN - RETURN SHORT(LongRealValS(sequence)) - END RealValS; - - PROCEDURE RealVal*(): REAL; - (* get a uniformly distributed real value in [0..1) *) - BEGIN - RETURN SHORT(LongRealValS(std)) - END RealVal; - - PROCEDURE ValS*(sequence: Sequence; low, high: LONGINT): LONGINT; - (* get a uniformly distributed integer in [low..high] *) - BEGIN - ASSERT(low <= high); - RETURN Entier( low + LongRealValS(sequence) * (1. + high - low) ) - END ValS; - - PROCEDURE Val*(low, high: LONGINT): LONGINT; - (* get a uniformly distributed integer in [low..high] *) - BEGIN - RETURN ValS(std, low, high) - END Val; - - PROCEDURE FlipS*(sequence: Sequence): BOOLEAN; - (* return TRUE or FALSE *) - BEGIN - IF int32ValS IN sequence.caps THEN - RETURN sequence.if.int32ValS(sequence) >= 0 - ELSE - RETURN sequence.if.longRealValS(sequence) >= 0.5 - END; - END FlipS; - - PROCEDURE Flip*(): BOOLEAN; - (* return TRUE or FALSE *) - BEGIN - RETURN FlipS(std) - END Flip; - - PROCEDURE Support*(type: Services.Type; setValS: SetValSProc); - (* support service for type *) - VAR - serviceDisc: ServiceDiscipline; - BEGIN - NEW(serviceDisc); - serviceDisc.id := serviceDiscID; - serviceDisc.setValS := setValS; - Disciplines.Add(type, serviceDisc); - Services.Define(type, service, NIL); - END Support; - - PROCEDURE SetValS*(sequence: Sequence; value: Operations.Operand); - (* store random value from sequence into already initialized value *) - VAR - baseType : Services.Type; - serviceDisc: ServiceDiscipline; - ok : BOOLEAN; - BEGIN - Services.GetSupportedBaseType(value, service, baseType); - ok := Disciplines.Seek(baseType, serviceDiscID, S.VAL(Disciplines.Discipline, serviceDisc)); - ASSERT(ok); - serviceDisc.setValS(sequence, value); - END SetValS; - - PROCEDURE SetVal*(value: Operations.Operand); - (* store random value from std sequence into already initialized value *) - BEGIN - SetValS(std, value); - END SetVal; - - (* ----- DefaultSequence ----- *) - - PROCEDURE CongruentialStep(VAR value1, value2: LONGINT); - BEGIN - value1 := - factor1 * (value1 MOD quotient1) - remainder1 * (value1 DIV quotient1); - IF value1 < 0 THEN - INC(value1, modulus1); - END; - value2 := - factor2 * (value2 MOD quotient2) - remainder2 * (value2 DIV quotient2); - IF value2 < 0 THEN - INC(value2, modulus2); - END; - END CongruentialStep; - - PROCEDURE DefaultSequenceValue(sequence: Sequence): LONGREAL; - VAR - value: LONGINT; - BEGIN - WITH sequence: DefaultSequence DO - CongruentialStep(sequence.value1, sequence.value2); - value := sequence.value1 - sequence.value2; - IF value <= 0 THEN - INC(value, modulus1); - END; - RETURN (value - 1.) / (modulus1 - 1.) - END; - END DefaultSequenceValue; - - PROCEDURE DefaultSequenceRewind(sequence: Sequence); - BEGIN - WITH sequence: DefaultSequence DO - sequence.value1 := sequence.seed1; - sequence.value2 := sequence.seed2; - END; - END DefaultSequenceRewind; - - PROCEDURE DefaultSequenceRestart(sequence, seed: Sequence); - BEGIN - WITH sequence: DefaultSequence DO - sequence.seed1 := ValS(seed, 1, modulus1-1); - sequence.seed2 := ValS(seed, 1, modulus2-1); - sequence.value1 := sequence.seed1; - sequence.value2 := sequence.seed2; - END; - END DefaultSequenceRestart; - - PROCEDURE CreateDefaultSequences; - VAR - mySeed, myStd: DefaultSequence; - if: Interface; - daytime: Times.Time; - timeval: Times.TimeValueRec; - count: LONGINT; - - PROCEDURE Hash(str: ARRAY OF CHAR): LONGINT; - VAR - index, - val: LONGINT; - BEGIN - val := 27567352; - index := 0; - WHILE str[index] # 0X DO - val := (val MOD 16777216) * 128 + - (val DIV 16777216 + ORD(str[index])) MOD 128; - INC(index); - END; (*WHILE*) - RETURN val - END Hash; - - BEGIN - (* define interface for all default sequences *) - NEW(if); - if.longRealValS := DefaultSequenceValue; - if.rewindSequence := DefaultSequenceRewind; - if.restartSequence := DefaultSequenceRestart; - - (* fake initial randomness using some portably accessible sources *) - NEW(mySeed); - Services.Init(mySeed, defaultSequenceType); - Init(mySeed, if, {longRealValS}); - Clocks.GetTime(Clocks.system, daytime); - Times.GetValue(daytime, timeval); - (* extract those 31 bits from daytime that are most likely to vary *) - mySeed.value1 := timeval.usec * 2048 + timeval.second MOD 65536 + 1; - (* generate 31 more bits from the process name *) - mySeed.value2 := Hash(Process.name) MOD (modulus2 - 1) + 1; - (* scramble these values *) - count := 0; - WHILE count < 4 DO - CongruentialStep(mySeed.value1, mySeed.value2); - INC(count); - END; - (* mix them together *) - DefaultSequenceRestart(mySeed, mySeed); - seed := mySeed; - - (* now use our seed to initialize std sequence *) - NEW(myStd); - Services.Init(myStd, defaultSequenceType); - Init(myStd, if, {longRealValS, rewindSequence, restartSequence}); - DefaultSequenceRestart(myStd, mySeed); - std := myStd; - - unpredictable := NIL; - END CreateDefaultSequences; + unpredictable := NIL; + END CreateDefaultSequences; BEGIN - serviceDiscID := Disciplines.Unique(); - Services.Create(service, "RandomGenerators"); - Services.CreateType(sequenceType, "RandomGenerators.Sequence", ""); - Services.CreateType(defaultSequenceType, "RandomGenerators.DefaultSequence", - "RandomGenerators.Sequence"); - CreateDefaultSequences; + serviceDiscID := Disciplines.Unique(); + Services.Create(service, "RandomGenerators"); + Services.CreateType(sequenceType, "RandomGenerators.Sequence", ""); + Services.CreateType(defaultSequenceType, "RandomGenerators.DefaultSequence", + "RandomGenerators.Sequence"); + CreateDefaultSequences; END ulmRandomGenerators. diff --git a/src/library/ulm/ulmRelatedEvents.Mod b/src/library/ulm/ulmRelatedEvents.Mod index 6f9a0c32..a5ad5453 100644 --- a/src/library/ulm/ulmRelatedEvents.Mod +++ b/src/library/ulm/ulmRelatedEvents.Mod @@ -1,422 +1,429 @@ (* Ulm's Oberon Library - Copyright (C) 1989-1994 by University of Ulm, SAI, D-89069 Ulm, Germany - ---------------------------------------------------------------------------- - Ulm's Oberon Library is free software; you can redistribute it - and/or modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either version - 2 of the License, or (at your option) any later version. + Copyright (C) 1989-1994 by University of Ulm, SAI, D-89069 Ulm, Germany + ---------------------------------------------------------------------------- + Ulm's Oberon Library is free software; you can redistribute it + and/or modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either version + 2 of the License, or (at your option) any later version. - Ulm's Oberon Library is distributed in the hope that it will be - useful, but WITHOUT ANY WARRANTY; without even the implied warranty - of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. + Ulm's Oberon Library is distributed in the hope that it will be + useful, but WITHOUT ANY WARRANTY; without even the implied warranty + of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - ---------------------------------------------------------------------------- - E-mail contact: oberon@mathematik.uni-ulm.de - ---------------------------------------------------------------------------- - $Id: RelatedEven.om,v 1.8 2005/04/28 08:30:09 borchert Exp $ - ---------------------------------------------------------------------------- - $Log: RelatedEven.om,v $ - Revision 1.8 2005/04/28 08:30:09 borchert - added assertion to Forward that takes care that from # to - (otherwise we get a nasty infinite loop) + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + ---------------------------------------------------------------------------- + E-mail contact: oberon@mathematik.uni-ulm.de + ---------------------------------------------------------------------------- + $Id: RelatedEven.om,v 1.8 2005/04/28 08:30:09 borchert Exp $ + ---------------------------------------------------------------------------- + $Log: RelatedEven.om,v $ + Revision 1.8 2005/04/28 08:30:09 borchert + added assertion to Forward that takes care that from # to + (otherwise we get a nasty infinite loop) - Revision 1.7 2004/09/09 21:04:24 borchert - undoing change of Revision 1.5: - fields dependants and dependson must not be subject of - Save/Restore as this makes it impossible to undo the - dependencies within the TerminationHandler - we no longer remove the discipline in case of terminated - objects as this causes a list of error events to be lost + Revision 1.7 2004/09/09 21:04:24 borchert + undoing change of Revision 1.5: + fields dependants and dependson must not be subject of + Save/Restore as this makes it impossible to undo the + dependencies within the TerminationHandler + we no longer remove the discipline in case of terminated + objects as this causes a list of error events to be lost - Revision 1.6 2004/02/18 17:01:59 borchert - Raise asserts now that event.type # NIL + Revision 1.6 2004/02/18 17:01:59 borchert + Raise asserts now that event.type # NIL - Revision 1.5 2004/02/18 16:53:48 borchert - fields dependants and dependson moved from discipline to state - object to support them for Save/Restore + Revision 1.5 2004/02/18 16:53:48 borchert + fields dependants and dependson moved from discipline to state + object to support them for Save/Restore - Revision 1.4 1998/01/12 14:39:18 borchert - some bug fixes around RelatedEvents.null + Revision 1.4 1998/01/12 14:39:18 borchert + some bug fixes around RelatedEvents.null - Revision 1.3 1995/03/20 17:05:13 borchert - - Save & Restore added - - support for Forwarders & Resources added + Revision 1.3 1995/03/20 17:05:13 borchert + - Save & Restore added + - support for Forwarders & Resources added - Revision 1.2 1994/08/27 14:49:44 borchert - null object added + Revision 1.2 1994/08/27 14:49:44 borchert + null object added - Revision 1.1 1994/02/22 20:09:53 borchert - Initial revision + Revision 1.1 1994/02/22 20:09:53 borchert + Initial revision - ---------------------------------------------------------------------------- - AFB 11/91 - ---------------------------------------------------------------------------- + ---------------------------------------------------------------------------- + AFB 11/91 + ---------------------------------------------------------------------------- *) MODULE ulmRelatedEvents; - (* relate events to objects *) + (* relate events to objects *) - IMPORT Disciplines := ulmDisciplines, Events := ulmEvents, Forwarders := ulmForwarders, Objects := ulmObjects, Priorities := ulmPriorities, Resources := ulmResources, SYSTEM; + IMPORT Disciplines := ulmDisciplines, Events := ulmEvents, Forwarders := ulmForwarders, Objects := ulmObjects, Priorities := ulmPriorities, Resources := ulmResources, SYSTEM; - CONST - (* possible directions of propagated events *) - forward = 0; (* forward along the forwardTo chain, if given *) - backward = 1; (* forward event to all dependants, if present *) - both = 2; (* forward event to both directions *) - TYPE - Direction = SHORTINT; (* forward, backward, both *) + CONST + (* possible directions of propagated events *) + forward = 0; (* forward along the forwardTo chain, if given *) + backward = 1; (* forward event to all dependants, if present *) + both = 2; (* forward event to both directions *) + TYPE + Direction = SHORTINT; (* forward, backward, both *) - TYPE - Object* = Disciplines.Object; - Event* = POINTER TO EventRec; - EventRec* = - RECORD - (Events.EventRec) - object*: Object; - event*: Events.Event; - END; - Queue* = POINTER TO QueueRec; - QueueRec* = - RECORD - (Objects.ObjectRec) - event*: Events.Event; - next*: Queue; - END; - ObjectList = POINTER TO ObjectListRec; - ObjectListRec = - RECORD - object: Object; - next: ObjectList; - END; - - TYPE - State = POINTER TO StateRec; - StateRec = - RECORD - default: BOOLEAN; (* default reaction? *) - eventType: Events.EventType; (* may be NIL *) - queue: BOOLEAN; (* are events to be queued? *) - forwardto: Object; - head, tail: Queue; - saved: State; - END; - Discipline = POINTER TO DisciplineRec; - DisciplineRec = - RECORD - (Disciplines.DisciplineRec) - state: State; - dependants: ObjectList; - dependsOn: Object; - END; - VAR - id: Disciplines.Identifier; - VAR - null*: Object; (* object which ignores all related events *) - nullevent: Events.EventType; - - PROCEDURE RemoveDependant(VAR list: ObjectList; dependant: Object); - VAR - prev, p: ObjectList; - BEGIN - prev := NIL; p := list; - WHILE (p # NIL) & (p.object # dependant) DO - prev := p; p := p.next; + TYPE + Object* = Disciplines.Object; + Event* = POINTER TO EventRec; + EventRec* = + RECORD + (Events.EventRec) + object*: Object; + event*: Events.Event; END; - IF p # NIL THEN - IF prev = NIL THEN - list := p.next; - ELSE - prev.next := p.next; - END; + Queue* = POINTER TO QueueRec; + QueueRec* = + RECORD + (Objects.ObjectRec) + event*: Events.Event; + next*: Queue; END; - END RemoveDependant; - - PROCEDURE TerminationHandler(event: Events.Event); - VAR - disc: Discipline; - BEGIN - WITH event: Resources.Event DO - IF (event.change = Resources.terminated) & - Disciplines.Seek(event.resource, id, SYSTEM.VAL(Disciplines.Discipline, disc)) THEN (* noch *) - IF (disc.dependsOn # NIL) & - Disciplines.Seek(disc.dependsOn, id, SYSTEM.VAL(Disciplines.Discipline, disc)) THEN (* noch *) - RemoveDependant(disc.dependants, event.resource); - disc.dependsOn := NIL; - END; - (* - afb 9/2004: - do not remove this discipline for dead objects - as this makes it impossible to retrieve the final - list of error events - Disciplines.Remove(event.resource, id); - *) - END; + ObjectList = POINTER TO ObjectListRec; + ObjectListRec = + RECORD + object: Object; + next: ObjectList; END; - END TerminationHandler; - PROCEDURE CreateState(VAR state: State); - BEGIN - NEW(state); - state.eventType := NIL; - state.queue := FALSE; state.head := NIL; state.tail := NIL; - state.forwardto := NIL; - state.default := TRUE; - state.saved := NIL; - END CreateState; + TYPE + State = POINTER TO StateRec; + StateRec = + RECORD + default: BOOLEAN; (* default reaction? *) + eventType: Events.EventType; (* may be NIL *) + queue: BOOLEAN; (* are events to be queued? *) + forwardto: Object; + head, tail: Queue; + saved: State; + END; + Discipline = POINTER TO DisciplineRec; + DisciplineRec = + RECORD + (Disciplines.DisciplineRec) + state: State; + dependants: ObjectList; + dependsOn: Object; + END; + VAR + id: Disciplines.Identifier; + VAR + null*: Object; (* object which ignores all related events *) + nullevent: Events.EventType; - PROCEDURE CreateDiscipline(VAR disc: Discipline); - BEGIN - NEW(disc); disc.id := id; CreateState(disc.state); - END CreateDiscipline; - - PROCEDURE GetEventType*(object: Object; VAR eventType: Events.EventType); - (* returns an event type for the given object; - all events related to the object are also handled by this event type - *) - VAR - disc: Discipline; - state: State; - BEGIN - IF object = null THEN - eventType := nullevent; + PROCEDURE RemoveDependant(VAR list: ObjectList; dependant: Object); + VAR + prev, p: ObjectList; + BEGIN + prev := NIL; p := list; + WHILE (p # NIL) & (p.object # dependant) DO + prev := p; p := p.next; + END; + IF p # NIL THEN + IF prev = NIL THEN + list := p.next; ELSE - IF ~Disciplines.Seek(object, id, SYSTEM.VAL(Disciplines.Discipline, disc)) THEN (* noch *) - CreateDiscipline(disc); - Disciplines.Add(object, disc); - END; - state := disc.state; - state.default := FALSE; - IF state.eventType = NIL THEN - Events.Define(state.eventType); - Events.SetPriority(state.eventType, Priorities.liberrors + 1); - Events.Ignore(state.eventType); - END; - eventType := state.eventType; + prev.next := p.next; END; - END GetEventType; + END; + END RemoveDependant; - PROCEDURE Forward*(from, to: Object); - (* causes all events related to `from' to be forwarded to `to' *) - VAR - disc: Discipline; - BEGIN - IF (from # NIL) & (from # null) THEN - ASSERT(from # to); - IF ~Disciplines.Seek(from, id, SYSTEM.VAL(Disciplines.Discipline, disc)) THEN (* noch *) - CreateDiscipline(disc); - Disciplines.Add(from, disc); - END; - IF to = null THEN - to := NIL; - END; - disc.state.forwardto := to; - disc.state.default := FALSE; + PROCEDURE Seek(object: Object; id: Disciplines.Identifier; + VAR discipline: Discipline): BOOLEAN; + VAR + disc: Disciplines.Discipline; + result: BOOLEAN; + BEGIN + result := Disciplines.Seek(object, id, disc); + IF result THEN discipline := disc(Discipline) ELSE discipline := NIL END; + RETURN result + END Seek; + + PROCEDURE TerminationHandler(event: Events.Event); + VAR + disc: Discipline; + BEGIN + WITH event: Resources.Event DO + IF (event.change = Resources.terminated) & Seek(event.resource, id, disc) THEN + IF (disc.dependsOn # NIL) & Seek(disc.dependsOn, id, disc) THEN + RemoveDependant(disc.dependants, event.resource); + disc.dependsOn := NIL; + END; + (* + afb 9/2004: + do not remove this discipline for dead objects + as this makes it impossible to retrieve the final + list of error events + Disciplines.Remove(event.resource, id); + *) END; - END Forward; + END; + END TerminationHandler; - PROCEDURE ForwardToDependants(from, to: Forwarders.Object); - (* is called by Forwarders.Forward: - build a backward chain from `to' to `from' - *) - VAR - fromDisc, toDisc: Discipline; - member: ObjectList; - eventType: Events.EventType; - BEGIN - IF (from = null) OR (to = null) THEN RETURN END; - IF ~Disciplines.Seek(from, id, SYSTEM.VAL(Disciplines.Discipline, fromDisc)) THEN (* noch *) - CreateDiscipline(fromDisc); Disciplines.Add(from, fromDisc); + PROCEDURE CreateState(VAR state: State); + BEGIN + NEW(state); + state.eventType := NIL; + state.queue := FALSE; state.head := NIL; state.tail := NIL; + state.forwardto := NIL; + state.default := TRUE; + state.saved := NIL; + END CreateState; + + PROCEDURE CreateDiscipline(VAR disc: Discipline); + BEGIN + NEW(disc); disc.id := id; CreateState(disc.state); + END CreateDiscipline; + + PROCEDURE GetEventType*(object: Object; VAR eventType: Events.EventType); + (* returns an event type for the given object; + all events related to the object are also handled by this event type + *) + VAR + disc: Discipline; + state: State; + BEGIN + IF object = null THEN + eventType := nullevent; + ELSE + IF ~Seek(object, id, disc) THEN + CreateDiscipline(disc); + Disciplines.Add(object, disc); END; - IF fromDisc.dependsOn # NIL THEN RETURN END; - fromDisc.dependsOn := to; - Resources.TakeInterest(from, eventType); - Events.Handler(eventType, TerminationHandler); - - IF ~Disciplines.Seek(to, id, SYSTEM.VAL(Disciplines.Discipline, toDisc)) THEN (* noch *) - CreateDiscipline(toDisc); Disciplines.Add(to, toDisc); + state := disc.state; + state.default := FALSE; + IF state.eventType = NIL THEN + Events.Define(state.eventType); + Events.SetPriority(state.eventType, Priorities.liberrors + 1); + Events.Ignore(state.eventType); END; - NEW(member); member.object := from; - member.next := toDisc.dependants; toDisc.dependants := member; - END ForwardToDependants; + eventType := state.eventType; + END; + END GetEventType; - PROCEDURE QueueEvents*(object: Object); - (* put all incoming events into a queue *) - VAR - disc: Discipline; - state: State; - BEGIN - IF (object # NIL) & (object # null) THEN - IF ~Disciplines.Seek(object, id, SYSTEM.VAL(Disciplines.Discipline, disc)) THEN - CreateDiscipline(disc); - Disciplines.Add(object, disc); - END; - state := disc.state; - state.default := FALSE; - IF ~state.queue THEN - state.queue := TRUE; state.head := NIL; state.tail := NIL; - END; + PROCEDURE Forward*(from, to: Object); + (* causes all events related to `from' to be forwarded to `to' *) + VAR + disc: Discipline; + BEGIN + IF (from # NIL) & (from # null) THEN + ASSERT(from # to); + IF ~Seek(from, id, disc) THEN + CreateDiscipline(disc); + Disciplines.Add(from, disc); END; - END QueueEvents; + IF to = null THEN + to := NIL; + END; + disc.state.forwardto := to; + disc.state.default := FALSE; + END; + END Forward; - PROCEDURE GetQueue*(object: Object; VAR queue: Queue); - (* return queue of related events which is removed - from the object; - object must have been prepared by QueueEvents - *) - VAR - disc: Discipline; - state: State; - BEGIN - IF (object # NIL) & (object # null) & - Disciplines.Seek(object, id, SYSTEM.VAL(Disciplines.Discipline, disc)) & disc.state.queue THEN (* noch *) - state := disc.state; - queue := state.head; state.head := NIL; state.tail := NIL; + PROCEDURE ForwardToDependants(from, to: Forwarders.Object); + (* is called by Forwarders.Forward: + build a backward chain from `to' to `from' + *) + VAR + fromDisc, toDisc: Discipline; + member: ObjectList; + eventType: Events.EventType; + BEGIN + IF (from = null) OR (to = null) THEN RETURN END; + IF ~Seek(from, id, fromDisc) THEN + CreateDiscipline(fromDisc); Disciplines.Add(from, fromDisc); + END; + IF fromDisc.dependsOn # NIL THEN RETURN END; + fromDisc.dependsOn := to; + Resources.TakeInterest(from, eventType); + Events.Handler(eventType, TerminationHandler); + + IF ~Seek(to, id, toDisc) THEN + CreateDiscipline(toDisc); Disciplines.Add(to, toDisc); + END; + NEW(member); member.object := from; + member.next := toDisc.dependants; toDisc.dependants := member; + END ForwardToDependants; + + PROCEDURE QueueEvents*(object: Object); + (* put all incoming events into a queue *) + VAR + disc: Discipline; + state: State; + BEGIN + IF (object # NIL) & (object # null) THEN + IF ~Seek(object, id, disc) THEN + CreateDiscipline(disc); + Disciplines.Add(object, disc); + END; + state := disc.state; + state.default := FALSE; + IF ~state.queue THEN + state.queue := TRUE; state.head := NIL; state.tail := NIL; + END; + END; + END QueueEvents; + + PROCEDURE GetQueue*(object: Object; VAR queue: Queue); + (* return queue of related events which is removed + from the object; + object must have been prepared by QueueEvents + *) + VAR + disc: Discipline; + state: State; + BEGIN + IF (object # NIL) & (object # null) & Seek(object, id, disc) & disc.state.queue THEN + state := disc.state; + queue := state.head; state.head := NIL; state.tail := NIL; + ELSE + queue := NIL; + END; + END GetQueue; + + PROCEDURE EventsPending*(object: Object) : BOOLEAN; + (* return TRUE if GetQueue will return a queue # NIL *) + VAR + disc: Discipline; + BEGIN + IF (object # NIL) & (object # null) & Seek(object, id, disc) & disc.state.queue THEN + RETURN disc.state.head # NIL + ELSE + RETURN FALSE + END; + END EventsPending; + + PROCEDURE Reset*(object: Object); + (* return to default behaviour *) + VAR + disc: Discipline; + state: State; + BEGIN + IF object # null THEN + IF Seek(object, id, disc) THEN + IF (disc.state.saved = NIL) & + (disc.dependsOn = NIL) & + (disc.dependants = NIL) THEN + Disciplines.Remove(object, id); + ELSE + state := disc.state; + state.queue := FALSE; state.head := NIL; state.tail := NIL; + state.eventType := NIL; state.forwardto := NIL; + state.default := TRUE; + END; + END; + END; + END Reset; + + PROCEDURE Save*(object: Object); + (* save current status of the given object and reset to + default behaviour; + the status includes the reaction types and event queues; + Save operations may be nested + *) + VAR + disc: Discipline; + state: State; + BEGIN + IF object # null THEN + IF ~Seek(object, id, disc) THEN + CreateDiscipline(disc); + Disciplines.Add(object, disc); + END; + CreateState(state); + state.saved := disc.state; disc.state := state; + END; + END Save; + + PROCEDURE Restore*(object: Object); + (* restore status saved earlier by Save *) + VAR + disc: Discipline; + BEGIN + IF Seek(object, id, disc) & (disc.state.saved # NIL) THEN + disc.state := disc.state.saved; + END; + END Restore; + + PROCEDURE InternalRaise(object: Object; dir: Direction; event: Events.Event); + VAR + disc: Discipline; + state: State; + relEvent: Event; + element: Queue; (* new element of queue *) + dependant: ObjectList; + BEGIN + IF (object = null) OR ~Seek(object, id, disc) THEN RETURN END; + + (* backward chaining *) + IF (disc.dependants # NIL) & (dir IN {backward, both}) THEN + dependant := disc.dependants; + WHILE dependant # NIL DO + InternalRaise(dependant.object, backward, event); + dependant := dependant.next; + END; + END; + + (* local handling & forward chaining *) + IF ~disc.state.default THEN + state := disc.state; + IF state.queue THEN + NEW(element); element.next := NIL; element.event := event; + IF state.tail # NIL THEN + state.tail.next := element; + ELSE + state.head := element; + END; + state.tail := element; + END; + IF state.eventType # NIL THEN + NEW(relEvent); + relEvent.message := event.message; + relEvent.type := state.eventType; + relEvent.object := object; + relEvent.event := event; + Events.Raise(relEvent); + END; + IF (state.forwardto # NIL) & (dir IN {both, forward}) THEN + InternalRaise(state.forwardto, forward, event); + END; + END; + END InternalRaise; + + PROCEDURE Raise*(object: Object; event: Events.Event); + VAR + disc: Discipline; + BEGIN + ASSERT(event.type # NIL); + IF object # null THEN + IF (object = NIL) OR ~Seek(object, id, disc) THEN + Events.Raise(event); ELSE - queue := NIL; + InternalRaise(object, both, event); END; - END GetQueue; + END; + END Raise; - PROCEDURE EventsPending*(object: Object) : BOOLEAN; - (* return TRUE if GetQueue will return a queue # NIL *) - VAR - disc: Discipline; - BEGIN - IF (object # NIL) & (object # null) & - Disciplines.Seek(object, id, SYSTEM.VAL(Disciplines.Discipline, disc)) & disc.state.queue THEN (* noch *) - RETURN disc.state.head # NIL - ELSE - RETURN FALSE - END; - END EventsPending; - - PROCEDURE Reset*(object: Object); - (* return to default behaviour *) - VAR - disc: Discipline; - state: State; - BEGIN - IF object # null THEN - IF Disciplines.Seek(object, id, SYSTEM.VAL(Disciplines.Discipline, disc)) THEN (* noch *) - IF (disc.state.saved = NIL) & - (disc.dependsOn = NIL) & - (disc.dependants = NIL) THEN - Disciplines.Remove(object, id); - ELSE - state := disc.state; - state.queue := FALSE; state.head := NIL; state.tail := NIL; - state.eventType := NIL; state.forwardto := NIL; - state.default := TRUE; - END; - END; - END; - END Reset; - - PROCEDURE Save*(object: Object); - (* save current status of the given object and reset to - default behaviour; - the status includes the reaction types and event queues; - Save operations may be nested - *) - VAR - disc: Discipline; - state: State; - BEGIN - IF object # null THEN - IF ~Disciplines.Seek(object, id, SYSTEM.VAL(Disciplines.Discipline, disc)) THEN (* noch *) - CreateDiscipline(disc); - Disciplines.Add(object, disc); - END; - CreateState(state); - state.saved := disc.state; disc.state := state; - END; - END Save; - - PROCEDURE Restore*(object: Object); - (* restore status saved earlier by Save *) - VAR - disc: Discipline; - BEGIN - IF Disciplines.Seek(object, id, SYSTEM.VAL(Disciplines.Discipline, disc)) & (disc.state.saved # NIL) THEN (* noch *) - disc.state := disc.state.saved; - END; - END Restore; - - PROCEDURE InternalRaise(object: Object; dir: Direction; event: Events.Event); - VAR - disc: Discipline; - state: State; - relEvent: Event; - element: Queue; (* new element of queue *) - dependant: ObjectList; - BEGIN - IF (object = null) OR ~Disciplines.Seek(object, id, SYSTEM.VAL(Disciplines.Discipline, disc)) THEN RETURN END; - - (* backward chaining *) - IF (disc.dependants # NIL) & (dir IN {backward, both}) THEN - dependant := disc.dependants; - WHILE dependant # NIL DO - InternalRaise(dependant.object, backward, event); - dependant := dependant.next; - END; - END; - - (* local handling & forward chaining *) - IF ~disc.state.default THEN - state := disc.state; - IF state.queue THEN - NEW(element); element.next := NIL; element.event := event; - IF state.tail # NIL THEN - state.tail.next := element; - ELSE - state.head := element; - END; - state.tail := element; - END; - IF state.eventType # NIL THEN - NEW(relEvent); - relEvent.message := event.message; - relEvent.type := state.eventType; - relEvent.object := object; - relEvent.event := event; - Events.Raise(relEvent); - END; - IF (state.forwardto # NIL) & (dir IN {both, forward}) THEN - InternalRaise(state.forwardto, forward, event); - END; - END; - END InternalRaise; - - PROCEDURE Raise*(object: Object; event: Events.Event); - VAR - disc: Discipline; - BEGIN - ASSERT(event.type # NIL); - IF object # null THEN - IF (object = NIL) OR ~Disciplines.Seek(object, id, SYSTEM.VAL(Disciplines.Discipline, disc)) THEN (* noch *) - Events.Raise(event); - ELSE - InternalRaise(object, both, event); - END; - END; - END Raise; - - PROCEDURE AppendQueue*(object: Object; queue: Queue); - (* Raise(object, event) for all events of the queue *) - BEGIN - WHILE queue # NIL DO - Raise(object, queue.event); - queue := queue.next; - END; - END AppendQueue; + PROCEDURE AppendQueue*(object: Object; queue: Queue); + (* Raise(object, event) for all events of the queue *) + BEGIN + WHILE queue # NIL DO + Raise(object, queue.event); + queue := queue.next; + END; + END AppendQueue; BEGIN - id := Disciplines.Unique(); - NEW(null); - Events.Define(nullevent); - Forwarders.Register("", ForwardToDependants); + id := Disciplines.Unique(); + NEW(null); + Events.Define(nullevent); + Forwarders.Register("", ForwardToDependants); END ulmRelatedEvents. diff --git a/src/library/ulm/ulmResources.Mod b/src/library/ulm/ulmResources.Mod index 9ff929bd..a700d22a 100644 --- a/src/library/ulm/ulmResources.Mod +++ b/src/library/ulm/ulmResources.Mod @@ -107,19 +107,11 @@ MODULE ulmResources; (* === private procedures ============================================ *) PROCEDURE GetDisc(resource: Resource; VAR disc: Discipline); + VAR d: Disciplines.Discipline; BEGIN - (*IF ~Disciplines.Seek(resource, discID, disc) THEN*) - (* this line causes error - err 123 type of actual parameter is not identical with that of formal VAR-parameter - because Discipline defined in this module is an extention of the same type in module Disciplines - Disciplines.Seek expects Disciplines.Discipline, not the extended type. - voc (ofront, OP2, as well as oo2c) behaves right by not allowing this, while Ulm's Oberon system - accepts this. - So we introduce here a workaround, which makes usage of this module unsafe; - - noch - *) - IF ~Disciplines.Seek(resource, discID, SYSTEM.VAL(Disciplines.Discipline, disc)) THEN (* noch *) + IF Disciplines.Seek(resource, discID, d) THEN + disc := d(Discipline) + ELSE NEW(disc); disc.id := discID; disc.state := alive; disc.refcnt := 0; disc.eventType := NIL; diff --git a/src/library/ulm/ulmScales.Mod b/src/library/ulm/ulmScales.Mod index 5de1188b..12cf5363 100644 --- a/src/library/ulm/ulmScales.Mod +++ b/src/library/ulm/ulmScales.Mod @@ -1,446 +1,446 @@ (* Ulm's Oberon Library - Copyright (C) 1989-1994 by University of Ulm, SAI, D-89069 Ulm, Germany - ---------------------------------------------------------------------------- - Ulm's Oberon Library is free software; you can redistribute it - and/or modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either version - 2 of the License, or (at your option) any later version. + Copyright (C) 1989-1994 by University of Ulm, SAI, D-89069 Ulm, Germany + ---------------------------------------------------------------------------- + Ulm's Oberon Library is free software; you can redistribute it + and/or modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either version + 2 of the License, or (at your option) any later version. - Ulm's Oberon Library is distributed in the hope that it will be - useful, but WITHOUT ANY WARRANTY; without even the implied warranty - of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. + Ulm's Oberon Library is distributed in the hope that it will be + useful, but WITHOUT ANY WARRANTY; without even the implied warranty + of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - ---------------------------------------------------------------------------- - E-mail contact: oberon@mathematik.uni-ulm.de - ---------------------------------------------------------------------------- - $Id: Scales.om,v 1.3 2004/09/03 09:31:53 borchert Exp $ - ---------------------------------------------------------------------------- - $Log: Scales.om,v $ - Revision 1.3 2004/09/03 09:31:53 borchert - bug fixes: Services.Init added in CreateOperand - Scales.Measure changed to Measure + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + ---------------------------------------------------------------------------- + E-mail contact: oberon@mathematik.uni-ulm.de + ---------------------------------------------------------------------------- + $Id: Scales.om,v 1.3 2004/09/03 09:31:53 borchert Exp $ + ---------------------------------------------------------------------------- + $Log: Scales.om,v $ + Revision 1.3 2004/09/03 09:31:53 borchert + bug fixes: Services.Init added in CreateOperand + Scales.Measure changed to Measure - Revision 1.2 1995/01/16 21:40:39 borchert - - assertions of Assertions converted into real assertions - - fixes due to changed if of PersistentObjects + Revision 1.2 1995/01/16 21:40:39 borchert + - assertions of Assertions converted into real assertions + - fixes due to changed if of PersistentObjects - Revision 1.1 1994/02/22 20:10:03 borchert - Initial revision + Revision 1.1 1994/02/22 20:10:03 borchert + Initial revision - ---------------------------------------------------------------------------- - AFB 12/91 - ---------------------------------------------------------------------------- + ---------------------------------------------------------------------------- + AFB 12/91 + ---------------------------------------------------------------------------- *) MODULE ulmScales; - IMPORT Disciplines := ulmDisciplines, Events := ulmEvents, Objects := ulmObjects, Operations := ulmOperations, PersistentObjects := ulmPersistentObjects, - RelatedEvents := ulmRelatedEvents, Services := ulmServices, SYS := SYSTEM; + IMPORT Disciplines := ulmDisciplines, Events := ulmEvents, Objects := ulmObjects, Operations := ulmOperations, PersistentObjects := ulmPersistentObjects, + RelatedEvents := ulmRelatedEvents, Services := ulmServices, SYS := SYSTEM; - TYPE - Scale* = POINTER TO ScaleRec; - Family* = POINTER TO FamilyRec; - FamilyRec* = - RECORD - (Disciplines.ObjectRec) - (* private components *) - reference: Scale; - END; - - TYPE - Unit* = POINTER TO UnitRec; - UnitList = POINTER TO UnitListRec; - UnitListRec = - RECORD - unit: Unit; - next: UnitList; - END; - Interface* = POINTER TO InterfaceRec; - ScaleRec* = - RECORD - (Disciplines.ObjectRec) - (* private components *) - if: Interface; - family: Family; - head, tail: UnitList; - nextUnit: UnitList; - END; - - CONST - unitNameLength* = 32; - TYPE - UnitName* = ARRAY unitNameLength OF CHAR; - UnitRec* = RECORD - (Disciplines.ObjectRec) - name: UnitName; - scale: Scale; + TYPE + Scale* = POINTER TO ScaleRec; + Family* = POINTER TO FamilyRec; + FamilyRec* = + RECORD + (Disciplines.ObjectRec) + (* private components *) + reference: Scale; END; - CONST - undefined = 0; absolute* = 1; relative* = 2; - TYPE - Measure* = POINTER TO MeasureRec; - MeasureRec* = - RECORD - (Operations.OperandRec) - scale: Scale; - type: SHORTINT; (* absolute or relative? *) - END; - VAR - measureType: Services.Type; + TYPE + Unit* = POINTER TO UnitRec; + UnitList = POINTER TO UnitListRec; + UnitListRec = + RECORD + unit: Unit; + next: UnitList; + END; + Interface* = POINTER TO InterfaceRec; + ScaleRec* = + RECORD + (Disciplines.ObjectRec) + (* private components *) + if: Interface; + family: Family; + head, tail: UnitList; + nextUnit: UnitList; + END; - TYPE - Value* = LONGINT; + CONST + unitNameLength* = 32; + TYPE + UnitName* = ARRAY unitNameLength OF CHAR; + UnitRec* = RECORD + (Disciplines.ObjectRec) + name: UnitName; + scale: Scale; + END; - CONST - add* = Operations.add; sub* = Operations.sub; - TYPE - Operation* = SHORTINT; (* add or sub *) - TYPE - CreateProc* = PROCEDURE (scale: Scale; VAR measure: Measure; abs: BOOLEAN); - GetValueProc* = PROCEDURE (measure: Measure; unit: Unit; VAR value: Value); - SetValueProc* = PROCEDURE (measure: Measure; unit: Unit; value: Value); - AssignProc* = PROCEDURE (target: Measure; source: Measure); - OperatorProc* = PROCEDURE (op: Operation; op1, op2, result: Measure); - CompareProc* = PROCEDURE (op1, op2: Measure) : INTEGER; - ConvertProc* = PROCEDURE (from, to: Measure); - - InterfaceRec* = - RECORD - (Objects.ObjectRec) - create*: CreateProc; - getvalue*: GetValueProc; - setvalue*: SetValueProc; - assign*: AssignProc; - op*: OperatorProc; - compare*: CompareProc; - (* the conversion routines are only to be provided - if the scaling system belongs to a family - *) - scaleToReference*: ConvertProc; - referenceToScale*: ConvertProc; - END; + CONST + undefined = 0; absolute* = 1; relative* = 2; + TYPE + Measure* = POINTER TO MeasureRec; + MeasureRec* = + RECORD + (Operations.OperandRec) + scale: Scale; + type: SHORTINT; (* absolute or relative? *) + END; + VAR + measureType: Services.Type; - VAR - invalidOperation*: Events.EventType; - (* operation cannot be performed for the given combination - of types (absolute or relative) - *) - incompatibleScales*: Events.EventType; - (* the scales of the operands do not belong to the same family *) - badCombination*: Events.EventType; - (* SetValue or GetValue: - given measure and unit do not belong to the same scaling system - *) + TYPE + Value* = LONGINT; - (* our interface to Operations *) - opif: Operations.Interface; - opcaps: Operations.CapabilitySet; + CONST + add* = Operations.add; sub* = Operations.sub; + TYPE + Operation* = SHORTINT; (* add or sub *) + TYPE + CreateProc* = PROCEDURE (scale: Scale; VAR measure: Measure; abs: BOOLEAN); + GetValueProc* = PROCEDURE (measure: Measure; unit: Unit; VAR value: Value); + SetValueProc* = PROCEDURE (measure: Measure; unit: Unit; value: Value); + AssignProc* = PROCEDURE (target: Measure; source: Measure); + OperatorProc* = PROCEDURE (op: Operation; op1, op2, result: Measure); + CompareProc* = PROCEDURE (op1, op2: Measure) : INTEGER; + ConvertProc* = PROCEDURE (from, to: Measure); - (* ======= private procedures ===================================== *) + InterfaceRec* = + RECORD + (Objects.ObjectRec) + create*: CreateProc; + getvalue*: GetValueProc; + setvalue*: SetValueProc; + assign*: AssignProc; + op*: OperatorProc; + compare*: CompareProc; + (* the conversion routines are only to be provided + if the scaling system belongs to a family + *) + scaleToReference*: ConvertProc; + referenceToScale*: ConvertProc; + END; - PROCEDURE DummyConversion(from, to: Measure); - BEGIN - from.scale.if.assign(to, from); - END DummyConversion; + VAR + invalidOperation*: Events.EventType; + (* operation cannot be performed for the given combination + of types (absolute or relative) + *) + incompatibleScales*: Events.EventType; + (* the scales of the operands do not belong to the same family *) + badCombination*: Events.EventType; + (* SetValue or GetValue: + given measure and unit do not belong to the same scaling system + *) - (* ======== exported procedures ==================================== *) + (* our interface to Operations *) + opif: Operations.Interface; + opcaps: Operations.CapabilitySet; - PROCEDURE InitFamily*(family: Family; reference: Scale); - BEGIN - family.reference := reference; - (* the reference scale becomes now a member of the family *) - reference.family := family; - reference.if.scaleToReference := DummyConversion; - reference.if.referenceToScale := DummyConversion; - END InitFamily; + (* ======= private procedures ===================================== *) - PROCEDURE Init*(scale: Scale; family: Family; if: Interface); - (* reference scales are to be initialized with family = NIL *) - BEGIN - scale.if := if; - scale.family := family; - scale.head := NIL; scale.tail := NIL; - scale.nextUnit := NIL; - END Init; + PROCEDURE DummyConversion(from, to: Measure); + BEGIN + from.scale.if.assign(to, from); + END DummyConversion; - PROCEDURE InitUnit*(scale: Scale; unit: Unit; name: UnitName); - VAR - listp: UnitList; - BEGIN - unit.name := name; - unit.scale := scale; - NEW(listp); listp.unit := unit; listp.next := NIL; - IF scale.head # NIL THEN - scale.tail.next := listp; + (* ======== exported procedures ==================================== *) + + PROCEDURE InitFamily*(family: Family; reference: Scale); + BEGIN + family.reference := reference; + (* the reference scale becomes now a member of the family *) + reference.family := family; + reference.if.scaleToReference := DummyConversion; + reference.if.referenceToScale := DummyConversion; + END InitFamily; + + PROCEDURE Init*(scale: Scale; family: Family; if: Interface); + (* reference scales are to be initialized with family = NIL *) + BEGIN + scale.if := if; + scale.family := family; + scale.head := NIL; scale.tail := NIL; + scale.nextUnit := NIL; + END Init; + + PROCEDURE InitUnit*(scale: Scale; unit: Unit; name: UnitName); + VAR + listp: UnitList; + BEGIN + unit.name := name; + unit.scale := scale; + NEW(listp); listp.unit := unit; listp.next := NIL; + IF scale.head # NIL THEN + scale.tail.next := listp; + ELSE + scale.head := listp; + END; + scale.tail := listp; + END InitUnit; + + PROCEDURE CreateMeasure*(scale: Scale; VAR measure: Measure; type: SHORTINT); + BEGIN + scale.if.create(scale, measure, type = absolute); + Operations.Init(measure, opif, opcaps); + measure.scale := scale; + measure.type := type; + END CreateMeasure; + + PROCEDURE CreateAbsMeasure*(scale: Scale; VAR measure: Measure); + (* init measure to the origin of the given system *) + BEGIN + CreateMeasure(scale, measure, absolute); + END CreateAbsMeasure; + + PROCEDURE CreateRelMeasure*(scale: Scale; VAR measure: Measure); + (* init relative measure to 0 *) + BEGIN + CreateMeasure(scale, measure, relative); + END CreateRelMeasure; + + PROCEDURE ConvertMeasure*(scale: Scale; VAR measure: Measure); + (* convert measure to the given scale which must belong + to the same family as the original scale of measure + *) + VAR + newMeasure: Measure; + refMeasure: Measure; + reference: Scale; + BEGIN + IF scale = measure.scale THEN + (* trivial case -- nothing is to be done *) + RETURN + END; + (* check that both scales belong to the same family *) + ASSERT((scale.family # NIL) & (scale.family = measure.scale.family)); + CreateMeasure(scale, newMeasure, measure.type); + reference := scale.family.reference; + CreateMeasure(reference, refMeasure, measure.type); + measure.scale.if.scaleToReference(measure, refMeasure); + scale.if.referenceToScale(refMeasure, newMeasure); + measure := newMeasure; + END ConvertMeasure; + + PROCEDURE GetReference*(family: Family; VAR reference: Scale); + BEGIN + reference := family.reference; + END GetReference; + + PROCEDURE GetFamily*(scale: Scale; VAR family: Family); + BEGIN + family := scale.family; + END GetFamily; + + PROCEDURE GetScaleOfUnit*(unit: Unit; VAR scale: Scale); + BEGIN + scale := unit.scale; + END GetScaleOfUnit; + + PROCEDURE GetScale*(measure: Measure; VAR scale: Scale); + BEGIN + scale := measure.scale; + END GetScale; + + PROCEDURE TraverseUnits*(scale: Scale); + BEGIN + scale.nextUnit := scale.head; + END TraverseUnits; + + PROCEDURE NextUnit*(scale: Scale; VAR unit: Unit) : BOOLEAN; + BEGIN + IF scale.nextUnit # NIL THEN + unit := scale.nextUnit.unit; + scale.nextUnit := scale.nextUnit.next; + RETURN TRUE + ELSE + RETURN FALSE + END; + END NextUnit; + + PROCEDURE GetName*(unit: Unit; VAR name: UnitName); + BEGIN + name := unit.name; + END GetName; + + PROCEDURE GetValue*(measure: Measure; unit: Unit; VAR value: Value); + VAR + scale: Scale; + BEGIN + scale := measure.scale; + ASSERT(unit.scale = scale); + scale.if.getvalue(measure, unit, value); + END GetValue; + + PROCEDURE SetValue*(measure: Measure; unit: Unit; value: Value); + VAR + scale: Scale; + BEGIN + scale := measure.scale; + ASSERT(unit.scale = scale); + scale.if.setvalue(measure, unit, value); + END SetValue; + + PROCEDURE IsAbsolute*(measure: Measure) : BOOLEAN; + BEGIN + RETURN measure.type = absolute + END IsAbsolute; + + PROCEDURE IsRelative*(measure: Measure) : BOOLEAN; + BEGIN + RETURN measure.type = relative + END IsRelative; + + PROCEDURE MeasureType*(measure: Measure) : SHORTINT; + BEGIN + RETURN measure.type + END MeasureType; + + (* ======== interface procedures for Operations ================= *) + + PROCEDURE CreateOperand(VAR op: Operations.Operand); + (* at this time we don't know anything about the + associated scale -- so we've have to delay this decision + *) + VAR + measure: Measure; + BEGIN + NEW(measure); + measure.type := undefined; + measure.scale := NIL; + Services.Init(measure, measureType); + op := measure; + Operations.Init(op, opif, {Operations.add..Operations.cmp}); + END CreateOperand; + + PROCEDURE Assign(VAR target: Operations.Operand; source: Operations.Operand); + BEGIN + (*WITH source: Measure DO WITH target: Measure DO*) + WITH source: Measure DO IF target IS Measure THEN (* WITH is replaced by IS -- noch *) + (* target is already initialized but possibly to a dummy operand + by CreateOperand + *) + IF target(Measure).type = undefined THEN (* type guard introduced *) + (* init target with the scale of source *) + CreateMeasure(source.scale, SYS.VAL(Measure, target), source.type); (* need to cast *) + END; + IF target(Measure).scale # source.scale THEN + (* adapt scale type from source -- + this could lead to a type guard failure if + target is not of the appropiate type + *) + CreateMeasure(source.scale, SYS.VAL(Measure, target), source.type); + END; + IF target(Measure).type # source.type THEN + (* adapt measure type from source *) + CreateMeasure(target(Measure).scale, SYS.VAL(Measure, target), source.type); + END; + source.scale.if.assign(SYS.VAL(Measure, target), source); + END; END; + END Assign; + + PROCEDURE CheckCompatibility(op1, op2: Operations.Operand; + VAR m1, m2: Measure); + (* is needed by Op and Compare: + both operands are checked to be members of the same family; + if they have different scales of the same family a + conversion is done; + *) + VAR + scale1, scale2: Scale; + BEGIN + WITH op1: Measure DO WITH op2: Measure DO + scale1 := op1.scale; scale2 := op2.scale; + IF scale1 # scale2 THEN + ASSERT((scale1.family # NIL) & (scale1.family = scale2.family)); + (* convert both operands to the reference scale *) + CreateMeasure(scale1.family.reference, m1, op1.type); + scale1.if.scaleToReference(op1, m1); + CreateMeasure(scale2.family.reference, m2, op2.type); + scale2.if.scaleToReference(op2, m2); ELSE - scale.head := listp; + m1 := op1; + m2 := op2; END; - scale.tail := listp; - END InitUnit; + END; END; + END CheckCompatibility; - PROCEDURE CreateMeasure*(scale: Scale; VAR measure: Measure; type: SHORTINT); - BEGIN - scale.if.create(scale, measure, type = absolute); - Operations.Init(measure, opif, opcaps); - measure.scale := scale; - measure.type := type; - END CreateMeasure; + PROCEDURE Op(op: Operations.Operation; op1, op2: Operations.Operand; + VAR result: Operations.Operand); + VAR + restype: SHORTINT; (* type of result -- set by CheckTypes *) + m1, m2: Measure; - PROCEDURE CreateAbsMeasure*(scale: Scale; VAR measure: Measure); - (* init measure to the origin of the given system *) - BEGIN - CreateMeasure(scale, measure, absolute); - END CreateAbsMeasure; - - PROCEDURE CreateRelMeasure*(scale: Scale; VAR measure: Measure); - (* init relative measure to 0 *) - BEGIN - CreateMeasure(scale, measure, relative); - END CreateRelMeasure; - - PROCEDURE ConvertMeasure*(scale: Scale; VAR measure: Measure); - (* convert measure to the given scale which must belong - to the same family as the original scale of measure + PROCEDURE CheckTypes(VAR restype: SHORTINT); + (* check operands for correct typing; + sets restype to the correct result type; *) - VAR - newMeasure: Measure; - refMeasure: Measure; - reference: Scale; - BEGIN - IF scale = measure.scale THEN - (* trivial case -- nothing is to be done *) - RETURN - END; - (* check that both scales belong to the same family *) - ASSERT((scale.family # NIL) & (scale.family = measure.scale.family)); - CreateMeasure(scale, newMeasure, measure.type); - reference := scale.family.reference; - CreateMeasure(reference, refMeasure, measure.type); - measure.scale.if.scaleToReference(measure, refMeasure); - scale.if.referenceToScale(refMeasure, newMeasure); - measure := newMeasure; - END ConvertMeasure; - - PROCEDURE GetReference*(family: Family; VAR reference: Scale); - BEGIN - reference := family.reference; - END GetReference; - - PROCEDURE GetFamily*(scale: Scale; VAR family: Family); - BEGIN - family := scale.family; - END GetFamily; - - PROCEDURE GetScaleOfUnit*(unit: Unit; VAR scale: Scale); - BEGIN - scale := unit.scale; - END GetScaleOfUnit; - - PROCEDURE GetScale*(measure: Measure; VAR scale: Scale); - BEGIN - scale := measure.scale; - END GetScale; - - PROCEDURE TraverseUnits*(scale: Scale); - BEGIN - scale.nextUnit := scale.head; - END TraverseUnits; - - PROCEDURE NextUnit*(scale: Scale; VAR unit: Unit) : BOOLEAN; - BEGIN - IF scale.nextUnit # NIL THEN - unit := scale.nextUnit.unit; - scale.nextUnit := scale.nextUnit.next; - RETURN TRUE - ELSE - RETURN FALSE - END; - END NextUnit; - - PROCEDURE GetName*(unit: Unit; VAR name: UnitName); - BEGIN - name := unit.name; - END GetName; - - PROCEDURE GetValue*(measure: Measure; unit: Unit; VAR value: Value); - VAR - scale: Scale; - BEGIN - scale := measure.scale; - ASSERT(unit.scale = scale); - scale.if.getvalue(measure, unit, value); - END GetValue; - - PROCEDURE SetValue*(measure: Measure; unit: Unit; value: Value); - VAR - scale: Scale; - BEGIN - scale := measure.scale; - ASSERT(unit.scale = scale); - scale.if.setvalue(measure, unit, value); - END SetValue; - - PROCEDURE IsAbsolute*(measure: Measure) : BOOLEAN; - BEGIN - RETURN measure.type = absolute - END IsAbsolute; - - PROCEDURE IsRelative*(measure: Measure) : BOOLEAN; - BEGIN - RETURN measure.type = relative - END IsRelative; - - PROCEDURE MeasureType*(measure: Measure) : SHORTINT; - BEGIN - RETURN measure.type - END MeasureType; - - (* ======== interface procedures for Operations ================= *) - - PROCEDURE CreateOperand(VAR op: Operations.Operand); - (* at this time we don't know anything about the - associated scale -- so we've have to delay this decision - *) - VAR - measure: Measure; - BEGIN - NEW(measure); - measure.type := undefined; - measure.scale := NIL; - Services.Init(measure, measureType); - op := measure; - Operations.Init(op, opif, {Operations.add..Operations.cmp}); - END CreateOperand; - - PROCEDURE Assign(VAR target: Operations.Operand; source: Operations.Operand); - BEGIN - (*WITH source: Measure DO WITH target: Measure DO*) - WITH source: Measure DO IF target IS Measure THEN (* WITH is replaced by IS -- noch *) - (* target is already initialized but possibly to a dummy operand - by CreateOperand - *) - IF target(Measure).type = undefined THEN (* type guard introduced *) - (* init target with the scale of source *) - CreateMeasure(source.scale, SYS.VAL(Measure, target), source.type); (* need to cast *) - END; - IF target(Measure).scale # source.scale THEN - (* adapt scale type from source -- - this could lead to a type guard failure if - target is not of the appropiate type - *) - CreateMeasure(source.scale, SYS.VAL(Measure, target), source.type); - END; - IF target(Measure).type # source.type THEN - (* adapt measure type from source *) - CreateMeasure(target(Measure).scale, SYS.VAL(Measure, target), source.type); - END; - source.scale.if.assign(SYS.VAL(Measure, target), source); + VAR ok: BOOLEAN; + BEGIN + (*WITH op1: Measure DO WITH op2: Measure DO*) + IF op1 IS Measure THEN IF op2 IS Measure THEN + CASE op OF + | Operations.add: (* only abs + abs is invalid *) + ok := (op1(Measure).type = relative) OR + (op2(Measure).type = relative); + IF op1(Measure).type = op2(Measure).type THEN + (* both are relative *) + restype := relative; + ELSE + (* exactly one absolute type is involved *) + restype := absolute; + END; + | Operations.sub: (* only rel - abs is invalid *) + ok := op1(Measure).type <= op2(Measure).type; + IF op1(Measure).type # op2(Measure).type THEN + (* abs - rel *) + restype := absolute; + ELSE + (* abs - abs or rel - rel *) + restype := relative; + END; + ELSE + END; + ASSERT(ok); (* invalid operation *) END; END; - END Assign; + END CheckTypes; - PROCEDURE CheckCompatibility(op1, op2: Operations.Operand; - VAR m1, m2: Measure); - (* is needed by Op and Compare: - both operands are checked to be members of the same family; - if they have different scales of the same family a - conversion is done; - *) - VAR - scale1, scale2: Scale; - BEGIN - WITH op1: Measure DO WITH op2: Measure DO - scale1 := op1.scale; scale2 := op2.scale; - IF scale1 # scale2 THEN - ASSERT((scale1.family # NIL) & (scale1.family = scale2.family)); - (* convert both operands to the reference scale *) - CreateMeasure(scale1.family.reference, m1, op1.type); - scale1.if.scaleToReference(op1, m1); - CreateMeasure(scale2.family.reference, m2, op2.type); - scale2.if.scaleToReference(op2, m2); - ELSE - m1 := op1; - m2 := op2; - END; - END; END; - END CheckCompatibility; - - PROCEDURE Op(op: Operations.Operation; op1, op2: Operations.Operand; - VAR result: Operations.Operand); - VAR - restype: SHORTINT; (* type of result -- set by CheckTypes *) - m1, m2: Measure; - - PROCEDURE CheckTypes(VAR restype: SHORTINT); - (* check operands for correct typing; - sets restype to the correct result type; - *) - VAR ok: BOOLEAN; - BEGIN - (*WITH op1: Measure DO WITH op2: Measure DO*) - IF op1 IS Measure THEN IF op2 IS Measure THEN - CASE op OF - | Operations.add: (* only abs + abs is invalid *) - ok := (op1(Measure).type = relative) OR - (op2(Measure).type = relative); - IF op1(Measure).type = op2(Measure).type THEN - (* both are relative *) - restype := relative; - ELSE - (* exactly one absolute type is involved *) - restype := absolute; - END; - | Operations.sub: (* only rel - abs is invalid *) - ok := op1(Measure).type <= op2(Measure).type; - IF op1(Measure).type # op2(Measure).type THEN - (* abs - rel *) - restype := absolute; - ELSE - (* abs - abs or rel - rel *) - restype := relative; - END; - ELSE - END; - ASSERT(ok); (* invalid operation *) - END; END; - END CheckTypes; - - BEGIN (* Op *) - (* result is already of type Measure; this is guaranteed by Operations *) - IF result IS Measure THEN - CheckTypes(restype); - CheckCompatibility(op1, op2, m1, m2); - CreateMeasure(m1.scale, SYS.VAL(Measure, result), restype); - m1.scale.if.op(op, m1, m2, SYS.VAL(Measure, result)); - END; - END Op; - - PROCEDURE Compare(op1, op2: Operations.Operand) : INTEGER; - VAR - m1, m2: Measure; - BEGIN + BEGIN (* Op *) + (* result is already of type Measure; this is guaranteed by Operations *) + IF result IS Measure THEN + CheckTypes(restype); CheckCompatibility(op1, op2, m1, m2); - ASSERT(m1.type = m2.type); - CheckCompatibility(op1, op2, m1, m2); - RETURN m1.scale.if.compare(m1, m2) - END Compare; + CreateMeasure(m1.scale, SYS.VAL(Measure, result), restype); + m1.scale.if.op(op, m1, m2, SYS.VAL(Measure, result)); + END; + END Op; - PROCEDURE InitInterface; - BEGIN - NEW(opif); - opif.create := CreateOperand; - opif.assign := Assign; - opif.op := Op; - opif.compare := Compare; - opcaps := {Operations.add, Operations.sub, Operations.cmp}; - END InitInterface; + PROCEDURE Compare(op1, op2: Operations.Operand) : INTEGER; + VAR + m1, m2: Measure; + BEGIN + CheckCompatibility(op1, op2, m1, m2); + ASSERT(m1.type = m2.type); + CheckCompatibility(op1, op2, m1, m2); + RETURN m1.scale.if.compare(m1, m2) + END Compare; + + PROCEDURE InitInterface; + BEGIN + NEW(opif); + opif.create := CreateOperand; + opif.assign := Assign; + opif.op := Op; + opif.compare := Compare; + opcaps := {Operations.add, Operations.sub, Operations.cmp}; + END InitInterface; BEGIN - InitInterface; - PersistentObjects.RegisterType(measureType, - "Scales.Measure", "Operations.Operand", NIL); + InitInterface; + PersistentObjects.RegisterType(measureType, + "Scales.Measure", "Operations.Operand", NIL); END ulmScales. diff --git a/src/library/ulm/ulmServices.Mod b/src/library/ulm/ulmServices.Mod index 3b804e4f..7ec557df 100644 --- a/src/library/ulm/ulmServices.Mod +++ b/src/library/ulm/ulmServices.Mod @@ -1,520 +1,520 @@ (* Ulm's Oberon Library - Copyright (C) 1989-1994 by University of Ulm, SAI, D-89069 Ulm, Germany - ---------------------------------------------------------------------------- - Ulm's Oberon Library is free software; you can redistribute it - and/or modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either version - 2 of the License, or (at your option) any later version. + Copyright (C) 1989-1994 by University of Ulm, SAI, D-89069 Ulm, Germany + ---------------------------------------------------------------------------- + Ulm's Oberon Library is free software; you can redistribute it + and/or modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either version + 2 of the License, or (at your option) any later version. - Ulm's Oberon Library is distributed in the hope that it will be - useful, but WITHOUT ANY WARRANTY; without even the implied warranty - of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. + Ulm's Oberon Library is distributed in the hope that it will be + useful, but WITHOUT ANY WARRANTY; without even the implied warranty + of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - ---------------------------------------------------------------------------- - E-mail contact: oberon@mathematik.uni-ulm.de - ---------------------------------------------------------------------------- - $Id: Services.om,v 1.2 2004/09/03 09:34:24 borchert Exp $ - ---------------------------------------------------------------------------- - $Log: Services.om,v $ - Revision 1.2 2004/09/03 09:34:24 borchert - cache results of LoadService to avoid further attempts + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + ---------------------------------------------------------------------------- + E-mail contact: oberon@mathematik.uni-ulm.de + ---------------------------------------------------------------------------- + $Id: Services.om,v 1.2 2004/09/03 09:34:24 borchert Exp $ + ---------------------------------------------------------------------------- + $Log: Services.om,v $ + Revision 1.2 2004/09/03 09:34:24 borchert + cache results of LoadService to avoid further attempts - Revision 1.1 1995/03/03 09:32:15 borchert - Initial revision + Revision 1.1 1995/03/03 09:32:15 borchert + Initial revision - ---------------------------------------------------------------------------- + ---------------------------------------------------------------------------- *) MODULE ulmServices; - IMPORT Disciplines := ulmDisciplines, Objects := ulmObjects; + IMPORT Disciplines := ulmDisciplines, Objects := ulmObjects; - TYPE - Type* = POINTER TO TypeRec; - ServiceList = POINTER TO ServiceListRec; - Service* = POINTER TO ServiceRec; - Object* = POINTER TO ObjectRec; - ObjectRec* = - RECORD - (Disciplines.ObjectRec) - type: Type; - installed: ServiceList; (* set of installed services *) - END; - - InstallProc = PROCEDURE (object: Object; service: Service); - - ServiceRec* = - RECORD - (Disciplines.ObjectRec) - name: ARRAY 64 OF CHAR; - next: Service; - END; - - ServiceListRec = - RECORD - service: Service; - type: Type; - install: InstallProc; - next: ServiceList; - END; - - VAR - services: Service; - (* list of services -- needed to support Seek *) - - TYPE - LoadModuleProc* = PROCEDURE (module: ARRAY OF CHAR) : BOOLEAN; - LoadServiceProc* = PROCEDURE (service, for: ARRAY OF CHAR) : BOOLEAN; - LoaderInterface* = POINTER TO LoaderInterfaceRec; - LoaderInterfaceRec* = - RECORD - loadModule*: LoadModuleProc; - loadService*: LoadServiceProc; - END; - VAR - loaderIF: LoaderInterface; - - (* ==== name tables ================================================== *) - - CONST - bufsize = 512; (* length of a name buffer in bytes *) - tabsize = 1171; - TYPE - BufferPosition = INTEGER; - Length = LONGINT; - HashValue = INTEGER; - Buffer = ARRAY bufsize OF CHAR; - NameList = POINTER TO NameListRec; - NameListRec = - RECORD - buffer: Buffer; - next: NameList; - END; - VAR - currentBuf: NameList; currentPos: BufferPosition; - TYPE - TypeRec* = - RECORD - (Disciplines.ObjectRec) - baseType: Type; - services: ServiceList; - cachedservices: ServiceList; (* of base types *) - (* table management *) - hashval: HashValue; - length: Length; - begin: NameList; - pos: BufferPosition; - next: Type; (* next type with same hash value *) - END; - BucketTable = ARRAY tabsize OF Type; - VAR - bucket: BucketTable; - - (* ==== name table management ======================================== *) - - PROCEDURE Hash(name: ARRAY OF CHAR; length: LONGINT) : HashValue; - CONST - shift = 4; - VAR - index: LONGINT; - val: LONGINT; - ch: CHAR; - ordval: INTEGER; - BEGIN - index := 0; val := length; - WHILE index < length DO - ch := name[index]; - IF ch >= " " THEN - ordval := ORD(ch) - ORD(" "); - ELSE - ordval := ORD(MAX(CHAR)) - ORD(" ") + ORD(ch); - END; - val := ASH(val, shift) + ordval; - INC(index); + TYPE + Type* = POINTER TO TypeRec; + ServiceList = POINTER TO ServiceListRec; + Service* = POINTER TO ServiceRec; + Object* = POINTER TO ObjectRec; + ObjectRec* = + RECORD + (Disciplines.ObjectRec) + type: Type; + installed: ServiceList; (* set of installed services *) END; - val := val MOD tabsize; - RETURN SHORT(val) - END Hash; - PROCEDURE CreateBuf(VAR buf: NameList); - BEGIN - NEW(buf); buf.next := NIL; - IF currentBuf # NIL THEN - currentBuf.next := buf; + InstallProc = PROCEDURE (object: Object; service: Service); + + ServiceRec* = + RECORD + (Disciplines.ObjectRec) + name: ARRAY 64 OF CHAR; + next: Service; END; - currentBuf := buf; - currentPos := 0; - END CreateBuf; - PROCEDURE StringLength(string: ARRAY OF CHAR) : LONGINT; - VAR - index: LONGINT; - BEGIN - index := 0; - WHILE (index < LEN(string)) & (string[index] # 0X) DO - INC(index); + ServiceListRec = + RECORD + service: Service; + type: Type; + install: InstallProc; + next: ServiceList; END; - RETURN index - END StringLength; - PROCEDURE InitName(name: Type; string: ARRAY OF CHAR); - VAR - index, length: LONGINT; - firstbuf, buf: NameList; - startpos: BufferPosition; - BEGIN - IF currentBuf = NIL THEN - CreateBuf(buf); + VAR + services: Service; + (* list of services -- needed to support Seek *) + + TYPE + LoadModuleProc* = PROCEDURE (module: ARRAY OF CHAR) : BOOLEAN; + LoadServiceProc* = PROCEDURE (service, for: ARRAY OF CHAR) : BOOLEAN; + LoaderInterface* = POINTER TO LoaderInterfaceRec; + LoaderInterfaceRec* = + RECORD + loadModule*: LoadModuleProc; + loadService*: LoadServiceProc; + END; + VAR + loaderIF: LoaderInterface; + + (* ==== name tables ================================================== *) + + CONST + bufsize = 512; (* length of a name buffer in bytes *) + tabsize = 1171; + TYPE + BufferPosition = INTEGER; + Length = LONGINT; + HashValue = INTEGER; + Buffer = ARRAY bufsize OF CHAR; + NameList = POINTER TO NameListRec; + NameListRec = + RECORD + buffer: Buffer; + next: NameList; + END; + VAR + currentBuf: NameList; currentPos: BufferPosition; + TYPE + TypeRec* = + RECORD + (Disciplines.ObjectRec) + baseType: Type; + services: ServiceList; + cachedservices: ServiceList; (* of base types *) + (* table management *) + hashval: HashValue; + length: Length; + begin: NameList; + pos: BufferPosition; + next: Type; (* next type with same hash value *) + END; + BucketTable = ARRAY tabsize OF Type; + VAR + bucket: BucketTable; + + (* ==== name table management ======================================== *) + + PROCEDURE Hash(name: ARRAY OF CHAR; length: LONGINT) : HashValue; + CONST + shift = 4; + VAR + index: LONGINT; + val: LONGINT; + ch: CHAR; + ordval: INTEGER; + BEGIN + index := 0; val := length; + WHILE index < length DO + ch := name[index]; + IF ch >= " " THEN + ordval := ORD(ch) - ORD(" "); ELSE - buf := currentBuf; + ordval := ORD(MAX(CHAR)) - ORD(" ") + ORD(ch); END; + val := ASH(val, shift) + ordval; + INC(index); + END; + val := val MOD tabsize; + RETURN SHORT(val) + END Hash; - firstbuf := buf; startpos := currentPos; - index := 0; - WHILE (index < LEN(string)) & (string[index] # 0X) DO - IF currentPos = bufsize THEN - CreateBuf(buf); - END; - buf.buffer[currentPos] := string[index]; INC(currentPos); - INC(index); + PROCEDURE CreateBuf(VAR buf: NameList); + BEGIN + NEW(buf); buf.next := NIL; + IF currentBuf # NIL THEN + currentBuf.next := buf; + END; + currentBuf := buf; + currentPos := 0; + END CreateBuf; + + PROCEDURE StringLength(string: ARRAY OF CHAR) : LONGINT; + VAR + index: LONGINT; + BEGIN + index := 0; + WHILE (index < LEN(string)) & (string[index] # 0X) DO + INC(index); + END; + RETURN index + END StringLength; + + PROCEDURE InitName(name: Type; string: ARRAY OF CHAR); + VAR + index, length: LONGINT; + firstbuf, buf: NameList; + startpos: BufferPosition; + BEGIN + IF currentBuf = NIL THEN + CreateBuf(buf); + ELSE + buf := currentBuf; + END; + + firstbuf := buf; startpos := currentPos; + index := 0; + WHILE (index < LEN(string)) & (string[index] # 0X) DO + IF currentPos = bufsize THEN + CreateBuf(buf); END; - length := index; + buf.buffer[currentPos] := string[index]; INC(currentPos); + INC(index); + END; + length := index; - name.hashval := Hash(string, length); - name.length := length; - name.begin := firstbuf; - name.pos := startpos; - name.next := bucket[name.hashval]; - bucket[name.hashval] := name; - END InitName; + name.hashval := Hash(string, length); + name.length := length; + name.begin := firstbuf; + name.pos := startpos; + name.next := bucket[name.hashval]; + bucket[name.hashval] := name; + END InitName; - PROCEDURE EqualName(name: Type; string: ARRAY OF CHAR) : BOOLEAN; - (* precondition: both have the same length *) + PROCEDURE EqualName(name: Type; string: ARRAY OF CHAR) : BOOLEAN; + (* precondition: both have the same length *) + VAR + index: LONGINT; + buf: NameList; + pos: INTEGER; + BEGIN + buf := name.begin; pos := name.pos; + index := 0; + WHILE index < name.length DO + IF pos = bufsize THEN + buf := buf.next; pos := 0; + END; + IF string[index] # buf.buffer[pos] THEN + RETURN FALSE + END; + INC(pos); + INC(index); + END; + RETURN TRUE + END EqualName; + + PROCEDURE SeekName(string: ARRAY OF CHAR; VAR name: Type) : BOOLEAN; + VAR + length: LONGINT; + hashval: HashValue; + p: Type; + BEGIN + length := StringLength(string); + hashval := Hash(string, length); + p := bucket[hashval]; + WHILE (p # NIL) & ((length # p.length) OR ~EqualName(p, string)) DO + p := p.next; + END; + name := p; + RETURN p # NIL + END SeekName; + + PROCEDURE ExtractName(name: Type; VAR string: ARRAY OF CHAR); + VAR + index: LONGINT; + buf: NameList; + pos: INTEGER; + BEGIN + buf := name.begin; pos := name.pos; + index := 0; + WHILE (index + 1 < LEN(string)) & (index < name.length) DO + IF pos = bufsize THEN + buf := buf.next; pos := 0; + END; + string[index] := buf.buffer[pos]; + INC(pos); + INC(index); + END; + string[index] := 0X; + END ExtractName; + + PROCEDURE LoadModule(module: ARRAY OF CHAR) : BOOLEAN; + BEGIN + IF (loaderIF # NIL) & (loaderIF.loadModule # NIL) THEN + RETURN loaderIF.loadModule(module) + ELSE + RETURN FALSE + END; + END LoadModule; + + PROCEDURE LoadService(service, for: ARRAY OF CHAR) : BOOLEAN; + BEGIN + IF (loaderIF # NIL) & (loaderIF.loadService # NIL) THEN + RETURN loaderIF.loadService(service, for) + ELSE + RETURN FALSE + END; + END LoadService; + + PROCEDURE MemberOf(list: ServiceList; service: Service; + VAR member: ServiceList) : BOOLEAN; + VAR + p: ServiceList; + BEGIN + p := list; + WHILE (p # NIL) & (p.service # service) DO + p := p.next; + END; + member := p; + RETURN p # NIL + END MemberOf; + + PROCEDURE SeekService(type: Type; service: Service; + VAR member: ServiceList; + VAR baseType: Type) : BOOLEAN; + + VAR + btype: Type; + cachedservice: ServiceList; + + PROCEDURE Seek(type: Type; service: Service; + VAR member: ServiceList) : BOOLEAN; VAR - index: LONGINT; - buf: NameList; - pos: INTEGER; - BEGIN - buf := name.begin; pos := name.pos; - index := 0; - WHILE index < name.length DO - IF pos = bufsize THEN - buf := buf.next; pos := 0; - END; - IF string[index] # buf.buffer[pos] THEN - RETURN FALSE - END; - INC(pos); - INC(index); + typeName: ARRAY 512 OF CHAR; + BEGIN + IF MemberOf(type.services, service, member) OR + MemberOf(type.cachedservices, service, member) THEN + RETURN TRUE END; + ExtractName(type, typeName); + RETURN LoadService(service.name, typeName) & + MemberOf(type.services, service, member) + END Seek; + + BEGIN (* SeekService *) + btype := type; + WHILE (btype # NIL) & ~Seek(btype, service, member) DO + btype := btype.baseType; + END; + IF (member # NIL) & (btype # type) THEN + (* cache result to avoid further tries to load + a more fitting variant dynamically + *) + NEW(cachedservice); + cachedservice.service := service; + cachedservice.type := member.type; + cachedservice.install := member.install; + cachedservice.next := type.cachedservices; + type.cachedservices := cachedservice; + baseType := member.type; RETURN TRUE - END EqualName; + END; + IF member = NIL THEN + RETURN FALSE + ELSE + baseType := member.type; + RETURN TRUE + END; + END SeekService; - PROCEDURE SeekName(string: ARRAY OF CHAR; VAR name: Type) : BOOLEAN; - VAR - length: LONGINT; - hashval: HashValue; - p: Type; - BEGIN - length := StringLength(string); - hashval := Hash(string, length); - p := bucket[hashval]; - WHILE (p # NIL) & ((length # p.length) OR ~EqualName(p, string)) DO - p := p.next; + PROCEDURE GetModule(name: ARRAY OF CHAR; VAR module: ARRAY OF CHAR); + (* get the name of the module where 'name' was defined *) + VAR + index: INTEGER; + BEGIN + index := 0; + WHILE (name[index] # ".") & (name[index] # 0X) & + (index < LEN(module)-1) DO + module[index] := name[index]; INC(index); + END; + module[index] := 0X; + END GetModule; + + (* ==== exported procedures ========================================== *) + + PROCEDURE InitLoader*(if: LoaderInterface); + BEGIN + ASSERT((loaderIF = NIL) & (if # NIL)); + loaderIF := if; + END InitLoader; + + PROCEDURE InitType*(type: Type; name, baseName: ARRAY OF CHAR); + VAR + baseType: Type; + otherType: Type; + ok: BOOLEAN; + BEGIN + IF baseName = "" THEN + baseType := NIL; + ELSE + ok := SeekName(baseName, baseType); ASSERT(ok); + END; + ASSERT(~SeekName(name, otherType)); + InitName(type, name); + type.baseType := baseType; + type.services := NIL; + type.cachedservices := NIL; + END InitType; + + PROCEDURE CreateType*(VAR type: Type; name, baseName: ARRAY OF CHAR); + BEGIN + NEW(type); InitType(type, name, baseName); + END CreateType; + + PROCEDURE Init*(object: Object; type: Type); + BEGIN + ASSERT(type # NIL); + ASSERT(object.type = NIL); + object.type := type; + object.installed := NIL; + END Init; + + PROCEDURE GetType*(object: Object; VAR type: Type); + BEGIN + type := object.type; + END GetType; + + PROCEDURE GetTypeName*(type: Type; VAR name: ARRAY OF CHAR); + BEGIN + ExtractName(type, name); + END GetTypeName; + + PROCEDURE GetBaseType*(type: Type; VAR baseType: Type); + BEGIN + baseType := type.baseType; + END GetBaseType; + + PROCEDURE IsExtensionOf*(type, baseType: Type) : BOOLEAN; + BEGIN + ASSERT(baseType # NIL); + WHILE (type # NIL) & (type # baseType) DO + type := type.baseType; + END; + RETURN type = baseType + END IsExtensionOf; + + PROCEDURE SeekType*(name: ARRAY OF CHAR; VAR type: Type); + VAR + module: ARRAY 64 OF CHAR; + BEGIN + IF ~SeekName(name, type) THEN + (* try to load the associated module *) + GetModule(name, module); + IF ~LoadModule(module) OR ~SeekName(name, type) THEN + type := NIL; END; - name := p; - RETURN p # NIL - END SeekName; + END; + END SeekType; - PROCEDURE ExtractName(name: Type; VAR string: ARRAY OF CHAR); - VAR - index: LONGINT; - buf: NameList; - pos: INTEGER; - BEGIN - buf := name.begin; pos := name.pos; - index := 0; - WHILE (index + 1 < LEN(string)) & (index < name.length) DO - IF pos = bufsize THEN - buf := buf.next; pos := 0; - END; - string[index] := buf.buffer[pos]; - INC(pos); - INC(index); - END; - string[index] := 0X; - END ExtractName; + PROCEDURE Seek*(name: ARRAY OF CHAR; VAR service: Service); + BEGIN + service := services; + WHILE (service # NIL) & (service.name # name) DO + service := service.next; + END; - PROCEDURE LoadModule(module: ARRAY OF CHAR) : BOOLEAN; - BEGIN - IF (loaderIF # NIL) & (loaderIF.loadModule # NIL) THEN - RETURN loaderIF.loadModule(module) - ELSE - RETURN FALSE - END; - END LoadModule; - - PROCEDURE LoadService(service, for: ARRAY OF CHAR) : BOOLEAN; - BEGIN - IF (loaderIF # NIL) & (loaderIF.loadService # NIL) THEN - RETURN loaderIF.loadService(service, for) - ELSE - RETURN FALSE - END; - END LoadService; - - PROCEDURE MemberOf(list: ServiceList; service: Service; - VAR member: ServiceList) : BOOLEAN; - VAR - p: ServiceList; - BEGIN - p := list; - WHILE (p # NIL) & (p.service # service) DO - p := p.next; - END; - member := p; - RETURN p # NIL - END MemberOf; - - PROCEDURE SeekService(type: Type; service: Service; - VAR member: ServiceList; - VAR baseType: Type) : BOOLEAN; - - VAR - btype: Type; - cachedservice: ServiceList; - - PROCEDURE Seek(type: Type; service: Service; - VAR member: ServiceList) : BOOLEAN; - VAR - typeName: ARRAY 512 OF CHAR; - BEGIN - IF MemberOf(type.services, service, member) OR - MemberOf(type.cachedservices, service, member) THEN - RETURN TRUE - END; - ExtractName(type, typeName); - RETURN LoadService(service.name, typeName) & - MemberOf(type.services, service, member) - END Seek; - - BEGIN (* SeekService *) - btype := type; - WHILE (btype # NIL) & ~Seek(btype, service, member) DO - btype := btype.baseType; - END; - IF (member # NIL) & (btype # type) THEN - (* cache result to avoid further tries to load - a more fitting variant dynamically - *) - NEW(cachedservice); - cachedservice.service := service; - cachedservice.type := member.type; - cachedservice.install := member.install; - cachedservice.next := type.cachedservices; - type.cachedservices := cachedservice; - baseType := member.type; - RETURN TRUE - END; - IF member = NIL THEN - RETURN FALSE - ELSE - baseType := member.type; - RETURN TRUE - END; - END SeekService; - - PROCEDURE GetModule(name: ARRAY OF CHAR; VAR module: ARRAY OF CHAR); - (* get the name of the module where 'name' was defined *) - VAR - index: INTEGER; - BEGIN - index := 0; - WHILE (name[index] # ".") & (name[index] # 0X) & - (index < LEN(module)-1) DO - module[index] := name[index]; INC(index); - END; - module[index] := 0X; - END GetModule; - - (* ==== exported procedures ========================================== *) - - PROCEDURE InitLoader*(if: LoaderInterface); - BEGIN - ASSERT((loaderIF = NIL) & (if # NIL)); - loaderIF := if; - END InitLoader; - - PROCEDURE InitType*(type: Type; name, baseName: ARRAY OF CHAR); - VAR - baseType: Type; - otherType: Type; - ok: BOOLEAN; - BEGIN - IF baseName = "" THEN - baseType := NIL; - ELSE - ok := SeekName(baseName, baseType); ASSERT(ok); - END; - ASSERT(~SeekName(name, otherType)); - InitName(type, name); - type.baseType := baseType; - type.services := NIL; - type.cachedservices := NIL; - END InitType; - - PROCEDURE CreateType*(VAR type: Type; name, baseName: ARRAY OF CHAR); - BEGIN - NEW(type); InitType(type, name, baseName); - END CreateType; - - PROCEDURE Init*(object: Object; type: Type); - BEGIN - ASSERT(type # NIL); - ASSERT(object.type = NIL); - object.type := type; - object.installed := NIL; - END Init; - - PROCEDURE GetType*(object: Object; VAR type: Type); - BEGIN - type := object.type; - END GetType; - - PROCEDURE GetTypeName*(type: Type; VAR name: ARRAY OF CHAR); - BEGIN - ExtractName(type, name); - END GetTypeName; - - PROCEDURE GetBaseType*(type: Type; VAR baseType: Type); - BEGIN - baseType := type.baseType; - END GetBaseType; - - PROCEDURE IsExtensionOf*(type, baseType: Type) : BOOLEAN; - BEGIN - ASSERT(baseType # NIL); - WHILE (type # NIL) & (type # baseType) DO - type := type.baseType; - END; - RETURN type = baseType - END IsExtensionOf; - - PROCEDURE SeekType*(name: ARRAY OF CHAR; VAR type: Type); - VAR - module: ARRAY 64 OF CHAR; - BEGIN - IF ~SeekName(name, type) THEN - (* try to load the associated module *) - GetModule(name, module); - IF ~LoadModule(module) OR ~SeekName(name, type) THEN - type := NIL; - END; - END; - END SeekType; - - PROCEDURE Seek*(name: ARRAY OF CHAR; VAR service: Service); - BEGIN + (* try to load a module named after `name', if not successful *) + IF (service = NIL) & LoadModule(name) THEN service := services; WHILE (service # NIL) & (service.name # name) DO - service := service.next; + service := service.next; END; + END; + END Seek; - (* try to load a module named after `name', if not successful *) - IF (service = NIL) & LoadModule(name) THEN - service := services; - WHILE (service # NIL) & (service.name # name) DO - service := service.next; - END; + PROCEDURE Create*(VAR service: Service; name: ARRAY OF CHAR); + + PROCEDURE Created(name: ARRAY OF CHAR) : BOOLEAN; + VAR + service: Service; + BEGIN + service := services; + WHILE (service # NIL) & (service.name # name) DO + service := service.next; END; - END Seek; + RETURN service # NIL + END Created; - PROCEDURE Create*(VAR service: Service; name: ARRAY OF CHAR); + BEGIN + ASSERT(~Created(name)); + NEW(service); + COPY(name, service.name); + service.next := services; services := service; + END Create; - PROCEDURE Created(name: ARRAY OF CHAR) : BOOLEAN; - VAR - service: Service; - BEGIN - service := services; - WHILE (service # NIL) & (service.name # name) DO - service := service.next; - END; - RETURN service # NIL - END Created; + PROCEDURE Define*(type: Type; service: Service; install: InstallProc); + VAR + member: ServiceList; + BEGIN + ASSERT(service # NIL); + (* protect against multiple definitions: *) + ASSERT(~MemberOf(type.services, service, member)); - BEGIN - ASSERT(~Created(name)); - NEW(service); - COPY(name, service.name); - service.next := services; services := service; - END Create; + NEW(member); member.service := service; + member.install := install; member.type := type; + member.next := type.services; type.services := member; + END Define; - PROCEDURE Define*(type: Type; service: Service; install: InstallProc); - VAR - member: ServiceList; - BEGIN - ASSERT(service # NIL); - (* protect against multiple definitions: *) - ASSERT(~MemberOf(type.services, service, member)); - - NEW(member); member.service := service; - member.install := install; member.type := type; - member.next := type.services; type.services := member; - END Define; - - PROCEDURE Install*(object: Object; service: Service) : BOOLEAN; - VAR - member, installed: ServiceList; - baseType: Type; - BEGIN - IF object.type = NIL THEN RETURN FALSE END; - IF ~SeekService(object.type, service, member, baseType) THEN - (* service not supported for this object type *) - RETURN FALSE + PROCEDURE Install*(object: Object; service: Service) : BOOLEAN; + VAR + member, installed: ServiceList; + baseType: Type; + BEGIN + IF object.type = NIL THEN RETURN FALSE END; + IF ~SeekService(object.type, service, member, baseType) THEN + (* service not supported for this object type *) + RETURN FALSE + END; + IF ~MemberOf(object.installed, service, installed) THEN + (* install services only once *) + IF member.install # NIL THEN + member.install(object, service); END; - IF ~MemberOf(object.installed, service, installed) THEN - (* install services only once *) - IF member.install # NIL THEN - member.install(object, service); - END; - NEW(installed); - installed.service := service; - installed.next := object.installed; - object.installed := installed; - END; - RETURN TRUE - END Install; + NEW(installed); + installed.service := service; + installed.next := object.installed; + object.installed := installed; + END; + RETURN TRUE + END Install; - PROCEDURE Supported*(object: Object; service: Service) : BOOLEAN; - VAR - member: ServiceList; - baseType: Type; - BEGIN - RETURN (object.type # NIL) & - SeekService(object.type, service, member, baseType) - END Supported; + PROCEDURE Supported*(object: Object; service: Service) : BOOLEAN; + VAR + member: ServiceList; + baseType: Type; + BEGIN + RETURN (object.type # NIL) & + SeekService(object.type, service, member, baseType) + END Supported; - PROCEDURE Installed*(object: Object; service: Service) : BOOLEAN; - VAR - member: ServiceList; - BEGIN - RETURN MemberOf(object.installed, service, member) - END Installed; + PROCEDURE Installed*(object: Object; service: Service) : BOOLEAN; + VAR + member: ServiceList; + BEGIN + RETURN MemberOf(object.installed, service, member) + END Installed; - PROCEDURE GetSupportedBaseType*(object: Object; service: Service; - VAR baseType: Type); - VAR - member: ServiceList; - BEGIN - IF ~SeekService(object.type, service, member, baseType) THEN - baseType := NIL; - END; - END GetSupportedBaseType; + PROCEDURE GetSupportedBaseType*(object: Object; service: Service; + VAR baseType: Type); + VAR + member: ServiceList; + BEGIN + IF ~SeekService(object.type, service, member, baseType) THEN + baseType := NIL; + END; + END GetSupportedBaseType; BEGIN - currentBuf := NIL; currentPos := 0; loaderIF := NIL; + currentBuf := NIL; currentPos := 0; loaderIF := NIL; END ulmServices. diff --git a/src/library/ulm/ulmStreamDisciplines.Mod b/src/library/ulm/ulmStreamDisciplines.Mod index 686214c9..522f9cda 100644 --- a/src/library/ulm/ulmStreamDisciplines.Mod +++ b/src/library/ulm/ulmStreamDisciplines.Mod @@ -1,246 +1,249 @@ (* Ulm's Oberon Library - Copyright (C) 1989-1994 by University of Ulm, SAI, D-89069 Ulm, Germany - ---------------------------------------------------------------------------- - Ulm's Oberon Library is free software; you can redistribute it - and/or modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either version - 2 of the License, or (at your option) any later version. + Copyright (C) 1989-1994 by University of Ulm, SAI, D-89069 Ulm, Germany + ---------------------------------------------------------------------------- + Ulm's Oberon Library is free software; you can redistribute it + and/or modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either version + 2 of the License, or (at your option) any later version. - Ulm's Oberon Library is distributed in the hope that it will be - useful, but WITHOUT ANY WARRANTY; without even the implied warranty - of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. + Ulm's Oberon Library is distributed in the hope that it will be + useful, but WITHOUT ANY WARRANTY; without even the implied warranty + of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - ---------------------------------------------------------------------------- - E-mail contact: oberon@mathematik.uni-ulm.de - ---------------------------------------------------------------------------- - $Id: StreamDisci.om,v 1.2 1994/07/04 14:53:25 borchert Exp $ - ---------------------------------------------------------------------------- - $Log: StreamDisci.om,v $ - Revision 1.2 1994/07/04 14:53:25 borchert - parameter for indentation width added + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + ---------------------------------------------------------------------------- + E-mail contact: oberon@mathematik.uni-ulm.de + ---------------------------------------------------------------------------- + $Id: StreamDisci.om,v 1.2 1994/07/04 14:53:25 borchert Exp $ + ---------------------------------------------------------------------------- + $Log: StreamDisci.om,v $ + Revision 1.2 1994/07/04 14:53:25 borchert + parameter for indentation width added - Revision 1.1 1994/02/22 20:10:34 borchert - Initial revision + Revision 1.1 1994/02/22 20:10:34 borchert + Initial revision - ---------------------------------------------------------------------------- - AFB 10/91 - ---------------------------------------------------------------------------- + ---------------------------------------------------------------------------- + AFB 10/91 + ---------------------------------------------------------------------------- *) MODULE ulmStreamDisciplines; - (* definition of general-purpose disciplines for streams *) + (* definition of general-purpose disciplines for streams *) - IMPORT ASCII := ulmASCII, Disciplines := ulmIndirectDisciplines, Events := ulmEvents, Sets := ulmSets, Streams := ulmStreams, SYSTEM; + IMPORT ASCII := ulmASCII, Disciplines := ulmIndirectDisciplines, Events := ulmEvents, Sets := ulmSets, Streams := ulmStreams, SYSTEM; - TYPE - LineTerminator* = ARRAY 4 OF CHAR; - VAR - badfieldsepset*: Events.EventType; + TYPE + LineTerminator* = ARRAY 4 OF CHAR; + VAR + badfieldsepset*: Events.EventType; - TYPE - StreamDiscipline = POINTER TO StreamDisciplineRec; - StreamDisciplineRec = - RECORD - (Disciplines.DisciplineRec) - lineterm: LineTerminator; - fieldseps: Sets.CharSet; - fieldsep: CHAR; (* one of them *) - whitespace: Sets.CharSet; - indentwidth: INTEGER; - END; - - VAR - id: Disciplines.Identifier; - (* default values *) - defaultFieldSeps: Sets.CharSet; - defaultFieldSep: CHAR; - defaultLineTerm: LineTerminator; - defaultWhiteSpace: Sets.CharSet; - defaultIndentWidth: INTEGER; - - PROCEDURE InitDiscipline(VAR disc: StreamDiscipline); - BEGIN - NEW(disc); disc.id := id; - disc.fieldseps := defaultFieldSeps; - disc.fieldsep := defaultFieldSep; - disc.lineterm := defaultLineTerm; - disc.whitespace := defaultWhiteSpace; - disc.indentwidth := defaultIndentWidth; - END InitDiscipline; - - PROCEDURE SetLineTerm*(s: Streams.Stream; lineterm: LineTerminator); - VAR - disc: StreamDiscipline; - BEGIN - IF ~Disciplines.Seek(s, id, SYSTEM.VAL(Disciplines.Discipline, disc)) THEN - InitDiscipline(disc); + TYPE + StreamDiscipline = POINTER TO StreamDisciplineRec; + StreamDisciplineRec = + RECORD + (Disciplines.DisciplineRec) + lineterm: LineTerminator; + fieldseps: Sets.CharSet; + fieldsep: CHAR; (* one of them *) + whitespace: Sets.CharSet; + indentwidth: INTEGER; END; - disc.lineterm := lineterm; + + VAR + id: Disciplines.Identifier; + (* default values *) + defaultFieldSeps: Sets.CharSet; + defaultFieldSep: CHAR; + defaultLineTerm: LineTerminator; + defaultWhiteSpace: Sets.CharSet; + defaultIndentWidth: INTEGER; + + PROCEDURE InitDiscipline(VAR disc: Disciplines.Discipline); + VAR + sdisc: StreamDiscipline; + BEGIN + NEW(sdisc); sdisc.id := id; + sdisc.fieldseps := defaultFieldSeps; + sdisc.fieldsep := defaultFieldSep; + sdisc.lineterm := defaultLineTerm; + sdisc.whitespace := defaultWhiteSpace; + sdisc.indentwidth := defaultIndentWidth; + disc := sdisc + END InitDiscipline; + + PROCEDURE SetLineTerm*(s: Streams.Stream; lineterm: LineTerminator); + VAR + disc: Disciplines.Discipline; + BEGIN + IF ~Disciplines.Seek(s, id, disc) THEN + InitDiscipline(disc); + END; + disc(StreamDiscipline).lineterm := lineterm; + Disciplines.Add(s, disc); + END SetLineTerm; + + PROCEDURE GetLineTerm*(s: Streams.Stream; VAR lineterm: LineTerminator); + (* default line terminator is ASCII.nl *) + VAR + disc: Disciplines.Discipline; + BEGIN + IF Disciplines.Seek(s, id, disc) THEN + lineterm := disc(StreamDiscipline).lineterm; + ELSE + lineterm := defaultLineTerm; + END; + END GetLineTerm; + + PROCEDURE SetFieldSepSet*(s: Streams.Stream; fieldsepset: Sets.CharSet); + (* cardinality of fieldsepset must be >= 1 *) + VAR + disc: Disciplines.Discipline; + ch: CHAR; found: BOOLEAN; + fieldsep: CHAR; + event: Events.Event; + BEGIN + ch := 0X; + LOOP (* seek for the first element inside fieldsepset *) + IF Sets.CharIn(fieldsepset, ch) THEN + found := TRUE; fieldsep := ch; EXIT + END; + IF ch = MAX(CHAR) THEN + found := FALSE; EXIT + END; + ch := CHR(ORD(ch) + 1); + END; + IF ~found THEN + NEW(event); + event.message := "StreamDisciplines.SetFieldSepSet: empty fieldsepset"; + event.type := badfieldsepset; + Events.Raise(event); + RETURN + END; + IF ~Disciplines.Seek(s, id, disc) THEN + InitDiscipline(disc); + END; + disc(StreamDiscipline).fieldseps := fieldsepset; + disc(StreamDiscipline).fieldsep := fieldsep; + Disciplines.Add(s, disc); + END SetFieldSepSet; + + PROCEDURE GetFieldSepSet*(s: Streams.Stream; VAR fieldsepset: Sets.CharSet); + (* default field separators are ASCII.tab and ASCII.sp *) + VAR + disc: Disciplines.Discipline; + BEGIN + IF Disciplines.Seek(s, id, disc) THEN + fieldsepset := disc(StreamDiscipline).fieldseps; + ELSE + fieldsepset := defaultFieldSeps; + END; + END GetFieldSepSet; + + PROCEDURE SetFieldSep*(s: Streams.Stream; fieldsep: CHAR); + VAR + disc: Disciplines.Discipline; + BEGIN + IF ~Disciplines.Seek(s, id, disc) THEN + InitDiscipline(disc); + END; + Sets.InclChar(disc(StreamDiscipline).fieldseps, fieldsep); + disc(StreamDiscipline).fieldsep := fieldsep; + Disciplines.Add(s, disc); + END SetFieldSep; + + PROCEDURE GetFieldSep*(s: Streams.Stream; VAR fieldsep: CHAR); + (* default field separator is ASCII.tab; + if a set of field separators has been given via SetFieldSepSet, + one of them is returned + *) + VAR + disc: Disciplines.Discipline; + BEGIN + IF Disciplines.Seek(s, id, disc) THEN + fieldsep := disc(StreamDiscipline).fieldsep; + ELSE + fieldsep := defaultFieldSep; + END; + END GetFieldSep; + + PROCEDURE GetWhiteSpace*(s: Streams.Stream; VAR whitespace: Sets.CharSet); + (* default: ASCII.tab, ASCII.sp, ASCII.np and ASCII.nl *) + VAR + disc: Disciplines.Discipline; + BEGIN + IF Disciplines.Seek(s, id, disc) THEN + whitespace := disc(StreamDiscipline).whitespace; + ELSE + whitespace := defaultWhiteSpace; + END; + END GetWhiteSpace; + + PROCEDURE SetWhiteSpace*(s: Streams.Stream; whitespace: Sets.CharSet); + VAR + disc: Disciplines.Discipline; + BEGIN + IF ~Disciplines.Seek(s, id, disc) THEN + InitDiscipline(disc); + END; + disc(StreamDiscipline).whitespace := whitespace; + Disciplines.Add(s, disc); + END SetWhiteSpace; + + PROCEDURE SetIndentationWidth*(s: Streams.Stream; indentwidth: INTEGER); + VAR + disc: Disciplines.Discipline; + BEGIN + IF indentwidth >= 0 THEN + IF ~Disciplines.Seek(s, id, disc) THEN + InitDiscipline(disc); + END; + disc(StreamDiscipline).indentwidth := indentwidth; Disciplines.Add(s, disc); - END SetLineTerm; + END; + END SetIndentationWidth; - PROCEDURE GetLineTerm*(s: Streams.Stream; VAR lineterm: LineTerminator); - (* default line terminator is ASCII.nl *) - VAR - disc: StreamDiscipline; - BEGIN - IF Disciplines.Seek(s, id, SYSTEM.VAL(Disciplines.Discipline, disc)) THEN - lineterm := disc.lineterm; - ELSE - lineterm := defaultLineTerm; - END; - END GetLineTerm; + PROCEDURE GetIndentationWidth*(s: Streams.Stream; VAR indentwidth: INTEGER); + VAR + disc: Disciplines.Discipline; + BEGIN + IF Disciplines.Seek(s, id, disc) THEN + indentwidth := disc(StreamDiscipline).indentwidth; + ELSE + indentwidth := defaultIndentWidth; + END; + END GetIndentationWidth; - PROCEDURE SetFieldSepSet*(s: Streams.Stream; fieldsepset: Sets.CharSet); - (* cardinality of fieldsepset must be >= 1 *) - VAR - disc: StreamDiscipline; - ch: CHAR; found: BOOLEAN; - fieldsep: CHAR; - event: Events.Event; - BEGIN - ch := 0X; - LOOP (* seek for the first element inside fieldsepset *) - IF Sets.CharIn(fieldsepset, ch) THEN - found := TRUE; fieldsep := ch; EXIT - END; - IF ch = MAX(CHAR) THEN - found := FALSE; EXIT - END; - ch := CHR(ORD(ch) + 1); - END; - IF ~found THEN - NEW(event); - event.message := "StreamDisciplines.SetFieldSepSet: empty fieldsepset"; - event.type := badfieldsepset; - Events.Raise(event); - RETURN - END; - IF ~Disciplines.Seek(s, id, SYSTEM.VAL(Disciplines.Discipline, disc)) THEN - InitDiscipline(disc); - END; - disc.fieldseps := fieldsepset; - disc.fieldsep := fieldsep; - Disciplines.Add(s, disc); - END SetFieldSepSet; - - PROCEDURE GetFieldSepSet*(s: Streams.Stream; VAR fieldsepset: Sets.CharSet); - (* default field separators are ASCII.tab and ASCII.sp *) - VAR - disc: StreamDiscipline; - BEGIN - IF Disciplines.Seek(s, id, SYSTEM.VAL(Disciplines.Discipline, disc)) THEN - fieldsepset := disc.fieldseps; - ELSE - fieldsepset := defaultFieldSeps; - END; - END GetFieldSepSet; - - PROCEDURE SetFieldSep*(s: Streams.Stream; fieldsep: CHAR); - VAR - disc: StreamDiscipline; - BEGIN - IF ~Disciplines.Seek(s, id, SYSTEM.VAL(Disciplines.Discipline, disc)) THEN - InitDiscipline(disc); - END; - Sets.InclChar(disc.fieldseps, fieldsep); - disc.fieldsep := fieldsep; - Disciplines.Add(s, disc); - END SetFieldSep; - - PROCEDURE GetFieldSep*(s: Streams.Stream; VAR fieldsep: CHAR); - (* default field separator is ASCII.tab; - if a set of field separators has been given via SetFieldSepSet, - one of them is returned - *) - VAR - disc: StreamDiscipline; - BEGIN - IF Disciplines.Seek(s, id, SYSTEM.VAL(Disciplines.Discipline, disc)) THEN - fieldsep := disc.fieldsep; - ELSE - fieldsep := defaultFieldSep; - END; - END GetFieldSep; - - PROCEDURE GetWhiteSpace*(s: Streams.Stream; VAR whitespace: Sets.CharSet); - (* default: ASCII.tab, ASCII.sp, ASCII.np and ASCII.nl *) - VAR - disc: StreamDiscipline; - BEGIN - IF Disciplines.Seek(s, id, SYSTEM.VAL(Disciplines.Discipline, disc)) THEN - whitespace := disc.whitespace; - ELSE - whitespace := defaultWhiteSpace; - END; - END GetWhiteSpace; - - PROCEDURE SetWhiteSpace*(s: Streams.Stream; whitespace: Sets.CharSet); - VAR - disc: StreamDiscipline; - BEGIN - IF ~Disciplines.Seek(s, id, SYSTEM.VAL(Disciplines.Discipline, disc)) THEN - InitDiscipline(disc); - END; - disc.whitespace := whitespace; - Disciplines.Add(s, disc); - END SetWhiteSpace; - - PROCEDURE SetIndentationWidth*(s: Streams.Stream; indentwidth: INTEGER); - VAR - disc: StreamDiscipline; - BEGIN - IF indentwidth >= 0 THEN - IF ~Disciplines.Seek(s, id, SYSTEM.VAL(Disciplines.Discipline, disc)) THEN - InitDiscipline(disc); - END; - disc.indentwidth := indentwidth; - Disciplines.Add(s, disc); - END; - END SetIndentationWidth; - - PROCEDURE GetIndentationWidth*(s: Streams.Stream; VAR indentwidth: INTEGER); - VAR - disc: StreamDiscipline; - BEGIN - IF Disciplines.Seek(s, id, SYSTEM.VAL(Disciplines.Discipline, disc)) THEN - indentwidth := disc.indentwidth; - ELSE - indentwidth := defaultIndentWidth; - END; - END GetIndentationWidth; - - PROCEDURE IncrIndentationWidth*(s: Streams.Stream; incr: INTEGER); - VAR - disc: StreamDiscipline; - BEGIN - IF ~Disciplines.Seek(s, id, SYSTEM.VAL(Disciplines.Discipline, disc)) THEN - InitDiscipline(disc); - END; - IF disc.indentwidth + incr >= 0 THEN - INC(disc.indentwidth, incr);; - END; - Disciplines.Add(s, disc); - END IncrIndentationWidth; + PROCEDURE IncrIndentationWidth*(s: Streams.Stream; incr: INTEGER); + VAR + disc: Disciplines.Discipline; + BEGIN + IF ~Disciplines.Seek(s, id, disc) THEN + InitDiscipline(disc); + END; + IF disc(StreamDiscipline).indentwidth + incr >= 0 THEN + INC(disc(StreamDiscipline).indentwidth, incr);; + END; + Disciplines.Add(s, disc); + END IncrIndentationWidth; BEGIN - Events.Define(badfieldsepset); + Events.Define(badfieldsepset); - id := Disciplines.Unique(); - Sets.InitSet(defaultFieldSeps); - Sets.InclChar(defaultFieldSeps, ASCII.tab); - Sets.InclChar(defaultFieldSeps, ASCII.sp); - defaultFieldSep := ASCII.tab; - defaultLineTerm[0] := ASCII.nl; defaultLineTerm[1] := 0X; - Sets.InitSet(defaultWhiteSpace); - Sets.InclChar(defaultWhiteSpace, ASCII.tab); - Sets.InclChar(defaultWhiteSpace, ASCII.sp); - Sets.InclChar(defaultWhiteSpace, ASCII.np); - Sets.InclChar(defaultWhiteSpace, ASCII.nl); - defaultIndentWidth := 0; + id := Disciplines.Unique(); + Sets.InitSet(defaultFieldSeps); + Sets.InclChar(defaultFieldSeps, ASCII.tab); + Sets.InclChar(defaultFieldSeps, ASCII.sp); + defaultFieldSep := ASCII.tab; + defaultLineTerm[0] := ASCII.nl; defaultLineTerm[1] := 0X; + Sets.InitSet(defaultWhiteSpace); + Sets.InclChar(defaultWhiteSpace, ASCII.tab); + Sets.InclChar(defaultWhiteSpace, ASCII.sp); + Sets.InclChar(defaultWhiteSpace, ASCII.np); + Sets.InclChar(defaultWhiteSpace, ASCII.nl); + defaultIndentWidth := 0; END ulmStreamDisciplines. diff --git a/src/library/ulm/ulmStreams.Mod b/src/library/ulm/ulmStreams.Mod index 149b1220..bb55c3e6 100644 --- a/src/library/ulm/ulmStreams.Mod +++ b/src/library/ulm/ulmStreams.Mod @@ -1,2150 +1,2150 @@ (* Ulm's Oberon Library - Copyright (C) 1989-2001 by University of Ulm, SAI, D-89069 Ulm, Germany - ---------------------------------------------------------------------------- - Ulm's Oberon Library is free software; you can redistribute it - and/or modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either version - 2 of the License, or (at your option) any later version. + Copyright (C) 1989-2001 by University of Ulm, SAI, D-89069 Ulm, Germany + ---------------------------------------------------------------------------- + Ulm's Oberon Library is free software; you can redistribute it + and/or modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either version + 2 of the License, or (at your option) any later version. - Ulm's Oberon Library is distributed in the hope that it will be - useful, but WITHOUT ANY WARRANTY; without even the implied warranty - of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. + Ulm's Oberon Library is distributed in the hope that it will be + useful, but WITHOUT ANY WARRANTY; without even the implied warranty + of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - ---------------------------------------------------------------------------- - E-mail contact: oberon@mathematik.uni-ulm.de - ---------------------------------------------------------------------------- - $Id: Streams.om,v 1.13 2005/02/14 23:36:35 borchert Exp $ - ---------------------------------------------------------------------------- - $Log: Streams.om,v $ - Revision 1.13 2005/02/14 23:36:35 borchert - bug fix: WritePart called InternalFlush without considering - that s.pos may be implicitly changed - (this assumption was wrong since revision 1.11) + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + ---------------------------------------------------------------------------- + E-mail contact: oberon@mathematik.uni-ulm.de + ---------------------------------------------------------------------------- + $Id: Streams.om,v 1.13 2005/02/14 23:36:35 borchert Exp $ + ---------------------------------------------------------------------------- + $Log: Streams.om,v $ + Revision 1.13 2005/02/14 23:36:35 borchert + bug fix: WritePart called InternalFlush without considering + that s.pos may be implicitly changed + (this assumption was wrong since revision 1.11) - Revision 1.12 2004/05/20 09:52:43 borchert - performance improvements: - - WritePart and Write take now the buffer by reference - - ReadByteFromBuf replaced by ReadBytesFromBuf - (contributed by Christian Ehrhardt) + Revision 1.12 2004/05/20 09:52:43 borchert + performance improvements: + - WritePart and Write take now the buffer by reference + - ReadByteFromBuf replaced by ReadBytesFromBuf + (contributed by Christian Ehrhardt) - Revision 1.11 2001/05/03 15:17:58 borchert - InternalFlush adapted for unidirectional pipelines to avoid - unintentional flushes due to buffer boundaries + Revision 1.11 2001/05/03 15:17:58 borchert + InternalFlush adapted for unidirectional pipelines to avoid + unintentional flushes due to buffer boundaries - Revision 1.10 2000/04/25 21:41:47 borchert - Streams.ReadPart loops now for unbuffered streams to collect input - until cnt is reached + Revision 1.10 2000/04/25 21:41:47 borchert + Streams.ReadPart loops now for unbuffered streams to collect input + until cnt is reached - Revision 1.9 1998/03/31 11:13:05 borchert - bug fix: NotificationHandler just reacted on Resources.unreferenced - but not on Resources.terminated + Revision 1.9 1998/03/31 11:13:05 borchert + bug fix: NotificationHandler just reacted on Resources.unreferenced + but not on Resources.terminated - Revision 1.8 1998/03/24 22:58:28 borchert - bug fix in Copy: left was computed incorrectly in case of - copies with fixed length (# -1) + Revision 1.8 1998/03/24 22:58:28 borchert + bug fix in Copy: left was computed incorrectly in case of + copies with fixed length (# -1) - Revision 1.7 1997/04/02 07:50:05 borchert - Copy replaced by a slightly more efficient variant + Revision 1.7 1997/04/02 07:50:05 borchert + Copy replaced by a slightly more efficient variant - Revision 1.6 1996/09/18 07:43:51 borchert - qualified references to own module (i.e. Streams.XXX) removed + Revision 1.6 1996/09/18 07:43:51 borchert + qualified references to own module (i.e. Streams.XXX) removed - Revision 1.5 1996/01/04 16:43:57 borchert - some bug fixes in the updates of read and write regions + Revision 1.5 1996/01/04 16:43:57 borchert + some bug fixes in the updates of read and write regions - Revision 1.4 1995/10/11 09:46:41 borchert - - closeEvent re-introduced (because it gets raised *before* - the actual close) - - bug fix: s.write was diminished in ReadPart but the write region - not properly adjusted - - bug fix: InternalSeek was setting s.left to negative values in - a special case + Revision 1.4 1995/10/11 09:46:41 borchert + - closeEvent re-introduced (because it gets raised *before* + the actual close) + - bug fix: s.write was diminished in ReadPart but the write region + not properly adjusted + - bug fix: InternalSeek was setting s.left to negative values in + a special case - Revision 1.3 1995/04/18 12:17:12 borchert - - Streams.Stream is now an extension of Services.Object - - Library variant of assertions replaced by ASSERT - - support of Resources added - - EnableClose, PreventClose & closeEvent removed + Revision 1.3 1995/04/18 12:17:12 borchert + - Streams.Stream is now an extension of Services.Object + - Library variant of assertions replaced by ASSERT + - support of Resources added + - EnableClose, PreventClose & closeEvent removed - Revision 1.2 1994/07/05 12:45:57 borchert - some minor bug fixes & enhancements: - - ReadPacket added - - streams which don't require cleanup are now subject to the GC - even if Close will never be called for them - - line buffered streams w/o bufio/addrio capability fill now buffer - up to the next line terminator only instead of trying to fill the - whole buffer - - ReadPart didn't set count correctly in all cases - - Touch calls now the flush interface procedure + Revision 1.2 1994/07/05 12:45:57 borchert + some minor bug fixes & enhancements: + - ReadPacket added + - streams which don't require cleanup are now subject to the GC + even if Close will never be called for them + - line buffered streams w/o bufio/addrio capability fill now buffer + up to the next line terminator only instead of trying to fill the + whole buffer + - ReadPart didn't set count correctly in all cases + - Touch calls now the flush interface procedure - Revision 1.1 1994/02/22 20:10:45 borchert - Initial revision + Revision 1.1 1994/02/22 20:10:45 borchert + Initial revision - ---------------------------------------------------------------------------- - AFB 6/89 - Major Revision: AFB 1/92: bufpool - ---------------------------------------------------------------------------- + ---------------------------------------------------------------------------- + AFB 6/89 + Major Revision: AFB 1/92: bufpool + ---------------------------------------------------------------------------- *) MODULE ulmStreams; - IMPORT Events := ulmEvents, Objects := ulmObjects, Priorities := ulmPriorities, Process := ulmProcess, RelatedEvents := ulmRelatedEvents, Resources := ulmResources, - Services := ulmServices, SYS := ulmSYSTEM, SYSTEM, Types := ulmTypes; + IMPORT Events := ulmEvents, Objects := ulmObjects, Priorities := ulmPriorities, Process := ulmProcess, RelatedEvents := ulmRelatedEvents, Resources := ulmResources, + Services := ulmServices, SYS := ulmSYSTEM, SYSTEM, Types := ulmTypes; - CONST - (* 3rd parameter of Seek *) - (* Whence = (fromStart, fromPos, fromEnd); *) - fromStart* = 0; fromPos* = 1; fromEnd* = 2; + CONST + (* 3rd parameter of Seek *) + (* Whence = (fromStart, fromPos, fromEnd); *) + fromStart* = 0; fromPos* = 1; fromEnd* = 2; - (* capabilities of a stream *) - (* Capability = (read, write, addrio, bufio, seek, tell, trunc, close, - holes, handler); + (* capabilities of a stream *) + (* Capability = (read, write, addrio, bufio, seek, tell, trunc, close, + holes, handler); + *) + read* = 0; write* = 1; addrio* = 2; bufio* = 3; seek* = 4; tell* = 5; + trunc* = 6; flush* = 7; close* = 8; holes* = 9; handler* = 10; + + (* BufMode = (nobuf, linebuf, onebuf, bufpool); *) + nobuf* = 0; linebuf* = 1; onebuf* = 2; bufpool* = 3; + + (* ErrorCode = (NoHandlerDefined, CannotRead, CannotSeek, CloseFailed, + NotLineBuffered, SeekFailed, TellFailed, BadWhence, + CannotTell, WriteFailed, CannotWrite, ReadFailed, + Unbuffered, BadParameters, CannotTrunc, TruncFailed, + NestedCall, FlushFailed); + *) + NoHandlerDefined* = 0; (* no handler defined *) + CannotRead* = 1; (* stream is write only *) + CannotSeek* = 2; (* stream is not capable of seeking *) + CloseFailed* = 3; (* Flush or Close failed *) + NotLineBuffered* = 4; (* LineTerm must not be called *) + SeekFailed* = 5; (* seek operation failed *) + TellFailed* = 6; (* tell operation failed *) + BadWhence* = 7; (* whence value out of [fromStart..fromEnd] *) + CannotTell* = 8; (* stream does not have a current position *) + WriteFailed* = 9; (* write error *) + CannotWrite* = 10; (* stream is read only *) + ReadFailed* = 11; (* read error *) + Unbuffered* = 12; (* operation isn't valid for unbuff'd streams *) + BadParameters* = 13; (* e.g. wrong count or offset values *) + CannotTrunc* = 14; (* stream is not capable of truncating *) + TruncFailed* = 15; (* trunc operation failed *) + NestedCall* = 16; (* nested stream operation *) + FlushFailed* = 17; (* flush operation failed *) + errorcodes* = 18; (* number of error codes *) + + (* === private constants ======================================= *) + bufsize = 8192; (* should be the file system block size *) + defaulttermch = 0AX; (* default line terminator (for linebuf) *) + + TYPE + Address* = Types.Address; + Count* = Types.Count; + Byte* = Types.Byte; + Whence* = SHORTINT; (* Whence = (fromStart, fromPos, fromEnd); *) + CapabilitySet* = SET; (* OF Capability; *) + BufMode* = SHORTINT; + ErrorCode* = SHORTINT; + Stream* = POINTER TO StreamRec; + Message* = RECORD (Objects.ObjectRec) END; + + (* the buffering system: + + buffers are always on bufsize-boundaries + + ok: the other components are defined + pos: file position of cont[0] (pos MOD bufsize = 0) + cont: valid data: cont[rbegin]..cont[rend-1] (read-region) + written data: cont[wbegin]..cont[wend-1] (write-region) + + both regions are maintained (even for non-rw streams) + *) + Buffer = POINTER TO BufferRec; + BufferRec = + RECORD + ok: BOOLEAN; (* TRUE if other components are valid *) + pos: Count; (* file position which corresponds to cont[0] *) + rbegin: Count; (* read-region: starting index *) + rend: Count; (* read-region: ending index *) + wbegin: Count; (* write-region: starting index of dirty region *) + wend: Count; (* write-region: ending index *) + cont: ARRAY bufsize OF Byte; (* buffer contents *) + nextfree: Buffer; (* only needed for released buffers *) + (* components for buffers which are members of a buffer pool *) + prevh, nexth: Buffer; (* next buffer with same the hash value *) + preva, nexta: Buffer; (* sorted list of buffers (access time) *) + END; + + CONST + hashtabsize = 128; (* size of bucket table *) + TYPE + BucketTable = ARRAY hashtabsize OF Buffer; + BufferPool = POINTER TO BufferPoolRec; + BufferPoolRec = + RECORD + maxbuf: INTEGER; (* maximal number of buffers to be used *) + nbuf: INTEGER; (* number of buffers in use *) + bucket: BucketTable; + (* list of all buffers sorted after the last access time; + tail points to the buffer most recently accessed + *) + head, tail: Buffer; + END; + + TYPE + AddrIOProc* = PROCEDURE (s: Stream; ptr: Address; cnt: Count) : Count; + BufIOProc* = PROCEDURE (s: Stream; VAR buf: ARRAY OF Byte; + off, cnt: Count) : Count; + SeekProc* = PROCEDURE (s: Stream; cnt: Count; whence: Whence) : BOOLEAN; + TellProc* = PROCEDURE (s: Stream; VAR cnt: Count) : BOOLEAN; + ReadProc* = PROCEDURE (s: Stream; VAR byte: Byte) : BOOLEAN; + WriteProc* = PROCEDURE (s: Stream; byte: Byte) : BOOLEAN; + TruncProc* = PROCEDURE (s: Stream; cnt: Count) : BOOLEAN; + FlushProc* = PROCEDURE (s: Stream) : BOOLEAN; + CloseProc* = PROCEDURE (s: Stream) : BOOLEAN; + HandlerProc* = PROCEDURE (s: Stream; VAR msg: Message); + + Interface* = POINTER TO InterfaceRec; + InterfaceRec* = + RECORD + (Objects.ObjectRec) + addrread*: AddrIOProc; (* read, addrio *) + addrwrite*: AddrIOProc; (* write, addrio *) + bufread*: BufIOProc; (* read, bufio *) + bufwrite*: BufIOProc; (* write, bufio *) + read*: ReadProc; (* read *) + write*: WriteProc; (* write *) + seek*: SeekProc; (* seek *) + tell*: TellProc; (* tell *) + trunc*: TruncProc; (* trunc *) + flush*: FlushProc; (* flush *) + close*: CloseProc; (* close *) + handler*: HandlerProc; (* handler *) + END; + + StreamRec* = + RECORD + (Services.ObjectRec) + (* following components are set after i/o-operations *) + count*: Count; (* resulting count of last operation *) + errors*: INTEGER; (* incremented for each error; may be set to 0 *) + error*: BOOLEAN; (* last operation successful? *) + lasterror*: ErrorCode; (* error code of last error *) + eof*: BOOLEAN; (* last read-operation with count=0 returned *) + (* === private part ============================================ *) + prev, next: Stream; (* list of open streams *) + if: Interface; caps: CapabilitySet; + bufmode: BufMode; (* buffering mode *) + bidirect: BOOLEAN; (* bidirectional buffering? *) + termch: Byte; (* flush on termch (linebuf only) *) + inlist: BOOLEAN; (* member of the list of opened streams? *) + tiedStream: Stream; (* to be flushed before read operations *) + buf: Buffer; (* current buffer; = NIL for unbuffered streams *) + wbuf: Buffer; (* buffer for writing (only if bidirect = TRUE) *) + bufpool: BufferPool; (* only if bufmode = bufpool *) + validpos: BOOLEAN; (* pos valid? *) + pos: Count; (* current position in stream *) + maxpos: Count; (* maximal position until now (only if buf # NIL) *) + left: Count; (* number of bytes left in buf (after pos) *) + write: Count; (* number of bytes which can be written in buf *) + rpos: Count; (* current position of if.tell *) + wextensible: BOOLEAN; (* write region extensible? *) + eofFound: BOOLEAN; (* eof seen yet? temporary use only *) + lock: BOOLEAN; (* avoid recursive operations *) + flushEvent: Events.EventType; (* valid if # NIL *) + closeEvent: Events.EventType; (* valid if # NIL *) + END; + VAR + type: Services.Type; + + TYPE + (* each error causes an event; + the error number is stored in event.errorcode; + the associated text can be taken from event.message + *) + Event* = POINTER TO EventRec; + EventRec* = + RECORD + (Events.EventRec) + stream*: Stream; + errorcode*: ErrorCode; + END; + + VAR + null*: Stream; (* accepts any output; does not return input *) + (* these streams are set by other modules; + after initialization of Streams they equal `null'; + so, connections with the standard UNIX streams must be + done by other modules + *) + stdin*, stdout*, stderr*: Stream; + errormsg*: ARRAY errorcodes OF Events.Message; + error*: Events.EventType; + + (* === private variables ========================================== *) + + opened: Stream; (* list of opened streams *) + (* this list has been reduced to the set of streams which + need to be cleaned up explicitly; + all other streams are subject to the garbage collection + even if Close has never been called for them *) - read* = 0; write* = 1; addrio* = 2; bufio* = 3; seek* = 4; tell* = 5; - trunc* = 6; flush* = 7; close* = 8; holes* = 9; handler* = 10; + freelist: Buffer; (* list of free buffers *) + nullif: Interface; (* interface of null-devices *) - (* BufMode = (nobuf, linebuf, onebuf, bufpool); *) - nobuf* = 0; linebuf* = 1; onebuf* = 2; bufpool* = 3; + (* === private procedures ========================================= *) - (* ErrorCode = (NoHandlerDefined, CannotRead, CannotSeek, CloseFailed, - NotLineBuffered, SeekFailed, TellFailed, BadWhence, - CannotTell, WriteFailed, CannotWrite, ReadFailed, - Unbuffered, BadParameters, CannotTrunc, TruncFailed, - NestedCall, FlushFailed); + PROCEDURE NewStream(s: Stream); + BEGIN + IF s.inlist THEN + s.prev := NIL; + s.next := opened; + IF opened # NIL THEN + opened.prev := s; + END; + opened := s; + END; + END NewStream; + + PROCEDURE OldStream(s: Stream); + BEGIN + IF s.inlist THEN + IF s.prev # NIL THEN + s.prev.next := s.next; + ELSE + opened := s.next; + END; + IF s.next # NIL THEN + s.next.prev := s.prev; + END; + END; + END OldStream; + + PROCEDURE NewBuffer(VAR b: Buffer); + BEGIN + IF freelist # NIL THEN + b := freelist; + freelist := freelist.nextfree; + ELSE + NEW(b); + END; + b.nextfree := NIL; + b.ok := FALSE; + END NewBuffer; + + PROCEDURE OldBuffer(VAR b: Buffer); + BEGIN + b.nextfree := freelist; + freelist := b; + b := NIL; + END OldBuffer; + + PROCEDURE Error(s: Stream; code: ErrorCode); + VAR + event: Event; + BEGIN + IF s # NIL THEN + INC(s.errors); + s.error := TRUE; + s.lasterror := code; + + (* generate error event *) + NEW(event); + event.type := error; + event.message := errormsg[code]; + event.stream := s; + event.errorcode := code; + RelatedEvents.Raise(s, event); + END; + END Error; + + PROCEDURE ^ InternalFlush(s: Stream) : BOOLEAN; + + (* ===== management of buffer pool ================================== *) + + PROCEDURE InitBufPool(s: Stream); + VAR + index: INTEGER; + BEGIN + s.bufpool.maxbuf := 16; (* default size *) + s.bufpool.nbuf := 0; (* currently, no buffers are allocated *) + s.bufpool.head := NIL; s.bufpool.tail := NIL; + index := 0; + WHILE index < hashtabsize DO + s.bufpool.bucket[index] := NIL; + INC(index); + END; + END InitBufPool; + + PROCEDURE HashValue(pos: Count) : INTEGER; + (* HashValue returns a hash value for pos *) + BEGIN + RETURN SHORT(pos DIV bufsize) MOD hashtabsize + END HashValue; + + PROCEDURE FindBuffer(s: Stream; pos: Count; VAR buf: Buffer) : BOOLEAN; + VAR + index: INTEGER; + bp: Buffer; + BEGIN + index := HashValue(pos); + bp := s.bufpool.bucket[index]; + WHILE bp # NIL DO + IF bp.pos = pos THEN + buf := bp; RETURN TRUE + END; + bp := bp.nexth; (* next buffer with same hash value *) + END; + buf := NIL; + RETURN FALSE + END FindBuffer; + + PROCEDURE GetBuffer(s: Stream); + (* look for buffer for s.pos and make it to the current buffer; + set s.left and s.write in dependance of s.pos + *) + VAR + buf: Buffer; + pos: Count; (* buffer boundary for s.pos *) + posindex: Count; (* buf[posindex] corresponds to s.pos *) + index: INTEGER; (* index into bucket table of the buffer pool *) + + PROCEDURE InitBuf(buf: Buffer); + VAR + index: INTEGER; (* of bucket table *) + BEGIN + buf.ok := TRUE; + buf.pos := pos; + buf.rbegin := posindex; buf.rend := posindex; s.left := 0; + buf.wbegin := posindex; buf.wend := posindex; + s.write := bufsize - posindex; + buf.nextfree := NIL; + + (* insert buf into hash list *) + index := HashValue(pos); + buf.prevh := NIL; + buf.nexth := s.bufpool.bucket[index]; + IF buf.nexth # NIL THEN + buf.nexth.prevh := buf; + END; + s.bufpool.bucket[index] := buf; + + (* buf is already at the end of the sorted list if we + re-use an old buffer *) - NoHandlerDefined* = 0; (* no handler defined *) - CannotRead* = 1; (* stream is write only *) - CannotSeek* = 2; (* stream is not capable of seeking *) - CloseFailed* = 3; (* Flush or Close failed *) - NotLineBuffered* = 4; (* LineTerm must not be called *) - SeekFailed* = 5; (* seek operation failed *) - TellFailed* = 6; (* tell operation failed *) - BadWhence* = 7; (* whence value out of [fromStart..fromEnd] *) - CannotTell* = 8; (* stream does not have a current position *) - WriteFailed* = 9; (* write error *) - CannotWrite* = 10; (* stream is read only *) - ReadFailed* = 11; (* read error *) - Unbuffered* = 12; (* operation isn't valid for unbuff'd streams *) - BadParameters* = 13; (* e.g. wrong count or offset values *) - CannotTrunc* = 14; (* stream is not capable of truncating *) - TruncFailed* = 15; (* trunc operation failed *) - NestedCall* = 16; (* nested stream operation *) - FlushFailed* = 17; (* flush operation failed *) - errorcodes* = 18; (* number of error codes *) + IF s.bufpool.tail # buf THEN + (* append buf to the sorted list *) + buf.nexta := NIL; + IF s.bufpool.tail = NIL THEN + s.bufpool.head := buf; + buf.preva := NIL; + ELSE + s.bufpool.tail.nexta := buf; + buf.preva := s.bufpool.tail; + END; + s.bufpool.tail := buf; + END; + END InitBuf; - (* === private constants ======================================= *) - bufsize = 8192; (* should be the file system block size *) - defaulttermch = 0AX; (* default line terminator (for linebuf) *) + PROCEDURE UseBuffer(s: Stream; buf: Buffer); + (* make buf to the current buffer of s *) + BEGIN + IF s.buf # buf THEN + (* remove buf from sorted list *) + IF buf.preva # NIL THEN + buf.preva.nexta := buf.nexta; + ELSE + s.bufpool.head := buf.nexta; + END; + IF buf.nexta # NIL THEN + buf.nexta.preva := buf.preva; + ELSE + s.bufpool.tail := buf.preva; + END; - TYPE - Address* = Types.Address; - Count* = Types.Count; - Byte* = Types.Byte; - Whence* = SHORTINT; (* Whence = (fromStart, fromPos, fromEnd); *) - CapabilitySet* = SET; (* OF Capability; *) - BufMode* = SHORTINT; - ErrorCode* = SHORTINT; - Stream* = POINTER TO StreamRec; - Message* = RECORD (Objects.ObjectRec) END; + (* append buf to sorted list *) + buf.nexta := NIL; + IF s.bufpool.tail = NIL THEN + s.bufpool.head := buf; + buf.preva := NIL; + ELSE + s.bufpool.tail.nexta := buf; + buf.preva := s.bufpool.tail; + END; + s.bufpool.tail := buf; - (* the buffering system: + (* set current buf of s to buf *) + s.buf := buf; - buffers are always on bufsize-boundaries + (* update s.left and s.write *) + IF buf.rbegin = buf.rend THEN + buf.rbegin := posindex; buf.rend := posindex; s.left := 0; + ELSIF (posindex >= buf.rbegin) & (posindex < buf.rend) THEN + s.left := buf.rend - posindex; + ELSE + s.left := 0; + END; + IF buf.wbegin = buf.wend THEN + buf.wbegin := posindex; buf.wend := posindex; + s.write := bufsize - posindex; + ELSIF (posindex >= buf.wbegin) & (posindex < buf.wend) THEN + s.write := bufsize - posindex; + ELSE + s.write := 0; + END; + END; + END UseBuffer; - ok: the other components are defined - pos: file position of cont[0] (pos MOD bufsize = 0) - cont: valid data: cont[rbegin]..cont[rend-1] (read-region) - written data: cont[wbegin]..cont[wend-1] (write-region) + BEGIN (* GetBuffer *) + posindex := s.pos MOD bufsize; + pos := s.pos - posindex; - both regions are maintained (even for non-rw streams) - *) - Buffer = POINTER TO BufferRec; - BufferRec = - RECORD - ok: BOOLEAN; (* TRUE if other components are valid *) - pos: Count; (* file position which corresponds to cont[0] *) - rbegin: Count; (* read-region: starting index *) - rend: Count; (* read-region: ending index *) - wbegin: Count; (* write-region: starting index of dirty region *) - wend: Count; (* write-region: ending index *) - cont: ARRAY bufsize OF Byte; (* buffer contents *) - nextfree: Buffer; (* only needed for released buffers *) - (* components for buffers which are members of a buffer pool *) - prevh, nexth: Buffer; (* next buffer with same the hash value *) - preva, nexta: Buffer; (* sorted list of buffers (access time) *) - END; + IF ~s.buf.ok THEN + (* init first allocated buffer which has not been used until now *) + InitBuf(s.buf); + INC(s.bufpool.nbuf); + ELSIF s.buf.pos # pos THEN + IF FindBuffer(s, pos, buf) THEN + UseBuffer(s, buf); + ELSE + IF s.bufpool.nbuf >= s.bufpool.maxbuf THEN + (* re-use already allocated buffer *) + buf := s.bufpool.head; + UseBuffer(s, buf); + IF buf.wbegin # buf.wend THEN + IF ~InternalFlush(s) THEN END; + END; - CONST - hashtabsize = 128; (* size of bucket table *) - TYPE - BucketTable = ARRAY hashtabsize OF Buffer; - BufferPool = POINTER TO BufferPoolRec; - BufferPoolRec = - RECORD - maxbuf: INTEGER; (* maximal number of buffers to be used *) - nbuf: INTEGER; (* number of buffers in use *) - bucket: BucketTable; - (* list of all buffers sorted after the last access time; - tail points to the buffer most recently accessed - *) - head, tail: Buffer; - END; + (* remove buf from hash list *) + IF buf.prevh # NIL THEN + buf.prevh.nexth := buf.nexth; + ELSE + index := HashValue(buf.pos); + s.bufpool.bucket[index] := buf.nexth; + END; + IF buf.nexth # NIL THEN + buf.nexth.prevh := buf.prevh; + END; - TYPE - AddrIOProc* = PROCEDURE (s: Stream; ptr: Address; cnt: Count) : Count; - BufIOProc* = PROCEDURE (s: Stream; VAR buf: ARRAY OF Byte; - off, cnt: Count) : Count; - SeekProc* = PROCEDURE (s: Stream; cnt: Count; whence: Whence) : BOOLEAN; - TellProc* = PROCEDURE (s: Stream; VAR cnt: Count) : BOOLEAN; - ReadProc* = PROCEDURE (s: Stream; VAR byte: Byte) : BOOLEAN; - WriteProc* = PROCEDURE (s: Stream; byte: Byte) : BOOLEAN; - TruncProc* = PROCEDURE (s: Stream; cnt: Count) : BOOLEAN; - FlushProc* = PROCEDURE (s: Stream) : BOOLEAN; - CloseProc* = PROCEDURE (s: Stream) : BOOLEAN; - HandlerProc* = PROCEDURE (s: Stream; VAR msg: Message); + InitBuf(buf); + ELSE + (* allocate and initialize new buffer *) + NewBuffer(buf); + InitBuf(buf); + INC(s.bufpool.nbuf); + END; + s.buf := buf; + END; + END; + END GetBuffer; - Interface* = POINTER TO InterfaceRec; - InterfaceRec* = - RECORD - (Objects.ObjectRec) - addrread*: AddrIOProc; (* read, addrio *) - addrwrite*: AddrIOProc; (* write, addrio *) - bufread*: BufIOProc; (* read, bufio *) - bufwrite*: BufIOProc; (* write, bufio *) - read*: ReadProc; (* read *) - write*: WriteProc; (* write *) - seek*: SeekProc; (* seek *) - tell*: TellProc; (* tell *) - trunc*: TruncProc; (* trunc *) - flush*: FlushProc; (* flush *) - close*: CloseProc; (* close *) - handler*: HandlerProc; (* handler *) - END; + PROCEDURE FlushBufPool(s: Stream) : BOOLEAN; + VAR + buf: Buffer; + ok: BOOLEAN; + BEGIN + ok := TRUE; + IF s.bufpool.nbuf > 0 THEN + buf := s.bufpool.head; + WHILE buf # NIL DO + s.buf := buf; + ok := InternalFlush(s) & ok; + buf := buf.nexta; + END; + END; + RETURN ok + END FlushBufPool; - StreamRec* = - RECORD - (Services.ObjectRec) - (* following components are set after i/o-operations *) - count*: Count; (* resulting count of last operation *) - errors*: INTEGER; (* incremented for each error; may be set to 0 *) - error*: BOOLEAN; (* last operation successful? *) - lasterror*: ErrorCode; (* error code of last error *) - eof*: BOOLEAN; (* last read-operation with count=0 returned *) - (* === private part ============================================ *) - prev, next: Stream; (* list of open streams *) - if: Interface; caps: CapabilitySet; - bufmode: BufMode; (* buffering mode *) - bidirect: BOOLEAN; (* bidirectional buffering? *) - termch: Byte; (* flush on termch (linebuf only) *) - inlist: BOOLEAN; (* member of the list of opened streams? *) - tiedStream: Stream; (* to be flushed before read operations *) - buf: Buffer; (* current buffer; = NIL for unbuffered streams *) - wbuf: Buffer; (* buffer for writing (only if bidirect = TRUE) *) - bufpool: BufferPool; (* only if bufmode = bufpool *) - validpos: BOOLEAN; (* pos valid? *) - pos: Count; (* current position in stream *) - maxpos: Count; (* maximal position until now (only if buf # NIL) *) - left: Count; (* number of bytes left in buf (after pos) *) - write: Count; (* number of bytes which can be written in buf *) - rpos: Count; (* current position of if.tell *) - wextensible: BOOLEAN; (* write region extensible? *) - eofFound: BOOLEAN; (* eof seen yet? temporary use only *) - lock: BOOLEAN; (* avoid recursive operations *) - flushEvent: Events.EventType; (* valid if # NIL *) - closeEvent: Events.EventType; (* valid if # NIL *) - END; - VAR + PROCEDURE ReleaseBufPool(s: Stream); + (* precondition: all buffers are flushed *) + VAR + buf: Buffer; + BEGIN + IF s.bufpool.nbuf > 0 THEN + buf := s.bufpool.head; + WHILE buf # NIL DO + s.buf := buf; + OldBuffer(s.buf); + buf := buf.nexta; + END; + END; + NewBuffer(s.buf); + InitBufPool(s); + END ReleaseBufPool; + + (* ================================================================== *) + + PROCEDURE GetBufMode*(s: Stream) : BufMode; + BEGIN + RETURN s.bufmode + END GetBufMode; + + PROCEDURE LineTerm*(s: Stream; termch: Byte); + (* set line terminator of `s' (linebuf) to `termch' *) + BEGIN + s.error := FALSE; + IF s.bufmode = linebuf THEN + s.termch := termch; + ELSE + Error(s, NotLineBuffered); + END; + END LineTerm; + + PROCEDURE Tie*(in, out: Stream); + (* PRE: `in' is an line buffered input stream, + `out' an output stream, + and `in' # `out'; + causes `out' to be flushed before reading from `in'; + `out' may be NIL to undo the effect + *) + BEGIN + in.error := FALSE; + IF in.bufmode # linebuf THEN + Error(in, NotLineBuffered); RETURN + END; + IF (in = out) OR ~(read IN in.caps) OR + (out # NIL) & ~(write IN out.caps) THEN + Error(in, BadParameters); RETURN + END; + in.tiedStream := out; + END Tie; + + PROCEDURE SetBufferPoolSize*(s: Stream; nbuf: INTEGER); + BEGIN + s.error := FALSE; + IF SYS.TAS(s.lock) THEN + Error(s, NestedCall); RETURN + END; + IF (s.bufmode = bufpool) & (nbuf >= 1) THEN + s.bufpool.maxbuf := nbuf; + END; + s.lock := FALSE; + END SetBufferPoolSize; + + PROCEDURE GetBufferPoolSize*(s: Stream; VAR nbuf: INTEGER); + BEGIN + s.error := FALSE; + CASE s.bufmode OF + | nobuf: nbuf := 0; + | linebuf: nbuf := 1; + | onebuf: nbuf := 1; + | bufpool: nbuf := s.bufpool.maxbuf; + ELSE (* Explicitly ignore unhandled values of s.bufmode *) + END; + END GetBufferPoolSize; + + PROCEDURE Capabilities*(s: Stream) : CapabilitySet; + BEGIN + s.error := FALSE; + RETURN s.caps + END Capabilities; + + PROCEDURE GetFlushEvent*(s: Stream; VAR type: Events.EventType); + (* `type' will be raised BEFORE every flush operation *) + BEGIN + s.error := FALSE; + IF s.flushEvent = NIL THEN + Events.Define(s.flushEvent); + END; + type := s.flushEvent; + END GetFlushEvent; + + PROCEDURE GetCloseEvent*(s: Stream; VAR type: Events.EventType); + (* `type' will be raised BEFORE the stream gets closed; + that means write operations etc. are legal + *) + BEGIN + s.error := FALSE; + IF s.closeEvent = NIL THEN + Events.Define(s.closeEvent); + END; + type := s.closeEvent; + END GetCloseEvent; + + PROCEDURE Close*(s: Stream) : BOOLEAN; + VAR + event: Event; + type: Events.EventType; + otherStream: Stream; + BEGIN + s.error := FALSE; + + IF (s.closeEvent # NIL) & ~SYS.TAS(s.lock) THEN + type := s.closeEvent; s.closeEvent := NIL; + s.lock := FALSE; + Events.SetPriority(type, Events.GetPriority() + 1); + NEW(event); + event.type := type; + event.message := "close event of Streams"; + event.stream := s; + Events.Raise(event); + END; + + IF ~SYS.TAS(s.lock) THEN + IF write IN s.caps THEN + IF s.bufmode = bufpool THEN + IF ~FlushBufPool(s) THEN END; + ELSE + IF ~InternalFlush(s) THEN END; + END; + END; + IF close IN s.caps THEN + IF ~s.if.close(s) THEN + Error(s, CloseFailed); + END; + END; + IF s.buf # NIL THEN + IF s.bufmode = bufpool THEN + ReleaseBufPool(s); + END; + OldBuffer(s.buf); + END; + OldStream(s); + + (* check if this stream has been tied to another stream *) + otherStream := opened; + WHILE otherStream # NIL DO + IF otherStream.tiedStream = s THEN + otherStream.tiedStream := NIL; (* undo tie operation *) + END; + otherStream := otherStream.next; + END; + (* s.lock remains TRUE to prevent further operations *) + Resources.Notify(s, Resources.terminated); + RETURN ~s.error + ELSE + Error(s, NestedCall); + RETURN FALSE + END; + END Close; + + PROCEDURE Release*(s: Stream); + BEGIN + IF ~Close(s) THEN END; + END Release; + + PROCEDURE CloseAll*; + BEGIN + WHILE opened # NIL DO + (* that's no endless loop; see Close/OldStream *) + Release(opened); + END; + END CloseAll; + + PROCEDURE NotificationHandler(event: Events.Event); + VAR + s: Stream; + BEGIN + IF ~(event IS Resources.Event) THEN RETURN END; + WITH event: Resources.Event DO + IF ~(event.resource IS Stream) THEN RETURN END; + s := event.resource(Stream); + IF event.change IN {Resources.unreferenced, Resources.terminated} THEN + IF ~s.lock THEN + Release(s); + END; + END; + END; + END NotificationHandler; + + PROCEDURE Init*(s: Stream; if: Interface; caps: CapabilitySet; + bufmode: BufMode); + + VAR + eventType: Events.EventType; type: Services.Type; - TYPE - (* each error causes an event; - the error number is stored in event.errorcode; - the associated text can be taken from event.message - *) - Event* = POINTER TO EventRec; - EventRec* = - RECORD - (Events.EventRec) - stream*: Stream; - errorcode*: ErrorCode; - END; + PROCEDURE InitBidirectionalBuffering(s: Stream); + BEGIN + s.validpos := TRUE; + s.pos := 0; + NewBuffer(s.wbuf); + s.buf.ok := TRUE; s.buf.rbegin := 0; s.buf.rend := 0; s.buf.pos := 0; + s.wbuf.ok := TRUE; s.wbuf.wbegin := 0; s.wbuf.wend := 0; + s.wbuf.pos := 0; + s.left := 0; s.write := bufsize; + END InitBidirectionalBuffering; - VAR - null*: Stream; (* accepts any output; does not return input *) - (* these streams are set by other modules; - after initialization of Streams they equal `null'; - so, connections with the standard UNIX streams must be - done by other modules - *) - stdin*, stdout*, stderr*: Stream; - errormsg*: ARRAY errorcodes OF Events.Message; - error*: Events.EventType; - - (* === private variables ========================================== *) - - opened: Stream; (* list of opened streams *) - (* this list has been reduced to the set of streams which - need to be cleaned up explicitly; - all other streams are subject to the garbage collection - even if Close has never been called for them - *) - freelist: Buffer; (* list of free buffers *) - nullif: Interface; (* interface of null-devices *) - - (* === private procedures ========================================= *) - - PROCEDURE NewStream(s: Stream); - BEGIN - IF s.inlist THEN - s.prev := NIL; - s.next := opened; - IF opened # NIL THEN - opened.prev := s; - END; - opened := s; - END; - END NewStream; - - PROCEDURE OldStream(s: Stream); - BEGIN - IF s.inlist THEN - IF s.prev # NIL THEN - s.prev.next := s.next; - ELSE - opened := s.next; - END; - IF s.next # NIL THEN - s.next.prev := s.prev; - END; - END; - END OldStream; - - PROCEDURE NewBuffer(VAR b: Buffer); - BEGIN - IF freelist # NIL THEN - b := freelist; - freelist := freelist.nextfree; - ELSE - NEW(b); - END; - b.nextfree := NIL; - b.ok := FALSE; - END NewBuffer; - - PROCEDURE OldBuffer(VAR b: Buffer); - BEGIN - b.nextfree := freelist; - freelist := b; - b := NIL; - END OldBuffer; - - PROCEDURE Error(s: Stream; code: ErrorCode); - VAR - event: Event; - BEGIN - IF s # NIL THEN - INC(s.errors); - s.error := TRUE; - s.lasterror := code; - - (* generate error event *) - NEW(event); - event.type := error; - event.message := errormsg[code]; - event.stream := s; - event.errorcode := code; - RelatedEvents.Raise(s, event); - END; - END Error; - - PROCEDURE ^ InternalFlush(s: Stream) : BOOLEAN; - - (* ===== management of buffer pool ================================== *) - - PROCEDURE InitBufPool(s: Stream); - VAR - index: INTEGER; - BEGIN - s.bufpool.maxbuf := 16; (* default size *) - s.bufpool.nbuf := 0; (* currently, no buffers are allocated *) - s.bufpool.head := NIL; s.bufpool.tail := NIL; - index := 0; - WHILE index < hashtabsize DO - s.bufpool.bucket[index] := NIL; - INC(index); - END; - END InitBufPool; - - PROCEDURE HashValue(pos: Count) : INTEGER; - (* HashValue returns a hash value for pos *) - BEGIN - RETURN SHORT(pos DIV bufsize) MOD hashtabsize - END HashValue; - - PROCEDURE FindBuffer(s: Stream; pos: Count; VAR buf: Buffer) : BOOLEAN; - VAR - index: INTEGER; - bp: Buffer; - BEGIN - index := HashValue(pos); - bp := s.bufpool.bucket[index]; - WHILE bp # NIL DO - IF bp.pos = pos THEN - buf := bp; RETURN TRUE - END; - bp := bp.nexth; (* next buffer with same hash value *) - END; - buf := NIL; - RETURN FALSE - END FindBuffer; - - PROCEDURE GetBuffer(s: Stream); - (* look for buffer for s.pos and make it to the current buffer; - set s.left and s.write in dependance of s.pos - *) - VAR - buf: Buffer; - pos: Count; (* buffer boundary for s.pos *) - posindex: Count; (* buf[posindex] corresponds to s.pos *) - index: INTEGER; (* index into bucket table of the buffer pool *) - - PROCEDURE InitBuf(buf: Buffer); - VAR - index: INTEGER; (* of bucket table *) - BEGIN - buf.ok := TRUE; - buf.pos := pos; - buf.rbegin := posindex; buf.rend := posindex; s.left := 0; - buf.wbegin := posindex; buf.wend := posindex; - s.write := bufsize - posindex; - buf.nextfree := NIL; - - (* insert buf into hash list *) - index := HashValue(pos); - buf.prevh := NIL; - buf.nexth := s.bufpool.bucket[index]; - IF buf.nexth # NIL THEN - buf.nexth.prevh := buf; - END; - s.bufpool.bucket[index] := buf; - - (* buf is already at the end of the sorted list if we - re-use an old buffer - *) - IF s.bufpool.tail # buf THEN - (* append buf to the sorted list *) - buf.nexta := NIL; - IF s.bufpool.tail = NIL THEN - s.bufpool.head := buf; - buf.preva := NIL; - ELSE - s.bufpool.tail.nexta := buf; - buf.preva := s.bufpool.tail; - END; - s.bufpool.tail := buf; - END; - END InitBuf; - - PROCEDURE UseBuffer(s: Stream; buf: Buffer); - (* make buf to the current buffer of s *) - BEGIN - IF s.buf # buf THEN - (* remove buf from sorted list *) - IF buf.preva # NIL THEN - buf.preva.nexta := buf.nexta; - ELSE - s.bufpool.head := buf.nexta; - END; - IF buf.nexta # NIL THEN - buf.nexta.preva := buf.preva; - ELSE - s.bufpool.tail := buf.preva; - END; - - (* append buf to sorted list *) - buf.nexta := NIL; - IF s.bufpool.tail = NIL THEN - s.bufpool.head := buf; - buf.preva := NIL; - ELSE - s.bufpool.tail.nexta := buf; - buf.preva := s.bufpool.tail; - END; - s.bufpool.tail := buf; - - (* set current buf of s to buf *) - s.buf := buf; - - (* update s.left and s.write *) - IF buf.rbegin = buf.rend THEN - buf.rbegin := posindex; buf.rend := posindex; s.left := 0; - ELSIF (posindex >= buf.rbegin) & (posindex < buf.rend) THEN - s.left := buf.rend - posindex; - ELSE - s.left := 0; - END; - IF buf.wbegin = buf.wend THEN - buf.wbegin := posindex; buf.wend := posindex; - s.write := bufsize - posindex; - ELSIF (posindex >= buf.wbegin) & (posindex < buf.wend) THEN - s.write := bufsize - posindex; - ELSE - s.write := 0; - END; - END; - END UseBuffer; - - BEGIN (* GetBuffer *) - posindex := s.pos MOD bufsize; - pos := s.pos - posindex; - - IF ~s.buf.ok THEN - (* init first allocated buffer which has not been used until now *) - InitBuf(s.buf); - INC(s.bufpool.nbuf); - ELSIF s.buf.pos # pos THEN - IF FindBuffer(s, pos, buf) THEN - UseBuffer(s, buf); - ELSE - IF s.bufpool.nbuf >= s.bufpool.maxbuf THEN - (* re-use already allocated buffer *) - buf := s.bufpool.head; - UseBuffer(s, buf); - IF buf.wbegin # buf.wend THEN - IF ~InternalFlush(s) THEN END; - END; - - (* remove buf from hash list *) - IF buf.prevh # NIL THEN - buf.prevh.nexth := buf.nexth; - ELSE - index := HashValue(buf.pos); - s.bufpool.bucket[index] := buf.nexth; - END; - IF buf.nexth # NIL THEN - buf.nexth.prevh := buf.prevh; - END; - - InitBuf(buf); - ELSE - (* allocate and initialize new buffer *) - NewBuffer(buf); - InitBuf(buf); - INC(s.bufpool.nbuf); - END; - s.buf := buf; - END; - END; - END GetBuffer; - - PROCEDURE FlushBufPool(s: Stream) : BOOLEAN; - VAR - buf: Buffer; - ok: BOOLEAN; - BEGIN - ok := TRUE; - IF s.bufpool.nbuf > 0 THEN - buf := s.bufpool.head; - WHILE buf # NIL DO - s.buf := buf; - ok := InternalFlush(s) & ok; - buf := buf.nexta; - END; - END; - RETURN ok - END FlushBufPool; - - PROCEDURE ReleaseBufPool(s: Stream); - (* precondition: all buffers are flushed *) - VAR - buf: Buffer; - BEGIN - IF s.bufpool.nbuf > 0 THEN - buf := s.bufpool.head; - WHILE buf # NIL DO - s.buf := buf; - OldBuffer(s.buf); - buf := buf.nexta; - END; - END; + BEGIN + ASSERT((s # NIL) & (if # NIL) & ({read, write} * caps # {})); + Services.GetType(s, type); ASSERT(type # NIL); + s.inlist := (close IN caps) OR (bufmode # nobuf) & (write IN caps); + NewStream(s); + (* initialize public part *) + s.count := 0; + s.errors := 0; + s.error := FALSE; + s.lasterror := 0; + s.eof := FALSE; + (* private part *) + s.if := if; s.caps := caps; + s.bufmode := bufmode; + s.validpos := FALSE; + s.left := 0; s.write := 0; + s.tiedStream := NIL; + IF bufmode IN {linebuf, onebuf, bufpool} THEN NewBuffer(s.buf); - InitBufPool(s); - END ReleaseBufPool; - - (* ================================================================== *) - - PROCEDURE GetBufMode*(s: Stream) : BufMode; - BEGIN - RETURN s.bufmode - END GetBufMode; - - PROCEDURE LineTerm*(s: Stream; termch: Byte); - (* set line terminator of `s' (linebuf) to `termch' *) - BEGIN - s.error := FALSE; - IF s.bufmode = linebuf THEN - s.termch := termch; + IF (bufmode = bufpool) & ~(seek IN caps) THEN + bufmode := onebuf; + END; + CASE bufmode OF + | linebuf: s.termch := defaulttermch; + | bufpool: NEW(s.bufpool); InitBufPool(s); ELSE - Error(s, NotLineBuffered); END; - END LineTerm; + s.maxpos := 0; + s.wextensible := {read, write, seek, tell, holes} * caps = + {read, write, seek, tell}; + s.bidirect := {read, write, seek, tell, trunc} * caps = {read, write}; + IF s.bidirect THEN + InitBidirectionalBuffering(s); + ELSE + s.wbuf := NIL; + END; + ELSE + s.buf := NIL; + s.wbuf := NIL; + s.wextensible := FALSE; + s.bidirect := FALSE; + END; + s.flushEvent := NIL; + s.closeEvent := NIL; + Resources.TakeInterest(s, eventType); + Events.Handler(eventType, NotificationHandler); + s.lock := FALSE; + END Init; - PROCEDURE Tie*(in, out: Stream); - (* PRE: `in' is an line buffered input stream, - `out' an output stream, - and `in' # `out'; - causes `out' to be flushed before reading from `in'; - `out' may be NIL to undo the effect - *) - BEGIN - in.error := FALSE; - IF in.bufmode # linebuf THEN - Error(in, NotLineBuffered); RETURN - END; - IF (in = out) OR ~(read IN in.caps) OR - (out # NIL) & ~(write IN out.caps) THEN - Error(in, BadParameters); RETURN - END; - in.tiedStream := out; - END Tie; - - PROCEDURE SetBufferPoolSize*(s: Stream; nbuf: INTEGER); - BEGIN - s.error := FALSE; - IF SYS.TAS(s.lock) THEN - Error(s, NestedCall); RETURN - END; - IF (s.bufmode = bufpool) & (nbuf >= 1) THEN - s.bufpool.maxbuf := nbuf; + PROCEDURE Send*(s: Stream; VAR message: Message); + BEGIN + IF ~SYS.TAS(s.lock) THEN + IF handler IN s.caps THEN + s.if.handler(s, message); + ELSE + Error(s, NoHandlerDefined); END; s.lock := FALSE; - END SetBufferPoolSize; + ELSE + Error(s, NestedCall); + END; + END Send; - PROCEDURE GetBufferPoolSize*(s: Stream; VAR nbuf: INTEGER); - BEGIN - s.error := FALSE; - CASE s.bufmode OF - | nobuf: nbuf := 0; - | linebuf: nbuf := 1; - | onebuf: nbuf := 1; - | bufpool: nbuf := s.bufpool.maxbuf; - ELSE (* Explicitly ignore unhandled values of s.bufmode *) + (* === private i/o procedures ================================= *) + + PROCEDURE ValidPos(s: Stream); + BEGIN + IF ~s.validpos THEN + IF tell IN s.caps THEN + IF ~s.if.tell(s, s.pos) OR (s.pos < 0) THEN + Error(s, TellFailed); + s.pos := 0; + END; + ELSE + s.pos := 0; END; - END GetBufferPoolSize; + s.rpos := s.pos; + s.validpos := TRUE; + s.left := 0; + s.write := 0; + END; + END ValidPos; - PROCEDURE Capabilities*(s: Stream) : CapabilitySet; - BEGIN - s.error := FALSE; - RETURN s.caps - END Capabilities; + PROCEDURE InitBuf(s: Stream); + BEGIN + IF s.bufmode = bufpool THEN + GetBuffer(s); + ELSE + s.buf.pos := s.pos - s.pos MOD bufsize; + s.buf.wbegin := s.pos MOD bufsize; + s.write := bufsize - s.buf.wbegin; + s.buf.wend := s.buf.wbegin; + s.buf.rbegin := s.buf.wbegin; + s.buf.rend := s.buf.wbegin; + s.left := 0; + s.buf.ok := TRUE; + END; + END InitBuf; - PROCEDURE GetFlushEvent*(s: Stream; VAR type: Events.EventType); - (* `type' will be raised BEFORE every flush operation *) - BEGIN - s.error := FALSE; - IF s.flushEvent = NIL THEN - Events.Define(s.flushEvent); - END; - type := s.flushEvent; - END GetFlushEvent; + PROCEDURE FillBuf(s: Stream) : BOOLEAN; + (* return FALSE on EOF or errors *) + VAR + offset, count: Count; + posindex: Count; (* s.pos MOD bufsize *) - PROCEDURE GetCloseEvent*(s: Stream; VAR type: Events.EventType); - (* `type' will be raised BEFORE the stream gets closed; - that means write operations etc. are legal + PROCEDURE Fill(s: Stream; VAR offset, count: Count) : BOOLEAN; + (* try to fill buf.cont[offset]..buf.cont[offset+count-1]; + return FALSE on EOF; + Fill always extends a read region: + s.buf.rend is set to offset + the number of bytes read *) - BEGIN - s.error := FALSE; - IF s.closeEvent = NIL THEN - Events.Define(s.closeEvent); - END; - type := s.closeEvent; - END GetCloseEvent; - - PROCEDURE Close*(s: Stream) : BOOLEAN; VAR - event: Event; - type: Events.EventType; - otherStream: Stream; - BEGIN - s.error := FALSE; - - IF (s.closeEvent # NIL) & ~SYS.TAS(s.lock) THEN - type := s.closeEvent; s.closeEvent := NIL; - s.lock := FALSE; - Events.SetPriority(type, Events.GetPriority() + 1); - NEW(event); - event.type := type; - event.message := "close event of Streams"; - event.stream := s; - Events.Raise(event); + linetermseen: BOOLEAN; + byte: Byte; + BEGIN + IF s.eofFound THEN + RETURN FALSE END; - - IF ~SYS.TAS(s.lock) THEN - IF write IN s.caps THEN - IF s.bufmode = bufpool THEN - IF ~FlushBufPool(s) THEN END; - ELSE - IF ~InternalFlush(s) THEN END; - END; - END; - IF close IN s.caps THEN - IF ~s.if.close(s) THEN - Error(s, CloseFailed); - END; - END; - IF s.buf # NIL THEN - IF s.bufmode = bufpool THEN - ReleaseBufPool(s); - END; - OldBuffer(s.buf); - END; - OldStream(s); - - (* check if this stream has been tied to another stream *) - otherStream := opened; - WHILE otherStream # NIL DO - IF otherStream.tiedStream = s THEN - otherStream.tiedStream := NIL; (* undo tie operation *) - END; - otherStream := otherStream.next; - END; - (* s.lock remains TRUE to prevent further operations *) - Resources.Notify(s, Resources.terminated); - RETURN ~s.error - ELSE - Error(s, NestedCall); - RETURN FALSE - END; - END Close; - - PROCEDURE Release*(s: Stream); - BEGIN - IF ~Close(s) THEN END; - END Release; - - PROCEDURE CloseAll*; - BEGIN - WHILE opened # NIL DO - (* that's no endless loop; see Close/OldStream *) - Release(opened); - END; - END CloseAll; - - PROCEDURE NotificationHandler(event: Events.Event); - VAR - s: Stream; - BEGIN - IF ~(event IS Resources.Event) THEN RETURN END; - WITH event: Resources.Event DO - IF ~(event.resource IS Stream) THEN RETURN END; - s := event.resource(Stream); - IF event.change IN {Resources.unreferenced, Resources.terminated} THEN - IF ~s.lock THEN - Release(s); - END; - END; - END; - END NotificationHandler; - - PROCEDURE Init*(s: Stream; if: Interface; caps: CapabilitySet; - bufmode: BufMode); - - VAR - eventType: Events.EventType; - type: Services.Type; - - PROCEDURE InitBidirectionalBuffering(s: Stream); - BEGIN - s.validpos := TRUE; - s.pos := 0; - NewBuffer(s.wbuf); - s.buf.ok := TRUE; s.buf.rbegin := 0; s.buf.rend := 0; s.buf.pos := 0; - s.wbuf.ok := TRUE; s.wbuf.wbegin := 0; s.wbuf.wend := 0; - s.wbuf.pos := 0; - s.left := 0; s.write := bufsize; - END InitBidirectionalBuffering; - - BEGIN - ASSERT((s # NIL) & (if # NIL) & ({read, write} * caps # {})); - Services.GetType(s, type); ASSERT(type # NIL); - s.inlist := (close IN caps) OR (bufmode # nobuf) & (write IN caps); - NewStream(s); - (* initialize public part *) - s.count := 0; - s.errors := 0; - s.error := FALSE; - s.lasterror := 0; - s.eof := FALSE; - (* private part *) - s.if := if; s.caps := caps; - s.bufmode := bufmode; - s.validpos := FALSE; - s.left := 0; s.write := 0; - s.tiedStream := NIL; - IF bufmode IN {linebuf, onebuf, bufpool} THEN - NewBuffer(s.buf); - IF (bufmode = bufpool) & ~(seek IN caps) THEN - bufmode := onebuf; - END; - CASE bufmode OF - | linebuf: s.termch := defaulttermch; - | bufpool: NEW(s.bufpool); InitBufPool(s); - ELSE - END; - s.maxpos := 0; - s.wextensible := {read, write, seek, tell, holes} * caps = - {read, write, seek, tell}; - s.bidirect := {read, write, seek, tell, trunc} * caps = {read, write}; - IF s.bidirect THEN - InitBidirectionalBuffering(s); - ELSE - s.wbuf := NIL; - END; - ELSE - s.buf := NIL; - s.wbuf := NIL; - s.wextensible := FALSE; - s.bidirect := FALSE; - END; - s.flushEvent := NIL; - s.closeEvent := NIL; - Resources.TakeInterest(s, eventType); - Events.Handler(eventType, NotificationHandler); - s.lock := FALSE; - END Init; - - PROCEDURE Send*(s: Stream; VAR message: Message); - BEGIN - IF ~SYS.TAS(s.lock) THEN - IF handler IN s.caps THEN - s.if.handler(s, message); - ELSE - Error(s, NoHandlerDefined); - END; - s.lock := FALSE; - ELSE - Error(s, NestedCall); - END; - END Send; - - (* === private i/o procedures ================================= *) - - PROCEDURE ValidPos(s: Stream); - BEGIN - IF ~s.validpos THEN - IF tell IN s.caps THEN - IF ~s.if.tell(s, s.pos) OR (s.pos < 0) THEN - Error(s, TellFailed); - s.pos := 0; - END; - ELSE - s.pos := 0; - END; - s.rpos := s.pos; - s.validpos := TRUE; - s.left := 0; - s.write := 0; - END; - END ValidPos; - - PROCEDURE InitBuf(s: Stream); - BEGIN - IF s.bufmode = bufpool THEN - GetBuffer(s); - ELSE - s.buf.pos := s.pos - s.pos MOD bufsize; - s.buf.wbegin := s.pos MOD bufsize; - s.write := bufsize - s.buf.wbegin; - s.buf.wend := s.buf.wbegin; - s.buf.rbegin := s.buf.wbegin; - s.buf.rend := s.buf.wbegin; - s.left := 0; - s.buf.ok := TRUE; - END; - END InitBuf; - - PROCEDURE FillBuf(s: Stream) : BOOLEAN; - (* return FALSE on EOF or errors *) - VAR - offset, count: Count; - posindex: Count; (* s.pos MOD bufsize *) - - PROCEDURE Fill(s: Stream; VAR offset, count: Count) : BOOLEAN; - (* try to fill buf.cont[offset]..buf.cont[offset+count-1]; - return FALSE on EOF; - Fill always extends a read region: - s.buf.rend is set to offset + the number of bytes read - *) - VAR - linetermseen: BOOLEAN; - byte: Byte; - BEGIN - IF s.eofFound THEN - RETURN FALSE - END; - IF addrio IN s.caps THEN - s.buf.rend := s.if.addrread(s, SYSTEM.ADR(s.buf.cont[offset]), count) + - offset; - ELSIF bufio IN s.caps THEN - s.buf.rend := s.if.bufread(s, s.buf.cont, offset, count) + offset; - ELSIF s.bufmode = linebuf THEN - s.buf.rend := offset; linetermseen := FALSE; - WHILE ~linetermseen & (s.buf.rend < offset+count) & - s.if.read(s, byte) DO - s.buf.cont[s.buf.rend] := byte; INC(s.buf.rend); - linetermseen := byte = s.termch; - END; - s.eofFound := ~linetermseen & - (s.buf.rend < offset+count); (* s.if.read failed? *) - ELSE - s.buf.rend := offset; - WHILE (s.buf.rend < offset+count) & - s.if.read(s, s.buf.cont[s.buf.rend]) DO - INC(s.buf.rend); - END; - s.eofFound := s.buf.rend < offset+count; (* s.if.read failed? *) - END; - (* negative counts of addrread or bufread indicate read errors *) - IF s.buf.rend < offset THEN - (* note error and recover s.buf.rend *) - Error(s, ReadFailed); - s.buf.rend := offset; - END; - INC(s.rpos, s.buf.rend - offset); - IF s.buf.rend > offset THEN - DEC(count, s.buf.rend - offset); - offset := s.buf.rend; - RETURN TRUE - ELSE - s.eofFound := TRUE; - RETURN FALSE - END; - END Fill; - - BEGIN (* FillBuf *) - ValidPos(s); - posindex := s.pos MOD bufsize; - s.eofFound := FALSE; - - (* flush associated output streams (line buffered streams only) *) - IF s.bufmode = linebuf THEN - IF write IN s.caps THEN - IF ~InternalFlush(s) THEN END; - END; - IF (s.tiedStream # NIL) & ~SYS.TAS(s.tiedStream.lock) THEN - IF ~InternalFlush(s.tiedStream) THEN END; - s.tiedStream.lock := FALSE; - END; - END; - - (* get a valid buffer and set - offset and count to the buffer range which is to be filled; - on default, we want to fill the whole buffer - *) - offset := 0; count := bufsize; (* default *) - IF ~s.buf.ok THEN - InitBuf(s); - ELSIF s.bidirect THEN - s.buf.rbegin := 0; s.buf.rend := 0; s.pos := 0; posindex := 0; - ELSE - IF s.bufmode = bufpool THEN - GetBuffer(s); - IF s.left > 0 THEN - (* buffer is already filled *) - s.eof := FALSE; RETURN TRUE - END; - ELSIF s.buf.pos # s.pos - posindex THEN - (* reuse filled buffer *) - IF write IN s.caps THEN - IF ~InternalFlush(s) THEN END; - END; - InitBuf(s); - END; - IF s.buf.rbegin # s.buf.rend THEN - IF (write IN s.caps) & - (s.buf.wbegin <= posindex) & (s.buf.wend > posindex) THEN - (* set read region to write region *) - s.buf.rbegin := s.buf.wbegin; s.buf.rend := s.buf.wend; - s.left := s.buf.wend - posindex; - s.eof := FALSE; RETURN TRUE - ELSIF s.buf.rend = posindex THEN - (* stream position equals end of read region *) - offset := s.buf.rend; count := bufsize - offset; - END; - END; - - (* take care of the write region by limiting count; - note that s.pos does *not* point into the write region; - this is guaranteed by WritePart and other operations - which would have extended the read region in such a case - *) - IF (write IN s.caps) & (s.buf.wbegin # s.buf.wend) THEN - IF s.buf.wbegin >= offset THEN - IF s.buf.wbegin > posindex THEN - (* write-region behind current position *) - count := s.buf.wbegin - offset; - ELSE - (* write-region before current position *) - offset := s.buf.wend; count := bufsize - offset; - END; - END; - IF (s.buf.pos + s.buf.wbegin = s.rpos) & ~(seek IN s.caps) THEN - (* flush if the start of write region corresponds to real - file position and we are not able to change the position - *) - IF ~InternalFlush(s) THEN END; - END; - END; - END; - - (* set the real position to the position we want to read from *) - IF ~s.bidirect & (s.buf.pos + offset # s.rpos) THEN - IF (seek IN s.caps) & s.if.seek(s, s.buf.pos+offset, fromStart) THEN - s.rpos := s.buf.pos + offset; - ELSIF s.pos = s.rpos THEN - DEC(count, posindex - offset); - offset := posindex; - ELSIF seek IN s.caps THEN - Error(s, SeekFailed); RETURN FALSE - ELSE - Error(s, CannotSeek); RETURN FALSE - END; - END; - - (* try to fill buf[offset..offset+count-1]; - and set s.buf.rbegin & s.buf.rend to the new read region - *) - IF s.buf.rend # offset THEN - (* forget old read region if we cannot extend it *) - s.buf.rbegin := offset; s.buf.rend := offset; - END; - WHILE Fill(s, offset, count) & (posindex >= s.buf.rend) DO END; - - IF posindex >= s.buf.rend THEN - (* read operation failed *) - IF (s.pos > s.rpos) & - (seek IN s.caps) & s.if.seek(s, s.pos, fromStart) THEN - s.rpos := s.pos; - (* second try: we were not able to fill the whole buffer - but perhaps we are able to read what we were requested for - *) - DEC(count, posindex - offset); - offset := posindex; - s.buf.rbegin := offset; s.buf.rend := offset; - s.eofFound := FALSE; (* retry it *) - s.eof := ~Fill(s, offset, count); - ELSE - s.eof := TRUE; - END; - ELSE - s.eof := FALSE; - END; - - IF s.eof THEN - s.left := 0; - ELSE - s.left := s.buf.rend - posindex; - END; - - RETURN ~s.eof - END FillBuf; - - - (* ==== i/o operations ============================================== *) - - PROCEDURE ReadPart*(s: Stream; VAR buf: ARRAY OF Byte; - off, cnt: Count) : BOOLEAN; - (* fill buf[off..off+cnt-1] *) - - VAR - pos: Count; - partcnt: Count; - - PROCEDURE ReadBytesFromBuf(s: Stream; - VAR to: ARRAY OF Byte; - off, cnt: Count) : BOOLEAN; - VAR - bytes, max, spos: Count; - BEGIN - IF s.left = 0 THEN - IF s.eofFound OR ~FillBuf(s) THEN RETURN FALSE END; - END; - spos := s.pos MOD bufsize; - max := s.left; - IF max > cnt THEN - max := cnt; - END; - bytes := 0; - WHILE bytes < max DO - to[off] := s.buf.cont[spos]; - INC(off); INC(spos); INC(bytes); - END; - INC(s.pos, bytes); DEC(s.left, bytes); INC(s.count, bytes); - IF ~s.bidirect THEN - IF s.write >= bytes THEN - DEC(s.write, bytes); - ELSE - s.write := 0; - END; - END; - RETURN TRUE - END ReadBytesFromBuf; - - BEGIN (* ReadPart *) - IF SYS.TAS(s.lock) THEN - Error(s, NestedCall); - RETURN FALSE - END; - s.error := FALSE; s.count := 0; - IF ~(read IN s.caps) THEN - s.lock := FALSE; Error(s, CannotRead); RETURN FALSE - ELSIF (off < 0) OR (off+cnt > LEN(buf)) OR (cnt < 0) THEN - s.lock := FALSE; Error(s, BadParameters); RETURN FALSE - END; - IF cnt = 0 THEN s.lock := FALSE; RETURN TRUE END; - IF s.buf # NIL THEN - s.eofFound := FALSE; - WHILE (s.count < cnt) & - ReadBytesFromBuf(s, buf, s.count + off, cnt - s.count) DO - (* s.count is already incremented by ReadBytesFromBuf *) - END; - (* extend write region, if necessary *) - IF ~s.bidirect THEN - pos := s.pos MOD bufsize; - IF (s.write > 0) & (s.buf.wend < pos) THEN - IF s.buf.wbegin = s.buf.wend THEN - s.buf.wbegin := pos; - END; - s.buf.wend := pos; - END; - END; - ELSE - IF addrio IN s.caps THEN - s.count := s.if.addrread(s, SYSTEM.ADR(buf[off]), cnt); - IF (s.count > 0) & (s.count < cnt) THEN - LOOP - partcnt := s.if.addrread(s, - SYSTEM.ADR(buf[off + s.count]), cnt - s.count); - IF (partcnt < 0) OR (partcnt = 0) THEN EXIT END; - ASSERT(partcnt <= cnt - s.count); - INC(s.count, partcnt); - IF s.count = cnt THEN EXIT END; - END; - END; - ELSIF bufio IN s.caps THEN - s.count := s.if.bufread(s, buf, off, cnt); - IF (s.count > 0) & (s.count < cnt) THEN - LOOP - partcnt := s.if.bufread(s, buf, off + s.count, cnt - s.count); - IF (partcnt < 0) OR (partcnt = 0) THEN EXIT END; - ASSERT(partcnt <= cnt - s.count); - INC(s.count, partcnt); - IF s.count = cnt THEN EXIT END; - END; - END; - ELSE - s.count := 0; - WHILE (s.count < cnt) & s.if.read(s, buf[s.count+off]) DO - INC(s.count); - END; - END; - IF s.count < 0 THEN - s.count := 0; - Error(s, ReadFailed); - ELSE - s.eof := s.count = 0; - END; - END; - s.lock := FALSE; - RETURN s.count = cnt - END ReadPart; - - PROCEDURE Read*(s: Stream; VAR buf: ARRAY OF Byte) : BOOLEAN; - BEGIN - RETURN ReadPart(s, buf, 0, LEN(buf)) - END Read; - - PROCEDURE ReadByte*(s: Stream; VAR byte: Byte) : BOOLEAN; - VAR - ok: BOOLEAN; - pos: Count; - BEGIN - IF SYS.TAS(s.lock) THEN - Error(s, NestedCall); RETURN FALSE - END; - s.error := FALSE; - IF s.left = 0 THEN - IF ~(read IN s.caps) THEN - s.lock := FALSE; Error(s, CannotRead); s.count := 0; RETURN FALSE - END; - IF s.buf # NIL THEN - IF ~FillBuf(s) THEN - (* FillBuf sets s.eof *) - s.lock := FALSE; - s.count := 0; - RETURN FALSE - END; - ELSE - ok := s.if.read(s, byte); - IF ok THEN - s.count := 1; - ELSE - s.count := 0; - END; - s.eof := ~ok; - s.lock := FALSE; - RETURN ok - END; - END; - (* s.left > 0 *) - s.count := 1; - byte := s.buf.cont[s.pos MOD bufsize]; - INC(s.pos); DEC(s.left); - IF ~s.bidirect & (s.write # 0) THEN - DEC(s.write); - pos := s.pos MOD bufsize; - IF s.buf.wend < pos THEN - IF s.buf.wbegin = s.buf.wend THEN - s.buf.wbegin := pos; - END; - s.buf.wend := pos; - END; - END; - (* s.eof has been set by FillBuf *) - s.lock := FALSE; - RETURN TRUE - END ReadByte; - - PROCEDURE ReadPacket*(s: Stream; VAR buf: ARRAY OF Byte; - off, maxcnt: Count) : Count; - (* fill buf[off..] with next packet *) - BEGIN - IF s.left > 0 THEN - IF maxcnt > s.left THEN - maxcnt := s.left; - END; - IF ReadPart(s, buf, off, maxcnt) THEN END; - RETURN s.count - END; - - IF SYS.TAS(s.lock) THEN - Error(s, NestedCall); - s.count := 0; - RETURN 0 - END; - s.error := FALSE; s.count := 0; - IF ~(read IN s.caps) THEN - s.lock := FALSE; Error(s, CannotRead); s.count := 0; RETURN 0 - ELSIF (off < 0) OR (off+maxcnt > LEN(buf)) OR (maxcnt < 0) THEN - s.lock := FALSE; Error(s, BadParameters); s.count := 0; RETURN 0 - END; - IF maxcnt = 0 THEN s.lock := FALSE; RETURN 0 END; - - IF s.buf # NIL THEN - (* s.left = 0 *) - IF ~FillBuf(s) THEN - (* FillBuf sets s.eof *) - s.lock := FALSE; - RETURN 0 - END; - s.lock := FALSE; - IF maxcnt > s.left THEN - maxcnt := s.left; - END; - IF ReadPart(s, buf, off, maxcnt) THEN END; - RETURN s.count - END; - - (* s.buf = NIL *) IF addrio IN s.caps THEN - s.count := s.if.addrread(s, SYSTEM.ADR(buf[off]), maxcnt); + s.buf.rend := s.if.addrread(s, SYSTEM.ADR(s.buf.cont[offset]), count) + + offset; ELSIF bufio IN s.caps THEN - s.count := s.if.bufread(s, buf, off, maxcnt); + s.buf.rend := s.if.bufread(s, s.buf.cont, offset, count) + offset; + ELSIF s.bufmode = linebuf THEN + s.buf.rend := offset; linetermseen := FALSE; + WHILE ~linetermseen & (s.buf.rend < offset+count) & + s.if.read(s, byte) DO + s.buf.cont[s.buf.rend] := byte; INC(s.buf.rend); + linetermseen := byte = s.termch; + END; + s.eofFound := ~linetermseen & + (s.buf.rend < offset+count); (* s.if.read failed? *) ELSE - s.count := 0; - WHILE (s.count < maxcnt) & s.if.read(s, buf[s.count+off]) DO - INC(s.count); - END; + s.buf.rend := offset; + WHILE (s.buf.rend < offset+count) & + s.if.read(s, s.buf.cont[s.buf.rend]) DO + INC(s.buf.rend); + END; + s.eofFound := s.buf.rend < offset+count; (* s.if.read failed? *) + END; + (* negative counts of addrread or bufread indicate read errors *) + IF s.buf.rend < offset THEN + (* note error and recover s.buf.rend *) + Error(s, ReadFailed); + s.buf.rend := offset; + END; + INC(s.rpos, s.buf.rend - offset); + IF s.buf.rend > offset THEN + DEC(count, s.buf.rend - offset); + offset := s.buf.rend; + RETURN TRUE + ELSE + s.eofFound := TRUE; + RETURN FALSE + END; + END Fill; + + BEGIN (* FillBuf *) + ValidPos(s); + posindex := s.pos MOD bufsize; + s.eofFound := FALSE; + + (* flush associated output streams (line buffered streams only) *) + IF s.bufmode = linebuf THEN + IF write IN s.caps THEN + IF ~InternalFlush(s) THEN END; + END; + IF (s.tiedStream # NIL) & ~SYS.TAS(s.tiedStream.lock) THEN + IF ~InternalFlush(s.tiedStream) THEN END; + s.tiedStream.lock := FALSE; + END; + END; + + (* get a valid buffer and set + offset and count to the buffer range which is to be filled; + on default, we want to fill the whole buffer + *) + offset := 0; count := bufsize; (* default *) + IF ~s.buf.ok THEN + InitBuf(s); + ELSIF s.bidirect THEN + s.buf.rbegin := 0; s.buf.rend := 0; s.pos := 0; posindex := 0; + ELSE + IF s.bufmode = bufpool THEN + GetBuffer(s); + IF s.left > 0 THEN + (* buffer is already filled *) + s.eof := FALSE; RETURN TRUE + END; + ELSIF s.buf.pos # s.pos - posindex THEN + (* reuse filled buffer *) + IF write IN s.caps THEN + IF ~InternalFlush(s) THEN END; + END; + InitBuf(s); + END; + IF s.buf.rbegin # s.buf.rend THEN + IF (write IN s.caps) & + (s.buf.wbegin <= posindex) & (s.buf.wend > posindex) THEN + (* set read region to write region *) + s.buf.rbegin := s.buf.wbegin; s.buf.rend := s.buf.wend; + s.left := s.buf.wend - posindex; + s.eof := FALSE; RETURN TRUE + ELSIF s.buf.rend = posindex THEN + (* stream position equals end of read region *) + offset := s.buf.rend; count := bufsize - offset; + END; + END; + + (* take care of the write region by limiting count; + note that s.pos does *not* point into the write region; + this is guaranteed by WritePart and other operations + which would have extended the read region in such a case + *) + IF (write IN s.caps) & (s.buf.wbegin # s.buf.wend) THEN + IF s.buf.wbegin >= offset THEN + IF s.buf.wbegin > posindex THEN + (* write-region behind current position *) + count := s.buf.wbegin - offset; + ELSE + (* write-region before current position *) + offset := s.buf.wend; count := bufsize - offset; + END; + END; + IF (s.buf.pos + s.buf.wbegin = s.rpos) & ~(seek IN s.caps) THEN + (* flush if the start of write region corresponds to real + file position and we are not able to change the position + *) + IF ~InternalFlush(s) THEN END; + END; + END; + END; + + (* set the real position to the position we want to read from *) + IF ~s.bidirect & (s.buf.pos + offset # s.rpos) THEN + IF (seek IN s.caps) & s.if.seek(s, s.buf.pos+offset, fromStart) THEN + s.rpos := s.buf.pos + offset; + ELSIF s.pos = s.rpos THEN + DEC(count, posindex - offset); + offset := posindex; + ELSIF seek IN s.caps THEN + Error(s, SeekFailed); RETURN FALSE + ELSE + Error(s, CannotSeek); RETURN FALSE + END; + END; + + (* try to fill buf[offset..offset+count-1]; + and set s.buf.rbegin & s.buf.rend to the new read region + *) + IF s.buf.rend # offset THEN + (* forget old read region if we cannot extend it *) + s.buf.rbegin := offset; s.buf.rend := offset; + END; + WHILE Fill(s, offset, count) & (posindex >= s.buf.rend) DO END; + + IF posindex >= s.buf.rend THEN + (* read operation failed *) + IF (s.pos > s.rpos) & + (seek IN s.caps) & s.if.seek(s, s.pos, fromStart) THEN + s.rpos := s.pos; + (* second try: we were not able to fill the whole buffer + but perhaps we are able to read what we were requested for + *) + DEC(count, posindex - offset); + offset := posindex; + s.buf.rbegin := offset; s.buf.rend := offset; + s.eofFound := FALSE; (* retry it *) + s.eof := ~Fill(s, offset, count); + ELSE + s.eof := TRUE; + END; + ELSE + s.eof := FALSE; + END; + + IF s.eof THEN + s.left := 0; + ELSE + s.left := s.buf.rend - posindex; + END; + + RETURN ~s.eof + END FillBuf; + + + (* ==== i/o operations ============================================== *) + + PROCEDURE ReadPart*(s: Stream; VAR buf: ARRAY OF Byte; + off, cnt: Count) : BOOLEAN; + (* fill buf[off..off+cnt-1] *) + + VAR + pos: Count; + partcnt: Count; + + PROCEDURE ReadBytesFromBuf(s: Stream; + VAR to: ARRAY OF Byte; + off, cnt: Count) : BOOLEAN; + VAR + bytes, max, spos: Count; + BEGIN + IF s.left = 0 THEN + IF s.eofFound OR ~FillBuf(s) THEN RETURN FALSE END; + END; + spos := s.pos MOD bufsize; + max := s.left; + IF max > cnt THEN + max := cnt; + END; + bytes := 0; + WHILE bytes < max DO + to[off] := s.buf.cont[spos]; + INC(off); INC(spos); INC(bytes); + END; + INC(s.pos, bytes); DEC(s.left, bytes); INC(s.count, bytes); + IF ~s.bidirect THEN + IF s.write >= bytes THEN + DEC(s.write, bytes); + ELSE + s.write := 0; + END; + END; + RETURN TRUE + END ReadBytesFromBuf; + + BEGIN (* ReadPart *) + IF SYS.TAS(s.lock) THEN + Error(s, NestedCall); + RETURN FALSE + END; + s.error := FALSE; s.count := 0; + IF ~(read IN s.caps) THEN + s.lock := FALSE; Error(s, CannotRead); RETURN FALSE + ELSIF (off < 0) OR (off+cnt > LEN(buf)) OR (cnt < 0) THEN + s.lock := FALSE; Error(s, BadParameters); RETURN FALSE + END; + IF cnt = 0 THEN s.lock := FALSE; RETURN TRUE END; + IF s.buf # NIL THEN + s.eofFound := FALSE; + WHILE (s.count < cnt) & + ReadBytesFromBuf(s, buf, s.count + off, cnt - s.count) DO + (* s.count is already incremented by ReadBytesFromBuf *) + END; + (* extend write region, if necessary *) + IF ~s.bidirect THEN + pos := s.pos MOD bufsize; + IF (s.write > 0) & (s.buf.wend < pos) THEN + IF s.buf.wbegin = s.buf.wend THEN + s.buf.wbegin := pos; + END; + s.buf.wend := pos; + END; + END; + ELSE + IF addrio IN s.caps THEN + s.count := s.if.addrread(s, SYSTEM.ADR(buf[off]), cnt); + IF (s.count > 0) & (s.count < cnt) THEN + LOOP + partcnt := s.if.addrread(s, + SYSTEM.ADR(buf[off + s.count]), cnt - s.count); + IF (partcnt < 0) OR (partcnt = 0) THEN EXIT END; + ASSERT(partcnt <= cnt - s.count); + INC(s.count, partcnt); + IF s.count = cnt THEN EXIT END; + END; + END; + ELSIF bufio IN s.caps THEN + s.count := s.if.bufread(s, buf, off, cnt); + IF (s.count > 0) & (s.count < cnt) THEN + LOOP + partcnt := s.if.bufread(s, buf, off + s.count, cnt - s.count); + IF (partcnt < 0) OR (partcnt = 0) THEN EXIT END; + ASSERT(partcnt <= cnt - s.count); + INC(s.count, partcnt); + IF s.count = cnt THEN EXIT END; + END; + END; + ELSE + s.count := 0; + WHILE (s.count < cnt) & s.if.read(s, buf[s.count+off]) DO + INC(s.count); + END; END; IF s.count < 0 THEN - s.count := 0; - Error(s, ReadFailed); + s.count := 0; + Error(s, ReadFailed); ELSE - s.eof := s.count = 0; + s.eof := s.count = 0; END; - s.lock := FALSE; - RETURN s.count - END ReadPacket; + END; + s.lock := FALSE; + RETURN s.count = cnt + END ReadPart; - PROCEDURE WritePart*(s: Stream; - (* read-only *) VAR buf: ARRAY OF Byte; - off, cnt: Count) : BOOLEAN; - (* write buf[off..off+cnt-1] to s *) - VAR - posindex: Count; + PROCEDURE Read*(s: Stream; VAR buf: ARRAY OF Byte) : BOOLEAN; + BEGIN + RETURN ReadPart(s, buf, 0, LEN(buf)) + END Read; - PROCEDURE NewBuffer(s: Stream) : BOOLEAN; - (* flush and get new buffer *) - BEGIN - IF s.pos - posindex # s.buf.pos THEN - IF s.bufmode # bufpool THEN - IF ~InternalFlush(s) THEN RETURN FALSE END; - END; - InitBuf(s); - IF s.write # 0 THEN RETURN TRUE END; - END; - IF s.buf.wbegin = s.buf.wend THEN - (* nothing written into this buffer until now *) - s.buf.wbegin := posindex; s.buf.wend := posindex; - s.write := bufsize - posindex; - ELSIF s.wextensible & (s.buf.rbegin # s.buf.rend) THEN - (* check if the write region may be extended - over parts of the read region - *) - IF s.buf.wend < posindex THEN - (* write region before current position *) - IF (s.buf.rbegin <= s.buf.wend) & (s.buf.rend >= posindex) THEN - s.buf.wend := posindex; - s.write := bufsize - posindex; - END; - ELSE (* s.wbegin > posindex *) - (* write region after current position *) - IF (s.buf.rbegin <= posindex) & (s.buf.rend >= s.buf.wbegin) THEN - s.buf.wbegin := posindex; - s.write := bufsize - posindex; - END; - END; - END; - IF (* still *) s.write = 0 THEN - (* Flush necessary *) - IF ~InternalFlush(s) THEN RETURN FALSE END; - s.buf.wbegin := posindex; s.buf.wend := posindex; - s.write := bufsize - posindex; - END; - RETURN TRUE - END NewBuffer; - - PROCEDURE UpdateReadRegion(s: Stream); - BEGIN - (* update s.left and extend read region, if possible *) - IF s.buf.rbegin = s.buf.rend THEN - (* set read region to write region *) - s.buf.rbegin := s.buf.wbegin; s.buf.rend := s.buf.wend; - s.left := s.buf.rend - posindex; - ELSIF (s.buf.rbegin < s.buf.wbegin) & (s.buf.rend >= s.buf.wbegin) THEN - (* forward extension of read region possible *) - IF s.buf.rend < s.buf.wend THEN - s.buf.rend := s.buf.wend; - END; - s.left := s.buf.rend - posindex; - ELSIF (s.buf.rbegin <= s.buf.wend) & (s.buf.rend > s.buf.wend) THEN - (* backward extension of read region possible *) - IF s.buf.rbegin > s.buf.wbegin THEN - s.buf.rbegin := s.buf.wend; - END; - s.left := s.buf.rend - posindex; - ELSE - (* posindex does not fall into [s.buf.rbegin..s.buf.rend-1] *) - s.left := 0; - END; - IF s.pos = s.buf.pos + bufsize THEN - s.left := 0; - END; - END UpdateReadRegion; - - BEGIN - IF SYS.TAS(s.lock) THEN - Error(s, NestedCall); RETURN FALSE + PROCEDURE ReadByte*(s: Stream; VAR byte: Byte) : BOOLEAN; + VAR + ok: BOOLEAN; + pos: Count; + BEGIN + IF SYS.TAS(s.lock) THEN + Error(s, NestedCall); RETURN FALSE + END; + s.error := FALSE; + IF s.left = 0 THEN + IF ~(read IN s.caps) THEN + s.lock := FALSE; Error(s, CannotRead); s.count := 0; RETURN FALSE END; - s.error := FALSE; s.count := 0; - IF ~(write IN s.caps) THEN - s.lock := FALSE; Error(s, CannotWrite); RETURN FALSE - ELSIF (off < 0) OR (off+cnt > LEN(buf)) OR (cnt < 0) THEN - s.lock := FALSE; Error(s, BadParameters); RETURN FALSE - ELSIF cnt = 0 THEN - s.lock := FALSE; RETURN TRUE - END; - IF s.buf # NIL THEN - IF s.bidirect THEN - WHILE s.count < cnt DO - IF (s.write = 0) & ~InternalFlush(s) THEN - s.lock := FALSE; RETURN FALSE - END; - s.wbuf.cont[s.wbuf.wend] := buf[off + s.count]; - INC(s.wbuf.wend); INC(s.count); DEC(s.write); - IF (s.bufmode = linebuf) & - (buf[s.count+off-1] = s.termch) THEN - IF ~InternalFlush(s) THEN - s.lock := FALSE; RETURN FALSE - END; - END; - END; - ELSE - ValidPos(s); - posindex := s.pos MOD bufsize; - IF ~s.buf.ok THEN - InitBuf(s); - END; + IF ~FillBuf(s) THEN + (* FillBuf sets s.eof *) + s.lock := FALSE; + s.count := 0; + RETURN FALSE + END; + ELSE + ok := s.if.read(s, byte); + IF ok THEN + s.count := 1; + ELSE + s.count := 0; + END; + s.eof := ~ok; + s.lock := FALSE; + RETURN ok + END; + END; + (* s.left > 0 *) + s.count := 1; + byte := s.buf.cont[s.pos MOD bufsize]; + INC(s.pos); DEC(s.left); + IF ~s.bidirect & (s.write # 0) THEN + DEC(s.write); + pos := s.pos MOD bufsize; + IF s.buf.wend < pos THEN + IF s.buf.wbegin = s.buf.wend THEN + s.buf.wbegin := pos; + END; + s.buf.wend := pos; + END; + END; + (* s.eof has been set by FillBuf *) + s.lock := FALSE; + RETURN TRUE + END ReadByte; - (* copy from buf to s.buf *) - WHILE s.count < cnt DO - IF s.write = 0 THEN - posindex := s.pos MOD bufsize; - IF s.count > 0 THEN - UpdateReadRegion(s); - END; - IF ~NewBuffer(s) THEN - s.lock := FALSE; RETURN FALSE - END; - END; - s.buf.cont[posindex] := buf[off + s.count]; - IF s.buf.wend = posindex THEN - INC(s.buf.wend); - END; - INC(s.count); INC(s.pos); DEC(s.write); INC(posindex); - IF (s.bufmode = linebuf) & - (buf[s.count+off-1] = s.termch) THEN - UpdateReadRegion(s); - IF ~InternalFlush(s) THEN - s.lock := FALSE; RETURN FALSE - END; - (* s.pos can be changed by InternalFlush *) - posindex := s.pos MOD bufsize; - END; - END; - UpdateReadRegion(s); - END; - ELSE (* unbuffered stream *) - IF addrio IN s.caps THEN - s.count := s.if.addrwrite(s, SYSTEM.ADR(buf[off]), cnt); - ELSIF bufio IN s.caps THEN - s.count := s.if.bufwrite(s, buf, off, cnt); - ELSE - s.count := 0; - WHILE (s.count < cnt) & s.if.write(s, buf[off+s.count]) DO - INC(s.count); - END; - END; - IF s.count # cnt THEN - Error(s, WriteFailed); - END; + PROCEDURE ReadPacket*(s: Stream; VAR buf: ARRAY OF Byte; + off, maxcnt: Count) : Count; + (* fill buf[off..] with next packet *) + BEGIN + IF s.left > 0 THEN + IF maxcnt > s.left THEN + maxcnt := s.left; + END; + IF ReadPart(s, buf, off, maxcnt) THEN END; + RETURN s.count + END; + + IF SYS.TAS(s.lock) THEN + Error(s, NestedCall); + s.count := 0; + RETURN 0 + END; + s.error := FALSE; s.count := 0; + IF ~(read IN s.caps) THEN + s.lock := FALSE; Error(s, CannotRead); s.count := 0; RETURN 0 + ELSIF (off < 0) OR (off+maxcnt > LEN(buf)) OR (maxcnt < 0) THEN + s.lock := FALSE; Error(s, BadParameters); s.count := 0; RETURN 0 + END; + IF maxcnt = 0 THEN s.lock := FALSE; RETURN 0 END; + + IF s.buf # NIL THEN + (* s.left = 0 *) + IF ~FillBuf(s) THEN + (* FillBuf sets s.eof *) + s.lock := FALSE; + RETURN 0 END; s.lock := FALSE; - RETURN s.count = cnt - END WritePart; - - PROCEDURE Write*(s: Stream; - (* read-only *) VAR buf: ARRAY OF Byte) : BOOLEAN; - BEGIN - RETURN WritePart(s, buf, 0, LEN(buf)) - END Write; - - PROCEDURE WritePartC*(s: Stream; buf: ARRAY OF Byte; - off, cnt: Count) : BOOLEAN; - (* write buf[off..off+cnt-1] to s *) - BEGIN - RETURN WritePart(s, buf, off, cnt) - END WritePartC; - - PROCEDURE WriteC*(s: Stream; buf: ARRAY OF Byte) : BOOLEAN; - BEGIN - RETURN WritePart(s, buf, 0, LEN(buf)) - END WriteC; - - PROCEDURE WriteByte*(s: Stream; byte: Byte) : BOOLEAN; - VAR - posindex: Count; - BEGIN - IF (s.write > 0) & ~SYS.TAS(s.lock) THEN - s.error := FALSE; s.count := 1; - - IF s.bidirect THEN - s.wbuf.cont[s.wbuf.wend] := byte; INC(s.wbuf.wend); DEC(s.write); - ELSE - (* put byte into s.buf *) - posindex := s.pos MOD bufsize; - s.buf.cont[posindex] := byte; - IF s.buf.wend = posindex THEN - INC(s.buf.wend); - END; - DEC(s.write); - - (* update s.buf.rend and s.left, if necessary *) - IF s.buf.rend = posindex THEN - INC(s.buf.rend); - END; - IF s.left # 0 THEN - DEC(s.left); - ELSIF s.buf.rbegin = s.buf.rend THEN - (* set read-region to write-region *) - s.buf.rbegin := s.buf.wbegin; s.buf.rend := s.buf.wend; - s.left := s.buf.wend - posindex; - END; - - INC(s.pos); - END; - - IF (s.bufmode = linebuf) & (byte = s.termch) THEN - IF ~InternalFlush(s) THEN - s.lock := FALSE; RETURN FALSE - END; - IF ~s.bidirect THEN - s.buf.wbegin := s.pos MOD bufsize; - END; - END; - - s.lock := FALSE; RETURN TRUE - ELSE - RETURN WritePart(s, byte, 0, 1) + IF maxcnt > s.left THEN + maxcnt := s.left; END; - END WriteByte; + IF ReadPart(s, buf, off, maxcnt) THEN END; + RETURN s.count + END; - PROCEDURE InternalSeek(s: Stream; offset: Count; whence: Whence) : BOOLEAN; - VAR - oldpos: Count; pos: Count; - BEGIN - s.error := FALSE; + (* s.buf = NIL *) + IF addrio IN s.caps THEN + s.count := s.if.addrread(s, SYSTEM.ADR(buf[off]), maxcnt); + ELSIF bufio IN s.caps THEN + s.count := s.if.bufread(s, buf, off, maxcnt); + ELSE + s.count := 0; + WHILE (s.count < maxcnt) & s.if.read(s, buf[s.count+off]) DO + INC(s.count); + END; + END; + IF s.count < 0 THEN + s.count := 0; + Error(s, ReadFailed); + ELSE + s.eof := s.count = 0; + END; + s.lock := FALSE; + RETURN s.count + END ReadPacket; + + PROCEDURE WritePart*(s: Stream; + (* read-only *) VAR buf: ARRAY OF Byte; + off, cnt: Count) : BOOLEAN; + (* write buf[off..off+cnt-1] to s *) + VAR + posindex: Count; + + PROCEDURE NewBuffer(s: Stream) : BOOLEAN; + (* flush and get new buffer *) + BEGIN + IF s.pos - posindex # s.buf.pos THEN + IF s.bufmode # bufpool THEN + IF ~InternalFlush(s) THEN RETURN FALSE END; + END; + InitBuf(s); + IF s.write # 0 THEN RETURN TRUE END; + END; + IF s.buf.wbegin = s.buf.wend THEN + (* nothing written into this buffer until now *) + s.buf.wbegin := posindex; s.buf.wend := posindex; + s.write := bufsize - posindex; + ELSIF s.wextensible & (s.buf.rbegin # s.buf.rend) THEN + (* check if the write region may be extended + over parts of the read region + *) + IF s.buf.wend < posindex THEN + (* write region before current position *) + IF (s.buf.rbegin <= s.buf.wend) & (s.buf.rend >= posindex) THEN + s.buf.wend := posindex; + s.write := bufsize - posindex; + END; + ELSE (* s.wbegin > posindex *) + (* write region after current position *) + IF (s.buf.rbegin <= posindex) & (s.buf.rend >= s.buf.wbegin) THEN + s.buf.wbegin := posindex; + s.write := bufsize - posindex; + END; + END; + END; + IF (* still *) s.write = 0 THEN + (* Flush necessary *) + IF ~InternalFlush(s) THEN RETURN FALSE END; + s.buf.wbegin := posindex; s.buf.wend := posindex; + s.write := bufsize - posindex; + END; + RETURN TRUE + END NewBuffer; + + PROCEDURE UpdateReadRegion(s: Stream); + BEGIN + (* update s.left and extend read region, if possible *) + IF s.buf.rbegin = s.buf.rend THEN + (* set read region to write region *) + s.buf.rbegin := s.buf.wbegin; s.buf.rend := s.buf.wend; + s.left := s.buf.rend - posindex; + ELSIF (s.buf.rbegin < s.buf.wbegin) & (s.buf.rend >= s.buf.wbegin) THEN + (* forward extension of read region possible *) + IF s.buf.rend < s.buf.wend THEN + s.buf.rend := s.buf.wend; + END; + s.left := s.buf.rend - posindex; + ELSIF (s.buf.rbegin <= s.buf.wend) & (s.buf.rend > s.buf.wend) THEN + (* backward extension of read region possible *) + IF s.buf.rbegin > s.buf.wbegin THEN + s.buf.rbegin := s.buf.wend; + END; + s.left := s.buf.rend - posindex; + ELSE + (* posindex does not fall into [s.buf.rbegin..s.buf.rend-1] *) + s.left := 0; + END; + IF s.pos = s.buf.pos + bufsize THEN + s.left := 0; + END; + END UpdateReadRegion; + + BEGIN + IF SYS.TAS(s.lock) THEN + Error(s, NestedCall); RETURN FALSE + END; + s.error := FALSE; s.count := 0; + IF ~(write IN s.caps) THEN + s.lock := FALSE; Error(s, CannotWrite); RETURN FALSE + ELSIF (off < 0) OR (off+cnt > LEN(buf)) OR (cnt < 0) THEN + s.lock := FALSE; Error(s, BadParameters); RETURN FALSE + ELSIF cnt = 0 THEN + s.lock := FALSE; RETURN TRUE + END; + + IF s.buf # NIL THEN IF s.bidirect THEN - Error(s, CannotSeek); RETURN FALSE - ELSIF s.buf = NIL THEN - IF ~(seek IN s.caps) THEN - Error(s, CannotSeek); RETURN FALSE - ELSIF ~s.if.seek(s, offset, whence) THEN - Error(s, SeekFailed); RETURN FALSE - END; + WHILE s.count < cnt DO + IF (s.write = 0) & ~InternalFlush(s) THEN + s.lock := FALSE; RETURN FALSE + END; + s.wbuf.cont[s.wbuf.wend] := buf[off + s.count]; + INC(s.wbuf.wend); INC(s.count); DEC(s.write); + IF (s.bufmode = linebuf) & + (buf[s.count+off-1] = s.termch) THEN + IF ~InternalFlush(s) THEN + s.lock := FALSE; RETURN FALSE + END; + END; + END; ELSE - IF ~s.validpos & (seek IN s.caps) THEN - IF (write IN s.caps) & ~InternalFlush(s) THEN END; - IF ~s.if.seek(s, offset, whence) THEN - Error(s, SeekFailed); RETURN FALSE - END; - IF whence = fromStart THEN - s.validpos := TRUE; - s.pos := offset; s.rpos := offset; - END; - ELSE - ValidPos(s); oldpos := s.pos; - IF s.pos > s.maxpos THEN - s.maxpos := s.pos; - END; - CASE whence OF - | fromStart: IF offset < 0 THEN - Error(s, SeekFailed); RETURN FALSE - END; - s.pos := offset; - | fromPos: IF s.pos + offset < 0 THEN - Error(s, SeekFailed); RETURN FALSE - END; - INC(s.pos, offset); - | fromEnd: IF (write IN s.caps) & ~InternalFlush(s) THEN END; - IF ~(seek IN s.caps) OR - ~s.if.seek(s, offset, whence) THEN - Error(s, SeekFailed); RETURN FALSE - END; - s.validpos := FALSE; ValidPos(s); - ELSE - Error(s, BadWhence); RETURN FALSE - END; - IF ~(holes IN s.caps) & (s.pos > s.maxpos) THEN - (* if holes are not permitted - we need to check the new position - *) - IF ~(seek IN s.caps) THEN - Error(s, CannotSeek); RETURN FALSE - ELSIF s.if.seek(s, s.pos, fromStart) THEN - s.rpos := s.pos; s.maxpos := s.pos; - ELSE - Error(s, SeekFailed); RETURN FALSE - END; - END; - IF s.buf.ok & (s.pos # oldpos) THEN - (* set s.left and s.write *) - IF (s.pos < s.buf.pos) OR (s.pos >= s.buf.pos + bufsize) THEN - s.left := 0; s.write := 0; - ELSE - pos := s.pos MOD bufsize; - IF s.buf.rbegin = s.buf.rend THEN - s.buf.rbegin := pos; s.buf.rend := pos; - END; - IF s.buf.wbegin = s.buf.wend THEN - s.buf.wbegin := pos; s.buf.wend := pos; - END; - IF s.pos > oldpos THEN - IF (pos >= s.buf.rbegin) & (pos < s.buf.rend) THEN - s.left := s.buf.rend - pos; - ELSE - s.left := 0; - END; - IF (pos >= s.buf.wbegin) & (pos <= s.buf.wend) THEN - s.write := bufsize - pos; - ELSE - s.write := 0; - END; - IF s.wextensible & - (s.write < s.left) & (s.buf.wbegin # s.buf.wend) THEN - (* s.write = 0 (else s.write >= s.left); - try to extend write-region to avoid - an unnecessary flush operation - *) - IF (s.buf.wbegin < pos) & - (s.buf.wend >= s.buf.rbegin) THEN - (* write-region is followed by read-region *) - s.buf.wend := pos; s.write := bufsize - pos; - ELSIF (pos < s.buf.wbegin) & - (s.buf.wbegin >= s.buf.rend) THEN - (* read-region is followed by write-region *) - s.buf.wbegin := pos; s.write := bufsize - pos; - END; - END; - ELSE (* s.pos < oldpos *) - IF (pos < s.buf.rbegin) OR (pos > s.buf.rend) THEN - s.left := 0; - ELSE - s.left := s.buf.rend - pos; - END; - IF (pos < s.buf.wbegin) OR (pos > s.buf.wend) THEN - s.write := 0; - ELSE - s.write := bufsize - pos; - END; - END; - END; - END; - END; - END; - IF s.left > 0 THEN - s.eof := FALSE; - END; - RETURN TRUE - END InternalSeek; + ValidPos(s); + posindex := s.pos MOD bufsize; + IF ~s.buf.ok THEN + InitBuf(s); + END; - PROCEDURE Seek*(s: Stream; offset: Count; whence: Whence) : BOOLEAN; - VAR - rval: BOOLEAN; - BEGIN - IF ~SYS.TAS(s.lock) THEN - rval := InternalSeek(s, offset, whence); - s.lock := FALSE; - RETURN rval + (* copy from buf to s.buf *) + WHILE s.count < cnt DO + IF s.write = 0 THEN + posindex := s.pos MOD bufsize; + IF s.count > 0 THEN + UpdateReadRegion(s); + END; + IF ~NewBuffer(s) THEN + s.lock := FALSE; RETURN FALSE + END; + END; + s.buf.cont[posindex] := buf[off + s.count]; + IF s.buf.wend = posindex THEN + INC(s.buf.wend); + END; + INC(s.count); INC(s.pos); DEC(s.write); INC(posindex); + IF (s.bufmode = linebuf) & + (buf[s.count+off-1] = s.termch) THEN + UpdateReadRegion(s); + IF ~InternalFlush(s) THEN + s.lock := FALSE; RETURN FALSE + END; + (* s.pos can be changed by InternalFlush *) + posindex := s.pos MOD bufsize; + END; + END; + UpdateReadRegion(s); + END; + ELSE (* unbuffered stream *) + IF addrio IN s.caps THEN + s.count := s.if.addrwrite(s, SYSTEM.ADR(buf[off]), cnt); + ELSIF bufio IN s.caps THEN + s.count := s.if.bufwrite(s, buf, off, cnt); ELSE - Error(s, NestedCall); - RETURN FALSE + s.count := 0; + WHILE (s.count < cnt) & s.if.write(s, buf[off+s.count]) DO + INC(s.count); + END; END; - END Seek; + IF s.count # cnt THEN + Error(s, WriteFailed); + END; + END; + s.lock := FALSE; + RETURN s.count = cnt + END WritePart; - PROCEDURE Tell*(s: Stream; VAR offset: Count) : BOOLEAN; - BEGIN - IF ~SYS.TAS(s.lock) THEN - s.error := FALSE; - IF tell IN s.caps THEN - IF s.buf # NIL THEN - IF s.validpos THEN - offset := s.pos; - ELSIF s.if.tell(s, s.rpos) THEN - s.validpos := TRUE; - s.pos := s.rpos; - offset := s.pos; - ELSE - s.lock := FALSE; - Error(s, TellFailed); - END; - ELSIF ~s.if.tell(s, offset) THEN - s.lock := FALSE; - Error(s, TellFailed); - END; - ELSE - s.lock := FALSE; - Error(s, CannotTell); - END; - s.lock := FALSE; + PROCEDURE Write*(s: Stream; + (* read-only *) VAR buf: ARRAY OF Byte) : BOOLEAN; + BEGIN + RETURN WritePart(s, buf, 0, LEN(buf)) + END Write; + + PROCEDURE WritePartC*(s: Stream; buf: ARRAY OF Byte; + off, cnt: Count) : BOOLEAN; + (* write buf[off..off+cnt-1] to s *) + BEGIN + RETURN WritePart(s, buf, off, cnt) + END WritePartC; + + PROCEDURE WriteC*(s: Stream; buf: ARRAY OF Byte) : BOOLEAN; + BEGIN + RETURN WritePart(s, buf, 0, LEN(buf)) + END WriteC; + + PROCEDURE WriteByte*(s: Stream; byte: Byte) : BOOLEAN; + VAR + posindex: Count; + BEGIN + IF (s.write > 0) & ~SYS.TAS(s.lock) THEN + s.error := FALSE; s.count := 1; + + IF s.bidirect THEN + s.wbuf.cont[s.wbuf.wend] := byte; INC(s.wbuf.wend); DEC(s.write); ELSE - Error(s, NestedCall); + (* put byte into s.buf *) + posindex := s.pos MOD bufsize; + s.buf.cont[posindex] := byte; + IF s.buf.wend = posindex THEN + INC(s.buf.wend); + END; + DEC(s.write); + + (* update s.buf.rend and s.left, if necessary *) + IF s.buf.rend = posindex THEN + INC(s.buf.rend); + END; + IF s.left # 0 THEN + DEC(s.left); + ELSIF s.buf.rbegin = s.buf.rend THEN + (* set read-region to write-region *) + s.buf.rbegin := s.buf.wbegin; s.buf.rend := s.buf.wend; + s.left := s.buf.wend - posindex; + END; + + INC(s.pos); END; - RETURN ~s.error - END Tell; - PROCEDURE GetPos*(s: Stream; VAR offset: Count); - (* IF ~Tell(s, offset) THEN offset := internal position END; *) - BEGIN - IF ~Tell(s, offset) THEN - IF SYS.TAS(s.lock) THEN - Error(s, NestedCall); - ELSE - ValidPos(s); - offset := s.pos; - s.lock := FALSE; - END; + IF (s.bufmode = linebuf) & (byte = s.termch) THEN + IF ~InternalFlush(s) THEN + s.lock := FALSE; RETURN FALSE + END; + IF ~s.bidirect THEN + s.buf.wbegin := s.pos MOD bufsize; + END; END; - END GetPos; - PROCEDURE SetPos*(s: Stream; offset: Count); - (* IF ~Seek(s, offset, fromStart) THEN END; *) - BEGIN - IF ~Seek(s, offset, fromStart) THEN END; - END SetPos; + s.lock := FALSE; RETURN TRUE + ELSE + RETURN WritePart(s, byte, 0, 1) + END; + END WriteByte; - PROCEDURE ^ Touch*(s: Stream); - - PROCEDURE Trunc*(s: Stream; length: Count) : BOOLEAN; - (* truncate `s' to a total length of `length'; - following holds if holes are permitted: - (1) the current position remains unchanged - (2) the contents between `length' and - the current position is undefined - this call fails if holes are not permitted and the - current position is beyond `length' - *) - VAR - ok: BOOLEAN; - BEGIN - IF ~SYS.TAS(s.lock) THEN - IF (trunc IN s.caps) & (length >= 0) THEN - s.error := FALSE; ok := TRUE; - IF s.buf # NIL THEN - ValidPos(s); - IF ~(holes IN s.caps) & (s.pos > length) THEN - ok := FALSE; - ELSIF (s.bufmode = bufpool) OR s.buf.ok & - (s.buf.pos DIV bufsize >= length DIV bufsize) THEN - Touch(s); - END; - END; - IF ~ok OR ~s.if.trunc(s, length) THEN - s.lock := FALSE; Error(s, TruncFailed); - END; - ELSE - s.lock := FALSE; Error(s, CannotTrunc); - END; - s.lock := FALSE; + PROCEDURE InternalSeek(s: Stream; offset: Count; whence: Whence) : BOOLEAN; + VAR + oldpos: Count; pos: Count; + BEGIN + s.error := FALSE; + IF s.bidirect THEN + Error(s, CannotSeek); RETURN FALSE + ELSIF s.buf = NIL THEN + IF ~(seek IN s.caps) THEN + Error(s, CannotSeek); RETURN FALSE + ELSIF ~s.if.seek(s, offset, whence) THEN + Error(s, SeekFailed); RETURN FALSE + END; + ELSE + IF ~s.validpos & (seek IN s.caps) THEN + IF (write IN s.caps) & ~InternalFlush(s) THEN END; + IF ~s.if.seek(s, offset, whence) THEN + Error(s, SeekFailed); RETURN FALSE + END; + IF whence = fromStart THEN + s.validpos := TRUE; + s.pos := offset; s.rpos := offset; + END; ELSE - Error(s, NestedCall); + ValidPos(s); oldpos := s.pos; + IF s.pos > s.maxpos THEN + s.maxpos := s.pos; + END; + CASE whence OF + | fromStart: IF offset < 0 THEN + Error(s, SeekFailed); RETURN FALSE + END; + s.pos := offset; + | fromPos: IF s.pos + offset < 0 THEN + Error(s, SeekFailed); RETURN FALSE + END; + INC(s.pos, offset); + | fromEnd: IF (write IN s.caps) & ~InternalFlush(s) THEN END; + IF ~(seek IN s.caps) OR + ~s.if.seek(s, offset, whence) THEN + Error(s, SeekFailed); RETURN FALSE + END; + s.validpos := FALSE; ValidPos(s); + ELSE + Error(s, BadWhence); RETURN FALSE + END; + IF ~(holes IN s.caps) & (s.pos > s.maxpos) THEN + (* if holes are not permitted + we need to check the new position + *) + IF ~(seek IN s.caps) THEN + Error(s, CannotSeek); RETURN FALSE + ELSIF s.if.seek(s, s.pos, fromStart) THEN + s.rpos := s.pos; s.maxpos := s.pos; + ELSE + Error(s, SeekFailed); RETURN FALSE + END; + END; + IF s.buf.ok & (s.pos # oldpos) THEN + (* set s.left and s.write *) + IF (s.pos < s.buf.pos) OR (s.pos >= s.buf.pos + bufsize) THEN + s.left := 0; s.write := 0; + ELSE + pos := s.pos MOD bufsize; + IF s.buf.rbegin = s.buf.rend THEN + s.buf.rbegin := pos; s.buf.rend := pos; + END; + IF s.buf.wbegin = s.buf.wend THEN + s.buf.wbegin := pos; s.buf.wend := pos; + END; + IF s.pos > oldpos THEN + IF (pos >= s.buf.rbegin) & (pos < s.buf.rend) THEN + s.left := s.buf.rend - pos; + ELSE + s.left := 0; + END; + IF (pos >= s.buf.wbegin) & (pos <= s.buf.wend) THEN + s.write := bufsize - pos; + ELSE + s.write := 0; + END; + IF s.wextensible & + (s.write < s.left) & (s.buf.wbegin # s.buf.wend) THEN + (* s.write = 0 (else s.write >= s.left); + try to extend write-region to avoid + an unnecessary flush operation + *) + IF (s.buf.wbegin < pos) & + (s.buf.wend >= s.buf.rbegin) THEN + (* write-region is followed by read-region *) + s.buf.wend := pos; s.write := bufsize - pos; + ELSIF (pos < s.buf.wbegin) & + (s.buf.wbegin >= s.buf.rend) THEN + (* read-region is followed by write-region *) + s.buf.wbegin := pos; s.write := bufsize - pos; + END; + END; + ELSE (* s.pos < oldpos *) + IF (pos < s.buf.rbegin) OR (pos > s.buf.rend) THEN + s.left := 0; + ELSE + s.left := s.buf.rend - pos; + END; + IF (pos < s.buf.wbegin) OR (pos > s.buf.wend) THEN + s.write := 0; + ELSE + s.write := bufsize - pos; + END; + END; + END; + END; END; - RETURN ~s.error - END Trunc; + END; + IF s.left > 0 THEN + s.eof := FALSE; + END; + RETURN TRUE + END InternalSeek; - PROCEDURE Back*(s: Stream) : BOOLEAN; - (* undo last read operation (one byte); - because of the delayed buffer filling - Back is always successful for buffered streams - immediately after read-operations - *) - VAR - rval: BOOLEAN; - BEGIN - IF ~SYS.TAS(s.lock) THEN - s.error := FALSE; - IF read IN s.caps THEN - IF seek IN s.caps THEN - (* fails if s.pos = 0 *) - rval := InternalSeek(s, -1, 1) - ELSIF s.bidirect & s.buf.ok THEN - IF s.pos > 0 THEN - DEC(s.pos); INC(s.left); - rval := TRUE; - ELSE - rval := FALSE; - END; - ELSIF (s.buf # NIL) & s.buf.ok THEN - rval := InternalSeek(s, -1, 1) & (s.left > 0) - ELSE - rval := FALSE - END; - ELSE - s.lock := FALSE; Error(s, CannotRead); - rval := FALSE - END; - s.lock := FALSE; - RETURN rval - ELSE - Error(s, NestedCall); - RETURN FALSE - END; - END Back; - - PROCEDURE Insert*(s: Stream; byte: Byte) : BOOLEAN; - (* return `byte' on next read-operation *) - BEGIN - IF ~SYS.TAS(s.lock) THEN - s.error := FALSE; - IF read IN s.caps THEN - IF s.buf # NIL THEN - (* seek in buffer possible? *) - IF s.bidirect THEN - IF s.pos > 0 THEN - DEC(s.pos); s.buf.cont[s.pos] := byte; - RETURN TRUE - ELSE - RETURN FALSE - END; - ELSIF s.buf.ok & - (s.pos > s.buf.pos+s.buf.rbegin) & - (s.pos < s.buf.pos+s.buf.rend) & - InternalSeek(s, -1, 1) THEN - s.buf.cont[s.pos MOD bufsize] := byte; - s.lock := FALSE; - RETURN TRUE - ELSE - s.lock := FALSE; - RETURN FALSE - END; - ELSE - s.lock := FALSE; Error(s, Unbuffered); RETURN FALSE - END; - ELSE - s.lock := FALSE; Error(s, CannotRead); RETURN FALSE - END; - ELSE - Error(s, NestedCall); - RETURN FALSE - END; - END Insert; - - PROCEDURE InternalFlush(s: Stream) : BOOLEAN; - - PROCEDURE Write(s: Stream; buf: Buffer) : BOOLEAN; - - VAR - count: Count; - BEGIN - IF addrio IN s.caps THEN - count := s.if.addrwrite(s, SYSTEM.ADR(buf.cont[buf.wbegin]), - buf.wend-buf.wbegin); - ELSIF bufio IN s.caps THEN - count := s.if.bufwrite(s, buf.cont, - buf.wbegin, buf.wend-buf.wbegin); - ELSIF s.if.write(s, buf.cont[buf.wbegin]) THEN - count := 1; - ELSE - count := 0; - END; - IF count < 0 THEN - count := 0; - END; - INC(buf.wbegin, count); INC(s.rpos, count); - RETURN count > 0 - END Write; - - PROCEDURE FlushEvent; - VAR - event: Event; - BEGIN - IF s.flushEvent # NIL THEN - NEW(event); - event.type := s.flushEvent; - event.message := "flush event of Streams"; - event.stream := s; - Events.Raise(event); - END; - END FlushEvent; - - BEGIN - s.error := FALSE; - IF (write IN s.caps) & (s.buf # NIL) & s.buf.ok THEN - IF s.bidirect & (s.wbuf.wend > s.wbuf.wbegin) THEN - FlushEvent; - WHILE (s.wbuf.wend > s.wbuf.wbegin) & Write(s, s.wbuf) DO END; - IF s.wbuf.wend > s.wbuf.wbegin THEN - s.wbuf.wbegin := 0; s.wbuf.wend := 0; s.write := bufsize; - Error(s, WriteFailed); RETURN FALSE - END; - s.wbuf.wbegin := 0; s.wbuf.wend := 0; s.write := bufsize; - ELSIF ~s.bidirect & (s.buf.wend > s.buf.wbegin) THEN - FlushEvent; - ValidPos(s); - IF s.buf.pos + s.buf.wbegin # s.rpos THEN - IF ~(seek IN s.caps) THEN - Error(s, CannotSeek); - (* write in this case at the current position - else there is no easy way to write anyhow - *) - ELSIF ~s.if.seek(s, s.buf.pos + s.buf.wbegin, fromStart) THEN - s.buf.wend := s.buf.wbegin; s.write := 0; - Error(s, SeekFailed); RETURN FALSE - END; - s.rpos := s.buf.pos + s.buf.wbegin; - END; - WHILE (s.buf.wend > s.buf.wbegin) & Write(s, s.buf) DO END; - IF s.buf.wend > s.buf.wbegin THEN - s.buf.wend := s.buf.wbegin; s.write := bufsize - s.buf.wbegin; - Error(s, WriteFailed); RETURN FALSE - END; - IF {seek, tell, trunc} * s.caps = {} THEN - (* unidirectional pipeline; reset s.pos to avoid - unintentional flushes due to buffer boundaries - *) - s.pos := 0; s.rpos := 0; s.buf.pos := 0; - s.buf.wbegin := 0; s.buf.wend := 0; s.write := bufsize; - ELSE - IF (s.pos >= s.buf.pos) & (s.pos < s.buf.pos + bufsize) THEN - s.buf.wbegin := s.pos MOD bufsize; - s.buf.wend := s.buf.wbegin; - s.write := bufsize - s.buf.wbegin; - ELSE - s.write := 0; - END; - END; - END; - END; - RETURN TRUE - END InternalFlush; - - PROCEDURE Flush*(s: Stream) : BOOLEAN; - VAR - ok: BOOLEAN; - BEGIN - IF ~SYS.TAS(s.lock) THEN - IF s.bufmode = bufpool THEN - ok := FlushBufPool(s); - ELSE - ok := InternalFlush(s); - END; - IF ok & (flush IN s.caps) THEN - ok := s.if.flush(s); - IF ~ok THEN - Error(s, FlushFailed); - END; - END; - s.lock := FALSE; - RETURN ok - ELSE - Error(s, NestedCall); - RETURN FALSE - END; - END Flush; - - PROCEDURE InputInBuffer*(s: Stream) : BOOLEAN; - (* returns TRUE if the next byte to be read is buffered *) - VAR - buf: Buffer; - pos: Count; - BEGIN - IF s.bufmode = bufpool THEN - IF ~s.buf.ok THEN RETURN FALSE END; - pos := s.pos - s.pos MOD bufsize; - IF s.buf.pos # pos THEN - IF ~FindBuffer(s, pos, buf) THEN - RETURN FALSE - END; - pos := s.pos - buf.pos; - RETURN (pos >= buf.rbegin) & (pos < buf.rend) - END; - ELSIF s.bidirect THEN - RETURN s.left > 0 - END; - pos := s.pos MOD bufsize; - RETURN (read IN s.caps) & (s.buf # NIL) & s.buf.ok & - ((s.left > 0) OR - (write IN s.caps) & (s.buf.wbegin <= pos) & (s.buf.wend > pos)) - END InputInBuffer; - - PROCEDURE OutputInBuffer*(s: Stream) : BOOLEAN; - (* returns TRUE if Flush would lead to a write-operation *) - VAR - buf: Buffer; - BEGIN - IF s.bufmode = bufpool THEN - buf := s.bufpool.head; - WHILE buf # NIL DO - IF buf.wbegin # buf.wend THEN RETURN TRUE END; - buf := buf.nexta; - END; - RETURN FALSE - ELSIF s.bidirect THEN - RETURN s.wbuf.wend > s.wbuf.wbegin - ELSE - RETURN (write IN s.caps) & (s.buf # NIL) & s.buf.ok & - (s.buf.wend > s.buf.wbegin) - END; - END OutputInBuffer; - - PROCEDURE OutputWillBeBuffered*(s: Stream) : BOOLEAN; - (* returns TRUE if the next written byte will be buffered *) - VAR - buf: Buffer; - pos: Count; - BEGIN - IF s.bufmode = bufpool THEN - IF s.bufpool.nbuf < s.bufpool.maxbuf THEN RETURN TRUE END; - pos := s.pos - s.pos MOD bufsize; - IF s.buf.pos # pos THEN - IF ~FindBuffer(s, pos, buf) THEN RETURN FALSE END; - IF s.buf.wbegin = s.buf.wend THEN RETURN TRUE END; - pos := s.pos - buf.pos; - RETURN (pos >= buf.wbegin) & (pos <= buf.wend) OR - (buf.wbegin > 0) & (pos + 1 = buf.wbegin) - END; - ELSIF s.bidirect THEN - RETURN s.write > 0 - END; - RETURN (write IN s.caps) & (s.buf # NIL) & - ((s.write > 0) OR ~s.buf.ok) - END OutputWillBeBuffered; - - PROCEDURE Touch*(s: Stream); - (* forget any buffer contents *) - BEGIN - IF ~SYS.TAS(s.lock) THEN - s.error := FALSE; - IF write IN s.caps THEN - IF s.bufmode = bufpool THEN - IF ~FlushBufPool(s) THEN END; - ReleaseBufPool(s); - ELSE - IF ~InternalFlush(s) THEN END; - END; - END; - IF flush IN s.caps THEN - IF ~s.if.flush(s) THEN - Error(s, FlushFailed); - END; - END; - IF s.bidirect THEN - s.buf.rbegin := 0; s.buf.rend := 0; s.left := 0; - ELSE - s.validpos := FALSE; - IF s.buf # NIL THEN - s.buf.ok := FALSE; - s.left := 0; - s.write := 0; - s.eofFound := FALSE; - END; - END; - s.lock := FALSE; - ELSE - Error(s, NestedCall); - END; - END Touch; - - PROCEDURE Copy*(source, dest: Stream; maxcnt: Count) : BOOLEAN; - (* more efficient variants are possible *) - VAR - left, count, copied, read, written: Count; - buffer: ARRAY bufsize OF Byte; - ok: BOOLEAN; - BEGIN - IF maxcnt >= 0 THEN - read := 0; written := 0; ok := TRUE; - left := maxcnt; - LOOP - IF left = 0 THEN - EXIT - END; - ASSERT(left > 0); - IF left > bufsize THEN - count := bufsize; - ELSE - count := left; - END; - - ok := ReadPacket(source, buffer, 0, count) > 0; - ASSERT(source.count <= count); - INC(read, source.count); - IF ~ok THEN EXIT END; - - ok := WritePart(dest, buffer, 0, source.count); - ASSERT(dest.count <= source.count); - INC(written, dest.count); - IF ~ok THEN EXIT END; - - DEC(left, dest.count); - END; - source.count := read; dest.count := written; - RETURN ok - ELSE - copied := 0; - WHILE (ReadPacket(source, buffer, 0, bufsize) > 0) & - WritePart(dest, buffer, 0, source.count) DO - INC(copied, source.count); - END; - source.count := copied; dest.count := copied; - RETURN ~source.error & ~dest.error - END; - END Copy; - - (* === nulldev procedures ========================================== *) - - PROCEDURE NulldevRead(s: Stream; VAR byte: Byte) : BOOLEAN; - BEGIN - byte := 0X; + PROCEDURE Seek*(s: Stream; offset: Count; whence: Whence) : BOOLEAN; + VAR + rval: BOOLEAN; + BEGIN + IF ~SYS.TAS(s.lock) THEN + rval := InternalSeek(s, offset, whence); + s.lock := FALSE; + RETURN rval + ELSE + Error(s, NestedCall); RETURN FALSE - END NulldevRead; + END; + END Seek; - PROCEDURE NulldevWrite(s: Stream; byte: Byte) : BOOLEAN; - BEGIN - RETURN TRUE - END NulldevWrite; - - PROCEDURE InitNullIf(VAR nullif: Interface); - BEGIN - NEW(nullif); - nullif.read := NulldevRead; - nullif.write := NulldevWrite; - END InitNullIf; - - PROCEDURE OpenNulldev(VAR s: Stream); - BEGIN - NEW(s); - Services.Init(s, type); - Init(s, nullif, {read, write}, nobuf); - END OpenNulldev; - - PROCEDURE ExitHandler(event: Events.Event); - (* flush all streams on exit; - we do not close them to allow output by other exit event handlers - *) - VAR s: Stream; - BEGIN - s := opened; - WHILE s # NIL DO - IF (s.bufmode # nobuf) & (write IN s.caps) THEN - IF ~Flush(s) THEN END; - END; - s := s.next; + PROCEDURE Tell*(s: Stream; VAR offset: Count) : BOOLEAN; + BEGIN + IF ~SYS.TAS(s.lock) THEN + s.error := FALSE; + IF tell IN s.caps THEN + IF s.buf # NIL THEN + IF s.validpos THEN + offset := s.pos; + ELSIF s.if.tell(s, s.rpos) THEN + s.validpos := TRUE; + s.pos := s.rpos; + offset := s.pos; + ELSE + s.lock := FALSE; + Error(s, TellFailed); + END; + ELSIF ~s.if.tell(s, offset) THEN + s.lock := FALSE; + Error(s, TellFailed); + END; + ELSE + s.lock := FALSE; + Error(s, CannotTell); END; - END ExitHandler; + s.lock := FALSE; + ELSE + Error(s, NestedCall); + END; + RETURN ~s.error + END Tell; - PROCEDURE FreeHandler(event: Events.Event); - (* set all free lists to NIL to return the associated storage - to the garbage collector - *) - BEGIN - freelist := NIL; - END FreeHandler; + PROCEDURE GetPos*(s: Stream; VAR offset: Count); + (* IF ~Tell(s, offset) THEN offset := internal position END; *) + BEGIN + IF ~Tell(s, offset) THEN + IF SYS.TAS(s.lock) THEN + Error(s, NestedCall); + ELSE + ValidPos(s); + offset := s.pos; + s.lock := FALSE; + END; + END; + END GetPos; + + PROCEDURE SetPos*(s: Stream; offset: Count); + (* IF ~Seek(s, offset, fromStart) THEN END; *) + BEGIN + IF ~Seek(s, offset, fromStart) THEN END; + END SetPos; + + PROCEDURE ^ Touch*(s: Stream); + + PROCEDURE Trunc*(s: Stream; length: Count) : BOOLEAN; + (* truncate `s' to a total length of `length'; + following holds if holes are permitted: + (1) the current position remains unchanged + (2) the contents between `length' and + the current position is undefined + this call fails if holes are not permitted and the + current position is beyond `length' + *) + VAR + ok: BOOLEAN; + BEGIN + IF ~SYS.TAS(s.lock) THEN + IF (trunc IN s.caps) & (length >= 0) THEN + s.error := FALSE; ok := TRUE; + IF s.buf # NIL THEN + ValidPos(s); + IF ~(holes IN s.caps) & (s.pos > length) THEN + ok := FALSE; + ELSIF (s.bufmode = bufpool) OR s.buf.ok & + (s.buf.pos DIV bufsize >= length DIV bufsize) THEN + Touch(s); + END; + END; + IF ~ok OR ~s.if.trunc(s, length) THEN + s.lock := FALSE; Error(s, TruncFailed); + END; + ELSE + s.lock := FALSE; Error(s, CannotTrunc); + END; + s.lock := FALSE; + ELSE + Error(s, NestedCall); + END; + RETURN ~s.error + END Trunc; + + PROCEDURE Back*(s: Stream) : BOOLEAN; + (* undo last read operation (one byte); + because of the delayed buffer filling + Back is always successful for buffered streams + immediately after read-operations + *) + VAR + rval: BOOLEAN; + BEGIN + IF ~SYS.TAS(s.lock) THEN + s.error := FALSE; + IF read IN s.caps THEN + IF seek IN s.caps THEN + (* fails if s.pos = 0 *) + rval := InternalSeek(s, -1, 1) + ELSIF s.bidirect & s.buf.ok THEN + IF s.pos > 0 THEN + DEC(s.pos); INC(s.left); + rval := TRUE; + ELSE + rval := FALSE; + END; + ELSIF (s.buf # NIL) & s.buf.ok THEN + rval := InternalSeek(s, -1, 1) & (s.left > 0) + ELSE + rval := FALSE + END; + ELSE + s.lock := FALSE; Error(s, CannotRead); + rval := FALSE + END; + s.lock := FALSE; + RETURN rval + ELSE + Error(s, NestedCall); + RETURN FALSE + END; + END Back; + + PROCEDURE Insert*(s: Stream; byte: Byte) : BOOLEAN; + (* return `byte' on next read-operation *) + BEGIN + IF ~SYS.TAS(s.lock) THEN + s.error := FALSE; + IF read IN s.caps THEN + IF s.buf # NIL THEN + (* seek in buffer possible? *) + IF s.bidirect THEN + IF s.pos > 0 THEN + DEC(s.pos); s.buf.cont[s.pos] := byte; + RETURN TRUE + ELSE + RETURN FALSE + END; + ELSIF s.buf.ok & + (s.pos > s.buf.pos+s.buf.rbegin) & + (s.pos < s.buf.pos+s.buf.rend) & + InternalSeek(s, -1, 1) THEN + s.buf.cont[s.pos MOD bufsize] := byte; + s.lock := FALSE; + RETURN TRUE + ELSE + s.lock := FALSE; + RETURN FALSE + END; + ELSE + s.lock := FALSE; Error(s, Unbuffered); RETURN FALSE + END; + ELSE + s.lock := FALSE; Error(s, CannotRead); RETURN FALSE + END; + ELSE + Error(s, NestedCall); + RETURN FALSE + END; + END Insert; + + PROCEDURE InternalFlush(s: Stream) : BOOLEAN; + + PROCEDURE Write(s: Stream; buf: Buffer) : BOOLEAN; + + VAR + count: Count; + BEGIN + IF addrio IN s.caps THEN + count := s.if.addrwrite(s, SYSTEM.ADR(buf.cont[buf.wbegin]), + buf.wend-buf.wbegin); + ELSIF bufio IN s.caps THEN + count := s.if.bufwrite(s, buf.cont, + buf.wbegin, buf.wend-buf.wbegin); + ELSIF s.if.write(s, buf.cont[buf.wbegin]) THEN + count := 1; + ELSE + count := 0; + END; + IF count < 0 THEN + count := 0; + END; + INC(buf.wbegin, count); INC(s.rpos, count); + RETURN count > 0 + END Write; + + PROCEDURE FlushEvent; + VAR + event: Event; + BEGIN + IF s.flushEvent # NIL THEN + NEW(event); + event.type := s.flushEvent; + event.message := "flush event of Streams"; + event.stream := s; + Events.Raise(event); + END; + END FlushEvent; + + BEGIN + s.error := FALSE; + IF (write IN s.caps) & (s.buf # NIL) & s.buf.ok THEN + IF s.bidirect & (s.wbuf.wend > s.wbuf.wbegin) THEN + FlushEvent; + WHILE (s.wbuf.wend > s.wbuf.wbegin) & Write(s, s.wbuf) DO END; + IF s.wbuf.wend > s.wbuf.wbegin THEN + s.wbuf.wbegin := 0; s.wbuf.wend := 0; s.write := bufsize; + Error(s, WriteFailed); RETURN FALSE + END; + s.wbuf.wbegin := 0; s.wbuf.wend := 0; s.write := bufsize; + ELSIF ~s.bidirect & (s.buf.wend > s.buf.wbegin) THEN + FlushEvent; + ValidPos(s); + IF s.buf.pos + s.buf.wbegin # s.rpos THEN + IF ~(seek IN s.caps) THEN + Error(s, CannotSeek); + (* write in this case at the current position + else there is no easy way to write anyhow + *) + ELSIF ~s.if.seek(s, s.buf.pos + s.buf.wbegin, fromStart) THEN + s.buf.wend := s.buf.wbegin; s.write := 0; + Error(s, SeekFailed); RETURN FALSE + END; + s.rpos := s.buf.pos + s.buf.wbegin; + END; + WHILE (s.buf.wend > s.buf.wbegin) & Write(s, s.buf) DO END; + IF s.buf.wend > s.buf.wbegin THEN + s.buf.wend := s.buf.wbegin; s.write := bufsize - s.buf.wbegin; + Error(s, WriteFailed); RETURN FALSE + END; + IF {seek, tell, trunc} * s.caps = {} THEN + (* unidirectional pipeline; reset s.pos to avoid + unintentional flushes due to buffer boundaries + *) + s.pos := 0; s.rpos := 0; s.buf.pos := 0; + s.buf.wbegin := 0; s.buf.wend := 0; s.write := bufsize; + ELSE + IF (s.pos >= s.buf.pos) & (s.pos < s.buf.pos + bufsize) THEN + s.buf.wbegin := s.pos MOD bufsize; + s.buf.wend := s.buf.wbegin; + s.write := bufsize - s.buf.wbegin; + ELSE + s.write := 0; + END; + END; + END; + END; + RETURN TRUE + END InternalFlush; + + PROCEDURE Flush*(s: Stream) : BOOLEAN; + VAR + ok: BOOLEAN; + BEGIN + IF ~SYS.TAS(s.lock) THEN + IF s.bufmode = bufpool THEN + ok := FlushBufPool(s); + ELSE + ok := InternalFlush(s); + END; + IF ok & (flush IN s.caps) THEN + ok := s.if.flush(s); + IF ~ok THEN + Error(s, FlushFailed); + END; + END; + s.lock := FALSE; + RETURN ok + ELSE + Error(s, NestedCall); + RETURN FALSE + END; + END Flush; + + PROCEDURE InputInBuffer*(s: Stream) : BOOLEAN; + (* returns TRUE if the next byte to be read is buffered *) + VAR + buf: Buffer; + pos: Count; + BEGIN + IF s.bufmode = bufpool THEN + IF ~s.buf.ok THEN RETURN FALSE END; + pos := s.pos - s.pos MOD bufsize; + IF s.buf.pos # pos THEN + IF ~FindBuffer(s, pos, buf) THEN + RETURN FALSE + END; + pos := s.pos - buf.pos; + RETURN (pos >= buf.rbegin) & (pos < buf.rend) + END; + ELSIF s.bidirect THEN + RETURN s.left > 0 + END; + pos := s.pos MOD bufsize; + RETURN (read IN s.caps) & (s.buf # NIL) & s.buf.ok & + ((s.left > 0) OR + (write IN s.caps) & (s.buf.wbegin <= pos) & (s.buf.wend > pos)) + END InputInBuffer; + + PROCEDURE OutputInBuffer*(s: Stream) : BOOLEAN; + (* returns TRUE if Flush would lead to a write-operation *) + VAR + buf: Buffer; + BEGIN + IF s.bufmode = bufpool THEN + buf := s.bufpool.head; + WHILE buf # NIL DO + IF buf.wbegin # buf.wend THEN RETURN TRUE END; + buf := buf.nexta; + END; + RETURN FALSE + ELSIF s.bidirect THEN + RETURN s.wbuf.wend > s.wbuf.wbegin + ELSE + RETURN (write IN s.caps) & (s.buf # NIL) & s.buf.ok & + (s.buf.wend > s.buf.wbegin) + END; + END OutputInBuffer; + + PROCEDURE OutputWillBeBuffered*(s: Stream) : BOOLEAN; + (* returns TRUE if the next written byte will be buffered *) + VAR + buf: Buffer; + pos: Count; + BEGIN + IF s.bufmode = bufpool THEN + IF s.bufpool.nbuf < s.bufpool.maxbuf THEN RETURN TRUE END; + pos := s.pos - s.pos MOD bufsize; + IF s.buf.pos # pos THEN + IF ~FindBuffer(s, pos, buf) THEN RETURN FALSE END; + IF s.buf.wbegin = s.buf.wend THEN RETURN TRUE END; + pos := s.pos - buf.pos; + RETURN (pos >= buf.wbegin) & (pos <= buf.wend) OR + (buf.wbegin > 0) & (pos + 1 = buf.wbegin) + END; + ELSIF s.bidirect THEN + RETURN s.write > 0 + END; + RETURN (write IN s.caps) & (s.buf # NIL) & + ((s.write > 0) OR ~s.buf.ok) + END OutputWillBeBuffered; + + PROCEDURE Touch*(s: Stream); + (* forget any buffer contents *) + BEGIN + IF ~SYS.TAS(s.lock) THEN + s.error := FALSE; + IF write IN s.caps THEN + IF s.bufmode = bufpool THEN + IF ~FlushBufPool(s) THEN END; + ReleaseBufPool(s); + ELSE + IF ~InternalFlush(s) THEN END; + END; + END; + IF flush IN s.caps THEN + IF ~s.if.flush(s) THEN + Error(s, FlushFailed); + END; + END; + IF s.bidirect THEN + s.buf.rbegin := 0; s.buf.rend := 0; s.left := 0; + ELSE + s.validpos := FALSE; + IF s.buf # NIL THEN + s.buf.ok := FALSE; + s.left := 0; + s.write := 0; + s.eofFound := FALSE; + END; + END; + s.lock := FALSE; + ELSE + Error(s, NestedCall); + END; + END Touch; + + PROCEDURE Copy*(source, dest: Stream; maxcnt: Count) : BOOLEAN; + (* more efficient variants are possible *) + VAR + left, count, copied, read, written: Count; + buffer: ARRAY bufsize OF Byte; + ok: BOOLEAN; + BEGIN + IF maxcnt >= 0 THEN + read := 0; written := 0; ok := TRUE; + left := maxcnt; + LOOP + IF left = 0 THEN + EXIT + END; + ASSERT(left > 0); + IF left > bufsize THEN + count := bufsize; + ELSE + count := left; + END; + + ok := ReadPacket(source, buffer, 0, count) > 0; + ASSERT(source.count <= count); + INC(read, source.count); + IF ~ok THEN EXIT END; + + ok := WritePart(dest, buffer, 0, source.count); + ASSERT(dest.count <= source.count); + INC(written, dest.count); + IF ~ok THEN EXIT END; + + DEC(left, dest.count); + END; + source.count := read; dest.count := written; + RETURN ok + ELSE + copied := 0; + WHILE (ReadPacket(source, buffer, 0, bufsize) > 0) & + WritePart(dest, buffer, 0, source.count) DO + INC(copied, source.count); + END; + source.count := copied; dest.count := copied; + RETURN ~source.error & ~dest.error + END; + END Copy; + + (* === nulldev procedures ========================================== *) + + PROCEDURE NulldevRead(s: Stream; VAR byte: Byte) : BOOLEAN; + BEGIN + byte := 0X; + RETURN FALSE + END NulldevRead; + + PROCEDURE NulldevWrite(s: Stream; byte: Byte) : BOOLEAN; + BEGIN + RETURN TRUE + END NulldevWrite; + + PROCEDURE InitNullIf(VAR nullif: Interface); + BEGIN + NEW(nullif); + nullif.read := NulldevRead; + nullif.write := NulldevWrite; + END InitNullIf; + + PROCEDURE OpenNulldev(VAR s: Stream); + BEGIN + NEW(s); + Services.Init(s, type); + Init(s, nullif, {read, write}, nobuf); + END OpenNulldev; + + PROCEDURE ExitHandler(event: Events.Event); + (* flush all streams on exit; + we do not close them to allow output by other exit event handlers + *) + VAR s: Stream; + BEGIN + s := opened; + WHILE s # NIL DO + IF (s.bufmode # nobuf) & (write IN s.caps) THEN + IF ~Flush(s) THEN END; + END; + s := s.next; + END; + END ExitHandler; + + PROCEDURE FreeHandler(event: Events.Event); + (* set all free lists to NIL to return the associated storage + to the garbage collector + *) + BEGIN + freelist := NIL; + END FreeHandler; BEGIN - Services.CreateType(type, "Streams.Stream", ""); + Services.CreateType(type, "Streams.Stream", ""); - errormsg[NoHandlerDefined] := "no handler defined"; - errormsg[CannotRead] := "not opened for reading"; - errormsg[CannotSeek] := "not capable of seeking"; - errormsg[CloseFailed] := "close operation failed"; - errormsg[NotLineBuffered] := "stream is not line buffered"; - errormsg[SeekFailed] := "seek operation failed"; - errormsg[TellFailed] := "tell operation failed"; - errormsg[BadWhence] := "bad value of whence parameter"; - errormsg[CannotTell] := "not capable of telling current position"; - errormsg[WriteFailed] := "write operation failed"; - errormsg[CannotWrite] := "not opened for writing"; - errormsg[ReadFailed] := "read operation failed"; - errormsg[Unbuffered] := "operation is not valid for unbuffered streams"; - errormsg[BadParameters] := "bad parameter values"; - errormsg[CannotTrunc] := "not capable of truncating"; - errormsg[TruncFailed] := "trunc operation failed"; - errormsg[NestedCall] := "nested stream operation"; - errormsg[FlushFailed] := "flush operation failed"; + errormsg[NoHandlerDefined] := "no handler defined"; + errormsg[CannotRead] := "not opened for reading"; + errormsg[CannotSeek] := "not capable of seeking"; + errormsg[CloseFailed] := "close operation failed"; + errormsg[NotLineBuffered] := "stream is not line buffered"; + errormsg[SeekFailed] := "seek operation failed"; + errormsg[TellFailed] := "tell operation failed"; + errormsg[BadWhence] := "bad value of whence parameter"; + errormsg[CannotTell] := "not capable of telling current position"; + errormsg[WriteFailed] := "write operation failed"; + errormsg[CannotWrite] := "not opened for writing"; + errormsg[ReadFailed] := "read operation failed"; + errormsg[Unbuffered] := "operation is not valid for unbuffered streams"; + errormsg[BadParameters] := "bad parameter values"; + errormsg[CannotTrunc] := "not capable of truncating"; + errormsg[TruncFailed] := "trunc operation failed"; + errormsg[NestedCall] := "nested stream operation"; + errormsg[FlushFailed] := "flush operation failed"; - Events.Define(error); Events.SetPriority(error, Priorities.liberrors); - Events.Ignore(error); + Events.Define(error); Events.SetPriority(error, Priorities.liberrors); + Events.Ignore(error); - opened := NIL; - InitNullIf(nullif); - OpenNulldev(null); stdin := null; stdout := null; stderr := null; + opened := NIL; + InitNullIf(nullif); + OpenNulldev(null); stdin := null; stdout := null; stderr := null; - Events.Handler(Process.termination, ExitHandler); - Events.Handler(Process.startOfGarbageCollection, FreeHandler); + Events.Handler(Process.termination, ExitHandler); + Events.Handler(Process.startOfGarbageCollection, FreeHandler); END ulmStreams. diff --git a/src/library/ulm/ulmSysIO.Mod b/src/library/ulm/ulmSysIO.Mod index a961f64d..2a22d29f 100644 --- a/src/library/ulm/ulmSysIO.Mod +++ b/src/library/ulm/ulmSysIO.Mod @@ -30,7 +30,10 @@ MODULE ulmSysIO; - IMPORT RelatedEvents := ulmRelatedEvents, Sys := ulmSys, SYS := SYSTEM, ulmSYSTEM, SysErrors := ulmSysErrors, SysTypes := ulmSysTypes; + IMPORT RelatedEvents := ulmRelatedEvents, + Sys := ulmSys, SYS := SYSTEM, ulmSYSTEM, + SysErrors := ulmSysErrors, SysTypes := ulmSysTypes, + Platform; CONST (* file control options: arguments of Fcntl and Open *) @@ -86,20 +89,20 @@ MODULE ulmSysIO; retry: BOOLEAN; VAR interrupted: BOOLEAN) : BOOLEAN; (* the filename must be 0X-terminated *) VAR - d0, d1: (*INTEGER*)LONGINT; + error: Platform.ErrorCode; BEGIN interrupted := FALSE; LOOP - IF ulmSYSTEM.UNIXCALL(Sys.open, d0, d1, - SYS.ADR(filename), SYS.VAL(LONGINT, options), protection) THEN - fd := d0; - RETURN TRUE + IF options * creat # {} THEN error := Platform.New(filename, fd) + ELSIF options * (rdwr+wronly) # {} THEN error := Platform.OldRW(filename, fd) + ELSE error := Platform.OldRO(filename, fd) END; + IF error = 0 THEN RETURN TRUE ELSE - IF d0 = SysErrors.intr THEN + IF Platform.Interrupted(error) THEN interrupted := TRUE; END; - IF (d0 # SysErrors.intr) OR ~retry THEN - SysErrors.Raise(errors, d0, Sys.open, filename); + IF ~Platform.Interrupted(error) OR ~retry THEN + SysErrors.Raise(errors, error, Sys.open, filename); RETURN FALSE END; END; @@ -119,21 +122,18 @@ MODULE ulmSysIO; errors: RelatedEvents.Object; retry: BOOLEAN; VAR interrupted: BOOLEAN) : BOOLEAN; VAR - d0, d1: LONGINT; - a0, a1 : LONGINT; (* just to match UNIXCALL interface *) + error: Platform.ErrorCode; BEGIN interrupted := FALSE; - a0 := 0; a1 := 0; (* Initialised to disable compiler warning. *) LOOP - IF ulmSYSTEM.UNIXCALL(Sys.close, d0, d1, fd, a0, a1) THEN - (*IF ulmSYSTEM.UNIXCALL(Sys.close, d0, d1, fd) THEN*) - RETURN TRUE + error := Platform.Close(fd); + IF error = 0 THEN RETURN TRUE ELSE - IF d0 = SysErrors.intr THEN + IF Platform.Interrupted(error) THEN interrupted := TRUE; END; - IF (d0 # SysErrors.intr) OR ~retry THEN - SysErrors.Raise(errors, d0, Sys.close, ""); + IF ~Platform.Interrupted(error) OR ~retry THEN + SysErrors.Raise(errors, error, Sys.close, ""); RETURN FALSE END; END; @@ -148,18 +148,19 @@ MODULE ulmSysIO; >0: number of bytes read *) VAR - d0, d1: LONGINT; + error: Platform.ErrorCode; + bytesread: Count; BEGIN interrupted := FALSE; LOOP - IF ulmSYSTEM.UNIXCALL(Sys.read, d0, d1, fd, buf, cnt) THEN - RETURN d0 + error := Platform.Read(fd, buf, cnt, bytesread); + IF error = 0 THEN RETURN bytesread ELSE - IF d0 = SysErrors.intr THEN + IF Platform.Interrupted(error) THEN interrupted := TRUE; END; - IF (d0 # SysErrors.intr) OR ~retry THEN - SysErrors.Raise(errors, d0, Sys.read, ""); + IF ~Platform.Interrupted(error) OR ~retry THEN + SysErrors.Raise(errors, error, Sys.read, ""); RETURN -1 END; END; @@ -173,18 +174,19 @@ MODULE ulmSysIO; >=0: number of bytes written *) VAR - d0, d1: LONGINT; + error: Platform.ErrorCode; + byteswritten: Count; BEGIN interrupted := FALSE; LOOP - IF ulmSYSTEM.UNIXCALL(Sys.write, d0, d1, fd, buf, cnt) THEN - RETURN d0 + error := Platform.Write(fd, buf, cnt); + IF error = 0 THEN RETURN cnt (* todo: Upfate Platform.Write to return actual length written. *) ELSE - IF d0 = SysErrors.intr THEN + IF Platform.Interrupted(error) THEN interrupted := TRUE; END; - IF (d0 # SysErrors.intr) OR ~retry THEN - SysErrors.Raise(errors, d0, Sys.write, ""); + IF ~Platform.Interrupted(error) OR ~retry THEN + SysErrors.Raise(errors, error, Sys.write, ""); RETURN -1 END; END; @@ -194,16 +196,23 @@ MODULE ulmSysIO; PROCEDURE Seek*(fd: File; offset: Count; whence: Whence; errors: RelatedEvents.Object) : BOOLEAN; VAR - d0, d1: LONGINT; + error: Platform.ErrorCode; relativity: INTEGER; BEGIN - IF ulmSYSTEM.UNIXCALL(Sys.lseek, d0, d1, fd, offset, whence) THEN - RETURN TRUE + CASE whence OF + |fromPos: relativity := Platform.SeekCur + |fromEnd: relativity := Platform.SeekEnd + ELSE relativity := Platform.SeekSet + END; + error := Platform.Seek(fd, offset, relativity); + IF error = 0 THEN RETURN TRUE ELSE - SysErrors.Raise(errors, d0, Sys.lseek, ""); + SysErrors.Raise(errors, error, Sys.lseek, ""); RETURN FALSE END; END Seek; +(* + PROCEDURE Tell*(fd: File; VAR offset: Count; errors: RelatedEvents.Object) : BOOLEAN; VAR @@ -229,7 +238,6 @@ MODULE ulmSysIO; (* following system call fails for non-tty's *) RETURN ulmSYSTEM.UNIXCALL(Sys.ioctl, d0, d1, fd, tcgeta, SYS.ADR(buf)) END Isatty; - PROCEDURE Fcntl*(fd: File; request: INTEGER; VAR arg: LONGINT; errors: RelatedEvents.Object; retry: BOOLEAN; VAR interrupted: BOOLEAN) : BOOLEAN; @@ -343,5 +351,6 @@ MODULE ulmSysIO; RETURN FALSE END; END Pipe; +*) END ulmSysIO. diff --git a/src/library/ulm/ulmSysTypes.Mod b/src/library/ulm/ulmSysTypes.Mod index 174140e7..6d16ab4b 100644 --- a/src/library/ulm/ulmSysTypes.Mod +++ b/src/library/ulm/ulmSysTypes.Mod @@ -30,7 +30,7 @@ MODULE ulmSysTypes; - IMPORT Types := ulmTypes; + IMPORT Types := ulmTypes, Platform; TYPE Address* = Types.Address; @@ -39,17 +39,17 @@ MODULE ulmSysTypes; Size* = Types.Size; Byte* = Types.Byte; - File* = (*INTEGER*)LONGINT; (* in ulm's system both INTEGER and LONGINT are 4 bytes long *) + File* = Platform.FileHandle; Offset* = LONGINT; Device* = LONGINT; - Inode* = LONGINT; - Time* = LONGINT; + Inode* = LONGINT; + Time* = LONGINT; - Word* = INTEGER; (* must have the size of C's int-type *) + Word* = INTEGER; (* must have the size of C's int-type *) (* Note: linux supports wait4 but not waitid, i.e. these * constants aren't needed. *) - (* + (* CONST (* possible values of the idtype parameter (4 bytes), see diff --git a/src/library/ulm/ulmTCrypt.Mod b/src/library/ulm/ulmTCrypt.Mod index 4003eaf0..c35c7809 100644 --- a/src/library/ulm/ulmTCrypt.Mod +++ b/src/library/ulm/ulmTCrypt.Mod @@ -1,1764 +1,1770 @@ (* Ulm's Oberon Library - Copyright (C) 1989-1997 by University of Ulm, SAI, D-89069 Ulm, Germany - ---------------------------------------------------------------------------- - Ulm's Oberon Library is free software; you can redistribute it - and/or modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either version - 2 of the License, or (at your option) any later version. + Copyright (C) 1989-1997 by University of Ulm, SAI, D-89069 Ulm, Germany + ---------------------------------------------------------------------------- + Ulm's Oberon Library is free software; you can redistribute it + and/or modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either version + 2 of the License, or (at your option) any later version. - Ulm's Oberon Library is distributed in the hope that it will be - useful, but WITHOUT ANY WARRANTY; without even the implied warranty - of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. + Ulm's Oberon Library is distributed in the hope that it will be + useful, but WITHOUT ANY WARRANTY; without even the implied warranty + of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - ---------------------------------------------------------------------------- - E-mail contact: oberon@mathematik.uni-ulm.de - ---------------------------------------------------------------------------- - $Id: TCrypt.om,v 1.1 1997/04/02 11:54:02 borchert Exp borchert $ - ---------------------------------------------------------------------------- - $Log: TCrypt.om,v $ - Revision 1.1 1997/04/02 11:54:02 borchert - Initial revision + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + ---------------------------------------------------------------------------- + E-mail contact: oberon@mathematik.uni-ulm.de + ---------------------------------------------------------------------------- + $Id: TCrypt.om,v 1.1 1997/04/02 11:54:02 borchert Exp borchert $ + ---------------------------------------------------------------------------- + $Log: TCrypt.om,v $ + Revision 1.1 1997/04/02 11:54:02 borchert + Initial revision - ---------------------------------------------------------------------------- + ---------------------------------------------------------------------------- *) MODULE ulmTCrypt; (* Michael Szczuka *) - (* Trautner's association method for key exchange *) + (* Trautner's association method for key exchange *) - IMPORT AsymmetricCiphers := ulmAsymmetricCiphers, BlockCiphers := ulmBlockCiphers, Ciphers := ulmCiphers, Conclusions := ulmConclusions, Events := ulmEvents, - NetIO := ulmNetIO, PersistentObjects := ulmPersistentObjects, Random := ulmRandomGenerators, RelatedEvents := ulmRelatedEvents, - Services := ulmServices, Streams := ulmStreams, SYS := SYSTEM; + IMPORT + AsymmetricCiphers := ulmAsymmetricCiphers, BlockCiphers := ulmBlockCiphers, + Ciphers := ulmCiphers, Conclusions := ulmConclusions, + Events := ulmEvents, NetIO := ulmNetIO, + PersistentObjects := ulmPersistentObjects, Random := ulmRandomGenerators, + RelatedEvents := ulmRelatedEvents, Services := ulmServices, + Streams := ulmStreams, SYS := SYSTEM; - CONST - M = 16; (* size of an element of CC(M) [ring of Circular Convolution] *) - MaxVar = 8; (* number of variables of a polynomial *) - MaxNrExp = 4; (* maxiumum number of different exponts used during - initialisaton *) - Dim = 2; (* dimension of the linear recursion *) - Rounds = 16; (* length of the linear recursion in rounds *) - LastRounds = 4; (* use the last LastRounds polynomial vectors as - the composed function eta *) - reg = 1; sing = 2; random = 3; - LIST = TRUE; NOLIST = FALSE; - MaxTerms = 1000; + CONST + M = 16; (* size of an element of CC(M) [ring of Circular Convolution] *) + MaxVar = 8; (* number of variables of a polynomial *) + MaxNrExp = 4; (* maxiumum number of different exponts used during + initialisaton *) + Dim = 2; (* dimension of the linear recursion *) + Rounds = 16; (* length of the linear recursion in rounds *) + LastRounds = 4; (* use the last LastRounds polynomial vectors as + the composed function eta *) + reg = 1; sing = 2; random = 3; + LIST = TRUE; NOLIST = FALSE; + MaxTerms = 1000; - CONST - writeSetFailed = 0; - readSetFailed = 1; - notRegular = 2; - errorcodes = 3; + CONST + writeSetFailed = 0; + readSetFailed = 1; + notRegular = 2; + errorcodes = 3; - TYPE - (* an element out of CC(M) *) - CCMElement = SET; - Exponent = ARRAY MaxVar OF SHORTINT; + TYPE + (* an element out of CC(M) *) + CCMElement = SET; + Exponent = ARRAY MaxVar OF SHORTINT; - TYPE - (* a polynomial with coefficients out of CC(M) *) - Polynom = POINTER TO PolynomRec; - PolynomRec = RECORD - koeff : CCMElement; - exp : Exponent; - next : Polynom; + TYPE + (* a polynomial with coefficients out of CC(M) *) + Polynom = POINTER TO PolynomRec; + PolynomRec = RECORD + koeff : CCMElement; + exp : Exponent; + next : Polynom; + END; + + TYPE + VektorCCM = ARRAY Dim OF CCMElement; + VektorPolynom = ARRAY Dim OF Polynom; + MatCCM = ARRAY Dim, Dim OF CCMElement; + MatPolynom = ARRAY Dim, Dim OF Polynom; + ListCCM = ARRAY Rounds OF CCMElement; + ListPolynom = ARRAY Rounds OF Polynom; + ChainCCM = ARRAY Rounds OF VektorCCM; + ChainPolynom = ARRAY Rounds OF VektorPolynom; + (* to increase the performance of the algorithm there shouldn't be too + many different exponents to start with *) + ListExp = ARRAY MaxNrExp OF Exponent; + + TYPE + (* this type is the input of the TCrypt method *) + TCryptInput = POINTER TO TCryptInputRec; + TCryptInputRec = RECORD + arg : ARRAY MaxVar OF CCMElement; + END; + + TYPE + (* result type after encryption with the public key *) + TCryptTmp = POINTER TO TCryptTmpRec; + TCryptTmpRec = RECORD + numerator : ChainCCM; + denominator : ListCCM; + END; + + TYPE + (* result type of the algorithm *) + TCryptRes = POINTER TO TCryptResRec; + TCryptResRec = RECORD + arg : ARRAY LastRounds OF VektorCCM; + END; + + TYPE + (* this type represents the public function f resp. phi *) + Phi = POINTER TO PhiRec; + PhiRec = RECORD + num : ChainPolynom; + denom : ListPolynom; + END; + + TYPE + (* the private/secret function g resp. psi consisting of an inital matrix + and a permutation *) + Psi = POINTER TO PsiRec; + PsiRec = RECORD + (* although the inital matrix consists only of elements out of CC(M) + this generalization is useful since all other matrces consist of + polynomials *) + initialmatrix : MatCCM; + (* correcting factors *) + korrNum : ChainCCM; + korrDenom : ListCCM; + END; + + (* the public function h resp. eta being the composition of f/phi + and g/psi *) + TYPE + Eta = POINTER TO EtaRec; + EtaRec = RECORD + p : ARRAY LastRounds OF VektorPolynom; + END; + + TYPE + (* the declaration of a basic type which PublicCipher and PrivateCipher + are descendents from seems a good idea ... at least to me :) *) + Cipher* = POINTER TO CipherRec; + CipherRec* = RECORD (AsymmetricCiphers.CipherRec) END; + (* the specific format of a public key for Trautner's technique *) + PublicCipher = POINTER TO PublicCipherRec; + PublicCipherRec = RECORD + (CipherRec) + phi : Phi; + eta : Eta; + END; + (* the specific format of a key for Trautner's technique *) + PrivateCipher = POINTER TO PrivateCipherRec; + PrivateCipherRec = RECORD + (CipherRec) + phi : Phi; + psi : Psi; + eta : Eta; + END; + + TYPE + ErrorEvent = POINTER TO ErrorEventRec; + ErrorEventRec = RECORD + (Events.EventRec) + errorcode : SHORTINT; + END; + + VAR + pubType, privType, cipherType : Services.Type; + pubIf, privIf, cipherIf : PersistentObjects.Interface; + NullCCM, EinsCCM : CCMElement; (* the zero and unit of CC(M) *) + NullExp : Exponent; (* consists of zero exponents *) + NullExpList : ListExp; (* a pseudo list for CreatePolynom *) + GlobalExpList : ListExp; (* contains the exponents which should be used + when calling CreatePolynom *) + NullPolynom : Polynom; (* the zero polynomial *) + PolFeld : ARRAY MaxTerms OF Polynom; (* used for sorting purposes *) + PreEvalArg : ARRAY M OF TCryptInput; (* precomputed values to speed + up evaluation of a polynomial *) + k : SHORTINT; (* simple counter during initialisation *) + error : Events.EventType; + errormsg : ARRAY errorcodes OF Events.Message; + + + (* ***** error handling ***** *) + + PROCEDURE InitErrorHandling; + BEGIN + Events.Define(error); + errormsg[writeSetFailed] := "couldn't write set"; + errormsg[readSetFailed] := "couldn't read set"; + errormsg[notRegular] := "element isn't regular"; + END InitErrorHandling; + + PROCEDURE Error(s: Streams.Stream; errorcode: SHORTINT); + VAR + event: ErrorEvent; + BEGIN + NEW(event); + event.message := errormsg[errorcode]; + event.type := error; + event.errorcode := errorcode; + RelatedEvents.Raise(s, event); + END Error; + + (* ***** arithmetic functions for elements out of CC(M) ***** *) + + PROCEDURE RegulaerCCM (x: CCMElement) : BOOLEAN; + (* tests x for regularity [a regular CCMElement contains an odd number of + set bits]; returns TRUE when x is regular, FALSE otherwise *) + VAR + res, i : SHORTINT; + BEGIN + i := 0; + res := 0; + REPEAT (* counting the set bits *) + IF i IN x THEN + INC(res); END; + INC(i); + UNTIL i>=M; + RETURN ((res MOD 2) = 1); + END RegulaerCCM; - TYPE - VektorCCM = ARRAY Dim OF CCMElement; - VektorPolynom = ARRAY Dim OF Polynom; - MatCCM = ARRAY Dim, Dim OF CCMElement; - MatPolynom = ARRAY Dim, Dim OF Polynom; - ListCCM = ARRAY Rounds OF CCMElement; - ListPolynom = ARRAY Rounds OF Polynom; - ChainCCM = ARRAY Rounds OF VektorCCM; - ChainPolynom = ARRAY Rounds OF VektorPolynom; - (* to increase the performance of the algorithm there shouldn't be too - many different exponents to start with *) - ListExp = ARRAY MaxNrExp OF Exponent; - - TYPE - (* this type is the input of the TCrypt method *) - TCryptInput = POINTER TO TCryptInputRec; - TCryptInputRec = RECORD - arg : ARRAY MaxVar OF CCMElement; + PROCEDURE EqualCCM (x, y: CCMElement) : BOOLEAN; + (* compares x and y for equality; if x and y are equal TRUE is returned, + FALSE otherwise *) + VAR + i : SHORTINT; + BEGIN + i := 0; + WHILE i < M DO + IF ((i IN x) & (~(i IN y))) OR ((~(i IN x)) & (i IN y)) THEN + RETURN FALSE; END; + INC(i); + END; + RETURN TRUE; + END EqualCCM; - TYPE - (* result type after encryption with the public key *) - TCryptTmp = POINTER TO TCryptTmpRec; - TCryptTmpRec = RECORD - numerator : ChainCCM; - denominator : ListCCM; + PROCEDURE AddCCM (x, y: CCMElement; VAR z: CCMElement); + (* add x and y in CC(M) *) + VAR + i : SHORTINT; + BEGIN + z := NullCCM; + i := 0; + REPEAT + IF ((i IN x) & (~(i IN y))) OR ((~(i IN x)) & (i IN y)) THEN + z := z + {i}; END; + INC(i); + UNTIL i>=M; + END AddCCM; - TYPE - (* result type of the algorithm *) - TCryptRes = POINTER TO TCryptResRec; - TCryptResRec = RECORD - arg : ARRAY LastRounds OF VektorCCM; - END; - - TYPE - (* this type represents the public function f resp. phi *) - Phi = POINTER TO PhiRec; - PhiRec = RECORD - num : ChainPolynom; - denom : ListPolynom; - END; - - TYPE - (* the private/secret function g resp. psi consisting of an inital matrix - and a permutation *) - Psi = POINTER TO PsiRec; - PsiRec = RECORD - (* although the inital matrix consists only of elements out of CC(M) - this generalization is useful since all other matrces consist of - polynomials *) - initialmatrix : MatCCM; - (* correcting factors *) - korrNum : ChainCCM; - korrDenom : ListCCM; - END; - - (* the public function h resp. eta being the composition of f/phi - and g/psi *) - TYPE - Eta = POINTER TO EtaRec; - EtaRec = RECORD - p : ARRAY LastRounds OF VektorPolynom; - END; - - TYPE - (* the declaration of a basic type which PublicCipher and PrivateCipher - are descendents from seems a good idea ... at least to me :) *) - Cipher* = POINTER TO CipherRec; - CipherRec* = RECORD (AsymmetricCiphers.CipherRec) END; - (* the specific format of a public key for Trautner's technique *) - PublicCipher = POINTER TO PublicCipherRec; - PublicCipherRec = RECORD - (CipherRec) - phi : Phi; - eta : Eta; - END; - (* the specific format of a key for Trautner's technique *) - PrivateCipher = POINTER TO PrivateCipherRec; - PrivateCipherRec = RECORD - (CipherRec) - phi : Phi; - psi : Psi; - eta : Eta; - END; - - TYPE - ErrorEvent = POINTER TO ErrorEventRec; - ErrorEventRec = RECORD - (Events.EventRec) - errorcode : SHORTINT; - END; - - VAR - pubType, privType, cipherType : Services.Type; - pubIf, privIf, cipherIf : PersistentObjects.Interface; - NullCCM, EinsCCM : CCMElement; (* the zero and unit of CC(M) *) - NullExp : Exponent; (* consists of zero exponents *) - NullExpList : ListExp; (* a pseudo list for CreatePolynom *) - GlobalExpList : ListExp; (* contains the exponents which should be used - when calling CreatePolynom *) - NullPolynom : Polynom; (* the zero polynomial *) - PolFeld : ARRAY MaxTerms OF Polynom; (* used for sorting purposes *) - PreEvalArg : ARRAY M OF TCryptInput; (* precomputed values to speed - up evaluation of a polynomial *) - k : SHORTINT; (* simple counter during initialisation *) - error : Events.EventType; - errormsg : ARRAY errorcodes OF Events.Message; - - - (* ***** error handling ***** *) - - PROCEDURE InitErrorHandling; - BEGIN - Events.Define(error); - errormsg[writeSetFailed] := "couldn't write set"; - errormsg[readSetFailed] := "couldn't read set"; - errormsg[notRegular] := "element isn't regular"; - END InitErrorHandling; - - PROCEDURE Error(s: Streams.Stream; errorcode: SHORTINT); - VAR - event: ErrorEvent; - BEGIN - NEW(event); - event.message := errormsg[errorcode]; - event.type := error; - event.errorcode := errorcode; - RelatedEvents.Raise(s, event); - END Error; - - (* ***** arithmetic functions for elements out of CC(M) ***** *) - - PROCEDURE RegulaerCCM (x: CCMElement) : BOOLEAN; - (* tests x for regularity [a regular CCMElement contains an odd number of - set bits]; returns TRUE when x is regular, FALSE otherwise *) - VAR - res, i : SHORTINT; - BEGIN - i := 0; - res := 0; - REPEAT (* counting the set bits *) - IF i IN x THEN - INC(res); - END; - INC(i); - UNTIL i>=M; - RETURN ((res MOD 2) = 1); - END RegulaerCCM; - - PROCEDURE EqualCCM (x, y: CCMElement) : BOOLEAN; - (* compares x and y for equality; if x and y are equal TRUE is returned, - FALSE otherwise *) - VAR - i : SHORTINT; - BEGIN - i := 0; - WHILE i < M DO - IF ((i IN x) & (~(i IN y))) OR ((~(i IN x)) & (i IN y)) THEN - RETURN FALSE; - END; - INC(i); - END; - RETURN TRUE; - END EqualCCM; - - PROCEDURE AddCCM (x, y: CCMElement; VAR z: CCMElement); - (* add x and y in CC(M) *) - VAR - i : SHORTINT; - BEGIN - z := NullCCM; - i := 0; + PROCEDURE MulCCM (x, y: CCMElement; VAR z: CCMElement); + (* multiply x and y in CC(M) *) + VAR + i, j, diff : SHORTINT; + tmp : INTEGER; + BEGIN + z := NullCCM; + i := 0; + REPEAT + j := 0; + tmp := 0; REPEAT - IF ((i IN x) & (~(i IN y))) OR ((~(i IN x)) & (i IN y)) THEN - z := z + {i}; - END; - INC(i); - UNTIL i>=M; - END AddCCM; - - PROCEDURE MulCCM (x, y: CCMElement; VAR z: CCMElement); - (* multiply x and y in CC(M) *) - VAR - i, j, diff : SHORTINT; - tmp : INTEGER; - BEGIN - z := NullCCM; - i := 0; - REPEAT - j := 0; - tmp := 0; - REPEAT - diff := i-j; - IF diff >= 0 THEN - IF (j IN x) & (diff IN y) THEN - INC(tmp); - END; - ELSE - IF (j IN x) & ((M+diff) IN y) THEN - INC(tmp); - END; - END; - INC(j); - UNTIL j>=M; - IF (tmp MOD 2) = 1 THEN - z := z + {i}; - END; - INC(i); - UNTIL i>=M; - END MulCCM; - - PROCEDURE PowerCCM (x: CCMElement; exp: INTEGER; VAR z: CCMElement); - (* raises x to the power exp in CC(M) *) - VAR - tmp : CCMElement; - BEGIN - (* some special cases first *) - IF exp >= M THEN - IF ~RegulaerCCM(x) THEN - (* x is singular -> result is zero *) - z := NullCCM; - RETURN; - END; - (* x is regular -> compute the modulus of exp mod M and use this - instead of exp *) - exp := exp MOD M; - END; - IF exp = 0 THEN - z := EinsCCM; - RETURN; - END; - IF exp = 1 THEN - z := x; - RETURN; + diff := i-j; + IF diff >= 0 THEN + IF (j IN x) & (diff IN y) THEN + INC(tmp); + END; + ELSE + IF (j IN x) & ((M+diff) IN y) THEN + INC(tmp); + END; + END; + INC(j); + UNTIL j>=M; + IF (tmp MOD 2) = 1 THEN + z := z + {i}; END; + INC(i); + UNTIL i>=M; + END MulCCM; - (* default case; use a "square and multiply" technique *) - tmp := x; + PROCEDURE PowerCCM (x: CCMElement; exp: INTEGER; VAR z: CCMElement); + (* raises x to the power exp in CC(M) *) + VAR + tmp : CCMElement; + BEGIN + (* some special cases first *) + IF exp >= M THEN + IF ~RegulaerCCM(x) THEN + (* x is singular -> result is zero *) + z := NullCCM; + RETURN; + END; + (* x is regular -> compute the modulus of exp mod M and use this + instead of exp *) + exp := exp MOD M; + END; + IF exp = 0 THEN z := EinsCCM; - REPEAT - IF exp MOD 2 = 1 THEN - MulCCM(z, tmp, z); - END; - exp := exp DIV 2; - MulCCM(tmp, tmp, tmp); - UNTIL exp < 1; - END PowerCCM; + RETURN; + END; + IF exp = 1 THEN + z := x; + RETURN; + END; - PROCEDURE CreateCCM (VAR x: CCMElement; mode: SHORTINT); - (* creates a random element out of CC(M) depending on mode which - can be reg, sing or random; - the result is in any case different from the zero *) + (* default case; use a "square and multiply" technique *) + tmp := x; + z := EinsCCM; + REPEAT + IF exp MOD 2 = 1 THEN + MulCCM(z, tmp, z); + END; + exp := exp DIV 2; + MulCCM(tmp, tmp, tmp); + UNTIL exp < 1; + END PowerCCM; + + PROCEDURE CreateCCM (VAR x: CCMElement; mode: SHORTINT); + (* creates a random element out of CC(M) depending on mode which + can be reg, sing or random; + the result is in any case different from the zero *) + VAR + i, SetBits: SHORTINT; + BEGIN + x := NullCCM; + REPEAT + i := 0; + SetBits := 0; + REPEAT + IF Random.Flip() THEN + (* set bit *) + x := x + {i}; + INC(SetBits); + END; + INC(i); + UNTIL i >= (M-1); + UNTIL SetBits > 0; (* at least one bit must be set so that the result + differs from zero *) + + CASE mode OF + random: + IF Random.Flip() THEN + x := x + {M-1}; + END; + | sing: (* singular element - even # of bits *) + IF (SetBits MOD 2) = 1 THEN + x := x + {M-1}; + END; + | reg: (* regular element - odd # of bits *) + IF ((SetBits + 1) MOD 2) = 1 THEN + x := x + {M-1}; + END; + ELSE + END; + END CreateCCM; + + (* ***** arithmetic functions for polynomials over CC(M) ***** *) + + PROCEDURE LengthPolynom(p: Polynom) : INTEGER; + (* returns the number of terms which make up the polynomial p *) + VAR + i : INTEGER; + BEGIN + i := 0; + WHILE p # NIL DO + INC(i); + p := p.next; + END; + RETURN i; + END LengthPolynom; + + PROCEDURE RegulaerPolynom (p: Polynom) : BOOLEAN; + (* tests the regularity of a polynomial [a polynomial is regular + iff the # of regular coefficients is odd] *) + VAR + regkoeffs : SHORTINT; + BEGIN + regkoeffs := 0; + WHILE p # NIL DO + IF RegulaerCCM(p.koeff) THEN + (* count # of reg. coefficients *) + INC(regkoeffs); + END; + p := p.next; + END; + RETURN (regkoeffs MOD 2) = 1; + END RegulaerPolynom; + + PROCEDURE CmpExp (exp1, exp2: Exponent) : SHORTINT; + (* compares two exponent vectors and returns 0 on equality, a + positive value if exp1>exp2 and a negative value if exp1 e2 THEN + cmp := 1; diff := TRUE; + END; + END; + INC(i); + UNTIL i >= MaxVar; + + IF sum1 < sum2 THEN + RETURN -2; + END; + IF sum1 > sum2 THEN + RETURN 2; + END; + + RETURN cmp + END CmpExp; + + PROCEDURE ArrangePolynom (VAR p: Polynom); + (* arrange a polynomial according to the order given by CmpExp *) + VAR + r : Polynom; + cnt : INTEGER; + + PROCEDURE SortPolynom(left, right: INTEGER); + (* sort the global field PolFeld with the quicksort algorithm *) VAR - i, SetBits: SHORTINT; - BEGIN - x := NullCCM; - REPEAT - i := 0; - SetBits := 0; - REPEAT - IF Random.Flip() THEN - (* set bit *) - x := x + {i}; - INC(SetBits); - END; - INC(i); - UNTIL i >= (M-1); - UNTIL SetBits > 0; (* at least one bit must be set so that the result - differs from zero *) + mid : INTEGER; - CASE mode OF - random: - IF Random.Flip() THEN - x := x + {M-1}; - END; - | sing: (* singular element - even # of bits *) - IF (SetBits MOD 2) = 1 THEN - x := x + {M-1}; - END; - | reg: (* regular element - odd # of bits *) - IF ((SetBits + 1) MOD 2) = 1 THEN - x := x + {M-1}; - END; + PROCEDURE Partition(l, r: INTEGER) : INTEGER; + VAR + koeff : CCMElement; + exp : Exponent; + cmp : Exponent; + i, j : INTEGER; + BEGIN + cmp := PolFeld[(l+r) DIV 2].exp; + i := l-1; + j := r+1; + LOOP + REPEAT + DEC(j); + UNTIL CmpExp(PolFeld[j].exp, cmp) >= 0; + REPEAT + INC(i); + UNTIL CmpExp(PolFeld[i].exp, cmp) <= 0; + IF i < j THEN + koeff := PolFeld[i].koeff; + exp := PolFeld[i].exp; + PolFeld[i].koeff := PolFeld[j].koeff; + PolFeld[i].exp := PolFeld[j].exp; + PolFeld[j].koeff := koeff; + PolFeld[j].exp := exp; + ELSE + RETURN j; + END; + END; + END Partition; + + BEGIN + IF left < right THEN + mid := Partition(left, right); + SortPolynom(left, mid); + SortPolynom(mid+1, right); + END; + END SortPolynom; + + BEGIN (* ArrangePolynom *) + IF p = NIL THEN + RETURN; + END; + r := p; + cnt := 0; + WHILE (p # NIL) & (cnt < MaxTerms) DO + PolFeld[cnt] := p; + INC(cnt); + p := p.next; + END; + (* polynomial contains too many terms; this shouldn't happen if all + parameters are set to reasonable values and MaxTerms is high + enough *) + ASSERT(cnt 1 THEN + SortPolynom(0, cnt-1); + END; + p := r; + END ArrangePolynom; + + PROCEDURE CopyPolynom (s: Polynom; VAR t: Polynom); + (* copy the source polynomial s to a new target t *) + VAR + troot : Polynom; + BEGIN + IF s = NIL THEN + t := NIL; + RETURN; + END; + NEW(t); + troot := t; (* save the root of t *) + WHILE s # NIL DO + troot.koeff := s.koeff; + troot.exp := s.exp; + s := s.next; + IF s # NIL THEN + NEW(troot.next); + troot := troot.next; ELSE + troot.next := NIL; END; - END CreateCCM; + END; + END CopyPolynom; - (* ***** arithmetic functions for polynomials over CC(M) ***** *) - - PROCEDURE LengthPolynom(p: Polynom) : INTEGER; - (* returns the number of terms which make up the polynomial p *) - VAR - i : INTEGER; - BEGIN - i := 0; - WHILE p # NIL DO - INC(i); - p := p.next; - END; - RETURN i; - END LengthPolynom; - - PROCEDURE RegulaerPolynom (p: Polynom) : BOOLEAN; - (* tests the regularity of a polynomial [a polynomial is regular - iff the # of regular coefficients is odd] *) - VAR - regkoeffs : SHORTINT; - BEGIN - regkoeffs := 0; - WHILE p # NIL DO - IF RegulaerCCM(p.koeff) THEN - (* count # of reg. coefficients *) - INC(regkoeffs); - END; - p := p.next; - END; - RETURN (regkoeffs MOD 2) = 1; - END RegulaerPolynom; - - PROCEDURE CmpExp (exp1, exp2: Exponent) : SHORTINT; - (* compares two exponent vectors and returns 0 on equality, a - positive value if exp1>exp2 and a negative value if exp1 e2 THEN - cmp := 1; diff := TRUE; - END; - END; - INC(i); - UNTIL i >= MaxVar; - - IF sum1 < sum2 THEN - RETURN -2; - END; - IF sum1 > sum2 THEN - RETURN 2; - END; - - RETURN cmp - END CmpExp; - - PROCEDURE ArrangePolynom (VAR p: Polynom); - (* arrange a polynomial according to the order given by CmpExp *) - VAR - r : Polynom; - cnt : INTEGER; - - PROCEDURE SortPolynom(left, right: INTEGER); - (* sort the global field PolFeld with the quicksort algorithm *) - VAR - mid : INTEGER; - - PROCEDURE Partition(l, r: INTEGER) : INTEGER; - VAR - koeff : CCMElement; - exp : Exponent; - cmp : Exponent; - i, j : INTEGER; - BEGIN - cmp := PolFeld[(l+r) DIV 2].exp; - i := l-1; - j := r+1; - LOOP - REPEAT - DEC(j); - UNTIL CmpExp(PolFeld[j].exp, cmp) >= 0; - REPEAT - INC(i); - UNTIL CmpExp(PolFeld[i].exp, cmp) <= 0; - IF i < j THEN - koeff := PolFeld[i].koeff; - exp := PolFeld[i].exp; - PolFeld[i].koeff := PolFeld[j].koeff; - PolFeld[i].exp := PolFeld[j].exp; - PolFeld[j].koeff := koeff; - PolFeld[j].exp := exp; - ELSE - RETURN j; - END; - END; - END Partition; - - BEGIN - IF left < right THEN - mid := Partition(left, right); - SortPolynom(left, mid); - SortPolynom(mid+1, right); - END; - END SortPolynom; - - BEGIN (* ArrangePolynom *) - IF p = NIL THEN - RETURN; - END; - r := p; - cnt := 0; - WHILE (p # NIL) & (cnt < MaxTerms) DO - PolFeld[cnt] := p; - INC(cnt); - p := p.next; - END; - (* polynomial contains too many terms; this shouldn't happen if all - parameters are set to reasonable values and MaxTerms is high - enough *) - ASSERT(cnt 1 THEN - SortPolynom(0, cnt-1); - END; - p := r; - END ArrangePolynom; - - PROCEDURE CopyPolynom (s: Polynom; VAR t: Polynom); - (* copy the source polynomial s to a new target t *) - VAR - troot : Polynom; - BEGIN - IF s = NIL THEN - t := NIL; - RETURN; - END; - NEW(t); - troot := t; (* save the root of t *) - WHILE s # NIL DO - troot.koeff := s.koeff; - troot.exp := s.exp; - s := s.next; - IF s # NIL THEN - NEW(troot.next); - troot := troot.next; - ELSE - troot.next := NIL; - END; - END; - END CopyPolynom; - - PROCEDURE AddPolynom (p, q: Polynom; VAR r: Polynom); - (* add two polynomial; the polynomials must be sorted by the exponents as - is the result *) - VAR - term1, term2 : Polynom; - last : Polynom; (* the last term of the result *) - tmp : Polynom; - cmpres : SHORTINT; - BEGIN - IF (p = NIL) & (q = NIL) THEN - r := NIL; - RETURN; - END; - NEW(r); - term1 := p; (* term1 runs through all terms of p *) - term2 := q; (* same with term2 for q *) - tmp := r; (* save the root of r *) - last := tmp; - REPEAT - IF (term1 = NIL) OR (term2 = NIL) THEN - IF term2 = NIL THEN - (* no further terms in q *) - WHILE term1 # NIL DO - (* copy the remaining terms of p *) - tmp.koeff := term1.koeff; - tmp.exp := term1.exp; - term1 := term1.next; - IF ~EqualCCM(tmp.koeff, NullCCM) THEN - last := tmp; - NEW(tmp.next); - tmp := tmp.next; - END; - END; - ELSE (* no further terms in p *) - WHILE term2 # NIL DO - tmp.koeff := term2.koeff; - tmp.exp := term2.exp; - term2 := term2.next; - IF ~EqualCCM(tmp.koeff, NullCCM) THEN - last := tmp; - NEW(tmp.next); - tmp := tmp.next; - END; - END; - END; - ELSE (* both p and q still have a term *) - cmpres := CmpExp(term1.exp, term2.exp); - IF cmpres = 0 THEN (* add when exponents are equal *) - AddCCM(term1.koeff, term2.koeff, tmp.koeff); - tmp.exp := term1.exp; - term1 := term1.next; - term2 := term2.next; - ELSE - IF cmpres < 0 THEN (* exp2 > exp1 *) - tmp.koeff := term2.koeff; - tmp.exp := term2.exp; - term2 := term2.next; - ELSE (* exp1 > exp2 *) - tmp.koeff := term1.koeff; - tmp.exp := term1.exp; - term1 := term1.next; - END; - END; - (* zero coefficients = zero terms shouldn't occur in the result *) - IF ~EqualCCM(tmp.koeff, NullCCM) THEN - NEW(tmp.next); - last := tmp; - tmp := tmp.next; - END; - END; - UNTIL (term1 = NIL) & (term2 = NIL); - - (* forget last created term *) - last.next := NIL; - END AddPolynom; - - PROCEDURE MulTerm (p, term: Polynom; VAR r: Polynom); - (* multiply a polynomial with a single term; is used by MulPolynom *) - VAR - tmp : Polynom; - last : Polynom; - - (* add two exponent vetors; addition is modulo M *) - PROCEDURE AddExp (exp1, exp2 : Exponent; VAR res: Exponent); - VAR - i : SHORTINT; - BEGIN - i := 0; - WHILE i exp1 *) + tmp.koeff := term2.koeff; + tmp.exp := term2.exp; + term2 := term2.next; + ELSE (* exp1 > exp2 *) + tmp.koeff := term1.koeff; + tmp.exp := term1.exp; + term1 := term1.next; + END; + END; + (* zero coefficients = zero terms shouldn't occur in the result *) + IF ~EqualCCM(tmp.koeff, NullCCM) THEN + NEW(tmp.next); + last := tmp; + tmp := tmp.next; + END; END; - qterm := q; - WHILE qterm # NIL DO - MulTerm(p,qterm,tmp); (* multiply p with current term of q *) - AddPolynom(tmp,r,r); (* add up results *) - qterm := qterm.next; - END; - ArrangePolynom(r); - END MulPolynom; + UNTIL (term1 = NIL) & (term2 = NIL); - PROCEDURE MulPolynomWithCCM (p: Polynom; c: CCMElement; VAR r: Polynom); - (* multiplies a polynomial with a single element out of CC(M) *) - VAR - tmp : Polynom; - BEGIN - IF p = NIL THEN - r := NIL; - RETURN; - END; - CopyPolynom(p, r); - tmp := r; - WHILE tmp # NIL DO - MulCCM(tmp.koeff, c, tmp.koeff); - tmp := tmp.next; - END; - END MulPolynomWithCCM; + (* forget last created term *) + last.next := NIL; + END AddPolynom; - PROCEDURE InvertPolynom (p: Polynom; VAR res: Polynom); - (* inverts a regular polynomial; if p is illegal (NIL) or singular the - result is NIL *) - VAR - exp : SHORTINT; - tmp : Polynom; - BEGIN - IF (p = NIL) OR ~RegulaerPolynom(p) THEN - res := NIL; - RETURN; - END; - CopyPolynom(p, tmp); - CopyPolynom(NullPolynom, res); - res.koeff := EinsCCM; - (* works the same way as PowerCCM ["square-and-multiply"] *) - exp := M - 1; (* inverse means "power M-1" *) - WHILE exp > 0 DO - IF (exp MOD 2) = 1 THEN - MulPolynom(res, tmp, res); - END; - MulPolynom(tmp, tmp, tmp); - exp := exp DIV 2; - END; - END InvertPolynom; + PROCEDURE MulTerm (p, term: Polynom; VAR r: Polynom); + (* multiply a polynomial with a single term; is used by MulPolynom *) + VAR + tmp : Polynom; + last : Polynom; - PROCEDURE EvalPolynom (p: Polynom; VAR res: CCMElement); - (* evaluate p; a precomputed list of all the powers of the argument can - be found in the global variable PreEvalArg *) + (* add two exponent vetors; addition is modulo M *) + PROCEDURE AddExp (exp1, exp2 : Exponent; VAR res: Exponent); VAR - i : SHORTINT; - pow, prod : CCMElement; - BEGIN - res := NullCCM; - IF p = NIL THEN - RETURN; - END; - WHILE p # NIL DO - prod := PreEvalArg[p.exp[0]].arg[0]; - i := 1; - REPEAT - pow := PreEvalArg[p.exp[i]].arg[i]; - MulCCM(prod, pow, prod); - INC(i); - UNTIL i >= MaxVar; - MulCCM(prod, p.koeff, prod); - AddCCM(res, prod, res); - p := p.next; - END; - END EvalPolynom; - - PROCEDURE CreateExp (VAR exp: Exponent); - (* creates a random vector of exponents *) - VAR - i : SHORTINT; - BEGIN + i : SHORTINT; + BEGIN i := 0; WHILE i 0 DO + IF (exp MOD 2) = 1 THEN + MulPolynom(res, tmp, res); END; + MulPolynom(tmp, tmp, tmp); + exp := exp DIV 2; + END; + END InvertPolynom; - NEW(p); - proot := p; (* save root of p *) - regkoeffs := 0; (* # of regular coeff. in p *) - i := 0; - WHILE i= MaxVar; + MulCCM(prod, p.koeff, prod); + AddCCM(res, prod, res); + p := p.next; + END; + END EvalPolynom; - (* the last term must be created manually so that the result is - regular/singular (depending on mode) *) - IF i # terms THEN - CreateCCM(p.koeff, random); - IF RegulaerCCM(p.koeff) THEN - INC(regkoeffs); - END; - NEW(p.next); - p := p.next; - END; + PROCEDURE CreateExp (VAR exp: Exponent); + (* creates a random vector of exponents *) + VAR + i : SHORTINT; + BEGIN + i := 0; + WHILE i 0 DO + IF (kk MOD 2) = 1 THEN + MulCCM(tmp, PreEvalArg[ii].arg[i], tmp); + END; + INC(ii,ii); + kk := kk DIV 2; + END; + PreEvalArg[k].arg[i] := tmp; + INC(k); + END; + INC(i); + END; + END PreComputeArgs; - (* E(n), n=1,...,Rounds, und sigma := psi *) - NEW(psi); - dy := 0; - WHILE dy < Dim DO - dx := 0; - WHILE dx < Dim DO - psi.initialmatrix[dy][dx] := E[0][dy][dx].koeff; - INC(dx); - END; - INC(dy); - END; - r := 0; - WHILE r < Rounds DO - d := 0; - WHILE d < Dim DO - psi.korrNum[r][d] := korrNum[r][d]; - INC(d); - END; - psi.korrDenom[r] := korrDenom[r]; - INC(r); + PROCEDURE EvaluatePhi (arg: TCryptInput; data: Phi) : TCryptTmp; + (* evaluate the public function phi (represented by data) with + argument arg *) + VAR + res : TCryptTmp; + r, d : SHORTINT; + BEGIN + NEW(res); + PreComputeArgs(arg); + r := 0; + WHILE r < Rounds DO + d := 0; + WHILE d < Dim DO + EvalPolynom(data.num[r][d], res.numerator[r][d]); + INC(d); END; + EvalPolynom(data.denom[r], res.denominator[r]); + INC(r); + END; + RETURN res; + END EvaluatePhi; - (* A(Rounds) := eta *) - NEW(eta); - r := 0; - idx := Rounds - LastRounds; - WHILE idx < Rounds DO - d := 0; - WHILE d < Dim DO - CopyPolynom(A[idx][d], eta.p[r][d]); - INC(d); - END; - INC(r); - INC(idx); - END; - END CreateMaps; - - PROCEDURE PreComputeArgs(arg: TCryptInput); - (* used for preevaluation of a polynomial argument *) - VAR - k, i, kk, ii : INTEGER; - tmp : CCMElement; - BEGIN - i := 0; - WHILE i < MaxVar DO - PreEvalArg[1].arg[i] := arg.arg[i]; - INC(i); - END; - i := 0; - WHILE i < MaxVar DO - k := 2; - tmp := arg.arg[i]; - WHILE k < M DO - MulCCM(tmp, tmp, tmp); - PreEvalArg[k].arg[i] := tmp; - INC(k,k); - END; - k := 3; - WHILE k < M DO - kk := k; - ii := 1; - tmp := EinsCCM; - WHILE kk > 0 DO - IF (kk MOD 2) = 1 THEN - MulCCM(tmp, PreEvalArg[ii].arg[i], tmp); - END; - INC(ii,ii); - kk := kk DIV 2; - END; - PreEvalArg[k].arg[i] := tmp; - INC(k); - END; - INC(i); - END; - END PreComputeArgs; - - PROCEDURE EvaluatePhi (arg: TCryptInput; data: Phi) : TCryptTmp; - (* evaluate the public function phi (represented by data) with - argument arg *) - VAR - res : TCryptTmp; - r, d : SHORTINT; - BEGIN - NEW(res); - PreComputeArgs(arg); - r := 0; - WHILE r < Rounds DO - d := 0; - WHILE d < Dim DO - EvalPolynom(data.num[r][d], res.numerator[r][d]); - INC(d); - END; - EvalPolynom(data.denom[r], res.denominator[r]); - INC(r); - END; - RETURN res; - END EvaluatePhi; - - PROCEDURE EvaluatePsi (arg: TCryptTmp; data: Psi) : TCryptRes; - (* evalute the private function psi *) - VAR - res : TCryptRes; - mat, prev : MatCCM; - num, denom, inv : CCMElement; - vek : VektorCCM; - A : ChainCCM; - r, d : SHORTINT; - BEGIN - (* first correct the input with the correlating inverts *) - MulCCM(arg.denominator[0], data.korrDenom[0], denom); + PROCEDURE EvaluatePsi (arg: TCryptTmp; data: Psi) : TCryptRes; + (* evalute the private function psi *) + VAR + res : TCryptRes; + mat, prev : MatCCM; + num, denom, inv : CCMElement; + vek : VektorCCM; + A : ChainCCM; + r, d : SHORTINT; + BEGIN + (* first correct the input with the correlating inverts *) + MulCCM(arg.denominator[0], data.korrDenom[0], denom); + PowerCCM(denom, M-1, inv); + MulCCM(arg.numerator[0][0], data.korrNum[0][0], num); + MulCCM(num, inv, vek[0]); + MulCCM(arg.numerator[0][1], data.korrNum[0][1], num); + MulCCM(num, inv, vek[1]); + MulMatrix(data.initialmatrix, vek, A[0]); + prev := data.initialmatrix; + r := 1; + WHILE r < Rounds DO + (* the matrix for the current round of the recursion must be computed + each round *) + BuildMatrix(mat, prev, A[r-1]); + prev := mat; + MulCCM(arg.denominator[r], data.korrDenom[r], denom); PowerCCM(denom, M-1, inv); - MulCCM(arg.numerator[0][0], data.korrNum[0][0], num); + MulCCM(arg.numerator[r][0], data.korrNum[r][0], num); MulCCM(num, inv, vek[0]); - MulCCM(arg.numerator[0][1], data.korrNum[0][1], num); + MulCCM(arg.numerator[r][1], data.korrNum[r][1], num); MulCCM(num, inv, vek[1]); - MulMatrix(data.initialmatrix, vek, A[0]); - prev := data.initialmatrix; - r := 1; - WHILE r < Rounds DO - (* the matrix for the current round of the recursion must be computed - each round *) - BuildMatrix(mat, prev, A[r-1]); - prev := mat; - MulCCM(arg.denominator[r], data.korrDenom[r], denom); - PowerCCM(denom, M-1, inv); - MulCCM(arg.numerator[r][0], data.korrNum[r][0], num); - MulCCM(num, inv, vek[0]); - MulCCM(arg.numerator[r][1], data.korrNum[r][1], num); - MulCCM(num, inv, vek[1]); - MulMatrix(mat, vek, A[r]); - INC(r); + MulMatrix(mat, vek, A[r]); + INC(r); + END; + NEW(res); + r := 0; + WHILE r < LastRounds DO + d := 0; + WHILE d < Dim DO + res.arg[r][d] := A[Rounds-LastRounds+r][d]; + INC(d); END; - NEW(res); - r := 0; - WHILE r < LastRounds DO - d := 0; - WHILE d < Dim DO - res.arg[r][d] := A[Rounds-LastRounds+r][d]; - INC(d); - END; - INC(r); - END; - RETURN res; - END EvaluatePsi; + INC(r); + END; + RETURN res; + END EvaluatePsi; - PROCEDURE EvaluateEta (arg: TCryptInput; data: Eta) : TCryptRes; - (* evaluate the public function eta (composition of phi and psi) *) - VAR - l, d : SHORTINT; - res : TCryptRes; - BEGIN - NEW(res); - PreComputeArgs(arg); - l := 0; - WHILE l < LastRounds DO - d := 0; - WHILE d < Dim DO - EvalPolynom(data.p[l][d], res.arg[l][d]); - INC(d); - END; - INC(l); + PROCEDURE EvaluateEta (arg: TCryptInput; data: Eta) : TCryptRes; + (* evaluate the public function eta (composition of phi and psi) *) + VAR + l, d : SHORTINT; + res : TCryptRes; + BEGIN + NEW(res); + PreComputeArgs(arg); + l := 0; + WHILE l < LastRounds DO + d := 0; + WHILE d < Dim DO + EvalPolynom(data.p[l][d], res.arg[l][d]); + INC(d); END; - RETURN res; - END EvaluateEta; + INC(l); + END; + RETURN res; + END EvaluateEta; - PROCEDURE Eof (s: Streams.Stream) : BOOLEAN; - (* returns TRUE if no bytes are left to read from stream s *) - VAR - b : SYS.BYTE; - BEGIN - RETURN ~Streams.ReadByte(s, b) OR ~Streams.Back(s); - END Eof; + PROCEDURE Eof (s: Streams.Stream) : BOOLEAN; + (* returns TRUE if no bytes are left to read from stream s *) + VAR + b : SYS.BYTE; + BEGIN + RETURN ~Streams.ReadByte(s, b) OR ~Streams.Back(s); + END Eof; - PROCEDURE Encrypt (msg: Streams.Stream; key: Ciphers.Cipher; - length: INTEGER; s: Streams.Stream) : BOOLEAN; - (* interface procedure for Ciphers.Encrypt *) - VAR - i, j : SHORTINT; - ccmarg : TCryptInput; - ccmres : TCryptTmp; - wholeStream : BOOLEAN; - BEGIN - (* check if the whole stream msg shall be encrypted or only a certain - amount of bytes *) - IF length <= 0 THEN - wholeStream := TRUE; - ELSE - wholeStream := FALSE - END; - NEW(ccmarg); - WHILE ~Eof(msg) & (wholeStream OR (length > 0)) DO - i := 0; - WHILE i < MaxVar DO - IF ~NetIO.ReadSet(msg, ccmarg.arg[i]) THEN - Error(msg, readSetFailed); - RETURN FALSE; - END; - IF ~RegulaerCCM(ccmarg.arg[i]) THEN - Error(msg, notRegular); - RETURN FALSE; - END; - INC(i); - END; - IF key IS PublicCipher THEN - ccmres := EvaluatePhi(ccmarg, key(PublicCipher).phi); - ELSE - ccmres := EvaluatePhi(ccmarg, key(PrivateCipher).phi); - END; - i := 0; - WHILE i < Rounds DO - j := 0; - WHILE j < Dim DO - IF ~NetIO.WriteSet(s, ccmres.numerator[i][j]) THEN - Error(s, writeSetFailed); - RETURN FALSE; - END; - INC(j); - END; - IF ~NetIO.WriteSet(s, ccmres.denominator[i]) THEN - Error(s, writeSetFailed); - RETURN FALSE; - END; - INC(i); - END; - DEC(length, MaxVar*(M DIV 8)); - END; - RETURN TRUE; - END Encrypt; - - PROCEDURE Decrypt (msg: Streams.Stream; key: Ciphers.Cipher; - length: INTEGER; s: Streams.Stream) : BOOLEAN; - (* interface procedure for Ciphers.Decrypt *) - VAR - i, j : SHORTINT; - inNum, inDenom, out : ARRAY (M DIV 8) OF SYS.BYTE; - ccmarg : TCryptTmp; - ccmres : TCryptRes; - wholeStream : BOOLEAN; - BEGIN - IF length < 0 THEN - wholeStream := TRUE; - ELSE - wholeStream := FALSE; - END; - WITH key:PrivateCipher DO - NEW(ccmarg); - WHILE ~Eof(msg) & (wholeStream OR (length > 0)) DO - i := 0; - WHILE i < Rounds DO - j := 0; - WHILE j < Dim DO - IF ~NetIO.ReadSet(msg, ccmarg.numerator[i][j]) THEN - Error(msg, readSetFailed); - RETURN FALSE; - END; - INC(j); - END; - IF ~NetIO.ReadSet(msg, ccmarg.denominator[i]) THEN - Error(msg, readSetFailed); - RETURN FALSE; - END; - INC(i); - END; - ccmres := EvaluatePsi(ccmarg, key.psi); - i := 0; - WHILE i < LastRounds DO - j := 0; - WHILE j < Dim DO - IF ~NetIO.WriteSet(s, ccmres.arg[i][j]) THEN - Error(s, writeSetFailed); - RETURN FALSE; - END; - INC(j); - END; - INC(i); - END; - DEC (length, Rounds*Dim*(M DIV 8)); - END; - END; - RETURN TRUE; - END Decrypt; - - PROCEDURE ComposedEncrypt (msg: Streams.Stream; key: Ciphers.Cipher; - length: INTEGER; s: Streams.Stream) : BOOLEAN; - (* interface procedure for AsymmetricCiphers.ComposedEncrypt *) - VAR - i, j : SHORTINT; - ccmarg : TCryptInput; - ccmres : TCryptRes; - in, out : ARRAY (M DIV 8) OF SYS.BYTE; - wholeStream : BOOLEAN; - BEGIN - IF length < 0 THEN - wholeStream := TRUE; - ELSE - wholeStream := FALSE; - END; - NEW(ccmarg); - WHILE ~Eof(msg) & (wholeStream OR (length > 0)) DO - i := 0; - WHILE i < MaxVar DO - IF ~NetIO.ReadSet(msg, ccmarg.arg[i]) THEN - Error(msg, readSetFailed); - RETURN FALSE; - END; - INC(i); - END; - IF key IS PublicCipher THEN - ccmres := EvaluateEta(ccmarg, key(PublicCipher).eta); - ELSE - ccmres := EvaluateEta(ccmarg, key(PrivateCipher).eta); - END; - i := 0; - WHILE i < LastRounds DO - j := 0; - WHILE j < Dim DO - IF ~NetIO.WriteSet(s, ccmres.arg[i][j]) THEN - Error(s, writeSetFailed); - RETURN FALSE; - END; - INC(j); - END; - INC(i); - END; - DEC (length, MaxVar*(M DIV 8)); - END; - RETURN TRUE; - END ComposedEncrypt; - - PROCEDURE RandomStream (s: Streams.Stream); - (* writes some random elements of CC(M) to the stream s which can then - be used as an input for Trautner's TCRYPT *) - VAR - ccm : CCMElement; - bytes : ARRAY M DIV 8 OF SYS.BYTE; - i : INTEGER; - BEGIN + PROCEDURE Encrypt (msg: Streams.Stream; key: Ciphers.Cipher; + length: INTEGER; s: Streams.Stream) : BOOLEAN; + (* interface procedure for Ciphers.Encrypt *) + VAR + i, j : SHORTINT; + ccmarg : TCryptInput; + ccmres : TCryptTmp; + wholeStream : BOOLEAN; + BEGIN + (* check if the whole stream msg shall be encrypted or only a certain + amount of bytes *) + IF length <= 0 THEN + wholeStream := TRUE; + ELSE + wholeStream := FALSE + END; + NEW(ccmarg); + WHILE ~Eof(msg) & (wholeStream OR (length > 0)) DO i := 0; WHILE i < MaxVar DO - CreateCCM(ccm, reg); - IF ~NetIO.WriteSet(s, ccm) THEN + IF ~NetIO.ReadSet(msg, ccmarg.arg[i]) THEN + Error(msg, readSetFailed); + RETURN FALSE; + END; + IF ~RegulaerCCM(ccmarg.arg[i]) THEN + Error(msg, notRegular); + RETURN FALSE; + END; + INC(i); + END; + IF key IS PublicCipher THEN + ccmres := EvaluatePhi(ccmarg, key(PublicCipher).phi); + ELSE + ccmres := EvaluatePhi(ccmarg, key(PrivateCipher).phi); + END; + i := 0; + WHILE i < Rounds DO + j := 0; + WHILE j < Dim DO + IF ~NetIO.WriteSet(s, ccmres.numerator[i][j]) THEN Error(s, writeSetFailed); - END; - INC(i); - END; - END RandomStream; - - PROCEDURE PublicCipherCreate (VAR obj: PersistentObjects.Object); - (* constructor for a public cipher *) - VAR - pub : PublicCipher; - if : AsymmetricCiphers.Interface; - caps : AsymmetricCiphers.CapabilitySet; - BEGIN - NEW(pub); NEW(pub.phi); NEW(pub.eta); - PersistentObjects.Init(pub, pubType); - NEW(if); if.encrypt := Encrypt; if.decrypt := NIL; - if.compencrypt := ComposedEncrypt; if.split := NIL; - if.randomStream := RandomStream; - caps := {AsymmetricCiphers.composed}; - AsymmetricCiphers.Init(pub, if, caps, M*MaxVar, M*Dim); - obj := pub; - END PublicCipherCreate; - - PROCEDURE Split (VAR public: AsymmetricCiphers.Cipher; - key: AsymmetricCiphers.Cipher); - (* interface procedure for asymmetric interface *) - VAR - pub: PublicCipher; - BEGIN - WITH key:PrivateCipher DO - PublicCipherCreate(SYS.VAL(PersistentObjects.Object, pub)); - pub.phi := key.phi; - pub.eta := key.eta; - public := pub; - END; - END Split; - - PROCEDURE CipherCreate (VAR obj: PersistentObjects.Object); - (* constructor for a private cipher *) - VAR - key : PrivateCipher; - if : AsymmetricCiphers.Interface; - caps : AsymmetricCiphers.CapabilitySet; - BEGIN - NEW(key); NEW(key.phi); NEW(key.psi); NEW(key.eta); - PersistentObjects.Init(key, privType); - NEW(if); if.encrypt := Encrypt; if.decrypt := Decrypt; - if.compencrypt := ComposedEncrypt; if.split := Split; - if.randomStream := RandomStream; - caps := {AsymmetricCiphers.composed, AsymmetricCiphers.isPrivateKey}; - AsymmetricCiphers.Init(key, if, caps, M*MaxVar, M*Dim); - obj := key; - END CipherCreate; - - PROCEDURE Create* (VAR key: Ciphers.Cipher); - (* creates a cipher for the use with Trautner's TCRYPT algorithm *) - VAR - tmpKey : PrivateCipher; - phi : Phi; - psi : Psi; - eta : Eta; - BEGIN - CipherCreate(SYS.VAL(PersistentObjects.Object, tmpKey)); - CreateMaps(tmpKey.phi, tmpKey.psi, tmpKey.eta); - key := tmpKey; - END Create; - - PROCEDURE WritePolynom (s: Streams.Stream; p: Polynom) : BOOLEAN; - (* writes the polynomial p onto the stream s *) - CONST - index = M DIV 8; - VAR - nrOfTerms, i : INTEGER; - bytes : ARRAY index OF SYS.BYTE; - BEGIN - nrOfTerms := LengthPolynom(p); - IF ~NetIO.WriteInteger(s, nrOfTerms) THEN - RETURN FALSE; - END; - WHILE nrOfTerms > 0 DO - IF ~NetIO.WriteSet(s, p.koeff) THEN RETURN FALSE; - END; - i := 0; - WHILE i < MaxVar DO - IF ~NetIO.WriteShortInt(s, p.exp[i]) THEN - RETURN FALSE; - END; - INC(i); - END; - p := p.next; - DEC(nrOfTerms); + END; + INC(j); + END; + IF ~NetIO.WriteSet(s, ccmres.denominator[i]) THEN + Error(s, writeSetFailed); + RETURN FALSE; + END; + INC(i); END; - RETURN TRUE; - END WritePolynom; + DEC(length, MaxVar*(M DIV 8)); + END; + RETURN TRUE; + END Encrypt; - PROCEDURE ReadPolynom (s: Streams.Stream; VAR p: Polynom) : BOOLEAN; - (* reads a polynomial from stream s *) - CONST - index = M DIV 8; - VAR - nrOfTerms, i : INTEGER; - pol : Polynom; - bytes : ARRAY index OF SYS.BYTE; - BEGIN - IF ~NetIO.ReadInteger(s, nrOfTerms) THEN - RETURN FALSE; - END; - NEW(p); - pol := p; - WHILE nrOfTerms > 0 DO - IF ~NetIO.ReadSet(s, pol.koeff) THEN + PROCEDURE Decrypt (msg: Streams.Stream; key: Ciphers.Cipher; + length: INTEGER; s: Streams.Stream) : BOOLEAN; + (* interface procedure for Ciphers.Decrypt *) + VAR + i, j : SHORTINT; + inNum, inDenom, out : ARRAY (M DIV 8) OF SYS.BYTE; + ccmarg : TCryptTmp; + ccmres : TCryptRes; + wholeStream : BOOLEAN; + BEGIN + IF length < 0 THEN + wholeStream := TRUE; + ELSE + wholeStream := FALSE; + END; + WITH key:PrivateCipher DO + NEW(ccmarg); + WHILE ~Eof(msg) & (wholeStream OR (length > 0)) DO + i := 0; + WHILE i < Rounds DO + j := 0; + WHILE j < Dim DO + IF ~NetIO.ReadSet(msg, ccmarg.numerator[i][j]) THEN + Error(msg, readSetFailed); + RETURN FALSE; + END; + INC(j); + END; + IF ~NetIO.ReadSet(msg, ccmarg.denominator[i]) THEN + Error(msg, readSetFailed); RETURN FALSE; - END; - i := 0; - WHILE i < MaxVar DO - IF ~NetIO.ReadShortInt(s, pol.exp[i]) THEN - RETURN FALSE; + END; + INC(i); + END; + ccmres := EvaluatePsi(ccmarg, key.psi); + i := 0; + WHILE i < LastRounds DO + j := 0; + WHILE j < Dim DO + IF ~NetIO.WriteSet(s, ccmres.arg[i][j]) THEN + Error(s, writeSetFailed); + RETURN FALSE; END; - INC(i); - END; - DEC(nrOfTerms); - IF nrOfTerms > 0 THEN - NEW(pol.next); - pol := pol.next; - END + INC(j); + END; + INC(i); + END; + DEC (length, Rounds*Dim*(M DIV 8)); END; - RETURN TRUE; - END ReadPolynom; + END; + RETURN TRUE; + END Decrypt; - PROCEDURE PhiWrite (s: Streams.Stream; data: Phi) : BOOLEAN; - (* writes the data structure for the public function phi onto a stream *) - VAR - r, d, k : INTEGER; - BEGIN - r := 0; - WHILE r < Rounds DO - d := 0; - WHILE d < Dim DO - IF ~WritePolynom(s, data.num[r][d]) THEN - RETURN FALSE; - END; - INC(d); - END; - IF ~WritePolynom(s, data.denom[r]) THEN + PROCEDURE ComposedEncrypt (msg: Streams.Stream; key: Ciphers.Cipher; + length: INTEGER; s: Streams.Stream) : BOOLEAN; + (* interface procedure for AsymmetricCiphers.ComposedEncrypt *) + VAR + i, j : SHORTINT; + ccmarg : TCryptInput; + ccmres : TCryptRes; + in, out : ARRAY (M DIV 8) OF SYS.BYTE; + wholeStream : BOOLEAN; + BEGIN + IF length < 0 THEN + wholeStream := TRUE; + ELSE + wholeStream := FALSE; + END; + NEW(ccmarg); + WHILE ~Eof(msg) & (wholeStream OR (length > 0)) DO + i := 0; + WHILE i < MaxVar DO + IF ~NetIO.ReadSet(msg, ccmarg.arg[i]) THEN + Error(msg, readSetFailed); + RETURN FALSE; + END; + INC(i); + END; + IF key IS PublicCipher THEN + ccmres := EvaluateEta(ccmarg, key(PublicCipher).eta); + ELSE + ccmres := EvaluateEta(ccmarg, key(PrivateCipher).eta); + END; + i := 0; + WHILE i < LastRounds DO + j := 0; + WHILE j < Dim DO + IF ~NetIO.WriteSet(s, ccmres.arg[i][j]) THEN + Error(s, writeSetFailed); RETURN FALSE; - END; - INC(r); + END; + INC(j); + END; + INC(i); END; - RETURN TRUE; - END PhiWrite; + DEC (length, MaxVar*(M DIV 8)); + END; + RETURN TRUE; + END ComposedEncrypt; - PROCEDURE PhiRead (s: Streams.Stream; VAR data: Phi) : BOOLEAN; - (* reads the data structure for the public function phi from a stream *) - VAR - r, d, k : INTEGER; - BEGIN - NEW(data); - r := 0; - WHILE r < Rounds DO - d := 0; - WHILE d < Dim DO - IF ~ReadPolynom(s, data.num[r][d]) THEN - RETURN FALSE; - END; - INC(d); - END; - IF ~ReadPolynom(s, data.denom[r]) THEN - RETURN FALSE; - END; - INC(r); + PROCEDURE RandomStream (s: Streams.Stream); + (* writes some random elements of CC(M) to the stream s which can then + be used as an input for Trautner's TCRYPT *) + VAR + ccm : CCMElement; + bytes : ARRAY M DIV 8 OF SYS.BYTE; + i : INTEGER; + BEGIN + i := 0; + WHILE i < MaxVar DO + CreateCCM(ccm, reg); + IF ~NetIO.WriteSet(s, ccm) THEN + Error(s, writeSetFailed); END; - RETURN TRUE; - END PhiRead; + INC(i); + END; + END RandomStream; - PROCEDURE PsiWrite (s: Streams.Stream; data: Psi) : BOOLEAN; - (* writes the data structure for the private function psi onto a stream *) - CONST - index = M DIV 8; - VAR - dx, dy, r, d : INTEGER; - bytes : ARRAY index OF SYS.BYTE; - BEGIN - dy := 0; - WHILE dy < Dim DO - dx := 0; - WHILE dx < Dim DO - IF ~NetIO.WriteSet(s, data.initialmatrix[dy][dx]) THEN - RETURN FALSE; - END; - INC(dx); - END; - INC(dy); - END; - r := 0; - WHILE r < Rounds DO - d := 0; - WHILE d < Dim DO - IF ~NetIO.WriteSet(s, data.korrNum[r][d]) THEN - RETURN FALSE; - END; - INC(d); - END; - IF ~NetIO.WriteSet(s, data.korrDenom[r]) THEN - RETURN FALSE; - END; - INC(r); - END; - RETURN TRUE; - END PsiWrite; + PROCEDURE PublicCipherCreate (VAR obj: PersistentObjects.Object); + (* constructor for a public cipher *) + VAR + pub : PublicCipher; + if : AsymmetricCiphers.Interface; + caps : AsymmetricCiphers.CapabilitySet; + BEGIN + NEW(pub); NEW(pub.phi); NEW(pub.eta); + PersistentObjects.Init(pub, pubType); + NEW(if); if.encrypt := Encrypt; if.decrypt := NIL; + if.compencrypt := ComposedEncrypt; if.split := NIL; + if.randomStream := RandomStream; + caps := {AsymmetricCiphers.composed}; + AsymmetricCiphers.Init(pub, if, caps, M*MaxVar, M*Dim); + obj := pub; + END PublicCipherCreate; - PROCEDURE PsiRead (s: Streams.Stream; VAR data: Psi) : BOOLEAN; - (* reads the data structure for the private function psi from a stream *) - CONST - index = M DIV 8; - VAR - dy, dx, r, d : INTEGER; - bytes : ARRAY index OF SYS.BYTE; - BEGIN - dy := 0; - WHILE dy < Dim DO - dx := 0; - WHILE dx < Dim DO - IF ~NetIO.ReadSet(s, data.initialmatrix[dy][dx]) THEN - RETURN FALSE; - END; - INC(dx); - END; - INC(dy); - END; - r := 0; - WHILE r < Rounds DO - d := 0; - WHILE d < Dim DO - IF ~NetIO.ReadSet(s, data.korrNum[r][d]) THEN - RETURN FALSE; - END; - INC(d); - END; - IF ~NetIO.ReadSet(s, data.korrDenom[r]) THEN - RETURN FALSE; - END; - INC(r); - END; - RETURN TRUE; - END PsiRead; + PROCEDURE Split (VAR public: AsymmetricCiphers.Cipher; + key: AsymmetricCiphers.Cipher); + (* interface procedure for asymmetric interface *) + VAR + pub: PublicCipher; + obj: PersistentObjects.Object; + BEGIN + WITH key:PrivateCipher DO + PublicCipherCreate(obj); pub := obj(PublicCipher); + pub.phi := key.phi; + pub.eta := key.eta; + public := pub; + END; + END Split; - PROCEDURE EtaWrite (s: Streams.Stream; data: Eta) : BOOLEAN; - (* writes the data structure for the public function eta onto a stream *) - VAR - l, d : INTEGER; - BEGIN - l := 0; - WHILE l < LastRounds DO - d := 0; - WHILE d < Dim DO - IF ~WritePolynom(s, data.p[l][d]) THEN - RETURN FALSE; - END; - INC(d); - END; - INC(l); - END; - RETURN TRUE; - END EtaWrite; + PROCEDURE CipherCreate (VAR obj: PersistentObjects.Object); + (* constructor for a private cipher *) + VAR + key : PrivateCipher; + if : AsymmetricCiphers.Interface; + caps : AsymmetricCiphers.CapabilitySet; + BEGIN + NEW(key); NEW(key.phi); NEW(key.psi); NEW(key.eta); + PersistentObjects.Init(key, privType); + NEW(if); if.encrypt := Encrypt; if.decrypt := Decrypt; + if.compencrypt := ComposedEncrypt; if.split := Split; + if.randomStream := RandomStream; + caps := {AsymmetricCiphers.composed, AsymmetricCiphers.isPrivateKey}; + AsymmetricCiphers.Init(key, if, caps, M*MaxVar, M*Dim); + obj := key; + END CipherCreate; - PROCEDURE EtaRead (s: Streams.Stream; VAR data: Eta) : BOOLEAN; - (* reads the data structure for the public function eta from a stream *) - VAR - l, d : INTEGER; - BEGIN - NEW(data); - l := 0; - WHILE l < LastRounds DO - d := 0; - WHILE d < Dim DO - IF ~ReadPolynom(s, data.p[l][d]) THEN - RETURN FALSE; - END; - INC(d); - END; - INC(l); - END; - RETURN TRUE; - END EtaRead; + PROCEDURE Create* (VAR key: Ciphers.Cipher); + (* creates a cipher for the use with Trautner's TCRYPT algorithm *) + VAR + tmpKey : PrivateCipher; + obj : PersistentObjects.Object; + phi : Phi; + psi : Psi; + eta : Eta; + BEGIN + CipherCreate(obj); tmpKey := obj(PrivateCipher); + CreateMaps(tmpKey.phi, tmpKey.psi, tmpKey.eta); + key := tmpKey; + END Create; - PROCEDURE PubWrite (s: Streams.Stream; - obj: PersistentObjects.Object) : BOOLEAN; - (* interface procedure for PersistentObjects *) - BEGIN - WITH obj:PublicCipher DO - RETURN PhiWrite(s, obj.phi) & EtaWrite(s, obj.eta); + PROCEDURE WritePolynom (s: Streams.Stream; p: Polynom) : BOOLEAN; + (* writes the polynomial p onto the stream s *) + CONST + index = M DIV 8; + VAR + nrOfTerms, i : INTEGER; + bytes : ARRAY index OF SYS.BYTE; + BEGIN + nrOfTerms := LengthPolynom(p); + IF ~NetIO.WriteInteger(s, nrOfTerms) THEN + RETURN FALSE; + END; + WHILE nrOfTerms > 0 DO + IF ~NetIO.WriteSet(s, p.koeff) THEN + RETURN FALSE; END; - END PubWrite; + i := 0; + WHILE i < MaxVar DO + IF ~NetIO.WriteShortInt(s, p.exp[i]) THEN + RETURN FALSE; + END; + INC(i); + END; + p := p.next; + DEC(nrOfTerms); + END; + RETURN TRUE; + END WritePolynom; - PROCEDURE CipherWrite (s: Streams.Stream; - obj: PersistentObjects.Object) : BOOLEAN; - (* interface procedure for PersistentObjects *) - BEGIN - WITH obj:PrivateCipher DO - RETURN PhiWrite(s, obj.phi) & - PsiWrite(s, obj.psi) & - EtaWrite(s, obj.eta); + PROCEDURE ReadPolynom (s: Streams.Stream; VAR p: Polynom) : BOOLEAN; + (* reads a polynomial from stream s *) + CONST + index = M DIV 8; + VAR + nrOfTerms, i : INTEGER; + pol : Polynom; + bytes : ARRAY index OF SYS.BYTE; + BEGIN + IF ~NetIO.ReadInteger(s, nrOfTerms) THEN + RETURN FALSE; + END; + NEW(p); + pol := p; + WHILE nrOfTerms > 0 DO + IF ~NetIO.ReadSet(s, pol.koeff) THEN + RETURN FALSE; END; - END CipherWrite; + i := 0; + WHILE i < MaxVar DO + IF ~NetIO.ReadShortInt(s, pol.exp[i]) THEN + RETURN FALSE; + END; + INC(i); + END; + DEC(nrOfTerms); + IF nrOfTerms > 0 THEN + NEW(pol.next); + pol := pol.next; + END + END; + RETURN TRUE; + END ReadPolynom; - PROCEDURE PubRead (s: Streams.Stream; - obj: PersistentObjects.Object) : BOOLEAN; - (* interface procedure for PersistentObjects *) - BEGIN - WITH obj:PublicCipher DO - IF ~PhiRead(s, obj.phi) OR ~EtaRead(s, obj.eta) THEN - RETURN FALSE; - END; + PROCEDURE PhiWrite (s: Streams.Stream; data: Phi) : BOOLEAN; + (* writes the data structure for the public function phi onto a stream *) + VAR + r, d, k : INTEGER; + BEGIN + r := 0; + WHILE r < Rounds DO + d := 0; + WHILE d < Dim DO + IF ~WritePolynom(s, data.num[r][d]) THEN + RETURN FALSE; + END; + INC(d); END; - RETURN TRUE; - END PubRead; + IF ~WritePolynom(s, data.denom[r]) THEN + RETURN FALSE; + END; + INC(r); + END; + RETURN TRUE; + END PhiWrite; - PROCEDURE CipherRead (s: Streams.Stream; - obj: PersistentObjects.Object) : BOOLEAN; - (* interface procedure for PersistentObjects *) - BEGIN - WITH obj:PrivateCipher DO - IF ~PhiRead(s, obj.phi) OR - ~PsiRead(s, obj.psi) OR - ~EtaRead(s, obj.eta) THEN - RETURN FALSE; - END; + PROCEDURE PhiRead (s: Streams.Stream; VAR data: Phi) : BOOLEAN; + (* reads the data structure for the public function phi from a stream *) + VAR + r, d, k : INTEGER; + BEGIN + NEW(data); + r := 0; + WHILE r < Rounds DO + d := 0; + WHILE d < Dim DO + IF ~ReadPolynom(s, data.num[r][d]) THEN + RETURN FALSE; + END; + INC(d); END; - RETURN TRUE; - END CipherRead; + IF ~ReadPolynom(s, data.denom[r]) THEN + RETURN FALSE; + END; + INC(r); + END; + RETURN TRUE; + END PhiRead; + + PROCEDURE PsiWrite (s: Streams.Stream; data: Psi) : BOOLEAN; + (* writes the data structure for the private function psi onto a stream *) + CONST + index = M DIV 8; + VAR + dx, dy, r, d : INTEGER; + bytes : ARRAY index OF SYS.BYTE; + BEGIN + dy := 0; + WHILE dy < Dim DO + dx := 0; + WHILE dx < Dim DO + IF ~NetIO.WriteSet(s, data.initialmatrix[dy][dx]) THEN + RETURN FALSE; + END; + INC(dx); + END; + INC(dy); + END; + r := 0; + WHILE r < Rounds DO + d := 0; + WHILE d < Dim DO + IF ~NetIO.WriteSet(s, data.korrNum[r][d]) THEN + RETURN FALSE; + END; + INC(d); + END; + IF ~NetIO.WriteSet(s, data.korrDenom[r]) THEN + RETURN FALSE; + END; + INC(r); + END; + RETURN TRUE; + END PsiWrite; + + PROCEDURE PsiRead (s: Streams.Stream; VAR data: Psi) : BOOLEAN; + (* reads the data structure for the private function psi from a stream *) + CONST + index = M DIV 8; + VAR + dy, dx, r, d : INTEGER; + bytes : ARRAY index OF SYS.BYTE; + BEGIN + dy := 0; + WHILE dy < Dim DO + dx := 0; + WHILE dx < Dim DO + IF ~NetIO.ReadSet(s, data.initialmatrix[dy][dx]) THEN + RETURN FALSE; + END; + INC(dx); + END; + INC(dy); + END; + r := 0; + WHILE r < Rounds DO + d := 0; + WHILE d < Dim DO + IF ~NetIO.ReadSet(s, data.korrNum[r][d]) THEN + RETURN FALSE; + END; + INC(d); + END; + IF ~NetIO.ReadSet(s, data.korrDenom[r]) THEN + RETURN FALSE; + END; + INC(r); + END; + RETURN TRUE; + END PsiRead; + + PROCEDURE EtaWrite (s: Streams.Stream; data: Eta) : BOOLEAN; + (* writes the data structure for the public function eta onto a stream *) + VAR + l, d : INTEGER; + BEGIN + l := 0; + WHILE l < LastRounds DO + d := 0; + WHILE d < Dim DO + IF ~WritePolynom(s, data.p[l][d]) THEN + RETURN FALSE; + END; + INC(d); + END; + INC(l); + END; + RETURN TRUE; + END EtaWrite; + + PROCEDURE EtaRead (s: Streams.Stream; VAR data: Eta) : BOOLEAN; + (* reads the data structure for the public function eta from a stream *) + VAR + l, d : INTEGER; + BEGIN + NEW(data); + l := 0; + WHILE l < LastRounds DO + d := 0; + WHILE d < Dim DO + IF ~ReadPolynom(s, data.p[l][d]) THEN + RETURN FALSE; + END; + INC(d); + END; + INC(l); + END; + RETURN TRUE; + END EtaRead; + + PROCEDURE PubWrite (s: Streams.Stream; + obj: PersistentObjects.Object) : BOOLEAN; + (* interface procedure for PersistentObjects *) + BEGIN + WITH obj:PublicCipher DO + RETURN PhiWrite(s, obj.phi) & EtaWrite(s, obj.eta); + END; + END PubWrite; + + PROCEDURE CipherWrite (s: Streams.Stream; + obj: PersistentObjects.Object) : BOOLEAN; + (* interface procedure for PersistentObjects *) + BEGIN + WITH obj:PrivateCipher DO + RETURN PhiWrite(s, obj.phi) & + PsiWrite(s, obj.psi) & + EtaWrite(s, obj.eta); + END; + END CipherWrite; + + PROCEDURE PubRead (s: Streams.Stream; + obj: PersistentObjects.Object) : BOOLEAN; + (* interface procedure for PersistentObjects *) + BEGIN + WITH obj:PublicCipher DO + IF ~PhiRead(s, obj.phi) OR ~EtaRead(s, obj.eta) THEN + RETURN FALSE; + END; + END; + RETURN TRUE; + END PubRead; + + PROCEDURE CipherRead (s: Streams.Stream; + obj: PersistentObjects.Object) : BOOLEAN; + (* interface procedure for PersistentObjects *) + BEGIN + WITH obj:PrivateCipher DO + IF ~PhiRead(s, obj.phi) OR + ~PsiRead(s, obj.psi) OR + ~EtaRead(s, obj.eta) THEN + RETURN FALSE; + END; + END; + RETURN TRUE; + END CipherRead; BEGIN - (* init of the zero and unit of CC(M) *) - NullCCM := {}; - EinsCCM := {0}; + (* init of the zero and unit of CC(M) *) + NullCCM := {}; + EinsCCM := {0}; - (* init of the zero exponent *) - k := 0; - WHILE k Priorities.base THEN - desc.caps := desc.caps + {Conditions.select, Conditions.async}; - desc.internal := priorityOfClock < Priorities.interrupts; - END; - END; - NEW(domain); Conditions.InitDomain(domain, if, desc); - domain.clock := clock; - IF Clocks.timer IN Clocks.Capabilities(clock) THEN - Events.Define(domain.alarm); - Events.SetPriority(domain.alarm, priorityOfClock + 1); - Events.Handler(domain.alarm, Wakeup); - ELSE - domain.alarm := NIL; - END; - NEW(clockDisc); clockDisc.id := disciplineId; - clockDisc.domain := domain; - Disciplines.Add(clock, clockDisc); - domain.event := NIL; + TYPE + WakeupEvent = POINTER TO WakeupEventRec; + WakeupEventRec = + RECORD + (Events.EventRec) + condition: Condition; + awaked: BOOLEAN; (* set to true by Wakeup event handler *) END; - Conditions.Init(condition, domain); - FixTime(time, currentTime, clock); condition.time := time; - condition.domain := domain; - condition.passed := Clocks.Passed(clock, time); - condition.scheduled := FALSE; - IF ~condition.passed & - (domain.alarm # NIL) & (clock # Clocks.system) THEN - ScheduleEvent(condition); - END; - END Init; - PROCEDURE Create*(VAR condition: Conditions.Condition; - clock: Clocks.Clock; time: Times.Time); - (* create and initialize a time condition: - is the current time of the clock greater than or - equal to `time'; - if time is relative then it is taken relative to the current time - *) - VAR - timeCond: Condition; - BEGIN - NEW(timeCond); - Init(timeCond, clock, time); - condition := timeCond; - END Create; + VAR + if: Conditions.Interface; - (* ======== interface procedures ================================ *) - - PROCEDURE GetTime(clock: Clocks.Clock; - VAR currentTime: Times.Time; - errors: RelatedEvents.Object) : BOOLEAN; - (* get the current time of clock and check for errors *) - VAR - oldEvents, newEvents: RelatedEvents.Queue; - BEGIN - RelatedEvents.GetQueue(clock, oldEvents); + PROCEDURE FixTime(VAR time: Times.Time; + currentTime: Times.Time; + clock: Clocks.Clock); + (* convert relative time measures into absolute time specs *) + VAR op: Op.Operand; + BEGIN + IF Scales.IsRelative(time) THEN Clocks.GetTime(clock, currentTime); - RelatedEvents.GetQueue(clock, newEvents); - IF newEvents # NIL THEN - RelatedEvents.AppendQueue(errors, newEvents); - END; - IF oldEvents # NIL THEN - RelatedEvents.AppendQueue(clock, oldEvents); - END; - IF newEvents # NIL THEN - RelatedEvents.AppendQueue(clock, newEvents); - END; - RETURN newEvents = NIL - END GetTime; + op := time; Op.Add3(op, currentTime, time); time := op(Times.Time) + END; + END FixTime; - PROCEDURE Passed(clock: Clocks.Clock; - time: Times.Time; - VAR passed: BOOLEAN; - errors: RelatedEvents.Object) : BOOLEAN; - VAR - oldEvents, newEvents: RelatedEvents.Queue; - BEGIN - RelatedEvents.GetQueue(clock, oldEvents); - passed := Clocks.Passed(clock, time); - RelatedEvents.GetQueue(clock, newEvents); - IF newEvents # NIL THEN - RelatedEvents.AppendQueue(errors, newEvents); + PROCEDURE Wakeup(event: Events.Event); + (* note that we strictly rely on the capability of the + underlying clock to raise this event at the appropriate + time; we are unable to verify it because that could + deadlock us in case of remote clocks + *) + VAR + condevent: Events.Event; (* event requested by SendEvent *) + BEGIN + WITH event: WakeupEvent DO + event.awaked := TRUE; + IF event.condition # NIL THEN + event.condition.passed := TRUE; + event.condition.scheduled := FALSE; + condevent := event.condition.domain.event; + IF condevent # NIL THEN + event.condition.domain.event := NIL; + Events.Raise(condevent); + END; END; - IF oldEvents # NIL THEN - RelatedEvents.AppendQueue(clock, oldEvents); - END; - IF newEvents # NIL THEN - RelatedEvents.AppendQueue(clock, newEvents); - END; - RETURN newEvents = NIL - END Passed; + END; + END Wakeup; - PROCEDURE Test(domain: Conditions.Domain; condition: Conditions.Condition; - errors: RelatedEvents.Object) : BOOLEAN; - VAR - currentTime: Times.Time; - BEGIN - WITH domain: Domain DO WITH condition: Condition DO - IF condition.passed THEN RETURN TRUE END; - IF condition.domain.event # NIL THEN RETURN FALSE END; - IF condition.scheduled THEN RETURN FALSE END; - IF ~Passed(domain.clock, condition.time, - condition.passed, errors) THEN - condition.passed := TRUE; - RETURN TRUE - END; - RETURN condition.passed - END; END; - END Test; + PROCEDURE ScheduleEvent(condition: Condition); + VAR + wakeup: WakeupEvent; + domain: Domain; + BEGIN + IF ~condition.scheduled THEN + domain := condition.domain; + ASSERT(domain.alarm # NIL); + NEW(wakeup); wakeup.type := domain.alarm; + wakeup.awaked := FALSE; wakeup.condition := condition; + condition.scheduled := TRUE; + Timers.Schedule(domain.clock, condition.time, wakeup); + END; + END ScheduleEvent; - PROCEDURE GetMinTime(conditionSet: Conditions.ConditionSet; - VAR minTime: Times.Time; - VAR minCond: Condition); + PROCEDURE Init*(condition: Condition; clock: Clocks.Clock; time: Times.Time); + (* like Create but without NEW *) + VAR + clockDisc: Discipline; + disc: Disciplines.Discipline; + domain: Domain; + desc: Conditions.Description; + priorityOfClock: Priorities.Priority; + currentTime: Times.Time; + BEGIN + IF Disciplines.Seek(clock, disciplineId, disc) THEN + domain := disc(Discipline).domain; + ELSE + (* create new domain *) + NEW(desc); desc.caps := {}; desc.internal := TRUE; + IF clock = Clocks.system THEN + desc.caps := desc.caps + + {Conditions.timelimit, Conditions.timecond}; + END; + IF Clocks.timer IN Clocks.Capabilities(clock) THEN + Clocks.GetPriority(clock, priorityOfClock); + IF priorityOfClock > Priorities.base THEN + desc.caps := desc.caps + {Conditions.select, Conditions.async}; + desc.internal := priorityOfClock < Priorities.interrupts; + END; + END; + NEW(domain); Conditions.InitDomain(domain, if, desc); + domain.clock := clock; + IF Clocks.timer IN Clocks.Capabilities(clock) THEN + Events.Define(domain.alarm); + Events.SetPriority(domain.alarm, priorityOfClock + 1); + Events.Handler(domain.alarm, Wakeup); + ELSE + domain.alarm := NIL; + END; + NEW(clockDisc); clockDisc.id := disciplineId; + clockDisc.domain := domain; + Disciplines.Add(clock, clockDisc); + domain.event := NIL; + END; + Conditions.Init(condition, domain); + FixTime(time, currentTime, clock); condition.time := time; + condition.domain := domain; + condition.passed := Clocks.Passed(clock, time); + condition.scheduled := FALSE; + IF ~condition.passed & + (domain.alarm # NIL) & (clock # Clocks.system) THEN + ScheduleEvent(condition); + END; + END Init; + + PROCEDURE Create*(VAR condition: Conditions.Condition; + clock: Clocks.Clock; time: Times.Time); + (* create and initialize a time condition: + is the current time of the clock greater than or + equal to `time'; + if time is relative then it is taken relative to the current time + *) + VAR + timeCond: Condition; + BEGIN + NEW(timeCond); + Init(timeCond, clock, time); + condition := timeCond; + END Create; + + (* ======== interface procedures ================================ *) + + PROCEDURE GetTime(clock: Clocks.Clock; + VAR currentTime: Times.Time; + errors: RelatedEvents.Object) : BOOLEAN; + (* get the current time of clock and check for errors *) + VAR + oldEvents, newEvents: RelatedEvents.Queue; + BEGIN + RelatedEvents.GetQueue(clock, oldEvents); + Clocks.GetTime(clock, currentTime); + RelatedEvents.GetQueue(clock, newEvents); + IF newEvents # NIL THEN + RelatedEvents.AppendQueue(errors, newEvents); + END; + IF oldEvents # NIL THEN + RelatedEvents.AppendQueue(clock, oldEvents); + END; + IF newEvents # NIL THEN + RelatedEvents.AppendQueue(clock, newEvents); + END; + RETURN newEvents = NIL + END GetTime; + + PROCEDURE Passed(clock: Clocks.Clock; + time: Times.Time; + VAR passed: BOOLEAN; + errors: RelatedEvents.Object) : BOOLEAN; + VAR + oldEvents, newEvents: RelatedEvents.Queue; + BEGIN + RelatedEvents.GetQueue(clock, oldEvents); + passed := Clocks.Passed(clock, time); + RelatedEvents.GetQueue(clock, newEvents); + IF newEvents # NIL THEN + RelatedEvents.AppendQueue(errors, newEvents); + END; + IF oldEvents # NIL THEN + RelatedEvents.AppendQueue(clock, oldEvents); + END; + IF newEvents # NIL THEN + RelatedEvents.AppendQueue(clock, newEvents); + END; + RETURN newEvents = NIL + END Passed; + + PROCEDURE Test(domain: Conditions.Domain; condition: Conditions.Condition; + errors: RelatedEvents.Object) : BOOLEAN; + VAR + currentTime: Times.Time; + BEGIN + WITH domain: Domain DO WITH condition: Condition DO + IF condition.passed THEN RETURN TRUE END; + IF condition.domain.event # NIL THEN RETURN FALSE END; + IF condition.scheduled THEN RETURN FALSE END; + IF ~Passed(domain.clock, condition.time, + condition.passed, errors) THEN + condition.passed := TRUE; + RETURN TRUE + END; + RETURN condition.passed + END; END; + END Test; + + PROCEDURE GetMinTime(conditionSet: Conditions.ConditionSet; + VAR minTime: Times.Time; + VAR minCond: Condition); + VAR + condition: Conditions.Condition; (* Condition *) + op: Op.Operand; + BEGIN + minTime := NIL; + Conditions.ExamineConditions(conditionSet); + WHILE Conditions.GetNextCondition(conditionSet, condition) DO + IF (minTime = NIL) OR (Op.Compare(condition(Condition).time, minTime) < 0) THEN + minTime := condition(Condition).time; minCond := condition(Condition) + END; + END; + op := minTime; Op.Assign(op, minTime); minTime := op(Times.Time) (* take a copy *) + END GetMinTime; + + PROCEDURE Select(domain: Conditions.Domain; + conditionSet: Conditions.ConditionSet; + time: Times.Time; + VAR setOfTrueConditions: Conditions.ConditionSet; + errors: RelatedEvents.Object; + retry: BOOLEAN; + VAR interrupted: BOOLEAN) : BOOLEAN; + VAR + minTime: Times.Time; + minCond: Condition; + currentTime: Times.Time; (* of Clocks.system *) + condition: Conditions.Condition; (* Condition *) + wakeup: WakeupEvent; + anythingTrue: BOOLEAN; + + PROCEDURE Failure; + (* we are unable to retrieve the time; + so we have to mark all conditions as passed + and to return the whole set + *) VAR - condition: Condition; - BEGIN - minTime := NIL; + condition: Conditions.Condition; (* Condition *) + BEGIN + Conditions.CreateSet(setOfTrueConditions); Conditions.ExamineConditions(conditionSet); - WHILE Conditions.GetNextCondition(conditionSet, SYSTEM.VAL(Conditions.Condition, condition)) DO - IF (minTime = NIL) OR (Op.Compare(condition.time, minTime) < 0) THEN - minTime := condition.time; minCond := condition; - END; + WHILE Conditions.GetNextCondition(conditionSet, condition) DO + condition(Condition).passed := TRUE; + Conditions.Incl(setOfTrueConditions, condition(Condition)); END; - Op.Assign(SYSTEM.VAL(Op.Operand, minTime), minTime); (* take a copy *) - END GetMinTime; + END Failure; - PROCEDURE Select(domain: Conditions.Domain; - conditionSet: Conditions.ConditionSet; - time: Times.Time; - VAR setOfTrueConditions: Conditions.ConditionSet; - errors: RelatedEvents.Object; - retry: BOOLEAN; - VAR interrupted: BOOLEAN) : BOOLEAN; - VAR - minTime: Times.Time; - minCond: Condition; - currentTime: Times.Time; (* of Clocks.system *) - condition: Condition; - wakeup: WakeupEvent; - anythingTrue: BOOLEAN; + BEGIN (* Select *) + WITH domain: Domain DO + GetMinTime(conditionSet, minTime, minCond); - PROCEDURE Failure; - (* we are unable to retrieve the time; - so we have to mark all conditions as passed - and to return the whole set - *) - VAR - condition: Condition; - BEGIN - Conditions.CreateSet(setOfTrueConditions); - Conditions.ExamineConditions(conditionSet); - WHILE Conditions.GetNextCondition(conditionSet, SYSTEM.VAL(Conditions.Condition, condition)) DO - condition.passed := TRUE; - Conditions.Incl(setOfTrueConditions, condition); - END; - END Failure; - - BEGIN (* Select *) - WITH domain: Domain DO - GetMinTime(conditionSet, minTime, minCond); - - (* block current process, if necessary *) - interrupted := FALSE; - IF time # NIL THEN - Clocks.GetTime(Clocks.system, currentTime); - FixTime(time, currentTime, Clocks.system); - NEW(wakeup); wakeup.type := domain.alarm; - wakeup.condition := NIL; wakeup.awaked := FALSE; - Timers.Schedule(Clocks.system, time, wakeup); - END; - IF ~GetTime(domain.clock, currentTime, errors) THEN - Failure; RETURN TRUE - END; - - IF ~minCond.passed THEN - LOOP (* goes only into loop if retry = TRUE & we get interrupted *) - Process.Pause; - IF wakeup.awaked THEN EXIT END; - interrupted := ~minCond.passed; - IF ~interrupted THEN EXIT END; - IF ~retry THEN RETURN FALSE END; - END; - END; - - anythingTrue := FALSE; - Conditions.CreateSet(setOfTrueConditions); - Conditions.ExamineConditions(conditionSet); - WHILE Conditions.GetNextCondition(conditionSet, SYSTEM.VAL(Conditions.Condition, condition)) DO - IF condition.passed THEN - Conditions.Incl(setOfTrueConditions, condition); - anythingTrue := TRUE; - END; - END; - RETURN anythingTrue + (* block current process, if necessary *) + interrupted := FALSE; + IF time # NIL THEN + Clocks.GetTime(Clocks.system, currentTime); + FixTime(time, currentTime, Clocks.system); + NEW(wakeup); wakeup.type := domain.alarm; + wakeup.condition := NIL; wakeup.awaked := FALSE; + Timers.Schedule(Clocks.system, time, wakeup); + END; + IF ~GetTime(domain.clock, currentTime, errors) THEN + Failure; RETURN TRUE END; - END Select; - PROCEDURE SendEvent(domain: Conditions.Domain; - condition: Conditions.Condition; - event: Events.Event; - errors: RelatedEvents.Object) : BOOLEAN; - BEGIN - WITH domain: Domain DO WITH condition: Condition DO - IF condition.passed THEN - RETURN FALSE - ELSE - domain.event := event; - ScheduleEvent(condition); - RETURN TRUE - END; - END; END; - END SendEvent; + IF ~minCond.passed THEN + LOOP (* goes only into loop if retry = TRUE & we get interrupted *) + Process.Pause; + IF wakeup.awaked THEN EXIT END; + interrupted := ~minCond.passed; + IF ~interrupted THEN EXIT END; + IF ~retry THEN RETURN FALSE END; + END; + END; - PROCEDURE GetNextTime(domain: Conditions.Domain; - conditionSet: Conditions.ConditionSet; - VAR nextTime: Times.Time; - VAR nextCond: Conditions.Condition; - errors: RelatedEvents.Object); - VAR - condition: Condition; - BEGIN - GetMinTime(conditionSet, nextTime, condition); - nextCond := condition; - END GetNextTime; + anythingTrue := FALSE; + Conditions.CreateSet(setOfTrueConditions); + Conditions.ExamineConditions(conditionSet); + WHILE Conditions.GetNextCondition(conditionSet, condition) DO + IF condition(Condition).passed THEN + Conditions.Incl(setOfTrueConditions, condition(Condition)); + anythingTrue := TRUE; + END; + END; + RETURN anythingTrue + END; + END Select; - PROCEDURE InitInterface; - BEGIN - NEW(if); - if.test := Test; - if.select := Select; - if.sendevent := SendEvent; - if.gettime := GetNextTime; - END InitInterface; + PROCEDURE SendEvent(domain: Conditions.Domain; + condition: Conditions.Condition; + event: Events.Event; + errors: RelatedEvents.Object) : BOOLEAN; + BEGIN + WITH domain: Domain DO WITH condition: Condition DO + IF condition.passed THEN + RETURN FALSE + ELSE + domain.event := event; + ScheduleEvent(condition); + RETURN TRUE + END; + END; END; + END SendEvent; + + PROCEDURE GetNextTime(domain: Conditions.Domain; + conditionSet: Conditions.ConditionSet; + VAR nextTime: Times.Time; + VAR nextCond: Conditions.Condition; + errors: RelatedEvents.Object); + VAR + condition: Condition; + BEGIN + GetMinTime(conditionSet, nextTime, condition); + nextCond := condition; + END GetNextTime; + + PROCEDURE InitInterface; + BEGIN + NEW(if); + if.test := Test; + if.select := Select; + if.sendevent := SendEvent; + if.gettime := GetNextTime; + END InitInterface; BEGIN - disciplineId := Disciplines.Unique(); - InitInterface; + disciplineId := Disciplines.Unique(); + InitInterface; END ulmTimeConditions. diff --git a/src/library/ulm/ulmTimers.Mod b/src/library/ulm/ulmTimers.Mod index 88ca1996..62c45e7f 100644 --- a/src/library/ulm/ulmTimers.Mod +++ b/src/library/ulm/ulmTimers.Mod @@ -1,336 +1,338 @@ (* Ulm's Oberon Library - Copyright (C) 1989-1994 by University of Ulm, SAI, D-89069 Ulm, Germany - ---------------------------------------------------------------------------- - Ulm's Oberon Library is free software; you can redistribute it - and/or modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either version - 2 of the License, or (at your option) any later version. + Copyright (C) 1989-1994 by University of Ulm, SAI, D-89069 Ulm, Germany + ---------------------------------------------------------------------------- + Ulm's Oberon Library is free software; you can redistribute it + and/or modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either version + 2 of the License, or (at your option) any later version. - Ulm's Oberon Library is distributed in the hope that it will be - useful, but WITHOUT ANY WARRANTY; without even the implied warranty - of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. + Ulm's Oberon Library is distributed in the hope that it will be + useful, but WITHOUT ANY WARRANTY; without even the implied warranty + of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - ---------------------------------------------------------------------------- - E-mail contact: oberon@mathematik.uni-ulm.de - ---------------------------------------------------------------------------- - $Id: Timers.om,v 1.3 2001/04/30 14:58:18 borchert Exp $ - ---------------------------------------------------------------------------- - $Log: Timers.om,v $ - Revision 1.3 2001/04/30 14:58:18 borchert - bug fix: recursion via Clocks.TimerOn was not possible + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + ---------------------------------------------------------------------------- + E-mail contact: oberon@mathematik.uni-ulm.de + ---------------------------------------------------------------------------- + $Id: Timers.om,v 1.3 2001/04/30 14:58:18 borchert Exp $ + ---------------------------------------------------------------------------- + $Log: Timers.om,v $ + Revision 1.3 2001/04/30 14:58:18 borchert + bug fix: recursion via Clocks.TimerOn was not possible - Revision 1.2 1994/07/18 14:21:51 borchert - bug fix: CreateQueue took uninitialized priority variable instead of - queue.priority + Revision 1.2 1994/07/18 14:21:51 borchert + bug fix: CreateQueue took uninitialized priority variable instead of + queue.priority - Revision 1.1 1994/02/22 20:11:37 borchert - Initial revision + Revision 1.1 1994/02/22 20:11:37 borchert + Initial revision - ---------------------------------------------------------------------------- - AFB 1/92 - ---------------------------------------------------------------------------- + ---------------------------------------------------------------------------- + AFB 1/92 + ---------------------------------------------------------------------------- *) MODULE ulmTimers; - IMPORT Clocks := ulmClocks, Disciplines := ulmDisciplines, Events := ulmEvents, Objects := ulmObjects, Op := ulmOperations, Priorities := ulmPriorities, - SYS := ulmSYSTEM, SYSTEM, RelatedEvents := ulmRelatedEvents, Scales := ulmScales, Times := ulmTimes; + IMPORT Clocks := ulmClocks, Disciplines := ulmDisciplines, Events := ulmEvents, Objects := ulmObjects, Op := ulmOperations, Priorities := ulmPriorities, + SYS := ulmSYSTEM, RelatedEvents := ulmRelatedEvents, Scales := ulmScales, Times := ulmTimes; - TYPE - Queue = POINTER TO QueueRec; - Timer* = POINTER TO TimerRec; - TimerRec* = - RECORD - (Objects.ObjectRec) - valid: BOOLEAN; (* a valid timer entry? *) - queue: Queue; (* timer belongs to this queue *) - prev, next: Timer; (* double-linked and sorted list *) - time: Times.Time; (* key *) - event: Events.Event; (* raise this event at the given time *) - END; - QueueRec = - RECORD - (Disciplines.ObjectRec) - clock: Clocks.Clock; (* queue of this clock *) - priority: Priorities.Priority; (* priority of the clock *) - checkQueue: Events.EventType; (* check queue on this event *) - head, tail: Timer; (* sorted list of timers *) - lock: BOOLEAN; - END; - TYPE - CheckQueueEvent = POINTER TO CheckQueueEventRec; - CheckQueueEventRec = - RECORD - (Events.EventRec) - queue: Queue; - END; - TYPE - ClockDiscipline = POINTER TO ClockDisciplineRec; - ClockDisciplineRec = - RECORD - (Disciplines.DisciplineRec) - queue: Queue; - END; - VAR - clockDisciplineId: Disciplines.Identifier; - - CONST - invalidTimer* = 0; (* timer is no longer valid *) - queueLocked* = 1; (* the queue is currently locked *) - badClock* = 2; (* clock is unable to maintain a timer *) - errorcodes* = 3; - TYPE - ErrorEvent* = POINTER TO ErrorEventRec; - ErrorEventRec* = - RECORD - (Events.EventRec) - errorcode*: SHORTINT; - END; - VAR - errormsg*: ARRAY errorcodes OF Events.Message; - error*: Events.EventType; - - PROCEDURE InitErrorHandling; - BEGIN - errormsg[invalidTimer] := "invalid timer given to Timers.Remove"; - errormsg[queueLocked] := "the queue is currently locked"; - errormsg[badClock] := "clock is unable to maintain a timer"; - Events.Define(error); Events.SetPriority(error, Priorities.liberrors); - END InitErrorHandling; - - PROCEDURE Error(errors: RelatedEvents.Object; code: SHORTINT); - VAR - event: ErrorEvent; - BEGIN - NEW(event); - event.type := error; - event.message := errormsg[code]; - event.errorcode := code; - RelatedEvents.Raise(errors, event); - END Error; - - PROCEDURE CheckQueue(queue: Queue); - VAR - currentTime: Times.Time; - oldTimers: Timer; - p, prev: Timer; - checkQueueEvent: CheckQueueEvent; - nextTimer: Timer; - BEGIN - IF queue.head = NIL THEN queue.lock := FALSE; RETURN END; - - Clocks.GetTime(queue.clock, currentTime); - - (* remove old timers from queue *) - oldTimers := queue.head; - p := queue.head; prev := NIL; - WHILE (p # NIL) & (Op.Compare(currentTime, p.time) >= 0) DO - prev := p; p := p.next; + TYPE + Queue = POINTER TO QueueRec; + Timer* = POINTER TO TimerRec; + TimerRec* = + RECORD + (Objects.ObjectRec) + valid: BOOLEAN; (* a valid timer entry? *) + queue: Queue; (* timer belongs to this queue *) + prev, next: Timer; (* double-linked and sorted list *) + time: Times.Time; (* key *) + event: Events.Event; (* raise this event at the given time *) END; - IF p = NIL THEN - queue.head := NIL; queue.tail := NIL; - ELSE - queue.head := p; - p.prev := NIL; + QueueRec = + RECORD + (Disciplines.ObjectRec) + clock: Clocks.Clock; (* queue of this clock *) + priority: Priorities.Priority; (* priority of the clock *) + checkQueue: Events.EventType; (* check queue on this event *) + head, tail: Timer; (* sorted list of timers *) + lock: BOOLEAN; END; - IF prev = NIL THEN - oldTimers := NIL; - ELSE - prev.next := NIL; + TYPE + CheckQueueEvent = POINTER TO CheckQueueEventRec; + CheckQueueEventRec = + RECORD + (Events.EventRec) + queue: Queue; END; + TYPE + ClockDiscipline = POINTER TO ClockDisciplineRec; + ClockDisciplineRec = + RECORD + (Disciplines.DisciplineRec) + queue: Queue; + END; + VAR + clockDisciplineId: Disciplines.Identifier; - (* set up next check-queue-event, if necessary *) - nextTimer := queue.head; - queue.lock := FALSE; - (* unlock queue now to allow recursion via Clocks.TimerOn *) - IF nextTimer # NIL THEN - NEW(checkQueueEvent); - checkQueueEvent.type := queue.checkQueue; - checkQueueEvent.message := "check queue of timer"; - checkQueueEvent.queue := queue; - Clocks.TimerOn(queue.clock, nextTimer.time, checkQueueEvent); - ELSE - Clocks.TimerOff(queue.clock); + CONST + invalidTimer* = 0; (* timer is no longer valid *) + queueLocked* = 1; (* the queue is currently locked *) + badClock* = 2; (* clock is unable to maintain a timer *) + errorcodes* = 3; + TYPE + ErrorEvent* = POINTER TO ErrorEventRec; + ErrorEventRec* = + RECORD + (Events.EventRec) + errorcode*: SHORTINT; END; + VAR + errormsg*: ARRAY errorcodes OF Events.Message; + error*: Events.EventType; - (* process old timers *) - p := oldTimers; - WHILE p # NIL DO - p.valid := FALSE; - Events.Raise(p.event); - p := p.next; - END; - END CheckQueue; + PROCEDURE InitErrorHandling; + BEGIN + errormsg[invalidTimer] := "invalid timer given to Timers.Remove"; + errormsg[queueLocked] := "the queue is currently locked"; + errormsg[badClock] := "clock is unable to maintain a timer"; + Events.Define(error); Events.SetPriority(error, Priorities.liberrors); + END InitErrorHandling; - PROCEDURE CatchCheckQueueEvents(event: Events.Event); - BEGIN - WITH event: CheckQueueEvent DO - IF ~SYS.TAS(event.queue.lock) THEN - CheckQueue(event.queue); - (* event.queue.lock := FALSE; (* done by CheckQueue *) *) - END; - END; - END CatchCheckQueueEvents; + PROCEDURE Error(errors: RelatedEvents.Object; code: SHORTINT); + VAR + event: ErrorEvent; + BEGIN + NEW(event); + event.type := error; + event.message := errormsg[code]; + event.errorcode := code; + RelatedEvents.Raise(errors, event); + END Error; - PROCEDURE CreateQueue(errors: RelatedEvents.Object; - VAR queue: Queue; clock: Clocks.Clock) : BOOLEAN; - VAR - clockDiscipline: ClockDiscipline; - BEGIN - IF ~(Clocks.timer IN Clocks.Capabilities(clock)) THEN - Error(errors, badClock); RETURN FALSE - END; + PROCEDURE CheckQueue(queue: Queue); + VAR + currentTime: Times.Time; + oldTimers: Timer; + p, prev: Timer; + checkQueueEvent: CheckQueueEvent; + nextTimer: Timer; + BEGIN + IF queue.head = NIL THEN queue.lock := FALSE; RETURN END; - NEW(queue); - queue.clock := clock; + Clocks.GetTime(queue.clock, currentTime); + + (* remove old timers from queue *) + oldTimers := queue.head; + p := queue.head; prev := NIL; + WHILE (p # NIL) & (Op.Compare(currentTime, p.time) >= 0) DO + prev := p; p := p.next; + END; + IF p = NIL THEN queue.head := NIL; queue.tail := NIL; - queue.lock := FALSE; - Events.Define(queue.checkQueue); - Events.Handler(queue.checkQueue, CatchCheckQueueEvents); - Clocks.GetPriority(clock, queue.priority); - IF queue.priority > Priorities.base THEN - Events.SetPriority(queue.checkQueue, queue.priority + 1); + ELSE + queue.head := p; + p.prev := NIL; + END; + IF prev = NIL THEN + oldTimers := NIL; + ELSE + prev.next := NIL; + END; + + (* set up next check-queue-event, if necessary *) + nextTimer := queue.head; + queue.lock := FALSE; + (* unlock queue now to allow recursion via Clocks.TimerOn *) + IF nextTimer # NIL THEN + NEW(checkQueueEvent); + checkQueueEvent.type := queue.checkQueue; + checkQueueEvent.message := "check queue of timer"; + checkQueueEvent.queue := queue; + Clocks.TimerOn(queue.clock, nextTimer.time, checkQueueEvent); + ELSE + Clocks.TimerOff(queue.clock); + END; + + (* process old timers *) + p := oldTimers; + WHILE p # NIL DO + p.valid := FALSE; + Events.Raise(p.event); + p := p.next; + END; + END CheckQueue; + + PROCEDURE CatchCheckQueueEvents(event: Events.Event); + BEGIN + WITH event: CheckQueueEvent DO + IF ~SYS.TAS(event.queue.lock) THEN + CheckQueue(event.queue); + (* event.queue.lock := FALSE; (* done by CheckQueue *) *) + END; + END; + END CatchCheckQueueEvents; + + PROCEDURE CreateQueue(errors: RelatedEvents.Object; + VAR queue: Queue; clock: Clocks.Clock) : BOOLEAN; + VAR + clockDiscipline: ClockDiscipline; + BEGIN + IF ~(Clocks.timer IN Clocks.Capabilities(clock)) THEN + Error(errors, badClock); RETURN FALSE + END; + + NEW(queue); + queue.clock := clock; + queue.head := NIL; queue.tail := NIL; + queue.lock := FALSE; + Events.Define(queue.checkQueue); + Events.Handler(queue.checkQueue, CatchCheckQueueEvents); + Clocks.GetPriority(clock, queue.priority); + IF queue.priority > Priorities.base THEN + Events.SetPriority(queue.checkQueue, queue.priority + 1); + ELSE + queue.priority := Priorities.default; + END; + + NEW(clockDiscipline); clockDiscipline.id := clockDisciplineId; + clockDiscipline.queue := queue; + Disciplines.Add(clock, clockDiscipline); + RETURN TRUE + END CreateQueue; + + PROCEDURE Add*(clock: Clocks.Clock; time: Times.Time; event: Events.Event; + VAR timer: Timer); + VAR + queue: Queue; + clockDiscipline: Disciplines.Discipline; (* ClockDiscipline *) + p: Timer; + absTime: Times.Time; + op: Op.Operand; + BEGIN + IF Disciplines.Seek(clock, clockDisciplineId, clockDiscipline) THEN + queue := clockDiscipline(ClockDiscipline).queue; + ELSIF ~CreateQueue(clock, queue, clock) THEN + RETURN + END; + + IF SYS.TAS(queue.lock) THEN + Error(clock, queueLocked); RETURN + END; + Events.AssertPriority(queue.priority); + + IF Scales.IsRelative(time) THEN + (* take relative time to be relative to the current time *) + Clocks.GetTime(clock, absTime); + (* Op.Add2(SYSTEM.VAL(Op.Operand, absTime), time); *) + op := absTime; Op.Add2(op, time); absTime := op(Times.Time); + ELSE + (* create a copy of time *) + op := NIL; Op.Assign(op, time); absTime := op(Times.Time); + END; + time := absTime; + NEW(timer); timer.time := time; timer.event := event; + timer.queue := queue; timer.valid := TRUE; + + (* look for the insertion point *) + p := queue.head; + WHILE (p # NIL) & (Op.Compare(time, p.time) > 0) DO + p := p.next; + END; + + (* insert timer in front of p *) + timer.next := p; + IF p = NIL THEN + (* append timer at the end of the queue *) + timer.prev := queue.tail; + IF queue.tail = NIL THEN + queue.head := timer; ELSE - queue.priority := Priorities.default; + queue.tail.next := timer; END; - - NEW(clockDiscipline); clockDiscipline.id := clockDisciplineId; - clockDiscipline.queue := queue; - Disciplines.Add(clock, clockDiscipline); - RETURN TRUE - END CreateQueue; - - PROCEDURE Add*(clock: Clocks.Clock; time: Times.Time; event: Events.Event; - VAR timer: Timer); - VAR - queue: Queue; - clockDiscipline: ClockDiscipline; - p: Timer; - absTime: Times.Time; - BEGIN - IF Disciplines.Seek(clock, clockDisciplineId, SYSTEM.VAL(Disciplines.Discipline, clockDiscipline)) THEN - queue := clockDiscipline.queue; - ELSIF ~CreateQueue(clock, queue, clock) THEN - RETURN + queue.tail := timer; + ELSE + timer.prev := p.prev; + timer.next := p; + IF p = queue.head THEN + queue.head := timer; + ELSE + p.prev.next := timer; END; + p.prev := timer; + END; + CheckQueue(queue); + (* queue.lock := FALSE; (* done by CheckQueue *) *) + Events.ExitPriority; + END Add; + + PROCEDURE Remove*(timer: Timer); + VAR + queue: Queue; + BEGIN + IF timer.valid THEN + queue := timer.queue; IF SYS.TAS(queue.lock) THEN - Error(clock, queueLocked); RETURN + Error(queue.clock, queueLocked); RETURN END; Events.AssertPriority(queue.priority); - - IF Scales.IsRelative(time) THEN - (* take relative time to be relative to the current time *) - Clocks.GetTime(clock, absTime); - Op.Add2(SYSTEM.VAL(Op.Operand, absTime), time); + timer.valid := FALSE; + IF timer.prev = NIL THEN + queue.head := timer.next; ELSE - (* create a copy of time *) - absTime := NIL; Op.Assign(SYSTEM.VAL(Op.Operand, absTime), time); + timer.prev.next := timer.next; END; - time := absTime; - NEW(timer); timer.time := time; timer.event := event; - timer.queue := queue; timer.valid := TRUE; - - (* look for the insertion point *) - p := queue.head; - WHILE (p # NIL) & (Op.Compare(time, p.time) > 0) DO - p := p.next; - END; - - (* insert timer in front of p *) - timer.next := p; - IF p = NIL THEN - (* append timer at the end of the queue *) - timer.prev := queue.tail; - IF queue.tail = NIL THEN - queue.head := timer; - ELSE - queue.tail.next := timer; - END; - queue.tail := timer; + IF timer.next = NIL THEN + queue.tail := timer.prev; ELSE - timer.prev := p.prev; - timer.next := p; - IF p = queue.head THEN - queue.head := timer; - ELSE - p.prev.next := timer; - END; - p.prev := timer; + timer.next.prev := timer.prev; END; - CheckQueue(queue); (* queue.lock := FALSE; (* done by CheckQueue *) *) Events.ExitPriority; - END Add; + ELSE + Error(timer.queue.clock, invalidTimer); + END; + END Remove; - PROCEDURE Remove*(timer: Timer); - VAR - queue: Queue; - BEGIN - IF timer.valid THEN - queue := timer.queue; - IF SYS.TAS(queue.lock) THEN - Error(queue.clock, queueLocked); RETURN - END; - Events.AssertPriority(queue.priority); - timer.valid := FALSE; - IF timer.prev = NIL THEN - queue.head := timer.next; - ELSE - timer.prev.next := timer.next; - END; - IF timer.next = NIL THEN - queue.tail := timer.prev; - ELSE - timer.next.prev := timer.prev; - END; - CheckQueue(queue); - (* queue.lock := FALSE; (* done by CheckQueue *) *) - Events.ExitPriority; - ELSE - Error(timer.queue.clock, invalidTimer); - END; - END Remove; + PROCEDURE Schedule*(clock: Clocks.Clock; + time: Times.Time; event: Events.Event); + VAR + timer: Timer; + BEGIN + Add(clock, time, event, timer); + END Schedule; - PROCEDURE Schedule*(clock: Clocks.Clock; - time: Times.Time; event: Events.Event); - VAR - timer: Timer; - BEGIN - Add(clock, time, event, timer); - END Schedule; + PROCEDURE NextEvent*(clock: Clocks.Clock; VAR time: Times.Time) : BOOLEAN; + VAR + rval: BOOLEAN; + queue: Queue; + clockDiscipline: Disciplines.Discipline; (* ClockDiscipline *) + BEGIN + IF ~Disciplines.Seek(clock, clockDisciplineId, clockDiscipline) THEN + RETURN FALSE + END; + queue := clockDiscipline(ClockDiscipline).queue; - PROCEDURE NextEvent*(clock: Clocks.Clock; VAR time: Times.Time) : BOOLEAN; - VAR - rval: BOOLEAN; - queue: Queue; - clockDiscipline: ClockDiscipline; - BEGIN - IF ~Disciplines.Seek(clock, clockDisciplineId, SYSTEM.VAL(Disciplines.Discipline, clockDiscipline)) THEN - RETURN FALSE - END; - queue := clockDiscipline.queue; - - IF SYS.TAS(queue.lock) THEN - Error(clock, queueLocked); RETURN FALSE - END; - CheckQueue(queue); - IF queue.head # NIL THEN - time := queue.head.time; - rval := TRUE; - ELSE - rval := FALSE - END; - (* queue.lock := FALSE; (* done by CheckQueue *) *) - RETURN rval - END NextEvent; + IF SYS.TAS(queue.lock) THEN + Error(clock, queueLocked); RETURN FALSE + END; + CheckQueue(queue); + IF queue.head # NIL THEN + time := queue.head.time; + rval := TRUE; + ELSE + rval := FALSE + END; + (* queue.lock := FALSE; (* done by CheckQueue *) *) + RETURN rval + END NextEvent; BEGIN - InitErrorHandling; - clockDisciplineId := Disciplines.Unique(); + InitErrorHandling; + clockDisciplineId := Disciplines.Unique(); END ulmTimers. diff --git a/src/library/ulm/ulmTimes.Mod b/src/library/ulm/ulmTimes.Mod index e7dc122f..cf45c823 100644 --- a/src/library/ulm/ulmTimes.Mod +++ b/src/library/ulm/ulmTimes.Mod @@ -1,398 +1,401 @@ (* Ulm's Oberon Library - Copyright (C) 1989-1994 by University of Ulm, SAI, D-89069 Ulm, Germany - ---------------------------------------------------------------------------- - Ulm's Oberon Library is free software; you can redistribute it - and/or modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either version - 2 of the License, or (at your option) any later version. + Copyright (C) 1989-1994 by University of Ulm, SAI, D-89069 Ulm, Germany + ---------------------------------------------------------------------------- + Ulm's Oberon Library is free software; you can redistribute it + and/or modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either version + 2 of the License, or (at your option) any later version. - Ulm's Oberon Library is distributed in the hope that it will be - useful, but WITHOUT ANY WARRANTY; without even the implied warranty - of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. + Ulm's Oberon Library is distributed in the hope that it will be + useful, but WITHOUT ANY WARRANTY; without even the implied warranty + of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - ---------------------------------------------------------------------------- - E-mail contact: oberon@mathematik.uni-ulm.de - ---------------------------------------------------------------------------- - $Id: Times.om,v 1.3 2001/04/30 14:54:44 borchert Exp $ - ---------------------------------------------------------------------------- - $Log: Times.om,v $ - Revision 1.3 2001/04/30 14:54:44 borchert - bug fix: base type is TimeRec instead of Times.TimeRec - (invalid self-reference) + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + ---------------------------------------------------------------------------- + E-mail contact: oberon@mathematik.uni-ulm.de + ---------------------------------------------------------------------------- + $Id: Times.om,v 1.3 2001/04/30 14:54:44 borchert Exp $ + ---------------------------------------------------------------------------- + $Log: Times.om,v $ + Revision 1.3 2001/04/30 14:54:44 borchert + bug fix: base type is TimeRec instead of Times.TimeRec + (invalid self-reference) - Revision 1.2 1995/04/07 13:25:07 borchert - fixes due to changed if of PersistentObjects + Revision 1.2 1995/04/07 13:25:07 borchert + fixes due to changed if of PersistentObjects - Revision 1.1 1994/02/22 20:12:02 borchert - Initial revision + Revision 1.1 1994/02/22 20:12:02 borchert + Initial revision - ---------------------------------------------------------------------------- - AFB 12/91 - ---------------------------------------------------------------------------- + ---------------------------------------------------------------------------- + AFB 12/91 + ---------------------------------------------------------------------------- *) MODULE ulmTimes; - IMPORT NetIO := ulmNetIO, Objects := ulmObjects, Operations := ulmOperations, PersistentObjects := ulmPersistentObjects, Scales := ulmScales, - Services := ulmServices, Streams := ulmStreams, SYSTEM; + IMPORT NetIO := ulmNetIO, Objects := ulmObjects, Operations := ulmOperations, PersistentObjects := ulmPersistentObjects, Scales := ulmScales, + Services := ulmServices, Streams := ulmStreams; - CONST - relative* = Scales.relative; - absolute* = Scales.absolute; - TYPE - (* the common base type of all time measures *) - Time* = POINTER TO TimeRec; - TimeRec* = RECORD (Scales.MeasureRec) END; + CONST + relative* = Scales.relative; + absolute* = Scales.absolute; + TYPE + (* the common base type of all time measures *) + Time* = POINTER TO TimeRec; + TimeRec* = RECORD (Scales.MeasureRec) END; - CONST - usecsPerSec = 1000000; (* 10^6 *) - TYPE - (* units of the reference implementation: - epoch, second and usec - *) - TimeValueRec* = - RECORD - (Objects.ObjectRec) - (* epoch 0: Jan. 1, 1970; - each epoch has a length of MAX(Scales.Value) + 1 seconds; - epoch may be negative: - -1 is the epoch just before 1970 - *) - epoch*: Scales.Value; - (* seconds and ... *) - second*: Scales.Value; - (* ... microseconds since the beginning of the epoch *) - usec*: Scales.Value; - END; - - (* ==== private datatypes for the reference scale *) - TYPE - ReferenceTime = POINTER TO ReferenceTimeRec; - ReferenceTimeRec = - RECORD - (TimeRec) - timeval: TimeValueRec; - END; - VAR - absType, relType: Services.Type; - CONST - epochUnit = 0; secondUnit = 1; usecUnit = 2; - TYPE - Unit = POINTER TO UnitRec; - UnitRec = - RECORD - (Scales.UnitRec) - index: SHORTINT; (* epochUnit..usecUnit *) - END; - - VAR - scale*: Scales.Scale; (* reference scale *) - family*: Scales.Family; (* family of time scales *) - if: Scales.Interface; - - PROCEDURE Create*(VAR time: Time; type: SHORTINT); - (* type = absolute or relative *) - VAR - m: Scales.Measure; - BEGIN - Scales.CreateMeasure(scale, m, type); - time := m(Time); - END Create; - - PROCEDURE Normalize(VAR timeval: TimeValueRec); - (* make sure that second and usec >= 0 *) - VAR - toomanysecs: Scales.Value; - secs: Scales.Value; - BEGIN - IF timeval.second < 0 THEN - INC(timeval.second, 1); - INC(timeval.second, MAX(Scales.Value)); - DEC(timeval.epoch); + CONST + usecsPerSec = 1000000; (* 10^6 *) + TYPE + (* units of the reference implementation: + epoch, second and usec + *) + TimeValueRec* = + RECORD + (Objects.ObjectRec) + (* epoch 0: Jan. 1, 1970; + each epoch has a length of MAX(Scales.Value) + 1 seconds; + epoch may be negative: + -1 is the epoch just before 1970 + *) + epoch*: Scales.Value; + (* seconds and ... *) + second*: Scales.Value; + (* ... microseconds since the beginning of the epoch *) + usec*: Scales.Value; END; - IF timeval.usec < 0 THEN - toomanysecs := timeval.usec DIV usecsPerSec; - IF toomanysecs > timeval.second THEN - timeval.second := - toomanysecs + MAX(Scales.Value) + 1 + - timeval.second; - DEC(timeval.epoch); - ELSE - DEC(timeval.second, toomanysecs); - END; - timeval.usec := timeval.usec MOD usecsPerSec; - ELSIF timeval.usec >= usecsPerSec THEN - secs := timeval.usec DIV usecsPerSec; - IF MAX(Scales.Value) - timeval.second <= secs THEN - INC(timeval.second, secs); - ELSE - timeval.second := secs - (MAX(Scales.Value) - timeval.second); - INC(timeval.epoch); - END; - timeval.usec := timeval.usec MOD usecsPerSec; - END; - END Normalize; - PROCEDURE SetValue*(time: Time; value: TimeValueRec); - VAR - refTime: Time; - scaleOfTime: Scales.Scale; - BEGIN - Normalize(value); - IF time IS ReferenceTime THEN - WITH time: ReferenceTime DO - time.timeval := value; - END; + (* ==== private datatypes for the reference scale *) + TYPE + ReferenceTime = POINTER TO ReferenceTimeRec; + ReferenceTimeRec = + RECORD + (TimeRec) + timeval: TimeValueRec; + END; + VAR + absType, relType: Services.Type; + CONST + epochUnit = 0; secondUnit = 1; usecUnit = 2; + TYPE + Unit = POINTER TO UnitRec; + UnitRec = + RECORD + (Scales.UnitRec) + index: SHORTINT; (* epochUnit..usecUnit *) + END; + + VAR + scale*: Scales.Scale; (* reference scale *) + family*: Scales.Family; (* family of time scales *) + if: Scales.Interface; + + PROCEDURE Create*(VAR time: Time; type: SHORTINT); + (* type = absolute or relative *) + VAR + m: Scales.Measure; + BEGIN + Scales.CreateMeasure(scale, m, type); + time := m(Time); + END Create; + + PROCEDURE Normalize(VAR timeval: TimeValueRec); + (* make sure that second and usec >= 0 *) + VAR + toomanysecs: Scales.Value; + secs: Scales.Value; + BEGIN + IF timeval.second < 0 THEN + INC(timeval.second, 1); + INC(timeval.second, MAX(Scales.Value)); + DEC(timeval.epoch); + END; + IF timeval.usec < 0 THEN + toomanysecs := timeval.usec DIV usecsPerSec; + IF toomanysecs > timeval.second THEN + timeval.second := - toomanysecs + MAX(Scales.Value) + 1 + + timeval.second; + DEC(timeval.epoch); ELSE - Create(refTime, Scales.MeasureType(time)); - refTime(ReferenceTime).timeval := value; - Scales.GetScale(time, scaleOfTime); - Scales.ConvertMeasure(scaleOfTime, SYSTEM.VAL(Scales.Measure, refTime)); - Operations.Copy(refTime, time); + DEC(timeval.second, toomanysecs); END; - END SetValue; - - PROCEDURE CreateAndSet*(VAR time: Time; type: SHORTINT; - epoch, second, usec: Scales.Value); - VAR - timeval: TimeValueRec; - BEGIN - Create(time, type); - timeval.epoch := epoch; timeval.second := second; timeval.usec := usec; - SetValue(time, timeval); - END CreateAndSet; - - PROCEDURE GetValue*(time: Time; VAR value: TimeValueRec); - BEGIN - IF ~(time IS ReferenceTime) THEN - Scales.ConvertMeasure(scale, SYSTEM.VAL(Scales.Measure, time)); - END; - value := time(ReferenceTime).timeval; - END GetValue; - - (* ===== interface procedures =================================== *) - - PROCEDURE InternalCreate(scale: Scales.Scale; - VAR measure: Scales.Measure; abs: BOOLEAN); - VAR - time: ReferenceTime; - BEGIN - NEW(time); - time.timeval.epoch := 0; - time.timeval.second := 0; - time.timeval.usec := 0; - IF abs THEN - PersistentObjects.Init(time, absType); + timeval.usec := timeval.usec MOD usecsPerSec; + ELSIF timeval.usec >= usecsPerSec THEN + secs := timeval.usec DIV usecsPerSec; + IF MAX(Scales.Value) - timeval.second <= secs THEN + INC(timeval.second, secs); ELSE - PersistentObjects.Init(time, relType); + timeval.second := secs - (MAX(Scales.Value) - timeval.second); + INC(timeval.epoch); END; - measure := time; - END InternalCreate; + timeval.usec := timeval.usec MOD usecsPerSec; + END; + END Normalize; - PROCEDURE InternalGetValue(measure: Scales.Measure; unit: Scales.Unit; - VAR value: Scales.Value); - BEGIN - WITH measure: ReferenceTime DO WITH unit: Unit DO - CASE unit.index OF - | epochUnit: value := measure.timeval.epoch; - | secondUnit: value := measure.timeval.second; - | usecUnit: value := measure.timeval.usec; + PROCEDURE SetValue*(time: Time; value: TimeValueRec); + VAR + refTime: Time; + measure: Scales.Measure; + scaleOfTime: Scales.Scale; + BEGIN + Normalize(value); + IF time IS ReferenceTime THEN + WITH time: ReferenceTime DO + time.timeval := value; + END; ELSE - END; - END; END; - END InternalGetValue; + Create(refTime, Scales.MeasureType(time)); + refTime(ReferenceTime).timeval := value; + Scales.GetScale(time, scaleOfTime); + measure := refTime; + Scales.ConvertMeasure(scaleOfTime, measure); + Operations.Copy(measure, time); + END; + END SetValue; - PROCEDURE InternalSetValue(measure: Scales.Measure; unit: Scales.Unit; - value: Scales.Value); - BEGIN - WITH measure: ReferenceTime DO WITH unit: Unit DO - CASE unit.index OF - | epochUnit: measure.timeval.epoch := value; - | secondUnit: measure.timeval.second := value; - | usecUnit: measure.timeval.usec := value; + PROCEDURE CreateAndSet*(VAR time: Time; type: SHORTINT; + epoch, second, usec: Scales.Value); + VAR + timeval: TimeValueRec; + BEGIN + Create(time, type); + timeval.epoch := epoch; timeval.second := second; timeval.usec := usec; + SetValue(time, timeval); + END CreateAndSet; + + PROCEDURE GetValue*(time: Time; VAR value: TimeValueRec); + VAR mtime: Scales.Measure; + BEGIN + IF ~(time IS ReferenceTime) THEN + Scales.ConvertMeasure(scale, mtime); time := mtime(Time) + END; + value := time(ReferenceTime).timeval; + END GetValue; + + (* ===== interface procedures =================================== *) + + PROCEDURE InternalCreate(scale: Scales.Scale; + VAR measure: Scales.Measure; abs: BOOLEAN); + VAR + time: ReferenceTime; + BEGIN + NEW(time); + time.timeval.epoch := 0; + time.timeval.second := 0; + time.timeval.usec := 0; + IF abs THEN + PersistentObjects.Init(time, absType); ELSE - END; - Normalize(measure.timeval); - END; END; - END InternalSetValue; + PersistentObjects.Init(time, relType); + END; + measure := time; + END InternalCreate; - PROCEDURE Assign(target: Scales.Measure; source: Scales.Measure); - BEGIN - WITH target: ReferenceTime DO WITH source: ReferenceTime DO - target.timeval := source.timeval; - END; END; - END Assign; - - PROCEDURE Op(op: Scales.Operation; op1, op2, result: Scales.Measure); - - PROCEDURE Add(op1, op2: TimeValueRec; VAR result: TimeValueRec); - BEGIN - result.epoch := op1.epoch + op2.epoch; - IF op1.second > MAX(Scales.Value) - op2.second THEN - INC(result.epoch); - result.second := op1.second - MAX(Scales.Value) - 1 + - op2.second; - ELSE - result.second := op1.second + op2.second; - END; - result.usec := op1.usec + op2.usec; - IF result.usec > usecsPerSec THEN - DEC(result.usec, usecsPerSec); - IF result.second = MAX(Scales.Value) THEN - result.second := 0; INC(result.epoch); - ELSE - INC(result.second); - END; - END; - END Add; - - PROCEDURE Sub(op1, op2: TimeValueRec; VAR result: TimeValueRec); - BEGIN - result.epoch := op1.epoch - op2.epoch; - IF op1.second >= op2.second THEN - result.second := op1.second - op2.second; - ELSE - DEC(result.epoch); - result.second := - op2.second + MAX(Scales.Value) + 1 + op1.second; - END; - result.usec := op1.usec - op2.usec; - IF result.usec < 0 THEN - INC(result.usec, usecsPerSec); - IF result.second = 0 THEN - result.second := MAX(Scales.Value); - DEC(result.epoch); - ELSE - DEC(result.second); - END; - END; - END Sub; - - BEGIN - WITH op1: ReferenceTime DO WITH op2: ReferenceTime DO - WITH result: ReferenceTime DO - CASE op OF - | Scales.add: Add(op1.timeval, op2.timeval, result.timeval); - | Scales.sub: Sub(op1.timeval, op2.timeval, result.timeval); - ELSE - END; - END; - END; END; - END Op; - - PROCEDURE Compare(op1, op2: Scales.Measure) : INTEGER; - - PROCEDURE ReturnVal(val1, val2: Scales.Value) : INTEGER; - BEGIN - IF val1 < val2 THEN - RETURN -1 - ELSIF val1 > val2 THEN - RETURN 1 - ELSE - RETURN 0 - END; - END ReturnVal; - - BEGIN - WITH op1: ReferenceTime DO - WITH op2: ReferenceTime DO - IF op1.timeval.epoch # op2.timeval.epoch THEN - RETURN ReturnVal(op1.timeval.epoch, op2.timeval.epoch) - ELSIF op1.timeval.second # op2.timeval.second THEN - RETURN ReturnVal(op1.timeval.second, op2.timeval.second) - ELSE - RETURN ReturnVal(op1.timeval.usec, op2.timeval.usec) - END; - END; + PROCEDURE InternalGetValue(measure: Scales.Measure; unit: Scales.Unit; + VAR value: Scales.Value); + BEGIN + WITH measure: ReferenceTime DO WITH unit: Unit DO + CASE unit.index OF + | epochUnit: value := measure.timeval.epoch; + | secondUnit: value := measure.timeval.second; + | usecUnit: value := measure.timeval.usec; + ELSE END; - RETURN 0; - END Compare; + END; END; + END InternalGetValue; - (* ========= initialization procedures ========================== *) - - PROCEDURE InitInterface; - VAR - timeType: Services.Type; - BEGIN - NEW(if); - if.create := InternalCreate; - if.getvalue := InternalGetValue; if.setvalue := InternalSetValue; - if.assign := Assign; if.op := Op; if.compare := Compare; - (* conversion procedures are not necessary *) - - PersistentObjects.RegisterType(timeType, "Times.Time", "Scales.Measure", - NIL); - END InitInterface; - - PROCEDURE CreateAbs(VAR object: PersistentObjects.Object); - VAR - measure: Scales.Measure; - BEGIN - Scales.CreateAbsMeasure(scale, measure); - object := measure; - END CreateAbs; - - PROCEDURE CreateRel(VAR object: PersistentObjects.Object); - VAR - measure: Scales.Measure; - BEGIN - Scales.CreateRelMeasure(scale, measure); - object := measure; - END CreateRel; - - PROCEDURE Write(s: Streams.Stream; - object: PersistentObjects.Object) : BOOLEAN; - BEGIN - WITH object: ReferenceTime DO - RETURN NetIO.WriteLongInt(s, object.timeval.epoch) & - NetIO.WriteLongInt(s, object.timeval.second) & - NetIO.WriteLongInt(s, object.timeval.usec) + PROCEDURE InternalSetValue(measure: Scales.Measure; unit: Scales.Unit; + value: Scales.Value); + BEGIN + WITH measure: ReferenceTime DO WITH unit: Unit DO + CASE unit.index OF + | epochUnit: measure.timeval.epoch := value; + | secondUnit: measure.timeval.second := value; + | usecUnit: measure.timeval.usec := value; + ELSE END; - END Write; + Normalize(measure.timeval); + END; END; + END InternalSetValue; - PROCEDURE Read(s: Streams.Stream; - object: PersistentObjects.Object) : BOOLEAN; - BEGIN - WITH object: ReferenceTime DO - RETURN NetIO.ReadLongInt(s, object.timeval.epoch) & - NetIO.ReadLongInt(s, object.timeval.second) & - NetIO.ReadLongInt(s, object.timeval.usec) + PROCEDURE Assign(target: Scales.Measure; source: Scales.Measure); + BEGIN + WITH target: ReferenceTime DO WITH source: ReferenceTime DO + target.timeval := source.timeval; + END; END; + END Assign; + + PROCEDURE Op(op: Scales.Operation; op1, op2, result: Scales.Measure); + + PROCEDURE Add(op1, op2: TimeValueRec; VAR result: TimeValueRec); + BEGIN + result.epoch := op1.epoch + op2.epoch; + IF op1.second > MAX(Scales.Value) - op2.second THEN + INC(result.epoch); + result.second := op1.second - MAX(Scales.Value) - 1 + + op2.second; + ELSE + result.second := op1.second + op2.second; END; - END Read; + result.usec := op1.usec + op2.usec; + IF result.usec > usecsPerSec THEN + DEC(result.usec, usecsPerSec); + IF result.second = MAX(Scales.Value) THEN + result.second := 0; INC(result.epoch); + ELSE + INC(result.second); + END; + END; + END Add; - PROCEDURE InitRefScale; + PROCEDURE Sub(op1, op2: TimeValueRec; VAR result: TimeValueRec); + BEGIN + result.epoch := op1.epoch - op2.epoch; + IF op1.second >= op2.second THEN + result.second := op1.second - op2.second; + ELSE + DEC(result.epoch); + result.second := - op2.second + MAX(Scales.Value) + 1 + op1.second; + END; + result.usec := op1.usec - op2.usec; + IF result.usec < 0 THEN + INC(result.usec, usecsPerSec); + IF result.second = 0 THEN + result.second := MAX(Scales.Value); + DEC(result.epoch); + ELSE + DEC(result.second); + END; + END; + END Sub; + BEGIN + WITH op1: ReferenceTime DO WITH op2: ReferenceTime DO + WITH result: ReferenceTime DO + CASE op OF + | Scales.add: Add(op1.timeval, op2.timeval, result.timeval); + | Scales.sub: Sub(op1.timeval, op2.timeval, result.timeval); + ELSE + END; + END; + END; END; + END Op; + + PROCEDURE Compare(op1, op2: Scales.Measure) : INTEGER; + + PROCEDURE ReturnVal(val1, val2: Scales.Value) : INTEGER; + BEGIN + IF val1 < val2 THEN + RETURN -1 + ELSIF val1 > val2 THEN + RETURN 1 + ELSE + RETURN 0 + END; + END ReturnVal; + + BEGIN + WITH op1: ReferenceTime DO + WITH op2: ReferenceTime DO + IF op1.timeval.epoch # op2.timeval.epoch THEN + RETURN ReturnVal(op1.timeval.epoch, op2.timeval.epoch) + ELSIF op1.timeval.second # op2.timeval.second THEN + RETURN ReturnVal(op1.timeval.second, op2.timeval.second) + ELSE + RETURN ReturnVal(op1.timeval.usec, op2.timeval.usec) + END; + END; + END; + RETURN 0; + END Compare; + + (* ========= initialization procedures ========================== *) + + PROCEDURE InitInterface; + VAR + timeType: Services.Type; + BEGIN + NEW(if); + if.create := InternalCreate; + if.getvalue := InternalGetValue; if.setvalue := InternalSetValue; + if.assign := Assign; if.op := Op; if.compare := Compare; + (* conversion procedures are not necessary *) + + PersistentObjects.RegisterType(timeType, "Times.Time", "Scales.Measure", + NIL); + END InitInterface; + + PROCEDURE CreateAbs(VAR object: PersistentObjects.Object); + VAR + measure: Scales.Measure; + BEGIN + Scales.CreateAbsMeasure(scale, measure); + object := measure; + END CreateAbs; + + PROCEDURE CreateRel(VAR object: PersistentObjects.Object); + VAR + measure: Scales.Measure; + BEGIN + Scales.CreateRelMeasure(scale, measure); + object := measure; + END CreateRel; + + PROCEDURE Write(s: Streams.Stream; + object: PersistentObjects.Object) : BOOLEAN; + BEGIN + WITH object: ReferenceTime DO + RETURN NetIO.WriteLongInt(s, object.timeval.epoch) & + NetIO.WriteLongInt(s, object.timeval.second) & + NetIO.WriteLongInt(s, object.timeval.usec) + END; + END Write; + + PROCEDURE Read(s: Streams.Stream; + object: PersistentObjects.Object) : BOOLEAN; + BEGIN + WITH object: ReferenceTime DO + RETURN NetIO.ReadLongInt(s, object.timeval.epoch) & + NetIO.ReadLongInt(s, object.timeval.second) & + NetIO.ReadLongInt(s, object.timeval.usec) + END; + END Read; + + PROCEDURE InitRefScale; + + VAR + poif: PersistentObjects.Interface; + + PROCEDURE InitUnit(unitIndex: SHORTINT; name: Scales.UnitName); VAR - poif: PersistentObjects.Interface; + unit: Unit; + BEGIN + NEW(unit); unit.index := unitIndex; + Scales.InitUnit(scale, unit, name); + END InitUnit; - PROCEDURE InitUnit(unitIndex: SHORTINT; name: Scales.UnitName); - VAR - unit: Unit; - BEGIN - NEW(unit); unit.index := unitIndex; - Scales.InitUnit(scale, unit, name); - END InitUnit; + BEGIN + NEW(scale); Scales.Init(scale, NIL, if); + InitUnit(epochUnit, "epoch"); + InitUnit(secondUnit, "second"); + InitUnit(usecUnit, "usec"); - BEGIN - NEW(scale); Scales.Init(scale, NIL, if); - InitUnit(epochUnit, "epoch"); - InitUnit(secondUnit, "second"); - InitUnit(usecUnit, "usec"); - - NEW(poif); poif.read := Read; poif.write := Write; - poif.create := CreateAbs; poif.createAndRead := NIL; - PersistentObjects.RegisterType(absType, - "Times.AbsReferenceTime", "Times.Time", poif); - NEW(poif); poif.read := Read; poif.write := Write; - poif.create := CreateRel; poif.createAndRead := NIL; - PersistentObjects.RegisterType(relType, - "Times.RelReferenceTime", "Times.Time", poif); - END InitRefScale; + NEW(poif); poif.read := Read; poif.write := Write; + poif.create := CreateAbs; poif.createAndRead := NIL; + PersistentObjects.RegisterType(absType, + "Times.AbsReferenceTime", "Times.Time", poif); + NEW(poif); poif.read := Read; poif.write := Write; + poif.create := CreateRel; poif.createAndRead := NIL; + PersistentObjects.RegisterType(relType, + "Times.RelReferenceTime", "Times.Time", poif); + END InitRefScale; BEGIN - InitInterface; - InitRefScale; - NEW(family); Scales.InitFamily(family, scale); + InitInterface; + InitRefScale; + NEW(family); Scales.InitFamily(family, scale); END ulmTimes. diff --git a/src/library/ulm/ulmTypes.Mod b/src/library/ulm/ulmTypes.Mod index c9d6f4fe..93bab9fc 100644 --- a/src/library/ulm/ulmTypes.Mod +++ b/src/library/ulm/ulmTypes.Mod @@ -50,15 +50,8 @@ MODULE ulmTypes; IMPORT SYS := SYSTEM; TYPE - Address* = LONGINT (*SYS.ADDRESS*); - (* ulm compiler can accept - VAR p : SYSTEM.ADDRESS; // SYSTEM.PTR in ETH and V4 versions - ... - p := SYSTEM.ADR(something); - and this is how it is used in ulm oberon system library, - while SYSTEM.ADR returns LONGINT in ETH and V4 versions. - Thus I leave it as LONGINT for now, before coming up with better solution -- noch *) - + Address* = SYS.ADDRESS; + UntracedAddress* = POINTER[1] TO UntracedAddressDesc; (*SYS.UNTRACEDADDRESS;*) UntracedAddressDesc* = RECORD[1] END; diff --git a/src/system/Platformunix.Mod b/src/system/Platformunix.Mod index 1ef21940..288fc04b 100644 --- a/src/system/Platformunix.Mod +++ b/src/system/Platformunix.Mod @@ -75,6 +75,7 @@ PROCEDURE -ECONNREFUSED(): ErrorCode 'ECONNREFUSED'; PROCEDURE -ECONNABORTED(): ErrorCode 'ECONNABORTED'; PROCEDURE -ENETUNREACH(): ErrorCode 'ENETUNREACH'; PROCEDURE -EHOSTUNREACH(): ErrorCode 'EHOSTUNREACH'; +PROCEDURE -EINTR(): ErrorCode 'EINTR'; @@ -92,15 +93,18 @@ PROCEDURE Inaccessible*(e: ErrorCode): BOOLEAN; BEGIN RETURN (e = EACCES()) OR (e = EROFS()) OR (e = EAGAIN()) END Inaccessible; PROCEDURE Absent*(e: ErrorCode): BOOLEAN; -BEGIN RETURN (e = ENOENT()) END Absent; +BEGIN RETURN e = ENOENT() END Absent; PROCEDURE TimedOut*(e: ErrorCode): BOOLEAN; -BEGIN RETURN (e = ETIMEDOUT()) END TimedOut; +BEGIN RETURN e = ETIMEDOUT() END TimedOut; PROCEDURE ConnectionFailed*(e: ErrorCode): BOOLEAN; BEGIN RETURN (e = ECONNREFUSED()) OR (e = ECONNABORTED()) OR (e = ENETUNREACH()) OR (e = EHOSTUNREACH()) END ConnectionFailed; +PROCEDURE Interrupted*(e: ErrorCode): BOOLEAN; +BEGIN RETURN e = EINTR() END Interrupted; + diff --git a/src/system/Platformwindows.Mod b/src/system/Platformwindows.Mod index f91415c5..a538fdc5 100644 --- a/src/system/Platformwindows.Mod +++ b/src/system/Platformwindows.Mod @@ -72,6 +72,7 @@ PROCEDURE -ECONNREFUSED(): ErrorCode 'WSAECONNREFUSED'; PROCEDURE -ECONNABORTED(): ErrorCode 'WSAECONNABORTED'; PROCEDURE -ENETUNREACH(): ErrorCode 'WSAENETUNREACH'; PROCEDURE -EHOSTUNREACH(): ErrorCode 'WSAEHOSTUNREACH'; +PROCEDURE -EINTR(): ErrorCode 'WSAEINTR'; @@ -100,6 +101,9 @@ PROCEDURE ConnectionFailed*(e: ErrorCode): BOOLEAN; BEGIN RETURN (e = ECONNREFUSED()) OR (e = ECONNABORTED()) OR (e = ENETUNREACH()) OR (e = EHOSTUNREACH()) END ConnectionFailed; +PROCEDURE Interrupted*(e: ErrorCode): BOOLEAN; +BEGIN RETURN e = EINTR() END Interrupted; + (* OS memory allocaton *) diff --git a/src/tools/make/oberon.mk b/src/tools/make/oberon.mk index 1d3fd191..16311bd0 100644 --- a/src/tools/make/oberon.mk +++ b/src/tools/make/oberon.mk @@ -209,20 +209,20 @@ ooc: @printf "\nMaking ooc library\n" cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocLowReal.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocLowLReal.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocRealMath.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocOakMath.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocLRealMath.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocRealMath.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocOakMath.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocLRealMath.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocLongInts.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocComplexMath.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocLComplexMath.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocComplexMath.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocLComplexMath.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocAscii.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocCharClass.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocStrings.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocConvTypes.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocLRealConv.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocLRealStr.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocRealConv.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocRealStr.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocLRealConv.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocLRealStr.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocRealConv.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocRealStr.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocIntConv.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocIntStr.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocMsg.Mod @@ -232,7 +232,7 @@ ooc: cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocStrings2.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocRts.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocFilenames.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocTextRider.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocTextRider.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocBinaryRider.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocJulianDay.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocFilenames.Mod @@ -255,52 +255,52 @@ ulm: cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmSYSTEM.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmEvents.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmProcess.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmResources.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmForwarders.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmRelatedEvents.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmResources.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmForwarders.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmRelatedEvents.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmTypes.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmStreams.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmStrings.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmStreams.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmStrings.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmSysTypes.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmTexts.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmSysConversions.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmErrors.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmSysErrors.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmSysStat.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmTexts.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmSysConversions.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmErrors.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmSysErrors.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmSysStat.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmASCII.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmSets.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmIO.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmAssertions.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmIndirectDisciplines.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmStreamDisciplines.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmAssertions.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmIndirectDisciplines.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmStreamDisciplines.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmIEEE.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmMC68881.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmReals.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmPrint.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmWrite.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmConstStrings.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmPlotters.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmSysIO.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmLoader.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmNetIO.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmPersistentObjects.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmPersistentDisciplines.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmOperations.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmScales.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmTimes.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmClocks.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmTimers.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmConditions.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmStreamConditions.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmTimeConditions.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmCiphers.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmCipherOps.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmBlockCiphers.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmAsymmetricCiphers.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmConclusions.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmRandomGenerators.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmTCrypt.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmIntOperations.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmPrint.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmWrite.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmConstStrings.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmPlotters.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmSysIO.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmLoader.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmNetIO.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmPersistentObjects.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmPersistentDisciplines.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmOperations.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmScales.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmTimes.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmClocks.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmTimers.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmConditions.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmStreamConditions.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmTimeConditions.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmCiphers.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmCipherOps.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmBlockCiphers.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmAsymmetricCiphers.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmConclusions.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmRandomGenerators.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmTCrypt.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmIntOperations.Mod pow32: @printf "\nMaking pow library\n" @@ -311,7 +311,7 @@ misc: cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/system/Oberon.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/misc/crt.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/misc/Listen.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/misc/MersenneTwister.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/misc/MersenneTwister.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/misc/MultiArrays.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/misc/MultiArrayRiders.Mod @@ -327,13 +327,13 @@ s3: cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethZlibReaders.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethZlibWriters.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethZip.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethRandomNumbers.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethRandomNumbers.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethGZReaders.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethGZWriters.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethUnicode.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethDates.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethReals.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethStrings.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethReals.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethStrings.Mod librarybinary: @printf "\nMaking lib$(ONAME)\n" From 212bcd58b9dd8792dfb302b3195aeab07beb6e5a Mon Sep 17 00:00:00 2001 From: David Brown Date: Wed, 28 Sep 2016 11:38:53 +0100 Subject: [PATCH 258/580] Beginning adding -OC (large model) runtime library --- makefile | 10 +- src/compiler/Compiler.Mod | 9 +- src/compiler/OPC.Mod | 9 +- src/compiler/OPT.Mod | 34 +- src/compiler/OPV.Mod | 1 + src/compiler/extTools.Mod | 1 - src/runtime/Files.Mod | 764 +++++++++++++++++++++++++++ src/runtime/Heap.Mod | 578 +++++++++++++++++++++ src/runtime/In.Mod | 0 src/runtime/LowLReal.Mod | 486 ++++++++++++++++++ src/runtime/LowReal.Mod | 408 +++++++++++++++ src/runtime/Math.Mod | 612 ++++++++++++++++++++++ src/runtime/MathL.Mod | 562 ++++++++++++++++++++ src/runtime/Modules.Mod | 96 ++++ src/runtime/Oberon.Mod | 74 +++ src/runtime/Out.Mod | 55 ++ src/runtime/Platformunix.Mod | 552 ++++++++++++++++++++ src/runtime/Platformwindows.Mod | 622 ++++++++++++++++++++++ src/runtime/Reals.Mod | 136 +++++ src/runtime/Strings.Mod | 156 ++++++ src/runtime/Texts.Mod | 881 ++++++++++++++++++++++++++++++++ src/system/Platformunix.Mod | 6 +- src/tools/make/oberon.mk | 300 ++++++----- 23 files changed, 6183 insertions(+), 169 deletions(-) create mode 100644 src/runtime/Files.Mod create mode 100644 src/runtime/Heap.Mod create mode 100644 src/runtime/In.Mod create mode 100644 src/runtime/LowLReal.Mod create mode 100644 src/runtime/LowReal.Mod create mode 100644 src/runtime/Math.Mod create mode 100644 src/runtime/MathL.Mod create mode 100644 src/runtime/Modules.Mod create mode 100644 src/runtime/Oberon.Mod create mode 100644 src/runtime/Out.Mod create mode 100644 src/runtime/Platformunix.Mod create mode 100644 src/runtime/Platformwindows.Mod create mode 100644 src/runtime/Reals.Mod create mode 100644 src/runtime/Strings.Mod create mode 100644 src/runtime/Texts.Mod diff --git a/makefile b/makefile index df72a78b..5202abb7 100644 --- a/makefile +++ b/makefile @@ -156,13 +156,14 @@ full: configuration @printf "\n\n--- Compiler build successfull ---\n\n" @make -f src/tools/make/oberon.mk -s browsercmd MODEL=2 @printf "\n\n--- Library build started ---\n\n" - @make -f src/tools/make/oberon.mk -s library MODEL=2 + @make -f src/tools/make/oberon.mk -s O2library + @make -f src/tools/make/oberon.mk -s OakwoodLibrary MODEL=C @printf "\n\n--- Library build successfull ---\n\n" @make -f src/tools/make/oberon.mk -s sourcechanges - @make -f src/tools/make/oberon.mk -s install MODEL=2 + @make -f src/tools/make/oberon.mk -s install @printf "\n\n--- Confidence tests started ---\n\n" @make -f src/tools/make/oberon.mk -s confidence MODEL=2 - @make -f src/tools/make/oberon.mk -s showpath MODEL=2 + @make -f src/tools/make/oberon.mk -s showpath assemble: @@ -190,7 +191,8 @@ browsercmd: configuration # library: build all directories under src/library library: configuration - @make -f src/tools/make/oberon.mk -s library MODEL=2 + @make -f src/tools/make/oberon.mk -s O2library + @make -f src/tools/make/oberon.mk -s OakwoodLibrary MODEL=C # Individual library components v4: configuration diff --git a/src/compiler/Compiler.Mod b/src/compiler/Compiler.Mod index f27fd578..e5acdac7 100644 --- a/src/compiler/Compiler.Mod +++ b/src/compiler/Compiler.Mod @@ -66,7 +66,14 @@ MODULE Compiler; (* J. Templ 3.2.95 *) OPT.sintobj.typ := OPT.sinttyp; OPT.intobj.typ := OPT.inttyp; - OPT.lintobj.typ := OPT.linttyp + OPT.lintobj.typ := OPT.linttyp; + + (* Enable or disable (non-system) BYTE type *) + IF OPM.Model = "C" THEN + OPT.cpbytetyp.strobj.name[4] := 0X (* Enable Component Pascal non-system BYTE type *) + ELSE + OPT.cpbytetyp.strobj.name[4] := '@' (* Disable Component Pascal non-system BYTE type *) + END END PropagateElementaryTypeSizes; diff --git a/src/compiler/OPC.Mod b/src/compiler/OPC.Mod index 4f4839c5..e0313bbe 100644 --- a/src/compiler/OPC.Mod +++ b/src/compiler/OPC.Mod @@ -821,10 +821,11 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) GenHeaderMsg; OPM.WriteLn; - (* Define adjustable type sizes *) - OPM.WriteString("#define INTEGER int"); OPM.WriteInt(OPT.inttyp.size*8); OPM.WriteLn; - OPM.WriteString("#define LONGINT int"); OPM.WriteInt(OPT.linttyp.size*8); OPM.WriteLn; - OPM.WriteString("#define SET uint"); OPM.WriteInt(OPT.settyp.size*8); OPM.WriteLn; + (* Define model dependent type sizes *) + OPM.WriteString("#define SHORTINT int"); OPM.WriteInt(OPT.sinttyp.size*8); OPM.WriteLn; + OPM.WriteString("#define INTEGER int"); OPM.WriteInt(OPT.inttyp.size*8); OPM.WriteLn; + OPM.WriteString("#define LONGINT int"); OPM.WriteInt(OPT.linttyp.size*8); OPM.WriteLn; + OPM.WriteString("#define SET uint"); OPM.WriteInt(OPT.settyp.size*8); OPM.WriteLn; OPM.WriteLn; Include(BasicIncludeFile); diff --git a/src/compiler/OPT.Mod b/src/compiler/OPT.Mod index ad3afe73..3732b2cb 100644 --- a/src/compiler/OPT.Mod +++ b/src/compiler/OPT.Mod @@ -151,13 +151,12 @@ CONST VAR topScope*: Object; - undftyp*, - bytetyp*, booltyp*, chartyp*, - sinttyp*, inttyp*, linttyp*, hinttyp*, - adrtyp*, - int8typ*, int16typ*, int32typ*, int64typ*, - realtyp*, lrltyp*, settyp*, stringtyp*, - niltyp*, notyp*, sysptrtyp*: Struct; + undftyp*, niltyp*, notyp*, + bytetyp*, cpbytetyp*, booltyp*, chartyp*, + sinttyp*, inttyp*, linttyp*, hinttyp*, + int8typ*, int16typ*, int32typ*, int64typ*, + realtyp*, lrltyp*, settyp*, stringtyp*, + adrtyp*, sysptrtyp*: Struct; sintobj*, intobj*, lintobj*: Object; @@ -1295,13 +1294,13 @@ BEGIN topScope := NIL; OpenScope(0, NIL); OPM.errpos := 0; InitStruct(niltyp, NilTyp); (*initialization of module SYSTEM*) - EnterTyp("BYTE", Byte, 1, bytetyp); + EnterTyp("BYTE", Byte, 1, bytetyp); EnterTyp("PTR", Pointer, -1, sysptrtyp); (* Size set in Compiler.PropagateElementaryTypeSize *) EnterTyp("ADDRESS", Int, -1, adrtyp); (* Size set in Compiler.PropagateElementaryTypeSize *) - EnterTyp("INT8", Int, 1, int8typ); - EnterTyp("INT16", Int, 2, int16typ); - EnterTyp("INT32", Int, 4, int32typ); - EnterTyp("INT64", Int, 8, int64typ); + EnterTyp("INT8", Int, 1, int8typ); + EnterTyp("INT16", Int, 2, int16typ); + EnterTyp("INT32", Int, 4, int32typ); + EnterTyp("INT64", Int, 8, int64typ); EnterProc("ADR", adrfn); EnterProc("CC", ccfn); @@ -1320,12 +1319,13 @@ BEGIN topScope := NIL; OpenScope(0, NIL); OPM.errpos := 0; universe := topScope; topScope^.right := NIL; - EnterTyp("BOOLEAN", Bool, 1, booltyp); - EnterTyp("CHAR", Char, 1, chartyp); + EnterTyp("BOOLEAN", Bool, 1, booltyp); + EnterTyp("CHAR", Char, 1, chartyp); EnterTyp("SET", Set, -1, settyp); (* Size set in Compiler.PropagateElementaryTypeSize *) - EnterTyp("REAL", Real, 4, realtyp); - EnterTyp("LONGREAL", LReal, 8, lrltyp); - EnterTyp("HUGEINT", Int, 8, hinttyp); + EnterTyp("REAL", Real, 4, realtyp); + EnterTyp("LONGREAL", LReal, 8, lrltyp); + EnterTyp("HUGEINT", Int, 8, hinttyp); + EnterTyp("BYTE@", Int, 1, cpbytetyp); (* Component Pascal byte type, enabled in Compiler.PropagateElementaryTypeSize *) EnterTypeAlias("SHORTINT", sintobj); EnterTypeAlias("INTEGER", intobj); diff --git a/src/compiler/OPV.Mod b/src/compiler/OPV.Mod index 34d1ef34..39bfeded 100644 --- a/src/compiler/OPV.Mod +++ b/src/compiler/OPV.Mod @@ -137,6 +137,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 (* mark basic types as predefined, OPC.Ident can avoid qualification*) OPT.chartyp^.strobj^.linkadr := PredefinedType; + OPT.cpbytetyp^.strobj^.linkadr := PredefinedType; OPT.settyp^.strobj^.linkadr := PredefinedType; OPT.realtyp^.strobj^.linkadr := PredefinedType; OPT.adrtyp^.strobj^.linkadr := PredefinedType; diff --git a/src/compiler/extTools.Mod b/src/compiler/extTools.Mod index f158fd60..077fb5a5 100644 --- a/src/compiler/extTools.Mod +++ b/src/compiler/extTools.Mod @@ -76,4 +76,3 @@ PROCEDURE LinkMain*(VAR moduleName: ARRAY OF CHAR; statically: BOOLEAN; addition END extTools. -, \ No newline at end of file diff --git a/src/runtime/Files.Mod b/src/runtime/Files.Mod new file mode 100644 index 00000000..7e497627 --- /dev/null +++ b/src/runtime/Files.Mod @@ -0,0 +1,764 @@ +MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files *) + + IMPORT SYSTEM, Platform, Heap, Strings, Out; + + (* standard data type I/O + + little endian, + Sint:1, Int:2, Lint:4 + ORD({0}) = 1, + false = 0, true =1 + IEEE real format, + null terminated strings, + compact numbers according to M.Odersky *) + + + CONST + nofbufs = 4; + bufsize = 4096; + noDesc = -1; + notDone = -1; + + (* file states *) + open = 0; (* OS File has been opened *) + create = 1; (* OS file needs to be created *) + close = 2; (* Register telling Create to use registerName directly: + i.e. since we're closing and all data is still in + buffers bypass writing to temp file and then renaming + and just write directly to fianl register name *) + + + TYPE + FileName = ARRAY 101 OF CHAR; + File* = POINTER TO FileDesc; + Buffer = POINTER TO BufDesc; + + FileDesc = RECORD + workName: FileName; + registerName: FileName; + tempFile: BOOLEAN; + identity: Platform.FileIdentity; + fd-: Platform.FileHandle; + len, pos: LONGINT; + bufs: ARRAY nofbufs OF Buffer; + swapper: INTEGER; + state: INTEGER; + next: File; + END; + + BufDesc = RECORD + f: File; + chg: BOOLEAN; + org: LONGINT; + size: LONGINT; + data: ARRAY bufsize OF SYSTEM.BYTE + END; + + Rider* = RECORD + res*: LONGINT; + eof*: BOOLEAN; + buf: Buffer; + org: LONGINT; + offset: LONGINT + END; + + + VAR + files: File; (* List of files that have an OS file handle/descriptor assigned *) + tempno: INTEGER; + HOME: ARRAY 1024 OF CHAR; + SearchPath: POINTER TO ARRAY OF CHAR; + + + + + PROCEDURE -IdxTrap "__HALT(-1)"; + + PROCEDURE^ Finalize(o: SYSTEM.PTR); + + PROCEDURE Err(s: ARRAY OF CHAR; f: File; errcode: Platform.ErrorCode); + BEGIN + Out.Ln; Out.String("-- "); Out.String(s); Out.String(": "); + IF f # NIL THEN + IF f.registerName # "" THEN Out.String(f.registerName) ELSE Out.String(f.workName) END; + IF f.fd # 0 THEN Out.String("f.fd = "); Out.Int(f.fd,1) END + END; + IF errcode # 0 THEN Out.String(" errcode = "); Out.Int(errcode, 1) END; + Out.Ln; + HALT(99) + END Err; + + PROCEDURE MakeFileName(dir, name: ARRAY OF CHAR; VAR dest: ARRAY OF CHAR); + VAR i, j: INTEGER; + BEGIN i := 0; j := 0; + WHILE dir[i] # 0X DO dest[i] := dir[i]; INC(i) END; + IF dest[i-1] # "/" THEN dest[i] := "/"; INC(i) END; + WHILE name[j] # 0X DO dest[i] := name[j]; INC(i); INC(j) END; + dest[i] := 0X + END MakeFileName; + + PROCEDURE GetTempName(finalName: ARRAY OF CHAR; VAR name: ARRAY OF CHAR); + VAR n, i, j: LONGINT; + BEGIN + INC(tempno); n := tempno; i := 0; + IF finalName[0] # "/" THEN (* relative pathname *) + WHILE Platform.CWD[i] # 0X DO name[i] := Platform.CWD[i]; INC(i) END; + IF Platform.CWD[i-1] # "/" THEN name[i] := "/"; INC(i) END + END; + j := 0; + WHILE finalName[j] # 0X DO name[i] := finalName[j]; INC(i); INC(j) END; + DEC(i); + WHILE name[i] # "/" DO DEC(i) END; + name[i+1] := "."; name[i+2] := "t"; name[i+3] := "m"; name[i+4] := "p"; name[i+5] := "."; INC(i, 6); + WHILE n > 0 DO name[i] := CHR(n MOD 10 + ORD("0")); n := n DIV 10; INC(i) END; + name[i] := "."; INC(i); n := Platform.PID; + WHILE n > 0 DO name[i] := CHR(n MOD 10 + ORD("0")); n := n DIV 10; INC(i) END; + name[i] := 0X + END GetTempName; + + PROCEDURE Create(f: File); + VAR + identity: Platform.FileIdentity; + done: BOOLEAN; + error: Platform.ErrorCode; + err: ARRAY 32 OF CHAR; + BEGIN + (* + Out.String("Files.Create fd = "); Out.Int(f.fd,1); + Out.String(", registerName = "); Out.String(f.registerName); + Out.String(", workName = "); Out.String(f.workName); + Out.String(", state = "); Out.Int(f.state,1); + Out.Ln; + *) + IF f.fd = noDesc THEN + IF f.state = create THEN + GetTempName(f.registerName, f.workName); f.tempFile := TRUE + ELSIF f.state = close THEN + f.workName := f.registerName; f.registerName := ""; f.tempFile := FALSE + END; + error := Platform.Unlink(f.workName); (*unlink first to avoid stale NFS handles and to avoid reuse of inodes*) + + error := Platform.New(f.workName, f.fd); + done := error = 0; + IF done THEN + f.next := files; files := f; + INC(Heap.FileCount); + Heap.RegisterFinalizer(f, Finalize); + f.state := open; + f.pos := 0; + error := Platform.Identify(f.fd, f.identity); + ELSE + IF Platform.NoSuchDirectory(error) THEN err := "no such directory" + ELSIF Platform.TooManyFiles(error) THEN err := "too many files open" + ELSE err := "file not created" + END; + Err(err, f, error) + END + END + END Create; + + PROCEDURE Flush(buf: Buffer); + VAR + error: Platform.ErrorCode; + f: File; + (* identity: Platform.FileIdentity; *) + BEGIN + (* + Out.String("Files.Flush buf.f.registername = "); Out.String(buf.f.registerName); + Out.String(", buf.f.fd = "); Out.Int(buf.f.fd,1); + Out.String(", buffer at $"); Out.Hex(SYSTEM.ADR(buf.data)); + Out.String(", size "); Out.Int(buf.size,1); Out.Ln; + *) + IF buf.chg THEN f := buf.f; Create(f); + IF buf.org # f.pos THEN + error := Platform.Seek(f.fd, buf.org, Platform.SeekSet); + (* + Out.String("Seeking to "); Out.Int(buf.org,1); + Out.String(", error code "); Out.Int(error,1); Out.Ln; + *) + END; + error := Platform.Write(f.fd, SYSTEM.ADR(buf.data), buf.size); + IF error # 0 THEN Err("error writing file", f, error) END; + f.pos := buf.org + buf.size; + buf.chg := FALSE; + error := Platform.Identify(f.fd, f.identity); + IF error # 0 THEN Err("error identifying file", f, error) END; + (* + error := Platform.Identify(f.fd, identity); + f.identity.mtime := identity.mtime; + *) + END + END Flush; + + + PROCEDURE CloseOSFile(f: File); + (* Close the OS file handle and remove f from 'files' *) + VAR prev: File; error: Platform.ErrorCode; + BEGIN + IF files = f THEN files := f.next + ELSE + prev := files; + WHILE (prev # NIL) & (prev.next # f) DO prev := prev.next END; + IF prev.next # NIL THEN prev.next := f.next END + END; + error := Platform.Close(f.fd); + f.fd := noDesc; f.state := create; DEC(Heap.FileCount); + END CloseOSFile; + + + PROCEDURE Close* (f: File); + VAR + i: LONGINT; + error: Platform.ErrorCode; + BEGIN + IF (f.state # create) OR (f.registerName # "") THEN + Create(f); i := 0; + WHILE (i < nofbufs) & (f.bufs[i] # NIL) DO Flush(f.bufs[i]); INC(i) END; + error := Platform.Sync(f.fd); + IF error # 0 THEN Err("error writing file", f, error) END; + CloseOSFile(f); + END + END Close; + + PROCEDURE Length* (f: File): LONGINT; + BEGIN RETURN f.len END Length; + + PROCEDURE New* (name: ARRAY OF CHAR): File; + VAR f: File; + BEGIN + NEW(f); f.workName := ""; COPY(name, f.registerName); + f.fd := noDesc; f.state := create; f.len := 0; f.pos := 0; f.swapper := -1; (*all f.buf[i] = NIL*) + RETURN f + END New; + + PROCEDURE ScanPath(VAR pos: INTEGER; VAR dir: ARRAY OF CHAR); + (* Extract next individual directory from searchpath starting at pos, + updating pos and returning dir. + Supports ~, ~user and blanks inside path *) + VAR i: INTEGER; ch: CHAR; + BEGIN + i := 0; + IF SearchPath = NIL THEN + IF pos = 0 THEN + dir[0] := "."; i := 1; INC(pos) (* Default search path is just the current directory *) + END + ELSE + ch := SearchPath[pos]; + WHILE (ch = " ") OR (ch = ";") DO INC(pos); ch := SearchPath[pos] END; + IF ch = "~" THEN + INC(pos); ch := SearchPath[pos]; + WHILE HOME[i] # 0X DO dir[i] := HOME[i]; INC(i) END; + IF (ch # "/") & (ch # 0X) & (ch # ";") & (ch # " ") THEN + WHILE (i > 0) & (dir[i-1] # "/") DO DEC(i) END + END + END; + WHILE (ch # 0X) & (ch # ";") DO dir[i] := ch; INC(i); INC(pos); ch := SearchPath[pos] END; + WHILE (i > 0) & (dir[i-1] = " ") DO DEC(i) END + END; + dir[i] := 0X + END ScanPath; + + PROCEDURE HasDir(VAR name: ARRAY OF CHAR): BOOLEAN; + VAR i: INTEGER; ch: CHAR; + BEGIN i := 0; ch := name[0]; + WHILE (ch # 0X) & (ch # "/") DO INC(i); ch := name[i] END; + RETURN ch = "/" + END HasDir; + + PROCEDURE CacheEntry(identity: Platform.FileIdentity): File; + VAR f: File; i: INTEGER; error: Platform.ErrorCode; + BEGIN f := files; + WHILE f # NIL DO + IF Platform.SameFile(identity, f.identity) THEN + IF ~Platform.SameFileTime(identity, f.identity) THEN i := 0; + WHILE i < nofbufs DO + IF f.bufs[i] # NIL THEN f.bufs[i].org := -1; f.bufs[i] := NIL END; + INC(i) + END; + f.swapper := -1; f.identity := identity; + error := Platform.Size(f.fd, f.len); + END; + RETURN f + END; + f := f.next + END; + RETURN NIL + END CacheEntry; + + PROCEDURE Old*(name: ARRAY OF CHAR): File; + VAR + f: File; + fd: Platform.FileHandle; + pos: INTEGER; + done: BOOLEAN; + dir, path: ARRAY 256 OF CHAR; + error: Platform.ErrorCode; + identity: Platform.FileIdentity; + BEGIN + (* Out.String("Files.Old "); Out.String(name); Out.Ln; *) + IF name # "" THEN + IF HasDir(name) THEN dir := ""; COPY(name, path) + ELSE pos := 0; ScanPath(pos, dir); MakeFileName(dir, name, path); ScanPath(pos, dir) + END; + LOOP + error := Platform.OldRW(path, fd); done := error = 0; + IF ~done & Platform.TooManyFiles(error) THEN Err("too many files open", f, error) END; + IF ~done & Platform.Inaccessible(error) THEN + error := Platform.OldRO(path, fd); done := error = 0; + END; + IF ~done & ~Platform.Absent(error) THEN + Out.String("Warning: Files.Old "); Out.String(name); + Out.String(" error = "); Out.Int(error, 0); Out.Ln; + END; + IF done THEN + (* Out.String(" fd = "); Out.Int(fd,1); Out.Ln; *) + error := Platform.Identify(fd, identity); + f := CacheEntry(identity); + IF f # NIL THEN + (* error := Platform.Close(fd); DCWB: Either this should be removed or should call CloseOSFile. *) + RETURN f + ELSE NEW(f); Heap.RegisterFinalizer(f, Finalize); + f.fd := fd; f.state := open; f.pos := 0; f.swapper := -1; (*all f.buf[i] = NIL*) + error := Platform.Size(fd, f.len); + COPY(name, f.workName); f.registerName := ""; f.tempFile := FALSE; + f.identity := identity; + f.next := files; files := f; INC(Heap.FileCount); + RETURN f + END + ELSIF dir = "" THEN RETURN NIL + ELSE MakeFileName(dir, name, path); ScanPath(pos, dir) + END + END + ELSE RETURN NIL + END + END Old; + + PROCEDURE Purge* (f: File); + VAR i: INTEGER; identity: Platform.FileIdentity; error: Platform.ErrorCode; + BEGIN i := 0; + WHILE i < nofbufs DO + IF f.bufs[i] # NIL THEN f.bufs[i].org := -1; f.bufs[i] := NIL END; + INC(i) + END; + IF f.fd # noDesc THEN + error := Platform.Truncate(f.fd, 0); + error := Platform.Seek(f.fd, 0, Platform.SeekSet) + END; + f.pos := 0; f.len := 0; f.swapper := -1; + error := Platform.Identify(f.fd, identity); Platform.SetMTime(f.identity, identity) + END Purge; + + PROCEDURE GetDate* (f: File; VAR t, d: LONGINT); + VAR + identity: Platform.FileIdentity; error: Platform.ErrorCode; + BEGIN + Create(f); error := Platform.Identify(f.fd, identity); + Platform.MTimeAsClock(identity, t, d) + END GetDate; + + PROCEDURE Pos* (VAR r: Rider): LONGINT; + BEGIN RETURN r.org + r.offset + END Pos; + + PROCEDURE Set* (VAR r: Rider; f: File; pos: LONGINT); + VAR org, offset, i, n: LONGINT; buf: Buffer; error: Platform.ErrorCode; + BEGIN + IF f # NIL THEN + (* + Out.String("Files.Set rider on fd = "); Out.Int(f.fd,1); + Out.String(", registerName = "); Out.String(f.registerName); + Out.String(", workName = "); Out.String(f.workName); + Out.String(", state = "); Out.Int(f.state,1); + Out.Ln; + *) + IF pos > f.len THEN pos := f.len ELSIF pos < 0 THEN pos := 0 END; + offset := pos MOD bufsize; org := pos - offset; i := 0; + WHILE (i < nofbufs) & (f.bufs[i] # NIL) & (org # f.bufs[i].org) DO INC(i) END; + IF i < nofbufs THEN + IF f.bufs[i] = NIL THEN NEW(buf); buf.chg := FALSE; buf.org := -1; buf.f := f; f.bufs[i] := buf + ELSE buf := f.bufs[i] + END + ELSE + f.swapper := (f.swapper + 1) MOD nofbufs; + buf := f.bufs[f.swapper]; + Flush(buf) + END; + IF buf.org # org THEN + IF org = f.len THEN buf.size := 0 + ELSE Create(f); + IF f.pos # org THEN error := Platform.Seek(f.fd, org, Platform.SeekSet) END; + error := Platform.ReadBuf(f.fd, buf.data, n); + IF error # 0 THEN Err("read from file not done", f, error) END; + f.pos := org + n; + buf.size := n + END; + buf.org := org; buf.chg := FALSE + END + ELSE buf := NIL; org := 0; offset := 0 + END; + r.buf := buf; r.org := org; r.offset := offset; r.eof := FALSE; r.res := 0 + END Set; + + PROCEDURE Read* (VAR r: Rider; VAR x: SYSTEM.BYTE); + VAR offset: LONGINT; buf: Buffer; + BEGIN + buf := r.buf; offset := r.offset; + IF r.org # buf.org THEN Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset END; + IF (offset < buf.size) THEN + x := buf.data[offset]; r.offset := offset + 1 + ELSIF r.org + offset < buf.f.len THEN + Set(r, r.buf.f, r.org + offset); + x := r.buf.data[0]; r.offset := 1 + ELSE + x := 0X; r.eof := TRUE + END + END Read; + + PROCEDURE ReadBytes* (VAR r: Rider; VAR x: ARRAY OF SYSTEM.BYTE; n: LONGINT); + VAR xpos, min, restInBuf, offset: LONGINT; buf: Buffer; + BEGIN + IF n > LEN(x) THEN IdxTrap END; + xpos := 0; buf := r.buf; offset := r.offset; + WHILE n > 0 DO + IF (r.org # buf.org) OR (offset >= bufsize) THEN + Set(r, buf.f, r.org + offset); + buf := r.buf; offset := r.offset + END; + restInBuf := buf.size - offset; + IF restInBuf = 0 THEN r.res := n; r.eof := TRUE; RETURN + ELSIF n > restInBuf THEN min := restInBuf ELSE min := n END; + SYSTEM.MOVE(SYSTEM.ADR(buf.data) + offset, SYSTEM.ADR(x) + xpos, min); + INC(offset, min); r.offset := offset; INC(xpos, min); DEC(n, min) + END; + r.res := 0; r.eof := FALSE + END ReadBytes; + + PROCEDURE Base* (VAR r: Rider): File; + BEGIN RETURN r.buf.f + END Base; + + PROCEDURE Write* (VAR r: Rider; x: SYSTEM.BYTE); + VAR buf: Buffer; offset: LONGINT; + BEGIN + buf := r.buf; offset := r.offset; + IF (r.org # buf.org) OR (offset >= bufsize) THEN + Set(r, buf.f, r.org + offset); + buf := r.buf; offset := r.offset + END; + buf.data[offset] := x; + buf.chg := TRUE; + IF offset = buf.size THEN + INC(buf.size); INC(buf.f.len) + END; + r.offset := offset + 1; r.res := 0 + END Write; + + PROCEDURE WriteBytes* (VAR r: Rider; VAR x: ARRAY OF SYSTEM.BYTE; n: LONGINT); + VAR xpos, min, restInBuf, offset: LONGINT; buf: Buffer; + BEGIN + IF n > LEN(x) THEN IdxTrap END; + xpos := 0; buf := r.buf; offset := r.offset; + WHILE n > 0 DO + IF (r.org # buf.org) OR (offset >= bufsize) THEN + Set(r, buf.f, r.org + offset); + buf := r.buf; offset := r.offset + END; + restInBuf := bufsize - offset; + IF n > restInBuf THEN min := restInBuf ELSE min := n END; + SYSTEM.MOVE(SYSTEM.ADR(x) + xpos, SYSTEM.ADR(buf.data) + offset, min); + INC(offset, min); r.offset := offset; + IF offset > buf.size THEN INC(buf.f.len, offset - buf.size); buf.size := offset END; + INC(xpos, min); DEC(n, min); buf.chg := TRUE + END; + r.res := 0 + END WriteBytes; + +(* another solution would be one that is similar to ReadBytes, WriteBytes. +No code duplication, more symmetric, only two ifs for +Read and Write in buffer, buf.size replaced by bufsize in Write ops, buf.size and len +must be made consistent with offset (if offset > buf.size) in a lazy way. + +PROCEDURE Write* (VAR r: Rider; x: SYSTEM.BYTE); + VAR buf: Buffer; offset: LONGINT; +BEGIN + buf := r.buf; offset := r.offset; + IF (offset >= bufsize) OR (r.org # buf.org) THEN + Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset; + END; + buf.data[offset] := x; r.offset := offset + 1; buf.chg := TRUE +END Write; + +PROCEDURE WriteBytes ... + +PROCEDURE Read* (VAR r: Rider; VAR x: SYSTEM.BYTE); + VAR offset: LONGINT; buf: Buffer; +BEGIN + buf := r.buf; offset := r.offset; + IF (offset >= buf.size) OR (r.org # buf.org) THEN + IF r.org + offset >= buf.f.len THEN x := 0X; r.eof := TRUE; RETURN + ELSE Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset + END + END; + x := buf.data[offset]; r.offset := offset + 1 +END Read; + +but this would also affect Set, Length, and Flush. +Especially Length would become fairly complex. +*) + + PROCEDURE Delete*(name: ARRAY OF CHAR; VAR res: INTEGER); + BEGIN res := Platform.Unlink(name) END Delete; + + PROCEDURE Rename* (old, new: ARRAY OF CHAR; VAR res: INTEGER); + VAR + fdold, fdnew: Platform.FileHandle; + n: LONGINT; + error, ignore: Platform.ErrorCode; + oldidentity, newidentity: Platform.FileIdentity; + buf: ARRAY 4096 OF CHAR; + BEGIN + (* + Out.String("Files.Rename old = "); Out.String(old); + Out.String(", new = "); Out.String(new); Out.Ln; + *) + error := Platform.IdentifyByName(old, oldidentity); + IF error = 0 THEN + error := Platform.IdentifyByName(new, newidentity); + IF (error # 0) & ~Platform.SameFile(oldidentity, newidentity) THEN + Delete(new, error); (* work around stale nfs handles *) + END; + error := Platform.Rename(old, new); + (* Out.String("Platform.Rename error code "); Out.Int(error,1); Out.Ln; *) + IF ~Platform.DifferentFilesystems(error) THEN + res := error; RETURN + ELSE + (* cross device link, move the file *) + error := Platform.OldRO(old, fdold); + IF error # 0 THEN res := 2; RETURN END; + error := Platform.New(new, fdnew); + IF error # 0 THEN error := Platform.Close(fdold); res := 3; RETURN END; + error := Platform.Read(fdold, SYSTEM.ADR(buf), bufsize, n); + WHILE n > 0 DO + error := Platform.Write(fdnew, SYSTEM.ADR(buf), n); + IF error # 0 THEN + ignore := Platform.Close(fdold); + ignore := Platform.Close(fdnew); + Err("cannot move file", NIL, error) + END; + error := Platform.Read(fdold, SYSTEM.ADR(buf), bufsize, n); + END; + ignore := Platform.Close(fdold); + ignore := Platform.Close(fdnew); + IF n = 0 THEN + error := Platform.Unlink(old); res := 0 + ELSE + Err("cannot move file", NIL, error) + END; + END + ELSE + res := 2 (* old file not found *) + END + END Rename; + + PROCEDURE Register* (f: File); + VAR idx, errcode: INTEGER; f1: File; file: ARRAY 104 OF CHAR; + BEGIN + (* + Out.String("Files.Register f.registerName = "); Out.String(f.registerName); + Out.String(", fd = "); Out.Int(f.fd,1); Out.Ln; + *) + IF (f.state = create) & (f.registerName # "") THEN f.state := close (* shortcut renaming *) END; + Close(f); + IF f.registerName # "" THEN + Rename(f.workName, f.registerName, errcode); + (* + Out.String("Renamed (for register) f.fd = "); Out.Int(f.fd,1); + Out.String(" from workname "); Out.String(f.workName); + Out.String(" to registerName "); Out.String(f.registerName); + Out.String(" errorcode = "); Out.Int(errcode,1); Out.Ln; + *) + IF errcode # 0 THEN COPY(f.registerName, file); HALT(99) END; + f.workName := f.registerName; f.registerName := ""; f.tempFile := FALSE + END + END Register; + + PROCEDURE ChangeDirectory*(path: ARRAY OF CHAR; VAR res: INTEGER); + BEGIN + res := Platform.Chdir(path); + END ChangeDirectory; + + PROCEDURE FlipBytes(VAR src, dest: ARRAY OF SYSTEM.BYTE); + VAR i, j: LONGINT; + BEGIN + IF ~Platform.LittleEndian THEN i := LEN(src); j := 0; + WHILE i > 0 DO DEC(i); dest[j] := src[i]; INC(j) END + ELSE SYSTEM.MOVE(SYSTEM.ADR(src), SYSTEM.ADR(dest), LEN(src)) + END + END FlipBytes; + + PROCEDURE ReadBool* (VAR R: Rider; VAR x: BOOLEAN); + BEGIN Read(R, SYSTEM.VAL(CHAR, x)) + END ReadBool; + + PROCEDURE ReadInt* (VAR R: Rider; VAR x: INTEGER); + VAR b: ARRAY 2 OF CHAR; + BEGIN ReadBytes(R, b, 2); + x := ORD(b[0]) + ORD(b[1])*256 + END ReadInt; + + PROCEDURE ReadLInt* (VAR R: Rider; VAR x: LONGINT); + VAR b: ARRAY 4 OF CHAR; + BEGIN ReadBytes(R, b, 4); + x := ORD(b[0]) + ORD(b[1])*100H + ORD(b[2])*10000H + ORD(b[3])*1000000H + END ReadLInt; + + PROCEDURE ReadSet* (VAR R: Rider; VAR x: SET); + (* 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); + (* 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); + VAR b: ARRAY 4 OF CHAR; + BEGIN ReadBytes(R, b, 4); FlipBytes(b, x) + END ReadReal; + + PROCEDURE ReadLReal* (VAR R: Rider; VAR x: LONGREAL); + VAR b: ARRAY 8 OF CHAR; + BEGIN ReadBytes(R, b, 8); FlipBytes(b, x) + END ReadLReal; + + PROCEDURE ReadString* (VAR R: Rider; VAR x: ARRAY OF CHAR); + VAR i: INTEGER; ch: CHAR; + BEGIN i := 0; + REPEAT Read(R, ch); x[i] := ch; INC(i) UNTIL ch = 0X + END ReadString; + + PROCEDURE ReadLine* (VAR R: Rider; VAR x: ARRAY OF CHAR); + VAR i: INTEGER; ch: CHAR; b : BOOLEAN; + BEGIN + i := 0; + b := FALSE; + REPEAT + Read(R, ch); + IF ((ch = 0X) OR (ch = 0AX) OR (ch = 0DX)) THEN + b := TRUE + ELSE + x[i] := ch; + INC(i); + END; + UNTIL b + END ReadLine; + + PROCEDURE ReadNum* (VAR R: Rider; VAR x: LONGINT); + VAR s: SHORTINT; ch: CHAR; n: LONGINT; + BEGIN s := 0; n := 0; Read(R, ch); + WHILE ORD(ch) >= 128 DO INC(n, ASH(ORD(ch) - 128, s) ); INC(s, 7); Read(R, ch) END; + INC(n, ASH(ORD(ch) MOD 64 - ORD(ch) DIV 64 * 64, s) ); + x := n + END ReadNum; + + PROCEDURE ReadNum64* (VAR R: Rider; VAR x: SYSTEM.INT64); + (* todo. use proper code when INC/ASH properly support INT64 on 32 bit platforms + VAR s: SHORTINT; ch: CHAR; n: SYSTEM.INT64; + BEGIN s := 0; n := 0; Read(R, ch); + WHILE ORD(ch) >= 128 DO INC(n, ASH(ORD(ch) - 128, s) ); INC(s, 7); Read(R, ch) END; + INC(n, ASH(ORD(ch) MOD 64 - ORD(ch) DIV 64 * 64, s) ); + x := n + *) + VAR n: LONGINT; + BEGIN ReadNum(R, n); x := n + END ReadNum64; + + PROCEDURE WriteBool* (VAR R: Rider; x: BOOLEAN); + BEGIN Write(R, SYSTEM.VAL(CHAR, x)) + END WriteBool; + + PROCEDURE WriteInt* (VAR R: Rider; x: INTEGER); + VAR b: ARRAY 2 OF CHAR; + BEGIN b[0] := CHR(x); b[1] := CHR(x DIV 256); + WriteBytes(R, b, 2); + END WriteInt; + + PROCEDURE WriteLInt* (VAR R: Rider; x: LONGINT); + VAR b: ARRAY 4 OF CHAR; + BEGIN + b[0] := CHR(x); b[1] := CHR(x DIV 100H); b[2] := CHR(x DIV 10000H); b[3] := CHR(x DIV 1000000H); + WriteBytes(R, b, 4); + END WriteLInt; + + PROCEDURE WriteSet* (VAR R: Rider; x: SET); + VAR b: ARRAY 4 OF CHAR; i: LONGINT; + BEGIN i := SYSTEM.VAL(LONGINT, x); + 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; + + PROCEDURE WriteReal* (VAR R: Rider; x: REAL); + VAR b: ARRAY 4 OF CHAR; + BEGIN FlipBytes(x, b); WriteBytes(R, b, 4) + END WriteReal; + + PROCEDURE WriteLReal* (VAR R: Rider; x: LONGREAL); + VAR b: ARRAY 8 OF CHAR; + BEGIN FlipBytes(x, b); WriteBytes(R, b, 8) + END WriteLReal; + + PROCEDURE WriteString* (VAR R: Rider; x: ARRAY [1] OF CHAR); + VAR i: INTEGER; + BEGIN i := 0; + WHILE x[i] # 0X DO INC(i) END; + WriteBytes(R, x, i+1) + END WriteString; + + PROCEDURE WriteNum* (VAR R: Rider; x: LONGINT); + BEGIN + WHILE (x < - 64) OR (x > 63) DO Write(R, CHR(x MOD 128 + 128)); x := x DIV 128 END; + Write(R, CHR(x MOD 128)) + END WriteNum; + + PROCEDURE WriteNum64* (VAR R: Rider; x: SYSTEM.INT64); + BEGIN + WHILE (x < - 64) OR (x > 63) DO Write(R, CHR(x MOD 128 + 128)); x := x DIV 128 END; + Write(R, CHR(x MOD 128)) + END WriteNum64; + + PROCEDURE GetName*(f: File; VAR name: ARRAY OF CHAR); + BEGIN + COPY (f.workName, name); + END GetName; + + PROCEDURE Finalize(o: SYSTEM.PTR); + VAR f: File; res: LONGINT; + BEGIN + f := SYSTEM.VAL(File, o); + (* + Out.String("Files.Finalize f.fd = "); Out.Int(f.fd,1); + Out.String(", f.registername = "); Out.String(f.registerName); + Out.String(", f.workName = "); Out.String(f.workName); Out.Ln; + *) + IF f.fd >= 0 THEN + CloseOSFile(f); + IF f.tempFile THEN res := Platform.Unlink(f.workName) END + END + END Finalize; + + PROCEDURE SetSearchPath*(path: ARRAY OF CHAR); + BEGIN + IF Strings.Length(path) # 0 THEN + NEW(SearchPath, Strings.Length(path)+1); + COPY(path, SearchPath^) + ELSE + SearchPath := NIL + END + END SetSearchPath; + + +BEGIN + tempno := -1; + Heap.FileCount := 0; + HOME := ""; Platform.GetEnv("HOME", HOME); +END Files. diff --git a/src/runtime/Heap.Mod b/src/runtime/Heap.Mod new file mode 100644 index 00000000..b05b218b --- /dev/null +++ b/src/runtime/Heap.Mod @@ -0,0 +1,578 @@ +MODULE Heap; + + IMPORT S := SYSTEM; (* Cannot import anything else as heap initialization must complete + before any other modules are initialized. *) + + CONST + ModNameLen = 20; + CmdNameLen = 24; + SZA = SIZE(S.ADDRESS); (* Size of address *) + Unit = 4*SZA; (* smallest possible heap block *) + nofLists = 9; (* number of free_lists *) + heapSize0 = 8000*Unit; (* startup heap size *) + + (* all blocks look the same: + free blocks describe themselves: size = Unit + tag = &tag++ + ->block size + sentinel = -SZA + next + *) + + (* heap chunks *) + nextChnkOff = S.VAL(S.ADDRESS, 0); (* next heap chunk, sorted ascendingly! *) + endOff = S.VAL(S.ADDRESS, SZA); (* end of heap chunk *) + blkOff = S.VAL(S.ADDRESS, 3*SZA); (* first block in a chunk *) + + (* heap blocks *) + tagOff = S.VAL(S.ADDRESS, 0); (* block starts with tag *) + sizeOff = S.VAL(S.ADDRESS, SZA); (* block size in free block relative to block start *) + sntlOff = S.VAL(S.ADDRESS, 2*SZA); (* pointer offset table sentinel in free block relative to block start *) + nextOff = S.VAL(S.ADDRESS, 3*SZA); (* next pointer in free block relative to block start *) + NoPtrSntl = S.VAL(S.ADDRESS, -SZA); + AddressZero = S.VAL(S.ADDRESS, 0); + + TYPE + ModuleName = ARRAY ModNameLen OF CHAR; + CmdName = ARRAY CmdNameLen OF CHAR; + + Module = POINTER TO ModuleDesc; + Cmd = POINTER TO CmdDesc; + + EnumProc = PROCEDURE(P: PROCEDURE(p: S.PTR)); + + ModuleDesc = RECORD + next: Module; + name: ModuleName; + refcnt: LONGINT; + cmds: Cmd; + types: S.ADDRESS; + enumPtrs: EnumProc; + reserved1, reserved2: LONGINT + END ; + + Command = PROCEDURE; + + CmdDesc = RECORD + next: Cmd; + name: CmdName; + cmd: Command + END ; + + Finalizer = PROCEDURE(obj: S.PTR); + + FinNode = POINTER TO FinDesc; + FinDesc = RECORD + next: FinNode; + obj: S.ADDRESS; (* weak pointer *) + marked: BOOLEAN; + finalize: Finalizer; + END ; + + VAR + (* the list of loaded (=initialization started) modules *) + modules*: S.PTR; + + freeList: ARRAY nofLists + 1 OF S.ADDRESS; (* dummy, 16, 32, 48, 64, 80, 96, 112, 128, sentinel *) + bigBlocks: S.ADDRESS; + allocated*: S.ADDRESS; + firstTry: BOOLEAN; + + (* extensible heap *) + heap: S.ADDRESS; (* the sorted list of heap chunks *) + heapend: S.ADDRESS; (* max possible pointer value (used for stack collection) *) + heapsize*: S.ADDRESS; (* the sum of all heap chunk sizes *) + + (* finalization candidates *) + fin: FinNode; + + (* garbage collector locking *) + lockdepth: INTEGER; + interrupted: BOOLEAN; + + (* File system file count monitor *) + FileCount*: INTEGER; + + + PROCEDURE Lock*; + BEGIN + INC(lockdepth); + END Lock; + + PROCEDURE -PlatformHalt(code: LONGINT) "Platform_Halt(code)"; + + PROCEDURE Unlock*; + BEGIN + DEC(lockdepth); + IF interrupted & (lockdepth = 0) THEN + PlatformHalt(-9); + END + END Unlock; + + + (* + PROCEDURE TAS*(VAR flag:BOOLEAN): BOOLEAN; (* added for compatibility with ulmSYSTEM module; noch *) + VAR oldflag : BOOLEAN; + BEGIN + oldflag := flag; + flag := TRUE; + RETURN oldflag; + END TAS; + *) + + PROCEDURE REGMOD*(VAR name: ModuleName; enumPtrs: EnumProc): S.PTR; + VAR m: Module; + BEGIN + (* REGMOD is called at the start of module initialisation code before that modules + type descriptors have been set up. 'NEW' depends on the Heap modules type + descriptors being ready for use, therefore, just for the Heap module itself, we + must use S.NEW. *) + IF name = "Heap" THEN + S.NEW(m, SIZE(ModuleDesc)) + ELSE + NEW(m) + END; + m.types := 0; m.cmds := NIL; + COPY(name, m.name); m.refcnt := 0; m.enumPtrs := enumPtrs; m.next := S.VAL(Module, modules); + modules := m; + RETURN m + END REGMOD; + + PROCEDURE REGCMD*(m: Module; VAR name: CmdName; cmd: Command); + VAR c: Cmd; + BEGIN + (* REGCMD is called during module initialisation code before that modules + type descriptors have been set up. 'NEW' depends on the Heap modules type + descriptors being ready for use, therefore, just for the commands registered + by the Heap module itself, we must use S.NEW. *) + IF m.name = "Heap" THEN + S.NEW(c, SIZE(CmdDesc)) + ELSE + NEW(c) + END; + COPY(name, c.name); c.cmd := cmd; c.next := m.cmds; m.cmds := c + END REGCMD; + + PROCEDURE REGTYP*(m: Module; typ: S.ADDRESS); + BEGIN S.PUT(typ, m.types); m.types := typ + END REGTYP; + + PROCEDURE INCREF*(m: Module); + BEGIN INC(m.refcnt) + END INCREF; + + + PROCEDURE -ExternPlatformOSAllocate "extern address Platform_OSAllocate(address size);"; + PROCEDURE -OSAllocate(size: S.ADDRESS): S.ADDRESS "Platform_OSAllocate(size)"; + + PROCEDURE NewChunk(blksz: S.ADDRESS): S.ADDRESS; + VAR chnk: S.ADDRESS; + BEGIN + chnk := OSAllocate(blksz + blkOff); + IF chnk # 0 THEN + S.PUT(chnk + endOff, chnk + (blkOff + blksz)); + S.PUT(chnk + blkOff, chnk + (blkOff + sizeOff)); + S.PUT(chnk + (blkOff + sizeOff), blksz); + S.PUT(chnk + (blkOff + sntlOff), NoPtrSntl); + S.PUT(chnk + (blkOff + nextOff), bigBlocks); + bigBlocks := chnk + blkOff; + INC(heapsize, blksz) + END ; + RETURN chnk + END NewChunk; + + PROCEDURE ExtendHeap(blksz: S.ADDRESS); + VAR size, chnk, j, next: S.ADDRESS; + BEGIN + IF blksz > 10000*Unit THEN size := blksz + ELSE size := 10000*Unit (* additional heuristics *) + END ; + chnk := NewChunk(size); + IF chnk # 0 THEN + (*sorted insertion*) + IF chnk < heap THEN + S.PUT(chnk, heap); heap := chnk + ELSE + j := heap; S.GET(j, next); + WHILE (next # 0) & (chnk > next) DO + j := next; + S.GET(j, next) + END; + S.PUT(chnk, next); S.PUT(j, chnk) + END ; + IF next = 0 THEN S.GET(chnk+endOff, heapend) END + END + END ExtendHeap; + + PROCEDURE ^GC*(markStack: BOOLEAN); + + PROCEDURE NEWREC*(tag: S.ADDRESS): S.PTR; + VAR + i, i0, di, blksz, restsize, t, adr, end, next, prev: S.ADDRESS; + new: S.PTR; + BEGIN + Lock(); + S.GET(tag, blksz); + + ASSERT((Unit = 16) OR (Unit = 32)); + ASSERT(SIZE(S.PTR) = SIZE(S.ADDRESS)); + ASSERT(blksz MOD Unit = 0); + + i0 := blksz DIV Unit; i := i0; + IF i < nofLists THEN adr := freeList[i]; + WHILE adr = 0 DO INC(i); adr := freeList[i] END + END ; + IF i < nofLists THEN (* unlink *) + S.GET(adr + nextOff, next); + freeList[i] := next; + IF i # i0 THEN (* split *) + di := i - i0; restsize := di * Unit; end := adr + restsize; + S.PUT(end + sizeOff, blksz); + S.PUT(end + sntlOff, NoPtrSntl); + S.PUT(end, end + sizeOff); + S.PUT(adr + sizeOff, restsize); + S.PUT(adr + nextOff, freeList[di]); + freeList[di] := adr; + INC(adr, restsize) + END + ELSE + adr := bigBlocks; prev := 0; + LOOP + IF adr = 0 THEN + IF firstTry THEN + GC(TRUE); INC(blksz, Unit); + IF (heapsize - allocated - blksz) * 4 < heapsize THEN + (* heap is still almost full; expand to avoid thrashing *) + ExtendHeap((allocated + blksz) DIV (3*Unit) * (4*Unit) - heapsize) + END ; + firstTry := FALSE; new := NEWREC(tag); firstTry := TRUE; + IF new = NIL THEN + (* depending on the fragmentation, the heap may not have been extended by + the anti-thrashing heuristics above *) + ExtendHeap((allocated + blksz) DIV (3*Unit) * (4*Unit) - heapsize); + new := NEWREC(tag); (* will find a free block if heap has been expanded properly *) + END ; + Unlock(); RETURN new + ELSE + Unlock(); RETURN NIL + END + END ; + S.GET(adr+sizeOff, t); + IF t >= blksz THEN EXIT END ; + prev := adr; S.GET(adr + nextOff, adr) + END ; + restsize := t - blksz; end := adr + restsize; + S.PUT(end + sizeOff, blksz); + S.PUT(end + sntlOff, NoPtrSntl); + S.PUT(end, end + sizeOff); + IF restsize > nofLists * Unit THEN (*resize*) + S.PUT(adr + sizeOff, restsize) + ELSE (*unlink*) + S.GET(adr + nextOff, next); + IF prev = 0 THEN bigBlocks := next + ELSE S.PUT(prev + nextOff, next); + END ; + IF restsize > 0 THEN (*move*) + di := restsize DIV Unit; + S.PUT(adr + sizeOff, restsize); + S.PUT(adr + nextOff, freeList[di]); + freeList[di] := adr + END + END ; + INC(adr, restsize) + END ; + i := adr + 4*SZA; end := adr + blksz; + WHILE i < end DO (*deliberately unrolled*) + S.PUT(i, AddressZero); + S.PUT(i + SZA, AddressZero); + S.PUT(i + 2*SZA, AddressZero); + S.PUT(i + 3*SZA, AddressZero); + INC(i, 4*SZA) + END ; + S.PUT(adr + nextOff, AddressZero); + S.PUT(adr, tag); + S.PUT(adr + sizeOff, AddressZero); + S.PUT(adr + sntlOff, AddressZero); + INC(allocated, blksz); + Unlock(); + RETURN S.VAL(S.PTR, adr + SZA) + END NEWREC; + + PROCEDURE NEWBLK*(size: S.ADDRESS): S.PTR; + VAR blksz, tag: S.ADDRESS; new: S.PTR; + BEGIN + Lock(); + blksz := (size + (4*SZA + Unit - 1)) DIV Unit * Unit; (*size + tag + meta + blksz + sntnl + UnitAlignment*) + new := NEWREC(S.ADR(blksz)); + tag := S.VAL(S.ADDRESS, new) + blksz - 3*SZA; + S.PUT(tag - SZA, AddressZero); (*reserved for meta info*) + S.PUT(tag, blksz); + S.PUT(tag + SZA, NoPtrSntl); + S.PUT(S.VAL(S.ADDRESS, new) - SZA, tag); + Unlock(); + RETURN new + END NEWBLK; + + PROCEDURE Mark(q: S.ADDRESS); + VAR p, tag, offset, fld, n, tagbits: S.ADDRESS; + BEGIN + IF q # 0 THEN + S.GET(q - SZA, tagbits); (* Load the tag for the record at q *) + IF ~ODD(tagbits) THEN (* If it has not already been marked *) + S.PUT(q - SZA, tagbits + 1); (* Mark it *) + p := 0; + tag := tagbits + SZA; (* Tag addresses first offset *) + LOOP + S.GET(tag, offset); (* Get next ptr field offset *) + IF offset < 0 THEN (* Sentinel reached: Value is -8*(#fields+1) *) + S.PUT(q - SZA, tag + offset + 1); (* Rotate base ptr into tag *) + IF p = 0 THEN EXIT END ; + n := q; q := p; + S.GET(q - SZA, tag); DEC(tag, 1); + S.GET(tag, offset); fld := q + offset; + S.GET(fld, p); S.PUT(fld, S.VAL(S.PTR, n)) + ELSE (* offset references a ptr field *) + fld := q + offset; (* S.ADDRESS the pointer *) + S.GET(fld, n); (* Load the pointer *) + IF n # 0 THEN (* If pointer is not NIL *) + S.GET(n - SZA, tagbits); (* Consider record pointed to by this field *) + IF ~ODD(tagbits) THEN + S.PUT(n - SZA, tagbits + 1); + S.PUT(q - SZA, tag + 1); + S.PUT(fld, S.VAL(S.PTR, p)); + p := q; q := n; + tag := tagbits + END + END + END ; + INC(tag, SZA) + END + END + END + END Mark; + + PROCEDURE MarkP(p: S.PTR); (* for compatibility with EnumPtrs in ANSI mode *) + BEGIN + Mark(S.VAL(S.ADDRESS, p)) + END MarkP; + + PROCEDURE Scan; + VAR chnk, adr, end, start, tag, i, size, freesize: S.ADDRESS; + BEGIN bigBlocks := 0; i := 1; + WHILE i < nofLists DO freeList[i] := 0; INC(i) END ; + freesize := 0; allocated := 0; chnk := heap; + WHILE chnk # 0 DO + adr := chnk + blkOff; + S.GET(chnk + endOff, end); + WHILE adr < end DO + S.GET(adr, tag); + IF ODD(tag) THEN (*marked*) + IF freesize > 0 THEN + start := adr - freesize; + S.PUT(start, start+SZA); + S.PUT(start+sizeOff, freesize); + S.PUT(start+sntlOff, NoPtrSntl); + i := freesize DIV Unit; freesize := 0; + IF i < nofLists THEN S.PUT(start + nextOff, freeList[i]); freeList[i] := start + ELSE S.PUT(start + nextOff, bigBlocks); bigBlocks := start + END + END ; + DEC(tag, 1); + S.PUT(adr, tag); + S.GET(tag, size); + INC(allocated, size); + INC(adr, size) + ELSE (*unmarked*) + S.GET(tag, size); + INC(freesize, size); + INC(adr, size) + END + END ; + IF freesize > 0 THEN (*collect last block*) + start := adr - freesize; + S.PUT(start, start+SZA); + S.PUT(start+sizeOff, freesize); + S.PUT(start+sntlOff, NoPtrSntl); + i := freesize DIV Unit; freesize := 0; + IF i < nofLists THEN S.PUT(start + nextOff, freeList[i]); freeList[i] := start + ELSE S.PUT(start + nextOff, bigBlocks); bigBlocks := start + END + END ; + S.GET(chnk, chnk) + END + END Scan; + + PROCEDURE Sift (l, r: S.ADDRESS; VAR a: ARRAY OF S.ADDRESS); + VAR i, j, x: S.ADDRESS; + BEGIN j := l; x := a[j]; + LOOP i := j; j := 2*j + 1; + IF (j < r) & (a[j] < a[j+1]) THEN INC(j) END; + IF (j > r) OR (a[j] <= x) THEN EXIT END; + a[i] := a[j] + END; + a[i] := x + END Sift; + + PROCEDURE HeapSort (n: S.ADDRESS; VAR a: ARRAY OF S.ADDRESS); + VAR l, r, x: S.ADDRESS; + BEGIN l := n DIV 2; r := n - 1; + WHILE l > 0 DO DEC(l); Sift(l, r, a) END; + WHILE r > 0 DO x := a[0]; a[0] := a[r]; a[r] := x; DEC(r); Sift(l, r, a) END + END HeapSort; + + PROCEDURE MarkCandidates(n: S.ADDRESS; VAR cand: ARRAY OF S.ADDRESS); + VAR chnk, adr, tag, next, lim, lim1, i, ptr, size: S.ADDRESS; + BEGIN + chnk := heap; i := 0; lim := cand[n-1]; + WHILE (chnk # 0 ) & (chnk < lim) DO + adr := chnk + blkOff; + S.GET(chnk + endOff, lim1); + IF lim < lim1 THEN lim1 := lim END ; + WHILE adr < lim1 DO + S.GET(adr, tag); + IF ODD(tag) THEN (*already marked*) + S.GET(tag-1, size); INC(adr, size) + ELSE + S.GET(tag, size); + ptr := adr + SZA; + WHILE cand[i] < ptr DO INC(i) END ; + IF i = n THEN RETURN END ; + next := adr + size; + IF cand[i] < next THEN Mark(ptr) END ; + adr := next + END + END ; + S.GET(chnk, chnk) + END + END MarkCandidates; + + PROCEDURE CheckFin; + VAR n: FinNode; tag: S.ADDRESS; + BEGIN + n := fin; + WHILE n # NIL DO + S.GET(n.obj - SZA, tag); + IF ~ODD(tag) THEN n.marked := FALSE; Mark(n.obj) + ELSE n.marked := TRUE + END ; + n := n.next + END + END CheckFin; + + PROCEDURE Finalize; + VAR n, prev: FinNode; + BEGIN n := fin; prev := NIL; + WHILE n # NIL DO + IF ~n.marked THEN + IF n = fin THEN fin := fin.next ELSE prev.next := n.next END ; + n.finalize(S.VAL(S.PTR, n.obj)); + (* new nodes may have been pushed in n.finalize, therefore: *) + IF prev = NIL THEN n := fin ELSE n := n.next END + ELSE + prev := n; n := n.next + END + END + END Finalize; + + PROCEDURE FINALL*; + VAR n: FinNode; + BEGIN + WHILE fin # NIL DO + n := fin; fin := fin.next; + n.finalize(S.VAL(S.PTR, n.obj)) + END + END FINALL; + + PROCEDURE -ExternMainStackFrame "extern address Platform_MainStackFrame;"; + PROCEDURE -PlatformMainStackFrame(): S.ADDRESS "Platform_MainStackFrame"; + + PROCEDURE MarkStack(n: S.ADDRESS; VAR cand: ARRAY OF S.ADDRESS); + VAR + frame: S.PTR; + inc, nofcand: S.ADDRESS; + sp, p, stack0: S.ADDRESS; + align: RECORD ch: CHAR; p: S.PTR END ; + BEGIN + IF n > 0 THEN MarkStack(n-1, cand); (* flush register windows by means of recursive calls *) + IF n > 100 THEN RETURN END (* prevent tail recursion optimization *) + END ; + IF n = 0 THEN + nofcand := 0; sp := S.ADR(frame); + stack0 := PlatformMainStackFrame(); + (* check for minimum alignment of pointers *) + inc := S.ADR(align.p) - S.ADR(align); + IF sp > stack0 THEN inc := -inc END ; + WHILE sp # stack0 DO + S.GET(sp, p); + IF (p > heap) & (p < heapend) THEN + IF nofcand = LEN(cand) THEN HeapSort(nofcand, cand); MarkCandidates(nofcand, cand); nofcand := 0 END ; + cand[nofcand] := p; INC(nofcand) + END ; + INC(sp, inc) + END ; + IF nofcand > 0 THEN HeapSort(nofcand, cand); MarkCandidates(nofcand, cand) END + END + END MarkStack; + + PROCEDURE GC*(markStack: BOOLEAN); + VAR + m: Module; + i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23: S.ADDRESS; + cand: ARRAY 10000 OF S.ADDRESS; + BEGIN + IF (lockdepth = 0) OR (lockdepth = 1) & ~markStack THEN + Lock(); + m := S.VAL(Module, modules); + WHILE m # NIL DO + IF m.enumPtrs # NIL THEN m.enumPtrs(MarkP) END ; + m := m^.next + END ; + IF markStack THEN + (* generate register pressure to force callee saved registers to memory; + may be simplified by inlining OS calls or processor specific instructions + *) + i0 := -100; i1 := -101; i2 := -102; i3 := -103; i4 := -104; i5 := -105; i6 := -106; i7 := -107; + i8 := 1; i9 := 2; i10 := 3; i11 := 4; i12 := 5; i13 := 6; i14 := 7; i15 := 8; + i16 := 9; i17 := 10; i18 := 11; i19 := 12; i20 := 13; i21 := 14; i22 := 15; i23 := 16; + LOOP INC(i0, 1); INC(i1, 2); INC(i2, 3); INC(i3, 4); INC(i4, 5); INC(i5, 6); INC(i6, 7); INC(i7, 8); + INC(i8, 9); INC(i9, 10); INC(i10, 11); INC(i11, 12); INC(i12, 13); INC(i13, 14); INC(i14, 15); INC(i15, 16); + INC(i16, 17); INC(i17, 18); INC(i18, 19); INC(i19, 20); INC(i20, 21); INC(i21, 22); INC(i22, 23); INC(i23, 24); + IF (i0 = -99) & (i15 = 24) THEN MarkStack(32, cand); EXIT END + END ; + IF i0 + i1 + i2 + i3 + i4 + i5 + i6 + i7 + i8 + i9 + i10 + i11 + i12 + i13 + i14 + i15 + + i16 + i17 + i18 + i19 + i20 + i21 + i22 + i23 > 10000 THEN RETURN (* use all variables *) + END ; + END; + CheckFin; + Scan; + Finalize; + Unlock() + END + END GC; + + PROCEDURE RegisterFinalizer*(obj: S.PTR; finalize: Finalizer); + VAR f: FinNode; + BEGIN NEW(f); + f.obj := S.VAL(S.ADDRESS, obj); f.finalize := finalize; f.marked := TRUE; + f.next := fin; fin := f; + END RegisterFinalizer; + + +PROCEDURE -ExternHeapInit "extern void *Heap__init();"; +PROCEDURE -HeapModuleInit 'Heap__init()'; + + PROCEDURE InitHeap*; + (* InitHeap is called by Platform.init before any module bodies have been + initialised, to enable NEW, S.NEW *) + BEGIN + heap := NewChunk(heapSize0); + S.GET(heap + endOff, heapend); + S.PUT(heap, AddressZero); + allocated := 0; firstTry := TRUE; freeList[nofLists] := 1; lockdepth := 0; + FileCount := 0; modules := NIL; heapsize := 0; bigBlocks := 0; fin := NIL; + interrupted := FALSE; + + HeapModuleInit; + END InitHeap; + +END Heap. diff --git a/src/runtime/In.Mod b/src/runtime/In.Mod new file mode 100644 index 00000000..e69de29b diff --git a/src/runtime/LowLReal.Mod b/src/runtime/LowLReal.Mod new file mode 100644 index 00000000..b90958b2 --- /dev/null +++ b/src/runtime/LowLReal.Mod @@ -0,0 +1,486 @@ +(* $Id: LowLReal.Mod,v 1.6 1999/09/02 13:15:35 acken Exp $ *) +MODULE oocLowLReal; + +(* ToDo. support 64 bit builds *) + +(* + LowLReal - Gives access to the underlying properties of the type LONGREAL + for IEEE double-precision numbers. + Copyright (C) 1996 Michael Griebling + + This module is free software; you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + This module is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +*) + + +IMPORT Low := LowReal, S := SYSTEM; + +(* + + Real number properties are defined as follows: + + radix--The whole number value of the radix used to represent the + corresponding read number values. + + places--The whole number value of the number of radix places used + to store values of the corresponding real number type. + + expoMin--The whole number value of the exponent minimum. + + expoMax--The whole number value of the exponent maximum. + + large--The largest value of the corresponding real number type. + + small--The smallest positive value of the corresponding real number + type, represented to maximal precision. + + IEC559--A Boolean value that is TRUE if and only if the implementation + of the corresponding real number type conforms to IEC 559:1989 + (IEEE 754:1987) in all regards. + + NOTES + 6 -- If `IEC559' is TRUE, the value of `radix' is 2. + 7 -- If LowReal.IEC559 is TRUE, the 32-bit format of IEC 559:1989 + is used for the type REAL. + 7 -- If LowLong.IEC559 is TRUE, the 64-bit format of IEC 559:1989 + is used for the type REAL. + + LIA1--A Boolean value that is TRUE if and only if the implementation of + the corresponding real number type conforms to ISO/IEC 10967-1:199x + (LIA-1) in all regards: parameters, arithmetic, exceptions, and + notification. + + rounds--A Boolean value that is TRUE if and only if each operation produces + a result that is one of the values of the corresponding real number + type nearest to the mathematical result. + + gUnderflow--A Boolean value that is TRUE if and only if there are values of + the corresponding real number type between 0.0 and `small'. + + exception--A Boolean value that is TRUE if and only if every operation that + attempts to produce a real value out of range raises an exception. + + extend--A Boolean value that is TRUE if and only if expressions of the + corresponding real number type are computed to higher precision than + the stored values. + + nModes--The whole number value giving the number of bit positions needed for + the status flags for mode control. + +*) + +CONST + radix*= 2; + places*= 53; + expoMax*= 1023; + expoMin*= 1-expoMax; + large*= MAX(LONGREAL); (*1.7976931348623157D+308;*) (* MAX(LONGREAL) *) + (*small*= 2.2250738585072014D-308;*) + small*= 2.2250738585072014/9.9999999999999981D307(*/10^308)*); + IEC559*= TRUE; + LIA1*= FALSE; + rounds*= FALSE; + gUnderflow*= TRUE; (* there are IEEE numbers smaller than `small' *) + exception*= FALSE; (* at least in the default implementation *) + extend*= FALSE; + nModes*= 0; + ONE=1.0D0; (* some commonly-used constants *) + ZERO=0.0D0; + TEN=1.0D1; + + DEBUG = TRUE; + + expOffset=expoMax; + hiBit=19; + expBit=hiBit+1; + nMask={0..hiBit,31}; (* number mask *) + expMask={expBit..30}; (* exponent mask *) + +TYPE + Modes*= SET; + LongInt=ARRAY 2 OF LONGINT; + LongSet=ARRAY 2 OF SET; + +VAR + (*sml* : LONGREAL; tmp: LONGREAL;*) (* this was a test to get small as a variable at runtime. obviously, compile time preferred; -- noch *) + isBigEndian-: BOOLEAN; (* set when target is big endian *) + (* + PROCEDURE power0(i, j : INTEGER) : LONGREAL; (* used to calculate sml at runtime; -- noch *) + VAR k : INTEGER; + p : LONGREAL; + BEGIN + k := 1; + p := i; + REPEAT + p := p * i; + INC(k); + UNTIL k=j; + RETURN p; + END power0; +*) + +(* Errors are handled through the LowReal module *) + +PROCEDURE err*(): INTEGER; +BEGIN + RETURN Low.err +END err; + +PROCEDURE ClearError*; +BEGIN + Low.ClearError +END ClearError; + +PROCEDURE ErrorHandler*(err: INTEGER); +BEGIN + Low.ErrorHandler(err) +END ErrorHandler; + +(* type-casting utilities *) + +PROCEDURE Move (VAR x: LONGREAL; VAR ra: ARRAY OF LONGINT); +(* typecast a LONGREAL to an array of LONGINTs *) + VAR t: LONGINT; +BEGIN + S.MOVE(S.ADR(x),S.ADR(ra),SIZE(LONGREAL)); + IF ~isBigEndian THEN t:=ra[0]; ra[0]:=ra[1]; ra[1]:=t END +END Move; + +PROCEDURE MoveSet (VAR x: LONGREAL; VAR ra: ARRAY OF SET); +(* typecast a LONGREAL to an array of LONGINTs *) + VAR t: SET; +BEGIN + S.MOVE(S.ADR(x),S.ADR(ra),SIZE(LONGREAL)); + IF ~isBigEndian THEN t:=ra[0]; ra[0]:=ra[1]; ra[1]:=t END +END MoveSet; + +(* Note: The below should be done with a type cast -- + once the compiler supports such things. *) +(*<* PUSH; Warnings := FALSE *>*) +PROCEDURE Real * (ra: ARRAY OF LONGINT): LONGREAL; +(* typecast an array of big endian LONGINTs to a LONGREAL *) + VAR t: LONGINT; x: LONGREAL; +BEGIN + IF ~isBigEndian THEN t:=ra[0]; ra[0]:=ra[1]; ra[1]:=t END; + S.MOVE(S.ADR(ra),S.ADR(x),SIZE(LONGREAL)); + RETURN x +END Real; + +PROCEDURE ToReal (ra: ARRAY OF SET): LONGREAL; +(* typecast an array of LONGINTs to a LONGREAL *) + VAR t: SET; x: LONGREAL; +BEGIN + IF ~isBigEndian THEN t:=ra[0]; ra[0]:=ra[1]; ra[1]:=t END; + S.MOVE(S.ADR(ra),S.ADR(x),SIZE(LONGREAL)); + RETURN x +END ToReal; +(*<* POP *> *) + +PROCEDURE exponent*(x: LONGREAL): INTEGER; +(* + The value of the call exponent(x) shall be the exponent value of `x' + that lies between `expoMin' and `expoMax'. An exception shall occur + and may be raised if `x' is equal to 0.0. + *) + VAR ra: LongInt; +BEGIN + (* NOTE: x=0.0 should raise exception *) + IF x=ZERO THEN RETURN 0 + ELSE Move(x, ra); + RETURN SHORT(S.LSH(ra[0],-expBit) MOD 2048)-expOffset + END +END exponent; + +PROCEDURE exponent10*(x: LONGREAL): INTEGER; +(* + The value of the call exponent10(x) shall be the base 10 exponent + value of `x'. An exception shall occur and may be raised if `x' is + equal to 0.0. + *) +VAR exp: INTEGER; +BEGIN + IF x=ZERO THEN RETURN 0 END; (* exception could be raised here *) + exp:=0; x:=ABS(x); + WHILE x>=TEN DO x:=x/TEN; INC(exp) END; + WHILE x<1 DO x:=x*TEN; DEC(exp) END; + RETURN exp +END exponent10; + +PROCEDURE fraction*(x: LONGREAL): LONGREAL; +(* + The value of the call fraction(x) shall be the significand (or + significant) part of `x'. Hence the following relationship shall + hold: x = scale(fraction(x), exponent(x)). +*) + CONST eZero={(hiBit+2)..29}; + VAR ra: LongInt; +BEGIN + IF x=ZERO THEN RETURN ZERO + ELSE Move(x, ra); + ra[0]:=S.VAL(LONGINT, S.VAL(SET,ra[0])*nMask+eZero); + RETURN Real(ra)*2.0D0 + END +END fraction; + +PROCEDURE IsInfinity * (real: LONGREAL) : BOOLEAN; + CONST signMask={0..30}; + VAR ra: LongSet; +BEGIN + MoveSet(real, ra); + RETURN (ra[0]*signMask=expMask) & (ra[1]={}) +END IsInfinity; + +PROCEDURE IsNaN * (real: LONGREAL) : BOOLEAN; + CONST fracMask={0..hiBit}; + VAR ra: LongSet; +BEGIN + MoveSet(real, ra); + RETURN (ra[0]*expMask=expMask) & ((ra[1]#{}) OR (ra[0]*fracMask#{})) +END IsNaN; + +PROCEDURE sign*(x: LONGREAL): LONGREAL; +(* + The value of the call sign(x) shall be 1.0 if `x' is greater than 0.0, + or shall be -1.0 if `x' is less than 0.0, or shall be either 1.0 or + -1.0 if `x' is equal to 0.0. +*) +BEGIN + IF xexpoMax THEN RETURN large*sign(x) (* exception raised here *) + ELSIF exp= TEN DO x := x/TEN; INC(exp) END; + WHILE (x > ZERO) & (x < 1.0) DO x := x*TEN; DEC(exp) END; + RETURN exp +END exponent10; + +(* TYPE REAL: 1/sign, 8/exponent, 23/significand *) + +PROCEDURE fraction*(x: REAL): REAL; +(* + The value of the call fraction(x) shall be the significand (or + significant) part of `x'. Hence the following relationship shall + hold: x = scale(fraction(x), exponent(x)). +*) +VAR c: CHAR; +BEGIN + IF x=ZERO THEN RETURN ZERO + ELSE + (* Set top 7 bits of exponent to 0111111 *) + S.GET(S.ADR(x)+3, c); + c := CHR(((ORD(c) DIV 128) * 128) + 63); (* Set X0111111 (X unchanged) *) + S.PUT(S.ADR(x)+3, c); + (* Set bottom bit of exponent to 0 *) + S.GET(S.ADR(x)+2, c); + c := CHR(ORD(c) MOD 128); (* Set 0XXXXXXX (X unchanged) *) + S.PUT(S.ADR(x)+2, c); + RETURN x * 2.0; + END +(* + CONST eZero={(hiBit+2)..29}; +BEGIN + IF x=ZERO THEN RETURN ZERO + ELSE RETURN S.VAL(REAL,(S.VAL(SET,x)*nMask)+eZero)*2.0 (* set the mantissa's exponent to zero *) + END +*) +END fraction; + +PROCEDURE IsInfinity * (real: REAL) : BOOLEAN; + VAR c0, c1, c2, c3: CHAR; +BEGIN + S.GET(S.ADR(real)+0, c3); + S.GET(S.ADR(real)+1, c2); + S.GET(S.ADR(real)+2, c1); + S.GET(S.ADR(real)+3, c0); + RETURN (ORD(c0) MOD 128 = 127) & (ORD(c1) = 128) & (ORD(c2) = 0) & (ORD(c3) = 0) +END IsInfinity; + +PROCEDURE IsNaN * (real: REAL) : BOOLEAN; + VAR c0, c1, c2, c3: CHAR; +BEGIN + S.GET(S.ADR(real)+0, c3); + S.GET(S.ADR(real)+1, c2); + S.GET(S.ADR(real)+2, c1); + S.GET(S.ADR(real)+3, c0); + RETURN (ORD(c0) MOD 128 = 127) + & (ORD(c1) DIV 128 = 1) + & ((ORD(c1) MOD 128 # 0) OR (ORD(c2) # 0) OR (ORD(c3) # 0)) +END IsNaN; + +PROCEDURE sign*(x: REAL): REAL; +(* + The value of the call sign(x) shall be 1.0 if `x' is greater than 0.0, + or shall be -1.0 if `x' is less than 0.0, or shall be either 1.0 or + -1.0 if `x' is equal to 0.0. +*) +BEGIN + IF x expoMax THEN RETURN large * sign(x) (* exception raised here *) + ELSIF exp < expoMin THEN RETURN small * sign(x) (* exception here as well *) + END; + SetExponent(x, SHORT(exp)); + (* SetExponent replaces these 2 lines: + lexp := S.VAL(SET, S.LSH(exp + expOffset, expBit)); (* shifted exponent bits *) + RETURN S.VAL(REAL, (S.VAL(SET, x) * nMask) + lexp) (* insert new exponent *) + *) +END scale; + +PROCEDURE ulp*(x: REAL): REAL; +(* + The value of the call ulp(x) shall be the value of the corresponding + real number type equal to a unit in the last place of `x', if such a + value exists; otherwise an exception shall occur and may be raised. +*) +BEGIN + RETURN scale(ONE, exponent(x)-places+1) +END ulp; + +PROCEDURE succ*(x: REAL): REAL; +(* + The value of the call succ(x) shall be the next value of the + corresponding real number type greater than `x', if such a type + exists; otherwise an exception shall occur and may be raised. +*) +BEGIN + RETURN x+ulp(x)*sign(x) +END succ; + +PROCEDURE pred*(x: REAL): REAL; +(* + The value of the call pred(x) shall be the next value of the + corresponding real number type less than `x', if such a type exists; + otherwise an exception shall occur and may be raised. +*) +BEGIN + RETURN x-ulp(x)*sign(x) +END pred; + +PROCEDURE intpart*(x: REAL): REAL; +(* + The value of the call intpart(x) shall be the integral part of `x'. + For negative values, this shall be -intpart(abs(x)). +*) + VAR loBit: INTEGER; +BEGIN + loBit := (hiBit+1) - exponent(x); + IF loBit <= 0 THEN RETURN x (* no fractional part *) + ELSIF loBit <= hiBit+1 THEN + RETURN S.VAL(REAL,S.VAL(SET,x)*{loBit..31}) (* integer part is extracted *) + ELSE RETURN ZERO (* no whole part *) + END +END intpart; + +PROCEDURE fractpart*(x: REAL): REAL; +(* + The value of the call fractpart(x) shall be the fractional part of + `x'. This satifies the relationship fractpart(x)+intpart(x)=x. +*) +BEGIN + RETURN x-intpart(x) +END fractpart; + +PROCEDURE trunc*(x: REAL; n: INTEGER): REAL; +(* + The value of the call trunc(x,n) shall be the value of the most + significant `n' places of `x'. An exception shall occur and may be + raised if `n' is less than or equal to zero. +*) + VAR loBit: INTEGER; mask: SET; +BEGIN loBit:=places-n; + IF n<=0 THEN RETURN ZERO (* exception should be raised *) + ELSIF loBit<=0 THEN RETURN x (* nothing was truncated *) + ELSE mask:={loBit..31}; (* truncation bit mask *) + RETURN S.VAL(REAL,S.VAL(SET,x)*mask) + END +END trunc; + +PROCEDURE round*(x: REAL; n: INTEGER): REAL; +(* + The value of the call round(x,n) shall be the value of `x' rounded to + the most significant `n' places. An exception shall occur and may be + raised if such a value does not exist, or if `n' is less than or equal + to zero. +*) + VAR loBit: INTEGER; num, mask: SET; r: REAL; +BEGIN loBit:=places-n; + IF n<=0 THEN RETURN ZERO (* exception should be raised *) + ELSIF loBit<=0 THEN RETURN x (* nothing was rounded *) + ELSE mask:={loBit..31}; num:=S.VAL(SET,x); (* truncation bit mask and number as SET *) + x:=S.VAL(REAL,num*mask); (* truncated result *) + IF loBit-1 IN num THEN (* check if result should be rounded *) + r:=scale(ONE,exponent(x)-n+1); (* rounding fraction *) + IF 31 IN num THEN RETURN x-r (* negative rounding toward -infinity *) + ELSE RETURN x+r (* positive rounding toward +infinity *) + END + ELSE RETURN x (* return truncated result *) + END + END +END round; + +PROCEDURE synthesize*(expart: INTEGER; frapart: REAL): REAL; +(* + The value of the call synthesize(expart,frapart) shall be a value of + the corresponding real number type contructed from the value of + `expart' and `frapart'. This value shall satisfy the relationship + synthesize(exponent(x),fraction(x)) = x. +*) +BEGIN + RETURN scale(frapart, expart) +END synthesize; + + +PROCEDURE setMode*(m: Modes); +(* + The call setMode(m) shall set status flags from the value of `m', + appropriate to the underlying implementation of the corresponding real + number type. + + NOTES + 3 -- Many implementations of floating point provide options for + setting flags within the system which control details of the handling + of the type. Although two procedures are provided, one for each real + number type, the effect may be the same. Typical effects that can be + obtained by this means are: + a) Ensuring that overflow will raise an exception; + b) Allowing underflow to raise an exception; + c) Controlling the rounding; + d) Allowing special values to be produced (e.g. NaNs in + implementations conforming to IEC 559:1989 (IEEE 754:1987)); + e) Ensuring that special valu access will raise an exception; + Since these effects are so varied, the values of type `Modes' that may + be used are not specified by this International Standard. + 4 -- The effects of `setMode' on operation on values of the + corresponding real number type in coroutines other than the calling + coroutine is not defined. Implementations are not require to preserve + the status flags (if any) with the coroutine state. +*) +BEGIN + (* hardware dependent mode setting of coprocessor *) +END setMode; + +PROCEDURE currentMode*(): Modes; +(* + The value of the call currentMode() shall be the current status flags + (in the form set by `setMode'), or the default status flags (if + `setMode' is not used). + + NOTE 5 -- The value of the call currentMode() is not necessarily the + value of set by `setMode', since a call of `setMode' might attempt to + set flags that cannot be set by the program. +*) +BEGIN + RETURN {} +END currentMode; + +PROCEDURE IsLowException*(): BOOLEAN; +(* + Returns TRUE if the current coroutine is in the exceptional execution state + because of the raising of the LowReal exception; otherwise returns FALSE. +*) +BEGIN + RETURN FALSE +END IsLowException; + +BEGIN + (* install the default error handler -- just sets err variable *) + ErrorHandler:=DefaultHandler; +(* tmp := power0(2,126); (* this is test to calculate small as a variable at runtime; -- noch *) + small := sml; + small := 1/power0(2,126); + *) +END LowReal. + + diff --git a/src/runtime/Math.Mod b/src/runtime/Math.Mod new file mode 100644 index 00000000..c2a648c9 --- /dev/null +++ b/src/runtime/Math.Mod @@ -0,0 +1,612 @@ +(* $Id: RealMath.Mod,v 1.6 1999/09/02 13:19:17 acken Exp $ *) +MODULE oocRealMath; + +(* MathL - Oakwood REAL Mathematics. + Adapted (with minimal changes) from OOC RealMath.Mod *) + +(* + RealMath - Target independent mathematical functions for REAL + (IEEE single-precision) numbers. + + Numerical approximations are taken from "Software Manual for the + Elementary Functions" by Cody & Waite and "Computer Approximations" + by Hart et al. + + Copyright (C) 1995 Michael Griebling + + This module is free software; you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + This module is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +*) + +IMPORT l := LowReal, S := SYSTEM; + +CONST + pi* = 3.1415926535897932384626433832795028841972; + e* = 2.7182818284590452353602874713526624977572; + + ZERO=0.0; ONE=1.0; HALF=0.5; TWO=2.0; (* local constants *) + + (* internally-used constants *) + huge = l.large; (* largest number this package accepts *) + miny = ONE/huge; (* smallest number this package accepts *) + sqrtHalf = 0.70710678118654752440; + Limit = 2.4414062E-4; (* 2**(-MantBits/2) *) + eps = 2.9802322E-8; (* 2**(-MantBits-1) *) + piInv = 0.31830988618379067154; (* 1/pi *) + piByTwo = 1.57079632679489661923132; + piByFour = 0.78539816339744830962; + lnv = 0.6931610107421875; (* should be exact *) + vbytwo = 0.13830277879601902638E-4; (* used in sinh/cosh *) + ln2Inv = 1.44269504088896340735992468100189213; + + (* error/exception codes *) + NoError*=0; IllegalRoot*=1; IllegalLog*=2; Overflow*=3; IllegalPower*=4; IllegalLogBase*=5; + IllegalTrig*=6; IllegalInvTrig*=7; HypInvTrigClipped*=8; IllegalHypInvTrig*=9; + LossOfAccuracy*=10; Underflow*=11; + +VAR + a1: ARRAY 18 OF REAL; (* lookup table for power function *) + a2: ARRAY 9 OF REAL; (* lookup table for power function *) + em: REAL; (* largest number such that 1+epsilon > 1.0 *) + LnInfinity: REAL; (* natural log of infinity *) + LnSmall: REAL; (* natural log of very small number *) + SqrtInfinity: REAL; (* square root of infinity *) + TanhMax: REAL; (* maximum Tanh value *) + t: REAL; (* internal variables *) + +(* internally used support routines *) + +PROCEDURE SinCos (x, y, sign: REAL): REAL; + CONST + ymax=9099; (* ENTIER(pi*2**(MantBits/2)) *) + r1=-0.1666665668E+0; + r2= 0.8333025139E-2; + r3=-0.1980741872E-3; + r4= 0.2601903036E-5; + VAR + n: LONGINT; xn, f, g: REAL; +BEGIN + IF y>=ymax THEN l.ErrorHandler(LossOfAccuracy); RETURN ZERO END; + + (* determine the reduced number *) + n:=ENTIER(y*piInv+HALF); xn:=n; + IF ODD(n) THEN sign:=-sign END; + x:=ABS(x); + IF x#y THEN xn:=xn-HALF END; + + (* fractional part of reduced number *) + f:=SHORT(ABS(LONG(x)) - LONG(xn)*pi); + + (* Pre: |f| <= pi/2 *) + IF ABS(f)= 0 *) + CONST + P0=0.41731; P1=0.59016; + VAR + xMant, yEst, z: REAL; xExp: INTEGER; +BEGIN + (* optimize zeros and check for illegal negative roots *) + IF x=ZERO THEN RETURN ZERO END; + IF x=LnInfinity THEN l.ErrorHandler(Overflow); RETURN huge + ELSIF x 0 *) + CONST + c1=355.0/512.0; c2=-2.121944400546905827679E-4; + A0=-0.5527074855E+0; B0=-0.6632718214E+1; + VAR f, zn, zd, r, z, w, xn: REAL; n: INTEGER; +BEGIN + (* ensure illegal inputs are trapped and handled *) + IF x<=ZERO THEN l.ErrorHandler(IllegalLog); RETURN -huge END; + + (* reduce the range of the input *) + f:=l.fraction(x)*HALF; n:=l.exponent(x)+1; + IF f>sqrtHalf THEN zn:=(f-HALF)-HALF; zd:=f*HALF+HALF + ELSE zn:=f-HALF; zd:=zn*HALF+HALF; DEC(n) + END; + + (* evaluate rational approximation from "Software Manual for the Elementary Functions" *) + z:=zn/zd; w:=z*z; r:=z+z*(w*A0/(w+B0)); + + (* scale the output *) + xn:=n; + RETURN (xn*c2+r)+xn*c1 +END ln; + +(* The angle in all trigonometric functions is measured in radians *) + +PROCEDURE sin*(x: REAL): REAL; + (* Returns the sine of x for all x *) +BEGIN + IF xymax THEN l.ErrorHandler(LossOfAccuracy); RETURN ZERO END; + + (* determine n and the fraction f *) + n:=round(x*twoByPi); xn:=n; + f:=SHORT(LONG(x)-LONG(xn)*piByTwo); + + (* check for underflow *) + IF ABS(f)HALF THEN + i:=1-flag; + IF y>ONE THEN l.ErrorHandler(IllegalInvTrig); res:=huge; RETURN END; + + (* reduce the input argument *) + g:=(ONE-y)*HALF; r:=-sqrt(g); y:=r+r; + + (* compute approximation *) + r:=((P2*g+P1)*g)/((g+Q1)*g+Q0); + res:=y+(y*r) + ELSE + i:=flag; + IF yONE THEN f:=ONE/f; n:=2 + ELSE n:=0 + END; + + (* check if f should be scaled *) + IF f>rt32 THEN f:=(((a*f-HALF)-HALF)+f)/(rt3+f); INC(n) END; + + (* check for underflow *) + IF ABS(f)1 THEN res:=-res END; + CASE n OF + | 1: res:=res+piBySix + | 2: res:=res+piByTwo + | 3: res:=res+piByThree + | ELSE (* do nothing *) + END; + RETURN res +END atan; + +PROCEDURE arctan*(x: REAL): REAL; + (* Returns the arctangent of x, in the range [-pi/2, pi/2] for all x *) +BEGIN + IF x<0 THEN RETURN -atan(-x) + ELSE RETURN atan(x) + END +END arctan; + +PROCEDURE power*(base, exponent: REAL): REAL; + (* Returns the value of the number base raised to the power exponent + for base > 0 *) + CONST P1=0.83357541E-1; K=0.4426950409; + Q1=0.69314675; Q2=0.24018510; Q3=0.54360383E-1; + OneOver16=0.0625; XMAX=16*(l.expoMax+1)-1; (*XMIN=16*l.expoMin;*) XMIN=-2016; (* to make it easier for voc; -- noch *) + VAR z, g, R, v, u2, u1, w1, w2: REAL; w: LONGREAL; + m, p, i: INTEGER; mp, pp, iw1: LONGINT; +BEGIN + (* handle all possible error conditions *) + IF base<=ZERO THEN + IF base#ZERO THEN l.ErrorHandler(IllegalPower); base:=-base + ELSIF exponent>ZERO THEN RETURN ZERO + ELSE l.ErrorHandler(IllegalPower); RETURN huge + END + END; + + (* extract the exponent of base to m and clear exponent of base in g *) + g:=l.fraction(base)*HALF; m:=l.exponent(base)+1; + + (* determine p table offset with an unrolled binary search *) + p:=1; + IF g<=a1[9] THEN p:=9 END; + IF g<=a1[p+4] THEN INC(p, 4) END; + IF g<=a1[p+2] THEN INC(p, 2) END; + + (* compute scaled z so that |z| <= 0.044 *) + z:=((g-a1[p+1])-a2[(p+1) DIV 2])/(g+a1[p+1]); z:=z+z; + + (* approximation for log2(z) from "Software Manual for the Elementary Functions" *) + v:=z*z; R:=P1*v*z; R:=R+K*R; u2:=(R+z*K)+z; + u1:=(m*16-p)*OneOver16; w:=LONG(exponent)*(LONG(u1)+LONG(u2)); (* need extra precision *) + + (* calculations below were modified to work properly -- incorrect in cited reference? *) + iw1:=ENTIER(16*w); w1:=iw1*OneOver16; w2:=SHORT(w-w1); + + (* check for overflow/underflow *) + IF iw1>XMAX THEN l.ErrorHandler(Overflow); RETURN huge + ELSIF iw1ZERO THEN INC(iw1); w2:=w2-OneOver16 END; IF iw1<0 THEN i:=0 ELSE i:=1 END; + mp:=div(iw1, 16)+i; pp:=16*mp-iw1; z:=((Q3*w2+Q2)*w2+Q1)*w2; z:=a1[pp+1]+a1[pp+1]*z; + RETURN l.scale(z, SHORT(mp)) +END power; + +PROCEDURE IsRMathException*(): BOOLEAN; + (* Returns TRUE if the current coroutine is in the exceptional execution state + because of the raising of the RealMath exception; otherwise returns FALSE. + *) +BEGIN + RETURN FALSE +END IsRMathException; + + +(* + Following routines are provided as extensions to the ISO standard. + They are either used as the basis of other functions or provide + useful functions which are not part of the ISO standard. +*) + +PROCEDURE log* (x, base: REAL): REAL; +(* log(x,base) is the logarithm of x base 'base'. All positive arguments are + allowed but base > 0 and base # 1 *) +BEGIN + (* log(x, base) = ln(x) / ln(base) *) + IF base<=ZERO THEN l.ErrorHandler(IllegalLogBase); RETURN -huge + ELSE RETURN ln(x)/ln(base) + END +END log; + +PROCEDURE ipower* (x: REAL; base: INTEGER): REAL; +(* ipower(x, base) returns the x to the integer power base where Log2(x) < expoMax *) + VAR Exp: INTEGER; y: REAL; neg: BOOLEAN; + + PROCEDURE Adjust(xadj: REAL): REAL; + BEGIN + IF (x0 THEN RETURN ZERO ELSE l.ErrorHandler(Overflow); RETURN Adjust(huge) END + END; + + (* trap potential overflows and underflows *) + Exp:=(l.exponent(x)+1)*base; y:=LnInfinity*ln2Inv; + IF Exp>y THEN l.ErrorHandler(Overflow); RETURN Adjust(huge) + ELSIF Exp<-y THEN RETURN ZERO + END; + + (* compute x**base using an optimised algorithm from Knuth, slightly + altered : p442, The Art Of Computer Programming, Vol 2 *) + y:=ONE; IF base<0 THEN neg:=TRUE; base := -base ELSE neg:= FALSE END; + LOOP + IF ODD(base) THEN y:=y*x END; + base:=base DIV 2; IF base=0 THEN EXIT END; + x:=x*x; + END; + IF neg THEN RETURN ONE/y ELSE RETURN y END +END ipower; + +PROCEDURE sincos* (x: REAL; VAR Sin, Cos: REAL); +(* More efficient sin/cos implementation if both values are needed. *) +BEGIN + Sin:=sin(x); Cos:=sqrt(ONE-Sin*Sin) +END sincos; + +PROCEDURE arctan2* (xn, xd: REAL): REAL; +(* arctan2(xn,xd) is the quadrant-correct arc tangent atan(xn/xd). If the + denominator xd is zero, then the numerator xn must not be zero. All + arguments are legal except xn = xd = 0. *) +VAR + res: REAL; xpdiff: LONGINT; +BEGIN + (* check for error conditions *) + IF xd=ZERO THEN + IF xn=ZERO THEN l.ErrorHandler(IllegalTrig); RETURN ZERO + ELSIF xn<0 THEN RETURN -piByTwo + ELSE RETURN piByTwo + END; + ELSE + xpdiff:=l.exponent(xn)-l.exponent(xd); + IF ABS(xpdiff)>=l.expoMax-3 THEN + (* overflow detected *) + IF xn<0 THEN RETURN -piByTwo + ELSE RETURN piByTwo + END + ELSE + res:=ABS(xn/xd); + IF res#ZERO THEN res:=atan(res) END; + IF xdLnInfinity THEN (* handle exp overflows *) + y:=y-lnv; + IF y>LnInfinity-lnv+0.69 THEN l.ErrorHandler(Overflow); + IF x>ZERO THEN RETURN huge ELSE RETURN -huge END + ELSE f:=exp(y); f:=f+f*vbytwo (* don't change to f(1+vbytwo) *) + END + ELSE f:=exp(y); f:=(f-ONE/f)*HALF + END; + + (* reach here when 1 < ABS(x) < LnInfinity-lnv+0.69 *) + IF x>ZERO THEN RETURN f ELSE RETURN -f END +END sinh; + +PROCEDURE cosh* (x: REAL): REAL; +(* cosh(x) is the hyperbolic cosine of x. The argument x must not be so large + that exp(|x|) overflows. *) + VAR y, f: REAL; +BEGIN y:=ABS(x); + IF y>LnInfinity THEN (* handle exp overflows *) + y:=y-lnv; + IF y>LnInfinity-lnv+0.69 THEN l.ErrorHandler(Overflow); + IF x>ZERO THEN RETURN huge ELSE RETURN -huge END + ELSE f:=exp(y); RETURN f+f*vbytwo (* don't change to f(1+vbytwo) *) + END + ELSE f:=exp(y); RETURN (f+ONE/f)*HALF + END +END cosh; + +PROCEDURE tanh* (x: REAL): REAL; +(* tanh(x) is the hyperbolic tangent of x. All arguments are legal. *) + CONST P0=-0.8237728127; P1=-0.3831010665E-2; Q0=2.471319654; ln3over2=0.5493061443; + BIG=9.010913347; (* (ln(2)+(t+1)*ln(B))/2 where t=mantissa bits, B=base *) + VAR f, t: REAL; +BEGIN f:=ABS(x); + IF f>BIG THEN t:=ONE + ELSIF f>ln3over2 THEN t:=ONE-TWO/(exp(TWO*f)+ONE) + ELSIF fSqrtInfinity*HALF THEN l.ErrorHandler(HypInvTrigClipped); + IF x>ZERO THEN RETURN ln(SqrtInfinity) ELSE RETURN -ln(SqrtInfinity) END; + ELSIF xSqrtInfinity*HALF THEN l.ErrorHandler(HypInvTrigClipped); RETURN ln(SqrtInfinity) + ELSE RETURN ln(x+sqrt(x*x-ONE)) + END +END arccosh; + +PROCEDURE arctanh* (x: REAL): REAL; +(* arctanh(x) is the arc hyperbolic tangent of x. |x| < 1 - sqrt(em), where + em is machine epsilon. Note that |x| must not be so close to 1 that the + result is less accurate than half precision. *) + CONST TanhLimit=0.999984991; (* Tanh(5.9) *) + VAR t: REAL; +BEGIN t:=ABS(x); + IF (t>=ONE) OR (t>(ONE-TWO*em)) THEN l.ErrorHandler(IllegalHypInvTrig); + IF xTanhLimit THEN l.ErrorHandler(LossOfAccuracy) + END; + RETURN arcsinh(x/sqrt(ONE-x*x)) +END arctanh; + +BEGIN + (* determine some fundamental constants used by hyperbolic trig functions *) + em:=l.ulp(ONE); + LnInfinity:=ln(huge); + LnSmall:=ln(miny); + SqrtInfinity:=sqrt(huge); + t:=l.pred(ONE)/sqrt(em); TanhMax:=ln(t+sqrt(t*t+ONE)); + + (* initialize some tables for the power() function a1[i]=2**((1-i)/16) *) + a1[1] :=ONE; + a1[2] :=S.VAL(REAL, 3F75257DH); + a1[3] :=S.VAL(REAL, 3F6AC0C7H); + a1[4] :=S.VAL(REAL, 3F60CCDFH); + a1[5] :=S.VAL(REAL, 3F5744FDH); + a1[6] :=S.VAL(REAL, 3F4E248CH); + a1[7] :=S.VAL(REAL, 3F45672AH); + a1[8] :=S.VAL(REAL, 3F3D08A4H); + a1[9] :=S.VAL(REAL, 3F3504F3H); + a1[10]:=S.VAL(REAL, 3F2D583FH); + a1[11]:=S.VAL(REAL, 3F25FED7H); + a1[12]:=S.VAL(REAL, 3F1EF532H); + a1[13]:=S.VAL(REAL, 3F1837F0H); + a1[14]:=S.VAL(REAL, 3F11C3D3H); + a1[15]:=S.VAL(REAL, 3F0B95C2H); + a1[16]:=S.VAL(REAL, 3F05AAC3H); + a1[17]:=HALF; + + (* a2[i]=2**[(1-2i)/16] - a1[2i]; delta resolution *) + a2[1]:=S.VAL(REAL, 31A92436H); + a2[2]:=S.VAL(REAL, 336C2A95H); + a2[3]:=S.VAL(REAL, 31A8FC24H); + a2[4]:=S.VAL(REAL, 331F580CH); + a2[5]:=S.VAL(REAL, 336A42A1H); + a2[6]:=S.VAL(REAL, 32C12342H); + a2[7]:=S.VAL(REAL, 32E75624H); + a2[8]:=S.VAL(REAL, 32CF9890H) +END oocRealMath. diff --git a/src/runtime/MathL.Mod b/src/runtime/MathL.Mod new file mode 100644 index 00000000..8732fee9 --- /dev/null +++ b/src/runtime/MathL.Mod @@ -0,0 +1,562 @@ +MODULE MathL; + +(* MathL - Oakwood LONGREAL Mathematics. + Adapted (with minimal changes) from OOC LRealMath.Mod *) + +(* + LRealMath - Target independent mathematical functions for LONGREAL + (IEEE double-precision) numbers. + + Numerical approximations are taken from "Software Manual for the + Elementary Functions" by Cody & Waite and "Computer Approximations" + by Hart et al. + + Copyright (C) 1996-1998 Michael Griebling + + This module is free software; you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + This module is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +*) + +IMPORT l := LowLReal, m := Math, SYSTEM; + +CONST + pi* = 3.1415926535897932384626433832795028841972D0; + e* = 2.7182818284590452353602874713526624977572D0; + + ZERO=0.0D0; ONE=1.0D0; HALF=0.5D0; TWO=2.0D0; (* local constants *) + + (* internally-used constants *) + huge = l.large; (* largest number this package accepts *) + miny = l.small; (* smallest number this package accepts *) + sqrtHalf = 0.70710678118654752440D0; + Limit = 1.0536712D-8; (* 2**(-MantBits/2) *) + eps = 5.5511151D-17; (* 2**(-MantBits-1) *) + piInv = 0.31830988618379067154D0; (* 1/pi *) + piByTwo = 1.57079632679489661923D0; + lnv = 0.6931610107421875D0; (* should be exact *) + vbytwo = 0.13830277879601902638D-4; (* used in sinh/cosh *) + ln2Inv = 1.44269504088896340735992468100189213D0; + + (* error/exception codes *) + NoError*=m.NoError; IllegalRoot*=m.IllegalRoot; IllegalLog*=m.IllegalLog; Overflow*=m.Overflow; + IllegalPower*=m.IllegalPower; IllegalLogBase*=m.IllegalLogBase; IllegalTrig*=m.IllegalTrig; + IllegalInvTrig*=m.IllegalInvTrig; HypInvTrigClipped*=m.HypInvTrigClipped; + IllegalHypInvTrig*=m.IllegalHypInvTrig; LossOfAccuracy*=m.LossOfAccuracy; + +VAR + a1: ARRAY 18 OF LONGREAL; (* lookup table for power function *) + a2: ARRAY 9 OF LONGREAL; (* lookup table for power function *) + em: LONGREAL; (* largest number such that 1+epsilon > 1.0 *) + LnInfinity: LONGREAL; (* natural log of infinity *) + LnSmall: LONGREAL; (* natural log of very small number *) + SqrtInfinity: LONGREAL; (* square root of infinity *) + TanhMax: LONGREAL; (* maximum Tanh value *) + t: LONGREAL; (* internal variables *) + +(* internally used support routines *) + +PROCEDURE SinCos (x, y, sign: LONGREAL): LONGREAL; + CONST + ymax=210828714; (* ENTIER(pi*2**(MantBits/2)) *) + c1=3.1416015625D0; + c2=-8.908910206761537356617D-6; + r1=-0.16666666666666665052D+0; + r2= 0.83333333333331650314D-2; + r3=-0.19841269841201840457D-3; + r4= 0.27557319210152756119D-5; + r5=-0.25052106798274584544D-7; + r6= 0.16058936490371589114D-9; + r7=-0.76429178068910467734D-12; + r8= 0.27204790957888846175D-14; + VAR + n: LONGINT; xn, f, x1, g: LONGREAL; +BEGIN + IF y>=ymax THEN l.ErrorHandler(LossOfAccuracy); RETURN ZERO END; + + (* determine the reduced number *) + n:=ENTIER(y*piInv+HALF); xn:=n; + IF ODD(n) THEN sign:=-sign END; + x:=ABS(x); + IF x#y THEN xn:=xn-HALF END; + + (* fractional part of reduced number *) + x1:=ENTIER(x); + f:=((x1-xn*c1)+(x-x1))-xn*c2; + + (* Pre: |f| <= pi/2 *) + IF ABS(f)= 0 *) + CONST + P0=0.41731; P1=0.59016; + VAR + xMant, yEst, z: LONGREAL; xExp: INTEGER; +BEGIN + (* optimize zeros and check for illegal negative roots *) + IF x=ZERO THEN RETURN ZERO END; + IF xLnInfinity THEN l.ErrorHandler(Overflow); RETURN huge + ELSIF x=ZERO THEN n:=SHORT(ENTIER(ln2Inv*x+HALF)) + ELSE n:=SHORT(ENTIER(ln2Inv*x-HALF)) + END; + xn:=n; g:=(x-xn*c1)-xn*c2; + + (* Calculate exp(g)/2 from "Software Manual for the Elementary Functions" *) + z:=g*g; p:=((P2*z+P1)*z+P0)*g; q:=(Q2*z+Q1)*z+HALF; + RETURN l.scale(HALF+p/(q-p), n+1) +END exp; + +PROCEDURE ln*(x: LONGREAL): LONGREAL; + (* Returns the natural logarithm of x for x > 0 *) + CONST + c1=355.0D0/512.0D0; c2=-2.121944400546905827679D-4; + P0=-0.64124943423745581147D+2; P1=0.16383943563021534222D+2; P2=-0.78956112887491257267D+0; + Q0=-0.76949932108494879777D+3; Q1=0.31203222091924532844D+3; Q2=-0.35667977739034646171D+2; + VAR f, zn, zd, r, z, w, p, q, xn: LONGREAL; n: INTEGER; +BEGIN + (* ensure illegal inputs are trapped and handled *) + IF x<=ZERO THEN l.ErrorHandler(IllegalLog); RETURN -huge END; + + (* reduce the range of the input *) + f:=l.fraction(x)*HALF; n:=l.exponent(x)+1; + IF f>sqrtHalf THEN zn:=(f-HALF)-HALF; zd:=f*HALF+HALF + ELSE zn:=f-HALF; zd:=zn*HALF+HALF; DEC(n) + END; + + (* evaluate rational approximation from "Software Manual for the Elementary Functions" *) + z:=zn/zd; w:=z*z; q:=((w+Q2)*w+Q1)*w+Q0; p:=w*((P2*w+P1)*w+P0); r:=z+z*(p/q); + + (* scale the output *) + xn:=n; + RETURN (xn*c2+r)+xn*c1 +END ln; + + +(* The angle in all trigonometric functions is measured in radians *) + +PROCEDURE sin* (x: LONGREAL): LONGREAL; +BEGIN + IF xONE THEN l.ErrorHandler(IllegalInvTrig); RETURN huge + ELSE RETURN arctan2(x, sqrt(ONE-x*x)) + END +END arcsin; + +PROCEDURE arccos*(x: LONGREAL): LONGREAL; + (* Returns the arccosine of x, in the range [0, pi] where -1 <= x <= 1 *) +BEGIN + IF ABS(x)>ONE THEN l.ErrorHandler(IllegalInvTrig); RETURN huge + ELSE RETURN arctan2(sqrt(ONE-x*x), x) + END +END arccos; + +PROCEDURE arctan*(x: LONGREAL): LONGREAL; + (* Returns the arctangent of x, in the range [-pi/2, pi/2] for all x *) +BEGIN + RETURN arctan2(x, ONE) +END arctan; + +PROCEDURE power*(base, exponent: LONGREAL): LONGREAL; + (* Returns the value of the number base raised to the power exponent + for base > 0 *) + CONST + P1=0.83333333333333211405D-1; P2=0.12500000000503799174D-1; + P3=0.22321421285924258967D-2; P4=0.43445775672163119635D-3; + K=0.44269504088896340736D0; + Q1=0.69314718055994529629D+0; Q2=0.24022650695909537056D+0; + Q3=0.55504108664085595326D-1; Q4=0.96181290595172416964D-2; + Q5=0.13333541313585784703D-2; Q6=0.15400290440989764601D-3; + Q7=0.14928852680595608186D-4; + OneOver16=0.0625D0; XMAX=16*l.expoMax-1; (*XMIN=16*l.expoMin+1;*) XMIN=-16351; (* noch *) + VAR z, g, R, v, u2, u1, w1, w2, y1, y2, w: LONGREAL; m, p, i: INTEGER; mp, pp, iw1: LONGINT; +BEGIN + (* handle all possible error conditions *) + IF ABS(exponent)ZERO THEN RETURN ZERO ELSE l.ErrorHandler(Overflow); RETURN -huge END + END; + + (* extract the exponent of base to m and clear exponent of base in g *) + g:=l.fraction(base)*HALF; m:=l.exponent(base)+1; + + (* determine p table offset with an unrolled binary search *) + p:=1; + IF g<=a1[9] THEN p:=9 END; + IF g<=a1[p+4] THEN INC(p, 4) END; + IF g<=a1[p+2] THEN INC(p, 2) END; + + (* compute scaled z so that |z| <= 0.044 *) + z:=((g-a1[p+1])-a2[(p+1) DIV 2])/(g+a1[p+1]); z:=z+z; + + (* approximation for log2(z) from "Software Manual for the Elementary Functions" *) + v:=z*z; R:=(((P4*v+P3)*v+P2)*v+P1)*v*z; R:=R+K*R; u2:=(R+z*K)+z; u1:=(m*16-p)*OneOver16; + + (* generate w with extra precision calculations *) + y1:=ENTIER(16*exponent)*OneOver16; y2:=exponent-y1; w:=u2*exponent+u1*y2; + w1:=ENTIER(16*w)*OneOver16; w2:=w-w1; w:=w1+u1*y1; + w1:=ENTIER(16*w)*OneOver16; w2:=w2+(w-w1); w:=ENTIER(16*w2)*OneOver16; + iw1:=ENTIER(16*(w+w1)); w2:=w2-w; + + (* check for overflow/underflow *) + IF iw1>XMAX THEN l.ErrorHandler(Overflow); RETURN huge + ELSIF iw1ZERO THEN INC(iw1); w2:=w2-OneOver16 END; IF iw1<0 THEN i:=0 ELSE i:=1 END; + mp:=div(iw1, 16)+i; pp:=16*mp-iw1; + z:=((((((Q7*w2+Q6)*w2+Q5)*w2+Q4)*w2+Q3)*w2+Q2)*w2+Q1)*w2; z:=a1[pp+1]+a1[pp+1]*z; + RETURN l.scale(z, SHORT(mp)) +END power; + +PROCEDURE round*(x: LONGREAL): LONGINT; + (* Returns the value of x rounded to the nearest integer *) +BEGIN + IF x 0 and base # 1. *) +BEGIN + (* log(x, base) = log2(x) / log2(base) *) + IF base<=ZERO THEN l.ErrorHandler(IllegalLogBase); RETURN -huge + ELSE RETURN ln(x)/ln(base) + END +END log; + +PROCEDURE ipower* (x: LONGREAL; base: INTEGER): LONGREAL; +(* ipower(x, base) returns the x to the integer power base where base*Log2(x) < Log2(Max) *) + VAR y: LONGREAL; neg: BOOLEAN; Exp: LONGINT; + + PROCEDURE Adjust(xadj: LONGREAL): LONGREAL; + BEGIN + IF (x0 THEN RETURN ZERO ELSE l.ErrorHandler(Overflow); RETURN Adjust(huge) END + END; + + (* trap potential overflows and underflows *) + Exp:=(l.exponent(x)+1)*base; y:=LnInfinity*ln2Inv; + IF Exp>y THEN l.ErrorHandler(Overflow); RETURN Adjust(huge) + ELSIF Exp<-y THEN RETURN ZERO + END; + + (* compute x**base using an optimised algorithm from Knuth, slightly + altered : p442, The Art Of Computer Programming, Vol 2 *) + y:=ONE; IF base<0 THEN neg:=TRUE; base := -base ELSE neg:= FALSE END; + LOOP + IF ODD(base) THEN y:=y*x END; + base:=base DIV 2; IF base=0 THEN EXIT END; + x:=x*x; + END; + IF neg THEN RETURN ONE/y ELSE RETURN y END +END ipower; + +PROCEDURE sincos* (x: LONGREAL; VAR Sin, Cos: LONGREAL); +(* More efficient sin/cos implementation if both values are needed. *) +BEGIN + Sin:=sin(x); Cos:=sqrt(ONE-Sin*Sin) +END sincos; + +PROCEDURE arctan2* (xn, xd: LONGREAL): LONGREAL; +(* arctan2(xn,xd) is the quadrant-correct arc tangent atan(xn/xd). If the + denominator xd is zero, then the numerator xn must not be zero. All + arguments are legal except xn = xd = 0. *) + CONST + P0=0.216062307897242551884D+3; P1=0.3226620700132512059245D+3; + P2=0.13270239816397674701D+3; P3=0.1288838303415727934D+2; + Q0=0.2160623078972426128957D+3; Q1=0.3946828393122829592162D+3; + Q2=0.221050883028417680623D+3; Q3=0.3850148650835119501D+2; + PiOver2=pi/2; Sqrt3=1.7320508075688772935D0; + VAR atan, z, z2, p, q: LONGREAL; xnExp, xdExp: INTEGER; Quadrant: SHORTINT; +BEGIN + IF ABS(xd)=l.expoMax-3 THEN l.ErrorHandler(Overflow); atan:=PiOver2 + ELSIF xnExp-xdExpABS(xd) THEN z:=ABS(xd/xn); Quadrant:=2 + ELSE z:=ABS(xn/xd); Quadrant:=0 + END; + + (* further reduce range to within 0 to 2-sqrt(3) *) + IF z>TWO-Sqrt3 THEN z:=(z*Sqrt3-ONE)/(Sqrt3+z); INC(Quadrant) END; + + (* approximation from "Computer Approximations" table ARCTN 5075 *) + IF ABS(z)1 THEN atan:=-atan END; + CASE Quadrant OF + 1: atan:=atan+pi/6 + | 2: atan:=atan+PiOver2 + | 3: atan:=atan+pi/3 + | ELSE (* angle is correct *) + END + END; + + (* map negative xds into the correct quadrant *) + IF xdLnInfinity THEN (* handle exp overflows *) + y:=y-lnv; + IF y>LnInfinity-lnv+0.69 THEN l.ErrorHandler(Overflow); + IF x>ZERO THEN RETURN huge ELSE RETURN -huge END + ELSE f:=exp(y); f:=f+f*vbytwo (* don't change to f(1+vbytwo) *) + END + ELSE f:=exp(y); f:=(f-ONE/f)*HALF + END; + + (* reach here when 1 < ABS(x) < LnInfinity-lnv+0.69 *) + IF x>ZERO THEN RETURN f ELSE RETURN -f END +END sinh; + +PROCEDURE cosh* (x: LONGREAL): LONGREAL; +(* cosh(x) is the hyperbolic cosine of x. The argument x must not be so large + that exp(|x|) overflows. *) + VAR y, f: LONGREAL; +BEGIN y:=ABS(x); + IF y>LnInfinity THEN (* handle exp overflows *) + y:=y-lnv; + IF y>LnInfinity-lnv+0.69 THEN l.ErrorHandler(Overflow); + IF x>ZERO THEN RETURN huge ELSE RETURN -huge END + ELSE f:=exp(y); RETURN f+f*vbytwo (* don't change to f(1+vbytwo) *) + END + ELSE f:=exp(y); RETURN (f+ONE/f)*HALF + END +END cosh; + +PROCEDURE tanh* (x: LONGREAL): LONGREAL; +(* tanh(x) is the hyperbolic tangent of x. All arguments are legal. *) + CONST + P0=-0.16134119023996228053D+4; P1=-0.99225929672236083313D+2; P2=-0.96437492777225469787D+0; + Q0= 0.48402357071988688686D+4; Q1= 0.22337720718962312926D+4; Q2= 0.11274474380534949335D+3; + ln3over2=0.54930614433405484570D0; + BIG=19.06154747D0; (* (ln(2)+(t+1)*ln(B))/2 where t=mantissa bits, B=base *) + VAR f, t: LONGREAL; +BEGIN f:=ABS(x); + IF f>BIG THEN t:=ONE + ELSIF f>ln3over2 THEN t:=ONE-TWO/(exp(TWO*f)+ONE) + ELSIF fSqrtInfinity*HALF THEN l.ErrorHandler(HypInvTrigClipped); + IF x>ZERO THEN RETURN ln(SqrtInfinity) ELSE RETURN -ln(SqrtInfinity) END; + ELSIF xSqrtInfinity*HALF THEN l.ErrorHandler(HypInvTrigClipped); RETURN ln(SqrtInfinity) + ELSE RETURN ln(x+sqrt(x*x-ONE)) + END +END arccosh; + +PROCEDURE arctanh* (x: LONGREAL): LONGREAL; +(* arctanh(x) is the arc hyperbolic tangent of x. |x| < 1 - sqrt(em), where + em is machine epsilon. Note that |x| must not be so close to 1 that the + result is less accurate than half precision. *) + CONST TanhLimit=0.999984991D0; (* Tanh(5.9) *) + VAR t: LONGREAL; +BEGIN t:=ABS(x); + IF (t>=ONE) OR (t>(ONE-TWO*em)) THEN l.ErrorHandler(IllegalHypInvTrig); + IF xTanhLimit THEN l.ErrorHandler(LossOfAccuracy) + END; + RETURN arcsinh(x/sqrt(ONE-x*x)) +END arctanh; + +PROCEDURE ToLONGREAL(h: HUGEINT): LONGREAL; +BEGIN RETURN SYSTEM.VAL(LONGREAL, h) +END ToLONGREAL; + +BEGIN + (* determine some fundamental constants used by hyperbolic trig functions *) + em:=l.ulp(ONE); + LnInfinity:=ln(huge); + LnSmall:=ln(miny); + SqrtInfinity:=sqrt(huge); + t:=l.pred(ONE)/sqrt(em); TanhMax:=ln(t+sqrt(t*t+ONE)); + + (* initialize some tables for the power() function a1[i]=2**((1-i)/16) *) + (* disable compiler warnings about 32-bit negative integers *) + (*<* PUSH; Warnings := FALSE *>*) + a1[ 1] := ONE; + a1[ 2] := ToLONGREAL(3FEEA4AFA2A490DAH); + a1[ 3] := ToLONGREAL(3FED5818DCFBA487H); + a1[ 4] := ToLONGREAL(3FEC199BDD85529CH); + a1[ 5] := ToLONGREAL(3FEAE89F995AD3ADH); + a1[ 6] := ToLONGREAL(3FE9C49182A3F090H); + a1[ 7] := ToLONGREAL(3FE8ACE5422AA0DBH); + a1[ 8] := ToLONGREAL(3FE7A11473EB0186H); + a1[ 9] := ToLONGREAL(3FE6A09E667F3BCCH); + a1[10] := ToLONGREAL(3FE5AB07DD485429H); + a1[11] := ToLONGREAL(3FE4BFDAD5362A27H); + a1[12] := ToLONGREAL(3FE3DEA64C123422H); + a1[13] := ToLONGREAL(3FE306FE0A31B715H); + a1[14] := ToLONGREAL(3FE2387A6E756238H); + a1[15] := ToLONGREAL(3FE172B83C7D517AH); + a1[16] := ToLONGREAL(3FE0B5586CF9890FH); + a1[17] := HALF; + + (* a2[i]=2**[(1-2i)/16] - a1[2i]; delta resolution *) + a2[1] := ToLONGREAL(3C90B1EE74320000H); + a2[2] := ToLONGREAL(3C71106589500000H); + a2[3] := ToLONGREAL(3C6C7C46B0700000H); + a2[4] := ToLONGREAL(3C9AFAA2047F0000H); + a2[5] := ToLONGREAL(3C86324C05460000H); + a2[6] := ToLONGREAL(3C7ADA0911F00000H); + a2[7] := ToLONGREAL(3C89B07EB6C80000H); + a2[8] := ToLONGREAL(3C88A62E4ADC0000H); + + (* reenable compiler warnings *) + (*<* POP *>*) +END MathL. + diff --git a/src/runtime/Modules.Mod b/src/runtime/Modules.Mod new file mode 100644 index 00000000..26268749 --- /dev/null +++ b/src/runtime/Modules.Mod @@ -0,0 +1,96 @@ +MODULE Modules; (* jt 6.1.96 *) + + (* access to list of modules and commands, based on ETH Oberon *) + + + IMPORT SYSTEM, Heap; + + CONST + ModNameLen* = 20; + + TYPE + ModuleName* = ARRAY ModNameLen OF CHAR; + Module* = POINTER TO ModuleDesc; + Cmd* = POINTER TO CmdDesc; + ModuleDesc* = RECORD (* cf. SYSTEM.Mod *) + next-: Module; + name-: ModuleName; + refcnt-: LONGINT; + cmds-: Cmd; + types-: LONGINT; + enumPtrs-: PROCEDURE (P: PROCEDURE(p: LONGINT)); + reserved1, reserved2: LONGINT; + END ; + + Command* = PROCEDURE; + + CmdDesc* = RECORD + next-: Cmd; + name-: ARRAY 24 OF CHAR; + cmd-: Command + END ; + + VAR + res*: INTEGER; + resMsg*: ARRAY 256 OF CHAR; + imported*, importing*: ModuleName; + + + PROCEDURE -modules*(): Module + "(Modules_Module)Heap_modules"; + + PROCEDURE -setmodules*(m: Module) + "Heap_modules = m"; + + + PROCEDURE Append(VAR a: ARRAY OF CHAR; b: ARRAY OF CHAR); + VAR i, j: INTEGER; + BEGIN + i := 0; WHILE a[i] # 0X DO INC(i) END; + j := 0; WHILE b[j] # 0X DO a[i] := b[j]; INC(i); INC(j) END; + a[i] := 0X + END Append; + + PROCEDURE ThisMod* (name: ARRAY OF CHAR): Module; + VAR m: Module; bodyname: ARRAY 64 OF CHAR; body: Command; + BEGIN m := modules(); + WHILE (m # NIL) & (m.name # name) DO m := m.next END ; + IF m # NIL THEN res := 0; resMsg := "" + ELSE res := 1; COPY(name, importing); + resMsg := ' module "'; Append(resMsg, name); Append(resMsg, '" not found'); + END ; + RETURN m + END ThisMod; + + PROCEDURE ThisCommand* (mod: Module; name: ARRAY OF CHAR): Command; + VAR c: Cmd; + BEGIN c := mod.cmds; + WHILE (c # NIL) & (c.name # name) DO c := c.next END ; + IF c # NIL THEN res := 0; resMsg := ""; RETURN c.cmd + ELSE res := 2; resMsg := ' command "'; COPY(name, importing); + Append(resMsg, mod.name); Append(resMsg, "."); Append(resMsg, name); Append(resMsg, '" not found'); + RETURN NIL + END + END ThisCommand; + + PROCEDURE Free*(name: ARRAY OF CHAR; all: BOOLEAN); + VAR m, p: Module; + BEGIN m := modules(); + IF all THEN + res := 1; resMsg := 'unloading "all" not yet supported' + ELSE + WHILE (m # NIL) & (m.name # name) DO p := m; m := m.next END ; + IF (m # NIL) & (m.refcnt = 0) THEN + IF m = modules() THEN setmodules(m.next) + ELSE p.next := m.next + END ; + res := 0 + ELSE res := 1; + IF m = NIL THEN resMsg := "module not found" + ELSE resMsg := "clients of this module exist" + END + END + END + END Free; + +END Modules. diff --git a/src/runtime/Oberon.Mod b/src/runtime/Oberon.Mod new file mode 100644 index 00000000..fbc3abd4 --- /dev/null +++ b/src/runtime/Oberon.Mod @@ -0,0 +1,74 @@ +MODULE Oberon; + +(* this version should not have dependency on graphics -- noch *) + + IMPORT Platform, Texts, Out; + + TYPE + ParList* = POINTER TO ParRec; + ParRec* = RECORD + (* + vwr*: Viewers.Viewer; + frame*: Display.Frame; + *) + text*: Texts.Text; + pos*: LONGINT + END; + + VAR + Log*: Texts.Text; + Par*: ParList; (*actual parameters*) + OptionChar*: CHAR; + + R: Texts.Reader; + W: Texts.Writer; + + (*clocks*) + +PROCEDURE GetClock* (VAR t, d: LONGINT); +BEGIN Platform.GetClock(t, d) +END GetClock; + +PROCEDURE Time* (): LONGINT; +BEGIN RETURN Platform.Time() +END Time; + +PROCEDURE PopulateParams; + VAR W: Texts.Writer; i: INTEGER; str: ARRAY 256 OF CHAR; +BEGIN + Texts.OpenWriter(W); + i := 1; (* skip program name *) + WHILE i < Platform.ArgCount DO + Platform.GetArg(i, str); Texts.WriteString(W, str); Texts.Write(W, " "); + INC(i) + END; + Texts.Append (Par^.text, W.buf); +END PopulateParams; + +PROCEDURE GetSelection*(VAR text: Texts.Text; VAR beg, end, time: LONGINT); +BEGIN text := NIL; beg := 0; end := 0; time := 0 +END GetSelection; + +(* --- Notifier for echoing to the comsole all text appended to the log. --- *) +PROCEDURE LogNotifier(Log: Texts.Text; op: INTEGER; beg, end: LONGINT); + VAR ch: CHAR; +BEGIN + Texts.OpenReader(R, Log, beg); + WHILE ~R.eot & (beg < end) DO + Texts.Read(R, ch); + IF ch = 0DX THEN Out.Ln ELSE Out.Char(ch) END; + INC(beg) + END +END LogNotifier; + +BEGIN + NEW(Par); + NEW(Par.text); + Par.pos := 0; + OptionChar := '-'; + Texts.Open(Par.text, ""); + PopulateParams; + NEW(Log); + Texts.Open(Log, ""); + Log.notify := LogNotifier; +END Oberon. diff --git a/src/runtime/Out.Mod b/src/runtime/Out.Mod new file mode 100644 index 00000000..245c67a8 --- /dev/null +++ b/src/runtime/Out.Mod @@ -0,0 +1,55 @@ +MODULE Out; (* D C W Brown. 2016-09-27 *) + + IMPORT SYSTEM, Platform; + +PROCEDURE Open*; +BEGIN +END Open; + +PROCEDURE Char*(ch: CHAR); + VAR error: Platform.ErrorCode; +BEGIN + error := Platform.Write(Platform.StdOut, SYSTEM.ADR(ch), 1) +END Char; + +PROCEDURE String*(str: ARRAY OF CHAR); + VAR l: LONGINT; error: Platform.ErrorCode; +BEGIN + l := 0; WHILE (l < LEN(str)) & (str[l] # 0X) DO INC(l) END; + error := Platform.Write(Platform.StdOut, SYSTEM.ADR(str), l) +END String; + +PROCEDURE Int*(x: HUGEINT; n: LONGINT); + CONST zero = ORD('0'); + VAR s: ARRAY 22 OF CHAR; i: INTEGER; negative: BOOLEAN; +BEGIN + negative := x < 0; + IF x = MIN(HUGEINT) THEN + s := "8085774586302733229"; i := 19 + ELSE + IF x < 0 THEN x := - x END; + s[0] := CHR(zero + (x MOD 10)); x := x DIV 10; + i := 1; WHILE x # 0 DO + s[i] := CHR(zero + (x MOD 10)); + x := x DIV 10; + INC(i) + END + END; + IF negative THEN s[i] := '-'; INC(i) END; + WHILE n > i DO Char(' '); DEC(n) END; + WHILE i > 0 DO DEC(i); Char(s[i]) END +END Int; + +PROCEDURE Real*(x: REAL; n: INTEGER); +BEGIN +END Real; + +PROCEDURE LongReal*(x: LONGREAL; n: INTEGER); +BEGIN +END LongReal; + +PROCEDURE Ln*; +BEGIN String(Platform.NL) +END Ln; + +END Out. diff --git a/src/runtime/Platformunix.Mod b/src/runtime/Platformunix.Mod new file mode 100644 index 00000000..034906bd --- /dev/null +++ b/src/runtime/Platformunix.Mod @@ -0,0 +1,552 @@ +MODULE Platform; +IMPORT SYSTEM; + +CONST + StdIn- = 0; + StdOut- = 1; + StdErr- = 2; + +TYPE + HaltProcedure = PROCEDURE(n: LONGINT); + SignalHandler = PROCEDURE(signal: INTEGER); + + ErrorCode* = INTEGER; + FileHandle* = LONGINT; + + FileIdentity* = RECORD + volume: LONGINT; (* dev on Unix filesystems, volume serial number on NTFS *) + index: LONGINT; (* inode on Unix filesystems, file id on NTFS *) + mtime: LONGINT; (* File modification time, value is system dependent *) + END; + + EnvPtr = POINTER TO ARRAY 1024 OF CHAR; + ArgPtr = POINTER TO ARRAY 1024 OF CHAR; + ArgVec = POINTER TO ARRAY 1024 OF ArgPtr; + ArgVecPtr = POINTER TO ARRAY 1 OF SYSTEM.ADDRESS; + + +VAR + LittleEndian-: BOOLEAN; + MainStackFrame-: SYSTEM.ADDRESS; + HaltCode-: LONGINT; + PID-: INTEGER; (* Note: Must be updated by Fork implementation *) + CWD-: ARRAY 256 OF CHAR; + ArgCount-: INTEGER; + + ArgVector-: SYSTEM.ADDRESS; + HaltHandler: HaltProcedure; + TimeStart: LONGINT; + + SeekSet-: INTEGER; + SeekCur-: INTEGER; + SeekEnd-: INTEGER; + + NL-: ARRAY 3 OF CHAR; (* Platform specific newline representation *) + + + +(* Unix headers to be included *) + +PROCEDURE -Aincludesystime '#include '; (* for gettimeofday *) +PROCEDURE -Aincludetime '#include '; (* for localtime *) +PROCEDURE -Aincludesystypes '#include '; +PROCEDURE -Aincludeunistd '#include '; +PROCEDURE -Aincludesysstat '#include '; +PROCEDURE -Aincludefcntl '#include '; +PROCEDURE -Aincludeerrno '#include '; +PROCEDURE -Astdlib '#include '; +PROCEDURE -Astdio '#include '; +PROCEDURE -Aerrno '#include '; + + + + +(* Error code tests *) + +PROCEDURE -EMFILE(): ErrorCode 'EMFILE'; +PROCEDURE -ENFILE(): ErrorCode 'ENFILE'; +PROCEDURE -ENOENT(): ErrorCode 'ENOENT'; +PROCEDURE -EXDEV(): ErrorCode 'EXDEV'; +PROCEDURE -EACCES(): ErrorCode 'EACCES'; +PROCEDURE -EROFS(): ErrorCode 'EROFS'; +PROCEDURE -EAGAIN(): ErrorCode 'EAGAIN'; +PROCEDURE -ETIMEDOUT(): ErrorCode 'ETIMEDOUT'; +PROCEDURE -ECONNREFUSED(): ErrorCode 'ECONNREFUSED'; +PROCEDURE -ECONNABORTED(): ErrorCode 'ECONNABORTED'; +PROCEDURE -ENETUNREACH(): ErrorCode 'ENETUNREACH'; +PROCEDURE -EHOSTUNREACH(): ErrorCode 'EHOSTUNREACH'; +PROCEDURE -EINTR(): ErrorCode 'EINTR'; + + + + +PROCEDURE TooManyFiles*(e: ErrorCode): BOOLEAN; +BEGIN RETURN (e = EMFILE()) OR (e = ENFILE()) END TooManyFiles; + +PROCEDURE NoSuchDirectory*(e: ErrorCode): BOOLEAN; +BEGIN RETURN e = ENOENT() END NoSuchDirectory; + +PROCEDURE DifferentFilesystems*(e: ErrorCode): BOOLEAN; +BEGIN RETURN e = EXDEV() END DifferentFilesystems; + +PROCEDURE Inaccessible*(e: ErrorCode): BOOLEAN; +BEGIN RETURN (e = EACCES()) OR (e = EROFS()) OR (e = EAGAIN()) END Inaccessible; + +PROCEDURE Absent*(e: ErrorCode): BOOLEAN; +BEGIN RETURN e = ENOENT() END Absent; + +PROCEDURE TimedOut*(e: ErrorCode): BOOLEAN; +BEGIN RETURN e = ETIMEDOUT() END TimedOut; + +PROCEDURE ConnectionFailed*(e: ErrorCode): BOOLEAN; +BEGIN RETURN (e = ECONNREFUSED()) OR (e = ECONNABORTED()) + OR (e = ENETUNREACH()) OR (e = EHOSTUNREACH()) END ConnectionFailed; + +PROCEDURE Interrupted*(e: ErrorCode): BOOLEAN; +BEGIN RETURN e = EINTR() END Interrupted; + + + + +(* OS memory allocaton *) + +PROCEDURE -allocate (size: SYSTEM.ADDRESS): SYSTEM.ADDRESS "(address)((void*)malloc((size_t)size))"; +PROCEDURE OSAllocate*(size: SYSTEM.ADDRESS): SYSTEM.ADDRESS; BEGIN RETURN allocate(size) END OSAllocate; + +PROCEDURE -free(address: SYSTEM.ADDRESS) "free((void*)address)"; +PROCEDURE OSFree*(address: SYSTEM.ADDRESS); BEGIN free(address) END OSFree; + + + + +(* Program startup *) + +PROCEDURE -ExternInitHeap "extern void Heap_InitHeap();"; +PROCEDURE -HeapInitHeap() "Heap_InitHeap()"; + +PROCEDURE Init*(argc: INTEGER; argvadr: SYSTEM.ADDRESS); +VAR av: ArgVecPtr; +BEGIN + MainStackFrame := argvadr; + ArgCount := argc; + av := SYSTEM.VAL(ArgVecPtr, argvadr); + ArgVector := av[0]; + HaltCode := -128; + + (* This function (Platform.Init) is called at program startup BEFORE any + modules have been initalised. In turn we must initialise the heap + before module startup (xxx__init) code is run. *) + HeapInitHeap(); +END Init; + + + + +(* Program arguments and environment access *) + +PROCEDURE -getenv(var: ARRAY OF CHAR): EnvPtr "(Platform_EnvPtr)getenv((char*)var)"; + +PROCEDURE getEnv*(var: ARRAY OF CHAR; VAR val: ARRAY OF CHAR): BOOLEAN; + VAR p: EnvPtr; +BEGIN + p := getenv(var); + IF p # NIL THEN COPY(p^, val) END; + RETURN p # NIL; +END getEnv; + +PROCEDURE GetEnv*(var: ARRAY OF CHAR; VAR val: ARRAY OF CHAR); +BEGIN + IF ~ getEnv(var, val) THEN val[0] := 0X END; +END GetEnv; + +PROCEDURE GetArg*(n: INTEGER; VAR val: ARRAY OF CHAR); + VAR av: ArgVec; +BEGIN + IF n < ArgCount THEN + av := SYSTEM.VAL(ArgVec,ArgVector); + COPY(av[n]^, val) + END +END GetArg; + +PROCEDURE GetIntArg*(n: INTEGER; VAR val: LONGINT); + VAR s: ARRAY 64 OF CHAR; k, d, i: LONGINT; +BEGIN + s := ""; GetArg(n, s); i := 0; + IF s[0] = "-" THEN i := 1 END ; + k := 0; d := ORD(s[i]) - ORD("0"); + WHILE (d >= 0 ) & (d <= 9) DO k := k*10 + d; INC(i); d := ORD(s[i]) - ORD("0") END ; + IF s[0] = "-" THEN k := -k; DEC(i) END ; + IF i > 0 THEN val := k END +END GetIntArg; + +PROCEDURE ArgPos*(s: ARRAY OF CHAR): INTEGER; + VAR i: INTEGER; arg: ARRAY 256 OF CHAR; +BEGIN + i := 0; GetArg(i, arg); + WHILE (i < ArgCount) & (s # arg) DO INC(i); GetArg(i, arg) END ; + RETURN i +END ArgPos; + + + + + +(* Signals and traps *) + +PROCEDURE -sethandler(s: INTEGER; h: SignalHandler) "SystemSetHandler(s, (address)h)"; + +PROCEDURE SetInterruptHandler*(handler: SignalHandler); +BEGIN sethandler(2, handler); END SetInterruptHandler; + +PROCEDURE SetQuitHandler*(handler: SignalHandler); +BEGIN sethandler(3, handler); END SetQuitHandler; + +PROCEDURE SetBadInstructionHandler*(handler: SignalHandler); +BEGIN sethandler(4, handler); END SetBadInstructionHandler; + + + + +(* Time of day *) + +PROCEDURE -gettimeval "struct timeval tv; gettimeofday(&tv,0)"; +PROCEDURE -tvsec(): LONGINT "tv.tv_sec"; +PROCEDURE -tvusec(): LONGINT "tv.tv_usec"; +PROCEDURE -sectotm(s: LONGINT) "struct tm *time = localtime((time_t*)&s)"; +PROCEDURE -tmsec(): LONGINT "(LONGINT)time->tm_sec"; +PROCEDURE -tmmin(): LONGINT "(LONGINT)time->tm_min"; +PROCEDURE -tmhour(): LONGINT "(LONGINT)time->tm_hour"; +PROCEDURE -tmmday(): LONGINT "(LONGINT)time->tm_mday"; +PROCEDURE -tmmon(): LONGINT "(LONGINT)time->tm_mon"; +PROCEDURE -tmyear(): LONGINT "(LONGINT)time->tm_year"; + +PROCEDURE YMDHMStoClock(ye,mo,da,ho,mi,se: LONGINT; VAR t, d: LONGINT); +BEGIN + d := ASH(ye MOD 100, 9) + ASH(mo+1, 5) + da; + t := ASH(ho, 12) + ASH(mi, 6) + se; +END YMDHMStoClock; + +PROCEDURE GetClock*(VAR t, d: LONGINT); +BEGIN + gettimeval; sectotm(tvsec()); + YMDHMStoClock(tmyear(), tmmon(), tmmday(), tmhour(), tmmin(), tmsec(), t, d); +END GetClock; + +PROCEDURE GetTimeOfDay*(VAR sec, usec: LONGINT); +BEGIN + gettimeval; sec := tvsec(); usec := tvusec(); +END GetTimeOfDay; + +PROCEDURE Time*(): LONGINT; +VAR ms: LONGINT; +BEGIN + gettimeval; + ms := (tvusec() DIV 1000) + (tvsec() * 1000); + RETURN (ms - TimeStart) MOD 7FFFFFFFH; +END Time; + + +PROCEDURE -nanosleep(s: LONGINT; ns: LONGINT) "struct timespec req, rem; req.tv_sec = s; req.tv_nsec = ns; nanosleep(&req, &rem)"; + +PROCEDURE Delay*(ms: LONGINT); +VAR s, ns: LONGINT; +BEGIN + s := ms DIV 1000; + ns := (ms MOD 1000) * 1000000; + nanosleep(s, ns); +END Delay; + + + + +(* System call *) + +PROCEDURE -system(str: ARRAY OF CHAR): INTEGER "system((char*)str)"; +PROCEDURE -err(): INTEGER "errno"; + + +PROCEDURE System*(cmd : ARRAY OF CHAR): INTEGER; +BEGIN RETURN system(cmd); END System; + +PROCEDURE Error*(): ErrorCode; BEGIN RETURN err() END Error; + + + + +(* File system *) + +(* Note: Consider also using flags O_SYNC and O_DIRECT as we do buffering *) +PROCEDURE -openrw (n: ARRAY OF CHAR): INTEGER "open((char*)n, O_RDWR)"; +PROCEDURE -openro (n: ARRAY OF CHAR): INTEGER "open((char*)n, O_RDONLY)"; +PROCEDURE -opennew(n: ARRAY OF CHAR): INTEGER "open((char*)n, O_CREAT | O_TRUNC | O_RDWR, 0664)"; + +(* File APIs *) + +PROCEDURE OldRO*(VAR n: ARRAY OF CHAR; VAR h: FileHandle): ErrorCode; +VAR fd: INTEGER; +BEGIN + fd := openro(n); + IF (fd < 0) THEN RETURN err() ELSE h := fd; RETURN 0 END; +END OldRO; + +PROCEDURE OldRW*(VAR n: ARRAY OF CHAR; VAR h: FileHandle): ErrorCode; +VAR fd: INTEGER; +BEGIN + fd := openrw(n); + IF (fd < 0) THEN RETURN err() ELSE h := fd; RETURN 0 END; +END OldRW; + +PROCEDURE New*(VAR n: ARRAY OF CHAR; VAR h: FileHandle): ErrorCode; +VAR fd: INTEGER; +BEGIN + fd := opennew(n); + IF (fd < 0) THEN RETURN err() ELSE h := fd; RETURN 0 END; +END New; + + + +PROCEDURE -closefile (fd: LONGINT): INTEGER "close(fd)"; + +PROCEDURE Close*(h: FileHandle): ErrorCode; +BEGIN + IF closefile(h) < 0 THEN RETURN err() ELSE RETURN 0 END +END Close; + + + +PROCEDURE -fstat(fd: LONGINT): INTEGER "fstat(fd, &s)"; +PROCEDURE -stat(n: ARRAY OF CHAR): INTEGER "stat((char*)n, &s)"; +PROCEDURE -structstats "struct stat s"; +PROCEDURE -statdev(): LONGINT "(LONGINT)s.st_dev"; +PROCEDURE -statino(): LONGINT "(LONGINT)s.st_ino"; +PROCEDURE -statmtime(): LONGINT "(LONGINT)s.st_mtime"; +PROCEDURE -statsize(): LONGINT "(address)s.st_size"; + +PROCEDURE Identify*(h: FileHandle; VAR identity: FileIdentity): ErrorCode; +BEGIN + structstats; + IF fstat(h) < 0 THEN RETURN err() END; + identity.volume := statdev(); + identity.index := statino(); + identity.mtime := statmtime(); + RETURN 0 +END Identify; + +PROCEDURE IdentifyByName*(n: ARRAY OF CHAR; VAR identity: FileIdentity): ErrorCode; +BEGIN + structstats; + IF stat(n) < 0 THEN RETURN err() END; + identity.volume := statdev(); + identity.index := statino(); + identity.mtime := statmtime(); + RETURN 0 +END IdentifyByName; + + +PROCEDURE SameFile*(i1, i2: FileIdentity): BOOLEAN; +BEGIN RETURN (i1.index = i2.index) & (i1.volume = i2.volume) +END SameFile; + +PROCEDURE SameFileTime*(i1, i2: FileIdentity): BOOLEAN; +BEGIN RETURN i1.mtime = i2.mtime +END SameFileTime; + +PROCEDURE SetMTime*(VAR target: FileIdentity; source: FileIdentity); +BEGIN target.mtime := source.mtime; +END SetMTime; + +PROCEDURE MTimeAsClock*(i: FileIdentity; VAR t, d: LONGINT); +BEGIN + sectotm(i.mtime); + YMDHMStoClock(tmyear(), tmmon(), tmmday(), tmhour(), tmmin(), tmsec(), t, d); +END MTimeAsClock; + + +PROCEDURE Size*(h: FileHandle; VAR l: LONGINT): ErrorCode; +BEGIN + structstats; + IF fstat(h) < 0 THEN RETURN err() END; + l := statsize(); + RETURN 0; +END Size; + + + +PROCEDURE -readfile (fd: LONGINT; p: SYSTEM.ADDRESS; l: LONGINT): LONGINT +"(LONGINT)read(fd, (void*)(address)(p), l)"; + +PROCEDURE Read*(h: FileHandle; p: SYSTEM.ADDRESS; l: LONGINT; VAR n: LONGINT): ErrorCode; +BEGIN + n := readfile(h, p, l); + IF n < 0 THEN n := 0; RETURN err() ELSE RETURN 0 END +END Read; + +PROCEDURE ReadBuf*(h: FileHandle; VAR b: ARRAY OF SYSTEM.BYTE; VAR n: LONGINT): ErrorCode; +BEGIN + n := readfile(h, SYSTEM.ADR(b), LEN(b)); + IF n < 0 THEN n := 0; RETURN err() ELSE RETURN 0 END +END ReadBuf; + + + +PROCEDURE -writefile(fd: LONGINT; p: SYSTEM.ADDRESS; l: SYSTEM.ADDRESS): SYSTEM.ADDRESS +"write(fd, (void*)(address)(p), l)"; + +PROCEDURE Write*(h: FileHandle; p: SYSTEM.ADDRESS; l: LONGINT): ErrorCode; + VAR written: SYSTEM.ADDRESS; +BEGIN + written := writefile(h, p, l); + IF written < 0 THEN RETURN err() ELSE RETURN 0 END +END Write; + + + +PROCEDURE -fsync(fd: LONGINT): INTEGER "fsync(fd)"; + +PROCEDURE Sync*(h: FileHandle): ErrorCode; +BEGIN + IF fsync(h) < 0 THEN RETURN err() ELSE RETURN 0 END +END Sync; + + + +PROCEDURE -lseek(fd: LONGINT; o: LONGINT; w: INTEGER): INTEGER "lseek(fd, o, w)"; +PROCEDURE -seekset(): INTEGER "SEEK_SET"; +PROCEDURE -seekcur(): INTEGER "SEEK_CUR"; +PROCEDURE -seekend(): INTEGER "SEEK_END"; + +PROCEDURE Seek*(h: FileHandle; offset: LONGINT; whence: INTEGER): ErrorCode; +BEGIN + IF lseek(h, offset, whence) < 0 THEN RETURN err() ELSE RETURN 0 END +END Seek; + + + +PROCEDURE -ftruncate(fd: LONGINT; l: LONGINT): INTEGER "ftruncate(fd, l)"; + +PROCEDURE Truncate*(h: FileHandle; l: LONGINT): ErrorCode; +BEGIN + IF (ftruncate(h, l) < 0) THEN RETURN err() ELSE RETURN 0 END; +END Truncate; + + + +PROCEDURE -unlink(n: ARRAY OF CHAR): INTEGER "unlink((char*)n)"; + +PROCEDURE Unlink*(VAR n: ARRAY OF CHAR): ErrorCode; +BEGIN + IF unlink(n) < 0 THEN RETURN err() ELSE RETURN 0 END +END Unlink; + + + +PROCEDURE -chdir(n: ARRAY OF CHAR): INTEGER "chdir((char*)n)"; +PROCEDURE -getcwd(VAR cwd: ARRAY OF CHAR): SYSTEM.PTR "getcwd((char*)cwd, cwd__len)"; + +PROCEDURE Chdir*(VAR n: ARRAY OF CHAR): ErrorCode; + VAR r: INTEGER; +BEGIN + IF (chdir(n) >= 0) & (getcwd(CWD) # NIL) THEN RETURN 0 + ELSE RETURN err() END +END Chdir; + + + +PROCEDURE -rename(o,n: ARRAY OF CHAR): INTEGER "rename((char*)o, (char*)n)"; + +PROCEDURE Rename*(VAR o,n: ARRAY OF CHAR): ErrorCode; +BEGIN + IF rename(o,n) < 0 THEN RETURN err() ELSE RETURN 0 END +END Rename; + + + + +(* Process termination *) + +PROCEDURE -exit(code: INTEGER) "exit(code)"; +PROCEDURE Exit*(code: INTEGER); +BEGIN exit(code) END Exit; + +PROCEDURE -errstring(s: ARRAY OF CHAR) 'write(1, s, s__len-1)'; +PROCEDURE -errc (c: CHAR) 'write(1, &c, 1)'; +PROCEDURE errch(c: CHAR); BEGIN errc(c) END errch; +PROCEDURE errln; BEGIN errch(0AX) END errln; + +PROCEDURE errposint(l: LONGINT); +BEGIN IF l>10 THEN errposint(l DIV 10) END; errch(CHR(ORD('0') + (l MOD 10))) END errposint; + +PROCEDURE errint(l: LONGINT); +BEGIN IF l<0 THEN errch('-'); l := -l END; errposint(l) END errint; + +PROCEDURE DisplayHaltCode(code: LONGINT); +BEGIN + CASE code OF + | -1: errstring("Assertion failure.") + | -2: errstring("Index out of range.") + | -3: errstring("Reached end of function without reaching RETURN.") + | -4: errstring("CASE statement: no matching label and no ELSE.") + | -5: errstring("Type guard failed.") + | -6: errstring("Implicit type guard in record assignment failed.") + | -7: errstring("Invalid case in WITH statement.") + | -8: errstring("Value out of range.") + | -9: errstring("Heap interrupted while locked, but lockdepth = 0 at unlock.") + |-10: errstring("NIL access."); + |-11: errstring("Alignment error."); + |-12: errstring("Divide by zero."); + |-13: errstring("Arithmetic overflow/underflow."); + |-14: errstring("Invalid function argument."); + |-15: errstring("Internal error, e.g. Type descriptor size mismatch.") + |-20: errstring("Too many, or negative number of, elements in dynamic array.") + ELSE + END +END DisplayHaltCode; + +PROCEDURE Halt*(code: LONGINT); +BEGIN + HaltCode := code; + IF HaltHandler # NIL THEN HaltHandler(code) END; + errstring("Terminated by Halt("); errint(code); errstring("). "); + IF code < 0 THEN DisplayHaltCode(code) END; + errln; + exit(SYSTEM.VAL(INTEGER,code)); +END Halt; + +PROCEDURE AssertFail*(code: LONGINT); +BEGIN + errstring("Assertion failure."); + IF code # 0 THEN errstring(" ASSERT code "); errint(code); errstring("."); END; + errln; + exit(SYSTEM.VAL(INTEGER,code)); +END AssertFail; + +PROCEDURE SetHalt*(p: HaltProcedure); +BEGIN HaltHandler := p; END SetHalt; + + + + + +PROCEDURE TestLittleEndian; + VAR i: INTEGER; + BEGIN i := 1; SYSTEM.GET(SYSTEM.ADR(i), LittleEndian); END TestLittleEndian; + + +PROCEDURE -getpid(): INTEGER "(INTEGER)getpid()"; + +BEGIN + TestLittleEndian; + + HaltCode := -128; + HaltHandler := NIL; + TimeStart := 0; TimeStart := Time(); + PID := getpid(); + IF getcwd(CWD) = NIL THEN CWD := "" END; + + SeekSet := seekset(); + SeekCur := seekcur(); + SeekEnd := seekend(); + + NL[0] := 0AX; (* LF *) + NL[1] := 0X; +END Platform. diff --git a/src/runtime/Platformwindows.Mod b/src/runtime/Platformwindows.Mod new file mode 100644 index 00000000..a538fdc5 --- /dev/null +++ b/src/runtime/Platformwindows.Mod @@ -0,0 +1,622 @@ +MODULE Platform; +IMPORT SYSTEM; + +(* TODO: + Use Unicode APIs with manual UTF8 conversion and prepend '\\?\' to + file paths in order to get 32768 character path length limit (as + opposed to 256 bytes. *) + + +TYPE + HaltProcedure = PROCEDURE(n: LONGINT); + SignalHandler = PROCEDURE(signal: INTEGER); + + ErrorCode* = INTEGER; + FileHandle* = LONGINT; + + FileIdentity* = RECORD + volume: LONGINT; (* dev on Unix filesystems, volume serial number on NTFS *) + indexhigh: LONGINT; (* inode on Unix filesystems, file id on NTFS *) + indexlow: LONGINT; + mtimehigh: LONGINT; (* File modification time, value is system dependent *) + mtimelow: LONGINT; (* File modification time, value is system dependent *) + END; + + EnvPtr = POINTER TO ARRAY 1024 OF CHAR; + ArgPtr = POINTER TO ARRAY 1024 OF CHAR; + ArgVec = POINTER TO ARRAY 1024 OF ArgPtr; + ArgVecPtr = POINTER TO ARRAY 1 OF SYSTEM.ADDRESS; + + +VAR + LittleEndian-: BOOLEAN; + MainStackFrame-: SYSTEM.ADDRESS; + HaltCode-: LONGINT; + PID-: INTEGER; (* Note: Must be updated by Fork implementation *) + CWD-: ARRAY 4096 OF CHAR; + ArgCount-: INTEGER; + + ArgVector-: SYSTEM.ADDRESS; + HaltHandler: HaltProcedure; + TimeStart: LONGINT; + + SeekSet-: INTEGER; + SeekCur-: INTEGER; + SeekEnd-: INTEGER; + + StdIn-: FileHandle; + StdOut-: FileHandle; + StdErr-: FileHandle; + + InterruptHandler: SignalHandler; + + nl-: ARRAY 3 OF CHAR; (* Platform specific newline representation *) + + + +PROCEDURE -AincludeWindowsWrapper '#include "WindowsWrapper.h"'; + + +(* Error code tests *) + +PROCEDURE -ERRORTOOMANYOPENFILES(): ErrorCode 'ERROR_TOO_MANY_OPEN_FILES'; +PROCEDURE -ERRORPATHNOTFOUND(): ErrorCode 'ERROR_PATH_NOT_FOUND'; +PROCEDURE -ERRORFILENOTFOUND(): ErrorCode 'ERROR_FILE_NOT_FOUND'; +PROCEDURE -ERRORNOTSAMEDEVICE(): ErrorCode 'ERROR_NOT_SAME_DEVICE'; +PROCEDURE -ERRORACCESSDENIED(): ErrorCode 'ERROR_ACCESS_DENIED'; +PROCEDURE -ERRORWRITEPROTECT(): ErrorCode 'ERROR_WRITE_PROTECT'; +PROCEDURE -ERRORSHARINGVIOLATION(): ErrorCode 'ERROR_SHARING_VIOLATION'; +PROCEDURE -ERRORNOTREADY(): ErrorCode 'ERROR_NOT_READY'; +PROCEDURE -ETIMEDOUT(): ErrorCode 'WSAETIMEDOUT'; +PROCEDURE -ECONNREFUSED(): ErrorCode 'WSAECONNREFUSED'; +PROCEDURE -ECONNABORTED(): ErrorCode 'WSAECONNABORTED'; +PROCEDURE -ENETUNREACH(): ErrorCode 'WSAENETUNREACH'; +PROCEDURE -EHOSTUNREACH(): ErrorCode 'WSAEHOSTUNREACH'; +PROCEDURE -EINTR(): ErrorCode 'WSAEINTR'; + + + +PROCEDURE TooManyFiles*(e: ErrorCode): BOOLEAN; +BEGIN RETURN e = ERRORTOOMANYOPENFILES() END TooManyFiles; + +PROCEDURE NoSuchDirectory*(e: ErrorCode): BOOLEAN; +BEGIN RETURN e = ERRORPATHNOTFOUND() END NoSuchDirectory; + +PROCEDURE DifferentFilesystems*(e: ErrorCode): BOOLEAN; +BEGIN RETURN e = ERRORNOTSAMEDEVICE() END DifferentFilesystems; + +PROCEDURE Inaccessible*(e: ErrorCode): BOOLEAN; +BEGIN + RETURN (e = ERRORACCESSDENIED()) OR (e = ERRORWRITEPROTECT()) + OR (e = ERRORNOTREADY()) OR (e = ERRORSHARINGVIOLATION()); +END Inaccessible; + +PROCEDURE Absent*(e: ErrorCode): BOOLEAN; +BEGIN RETURN (e = ERRORFILENOTFOUND()) OR (e = ERRORPATHNOTFOUND()) END Absent; + +PROCEDURE TimedOut*(e: ErrorCode): BOOLEAN; +BEGIN RETURN (e = ETIMEDOUT()) END TimedOut; + +PROCEDURE ConnectionFailed*(e: ErrorCode): BOOLEAN; +BEGIN RETURN (e = ECONNREFUSED()) OR (e = ECONNABORTED()) + OR (e = ENETUNREACH()) OR (e = EHOSTUNREACH()) END ConnectionFailed; + +PROCEDURE Interrupted*(e: ErrorCode): BOOLEAN; +BEGIN RETURN e = EINTR() END Interrupted; + + + +(* OS memory allocaton *) + +PROCEDURE -allocate(size: SYSTEM.ADDRESS): SYSTEM.ADDRESS "(address)((void*)HeapAlloc(GetProcessHeap(), 0, (size_t)size))"; +PROCEDURE OSAllocate*(size: SYSTEM.ADDRESS): SYSTEM.ADDRESS; BEGIN RETURN allocate(size) END OSAllocate; + +PROCEDURE -free(address: SYSTEM.ADDRESS) "HeapFree(GetProcessHeap(), 0, (void*)address)"; +PROCEDURE OSFree*(address: SYSTEM.ADDRESS); BEGIN free(address) END OSFree; + + + + +(* Program startup *) + +PROCEDURE -ExternInitHeap "extern void Heap_InitHeap();"; +PROCEDURE -HeapInitHeap() "Heap_InitHeap()"; + +PROCEDURE Init*(argc: INTEGER; argvadr: SYSTEM.ADDRESS); +VAR av: ArgVecPtr; +BEGIN + MainStackFrame := argvadr; + ArgCount := argc; + av := SYSTEM.VAL(ArgVecPtr, argvadr); + ArgVector := av[0]; + HaltCode := -128; + + (* This function (Platform.Init) is called at program startup BEFORE any + modules have been initalised. In turn we must initialise the heap + before module startup (xxx__init) code is run. *) + HeapInitHeap(); +END Init; + + + + +(* Program arguments and environmet access *) + +PROCEDURE -getenv(name: ARRAY OF CHAR; VAR buf: ARRAY OF CHAR): INTEGER +"(INTEGER)GetEnvironmentVariable((char*)name, (char*)buf, buf__len)"; + +PROCEDURE getEnv*(var: ARRAY OF CHAR; VAR val: ARRAY OF CHAR): BOOLEAN; + VAR + buf: ARRAY 4096 OF CHAR; + res: INTEGER; +BEGIN + res := getenv(var, buf); + IF (res > 0) & (res < LEN(buf)) THEN + COPY(buf, val); + RETURN TRUE; + ELSE + RETURN FALSE; + END; +END getEnv; + +PROCEDURE GetEnv*(var: ARRAY OF CHAR; VAR val: ARRAY OF CHAR); +BEGIN + IF ~getEnv(var, val) THEN val[0] := 0X END; +END GetEnv; + +PROCEDURE GetArg*(n: INTEGER; VAR val: ARRAY OF CHAR); + VAR av: ArgVec; +BEGIN + IF n < ArgCount THEN + av := SYSTEM.VAL(ArgVec,ArgVector); + COPY(av[n]^, val) + END +END GetArg; + +PROCEDURE GetIntArg*(n: INTEGER; VAR val: LONGINT); + VAR s: ARRAY 64 OF CHAR; k, d, i: LONGINT; +BEGIN + s := ""; GetArg(n, s); i := 0; + IF s[0] = "-" THEN i := 1 END ; + k := 0; d := ORD(s[i]) - ORD("0"); + WHILE (d >= 0 ) & (d <= 9) DO k := k*10 + d; INC(i); d := ORD(s[i]) - ORD("0") END ; + IF s[0] = "-" THEN k := -k; DEC(i) END ; + IF i > 0 THEN val := k END +END GetIntArg; + +PROCEDURE ArgPos*(s: ARRAY OF CHAR): INTEGER; + VAR i: INTEGER; arg: ARRAY 256 OF CHAR; +BEGIN + i := 0; GetArg(i, arg); + WHILE (i < ArgCount) & (s # arg) DO INC(i); GetArg(i, arg) END ; + RETURN i +END ArgPos; + + + + + +(* Signals and traps *) + +(* PROCEDURE -signal(sig: LONGINT; func: SignalHandler) "signal(sig, func)"; *) + +(* TODO *) + +(* Ctrl/c handling *) + +PROCEDURE -SetInterruptHandler*(h: SignalHandler) "SystemSetInterruptHandler((address)h)"; +PROCEDURE -SetQuitHandler* (h: SignalHandler) "SystemSetQuitHandler((address)h)"; + +PROCEDURE SetBadInstructionHandler*(handler: SignalHandler); +BEGIN (* TODO *) END SetBadInstructionHandler; + + + + +(* Time of day *) + +PROCEDURE -getLocalTime "SYSTEMTIME st; GetLocalTime(&st)"; +PROCEDURE -stmsec(): INTEGER "(INTEGER)st.wMilliseconds"; +PROCEDURE -stsec(): INTEGER "(INTEGER)st.wSecond"; +PROCEDURE -stmin(): INTEGER "(INTEGER)st.wMinute"; +PROCEDURE -sthour(): INTEGER "(INTEGER)st.wHour"; +PROCEDURE -stmday(): INTEGER "(INTEGER)st.wDay"; +PROCEDURE -stmon(): INTEGER "(INTEGER)st.wMonth"; +PROCEDURE -styear(): INTEGER "(INTEGER)st.wYear"; + +PROCEDURE YMDHMStoClock(ye,mo,da,ho,mi,se: INTEGER; VAR t, d: LONGINT); +BEGIN + d := ASH(ye MOD 100, 9) + ASH(mo+1, 5) + da; + t := ASH(ho, 12) + ASH(mi, 6) + se; +END YMDHMStoClock; + +PROCEDURE GetClock*(VAR t, d: LONGINT); +BEGIN + getLocalTime; + YMDHMStoClock(styear(), stmon(), stmday(), sthour(), stmin(), stsec(), t, d); +END GetClock; + +PROCEDURE -GetTickCount(): LONGINT "(LONGINT)(uint32)GetTickCount()"; + +PROCEDURE Time*(): LONGINT; +VAR ms: LONGINT; +BEGIN + ms := GetTickCount(); + RETURN (ms - TimeStart) MOD 7FFFFFFFH; +END Time; + + +PROCEDURE -sleep(ms: LONGINT) "Sleep((DWORD)ms)"; + +PROCEDURE Delay*(ms: LONGINT); +BEGIN + WHILE ms > 30000 DO sleep(30000); ms := ms-30000 END; + IF ms > 0 THEN sleep(ms) END; +END Delay; + + +PROCEDURE -stToFt "FILETIME ft; SystemTimeToFileTime(&st, &ft)"; +PROCEDURE -ftToUli "ULARGE_INTEGER ul; ul.LowPart=ft.dwLowDateTime; ul.HighPart=ft.dwHighDateTime"; +PROCEDURE -tous1970 "ul.QuadPart = (ul.QuadPart - 116444736000000000ULL)/10LL"; +PROCEDURE -ulSec(): LONGINT "(LONGINT)(ul.QuadPart / 1000000LL)"; +PROCEDURE -uluSec(): LONGINT "(LONGINT)(ul.QuadPart % 1000000LL)"; + +PROCEDURE GetTimeOfDay*(VAR sec, usec: LONGINT); +BEGIN + getLocalTime; stToFt; ftToUli; tous1970; + sec := ulSec(); usec := uluSec(); +END GetTimeOfDay; + + + +(* System call *) + +PROCEDURE -startupInfo "STARTUPINFO si = {0}; si.cb = sizeof(si);"; +PROCEDURE -processInfo "PROCESS_INFORMATION pi = {0};"; +PROCEDURE -createProcess(str: ARRAY OF CHAR): INTEGER "(INTEGER)CreateProcess(0, (char*)str, 0,0,0,0,0,0,&si,&pi)"; +PROCEDURE -waitForProcess(): INTEGER "(INTEGER)WaitForSingleObject(pi.hProcess, INFINITE)"; +PROCEDURE -getExitCodeProcess(VAR exitcode: INTEGER) "GetExitCodeProcess(pi.hProcess, (DWORD*)exitcode);"; +PROCEDURE -cleanupProcess "CloseHandle(pi.hProcess); CloseHandle(pi.hThread);"; +PROCEDURE -err(): INTEGER "(INTEGER)GetLastError()"; + +PROCEDURE System*(cmd : ARRAY OF CHAR): INTEGER; +VAR + result: INTEGER; +BEGIN + result := 127; + startupInfo; processInfo; + IF createProcess(cmd) # 0 THEN + IF waitForProcess() = 0 THEN getExitCodeProcess(result) END; + cleanupProcess; + END; + RETURN result * 256; +END System; + +PROCEDURE Error*(): ErrorCode; BEGIN RETURN err() END Error; + + +(* File system *) + +PROCEDURE -invalidHandleValue(): LONGINT "((LONGINT)(address)INVALID_HANDLE_VALUE)"; + +PROCEDURE -openrw (n: ARRAY OF CHAR): LONGINT +"(LONGINT)(address)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0)"; + +PROCEDURE -openro (n: ARRAY OF CHAR): LONGINT +"(LONGINT)(address)CreateFile((char*)n, GENERIC_READ , FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0)"; + +PROCEDURE -opennew(n: ARRAY OF CHAR): LONGINT +"(LONGINT)(address)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0)"; + + + + +(* File APIs *) + +PROCEDURE OldRO*(VAR n: ARRAY OF CHAR; VAR h: FileHandle): ErrorCode; +VAR fd: LONGINT; +BEGIN + fd := openro(n); + IF (fd = invalidHandleValue()) THEN RETURN err() ELSE h := fd; RETURN 0 END; +END OldRO; + +PROCEDURE OldRW*(VAR n: ARRAY OF CHAR; VAR h: FileHandle): ErrorCode; +VAR fd: LONGINT; +BEGIN + fd := openrw(n); + IF (fd = invalidHandleValue()) THEN RETURN err() ELSE h := fd; RETURN 0 END; +END OldRW; + +PROCEDURE New*(VAR n: ARRAY OF CHAR; VAR h: FileHandle): ErrorCode; +VAR fd: LONGINT; +BEGIN + fd := opennew(n); + IF (fd = invalidHandleValue()) THEN RETURN err() ELSE h := fd; RETURN 0 END; +END New; + + + +PROCEDURE -closeHandle(h: FileHandle): INTEGER "(INTEGER)CloseHandle((HANDLE)(address)h)"; + +PROCEDURE Close*(h: FileHandle): ErrorCode; +BEGIN + IF closeHandle(h) = 0 THEN RETURN err() ELSE RETURN 0 END +END Close; + + + +PROCEDURE -byHandleFileInformation "BY_HANDLE_FILE_INFORMATION bhfi"; +PROCEDURE -getFileInformationByHandle(h: FileHandle): INTEGER "(INTEGER)GetFileInformationByHandle((HANDLE)(address)h, &bhfi)"; +PROCEDURE -bhfiMtimeHigh(): LONGINT "(LONGINT)bhfi.ftLastWriteTime.dwHighDateTime"; +PROCEDURE -bhfiMtimeLow(): LONGINT "(LONGINT)bhfi.ftLastWriteTime.dwLowDateTime"; +PROCEDURE -bhfiVsn(): LONGINT "(LONGINT)bhfi.dwVolumeSerialNumber"; +PROCEDURE -bhfiIndexHigh(): LONGINT "(LONGINT)bhfi.nFileIndexHigh"; +PROCEDURE -bhfiIndexLow(): LONGINT "(LONGINT)bhfi.nFileIndexLow"; + + +PROCEDURE Identify*(h: FileHandle; VAR identity: FileIdentity): ErrorCode; +BEGIN + byHandleFileInformation; + IF getFileInformationByHandle(h) = 0 THEN RETURN err() END; + identity.volume := bhfiVsn(); + identity.indexhigh := bhfiIndexHigh(); + identity.indexlow := bhfiIndexLow(); + identity.mtimehigh := bhfiMtimeHigh(); + identity.mtimelow := bhfiMtimeLow(); + RETURN 0 +END Identify; + +PROCEDURE IdentifyByName*(n: ARRAY OF CHAR; VAR identity: FileIdentity): ErrorCode; +VAR + h: FileHandle; + e,i: ErrorCode; +BEGIN + e := OldRO(n, h); + IF e # 0 THEN RETURN e END; + e := Identify(h, identity); + i := Close(h); + RETURN e; +END IdentifyByName; + + +PROCEDURE SameFile*(i1, i2: FileIdentity): BOOLEAN; +BEGIN RETURN (i1.indexhigh = i2.indexhigh) & (i1.indexlow = i2.indexlow) & (i1.volume = i2.volume) +END SameFile; + +PROCEDURE SameFileTime*(i1, i2: FileIdentity): BOOLEAN; +BEGIN RETURN (i1.mtimehigh = i2.mtimehigh) & (i1.mtimelow = i2.mtimelow) +END SameFileTime; + +PROCEDURE SetMTime*(VAR target: FileIdentity; source: FileIdentity); +BEGIN target.mtimehigh := source.mtimehigh; target.mtimelow := source.mtimelow; +END SetMTime; + +PROCEDURE -identityToFileTime(i: FileIdentity) +"FILETIME ft; ft.dwHighDateTime = i.mtimehigh; ft.dwLowDateTime = i.mtimelow"; + +PROCEDURE -fileTimeToSysTime +"SYSTEMTIME st; FileTimeToSystemTime(&ft, &st)"; + +PROCEDURE MTimeAsClock*(i: FileIdentity; VAR t, d: LONGINT); +BEGIN + identityToFileTime(i); fileTimeToSysTime; + YMDHMStoClock(styear(), stmon(), stmday(), sthour(), stmin(), stsec(), t, d); +END MTimeAsClock; + +PROCEDURE -largeInteger "LARGE_INTEGER li"; +PROCEDURE -liLongint(): LONGINT "(LONGINT)li.QuadPart"; +PROCEDURE -getFileSize(h: FileHandle): INTEGER "(INTEGER)GetFileSizeEx((HANDLE)(address)h, &li)"; + +PROCEDURE Size*(h: FileHandle; VAR l: LONGINT): ErrorCode; +BEGIN + largeInteger; + IF getFileSize(h) = 0 THEN RETURN err() END; + l := liLongint(); + RETURN 0; +END Size; + + +PROCEDURE -readfile (fd: LONGINT; p: SYSTEM.ADDRESS; l: LONGINT; VAR n: SYSTEM.INT32): INTEGER +"(INTEGER)ReadFile((HANDLE)fd, (void*)p, (DWORD)l, (DWORD*)n, 0)"; + +PROCEDURE Read*(h: FileHandle; p: SYSTEM.ADDRESS; l: LONGINT; VAR n: LONGINT): ErrorCode; +VAR result: INTEGER; lengthread: SYSTEM.INT32; +BEGIN + result := readfile(h, p, l, lengthread); + IF result = 0 THEN n := 0; RETURN err() ELSE n := lengthread; RETURN 0 END +END Read; + +PROCEDURE ReadBuf*(h: FileHandle; VAR b: ARRAY OF SYSTEM.BYTE; VAR n: LONGINT): ErrorCode; +VAR result: INTEGER; lengthread: SYSTEM.INT32; +BEGIN + result := readfile(h, SYSTEM.ADR(b), LEN(b), lengthread); + IF result = 0 THEN n := 0; RETURN err() ELSE n := lengthread; RETURN 0 END +END ReadBuf; + + + +PROCEDURE -writefile(fd: LONGINT; p: SYSTEM.ADDRESS; l: LONGINT): INTEGER +"(INTEGER)WriteFile((HANDLE)fd, (void*)(p), (DWORD)l, 0,0)"; + +PROCEDURE Write*(h: FileHandle; p: SYSTEM.ADDRESS; l: LONGINT): ErrorCode; +BEGIN + IF writefile(h, p, l) = 0 THEN RETURN err() ELSE RETURN 0 END +END Write; + + + +PROCEDURE -flushFileBuffers(h: FileHandle): INTEGER "(INTEGER)FlushFileBuffers((HANDLE)h)"; + +PROCEDURE Sync*(h: FileHandle): ErrorCode; +BEGIN + IF flushFileBuffers(h) = 0 THEN RETURN err() ELSE RETURN 0 END +END Sync; + + + +PROCEDURE -setFilePointerEx(h: FileHandle; o: LONGINT; r: INTEGER; VAR rc: INTEGER) +"li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((HANDLE)(address)h, li, 0, (DWORD)r)"; + +PROCEDURE -seekset(): INTEGER "FILE_BEGIN"; +PROCEDURE -seekcur(): INTEGER "FILE_CURRENT"; +PROCEDURE -seekend(): INTEGER "FILE_END"; + +PROCEDURE Seek*(h: FileHandle; o: LONGINT; r: INTEGER): ErrorCode; +VAR rc: INTEGER; +BEGIN + largeInteger; + setFilePointerEx(h, o, r, rc); + IF rc = 0 THEN RETURN err() ELSE RETURN 0 END +END Seek; + + + +PROCEDURE -setEndOfFile(h: FileHandle): INTEGER "(INTEGER)SetEndOfFile((HANDLE)(address)h)"; +PROCEDURE -getFilePos(h: FileHandle; VAR r: LONGINT; VAR rc: INTEGER) +"LARGE_INTEGER liz = {0}; *rc = (INTEGER)SetFilePointerEx((HANDLE)(address)h, liz, &li, FILE_CURRENT); *r = (LONGINT)li.QuadPart"; + +PROCEDURE Truncate*(h: FileHandle; limit: LONGINT): ErrorCode; +VAR rc: INTEGER; oldpos: LONGINT; +BEGIN + largeInteger; + getFilePos(h, oldpos, rc); + IF rc = 0 THEN RETURN err() END; + setFilePointerEx(h, limit, seekset(), rc); + IF rc = 0 THEN RETURN err() END; + IF setEndOfFile(h) = 0 THEN RETURN err() END; + setFilePointerEx(h, oldpos, seekset(), rc); (* Restore original file position *) + IF rc = 0 THEN RETURN err() END; + RETURN 0; +END Truncate; + + + +PROCEDURE -deleteFile(n: ARRAY OF CHAR): INTEGER "(INTEGER)DeleteFile((char*)n)"; + +PROCEDURE Unlink*(VAR n: ARRAY OF CHAR): ErrorCode; +BEGIN + IF deleteFile(n) = 0 THEN RETURN err() ELSE RETURN 0 END +END Unlink; + + +PROCEDURE -setCurrentDirectory(n: ARRAY OF CHAR): INTEGER "(INTEGER)SetCurrentDirectory((char*)n)"; +PROCEDURE -getCurrentDirectory(VAR n: ARRAY OF CHAR) "GetCurrentDirectory(n__len, (char*)n)"; + +PROCEDURE Chdir*(VAR n: ARRAY OF CHAR): ErrorCode; + VAR r: INTEGER; +BEGIN + r := setCurrentDirectory(n); + IF r = 0 THEN RETURN err() END; + getCurrentDirectory(CWD); + RETURN 0; +END Chdir; + + + +PROCEDURE -moveFile(o,n: ARRAY OF CHAR): INTEGER +"(INTEGER)MoveFileEx((char*)o, (char*)n, MOVEFILE_REPLACE_EXISTING)"; + +PROCEDURE Rename*(VAR o,n: ARRAY OF CHAR): ErrorCode; +BEGIN + IF moveFile(o,n) = 0 THEN RETURN err() ELSE RETURN 0 END +END Rename; + + + + +(* Process termination *) + +PROCEDURE -exit(code: INTEGER) "ExitProcess((UINT)code)"; +PROCEDURE Exit*(code: INTEGER); +BEGIN exit(code) END Exit; + + +PROCEDURE -errstring(s: ARRAY OF CHAR) 'WriteFile((HANDLE)(address)Platform_StdOut, s, s__len-1, 0,0)'; +PROCEDURE -errc (c: CHAR) 'WriteFile((HANDLE)(address)Platform_StdOut, &c, 1, 0,0)'; +PROCEDURE errch(c: CHAR); BEGIN errc(c) END errch; +PROCEDURE errln; BEGIN errch(0DX); errch(0AX) END errln; + +PROCEDURE errposint(l: LONGINT); +BEGIN IF l>10 THEN errposint(l DIV 10) END; errch(CHR(ORD('0') + (l MOD 10))) END errposint; + +PROCEDURE errint(l: LONGINT); +BEGIN IF l<0 THEN errch('-'); l := -l END; errposint(l) END errint; + +PROCEDURE DisplayHaltCode(code: LONGINT); +BEGIN + CASE code OF + | -1: errstring("Rider ReadBuf/WriteBuf transfer size longer than buffer.") + | -2: errstring("Index out of range.") + | -3: errstring("Reached end of function without reaching RETURN.") + | -4: errstring("CASE statement: no matching label and no ELSE.") + | -5: errstring("Type guard failed.") + | -6: errstring("Type equality failed.") + | -7: errstring("WITH statement type guard failed.") + | -8: errstring("SHORT: Value too large for shorter type.") + | -9: errstring("Heap interrupted while locked, but lockdepth = 0 at unlock.") + |-10: errstring("NIL access."); + |-11: errstring("Alignment error."); + |-12: errstring("Divide by zero."); + |-13: errstring("Arithmetic overflow/underflow."); + |-14: errstring("Invalid function argument."); + |-15: errstring("Internal error, e.g. Type descriptor size mismatch.") + |-20: errstring("Too many, or negative number of, elements in dynamic array.") + ELSE + END +END DisplayHaltCode; + +PROCEDURE Halt*(code: LONGINT); +BEGIN + HaltCode := code; + IF HaltHandler # NIL THEN HaltHandler(code) END; + errstring("Terminated by Halt("); errint(code); errstring("). "); + IF code < 0 THEN DisplayHaltCode(code) END; + errln; + exit(SYSTEM.VAL(INTEGER,code)); +END Halt; + +PROCEDURE AssertFail*(code: LONGINT); +BEGIN + errstring("Assertion failure."); + IF code # 0 THEN errstring(" ASSERT code "); errint(code); errstring("."); END; + errln; + exit(SYSTEM.VAL(INTEGER,code)); +END AssertFail; + +PROCEDURE SetHalt*(p: HaltProcedure); +BEGIN HaltHandler := p; END SetHalt; + + + + +PROCEDURE TestLittleEndian; + VAR i: INTEGER; + BEGIN i := 1; SYSTEM.GET(SYSTEM.ADR(i), LittleEndian); END TestLittleEndian; + + +PROCEDURE -getstdinhandle(): FileHandle "(address)GetStdHandle(STD_INPUT_HANDLE)"; +PROCEDURE -getstdouthandle(): FileHandle "(address)GetStdHandle(STD_OUTPUT_HANDLE)"; +PROCEDURE -getstderrhandle(): FileHandle "(address)GetStdHandle(STD_ERROR_HANDLE)"; +PROCEDURE -getpid(): INTEGER "(INTEGER)GetCurrentProcessId()"; + +BEGIN + TestLittleEndian; + + HaltCode := -128; + HaltHandler := NIL; + TimeStart := 0; TimeStart := Time(); + CWD := ""; getCurrentDirectory(CWD); + PID := getpid(); + + SeekSet := seekset(); + SeekCur := seekcur(); + SeekEnd := seekend(); + + StdIn := getstdinhandle(); + StdOut := getstdouthandle(); + StdErr := getstderrhandle(); + + nl[0] := 0DX; (* CR *) + nl[1] := 0AX; (* LF *) + nl[2] := 0X; +END Platform. diff --git a/src/runtime/Reals.Mod b/src/runtime/Reals.Mod new file mode 100644 index 00000000..f9e6617b --- /dev/null +++ b/src/runtime/Reals.Mod @@ -0,0 +1,136 @@ +MODULE Reals; + (* JT, 5.2.90 / RC 9.12.91 conversion between reals and strings for HP-700, MB 9.12.91, JT for Ofront, 16.3. 95*) + (* DCWB 20160817 Made independent of INTEGER size *) + + IMPORT SYSTEM; + + PROCEDURE Ten*(e: INTEGER): REAL; + VAR r, power: LONGREAL; + BEGIN r := 1.0; + power := 10.0; + WHILE e > 0 DO + IF ODD(e) THEN r := r * power END ; + power := power * power; e := e DIV 2 + END ; + RETURN SHORT(r) + END Ten; + + + PROCEDURE TenL*(e: INTEGER): LONGREAL; + VAR r, power: LONGREAL; + BEGIN r := 1.0; + power := 10.0; + LOOP + IF ODD(e) THEN r := r * power END ; + e := e DIV 2; + IF e <= 0 THEN RETURN r END ; + power := power * power + END + END TenL; + + + (* Real number format (IEEE 754) + + TYPE REAL - Single precision / binary32: + 1/sign, 8/exponent, 23/significand + + TYPE LONGREAL - Double precision / binary64: + 1/sign, 11/exponent, 52/significand + + exponent: + stored as exponent value + 127. + + significand (fraction): + excludes leading (most significant) bit which is assumed to be 1. + *) + + + PROCEDURE Expo*(x: REAL): INTEGER; + VAR i: INTEGER; + BEGIN + SYSTEM.GET(SYSTEM.ADR(x)+2, i); + RETURN (i DIV 128) MOD 256 + END Expo; + + PROCEDURE SetExpo*(VAR x: REAL; ex: INTEGER); + VAR c: CHAR; + BEGIN + (* Replace exponent bits within top byte of REAL *) + SYSTEM.GET(SYSTEM.ADR(x)+3, c); + SYSTEM.PUT(SYSTEM.ADR(x)+3, CHR(((ORD(c) DIV 128) * 128) + ((ex DIV 2) MOD 128))); + (* Replace exponent bits within 2nd byte of REAL *) + SYSTEM.GET(SYSTEM.ADR(x)+2, c); + SYSTEM.PUT(SYSTEM.ADR(x)+2, CHR((ORD(c) MOD 128) + ((ex MOD 2) * 128))) + END SetExpo; + + PROCEDURE ExpoL*(x: LONGREAL): INTEGER; + VAR i: INTEGER; + BEGIN + SYSTEM.GET(SYSTEM.ADR(x)+6, i); + RETURN (i DIV 16) MOD 2048 + END ExpoL; + + (* Convert LONGREAL: Write positive integer value of x into array d. + The value is stored backwards, i.e. least significant digit + first. n digits are written, with trailing zeros fill. + On entry x has been scaled to the number of digits required. *) + PROCEDURE ConvertL*(x: LONGREAL; n: INTEGER; VAR d: ARRAY OF CHAR); + VAR i, j, k: LONGINT; + BEGIN + IF x < 0 THEN x := -x END; + k := 0; + + IF (SIZE(LONGINT) < 8) & (n > 9) THEN + (* There are more decimal digits than can be held in a single LONGINT *) + i := ENTIER(x / 1000000000.0D0); (* The 10th and higher digits *) + j := ENTIER(x - (i * 1000000000.0D0)); (* The low 9 digits *) + (* First generate the low 9 digits. *) + IF j < 0 THEN j := 0 END; + WHILE k < 9 DO + d[k] := CHR(j MOD 10 + 48); j := j DIV 10; INC(k) + END; + (* Fall through to generate the upper digits *) + ELSE + (* We can generate all the digits in one go. *) + i := ENTIER(x); + END; + + WHILE k < n DO + d[k] := CHR(i MOD 10 + 48); i := i DIV 10; INC(k) + END + END ConvertL; + + + PROCEDURE Convert*(x: REAL; n: INTEGER; VAR d: ARRAY OF CHAR); + BEGIN ConvertL(x, n, d) + END Convert; + + PROCEDURE ToHex(i: INTEGER): CHAR; + BEGIN + IF i < 10 THEN RETURN CHR(i+48) + ELSE RETURN CHR(i+55) END + END ToHex; + + PROCEDURE BytesToHex(VAR b, d: ARRAY OF SYSTEM.BYTE); + VAR i: INTEGER; l: LONGINT; by: CHAR; + BEGIN + i := 0; l := LEN(b); + WHILE i < l DO + by := SYSTEM.VAL(CHAR, b[i]); + d[i*2] := ToHex(ORD(by) DIV 16); + d[i*2+1] := ToHex(ORD(by) MOD 16); + INC(i) + END + END BytesToHex; + + (* Convert Hex *) + PROCEDURE ConvertH*(y: REAL; VAR d: ARRAY OF CHAR); + BEGIN BytesToHex(y, d) + END ConvertH; + + (* Convert Hex Long *) + PROCEDURE ConvertHL*(x: LONGREAL; VAR d: ARRAY OF CHAR); + BEGIN BytesToHex(x, d) + END ConvertHL; + +END Reals. diff --git a/src/runtime/Strings.Mod b/src/runtime/Strings.Mod new file mode 100644 index 00000000..e6fe12ac --- /dev/null +++ b/src/runtime/Strings.Mod @@ -0,0 +1,156 @@ +(*------------------------------------------------------------- +Strings provides a set of operations on strings (i.e., on string constants and character +arrays, both of which contain the character 0X as a terminator). All positions in +strings start at 0. +Strings.Length(s) + returns the number of characters in s up to and excluding the first 0X. +Strings.Insert(src, pos, dst) + inserts the string src into the string dst at position pos (0 <= pos <= Length(dst)). + If pos = Length(dst), src is appended to dst. If the size of dst is not large enough + to hold the result of the operation, the result is truncated so that dst is always + terminated with a 0X. +Strings.Append(s, dst) + has the same effect as Insert(s, Length(s), dst). +Strings.Delete(s, pos, n) + deletes n characters from s starting at position pos (0 <= pos < Length(s)). + If n > Length(s) - pos, the new length of s is pos. +Strings.Replace(src, pos, dst) + has the same effect as Delete(dst, pos, Length(src)) followed by an Insert(src, pos, dst). +Strings.Extract(src, pos, n, dst) + extracts a substring dst with n characters from position pos (0 <= pos < Length(src)) in src. + If n > Length(src) - pos, dst is only the part of src from pos to Length(src) - 1. If the size of + dst is not large enough to hold the result of the operation, the result is truncated so that + dst is always terminated with a 0X. +Strings.Pos(pat, s, pos) + returns the position of the first occurrence of pat in s after position pos (inclusive). + If pat is not found, -1 is returned. +Strings.Cap(s) + replaces each lower case letter in s by its upper case equivalent. +-------------------------------------------------------------*) +(* added from trianus v4 *) +MODULE Strings; (*HM 94-06-22 / *) + + +PROCEDURE Length* (s: ARRAY OF CHAR): INTEGER; + VAR i: INTEGER; +BEGIN + i := 0; WHILE (i < LEN(s)) & (s[i] # 0X) DO INC(i) END ; + RETURN i +END Length; + + +PROCEDURE Append* (extra: ARRAY OF CHAR; VAR dest: ARRAY OF CHAR); + VAR n1, n2, i: INTEGER; +BEGIN + n1 := Length(dest); n2 := Length(extra); i := 0; + WHILE (i < n2) & (i + n1 < LEN(dest)) DO dest[i + n1] := extra[i]; INC(i) END ; + IF i + n1 < LEN(dest) THEN dest[i + n1] := 0X END +END Append; + + +PROCEDURE Insert* (source: ARRAY OF CHAR; pos: INTEGER; VAR dest: ARRAY OF CHAR); + VAR n1, n2, i: INTEGER; +BEGIN + n1 := Length(dest); n2 := Length(source); + IF pos < 0 THEN pos := 0 END ; + IF pos > n1 THEN Append(dest, source); RETURN END ; + IF pos + n2 < LEN(dest) THEN (*make room for source*) + i := n1; (*move also 0X if it is there*) + WHILE i >= pos DO + IF i + n2 < LEN(dest) THEN dest[i + n2] := dest[i] END ; + DEC(i) + END + END ; + i := 0; WHILE i < n2 DO dest[pos + i] := source[i]; INC(i) END +END Insert; + + +PROCEDURE Delete* (VAR s: ARRAY OF CHAR; pos, n: INTEGER); + VAR len, i: INTEGER; +BEGIN + len:=Length(s); + IF pos < 0 THEN pos:=0 ELSIF pos >= len THEN RETURN END ; + IF pos + n < len THEN + i:=pos + n; WHILE i < len DO s[i - n]:=s[i]; INC(i) END ; + IF i - n < LEN(s) THEN s[i - n]:=0X END + ELSE s[pos]:=0X + END +END Delete; + + +PROCEDURE Replace* (source: ARRAY OF CHAR; pos: INTEGER; VAR dest: ARRAY OF CHAR); +BEGIN + Delete(dest, pos, pos + Length(source)); + Insert(source, pos, dest) +END Replace; + + +PROCEDURE Extract* (source: ARRAY OF CHAR; pos, n: INTEGER; VAR dest: ARRAY OF CHAR); + VAR len, destLen, i: INTEGER; +BEGIN + len := Length(source); destLen := SHORT(LEN(dest)) - 1; + IF pos < 0 THEN pos := 0 END ; + IF pos >= len THEN dest[0] := 0X; RETURN END ; + i := 0; + WHILE (pos + i <= LEN(source)) & (source[pos + i] # 0X) & (i < n) DO + IF i < destLen THEN dest[i] := source[pos + i] END ; + INC(i) + END ; + dest[i] := 0X +END Extract; + + +PROCEDURE Pos* (pattern, s: ARRAY OF CHAR; pos: INTEGER): INTEGER; + VAR n1, n2, i, j: INTEGER; +BEGIN + n1 := Length(s); n2 := Length(pattern); + IF n2 = 0 THEN RETURN 0 END ; + i := pos; + WHILE i <= n1 - n2 DO + IF s[i] = pattern[0] THEN + j := 1; WHILE (j < n2) & (s[i + j] = pattern[j]) DO INC(j) END ; + IF j = n2 THEN RETURN i END + END ; + INC(i) + END ; + RETURN -1 +END Pos; + + +PROCEDURE Cap* (VAR s: ARRAY OF CHAR); + VAR i: INTEGER; +BEGIN + i := 0; + WHILE s[i] # 0X DO + IF ("a" <= s[i]) & (s[i] <= "z") THEN s[i] := CAP(s[i]) END ; + INC(i) + END +END Cap; + + +PROCEDURE Match* (string, pattern: ARRAY OF CHAR): BOOLEAN; + + PROCEDURE M (VAR name, mask: ARRAY OF CHAR; n, m: INTEGER): BOOLEAN; + BEGIN + WHILE (n >= 0) & (m >= 0) & (mask[m] # "*") DO + IF name[n] # mask[m] THEN RETURN FALSE END ; + DEC(n); DEC(m) + END ; + (* ----- name empty | mask empty | mask ends with "*" *) + IF m < 0 THEN RETURN n < 0 END ; + (* ----- name empty | mask ends with "*" *) + WHILE (m >= 0) & (mask[m] = "*") DO DEC(m) END ; + IF m < 0 THEN RETURN TRUE END ; + (* ----- name empty | mask still to be matched *) + WHILE n >= 0 DO + IF M(name, mask, n, m) THEN RETURN TRUE END ; + DEC(n) + END ; + RETURN FALSE + END M; + +BEGIN + RETURN M(string, pattern, Length(string)-1, Length(pattern)-1) +END Match; + +END Strings. diff --git a/src/runtime/Texts.Mod b/src/runtime/Texts.Mod new file mode 100644 index 00000000..305b225d --- /dev/null +++ b/src/runtime/Texts.Mod @@ -0,0 +1,881 @@ +MODULE Texts; (** CAS/HM 23.9.93 -- interface based on Texts by JG/NW 6.12.91**) (* << RC, MB, JT *) + IMPORT + Files, Modules, Reals, SYSTEM; + + (*--- insert field e: Elem into Texts.Scanner and change Texts.Scan to set it in case of class=6 *) + + + CONST + Displaywhite = 15; + ElemChar* = 1CX; + TAB = 9X; CR = 0DX; maxD = 9; + (**FileMsg.id**) + load* = 0; store* = 1; + (**Notifier op**) + replace* = 0; insert* = 1; delete* = 2; unmark* = 3; + (**Scanner.class**) + Inval* = 0; Name* = 1; String* = 2; Int* = 3; Real* = 4; LongReal* = 5; Char* = 6; + + textTag = 0F0X; DocBlockId = 0F7X; version = 01X; + + TYPE + FontsFont = POINTER TO FontDesc; + FontDesc = RECORD + name: ARRAY 32 OF CHAR; + END ; + + Run = POINTER TO RunDesc; + RunDesc = RECORD + prev, next: Run; + len: LONGINT; + fnt: FontsFont; + col, voff: SYSTEM.INT8; + ascii: BOOLEAN (* << *) + END; + + Piece = POINTER TO PieceDesc; + PieceDesc = RECORD (RunDesc) + file: Files.File; + org: LONGINT + END; + + Elem* = POINTER TO ElemDesc; + Buffer* = POINTER TO BufDesc; + Text* = POINTER TO TextDesc; + + ElemMsg* = RECORD END; + Handler* = PROCEDURE (e: Elem; VAR msg: ElemMsg); + + ElemDesc* = RECORD (RunDesc) + W*, H*: LONGINT; + handle*: Handler; + base: Text + END; + + FileMsg* = RECORD (ElemMsg) + id*: INTEGER; + pos*: LONGINT; + r*: Files.Rider + END; + + CopyMsg* = RECORD (ElemMsg) + e*: Elem + END; + + IdentifyMsg* = RECORD (ElemMsg) + mod*, proc*: ARRAY 32 OF CHAR + END; + + + BufDesc* = RECORD + len*: LONGINT; + head: Run + END; + + Notifier* = PROCEDURE (T: Text; op: INTEGER; beg, end: LONGINT); + TextDesc* = RECORD + len*: LONGINT; + notify*: Notifier; + head, cache: Run; + corg: LONGINT + END; + + Reader* = RECORD + eot*: BOOLEAN; + fnt*: FontsFont; + col*, voff*: SYSTEM.INT8; + elem*: Elem; + rider: Files.Rider; + run: Run; + org, off: LONGINT + END; + + Scanner* = RECORD (Reader) + nextCh*: CHAR; + line*, class*: INTEGER; + i*: LONGINT; + x*: REAL; + y*: LONGREAL; + c*: CHAR; + len*: SHORTINT; + s*: ARRAY 64 OF CHAR (* << *) + END; + + Writer* = RECORD + buf*: Buffer; + fnt*: FontsFont; + col*, voff*: SYSTEM.INT8; + rider: Files.Rider; + file: Files.File + END; + + Alien = POINTER TO RECORD (ElemDesc) + file: Files.File; + org, span: LONGINT; + mod, proc: ARRAY 32 OF CHAR + END; + + VAR + new*: Elem; + del: Buffer; + FontsDefault: FontsFont; + + + PROCEDURE FontsThis(VAR name: ARRAY OF CHAR): FontsFont; + VAR F: FontsFont; + BEGIN + NEW(F); COPY(name, F.name); RETURN F + END FontsThis; + + (* run primitives *) + + PROCEDURE Find (T: Text; VAR pos: LONGINT; VAR u: Run; VAR org, off: LONGINT); + VAR v: Run; m: LONGINT; + BEGIN + IF pos >= T.len THEN pos := T.len; u := T.head; org := T.len; off := 0; T.cache := T.head; T.corg := 0 + ELSE v := T.cache.next; m := pos - T.corg; + IF pos >= T.corg THEN + WHILE m >= v.len DO DEC(m, v.len); v := v.next END + ELSE + WHILE m < 0 DO v := v.prev; INC(m, v.len) END; + END; + u := v; org := pos - m; off := m; T.cache := v.prev; T.corg := org + END + END Find; + + PROCEDURE Split (off: LONGINT; VAR u, un: Run); + VAR p, U: Piece; + BEGIN + IF off = 0 THEN un := u; u := un.prev + ELSIF off >= u.len THEN un := u.next + ELSE NEW(p); un := p; U := u(Piece); + p^ := U^; INC(p.org, off); DEC(p.len, off); DEC(U.len, p.len); + p.ascii := u.ascii; p.prev := U; p.next := U.next; p.next.prev := p; U.next := p (* << *) + END + END Split; + + PROCEDURE Merge (T: Text; u: Run; VAR v: Run); + VAR p, q: Piece; + BEGIN + IF (u IS Piece) & (v IS Piece) & (u.fnt.name = v.fnt.name) & (u.col = v.col) & (u.voff = v.voff) + & (u(Piece).ascii = v(Piece).ascii) THEN (* << *) + p := u(Piece); q := v(Piece); + IF (p.file = q.file) & (p.org + p.len = q.org) THEN + IF T.cache = u THEN INC(T.corg, q.len) + ELSIF T.cache = v THEN T.cache := T.head; T.corg := 0 + END; + INC(p.len, q.len); v := v.next + END + END + END Merge; + + PROCEDURE Splice (un, v, w: Run; base: Text); (* (u, un) -> (u, v, w, un) *) + VAR u: Run; + BEGIN + IF v # w.next THEN u := un.prev; + u.next := v; v.prev := u; un.prev := w; w.next := un; + REPEAT + IF v IS Elem THEN v(Elem).base := base END; + v := v.next + UNTIL v = un + END + END Splice; + + PROCEDURE ClonePiece (p: Piece): Piece; + VAR q: Piece; + BEGIN NEW(q); q^ := p^; RETURN q + END ClonePiece; + + PROCEDURE CloneElem (e: Elem): Elem; + VAR msg: CopyMsg; + BEGIN msg.e := NIL; e.handle(e, msg); RETURN msg.e + END CloneElem; + + + (** Elements **) + + PROCEDURE CopyElem* (SE, DE: Elem); + BEGIN DE.len := SE.len; DE.fnt := SE.fnt; DE.col := SE.col; DE.voff := SE.voff; + DE.W := SE.W; DE.H := SE.H; DE.handle := SE.handle + END CopyElem; + + PROCEDURE ElemBase* (E: Elem): Text; + BEGIN RETURN E.base + END ElemBase; + + PROCEDURE ElemPos* (E: Elem): LONGINT; + VAR u: Run; pos: LONGINT; + BEGIN u := E.base.head.next; pos := 0; + WHILE u # E DO pos := pos + u.len; u := u.next END; + RETURN pos + END ElemPos; + + + PROCEDURE HandleAlien (E: Elem; VAR msg: ElemMsg); + VAR e: Alien; r: Files.Rider; i: LONGINT; ch: CHAR; + BEGIN + WITH E: Alien DO + IF msg IS CopyMsg THEN + WITH msg: CopyMsg DO NEW(e); CopyElem(E, e); + e.file := E.file; e.org := E.org; e.span := E.span; e.mod := E.mod; e.proc := E.proc; + msg.e := e + END + ELSIF msg IS IdentifyMsg THEN + WITH msg: IdentifyMsg DO + COPY(E.mod, msg.mod); COPY(E.proc, msg.proc); msg.mod[31] := 1X (*alien*) + END + ELSIF msg IS FileMsg THEN + WITH msg: FileMsg DO + IF msg.id = store THEN Files.Set(r, E.file, E.org); i := E.span; + WHILE i > 0 DO Files.Read(r, ch); Files.Write(msg.r, ch); DEC(i) END + END + END + END + END + END HandleAlien; + + + (** Buffers **) + + PROCEDURE OpenBuf* (B: Buffer); + VAR u: Run; + BEGIN NEW(u); u.next := u; u.prev := u; B.head := u; B.len := 0 + END OpenBuf; + + PROCEDURE Copy* (SB, DB: Buffer); + VAR u, v, vn: Run; + BEGIN u := SB.head.next; v := DB.head.prev; + WHILE u # SB.head DO + IF u IS Piece THEN vn := ClonePiece(u(Piece)) ELSE vn := CloneElem(u(Elem)) END; + v.next := vn; vn.prev := v; v := vn; u := u.next + END; + v.next := DB.head; DB.head.prev := v; + INC(DB.len, SB.len) + END Copy; + + PROCEDURE Recall* (VAR B: Buffer); + BEGIN B := del; del := NIL + END Recall; + + + (** Texts **) + + PROCEDURE Save* (T: Text; beg, end: LONGINT; B: Buffer); + VAR u, v, w, wn: Run; uo, ud, vo, vd: LONGINT; + BEGIN Find(T, beg, u, uo, ud); Find(T, end, v, vo, vd); + w := B.head.prev; + WHILE u # v DO + IF u IS Piece THEN wn := ClonePiece(u(Piece)); DEC(wn.len, ud); INC(wn(Piece).org, ud) + ELSE wn := CloneElem(u(Elem)) + END; + w.next := wn; wn.prev := w; w := wn; u := u.next; ud := 0 + END; + IF vd > 0 THEN (*v IS Piece*) wn := ClonePiece(v(Piece)); wn.len := vd - ud; INC(wn(Piece).org, ud); + w.next := wn; wn.prev := w; w := wn + END; + w.next := B.head; B.head.prev := w; + INC(B.len, end - beg) + END Save; + + PROCEDURE Insert* (T: Text; pos: LONGINT; B: Buffer); + VAR u, un, v: Run; p, q: Piece; uo, ud, len: LONGINT; + BEGIN Find(T, pos, u, uo, ud); Split(ud, u, un); + len := B.len; v := B.head.next; + Merge(T, u, v); Splice(un, v, B.head.prev, T); + INC(T.len, len); B.head.next := B.head; B.head.prev := B.head; B.len := 0; + IF T.notify # NIL THEN T.notify(T, insert, pos, pos+len) END + END Insert; + + PROCEDURE Append* (T: Text; B: Buffer); + VAR v: Run; pos, len: LONGINT; + BEGIN pos := T.len; len := B.len; v := B.head.next; + Merge(T, T.head.prev, v); Splice(T.head, v, B.head.prev, T); + INC(T.len, len); B.head.next := B.head; B.head.prev := B.head; B.len := 0; + IF T.notify # NIL THEN T.notify(T, insert, pos, pos+len) END + END Append; + + PROCEDURE Delete* (T: Text; beg, end: LONGINT); + VAR c, u, un, v, vn: Run; co, uo, ud, vo, vd: LONGINT; + BEGIN + Find(T, beg, u, uo, ud); Split(ud, u, un); c := T.cache; co := T.corg; + Find(T, end, v, vo, vd); Split(vd, v, vn); T.cache := c; T.corg := co; + NEW(del); OpenBuf(del); del.len := end - beg; + Splice(del.head, un, v, NIL); + Merge(T, u, vn); u.next := vn; vn.prev := u; + DEC(T.len, end - beg); + IF T.notify # NIL THEN T.notify(T, delete, beg, end) END + END Delete; + + PROCEDURE ChangeLooks* (T: Text; beg, end: LONGINT; sel: SET; fnt: FontsFont; col, voff: SYSTEM.INT8); + VAR c, u, un, v, vn: Run; co, uo, ud, vo, vd: LONGINT; + BEGIN Find(T, beg, u, uo, ud); Split(ud, u, un); c := T.cache; co := T.corg; + Find(T, end, v, vo, vd); Split(vd, v, vn); T.cache := c; T.corg := co; + WHILE un # vn DO + IF (0 IN sel) & (fnt # NIL) THEN un.fnt := fnt END; + IF 1 IN sel THEN un.col := col END; + IF 2 IN sel THEN un.voff := voff END; + Merge(T, u, un); + IF u.next = un THEN u := un; un := un.next ELSE u.next := un; un.prev := u END + END; + Merge(T, u, un); u.next := un; un.prev := u; + IF T.notify # NIL THEN T.notify(T, replace, beg, end) END + END ChangeLooks; + + + (** Readers **) + + PROCEDURE OpenReader* (VAR R: Reader; T: Text; pos: LONGINT); + VAR u: Run; + BEGIN + IF pos >= T.len THEN pos := T.len END; + Find(T, pos, u, R.org, R.off); R.run := u; R.eot := FALSE; + IF u IS Piece THEN + Files.Set(R.rider, u(Piece).file, u(Piece).org + R.off) + END + END OpenReader; + + PROCEDURE Read* (VAR R: Reader; VAR ch: CHAR); + VAR u: Run; pos: LONGINT; nextch: CHAR; + BEGIN u := R.run; R.fnt := u.fnt; R.col := u.col; R.voff := u.voff; INC(R.off); + IF u IS Piece THEN Files.Read(R.rider, ch); R.elem := NIL; + IF (ch = 0AX) & u(Piece).ascii THEN ch := CR (* << LF to CR *) + ELSIF (ch = CR) & u(Piece).ascii THEN (* << CR LF to CR *) + pos := Files.Pos(R.rider); Files.Read(R.rider, nextch); + IF nextch = 0AX THEN INC(R.off) ELSE Files.Set(R.rider, u(Piece).file, pos) END + END + ELSIF u IS Elem THEN ch := ElemChar; R.elem := u(Elem) + ELSE ch := 0X; R.elem := NIL; R.eot := TRUE + END; + IF R.off = u.len THEN INC(R.org, u.len); u := u.next; + IF u IS Piece THEN + WITH u: Piece DO Files.Set(R.rider, u.file, u.org) END + END; + R.run := u; R.off := 0 + END + END Read; + + PROCEDURE ReadElem* (VAR R: Reader); + VAR u, un: Run; + BEGIN u := R.run; + WHILE u IS Piece DO INC(R.org, u.len); u := u.next END; + IF u IS Elem THEN un := u.next; R.run := un; INC(R.org); R.off := 0; + R.fnt := u.fnt; R.col := u.col; R.voff := u.voff; R.elem := u(Elem); + IF un IS Piece THEN + WITH un: Piece DO Files.Set(R.rider, un.file, un.org) END + END + ELSE R.eot := TRUE; R.elem := NIL + END + END ReadElem; + + PROCEDURE ReadPrevElem* (VAR R: Reader); + VAR u: Run; + BEGIN u := R.run.prev; + WHILE u IS Piece DO DEC(R.org, u.len); u := u.prev END; + IF u IS Elem THEN R.run := u; DEC(R.org); R.off := 0; + R.fnt := u.fnt; R.col := u.col; R.voff := u.voff; R.elem := u(Elem) + ELSE R.eot := TRUE; R.elem := NIL + END + END ReadPrevElem; + + PROCEDURE Pos* (VAR R: Reader): LONGINT; + BEGIN RETURN R.org + R.off + END Pos; + + + (** Scanners --------------- NW --------------- **) + + PROCEDURE OpenScanner* (VAR S: Scanner; T: Text; pos: LONGINT); + BEGIN OpenReader(S, T, pos); S.line := 0; S.nextCh := " " + END OpenScanner; + + (*IEEE floating point formats: + x = 2^(e-127) * 1.m bit 0: sign, bits 1- 8: e, bits 9-31: m + x = 2^(e-1023) * 1.m bit 0: sign, bits 1-11: e, bits 12-63: m *) + + PROCEDURE Scan* (VAR S: Scanner); + CONST maxD = 32; + VAR ch, term: CHAR; + neg, negE, hex: BOOLEAN; + i, j, h: SHORTINT; + e: INTEGER; k: LONGINT; + x, f: REAL; y, g: LONGREAL; + d: ARRAY maxD OF CHAR; + + PROCEDURE ReadScaleFactor; + BEGIN Read(S, ch); + IF ch = "-" THEN negE := TRUE; Read(S, ch) + ELSE negE := FALSE; + IF ch = "+" THEN Read(S, ch) END + END; + WHILE ("0" <= ch) & (ch <= "9") DO + e := e*10 + ORD(ch) - 30H; Read(S, ch) + END + END ReadScaleFactor; + + BEGIN ch := S.nextCh; i := 0; + LOOP + IF ch = CR THEN INC(S.line) + ELSIF (ch # " ") & (ch # TAB) THEN EXIT + END ; + Read(S, ch) + END; + IF ("A" <= CAP(ch)) & (CAP(ch) <= "Z") OR (ch = "/") OR (ch = ".") THEN (*name*) (* << *) + REPEAT S.s[i] := ch; INC(i); Read(S, ch) + UNTIL (CAP(ch) > "Z") & (ch # "_") (* << *) + OR ("A" > CAP(ch)) & (ch > "9") + OR ("0" > ch) & (ch # ".") & (ch # "/") (* << *) + OR (i = 63); (* << *) + S.s[i] := 0X; S.len := i; S.class := 1 + ELSIF ch = 22X THEN (*literal string*) + Read(S, ch); + WHILE (ch # 22X) & (ch >= " ") & (i # 63) DO (* << *) + S.s[i] := ch; INC(i); Read(S, ch) + END; + S.s[i] := 0X; S.len := i+1; Read(S, ch); S.class := 2 + ELSE + IF ch = "-" THEN neg := TRUE; Read(S, ch) ELSE neg := FALSE END ; + IF ("0" <= ch) & (ch <= "9") THEN (*number*) + hex := FALSE; j := 0; + LOOP d[i] := ch; INC(i); Read(S, ch); + IF ch < "0" THEN EXIT END; + IF "9" < ch THEN + IF ("A" <= ch) & (ch <= "F") THEN hex := TRUE; ch := CHR(ORD(ch)-7) + ELSIF ("a" <= ch) & (ch <= "f") THEN hex := TRUE; ch := CHR(ORD(ch)-27H) + ELSE EXIT + END + END + END; + IF ch = "H" THEN (*hex number*) + Read(S, ch); S.class := 3; + IF i-j > 8 THEN j := i-8 END ; + k := ORD(d[j]) - 30H; INC(j); + IF (i-j = 7) & (k >= 8) THEN DEC(k, 16) END ; + WHILE j < i DO k := k*10H + (ORD(d[j]) - 30H); INC(j) END ; + IF neg THEN S.i := -k ELSE S.i := k END + ELSIF ch = "." THEN (*read real*) + Read(S, ch); h := i; + WHILE ("0" <= ch) & (ch <= "9") DO d[i] := ch; INC(i); Read(S, ch) END ; + IF ch = "D" THEN + e := 0; y := 0; g := 1; + REPEAT y := y*10 + (ORD(d[j]) - 30H); INC(j) UNTIL j = h; + WHILE j < i DO g := g/10; y := (ORD(d[j]) - 30H)*g + y; INC(j) END ; + ReadScaleFactor; + IF negE THEN + IF e <= 308 THEN y := y / Reals.TenL(e) ELSE y := 0 END + ELSIF e > 0 THEN + IF e <= 308 THEN y := Reals.TenL(e) * y ELSE HALT(40) END + END ; + IF neg THEN y := -y END ; + S.class := 5; S.y := y + ELSE e := 0; x := 0; f := 1; + REPEAT x := x*10 + (ORD(d[j]) - 30H); INC(j) UNTIL j = h; + WHILE j < i DO f := f/10; x := (ORD(d[j])-30H)*f + x; INC(j) END; + IF ch = "E" THEN ReadScaleFactor END ; + IF negE THEN + IF e <= 38 THEN x := x / Reals.Ten(e) ELSE x := 0 END + ELSIF e > 0 THEN + IF e <= 38 THEN x := Reals.Ten(e) * x ELSE HALT(40) END + END ; + IF neg THEN x := -x END ; + S.class := 4; S.x := x + END ; + IF hex THEN S.class := 0 END + ELSE (*decimal integer*) + S.class := 3; k := 0; + REPEAT k := k*10 + (ORD(d[j]) - 30H); INC(j) UNTIL j = i; + IF neg THEN S.i := -k ELSE S.i := k END; + IF hex THEN S.class := 0 ELSE S.class := 3 END + END + ELSE S.class := 6; + IF neg THEN S.c := "-" ELSE S.c := ch; Read(S, ch) END + END + END; + S.nextCh := ch + END Scan; + + + (** Writers **) + + PROCEDURE OpenWriter* (VAR W: Writer); + BEGIN NEW(W.buf); OpenBuf(W.buf); + W.fnt := FontsDefault; W.col := Displaywhite; W.voff := 0; + W.file := Files.New(""); Files.Set(W.rider, W.file, 0) + END OpenWriter; + + PROCEDURE SetFont* (VAR W: Writer; fnt: FontsFont); + BEGIN W.fnt := fnt + END SetFont; + + PROCEDURE SetColor* (VAR W: Writer; col: SYSTEM.INT8); + BEGIN W.col := col + END SetColor; + + PROCEDURE SetOffset* (VAR W: Writer; voff: SYSTEM.INT8); + BEGIN W.voff := voff + END SetOffset; + + + PROCEDURE Write* (VAR W: Writer; ch: CHAR); + VAR u, un: Run; p: Piece; + BEGIN Files.Write(W.rider, ch); INC(W.buf.len); un := W.buf.head; u := un.prev; + IF (u IS Piece) & (u(Piece).file = W.file) & (u.fnt.name = W.fnt.name) & (u.col = W.col) & (u.voff = W.voff) + & ~u(Piece).ascii THEN (* << *) + INC(u.len) + ELSE NEW(p); u.next := p; p.prev := u; p.next := un; un.prev := p; + p.len := 1; p.fnt := W.fnt; p.col := W.col; p.voff := W.voff; + p.file := W.file; p.org := Files.Length(W.file) - 1; p.ascii := FALSE (* << *) + END + END Write; + + PROCEDURE WriteElem* (VAR W: Writer; e: Elem); + VAR u, un: Run; + BEGIN + IF e.base # NIL THEN HALT(99) END; + INC(W.buf.len); e.len := 1; e.fnt := W.fnt; e.col := W.col; e.voff := W.voff; + un := W.buf.head; u := un.prev; u.next := e; e.prev := u; e.next := un; un.prev := e + END WriteElem; + + PROCEDURE WriteLn* (VAR W: Writer); + BEGIN Write(W, CR) + END WriteLn; + + PROCEDURE WriteString* (VAR W: Writer; s: ARRAY OF CHAR); + VAR i: INTEGER; + BEGIN i := 0; + WHILE s[i] >= " " DO Write(W, s[i]); INC(i) END + END WriteString; + + PROCEDURE WriteInt* (VAR W: Writer; x, n: SYSTEM.INT64); + VAR + i: INTEGER; x0: SYSTEM.INT64; + a: ARRAY 24 OF CHAR; + BEGIN i := 0; + IF x < 0 THEN + IF x = MIN(SYSTEM.INT64) THEN WriteString(W, " -9223372036854775808"); RETURN + ELSE DEC(n); x0 := -x + END + ELSE x0 := x + END; + REPEAT + a[i] := CHR(x0 MOD 10 + 30H); x0 := x0 DIV 10; INC(i) + UNTIL x0 = 0; + WHILE n > i DO Write(W, " "); DEC(n) END; + IF x < 0 THEN Write(W, "-") END; + REPEAT DEC(i); Write(W, a[i]) UNTIL i = 0 + END WriteInt; + + PROCEDURE WriteHex* (VAR W: Writer; x: LONGINT); + VAR i: INTEGER; y: LONGINT; + a: ARRAY 20 OF CHAR; + BEGIN i := 0; Write(W, " "); + REPEAT y := x MOD 10H; + IF y < 10 THEN a[i] := CHR(y + 30H) ELSE a[i] := CHR(y + 37H) END; + x := x DIV 10H; INC(i) + UNTIL i = 8; + REPEAT DEC(i); Write(W, a[i]) UNTIL i = 0 + END WriteHex; + + PROCEDURE WriteReal* (VAR W: Writer; x: REAL; n: INTEGER); + VAR e: INTEGER; x0: REAL; + d: ARRAY maxD OF CHAR; + BEGIN e := Reals.Expo(x); + IF e = 0 THEN + WriteString(W, " 0"); + REPEAT Write(W, " "); DEC(n) UNTIL n <= 3 + ELSIF e = 255 THEN + WriteString(W, " NaN"); + WHILE n > 4 DO Write(W, " "); DEC(n) END + ELSE + IF n <= 9 THEN n := 3 ELSE DEC(n, 6) END; + REPEAT Write(W, " "); DEC(n) UNTIL n <= 8; + (*there are 2 < n <= 8 digits to be written*) + IF x < 0.0 THEN Write(W, "-"); x := -x ELSE Write(W, " ") END; + e := (e - 127) * 77 DIV 256; + IF e >= 0 THEN x := x / Reals.Ten(e) ELSE x := Reals.Ten(-e) * x END; + IF x >= 10.0 THEN x := 0.1*x; INC(e) END; + x0 := Reals.Ten(n-1); x := x0*x + 0.5; + IF x >= 10.0*x0 THEN x := x*0.1; INC(e) END; + Reals.Convert(x, n, d); + DEC(n); Write(W, d[n]); Write(W, "."); + REPEAT DEC(n); Write(W, d[n]) UNTIL n = 0; + Write(W, "E"); + IF e < 0 THEN Write(W, "-"); e := -e ELSE Write(W, "+") END; + Write(W, CHR(e DIV 10 + 30H)); Write(W, CHR(e MOD 10 + 30H)) + END + END WriteReal; + + PROCEDURE WriteRealFix* (VAR W: Writer; x: REAL; n, k: INTEGER); + VAR e, i: INTEGER; sign: CHAR; x0: REAL; + d: ARRAY maxD OF CHAR; + + PROCEDURE seq(ch: CHAR; n: INTEGER); + BEGIN WHILE n > 0 DO Write(W, ch); DEC(n) END + END seq; + + PROCEDURE dig(n: INTEGER); + BEGIN + WHILE n > 0 DO + DEC(i); Write(W, d[i]); DEC(n) + END + END dig; + + BEGIN e := Reals.Expo(x); + IF k < 0 THEN k := 0 END; + IF e = 0 THEN seq(" ", n-k-2); Write(W, "0"); seq(" ", k+1) + ELSIF e = 255 THEN WriteString(W, " NaN"); seq(" ", n-4) + ELSE e := (e - 127) * 77 DIV 256; + IF x < 0 THEN sign := "-"; x := -x ELSE sign := " " END; + IF e >= 0 THEN (*x >= 1.0, 77/256 = log 2*) x := x/Reals.Ten(e) + ELSE (*x < 1.0*) x := Reals.Ten(-e) * x + END; + IF x >= 10.0 THEN x := 0.1*x; INC(e) END; + (* 1 <= x < 10 *) + IF k+e >= maxD-1 THEN k := maxD-1-e + ELSIF k+e < 0 THEN k := -e; x := 0.0 + END; + x0 := Reals.Ten(k+e); x := x0*x + 0.5; + IF x >= 10.0*x0 THEN INC(e) END; + (*e = no. of digits before decimal point*) + INC(e); i := k+e; Reals.Convert(x, i, d); + IF e > 0 THEN + seq(" ", n-e-k-2); Write(W, sign); dig(e); + Write(W, "."); dig(k) + ELSE seq(" ", n-k-3); + Write(W, sign); Write(W, "0"); Write(W, "."); + seq("0", -e); dig(k+e) + END + END + END WriteRealFix; + + PROCEDURE WriteRealHex* (VAR W: Writer; x: REAL); + VAR i: INTEGER; + d: ARRAY 8 OF CHAR; + BEGIN Reals.ConvertH(x, d); i := 0; + REPEAT Write(W, d[i]); INC(i) UNTIL i = 8 + END WriteRealHex; + + PROCEDURE WriteLongReal* (VAR W: Writer; x: LONGREAL; n: INTEGER); + CONST maxD = 16; + VAR e: INTEGER; x0: LONGREAL; + d: ARRAY maxD OF CHAR; + BEGIN e := Reals.ExpoL(x); + IF e = 0 THEN + WriteString(W, " 0"); + REPEAT Write(W, " "); DEC(n) UNTIL n <= 3 + ELSIF e = 2047 THEN + WriteString(W, " NaN"); + WHILE n > 4 DO Write(W, " "); DEC(n) END + ELSE + IF n <= 10 THEN n := 3 ELSE DEC(n, 7) END; + REPEAT Write(W, " "); DEC(n) UNTIL n <= maxD; + (*there are 2 <= n <= maxD digits to be written*) + IF x < 0 THEN Write(W, "-"); x := -x ELSE Write(W, " ") END; + + (* Scale e to be an exponent of 10 rather than 2 *) + e := SHORT(LONG(e - 1023) * 77 DIV 256); + IF e >= 0 THEN x := x / Reals.TenL(e) ELSE x := Reals.TenL(-e) * x END ; + IF x >= 10.0D0 THEN x := 0.1D0 * x; INC(e) END; + + (* Scale x to the number of digits requested *) + x0 := Reals.TenL(n-1); x := x0*x + 0.5D0; + IF x >= 10.0D0*x0 THEN x := 0.1D0 * x; INC(e) END ; + + (* Generate the mantissa digits of x *) + Reals.ConvertL(x, n, d); + + DEC(n); Write(W, d[n]); Write(W, "."); + REPEAT DEC(n); Write(W, d[n]) UNTIL n = 0; + + Write(W, "D"); + IF e < 0 THEN Write(W, "-"); e := -e ELSE Write(W, "+") END; + Write(W, CHR(e DIV 100 + 30H)); e := e MOD 100; + Write(W, CHR(e DIV 10 + 30H)); + Write(W, CHR(e MOD 10 + 30H)) + END + END WriteLongReal; + + PROCEDURE WriteLongRealHex* (VAR W: Writer; x: LONGREAL); + VAR i: INTEGER; + d: ARRAY 16 OF CHAR; + BEGIN Reals.ConvertHL(x, d); i := 0; + REPEAT Write(W, d[i]); INC(i) UNTIL i = 16 + END WriteLongRealHex; + + PROCEDURE WriteDate* (VAR W: Writer; t, d: LONGINT); + + PROCEDURE WritePair(ch: CHAR; x: LONGINT); + BEGIN Write(W, ch); + Write(W, CHR(x DIV 10 + 30H)); Write(W, CHR(x MOD 10 + 30H)) + END WritePair; + + BEGIN + WritePair(" ", d MOD 32); WritePair(".", d DIV 32 MOD 16); WritePair(".", d DIV 512 MOD 128); + WritePair(" ", t DIV 4096 MOD 32); WritePair(":", t DIV 64 MOD 64); WritePair(":", t MOD 64) + END WriteDate; + + + (** Text Filing **) + + PROCEDURE Load0 (VAR r: Files.Rider; T: Text); + VAR u, un: Run; p: Piece; e: Elem; + org, pos, hlen, plen: LONGINT; ecnt, fcnt: SHORTINT; + fno, col, voff: SYSTEM.INT8; + f: Files.File; + msg: FileMsg; + mods, procs: ARRAY 64, 32 OF CHAR; + name: ARRAY 32 OF CHAR; + fnts: ARRAY 32 OF FontsFont; + + PROCEDURE LoadElem (VAR r: Files.Rider; pos, span: LONGINT; VAR e: Elem); + VAR M: Modules.Module; Cmd: Modules.Command; a: Alien; + org, ew, eh: LONGINT; eno: SYSTEM.INT8; + BEGIN new := NIL; + Files.ReadLInt(r, ew); Files.ReadLInt(r, eh); Files.Read(r, eno); + IF eno > ecnt THEN ecnt := eno; Files.ReadString(r, mods[eno]); Files.ReadString(r, procs[eno]) END; + org := Files.Pos(r); M := Modules.ThisMod(mods[eno]); + IF M # NIL THEN Cmd := Modules.ThisCommand(M, procs[eno]); + IF Cmd # NIL THEN Cmd END + END; + e := new; + IF e # NIL THEN e.W := ew; e.H := eh; e.base := T; + msg.pos := pos; e.handle(e, msg); + IF Files.Pos(r) # org + span THEN e := NIL END + END; + IF e = NIL THEN Files.Set(r, f, org + span); + NEW(a); a.W := ew; a.H := eh; a.handle := HandleAlien; a.base := T; + a.file := f; a.org := org; a.span := span; + COPY(mods[eno], a.mod); COPY(procs[eno], a.proc); + e := a + END + END LoadElem; + + BEGIN pos := Files.Pos(r); f := Files.Base(r); + NEW(u); u.len := MAX(LONGINT); (*u.fnt := FontsDefault;*)u.fnt := NIL; u.col := Displaywhite; + T.head := u; ecnt := 0; fcnt := 0; + msg.id := load; msg.r := r; + Files.ReadLInt(msg.r, hlen); (*!!!org := pos + hlen;*) org := pos -2 + hlen; pos := org; Files.Read(msg.r, fno); + WHILE fno # 0 DO + IF fno > fcnt THEN fcnt := fno; Files.ReadString(msg.r, name); fnts[fno] := FontsThis(name) END; + Files.Read(msg.r, col); Files.Read(msg.r, voff); Files.ReadLInt(msg.r, plen); + IF plen > 0 THEN NEW(p); p.file := f; p.org := pos; p.ascii := FALSE; un := p; un.len := plen + ELSE LoadElem(msg.r, pos - org, -plen, e); un := e; un.len := 1 + END; + (*un.fnt := fnts[fno];*) un.col := col; un.voff := voff; + INC(pos, un.len); u.next := un; un.prev := u; u := un; Files.Read(msg.r, fno) + END; + u.next := T.head; T.head.prev := u; T.cache := T.head; T.corg := 0; + Files.ReadLInt(msg.r, T.len); Files.Set(r, f, Files.Pos(msg.r) + T.len) + END Load0; + + PROCEDURE Load* (VAR r: Files.Rider; T: Text); + CONST oldTag = -4095; + VAR tag: INTEGER; + BEGIN + (* for compatibility inner text tags are checked and skipped; remove this in a later version *) + Files.ReadInt(r, tag); IF tag # oldTag THEN Files.Set(r, Files.Base(r), Files.Pos(r)-2) END; + Load0(r, T) + END Load; + + PROCEDURE Open* (T: Text; name: ARRAY OF CHAR); + VAR f: Files.File; r: Files.Rider; u: Run; p: Piece; tag, version: CHAR; hlen: LONGINT; + BEGIN f := Files.Old(name); + IF f = NIL THEN f := Files.New("") END; + Files.Set(r, f, 0); Files.Read(r, tag); Files.Read(r, version); + IF (tag = textTag) OR (tag = 01X) & (version = textTag) THEN Load0(r, T) + ELSE (*ascii*) + NEW(u); u.len := MAX(LONGINT); u.fnt := NIL; u.col := Displaywhite; + NEW(p); + IF (tag = DocBlockId) & (version = 07X) THEN (* extract ascii text from System 3 text document *) + Files.Set(r, f, 28); Files.ReadLInt(r, hlen); + Files.Set(r, f, 22 + hlen); Files.ReadLInt(r, T.len); p.org := 26 + hlen + ELSE + T.len := Files.Length(f); p.org := 0 + END ; + IF T.len > 0 THEN p.len := T.len; p.fnt := FontsDefault; + p.col := Displaywhite; p.voff := 0; p.file := f; p.ascii := TRUE; + u.next := p; u.prev := p; p.next := u; p.prev := u + ELSE u.next := u; u.prev := u + END; + T.head := u; T.cache := T.head; T.corg := 0 + END + END Open; + + PROCEDURE Store* (VAR r: Files.Rider; T: Text); + VAR r1: Files.Rider; u, un: Run; e: Elem; org, pos, delta, hlen, rlen: LONGINT; ecnt, fcnt: SHORTINT; ch: CHAR; (* << *) + fno: SYSTEM.INT8; + msg: FileMsg; iden: IdentifyMsg; + mods, procs: ARRAY 64, 32 OF CHAR; + fnts: ARRAY 32 OF FontsFont; + block: ARRAY 1024 OF CHAR; + + PROCEDURE StoreElem (VAR r: Files.Rider; pos: LONGINT; e: Elem); + VAR r1: Files.Rider; org, span: LONGINT; eno: SYSTEM.INT8; + BEGIN COPY(iden.mod, mods[ecnt]); COPY(iden.proc, procs[ecnt]); eno := 1; + WHILE (mods[eno] # iden.mod) OR (procs[eno] # iden.proc) DO INC(eno) END; + Files.Set(r1, Files.Base(r), Files.Pos(r)); + Files.WriteLInt(r, 0); Files.WriteLInt(r, 0); Files.WriteLInt(r, 0); (*fixup slot*) + Files.Write(r, eno); + IF eno = ecnt THEN INC(ecnt); Files.WriteString(r, iden.mod); Files.WriteString(r, iden.proc) END; + msg.pos := pos; org := Files.Pos(r); e.handle(e, msg); span := Files.Pos(r) - org; + Files.WriteLInt(r1, -span); Files.WriteLInt(r1, e.W); Files.WriteLInt(r1, e.H) (*fixup*) + END StoreElem; + + BEGIN + org := Files.Pos(r); msg.id := store; msg.r := r; Files.WriteLInt(msg.r, 0); (*fixup slot*) + u := T.head.next; pos := 0; delta := 0; fcnt := 1; ecnt := 1; + WHILE u # T.head DO + IF u IS Elem THEN iden.mod[0] := 0X; u(Elem).handle(u(Elem), iden) ELSE iden.mod[0] := 1X END; + IF iden.mod[0] # 0X THEN + fnts[fcnt] := u.fnt; fno := 1; + WHILE fnts[fno].name # u.fnt.name DO INC(fno) END; + Files.Write(msg.r, fno); + IF fno = fcnt THEN INC(fcnt); Files.WriteString(msg.r, u.fnt.name) END; + Files.Write(msg.r, u.col); Files.Write(msg.r, u.voff) + END; + IF u IS Piece THEN rlen := u.len; un := u.next; + WHILE (un IS Piece) & (un.fnt = u.fnt) & (un.col = u.col) & (un.voff = u.voff) DO + INC(rlen, un.len); un := un.next + END; + Files.WriteLInt(msg.r, rlen); INC(pos, rlen); u := un + ELSIF iden.mod[0] # 0X THEN StoreElem(msg.r, pos, u(Elem)); INC(pos); u := u.next + ELSE INC(delta); u := u.next + END + END; + Files.Write(msg.r, 0); Files.WriteLInt(msg.r, T.len - delta); + (*!!!hlen := Files.Pos(msg.r) - org;*) hlen := Files.Pos(msg.r) - org + 2; + Files.Set(r1, Files.Base(msg.r), org); Files.WriteLInt(r1, hlen); (*fixup*) + u := T.head.next; + WHILE u # T.head DO + IF u IS Piece THEN + WITH u: Piece DO + IF u.ascii THEN Files.Set(r1, u.file, u.org); delta := u.len; (* << LF to CR *) + WHILE delta > 0 DO Files.Read(r1, ch); DEC(delta); + IF ch = 0AX THEN Files.Write(msg.r, CR) ELSE Files.Write(msg.r, ch) END + END + ELSE Files.Set(r1, u.file, u.org); delta := u.len; + WHILE delta > LEN(block) DO Files.ReadBytes(r1, block, LEN(block)); + Files.WriteBytes(msg.r, block, LEN(block)); DEC(delta, LEN(block)) + END; + Files.ReadBytes(r1, block, delta); Files.WriteBytes(msg.r, block, delta) + END + END + ELSE iden.mod[0] := 0X; u(Elem).handle(u(Elem), iden); + IF iden.mod[0] # 0X THEN Files.Write(msg.r, ElemChar) END + END; + u := u.next + END; + r := msg.r; + IF T.notify # NIL THEN T.notify(T, unmark, 0, 0) END + END Store; + + PROCEDURE Close* (T: Text; name: ARRAY OF CHAR); + VAR f: Files.File; r: Files.Rider; i, res: INTEGER; bak: ARRAY 64 OF CHAR; + BEGIN + f := Files.New(name); Files.Set(r, f, 0); Files.Write(r, textTag); Files.Write(r, version); Store(r, T); + i := 0; WHILE name[i] # 0X DO INC(i) END; + COPY(name, bak); bak[i] := "."; bak[i+1] := "B"; bak[i+2] := "a"; bak[i+3] := "k"; bak[i+4] := 0X; + Files.Rename(name, bak, res); Files.Register(f) + END Close; + +BEGIN del := NIL; NEW(FontsDefault); FontsDefault.name := "Syntax10.Scn.Fnt" +END Texts. diff --git a/src/system/Platformunix.Mod b/src/system/Platformunix.Mod index 288fc04b..034906bd 100644 --- a/src/system/Platformunix.Mod +++ b/src/system/Platformunix.Mod @@ -41,7 +41,7 @@ VAR SeekCur-: INTEGER; SeekEnd-: INTEGER; - nl-: ARRAY 3 OF CHAR; (* Platform specific newline representation *) + NL-: ARRAY 3 OF CHAR; (* Platform specific newline representation *) @@ -547,6 +547,6 @@ BEGIN SeekCur := seekcur(); SeekEnd := seekend(); - nl[0] := 0AX; (* LF *) - nl[1] := 0X; + NL[0] := 0AX; (* LF *) + NL[1] := 0X; END Platform. diff --git a/src/tools/make/oberon.mk b/src/tools/make/oberon.mk index 16311bd0..862ee483 100644 --- a/src/tools/make/oberon.mk +++ b/src/tools/make/oberon.mk @@ -155,16 +155,20 @@ installable: # May require root access. install: @printf "\nInstalling into \"$(INSTALLDIR)\"\n" - @rm -rf "$(INSTALLDIR)/bin" "$(INSTALLDIR)/$(MODEL)" + @rm -rf "$(INSTALLDIR)/bin" "$(INSTALLDIR)/2 "$(INSTALLDIR)/C + @mkdir -p "$(INSTALLDIR)/bin" + @cp $(OBECOMP) "$(INSTALLDIR)/bin/$(OBECOMP)" + @-cp $(BUILDDIR)/showdef$(BINEXT) "$(INSTALLDIR)/bin" + + @mkdir -p "$(INSTALLDIR)/2/include" && cp $(BUILDDIR)/*.h "$(INSTALLDIR)/2/include/" + @mkdir -p "$(INSTALLDIR)/2/sym" && cp $(BUILDDIR)/*.sym "$(INSTALLDIR)/2/sym/" + @mkdir -p "$(INSTALLDIR)/C/include" && cp $(BUILDDIR)/C/*.h "$(INSTALLDIR)/C/include/" + @mkdir -p "$(INSTALLDIR)/C/sym" && cp $(BUILDDIR)/C/*.sym "$(INSTALLDIR)/C/sym/" + @mkdir -p "$(INSTALLDIR)/lib" - @mkdir -p "$(INSTALLDIR)/$(MODEL)/include" - @mkdir -p "$(INSTALLDIR)/$(MODEL)/sym" - @cp $(BUILDDIR)/*.h "$(INSTALLDIR)/$(MODEL)/include/" - @cp $(BUILDDIR)/*.sym "$(INSTALLDIR)/$(MODEL)/sym/" - @cp $(OBECOMP) "$(INSTALLDIR)/bin/$(OBECOMP)" - @-cp $(BUILDDIR)/showdef$(BINEXT) "$(INSTALLDIR)/bin" - @cp $(BUILDDIR)/lib$(ONAME)* "$(INSTALLDIR)/lib/" + @cp $(BUILDDIR)/lib$(ONAME)* "$(INSTALLDIR)/lib/" + @cp $(BUILDDIR)/C/lib$(ONAME)* "$(INSTALLDIR)/lib/" @if which ldconfig >/dev/null 2>&1; then $(LDCONFIG); fi @@ -184,176 +188,194 @@ uninstall: if which ldconfig >/dev/null 2>&1; then ldconfig; fi +runtime: + @printf "\nMaking v4 library for -O$(MODEL)\n" + cd $(BUILDDIR)/$(MODEL) && $(COMPILE) -c SYSTEM.c + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Platform$(PLATFORM).Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Heap.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Out.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Modules.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Strings.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Files.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Reals.Mod +# cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/LowReal.Mod +# cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Math.Mod +# cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/LowLReal.Mod +# cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/MathL.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Texts.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Oberon.Mod v4: @printf "\nMaking v4 library\n" - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/v4/Args.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/v4/Printer.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/v4/Sets.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/v4/Args.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/v4/Printer.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/v4/Sets.Mod ooc2: @printf "\nMaking ooc2 library\n" - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc2/ooc2Strings.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc2/ooc2Ascii.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc2/ooc2CharClass.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc2/ooc2ConvTypes.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc2/ooc2IntConv.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc2/ooc2IntStr.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc2/ooc2Real0.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc2/ooc2Strings.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc2/ooc2Ascii.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc2/ooc2CharClass.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc2/ooc2ConvTypes.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc2/ooc2IntConv.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc2/ooc2IntStr.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc2/ooc2Real0.Mod TODO: Comment disabled lines contain use of VAL that reads beyond source variable ooc: @printf "\nMaking ooc library\n" - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocLowReal.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocLowLReal.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocRealMath.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocOakMath.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocLRealMath.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocLongInts.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocComplexMath.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocLComplexMath.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocAscii.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocCharClass.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocStrings.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocConvTypes.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocLRealConv.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocLRealStr.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocRealConv.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocRealStr.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocIntConv.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocIntStr.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocMsg.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocSysClock.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocTime.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocChannel.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocStrings2.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocRts.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocFilenames.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocTextRider.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocBinaryRider.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocJulianDay.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocFilenames.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocwrapperlibc.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocC$(DATAMODEL).Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocLowReal.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocLowLReal.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocRealMath.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocOakMath.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocLRealMath.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocLongInts.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocComplexMath.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocLComplexMath.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocAscii.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocCharClass.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocStrings.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocConvTypes.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocLRealConv.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocLRealStr.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocRealConv.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocRealStr.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocIntConv.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocIntStr.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocMsg.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocSysClock.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocTime.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocChannel.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocStrings2.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocRts.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocFilenames.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocTextRider.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocBinaryRider.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocJulianDay.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocFilenames.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocwrapperlibc.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocC$(DATAMODEL).Mod oocX11: @printf "\nMaking oocX11 library\n" - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/oocX11/oocX11.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/oocX11/oocXutil.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/oocX11/oocXYplane.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/oocX11/oocX11.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/oocX11/oocXutil.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/oocX11/oocXYplane.Mod ulm: @printf "\nMaking ulm library\n" - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmObjects.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmPriorities.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmDisciplines.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmServices.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmSys.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmSYSTEM.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmEvents.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmProcess.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmResources.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmForwarders.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmRelatedEvents.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmTypes.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmStreams.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmStrings.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmSysTypes.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmTexts.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmSysConversions.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmErrors.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmSysErrors.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmSysStat.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmASCII.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmSets.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmIO.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmAssertions.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmIndirectDisciplines.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmStreamDisciplines.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmIEEE.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmMC68881.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmReals.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmPrint.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmWrite.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmConstStrings.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmPlotters.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmSysIO.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmLoader.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmNetIO.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmPersistentObjects.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmPersistentDisciplines.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmOperations.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmScales.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmTimes.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmClocks.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmTimers.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmConditions.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmStreamConditions.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmTimeConditions.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmCiphers.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmCipherOps.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmBlockCiphers.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmAsymmetricCiphers.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmConclusions.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmRandomGenerators.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmTCrypt.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmIntOperations.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmObjects.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmPriorities.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmDisciplines.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmServices.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmSys.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmSYSTEM.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmEvents.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmProcess.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmResources.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmForwarders.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmRelatedEvents.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmTypes.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmStreams.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmStrings.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmSysTypes.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmTexts.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmSysConversions.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmErrors.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmSysErrors.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmSysStat.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmASCII.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmSets.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmIO.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmAssertions.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmIndirectDisciplines.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmStreamDisciplines.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmIEEE.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmMC68881.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmReals.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmPrint.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmWrite.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmConstStrings.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmPlotters.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmSysIO.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmLoader.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmNetIO.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmPersistentObjects.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmPersistentDisciplines.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmOperations.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmScales.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmTimes.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmClocks.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmTimers.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmConditions.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmStreamConditions.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmTimeConditions.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmCiphers.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmCipherOps.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmBlockCiphers.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmAsymmetricCiphers.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmConclusions.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmRandomGenerators.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmTCrypt.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmIntOperations.Mod pow32: @printf "\nMaking pow library\n" - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/pow/powStrings.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/pow/powStrings.Mod misc: @printf "\nMaking misc library\n" - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/system/Oberon.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/misc/crt.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/misc/Listen.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/misc/MersenneTwister.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/misc/MultiArrays.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/misc/MultiArrayRiders.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/system/Oberon.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/misc/crt.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/misc/Listen.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/misc/MersenneTwister.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/misc/MultiArrays.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/misc/MultiArrayRiders.Mod s3: @printf "\nMaking s3 library\n" - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethBTrees.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethMD5.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethSets.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethZlib.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethZlibBuffers.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethZlibInflate.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethZlibDeflate.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethZlibReaders.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethZlibWriters.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethZip.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethRandomNumbers.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethGZReaders.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethGZWriters.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethUnicode.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethDates.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethReals.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethStrings.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/s3/ethBTrees.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/s3/ethMD5.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/s3/ethSets.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/s3/ethZlib.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/s3/ethZlibBuffers.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/s3/ethZlibInflate.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/s3/ethZlibDeflate.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/s3/ethZlibReaders.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/s3/ethZlibWriters.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/s3/ethZip.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/s3/ethRandomNumbers.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/s3/ethGZReaders.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/s3/ethGZWriters.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/s3/ethUnicode.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/s3/ethDates.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/s3/ethReals.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/s3/ethStrings.Mod -librarybinary: - @printf "\nMaking lib$(ONAME)\n" -# Remove objects that should not be part of the library +O2library: v4 ooc2 ooc ulm pow32 misc s3 + @printf "\nMaking lib$(ONAME)2\n" rm -f $(BUILDDIR)/Compiler.o - # Note: remining compiler files are retained in the library allowing the building # of utilities like BrowserCmd.Mod (aka showdef). - # Make static library - ar rcs "$(BUILDDIR)/lib$(ONAME)$(MODEL).a" $(BUILDDIR)/*.o - + ar rcs "$(BUILDDIR)/lib$(ONAME)2.a" $(BUILDDIR)/*.o # Make shared library - @cd $(BUILDDIR) && $(COMPILE) -shared -o lib$(ONAME)$(MODEL).so *.o + @cd $(BUILDDIR) && $(COMPILE) -shared -o lib$(ONAME)2.so *.o -library: v4 ooc2 ooc ulm pow32 misc s3 librarybinary +OakwoodLibrary: + @printf "\nMaking lib$(ONAME)$(MODEL)\n" + mkdir -p $(BUILDDIR)/$(MODEL) + cp src/system/*.[ch] $(BUILDDIR)/$(MODEL) + @make -f src/tools/make/oberon.mk -s runtime MODEL=$(MODEL) + ar rcs "$(BUILDDIR)/$(MODEL)/lib$(ONAME)$(MODEL).a" $(BUILDDIR)/$(MODEL)/*.o + @cd $(BUILDDIR)/$(MODEL) && $(COMPILE) -shared -o lib$(ONAME)$(MODEL).so *.o From 25d99fd36af45b9d33d65f97784e6075dff0151d Mon Sep 17 00:00:00 2001 From: David Brown Date: Wed, 28 Sep 2016 18:48:56 +0100 Subject: [PATCH 259/580] Add SYSTEM.SET32 and 64 types. Fix 32 bit build. --- makefile | 10 ++++++++-- src/compiler/Compiler.Mod | 8 +++++++- src/compiler/OPC.Mod | 6 ++++-- src/compiler/OPT.Mod | 28 +++++++++++++++++++--------- src/compiler/OPV.Mod | 2 ++ src/runtime/Files.Mod | 5 +++-- src/runtime/Platformunix.Mod | 2 +- src/tools/make/oberon.mk | 16 +++++++--------- 8 files changed, 51 insertions(+), 26 deletions(-) diff --git a/makefile b/makefile index 5202abb7..fc481183 100644 --- a/makefile +++ b/makefile @@ -157,7 +157,7 @@ full: configuration @make -f src/tools/make/oberon.mk -s browsercmd MODEL=2 @printf "\n\n--- Library build started ---\n\n" @make -f src/tools/make/oberon.mk -s O2library - @make -f src/tools/make/oberon.mk -s OakwoodLibrary MODEL=C + @make -f src/tools/make/oberon.mk -s runtime MODEL=C @printf "\n\n--- Library build successfull ---\n\n" @make -f src/tools/make/oberon.mk -s sourcechanges @make -f src/tools/make/oberon.mk -s install @@ -192,7 +192,13 @@ browsercmd: configuration # library: build all directories under src/library library: configuration @make -f src/tools/make/oberon.mk -s O2library - @make -f src/tools/make/oberon.mk -s OakwoodLibrary MODEL=C + @make -f src/tools/make/oberon.mk -s runtime MODEL=C + +runtime: configuration + @make -f src/tools/make/oberon.mk -s runtime MODEL=C + + + # Individual library components v4: configuration diff --git a/src/compiler/Compiler.Mod b/src/compiler/Compiler.Mod index e5acdac7..f21ef95d 100644 --- a/src/compiler/Compiler.Mod +++ b/src/compiler/Compiler.Mod @@ -55,7 +55,6 @@ MODULE Compiler; (* J. Templ 3.2.95 *) BEGIN OPT.sysptrtyp.size := OPM.AddressSize; OPT.adrtyp.size := OPM.AddressSize; - OPT.settyp.size := OPM.SetSize; adrinttyp := OPT.IntType(OPM.AddressSize); OPT.adrtyp.strobj := adrinttyp.strobj; @@ -68,6 +67,13 @@ MODULE Compiler; (* J. Templ 3.2.95 *) OPT.intobj.typ := OPT.inttyp; OPT.lintobj.typ := OPT.linttyp; + (*OPT.settyp.size := OPM.SetSize;*) + CASE OPM.LongintSize OF + |4: OPT.settyp := OPT.set32typ + ELSE OPT.settyp := OPT.set64typ + END; + OPT.setobj.typ := OPT.settyp; + (* Enable or disable (non-system) BYTE type *) IF OPM.Model = "C" THEN OPT.cpbytetyp.strobj.name[4] := 0X (* Enable Component Pascal non-system BYTE type *) diff --git a/src/compiler/OPC.Mod b/src/compiler/OPC.Mod index e0313bbe..e601db3a 100644 --- a/src/compiler/OPC.Mod +++ b/src/compiler/OPC.Mod @@ -111,9 +111,11 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) IF hashtab[h] >= 0 THEN IF keytab[hashtab[h]] = obj^.name THEN OPM.Write('_') END END - ELSIF (mode = OPT.Typ) & (obj.typ.form = OPT.Int) THEN + ELSIF (mode = OPT.Typ) & (obj.typ.form IN {OPT.Int, OPT.Set}) THEN IF obj.typ = OPT.adrtyp THEN OPM.WriteString("address") - ELSE OPM.WriteString("int"); OPM.WriteInt(obj.typ.size*8) + ELSE + IF obj.typ.form = OPT.Int THEN OPM.WriteString("int") ELSE OPM.WriteString("uint") END; + OPM.WriteInt(obj.typ.size*8) END ELSE IF (mode # OPT.Typ) OR (obj^.linkadr # PredefinedType) THEN diff --git a/src/compiler/OPT.Mod b/src/compiler/OPT.Mod index 3732b2cb..ac134c9c 100644 --- a/src/compiler/OPT.Mod +++ b/src/compiler/OPT.Mod @@ -155,10 +155,11 @@ VAR bytetyp*, cpbytetyp*, booltyp*, chartyp*, sinttyp*, inttyp*, linttyp*, hinttyp*, int8typ*, int16typ*, int32typ*, int64typ*, - realtyp*, lrltyp*, settyp*, stringtyp*, + settyp*, set32typ*, set64typ*, + realtyp*, lrltyp*, stringtyp*, adrtyp*, sysptrtyp*: Struct; - sintobj*, intobj*, lintobj*: Object; + sintobj*, intobj*, lintobj*, setobj*: Object; nofGmod*: SHORTINT; (*nof imports*) GlbMod*: ARRAY maxImps OF Object; (* ^.right = first object, ^.name = module import name (not alias) *) @@ -229,6 +230,12 @@ BEGIN RETURN int64typ END IntType; +PROCEDURE SetType*(size: LONGINT): Struct; +BEGIN + IF size = set32typ.size THEN RETURN set32typ END; + RETURN set64typ +END SetType; + PROCEDURE ShorterOrLongerType*(x: Struct; dir: INTEGER): Struct; VAR i: INTEGER; BEGIN @@ -803,10 +810,9 @@ END InTProc; PROCEDURE InTyp(tag: LONGINT): Struct; BEGIN - IF tag = Int THEN - RETURN IntType(OPM.SymRInt()) - ELSE - RETURN impCtxt.ref[tag] + IF tag = Int THEN RETURN IntType(OPM.SymRInt()) + ELSIF tag = Set THEN RETURN SetType(OPM.SymRInt()) + ELSE RETURN impCtxt.ref[tag] END END InTyp; @@ -1124,7 +1130,7 @@ END Import; VAR strobj: Object; BEGIN IF (typ^.ref < expCtxt.ref) THEN OPM.SymWInt(-typ^.ref); - IF typ.ref = Int THEN OPM.SymWInt(typ.size) END + IF typ.ref IN {Int, Set} THEN OPM.SymWInt(typ.size) END ELSE OPM.SymWInt(Sstruct); typ^.ref := expCtxt.ref; INC(expCtxt.ref); @@ -1170,7 +1176,7 @@ END Import; | Bool, Char: OPM.SymWCh(CHR(obj^.conval^.intval)) | Int: OPM.SymWInt(obj^.conval^.intval); OPM.SymWInt(obj.typ.size) - | Set: OPM.SymWSet(obj^.conval^.setval) + | Set: OPM.SymWSet(obj^.conval^.setval); OPM.SymWInt(obj.typ.size) | Real: rval := SHORT(obj^.conval^.realval); OPM.SymWReal(rval) | LReal: OPM.SymWLReal(obj^.conval^.realval) | String: OutName(obj^.conval^.ext^) @@ -1301,6 +1307,8 @@ BEGIN topScope := NIL; OpenScope(0, NIL); OPM.errpos := 0; EnterTyp("INT16", Int, 2, int16typ); EnterTyp("INT32", Int, 4, int32typ); EnterTyp("INT64", Int, 8, int64typ); + EnterTyp("SET32", Set, 4, set32typ); + EnterTyp("SET64", Set, 8, set64typ); EnterProc("ADR", adrfn); EnterProc("CC", ccfn); @@ -1321,7 +1329,7 @@ BEGIN topScope := NIL; OpenScope(0, NIL); OPM.errpos := 0; EnterTyp("BOOLEAN", Bool, 1, booltyp); EnterTyp("CHAR", Char, 1, chartyp); - EnterTyp("SET", Set, -1, settyp); (* Size set in Compiler.PropagateElementaryTypeSize *) +(*EnterTyp("SET", Set, -1, settyp);*) (* Size set in Compiler.PropagateElementaryTypeSize *) EnterTyp("REAL", Real, 4, realtyp); EnterTyp("LONGREAL", LReal, 8, lrltyp); EnterTyp("HUGEINT", Int, 8, hinttyp); @@ -1330,6 +1338,8 @@ BEGIN topScope := NIL; OpenScope(0, NIL); OPM.errpos := 0; EnterTypeAlias("SHORTINT", sintobj); EnterTypeAlias("INTEGER", intobj); EnterTypeAlias("LONGINT", lintobj); + EnterTypeAlias("SET", setobj); + EnterBoolConst("FALSE", 0); (* 0 and 1 are compiler internal representation only *) EnterBoolConst("TRUE", 1); diff --git a/src/compiler/OPV.Mod b/src/compiler/OPV.Mod index 39bfeded..0d29d56d 100644 --- a/src/compiler/OPV.Mod +++ b/src/compiler/OPV.Mod @@ -145,6 +145,8 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 OPT.int16typ^.strobj^.linkadr := PredefinedType; OPT.int32typ^.strobj^.linkadr := PredefinedType; OPT.int64typ^.strobj^.linkadr := PredefinedType; + OPT.set32typ^.strobj^.linkadr := PredefinedType; + OPT.set64typ^.strobj^.linkadr := PredefinedType; OPT.hinttyp.strobj.linkadr := PredefinedType; OPT.lrltyp^.strobj^.linkadr := PredefinedType; OPT.booltyp^.strobj^.linkadr := PredefinedType; diff --git a/src/runtime/Files.Mod b/src/runtime/Files.Mod index 7e497627..46f16c85 100644 --- a/src/runtime/Files.Mod +++ b/src/runtime/Files.Mod @@ -73,6 +73,7 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files PROCEDURE -IdxTrap "__HALT(-1)"; + PROCEDURE -ToAdr(x: SYSTEM.INT64): SYSTEM.ADDRESS "(address)x"; PROCEDURE^ Finalize(o: SYSTEM.PTR); @@ -427,7 +428,7 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files restInBuf := buf.size - offset; IF restInBuf = 0 THEN r.res := n; r.eof := TRUE; RETURN ELSIF n > restInBuf THEN min := restInBuf ELSE min := n END; - SYSTEM.MOVE(SYSTEM.ADR(buf.data) + offset, SYSTEM.ADR(x) + xpos, min); + SYSTEM.MOVE(SYSTEM.ADR(buf.data) + ToAdr(offset), SYSTEM.ADR(x) + ToAdr(xpos), min); INC(offset, min); r.offset := offset; INC(xpos, min); DEC(n, min) END; r.res := 0; r.eof := FALSE @@ -465,7 +466,7 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files END; restInBuf := bufsize - offset; IF n > restInBuf THEN min := restInBuf ELSE min := n END; - SYSTEM.MOVE(SYSTEM.ADR(x) + xpos, SYSTEM.ADR(buf.data) + offset, min); + SYSTEM.MOVE(SYSTEM.ADR(x) + ToAdr(xpos), SYSTEM.ADR(buf.data) + ToAdr(offset), min); INC(offset, min); r.offset := offset; IF offset > buf.size THEN INC(buf.f.len, offset - buf.size); buf.size := offset END; INC(xpos, min); DEC(n, min); buf.chg := TRUE diff --git a/src/runtime/Platformunix.Mod b/src/runtime/Platformunix.Mod index 034906bd..3db3f2d7 100644 --- a/src/runtime/Platformunix.Mod +++ b/src/runtime/Platformunix.Mod @@ -389,7 +389,7 @@ END ReadBuf; -PROCEDURE -writefile(fd: LONGINT; p: SYSTEM.ADDRESS; l: SYSTEM.ADDRESS): SYSTEM.ADDRESS +PROCEDURE -writefile(fd: LONGINT; p: SYSTEM.ADDRESS; l: LONGINT): SYSTEM.ADDRESS "write(fd, (void*)(address)(p), l)"; PROCEDURE Write*(h: FileHandle; p: SYSTEM.ADDRESS; l: LONGINT): ErrorCode; diff --git a/src/tools/make/oberon.mk b/src/tools/make/oberon.mk index 862ee483..af0cbe2c 100644 --- a/src/tools/make/oberon.mk +++ b/src/tools/make/oberon.mk @@ -189,7 +189,9 @@ uninstall: runtime: - @printf "\nMaking v4 library for -O$(MODEL)\n" + @printf "\nMaking run time library for -O$(MODEL)\n" + mkdir -p $(BUILDDIR)/$(MODEL) + cp src/system/*.[ch] $(BUILDDIR)/$(MODEL) cd $(BUILDDIR)/$(MODEL) && $(COMPILE) -c SYSTEM.c cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Platform$(PLATFORM).Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Heap.Mod @@ -204,6 +206,10 @@ runtime: # cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/MathL.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Texts.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Oberon.Mod + @printf "\nMaking lib$(ONAME)$(MODEL)\n" + ar rcs "$(BUILDDIR)/$(MODEL)/lib$(ONAME)$(MODEL).a" $(BUILDDIR)/$(MODEL)/*.o + @cd $(BUILDDIR)/$(MODEL) && $(COMPILE) -shared -o lib$(ONAME)$(MODEL).so *.o + v4: @@ -369,14 +375,6 @@ O2library: v4 ooc2 ooc ulm pow32 misc s3 -OakwoodLibrary: - @printf "\nMaking lib$(ONAME)$(MODEL)\n" - mkdir -p $(BUILDDIR)/$(MODEL) - cp src/system/*.[ch] $(BUILDDIR)/$(MODEL) - @make -f src/tools/make/oberon.mk -s runtime MODEL=$(MODEL) - ar rcs "$(BUILDDIR)/$(MODEL)/lib$(ONAME)$(MODEL).a" $(BUILDDIR)/$(MODEL)/*.o - @cd $(BUILDDIR)/$(MODEL) && $(COMPILE) -shared -o lib$(ONAME)$(MODEL).so *.o - From 08bf8d2fc3bae52e3a82e0d3aeb016449dc63728 Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 29 Sep 2016 10:28:40 +0100 Subject: [PATCH 260/580] Propagate NL spelling change to PlatformWindows. --- src/runtime/Platformwindows.Mod | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/runtime/Platformwindows.Mod b/src/runtime/Platformwindows.Mod index a538fdc5..8471eabb 100644 --- a/src/runtime/Platformwindows.Mod +++ b/src/runtime/Platformwindows.Mod @@ -50,7 +50,7 @@ VAR InterruptHandler: SignalHandler; - nl-: ARRAY 3 OF CHAR; (* Platform specific newline representation *) + NL-: ARRAY 3 OF CHAR; (* Platform specific newline representation *) @@ -616,7 +616,7 @@ BEGIN StdOut := getstdouthandle(); StdErr := getstderrhandle(); - nl[0] := 0DX; (* CR *) - nl[1] := 0AX; (* LF *) - nl[2] := 0X; + NL[0] := 0DX; (* CR *) + NL[1] := 0AX; (* LF *) + NL[2] := 0X; END Platform. From 6dedf34785440708335a5581503a2cce74064b93 Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 30 Sep 2016 16:38:22 +0100 Subject: [PATCH 261/580] SET32 and SET64 compatibility and bootstrap update. --- bootstrap/unix-44/Compiler.c | 24 ++++-- bootstrap/unix-44/Configuration.c | 11 +-- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Console.c | 9 +- bootstrap/unix-44/Console.h | 2 +- bootstrap/unix-44/Files.c | 52 ++++-------- bootstrap/unix-44/Files.h | 10 +-- bootstrap/unix-44/Heap.c | 9 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 9 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 120 ++++++++++++++++----------- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 28 ++++--- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 33 ++++---- bootstrap/unix-44/OPM.h | 10 +-- bootstrap/unix-44/OPP.c | 13 +-- bootstrap/unix-44/OPP.h | 4 +- bootstrap/unix-44/OPS.c | 9 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 54 ++++++++---- bootstrap/unix-44/OPT.h | 11 +-- bootstrap/unix-44/OPV.c | 12 ++- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Platform.c | 15 ++-- bootstrap/unix-44/Platform.h | 4 +- bootstrap/unix-44/Reals.c | 9 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 9 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 13 +-- bootstrap/unix-44/Texts.h | 4 +- bootstrap/unix-44/errors.c | 9 +- bootstrap/unix-44/errors.h | 2 +- bootstrap/unix-44/extTools.c | 9 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-44/vt100.c | 9 +- bootstrap/unix-44/vt100.h | 2 +- bootstrap/unix-48/Compiler.c | 24 ++++-- bootstrap/unix-48/Configuration.c | 11 +-- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Console.c | 9 +- bootstrap/unix-48/Console.h | 2 +- bootstrap/unix-48/Files.c | 52 ++++-------- bootstrap/unix-48/Files.h | 10 +-- bootstrap/unix-48/Heap.c | 9 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 9 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 120 ++++++++++++++++----------- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 28 ++++--- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 33 ++++---- bootstrap/unix-48/OPM.h | 10 +-- bootstrap/unix-48/OPP.c | 13 +-- bootstrap/unix-48/OPP.h | 4 +- bootstrap/unix-48/OPS.c | 9 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 54 ++++++++---- bootstrap/unix-48/OPT.h | 11 +-- bootstrap/unix-48/OPV.c | 12 ++- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Platform.c | 15 ++-- bootstrap/unix-48/Platform.h | 4 +- bootstrap/unix-48/Reals.c | 9 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 9 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 13 +-- bootstrap/unix-48/Texts.h | 4 +- bootstrap/unix-48/errors.c | 9 +- bootstrap/unix-48/errors.h | 2 +- bootstrap/unix-48/extTools.c | 9 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-48/vt100.c | 9 +- bootstrap/unix-48/vt100.h | 2 +- bootstrap/unix-88/Compiler.c | 24 ++++-- bootstrap/unix-88/Configuration.c | 11 +-- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Console.c | 9 +- bootstrap/unix-88/Console.h | 2 +- bootstrap/unix-88/Files.c | 52 ++++-------- bootstrap/unix-88/Files.h | 10 +-- bootstrap/unix-88/Heap.c | 9 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 9 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 120 ++++++++++++++++----------- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 28 ++++--- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 33 ++++---- bootstrap/unix-88/OPM.h | 10 +-- bootstrap/unix-88/OPP.c | 13 +-- bootstrap/unix-88/OPP.h | 4 +- bootstrap/unix-88/OPS.c | 9 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 54 ++++++++---- bootstrap/unix-88/OPT.h | 11 +-- bootstrap/unix-88/OPV.c | 12 ++- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Platform.c | 15 ++-- bootstrap/unix-88/Platform.h | 4 +- bootstrap/unix-88/Reals.c | 9 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 9 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 13 +-- bootstrap/unix-88/Texts.h | 4 +- bootstrap/unix-88/errors.c | 9 +- bootstrap/unix-88/errors.h | 2 +- bootstrap/unix-88/extTools.c | 9 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/unix-88/vt100.c | 9 +- bootstrap/unix-88/vt100.h | 2 +- bootstrap/windows-48/Compiler.c | 24 ++++-- bootstrap/windows-48/Configuration.c | 11 +-- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Console.c | 9 +- bootstrap/windows-48/Console.h | 2 +- bootstrap/windows-48/Files.c | 52 ++++-------- bootstrap/windows-48/Files.h | 10 +-- bootstrap/windows-48/Heap.c | 9 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 9 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 120 ++++++++++++++++----------- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 28 ++++--- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 33 ++++---- bootstrap/windows-48/OPM.h | 10 +-- bootstrap/windows-48/OPP.c | 13 +-- bootstrap/windows-48/OPP.h | 4 +- bootstrap/windows-48/OPS.c | 9 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 54 ++++++++---- bootstrap/windows-48/OPT.h | 11 +-- bootstrap/windows-48/OPV.c | 12 ++- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Platform.c | 9 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 9 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 9 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 13 +-- bootstrap/windows-48/Texts.h | 4 +- bootstrap/windows-48/errors.c | 9 +- bootstrap/windows-48/errors.h | 2 +- bootstrap/windows-48/extTools.c | 9 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-48/vt100.c | 9 +- bootstrap/windows-48/vt100.h | 2 +- bootstrap/windows-88/Compiler.c | 24 ++++-- bootstrap/windows-88/Configuration.c | 11 +-- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Console.c | 9 +- bootstrap/windows-88/Console.h | 2 +- bootstrap/windows-88/Files.c | 52 ++++-------- bootstrap/windows-88/Files.h | 10 +-- bootstrap/windows-88/Heap.c | 9 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 9 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 120 ++++++++++++++++----------- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 28 ++++--- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 33 ++++---- bootstrap/windows-88/OPM.h | 10 +-- bootstrap/windows-88/OPP.c | 13 +-- bootstrap/windows-88/OPP.h | 4 +- bootstrap/windows-88/OPS.c | 9 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 54 ++++++++---- bootstrap/windows-88/OPT.h | 11 +-- bootstrap/windows-88/OPV.c | 12 ++- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Platform.c | 9 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 9 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 9 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 13 +-- bootstrap/windows-88/Texts.h | 4 +- bootstrap/windows-88/errors.c | 9 +- bootstrap/windows-88/errors.h | 2 +- bootstrap/windows-88/extTools.c | 9 +- bootstrap/windows-88/extTools.h | 2 +- bootstrap/windows-88/vt100.c | 9 +- bootstrap/windows-88/vt100.h | 2 +- src/compiler/OPB.Mod | 14 +++- src/compiler/OPM.Mod | 24 +++++- src/compiler/OPT.Mod | 3 + src/runtime/Files.Mod | 33 +++----- src/runtime/LowReal.Mod | 69 ++++++++------- src/runtime/Math.Mod | 54 ++++++------ src/system/Files.Mod | 116 ++++++++++++-------------- 202 files changed, 1650 insertions(+), 1272 deletions(-) diff --git a/bootstrap/unix-44/Compiler.c b/bootstrap/unix-44/Compiler.c index 1b3b14f1..637fd329 100644 --- a/bootstrap/unix-44/Compiler.c +++ b/bootstrap/unix-44/Compiler.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Configuration.h" @@ -83,7 +84,6 @@ static void Compiler_PropagateElementaryTypeSizes (void) OPT_Struct adrinttyp = NIL; OPT_sysptrtyp->size = OPM_AddressSize; OPT_adrtyp->size = OPM_AddressSize; - OPT_settyp->size = OPM_SetSize; adrinttyp = OPT_IntType(OPM_AddressSize); OPT_adrtyp->strobj = adrinttyp->strobj; OPT_sinttyp = OPT_IntType(OPM_ShortintSize); @@ -92,6 +92,20 @@ static void Compiler_PropagateElementaryTypeSizes (void) OPT_sintobj->typ = OPT_sinttyp; OPT_intobj->typ = OPT_inttyp; OPT_lintobj->typ = OPT_linttyp; + switch (OPM_LongintSize) { + case 4: + OPT_settyp = OPT_set32typ; + break; + default: + OPT_settyp = OPT_set64typ; + break; + } + OPT_setobj->typ = OPT_settyp; + if (__STRCMP(OPM_Model, "C") == 0) { + OPT_cpbytetyp->strobj->name[4] = 0x00; + } else { + OPT_cpbytetyp->strobj->name[4] = '@'; + } } void Compiler_Translate (void) diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index 85c8cf89..a3240e8e 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" @@ -18,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index a365d693..4d4279da 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Console.c b/bootstrap/unix-44/Console.c index c2089f05..206f8024 100644 --- a/bootstrap/unix-44/Console.c +++ b/bootstrap/unix-44/Console.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Platform.h" diff --git a/bootstrap/unix-44/Console.h b/bootstrap/unix-44/Console.h index 08f4e38e..6549e2cc 100644 --- a/bootstrap/unix-44/Console.h +++ b/bootstrap/unix-44/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 4800d53c..b1a7e280 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,13 +1,13 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" -#include "Configuration.h" -#include "Console.h" #include "Heap.h" +#include "Console.h" #include "Platform.h" #include "Strings.h" @@ -89,9 +89,8 @@ export void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); export void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); export void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); export void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x); -export void Files_ReadNum64 (Files_Rider *R, address *R__typ, int64 *x); export void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); -export void Files_ReadSet (Files_Rider *R, address *R__typ, SET *x); +export void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x); export void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); export void Files_Register (Files_File f); export void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res); @@ -104,13 +103,13 @@ export void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, L export void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x); export void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x); export void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x); -export void Files_WriteNum (Files_Rider *R, address *R__typ, int32 x); -export void Files_WriteNum64 (Files_Rider *R, address *R__typ, int64 x); +export void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x); export void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x); -export void Files_WriteSet (Files_Rider *R, address *R__typ, SET x); +export void Files_WriteSet (Files_Rider *R, address *R__typ, uint32 x); export void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); #define Files_IdxTrap() __HALT(-1) +#define Files_ToAdr(x) (address)x static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int16 errcode) { @@ -662,7 +661,7 @@ void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x } else { min = n; } - __MOVE(((address)buf->data) + offset, ((address)x) + xpos, min); + __MOVE((address)buf->data + Files_ToAdr(offset), (address)x + Files_ToAdr(xpos), min); offset += min; (*r).offset = offset; xpos += min; @@ -722,7 +721,7 @@ void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT } else { min = n; } - __MOVE(((address)x) + xpos, ((address)buf->data) + offset, min); + __MOVE((address)x + Files_ToAdr(xpos), (address)buf->data + Files_ToAdr(offset), min); offset += min; (*r).offset = offset; if (offset > buf->size) { @@ -862,13 +861,13 @@ void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x) *x = (((int16)b[0] + __ASHL((int16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); } -void Files_ReadSet (Files_Rider *R, address *R__typ, SET *x) +void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x) { CHAR b[4]; int32 l; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); l = (((int16)b[0] + __ASHL((int16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); - *x = (SET)l; + *x = (uint32)l; } void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x) @@ -932,13 +931,6 @@ void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x) *x = n; } -void Files_ReadNum64 (Files_Rider *R, address *R__typ, int64 *x) -{ - int32 n; - Files_ReadNum(&*R, R__typ, &n); - *x = n; -} - void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x) { Files_Write(&*R, R__typ, __VAL(CHAR, x)); @@ -962,7 +954,7 @@ void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x) Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } -void Files_WriteSet (Files_Rider *R, address *R__typ, SET x) +void Files_WriteSet (Files_Rider *R, address *R__typ, uint32 x) { CHAR b[4]; int32 i; @@ -998,16 +990,7 @@ void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len Files_WriteBytes(&*R, R__typ, (void*)x, x__len * 1, i + 1); } -void Files_WriteNum (Files_Rider *R, address *R__typ, int32 x) -{ - while (x < -64 || x > 63) { - Files_Write(&*R, R__typ, (CHAR)(__MASK(x, -128) + 128)); - x = __ASHR(x, 7); - } - Files_Write(&*R, R__typ, (CHAR)__MASK(x, -128)); -} - -void Files_WriteNum64 (Files_Rider *R, address *R__typ, int64 x) +void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x) { while (x < -64 || x > 63) { Files_Write(&*R, R__typ, (CHAR)(__MASK(x, -128) + 128)); @@ -1059,9 +1042,8 @@ __TDESC(Files_Rider, 1, 1) = {__TDFLDS("Rider", 20), {8, -8}}; export void *Files__init(void) { __DEFMOD; - __MODULE_IMPORT(Configuration); - __MODULE_IMPORT(Console); __MODULE_IMPORT(Heap); + __MODULE_IMPORT(Console); __MODULE_IMPORT(Platform); __MODULE_IMPORT(Strings); __REGMOD("Files", EnumPtrs); diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index 55e5fa16..fd146132 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h @@ -46,9 +46,8 @@ import void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); import void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); import void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); import void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x); -import void Files_ReadNum64 (Files_Rider *R, address *R__typ, int64 *x); import void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); -import void Files_ReadSet (Files_Rider *R, address *R__typ, SET *x); +import void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x); import void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); import void Files_Register (Files_File f); import void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res); @@ -60,10 +59,9 @@ import void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, L import void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x); import void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x); import void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x); -import void Files_WriteNum (Files_Rider *R, address *R__typ, int32 x); -import void Files_WriteNum64 (Files_Rider *R, address *R__typ, int64 x); +import void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x); import void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x); -import void Files_WriteSet (Files_Rider *R, address *R__typ, SET x); +import void Files_WriteSet (Files_Rider *R, address *R__typ, uint32 x); import void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); import void *Files__init(void); diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index 1f66b283..b3eea6a3 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index 9e9400e1..a7135c5b 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index f165488e..2984f32f 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index a2ceebdf..9b84521f 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index e370e621..d099cad7 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "OPM.h" @@ -55,6 +56,7 @@ export void OPB_Return (OPT_Node *x, OPT_Object proc); export void OPB_SetElem (OPT_Node *x); static void OPB_SetIntType (OPT_Node node); export void OPB_SetRange (OPT_Node *x, OPT_Node y); +static void OPB_SetSetType (OPT_Node node); export void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno); export void OPB_StPar0 (OPT_Node *par0, int16 fctno); export void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno); @@ -223,6 +225,17 @@ static void OPB_SetIntType (OPT_Node node) node->typ = OPT_IntType(OPT_IntSize(node->conval->intval)); } +static void OPB_SetSetType (OPT_Node node) +{ + int32 i32; + __GET((address)&node->conval->setval + 4, i32, int32); + if (i32 == 0) { + node->typ = OPT_set32typ; + } else { + node->typ = OPT_set64typ; + } +} + OPT_Node OPB_NewIntConst (int64 intval) { OPT_Node _o_result; @@ -364,16 +377,16 @@ void OPB_Field (OPT_Node *x, OPT_Object y) } } -static struct TypTest__57 { +static struct TypTest__58 { OPT_Node *x; OPT_Object *obj; BOOLEAN *guard; - struct TypTest__57 *lnk; -} *TypTest__57_s; + struct TypTest__58 *lnk; +} *TypTest__58_s; -static void GTT__58 (OPT_Struct t0, OPT_Struct t1); +static void GTT__59 (OPT_Struct t0, OPT_Struct t1); -static void GTT__58 (OPT_Struct t0, OPT_Struct t1) +static void GTT__59 (OPT_Struct t0, OPT_Struct t1) { OPT_Node node = NIL; OPT_Struct t = NIL; @@ -386,54 +399,54 @@ static void GTT__58 (OPT_Struct t0, OPT_Struct t1) t1 = t1->BaseTyp; } if (t1 == t0 || t0->form == 0) { - if (*TypTest__57_s->guard) { - OPB_BindNodes(5, NIL, &*TypTest__57_s->x, NIL); - (*TypTest__57_s->x)->readonly = (*TypTest__57_s->x)->left->readonly; + if (*TypTest__58_s->guard) { + OPB_BindNodes(5, NIL, &*TypTest__58_s->x, NIL); + (*TypTest__58_s->x)->readonly = (*TypTest__58_s->x)->left->readonly; } else { node = OPT_NewNode(11); node->subcl = 16; - node->left = *TypTest__57_s->x; - node->obj = *TypTest__57_s->obj; - *TypTest__57_s->x = node; + node->left = *TypTest__58_s->x; + node->obj = *TypTest__58_s->obj; + *TypTest__58_s->x = node; } } else { OPB_err(85); } } else if (t0 != t1) { OPB_err(85); - } else if (!*TypTest__57_s->guard) { - if ((*TypTest__57_s->x)->class == 5) { + } else if (!*TypTest__58_s->guard) { + if ((*TypTest__58_s->x)->class == 5) { node = OPT_NewNode(11); node->subcl = 16; - node->left = *TypTest__57_s->x; - node->obj = *TypTest__57_s->obj; - *TypTest__57_s->x = node; + node->left = *TypTest__58_s->x; + node->obj = *TypTest__58_s->obj; + *TypTest__58_s->x = node; } else { - *TypTest__57_s->x = OPB_NewBoolConst(1); + *TypTest__58_s->x = OPB_NewBoolConst(1); } } } void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) { - struct TypTest__57 _s; + struct TypTest__58 _s; _s.x = x; _s.obj = &obj; _s.guard = &guard; - _s.lnk = TypTest__57_s; - TypTest__57_s = &_s; + _s.lnk = TypTest__58_s; + TypTest__58_s = &_s; if (OPB_NotVar(*x)) { OPB_err(112); } else if ((*x)->typ->form == 11) { if (((*x)->typ->BaseTyp->comp != 4 && (*x)->typ != OPT_sysptrtyp)) { OPB_err(85); } else if (obj->typ->form == 11) { - GTT__58((*x)->typ->BaseTyp, obj->typ->BaseTyp); + GTT__59((*x)->typ->BaseTyp, obj->typ->BaseTyp); } else { OPB_err(86); } } else if (((((*x)->typ->comp == 4 && (*x)->class == 1)) && obj->typ->comp == 4)) { - GTT__58((*x)->typ, obj->typ); + GTT__59((*x)->typ, obj->typ); } else { OPB_err(87); } @@ -442,7 +455,7 @@ void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) } else { (*x)->typ = OPT_booltyp; } - TypTest__57_s = _s.lnk; + TypTest__58_s = _s.lnk; } void OPB_In (OPT_Node *x, OPT_Node y) @@ -1109,7 +1122,13 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) f = (*x)->typ->form; g = typ->form; if ((*x)->class == 7) { - if (f == 4) { + if ((((f == 7 && g == 7)) && (*x)->typ->size > typ->size)) { + OPB_SetSetType(*x); + if ((*x)->typ->size > typ->size) { + OPB_err(203); + (*x)->conval->setval = 0x0; + } + } else if (f == 4) { if (g == 4) { if ((*x)->typ->size > typ->size) { OPB_SetIntType(*x); @@ -1243,6 +1262,13 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) OPB_err(100); } break; + case 7: + if ((g == 7 && y->typ->size < z->typ->size)) { + OPB_Convert(&y, z->typ); + } else { + OPB_err(100); + } + break; case 5: if (g == 4) { OPB_Convert(&y, z->typ); @@ -1969,13 +1995,13 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) *par0 = x; } -static struct StPar1__52 { - struct StPar1__52 *lnk; -} *StPar1__52_s; +static struct StPar1__53 { + struct StPar1__53 *lnk; +} *StPar1__53_s; -static OPT_Node NewOp__53 (int8 class, int8 subcl, OPT_Node left, OPT_Node right); +static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right); -static OPT_Node NewOp__53 (int8 class, int8 subcl, OPT_Node left, OPT_Node right) +static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right) { OPT_Node _o_result; OPT_Node node = NIL; @@ -1992,9 +2018,9 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) int16 f, L; OPT_Struct typ = NIL; OPT_Node p = NIL, t = NIL; - struct StPar1__52 _s; - _s.lnk = StPar1__52_s; - StPar1__52_s = &_s; + struct StPar1__53 _s; + _s.lnk = StPar1__53_s; + StPar1__53_s = &_s; p = *par0; f = x->typ->form; switch (fctno) { @@ -2010,7 +2036,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) OPB_err(111); } } - p = NewOp__53(19, fctno, p, x); + p = NewOp__54(19, fctno, p, x); p->typ = OPT_notyp; } break; @@ -2021,7 +2047,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > (int64)OPM_MaxSet))) { OPB_err(202); } - p = NewOp__53(19, fctno, p, x); + p = NewOp__54(19, fctno, p, x); } else { OPB_err(111); } @@ -2046,7 +2072,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) p = p->left; x->conval->intval += 1; } - p = NewOp__53(12, 19, p, x); + p = NewOp__54(12, 19, p, x); p->typ = OPT_linttyp; } else { p = x; @@ -2068,7 +2094,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) t = x; x = p; p = t; - p = NewOp__53(19, 18, p, x); + p = NewOp__54(19, 18, p, x); } else { OPB_err(111); } @@ -2094,7 +2120,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) } p->obj = NIL; } else { - p = NewOp__53(12, 17, p, x); + p = NewOp__54(12, 17, p, x); p->typ = p->left->typ; } } else { @@ -2125,9 +2151,9 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) OPB_err(111); } else { if (fctno == 22) { - p = NewOp__53(12, 27, p, x); + p = NewOp__54(12, 27, p, x); } else { - p = NewOp__53(12, 28, p, x); + p = NewOp__54(12, 28, p, x); } p->typ = p->left->typ; } @@ -2144,7 +2170,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) x = p; p = t; } - p = NewOp__53(19, fctno, p, x); + p = NewOp__54(19, fctno, p, x); } else { OPB_err(111); } @@ -2154,7 +2180,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (f == 4) { - p = NewOp__53(12, 26, p, x); + p = NewOp__54(12, 26, p, x); } else { OPB_err(111); } @@ -2182,7 +2208,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (f == 4) { - p = NewOp__53(19, 30, p, x); + p = NewOp__54(19, 30, p, x); } else { OPB_err(111); } @@ -2228,7 +2254,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) break; } *par0 = p; - StPar1__52_s = _s.lnk; + StPar1__53_s = _s.lnk; } void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n) diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index 8c0fd594..07dda5db 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 4c9ae495..545deb33 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Configuration.h" @@ -193,11 +194,15 @@ void OPC_Ident (OPT_Object obj) OPM_Write('_'); } } - } else if ((mode == 5 && obj->typ->form == 4)) { + } else if ((mode == 5 && __IN(obj->typ->form, 0x90, 32))) { if (obj->typ == OPT_adrtyp) { OPM_WriteString((CHAR*)"address", 8); } else { - OPM_WriteString((CHAR*)"int", 4); + if (obj->typ->form == 4) { + OPM_WriteString((CHAR*)"int", 4); + } else { + OPM_WriteString((CHAR*)"uint", 5); + } OPM_WriteInt(__ASHL(obj->typ->size, 3)); } } else { @@ -1233,13 +1238,16 @@ void OPC_GenBdy (OPT_Node n) OPM_currFile = 1; OPC_GenHeaderMsg(); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#define INTEGER int", 20); + OPM_WriteString((CHAR*)"#define SHORTINT int", 21); + OPM_WriteInt(__ASHL(OPT_sinttyp->size, 3)); + OPM_WriteLn(); + OPM_WriteString((CHAR*)"#define INTEGER int", 21); OPM_WriteInt(__ASHL(OPT_inttyp->size, 3)); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#define LONGINT int", 20); + OPM_WriteString((CHAR*)"#define LONGINT int", 21); OPM_WriteInt(__ASHL(OPT_linttyp->size, 3)); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#define SET uint", 21); + OPM_WriteString((CHAR*)"#define SET uint", 22); OPM_WriteInt(__ASHL(OPT_settyp->size, 3)); OPM_WriteLn(); OPM_WriteLn(); @@ -1851,7 +1859,7 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim) void OPC_Constant (OPT_Const con, int16 form) { int16 i; - SET s; + uint32 s; int32 hex; BOOLEAN skipLeading; switch (form) { diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index e681f43d..c9cf0ace 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 534a5c0d..32bb978e 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Configuration.h" @@ -25,7 +26,7 @@ static int16 OPM_GlobalAddressSize; export int16 OPM_AddressSize; static int16 OPM_GlobalAlignment; export int16 OPM_Alignment; -export SET OPM_GlobalOptions, OPM_Options; +export uint32 OPM_GlobalOptions, OPM_Options; export int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize, OPM_MaxSet; export int64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; @@ -52,7 +53,7 @@ export void OPM_DeleteNewSym (void); export void OPM_FPrint (int32 *fp, int64 val); export void OPM_FPrintLReal (int32 *fp, LONGREAL lr); export void OPM_FPrintReal (int32 *fp, REAL real); -export void OPM_FPrintSet (int32 *fp, SET set); +export void OPM_FPrintSet (int32 *fp, uint32 set); static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 pos); export void OPM_Get (CHAR *ch); export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); @@ -80,12 +81,12 @@ export int32 OPM_SymRInt (void); export int64 OPM_SymRInt64 (void); export void OPM_SymRLReal (LONGREAL *lr); export void OPM_SymRReal (REAL *r); -export void OPM_SymRSet (SET *s); +export void OPM_SymRSet (uint32 *s); export void OPM_SymWCh (CHAR ch); export void OPM_SymWInt (int64 i); export void OPM_SymWLReal (LONGREAL lr); export void OPM_SymWReal (REAL r); -export void OPM_SymWSet (SET s); +export void OPM_SymWSet (uint32 s); static void OPM_VerboseListSizes (void); export void OPM_Write (CHAR ch); export void OPM_WriteHex (int64 i); @@ -329,7 +330,7 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWStr((CHAR*)" -V Display compiler debugging messages.", 46); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" Size model for elementary types (default O2 on 32 bit builds, OV on 64 bits)", 79); + OPM_LogWStr((CHAR*)" Size model for elementary types (default O2)", 47); OPM_LogWLn(); OPM_LogWStr((CHAR*)" -O2 Original Oberon / Oberon-2: 8 bit SHORTINT, 16 bit INTEGER, 32 bit LONGINT and SET.", 95); OPM_LogWLn(); @@ -709,10 +710,10 @@ void OPM_err (int16 n) void OPM_FPrint (int32 *fp, int64 val) { - *fp = __ROTL((int32)((SET)*fp ^ __VAL(SET, val)), 1, 32); + *fp = __ROTL((int32)((uint32)*fp ^ __VAL(uint32, val)), 1, 32); } -void OPM_FPrintSet (int32 *fp, SET set) +void OPM_FPrintSet (int32 *fp, uint32 set) { OPM_FPrint(&*fp, (int32)set); } @@ -751,13 +752,11 @@ int32 OPM_SymRInt (void) int64 OPM_SymRInt64 (void) { int64 _o_result; - int64 k; - Files_ReadNum64(&OPM_oldSF, Files_Rider__typ, &k); - _o_result = k; + _o_result = OPM_SymRInt(); return _o_result; } -void OPM_SymRSet (SET *s) +void OPM_SymRSet (uint32 *s) { Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (int32*)&*s); } @@ -808,10 +807,10 @@ void OPM_SymWCh (CHAR ch) void OPM_SymWInt (int64 i) { - Files_WriteNum64(&OPM_newSF, Files_Rider__typ, i); + Files_WriteNum(&OPM_newSF, Files_Rider__typ, i); } -void OPM_SymWSet (SET s) +void OPM_SymWSet (uint32 s) { Files_WriteNum(&OPM_newSF, Files_Rider__typ, (int32)s); } diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index 933ef1b5..dd3c0c27 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h @@ -8,7 +8,7 @@ import CHAR OPM_Model[10]; import int16 OPM_AddressSize, OPM_Alignment; -import SET OPM_GlobalOptions, OPM_Options; +import uint32 OPM_GlobalOptions, OPM_Options; import int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize, OPM_MaxSet; import int64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; @@ -26,7 +26,7 @@ import void OPM_DeleteNewSym (void); import void OPM_FPrint (int32 *fp, int64 val); import void OPM_FPrintLReal (int32 *fp, LONGREAL lr); import void OPM_FPrintReal (int32 *fp, REAL real); -import void OPM_FPrintSet (int32 *fp, SET set); +import void OPM_FPrintSet (int32 *fp, uint32 set); import void OPM_Get (CHAR *ch); import void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); import void OPM_InitOptions (void); @@ -49,12 +49,12 @@ import int32 OPM_SymRInt (void); import int64 OPM_SymRInt64 (void); import void OPM_SymRLReal (LONGREAL *lr); import void OPM_SymRReal (REAL *r); -import void OPM_SymRSet (SET *s); +import void OPM_SymRSet (uint32 *s); import void OPM_SymWCh (CHAR ch); import void OPM_SymWInt (int64 i); import void OPM_SymWLReal (LONGREAL lr); import void OPM_SymWReal (REAL r); -import void OPM_SymWSet (SET s); +import void OPM_SymWSet (uint32 s); import void OPM_Write (CHAR ch); import void OPM_WriteHex (int64 i); import void OPM_WriteInt (int64 i); diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index 010efab1..1eff447d 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "OPB.h" @@ -39,7 +40,7 @@ static void OPP_Expression (OPT_Node *x); static BOOLEAN OPP_Extends (OPT_Struct x, OPT_Struct b); static void OPP_Factor (OPT_Node *x); static void OPP_FormalParameters (OPT_Object *firstPar, OPT_Struct *resTyp); -export void OPP_Module (OPT_Node *prog, SET opt); +export void OPP_Module (OPT_Node *prog, uint32 opt); static void OPP_PointerType (OPT_Struct *typ); static void OPP_ProcedureDeclaration (OPT_Node *x); static void OPP_Receiver (int8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec); @@ -1775,7 +1776,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) OPP_CheckSym(41); } -void OPP_Module (OPT_Node *prog, SET opt) +void OPP_Module (OPT_Node *prog, uint32 opt) { OPS_Name impName, aliasName; OPT_Node procdec = NIL, statseq = NIL; diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index 373d8daa..c759545a 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h @@ -9,7 +9,7 @@ -import void OPP_Module (OPT_Node *prog, SET opt); +import void OPP_Module (OPT_Node *prog, uint32 opt); import void *OPP__init(void); diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index f8ed61bf..18c3c066 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index 1f02668b..260fcd01 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index 7efc4cc4..9682088a 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "OPM.h" @@ -19,7 +20,7 @@ typedef OPT_ConstExt ext; int64 intval; int32 intval2; - SET setval; + uint32 setval; LONGREAL realval; } OPT_ConstDesc; @@ -88,8 +89,8 @@ typedef export OPT_Object OPT_topScope; -export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; -export OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj; +export OPT_Struct OPT_undftyp, OPT_niltyp, OPT_notyp, OPT_bytetyp, OPT_cpbytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_settyp, OPT_set32typ, OPT_set64typ, OPT_realtyp, OPT_lrltyp, OPT_stringtyp, OPT_adrtyp, OPT_sysptrtyp; +export OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj, OPT_setobj; export int8 OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; @@ -137,7 +138,7 @@ static void OPT_InSign (int8 mno, OPT_Struct *res, OPT_Object *par); static void OPT_InStruct (OPT_Struct *typ); static OPT_Object OPT_InTProc (int8 mno); static OPT_Struct OPT_InTyp (int32 tag); -export void OPT_Init (OPS_Name name, SET opt); +export void OPT_Init (OPS_Name name, uint32 opt); export void OPT_InitRecno (void); static void OPT_InitStruct (OPT_Struct *typ, int8 form); export void OPT_Insert (OPS_Name name, OPT_Object *obj); @@ -159,6 +160,7 @@ static void OPT_OutObj (OPT_Object obj); static void OPT_OutSign (OPT_Struct result, OPT_Object par); static void OPT_OutStr (OPT_Struct typ); static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj); +export OPT_Struct OPT_SetType (int32 size); export OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir); export int32 OPT_SizeAlignment (int32 size); export void OPT_TypSize (OPT_Struct typ); @@ -209,6 +211,17 @@ OPT_Struct OPT_IntType (int32 size) return _o_result; } +OPT_Struct OPT_SetType (int32 size) +{ + OPT_Struct _o_result; + if (size == OPT_set32typ->size) { + _o_result = OPT_set32typ; + return _o_result; + } + _o_result = OPT_set64typ; + return _o_result; +} + OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir) { OPT_Struct _o_result; @@ -449,7 +462,7 @@ void OPT_CloseScope (void) OPT_topScope = OPT_topScope->left; } -void OPT_Init (OPS_Name name, SET opt) +void OPT_Init (OPS_Name name, uint32 opt) { OPT_topScope = OPT_universe; OPT_OpenScope(0, NIL); @@ -1171,6 +1184,9 @@ static OPT_Struct OPT_InTyp (int32 tag) if (tag == 4) { _o_result = OPT_IntType(OPM_SymRInt()); return _o_result; + } else if (tag == 7) { + _o_result = OPT_SetType(OPM_SymRInt()); + return _o_result; } else { _o_result = OPT_impCtxt.ref[__X(tag, 255)]; return _o_result; @@ -1628,7 +1644,7 @@ static void OPT_OutStr (OPT_Struct typ) OPT_Object strobj = NIL; if (typ->ref < OPT_expCtxt.ref) { OPM_SymWInt(-typ->ref); - if (typ->ref == 4) { + if (__IN(typ->ref, 0x90, 32)) { OPM_SymWInt(typ->size); } } else { @@ -1732,6 +1748,7 @@ static void OPT_OutConstant (OPT_Object obj) break; case 7: OPM_SymWSet(obj->conval->setval); + OPM_SymWInt(obj->typ->size); break; case 5: rval = obj->conval->realval; @@ -1959,28 +1976,32 @@ static void EnumPtrs(void (*P)(void*)) { P(OPT_topScope); P(OPT_undftyp); + P(OPT_niltyp); + P(OPT_notyp); P(OPT_bytetyp); + P(OPT_cpbytetyp); P(OPT_booltyp); P(OPT_chartyp); P(OPT_sinttyp); P(OPT_inttyp); P(OPT_linttyp); P(OPT_hinttyp); - P(OPT_adrtyp); P(OPT_int8typ); P(OPT_int16typ); P(OPT_int32typ); P(OPT_int64typ); + P(OPT_settyp); + P(OPT_set32typ); + P(OPT_set64typ); P(OPT_realtyp); P(OPT_lrltyp); - P(OPT_settyp); P(OPT_stringtyp); - P(OPT_niltyp); - P(OPT_notyp); + P(OPT_adrtyp); P(OPT_sysptrtyp); P(OPT_sintobj); P(OPT_intobj); P(OPT_lintobj); + P(OPT_setobj); __ENUMP(OPT_GlbMod, 64, P); P(OPT_universe); P(OPT_syslink); @@ -2056,6 +2077,8 @@ export void *OPT__init(void) OPT_EnterTyp((CHAR*)"INT16", 4, 2, &OPT_int16typ); OPT_EnterTyp((CHAR*)"INT32", 4, 4, &OPT_int32typ); OPT_EnterTyp((CHAR*)"INT64", 4, 8, &OPT_int64typ); + OPT_EnterTyp((CHAR*)"SET32", 7, 4, &OPT_set32typ); + OPT_EnterTyp((CHAR*)"SET64", 7, 8, &OPT_set64typ); OPT_EnterProc((CHAR*)"ADR", 20); OPT_EnterProc((CHAR*)"CC", 21); OPT_EnterProc((CHAR*)"LSH", 22); @@ -2073,13 +2096,14 @@ export void *OPT__init(void) OPT_topScope->right = NIL; OPT_EnterTyp((CHAR*)"BOOLEAN", 2, 1, &OPT_booltyp); OPT_EnterTyp((CHAR*)"CHAR", 3, 1, &OPT_chartyp); - OPT_EnterTyp((CHAR*)"SET", 7, -1, &OPT_settyp); OPT_EnterTyp((CHAR*)"REAL", 5, 4, &OPT_realtyp); OPT_EnterTyp((CHAR*)"LONGREAL", 6, 8, &OPT_lrltyp); OPT_EnterTyp((CHAR*)"HUGEINT", 4, 8, &OPT_hinttyp); + OPT_EnterTyp((CHAR*)"BYTE@", 4, 1, &OPT_cpbytetyp); OPT_EnterTypeAlias((CHAR*)"SHORTINT", &OPT_sintobj); OPT_EnterTypeAlias((CHAR*)"INTEGER", &OPT_intobj); OPT_EnterTypeAlias((CHAR*)"LONGINT", &OPT_lintobj); + OPT_EnterTypeAlias((CHAR*)"SET", &OPT_setobj); OPT_EnterBoolConst((CHAR*)"FALSE", 0); OPT_EnterBoolConst((CHAR*)"TRUE", 1); OPT_EnterProc((CHAR*)"HALT", 0); diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index 202c8278..2bc05576 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h @@ -17,7 +17,7 @@ typedef OPT_ConstExt ext; int64 intval; int32 intval2; - SET setval; + uint32 setval; LONGREAL realval; } OPT_ConstDesc; @@ -67,8 +67,8 @@ typedef import OPT_Object OPT_topScope; -import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; -import OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj; +import OPT_Struct OPT_undftyp, OPT_niltyp, OPT_notyp, OPT_bytetyp, OPT_cpbytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_settyp, OPT_set32typ, OPT_set64typ, OPT_realtyp, OPT_lrltyp, OPT_stringtyp, OPT_adrtyp, OPT_sysptrtyp; +import OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj, OPT_setobj; import int8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; @@ -92,7 +92,7 @@ import void OPT_FindField (OPS_Name name, OPT_Struct typ, OPT_Object *res); import void OPT_FindImport (OPT_Object mod, OPT_Object *res); import void OPT_IdFPrint (OPT_Struct typ); import void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); -import void OPT_Init (OPS_Name name, SET opt); +import void OPT_Init (OPS_Name name, uint32 opt); import void OPT_InitRecno (void); import void OPT_Insert (OPS_Name name, OPT_Object *obj); import void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); @@ -104,6 +104,7 @@ import OPT_Node OPT_NewNode (int8 class); import OPT_Object OPT_NewObj (void); import OPT_Struct OPT_NewStr (int8 form, int8 comp); import void OPT_OpenScope (int8 level, OPT_Object owner); +import OPT_Struct OPT_SetType (int32 size); import OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir); import int32 OPT_SizeAlignment (int32 size); import void OPT_TypSize (OPT_Struct typ); diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index ff99f665..99e7aa6a 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "OPC.h" @@ -187,6 +188,7 @@ void OPV_AdrAndSize (OPT_Object topScope) OPV_Traverse(topScope->right, topScope, 1); OPV_Traverse(topScope->right, topScope, 0); OPT_chartyp->strobj->linkadr = 2; + OPT_cpbytetyp->strobj->linkadr = 2; OPT_settyp->strobj->linkadr = 2; OPT_realtyp->strobj->linkadr = 2; OPT_adrtyp->strobj->linkadr = 2; @@ -194,6 +196,8 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_int16typ->strobj->linkadr = 2; OPT_int32typ->strobj->linkadr = 2; OPT_int64typ->strobj->linkadr = 2; + OPT_set32typ->strobj->linkadr = 2; + OPT_set64typ->strobj->linkadr = 2; OPT_hinttyp->strobj->linkadr = 2; OPT_lrltyp->strobj->linkadr = 2; OPT_booltyp->strobj->linkadr = 2; diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index a44fb5b5..f5e41d45 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 18c66534..defb84f0 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" @@ -40,7 +41,7 @@ export int32 Platform_ArgVector; static Platform_HaltProcedure Platform_HaltHandler; static int32 Platform_TimeStart; export int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; -export CHAR Platform_nl[3]; +export CHAR Platform_NL[3]; export address *Platform_FileIdentity__typ; @@ -798,7 +799,7 @@ export void *Platform__init(void) Platform_SeekSet = Platform_seekset(); Platform_SeekCur = Platform_seekcur(); Platform_SeekEnd = Platform_seekend(); - Platform_nl[0] = 0x0a; - Platform_nl[1] = 0x00; + Platform_NL[0] = 0x0a; + Platform_NL[1] = 0x00; __ENDMOD; } diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index 158cb341..01e08432 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h @@ -26,7 +26,7 @@ import CHAR Platform_CWD[256]; import int16 Platform_ArgCount; import int32 Platform_ArgVector; import int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; -import CHAR Platform_nl[3]; +import CHAR Platform_NL[3]; import address *Platform_FileIdentity__typ; diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 57e22100..d7d2994c 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index f3404dda..8c1ff819 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index bcf3cb9b..ac03bada 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index 9418692a..cc9d99a1 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index efc9fd98..a8af28c1 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Files.h" @@ -183,7 +184,7 @@ export address *Texts_Writer__typ; export address *Texts__1__typ; export void Texts_Append (Texts_Text T, Texts_Buffer B); -export void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff); +export void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, uint32 sel, Texts_FontsFont fnt, int8 col, int8 voff); static Texts_Elem Texts_CloneElem (Texts_Elem e); static Texts_Piece Texts_ClonePiece (Texts_Piece p); export void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len); @@ -565,7 +566,7 @@ void Texts_Delete (Texts_Text T, int32 beg, int32 end) } } -void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff) +void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, uint32 sel, Texts_FontsFont fnt, int8 col, int8 voff) { Texts_Run c = NIL, u = NIL, un = NIL, v = NIL, vn = NIL; int32 co, uo, ud, vo, vd; diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index e402259d..2d6de22a 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h @@ -129,7 +129,7 @@ import address *Texts_Scanner__typ; import address *Texts_Writer__typ; import void Texts_Append (Texts_Text T, Texts_Buffer B); -import void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff); +import void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, uint32 sel, Texts_FontsFont fnt, int8 col, int8 voff); import void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len); import void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); import void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); diff --git a/bootstrap/unix-44/errors.c b/bootstrap/unix-44/errors.c index ba890a17..f284397b 100644 --- a/bootstrap/unix-44/errors.c +++ b/bootstrap/unix-44/errors.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" diff --git a/bootstrap/unix-44/errors.h b/bootstrap/unix-44/errors.h index d8124792..5aa2a5f6 100644 --- a/bootstrap/unix-44/errors.h +++ b/bootstrap/unix-44/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index 76fdc084..fe7eb545 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index bb5be954..8cdd8e01 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-44/vt100.c b/bootstrap/unix-44/vt100.c index c44586d2..a4bc9ec1 100644 --- a/bootstrap/unix-44/vt100.c +++ b/bootstrap/unix-44/vt100.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/unix-44/vt100.h b/bootstrap/unix-44/vt100.h index c9a01a7c..44d81f73 100644 --- a/bootstrap/unix-44/vt100.h +++ b/bootstrap/unix-44/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-48/Compiler.c b/bootstrap/unix-48/Compiler.c index 1b3b14f1..637fd329 100644 --- a/bootstrap/unix-48/Compiler.c +++ b/bootstrap/unix-48/Compiler.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Configuration.h" @@ -83,7 +84,6 @@ static void Compiler_PropagateElementaryTypeSizes (void) OPT_Struct adrinttyp = NIL; OPT_sysptrtyp->size = OPM_AddressSize; OPT_adrtyp->size = OPM_AddressSize; - OPT_settyp->size = OPM_SetSize; adrinttyp = OPT_IntType(OPM_AddressSize); OPT_adrtyp->strobj = adrinttyp->strobj; OPT_sinttyp = OPT_IntType(OPM_ShortintSize); @@ -92,6 +92,20 @@ static void Compiler_PropagateElementaryTypeSizes (void) OPT_sintobj->typ = OPT_sinttyp; OPT_intobj->typ = OPT_inttyp; OPT_lintobj->typ = OPT_linttyp; + switch (OPM_LongintSize) { + case 4: + OPT_settyp = OPT_set32typ; + break; + default: + OPT_settyp = OPT_set64typ; + break; + } + OPT_setobj->typ = OPT_settyp; + if (__STRCMP(OPM_Model, "C") == 0) { + OPT_cpbytetyp->strobj->name[4] = 0x00; + } else { + OPT_cpbytetyp->strobj->name[4] = '@'; + } } void Compiler_Translate (void) diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index 85c8cf89..a3240e8e 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" @@ -18,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index a365d693..4d4279da 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Console.c b/bootstrap/unix-48/Console.c index c2089f05..206f8024 100644 --- a/bootstrap/unix-48/Console.c +++ b/bootstrap/unix-48/Console.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Platform.h" diff --git a/bootstrap/unix-48/Console.h b/bootstrap/unix-48/Console.h index 08f4e38e..6549e2cc 100644 --- a/bootstrap/unix-48/Console.h +++ b/bootstrap/unix-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 4800d53c..b1a7e280 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,13 +1,13 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" -#include "Configuration.h" -#include "Console.h" #include "Heap.h" +#include "Console.h" #include "Platform.h" #include "Strings.h" @@ -89,9 +89,8 @@ export void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); export void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); export void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); export void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x); -export void Files_ReadNum64 (Files_Rider *R, address *R__typ, int64 *x); export void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); -export void Files_ReadSet (Files_Rider *R, address *R__typ, SET *x); +export void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x); export void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); export void Files_Register (Files_File f); export void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res); @@ -104,13 +103,13 @@ export void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, L export void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x); export void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x); export void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x); -export void Files_WriteNum (Files_Rider *R, address *R__typ, int32 x); -export void Files_WriteNum64 (Files_Rider *R, address *R__typ, int64 x); +export void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x); export void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x); -export void Files_WriteSet (Files_Rider *R, address *R__typ, SET x); +export void Files_WriteSet (Files_Rider *R, address *R__typ, uint32 x); export void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); #define Files_IdxTrap() __HALT(-1) +#define Files_ToAdr(x) (address)x static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int16 errcode) { @@ -662,7 +661,7 @@ void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x } else { min = n; } - __MOVE(((address)buf->data) + offset, ((address)x) + xpos, min); + __MOVE((address)buf->data + Files_ToAdr(offset), (address)x + Files_ToAdr(xpos), min); offset += min; (*r).offset = offset; xpos += min; @@ -722,7 +721,7 @@ void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT } else { min = n; } - __MOVE(((address)x) + xpos, ((address)buf->data) + offset, min); + __MOVE((address)x + Files_ToAdr(xpos), (address)buf->data + Files_ToAdr(offset), min); offset += min; (*r).offset = offset; if (offset > buf->size) { @@ -862,13 +861,13 @@ void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x) *x = (((int16)b[0] + __ASHL((int16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); } -void Files_ReadSet (Files_Rider *R, address *R__typ, SET *x) +void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x) { CHAR b[4]; int32 l; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); l = (((int16)b[0] + __ASHL((int16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); - *x = (SET)l; + *x = (uint32)l; } void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x) @@ -932,13 +931,6 @@ void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x) *x = n; } -void Files_ReadNum64 (Files_Rider *R, address *R__typ, int64 *x) -{ - int32 n; - Files_ReadNum(&*R, R__typ, &n); - *x = n; -} - void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x) { Files_Write(&*R, R__typ, __VAL(CHAR, x)); @@ -962,7 +954,7 @@ void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x) Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } -void Files_WriteSet (Files_Rider *R, address *R__typ, SET x) +void Files_WriteSet (Files_Rider *R, address *R__typ, uint32 x) { CHAR b[4]; int32 i; @@ -998,16 +990,7 @@ void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len Files_WriteBytes(&*R, R__typ, (void*)x, x__len * 1, i + 1); } -void Files_WriteNum (Files_Rider *R, address *R__typ, int32 x) -{ - while (x < -64 || x > 63) { - Files_Write(&*R, R__typ, (CHAR)(__MASK(x, -128) + 128)); - x = __ASHR(x, 7); - } - Files_Write(&*R, R__typ, (CHAR)__MASK(x, -128)); -} - -void Files_WriteNum64 (Files_Rider *R, address *R__typ, int64 x) +void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x) { while (x < -64 || x > 63) { Files_Write(&*R, R__typ, (CHAR)(__MASK(x, -128) + 128)); @@ -1059,9 +1042,8 @@ __TDESC(Files_Rider, 1, 1) = {__TDFLDS("Rider", 20), {8, -8}}; export void *Files__init(void) { __DEFMOD; - __MODULE_IMPORT(Configuration); - __MODULE_IMPORT(Console); __MODULE_IMPORT(Heap); + __MODULE_IMPORT(Console); __MODULE_IMPORT(Platform); __MODULE_IMPORT(Strings); __REGMOD("Files", EnumPtrs); diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index 55e5fa16..fd146132 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h @@ -46,9 +46,8 @@ import void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); import void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); import void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); import void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x); -import void Files_ReadNum64 (Files_Rider *R, address *R__typ, int64 *x); import void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); -import void Files_ReadSet (Files_Rider *R, address *R__typ, SET *x); +import void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x); import void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); import void Files_Register (Files_File f); import void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res); @@ -60,10 +59,9 @@ import void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, L import void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x); import void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x); import void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x); -import void Files_WriteNum (Files_Rider *R, address *R__typ, int32 x); -import void Files_WriteNum64 (Files_Rider *R, address *R__typ, int64 x); +import void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x); import void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x); -import void Files_WriteSet (Files_Rider *R, address *R__typ, SET x); +import void Files_WriteSet (Files_Rider *R, address *R__typ, uint32 x); import void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); import void *Files__init(void); diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index 1f66b283..b3eea6a3 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index 9e9400e1..a7135c5b 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index f165488e..2984f32f 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index a2ceebdf..9b84521f 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index e370e621..d099cad7 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "OPM.h" @@ -55,6 +56,7 @@ export void OPB_Return (OPT_Node *x, OPT_Object proc); export void OPB_SetElem (OPT_Node *x); static void OPB_SetIntType (OPT_Node node); export void OPB_SetRange (OPT_Node *x, OPT_Node y); +static void OPB_SetSetType (OPT_Node node); export void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno); export void OPB_StPar0 (OPT_Node *par0, int16 fctno); export void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno); @@ -223,6 +225,17 @@ static void OPB_SetIntType (OPT_Node node) node->typ = OPT_IntType(OPT_IntSize(node->conval->intval)); } +static void OPB_SetSetType (OPT_Node node) +{ + int32 i32; + __GET((address)&node->conval->setval + 4, i32, int32); + if (i32 == 0) { + node->typ = OPT_set32typ; + } else { + node->typ = OPT_set64typ; + } +} + OPT_Node OPB_NewIntConst (int64 intval) { OPT_Node _o_result; @@ -364,16 +377,16 @@ void OPB_Field (OPT_Node *x, OPT_Object y) } } -static struct TypTest__57 { +static struct TypTest__58 { OPT_Node *x; OPT_Object *obj; BOOLEAN *guard; - struct TypTest__57 *lnk; -} *TypTest__57_s; + struct TypTest__58 *lnk; +} *TypTest__58_s; -static void GTT__58 (OPT_Struct t0, OPT_Struct t1); +static void GTT__59 (OPT_Struct t0, OPT_Struct t1); -static void GTT__58 (OPT_Struct t0, OPT_Struct t1) +static void GTT__59 (OPT_Struct t0, OPT_Struct t1) { OPT_Node node = NIL; OPT_Struct t = NIL; @@ -386,54 +399,54 @@ static void GTT__58 (OPT_Struct t0, OPT_Struct t1) t1 = t1->BaseTyp; } if (t1 == t0 || t0->form == 0) { - if (*TypTest__57_s->guard) { - OPB_BindNodes(5, NIL, &*TypTest__57_s->x, NIL); - (*TypTest__57_s->x)->readonly = (*TypTest__57_s->x)->left->readonly; + if (*TypTest__58_s->guard) { + OPB_BindNodes(5, NIL, &*TypTest__58_s->x, NIL); + (*TypTest__58_s->x)->readonly = (*TypTest__58_s->x)->left->readonly; } else { node = OPT_NewNode(11); node->subcl = 16; - node->left = *TypTest__57_s->x; - node->obj = *TypTest__57_s->obj; - *TypTest__57_s->x = node; + node->left = *TypTest__58_s->x; + node->obj = *TypTest__58_s->obj; + *TypTest__58_s->x = node; } } else { OPB_err(85); } } else if (t0 != t1) { OPB_err(85); - } else if (!*TypTest__57_s->guard) { - if ((*TypTest__57_s->x)->class == 5) { + } else if (!*TypTest__58_s->guard) { + if ((*TypTest__58_s->x)->class == 5) { node = OPT_NewNode(11); node->subcl = 16; - node->left = *TypTest__57_s->x; - node->obj = *TypTest__57_s->obj; - *TypTest__57_s->x = node; + node->left = *TypTest__58_s->x; + node->obj = *TypTest__58_s->obj; + *TypTest__58_s->x = node; } else { - *TypTest__57_s->x = OPB_NewBoolConst(1); + *TypTest__58_s->x = OPB_NewBoolConst(1); } } } void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) { - struct TypTest__57 _s; + struct TypTest__58 _s; _s.x = x; _s.obj = &obj; _s.guard = &guard; - _s.lnk = TypTest__57_s; - TypTest__57_s = &_s; + _s.lnk = TypTest__58_s; + TypTest__58_s = &_s; if (OPB_NotVar(*x)) { OPB_err(112); } else if ((*x)->typ->form == 11) { if (((*x)->typ->BaseTyp->comp != 4 && (*x)->typ != OPT_sysptrtyp)) { OPB_err(85); } else if (obj->typ->form == 11) { - GTT__58((*x)->typ->BaseTyp, obj->typ->BaseTyp); + GTT__59((*x)->typ->BaseTyp, obj->typ->BaseTyp); } else { OPB_err(86); } } else if (((((*x)->typ->comp == 4 && (*x)->class == 1)) && obj->typ->comp == 4)) { - GTT__58((*x)->typ, obj->typ); + GTT__59((*x)->typ, obj->typ); } else { OPB_err(87); } @@ -442,7 +455,7 @@ void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) } else { (*x)->typ = OPT_booltyp; } - TypTest__57_s = _s.lnk; + TypTest__58_s = _s.lnk; } void OPB_In (OPT_Node *x, OPT_Node y) @@ -1109,7 +1122,13 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) f = (*x)->typ->form; g = typ->form; if ((*x)->class == 7) { - if (f == 4) { + if ((((f == 7 && g == 7)) && (*x)->typ->size > typ->size)) { + OPB_SetSetType(*x); + if ((*x)->typ->size > typ->size) { + OPB_err(203); + (*x)->conval->setval = 0x0; + } + } else if (f == 4) { if (g == 4) { if ((*x)->typ->size > typ->size) { OPB_SetIntType(*x); @@ -1243,6 +1262,13 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) OPB_err(100); } break; + case 7: + if ((g == 7 && y->typ->size < z->typ->size)) { + OPB_Convert(&y, z->typ); + } else { + OPB_err(100); + } + break; case 5: if (g == 4) { OPB_Convert(&y, z->typ); @@ -1969,13 +1995,13 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) *par0 = x; } -static struct StPar1__52 { - struct StPar1__52 *lnk; -} *StPar1__52_s; +static struct StPar1__53 { + struct StPar1__53 *lnk; +} *StPar1__53_s; -static OPT_Node NewOp__53 (int8 class, int8 subcl, OPT_Node left, OPT_Node right); +static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right); -static OPT_Node NewOp__53 (int8 class, int8 subcl, OPT_Node left, OPT_Node right) +static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right) { OPT_Node _o_result; OPT_Node node = NIL; @@ -1992,9 +2018,9 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) int16 f, L; OPT_Struct typ = NIL; OPT_Node p = NIL, t = NIL; - struct StPar1__52 _s; - _s.lnk = StPar1__52_s; - StPar1__52_s = &_s; + struct StPar1__53 _s; + _s.lnk = StPar1__53_s; + StPar1__53_s = &_s; p = *par0; f = x->typ->form; switch (fctno) { @@ -2010,7 +2036,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) OPB_err(111); } } - p = NewOp__53(19, fctno, p, x); + p = NewOp__54(19, fctno, p, x); p->typ = OPT_notyp; } break; @@ -2021,7 +2047,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > (int64)OPM_MaxSet))) { OPB_err(202); } - p = NewOp__53(19, fctno, p, x); + p = NewOp__54(19, fctno, p, x); } else { OPB_err(111); } @@ -2046,7 +2072,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) p = p->left; x->conval->intval += 1; } - p = NewOp__53(12, 19, p, x); + p = NewOp__54(12, 19, p, x); p->typ = OPT_linttyp; } else { p = x; @@ -2068,7 +2094,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) t = x; x = p; p = t; - p = NewOp__53(19, 18, p, x); + p = NewOp__54(19, 18, p, x); } else { OPB_err(111); } @@ -2094,7 +2120,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) } p->obj = NIL; } else { - p = NewOp__53(12, 17, p, x); + p = NewOp__54(12, 17, p, x); p->typ = p->left->typ; } } else { @@ -2125,9 +2151,9 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) OPB_err(111); } else { if (fctno == 22) { - p = NewOp__53(12, 27, p, x); + p = NewOp__54(12, 27, p, x); } else { - p = NewOp__53(12, 28, p, x); + p = NewOp__54(12, 28, p, x); } p->typ = p->left->typ; } @@ -2144,7 +2170,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) x = p; p = t; } - p = NewOp__53(19, fctno, p, x); + p = NewOp__54(19, fctno, p, x); } else { OPB_err(111); } @@ -2154,7 +2180,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (f == 4) { - p = NewOp__53(12, 26, p, x); + p = NewOp__54(12, 26, p, x); } else { OPB_err(111); } @@ -2182,7 +2208,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (f == 4) { - p = NewOp__53(19, 30, p, x); + p = NewOp__54(19, 30, p, x); } else { OPB_err(111); } @@ -2228,7 +2254,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) break; } *par0 = p; - StPar1__52_s = _s.lnk; + StPar1__53_s = _s.lnk; } void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n) diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index 8c0fd594..07dda5db 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 4c9ae495..545deb33 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Configuration.h" @@ -193,11 +194,15 @@ void OPC_Ident (OPT_Object obj) OPM_Write('_'); } } - } else if ((mode == 5 && obj->typ->form == 4)) { + } else if ((mode == 5 && __IN(obj->typ->form, 0x90, 32))) { if (obj->typ == OPT_adrtyp) { OPM_WriteString((CHAR*)"address", 8); } else { - OPM_WriteString((CHAR*)"int", 4); + if (obj->typ->form == 4) { + OPM_WriteString((CHAR*)"int", 4); + } else { + OPM_WriteString((CHAR*)"uint", 5); + } OPM_WriteInt(__ASHL(obj->typ->size, 3)); } } else { @@ -1233,13 +1238,16 @@ void OPC_GenBdy (OPT_Node n) OPM_currFile = 1; OPC_GenHeaderMsg(); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#define INTEGER int", 20); + OPM_WriteString((CHAR*)"#define SHORTINT int", 21); + OPM_WriteInt(__ASHL(OPT_sinttyp->size, 3)); + OPM_WriteLn(); + OPM_WriteString((CHAR*)"#define INTEGER int", 21); OPM_WriteInt(__ASHL(OPT_inttyp->size, 3)); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#define LONGINT int", 20); + OPM_WriteString((CHAR*)"#define LONGINT int", 21); OPM_WriteInt(__ASHL(OPT_linttyp->size, 3)); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#define SET uint", 21); + OPM_WriteString((CHAR*)"#define SET uint", 22); OPM_WriteInt(__ASHL(OPT_settyp->size, 3)); OPM_WriteLn(); OPM_WriteLn(); @@ -1851,7 +1859,7 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim) void OPC_Constant (OPT_Const con, int16 form) { int16 i; - SET s; + uint32 s; int32 hex; BOOLEAN skipLeading; switch (form) { diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index e681f43d..c9cf0ace 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 534a5c0d..32bb978e 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Configuration.h" @@ -25,7 +26,7 @@ static int16 OPM_GlobalAddressSize; export int16 OPM_AddressSize; static int16 OPM_GlobalAlignment; export int16 OPM_Alignment; -export SET OPM_GlobalOptions, OPM_Options; +export uint32 OPM_GlobalOptions, OPM_Options; export int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize, OPM_MaxSet; export int64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; @@ -52,7 +53,7 @@ export void OPM_DeleteNewSym (void); export void OPM_FPrint (int32 *fp, int64 val); export void OPM_FPrintLReal (int32 *fp, LONGREAL lr); export void OPM_FPrintReal (int32 *fp, REAL real); -export void OPM_FPrintSet (int32 *fp, SET set); +export void OPM_FPrintSet (int32 *fp, uint32 set); static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 pos); export void OPM_Get (CHAR *ch); export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); @@ -80,12 +81,12 @@ export int32 OPM_SymRInt (void); export int64 OPM_SymRInt64 (void); export void OPM_SymRLReal (LONGREAL *lr); export void OPM_SymRReal (REAL *r); -export void OPM_SymRSet (SET *s); +export void OPM_SymRSet (uint32 *s); export void OPM_SymWCh (CHAR ch); export void OPM_SymWInt (int64 i); export void OPM_SymWLReal (LONGREAL lr); export void OPM_SymWReal (REAL r); -export void OPM_SymWSet (SET s); +export void OPM_SymWSet (uint32 s); static void OPM_VerboseListSizes (void); export void OPM_Write (CHAR ch); export void OPM_WriteHex (int64 i); @@ -329,7 +330,7 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWStr((CHAR*)" -V Display compiler debugging messages.", 46); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" Size model for elementary types (default O2 on 32 bit builds, OV on 64 bits)", 79); + OPM_LogWStr((CHAR*)" Size model for elementary types (default O2)", 47); OPM_LogWLn(); OPM_LogWStr((CHAR*)" -O2 Original Oberon / Oberon-2: 8 bit SHORTINT, 16 bit INTEGER, 32 bit LONGINT and SET.", 95); OPM_LogWLn(); @@ -709,10 +710,10 @@ void OPM_err (int16 n) void OPM_FPrint (int32 *fp, int64 val) { - *fp = __ROTL((int32)((SET)*fp ^ __VAL(SET, val)), 1, 32); + *fp = __ROTL((int32)((uint32)*fp ^ __VAL(uint32, val)), 1, 32); } -void OPM_FPrintSet (int32 *fp, SET set) +void OPM_FPrintSet (int32 *fp, uint32 set) { OPM_FPrint(&*fp, (int32)set); } @@ -751,13 +752,11 @@ int32 OPM_SymRInt (void) int64 OPM_SymRInt64 (void) { int64 _o_result; - int64 k; - Files_ReadNum64(&OPM_oldSF, Files_Rider__typ, &k); - _o_result = k; + _o_result = OPM_SymRInt(); return _o_result; } -void OPM_SymRSet (SET *s) +void OPM_SymRSet (uint32 *s) { Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (int32*)&*s); } @@ -808,10 +807,10 @@ void OPM_SymWCh (CHAR ch) void OPM_SymWInt (int64 i) { - Files_WriteNum64(&OPM_newSF, Files_Rider__typ, i); + Files_WriteNum(&OPM_newSF, Files_Rider__typ, i); } -void OPM_SymWSet (SET s) +void OPM_SymWSet (uint32 s) { Files_WriteNum(&OPM_newSF, Files_Rider__typ, (int32)s); } diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index 933ef1b5..dd3c0c27 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h @@ -8,7 +8,7 @@ import CHAR OPM_Model[10]; import int16 OPM_AddressSize, OPM_Alignment; -import SET OPM_GlobalOptions, OPM_Options; +import uint32 OPM_GlobalOptions, OPM_Options; import int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize, OPM_MaxSet; import int64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; @@ -26,7 +26,7 @@ import void OPM_DeleteNewSym (void); import void OPM_FPrint (int32 *fp, int64 val); import void OPM_FPrintLReal (int32 *fp, LONGREAL lr); import void OPM_FPrintReal (int32 *fp, REAL real); -import void OPM_FPrintSet (int32 *fp, SET set); +import void OPM_FPrintSet (int32 *fp, uint32 set); import void OPM_Get (CHAR *ch); import void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); import void OPM_InitOptions (void); @@ -49,12 +49,12 @@ import int32 OPM_SymRInt (void); import int64 OPM_SymRInt64 (void); import void OPM_SymRLReal (LONGREAL *lr); import void OPM_SymRReal (REAL *r); -import void OPM_SymRSet (SET *s); +import void OPM_SymRSet (uint32 *s); import void OPM_SymWCh (CHAR ch); import void OPM_SymWInt (int64 i); import void OPM_SymWLReal (LONGREAL lr); import void OPM_SymWReal (REAL r); -import void OPM_SymWSet (SET s); +import void OPM_SymWSet (uint32 s); import void OPM_Write (CHAR ch); import void OPM_WriteHex (int64 i); import void OPM_WriteInt (int64 i); diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index 010efab1..1eff447d 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "OPB.h" @@ -39,7 +40,7 @@ static void OPP_Expression (OPT_Node *x); static BOOLEAN OPP_Extends (OPT_Struct x, OPT_Struct b); static void OPP_Factor (OPT_Node *x); static void OPP_FormalParameters (OPT_Object *firstPar, OPT_Struct *resTyp); -export void OPP_Module (OPT_Node *prog, SET opt); +export void OPP_Module (OPT_Node *prog, uint32 opt); static void OPP_PointerType (OPT_Struct *typ); static void OPP_ProcedureDeclaration (OPT_Node *x); static void OPP_Receiver (int8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec); @@ -1775,7 +1776,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) OPP_CheckSym(41); } -void OPP_Module (OPT_Node *prog, SET opt) +void OPP_Module (OPT_Node *prog, uint32 opt) { OPS_Name impName, aliasName; OPT_Node procdec = NIL, statseq = NIL; diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index 373d8daa..c759545a 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h @@ -9,7 +9,7 @@ -import void OPP_Module (OPT_Node *prog, SET opt); +import void OPP_Module (OPT_Node *prog, uint32 opt); import void *OPP__init(void); diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index f8ed61bf..18c3c066 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index 1f02668b..260fcd01 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 3f54ed72..5bfcda58 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "OPM.h" @@ -19,7 +20,7 @@ typedef OPT_ConstExt ext; int64 intval; int32 intval2; - SET setval; + uint32 setval; LONGREAL realval; } OPT_ConstDesc; @@ -88,8 +89,8 @@ typedef export OPT_Object OPT_topScope; -export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; -export OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj; +export OPT_Struct OPT_undftyp, OPT_niltyp, OPT_notyp, OPT_bytetyp, OPT_cpbytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_settyp, OPT_set32typ, OPT_set64typ, OPT_realtyp, OPT_lrltyp, OPT_stringtyp, OPT_adrtyp, OPT_sysptrtyp; +export OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj, OPT_setobj; export int8 OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; @@ -137,7 +138,7 @@ static void OPT_InSign (int8 mno, OPT_Struct *res, OPT_Object *par); static void OPT_InStruct (OPT_Struct *typ); static OPT_Object OPT_InTProc (int8 mno); static OPT_Struct OPT_InTyp (int32 tag); -export void OPT_Init (OPS_Name name, SET opt); +export void OPT_Init (OPS_Name name, uint32 opt); export void OPT_InitRecno (void); static void OPT_InitStruct (OPT_Struct *typ, int8 form); export void OPT_Insert (OPS_Name name, OPT_Object *obj); @@ -159,6 +160,7 @@ static void OPT_OutObj (OPT_Object obj); static void OPT_OutSign (OPT_Struct result, OPT_Object par); static void OPT_OutStr (OPT_Struct typ); static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj); +export OPT_Struct OPT_SetType (int32 size); export OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir); export int32 OPT_SizeAlignment (int32 size); export void OPT_TypSize (OPT_Struct typ); @@ -209,6 +211,17 @@ OPT_Struct OPT_IntType (int32 size) return _o_result; } +OPT_Struct OPT_SetType (int32 size) +{ + OPT_Struct _o_result; + if (size == OPT_set32typ->size) { + _o_result = OPT_set32typ; + return _o_result; + } + _o_result = OPT_set64typ; + return _o_result; +} + OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir) { OPT_Struct _o_result; @@ -449,7 +462,7 @@ void OPT_CloseScope (void) OPT_topScope = OPT_topScope->left; } -void OPT_Init (OPS_Name name, SET opt) +void OPT_Init (OPS_Name name, uint32 opt) { OPT_topScope = OPT_universe; OPT_OpenScope(0, NIL); @@ -1171,6 +1184,9 @@ static OPT_Struct OPT_InTyp (int32 tag) if (tag == 4) { _o_result = OPT_IntType(OPM_SymRInt()); return _o_result; + } else if (tag == 7) { + _o_result = OPT_SetType(OPM_SymRInt()); + return _o_result; } else { _o_result = OPT_impCtxt.ref[__X(tag, 255)]; return _o_result; @@ -1628,7 +1644,7 @@ static void OPT_OutStr (OPT_Struct typ) OPT_Object strobj = NIL; if (typ->ref < OPT_expCtxt.ref) { OPM_SymWInt(-typ->ref); - if (typ->ref == 4) { + if (__IN(typ->ref, 0x90, 32)) { OPM_SymWInt(typ->size); } } else { @@ -1732,6 +1748,7 @@ static void OPT_OutConstant (OPT_Object obj) break; case 7: OPM_SymWSet(obj->conval->setval); + OPM_SymWInt(obj->typ->size); break; case 5: rval = obj->conval->realval; @@ -1959,28 +1976,32 @@ static void EnumPtrs(void (*P)(void*)) { P(OPT_topScope); P(OPT_undftyp); + P(OPT_niltyp); + P(OPT_notyp); P(OPT_bytetyp); + P(OPT_cpbytetyp); P(OPT_booltyp); P(OPT_chartyp); P(OPT_sinttyp); P(OPT_inttyp); P(OPT_linttyp); P(OPT_hinttyp); - P(OPT_adrtyp); P(OPT_int8typ); P(OPT_int16typ); P(OPT_int32typ); P(OPT_int64typ); + P(OPT_settyp); + P(OPT_set32typ); + P(OPT_set64typ); P(OPT_realtyp); P(OPT_lrltyp); - P(OPT_settyp); P(OPT_stringtyp); - P(OPT_niltyp); - P(OPT_notyp); + P(OPT_adrtyp); P(OPT_sysptrtyp); P(OPT_sintobj); P(OPT_intobj); P(OPT_lintobj); + P(OPT_setobj); __ENUMP(OPT_GlbMod, 64, P); P(OPT_universe); P(OPT_syslink); @@ -2056,6 +2077,8 @@ export void *OPT__init(void) OPT_EnterTyp((CHAR*)"INT16", 4, 2, &OPT_int16typ); OPT_EnterTyp((CHAR*)"INT32", 4, 4, &OPT_int32typ); OPT_EnterTyp((CHAR*)"INT64", 4, 8, &OPT_int64typ); + OPT_EnterTyp((CHAR*)"SET32", 7, 4, &OPT_set32typ); + OPT_EnterTyp((CHAR*)"SET64", 7, 8, &OPT_set64typ); OPT_EnterProc((CHAR*)"ADR", 20); OPT_EnterProc((CHAR*)"CC", 21); OPT_EnterProc((CHAR*)"LSH", 22); @@ -2073,13 +2096,14 @@ export void *OPT__init(void) OPT_topScope->right = NIL; OPT_EnterTyp((CHAR*)"BOOLEAN", 2, 1, &OPT_booltyp); OPT_EnterTyp((CHAR*)"CHAR", 3, 1, &OPT_chartyp); - OPT_EnterTyp((CHAR*)"SET", 7, -1, &OPT_settyp); OPT_EnterTyp((CHAR*)"REAL", 5, 4, &OPT_realtyp); OPT_EnterTyp((CHAR*)"LONGREAL", 6, 8, &OPT_lrltyp); OPT_EnterTyp((CHAR*)"HUGEINT", 4, 8, &OPT_hinttyp); + OPT_EnterTyp((CHAR*)"BYTE@", 4, 1, &OPT_cpbytetyp); OPT_EnterTypeAlias((CHAR*)"SHORTINT", &OPT_sintobj); OPT_EnterTypeAlias((CHAR*)"INTEGER", &OPT_intobj); OPT_EnterTypeAlias((CHAR*)"LONGINT", &OPT_lintobj); + OPT_EnterTypeAlias((CHAR*)"SET", &OPT_setobj); OPT_EnterBoolConst((CHAR*)"FALSE", 0); OPT_EnterBoolConst((CHAR*)"TRUE", 1); OPT_EnterProc((CHAR*)"HALT", 0); diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index 202c8278..2bc05576 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h @@ -17,7 +17,7 @@ typedef OPT_ConstExt ext; int64 intval; int32 intval2; - SET setval; + uint32 setval; LONGREAL realval; } OPT_ConstDesc; @@ -67,8 +67,8 @@ typedef import OPT_Object OPT_topScope; -import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; -import OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj; +import OPT_Struct OPT_undftyp, OPT_niltyp, OPT_notyp, OPT_bytetyp, OPT_cpbytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_settyp, OPT_set32typ, OPT_set64typ, OPT_realtyp, OPT_lrltyp, OPT_stringtyp, OPT_adrtyp, OPT_sysptrtyp; +import OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj, OPT_setobj; import int8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; @@ -92,7 +92,7 @@ import void OPT_FindField (OPS_Name name, OPT_Struct typ, OPT_Object *res); import void OPT_FindImport (OPT_Object mod, OPT_Object *res); import void OPT_IdFPrint (OPT_Struct typ); import void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); -import void OPT_Init (OPS_Name name, SET opt); +import void OPT_Init (OPS_Name name, uint32 opt); import void OPT_InitRecno (void); import void OPT_Insert (OPS_Name name, OPT_Object *obj); import void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); @@ -104,6 +104,7 @@ import OPT_Node OPT_NewNode (int8 class); import OPT_Object OPT_NewObj (void); import OPT_Struct OPT_NewStr (int8 form, int8 comp); import void OPT_OpenScope (int8 level, OPT_Object owner); +import OPT_Struct OPT_SetType (int32 size); import OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir); import int32 OPT_SizeAlignment (int32 size); import void OPT_TypSize (OPT_Struct typ); diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index ff99f665..99e7aa6a 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "OPC.h" @@ -187,6 +188,7 @@ void OPV_AdrAndSize (OPT_Object topScope) OPV_Traverse(topScope->right, topScope, 1); OPV_Traverse(topScope->right, topScope, 0); OPT_chartyp->strobj->linkadr = 2; + OPT_cpbytetyp->strobj->linkadr = 2; OPT_settyp->strobj->linkadr = 2; OPT_realtyp->strobj->linkadr = 2; OPT_adrtyp->strobj->linkadr = 2; @@ -194,6 +196,8 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_int16typ->strobj->linkadr = 2; OPT_int32typ->strobj->linkadr = 2; OPT_int64typ->strobj->linkadr = 2; + OPT_set32typ->strobj->linkadr = 2; + OPT_set64typ->strobj->linkadr = 2; OPT_hinttyp->strobj->linkadr = 2; OPT_lrltyp->strobj->linkadr = 2; OPT_booltyp->strobj->linkadr = 2; diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index a44fb5b5..f5e41d45 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 18c66534..defb84f0 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" @@ -40,7 +41,7 @@ export int32 Platform_ArgVector; static Platform_HaltProcedure Platform_HaltHandler; static int32 Platform_TimeStart; export int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; -export CHAR Platform_nl[3]; +export CHAR Platform_NL[3]; export address *Platform_FileIdentity__typ; @@ -798,7 +799,7 @@ export void *Platform__init(void) Platform_SeekSet = Platform_seekset(); Platform_SeekCur = Platform_seekcur(); Platform_SeekEnd = Platform_seekend(); - Platform_nl[0] = 0x0a; - Platform_nl[1] = 0x00; + Platform_NL[0] = 0x0a; + Platform_NL[1] = 0x00; __ENDMOD; } diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index 158cb341..01e08432 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h @@ -26,7 +26,7 @@ import CHAR Platform_CWD[256]; import int16 Platform_ArgCount; import int32 Platform_ArgVector; import int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; -import CHAR Platform_nl[3]; +import CHAR Platform_NL[3]; import address *Platform_FileIdentity__typ; diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 57e22100..d7d2994c 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index f3404dda..8c1ff819 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index bcf3cb9b..ac03bada 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index 9418692a..cc9d99a1 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index 28f099a4..09661382 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Files.h" @@ -183,7 +184,7 @@ export address *Texts_Writer__typ; export address *Texts__1__typ; export void Texts_Append (Texts_Text T, Texts_Buffer B); -export void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff); +export void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, uint32 sel, Texts_FontsFont fnt, int8 col, int8 voff); static Texts_Elem Texts_CloneElem (Texts_Elem e); static Texts_Piece Texts_ClonePiece (Texts_Piece p); export void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len); @@ -565,7 +566,7 @@ void Texts_Delete (Texts_Text T, int32 beg, int32 end) } } -void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff) +void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, uint32 sel, Texts_FontsFont fnt, int8 col, int8 voff) { Texts_Run c = NIL, u = NIL, un = NIL, v = NIL, vn = NIL; int32 co, uo, ud, vo, vd; diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index 0afd65f7..86f8f5b7 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h @@ -130,7 +130,7 @@ import address *Texts_Scanner__typ; import address *Texts_Writer__typ; import void Texts_Append (Texts_Text T, Texts_Buffer B); -import void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff); +import void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, uint32 sel, Texts_FontsFont fnt, int8 col, int8 voff); import void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len); import void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); import void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); diff --git a/bootstrap/unix-48/errors.c b/bootstrap/unix-48/errors.c index ba890a17..f284397b 100644 --- a/bootstrap/unix-48/errors.c +++ b/bootstrap/unix-48/errors.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" diff --git a/bootstrap/unix-48/errors.h b/bootstrap/unix-48/errors.h index d8124792..5aa2a5f6 100644 --- a/bootstrap/unix-48/errors.h +++ b/bootstrap/unix-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index 76fdc084..fe7eb545 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index bb5be954..8cdd8e01 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/vt100.c b/bootstrap/unix-48/vt100.c index c44586d2..a4bc9ec1 100644 --- a/bootstrap/unix-48/vt100.c +++ b/bootstrap/unix-48/vt100.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/unix-48/vt100.h b/bootstrap/unix-48/vt100.h index c9a01a7c..44d81f73 100644 --- a/bootstrap/unix-48/vt100.h +++ b/bootstrap/unix-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-88/Compiler.c b/bootstrap/unix-88/Compiler.c index 1b3b14f1..637fd329 100644 --- a/bootstrap/unix-88/Compiler.c +++ b/bootstrap/unix-88/Compiler.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Configuration.h" @@ -83,7 +84,6 @@ static void Compiler_PropagateElementaryTypeSizes (void) OPT_Struct adrinttyp = NIL; OPT_sysptrtyp->size = OPM_AddressSize; OPT_adrtyp->size = OPM_AddressSize; - OPT_settyp->size = OPM_SetSize; adrinttyp = OPT_IntType(OPM_AddressSize); OPT_adrtyp->strobj = adrinttyp->strobj; OPT_sinttyp = OPT_IntType(OPM_ShortintSize); @@ -92,6 +92,20 @@ static void Compiler_PropagateElementaryTypeSizes (void) OPT_sintobj->typ = OPT_sinttyp; OPT_intobj->typ = OPT_inttyp; OPT_lintobj->typ = OPT_linttyp; + switch (OPM_LongintSize) { + case 4: + OPT_settyp = OPT_set32typ; + break; + default: + OPT_settyp = OPT_set64typ; + break; + } + OPT_setobj->typ = OPT_settyp; + if (__STRCMP(OPM_Model, "C") == 0) { + OPT_cpbytetyp->strobj->name[4] = 0x00; + } else { + OPT_cpbytetyp->strobj->name[4] = '@'; + } } void Compiler_Translate (void) diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index 85c8cf89..a3240e8e 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" @@ -18,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index a365d693..4d4279da 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Console.c b/bootstrap/unix-88/Console.c index c2089f05..206f8024 100644 --- a/bootstrap/unix-88/Console.c +++ b/bootstrap/unix-88/Console.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Platform.h" diff --git a/bootstrap/unix-88/Console.h b/bootstrap/unix-88/Console.h index 08f4e38e..6549e2cc 100644 --- a/bootstrap/unix-88/Console.h +++ b/bootstrap/unix-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index efa49511..8e446a1c 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,13 +1,13 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" -#include "Configuration.h" -#include "Console.h" #include "Heap.h" +#include "Console.h" #include "Platform.h" #include "Strings.h" @@ -89,9 +89,8 @@ export void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); export void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); export void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); export void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x); -export void Files_ReadNum64 (Files_Rider *R, address *R__typ, int64 *x); export void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); -export void Files_ReadSet (Files_Rider *R, address *R__typ, SET *x); +export void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x); export void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); export void Files_Register (Files_File f); export void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res); @@ -104,13 +103,13 @@ export void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, L export void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x); export void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x); export void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x); -export void Files_WriteNum (Files_Rider *R, address *R__typ, int32 x); -export void Files_WriteNum64 (Files_Rider *R, address *R__typ, int64 x); +export void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x); export void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x); -export void Files_WriteSet (Files_Rider *R, address *R__typ, SET x); +export void Files_WriteSet (Files_Rider *R, address *R__typ, uint32 x); export void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); #define Files_IdxTrap() __HALT(-1) +#define Files_ToAdr(x) (address)x static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int16 errcode) { @@ -662,7 +661,7 @@ void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x } else { min = n; } - __MOVE((address)buf->data + (int64)offset, (address)x + (int64)xpos, min); + __MOVE((address)buf->data + Files_ToAdr(offset), (address)x + Files_ToAdr(xpos), min); offset += min; (*r).offset = offset; xpos += min; @@ -722,7 +721,7 @@ void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT } else { min = n; } - __MOVE((address)x + (int64)xpos, (address)buf->data + (int64)offset, min); + __MOVE((address)x + Files_ToAdr(xpos), (address)buf->data + Files_ToAdr(offset), min); offset += min; (*r).offset = offset; if (offset > buf->size) { @@ -862,13 +861,13 @@ void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x) *x = (((int16)b[0] + __ASHL((int16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); } -void Files_ReadSet (Files_Rider *R, address *R__typ, SET *x) +void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x) { CHAR b[4]; int32 l; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); l = (((int16)b[0] + __ASHL((int16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); - *x = (SET)l; + *x = (uint32)l; } void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x) @@ -932,13 +931,6 @@ void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x) *x = n; } -void Files_ReadNum64 (Files_Rider *R, address *R__typ, int64 *x) -{ - int32 n; - Files_ReadNum(&*R, R__typ, &n); - *x = n; -} - void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x) { Files_Write(&*R, R__typ, __VAL(CHAR, x)); @@ -962,7 +954,7 @@ void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x) Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } -void Files_WriteSet (Files_Rider *R, address *R__typ, SET x) +void Files_WriteSet (Files_Rider *R, address *R__typ, uint32 x) { CHAR b[4]; int32 i; @@ -998,16 +990,7 @@ void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len Files_WriteBytes(&*R, R__typ, (void*)x, x__len * 1, i + 1); } -void Files_WriteNum (Files_Rider *R, address *R__typ, int32 x) -{ - while (x < -64 || x > 63) { - Files_Write(&*R, R__typ, (CHAR)(__MASK(x, -128) + 128)); - x = __ASHR(x, 7); - } - Files_Write(&*R, R__typ, (CHAR)__MASK(x, -128)); -} - -void Files_WriteNum64 (Files_Rider *R, address *R__typ, int64 x) +void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x) { while (x < -64 || x > 63) { Files_Write(&*R, R__typ, (CHAR)(__MASK(x, -128) + 128)); @@ -1059,9 +1042,8 @@ __TDESC(Files_Rider, 1, 1) = {__TDFLDS("Rider", 24), {8, -16}}; export void *Files__init(void) { __DEFMOD; - __MODULE_IMPORT(Configuration); - __MODULE_IMPORT(Console); __MODULE_IMPORT(Heap); + __MODULE_IMPORT(Console); __MODULE_IMPORT(Platform); __MODULE_IMPORT(Strings); __REGMOD("Files", EnumPtrs); diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 5aebf125..edb43852 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h @@ -48,9 +48,8 @@ import void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); import void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); import void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); import void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x); -import void Files_ReadNum64 (Files_Rider *R, address *R__typ, int64 *x); import void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); -import void Files_ReadSet (Files_Rider *R, address *R__typ, SET *x); +import void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x); import void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); import void Files_Register (Files_File f); import void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res); @@ -62,10 +61,9 @@ import void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, L import void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x); import void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x); import void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x); -import void Files_WriteNum (Files_Rider *R, address *R__typ, int32 x); -import void Files_WriteNum64 (Files_Rider *R, address *R__typ, int64 x); +import void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x); import void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x); -import void Files_WriteSet (Files_Rider *R, address *R__typ, SET x); +import void Files_WriteSet (Files_Rider *R, address *R__typ, uint32 x); import void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); import void *Files__init(void); diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index 71ad15a1..571a7dd2 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index 0cd62e2b..2187094a 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 0e05b5aa..e18d29cf 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index a2ceebdf..9b84521f 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index e370e621..d099cad7 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "OPM.h" @@ -55,6 +56,7 @@ export void OPB_Return (OPT_Node *x, OPT_Object proc); export void OPB_SetElem (OPT_Node *x); static void OPB_SetIntType (OPT_Node node); export void OPB_SetRange (OPT_Node *x, OPT_Node y); +static void OPB_SetSetType (OPT_Node node); export void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno); export void OPB_StPar0 (OPT_Node *par0, int16 fctno); export void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno); @@ -223,6 +225,17 @@ static void OPB_SetIntType (OPT_Node node) node->typ = OPT_IntType(OPT_IntSize(node->conval->intval)); } +static void OPB_SetSetType (OPT_Node node) +{ + int32 i32; + __GET((address)&node->conval->setval + 4, i32, int32); + if (i32 == 0) { + node->typ = OPT_set32typ; + } else { + node->typ = OPT_set64typ; + } +} + OPT_Node OPB_NewIntConst (int64 intval) { OPT_Node _o_result; @@ -364,16 +377,16 @@ void OPB_Field (OPT_Node *x, OPT_Object y) } } -static struct TypTest__57 { +static struct TypTest__58 { OPT_Node *x; OPT_Object *obj; BOOLEAN *guard; - struct TypTest__57 *lnk; -} *TypTest__57_s; + struct TypTest__58 *lnk; +} *TypTest__58_s; -static void GTT__58 (OPT_Struct t0, OPT_Struct t1); +static void GTT__59 (OPT_Struct t0, OPT_Struct t1); -static void GTT__58 (OPT_Struct t0, OPT_Struct t1) +static void GTT__59 (OPT_Struct t0, OPT_Struct t1) { OPT_Node node = NIL; OPT_Struct t = NIL; @@ -386,54 +399,54 @@ static void GTT__58 (OPT_Struct t0, OPT_Struct t1) t1 = t1->BaseTyp; } if (t1 == t0 || t0->form == 0) { - if (*TypTest__57_s->guard) { - OPB_BindNodes(5, NIL, &*TypTest__57_s->x, NIL); - (*TypTest__57_s->x)->readonly = (*TypTest__57_s->x)->left->readonly; + if (*TypTest__58_s->guard) { + OPB_BindNodes(5, NIL, &*TypTest__58_s->x, NIL); + (*TypTest__58_s->x)->readonly = (*TypTest__58_s->x)->left->readonly; } else { node = OPT_NewNode(11); node->subcl = 16; - node->left = *TypTest__57_s->x; - node->obj = *TypTest__57_s->obj; - *TypTest__57_s->x = node; + node->left = *TypTest__58_s->x; + node->obj = *TypTest__58_s->obj; + *TypTest__58_s->x = node; } } else { OPB_err(85); } } else if (t0 != t1) { OPB_err(85); - } else if (!*TypTest__57_s->guard) { - if ((*TypTest__57_s->x)->class == 5) { + } else if (!*TypTest__58_s->guard) { + if ((*TypTest__58_s->x)->class == 5) { node = OPT_NewNode(11); node->subcl = 16; - node->left = *TypTest__57_s->x; - node->obj = *TypTest__57_s->obj; - *TypTest__57_s->x = node; + node->left = *TypTest__58_s->x; + node->obj = *TypTest__58_s->obj; + *TypTest__58_s->x = node; } else { - *TypTest__57_s->x = OPB_NewBoolConst(1); + *TypTest__58_s->x = OPB_NewBoolConst(1); } } } void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) { - struct TypTest__57 _s; + struct TypTest__58 _s; _s.x = x; _s.obj = &obj; _s.guard = &guard; - _s.lnk = TypTest__57_s; - TypTest__57_s = &_s; + _s.lnk = TypTest__58_s; + TypTest__58_s = &_s; if (OPB_NotVar(*x)) { OPB_err(112); } else if ((*x)->typ->form == 11) { if (((*x)->typ->BaseTyp->comp != 4 && (*x)->typ != OPT_sysptrtyp)) { OPB_err(85); } else if (obj->typ->form == 11) { - GTT__58((*x)->typ->BaseTyp, obj->typ->BaseTyp); + GTT__59((*x)->typ->BaseTyp, obj->typ->BaseTyp); } else { OPB_err(86); } } else if (((((*x)->typ->comp == 4 && (*x)->class == 1)) && obj->typ->comp == 4)) { - GTT__58((*x)->typ, obj->typ); + GTT__59((*x)->typ, obj->typ); } else { OPB_err(87); } @@ -442,7 +455,7 @@ void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) } else { (*x)->typ = OPT_booltyp; } - TypTest__57_s = _s.lnk; + TypTest__58_s = _s.lnk; } void OPB_In (OPT_Node *x, OPT_Node y) @@ -1109,7 +1122,13 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) f = (*x)->typ->form; g = typ->form; if ((*x)->class == 7) { - if (f == 4) { + if ((((f == 7 && g == 7)) && (*x)->typ->size > typ->size)) { + OPB_SetSetType(*x); + if ((*x)->typ->size > typ->size) { + OPB_err(203); + (*x)->conval->setval = 0x0; + } + } else if (f == 4) { if (g == 4) { if ((*x)->typ->size > typ->size) { OPB_SetIntType(*x); @@ -1243,6 +1262,13 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) OPB_err(100); } break; + case 7: + if ((g == 7 && y->typ->size < z->typ->size)) { + OPB_Convert(&y, z->typ); + } else { + OPB_err(100); + } + break; case 5: if (g == 4) { OPB_Convert(&y, z->typ); @@ -1969,13 +1995,13 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) *par0 = x; } -static struct StPar1__52 { - struct StPar1__52 *lnk; -} *StPar1__52_s; +static struct StPar1__53 { + struct StPar1__53 *lnk; +} *StPar1__53_s; -static OPT_Node NewOp__53 (int8 class, int8 subcl, OPT_Node left, OPT_Node right); +static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right); -static OPT_Node NewOp__53 (int8 class, int8 subcl, OPT_Node left, OPT_Node right) +static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right) { OPT_Node _o_result; OPT_Node node = NIL; @@ -1992,9 +2018,9 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) int16 f, L; OPT_Struct typ = NIL; OPT_Node p = NIL, t = NIL; - struct StPar1__52 _s; - _s.lnk = StPar1__52_s; - StPar1__52_s = &_s; + struct StPar1__53 _s; + _s.lnk = StPar1__53_s; + StPar1__53_s = &_s; p = *par0; f = x->typ->form; switch (fctno) { @@ -2010,7 +2036,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) OPB_err(111); } } - p = NewOp__53(19, fctno, p, x); + p = NewOp__54(19, fctno, p, x); p->typ = OPT_notyp; } break; @@ -2021,7 +2047,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > (int64)OPM_MaxSet))) { OPB_err(202); } - p = NewOp__53(19, fctno, p, x); + p = NewOp__54(19, fctno, p, x); } else { OPB_err(111); } @@ -2046,7 +2072,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) p = p->left; x->conval->intval += 1; } - p = NewOp__53(12, 19, p, x); + p = NewOp__54(12, 19, p, x); p->typ = OPT_linttyp; } else { p = x; @@ -2068,7 +2094,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) t = x; x = p; p = t; - p = NewOp__53(19, 18, p, x); + p = NewOp__54(19, 18, p, x); } else { OPB_err(111); } @@ -2094,7 +2120,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) } p->obj = NIL; } else { - p = NewOp__53(12, 17, p, x); + p = NewOp__54(12, 17, p, x); p->typ = p->left->typ; } } else { @@ -2125,9 +2151,9 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) OPB_err(111); } else { if (fctno == 22) { - p = NewOp__53(12, 27, p, x); + p = NewOp__54(12, 27, p, x); } else { - p = NewOp__53(12, 28, p, x); + p = NewOp__54(12, 28, p, x); } p->typ = p->left->typ; } @@ -2144,7 +2170,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) x = p; p = t; } - p = NewOp__53(19, fctno, p, x); + p = NewOp__54(19, fctno, p, x); } else { OPB_err(111); } @@ -2154,7 +2180,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (f == 4) { - p = NewOp__53(12, 26, p, x); + p = NewOp__54(12, 26, p, x); } else { OPB_err(111); } @@ -2182,7 +2208,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (f == 4) { - p = NewOp__53(19, 30, p, x); + p = NewOp__54(19, 30, p, x); } else { OPB_err(111); } @@ -2228,7 +2254,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) break; } *par0 = p; - StPar1__52_s = _s.lnk; + StPar1__53_s = _s.lnk; } void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n) diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index 8c0fd594..07dda5db 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index 4c9ae495..545deb33 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Configuration.h" @@ -193,11 +194,15 @@ void OPC_Ident (OPT_Object obj) OPM_Write('_'); } } - } else if ((mode == 5 && obj->typ->form == 4)) { + } else if ((mode == 5 && __IN(obj->typ->form, 0x90, 32))) { if (obj->typ == OPT_adrtyp) { OPM_WriteString((CHAR*)"address", 8); } else { - OPM_WriteString((CHAR*)"int", 4); + if (obj->typ->form == 4) { + OPM_WriteString((CHAR*)"int", 4); + } else { + OPM_WriteString((CHAR*)"uint", 5); + } OPM_WriteInt(__ASHL(obj->typ->size, 3)); } } else { @@ -1233,13 +1238,16 @@ void OPC_GenBdy (OPT_Node n) OPM_currFile = 1; OPC_GenHeaderMsg(); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#define INTEGER int", 20); + OPM_WriteString((CHAR*)"#define SHORTINT int", 21); + OPM_WriteInt(__ASHL(OPT_sinttyp->size, 3)); + OPM_WriteLn(); + OPM_WriteString((CHAR*)"#define INTEGER int", 21); OPM_WriteInt(__ASHL(OPT_inttyp->size, 3)); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#define LONGINT int", 20); + OPM_WriteString((CHAR*)"#define LONGINT int", 21); OPM_WriteInt(__ASHL(OPT_linttyp->size, 3)); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#define SET uint", 21); + OPM_WriteString((CHAR*)"#define SET uint", 22); OPM_WriteInt(__ASHL(OPT_settyp->size, 3)); OPM_WriteLn(); OPM_WriteLn(); @@ -1851,7 +1859,7 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim) void OPC_Constant (OPT_Const con, int16 form) { int16 i; - SET s; + uint32 s; int32 hex; BOOLEAN skipLeading; switch (form) { diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index e681f43d..c9cf0ace 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 297ade25..9ecaaba2 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Configuration.h" @@ -25,7 +26,7 @@ static int16 OPM_GlobalAddressSize; export int16 OPM_AddressSize; static int16 OPM_GlobalAlignment; export int16 OPM_Alignment; -export SET OPM_GlobalOptions, OPM_Options; +export uint32 OPM_GlobalOptions, OPM_Options; export int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize, OPM_MaxSet; export int64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; @@ -52,7 +53,7 @@ export void OPM_DeleteNewSym (void); export void OPM_FPrint (int32 *fp, int64 val); export void OPM_FPrintLReal (int32 *fp, LONGREAL lr); export void OPM_FPrintReal (int32 *fp, REAL real); -export void OPM_FPrintSet (int32 *fp, SET set); +export void OPM_FPrintSet (int32 *fp, uint32 set); static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 pos); export void OPM_Get (CHAR *ch); export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); @@ -80,12 +81,12 @@ export int32 OPM_SymRInt (void); export int64 OPM_SymRInt64 (void); export void OPM_SymRLReal (LONGREAL *lr); export void OPM_SymRReal (REAL *r); -export void OPM_SymRSet (SET *s); +export void OPM_SymRSet (uint32 *s); export void OPM_SymWCh (CHAR ch); export void OPM_SymWInt (int64 i); export void OPM_SymWLReal (LONGREAL lr); export void OPM_SymWReal (REAL r); -export void OPM_SymWSet (SET s); +export void OPM_SymWSet (uint32 s); static void OPM_VerboseListSizes (void); export void OPM_Write (CHAR ch); export void OPM_WriteHex (int64 i); @@ -329,7 +330,7 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWStr((CHAR*)" -V Display compiler debugging messages.", 46); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" Size model for elementary types (default O2 on 32 bit builds, OV on 64 bits)", 79); + OPM_LogWStr((CHAR*)" Size model for elementary types (default O2)", 47); OPM_LogWLn(); OPM_LogWStr((CHAR*)" -O2 Original Oberon / Oberon-2: 8 bit SHORTINT, 16 bit INTEGER, 32 bit LONGINT and SET.", 95); OPM_LogWLn(); @@ -709,10 +710,10 @@ void OPM_err (int16 n) void OPM_FPrint (int32 *fp, int64 val) { - *fp = __ROTL((int32)((SET)*fp ^ __VAL(SET, val)), 1, 32); + *fp = __ROTL((int32)((uint32)*fp ^ __VAL(uint32, val)), 1, 32); } -void OPM_FPrintSet (int32 *fp, SET set) +void OPM_FPrintSet (int32 *fp, uint32 set) { OPM_FPrint(&*fp, (int32)set); } @@ -751,13 +752,11 @@ int32 OPM_SymRInt (void) int64 OPM_SymRInt64 (void) { int64 _o_result; - int64 k; - Files_ReadNum64(&OPM_oldSF, Files_Rider__typ, &k); - _o_result = k; + _o_result = OPM_SymRInt(); return _o_result; } -void OPM_SymRSet (SET *s) +void OPM_SymRSet (uint32 *s) { Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (int32*)&*s); } @@ -808,10 +807,10 @@ void OPM_SymWCh (CHAR ch) void OPM_SymWInt (int64 i) { - Files_WriteNum64(&OPM_newSF, Files_Rider__typ, i); + Files_WriteNum(&OPM_newSF, Files_Rider__typ, i); } -void OPM_SymWSet (SET s) +void OPM_SymWSet (uint32 s) { Files_WriteNum(&OPM_newSF, Files_Rider__typ, (int32)s); } diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index 933ef1b5..dd3c0c27 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h @@ -8,7 +8,7 @@ import CHAR OPM_Model[10]; import int16 OPM_AddressSize, OPM_Alignment; -import SET OPM_GlobalOptions, OPM_Options; +import uint32 OPM_GlobalOptions, OPM_Options; import int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize, OPM_MaxSet; import int64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; @@ -26,7 +26,7 @@ import void OPM_DeleteNewSym (void); import void OPM_FPrint (int32 *fp, int64 val); import void OPM_FPrintLReal (int32 *fp, LONGREAL lr); import void OPM_FPrintReal (int32 *fp, REAL real); -import void OPM_FPrintSet (int32 *fp, SET set); +import void OPM_FPrintSet (int32 *fp, uint32 set); import void OPM_Get (CHAR *ch); import void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); import void OPM_InitOptions (void); @@ -49,12 +49,12 @@ import int32 OPM_SymRInt (void); import int64 OPM_SymRInt64 (void); import void OPM_SymRLReal (LONGREAL *lr); import void OPM_SymRReal (REAL *r); -import void OPM_SymRSet (SET *s); +import void OPM_SymRSet (uint32 *s); import void OPM_SymWCh (CHAR ch); import void OPM_SymWInt (int64 i); import void OPM_SymWLReal (LONGREAL lr); import void OPM_SymWReal (REAL r); -import void OPM_SymWSet (SET s); +import void OPM_SymWSet (uint32 s); import void OPM_Write (CHAR ch); import void OPM_WriteHex (int64 i); import void OPM_WriteInt (int64 i); diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index c9986e20..6bfd4b38 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "OPB.h" @@ -39,7 +40,7 @@ static void OPP_Expression (OPT_Node *x); static BOOLEAN OPP_Extends (OPT_Struct x, OPT_Struct b); static void OPP_Factor (OPT_Node *x); static void OPP_FormalParameters (OPT_Object *firstPar, OPT_Struct *resTyp); -export void OPP_Module (OPT_Node *prog, SET opt); +export void OPP_Module (OPT_Node *prog, uint32 opt); static void OPP_PointerType (OPT_Struct *typ); static void OPP_ProcedureDeclaration (OPT_Node *x); static void OPP_Receiver (int8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec); @@ -1775,7 +1776,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) OPP_CheckSym(41); } -void OPP_Module (OPT_Node *prog, SET opt) +void OPP_Module (OPT_Node *prog, uint32 opt) { OPS_Name impName, aliasName; OPT_Node procdec = NIL, statseq = NIL; diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index 373d8daa..c759545a 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h @@ -9,7 +9,7 @@ -import void OPP_Module (OPT_Node *prog, SET opt); +import void OPP_Module (OPT_Node *prog, uint32 opt); import void *OPP__init(void); diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index f8ed61bf..18c3c066 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index 1f02668b..260fcd01 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index b0a12a18..98ef4a7f 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "OPM.h" @@ -19,7 +20,7 @@ typedef OPT_ConstExt ext; int64 intval; int32 intval2; - SET setval; + uint32 setval; LONGREAL realval; } OPT_ConstDesc; @@ -88,8 +89,8 @@ typedef export OPT_Object OPT_topScope; -export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; -export OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj; +export OPT_Struct OPT_undftyp, OPT_niltyp, OPT_notyp, OPT_bytetyp, OPT_cpbytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_settyp, OPT_set32typ, OPT_set64typ, OPT_realtyp, OPT_lrltyp, OPT_stringtyp, OPT_adrtyp, OPT_sysptrtyp; +export OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj, OPT_setobj; export int8 OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; @@ -137,7 +138,7 @@ static void OPT_InSign (int8 mno, OPT_Struct *res, OPT_Object *par); static void OPT_InStruct (OPT_Struct *typ); static OPT_Object OPT_InTProc (int8 mno); static OPT_Struct OPT_InTyp (int32 tag); -export void OPT_Init (OPS_Name name, SET opt); +export void OPT_Init (OPS_Name name, uint32 opt); export void OPT_InitRecno (void); static void OPT_InitStruct (OPT_Struct *typ, int8 form); export void OPT_Insert (OPS_Name name, OPT_Object *obj); @@ -159,6 +160,7 @@ static void OPT_OutObj (OPT_Object obj); static void OPT_OutSign (OPT_Struct result, OPT_Object par); static void OPT_OutStr (OPT_Struct typ); static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj); +export OPT_Struct OPT_SetType (int32 size); export OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir); export int32 OPT_SizeAlignment (int32 size); export void OPT_TypSize (OPT_Struct typ); @@ -209,6 +211,17 @@ OPT_Struct OPT_IntType (int32 size) return _o_result; } +OPT_Struct OPT_SetType (int32 size) +{ + OPT_Struct _o_result; + if (size == OPT_set32typ->size) { + _o_result = OPT_set32typ; + return _o_result; + } + _o_result = OPT_set64typ; + return _o_result; +} + OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir) { OPT_Struct _o_result; @@ -449,7 +462,7 @@ void OPT_CloseScope (void) OPT_topScope = OPT_topScope->left; } -void OPT_Init (OPS_Name name, SET opt) +void OPT_Init (OPS_Name name, uint32 opt) { OPT_topScope = OPT_universe; OPT_OpenScope(0, NIL); @@ -1171,6 +1184,9 @@ static OPT_Struct OPT_InTyp (int32 tag) if (tag == 4) { _o_result = OPT_IntType(OPM_SymRInt()); return _o_result; + } else if (tag == 7) { + _o_result = OPT_SetType(OPM_SymRInt()); + return _o_result; } else { _o_result = OPT_impCtxt.ref[__X(tag, 255)]; return _o_result; @@ -1628,7 +1644,7 @@ static void OPT_OutStr (OPT_Struct typ) OPT_Object strobj = NIL; if (typ->ref < OPT_expCtxt.ref) { OPM_SymWInt(-typ->ref); - if (typ->ref == 4) { + if (__IN(typ->ref, 0x90, 32)) { OPM_SymWInt(typ->size); } } else { @@ -1732,6 +1748,7 @@ static void OPT_OutConstant (OPT_Object obj) break; case 7: OPM_SymWSet(obj->conval->setval); + OPM_SymWInt(obj->typ->size); break; case 5: rval = obj->conval->realval; @@ -1959,28 +1976,32 @@ static void EnumPtrs(void (*P)(void*)) { P(OPT_topScope); P(OPT_undftyp); + P(OPT_niltyp); + P(OPT_notyp); P(OPT_bytetyp); + P(OPT_cpbytetyp); P(OPT_booltyp); P(OPT_chartyp); P(OPT_sinttyp); P(OPT_inttyp); P(OPT_linttyp); P(OPT_hinttyp); - P(OPT_adrtyp); P(OPT_int8typ); P(OPT_int16typ); P(OPT_int32typ); P(OPT_int64typ); + P(OPT_settyp); + P(OPT_set32typ); + P(OPT_set64typ); P(OPT_realtyp); P(OPT_lrltyp); - P(OPT_settyp); P(OPT_stringtyp); - P(OPT_niltyp); - P(OPT_notyp); + P(OPT_adrtyp); P(OPT_sysptrtyp); P(OPT_sintobj); P(OPT_intobj); P(OPT_lintobj); + P(OPT_setobj); __ENUMP(OPT_GlbMod, 64, P); P(OPT_universe); P(OPT_syslink); @@ -2056,6 +2077,8 @@ export void *OPT__init(void) OPT_EnterTyp((CHAR*)"INT16", 4, 2, &OPT_int16typ); OPT_EnterTyp((CHAR*)"INT32", 4, 4, &OPT_int32typ); OPT_EnterTyp((CHAR*)"INT64", 4, 8, &OPT_int64typ); + OPT_EnterTyp((CHAR*)"SET32", 7, 4, &OPT_set32typ); + OPT_EnterTyp((CHAR*)"SET64", 7, 8, &OPT_set64typ); OPT_EnterProc((CHAR*)"ADR", 20); OPT_EnterProc((CHAR*)"CC", 21); OPT_EnterProc((CHAR*)"LSH", 22); @@ -2073,13 +2096,14 @@ export void *OPT__init(void) OPT_topScope->right = NIL; OPT_EnterTyp((CHAR*)"BOOLEAN", 2, 1, &OPT_booltyp); OPT_EnterTyp((CHAR*)"CHAR", 3, 1, &OPT_chartyp); - OPT_EnterTyp((CHAR*)"SET", 7, -1, &OPT_settyp); OPT_EnterTyp((CHAR*)"REAL", 5, 4, &OPT_realtyp); OPT_EnterTyp((CHAR*)"LONGREAL", 6, 8, &OPT_lrltyp); OPT_EnterTyp((CHAR*)"HUGEINT", 4, 8, &OPT_hinttyp); + OPT_EnterTyp((CHAR*)"BYTE@", 4, 1, &OPT_cpbytetyp); OPT_EnterTypeAlias((CHAR*)"SHORTINT", &OPT_sintobj); OPT_EnterTypeAlias((CHAR*)"INTEGER", &OPT_intobj); OPT_EnterTypeAlias((CHAR*)"LONGINT", &OPT_lintobj); + OPT_EnterTypeAlias((CHAR*)"SET", &OPT_setobj); OPT_EnterBoolConst((CHAR*)"FALSE", 0); OPT_EnterBoolConst((CHAR*)"TRUE", 1); OPT_EnterProc((CHAR*)"HALT", 0); diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 202c8278..2bc05576 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h @@ -17,7 +17,7 @@ typedef OPT_ConstExt ext; int64 intval; int32 intval2; - SET setval; + uint32 setval; LONGREAL realval; } OPT_ConstDesc; @@ -67,8 +67,8 @@ typedef import OPT_Object OPT_topScope; -import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; -import OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj; +import OPT_Struct OPT_undftyp, OPT_niltyp, OPT_notyp, OPT_bytetyp, OPT_cpbytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_settyp, OPT_set32typ, OPT_set64typ, OPT_realtyp, OPT_lrltyp, OPT_stringtyp, OPT_adrtyp, OPT_sysptrtyp; +import OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj, OPT_setobj; import int8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; @@ -92,7 +92,7 @@ import void OPT_FindField (OPS_Name name, OPT_Struct typ, OPT_Object *res); import void OPT_FindImport (OPT_Object mod, OPT_Object *res); import void OPT_IdFPrint (OPT_Struct typ); import void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); -import void OPT_Init (OPS_Name name, SET opt); +import void OPT_Init (OPS_Name name, uint32 opt); import void OPT_InitRecno (void); import void OPT_Insert (OPS_Name name, OPT_Object *obj); import void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); @@ -104,6 +104,7 @@ import OPT_Node OPT_NewNode (int8 class); import OPT_Object OPT_NewObj (void); import OPT_Struct OPT_NewStr (int8 form, int8 comp); import void OPT_OpenScope (int8 level, OPT_Object owner); +import OPT_Struct OPT_SetType (int32 size); import OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir); import int32 OPT_SizeAlignment (int32 size); import void OPT_TypSize (OPT_Struct typ); diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 07fa214f..5171284e 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "OPC.h" @@ -187,6 +188,7 @@ void OPV_AdrAndSize (OPT_Object topScope) OPV_Traverse(topScope->right, topScope, 1); OPV_Traverse(topScope->right, topScope, 0); OPT_chartyp->strobj->linkadr = 2; + OPT_cpbytetyp->strobj->linkadr = 2; OPT_settyp->strobj->linkadr = 2; OPT_realtyp->strobj->linkadr = 2; OPT_adrtyp->strobj->linkadr = 2; @@ -194,6 +196,8 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_int16typ->strobj->linkadr = 2; OPT_int32typ->strobj->linkadr = 2; OPT_int64typ->strobj->linkadr = 2; + OPT_set32typ->strobj->linkadr = 2; + OPT_set64typ->strobj->linkadr = 2; OPT_hinttyp->strobj->linkadr = 2; OPT_lrltyp->strobj->linkadr = 2; OPT_booltyp->strobj->linkadr = 2; diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index a44fb5b5..f5e41d45 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 26dc3ce5..4d9d1fb1 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" @@ -40,7 +41,7 @@ export int64 Platform_ArgVector; static Platform_HaltProcedure Platform_HaltHandler; static int32 Platform_TimeStart; export int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; -export CHAR Platform_nl[3]; +export CHAR Platform_NL[3]; export address *Platform_FileIdentity__typ; @@ -798,7 +799,7 @@ export void *Platform__init(void) Platform_SeekSet = Platform_seekset(); Platform_SeekCur = Platform_seekcur(); Platform_SeekEnd = Platform_seekend(); - Platform_nl[0] = 0x0a; - Platform_nl[1] = 0x00; + Platform_NL[0] = 0x0a; + Platform_NL[1] = 0x00; __ENDMOD; } diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index c9b53f3c..c308ce3a 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h @@ -26,7 +26,7 @@ import CHAR Platform_CWD[256]; import int16 Platform_ArgCount; import int64 Platform_ArgVector; import int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; -import CHAR Platform_nl[3]; +import CHAR Platform_NL[3]; import address *Platform_FileIdentity__typ; diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 57e22100..d7d2994c 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index f3404dda..8c1ff819 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index bcf3cb9b..ac03bada 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index 9418692a..cc9d99a1 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index a71cf72a..9a4efb22 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Files.h" @@ -183,7 +184,7 @@ export address *Texts_Writer__typ; export address *Texts__1__typ; export void Texts_Append (Texts_Text T, Texts_Buffer B); -export void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff); +export void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, uint32 sel, Texts_FontsFont fnt, int8 col, int8 voff); static Texts_Elem Texts_CloneElem (Texts_Elem e); static Texts_Piece Texts_ClonePiece (Texts_Piece p); export void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len); @@ -565,7 +566,7 @@ void Texts_Delete (Texts_Text T, int32 beg, int32 end) } } -void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff) +void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, uint32 sel, Texts_FontsFont fnt, int8 col, int8 voff) { Texts_Run c = NIL, u = NIL, un = NIL, v = NIL, vn = NIL; int32 co, uo, ud, vo, vd; diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index 47f1e428..7f02a3aa 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h @@ -130,7 +130,7 @@ import address *Texts_Scanner__typ; import address *Texts_Writer__typ; import void Texts_Append (Texts_Text T, Texts_Buffer B); -import void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff); +import void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, uint32 sel, Texts_FontsFont fnt, int8 col, int8 voff); import void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len); import void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); import void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); diff --git a/bootstrap/unix-88/errors.c b/bootstrap/unix-88/errors.c index ba890a17..f284397b 100644 --- a/bootstrap/unix-88/errors.c +++ b/bootstrap/unix-88/errors.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" diff --git a/bootstrap/unix-88/errors.h b/bootstrap/unix-88/errors.h index d8124792..5aa2a5f6 100644 --- a/bootstrap/unix-88/errors.h +++ b/bootstrap/unix-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index 76fdc084..fe7eb545 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index bb5be954..8cdd8e01 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/vt100.c b/bootstrap/unix-88/vt100.c index c44586d2..a4bc9ec1 100644 --- a/bootstrap/unix-88/vt100.c +++ b/bootstrap/unix-88/vt100.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/unix-88/vt100.h b/bootstrap/unix-88/vt100.h index c9a01a7c..44d81f73 100644 --- a/bootstrap/unix-88/vt100.h +++ b/bootstrap/unix-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-48/Compiler.c b/bootstrap/windows-48/Compiler.c index 1b3b14f1..637fd329 100644 --- a/bootstrap/windows-48/Compiler.c +++ b/bootstrap/windows-48/Compiler.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Configuration.h" @@ -83,7 +84,6 @@ static void Compiler_PropagateElementaryTypeSizes (void) OPT_Struct adrinttyp = NIL; OPT_sysptrtyp->size = OPM_AddressSize; OPT_adrtyp->size = OPM_AddressSize; - OPT_settyp->size = OPM_SetSize; adrinttyp = OPT_IntType(OPM_AddressSize); OPT_adrtyp->strobj = adrinttyp->strobj; OPT_sinttyp = OPT_IntType(OPM_ShortintSize); @@ -92,6 +92,20 @@ static void Compiler_PropagateElementaryTypeSizes (void) OPT_sintobj->typ = OPT_sinttyp; OPT_intobj->typ = OPT_inttyp; OPT_lintobj->typ = OPT_linttyp; + switch (OPM_LongintSize) { + case 4: + OPT_settyp = OPT_set32typ; + break; + default: + OPT_settyp = OPT_set64typ; + break; + } + OPT_setobj->typ = OPT_settyp; + if (__STRCMP(OPM_Model, "C") == 0) { + OPT_cpbytetyp->strobj->name[4] = 0x00; + } else { + OPT_cpbytetyp->strobj->name[4] = '@'; + } } void Compiler_Translate (void) diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index 85c8cf89..a3240e8e 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" @@ -18,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index a365d693..4d4279da 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Console.c b/bootstrap/windows-48/Console.c index 7d63057e..d6ad8ef3 100644 --- a/bootstrap/windows-48/Console.c +++ b/bootstrap/windows-48/Console.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Platform.h" diff --git a/bootstrap/windows-48/Console.h b/bootstrap/windows-48/Console.h index 08f4e38e..6549e2cc 100644 --- a/bootstrap/windows-48/Console.h +++ b/bootstrap/windows-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index ef927317..39445fd2 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,13 +1,13 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" -#include "Configuration.h" -#include "Console.h" #include "Heap.h" +#include "Console.h" #include "Platform.h" #include "Strings.h" @@ -89,9 +89,8 @@ export void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); export void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); export void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); export void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x); -export void Files_ReadNum64 (Files_Rider *R, address *R__typ, int64 *x); export void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); -export void Files_ReadSet (Files_Rider *R, address *R__typ, SET *x); +export void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x); export void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); export void Files_Register (Files_File f); export void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res); @@ -104,13 +103,13 @@ export void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, L export void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x); export void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x); export void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x); -export void Files_WriteNum (Files_Rider *R, address *R__typ, int32 x); -export void Files_WriteNum64 (Files_Rider *R, address *R__typ, int64 x); +export void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x); export void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x); -export void Files_WriteSet (Files_Rider *R, address *R__typ, SET x); +export void Files_WriteSet (Files_Rider *R, address *R__typ, uint32 x); export void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); #define Files_IdxTrap() __HALT(-1) +#define Files_ToAdr(x) (address)x static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int16 errcode) { @@ -662,7 +661,7 @@ void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x } else { min = n; } - __MOVE(((address)buf->data) + offset, ((address)x) + xpos, min); + __MOVE((address)buf->data + Files_ToAdr(offset), (address)x + Files_ToAdr(xpos), min); offset += min; (*r).offset = offset; xpos += min; @@ -722,7 +721,7 @@ void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT } else { min = n; } - __MOVE(((address)x) + xpos, ((address)buf->data) + offset, min); + __MOVE((address)x + Files_ToAdr(xpos), (address)buf->data + Files_ToAdr(offset), min); offset += min; (*r).offset = offset; if (offset > buf->size) { @@ -862,13 +861,13 @@ void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x) *x = (((int16)b[0] + __ASHL((int16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); } -void Files_ReadSet (Files_Rider *R, address *R__typ, SET *x) +void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x) { CHAR b[4]; int32 l; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); l = (((int16)b[0] + __ASHL((int16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); - *x = (SET)l; + *x = (uint32)l; } void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x) @@ -932,13 +931,6 @@ void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x) *x = n; } -void Files_ReadNum64 (Files_Rider *R, address *R__typ, int64 *x) -{ - int32 n; - Files_ReadNum(&*R, R__typ, &n); - *x = n; -} - void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x) { Files_Write(&*R, R__typ, __VAL(CHAR, x)); @@ -962,7 +954,7 @@ void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x) Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } -void Files_WriteSet (Files_Rider *R, address *R__typ, SET x) +void Files_WriteSet (Files_Rider *R, address *R__typ, uint32 x) { CHAR b[4]; int32 i; @@ -998,16 +990,7 @@ void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len Files_WriteBytes(&*R, R__typ, (void*)x, x__len * 1, i + 1); } -void Files_WriteNum (Files_Rider *R, address *R__typ, int32 x) -{ - while (x < -64 || x > 63) { - Files_Write(&*R, R__typ, (CHAR)(__MASK(x, -128) + 128)); - x = __ASHR(x, 7); - } - Files_Write(&*R, R__typ, (CHAR)__MASK(x, -128)); -} - -void Files_WriteNum64 (Files_Rider *R, address *R__typ, int64 x) +void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x) { while (x < -64 || x > 63) { Files_Write(&*R, R__typ, (CHAR)(__MASK(x, -128) + 128)); @@ -1059,9 +1042,8 @@ __TDESC(Files_Rider, 1, 1) = {__TDFLDS("Rider", 20), {8, -8}}; export void *Files__init(void) { __DEFMOD; - __MODULE_IMPORT(Configuration); - __MODULE_IMPORT(Console); __MODULE_IMPORT(Heap); + __MODULE_IMPORT(Console); __MODULE_IMPORT(Platform); __MODULE_IMPORT(Strings); __REGMOD("Files", EnumPtrs); diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index 8d274283..1b482bb6 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h @@ -46,9 +46,8 @@ import void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); import void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); import void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); import void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x); -import void Files_ReadNum64 (Files_Rider *R, address *R__typ, int64 *x); import void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); -import void Files_ReadSet (Files_Rider *R, address *R__typ, SET *x); +import void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x); import void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); import void Files_Register (Files_File f); import void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res); @@ -60,10 +59,9 @@ import void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, L import void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x); import void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x); import void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x); -import void Files_WriteNum (Files_Rider *R, address *R__typ, int32 x); -import void Files_WriteNum64 (Files_Rider *R, address *R__typ, int64 x); +import void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x); import void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x); -import void Files_WriteSet (Files_Rider *R, address *R__typ, SET x); +import void Files_WriteSet (Files_Rider *R, address *R__typ, uint32 x); import void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); import void *Files__init(void); diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index 1f66b283..b3eea6a3 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index 9e9400e1..a7135c5b 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index f165488e..2984f32f 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index a2ceebdf..9b84521f 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index e370e621..d099cad7 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "OPM.h" @@ -55,6 +56,7 @@ export void OPB_Return (OPT_Node *x, OPT_Object proc); export void OPB_SetElem (OPT_Node *x); static void OPB_SetIntType (OPT_Node node); export void OPB_SetRange (OPT_Node *x, OPT_Node y); +static void OPB_SetSetType (OPT_Node node); export void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno); export void OPB_StPar0 (OPT_Node *par0, int16 fctno); export void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno); @@ -223,6 +225,17 @@ static void OPB_SetIntType (OPT_Node node) node->typ = OPT_IntType(OPT_IntSize(node->conval->intval)); } +static void OPB_SetSetType (OPT_Node node) +{ + int32 i32; + __GET((address)&node->conval->setval + 4, i32, int32); + if (i32 == 0) { + node->typ = OPT_set32typ; + } else { + node->typ = OPT_set64typ; + } +} + OPT_Node OPB_NewIntConst (int64 intval) { OPT_Node _o_result; @@ -364,16 +377,16 @@ void OPB_Field (OPT_Node *x, OPT_Object y) } } -static struct TypTest__57 { +static struct TypTest__58 { OPT_Node *x; OPT_Object *obj; BOOLEAN *guard; - struct TypTest__57 *lnk; -} *TypTest__57_s; + struct TypTest__58 *lnk; +} *TypTest__58_s; -static void GTT__58 (OPT_Struct t0, OPT_Struct t1); +static void GTT__59 (OPT_Struct t0, OPT_Struct t1); -static void GTT__58 (OPT_Struct t0, OPT_Struct t1) +static void GTT__59 (OPT_Struct t0, OPT_Struct t1) { OPT_Node node = NIL; OPT_Struct t = NIL; @@ -386,54 +399,54 @@ static void GTT__58 (OPT_Struct t0, OPT_Struct t1) t1 = t1->BaseTyp; } if (t1 == t0 || t0->form == 0) { - if (*TypTest__57_s->guard) { - OPB_BindNodes(5, NIL, &*TypTest__57_s->x, NIL); - (*TypTest__57_s->x)->readonly = (*TypTest__57_s->x)->left->readonly; + if (*TypTest__58_s->guard) { + OPB_BindNodes(5, NIL, &*TypTest__58_s->x, NIL); + (*TypTest__58_s->x)->readonly = (*TypTest__58_s->x)->left->readonly; } else { node = OPT_NewNode(11); node->subcl = 16; - node->left = *TypTest__57_s->x; - node->obj = *TypTest__57_s->obj; - *TypTest__57_s->x = node; + node->left = *TypTest__58_s->x; + node->obj = *TypTest__58_s->obj; + *TypTest__58_s->x = node; } } else { OPB_err(85); } } else if (t0 != t1) { OPB_err(85); - } else if (!*TypTest__57_s->guard) { - if ((*TypTest__57_s->x)->class == 5) { + } else if (!*TypTest__58_s->guard) { + if ((*TypTest__58_s->x)->class == 5) { node = OPT_NewNode(11); node->subcl = 16; - node->left = *TypTest__57_s->x; - node->obj = *TypTest__57_s->obj; - *TypTest__57_s->x = node; + node->left = *TypTest__58_s->x; + node->obj = *TypTest__58_s->obj; + *TypTest__58_s->x = node; } else { - *TypTest__57_s->x = OPB_NewBoolConst(1); + *TypTest__58_s->x = OPB_NewBoolConst(1); } } } void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) { - struct TypTest__57 _s; + struct TypTest__58 _s; _s.x = x; _s.obj = &obj; _s.guard = &guard; - _s.lnk = TypTest__57_s; - TypTest__57_s = &_s; + _s.lnk = TypTest__58_s; + TypTest__58_s = &_s; if (OPB_NotVar(*x)) { OPB_err(112); } else if ((*x)->typ->form == 11) { if (((*x)->typ->BaseTyp->comp != 4 && (*x)->typ != OPT_sysptrtyp)) { OPB_err(85); } else if (obj->typ->form == 11) { - GTT__58((*x)->typ->BaseTyp, obj->typ->BaseTyp); + GTT__59((*x)->typ->BaseTyp, obj->typ->BaseTyp); } else { OPB_err(86); } } else if (((((*x)->typ->comp == 4 && (*x)->class == 1)) && obj->typ->comp == 4)) { - GTT__58((*x)->typ, obj->typ); + GTT__59((*x)->typ, obj->typ); } else { OPB_err(87); } @@ -442,7 +455,7 @@ void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) } else { (*x)->typ = OPT_booltyp; } - TypTest__57_s = _s.lnk; + TypTest__58_s = _s.lnk; } void OPB_In (OPT_Node *x, OPT_Node y) @@ -1109,7 +1122,13 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) f = (*x)->typ->form; g = typ->form; if ((*x)->class == 7) { - if (f == 4) { + if ((((f == 7 && g == 7)) && (*x)->typ->size > typ->size)) { + OPB_SetSetType(*x); + if ((*x)->typ->size > typ->size) { + OPB_err(203); + (*x)->conval->setval = 0x0; + } + } else if (f == 4) { if (g == 4) { if ((*x)->typ->size > typ->size) { OPB_SetIntType(*x); @@ -1243,6 +1262,13 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) OPB_err(100); } break; + case 7: + if ((g == 7 && y->typ->size < z->typ->size)) { + OPB_Convert(&y, z->typ); + } else { + OPB_err(100); + } + break; case 5: if (g == 4) { OPB_Convert(&y, z->typ); @@ -1969,13 +1995,13 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) *par0 = x; } -static struct StPar1__52 { - struct StPar1__52 *lnk; -} *StPar1__52_s; +static struct StPar1__53 { + struct StPar1__53 *lnk; +} *StPar1__53_s; -static OPT_Node NewOp__53 (int8 class, int8 subcl, OPT_Node left, OPT_Node right); +static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right); -static OPT_Node NewOp__53 (int8 class, int8 subcl, OPT_Node left, OPT_Node right) +static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right) { OPT_Node _o_result; OPT_Node node = NIL; @@ -1992,9 +2018,9 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) int16 f, L; OPT_Struct typ = NIL; OPT_Node p = NIL, t = NIL; - struct StPar1__52 _s; - _s.lnk = StPar1__52_s; - StPar1__52_s = &_s; + struct StPar1__53 _s; + _s.lnk = StPar1__53_s; + StPar1__53_s = &_s; p = *par0; f = x->typ->form; switch (fctno) { @@ -2010,7 +2036,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) OPB_err(111); } } - p = NewOp__53(19, fctno, p, x); + p = NewOp__54(19, fctno, p, x); p->typ = OPT_notyp; } break; @@ -2021,7 +2047,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > (int64)OPM_MaxSet))) { OPB_err(202); } - p = NewOp__53(19, fctno, p, x); + p = NewOp__54(19, fctno, p, x); } else { OPB_err(111); } @@ -2046,7 +2072,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) p = p->left; x->conval->intval += 1; } - p = NewOp__53(12, 19, p, x); + p = NewOp__54(12, 19, p, x); p->typ = OPT_linttyp; } else { p = x; @@ -2068,7 +2094,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) t = x; x = p; p = t; - p = NewOp__53(19, 18, p, x); + p = NewOp__54(19, 18, p, x); } else { OPB_err(111); } @@ -2094,7 +2120,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) } p->obj = NIL; } else { - p = NewOp__53(12, 17, p, x); + p = NewOp__54(12, 17, p, x); p->typ = p->left->typ; } } else { @@ -2125,9 +2151,9 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) OPB_err(111); } else { if (fctno == 22) { - p = NewOp__53(12, 27, p, x); + p = NewOp__54(12, 27, p, x); } else { - p = NewOp__53(12, 28, p, x); + p = NewOp__54(12, 28, p, x); } p->typ = p->left->typ; } @@ -2144,7 +2170,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) x = p; p = t; } - p = NewOp__53(19, fctno, p, x); + p = NewOp__54(19, fctno, p, x); } else { OPB_err(111); } @@ -2154,7 +2180,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (f == 4) { - p = NewOp__53(12, 26, p, x); + p = NewOp__54(12, 26, p, x); } else { OPB_err(111); } @@ -2182,7 +2208,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (f == 4) { - p = NewOp__53(19, 30, p, x); + p = NewOp__54(19, 30, p, x); } else { OPB_err(111); } @@ -2228,7 +2254,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) break; } *par0 = p; - StPar1__52_s = _s.lnk; + StPar1__53_s = _s.lnk; } void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n) diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index 8c0fd594..07dda5db 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 4c9ae495..545deb33 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Configuration.h" @@ -193,11 +194,15 @@ void OPC_Ident (OPT_Object obj) OPM_Write('_'); } } - } else if ((mode == 5 && obj->typ->form == 4)) { + } else if ((mode == 5 && __IN(obj->typ->form, 0x90, 32))) { if (obj->typ == OPT_adrtyp) { OPM_WriteString((CHAR*)"address", 8); } else { - OPM_WriteString((CHAR*)"int", 4); + if (obj->typ->form == 4) { + OPM_WriteString((CHAR*)"int", 4); + } else { + OPM_WriteString((CHAR*)"uint", 5); + } OPM_WriteInt(__ASHL(obj->typ->size, 3)); } } else { @@ -1233,13 +1238,16 @@ void OPC_GenBdy (OPT_Node n) OPM_currFile = 1; OPC_GenHeaderMsg(); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#define INTEGER int", 20); + OPM_WriteString((CHAR*)"#define SHORTINT int", 21); + OPM_WriteInt(__ASHL(OPT_sinttyp->size, 3)); + OPM_WriteLn(); + OPM_WriteString((CHAR*)"#define INTEGER int", 21); OPM_WriteInt(__ASHL(OPT_inttyp->size, 3)); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#define LONGINT int", 20); + OPM_WriteString((CHAR*)"#define LONGINT int", 21); OPM_WriteInt(__ASHL(OPT_linttyp->size, 3)); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#define SET uint", 21); + OPM_WriteString((CHAR*)"#define SET uint", 22); OPM_WriteInt(__ASHL(OPT_settyp->size, 3)); OPM_WriteLn(); OPM_WriteLn(); @@ -1851,7 +1859,7 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim) void OPC_Constant (OPT_Const con, int16 form) { int16 i; - SET s; + uint32 s; int32 hex; BOOLEAN skipLeading; switch (form) { diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index e681f43d..c9cf0ace 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 534a5c0d..32bb978e 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Configuration.h" @@ -25,7 +26,7 @@ static int16 OPM_GlobalAddressSize; export int16 OPM_AddressSize; static int16 OPM_GlobalAlignment; export int16 OPM_Alignment; -export SET OPM_GlobalOptions, OPM_Options; +export uint32 OPM_GlobalOptions, OPM_Options; export int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize, OPM_MaxSet; export int64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; @@ -52,7 +53,7 @@ export void OPM_DeleteNewSym (void); export void OPM_FPrint (int32 *fp, int64 val); export void OPM_FPrintLReal (int32 *fp, LONGREAL lr); export void OPM_FPrintReal (int32 *fp, REAL real); -export void OPM_FPrintSet (int32 *fp, SET set); +export void OPM_FPrintSet (int32 *fp, uint32 set); static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 pos); export void OPM_Get (CHAR *ch); export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); @@ -80,12 +81,12 @@ export int32 OPM_SymRInt (void); export int64 OPM_SymRInt64 (void); export void OPM_SymRLReal (LONGREAL *lr); export void OPM_SymRReal (REAL *r); -export void OPM_SymRSet (SET *s); +export void OPM_SymRSet (uint32 *s); export void OPM_SymWCh (CHAR ch); export void OPM_SymWInt (int64 i); export void OPM_SymWLReal (LONGREAL lr); export void OPM_SymWReal (REAL r); -export void OPM_SymWSet (SET s); +export void OPM_SymWSet (uint32 s); static void OPM_VerboseListSizes (void); export void OPM_Write (CHAR ch); export void OPM_WriteHex (int64 i); @@ -329,7 +330,7 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWStr((CHAR*)" -V Display compiler debugging messages.", 46); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" Size model for elementary types (default O2 on 32 bit builds, OV on 64 bits)", 79); + OPM_LogWStr((CHAR*)" Size model for elementary types (default O2)", 47); OPM_LogWLn(); OPM_LogWStr((CHAR*)" -O2 Original Oberon / Oberon-2: 8 bit SHORTINT, 16 bit INTEGER, 32 bit LONGINT and SET.", 95); OPM_LogWLn(); @@ -709,10 +710,10 @@ void OPM_err (int16 n) void OPM_FPrint (int32 *fp, int64 val) { - *fp = __ROTL((int32)((SET)*fp ^ __VAL(SET, val)), 1, 32); + *fp = __ROTL((int32)((uint32)*fp ^ __VAL(uint32, val)), 1, 32); } -void OPM_FPrintSet (int32 *fp, SET set) +void OPM_FPrintSet (int32 *fp, uint32 set) { OPM_FPrint(&*fp, (int32)set); } @@ -751,13 +752,11 @@ int32 OPM_SymRInt (void) int64 OPM_SymRInt64 (void) { int64 _o_result; - int64 k; - Files_ReadNum64(&OPM_oldSF, Files_Rider__typ, &k); - _o_result = k; + _o_result = OPM_SymRInt(); return _o_result; } -void OPM_SymRSet (SET *s) +void OPM_SymRSet (uint32 *s) { Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (int32*)&*s); } @@ -808,10 +807,10 @@ void OPM_SymWCh (CHAR ch) void OPM_SymWInt (int64 i) { - Files_WriteNum64(&OPM_newSF, Files_Rider__typ, i); + Files_WriteNum(&OPM_newSF, Files_Rider__typ, i); } -void OPM_SymWSet (SET s) +void OPM_SymWSet (uint32 s) { Files_WriteNum(&OPM_newSF, Files_Rider__typ, (int32)s); } diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index 933ef1b5..dd3c0c27 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h @@ -8,7 +8,7 @@ import CHAR OPM_Model[10]; import int16 OPM_AddressSize, OPM_Alignment; -import SET OPM_GlobalOptions, OPM_Options; +import uint32 OPM_GlobalOptions, OPM_Options; import int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize, OPM_MaxSet; import int64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; @@ -26,7 +26,7 @@ import void OPM_DeleteNewSym (void); import void OPM_FPrint (int32 *fp, int64 val); import void OPM_FPrintLReal (int32 *fp, LONGREAL lr); import void OPM_FPrintReal (int32 *fp, REAL real); -import void OPM_FPrintSet (int32 *fp, SET set); +import void OPM_FPrintSet (int32 *fp, uint32 set); import void OPM_Get (CHAR *ch); import void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); import void OPM_InitOptions (void); @@ -49,12 +49,12 @@ import int32 OPM_SymRInt (void); import int64 OPM_SymRInt64 (void); import void OPM_SymRLReal (LONGREAL *lr); import void OPM_SymRReal (REAL *r); -import void OPM_SymRSet (SET *s); +import void OPM_SymRSet (uint32 *s); import void OPM_SymWCh (CHAR ch); import void OPM_SymWInt (int64 i); import void OPM_SymWLReal (LONGREAL lr); import void OPM_SymWReal (REAL r); -import void OPM_SymWSet (SET s); +import void OPM_SymWSet (uint32 s); import void OPM_Write (CHAR ch); import void OPM_WriteHex (int64 i); import void OPM_WriteInt (int64 i); diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index 010efab1..1eff447d 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "OPB.h" @@ -39,7 +40,7 @@ static void OPP_Expression (OPT_Node *x); static BOOLEAN OPP_Extends (OPT_Struct x, OPT_Struct b); static void OPP_Factor (OPT_Node *x); static void OPP_FormalParameters (OPT_Object *firstPar, OPT_Struct *resTyp); -export void OPP_Module (OPT_Node *prog, SET opt); +export void OPP_Module (OPT_Node *prog, uint32 opt); static void OPP_PointerType (OPT_Struct *typ); static void OPP_ProcedureDeclaration (OPT_Node *x); static void OPP_Receiver (int8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec); @@ -1775,7 +1776,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) OPP_CheckSym(41); } -void OPP_Module (OPT_Node *prog, SET opt) +void OPP_Module (OPT_Node *prog, uint32 opt) { OPS_Name impName, aliasName; OPT_Node procdec = NIL, statseq = NIL; diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index 373d8daa..c759545a 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h @@ -9,7 +9,7 @@ -import void OPP_Module (OPT_Node *prog, SET opt); +import void OPP_Module (OPT_Node *prog, uint32 opt); import void *OPP__init(void); diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index f8ed61bf..18c3c066 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index 1f02668b..260fcd01 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 3f54ed72..5bfcda58 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "OPM.h" @@ -19,7 +20,7 @@ typedef OPT_ConstExt ext; int64 intval; int32 intval2; - SET setval; + uint32 setval; LONGREAL realval; } OPT_ConstDesc; @@ -88,8 +89,8 @@ typedef export OPT_Object OPT_topScope; -export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; -export OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj; +export OPT_Struct OPT_undftyp, OPT_niltyp, OPT_notyp, OPT_bytetyp, OPT_cpbytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_settyp, OPT_set32typ, OPT_set64typ, OPT_realtyp, OPT_lrltyp, OPT_stringtyp, OPT_adrtyp, OPT_sysptrtyp; +export OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj, OPT_setobj; export int8 OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; @@ -137,7 +138,7 @@ static void OPT_InSign (int8 mno, OPT_Struct *res, OPT_Object *par); static void OPT_InStruct (OPT_Struct *typ); static OPT_Object OPT_InTProc (int8 mno); static OPT_Struct OPT_InTyp (int32 tag); -export void OPT_Init (OPS_Name name, SET opt); +export void OPT_Init (OPS_Name name, uint32 opt); export void OPT_InitRecno (void); static void OPT_InitStruct (OPT_Struct *typ, int8 form); export void OPT_Insert (OPS_Name name, OPT_Object *obj); @@ -159,6 +160,7 @@ static void OPT_OutObj (OPT_Object obj); static void OPT_OutSign (OPT_Struct result, OPT_Object par); static void OPT_OutStr (OPT_Struct typ); static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj); +export OPT_Struct OPT_SetType (int32 size); export OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir); export int32 OPT_SizeAlignment (int32 size); export void OPT_TypSize (OPT_Struct typ); @@ -209,6 +211,17 @@ OPT_Struct OPT_IntType (int32 size) return _o_result; } +OPT_Struct OPT_SetType (int32 size) +{ + OPT_Struct _o_result; + if (size == OPT_set32typ->size) { + _o_result = OPT_set32typ; + return _o_result; + } + _o_result = OPT_set64typ; + return _o_result; +} + OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir) { OPT_Struct _o_result; @@ -449,7 +462,7 @@ void OPT_CloseScope (void) OPT_topScope = OPT_topScope->left; } -void OPT_Init (OPS_Name name, SET opt) +void OPT_Init (OPS_Name name, uint32 opt) { OPT_topScope = OPT_universe; OPT_OpenScope(0, NIL); @@ -1171,6 +1184,9 @@ static OPT_Struct OPT_InTyp (int32 tag) if (tag == 4) { _o_result = OPT_IntType(OPM_SymRInt()); return _o_result; + } else if (tag == 7) { + _o_result = OPT_SetType(OPM_SymRInt()); + return _o_result; } else { _o_result = OPT_impCtxt.ref[__X(tag, 255)]; return _o_result; @@ -1628,7 +1644,7 @@ static void OPT_OutStr (OPT_Struct typ) OPT_Object strobj = NIL; if (typ->ref < OPT_expCtxt.ref) { OPM_SymWInt(-typ->ref); - if (typ->ref == 4) { + if (__IN(typ->ref, 0x90, 32)) { OPM_SymWInt(typ->size); } } else { @@ -1732,6 +1748,7 @@ static void OPT_OutConstant (OPT_Object obj) break; case 7: OPM_SymWSet(obj->conval->setval); + OPM_SymWInt(obj->typ->size); break; case 5: rval = obj->conval->realval; @@ -1959,28 +1976,32 @@ static void EnumPtrs(void (*P)(void*)) { P(OPT_topScope); P(OPT_undftyp); + P(OPT_niltyp); + P(OPT_notyp); P(OPT_bytetyp); + P(OPT_cpbytetyp); P(OPT_booltyp); P(OPT_chartyp); P(OPT_sinttyp); P(OPT_inttyp); P(OPT_linttyp); P(OPT_hinttyp); - P(OPT_adrtyp); P(OPT_int8typ); P(OPT_int16typ); P(OPT_int32typ); P(OPT_int64typ); + P(OPT_settyp); + P(OPT_set32typ); + P(OPT_set64typ); P(OPT_realtyp); P(OPT_lrltyp); - P(OPT_settyp); P(OPT_stringtyp); - P(OPT_niltyp); - P(OPT_notyp); + P(OPT_adrtyp); P(OPT_sysptrtyp); P(OPT_sintobj); P(OPT_intobj); P(OPT_lintobj); + P(OPT_setobj); __ENUMP(OPT_GlbMod, 64, P); P(OPT_universe); P(OPT_syslink); @@ -2056,6 +2077,8 @@ export void *OPT__init(void) OPT_EnterTyp((CHAR*)"INT16", 4, 2, &OPT_int16typ); OPT_EnterTyp((CHAR*)"INT32", 4, 4, &OPT_int32typ); OPT_EnterTyp((CHAR*)"INT64", 4, 8, &OPT_int64typ); + OPT_EnterTyp((CHAR*)"SET32", 7, 4, &OPT_set32typ); + OPT_EnterTyp((CHAR*)"SET64", 7, 8, &OPT_set64typ); OPT_EnterProc((CHAR*)"ADR", 20); OPT_EnterProc((CHAR*)"CC", 21); OPT_EnterProc((CHAR*)"LSH", 22); @@ -2073,13 +2096,14 @@ export void *OPT__init(void) OPT_topScope->right = NIL; OPT_EnterTyp((CHAR*)"BOOLEAN", 2, 1, &OPT_booltyp); OPT_EnterTyp((CHAR*)"CHAR", 3, 1, &OPT_chartyp); - OPT_EnterTyp((CHAR*)"SET", 7, -1, &OPT_settyp); OPT_EnterTyp((CHAR*)"REAL", 5, 4, &OPT_realtyp); OPT_EnterTyp((CHAR*)"LONGREAL", 6, 8, &OPT_lrltyp); OPT_EnterTyp((CHAR*)"HUGEINT", 4, 8, &OPT_hinttyp); + OPT_EnterTyp((CHAR*)"BYTE@", 4, 1, &OPT_cpbytetyp); OPT_EnterTypeAlias((CHAR*)"SHORTINT", &OPT_sintobj); OPT_EnterTypeAlias((CHAR*)"INTEGER", &OPT_intobj); OPT_EnterTypeAlias((CHAR*)"LONGINT", &OPT_lintobj); + OPT_EnterTypeAlias((CHAR*)"SET", &OPT_setobj); OPT_EnterBoolConst((CHAR*)"FALSE", 0); OPT_EnterBoolConst((CHAR*)"TRUE", 1); OPT_EnterProc((CHAR*)"HALT", 0); diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index 202c8278..2bc05576 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h @@ -17,7 +17,7 @@ typedef OPT_ConstExt ext; int64 intval; int32 intval2; - SET setval; + uint32 setval; LONGREAL realval; } OPT_ConstDesc; @@ -67,8 +67,8 @@ typedef import OPT_Object OPT_topScope; -import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; -import OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj; +import OPT_Struct OPT_undftyp, OPT_niltyp, OPT_notyp, OPT_bytetyp, OPT_cpbytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_settyp, OPT_set32typ, OPT_set64typ, OPT_realtyp, OPT_lrltyp, OPT_stringtyp, OPT_adrtyp, OPT_sysptrtyp; +import OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj, OPT_setobj; import int8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; @@ -92,7 +92,7 @@ import void OPT_FindField (OPS_Name name, OPT_Struct typ, OPT_Object *res); import void OPT_FindImport (OPT_Object mod, OPT_Object *res); import void OPT_IdFPrint (OPT_Struct typ); import void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); -import void OPT_Init (OPS_Name name, SET opt); +import void OPT_Init (OPS_Name name, uint32 opt); import void OPT_InitRecno (void); import void OPT_Insert (OPS_Name name, OPT_Object *obj); import void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); @@ -104,6 +104,7 @@ import OPT_Node OPT_NewNode (int8 class); import OPT_Object OPT_NewObj (void); import OPT_Struct OPT_NewStr (int8 form, int8 comp); import void OPT_OpenScope (int8 level, OPT_Object owner); +import OPT_Struct OPT_SetType (int32 size); import OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir); import int32 OPT_SizeAlignment (int32 size); import void OPT_TypSize (OPT_Struct typ); diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index ff99f665..99e7aa6a 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "OPC.h" @@ -187,6 +188,7 @@ void OPV_AdrAndSize (OPT_Object topScope) OPV_Traverse(topScope->right, topScope, 1); OPV_Traverse(topScope->right, topScope, 0); OPT_chartyp->strobj->linkadr = 2; + OPT_cpbytetyp->strobj->linkadr = 2; OPT_settyp->strobj->linkadr = 2; OPT_realtyp->strobj->linkadr = 2; OPT_adrtyp->strobj->linkadr = 2; @@ -194,6 +196,8 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_int16typ->strobj->linkadr = 2; OPT_int32typ->strobj->linkadr = 2; OPT_int64typ->strobj->linkadr = 2; + OPT_set32typ->strobj->linkadr = 2; + OPT_set64typ->strobj->linkadr = 2; OPT_hinttyp->strobj->linkadr = 2; OPT_lrltyp->strobj->linkadr = 2; OPT_booltyp->strobj->linkadr = 2; diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index a44fb5b5..f5e41d45 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 41a1da42..38a8dd6e 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index 7917d958..0d3476b4 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 57e22100..d7d2994c 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index f3404dda..8c1ff819 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index bcf3cb9b..ac03bada 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index 9418692a..cc9d99a1 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index 28f099a4..09661382 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Files.h" @@ -183,7 +184,7 @@ export address *Texts_Writer__typ; export address *Texts__1__typ; export void Texts_Append (Texts_Text T, Texts_Buffer B); -export void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff); +export void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, uint32 sel, Texts_FontsFont fnt, int8 col, int8 voff); static Texts_Elem Texts_CloneElem (Texts_Elem e); static Texts_Piece Texts_ClonePiece (Texts_Piece p); export void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len); @@ -565,7 +566,7 @@ void Texts_Delete (Texts_Text T, int32 beg, int32 end) } } -void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff) +void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, uint32 sel, Texts_FontsFont fnt, int8 col, int8 voff) { Texts_Run c = NIL, u = NIL, un = NIL, v = NIL, vn = NIL; int32 co, uo, ud, vo, vd; diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index 0afd65f7..86f8f5b7 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h @@ -130,7 +130,7 @@ import address *Texts_Scanner__typ; import address *Texts_Writer__typ; import void Texts_Append (Texts_Text T, Texts_Buffer B); -import void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff); +import void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, uint32 sel, Texts_FontsFont fnt, int8 col, int8 voff); import void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len); import void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); import void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); diff --git a/bootstrap/windows-48/errors.c b/bootstrap/windows-48/errors.c index ba890a17..f284397b 100644 --- a/bootstrap/windows-48/errors.c +++ b/bootstrap/windows-48/errors.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" diff --git a/bootstrap/windows-48/errors.h b/bootstrap/windows-48/errors.h index d8124792..5aa2a5f6 100644 --- a/bootstrap/windows-48/errors.h +++ b/bootstrap/windows-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index 76fdc084..fe7eb545 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index bb5be954..8cdd8e01 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/vt100.c b/bootstrap/windows-48/vt100.c index c44586d2..a4bc9ec1 100644 --- a/bootstrap/windows-48/vt100.c +++ b/bootstrap/windows-48/vt100.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/windows-48/vt100.h b/bootstrap/windows-48/vt100.h index c9a01a7c..44d81f73 100644 --- a/bootstrap/windows-48/vt100.h +++ b/bootstrap/windows-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-88/Compiler.c b/bootstrap/windows-88/Compiler.c index 1b3b14f1..637fd329 100644 --- a/bootstrap/windows-88/Compiler.c +++ b/bootstrap/windows-88/Compiler.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Configuration.h" @@ -83,7 +84,6 @@ static void Compiler_PropagateElementaryTypeSizes (void) OPT_Struct adrinttyp = NIL; OPT_sysptrtyp->size = OPM_AddressSize; OPT_adrtyp->size = OPM_AddressSize; - OPT_settyp->size = OPM_SetSize; adrinttyp = OPT_IntType(OPM_AddressSize); OPT_adrtyp->strobj = adrinttyp->strobj; OPT_sinttyp = OPT_IntType(OPM_ShortintSize); @@ -92,6 +92,20 @@ static void Compiler_PropagateElementaryTypeSizes (void) OPT_sintobj->typ = OPT_sinttyp; OPT_intobj->typ = OPT_inttyp; OPT_lintobj->typ = OPT_linttyp; + switch (OPM_LongintSize) { + case 4: + OPT_settyp = OPT_set32typ; + break; + default: + OPT_settyp = OPT_set64typ; + break; + } + OPT_setobj->typ = OPT_settyp; + if (__STRCMP(OPM_Model, "C") == 0) { + OPT_cpbytetyp->strobj->name[4] = 0x00; + } else { + OPT_cpbytetyp->strobj->name[4] = '@'; + } } void Compiler_Translate (void) diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index 85c8cf89..a3240e8e 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" @@ -18,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index a365d693..4d4279da 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Console.c b/bootstrap/windows-88/Console.c index 7d63057e..d6ad8ef3 100644 --- a/bootstrap/windows-88/Console.c +++ b/bootstrap/windows-88/Console.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Platform.h" diff --git a/bootstrap/windows-88/Console.h b/bootstrap/windows-88/Console.h index 08f4e38e..6549e2cc 100644 --- a/bootstrap/windows-88/Console.h +++ b/bootstrap/windows-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 72ef67df..8d9e0113 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,13 +1,13 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" -#include "Configuration.h" -#include "Console.h" #include "Heap.h" +#include "Console.h" #include "Platform.h" #include "Strings.h" @@ -89,9 +89,8 @@ export void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); export void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); export void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); export void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x); -export void Files_ReadNum64 (Files_Rider *R, address *R__typ, int64 *x); export void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); -export void Files_ReadSet (Files_Rider *R, address *R__typ, SET *x); +export void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x); export void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); export void Files_Register (Files_File f); export void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res); @@ -104,13 +103,13 @@ export void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, L export void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x); export void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x); export void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x); -export void Files_WriteNum (Files_Rider *R, address *R__typ, int32 x); -export void Files_WriteNum64 (Files_Rider *R, address *R__typ, int64 x); +export void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x); export void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x); -export void Files_WriteSet (Files_Rider *R, address *R__typ, SET x); +export void Files_WriteSet (Files_Rider *R, address *R__typ, uint32 x); export void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); #define Files_IdxTrap() __HALT(-1) +#define Files_ToAdr(x) (address)x static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int16 errcode) { @@ -662,7 +661,7 @@ void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x } else { min = n; } - __MOVE((address)buf->data + (int64)offset, (address)x + (int64)xpos, min); + __MOVE((address)buf->data + Files_ToAdr(offset), (address)x + Files_ToAdr(xpos), min); offset += min; (*r).offset = offset; xpos += min; @@ -722,7 +721,7 @@ void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT } else { min = n; } - __MOVE((address)x + (int64)xpos, (address)buf->data + (int64)offset, min); + __MOVE((address)x + Files_ToAdr(xpos), (address)buf->data + Files_ToAdr(offset), min); offset += min; (*r).offset = offset; if (offset > buf->size) { @@ -862,13 +861,13 @@ void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x) *x = (((int16)b[0] + __ASHL((int16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); } -void Files_ReadSet (Files_Rider *R, address *R__typ, SET *x) +void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x) { CHAR b[4]; int32 l; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); l = (((int16)b[0] + __ASHL((int16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); - *x = (SET)l; + *x = (uint32)l; } void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x) @@ -932,13 +931,6 @@ void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x) *x = n; } -void Files_ReadNum64 (Files_Rider *R, address *R__typ, int64 *x) -{ - int32 n; - Files_ReadNum(&*R, R__typ, &n); - *x = n; -} - void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x) { Files_Write(&*R, R__typ, __VAL(CHAR, x)); @@ -962,7 +954,7 @@ void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x) Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } -void Files_WriteSet (Files_Rider *R, address *R__typ, SET x) +void Files_WriteSet (Files_Rider *R, address *R__typ, uint32 x) { CHAR b[4]; int32 i; @@ -998,16 +990,7 @@ void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len Files_WriteBytes(&*R, R__typ, (void*)x, x__len * 1, i + 1); } -void Files_WriteNum (Files_Rider *R, address *R__typ, int32 x) -{ - while (x < -64 || x > 63) { - Files_Write(&*R, R__typ, (CHAR)(__MASK(x, -128) + 128)); - x = __ASHR(x, 7); - } - Files_Write(&*R, R__typ, (CHAR)__MASK(x, -128)); -} - -void Files_WriteNum64 (Files_Rider *R, address *R__typ, int64 x) +void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x) { while (x < -64 || x > 63) { Files_Write(&*R, R__typ, (CHAR)(__MASK(x, -128) + 128)); @@ -1059,9 +1042,8 @@ __TDESC(Files_Rider, 1, 1) = {__TDFLDS("Rider", 24), {8, -16}}; export void *Files__init(void) { __DEFMOD; - __MODULE_IMPORT(Configuration); - __MODULE_IMPORT(Console); __MODULE_IMPORT(Heap); + __MODULE_IMPORT(Console); __MODULE_IMPORT(Platform); __MODULE_IMPORT(Strings); __REGMOD("Files", EnumPtrs); diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 668d8ebf..acb178a5 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h @@ -48,9 +48,8 @@ import void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); import void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); import void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); import void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x); -import void Files_ReadNum64 (Files_Rider *R, address *R__typ, int64 *x); import void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); -import void Files_ReadSet (Files_Rider *R, address *R__typ, SET *x); +import void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x); import void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); import void Files_Register (Files_File f); import void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res); @@ -62,10 +61,9 @@ import void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, L import void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x); import void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x); import void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x); -import void Files_WriteNum (Files_Rider *R, address *R__typ, int32 x); -import void Files_WriteNum64 (Files_Rider *R, address *R__typ, int64 x); +import void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x); import void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x); -import void Files_WriteSet (Files_Rider *R, address *R__typ, SET x); +import void Files_WriteSet (Files_Rider *R, address *R__typ, uint32 x); import void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); import void *Files__init(void); diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index 71ad15a1..571a7dd2 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index 0cd62e2b..2187094a 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 0e05b5aa..e18d29cf 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index a2ceebdf..9b84521f 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index e370e621..d099cad7 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "OPM.h" @@ -55,6 +56,7 @@ export void OPB_Return (OPT_Node *x, OPT_Object proc); export void OPB_SetElem (OPT_Node *x); static void OPB_SetIntType (OPT_Node node); export void OPB_SetRange (OPT_Node *x, OPT_Node y); +static void OPB_SetSetType (OPT_Node node); export void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno); export void OPB_StPar0 (OPT_Node *par0, int16 fctno); export void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno); @@ -223,6 +225,17 @@ static void OPB_SetIntType (OPT_Node node) node->typ = OPT_IntType(OPT_IntSize(node->conval->intval)); } +static void OPB_SetSetType (OPT_Node node) +{ + int32 i32; + __GET((address)&node->conval->setval + 4, i32, int32); + if (i32 == 0) { + node->typ = OPT_set32typ; + } else { + node->typ = OPT_set64typ; + } +} + OPT_Node OPB_NewIntConst (int64 intval) { OPT_Node _o_result; @@ -364,16 +377,16 @@ void OPB_Field (OPT_Node *x, OPT_Object y) } } -static struct TypTest__57 { +static struct TypTest__58 { OPT_Node *x; OPT_Object *obj; BOOLEAN *guard; - struct TypTest__57 *lnk; -} *TypTest__57_s; + struct TypTest__58 *lnk; +} *TypTest__58_s; -static void GTT__58 (OPT_Struct t0, OPT_Struct t1); +static void GTT__59 (OPT_Struct t0, OPT_Struct t1); -static void GTT__58 (OPT_Struct t0, OPT_Struct t1) +static void GTT__59 (OPT_Struct t0, OPT_Struct t1) { OPT_Node node = NIL; OPT_Struct t = NIL; @@ -386,54 +399,54 @@ static void GTT__58 (OPT_Struct t0, OPT_Struct t1) t1 = t1->BaseTyp; } if (t1 == t0 || t0->form == 0) { - if (*TypTest__57_s->guard) { - OPB_BindNodes(5, NIL, &*TypTest__57_s->x, NIL); - (*TypTest__57_s->x)->readonly = (*TypTest__57_s->x)->left->readonly; + if (*TypTest__58_s->guard) { + OPB_BindNodes(5, NIL, &*TypTest__58_s->x, NIL); + (*TypTest__58_s->x)->readonly = (*TypTest__58_s->x)->left->readonly; } else { node = OPT_NewNode(11); node->subcl = 16; - node->left = *TypTest__57_s->x; - node->obj = *TypTest__57_s->obj; - *TypTest__57_s->x = node; + node->left = *TypTest__58_s->x; + node->obj = *TypTest__58_s->obj; + *TypTest__58_s->x = node; } } else { OPB_err(85); } } else if (t0 != t1) { OPB_err(85); - } else if (!*TypTest__57_s->guard) { - if ((*TypTest__57_s->x)->class == 5) { + } else if (!*TypTest__58_s->guard) { + if ((*TypTest__58_s->x)->class == 5) { node = OPT_NewNode(11); node->subcl = 16; - node->left = *TypTest__57_s->x; - node->obj = *TypTest__57_s->obj; - *TypTest__57_s->x = node; + node->left = *TypTest__58_s->x; + node->obj = *TypTest__58_s->obj; + *TypTest__58_s->x = node; } else { - *TypTest__57_s->x = OPB_NewBoolConst(1); + *TypTest__58_s->x = OPB_NewBoolConst(1); } } } void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) { - struct TypTest__57 _s; + struct TypTest__58 _s; _s.x = x; _s.obj = &obj; _s.guard = &guard; - _s.lnk = TypTest__57_s; - TypTest__57_s = &_s; + _s.lnk = TypTest__58_s; + TypTest__58_s = &_s; if (OPB_NotVar(*x)) { OPB_err(112); } else if ((*x)->typ->form == 11) { if (((*x)->typ->BaseTyp->comp != 4 && (*x)->typ != OPT_sysptrtyp)) { OPB_err(85); } else if (obj->typ->form == 11) { - GTT__58((*x)->typ->BaseTyp, obj->typ->BaseTyp); + GTT__59((*x)->typ->BaseTyp, obj->typ->BaseTyp); } else { OPB_err(86); } } else if (((((*x)->typ->comp == 4 && (*x)->class == 1)) && obj->typ->comp == 4)) { - GTT__58((*x)->typ, obj->typ); + GTT__59((*x)->typ, obj->typ); } else { OPB_err(87); } @@ -442,7 +455,7 @@ void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) } else { (*x)->typ = OPT_booltyp; } - TypTest__57_s = _s.lnk; + TypTest__58_s = _s.lnk; } void OPB_In (OPT_Node *x, OPT_Node y) @@ -1109,7 +1122,13 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) f = (*x)->typ->form; g = typ->form; if ((*x)->class == 7) { - if (f == 4) { + if ((((f == 7 && g == 7)) && (*x)->typ->size > typ->size)) { + OPB_SetSetType(*x); + if ((*x)->typ->size > typ->size) { + OPB_err(203); + (*x)->conval->setval = 0x0; + } + } else if (f == 4) { if (g == 4) { if ((*x)->typ->size > typ->size) { OPB_SetIntType(*x); @@ -1243,6 +1262,13 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) OPB_err(100); } break; + case 7: + if ((g == 7 && y->typ->size < z->typ->size)) { + OPB_Convert(&y, z->typ); + } else { + OPB_err(100); + } + break; case 5: if (g == 4) { OPB_Convert(&y, z->typ); @@ -1969,13 +1995,13 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) *par0 = x; } -static struct StPar1__52 { - struct StPar1__52 *lnk; -} *StPar1__52_s; +static struct StPar1__53 { + struct StPar1__53 *lnk; +} *StPar1__53_s; -static OPT_Node NewOp__53 (int8 class, int8 subcl, OPT_Node left, OPT_Node right); +static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right); -static OPT_Node NewOp__53 (int8 class, int8 subcl, OPT_Node left, OPT_Node right) +static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right) { OPT_Node _o_result; OPT_Node node = NIL; @@ -1992,9 +2018,9 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) int16 f, L; OPT_Struct typ = NIL; OPT_Node p = NIL, t = NIL; - struct StPar1__52 _s; - _s.lnk = StPar1__52_s; - StPar1__52_s = &_s; + struct StPar1__53 _s; + _s.lnk = StPar1__53_s; + StPar1__53_s = &_s; p = *par0; f = x->typ->form; switch (fctno) { @@ -2010,7 +2036,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) OPB_err(111); } } - p = NewOp__53(19, fctno, p, x); + p = NewOp__54(19, fctno, p, x); p->typ = OPT_notyp; } break; @@ -2021,7 +2047,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > (int64)OPM_MaxSet))) { OPB_err(202); } - p = NewOp__53(19, fctno, p, x); + p = NewOp__54(19, fctno, p, x); } else { OPB_err(111); } @@ -2046,7 +2072,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) p = p->left; x->conval->intval += 1; } - p = NewOp__53(12, 19, p, x); + p = NewOp__54(12, 19, p, x); p->typ = OPT_linttyp; } else { p = x; @@ -2068,7 +2094,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) t = x; x = p; p = t; - p = NewOp__53(19, 18, p, x); + p = NewOp__54(19, 18, p, x); } else { OPB_err(111); } @@ -2094,7 +2120,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) } p->obj = NIL; } else { - p = NewOp__53(12, 17, p, x); + p = NewOp__54(12, 17, p, x); p->typ = p->left->typ; } } else { @@ -2125,9 +2151,9 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) OPB_err(111); } else { if (fctno == 22) { - p = NewOp__53(12, 27, p, x); + p = NewOp__54(12, 27, p, x); } else { - p = NewOp__53(12, 28, p, x); + p = NewOp__54(12, 28, p, x); } p->typ = p->left->typ; } @@ -2144,7 +2170,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) x = p; p = t; } - p = NewOp__53(19, fctno, p, x); + p = NewOp__54(19, fctno, p, x); } else { OPB_err(111); } @@ -2154,7 +2180,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (f == 4) { - p = NewOp__53(12, 26, p, x); + p = NewOp__54(12, 26, p, x); } else { OPB_err(111); } @@ -2182,7 +2208,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (f == 4) { - p = NewOp__53(19, 30, p, x); + p = NewOp__54(19, 30, p, x); } else { OPB_err(111); } @@ -2228,7 +2254,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) break; } *par0 = p; - StPar1__52_s = _s.lnk; + StPar1__53_s = _s.lnk; } void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n) diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index 8c0fd594..07dda5db 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index 4c9ae495..545deb33 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Configuration.h" @@ -193,11 +194,15 @@ void OPC_Ident (OPT_Object obj) OPM_Write('_'); } } - } else if ((mode == 5 && obj->typ->form == 4)) { + } else if ((mode == 5 && __IN(obj->typ->form, 0x90, 32))) { if (obj->typ == OPT_adrtyp) { OPM_WriteString((CHAR*)"address", 8); } else { - OPM_WriteString((CHAR*)"int", 4); + if (obj->typ->form == 4) { + OPM_WriteString((CHAR*)"int", 4); + } else { + OPM_WriteString((CHAR*)"uint", 5); + } OPM_WriteInt(__ASHL(obj->typ->size, 3)); } } else { @@ -1233,13 +1238,16 @@ void OPC_GenBdy (OPT_Node n) OPM_currFile = 1; OPC_GenHeaderMsg(); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#define INTEGER int", 20); + OPM_WriteString((CHAR*)"#define SHORTINT int", 21); + OPM_WriteInt(__ASHL(OPT_sinttyp->size, 3)); + OPM_WriteLn(); + OPM_WriteString((CHAR*)"#define INTEGER int", 21); OPM_WriteInt(__ASHL(OPT_inttyp->size, 3)); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#define LONGINT int", 20); + OPM_WriteString((CHAR*)"#define LONGINT int", 21); OPM_WriteInt(__ASHL(OPT_linttyp->size, 3)); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#define SET uint", 21); + OPM_WriteString((CHAR*)"#define SET uint", 22); OPM_WriteInt(__ASHL(OPT_settyp->size, 3)); OPM_WriteLn(); OPM_WriteLn(); @@ -1851,7 +1859,7 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim) void OPC_Constant (OPT_Const con, int16 form) { int16 i; - SET s; + uint32 s; int32 hex; BOOLEAN skipLeading; switch (form) { diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index e681f43d..c9cf0ace 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 297ade25..9ecaaba2 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Configuration.h" @@ -25,7 +26,7 @@ static int16 OPM_GlobalAddressSize; export int16 OPM_AddressSize; static int16 OPM_GlobalAlignment; export int16 OPM_Alignment; -export SET OPM_GlobalOptions, OPM_Options; +export uint32 OPM_GlobalOptions, OPM_Options; export int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize, OPM_MaxSet; export int64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; @@ -52,7 +53,7 @@ export void OPM_DeleteNewSym (void); export void OPM_FPrint (int32 *fp, int64 val); export void OPM_FPrintLReal (int32 *fp, LONGREAL lr); export void OPM_FPrintReal (int32 *fp, REAL real); -export void OPM_FPrintSet (int32 *fp, SET set); +export void OPM_FPrintSet (int32 *fp, uint32 set); static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 pos); export void OPM_Get (CHAR *ch); export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); @@ -80,12 +81,12 @@ export int32 OPM_SymRInt (void); export int64 OPM_SymRInt64 (void); export void OPM_SymRLReal (LONGREAL *lr); export void OPM_SymRReal (REAL *r); -export void OPM_SymRSet (SET *s); +export void OPM_SymRSet (uint32 *s); export void OPM_SymWCh (CHAR ch); export void OPM_SymWInt (int64 i); export void OPM_SymWLReal (LONGREAL lr); export void OPM_SymWReal (REAL r); -export void OPM_SymWSet (SET s); +export void OPM_SymWSet (uint32 s); static void OPM_VerboseListSizes (void); export void OPM_Write (CHAR ch); export void OPM_WriteHex (int64 i); @@ -329,7 +330,7 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWStr((CHAR*)" -V Display compiler debugging messages.", 46); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" Size model for elementary types (default O2 on 32 bit builds, OV on 64 bits)", 79); + OPM_LogWStr((CHAR*)" Size model for elementary types (default O2)", 47); OPM_LogWLn(); OPM_LogWStr((CHAR*)" -O2 Original Oberon / Oberon-2: 8 bit SHORTINT, 16 bit INTEGER, 32 bit LONGINT and SET.", 95); OPM_LogWLn(); @@ -709,10 +710,10 @@ void OPM_err (int16 n) void OPM_FPrint (int32 *fp, int64 val) { - *fp = __ROTL((int32)((SET)*fp ^ __VAL(SET, val)), 1, 32); + *fp = __ROTL((int32)((uint32)*fp ^ __VAL(uint32, val)), 1, 32); } -void OPM_FPrintSet (int32 *fp, SET set) +void OPM_FPrintSet (int32 *fp, uint32 set) { OPM_FPrint(&*fp, (int32)set); } @@ -751,13 +752,11 @@ int32 OPM_SymRInt (void) int64 OPM_SymRInt64 (void) { int64 _o_result; - int64 k; - Files_ReadNum64(&OPM_oldSF, Files_Rider__typ, &k); - _o_result = k; + _o_result = OPM_SymRInt(); return _o_result; } -void OPM_SymRSet (SET *s) +void OPM_SymRSet (uint32 *s) { Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (int32*)&*s); } @@ -808,10 +807,10 @@ void OPM_SymWCh (CHAR ch) void OPM_SymWInt (int64 i) { - Files_WriteNum64(&OPM_newSF, Files_Rider__typ, i); + Files_WriteNum(&OPM_newSF, Files_Rider__typ, i); } -void OPM_SymWSet (SET s) +void OPM_SymWSet (uint32 s) { Files_WriteNum(&OPM_newSF, Files_Rider__typ, (int32)s); } diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index 933ef1b5..dd3c0c27 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h @@ -8,7 +8,7 @@ import CHAR OPM_Model[10]; import int16 OPM_AddressSize, OPM_Alignment; -import SET OPM_GlobalOptions, OPM_Options; +import uint32 OPM_GlobalOptions, OPM_Options; import int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize, OPM_MaxSet; import int64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; @@ -26,7 +26,7 @@ import void OPM_DeleteNewSym (void); import void OPM_FPrint (int32 *fp, int64 val); import void OPM_FPrintLReal (int32 *fp, LONGREAL lr); import void OPM_FPrintReal (int32 *fp, REAL real); -import void OPM_FPrintSet (int32 *fp, SET set); +import void OPM_FPrintSet (int32 *fp, uint32 set); import void OPM_Get (CHAR *ch); import void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); import void OPM_InitOptions (void); @@ -49,12 +49,12 @@ import int32 OPM_SymRInt (void); import int64 OPM_SymRInt64 (void); import void OPM_SymRLReal (LONGREAL *lr); import void OPM_SymRReal (REAL *r); -import void OPM_SymRSet (SET *s); +import void OPM_SymRSet (uint32 *s); import void OPM_SymWCh (CHAR ch); import void OPM_SymWInt (int64 i); import void OPM_SymWLReal (LONGREAL lr); import void OPM_SymWReal (REAL r); -import void OPM_SymWSet (SET s); +import void OPM_SymWSet (uint32 s); import void OPM_Write (CHAR ch); import void OPM_WriteHex (int64 i); import void OPM_WriteInt (int64 i); diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index c9986e20..6bfd4b38 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "OPB.h" @@ -39,7 +40,7 @@ static void OPP_Expression (OPT_Node *x); static BOOLEAN OPP_Extends (OPT_Struct x, OPT_Struct b); static void OPP_Factor (OPT_Node *x); static void OPP_FormalParameters (OPT_Object *firstPar, OPT_Struct *resTyp); -export void OPP_Module (OPT_Node *prog, SET opt); +export void OPP_Module (OPT_Node *prog, uint32 opt); static void OPP_PointerType (OPT_Struct *typ); static void OPP_ProcedureDeclaration (OPT_Node *x); static void OPP_Receiver (int8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec); @@ -1775,7 +1776,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) OPP_CheckSym(41); } -void OPP_Module (OPT_Node *prog, SET opt) +void OPP_Module (OPT_Node *prog, uint32 opt) { OPS_Name impName, aliasName; OPT_Node procdec = NIL, statseq = NIL; diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index 373d8daa..c759545a 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h @@ -9,7 +9,7 @@ -import void OPP_Module (OPT_Node *prog, SET opt); +import void OPP_Module (OPT_Node *prog, uint32 opt); import void *OPP__init(void); diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index f8ed61bf..18c3c066 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index 1f02668b..260fcd01 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index b0a12a18..98ef4a7f 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "OPM.h" @@ -19,7 +20,7 @@ typedef OPT_ConstExt ext; int64 intval; int32 intval2; - SET setval; + uint32 setval; LONGREAL realval; } OPT_ConstDesc; @@ -88,8 +89,8 @@ typedef export OPT_Object OPT_topScope; -export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; -export OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj; +export OPT_Struct OPT_undftyp, OPT_niltyp, OPT_notyp, OPT_bytetyp, OPT_cpbytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_settyp, OPT_set32typ, OPT_set64typ, OPT_realtyp, OPT_lrltyp, OPT_stringtyp, OPT_adrtyp, OPT_sysptrtyp; +export OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj, OPT_setobj; export int8 OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; @@ -137,7 +138,7 @@ static void OPT_InSign (int8 mno, OPT_Struct *res, OPT_Object *par); static void OPT_InStruct (OPT_Struct *typ); static OPT_Object OPT_InTProc (int8 mno); static OPT_Struct OPT_InTyp (int32 tag); -export void OPT_Init (OPS_Name name, SET opt); +export void OPT_Init (OPS_Name name, uint32 opt); export void OPT_InitRecno (void); static void OPT_InitStruct (OPT_Struct *typ, int8 form); export void OPT_Insert (OPS_Name name, OPT_Object *obj); @@ -159,6 +160,7 @@ static void OPT_OutObj (OPT_Object obj); static void OPT_OutSign (OPT_Struct result, OPT_Object par); static void OPT_OutStr (OPT_Struct typ); static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj); +export OPT_Struct OPT_SetType (int32 size); export OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir); export int32 OPT_SizeAlignment (int32 size); export void OPT_TypSize (OPT_Struct typ); @@ -209,6 +211,17 @@ OPT_Struct OPT_IntType (int32 size) return _o_result; } +OPT_Struct OPT_SetType (int32 size) +{ + OPT_Struct _o_result; + if (size == OPT_set32typ->size) { + _o_result = OPT_set32typ; + return _o_result; + } + _o_result = OPT_set64typ; + return _o_result; +} + OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir) { OPT_Struct _o_result; @@ -449,7 +462,7 @@ void OPT_CloseScope (void) OPT_topScope = OPT_topScope->left; } -void OPT_Init (OPS_Name name, SET opt) +void OPT_Init (OPS_Name name, uint32 opt) { OPT_topScope = OPT_universe; OPT_OpenScope(0, NIL); @@ -1171,6 +1184,9 @@ static OPT_Struct OPT_InTyp (int32 tag) if (tag == 4) { _o_result = OPT_IntType(OPM_SymRInt()); return _o_result; + } else if (tag == 7) { + _o_result = OPT_SetType(OPM_SymRInt()); + return _o_result; } else { _o_result = OPT_impCtxt.ref[__X(tag, 255)]; return _o_result; @@ -1628,7 +1644,7 @@ static void OPT_OutStr (OPT_Struct typ) OPT_Object strobj = NIL; if (typ->ref < OPT_expCtxt.ref) { OPM_SymWInt(-typ->ref); - if (typ->ref == 4) { + if (__IN(typ->ref, 0x90, 32)) { OPM_SymWInt(typ->size); } } else { @@ -1732,6 +1748,7 @@ static void OPT_OutConstant (OPT_Object obj) break; case 7: OPM_SymWSet(obj->conval->setval); + OPM_SymWInt(obj->typ->size); break; case 5: rval = obj->conval->realval; @@ -1959,28 +1976,32 @@ static void EnumPtrs(void (*P)(void*)) { P(OPT_topScope); P(OPT_undftyp); + P(OPT_niltyp); + P(OPT_notyp); P(OPT_bytetyp); + P(OPT_cpbytetyp); P(OPT_booltyp); P(OPT_chartyp); P(OPT_sinttyp); P(OPT_inttyp); P(OPT_linttyp); P(OPT_hinttyp); - P(OPT_adrtyp); P(OPT_int8typ); P(OPT_int16typ); P(OPT_int32typ); P(OPT_int64typ); + P(OPT_settyp); + P(OPT_set32typ); + P(OPT_set64typ); P(OPT_realtyp); P(OPT_lrltyp); - P(OPT_settyp); P(OPT_stringtyp); - P(OPT_niltyp); - P(OPT_notyp); + P(OPT_adrtyp); P(OPT_sysptrtyp); P(OPT_sintobj); P(OPT_intobj); P(OPT_lintobj); + P(OPT_setobj); __ENUMP(OPT_GlbMod, 64, P); P(OPT_universe); P(OPT_syslink); @@ -2056,6 +2077,8 @@ export void *OPT__init(void) OPT_EnterTyp((CHAR*)"INT16", 4, 2, &OPT_int16typ); OPT_EnterTyp((CHAR*)"INT32", 4, 4, &OPT_int32typ); OPT_EnterTyp((CHAR*)"INT64", 4, 8, &OPT_int64typ); + OPT_EnterTyp((CHAR*)"SET32", 7, 4, &OPT_set32typ); + OPT_EnterTyp((CHAR*)"SET64", 7, 8, &OPT_set64typ); OPT_EnterProc((CHAR*)"ADR", 20); OPT_EnterProc((CHAR*)"CC", 21); OPT_EnterProc((CHAR*)"LSH", 22); @@ -2073,13 +2096,14 @@ export void *OPT__init(void) OPT_topScope->right = NIL; OPT_EnterTyp((CHAR*)"BOOLEAN", 2, 1, &OPT_booltyp); OPT_EnterTyp((CHAR*)"CHAR", 3, 1, &OPT_chartyp); - OPT_EnterTyp((CHAR*)"SET", 7, -1, &OPT_settyp); OPT_EnterTyp((CHAR*)"REAL", 5, 4, &OPT_realtyp); OPT_EnterTyp((CHAR*)"LONGREAL", 6, 8, &OPT_lrltyp); OPT_EnterTyp((CHAR*)"HUGEINT", 4, 8, &OPT_hinttyp); + OPT_EnterTyp((CHAR*)"BYTE@", 4, 1, &OPT_cpbytetyp); OPT_EnterTypeAlias((CHAR*)"SHORTINT", &OPT_sintobj); OPT_EnterTypeAlias((CHAR*)"INTEGER", &OPT_intobj); OPT_EnterTypeAlias((CHAR*)"LONGINT", &OPT_lintobj); + OPT_EnterTypeAlias((CHAR*)"SET", &OPT_setobj); OPT_EnterBoolConst((CHAR*)"FALSE", 0); OPT_EnterBoolConst((CHAR*)"TRUE", 1); OPT_EnterProc((CHAR*)"HALT", 0); diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 202c8278..2bc05576 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h @@ -17,7 +17,7 @@ typedef OPT_ConstExt ext; int64 intval; int32 intval2; - SET setval; + uint32 setval; LONGREAL realval; } OPT_ConstDesc; @@ -67,8 +67,8 @@ typedef import OPT_Object OPT_topScope; -import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; -import OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj; +import OPT_Struct OPT_undftyp, OPT_niltyp, OPT_notyp, OPT_bytetyp, OPT_cpbytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_settyp, OPT_set32typ, OPT_set64typ, OPT_realtyp, OPT_lrltyp, OPT_stringtyp, OPT_adrtyp, OPT_sysptrtyp; +import OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj, OPT_setobj; import int8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; @@ -92,7 +92,7 @@ import void OPT_FindField (OPS_Name name, OPT_Struct typ, OPT_Object *res); import void OPT_FindImport (OPT_Object mod, OPT_Object *res); import void OPT_IdFPrint (OPT_Struct typ); import void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); -import void OPT_Init (OPS_Name name, SET opt); +import void OPT_Init (OPS_Name name, uint32 opt); import void OPT_InitRecno (void); import void OPT_Insert (OPS_Name name, OPT_Object *obj); import void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); @@ -104,6 +104,7 @@ import OPT_Node OPT_NewNode (int8 class); import OPT_Object OPT_NewObj (void); import OPT_Struct OPT_NewStr (int8 form, int8 comp); import void OPT_OpenScope (int8 level, OPT_Object owner); +import OPT_Struct OPT_SetType (int32 size); import OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir); import int32 OPT_SizeAlignment (int32 size); import void OPT_TypSize (OPT_Struct typ); diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 07fa214f..5171284e 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "OPC.h" @@ -187,6 +188,7 @@ void OPV_AdrAndSize (OPT_Object topScope) OPV_Traverse(topScope->right, topScope, 1); OPV_Traverse(topScope->right, topScope, 0); OPT_chartyp->strobj->linkadr = 2; + OPT_cpbytetyp->strobj->linkadr = 2; OPT_settyp->strobj->linkadr = 2; OPT_realtyp->strobj->linkadr = 2; OPT_adrtyp->strobj->linkadr = 2; @@ -194,6 +196,8 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_int16typ->strobj->linkadr = 2; OPT_int32typ->strobj->linkadr = 2; OPT_int64typ->strobj->linkadr = 2; + OPT_set32typ->strobj->linkadr = 2; + OPT_set64typ->strobj->linkadr = 2; OPT_hinttyp->strobj->linkadr = 2; OPT_lrltyp->strobj->linkadr = 2; OPT_booltyp->strobj->linkadr = 2; diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index a44fb5b5..f5e41d45 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 95dd629a..5a5ee14a 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index b99b4747..b8d8c5e7 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 57e22100..d7d2994c 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index f3404dda..8c1ff819 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index bcf3cb9b..ac03bada 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index 9418692a..cc9d99a1 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index a71cf72a..9a4efb22 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Files.h" @@ -183,7 +184,7 @@ export address *Texts_Writer__typ; export address *Texts__1__typ; export void Texts_Append (Texts_Text T, Texts_Buffer B); -export void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff); +export void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, uint32 sel, Texts_FontsFont fnt, int8 col, int8 voff); static Texts_Elem Texts_CloneElem (Texts_Elem e); static Texts_Piece Texts_ClonePiece (Texts_Piece p); export void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len); @@ -565,7 +566,7 @@ void Texts_Delete (Texts_Text T, int32 beg, int32 end) } } -void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff) +void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, uint32 sel, Texts_FontsFont fnt, int8 col, int8 voff) { Texts_Run c = NIL, u = NIL, un = NIL, v = NIL, vn = NIL; int32 co, uo, ud, vo, vd; diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index 47f1e428..7f02a3aa 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h @@ -130,7 +130,7 @@ import address *Texts_Scanner__typ; import address *Texts_Writer__typ; import void Texts_Append (Texts_Text T, Texts_Buffer B); -import void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff); +import void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, uint32 sel, Texts_FontsFont fnt, int8 col, int8 voff); import void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len); import void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); import void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); diff --git a/bootstrap/windows-88/errors.c b/bootstrap/windows-88/errors.c index ba890a17..f284397b 100644 --- a/bootstrap/windows-88/errors.c +++ b/bootstrap/windows-88/errors.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" diff --git a/bootstrap/windows-88/errors.h b/bootstrap/windows-88/errors.h index d8124792..5aa2a5f6 100644 --- a/bootstrap/windows-88/errors.h +++ b/bootstrap/windows-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index 76fdc084..fe7eb545 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index bb5be954..8cdd8e01 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/vt100.c b/bootstrap/windows-88/vt100.c index c44586d2..a4bc9ec1 100644 --- a/bootstrap/windows-88/vt100.c +++ b/bootstrap/windows-88/vt100.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/windows-88/vt100.h b/bootstrap/windows-88/vt100.h index c9a01a7c..44d81f73 100644 --- a/bootstrap/windows-88/vt100.h +++ b/bootstrap/windows-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/src/compiler/OPB.Mod b/src/compiler/OPB.Mod index 547f2521..b29f6b49 100644 --- a/src/compiler/OPB.Mod +++ b/src/compiler/OPB.Mod @@ -107,6 +107,12 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) BEGIN node.typ := OPT.IntType(OPT.IntSize(node.conval.intval)) END SetIntType; + PROCEDURE SetSetType(node: OPT.Node); + VAR i32: SYSTEM.INT32; + BEGIN SYSTEM.GET(SYSTEM.ADR(node.conval.setval)+4, i32); (* See if upper 32 bits are zero *) + IF i32 = 0 THEN node.typ := OPT.set32typ ELSE node.typ := OPT.set64typ END + END SetSetType; + PROCEDURE NewIntConst*(intval: SYSTEM.INT64): OPT.Node; VAR x: OPT.Node; BEGIN @@ -593,7 +599,10 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) VAR node: OPT.Node; f, g: INTEGER; k: SYSTEM.INT64; r: LONGREAL; BEGIN f := x^.typ^.form; g := typ^.form; (* f: old form, g: new form *) IF x^.class = OPT.Nconst THEN - IF f = OPT.Int THEN + IF (f = OPT.Set) & (g = OPT.Set) & (x.typ.size > typ.size) THEN + SetSetType(x); + IF x.typ.size > typ.size THEN err(203); x^.conval^.setval := {} END + ELSIF f = OPT.Int THEN IF g = OPT.Int THEN IF x.typ.size > typ.size THEN SetIntType(x); IF x.typ.size > typ.size THEN err(203); x^.conval^.intval := 1 END @@ -663,6 +672,9 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) ELSIF g IN {OPT.Int} + OPT.realSet THEN Convert(z, y.typ) ELSE err(100) END + |OPT.Set: IF (g = OPT.Set) & (y.typ.size < z.typ.size) THEN Convert(y, z.typ) + ELSE err(100) + END |OPT.Real: IF g = OPT.Int THEN Convert(y, z^.typ) ELSIF g IN OPT.realSet THEN Convert(z, y^.typ) ELSE err(100) diff --git a/src/compiler/OPM.Mod b/src/compiler/OPM.Mod index c0f59250..3dd56c16 100644 --- a/src/compiler/OPM.Mod +++ b/src/compiler/OPM.Mod @@ -268,7 +268,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) LogWStr(" -f Disable vt100 control characters in status output."); LogWLn; LogWStr(" -V Display compiler debugging messages."); LogWLn; LogWLn; - LogWStr(" Size model for elementary types (default O2 on 32 bit builds, OV on 64 bits)"); LogWLn; + LogWStr(" Size model for elementary types (default O2)"); LogWLn; LogWStr(" -O2 Original Oberon / Oberon-2: 8 bit SHORTINT, 16 bit INTEGER, 32 bit LONGINT and SET."); LogWLn; LogWStr(" -OC Component Pascal: 16 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET."); LogWLn; LogWStr(" -OV Alternate large model: 8 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET."); LogWLn; @@ -597,10 +597,22 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) BEGIN Files.ReadNum(oldSF, k); RETURN k END SymRInt; + (* todo PROCEDURE SymRInt64*(): SYSTEM.INT64; VAR k: SYSTEM.INT64; - BEGIN Files.ReadNum64(oldSF, k); RETURN k + BEGIN Files.ReadNum(oldSF, k); RETURN k END SymRInt64; + *) + + PROCEDURE SymRInt64*(): SYSTEM.INT64; + BEGIN RETURN SymRInt() + END SymRInt64; + + (* todo + PROCEDURE SymRSet*(VAR s: SYSTEM.SET64); + BEGIN Files.ReadNum(oldSF, SYSTEM.VAL(SYSTEM.INT64, s)) + END SymRSet; + *) PROCEDURE SymRSet*(VAR s: SET); BEGIN Files.ReadNum(oldSF, SYSTEM.VAL(LONGINT, s)) @@ -644,9 +656,15 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) END SymWCh; PROCEDURE SymWInt*(i: SYSTEM.INT64); - BEGIN Files.WriteNum64(newSF, i) + BEGIN Files.WriteNum(newSF, i) END SymWInt; + (* todo + PROCEDURE SymWSet*(s: SYSTEM.SET64); + BEGIN Files.WriteNum(newSF, SYSTEM.VAL(SYSTEM.INT64, s)) + END SymWSet; + *) + PROCEDURE SymWSet*(s: SET); BEGIN Files.WriteNum(newSF, SYSTEM.VAL(LONGINT, s)) END SymWSet; diff --git a/src/compiler/OPT.Mod b/src/compiler/OPT.Mod index ac134c9c..e55c7d3c 100644 --- a/src/compiler/OPT.Mod +++ b/src/compiler/OPT.Mod @@ -15,6 +15,9 @@ TYPE ext*: ConstExt; (* string or code for code proc *) intval*: SYSTEM.INT64; (* constant value or adr, proc par size, text position or least case label *) intval2*: LONGINT; (* string length, proc var size or larger case label *) + (* todo + setval*: SYSTEM.SET64; (* constant value, procedure body present or "ELSE" present in case *) + *) setval*: SET; (* constant value, procedure body present or "ELSE" present in case *) realval*: LONGREAL (* real or longreal constant value *) END; diff --git a/src/runtime/Files.Mod b/src/runtime/Files.Mod index 46f16c85..73d527cf 100644 --- a/src/runtime/Files.Mod +++ b/src/runtime/Files.Mod @@ -58,8 +58,8 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files res*: LONGINT; eof*: BOOLEAN; buf: Buffer; - org: LONGINT; - offset: LONGINT + org: LONGINT; (* File offset of block containing current position *) + offset: LONGINT (* Current position offset within block at org. *) END; @@ -654,6 +654,7 @@ Especially Length would become fairly complex. UNTIL b END ReadLine; + (* PROCEDURE ReadNum* (VAR R: Rider; VAR x: LONGINT); VAR s: SHORTINT; ch: CHAR; n: LONGINT; BEGIN s := 0; n := 0; Read(R, ch); @@ -661,18 +662,16 @@ Especially Length would become fairly complex. INC(n, ASH(ORD(ch) MOD 64 - ORD(ch) DIV 64 * 64, s) ); x := n END ReadNum; - - PROCEDURE ReadNum64* (VAR R: Rider; VAR x: SYSTEM.INT64); - (* todo. use proper code when INC/ASH properly support INT64 on 32 bit platforms - VAR s: SHORTINT; ch: CHAR; n: SYSTEM.INT64; - BEGIN s := 0; n := 0; Read(R, ch); - WHILE ORD(ch) >= 128 DO INC(n, ASH(ORD(ch) - 128, s) ); INC(s, 7); Read(R, ch) END; - INC(n, ASH(ORD(ch) MOD 64 - ORD(ch) DIV 64 * 64, s) ); - x := n *) - VAR n: LONGINT; - BEGIN ReadNum(R, n); x := n - END ReadNum64; + + PROCEDURE ReadNum*(VAR R: Rider; VAR x: ARRAY OF SYSTEM.BYTE); + VAR s, b: SYSTEM.INT8; q: SYSTEM.INT64; + BEGIN s := 0; q := 0; Read(R, b); + WHILE b >= 128 DO INC(q, ASH(b-128, s)); INC(s, 7); Read(R, b) END; + INC(q, ASH(b MOD 64 - b DIV 64 * 64, s)); + ASSERT(LEN(x) <= 8); + SYSTEM.MOVE(SYSTEM.ADR(q), SYSTEM.ADR(x), LEN(x)) (* Assumes little endian representation of q and x. *) + END ReadNum; PROCEDURE WriteBool* (VAR R: Rider; x: BOOLEAN); BEGIN Write(R, SYSTEM.VAL(CHAR, x)) @@ -715,18 +714,12 @@ Especially Length would become fairly complex. WriteBytes(R, x, i+1) END WriteString; - PROCEDURE WriteNum* (VAR R: Rider; x: LONGINT); + PROCEDURE WriteNum* (VAR R: Rider; x: SYSTEM.INT64); BEGIN WHILE (x < - 64) OR (x > 63) DO Write(R, CHR(x MOD 128 + 128)); x := x DIV 128 END; Write(R, CHR(x MOD 128)) END WriteNum; - PROCEDURE WriteNum64* (VAR R: Rider; x: SYSTEM.INT64); - BEGIN - WHILE (x < - 64) OR (x > 63) DO Write(R, CHR(x MOD 128 + 128)); x := x DIV 128 END; - Write(R, CHR(x MOD 128)) - END WriteNum64; - PROCEDURE GetName*(f: File; VAR name: ARRAY OF CHAR); BEGIN COPY (f.workName, name); diff --git a/src/runtime/LowReal.Mod b/src/runtime/LowReal.Mod index 98f2a8a9..e5a8f8a6 100644 --- a/src/runtime/LowReal.Mod +++ b/src/runtime/LowReal.Mod @@ -23,7 +23,7 @@ MODULE LowReal; *) -IMPORT S := SYSTEM, Reals; +IMPORT SYSTEM; (* @@ -99,13 +99,13 @@ CONST ZERO = 0.0; expOffset = expoMax; - hiBit = 22; - expBit = hiBit+1; - nMask = {0..hiBit,31}; (* number mask *) - expMask = {expBit..30}; (* exponent mask *) + (*hiBit = 22;*) + (*expBit = hiBit+1;*) + nMask = {0..22,31}; (* number mask *) + expMask = {23..30}; (* exponent mask *) TYPE - Modes*= SET; + Modes* = SET; VAR (*small* : REAL; tmp: REAL;*) (* this was a test to get small as a variable at runtime. obviously, compile time preferred; -- noch *) @@ -131,15 +131,24 @@ PROCEDURE exponent*(x: REAL): INTEGER; that lies between `expoMin' and `expoMax'. An exception shall occur and may be raised if `x' is equal to 0.0. *) + VAR w: SYSTEM.INT16; BEGIN (* NOTE: x=0.0 should raise exception *) - IF x = ZERO THEN RETURN 0 - ELSE RETURN Reals.Expo(x) - expOffset - END + IF x = ZERO THEN RETURN 0 END; + + RETURN SYSTEM.VAL(INTEGER, SYSTEM.LSH((SYSTEM.VAL(SYSTEM.SET32, x) * expMask), -23)); + + + SYSTEM.GET(SYSTEM.ADR(x)+2, w); (* Load most significant word *) + RETURN ((w DIV 128) MOD 256) - expOffset END exponent; -PROCEDURE SetExponent(VAR x: REAL; ex: INTEGER); -BEGIN Reals.SetExpo(x, ex + expOffset) +PROCEDURE SetExponent(VAR x: REAL; ex: SYSTEM.INT32); + VAR s: SYSTEM.SET32; +BEGIN + ex := SYSTEM.LSH(ex + expOffset, 23); + s := SYSTEM.VAL(SYSTEM.SET32, s) * nMask + SYSTEM.VAL(SYSTEM.SET32, ex) * expMask; + SYSTEM.PUT(SYSTEM.ADR(x), s) END SetExponent; PROCEDURE exponent10*(x: REAL): INTEGER; @@ -170,20 +179,20 @@ BEGIN IF x=ZERO THEN RETURN ZERO ELSE (* Set top 7 bits of exponent to 0111111 *) - S.GET(S.ADR(x)+3, c); + SYSTEM.GET(SYSTEM.ADR(x)+3, c); c := CHR(((ORD(c) DIV 128) * 128) + 63); (* Set X0111111 (X unchanged) *) - S.PUT(S.ADR(x)+3, c); + SYSTEM.PUT(SYSTEM.ADR(x)+3, c); (* Set bottom bit of exponent to 0 *) - S.GET(S.ADR(x)+2, c); + SYSTEM.GET(SYSTEM.ADR(x)+2, c); c := CHR(ORD(c) MOD 128); (* Set 0XXXXXXX (X unchanged) *) - S.PUT(S.ADR(x)+2, c); + SYSTEM.PUT(SYSTEM.ADR(x)+2, c); RETURN x * 2.0; END (* CONST eZero={(hiBit+2)..29}; BEGIN IF x=ZERO THEN RETURN ZERO - ELSE RETURN S.VAL(REAL,(S.VAL(SET,x)*nMask)+eZero)*2.0 (* set the mantissa's exponent to zero *) + ELSE RETURN SYSTEM.VAL(REAL,(SYSTEM.VAL(SET,x)*nMask)+eZero)*2.0 (* set the mantissa's exponent to zero *) END *) END fraction; @@ -191,20 +200,20 @@ END fraction; PROCEDURE IsInfinity * (real: REAL) : BOOLEAN; VAR c0, c1, c2, c3: CHAR; BEGIN - S.GET(S.ADR(real)+0, c3); - S.GET(S.ADR(real)+1, c2); - S.GET(S.ADR(real)+2, c1); - S.GET(S.ADR(real)+3, c0); + SYSTEM.GET(SYSTEM.ADR(real)+0, c3); + SYSTEM.GET(SYSTEM.ADR(real)+1, c2); + SYSTEM.GET(SYSTEM.ADR(real)+2, c1); + SYSTEM.GET(SYSTEM.ADR(real)+3, c0); RETURN (ORD(c0) MOD 128 = 127) & (ORD(c1) = 128) & (ORD(c2) = 0) & (ORD(c3) = 0) END IsInfinity; PROCEDURE IsNaN * (real: REAL) : BOOLEAN; VAR c0, c1, c2, c3: CHAR; BEGIN - S.GET(S.ADR(real)+0, c3); - S.GET(S.ADR(real)+1, c2); - S.GET(S.ADR(real)+2, c1); - S.GET(S.ADR(real)+3, c0); + SYSTEM.GET(SYSTEM.ADR(real)+0, c3); + SYSTEM.GET(SYSTEM.ADR(real)+1, c2); + SYSTEM.GET(SYSTEM.ADR(real)+2, c1); + SYSTEM.GET(SYSTEM.ADR(real)+3, c0); RETURN (ORD(c0) MOD 128 = 127) & (ORD(c1) DIV 128 = 1) & ((ORD(c1) MOD 128 # 0) OR (ORD(c2) # 0) OR (ORD(c3) # 0)) @@ -235,8 +244,8 @@ BEGIN END; SetExponent(x, SHORT(exp)); (* SetExponent replaces these 2 lines: - lexp := S.VAL(SET, S.LSH(exp + expOffset, expBit)); (* shifted exponent bits *) - RETURN S.VAL(REAL, (S.VAL(SET, x) * nMask) + lexp) (* insert new exponent *) + lexp := SYSTEM.VAL(SET, SYSTEM.LSH(exp + expOffset, expBit)); (* shifted exponent bits *) + RETURN SYSTEM.VAL(REAL, (SYSTEM.VAL(SET, x) * nMask) + lexp) (* insert new exponent *) *) END scale; @@ -280,7 +289,7 @@ BEGIN loBit := (hiBit+1) - exponent(x); IF loBit <= 0 THEN RETURN x (* no fractional part *) ELSIF loBit <= hiBit+1 THEN - RETURN S.VAL(REAL,S.VAL(SET,x)*{loBit..31}) (* integer part is extracted *) + RETURN SYSTEM.VAL(REAL,SYSTEM.VAL(SET,x)*{loBit..31}) (* integer part is extracted *) ELSE RETURN ZERO (* no whole part *) END END intpart; @@ -305,7 +314,7 @@ BEGIN loBit:=places-n; IF n<=0 THEN RETURN ZERO (* exception should be raised *) ELSIF loBit<=0 THEN RETURN x (* nothing was truncated *) ELSE mask:={loBit..31}; (* truncation bit mask *) - RETURN S.VAL(REAL,S.VAL(SET,x)*mask) + RETURN SYSTEM.VAL(REAL,SYSTEM.VAL(SET,x)*mask) END END trunc; @@ -320,8 +329,8 @@ PROCEDURE round*(x: REAL; n: INTEGER): REAL; BEGIN loBit:=places-n; IF n<=0 THEN RETURN ZERO (* exception should be raised *) ELSIF loBit<=0 THEN RETURN x (* nothing was rounded *) - ELSE mask:={loBit..31}; num:=S.VAL(SET,x); (* truncation bit mask and number as SET *) - x:=S.VAL(REAL,num*mask); (* truncated result *) + ELSE mask:={loBit..31}; num:=SYSTEM.VAL(SET,x); (* truncation bit mask and number as SET *) + x:=SYSTEM.VAL(REAL,num*mask); (* truncated result *) IF loBit-1 IN num THEN (* check if result should be rounded *) r:=scale(ONE,exponent(x)-n+1); (* rounding fraction *) IF 31 IN num THEN RETURN x-r (* negative rounding toward -infinity *) diff --git a/src/runtime/Math.Mod b/src/runtime/Math.Mod index c2a648c9..392534bd 100644 --- a/src/runtime/Math.Mod +++ b/src/runtime/Math.Mod @@ -573,6 +573,10 @@ BEGIN t:=ABS(x); RETURN arcsinh(x/sqrt(ONE-x*x)) END arctanh; +PROCEDURE ToREAL(h: HUGEINT): REAL; +BEGIN RETURN SYSTEM.VAL(REAL, h) +END ToREAL; + BEGIN (* determine some fundamental constants used by hyperbolic trig functions *) em:=l.ulp(ONE); @@ -582,31 +586,31 @@ BEGIN t:=l.pred(ONE)/sqrt(em); TanhMax:=ln(t+sqrt(t*t+ONE)); (* initialize some tables for the power() function a1[i]=2**((1-i)/16) *) - a1[1] :=ONE; - a1[2] :=S.VAL(REAL, 3F75257DH); - a1[3] :=S.VAL(REAL, 3F6AC0C7H); - a1[4] :=S.VAL(REAL, 3F60CCDFH); - a1[5] :=S.VAL(REAL, 3F5744FDH); - a1[6] :=S.VAL(REAL, 3F4E248CH); - a1[7] :=S.VAL(REAL, 3F45672AH); - a1[8] :=S.VAL(REAL, 3F3D08A4H); - a1[9] :=S.VAL(REAL, 3F3504F3H); - a1[10]:=S.VAL(REAL, 3F2D583FH); - a1[11]:=S.VAL(REAL, 3F25FED7H); - a1[12]:=S.VAL(REAL, 3F1EF532H); - a1[13]:=S.VAL(REAL, 3F1837F0H); - a1[14]:=S.VAL(REAL, 3F11C3D3H); - a1[15]:=S.VAL(REAL, 3F0B95C2H); - a1[16]:=S.VAL(REAL, 3F05AAC3H); - a1[17]:=HALF; + a1[1] := ONE; + a1[2] := ToREAL(3F75257DH); + a1[3] := ToREAL(3F6AC0C7H); + a1[4] := ToREAL(3F60CCDFH); + a1[5] := ToREAL(3F5744FDH); + a1[6] := ToREAL(3F4E248CH); + a1[7] := ToREAL(3F45672AH); + a1[8] := ToREAL(3F3D08A4H); + a1[9] := ToREAL(3F3504F3H); + a1[10] := ToREAL(3F2D583FH); + a1[11] := ToREAL(3F25FED7H); + a1[12] := ToREAL(3F1EF532H); + a1[13] := ToREAL(3F1837F0H); + a1[14] := ToREAL(3F11C3D3H); + a1[15] := ToREAL(3F0B95C2H); + a1[16] := ToREAL(3F05AAC3H); + a1[17] := HALF; (* a2[i]=2**[(1-2i)/16] - a1[2i]; delta resolution *) - a2[1]:=S.VAL(REAL, 31A92436H); - a2[2]:=S.VAL(REAL, 336C2A95H); - a2[3]:=S.VAL(REAL, 31A8FC24H); - a2[4]:=S.VAL(REAL, 331F580CH); - a2[5]:=S.VAL(REAL, 336A42A1H); - a2[6]:=S.VAL(REAL, 32C12342H); - a2[7]:=S.VAL(REAL, 32E75624H); - a2[8]:=S.VAL(REAL, 32CF9890H) + a2[1] := ToREAL(31A92436H); + a2[2] := ToREAL(336C2A95H); + a2[3] := ToREAL(31A8FC24H); + a2[4] := ToREAL(331F580CH); + a2[5] := ToREAL(336A42A1H); + a2[6] := ToREAL(32C12342H); + a2[7] := ToREAL(32E75624H); + a2[8] := ToREAL(32CF9890H) END oocRealMath. diff --git a/src/system/Files.Mod b/src/system/Files.Mod index 76732ebc..04495ccb 100644 --- a/src/system/Files.Mod +++ b/src/system/Files.Mod @@ -1,6 +1,6 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files *) - IMPORT SYSTEM, Platform, Heap, Strings, Configuration, Console; + IMPORT SYSTEM, Platform, Heap, Strings, Out := Console; (* standard data type I/O @@ -58,8 +58,8 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files res*: LONGINT; eof*: BOOLEAN; buf: Buffer; - org: LONGINT; - offset: LONGINT + org: LONGINT; (* File offset of block containing current position *) + offset: LONGINT (* Current position offset within block at org. *) END; @@ -73,18 +73,19 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files PROCEDURE -IdxTrap "__HALT(-1)"; + PROCEDURE -ToAdr(x: SYSTEM.INT64): SYSTEM.ADDRESS "(address)x"; PROCEDURE^ Finalize(o: SYSTEM.PTR); PROCEDURE Err(s: ARRAY OF CHAR; f: File; errcode: Platform.ErrorCode); BEGIN - Console.Ln; Console.String("-- "); Console.String(s); Console.String(": "); + Out.Ln; Out.String("-- "); Out.String(s); Out.String(": "); IF f # NIL THEN - IF f.registerName # "" THEN Console.String(f.registerName) ELSE Console.String(f.workName) END; - IF f.fd # 0 THEN Console.String("f.fd = "); Console.Int(f.fd,1) END + IF f.registerName # "" THEN Out.String(f.registerName) ELSE Out.String(f.workName) END; + IF f.fd # 0 THEN Out.String("f.fd = "); Out.Int(f.fd,1) END END; - IF errcode # 0 THEN Console.String(" errcode = "); Console.Int(errcode, 1) END; - Console.Ln; + IF errcode # 0 THEN Out.String(" errcode = "); Out.Int(errcode, 1) END; + Out.Ln; HALT(99) END Err; @@ -124,11 +125,11 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files err: ARRAY 32 OF CHAR; BEGIN (* - Console.String("Files.Create fd = "); Console.Int(f.fd,1); - Console.String(", registerName = "); Console.String(f.registerName); - Console.String(", workName = "); Console.String(f.workName); - Console.String(", state = "); Console.Int(f.state,1); - Console.Ln; + Out.String("Files.Create fd = "); Out.Int(f.fd,1); + Out.String(", registerName = "); Out.String(f.registerName); + Out.String(", workName = "); Out.String(f.workName); + Out.String(", state = "); Out.Int(f.state,1); + Out.Ln; *) IF f.fd = noDesc THEN IF f.state = create THEN @@ -164,17 +165,17 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files (* identity: Platform.FileIdentity; *) BEGIN (* - Console.String("Files.Flush buf.f.registername = "); Console.String(buf.f.registerName); - Console.String(", buf.f.fd = "); Console.Int(buf.f.fd,1); - Console.String(", buffer at $"); Console.Hex(SYSTEM.ADR(buf.data)); - Console.String(", size "); Console.Int(buf.size,1); Console.Ln; + Out.String("Files.Flush buf.f.registername = "); Out.String(buf.f.registerName); + Out.String(", buf.f.fd = "); Out.Int(buf.f.fd,1); + Out.String(", buffer at $"); Out.Hex(SYSTEM.ADR(buf.data)); + Out.String(", size "); Out.Int(buf.size,1); Out.Ln; *) IF buf.chg THEN f := buf.f; Create(f); IF buf.org # f.pos THEN error := Platform.Seek(f.fd, buf.org, Platform.SeekSet); (* - Console.String("Seeking to "); Console.Int(buf.org,1); - Console.String(", error code "); Console.Int(error,1); Console.Ln; + Out.String("Seeking to "); Out.Int(buf.org,1); + Out.String(", error code "); Out.Int(error,1); Out.Ln; *) END; error := Platform.Write(f.fd, SYSTEM.ADR(buf.data), buf.size); @@ -295,7 +296,7 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files error: Platform.ErrorCode; identity: Platform.FileIdentity; BEGIN - (* Console.String("Files.Old "); Console.String(name); Console.Ln; *) + (* Out.String("Files.Old "); Out.String(name); Out.Ln; *) IF name # "" THEN IF HasDir(name) THEN dir := ""; COPY(name, path) ELSE pos := 0; ScanPath(pos, dir); MakeFileName(dir, name, path); ScanPath(pos, dir) @@ -307,11 +308,11 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files error := Platform.OldRO(path, fd); done := error = 0; END; IF ~done & ~Platform.Absent(error) THEN - Console.String("Warning: Files.Old "); Console.String(name); - Console.String(" error = "); Console.Int(error, 0); Console.Ln; + Out.String("Warning: Files.Old "); Out.String(name); + Out.String(" error = "); Out.Int(error, 0); Out.Ln; END; IF done THEN - (* Console.String(" fd = "); Console.Int(fd,1); Console.Ln; *) + (* Out.String(" fd = "); Out.Int(fd,1); Out.Ln; *) error := Platform.Identify(fd, identity); f := CacheEntry(identity); IF f # NIL THEN @@ -365,11 +366,11 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files BEGIN IF f # NIL THEN (* - Console.String("Files.Set rider on fd = "); Console.Int(f.fd,1); - Console.String(", registerName = "); Console.String(f.registerName); - Console.String(", workName = "); Console.String(f.workName); - Console.String(", state = "); Console.Int(f.state,1); - Console.Ln; + Out.String("Files.Set rider on fd = "); Out.Int(f.fd,1); + Out.String(", registerName = "); Out.String(f.registerName); + Out.String(", workName = "); Out.String(f.workName); + Out.String(", state = "); Out.Int(f.state,1); + Out.Ln; *) IF pos > f.len THEN pos := f.len ELSIF pos < 0 THEN pos := 0 END; offset := pos MOD bufsize; org := pos - offset; i := 0; @@ -427,7 +428,7 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files restInBuf := buf.size - offset; IF restInBuf = 0 THEN r.res := n; r.eof := TRUE; RETURN ELSIF n > restInBuf THEN min := restInBuf ELSE min := n END; - SYSTEM.MOVE(SYSTEM.ADR(buf.data) + offset, SYSTEM.ADR(x) + xpos, min); + SYSTEM.MOVE(SYSTEM.ADR(buf.data) + ToAdr(offset), SYSTEM.ADR(x) + ToAdr(xpos), min); INC(offset, min); r.offset := offset; INC(xpos, min); DEC(n, min) END; r.res := 0; r.eof := FALSE @@ -465,7 +466,7 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files END; restInBuf := bufsize - offset; IF n > restInBuf THEN min := restInBuf ELSE min := n END; - SYSTEM.MOVE(SYSTEM.ADR(x) + xpos, SYSTEM.ADR(buf.data) + offset, min); + SYSTEM.MOVE(SYSTEM.ADR(x) + ToAdr(xpos), SYSTEM.ADR(buf.data) + ToAdr(offset), min); INC(offset, min); r.offset := offset; IF offset > buf.size THEN INC(buf.f.len, offset - buf.size); buf.size := offset END; INC(xpos, min); DEC(n, min); buf.chg := TRUE @@ -518,8 +519,8 @@ Especially Length would become fairly complex. buf: ARRAY 4096 OF CHAR; BEGIN (* - Console.String("Files.Rename old = "); Console.String(old); - Console.String(", new = "); Console.String(new); Console.Ln; + Out.String("Files.Rename old = "); Out.String(old); + Out.String(", new = "); Out.String(new); Out.Ln; *) error := Platform.IdentifyByName(old, oldidentity); IF error = 0 THEN @@ -528,7 +529,7 @@ Especially Length would become fairly complex. Delete(new, error); (* work around stale nfs handles *) END; error := Platform.Rename(old, new); - (* Console.String("Platform.Rename error code "); Console.Int(error,1); Console.Ln; *) + (* Out.String("Platform.Rename error code "); Out.Int(error,1); Out.Ln; *) IF ~Platform.DifferentFilesystems(error) THEN res := error; RETURN ELSE @@ -564,18 +565,18 @@ Especially Length would become fairly complex. VAR idx, errcode: INTEGER; f1: File; file: ARRAY 104 OF CHAR; BEGIN (* - Console.String("Files.Register f.registerName = "); Console.String(f.registerName); - Console.String(", fd = "); Console.Int(f.fd,1); Console.Ln; + Out.String("Files.Register f.registerName = "); Out.String(f.registerName); + Out.String(", fd = "); Out.Int(f.fd,1); Out.Ln; *) IF (f.state = create) & (f.registerName # "") THEN f.state := close (* shortcut renaming *) END; Close(f); IF f.registerName # "" THEN Rename(f.workName, f.registerName, errcode); (* - Console.String("Renamed (for register) f.fd = "); Console.Int(f.fd,1); - Console.String(" from workname "); Console.String(f.workName); - Console.String(" to registerName "); Console.String(f.registerName); - Console.String(" errorcode = "); Console.Int(errcode,1); Console.Ln; + Out.String("Renamed (for register) f.fd = "); Out.Int(f.fd,1); + Out.String(" from workname "); Out.String(f.workName); + Out.String(" to registerName "); Out.String(f.registerName); + Out.String(" errorcode = "); Out.Int(errcode,1); Out.Ln; *) IF errcode # 0 THEN COPY(f.registerName, file); HALT(99) END; f.workName := f.registerName; f.registerName := ""; f.tempFile := FALSE @@ -653,6 +654,17 @@ Especially Length would become fairly complex. UNTIL b END ReadLine; + (* todo + PROCEDURE ReadNum*(VAR R: Rider; VAR x: ARRAY OF SYSTEM.BYTE); + VAR s, b: SYSTEM.INT8; q: SYSTEM.INT64; + BEGIN s := 0; q := 0; Read(R, b); + WHILE b >= 128 DO INC(q, ASH(b-128, s)); INC(s, 7); Read(R, b) END; + INC(q, ASH(b MOD 64 - b DIV 64 * 64, s)); + ASSERT(LEN(x) <= 8); + SYSTEM.MOVE(SYSTEM.ADR(q), SYSTEM.ADR(x), LEN(x)) (* Assumes little endian representation of q and x. *) + END ReadNum; + *) + PROCEDURE ReadNum* (VAR R: Rider; VAR x: LONGINT); VAR s: SHORTINT; ch: CHAR; n: LONGINT; BEGIN s := 0; n := 0; Read(R, ch); @@ -661,18 +673,6 @@ Especially Length would become fairly complex. x := n END ReadNum; - PROCEDURE ReadNum64* (VAR R: Rider; VAR x: SYSTEM.INT64); - (* todo. use proper code when INC/ASH properly support INT64 on 32 bit platforms - VAR s: SHORTINT; ch: CHAR; n: SYSTEM.INT64; - BEGIN s := 0; n := 0; Read(R, ch); - WHILE ORD(ch) >= 128 DO INC(n, ASH(ORD(ch) - 128, s) ); INC(s, 7); Read(R, ch) END; - INC(n, ASH(ORD(ch) MOD 64 - ORD(ch) DIV 64 * 64, s) ); - x := n - *) - VAR n: LONGINT; - BEGIN ReadNum(R, n); x := n - END ReadNum64; - PROCEDURE WriteBool* (VAR R: Rider; x: BOOLEAN); BEGIN Write(R, SYSTEM.VAL(CHAR, x)) END WriteBool; @@ -714,18 +714,12 @@ Especially Length would become fairly complex. WriteBytes(R, x, i+1) END WriteString; - PROCEDURE WriteNum* (VAR R: Rider; x: LONGINT); + PROCEDURE WriteNum* (VAR R: Rider; x: SYSTEM.INT64); BEGIN WHILE (x < - 64) OR (x > 63) DO Write(R, CHR(x MOD 128 + 128)); x := x DIV 128 END; Write(R, CHR(x MOD 128)) END WriteNum; - PROCEDURE WriteNum64* (VAR R: Rider; x: SYSTEM.INT64); - BEGIN - WHILE (x < - 64) OR (x > 63) DO Write(R, CHR(x MOD 128 + 128)); x := x DIV 128 END; - Write(R, CHR(x MOD 128)) - END WriteNum64; - PROCEDURE GetName*(f: File; VAR name: ARRAY OF CHAR); BEGIN COPY (f.workName, name); @@ -736,9 +730,9 @@ Especially Length would become fairly complex. BEGIN f := SYSTEM.VAL(File, o); (* - Console.String("Files.Finalize f.fd = "); Console.Int(f.fd,1); - Console.String(", f.registername = "); Console.String(f.registerName); - Console.String(", f.workName = "); Console.String(f.workName); Console.Ln; + Out.String("Files.Finalize f.fd = "); Out.Int(f.fd,1); + Out.String(", f.registername = "); Out.String(f.registerName); + Out.String(", f.workName = "); Out.String(f.workName); Out.Ln; *) IF f.fd >= 0 THEN CloseOSFile(f); From 3dc5049d5a637f9aa83a1d23a35a602820815deb Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 30 Sep 2016 17:19:26 +0100 Subject: [PATCH 262/580] Stepping toward generalised ReadNum. --- bootstrap/unix-44/Files.c | 18 ++++++++++++++++++ bootstrap/unix-44/Files.h | 1 + bootstrap/unix-44/OPM.c | 10 +++++++++- bootstrap/unix-44/OPM.h | 1 + bootstrap/unix-48/Files.c | 18 ++++++++++++++++++ bootstrap/unix-48/Files.h | 1 + bootstrap/unix-48/OPM.c | 10 +++++++++- bootstrap/unix-48/OPM.h | 1 + bootstrap/unix-88/Files.c | 18 ++++++++++++++++++ bootstrap/unix-88/Files.h | 1 + bootstrap/unix-88/OPM.c | 10 +++++++++- bootstrap/unix-88/OPM.h | 1 + bootstrap/windows-48/Files.c | 18 ++++++++++++++++++ bootstrap/windows-48/Files.h | 1 + bootstrap/windows-48/OPM.c | 10 +++++++++- bootstrap/windows-48/OPM.h | 1 + bootstrap/windows-88/Files.c | 18 ++++++++++++++++++ bootstrap/windows-88/Files.h | 1 + bootstrap/windows-88/OPM.c | 10 +++++++++- bootstrap/windows-88/OPM.h | 1 + src/compiler/OPM.Mod | 18 ++++++------------ src/runtime/Files.Mod | 10 ---------- src/system/Files.Mod | 8 ++++---- src/tools/make/oberon.mk | 2 +- 24 files changed, 156 insertions(+), 32 deletions(-) diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index b1a7e280..81252466 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -89,6 +89,7 @@ export void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); export void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); export void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); export void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x); +export void Files_ReadNum64 (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len); export void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); export void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x); export void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); @@ -914,6 +915,23 @@ void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) } while (!b); } +void Files_ReadNum64 (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len) +{ + int8 s, b; + int64 q; + s = 0; + q = 0; + Files_Read(&*R, R__typ, (void*)&b); + while ((int16)b >= 128) { + q += (int64)__ASH(((int16)b - 128), s); + s += 7; + Files_Read(&*R, R__typ, (void*)&b); + } + q += (int64)__ASH((__MASK(b, -64) - __ASHL(__ASHR(b, 6), 6)), s); + __ASSERT(x__len <= 8, 0); + __MOVE((address)&q, (address)x, x__len); +} + void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x) { int8 s; diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index fd146132..af64d06f 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -46,6 +46,7 @@ import void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); import void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); import void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); import void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x); +import void Files_ReadNum64 (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len); import void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); import void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x); import void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 32bb978e..7e770a33 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -82,6 +82,7 @@ export int64 OPM_SymRInt64 (void); export void OPM_SymRLReal (LONGREAL *lr); export void OPM_SymRReal (REAL *r); export void OPM_SymRSet (uint32 *s); +export void OPM_SymRSet64 (uint64 *s); export void OPM_SymWCh (CHAR ch); export void OPM_SymWInt (int64 i); export void OPM_SymWLReal (LONGREAL lr); @@ -752,10 +753,17 @@ int32 OPM_SymRInt (void) int64 OPM_SymRInt64 (void) { int64 _o_result; - _o_result = OPM_SymRInt(); + int64 k; + Files_ReadNum64(&OPM_oldSF, Files_Rider__typ, (void*)&k, 8); + _o_result = k; return _o_result; } +void OPM_SymRSet64 (uint64 *s) +{ + Files_ReadNum64(&OPM_oldSF, Files_Rider__typ, (void*)&*s, 8); +} + void OPM_SymRSet (uint32 *s) { Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (int32*)&*s); diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index dd3c0c27..12db4754 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -50,6 +50,7 @@ import int64 OPM_SymRInt64 (void); import void OPM_SymRLReal (LONGREAL *lr); import void OPM_SymRReal (REAL *r); import void OPM_SymRSet (uint32 *s); +import void OPM_SymRSet64 (uint64 *s); import void OPM_SymWCh (CHAR ch); import void OPM_SymWInt (int64 i); import void OPM_SymWLReal (LONGREAL lr); diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index b1a7e280..81252466 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -89,6 +89,7 @@ export void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); export void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); export void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); export void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x); +export void Files_ReadNum64 (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len); export void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); export void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x); export void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); @@ -914,6 +915,23 @@ void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) } while (!b); } +void Files_ReadNum64 (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len) +{ + int8 s, b; + int64 q; + s = 0; + q = 0; + Files_Read(&*R, R__typ, (void*)&b); + while ((int16)b >= 128) { + q += (int64)__ASH(((int16)b - 128), s); + s += 7; + Files_Read(&*R, R__typ, (void*)&b); + } + q += (int64)__ASH((__MASK(b, -64) - __ASHL(__ASHR(b, 6), 6)), s); + __ASSERT(x__len <= 8, 0); + __MOVE((address)&q, (address)x, x__len); +} + void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x) { int8 s; diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index fd146132..af64d06f 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -46,6 +46,7 @@ import void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); import void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); import void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); import void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x); +import void Files_ReadNum64 (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len); import void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); import void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x); import void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 32bb978e..7e770a33 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -82,6 +82,7 @@ export int64 OPM_SymRInt64 (void); export void OPM_SymRLReal (LONGREAL *lr); export void OPM_SymRReal (REAL *r); export void OPM_SymRSet (uint32 *s); +export void OPM_SymRSet64 (uint64 *s); export void OPM_SymWCh (CHAR ch); export void OPM_SymWInt (int64 i); export void OPM_SymWLReal (LONGREAL lr); @@ -752,10 +753,17 @@ int32 OPM_SymRInt (void) int64 OPM_SymRInt64 (void) { int64 _o_result; - _o_result = OPM_SymRInt(); + int64 k; + Files_ReadNum64(&OPM_oldSF, Files_Rider__typ, (void*)&k, 8); + _o_result = k; return _o_result; } +void OPM_SymRSet64 (uint64 *s) +{ + Files_ReadNum64(&OPM_oldSF, Files_Rider__typ, (void*)&*s, 8); +} + void OPM_SymRSet (uint32 *s) { Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (int32*)&*s); diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index dd3c0c27..12db4754 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -50,6 +50,7 @@ import int64 OPM_SymRInt64 (void); import void OPM_SymRLReal (LONGREAL *lr); import void OPM_SymRReal (REAL *r); import void OPM_SymRSet (uint32 *s); +import void OPM_SymRSet64 (uint64 *s); import void OPM_SymWCh (CHAR ch); import void OPM_SymWInt (int64 i); import void OPM_SymWLReal (LONGREAL lr); diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 8e446a1c..75dee180 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -89,6 +89,7 @@ export void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); export void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); export void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); export void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x); +export void Files_ReadNum64 (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len); export void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); export void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x); export void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); @@ -914,6 +915,23 @@ void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) } while (!b); } +void Files_ReadNum64 (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len) +{ + int8 s, b; + int64 q; + s = 0; + q = 0; + Files_Read(&*R, R__typ, (void*)&b); + while ((int16)b >= 128) { + q += (int64)__ASH(((int16)b - 128), s); + s += 7; + Files_Read(&*R, R__typ, (void*)&b); + } + q += (int64)__ASH((__MASK(b, -64) - __ASHL(__ASHR(b, 6), 6)), s); + __ASSERT(x__len <= 8, 0); + __MOVE((address)&q, (address)x, x__len); +} + void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x) { int8 s; diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index edb43852..0ba00834 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -48,6 +48,7 @@ import void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); import void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); import void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); import void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x); +import void Files_ReadNum64 (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len); import void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); import void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x); import void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 9ecaaba2..deeaaa1d 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -82,6 +82,7 @@ export int64 OPM_SymRInt64 (void); export void OPM_SymRLReal (LONGREAL *lr); export void OPM_SymRReal (REAL *r); export void OPM_SymRSet (uint32 *s); +export void OPM_SymRSet64 (uint64 *s); export void OPM_SymWCh (CHAR ch); export void OPM_SymWInt (int64 i); export void OPM_SymWLReal (LONGREAL lr); @@ -752,10 +753,17 @@ int32 OPM_SymRInt (void) int64 OPM_SymRInt64 (void) { int64 _o_result; - _o_result = OPM_SymRInt(); + int64 k; + Files_ReadNum64(&OPM_oldSF, Files_Rider__typ, (void*)&k, 8); + _o_result = k; return _o_result; } +void OPM_SymRSet64 (uint64 *s) +{ + Files_ReadNum64(&OPM_oldSF, Files_Rider__typ, (void*)&*s, 8); +} + void OPM_SymRSet (uint32 *s) { Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (int32*)&*s); diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index dd3c0c27..12db4754 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -50,6 +50,7 @@ import int64 OPM_SymRInt64 (void); import void OPM_SymRLReal (LONGREAL *lr); import void OPM_SymRReal (REAL *r); import void OPM_SymRSet (uint32 *s); +import void OPM_SymRSet64 (uint64 *s); import void OPM_SymWCh (CHAR ch); import void OPM_SymWInt (int64 i); import void OPM_SymWLReal (LONGREAL lr); diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 39445fd2..003173fa 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -89,6 +89,7 @@ export void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); export void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); export void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); export void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x); +export void Files_ReadNum64 (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len); export void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); export void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x); export void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); @@ -914,6 +915,23 @@ void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) } while (!b); } +void Files_ReadNum64 (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len) +{ + int8 s, b; + int64 q; + s = 0; + q = 0; + Files_Read(&*R, R__typ, (void*)&b); + while ((int16)b >= 128) { + q += (int64)__ASH(((int16)b - 128), s); + s += 7; + Files_Read(&*R, R__typ, (void*)&b); + } + q += (int64)__ASH((__MASK(b, -64) - __ASHL(__ASHR(b, 6), 6)), s); + __ASSERT(x__len <= 8, 0); + __MOVE((address)&q, (address)x, x__len); +} + void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x) { int8 s; diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index 1b482bb6..12fa2cfa 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -46,6 +46,7 @@ import void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); import void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); import void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); import void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x); +import void Files_ReadNum64 (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len); import void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); import void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x); import void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 32bb978e..7e770a33 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -82,6 +82,7 @@ export int64 OPM_SymRInt64 (void); export void OPM_SymRLReal (LONGREAL *lr); export void OPM_SymRReal (REAL *r); export void OPM_SymRSet (uint32 *s); +export void OPM_SymRSet64 (uint64 *s); export void OPM_SymWCh (CHAR ch); export void OPM_SymWInt (int64 i); export void OPM_SymWLReal (LONGREAL lr); @@ -752,10 +753,17 @@ int32 OPM_SymRInt (void) int64 OPM_SymRInt64 (void) { int64 _o_result; - _o_result = OPM_SymRInt(); + int64 k; + Files_ReadNum64(&OPM_oldSF, Files_Rider__typ, (void*)&k, 8); + _o_result = k; return _o_result; } +void OPM_SymRSet64 (uint64 *s) +{ + Files_ReadNum64(&OPM_oldSF, Files_Rider__typ, (void*)&*s, 8); +} + void OPM_SymRSet (uint32 *s) { Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (int32*)&*s); diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index dd3c0c27..12db4754 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -50,6 +50,7 @@ import int64 OPM_SymRInt64 (void); import void OPM_SymRLReal (LONGREAL *lr); import void OPM_SymRReal (REAL *r); import void OPM_SymRSet (uint32 *s); +import void OPM_SymRSet64 (uint64 *s); import void OPM_SymWCh (CHAR ch); import void OPM_SymWInt (int64 i); import void OPM_SymWLReal (LONGREAL lr); diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 8d9e0113..36fc4d53 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -89,6 +89,7 @@ export void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); export void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); export void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); export void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x); +export void Files_ReadNum64 (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len); export void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); export void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x); export void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); @@ -914,6 +915,23 @@ void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) } while (!b); } +void Files_ReadNum64 (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len) +{ + int8 s, b; + int64 q; + s = 0; + q = 0; + Files_Read(&*R, R__typ, (void*)&b); + while ((int16)b >= 128) { + q += (int64)__ASH(((int16)b - 128), s); + s += 7; + Files_Read(&*R, R__typ, (void*)&b); + } + q += (int64)__ASH((__MASK(b, -64) - __ASHL(__ASHR(b, 6), 6)), s); + __ASSERT(x__len <= 8, 0); + __MOVE((address)&q, (address)x, x__len); +} + void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x) { int8 s; diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index acb178a5..35d709e7 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -48,6 +48,7 @@ import void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); import void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); import void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); import void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x); +import void Files_ReadNum64 (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len); import void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); import void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x); import void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 9ecaaba2..deeaaa1d 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -82,6 +82,7 @@ export int64 OPM_SymRInt64 (void); export void OPM_SymRLReal (LONGREAL *lr); export void OPM_SymRReal (REAL *r); export void OPM_SymRSet (uint32 *s); +export void OPM_SymRSet64 (uint64 *s); export void OPM_SymWCh (CHAR ch); export void OPM_SymWInt (int64 i); export void OPM_SymWLReal (LONGREAL lr); @@ -752,10 +753,17 @@ int32 OPM_SymRInt (void) int64 OPM_SymRInt64 (void) { int64 _o_result; - _o_result = OPM_SymRInt(); + int64 k; + Files_ReadNum64(&OPM_oldSF, Files_Rider__typ, (void*)&k, 8); + _o_result = k; return _o_result; } +void OPM_SymRSet64 (uint64 *s) +{ + Files_ReadNum64(&OPM_oldSF, Files_Rider__typ, (void*)&*s, 8); +} + void OPM_SymRSet (uint32 *s) { Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (int32*)&*s); diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index dd3c0c27..12db4754 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -50,6 +50,7 @@ import int64 OPM_SymRInt64 (void); import void OPM_SymRLReal (LONGREAL *lr); import void OPM_SymRReal (REAL *r); import void OPM_SymRSet (uint32 *s); +import void OPM_SymRSet64 (uint64 *s); import void OPM_SymWCh (CHAR ch); import void OPM_SymWInt (int64 i); import void OPM_SymWLReal (LONGREAL lr); diff --git a/src/compiler/OPM.Mod b/src/compiler/OPM.Mod index 3dd56c16..6db573f6 100644 --- a/src/compiler/OPM.Mod +++ b/src/compiler/OPM.Mod @@ -592,27 +592,21 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) BEGIN Files.Read(oldSF, ch) END SymRCh; + (* todo - combine RInt64 and RInt *) PROCEDURE SymRInt*(): LONGINT; VAR k: LONGINT; BEGIN Files.ReadNum(oldSF, k); RETURN k END SymRInt; - (* todo PROCEDURE SymRInt64*(): SYSTEM.INT64; VAR k: SYSTEM.INT64; - BEGIN Files.ReadNum(oldSF, k); RETURN k - END SymRInt64; - *) - - PROCEDURE SymRInt64*(): SYSTEM.INT64; - BEGIN RETURN SymRInt() + BEGIN Files.ReadNum64(oldSF, k); RETURN k END SymRInt64; - (* todo - PROCEDURE SymRSet*(VAR s: SYSTEM.SET64); - BEGIN Files.ReadNum(oldSF, SYSTEM.VAL(SYSTEM.INT64, s)) - END SymRSet; - *) + (* todo - combine RSet64 and RSet *) + PROCEDURE SymRSet64*(VAR s: SYSTEM.SET64); + BEGIN Files.ReadNum64(oldSF, s) + END SymRSet64; PROCEDURE SymRSet*(VAR s: SET); BEGIN Files.ReadNum(oldSF, SYSTEM.VAL(LONGINT, s)) diff --git a/src/runtime/Files.Mod b/src/runtime/Files.Mod index 73d527cf..893abf1f 100644 --- a/src/runtime/Files.Mod +++ b/src/runtime/Files.Mod @@ -654,16 +654,6 @@ Especially Length would become fairly complex. UNTIL b END ReadLine; - (* - PROCEDURE ReadNum* (VAR R: Rider; VAR x: LONGINT); - VAR s: SHORTINT; ch: CHAR; n: LONGINT; - BEGIN s := 0; n := 0; Read(R, ch); - WHILE ORD(ch) >= 128 DO INC(n, ASH(ORD(ch) - 128, s) ); INC(s, 7); Read(R, ch) END; - INC(n, ASH(ORD(ch) MOD 64 - ORD(ch) DIV 64 * 64, s) ); - x := n - END ReadNum; - *) - PROCEDURE ReadNum*(VAR R: Rider; VAR x: ARRAY OF SYSTEM.BYTE); VAR s, b: SYSTEM.INT8; q: SYSTEM.INT64; BEGIN s := 0; q := 0; Read(R, b); diff --git a/src/system/Files.Mod b/src/system/Files.Mod index 04495ccb..94ef014a 100644 --- a/src/system/Files.Mod +++ b/src/system/Files.Mod @@ -654,16 +654,16 @@ Especially Length would become fairly complex. UNTIL b END ReadLine; - (* todo - PROCEDURE ReadNum*(VAR R: Rider; VAR x: ARRAY OF SYSTEM.BYTE); + (* todo combine ReadNum and ReadNum64 *) + PROCEDURE ReadNum64*(VAR R: Rider; VAR x: ARRAY OF SYSTEM.BYTE); VAR s, b: SYSTEM.INT8; q: SYSTEM.INT64; BEGIN s := 0; q := 0; Read(R, b); WHILE b >= 128 DO INC(q, ASH(b-128, s)); INC(s, 7); Read(R, b) END; INC(q, ASH(b MOD 64 - b DIV 64 * 64, s)); ASSERT(LEN(x) <= 8); SYSTEM.MOVE(SYSTEM.ADR(q), SYSTEM.ADR(x), LEN(x)) (* Assumes little endian representation of q and x. *) - END ReadNum; - *) + END ReadNum64; + PROCEDURE ReadNum* (VAR R: Rider; VAR x: LONGINT); VAR s: SHORTINT; ch: CHAR; n: LONGINT; diff --git a/src/tools/make/oberon.mk b/src/tools/make/oberon.mk index af0cbe2c..6d2a9c24 100644 --- a/src/tools/make/oberon.mk +++ b/src/tools/make/oberon.mk @@ -155,7 +155,7 @@ installable: # May require root access. install: @printf "\nInstalling into \"$(INSTALLDIR)\"\n" - @rm -rf "$(INSTALLDIR)/bin" "$(INSTALLDIR)/2 "$(INSTALLDIR)/C + @rm -rf "$(INSTALLDIR)" @mkdir -p "$(INSTALLDIR)/bin" @cp $(OBECOMP) "$(INSTALLDIR)/bin/$(OBECOMP)" From 1fa182c7ce76103c4c37649eb35bd51f71b5b662 Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 30 Sep 2016 18:15:46 +0100 Subject: [PATCH 263/580] Fix generalised ReadNum and use for Sym reading. --- bootstrap/unix-44/Files.c | 26 ++++---------------------- bootstrap/unix-44/Files.h | 3 +-- bootstrap/unix-44/OPM.c | 8 ++++---- bootstrap/unix-44/extTools.c | 2 +- bootstrap/unix-48/Files.c | 26 ++++---------------------- bootstrap/unix-48/Files.h | 3 +-- bootstrap/unix-48/OPM.c | 8 ++++---- bootstrap/unix-48/extTools.c | 2 +- bootstrap/unix-88/Files.c | 26 ++++---------------------- bootstrap/unix-88/Files.h | 3 +-- bootstrap/unix-88/OPM.c | 8 ++++---- bootstrap/unix-88/extTools.c | 2 +- bootstrap/windows-48/Files.c | 26 ++++---------------------- bootstrap/windows-48/Files.h | 3 +-- bootstrap/windows-48/OPM.c | 8 ++++---- bootstrap/windows-48/extTools.c | 2 +- bootstrap/windows-88/Files.c | 26 ++++---------------------- bootstrap/windows-88/Files.h | 3 +-- bootstrap/windows-88/OPM.c | 8 ++++---- bootstrap/windows-88/extTools.c | 2 +- src/compiler/OPM.Mod | 6 +++--- src/runtime/Files.Mod | 2 +- src/system/Files.Mod | 17 ++++------------- src/tools/make/configure.c | 2 +- 24 files changed, 59 insertions(+), 163 deletions(-) diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 81252466..7a06dc47 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -88,8 +88,7 @@ export void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x); export void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); export void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); export void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); -export void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x); -export void Files_ReadNum64 (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len); +export void Files_ReadNum (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len); export void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); export void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x); export void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); @@ -915,15 +914,15 @@ void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) } while (!b); } -void Files_ReadNum64 (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len) +void Files_ReadNum (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len) { int8 s, b; int64 q; s = 0; q = 0; Files_Read(&*R, R__typ, (void*)&b); - while ((int16)b >= 128) { - q += (int64)__ASH(((int16)b - 128), s); + while (b < 0) { + q += (int64)__ASH(((int16)b + 128), s); s += 7; Files_Read(&*R, R__typ, (void*)&b); } @@ -932,23 +931,6 @@ void Files_ReadNum64 (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x __MOVE((address)&q, (address)x, x__len); } -void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x) -{ - int8 s; - CHAR ch; - int32 n; - s = 0; - n = 0; - Files_Read(&*R, R__typ, (void*)&ch); - while ((int16)ch >= 128) { - n += __ASH(((int16)ch - 128), s); - s += 7; - Files_Read(&*R, R__typ, (void*)&ch); - } - n += __ASH((__MASK((int16)ch, -64) - __ASHL(__ASHR((int16)ch, 6), 6)), s); - *x = n; -} - void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x) { Files_Write(&*R, R__typ, __VAL(CHAR, x)); diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index af64d06f..69903ae1 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -45,8 +45,7 @@ import void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x); import void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); import void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); import void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); -import void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x); -import void Files_ReadNum64 (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len); +import void Files_ReadNum (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len); import void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); import void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x); import void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 7e770a33..1457a09c 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -745,7 +745,7 @@ int32 OPM_SymRInt (void) { int32 _o_result; int32 k; - Files_ReadNum(&OPM_oldSF, Files_Rider__typ, &k); + Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&k, 4); _o_result = k; return _o_result; } @@ -754,19 +754,19 @@ int64 OPM_SymRInt64 (void) { int64 _o_result; int64 k; - Files_ReadNum64(&OPM_oldSF, Files_Rider__typ, (void*)&k, 8); + Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&k, 8); _o_result = k; return _o_result; } void OPM_SymRSet64 (uint64 *s) { - Files_ReadNum64(&OPM_oldSF, Files_Rider__typ, (void*)&*s, 8); + Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&*s, 8); } void OPM_SymRSet (uint32 *s) { - Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (int32*)&*s); + Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&*s, 4); } void OPM_SymRReal (REAL *r) diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index fe7eb545..b082e82c 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -64,7 +64,7 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN static void extTools_InitialiseCompilerCommand (CHAR *s, LONGINT s__len) { - __COPY("gcc -g -O1", s, s__len); + __COPY("gcc -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 81252466..7a06dc47 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -88,8 +88,7 @@ export void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x); export void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); export void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); export void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); -export void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x); -export void Files_ReadNum64 (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len); +export void Files_ReadNum (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len); export void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); export void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x); export void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); @@ -915,15 +914,15 @@ void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) } while (!b); } -void Files_ReadNum64 (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len) +void Files_ReadNum (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len) { int8 s, b; int64 q; s = 0; q = 0; Files_Read(&*R, R__typ, (void*)&b); - while ((int16)b >= 128) { - q += (int64)__ASH(((int16)b - 128), s); + while (b < 0) { + q += (int64)__ASH(((int16)b + 128), s); s += 7; Files_Read(&*R, R__typ, (void*)&b); } @@ -932,23 +931,6 @@ void Files_ReadNum64 (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x __MOVE((address)&q, (address)x, x__len); } -void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x) -{ - int8 s; - CHAR ch; - int32 n; - s = 0; - n = 0; - Files_Read(&*R, R__typ, (void*)&ch); - while ((int16)ch >= 128) { - n += __ASH(((int16)ch - 128), s); - s += 7; - Files_Read(&*R, R__typ, (void*)&ch); - } - n += __ASH((__MASK((int16)ch, -64) - __ASHL(__ASHR((int16)ch, 6), 6)), s); - *x = n; -} - void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x) { Files_Write(&*R, R__typ, __VAL(CHAR, x)); diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index af64d06f..69903ae1 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -45,8 +45,7 @@ import void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x); import void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); import void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); import void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); -import void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x); -import void Files_ReadNum64 (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len); +import void Files_ReadNum (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len); import void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); import void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x); import void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 7e770a33..1457a09c 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -745,7 +745,7 @@ int32 OPM_SymRInt (void) { int32 _o_result; int32 k; - Files_ReadNum(&OPM_oldSF, Files_Rider__typ, &k); + Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&k, 4); _o_result = k; return _o_result; } @@ -754,19 +754,19 @@ int64 OPM_SymRInt64 (void) { int64 _o_result; int64 k; - Files_ReadNum64(&OPM_oldSF, Files_Rider__typ, (void*)&k, 8); + Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&k, 8); _o_result = k; return _o_result; } void OPM_SymRSet64 (uint64 *s) { - Files_ReadNum64(&OPM_oldSF, Files_Rider__typ, (void*)&*s, 8); + Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&*s, 8); } void OPM_SymRSet (uint32 *s) { - Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (int32*)&*s); + Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&*s, 4); } void OPM_SymRReal (REAL *r) diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index fe7eb545..b082e82c 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -64,7 +64,7 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN static void extTools_InitialiseCompilerCommand (CHAR *s, LONGINT s__len) { - __COPY("gcc -g -O1", s, s__len); + __COPY("gcc -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 75dee180..a884abf3 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -88,8 +88,7 @@ export void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x); export void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); export void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); export void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); -export void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x); -export void Files_ReadNum64 (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len); +export void Files_ReadNum (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len); export void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); export void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x); export void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); @@ -915,15 +914,15 @@ void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) } while (!b); } -void Files_ReadNum64 (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len) +void Files_ReadNum (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len) { int8 s, b; int64 q; s = 0; q = 0; Files_Read(&*R, R__typ, (void*)&b); - while ((int16)b >= 128) { - q += (int64)__ASH(((int16)b - 128), s); + while (b < 0) { + q += (int64)__ASH(((int16)b + 128), s); s += 7; Files_Read(&*R, R__typ, (void*)&b); } @@ -932,23 +931,6 @@ void Files_ReadNum64 (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x __MOVE((address)&q, (address)x, x__len); } -void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x) -{ - int8 s; - CHAR ch; - int32 n; - s = 0; - n = 0; - Files_Read(&*R, R__typ, (void*)&ch); - while ((int16)ch >= 128) { - n += __ASH(((int16)ch - 128), s); - s += 7; - Files_Read(&*R, R__typ, (void*)&ch); - } - n += __ASH((__MASK((int16)ch, -64) - __ASHL(__ASHR((int16)ch, 6), 6)), s); - *x = n; -} - void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x) { Files_Write(&*R, R__typ, __VAL(CHAR, x)); diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 0ba00834..02e44bed 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -47,8 +47,7 @@ import void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x); import void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); import void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); import void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); -import void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x); -import void Files_ReadNum64 (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len); +import void Files_ReadNum (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len); import void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); import void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x); import void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index deeaaa1d..0c2ad2b1 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -745,7 +745,7 @@ int32 OPM_SymRInt (void) { int32 _o_result; int32 k; - Files_ReadNum(&OPM_oldSF, Files_Rider__typ, &k); + Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&k, 4); _o_result = k; return _o_result; } @@ -754,19 +754,19 @@ int64 OPM_SymRInt64 (void) { int64 _o_result; int64 k; - Files_ReadNum64(&OPM_oldSF, Files_Rider__typ, (void*)&k, 8); + Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&k, 8); _o_result = k; return _o_result; } void OPM_SymRSet64 (uint64 *s) { - Files_ReadNum64(&OPM_oldSF, Files_Rider__typ, (void*)&*s, 8); + Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&*s, 8); } void OPM_SymRSet (uint32 *s) { - Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (int32*)&*s); + Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&*s, 4); } void OPM_SymRReal (REAL *r) diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index fe7eb545..b082e82c 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -64,7 +64,7 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN static void extTools_InitialiseCompilerCommand (CHAR *s, LONGINT s__len) { - __COPY("gcc -g -O1", s, s__len); + __COPY("gcc -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 003173fa..6163931f 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -88,8 +88,7 @@ export void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x); export void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); export void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); export void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); -export void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x); -export void Files_ReadNum64 (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len); +export void Files_ReadNum (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len); export void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); export void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x); export void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); @@ -915,15 +914,15 @@ void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) } while (!b); } -void Files_ReadNum64 (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len) +void Files_ReadNum (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len) { int8 s, b; int64 q; s = 0; q = 0; Files_Read(&*R, R__typ, (void*)&b); - while ((int16)b >= 128) { - q += (int64)__ASH(((int16)b - 128), s); + while (b < 0) { + q += (int64)__ASH(((int16)b + 128), s); s += 7; Files_Read(&*R, R__typ, (void*)&b); } @@ -932,23 +931,6 @@ void Files_ReadNum64 (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x __MOVE((address)&q, (address)x, x__len); } -void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x) -{ - int8 s; - CHAR ch; - int32 n; - s = 0; - n = 0; - Files_Read(&*R, R__typ, (void*)&ch); - while ((int16)ch >= 128) { - n += __ASH(((int16)ch - 128), s); - s += 7; - Files_Read(&*R, R__typ, (void*)&ch); - } - n += __ASH((__MASK((int16)ch, -64) - __ASHL(__ASHR((int16)ch, 6), 6)), s); - *x = n; -} - void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x) { Files_Write(&*R, R__typ, __VAL(CHAR, x)); diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index 12fa2cfa..56c229a3 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -45,8 +45,7 @@ import void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x); import void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); import void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); import void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); -import void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x); -import void Files_ReadNum64 (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len); +import void Files_ReadNum (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len); import void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); import void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x); import void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 7e770a33..1457a09c 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -745,7 +745,7 @@ int32 OPM_SymRInt (void) { int32 _o_result; int32 k; - Files_ReadNum(&OPM_oldSF, Files_Rider__typ, &k); + Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&k, 4); _o_result = k; return _o_result; } @@ -754,19 +754,19 @@ int64 OPM_SymRInt64 (void) { int64 _o_result; int64 k; - Files_ReadNum64(&OPM_oldSF, Files_Rider__typ, (void*)&k, 8); + Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&k, 8); _o_result = k; return _o_result; } void OPM_SymRSet64 (uint64 *s) { - Files_ReadNum64(&OPM_oldSF, Files_Rider__typ, (void*)&*s, 8); + Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&*s, 8); } void OPM_SymRSet (uint32 *s) { - Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (int32*)&*s); + Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&*s, 4); } void OPM_SymRReal (REAL *r) diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index fe7eb545..b082e82c 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -64,7 +64,7 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN static void extTools_InitialiseCompilerCommand (CHAR *s, LONGINT s__len) { - __COPY("gcc -g -O1", s, s__len); + __COPY("gcc -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 36fc4d53..ff0e4a78 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -88,8 +88,7 @@ export void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x); export void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); export void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); export void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); -export void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x); -export void Files_ReadNum64 (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len); +export void Files_ReadNum (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len); export void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); export void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x); export void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); @@ -915,15 +914,15 @@ void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) } while (!b); } -void Files_ReadNum64 (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len) +void Files_ReadNum (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len) { int8 s, b; int64 q; s = 0; q = 0; Files_Read(&*R, R__typ, (void*)&b); - while ((int16)b >= 128) { - q += (int64)__ASH(((int16)b - 128), s); + while (b < 0) { + q += (int64)__ASH(((int16)b + 128), s); s += 7; Files_Read(&*R, R__typ, (void*)&b); } @@ -932,23 +931,6 @@ void Files_ReadNum64 (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x __MOVE((address)&q, (address)x, x__len); } -void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x) -{ - int8 s; - CHAR ch; - int32 n; - s = 0; - n = 0; - Files_Read(&*R, R__typ, (void*)&ch); - while ((int16)ch >= 128) { - n += __ASH(((int16)ch - 128), s); - s += 7; - Files_Read(&*R, R__typ, (void*)&ch); - } - n += __ASH((__MASK((int16)ch, -64) - __ASHL(__ASHR((int16)ch, 6), 6)), s); - *x = n; -} - void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x) { Files_Write(&*R, R__typ, __VAL(CHAR, x)); diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 35d709e7..e00e603f 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -47,8 +47,7 @@ import void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x); import void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); import void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); import void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); -import void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x); -import void Files_ReadNum64 (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len); +import void Files_ReadNum (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len); import void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); import void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x); import void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index deeaaa1d..0c2ad2b1 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -745,7 +745,7 @@ int32 OPM_SymRInt (void) { int32 _o_result; int32 k; - Files_ReadNum(&OPM_oldSF, Files_Rider__typ, &k); + Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&k, 4); _o_result = k; return _o_result; } @@ -754,19 +754,19 @@ int64 OPM_SymRInt64 (void) { int64 _o_result; int64 k; - Files_ReadNum64(&OPM_oldSF, Files_Rider__typ, (void*)&k, 8); + Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&k, 8); _o_result = k; return _o_result; } void OPM_SymRSet64 (uint64 *s) { - Files_ReadNum64(&OPM_oldSF, Files_Rider__typ, (void*)&*s, 8); + Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&*s, 8); } void OPM_SymRSet (uint32 *s) { - Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (int32*)&*s); + Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&*s, 4); } void OPM_SymRReal (REAL *r) diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index fe7eb545..b082e82c 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -64,7 +64,7 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN static void extTools_InitialiseCompilerCommand (CHAR *s, LONGINT s__len) { - __COPY("gcc -g -O1", s, s__len); + __COPY("gcc -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); diff --git a/src/compiler/OPM.Mod b/src/compiler/OPM.Mod index 6db573f6..a2beb450 100644 --- a/src/compiler/OPM.Mod +++ b/src/compiler/OPM.Mod @@ -600,16 +600,16 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) PROCEDURE SymRInt64*(): SYSTEM.INT64; VAR k: SYSTEM.INT64; - BEGIN Files.ReadNum64(oldSF, k); RETURN k + BEGIN Files.ReadNum(oldSF, k); RETURN k END SymRInt64; (* todo - combine RSet64 and RSet *) PROCEDURE SymRSet64*(VAR s: SYSTEM.SET64); - BEGIN Files.ReadNum64(oldSF, s) + BEGIN Files.ReadNum(oldSF, s) END SymRSet64; PROCEDURE SymRSet*(VAR s: SET); - BEGIN Files.ReadNum(oldSF, SYSTEM.VAL(LONGINT, s)) + BEGIN Files.ReadNum(oldSF, s) END SymRSet; PROCEDURE SymRReal*(VAR r: REAL); diff --git a/src/runtime/Files.Mod b/src/runtime/Files.Mod index 893abf1f..a8246ace 100644 --- a/src/runtime/Files.Mod +++ b/src/runtime/Files.Mod @@ -657,7 +657,7 @@ Especially Length would become fairly complex. PROCEDURE ReadNum*(VAR R: Rider; VAR x: ARRAY OF SYSTEM.BYTE); VAR s, b: SYSTEM.INT8; q: SYSTEM.INT64; BEGIN s := 0; q := 0; Read(R, b); - WHILE b >= 128 DO INC(q, ASH(b-128, s)); INC(s, 7); Read(R, b) END; + WHILE b < 0 DO INC(q, ASH(b+128, s)); INC(s, 7); Read(R, b) END; INC(q, ASH(b MOD 64 - b DIV 64 * 64, s)); ASSERT(LEN(x) <= 8); SYSTEM.MOVE(SYSTEM.ADR(q), SYSTEM.ADR(x), LEN(x)) (* Assumes little endian representation of q and x. *) diff --git a/src/system/Files.Mod b/src/system/Files.Mod index 94ef014a..e4add256 100644 --- a/src/system/Files.Mod +++ b/src/system/Files.Mod @@ -654,23 +654,14 @@ Especially Length would become fairly complex. UNTIL b END ReadLine; - (* todo combine ReadNum and ReadNum64 *) - PROCEDURE ReadNum64*(VAR R: Rider; VAR x: ARRAY OF SYSTEM.BYTE); + PROCEDURE ReadNum*(VAR R: Rider; VAR x: ARRAY OF SYSTEM.BYTE); VAR s, b: SYSTEM.INT8; q: SYSTEM.INT64; - BEGIN s := 0; q := 0; Read(R, b); - WHILE b >= 128 DO INC(q, ASH(b-128, s)); INC(s, 7); Read(R, b) END; + BEGIN + s := 0; q := 0; Read(R, b); + WHILE b < 0 DO INC(q, ASH(b+128, s)); INC(s, 7); Read(R, b) END; INC(q, ASH(b MOD 64 - b DIV 64 * 64, s)); ASSERT(LEN(x) <= 8); SYSTEM.MOVE(SYSTEM.ADR(q), SYSTEM.ADR(x), LEN(x)) (* Assumes little endian representation of q and x. *) - END ReadNum64; - - - PROCEDURE ReadNum* (VAR R: Rider; VAR x: LONGINT); - VAR s: SHORTINT; ch: CHAR; n: LONGINT; - BEGIN s := 0; n := 0; Read(R, ch); - WHILE ORD(ch) >= 128 DO INC(n, ASH(ORD(ch) - 128, s) ); INC(s, 7); Read(R, ch) END; - INC(n, ASH(ORD(ch) MOD 64 - ORD(ch) DIV 64 * 64, s) ); - x := n END ReadNum; PROCEDURE WriteBool* (VAR R: Rider; x: BOOLEAN); diff --git a/src/tools/make/configure.c b/src/tools/make/configure.c index b8d261dd..d3ccc2d1 100644 --- a/src/tools/make/configure.c +++ b/src/tools/make/configure.c @@ -126,7 +126,7 @@ void determineOS() { #endif } -#define optimize " -O1" +#define optimize "" // " -O1" void determineCCompiler() { snprintf(libspec, sizeof(libspec), " -l %s", oname); From 2e02f9204cf33846c143b49a14397d07d990a421 Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 30 Sep 2016 18:42:59 +0100 Subject: [PATCH 264/580] Accept all SET types in INCL. --- bootstrap/unix-44/OPB.c | 4 ++-- bootstrap/unix-44/OPM.c | 6 ------ bootstrap/unix-44/OPM.h | 1 - bootstrap/unix-48/OPB.c | 4 ++-- bootstrap/unix-48/OPM.c | 6 ------ bootstrap/unix-48/OPM.h | 1 - bootstrap/unix-88/OPB.c | 4 ++-- bootstrap/unix-88/OPM.c | 6 ------ bootstrap/unix-88/OPM.h | 1 - bootstrap/windows-48/OPB.c | 4 ++-- bootstrap/windows-48/OPM.c | 6 ------ bootstrap/windows-48/OPM.h | 1 - bootstrap/windows-88/OPB.c | 4 ++-- bootstrap/windows-88/OPM.c | 6 ------ bootstrap/windows-88/OPM.h | 1 - src/compiler/OPB.Mod | 14 +++++++------- src/compiler/OPM.Mod | 11 +++-------- src/compiler/OPT.Mod | 6 ++---- 18 files changed, 22 insertions(+), 64 deletions(-) diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index d099cad7..0b88b1ea 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1879,7 +1879,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) case 15: case 16: if (OPB_NotVar(x)) { OPB_err(112); - } else if (x->typ != OPT_settyp) { + } else if (x->typ->form != 7) { OPB_err(111); x->typ = OPT_settyp; } else if (x->readonly) { @@ -2044,7 +2044,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (f == 4) { - if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > (int64)OPM_MaxSet))) { + if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval >= (int64)__ASHL(p->typ->size, 3)))) { OPB_err(202); } p = NewOp__54(19, fctno, p, x); diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 1457a09c..1ef195b4 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -82,7 +82,6 @@ export int64 OPM_SymRInt64 (void); export void OPM_SymRLReal (LONGREAL *lr); export void OPM_SymRReal (REAL *r); export void OPM_SymRSet (uint32 *s); -export void OPM_SymRSet64 (uint64 *s); export void OPM_SymWCh (CHAR ch); export void OPM_SymWInt (int64 i); export void OPM_SymWLReal (LONGREAL lr); @@ -759,11 +758,6 @@ int64 OPM_SymRInt64 (void) return _o_result; } -void OPM_SymRSet64 (uint64 *s) -{ - Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&*s, 8); -} - void OPM_SymRSet (uint32 *s) { Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&*s, 4); diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index 12db4754..dd3c0c27 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -50,7 +50,6 @@ import int64 OPM_SymRInt64 (void); import void OPM_SymRLReal (LONGREAL *lr); import void OPM_SymRReal (REAL *r); import void OPM_SymRSet (uint32 *s); -import void OPM_SymRSet64 (uint64 *s); import void OPM_SymWCh (CHAR ch); import void OPM_SymWInt (int64 i); import void OPM_SymWLReal (LONGREAL lr); diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index d099cad7..0b88b1ea 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1879,7 +1879,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) case 15: case 16: if (OPB_NotVar(x)) { OPB_err(112); - } else if (x->typ != OPT_settyp) { + } else if (x->typ->form != 7) { OPB_err(111); x->typ = OPT_settyp; } else if (x->readonly) { @@ -2044,7 +2044,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (f == 4) { - if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > (int64)OPM_MaxSet))) { + if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval >= (int64)__ASHL(p->typ->size, 3)))) { OPB_err(202); } p = NewOp__54(19, fctno, p, x); diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 1457a09c..1ef195b4 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -82,7 +82,6 @@ export int64 OPM_SymRInt64 (void); export void OPM_SymRLReal (LONGREAL *lr); export void OPM_SymRReal (REAL *r); export void OPM_SymRSet (uint32 *s); -export void OPM_SymRSet64 (uint64 *s); export void OPM_SymWCh (CHAR ch); export void OPM_SymWInt (int64 i); export void OPM_SymWLReal (LONGREAL lr); @@ -759,11 +758,6 @@ int64 OPM_SymRInt64 (void) return _o_result; } -void OPM_SymRSet64 (uint64 *s) -{ - Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&*s, 8); -} - void OPM_SymRSet (uint32 *s) { Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&*s, 4); diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index 12db4754..dd3c0c27 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -50,7 +50,6 @@ import int64 OPM_SymRInt64 (void); import void OPM_SymRLReal (LONGREAL *lr); import void OPM_SymRReal (REAL *r); import void OPM_SymRSet (uint32 *s); -import void OPM_SymRSet64 (uint64 *s); import void OPM_SymWCh (CHAR ch); import void OPM_SymWInt (int64 i); import void OPM_SymWLReal (LONGREAL lr); diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index d099cad7..0b88b1ea 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1879,7 +1879,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) case 15: case 16: if (OPB_NotVar(x)) { OPB_err(112); - } else if (x->typ != OPT_settyp) { + } else if (x->typ->form != 7) { OPB_err(111); x->typ = OPT_settyp; } else if (x->readonly) { @@ -2044,7 +2044,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (f == 4) { - if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > (int64)OPM_MaxSet))) { + if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval >= (int64)__ASHL(p->typ->size, 3)))) { OPB_err(202); } p = NewOp__54(19, fctno, p, x); diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 0c2ad2b1..41d574f6 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -82,7 +82,6 @@ export int64 OPM_SymRInt64 (void); export void OPM_SymRLReal (LONGREAL *lr); export void OPM_SymRReal (REAL *r); export void OPM_SymRSet (uint32 *s); -export void OPM_SymRSet64 (uint64 *s); export void OPM_SymWCh (CHAR ch); export void OPM_SymWInt (int64 i); export void OPM_SymWLReal (LONGREAL lr); @@ -759,11 +758,6 @@ int64 OPM_SymRInt64 (void) return _o_result; } -void OPM_SymRSet64 (uint64 *s) -{ - Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&*s, 8); -} - void OPM_SymRSet (uint32 *s) { Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&*s, 4); diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index 12db4754..dd3c0c27 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -50,7 +50,6 @@ import int64 OPM_SymRInt64 (void); import void OPM_SymRLReal (LONGREAL *lr); import void OPM_SymRReal (REAL *r); import void OPM_SymRSet (uint32 *s); -import void OPM_SymRSet64 (uint64 *s); import void OPM_SymWCh (CHAR ch); import void OPM_SymWInt (int64 i); import void OPM_SymWLReal (LONGREAL lr); diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index d099cad7..0b88b1ea 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1879,7 +1879,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) case 15: case 16: if (OPB_NotVar(x)) { OPB_err(112); - } else if (x->typ != OPT_settyp) { + } else if (x->typ->form != 7) { OPB_err(111); x->typ = OPT_settyp; } else if (x->readonly) { @@ -2044,7 +2044,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (f == 4) { - if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > (int64)OPM_MaxSet))) { + if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval >= (int64)__ASHL(p->typ->size, 3)))) { OPB_err(202); } p = NewOp__54(19, fctno, p, x); diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 1457a09c..1ef195b4 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -82,7 +82,6 @@ export int64 OPM_SymRInt64 (void); export void OPM_SymRLReal (LONGREAL *lr); export void OPM_SymRReal (REAL *r); export void OPM_SymRSet (uint32 *s); -export void OPM_SymRSet64 (uint64 *s); export void OPM_SymWCh (CHAR ch); export void OPM_SymWInt (int64 i); export void OPM_SymWLReal (LONGREAL lr); @@ -759,11 +758,6 @@ int64 OPM_SymRInt64 (void) return _o_result; } -void OPM_SymRSet64 (uint64 *s) -{ - Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&*s, 8); -} - void OPM_SymRSet (uint32 *s) { Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&*s, 4); diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index 12db4754..dd3c0c27 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -50,7 +50,6 @@ import int64 OPM_SymRInt64 (void); import void OPM_SymRLReal (LONGREAL *lr); import void OPM_SymRReal (REAL *r); import void OPM_SymRSet (uint32 *s); -import void OPM_SymRSet64 (uint64 *s); import void OPM_SymWCh (CHAR ch); import void OPM_SymWInt (int64 i); import void OPM_SymWLReal (LONGREAL lr); diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index d099cad7..0b88b1ea 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1879,7 +1879,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) case 15: case 16: if (OPB_NotVar(x)) { OPB_err(112); - } else if (x->typ != OPT_settyp) { + } else if (x->typ->form != 7) { OPB_err(111); x->typ = OPT_settyp; } else if (x->readonly) { @@ -2044,7 +2044,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (f == 4) { - if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > (int64)OPM_MaxSet))) { + if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval >= (int64)__ASHL(p->typ->size, 3)))) { OPB_err(202); } p = NewOp__54(19, fctno, p, x); diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 0c2ad2b1..41d574f6 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -82,7 +82,6 @@ export int64 OPM_SymRInt64 (void); export void OPM_SymRLReal (LONGREAL *lr); export void OPM_SymRReal (REAL *r); export void OPM_SymRSet (uint32 *s); -export void OPM_SymRSet64 (uint64 *s); export void OPM_SymWCh (CHAR ch); export void OPM_SymWInt (int64 i); export void OPM_SymWLReal (LONGREAL lr); @@ -759,11 +758,6 @@ int64 OPM_SymRInt64 (void) return _o_result; } -void OPM_SymRSet64 (uint64 *s) -{ - Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&*s, 8); -} - void OPM_SymRSet (uint32 *s) { Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&*s, 4); diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index 12db4754..dd3c0c27 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -50,7 +50,6 @@ import int64 OPM_SymRInt64 (void); import void OPM_SymRLReal (LONGREAL *lr); import void OPM_SymRReal (REAL *r); import void OPM_SymRSet (uint32 *s); -import void OPM_SymRSet64 (uint64 *s); import void OPM_SymWCh (CHAR ch); import void OPM_SymWInt (int64 i); import void OPM_SymWLReal (LONGREAL lr); diff --git a/src/compiler/OPB.Mod b/src/compiler/OPB.Mod index b29f6b49..c1a317d2 100644 --- a/src/compiler/OPB.Mod +++ b/src/compiler/OPB.Mod @@ -811,11 +811,11 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) ELSE err(201); x^.conval^.setval := {l..k} END ; x^.obj := NIL - ELSE BindNodes(OPT.Nupto, OPT.settyp, x, y) + ELSE BindNodes(OPT.Nupto, OPT.settyp, x, y) (* todo choose appropriate set type ? *) END ELSE err(93) END ; - x^.typ := OPT.settyp + x^.typ := OPT.settyp (* todo choose appropriate set type ? *) END SetRange; PROCEDURE SetElem*(VAR x: OPT.Node); @@ -829,9 +829,9 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) ELSE err(202) END ; x^.obj := NIL - ELSE Convert(x, OPT.settyp) + ELSE Convert(x, OPT.settyp) (* todo choose appropriate set type ? *) END ; - x^.typ := OPT.settyp + x^.typ := OPT.settyp (* todo choose appropriate set type ? *) END SetElem; PROCEDURE CheckAssign(x: OPT.Struct; ynode: OPT.Node); (* x := y *) @@ -1027,7 +1027,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) |OPT.inclfn, OPT.exclfn: (*INCL, EXCL*) IF NotVar(x) THEN err(112) - ELSIF x^.typ # OPT.settyp THEN err(111); x^.typ := OPT.settyp + ELSIF x.typ.form # OPT.Set THEN err(111); x^.typ := OPT.settyp ELSIF x^.readonly THEN err(76) END |OPT.lenfn: (*LEN*) @@ -1124,8 +1124,8 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) OPT.exclfn: (*INCL, EXCL*) IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) ELSIF f = OPT.Int THEN - IF (x^.class = OPT.Nconst) & ((0 > x^.conval^.intval) OR (x^.conval^.intval > OPM.MaxSet)) THEN err(202) - END ; + IF (x^.class = OPT.Nconst) & ((0 > x^.conval^.intval) OR (x^.conval^.intval >= p.typ.size*8)) THEN err(202) + END; p := NewOp(OPT.Nassign, fctno, p, x) ELSE err(111) END ; diff --git a/src/compiler/OPM.Mod b/src/compiler/OPM.Mod index a2beb450..a18953a7 100644 --- a/src/compiler/OPM.Mod +++ b/src/compiler/OPM.Mod @@ -552,7 +552,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) END FPrint; - PROCEDURE FPrintSet*(VAR fp: LONGINT; set: SET); + PROCEDURE FPrintSet*(VAR fp: LONGINT; set: SET); (*SYSTEM.SET64);*) BEGIN FPrint(fp, SYSTEM.VAL(LONGINT, set)) END FPrintSet; @@ -603,12 +603,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) BEGIN Files.ReadNum(oldSF, k); RETURN k END SymRInt64; - (* todo - combine RSet64 and RSet *) - PROCEDURE SymRSet64*(VAR s: SYSTEM.SET64); - BEGIN Files.ReadNum(oldSF, s) - END SymRSet64; - - PROCEDURE SymRSet*(VAR s: SET); + PROCEDURE SymRSet*(VAR s: SET); (*SYSTEM.SET64);*) BEGIN Files.ReadNum(oldSF, s) END SymRSet; @@ -653,7 +648,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) BEGIN Files.WriteNum(newSF, i) END SymWInt; - (* todo + (* PROCEDURE SymWSet*(s: SYSTEM.SET64); BEGIN Files.WriteNum(newSF, SYSTEM.VAL(SYSTEM.INT64, s)) END SymWSet; diff --git a/src/compiler/OPT.Mod b/src/compiler/OPT.Mod index e55c7d3c..a3960ac2 100644 --- a/src/compiler/OPT.Mod +++ b/src/compiler/OPT.Mod @@ -15,10 +15,8 @@ TYPE ext*: ConstExt; (* string or code for code proc *) intval*: SYSTEM.INT64; (* constant value or adr, proc par size, text position or least case label *) intval2*: LONGINT; (* string length, proc var size or larger case label *) - (* todo - setval*: SYSTEM.SET64; (* constant value, procedure body present or "ELSE" present in case *) - *) - setval*: SET; (* constant value, procedure body present or "ELSE" present in case *) + (*setval*: SYSTEM.SET64;*) (* constant value, procedure body present or "ELSE" present in case *) + setval*: SET; (* constant value, procedure body present or "ELSE" present in case *) realval*: LONGREAL (* real or longreal constant value *) END; From 7238be5257d3827e1e0e504ac291158f29347291 Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 30 Sep 2016 19:00:33 +0100 Subject: [PATCH 265/580] Use SET64 representation in the compiler. --- bootstrap/unix-44/OPB.c | 4 ++-- bootstrap/unix-44/OPM.c | 18 +++++++++--------- bootstrap/unix-44/OPM.h | 6 +++--- bootstrap/unix-44/OPP.c | 10 +++++----- bootstrap/unix-44/OPT.c | 4 ++-- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 2 +- bootstrap/unix-48/OPB.c | 4 ++-- bootstrap/unix-48/OPM.c | 18 +++++++++--------- bootstrap/unix-48/OPM.h | 6 +++--- bootstrap/unix-48/OPP.c | 10 +++++----- bootstrap/unix-48/OPT.c | 4 ++-- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 2 +- bootstrap/unix-88/OPB.c | 4 ++-- bootstrap/unix-88/OPM.c | 18 +++++++++--------- bootstrap/unix-88/OPM.h | 6 +++--- bootstrap/unix-88/OPP.c | 10 +++++----- bootstrap/unix-88/OPT.c | 4 ++-- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 2 +- bootstrap/windows-48/OPB.c | 4 ++-- bootstrap/windows-48/OPM.c | 18 +++++++++--------- bootstrap/windows-48/OPM.h | 6 +++--- bootstrap/windows-48/OPP.c | 10 +++++----- bootstrap/windows-48/OPT.c | 4 ++-- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 2 +- bootstrap/windows-88/OPB.c | 4 ++-- bootstrap/windows-88/OPM.c | 18 +++++++++--------- bootstrap/windows-88/OPM.h | 6 +++--- bootstrap/windows-88/OPP.c | 10 +++++----- bootstrap/windows-88/OPT.c | 4 ++-- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 2 +- src/compiler/OPM.Mod | 10 ++-------- src/compiler/OPT.Mod | 3 +-- src/test/confidence/planned-binary-change | 2 +- 38 files changed, 119 insertions(+), 126 deletions(-) diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index 0b88b1ea..43c9e328 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -471,7 +471,7 @@ void OPB_In (OPT_Node *x, OPT_Node y) if (k < 0 || k > (int64)OPM_MaxSet) { OPB_err(202); } else if (y->class == 7) { - (*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval, 32)); + (*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval, 64)); (*x)->obj = NIL; } else { OPB_BindNodes(12, OPT_booltyp, &*x, y); @@ -2483,7 +2483,7 @@ void OPB_StaticLink (int8 dlev) scope = OPT_topScope; while (dlev > 0) { dlev -= 1; - scope->link->conval->setval |= __SETOF(3,32); + scope->link->conval->setval |= __SETOF(3,64); scope = scope->left; } } diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 1ef195b4..b77fcb9c 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -53,7 +53,7 @@ export void OPM_DeleteNewSym (void); export void OPM_FPrint (int32 *fp, int64 val); export void OPM_FPrintLReal (int32 *fp, LONGREAL lr); export void OPM_FPrintReal (int32 *fp, REAL real); -export void OPM_FPrintSet (int32 *fp, uint32 set); +export void OPM_FPrintSet (int32 *fp, uint64 set); static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 pos); export void OPM_Get (CHAR *ch); export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); @@ -81,12 +81,12 @@ export int32 OPM_SymRInt (void); export int64 OPM_SymRInt64 (void); export void OPM_SymRLReal (LONGREAL *lr); export void OPM_SymRReal (REAL *r); -export void OPM_SymRSet (uint32 *s); +export void OPM_SymRSet (uint64 *s); export void OPM_SymWCh (CHAR ch); export void OPM_SymWInt (int64 i); export void OPM_SymWLReal (LONGREAL lr); export void OPM_SymWReal (REAL r); -export void OPM_SymWSet (uint32 s); +export void OPM_SymWSet (uint64 s); static void OPM_VerboseListSizes (void); export void OPM_Write (CHAR ch); export void OPM_WriteHex (int64 i); @@ -713,9 +713,9 @@ void OPM_FPrint (int32 *fp, int64 val) *fp = __ROTL((int32)((uint32)*fp ^ __VAL(uint32, val)), 1, 32); } -void OPM_FPrintSet (int32 *fp, uint32 set) +void OPM_FPrintSet (int32 *fp, uint64 set) { - OPM_FPrint(&*fp, (int32)set); + OPM_FPrint(&*fp, __VAL(int32, set)); } void OPM_FPrintReal (int32 *fp, REAL real) @@ -758,9 +758,9 @@ int64 OPM_SymRInt64 (void) return _o_result; } -void OPM_SymRSet (uint32 *s) +void OPM_SymRSet (uint64 *s) { - Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&*s, 4); + Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&*s, 8); } void OPM_SymRReal (REAL *r) @@ -812,9 +812,9 @@ void OPM_SymWInt (int64 i) Files_WriteNum(&OPM_newSF, Files_Rider__typ, i); } -void OPM_SymWSet (uint32 s) +void OPM_SymWSet (uint64 s) { - Files_WriteNum(&OPM_newSF, Files_Rider__typ, (int32)s); + Files_WriteNum(&OPM_newSF, Files_Rider__typ, (int64)s); } void OPM_SymWReal (REAL r) diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index dd3c0c27..aec6ed54 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -26,7 +26,7 @@ import void OPM_DeleteNewSym (void); import void OPM_FPrint (int32 *fp, int64 val); import void OPM_FPrintLReal (int32 *fp, LONGREAL lr); import void OPM_FPrintReal (int32 *fp, REAL real); -import void OPM_FPrintSet (int32 *fp, uint32 set); +import void OPM_FPrintSet (int32 *fp, uint64 set); import void OPM_Get (CHAR *ch); import void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); import void OPM_InitOptions (void); @@ -49,12 +49,12 @@ import int32 OPM_SymRInt (void); import int64 OPM_SymRInt64 (void); import void OPM_SymRLReal (LONGREAL *lr); import void OPM_SymRReal (REAL *r); -import void OPM_SymRSet (uint32 *s); +import void OPM_SymRSet (uint64 *s); import void OPM_SymWCh (CHAR ch); import void OPM_SymWInt (int64 i); import void OPM_SymWLReal (LONGREAL lr); import void OPM_SymWReal (REAL r); -import void OPM_SymWSet (uint32 s); +import void OPM_SymWSet (uint64 s); import void OPM_Write (CHAR ch); import void OPM_WriteHex (int64 i); import void OPM_WriteInt (int64 i); diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index 1eff447d..d4bdcf39 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -967,7 +967,7 @@ static void GetCode__19 (void) } } } - (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1,32); + (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1,64); } static void GetParams__21 (void) @@ -999,7 +999,7 @@ static void Body__17 (void) OPT_Node procdec = NIL, statseq = NIL; int32 c; c = OPM_errpos; - (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1,32); + (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1,64); OPP_CheckSym(39); OPP_Block(&procdec, &statseq); OPB_Enter(&procdec, statseq, *ProcedureDeclaration__16_s->proc); @@ -1042,7 +1042,7 @@ static void TProcDecl__23 (void) if ((*ProcedureDeclaration__16_s->fwd != NIL && (*ProcedureDeclaration__16_s->fwd)->mnolev != OPP_level)) { *ProcedureDeclaration__16_s->fwd = NIL; } - if ((((*ProcedureDeclaration__16_s->fwd != NIL && (*ProcedureDeclaration__16_s->fwd)->mode == 13)) && !__IN(1, (*ProcedureDeclaration__16_s->fwd)->conval->setval, 32))) { + if ((((*ProcedureDeclaration__16_s->fwd != NIL && (*ProcedureDeclaration__16_s->fwd)->mode == 13)) && !__IN(1, (*ProcedureDeclaration__16_s->fwd)->conval->setval, 64))) { *ProcedureDeclaration__16_s->proc = OPT_NewObj(); (*ProcedureDeclaration__16_s->proc)->leaf = 1; if ((*ProcedureDeclaration__16_s->fwd)->vis != *ProcedureDeclaration__16_s->vis) { @@ -1076,7 +1076,7 @@ static void TProcDecl__23 (void) if ((((((baseProc->vis == 1 && (*ProcedureDeclaration__16_s->proc)->vis == 0)) && recTyp->strobj != NIL)) && recTyp->strobj->vis == 1)) { OPP_err(109); } - (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(2,32); + (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(2,64); } if (!*ProcedureDeclaration__16_s->forward) { Body__17(); @@ -1136,7 +1136,7 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) if ((fwd != NIL && (fwd->mnolev != OPP_level || fwd->mode == 8))) { fwd = NIL; } - if ((((fwd != NIL && __IN(fwd->mode, 0xc0, 32))) && !__IN(1, fwd->conval->setval, 32))) { + if ((((fwd != NIL && __IN(fwd->mode, 0xc0, 32))) && !__IN(1, fwd->conval->setval, 64))) { proc = OPT_NewObj(); proc->leaf = 1; if (fwd->vis != vis) { diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index 9682088a..b178bfbc 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -20,7 +20,7 @@ typedef OPT_ConstExt ext; int64 intval; int32 intval2; - uint32 setval; + uint64 setval; LONGREAL realval; } OPT_ConstDesc; @@ -2008,7 +2008,7 @@ static void EnumPtrs(void (*P)(void*)) __ENUMR(&OPT_impCtxt, OPT_ImpCtxt__typ, 3140, 1, P); } -__TDESC(OPT_ConstDesc, 1, 1) = {__TDFLDS("ConstDesc", 28), {0, -8}}; +__TDESC(OPT_ConstDesc, 1, 1) = {__TDFLDS("ConstDesc", 32), {0, -8}}; __TDESC(OPT_ObjDesc, 1, 6) = {__TDFLDS("ObjDesc", 304), {0, 4, 8, 12, 284, 288, -28}}; __TDESC(OPT_StrDesc, 1, 3) = {__TDFLDS("StrDesc", 56), {44, 48, 52, -16}}; __TDESC(OPT_NodeDesc, 1, 6) = {__TDFLDS("NodeDesc", 28), {0, 4, 8, 16, 20, 24, -28}}; diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index 2bc05576..624d4fe0 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -17,7 +17,7 @@ typedef OPT_ConstExt ext; int64 intval; int32 intval2; - uint32 setval; + uint64 setval; LONGREAL realval; } OPT_ConstDesc; diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index 99e7aa6a..a07e28a6 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -72,7 +72,7 @@ static void OPV_GetTProcNum (OPT_Object obj) OPT_FindField(obj->name, typ->BaseTyp, &redef); if (redef != NIL) { obj->adr = __ASHL(__ASHR(redef->adr, 16), 16); - if (!__IN(2, obj->conval->setval, 32)) { + if (!__IN(2, obj->conval->setval, 64)) { OPM_err(119); } } else { diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index 0b88b1ea..43c9e328 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -471,7 +471,7 @@ void OPB_In (OPT_Node *x, OPT_Node y) if (k < 0 || k > (int64)OPM_MaxSet) { OPB_err(202); } else if (y->class == 7) { - (*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval, 32)); + (*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval, 64)); (*x)->obj = NIL; } else { OPB_BindNodes(12, OPT_booltyp, &*x, y); @@ -2483,7 +2483,7 @@ void OPB_StaticLink (int8 dlev) scope = OPT_topScope; while (dlev > 0) { dlev -= 1; - scope->link->conval->setval |= __SETOF(3,32); + scope->link->conval->setval |= __SETOF(3,64); scope = scope->left; } } diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 1ef195b4..b77fcb9c 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -53,7 +53,7 @@ export void OPM_DeleteNewSym (void); export void OPM_FPrint (int32 *fp, int64 val); export void OPM_FPrintLReal (int32 *fp, LONGREAL lr); export void OPM_FPrintReal (int32 *fp, REAL real); -export void OPM_FPrintSet (int32 *fp, uint32 set); +export void OPM_FPrintSet (int32 *fp, uint64 set); static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 pos); export void OPM_Get (CHAR *ch); export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); @@ -81,12 +81,12 @@ export int32 OPM_SymRInt (void); export int64 OPM_SymRInt64 (void); export void OPM_SymRLReal (LONGREAL *lr); export void OPM_SymRReal (REAL *r); -export void OPM_SymRSet (uint32 *s); +export void OPM_SymRSet (uint64 *s); export void OPM_SymWCh (CHAR ch); export void OPM_SymWInt (int64 i); export void OPM_SymWLReal (LONGREAL lr); export void OPM_SymWReal (REAL r); -export void OPM_SymWSet (uint32 s); +export void OPM_SymWSet (uint64 s); static void OPM_VerboseListSizes (void); export void OPM_Write (CHAR ch); export void OPM_WriteHex (int64 i); @@ -713,9 +713,9 @@ void OPM_FPrint (int32 *fp, int64 val) *fp = __ROTL((int32)((uint32)*fp ^ __VAL(uint32, val)), 1, 32); } -void OPM_FPrintSet (int32 *fp, uint32 set) +void OPM_FPrintSet (int32 *fp, uint64 set) { - OPM_FPrint(&*fp, (int32)set); + OPM_FPrint(&*fp, __VAL(int32, set)); } void OPM_FPrintReal (int32 *fp, REAL real) @@ -758,9 +758,9 @@ int64 OPM_SymRInt64 (void) return _o_result; } -void OPM_SymRSet (uint32 *s) +void OPM_SymRSet (uint64 *s) { - Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&*s, 4); + Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&*s, 8); } void OPM_SymRReal (REAL *r) @@ -812,9 +812,9 @@ void OPM_SymWInt (int64 i) Files_WriteNum(&OPM_newSF, Files_Rider__typ, i); } -void OPM_SymWSet (uint32 s) +void OPM_SymWSet (uint64 s) { - Files_WriteNum(&OPM_newSF, Files_Rider__typ, (int32)s); + Files_WriteNum(&OPM_newSF, Files_Rider__typ, (int64)s); } void OPM_SymWReal (REAL r) diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index dd3c0c27..aec6ed54 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -26,7 +26,7 @@ import void OPM_DeleteNewSym (void); import void OPM_FPrint (int32 *fp, int64 val); import void OPM_FPrintLReal (int32 *fp, LONGREAL lr); import void OPM_FPrintReal (int32 *fp, REAL real); -import void OPM_FPrintSet (int32 *fp, uint32 set); +import void OPM_FPrintSet (int32 *fp, uint64 set); import void OPM_Get (CHAR *ch); import void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); import void OPM_InitOptions (void); @@ -49,12 +49,12 @@ import int32 OPM_SymRInt (void); import int64 OPM_SymRInt64 (void); import void OPM_SymRLReal (LONGREAL *lr); import void OPM_SymRReal (REAL *r); -import void OPM_SymRSet (uint32 *s); +import void OPM_SymRSet (uint64 *s); import void OPM_SymWCh (CHAR ch); import void OPM_SymWInt (int64 i); import void OPM_SymWLReal (LONGREAL lr); import void OPM_SymWReal (REAL r); -import void OPM_SymWSet (uint32 s); +import void OPM_SymWSet (uint64 s); import void OPM_Write (CHAR ch); import void OPM_WriteHex (int64 i); import void OPM_WriteInt (int64 i); diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index 1eff447d..d4bdcf39 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -967,7 +967,7 @@ static void GetCode__19 (void) } } } - (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1,32); + (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1,64); } static void GetParams__21 (void) @@ -999,7 +999,7 @@ static void Body__17 (void) OPT_Node procdec = NIL, statseq = NIL; int32 c; c = OPM_errpos; - (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1,32); + (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1,64); OPP_CheckSym(39); OPP_Block(&procdec, &statseq); OPB_Enter(&procdec, statseq, *ProcedureDeclaration__16_s->proc); @@ -1042,7 +1042,7 @@ static void TProcDecl__23 (void) if ((*ProcedureDeclaration__16_s->fwd != NIL && (*ProcedureDeclaration__16_s->fwd)->mnolev != OPP_level)) { *ProcedureDeclaration__16_s->fwd = NIL; } - if ((((*ProcedureDeclaration__16_s->fwd != NIL && (*ProcedureDeclaration__16_s->fwd)->mode == 13)) && !__IN(1, (*ProcedureDeclaration__16_s->fwd)->conval->setval, 32))) { + if ((((*ProcedureDeclaration__16_s->fwd != NIL && (*ProcedureDeclaration__16_s->fwd)->mode == 13)) && !__IN(1, (*ProcedureDeclaration__16_s->fwd)->conval->setval, 64))) { *ProcedureDeclaration__16_s->proc = OPT_NewObj(); (*ProcedureDeclaration__16_s->proc)->leaf = 1; if ((*ProcedureDeclaration__16_s->fwd)->vis != *ProcedureDeclaration__16_s->vis) { @@ -1076,7 +1076,7 @@ static void TProcDecl__23 (void) if ((((((baseProc->vis == 1 && (*ProcedureDeclaration__16_s->proc)->vis == 0)) && recTyp->strobj != NIL)) && recTyp->strobj->vis == 1)) { OPP_err(109); } - (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(2,32); + (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(2,64); } if (!*ProcedureDeclaration__16_s->forward) { Body__17(); @@ -1136,7 +1136,7 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) if ((fwd != NIL && (fwd->mnolev != OPP_level || fwd->mode == 8))) { fwd = NIL; } - if ((((fwd != NIL && __IN(fwd->mode, 0xc0, 32))) && !__IN(1, fwd->conval->setval, 32))) { + if ((((fwd != NIL && __IN(fwd->mode, 0xc0, 32))) && !__IN(1, fwd->conval->setval, 64))) { proc = OPT_NewObj(); proc->leaf = 1; if (fwd->vis != vis) { diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 5bfcda58..930f9138 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -20,7 +20,7 @@ typedef OPT_ConstExt ext; int64 intval; int32 intval2; - uint32 setval; + uint64 setval; LONGREAL realval; } OPT_ConstDesc; @@ -2008,7 +2008,7 @@ static void EnumPtrs(void (*P)(void*)) __ENUMR(&OPT_impCtxt, OPT_ImpCtxt__typ, 3140, 1, P); } -__TDESC(OPT_ConstDesc, 1, 1) = {__TDFLDS("ConstDesc", 32), {0, -8}}; +__TDESC(OPT_ConstDesc, 1, 1) = {__TDFLDS("ConstDesc", 40), {0, -8}}; __TDESC(OPT_ObjDesc, 1, 6) = {__TDFLDS("ObjDesc", 304), {0, 4, 8, 12, 284, 288, -28}}; __TDESC(OPT_StrDesc, 1, 3) = {__TDFLDS("StrDesc", 56), {44, 48, 52, -16}}; __TDESC(OPT_NodeDesc, 1, 6) = {__TDFLDS("NodeDesc", 28), {0, 4, 8, 16, 20, 24, -28}}; diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index 2bc05576..624d4fe0 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -17,7 +17,7 @@ typedef OPT_ConstExt ext; int64 intval; int32 intval2; - uint32 setval; + uint64 setval; LONGREAL realval; } OPT_ConstDesc; diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index 99e7aa6a..a07e28a6 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -72,7 +72,7 @@ static void OPV_GetTProcNum (OPT_Object obj) OPT_FindField(obj->name, typ->BaseTyp, &redef); if (redef != NIL) { obj->adr = __ASHL(__ASHR(redef->adr, 16), 16); - if (!__IN(2, obj->conval->setval, 32)) { + if (!__IN(2, obj->conval->setval, 64)) { OPM_err(119); } } else { diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index 0b88b1ea..43c9e328 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -471,7 +471,7 @@ void OPB_In (OPT_Node *x, OPT_Node y) if (k < 0 || k > (int64)OPM_MaxSet) { OPB_err(202); } else if (y->class == 7) { - (*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval, 32)); + (*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval, 64)); (*x)->obj = NIL; } else { OPB_BindNodes(12, OPT_booltyp, &*x, y); @@ -2483,7 +2483,7 @@ void OPB_StaticLink (int8 dlev) scope = OPT_topScope; while (dlev > 0) { dlev -= 1; - scope->link->conval->setval |= __SETOF(3,32); + scope->link->conval->setval |= __SETOF(3,64); scope = scope->left; } } diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 41d574f6..e894697a 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -53,7 +53,7 @@ export void OPM_DeleteNewSym (void); export void OPM_FPrint (int32 *fp, int64 val); export void OPM_FPrintLReal (int32 *fp, LONGREAL lr); export void OPM_FPrintReal (int32 *fp, REAL real); -export void OPM_FPrintSet (int32 *fp, uint32 set); +export void OPM_FPrintSet (int32 *fp, uint64 set); static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 pos); export void OPM_Get (CHAR *ch); export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); @@ -81,12 +81,12 @@ export int32 OPM_SymRInt (void); export int64 OPM_SymRInt64 (void); export void OPM_SymRLReal (LONGREAL *lr); export void OPM_SymRReal (REAL *r); -export void OPM_SymRSet (uint32 *s); +export void OPM_SymRSet (uint64 *s); export void OPM_SymWCh (CHAR ch); export void OPM_SymWInt (int64 i); export void OPM_SymWLReal (LONGREAL lr); export void OPM_SymWReal (REAL r); -export void OPM_SymWSet (uint32 s); +export void OPM_SymWSet (uint64 s); static void OPM_VerboseListSizes (void); export void OPM_Write (CHAR ch); export void OPM_WriteHex (int64 i); @@ -713,9 +713,9 @@ void OPM_FPrint (int32 *fp, int64 val) *fp = __ROTL((int32)((uint32)*fp ^ __VAL(uint32, val)), 1, 32); } -void OPM_FPrintSet (int32 *fp, uint32 set) +void OPM_FPrintSet (int32 *fp, uint64 set) { - OPM_FPrint(&*fp, (int32)set); + OPM_FPrint(&*fp, __VAL(int32, set)); } void OPM_FPrintReal (int32 *fp, REAL real) @@ -758,9 +758,9 @@ int64 OPM_SymRInt64 (void) return _o_result; } -void OPM_SymRSet (uint32 *s) +void OPM_SymRSet (uint64 *s) { - Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&*s, 4); + Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&*s, 8); } void OPM_SymRReal (REAL *r) @@ -812,9 +812,9 @@ void OPM_SymWInt (int64 i) Files_WriteNum(&OPM_newSF, Files_Rider__typ, i); } -void OPM_SymWSet (uint32 s) +void OPM_SymWSet (uint64 s) { - Files_WriteNum(&OPM_newSF, Files_Rider__typ, (int32)s); + Files_WriteNum(&OPM_newSF, Files_Rider__typ, (int64)s); } void OPM_SymWReal (REAL r) diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index dd3c0c27..aec6ed54 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -26,7 +26,7 @@ import void OPM_DeleteNewSym (void); import void OPM_FPrint (int32 *fp, int64 val); import void OPM_FPrintLReal (int32 *fp, LONGREAL lr); import void OPM_FPrintReal (int32 *fp, REAL real); -import void OPM_FPrintSet (int32 *fp, uint32 set); +import void OPM_FPrintSet (int32 *fp, uint64 set); import void OPM_Get (CHAR *ch); import void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); import void OPM_InitOptions (void); @@ -49,12 +49,12 @@ import int32 OPM_SymRInt (void); import int64 OPM_SymRInt64 (void); import void OPM_SymRLReal (LONGREAL *lr); import void OPM_SymRReal (REAL *r); -import void OPM_SymRSet (uint32 *s); +import void OPM_SymRSet (uint64 *s); import void OPM_SymWCh (CHAR ch); import void OPM_SymWInt (int64 i); import void OPM_SymWLReal (LONGREAL lr); import void OPM_SymWReal (REAL r); -import void OPM_SymWSet (uint32 s); +import void OPM_SymWSet (uint64 s); import void OPM_Write (CHAR ch); import void OPM_WriteHex (int64 i); import void OPM_WriteInt (int64 i); diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index 6bfd4b38..4aa1322a 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -967,7 +967,7 @@ static void GetCode__19 (void) } } } - (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1,32); + (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1,64); } static void GetParams__21 (void) @@ -999,7 +999,7 @@ static void Body__17 (void) OPT_Node procdec = NIL, statseq = NIL; int32 c; c = OPM_errpos; - (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1,32); + (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1,64); OPP_CheckSym(39); OPP_Block(&procdec, &statseq); OPB_Enter(&procdec, statseq, *ProcedureDeclaration__16_s->proc); @@ -1042,7 +1042,7 @@ static void TProcDecl__23 (void) if ((*ProcedureDeclaration__16_s->fwd != NIL && (*ProcedureDeclaration__16_s->fwd)->mnolev != OPP_level)) { *ProcedureDeclaration__16_s->fwd = NIL; } - if ((((*ProcedureDeclaration__16_s->fwd != NIL && (*ProcedureDeclaration__16_s->fwd)->mode == 13)) && !__IN(1, (*ProcedureDeclaration__16_s->fwd)->conval->setval, 32))) { + if ((((*ProcedureDeclaration__16_s->fwd != NIL && (*ProcedureDeclaration__16_s->fwd)->mode == 13)) && !__IN(1, (*ProcedureDeclaration__16_s->fwd)->conval->setval, 64))) { *ProcedureDeclaration__16_s->proc = OPT_NewObj(); (*ProcedureDeclaration__16_s->proc)->leaf = 1; if ((*ProcedureDeclaration__16_s->fwd)->vis != *ProcedureDeclaration__16_s->vis) { @@ -1076,7 +1076,7 @@ static void TProcDecl__23 (void) if ((((((baseProc->vis == 1 && (*ProcedureDeclaration__16_s->proc)->vis == 0)) && recTyp->strobj != NIL)) && recTyp->strobj->vis == 1)) { OPP_err(109); } - (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(2,32); + (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(2,64); } if (!*ProcedureDeclaration__16_s->forward) { Body__17(); @@ -1136,7 +1136,7 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) if ((fwd != NIL && (fwd->mnolev != OPP_level || fwd->mode == 8))) { fwd = NIL; } - if ((((fwd != NIL && __IN(fwd->mode, 0xc0, 32))) && !__IN(1, fwd->conval->setval, 32))) { + if ((((fwd != NIL && __IN(fwd->mode, 0xc0, 32))) && !__IN(1, fwd->conval->setval, 64))) { proc = OPT_NewObj(); proc->leaf = 1; if (fwd->vis != vis) { diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index 98ef4a7f..c3766e15 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -20,7 +20,7 @@ typedef OPT_ConstExt ext; int64 intval; int32 intval2; - uint32 setval; + uint64 setval; LONGREAL realval; } OPT_ConstDesc; @@ -2008,7 +2008,7 @@ static void EnumPtrs(void (*P)(void*)) __ENUMR(&OPT_impCtxt, OPT_ImpCtxt__typ, 5184, 1, P); } -__TDESC(OPT_ConstDesc, 1, 1) = {__TDFLDS("ConstDesc", 32), {0, -16}}; +__TDESC(OPT_ConstDesc, 1, 1) = {__TDFLDS("ConstDesc", 40), {0, -16}}; __TDESC(OPT_ObjDesc, 1, 6) = {__TDFLDS("ObjDesc", 336), {0, 8, 16, 24, 304, 312, -56}}; __TDESC(OPT_StrDesc, 1, 3) = {__TDFLDS("StrDesc", 72), {48, 56, 64, -32}}; __TDESC(OPT_NodeDesc, 1, 6) = {__TDFLDS("NodeDesc", 56), {0, 8, 16, 32, 40, 48, -56}}; diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 2bc05576..624d4fe0 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -17,7 +17,7 @@ typedef OPT_ConstExt ext; int64 intval; int32 intval2; - uint32 setval; + uint64 setval; LONGREAL realval; } OPT_ConstDesc; diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 5171284e..4657f6d3 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -72,7 +72,7 @@ static void OPV_GetTProcNum (OPT_Object obj) OPT_FindField(obj->name, typ->BaseTyp, &redef); if (redef != NIL) { obj->adr = __ASHL(__ASHR(redef->adr, 16), 16); - if (!__IN(2, obj->conval->setval, 32)) { + if (!__IN(2, obj->conval->setval, 64)) { OPM_err(119); } } else { diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index 0b88b1ea..43c9e328 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -471,7 +471,7 @@ void OPB_In (OPT_Node *x, OPT_Node y) if (k < 0 || k > (int64)OPM_MaxSet) { OPB_err(202); } else if (y->class == 7) { - (*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval, 32)); + (*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval, 64)); (*x)->obj = NIL; } else { OPB_BindNodes(12, OPT_booltyp, &*x, y); @@ -2483,7 +2483,7 @@ void OPB_StaticLink (int8 dlev) scope = OPT_topScope; while (dlev > 0) { dlev -= 1; - scope->link->conval->setval |= __SETOF(3,32); + scope->link->conval->setval |= __SETOF(3,64); scope = scope->left; } } diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 1ef195b4..b77fcb9c 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -53,7 +53,7 @@ export void OPM_DeleteNewSym (void); export void OPM_FPrint (int32 *fp, int64 val); export void OPM_FPrintLReal (int32 *fp, LONGREAL lr); export void OPM_FPrintReal (int32 *fp, REAL real); -export void OPM_FPrintSet (int32 *fp, uint32 set); +export void OPM_FPrintSet (int32 *fp, uint64 set); static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 pos); export void OPM_Get (CHAR *ch); export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); @@ -81,12 +81,12 @@ export int32 OPM_SymRInt (void); export int64 OPM_SymRInt64 (void); export void OPM_SymRLReal (LONGREAL *lr); export void OPM_SymRReal (REAL *r); -export void OPM_SymRSet (uint32 *s); +export void OPM_SymRSet (uint64 *s); export void OPM_SymWCh (CHAR ch); export void OPM_SymWInt (int64 i); export void OPM_SymWLReal (LONGREAL lr); export void OPM_SymWReal (REAL r); -export void OPM_SymWSet (uint32 s); +export void OPM_SymWSet (uint64 s); static void OPM_VerboseListSizes (void); export void OPM_Write (CHAR ch); export void OPM_WriteHex (int64 i); @@ -713,9 +713,9 @@ void OPM_FPrint (int32 *fp, int64 val) *fp = __ROTL((int32)((uint32)*fp ^ __VAL(uint32, val)), 1, 32); } -void OPM_FPrintSet (int32 *fp, uint32 set) +void OPM_FPrintSet (int32 *fp, uint64 set) { - OPM_FPrint(&*fp, (int32)set); + OPM_FPrint(&*fp, __VAL(int32, set)); } void OPM_FPrintReal (int32 *fp, REAL real) @@ -758,9 +758,9 @@ int64 OPM_SymRInt64 (void) return _o_result; } -void OPM_SymRSet (uint32 *s) +void OPM_SymRSet (uint64 *s) { - Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&*s, 4); + Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&*s, 8); } void OPM_SymRReal (REAL *r) @@ -812,9 +812,9 @@ void OPM_SymWInt (int64 i) Files_WriteNum(&OPM_newSF, Files_Rider__typ, i); } -void OPM_SymWSet (uint32 s) +void OPM_SymWSet (uint64 s) { - Files_WriteNum(&OPM_newSF, Files_Rider__typ, (int32)s); + Files_WriteNum(&OPM_newSF, Files_Rider__typ, (int64)s); } void OPM_SymWReal (REAL r) diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index dd3c0c27..aec6ed54 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -26,7 +26,7 @@ import void OPM_DeleteNewSym (void); import void OPM_FPrint (int32 *fp, int64 val); import void OPM_FPrintLReal (int32 *fp, LONGREAL lr); import void OPM_FPrintReal (int32 *fp, REAL real); -import void OPM_FPrintSet (int32 *fp, uint32 set); +import void OPM_FPrintSet (int32 *fp, uint64 set); import void OPM_Get (CHAR *ch); import void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); import void OPM_InitOptions (void); @@ -49,12 +49,12 @@ import int32 OPM_SymRInt (void); import int64 OPM_SymRInt64 (void); import void OPM_SymRLReal (LONGREAL *lr); import void OPM_SymRReal (REAL *r); -import void OPM_SymRSet (uint32 *s); +import void OPM_SymRSet (uint64 *s); import void OPM_SymWCh (CHAR ch); import void OPM_SymWInt (int64 i); import void OPM_SymWLReal (LONGREAL lr); import void OPM_SymWReal (REAL r); -import void OPM_SymWSet (uint32 s); +import void OPM_SymWSet (uint64 s); import void OPM_Write (CHAR ch); import void OPM_WriteHex (int64 i); import void OPM_WriteInt (int64 i); diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index 1eff447d..d4bdcf39 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -967,7 +967,7 @@ static void GetCode__19 (void) } } } - (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1,32); + (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1,64); } static void GetParams__21 (void) @@ -999,7 +999,7 @@ static void Body__17 (void) OPT_Node procdec = NIL, statseq = NIL; int32 c; c = OPM_errpos; - (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1,32); + (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1,64); OPP_CheckSym(39); OPP_Block(&procdec, &statseq); OPB_Enter(&procdec, statseq, *ProcedureDeclaration__16_s->proc); @@ -1042,7 +1042,7 @@ static void TProcDecl__23 (void) if ((*ProcedureDeclaration__16_s->fwd != NIL && (*ProcedureDeclaration__16_s->fwd)->mnolev != OPP_level)) { *ProcedureDeclaration__16_s->fwd = NIL; } - if ((((*ProcedureDeclaration__16_s->fwd != NIL && (*ProcedureDeclaration__16_s->fwd)->mode == 13)) && !__IN(1, (*ProcedureDeclaration__16_s->fwd)->conval->setval, 32))) { + if ((((*ProcedureDeclaration__16_s->fwd != NIL && (*ProcedureDeclaration__16_s->fwd)->mode == 13)) && !__IN(1, (*ProcedureDeclaration__16_s->fwd)->conval->setval, 64))) { *ProcedureDeclaration__16_s->proc = OPT_NewObj(); (*ProcedureDeclaration__16_s->proc)->leaf = 1; if ((*ProcedureDeclaration__16_s->fwd)->vis != *ProcedureDeclaration__16_s->vis) { @@ -1076,7 +1076,7 @@ static void TProcDecl__23 (void) if ((((((baseProc->vis == 1 && (*ProcedureDeclaration__16_s->proc)->vis == 0)) && recTyp->strobj != NIL)) && recTyp->strobj->vis == 1)) { OPP_err(109); } - (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(2,32); + (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(2,64); } if (!*ProcedureDeclaration__16_s->forward) { Body__17(); @@ -1136,7 +1136,7 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) if ((fwd != NIL && (fwd->mnolev != OPP_level || fwd->mode == 8))) { fwd = NIL; } - if ((((fwd != NIL && __IN(fwd->mode, 0xc0, 32))) && !__IN(1, fwd->conval->setval, 32))) { + if ((((fwd != NIL && __IN(fwd->mode, 0xc0, 32))) && !__IN(1, fwd->conval->setval, 64))) { proc = OPT_NewObj(); proc->leaf = 1; if (fwd->vis != vis) { diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 5bfcda58..930f9138 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -20,7 +20,7 @@ typedef OPT_ConstExt ext; int64 intval; int32 intval2; - uint32 setval; + uint64 setval; LONGREAL realval; } OPT_ConstDesc; @@ -2008,7 +2008,7 @@ static void EnumPtrs(void (*P)(void*)) __ENUMR(&OPT_impCtxt, OPT_ImpCtxt__typ, 3140, 1, P); } -__TDESC(OPT_ConstDesc, 1, 1) = {__TDFLDS("ConstDesc", 32), {0, -8}}; +__TDESC(OPT_ConstDesc, 1, 1) = {__TDFLDS("ConstDesc", 40), {0, -8}}; __TDESC(OPT_ObjDesc, 1, 6) = {__TDFLDS("ObjDesc", 304), {0, 4, 8, 12, 284, 288, -28}}; __TDESC(OPT_StrDesc, 1, 3) = {__TDFLDS("StrDesc", 56), {44, 48, 52, -16}}; __TDESC(OPT_NodeDesc, 1, 6) = {__TDFLDS("NodeDesc", 28), {0, 4, 8, 16, 20, 24, -28}}; diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index 2bc05576..624d4fe0 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -17,7 +17,7 @@ typedef OPT_ConstExt ext; int64 intval; int32 intval2; - uint32 setval; + uint64 setval; LONGREAL realval; } OPT_ConstDesc; diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index 99e7aa6a..a07e28a6 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -72,7 +72,7 @@ static void OPV_GetTProcNum (OPT_Object obj) OPT_FindField(obj->name, typ->BaseTyp, &redef); if (redef != NIL) { obj->adr = __ASHL(__ASHR(redef->adr, 16), 16); - if (!__IN(2, obj->conval->setval, 32)) { + if (!__IN(2, obj->conval->setval, 64)) { OPM_err(119); } } else { diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index 0b88b1ea..43c9e328 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -471,7 +471,7 @@ void OPB_In (OPT_Node *x, OPT_Node y) if (k < 0 || k > (int64)OPM_MaxSet) { OPB_err(202); } else if (y->class == 7) { - (*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval, 32)); + (*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval, 64)); (*x)->obj = NIL; } else { OPB_BindNodes(12, OPT_booltyp, &*x, y); @@ -2483,7 +2483,7 @@ void OPB_StaticLink (int8 dlev) scope = OPT_topScope; while (dlev > 0) { dlev -= 1; - scope->link->conval->setval |= __SETOF(3,32); + scope->link->conval->setval |= __SETOF(3,64); scope = scope->left; } } diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 41d574f6..e894697a 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -53,7 +53,7 @@ export void OPM_DeleteNewSym (void); export void OPM_FPrint (int32 *fp, int64 val); export void OPM_FPrintLReal (int32 *fp, LONGREAL lr); export void OPM_FPrintReal (int32 *fp, REAL real); -export void OPM_FPrintSet (int32 *fp, uint32 set); +export void OPM_FPrintSet (int32 *fp, uint64 set); static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 pos); export void OPM_Get (CHAR *ch); export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); @@ -81,12 +81,12 @@ export int32 OPM_SymRInt (void); export int64 OPM_SymRInt64 (void); export void OPM_SymRLReal (LONGREAL *lr); export void OPM_SymRReal (REAL *r); -export void OPM_SymRSet (uint32 *s); +export void OPM_SymRSet (uint64 *s); export void OPM_SymWCh (CHAR ch); export void OPM_SymWInt (int64 i); export void OPM_SymWLReal (LONGREAL lr); export void OPM_SymWReal (REAL r); -export void OPM_SymWSet (uint32 s); +export void OPM_SymWSet (uint64 s); static void OPM_VerboseListSizes (void); export void OPM_Write (CHAR ch); export void OPM_WriteHex (int64 i); @@ -713,9 +713,9 @@ void OPM_FPrint (int32 *fp, int64 val) *fp = __ROTL((int32)((uint32)*fp ^ __VAL(uint32, val)), 1, 32); } -void OPM_FPrintSet (int32 *fp, uint32 set) +void OPM_FPrintSet (int32 *fp, uint64 set) { - OPM_FPrint(&*fp, (int32)set); + OPM_FPrint(&*fp, __VAL(int32, set)); } void OPM_FPrintReal (int32 *fp, REAL real) @@ -758,9 +758,9 @@ int64 OPM_SymRInt64 (void) return _o_result; } -void OPM_SymRSet (uint32 *s) +void OPM_SymRSet (uint64 *s) { - Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&*s, 4); + Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&*s, 8); } void OPM_SymRReal (REAL *r) @@ -812,9 +812,9 @@ void OPM_SymWInt (int64 i) Files_WriteNum(&OPM_newSF, Files_Rider__typ, i); } -void OPM_SymWSet (uint32 s) +void OPM_SymWSet (uint64 s) { - Files_WriteNum(&OPM_newSF, Files_Rider__typ, (int32)s); + Files_WriteNum(&OPM_newSF, Files_Rider__typ, (int64)s); } void OPM_SymWReal (REAL r) diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index dd3c0c27..aec6ed54 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -26,7 +26,7 @@ import void OPM_DeleteNewSym (void); import void OPM_FPrint (int32 *fp, int64 val); import void OPM_FPrintLReal (int32 *fp, LONGREAL lr); import void OPM_FPrintReal (int32 *fp, REAL real); -import void OPM_FPrintSet (int32 *fp, uint32 set); +import void OPM_FPrintSet (int32 *fp, uint64 set); import void OPM_Get (CHAR *ch); import void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); import void OPM_InitOptions (void); @@ -49,12 +49,12 @@ import int32 OPM_SymRInt (void); import int64 OPM_SymRInt64 (void); import void OPM_SymRLReal (LONGREAL *lr); import void OPM_SymRReal (REAL *r); -import void OPM_SymRSet (uint32 *s); +import void OPM_SymRSet (uint64 *s); import void OPM_SymWCh (CHAR ch); import void OPM_SymWInt (int64 i); import void OPM_SymWLReal (LONGREAL lr); import void OPM_SymWReal (REAL r); -import void OPM_SymWSet (uint32 s); +import void OPM_SymWSet (uint64 s); import void OPM_Write (CHAR ch); import void OPM_WriteHex (int64 i); import void OPM_WriteInt (int64 i); diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index 6bfd4b38..4aa1322a 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -967,7 +967,7 @@ static void GetCode__19 (void) } } } - (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1,32); + (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1,64); } static void GetParams__21 (void) @@ -999,7 +999,7 @@ static void Body__17 (void) OPT_Node procdec = NIL, statseq = NIL; int32 c; c = OPM_errpos; - (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1,32); + (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1,64); OPP_CheckSym(39); OPP_Block(&procdec, &statseq); OPB_Enter(&procdec, statseq, *ProcedureDeclaration__16_s->proc); @@ -1042,7 +1042,7 @@ static void TProcDecl__23 (void) if ((*ProcedureDeclaration__16_s->fwd != NIL && (*ProcedureDeclaration__16_s->fwd)->mnolev != OPP_level)) { *ProcedureDeclaration__16_s->fwd = NIL; } - if ((((*ProcedureDeclaration__16_s->fwd != NIL && (*ProcedureDeclaration__16_s->fwd)->mode == 13)) && !__IN(1, (*ProcedureDeclaration__16_s->fwd)->conval->setval, 32))) { + if ((((*ProcedureDeclaration__16_s->fwd != NIL && (*ProcedureDeclaration__16_s->fwd)->mode == 13)) && !__IN(1, (*ProcedureDeclaration__16_s->fwd)->conval->setval, 64))) { *ProcedureDeclaration__16_s->proc = OPT_NewObj(); (*ProcedureDeclaration__16_s->proc)->leaf = 1; if ((*ProcedureDeclaration__16_s->fwd)->vis != *ProcedureDeclaration__16_s->vis) { @@ -1076,7 +1076,7 @@ static void TProcDecl__23 (void) if ((((((baseProc->vis == 1 && (*ProcedureDeclaration__16_s->proc)->vis == 0)) && recTyp->strobj != NIL)) && recTyp->strobj->vis == 1)) { OPP_err(109); } - (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(2,32); + (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(2,64); } if (!*ProcedureDeclaration__16_s->forward) { Body__17(); @@ -1136,7 +1136,7 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) if ((fwd != NIL && (fwd->mnolev != OPP_level || fwd->mode == 8))) { fwd = NIL; } - if ((((fwd != NIL && __IN(fwd->mode, 0xc0, 32))) && !__IN(1, fwd->conval->setval, 32))) { + if ((((fwd != NIL && __IN(fwd->mode, 0xc0, 32))) && !__IN(1, fwd->conval->setval, 64))) { proc = OPT_NewObj(); proc->leaf = 1; if (fwd->vis != vis) { diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index 98ef4a7f..c3766e15 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -20,7 +20,7 @@ typedef OPT_ConstExt ext; int64 intval; int32 intval2; - uint32 setval; + uint64 setval; LONGREAL realval; } OPT_ConstDesc; @@ -2008,7 +2008,7 @@ static void EnumPtrs(void (*P)(void*)) __ENUMR(&OPT_impCtxt, OPT_ImpCtxt__typ, 5184, 1, P); } -__TDESC(OPT_ConstDesc, 1, 1) = {__TDFLDS("ConstDesc", 32), {0, -16}}; +__TDESC(OPT_ConstDesc, 1, 1) = {__TDFLDS("ConstDesc", 40), {0, -16}}; __TDESC(OPT_ObjDesc, 1, 6) = {__TDFLDS("ObjDesc", 336), {0, 8, 16, 24, 304, 312, -56}}; __TDESC(OPT_StrDesc, 1, 3) = {__TDFLDS("StrDesc", 72), {48, 56, 64, -32}}; __TDESC(OPT_NodeDesc, 1, 6) = {__TDFLDS("NodeDesc", 56), {0, 8, 16, 32, 40, 48, -56}}; diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 2bc05576..624d4fe0 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -17,7 +17,7 @@ typedef OPT_ConstExt ext; int64 intval; int32 intval2; - uint32 setval; + uint64 setval; LONGREAL realval; } OPT_ConstDesc; diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 5171284e..4657f6d3 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -72,7 +72,7 @@ static void OPV_GetTProcNum (OPT_Object obj) OPT_FindField(obj->name, typ->BaseTyp, &redef); if (redef != NIL) { obj->adr = __ASHL(__ASHR(redef->adr, 16), 16); - if (!__IN(2, obj->conval->setval, 32)) { + if (!__IN(2, obj->conval->setval, 64)) { OPM_err(119); } } else { diff --git a/src/compiler/OPM.Mod b/src/compiler/OPM.Mod index a18953a7..1af3cde7 100644 --- a/src/compiler/OPM.Mod +++ b/src/compiler/OPM.Mod @@ -552,7 +552,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) END FPrint; - PROCEDURE FPrintSet*(VAR fp: LONGINT; set: SET); (*SYSTEM.SET64);*) + PROCEDURE FPrintSet*(VAR fp: LONGINT; set: SYSTEM.SET64); BEGIN FPrint(fp, SYSTEM.VAL(LONGINT, set)) END FPrintSet; @@ -603,7 +603,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) BEGIN Files.ReadNum(oldSF, k); RETURN k END SymRInt64; - PROCEDURE SymRSet*(VAR s: SET); (*SYSTEM.SET64);*) + PROCEDURE SymRSet*(VAR s: SYSTEM.SET64); BEGIN Files.ReadNum(oldSF, s) END SymRSet; @@ -648,15 +648,9 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) BEGIN Files.WriteNum(newSF, i) END SymWInt; - (* PROCEDURE SymWSet*(s: SYSTEM.SET64); BEGIN Files.WriteNum(newSF, SYSTEM.VAL(SYSTEM.INT64, s)) END SymWSet; - *) - - PROCEDURE SymWSet*(s: SET); - BEGIN Files.WriteNum(newSF, SYSTEM.VAL(LONGINT, s)) - END SymWSet; PROCEDURE SymWReal*(r: REAL); BEGIN Files.WriteReal(newSF, r) diff --git a/src/compiler/OPT.Mod b/src/compiler/OPT.Mod index a3960ac2..93db3e5e 100644 --- a/src/compiler/OPT.Mod +++ b/src/compiler/OPT.Mod @@ -15,8 +15,7 @@ TYPE ext*: ConstExt; (* string or code for code proc *) intval*: SYSTEM.INT64; (* constant value or adr, proc par size, text position or least case label *) intval2*: LONGINT; (* string length, proc var size or larger case label *) - (*setval*: SYSTEM.SET64;*) (* constant value, procedure body present or "ELSE" present in case *) - setval*: SET; (* constant value, procedure body present or "ELSE" present in case *) + setval*: SYSTEM.SET64; (* constant value, procedure body present or "ELSE" present in case *) realval*: LONGREAL (* real or longreal constant value *) END; diff --git a/src/test/confidence/planned-binary-change b/src/test/confidence/planned-binary-change index 0a38b805..0e593b78 100644 --- a/src/test/confidence/planned-binary-change +++ b/src/test/confidence/planned-binary-change @@ -1 +1 @@ -25 Sep 2016 15:50:01 +30 Sep 2016 18:58:19 From d344c9ce807581c6894eb5e87dc3f1ab10837fd9 Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 30 Sep 2016 20:30:58 +0100 Subject: [PATCH 266/580] Set size testing and constant size propagation. --- bootstrap/unix-44/OPB.c | 26 ++++++++++++++------- bootstrap/unix-44/OPC.c | 4 ++-- bootstrap/unix-48/OPB.c | 26 ++++++++++++++------- bootstrap/unix-48/OPC.c | 4 ++-- bootstrap/unix-88/OPB.c | 26 ++++++++++++++------- bootstrap/unix-88/OPC.c | 4 ++-- bootstrap/windows-48/OPB.c | 26 ++++++++++++++------- bootstrap/windows-48/OPC.c | 4 ++-- bootstrap/windows-88/OPB.c | 26 ++++++++++++++------- bootstrap/windows-88/OPC.c | 4 ++-- src/compiler/OPB.Mod | 39 ++++++++++++++++++-------------- src/compiler/OPC.Mod | 4 ++-- src/tools/browser/BrowserCmd.Mod | 4 ++-- 13 files changed, 126 insertions(+), 71 deletions(-) diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index 43c9e328..61ddc369 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -468,7 +468,7 @@ void OPB_In (OPT_Node *x, OPT_Node y) } else if ((f == 4 && y->typ->form == 7)) { if ((*x)->class == 7) { k = (*x)->conval->intval; - if (k < 0 || k > (int64)OPM_MaxSet) { + if (k < 0 || k >= (int64)__ASHL(y->typ->size, 3)) { OPB_err(202); } else if (y->class == 7) { (*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval, 64)); @@ -584,7 +584,11 @@ void OPB_MOp (int8 op, OPT_Node *x) } else if (__IN(f, 0x60, 32)) { z->conval->realval = -z->conval->realval; } else { - z->conval->setval = ~z->conval->setval; + if (z->typ->size == 8) { + z->conval->setval = ~z->conval->setval; + } else { + z->conval->setval = z->conval->setval ^ 0xffffffff; + } } z->obj = NIL; } else { @@ -959,6 +963,7 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) } } else if (f == 7) { xval->setval = (xval->setval & yval->setval); + OPB_SetSetType(x); } else if (f != 0) { OPB_err(101); } @@ -983,6 +988,7 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) } } else if (f == 7) { xval->setval = xval->setval ^ yval->setval; + OPB_SetSetType(x); } else if (f != 0) { OPB_err(102); } @@ -1037,6 +1043,7 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) } } else if (f == 7) { xval->setval = xval->setval | yval->setval; + OPB_SetSetType(x); } else if (f != 0) { OPB_err(105); } @@ -1059,6 +1066,7 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) } } else if (f == 7) { xval->setval = (xval->setval & ~yval->setval); + OPB_SetSetType(x); } else if (f != 0) { OPB_err(106); } @@ -1514,19 +1522,20 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y) } else if (((*x)->typ->form == 4 && y->typ->form == 4)) { if ((*x)->class == 7) { k = (*x)->conval->intval; - if (0 > k || k > (int64)OPM_MaxSet) { + if (0 > k || k > 31) { OPB_err(202); } } if (y->class == 7) { l = y->conval->intval; - if (0 > l || l > (int64)OPM_MaxSet) { + if (0 > l || l > 31) { OPB_err(202); } } if (((*x)->class == 7 && y->class == 7)) { if (k <= l) { (*x)->conval->setval = __SETRNG(k, l, 32); + OPB_SetSetType(*x); } else { OPB_err(201); (*x)->conval->setval = __SETRNG(l, k, 32); @@ -1550,8 +1559,9 @@ void OPB_SetElem (OPT_Node *x) OPB_err(93); } else if ((*x)->class == 7) { k = (*x)->conval->intval; - if ((0 <= k && k <= (int64)OPM_MaxSet)) { + if ((0 <= k && k <= 31)) { (*x)->conval->setval = __SETOF(k,32); + OPB_SetSetType(*x); } else { OPB_err(202); } @@ -1581,13 +1591,13 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPB_err(113); } break; - case 2: case 3: case 7: + case 2: case 3: if (g != f) { OPB_err(113); } break; - case 4: - if (g != 4 || x->size < y->size) { + case 4: case 7: + if (g != f || x->size < y->size) { OPB_err(113); } break; diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 545deb33..5a228db9 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1859,7 +1859,7 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim) void OPC_Constant (OPT_Const con, int16 form) { int16 i; - uint32 s; + uint64 s; int32 hex; BOOLEAN skipLeading; switch (form) { @@ -1891,7 +1891,7 @@ void OPC_Constant (OPT_Const con, int16 form) do { i -= 1; hex = __ASHL(hex, 1); - if (__IN(i, s, 32)) { + if (__IN(i, s, 64)) { hex += 1; } } while (!(__MASK(i, -8) == 0)); diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index 43c9e328..61ddc369 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -468,7 +468,7 @@ void OPB_In (OPT_Node *x, OPT_Node y) } else if ((f == 4 && y->typ->form == 7)) { if ((*x)->class == 7) { k = (*x)->conval->intval; - if (k < 0 || k > (int64)OPM_MaxSet) { + if (k < 0 || k >= (int64)__ASHL(y->typ->size, 3)) { OPB_err(202); } else if (y->class == 7) { (*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval, 64)); @@ -584,7 +584,11 @@ void OPB_MOp (int8 op, OPT_Node *x) } else if (__IN(f, 0x60, 32)) { z->conval->realval = -z->conval->realval; } else { - z->conval->setval = ~z->conval->setval; + if (z->typ->size == 8) { + z->conval->setval = ~z->conval->setval; + } else { + z->conval->setval = z->conval->setval ^ 0xffffffff; + } } z->obj = NIL; } else { @@ -959,6 +963,7 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) } } else if (f == 7) { xval->setval = (xval->setval & yval->setval); + OPB_SetSetType(x); } else if (f != 0) { OPB_err(101); } @@ -983,6 +988,7 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) } } else if (f == 7) { xval->setval = xval->setval ^ yval->setval; + OPB_SetSetType(x); } else if (f != 0) { OPB_err(102); } @@ -1037,6 +1043,7 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) } } else if (f == 7) { xval->setval = xval->setval | yval->setval; + OPB_SetSetType(x); } else if (f != 0) { OPB_err(105); } @@ -1059,6 +1066,7 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) } } else if (f == 7) { xval->setval = (xval->setval & ~yval->setval); + OPB_SetSetType(x); } else if (f != 0) { OPB_err(106); } @@ -1514,19 +1522,20 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y) } else if (((*x)->typ->form == 4 && y->typ->form == 4)) { if ((*x)->class == 7) { k = (*x)->conval->intval; - if (0 > k || k > (int64)OPM_MaxSet) { + if (0 > k || k > 31) { OPB_err(202); } } if (y->class == 7) { l = y->conval->intval; - if (0 > l || l > (int64)OPM_MaxSet) { + if (0 > l || l > 31) { OPB_err(202); } } if (((*x)->class == 7 && y->class == 7)) { if (k <= l) { (*x)->conval->setval = __SETRNG(k, l, 32); + OPB_SetSetType(*x); } else { OPB_err(201); (*x)->conval->setval = __SETRNG(l, k, 32); @@ -1550,8 +1559,9 @@ void OPB_SetElem (OPT_Node *x) OPB_err(93); } else if ((*x)->class == 7) { k = (*x)->conval->intval; - if ((0 <= k && k <= (int64)OPM_MaxSet)) { + if ((0 <= k && k <= 31)) { (*x)->conval->setval = __SETOF(k,32); + OPB_SetSetType(*x); } else { OPB_err(202); } @@ -1581,13 +1591,13 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPB_err(113); } break; - case 2: case 3: case 7: + case 2: case 3: if (g != f) { OPB_err(113); } break; - case 4: - if (g != 4 || x->size < y->size) { + case 4: case 7: + if (g != f || x->size < y->size) { OPB_err(113); } break; diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 545deb33..5a228db9 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1859,7 +1859,7 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim) void OPC_Constant (OPT_Const con, int16 form) { int16 i; - uint32 s; + uint64 s; int32 hex; BOOLEAN skipLeading; switch (form) { @@ -1891,7 +1891,7 @@ void OPC_Constant (OPT_Const con, int16 form) do { i -= 1; hex = __ASHL(hex, 1); - if (__IN(i, s, 32)) { + if (__IN(i, s, 64)) { hex += 1; } } while (!(__MASK(i, -8) == 0)); diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index 43c9e328..61ddc369 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -468,7 +468,7 @@ void OPB_In (OPT_Node *x, OPT_Node y) } else if ((f == 4 && y->typ->form == 7)) { if ((*x)->class == 7) { k = (*x)->conval->intval; - if (k < 0 || k > (int64)OPM_MaxSet) { + if (k < 0 || k >= (int64)__ASHL(y->typ->size, 3)) { OPB_err(202); } else if (y->class == 7) { (*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval, 64)); @@ -584,7 +584,11 @@ void OPB_MOp (int8 op, OPT_Node *x) } else if (__IN(f, 0x60, 32)) { z->conval->realval = -z->conval->realval; } else { - z->conval->setval = ~z->conval->setval; + if (z->typ->size == 8) { + z->conval->setval = ~z->conval->setval; + } else { + z->conval->setval = z->conval->setval ^ 0xffffffff; + } } z->obj = NIL; } else { @@ -959,6 +963,7 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) } } else if (f == 7) { xval->setval = (xval->setval & yval->setval); + OPB_SetSetType(x); } else if (f != 0) { OPB_err(101); } @@ -983,6 +988,7 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) } } else if (f == 7) { xval->setval = xval->setval ^ yval->setval; + OPB_SetSetType(x); } else if (f != 0) { OPB_err(102); } @@ -1037,6 +1043,7 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) } } else if (f == 7) { xval->setval = xval->setval | yval->setval; + OPB_SetSetType(x); } else if (f != 0) { OPB_err(105); } @@ -1059,6 +1066,7 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) } } else if (f == 7) { xval->setval = (xval->setval & ~yval->setval); + OPB_SetSetType(x); } else if (f != 0) { OPB_err(106); } @@ -1514,19 +1522,20 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y) } else if (((*x)->typ->form == 4 && y->typ->form == 4)) { if ((*x)->class == 7) { k = (*x)->conval->intval; - if (0 > k || k > (int64)OPM_MaxSet) { + if (0 > k || k > 31) { OPB_err(202); } } if (y->class == 7) { l = y->conval->intval; - if (0 > l || l > (int64)OPM_MaxSet) { + if (0 > l || l > 31) { OPB_err(202); } } if (((*x)->class == 7 && y->class == 7)) { if (k <= l) { (*x)->conval->setval = __SETRNG(k, l, 32); + OPB_SetSetType(*x); } else { OPB_err(201); (*x)->conval->setval = __SETRNG(l, k, 32); @@ -1550,8 +1559,9 @@ void OPB_SetElem (OPT_Node *x) OPB_err(93); } else if ((*x)->class == 7) { k = (*x)->conval->intval; - if ((0 <= k && k <= (int64)OPM_MaxSet)) { + if ((0 <= k && k <= 31)) { (*x)->conval->setval = __SETOF(k,32); + OPB_SetSetType(*x); } else { OPB_err(202); } @@ -1581,13 +1591,13 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPB_err(113); } break; - case 2: case 3: case 7: + case 2: case 3: if (g != f) { OPB_err(113); } break; - case 4: - if (g != 4 || x->size < y->size) { + case 4: case 7: + if (g != f || x->size < y->size) { OPB_err(113); } break; diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index 545deb33..5a228db9 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1859,7 +1859,7 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim) void OPC_Constant (OPT_Const con, int16 form) { int16 i; - uint32 s; + uint64 s; int32 hex; BOOLEAN skipLeading; switch (form) { @@ -1891,7 +1891,7 @@ void OPC_Constant (OPT_Const con, int16 form) do { i -= 1; hex = __ASHL(hex, 1); - if (__IN(i, s, 32)) { + if (__IN(i, s, 64)) { hex += 1; } } while (!(__MASK(i, -8) == 0)); diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index 43c9e328..61ddc369 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -468,7 +468,7 @@ void OPB_In (OPT_Node *x, OPT_Node y) } else if ((f == 4 && y->typ->form == 7)) { if ((*x)->class == 7) { k = (*x)->conval->intval; - if (k < 0 || k > (int64)OPM_MaxSet) { + if (k < 0 || k >= (int64)__ASHL(y->typ->size, 3)) { OPB_err(202); } else if (y->class == 7) { (*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval, 64)); @@ -584,7 +584,11 @@ void OPB_MOp (int8 op, OPT_Node *x) } else if (__IN(f, 0x60, 32)) { z->conval->realval = -z->conval->realval; } else { - z->conval->setval = ~z->conval->setval; + if (z->typ->size == 8) { + z->conval->setval = ~z->conval->setval; + } else { + z->conval->setval = z->conval->setval ^ 0xffffffff; + } } z->obj = NIL; } else { @@ -959,6 +963,7 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) } } else if (f == 7) { xval->setval = (xval->setval & yval->setval); + OPB_SetSetType(x); } else if (f != 0) { OPB_err(101); } @@ -983,6 +988,7 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) } } else if (f == 7) { xval->setval = xval->setval ^ yval->setval; + OPB_SetSetType(x); } else if (f != 0) { OPB_err(102); } @@ -1037,6 +1043,7 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) } } else if (f == 7) { xval->setval = xval->setval | yval->setval; + OPB_SetSetType(x); } else if (f != 0) { OPB_err(105); } @@ -1059,6 +1066,7 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) } } else if (f == 7) { xval->setval = (xval->setval & ~yval->setval); + OPB_SetSetType(x); } else if (f != 0) { OPB_err(106); } @@ -1514,19 +1522,20 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y) } else if (((*x)->typ->form == 4 && y->typ->form == 4)) { if ((*x)->class == 7) { k = (*x)->conval->intval; - if (0 > k || k > (int64)OPM_MaxSet) { + if (0 > k || k > 31) { OPB_err(202); } } if (y->class == 7) { l = y->conval->intval; - if (0 > l || l > (int64)OPM_MaxSet) { + if (0 > l || l > 31) { OPB_err(202); } } if (((*x)->class == 7 && y->class == 7)) { if (k <= l) { (*x)->conval->setval = __SETRNG(k, l, 32); + OPB_SetSetType(*x); } else { OPB_err(201); (*x)->conval->setval = __SETRNG(l, k, 32); @@ -1550,8 +1559,9 @@ void OPB_SetElem (OPT_Node *x) OPB_err(93); } else if ((*x)->class == 7) { k = (*x)->conval->intval; - if ((0 <= k && k <= (int64)OPM_MaxSet)) { + if ((0 <= k && k <= 31)) { (*x)->conval->setval = __SETOF(k,32); + OPB_SetSetType(*x); } else { OPB_err(202); } @@ -1581,13 +1591,13 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPB_err(113); } break; - case 2: case 3: case 7: + case 2: case 3: if (g != f) { OPB_err(113); } break; - case 4: - if (g != 4 || x->size < y->size) { + case 4: case 7: + if (g != f || x->size < y->size) { OPB_err(113); } break; diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 545deb33..5a228db9 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1859,7 +1859,7 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim) void OPC_Constant (OPT_Const con, int16 form) { int16 i; - uint32 s; + uint64 s; int32 hex; BOOLEAN skipLeading; switch (form) { @@ -1891,7 +1891,7 @@ void OPC_Constant (OPT_Const con, int16 form) do { i -= 1; hex = __ASHL(hex, 1); - if (__IN(i, s, 32)) { + if (__IN(i, s, 64)) { hex += 1; } } while (!(__MASK(i, -8) == 0)); diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index 43c9e328..61ddc369 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -468,7 +468,7 @@ void OPB_In (OPT_Node *x, OPT_Node y) } else if ((f == 4 && y->typ->form == 7)) { if ((*x)->class == 7) { k = (*x)->conval->intval; - if (k < 0 || k > (int64)OPM_MaxSet) { + if (k < 0 || k >= (int64)__ASHL(y->typ->size, 3)) { OPB_err(202); } else if (y->class == 7) { (*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval, 64)); @@ -584,7 +584,11 @@ void OPB_MOp (int8 op, OPT_Node *x) } else if (__IN(f, 0x60, 32)) { z->conval->realval = -z->conval->realval; } else { - z->conval->setval = ~z->conval->setval; + if (z->typ->size == 8) { + z->conval->setval = ~z->conval->setval; + } else { + z->conval->setval = z->conval->setval ^ 0xffffffff; + } } z->obj = NIL; } else { @@ -959,6 +963,7 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) } } else if (f == 7) { xval->setval = (xval->setval & yval->setval); + OPB_SetSetType(x); } else if (f != 0) { OPB_err(101); } @@ -983,6 +988,7 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) } } else if (f == 7) { xval->setval = xval->setval ^ yval->setval; + OPB_SetSetType(x); } else if (f != 0) { OPB_err(102); } @@ -1037,6 +1043,7 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) } } else if (f == 7) { xval->setval = xval->setval | yval->setval; + OPB_SetSetType(x); } else if (f != 0) { OPB_err(105); } @@ -1059,6 +1066,7 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) } } else if (f == 7) { xval->setval = (xval->setval & ~yval->setval); + OPB_SetSetType(x); } else if (f != 0) { OPB_err(106); } @@ -1514,19 +1522,20 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y) } else if (((*x)->typ->form == 4 && y->typ->form == 4)) { if ((*x)->class == 7) { k = (*x)->conval->intval; - if (0 > k || k > (int64)OPM_MaxSet) { + if (0 > k || k > 31) { OPB_err(202); } } if (y->class == 7) { l = y->conval->intval; - if (0 > l || l > (int64)OPM_MaxSet) { + if (0 > l || l > 31) { OPB_err(202); } } if (((*x)->class == 7 && y->class == 7)) { if (k <= l) { (*x)->conval->setval = __SETRNG(k, l, 32); + OPB_SetSetType(*x); } else { OPB_err(201); (*x)->conval->setval = __SETRNG(l, k, 32); @@ -1550,8 +1559,9 @@ void OPB_SetElem (OPT_Node *x) OPB_err(93); } else if ((*x)->class == 7) { k = (*x)->conval->intval; - if ((0 <= k && k <= (int64)OPM_MaxSet)) { + if ((0 <= k && k <= 31)) { (*x)->conval->setval = __SETOF(k,32); + OPB_SetSetType(*x); } else { OPB_err(202); } @@ -1581,13 +1591,13 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPB_err(113); } break; - case 2: case 3: case 7: + case 2: case 3: if (g != f) { OPB_err(113); } break; - case 4: - if (g != 4 || x->size < y->size) { + case 4: case 7: + if (g != f || x->size < y->size) { OPB_err(113); } break; diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index 545deb33..5a228db9 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1859,7 +1859,7 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim) void OPC_Constant (OPT_Const con, int16 form) { int16 i; - uint32 s; + uint64 s; int32 hex; BOOLEAN skipLeading; switch (form) { @@ -1891,7 +1891,7 @@ void OPC_Constant (OPT_Const con, int16 form) do { i -= 1; hex = __ASHL(hex, 1); - if (__IN(i, s, 32)) { + if (__IN(i, s, 64)) { hex += 1; } } while (!(__MASK(i, -8) == 0)); diff --git a/src/compiler/OPB.Mod b/src/compiler/OPB.Mod index c1a317d2..17b4be1b 100644 --- a/src/compiler/OPB.Mod +++ b/src/compiler/OPB.Mod @@ -243,7 +243,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) ELSIF (f = OPT.Int) & (y^.typ^.form = OPT.Set) THEN IF x^.class = OPT.Nconst THEN k := x^.conval^.intval; - IF (k < 0) OR (k > OPM.MaxSet) THEN err(202) + IF (k < 0) OR (k >= y.typ.size*8) THEN err(202) ELSIF y^.class = OPT.Nconst THEN x^.conval^.intval := BoolToInt(k IN y^.conval^.setval); x^.obj := NIL ELSE BindNodes(OPT.Ndop, OPT.booltyp, x, y); x^.subcl := OPS.in END @@ -305,8 +305,13 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) ELSE z^.conval^.intval := -z^.conval^.intval; SetIntType(z) END ELSIF f IN OPT.realSet THEN z^.conval^.realval := -z^.conval^.realval - ELSE z^.conval^.setval := -z^.conval^.setval - END ; + ELSE + IF z.typ.size = 8 THEN + z^.conval^.setval := -z^.conval^.setval + ELSE + z.conval.setval := z.conval.setval / {0..31} + END + END; z^.obj := NIL ELSE z := NewOp(op, typ, z) END @@ -503,7 +508,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) ELSE err(204) END ELSIF f = OPT.Set THEN - xval^.setval := xval^.setval * yval^.setval + xval^.setval := xval^.setval * yval^.setval; SetSetType(x) ELSIF f # OPT.Undef THEN err(101) END |OPS.slash: IF f = OPT.Int THEN @@ -519,7 +524,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) ELSE err(205) END ELSIF f = OPT.Set THEN - xval^.setval := xval^.setval / yval^.setval + xval^.setval := xval^.setval / yval^.setval; SetSetType(x) ELSIF f # OPT.Undef THEN err(102) END |OPS.div: IF f = OPT.Int THEN @@ -553,7 +558,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) ELSE err(206) END ELSIF f = OPT.Set THEN - xval^.setval := xval^.setval + yval^.setval + xval^.setval := xval^.setval + yval^.setval; SetSetType(x) ELSIF f # OPT.Undef THEN err(105) END |OPS.minus: IF f = OPT.Int THEN @@ -569,7 +574,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) ELSE err(207) END ELSIF f = OPT.Set THEN - xval^.setval := xval^.setval - yval^.setval + xval^.setval := xval^.setval - yval^.setval; SetSetType(x) ELSIF f # OPT.Undef THEN err(106) END |OPS.or: IF f = OPT.Bool THEN @@ -799,23 +804,23 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) ELSIF (x^.typ^.form = OPT.Int) & (y^.typ^.form = OPT.Int) THEN IF x^.class = OPT.Nconst THEN k := x^.conval^.intval; - IF (0 > k) OR (k > OPM.MaxSet) THEN err(202) END + IF (0 > k) OR (k > MAX(SYSTEM.SET64)) THEN err(202) END END ; IF y^.class = OPT.Nconst THEN l := y^.conval^.intval; - IF (0 > l) OR (l > OPM.MaxSet) THEN err(202) END + IF (0 > l) OR (l > MAX(SYSTEM.SET64)) THEN err(202) END END ; IF (x^.class = OPT.Nconst) & (y^.class = OPT.Nconst) THEN IF k <= l THEN - x^.conval^.setval := {k..l} + x^.conval^.setval := {k..l}; SetSetType(x) ELSE err(201); x^.conval^.setval := {l..k} END ; x^.obj := NIL - ELSE BindNodes(OPT.Nupto, OPT.settyp, x, y) (* todo choose appropriate set type ? *) + ELSE BindNodes(OPT.Nupto, OPT.settyp, x, y) END ELSE err(93) END ; - x^.typ := OPT.settyp (* todo choose appropriate set type ? *) + x^.typ := OPT.settyp (* todo: syntax for specifying set type e.g. SYSTEM.SET64{n1..n2} *) END SetRange; PROCEDURE SetElem*(VAR x: OPT.Node); @@ -825,12 +830,12 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) ELSIF x^.typ^.form # OPT.Int THEN err(93) ELSIF x^.class = OPT.Nconst THEN k := x^.conval^.intval; - IF (0 <= k) & (k <= OPM.MaxSet) THEN x^.conval^.setval := {k} + IF (0 <= k) & (k <= MAX(SYSTEM.SET64)) THEN x^.conval^.setval := {k}; SetSetType(x) ELSE err(202) END ; x^.obj := NIL ELSE Convert(x, OPT.settyp) (* todo choose appropriate set type ? *) - END ; + END; x^.typ := OPT.settyp (* todo choose appropriate set type ? *) END SetElem; @@ -859,9 +864,9 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) OPT.String: | OPT.Byte: IF ~((g IN {OPT.Byte, OPT.Char, OPT.Int}) & (y.size = 1)) THEN err(113) END | OPT.Bool, - OPT.Char, - OPT.Set: IF g # f THEN err(113) END - | OPT.Int: IF (g # OPT.Int) OR (x.size < y.size) THEN err(113) END + OPT.Char: IF g # f THEN err(113) END + | OPT.Int, + OPT.Set: IF (g # f) OR (x.size < y.size) THEN err(113) END | OPT.Real: IF ~(g IN {OPT.Int..OPT.Real}) THEN err(113) END | OPT.LReal: IF ~(g IN {OPT.Int..OPT.LReal}) THEN err(113) END | OPT.Pointer: IF (x = y) OR (g = OPT.NilTyp) OR (x = OPT.sysptrtyp) & (g = OPT.Pointer) THEN (* ok *) diff --git a/src/compiler/OPC.Mod b/src/compiler/OPC.Mod index e601db3a..06252183 100644 --- a/src/compiler/OPC.Mod +++ b/src/compiler/OPC.Mod @@ -1227,7 +1227,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) END Len; PROCEDURE Constant* (con: OPT.Const; form: INTEGER); - VAR i: INTEGER; s: SET; + VAR i: INTEGER; s: SYSTEM.SET64; hex: LONGINT; skipLeading: BOOLEAN; BEGIN CASE form OF @@ -1239,7 +1239,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) | OPT.LReal: OPM.WriteReal(con^.realval, 0X) | OPT.Set: OPM.WriteString("0x"); skipLeading := TRUE; - s := con^.setval; i := MAX(SET) + 1; + s := con^.setval; i := MAX(SYSTEM.SET64) + 1; REPEAT hex := 0; REPEAT diff --git a/src/tools/browser/BrowserCmd.Mod b/src/tools/browser/BrowserCmd.Mod index 28573293..b017c028 100644 --- a/src/tools/browser/BrowserCmd.Mod +++ b/src/tools/browser/BrowserCmd.Mod @@ -41,7 +41,7 @@ MODULE BrowserCmd; (* RC 29.10.93 *) (* object model 4.12.93, command line ver END Wsign; PROCEDURE Objects(obj: OPT.Object; mode: SET); - VAR i: SYSTEM.INT64; m: INTEGER; s: SET; ext: OPT.ConstExt; + VAR i: SYSTEM.INT64; m: INTEGER; s: SYSTEM.SET64; ext: OPT.ConstExt; BEGIN IF obj # NIL THEN Objects(obj^.left, mode); @@ -61,7 +61,7 @@ MODULE BrowserCmd; (* RC 29.10.93 *) (* object model 4.12.93, command line ver END |OPT.Int: Wi(obj^.conval^.intval) |OPT.Set: Wch("{"); i := 0; s := obj^.conval^.setval; - WHILE i <= MAX(SET) DO + WHILE i <= MAX(SYSTEM.SET64) DO IF i IN s THEN Wi(i); EXCL(s, i); IF s # {} THEN Ws(", ") END END ; From c924a33a056a6385d2bacfc2aea02ad3409643ad Mon Sep 17 00:00:00 2001 From: David Brown Date: Sat, 1 Oct 2016 10:49:25 +0100 Subject: [PATCH 267/580] Better set constant checking. --- src/compiler/OPB.Mod | 13 +++++++------ src/compiler/OPC.Mod | 2 +- src/compiler/OPM.Mod | 2 -- src/system/SYSTEM.h | 1 + 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/compiler/OPB.Mod b/src/compiler/OPB.Mod index 17b4be1b..a6b8cf67 100644 --- a/src/compiler/OPB.Mod +++ b/src/compiler/OPB.Mod @@ -830,13 +830,14 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) ELSIF x^.typ^.form # OPT.Int THEN err(93) ELSIF x^.class = OPT.Nconst THEN k := x^.conval^.intval; - IF (0 <= k) & (k <= MAX(SYSTEM.SET64)) THEN x^.conval^.setval := {k}; SetSetType(x) + IF (0 <= k) & (k <= MAX(SYSTEM.SET64)) THEN + x^.conval^.setval := {}; INCL(x.conval.setval, k); ELSE err(202) - END ; - x^.obj := NIL - ELSE Convert(x, OPT.settyp) (* todo choose appropriate set type ? *) + END; + SetSetType(x); x^.obj := NIL + ELSE + Convert(x, OPT.settyp); x^.typ := OPT.settyp END; - x^.typ := OPT.settyp (* todo choose appropriate set type ? *) END SetElem; PROCEDURE CheckAssign(x: OPT.Struct; ynode: OPT.Node); (* x := y *) @@ -994,7 +995,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) OPT.Bool: x := NewBoolConst(TRUE) | OPT.Char: x := NewIntConst(0FFH); x^.typ := OPT.chartyp | OPT.Int: x := NewIntConst(OPM.SignedMaximum(x.typ.size)) - | OPT.Set: x := NewIntConst(OPM.MaxSet); x^.typ := OPT.inttyp + | OPT.Set: x := NewIntConst(x.typ.size*8-1); x^.typ := OPT.inttyp | OPT.Real: x := NewRealConst(OPM.MaxReal, OPT.realtyp) | OPT.LReal: x := NewRealConst(OPM.MaxLReal, OPT.lrltyp) ELSE err(111) diff --git a/src/compiler/OPC.Mod b/src/compiler/OPC.Mod index 06252183..72e13291 100644 --- a/src/compiler/OPC.Mod +++ b/src/compiler/OPC.Mod @@ -1228,7 +1228,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) PROCEDURE Constant* (con: OPT.Const; form: INTEGER); VAR i: INTEGER; s: SYSTEM.SET64; - hex: LONGINT; skipLeading: BOOLEAN; + hex: SYSTEM.INT64; skipLeading: BOOLEAN; BEGIN CASE form OF | OPT.Byte: OPM.WriteInt(con^.intval) diff --git a/src/compiler/OPM.Mod b/src/compiler/OPM.Mod index 1af3cde7..be89719c 100644 --- a/src/compiler/OPM.Mod +++ b/src/compiler/OPM.Mod @@ -93,7 +93,6 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) ShortintSize*, IntegerSize*, LongintSize*, SetSize*: INTEGER; - MaxSet*: INTEGER; MaxIndex*: SYSTEM.INT64; MinReal*, MaxReal*, MinLReal*, MaxLReal*: LONGREAL; @@ -344,7 +343,6 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) |'V': ShortintSize := 1; IntegerSize := 4; LongintSize := 8; SetSize := 8 ELSE ShortintSize := 1; IntegerSize := 2; LongintSize := 4; SetSize := 4 END; - MaxSet := SetSize * 8 - 1; IF verbose IN Options THEN VerboseListSizes END; diff --git a/src/system/SYSTEM.h b/src/system/SYSTEM.h index 7c55807b..4e1bfe18 100644 --- a/src/system/SYSTEM.h +++ b/src/system/SYSTEM.h @@ -229,6 +229,7 @@ static inline double SYSTEM_ABSD(double i) {return i >= 0.0 ? i : -i;} #define __ODD(x) ((x)&1) #define __IN(x, s, size) (((unsigned int)(x))>(x))&1)) +// todo tested versions of SETOF and SETRNG: check that x, l and h fit size #define __SETOF(x, size) ((uint##size)1<<(x)) #define __SETRNG(l, h, size) ((~(uint##size)0<<(l))&~(uint##size)0>>(size-1-(h))) From c2567a2600f3aea2ac5c9c174a90ece4005c5f2c Mon Sep 17 00:00:00 2001 From: David Brown Date: Sat, 1 Oct 2016 17:26:44 +0100 Subject: [PATCH 268/580] Reorganise system and runtime library modules for both O2 and OC builds. --- bootstrap/SYSTEM.h | 1 + bootstrap/unix-44/Compiler.c | 2 +- bootstrap/unix-44/Configuration.c | 4 +- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Console.c | 157 ----- bootstrap/unix-44/Console.h | 23 - bootstrap/unix-44/Files.c | 38 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 2 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 4 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 17 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 6 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 17 +- bootstrap/unix-44/OPM.h | 4 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 2 +- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 2 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Out.c | 105 ++++ bootstrap/unix-44/Out.h | 21 + bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 7 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/errors.c | 2 +- bootstrap/unix-44/errors.h | 2 +- bootstrap/unix-44/extTools.c | 34 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-44/vt100.c | 16 +- bootstrap/unix-44/vt100.h | 2 +- bootstrap/unix-48/Compiler.c | 2 +- bootstrap/unix-48/Configuration.c | 4 +- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Console.c | 157 ----- bootstrap/unix-48/Console.h | 23 - bootstrap/unix-48/Files.c | 38 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 2 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 4 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 17 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 6 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 17 +- bootstrap/unix-48/OPM.h | 4 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 2 +- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 2 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Out.c | 105 ++++ bootstrap/unix-48/Out.h | 21 + bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 7 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/errors.c | 2 +- bootstrap/unix-48/errors.h | 2 +- bootstrap/unix-48/extTools.c | 34 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-48/vt100.c | 16 +- bootstrap/unix-48/vt100.h | 2 +- bootstrap/unix-88/Compiler.c | 2 +- bootstrap/unix-88/Configuration.c | 4 +- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Console.c | 157 ----- bootstrap/unix-88/Console.h | 23 - bootstrap/unix-88/Files.c | 38 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 2 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 4 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 17 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 6 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 17 +- bootstrap/unix-88/OPM.h | 4 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 2 +- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 2 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Out.c | 105 ++++ bootstrap/unix-88/Out.h | 21 + bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 7 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/errors.c | 2 +- bootstrap/unix-88/errors.h | 2 +- bootstrap/unix-88/extTools.c | 34 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/unix-88/vt100.c | 16 +- bootstrap/unix-88/vt100.h | 2 +- bootstrap/windows-48/Compiler.c | 2 +- bootstrap/windows-48/Configuration.c | 4 +- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Console.c | 157 ----- bootstrap/windows-48/Console.h | 23 - bootstrap/windows-48/Files.c | 38 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 2 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 4 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 17 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 6 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 17 +- bootstrap/windows-48/OPM.h | 4 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 2 +- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 2 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Out.c | 105 ++++ bootstrap/windows-48/Out.h | 21 + bootstrap/windows-48/Platform.c | 10 +- bootstrap/windows-48/Platform.h | 4 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 7 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/errors.c | 2 +- bootstrap/windows-48/errors.h | 2 +- bootstrap/windows-48/extTools.c | 34 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-48/vt100.c | 16 +- bootstrap/windows-48/vt100.h | 2 +- bootstrap/windows-88/Compiler.c | 2 +- bootstrap/windows-88/Configuration.c | 4 +- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Console.c | 157 ----- bootstrap/windows-88/Console.h | 23 - bootstrap/windows-88/Files.c | 38 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 2 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 4 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 17 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 6 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 17 +- bootstrap/windows-88/OPM.h | 4 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 2 +- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 2 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Out.c | 105 ++++ bootstrap/windows-88/Out.h | 21 + bootstrap/windows-88/Platform.c | 10 +- bootstrap/windows-88/Platform.h | 4 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 7 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/errors.c | 2 +- bootstrap/windows-88/errors.h | 2 +- bootstrap/windows-88/extTools.c | 34 +- bootstrap/windows-88/extTools.h | 2 +- bootstrap/windows-88/vt100.c | 16 +- bootstrap/windows-88/vt100.h | 2 +- makefile | 10 +- src/compiler/OPM.Mod | 10 +- src/compiler/extTools.Mod | 14 +- src/{system => library/v4}/Console.Mod | 0 src/runtime/Out.Mod | 2 +- src/runtime/Platformunix.Mod | 2 +- src/{system => runtime}/SYSTEM.c | 0 src/{system => runtime}/SYSTEM.h | 0 src/{system => runtime}/WindowsWrapper.h | 0 src/runtime/vt100.Mod | 342 +++++++++++ src/system/Files.Mod | 749 ----------------------- src/system/Heap.Mod | 578 ----------------- src/system/Oberon.Mod | 86 --- src/system/Platformunix.Mod | 552 ----------------- src/system/Platformwindows.Mod | 622 ------------------- src/tools/browser/BrowserCmd.Mod | 6 +- src/tools/make/oberon.mk | 31 +- 223 files changed, 1521 insertions(+), 4039 deletions(-) delete mode 100644 bootstrap/unix-44/Console.c delete mode 100644 bootstrap/unix-44/Console.h create mode 100644 bootstrap/unix-44/Out.c create mode 100644 bootstrap/unix-44/Out.h delete mode 100644 bootstrap/unix-48/Console.c delete mode 100644 bootstrap/unix-48/Console.h create mode 100644 bootstrap/unix-48/Out.c create mode 100644 bootstrap/unix-48/Out.h delete mode 100644 bootstrap/unix-88/Console.c delete mode 100644 bootstrap/unix-88/Console.h create mode 100644 bootstrap/unix-88/Out.c create mode 100644 bootstrap/unix-88/Out.h delete mode 100644 bootstrap/windows-48/Console.c delete mode 100644 bootstrap/windows-48/Console.h create mode 100644 bootstrap/windows-48/Out.c create mode 100644 bootstrap/windows-48/Out.h delete mode 100644 bootstrap/windows-88/Console.c delete mode 100644 bootstrap/windows-88/Console.h create mode 100644 bootstrap/windows-88/Out.c create mode 100644 bootstrap/windows-88/Out.h rename src/{system => library/v4}/Console.Mod (100%) rename src/{system => runtime}/SYSTEM.c (100%) rename src/{system => runtime}/SYSTEM.h (100%) rename src/{system => runtime}/WindowsWrapper.h (100%) create mode 100644 src/runtime/vt100.Mod delete mode 100644 src/system/Files.Mod delete mode 100644 src/system/Heap.Mod delete mode 100644 src/system/Oberon.Mod delete mode 100644 src/system/Platformunix.Mod delete mode 100644 src/system/Platformwindows.Mod diff --git a/bootstrap/SYSTEM.h b/bootstrap/SYSTEM.h index 7c55807b..4e1bfe18 100644 --- a/bootstrap/SYSTEM.h +++ b/bootstrap/SYSTEM.h @@ -229,6 +229,7 @@ static inline double SYSTEM_ABSD(double i) {return i >= 0.0 ? i : -i;} #define __ODD(x) ((x)&1) #define __IN(x, s, size) (((unsigned int)(x))>(x))&1)) +// todo tested versions of SETOF and SETRNG: check that x, l and h fit size #define __SETOF(x, size) ((uint##size)1<<(x)) #define __SETRNG(l, h, size) ((~(uint##size)0<<(l))&~(uint##size)0>>(size-1-(h))) diff --git a/bootstrap/unix-44/Compiler.c b/bootstrap/unix-44/Compiler.c index 637fd329..a3cc57ea 100644 --- a/bootstrap/unix-44/Compiler.c +++ b/bootstrap/unix-44/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index a3240e8e..32d0b51f 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index 4d4279da..db2b8c32 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Console.c b/bootstrap/unix-44/Console.c deleted file mode 100644 index 206f8024..00000000 --- a/bootstrap/unix-44/Console.c +++ /dev/null @@ -1,157 +0,0 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ - -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 - -#include "SYSTEM.h" -#include "Platform.h" - - -static CHAR Console_line[128]; -static int16 Console_pos; - - -export void Console_Bool (BOOLEAN b); -export void Console_Char (CHAR ch); -export void Console_Flush (void); -export void Console_Hex (int32 i); -export void Console_Int (int64 i, int64 n); -export void Console_Ln (void); -export void Console_Read (CHAR *ch); -export void Console_ReadLine (CHAR *line, LONGINT line__len); -export void Console_String (CHAR *s, LONGINT s__len); - - -void Console_Flush (void) -{ - int16 error; - error = Platform_Write(1, (address)Console_line, Console_pos); - Console_pos = 0; -} - -void Console_Char (CHAR ch) -{ - if (Console_pos == 128) { - Console_Flush(); - } - Console_line[__X(Console_pos, 128)] = ch; - Console_pos += 1; - if (ch == 0x0a) { - Console_Flush(); - } -} - -void Console_String (CHAR *s, LONGINT s__len) -{ - int16 i; - __DUP(s, s__len, CHAR); - i = 0; - while (s[__X(i, s__len)] != 0x00) { - Console_Char(s[__X(i, s__len)]); - i += 1; - } - __DEL(s); -} - -void Console_Int (int64 i, int64 n) -{ - CHAR s[32]; - int32 i1, k; - if (i == (int64)__LSHL(1, 31, 32)) { - __MOVE("8463847412", s, 11); - k = 10; - } else { - i1 = __ABS(__VAL(int32, i)); - s[0] = (CHAR)((int)__MOD(i1, 10) + 48); - i1 = __DIV(i1, 10); - k = 1; - while (i1 > 0) { - s[__X(k, 32)] = (CHAR)((int)__MOD(i1, 10) + 48); - i1 = __DIV(i1, 10); - k += 1; - } - } - if (i < 0) { - s[__X(k, 32)] = '-'; - k += 1; - } - while (n > (int64)k) { - Console_Char(' '); - n -= 1; - } - while (k > 0) { - k -= 1; - Console_Char(s[__X(k, 32)]); - } -} - -void Console_Ln (void) -{ - Console_Char(0x0a); -} - -void Console_Bool (BOOLEAN b) -{ - if (b) { - Console_String((CHAR*)"TRUE", 5); - } else { - Console_String((CHAR*)"FALSE", 6); - } -} - -void Console_Hex (int32 i) -{ - int16 k; - int64 n; - k = -28; - while (k <= 0) { - n = __MASK(__ASH(i, k), -16); - if (n <= 9) { - Console_Char((CHAR)(48 + n)); - } else { - Console_Char((CHAR)(55 + n)); - } - k += 4; - } -} - -void Console_Read (CHAR *ch) -{ - int32 n; - int16 error; - Console_Flush(); - error = Platform_ReadBuf(0, (void*)&*ch, 1, &n); - if (n != 1) { - *ch = 0x00; - } -} - -void Console_ReadLine (CHAR *line, LONGINT line__len) -{ - int32 i; - CHAR ch; - Console_Flush(); - i = 0; - Console_Read(&ch); - while ((((i < line__len - 1 && ch != 0x0a)) && ch != 0x00)) { - line[__X(i, line__len)] = ch; - i += 1; - Console_Read(&ch); - } - line[__X(i, line__len)] = 0x00; -} - - -export void *Console__init(void) -{ - __DEFMOD; - __MODULE_IMPORT(Platform); - __REGMOD("Console", 0); - __REGCMD("Flush", Console_Flush); - __REGCMD("Ln", Console_Ln); -/* BEGIN */ - Console_pos = 0; - __ENDMOD; -} diff --git a/bootstrap/unix-44/Console.h b/bootstrap/unix-44/Console.h deleted file mode 100644 index 6549e2cc..00000000 --- a/bootstrap/unix-44/Console.h +++ /dev/null @@ -1,23 +0,0 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ - -#ifndef Console__h -#define Console__h - -#include "SYSTEM.h" - - - - -import void Console_Bool (BOOLEAN b); -import void Console_Char (CHAR ch); -import void Console_Flush (void); -import void Console_Hex (int32 i); -import void Console_Int (int64 i, int64 n); -import void Console_Ln (void); -import void Console_Read (CHAR *ch); -import void Console_ReadLine (CHAR *line, LONGINT line__len); -import void Console_String (CHAR *s, LONGINT s__len); -import void *Console__init(void); - - -#endif // Console diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 7a06dc47..25192376 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -7,7 +7,7 @@ #include "SYSTEM.h" #include "Heap.h" -#include "Console.h" +#include "Out.h" #include "Platform.h" #include "Strings.h" @@ -114,26 +114,26 @@ export void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int16 errcode) { __DUP(s, s__len, CHAR); - Console_Ln(); - Console_String((CHAR*)"-- ", 4); - Console_String(s, s__len); - Console_String((CHAR*)": ", 3); + Out_Ln(); + Out_String((CHAR*)"-- ", 4); + Out_String(s, s__len); + Out_String((CHAR*)": ", 3); if (f != NIL) { if (f->registerName[0] != 0x00) { - Console_String(f->registerName, 101); + Out_String(f->registerName, 101); } else { - Console_String(f->workName, 101); + Out_String(f->workName, 101); } if (f->fd != 0) { - Console_String((CHAR*)"f.fd = ", 8); - Console_Int(f->fd, 1); + Out_String((CHAR*)"f.fd = ", 8); + Out_Int(f->fd, 1); } } if (errcode != 0) { - Console_String((CHAR*)" errcode = ", 12); - Console_Int(errcode, 1); + Out_String((CHAR*)" errcode = ", 12); + Out_Int(errcode, 1); } - Console_Ln(); + Out_Ln(); __HALT(99); __DEL(s); } @@ -460,11 +460,11 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) done = error == 0; } if ((!done && !Platform_Absent(error))) { - Console_String((CHAR*)"Warning: Files.Old ", 20); - Console_String(name, name__len); - Console_String((CHAR*)" error = ", 10); - Console_Int(error, 0); - Console_Ln(); + Out_String((CHAR*)"Warning: Files.Old ", 20); + Out_String(name, name__len); + Out_String((CHAR*)" error = ", 10); + Out_Int(error, 0); + Out_Ln(); } if (done) { error = Platform_Identify(fd, &identity, Platform_FileIdentity__typ); @@ -1043,7 +1043,7 @@ export void *Files__init(void) { __DEFMOD; __MODULE_IMPORT(Heap); - __MODULE_IMPORT(Console); + __MODULE_IMPORT(Out); __MODULE_IMPORT(Platform); __MODULE_IMPORT(Strings); __REGMOD("Files", EnumPtrs); diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index 69903ae1..1a38cc40 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index b3eea6a3..9c9c2846 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index a7135c5b..d4afd6fe 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index 2984f32f..9cfee5c9 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -6,7 +6,6 @@ #define SET uint32 #include "SYSTEM.h" -#include "Console.h" #include "Heap.h" typedef @@ -167,7 +166,6 @@ __TDESC(Modules_CmdDesc, 1, 1) = {__TDFLDS("CmdDesc", 32), {0, -8}}; export void *Modules__init(void) { __DEFMOD; - __MODULE_IMPORT(Console); __MODULE_IMPORT(Heap); __REGMOD("Modules", 0); __INITYP(Modules_ModuleDesc, Modules_ModuleDesc, 0); diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index 9b84521f..4e105135 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index 61ddc369..ef3ea081 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -1522,13 +1522,13 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y) } else if (((*x)->typ->form == 4 && y->typ->form == 4)) { if ((*x)->class == 7) { k = (*x)->conval->intval; - if (0 > k || k > 31) { + if (0 > k || k > 63) { OPB_err(202); } } if (y->class == 7) { l = y->conval->intval; - if (0 > l || l > 31) { + if (0 > l || l > 63) { OPB_err(202); } } @@ -1559,17 +1559,18 @@ void OPB_SetElem (OPT_Node *x) OPB_err(93); } else if ((*x)->class == 7) { k = (*x)->conval->intval; - if ((0 <= k && k <= 31)) { - (*x)->conval->setval = __SETOF(k,32); - OPB_SetSetType(*x); + if ((0 <= k && k <= 63)) { + (*x)->conval->setval = 0x0; + (*x)->conval->setval |= __SETOF(k,64); } else { OPB_err(202); } + OPB_SetSetType(*x); (*x)->obj = NIL; } else { OPB_Convert(&*x, OPT_settyp); + (*x)->typ = OPT_settyp; } - (*x)->typ = OPT_settyp; } static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) @@ -1816,7 +1817,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) x = OPB_NewIntConst(OPM_SignedMaximum(x->typ->size)); break; case 7: - x = OPB_NewIntConst(OPM_MaxSet); + x = OPB_NewIntConst(__ASHL(x->typ->size, 3) - 1); x->typ = OPT_inttyp; break; case 5: diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index 07dda5db..54e81677 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 5a228db9..6739a87e 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -1860,7 +1860,7 @@ void OPC_Constant (OPT_Const con, int16 form) { int16 i; uint64 s; - int32 hex; + int64 hex; BOOLEAN skipLeading; switch (form) { case 1: @@ -1885,7 +1885,7 @@ void OPC_Constant (OPT_Const con, int16 form) OPM_WriteString((CHAR*)"0x", 3); skipLeading = 1; s = con->setval; - i = 32; + i = 64; do { hex = 0; do { diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index c9cf0ace..32ec3b7f 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index b77fcb9c..1ab50cf6 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -7,8 +7,8 @@ #include "SYSTEM.h" #include "Configuration.h" -#include "Console.h" #include "Files.h" +#include "Out.h" #include "Platform.h" #include "Strings.h" #include "Texts.h" @@ -27,7 +27,7 @@ export int16 OPM_AddressSize; static int16 OPM_GlobalAlignment; export int16 OPM_Alignment; export uint32 OPM_GlobalOptions, OPM_Options; -export int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize, OPM_MaxSet; +export int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; export int64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; @@ -102,24 +102,24 @@ export void OPM_err (int16 n); void OPM_LogW (CHAR ch) { - Console_Char(ch); + Out_Char(ch); } void OPM_LogWStr (CHAR *s, LONGINT s__len) { __DUP(s, s__len, CHAR); - Console_String(s, s__len); + Out_String(s, s__len); __DEL(s); } void OPM_LogWNum (int64 i, int64 len) { - Console_Int(i, len); + Out_Int(i, len); } void OPM_LogWLn (void) { - Console_Ln(); + Out_Ln(); } int64 OPM_SignedMaximum (int32 bytecount) @@ -455,7 +455,6 @@ void OPM_InitOptions (void) OPM_SetSize = 4; break; } - OPM_MaxSet = __ASHL(OPM_SetSize, 3) - 1; if (__IN(18, OPM_Options, 32)) { OPM_VerboseListSizes(); } @@ -1075,8 +1074,8 @@ export void *OPM__init(void) { __DEFMOD; __MODULE_IMPORT(Configuration); - __MODULE_IMPORT(Console); __MODULE_IMPORT(Files); + __MODULE_IMPORT(Out); __MODULE_IMPORT(Platform); __MODULE_IMPORT(Strings); __MODULE_IMPORT(Texts); diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index aec6ed54..960bd0ba 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h @@ -9,7 +9,7 @@ import CHAR OPM_Model[10]; import int16 OPM_AddressSize, OPM_Alignment; import uint32 OPM_GlobalOptions, OPM_Options; -import int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize, OPM_MaxSet; +import int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; import int64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index d4bdcf39..3a1bf6f6 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index c759545a..8b28d78e 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index 18c3c066..882c9331 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index 260fcd01..62dc025a 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index b178bfbc..66d53030 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index 624d4fe0..6f17b409 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index a07e28a6..ba7bab5f 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index f5e41d45..30c2c7e7 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Out.c b/bootstrap/unix-44/Out.c new file mode 100644 index 00000000..a99d3410 --- /dev/null +++ b/bootstrap/unix-44/Out.c @@ -0,0 +1,105 @@ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ + +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + +#include "SYSTEM.h" +#include "Platform.h" + + + + +export void Out_Char (CHAR ch); +export void Out_Int (int64 x, int64 n); +export void Out_Ln (void); +export void Out_LongReal (LONGREAL x, int16 n); +export void Out_Open (void); +export void Out_Real (REAL x, int16 n); +export void Out_String (CHAR *str, LONGINT str__len); + + +void Out_Open (void) +{ +} + +void Out_Char (CHAR ch) +{ + int16 error; + error = Platform_Write(1, (address)&ch, 1); +} + +void Out_String (CHAR *str, LONGINT str__len) +{ + int32 l; + int16 error; + __DUP(str, str__len, CHAR); + l = 0; + while ((l < str__len && str[l] != 0x00)) { + l += 1; + } + error = Platform_Write(1, (address)str, l); + __DEL(str); +} + +void Out_Int (int64 x, int64 n) +{ + CHAR s[22]; + int16 i; + BOOLEAN negative; + negative = x < 0; + if (x == (-9223372036854775807-1)) { + __MOVE("8085774586302733229", s, 20); + i = 19; + } else { + if (x < 0) { + x = -x; + } + s[0] = (CHAR)(48 + __MOD(x, 10)); + x = __DIV(x, 10); + i = 1; + while (x != 0) { + s[i] = (CHAR)(48 + __MOD(x, 10)); + x = __DIV(x, 10); + i += 1; + } + } + if (negative) { + s[i] = '-'; + i += 1; + } + while (n > (int64)i) { + Out_Char(' '); + n -= 1; + } + while (i > 0) { + i -= 1; + Out_Char(s[i]); + } +} + +void Out_Real (REAL x, int16 n) +{ +} + +void Out_LongReal (LONGREAL x, int16 n) +{ +} + +void Out_Ln (void) +{ + Out_String(Platform_NL, 3); +} + + +export void *Out__init(void) +{ + __DEFMOD; + __MODULE_IMPORT(Platform); + __REGMOD("Out", 0); + __REGCMD("Ln", Out_Ln); + __REGCMD("Open", Out_Open); +/* BEGIN */ + __ENDMOD; +} diff --git a/bootstrap/unix-44/Out.h b/bootstrap/unix-44/Out.h new file mode 100644 index 00000000..6717f71b --- /dev/null +++ b/bootstrap/unix-44/Out.h @@ -0,0 +1,21 @@ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ + +#ifndef Out__h +#define Out__h + +#include "SYSTEM.h" + + + + +import void Out_Char (CHAR ch); +import void Out_Int (int64 x, int64 n); +import void Out_Ln (void); +import void Out_LongReal (LONGREAL x, int16 n); +import void Out_Open (void); +import void Out_Real (REAL x, int16 n); +import void Out_String (CHAR *str, LONGINT str__len); +import void *Out__init(void); + + +#endif // Out diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index defb84f0..addd94c0 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index 01e08432..18008f62 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index d7d2994c..f173fc32 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index 8c1ff819..98443ee2 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index ac03bada..accc2e6a 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index cc9d99a1..9ebac10a 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index a8af28c1..ac457f52 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -1473,7 +1473,7 @@ static void Texts_Load0 (Files_Rider *r, address *r__typ, Texts_Text T) Texts_Piece p = NIL; Texts_Elem e = NIL; int32 org, pos, hlen, plen; - int8 ecnt, fno, fcnt, col, voff; + int8 ecnt, fcnt, fno, col, voff; Files_File f = NIL; Texts_FileMsg msg; CHAR mods[64][32], procs[64][32]; @@ -1653,8 +1653,9 @@ void Texts_Store (Files_Rider *r, address *r__typ, Texts_Text T) Texts_Run u = NIL, un = NIL; Texts_Elem e = NIL; int32 org, pos, delta, hlen, rlen; - int8 ecnt, fno, fcnt; + int8 ecnt, fcnt; CHAR ch; + int8 fno; Texts_FileMsg msg; Texts_IdentifyMsg iden; CHAR mods[64][32], procs[64][32]; diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index 2d6de22a..80ab5a77 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/errors.c b/bootstrap/unix-44/errors.c index f284397b..b071c3a8 100644 --- a/bootstrap/unix-44/errors.c +++ b/bootstrap/unix-44/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/errors.h b/bootstrap/unix-44/errors.h index 5aa2a5f6..1560dc0d 100644 --- a/bootstrap/unix-44/errors.h +++ b/bootstrap/unix-44/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index b082e82c..f6b467bb 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -7,8 +7,8 @@ #include "SYSTEM.h" #include "Configuration.h" -#include "Console.h" #include "OPM.h" +#include "Out.h" #include "Platform.h" #include "Strings.h" @@ -28,9 +28,9 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN __DUP(title, title__len, CHAR); __DUP(cmd, cmd__len, CHAR); if (__IN(18, OPM_Options, 32)) { - Console_String(title, title__len); - Console_String(cmd, cmd__len); - Console_Ln(); + Out_String(title, title__len); + Out_String(cmd, cmd__len); + Out_Ln(); } r = Platform_System(cmd, cmd__len); status = __MASK(r, -128); @@ -39,18 +39,18 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN exitcode = exitcode - 256; } if (r != 0) { - Console_String(title, title__len); - Console_String(cmd, cmd__len); - Console_Ln(); - Console_String((CHAR*)"-- failed: status ", 19); - Console_Int(status, 1); - Console_String((CHAR*)", exitcode ", 12); - Console_Int(exitcode, 1); - Console_String((CHAR*)".", 2); - Console_Ln(); + Out_String(title, title__len); + Out_String(cmd, cmd__len); + Out_Ln(); + Out_String((CHAR*)"-- failed: status ", 19); + Out_Int(status, 1); + Out_String((CHAR*)", exitcode ", 12); + Out_Int(exitcode, 1); + Out_String((CHAR*)".", 2); + Out_Ln(); if ((status == 0 && exitcode == 127)) { - Console_String((CHAR*)"Is the C compiler in the current command path\?", 47); - Console_Ln(); + Out_String((CHAR*)"Is the C compiler in the current command path\?", 47); + Out_Ln(); } if (status != 0) { Platform_Halt(status); @@ -112,8 +112,8 @@ export void *extTools__init(void) { __DEFMOD; __MODULE_IMPORT(Configuration); - __MODULE_IMPORT(Console); __MODULE_IMPORT(OPM); + __MODULE_IMPORT(Out); __MODULE_IMPORT(Platform); __MODULE_IMPORT(Strings); __REGMOD("extTools", 0); diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index 8cdd8e01..ab7785db 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-44/vt100.c b/bootstrap/unix-44/vt100.c index a4bc9ec1..23b25f53 100644 --- a/bootstrap/unix-44/vt100.c +++ b/bootstrap/unix-44/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -6,7 +6,7 @@ #define SET uint32 #include "SYSTEM.h" -#include "Console.h" +#include "Out.h" #include "Strings.h" @@ -90,7 +90,7 @@ static void vt100_EscSeq0 (CHAR *letter, LONGINT letter__len) __DUP(letter, letter__len, CHAR); __COPY(vt100_CSI, cmd, 9); Strings_Append(letter, letter__len, (void*)cmd, 9); - Console_String(cmd, 9); + Out_String(cmd, 9); __DEL(letter); } @@ -103,7 +103,7 @@ static void vt100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len) __COPY(vt100_CSI, cmd, 7); Strings_Append(nstr, 2, (void*)cmd, 7); Strings_Append(letter, letter__len, (void*)cmd, 7); - Console_String(cmd, 7); + Out_String(cmd, 7); __DEL(letter); } @@ -116,7 +116,7 @@ static void vt100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len) __COPY(vt100_CSI, cmd, 7); Strings_Append(letter, letter__len, (void*)cmd, 7); Strings_Append(nstr, 2, (void*)cmd, 7); - Console_String(cmd, 7); + Out_String(cmd, 7); __DEL(letter); } @@ -132,7 +132,7 @@ static void vt100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len) Strings_Append((CHAR*)";", 2, (void*)cmd, 12); Strings_Append(mstr, 5, (void*)cmd, 12); Strings_Append(letter, letter__len, (void*)cmd, 12); - Console_String(cmd, 12); + Out_String(cmd, 12); __DEL(letter); } @@ -242,7 +242,7 @@ void vt100_SetAttr (CHAR *attr, LONGINT attr__len) __DUP(attr, attr__len, CHAR); __COPY(vt100_CSI, tmpstr, 16); Strings_Append(attr, attr__len, (void*)tmpstr, 16); - Console_String(tmpstr, 16); + Out_String(tmpstr, 16); __DEL(attr); } @@ -250,7 +250,7 @@ void vt100_SetAttr (CHAR *attr, LONGINT attr__len) export void *vt100__init(void) { __DEFMOD; - __MODULE_IMPORT(Console); + __MODULE_IMPORT(Out); __MODULE_IMPORT(Strings); __REGMOD("vt100", 0); __REGCMD("DECTCEMh", vt100_DECTCEMh); diff --git a/bootstrap/unix-44/vt100.h b/bootstrap/unix-44/vt100.h index 44d81f73..95c8d77e 100644 --- a/bootstrap/unix-44/vt100.h +++ b/bootstrap/unix-44/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-48/Compiler.c b/bootstrap/unix-48/Compiler.c index 637fd329..a3cc57ea 100644 --- a/bootstrap/unix-48/Compiler.c +++ b/bootstrap/unix-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index a3240e8e..32d0b51f 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index 4d4279da..db2b8c32 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Console.c b/bootstrap/unix-48/Console.c deleted file mode 100644 index 206f8024..00000000 --- a/bootstrap/unix-48/Console.c +++ /dev/null @@ -1,157 +0,0 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ - -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 - -#include "SYSTEM.h" -#include "Platform.h" - - -static CHAR Console_line[128]; -static int16 Console_pos; - - -export void Console_Bool (BOOLEAN b); -export void Console_Char (CHAR ch); -export void Console_Flush (void); -export void Console_Hex (int32 i); -export void Console_Int (int64 i, int64 n); -export void Console_Ln (void); -export void Console_Read (CHAR *ch); -export void Console_ReadLine (CHAR *line, LONGINT line__len); -export void Console_String (CHAR *s, LONGINT s__len); - - -void Console_Flush (void) -{ - int16 error; - error = Platform_Write(1, (address)Console_line, Console_pos); - Console_pos = 0; -} - -void Console_Char (CHAR ch) -{ - if (Console_pos == 128) { - Console_Flush(); - } - Console_line[__X(Console_pos, 128)] = ch; - Console_pos += 1; - if (ch == 0x0a) { - Console_Flush(); - } -} - -void Console_String (CHAR *s, LONGINT s__len) -{ - int16 i; - __DUP(s, s__len, CHAR); - i = 0; - while (s[__X(i, s__len)] != 0x00) { - Console_Char(s[__X(i, s__len)]); - i += 1; - } - __DEL(s); -} - -void Console_Int (int64 i, int64 n) -{ - CHAR s[32]; - int32 i1, k; - if (i == (int64)__LSHL(1, 31, 32)) { - __MOVE("8463847412", s, 11); - k = 10; - } else { - i1 = __ABS(__VAL(int32, i)); - s[0] = (CHAR)((int)__MOD(i1, 10) + 48); - i1 = __DIV(i1, 10); - k = 1; - while (i1 > 0) { - s[__X(k, 32)] = (CHAR)((int)__MOD(i1, 10) + 48); - i1 = __DIV(i1, 10); - k += 1; - } - } - if (i < 0) { - s[__X(k, 32)] = '-'; - k += 1; - } - while (n > (int64)k) { - Console_Char(' '); - n -= 1; - } - while (k > 0) { - k -= 1; - Console_Char(s[__X(k, 32)]); - } -} - -void Console_Ln (void) -{ - Console_Char(0x0a); -} - -void Console_Bool (BOOLEAN b) -{ - if (b) { - Console_String((CHAR*)"TRUE", 5); - } else { - Console_String((CHAR*)"FALSE", 6); - } -} - -void Console_Hex (int32 i) -{ - int16 k; - int64 n; - k = -28; - while (k <= 0) { - n = __MASK(__ASH(i, k), -16); - if (n <= 9) { - Console_Char((CHAR)(48 + n)); - } else { - Console_Char((CHAR)(55 + n)); - } - k += 4; - } -} - -void Console_Read (CHAR *ch) -{ - int32 n; - int16 error; - Console_Flush(); - error = Platform_ReadBuf(0, (void*)&*ch, 1, &n); - if (n != 1) { - *ch = 0x00; - } -} - -void Console_ReadLine (CHAR *line, LONGINT line__len) -{ - int32 i; - CHAR ch; - Console_Flush(); - i = 0; - Console_Read(&ch); - while ((((i < line__len - 1 && ch != 0x0a)) && ch != 0x00)) { - line[__X(i, line__len)] = ch; - i += 1; - Console_Read(&ch); - } - line[__X(i, line__len)] = 0x00; -} - - -export void *Console__init(void) -{ - __DEFMOD; - __MODULE_IMPORT(Platform); - __REGMOD("Console", 0); - __REGCMD("Flush", Console_Flush); - __REGCMD("Ln", Console_Ln); -/* BEGIN */ - Console_pos = 0; - __ENDMOD; -} diff --git a/bootstrap/unix-48/Console.h b/bootstrap/unix-48/Console.h deleted file mode 100644 index 6549e2cc..00000000 --- a/bootstrap/unix-48/Console.h +++ /dev/null @@ -1,23 +0,0 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ - -#ifndef Console__h -#define Console__h - -#include "SYSTEM.h" - - - - -import void Console_Bool (BOOLEAN b); -import void Console_Char (CHAR ch); -import void Console_Flush (void); -import void Console_Hex (int32 i); -import void Console_Int (int64 i, int64 n); -import void Console_Ln (void); -import void Console_Read (CHAR *ch); -import void Console_ReadLine (CHAR *line, LONGINT line__len); -import void Console_String (CHAR *s, LONGINT s__len); -import void *Console__init(void); - - -#endif // Console diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 7a06dc47..25192376 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -7,7 +7,7 @@ #include "SYSTEM.h" #include "Heap.h" -#include "Console.h" +#include "Out.h" #include "Platform.h" #include "Strings.h" @@ -114,26 +114,26 @@ export void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int16 errcode) { __DUP(s, s__len, CHAR); - Console_Ln(); - Console_String((CHAR*)"-- ", 4); - Console_String(s, s__len); - Console_String((CHAR*)": ", 3); + Out_Ln(); + Out_String((CHAR*)"-- ", 4); + Out_String(s, s__len); + Out_String((CHAR*)": ", 3); if (f != NIL) { if (f->registerName[0] != 0x00) { - Console_String(f->registerName, 101); + Out_String(f->registerName, 101); } else { - Console_String(f->workName, 101); + Out_String(f->workName, 101); } if (f->fd != 0) { - Console_String((CHAR*)"f.fd = ", 8); - Console_Int(f->fd, 1); + Out_String((CHAR*)"f.fd = ", 8); + Out_Int(f->fd, 1); } } if (errcode != 0) { - Console_String((CHAR*)" errcode = ", 12); - Console_Int(errcode, 1); + Out_String((CHAR*)" errcode = ", 12); + Out_Int(errcode, 1); } - Console_Ln(); + Out_Ln(); __HALT(99); __DEL(s); } @@ -460,11 +460,11 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) done = error == 0; } if ((!done && !Platform_Absent(error))) { - Console_String((CHAR*)"Warning: Files.Old ", 20); - Console_String(name, name__len); - Console_String((CHAR*)" error = ", 10); - Console_Int(error, 0); - Console_Ln(); + Out_String((CHAR*)"Warning: Files.Old ", 20); + Out_String(name, name__len); + Out_String((CHAR*)" error = ", 10); + Out_Int(error, 0); + Out_Ln(); } if (done) { error = Platform_Identify(fd, &identity, Platform_FileIdentity__typ); @@ -1043,7 +1043,7 @@ export void *Files__init(void) { __DEFMOD; __MODULE_IMPORT(Heap); - __MODULE_IMPORT(Console); + __MODULE_IMPORT(Out); __MODULE_IMPORT(Platform); __MODULE_IMPORT(Strings); __REGMOD("Files", EnumPtrs); diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index 69903ae1..1a38cc40 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index b3eea6a3..9c9c2846 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index a7135c5b..d4afd6fe 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index 2984f32f..9cfee5c9 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -6,7 +6,6 @@ #define SET uint32 #include "SYSTEM.h" -#include "Console.h" #include "Heap.h" typedef @@ -167,7 +166,6 @@ __TDESC(Modules_CmdDesc, 1, 1) = {__TDFLDS("CmdDesc", 32), {0, -8}}; export void *Modules__init(void) { __DEFMOD; - __MODULE_IMPORT(Console); __MODULE_IMPORT(Heap); __REGMOD("Modules", 0); __INITYP(Modules_ModuleDesc, Modules_ModuleDesc, 0); diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index 9b84521f..4e105135 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index 61ddc369..ef3ea081 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -1522,13 +1522,13 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y) } else if (((*x)->typ->form == 4 && y->typ->form == 4)) { if ((*x)->class == 7) { k = (*x)->conval->intval; - if (0 > k || k > 31) { + if (0 > k || k > 63) { OPB_err(202); } } if (y->class == 7) { l = y->conval->intval; - if (0 > l || l > 31) { + if (0 > l || l > 63) { OPB_err(202); } } @@ -1559,17 +1559,18 @@ void OPB_SetElem (OPT_Node *x) OPB_err(93); } else if ((*x)->class == 7) { k = (*x)->conval->intval; - if ((0 <= k && k <= 31)) { - (*x)->conval->setval = __SETOF(k,32); - OPB_SetSetType(*x); + if ((0 <= k && k <= 63)) { + (*x)->conval->setval = 0x0; + (*x)->conval->setval |= __SETOF(k,64); } else { OPB_err(202); } + OPB_SetSetType(*x); (*x)->obj = NIL; } else { OPB_Convert(&*x, OPT_settyp); + (*x)->typ = OPT_settyp; } - (*x)->typ = OPT_settyp; } static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) @@ -1816,7 +1817,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) x = OPB_NewIntConst(OPM_SignedMaximum(x->typ->size)); break; case 7: - x = OPB_NewIntConst(OPM_MaxSet); + x = OPB_NewIntConst(__ASHL(x->typ->size, 3) - 1); x->typ = OPT_inttyp; break; case 5: diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index 07dda5db..54e81677 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 5a228db9..6739a87e 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -1860,7 +1860,7 @@ void OPC_Constant (OPT_Const con, int16 form) { int16 i; uint64 s; - int32 hex; + int64 hex; BOOLEAN skipLeading; switch (form) { case 1: @@ -1885,7 +1885,7 @@ void OPC_Constant (OPT_Const con, int16 form) OPM_WriteString((CHAR*)"0x", 3); skipLeading = 1; s = con->setval; - i = 32; + i = 64; do { hex = 0; do { diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index c9cf0ace..32ec3b7f 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index b77fcb9c..1ab50cf6 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -7,8 +7,8 @@ #include "SYSTEM.h" #include "Configuration.h" -#include "Console.h" #include "Files.h" +#include "Out.h" #include "Platform.h" #include "Strings.h" #include "Texts.h" @@ -27,7 +27,7 @@ export int16 OPM_AddressSize; static int16 OPM_GlobalAlignment; export int16 OPM_Alignment; export uint32 OPM_GlobalOptions, OPM_Options; -export int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize, OPM_MaxSet; +export int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; export int64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; @@ -102,24 +102,24 @@ export void OPM_err (int16 n); void OPM_LogW (CHAR ch) { - Console_Char(ch); + Out_Char(ch); } void OPM_LogWStr (CHAR *s, LONGINT s__len) { __DUP(s, s__len, CHAR); - Console_String(s, s__len); + Out_String(s, s__len); __DEL(s); } void OPM_LogWNum (int64 i, int64 len) { - Console_Int(i, len); + Out_Int(i, len); } void OPM_LogWLn (void) { - Console_Ln(); + Out_Ln(); } int64 OPM_SignedMaximum (int32 bytecount) @@ -455,7 +455,6 @@ void OPM_InitOptions (void) OPM_SetSize = 4; break; } - OPM_MaxSet = __ASHL(OPM_SetSize, 3) - 1; if (__IN(18, OPM_Options, 32)) { OPM_VerboseListSizes(); } @@ -1075,8 +1074,8 @@ export void *OPM__init(void) { __DEFMOD; __MODULE_IMPORT(Configuration); - __MODULE_IMPORT(Console); __MODULE_IMPORT(Files); + __MODULE_IMPORT(Out); __MODULE_IMPORT(Platform); __MODULE_IMPORT(Strings); __MODULE_IMPORT(Texts); diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index aec6ed54..960bd0ba 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h @@ -9,7 +9,7 @@ import CHAR OPM_Model[10]; import int16 OPM_AddressSize, OPM_Alignment; import uint32 OPM_GlobalOptions, OPM_Options; -import int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize, OPM_MaxSet; +import int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; import int64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index d4bdcf39..3a1bf6f6 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index c759545a..8b28d78e 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index 18c3c066..882c9331 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index 260fcd01..62dc025a 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 930f9138..a23ac389 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index 624d4fe0..6f17b409 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index a07e28a6..ba7bab5f 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index f5e41d45..30c2c7e7 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Out.c b/bootstrap/unix-48/Out.c new file mode 100644 index 00000000..a99d3410 --- /dev/null +++ b/bootstrap/unix-48/Out.c @@ -0,0 +1,105 @@ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ + +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + +#include "SYSTEM.h" +#include "Platform.h" + + + + +export void Out_Char (CHAR ch); +export void Out_Int (int64 x, int64 n); +export void Out_Ln (void); +export void Out_LongReal (LONGREAL x, int16 n); +export void Out_Open (void); +export void Out_Real (REAL x, int16 n); +export void Out_String (CHAR *str, LONGINT str__len); + + +void Out_Open (void) +{ +} + +void Out_Char (CHAR ch) +{ + int16 error; + error = Platform_Write(1, (address)&ch, 1); +} + +void Out_String (CHAR *str, LONGINT str__len) +{ + int32 l; + int16 error; + __DUP(str, str__len, CHAR); + l = 0; + while ((l < str__len && str[l] != 0x00)) { + l += 1; + } + error = Platform_Write(1, (address)str, l); + __DEL(str); +} + +void Out_Int (int64 x, int64 n) +{ + CHAR s[22]; + int16 i; + BOOLEAN negative; + negative = x < 0; + if (x == (-9223372036854775807-1)) { + __MOVE("8085774586302733229", s, 20); + i = 19; + } else { + if (x < 0) { + x = -x; + } + s[0] = (CHAR)(48 + __MOD(x, 10)); + x = __DIV(x, 10); + i = 1; + while (x != 0) { + s[i] = (CHAR)(48 + __MOD(x, 10)); + x = __DIV(x, 10); + i += 1; + } + } + if (negative) { + s[i] = '-'; + i += 1; + } + while (n > (int64)i) { + Out_Char(' '); + n -= 1; + } + while (i > 0) { + i -= 1; + Out_Char(s[i]); + } +} + +void Out_Real (REAL x, int16 n) +{ +} + +void Out_LongReal (LONGREAL x, int16 n) +{ +} + +void Out_Ln (void) +{ + Out_String(Platform_NL, 3); +} + + +export void *Out__init(void) +{ + __DEFMOD; + __MODULE_IMPORT(Platform); + __REGMOD("Out", 0); + __REGCMD("Ln", Out_Ln); + __REGCMD("Open", Out_Open); +/* BEGIN */ + __ENDMOD; +} diff --git a/bootstrap/unix-48/Out.h b/bootstrap/unix-48/Out.h new file mode 100644 index 00000000..6717f71b --- /dev/null +++ b/bootstrap/unix-48/Out.h @@ -0,0 +1,21 @@ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ + +#ifndef Out__h +#define Out__h + +#include "SYSTEM.h" + + + + +import void Out_Char (CHAR ch); +import void Out_Int (int64 x, int64 n); +import void Out_Ln (void); +import void Out_LongReal (LONGREAL x, int16 n); +import void Out_Open (void); +import void Out_Real (REAL x, int16 n); +import void Out_String (CHAR *str, LONGINT str__len); +import void *Out__init(void); + + +#endif // Out diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index defb84f0..addd94c0 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index 01e08432..18008f62 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index d7d2994c..f173fc32 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index 8c1ff819..98443ee2 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index ac03bada..accc2e6a 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index cc9d99a1..9ebac10a 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index 09661382..8fd544dc 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -1473,7 +1473,7 @@ static void Texts_Load0 (Files_Rider *r, address *r__typ, Texts_Text T) Texts_Piece p = NIL; Texts_Elem e = NIL; int32 org, pos, hlen, plen; - int8 ecnt, fno, fcnt, col, voff; + int8 ecnt, fcnt, fno, col, voff; Files_File f = NIL; Texts_FileMsg msg; CHAR mods[64][32], procs[64][32]; @@ -1653,8 +1653,9 @@ void Texts_Store (Files_Rider *r, address *r__typ, Texts_Text T) Texts_Run u = NIL, un = NIL; Texts_Elem e = NIL; int32 org, pos, delta, hlen, rlen; - int8 ecnt, fno, fcnt; + int8 ecnt, fcnt; CHAR ch; + int8 fno; Texts_FileMsg msg; Texts_IdentifyMsg iden; CHAR mods[64][32], procs[64][32]; diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index 86f8f5b7..3d119274 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/errors.c b/bootstrap/unix-48/errors.c index f284397b..b071c3a8 100644 --- a/bootstrap/unix-48/errors.c +++ b/bootstrap/unix-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/errors.h b/bootstrap/unix-48/errors.h index 5aa2a5f6..1560dc0d 100644 --- a/bootstrap/unix-48/errors.h +++ b/bootstrap/unix-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index b082e82c..f6b467bb 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -7,8 +7,8 @@ #include "SYSTEM.h" #include "Configuration.h" -#include "Console.h" #include "OPM.h" +#include "Out.h" #include "Platform.h" #include "Strings.h" @@ -28,9 +28,9 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN __DUP(title, title__len, CHAR); __DUP(cmd, cmd__len, CHAR); if (__IN(18, OPM_Options, 32)) { - Console_String(title, title__len); - Console_String(cmd, cmd__len); - Console_Ln(); + Out_String(title, title__len); + Out_String(cmd, cmd__len); + Out_Ln(); } r = Platform_System(cmd, cmd__len); status = __MASK(r, -128); @@ -39,18 +39,18 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN exitcode = exitcode - 256; } if (r != 0) { - Console_String(title, title__len); - Console_String(cmd, cmd__len); - Console_Ln(); - Console_String((CHAR*)"-- failed: status ", 19); - Console_Int(status, 1); - Console_String((CHAR*)", exitcode ", 12); - Console_Int(exitcode, 1); - Console_String((CHAR*)".", 2); - Console_Ln(); + Out_String(title, title__len); + Out_String(cmd, cmd__len); + Out_Ln(); + Out_String((CHAR*)"-- failed: status ", 19); + Out_Int(status, 1); + Out_String((CHAR*)", exitcode ", 12); + Out_Int(exitcode, 1); + Out_String((CHAR*)".", 2); + Out_Ln(); if ((status == 0 && exitcode == 127)) { - Console_String((CHAR*)"Is the C compiler in the current command path\?", 47); - Console_Ln(); + Out_String((CHAR*)"Is the C compiler in the current command path\?", 47); + Out_Ln(); } if (status != 0) { Platform_Halt(status); @@ -112,8 +112,8 @@ export void *extTools__init(void) { __DEFMOD; __MODULE_IMPORT(Configuration); - __MODULE_IMPORT(Console); __MODULE_IMPORT(OPM); + __MODULE_IMPORT(Out); __MODULE_IMPORT(Platform); __MODULE_IMPORT(Strings); __REGMOD("extTools", 0); diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index 8cdd8e01..ab7785db 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/vt100.c b/bootstrap/unix-48/vt100.c index a4bc9ec1..23b25f53 100644 --- a/bootstrap/unix-48/vt100.c +++ b/bootstrap/unix-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -6,7 +6,7 @@ #define SET uint32 #include "SYSTEM.h" -#include "Console.h" +#include "Out.h" #include "Strings.h" @@ -90,7 +90,7 @@ static void vt100_EscSeq0 (CHAR *letter, LONGINT letter__len) __DUP(letter, letter__len, CHAR); __COPY(vt100_CSI, cmd, 9); Strings_Append(letter, letter__len, (void*)cmd, 9); - Console_String(cmd, 9); + Out_String(cmd, 9); __DEL(letter); } @@ -103,7 +103,7 @@ static void vt100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len) __COPY(vt100_CSI, cmd, 7); Strings_Append(nstr, 2, (void*)cmd, 7); Strings_Append(letter, letter__len, (void*)cmd, 7); - Console_String(cmd, 7); + Out_String(cmd, 7); __DEL(letter); } @@ -116,7 +116,7 @@ static void vt100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len) __COPY(vt100_CSI, cmd, 7); Strings_Append(letter, letter__len, (void*)cmd, 7); Strings_Append(nstr, 2, (void*)cmd, 7); - Console_String(cmd, 7); + Out_String(cmd, 7); __DEL(letter); } @@ -132,7 +132,7 @@ static void vt100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len) Strings_Append((CHAR*)";", 2, (void*)cmd, 12); Strings_Append(mstr, 5, (void*)cmd, 12); Strings_Append(letter, letter__len, (void*)cmd, 12); - Console_String(cmd, 12); + Out_String(cmd, 12); __DEL(letter); } @@ -242,7 +242,7 @@ void vt100_SetAttr (CHAR *attr, LONGINT attr__len) __DUP(attr, attr__len, CHAR); __COPY(vt100_CSI, tmpstr, 16); Strings_Append(attr, attr__len, (void*)tmpstr, 16); - Console_String(tmpstr, 16); + Out_String(tmpstr, 16); __DEL(attr); } @@ -250,7 +250,7 @@ void vt100_SetAttr (CHAR *attr, LONGINT attr__len) export void *vt100__init(void) { __DEFMOD; - __MODULE_IMPORT(Console); + __MODULE_IMPORT(Out); __MODULE_IMPORT(Strings); __REGMOD("vt100", 0); __REGCMD("DECTCEMh", vt100_DECTCEMh); diff --git a/bootstrap/unix-48/vt100.h b/bootstrap/unix-48/vt100.h index 44d81f73..95c8d77e 100644 --- a/bootstrap/unix-48/vt100.h +++ b/bootstrap/unix-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-88/Compiler.c b/bootstrap/unix-88/Compiler.c index 637fd329..a3cc57ea 100644 --- a/bootstrap/unix-88/Compiler.c +++ b/bootstrap/unix-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index a3240e8e..32d0b51f 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index 4d4279da..db2b8c32 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Console.c b/bootstrap/unix-88/Console.c deleted file mode 100644 index 206f8024..00000000 --- a/bootstrap/unix-88/Console.c +++ /dev/null @@ -1,157 +0,0 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ - -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 - -#include "SYSTEM.h" -#include "Platform.h" - - -static CHAR Console_line[128]; -static int16 Console_pos; - - -export void Console_Bool (BOOLEAN b); -export void Console_Char (CHAR ch); -export void Console_Flush (void); -export void Console_Hex (int32 i); -export void Console_Int (int64 i, int64 n); -export void Console_Ln (void); -export void Console_Read (CHAR *ch); -export void Console_ReadLine (CHAR *line, LONGINT line__len); -export void Console_String (CHAR *s, LONGINT s__len); - - -void Console_Flush (void) -{ - int16 error; - error = Platform_Write(1, (address)Console_line, Console_pos); - Console_pos = 0; -} - -void Console_Char (CHAR ch) -{ - if (Console_pos == 128) { - Console_Flush(); - } - Console_line[__X(Console_pos, 128)] = ch; - Console_pos += 1; - if (ch == 0x0a) { - Console_Flush(); - } -} - -void Console_String (CHAR *s, LONGINT s__len) -{ - int16 i; - __DUP(s, s__len, CHAR); - i = 0; - while (s[__X(i, s__len)] != 0x00) { - Console_Char(s[__X(i, s__len)]); - i += 1; - } - __DEL(s); -} - -void Console_Int (int64 i, int64 n) -{ - CHAR s[32]; - int32 i1, k; - if (i == (int64)__LSHL(1, 31, 32)) { - __MOVE("8463847412", s, 11); - k = 10; - } else { - i1 = __ABS(__VAL(int32, i)); - s[0] = (CHAR)((int)__MOD(i1, 10) + 48); - i1 = __DIV(i1, 10); - k = 1; - while (i1 > 0) { - s[__X(k, 32)] = (CHAR)((int)__MOD(i1, 10) + 48); - i1 = __DIV(i1, 10); - k += 1; - } - } - if (i < 0) { - s[__X(k, 32)] = '-'; - k += 1; - } - while (n > (int64)k) { - Console_Char(' '); - n -= 1; - } - while (k > 0) { - k -= 1; - Console_Char(s[__X(k, 32)]); - } -} - -void Console_Ln (void) -{ - Console_Char(0x0a); -} - -void Console_Bool (BOOLEAN b) -{ - if (b) { - Console_String((CHAR*)"TRUE", 5); - } else { - Console_String((CHAR*)"FALSE", 6); - } -} - -void Console_Hex (int32 i) -{ - int16 k; - int64 n; - k = -28; - while (k <= 0) { - n = __MASK(__ASH(i, k), -16); - if (n <= 9) { - Console_Char((CHAR)(48 + n)); - } else { - Console_Char((CHAR)(55 + n)); - } - k += 4; - } -} - -void Console_Read (CHAR *ch) -{ - int32 n; - int16 error; - Console_Flush(); - error = Platform_ReadBuf(0, (void*)&*ch, 1, &n); - if (n != 1) { - *ch = 0x00; - } -} - -void Console_ReadLine (CHAR *line, LONGINT line__len) -{ - int32 i; - CHAR ch; - Console_Flush(); - i = 0; - Console_Read(&ch); - while ((((i < line__len - 1 && ch != 0x0a)) && ch != 0x00)) { - line[__X(i, line__len)] = ch; - i += 1; - Console_Read(&ch); - } - line[__X(i, line__len)] = 0x00; -} - - -export void *Console__init(void) -{ - __DEFMOD; - __MODULE_IMPORT(Platform); - __REGMOD("Console", 0); - __REGCMD("Flush", Console_Flush); - __REGCMD("Ln", Console_Ln); -/* BEGIN */ - Console_pos = 0; - __ENDMOD; -} diff --git a/bootstrap/unix-88/Console.h b/bootstrap/unix-88/Console.h deleted file mode 100644 index 6549e2cc..00000000 --- a/bootstrap/unix-88/Console.h +++ /dev/null @@ -1,23 +0,0 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ - -#ifndef Console__h -#define Console__h - -#include "SYSTEM.h" - - - - -import void Console_Bool (BOOLEAN b); -import void Console_Char (CHAR ch); -import void Console_Flush (void); -import void Console_Hex (int32 i); -import void Console_Int (int64 i, int64 n); -import void Console_Ln (void); -import void Console_Read (CHAR *ch); -import void Console_ReadLine (CHAR *line, LONGINT line__len); -import void Console_String (CHAR *s, LONGINT s__len); -import void *Console__init(void); - - -#endif // Console diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index a884abf3..010c9d80 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -7,7 +7,7 @@ #include "SYSTEM.h" #include "Heap.h" -#include "Console.h" +#include "Out.h" #include "Platform.h" #include "Strings.h" @@ -114,26 +114,26 @@ export void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int16 errcode) { __DUP(s, s__len, CHAR); - Console_Ln(); - Console_String((CHAR*)"-- ", 4); - Console_String(s, s__len); - Console_String((CHAR*)": ", 3); + Out_Ln(); + Out_String((CHAR*)"-- ", 4); + Out_String(s, s__len); + Out_String((CHAR*)": ", 3); if (f != NIL) { if (f->registerName[0] != 0x00) { - Console_String(f->registerName, 101); + Out_String(f->registerName, 101); } else { - Console_String(f->workName, 101); + Out_String(f->workName, 101); } if (f->fd != 0) { - Console_String((CHAR*)"f.fd = ", 8); - Console_Int(f->fd, 1); + Out_String((CHAR*)"f.fd = ", 8); + Out_Int(f->fd, 1); } } if (errcode != 0) { - Console_String((CHAR*)" errcode = ", 12); - Console_Int(errcode, 1); + Out_String((CHAR*)" errcode = ", 12); + Out_Int(errcode, 1); } - Console_Ln(); + Out_Ln(); __HALT(99); __DEL(s); } @@ -460,11 +460,11 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) done = error == 0; } if ((!done && !Platform_Absent(error))) { - Console_String((CHAR*)"Warning: Files.Old ", 20); - Console_String(name, name__len); - Console_String((CHAR*)" error = ", 10); - Console_Int(error, 0); - Console_Ln(); + Out_String((CHAR*)"Warning: Files.Old ", 20); + Out_String(name, name__len); + Out_String((CHAR*)" error = ", 10); + Out_Int(error, 0); + Out_Ln(); } if (done) { error = Platform_Identify(fd, &identity, Platform_FileIdentity__typ); @@ -1043,7 +1043,7 @@ export void *Files__init(void) { __DEFMOD; __MODULE_IMPORT(Heap); - __MODULE_IMPORT(Console); + __MODULE_IMPORT(Out); __MODULE_IMPORT(Platform); __MODULE_IMPORT(Strings); __REGMOD("Files", EnumPtrs); diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 02e44bed..87c48fa5 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index 571a7dd2..6ab9f1ca 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index 2187094a..b183ffa4 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index e18d29cf..dab15898 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -6,7 +6,6 @@ #define SET uint32 #include "SYSTEM.h" -#include "Console.h" #include "Heap.h" typedef @@ -167,7 +166,6 @@ __TDESC(Modules_CmdDesc, 1, 1) = {__TDFLDS("CmdDesc", 40), {0, -16}}; export void *Modules__init(void) { __DEFMOD; - __MODULE_IMPORT(Console); __MODULE_IMPORT(Heap); __REGMOD("Modules", 0); __INITYP(Modules_ModuleDesc, Modules_ModuleDesc, 0); diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index 9b84521f..4e105135 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index 61ddc369..ef3ea081 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -1522,13 +1522,13 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y) } else if (((*x)->typ->form == 4 && y->typ->form == 4)) { if ((*x)->class == 7) { k = (*x)->conval->intval; - if (0 > k || k > 31) { + if (0 > k || k > 63) { OPB_err(202); } } if (y->class == 7) { l = y->conval->intval; - if (0 > l || l > 31) { + if (0 > l || l > 63) { OPB_err(202); } } @@ -1559,17 +1559,18 @@ void OPB_SetElem (OPT_Node *x) OPB_err(93); } else if ((*x)->class == 7) { k = (*x)->conval->intval; - if ((0 <= k && k <= 31)) { - (*x)->conval->setval = __SETOF(k,32); - OPB_SetSetType(*x); + if ((0 <= k && k <= 63)) { + (*x)->conval->setval = 0x0; + (*x)->conval->setval |= __SETOF(k,64); } else { OPB_err(202); } + OPB_SetSetType(*x); (*x)->obj = NIL; } else { OPB_Convert(&*x, OPT_settyp); + (*x)->typ = OPT_settyp; } - (*x)->typ = OPT_settyp; } static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) @@ -1816,7 +1817,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) x = OPB_NewIntConst(OPM_SignedMaximum(x->typ->size)); break; case 7: - x = OPB_NewIntConst(OPM_MaxSet); + x = OPB_NewIntConst(__ASHL(x->typ->size, 3) - 1); x->typ = OPT_inttyp; break; case 5: diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index 07dda5db..54e81677 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index 5a228db9..6739a87e 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -1860,7 +1860,7 @@ void OPC_Constant (OPT_Const con, int16 form) { int16 i; uint64 s; - int32 hex; + int64 hex; BOOLEAN skipLeading; switch (form) { case 1: @@ -1885,7 +1885,7 @@ void OPC_Constant (OPT_Const con, int16 form) OPM_WriteString((CHAR*)"0x", 3); skipLeading = 1; s = con->setval; - i = 32; + i = 64; do { hex = 0; do { diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index c9cf0ace..32ec3b7f 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index e894697a..732baf46 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -7,8 +7,8 @@ #include "SYSTEM.h" #include "Configuration.h" -#include "Console.h" #include "Files.h" +#include "Out.h" #include "Platform.h" #include "Strings.h" #include "Texts.h" @@ -27,7 +27,7 @@ export int16 OPM_AddressSize; static int16 OPM_GlobalAlignment; export int16 OPM_Alignment; export uint32 OPM_GlobalOptions, OPM_Options; -export int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize, OPM_MaxSet; +export int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; export int64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; @@ -102,24 +102,24 @@ export void OPM_err (int16 n); void OPM_LogW (CHAR ch) { - Console_Char(ch); + Out_Char(ch); } void OPM_LogWStr (CHAR *s, LONGINT s__len) { __DUP(s, s__len, CHAR); - Console_String(s, s__len); + Out_String(s, s__len); __DEL(s); } void OPM_LogWNum (int64 i, int64 len) { - Console_Int(i, len); + Out_Int(i, len); } void OPM_LogWLn (void) { - Console_Ln(); + Out_Ln(); } int64 OPM_SignedMaximum (int32 bytecount) @@ -455,7 +455,6 @@ void OPM_InitOptions (void) OPM_SetSize = 4; break; } - OPM_MaxSet = __ASHL(OPM_SetSize, 3) - 1; if (__IN(18, OPM_Options, 32)) { OPM_VerboseListSizes(); } @@ -1075,8 +1074,8 @@ export void *OPM__init(void) { __DEFMOD; __MODULE_IMPORT(Configuration); - __MODULE_IMPORT(Console); __MODULE_IMPORT(Files); + __MODULE_IMPORT(Out); __MODULE_IMPORT(Platform); __MODULE_IMPORT(Strings); __MODULE_IMPORT(Texts); diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index aec6ed54..960bd0ba 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h @@ -9,7 +9,7 @@ import CHAR OPM_Model[10]; import int16 OPM_AddressSize, OPM_Alignment; import uint32 OPM_GlobalOptions, OPM_Options; -import int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize, OPM_MaxSet; +import int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; import int64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index 4aa1322a..bf1c6c9b 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index c759545a..8b28d78e 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index 18c3c066..882c9331 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index 260fcd01..62dc025a 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index c3766e15..186ab7e3 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 624d4fe0..6f17b409 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 4657f6d3..f566e592 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index f5e41d45..30c2c7e7 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Out.c b/bootstrap/unix-88/Out.c new file mode 100644 index 00000000..a99d3410 --- /dev/null +++ b/bootstrap/unix-88/Out.c @@ -0,0 +1,105 @@ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ + +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + +#include "SYSTEM.h" +#include "Platform.h" + + + + +export void Out_Char (CHAR ch); +export void Out_Int (int64 x, int64 n); +export void Out_Ln (void); +export void Out_LongReal (LONGREAL x, int16 n); +export void Out_Open (void); +export void Out_Real (REAL x, int16 n); +export void Out_String (CHAR *str, LONGINT str__len); + + +void Out_Open (void) +{ +} + +void Out_Char (CHAR ch) +{ + int16 error; + error = Platform_Write(1, (address)&ch, 1); +} + +void Out_String (CHAR *str, LONGINT str__len) +{ + int32 l; + int16 error; + __DUP(str, str__len, CHAR); + l = 0; + while ((l < str__len && str[l] != 0x00)) { + l += 1; + } + error = Platform_Write(1, (address)str, l); + __DEL(str); +} + +void Out_Int (int64 x, int64 n) +{ + CHAR s[22]; + int16 i; + BOOLEAN negative; + negative = x < 0; + if (x == (-9223372036854775807-1)) { + __MOVE("8085774586302733229", s, 20); + i = 19; + } else { + if (x < 0) { + x = -x; + } + s[0] = (CHAR)(48 + __MOD(x, 10)); + x = __DIV(x, 10); + i = 1; + while (x != 0) { + s[i] = (CHAR)(48 + __MOD(x, 10)); + x = __DIV(x, 10); + i += 1; + } + } + if (negative) { + s[i] = '-'; + i += 1; + } + while (n > (int64)i) { + Out_Char(' '); + n -= 1; + } + while (i > 0) { + i -= 1; + Out_Char(s[i]); + } +} + +void Out_Real (REAL x, int16 n) +{ +} + +void Out_LongReal (LONGREAL x, int16 n) +{ +} + +void Out_Ln (void) +{ + Out_String(Platform_NL, 3); +} + + +export void *Out__init(void) +{ + __DEFMOD; + __MODULE_IMPORT(Platform); + __REGMOD("Out", 0); + __REGCMD("Ln", Out_Ln); + __REGCMD("Open", Out_Open); +/* BEGIN */ + __ENDMOD; +} diff --git a/bootstrap/unix-88/Out.h b/bootstrap/unix-88/Out.h new file mode 100644 index 00000000..6717f71b --- /dev/null +++ b/bootstrap/unix-88/Out.h @@ -0,0 +1,21 @@ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ + +#ifndef Out__h +#define Out__h + +#include "SYSTEM.h" + + + + +import void Out_Char (CHAR ch); +import void Out_Int (int64 x, int64 n); +import void Out_Ln (void); +import void Out_LongReal (LONGREAL x, int16 n); +import void Out_Open (void); +import void Out_Real (REAL x, int16 n); +import void Out_String (CHAR *str, LONGINT str__len); +import void *Out__init(void); + + +#endif // Out diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 4d9d1fb1..b648dbcc 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index c308ce3a..c74c7031 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index d7d2994c..f173fc32 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index 8c1ff819..98443ee2 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index ac03bada..accc2e6a 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index cc9d99a1..9ebac10a 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index 9a4efb22..369dceed 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -1473,7 +1473,7 @@ static void Texts_Load0 (Files_Rider *r, address *r__typ, Texts_Text T) Texts_Piece p = NIL; Texts_Elem e = NIL; int32 org, pos, hlen, plen; - int8 ecnt, fno, fcnt, col, voff; + int8 ecnt, fcnt, fno, col, voff; Files_File f = NIL; Texts_FileMsg msg; CHAR mods[64][32], procs[64][32]; @@ -1653,8 +1653,9 @@ void Texts_Store (Files_Rider *r, address *r__typ, Texts_Text T) Texts_Run u = NIL, un = NIL; Texts_Elem e = NIL; int32 org, pos, delta, hlen, rlen; - int8 ecnt, fno, fcnt; + int8 ecnt, fcnt; CHAR ch; + int8 fno; Texts_FileMsg msg; Texts_IdentifyMsg iden; CHAR mods[64][32], procs[64][32]; diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index 7f02a3aa..8c6bf3f2 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/errors.c b/bootstrap/unix-88/errors.c index f284397b..b071c3a8 100644 --- a/bootstrap/unix-88/errors.c +++ b/bootstrap/unix-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/errors.h b/bootstrap/unix-88/errors.h index 5aa2a5f6..1560dc0d 100644 --- a/bootstrap/unix-88/errors.h +++ b/bootstrap/unix-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index b082e82c..f6b467bb 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -7,8 +7,8 @@ #include "SYSTEM.h" #include "Configuration.h" -#include "Console.h" #include "OPM.h" +#include "Out.h" #include "Platform.h" #include "Strings.h" @@ -28,9 +28,9 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN __DUP(title, title__len, CHAR); __DUP(cmd, cmd__len, CHAR); if (__IN(18, OPM_Options, 32)) { - Console_String(title, title__len); - Console_String(cmd, cmd__len); - Console_Ln(); + Out_String(title, title__len); + Out_String(cmd, cmd__len); + Out_Ln(); } r = Platform_System(cmd, cmd__len); status = __MASK(r, -128); @@ -39,18 +39,18 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN exitcode = exitcode - 256; } if (r != 0) { - Console_String(title, title__len); - Console_String(cmd, cmd__len); - Console_Ln(); - Console_String((CHAR*)"-- failed: status ", 19); - Console_Int(status, 1); - Console_String((CHAR*)", exitcode ", 12); - Console_Int(exitcode, 1); - Console_String((CHAR*)".", 2); - Console_Ln(); + Out_String(title, title__len); + Out_String(cmd, cmd__len); + Out_Ln(); + Out_String((CHAR*)"-- failed: status ", 19); + Out_Int(status, 1); + Out_String((CHAR*)", exitcode ", 12); + Out_Int(exitcode, 1); + Out_String((CHAR*)".", 2); + Out_Ln(); if ((status == 0 && exitcode == 127)) { - Console_String((CHAR*)"Is the C compiler in the current command path\?", 47); - Console_Ln(); + Out_String((CHAR*)"Is the C compiler in the current command path\?", 47); + Out_Ln(); } if (status != 0) { Platform_Halt(status); @@ -112,8 +112,8 @@ export void *extTools__init(void) { __DEFMOD; __MODULE_IMPORT(Configuration); - __MODULE_IMPORT(Console); __MODULE_IMPORT(OPM); + __MODULE_IMPORT(Out); __MODULE_IMPORT(Platform); __MODULE_IMPORT(Strings); __REGMOD("extTools", 0); diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index 8cdd8e01..ab7785db 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/vt100.c b/bootstrap/unix-88/vt100.c index a4bc9ec1..23b25f53 100644 --- a/bootstrap/unix-88/vt100.c +++ b/bootstrap/unix-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -6,7 +6,7 @@ #define SET uint32 #include "SYSTEM.h" -#include "Console.h" +#include "Out.h" #include "Strings.h" @@ -90,7 +90,7 @@ static void vt100_EscSeq0 (CHAR *letter, LONGINT letter__len) __DUP(letter, letter__len, CHAR); __COPY(vt100_CSI, cmd, 9); Strings_Append(letter, letter__len, (void*)cmd, 9); - Console_String(cmd, 9); + Out_String(cmd, 9); __DEL(letter); } @@ -103,7 +103,7 @@ static void vt100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len) __COPY(vt100_CSI, cmd, 7); Strings_Append(nstr, 2, (void*)cmd, 7); Strings_Append(letter, letter__len, (void*)cmd, 7); - Console_String(cmd, 7); + Out_String(cmd, 7); __DEL(letter); } @@ -116,7 +116,7 @@ static void vt100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len) __COPY(vt100_CSI, cmd, 7); Strings_Append(letter, letter__len, (void*)cmd, 7); Strings_Append(nstr, 2, (void*)cmd, 7); - Console_String(cmd, 7); + Out_String(cmd, 7); __DEL(letter); } @@ -132,7 +132,7 @@ static void vt100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len) Strings_Append((CHAR*)";", 2, (void*)cmd, 12); Strings_Append(mstr, 5, (void*)cmd, 12); Strings_Append(letter, letter__len, (void*)cmd, 12); - Console_String(cmd, 12); + Out_String(cmd, 12); __DEL(letter); } @@ -242,7 +242,7 @@ void vt100_SetAttr (CHAR *attr, LONGINT attr__len) __DUP(attr, attr__len, CHAR); __COPY(vt100_CSI, tmpstr, 16); Strings_Append(attr, attr__len, (void*)tmpstr, 16); - Console_String(tmpstr, 16); + Out_String(tmpstr, 16); __DEL(attr); } @@ -250,7 +250,7 @@ void vt100_SetAttr (CHAR *attr, LONGINT attr__len) export void *vt100__init(void) { __DEFMOD; - __MODULE_IMPORT(Console); + __MODULE_IMPORT(Out); __MODULE_IMPORT(Strings); __REGMOD("vt100", 0); __REGCMD("DECTCEMh", vt100_DECTCEMh); diff --git a/bootstrap/unix-88/vt100.h b/bootstrap/unix-88/vt100.h index 44d81f73..95c8d77e 100644 --- a/bootstrap/unix-88/vt100.h +++ b/bootstrap/unix-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-48/Compiler.c b/bootstrap/windows-48/Compiler.c index 637fd329..a3cc57ea 100644 --- a/bootstrap/windows-48/Compiler.c +++ b/bootstrap/windows-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index a3240e8e..32d0b51f 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index 4d4279da..db2b8c32 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Console.c b/bootstrap/windows-48/Console.c deleted file mode 100644 index d6ad8ef3..00000000 --- a/bootstrap/windows-48/Console.c +++ /dev/null @@ -1,157 +0,0 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ - -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 - -#include "SYSTEM.h" -#include "Platform.h" - - -static CHAR Console_line[128]; -static int16 Console_pos; - - -export void Console_Bool (BOOLEAN b); -export void Console_Char (CHAR ch); -export void Console_Flush (void); -export void Console_Hex (int32 i); -export void Console_Int (int64 i, int64 n); -export void Console_Ln (void); -export void Console_Read (CHAR *ch); -export void Console_ReadLine (CHAR *line, LONGINT line__len); -export void Console_String (CHAR *s, LONGINT s__len); - - -void Console_Flush (void) -{ - int16 error; - error = Platform_Write(Platform_StdOut, (address)Console_line, Console_pos); - Console_pos = 0; -} - -void Console_Char (CHAR ch) -{ - if (Console_pos == 128) { - Console_Flush(); - } - Console_line[__X(Console_pos, 128)] = ch; - Console_pos += 1; - if (ch == 0x0a) { - Console_Flush(); - } -} - -void Console_String (CHAR *s, LONGINT s__len) -{ - int16 i; - __DUP(s, s__len, CHAR); - i = 0; - while (s[__X(i, s__len)] != 0x00) { - Console_Char(s[__X(i, s__len)]); - i += 1; - } - __DEL(s); -} - -void Console_Int (int64 i, int64 n) -{ - CHAR s[32]; - int32 i1, k; - if (i == (int64)__LSHL(1, 31, 32)) { - __MOVE("8463847412", s, 11); - k = 10; - } else { - i1 = __ABS(__VAL(int32, i)); - s[0] = (CHAR)((int)__MOD(i1, 10) + 48); - i1 = __DIV(i1, 10); - k = 1; - while (i1 > 0) { - s[__X(k, 32)] = (CHAR)((int)__MOD(i1, 10) + 48); - i1 = __DIV(i1, 10); - k += 1; - } - } - if (i < 0) { - s[__X(k, 32)] = '-'; - k += 1; - } - while (n > (int64)k) { - Console_Char(' '); - n -= 1; - } - while (k > 0) { - k -= 1; - Console_Char(s[__X(k, 32)]); - } -} - -void Console_Ln (void) -{ - Console_Char(0x0a); -} - -void Console_Bool (BOOLEAN b) -{ - if (b) { - Console_String((CHAR*)"TRUE", 5); - } else { - Console_String((CHAR*)"FALSE", 6); - } -} - -void Console_Hex (int32 i) -{ - int16 k; - int64 n; - k = -28; - while (k <= 0) { - n = __MASK(__ASH(i, k), -16); - if (n <= 9) { - Console_Char((CHAR)(48 + n)); - } else { - Console_Char((CHAR)(55 + n)); - } - k += 4; - } -} - -void Console_Read (CHAR *ch) -{ - int32 n; - int16 error; - Console_Flush(); - error = Platform_ReadBuf(Platform_StdIn, (void*)&*ch, 1, &n); - if (n != 1) { - *ch = 0x00; - } -} - -void Console_ReadLine (CHAR *line, LONGINT line__len) -{ - int32 i; - CHAR ch; - Console_Flush(); - i = 0; - Console_Read(&ch); - while ((((i < line__len - 1 && ch != 0x0a)) && ch != 0x00)) { - line[__X(i, line__len)] = ch; - i += 1; - Console_Read(&ch); - } - line[__X(i, line__len)] = 0x00; -} - - -export void *Console__init(void) -{ - __DEFMOD; - __MODULE_IMPORT(Platform); - __REGMOD("Console", 0); - __REGCMD("Flush", Console_Flush); - __REGCMD("Ln", Console_Ln); -/* BEGIN */ - Console_pos = 0; - __ENDMOD; -} diff --git a/bootstrap/windows-48/Console.h b/bootstrap/windows-48/Console.h deleted file mode 100644 index 6549e2cc..00000000 --- a/bootstrap/windows-48/Console.h +++ /dev/null @@ -1,23 +0,0 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ - -#ifndef Console__h -#define Console__h - -#include "SYSTEM.h" - - - - -import void Console_Bool (BOOLEAN b); -import void Console_Char (CHAR ch); -import void Console_Flush (void); -import void Console_Hex (int32 i); -import void Console_Int (int64 i, int64 n); -import void Console_Ln (void); -import void Console_Read (CHAR *ch); -import void Console_ReadLine (CHAR *line, LONGINT line__len); -import void Console_String (CHAR *s, LONGINT s__len); -import void *Console__init(void); - - -#endif // Console diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 6163931f..4e669b75 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -7,7 +7,7 @@ #include "SYSTEM.h" #include "Heap.h" -#include "Console.h" +#include "Out.h" #include "Platform.h" #include "Strings.h" @@ -114,26 +114,26 @@ export void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int16 errcode) { __DUP(s, s__len, CHAR); - Console_Ln(); - Console_String((CHAR*)"-- ", 4); - Console_String(s, s__len); - Console_String((CHAR*)": ", 3); + Out_Ln(); + Out_String((CHAR*)"-- ", 4); + Out_String(s, s__len); + Out_String((CHAR*)": ", 3); if (f != NIL) { if (f->registerName[0] != 0x00) { - Console_String(f->registerName, 101); + Out_String(f->registerName, 101); } else { - Console_String(f->workName, 101); + Out_String(f->workName, 101); } if (f->fd != 0) { - Console_String((CHAR*)"f.fd = ", 8); - Console_Int(f->fd, 1); + Out_String((CHAR*)"f.fd = ", 8); + Out_Int(f->fd, 1); } } if (errcode != 0) { - Console_String((CHAR*)" errcode = ", 12); - Console_Int(errcode, 1); + Out_String((CHAR*)" errcode = ", 12); + Out_Int(errcode, 1); } - Console_Ln(); + Out_Ln(); __HALT(99); __DEL(s); } @@ -460,11 +460,11 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) done = error == 0; } if ((!done && !Platform_Absent(error))) { - Console_String((CHAR*)"Warning: Files.Old ", 20); - Console_String(name, name__len); - Console_String((CHAR*)" error = ", 10); - Console_Int(error, 0); - Console_Ln(); + Out_String((CHAR*)"Warning: Files.Old ", 20); + Out_String(name, name__len); + Out_String((CHAR*)" error = ", 10); + Out_Int(error, 0); + Out_Ln(); } if (done) { error = Platform_Identify(fd, &identity, Platform_FileIdentity__typ); @@ -1043,7 +1043,7 @@ export void *Files__init(void) { __DEFMOD; __MODULE_IMPORT(Heap); - __MODULE_IMPORT(Console); + __MODULE_IMPORT(Out); __MODULE_IMPORT(Platform); __MODULE_IMPORT(Strings); __REGMOD("Files", EnumPtrs); diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index 56c229a3..3d4b568e 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index b3eea6a3..9c9c2846 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index a7135c5b..d4afd6fe 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index 2984f32f..9cfee5c9 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -6,7 +6,6 @@ #define SET uint32 #include "SYSTEM.h" -#include "Console.h" #include "Heap.h" typedef @@ -167,7 +166,6 @@ __TDESC(Modules_CmdDesc, 1, 1) = {__TDFLDS("CmdDesc", 32), {0, -8}}; export void *Modules__init(void) { __DEFMOD; - __MODULE_IMPORT(Console); __MODULE_IMPORT(Heap); __REGMOD("Modules", 0); __INITYP(Modules_ModuleDesc, Modules_ModuleDesc, 0); diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index 9b84521f..4e105135 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index 61ddc369..ef3ea081 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -1522,13 +1522,13 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y) } else if (((*x)->typ->form == 4 && y->typ->form == 4)) { if ((*x)->class == 7) { k = (*x)->conval->intval; - if (0 > k || k > 31) { + if (0 > k || k > 63) { OPB_err(202); } } if (y->class == 7) { l = y->conval->intval; - if (0 > l || l > 31) { + if (0 > l || l > 63) { OPB_err(202); } } @@ -1559,17 +1559,18 @@ void OPB_SetElem (OPT_Node *x) OPB_err(93); } else if ((*x)->class == 7) { k = (*x)->conval->intval; - if ((0 <= k && k <= 31)) { - (*x)->conval->setval = __SETOF(k,32); - OPB_SetSetType(*x); + if ((0 <= k && k <= 63)) { + (*x)->conval->setval = 0x0; + (*x)->conval->setval |= __SETOF(k,64); } else { OPB_err(202); } + OPB_SetSetType(*x); (*x)->obj = NIL; } else { OPB_Convert(&*x, OPT_settyp); + (*x)->typ = OPT_settyp; } - (*x)->typ = OPT_settyp; } static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) @@ -1816,7 +1817,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) x = OPB_NewIntConst(OPM_SignedMaximum(x->typ->size)); break; case 7: - x = OPB_NewIntConst(OPM_MaxSet); + x = OPB_NewIntConst(__ASHL(x->typ->size, 3) - 1); x->typ = OPT_inttyp; break; case 5: diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index 07dda5db..54e81677 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 5a228db9..6739a87e 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -1860,7 +1860,7 @@ void OPC_Constant (OPT_Const con, int16 form) { int16 i; uint64 s; - int32 hex; + int64 hex; BOOLEAN skipLeading; switch (form) { case 1: @@ -1885,7 +1885,7 @@ void OPC_Constant (OPT_Const con, int16 form) OPM_WriteString((CHAR*)"0x", 3); skipLeading = 1; s = con->setval; - i = 32; + i = 64; do { hex = 0; do { diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index c9cf0ace..32ec3b7f 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index b77fcb9c..1ab50cf6 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -7,8 +7,8 @@ #include "SYSTEM.h" #include "Configuration.h" -#include "Console.h" #include "Files.h" +#include "Out.h" #include "Platform.h" #include "Strings.h" #include "Texts.h" @@ -27,7 +27,7 @@ export int16 OPM_AddressSize; static int16 OPM_GlobalAlignment; export int16 OPM_Alignment; export uint32 OPM_GlobalOptions, OPM_Options; -export int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize, OPM_MaxSet; +export int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; export int64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; @@ -102,24 +102,24 @@ export void OPM_err (int16 n); void OPM_LogW (CHAR ch) { - Console_Char(ch); + Out_Char(ch); } void OPM_LogWStr (CHAR *s, LONGINT s__len) { __DUP(s, s__len, CHAR); - Console_String(s, s__len); + Out_String(s, s__len); __DEL(s); } void OPM_LogWNum (int64 i, int64 len) { - Console_Int(i, len); + Out_Int(i, len); } void OPM_LogWLn (void) { - Console_Ln(); + Out_Ln(); } int64 OPM_SignedMaximum (int32 bytecount) @@ -455,7 +455,6 @@ void OPM_InitOptions (void) OPM_SetSize = 4; break; } - OPM_MaxSet = __ASHL(OPM_SetSize, 3) - 1; if (__IN(18, OPM_Options, 32)) { OPM_VerboseListSizes(); } @@ -1075,8 +1074,8 @@ export void *OPM__init(void) { __DEFMOD; __MODULE_IMPORT(Configuration); - __MODULE_IMPORT(Console); __MODULE_IMPORT(Files); + __MODULE_IMPORT(Out); __MODULE_IMPORT(Platform); __MODULE_IMPORT(Strings); __MODULE_IMPORT(Texts); diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index aec6ed54..960bd0ba 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h @@ -9,7 +9,7 @@ import CHAR OPM_Model[10]; import int16 OPM_AddressSize, OPM_Alignment; import uint32 OPM_GlobalOptions, OPM_Options; -import int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize, OPM_MaxSet; +import int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; import int64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index d4bdcf39..3a1bf6f6 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index c759545a..8b28d78e 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index 18c3c066..882c9331 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index 260fcd01..62dc025a 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 930f9138..a23ac389 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index 624d4fe0..6f17b409 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index a07e28a6..ba7bab5f 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index f5e41d45..30c2c7e7 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Out.c b/bootstrap/windows-48/Out.c new file mode 100644 index 00000000..60051d13 --- /dev/null +++ b/bootstrap/windows-48/Out.c @@ -0,0 +1,105 @@ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ + +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + +#include "SYSTEM.h" +#include "Platform.h" + + + + +export void Out_Char (CHAR ch); +export void Out_Int (int64 x, int64 n); +export void Out_Ln (void); +export void Out_LongReal (LONGREAL x, int16 n); +export void Out_Open (void); +export void Out_Real (REAL x, int16 n); +export void Out_String (CHAR *str, LONGINT str__len); + + +void Out_Open (void) +{ +} + +void Out_Char (CHAR ch) +{ + int16 error; + error = Platform_Write(Platform_StdOut, (address)&ch, 1); +} + +void Out_String (CHAR *str, LONGINT str__len) +{ + int32 l; + int16 error; + __DUP(str, str__len, CHAR); + l = 0; + while ((l < str__len && str[l] != 0x00)) { + l += 1; + } + error = Platform_Write(Platform_StdOut, (address)str, l); + __DEL(str); +} + +void Out_Int (int64 x, int64 n) +{ + CHAR s[22]; + int16 i; + BOOLEAN negative; + negative = x < 0; + if (x == (-9223372036854775807-1)) { + __MOVE("8085774586302733229", s, 20); + i = 19; + } else { + if (x < 0) { + x = -x; + } + s[0] = (CHAR)(48 + __MOD(x, 10)); + x = __DIV(x, 10); + i = 1; + while (x != 0) { + s[i] = (CHAR)(48 + __MOD(x, 10)); + x = __DIV(x, 10); + i += 1; + } + } + if (negative) { + s[i] = '-'; + i += 1; + } + while (n > (int64)i) { + Out_Char(' '); + n -= 1; + } + while (i > 0) { + i -= 1; + Out_Char(s[i]); + } +} + +void Out_Real (REAL x, int16 n) +{ +} + +void Out_LongReal (LONGREAL x, int16 n) +{ +} + +void Out_Ln (void) +{ + Out_String(Platform_NL, 3); +} + + +export void *Out__init(void) +{ + __DEFMOD; + __MODULE_IMPORT(Platform); + __REGMOD("Out", 0); + __REGCMD("Ln", Out_Ln); + __REGCMD("Open", Out_Open); +/* BEGIN */ + __ENDMOD; +} diff --git a/bootstrap/windows-48/Out.h b/bootstrap/windows-48/Out.h new file mode 100644 index 00000000..6717f71b --- /dev/null +++ b/bootstrap/windows-48/Out.h @@ -0,0 +1,21 @@ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ + +#ifndef Out__h +#define Out__h + +#include "SYSTEM.h" + + + + +import void Out_Char (CHAR ch); +import void Out_Int (int64 x, int64 n); +import void Out_Ln (void); +import void Out_LongReal (LONGREAL x, int16 n); +import void Out_Open (void); +import void Out_Real (REAL x, int16 n); +import void Out_String (CHAR *str, LONGINT str__len); +import void *Out__init(void); + + +#endif // Out diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 38a8dd6e..f3eea094 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -43,7 +43,7 @@ static int32 Platform_TimeStart; export int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; export int32 Platform_StdIn, Platform_StdOut, Platform_StdErr; static Platform_SignalHandler Platform_InterruptHandler; -export CHAR Platform_nl[3]; +export CHAR Platform_NL[3]; export address *Platform_FileIdentity__typ; @@ -851,8 +851,8 @@ export void *Platform__init(void) Platform_StdIn = Platform_getstdinhandle(); Platform_StdOut = Platform_getstdouthandle(); Platform_StdErr = Platform_getstderrhandle(); - Platform_nl[0] = 0x0d; - Platform_nl[1] = 0x0a; - Platform_nl[2] = 0x00; + Platform_NL[0] = 0x0d; + Platform_NL[1] = 0x0a; + Platform_NL[2] = 0x00; __ENDMOD; } diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index 0d3476b4..a07ae09d 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h @@ -27,7 +27,7 @@ import int16 Platform_ArgCount; import int32 Platform_ArgVector; import int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; import int32 Platform_StdIn, Platform_StdOut, Platform_StdErr; -import CHAR Platform_nl[3]; +import CHAR Platform_NL[3]; import address *Platform_FileIdentity__typ; diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index d7d2994c..f173fc32 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index 8c1ff819..98443ee2 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index ac03bada..accc2e6a 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index cc9d99a1..9ebac10a 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index 09661382..8fd544dc 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -1473,7 +1473,7 @@ static void Texts_Load0 (Files_Rider *r, address *r__typ, Texts_Text T) Texts_Piece p = NIL; Texts_Elem e = NIL; int32 org, pos, hlen, plen; - int8 ecnt, fno, fcnt, col, voff; + int8 ecnt, fcnt, fno, col, voff; Files_File f = NIL; Texts_FileMsg msg; CHAR mods[64][32], procs[64][32]; @@ -1653,8 +1653,9 @@ void Texts_Store (Files_Rider *r, address *r__typ, Texts_Text T) Texts_Run u = NIL, un = NIL; Texts_Elem e = NIL; int32 org, pos, delta, hlen, rlen; - int8 ecnt, fno, fcnt; + int8 ecnt, fcnt; CHAR ch; + int8 fno; Texts_FileMsg msg; Texts_IdentifyMsg iden; CHAR mods[64][32], procs[64][32]; diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index 86f8f5b7..3d119274 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/errors.c b/bootstrap/windows-48/errors.c index f284397b..b071c3a8 100644 --- a/bootstrap/windows-48/errors.c +++ b/bootstrap/windows-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/errors.h b/bootstrap/windows-48/errors.h index 5aa2a5f6..1560dc0d 100644 --- a/bootstrap/windows-48/errors.h +++ b/bootstrap/windows-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index b082e82c..f6b467bb 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -7,8 +7,8 @@ #include "SYSTEM.h" #include "Configuration.h" -#include "Console.h" #include "OPM.h" +#include "Out.h" #include "Platform.h" #include "Strings.h" @@ -28,9 +28,9 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN __DUP(title, title__len, CHAR); __DUP(cmd, cmd__len, CHAR); if (__IN(18, OPM_Options, 32)) { - Console_String(title, title__len); - Console_String(cmd, cmd__len); - Console_Ln(); + Out_String(title, title__len); + Out_String(cmd, cmd__len); + Out_Ln(); } r = Platform_System(cmd, cmd__len); status = __MASK(r, -128); @@ -39,18 +39,18 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN exitcode = exitcode - 256; } if (r != 0) { - Console_String(title, title__len); - Console_String(cmd, cmd__len); - Console_Ln(); - Console_String((CHAR*)"-- failed: status ", 19); - Console_Int(status, 1); - Console_String((CHAR*)", exitcode ", 12); - Console_Int(exitcode, 1); - Console_String((CHAR*)".", 2); - Console_Ln(); + Out_String(title, title__len); + Out_String(cmd, cmd__len); + Out_Ln(); + Out_String((CHAR*)"-- failed: status ", 19); + Out_Int(status, 1); + Out_String((CHAR*)", exitcode ", 12); + Out_Int(exitcode, 1); + Out_String((CHAR*)".", 2); + Out_Ln(); if ((status == 0 && exitcode == 127)) { - Console_String((CHAR*)"Is the C compiler in the current command path\?", 47); - Console_Ln(); + Out_String((CHAR*)"Is the C compiler in the current command path\?", 47); + Out_Ln(); } if (status != 0) { Platform_Halt(status); @@ -112,8 +112,8 @@ export void *extTools__init(void) { __DEFMOD; __MODULE_IMPORT(Configuration); - __MODULE_IMPORT(Console); __MODULE_IMPORT(OPM); + __MODULE_IMPORT(Out); __MODULE_IMPORT(Platform); __MODULE_IMPORT(Strings); __REGMOD("extTools", 0); diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index 8cdd8e01..ab7785db 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/vt100.c b/bootstrap/windows-48/vt100.c index a4bc9ec1..23b25f53 100644 --- a/bootstrap/windows-48/vt100.c +++ b/bootstrap/windows-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -6,7 +6,7 @@ #define SET uint32 #include "SYSTEM.h" -#include "Console.h" +#include "Out.h" #include "Strings.h" @@ -90,7 +90,7 @@ static void vt100_EscSeq0 (CHAR *letter, LONGINT letter__len) __DUP(letter, letter__len, CHAR); __COPY(vt100_CSI, cmd, 9); Strings_Append(letter, letter__len, (void*)cmd, 9); - Console_String(cmd, 9); + Out_String(cmd, 9); __DEL(letter); } @@ -103,7 +103,7 @@ static void vt100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len) __COPY(vt100_CSI, cmd, 7); Strings_Append(nstr, 2, (void*)cmd, 7); Strings_Append(letter, letter__len, (void*)cmd, 7); - Console_String(cmd, 7); + Out_String(cmd, 7); __DEL(letter); } @@ -116,7 +116,7 @@ static void vt100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len) __COPY(vt100_CSI, cmd, 7); Strings_Append(letter, letter__len, (void*)cmd, 7); Strings_Append(nstr, 2, (void*)cmd, 7); - Console_String(cmd, 7); + Out_String(cmd, 7); __DEL(letter); } @@ -132,7 +132,7 @@ static void vt100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len) Strings_Append((CHAR*)";", 2, (void*)cmd, 12); Strings_Append(mstr, 5, (void*)cmd, 12); Strings_Append(letter, letter__len, (void*)cmd, 12); - Console_String(cmd, 12); + Out_String(cmd, 12); __DEL(letter); } @@ -242,7 +242,7 @@ void vt100_SetAttr (CHAR *attr, LONGINT attr__len) __DUP(attr, attr__len, CHAR); __COPY(vt100_CSI, tmpstr, 16); Strings_Append(attr, attr__len, (void*)tmpstr, 16); - Console_String(tmpstr, 16); + Out_String(tmpstr, 16); __DEL(attr); } @@ -250,7 +250,7 @@ void vt100_SetAttr (CHAR *attr, LONGINT attr__len) export void *vt100__init(void) { __DEFMOD; - __MODULE_IMPORT(Console); + __MODULE_IMPORT(Out); __MODULE_IMPORT(Strings); __REGMOD("vt100", 0); __REGCMD("DECTCEMh", vt100_DECTCEMh); diff --git a/bootstrap/windows-48/vt100.h b/bootstrap/windows-48/vt100.h index 44d81f73..95c8d77e 100644 --- a/bootstrap/windows-48/vt100.h +++ b/bootstrap/windows-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-88/Compiler.c b/bootstrap/windows-88/Compiler.c index 637fd329..a3cc57ea 100644 --- a/bootstrap/windows-88/Compiler.c +++ b/bootstrap/windows-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index a3240e8e..32d0b51f 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index 4d4279da..db2b8c32 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Console.c b/bootstrap/windows-88/Console.c deleted file mode 100644 index d6ad8ef3..00000000 --- a/bootstrap/windows-88/Console.c +++ /dev/null @@ -1,157 +0,0 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ - -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 - -#include "SYSTEM.h" -#include "Platform.h" - - -static CHAR Console_line[128]; -static int16 Console_pos; - - -export void Console_Bool (BOOLEAN b); -export void Console_Char (CHAR ch); -export void Console_Flush (void); -export void Console_Hex (int32 i); -export void Console_Int (int64 i, int64 n); -export void Console_Ln (void); -export void Console_Read (CHAR *ch); -export void Console_ReadLine (CHAR *line, LONGINT line__len); -export void Console_String (CHAR *s, LONGINT s__len); - - -void Console_Flush (void) -{ - int16 error; - error = Platform_Write(Platform_StdOut, (address)Console_line, Console_pos); - Console_pos = 0; -} - -void Console_Char (CHAR ch) -{ - if (Console_pos == 128) { - Console_Flush(); - } - Console_line[__X(Console_pos, 128)] = ch; - Console_pos += 1; - if (ch == 0x0a) { - Console_Flush(); - } -} - -void Console_String (CHAR *s, LONGINT s__len) -{ - int16 i; - __DUP(s, s__len, CHAR); - i = 0; - while (s[__X(i, s__len)] != 0x00) { - Console_Char(s[__X(i, s__len)]); - i += 1; - } - __DEL(s); -} - -void Console_Int (int64 i, int64 n) -{ - CHAR s[32]; - int32 i1, k; - if (i == (int64)__LSHL(1, 31, 32)) { - __MOVE("8463847412", s, 11); - k = 10; - } else { - i1 = __ABS(__VAL(int32, i)); - s[0] = (CHAR)((int)__MOD(i1, 10) + 48); - i1 = __DIV(i1, 10); - k = 1; - while (i1 > 0) { - s[__X(k, 32)] = (CHAR)((int)__MOD(i1, 10) + 48); - i1 = __DIV(i1, 10); - k += 1; - } - } - if (i < 0) { - s[__X(k, 32)] = '-'; - k += 1; - } - while (n > (int64)k) { - Console_Char(' '); - n -= 1; - } - while (k > 0) { - k -= 1; - Console_Char(s[__X(k, 32)]); - } -} - -void Console_Ln (void) -{ - Console_Char(0x0a); -} - -void Console_Bool (BOOLEAN b) -{ - if (b) { - Console_String((CHAR*)"TRUE", 5); - } else { - Console_String((CHAR*)"FALSE", 6); - } -} - -void Console_Hex (int32 i) -{ - int16 k; - int64 n; - k = -28; - while (k <= 0) { - n = __MASK(__ASH(i, k), -16); - if (n <= 9) { - Console_Char((CHAR)(48 + n)); - } else { - Console_Char((CHAR)(55 + n)); - } - k += 4; - } -} - -void Console_Read (CHAR *ch) -{ - int32 n; - int16 error; - Console_Flush(); - error = Platform_ReadBuf(Platform_StdIn, (void*)&*ch, 1, &n); - if (n != 1) { - *ch = 0x00; - } -} - -void Console_ReadLine (CHAR *line, LONGINT line__len) -{ - int32 i; - CHAR ch; - Console_Flush(); - i = 0; - Console_Read(&ch); - while ((((i < line__len - 1 && ch != 0x0a)) && ch != 0x00)) { - line[__X(i, line__len)] = ch; - i += 1; - Console_Read(&ch); - } - line[__X(i, line__len)] = 0x00; -} - - -export void *Console__init(void) -{ - __DEFMOD; - __MODULE_IMPORT(Platform); - __REGMOD("Console", 0); - __REGCMD("Flush", Console_Flush); - __REGCMD("Ln", Console_Ln); -/* BEGIN */ - Console_pos = 0; - __ENDMOD; -} diff --git a/bootstrap/windows-88/Console.h b/bootstrap/windows-88/Console.h deleted file mode 100644 index 6549e2cc..00000000 --- a/bootstrap/windows-88/Console.h +++ /dev/null @@ -1,23 +0,0 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ - -#ifndef Console__h -#define Console__h - -#include "SYSTEM.h" - - - - -import void Console_Bool (BOOLEAN b); -import void Console_Char (CHAR ch); -import void Console_Flush (void); -import void Console_Hex (int32 i); -import void Console_Int (int64 i, int64 n); -import void Console_Ln (void); -import void Console_Read (CHAR *ch); -import void Console_ReadLine (CHAR *line, LONGINT line__len); -import void Console_String (CHAR *s, LONGINT s__len); -import void *Console__init(void); - - -#endif // Console diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index ff0e4a78..7dda2f04 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -7,7 +7,7 @@ #include "SYSTEM.h" #include "Heap.h" -#include "Console.h" +#include "Out.h" #include "Platform.h" #include "Strings.h" @@ -114,26 +114,26 @@ export void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int16 errcode) { __DUP(s, s__len, CHAR); - Console_Ln(); - Console_String((CHAR*)"-- ", 4); - Console_String(s, s__len); - Console_String((CHAR*)": ", 3); + Out_Ln(); + Out_String((CHAR*)"-- ", 4); + Out_String(s, s__len); + Out_String((CHAR*)": ", 3); if (f != NIL) { if (f->registerName[0] != 0x00) { - Console_String(f->registerName, 101); + Out_String(f->registerName, 101); } else { - Console_String(f->workName, 101); + Out_String(f->workName, 101); } if (f->fd != 0) { - Console_String((CHAR*)"f.fd = ", 8); - Console_Int(f->fd, 1); + Out_String((CHAR*)"f.fd = ", 8); + Out_Int(f->fd, 1); } } if (errcode != 0) { - Console_String((CHAR*)" errcode = ", 12); - Console_Int(errcode, 1); + Out_String((CHAR*)" errcode = ", 12); + Out_Int(errcode, 1); } - Console_Ln(); + Out_Ln(); __HALT(99); __DEL(s); } @@ -460,11 +460,11 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) done = error == 0; } if ((!done && !Platform_Absent(error))) { - Console_String((CHAR*)"Warning: Files.Old ", 20); - Console_String(name, name__len); - Console_String((CHAR*)" error = ", 10); - Console_Int(error, 0); - Console_Ln(); + Out_String((CHAR*)"Warning: Files.Old ", 20); + Out_String(name, name__len); + Out_String((CHAR*)" error = ", 10); + Out_Int(error, 0); + Out_Ln(); } if (done) { error = Platform_Identify(fd, &identity, Platform_FileIdentity__typ); @@ -1043,7 +1043,7 @@ export void *Files__init(void) { __DEFMOD; __MODULE_IMPORT(Heap); - __MODULE_IMPORT(Console); + __MODULE_IMPORT(Out); __MODULE_IMPORT(Platform); __MODULE_IMPORT(Strings); __REGMOD("Files", EnumPtrs); diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index e00e603f..82031060 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index 571a7dd2..6ab9f1ca 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index 2187094a..b183ffa4 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index e18d29cf..dab15898 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -6,7 +6,6 @@ #define SET uint32 #include "SYSTEM.h" -#include "Console.h" #include "Heap.h" typedef @@ -167,7 +166,6 @@ __TDESC(Modules_CmdDesc, 1, 1) = {__TDFLDS("CmdDesc", 40), {0, -16}}; export void *Modules__init(void) { __DEFMOD; - __MODULE_IMPORT(Console); __MODULE_IMPORT(Heap); __REGMOD("Modules", 0); __INITYP(Modules_ModuleDesc, Modules_ModuleDesc, 0); diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index 9b84521f..4e105135 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index 61ddc369..ef3ea081 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -1522,13 +1522,13 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y) } else if (((*x)->typ->form == 4 && y->typ->form == 4)) { if ((*x)->class == 7) { k = (*x)->conval->intval; - if (0 > k || k > 31) { + if (0 > k || k > 63) { OPB_err(202); } } if (y->class == 7) { l = y->conval->intval; - if (0 > l || l > 31) { + if (0 > l || l > 63) { OPB_err(202); } } @@ -1559,17 +1559,18 @@ void OPB_SetElem (OPT_Node *x) OPB_err(93); } else if ((*x)->class == 7) { k = (*x)->conval->intval; - if ((0 <= k && k <= 31)) { - (*x)->conval->setval = __SETOF(k,32); - OPB_SetSetType(*x); + if ((0 <= k && k <= 63)) { + (*x)->conval->setval = 0x0; + (*x)->conval->setval |= __SETOF(k,64); } else { OPB_err(202); } + OPB_SetSetType(*x); (*x)->obj = NIL; } else { OPB_Convert(&*x, OPT_settyp); + (*x)->typ = OPT_settyp; } - (*x)->typ = OPT_settyp; } static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) @@ -1816,7 +1817,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) x = OPB_NewIntConst(OPM_SignedMaximum(x->typ->size)); break; case 7: - x = OPB_NewIntConst(OPM_MaxSet); + x = OPB_NewIntConst(__ASHL(x->typ->size, 3) - 1); x->typ = OPT_inttyp; break; case 5: diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index 07dda5db..54e81677 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index 5a228db9..6739a87e 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -1860,7 +1860,7 @@ void OPC_Constant (OPT_Const con, int16 form) { int16 i; uint64 s; - int32 hex; + int64 hex; BOOLEAN skipLeading; switch (form) { case 1: @@ -1885,7 +1885,7 @@ void OPC_Constant (OPT_Const con, int16 form) OPM_WriteString((CHAR*)"0x", 3); skipLeading = 1; s = con->setval; - i = 32; + i = 64; do { hex = 0; do { diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index c9cf0ace..32ec3b7f 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index e894697a..732baf46 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -7,8 +7,8 @@ #include "SYSTEM.h" #include "Configuration.h" -#include "Console.h" #include "Files.h" +#include "Out.h" #include "Platform.h" #include "Strings.h" #include "Texts.h" @@ -27,7 +27,7 @@ export int16 OPM_AddressSize; static int16 OPM_GlobalAlignment; export int16 OPM_Alignment; export uint32 OPM_GlobalOptions, OPM_Options; -export int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize, OPM_MaxSet; +export int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; export int64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; @@ -102,24 +102,24 @@ export void OPM_err (int16 n); void OPM_LogW (CHAR ch) { - Console_Char(ch); + Out_Char(ch); } void OPM_LogWStr (CHAR *s, LONGINT s__len) { __DUP(s, s__len, CHAR); - Console_String(s, s__len); + Out_String(s, s__len); __DEL(s); } void OPM_LogWNum (int64 i, int64 len) { - Console_Int(i, len); + Out_Int(i, len); } void OPM_LogWLn (void) { - Console_Ln(); + Out_Ln(); } int64 OPM_SignedMaximum (int32 bytecount) @@ -455,7 +455,6 @@ void OPM_InitOptions (void) OPM_SetSize = 4; break; } - OPM_MaxSet = __ASHL(OPM_SetSize, 3) - 1; if (__IN(18, OPM_Options, 32)) { OPM_VerboseListSizes(); } @@ -1075,8 +1074,8 @@ export void *OPM__init(void) { __DEFMOD; __MODULE_IMPORT(Configuration); - __MODULE_IMPORT(Console); __MODULE_IMPORT(Files); + __MODULE_IMPORT(Out); __MODULE_IMPORT(Platform); __MODULE_IMPORT(Strings); __MODULE_IMPORT(Texts); diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index aec6ed54..960bd0ba 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h @@ -9,7 +9,7 @@ import CHAR OPM_Model[10]; import int16 OPM_AddressSize, OPM_Alignment; import uint32 OPM_GlobalOptions, OPM_Options; -import int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize, OPM_MaxSet; +import int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; import int64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index 4aa1322a..bf1c6c9b 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index c759545a..8b28d78e 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index 18c3c066..882c9331 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index 260fcd01..62dc025a 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index c3766e15..186ab7e3 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 624d4fe0..6f17b409 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 4657f6d3..f566e592 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index f5e41d45..30c2c7e7 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Out.c b/bootstrap/windows-88/Out.c new file mode 100644 index 00000000..60051d13 --- /dev/null +++ b/bootstrap/windows-88/Out.c @@ -0,0 +1,105 @@ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ + +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + +#include "SYSTEM.h" +#include "Platform.h" + + + + +export void Out_Char (CHAR ch); +export void Out_Int (int64 x, int64 n); +export void Out_Ln (void); +export void Out_LongReal (LONGREAL x, int16 n); +export void Out_Open (void); +export void Out_Real (REAL x, int16 n); +export void Out_String (CHAR *str, LONGINT str__len); + + +void Out_Open (void) +{ +} + +void Out_Char (CHAR ch) +{ + int16 error; + error = Platform_Write(Platform_StdOut, (address)&ch, 1); +} + +void Out_String (CHAR *str, LONGINT str__len) +{ + int32 l; + int16 error; + __DUP(str, str__len, CHAR); + l = 0; + while ((l < str__len && str[l] != 0x00)) { + l += 1; + } + error = Platform_Write(Platform_StdOut, (address)str, l); + __DEL(str); +} + +void Out_Int (int64 x, int64 n) +{ + CHAR s[22]; + int16 i; + BOOLEAN negative; + negative = x < 0; + if (x == (-9223372036854775807-1)) { + __MOVE("8085774586302733229", s, 20); + i = 19; + } else { + if (x < 0) { + x = -x; + } + s[0] = (CHAR)(48 + __MOD(x, 10)); + x = __DIV(x, 10); + i = 1; + while (x != 0) { + s[i] = (CHAR)(48 + __MOD(x, 10)); + x = __DIV(x, 10); + i += 1; + } + } + if (negative) { + s[i] = '-'; + i += 1; + } + while (n > (int64)i) { + Out_Char(' '); + n -= 1; + } + while (i > 0) { + i -= 1; + Out_Char(s[i]); + } +} + +void Out_Real (REAL x, int16 n) +{ +} + +void Out_LongReal (LONGREAL x, int16 n) +{ +} + +void Out_Ln (void) +{ + Out_String(Platform_NL, 3); +} + + +export void *Out__init(void) +{ + __DEFMOD; + __MODULE_IMPORT(Platform); + __REGMOD("Out", 0); + __REGCMD("Ln", Out_Ln); + __REGCMD("Open", Out_Open); +/* BEGIN */ + __ENDMOD; +} diff --git a/bootstrap/windows-88/Out.h b/bootstrap/windows-88/Out.h new file mode 100644 index 00000000..6717f71b --- /dev/null +++ b/bootstrap/windows-88/Out.h @@ -0,0 +1,21 @@ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ + +#ifndef Out__h +#define Out__h + +#include "SYSTEM.h" + + + + +import void Out_Char (CHAR ch); +import void Out_Int (int64 x, int64 n); +import void Out_Ln (void); +import void Out_LongReal (LONGREAL x, int16 n); +import void Out_Open (void); +import void Out_Real (REAL x, int16 n); +import void Out_String (CHAR *str, LONGINT str__len); +import void *Out__init(void); + + +#endif // Out diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 5a5ee14a..efcb7845 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -43,7 +43,7 @@ static int32 Platform_TimeStart; export int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; export int32 Platform_StdIn, Platform_StdOut, Platform_StdErr; static Platform_SignalHandler Platform_InterruptHandler; -export CHAR Platform_nl[3]; +export CHAR Platform_NL[3]; export address *Platform_FileIdentity__typ; @@ -851,8 +851,8 @@ export void *Platform__init(void) Platform_StdIn = Platform_getstdinhandle(); Platform_StdOut = Platform_getstdouthandle(); Platform_StdErr = Platform_getstderrhandle(); - Platform_nl[0] = 0x0d; - Platform_nl[1] = 0x0a; - Platform_nl[2] = 0x00; + Platform_NL[0] = 0x0d; + Platform_NL[1] = 0x0a; + Platform_NL[2] = 0x00; __ENDMOD; } diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index b8d8c5e7..2e13990f 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h @@ -27,7 +27,7 @@ import int16 Platform_ArgCount; import int64 Platform_ArgVector; import int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; import int32 Platform_StdIn, Platform_StdOut, Platform_StdErr; -import CHAR Platform_nl[3]; +import CHAR Platform_NL[3]; import address *Platform_FileIdentity__typ; diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index d7d2994c..f173fc32 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index 8c1ff819..98443ee2 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index ac03bada..accc2e6a 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index cc9d99a1..9ebac10a 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index 9a4efb22..369dceed 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -1473,7 +1473,7 @@ static void Texts_Load0 (Files_Rider *r, address *r__typ, Texts_Text T) Texts_Piece p = NIL; Texts_Elem e = NIL; int32 org, pos, hlen, plen; - int8 ecnt, fno, fcnt, col, voff; + int8 ecnt, fcnt, fno, col, voff; Files_File f = NIL; Texts_FileMsg msg; CHAR mods[64][32], procs[64][32]; @@ -1653,8 +1653,9 @@ void Texts_Store (Files_Rider *r, address *r__typ, Texts_Text T) Texts_Run u = NIL, un = NIL; Texts_Elem e = NIL; int32 org, pos, delta, hlen, rlen; - int8 ecnt, fno, fcnt; + int8 ecnt, fcnt; CHAR ch; + int8 fno; Texts_FileMsg msg; Texts_IdentifyMsg iden; CHAR mods[64][32], procs[64][32]; diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index 7f02a3aa..8c6bf3f2 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/errors.c b/bootstrap/windows-88/errors.c index f284397b..b071c3a8 100644 --- a/bootstrap/windows-88/errors.c +++ b/bootstrap/windows-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/errors.h b/bootstrap/windows-88/errors.h index 5aa2a5f6..1560dc0d 100644 --- a/bootstrap/windows-88/errors.h +++ b/bootstrap/windows-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index b082e82c..f6b467bb 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -7,8 +7,8 @@ #include "SYSTEM.h" #include "Configuration.h" -#include "Console.h" #include "OPM.h" +#include "Out.h" #include "Platform.h" #include "Strings.h" @@ -28,9 +28,9 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN __DUP(title, title__len, CHAR); __DUP(cmd, cmd__len, CHAR); if (__IN(18, OPM_Options, 32)) { - Console_String(title, title__len); - Console_String(cmd, cmd__len); - Console_Ln(); + Out_String(title, title__len); + Out_String(cmd, cmd__len); + Out_Ln(); } r = Platform_System(cmd, cmd__len); status = __MASK(r, -128); @@ -39,18 +39,18 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN exitcode = exitcode - 256; } if (r != 0) { - Console_String(title, title__len); - Console_String(cmd, cmd__len); - Console_Ln(); - Console_String((CHAR*)"-- failed: status ", 19); - Console_Int(status, 1); - Console_String((CHAR*)", exitcode ", 12); - Console_Int(exitcode, 1); - Console_String((CHAR*)".", 2); - Console_Ln(); + Out_String(title, title__len); + Out_String(cmd, cmd__len); + Out_Ln(); + Out_String((CHAR*)"-- failed: status ", 19); + Out_Int(status, 1); + Out_String((CHAR*)", exitcode ", 12); + Out_Int(exitcode, 1); + Out_String((CHAR*)".", 2); + Out_Ln(); if ((status == 0 && exitcode == 127)) { - Console_String((CHAR*)"Is the C compiler in the current command path\?", 47); - Console_Ln(); + Out_String((CHAR*)"Is the C compiler in the current command path\?", 47); + Out_Ln(); } if (status != 0) { Platform_Halt(status); @@ -112,8 +112,8 @@ export void *extTools__init(void) { __DEFMOD; __MODULE_IMPORT(Configuration); - __MODULE_IMPORT(Console); __MODULE_IMPORT(OPM); + __MODULE_IMPORT(Out); __MODULE_IMPORT(Platform); __MODULE_IMPORT(Strings); __REGMOD("extTools", 0); diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index 8cdd8e01..ab7785db 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/vt100.c b/bootstrap/windows-88/vt100.c index a4bc9ec1..23b25f53 100644 --- a/bootstrap/windows-88/vt100.c +++ b/bootstrap/windows-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -6,7 +6,7 @@ #define SET uint32 #include "SYSTEM.h" -#include "Console.h" +#include "Out.h" #include "Strings.h" @@ -90,7 +90,7 @@ static void vt100_EscSeq0 (CHAR *letter, LONGINT letter__len) __DUP(letter, letter__len, CHAR); __COPY(vt100_CSI, cmd, 9); Strings_Append(letter, letter__len, (void*)cmd, 9); - Console_String(cmd, 9); + Out_String(cmd, 9); __DEL(letter); } @@ -103,7 +103,7 @@ static void vt100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len) __COPY(vt100_CSI, cmd, 7); Strings_Append(nstr, 2, (void*)cmd, 7); Strings_Append(letter, letter__len, (void*)cmd, 7); - Console_String(cmd, 7); + Out_String(cmd, 7); __DEL(letter); } @@ -116,7 +116,7 @@ static void vt100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len) __COPY(vt100_CSI, cmd, 7); Strings_Append(letter, letter__len, (void*)cmd, 7); Strings_Append(nstr, 2, (void*)cmd, 7); - Console_String(cmd, 7); + Out_String(cmd, 7); __DEL(letter); } @@ -132,7 +132,7 @@ static void vt100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len) Strings_Append((CHAR*)";", 2, (void*)cmd, 12); Strings_Append(mstr, 5, (void*)cmd, 12); Strings_Append(letter, letter__len, (void*)cmd, 12); - Console_String(cmd, 12); + Out_String(cmd, 12); __DEL(letter); } @@ -242,7 +242,7 @@ void vt100_SetAttr (CHAR *attr, LONGINT attr__len) __DUP(attr, attr__len, CHAR); __COPY(vt100_CSI, tmpstr, 16); Strings_Append(attr, attr__len, (void*)tmpstr, 16); - Console_String(tmpstr, 16); + Out_String(tmpstr, 16); __DEL(attr); } @@ -250,7 +250,7 @@ void vt100_SetAttr (CHAR *attr, LONGINT attr__len) export void *vt100__init(void) { __DEFMOD; - __MODULE_IMPORT(Console); + __MODULE_IMPORT(Out); __MODULE_IMPORT(Strings); __REGMOD("vt100", 0); __REGCMD("DECTCEMh", vt100_DECTCEMh); diff --git a/bootstrap/windows-88/vt100.h b/bootstrap/windows-88/vt100.h index 44d81f73..95c8d77e 100644 --- a/bootstrap/windows-88/vt100.h +++ b/bootstrap/windows-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/makefile b/makefile index fc481183..82c50d44 100644 --- a/makefile +++ b/makefile @@ -102,7 +102,7 @@ usage: FORCE: configuration: FORCE - @$(CC) -I src/system -o a.o src/tools/make/configure.c + @$(CC) -I src/runtime -o a.o src/tools/make/configure.c @./a.o @rm a.o @echo BRANCH=$$(git rev-parse --abbrev-ref HEAD)>>Configuration.Make @@ -110,7 +110,7 @@ configuration: FORCE bootstrapconfiguration: FORCE - @$(CC) -I src/system -o a.o src/tools/make/configure.c + @$(CC) -I src/runtime -o a.o src/tools/make/configure.c @./a.o bootstrap @rm a.o @echo BRANCH=$$(git rev-parse --abbrev-ref HEAD)>>Configuration.Make @@ -120,7 +120,7 @@ bootstrapconfiguration: FORCE reportsizes: FORCE - @$(CC) -I src/system -o a.o src/tools/make/configure.c + @$(CC) -I src/runtime -o a.o src/tools/make/configure.c @./a.o report @rm a.o @@ -263,7 +263,7 @@ bootstrap: bootstrapconfiguration make -f src/tools/make/oberon.mk -s translate MODEL=2 INTSIZE=4 ADRSIZE=8 ALIGNMENT=8 PLATFORM=unix BUILDDIR=bootstrap/unix-88 && rm bootstrap/unix-88/*.sym make -f src/tools/make/oberon.mk -s translate MODEL=2 INTSIZE=2 ADRSIZE=4 ALIGNMENT=8 PLATFORM=windows BUILDDIR=bootstrap/windows-48 && rm bootstrap/windows-48/*.sym make -f src/tools/make/oberon.mk -s translate MODEL=2 INTSIZE=4 ADRSIZE=8 ALIGNMENT=8 PLATFORM=windows BUILDDIR=bootstrap/windows-88 && rm bootstrap/windows-88/*.sym - cp src/system/*.[ch] bootstrap + cp src/runtime/*.[ch] bootstrap bootstrapunclean: bootstrapconfiguration @@ -273,7 +273,7 @@ bootstrapunclean: bootstrapconfiguration make -f src/tools/make/oberon.mk -s translate MODEL=2 INTSIZE=4 ADRSIZE=8 ALIGNMENT=8 PLATFORM=unix BUILDDIR=bootstrap/unix-88 && rm bootstrap/unix-88/*.sym make -f src/tools/make/oberon.mk -s translate MODEL=2 INTSIZE=2 ADRSIZE=4 ALIGNMENT=8 PLATFORM=windows BUILDDIR=bootstrap/windows-48 && rm bootstrap/windows-48/*.sym make -f src/tools/make/oberon.mk -s translate MODEL=2 INTSIZE=4 ADRSIZE=8 ALIGNMENT=8 PLATFORM=windows BUILDDIR=bootstrap/windows-88 && rm bootstrap/windows-88/*.sym - cp src/system/*.[ch] bootstrap + cp src/runtime/*.[ch] bootstrap diff --git a/src/compiler/OPM.Mod b/src/compiler/OPM.Mod index be89719c..703ff236 100644 --- a/src/compiler/OPM.Mod +++ b/src/compiler/OPM.Mod @@ -4,7 +4,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) 31.1.2007 jt synchronized with BlackBox version, in particular PromoteIntConstToLInt added *) - IMPORT SYSTEM, Texts, Files, Platform, Console, errors, Configuration, vt100, Strings; + IMPORT SYSTEM, Texts, Files, Platform, Out, errors, Configuration, vt100, Strings; CONST OptionChar* = "-"; @@ -124,10 +124,10 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) (* ------------------------- Log Output ------------------------- *) - PROCEDURE LogW*(ch: CHAR); BEGIN Console.Char(ch) END LogW; - PROCEDURE LogWStr*(s: ARRAY OF CHAR); BEGIN Console.String(s) END LogWStr; - PROCEDURE LogWNum*(i, len: SYSTEM.INT64); BEGIN Console.Int(i, len) END LogWNum; - PROCEDURE LogWLn*; BEGIN Console.Ln END LogWLn; + PROCEDURE LogW*(ch: CHAR); BEGIN Out.Char(ch) END LogW; + PROCEDURE LogWStr*(s: ARRAY OF CHAR); BEGIN Out.String(s) END LogWStr; + PROCEDURE LogWNum*(i, len: SYSTEM.INT64); BEGIN Out.Int(i, len) END LogWNum; + PROCEDURE LogWLn*; BEGIN Out.Ln END LogWLn; diff --git a/src/compiler/extTools.Mod b/src/compiler/extTools.Mod index 077fb5a5..c241eaac 100644 --- a/src/compiler/extTools.Mod +++ b/src/compiler/extTools.Mod @@ -1,6 +1,6 @@ MODULE extTools; -IMPORT Strings, Console, Configuration, Platform, OPM; +IMPORT Strings, Out, Configuration, Platform, OPM; VAR CFLAGS: ARRAY 1023 OF CHAR; @@ -9,7 +9,7 @@ PROCEDURE execute(title: ARRAY OF CHAR; cmd: ARRAY OF CHAR); VAR r, status, exitcode: INTEGER; BEGIN IF OPM.verbose IN OPM.Options THEN - Console.String(title); Console.String(cmd); Console.Ln + Out.String(title); Out.String(cmd); Out.Ln END; r := Platform.System(cmd); status := r MOD 128; @@ -17,12 +17,12 @@ BEGIN IF exitcode > 127 THEN exitcode := exitcode - 256 END; (* Handle signed exit code *) IF r # 0 THEN - Console.String(title); Console.String(cmd); Console.Ln; - Console.String("-- failed: status "); Console.Int(status,1); - Console.String(", exitcode "); Console.Int(exitcode,1); - Console.String("."); Console.Ln; + Out.String(title); Out.String(cmd); Out.Ln; + Out.String("-- failed: status "); Out.Int(status,1); + Out.String(", exitcode "); Out.Int(exitcode,1); + Out.String("."); Out.Ln; IF (status = 0) & (exitcode = 127) THEN - Console.String("Is the C compiler in the current command path?"); Console.Ln + Out.String("Is the C compiler in the current command path?"); Out.Ln END; IF status # 0 THEN Platform.Halt(status) ELSE Platform.Halt(exitcode) END END; diff --git a/src/system/Console.Mod b/src/library/v4/Console.Mod similarity index 100% rename from src/system/Console.Mod rename to src/library/v4/Console.Mod diff --git a/src/runtime/Out.Mod b/src/runtime/Out.Mod index 245c67a8..66db1944 100644 --- a/src/runtime/Out.Mod +++ b/src/runtime/Out.Mod @@ -19,7 +19,7 @@ BEGIN error := Platform.Write(Platform.StdOut, SYSTEM.ADR(str), l) END String; -PROCEDURE Int*(x: HUGEINT; n: LONGINT); +PROCEDURE Int*(x, n: HUGEINT); CONST zero = ORD('0'); VAR s: ARRAY 22 OF CHAR; i: INTEGER; negative: BOOLEAN; BEGIN diff --git a/src/runtime/Platformunix.Mod b/src/runtime/Platformunix.Mod index 3db3f2d7..034906bd 100644 --- a/src/runtime/Platformunix.Mod +++ b/src/runtime/Platformunix.Mod @@ -389,7 +389,7 @@ END ReadBuf; -PROCEDURE -writefile(fd: LONGINT; p: SYSTEM.ADDRESS; l: LONGINT): SYSTEM.ADDRESS +PROCEDURE -writefile(fd: LONGINT; p: SYSTEM.ADDRESS; l: SYSTEM.ADDRESS): SYSTEM.ADDRESS "write(fd, (void*)(address)(p), l)"; PROCEDURE Write*(h: FileHandle; p: SYSTEM.ADDRESS; l: LONGINT): ErrorCode; diff --git a/src/system/SYSTEM.c b/src/runtime/SYSTEM.c similarity index 100% rename from src/system/SYSTEM.c rename to src/runtime/SYSTEM.c diff --git a/src/system/SYSTEM.h b/src/runtime/SYSTEM.h similarity index 100% rename from src/system/SYSTEM.h rename to src/runtime/SYSTEM.h diff --git a/src/system/WindowsWrapper.h b/src/runtime/WindowsWrapper.h similarity index 100% rename from src/system/WindowsWrapper.h rename to src/runtime/WindowsWrapper.h diff --git a/src/runtime/vt100.Mod b/src/runtime/vt100.Mod new file mode 100644 index 00000000..f21df4a6 --- /dev/null +++ b/src/runtime/vt100.Mod @@ -0,0 +1,342 @@ +MODULE vt100; + +IMPORT Out, Strings; + (* reference http://en.wikipedia.org/wiki/ANSI_escape_code + & http://misc.flogisoft.com/bash/tip_colors_and_formatting + *) +CONST + + Escape* = 1BX; + SynchronousIdle* = 16X; + LeftCrotchet* = '['; + + (* formatting *) + Bold* = "1m"; + Dim* = "2m"; + Underlined* = "4m"; + Blink* = "5m"; (* does not work with most emulators, works in tty and xterm *) + Reverse* = "7m"; (* invert the foreground and background colors *) + Hidden* = "8m"; (* useful for passwords *) + + (* reset *) + ResetAll* = "0m"; + ResetBold* = "21m"; + ResetDim* = "22m"; + ResetUnderlined* = "24m"; + ResetBlink* = "25m"; + ResetReverse* = "27m"; + ResetHidden* = "28m"; + + (* foreground colors *) + Black* = "30m"; + Red* = "31m"; + Green* = "32m"; + Yellow* = "33m"; + Blue* = "34m"; + Magenta* = "35m"; + Cyan* = "36m"; + LightGray* = "37m"; + Default* = "39m"; + DarkGray* = "90m"; + LightRed* = "91m"; + LightGreen* = "92m"; + LightYellow* = "93m"; + LightBlue* = "94m"; + LightMagenta* = "95m"; + LightCyan* = "96m"; + White* = "97m"; + + (* background colors *) + BBlack* = "40m"; + BRed* = "41m"; + BGreen* = "42m"; + BYellow* = "43m"; + BBlue* = "44m"; + BMagenta* = "45m"; + BCyan* = "46m"; + BLightGray* = "47m"; + BDefault* = "49m"; + BDarkGray* = "100m"; + BLightRed* = "101m"; + BLightGreen* = "102m"; + BLightYellow* = "103m"; + BLightBlue* = "104m"; + BLightMagenta*= "105m"; + BLightCyan* = "106m"; + BWhite* = "107m"; + + VAR + CSI* : ARRAY 5 OF CHAR; + tmpstr : ARRAY 32 OF CHAR; + + (* IntToStr routine taken from + https://github.com/romiras/Oberon-F-components/blob/master/Ott/Mod/IntStr.cp + and modified to work on 64bit system, + in order to avoid using oocIntStr, which has many dependencies *) + PROCEDURE Reverse0 (VAR str : ARRAY OF CHAR; start, end : INTEGER); + (* Reverses order of characters in the interval [start..end]. *) + VAR + h : CHAR; + BEGIN + WHILE start < end DO + h := str[start]; str[start] := str[end]; str[end] := h; + INC(start); DEC(end) + END + END Reverse0; + + PROCEDURE IntToStr*(int: LONGINT; VAR str: ARRAY OF CHAR); + (* Converts the value of `int' to string form and copies the possibly truncated + result to `str'. *) + VAR + b : ARRAY 21 OF CHAR; + s, e: INTEGER; + maxLength : SHORTINT; (* maximum number of digits representing a LONGINT value *) + BEGIN + IF SIZE(LONGINT) = 4 THEN maxLength := 11 END; + IF SIZE(LONGINT) = 8 THEN maxLength := 20 END; + (* build representation in string 'b' *) + IF int = MIN(LONGINT) THEN (* smallest LONGINT, -int is an overflow *) + IF SIZE(LONGINT) = 4 THEN + b := "-2147483648"; + e := 11 + ELSE (* SIZE(LONGINT) = 8 *) + b := "-9223372036854775808"; + e := 20 + END + ELSE + IF int < 0 THEN (* negative sign *) + b[0] := "-"; int := -int; s := 1 + ELSE (* no sign *) + s := 0 + END; + e := s; (* 's' holds starting position of string *) + REPEAT + b[e] := CHR(int MOD 10+ORD("0")); + int := int DIV 10; + INC(e) + UNTIL int = 0; + b[e] := 0X; + Reverse0(b, s, e-1); + END; + COPY(b, str) (* truncate output if necessary *) + END IntToStr; + + PROCEDURE EscSeq0 (letter : ARRAY OF CHAR); + VAR + cmd : ARRAY 9 OF CHAR; + BEGIN + COPY(CSI, cmd); + Strings.Append (letter, cmd); + Out.String (cmd); + END EscSeq0; + + PROCEDURE EscSeq (n : INTEGER; letter : ARRAY OF CHAR); + VAR nstr : ARRAY 2 OF CHAR; + cmd : ARRAY 7 OF CHAR; + BEGIN + IntToStr (n, nstr); + COPY(CSI, cmd); + Strings.Append (nstr, cmd); + Strings.Append (letter, cmd); + Out.String (cmd); + END EscSeq; + + PROCEDURE EscSeqSwapped (n : INTEGER; letter : ARRAY OF CHAR); + VAR nstr : ARRAY 2 OF CHAR; + cmd : ARRAY 7 OF CHAR; + BEGIN + IntToStr (n, nstr); + COPY(CSI, cmd); + Strings.Append (letter, cmd); + Strings.Append (nstr, cmd); + Out.String (cmd); + END EscSeqSwapped; + + PROCEDURE EscSeq2(n, m : INTEGER; letter : ARRAY OF CHAR); + VAR nstr, mstr : ARRAY 5 OF CHAR; + cmd : ARRAY 12 OF CHAR; + BEGIN + IntToStr(n, nstr); + IntToStr(m, mstr); + + COPY (CSI, cmd); + Strings.Append (nstr, cmd); + Strings.Append (';', cmd); + Strings.Append (mstr, cmd); + Strings.Append (letter, cmd); + Out.String (cmd); + + END EscSeq2; + + + +(* Cursor up + moves cursor n cells in the given direction. if the cursor is already at the edge of the screen, this has no effect *) + + PROCEDURE CUU*(n : INTEGER); + BEGIN + EscSeq (n, 'A'); + END CUU; + +(* Cursor down + moves cursor n cells in the given direction. if the cursor is already at the edge of the screen, this has no effect *) + + PROCEDURE CUD*(n : INTEGER); + BEGIN + EscSeq (n, 'B'); + END CUD; + + +(* Cursor forward + moves cursor n cells in the given direction. if the cursor is already at the edge of the screen, this has no effect *) + + PROCEDURE CUF*(n : INTEGER); + BEGIN + EscSeq (n, 'C'); + END CUF; + +(* Cursor back + moves cursor n cells in the given direction. if the cursor is already at the edge of the screen, this has no effect *) + + PROCEDURE CUB*(n : INTEGER); + BEGIN + EscSeq (n, 'D'); + END CUB; + +(* Curnser Next Line + moves cursor to beginning of the line n lines down *) + + PROCEDURE CNL*( n: INTEGER); + BEGIN + EscSeq (n, 'E'); + END CNL; + + +(* Cursor Previous Line + Moves cursor to beginning of the line n lines down *) + + PROCEDURE CPL*( n : INTEGER); + BEGIN + EscSeq (n, 'F'); + END CPL; + +(* Cursor Horizontal Absolute + Moves the cursor to column n *) + + PROCEDURE CHA*( n : INTEGER); + BEGIN + EscSeq (n, 'G'); + END CHA; + + (* Cursor position, moves cursor to row n, column m *) + PROCEDURE CUP*(n, m : INTEGER); + BEGIN + EscSeq2 (n, m, 'H'); + END CUP; + + (* Erase Display + if n = 0 then clears from cursor to end of the screen + if n = 1 then clears from cursor to beginning of the screen + if n = 2 then clears entire screen *) + + PROCEDURE ED* (n : INTEGER); + BEGIN + EscSeq(n, 'J'); + END ED; + + (* Erase in Line + Erases part of the line. If n is zero, clear from cursor to the end of the line. If n is one, clear from cursor to beginning of the line. If n is two, clear entire line. Cursor position does not change *) + PROCEDURE EL*( n : INTEGER); + BEGIN + EscSeq(n, 'K'); + END EL; + +(* Scroll Up + Scroll whole page up by n lines. New lines are added at the bottom *) + PROCEDURE SU*( n : INTEGER); + BEGIN + EscSeq(n, 'S') + END SU; + +(* Scroll Down + Scroll whole page down by n (default 1) lines. New lines are added at the top *) + PROCEDURE SD*( n : INTEGER); + BEGIN + EscSeq(n, 'T'); + END SD; + +(* Horizontal and Vertical Position, + Moves the cursor to row n, column m. Both default to 1 if omitted. Same as CUP *) + PROCEDURE HVP*(n, m : INTEGER); + BEGIN + EscSeq2 (n, m, 'f'); + END HVP; + +(* Select Graphic Rendition + Sets SGR parameters, including text color. After CSI can be zero or more parameters separated with ;. With no parameters, CSI m is treated as CSI 0 m (reset / normal), which is typical of most of the ANSI escape sequences *) + + PROCEDURE SGR*( n : INTEGER); + BEGIN + EscSeq(n, 'm'); + END SGR; + + PROCEDURE SGR2*( n, m : INTEGER); + BEGIN + EscSeq2(n, m, 'm'); + END SGR2; + +(* Device Status Report + Reports the cursor position (CPR) to the application as (as though typed at the keyboard) ESC[n;mR, where n is the row and m is the column.) *) + + PROCEDURE DSR*(n : INTEGER); + BEGIN + EscSeq(6, 'n'); + END DSR; + +(* Save Cursor Position *) + + PROCEDURE SCP*; + BEGIN + EscSeq0('s'); + END SCP; + +(* Restore Cursor Position *) + + PROCEDURE RCP*; + BEGIN + EscSeq0('u'); + END RCP; + +(* Hide the cursor *) + PROCEDURE DECTCEMl*; + BEGIN + EscSeq0("?25l") + END DECTCEMl; + +(* shows the cursor *) + PROCEDURE DECTCEMh*; + BEGIN + EscSeq0("?25h") + END DECTCEMh; + + PROCEDURE SetAttr*(attr : ARRAY OF CHAR); + VAR tmpstr : ARRAY 16 OF CHAR; + BEGIN + COPY(CSI, tmpstr); + Strings.Append(attr, tmpstr); + Out.String(tmpstr); + END SetAttr; + + BEGIN + (* init CSI sequence *) + COPY(Escape, CSI); + Strings.Append(LeftCrotchet, CSI); +(* + EraseDisplay; + GotoXY (0, 0); + COPY(CSI, tmpstr); + Strings.Append(Green, tmpstr); + Strings.Append("hello", tmpstr); + Out.String(tmpstr); Out.Ln; +*) + END vt100. diff --git a/src/system/Files.Mod b/src/system/Files.Mod deleted file mode 100644 index e4add256..00000000 --- a/src/system/Files.Mod +++ /dev/null @@ -1,749 +0,0 @@ -MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files *) - - IMPORT SYSTEM, Platform, Heap, Strings, Out := Console; - - (* standard data type I/O - - little endian, - Sint:1, Int:2, Lint:4 - ORD({0}) = 1, - false = 0, true =1 - IEEE real format, - null terminated strings, - compact numbers according to M.Odersky *) - - - CONST - nofbufs = 4; - bufsize = 4096; - noDesc = -1; - notDone = -1; - - (* file states *) - open = 0; (* OS File has been opened *) - create = 1; (* OS file needs to be created *) - close = 2; (* Register telling Create to use registerName directly: - i.e. since we're closing and all data is still in - buffers bypass writing to temp file and then renaming - and just write directly to fianl register name *) - - - TYPE - FileName = ARRAY 101 OF CHAR; - File* = POINTER TO FileDesc; - Buffer = POINTER TO BufDesc; - - FileDesc = RECORD - workName: FileName; - registerName: FileName; - tempFile: BOOLEAN; - identity: Platform.FileIdentity; - fd-: Platform.FileHandle; - len, pos: LONGINT; - bufs: ARRAY nofbufs OF Buffer; - swapper: INTEGER; - state: INTEGER; - next: File; - END; - - BufDesc = RECORD - f: File; - chg: BOOLEAN; - org: LONGINT; - size: LONGINT; - data: ARRAY bufsize OF SYSTEM.BYTE - END; - - Rider* = RECORD - res*: LONGINT; - eof*: BOOLEAN; - buf: Buffer; - org: LONGINT; (* File offset of block containing current position *) - offset: LONGINT (* Current position offset within block at org. *) - END; - - - VAR - files: File; (* List of files that have an OS file handle/descriptor assigned *) - tempno: INTEGER; - HOME: ARRAY 1024 OF CHAR; - SearchPath: POINTER TO ARRAY OF CHAR; - - - - - PROCEDURE -IdxTrap "__HALT(-1)"; - PROCEDURE -ToAdr(x: SYSTEM.INT64): SYSTEM.ADDRESS "(address)x"; - - PROCEDURE^ Finalize(o: SYSTEM.PTR); - - PROCEDURE Err(s: ARRAY OF CHAR; f: File; errcode: Platform.ErrorCode); - BEGIN - Out.Ln; Out.String("-- "); Out.String(s); Out.String(": "); - IF f # NIL THEN - IF f.registerName # "" THEN Out.String(f.registerName) ELSE Out.String(f.workName) END; - IF f.fd # 0 THEN Out.String("f.fd = "); Out.Int(f.fd,1) END - END; - IF errcode # 0 THEN Out.String(" errcode = "); Out.Int(errcode, 1) END; - Out.Ln; - HALT(99) - END Err; - - PROCEDURE MakeFileName(dir, name: ARRAY OF CHAR; VAR dest: ARRAY OF CHAR); - VAR i, j: INTEGER; - BEGIN i := 0; j := 0; - WHILE dir[i] # 0X DO dest[i] := dir[i]; INC(i) END; - IF dest[i-1] # "/" THEN dest[i] := "/"; INC(i) END; - WHILE name[j] # 0X DO dest[i] := name[j]; INC(i); INC(j) END; - dest[i] := 0X - END MakeFileName; - - PROCEDURE GetTempName(finalName: ARRAY OF CHAR; VAR name: ARRAY OF CHAR); - VAR n, i, j: LONGINT; - BEGIN - INC(tempno); n := tempno; i := 0; - IF finalName[0] # "/" THEN (* relative pathname *) - WHILE Platform.CWD[i] # 0X DO name[i] := Platform.CWD[i]; INC(i) END; - IF Platform.CWD[i-1] # "/" THEN name[i] := "/"; INC(i) END - END; - j := 0; - WHILE finalName[j] # 0X DO name[i] := finalName[j]; INC(i); INC(j) END; - DEC(i); - WHILE name[i] # "/" DO DEC(i) END; - name[i+1] := "."; name[i+2] := "t"; name[i+3] := "m"; name[i+4] := "p"; name[i+5] := "."; INC(i, 6); - WHILE n > 0 DO name[i] := CHR(n MOD 10 + ORD("0")); n := n DIV 10; INC(i) END; - name[i] := "."; INC(i); n := Platform.PID; - WHILE n > 0 DO name[i] := CHR(n MOD 10 + ORD("0")); n := n DIV 10; INC(i) END; - name[i] := 0X - END GetTempName; - - PROCEDURE Create(f: File); - VAR - identity: Platform.FileIdentity; - done: BOOLEAN; - error: Platform.ErrorCode; - err: ARRAY 32 OF CHAR; - BEGIN - (* - Out.String("Files.Create fd = "); Out.Int(f.fd,1); - Out.String(", registerName = "); Out.String(f.registerName); - Out.String(", workName = "); Out.String(f.workName); - Out.String(", state = "); Out.Int(f.state,1); - Out.Ln; - *) - IF f.fd = noDesc THEN - IF f.state = create THEN - GetTempName(f.registerName, f.workName); f.tempFile := TRUE - ELSIF f.state = close THEN - f.workName := f.registerName; f.registerName := ""; f.tempFile := FALSE - END; - error := Platform.Unlink(f.workName); (*unlink first to avoid stale NFS handles and to avoid reuse of inodes*) - - error := Platform.New(f.workName, f.fd); - done := error = 0; - IF done THEN - f.next := files; files := f; - INC(Heap.FileCount); - Heap.RegisterFinalizer(f, Finalize); - f.state := open; - f.pos := 0; - error := Platform.Identify(f.fd, f.identity); - ELSE - IF Platform.NoSuchDirectory(error) THEN err := "no such directory" - ELSIF Platform.TooManyFiles(error) THEN err := "too many files open" - ELSE err := "file not created" - END; - Err(err, f, error) - END - END - END Create; - - PROCEDURE Flush(buf: Buffer); - VAR - error: Platform.ErrorCode; - f: File; - (* identity: Platform.FileIdentity; *) - BEGIN - (* - Out.String("Files.Flush buf.f.registername = "); Out.String(buf.f.registerName); - Out.String(", buf.f.fd = "); Out.Int(buf.f.fd,1); - Out.String(", buffer at $"); Out.Hex(SYSTEM.ADR(buf.data)); - Out.String(", size "); Out.Int(buf.size,1); Out.Ln; - *) - IF buf.chg THEN f := buf.f; Create(f); - IF buf.org # f.pos THEN - error := Platform.Seek(f.fd, buf.org, Platform.SeekSet); - (* - Out.String("Seeking to "); Out.Int(buf.org,1); - Out.String(", error code "); Out.Int(error,1); Out.Ln; - *) - END; - error := Platform.Write(f.fd, SYSTEM.ADR(buf.data), buf.size); - IF error # 0 THEN Err("error writing file", f, error) END; - f.pos := buf.org + buf.size; - buf.chg := FALSE; - error := Platform.Identify(f.fd, f.identity); - IF error # 0 THEN Err("error identifying file", f, error) END; - (* - error := Platform.Identify(f.fd, identity); - f.identity.mtime := identity.mtime; - *) - END - END Flush; - - - PROCEDURE CloseOSFile(f: File); - (* Close the OS file handle and remove f from 'files' *) - VAR prev: File; error: Platform.ErrorCode; - BEGIN - IF files = f THEN files := f.next - ELSE - prev := files; - WHILE (prev # NIL) & (prev.next # f) DO prev := prev.next END; - IF prev.next # NIL THEN prev.next := f.next END - END; - error := Platform.Close(f.fd); - f.fd := noDesc; f.state := create; DEC(Heap.FileCount); - END CloseOSFile; - - - PROCEDURE Close* (f: File); - VAR - i: LONGINT; - error: Platform.ErrorCode; - BEGIN - IF (f.state # create) OR (f.registerName # "") THEN - Create(f); i := 0; - WHILE (i < nofbufs) & (f.bufs[i] # NIL) DO Flush(f.bufs[i]); INC(i) END; - error := Platform.Sync(f.fd); - IF error # 0 THEN Err("error writing file", f, error) END; - CloseOSFile(f); - END - END Close; - - PROCEDURE Length* (f: File): LONGINT; - BEGIN RETURN f.len END Length; - - PROCEDURE New* (name: ARRAY OF CHAR): File; - VAR f: File; - BEGIN - NEW(f); f.workName := ""; COPY(name, f.registerName); - f.fd := noDesc; f.state := create; f.len := 0; f.pos := 0; f.swapper := -1; (*all f.buf[i] = NIL*) - RETURN f - END New; - - PROCEDURE ScanPath(VAR pos: INTEGER; VAR dir: ARRAY OF CHAR); - (* Extract next individual directory from searchpath starting at pos, - updating pos and returning dir. - Supports ~, ~user and blanks inside path *) - VAR i: INTEGER; ch: CHAR; - BEGIN - i := 0; - IF SearchPath = NIL THEN - IF pos = 0 THEN - dir[0] := "."; i := 1; INC(pos) (* Default search path is just the current directory *) - END - ELSE - ch := SearchPath[pos]; - WHILE (ch = " ") OR (ch = ";") DO INC(pos); ch := SearchPath[pos] END; - IF ch = "~" THEN - INC(pos); ch := SearchPath[pos]; - WHILE HOME[i] # 0X DO dir[i] := HOME[i]; INC(i) END; - IF (ch # "/") & (ch # 0X) & (ch # ";") & (ch # " ") THEN - WHILE (i > 0) & (dir[i-1] # "/") DO DEC(i) END - END - END; - WHILE (ch # 0X) & (ch # ";") DO dir[i] := ch; INC(i); INC(pos); ch := SearchPath[pos] END; - WHILE (i > 0) & (dir[i-1] = " ") DO DEC(i) END - END; - dir[i] := 0X - END ScanPath; - - PROCEDURE HasDir(VAR name: ARRAY OF CHAR): BOOLEAN; - VAR i: INTEGER; ch: CHAR; - BEGIN i := 0; ch := name[0]; - WHILE (ch # 0X) & (ch # "/") DO INC(i); ch := name[i] END; - RETURN ch = "/" - END HasDir; - - PROCEDURE CacheEntry(identity: Platform.FileIdentity): File; - VAR f: File; i: INTEGER; error: Platform.ErrorCode; - BEGIN f := files; - WHILE f # NIL DO - IF Platform.SameFile(identity, f.identity) THEN - IF ~Platform.SameFileTime(identity, f.identity) THEN i := 0; - WHILE i < nofbufs DO - IF f.bufs[i] # NIL THEN f.bufs[i].org := -1; f.bufs[i] := NIL END; - INC(i) - END; - f.swapper := -1; f.identity := identity; - error := Platform.Size(f.fd, f.len); - END; - RETURN f - END; - f := f.next - END; - RETURN NIL - END CacheEntry; - - PROCEDURE Old*(name: ARRAY OF CHAR): File; - VAR - f: File; - fd: Platform.FileHandle; - pos: INTEGER; - done: BOOLEAN; - dir, path: ARRAY 256 OF CHAR; - error: Platform.ErrorCode; - identity: Platform.FileIdentity; - BEGIN - (* Out.String("Files.Old "); Out.String(name); Out.Ln; *) - IF name # "" THEN - IF HasDir(name) THEN dir := ""; COPY(name, path) - ELSE pos := 0; ScanPath(pos, dir); MakeFileName(dir, name, path); ScanPath(pos, dir) - END; - LOOP - error := Platform.OldRW(path, fd); done := error = 0; - IF ~done & Platform.TooManyFiles(error) THEN Err("too many files open", f, error) END; - IF ~done & Platform.Inaccessible(error) THEN - error := Platform.OldRO(path, fd); done := error = 0; - END; - IF ~done & ~Platform.Absent(error) THEN - Out.String("Warning: Files.Old "); Out.String(name); - Out.String(" error = "); Out.Int(error, 0); Out.Ln; - END; - IF done THEN - (* Out.String(" fd = "); Out.Int(fd,1); Out.Ln; *) - error := Platform.Identify(fd, identity); - f := CacheEntry(identity); - IF f # NIL THEN - (* error := Platform.Close(fd); DCWB: Either this should be removed or should call CloseOSFile. *) - RETURN f - ELSE NEW(f); Heap.RegisterFinalizer(f, Finalize); - f.fd := fd; f.state := open; f.pos := 0; f.swapper := -1; (*all f.buf[i] = NIL*) - error := Platform.Size(fd, f.len); - COPY(name, f.workName); f.registerName := ""; f.tempFile := FALSE; - f.identity := identity; - f.next := files; files := f; INC(Heap.FileCount); - RETURN f - END - ELSIF dir = "" THEN RETURN NIL - ELSE MakeFileName(dir, name, path); ScanPath(pos, dir) - END - END - ELSE RETURN NIL - END - END Old; - - PROCEDURE Purge* (f: File); - VAR i: INTEGER; identity: Platform.FileIdentity; error: Platform.ErrorCode; - BEGIN i := 0; - WHILE i < nofbufs DO - IF f.bufs[i] # NIL THEN f.bufs[i].org := -1; f.bufs[i] := NIL END; - INC(i) - END; - IF f.fd # noDesc THEN - error := Platform.Truncate(f.fd, 0); - error := Platform.Seek(f.fd, 0, Platform.SeekSet) - END; - f.pos := 0; f.len := 0; f.swapper := -1; - error := Platform.Identify(f.fd, identity); Platform.SetMTime(f.identity, identity) - END Purge; - - PROCEDURE GetDate* (f: File; VAR t, d: LONGINT); - VAR - identity: Platform.FileIdentity; error: Platform.ErrorCode; - BEGIN - Create(f); error := Platform.Identify(f.fd, identity); - Platform.MTimeAsClock(identity, t, d) - END GetDate; - - PROCEDURE Pos* (VAR r: Rider): LONGINT; - BEGIN RETURN r.org + r.offset - END Pos; - - PROCEDURE Set* (VAR r: Rider; f: File; pos: LONGINT); - VAR org, offset, i, n: LONGINT; buf: Buffer; error: Platform.ErrorCode; - BEGIN - IF f # NIL THEN - (* - Out.String("Files.Set rider on fd = "); Out.Int(f.fd,1); - Out.String(", registerName = "); Out.String(f.registerName); - Out.String(", workName = "); Out.String(f.workName); - Out.String(", state = "); Out.Int(f.state,1); - Out.Ln; - *) - IF pos > f.len THEN pos := f.len ELSIF pos < 0 THEN pos := 0 END; - offset := pos MOD bufsize; org := pos - offset; i := 0; - WHILE (i < nofbufs) & (f.bufs[i] # NIL) & (org # f.bufs[i].org) DO INC(i) END; - IF i < nofbufs THEN - IF f.bufs[i] = NIL THEN NEW(buf); buf.chg := FALSE; buf.org := -1; buf.f := f; f.bufs[i] := buf - ELSE buf := f.bufs[i] - END - ELSE - f.swapper := (f.swapper + 1) MOD nofbufs; - buf := f.bufs[f.swapper]; - Flush(buf) - END; - IF buf.org # org THEN - IF org = f.len THEN buf.size := 0 - ELSE Create(f); - IF f.pos # org THEN error := Platform.Seek(f.fd, org, Platform.SeekSet) END; - error := Platform.ReadBuf(f.fd, buf.data, n); - IF error # 0 THEN Err("read from file not done", f, error) END; - f.pos := org + n; - buf.size := n - END; - buf.org := org; buf.chg := FALSE - END - ELSE buf := NIL; org := 0; offset := 0 - END; - r.buf := buf; r.org := org; r.offset := offset; r.eof := FALSE; r.res := 0 - END Set; - - PROCEDURE Read* (VAR r: Rider; VAR x: SYSTEM.BYTE); - VAR offset: LONGINT; buf: Buffer; - BEGIN - buf := r.buf; offset := r.offset; - IF r.org # buf.org THEN Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset END; - IF (offset < buf.size) THEN - x := buf.data[offset]; r.offset := offset + 1 - ELSIF r.org + offset < buf.f.len THEN - Set(r, r.buf.f, r.org + offset); - x := r.buf.data[0]; r.offset := 1 - ELSE - x := 0X; r.eof := TRUE - END - END Read; - - PROCEDURE ReadBytes* (VAR r: Rider; VAR x: ARRAY OF SYSTEM.BYTE; n: LONGINT); - VAR xpos, min, restInBuf, offset: LONGINT; buf: Buffer; - BEGIN - IF n > LEN(x) THEN IdxTrap END; - xpos := 0; buf := r.buf; offset := r.offset; - WHILE n > 0 DO - IF (r.org # buf.org) OR (offset >= bufsize) THEN - Set(r, buf.f, r.org + offset); - buf := r.buf; offset := r.offset - END; - restInBuf := buf.size - offset; - IF restInBuf = 0 THEN r.res := n; r.eof := TRUE; RETURN - ELSIF n > restInBuf THEN min := restInBuf ELSE min := n END; - SYSTEM.MOVE(SYSTEM.ADR(buf.data) + ToAdr(offset), SYSTEM.ADR(x) + ToAdr(xpos), min); - INC(offset, min); r.offset := offset; INC(xpos, min); DEC(n, min) - END; - r.res := 0; r.eof := FALSE - END ReadBytes; - - PROCEDURE Base* (VAR r: Rider): File; - BEGIN RETURN r.buf.f - END Base; - - PROCEDURE Write* (VAR r: Rider; x: SYSTEM.BYTE); - VAR buf: Buffer; offset: LONGINT; - BEGIN - buf := r.buf; offset := r.offset; - IF (r.org # buf.org) OR (offset >= bufsize) THEN - Set(r, buf.f, r.org + offset); - buf := r.buf; offset := r.offset - END; - buf.data[offset] := x; - buf.chg := TRUE; - IF offset = buf.size THEN - INC(buf.size); INC(buf.f.len) - END; - r.offset := offset + 1; r.res := 0 - END Write; - - PROCEDURE WriteBytes* (VAR r: Rider; VAR x: ARRAY OF SYSTEM.BYTE; n: LONGINT); - VAR xpos, min, restInBuf, offset: LONGINT; buf: Buffer; - BEGIN - IF n > LEN(x) THEN IdxTrap END; - xpos := 0; buf := r.buf; offset := r.offset; - WHILE n > 0 DO - IF (r.org # buf.org) OR (offset >= bufsize) THEN - Set(r, buf.f, r.org + offset); - buf := r.buf; offset := r.offset - END; - restInBuf := bufsize - offset; - IF n > restInBuf THEN min := restInBuf ELSE min := n END; - SYSTEM.MOVE(SYSTEM.ADR(x) + ToAdr(xpos), SYSTEM.ADR(buf.data) + ToAdr(offset), min); - INC(offset, min); r.offset := offset; - IF offset > buf.size THEN INC(buf.f.len, offset - buf.size); buf.size := offset END; - INC(xpos, min); DEC(n, min); buf.chg := TRUE - END; - r.res := 0 - END WriteBytes; - -(* another solution would be one that is similar to ReadBytes, WriteBytes. -No code duplication, more symmetric, only two ifs for -Read and Write in buffer, buf.size replaced by bufsize in Write ops, buf.size and len -must be made consistent with offset (if offset > buf.size) in a lazy way. - -PROCEDURE Write* (VAR r: Rider; x: SYSTEM.BYTE); - VAR buf: Buffer; offset: LONGINT; -BEGIN - buf := r.buf; offset := r.offset; - IF (offset >= bufsize) OR (r.org # buf.org) THEN - Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset; - END; - buf.data[offset] := x; r.offset := offset + 1; buf.chg := TRUE -END Write; - -PROCEDURE WriteBytes ... - -PROCEDURE Read* (VAR r: Rider; VAR x: SYSTEM.BYTE); - VAR offset: LONGINT; buf: Buffer; -BEGIN - buf := r.buf; offset := r.offset; - IF (offset >= buf.size) OR (r.org # buf.org) THEN - IF r.org + offset >= buf.f.len THEN x := 0X; r.eof := TRUE; RETURN - ELSE Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset - END - END; - x := buf.data[offset]; r.offset := offset + 1 -END Read; - -but this would also affect Set, Length, and Flush. -Especially Length would become fairly complex. -*) - - PROCEDURE Delete*(name: ARRAY OF CHAR; VAR res: INTEGER); - BEGIN res := Platform.Unlink(name) END Delete; - - PROCEDURE Rename* (old, new: ARRAY OF CHAR; VAR res: INTEGER); - VAR - fdold, fdnew: Platform.FileHandle; - n: LONGINT; - error, ignore: Platform.ErrorCode; - oldidentity, newidentity: Platform.FileIdentity; - buf: ARRAY 4096 OF CHAR; - BEGIN - (* - Out.String("Files.Rename old = "); Out.String(old); - Out.String(", new = "); Out.String(new); Out.Ln; - *) - error := Platform.IdentifyByName(old, oldidentity); - IF error = 0 THEN - error := Platform.IdentifyByName(new, newidentity); - IF (error # 0) & ~Platform.SameFile(oldidentity, newidentity) THEN - Delete(new, error); (* work around stale nfs handles *) - END; - error := Platform.Rename(old, new); - (* Out.String("Platform.Rename error code "); Out.Int(error,1); Out.Ln; *) - IF ~Platform.DifferentFilesystems(error) THEN - res := error; RETURN - ELSE - (* cross device link, move the file *) - error := Platform.OldRO(old, fdold); - IF error # 0 THEN res := 2; RETURN END; - error := Platform.New(new, fdnew); - IF error # 0 THEN error := Platform.Close(fdold); res := 3; RETURN END; - error := Platform.Read(fdold, SYSTEM.ADR(buf), bufsize, n); - WHILE n > 0 DO - error := Platform.Write(fdnew, SYSTEM.ADR(buf), n); - IF error # 0 THEN - ignore := Platform.Close(fdold); - ignore := Platform.Close(fdnew); - Err("cannot move file", NIL, error) - END; - error := Platform.Read(fdold, SYSTEM.ADR(buf), bufsize, n); - END; - ignore := Platform.Close(fdold); - ignore := Platform.Close(fdnew); - IF n = 0 THEN - error := Platform.Unlink(old); res := 0 - ELSE - Err("cannot move file", NIL, error) - END; - END - ELSE - res := 2 (* old file not found *) - END - END Rename; - - PROCEDURE Register* (f: File); - VAR idx, errcode: INTEGER; f1: File; file: ARRAY 104 OF CHAR; - BEGIN - (* - Out.String("Files.Register f.registerName = "); Out.String(f.registerName); - Out.String(", fd = "); Out.Int(f.fd,1); Out.Ln; - *) - IF (f.state = create) & (f.registerName # "") THEN f.state := close (* shortcut renaming *) END; - Close(f); - IF f.registerName # "" THEN - Rename(f.workName, f.registerName, errcode); - (* - Out.String("Renamed (for register) f.fd = "); Out.Int(f.fd,1); - Out.String(" from workname "); Out.String(f.workName); - Out.String(" to registerName "); Out.String(f.registerName); - Out.String(" errorcode = "); Out.Int(errcode,1); Out.Ln; - *) - IF errcode # 0 THEN COPY(f.registerName, file); HALT(99) END; - f.workName := f.registerName; f.registerName := ""; f.tempFile := FALSE - END - END Register; - - PROCEDURE ChangeDirectory*(path: ARRAY OF CHAR; VAR res: INTEGER); - BEGIN - res := Platform.Chdir(path); - END ChangeDirectory; - - PROCEDURE FlipBytes(VAR src, dest: ARRAY OF SYSTEM.BYTE); - VAR i, j: LONGINT; - BEGIN - IF ~Platform.LittleEndian THEN i := LEN(src); j := 0; - WHILE i > 0 DO DEC(i); dest[j] := src[i]; INC(j) END - ELSE SYSTEM.MOVE(SYSTEM.ADR(src), SYSTEM.ADR(dest), LEN(src)) - END - END FlipBytes; - - PROCEDURE ReadBool* (VAR R: Rider; VAR x: BOOLEAN); - BEGIN Read(R, SYSTEM.VAL(CHAR, x)) - END ReadBool; - - PROCEDURE ReadInt* (VAR R: Rider; VAR x: INTEGER); - VAR b: ARRAY 2 OF CHAR; - BEGIN ReadBytes(R, b, 2); - x := ORD(b[0]) + ORD(b[1])*256 - END ReadInt; - - PROCEDURE ReadLInt* (VAR R: Rider; VAR x: LONGINT); - VAR b: ARRAY 4 OF CHAR; - BEGIN ReadBytes(R, b, 4); - x := ORD(b[0]) + ORD(b[1])*100H + ORD(b[2])*10000H + ORD(b[3])*1000000H - END ReadLInt; - - PROCEDURE ReadSet* (VAR R: Rider; VAR x: SET); - (* 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); - (* 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); - VAR b: ARRAY 4 OF CHAR; - BEGIN ReadBytes(R, b, 4); FlipBytes(b, x) - END ReadReal; - - PROCEDURE ReadLReal* (VAR R: Rider; VAR x: LONGREAL); - VAR b: ARRAY 8 OF CHAR; - BEGIN ReadBytes(R, b, 8); FlipBytes(b, x) - END ReadLReal; - - PROCEDURE ReadString* (VAR R: Rider; VAR x: ARRAY OF CHAR); - VAR i: INTEGER; ch: CHAR; - BEGIN i := 0; - REPEAT Read(R, ch); x[i] := ch; INC(i) UNTIL ch = 0X - END ReadString; - - PROCEDURE ReadLine* (VAR R: Rider; VAR x: ARRAY OF CHAR); - VAR i: INTEGER; ch: CHAR; b : BOOLEAN; - BEGIN - i := 0; - b := FALSE; - REPEAT - Read(R, ch); - IF ((ch = 0X) OR (ch = 0AX) OR (ch = 0DX)) THEN - b := TRUE - ELSE - x[i] := ch; - INC(i); - END; - UNTIL b - END ReadLine; - - PROCEDURE ReadNum*(VAR R: Rider; VAR x: ARRAY OF SYSTEM.BYTE); - VAR s, b: SYSTEM.INT8; q: SYSTEM.INT64; - BEGIN - s := 0; q := 0; Read(R, b); - WHILE b < 0 DO INC(q, ASH(b+128, s)); INC(s, 7); Read(R, b) END; - INC(q, ASH(b MOD 64 - b DIV 64 * 64, s)); - ASSERT(LEN(x) <= 8); - SYSTEM.MOVE(SYSTEM.ADR(q), SYSTEM.ADR(x), LEN(x)) (* Assumes little endian representation of q and x. *) - END ReadNum; - - PROCEDURE WriteBool* (VAR R: Rider; x: BOOLEAN); - BEGIN Write(R, SYSTEM.VAL(CHAR, x)) - END WriteBool; - - PROCEDURE WriteInt* (VAR R: Rider; x: INTEGER); - VAR b: ARRAY 2 OF CHAR; - BEGIN b[0] := CHR(x); b[1] := CHR(x DIV 256); - WriteBytes(R, b, 2); - END WriteInt; - - PROCEDURE WriteLInt* (VAR R: Rider; x: LONGINT); - VAR b: ARRAY 4 OF CHAR; - BEGIN - b[0] := CHR(x); b[1] := CHR(x DIV 100H); b[2] := CHR(x DIV 10000H); b[3] := CHR(x DIV 1000000H); - WriteBytes(R, b, 4); - END WriteLInt; - - PROCEDURE WriteSet* (VAR R: Rider; x: SET); - VAR b: ARRAY 4 OF CHAR; i: LONGINT; - BEGIN i := SYSTEM.VAL(LONGINT, x); - 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; - - PROCEDURE WriteReal* (VAR R: Rider; x: REAL); - VAR b: ARRAY 4 OF CHAR; - BEGIN FlipBytes(x, b); WriteBytes(R, b, 4) - END WriteReal; - - PROCEDURE WriteLReal* (VAR R: Rider; x: LONGREAL); - VAR b: ARRAY 8 OF CHAR; - BEGIN FlipBytes(x, b); WriteBytes(R, b, 8) - END WriteLReal; - - PROCEDURE WriteString* (VAR R: Rider; x: ARRAY [1] OF CHAR); - VAR i: INTEGER; - BEGIN i := 0; - WHILE x[i] # 0X DO INC(i) END; - WriteBytes(R, x, i+1) - END WriteString; - - PROCEDURE WriteNum* (VAR R: Rider; x: SYSTEM.INT64); - BEGIN - WHILE (x < - 64) OR (x > 63) DO Write(R, CHR(x MOD 128 + 128)); x := x DIV 128 END; - Write(R, CHR(x MOD 128)) - END WriteNum; - - PROCEDURE GetName*(f: File; VAR name: ARRAY OF CHAR); - BEGIN - COPY (f.workName, name); - END GetName; - - PROCEDURE Finalize(o: SYSTEM.PTR); - VAR f: File; res: LONGINT; - BEGIN - f := SYSTEM.VAL(File, o); - (* - Out.String("Files.Finalize f.fd = "); Out.Int(f.fd,1); - Out.String(", f.registername = "); Out.String(f.registerName); - Out.String(", f.workName = "); Out.String(f.workName); Out.Ln; - *) - IF f.fd >= 0 THEN - CloseOSFile(f); - IF f.tempFile THEN res := Platform.Unlink(f.workName) END - END - END Finalize; - - PROCEDURE SetSearchPath*(path: ARRAY OF CHAR); - BEGIN - IF Strings.Length(path) # 0 THEN - NEW(SearchPath, Strings.Length(path)+1); - COPY(path, SearchPath^) - ELSE - SearchPath := NIL - END - END SetSearchPath; - - -BEGIN - tempno := -1; - Heap.FileCount := 0; - HOME := ""; Platform.GetEnv("HOME", HOME); -END Files. diff --git a/src/system/Heap.Mod b/src/system/Heap.Mod deleted file mode 100644 index b05b218b..00000000 --- a/src/system/Heap.Mod +++ /dev/null @@ -1,578 +0,0 @@ -MODULE Heap; - - IMPORT S := SYSTEM; (* Cannot import anything else as heap initialization must complete - before any other modules are initialized. *) - - CONST - ModNameLen = 20; - CmdNameLen = 24; - SZA = SIZE(S.ADDRESS); (* Size of address *) - Unit = 4*SZA; (* smallest possible heap block *) - nofLists = 9; (* number of free_lists *) - heapSize0 = 8000*Unit; (* startup heap size *) - - (* all blocks look the same: - free blocks describe themselves: size = Unit - tag = &tag++ - ->block size - sentinel = -SZA - next - *) - - (* heap chunks *) - nextChnkOff = S.VAL(S.ADDRESS, 0); (* next heap chunk, sorted ascendingly! *) - endOff = S.VAL(S.ADDRESS, SZA); (* end of heap chunk *) - blkOff = S.VAL(S.ADDRESS, 3*SZA); (* first block in a chunk *) - - (* heap blocks *) - tagOff = S.VAL(S.ADDRESS, 0); (* block starts with tag *) - sizeOff = S.VAL(S.ADDRESS, SZA); (* block size in free block relative to block start *) - sntlOff = S.VAL(S.ADDRESS, 2*SZA); (* pointer offset table sentinel in free block relative to block start *) - nextOff = S.VAL(S.ADDRESS, 3*SZA); (* next pointer in free block relative to block start *) - NoPtrSntl = S.VAL(S.ADDRESS, -SZA); - AddressZero = S.VAL(S.ADDRESS, 0); - - TYPE - ModuleName = ARRAY ModNameLen OF CHAR; - CmdName = ARRAY CmdNameLen OF CHAR; - - Module = POINTER TO ModuleDesc; - Cmd = POINTER TO CmdDesc; - - EnumProc = PROCEDURE(P: PROCEDURE(p: S.PTR)); - - ModuleDesc = RECORD - next: Module; - name: ModuleName; - refcnt: LONGINT; - cmds: Cmd; - types: S.ADDRESS; - enumPtrs: EnumProc; - reserved1, reserved2: LONGINT - END ; - - Command = PROCEDURE; - - CmdDesc = RECORD - next: Cmd; - name: CmdName; - cmd: Command - END ; - - Finalizer = PROCEDURE(obj: S.PTR); - - FinNode = POINTER TO FinDesc; - FinDesc = RECORD - next: FinNode; - obj: S.ADDRESS; (* weak pointer *) - marked: BOOLEAN; - finalize: Finalizer; - END ; - - VAR - (* the list of loaded (=initialization started) modules *) - modules*: S.PTR; - - freeList: ARRAY nofLists + 1 OF S.ADDRESS; (* dummy, 16, 32, 48, 64, 80, 96, 112, 128, sentinel *) - bigBlocks: S.ADDRESS; - allocated*: S.ADDRESS; - firstTry: BOOLEAN; - - (* extensible heap *) - heap: S.ADDRESS; (* the sorted list of heap chunks *) - heapend: S.ADDRESS; (* max possible pointer value (used for stack collection) *) - heapsize*: S.ADDRESS; (* the sum of all heap chunk sizes *) - - (* finalization candidates *) - fin: FinNode; - - (* garbage collector locking *) - lockdepth: INTEGER; - interrupted: BOOLEAN; - - (* File system file count monitor *) - FileCount*: INTEGER; - - - PROCEDURE Lock*; - BEGIN - INC(lockdepth); - END Lock; - - PROCEDURE -PlatformHalt(code: LONGINT) "Platform_Halt(code)"; - - PROCEDURE Unlock*; - BEGIN - DEC(lockdepth); - IF interrupted & (lockdepth = 0) THEN - PlatformHalt(-9); - END - END Unlock; - - - (* - PROCEDURE TAS*(VAR flag:BOOLEAN): BOOLEAN; (* added for compatibility with ulmSYSTEM module; noch *) - VAR oldflag : BOOLEAN; - BEGIN - oldflag := flag; - flag := TRUE; - RETURN oldflag; - END TAS; - *) - - PROCEDURE REGMOD*(VAR name: ModuleName; enumPtrs: EnumProc): S.PTR; - VAR m: Module; - BEGIN - (* REGMOD is called at the start of module initialisation code before that modules - type descriptors have been set up. 'NEW' depends on the Heap modules type - descriptors being ready for use, therefore, just for the Heap module itself, we - must use S.NEW. *) - IF name = "Heap" THEN - S.NEW(m, SIZE(ModuleDesc)) - ELSE - NEW(m) - END; - m.types := 0; m.cmds := NIL; - COPY(name, m.name); m.refcnt := 0; m.enumPtrs := enumPtrs; m.next := S.VAL(Module, modules); - modules := m; - RETURN m - END REGMOD; - - PROCEDURE REGCMD*(m: Module; VAR name: CmdName; cmd: Command); - VAR c: Cmd; - BEGIN - (* REGCMD is called during module initialisation code before that modules - type descriptors have been set up. 'NEW' depends on the Heap modules type - descriptors being ready for use, therefore, just for the commands registered - by the Heap module itself, we must use S.NEW. *) - IF m.name = "Heap" THEN - S.NEW(c, SIZE(CmdDesc)) - ELSE - NEW(c) - END; - COPY(name, c.name); c.cmd := cmd; c.next := m.cmds; m.cmds := c - END REGCMD; - - PROCEDURE REGTYP*(m: Module; typ: S.ADDRESS); - BEGIN S.PUT(typ, m.types); m.types := typ - END REGTYP; - - PROCEDURE INCREF*(m: Module); - BEGIN INC(m.refcnt) - END INCREF; - - - PROCEDURE -ExternPlatformOSAllocate "extern address Platform_OSAllocate(address size);"; - PROCEDURE -OSAllocate(size: S.ADDRESS): S.ADDRESS "Platform_OSAllocate(size)"; - - PROCEDURE NewChunk(blksz: S.ADDRESS): S.ADDRESS; - VAR chnk: S.ADDRESS; - BEGIN - chnk := OSAllocate(blksz + blkOff); - IF chnk # 0 THEN - S.PUT(chnk + endOff, chnk + (blkOff + blksz)); - S.PUT(chnk + blkOff, chnk + (blkOff + sizeOff)); - S.PUT(chnk + (blkOff + sizeOff), blksz); - S.PUT(chnk + (blkOff + sntlOff), NoPtrSntl); - S.PUT(chnk + (blkOff + nextOff), bigBlocks); - bigBlocks := chnk + blkOff; - INC(heapsize, blksz) - END ; - RETURN chnk - END NewChunk; - - PROCEDURE ExtendHeap(blksz: S.ADDRESS); - VAR size, chnk, j, next: S.ADDRESS; - BEGIN - IF blksz > 10000*Unit THEN size := blksz - ELSE size := 10000*Unit (* additional heuristics *) - END ; - chnk := NewChunk(size); - IF chnk # 0 THEN - (*sorted insertion*) - IF chnk < heap THEN - S.PUT(chnk, heap); heap := chnk - ELSE - j := heap; S.GET(j, next); - WHILE (next # 0) & (chnk > next) DO - j := next; - S.GET(j, next) - END; - S.PUT(chnk, next); S.PUT(j, chnk) - END ; - IF next = 0 THEN S.GET(chnk+endOff, heapend) END - END - END ExtendHeap; - - PROCEDURE ^GC*(markStack: BOOLEAN); - - PROCEDURE NEWREC*(tag: S.ADDRESS): S.PTR; - VAR - i, i0, di, blksz, restsize, t, adr, end, next, prev: S.ADDRESS; - new: S.PTR; - BEGIN - Lock(); - S.GET(tag, blksz); - - ASSERT((Unit = 16) OR (Unit = 32)); - ASSERT(SIZE(S.PTR) = SIZE(S.ADDRESS)); - ASSERT(blksz MOD Unit = 0); - - i0 := blksz DIV Unit; i := i0; - IF i < nofLists THEN adr := freeList[i]; - WHILE adr = 0 DO INC(i); adr := freeList[i] END - END ; - IF i < nofLists THEN (* unlink *) - S.GET(adr + nextOff, next); - freeList[i] := next; - IF i # i0 THEN (* split *) - di := i - i0; restsize := di * Unit; end := adr + restsize; - S.PUT(end + sizeOff, blksz); - S.PUT(end + sntlOff, NoPtrSntl); - S.PUT(end, end + sizeOff); - S.PUT(adr + sizeOff, restsize); - S.PUT(adr + nextOff, freeList[di]); - freeList[di] := adr; - INC(adr, restsize) - END - ELSE - adr := bigBlocks; prev := 0; - LOOP - IF adr = 0 THEN - IF firstTry THEN - GC(TRUE); INC(blksz, Unit); - IF (heapsize - allocated - blksz) * 4 < heapsize THEN - (* heap is still almost full; expand to avoid thrashing *) - ExtendHeap((allocated + blksz) DIV (3*Unit) * (4*Unit) - heapsize) - END ; - firstTry := FALSE; new := NEWREC(tag); firstTry := TRUE; - IF new = NIL THEN - (* depending on the fragmentation, the heap may not have been extended by - the anti-thrashing heuristics above *) - ExtendHeap((allocated + blksz) DIV (3*Unit) * (4*Unit) - heapsize); - new := NEWREC(tag); (* will find a free block if heap has been expanded properly *) - END ; - Unlock(); RETURN new - ELSE - Unlock(); RETURN NIL - END - END ; - S.GET(adr+sizeOff, t); - IF t >= blksz THEN EXIT END ; - prev := adr; S.GET(adr + nextOff, adr) - END ; - restsize := t - blksz; end := adr + restsize; - S.PUT(end + sizeOff, blksz); - S.PUT(end + sntlOff, NoPtrSntl); - S.PUT(end, end + sizeOff); - IF restsize > nofLists * Unit THEN (*resize*) - S.PUT(adr + sizeOff, restsize) - ELSE (*unlink*) - S.GET(adr + nextOff, next); - IF prev = 0 THEN bigBlocks := next - ELSE S.PUT(prev + nextOff, next); - END ; - IF restsize > 0 THEN (*move*) - di := restsize DIV Unit; - S.PUT(adr + sizeOff, restsize); - S.PUT(adr + nextOff, freeList[di]); - freeList[di] := adr - END - END ; - INC(adr, restsize) - END ; - i := adr + 4*SZA; end := adr + blksz; - WHILE i < end DO (*deliberately unrolled*) - S.PUT(i, AddressZero); - S.PUT(i + SZA, AddressZero); - S.PUT(i + 2*SZA, AddressZero); - S.PUT(i + 3*SZA, AddressZero); - INC(i, 4*SZA) - END ; - S.PUT(adr + nextOff, AddressZero); - S.PUT(adr, tag); - S.PUT(adr + sizeOff, AddressZero); - S.PUT(adr + sntlOff, AddressZero); - INC(allocated, blksz); - Unlock(); - RETURN S.VAL(S.PTR, adr + SZA) - END NEWREC; - - PROCEDURE NEWBLK*(size: S.ADDRESS): S.PTR; - VAR blksz, tag: S.ADDRESS; new: S.PTR; - BEGIN - Lock(); - blksz := (size + (4*SZA + Unit - 1)) DIV Unit * Unit; (*size + tag + meta + blksz + sntnl + UnitAlignment*) - new := NEWREC(S.ADR(blksz)); - tag := S.VAL(S.ADDRESS, new) + blksz - 3*SZA; - S.PUT(tag - SZA, AddressZero); (*reserved for meta info*) - S.PUT(tag, blksz); - S.PUT(tag + SZA, NoPtrSntl); - S.PUT(S.VAL(S.ADDRESS, new) - SZA, tag); - Unlock(); - RETURN new - END NEWBLK; - - PROCEDURE Mark(q: S.ADDRESS); - VAR p, tag, offset, fld, n, tagbits: S.ADDRESS; - BEGIN - IF q # 0 THEN - S.GET(q - SZA, tagbits); (* Load the tag for the record at q *) - IF ~ODD(tagbits) THEN (* If it has not already been marked *) - S.PUT(q - SZA, tagbits + 1); (* Mark it *) - p := 0; - tag := tagbits + SZA; (* Tag addresses first offset *) - LOOP - S.GET(tag, offset); (* Get next ptr field offset *) - IF offset < 0 THEN (* Sentinel reached: Value is -8*(#fields+1) *) - S.PUT(q - SZA, tag + offset + 1); (* Rotate base ptr into tag *) - IF p = 0 THEN EXIT END ; - n := q; q := p; - S.GET(q - SZA, tag); DEC(tag, 1); - S.GET(tag, offset); fld := q + offset; - S.GET(fld, p); S.PUT(fld, S.VAL(S.PTR, n)) - ELSE (* offset references a ptr field *) - fld := q + offset; (* S.ADDRESS the pointer *) - S.GET(fld, n); (* Load the pointer *) - IF n # 0 THEN (* If pointer is not NIL *) - S.GET(n - SZA, tagbits); (* Consider record pointed to by this field *) - IF ~ODD(tagbits) THEN - S.PUT(n - SZA, tagbits + 1); - S.PUT(q - SZA, tag + 1); - S.PUT(fld, S.VAL(S.PTR, p)); - p := q; q := n; - tag := tagbits - END - END - END ; - INC(tag, SZA) - END - END - END - END Mark; - - PROCEDURE MarkP(p: S.PTR); (* for compatibility with EnumPtrs in ANSI mode *) - BEGIN - Mark(S.VAL(S.ADDRESS, p)) - END MarkP; - - PROCEDURE Scan; - VAR chnk, adr, end, start, tag, i, size, freesize: S.ADDRESS; - BEGIN bigBlocks := 0; i := 1; - WHILE i < nofLists DO freeList[i] := 0; INC(i) END ; - freesize := 0; allocated := 0; chnk := heap; - WHILE chnk # 0 DO - adr := chnk + blkOff; - S.GET(chnk + endOff, end); - WHILE adr < end DO - S.GET(adr, tag); - IF ODD(tag) THEN (*marked*) - IF freesize > 0 THEN - start := adr - freesize; - S.PUT(start, start+SZA); - S.PUT(start+sizeOff, freesize); - S.PUT(start+sntlOff, NoPtrSntl); - i := freesize DIV Unit; freesize := 0; - IF i < nofLists THEN S.PUT(start + nextOff, freeList[i]); freeList[i] := start - ELSE S.PUT(start + nextOff, bigBlocks); bigBlocks := start - END - END ; - DEC(tag, 1); - S.PUT(adr, tag); - S.GET(tag, size); - INC(allocated, size); - INC(adr, size) - ELSE (*unmarked*) - S.GET(tag, size); - INC(freesize, size); - INC(adr, size) - END - END ; - IF freesize > 0 THEN (*collect last block*) - start := adr - freesize; - S.PUT(start, start+SZA); - S.PUT(start+sizeOff, freesize); - S.PUT(start+sntlOff, NoPtrSntl); - i := freesize DIV Unit; freesize := 0; - IF i < nofLists THEN S.PUT(start + nextOff, freeList[i]); freeList[i] := start - ELSE S.PUT(start + nextOff, bigBlocks); bigBlocks := start - END - END ; - S.GET(chnk, chnk) - END - END Scan; - - PROCEDURE Sift (l, r: S.ADDRESS; VAR a: ARRAY OF S.ADDRESS); - VAR i, j, x: S.ADDRESS; - BEGIN j := l; x := a[j]; - LOOP i := j; j := 2*j + 1; - IF (j < r) & (a[j] < a[j+1]) THEN INC(j) END; - IF (j > r) OR (a[j] <= x) THEN EXIT END; - a[i] := a[j] - END; - a[i] := x - END Sift; - - PROCEDURE HeapSort (n: S.ADDRESS; VAR a: ARRAY OF S.ADDRESS); - VAR l, r, x: S.ADDRESS; - BEGIN l := n DIV 2; r := n - 1; - WHILE l > 0 DO DEC(l); Sift(l, r, a) END; - WHILE r > 0 DO x := a[0]; a[0] := a[r]; a[r] := x; DEC(r); Sift(l, r, a) END - END HeapSort; - - PROCEDURE MarkCandidates(n: S.ADDRESS; VAR cand: ARRAY OF S.ADDRESS); - VAR chnk, adr, tag, next, lim, lim1, i, ptr, size: S.ADDRESS; - BEGIN - chnk := heap; i := 0; lim := cand[n-1]; - WHILE (chnk # 0 ) & (chnk < lim) DO - adr := chnk + blkOff; - S.GET(chnk + endOff, lim1); - IF lim < lim1 THEN lim1 := lim END ; - WHILE adr < lim1 DO - S.GET(adr, tag); - IF ODD(tag) THEN (*already marked*) - S.GET(tag-1, size); INC(adr, size) - ELSE - S.GET(tag, size); - ptr := adr + SZA; - WHILE cand[i] < ptr DO INC(i) END ; - IF i = n THEN RETURN END ; - next := adr + size; - IF cand[i] < next THEN Mark(ptr) END ; - adr := next - END - END ; - S.GET(chnk, chnk) - END - END MarkCandidates; - - PROCEDURE CheckFin; - VAR n: FinNode; tag: S.ADDRESS; - BEGIN - n := fin; - WHILE n # NIL DO - S.GET(n.obj - SZA, tag); - IF ~ODD(tag) THEN n.marked := FALSE; Mark(n.obj) - ELSE n.marked := TRUE - END ; - n := n.next - END - END CheckFin; - - PROCEDURE Finalize; - VAR n, prev: FinNode; - BEGIN n := fin; prev := NIL; - WHILE n # NIL DO - IF ~n.marked THEN - IF n = fin THEN fin := fin.next ELSE prev.next := n.next END ; - n.finalize(S.VAL(S.PTR, n.obj)); - (* new nodes may have been pushed in n.finalize, therefore: *) - IF prev = NIL THEN n := fin ELSE n := n.next END - ELSE - prev := n; n := n.next - END - END - END Finalize; - - PROCEDURE FINALL*; - VAR n: FinNode; - BEGIN - WHILE fin # NIL DO - n := fin; fin := fin.next; - n.finalize(S.VAL(S.PTR, n.obj)) - END - END FINALL; - - PROCEDURE -ExternMainStackFrame "extern address Platform_MainStackFrame;"; - PROCEDURE -PlatformMainStackFrame(): S.ADDRESS "Platform_MainStackFrame"; - - PROCEDURE MarkStack(n: S.ADDRESS; VAR cand: ARRAY OF S.ADDRESS); - VAR - frame: S.PTR; - inc, nofcand: S.ADDRESS; - sp, p, stack0: S.ADDRESS; - align: RECORD ch: CHAR; p: S.PTR END ; - BEGIN - IF n > 0 THEN MarkStack(n-1, cand); (* flush register windows by means of recursive calls *) - IF n > 100 THEN RETURN END (* prevent tail recursion optimization *) - END ; - IF n = 0 THEN - nofcand := 0; sp := S.ADR(frame); - stack0 := PlatformMainStackFrame(); - (* check for minimum alignment of pointers *) - inc := S.ADR(align.p) - S.ADR(align); - IF sp > stack0 THEN inc := -inc END ; - WHILE sp # stack0 DO - S.GET(sp, p); - IF (p > heap) & (p < heapend) THEN - IF nofcand = LEN(cand) THEN HeapSort(nofcand, cand); MarkCandidates(nofcand, cand); nofcand := 0 END ; - cand[nofcand] := p; INC(nofcand) - END ; - INC(sp, inc) - END ; - IF nofcand > 0 THEN HeapSort(nofcand, cand); MarkCandidates(nofcand, cand) END - END - END MarkStack; - - PROCEDURE GC*(markStack: BOOLEAN); - VAR - m: Module; - i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23: S.ADDRESS; - cand: ARRAY 10000 OF S.ADDRESS; - BEGIN - IF (lockdepth = 0) OR (lockdepth = 1) & ~markStack THEN - Lock(); - m := S.VAL(Module, modules); - WHILE m # NIL DO - IF m.enumPtrs # NIL THEN m.enumPtrs(MarkP) END ; - m := m^.next - END ; - IF markStack THEN - (* generate register pressure to force callee saved registers to memory; - may be simplified by inlining OS calls or processor specific instructions - *) - i0 := -100; i1 := -101; i2 := -102; i3 := -103; i4 := -104; i5 := -105; i6 := -106; i7 := -107; - i8 := 1; i9 := 2; i10 := 3; i11 := 4; i12 := 5; i13 := 6; i14 := 7; i15 := 8; - i16 := 9; i17 := 10; i18 := 11; i19 := 12; i20 := 13; i21 := 14; i22 := 15; i23 := 16; - LOOP INC(i0, 1); INC(i1, 2); INC(i2, 3); INC(i3, 4); INC(i4, 5); INC(i5, 6); INC(i6, 7); INC(i7, 8); - INC(i8, 9); INC(i9, 10); INC(i10, 11); INC(i11, 12); INC(i12, 13); INC(i13, 14); INC(i14, 15); INC(i15, 16); - INC(i16, 17); INC(i17, 18); INC(i18, 19); INC(i19, 20); INC(i20, 21); INC(i21, 22); INC(i22, 23); INC(i23, 24); - IF (i0 = -99) & (i15 = 24) THEN MarkStack(32, cand); EXIT END - END ; - IF i0 + i1 + i2 + i3 + i4 + i5 + i6 + i7 + i8 + i9 + i10 + i11 + i12 + i13 + i14 + i15 - + i16 + i17 + i18 + i19 + i20 + i21 + i22 + i23 > 10000 THEN RETURN (* use all variables *) - END ; - END; - CheckFin; - Scan; - Finalize; - Unlock() - END - END GC; - - PROCEDURE RegisterFinalizer*(obj: S.PTR; finalize: Finalizer); - VAR f: FinNode; - BEGIN NEW(f); - f.obj := S.VAL(S.ADDRESS, obj); f.finalize := finalize; f.marked := TRUE; - f.next := fin; fin := f; - END RegisterFinalizer; - - -PROCEDURE -ExternHeapInit "extern void *Heap__init();"; -PROCEDURE -HeapModuleInit 'Heap__init()'; - - PROCEDURE InitHeap*; - (* InitHeap is called by Platform.init before any module bodies have been - initialised, to enable NEW, S.NEW *) - BEGIN - heap := NewChunk(heapSize0); - S.GET(heap + endOff, heapend); - S.PUT(heap, AddressZero); - allocated := 0; firstTry := TRUE; freeList[nofLists] := 1; lockdepth := 0; - FileCount := 0; modules := NIL; heapsize := 0; bigBlocks := 0; fin := NIL; - interrupted := FALSE; - - HeapModuleInit; - END InitHeap; - -END Heap. diff --git a/src/system/Oberon.Mod b/src/system/Oberon.Mod deleted file mode 100644 index d0125cdc..00000000 --- a/src/system/Oberon.Mod +++ /dev/null @@ -1,86 +0,0 @@ -MODULE Oberon; - -(* this version should not have dependency on graphics -- noch *) - - IMPORT Platform, Texts, Args, Console; - - TYPE - ParList* = POINTER TO ParRec; - - ParRec* = RECORD - (* vwr*: Viewers.Viewer; - frame*: Display.Frame;*) - text*: Texts.Text; - pos*: LONGINT - END; - - VAR - - Log*: Texts.Text; - Par*: ParList; (*actual parameters*) - R: Texts.Reader; - W: Texts.Writer; - OptionChar*: CHAR; - - (*clocks*) - - PROCEDURE GetClock* (VAR t, d: LONGINT); - BEGIN Platform.GetClock(t, d) - END GetClock; - - PROCEDURE Time* (): LONGINT; - BEGIN - RETURN Platform.Time() - END Time; - - PROCEDURE PopulateParams; - VAR - W: Texts.Writer; - i: INTEGER; - str: ARRAY 32 OF CHAR; - BEGIN - - i := 1; (* skip program name *) - Texts.OpenWriter(W); - - REPEAT - IF i < Args.argc THEN - Args.Get(i, str); - Texts.WriteString(W, str); - Texts.WriteString(W, " "); - END; - INC(i) - UNTIL i >= Args.argc; - - Texts.Append (Par^.text, W.buf); - - END PopulateParams; - - PROCEDURE GetSelection*(VAR text: Texts.Text; VAR beg, end, time: LONGINT); - BEGIN text := NIL; beg := 0; end := 0; time := 0; - END GetSelection; - -(* --- Notifier for echoing all text appended to the log onto the console. --- *) - -PROCEDURE LogNotifier(Log: Texts.Text; op: INTEGER; beg, end: LONGINT); - VAR ch: CHAR; -BEGIN - Texts.OpenReader(R, Log, beg); - WHILE ~R.eot & (beg < end) DO - Texts.Read(R, ch); - IF ch = 0DX THEN Console.Ln ELSE Console.Char(ch) END; - INC(beg) - END -END LogNotifier; - -BEGIN - NEW(Par); - NEW(Par.text); - Par.pos := 0; - OptionChar := '-'; - Texts.Open(Par.text, ""); - PopulateParams; - NEW(Log); - Texts.Open(Log, ""); - Log.notify := LogNotifier; -END Oberon. diff --git a/src/system/Platformunix.Mod b/src/system/Platformunix.Mod deleted file mode 100644 index 034906bd..00000000 --- a/src/system/Platformunix.Mod +++ /dev/null @@ -1,552 +0,0 @@ -MODULE Platform; -IMPORT SYSTEM; - -CONST - StdIn- = 0; - StdOut- = 1; - StdErr- = 2; - -TYPE - HaltProcedure = PROCEDURE(n: LONGINT); - SignalHandler = PROCEDURE(signal: INTEGER); - - ErrorCode* = INTEGER; - FileHandle* = LONGINT; - - FileIdentity* = RECORD - volume: LONGINT; (* dev on Unix filesystems, volume serial number on NTFS *) - index: LONGINT; (* inode on Unix filesystems, file id on NTFS *) - mtime: LONGINT; (* File modification time, value is system dependent *) - END; - - EnvPtr = POINTER TO ARRAY 1024 OF CHAR; - ArgPtr = POINTER TO ARRAY 1024 OF CHAR; - ArgVec = POINTER TO ARRAY 1024 OF ArgPtr; - ArgVecPtr = POINTER TO ARRAY 1 OF SYSTEM.ADDRESS; - - -VAR - LittleEndian-: BOOLEAN; - MainStackFrame-: SYSTEM.ADDRESS; - HaltCode-: LONGINT; - PID-: INTEGER; (* Note: Must be updated by Fork implementation *) - CWD-: ARRAY 256 OF CHAR; - ArgCount-: INTEGER; - - ArgVector-: SYSTEM.ADDRESS; - HaltHandler: HaltProcedure; - TimeStart: LONGINT; - - SeekSet-: INTEGER; - SeekCur-: INTEGER; - SeekEnd-: INTEGER; - - NL-: ARRAY 3 OF CHAR; (* Platform specific newline representation *) - - - -(* Unix headers to be included *) - -PROCEDURE -Aincludesystime '#include '; (* for gettimeofday *) -PROCEDURE -Aincludetime '#include '; (* for localtime *) -PROCEDURE -Aincludesystypes '#include '; -PROCEDURE -Aincludeunistd '#include '; -PROCEDURE -Aincludesysstat '#include '; -PROCEDURE -Aincludefcntl '#include '; -PROCEDURE -Aincludeerrno '#include '; -PROCEDURE -Astdlib '#include '; -PROCEDURE -Astdio '#include '; -PROCEDURE -Aerrno '#include '; - - - - -(* Error code tests *) - -PROCEDURE -EMFILE(): ErrorCode 'EMFILE'; -PROCEDURE -ENFILE(): ErrorCode 'ENFILE'; -PROCEDURE -ENOENT(): ErrorCode 'ENOENT'; -PROCEDURE -EXDEV(): ErrorCode 'EXDEV'; -PROCEDURE -EACCES(): ErrorCode 'EACCES'; -PROCEDURE -EROFS(): ErrorCode 'EROFS'; -PROCEDURE -EAGAIN(): ErrorCode 'EAGAIN'; -PROCEDURE -ETIMEDOUT(): ErrorCode 'ETIMEDOUT'; -PROCEDURE -ECONNREFUSED(): ErrorCode 'ECONNREFUSED'; -PROCEDURE -ECONNABORTED(): ErrorCode 'ECONNABORTED'; -PROCEDURE -ENETUNREACH(): ErrorCode 'ENETUNREACH'; -PROCEDURE -EHOSTUNREACH(): ErrorCode 'EHOSTUNREACH'; -PROCEDURE -EINTR(): ErrorCode 'EINTR'; - - - - -PROCEDURE TooManyFiles*(e: ErrorCode): BOOLEAN; -BEGIN RETURN (e = EMFILE()) OR (e = ENFILE()) END TooManyFiles; - -PROCEDURE NoSuchDirectory*(e: ErrorCode): BOOLEAN; -BEGIN RETURN e = ENOENT() END NoSuchDirectory; - -PROCEDURE DifferentFilesystems*(e: ErrorCode): BOOLEAN; -BEGIN RETURN e = EXDEV() END DifferentFilesystems; - -PROCEDURE Inaccessible*(e: ErrorCode): BOOLEAN; -BEGIN RETURN (e = EACCES()) OR (e = EROFS()) OR (e = EAGAIN()) END Inaccessible; - -PROCEDURE Absent*(e: ErrorCode): BOOLEAN; -BEGIN RETURN e = ENOENT() END Absent; - -PROCEDURE TimedOut*(e: ErrorCode): BOOLEAN; -BEGIN RETURN e = ETIMEDOUT() END TimedOut; - -PROCEDURE ConnectionFailed*(e: ErrorCode): BOOLEAN; -BEGIN RETURN (e = ECONNREFUSED()) OR (e = ECONNABORTED()) - OR (e = ENETUNREACH()) OR (e = EHOSTUNREACH()) END ConnectionFailed; - -PROCEDURE Interrupted*(e: ErrorCode): BOOLEAN; -BEGIN RETURN e = EINTR() END Interrupted; - - - - -(* OS memory allocaton *) - -PROCEDURE -allocate (size: SYSTEM.ADDRESS): SYSTEM.ADDRESS "(address)((void*)malloc((size_t)size))"; -PROCEDURE OSAllocate*(size: SYSTEM.ADDRESS): SYSTEM.ADDRESS; BEGIN RETURN allocate(size) END OSAllocate; - -PROCEDURE -free(address: SYSTEM.ADDRESS) "free((void*)address)"; -PROCEDURE OSFree*(address: SYSTEM.ADDRESS); BEGIN free(address) END OSFree; - - - - -(* Program startup *) - -PROCEDURE -ExternInitHeap "extern void Heap_InitHeap();"; -PROCEDURE -HeapInitHeap() "Heap_InitHeap()"; - -PROCEDURE Init*(argc: INTEGER; argvadr: SYSTEM.ADDRESS); -VAR av: ArgVecPtr; -BEGIN - MainStackFrame := argvadr; - ArgCount := argc; - av := SYSTEM.VAL(ArgVecPtr, argvadr); - ArgVector := av[0]; - HaltCode := -128; - - (* This function (Platform.Init) is called at program startup BEFORE any - modules have been initalised. In turn we must initialise the heap - before module startup (xxx__init) code is run. *) - HeapInitHeap(); -END Init; - - - - -(* Program arguments and environment access *) - -PROCEDURE -getenv(var: ARRAY OF CHAR): EnvPtr "(Platform_EnvPtr)getenv((char*)var)"; - -PROCEDURE getEnv*(var: ARRAY OF CHAR; VAR val: ARRAY OF CHAR): BOOLEAN; - VAR p: EnvPtr; -BEGIN - p := getenv(var); - IF p # NIL THEN COPY(p^, val) END; - RETURN p # NIL; -END getEnv; - -PROCEDURE GetEnv*(var: ARRAY OF CHAR; VAR val: ARRAY OF CHAR); -BEGIN - IF ~ getEnv(var, val) THEN val[0] := 0X END; -END GetEnv; - -PROCEDURE GetArg*(n: INTEGER; VAR val: ARRAY OF CHAR); - VAR av: ArgVec; -BEGIN - IF n < ArgCount THEN - av := SYSTEM.VAL(ArgVec,ArgVector); - COPY(av[n]^, val) - END -END GetArg; - -PROCEDURE GetIntArg*(n: INTEGER; VAR val: LONGINT); - VAR s: ARRAY 64 OF CHAR; k, d, i: LONGINT; -BEGIN - s := ""; GetArg(n, s); i := 0; - IF s[0] = "-" THEN i := 1 END ; - k := 0; d := ORD(s[i]) - ORD("0"); - WHILE (d >= 0 ) & (d <= 9) DO k := k*10 + d; INC(i); d := ORD(s[i]) - ORD("0") END ; - IF s[0] = "-" THEN k := -k; DEC(i) END ; - IF i > 0 THEN val := k END -END GetIntArg; - -PROCEDURE ArgPos*(s: ARRAY OF CHAR): INTEGER; - VAR i: INTEGER; arg: ARRAY 256 OF CHAR; -BEGIN - i := 0; GetArg(i, arg); - WHILE (i < ArgCount) & (s # arg) DO INC(i); GetArg(i, arg) END ; - RETURN i -END ArgPos; - - - - - -(* Signals and traps *) - -PROCEDURE -sethandler(s: INTEGER; h: SignalHandler) "SystemSetHandler(s, (address)h)"; - -PROCEDURE SetInterruptHandler*(handler: SignalHandler); -BEGIN sethandler(2, handler); END SetInterruptHandler; - -PROCEDURE SetQuitHandler*(handler: SignalHandler); -BEGIN sethandler(3, handler); END SetQuitHandler; - -PROCEDURE SetBadInstructionHandler*(handler: SignalHandler); -BEGIN sethandler(4, handler); END SetBadInstructionHandler; - - - - -(* Time of day *) - -PROCEDURE -gettimeval "struct timeval tv; gettimeofday(&tv,0)"; -PROCEDURE -tvsec(): LONGINT "tv.tv_sec"; -PROCEDURE -tvusec(): LONGINT "tv.tv_usec"; -PROCEDURE -sectotm(s: LONGINT) "struct tm *time = localtime((time_t*)&s)"; -PROCEDURE -tmsec(): LONGINT "(LONGINT)time->tm_sec"; -PROCEDURE -tmmin(): LONGINT "(LONGINT)time->tm_min"; -PROCEDURE -tmhour(): LONGINT "(LONGINT)time->tm_hour"; -PROCEDURE -tmmday(): LONGINT "(LONGINT)time->tm_mday"; -PROCEDURE -tmmon(): LONGINT "(LONGINT)time->tm_mon"; -PROCEDURE -tmyear(): LONGINT "(LONGINT)time->tm_year"; - -PROCEDURE YMDHMStoClock(ye,mo,da,ho,mi,se: LONGINT; VAR t, d: LONGINT); -BEGIN - d := ASH(ye MOD 100, 9) + ASH(mo+1, 5) + da; - t := ASH(ho, 12) + ASH(mi, 6) + se; -END YMDHMStoClock; - -PROCEDURE GetClock*(VAR t, d: LONGINT); -BEGIN - gettimeval; sectotm(tvsec()); - YMDHMStoClock(tmyear(), tmmon(), tmmday(), tmhour(), tmmin(), tmsec(), t, d); -END GetClock; - -PROCEDURE GetTimeOfDay*(VAR sec, usec: LONGINT); -BEGIN - gettimeval; sec := tvsec(); usec := tvusec(); -END GetTimeOfDay; - -PROCEDURE Time*(): LONGINT; -VAR ms: LONGINT; -BEGIN - gettimeval; - ms := (tvusec() DIV 1000) + (tvsec() * 1000); - RETURN (ms - TimeStart) MOD 7FFFFFFFH; -END Time; - - -PROCEDURE -nanosleep(s: LONGINT; ns: LONGINT) "struct timespec req, rem; req.tv_sec = s; req.tv_nsec = ns; nanosleep(&req, &rem)"; - -PROCEDURE Delay*(ms: LONGINT); -VAR s, ns: LONGINT; -BEGIN - s := ms DIV 1000; - ns := (ms MOD 1000) * 1000000; - nanosleep(s, ns); -END Delay; - - - - -(* System call *) - -PROCEDURE -system(str: ARRAY OF CHAR): INTEGER "system((char*)str)"; -PROCEDURE -err(): INTEGER "errno"; - - -PROCEDURE System*(cmd : ARRAY OF CHAR): INTEGER; -BEGIN RETURN system(cmd); END System; - -PROCEDURE Error*(): ErrorCode; BEGIN RETURN err() END Error; - - - - -(* File system *) - -(* Note: Consider also using flags O_SYNC and O_DIRECT as we do buffering *) -PROCEDURE -openrw (n: ARRAY OF CHAR): INTEGER "open((char*)n, O_RDWR)"; -PROCEDURE -openro (n: ARRAY OF CHAR): INTEGER "open((char*)n, O_RDONLY)"; -PROCEDURE -opennew(n: ARRAY OF CHAR): INTEGER "open((char*)n, O_CREAT | O_TRUNC | O_RDWR, 0664)"; - -(* File APIs *) - -PROCEDURE OldRO*(VAR n: ARRAY OF CHAR; VAR h: FileHandle): ErrorCode; -VAR fd: INTEGER; -BEGIN - fd := openro(n); - IF (fd < 0) THEN RETURN err() ELSE h := fd; RETURN 0 END; -END OldRO; - -PROCEDURE OldRW*(VAR n: ARRAY OF CHAR; VAR h: FileHandle): ErrorCode; -VAR fd: INTEGER; -BEGIN - fd := openrw(n); - IF (fd < 0) THEN RETURN err() ELSE h := fd; RETURN 0 END; -END OldRW; - -PROCEDURE New*(VAR n: ARRAY OF CHAR; VAR h: FileHandle): ErrorCode; -VAR fd: INTEGER; -BEGIN - fd := opennew(n); - IF (fd < 0) THEN RETURN err() ELSE h := fd; RETURN 0 END; -END New; - - - -PROCEDURE -closefile (fd: LONGINT): INTEGER "close(fd)"; - -PROCEDURE Close*(h: FileHandle): ErrorCode; -BEGIN - IF closefile(h) < 0 THEN RETURN err() ELSE RETURN 0 END -END Close; - - - -PROCEDURE -fstat(fd: LONGINT): INTEGER "fstat(fd, &s)"; -PROCEDURE -stat(n: ARRAY OF CHAR): INTEGER "stat((char*)n, &s)"; -PROCEDURE -structstats "struct stat s"; -PROCEDURE -statdev(): LONGINT "(LONGINT)s.st_dev"; -PROCEDURE -statino(): LONGINT "(LONGINT)s.st_ino"; -PROCEDURE -statmtime(): LONGINT "(LONGINT)s.st_mtime"; -PROCEDURE -statsize(): LONGINT "(address)s.st_size"; - -PROCEDURE Identify*(h: FileHandle; VAR identity: FileIdentity): ErrorCode; -BEGIN - structstats; - IF fstat(h) < 0 THEN RETURN err() END; - identity.volume := statdev(); - identity.index := statino(); - identity.mtime := statmtime(); - RETURN 0 -END Identify; - -PROCEDURE IdentifyByName*(n: ARRAY OF CHAR; VAR identity: FileIdentity): ErrorCode; -BEGIN - structstats; - IF stat(n) < 0 THEN RETURN err() END; - identity.volume := statdev(); - identity.index := statino(); - identity.mtime := statmtime(); - RETURN 0 -END IdentifyByName; - - -PROCEDURE SameFile*(i1, i2: FileIdentity): BOOLEAN; -BEGIN RETURN (i1.index = i2.index) & (i1.volume = i2.volume) -END SameFile; - -PROCEDURE SameFileTime*(i1, i2: FileIdentity): BOOLEAN; -BEGIN RETURN i1.mtime = i2.mtime -END SameFileTime; - -PROCEDURE SetMTime*(VAR target: FileIdentity; source: FileIdentity); -BEGIN target.mtime := source.mtime; -END SetMTime; - -PROCEDURE MTimeAsClock*(i: FileIdentity; VAR t, d: LONGINT); -BEGIN - sectotm(i.mtime); - YMDHMStoClock(tmyear(), tmmon(), tmmday(), tmhour(), tmmin(), tmsec(), t, d); -END MTimeAsClock; - - -PROCEDURE Size*(h: FileHandle; VAR l: LONGINT): ErrorCode; -BEGIN - structstats; - IF fstat(h) < 0 THEN RETURN err() END; - l := statsize(); - RETURN 0; -END Size; - - - -PROCEDURE -readfile (fd: LONGINT; p: SYSTEM.ADDRESS; l: LONGINT): LONGINT -"(LONGINT)read(fd, (void*)(address)(p), l)"; - -PROCEDURE Read*(h: FileHandle; p: SYSTEM.ADDRESS; l: LONGINT; VAR n: LONGINT): ErrorCode; -BEGIN - n := readfile(h, p, l); - IF n < 0 THEN n := 0; RETURN err() ELSE RETURN 0 END -END Read; - -PROCEDURE ReadBuf*(h: FileHandle; VAR b: ARRAY OF SYSTEM.BYTE; VAR n: LONGINT): ErrorCode; -BEGIN - n := readfile(h, SYSTEM.ADR(b), LEN(b)); - IF n < 0 THEN n := 0; RETURN err() ELSE RETURN 0 END -END ReadBuf; - - - -PROCEDURE -writefile(fd: LONGINT; p: SYSTEM.ADDRESS; l: SYSTEM.ADDRESS): SYSTEM.ADDRESS -"write(fd, (void*)(address)(p), l)"; - -PROCEDURE Write*(h: FileHandle; p: SYSTEM.ADDRESS; l: LONGINT): ErrorCode; - VAR written: SYSTEM.ADDRESS; -BEGIN - written := writefile(h, p, l); - IF written < 0 THEN RETURN err() ELSE RETURN 0 END -END Write; - - - -PROCEDURE -fsync(fd: LONGINT): INTEGER "fsync(fd)"; - -PROCEDURE Sync*(h: FileHandle): ErrorCode; -BEGIN - IF fsync(h) < 0 THEN RETURN err() ELSE RETURN 0 END -END Sync; - - - -PROCEDURE -lseek(fd: LONGINT; o: LONGINT; w: INTEGER): INTEGER "lseek(fd, o, w)"; -PROCEDURE -seekset(): INTEGER "SEEK_SET"; -PROCEDURE -seekcur(): INTEGER "SEEK_CUR"; -PROCEDURE -seekend(): INTEGER "SEEK_END"; - -PROCEDURE Seek*(h: FileHandle; offset: LONGINT; whence: INTEGER): ErrorCode; -BEGIN - IF lseek(h, offset, whence) < 0 THEN RETURN err() ELSE RETURN 0 END -END Seek; - - - -PROCEDURE -ftruncate(fd: LONGINT; l: LONGINT): INTEGER "ftruncate(fd, l)"; - -PROCEDURE Truncate*(h: FileHandle; l: LONGINT): ErrorCode; -BEGIN - IF (ftruncate(h, l) < 0) THEN RETURN err() ELSE RETURN 0 END; -END Truncate; - - - -PROCEDURE -unlink(n: ARRAY OF CHAR): INTEGER "unlink((char*)n)"; - -PROCEDURE Unlink*(VAR n: ARRAY OF CHAR): ErrorCode; -BEGIN - IF unlink(n) < 0 THEN RETURN err() ELSE RETURN 0 END -END Unlink; - - - -PROCEDURE -chdir(n: ARRAY OF CHAR): INTEGER "chdir((char*)n)"; -PROCEDURE -getcwd(VAR cwd: ARRAY OF CHAR): SYSTEM.PTR "getcwd((char*)cwd, cwd__len)"; - -PROCEDURE Chdir*(VAR n: ARRAY OF CHAR): ErrorCode; - VAR r: INTEGER; -BEGIN - IF (chdir(n) >= 0) & (getcwd(CWD) # NIL) THEN RETURN 0 - ELSE RETURN err() END -END Chdir; - - - -PROCEDURE -rename(o,n: ARRAY OF CHAR): INTEGER "rename((char*)o, (char*)n)"; - -PROCEDURE Rename*(VAR o,n: ARRAY OF CHAR): ErrorCode; -BEGIN - IF rename(o,n) < 0 THEN RETURN err() ELSE RETURN 0 END -END Rename; - - - - -(* Process termination *) - -PROCEDURE -exit(code: INTEGER) "exit(code)"; -PROCEDURE Exit*(code: INTEGER); -BEGIN exit(code) END Exit; - -PROCEDURE -errstring(s: ARRAY OF CHAR) 'write(1, s, s__len-1)'; -PROCEDURE -errc (c: CHAR) 'write(1, &c, 1)'; -PROCEDURE errch(c: CHAR); BEGIN errc(c) END errch; -PROCEDURE errln; BEGIN errch(0AX) END errln; - -PROCEDURE errposint(l: LONGINT); -BEGIN IF l>10 THEN errposint(l DIV 10) END; errch(CHR(ORD('0') + (l MOD 10))) END errposint; - -PROCEDURE errint(l: LONGINT); -BEGIN IF l<0 THEN errch('-'); l := -l END; errposint(l) END errint; - -PROCEDURE DisplayHaltCode(code: LONGINT); -BEGIN - CASE code OF - | -1: errstring("Assertion failure.") - | -2: errstring("Index out of range.") - | -3: errstring("Reached end of function without reaching RETURN.") - | -4: errstring("CASE statement: no matching label and no ELSE.") - | -5: errstring("Type guard failed.") - | -6: errstring("Implicit type guard in record assignment failed.") - | -7: errstring("Invalid case in WITH statement.") - | -8: errstring("Value out of range.") - | -9: errstring("Heap interrupted while locked, but lockdepth = 0 at unlock.") - |-10: errstring("NIL access."); - |-11: errstring("Alignment error."); - |-12: errstring("Divide by zero."); - |-13: errstring("Arithmetic overflow/underflow."); - |-14: errstring("Invalid function argument."); - |-15: errstring("Internal error, e.g. Type descriptor size mismatch.") - |-20: errstring("Too many, or negative number of, elements in dynamic array.") - ELSE - END -END DisplayHaltCode; - -PROCEDURE Halt*(code: LONGINT); -BEGIN - HaltCode := code; - IF HaltHandler # NIL THEN HaltHandler(code) END; - errstring("Terminated by Halt("); errint(code); errstring("). "); - IF code < 0 THEN DisplayHaltCode(code) END; - errln; - exit(SYSTEM.VAL(INTEGER,code)); -END Halt; - -PROCEDURE AssertFail*(code: LONGINT); -BEGIN - errstring("Assertion failure."); - IF code # 0 THEN errstring(" ASSERT code "); errint(code); errstring("."); END; - errln; - exit(SYSTEM.VAL(INTEGER,code)); -END AssertFail; - -PROCEDURE SetHalt*(p: HaltProcedure); -BEGIN HaltHandler := p; END SetHalt; - - - - - -PROCEDURE TestLittleEndian; - VAR i: INTEGER; - BEGIN i := 1; SYSTEM.GET(SYSTEM.ADR(i), LittleEndian); END TestLittleEndian; - - -PROCEDURE -getpid(): INTEGER "(INTEGER)getpid()"; - -BEGIN - TestLittleEndian; - - HaltCode := -128; - HaltHandler := NIL; - TimeStart := 0; TimeStart := Time(); - PID := getpid(); - IF getcwd(CWD) = NIL THEN CWD := "" END; - - SeekSet := seekset(); - SeekCur := seekcur(); - SeekEnd := seekend(); - - NL[0] := 0AX; (* LF *) - NL[1] := 0X; -END Platform. diff --git a/src/system/Platformwindows.Mod b/src/system/Platformwindows.Mod deleted file mode 100644 index a538fdc5..00000000 --- a/src/system/Platformwindows.Mod +++ /dev/null @@ -1,622 +0,0 @@ -MODULE Platform; -IMPORT SYSTEM; - -(* TODO: - Use Unicode APIs with manual UTF8 conversion and prepend '\\?\' to - file paths in order to get 32768 character path length limit (as - opposed to 256 bytes. *) - - -TYPE - HaltProcedure = PROCEDURE(n: LONGINT); - SignalHandler = PROCEDURE(signal: INTEGER); - - ErrorCode* = INTEGER; - FileHandle* = LONGINT; - - FileIdentity* = RECORD - volume: LONGINT; (* dev on Unix filesystems, volume serial number on NTFS *) - indexhigh: LONGINT; (* inode on Unix filesystems, file id on NTFS *) - indexlow: LONGINT; - mtimehigh: LONGINT; (* File modification time, value is system dependent *) - mtimelow: LONGINT; (* File modification time, value is system dependent *) - END; - - EnvPtr = POINTER TO ARRAY 1024 OF CHAR; - ArgPtr = POINTER TO ARRAY 1024 OF CHAR; - ArgVec = POINTER TO ARRAY 1024 OF ArgPtr; - ArgVecPtr = POINTER TO ARRAY 1 OF SYSTEM.ADDRESS; - - -VAR - LittleEndian-: BOOLEAN; - MainStackFrame-: SYSTEM.ADDRESS; - HaltCode-: LONGINT; - PID-: INTEGER; (* Note: Must be updated by Fork implementation *) - CWD-: ARRAY 4096 OF CHAR; - ArgCount-: INTEGER; - - ArgVector-: SYSTEM.ADDRESS; - HaltHandler: HaltProcedure; - TimeStart: LONGINT; - - SeekSet-: INTEGER; - SeekCur-: INTEGER; - SeekEnd-: INTEGER; - - StdIn-: FileHandle; - StdOut-: FileHandle; - StdErr-: FileHandle; - - InterruptHandler: SignalHandler; - - nl-: ARRAY 3 OF CHAR; (* Platform specific newline representation *) - - - -PROCEDURE -AincludeWindowsWrapper '#include "WindowsWrapper.h"'; - - -(* Error code tests *) - -PROCEDURE -ERRORTOOMANYOPENFILES(): ErrorCode 'ERROR_TOO_MANY_OPEN_FILES'; -PROCEDURE -ERRORPATHNOTFOUND(): ErrorCode 'ERROR_PATH_NOT_FOUND'; -PROCEDURE -ERRORFILENOTFOUND(): ErrorCode 'ERROR_FILE_NOT_FOUND'; -PROCEDURE -ERRORNOTSAMEDEVICE(): ErrorCode 'ERROR_NOT_SAME_DEVICE'; -PROCEDURE -ERRORACCESSDENIED(): ErrorCode 'ERROR_ACCESS_DENIED'; -PROCEDURE -ERRORWRITEPROTECT(): ErrorCode 'ERROR_WRITE_PROTECT'; -PROCEDURE -ERRORSHARINGVIOLATION(): ErrorCode 'ERROR_SHARING_VIOLATION'; -PROCEDURE -ERRORNOTREADY(): ErrorCode 'ERROR_NOT_READY'; -PROCEDURE -ETIMEDOUT(): ErrorCode 'WSAETIMEDOUT'; -PROCEDURE -ECONNREFUSED(): ErrorCode 'WSAECONNREFUSED'; -PROCEDURE -ECONNABORTED(): ErrorCode 'WSAECONNABORTED'; -PROCEDURE -ENETUNREACH(): ErrorCode 'WSAENETUNREACH'; -PROCEDURE -EHOSTUNREACH(): ErrorCode 'WSAEHOSTUNREACH'; -PROCEDURE -EINTR(): ErrorCode 'WSAEINTR'; - - - -PROCEDURE TooManyFiles*(e: ErrorCode): BOOLEAN; -BEGIN RETURN e = ERRORTOOMANYOPENFILES() END TooManyFiles; - -PROCEDURE NoSuchDirectory*(e: ErrorCode): BOOLEAN; -BEGIN RETURN e = ERRORPATHNOTFOUND() END NoSuchDirectory; - -PROCEDURE DifferentFilesystems*(e: ErrorCode): BOOLEAN; -BEGIN RETURN e = ERRORNOTSAMEDEVICE() END DifferentFilesystems; - -PROCEDURE Inaccessible*(e: ErrorCode): BOOLEAN; -BEGIN - RETURN (e = ERRORACCESSDENIED()) OR (e = ERRORWRITEPROTECT()) - OR (e = ERRORNOTREADY()) OR (e = ERRORSHARINGVIOLATION()); -END Inaccessible; - -PROCEDURE Absent*(e: ErrorCode): BOOLEAN; -BEGIN RETURN (e = ERRORFILENOTFOUND()) OR (e = ERRORPATHNOTFOUND()) END Absent; - -PROCEDURE TimedOut*(e: ErrorCode): BOOLEAN; -BEGIN RETURN (e = ETIMEDOUT()) END TimedOut; - -PROCEDURE ConnectionFailed*(e: ErrorCode): BOOLEAN; -BEGIN RETURN (e = ECONNREFUSED()) OR (e = ECONNABORTED()) - OR (e = ENETUNREACH()) OR (e = EHOSTUNREACH()) END ConnectionFailed; - -PROCEDURE Interrupted*(e: ErrorCode): BOOLEAN; -BEGIN RETURN e = EINTR() END Interrupted; - - - -(* OS memory allocaton *) - -PROCEDURE -allocate(size: SYSTEM.ADDRESS): SYSTEM.ADDRESS "(address)((void*)HeapAlloc(GetProcessHeap(), 0, (size_t)size))"; -PROCEDURE OSAllocate*(size: SYSTEM.ADDRESS): SYSTEM.ADDRESS; BEGIN RETURN allocate(size) END OSAllocate; - -PROCEDURE -free(address: SYSTEM.ADDRESS) "HeapFree(GetProcessHeap(), 0, (void*)address)"; -PROCEDURE OSFree*(address: SYSTEM.ADDRESS); BEGIN free(address) END OSFree; - - - - -(* Program startup *) - -PROCEDURE -ExternInitHeap "extern void Heap_InitHeap();"; -PROCEDURE -HeapInitHeap() "Heap_InitHeap()"; - -PROCEDURE Init*(argc: INTEGER; argvadr: SYSTEM.ADDRESS); -VAR av: ArgVecPtr; -BEGIN - MainStackFrame := argvadr; - ArgCount := argc; - av := SYSTEM.VAL(ArgVecPtr, argvadr); - ArgVector := av[0]; - HaltCode := -128; - - (* This function (Platform.Init) is called at program startup BEFORE any - modules have been initalised. In turn we must initialise the heap - before module startup (xxx__init) code is run. *) - HeapInitHeap(); -END Init; - - - - -(* Program arguments and environmet access *) - -PROCEDURE -getenv(name: ARRAY OF CHAR; VAR buf: ARRAY OF CHAR): INTEGER -"(INTEGER)GetEnvironmentVariable((char*)name, (char*)buf, buf__len)"; - -PROCEDURE getEnv*(var: ARRAY OF CHAR; VAR val: ARRAY OF CHAR): BOOLEAN; - VAR - buf: ARRAY 4096 OF CHAR; - res: INTEGER; -BEGIN - res := getenv(var, buf); - IF (res > 0) & (res < LEN(buf)) THEN - COPY(buf, val); - RETURN TRUE; - ELSE - RETURN FALSE; - END; -END getEnv; - -PROCEDURE GetEnv*(var: ARRAY OF CHAR; VAR val: ARRAY OF CHAR); -BEGIN - IF ~getEnv(var, val) THEN val[0] := 0X END; -END GetEnv; - -PROCEDURE GetArg*(n: INTEGER; VAR val: ARRAY OF CHAR); - VAR av: ArgVec; -BEGIN - IF n < ArgCount THEN - av := SYSTEM.VAL(ArgVec,ArgVector); - COPY(av[n]^, val) - END -END GetArg; - -PROCEDURE GetIntArg*(n: INTEGER; VAR val: LONGINT); - VAR s: ARRAY 64 OF CHAR; k, d, i: LONGINT; -BEGIN - s := ""; GetArg(n, s); i := 0; - IF s[0] = "-" THEN i := 1 END ; - k := 0; d := ORD(s[i]) - ORD("0"); - WHILE (d >= 0 ) & (d <= 9) DO k := k*10 + d; INC(i); d := ORD(s[i]) - ORD("0") END ; - IF s[0] = "-" THEN k := -k; DEC(i) END ; - IF i > 0 THEN val := k END -END GetIntArg; - -PROCEDURE ArgPos*(s: ARRAY OF CHAR): INTEGER; - VAR i: INTEGER; arg: ARRAY 256 OF CHAR; -BEGIN - i := 0; GetArg(i, arg); - WHILE (i < ArgCount) & (s # arg) DO INC(i); GetArg(i, arg) END ; - RETURN i -END ArgPos; - - - - - -(* Signals and traps *) - -(* PROCEDURE -signal(sig: LONGINT; func: SignalHandler) "signal(sig, func)"; *) - -(* TODO *) - -(* Ctrl/c handling *) - -PROCEDURE -SetInterruptHandler*(h: SignalHandler) "SystemSetInterruptHandler((address)h)"; -PROCEDURE -SetQuitHandler* (h: SignalHandler) "SystemSetQuitHandler((address)h)"; - -PROCEDURE SetBadInstructionHandler*(handler: SignalHandler); -BEGIN (* TODO *) END SetBadInstructionHandler; - - - - -(* Time of day *) - -PROCEDURE -getLocalTime "SYSTEMTIME st; GetLocalTime(&st)"; -PROCEDURE -stmsec(): INTEGER "(INTEGER)st.wMilliseconds"; -PROCEDURE -stsec(): INTEGER "(INTEGER)st.wSecond"; -PROCEDURE -stmin(): INTEGER "(INTEGER)st.wMinute"; -PROCEDURE -sthour(): INTEGER "(INTEGER)st.wHour"; -PROCEDURE -stmday(): INTEGER "(INTEGER)st.wDay"; -PROCEDURE -stmon(): INTEGER "(INTEGER)st.wMonth"; -PROCEDURE -styear(): INTEGER "(INTEGER)st.wYear"; - -PROCEDURE YMDHMStoClock(ye,mo,da,ho,mi,se: INTEGER; VAR t, d: LONGINT); -BEGIN - d := ASH(ye MOD 100, 9) + ASH(mo+1, 5) + da; - t := ASH(ho, 12) + ASH(mi, 6) + se; -END YMDHMStoClock; - -PROCEDURE GetClock*(VAR t, d: LONGINT); -BEGIN - getLocalTime; - YMDHMStoClock(styear(), stmon(), stmday(), sthour(), stmin(), stsec(), t, d); -END GetClock; - -PROCEDURE -GetTickCount(): LONGINT "(LONGINT)(uint32)GetTickCount()"; - -PROCEDURE Time*(): LONGINT; -VAR ms: LONGINT; -BEGIN - ms := GetTickCount(); - RETURN (ms - TimeStart) MOD 7FFFFFFFH; -END Time; - - -PROCEDURE -sleep(ms: LONGINT) "Sleep((DWORD)ms)"; - -PROCEDURE Delay*(ms: LONGINT); -BEGIN - WHILE ms > 30000 DO sleep(30000); ms := ms-30000 END; - IF ms > 0 THEN sleep(ms) END; -END Delay; - - -PROCEDURE -stToFt "FILETIME ft; SystemTimeToFileTime(&st, &ft)"; -PROCEDURE -ftToUli "ULARGE_INTEGER ul; ul.LowPart=ft.dwLowDateTime; ul.HighPart=ft.dwHighDateTime"; -PROCEDURE -tous1970 "ul.QuadPart = (ul.QuadPart - 116444736000000000ULL)/10LL"; -PROCEDURE -ulSec(): LONGINT "(LONGINT)(ul.QuadPart / 1000000LL)"; -PROCEDURE -uluSec(): LONGINT "(LONGINT)(ul.QuadPart % 1000000LL)"; - -PROCEDURE GetTimeOfDay*(VAR sec, usec: LONGINT); -BEGIN - getLocalTime; stToFt; ftToUli; tous1970; - sec := ulSec(); usec := uluSec(); -END GetTimeOfDay; - - - -(* System call *) - -PROCEDURE -startupInfo "STARTUPINFO si = {0}; si.cb = sizeof(si);"; -PROCEDURE -processInfo "PROCESS_INFORMATION pi = {0};"; -PROCEDURE -createProcess(str: ARRAY OF CHAR): INTEGER "(INTEGER)CreateProcess(0, (char*)str, 0,0,0,0,0,0,&si,&pi)"; -PROCEDURE -waitForProcess(): INTEGER "(INTEGER)WaitForSingleObject(pi.hProcess, INFINITE)"; -PROCEDURE -getExitCodeProcess(VAR exitcode: INTEGER) "GetExitCodeProcess(pi.hProcess, (DWORD*)exitcode);"; -PROCEDURE -cleanupProcess "CloseHandle(pi.hProcess); CloseHandle(pi.hThread);"; -PROCEDURE -err(): INTEGER "(INTEGER)GetLastError()"; - -PROCEDURE System*(cmd : ARRAY OF CHAR): INTEGER; -VAR - result: INTEGER; -BEGIN - result := 127; - startupInfo; processInfo; - IF createProcess(cmd) # 0 THEN - IF waitForProcess() = 0 THEN getExitCodeProcess(result) END; - cleanupProcess; - END; - RETURN result * 256; -END System; - -PROCEDURE Error*(): ErrorCode; BEGIN RETURN err() END Error; - - -(* File system *) - -PROCEDURE -invalidHandleValue(): LONGINT "((LONGINT)(address)INVALID_HANDLE_VALUE)"; - -PROCEDURE -openrw (n: ARRAY OF CHAR): LONGINT -"(LONGINT)(address)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0)"; - -PROCEDURE -openro (n: ARRAY OF CHAR): LONGINT -"(LONGINT)(address)CreateFile((char*)n, GENERIC_READ , FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0)"; - -PROCEDURE -opennew(n: ARRAY OF CHAR): LONGINT -"(LONGINT)(address)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0)"; - - - - -(* File APIs *) - -PROCEDURE OldRO*(VAR n: ARRAY OF CHAR; VAR h: FileHandle): ErrorCode; -VAR fd: LONGINT; -BEGIN - fd := openro(n); - IF (fd = invalidHandleValue()) THEN RETURN err() ELSE h := fd; RETURN 0 END; -END OldRO; - -PROCEDURE OldRW*(VAR n: ARRAY OF CHAR; VAR h: FileHandle): ErrorCode; -VAR fd: LONGINT; -BEGIN - fd := openrw(n); - IF (fd = invalidHandleValue()) THEN RETURN err() ELSE h := fd; RETURN 0 END; -END OldRW; - -PROCEDURE New*(VAR n: ARRAY OF CHAR; VAR h: FileHandle): ErrorCode; -VAR fd: LONGINT; -BEGIN - fd := opennew(n); - IF (fd = invalidHandleValue()) THEN RETURN err() ELSE h := fd; RETURN 0 END; -END New; - - - -PROCEDURE -closeHandle(h: FileHandle): INTEGER "(INTEGER)CloseHandle((HANDLE)(address)h)"; - -PROCEDURE Close*(h: FileHandle): ErrorCode; -BEGIN - IF closeHandle(h) = 0 THEN RETURN err() ELSE RETURN 0 END -END Close; - - - -PROCEDURE -byHandleFileInformation "BY_HANDLE_FILE_INFORMATION bhfi"; -PROCEDURE -getFileInformationByHandle(h: FileHandle): INTEGER "(INTEGER)GetFileInformationByHandle((HANDLE)(address)h, &bhfi)"; -PROCEDURE -bhfiMtimeHigh(): LONGINT "(LONGINT)bhfi.ftLastWriteTime.dwHighDateTime"; -PROCEDURE -bhfiMtimeLow(): LONGINT "(LONGINT)bhfi.ftLastWriteTime.dwLowDateTime"; -PROCEDURE -bhfiVsn(): LONGINT "(LONGINT)bhfi.dwVolumeSerialNumber"; -PROCEDURE -bhfiIndexHigh(): LONGINT "(LONGINT)bhfi.nFileIndexHigh"; -PROCEDURE -bhfiIndexLow(): LONGINT "(LONGINT)bhfi.nFileIndexLow"; - - -PROCEDURE Identify*(h: FileHandle; VAR identity: FileIdentity): ErrorCode; -BEGIN - byHandleFileInformation; - IF getFileInformationByHandle(h) = 0 THEN RETURN err() END; - identity.volume := bhfiVsn(); - identity.indexhigh := bhfiIndexHigh(); - identity.indexlow := bhfiIndexLow(); - identity.mtimehigh := bhfiMtimeHigh(); - identity.mtimelow := bhfiMtimeLow(); - RETURN 0 -END Identify; - -PROCEDURE IdentifyByName*(n: ARRAY OF CHAR; VAR identity: FileIdentity): ErrorCode; -VAR - h: FileHandle; - e,i: ErrorCode; -BEGIN - e := OldRO(n, h); - IF e # 0 THEN RETURN e END; - e := Identify(h, identity); - i := Close(h); - RETURN e; -END IdentifyByName; - - -PROCEDURE SameFile*(i1, i2: FileIdentity): BOOLEAN; -BEGIN RETURN (i1.indexhigh = i2.indexhigh) & (i1.indexlow = i2.indexlow) & (i1.volume = i2.volume) -END SameFile; - -PROCEDURE SameFileTime*(i1, i2: FileIdentity): BOOLEAN; -BEGIN RETURN (i1.mtimehigh = i2.mtimehigh) & (i1.mtimelow = i2.mtimelow) -END SameFileTime; - -PROCEDURE SetMTime*(VAR target: FileIdentity; source: FileIdentity); -BEGIN target.mtimehigh := source.mtimehigh; target.mtimelow := source.mtimelow; -END SetMTime; - -PROCEDURE -identityToFileTime(i: FileIdentity) -"FILETIME ft; ft.dwHighDateTime = i.mtimehigh; ft.dwLowDateTime = i.mtimelow"; - -PROCEDURE -fileTimeToSysTime -"SYSTEMTIME st; FileTimeToSystemTime(&ft, &st)"; - -PROCEDURE MTimeAsClock*(i: FileIdentity; VAR t, d: LONGINT); -BEGIN - identityToFileTime(i); fileTimeToSysTime; - YMDHMStoClock(styear(), stmon(), stmday(), sthour(), stmin(), stsec(), t, d); -END MTimeAsClock; - -PROCEDURE -largeInteger "LARGE_INTEGER li"; -PROCEDURE -liLongint(): LONGINT "(LONGINT)li.QuadPart"; -PROCEDURE -getFileSize(h: FileHandle): INTEGER "(INTEGER)GetFileSizeEx((HANDLE)(address)h, &li)"; - -PROCEDURE Size*(h: FileHandle; VAR l: LONGINT): ErrorCode; -BEGIN - largeInteger; - IF getFileSize(h) = 0 THEN RETURN err() END; - l := liLongint(); - RETURN 0; -END Size; - - -PROCEDURE -readfile (fd: LONGINT; p: SYSTEM.ADDRESS; l: LONGINT; VAR n: SYSTEM.INT32): INTEGER -"(INTEGER)ReadFile((HANDLE)fd, (void*)p, (DWORD)l, (DWORD*)n, 0)"; - -PROCEDURE Read*(h: FileHandle; p: SYSTEM.ADDRESS; l: LONGINT; VAR n: LONGINT): ErrorCode; -VAR result: INTEGER; lengthread: SYSTEM.INT32; -BEGIN - result := readfile(h, p, l, lengthread); - IF result = 0 THEN n := 0; RETURN err() ELSE n := lengthread; RETURN 0 END -END Read; - -PROCEDURE ReadBuf*(h: FileHandle; VAR b: ARRAY OF SYSTEM.BYTE; VAR n: LONGINT): ErrorCode; -VAR result: INTEGER; lengthread: SYSTEM.INT32; -BEGIN - result := readfile(h, SYSTEM.ADR(b), LEN(b), lengthread); - IF result = 0 THEN n := 0; RETURN err() ELSE n := lengthread; RETURN 0 END -END ReadBuf; - - - -PROCEDURE -writefile(fd: LONGINT; p: SYSTEM.ADDRESS; l: LONGINT): INTEGER -"(INTEGER)WriteFile((HANDLE)fd, (void*)(p), (DWORD)l, 0,0)"; - -PROCEDURE Write*(h: FileHandle; p: SYSTEM.ADDRESS; l: LONGINT): ErrorCode; -BEGIN - IF writefile(h, p, l) = 0 THEN RETURN err() ELSE RETURN 0 END -END Write; - - - -PROCEDURE -flushFileBuffers(h: FileHandle): INTEGER "(INTEGER)FlushFileBuffers((HANDLE)h)"; - -PROCEDURE Sync*(h: FileHandle): ErrorCode; -BEGIN - IF flushFileBuffers(h) = 0 THEN RETURN err() ELSE RETURN 0 END -END Sync; - - - -PROCEDURE -setFilePointerEx(h: FileHandle; o: LONGINT; r: INTEGER; VAR rc: INTEGER) -"li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((HANDLE)(address)h, li, 0, (DWORD)r)"; - -PROCEDURE -seekset(): INTEGER "FILE_BEGIN"; -PROCEDURE -seekcur(): INTEGER "FILE_CURRENT"; -PROCEDURE -seekend(): INTEGER "FILE_END"; - -PROCEDURE Seek*(h: FileHandle; o: LONGINT; r: INTEGER): ErrorCode; -VAR rc: INTEGER; -BEGIN - largeInteger; - setFilePointerEx(h, o, r, rc); - IF rc = 0 THEN RETURN err() ELSE RETURN 0 END -END Seek; - - - -PROCEDURE -setEndOfFile(h: FileHandle): INTEGER "(INTEGER)SetEndOfFile((HANDLE)(address)h)"; -PROCEDURE -getFilePos(h: FileHandle; VAR r: LONGINT; VAR rc: INTEGER) -"LARGE_INTEGER liz = {0}; *rc = (INTEGER)SetFilePointerEx((HANDLE)(address)h, liz, &li, FILE_CURRENT); *r = (LONGINT)li.QuadPart"; - -PROCEDURE Truncate*(h: FileHandle; limit: LONGINT): ErrorCode; -VAR rc: INTEGER; oldpos: LONGINT; -BEGIN - largeInteger; - getFilePos(h, oldpos, rc); - IF rc = 0 THEN RETURN err() END; - setFilePointerEx(h, limit, seekset(), rc); - IF rc = 0 THEN RETURN err() END; - IF setEndOfFile(h) = 0 THEN RETURN err() END; - setFilePointerEx(h, oldpos, seekset(), rc); (* Restore original file position *) - IF rc = 0 THEN RETURN err() END; - RETURN 0; -END Truncate; - - - -PROCEDURE -deleteFile(n: ARRAY OF CHAR): INTEGER "(INTEGER)DeleteFile((char*)n)"; - -PROCEDURE Unlink*(VAR n: ARRAY OF CHAR): ErrorCode; -BEGIN - IF deleteFile(n) = 0 THEN RETURN err() ELSE RETURN 0 END -END Unlink; - - -PROCEDURE -setCurrentDirectory(n: ARRAY OF CHAR): INTEGER "(INTEGER)SetCurrentDirectory((char*)n)"; -PROCEDURE -getCurrentDirectory(VAR n: ARRAY OF CHAR) "GetCurrentDirectory(n__len, (char*)n)"; - -PROCEDURE Chdir*(VAR n: ARRAY OF CHAR): ErrorCode; - VAR r: INTEGER; -BEGIN - r := setCurrentDirectory(n); - IF r = 0 THEN RETURN err() END; - getCurrentDirectory(CWD); - RETURN 0; -END Chdir; - - - -PROCEDURE -moveFile(o,n: ARRAY OF CHAR): INTEGER -"(INTEGER)MoveFileEx((char*)o, (char*)n, MOVEFILE_REPLACE_EXISTING)"; - -PROCEDURE Rename*(VAR o,n: ARRAY OF CHAR): ErrorCode; -BEGIN - IF moveFile(o,n) = 0 THEN RETURN err() ELSE RETURN 0 END -END Rename; - - - - -(* Process termination *) - -PROCEDURE -exit(code: INTEGER) "ExitProcess((UINT)code)"; -PROCEDURE Exit*(code: INTEGER); -BEGIN exit(code) END Exit; - - -PROCEDURE -errstring(s: ARRAY OF CHAR) 'WriteFile((HANDLE)(address)Platform_StdOut, s, s__len-1, 0,0)'; -PROCEDURE -errc (c: CHAR) 'WriteFile((HANDLE)(address)Platform_StdOut, &c, 1, 0,0)'; -PROCEDURE errch(c: CHAR); BEGIN errc(c) END errch; -PROCEDURE errln; BEGIN errch(0DX); errch(0AX) END errln; - -PROCEDURE errposint(l: LONGINT); -BEGIN IF l>10 THEN errposint(l DIV 10) END; errch(CHR(ORD('0') + (l MOD 10))) END errposint; - -PROCEDURE errint(l: LONGINT); -BEGIN IF l<0 THEN errch('-'); l := -l END; errposint(l) END errint; - -PROCEDURE DisplayHaltCode(code: LONGINT); -BEGIN - CASE code OF - | -1: errstring("Rider ReadBuf/WriteBuf transfer size longer than buffer.") - | -2: errstring("Index out of range.") - | -3: errstring("Reached end of function without reaching RETURN.") - | -4: errstring("CASE statement: no matching label and no ELSE.") - | -5: errstring("Type guard failed.") - | -6: errstring("Type equality failed.") - | -7: errstring("WITH statement type guard failed.") - | -8: errstring("SHORT: Value too large for shorter type.") - | -9: errstring("Heap interrupted while locked, but lockdepth = 0 at unlock.") - |-10: errstring("NIL access."); - |-11: errstring("Alignment error."); - |-12: errstring("Divide by zero."); - |-13: errstring("Arithmetic overflow/underflow."); - |-14: errstring("Invalid function argument."); - |-15: errstring("Internal error, e.g. Type descriptor size mismatch.") - |-20: errstring("Too many, or negative number of, elements in dynamic array.") - ELSE - END -END DisplayHaltCode; - -PROCEDURE Halt*(code: LONGINT); -BEGIN - HaltCode := code; - IF HaltHandler # NIL THEN HaltHandler(code) END; - errstring("Terminated by Halt("); errint(code); errstring("). "); - IF code < 0 THEN DisplayHaltCode(code) END; - errln; - exit(SYSTEM.VAL(INTEGER,code)); -END Halt; - -PROCEDURE AssertFail*(code: LONGINT); -BEGIN - errstring("Assertion failure."); - IF code # 0 THEN errstring(" ASSERT code "); errint(code); errstring("."); END; - errln; - exit(SYSTEM.VAL(INTEGER,code)); -END AssertFail; - -PROCEDURE SetHalt*(p: HaltProcedure); -BEGIN HaltHandler := p; END SetHalt; - - - - -PROCEDURE TestLittleEndian; - VAR i: INTEGER; - BEGIN i := 1; SYSTEM.GET(SYSTEM.ADR(i), LittleEndian); END TestLittleEndian; - - -PROCEDURE -getstdinhandle(): FileHandle "(address)GetStdHandle(STD_INPUT_HANDLE)"; -PROCEDURE -getstdouthandle(): FileHandle "(address)GetStdHandle(STD_OUTPUT_HANDLE)"; -PROCEDURE -getstderrhandle(): FileHandle "(address)GetStdHandle(STD_ERROR_HANDLE)"; -PROCEDURE -getpid(): INTEGER "(INTEGER)GetCurrentProcessId()"; - -BEGIN - TestLittleEndian; - - HaltCode := -128; - HaltHandler := NIL; - TimeStart := 0; TimeStart := Time(); - CWD := ""; getCurrentDirectory(CWD); - PID := getpid(); - - SeekSet := seekset(); - SeekCur := seekcur(); - SeekEnd := seekend(); - - StdIn := getstdinhandle(); - StdOut := getstdouthandle(); - StdErr := getstderrhandle(); - - nl[0] := 0DX; (* CR *) - nl[1] := 0AX; (* LF *) - nl[2] := 0X; -END Platform. diff --git a/src/tools/browser/BrowserCmd.Mod b/src/tools/browser/BrowserCmd.Mod index b017c028..3ae3dd5b 100644 --- a/src/tools/browser/BrowserCmd.Mod +++ b/src/tools/browser/BrowserCmd.Mod @@ -1,7 +1,7 @@ MODULE BrowserCmd; (* RC 29.10.93 *) (* object model 4.12.93, command line version jt 4.4.95 *) IMPORT - OPM, OPS, OPT, OPV, Texts, Console, Platform, SYSTEM; + OPM, OPS, OPT, OPV, Texts, Out, Platform, SYSTEM; CONST @@ -257,12 +257,12 @@ MODULE BrowserCmd; (* RC 29.10.93 *) (* object model 4.12.93, command line ver OPT.Init(name, {}); OPT.SelfName := "AvoidErr154"; WModule(name, T); OPT.Close; Texts.OpenReader(R, T, 0); Texts.Read(R, ch); i := 0; WHILE ~R.eot DO - IF ch = 0DX THEN s[i] := 0X; i := 0; Console.String(s); Console.Ln + IF ch = 0DX THEN s[i] := 0X; i := 0; Out.String(s); Out.Ln ELSE s[i] := ch; INC(i) END ; Texts.Read(R, ch) END ; - s[i] := 0X; Console.String(s) + s[i] := 0X; Out.String(s) END END ShowDef; diff --git a/src/tools/make/oberon.mk b/src/tools/make/oberon.mk index 6d2a9c24..d4abd1e3 100644 --- a/src/tools/make/oberon.mk +++ b/src/tools/make/oberon.mk @@ -60,17 +60,17 @@ assemble: @printf " DATAMODEL: %s\n" "$(DATAMODEL)" cd $(BUILDDIR) && $(COMPILE) -c SYSTEM.c Configuration.c Platform.c Heap.c - cd $(BUILDDIR) && $(COMPILE) -c Console.c Strings.c Modules.c Files.c + cd $(BUILDDIR) && $(COMPILE) -c Out.c Strings.c Modules.c Files.c cd $(BUILDDIR) && $(COMPILE) -c Reals.c Texts.c vt100.c errors.c cd $(BUILDDIR) && $(COMPILE) -c OPM.c extTools.c OPS.c OPT.c cd $(BUILDDIR) && $(COMPILE) -c OPC.c OPV.c OPB.c OPP.c cd $(BUILDDIR) && $(COMPILE) $(STATICLINK) Compiler.c -o $(ROOTDIR)/$(OBECOMP) \ - SYSTEM.o Configuration.o Platform.o Heap.o Console.o Strings.o Modules.o Files.o \ + SYSTEM.o Configuration.o Platform.o Heap.o Out.o Strings.o Modules.o Files.o \ Reals.o Texts.o vt100.o errors.o OPM.o extTools.o OPS.o OPT.o \ OPC.o OPV.o OPB.o OPP.o - cp src/system/*.[ch] $(BUILDDIR) + cp src/runtime/*.[ch] $(BUILDDIR) @printf "$(OBECOMP) created.\n" @@ -102,15 +102,15 @@ translate: @rm -f $(BUILDDIR)/*.sym cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../Configuration.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/system/Platform$(PLATFORM).Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfFapx -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/system/Heap.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/system/Console.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/library/v4/Strings.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/library/v4/Modules.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfFx -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/system/Files.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/library/v4/Reals.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/library/v4/Texts.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/library/misc/vt100.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Platform$(PLATFORM).Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfFapx -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Heap.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfFapx -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Out.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Strings.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Modules.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfFx -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Files.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Reals.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Texts.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/vt100.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/errors.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/OPM.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/extTools.Mod @@ -131,7 +131,7 @@ browsercmd: @printf "\nMaking symbol browser\n" @cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -fSm -O$(MODEL) ../../src/tools/browser/BrowserCmd.Mod @cd $(BUILDDIR); $(COMPILE) BrowserCmd.c -o showdef \ - Platform.o Texts.o OPT.o Heap.o Console.o SYSTEM.o OPM.o OPS.o OPV.o \ + Platform.o Texts.o OPT.o Heap.o Out.o SYSTEM.o OPM.o OPS.o OPV.o \ Files.o Reals.o Modules.o vt100.o errors.o Configuration.o Strings.o \ OPC.o @@ -191,7 +191,7 @@ uninstall: runtime: @printf "\nMaking run time library for -O$(MODEL)\n" mkdir -p $(BUILDDIR)/$(MODEL) - cp src/system/*.[ch] $(BUILDDIR)/$(MODEL) + cp src/runtime/*.[ch] $(BUILDDIR)/$(MODEL) cd $(BUILDDIR)/$(MODEL) && $(COMPILE) -c SYSTEM.c cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Platform$(PLATFORM).Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Heap.Mod @@ -215,6 +215,7 @@ runtime: v4: @printf "\nMaking v4 library\n" cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/v4/Args.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/v4/Console.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/v4/Printer.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/v4/Sets.Mod @@ -334,7 +335,7 @@ pow32: misc: @printf "\nMaking misc library\n" - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/system/Oberon.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/runtime/Oberon.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/misc/crt.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/misc/Listen.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/misc/MersenneTwister.Mod From fcb51a6c23cc62d5b8b647b42d93533cffd83805 Mon Sep 17 00:00:00 2001 From: David Brown Date: Sat, 1 Oct 2016 17:58:16 +0100 Subject: [PATCH 269/580] Fix Platform.Write on 32 bit builds. --- src/runtime/Platformunix.Mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runtime/Platformunix.Mod b/src/runtime/Platformunix.Mod index 034906bd..3db3f2d7 100644 --- a/src/runtime/Platformunix.Mod +++ b/src/runtime/Platformunix.Mod @@ -389,7 +389,7 @@ END ReadBuf; -PROCEDURE -writefile(fd: LONGINT; p: SYSTEM.ADDRESS; l: SYSTEM.ADDRESS): SYSTEM.ADDRESS +PROCEDURE -writefile(fd: LONGINT; p: SYSTEM.ADDRESS; l: LONGINT): SYSTEM.ADDRESS "write(fd, (void*)(address)(p), l)"; PROCEDURE Write*(h: FileHandle; p: SYSTEM.ADDRESS; l: LONGINT): ErrorCode; From 80c9d36a7a536bd8c8f70143e3b4c33d5612459b Mon Sep 17 00:00:00 2001 From: David Brown Date: Mon, 3 Oct 2016 20:05:22 +0100 Subject: [PATCH 270/580] (Largely untested) Oakwood Math.Mod, some SETxx fixes. --- bootstrap/unix-44/Compiler.c | 2 +- bootstrap/unix-44/Configuration.c | 4 +- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Files.c | 2 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 2 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 4 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 2 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 2 +- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 2 +- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 55 +-- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Out.c | 2 +- bootstrap/unix-44/Out.h | 2 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/errors.c | 2 +- bootstrap/unix-44/errors.h | 2 +- bootstrap/unix-44/extTools.c | 2 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-44/vt100.c | 2 +- bootstrap/unix-44/vt100.h | 2 +- bootstrap/unix-48/Compiler.c | 2 +- bootstrap/unix-48/Configuration.c | 4 +- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Files.c | 2 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 2 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 4 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 2 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 2 +- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 2 +- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 55 +-- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Out.c | 2 +- bootstrap/unix-48/Out.h | 2 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/errors.c | 2 +- bootstrap/unix-48/errors.h | 2 +- bootstrap/unix-48/extTools.c | 2 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-48/vt100.c | 2 +- bootstrap/unix-48/vt100.h | 2 +- bootstrap/unix-88/Compiler.c | 2 +- bootstrap/unix-88/Configuration.c | 4 +- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Files.c | 2 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 2 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 4 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 2 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 2 +- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 2 +- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 55 +-- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Out.c | 2 +- bootstrap/unix-88/Out.h | 2 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/errors.c | 2 +- bootstrap/unix-88/errors.h | 2 +- bootstrap/unix-88/extTools.c | 2 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/unix-88/vt100.c | 2 +- bootstrap/unix-88/vt100.h | 2 +- bootstrap/windows-48/Compiler.c | 2 +- bootstrap/windows-48/Configuration.c | 4 +- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Files.c | 2 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 2 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 4 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 2 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 2 +- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 2 +- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 55 +-- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Out.c | 2 +- bootstrap/windows-48/Out.h | 2 +- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/errors.c | 2 +- bootstrap/windows-48/errors.h | 2 +- bootstrap/windows-48/extTools.c | 2 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-48/vt100.c | 2 +- bootstrap/windows-48/vt100.h | 2 +- bootstrap/windows-88/Compiler.c | 2 +- bootstrap/windows-88/Configuration.c | 4 +- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Files.c | 2 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 2 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 4 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 2 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 2 +- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 2 +- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 55 +-- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Out.c | 2 +- bootstrap/windows-88/Out.h | 2 +- bootstrap/windows-88/Platform.c | 2 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/errors.c | 2 +- bootstrap/windows-88/errors.h | 2 +- bootstrap/windows-88/extTools.c | 2 +- bootstrap/windows-88/extTools.h | 2 +- bootstrap/windows-88/vt100.c | 2 +- bootstrap/windows-88/vt100.h | 2 +- src/compiler/OPB.Mod | 1 + src/compiler/OPV.Mod | 28 +- src/runtime/LowReal.Mod | 417 ----------------- src/runtime/Math.Mod | 640 +++++++++++++++++---------- src/tools/make/oberon.mk | 6 +- 200 files changed, 780 insertions(+), 987 deletions(-) delete mode 100644 src/runtime/LowReal.Mod diff --git a/bootstrap/unix-44/Compiler.c b/bootstrap/unix-44/Compiler.c index a3cc57ea..5eeecbcd 100644 --- a/bootstrap/unix-44/Compiler.c +++ b/bootstrap/unix-44/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index 32d0b51f..8d939331 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index db2b8c32..29896228 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 25192376..5ccc86c7 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index 1a38cc40..4df07327 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index 9c9c2846..ed20badb 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index d4afd6fe..15cedcc4 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index 9cfee5c9..352866db 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index 4e105135..c6f0ec55 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index ef3ea081..80807ca6 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -1273,6 +1273,8 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) case 7: if ((g == 7 && y->typ->size < z->typ->size)) { OPB_Convert(&y, z->typ); + } else if (g == 7) { + OPB_Convert(&z, y->typ); } else { OPB_err(100); } diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index 54e81677..7917b570 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 6739a87e..fad4716b 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index 32ec3b7f..6d64b896 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 1ab50cf6..c2760a09 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index 960bd0ba..b798756b 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index 3a1bf6f6..f691a0ee 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index 8b28d78e..b466e3aa 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index 882c9331..bd835f8d 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index 62dc025a..af7eca8a 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index 66d53030..3e713505 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index 6f17b409..5fe4dd5c 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index ba7bab5f..ab191652 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -41,7 +41,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x); static void OPV_ParIntLiteral (int64 n, int32 size); static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp); static BOOLEAN OPV_SideEffects (OPT_Node n); -static void OPV_SizeCast (int32 from, int32 to); +static void OPV_SizeCast (OPT_Node n, int32 to); static void OPV_Stamp (OPS_Name s); static OPT_Object OPV_SuperProc (OPT_Node n); static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported); @@ -380,12 +380,24 @@ static void OPV_Entier (OPT_Node n, int16 prec) } } -static void OPV_SizeCast (int32 from, int32 to) +static void OPV_SizeCast (OPT_Node n, int32 to) { - if ((from != to && (from > 4 || to != 4))) { - OPM_WriteString((CHAR*)"(int", 5); - OPM_WriteInt(__ASHL(to, 3)); - OPM_WriteString((CHAR*)")", 2); + if ((to < n->typ->size && __IN(2, OPM_Options, 32))) { + OPM_WriteString((CHAR*)"__SHORT", 8); + if (OPV_SideEffects(n)) { + OPM_Write('F'); + } + OPM_Write('('); + OPV_Entier(n, -1); + OPM_WriteString((CHAR*)", ", 3); + OPM_WriteInt(OPM_SignedMaximum(to) + 1); + OPM_Write(')'); + } else { + if ((n->typ->size != to && (n->typ->size > 4 || to != 4))) { + OPM_WriteString((CHAR*)"(int", 5); + OPM_WriteInt(__ASHL(to, 3)); + OPM_WriteString((CHAR*)")", 2); + } } } @@ -395,26 +407,19 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int16 prec) from = n->typ->form; to = newtype->form; if (to == 7) { - OPM_WriteString((CHAR*)"__SETOF(", 9); - OPV_Entier(n, -1); - OPM_WriteString((CHAR*)",", 2); - OPM_WriteInt(__ASHL(newtype->size, 3)); - OPM_Write(')'); - } else if (to == 4) { - if ((newtype->size < n->typ->size && __IN(2, OPM_Options, 32))) { - OPM_WriteString((CHAR*)"__SHORT", 8); - if (OPV_SideEffects(n)) { - OPM_Write('F'); - } - OPM_Write('('); - OPV_Entier(n, -1); - OPM_WriteString((CHAR*)", ", 3); - OPM_WriteInt(OPM_SignedMaximum(newtype->size) + 1); - OPM_Write(')'); - } else { - OPV_SizeCast(n->typ->size, newtype->size); + if (from == 7) { + OPV_SizeCast(n, newtype->size); OPV_Entier(n, 9); + } else { + OPM_WriteString((CHAR*)"__SETOF(", 9); + OPV_Entier(n, -1); + OPM_WriteString((CHAR*)",", 2); + OPM_WriteInt(__ASHL(newtype->size, 3)); + OPM_Write(')'); } + } else if (to == 4) { + OPV_SizeCast(n, newtype->size); + OPV_Entier(n, 9); } else if (to == 3) { if (__IN(2, OPM_Options, 32)) { OPM_WriteString((CHAR*)"__CHR", 6); diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index 30c2c7e7..49c91eed 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Out.c b/bootstrap/unix-44/Out.c index a99d3410..c278b7af 100644 --- a/bootstrap/unix-44/Out.c +++ b/bootstrap/unix-44/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Out.h b/bootstrap/unix-44/Out.h index 6717f71b..72b7e0cb 100644 --- a/bootstrap/unix-44/Out.h +++ b/bootstrap/unix-44/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index addd94c0..16672654 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index 18008f62..d4fe9c38 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index f173fc32..97923f8d 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index 98443ee2..24d6197a 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index accc2e6a..afd5e004 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index 9ebac10a..ce00b00c 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index ac457f52..9b65a9b8 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index 80ab5a77..bf82f949 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/errors.c b/bootstrap/unix-44/errors.c index b071c3a8..d35766eb 100644 --- a/bootstrap/unix-44/errors.c +++ b/bootstrap/unix-44/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/errors.h b/bootstrap/unix-44/errors.h index 1560dc0d..6adfb219 100644 --- a/bootstrap/unix-44/errors.h +++ b/bootstrap/unix-44/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index f6b467bb..5f5a39b3 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index ab7785db..57da5b24 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-44/vt100.c b/bootstrap/unix-44/vt100.c index 23b25f53..61383b15 100644 --- a/bootstrap/unix-44/vt100.c +++ b/bootstrap/unix-44/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/vt100.h b/bootstrap/unix-44/vt100.h index 95c8d77e..511c4d6b 100644 --- a/bootstrap/unix-44/vt100.h +++ b/bootstrap/unix-44/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-48/Compiler.c b/bootstrap/unix-48/Compiler.c index a3cc57ea..5eeecbcd 100644 --- a/bootstrap/unix-48/Compiler.c +++ b/bootstrap/unix-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index 32d0b51f..8d939331 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index db2b8c32..29896228 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 25192376..5ccc86c7 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index 1a38cc40..4df07327 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index 9c9c2846..ed20badb 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index d4afd6fe..15cedcc4 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index 9cfee5c9..352866db 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index 4e105135..c6f0ec55 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index ef3ea081..80807ca6 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -1273,6 +1273,8 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) case 7: if ((g == 7 && y->typ->size < z->typ->size)) { OPB_Convert(&y, z->typ); + } else if (g == 7) { + OPB_Convert(&z, y->typ); } else { OPB_err(100); } diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index 54e81677..7917b570 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 6739a87e..fad4716b 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index 32ec3b7f..6d64b896 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 1ab50cf6..c2760a09 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index 960bd0ba..b798756b 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index 3a1bf6f6..f691a0ee 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index 8b28d78e..b466e3aa 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index 882c9331..bd835f8d 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index 62dc025a..af7eca8a 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index a23ac389..bd0b6935 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index 6f17b409..5fe4dd5c 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index ba7bab5f..ab191652 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -41,7 +41,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x); static void OPV_ParIntLiteral (int64 n, int32 size); static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp); static BOOLEAN OPV_SideEffects (OPT_Node n); -static void OPV_SizeCast (int32 from, int32 to); +static void OPV_SizeCast (OPT_Node n, int32 to); static void OPV_Stamp (OPS_Name s); static OPT_Object OPV_SuperProc (OPT_Node n); static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported); @@ -380,12 +380,24 @@ static void OPV_Entier (OPT_Node n, int16 prec) } } -static void OPV_SizeCast (int32 from, int32 to) +static void OPV_SizeCast (OPT_Node n, int32 to) { - if ((from != to && (from > 4 || to != 4))) { - OPM_WriteString((CHAR*)"(int", 5); - OPM_WriteInt(__ASHL(to, 3)); - OPM_WriteString((CHAR*)")", 2); + if ((to < n->typ->size && __IN(2, OPM_Options, 32))) { + OPM_WriteString((CHAR*)"__SHORT", 8); + if (OPV_SideEffects(n)) { + OPM_Write('F'); + } + OPM_Write('('); + OPV_Entier(n, -1); + OPM_WriteString((CHAR*)", ", 3); + OPM_WriteInt(OPM_SignedMaximum(to) + 1); + OPM_Write(')'); + } else { + if ((n->typ->size != to && (n->typ->size > 4 || to != 4))) { + OPM_WriteString((CHAR*)"(int", 5); + OPM_WriteInt(__ASHL(to, 3)); + OPM_WriteString((CHAR*)")", 2); + } } } @@ -395,26 +407,19 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int16 prec) from = n->typ->form; to = newtype->form; if (to == 7) { - OPM_WriteString((CHAR*)"__SETOF(", 9); - OPV_Entier(n, -1); - OPM_WriteString((CHAR*)",", 2); - OPM_WriteInt(__ASHL(newtype->size, 3)); - OPM_Write(')'); - } else if (to == 4) { - if ((newtype->size < n->typ->size && __IN(2, OPM_Options, 32))) { - OPM_WriteString((CHAR*)"__SHORT", 8); - if (OPV_SideEffects(n)) { - OPM_Write('F'); - } - OPM_Write('('); - OPV_Entier(n, -1); - OPM_WriteString((CHAR*)", ", 3); - OPM_WriteInt(OPM_SignedMaximum(newtype->size) + 1); - OPM_Write(')'); - } else { - OPV_SizeCast(n->typ->size, newtype->size); + if (from == 7) { + OPV_SizeCast(n, newtype->size); OPV_Entier(n, 9); + } else { + OPM_WriteString((CHAR*)"__SETOF(", 9); + OPV_Entier(n, -1); + OPM_WriteString((CHAR*)",", 2); + OPM_WriteInt(__ASHL(newtype->size, 3)); + OPM_Write(')'); } + } else if (to == 4) { + OPV_SizeCast(n, newtype->size); + OPV_Entier(n, 9); } else if (to == 3) { if (__IN(2, OPM_Options, 32)) { OPM_WriteString((CHAR*)"__CHR", 6); diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index 30c2c7e7..49c91eed 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Out.c b/bootstrap/unix-48/Out.c index a99d3410..c278b7af 100644 --- a/bootstrap/unix-48/Out.c +++ b/bootstrap/unix-48/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Out.h b/bootstrap/unix-48/Out.h index 6717f71b..72b7e0cb 100644 --- a/bootstrap/unix-48/Out.h +++ b/bootstrap/unix-48/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index addd94c0..16672654 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index 18008f62..d4fe9c38 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index f173fc32..97923f8d 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index 98443ee2..24d6197a 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index accc2e6a..afd5e004 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index 9ebac10a..ce00b00c 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index 8fd544dc..f656fcc8 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index 3d119274..6feea28a 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/errors.c b/bootstrap/unix-48/errors.c index b071c3a8..d35766eb 100644 --- a/bootstrap/unix-48/errors.c +++ b/bootstrap/unix-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/errors.h b/bootstrap/unix-48/errors.h index 1560dc0d..6adfb219 100644 --- a/bootstrap/unix-48/errors.h +++ b/bootstrap/unix-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index f6b467bb..5f5a39b3 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index ab7785db..57da5b24 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/vt100.c b/bootstrap/unix-48/vt100.c index 23b25f53..61383b15 100644 --- a/bootstrap/unix-48/vt100.c +++ b/bootstrap/unix-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/vt100.h b/bootstrap/unix-48/vt100.h index 95c8d77e..511c4d6b 100644 --- a/bootstrap/unix-48/vt100.h +++ b/bootstrap/unix-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-88/Compiler.c b/bootstrap/unix-88/Compiler.c index a3cc57ea..5eeecbcd 100644 --- a/bootstrap/unix-88/Compiler.c +++ b/bootstrap/unix-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index 32d0b51f..8d939331 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index db2b8c32..29896228 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 010c9d80..980cd0fc 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 87c48fa5..fefffb47 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index 6ab9f1ca..2dd37317 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index b183ffa4..dc9db0d8 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index dab15898..57b8190a 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index 4e105135..c6f0ec55 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index ef3ea081..80807ca6 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -1273,6 +1273,8 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) case 7: if ((g == 7 && y->typ->size < z->typ->size)) { OPB_Convert(&y, z->typ); + } else if (g == 7) { + OPB_Convert(&z, y->typ); } else { OPB_err(100); } diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index 54e81677..7917b570 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index 6739a87e..fad4716b 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index 32ec3b7f..6d64b896 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 732baf46..bc0b1d98 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index 960bd0ba..b798756b 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index bf1c6c9b..643f8fc5 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index 8b28d78e..b466e3aa 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index 882c9331..bd835f8d 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index 62dc025a..af7eca8a 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index 186ab7e3..a8d1a2b2 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 6f17b409..5fe4dd5c 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index f566e592..5004eab0 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -41,7 +41,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x); static void OPV_ParIntLiteral (int64 n, int32 size); static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp); static BOOLEAN OPV_SideEffects (OPT_Node n); -static void OPV_SizeCast (int32 from, int32 to); +static void OPV_SizeCast (OPT_Node n, int32 to); static void OPV_Stamp (OPS_Name s); static OPT_Object OPV_SuperProc (OPT_Node n); static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported); @@ -380,12 +380,24 @@ static void OPV_Entier (OPT_Node n, int16 prec) } } -static void OPV_SizeCast (int32 from, int32 to) +static void OPV_SizeCast (OPT_Node n, int32 to) { - if ((from != to && (from > 4 || to != 4))) { - OPM_WriteString((CHAR*)"(int", 5); - OPM_WriteInt(__ASHL(to, 3)); - OPM_WriteString((CHAR*)")", 2); + if ((to < n->typ->size && __IN(2, OPM_Options, 32))) { + OPM_WriteString((CHAR*)"__SHORT", 8); + if (OPV_SideEffects(n)) { + OPM_Write('F'); + } + OPM_Write('('); + OPV_Entier(n, -1); + OPM_WriteString((CHAR*)", ", 3); + OPM_WriteInt(OPM_SignedMaximum(to) + 1); + OPM_Write(')'); + } else { + if ((n->typ->size != to && (n->typ->size > 4 || to != 4))) { + OPM_WriteString((CHAR*)"(int", 5); + OPM_WriteInt(__ASHL(to, 3)); + OPM_WriteString((CHAR*)")", 2); + } } } @@ -395,26 +407,19 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int16 prec) from = n->typ->form; to = newtype->form; if (to == 7) { - OPM_WriteString((CHAR*)"__SETOF(", 9); - OPV_Entier(n, -1); - OPM_WriteString((CHAR*)",", 2); - OPM_WriteInt(__ASHL(newtype->size, 3)); - OPM_Write(')'); - } else if (to == 4) { - if ((newtype->size < n->typ->size && __IN(2, OPM_Options, 32))) { - OPM_WriteString((CHAR*)"__SHORT", 8); - if (OPV_SideEffects(n)) { - OPM_Write('F'); - } - OPM_Write('('); - OPV_Entier(n, -1); - OPM_WriteString((CHAR*)", ", 3); - OPM_WriteInt(OPM_SignedMaximum(newtype->size) + 1); - OPM_Write(')'); - } else { - OPV_SizeCast(n->typ->size, newtype->size); + if (from == 7) { + OPV_SizeCast(n, newtype->size); OPV_Entier(n, 9); + } else { + OPM_WriteString((CHAR*)"__SETOF(", 9); + OPV_Entier(n, -1); + OPM_WriteString((CHAR*)",", 2); + OPM_WriteInt(__ASHL(newtype->size, 3)); + OPM_Write(')'); } + } else if (to == 4) { + OPV_SizeCast(n, newtype->size); + OPV_Entier(n, 9); } else if (to == 3) { if (__IN(2, OPM_Options, 32)) { OPM_WriteString((CHAR*)"__CHR", 6); diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index 30c2c7e7..49c91eed 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Out.c b/bootstrap/unix-88/Out.c index a99d3410..c278b7af 100644 --- a/bootstrap/unix-88/Out.c +++ b/bootstrap/unix-88/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Out.h b/bootstrap/unix-88/Out.h index 6717f71b..72b7e0cb 100644 --- a/bootstrap/unix-88/Out.h +++ b/bootstrap/unix-88/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index b648dbcc..f677d8cf 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index c74c7031..14ebab63 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index f173fc32..97923f8d 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index 98443ee2..24d6197a 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index accc2e6a..afd5e004 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index 9ebac10a..ce00b00c 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index 369dceed..97cfe790 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index 8c6bf3f2..695d46a5 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/errors.c b/bootstrap/unix-88/errors.c index b071c3a8..d35766eb 100644 --- a/bootstrap/unix-88/errors.c +++ b/bootstrap/unix-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/errors.h b/bootstrap/unix-88/errors.h index 1560dc0d..6adfb219 100644 --- a/bootstrap/unix-88/errors.h +++ b/bootstrap/unix-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index f6b467bb..5f5a39b3 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index ab7785db..57da5b24 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/vt100.c b/bootstrap/unix-88/vt100.c index 23b25f53..61383b15 100644 --- a/bootstrap/unix-88/vt100.c +++ b/bootstrap/unix-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/vt100.h b/bootstrap/unix-88/vt100.h index 95c8d77e..511c4d6b 100644 --- a/bootstrap/unix-88/vt100.h +++ b/bootstrap/unix-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-48/Compiler.c b/bootstrap/windows-48/Compiler.c index a3cc57ea..5eeecbcd 100644 --- a/bootstrap/windows-48/Compiler.c +++ b/bootstrap/windows-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index 32d0b51f..8d939331 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index db2b8c32..29896228 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 4e669b75..afea83b3 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index 3d4b568e..d797cd7d 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index 9c9c2846..ed20badb 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index d4afd6fe..15cedcc4 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index 9cfee5c9..352866db 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index 4e105135..c6f0ec55 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index ef3ea081..80807ca6 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -1273,6 +1273,8 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) case 7: if ((g == 7 && y->typ->size < z->typ->size)) { OPB_Convert(&y, z->typ); + } else if (g == 7) { + OPB_Convert(&z, y->typ); } else { OPB_err(100); } diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index 54e81677..7917b570 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 6739a87e..fad4716b 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index 32ec3b7f..6d64b896 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 1ab50cf6..c2760a09 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index 960bd0ba..b798756b 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index 3a1bf6f6..f691a0ee 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index 8b28d78e..b466e3aa 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index 882c9331..bd835f8d 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index 62dc025a..af7eca8a 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index a23ac389..bd0b6935 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index 6f17b409..5fe4dd5c 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index ba7bab5f..ab191652 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -41,7 +41,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x); static void OPV_ParIntLiteral (int64 n, int32 size); static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp); static BOOLEAN OPV_SideEffects (OPT_Node n); -static void OPV_SizeCast (int32 from, int32 to); +static void OPV_SizeCast (OPT_Node n, int32 to); static void OPV_Stamp (OPS_Name s); static OPT_Object OPV_SuperProc (OPT_Node n); static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported); @@ -380,12 +380,24 @@ static void OPV_Entier (OPT_Node n, int16 prec) } } -static void OPV_SizeCast (int32 from, int32 to) +static void OPV_SizeCast (OPT_Node n, int32 to) { - if ((from != to && (from > 4 || to != 4))) { - OPM_WriteString((CHAR*)"(int", 5); - OPM_WriteInt(__ASHL(to, 3)); - OPM_WriteString((CHAR*)")", 2); + if ((to < n->typ->size && __IN(2, OPM_Options, 32))) { + OPM_WriteString((CHAR*)"__SHORT", 8); + if (OPV_SideEffects(n)) { + OPM_Write('F'); + } + OPM_Write('('); + OPV_Entier(n, -1); + OPM_WriteString((CHAR*)", ", 3); + OPM_WriteInt(OPM_SignedMaximum(to) + 1); + OPM_Write(')'); + } else { + if ((n->typ->size != to && (n->typ->size > 4 || to != 4))) { + OPM_WriteString((CHAR*)"(int", 5); + OPM_WriteInt(__ASHL(to, 3)); + OPM_WriteString((CHAR*)")", 2); + } } } @@ -395,26 +407,19 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int16 prec) from = n->typ->form; to = newtype->form; if (to == 7) { - OPM_WriteString((CHAR*)"__SETOF(", 9); - OPV_Entier(n, -1); - OPM_WriteString((CHAR*)",", 2); - OPM_WriteInt(__ASHL(newtype->size, 3)); - OPM_Write(')'); - } else if (to == 4) { - if ((newtype->size < n->typ->size && __IN(2, OPM_Options, 32))) { - OPM_WriteString((CHAR*)"__SHORT", 8); - if (OPV_SideEffects(n)) { - OPM_Write('F'); - } - OPM_Write('('); - OPV_Entier(n, -1); - OPM_WriteString((CHAR*)", ", 3); - OPM_WriteInt(OPM_SignedMaximum(newtype->size) + 1); - OPM_Write(')'); - } else { - OPV_SizeCast(n->typ->size, newtype->size); + if (from == 7) { + OPV_SizeCast(n, newtype->size); OPV_Entier(n, 9); + } else { + OPM_WriteString((CHAR*)"__SETOF(", 9); + OPV_Entier(n, -1); + OPM_WriteString((CHAR*)",", 2); + OPM_WriteInt(__ASHL(newtype->size, 3)); + OPM_Write(')'); } + } else if (to == 4) { + OPV_SizeCast(n, newtype->size); + OPV_Entier(n, 9); } else if (to == 3) { if (__IN(2, OPM_Options, 32)) { OPM_WriteString((CHAR*)"__CHR", 6); diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index 30c2c7e7..49c91eed 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Out.c b/bootstrap/windows-48/Out.c index 60051d13..f08085ef 100644 --- a/bootstrap/windows-48/Out.c +++ b/bootstrap/windows-48/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Out.h b/bootstrap/windows-48/Out.h index 6717f71b..72b7e0cb 100644 --- a/bootstrap/windows-48/Out.h +++ b/bootstrap/windows-48/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index f3eea094..7b5e8a8c 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index a07ae09d..e0dfb26e 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index f173fc32..97923f8d 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index 98443ee2..24d6197a 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index accc2e6a..afd5e004 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index 9ebac10a..ce00b00c 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index 8fd544dc..f656fcc8 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index 3d119274..6feea28a 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/errors.c b/bootstrap/windows-48/errors.c index b071c3a8..d35766eb 100644 --- a/bootstrap/windows-48/errors.c +++ b/bootstrap/windows-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/errors.h b/bootstrap/windows-48/errors.h index 1560dc0d..6adfb219 100644 --- a/bootstrap/windows-48/errors.h +++ b/bootstrap/windows-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index f6b467bb..5f5a39b3 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index ab7785db..57da5b24 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/vt100.c b/bootstrap/windows-48/vt100.c index 23b25f53..61383b15 100644 --- a/bootstrap/windows-48/vt100.c +++ b/bootstrap/windows-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/vt100.h b/bootstrap/windows-48/vt100.h index 95c8d77e..511c4d6b 100644 --- a/bootstrap/windows-48/vt100.h +++ b/bootstrap/windows-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-88/Compiler.c b/bootstrap/windows-88/Compiler.c index a3cc57ea..5eeecbcd 100644 --- a/bootstrap/windows-88/Compiler.c +++ b/bootstrap/windows-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index 32d0b51f..8d939331 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index db2b8c32..29896228 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 7dda2f04..a2df0b07 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 82031060..85708a3f 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index 6ab9f1ca..2dd37317 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index b183ffa4..dc9db0d8 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index dab15898..57b8190a 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index 4e105135..c6f0ec55 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index ef3ea081..80807ca6 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -1273,6 +1273,8 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) case 7: if ((g == 7 && y->typ->size < z->typ->size)) { OPB_Convert(&y, z->typ); + } else if (g == 7) { + OPB_Convert(&z, y->typ); } else { OPB_err(100); } diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index 54e81677..7917b570 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index 6739a87e..fad4716b 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index 32ec3b7f..6d64b896 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 732baf46..bc0b1d98 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index 960bd0ba..b798756b 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index bf1c6c9b..643f8fc5 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index 8b28d78e..b466e3aa 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index 882c9331..bd835f8d 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index 62dc025a..af7eca8a 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index 186ab7e3..a8d1a2b2 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 6f17b409..5fe4dd5c 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index f566e592..5004eab0 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -41,7 +41,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x); static void OPV_ParIntLiteral (int64 n, int32 size); static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp); static BOOLEAN OPV_SideEffects (OPT_Node n); -static void OPV_SizeCast (int32 from, int32 to); +static void OPV_SizeCast (OPT_Node n, int32 to); static void OPV_Stamp (OPS_Name s); static OPT_Object OPV_SuperProc (OPT_Node n); static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported); @@ -380,12 +380,24 @@ static void OPV_Entier (OPT_Node n, int16 prec) } } -static void OPV_SizeCast (int32 from, int32 to) +static void OPV_SizeCast (OPT_Node n, int32 to) { - if ((from != to && (from > 4 || to != 4))) { - OPM_WriteString((CHAR*)"(int", 5); - OPM_WriteInt(__ASHL(to, 3)); - OPM_WriteString((CHAR*)")", 2); + if ((to < n->typ->size && __IN(2, OPM_Options, 32))) { + OPM_WriteString((CHAR*)"__SHORT", 8); + if (OPV_SideEffects(n)) { + OPM_Write('F'); + } + OPM_Write('('); + OPV_Entier(n, -1); + OPM_WriteString((CHAR*)", ", 3); + OPM_WriteInt(OPM_SignedMaximum(to) + 1); + OPM_Write(')'); + } else { + if ((n->typ->size != to && (n->typ->size > 4 || to != 4))) { + OPM_WriteString((CHAR*)"(int", 5); + OPM_WriteInt(__ASHL(to, 3)); + OPM_WriteString((CHAR*)")", 2); + } } } @@ -395,26 +407,19 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int16 prec) from = n->typ->form; to = newtype->form; if (to == 7) { - OPM_WriteString((CHAR*)"__SETOF(", 9); - OPV_Entier(n, -1); - OPM_WriteString((CHAR*)",", 2); - OPM_WriteInt(__ASHL(newtype->size, 3)); - OPM_Write(')'); - } else if (to == 4) { - if ((newtype->size < n->typ->size && __IN(2, OPM_Options, 32))) { - OPM_WriteString((CHAR*)"__SHORT", 8); - if (OPV_SideEffects(n)) { - OPM_Write('F'); - } - OPM_Write('('); - OPV_Entier(n, -1); - OPM_WriteString((CHAR*)", ", 3); - OPM_WriteInt(OPM_SignedMaximum(newtype->size) + 1); - OPM_Write(')'); - } else { - OPV_SizeCast(n->typ->size, newtype->size); + if (from == 7) { + OPV_SizeCast(n, newtype->size); OPV_Entier(n, 9); + } else { + OPM_WriteString((CHAR*)"__SETOF(", 9); + OPV_Entier(n, -1); + OPM_WriteString((CHAR*)",", 2); + OPM_WriteInt(__ASHL(newtype->size, 3)); + OPM_Write(')'); } + } else if (to == 4) { + OPV_SizeCast(n, newtype->size); + OPV_Entier(n, 9); } else if (to == 3) { if (__IN(2, OPM_Options, 32)) { OPM_WriteString((CHAR*)"__CHR", 6); diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index 30c2c7e7..49c91eed 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Out.c b/bootstrap/windows-88/Out.c index 60051d13..f08085ef 100644 --- a/bootstrap/windows-88/Out.c +++ b/bootstrap/windows-88/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Out.h b/bootstrap/windows-88/Out.h index 6717f71b..72b7e0cb 100644 --- a/bootstrap/windows-88/Out.h +++ b/bootstrap/windows-88/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index efcb7845..8f725aaa 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index 2e13990f..070acb18 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index f173fc32..97923f8d 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index 98443ee2..24d6197a 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index accc2e6a..afd5e004 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index 9ebac10a..ce00b00c 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index 369dceed..97cfe790 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index 8c6bf3f2..695d46a5 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/errors.c b/bootstrap/windows-88/errors.c index b071c3a8..d35766eb 100644 --- a/bootstrap/windows-88/errors.c +++ b/bootstrap/windows-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/errors.h b/bootstrap/windows-88/errors.h index 1560dc0d..6adfb219 100644 --- a/bootstrap/windows-88/errors.h +++ b/bootstrap/windows-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index f6b467bb..5f5a39b3 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index ab7785db..57da5b24 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/vt100.c b/bootstrap/windows-88/vt100.c index 23b25f53..61383b15 100644 --- a/bootstrap/windows-88/vt100.c +++ b/bootstrap/windows-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/vt100.h b/bootstrap/windows-88/vt100.h index 95c8d77e..511c4d6b 100644 --- a/bootstrap/windows-88/vt100.h +++ b/bootstrap/windows-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/src/compiler/OPB.Mod b/src/compiler/OPB.Mod index a6b8cf67..5cdad662 100644 --- a/src/compiler/OPB.Mod +++ b/src/compiler/OPB.Mod @@ -678,6 +678,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) ELSE err(100) END |OPT.Set: IF (g = OPT.Set) & (y.typ.size < z.typ.size) THEN Convert(y, z.typ) + ELSIF (g = OPT.Set) THEN Convert(z, y.typ) ELSE err(100) END |OPT.Real: IF g = OPT.Int THEN Convert(y, z^.typ) diff --git a/src/compiler/OPV.Mod b/src/compiler/OPV.Mod index 0d29d56d..dd089baf 100644 --- a/src/compiler/OPV.Mod +++ b/src/compiler/OPV.Mod @@ -232,10 +232,16 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 END END Entier; - PROCEDURE SizeCast(from, to: LONGINT); + PROCEDURE SizeCast(n: OPT.Node; to: LONGINT); BEGIN - IF (from # to) & ((from > OPM.CIntSize) OR (to # OPM.CIntSize)) THEN - OPM.WriteString("(int"); OPM.WriteInt(to*8); OPM.WriteString(")") + IF (to < n.typ.size) & (OPM.ranchk IN OPM.Options) THEN + OPM.WriteString("__SHORT"); IF SideEffects(n) THEN OPM.Write("F") END; + OPM.Write(OpenParen); Entier(n, MinPrec); OPM.WriteString(Comma); + OPM.WriteInt(OPM.SignedMaximum(to) + 1); OPM.Write(CloseParen) + ELSE + IF (n.typ.size # to) & ((n.typ.size > OPM.CIntSize) OR (to # OPM.CIntSize)) THEN + OPM.WriteString("(int"); OPM.WriteInt(to*8); OPM.WriteString(")") + END END END SizeCast; @@ -243,16 +249,14 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 VAR from, to: INTEGER; BEGIN from := n^.typ^.form; to := newtype.form; IF to = OPT.Set THEN - OPM.WriteString("__SETOF("); Entier(n, MinPrec); - OPM.WriteString(","); OPM.WriteInt(newtype.size*8); OPM.Write(CloseParen) - ELSIF to = OPT.Int THEN - IF (newtype.size < n.typ.size) & (OPM.ranchk IN OPM.Options) THEN - OPM.WriteString("__SHORT"); IF SideEffects(n) THEN OPM.Write("F") END; - OPM.Write(OpenParen); Entier(n, MinPrec); OPM.WriteString(Comma); - OPM.WriteInt(OPM.SignedMaximum(newtype.size) + 1); OPM.Write(CloseParen) - ELSE - SizeCast(n.typ.size, newtype.size); Entier(n, 9) + IF from = OPT.Set THEN (* Sets of different size *) + SizeCast(n, newtype.size); Entier(n, 9) + ELSE (* Set from integer *) + OPM.WriteString("__SETOF("); Entier(n, MinPrec); + OPM.WriteString(","); OPM.WriteInt(newtype.size*8); OPM.Write(CloseParen) END + ELSIF to = OPT.Int THEN (* integers of different size *) + SizeCast(n, newtype.size); Entier(n, 9) ELSIF to = OPT.Char THEN IF OPM.ranchk IN OPM.Options THEN OPM.WriteString("__CHR"); IF SideEffects(n) THEN OPM.Write("F") END ; diff --git a/src/runtime/LowReal.Mod b/src/runtime/LowReal.Mod deleted file mode 100644 index e5a8f8a6..00000000 --- a/src/runtime/LowReal.Mod +++ /dev/null @@ -1,417 +0,0 @@ -(* $Id: LowReal.Mod,v 1.5 1999/09/02 13:17:38 acken Exp $ *) -MODULE LowReal; - -(* - LowReal - Gives access to the underlying properties of the type REAL - for IEEE single-precision numbers. - Copyright (C) 1995 Michael Griebling - - This module is free software; you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - This module is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -*) - - -IMPORT SYSTEM; - -(* - - Real number properties are defined as follows: - - radix--The whole number value of the radix used to represent the - corresponding read number values. - - places--The whole number value of the number of radix places used - to store values of the corresponding real number type. - - expoMin--The whole number value of the exponent minimum. - - expoMax--The whole number value of the exponent maximum. - - large--The largest value of the corresponding real number type. - - small--The smallest positive value of the corresponding real number - type, represented to maximal precision. - - IEC559--A Boolean value that is TRUE if and only if the implementation - of the corresponding real number type conforms to IEC 559:1989 - (IEEE 754:1987) in all regards. - - NOTES - 6 -- If `IEC559' is TRUE, the value of `radix' is 2. - 7 -- If LowReal.IEC559 is TRUE, the 32-bit format of IEC 559:1989 - is used for the type REAL. - 7 -- If LowLong.IEC559 is TRUE, the 64-bit format of IEC 559:1989 - is used for the type REAL. - - LIA1--A Boolean value that is TRUE if and only if the implementation of - the corresponding real number type conforms to ISO/IEC 10967-1:199x - (LIA-1) in all regards: parameters, arithmetic, exceptions, and - notification. - - rounds--A Boolean value that is TRUE if and only if each operation produces - a result that is one of the values of the corresponding real number - type nearest to the mathematical result. - - gUnderflow--A Boolean value that is TRUE if and only if there are values of - the corresponding real number type between 0.0 and `small'. - - exception--A Boolean value that is TRUE if and only if every operation that - attempts to produce a real value out of range raises an exception. - - extend--A Boolean value that is TRUE if and only if expressions of the - corresponding real number type are computed to higher precision than - the stored values. - - nModes--The whole number value giving the number of bit positions needed for - the status flags for mode control. - -*) -CONST - radix* = 2; - places* = 24; - expoMax* = 127; - expoMin* = 1-expoMax; - large* = MAX(REAL); (*3.40282347E+38;*) - (*small* = 1.17549435E-38; (* 2^(-126) *)*) - small* = 1/8.50705917E37; (* don't know better way; -- noch *) - IEC559* = TRUE; - LIA1* = FALSE; - rounds* = FALSE; - gUnderflow* = TRUE; (* there are IEEE numbers smaller than `small' *) - exception* = FALSE; (* at least in the default implementation *) - extend* = FALSE; - nModes* = 0; - - TEN = 10.0; (* some commonly-used constants *) - ONE = 1.0; - ZERO = 0.0; - - expOffset = expoMax; - (*hiBit = 22;*) - (*expBit = hiBit+1;*) - nMask = {0..22,31}; (* number mask *) - expMask = {23..30}; (* exponent mask *) - -TYPE - Modes* = SET; - -VAR - (*small* : REAL; tmp: REAL;*) (* this was a test to get small as a variable at runtime. obviously, compile time preferred; -- noch *) - ErrorHandler*: PROCEDURE (errno : INTEGER); - err-: INTEGER; - -(* Error handler default stub which can be replaced *) - -PROCEDURE DefaultHandler (errno : INTEGER); -BEGIN - err:=errno -END DefaultHandler; - -PROCEDURE ClearError*; -BEGIN - err:=0 -END ClearError; - - -PROCEDURE exponent*(x: REAL): INTEGER; -(* - The value of the call exponent(x) shall be the exponent value of `x' - that lies between `expoMin' and `expoMax'. An exception shall occur - and may be raised if `x' is equal to 0.0. - *) - VAR w: SYSTEM.INT16; -BEGIN - (* NOTE: x=0.0 should raise exception *) - IF x = ZERO THEN RETURN 0 END; - - RETURN SYSTEM.VAL(INTEGER, SYSTEM.LSH((SYSTEM.VAL(SYSTEM.SET32, x) * expMask), -23)); - - - SYSTEM.GET(SYSTEM.ADR(x)+2, w); (* Load most significant word *) - RETURN ((w DIV 128) MOD 256) - expOffset -END exponent; - -PROCEDURE SetExponent(VAR x: REAL; ex: SYSTEM.INT32); - VAR s: SYSTEM.SET32; -BEGIN - ex := SYSTEM.LSH(ex + expOffset, 23); - s := SYSTEM.VAL(SYSTEM.SET32, s) * nMask + SYSTEM.VAL(SYSTEM.SET32, ex) * expMask; - SYSTEM.PUT(SYSTEM.ADR(x), s) -END SetExponent; - -PROCEDURE exponent10*(x: REAL): INTEGER; -(* - The value of the call exponent10(x) shall be the base 10 exponent - value of `x'. An exception shall occur and may be raised if `x' is - equal to 0.0. - *) -VAR exp: INTEGER; -BEGIN - exp := 0; x := ABS(x); - IF x = ZERO THEN RETURN exp END; (* exception could be raised here *) - WHILE x >= TEN DO x := x/TEN; INC(exp) END; - WHILE (x > ZERO) & (x < 1.0) DO x := x*TEN; DEC(exp) END; - RETURN exp -END exponent10; - -(* TYPE REAL: 1/sign, 8/exponent, 23/significand *) - -PROCEDURE fraction*(x: REAL): REAL; -(* - The value of the call fraction(x) shall be the significand (or - significant) part of `x'. Hence the following relationship shall - hold: x = scale(fraction(x), exponent(x)). -*) -VAR c: CHAR; -BEGIN - IF x=ZERO THEN RETURN ZERO - ELSE - (* Set top 7 bits of exponent to 0111111 *) - SYSTEM.GET(SYSTEM.ADR(x)+3, c); - c := CHR(((ORD(c) DIV 128) * 128) + 63); (* Set X0111111 (X unchanged) *) - SYSTEM.PUT(SYSTEM.ADR(x)+3, c); - (* Set bottom bit of exponent to 0 *) - SYSTEM.GET(SYSTEM.ADR(x)+2, c); - c := CHR(ORD(c) MOD 128); (* Set 0XXXXXXX (X unchanged) *) - SYSTEM.PUT(SYSTEM.ADR(x)+2, c); - RETURN x * 2.0; - END -(* - CONST eZero={(hiBit+2)..29}; -BEGIN - IF x=ZERO THEN RETURN ZERO - ELSE RETURN SYSTEM.VAL(REAL,(SYSTEM.VAL(SET,x)*nMask)+eZero)*2.0 (* set the mantissa's exponent to zero *) - END -*) -END fraction; - -PROCEDURE IsInfinity * (real: REAL) : BOOLEAN; - VAR c0, c1, c2, c3: CHAR; -BEGIN - SYSTEM.GET(SYSTEM.ADR(real)+0, c3); - SYSTEM.GET(SYSTEM.ADR(real)+1, c2); - SYSTEM.GET(SYSTEM.ADR(real)+2, c1); - SYSTEM.GET(SYSTEM.ADR(real)+3, c0); - RETURN (ORD(c0) MOD 128 = 127) & (ORD(c1) = 128) & (ORD(c2) = 0) & (ORD(c3) = 0) -END IsInfinity; - -PROCEDURE IsNaN * (real: REAL) : BOOLEAN; - VAR c0, c1, c2, c3: CHAR; -BEGIN - SYSTEM.GET(SYSTEM.ADR(real)+0, c3); - SYSTEM.GET(SYSTEM.ADR(real)+1, c2); - SYSTEM.GET(SYSTEM.ADR(real)+2, c1); - SYSTEM.GET(SYSTEM.ADR(real)+3, c0); - RETURN (ORD(c0) MOD 128 = 127) - & (ORD(c1) DIV 128 = 1) - & ((ORD(c1) MOD 128 # 0) OR (ORD(c2) # 0) OR (ORD(c3) # 0)) -END IsNaN; - -PROCEDURE sign*(x: REAL): REAL; -(* - The value of the call sign(x) shall be 1.0 if `x' is greater than 0.0, - or shall be -1.0 if `x' is less than 0.0, or shall be either 1.0 or - -1.0 if `x' is equal to 0.0. -*) -BEGIN - IF x expoMax THEN RETURN large * sign(x) (* exception raised here *) - ELSIF exp < expoMin THEN RETURN small * sign(x) (* exception here as well *) - END; - SetExponent(x, SHORT(exp)); - (* SetExponent replaces these 2 lines: - lexp := SYSTEM.VAL(SET, SYSTEM.LSH(exp + expOffset, expBit)); (* shifted exponent bits *) - RETURN SYSTEM.VAL(REAL, (SYSTEM.VAL(SET, x) * nMask) + lexp) (* insert new exponent *) - *) -END scale; - -PROCEDURE ulp*(x: REAL): REAL; -(* - The value of the call ulp(x) shall be the value of the corresponding - real number type equal to a unit in the last place of `x', if such a - value exists; otherwise an exception shall occur and may be raised. -*) -BEGIN - RETURN scale(ONE, exponent(x)-places+1) -END ulp; - -PROCEDURE succ*(x: REAL): REAL; -(* - The value of the call succ(x) shall be the next value of the - corresponding real number type greater than `x', if such a type - exists; otherwise an exception shall occur and may be raised. -*) -BEGIN - RETURN x+ulp(x)*sign(x) -END succ; - -PROCEDURE pred*(x: REAL): REAL; -(* - The value of the call pred(x) shall be the next value of the - corresponding real number type less than `x', if such a type exists; - otherwise an exception shall occur and may be raised. -*) -BEGIN - RETURN x-ulp(x)*sign(x) -END pred; - -PROCEDURE intpart*(x: REAL): REAL; -(* - The value of the call intpart(x) shall be the integral part of `x'. - For negative values, this shall be -intpart(abs(x)). -*) - VAR loBit: INTEGER; -BEGIN - loBit := (hiBit+1) - exponent(x); - IF loBit <= 0 THEN RETURN x (* no fractional part *) - ELSIF loBit <= hiBit+1 THEN - RETURN SYSTEM.VAL(REAL,SYSTEM.VAL(SET,x)*{loBit..31}) (* integer part is extracted *) - ELSE RETURN ZERO (* no whole part *) - END -END intpart; - -PROCEDURE fractpart*(x: REAL): REAL; -(* - The value of the call fractpart(x) shall be the fractional part of - `x'. This satifies the relationship fractpart(x)+intpart(x)=x. -*) -BEGIN - RETURN x-intpart(x) -END fractpart; - -PROCEDURE trunc*(x: REAL; n: INTEGER): REAL; -(* - The value of the call trunc(x,n) shall be the value of the most - significant `n' places of `x'. An exception shall occur and may be - raised if `n' is less than or equal to zero. -*) - VAR loBit: INTEGER; mask: SET; -BEGIN loBit:=places-n; - IF n<=0 THEN RETURN ZERO (* exception should be raised *) - ELSIF loBit<=0 THEN RETURN x (* nothing was truncated *) - ELSE mask:={loBit..31}; (* truncation bit mask *) - RETURN SYSTEM.VAL(REAL,SYSTEM.VAL(SET,x)*mask) - END -END trunc; - -PROCEDURE round*(x: REAL; n: INTEGER): REAL; -(* - The value of the call round(x,n) shall be the value of `x' rounded to - the most significant `n' places. An exception shall occur and may be - raised if such a value does not exist, or if `n' is less than or equal - to zero. -*) - VAR loBit: INTEGER; num, mask: SET; r: REAL; -BEGIN loBit:=places-n; - IF n<=0 THEN RETURN ZERO (* exception should be raised *) - ELSIF loBit<=0 THEN RETURN x (* nothing was rounded *) - ELSE mask:={loBit..31}; num:=SYSTEM.VAL(SET,x); (* truncation bit mask and number as SET *) - x:=SYSTEM.VAL(REAL,num*mask); (* truncated result *) - IF loBit-1 IN num THEN (* check if result should be rounded *) - r:=scale(ONE,exponent(x)-n+1); (* rounding fraction *) - IF 31 IN num THEN RETURN x-r (* negative rounding toward -infinity *) - ELSE RETURN x+r (* positive rounding toward +infinity *) - END - ELSE RETURN x (* return truncated result *) - END - END -END round; - -PROCEDURE synthesize*(expart: INTEGER; frapart: REAL): REAL; -(* - The value of the call synthesize(expart,frapart) shall be a value of - the corresponding real number type contructed from the value of - `expart' and `frapart'. This value shall satisfy the relationship - synthesize(exponent(x),fraction(x)) = x. -*) -BEGIN - RETURN scale(frapart, expart) -END synthesize; - - -PROCEDURE setMode*(m: Modes); -(* - The call setMode(m) shall set status flags from the value of `m', - appropriate to the underlying implementation of the corresponding real - number type. - - NOTES - 3 -- Many implementations of floating point provide options for - setting flags within the system which control details of the handling - of the type. Although two procedures are provided, one for each real - number type, the effect may be the same. Typical effects that can be - obtained by this means are: - a) Ensuring that overflow will raise an exception; - b) Allowing underflow to raise an exception; - c) Controlling the rounding; - d) Allowing special values to be produced (e.g. NaNs in - implementations conforming to IEC 559:1989 (IEEE 754:1987)); - e) Ensuring that special valu access will raise an exception; - Since these effects are so varied, the values of type `Modes' that may - be used are not specified by this International Standard. - 4 -- The effects of `setMode' on operation on values of the - corresponding real number type in coroutines other than the calling - coroutine is not defined. Implementations are not require to preserve - the status flags (if any) with the coroutine state. -*) -BEGIN - (* hardware dependent mode setting of coprocessor *) -END setMode; - -PROCEDURE currentMode*(): Modes; -(* - The value of the call currentMode() shall be the current status flags - (in the form set by `setMode'), or the default status flags (if - `setMode' is not used). - - NOTE 5 -- The value of the call currentMode() is not necessarily the - value of set by `setMode', since a call of `setMode' might attempt to - set flags that cannot be set by the program. -*) -BEGIN - RETURN {} -END currentMode; - -PROCEDURE IsLowException*(): BOOLEAN; -(* - Returns TRUE if the current coroutine is in the exceptional execution state - because of the raising of the LowReal exception; otherwise returns FALSE. -*) -BEGIN - RETURN FALSE -END IsLowException; - -BEGIN - (* install the default error handler -- just sets err variable *) - ErrorHandler:=DefaultHandler; -(* tmp := power0(2,126); (* this is test to calculate small as a variable at runtime; -- noch *) - small := sml; - small := 1/power0(2,126); - *) -END LowReal. - - diff --git a/src/runtime/Math.Mod b/src/runtime/Math.Mod index 392534bd..3e8c492e 100644 --- a/src/runtime/Math.Mod +++ b/src/runtime/Math.Mod @@ -1,12 +1,12 @@ -(* $Id: RealMath.Mod,v 1.6 1999/09/02 13:19:17 acken Exp $ *) -MODULE oocRealMath; +MODULE Math; -(* MathL - Oakwood REAL Mathematics. - Adapted (with minimal changes) from OOC RealMath.Mod *) +IMPORT SYSTEM; -(* - RealMath - Target independent mathematical functions for REAL - (IEEE single-precision) numbers. +(* Math - Oakwood REAL Mathematics. + Adapted from OOC LowReal.Mod and RealMath.Mod + + Target independent mathematical functions for REAL + (IEEE single - precision) numbers. Numerical approximations are taken from "Software Manual for the Elementary Functions" by Cody & Waite and "Computer Approximations" @@ -26,82 +26,245 @@ MODULE oocRealMath; You should have received a copy of the GNU Lesser General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 - 1307 USA *) -IMPORT l := LowReal, S := SYSTEM; +(* + Real number properties are defined as follows: + + radix - -The whole number value of the radix used to represent the + corresponding read number values. + + places - -The whole number value of the number of radix places used + to store values of the corresponding real number type. + + expoMin - -The whole number value of the exponent minimum. + + expoMax - -The whole number value of the exponent maximum. + + large - -The largest value of the corresponding real number type. + + small - -The smallest positive value of the corresponding real number + type, represented to maximal precision. + + IEC559 - -A Boolean value that is TRUE if and only if the implementation + of the corresponding real number type conforms to IEC 559:1989 + (IEEE 754:1987) in all regards. + + NOTES + 6 -- If `IEC559' is TRUE, the value of `radix' is 2. + 7 -- If LowReal.IEC559 is TRUE, the 32 - bit format of IEC 559:1989 + is used for the type REAL. + 7 -- If LowLong.IEC559 is TRUE, the 64 - bit format of IEC 559:1989 + is used for the type REAL. + + LIA1 - -A Boolean value that is TRUE if and only if the implementation of + the corresponding real number type conforms to ISO/IEC 10967 - 1:199x + (LIA - 1) in all regards: parameters, arithmetic, exceptions, and + notification. + + rounds - -A Boolean value that is TRUE if and only if each operation produces + a result that is one of the values of the corresponding real number + type nearest to the mathematical result. + + gUnderflow - -A Boolean value that is TRUE if and only if there are values of + the corresponding real number type between 0.0 and `small'. + + exception - -A Boolean value that is TRUE if and only if every operation that + attempts to produce a real value out of range raises an exception. + + extend - -A Boolean value that is TRUE if and only if expressions of the + corresponding real number type are computed to higher precision than + the stored values. + + nModes - -The whole number value giving the number of bit positions needed for + the status flags for mode control. + *) CONST pi* = 3.1415926535897932384626433832795028841972; e* = 2.7182818284590452353602874713526624977572; - ZERO=0.0; ONE=1.0; HALF=0.5; TWO=2.0; (* local constants *) + places* = 24; + large* = MAX(REAL); (* 3.40282347E+38. Largest number this package accepts *) +(*small* = 1.17549435E-38; *) (* 2^(-126) *) + small* = 1/8.50705917E37; (* don't know better way; -- noch *) + expoMax* = 127; + expoMin* = 1-expoMax; - (* internally-used constants *) - huge = l.large; (* largest number this package accepts *) - miny = ONE/huge; (* smallest number this package accepts *) - sqrtHalf = 0.70710678118654752440; - Limit = 2.4414062E-4; (* 2**(-MantBits/2) *) - eps = 2.9802322E-8; (* 2**(-MantBits-1) *) - piInv = 0.31830988618379067154; (* 1/pi *) - piByTwo = 1.57079632679489661923132; - piByFour = 0.78539816339744830962; - lnv = 0.6931610107421875; (* should be exact *) - vbytwo = 0.13830277879601902638E-4; (* used in sinh/cosh *) - ln2Inv = 1.44269504088896340735992468100189213; + expOffset = expoMax; + nMask = {0..22,31}; (* number mask: Sign and mantissa *) + expMask = {23..30}; (* exponent mask: exponent value + 127 *) + + ZERO = 0.0; + HALF = 0.5; + ONE = 1.0; + TWO = 2.0; + TEN = 10.0; + miny = ONE/large; (* Smallest number thispackage accepts *) + sqrtHalf = 0.70710678118654752440; + Limit = 2.4414062E-4; (* 2 * *( - MantBits/2) *) + eps = 2.9802322E-8; (* 2 * *( - MantBits - 1) *) + piInv = 0.31830988618379067154; (* 1/pi *) + piByTwo = 1.57079632679489661923132; + piByFour = 0.78539816339744830962; + lnv = 0.6931610107421875; (* should be exact *) + vbytwo = 0.13830277879601902638E-4; (* used in sinh/cosh *) + ln2Inv = 1.44269504088896340735992468100189213; (* error/exception codes *) - NoError*=0; IllegalRoot*=1; IllegalLog*=2; Overflow*=3; IllegalPower*=4; IllegalLogBase*=5; - IllegalTrig*=6; IllegalInvTrig*=7; HypInvTrigClipped*=8; IllegalHypInvTrig*=9; - LossOfAccuracy*=10; Underflow*=11; + NoError* = 0; IllegalRoot* = 1; IllegalLog* = 2; Overflow* = 3; + IllegalPower* = 4; IllegalLogBase* = 5; IllegalTrig* = 6; IllegalInvTrig* = 7; + HypInvTrigClipped* = 8; IllegalHypInvTrig* = 9; LossOfAccuracy* = 10; Underflow* = 11; VAR + ErrorHandler*: PROCEDURE (errno : INTEGER); + err-: INTEGER; + a1: ARRAY 18 OF REAL; (* lookup table for power function *) a2: ARRAY 9 OF REAL; (* lookup table for power function *) - em: REAL; (* largest number such that 1+epsilon > 1.0 *) + em: REAL; (* largest number such that 1 + epsilon > 1.0 *) LnInfinity: REAL; (* natural log of infinity *) LnSmall: REAL; (* natural log of very small number *) SqrtInfinity: REAL; (* square root of infinity *) TanhMax: REAL; (* maximum Tanh value *) t: REAL; (* internal variables *) -(* internally used support routines *) + +PROCEDURE DefaultErrorHandler(errno : INTEGER); +BEGIN err:=errno END DefaultErrorHandler; + +PROCEDURE ClearError*; +BEGIN err:=0 END ClearError; + + +(* TYPE REAL: 1/sign, 8/exponent, 23/significand *) + +PROCEDURE fraction*(x: REAL): REAL; +(* + The value of the call fraction(x) shall be the significand (or + significant) part of `x'. Hence the following relationship shall + hold: x = scale(fraction(x), exponent(x)). +*) + VAR s: SET; +BEGIN + IF x = ZERO THEN RETURN ZERO + ELSE + s := SYSTEM.VAL(SYSTEM.SET32, x) * nMask + {24..29}; + RETURN SYSTEM.VAL(REAL, s) * 2.0; + END +END fraction; + +PROCEDURE exponent*(x: REAL): INTEGER; +(* + The value of the call exponent(x) shall be the exponent value of `x' + that lies between `expoMin' and `expoMax'. An exception shall occur + and may be raised if `x' is equal to 0.0. + *) +BEGIN + IF x = ZERO THEN RETURN 0 (* NOTE: x=0.0 should raise exception *) + ELSE + RETURN SHORT(SYSTEM.LSH(SYSTEM.VAL(SYSTEM.INT32, x), -23) MOD 256) - 127 + END +END exponent; + +PROCEDURE sign*(x: REAL): REAL; +(* + The value of the call sign(x) shall be 1.0 if `x' is greater than 0.0, + or shall be -1.0 if `x' is less than 0.0, or shall be either 1.0 or + -1.0 if `x' is equal to 0.0. +*) +BEGIN + IF x < ZERO THEN RETURN -ONE ELSE RETURN ONE END +END sign; + +PROCEDURE scale*(x: REAL; n: INTEGER): REAL; +(* + The value of the call scale(x,n) shall be the value x*radix^n if such + a value exists; otherwise an execption shall occur and may be raised. +*) + VAR exp: LONGINT; lexp: SET; +BEGIN + IF x = ZERO THEN RETURN ZERO END; + exp := exponent(x) + n; (* new exponent *) + IF exp > expoMax THEN RETURN large * sign(x) (* exception raised here *) + ELSIF exp < expoMin THEN RETURN small * sign(x) (* exception here as well *) + END; + lexp := SYSTEM.VAL(SYSTEM.SET32, x) * nMask (* sign and significand *) + + SYSTEM.VAL(SYSTEM.SET32, SYSTEM.LSH(exp+expOffset, 23)); (* shifted exponent bits *) + RETURN SYSTEM.VAL(REAL, lexp) +END scale; + +PROCEDURE ulp*(x: REAL): REAL; +(* + The value of the call ulp(x) shall be the value of the corresponding + real number type equal to a unit in the last place of `x', if such a + value exists; otherwise an exception shall occur and may be raised. +*) +BEGIN + RETURN scale(ONE, exponent(x)-places+1) +END ulp; + +PROCEDURE succ*(x: REAL): REAL; +(* + The value of the call succ(x) shall be the next value of the + corresponding real number type greater than `x', if such a type + exists; otherwise an exception shall occur and may be raised. +*) +BEGIN + RETURN x+ulp(x)*sign(x) +END succ; + +PROCEDURE pred*(x: REAL): REAL; +(* + The value of the call pred(x) shall be the next value of the + corresponding real number type less than `x', if such a type exists; + otherwise an exception shall occur and may be raised. +*) +BEGIN + RETURN x-ulp(x)*sign(x) +END pred; + PROCEDURE SinCos (x, y, sign: REAL): REAL; CONST - ymax=9099; (* ENTIER(pi*2**(MantBits/2)) *) - r1=-0.1666665668E+0; - r2= 0.8333025139E-2; - r3=-0.1980741872E-3; - r4= 0.2601903036E-5; + ymax = 9099; (* ENTIER(pi * 2* * (MantBits/2)) *) + r1 = -0.1666665668E+0; + r2 = 0.8333025139E-2; + r3 = -0.1980741872E-3; + r4 = 0.2601903036E-5; VAR n: LONGINT; xn, f, g: REAL; BEGIN - IF y>=ymax THEN l.ErrorHandler(LossOfAccuracy); RETURN ZERO END; + IF y >= ymax THEN ErrorHandler(LossOfAccuracy); RETURN ZERO END; (* determine the reduced number *) - n:=ENTIER(y*piInv+HALF); xn:=n; - IF ODD(n) THEN sign:=-sign END; - x:=ABS(x); - IF x#y THEN xn:=xn-HALF END; + n := ENTIER(y * piInv + HALF); xn := n; + IF ODD(n) THEN sign := -sign END; + x := ABS(x); + IF x # y THEN xn := xn - HALF END; (* fractional part of reduced number *) - f:=SHORT(ABS(LONG(x)) - LONG(xn)*pi); + f := SHORT(ABS(LONG(x)) - LONG(xn) * pi); (* Pre: |f| <= pi/2 *) - IF ABS(f)= 0 *) CONST - P0=0.41731; P1=0.59016; + P0 = 0.41731; P1 = 0.59016; VAR xMant, yEst, z: REAL; xExp: INTEGER; BEGIN (* optimize zeros and check for illegal negative roots *) - IF x=ZERO THEN RETURN ZERO END; - IF x=LnInfinity THEN l.ErrorHandler(Overflow); RETURN huge - ELSIF x= LnInfinity THEN ErrorHandler(Overflow); RETURN large + ELSIF x < LnSmall THEN ErrorHandler(Underflow); RETURN ZERO + ELSIF ABS(x) < eps THEN RETURN ONE END; (* Decompose and scale the number *) - n:=round(ln2Inv*x); - xn:=n; g:=SHORT(LONG(x)-LONG(xn)*ln2); + n := round(ln2Inv * x); + xn := n; g := SHORT(LONG(x) - LONG(xn) * ln2); (* Calculate exp(g)/2 from "Software Manual for the Elementary Functions" *) - z:=g*g; p:=(P1*z+P0)*g; q:=Q1*z+HALF; - RETURN l.scale(HALF+p/(q-p), SHORT(n+1)) + z := g * g; p := (P1 * z + P0) * g; q := Q1 * z + HALF; + RETURN scale(HALF + p/(q - p), SHORT(n + 1)) END exp; -PROCEDURE ln*(x: REAL): REAL; +PROCEDURE ln * (x: REAL): REAL; (* Returns the natural logarithm of x for x > 0 *) CONST - c1=355.0/512.0; c2=-2.121944400546905827679E-4; - A0=-0.5527074855E+0; B0=-0.6632718214E+1; + c1 = 355.0/512.0; c2 = -2.121944400546905827679E-4; + A0 = -0.5527074855E+0; B0 = -0.6632718214E+1; VAR f, zn, zd, r, z, w, xn: REAL; n: INTEGER; BEGIN (* ensure illegal inputs are trapped and handled *) - IF x<=ZERO THEN l.ErrorHandler(IllegalLog); RETURN -huge END; + IF x <= ZERO THEN ErrorHandler(IllegalLog); RETURN -large END; (* reduce the range of the input *) - f:=l.fraction(x)*HALF; n:=l.exponent(x)+1; - IF f>sqrtHalf THEN zn:=(f-HALF)-HALF; zd:=f*HALF+HALF - ELSE zn:=f-HALF; zd:=zn*HALF+HALF; DEC(n) + f := fraction(x) * HALF; n := exponent(x) + 1; + IF f > sqrtHalf THEN zn := (f - HALF) - HALF; zd := f * HALF + HALF + ELSE zn := f - HALF; zd := zn * HALF + HALF; DEC(n) END; (* evaluate rational approximation from "Software Manual for the Elementary Functions" *) - z:=zn/zd; w:=z*z; r:=z+z*(w*A0/(w+B0)); + z := zn/zd; w := z * z; r := z + z * (w * A0/(w + B0)); (* scale the output *) - xn:=n; - RETURN (xn*c2+r)+xn*c1 + xn := n; + RETURN (xn * c2 + r) + xn * c1 END ln; (* The angle in all trigonometric functions is measured in radians *) -PROCEDURE sin*(x: REAL): REAL; +PROCEDURE sin * (x: REAL): REAL; (* Returns the sine of x for all x *) BEGIN - IF xymax THEN l.ErrorHandler(LossOfAccuracy); RETURN ZERO END; + y := ABS(x); + IF y > ymax THEN ErrorHandler(LossOfAccuracy); RETURN ZERO END; (* determine n and the fraction f *) - n:=round(x*twoByPi); xn:=n; - f:=SHORT(LONG(x)-LONG(xn)*piByTwo); + n := round(x * twoByPi); xn := n; + f := SHORT(LONG(x) - LONG(xn) * piByTwo); (* check for underflow *) - IF ABS(f)HALF THEN - i:=1-flag; - IF y>ONE THEN l.ErrorHandler(IllegalInvTrig); res:=huge; RETURN END; + y := ABS(x); + IF y > HALF THEN + i := 1 - flag; + IF y > ONE THEN ErrorHandler(IllegalInvTrig); res := large; RETURN END; (* reduce the input argument *) - g:=(ONE-y)*HALF; r:=-sqrt(g); y:=r+r; + g := (ONE-y) * HALF; r := -sqrt(g); y := r + r; (* compute approximation *) - r:=((P2*g+P1)*g)/((g+Q1)*g+Q0); - res:=y+(y*r) + r := ((P2 * g + P1) * g)/((g + Q1) * g + Q0); + res := y + (y * r) ELSE - i:=flag; - IF yONE THEN f:=ONE/f; n:=2 - ELSE n:=0 + IF f > ONE THEN f := ONE/f; n := 2 + ELSE n := 0 END; (* check if f should be scaled *) - IF f>rt32 THEN f:=(((a*f-HALF)-HALF)+f)/(rt3+f); INC(n) END; + IF f > rt32 THEN f := (((a * f - HALF) - HALF) + f)/(rt3 + f); INC(n) END; (* check for underflow *) - IF ABS(f)1 THEN res:=-res END; + IF n > 1 THEN res := -res END; CASE n OF - | 1: res:=res+piBySix - | 2: res:=res+piByTwo - | 3: res:=res+piByThree + | 1: res := res + piBySix + | 2: res := res + piByTwo + | 3: res := res + piByThree | ELSE (* do nothing *) END; RETURN res END atan; -PROCEDURE arctan*(x: REAL): REAL; - (* Returns the arctangent of x, in the range [-pi/2, pi/2] for all x *) +PROCEDURE arctan * (x: REAL): REAL; + (* Returns the arctangent of x, in the range [ - pi/2, pi/2] for all x *) BEGIN - IF x<0 THEN RETURN -atan(-x) + IF x < 0 THEN RETURN -atan( - x) ELSE RETURN atan(x) END END arctan; -PROCEDURE power*(base, exponent: REAL): REAL; +PROCEDURE power * (base, exp: REAL): REAL; (* Returns the value of the number base raised to the power exponent for base > 0 *) - CONST P1=0.83357541E-1; K=0.4426950409; - Q1=0.69314675; Q2=0.24018510; Q3=0.54360383E-1; - OneOver16=0.0625; XMAX=16*(l.expoMax+1)-1; (*XMIN=16*l.expoMin;*) XMIN=-2016; (* to make it easier for voc; -- noch *) + CONST P1 = 0.83357541E-1; K = 0.4426950409; + Q1 = 0.69314675; Q2 = 0.24018510; Q3 = 0.54360383E-1; + OneOver16 = 0.0625; + XMAX = 16 * (expoMax + 1) - 1; + (* XMIN = 16 * expoMin; *) XMIN = -2016; (* to make it easier for voc; -- noch *) VAR z, g, R, v, u2, u1, w1, w2: REAL; w: LONGREAL; m, p, i: INTEGER; mp, pp, iw1: LONGINT; BEGIN (* handle all possible error conditions *) - IF base<=ZERO THEN - IF base#ZERO THEN l.ErrorHandler(IllegalPower); base:=-base - ELSIF exponent>ZERO THEN RETURN ZERO - ELSE l.ErrorHandler(IllegalPower); RETURN huge + IF base <= ZERO THEN + IF base # ZERO THEN ErrorHandler(IllegalPower); base := -base + ELSIF exp > ZERO THEN RETURN ZERO + ELSE ErrorHandler(IllegalPower); RETURN large END END; (* extract the exponent of base to m and clear exponent of base in g *) - g:=l.fraction(base)*HALF; m:=l.exponent(base)+1; + g := fraction(base) * HALF; + m := exponent(base) + 1; (* determine p table offset with an unrolled binary search *) - p:=1; - IF g<=a1[9] THEN p:=9 END; - IF g<=a1[p+4] THEN INC(p, 4) END; - IF g<=a1[p+2] THEN INC(p, 2) END; + p := 1; + IF g <= a1[9] THEN p := 9 END; + IF g <= a1[p + 4] THEN INC(p, 4) END; + IF g <= a1[p + 2] THEN INC(p, 2) END; (* compute scaled z so that |z| <= 0.044 *) - z:=((g-a1[p+1])-a2[(p+1) DIV 2])/(g+a1[p+1]); z:=z+z; + z := ((g - a1[p + 1]) - a2[(p + 1) DIV 2])/(g + a1[p + 1]); z := z + z; (* approximation for log2(z) from "Software Manual for the Elementary Functions" *) - v:=z*z; R:=P1*v*z; R:=R+K*R; u2:=(R+z*K)+z; - u1:=(m*16-p)*OneOver16; w:=LONG(exponent)*(LONG(u1)+LONG(u2)); (* need extra precision *) + v := z * z; R := P1 * v*z; R := R + K * R; u2 := (R + z * K) + z; + u1 := (m * 16 - p) * OneOver16; w := LONG(exp) * (LONG(u1) + LONG(u2)); (* need extra precision *) (* calculations below were modified to work properly -- incorrect in cited reference? *) - iw1:=ENTIER(16*w); w1:=iw1*OneOver16; w2:=SHORT(w-w1); + iw1 := ENTIER(16 * w); w1 := iw1 * OneOver16; w2 := SHORT(w - w1); (* check for overflow/underflow *) - IF iw1>XMAX THEN l.ErrorHandler(Overflow); RETURN huge - ELSIF iw1 XMAX THEN ErrorHandler(Overflow); RETURN large + ELSIF iw1 < XMIN THEN ErrorHandler(Underflow); RETURN ZERO END; - (* final approximation 2**w2-1 where -0.0625 <= w2 <= 0 *) - IF w2>ZERO THEN INC(iw1); w2:=w2-OneOver16 END; IF iw1<0 THEN i:=0 ELSE i:=1 END; - mp:=div(iw1, 16)+i; pp:=16*mp-iw1; z:=((Q3*w2+Q2)*w2+Q1)*w2; z:=a1[pp+1]+a1[pp+1]*z; - RETURN l.scale(z, SHORT(mp)) + (* final approximation 2 * *w2 - 1 where -0.0625 <= w2 <= 0 *) + IF w2 > ZERO THEN INC(iw1); w2 := w2 - OneOver16 END; + IF iw1 < 0 THEN i := 0 ELSE i := 1 END; + mp := div(iw1, 16) + i; pp := 16 * mp - iw1; + z := ((Q3 * w2 + Q2) * w2 + Q1) * w2; + z := a1[pp + 1] + a1[pp + 1] * z; + RETURN scale(z, SHORT(mp)) END power; -PROCEDURE IsRMathException*(): BOOLEAN; +PROCEDURE IsRMathException * (): BOOLEAN; (* Returns TRUE if the current coroutine is in the exceptional execution state because of the raising of the RealMath exception; otherwise returns FALSE. *) @@ -403,14 +572,14 @@ END IsRMathException; Following routines are provided as extensions to the ISO standard. They are either used as the basis of other functions or provide useful functions which are not part of the ISO standard. -*) + *) PROCEDURE log* (x, base: REAL): REAL; (* log(x,base) is the logarithm of x base 'base'. All positive arguments are allowed but base > 0 and base # 1 *) BEGIN (* log(x, base) = ln(x) / ln(base) *) - IF base<=ZERO THEN l.ErrorHandler(IllegalLogBase); RETURN -huge + IF base <= ZERO THEN ErrorHandler(IllegalLogBase); RETURN -large ELSE RETURN ln(x)/ln(base) END END log; @@ -421,29 +590,29 @@ PROCEDURE ipower* (x: REAL; base: INTEGER): REAL; PROCEDURE Adjust(xadj: REAL): REAL; BEGIN - IF (x0 THEN RETURN ZERO ELSE l.ErrorHandler(Overflow); RETURN Adjust(huge) END + IF base = 0 THEN RETURN ONE (* x * *0 = 1 *) + ELSIF ABS(x) < miny THEN + IF base > 0 THEN RETURN ZERO ELSE ErrorHandler(Overflow); RETURN Adjust(large) END END; (* trap potential overflows and underflows *) - Exp:=(l.exponent(x)+1)*base; y:=LnInfinity*ln2Inv; - IF Exp>y THEN l.ErrorHandler(Overflow); RETURN Adjust(huge) - ELSIF Exp<-y THEN RETURN ZERO + Exp := (exponent(x) + 1) * base; y := LnInfinity * ln2Inv; + IF Exp > y THEN ErrorHandler(Overflow); RETURN Adjust(large) + ELSIF Exp< - y THEN RETURN ZERO END; - (* compute x**base using an optimised algorithm from Knuth, slightly + (* compute x * *base using an optimised algorithm from Knuth, slightly altered : p442, The Art Of Computer Programming, Vol 2 *) - y:=ONE; IF base<0 THEN neg:=TRUE; base := -base ELSE neg:= FALSE END; + y := ONE; IF base < 0 THEN neg := TRUE; base := -base ELSE neg:= FALSE END; LOOP - IF ODD(base) THEN y:=y*x END; - base:=base DIV 2; IF base=0 THEN EXIT END; - x:=x*x; + IF ODD(base) THEN y := y * x END; + base := base DIV 2; IF base = 0 THEN EXIT END; + x := x * x; END; IF neg THEN RETURN ONE/y ELSE RETURN y END END ipower; @@ -451,34 +620,34 @@ END ipower; PROCEDURE sincos* (x: REAL; VAR Sin, Cos: REAL); (* More efficient sin/cos implementation if both values are needed. *) BEGIN - Sin:=sin(x); Cos:=sqrt(ONE-Sin*Sin) + Sin := sin(x); Cos := sqrt(ONE-Sin * Sin) END sincos; PROCEDURE arctan2* (xn, xd: REAL): REAL; -(* arctan2(xn,xd) is the quadrant-correct arc tangent atan(xn/xd). If the +(* arctan2(xn,xd) is the quadrant - correct arc tangent atan(xn/xd). If the denominator xd is zero, then the numerator xn must not be zero. All arguments are legal except xn = xd = 0. *) VAR res: REAL; xpdiff: LONGINT; BEGIN (* check for error conditions *) - IF xd=ZERO THEN - IF xn=ZERO THEN l.ErrorHandler(IllegalTrig); RETURN ZERO - ELSIF xn<0 THEN RETURN -piByTwo + IF xd = ZERO THEN + IF xn = ZERO THEN ErrorHandler(IllegalTrig); RETURN ZERO + ELSIF xn < 0 THEN RETURN -piByTwo ELSE RETURN piByTwo END; ELSE - xpdiff:=l.exponent(xn)-l.exponent(xd); - IF ABS(xpdiff)>=l.expoMax-3 THEN + xpdiff := exponent(xn) - exponent(xd); + IF ABS(xpdiff) >= expoMax - 3 THEN (* overflow detected *) - IF xn<0 THEN RETURN -piByTwo + IF xn < 0 THEN RETURN -piByTwo ELSE RETURN piByTwo END ELSE - res:=ABS(xn/xd); - IF res#ZERO THEN res:=atan(res) END; - IF xdLnInfinity THEN (* handle exp overflows *) - y:=y-lnv; - IF y>LnInfinity-lnv+0.69 THEN l.ErrorHandler(Overflow); - IF x>ZERO THEN RETURN huge ELSE RETURN -huge END - ELSE f:=exp(y); f:=f+f*vbytwo (* don't change to f(1+vbytwo) *) + f := y * y; y := f * ((f * P1 + P0)/(f + Q0)); RETURN x + x * y + ELSIF y > LnInfinity THEN (* handle exp overflows *) + y := y - lnv; + IF y > LnInfinity - lnv + 0.69 THEN ErrorHandler(Overflow); + IF x > ZERO THEN RETURN large ELSE RETURN -large END + ELSE f := exp(y); f := f + f * vbytwo (* don't change to f(1 + vbytwo) *) END - ELSE f:=exp(y); f:=(f-ONE/f)*HALF + ELSE f := exp(y); f := (f - ONE/f) * HALF END; - (* reach here when 1 < ABS(x) < LnInfinity-lnv+0.69 *) - IF x>ZERO THEN RETURN f ELSE RETURN -f END + (* reach here when 1 < ABS(x) < LnInfinity - lnv + 0.69 *) + IF x > ZERO THEN RETURN f ELSE RETURN -f END END sinh; PROCEDURE cosh* (x: REAL): REAL; (* cosh(x) is the hyperbolic cosine of x. The argument x must not be so large that exp(|x|) overflows. *) VAR y, f: REAL; -BEGIN y:=ABS(x); - IF y>LnInfinity THEN (* handle exp overflows *) - y:=y-lnv; - IF y>LnInfinity-lnv+0.69 THEN l.ErrorHandler(Overflow); - IF x>ZERO THEN RETURN huge ELSE RETURN -huge END - ELSE f:=exp(y); RETURN f+f*vbytwo (* don't change to f(1+vbytwo) *) +BEGIN y := ABS(x); + IF y > LnInfinity THEN (* handle exp overflows *) + y := y - lnv; + IF y > LnInfinity - lnv + 0.69 THEN ErrorHandler(Overflow); + IF x > ZERO THEN RETURN large ELSE RETURN -large END + ELSE f := exp(y); RETURN f + f * vbytwo (* don't change to f(1 + vbytwo) *) END - ELSE f:=exp(y); RETURN (f+ONE/f)*HALF + ELSE f := exp(y); RETURN (f + ONE/f) * HALF END END cosh; PROCEDURE tanh* (x: REAL): REAL; (* tanh(x) is the hyperbolic tangent of x. All arguments are legal. *) - CONST P0=-0.8237728127; P1=-0.3831010665E-2; Q0=2.471319654; ln3over2=0.5493061443; - BIG=9.010913347; (* (ln(2)+(t+1)*ln(B))/2 where t=mantissa bits, B=base *) + CONST P0 = -0.8237728127; P1 = -0.3831010665E-2; Q0 = 2.471319654; ln3over2 = 0.5493061443; + BIG = 9.010913347; (* (ln(2) + (t + 1) * ln(B))/2 where t = mantissa bits, B = base *) VAR f, t: REAL; -BEGIN f:=ABS(x); - IF f>BIG THEN t:=ONE - ELSIF f>ln3over2 THEN t:=ONE-TWO/(exp(TWO*f)+ONE) - ELSIF f BIG THEN t := ONE + ELSIF f > ln3over2 THEN t := ONE - TWO/(exp(TWO * f) + ONE) + ELSIF f < Limit THEN t := f ELSE (* approximation from "Software Manual for the Elementary Functions" *) - t:=f*f; t:=t*(P1*t+P0)/(t+Q0); t:=f+f*t + t := f * f; t := t * (P1 * t + P0)/(t + Q0); t := f + f * t END; - IF xSqrtInfinity*HALF THEN l.ErrorHandler(HypInvTrigClipped); - IF x>ZERO THEN RETURN ln(SqrtInfinity) ELSE RETURN -ln(SqrtInfinity) END; - ELSIF x SqrtInfinity * HALF THEN ErrorHandler(HypInvTrigClipped); + IF x > ZERO THEN RETURN ln(SqrtInfinity) ELSE RETURN -ln(SqrtInfinity) END; + ELSIF x < ZERO THEN RETURN -ln( - x + sqrt(x * x + ONE)) + ELSE RETURN ln(x + sqrt(x * x + ONE)) END END arcsinh; @@ -553,9 +722,9 @@ PROCEDURE arccosh* (x: REAL): REAL; (* arccosh(x) is the arc hyperbolic cosine of x. All arguments greater than or equal to 1 are legal. *) BEGIN - IF xSqrtInfinity*HALF THEN l.ErrorHandler(HypInvTrigClipped); RETURN ln(SqrtInfinity) - ELSE RETURN ln(x+sqrt(x*x-ONE)) + IF x < ONE THEN ErrorHandler(IllegalHypInvTrig); RETURN ZERO + ELSIF x > SqrtInfinity * HALF THEN ErrorHandler(HypInvTrigClipped); RETURN ln(SqrtInfinity) + ELSE RETURN ln(x + sqrt(x * x - ONE)) END END arccosh; @@ -563,14 +732,14 @@ PROCEDURE arctanh* (x: REAL): REAL; (* arctanh(x) is the arc hyperbolic tangent of x. |x| < 1 - sqrt(em), where em is machine epsilon. Note that |x| must not be so close to 1 that the result is less accurate than half precision. *) - CONST TanhLimit=0.999984991; (* Tanh(5.9) *) + CONST TanhLimit = 0.999984991; (* Tanh(5.9) *) VAR t: REAL; -BEGIN t:=ABS(x); - IF (t>=ONE) OR (t>(ONE-TWO*em)) THEN l.ErrorHandler(IllegalHypInvTrig); - IF xTanhLimit THEN l.ErrorHandler(LossOfAccuracy) +BEGIN t := ABS(x); + IF (t >= ONE) OR (t > (ONE - TWO * em)) THEN ErrorHandler(IllegalHypInvTrig); + IF x < ZERO THEN RETURN -TanhMax ELSE RETURN TanhMax END + ELSIF t > TanhLimit THEN ErrorHandler(LossOfAccuracy) END; - RETURN arcsinh(x/sqrt(ONE-x*x)) + RETURN arcsinh(x/sqrt(ONE - x * x)) END arctanh; PROCEDURE ToREAL(h: HUGEINT): REAL; @@ -578,14 +747,17 @@ BEGIN RETURN SYSTEM.VAL(REAL, h) END ToREAL; BEGIN - (* determine some fundamental constants used by hyperbolic trig functions *) - em:=l.ulp(ONE); - LnInfinity:=ln(huge); - LnSmall:=ln(miny); - SqrtInfinity:=sqrt(huge); - t:=l.pred(ONE)/sqrt(em); TanhMax:=ln(t+sqrt(t*t+ONE)); + ErrorHandler := DefaultErrorHandler; - (* initialize some tables for the power() function a1[i]=2**((1-i)/16) *) + (* determine fundamental constants used by hyperbolic trig functions *) + em := ulp(ONE); + LnInfinity := ln(large); + LnSmall := ln(miny); + SqrtInfinity := sqrt(large); + t := pred(ONE)/sqrt(em); + TanhMax := ln(t + sqrt(t * t + ONE)); + + (* initialize tables for the power() function a1[i] = 2 * *((1 - i)/16) *) a1[1] := ONE; a1[2] := ToREAL(3F75257DH); a1[3] := ToREAL(3F6AC0C7H); @@ -604,7 +776,7 @@ BEGIN a1[16] := ToREAL(3F05AAC3H); a1[17] := HALF; - (* a2[i]=2**[(1-2i)/16] - a1[2i]; delta resolution *) + (* a2[i] = 2 * *[(1 - 2i)/16] - a1[2i]; delta resolution *) a2[1] := ToREAL(31A92436H); a2[2] := ToREAL(336C2A95H); a2[3] := ToREAL(31A8FC24H); @@ -613,4 +785,4 @@ BEGIN a2[6] := ToREAL(32C12342H); a2[7] := ToREAL(32E75624H); a2[8] := ToREAL(32CF9890H) -END oocRealMath. +END Math. diff --git a/src/tools/make/oberon.mk b/src/tools/make/oberon.mk index d4abd1e3..6ad77214 100644 --- a/src/tools/make/oberon.mk +++ b/src/tools/make/oberon.mk @@ -199,11 +199,9 @@ runtime: cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Modules.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Strings.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Files.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Reals.Mod -# cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/LowReal.Mod -# cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Math.Mod -# cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/LowLReal.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Math.Mod # cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/MathL.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Reals.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Texts.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Oberon.Mod @printf "\nMaking lib$(ONAME)$(MODEL)\n" From b71526ff5c3ad588faed5e677037df5d905ec50d Mon Sep 17 00:00:00 2001 From: David Brown Date: Tue, 4 Oct 2016 12:04:43 +0100 Subject: [PATCH 271/580] Add Mathl.Mod. Math and Mathl now compiling, but little tested. --- bootstrap/unix-44/Compiler.c | 2 +- bootstrap/unix-44/Configuration.c | 4 +- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Files.c | 2 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 2 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 2 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 2 +- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 2 +- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 2 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Out.c | 2 +- bootstrap/unix-44/Out.h | 2 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/errors.c | 2 +- bootstrap/unix-44/errors.h | 2 +- bootstrap/unix-44/extTools.c | 2 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-44/vt100.c | 2 +- bootstrap/unix-44/vt100.h | 2 +- bootstrap/unix-48/Compiler.c | 2 +- bootstrap/unix-48/Configuration.c | 4 +- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Files.c | 2 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 2 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 2 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 2 +- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 2 +- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 2 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Out.c | 2 +- bootstrap/unix-48/Out.h | 2 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/errors.c | 2 +- bootstrap/unix-48/errors.h | 2 +- bootstrap/unix-48/extTools.c | 2 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-48/vt100.c | 2 +- bootstrap/unix-48/vt100.h | 2 +- bootstrap/unix-88/Compiler.c | 2 +- bootstrap/unix-88/Configuration.c | 4 +- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Files.c | 2 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 2 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 2 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 2 +- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 2 +- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 2 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Out.c | 2 +- bootstrap/unix-88/Out.h | 2 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/errors.c | 2 +- bootstrap/unix-88/errors.h | 2 +- bootstrap/unix-88/extTools.c | 2 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/unix-88/vt100.c | 2 +- bootstrap/unix-88/vt100.h | 2 +- bootstrap/windows-48/Compiler.c | 2 +- bootstrap/windows-48/Configuration.c | 4 +- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Files.c | 2 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 2 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 2 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 2 +- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 2 +- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 2 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Out.c | 2 +- bootstrap/windows-48/Out.h | 2 +- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/errors.c | 2 +- bootstrap/windows-48/errors.h | 2 +- bootstrap/windows-48/extTools.c | 2 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-48/vt100.c | 2 +- bootstrap/windows-48/vt100.h | 2 +- bootstrap/windows-88/Compiler.c | 2 +- bootstrap/windows-88/Configuration.c | 4 +- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Files.c | 2 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 2 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 2 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 2 +- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 2 +- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 2 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Out.c | 2 +- bootstrap/windows-88/Out.h | 2 +- bootstrap/windows-88/Platform.c | 2 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/errors.c | 2 +- bootstrap/windows-88/errors.h | 2 +- bootstrap/windows-88/extTools.c | 2 +- bootstrap/windows-88/extTools.h | 2 +- bootstrap/windows-88/vt100.c | 2 +- bootstrap/windows-88/vt100.h | 2 +- src/runtime/LowLReal.Mod | 486 ------------------------- src/runtime/Math.Mod | 3 +- src/runtime/MathL.Mod | 520 +++++++++++++++++---------- src/tools/make/oberon.mk | 2 +- 199 files changed, 542 insertions(+), 869 deletions(-) delete mode 100644 src/runtime/LowLReal.Mod diff --git a/bootstrap/unix-44/Compiler.c b/bootstrap/unix-44/Compiler.c index 5eeecbcd..f176c32c 100644 --- a/bootstrap/unix-44/Compiler.c +++ b/bootstrap/unix-44/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index 8d939331..cd60e0eb 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index 29896228..51248a3a 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 5ccc86c7..dcdaea0d 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index 4df07327..d902e57e 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index ed20badb..bf247ca6 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index 15cedcc4..2b27eb13 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index 352866db..19cf402a 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index c6f0ec55..eb8d7d25 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index 80807ca6..4df43c2a 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index 7917b570..bab5adcc 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index fad4716b..fd8f546f 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index 6d64b896..662ac74a 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index c2760a09..8430bf82 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index b798756b..d7aadb69 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index f691a0ee..016b40ed 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index b466e3aa..90da6ba9 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index bd835f8d..f7f892bf 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index af7eca8a..d97f3caa 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index 3e713505..b214554c 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index 5fe4dd5c..88225ce2 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index ab191652..65f5d6d9 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index 49c91eed..ab72377c 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Out.c b/bootstrap/unix-44/Out.c index c278b7af..66f4fc90 100644 --- a/bootstrap/unix-44/Out.c +++ b/bootstrap/unix-44/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Out.h b/bootstrap/unix-44/Out.h index 72b7e0cb..4d3199e6 100644 --- a/bootstrap/unix-44/Out.h +++ b/bootstrap/unix-44/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 16672654..a550ad52 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index d4fe9c38..eee301c1 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 97923f8d..7d395538 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index 24d6197a..98731ba9 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index afd5e004..7d4bf19a 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index ce00b00c..939e74d8 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index 9b65a9b8..adb24e10 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index bf82f949..ca5c6c89 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/errors.c b/bootstrap/unix-44/errors.c index d35766eb..49c6425d 100644 --- a/bootstrap/unix-44/errors.c +++ b/bootstrap/unix-44/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/errors.h b/bootstrap/unix-44/errors.h index 6adfb219..e7ecd052 100644 --- a/bootstrap/unix-44/errors.h +++ b/bootstrap/unix-44/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index 5f5a39b3..b58bcc2a 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index 57da5b24..cb8a5a95 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-44/vt100.c b/bootstrap/unix-44/vt100.c index 61383b15..92ed02e4 100644 --- a/bootstrap/unix-44/vt100.c +++ b/bootstrap/unix-44/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/vt100.h b/bootstrap/unix-44/vt100.h index 511c4d6b..393203ef 100644 --- a/bootstrap/unix-44/vt100.h +++ b/bootstrap/unix-44/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-48/Compiler.c b/bootstrap/unix-48/Compiler.c index 5eeecbcd..f176c32c 100644 --- a/bootstrap/unix-48/Compiler.c +++ b/bootstrap/unix-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index 8d939331..cd60e0eb 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index 29896228..51248a3a 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 5ccc86c7..dcdaea0d 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index 4df07327..d902e57e 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index ed20badb..bf247ca6 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index 15cedcc4..2b27eb13 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index 352866db..19cf402a 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index c6f0ec55..eb8d7d25 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index 80807ca6..4df43c2a 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index 7917b570..bab5adcc 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index fad4716b..fd8f546f 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index 6d64b896..662ac74a 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index c2760a09..8430bf82 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index b798756b..d7aadb69 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index f691a0ee..016b40ed 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index b466e3aa..90da6ba9 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index bd835f8d..f7f892bf 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index af7eca8a..d97f3caa 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index bd0b6935..911d49ab 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index 5fe4dd5c..88225ce2 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index ab191652..65f5d6d9 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index 49c91eed..ab72377c 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Out.c b/bootstrap/unix-48/Out.c index c278b7af..66f4fc90 100644 --- a/bootstrap/unix-48/Out.c +++ b/bootstrap/unix-48/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Out.h b/bootstrap/unix-48/Out.h index 72b7e0cb..4d3199e6 100644 --- a/bootstrap/unix-48/Out.h +++ b/bootstrap/unix-48/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 16672654..a550ad52 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index d4fe9c38..eee301c1 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 97923f8d..7d395538 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index 24d6197a..98731ba9 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index afd5e004..7d4bf19a 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index ce00b00c..939e74d8 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index f656fcc8..f6698990 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index 6feea28a..baa9464f 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/errors.c b/bootstrap/unix-48/errors.c index d35766eb..49c6425d 100644 --- a/bootstrap/unix-48/errors.c +++ b/bootstrap/unix-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/errors.h b/bootstrap/unix-48/errors.h index 6adfb219..e7ecd052 100644 --- a/bootstrap/unix-48/errors.h +++ b/bootstrap/unix-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index 5f5a39b3..b58bcc2a 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index 57da5b24..cb8a5a95 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/vt100.c b/bootstrap/unix-48/vt100.c index 61383b15..92ed02e4 100644 --- a/bootstrap/unix-48/vt100.c +++ b/bootstrap/unix-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/vt100.h b/bootstrap/unix-48/vt100.h index 511c4d6b..393203ef 100644 --- a/bootstrap/unix-48/vt100.h +++ b/bootstrap/unix-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-88/Compiler.c b/bootstrap/unix-88/Compiler.c index 5eeecbcd..f176c32c 100644 --- a/bootstrap/unix-88/Compiler.c +++ b/bootstrap/unix-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index 8d939331..cd60e0eb 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index 29896228..51248a3a 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 980cd0fc..05693822 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index fefffb47..74b0c2ac 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index 2dd37317..d929bf31 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index dc9db0d8..c0f06627 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 57b8190a..3f625202 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index c6f0ec55..eb8d7d25 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index 80807ca6..4df43c2a 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index 7917b570..bab5adcc 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index fad4716b..fd8f546f 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index 6d64b896..662ac74a 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index bc0b1d98..69eb0109 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index b798756b..d7aadb69 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index 643f8fc5..aa541ba7 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index b466e3aa..90da6ba9 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index bd835f8d..f7f892bf 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index af7eca8a..d97f3caa 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index a8d1a2b2..5adea265 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 5fe4dd5c..88225ce2 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 5004eab0..8a61c677 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index 49c91eed..ab72377c 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Out.c b/bootstrap/unix-88/Out.c index c278b7af..66f4fc90 100644 --- a/bootstrap/unix-88/Out.c +++ b/bootstrap/unix-88/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Out.h b/bootstrap/unix-88/Out.h index 72b7e0cb..4d3199e6 100644 --- a/bootstrap/unix-88/Out.h +++ b/bootstrap/unix-88/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index f677d8cf..79765125 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index 14ebab63..ff4f1129 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 97923f8d..7d395538 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index 24d6197a..98731ba9 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index afd5e004..7d4bf19a 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index ce00b00c..939e74d8 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index 97cfe790..ebb0ff54 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index 695d46a5..b75c50d4 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/errors.c b/bootstrap/unix-88/errors.c index d35766eb..49c6425d 100644 --- a/bootstrap/unix-88/errors.c +++ b/bootstrap/unix-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/errors.h b/bootstrap/unix-88/errors.h index 6adfb219..e7ecd052 100644 --- a/bootstrap/unix-88/errors.h +++ b/bootstrap/unix-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index 5f5a39b3..b58bcc2a 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index 57da5b24..cb8a5a95 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/vt100.c b/bootstrap/unix-88/vt100.c index 61383b15..92ed02e4 100644 --- a/bootstrap/unix-88/vt100.c +++ b/bootstrap/unix-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/vt100.h b/bootstrap/unix-88/vt100.h index 511c4d6b..393203ef 100644 --- a/bootstrap/unix-88/vt100.h +++ b/bootstrap/unix-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-48/Compiler.c b/bootstrap/windows-48/Compiler.c index 5eeecbcd..f176c32c 100644 --- a/bootstrap/windows-48/Compiler.c +++ b/bootstrap/windows-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index 8d939331..cd60e0eb 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index 29896228..51248a3a 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index afea83b3..d994f80e 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index d797cd7d..ee2c6a91 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index ed20badb..bf247ca6 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index 15cedcc4..2b27eb13 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index 352866db..19cf402a 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index c6f0ec55..eb8d7d25 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index 80807ca6..4df43c2a 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index 7917b570..bab5adcc 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index fad4716b..fd8f546f 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index 6d64b896..662ac74a 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index c2760a09..8430bf82 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index b798756b..d7aadb69 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index f691a0ee..016b40ed 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index b466e3aa..90da6ba9 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index bd835f8d..f7f892bf 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index af7eca8a..d97f3caa 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index bd0b6935..911d49ab 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index 5fe4dd5c..88225ce2 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index ab191652..65f5d6d9 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index 49c91eed..ab72377c 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Out.c b/bootstrap/windows-48/Out.c index f08085ef..6ea96ec6 100644 --- a/bootstrap/windows-48/Out.c +++ b/bootstrap/windows-48/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Out.h b/bootstrap/windows-48/Out.h index 72b7e0cb..4d3199e6 100644 --- a/bootstrap/windows-48/Out.h +++ b/bootstrap/windows-48/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 7b5e8a8c..f88bbad9 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index e0dfb26e..e1231b49 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 97923f8d..7d395538 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index 24d6197a..98731ba9 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index afd5e004..7d4bf19a 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index ce00b00c..939e74d8 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index f656fcc8..f6698990 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index 6feea28a..baa9464f 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/errors.c b/bootstrap/windows-48/errors.c index d35766eb..49c6425d 100644 --- a/bootstrap/windows-48/errors.c +++ b/bootstrap/windows-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/errors.h b/bootstrap/windows-48/errors.h index 6adfb219..e7ecd052 100644 --- a/bootstrap/windows-48/errors.h +++ b/bootstrap/windows-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index 5f5a39b3..b58bcc2a 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index 57da5b24..cb8a5a95 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/vt100.c b/bootstrap/windows-48/vt100.c index 61383b15..92ed02e4 100644 --- a/bootstrap/windows-48/vt100.c +++ b/bootstrap/windows-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/vt100.h b/bootstrap/windows-48/vt100.h index 511c4d6b..393203ef 100644 --- a/bootstrap/windows-48/vt100.h +++ b/bootstrap/windows-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-88/Compiler.c b/bootstrap/windows-88/Compiler.c index 5eeecbcd..f176c32c 100644 --- a/bootstrap/windows-88/Compiler.c +++ b/bootstrap/windows-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index 8d939331..cd60e0eb 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index 29896228..51248a3a 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index a2df0b07..06562971 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 85708a3f..f2adf7f8 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index 2dd37317..d929bf31 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index dc9db0d8..c0f06627 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 57b8190a..3f625202 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index c6f0ec55..eb8d7d25 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index 80807ca6..4df43c2a 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index 7917b570..bab5adcc 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index fad4716b..fd8f546f 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index 6d64b896..662ac74a 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index bc0b1d98..69eb0109 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index b798756b..d7aadb69 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index 643f8fc5..aa541ba7 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index b466e3aa..90da6ba9 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index bd835f8d..f7f892bf 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index af7eca8a..d97f3caa 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index a8d1a2b2..5adea265 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 5fe4dd5c..88225ce2 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 5004eab0..8a61c677 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index 49c91eed..ab72377c 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Out.c b/bootstrap/windows-88/Out.c index f08085ef..6ea96ec6 100644 --- a/bootstrap/windows-88/Out.c +++ b/bootstrap/windows-88/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Out.h b/bootstrap/windows-88/Out.h index 72b7e0cb..4d3199e6 100644 --- a/bootstrap/windows-88/Out.h +++ b/bootstrap/windows-88/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 8f725aaa..e99e1be2 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index 070acb18..04c87a8c 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 97923f8d..7d395538 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index 24d6197a..98731ba9 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index afd5e004..7d4bf19a 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index ce00b00c..939e74d8 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index 97cfe790..ebb0ff54 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index 695d46a5..b75c50d4 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/errors.c b/bootstrap/windows-88/errors.c index d35766eb..49c6425d 100644 --- a/bootstrap/windows-88/errors.c +++ b/bootstrap/windows-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/errors.h b/bootstrap/windows-88/errors.h index 6adfb219..e7ecd052 100644 --- a/bootstrap/windows-88/errors.h +++ b/bootstrap/windows-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index 5f5a39b3..b58bcc2a 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index 57da5b24..cb8a5a95 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/vt100.c b/bootstrap/windows-88/vt100.c index 61383b15..92ed02e4 100644 --- a/bootstrap/windows-88/vt100.c +++ b/bootstrap/windows-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/vt100.h b/bootstrap/windows-88/vt100.h index 511c4d6b..393203ef 100644 --- a/bootstrap/windows-88/vt100.h +++ b/bootstrap/windows-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/src/runtime/LowLReal.Mod b/src/runtime/LowLReal.Mod deleted file mode 100644 index b90958b2..00000000 --- a/src/runtime/LowLReal.Mod +++ /dev/null @@ -1,486 +0,0 @@ -(* $Id: LowLReal.Mod,v 1.6 1999/09/02 13:15:35 acken Exp $ *) -MODULE oocLowLReal; - -(* ToDo. support 64 bit builds *) - -(* - LowLReal - Gives access to the underlying properties of the type LONGREAL - for IEEE double-precision numbers. - Copyright (C) 1996 Michael Griebling - - This module is free software; you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - This module is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -*) - - -IMPORT Low := LowReal, S := SYSTEM; - -(* - - Real number properties are defined as follows: - - radix--The whole number value of the radix used to represent the - corresponding read number values. - - places--The whole number value of the number of radix places used - to store values of the corresponding real number type. - - expoMin--The whole number value of the exponent minimum. - - expoMax--The whole number value of the exponent maximum. - - large--The largest value of the corresponding real number type. - - small--The smallest positive value of the corresponding real number - type, represented to maximal precision. - - IEC559--A Boolean value that is TRUE if and only if the implementation - of the corresponding real number type conforms to IEC 559:1989 - (IEEE 754:1987) in all regards. - - NOTES - 6 -- If `IEC559' is TRUE, the value of `radix' is 2. - 7 -- If LowReal.IEC559 is TRUE, the 32-bit format of IEC 559:1989 - is used for the type REAL. - 7 -- If LowLong.IEC559 is TRUE, the 64-bit format of IEC 559:1989 - is used for the type REAL. - - LIA1--A Boolean value that is TRUE if and only if the implementation of - the corresponding real number type conforms to ISO/IEC 10967-1:199x - (LIA-1) in all regards: parameters, arithmetic, exceptions, and - notification. - - rounds--A Boolean value that is TRUE if and only if each operation produces - a result that is one of the values of the corresponding real number - type nearest to the mathematical result. - - gUnderflow--A Boolean value that is TRUE if and only if there are values of - the corresponding real number type between 0.0 and `small'. - - exception--A Boolean value that is TRUE if and only if every operation that - attempts to produce a real value out of range raises an exception. - - extend--A Boolean value that is TRUE if and only if expressions of the - corresponding real number type are computed to higher precision than - the stored values. - - nModes--The whole number value giving the number of bit positions needed for - the status flags for mode control. - -*) - -CONST - radix*= 2; - places*= 53; - expoMax*= 1023; - expoMin*= 1-expoMax; - large*= MAX(LONGREAL); (*1.7976931348623157D+308;*) (* MAX(LONGREAL) *) - (*small*= 2.2250738585072014D-308;*) - small*= 2.2250738585072014/9.9999999999999981D307(*/10^308)*); - IEC559*= TRUE; - LIA1*= FALSE; - rounds*= FALSE; - gUnderflow*= TRUE; (* there are IEEE numbers smaller than `small' *) - exception*= FALSE; (* at least in the default implementation *) - extend*= FALSE; - nModes*= 0; - ONE=1.0D0; (* some commonly-used constants *) - ZERO=0.0D0; - TEN=1.0D1; - - DEBUG = TRUE; - - expOffset=expoMax; - hiBit=19; - expBit=hiBit+1; - nMask={0..hiBit,31}; (* number mask *) - expMask={expBit..30}; (* exponent mask *) - -TYPE - Modes*= SET; - LongInt=ARRAY 2 OF LONGINT; - LongSet=ARRAY 2 OF SET; - -VAR - (*sml* : LONGREAL; tmp: LONGREAL;*) (* this was a test to get small as a variable at runtime. obviously, compile time preferred; -- noch *) - isBigEndian-: BOOLEAN; (* set when target is big endian *) - (* - PROCEDURE power0(i, j : INTEGER) : LONGREAL; (* used to calculate sml at runtime; -- noch *) - VAR k : INTEGER; - p : LONGREAL; - BEGIN - k := 1; - p := i; - REPEAT - p := p * i; - INC(k); - UNTIL k=j; - RETURN p; - END power0; -*) - -(* Errors are handled through the LowReal module *) - -PROCEDURE err*(): INTEGER; -BEGIN - RETURN Low.err -END err; - -PROCEDURE ClearError*; -BEGIN - Low.ClearError -END ClearError; - -PROCEDURE ErrorHandler*(err: INTEGER); -BEGIN - Low.ErrorHandler(err) -END ErrorHandler; - -(* type-casting utilities *) - -PROCEDURE Move (VAR x: LONGREAL; VAR ra: ARRAY OF LONGINT); -(* typecast a LONGREAL to an array of LONGINTs *) - VAR t: LONGINT; -BEGIN - S.MOVE(S.ADR(x),S.ADR(ra),SIZE(LONGREAL)); - IF ~isBigEndian THEN t:=ra[0]; ra[0]:=ra[1]; ra[1]:=t END -END Move; - -PROCEDURE MoveSet (VAR x: LONGREAL; VAR ra: ARRAY OF SET); -(* typecast a LONGREAL to an array of LONGINTs *) - VAR t: SET; -BEGIN - S.MOVE(S.ADR(x),S.ADR(ra),SIZE(LONGREAL)); - IF ~isBigEndian THEN t:=ra[0]; ra[0]:=ra[1]; ra[1]:=t END -END MoveSet; - -(* Note: The below should be done with a type cast -- - once the compiler supports such things. *) -(*<* PUSH; Warnings := FALSE *>*) -PROCEDURE Real * (ra: ARRAY OF LONGINT): LONGREAL; -(* typecast an array of big endian LONGINTs to a LONGREAL *) - VAR t: LONGINT; x: LONGREAL; -BEGIN - IF ~isBigEndian THEN t:=ra[0]; ra[0]:=ra[1]; ra[1]:=t END; - S.MOVE(S.ADR(ra),S.ADR(x),SIZE(LONGREAL)); - RETURN x -END Real; - -PROCEDURE ToReal (ra: ARRAY OF SET): LONGREAL; -(* typecast an array of LONGINTs to a LONGREAL *) - VAR t: SET; x: LONGREAL; -BEGIN - IF ~isBigEndian THEN t:=ra[0]; ra[0]:=ra[1]; ra[1]:=t END; - S.MOVE(S.ADR(ra),S.ADR(x),SIZE(LONGREAL)); - RETURN x -END ToReal; -(*<* POP *> *) - -PROCEDURE exponent*(x: LONGREAL): INTEGER; -(* - The value of the call exponent(x) shall be the exponent value of `x' - that lies between `expoMin' and `expoMax'. An exception shall occur - and may be raised if `x' is equal to 0.0. - *) - VAR ra: LongInt; -BEGIN - (* NOTE: x=0.0 should raise exception *) - IF x=ZERO THEN RETURN 0 - ELSE Move(x, ra); - RETURN SHORT(S.LSH(ra[0],-expBit) MOD 2048)-expOffset - END -END exponent; - -PROCEDURE exponent10*(x: LONGREAL): INTEGER; -(* - The value of the call exponent10(x) shall be the base 10 exponent - value of `x'. An exception shall occur and may be raised if `x' is - equal to 0.0. - *) -VAR exp: INTEGER; -BEGIN - IF x=ZERO THEN RETURN 0 END; (* exception could be raised here *) - exp:=0; x:=ABS(x); - WHILE x>=TEN DO x:=x/TEN; INC(exp) END; - WHILE x<1 DO x:=x*TEN; DEC(exp) END; - RETURN exp -END exponent10; - -PROCEDURE fraction*(x: LONGREAL): LONGREAL; -(* - The value of the call fraction(x) shall be the significand (or - significant) part of `x'. Hence the following relationship shall - hold: x = scale(fraction(x), exponent(x)). -*) - CONST eZero={(hiBit+2)..29}; - VAR ra: LongInt; -BEGIN - IF x=ZERO THEN RETURN ZERO - ELSE Move(x, ra); - ra[0]:=S.VAL(LONGINT, S.VAL(SET,ra[0])*nMask+eZero); - RETURN Real(ra)*2.0D0 - END -END fraction; - -PROCEDURE IsInfinity * (real: LONGREAL) : BOOLEAN; - CONST signMask={0..30}; - VAR ra: LongSet; -BEGIN - MoveSet(real, ra); - RETURN (ra[0]*signMask=expMask) & (ra[1]={}) -END IsInfinity; - -PROCEDURE IsNaN * (real: LONGREAL) : BOOLEAN; - CONST fracMask={0..hiBit}; - VAR ra: LongSet; -BEGIN - MoveSet(real, ra); - RETURN (ra[0]*expMask=expMask) & ((ra[1]#{}) OR (ra[0]*fracMask#{})) -END IsNaN; - -PROCEDURE sign*(x: LONGREAL): LONGREAL; -(* - The value of the call sign(x) shall be 1.0 if `x' is greater than 0.0, - or shall be -1.0 if `x' is less than 0.0, or shall be either 1.0 or - -1.0 if `x' is equal to 0.0. -*) -BEGIN - IF xexpoMax THEN RETURN large*sign(x) (* exception raised here *) - ELSIF exp 1.0 *) - LnInfinity: LONGREAL; (* natural log of infinity *) - LnSmall: LONGREAL; (* natural log of very small number *) - SqrtInfinity: LONGREAL; (* square root of infinity *) - TanhMax: LONGREAL; (* maximum Tanh value *) - t: LONGREAL; (* internal variables *) + a1: ARRAY 18 OF LONGREAL; (* lookup table for power function *) + a2: ARRAY 9 OF LONGREAL; (* lookup table for power function *) + em: LONGREAL; (* largest number such that 1 + epsilon > 1.0 *) + LnInfinity: LONGREAL; (* natural log of infinity *) + LnSmall: LONGREAL; (* natural log of very small number *) + SqrtInfinity: LONGREAL; (* square root of infinity *) + TanhMax: LONGREAL; (* maximum Tanh value *) + t: LONGREAL; (* internal variables *) + NumberMask: SYSTEM.SET64; (* Sign and significand, {0..51, 63} *) + ExponentMask: SYSTEM.SET64; (* Exponent part, {53..62} *) + ZeroExponent: SYSTEM.SET64; (* Zero valued exponent {54..61} *) + i: INTEGER; (* For initialisation loops in module body. *) + + + + +(* TYPE LONGREAL: 1/sign, 11/exponent, 52/significand *) + +PROCEDURE fraction*(x: LONGREAL): LONGREAL; +(* + The value of the call fraction(x) shall be the significand (or + significant) part of `x'. Hence the following relationship shall + hold: x = scale(fraction(x), exponent(x)). +*) + VAR s: SET; +BEGIN + IF x = ZERO THEN RETURN ZERO + ELSE + s := SYSTEM.VAL(SYSTEM.SET64, x) * NumberMask + ZeroExponent; + RETURN SYSTEM.VAL(LONGREAL, s) * 2.0; + END +END fraction; + +PROCEDURE exponent*(x: LONGREAL): INTEGER; +(* + The value of the call exponent(x) shall be the exponent value of `x' + that lies between `expoMin' and `expoMax'. An exception shall occur + and may be raised if `x' is equal to 0.0. +*) + VAR i: SYSTEM.INT64; +BEGIN + IF x = ZERO THEN RETURN 0 (* NOTE: x=0.0 should raise exception *) + ELSE + i := SYSTEM.LSH(SYSTEM.VAL(SYSTEM.INT64, x), -52) MOD 2048; + RETURN SYSTEM.VAL(INTEGER, i) - 1023 + END +END exponent; + +PROCEDURE sign*(x: LONGREAL): LONGREAL; +(* + The value of the call sign(x) shall be 1.0 if `x' is greater than 0.0, + or shall be -1.0 if `x' is less than 0.0, or shall be either 1.0 or + -1.0 if `x' is equal to 0.0. +*) +BEGIN + IF x < ZERO THEN RETURN -ONE ELSE RETURN ONE END +END sign; + +PROCEDURE scale*(x: LONGREAL; n: INTEGER): LONGREAL; +(* + The value of the call scale(x,n) shall be the value x*radix^n if such + a value exists; otherwise an execption shall occur and may be raised. +*) + VAR exp: LONGINT; lexp: SYSTEM.SET64; +BEGIN + IF x = ZERO THEN RETURN ZERO END; + exp := exponent(x) + n; (* new exponent *) + IF exp > expoMax THEN RETURN large * sign(x) (* exception raised here *) + ELSIF exp < expoMin THEN RETURN small * sign(x) (* exception here as well *) + END; + lexp := SYSTEM.VAL(SYSTEM.SET64, x) * NumberMask (* sign and significand *) + + SYSTEM.VAL(SYSTEM.SET64, SYSTEM.LSH(exp + expOffset, 52)); (* shifted exponent bits *) + RETURN SYSTEM.VAL(LONGREAL, lexp) +END scale; + +PROCEDURE ulp*(x: LONGREAL): LONGREAL; +(* + The value of the call ulp(x) shall be the value of the corresponding + real number type equal to a unit in the last place of `x', if such a + value exists; otherwise an exception shall occur and may be raised. +*) +BEGIN + RETURN scale(ONE, exponent(x)-places+1) +END ulp; + +PROCEDURE succ*(x: LONGREAL): LONGREAL; +(* + The value of the call succ(x) shall be the next value of the + corresponding real number type greater than `x', if such a type + exists; otherwise an exception shall occur and may be raised. +*) +BEGIN + RETURN x+ulp(x)*sign(x) +END succ; + +PROCEDURE pred*(x: LONGREAL): LONGREAL; +(* + The value of the call pred(x) shall be the next value of the + corresponding real number type less than `x', if such a type exists; + otherwise an exception shall occur and may be raised. +*) +BEGIN + RETURN x-ulp(x)*sign(x) +END pred; -(* internally used support routines *) PROCEDURE SinCos (x, y, sign: LONGREAL): LONGREAL; CONST - ymax=210828714; (* ENTIER(pi*2**(MantBits/2)) *) - c1=3.1416015625D0; - c2=-8.908910206761537356617D-6; - r1=-0.16666666666666665052D+0; - r2= 0.83333333333331650314D-2; - r3=-0.19841269841201840457D-3; - r4= 0.27557319210152756119D-5; - r5=-0.25052106798274584544D-7; - r6= 0.16058936490371589114D-9; - r7=-0.76429178068910467734D-12; - r8= 0.27204790957888846175D-14; + ymax = 210828714; (* ENTIER(pi*2**(MantBits/2)) *) + c1 = 3.1416015625D0; + c2 = -8.908910206761537356617D-6; + r1 = -0.16666666666666665052D+0; + r2 = 0.83333333333331650314D-2; + r3 = -0.19841269841201840457D-3; + r4 = 0.27557319210152756119D-5; + r5 = -0.25052106798274584544D-7; + r6 = 0.16058936490371589114D-9; + r7 = -0.76429178068910467734D-12; + r8 = 0.27204790957888846175D-14; VAR n: LONGINT; xn, f, x1, g: LONGREAL; BEGIN - IF y>=ymax THEN l.ErrorHandler(LossOfAccuracy); RETURN ZERO END; + IF y >= ymax THEN Math.ErrorHandler(Math.LossOfAccuracy); RETURN ZERO END; (* determine the reduced number *) - n:=ENTIER(y*piInv+HALF); xn:=n; - IF ODD(n) THEN sign:=-sign END; - x:=ABS(x); - IF x#y THEN xn:=xn-HALF END; + n := ENTIER(y*piInv + HALF); xn := n; + IF ODD(n) THEN sign := -sign END; + x := ABS(x); + IF x # y THEN xn := xn-HALF END; (* fractional part of reduced number *) - x1:=ENTIER(x); - f:=((x1-xn*c1)+(x-x1))-xn*c2; + x1 := ENTIER(x); + f := ((x1-xn*c1) + (x-x1))-xn*c2; (* Pre: |f| <= pi/2 *) - IF ABS(f)LnInfinity THEN l.ErrorHandler(Overflow); RETURN huge - ELSIF x LnInfinity THEN Math.ErrorHandler(Math.Overflow); RETURN large + ELSIF x < LnSmall THEN RETURN ZERO + ELSIF ABS(x) < eps THEN RETURN ONE END; (* Decompose and scale the number *) - IF x>=ZERO THEN n:=SHORT(ENTIER(ln2Inv*x+HALF)) - ELSE n:=SHORT(ENTIER(ln2Inv*x-HALF)) + IF x >= ZERO THEN n := SHORT(ENTIER(ln2Inv*x + HALF)) + ELSE n := SHORT(ENTIER(ln2Inv*x-HALF)) END; - xn:=n; g:=(x-xn*c1)-xn*c2; + xn := n; g := (x-xn*c1)-xn*c2; (* Calculate exp(g)/2 from "Software Manual for the Elementary Functions" *) - z:=g*g; p:=((P2*z+P1)*z+P0)*g; q:=(Q2*z+Q1)*z+HALF; - RETURN l.scale(HALF+p/(q-p), n+1) + z := g*g; p := ((P2*z + P1)*z + P0)*g; q := (Q2*z + Q1)*z + HALF; + RETURN scale(HALF + p/(q-p), n + 1) END exp; PROCEDURE ln*(x: LONGREAL): LONGREAL; @@ -177,20 +327,20 @@ PROCEDURE ln*(x: LONGREAL): LONGREAL; VAR f, zn, zd, r, z, w, p, q, xn: LONGREAL; n: INTEGER; BEGIN (* ensure illegal inputs are trapped and handled *) - IF x<=ZERO THEN l.ErrorHandler(IllegalLog); RETURN -huge END; + IF x <= ZERO THEN Math.ErrorHandler(Math.IllegalLog); RETURN -large END; (* reduce the range of the input *) - f:=l.fraction(x)*HALF; n:=l.exponent(x)+1; - IF f>sqrtHalf THEN zn:=(f-HALF)-HALF; zd:=f*HALF+HALF - ELSE zn:=f-HALF; zd:=zn*HALF+HALF; DEC(n) + f := fraction(x)*HALF; n := exponent(x) + 1; + IF f > sqrtHalf THEN zn := (f-HALF)-HALF; zd := f*HALF + HALF + ELSE zn := f-HALF; zd := zn*HALF + HALF; DEC(n) END; (* evaluate rational approximation from "Software Manual for the Elementary Functions" *) - z:=zn/zd; w:=z*z; q:=((w+Q2)*w+Q1)*w+Q0; p:=w*((P2*w+P1)*w+P0); r:=z+z*(p/q); + z := zn/zd; w := z*z; q := ((w + Q2)*w + Q1)*w + Q0; p := w*((P2*w + P1)*w + P0); r := z + z*(p/q); (* scale the output *) - xn:=n; - RETURN (xn*c2+r)+xn*c1 + xn := n; + RETURN (xn*c2 + r) + xn*c1 END ln; @@ -198,14 +348,14 @@ END ln; PROCEDURE sin* (x: LONGREAL): LONGREAL; BEGIN - IF xONE THEN l.ErrorHandler(IllegalInvTrig); RETURN huge + IF ABS(x) > ONE THEN Math.ErrorHandler(Math.IllegalInvTrig); RETURN large ELSE RETURN arctan2(x, sqrt(ONE-x*x)) END END arcsin; @@ -229,7 +379,7 @@ END arcsin; PROCEDURE arccos*(x: LONGREAL): LONGREAL; (* Returns the arccosine of x, in the range [0, pi] where -1 <= x <= 1 *) BEGIN - IF ABS(x)>ONE THEN l.ErrorHandler(IllegalInvTrig); RETURN huge + IF ABS(x) > ONE THEN Math.ErrorHandler(Math.IllegalInvTrig); RETURN large ELSE RETURN arctan2(sqrt(ONE-x*x), x) END END arccos; @@ -240,7 +390,7 @@ BEGIN RETURN arctan2(x, ONE) END arctan; -PROCEDURE power*(base, exponent: LONGREAL): LONGREAL; +PROCEDURE power*(base, exp: LONGREAL): LONGREAL; (* Returns the value of the number base raised to the power exponent for base > 0 *) CONST @@ -251,54 +401,56 @@ PROCEDURE power*(base, exponent: LONGREAL): LONGREAL; Q3=0.55504108664085595326D-1; Q4=0.96181290595172416964D-2; Q5=0.13333541313585784703D-2; Q6=0.15400290440989764601D-3; Q7=0.14928852680595608186D-4; - OneOver16=0.0625D0; XMAX=16*l.expoMax-1; (*XMIN=16*l.expoMin+1;*) XMIN=-16351; (* noch *) + OneOver16 = 0.0625D0; + XMAX = 16*expoMax - 1; (*XMIN=16*l.expoMin + 1;*) + XMIN = -16351; (* noch *) VAR z, g, R, v, u2, u1, w1, w2, y1, y2, w: LONGREAL; m, p, i: INTEGER; mp, pp, iw1: LONGINT; BEGIN (* handle all possible error conditions *) - IF ABS(exponent)ZERO THEN RETURN ZERO ELSE l.ErrorHandler(Overflow); RETURN -huge END + IF ABS(exp) < miny THEN RETURN ONE (* base**0 = 1 *) + ELSIF base < ZERO THEN Math.ErrorHandler(Math.IllegalPower); RETURN -large + ELSIF ABS(base) < miny THEN + IF exp > ZERO THEN RETURN ZERO ELSE Math.ErrorHandler(Math.Overflow); RETURN -large END END; (* extract the exponent of base to m and clear exponent of base in g *) - g:=l.fraction(base)*HALF; m:=l.exponent(base)+1; + g := fraction(base)*HALF; m := exponent(base) + 1; (* determine p table offset with an unrolled binary search *) - p:=1; - IF g<=a1[9] THEN p:=9 END; - IF g<=a1[p+4] THEN INC(p, 4) END; - IF g<=a1[p+2] THEN INC(p, 2) END; + p := 1; + IF g <= a1[9] THEN p := 9 END; + IF g <= a1[p + 4] THEN INC(p, 4) END; + IF g <= a1[p + 2] THEN INC(p, 2) END; (* compute scaled z so that |z| <= 0.044 *) - z:=((g-a1[p+1])-a2[(p+1) DIV 2])/(g+a1[p+1]); z:=z+z; + z := ((g-a1[p + 1])-a2[(p + 1) DIV 2])/(g + a1[p + 1]); z := z + z; (* approximation for log2(z) from "Software Manual for the Elementary Functions" *) - v:=z*z; R:=(((P4*v+P3)*v+P2)*v+P1)*v*z; R:=R+K*R; u2:=(R+z*K)+z; u1:=(m*16-p)*OneOver16; + v := z*z; R := (((P4*v + P3)*v + P2)*v + P1)*v*z; R := R + K*R; u2 := (R + z*K) + z; u1 := (m*16-p)*OneOver16; (* generate w with extra precision calculations *) - y1:=ENTIER(16*exponent)*OneOver16; y2:=exponent-y1; w:=u2*exponent+u1*y2; - w1:=ENTIER(16*w)*OneOver16; w2:=w-w1; w:=w1+u1*y1; - w1:=ENTIER(16*w)*OneOver16; w2:=w2+(w-w1); w:=ENTIER(16*w2)*OneOver16; - iw1:=ENTIER(16*(w+w1)); w2:=w2-w; + y1 := ENTIER(16*exp)*OneOver16; y2 := exp-y1; w := u2*exp + u1*y2; + w1 := ENTIER(16*w)*OneOver16; w2 := w-w1; w := w1 + u1*y1; + w1 := ENTIER(16*w)*OneOver16; w2 := w2 + (w-w1); w := ENTIER(16*w2)*OneOver16; + iw1 := ENTIER(16*(w + w1)); w2 := w2-w; (* check for overflow/underflow *) - IF iw1>XMAX THEN l.ErrorHandler(Overflow); RETURN huge - ELSIF iw1 XMAX THEN Math.ErrorHandler(Math.Overflow); RETURN large + ELSIF iw1 < XMIN THEN RETURN ZERO (* underflow *) END; (* final approximation 2**w2-1 where -0.0625 <= w2 <= 0 *) - IF w2>ZERO THEN INC(iw1); w2:=w2-OneOver16 END; IF iw1<0 THEN i:=0 ELSE i:=1 END; - mp:=div(iw1, 16)+i; pp:=16*mp-iw1; - z:=((((((Q7*w2+Q6)*w2+Q5)*w2+Q4)*w2+Q3)*w2+Q2)*w2+Q1)*w2; z:=a1[pp+1]+a1[pp+1]*z; - RETURN l.scale(z, SHORT(mp)) + IF w2 > ZERO THEN INC(iw1); w2 := w2-OneOver16 END; IF iw1 < 0 THEN i := 0 ELSE i := 1 END; + mp := div(iw1, 16) + i; pp := 16*mp-iw1; + z := ((((((Q7*w2 + Q6)*w2 + Q5)*w2 + Q4)*w2 + Q3)*w2 + Q2)*w2 + Q1)*w2; z := a1[pp + 1] + a1[pp + 1]*z; + RETURN scale(z, SHORT(mp)) END power; PROCEDURE round*(x: LONGREAL): LONGINT; (* Returns the value of x rounded to the nearest integer *) BEGIN - IF x 0 and base # 1. *) BEGIN (* log(x, base) = log2(x) / log2(base) *) - IF base<=ZERO THEN l.ErrorHandler(IllegalLogBase); RETURN -huge + IF base <= ZERO THEN Math.ErrorHandler(Math.IllegalLogBase); RETURN -large ELSE RETURN ln(x)/ln(base) END END log; @@ -333,29 +485,29 @@ PROCEDURE ipower* (x: LONGREAL; base: INTEGER): LONGREAL; PROCEDURE Adjust(xadj: LONGREAL): LONGREAL; BEGIN - IF (x0 THEN RETURN ZERO ELSE l.ErrorHandler(Overflow); RETURN Adjust(huge) END + ELSIF ABS(x) < miny THEN + IF base > 0 THEN RETURN ZERO ELSE Math.ErrorHandler(Math.Overflow); RETURN Adjust(large) END END; (* trap potential overflows and underflows *) - Exp:=(l.exponent(x)+1)*base; y:=LnInfinity*ln2Inv; - IF Exp>y THEN l.ErrorHandler(Overflow); RETURN Adjust(huge) - ELSIF Exp<-y THEN RETURN ZERO + Exp := (exponent(x) + 1)*base; y := LnInfinity*ln2Inv; + IF Exp > y THEN Math.ErrorHandler(Math.Overflow); RETURN Adjust(large) + ELSIF Exp < -y THEN RETURN ZERO END; (* compute x**base using an optimised algorithm from Knuth, slightly altered : p442, The Art Of Computer Programming, Vol 2 *) - y:=ONE; IF base<0 THEN neg:=TRUE; base := -base ELSE neg:= FALSE END; + y := ONE; IF base < 0 THEN neg := TRUE; base := -base ELSE neg:= FALSE END; LOOP - IF ODD(base) THEN y:=y*x END; - base:=base DIV 2; IF base=0 THEN EXIT END; - x:=x*x; + IF ODD(base) THEN y := y*x END; + base := base DIV 2; IF base=0 THEN EXIT END; + x := x*x; END; IF neg THEN RETURN ONE/y ELSE RETURN y END END ipower; @@ -363,7 +515,7 @@ END ipower; PROCEDURE sincos* (x: LONGREAL; VAR Sin, Cos: LONGREAL); (* More efficient sin/cos implementation if both values are needed. *) BEGIN - Sin:=sin(x); Cos:=sqrt(ONE-Sin*Sin) + Sin := sin(x); Cos := sqrt(ONE-Sin*Sin) END sincos; PROCEDURE arctan2* (xn, xd: LONGREAL): LONGREAL; @@ -378,43 +530,43 @@ PROCEDURE arctan2* (xn, xd: LONGREAL): LONGREAL; PiOver2=pi/2; Sqrt3=1.7320508075688772935D0; VAR atan, z, z2, p, q: LONGREAL; xnExp, xdExp: INTEGER; Quadrant: SHORTINT; BEGIN - IF ABS(xd)=l.expoMax-3 THEN l.ErrorHandler(Overflow); atan:=PiOver2 - ELSIF xnExp-xdExp= expoMax-3 THEN Math.ErrorHandler(Math.Overflow); atan := PiOver2 + ELSIF xnExp-xdExp < expoMin + 3 THEN atan := ZERO ELSE (* ensure division of xn/xd always produces a number < 1 & resolve quadrant *) - IF ABS(xn)>ABS(xd) THEN z:=ABS(xd/xn); Quadrant:=2 - ELSE z:=ABS(xn/xd); Quadrant:=0 + IF ABS(xn) > ABS(xd) THEN z := ABS(xd/xn); Quadrant := 2 + ELSE z := ABS(xn/xd); Quadrant := 0 END; (* further reduce range to within 0 to 2-sqrt(3) *) - IF z>TWO-Sqrt3 THEN z:=(z*Sqrt3-ONE)/(Sqrt3+z); INC(Quadrant) END; + IF z > TWO-Sqrt3 THEN z := (z*Sqrt3-ONE)/(Sqrt3 + z); INC(Quadrant) END; (* approximation from "Computer Approximations" table ARCTN 5075 *) - IF ABS(z)1 THEN atan:=-atan END; + IF Quadrant > 1 THEN atan := -atan END; CASE Quadrant OF - 1: atan:=atan+pi/6 - | 2: atan:=atan+PiOver2 - | 3: atan:=atan+pi/3 + 1: atan := atan + pi/6 + | 2: atan := atan + PiOver2 + | 3: atan := atan + pi/3 | ELSE (* angle is correct *) END END; (* map negative xds into the correct quadrant *) - IF xdLnInfinity THEN (* handle exp overflows *) - y:=y-lnv; - IF y>LnInfinity-lnv+0.69 THEN l.ErrorHandler(Overflow); - IF x>ZERO THEN RETURN huge ELSE RETURN -huge END - ELSE f:=exp(y); f:=f+f*vbytwo (* don't change to f(1+vbytwo) *) + f := y*y; p := ((P3*f + P2)*f + P1)*f + P0; q := ((f + Q2)*f + Q1)*f + Q0; y := f*(p/q); RETURN x + x*y + ELSIF y > LnInfinity THEN (* handle exp overflows *) + y := y-lnv; + IF y > LnInfinity-lnv + 0.69 THEN Math.ErrorHandler(Math.Overflow); + IF x > ZERO THEN RETURN large ELSE RETURN -large END + ELSE f := exp(y); f := f + f*vbytwo (* don't change to f(1 + vbytwo) *) END - ELSE f:=exp(y); f:=(f-ONE/f)*HALF + ELSE f := exp(y); f := (f-ONE/f)*HALF END; - (* reach here when 1 < ABS(x) < LnInfinity-lnv+0.69 *) - IF x>ZERO THEN RETURN f ELSE RETURN -f END + (* reach here when 1 < ABS(x) < LnInfinity-lnv + 0.69 *) + IF x > ZERO THEN RETURN f ELSE RETURN -f END END sinh; PROCEDURE cosh* (x: LONGREAL): LONGREAL; (* cosh(x) is the hyperbolic cosine of x. The argument x must not be so large that exp(|x|) overflows. *) VAR y, f: LONGREAL; -BEGIN y:=ABS(x); - IF y>LnInfinity THEN (* handle exp overflows *) - y:=y-lnv; - IF y>LnInfinity-lnv+0.69 THEN l.ErrorHandler(Overflow); - IF x>ZERO THEN RETURN huge ELSE RETURN -huge END - ELSE f:=exp(y); RETURN f+f*vbytwo (* don't change to f(1+vbytwo) *) +BEGIN y := ABS(x); + IF y > LnInfinity THEN (* handle exp overflows *) + y := y-lnv; + IF y > LnInfinity-lnv + 0.69 THEN Math.ErrorHandler(Math.Overflow); + IF x > ZERO THEN RETURN large ELSE RETURN -large END + ELSE f := exp(y); RETURN f + f*vbytwo (* don't change to f(1 + vbytwo) *) END - ELSE f:=exp(y); RETURN (f+ONE/f)*HALF + ELSE f := exp(y); RETURN (f + ONE/f)*HALF END END cosh; @@ -467,25 +619,25 @@ PROCEDURE tanh* (x: LONGREAL): LONGREAL; P0=-0.16134119023996228053D+4; P1=-0.99225929672236083313D+2; P2=-0.96437492777225469787D+0; Q0= 0.48402357071988688686D+4; Q1= 0.22337720718962312926D+4; Q2= 0.11274474380534949335D+3; ln3over2=0.54930614433405484570D0; - BIG=19.06154747D0; (* (ln(2)+(t+1)*ln(B))/2 where t=mantissa bits, B=base *) + BIG=19.06154747D0; (* (ln(2) + (t + 1)*ln(B))/2 where t=mantissa bits, B=base *) VAR f, t: LONGREAL; -BEGIN f:=ABS(x); - IF f>BIG THEN t:=ONE - ELSIF f>ln3over2 THEN t:=ONE-TWO/(exp(TWO*f)+ONE) - ELSIF f BIG THEN t := ONE + ELSIF f > ln3over2 THEN t := ONE-TWO/(exp(TWO*f) + ONE) + ELSIF f < Limit THEN t := f ELSE (* approximation from "Software Manual for the Elementary Functions" *) - t:=f*f; t:=t*(((P2*t+P1)*t+P0)/(((t+Q2)*t+Q1)*t+Q0)); t:=f+f*t + t := f*f; t := t*(((P2*t + P1)*t + P0)/(((t + Q2)*t + Q1)*t + Q0)); t := f + f*t END; - IF xSqrtInfinity*HALF THEN l.ErrorHandler(HypInvTrigClipped); - IF x>ZERO THEN RETURN ln(SqrtInfinity) ELSE RETURN -ln(SqrtInfinity) END; - ELSIF x SqrtInfinity*HALF THEN Math.ErrorHandler(Math.HypInvTrigClipped); + IF x > ZERO THEN RETURN ln(SqrtInfinity) ELSE RETURN -ln(SqrtInfinity) END; + ELSIF x < ZERO THEN RETURN -ln(-x + sqrt(x*x + ONE)) + ELSE RETURN ln(x + sqrt(x*x + ONE)) END END arcsinh; @@ -493,9 +645,9 @@ PROCEDURE arccosh* (x: LONGREAL): LONGREAL; (* arccosh(x) is the arc hyperbolic cosine of x. All arguments greater than or equal to 1 are legal. *) BEGIN - IF xSqrtInfinity*HALF THEN l.ErrorHandler(HypInvTrigClipped); RETURN ln(SqrtInfinity) - ELSE RETURN ln(x+sqrt(x*x-ONE)) + IF x < ONE THEN Math.ErrorHandler(Math.IllegalHypInvTrig); RETURN ZERO + ELSIF x > SqrtInfinity*HALF THEN Math.ErrorHandler(Math.HypInvTrigClipped); RETURN ln(SqrtInfinity) + ELSE RETURN ln(x + sqrt(x*x-ONE)) END END arccosh; @@ -505,10 +657,10 @@ PROCEDURE arctanh* (x: LONGREAL): LONGREAL; result is less accurate than half precision. *) CONST TanhLimit=0.999984991D0; (* Tanh(5.9) *) VAR t: LONGREAL; -BEGIN t:=ABS(x); - IF (t>=ONE) OR (t>(ONE-TWO*em)) THEN l.ErrorHandler(IllegalHypInvTrig); - IF xTanhLimit THEN l.ErrorHandler(LossOfAccuracy) +BEGIN t := ABS(x); + IF (t >= ONE) OR (t > (ONE-TWO*em)) THEN Math.ErrorHandler(Math.IllegalHypInvTrig); + IF x < ZERO THEN RETURN -TanhMax ELSE RETURN TanhMax END + ELSIF t > TanhLimit THEN Math.ErrorHandler(Math.LossOfAccuracy) END; RETURN arcsinh(x/sqrt(ONE-x*x)) END arctanh; @@ -518,16 +670,24 @@ BEGIN RETURN SYSTEM.VAL(LONGREAL, h) END ToLONGREAL; BEGIN + (* Initialise masks. *) + NumberMask := {}; INCL(NumberMask, 63); + FOR i := 0 TO 51 DO INCL(NumberMask, i) END; + ExponentMask := -NumberMask; + ZeroExponent := {}; + FOR i := 54 TO 61 DO INCL(ZeroExponent, i) END; + (* determine some fundamental constants used by hyperbolic trig functions *) - em:=l.ulp(ONE); - LnInfinity:=ln(huge); - LnSmall:=ln(miny); - SqrtInfinity:=sqrt(huge); - t:=l.pred(ONE)/sqrt(em); TanhMax:=ln(t+sqrt(t*t+ONE)); + em := ulp(ONE); + LnInfinity := ln(large); + LnSmall := ln(miny); + SqrtInfinity := sqrt(large); + t := pred(ONE)/sqrt(em); + TanhMax := ln(t + sqrt(t*t + ONE)); (* initialize some tables for the power() function a1[i]=2**((1-i)/16) *) (* disable compiler warnings about 32-bit negative integers *) - (*<* PUSH; Warnings := FALSE *>*) + (* < * PUSH; Warnings := FALSE * > *) a1[ 1] := ONE; a1[ 2] := ToLONGREAL(3FEEA4AFA2A490DAH); a1[ 3] := ToLONGREAL(3FED5818DCFBA487H); @@ -557,6 +717,6 @@ BEGIN a2[8] := ToLONGREAL(3C88A62E4ADC0000H); (* reenable compiler warnings *) - (*<* POP *>*) + (* < * POP * > *) END MathL. diff --git a/src/tools/make/oberon.mk b/src/tools/make/oberon.mk index 6ad77214..4e054338 100644 --- a/src/tools/make/oberon.mk +++ b/src/tools/make/oberon.mk @@ -200,7 +200,7 @@ runtime: cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Strings.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Files.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Math.Mod -# cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/MathL.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/MathL.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Reals.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Texts.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Oberon.Mod From a828ff79a49fc8cefb1fa81225fd2d31f2798705 Mon Sep 17 00:00:00 2001 From: David Brown Date: Sat, 8 Oct 2016 17:02:46 +0100 Subject: [PATCH 272/580] Implement Out.Real and Out.LongReal. --- bootstrap/unix-44/Compiler.c | 2 +- bootstrap/unix-44/Configuration.c | 4 +- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Files.c | 2 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 2 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 2 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 2 +- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 2 +- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 2 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Out.c | 267 +++++++++++++++++++++++++-- bootstrap/unix-44/Out.h | 3 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/errors.c | 2 +- bootstrap/unix-44/errors.h | 2 +- bootstrap/unix-44/extTools.c | 2 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-44/vt100.c | 2 +- bootstrap/unix-44/vt100.h | 2 +- bootstrap/unix-48/Compiler.c | 2 +- bootstrap/unix-48/Configuration.c | 4 +- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Files.c | 2 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 2 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 2 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 2 +- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 2 +- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 2 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Out.c | 267 +++++++++++++++++++++++++-- bootstrap/unix-48/Out.h | 3 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/errors.c | 2 +- bootstrap/unix-48/errors.h | 2 +- bootstrap/unix-48/extTools.c | 2 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-48/vt100.c | 2 +- bootstrap/unix-48/vt100.h | 2 +- bootstrap/unix-88/Compiler.c | 2 +- bootstrap/unix-88/Configuration.c | 4 +- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Files.c | 2 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 2 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 2 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 2 +- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 2 +- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 2 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Out.c | 267 +++++++++++++++++++++++++-- bootstrap/unix-88/Out.h | 3 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/errors.c | 2 +- bootstrap/unix-88/errors.h | 2 +- bootstrap/unix-88/extTools.c | 2 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/unix-88/vt100.c | 2 +- bootstrap/unix-88/vt100.h | 2 +- bootstrap/windows-48/Compiler.c | 2 +- bootstrap/windows-48/Configuration.c | 4 +- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Files.c | 2 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 2 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 2 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 2 +- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 2 +- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 2 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Out.c | 267 +++++++++++++++++++++++++-- bootstrap/windows-48/Out.h | 3 +- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/errors.c | 2 +- bootstrap/windows-48/errors.h | 2 +- bootstrap/windows-48/extTools.c | 2 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-48/vt100.c | 2 +- bootstrap/windows-48/vt100.h | 2 +- bootstrap/windows-88/Compiler.c | 2 +- bootstrap/windows-88/Configuration.c | 4 +- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Files.c | 2 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 2 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 2 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 2 +- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 2 +- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 2 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Out.c | 267 +++++++++++++++++++++++++-- bootstrap/windows-88/Out.h | 3 +- bootstrap/windows-88/Platform.c | 2 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/errors.c | 2 +- bootstrap/windows-88/errors.h | 2 +- bootstrap/windows-88/extTools.c | 2 +- bootstrap/windows-88/extTools.h | 2 +- bootstrap/windows-88/vt100.c | 2 +- bootstrap/windows-88/vt100.h | 2 +- src/runtime/Math.Mod | 24 +-- src/runtime/MathL.Mod | 2 +- src/runtime/Out.Mod | 194 ++++++++++++++++++- src/tools/make/oberon.mk | 5 +- 199 files changed, 1670 insertions(+), 285 deletions(-) diff --git a/bootstrap/unix-44/Compiler.c b/bootstrap/unix-44/Compiler.c index f176c32c..2dd6f251 100644 --- a/bootstrap/unix-44/Compiler.c +++ b/bootstrap/unix-44/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index cd60e0eb..3498204c 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index 51248a3a..14d86591 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index dcdaea0d..cb7920a3 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index d902e57e..4a49d744 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index bf247ca6..860107f9 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index 2b27eb13..84c9bb20 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index 19cf402a..ab3bb29b 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index eb8d7d25..95fc4f94 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index 4df43c2a..bfc64251 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index bab5adcc..d04325c7 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index fd8f546f..54cd9a85 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index 662ac74a..69a5580c 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 8430bf82..7da9b7b0 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index d7aadb69..d2a06df9 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index 016b40ed..768bfd2c 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index 90da6ba9..ee87db69 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index f7f892bf..02c301dc 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index d97f3caa..98dd65e7 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index b214554c..f9666e9a 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index 88225ce2..f5b615f8 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index 65f5d6d9..ce5e3036 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index ab72377c..43fd6331 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Out.c b/bootstrap/unix-44/Out.c index 66f4fc90..37cb4c91 100644 --- a/bootstrap/unix-44/Out.c +++ b/bootstrap/unix-44/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -7,6 +7,7 @@ #include "SYSTEM.h" #include "Platform.h" +#include "Strings.h" @@ -18,7 +19,13 @@ export void Out_LongReal (LONGREAL x, int16 n); export void Out_Open (void); export void Out_Real (REAL x, int16 n); export void Out_String (CHAR *str, LONGINT str__len); +export REAL Out_Ten (int16 e); +static LONGREAL Out_TenL (int16 e); +static void Out_digit (int64 n, CHAR *s, LONGINT s__len, int16 *i); +static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16 *i); +#define Out_Entier32(x) (int32)(x) +#define Out_Entier64(x) (int64)(x) void Out_Open (void) { @@ -36,7 +43,7 @@ void Out_String (CHAR *str, LONGINT str__len) int16 error; __DUP(str, str__len, CHAR); l = 0; - while ((l < str__len && str[l] != 0x00)) { + while ((l < str__len && str[__X(l, str__len)] != 0x00)) { l += 1; } error = Platform_Write(1, (address)str, l); @@ -60,13 +67,13 @@ void Out_Int (int64 x, int64 n) x = __DIV(x, 10); i = 1; while (x != 0) { - s[i] = (CHAR)(48 + __MOD(x, 10)); + s[__X(i, 22)] = (CHAR)(48 + __MOD(x, 10)); x = __DIV(x, 10); i += 1; } } if (negative) { - s[i] = '-'; + s[__X(i, 22)] = '-'; i += 1; } while (n > (int64)i) { @@ -75,28 +82,262 @@ void Out_Int (int64 x, int64 n) } while (i > 0) { i -= 1; - Out_Char(s[i]); + Out_Char(s[__X(i, 22)]); } } -void Out_Real (REAL x, int16 n) -{ -} - -void Out_LongReal (LONGREAL x, int16 n) -{ -} - void Out_Ln (void) { Out_String(Platform_NL, 3); } +static void Out_digit (int64 n, CHAR *s, LONGINT s__len, int16 *i) +{ + *i -= 1; + s[__X(*i, s__len)] = (CHAR)(__MOD(n, 10) + 48); +} + +static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16 *i) +{ + int16 j, l; + __DUP(t, t__len, CHAR); + l = Strings_Length(t, t__len); + if (l > *i) { + l = *i; + } + *i -= l; + j = 0; + while (j < l) { + s[__X(*i + j, s__len)] = t[__X(j, t__len)]; + j += 1; + } + __DEL(t); +} + +REAL Out_Ten (int16 e) +{ + REAL _o_result; + LONGREAL r, power; + r = (LONGREAL)1; + power = (LONGREAL)10; + while (e > 0) { + if (__ODD(e)) { + r = r * power; + } + power = power * power; + e = __ASHR(e, 1); + } + _o_result = r; + return _o_result; +} + +void Out_Real (REAL x, int16 n) +{ + int16 e; + int32 f; + CHAR s[30]; + int16 i; + REAL x0; + BOOLEAN nn, en; + int32 m; + int16 d; + nn = __VAL(int32, x) < 0; + if (nn) { + n -= 1; + } + e = (int16)__MASK(__ASHR(__VAL(int32, x), 23), -256); + f = __MASK(__VAL(int32, x), -8388608); + i = 30; + if (e == 255) { + if (f == 0) { + Out_prepend((CHAR*)"Infinity", 9, (void*)s, 30, &i); + } else { + Out_prepend((CHAR*)"NaN", 4, (void*)s, 30, &i); + } + } else { + if (e == 0) { + Out_prepend((CHAR*)"E+00", 5, (void*)s, 30, &i); + m = 0; + } else { + if (nn) { + x = -x; + } + e = __ASHR((e - 127) * 77, 8); + if (e >= 0) { + x = x / (REAL)Out_Ten(e); + } else { + x = Out_Ten(-e) * x; + } + if (x >= (REAL)10) { + x = 1.0000000e-001 * x; + e += 1; + } + en = e < 0; + if (en) { + e = -e; + } + d = 2; + while (d > 0) { + Out_digit(e, (void*)s, 30, &i); + e = __DIV(e, 10); + d -= 1; + } + if (en) { + Out_prepend((CHAR*)"E-", 3, (void*)s, 30, &i); + } else { + Out_prepend((CHAR*)"E+", 3, (void*)s, 30, &i); + } + x0 = Out_Ten(7); + x = x0 * x + 5.0000000e-001; + if (x >= (REAL)10 * x0) { + x = 1.0000000e-001 * x; + e += 1; + } + m = Out_Entier32(x); + } + d = 8; + while ((((d > 2 && d > n - 5)) && (int)__MOD(m, 10) == 0)) { + m = __DIV(m, 10); + d -= 1; + } + while (d > 1) { + Out_digit(m, (void*)s, 30, &i); + m = __DIV(m, 10); + d -= 1; + } + i -= 1; + s[__X(i, 30)] = '.'; + Out_digit(m, (void*)s, 30, &i); + } + n -= 30 - i; + while (n > 0) { + Out_Char(' '); + n -= 1; + } + if (nn) { + Out_Char('-'); + } + while (i < 30) { + Out_Char(s[__X(i, 30)]); + i += 1; + } +} + +static LONGREAL Out_TenL (int16 e) +{ + LONGREAL _o_result; + LONGREAL r, power; + r = (LONGREAL)1; + power = (LONGREAL)10; + while (e > 0) { + if (__ODD(e)) { + r = r * power; + } + power = power * power; + e = __ASHR(e, 1); + } + _o_result = r; + return _o_result; +} + +void Out_LongReal (LONGREAL x, int16 n) +{ + int16 e; + int64 f; + CHAR s[30]; + int16 i; + LONGREAL x0; + BOOLEAN nn, en; + int64 m; + int16 d; + nn = __VAL(int64, x) < 0; + if (nn) { + n -= 1; + } + e = (int16)__MASK(__ASHR((__VAL(int64, x)), 52), -2048); + f = __MASK((__VAL(int64, x)), -4503599627370496); + i = 30; + if (e == 2047) { + if (f == 0) { + Out_prepend((CHAR*)"Infinity", 9, (void*)s, 30, &i); + } else { + Out_prepend((CHAR*)"NaN", 4, (void*)s, 30, &i); + } + } else { + if (e == 0) { + Out_prepend((CHAR*)"D+000", 6, (void*)s, 30, &i); + m = 0; + } else { + if (nn) { + x = -x; + } + e = (int16)__ASHR((e - 1023) * 77, 8); + if (e >= 0) { + x = x / (LONGREAL)Out_TenL(e); + } else { + x = Out_TenL(-e) * x; + } + if (x >= (LONGREAL)10) { + x = 1.00000000000000e-001 * x; + e += 1; + } + en = e < 0; + if (en) { + e = -e; + } + d = 3; + while (d > 0) { + Out_digit(e, (void*)s, 30, &i); + e = __DIV(e, 10); + d -= 1; + } + if (en) { + Out_prepend((CHAR*)"D-", 3, (void*)s, 30, &i); + } else { + Out_prepend((CHAR*)"D+", 3, (void*)s, 30, &i); + } + x0 = Out_TenL(15); + x = x0 * x + 5.00000000000000e-001; + if (x >= (LONGREAL)10 * x0) { + x = 1.00000000000000e-001 * x; + e += 1; + } + m = Out_Entier64(x); + } + d = 16; + while ((((d > 2 && d > n - 6)) && __MOD(m, 10) == 0)) { + m = __DIV(m, 10); + d -= 1; + } + while (d > 1) { + Out_digit(m, (void*)s, 30, &i); + m = __DIV(m, 10); + d -= 1; + } + i -= 1; + s[__X(i, 30)] = '.'; + Out_digit(m, (void*)s, 30, &i); + } + n -= 30 - i; + while (n > 0) { + Out_Char(' '); + n -= 1; + } + if (nn) { + Out_Char('-'); + } + while (i < 30) { + Out_Char(s[__X(i, 30)]); + i += 1; + } +} + export void *Out__init(void) { __DEFMOD; __MODULE_IMPORT(Platform); + __MODULE_IMPORT(Strings); __REGMOD("Out", 0); __REGCMD("Ln", Out_Ln); __REGCMD("Open", Out_Open); diff --git a/bootstrap/unix-44/Out.h b/bootstrap/unix-44/Out.h index 4d3199e6..9076f6d1 100644 --- a/bootstrap/unix-44/Out.h +++ b/bootstrap/unix-44/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h @@ -15,6 +15,7 @@ import void Out_LongReal (LONGREAL x, int16 n); import void Out_Open (void); import void Out_Real (REAL x, int16 n); import void Out_String (CHAR *str, LONGINT str__len); +import REAL Out_Ten (int16 e); import void *Out__init(void); diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index a550ad52..3ba187a5 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index eee301c1..a96c77e9 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 7d395538..4e18ac01 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index 98731ba9..5728d211 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index 7d4bf19a..37643e92 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index 939e74d8..b7482150 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index adb24e10..340d4654 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index ca5c6c89..0992f4eb 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/errors.c b/bootstrap/unix-44/errors.c index 49c6425d..5ecfeea1 100644 --- a/bootstrap/unix-44/errors.c +++ b/bootstrap/unix-44/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/errors.h b/bootstrap/unix-44/errors.h index e7ecd052..20eeca0d 100644 --- a/bootstrap/unix-44/errors.h +++ b/bootstrap/unix-44/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index b58bcc2a..b1328b1c 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index cb8a5a95..27684ca4 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-44/vt100.c b/bootstrap/unix-44/vt100.c index 92ed02e4..a2c7b023 100644 --- a/bootstrap/unix-44/vt100.c +++ b/bootstrap/unix-44/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/vt100.h b/bootstrap/unix-44/vt100.h index 393203ef..83b8a893 100644 --- a/bootstrap/unix-44/vt100.h +++ b/bootstrap/unix-44/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-48/Compiler.c b/bootstrap/unix-48/Compiler.c index f176c32c..2dd6f251 100644 --- a/bootstrap/unix-48/Compiler.c +++ b/bootstrap/unix-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index cd60e0eb..3498204c 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index 51248a3a..14d86591 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index dcdaea0d..cb7920a3 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index d902e57e..4a49d744 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index bf247ca6..860107f9 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index 2b27eb13..84c9bb20 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index 19cf402a..ab3bb29b 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index eb8d7d25..95fc4f94 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index 4df43c2a..bfc64251 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index bab5adcc..d04325c7 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index fd8f546f..54cd9a85 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index 662ac74a..69a5580c 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 8430bf82..7da9b7b0 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index d7aadb69..d2a06df9 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index 016b40ed..768bfd2c 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index 90da6ba9..ee87db69 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index f7f892bf..02c301dc 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index d97f3caa..98dd65e7 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 911d49ab..7ebdfd73 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index 88225ce2..f5b615f8 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index 65f5d6d9..ce5e3036 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index ab72377c..43fd6331 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Out.c b/bootstrap/unix-48/Out.c index 66f4fc90..37cb4c91 100644 --- a/bootstrap/unix-48/Out.c +++ b/bootstrap/unix-48/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -7,6 +7,7 @@ #include "SYSTEM.h" #include "Platform.h" +#include "Strings.h" @@ -18,7 +19,13 @@ export void Out_LongReal (LONGREAL x, int16 n); export void Out_Open (void); export void Out_Real (REAL x, int16 n); export void Out_String (CHAR *str, LONGINT str__len); +export REAL Out_Ten (int16 e); +static LONGREAL Out_TenL (int16 e); +static void Out_digit (int64 n, CHAR *s, LONGINT s__len, int16 *i); +static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16 *i); +#define Out_Entier32(x) (int32)(x) +#define Out_Entier64(x) (int64)(x) void Out_Open (void) { @@ -36,7 +43,7 @@ void Out_String (CHAR *str, LONGINT str__len) int16 error; __DUP(str, str__len, CHAR); l = 0; - while ((l < str__len && str[l] != 0x00)) { + while ((l < str__len && str[__X(l, str__len)] != 0x00)) { l += 1; } error = Platform_Write(1, (address)str, l); @@ -60,13 +67,13 @@ void Out_Int (int64 x, int64 n) x = __DIV(x, 10); i = 1; while (x != 0) { - s[i] = (CHAR)(48 + __MOD(x, 10)); + s[__X(i, 22)] = (CHAR)(48 + __MOD(x, 10)); x = __DIV(x, 10); i += 1; } } if (negative) { - s[i] = '-'; + s[__X(i, 22)] = '-'; i += 1; } while (n > (int64)i) { @@ -75,28 +82,262 @@ void Out_Int (int64 x, int64 n) } while (i > 0) { i -= 1; - Out_Char(s[i]); + Out_Char(s[__X(i, 22)]); } } -void Out_Real (REAL x, int16 n) -{ -} - -void Out_LongReal (LONGREAL x, int16 n) -{ -} - void Out_Ln (void) { Out_String(Platform_NL, 3); } +static void Out_digit (int64 n, CHAR *s, LONGINT s__len, int16 *i) +{ + *i -= 1; + s[__X(*i, s__len)] = (CHAR)(__MOD(n, 10) + 48); +} + +static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16 *i) +{ + int16 j, l; + __DUP(t, t__len, CHAR); + l = Strings_Length(t, t__len); + if (l > *i) { + l = *i; + } + *i -= l; + j = 0; + while (j < l) { + s[__X(*i + j, s__len)] = t[__X(j, t__len)]; + j += 1; + } + __DEL(t); +} + +REAL Out_Ten (int16 e) +{ + REAL _o_result; + LONGREAL r, power; + r = (LONGREAL)1; + power = (LONGREAL)10; + while (e > 0) { + if (__ODD(e)) { + r = r * power; + } + power = power * power; + e = __ASHR(e, 1); + } + _o_result = r; + return _o_result; +} + +void Out_Real (REAL x, int16 n) +{ + int16 e; + int32 f; + CHAR s[30]; + int16 i; + REAL x0; + BOOLEAN nn, en; + int32 m; + int16 d; + nn = __VAL(int32, x) < 0; + if (nn) { + n -= 1; + } + e = (int16)__MASK(__ASHR(__VAL(int32, x), 23), -256); + f = __MASK(__VAL(int32, x), -8388608); + i = 30; + if (e == 255) { + if (f == 0) { + Out_prepend((CHAR*)"Infinity", 9, (void*)s, 30, &i); + } else { + Out_prepend((CHAR*)"NaN", 4, (void*)s, 30, &i); + } + } else { + if (e == 0) { + Out_prepend((CHAR*)"E+00", 5, (void*)s, 30, &i); + m = 0; + } else { + if (nn) { + x = -x; + } + e = __ASHR((e - 127) * 77, 8); + if (e >= 0) { + x = x / (REAL)Out_Ten(e); + } else { + x = Out_Ten(-e) * x; + } + if (x >= (REAL)10) { + x = 1.0000000e-001 * x; + e += 1; + } + en = e < 0; + if (en) { + e = -e; + } + d = 2; + while (d > 0) { + Out_digit(e, (void*)s, 30, &i); + e = __DIV(e, 10); + d -= 1; + } + if (en) { + Out_prepend((CHAR*)"E-", 3, (void*)s, 30, &i); + } else { + Out_prepend((CHAR*)"E+", 3, (void*)s, 30, &i); + } + x0 = Out_Ten(7); + x = x0 * x + 5.0000000e-001; + if (x >= (REAL)10 * x0) { + x = 1.0000000e-001 * x; + e += 1; + } + m = Out_Entier32(x); + } + d = 8; + while ((((d > 2 && d > n - 5)) && (int)__MOD(m, 10) == 0)) { + m = __DIV(m, 10); + d -= 1; + } + while (d > 1) { + Out_digit(m, (void*)s, 30, &i); + m = __DIV(m, 10); + d -= 1; + } + i -= 1; + s[__X(i, 30)] = '.'; + Out_digit(m, (void*)s, 30, &i); + } + n -= 30 - i; + while (n > 0) { + Out_Char(' '); + n -= 1; + } + if (nn) { + Out_Char('-'); + } + while (i < 30) { + Out_Char(s[__X(i, 30)]); + i += 1; + } +} + +static LONGREAL Out_TenL (int16 e) +{ + LONGREAL _o_result; + LONGREAL r, power; + r = (LONGREAL)1; + power = (LONGREAL)10; + while (e > 0) { + if (__ODD(e)) { + r = r * power; + } + power = power * power; + e = __ASHR(e, 1); + } + _o_result = r; + return _o_result; +} + +void Out_LongReal (LONGREAL x, int16 n) +{ + int16 e; + int64 f; + CHAR s[30]; + int16 i; + LONGREAL x0; + BOOLEAN nn, en; + int64 m; + int16 d; + nn = __VAL(int64, x) < 0; + if (nn) { + n -= 1; + } + e = (int16)__MASK(__ASHR((__VAL(int64, x)), 52), -2048); + f = __MASK((__VAL(int64, x)), -4503599627370496); + i = 30; + if (e == 2047) { + if (f == 0) { + Out_prepend((CHAR*)"Infinity", 9, (void*)s, 30, &i); + } else { + Out_prepend((CHAR*)"NaN", 4, (void*)s, 30, &i); + } + } else { + if (e == 0) { + Out_prepend((CHAR*)"D+000", 6, (void*)s, 30, &i); + m = 0; + } else { + if (nn) { + x = -x; + } + e = (int16)__ASHR((e - 1023) * 77, 8); + if (e >= 0) { + x = x / (LONGREAL)Out_TenL(e); + } else { + x = Out_TenL(-e) * x; + } + if (x >= (LONGREAL)10) { + x = 1.00000000000000e-001 * x; + e += 1; + } + en = e < 0; + if (en) { + e = -e; + } + d = 3; + while (d > 0) { + Out_digit(e, (void*)s, 30, &i); + e = __DIV(e, 10); + d -= 1; + } + if (en) { + Out_prepend((CHAR*)"D-", 3, (void*)s, 30, &i); + } else { + Out_prepend((CHAR*)"D+", 3, (void*)s, 30, &i); + } + x0 = Out_TenL(15); + x = x0 * x + 5.00000000000000e-001; + if (x >= (LONGREAL)10 * x0) { + x = 1.00000000000000e-001 * x; + e += 1; + } + m = Out_Entier64(x); + } + d = 16; + while ((((d > 2 && d > n - 6)) && __MOD(m, 10) == 0)) { + m = __DIV(m, 10); + d -= 1; + } + while (d > 1) { + Out_digit(m, (void*)s, 30, &i); + m = __DIV(m, 10); + d -= 1; + } + i -= 1; + s[__X(i, 30)] = '.'; + Out_digit(m, (void*)s, 30, &i); + } + n -= 30 - i; + while (n > 0) { + Out_Char(' '); + n -= 1; + } + if (nn) { + Out_Char('-'); + } + while (i < 30) { + Out_Char(s[__X(i, 30)]); + i += 1; + } +} + export void *Out__init(void) { __DEFMOD; __MODULE_IMPORT(Platform); + __MODULE_IMPORT(Strings); __REGMOD("Out", 0); __REGCMD("Ln", Out_Ln); __REGCMD("Open", Out_Open); diff --git a/bootstrap/unix-48/Out.h b/bootstrap/unix-48/Out.h index 4d3199e6..9076f6d1 100644 --- a/bootstrap/unix-48/Out.h +++ b/bootstrap/unix-48/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h @@ -15,6 +15,7 @@ import void Out_LongReal (LONGREAL x, int16 n); import void Out_Open (void); import void Out_Real (REAL x, int16 n); import void Out_String (CHAR *str, LONGINT str__len); +import REAL Out_Ten (int16 e); import void *Out__init(void); diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index a550ad52..3ba187a5 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index eee301c1..a96c77e9 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 7d395538..4e18ac01 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index 98731ba9..5728d211 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index 7d4bf19a..37643e92 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index 939e74d8..b7482150 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index f6698990..92376713 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index baa9464f..107cdc6c 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/errors.c b/bootstrap/unix-48/errors.c index 49c6425d..5ecfeea1 100644 --- a/bootstrap/unix-48/errors.c +++ b/bootstrap/unix-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/errors.h b/bootstrap/unix-48/errors.h index e7ecd052..20eeca0d 100644 --- a/bootstrap/unix-48/errors.h +++ b/bootstrap/unix-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index b58bcc2a..b1328b1c 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index cb8a5a95..27684ca4 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/vt100.c b/bootstrap/unix-48/vt100.c index 92ed02e4..a2c7b023 100644 --- a/bootstrap/unix-48/vt100.c +++ b/bootstrap/unix-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/vt100.h b/bootstrap/unix-48/vt100.h index 393203ef..83b8a893 100644 --- a/bootstrap/unix-48/vt100.h +++ b/bootstrap/unix-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-88/Compiler.c b/bootstrap/unix-88/Compiler.c index f176c32c..2dd6f251 100644 --- a/bootstrap/unix-88/Compiler.c +++ b/bootstrap/unix-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index cd60e0eb..3498204c 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index 51248a3a..14d86591 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 05693822..2324bd31 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 74b0c2ac..5156a13d 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index d929bf31..e3aceaf6 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index c0f06627..29ed6e2f 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 3f625202..273f6c11 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index eb8d7d25..95fc4f94 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index 4df43c2a..bfc64251 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index bab5adcc..d04325c7 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index fd8f546f..54cd9a85 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index 662ac74a..69a5580c 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 69eb0109..ec6acf95 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index d7aadb69..d2a06df9 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index aa541ba7..ddd0d49c 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index 90da6ba9..ee87db69 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index f7f892bf..02c301dc 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index d97f3caa..98dd65e7 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index 5adea265..60915d55 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 88225ce2..f5b615f8 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 8a61c677..e3b8aff9 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index ab72377c..43fd6331 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Out.c b/bootstrap/unix-88/Out.c index 66f4fc90..37cb4c91 100644 --- a/bootstrap/unix-88/Out.c +++ b/bootstrap/unix-88/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -7,6 +7,7 @@ #include "SYSTEM.h" #include "Platform.h" +#include "Strings.h" @@ -18,7 +19,13 @@ export void Out_LongReal (LONGREAL x, int16 n); export void Out_Open (void); export void Out_Real (REAL x, int16 n); export void Out_String (CHAR *str, LONGINT str__len); +export REAL Out_Ten (int16 e); +static LONGREAL Out_TenL (int16 e); +static void Out_digit (int64 n, CHAR *s, LONGINT s__len, int16 *i); +static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16 *i); +#define Out_Entier32(x) (int32)(x) +#define Out_Entier64(x) (int64)(x) void Out_Open (void) { @@ -36,7 +43,7 @@ void Out_String (CHAR *str, LONGINT str__len) int16 error; __DUP(str, str__len, CHAR); l = 0; - while ((l < str__len && str[l] != 0x00)) { + while ((l < str__len && str[__X(l, str__len)] != 0x00)) { l += 1; } error = Platform_Write(1, (address)str, l); @@ -60,13 +67,13 @@ void Out_Int (int64 x, int64 n) x = __DIV(x, 10); i = 1; while (x != 0) { - s[i] = (CHAR)(48 + __MOD(x, 10)); + s[__X(i, 22)] = (CHAR)(48 + __MOD(x, 10)); x = __DIV(x, 10); i += 1; } } if (negative) { - s[i] = '-'; + s[__X(i, 22)] = '-'; i += 1; } while (n > (int64)i) { @@ -75,28 +82,262 @@ void Out_Int (int64 x, int64 n) } while (i > 0) { i -= 1; - Out_Char(s[i]); + Out_Char(s[__X(i, 22)]); } } -void Out_Real (REAL x, int16 n) -{ -} - -void Out_LongReal (LONGREAL x, int16 n) -{ -} - void Out_Ln (void) { Out_String(Platform_NL, 3); } +static void Out_digit (int64 n, CHAR *s, LONGINT s__len, int16 *i) +{ + *i -= 1; + s[__X(*i, s__len)] = (CHAR)(__MOD(n, 10) + 48); +} + +static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16 *i) +{ + int16 j, l; + __DUP(t, t__len, CHAR); + l = Strings_Length(t, t__len); + if (l > *i) { + l = *i; + } + *i -= l; + j = 0; + while (j < l) { + s[__X(*i + j, s__len)] = t[__X(j, t__len)]; + j += 1; + } + __DEL(t); +} + +REAL Out_Ten (int16 e) +{ + REAL _o_result; + LONGREAL r, power; + r = (LONGREAL)1; + power = (LONGREAL)10; + while (e > 0) { + if (__ODD(e)) { + r = r * power; + } + power = power * power; + e = __ASHR(e, 1); + } + _o_result = r; + return _o_result; +} + +void Out_Real (REAL x, int16 n) +{ + int16 e; + int32 f; + CHAR s[30]; + int16 i; + REAL x0; + BOOLEAN nn, en; + int32 m; + int16 d; + nn = __VAL(int32, x) < 0; + if (nn) { + n -= 1; + } + e = (int16)__MASK(__ASHR(__VAL(int32, x), 23), -256); + f = __MASK(__VAL(int32, x), -8388608); + i = 30; + if (e == 255) { + if (f == 0) { + Out_prepend((CHAR*)"Infinity", 9, (void*)s, 30, &i); + } else { + Out_prepend((CHAR*)"NaN", 4, (void*)s, 30, &i); + } + } else { + if (e == 0) { + Out_prepend((CHAR*)"E+00", 5, (void*)s, 30, &i); + m = 0; + } else { + if (nn) { + x = -x; + } + e = __ASHR((e - 127) * 77, 8); + if (e >= 0) { + x = x / (REAL)Out_Ten(e); + } else { + x = Out_Ten(-e) * x; + } + if (x >= (REAL)10) { + x = 1.0000000e-001 * x; + e += 1; + } + en = e < 0; + if (en) { + e = -e; + } + d = 2; + while (d > 0) { + Out_digit(e, (void*)s, 30, &i); + e = __DIV(e, 10); + d -= 1; + } + if (en) { + Out_prepend((CHAR*)"E-", 3, (void*)s, 30, &i); + } else { + Out_prepend((CHAR*)"E+", 3, (void*)s, 30, &i); + } + x0 = Out_Ten(7); + x = x0 * x + 5.0000000e-001; + if (x >= (REAL)10 * x0) { + x = 1.0000000e-001 * x; + e += 1; + } + m = Out_Entier32(x); + } + d = 8; + while ((((d > 2 && d > n - 5)) && (int)__MOD(m, 10) == 0)) { + m = __DIV(m, 10); + d -= 1; + } + while (d > 1) { + Out_digit(m, (void*)s, 30, &i); + m = __DIV(m, 10); + d -= 1; + } + i -= 1; + s[__X(i, 30)] = '.'; + Out_digit(m, (void*)s, 30, &i); + } + n -= 30 - i; + while (n > 0) { + Out_Char(' '); + n -= 1; + } + if (nn) { + Out_Char('-'); + } + while (i < 30) { + Out_Char(s[__X(i, 30)]); + i += 1; + } +} + +static LONGREAL Out_TenL (int16 e) +{ + LONGREAL _o_result; + LONGREAL r, power; + r = (LONGREAL)1; + power = (LONGREAL)10; + while (e > 0) { + if (__ODD(e)) { + r = r * power; + } + power = power * power; + e = __ASHR(e, 1); + } + _o_result = r; + return _o_result; +} + +void Out_LongReal (LONGREAL x, int16 n) +{ + int16 e; + int64 f; + CHAR s[30]; + int16 i; + LONGREAL x0; + BOOLEAN nn, en; + int64 m; + int16 d; + nn = __VAL(int64, x) < 0; + if (nn) { + n -= 1; + } + e = (int16)__MASK(__ASHR((__VAL(int64, x)), 52), -2048); + f = __MASK((__VAL(int64, x)), -4503599627370496); + i = 30; + if (e == 2047) { + if (f == 0) { + Out_prepend((CHAR*)"Infinity", 9, (void*)s, 30, &i); + } else { + Out_prepend((CHAR*)"NaN", 4, (void*)s, 30, &i); + } + } else { + if (e == 0) { + Out_prepend((CHAR*)"D+000", 6, (void*)s, 30, &i); + m = 0; + } else { + if (nn) { + x = -x; + } + e = (int16)__ASHR((e - 1023) * 77, 8); + if (e >= 0) { + x = x / (LONGREAL)Out_TenL(e); + } else { + x = Out_TenL(-e) * x; + } + if (x >= (LONGREAL)10) { + x = 1.00000000000000e-001 * x; + e += 1; + } + en = e < 0; + if (en) { + e = -e; + } + d = 3; + while (d > 0) { + Out_digit(e, (void*)s, 30, &i); + e = __DIV(e, 10); + d -= 1; + } + if (en) { + Out_prepend((CHAR*)"D-", 3, (void*)s, 30, &i); + } else { + Out_prepend((CHAR*)"D+", 3, (void*)s, 30, &i); + } + x0 = Out_TenL(15); + x = x0 * x + 5.00000000000000e-001; + if (x >= (LONGREAL)10 * x0) { + x = 1.00000000000000e-001 * x; + e += 1; + } + m = Out_Entier64(x); + } + d = 16; + while ((((d > 2 && d > n - 6)) && __MOD(m, 10) == 0)) { + m = __DIV(m, 10); + d -= 1; + } + while (d > 1) { + Out_digit(m, (void*)s, 30, &i); + m = __DIV(m, 10); + d -= 1; + } + i -= 1; + s[__X(i, 30)] = '.'; + Out_digit(m, (void*)s, 30, &i); + } + n -= 30 - i; + while (n > 0) { + Out_Char(' '); + n -= 1; + } + if (nn) { + Out_Char('-'); + } + while (i < 30) { + Out_Char(s[__X(i, 30)]); + i += 1; + } +} + export void *Out__init(void) { __DEFMOD; __MODULE_IMPORT(Platform); + __MODULE_IMPORT(Strings); __REGMOD("Out", 0); __REGCMD("Ln", Out_Ln); __REGCMD("Open", Out_Open); diff --git a/bootstrap/unix-88/Out.h b/bootstrap/unix-88/Out.h index 4d3199e6..9076f6d1 100644 --- a/bootstrap/unix-88/Out.h +++ b/bootstrap/unix-88/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h @@ -15,6 +15,7 @@ import void Out_LongReal (LONGREAL x, int16 n); import void Out_Open (void); import void Out_Real (REAL x, int16 n); import void Out_String (CHAR *str, LONGINT str__len); +import REAL Out_Ten (int16 e); import void *Out__init(void); diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 79765125..feddb176 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index ff4f1129..ffacb767 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 7d395538..4e18ac01 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index 98731ba9..5728d211 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index 7d4bf19a..37643e92 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index 939e74d8..b7482150 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index ebb0ff54..0d2f319e 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index b75c50d4..4b01b650 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/errors.c b/bootstrap/unix-88/errors.c index 49c6425d..5ecfeea1 100644 --- a/bootstrap/unix-88/errors.c +++ b/bootstrap/unix-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/errors.h b/bootstrap/unix-88/errors.h index e7ecd052..20eeca0d 100644 --- a/bootstrap/unix-88/errors.h +++ b/bootstrap/unix-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index b58bcc2a..b1328b1c 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index cb8a5a95..27684ca4 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/vt100.c b/bootstrap/unix-88/vt100.c index 92ed02e4..a2c7b023 100644 --- a/bootstrap/unix-88/vt100.c +++ b/bootstrap/unix-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/vt100.h b/bootstrap/unix-88/vt100.h index 393203ef..83b8a893 100644 --- a/bootstrap/unix-88/vt100.h +++ b/bootstrap/unix-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-48/Compiler.c b/bootstrap/windows-48/Compiler.c index f176c32c..2dd6f251 100644 --- a/bootstrap/windows-48/Compiler.c +++ b/bootstrap/windows-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index cd60e0eb..3498204c 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index 51248a3a..14d86591 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index d994f80e..a444fff2 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index ee2c6a91..a447dbad 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index bf247ca6..860107f9 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index 2b27eb13..84c9bb20 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index 19cf402a..ab3bb29b 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index eb8d7d25..95fc4f94 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index 4df43c2a..bfc64251 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index bab5adcc..d04325c7 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index fd8f546f..54cd9a85 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index 662ac74a..69a5580c 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 8430bf82..7da9b7b0 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index d7aadb69..d2a06df9 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index 016b40ed..768bfd2c 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index 90da6ba9..ee87db69 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index f7f892bf..02c301dc 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index d97f3caa..98dd65e7 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 911d49ab..7ebdfd73 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index 88225ce2..f5b615f8 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index 65f5d6d9..ce5e3036 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index ab72377c..43fd6331 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Out.c b/bootstrap/windows-48/Out.c index 6ea96ec6..790b4f75 100644 --- a/bootstrap/windows-48/Out.c +++ b/bootstrap/windows-48/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -7,6 +7,7 @@ #include "SYSTEM.h" #include "Platform.h" +#include "Strings.h" @@ -18,7 +19,13 @@ export void Out_LongReal (LONGREAL x, int16 n); export void Out_Open (void); export void Out_Real (REAL x, int16 n); export void Out_String (CHAR *str, LONGINT str__len); +export REAL Out_Ten (int16 e); +static LONGREAL Out_TenL (int16 e); +static void Out_digit (int64 n, CHAR *s, LONGINT s__len, int16 *i); +static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16 *i); +#define Out_Entier32(x) (int32)(x) +#define Out_Entier64(x) (int64)(x) void Out_Open (void) { @@ -36,7 +43,7 @@ void Out_String (CHAR *str, LONGINT str__len) int16 error; __DUP(str, str__len, CHAR); l = 0; - while ((l < str__len && str[l] != 0x00)) { + while ((l < str__len && str[__X(l, str__len)] != 0x00)) { l += 1; } error = Platform_Write(Platform_StdOut, (address)str, l); @@ -60,13 +67,13 @@ void Out_Int (int64 x, int64 n) x = __DIV(x, 10); i = 1; while (x != 0) { - s[i] = (CHAR)(48 + __MOD(x, 10)); + s[__X(i, 22)] = (CHAR)(48 + __MOD(x, 10)); x = __DIV(x, 10); i += 1; } } if (negative) { - s[i] = '-'; + s[__X(i, 22)] = '-'; i += 1; } while (n > (int64)i) { @@ -75,28 +82,262 @@ void Out_Int (int64 x, int64 n) } while (i > 0) { i -= 1; - Out_Char(s[i]); + Out_Char(s[__X(i, 22)]); } } -void Out_Real (REAL x, int16 n) -{ -} - -void Out_LongReal (LONGREAL x, int16 n) -{ -} - void Out_Ln (void) { Out_String(Platform_NL, 3); } +static void Out_digit (int64 n, CHAR *s, LONGINT s__len, int16 *i) +{ + *i -= 1; + s[__X(*i, s__len)] = (CHAR)(__MOD(n, 10) + 48); +} + +static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16 *i) +{ + int16 j, l; + __DUP(t, t__len, CHAR); + l = Strings_Length(t, t__len); + if (l > *i) { + l = *i; + } + *i -= l; + j = 0; + while (j < l) { + s[__X(*i + j, s__len)] = t[__X(j, t__len)]; + j += 1; + } + __DEL(t); +} + +REAL Out_Ten (int16 e) +{ + REAL _o_result; + LONGREAL r, power; + r = (LONGREAL)1; + power = (LONGREAL)10; + while (e > 0) { + if (__ODD(e)) { + r = r * power; + } + power = power * power; + e = __ASHR(e, 1); + } + _o_result = r; + return _o_result; +} + +void Out_Real (REAL x, int16 n) +{ + int16 e; + int32 f; + CHAR s[30]; + int16 i; + REAL x0; + BOOLEAN nn, en; + int32 m; + int16 d; + nn = __VAL(int32, x) < 0; + if (nn) { + n -= 1; + } + e = (int16)__MASK(__ASHR(__VAL(int32, x), 23), -256); + f = __MASK(__VAL(int32, x), -8388608); + i = 30; + if (e == 255) { + if (f == 0) { + Out_prepend((CHAR*)"Infinity", 9, (void*)s, 30, &i); + } else { + Out_prepend((CHAR*)"NaN", 4, (void*)s, 30, &i); + } + } else { + if (e == 0) { + Out_prepend((CHAR*)"E+00", 5, (void*)s, 30, &i); + m = 0; + } else { + if (nn) { + x = -x; + } + e = __ASHR((e - 127) * 77, 8); + if (e >= 0) { + x = x / (REAL)Out_Ten(e); + } else { + x = Out_Ten(-e) * x; + } + if (x >= (REAL)10) { + x = 1.0000000e-001 * x; + e += 1; + } + en = e < 0; + if (en) { + e = -e; + } + d = 2; + while (d > 0) { + Out_digit(e, (void*)s, 30, &i); + e = __DIV(e, 10); + d -= 1; + } + if (en) { + Out_prepend((CHAR*)"E-", 3, (void*)s, 30, &i); + } else { + Out_prepend((CHAR*)"E+", 3, (void*)s, 30, &i); + } + x0 = Out_Ten(7); + x = x0 * x + 5.0000000e-001; + if (x >= (REAL)10 * x0) { + x = 1.0000000e-001 * x; + e += 1; + } + m = Out_Entier32(x); + } + d = 8; + while ((((d > 2 && d > n - 5)) && (int)__MOD(m, 10) == 0)) { + m = __DIV(m, 10); + d -= 1; + } + while (d > 1) { + Out_digit(m, (void*)s, 30, &i); + m = __DIV(m, 10); + d -= 1; + } + i -= 1; + s[__X(i, 30)] = '.'; + Out_digit(m, (void*)s, 30, &i); + } + n -= 30 - i; + while (n > 0) { + Out_Char(' '); + n -= 1; + } + if (nn) { + Out_Char('-'); + } + while (i < 30) { + Out_Char(s[__X(i, 30)]); + i += 1; + } +} + +static LONGREAL Out_TenL (int16 e) +{ + LONGREAL _o_result; + LONGREAL r, power; + r = (LONGREAL)1; + power = (LONGREAL)10; + while (e > 0) { + if (__ODD(e)) { + r = r * power; + } + power = power * power; + e = __ASHR(e, 1); + } + _o_result = r; + return _o_result; +} + +void Out_LongReal (LONGREAL x, int16 n) +{ + int16 e; + int64 f; + CHAR s[30]; + int16 i; + LONGREAL x0; + BOOLEAN nn, en; + int64 m; + int16 d; + nn = __VAL(int64, x) < 0; + if (nn) { + n -= 1; + } + e = (int16)__MASK(__ASHR((__VAL(int64, x)), 52), -2048); + f = __MASK((__VAL(int64, x)), -4503599627370496); + i = 30; + if (e == 2047) { + if (f == 0) { + Out_prepend((CHAR*)"Infinity", 9, (void*)s, 30, &i); + } else { + Out_prepend((CHAR*)"NaN", 4, (void*)s, 30, &i); + } + } else { + if (e == 0) { + Out_prepend((CHAR*)"D+000", 6, (void*)s, 30, &i); + m = 0; + } else { + if (nn) { + x = -x; + } + e = (int16)__ASHR((e - 1023) * 77, 8); + if (e >= 0) { + x = x / (LONGREAL)Out_TenL(e); + } else { + x = Out_TenL(-e) * x; + } + if (x >= (LONGREAL)10) { + x = 1.00000000000000e-001 * x; + e += 1; + } + en = e < 0; + if (en) { + e = -e; + } + d = 3; + while (d > 0) { + Out_digit(e, (void*)s, 30, &i); + e = __DIV(e, 10); + d -= 1; + } + if (en) { + Out_prepend((CHAR*)"D-", 3, (void*)s, 30, &i); + } else { + Out_prepend((CHAR*)"D+", 3, (void*)s, 30, &i); + } + x0 = Out_TenL(15); + x = x0 * x + 5.00000000000000e-001; + if (x >= (LONGREAL)10 * x0) { + x = 1.00000000000000e-001 * x; + e += 1; + } + m = Out_Entier64(x); + } + d = 16; + while ((((d > 2 && d > n - 6)) && __MOD(m, 10) == 0)) { + m = __DIV(m, 10); + d -= 1; + } + while (d > 1) { + Out_digit(m, (void*)s, 30, &i); + m = __DIV(m, 10); + d -= 1; + } + i -= 1; + s[__X(i, 30)] = '.'; + Out_digit(m, (void*)s, 30, &i); + } + n -= 30 - i; + while (n > 0) { + Out_Char(' '); + n -= 1; + } + if (nn) { + Out_Char('-'); + } + while (i < 30) { + Out_Char(s[__X(i, 30)]); + i += 1; + } +} + export void *Out__init(void) { __DEFMOD; __MODULE_IMPORT(Platform); + __MODULE_IMPORT(Strings); __REGMOD("Out", 0); __REGCMD("Ln", Out_Ln); __REGCMD("Open", Out_Open); diff --git a/bootstrap/windows-48/Out.h b/bootstrap/windows-48/Out.h index 4d3199e6..9076f6d1 100644 --- a/bootstrap/windows-48/Out.h +++ b/bootstrap/windows-48/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h @@ -15,6 +15,7 @@ import void Out_LongReal (LONGREAL x, int16 n); import void Out_Open (void); import void Out_Real (REAL x, int16 n); import void Out_String (CHAR *str, LONGINT str__len); +import REAL Out_Ten (int16 e); import void *Out__init(void); diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index f88bbad9..3e82ab82 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index e1231b49..c5ff14b6 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 7d395538..4e18ac01 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index 98731ba9..5728d211 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index 7d4bf19a..37643e92 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index 939e74d8..b7482150 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index f6698990..92376713 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index baa9464f..107cdc6c 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/errors.c b/bootstrap/windows-48/errors.c index 49c6425d..5ecfeea1 100644 --- a/bootstrap/windows-48/errors.c +++ b/bootstrap/windows-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/errors.h b/bootstrap/windows-48/errors.h index e7ecd052..20eeca0d 100644 --- a/bootstrap/windows-48/errors.h +++ b/bootstrap/windows-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index b58bcc2a..b1328b1c 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index cb8a5a95..27684ca4 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/vt100.c b/bootstrap/windows-48/vt100.c index 92ed02e4..a2c7b023 100644 --- a/bootstrap/windows-48/vt100.c +++ b/bootstrap/windows-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/vt100.h b/bootstrap/windows-48/vt100.h index 393203ef..83b8a893 100644 --- a/bootstrap/windows-48/vt100.h +++ b/bootstrap/windows-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-88/Compiler.c b/bootstrap/windows-88/Compiler.c index f176c32c..2dd6f251 100644 --- a/bootstrap/windows-88/Compiler.c +++ b/bootstrap/windows-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index cd60e0eb..3498204c 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index 51248a3a..14d86591 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 06562971..dd50c47a 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index f2adf7f8..99068de9 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index d929bf31..e3aceaf6 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index c0f06627..29ed6e2f 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 3f625202..273f6c11 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index eb8d7d25..95fc4f94 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index 4df43c2a..bfc64251 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index bab5adcc..d04325c7 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index fd8f546f..54cd9a85 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index 662ac74a..69a5580c 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 69eb0109..ec6acf95 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index d7aadb69..d2a06df9 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index aa541ba7..ddd0d49c 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index 90da6ba9..ee87db69 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index f7f892bf..02c301dc 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index d97f3caa..98dd65e7 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index 5adea265..60915d55 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 88225ce2..f5b615f8 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 8a61c677..e3b8aff9 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index ab72377c..43fd6331 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Out.c b/bootstrap/windows-88/Out.c index 6ea96ec6..790b4f75 100644 --- a/bootstrap/windows-88/Out.c +++ b/bootstrap/windows-88/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -7,6 +7,7 @@ #include "SYSTEM.h" #include "Platform.h" +#include "Strings.h" @@ -18,7 +19,13 @@ export void Out_LongReal (LONGREAL x, int16 n); export void Out_Open (void); export void Out_Real (REAL x, int16 n); export void Out_String (CHAR *str, LONGINT str__len); +export REAL Out_Ten (int16 e); +static LONGREAL Out_TenL (int16 e); +static void Out_digit (int64 n, CHAR *s, LONGINT s__len, int16 *i); +static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16 *i); +#define Out_Entier32(x) (int32)(x) +#define Out_Entier64(x) (int64)(x) void Out_Open (void) { @@ -36,7 +43,7 @@ void Out_String (CHAR *str, LONGINT str__len) int16 error; __DUP(str, str__len, CHAR); l = 0; - while ((l < str__len && str[l] != 0x00)) { + while ((l < str__len && str[__X(l, str__len)] != 0x00)) { l += 1; } error = Platform_Write(Platform_StdOut, (address)str, l); @@ -60,13 +67,13 @@ void Out_Int (int64 x, int64 n) x = __DIV(x, 10); i = 1; while (x != 0) { - s[i] = (CHAR)(48 + __MOD(x, 10)); + s[__X(i, 22)] = (CHAR)(48 + __MOD(x, 10)); x = __DIV(x, 10); i += 1; } } if (negative) { - s[i] = '-'; + s[__X(i, 22)] = '-'; i += 1; } while (n > (int64)i) { @@ -75,28 +82,262 @@ void Out_Int (int64 x, int64 n) } while (i > 0) { i -= 1; - Out_Char(s[i]); + Out_Char(s[__X(i, 22)]); } } -void Out_Real (REAL x, int16 n) -{ -} - -void Out_LongReal (LONGREAL x, int16 n) -{ -} - void Out_Ln (void) { Out_String(Platform_NL, 3); } +static void Out_digit (int64 n, CHAR *s, LONGINT s__len, int16 *i) +{ + *i -= 1; + s[__X(*i, s__len)] = (CHAR)(__MOD(n, 10) + 48); +} + +static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16 *i) +{ + int16 j, l; + __DUP(t, t__len, CHAR); + l = Strings_Length(t, t__len); + if (l > *i) { + l = *i; + } + *i -= l; + j = 0; + while (j < l) { + s[__X(*i + j, s__len)] = t[__X(j, t__len)]; + j += 1; + } + __DEL(t); +} + +REAL Out_Ten (int16 e) +{ + REAL _o_result; + LONGREAL r, power; + r = (LONGREAL)1; + power = (LONGREAL)10; + while (e > 0) { + if (__ODD(e)) { + r = r * power; + } + power = power * power; + e = __ASHR(e, 1); + } + _o_result = r; + return _o_result; +} + +void Out_Real (REAL x, int16 n) +{ + int16 e; + int32 f; + CHAR s[30]; + int16 i; + REAL x0; + BOOLEAN nn, en; + int32 m; + int16 d; + nn = __VAL(int32, x) < 0; + if (nn) { + n -= 1; + } + e = (int16)__MASK(__ASHR(__VAL(int32, x), 23), -256); + f = __MASK(__VAL(int32, x), -8388608); + i = 30; + if (e == 255) { + if (f == 0) { + Out_prepend((CHAR*)"Infinity", 9, (void*)s, 30, &i); + } else { + Out_prepend((CHAR*)"NaN", 4, (void*)s, 30, &i); + } + } else { + if (e == 0) { + Out_prepend((CHAR*)"E+00", 5, (void*)s, 30, &i); + m = 0; + } else { + if (nn) { + x = -x; + } + e = __ASHR((e - 127) * 77, 8); + if (e >= 0) { + x = x / (REAL)Out_Ten(e); + } else { + x = Out_Ten(-e) * x; + } + if (x >= (REAL)10) { + x = 1.0000000e-001 * x; + e += 1; + } + en = e < 0; + if (en) { + e = -e; + } + d = 2; + while (d > 0) { + Out_digit(e, (void*)s, 30, &i); + e = __DIV(e, 10); + d -= 1; + } + if (en) { + Out_prepend((CHAR*)"E-", 3, (void*)s, 30, &i); + } else { + Out_prepend((CHAR*)"E+", 3, (void*)s, 30, &i); + } + x0 = Out_Ten(7); + x = x0 * x + 5.0000000e-001; + if (x >= (REAL)10 * x0) { + x = 1.0000000e-001 * x; + e += 1; + } + m = Out_Entier32(x); + } + d = 8; + while ((((d > 2 && d > n - 5)) && (int)__MOD(m, 10) == 0)) { + m = __DIV(m, 10); + d -= 1; + } + while (d > 1) { + Out_digit(m, (void*)s, 30, &i); + m = __DIV(m, 10); + d -= 1; + } + i -= 1; + s[__X(i, 30)] = '.'; + Out_digit(m, (void*)s, 30, &i); + } + n -= 30 - i; + while (n > 0) { + Out_Char(' '); + n -= 1; + } + if (nn) { + Out_Char('-'); + } + while (i < 30) { + Out_Char(s[__X(i, 30)]); + i += 1; + } +} + +static LONGREAL Out_TenL (int16 e) +{ + LONGREAL _o_result; + LONGREAL r, power; + r = (LONGREAL)1; + power = (LONGREAL)10; + while (e > 0) { + if (__ODD(e)) { + r = r * power; + } + power = power * power; + e = __ASHR(e, 1); + } + _o_result = r; + return _o_result; +} + +void Out_LongReal (LONGREAL x, int16 n) +{ + int16 e; + int64 f; + CHAR s[30]; + int16 i; + LONGREAL x0; + BOOLEAN nn, en; + int64 m; + int16 d; + nn = __VAL(int64, x) < 0; + if (nn) { + n -= 1; + } + e = (int16)__MASK(__ASHR((__VAL(int64, x)), 52), -2048); + f = __MASK((__VAL(int64, x)), -4503599627370496); + i = 30; + if (e == 2047) { + if (f == 0) { + Out_prepend((CHAR*)"Infinity", 9, (void*)s, 30, &i); + } else { + Out_prepend((CHAR*)"NaN", 4, (void*)s, 30, &i); + } + } else { + if (e == 0) { + Out_prepend((CHAR*)"D+000", 6, (void*)s, 30, &i); + m = 0; + } else { + if (nn) { + x = -x; + } + e = (int16)__ASHR((e - 1023) * 77, 8); + if (e >= 0) { + x = x / (LONGREAL)Out_TenL(e); + } else { + x = Out_TenL(-e) * x; + } + if (x >= (LONGREAL)10) { + x = 1.00000000000000e-001 * x; + e += 1; + } + en = e < 0; + if (en) { + e = -e; + } + d = 3; + while (d > 0) { + Out_digit(e, (void*)s, 30, &i); + e = __DIV(e, 10); + d -= 1; + } + if (en) { + Out_prepend((CHAR*)"D-", 3, (void*)s, 30, &i); + } else { + Out_prepend((CHAR*)"D+", 3, (void*)s, 30, &i); + } + x0 = Out_TenL(15); + x = x0 * x + 5.00000000000000e-001; + if (x >= (LONGREAL)10 * x0) { + x = 1.00000000000000e-001 * x; + e += 1; + } + m = Out_Entier64(x); + } + d = 16; + while ((((d > 2 && d > n - 6)) && __MOD(m, 10) == 0)) { + m = __DIV(m, 10); + d -= 1; + } + while (d > 1) { + Out_digit(m, (void*)s, 30, &i); + m = __DIV(m, 10); + d -= 1; + } + i -= 1; + s[__X(i, 30)] = '.'; + Out_digit(m, (void*)s, 30, &i); + } + n -= 30 - i; + while (n > 0) { + Out_Char(' '); + n -= 1; + } + if (nn) { + Out_Char('-'); + } + while (i < 30) { + Out_Char(s[__X(i, 30)]); + i += 1; + } +} + export void *Out__init(void) { __DEFMOD; __MODULE_IMPORT(Platform); + __MODULE_IMPORT(Strings); __REGMOD("Out", 0); __REGCMD("Ln", Out_Ln); __REGCMD("Open", Out_Open); diff --git a/bootstrap/windows-88/Out.h b/bootstrap/windows-88/Out.h index 4d3199e6..9076f6d1 100644 --- a/bootstrap/windows-88/Out.h +++ b/bootstrap/windows-88/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h @@ -15,6 +15,7 @@ import void Out_LongReal (LONGREAL x, int16 n); import void Out_Open (void); import void Out_Real (REAL x, int16 n); import void Out_String (CHAR *str, LONGINT str__len); +import REAL Out_Ten (int16 e); import void *Out__init(void); diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index e99e1be2..6f3c4e4f 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index 04c87a8c..1008cc4b 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 7d395538..4e18ac01 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index 98731ba9..5728d211 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index 7d4bf19a..37643e92 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index 939e74d8..b7482150 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index ebb0ff54..0d2f319e 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index b75c50d4..4b01b650 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/errors.c b/bootstrap/windows-88/errors.c index 49c6425d..5ecfeea1 100644 --- a/bootstrap/windows-88/errors.c +++ b/bootstrap/windows-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/errors.h b/bootstrap/windows-88/errors.h index e7ecd052..20eeca0d 100644 --- a/bootstrap/windows-88/errors.h +++ b/bootstrap/windows-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index b58bcc2a..b1328b1c 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index cb8a5a95..27684ca4 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/vt100.c b/bootstrap/windows-88/vt100.c index 92ed02e4..a2c7b023 100644 --- a/bootstrap/windows-88/vt100.c +++ b/bootstrap/windows-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/vt100.h b/bootstrap/windows-88/vt100.h index 393203ef..83b8a893 100644 --- a/bootstrap/windows-88/vt100.h +++ b/bootstrap/windows-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/src/runtime/Math.Mod b/src/runtime/Math.Mod index 216275ef..b3ca4e6a 100644 --- a/src/runtime/Math.Mod +++ b/src/runtime/Math.Mod @@ -271,7 +271,7 @@ END div; PROCEDURE^ arctan2* (xn, xd: REAL): REAL; PROCEDURE^ sincos* (x: REAL; VAR Sin, Cos: REAL); -PROCEDURE round * (x: REAL): LONGINT; +PROCEDURE round* (x: REAL): LONGINT; (* Returns the value of x rounded to the nearest integer *) BEGIN IF x < ZERO THEN RETURN -ENTIER(HALF - x) @@ -279,7 +279,7 @@ BEGIN END END round; -PROCEDURE sqrt * (x: REAL): REAL; +PROCEDURE sqrt* (x: REAL): REAL; (* Returns the positive square root of x where x >= 0 *) CONST P0 = 0.41731; P1 = 0.59016; @@ -306,7 +306,7 @@ BEGIN RETURN scale(yEst, xExp DIV 2) END sqrt; -PROCEDURE exp * (x: REAL): REAL; +PROCEDURE exp* (x: REAL): REAL; (* Returns the exponential of x for x < Ln(MAX(REAL)) *) CONST ln2 = 0.6931471805599453094172321D0; @@ -328,7 +328,7 @@ BEGIN RETURN scale(HALF + p/(q - p), SHORT(n + 1)) END exp; -PROCEDURE ln * (x: REAL): REAL; +PROCEDURE ln* (x: REAL): REAL; (* Returns the natural logarithm of x for x > 0 *) CONST c1 = 355.0/512.0; c2 = -2.121944400546905827679E-4; @@ -354,7 +354,7 @@ END ln; (* The angle in all trigonometric functions is measured in radians *) -PROCEDURE sin * (x: REAL): REAL; +PROCEDURE sin* (x: REAL): REAL; (* Returns the sine of x for all x *) BEGIN IF x < ZERO THEN RETURN SinCos(x, -x, -ONE) @@ -362,13 +362,13 @@ BEGIN END END sin; -PROCEDURE cos * (x: REAL): REAL; +PROCEDURE cos* (x: REAL): REAL; (* Returns the cosine of x for all x *) BEGIN RETURN SinCos(x, ABS(x) + piByTwo, ONE) END cos; -PROCEDURE tan * (x: REAL): REAL; +PROCEDURE tan* (x: REAL): REAL; (* Returns the tangent of x where x cannot be an odd multiple of pi/2 *) CONST ymax = 6434; (* ENTIER(2 * *(MantBits/2) * pi/2) *) @@ -428,7 +428,7 @@ BEGIN END END asincos; -PROCEDURE arcsin * (x: REAL): REAL; +PROCEDURE arcsin* (x: REAL): REAL; (* Returns the arcsine of x, in the range [ - pi/2, pi/2] where -1 <= x <= 1 *) VAR res: REAL; i: LONGINT; @@ -442,7 +442,7 @@ BEGIN RETURN res END arcsin; -PROCEDURE arccos * (x: REAL): REAL; +PROCEDURE arccos* (x: REAL): REAL; (* Returns the arccosine of x, in the range [0, pi] where -1 <= x <= 1 *) VAR res: REAL; i: LONGINT; @@ -497,7 +497,7 @@ BEGIN RETURN res END atan; -PROCEDURE arctan * (x: REAL): REAL; +PROCEDURE arctan* (x: REAL): REAL; (* Returns the arctangent of x, in the range [ - pi/2, pi/2] for all x *) BEGIN IF x < 0 THEN RETURN -atan( - x) @@ -505,7 +505,7 @@ BEGIN END END arctan; -PROCEDURE power * (base, exp: REAL): REAL; +PROCEDURE power* (base, exp: REAL): REAL; (* Returns the value of the number base raised to the power exponent for base > 0 *) CONST P1 = 0.83357541E-1; K = 0.4426950409; @@ -558,7 +558,7 @@ BEGIN RETURN scale(z, SHORT(mp)) END power; -PROCEDURE IsRMathException * (): BOOLEAN; +PROCEDURE IsRMathException* (): BOOLEAN; (* Returns TRUE if the current coroutine is in the exceptional execution state because of the raising of the RealMath exception; otherwise returns FALSE. *) diff --git a/src/runtime/MathL.Mod b/src/runtime/MathL.Mod index c3355d2e..69f994bb 100644 --- a/src/runtime/MathL.Mod +++ b/src/runtime/MathL.Mod @@ -96,7 +96,7 @@ CONST ONE = 1.0D0; HALF = 0.5D0; TWO = 2.0D0; - miny = ONE/large; (* Smallest number this package accepts *) + miny = ONE/large; (* Smallest number this package accepts *) sqrtHalf = 0.70710678118654752440D0; Limit = 1.0536712D-8; (* 2**(-MantBits/2) *) eps = 5.5511151D-17; (* 2**(-MantBits-1) *) diff --git a/src/runtime/Out.Mod b/src/runtime/Out.Mod index 66db1944..72287c56 100644 --- a/src/runtime/Out.Mod +++ b/src/runtime/Out.Mod @@ -1,6 +1,6 @@ -MODULE Out; (* D C W Brown. 2016-09-27 *) +MODULE Out; (* DCW Brown. 2016-09-27 *) - IMPORT SYSTEM, Platform; +IMPORT SYSTEM, Platform, Strings; PROCEDURE Open*; BEGIN @@ -40,16 +40,190 @@ BEGIN WHILE i > 0 DO DEC(i); Char(s[i]) END END Int; -PROCEDURE Real*(x: REAL; n: INTEGER); -BEGIN -END Real; - -PROCEDURE LongReal*(x: LONGREAL; n: INTEGER); -BEGIN -END LongReal; - PROCEDURE Ln*; BEGIN String(Platform.NL) END Ln; + +(* Real and Longreal display *) + +PROCEDURE digit(n: HUGEINT; VAR s: ARRAY OF CHAR; VAR i: INTEGER); +BEGIN + DEC(i); s[i] := CHR(n MOD 10 + 48); +END digit; + +PROCEDURE prepend(t: ARRAY OF CHAR; VAR s: ARRAY OF CHAR; VAR i: INTEGER); + VAR j, l: INTEGER; +BEGIN + l := Strings.Length(t); IF l > i THEN l := i END; + DEC(i, l); j := 0; + WHILE j < l DO s[i+j] := t[j]; INC(j) END +END prepend; + + +PROCEDURE Ten*(e: INTEGER): REAL; +VAR r, power: LONGREAL; +BEGIN r := 1.0; power := 10.0; + WHILE e > 0 DO + IF ODD(e) THEN r := r*power END; + power := power*power; e := e DIV 2 + END; + RETURN SHORT(r) +END Ten; + +PROCEDURE -Entier32(x: REAL): SYSTEM.INT32 "(int32)(x)"; + +PROCEDURE Real*(x: REAL; n: INTEGER); + +(* Real(x, n) writes the real number x to the end of the output stream using an + exponential form. If the textual representation of x requires m characters (including a + two-digit signed exponent), x is right adjusted in a ï¬eld of Max(n, m) characters padded + with blanks at the left end. A plus sign of the mantissa is not written. + REAL is 1/sign, 8/exponent, 23/significand *) + +CONST + maxsigdigits = 8; (* Max significant digits to display from mantissa *) + +VAR + e: INTEGER; (* Exponent field *) + f: SYSTEM.INT32; (* Fraction field *) + s: ARRAY 30 OF CHAR; (* Buffer built backwards *) + i: INTEGER; (* Index into s *) + x0: REAL; + nn: BOOLEAN; (* Number negative *) + en: BOOLEAN; (* Exponent negative *) + m: SYSTEM.INT32; (* Mantissa digits *) + d: INTEGER; (* Significant digit count to display *) + +BEGIN + nn := SYSTEM.VAL(SYSTEM.INT32, x) < 0; IF nn THEN DEC(n) END; + e := SYSTEM.VAL(INTEGER, (SYSTEM.VAL(SYSTEM.INT32, x) DIV 800000H) MOD 100H); + f := SYSTEM.VAL(SYSTEM.INT32, x) MOD 800000H; + + i := LEN(s); + IF e = 0FFH THEN (* NaN / Infinity *) + IF f = 0 THEN prepend("Infinity", s, i) ELSE prepend("NaN", s, i) END + ELSE + IF e = 0 THEN prepend("E+00", s, i); m := 0; + ELSE + IF nn THEN x := -x END; + + (* Scale e to be an exponent of 10 rather than 2 *) + e := (e - 127) * 77 DIV 256; + IF e >= 0 THEN x := x / Ten(e) ELSE x := Ten(-e) * x END ; + IF x >= 10.0 THEN x := 0.1 * x; INC(e) END; + + (* Generate the exponent digits *) + en := e < 0; IF en THEN e := - e END; + d := 2; WHILE d > 0 DO digit(e, s, i); e := e DIV 10; DEC(d) END; + IF en THEN prepend("E-", s, i) ELSE prepend("E+", s, i) END; + + (* Scale x to 8 significant digits *) + x0 := Ten(maxsigdigits-1); x := x0*x + 0.5; + IF x >= 10.0*x0 THEN x := 0.1*x; INC(e) END; + m := Entier32(x) + END; + + (* Drop trailing zeroes where we don't have room *) + d := maxsigdigits; + WHILE (d > 2) & (d > n-5) & (m MOD 10 = 0) DO m := m DIV 10; DEC(d) END; + + (* Render significant digits *) + WHILE d > 1 DO digit(m, s, i); m := m DIV 10; DEC(d) END; + DEC(i); s[i] := '.'; + digit(m, s, i); + END; + + (* Generate leading padding *) + DEC(n, LEN(s)-i); WHILE n > 0 DO Char(" "); DEC(n) END; + + (* Render prepared number from right end of buffer s *) + IF nn THEN Char("-") END; + WHILE i < LEN(s) DO Char(s[i]); INC(i) END +END Real; + + +PROCEDURE TenL(e: INTEGER): LONGREAL; + VAR r, power: LONGREAL; +BEGIN r := 1.0; power := 10.0; + WHILE e > 0 DO + IF ODD(e) THEN r := r*power END; + power := power*power; e := e DIV 2; + END; + RETURN r +END TenL; + +PROCEDURE -Entier64(x: LONGREAL): SYSTEM.INT64 "(int64)(x)"; + +PROCEDURE LongReal*(x: LONGREAL; n: INTEGER); + +(* LongReal(x, n) writes the long real number x to the end of the output stream using an + exponential form. If the textual representation of x requires m characters (including a + three-digit signed exponent), x is right adjusted in a ï¬eld of Max(n, m) characters padded + with blanks at the left end. A plus sign of the mantissa is not written. + LONGREAL is 1/sign, 11/exponent, 52/significand *) + +CONST + maxsigdigits = 16; (* Max significant digits to display from mantissa *) + +VAR + e: INTEGER; (* Exponent field *) + f: HUGEINT; (* Fraction field *) + s: ARRAY 30 OF CHAR; (* Buffer built backwards *) + i: INTEGER; (* Index into s *) + x0: LONGREAL; + nn: BOOLEAN; (* Number negative *) + en: BOOLEAN; (* Exponent negative *) + m: HUGEINT; (* Mantissa digits *) + d: INTEGER; (* Significant digit count to display *) + +BEGIN + nn := SYSTEM.VAL(HUGEINT, x) < 0; IF nn THEN DEC(n) END; + e := SYSTEM.VAL(INTEGER, (SYSTEM.VAL(HUGEINT, x) DIV 10000000000000H) MOD 800H); + f := SYSTEM.VAL(HUGEINT, x) MOD 10000000000000H; + + i := LEN(s); + IF e = 7FFH THEN (* NaN / Infinity *) + IF f = 0 THEN prepend("Infinity", s, i) ELSE prepend("NaN", s, i) END + ELSE + IF e = 0 THEN prepend("D+000", s, i); m := 0; + ELSE + IF nn THEN x := -x END; + + (* Scale e to be an exponent of 10 rather than 2 *) + e := SHORT(LONG(e - 1023) * 77 DIV 256); + IF e >= 0 THEN x := x / TenL(e) ELSE x := TenL(-e) * x END ; + IF x >= 10.0D0 THEN x := 0.1D0 * x; INC(e) END; + + (* Generate the exponent digits *) + en := e < 0; IF en THEN e := - e END; + d := 3; WHILE d > 0 DO digit(e, s, i); e := e DIV 10; DEC(d) END; + IF en THEN prepend("D-", s, i) ELSE prepend("D+", s, i) END; + + (* Scale x to 15 significant digits *) + x0 := TenL(maxsigdigits-1); + x := x0 * x + 0.5D0; + IF x >= 10.0D0 * x0 THEN x := 0.1D0 * x; INC(e) END; + m := Entier64(x) + END; + + (* Drop trailing zeroes where we don't have room *) + d := maxsigdigits; + WHILE (d > 2) & (d > n-6) & (m MOD 10 = 0) DO m := m DIV 10; DEC(d) END; + + (* Render significant digits *) + WHILE d > 1 DO digit(m, s, i); m := m DIV 10; DEC(d) END; + DEC(i); s[i] := '.'; + digit(m, s, i); + END; + + (* Generate leading padding *) + DEC(n, LEN(s)-i); WHILE n > 0 DO Char(" "); DEC(n) END; + + (* Render prepared number from right end of buffer s *) + IF nn THEN Char("-") END; + WHILE i < LEN(s) DO Char(s[i]); INC(i) END +END LongReal; + + END Out. diff --git a/src/tools/make/oberon.mk b/src/tools/make/oberon.mk index 4e054338..b8688337 100644 --- a/src/tools/make/oberon.mk +++ b/src/tools/make/oberon.mk @@ -104,8 +104,8 @@ translate: cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../Configuration.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Platform$(PLATFORM).Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfFapx -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Heap.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfFapx -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Out.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Strings.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Out.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Modules.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfFx -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Files.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Reals.Mod @@ -195,9 +195,9 @@ runtime: cd $(BUILDDIR)/$(MODEL) && $(COMPILE) -c SYSTEM.c cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Platform$(PLATFORM).Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Heap.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Out.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Modules.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Strings.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Out.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Files.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Math.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/MathL.Mod @@ -387,6 +387,7 @@ RUNTEST = COMPILER=$(COMPILER) OBECOMP="$(OBECOMP) -O$(MODEL)" FLAVOUR=$(FLAVOUR confidence: @printf "\n\n--- Confidence tests ---\n\n" +# cd src/test/confidence/math; $(RUNTEST) cd src/test/confidence/hello; $(RUNTEST) cd src/test/confidence/intsyntax; $(RUNTEST) cd src/test/confidence/language; $(RUNTEST) From ebd1a2e695ad423685465bc48e4a77135b2a60de Mon Sep 17 00:00:00 2001 From: David Brown Date: Sat, 8 Oct 2016 17:30:44 +0100 Subject: [PATCH 273/580] Add tests for Out.Real, Out.LongReal. --- makefile | 2 +- src/test/confidence/out/expected | 190 ++++++++++++++++++++++++++++ src/test/confidence/out/outtest.mod | 119 +++++++++++++++++ src/test/confidence/out/result-O2 | 93 ++++++++++++++ src/test/confidence/out/result-OC | 93 ++++++++++++++ src/test/confidence/out/test.sh | 15 +++ src/tools/make/oberon.mk | 1 + 7 files changed, 512 insertions(+), 1 deletion(-) create mode 100644 src/test/confidence/out/expected create mode 100644 src/test/confidence/out/outtest.mod create mode 100644 src/test/confidence/out/result-O2 create mode 100644 src/test/confidence/out/result-OC create mode 100644 src/test/confidence/out/test.sh diff --git a/makefile b/makefile index 82c50d44..b8323eea 100644 --- a/makefile +++ b/makefile @@ -239,7 +239,7 @@ uninstall: configuration # confidence: Run a set of confidence tests confidence: configuration - @make -f src/tools/make/oberon.mk -s confidence + @make -f src/tools/make/oberon.mk -s confidence MODEL=2 planned-binary-change: @date >src/test/confidence/planned-binary-change diff --git a/src/test/confidence/out/expected b/src/test/confidence/out/expected new file mode 100644 index 00000000..5343a884 --- /dev/null +++ b/src/test/confidence/out/expected @@ -0,0 +1,190 @@ +--- Testing with Oberon 2 variable model --- +Out module tests. +SIZE(INTEGER) = 2 + +Testing LONGREAL. + + 1 2 3 + 123456789012345678901234567890 + 1.0D0: 1.0D+000 + 1.1D0: 1.1D+000 + 2.1D0: 2.1D+000 +-1.1D0: -1.1D+000 + 1.1D3: 1.1D+003 + 1.1D-3: 1.1D-003 + 1.2345678987654321D3: 1.23456789876543D+003 + 0.0: 0.0D+000 + 0.000123D0: 1.23D-004 + 1/0.0: Infinity +-1/0.0: -Infinity + + 1 2 3 + 123456789012345678901234567890 + 1.0D0: 1.00000D+000 + 1.1D0: 1.10000D+000 + 2.1D0: 2.10000D+000 +-1.1D0: -1.1000D+000 + 1.1D3: 1.10000D+003 + 1.1D-3: 1.10000D-003 + 1.2345678987654321D3: 1.23456789876543D+003 + 0.0: 0.00000D+000 + 0.000123D0: 1.23000D-004 + 1/0.0: Infinity +-1/0.0: -Infinity + + 1 2 3 + 123456789012345678901234567890 + 1.0D0: 1.000000000000000D+000 + 1.1D0: 1.100000000000000D+000 + 2.1D0: 2.100000000000000D+000 +-1.1D0: -1.100000000000000D+000 + 1.1D3: 1.100000000000000D+003 + 1.1D-3: 1.100000000000000D-003 + 1.2345678987654321D3: 1.234567898765430D+003 + 0.0: 0.000000000000000D+000 + 0.000123D0: 1.230000000000000D-004 + 1/0.0: Infinity +-1/0.0: -Infinity + + + +Testing REAL. + + 1 2 3 + 123456789012345678901234567890 + 1.0E0: 1.0E+00 + 1.1E0: 1.1E+00 + 2.1E0: 2.1E+00 +-1.1E0: -1.1E+00 + 1.1E3: 1.1E+03 + 1.1E-3: 1.1E-03 + 1.2345678987654321E3: 1.234568E+03 + 0.0: 0.0E+00 + 0.000123E0: 1.23E-04 + 1/0.0: Infinity +-1/0.0: -Infinity + + 1 2 3 + 123456789012345678901234567890 + 1.0E0: 1.000000E+00 + 1.1E0: 1.100000E+00 + 2.1E0: 2.100000E+00 +-1.1E0: -1.10000E+00 + 1.1E3: 1.100000E+03 + 1.1E-3: 1.100000E-03 + 1.2345678987654321E3: 1.234568E+03 + 0.0: 0.000000E+00 + 0.000123E0: 1.230000E-04 + 1/0.0: Infinity +-1/0.0: -Infinity + + 1 2 3 + 123456789012345678901234567890 + 1.0E0: 1.0000000E+00 + 1.1E0: 1.1000000E+00 + 2.1E0: 2.1000000E+00 +-1.1E0: -1.1000000E+00 + 1.1E3: 1.1000000E+03 + 1.1E-3: 1.1000000E-03 + 1.2345678987654321E3: 1.2345680E+03 + 0.0: 0.0000000E+00 + 0.000123E0: 1.2300000E-04 + 1/0.0: Infinity +-1/0.0: -Infinity + + + +--- Testing with Component Pascal variable model --- +Out module tests. +SIZE(INTEGER) = 4 + +Testing LONGREAL. + + 1 2 3 + 123456789012345678901234567890 + 1.0D0: 1.0D+000 + 1.1D0: 1.1D+000 + 2.1D0: 2.1D+000 +-1.1D0: -1.1D+000 + 1.1D3: 1.1D+003 + 1.1D-3: 1.1D-003 + 1.2345678987654321D3: 1.23456789876543D+003 + 0.0: 0.0D+000 + 0.000123D0: 1.23D-004 + 1/0.0: Infinity +-1/0.0: -Infinity + + 1 2 3 + 123456789012345678901234567890 + 1.0D0: 1.00000D+000 + 1.1D0: 1.10000D+000 + 2.1D0: 2.10000D+000 +-1.1D0: -1.1000D+000 + 1.1D3: 1.10000D+003 + 1.1D-3: 1.10000D-003 + 1.2345678987654321D3: 1.23456789876543D+003 + 0.0: 0.00000D+000 + 0.000123D0: 1.23000D-004 + 1/0.0: Infinity +-1/0.0: -Infinity + + 1 2 3 + 123456789012345678901234567890 + 1.0D0: 1.000000000000000D+000 + 1.1D0: 1.100000000000000D+000 + 2.1D0: 2.100000000000000D+000 +-1.1D0: -1.100000000000000D+000 + 1.1D3: 1.100000000000000D+003 + 1.1D-3: 1.100000000000000D-003 + 1.2345678987654321D3: 1.234567898765430D+003 + 0.0: 0.000000000000000D+000 + 0.000123D0: 1.230000000000000D-004 + 1/0.0: Infinity +-1/0.0: -Infinity + + + +Testing REAL. + + 1 2 3 + 123456789012345678901234567890 + 1.0E0: 1.0E+00 + 1.1E0: 1.1E+00 + 2.1E0: 2.1E+00 +-1.1E0: -1.1E+00 + 1.1E3: 1.1E+03 + 1.1E-3: 1.1E-03 + 1.2345678987654321E3: 1.234568E+03 + 0.0: 0.0E+00 + 0.000123E0: 1.23E-04 + 1/0.0: Infinity +-1/0.0: -Infinity + + 1 2 3 + 123456789012345678901234567890 + 1.0E0: 1.000000E+00 + 1.1E0: 1.100000E+00 + 2.1E0: 2.100000E+00 +-1.1E0: -1.10000E+00 + 1.1E3: 1.100000E+03 + 1.1E-3: 1.100000E-03 + 1.2345678987654321E3: 1.234568E+03 + 0.0: 0.000000E+00 + 0.000123E0: 1.230000E-04 + 1/0.0: Infinity +-1/0.0: -Infinity + + 1 2 3 + 123456789012345678901234567890 + 1.0E0: 1.0000000E+00 + 1.1E0: 1.1000000E+00 + 2.1E0: 2.1000000E+00 +-1.1E0: -1.1000000E+00 + 1.1E3: 1.1000000E+03 + 1.1E-3: 1.1000000E-03 + 1.2345678987654321E3: 1.2345680E+03 + 0.0: 0.0000000E+00 + 0.000123E0: 1.2300000E-04 + 1/0.0: Infinity +-1/0.0: -Infinity + diff --git a/src/test/confidence/out/outtest.mod b/src/test/confidence/out/outtest.mod new file mode 100644 index 00000000..b2a00669 --- /dev/null +++ b/src/test/confidence/out/outtest.mod @@ -0,0 +1,119 @@ +MODULE outtest; + +IMPORT Out; + +VAR + r: REAL; + lr: LONGREAL; + +PROCEDURE ws(s: ARRAY OF CHAR); BEGIN Out.String(s) END ws; +PROCEDURE wi(i: HUGEINT); BEGIN Out.Int(i,1) END wi; +PROCEDURE wl; BEGIN Out.Ln END wl; + + +BEGIN + ws("Out module tests."); wl; + ws("SIZE(INTEGER) = "); wi(SIZE(INTEGER)); wl; wl; + + ws("Testing LONGREAL."); wl; wl; + ws(" 1 2 3"); wl; + ws(" 123456789012345678901234567890"); wl; + ws(" 1.0D0: "); Out.LongReal( 1.0D0, 1); wl; + ws(" 1.1D0: "); Out.LongReal( 1.1D0, 1); wl; + ws(" 2.1D0: "); Out.LongReal( 2.1D0, 1); wl; + ws("-1.1D0: "); Out.LongReal(-1.1D0, 1); wl; + ws(" 1.1D3: "); Out.LongReal( 1.1D3, 1); wl; + ws(" 1.1D-3: "); Out.LongReal( 1.1D-3, 1); wl; + ws(" 1.2345678987654321D3: "); Out.LongReal( 1.2345678987654321D3, 1); wl; + ws(" 0.0: "); Out.LongReal(0.0, 1); wl; + ws(" 0.000123D0: "); Out.LongReal(0.000123D0, 1); wl; + lr := 0.0; lr := 1/lr; + ws(" 1/0.0: "); Out.LongReal(lr, 1); wl; + lr := 0.0; lr := -1/lr; + ws("-1/0.0: "); Out.LongReal(lr, 1); wl; + wl; + ws(" 1 2 3"); wl; + ws(" 123456789012345678901234567890"); wl; + ws(" 1.0D0: "); Out.LongReal( 1.0D0, 12); wl; + ws(" 1.1D0: "); Out.LongReal( 1.1D0, 12); wl; + ws(" 2.1D0: "); Out.LongReal( 2.1D0, 12); wl; + ws("-1.1D0: "); Out.LongReal(-1.1D0, 12); wl; + ws(" 1.1D3: "); Out.LongReal( 1.1D3, 12); wl; + ws(" 1.1D-3: "); Out.LongReal( 1.1D-3, 12); wl; + ws(" 1.2345678987654321D3: "); Out.LongReal( 1.2345678987654321D3, 12); wl; + ws(" 0.0: "); Out.LongReal(0.0, 12); wl; + ws(" 0.000123D0: "); Out.LongReal(0.000123D0, 12); wl; + lr := 0.0; lr := 1/lr; + ws(" 1/0.0: "); Out.LongReal(lr, 12); wl; + lr := 0.0; lr := -1/lr; + ws("-1/0.0: "); Out.LongReal(lr, 12); wl; + wl; + ws(" 1 2 3"); wl; + ws(" 123456789012345678901234567890"); wl; + ws(" 1.0D0: "); Out.LongReal( 1.0D0, 30); wl; + ws(" 1.1D0: "); Out.LongReal( 1.1D0, 30); wl; + ws(" 2.1D0: "); Out.LongReal( 2.1D0, 30); wl; + ws("-1.1D0: "); Out.LongReal(-1.1D0, 30); wl; + ws(" 1.1D3: "); Out.LongReal( 1.1D3, 30); wl; + ws(" 1.1D-3: "); Out.LongReal( 1.1D-3, 30); wl; + ws(" 1.2345678987654321D3: "); Out.LongReal( 1.2345678987654321D3, 30); wl; + ws(" 0.0: "); Out.LongReal(0.0, 30); wl; + ws(" 0.000123D0: "); Out.LongReal(0.000123D0, 30); wl; + lr := 0.0; lr := 1/lr; + ws(" 1/0.0: "); Out.LongReal(lr, 30); wl; + lr := 0.0; lr := -1/lr; + ws("-1/0.0: "); Out.LongReal(lr, 30); wl; + wl; wl; wl; + + + ws("Testing REAL."); wl; wl; + ws(" 1 2 3"); wl; + ws(" 123456789012345678901234567890"); wl; + ws(" 1.0E0: "); Out.Real( 1.0E0, 1); wl; + ws(" 1.1E0: "); Out.Real( 1.1E0, 1); wl; + ws(" 2.1E0: "); Out.Real( 2.1E0, 1); wl; + ws("-1.1E0: "); Out.Real(-1.1E0, 1); wl; + ws(" 1.1E3: "); Out.Real( 1.1E3, 1); wl; + ws(" 1.1E-3: "); Out.Real( 1.1E-3, 1); wl; + ws(" 1.2345678987654321E3: "); Out.Real( 1.2345678987654321E3, 1); wl; + ws(" 0.0: "); Out.Real(0.0, 1); wl; + ws(" 0.000123E0: "); Out.Real(0.000123E0, 1); wl; + r := 0.0; r := 1/r; + ws(" 1/0.0: "); Out.Real(r, 1); wl; + r := 0.0; r := -1/r; + ws("-1/0.0: "); Out.Real(r, 1); wl; + wl; + ws(" 1 2 3"); wl; + ws(" 123456789012345678901234567890"); wl; + ws(" 1.0E0: "); Out.Real( 1.0E0, 12); wl; + ws(" 1.1E0: "); Out.Real( 1.1E0, 12); wl; + ws(" 2.1E0: "); Out.Real( 2.1E0, 12); wl; + ws("-1.1E0: "); Out.Real(-1.1E0, 12); wl; + ws(" 1.1E3: "); Out.Real( 1.1E3, 12); wl; + ws(" 1.1E-3: "); Out.Real( 1.1E-3, 12); wl; + ws(" 1.2345678987654321E3: "); Out.Real( 1.2345678987654321E3, 12); wl; + ws(" 0.0: "); Out.Real(0.0, 12); wl; + ws(" 0.000123E0: "); Out.Real(0.000123E0, 12); wl; + r := 0.0; r := 1/r; + ws(" 1/0.0: "); Out.Real(r, 12); wl; + r := 0.0; r := -1/r; + ws("-1/0.0: "); Out.Real(r, 12); wl; + wl; + ws(" 1 2 3"); wl; + ws(" 123456789012345678901234567890"); wl; + ws(" 1.0E0: "); Out.Real( 1.0E0, 30); wl; + ws(" 1.1E0: "); Out.Real( 1.1E0, 30); wl; + ws(" 2.1E0: "); Out.Real( 2.1E0, 30); wl; + ws("-1.1E0: "); Out.Real(-1.1E0, 30); wl; + ws(" 1.1E3: "); Out.Real( 1.1E3, 30); wl; + ws(" 1.1E-3: "); Out.Real( 1.1E-3, 30); wl; + ws(" 1.2345678987654321E3: "); Out.Real( 1.2345678987654321E3, 30); wl; + ws(" 0.0: "); Out.Real(0.0, 30); wl; + ws(" 0.000123E0: "); Out.Real(0.000123E0, 30); wl; + r := 0.0; r := 1/r; + ws(" 1/0.0: "); Out.Real(r, 30); wl; + r := 0.0; r := -1/r; + ws("-1/0.0: "); Out.Real(r, 30); wl; + wl; + +END outtest. diff --git a/src/test/confidence/out/result-O2 b/src/test/confidence/out/result-O2 new file mode 100644 index 00000000..1121e4ae --- /dev/null +++ b/src/test/confidence/out/result-O2 @@ -0,0 +1,93 @@ +Out module tests. +SIZE(INTEGER) = 2 + +Testing LONGREAL. + + 1 2 3 + 123456789012345678901234567890 + 1.0D0: 1.0D+000 + 1.1D0: 1.1D+000 + 2.1D0: 2.1D+000 +-1.1D0: -1.1D+000 + 1.1D3: 1.1D+003 + 1.1D-3: 1.1D-003 + 1.2345678987654321D3: 1.23456789876543D+003 + 0.0: 0.0D+000 + 0.000123D0: 1.23D-004 + 1/0.0: Infinity +-1/0.0: -Infinity + + 1 2 3 + 123456789012345678901234567890 + 1.0D0: 1.00000D+000 + 1.1D0: 1.10000D+000 + 2.1D0: 2.10000D+000 +-1.1D0: -1.1000D+000 + 1.1D3: 1.10000D+003 + 1.1D-3: 1.10000D-003 + 1.2345678987654321D3: 1.23456789876543D+003 + 0.0: 0.00000D+000 + 0.000123D0: 1.23000D-004 + 1/0.0: Infinity +-1/0.0: -Infinity + + 1 2 3 + 123456789012345678901234567890 + 1.0D0: 1.000000000000000D+000 + 1.1D0: 1.100000000000000D+000 + 2.1D0: 2.100000000000000D+000 +-1.1D0: -1.100000000000000D+000 + 1.1D3: 1.100000000000000D+003 + 1.1D-3: 1.100000000000000D-003 + 1.2345678987654321D3: 1.234567898765430D+003 + 0.0: 0.000000000000000D+000 + 0.000123D0: 1.230000000000000D-004 + 1/0.0: Infinity +-1/0.0: -Infinity + + + +Testing REAL. + + 1 2 3 + 123456789012345678901234567890 + 1.0E0: 1.0E+00 + 1.1E0: 1.1E+00 + 2.1E0: 2.1E+00 +-1.1E0: -1.1E+00 + 1.1E3: 1.1E+03 + 1.1E-3: 1.1E-03 + 1.2345678987654321E3: 1.234568E+03 + 0.0: 0.0E+00 + 0.000123E0: 1.23E-04 + 1/0.0: Infinity +-1/0.0: -Infinity + + 1 2 3 + 123456789012345678901234567890 + 1.0E0: 1.000000E+00 + 1.1E0: 1.100000E+00 + 2.1E0: 2.100000E+00 +-1.1E0: -1.10000E+00 + 1.1E3: 1.100000E+03 + 1.1E-3: 1.100000E-03 + 1.2345678987654321E3: 1.234568E+03 + 0.0: 0.000000E+00 + 0.000123E0: 1.230000E-04 + 1/0.0: Infinity +-1/0.0: -Infinity + + 1 2 3 + 123456789012345678901234567890 + 1.0E0: 1.0000000E+00 + 1.1E0: 1.1000000E+00 + 2.1E0: 2.1000000E+00 +-1.1E0: -1.1000000E+00 + 1.1E3: 1.1000000E+03 + 1.1E-3: 1.1000000E-03 + 1.2345678987654321E3: 1.2345680E+03 + 0.0: 0.0000000E+00 + 0.000123E0: 1.2300000E-04 + 1/0.0: Infinity +-1/0.0: -Infinity + diff --git a/src/test/confidence/out/result-OC b/src/test/confidence/out/result-OC new file mode 100644 index 00000000..8713aa8e --- /dev/null +++ b/src/test/confidence/out/result-OC @@ -0,0 +1,93 @@ +Out module tests. +SIZE(INTEGER) = 4 + +Testing LONGREAL. + + 1 2 3 + 123456789012345678901234567890 + 1.0D0: 1.0D+000 + 1.1D0: 1.1D+000 + 2.1D0: 2.1D+000 +-1.1D0: -1.1D+000 + 1.1D3: 1.1D+003 + 1.1D-3: 1.1D-003 + 1.2345678987654321D3: 1.23456789876543D+003 + 0.0: 0.0D+000 + 0.000123D0: 1.23D-004 + 1/0.0: Infinity +-1/0.0: -Infinity + + 1 2 3 + 123456789012345678901234567890 + 1.0D0: 1.00000D+000 + 1.1D0: 1.10000D+000 + 2.1D0: 2.10000D+000 +-1.1D0: -1.1000D+000 + 1.1D3: 1.10000D+003 + 1.1D-3: 1.10000D-003 + 1.2345678987654321D3: 1.23456789876543D+003 + 0.0: 0.00000D+000 + 0.000123D0: 1.23000D-004 + 1/0.0: Infinity +-1/0.0: -Infinity + + 1 2 3 + 123456789012345678901234567890 + 1.0D0: 1.000000000000000D+000 + 1.1D0: 1.100000000000000D+000 + 2.1D0: 2.100000000000000D+000 +-1.1D0: -1.100000000000000D+000 + 1.1D3: 1.100000000000000D+003 + 1.1D-3: 1.100000000000000D-003 + 1.2345678987654321D3: 1.234567898765430D+003 + 0.0: 0.000000000000000D+000 + 0.000123D0: 1.230000000000000D-004 + 1/0.0: Infinity +-1/0.0: -Infinity + + + +Testing REAL. + + 1 2 3 + 123456789012345678901234567890 + 1.0E0: 1.0E+00 + 1.1E0: 1.1E+00 + 2.1E0: 2.1E+00 +-1.1E0: -1.1E+00 + 1.1E3: 1.1E+03 + 1.1E-3: 1.1E-03 + 1.2345678987654321E3: 1.234568E+03 + 0.0: 0.0E+00 + 0.000123E0: 1.23E-04 + 1/0.0: Infinity +-1/0.0: -Infinity + + 1 2 3 + 123456789012345678901234567890 + 1.0E0: 1.000000E+00 + 1.1E0: 1.100000E+00 + 2.1E0: 2.100000E+00 +-1.1E0: -1.10000E+00 + 1.1E3: 1.100000E+03 + 1.1E-3: 1.100000E-03 + 1.2345678987654321E3: 1.234568E+03 + 0.0: 0.000000E+00 + 0.000123E0: 1.230000E-04 + 1/0.0: Infinity +-1/0.0: -Infinity + + 1 2 3 + 123456789012345678901234567890 + 1.0E0: 1.0000000E+00 + 1.1E0: 1.1000000E+00 + 2.1E0: 2.1000000E+00 +-1.1E0: -1.1000000E+00 + 1.1E3: 1.1000000E+03 + 1.1E-3: 1.1000000E-03 + 1.2345678987654321E3: 1.2345680E+03 + 0.0: 0.0000000E+00 + 0.000123E0: 1.2300000E-04 + 1/0.0: Infinity +-1/0.0: -Infinity + diff --git a/src/test/confidence/out/test.sh b/src/test/confidence/out/test.sh new file mode 100644 index 00000000..48198a64 --- /dev/null +++ b/src/test/confidence/out/test.sh @@ -0,0 +1,15 @@ +#!/bin/sh +. ../testenv.sh +$OBECOMP outtest.mod -m -O2 +#../../../../voc outtest.mod -m -O2 +./outtest >result-O2 +$OBECOMP outtest.mod -m -OC +#../../../../voc outtest.mod -m -OC +./outtest >result-OC +echo --- Testing with Oberon 2 variable model --- >result +cat result-O2 >>result +echo "" >>result +echo "" >>result +echo --- Testing with Component Pascal variable model --- >>result +cat result-OC >>result +. ../testresult.sh diff --git a/src/tools/make/oberon.mk b/src/tools/make/oberon.mk index b8688337..d8a8dd6b 100644 --- a/src/tools/make/oberon.mk +++ b/src/tools/make/oberon.mk @@ -389,6 +389,7 @@ confidence: @printf "\n\n--- Confidence tests ---\n\n" # cd src/test/confidence/math; $(RUNTEST) cd src/test/confidence/hello; $(RUNTEST) + cd src/test/confidence/out; $(RUNTEST) cd src/test/confidence/intsyntax; $(RUNTEST) cd src/test/confidence/language; $(RUNTEST) cd src/test/confidence/texts; $(RUNTEST) From ee77ec43ca8805aeccf654adf12c72dc08b49c6e Mon Sep 17 00:00:00 2001 From: David Brown Date: Tue, 11 Oct 2016 11:42:22 +0100 Subject: [PATCH 274/580] Out.Mod. Add buffer, simplify real output. --- bootstrap/unix-44/Compiler.c | 2 +- bootstrap/unix-44/Configuration.c | 4 +- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Files.c | 2 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 2 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 2 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 2 +- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 2 +- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 2 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Out.c | 224 +++++++++++---------------- bootstrap/unix-44/Out.h | 5 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 17 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/errors.c | 2 +- bootstrap/unix-44/errors.h | 2 +- bootstrap/unix-44/extTools.c | 2 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-44/vt100.c | 2 +- bootstrap/unix-44/vt100.h | 2 +- bootstrap/unix-48/Compiler.c | 2 +- bootstrap/unix-48/Configuration.c | 4 +- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Files.c | 2 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 2 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 2 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 2 +- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 2 +- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 2 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Out.c | 224 +++++++++++---------------- bootstrap/unix-48/Out.h | 5 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 17 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/errors.c | 2 +- bootstrap/unix-48/errors.h | 2 +- bootstrap/unix-48/extTools.c | 2 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-48/vt100.c | 2 +- bootstrap/unix-48/vt100.h | 2 +- bootstrap/unix-88/Compiler.c | 2 +- bootstrap/unix-88/Configuration.c | 4 +- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Files.c | 2 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 2 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 2 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 2 +- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 2 +- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 2 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Out.c | 224 +++++++++++---------------- bootstrap/unix-88/Out.h | 5 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 17 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/errors.c | 2 +- bootstrap/unix-88/errors.h | 2 +- bootstrap/unix-88/extTools.c | 2 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/unix-88/vt100.c | 2 +- bootstrap/unix-88/vt100.h | 2 +- bootstrap/windows-48/Compiler.c | 2 +- bootstrap/windows-48/Configuration.c | 4 +- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Files.c | 2 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 2 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 2 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 2 +- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 2 +- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 2 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Out.c | 224 +++++++++++---------------- bootstrap/windows-48/Out.h | 5 +- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 17 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/errors.c | 2 +- bootstrap/windows-48/errors.h | 2 +- bootstrap/windows-48/extTools.c | 2 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-48/vt100.c | 2 +- bootstrap/windows-48/vt100.h | 2 +- bootstrap/windows-88/Compiler.c | 2 +- bootstrap/windows-88/Configuration.c | 4 +- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Files.c | 2 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 2 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 2 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 2 +- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 2 +- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 2 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Out.c | 224 +++++++++++---------------- bootstrap/windows-88/Out.h | 5 +- bootstrap/windows-88/Platform.c | 2 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 17 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/errors.c | 2 +- bootstrap/windows-88/errors.h | 2 +- bootstrap/windows-88/extTools.c | 2 +- bootstrap/windows-88/extTools.h | 2 +- bootstrap/windows-88/vt100.c | 2 +- bootstrap/windows-88/vt100.h | 2 +- src/runtime/Out.Mod | 170 ++++++++------------ src/runtime/Strings.Mod | 6 +- src/test/confidence/out/expected | 36 ++--- src/test/confidence/out/result-O2 | 18 +-- src/test/confidence/out/result-OC | 18 +-- 200 files changed, 803 insertions(+), 1045 deletions(-) diff --git a/bootstrap/unix-44/Compiler.c b/bootstrap/unix-44/Compiler.c index 2dd6f251..b303a7c4 100644 --- a/bootstrap/unix-44/Compiler.c +++ b/bootstrap/unix-44/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index 3498204c..8ac138be 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index 14d86591..207eeb63 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index cb7920a3..c983396b 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index 4a49d744..ba64fc56 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index 860107f9..8758813f 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index 84c9bb20..bcf77f96 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index ab3bb29b..5302c9f4 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index 95fc4f94..abb938ae 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index bfc64251..3233aa7b 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index d04325c7..6931fe6e 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 54cd9a85..48f0d967 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index 69a5580c..40825f04 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 7da9b7b0..abb65cd0 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index d2a06df9..e18ab6ff 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index 768bfd2c..10e8168f 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index ee87db69..49d03b82 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index 02c301dc..288a081d 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index 98dd65e7..bc45e385 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index f9666e9a..9ec11e5d 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index f5b615f8..95947e81 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index ce5e3036..96075563 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index 43fd6331..0d54d226 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Out.c b/bootstrap/unix-44/Out.c index 37cb4c91..3df836a0 100644 --- a/bootstrap/unix-44/Out.c +++ b/bootstrap/unix-44/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -7,34 +7,63 @@ #include "SYSTEM.h" #include "Platform.h" -#include "Strings.h" +static CHAR Out_buf[128]; +static int16 Out_in; export void Out_Char (CHAR ch); +export void Out_Flush (void); export void Out_Int (int64 x, int64 n); +static int32 Out_Length (CHAR *s, LONGINT s__len); export void Out_Ln (void); export void Out_LongReal (LONGREAL x, int16 n); export void Out_Open (void); export void Out_Real (REAL x, int16 n); +static void Out_RealP (LONGREAL x, int16 n, int16 exponentdigits, int16 maxsigdigits, CHAR exp); export void Out_String (CHAR *str, LONGINT str__len); -export REAL Out_Ten (int16 e); -static LONGREAL Out_TenL (int16 e); +export LONGREAL Out_Ten (int16 e); static void Out_digit (int64 n, CHAR *s, LONGINT s__len, int16 *i); static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16 *i); -#define Out_Entier32(x) (int32)(x) #define Out_Entier64(x) (int64)(x) +void Out_Flush (void) +{ + int16 error; + if (Out_in > 0) { + error = Platform_Write(1, (address)Out_buf, Out_in); + } + Out_in = 0; +} + void Out_Open (void) { } void Out_Char (CHAR ch) { - int16 error; - error = Platform_Write(1, (address)&ch, 1); + if (Out_in >= 128) { + Out_Flush(); + } + Out_buf[__X(Out_in, 128)] = ch; + Out_in += 1; + if (ch == 0x0a) { + Out_Flush(); + } +} + +static int32 Out_Length (CHAR *s, LONGINT s__len) +{ + int32 _o_result; + int32 l; + l = 0; + while ((l < s__len && s[__X(l, s__len)] != 0x00)) { + l += 1; + } + _o_result = l; + return _o_result; } void Out_String (CHAR *str, LONGINT str__len) @@ -42,11 +71,16 @@ void Out_String (CHAR *str, LONGINT str__len) int32 l; int16 error; __DUP(str, str__len, CHAR); - l = 0; - while ((l < str__len && str[__X(l, str__len)] != 0x00)) { - l += 1; + l = Out_Length((void*)str, str__len); + if (Out_in + l > 128) { + Out_Flush(); + } + if (l > 128) { + error = Platform_Write(1, (address)str, l); + } else { + __MOVE((address)str, (address)&Out_buf[__X(Out_in, 128)], l); + Out_in += (int16)l; } - error = Platform_Write(1, (address)str, l); __DEL(str); } @@ -89,6 +123,7 @@ void Out_Int (int64 x, int64 n) void Out_Ln (void) { Out_String(Platform_NL, 3); + Out_Flush(); } static void Out_digit (int64 n, CHAR *s, LONGINT s__len, int16 *i) @@ -99,13 +134,14 @@ static void Out_digit (int64 n, CHAR *s, LONGINT s__len, int16 *i) static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16 *i) { - int16 j, l; + int16 j; + int32 l; __DUP(t, t__len, CHAR); - l = Strings_Length(t, t__len); + l = Out_Length((void*)t, t__len); if (l > *i) { l = *i; } - *i -= l; + *i -= (int16)l; j = 0; while (j < l) { s[__X(*i + j, s__len)] = t[__X(j, t__len)]; @@ -114,116 +150,7 @@ static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16 __DEL(t); } -REAL Out_Ten (int16 e) -{ - REAL _o_result; - LONGREAL r, power; - r = (LONGREAL)1; - power = (LONGREAL)10; - while (e > 0) { - if (__ODD(e)) { - r = r * power; - } - power = power * power; - e = __ASHR(e, 1); - } - _o_result = r; - return _o_result; -} - -void Out_Real (REAL x, int16 n) -{ - int16 e; - int32 f; - CHAR s[30]; - int16 i; - REAL x0; - BOOLEAN nn, en; - int32 m; - int16 d; - nn = __VAL(int32, x) < 0; - if (nn) { - n -= 1; - } - e = (int16)__MASK(__ASHR(__VAL(int32, x), 23), -256); - f = __MASK(__VAL(int32, x), -8388608); - i = 30; - if (e == 255) { - if (f == 0) { - Out_prepend((CHAR*)"Infinity", 9, (void*)s, 30, &i); - } else { - Out_prepend((CHAR*)"NaN", 4, (void*)s, 30, &i); - } - } else { - if (e == 0) { - Out_prepend((CHAR*)"E+00", 5, (void*)s, 30, &i); - m = 0; - } else { - if (nn) { - x = -x; - } - e = __ASHR((e - 127) * 77, 8); - if (e >= 0) { - x = x / (REAL)Out_Ten(e); - } else { - x = Out_Ten(-e) * x; - } - if (x >= (REAL)10) { - x = 1.0000000e-001 * x; - e += 1; - } - en = e < 0; - if (en) { - e = -e; - } - d = 2; - while (d > 0) { - Out_digit(e, (void*)s, 30, &i); - e = __DIV(e, 10); - d -= 1; - } - if (en) { - Out_prepend((CHAR*)"E-", 3, (void*)s, 30, &i); - } else { - Out_prepend((CHAR*)"E+", 3, (void*)s, 30, &i); - } - x0 = Out_Ten(7); - x = x0 * x + 5.0000000e-001; - if (x >= (REAL)10 * x0) { - x = 1.0000000e-001 * x; - e += 1; - } - m = Out_Entier32(x); - } - d = 8; - while ((((d > 2 && d > n - 5)) && (int)__MOD(m, 10) == 0)) { - m = __DIV(m, 10); - d -= 1; - } - while (d > 1) { - Out_digit(m, (void*)s, 30, &i); - m = __DIV(m, 10); - d -= 1; - } - i -= 1; - s[__X(i, 30)] = '.'; - Out_digit(m, (void*)s, 30, &i); - } - n -= 30 - i; - while (n > 0) { - Out_Char(' '); - n -= 1; - } - if (nn) { - Out_Char('-'); - } - while (i < 30) { - Out_Char(s[__X(i, 30)]); - i += 1; - } -} - -static LONGREAL Out_TenL (int16 e) +LONGREAL Out_Ten (int16 e) { LONGREAL _o_result; LONGREAL r, power; @@ -240,7 +167,7 @@ static LONGREAL Out_TenL (int16 e) return _o_result; } -void Out_LongReal (LONGREAL x, int16 n) +static void Out_RealP (LONGREAL x, int16 n, int16 exponentdigits, int16 maxsigdigits, CHAR exp) { int16 e; int64 f; @@ -249,7 +176,7 @@ void Out_LongReal (LONGREAL x, int16 n) LONGREAL x0; BOOLEAN nn, en; int64 m; - int16 d; + int16 d, dr; nn = __VAL(int64, x) < 0; if (nn) { n -= 1; @@ -265,7 +192,15 @@ void Out_LongReal (LONGREAL x, int16 n) } } else { if (e == 0) { - Out_prepend((CHAR*)"D+000", 6, (void*)s, 30, &i); + d = i - exponentdigits; + while (i > d) { + i -= 1; + s[__X(i, 30)] = '0'; + } + i -= 1; + s[__X(i, 30)] = '+'; + i -= 1; + s[__X(i, 30)] = exp; m = 0; } else { if (nn) { @@ -273,9 +208,9 @@ void Out_LongReal (LONGREAL x, int16 n) } e = (int16)__ASHR((e - 1023) * 77, 8); if (e >= 0) { - x = x / (LONGREAL)Out_TenL(e); + x = x / (LONGREAL)Out_Ten(e); } else { - x = Out_TenL(-e) * x; + x = Out_Ten(-e) * x; } if (x >= (LONGREAL)10) { x = 1.00000000000000e-001 * x; @@ -285,18 +220,21 @@ void Out_LongReal (LONGREAL x, int16 n) if (en) { e = -e; } - d = 3; + d = exponentdigits; while (d > 0) { Out_digit(e, (void*)s, 30, &i); e = __DIV(e, 10); d -= 1; } + i -= 1; if (en) { - Out_prepend((CHAR*)"D-", 3, (void*)s, 30, &i); + s[__X(i, 30)] = '-'; } else { - Out_prepend((CHAR*)"D+", 3, (void*)s, 30, &i); + s[__X(i, 30)] = '+'; } - x0 = Out_TenL(15); + i -= 1; + s[__X(i, 30)] = exp; + x0 = Out_Ten(maxsigdigits - 1); x = x0 * x + 5.00000000000000e-001; if (x >= (LONGREAL)10 * x0) { x = 1.00000000000000e-001 * x; @@ -304,8 +242,12 @@ void Out_LongReal (LONGREAL x, int16 n) } m = Out_Entier64(x); } - d = 16; - while ((((d > 2 && d > n - 6)) && __MOD(m, 10) == 0)) { + d = maxsigdigits; + dr = n - (exponentdigits + 3); + if (dr < 2) { + dr = 2; + } + while ((d > dr && __MOD(m, 10) == 0)) { m = __DIV(m, 10); d -= 1; } @@ -332,13 +274,23 @@ void Out_LongReal (LONGREAL x, int16 n) } } +void Out_Real (REAL x, int16 n) +{ + Out_RealP(x, n, 2, 7, 'E'); +} + +void Out_LongReal (LONGREAL x, int16 n) +{ + Out_RealP(x, n, 3, 16, 'D'); +} + export void *Out__init(void) { __DEFMOD; __MODULE_IMPORT(Platform); - __MODULE_IMPORT(Strings); __REGMOD("Out", 0); + __REGCMD("Flush", Out_Flush); __REGCMD("Ln", Out_Ln); __REGCMD("Open", Out_Open); /* BEGIN */ diff --git a/bootstrap/unix-44/Out.h b/bootstrap/unix-44/Out.h index 9076f6d1..362b4414 100644 --- a/bootstrap/unix-44/Out.h +++ b/bootstrap/unix-44/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h @@ -9,13 +9,14 @@ import void Out_Char (CHAR ch); +import void Out_Flush (void); import void Out_Int (int64 x, int64 n); import void Out_Ln (void); import void Out_LongReal (LONGREAL x, int16 n); import void Out_Open (void); import void Out_Real (REAL x, int16 n); import void Out_String (CHAR *str, LONGINT str__len); -import REAL Out_Ten (int16 e); +import LONGREAL Out_Ten (int16 e); import void *Out__init(void); diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 3ba187a5..0667398d 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index a96c77e9..4897b84e 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 4e18ac01..8697b424 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index 5728d211..e764f95f 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index 37643e92..8a95a8eb 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -24,15 +24,22 @@ export void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR int16 Strings_Length (CHAR *s, LONGINT s__len) { int16 _o_result; - int16 i; + int32 i; __DUP(s, s__len, CHAR); i = 0; while ((i < s__len && s[__X(i, s__len)] != 0x00)) { i += 1; } - _o_result = i; - __DEL(s); - return _o_result; + if (i <= 32767) { + _o_result = (int16)i; + __DEL(s); + return _o_result; + } else { + _o_result = 32767; + __DEL(s); + return _o_result; + } + __RETCHK; } void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len) diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index b7482150..4989383b 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index 340d4654..6fd83b96 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index 0992f4eb..82b41cda 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/errors.c b/bootstrap/unix-44/errors.c index 5ecfeea1..408d5ec7 100644 --- a/bootstrap/unix-44/errors.c +++ b/bootstrap/unix-44/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/errors.h b/bootstrap/unix-44/errors.h index 20eeca0d..b0247272 100644 --- a/bootstrap/unix-44/errors.h +++ b/bootstrap/unix-44/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index b1328b1c..5df06422 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index 27684ca4..ef0da35c 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-44/vt100.c b/bootstrap/unix-44/vt100.c index a2c7b023..65b16ccc 100644 --- a/bootstrap/unix-44/vt100.c +++ b/bootstrap/unix-44/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/vt100.h b/bootstrap/unix-44/vt100.h index 83b8a893..2211e981 100644 --- a/bootstrap/unix-44/vt100.h +++ b/bootstrap/unix-44/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-48/Compiler.c b/bootstrap/unix-48/Compiler.c index 2dd6f251..b303a7c4 100644 --- a/bootstrap/unix-48/Compiler.c +++ b/bootstrap/unix-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index 3498204c..8ac138be 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index 14d86591..207eeb63 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index cb7920a3..c983396b 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index 4a49d744..ba64fc56 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index 860107f9..8758813f 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index 84c9bb20..bcf77f96 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index ab3bb29b..5302c9f4 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index 95fc4f94..abb938ae 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index bfc64251..3233aa7b 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index d04325c7..6931fe6e 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 54cd9a85..48f0d967 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index 69a5580c..40825f04 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 7da9b7b0..abb65cd0 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index d2a06df9..e18ab6ff 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index 768bfd2c..10e8168f 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index ee87db69..49d03b82 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index 02c301dc..288a081d 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index 98dd65e7..bc45e385 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 7ebdfd73..55178203 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index f5b615f8..95947e81 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index ce5e3036..96075563 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index 43fd6331..0d54d226 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Out.c b/bootstrap/unix-48/Out.c index 37cb4c91..3df836a0 100644 --- a/bootstrap/unix-48/Out.c +++ b/bootstrap/unix-48/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -7,34 +7,63 @@ #include "SYSTEM.h" #include "Platform.h" -#include "Strings.h" +static CHAR Out_buf[128]; +static int16 Out_in; export void Out_Char (CHAR ch); +export void Out_Flush (void); export void Out_Int (int64 x, int64 n); +static int32 Out_Length (CHAR *s, LONGINT s__len); export void Out_Ln (void); export void Out_LongReal (LONGREAL x, int16 n); export void Out_Open (void); export void Out_Real (REAL x, int16 n); +static void Out_RealP (LONGREAL x, int16 n, int16 exponentdigits, int16 maxsigdigits, CHAR exp); export void Out_String (CHAR *str, LONGINT str__len); -export REAL Out_Ten (int16 e); -static LONGREAL Out_TenL (int16 e); +export LONGREAL Out_Ten (int16 e); static void Out_digit (int64 n, CHAR *s, LONGINT s__len, int16 *i); static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16 *i); -#define Out_Entier32(x) (int32)(x) #define Out_Entier64(x) (int64)(x) +void Out_Flush (void) +{ + int16 error; + if (Out_in > 0) { + error = Platform_Write(1, (address)Out_buf, Out_in); + } + Out_in = 0; +} + void Out_Open (void) { } void Out_Char (CHAR ch) { - int16 error; - error = Platform_Write(1, (address)&ch, 1); + if (Out_in >= 128) { + Out_Flush(); + } + Out_buf[__X(Out_in, 128)] = ch; + Out_in += 1; + if (ch == 0x0a) { + Out_Flush(); + } +} + +static int32 Out_Length (CHAR *s, LONGINT s__len) +{ + int32 _o_result; + int32 l; + l = 0; + while ((l < s__len && s[__X(l, s__len)] != 0x00)) { + l += 1; + } + _o_result = l; + return _o_result; } void Out_String (CHAR *str, LONGINT str__len) @@ -42,11 +71,16 @@ void Out_String (CHAR *str, LONGINT str__len) int32 l; int16 error; __DUP(str, str__len, CHAR); - l = 0; - while ((l < str__len && str[__X(l, str__len)] != 0x00)) { - l += 1; + l = Out_Length((void*)str, str__len); + if (Out_in + l > 128) { + Out_Flush(); + } + if (l > 128) { + error = Platform_Write(1, (address)str, l); + } else { + __MOVE((address)str, (address)&Out_buf[__X(Out_in, 128)], l); + Out_in += (int16)l; } - error = Platform_Write(1, (address)str, l); __DEL(str); } @@ -89,6 +123,7 @@ void Out_Int (int64 x, int64 n) void Out_Ln (void) { Out_String(Platform_NL, 3); + Out_Flush(); } static void Out_digit (int64 n, CHAR *s, LONGINT s__len, int16 *i) @@ -99,13 +134,14 @@ static void Out_digit (int64 n, CHAR *s, LONGINT s__len, int16 *i) static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16 *i) { - int16 j, l; + int16 j; + int32 l; __DUP(t, t__len, CHAR); - l = Strings_Length(t, t__len); + l = Out_Length((void*)t, t__len); if (l > *i) { l = *i; } - *i -= l; + *i -= (int16)l; j = 0; while (j < l) { s[__X(*i + j, s__len)] = t[__X(j, t__len)]; @@ -114,116 +150,7 @@ static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16 __DEL(t); } -REAL Out_Ten (int16 e) -{ - REAL _o_result; - LONGREAL r, power; - r = (LONGREAL)1; - power = (LONGREAL)10; - while (e > 0) { - if (__ODD(e)) { - r = r * power; - } - power = power * power; - e = __ASHR(e, 1); - } - _o_result = r; - return _o_result; -} - -void Out_Real (REAL x, int16 n) -{ - int16 e; - int32 f; - CHAR s[30]; - int16 i; - REAL x0; - BOOLEAN nn, en; - int32 m; - int16 d; - nn = __VAL(int32, x) < 0; - if (nn) { - n -= 1; - } - e = (int16)__MASK(__ASHR(__VAL(int32, x), 23), -256); - f = __MASK(__VAL(int32, x), -8388608); - i = 30; - if (e == 255) { - if (f == 0) { - Out_prepend((CHAR*)"Infinity", 9, (void*)s, 30, &i); - } else { - Out_prepend((CHAR*)"NaN", 4, (void*)s, 30, &i); - } - } else { - if (e == 0) { - Out_prepend((CHAR*)"E+00", 5, (void*)s, 30, &i); - m = 0; - } else { - if (nn) { - x = -x; - } - e = __ASHR((e - 127) * 77, 8); - if (e >= 0) { - x = x / (REAL)Out_Ten(e); - } else { - x = Out_Ten(-e) * x; - } - if (x >= (REAL)10) { - x = 1.0000000e-001 * x; - e += 1; - } - en = e < 0; - if (en) { - e = -e; - } - d = 2; - while (d > 0) { - Out_digit(e, (void*)s, 30, &i); - e = __DIV(e, 10); - d -= 1; - } - if (en) { - Out_prepend((CHAR*)"E-", 3, (void*)s, 30, &i); - } else { - Out_prepend((CHAR*)"E+", 3, (void*)s, 30, &i); - } - x0 = Out_Ten(7); - x = x0 * x + 5.0000000e-001; - if (x >= (REAL)10 * x0) { - x = 1.0000000e-001 * x; - e += 1; - } - m = Out_Entier32(x); - } - d = 8; - while ((((d > 2 && d > n - 5)) && (int)__MOD(m, 10) == 0)) { - m = __DIV(m, 10); - d -= 1; - } - while (d > 1) { - Out_digit(m, (void*)s, 30, &i); - m = __DIV(m, 10); - d -= 1; - } - i -= 1; - s[__X(i, 30)] = '.'; - Out_digit(m, (void*)s, 30, &i); - } - n -= 30 - i; - while (n > 0) { - Out_Char(' '); - n -= 1; - } - if (nn) { - Out_Char('-'); - } - while (i < 30) { - Out_Char(s[__X(i, 30)]); - i += 1; - } -} - -static LONGREAL Out_TenL (int16 e) +LONGREAL Out_Ten (int16 e) { LONGREAL _o_result; LONGREAL r, power; @@ -240,7 +167,7 @@ static LONGREAL Out_TenL (int16 e) return _o_result; } -void Out_LongReal (LONGREAL x, int16 n) +static void Out_RealP (LONGREAL x, int16 n, int16 exponentdigits, int16 maxsigdigits, CHAR exp) { int16 e; int64 f; @@ -249,7 +176,7 @@ void Out_LongReal (LONGREAL x, int16 n) LONGREAL x0; BOOLEAN nn, en; int64 m; - int16 d; + int16 d, dr; nn = __VAL(int64, x) < 0; if (nn) { n -= 1; @@ -265,7 +192,15 @@ void Out_LongReal (LONGREAL x, int16 n) } } else { if (e == 0) { - Out_prepend((CHAR*)"D+000", 6, (void*)s, 30, &i); + d = i - exponentdigits; + while (i > d) { + i -= 1; + s[__X(i, 30)] = '0'; + } + i -= 1; + s[__X(i, 30)] = '+'; + i -= 1; + s[__X(i, 30)] = exp; m = 0; } else { if (nn) { @@ -273,9 +208,9 @@ void Out_LongReal (LONGREAL x, int16 n) } e = (int16)__ASHR((e - 1023) * 77, 8); if (e >= 0) { - x = x / (LONGREAL)Out_TenL(e); + x = x / (LONGREAL)Out_Ten(e); } else { - x = Out_TenL(-e) * x; + x = Out_Ten(-e) * x; } if (x >= (LONGREAL)10) { x = 1.00000000000000e-001 * x; @@ -285,18 +220,21 @@ void Out_LongReal (LONGREAL x, int16 n) if (en) { e = -e; } - d = 3; + d = exponentdigits; while (d > 0) { Out_digit(e, (void*)s, 30, &i); e = __DIV(e, 10); d -= 1; } + i -= 1; if (en) { - Out_prepend((CHAR*)"D-", 3, (void*)s, 30, &i); + s[__X(i, 30)] = '-'; } else { - Out_prepend((CHAR*)"D+", 3, (void*)s, 30, &i); + s[__X(i, 30)] = '+'; } - x0 = Out_TenL(15); + i -= 1; + s[__X(i, 30)] = exp; + x0 = Out_Ten(maxsigdigits - 1); x = x0 * x + 5.00000000000000e-001; if (x >= (LONGREAL)10 * x0) { x = 1.00000000000000e-001 * x; @@ -304,8 +242,12 @@ void Out_LongReal (LONGREAL x, int16 n) } m = Out_Entier64(x); } - d = 16; - while ((((d > 2 && d > n - 6)) && __MOD(m, 10) == 0)) { + d = maxsigdigits; + dr = n - (exponentdigits + 3); + if (dr < 2) { + dr = 2; + } + while ((d > dr && __MOD(m, 10) == 0)) { m = __DIV(m, 10); d -= 1; } @@ -332,13 +274,23 @@ void Out_LongReal (LONGREAL x, int16 n) } } +void Out_Real (REAL x, int16 n) +{ + Out_RealP(x, n, 2, 7, 'E'); +} + +void Out_LongReal (LONGREAL x, int16 n) +{ + Out_RealP(x, n, 3, 16, 'D'); +} + export void *Out__init(void) { __DEFMOD; __MODULE_IMPORT(Platform); - __MODULE_IMPORT(Strings); __REGMOD("Out", 0); + __REGCMD("Flush", Out_Flush); __REGCMD("Ln", Out_Ln); __REGCMD("Open", Out_Open); /* BEGIN */ diff --git a/bootstrap/unix-48/Out.h b/bootstrap/unix-48/Out.h index 9076f6d1..362b4414 100644 --- a/bootstrap/unix-48/Out.h +++ b/bootstrap/unix-48/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h @@ -9,13 +9,14 @@ import void Out_Char (CHAR ch); +import void Out_Flush (void); import void Out_Int (int64 x, int64 n); import void Out_Ln (void); import void Out_LongReal (LONGREAL x, int16 n); import void Out_Open (void); import void Out_Real (REAL x, int16 n); import void Out_String (CHAR *str, LONGINT str__len); -import REAL Out_Ten (int16 e); +import LONGREAL Out_Ten (int16 e); import void *Out__init(void); diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 3ba187a5..0667398d 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index a96c77e9..4897b84e 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 4e18ac01..8697b424 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index 5728d211..e764f95f 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index 37643e92..8a95a8eb 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -24,15 +24,22 @@ export void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR int16 Strings_Length (CHAR *s, LONGINT s__len) { int16 _o_result; - int16 i; + int32 i; __DUP(s, s__len, CHAR); i = 0; while ((i < s__len && s[__X(i, s__len)] != 0x00)) { i += 1; } - _o_result = i; - __DEL(s); - return _o_result; + if (i <= 32767) { + _o_result = (int16)i; + __DEL(s); + return _o_result; + } else { + _o_result = 32767; + __DEL(s); + return _o_result; + } + __RETCHK; } void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len) diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index b7482150..4989383b 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index 92376713..421c5f47 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index 107cdc6c..e27e5f53 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/errors.c b/bootstrap/unix-48/errors.c index 5ecfeea1..408d5ec7 100644 --- a/bootstrap/unix-48/errors.c +++ b/bootstrap/unix-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/errors.h b/bootstrap/unix-48/errors.h index 20eeca0d..b0247272 100644 --- a/bootstrap/unix-48/errors.h +++ b/bootstrap/unix-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index b1328b1c..5df06422 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index 27684ca4..ef0da35c 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/vt100.c b/bootstrap/unix-48/vt100.c index a2c7b023..65b16ccc 100644 --- a/bootstrap/unix-48/vt100.c +++ b/bootstrap/unix-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/vt100.h b/bootstrap/unix-48/vt100.h index 83b8a893..2211e981 100644 --- a/bootstrap/unix-48/vt100.h +++ b/bootstrap/unix-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-88/Compiler.c b/bootstrap/unix-88/Compiler.c index 2dd6f251..b303a7c4 100644 --- a/bootstrap/unix-88/Compiler.c +++ b/bootstrap/unix-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index 3498204c..8ac138be 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index 14d86591..207eeb63 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 2324bd31..00efd9fc 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 5156a13d..1e455c40 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index e3aceaf6..b09688eb 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index 29ed6e2f..a5b2fe18 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 273f6c11..73f0a95b 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index 95fc4f94..abb938ae 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index bfc64251..3233aa7b 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index d04325c7..6931fe6e 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index 54cd9a85..48f0d967 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index 69a5580c..40825f04 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index ec6acf95..f377d2a5 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index d2a06df9..e18ab6ff 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index ddd0d49c..5c4e3c07 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index ee87db69..49d03b82 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index 02c301dc..288a081d 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index 98dd65e7..bc45e385 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index 60915d55..3e3e97fb 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index f5b615f8..95947e81 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index e3b8aff9..fd84941f 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index 43fd6331..0d54d226 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Out.c b/bootstrap/unix-88/Out.c index 37cb4c91..3df836a0 100644 --- a/bootstrap/unix-88/Out.c +++ b/bootstrap/unix-88/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -7,34 +7,63 @@ #include "SYSTEM.h" #include "Platform.h" -#include "Strings.h" +static CHAR Out_buf[128]; +static int16 Out_in; export void Out_Char (CHAR ch); +export void Out_Flush (void); export void Out_Int (int64 x, int64 n); +static int32 Out_Length (CHAR *s, LONGINT s__len); export void Out_Ln (void); export void Out_LongReal (LONGREAL x, int16 n); export void Out_Open (void); export void Out_Real (REAL x, int16 n); +static void Out_RealP (LONGREAL x, int16 n, int16 exponentdigits, int16 maxsigdigits, CHAR exp); export void Out_String (CHAR *str, LONGINT str__len); -export REAL Out_Ten (int16 e); -static LONGREAL Out_TenL (int16 e); +export LONGREAL Out_Ten (int16 e); static void Out_digit (int64 n, CHAR *s, LONGINT s__len, int16 *i); static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16 *i); -#define Out_Entier32(x) (int32)(x) #define Out_Entier64(x) (int64)(x) +void Out_Flush (void) +{ + int16 error; + if (Out_in > 0) { + error = Platform_Write(1, (address)Out_buf, Out_in); + } + Out_in = 0; +} + void Out_Open (void) { } void Out_Char (CHAR ch) { - int16 error; - error = Platform_Write(1, (address)&ch, 1); + if (Out_in >= 128) { + Out_Flush(); + } + Out_buf[__X(Out_in, 128)] = ch; + Out_in += 1; + if (ch == 0x0a) { + Out_Flush(); + } +} + +static int32 Out_Length (CHAR *s, LONGINT s__len) +{ + int32 _o_result; + int32 l; + l = 0; + while ((l < s__len && s[__X(l, s__len)] != 0x00)) { + l += 1; + } + _o_result = l; + return _o_result; } void Out_String (CHAR *str, LONGINT str__len) @@ -42,11 +71,16 @@ void Out_String (CHAR *str, LONGINT str__len) int32 l; int16 error; __DUP(str, str__len, CHAR); - l = 0; - while ((l < str__len && str[__X(l, str__len)] != 0x00)) { - l += 1; + l = Out_Length((void*)str, str__len); + if (Out_in + l > 128) { + Out_Flush(); + } + if (l > 128) { + error = Platform_Write(1, (address)str, l); + } else { + __MOVE((address)str, (address)&Out_buf[__X(Out_in, 128)], l); + Out_in += (int16)l; } - error = Platform_Write(1, (address)str, l); __DEL(str); } @@ -89,6 +123,7 @@ void Out_Int (int64 x, int64 n) void Out_Ln (void) { Out_String(Platform_NL, 3); + Out_Flush(); } static void Out_digit (int64 n, CHAR *s, LONGINT s__len, int16 *i) @@ -99,13 +134,14 @@ static void Out_digit (int64 n, CHAR *s, LONGINT s__len, int16 *i) static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16 *i) { - int16 j, l; + int16 j; + int32 l; __DUP(t, t__len, CHAR); - l = Strings_Length(t, t__len); + l = Out_Length((void*)t, t__len); if (l > *i) { l = *i; } - *i -= l; + *i -= (int16)l; j = 0; while (j < l) { s[__X(*i + j, s__len)] = t[__X(j, t__len)]; @@ -114,116 +150,7 @@ static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16 __DEL(t); } -REAL Out_Ten (int16 e) -{ - REAL _o_result; - LONGREAL r, power; - r = (LONGREAL)1; - power = (LONGREAL)10; - while (e > 0) { - if (__ODD(e)) { - r = r * power; - } - power = power * power; - e = __ASHR(e, 1); - } - _o_result = r; - return _o_result; -} - -void Out_Real (REAL x, int16 n) -{ - int16 e; - int32 f; - CHAR s[30]; - int16 i; - REAL x0; - BOOLEAN nn, en; - int32 m; - int16 d; - nn = __VAL(int32, x) < 0; - if (nn) { - n -= 1; - } - e = (int16)__MASK(__ASHR(__VAL(int32, x), 23), -256); - f = __MASK(__VAL(int32, x), -8388608); - i = 30; - if (e == 255) { - if (f == 0) { - Out_prepend((CHAR*)"Infinity", 9, (void*)s, 30, &i); - } else { - Out_prepend((CHAR*)"NaN", 4, (void*)s, 30, &i); - } - } else { - if (e == 0) { - Out_prepend((CHAR*)"E+00", 5, (void*)s, 30, &i); - m = 0; - } else { - if (nn) { - x = -x; - } - e = __ASHR((e - 127) * 77, 8); - if (e >= 0) { - x = x / (REAL)Out_Ten(e); - } else { - x = Out_Ten(-e) * x; - } - if (x >= (REAL)10) { - x = 1.0000000e-001 * x; - e += 1; - } - en = e < 0; - if (en) { - e = -e; - } - d = 2; - while (d > 0) { - Out_digit(e, (void*)s, 30, &i); - e = __DIV(e, 10); - d -= 1; - } - if (en) { - Out_prepend((CHAR*)"E-", 3, (void*)s, 30, &i); - } else { - Out_prepend((CHAR*)"E+", 3, (void*)s, 30, &i); - } - x0 = Out_Ten(7); - x = x0 * x + 5.0000000e-001; - if (x >= (REAL)10 * x0) { - x = 1.0000000e-001 * x; - e += 1; - } - m = Out_Entier32(x); - } - d = 8; - while ((((d > 2 && d > n - 5)) && (int)__MOD(m, 10) == 0)) { - m = __DIV(m, 10); - d -= 1; - } - while (d > 1) { - Out_digit(m, (void*)s, 30, &i); - m = __DIV(m, 10); - d -= 1; - } - i -= 1; - s[__X(i, 30)] = '.'; - Out_digit(m, (void*)s, 30, &i); - } - n -= 30 - i; - while (n > 0) { - Out_Char(' '); - n -= 1; - } - if (nn) { - Out_Char('-'); - } - while (i < 30) { - Out_Char(s[__X(i, 30)]); - i += 1; - } -} - -static LONGREAL Out_TenL (int16 e) +LONGREAL Out_Ten (int16 e) { LONGREAL _o_result; LONGREAL r, power; @@ -240,7 +167,7 @@ static LONGREAL Out_TenL (int16 e) return _o_result; } -void Out_LongReal (LONGREAL x, int16 n) +static void Out_RealP (LONGREAL x, int16 n, int16 exponentdigits, int16 maxsigdigits, CHAR exp) { int16 e; int64 f; @@ -249,7 +176,7 @@ void Out_LongReal (LONGREAL x, int16 n) LONGREAL x0; BOOLEAN nn, en; int64 m; - int16 d; + int16 d, dr; nn = __VAL(int64, x) < 0; if (nn) { n -= 1; @@ -265,7 +192,15 @@ void Out_LongReal (LONGREAL x, int16 n) } } else { if (e == 0) { - Out_prepend((CHAR*)"D+000", 6, (void*)s, 30, &i); + d = i - exponentdigits; + while (i > d) { + i -= 1; + s[__X(i, 30)] = '0'; + } + i -= 1; + s[__X(i, 30)] = '+'; + i -= 1; + s[__X(i, 30)] = exp; m = 0; } else { if (nn) { @@ -273,9 +208,9 @@ void Out_LongReal (LONGREAL x, int16 n) } e = (int16)__ASHR((e - 1023) * 77, 8); if (e >= 0) { - x = x / (LONGREAL)Out_TenL(e); + x = x / (LONGREAL)Out_Ten(e); } else { - x = Out_TenL(-e) * x; + x = Out_Ten(-e) * x; } if (x >= (LONGREAL)10) { x = 1.00000000000000e-001 * x; @@ -285,18 +220,21 @@ void Out_LongReal (LONGREAL x, int16 n) if (en) { e = -e; } - d = 3; + d = exponentdigits; while (d > 0) { Out_digit(e, (void*)s, 30, &i); e = __DIV(e, 10); d -= 1; } + i -= 1; if (en) { - Out_prepend((CHAR*)"D-", 3, (void*)s, 30, &i); + s[__X(i, 30)] = '-'; } else { - Out_prepend((CHAR*)"D+", 3, (void*)s, 30, &i); + s[__X(i, 30)] = '+'; } - x0 = Out_TenL(15); + i -= 1; + s[__X(i, 30)] = exp; + x0 = Out_Ten(maxsigdigits - 1); x = x0 * x + 5.00000000000000e-001; if (x >= (LONGREAL)10 * x0) { x = 1.00000000000000e-001 * x; @@ -304,8 +242,12 @@ void Out_LongReal (LONGREAL x, int16 n) } m = Out_Entier64(x); } - d = 16; - while ((((d > 2 && d > n - 6)) && __MOD(m, 10) == 0)) { + d = maxsigdigits; + dr = n - (exponentdigits + 3); + if (dr < 2) { + dr = 2; + } + while ((d > dr && __MOD(m, 10) == 0)) { m = __DIV(m, 10); d -= 1; } @@ -332,13 +274,23 @@ void Out_LongReal (LONGREAL x, int16 n) } } +void Out_Real (REAL x, int16 n) +{ + Out_RealP(x, n, 2, 7, 'E'); +} + +void Out_LongReal (LONGREAL x, int16 n) +{ + Out_RealP(x, n, 3, 16, 'D'); +} + export void *Out__init(void) { __DEFMOD; __MODULE_IMPORT(Platform); - __MODULE_IMPORT(Strings); __REGMOD("Out", 0); + __REGCMD("Flush", Out_Flush); __REGCMD("Ln", Out_Ln); __REGCMD("Open", Out_Open); /* BEGIN */ diff --git a/bootstrap/unix-88/Out.h b/bootstrap/unix-88/Out.h index 9076f6d1..362b4414 100644 --- a/bootstrap/unix-88/Out.h +++ b/bootstrap/unix-88/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h @@ -9,13 +9,14 @@ import void Out_Char (CHAR ch); +import void Out_Flush (void); import void Out_Int (int64 x, int64 n); import void Out_Ln (void); import void Out_LongReal (LONGREAL x, int16 n); import void Out_Open (void); import void Out_Real (REAL x, int16 n); import void Out_String (CHAR *str, LONGINT str__len); -import REAL Out_Ten (int16 e); +import LONGREAL Out_Ten (int16 e); import void *Out__init(void); diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index feddb176..ddd65b5f 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index ffacb767..f2194f3c 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 4e18ac01..8697b424 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index 5728d211..e764f95f 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index 37643e92..8a95a8eb 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -24,15 +24,22 @@ export void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR int16 Strings_Length (CHAR *s, LONGINT s__len) { int16 _o_result; - int16 i; + int32 i; __DUP(s, s__len, CHAR); i = 0; while ((i < s__len && s[__X(i, s__len)] != 0x00)) { i += 1; } - _o_result = i; - __DEL(s); - return _o_result; + if (i <= 32767) { + _o_result = (int16)i; + __DEL(s); + return _o_result; + } else { + _o_result = 32767; + __DEL(s); + return _o_result; + } + __RETCHK; } void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len) diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index b7482150..4989383b 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index 0d2f319e..ce4a885a 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index 4b01b650..26669d1c 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/errors.c b/bootstrap/unix-88/errors.c index 5ecfeea1..408d5ec7 100644 --- a/bootstrap/unix-88/errors.c +++ b/bootstrap/unix-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/errors.h b/bootstrap/unix-88/errors.h index 20eeca0d..b0247272 100644 --- a/bootstrap/unix-88/errors.h +++ b/bootstrap/unix-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index b1328b1c..5df06422 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index 27684ca4..ef0da35c 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/vt100.c b/bootstrap/unix-88/vt100.c index a2c7b023..65b16ccc 100644 --- a/bootstrap/unix-88/vt100.c +++ b/bootstrap/unix-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/vt100.h b/bootstrap/unix-88/vt100.h index 83b8a893..2211e981 100644 --- a/bootstrap/unix-88/vt100.h +++ b/bootstrap/unix-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-48/Compiler.c b/bootstrap/windows-48/Compiler.c index 2dd6f251..b303a7c4 100644 --- a/bootstrap/windows-48/Compiler.c +++ b/bootstrap/windows-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index 3498204c..8ac138be 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index 14d86591..207eeb63 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index a444fff2..0c55ce0a 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index a447dbad..8cee9102 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index 860107f9..8758813f 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index 84c9bb20..bcf77f96 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index ab3bb29b..5302c9f4 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index 95fc4f94..abb938ae 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index bfc64251..3233aa7b 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index d04325c7..6931fe6e 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 54cd9a85..48f0d967 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index 69a5580c..40825f04 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 7da9b7b0..abb65cd0 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index d2a06df9..e18ab6ff 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index 768bfd2c..10e8168f 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index ee87db69..49d03b82 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index 02c301dc..288a081d 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index 98dd65e7..bc45e385 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 7ebdfd73..55178203 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index f5b615f8..95947e81 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index ce5e3036..96075563 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index 43fd6331..0d54d226 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Out.c b/bootstrap/windows-48/Out.c index 790b4f75..b21d426b 100644 --- a/bootstrap/windows-48/Out.c +++ b/bootstrap/windows-48/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -7,34 +7,63 @@ #include "SYSTEM.h" #include "Platform.h" -#include "Strings.h" +static CHAR Out_buf[128]; +static int16 Out_in; export void Out_Char (CHAR ch); +export void Out_Flush (void); export void Out_Int (int64 x, int64 n); +static int32 Out_Length (CHAR *s, LONGINT s__len); export void Out_Ln (void); export void Out_LongReal (LONGREAL x, int16 n); export void Out_Open (void); export void Out_Real (REAL x, int16 n); +static void Out_RealP (LONGREAL x, int16 n, int16 exponentdigits, int16 maxsigdigits, CHAR exp); export void Out_String (CHAR *str, LONGINT str__len); -export REAL Out_Ten (int16 e); -static LONGREAL Out_TenL (int16 e); +export LONGREAL Out_Ten (int16 e); static void Out_digit (int64 n, CHAR *s, LONGINT s__len, int16 *i); static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16 *i); -#define Out_Entier32(x) (int32)(x) #define Out_Entier64(x) (int64)(x) +void Out_Flush (void) +{ + int16 error; + if (Out_in > 0) { + error = Platform_Write(Platform_StdOut, (address)Out_buf, Out_in); + } + Out_in = 0; +} + void Out_Open (void) { } void Out_Char (CHAR ch) { - int16 error; - error = Platform_Write(Platform_StdOut, (address)&ch, 1); + if (Out_in >= 128) { + Out_Flush(); + } + Out_buf[__X(Out_in, 128)] = ch; + Out_in += 1; + if (ch == 0x0a) { + Out_Flush(); + } +} + +static int32 Out_Length (CHAR *s, LONGINT s__len) +{ + int32 _o_result; + int32 l; + l = 0; + while ((l < s__len && s[__X(l, s__len)] != 0x00)) { + l += 1; + } + _o_result = l; + return _o_result; } void Out_String (CHAR *str, LONGINT str__len) @@ -42,11 +71,16 @@ void Out_String (CHAR *str, LONGINT str__len) int32 l; int16 error; __DUP(str, str__len, CHAR); - l = 0; - while ((l < str__len && str[__X(l, str__len)] != 0x00)) { - l += 1; + l = Out_Length((void*)str, str__len); + if (Out_in + l > 128) { + Out_Flush(); + } + if (l > 128) { + error = Platform_Write(Platform_StdOut, (address)str, l); + } else { + __MOVE((address)str, (address)&Out_buf[__X(Out_in, 128)], l); + Out_in += (int16)l; } - error = Platform_Write(Platform_StdOut, (address)str, l); __DEL(str); } @@ -89,6 +123,7 @@ void Out_Int (int64 x, int64 n) void Out_Ln (void) { Out_String(Platform_NL, 3); + Out_Flush(); } static void Out_digit (int64 n, CHAR *s, LONGINT s__len, int16 *i) @@ -99,13 +134,14 @@ static void Out_digit (int64 n, CHAR *s, LONGINT s__len, int16 *i) static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16 *i) { - int16 j, l; + int16 j; + int32 l; __DUP(t, t__len, CHAR); - l = Strings_Length(t, t__len); + l = Out_Length((void*)t, t__len); if (l > *i) { l = *i; } - *i -= l; + *i -= (int16)l; j = 0; while (j < l) { s[__X(*i + j, s__len)] = t[__X(j, t__len)]; @@ -114,116 +150,7 @@ static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16 __DEL(t); } -REAL Out_Ten (int16 e) -{ - REAL _o_result; - LONGREAL r, power; - r = (LONGREAL)1; - power = (LONGREAL)10; - while (e > 0) { - if (__ODD(e)) { - r = r * power; - } - power = power * power; - e = __ASHR(e, 1); - } - _o_result = r; - return _o_result; -} - -void Out_Real (REAL x, int16 n) -{ - int16 e; - int32 f; - CHAR s[30]; - int16 i; - REAL x0; - BOOLEAN nn, en; - int32 m; - int16 d; - nn = __VAL(int32, x) < 0; - if (nn) { - n -= 1; - } - e = (int16)__MASK(__ASHR(__VAL(int32, x), 23), -256); - f = __MASK(__VAL(int32, x), -8388608); - i = 30; - if (e == 255) { - if (f == 0) { - Out_prepend((CHAR*)"Infinity", 9, (void*)s, 30, &i); - } else { - Out_prepend((CHAR*)"NaN", 4, (void*)s, 30, &i); - } - } else { - if (e == 0) { - Out_prepend((CHAR*)"E+00", 5, (void*)s, 30, &i); - m = 0; - } else { - if (nn) { - x = -x; - } - e = __ASHR((e - 127) * 77, 8); - if (e >= 0) { - x = x / (REAL)Out_Ten(e); - } else { - x = Out_Ten(-e) * x; - } - if (x >= (REAL)10) { - x = 1.0000000e-001 * x; - e += 1; - } - en = e < 0; - if (en) { - e = -e; - } - d = 2; - while (d > 0) { - Out_digit(e, (void*)s, 30, &i); - e = __DIV(e, 10); - d -= 1; - } - if (en) { - Out_prepend((CHAR*)"E-", 3, (void*)s, 30, &i); - } else { - Out_prepend((CHAR*)"E+", 3, (void*)s, 30, &i); - } - x0 = Out_Ten(7); - x = x0 * x + 5.0000000e-001; - if (x >= (REAL)10 * x0) { - x = 1.0000000e-001 * x; - e += 1; - } - m = Out_Entier32(x); - } - d = 8; - while ((((d > 2 && d > n - 5)) && (int)__MOD(m, 10) == 0)) { - m = __DIV(m, 10); - d -= 1; - } - while (d > 1) { - Out_digit(m, (void*)s, 30, &i); - m = __DIV(m, 10); - d -= 1; - } - i -= 1; - s[__X(i, 30)] = '.'; - Out_digit(m, (void*)s, 30, &i); - } - n -= 30 - i; - while (n > 0) { - Out_Char(' '); - n -= 1; - } - if (nn) { - Out_Char('-'); - } - while (i < 30) { - Out_Char(s[__X(i, 30)]); - i += 1; - } -} - -static LONGREAL Out_TenL (int16 e) +LONGREAL Out_Ten (int16 e) { LONGREAL _o_result; LONGREAL r, power; @@ -240,7 +167,7 @@ static LONGREAL Out_TenL (int16 e) return _o_result; } -void Out_LongReal (LONGREAL x, int16 n) +static void Out_RealP (LONGREAL x, int16 n, int16 exponentdigits, int16 maxsigdigits, CHAR exp) { int16 e; int64 f; @@ -249,7 +176,7 @@ void Out_LongReal (LONGREAL x, int16 n) LONGREAL x0; BOOLEAN nn, en; int64 m; - int16 d; + int16 d, dr; nn = __VAL(int64, x) < 0; if (nn) { n -= 1; @@ -265,7 +192,15 @@ void Out_LongReal (LONGREAL x, int16 n) } } else { if (e == 0) { - Out_prepend((CHAR*)"D+000", 6, (void*)s, 30, &i); + d = i - exponentdigits; + while (i > d) { + i -= 1; + s[__X(i, 30)] = '0'; + } + i -= 1; + s[__X(i, 30)] = '+'; + i -= 1; + s[__X(i, 30)] = exp; m = 0; } else { if (nn) { @@ -273,9 +208,9 @@ void Out_LongReal (LONGREAL x, int16 n) } e = (int16)__ASHR((e - 1023) * 77, 8); if (e >= 0) { - x = x / (LONGREAL)Out_TenL(e); + x = x / (LONGREAL)Out_Ten(e); } else { - x = Out_TenL(-e) * x; + x = Out_Ten(-e) * x; } if (x >= (LONGREAL)10) { x = 1.00000000000000e-001 * x; @@ -285,18 +220,21 @@ void Out_LongReal (LONGREAL x, int16 n) if (en) { e = -e; } - d = 3; + d = exponentdigits; while (d > 0) { Out_digit(e, (void*)s, 30, &i); e = __DIV(e, 10); d -= 1; } + i -= 1; if (en) { - Out_prepend((CHAR*)"D-", 3, (void*)s, 30, &i); + s[__X(i, 30)] = '-'; } else { - Out_prepend((CHAR*)"D+", 3, (void*)s, 30, &i); + s[__X(i, 30)] = '+'; } - x0 = Out_TenL(15); + i -= 1; + s[__X(i, 30)] = exp; + x0 = Out_Ten(maxsigdigits - 1); x = x0 * x + 5.00000000000000e-001; if (x >= (LONGREAL)10 * x0) { x = 1.00000000000000e-001 * x; @@ -304,8 +242,12 @@ void Out_LongReal (LONGREAL x, int16 n) } m = Out_Entier64(x); } - d = 16; - while ((((d > 2 && d > n - 6)) && __MOD(m, 10) == 0)) { + d = maxsigdigits; + dr = n - (exponentdigits + 3); + if (dr < 2) { + dr = 2; + } + while ((d > dr && __MOD(m, 10) == 0)) { m = __DIV(m, 10); d -= 1; } @@ -332,13 +274,23 @@ void Out_LongReal (LONGREAL x, int16 n) } } +void Out_Real (REAL x, int16 n) +{ + Out_RealP(x, n, 2, 7, 'E'); +} + +void Out_LongReal (LONGREAL x, int16 n) +{ + Out_RealP(x, n, 3, 16, 'D'); +} + export void *Out__init(void) { __DEFMOD; __MODULE_IMPORT(Platform); - __MODULE_IMPORT(Strings); __REGMOD("Out", 0); + __REGCMD("Flush", Out_Flush); __REGCMD("Ln", Out_Ln); __REGCMD("Open", Out_Open); /* BEGIN */ diff --git a/bootstrap/windows-48/Out.h b/bootstrap/windows-48/Out.h index 9076f6d1..362b4414 100644 --- a/bootstrap/windows-48/Out.h +++ b/bootstrap/windows-48/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h @@ -9,13 +9,14 @@ import void Out_Char (CHAR ch); +import void Out_Flush (void); import void Out_Int (int64 x, int64 n); import void Out_Ln (void); import void Out_LongReal (LONGREAL x, int16 n); import void Out_Open (void); import void Out_Real (REAL x, int16 n); import void Out_String (CHAR *str, LONGINT str__len); -import REAL Out_Ten (int16 e); +import LONGREAL Out_Ten (int16 e); import void *Out__init(void); diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 3e82ab82..d50ae9ec 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index c5ff14b6..3aa708ca 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 4e18ac01..8697b424 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index 5728d211..e764f95f 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index 37643e92..8a95a8eb 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -24,15 +24,22 @@ export void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR int16 Strings_Length (CHAR *s, LONGINT s__len) { int16 _o_result; - int16 i; + int32 i; __DUP(s, s__len, CHAR); i = 0; while ((i < s__len && s[__X(i, s__len)] != 0x00)) { i += 1; } - _o_result = i; - __DEL(s); - return _o_result; + if (i <= 32767) { + _o_result = (int16)i; + __DEL(s); + return _o_result; + } else { + _o_result = 32767; + __DEL(s); + return _o_result; + } + __RETCHK; } void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len) diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index b7482150..4989383b 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index 92376713..421c5f47 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index 107cdc6c..e27e5f53 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/errors.c b/bootstrap/windows-48/errors.c index 5ecfeea1..408d5ec7 100644 --- a/bootstrap/windows-48/errors.c +++ b/bootstrap/windows-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/errors.h b/bootstrap/windows-48/errors.h index 20eeca0d..b0247272 100644 --- a/bootstrap/windows-48/errors.h +++ b/bootstrap/windows-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index b1328b1c..5df06422 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index 27684ca4..ef0da35c 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/vt100.c b/bootstrap/windows-48/vt100.c index a2c7b023..65b16ccc 100644 --- a/bootstrap/windows-48/vt100.c +++ b/bootstrap/windows-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/vt100.h b/bootstrap/windows-48/vt100.h index 83b8a893..2211e981 100644 --- a/bootstrap/windows-48/vt100.h +++ b/bootstrap/windows-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-88/Compiler.c b/bootstrap/windows-88/Compiler.c index 2dd6f251..b303a7c4 100644 --- a/bootstrap/windows-88/Compiler.c +++ b/bootstrap/windows-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index 3498204c..8ac138be 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index 14d86591..207eeb63 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index dd50c47a..b9443fd9 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 99068de9..98e13fc1 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index e3aceaf6..b09688eb 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index 29ed6e2f..a5b2fe18 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 273f6c11..73f0a95b 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index 95fc4f94..abb938ae 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index bfc64251..3233aa7b 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index d04325c7..6931fe6e 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index 54cd9a85..48f0d967 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index 69a5580c..40825f04 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index ec6acf95..f377d2a5 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index d2a06df9..e18ab6ff 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index ddd0d49c..5c4e3c07 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index ee87db69..49d03b82 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index 02c301dc..288a081d 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index 98dd65e7..bc45e385 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index 60915d55..3e3e97fb 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index f5b615f8..95947e81 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index e3b8aff9..fd84941f 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index 43fd6331..0d54d226 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Out.c b/bootstrap/windows-88/Out.c index 790b4f75..b21d426b 100644 --- a/bootstrap/windows-88/Out.c +++ b/bootstrap/windows-88/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -7,34 +7,63 @@ #include "SYSTEM.h" #include "Platform.h" -#include "Strings.h" +static CHAR Out_buf[128]; +static int16 Out_in; export void Out_Char (CHAR ch); +export void Out_Flush (void); export void Out_Int (int64 x, int64 n); +static int32 Out_Length (CHAR *s, LONGINT s__len); export void Out_Ln (void); export void Out_LongReal (LONGREAL x, int16 n); export void Out_Open (void); export void Out_Real (REAL x, int16 n); +static void Out_RealP (LONGREAL x, int16 n, int16 exponentdigits, int16 maxsigdigits, CHAR exp); export void Out_String (CHAR *str, LONGINT str__len); -export REAL Out_Ten (int16 e); -static LONGREAL Out_TenL (int16 e); +export LONGREAL Out_Ten (int16 e); static void Out_digit (int64 n, CHAR *s, LONGINT s__len, int16 *i); static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16 *i); -#define Out_Entier32(x) (int32)(x) #define Out_Entier64(x) (int64)(x) +void Out_Flush (void) +{ + int16 error; + if (Out_in > 0) { + error = Platform_Write(Platform_StdOut, (address)Out_buf, Out_in); + } + Out_in = 0; +} + void Out_Open (void) { } void Out_Char (CHAR ch) { - int16 error; - error = Platform_Write(Platform_StdOut, (address)&ch, 1); + if (Out_in >= 128) { + Out_Flush(); + } + Out_buf[__X(Out_in, 128)] = ch; + Out_in += 1; + if (ch == 0x0a) { + Out_Flush(); + } +} + +static int32 Out_Length (CHAR *s, LONGINT s__len) +{ + int32 _o_result; + int32 l; + l = 0; + while ((l < s__len && s[__X(l, s__len)] != 0x00)) { + l += 1; + } + _o_result = l; + return _o_result; } void Out_String (CHAR *str, LONGINT str__len) @@ -42,11 +71,16 @@ void Out_String (CHAR *str, LONGINT str__len) int32 l; int16 error; __DUP(str, str__len, CHAR); - l = 0; - while ((l < str__len && str[__X(l, str__len)] != 0x00)) { - l += 1; + l = Out_Length((void*)str, str__len); + if (Out_in + l > 128) { + Out_Flush(); + } + if (l > 128) { + error = Platform_Write(Platform_StdOut, (address)str, l); + } else { + __MOVE((address)str, (address)&Out_buf[__X(Out_in, 128)], l); + Out_in += (int16)l; } - error = Platform_Write(Platform_StdOut, (address)str, l); __DEL(str); } @@ -89,6 +123,7 @@ void Out_Int (int64 x, int64 n) void Out_Ln (void) { Out_String(Platform_NL, 3); + Out_Flush(); } static void Out_digit (int64 n, CHAR *s, LONGINT s__len, int16 *i) @@ -99,13 +134,14 @@ static void Out_digit (int64 n, CHAR *s, LONGINT s__len, int16 *i) static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16 *i) { - int16 j, l; + int16 j; + int32 l; __DUP(t, t__len, CHAR); - l = Strings_Length(t, t__len); + l = Out_Length((void*)t, t__len); if (l > *i) { l = *i; } - *i -= l; + *i -= (int16)l; j = 0; while (j < l) { s[__X(*i + j, s__len)] = t[__X(j, t__len)]; @@ -114,116 +150,7 @@ static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16 __DEL(t); } -REAL Out_Ten (int16 e) -{ - REAL _o_result; - LONGREAL r, power; - r = (LONGREAL)1; - power = (LONGREAL)10; - while (e > 0) { - if (__ODD(e)) { - r = r * power; - } - power = power * power; - e = __ASHR(e, 1); - } - _o_result = r; - return _o_result; -} - -void Out_Real (REAL x, int16 n) -{ - int16 e; - int32 f; - CHAR s[30]; - int16 i; - REAL x0; - BOOLEAN nn, en; - int32 m; - int16 d; - nn = __VAL(int32, x) < 0; - if (nn) { - n -= 1; - } - e = (int16)__MASK(__ASHR(__VAL(int32, x), 23), -256); - f = __MASK(__VAL(int32, x), -8388608); - i = 30; - if (e == 255) { - if (f == 0) { - Out_prepend((CHAR*)"Infinity", 9, (void*)s, 30, &i); - } else { - Out_prepend((CHAR*)"NaN", 4, (void*)s, 30, &i); - } - } else { - if (e == 0) { - Out_prepend((CHAR*)"E+00", 5, (void*)s, 30, &i); - m = 0; - } else { - if (nn) { - x = -x; - } - e = __ASHR((e - 127) * 77, 8); - if (e >= 0) { - x = x / (REAL)Out_Ten(e); - } else { - x = Out_Ten(-e) * x; - } - if (x >= (REAL)10) { - x = 1.0000000e-001 * x; - e += 1; - } - en = e < 0; - if (en) { - e = -e; - } - d = 2; - while (d > 0) { - Out_digit(e, (void*)s, 30, &i); - e = __DIV(e, 10); - d -= 1; - } - if (en) { - Out_prepend((CHAR*)"E-", 3, (void*)s, 30, &i); - } else { - Out_prepend((CHAR*)"E+", 3, (void*)s, 30, &i); - } - x0 = Out_Ten(7); - x = x0 * x + 5.0000000e-001; - if (x >= (REAL)10 * x0) { - x = 1.0000000e-001 * x; - e += 1; - } - m = Out_Entier32(x); - } - d = 8; - while ((((d > 2 && d > n - 5)) && (int)__MOD(m, 10) == 0)) { - m = __DIV(m, 10); - d -= 1; - } - while (d > 1) { - Out_digit(m, (void*)s, 30, &i); - m = __DIV(m, 10); - d -= 1; - } - i -= 1; - s[__X(i, 30)] = '.'; - Out_digit(m, (void*)s, 30, &i); - } - n -= 30 - i; - while (n > 0) { - Out_Char(' '); - n -= 1; - } - if (nn) { - Out_Char('-'); - } - while (i < 30) { - Out_Char(s[__X(i, 30)]); - i += 1; - } -} - -static LONGREAL Out_TenL (int16 e) +LONGREAL Out_Ten (int16 e) { LONGREAL _o_result; LONGREAL r, power; @@ -240,7 +167,7 @@ static LONGREAL Out_TenL (int16 e) return _o_result; } -void Out_LongReal (LONGREAL x, int16 n) +static void Out_RealP (LONGREAL x, int16 n, int16 exponentdigits, int16 maxsigdigits, CHAR exp) { int16 e; int64 f; @@ -249,7 +176,7 @@ void Out_LongReal (LONGREAL x, int16 n) LONGREAL x0; BOOLEAN nn, en; int64 m; - int16 d; + int16 d, dr; nn = __VAL(int64, x) < 0; if (nn) { n -= 1; @@ -265,7 +192,15 @@ void Out_LongReal (LONGREAL x, int16 n) } } else { if (e == 0) { - Out_prepend((CHAR*)"D+000", 6, (void*)s, 30, &i); + d = i - exponentdigits; + while (i > d) { + i -= 1; + s[__X(i, 30)] = '0'; + } + i -= 1; + s[__X(i, 30)] = '+'; + i -= 1; + s[__X(i, 30)] = exp; m = 0; } else { if (nn) { @@ -273,9 +208,9 @@ void Out_LongReal (LONGREAL x, int16 n) } e = (int16)__ASHR((e - 1023) * 77, 8); if (e >= 0) { - x = x / (LONGREAL)Out_TenL(e); + x = x / (LONGREAL)Out_Ten(e); } else { - x = Out_TenL(-e) * x; + x = Out_Ten(-e) * x; } if (x >= (LONGREAL)10) { x = 1.00000000000000e-001 * x; @@ -285,18 +220,21 @@ void Out_LongReal (LONGREAL x, int16 n) if (en) { e = -e; } - d = 3; + d = exponentdigits; while (d > 0) { Out_digit(e, (void*)s, 30, &i); e = __DIV(e, 10); d -= 1; } + i -= 1; if (en) { - Out_prepend((CHAR*)"D-", 3, (void*)s, 30, &i); + s[__X(i, 30)] = '-'; } else { - Out_prepend((CHAR*)"D+", 3, (void*)s, 30, &i); + s[__X(i, 30)] = '+'; } - x0 = Out_TenL(15); + i -= 1; + s[__X(i, 30)] = exp; + x0 = Out_Ten(maxsigdigits - 1); x = x0 * x + 5.00000000000000e-001; if (x >= (LONGREAL)10 * x0) { x = 1.00000000000000e-001 * x; @@ -304,8 +242,12 @@ void Out_LongReal (LONGREAL x, int16 n) } m = Out_Entier64(x); } - d = 16; - while ((((d > 2 && d > n - 6)) && __MOD(m, 10) == 0)) { + d = maxsigdigits; + dr = n - (exponentdigits + 3); + if (dr < 2) { + dr = 2; + } + while ((d > dr && __MOD(m, 10) == 0)) { m = __DIV(m, 10); d -= 1; } @@ -332,13 +274,23 @@ void Out_LongReal (LONGREAL x, int16 n) } } +void Out_Real (REAL x, int16 n) +{ + Out_RealP(x, n, 2, 7, 'E'); +} + +void Out_LongReal (LONGREAL x, int16 n) +{ + Out_RealP(x, n, 3, 16, 'D'); +} + export void *Out__init(void) { __DEFMOD; __MODULE_IMPORT(Platform); - __MODULE_IMPORT(Strings); __REGMOD("Out", 0); + __REGCMD("Flush", Out_Flush); __REGCMD("Ln", Out_Ln); __REGCMD("Open", Out_Open); /* BEGIN */ diff --git a/bootstrap/windows-88/Out.h b/bootstrap/windows-88/Out.h index 9076f6d1..362b4414 100644 --- a/bootstrap/windows-88/Out.h +++ b/bootstrap/windows-88/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h @@ -9,13 +9,14 @@ import void Out_Char (CHAR ch); +import void Out_Flush (void); import void Out_Int (int64 x, int64 n); import void Out_Ln (void); import void Out_LongReal (LONGREAL x, int16 n); import void Out_Open (void); import void Out_Real (REAL x, int16 n); import void Out_String (CHAR *str, LONGINT str__len); -import REAL Out_Ten (int16 e); +import LONGREAL Out_Ten (int16 e); import void *Out__init(void); diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 6f3c4e4f..7efc77b3 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index 1008cc4b..52d679bb 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 4e18ac01..8697b424 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index 5728d211..e764f95f 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index 37643e92..8a95a8eb 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -24,15 +24,22 @@ export void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR int16 Strings_Length (CHAR *s, LONGINT s__len) { int16 _o_result; - int16 i; + int32 i; __DUP(s, s__len, CHAR); i = 0; while ((i < s__len && s[__X(i, s__len)] != 0x00)) { i += 1; } - _o_result = i; - __DEL(s); - return _o_result; + if (i <= 32767) { + _o_result = (int16)i; + __DEL(s); + return _o_result; + } else { + _o_result = 32767; + __DEL(s); + return _o_result; + } + __RETCHK; } void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len) diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index b7482150..4989383b 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index 0d2f319e..ce4a885a 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index 4b01b650..26669d1c 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/errors.c b/bootstrap/windows-88/errors.c index 5ecfeea1..408d5ec7 100644 --- a/bootstrap/windows-88/errors.c +++ b/bootstrap/windows-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/errors.h b/bootstrap/windows-88/errors.h index 20eeca0d..b0247272 100644 --- a/bootstrap/windows-88/errors.h +++ b/bootstrap/windows-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index b1328b1c..5df06422 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index 27684ca4..ef0da35c 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/vt100.c b/bootstrap/windows-88/vt100.c index a2c7b023..65b16ccc 100644 --- a/bootstrap/windows-88/vt100.c +++ b/bootstrap/windows-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/vt100.h b/bootstrap/windows-88/vt100.h index 83b8a893..2211e981 100644 --- a/bootstrap/windows-88/vt100.h +++ b/bootstrap/windows-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/src/runtime/Out.Mod b/src/runtime/Out.Mod index 72287c56..9463fef8 100644 --- a/src/runtime/Out.Mod +++ b/src/runtime/Out.Mod @@ -1,24 +1,46 @@ MODULE Out; (* DCW Brown. 2016-09-27 *) -IMPORT SYSTEM, Platform, Strings; +IMPORT SYSTEM, Platform; + +VAR buf: ARRAY 128 OF CHAR; in: INTEGER; + +PROCEDURE Flush*; +VAR error: Platform.ErrorCode; +BEGIN + IF in > 0 THEN error := Platform.Write(Platform.StdOut, SYSTEM.ADR(buf), in) END; + in := 0; +END Flush; PROCEDURE Open*; BEGIN END Open; PROCEDURE Char*(ch: CHAR); - VAR error: Platform.ErrorCode; BEGIN - error := Platform.Write(Platform.StdOut, SYSTEM.ADR(ch), 1) + IF in >= LEN(buf) THEN Flush END; + buf[in] := ch; INC(in); + IF ch = 0AX THEN Flush END; END Char; +PROCEDURE Length(VAR s: ARRAY OF CHAR): LONGINT; +VAR l: LONGINT; +BEGIN l := 0; WHILE (l < LEN(s)) & (s[l] # 0X) DO INC(l) END; RETURN l +END Length; + PROCEDURE String*(str: ARRAY OF CHAR); VAR l: LONGINT; error: Platform.ErrorCode; BEGIN - l := 0; WHILE (l < LEN(str)) & (str[l] # 0X) DO INC(l) END; - error := Platform.Write(Platform.StdOut, SYSTEM.ADR(str), l) + l := Length(str); + IF in + l > LEN(buf) THEN Flush END; + IF l > LEN(buf) THEN + (* Doesn't fit buf. Bypass buffering. *) + error := Platform.Write(Platform.StdOut, SYSTEM.ADR(str), l) + ELSE + SYSTEM.MOVE(SYSTEM.ADR(str), SYSTEM.ADR(buf[in]), l); INC(in, SHORT(l)); + END END String; + PROCEDURE Int*(x, n: HUGEINT); CONST zero = ORD('0'); VAR s: ARRAY 22 OF CHAR; i: INTEGER; negative: BOOLEAN; @@ -41,7 +63,7 @@ BEGIN END Int; PROCEDURE Ln*; -BEGIN String(Platform.NL) +BEGIN String(Platform.NL); Flush; END Ln; @@ -53,109 +75,27 @@ BEGIN END digit; PROCEDURE prepend(t: ARRAY OF CHAR; VAR s: ARRAY OF CHAR; VAR i: INTEGER); - VAR j, l: INTEGER; + VAR j: INTEGER; l: LONGINT; BEGIN - l := Strings.Length(t); IF l > i THEN l := i END; - DEC(i, l); j := 0; + l := Length(t); IF l > i THEN l := i END; + DEC(i, SHORT(l)); j := 0; WHILE j < l DO s[i+j] := t[j]; INC(j) END END prepend; -PROCEDURE Ten*(e: INTEGER): REAL; +PROCEDURE Ten*(e: INTEGER): LONGREAL; VAR r, power: LONGREAL; -BEGIN r := 1.0; power := 10.0; +BEGIN r := 1.0D0; power := 1.0D1; WHILE e > 0 DO IF ODD(e) THEN r := r*power END; power := power*power; e := e DIV 2 END; - RETURN SHORT(r) -END Ten; - -PROCEDURE -Entier32(x: REAL): SYSTEM.INT32 "(int32)(x)"; - -PROCEDURE Real*(x: REAL; n: INTEGER); - -(* Real(x, n) writes the real number x to the end of the output stream using an - exponential form. If the textual representation of x requires m characters (including a - two-digit signed exponent), x is right adjusted in a ï¬eld of Max(n, m) characters padded - with blanks at the left end. A plus sign of the mantissa is not written. - REAL is 1/sign, 8/exponent, 23/significand *) - -CONST - maxsigdigits = 8; (* Max significant digits to display from mantissa *) - -VAR - e: INTEGER; (* Exponent field *) - f: SYSTEM.INT32; (* Fraction field *) - s: ARRAY 30 OF CHAR; (* Buffer built backwards *) - i: INTEGER; (* Index into s *) - x0: REAL; - nn: BOOLEAN; (* Number negative *) - en: BOOLEAN; (* Exponent negative *) - m: SYSTEM.INT32; (* Mantissa digits *) - d: INTEGER; (* Significant digit count to display *) - -BEGIN - nn := SYSTEM.VAL(SYSTEM.INT32, x) < 0; IF nn THEN DEC(n) END; - e := SYSTEM.VAL(INTEGER, (SYSTEM.VAL(SYSTEM.INT32, x) DIV 800000H) MOD 100H); - f := SYSTEM.VAL(SYSTEM.INT32, x) MOD 800000H; - - i := LEN(s); - IF e = 0FFH THEN (* NaN / Infinity *) - IF f = 0 THEN prepend("Infinity", s, i) ELSE prepend("NaN", s, i) END - ELSE - IF e = 0 THEN prepend("E+00", s, i); m := 0; - ELSE - IF nn THEN x := -x END; - - (* Scale e to be an exponent of 10 rather than 2 *) - e := (e - 127) * 77 DIV 256; - IF e >= 0 THEN x := x / Ten(e) ELSE x := Ten(-e) * x END ; - IF x >= 10.0 THEN x := 0.1 * x; INC(e) END; - - (* Generate the exponent digits *) - en := e < 0; IF en THEN e := - e END; - d := 2; WHILE d > 0 DO digit(e, s, i); e := e DIV 10; DEC(d) END; - IF en THEN prepend("E-", s, i) ELSE prepend("E+", s, i) END; - - (* Scale x to 8 significant digits *) - x0 := Ten(maxsigdigits-1); x := x0*x + 0.5; - IF x >= 10.0*x0 THEN x := 0.1*x; INC(e) END; - m := Entier32(x) - END; - - (* Drop trailing zeroes where we don't have room *) - d := maxsigdigits; - WHILE (d > 2) & (d > n-5) & (m MOD 10 = 0) DO m := m DIV 10; DEC(d) END; - - (* Render significant digits *) - WHILE d > 1 DO digit(m, s, i); m := m DIV 10; DEC(d) END; - DEC(i); s[i] := '.'; - digit(m, s, i); - END; - - (* Generate leading padding *) - DEC(n, LEN(s)-i); WHILE n > 0 DO Char(" "); DEC(n) END; - - (* Render prepared number from right end of buffer s *) - IF nn THEN Char("-") END; - WHILE i < LEN(s) DO Char(s[i]); INC(i) END -END Real; - - -PROCEDURE TenL(e: INTEGER): LONGREAL; - VAR r, power: LONGREAL; -BEGIN r := 1.0; power := 10.0; - WHILE e > 0 DO - IF ODD(e) THEN r := r*power END; - power := power*power; e := e DIV 2; - END; RETURN r -END TenL; +END Ten; PROCEDURE -Entier64(x: LONGREAL): SYSTEM.INT64 "(int64)(x)"; -PROCEDURE LongReal*(x: LONGREAL; n: INTEGER); +PROCEDURE RealP(x: LONGREAL; n, exponentdigits, maxsigdigits: INTEGER; exp: CHAR); (* LongReal(x, n) writes the long real number x to the end of the output stream using an exponential form. If the textual representation of x requires m characters (including a @@ -163,9 +103,6 @@ PROCEDURE LongReal*(x: LONGREAL; n: INTEGER); with blanks at the left end. A plus sign of the mantissa is not written. LONGREAL is 1/sign, 11/exponent, 52/significand *) -CONST - maxsigdigits = 16; (* Max significant digits to display from mantissa *) - VAR e: INTEGER; (* Exponent field *) f: HUGEINT; (* Fraction field *) @@ -176,6 +113,7 @@ VAR en: BOOLEAN; (* Exponent negative *) m: HUGEINT; (* Mantissa digits *) d: INTEGER; (* Significant digit count to display *) + dr: INTEGER; (* Number of insignificant digits that can be dropped *) BEGIN nn := SYSTEM.VAL(HUGEINT, x) < 0; IF nn THEN DEC(n) END; @@ -186,22 +124,32 @@ BEGIN IF e = 7FFH THEN (* NaN / Infinity *) IF f = 0 THEN prepend("Infinity", s, i) ELSE prepend("NaN", s, i) END ELSE - IF e = 0 THEN prepend("D+000", s, i); m := 0; + IF e = 0 THEN + d := i - exponentdigits; WHILE i > d DO DEC(i); s[i] := "0" END; + DEC(i); s[i] := "+"; + DEC(i); s[i] := exp; + m := 0; ELSE IF nn THEN x := -x END; (* Scale e to be an exponent of 10 rather than 2 *) e := SHORT(LONG(e - 1023) * 77 DIV 256); - IF e >= 0 THEN x := x / TenL(e) ELSE x := TenL(-e) * x END ; + IF e >= 0 THEN x := x / Ten(e) ELSE x := Ten(-e) * x END ; IF x >= 10.0D0 THEN x := 0.1D0 * x; INC(e) END; (* Generate the exponent digits *) en := e < 0; IF en THEN e := - e END; - d := 3; WHILE d > 0 DO digit(e, s, i); e := e DIV 10; DEC(d) END; - IF en THEN prepend("D-", s, i) ELSE prepend("D+", s, i) END; + d := exponentdigits; + WHILE d > 0 DO digit(e, s, i); e := e DIV 10; DEC(d) END; + DEC(i); IF en THEN s[i] := "-" ELSE s[i] := "+" END; + DEC(i); s[i] := exp; - (* Scale x to 15 significant digits *) - x0 := TenL(maxsigdigits-1); + (* Todo: generate more than maxsigdigits if we have room for them *) + + (* Scale x to enoughsignificant digits to reliably test for trailing + zeroes. + todo or to the amount of space available, if greater. *) + x0 := Ten(maxsigdigits-1); x := x0 * x + 0.5D0; IF x >= 10.0D0 * x0 THEN x := 0.1D0 * x; INC(e) END; m := Entier64(x) @@ -209,7 +157,9 @@ BEGIN (* Drop trailing zeroes where we don't have room *) d := maxsigdigits; - WHILE (d > 2) & (d > n-6) & (m MOD 10 = 0) DO m := m DIV 10; DEC(d) END; + dr := n - (exponentdigits + 3); (* 3 for '.', D/E and +/- *) + IF dr < 2 THEN dr := 2 END; + WHILE (d > dr) & (m MOD 10 = 0) DO m := m DIV 10; DEC(d) END; (* Render significant digits *) WHILE d > 1 DO digit(m, s, i); m := m DIV 10; DEC(d) END; @@ -223,7 +173,15 @@ BEGIN (* Render prepared number from right end of buffer s *) IF nn THEN Char("-") END; WHILE i < LEN(s) DO Char(s[i]); INC(i) END +END RealP; + + +PROCEDURE Real*(x: REAL; n: INTEGER); +BEGIN RealP(x, n, 2, 7, "E"); +END Real; + +PROCEDURE LongReal*(x: LONGREAL; n: INTEGER); +BEGIN RealP(x, n, 3, 16, "D"); END LongReal; - END Out. diff --git a/src/runtime/Strings.Mod b/src/runtime/Strings.Mod index e6fe12ac..0dcfa6d2 100644 --- a/src/runtime/Strings.Mod +++ b/src/runtime/Strings.Mod @@ -32,10 +32,10 @@ MODULE Strings; (*HM 94-06-22 / *) PROCEDURE Length* (s: ARRAY OF CHAR): INTEGER; - VAR i: INTEGER; + VAR i: LONGINT; BEGIN - i := 0; WHILE (i < LEN(s)) & (s[i] # 0X) DO INC(i) END ; - RETURN i + i := 0; WHILE (i < LEN(s)) & (s[i] # 0X) DO INC(i) END; + IF i <= MAX(INTEGER) THEN RETURN SHORT(i) ELSE RETURN MAX(INTEGER) END END Length; diff --git a/src/test/confidence/out/expected b/src/test/confidence/out/expected index 5343a884..b71feae8 100644 --- a/src/test/confidence/out/expected +++ b/src/test/confidence/out/expected @@ -80,15 +80,15 @@ Testing REAL. 1 2 3 123456789012345678901234567890 - 1.0E0: 1.0000000E+00 - 1.1E0: 1.1000000E+00 - 2.1E0: 2.1000000E+00 --1.1E0: -1.1000000E+00 - 1.1E3: 1.1000000E+03 - 1.1E-3: 1.1000000E-03 - 1.2345678987654321E3: 1.2345680E+03 - 0.0: 0.0000000E+00 - 0.000123E0: 1.2300000E-04 + 1.0E0: 1.000000E+00 + 1.1E0: 1.100000E+00 + 2.1E0: 2.100000E+00 +-1.1E0: -1.100000E+00 + 1.1E3: 1.100000E+03 + 1.1E-3: 1.100000E-03 + 1.2345678987654321E3: 1.234568E+03 + 0.0: 0.000000E+00 + 0.000123E0: 1.230000E-04 1/0.0: Infinity -1/0.0: -Infinity @@ -176,15 +176,15 @@ Testing REAL. 1 2 3 123456789012345678901234567890 - 1.0E0: 1.0000000E+00 - 1.1E0: 1.1000000E+00 - 2.1E0: 2.1000000E+00 --1.1E0: -1.1000000E+00 - 1.1E3: 1.1000000E+03 - 1.1E-3: 1.1000000E-03 - 1.2345678987654321E3: 1.2345680E+03 - 0.0: 0.0000000E+00 - 0.000123E0: 1.2300000E-04 + 1.0E0: 1.000000E+00 + 1.1E0: 1.100000E+00 + 2.1E0: 2.100000E+00 +-1.1E0: -1.100000E+00 + 1.1E3: 1.100000E+03 + 1.1E-3: 1.100000E-03 + 1.2345678987654321E3: 1.234568E+03 + 0.0: 0.000000E+00 + 0.000123E0: 1.230000E-04 1/0.0: Infinity -1/0.0: -Infinity diff --git a/src/test/confidence/out/result-O2 b/src/test/confidence/out/result-O2 index 1121e4ae..78548b4d 100644 --- a/src/test/confidence/out/result-O2 +++ b/src/test/confidence/out/result-O2 @@ -79,15 +79,15 @@ Testing REAL. 1 2 3 123456789012345678901234567890 - 1.0E0: 1.0000000E+00 - 1.1E0: 1.1000000E+00 - 2.1E0: 2.1000000E+00 --1.1E0: -1.1000000E+00 - 1.1E3: 1.1000000E+03 - 1.1E-3: 1.1000000E-03 - 1.2345678987654321E3: 1.2345680E+03 - 0.0: 0.0000000E+00 - 0.000123E0: 1.2300000E-04 + 1.0E0: 1.000000E+00 + 1.1E0: 1.100000E+00 + 2.1E0: 2.100000E+00 +-1.1E0: -1.100000E+00 + 1.1E3: 1.100000E+03 + 1.1E-3: 1.100000E-03 + 1.2345678987654321E3: 1.234568E+03 + 0.0: 0.000000E+00 + 0.000123E0: 1.230000E-04 1/0.0: Infinity -1/0.0: -Infinity diff --git a/src/test/confidence/out/result-OC b/src/test/confidence/out/result-OC index 8713aa8e..fc82e517 100644 --- a/src/test/confidence/out/result-OC +++ b/src/test/confidence/out/result-OC @@ -79,15 +79,15 @@ Testing REAL. 1 2 3 123456789012345678901234567890 - 1.0E0: 1.0000000E+00 - 1.1E0: 1.1000000E+00 - 2.1E0: 2.1000000E+00 --1.1E0: -1.1000000E+00 - 1.1E3: 1.1000000E+03 - 1.1E-3: 1.1000000E-03 - 1.2345678987654321E3: 1.2345680E+03 - 0.0: 0.0000000E+00 - 0.000123E0: 1.2300000E-04 + 1.0E0: 1.000000E+00 + 1.1E0: 1.100000E+00 + 2.1E0: 2.100000E+00 +-1.1E0: -1.100000E+00 + 1.1E3: 1.100000E+03 + 1.1E-3: 1.100000E-03 + 1.2345678987654321E3: 1.234568E+03 + 0.0: 0.000000E+00 + 0.000123E0: 1.230000E-04 1/0.0: Infinity -1/0.0: -Infinity From fb3753c55d0acd09225fc4982768a3235a53f1a7 Mon Sep 17 00:00:00 2001 From: David Brown Date: Tue, 11 Oct 2016 12:11:57 +0100 Subject: [PATCH 275/580] Add hard reset and clean to postpush script. --- src/tools/make/postpush.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/make/postpush.pl b/src/tools/make/postpush.pl index fe9e62ad..47956785 100755 --- a/src/tools/make/postpush.pl +++ b/src/tools/make/postpush.pl @@ -43,7 +43,7 @@ if ($buildneeded) { } else { close(STDIN); close(STDOUT); close(STDERR); # child process system 'echo Syncing voc>postpush.log'; - system '(cd voc; git pull; git checkout -f ' . $branch . '; git pull; git checkout -f) >>postpush.log'; + system '(cd voc; git reset --hard; git clean -dfx; git pull; git checkout -f ' . $branch . '; git pull; git checkout -f) >>postpush.log'; exec 'perl voc/src/tools/make/buildall.pl ' . $branch . ' >/tmp/buildall.log'; exit; } From 1ef199dd933d4c1843b62405fb25d56f97b4cfcc Mon Sep 17 00:00:00 2001 From: David Brown Date: Tue, 11 Oct 2016 12:22:07 +0100 Subject: [PATCH 276/580] Add hard reset and clean to buildall script. --- src/tools/make/buildall.pl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/tools/make/buildall.pl b/src/tools/make/buildall.pl index 01f262c2..d4f36bd0 100755 --- a/src/tools/make/buildall.pl +++ b/src/tools/make/buildall.pl @@ -6,6 +6,7 @@ use Cwd; my $branch = "master"; + if (defined($ARGV[0]) && ($ARGV[0] ne "")) {$branch = $ARGV[0]} my %machines = ( @@ -14,7 +15,8 @@ my %machines = ( "wind" => ['-p5932 dave@wax', "", "vishaps/voc", "export CC=gcc && make full;" . "export CC=i686-w64-mingw32-gcc && make full;" . "cd ~;" - . "sh start64.sh \\\"cd vishaps/voc && git pull && git checkout $branch && git pull;" + . "sh start64.sh \\\"cd vishaps/voc && git reset --hard && git clean -dfx &&" + . "git pull && git checkout $branch && git pull;" . "export CC=gcc && make full;" . "export CC=x86_64-w64-mingw32-gcc && make full\\\""], "android" => ['-p8022 root@and', "", "vishap/voc", "export CC=gcc && make full"], @@ -55,7 +57,8 @@ unlink glob "log/*"; for my $machine (sort keys %machines) { my ($login, $sudo, $dir, $mkcmd) = @{$machines{$machine}}; - my $cmd = "ssh $login \"cd $dir && $sudo git pull && $sudo git checkout -f $branch && $sudo git pull && $sudo $mkcmd\" "; + my $cmd = "ssh $login \"cd $dir && $sudo git reset --hard && sudo git clean -dfx &&" + . "$sudo git pull && $sudo git checkout -f $branch && $sudo git pull && $sudo $mkcmd\" "; logged($cmd, $machine); } From 1a3364269eb8b619f2dbcbf9742010fc2ad84add Mon Sep 17 00:00:00 2001 From: David Brown Date: Tue, 11 Oct 2016 15:35:37 +0100 Subject: [PATCH 277/580] Remove unwanted result files from git and correct use of sudo in buildall. --- .gitignore | 1 + src/test/confidence/out/result-O2 | 93 ------------------------------- src/test/confidence/out/result-OC | 93 ------------------------------- src/tools/make/buildall.pl | 2 +- 4 files changed, 2 insertions(+), 187 deletions(-) delete mode 100644 src/test/confidence/out/result-O2 delete mode 100644 src/test/confidence/out/result-OC diff --git a/.gitignore b/.gitignore index 2c05bb3a..db4032e0 100644 --- a/.gitignore +++ b/.gitignore @@ -19,6 +19,7 @@ /src/test/**/*.sym **/*.stackdump /src/test/confidence/**/result +/src/test/confidence/**/result-* /src/test/confidence/**/*.asm /src/test/confidence/**/*.s /src/test/confidence/**/*.map diff --git a/src/test/confidence/out/result-O2 b/src/test/confidence/out/result-O2 deleted file mode 100644 index 78548b4d..00000000 --- a/src/test/confidence/out/result-O2 +++ /dev/null @@ -1,93 +0,0 @@ -Out module tests. -SIZE(INTEGER) = 2 - -Testing LONGREAL. - - 1 2 3 - 123456789012345678901234567890 - 1.0D0: 1.0D+000 - 1.1D0: 1.1D+000 - 2.1D0: 2.1D+000 --1.1D0: -1.1D+000 - 1.1D3: 1.1D+003 - 1.1D-3: 1.1D-003 - 1.2345678987654321D3: 1.23456789876543D+003 - 0.0: 0.0D+000 - 0.000123D0: 1.23D-004 - 1/0.0: Infinity --1/0.0: -Infinity - - 1 2 3 - 123456789012345678901234567890 - 1.0D0: 1.00000D+000 - 1.1D0: 1.10000D+000 - 2.1D0: 2.10000D+000 --1.1D0: -1.1000D+000 - 1.1D3: 1.10000D+003 - 1.1D-3: 1.10000D-003 - 1.2345678987654321D3: 1.23456789876543D+003 - 0.0: 0.00000D+000 - 0.000123D0: 1.23000D-004 - 1/0.0: Infinity --1/0.0: -Infinity - - 1 2 3 - 123456789012345678901234567890 - 1.0D0: 1.000000000000000D+000 - 1.1D0: 1.100000000000000D+000 - 2.1D0: 2.100000000000000D+000 --1.1D0: -1.100000000000000D+000 - 1.1D3: 1.100000000000000D+003 - 1.1D-3: 1.100000000000000D-003 - 1.2345678987654321D3: 1.234567898765430D+003 - 0.0: 0.000000000000000D+000 - 0.000123D0: 1.230000000000000D-004 - 1/0.0: Infinity --1/0.0: -Infinity - - - -Testing REAL. - - 1 2 3 - 123456789012345678901234567890 - 1.0E0: 1.0E+00 - 1.1E0: 1.1E+00 - 2.1E0: 2.1E+00 --1.1E0: -1.1E+00 - 1.1E3: 1.1E+03 - 1.1E-3: 1.1E-03 - 1.2345678987654321E3: 1.234568E+03 - 0.0: 0.0E+00 - 0.000123E0: 1.23E-04 - 1/0.0: Infinity --1/0.0: -Infinity - - 1 2 3 - 123456789012345678901234567890 - 1.0E0: 1.000000E+00 - 1.1E0: 1.100000E+00 - 2.1E0: 2.100000E+00 --1.1E0: -1.10000E+00 - 1.1E3: 1.100000E+03 - 1.1E-3: 1.100000E-03 - 1.2345678987654321E3: 1.234568E+03 - 0.0: 0.000000E+00 - 0.000123E0: 1.230000E-04 - 1/0.0: Infinity --1/0.0: -Infinity - - 1 2 3 - 123456789012345678901234567890 - 1.0E0: 1.000000E+00 - 1.1E0: 1.100000E+00 - 2.1E0: 2.100000E+00 --1.1E0: -1.100000E+00 - 1.1E3: 1.100000E+03 - 1.1E-3: 1.100000E-03 - 1.2345678987654321E3: 1.234568E+03 - 0.0: 0.000000E+00 - 0.000123E0: 1.230000E-04 - 1/0.0: Infinity --1/0.0: -Infinity - diff --git a/src/test/confidence/out/result-OC b/src/test/confidence/out/result-OC deleted file mode 100644 index fc82e517..00000000 --- a/src/test/confidence/out/result-OC +++ /dev/null @@ -1,93 +0,0 @@ -Out module tests. -SIZE(INTEGER) = 4 - -Testing LONGREAL. - - 1 2 3 - 123456789012345678901234567890 - 1.0D0: 1.0D+000 - 1.1D0: 1.1D+000 - 2.1D0: 2.1D+000 --1.1D0: -1.1D+000 - 1.1D3: 1.1D+003 - 1.1D-3: 1.1D-003 - 1.2345678987654321D3: 1.23456789876543D+003 - 0.0: 0.0D+000 - 0.000123D0: 1.23D-004 - 1/0.0: Infinity --1/0.0: -Infinity - - 1 2 3 - 123456789012345678901234567890 - 1.0D0: 1.00000D+000 - 1.1D0: 1.10000D+000 - 2.1D0: 2.10000D+000 --1.1D0: -1.1000D+000 - 1.1D3: 1.10000D+003 - 1.1D-3: 1.10000D-003 - 1.2345678987654321D3: 1.23456789876543D+003 - 0.0: 0.00000D+000 - 0.000123D0: 1.23000D-004 - 1/0.0: Infinity --1/0.0: -Infinity - - 1 2 3 - 123456789012345678901234567890 - 1.0D0: 1.000000000000000D+000 - 1.1D0: 1.100000000000000D+000 - 2.1D0: 2.100000000000000D+000 --1.1D0: -1.100000000000000D+000 - 1.1D3: 1.100000000000000D+003 - 1.1D-3: 1.100000000000000D-003 - 1.2345678987654321D3: 1.234567898765430D+003 - 0.0: 0.000000000000000D+000 - 0.000123D0: 1.230000000000000D-004 - 1/0.0: Infinity --1/0.0: -Infinity - - - -Testing REAL. - - 1 2 3 - 123456789012345678901234567890 - 1.0E0: 1.0E+00 - 1.1E0: 1.1E+00 - 2.1E0: 2.1E+00 --1.1E0: -1.1E+00 - 1.1E3: 1.1E+03 - 1.1E-3: 1.1E-03 - 1.2345678987654321E3: 1.234568E+03 - 0.0: 0.0E+00 - 0.000123E0: 1.23E-04 - 1/0.0: Infinity --1/0.0: -Infinity - - 1 2 3 - 123456789012345678901234567890 - 1.0E0: 1.000000E+00 - 1.1E0: 1.100000E+00 - 2.1E0: 2.100000E+00 --1.1E0: -1.10000E+00 - 1.1E3: 1.100000E+03 - 1.1E-3: 1.100000E-03 - 1.2345678987654321E3: 1.234568E+03 - 0.0: 0.000000E+00 - 0.000123E0: 1.230000E-04 - 1/0.0: Infinity --1/0.0: -Infinity - - 1 2 3 - 123456789012345678901234567890 - 1.0E0: 1.000000E+00 - 1.1E0: 1.100000E+00 - 2.1E0: 2.100000E+00 --1.1E0: -1.100000E+00 - 1.1E3: 1.100000E+03 - 1.1E-3: 1.100000E-03 - 1.2345678987654321E3: 1.234568E+03 - 0.0: 0.000000E+00 - 0.000123E0: 1.230000E-04 - 1/0.0: Infinity --1/0.0: -Infinity - diff --git a/src/tools/make/buildall.pl b/src/tools/make/buildall.pl index d4f36bd0..20d99cbd 100755 --- a/src/tools/make/buildall.pl +++ b/src/tools/make/buildall.pl @@ -57,7 +57,7 @@ unlink glob "log/*"; for my $machine (sort keys %machines) { my ($login, $sudo, $dir, $mkcmd) = @{$machines{$machine}}; - my $cmd = "ssh $login \"cd $dir && $sudo git reset --hard && sudo git clean -dfx &&" + my $cmd = "ssh $login \"cd $dir && $sudo git reset --hard && $sudo git clean -dfx &&" . "$sudo git pull && $sudo git checkout -f $branch && $sudo git pull && $sudo $mkcmd\" "; logged($cmd, $machine); } From f0a68cf6f9f5b8a3bc160275fd9b93bfc75b0a15 Mon Sep 17 00:00:00 2001 From: David Brown Date: Wed, 12 Oct 2016 11:12:08 +0100 Subject: [PATCH 278/580] Improved Out.Real* layout and build type independence. --- bootstrap/unix-44/Out.c | 54 +++++--- bootstrap/unix-48/Out.c | 54 +++++--- bootstrap/unix-88/Out.c | 54 +++++--- bootstrap/windows-48/Out.c | 54 +++++--- bootstrap/windows-88/Out.c | 54 +++++--- src/runtime/Out.Mod | 70 ++++++---- src/test/confidence/out/expected | 196 +++++++++++++++++++--------- src/test/confidence/out/outtest.mod | 130 +++++++++++++----- 8 files changed, 456 insertions(+), 210 deletions(-) diff --git a/bootstrap/unix-44/Out.c b/bootstrap/unix-44/Out.c index 3df836a0..1d0fcf65 100644 --- a/bootstrap/unix-44/Out.c +++ b/bootstrap/unix-44/Out.c @@ -21,7 +21,7 @@ export void Out_Ln (void); export void Out_LongReal (LONGREAL x, int16 n); export void Out_Open (void); export void Out_Real (REAL x, int16 n); -static void Out_RealP (LONGREAL x, int16 n, int16 exponentdigits, int16 maxsigdigits, CHAR exp); +static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_); export void Out_String (CHAR *str, LONGINT str__len); export LONGREAL Out_Ten (int16 e); static void Out_digit (int64 n, CHAR *s, LONGINT s__len, int16 *i); @@ -167,12 +167,12 @@ LONGREAL Out_Ten (int16 e) return _o_result; } -static void Out_RealP (LONGREAL x, int16 n, int16 exponentdigits, int16 maxsigdigits, CHAR exp) +static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_) { int16 e; int64 f; CHAR s[30]; - int16 i; + int16 i, el; LONGREAL x0; BOOLEAN nn, en; int64 m; @@ -191,16 +191,35 @@ static void Out_RealP (LONGREAL x, int16 n, int16 exponentdigits, int16 maxsigdi Out_prepend((CHAR*)"NaN", 4, (void*)s, 30, &i); } } else { + if (long_) { + el = 3; + dr = n - 6; + if (dr > 17) { + dr = 17; + } + d = dr; + if (d < 16) { + d = 16; + } + } else { + el = 2; + dr = n - 5; + if (dr > 9) { + dr = 9; + } + d = dr; + if (d < 7) { + d = 7; + } + } if (e == 0) { - d = i - exponentdigits; - while (i > d) { + while (el > 0) { i -= 1; s[__X(i, 30)] = '0'; + el -= 1; } i -= 1; s[__X(i, 30)] = '+'; - i -= 1; - s[__X(i, 30)] = exp; m = 0; } else { if (nn) { @@ -220,11 +239,10 @@ static void Out_RealP (LONGREAL x, int16 n, int16 exponentdigits, int16 maxsigdi if (en) { e = -e; } - d = exponentdigits; - while (d > 0) { + while (el > 0) { Out_digit(e, (void*)s, 30, &i); e = __DIV(e, 10); - d -= 1; + el -= 1; } i -= 1; if (en) { @@ -232,9 +250,7 @@ static void Out_RealP (LONGREAL x, int16 n, int16 exponentdigits, int16 maxsigdi } else { s[__X(i, 30)] = '+'; } - i -= 1; - s[__X(i, 30)] = exp; - x0 = Out_Ten(maxsigdigits - 1); + x0 = Out_Ten(d - 1); x = x0 * x + 5.00000000000000e-001; if (x >= (LONGREAL)10 * x0) { x = 1.00000000000000e-001 * x; @@ -242,8 +258,12 @@ static void Out_RealP (LONGREAL x, int16 n, int16 exponentdigits, int16 maxsigdi } m = Out_Entier64(x); } - d = maxsigdigits; - dr = n - (exponentdigits + 3); + i -= 1; + if (long_) { + s[__X(i, 30)] = 'D'; + } else { + s[__X(i, 30)] = 'E'; + } if (dr < 2) { dr = 2; } @@ -276,12 +296,12 @@ static void Out_RealP (LONGREAL x, int16 n, int16 exponentdigits, int16 maxsigdi void Out_Real (REAL x, int16 n) { - Out_RealP(x, n, 2, 7, 'E'); + Out_RealP(x, n, 0); } void Out_LongReal (LONGREAL x, int16 n) { - Out_RealP(x, n, 3, 16, 'D'); + Out_RealP(x, n, 1); } diff --git a/bootstrap/unix-48/Out.c b/bootstrap/unix-48/Out.c index 3df836a0..1d0fcf65 100644 --- a/bootstrap/unix-48/Out.c +++ b/bootstrap/unix-48/Out.c @@ -21,7 +21,7 @@ export void Out_Ln (void); export void Out_LongReal (LONGREAL x, int16 n); export void Out_Open (void); export void Out_Real (REAL x, int16 n); -static void Out_RealP (LONGREAL x, int16 n, int16 exponentdigits, int16 maxsigdigits, CHAR exp); +static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_); export void Out_String (CHAR *str, LONGINT str__len); export LONGREAL Out_Ten (int16 e); static void Out_digit (int64 n, CHAR *s, LONGINT s__len, int16 *i); @@ -167,12 +167,12 @@ LONGREAL Out_Ten (int16 e) return _o_result; } -static void Out_RealP (LONGREAL x, int16 n, int16 exponentdigits, int16 maxsigdigits, CHAR exp) +static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_) { int16 e; int64 f; CHAR s[30]; - int16 i; + int16 i, el; LONGREAL x0; BOOLEAN nn, en; int64 m; @@ -191,16 +191,35 @@ static void Out_RealP (LONGREAL x, int16 n, int16 exponentdigits, int16 maxsigdi Out_prepend((CHAR*)"NaN", 4, (void*)s, 30, &i); } } else { + if (long_) { + el = 3; + dr = n - 6; + if (dr > 17) { + dr = 17; + } + d = dr; + if (d < 16) { + d = 16; + } + } else { + el = 2; + dr = n - 5; + if (dr > 9) { + dr = 9; + } + d = dr; + if (d < 7) { + d = 7; + } + } if (e == 0) { - d = i - exponentdigits; - while (i > d) { + while (el > 0) { i -= 1; s[__X(i, 30)] = '0'; + el -= 1; } i -= 1; s[__X(i, 30)] = '+'; - i -= 1; - s[__X(i, 30)] = exp; m = 0; } else { if (nn) { @@ -220,11 +239,10 @@ static void Out_RealP (LONGREAL x, int16 n, int16 exponentdigits, int16 maxsigdi if (en) { e = -e; } - d = exponentdigits; - while (d > 0) { + while (el > 0) { Out_digit(e, (void*)s, 30, &i); e = __DIV(e, 10); - d -= 1; + el -= 1; } i -= 1; if (en) { @@ -232,9 +250,7 @@ static void Out_RealP (LONGREAL x, int16 n, int16 exponentdigits, int16 maxsigdi } else { s[__X(i, 30)] = '+'; } - i -= 1; - s[__X(i, 30)] = exp; - x0 = Out_Ten(maxsigdigits - 1); + x0 = Out_Ten(d - 1); x = x0 * x + 5.00000000000000e-001; if (x >= (LONGREAL)10 * x0) { x = 1.00000000000000e-001 * x; @@ -242,8 +258,12 @@ static void Out_RealP (LONGREAL x, int16 n, int16 exponentdigits, int16 maxsigdi } m = Out_Entier64(x); } - d = maxsigdigits; - dr = n - (exponentdigits + 3); + i -= 1; + if (long_) { + s[__X(i, 30)] = 'D'; + } else { + s[__X(i, 30)] = 'E'; + } if (dr < 2) { dr = 2; } @@ -276,12 +296,12 @@ static void Out_RealP (LONGREAL x, int16 n, int16 exponentdigits, int16 maxsigdi void Out_Real (REAL x, int16 n) { - Out_RealP(x, n, 2, 7, 'E'); + Out_RealP(x, n, 0); } void Out_LongReal (LONGREAL x, int16 n) { - Out_RealP(x, n, 3, 16, 'D'); + Out_RealP(x, n, 1); } diff --git a/bootstrap/unix-88/Out.c b/bootstrap/unix-88/Out.c index 3df836a0..1d0fcf65 100644 --- a/bootstrap/unix-88/Out.c +++ b/bootstrap/unix-88/Out.c @@ -21,7 +21,7 @@ export void Out_Ln (void); export void Out_LongReal (LONGREAL x, int16 n); export void Out_Open (void); export void Out_Real (REAL x, int16 n); -static void Out_RealP (LONGREAL x, int16 n, int16 exponentdigits, int16 maxsigdigits, CHAR exp); +static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_); export void Out_String (CHAR *str, LONGINT str__len); export LONGREAL Out_Ten (int16 e); static void Out_digit (int64 n, CHAR *s, LONGINT s__len, int16 *i); @@ -167,12 +167,12 @@ LONGREAL Out_Ten (int16 e) return _o_result; } -static void Out_RealP (LONGREAL x, int16 n, int16 exponentdigits, int16 maxsigdigits, CHAR exp) +static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_) { int16 e; int64 f; CHAR s[30]; - int16 i; + int16 i, el; LONGREAL x0; BOOLEAN nn, en; int64 m; @@ -191,16 +191,35 @@ static void Out_RealP (LONGREAL x, int16 n, int16 exponentdigits, int16 maxsigdi Out_prepend((CHAR*)"NaN", 4, (void*)s, 30, &i); } } else { + if (long_) { + el = 3; + dr = n - 6; + if (dr > 17) { + dr = 17; + } + d = dr; + if (d < 16) { + d = 16; + } + } else { + el = 2; + dr = n - 5; + if (dr > 9) { + dr = 9; + } + d = dr; + if (d < 7) { + d = 7; + } + } if (e == 0) { - d = i - exponentdigits; - while (i > d) { + while (el > 0) { i -= 1; s[__X(i, 30)] = '0'; + el -= 1; } i -= 1; s[__X(i, 30)] = '+'; - i -= 1; - s[__X(i, 30)] = exp; m = 0; } else { if (nn) { @@ -220,11 +239,10 @@ static void Out_RealP (LONGREAL x, int16 n, int16 exponentdigits, int16 maxsigdi if (en) { e = -e; } - d = exponentdigits; - while (d > 0) { + while (el > 0) { Out_digit(e, (void*)s, 30, &i); e = __DIV(e, 10); - d -= 1; + el -= 1; } i -= 1; if (en) { @@ -232,9 +250,7 @@ static void Out_RealP (LONGREAL x, int16 n, int16 exponentdigits, int16 maxsigdi } else { s[__X(i, 30)] = '+'; } - i -= 1; - s[__X(i, 30)] = exp; - x0 = Out_Ten(maxsigdigits - 1); + x0 = Out_Ten(d - 1); x = x0 * x + 5.00000000000000e-001; if (x >= (LONGREAL)10 * x0) { x = 1.00000000000000e-001 * x; @@ -242,8 +258,12 @@ static void Out_RealP (LONGREAL x, int16 n, int16 exponentdigits, int16 maxsigdi } m = Out_Entier64(x); } - d = maxsigdigits; - dr = n - (exponentdigits + 3); + i -= 1; + if (long_) { + s[__X(i, 30)] = 'D'; + } else { + s[__X(i, 30)] = 'E'; + } if (dr < 2) { dr = 2; } @@ -276,12 +296,12 @@ static void Out_RealP (LONGREAL x, int16 n, int16 exponentdigits, int16 maxsigdi void Out_Real (REAL x, int16 n) { - Out_RealP(x, n, 2, 7, 'E'); + Out_RealP(x, n, 0); } void Out_LongReal (LONGREAL x, int16 n) { - Out_RealP(x, n, 3, 16, 'D'); + Out_RealP(x, n, 1); } diff --git a/bootstrap/windows-48/Out.c b/bootstrap/windows-48/Out.c index b21d426b..eb112d34 100644 --- a/bootstrap/windows-48/Out.c +++ b/bootstrap/windows-48/Out.c @@ -21,7 +21,7 @@ export void Out_Ln (void); export void Out_LongReal (LONGREAL x, int16 n); export void Out_Open (void); export void Out_Real (REAL x, int16 n); -static void Out_RealP (LONGREAL x, int16 n, int16 exponentdigits, int16 maxsigdigits, CHAR exp); +static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_); export void Out_String (CHAR *str, LONGINT str__len); export LONGREAL Out_Ten (int16 e); static void Out_digit (int64 n, CHAR *s, LONGINT s__len, int16 *i); @@ -167,12 +167,12 @@ LONGREAL Out_Ten (int16 e) return _o_result; } -static void Out_RealP (LONGREAL x, int16 n, int16 exponentdigits, int16 maxsigdigits, CHAR exp) +static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_) { int16 e; int64 f; CHAR s[30]; - int16 i; + int16 i, el; LONGREAL x0; BOOLEAN nn, en; int64 m; @@ -191,16 +191,35 @@ static void Out_RealP (LONGREAL x, int16 n, int16 exponentdigits, int16 maxsigdi Out_prepend((CHAR*)"NaN", 4, (void*)s, 30, &i); } } else { + if (long_) { + el = 3; + dr = n - 6; + if (dr > 17) { + dr = 17; + } + d = dr; + if (d < 16) { + d = 16; + } + } else { + el = 2; + dr = n - 5; + if (dr > 9) { + dr = 9; + } + d = dr; + if (d < 7) { + d = 7; + } + } if (e == 0) { - d = i - exponentdigits; - while (i > d) { + while (el > 0) { i -= 1; s[__X(i, 30)] = '0'; + el -= 1; } i -= 1; s[__X(i, 30)] = '+'; - i -= 1; - s[__X(i, 30)] = exp; m = 0; } else { if (nn) { @@ -220,11 +239,10 @@ static void Out_RealP (LONGREAL x, int16 n, int16 exponentdigits, int16 maxsigdi if (en) { e = -e; } - d = exponentdigits; - while (d > 0) { + while (el > 0) { Out_digit(e, (void*)s, 30, &i); e = __DIV(e, 10); - d -= 1; + el -= 1; } i -= 1; if (en) { @@ -232,9 +250,7 @@ static void Out_RealP (LONGREAL x, int16 n, int16 exponentdigits, int16 maxsigdi } else { s[__X(i, 30)] = '+'; } - i -= 1; - s[__X(i, 30)] = exp; - x0 = Out_Ten(maxsigdigits - 1); + x0 = Out_Ten(d - 1); x = x0 * x + 5.00000000000000e-001; if (x >= (LONGREAL)10 * x0) { x = 1.00000000000000e-001 * x; @@ -242,8 +258,12 @@ static void Out_RealP (LONGREAL x, int16 n, int16 exponentdigits, int16 maxsigdi } m = Out_Entier64(x); } - d = maxsigdigits; - dr = n - (exponentdigits + 3); + i -= 1; + if (long_) { + s[__X(i, 30)] = 'D'; + } else { + s[__X(i, 30)] = 'E'; + } if (dr < 2) { dr = 2; } @@ -276,12 +296,12 @@ static void Out_RealP (LONGREAL x, int16 n, int16 exponentdigits, int16 maxsigdi void Out_Real (REAL x, int16 n) { - Out_RealP(x, n, 2, 7, 'E'); + Out_RealP(x, n, 0); } void Out_LongReal (LONGREAL x, int16 n) { - Out_RealP(x, n, 3, 16, 'D'); + Out_RealP(x, n, 1); } diff --git a/bootstrap/windows-88/Out.c b/bootstrap/windows-88/Out.c index b21d426b..eb112d34 100644 --- a/bootstrap/windows-88/Out.c +++ b/bootstrap/windows-88/Out.c @@ -21,7 +21,7 @@ export void Out_Ln (void); export void Out_LongReal (LONGREAL x, int16 n); export void Out_Open (void); export void Out_Real (REAL x, int16 n); -static void Out_RealP (LONGREAL x, int16 n, int16 exponentdigits, int16 maxsigdigits, CHAR exp); +static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_); export void Out_String (CHAR *str, LONGINT str__len); export LONGREAL Out_Ten (int16 e); static void Out_digit (int64 n, CHAR *s, LONGINT s__len, int16 *i); @@ -167,12 +167,12 @@ LONGREAL Out_Ten (int16 e) return _o_result; } -static void Out_RealP (LONGREAL x, int16 n, int16 exponentdigits, int16 maxsigdigits, CHAR exp) +static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_) { int16 e; int64 f; CHAR s[30]; - int16 i; + int16 i, el; LONGREAL x0; BOOLEAN nn, en; int64 m; @@ -191,16 +191,35 @@ static void Out_RealP (LONGREAL x, int16 n, int16 exponentdigits, int16 maxsigdi Out_prepend((CHAR*)"NaN", 4, (void*)s, 30, &i); } } else { + if (long_) { + el = 3; + dr = n - 6; + if (dr > 17) { + dr = 17; + } + d = dr; + if (d < 16) { + d = 16; + } + } else { + el = 2; + dr = n - 5; + if (dr > 9) { + dr = 9; + } + d = dr; + if (d < 7) { + d = 7; + } + } if (e == 0) { - d = i - exponentdigits; - while (i > d) { + while (el > 0) { i -= 1; s[__X(i, 30)] = '0'; + el -= 1; } i -= 1; s[__X(i, 30)] = '+'; - i -= 1; - s[__X(i, 30)] = exp; m = 0; } else { if (nn) { @@ -220,11 +239,10 @@ static void Out_RealP (LONGREAL x, int16 n, int16 exponentdigits, int16 maxsigdi if (en) { e = -e; } - d = exponentdigits; - while (d > 0) { + while (el > 0) { Out_digit(e, (void*)s, 30, &i); e = __DIV(e, 10); - d -= 1; + el -= 1; } i -= 1; if (en) { @@ -232,9 +250,7 @@ static void Out_RealP (LONGREAL x, int16 n, int16 exponentdigits, int16 maxsigdi } else { s[__X(i, 30)] = '+'; } - i -= 1; - s[__X(i, 30)] = exp; - x0 = Out_Ten(maxsigdigits - 1); + x0 = Out_Ten(d - 1); x = x0 * x + 5.00000000000000e-001; if (x >= (LONGREAL)10 * x0) { x = 1.00000000000000e-001 * x; @@ -242,8 +258,12 @@ static void Out_RealP (LONGREAL x, int16 n, int16 exponentdigits, int16 maxsigdi } m = Out_Entier64(x); } - d = maxsigdigits; - dr = n - (exponentdigits + 3); + i -= 1; + if (long_) { + s[__X(i, 30)] = 'D'; + } else { + s[__X(i, 30)] = 'E'; + } if (dr < 2) { dr = 2; } @@ -276,12 +296,12 @@ static void Out_RealP (LONGREAL x, int16 n, int16 exponentdigits, int16 maxsigdi void Out_Real (REAL x, int16 n) { - Out_RealP(x, n, 2, 7, 'E'); + Out_RealP(x, n, 0); } void Out_LongReal (LONGREAL x, int16 n) { - Out_RealP(x, n, 3, 16, 'D'); + Out_RealP(x, n, 1); } diff --git a/src/runtime/Out.Mod b/src/runtime/Out.Mod index 9463fef8..ec960404 100644 --- a/src/runtime/Out.Mod +++ b/src/runtime/Out.Mod @@ -95,7 +95,7 @@ END Ten; PROCEDURE -Entier64(x: LONGREAL): SYSTEM.INT64 "(int64)(x)"; -PROCEDURE RealP(x: LONGREAL; n, exponentdigits, maxsigdigits: INTEGER; exp: CHAR); +PROCEDURE RealP(x: LONGREAL; n: INTEGER; long: BOOLEAN); (* LongReal(x, n) writes the long real number x to the end of the output stream using an exponential form. If the textual representation of x requires m characters (including a @@ -104,16 +104,17 @@ PROCEDURE RealP(x: LONGREAL; n, exponentdigits, maxsigdigits: INTEGER; exp: CHAR LONGREAL is 1/sign, 11/exponent, 52/significand *) VAR - e: INTEGER; (* Exponent field *) - f: HUGEINT; (* Fraction field *) - s: ARRAY 30 OF CHAR; (* Buffer built backwards *) - i: INTEGER; (* Index into s *) - x0: LONGREAL; - nn: BOOLEAN; (* Number negative *) - en: BOOLEAN; (* Exponent negative *) - m: HUGEINT; (* Mantissa digits *) - d: INTEGER; (* Significant digit count to display *) - dr: INTEGER; (* Number of insignificant digits that can be dropped *) + e: INTEGER; (* Exponent field *) + f: HUGEINT; (* Fraction field *) + s: ARRAY 30 OF CHAR; (* Buffer built backwards *) + i: INTEGER; (* Index into s *) + el: INTEGER; (* Exponent length *) + x0: LONGREAL; + nn: BOOLEAN; (* Number negative *) + en: BOOLEAN; (* Exponent negative *) + m: HUGEINT; (* Mantissa digits *) + d: INTEGER; (* Significant digit count to display *) + dr: INTEGER; (* Number of insignificant digits that can be dropped *) BEGIN nn := SYSTEM.VAL(HUGEINT, x) < 0; IF nn THEN DEC(n) END; @@ -124,10 +125,25 @@ BEGIN IF e = 7FFH THEN (* NaN / Infinity *) IF f = 0 THEN prepend("Infinity", s, i) ELSE prepend("NaN", s, i) END ELSE + (* Calculate number of significant digits caller has proposed space for, and + number of digits to generate. *) + IF long THEN + el := 3; + dr := n-6; (* Leave room for dp and '+D000' *) + IF dr > 17 THEN dr := 17 END; (* Limit to max useful significant digits *) + d := dr; (* Number of digits to generate *) + IF d < 16 THEN d := 16 END (* Generate enough digits to do trailing zero supporession *) + ELSE + el := 2; + dr := n-5; (* Leave room for dp and '+E00' *) + IF dr > 9 THEN dr := 9 END; (* Limit to max useful significant digits *) + d := dr; (* Number of digits to generate *) + IF d < 7 THEN d := 7 END (* Generate enough digits to do trailing zero supporession *) + END; + IF e = 0 THEN - d := i - exponentdigits; WHILE i > d DO DEC(i); s[i] := "0" END; + WHILE el > 0 DO DEC(i); s[i] := "0"; DEC(el) END; DEC(i); s[i] := "+"; - DEC(i); s[i] := exp; m := 0; ELSE IF nn THEN x := -x END; @@ -139,25 +155,23 @@ BEGIN (* Generate the exponent digits *) en := e < 0; IF en THEN e := - e END; - d := exponentdigits; - WHILE d > 0 DO digit(e, s, i); e := e DIV 10; DEC(d) END; + WHILE el > 0 DO digit(e, s, i); e := e DIV 10; DEC(el) END; DEC(i); IF en THEN s[i] := "-" ELSE s[i] := "+" END; - DEC(i); s[i] := exp; - (* Todo: generate more than maxsigdigits if we have room for them *) - - (* Scale x to enoughsignificant digits to reliably test for trailing - zeroes. - todo or to the amount of space available, if greater. *) - x0 := Ten(maxsigdigits-1); - x := x0 * x + 0.5D0; + (* Scale x to enough significant digits to reliably test for trailing + zeroes or to the amount of space available, if greater. *) + x0 := Ten(d-1); + x := x0 * x; + x := x + 0.5D0; (* Do not combine with previous line as doing so + introduces a least significant bit difference + between 32 bit and 64 bit builds. *) IF x >= 10.0D0 * x0 THEN x := 0.1D0 * x; INC(e) END; m := Entier64(x) END; - (* Drop trailing zeroes where we don't have room *) - d := maxsigdigits; - dr := n - (exponentdigits + 3); (* 3 for '.', D/E and +/- *) + DEC(i); IF long THEN s[i] := "D" ELSE s[i] := "E" END; + + (* Drop trailing zeroes where caller proposes to use less space *) IF dr < 2 THEN dr := 2 END; WHILE (d > dr) & (m MOD 10 = 0) DO m := m DIV 10; DEC(d) END; @@ -177,11 +191,11 @@ END RealP; PROCEDURE Real*(x: REAL; n: INTEGER); -BEGIN RealP(x, n, 2, 7, "E"); +BEGIN RealP(x, n, FALSE); END Real; PROCEDURE LongReal*(x: LONGREAL; n: INTEGER); -BEGIN RealP(x, n, 3, 16, "D"); +BEGIN RealP(x, n, TRUE); END LongReal; END Out. diff --git a/src/test/confidence/out/expected b/src/test/confidence/out/expected index b71feae8..acc6253e 100644 --- a/src/test/confidence/out/expected +++ b/src/test/confidence/out/expected @@ -1,11 +1,39 @@ --- Testing with Oberon 2 variable model --- +Real number hex representation. + 1.0D0: 3FF0000000000000 + 1.1D0: 3FF199999999999A + 2.1D0: 4000CCCCCCCCCCCD +-1.1D0: BFF199999999999A + 1.1D3: 4091300000000000 + 1.1D-3: 3F5205BC01A36E2F + 1.2345678987654321D3: 40934A45874103D8 + 0.0: 0000000000000000 + 0.000123D0: 3F201F31F46ED246 + 1/0.0: 7FF0000000000000 +-1/0.0: FFF0000000000000 + 0.0/0.0: FFF8000000000000 + + 1.0E0: 3F800000 + 1.1E0: 3F8CCCCD + 2.1E0: 40066666 +-1.1E0: BF8CCCCD + 1.1E3: 44898000 + 1.1E-3: 3A902DE0 + 1.2345678987654321E3: 449A522C + 0.0: 00000000 + 0.000123E0: 3900F990 + 1/0.0: 7F800000 +-1/0.0: FF800000 + 0.0/0.0: FFC00000 + + Out module tests. SIZE(INTEGER) = 2 Testing LONGREAL. - 1 2 3 - 123456789012345678901234567890 + 1 2 3 4 + 1234567890123456789012345678901234567890 1.0D0: 1.0D+000 1.1D0: 1.1D+000 2.1D0: 2.1D+000 @@ -17,9 +45,10 @@ Testing LONGREAL. 0.000123D0: 1.23D-004 1/0.0: Infinity -1/0.0: -Infinity + 0.0/0.0: -NaN - 1 2 3 - 123456789012345678901234567890 + 1 2 3 4 + 1234567890123456789012345678901234567890 1.0D0: 1.00000D+000 1.1D0: 1.10000D+000 2.1D0: 2.10000D+000 @@ -31,27 +60,29 @@ Testing LONGREAL. 0.000123D0: 1.23000D-004 1/0.0: Infinity -1/0.0: -Infinity + 0.0/0.0: -NaN - 1 2 3 - 123456789012345678901234567890 - 1.0D0: 1.000000000000000D+000 - 1.1D0: 1.100000000000000D+000 - 2.1D0: 2.100000000000000D+000 --1.1D0: -1.100000000000000D+000 - 1.1D3: 1.100000000000000D+003 - 1.1D-3: 1.100000000000000D-003 - 1.2345678987654321D3: 1.234567898765430D+003 - 0.0: 0.000000000000000D+000 - 0.000123D0: 1.230000000000000D-004 - 1/0.0: Infinity --1/0.0: -Infinity + 1 2 3 4 + 1234567890123456789012345678901234567890 + 1.0D0: 1.0000000000000000D+000 + 1.1D0: 1.1000000000000000D+000 + 2.1D0: 2.1000000000000000D+000 +-1.1D0: -1.1000000000000000D+000 + 1.1D3: 1.1000000000000000D+003 + 1.1D-3: 1.1000000000000000D-003 + 1.2345678987654321D3: 1.2345678987654300D+003 + 0.0: 0.0000000000000000D+000 + 0.000123D0: 1.2300000000000000D-004 + 1/0.0: Infinity +-1/0.0: -Infinity + 0.0/0.0: -NaN Testing REAL. - 1 2 3 - 123456789012345678901234567890 + 1 2 3 4 + 1234567890123456789012345678901234567890 1.0E0: 1.0E+00 1.1E0: 1.1E+00 2.1E0: 2.1E+00 @@ -63,6 +94,7 @@ Testing REAL. 0.000123E0: 1.23E-04 1/0.0: Infinity -1/0.0: -Infinity + 0.0/0.0: -NaN 1 2 3 123456789012345678901234567890 @@ -77,31 +109,61 @@ Testing REAL. 0.000123E0: 1.230000E-04 1/0.0: Infinity -1/0.0: -Infinity + 0.0/0.0: -NaN - 1 2 3 - 123456789012345678901234567890 - 1.0E0: 1.000000E+00 - 1.1E0: 1.100000E+00 - 2.1E0: 2.100000E+00 --1.1E0: -1.100000E+00 - 1.1E3: 1.100000E+03 - 1.1E-3: 1.100000E-03 - 1.2345678987654321E3: 1.234568E+03 - 0.0: 0.000000E+00 - 0.000123E0: 1.230000E-04 - 1/0.0: Infinity --1/0.0: -Infinity + 1 2 3 4 + 1234567890123456789012345678901234567890 + 1.0E0: 1.00000000E+00 + 1.1E0: 1.10000002E+00 + 2.1E0: 2.09999990E+00 +-1.1E0: -1.10000002E+00 + 1.1E3: 1.10000000E+03 + 1.1E-3: 1.09999999E-03 + 1.2345678987654321E3: 1.23456787E+03 + 0.0: 0.00000000E+00 + 0.000123E0: 1.23000005E-04 + 1/0.0: Infinity +-1/0.0: -Infinity + 0.0/0.0: -NaN --- Testing with Component Pascal variable model --- +Real number hex representation. + 1.0D0: 3FF0000000000000 + 1.1D0: 3FF199999999999A + 2.1D0: 4000CCCCCCCCCCCD +-1.1D0: BFF199999999999A + 1.1D3: 4091300000000000 + 1.1D-3: 3F5205BC01A36E2F + 1.2345678987654321D3: 40934A45874103D8 + 0.0: 0000000000000000 + 0.000123D0: 3F201F31F46ED246 + 1/0.0: 7FF0000000000000 +-1/0.0: FFF0000000000000 + 0.0/0.0: FFF8000000000000 + + 1.0E0: 3F800000 + 1.1E0: 3F8CCCCD + 2.1E0: 40066666 +-1.1E0: BF8CCCCD + 1.1E3: 44898000 + 1.1E-3: 3A902DE0 + 1.2345678987654321E3: 449A522C + 0.0: 00000000 + 0.000123E0: 3900F990 + 1/0.0: 7F800000 +-1/0.0: FF800000 + 0.0/0.0: FFC00000 + + Out module tests. SIZE(INTEGER) = 4 Testing LONGREAL. - 1 2 3 - 123456789012345678901234567890 + 1 2 3 4 + 1234567890123456789012345678901234567890 1.0D0: 1.0D+000 1.1D0: 1.1D+000 2.1D0: 2.1D+000 @@ -113,9 +175,10 @@ Testing LONGREAL. 0.000123D0: 1.23D-004 1/0.0: Infinity -1/0.0: -Infinity + 0.0/0.0: -NaN - 1 2 3 - 123456789012345678901234567890 + 1 2 3 4 + 1234567890123456789012345678901234567890 1.0D0: 1.00000D+000 1.1D0: 1.10000D+000 2.1D0: 2.10000D+000 @@ -127,27 +190,29 @@ Testing LONGREAL. 0.000123D0: 1.23000D-004 1/0.0: Infinity -1/0.0: -Infinity + 0.0/0.0: -NaN - 1 2 3 - 123456789012345678901234567890 - 1.0D0: 1.000000000000000D+000 - 1.1D0: 1.100000000000000D+000 - 2.1D0: 2.100000000000000D+000 --1.1D0: -1.100000000000000D+000 - 1.1D3: 1.100000000000000D+003 - 1.1D-3: 1.100000000000000D-003 - 1.2345678987654321D3: 1.234567898765430D+003 - 0.0: 0.000000000000000D+000 - 0.000123D0: 1.230000000000000D-004 - 1/0.0: Infinity --1/0.0: -Infinity + 1 2 3 4 + 1234567890123456789012345678901234567890 + 1.0D0: 1.0000000000000000D+000 + 1.1D0: 1.1000000000000000D+000 + 2.1D0: 2.1000000000000000D+000 +-1.1D0: -1.1000000000000000D+000 + 1.1D3: 1.1000000000000000D+003 + 1.1D-3: 1.1000000000000000D-003 + 1.2345678987654321D3: 1.2345678987654300D+003 + 0.0: 0.0000000000000000D+000 + 0.000123D0: 1.2300000000000000D-004 + 1/0.0: Infinity +-1/0.0: -Infinity + 0.0/0.0: -NaN Testing REAL. - 1 2 3 - 123456789012345678901234567890 + 1 2 3 4 + 1234567890123456789012345678901234567890 1.0E0: 1.0E+00 1.1E0: 1.1E+00 2.1E0: 2.1E+00 @@ -159,6 +224,7 @@ Testing REAL. 0.000123E0: 1.23E-04 1/0.0: Infinity -1/0.0: -Infinity + 0.0/0.0: -NaN 1 2 3 123456789012345678901234567890 @@ -173,18 +239,20 @@ Testing REAL. 0.000123E0: 1.230000E-04 1/0.0: Infinity -1/0.0: -Infinity + 0.0/0.0: -NaN - 1 2 3 - 123456789012345678901234567890 - 1.0E0: 1.000000E+00 - 1.1E0: 1.100000E+00 - 2.1E0: 2.100000E+00 --1.1E0: -1.100000E+00 - 1.1E3: 1.100000E+03 - 1.1E-3: 1.100000E-03 - 1.2345678987654321E3: 1.234568E+03 - 0.0: 0.000000E+00 - 0.000123E0: 1.230000E-04 - 1/0.0: Infinity --1/0.0: -Infinity + 1 2 3 4 + 1234567890123456789012345678901234567890 + 1.0E0: 1.00000000E+00 + 1.1E0: 1.10000002E+00 + 2.1E0: 2.09999990E+00 +-1.1E0: -1.10000002E+00 + 1.1E3: 1.10000000E+03 + 1.1E-3: 1.09999999E-03 + 1.2345678987654321E3: 1.23456787E+03 + 0.0: 0.00000000E+00 + 0.000123E0: 1.23000005E-04 + 1/0.0: Infinity +-1/0.0: -Infinity + 0.0/0.0: -NaN diff --git a/src/test/confidence/out/outtest.mod b/src/test/confidence/out/outtest.mod index b2a00669..37881960 100644 --- a/src/test/confidence/out/outtest.mod +++ b/src/test/confidence/out/outtest.mod @@ -1,23 +1,75 @@ MODULE outtest; -IMPORT Out; +IMPORT Out, SYSTEM; VAR r: REAL; lr: LONGREAL; + cw: SYSTEM.INT16; +PROCEDURE wc(c: CHAR); BEGIN Out.Char(c) END wc; PROCEDURE ws(s: ARRAY OF CHAR); BEGIN Out.String(s) END ws; PROCEDURE wi(i: HUGEINT); BEGIN Out.Int(i,1) END wi; PROCEDURE wl; BEGIN Out.Ln END wl; +PROCEDURE wh(VAR h: ARRAY OF SYSTEM.BYTE); + VAR i: INTEGER; b: SYSTEM.INT8; +BEGIN + i := SHORT(LEN(h)); + WHILE i > 0 DO + DEC(i); b := SYSTEM.VAL(SYSTEM.INT8, h[i]); + IF b DIV 16 MOD 16 < 10 THEN wc(CHR(b DIV 16 MOD 16 + 48)) ELSE wc(CHR(b DIV 16 MOD 16 + 55)) END; + IF b MOD 16 < 10 THEN wc(CHR(b MOD 16 + 48)) ELSE wc(CHR(b MOD 16 + 55)) END; + END +END wh; + + +(* +PROCEDURE -GetFpcw() '__asm__ __volatile__ ("fnstcw %0" : "=m" (outtest_cw))'; +*) + + BEGIN + (* + ws("Floating point control word: "); GetFpcw; wh(cw); wl; + wl; + *) + + ws("Real number hex representation."); wl; + lr := 1.0D0; ws(" 1.0D0: "); wh(lr); wl; + lr := 1.1D0; ws(" 1.1D0: "); wh(lr); wl; + lr := 2.1D0; ws(" 2.1D0: "); wh(lr); wl; + lr := -1.1D0; ws("-1.1D0: "); wh(lr); wl; + lr := 1.1D3; ws(" 1.1D3: "); wh(lr); wl; + lr := 1.1D-3; ws(" 1.1D-3: "); wh(lr); wl; + lr := 1.2345678987654321D3; ws(" 1.2345678987654321D3: "); wh(lr); wl; + lr := 0.0; ws(" 0.0: "); wh(lr); wl; + lr := 0.000123D0; ws(" 0.000123D0: "); wh(lr); wl; + lr := 0.0; lr := 1/lr; ws(" 1/0.0: "); wh(lr); wl; + lr := 0.0; lr := -1/lr; ws("-1/0.0: "); wh(lr); wl; + lr := 0.0; lr := 0.0D0/lr; ws(" 0.0/0.0: "); wh(lr); wl; + wl; + r := 1.0E0; ws(" 1.0E0: "); wh(r); wl; + r := 1.1E0; ws(" 1.1E0: "); wh(r); wl; + r := 2.1E0; ws(" 2.1E0: "); wh(r); wl; + r := -1.1E0; ws("-1.1E0: "); wh(r); wl; + r := 1.1E3; ws(" 1.1E3: "); wh(r); wl; + r := 1.1E-3; ws(" 1.1E-3: "); wh(r); wl; + r := 1.2345678987654321E3; ws(" 1.2345678987654321E3: "); wh(r); wl; + r := 0.0; ws(" 0.0: "); wh(r); wl; + r := 0.000123E0; ws(" 0.000123E0: "); wh(r); wl; + r := 0.0; r := 1/r; ws(" 1/0.0: "); wh(r); wl; + r := 0.0; r := -1/r; ws("-1/0.0: "); wh(r); wl; + r := 0.0; r := 0.0E0/r; ws(" 0.0/0.0: "); wh(r); wl; + wl; wl; + ws("Out module tests."); wl; ws("SIZE(INTEGER) = "); wi(SIZE(INTEGER)); wl; wl; ws("Testing LONGREAL."); wl; wl; - ws(" 1 2 3"); wl; - ws(" 123456789012345678901234567890"); wl; + ws(" 1 2 3 4"); wl; + ws(" 1234567890123456789012345678901234567890"); wl; ws(" 1.0D0: "); Out.LongReal( 1.0D0, 1); wl; ws(" 1.1D0: "); Out.LongReal( 1.1D0, 1); wl; ws(" 2.1D0: "); Out.LongReal( 2.1D0, 1); wl; @@ -31,9 +83,11 @@ BEGIN ws(" 1/0.0: "); Out.LongReal(lr, 1); wl; lr := 0.0; lr := -1/lr; ws("-1/0.0: "); Out.LongReal(lr, 1); wl; + lr := 0.0; lr := 0.0D0/lr; + ws(" 0.0/0.0: "); Out.LongReal(lr, 1); wl; wl; - ws(" 1 2 3"); wl; - ws(" 123456789012345678901234567890"); wl; + ws(" 1 2 3 4"); wl; + ws(" 1234567890123456789012345678901234567890"); wl; ws(" 1.0D0: "); Out.LongReal( 1.0D0, 12); wl; ws(" 1.1D0: "); Out.LongReal( 1.1D0, 12); wl; ws(" 2.1D0: "); Out.LongReal( 2.1D0, 12); wl; @@ -47,28 +101,32 @@ BEGIN ws(" 1/0.0: "); Out.LongReal(lr, 12); wl; lr := 0.0; lr := -1/lr; ws("-1/0.0: "); Out.LongReal(lr, 12); wl; + lr := 0.0; lr := 0.0D0/lr; + ws(" 0.0/0.0: "); Out.LongReal(lr, 12); wl; wl; - ws(" 1 2 3"); wl; - ws(" 123456789012345678901234567890"); wl; - ws(" 1.0D0: "); Out.LongReal( 1.0D0, 30); wl; - ws(" 1.1D0: "); Out.LongReal( 1.1D0, 30); wl; - ws(" 2.1D0: "); Out.LongReal( 2.1D0, 30); wl; - ws("-1.1D0: "); Out.LongReal(-1.1D0, 30); wl; - ws(" 1.1D3: "); Out.LongReal( 1.1D3, 30); wl; - ws(" 1.1D-3: "); Out.LongReal( 1.1D-3, 30); wl; - ws(" 1.2345678987654321D3: "); Out.LongReal( 1.2345678987654321D3, 30); wl; - ws(" 0.0: "); Out.LongReal(0.0, 30); wl; - ws(" 0.000123D0: "); Out.LongReal(0.000123D0, 30); wl; + ws(" 1 2 3 4"); wl; + ws(" 1234567890123456789012345678901234567890"); wl; + ws(" 1.0D0: "); Out.LongReal( 1.0D0, 40); wl; + ws(" 1.1D0: "); Out.LongReal( 1.1D0, 40); wl; + ws(" 2.1D0: "); Out.LongReal( 2.1D0, 40); wl; + ws("-1.1D0: "); Out.LongReal(-1.1D0, 40); wl; + ws(" 1.1D3: "); Out.LongReal( 1.1D3, 40); wl; + ws(" 1.1D-3: "); Out.LongReal( 1.1D-3, 40); wl; + ws(" 1.2345678987654321D3: "); Out.LongReal( 1.2345678987654321D3, 40); wl; + ws(" 0.0: "); Out.LongReal(0.0, 40); wl; + ws(" 0.000123D0: "); Out.LongReal(0.000123D0, 40); wl; lr := 0.0; lr := 1/lr; - ws(" 1/0.0: "); Out.LongReal(lr, 30); wl; + ws(" 1/0.0: "); Out.LongReal(lr, 40); wl; lr := 0.0; lr := -1/lr; - ws("-1/0.0: "); Out.LongReal(lr, 30); wl; + ws("-1/0.0: "); Out.LongReal(lr, 40); wl; + lr := 0.0; lr := 0.0D0/lr; + ws(" 0.0/0.0: "); Out.LongReal(lr, 40); wl; wl; wl; wl; ws("Testing REAL."); wl; wl; - ws(" 1 2 3"); wl; - ws(" 123456789012345678901234567890"); wl; + ws(" 1 2 3 4"); wl; + ws(" 1234567890123456789012345678901234567890"); wl; ws(" 1.0E0: "); Out.Real( 1.0E0, 1); wl; ws(" 1.1E0: "); Out.Real( 1.1E0, 1); wl; ws(" 2.1E0: "); Out.Real( 2.1E0, 1); wl; @@ -82,6 +140,8 @@ BEGIN ws(" 1/0.0: "); Out.Real(r, 1); wl; r := 0.0; r := -1/r; ws("-1/0.0: "); Out.Real(r, 1); wl; + r := 0.0; r := 0.0E0/r; + ws(" 0.0/0.0: "); Out.Real(r, 1); wl; wl; ws(" 1 2 3"); wl; ws(" 123456789012345678901234567890"); wl; @@ -98,22 +158,26 @@ BEGIN ws(" 1/0.0: "); Out.Real(r, 12); wl; r := 0.0; r := -1/r; ws("-1/0.0: "); Out.Real(r, 12); wl; + r := 0.0; r := 0.0E0/r; + ws(" 0.0/0.0: "); Out.Real(r, 12); wl; wl; - ws(" 1 2 3"); wl; - ws(" 123456789012345678901234567890"); wl; - ws(" 1.0E0: "); Out.Real( 1.0E0, 30); wl; - ws(" 1.1E0: "); Out.Real( 1.1E0, 30); wl; - ws(" 2.1E0: "); Out.Real( 2.1E0, 30); wl; - ws("-1.1E0: "); Out.Real(-1.1E0, 30); wl; - ws(" 1.1E3: "); Out.Real( 1.1E3, 30); wl; - ws(" 1.1E-3: "); Out.Real( 1.1E-3, 30); wl; - ws(" 1.2345678987654321E3: "); Out.Real( 1.2345678987654321E3, 30); wl; - ws(" 0.0: "); Out.Real(0.0, 30); wl; - ws(" 0.000123E0: "); Out.Real(0.000123E0, 30); wl; + ws(" 1 2 3 4"); wl; + ws(" 1234567890123456789012345678901234567890"); wl; + ws(" 1.0E0: "); Out.Real( 1.0E0, 40); wl; + ws(" 1.1E0: "); Out.Real( 1.1E0, 40); wl; + ws(" 2.1E0: "); Out.Real( 2.1E0, 40); wl; + ws("-1.1E0: "); Out.Real(-1.1E0, 40); wl; + ws(" 1.1E3: "); Out.Real( 1.1E3, 40); wl; + ws(" 1.1E-3: "); Out.Real( 1.1E-3, 40); wl; + ws(" 1.2345678987654321E3: "); Out.Real( 1.2345678987654321E3, 40); wl; + ws(" 0.0: "); Out.Real(0.0, 40); wl; + ws(" 0.000123E0: "); Out.Real(0.000123E0, 40); wl; r := 0.0; r := 1/r; - ws(" 1/0.0: "); Out.Real(r, 30); wl; + ws(" 1/0.0: "); Out.Real(r, 40); wl; r := 0.0; r := -1/r; - ws("-1/0.0: "); Out.Real(r, 30); wl; + ws("-1/0.0: "); Out.Real(r, 40); wl; + r := 0.0; r := 0.0E0/r; + ws(" 0.0/0.0: "); Out.Real(r, 40); wl; wl; END outtest. From dd6f704e68bb059b93a4b762d20a2a19f2f8f64c Mon Sep 17 00:00:00 2001 From: David Brown Date: Wed, 12 Oct 2016 11:49:21 +0100 Subject: [PATCH 279/580] Don't display sign for NaN as x86 and arm generate it differently for 0.0/0.0 --- bootstrap/unix-44/Compiler.c | 2 +- bootstrap/unix-44/Configuration.c | 4 ++-- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Files.c | 2 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 2 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 2 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 2 +- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 2 +- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 2 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Out.c | 11 ++++++----- bootstrap/unix-44/Out.h | 2 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/errors.c | 2 +- bootstrap/unix-44/errors.h | 2 +- bootstrap/unix-44/extTools.c | 2 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-44/vt100.c | 2 +- bootstrap/unix-44/vt100.h | 2 +- bootstrap/unix-48/Compiler.c | 2 +- bootstrap/unix-48/Configuration.c | 4 ++-- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Files.c | 2 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 2 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 2 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 2 +- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 2 +- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 2 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Out.c | 11 ++++++----- bootstrap/unix-48/Out.h | 2 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/errors.c | 2 +- bootstrap/unix-48/errors.h | 2 +- bootstrap/unix-48/extTools.c | 2 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-48/vt100.c | 2 +- bootstrap/unix-48/vt100.h | 2 +- bootstrap/unix-88/Compiler.c | 2 +- bootstrap/unix-88/Configuration.c | 4 ++-- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Files.c | 2 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 2 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 2 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 2 +- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 2 +- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 2 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Out.c | 11 ++++++----- bootstrap/unix-88/Out.h | 2 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/errors.c | 2 +- bootstrap/unix-88/errors.h | 2 +- bootstrap/unix-88/extTools.c | 2 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/unix-88/vt100.c | 2 +- bootstrap/unix-88/vt100.h | 2 +- bootstrap/windows-48/Compiler.c | 2 +- bootstrap/windows-48/Configuration.c | 4 ++-- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Files.c | 2 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 2 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 2 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 2 +- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 2 +- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 2 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Out.c | 11 ++++++----- bootstrap/windows-48/Out.h | 2 +- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/errors.c | 2 +- bootstrap/windows-48/errors.h | 2 +- bootstrap/windows-48/extTools.c | 2 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-48/vt100.c | 2 +- bootstrap/windows-48/vt100.h | 2 +- bootstrap/windows-88/Compiler.c | 2 +- bootstrap/windows-88/Configuration.c | 4 ++-- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Files.c | 2 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 2 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 2 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 2 +- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 2 +- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 2 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Out.c | 11 ++++++----- bootstrap/windows-88/Out.h | 2 +- bootstrap/windows-88/Platform.c | 2 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/errors.c | 2 +- bootstrap/windows-88/errors.h | 2 +- bootstrap/windows-88/extTools.c | 2 +- bootstrap/windows-88/extTools.h | 2 +- bootstrap/windows-88/vt100.c | 2 +- bootstrap/windows-88/vt100.h | 2 +- src/runtime/Out.Mod | 3 ++- src/test/confidence/out/expected | 24 ++++++++++++------------ 197 files changed, 239 insertions(+), 233 deletions(-) diff --git a/bootstrap/unix-44/Compiler.c b/bootstrap/unix-44/Compiler.c index b303a7c4..5ec069b8 100644 --- a/bootstrap/unix-44/Compiler.c +++ b/bootstrap/unix-44/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index 8ac138be..0bef890f 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index 207eeb63..286f28c0 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index c983396b..4074c8b1 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index ba64fc56..c38c3f26 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index 8758813f..cb386d17 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index bcf77f96..c6dbfb3e 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index 5302c9f4..e5227fba 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index abb938ae..77ec53de 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index 3233aa7b..aab1b7fe 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index 6931fe6e..eb00fcda 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 48f0d967..84393696 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index 40825f04..d6a60b2e 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index abb65cd0..76cc2b7c 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index e18ab6ff..b7b19fb7 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index 10e8168f..e3a26a86 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index 49d03b82..1f2ff59f 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index 288a081d..72800d6b 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index bc45e385..595b3668 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index 9ec11e5d..a1e67f1b 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index 95947e81..d40fcd25 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index 96075563..19522c13 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index 0d54d226..fa176ddf 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Out.c b/bootstrap/unix-44/Out.c index 1d0fcf65..944cc0e5 100644 --- a/bootstrap/unix-44/Out.c +++ b/bootstrap/unix-44/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -177,12 +177,12 @@ static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_) BOOLEAN nn, en; int64 m; int16 d, dr; - nn = __VAL(int64, x) < 0; + e = (int16)__MASK(__ASHR((__VAL(int64, x)), 52), -2048); + f = __MASK((__VAL(int64, x)), -4503599627370496); + nn = (__VAL(int64, x) < 0 && !((e == 2047 && f != 0))); if (nn) { n -= 1; } - e = (int16)__MASK(__ASHR((__VAL(int64, x)), 52), -2048); - f = __MASK((__VAL(int64, x)), -4503599627370496); i = 30; if (e == 2047) { if (f == 0) { @@ -251,7 +251,8 @@ static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_) s[__X(i, 30)] = '+'; } x0 = Out_Ten(d - 1); - x = x0 * x + 5.00000000000000e-001; + x = x0 * x; + x = x + 5.00000000000000e-001; if (x >= (LONGREAL)10 * x0) { x = 1.00000000000000e-001 * x; e += 1; diff --git a/bootstrap/unix-44/Out.h b/bootstrap/unix-44/Out.h index 362b4414..418e17e2 100644 --- a/bootstrap/unix-44/Out.h +++ b/bootstrap/unix-44/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 0667398d..4c779435 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index 4897b84e..e45b429c 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 8697b424..ece1bf1d 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index e764f95f..523e9f9e 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index 8a95a8eb..c86ccc0e 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index 4989383b..c12329ab 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index 6fd83b96..2a154ebf 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index 82b41cda..5a8c9b51 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/errors.c b/bootstrap/unix-44/errors.c index 408d5ec7..44990c71 100644 --- a/bootstrap/unix-44/errors.c +++ b/bootstrap/unix-44/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/errors.h b/bootstrap/unix-44/errors.h index b0247272..e0bb109d 100644 --- a/bootstrap/unix-44/errors.h +++ b/bootstrap/unix-44/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index 5df06422..c83fd7dd 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index ef0da35c..21016d9e 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-44/vt100.c b/bootstrap/unix-44/vt100.c index 65b16ccc..afa2b377 100644 --- a/bootstrap/unix-44/vt100.c +++ b/bootstrap/unix-44/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/vt100.h b/bootstrap/unix-44/vt100.h index 2211e981..03038059 100644 --- a/bootstrap/unix-44/vt100.h +++ b/bootstrap/unix-44/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-48/Compiler.c b/bootstrap/unix-48/Compiler.c index b303a7c4..5ec069b8 100644 --- a/bootstrap/unix-48/Compiler.c +++ b/bootstrap/unix-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index 8ac138be..0bef890f 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index 207eeb63..286f28c0 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index c983396b..4074c8b1 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index ba64fc56..c38c3f26 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index 8758813f..cb386d17 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index bcf77f96..c6dbfb3e 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index 5302c9f4..e5227fba 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index abb938ae..77ec53de 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index 3233aa7b..aab1b7fe 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index 6931fe6e..eb00fcda 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 48f0d967..84393696 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index 40825f04..d6a60b2e 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index abb65cd0..76cc2b7c 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index e18ab6ff..b7b19fb7 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index 10e8168f..e3a26a86 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index 49d03b82..1f2ff59f 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index 288a081d..72800d6b 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index bc45e385..595b3668 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 55178203..bc22f7e2 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index 95947e81..d40fcd25 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index 96075563..19522c13 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index 0d54d226..fa176ddf 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Out.c b/bootstrap/unix-48/Out.c index 1d0fcf65..944cc0e5 100644 --- a/bootstrap/unix-48/Out.c +++ b/bootstrap/unix-48/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -177,12 +177,12 @@ static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_) BOOLEAN nn, en; int64 m; int16 d, dr; - nn = __VAL(int64, x) < 0; + e = (int16)__MASK(__ASHR((__VAL(int64, x)), 52), -2048); + f = __MASK((__VAL(int64, x)), -4503599627370496); + nn = (__VAL(int64, x) < 0 && !((e == 2047 && f != 0))); if (nn) { n -= 1; } - e = (int16)__MASK(__ASHR((__VAL(int64, x)), 52), -2048); - f = __MASK((__VAL(int64, x)), -4503599627370496); i = 30; if (e == 2047) { if (f == 0) { @@ -251,7 +251,8 @@ static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_) s[__X(i, 30)] = '+'; } x0 = Out_Ten(d - 1); - x = x0 * x + 5.00000000000000e-001; + x = x0 * x; + x = x + 5.00000000000000e-001; if (x >= (LONGREAL)10 * x0) { x = 1.00000000000000e-001 * x; e += 1; diff --git a/bootstrap/unix-48/Out.h b/bootstrap/unix-48/Out.h index 362b4414..418e17e2 100644 --- a/bootstrap/unix-48/Out.h +++ b/bootstrap/unix-48/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 0667398d..4c779435 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index 4897b84e..e45b429c 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 8697b424..ece1bf1d 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index e764f95f..523e9f9e 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index 8a95a8eb..c86ccc0e 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index 4989383b..c12329ab 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index 421c5f47..672171ee 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index e27e5f53..802df5a7 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/errors.c b/bootstrap/unix-48/errors.c index 408d5ec7..44990c71 100644 --- a/bootstrap/unix-48/errors.c +++ b/bootstrap/unix-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/errors.h b/bootstrap/unix-48/errors.h index b0247272..e0bb109d 100644 --- a/bootstrap/unix-48/errors.h +++ b/bootstrap/unix-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index 5df06422..c83fd7dd 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index ef0da35c..21016d9e 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/vt100.c b/bootstrap/unix-48/vt100.c index 65b16ccc..afa2b377 100644 --- a/bootstrap/unix-48/vt100.c +++ b/bootstrap/unix-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/vt100.h b/bootstrap/unix-48/vt100.h index 2211e981..03038059 100644 --- a/bootstrap/unix-48/vt100.h +++ b/bootstrap/unix-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-88/Compiler.c b/bootstrap/unix-88/Compiler.c index b303a7c4..5ec069b8 100644 --- a/bootstrap/unix-88/Compiler.c +++ b/bootstrap/unix-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index 8ac138be..0bef890f 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index 207eeb63..286f28c0 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 00efd9fc..e380bc50 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 1e455c40..5c717742 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index b09688eb..1a82d9e8 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index a5b2fe18..abcafa6a 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 73f0a95b..5fdce638 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index abb938ae..77ec53de 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index 3233aa7b..aab1b7fe 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index 6931fe6e..eb00fcda 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index 48f0d967..84393696 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index 40825f04..d6a60b2e 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index f377d2a5..ca25d1e6 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index e18ab6ff..b7b19fb7 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index 5c4e3c07..64a861ac 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index 49d03b82..1f2ff59f 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index 288a081d..72800d6b 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index bc45e385..595b3668 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index 3e3e97fb..7be03e0d 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 95947e81..d40fcd25 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index fd84941f..90adf5f7 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index 0d54d226..fa176ddf 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Out.c b/bootstrap/unix-88/Out.c index 1d0fcf65..944cc0e5 100644 --- a/bootstrap/unix-88/Out.c +++ b/bootstrap/unix-88/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -177,12 +177,12 @@ static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_) BOOLEAN nn, en; int64 m; int16 d, dr; - nn = __VAL(int64, x) < 0; + e = (int16)__MASK(__ASHR((__VAL(int64, x)), 52), -2048); + f = __MASK((__VAL(int64, x)), -4503599627370496); + nn = (__VAL(int64, x) < 0 && !((e == 2047 && f != 0))); if (nn) { n -= 1; } - e = (int16)__MASK(__ASHR((__VAL(int64, x)), 52), -2048); - f = __MASK((__VAL(int64, x)), -4503599627370496); i = 30; if (e == 2047) { if (f == 0) { @@ -251,7 +251,8 @@ static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_) s[__X(i, 30)] = '+'; } x0 = Out_Ten(d - 1); - x = x0 * x + 5.00000000000000e-001; + x = x0 * x; + x = x + 5.00000000000000e-001; if (x >= (LONGREAL)10 * x0) { x = 1.00000000000000e-001 * x; e += 1; diff --git a/bootstrap/unix-88/Out.h b/bootstrap/unix-88/Out.h index 362b4414..418e17e2 100644 --- a/bootstrap/unix-88/Out.h +++ b/bootstrap/unix-88/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index ddd65b5f..4d742327 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index f2194f3c..1df437c2 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 8697b424..ece1bf1d 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index e764f95f..523e9f9e 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index 8a95a8eb..c86ccc0e 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index 4989383b..c12329ab 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index ce4a885a..6033652e 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index 26669d1c..54f5d5ee 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/errors.c b/bootstrap/unix-88/errors.c index 408d5ec7..44990c71 100644 --- a/bootstrap/unix-88/errors.c +++ b/bootstrap/unix-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/errors.h b/bootstrap/unix-88/errors.h index b0247272..e0bb109d 100644 --- a/bootstrap/unix-88/errors.h +++ b/bootstrap/unix-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index 5df06422..c83fd7dd 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index ef0da35c..21016d9e 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/vt100.c b/bootstrap/unix-88/vt100.c index 65b16ccc..afa2b377 100644 --- a/bootstrap/unix-88/vt100.c +++ b/bootstrap/unix-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/vt100.h b/bootstrap/unix-88/vt100.h index 2211e981..03038059 100644 --- a/bootstrap/unix-88/vt100.h +++ b/bootstrap/unix-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-48/Compiler.c b/bootstrap/windows-48/Compiler.c index b303a7c4..5ec069b8 100644 --- a/bootstrap/windows-48/Compiler.c +++ b/bootstrap/windows-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index 8ac138be..0bef890f 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index 207eeb63..286f28c0 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 0c55ce0a..9b51335b 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index 8cee9102..3ca0b501 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index 8758813f..cb386d17 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index bcf77f96..c6dbfb3e 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index 5302c9f4..e5227fba 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index abb938ae..77ec53de 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index 3233aa7b..aab1b7fe 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index 6931fe6e..eb00fcda 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 48f0d967..84393696 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index 40825f04..d6a60b2e 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index abb65cd0..76cc2b7c 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index e18ab6ff..b7b19fb7 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index 10e8168f..e3a26a86 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index 49d03b82..1f2ff59f 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index 288a081d..72800d6b 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index bc45e385..595b3668 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 55178203..bc22f7e2 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index 95947e81..d40fcd25 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index 96075563..19522c13 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index 0d54d226..fa176ddf 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Out.c b/bootstrap/windows-48/Out.c index eb112d34..146364f1 100644 --- a/bootstrap/windows-48/Out.c +++ b/bootstrap/windows-48/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -177,12 +177,12 @@ static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_) BOOLEAN nn, en; int64 m; int16 d, dr; - nn = __VAL(int64, x) < 0; + e = (int16)__MASK(__ASHR((__VAL(int64, x)), 52), -2048); + f = __MASK((__VAL(int64, x)), -4503599627370496); + nn = (__VAL(int64, x) < 0 && !((e == 2047 && f != 0))); if (nn) { n -= 1; } - e = (int16)__MASK(__ASHR((__VAL(int64, x)), 52), -2048); - f = __MASK((__VAL(int64, x)), -4503599627370496); i = 30; if (e == 2047) { if (f == 0) { @@ -251,7 +251,8 @@ static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_) s[__X(i, 30)] = '+'; } x0 = Out_Ten(d - 1); - x = x0 * x + 5.00000000000000e-001; + x = x0 * x; + x = x + 5.00000000000000e-001; if (x >= (LONGREAL)10 * x0) { x = 1.00000000000000e-001 * x; e += 1; diff --git a/bootstrap/windows-48/Out.h b/bootstrap/windows-48/Out.h index 362b4414..418e17e2 100644 --- a/bootstrap/windows-48/Out.h +++ b/bootstrap/windows-48/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index d50ae9ec..10094e2d 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index 3aa708ca..76bb3755 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 8697b424..ece1bf1d 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index e764f95f..523e9f9e 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index 8a95a8eb..c86ccc0e 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index 4989383b..c12329ab 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index 421c5f47..672171ee 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index e27e5f53..802df5a7 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/errors.c b/bootstrap/windows-48/errors.c index 408d5ec7..44990c71 100644 --- a/bootstrap/windows-48/errors.c +++ b/bootstrap/windows-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/errors.h b/bootstrap/windows-48/errors.h index b0247272..e0bb109d 100644 --- a/bootstrap/windows-48/errors.h +++ b/bootstrap/windows-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index 5df06422..c83fd7dd 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index ef0da35c..21016d9e 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/vt100.c b/bootstrap/windows-48/vt100.c index 65b16ccc..afa2b377 100644 --- a/bootstrap/windows-48/vt100.c +++ b/bootstrap/windows-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/vt100.h b/bootstrap/windows-48/vt100.h index 2211e981..03038059 100644 --- a/bootstrap/windows-48/vt100.h +++ b/bootstrap/windows-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-88/Compiler.c b/bootstrap/windows-88/Compiler.c index b303a7c4..5ec069b8 100644 --- a/bootstrap/windows-88/Compiler.c +++ b/bootstrap/windows-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index 8ac138be..0bef890f 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index 207eeb63..286f28c0 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index b9443fd9..98dcdccb 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 98e13fc1..a643f9c2 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index b09688eb..1a82d9e8 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index a5b2fe18..abcafa6a 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 73f0a95b..5fdce638 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index abb938ae..77ec53de 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index 3233aa7b..aab1b7fe 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index 6931fe6e..eb00fcda 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index 48f0d967..84393696 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index 40825f04..d6a60b2e 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index f377d2a5..ca25d1e6 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index e18ab6ff..b7b19fb7 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index 5c4e3c07..64a861ac 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index 49d03b82..1f2ff59f 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index 288a081d..72800d6b 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index bc45e385..595b3668 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index 3e3e97fb..7be03e0d 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 95947e81..d40fcd25 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index fd84941f..90adf5f7 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index 0d54d226..fa176ddf 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Out.c b/bootstrap/windows-88/Out.c index eb112d34..146364f1 100644 --- a/bootstrap/windows-88/Out.c +++ b/bootstrap/windows-88/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -177,12 +177,12 @@ static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_) BOOLEAN nn, en; int64 m; int16 d, dr; - nn = __VAL(int64, x) < 0; + e = (int16)__MASK(__ASHR((__VAL(int64, x)), 52), -2048); + f = __MASK((__VAL(int64, x)), -4503599627370496); + nn = (__VAL(int64, x) < 0 && !((e == 2047 && f != 0))); if (nn) { n -= 1; } - e = (int16)__MASK(__ASHR((__VAL(int64, x)), 52), -2048); - f = __MASK((__VAL(int64, x)), -4503599627370496); i = 30; if (e == 2047) { if (f == 0) { @@ -251,7 +251,8 @@ static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_) s[__X(i, 30)] = '+'; } x0 = Out_Ten(d - 1); - x = x0 * x + 5.00000000000000e-001; + x = x0 * x; + x = x + 5.00000000000000e-001; if (x >= (LONGREAL)10 * x0) { x = 1.00000000000000e-001 * x; e += 1; diff --git a/bootstrap/windows-88/Out.h b/bootstrap/windows-88/Out.h index 362b4414..418e17e2 100644 --- a/bootstrap/windows-88/Out.h +++ b/bootstrap/windows-88/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 7efc77b3..4b4bd5d9 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index 52d679bb..bc2df7c8 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 8697b424..ece1bf1d 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index e764f95f..523e9f9e 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index 8a95a8eb..c86ccc0e 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index 4989383b..c12329ab 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index ce4a885a..6033652e 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index 26669d1c..54f5d5ee 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/errors.c b/bootstrap/windows-88/errors.c index 408d5ec7..44990c71 100644 --- a/bootstrap/windows-88/errors.c +++ b/bootstrap/windows-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/errors.h b/bootstrap/windows-88/errors.h index b0247272..e0bb109d 100644 --- a/bootstrap/windows-88/errors.h +++ b/bootstrap/windows-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index 5df06422..c83fd7dd 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index ef0da35c..21016d9e 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/vt100.c b/bootstrap/windows-88/vt100.c index 65b16ccc..afa2b377 100644 --- a/bootstrap/windows-88/vt100.c +++ b/bootstrap/windows-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/vt100.h b/bootstrap/windows-88/vt100.h index 2211e981..03038059 100644 --- a/bootstrap/windows-88/vt100.h +++ b/bootstrap/windows-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/src/runtime/Out.Mod b/src/runtime/Out.Mod index ec960404..6ba07c09 100644 --- a/src/runtime/Out.Mod +++ b/src/runtime/Out.Mod @@ -117,9 +117,10 @@ VAR dr: INTEGER; (* Number of insignificant digits that can be dropped *) BEGIN - nn := SYSTEM.VAL(HUGEINT, x) < 0; IF nn THEN DEC(n) END; e := SYSTEM.VAL(INTEGER, (SYSTEM.VAL(HUGEINT, x) DIV 10000000000000H) MOD 800H); f := SYSTEM.VAL(HUGEINT, x) MOD 10000000000000H; + nn := (SYSTEM.VAL(HUGEINT, x) < 0) & ~((e = 7FFH) & (f # 0)); (* Ignore sign on Nan *) + IF nn THEN DEC(n) END; i := LEN(s); IF e = 7FFH THEN (* NaN / Infinity *) diff --git a/src/test/confidence/out/expected b/src/test/confidence/out/expected index acc6253e..b5ab3a3b 100644 --- a/src/test/confidence/out/expected +++ b/src/test/confidence/out/expected @@ -45,7 +45,7 @@ Testing LONGREAL. 0.000123D0: 1.23D-004 1/0.0: Infinity -1/0.0: -Infinity - 0.0/0.0: -NaN + 0.0/0.0: NaN 1 2 3 4 1234567890123456789012345678901234567890 @@ -60,7 +60,7 @@ Testing LONGREAL. 0.000123D0: 1.23000D-004 1/0.0: Infinity -1/0.0: -Infinity - 0.0/0.0: -NaN + 0.0/0.0: NaN 1 2 3 4 1234567890123456789012345678901234567890 @@ -75,7 +75,7 @@ Testing LONGREAL. 0.000123D0: 1.2300000000000000D-004 1/0.0: Infinity -1/0.0: -Infinity - 0.0/0.0: -NaN + 0.0/0.0: NaN @@ -94,7 +94,7 @@ Testing REAL. 0.000123E0: 1.23E-04 1/0.0: Infinity -1/0.0: -Infinity - 0.0/0.0: -NaN + 0.0/0.0: NaN 1 2 3 123456789012345678901234567890 @@ -109,7 +109,7 @@ Testing REAL. 0.000123E0: 1.230000E-04 1/0.0: Infinity -1/0.0: -Infinity - 0.0/0.0: -NaN + 0.0/0.0: NaN 1 2 3 4 1234567890123456789012345678901234567890 @@ -124,7 +124,7 @@ Testing REAL. 0.000123E0: 1.23000005E-04 1/0.0: Infinity -1/0.0: -Infinity - 0.0/0.0: -NaN + 0.0/0.0: NaN @@ -175,7 +175,7 @@ Testing LONGREAL. 0.000123D0: 1.23D-004 1/0.0: Infinity -1/0.0: -Infinity - 0.0/0.0: -NaN + 0.0/0.0: NaN 1 2 3 4 1234567890123456789012345678901234567890 @@ -190,7 +190,7 @@ Testing LONGREAL. 0.000123D0: 1.23000D-004 1/0.0: Infinity -1/0.0: -Infinity - 0.0/0.0: -NaN + 0.0/0.0: NaN 1 2 3 4 1234567890123456789012345678901234567890 @@ -205,7 +205,7 @@ Testing LONGREAL. 0.000123D0: 1.2300000000000000D-004 1/0.0: Infinity -1/0.0: -Infinity - 0.0/0.0: -NaN + 0.0/0.0: NaN @@ -224,7 +224,7 @@ Testing REAL. 0.000123E0: 1.23E-04 1/0.0: Infinity -1/0.0: -Infinity - 0.0/0.0: -NaN + 0.0/0.0: NaN 1 2 3 123456789012345678901234567890 @@ -239,7 +239,7 @@ Testing REAL. 0.000123E0: 1.230000E-04 1/0.0: Infinity -1/0.0: -Infinity - 0.0/0.0: -NaN + 0.0/0.0: NaN 1 2 3 4 1234567890123456789012345678901234567890 @@ -254,5 +254,5 @@ Testing REAL. 0.000123E0: 1.23000005E-04 1/0.0: Infinity -1/0.0: -Infinity - 0.0/0.0: -NaN + 0.0/0.0: NaN From ea3061523579836d384dbf706c9a4a92a5c712c4 Mon Sep 17 00:00:00 2001 From: David Brown Date: Wed, 12 Oct 2016 12:08:39 +0100 Subject: [PATCH 280/580] Omit hex display of 0.0/0.0 from outtest as it differs between x86 and arm. --- src/test/confidence/out/outtest.mod | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/confidence/out/outtest.mod b/src/test/confidence/out/outtest.mod index 37881960..aa1997cb 100644 --- a/src/test/confidence/out/outtest.mod +++ b/src/test/confidence/out/outtest.mod @@ -48,7 +48,7 @@ BEGIN lr := 0.000123D0; ws(" 0.000123D0: "); wh(lr); wl; lr := 0.0; lr := 1/lr; ws(" 1/0.0: "); wh(lr); wl; lr := 0.0; lr := -1/lr; ws("-1/0.0: "); wh(lr); wl; - lr := 0.0; lr := 0.0D0/lr; ws(" 0.0/0.0: "); wh(lr); wl; +(*lr := 0.0; lr := 0.0D0/lr; ws(" 0.0/0.0: "); wh(lr); wl;*) wl; r := 1.0E0; ws(" 1.0E0: "); wh(r); wl; r := 1.1E0; ws(" 1.1E0: "); wh(r); wl; @@ -61,7 +61,7 @@ BEGIN r := 0.000123E0; ws(" 0.000123E0: "); wh(r); wl; r := 0.0; r := 1/r; ws(" 1/0.0: "); wh(r); wl; r := 0.0; r := -1/r; ws("-1/0.0: "); wh(r); wl; - r := 0.0; r := 0.0E0/r; ws(" 0.0/0.0: "); wh(r); wl; +(*r := 0.0; r := 0.0E0/r; ws(" 0.0/0.0: "); wh(r); wl;*) wl; wl; ws("Out module tests."); wl; From b231efb466a552dcf6466be1ec68bdc61e9fe420 Mon Sep 17 00:00:00 2001 From: David Brown Date: Wed, 12 Oct 2016 12:30:27 +0100 Subject: [PATCH 281/580] Updated outtest expected results. --- src/test/confidence/out/expected | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/test/confidence/out/expected b/src/test/confidence/out/expected index b5ab3a3b..586814dc 100644 --- a/src/test/confidence/out/expected +++ b/src/test/confidence/out/expected @@ -11,7 +11,6 @@ Real number hex representation. 0.000123D0: 3F201F31F46ED246 1/0.0: 7FF0000000000000 -1/0.0: FFF0000000000000 - 0.0/0.0: FFF8000000000000 1.0E0: 3F800000 1.1E0: 3F8CCCCD @@ -24,7 +23,6 @@ Real number hex representation. 0.000123E0: 3900F990 1/0.0: 7F800000 -1/0.0: FF800000 - 0.0/0.0: FFC00000 Out module tests. @@ -141,7 +139,6 @@ Real number hex representation. 0.000123D0: 3F201F31F46ED246 1/0.0: 7FF0000000000000 -1/0.0: FFF0000000000000 - 0.0/0.0: FFF8000000000000 1.0E0: 3F800000 1.1E0: 3F8CCCCD @@ -154,7 +151,6 @@ Real number hex representation. 0.000123E0: 3900F990 1/0.0: 7F800000 -1/0.0: FF800000 - 0.0/0.0: FFC00000 Out module tests. From 80de6dc2164864ab04d2bf671245084a57b37799 Mon Sep 17 00:00:00 2001 From: David Brown Date: Sat, 15 Oct 2016 17:15:05 +0100 Subject: [PATCH 282/580] Rationalise -O2 vs -OC library build. --- bootstrap/unix-44/Compiler.c | 14 +- bootstrap/unix-44/Configuration.c | 4 +- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Files.c | 2 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 2 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 2 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 20 +- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 2 +- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 2 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Out.c | 3 +- bootstrap/unix-44/Out.h | 2 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/errors.c | 2 +- bootstrap/unix-44/errors.h | 2 +- bootstrap/unix-44/extTools.c | 3 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-44/vt100.c | 190 +++++++-------- bootstrap/unix-44/vt100.h | 56 ++--- bootstrap/unix-48/Compiler.c | 14 +- bootstrap/unix-48/Configuration.c | 4 +- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Files.c | 2 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 2 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 2 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 20 +- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 2 +- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 2 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Out.c | 3 +- bootstrap/unix-48/Out.h | 2 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/errors.c | 2 +- bootstrap/unix-48/errors.h | 2 +- bootstrap/unix-48/extTools.c | 3 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-48/vt100.c | 190 +++++++-------- bootstrap/unix-48/vt100.h | 56 ++--- bootstrap/unix-88/Compiler.c | 14 +- bootstrap/unix-88/Configuration.c | 4 +- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Files.c | 2 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 2 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 2 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 20 +- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 2 +- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 2 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Out.c | 3 +- bootstrap/unix-88/Out.h | 2 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/errors.c | 2 +- bootstrap/unix-88/errors.h | 2 +- bootstrap/unix-88/extTools.c | 3 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/unix-88/vt100.c | 190 +++++++-------- bootstrap/unix-88/vt100.h | 56 ++--- bootstrap/windows-48/Compiler.c | 14 +- bootstrap/windows-48/Configuration.c | 4 +- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Files.c | 2 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 2 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 2 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 20 +- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 2 +- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 2 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Out.c | 3 +- bootstrap/windows-48/Out.h | 2 +- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/errors.c | 2 +- bootstrap/windows-48/errors.h | 2 +- bootstrap/windows-48/extTools.c | 3 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-48/vt100.c | 190 +++++++-------- bootstrap/windows-48/vt100.h | 56 ++--- bootstrap/windows-88/Compiler.c | 14 +- bootstrap/windows-88/Configuration.c | 4 +- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Files.c | 2 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 2 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 2 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 20 +- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 2 +- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 2 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Out.c | 3 +- bootstrap/windows-88/Out.h | 2 +- bootstrap/windows-88/Platform.c | 2 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/errors.c | 2 +- bootstrap/windows-88/errors.h | 2 +- bootstrap/windows-88/extTools.c | 3 +- bootstrap/windows-88/extTools.h | 2 +- bootstrap/windows-88/vt100.c | 190 +++++++-------- bootstrap/windows-88/vt100.h | 56 ++--- makefile | 13 +- src/compiler/Compiler.Mod | 10 +- src/compiler/OPM.Mod | 18 +- src/compiler/extTools.Mod | 1 + src/library/misc/crt.Mod | 107 +++++---- src/library/misc/vt100.Mod | 342 --------------------------- src/library/s3/ethReals.Mod | 2 +- src/runtime/MathL.Mod | 4 +- src/runtime/Out.Mod | 1 + src/runtime/vt100.Mod | 4 +- src/tools/make/oberon.mk | 313 ++++++++++++------------ 206 files changed, 1129 insertions(+), 1456 deletions(-) delete mode 100644 src/library/misc/vt100.Mod diff --git a/bootstrap/unix-44/Compiler.c b/bootstrap/unix-44/Compiler.c index 5ec069b8..82f1ab48 100644 --- a/bootstrap/unix-44/Compiler.c +++ b/bootstrap/unix-44/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 @@ -16,8 +16,8 @@ #include "OPV.h" #include "Platform.h" #include "Strings.h" +#include "VT100.h" #include "extTools.h" -#include "vt100.h" static CHAR Compiler_mname[256]; @@ -47,20 +47,20 @@ void Compiler_Module (BOOLEAN *done) if ((__IN(10, OPM_Options, 32) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { OPM_DeleteNewSym(); if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"32m", 4); + VT100_SetAttr((CHAR*)"32m", 4); } OPM_LogWStr((CHAR*)" Main program.", 16); if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"0m", 3); + VT100_SetAttr((CHAR*)"0m", 3); } } else { if (new) { if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"32m", 4); + VT100_SetAttr((CHAR*)"32m", 4); } OPM_LogWStr((CHAR*)" New symbol file.", 19); if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"0m", 3); + VT100_SetAttr((CHAR*)"0m", 3); } OPM_RegisterNewSym(); } else if (ext) { @@ -175,8 +175,8 @@ export int main(int argc, char **argv) __MODULE_IMPORT(OPV); __MODULE_IMPORT(Platform); __MODULE_IMPORT(Strings); + __MODULE_IMPORT(VT100); __MODULE_IMPORT(extTools); - __MODULE_IMPORT(vt100); __REGMAIN("Compiler", 0); __REGCMD("Translate", Compiler_Translate); /* BEGIN */ diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index 0bef890f..b9310392 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index 286f28c0..c760742c 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 4074c8b1..e46e005c 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index c38c3f26..33cfbbec 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index cb386d17..948db354 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index c6dbfb3e..7712f182 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index e5227fba..5cdcbe9c 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index 77ec53de..e6fcdbbe 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index aab1b7fe..aa7126c9 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index eb00fcda..b63ca81f 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 84393696..d2a4419b 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index d6a60b2e..4da49877 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 76cc2b7c..d202f2cd 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -12,8 +12,8 @@ #include "Platform.h" #include "Strings.h" #include "Texts.h" +#include "VT100.h" #include "errors.h" -#include "vt100.h" typedef CHAR OPM_FileName[32]; @@ -325,7 +325,7 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWLn(); OPM_LogWStr((CHAR*)" Miscellaneous", 16); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -f Disable vt100 control characters in status output.", 60); + OPM_LogWStr((CHAR*)" -f Disable VT100 control characters in status output.", 60); OPM_LogWLn(); OPM_LogWStr((CHAR*)" -V Display compiler debugging messages.", 46); OPM_LogWLn(); @@ -555,20 +555,20 @@ static void OPM_LogErrMsg (int16 n) CHAR buf[1024]; if (n >= 0) { if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"31m", 4); + VT100_SetAttr((CHAR*)"31m", 4); } OPM_LogWStr((CHAR*)" err ", 7); if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"0m", 3); + VT100_SetAttr((CHAR*)"0m", 3); } } else { if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"35m", 4); + VT100_SetAttr((CHAR*)"35m", 4); } OPM_LogWStr((CHAR*)" warning ", 11); n = -n; if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"0m", 3); + VT100_SetAttr((CHAR*)"0m", 3); } } OPM_LogWNum(n, 1); @@ -641,11 +641,11 @@ static void OPM_ShowLine (int64 pos) i -= 1; } if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"32m", 4); + VT100_SetAttr((CHAR*)"32m", 4); } OPM_LogW('^'); if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"0m", 3); + VT100_SetAttr((CHAR*)"0m", 3); } Files_Close(f); } @@ -1079,8 +1079,8 @@ export void *OPM__init(void) __MODULE_IMPORT(Platform); __MODULE_IMPORT(Strings); __MODULE_IMPORT(Texts); + __MODULE_IMPORT(VT100); __MODULE_IMPORT(errors); - __MODULE_IMPORT(vt100); __REGMOD("OPM", EnumPtrs); __REGCMD("CloseFiles", OPM_CloseFiles); __REGCMD("CloseOldSym", OPM_CloseOldSym); diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index b7b19fb7..b088cc93 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index e3a26a86..63fb92b5 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index 1f2ff59f..57f41cf8 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index 72800d6b..e7cd3549 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index 595b3668..0a75e9c7 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index a1e67f1b..c5d47d14 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index d40fcd25..d8da229b 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index 19522c13..fd02ab90 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index fa176ddf..48195728 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Out.c b/bootstrap/unix-44/Out.c index 944cc0e5..67b82ce9 100644 --- a/bootstrap/unix-44/Out.c +++ b/bootstrap/unix-44/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -315,5 +315,6 @@ export void *Out__init(void) __REGCMD("Ln", Out_Ln); __REGCMD("Open", Out_Open); /* BEGIN */ + Out_in = 0; __ENDMOD; } diff --git a/bootstrap/unix-44/Out.h b/bootstrap/unix-44/Out.h index 418e17e2..f91ee6a4 100644 --- a/bootstrap/unix-44/Out.h +++ b/bootstrap/unix-44/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 4c779435..ff57e9c4 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index e45b429c..5e6af8ad 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index ece1bf1d..6135ec40 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index 523e9f9e..86321454 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index c86ccc0e..92ce5fe0 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index c12329ab..76b31eb9 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index 2a154ebf..ac65c9f1 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index 5a8c9b51..60f267ed 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/errors.c b/bootstrap/unix-44/errors.c index 44990c71..70424462 100644 --- a/bootstrap/unix-44/errors.c +++ b/bootstrap/unix-44/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/errors.h b/bootstrap/unix-44/errors.h index e0bb109d..80c4a045 100644 --- a/bootstrap/unix-44/errors.h +++ b/bootstrap/unix-44/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index c83fd7dd..a6e5fe94 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -102,6 +102,7 @@ void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN stati Strings_Append((CHAR*)"", 1, (void*)cmd, 1023); Strings_Append((CHAR*)"/lib\"", 6, (void*)cmd, 1023); Strings_Append((CHAR*)" -l voc", 8, (void*)cmd, 1023); + Strings_Append((CHAR*)"-O", 3, (void*)cmd, 1023); Strings_Append(OPM_Model, 10, (void*)cmd, 1023); extTools_execute((CHAR*)"Assemble and link: ", 20, cmd, 1023); __DEL(additionalopts); diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index 21016d9e..d945916e 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-44/vt100.c b/bootstrap/unix-44/vt100.c index afa2b377..7c1212f5 100644 --- a/bootstrap/unix-44/vt100.c +++ b/bootstrap/unix-44/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -10,40 +10,40 @@ #include "Strings.h" -export CHAR vt100_CSI[5]; -static CHAR vt100_tmpstr[32]; +export CHAR VT100_CSI[5]; +static CHAR VT100_tmpstr[32]; -export void vt100_CHA (int16 n); -export void vt100_CNL (int16 n); -export void vt100_CPL (int16 n); -export void vt100_CUB (int16 n); -export void vt100_CUD (int16 n); -export void vt100_CUF (int16 n); -export void vt100_CUP (int16 n, int16 m); -export void vt100_CUU (int16 n); -export void vt100_DECTCEMh (void); -export void vt100_DECTCEMl (void); -export void vt100_DSR (int16 n); -export void vt100_ED (int16 n); -export void vt100_EL (int16 n); -static void vt100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len); -static void vt100_EscSeq0 (CHAR *letter, LONGINT letter__len); -static void vt100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len); -static void vt100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len); -export void vt100_HVP (int16 n, int16 m); -export void vt100_IntToStr (int32 int_, CHAR *str, LONGINT str__len); -export void vt100_RCP (void); -static void vt100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end); -export void vt100_SCP (void); -export void vt100_SD (int16 n); -export void vt100_SGR (int16 n); -export void vt100_SGR2 (int16 n, int16 m); -export void vt100_SU (int16 n); -export void vt100_SetAttr (CHAR *attr, LONGINT attr__len); +export void VT100_CHA (int16 n); +export void VT100_CNL (int16 n); +export void VT100_CPL (int16 n); +export void VT100_CUB (int16 n); +export void VT100_CUD (int16 n); +export void VT100_CUF (int16 n); +export void VT100_CUP (int16 n, int16 m); +export void VT100_CUU (int16 n); +export void VT100_DECTCEMh (void); +export void VT100_DECTCEMl (void); +export void VT100_DSR (int16 n); +export void VT100_ED (int16 n); +export void VT100_EL (int16 n); +static void VT100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len); +static void VT100_EscSeq0 (CHAR *letter, LONGINT letter__len); +static void VT100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len); +static void VT100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len); +export void VT100_HVP (int16 n, int16 m); +export void VT100_IntToStr (int32 int_, CHAR *str, LONGINT str__len); +export void VT100_RCP (void); +static void VT100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end); +export void VT100_SCP (void); +export void VT100_SD (int16 n); +export void VT100_SGR (int16 n); +export void VT100_SGR2 (int16 n, int16 m); +export void VT100_SU (int16 n); +export void VT100_SetAttr (CHAR *attr, LONGINT attr__len); -static void vt100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end) +static void VT100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end) { CHAR h; while (start < end) { @@ -55,7 +55,7 @@ static void vt100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end) } } -void vt100_IntToStr (int32 int_, CHAR *str, LONGINT str__len) +void VT100_IntToStr (int32 int_, CHAR *str, LONGINT str__len) { CHAR b[21]; int16 s, e; @@ -79,55 +79,55 @@ void vt100_IntToStr (int32 int_, CHAR *str, LONGINT str__len) e += 1; } while (!(int_ == 0)); b[__X(e, 21)] = 0x00; - vt100_Reverse0((void*)b, 21, s, e - 1); + VT100_Reverse0((void*)b, 21, s, e - 1); } __COPY(b, str, str__len); } -static void vt100_EscSeq0 (CHAR *letter, LONGINT letter__len) +static void VT100_EscSeq0 (CHAR *letter, LONGINT letter__len) { CHAR cmd[9]; __DUP(letter, letter__len, CHAR); - __COPY(vt100_CSI, cmd, 9); + __COPY(VT100_CSI, cmd, 9); Strings_Append(letter, letter__len, (void*)cmd, 9); Out_String(cmd, 9); __DEL(letter); } -static void vt100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len) +static void VT100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len) { CHAR nstr[2]; CHAR cmd[7]; __DUP(letter, letter__len, CHAR); - vt100_IntToStr(n, (void*)nstr, 2); - __COPY(vt100_CSI, cmd, 7); + VT100_IntToStr(n, (void*)nstr, 2); + __COPY(VT100_CSI, cmd, 7); Strings_Append(nstr, 2, (void*)cmd, 7); Strings_Append(letter, letter__len, (void*)cmd, 7); Out_String(cmd, 7); __DEL(letter); } -static void vt100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len) +static void VT100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len) { CHAR nstr[2]; CHAR cmd[7]; __DUP(letter, letter__len, CHAR); - vt100_IntToStr(n, (void*)nstr, 2); - __COPY(vt100_CSI, cmd, 7); + VT100_IntToStr(n, (void*)nstr, 2); + __COPY(VT100_CSI, cmd, 7); Strings_Append(letter, letter__len, (void*)cmd, 7); Strings_Append(nstr, 2, (void*)cmd, 7); Out_String(cmd, 7); __DEL(letter); } -static void vt100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len) +static void VT100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len) { CHAR nstr[5], mstr[5]; CHAR cmd[12]; __DUP(letter, letter__len, CHAR); - vt100_IntToStr(n, (void*)nstr, 5); - vt100_IntToStr(m, (void*)mstr, 5); - __COPY(vt100_CSI, cmd, 12); + VT100_IntToStr(n, (void*)nstr, 5); + VT100_IntToStr(m, (void*)mstr, 5); + __COPY(VT100_CSI, cmd, 12); Strings_Append(nstr, 5, (void*)cmd, 12); Strings_Append((CHAR*)";", 2, (void*)cmd, 12); Strings_Append(mstr, 5, (void*)cmd, 12); @@ -136,129 +136,129 @@ static void vt100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len) __DEL(letter); } -void vt100_CUU (int16 n) +void VT100_CUU (int16 n) { - vt100_EscSeq(n, (CHAR*)"A", 2); + VT100_EscSeq(n, (CHAR*)"A", 2); } -void vt100_CUD (int16 n) +void VT100_CUD (int16 n) { - vt100_EscSeq(n, (CHAR*)"B", 2); + VT100_EscSeq(n, (CHAR*)"B", 2); } -void vt100_CUF (int16 n) +void VT100_CUF (int16 n) { - vt100_EscSeq(n, (CHAR*)"C", 2); + VT100_EscSeq(n, (CHAR*)"C", 2); } -void vt100_CUB (int16 n) +void VT100_CUB (int16 n) { - vt100_EscSeq(n, (CHAR*)"D", 2); + VT100_EscSeq(n, (CHAR*)"D", 2); } -void vt100_CNL (int16 n) +void VT100_CNL (int16 n) { - vt100_EscSeq(n, (CHAR*)"E", 2); + VT100_EscSeq(n, (CHAR*)"E", 2); } -void vt100_CPL (int16 n) +void VT100_CPL (int16 n) { - vt100_EscSeq(n, (CHAR*)"F", 2); + VT100_EscSeq(n, (CHAR*)"F", 2); } -void vt100_CHA (int16 n) +void VT100_CHA (int16 n) { - vt100_EscSeq(n, (CHAR*)"G", 2); + VT100_EscSeq(n, (CHAR*)"G", 2); } -void vt100_CUP (int16 n, int16 m) +void VT100_CUP (int16 n, int16 m) { - vt100_EscSeq2(n, m, (CHAR*)"H", 2); + VT100_EscSeq2(n, m, (CHAR*)"H", 2); } -void vt100_ED (int16 n) +void VT100_ED (int16 n) { - vt100_EscSeq(n, (CHAR*)"J", 2); + VT100_EscSeq(n, (CHAR*)"J", 2); } -void vt100_EL (int16 n) +void VT100_EL (int16 n) { - vt100_EscSeq(n, (CHAR*)"K", 2); + VT100_EscSeq(n, (CHAR*)"K", 2); } -void vt100_SU (int16 n) +void VT100_SU (int16 n) { - vt100_EscSeq(n, (CHAR*)"S", 2); + VT100_EscSeq(n, (CHAR*)"S", 2); } -void vt100_SD (int16 n) +void VT100_SD (int16 n) { - vt100_EscSeq(n, (CHAR*)"T", 2); + VT100_EscSeq(n, (CHAR*)"T", 2); } -void vt100_HVP (int16 n, int16 m) +void VT100_HVP (int16 n, int16 m) { - vt100_EscSeq2(n, m, (CHAR*)"f", 2); + VT100_EscSeq2(n, m, (CHAR*)"f", 2); } -void vt100_SGR (int16 n) +void VT100_SGR (int16 n) { - vt100_EscSeq(n, (CHAR*)"m", 2); + VT100_EscSeq(n, (CHAR*)"m", 2); } -void vt100_SGR2 (int16 n, int16 m) +void VT100_SGR2 (int16 n, int16 m) { - vt100_EscSeq2(n, m, (CHAR*)"m", 2); + VT100_EscSeq2(n, m, (CHAR*)"m", 2); } -void vt100_DSR (int16 n) +void VT100_DSR (int16 n) { - vt100_EscSeq(6, (CHAR*)"n", 2); + VT100_EscSeq(6, (CHAR*)"n", 2); } -void vt100_SCP (void) +void VT100_SCP (void) { - vt100_EscSeq0((CHAR*)"s", 2); + VT100_EscSeq0((CHAR*)"s", 2); } -void vt100_RCP (void) +void VT100_RCP (void) { - vt100_EscSeq0((CHAR*)"u", 2); + VT100_EscSeq0((CHAR*)"u", 2); } -void vt100_DECTCEMl (void) +void VT100_DECTCEMl (void) { - vt100_EscSeq0((CHAR*)"\?25l", 5); + VT100_EscSeq0((CHAR*)"\?25l", 5); } -void vt100_DECTCEMh (void) +void VT100_DECTCEMh (void) { - vt100_EscSeq0((CHAR*)"\?25h", 5); + VT100_EscSeq0((CHAR*)"\?25h", 5); } -void vt100_SetAttr (CHAR *attr, LONGINT attr__len) +void VT100_SetAttr (CHAR *attr, LONGINT attr__len) { CHAR tmpstr[16]; __DUP(attr, attr__len, CHAR); - __COPY(vt100_CSI, tmpstr, 16); + __COPY(VT100_CSI, tmpstr, 16); Strings_Append(attr, attr__len, (void*)tmpstr, 16); Out_String(tmpstr, 16); __DEL(attr); } -export void *vt100__init(void) +export void *VT100__init(void) { __DEFMOD; __MODULE_IMPORT(Out); __MODULE_IMPORT(Strings); - __REGMOD("vt100", 0); - __REGCMD("DECTCEMh", vt100_DECTCEMh); - __REGCMD("DECTCEMl", vt100_DECTCEMl); - __REGCMD("RCP", vt100_RCP); - __REGCMD("SCP", vt100_SCP); + __REGMOD("VT100", 0); + __REGCMD("DECTCEMh", VT100_DECTCEMh); + __REGCMD("DECTCEMl", VT100_DECTCEMl); + __REGCMD("RCP", VT100_RCP); + __REGCMD("SCP", VT100_SCP); /* BEGIN */ - __COPY("\033", vt100_CSI, 5); - Strings_Append((CHAR*)"[", 2, (void*)vt100_CSI, 5); + __COPY("\033", VT100_CSI, 5); + Strings_Append((CHAR*)"[", 2, (void*)VT100_CSI, 5); __ENDMOD; } diff --git a/bootstrap/unix-44/vt100.h b/bootstrap/unix-44/vt100.h index 03038059..64913ea9 100644 --- a/bootstrap/unix-44/vt100.h +++ b/bootstrap/unix-44/vt100.h @@ -1,37 +1,37 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#ifndef vt100__h -#define vt100__h +#ifndef VT100__h +#define VT100__h #include "SYSTEM.h" -import CHAR vt100_CSI[5]; +import CHAR VT100_CSI[5]; -import void vt100_CHA (int16 n); -import void vt100_CNL (int16 n); -import void vt100_CPL (int16 n); -import void vt100_CUB (int16 n); -import void vt100_CUD (int16 n); -import void vt100_CUF (int16 n); -import void vt100_CUP (int16 n, int16 m); -import void vt100_CUU (int16 n); -import void vt100_DECTCEMh (void); -import void vt100_DECTCEMl (void); -import void vt100_DSR (int16 n); -import void vt100_ED (int16 n); -import void vt100_EL (int16 n); -import void vt100_HVP (int16 n, int16 m); -import void vt100_IntToStr (int32 int_, CHAR *str, LONGINT str__len); -import void vt100_RCP (void); -import void vt100_SCP (void); -import void vt100_SD (int16 n); -import void vt100_SGR (int16 n); -import void vt100_SGR2 (int16 n, int16 m); -import void vt100_SU (int16 n); -import void vt100_SetAttr (CHAR *attr, LONGINT attr__len); -import void *vt100__init(void); +import void VT100_CHA (int16 n); +import void VT100_CNL (int16 n); +import void VT100_CPL (int16 n); +import void VT100_CUB (int16 n); +import void VT100_CUD (int16 n); +import void VT100_CUF (int16 n); +import void VT100_CUP (int16 n, int16 m); +import void VT100_CUU (int16 n); +import void VT100_DECTCEMh (void); +import void VT100_DECTCEMl (void); +import void VT100_DSR (int16 n); +import void VT100_ED (int16 n); +import void VT100_EL (int16 n); +import void VT100_HVP (int16 n, int16 m); +import void VT100_IntToStr (int32 int_, CHAR *str, LONGINT str__len); +import void VT100_RCP (void); +import void VT100_SCP (void); +import void VT100_SD (int16 n); +import void VT100_SGR (int16 n); +import void VT100_SGR2 (int16 n, int16 m); +import void VT100_SU (int16 n); +import void VT100_SetAttr (CHAR *attr, LONGINT attr__len); +import void *VT100__init(void); -#endif // vt100 +#endif // VT100 diff --git a/bootstrap/unix-48/Compiler.c b/bootstrap/unix-48/Compiler.c index 5ec069b8..82f1ab48 100644 --- a/bootstrap/unix-48/Compiler.c +++ b/bootstrap/unix-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 @@ -16,8 +16,8 @@ #include "OPV.h" #include "Platform.h" #include "Strings.h" +#include "VT100.h" #include "extTools.h" -#include "vt100.h" static CHAR Compiler_mname[256]; @@ -47,20 +47,20 @@ void Compiler_Module (BOOLEAN *done) if ((__IN(10, OPM_Options, 32) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { OPM_DeleteNewSym(); if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"32m", 4); + VT100_SetAttr((CHAR*)"32m", 4); } OPM_LogWStr((CHAR*)" Main program.", 16); if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"0m", 3); + VT100_SetAttr((CHAR*)"0m", 3); } } else { if (new) { if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"32m", 4); + VT100_SetAttr((CHAR*)"32m", 4); } OPM_LogWStr((CHAR*)" New symbol file.", 19); if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"0m", 3); + VT100_SetAttr((CHAR*)"0m", 3); } OPM_RegisterNewSym(); } else if (ext) { @@ -175,8 +175,8 @@ export int main(int argc, char **argv) __MODULE_IMPORT(OPV); __MODULE_IMPORT(Platform); __MODULE_IMPORT(Strings); + __MODULE_IMPORT(VT100); __MODULE_IMPORT(extTools); - __MODULE_IMPORT(vt100); __REGMAIN("Compiler", 0); __REGCMD("Translate", Compiler_Translate); /* BEGIN */ diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index 0bef890f..b9310392 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index 286f28c0..c760742c 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 4074c8b1..e46e005c 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index c38c3f26..33cfbbec 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index cb386d17..948db354 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index c6dbfb3e..7712f182 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index e5227fba..5cdcbe9c 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index 77ec53de..e6fcdbbe 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index aab1b7fe..aa7126c9 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index eb00fcda..b63ca81f 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 84393696..d2a4419b 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index d6a60b2e..4da49877 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 76cc2b7c..d202f2cd 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -12,8 +12,8 @@ #include "Platform.h" #include "Strings.h" #include "Texts.h" +#include "VT100.h" #include "errors.h" -#include "vt100.h" typedef CHAR OPM_FileName[32]; @@ -325,7 +325,7 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWLn(); OPM_LogWStr((CHAR*)" Miscellaneous", 16); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -f Disable vt100 control characters in status output.", 60); + OPM_LogWStr((CHAR*)" -f Disable VT100 control characters in status output.", 60); OPM_LogWLn(); OPM_LogWStr((CHAR*)" -V Display compiler debugging messages.", 46); OPM_LogWLn(); @@ -555,20 +555,20 @@ static void OPM_LogErrMsg (int16 n) CHAR buf[1024]; if (n >= 0) { if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"31m", 4); + VT100_SetAttr((CHAR*)"31m", 4); } OPM_LogWStr((CHAR*)" err ", 7); if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"0m", 3); + VT100_SetAttr((CHAR*)"0m", 3); } } else { if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"35m", 4); + VT100_SetAttr((CHAR*)"35m", 4); } OPM_LogWStr((CHAR*)" warning ", 11); n = -n; if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"0m", 3); + VT100_SetAttr((CHAR*)"0m", 3); } } OPM_LogWNum(n, 1); @@ -641,11 +641,11 @@ static void OPM_ShowLine (int64 pos) i -= 1; } if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"32m", 4); + VT100_SetAttr((CHAR*)"32m", 4); } OPM_LogW('^'); if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"0m", 3); + VT100_SetAttr((CHAR*)"0m", 3); } Files_Close(f); } @@ -1079,8 +1079,8 @@ export void *OPM__init(void) __MODULE_IMPORT(Platform); __MODULE_IMPORT(Strings); __MODULE_IMPORT(Texts); + __MODULE_IMPORT(VT100); __MODULE_IMPORT(errors); - __MODULE_IMPORT(vt100); __REGMOD("OPM", EnumPtrs); __REGCMD("CloseFiles", OPM_CloseFiles); __REGCMD("CloseOldSym", OPM_CloseOldSym); diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index b7b19fb7..b088cc93 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index e3a26a86..63fb92b5 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index 1f2ff59f..57f41cf8 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index 72800d6b..e7cd3549 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index 595b3668..0a75e9c7 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index bc22f7e2..6f466b3e 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index d40fcd25..d8da229b 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index 19522c13..fd02ab90 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index fa176ddf..48195728 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Out.c b/bootstrap/unix-48/Out.c index 944cc0e5..67b82ce9 100644 --- a/bootstrap/unix-48/Out.c +++ b/bootstrap/unix-48/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -315,5 +315,6 @@ export void *Out__init(void) __REGCMD("Ln", Out_Ln); __REGCMD("Open", Out_Open); /* BEGIN */ + Out_in = 0; __ENDMOD; } diff --git a/bootstrap/unix-48/Out.h b/bootstrap/unix-48/Out.h index 418e17e2..f91ee6a4 100644 --- a/bootstrap/unix-48/Out.h +++ b/bootstrap/unix-48/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 4c779435..ff57e9c4 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index e45b429c..5e6af8ad 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index ece1bf1d..6135ec40 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index 523e9f9e..86321454 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index c86ccc0e..92ce5fe0 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index c12329ab..76b31eb9 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index 672171ee..b5634f26 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index 802df5a7..7709374b 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/errors.c b/bootstrap/unix-48/errors.c index 44990c71..70424462 100644 --- a/bootstrap/unix-48/errors.c +++ b/bootstrap/unix-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/errors.h b/bootstrap/unix-48/errors.h index e0bb109d..80c4a045 100644 --- a/bootstrap/unix-48/errors.h +++ b/bootstrap/unix-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index c83fd7dd..a6e5fe94 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -102,6 +102,7 @@ void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN stati Strings_Append((CHAR*)"", 1, (void*)cmd, 1023); Strings_Append((CHAR*)"/lib\"", 6, (void*)cmd, 1023); Strings_Append((CHAR*)" -l voc", 8, (void*)cmd, 1023); + Strings_Append((CHAR*)"-O", 3, (void*)cmd, 1023); Strings_Append(OPM_Model, 10, (void*)cmd, 1023); extTools_execute((CHAR*)"Assemble and link: ", 20, cmd, 1023); __DEL(additionalopts); diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index 21016d9e..d945916e 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/vt100.c b/bootstrap/unix-48/vt100.c index afa2b377..7c1212f5 100644 --- a/bootstrap/unix-48/vt100.c +++ b/bootstrap/unix-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -10,40 +10,40 @@ #include "Strings.h" -export CHAR vt100_CSI[5]; -static CHAR vt100_tmpstr[32]; +export CHAR VT100_CSI[5]; +static CHAR VT100_tmpstr[32]; -export void vt100_CHA (int16 n); -export void vt100_CNL (int16 n); -export void vt100_CPL (int16 n); -export void vt100_CUB (int16 n); -export void vt100_CUD (int16 n); -export void vt100_CUF (int16 n); -export void vt100_CUP (int16 n, int16 m); -export void vt100_CUU (int16 n); -export void vt100_DECTCEMh (void); -export void vt100_DECTCEMl (void); -export void vt100_DSR (int16 n); -export void vt100_ED (int16 n); -export void vt100_EL (int16 n); -static void vt100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len); -static void vt100_EscSeq0 (CHAR *letter, LONGINT letter__len); -static void vt100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len); -static void vt100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len); -export void vt100_HVP (int16 n, int16 m); -export void vt100_IntToStr (int32 int_, CHAR *str, LONGINT str__len); -export void vt100_RCP (void); -static void vt100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end); -export void vt100_SCP (void); -export void vt100_SD (int16 n); -export void vt100_SGR (int16 n); -export void vt100_SGR2 (int16 n, int16 m); -export void vt100_SU (int16 n); -export void vt100_SetAttr (CHAR *attr, LONGINT attr__len); +export void VT100_CHA (int16 n); +export void VT100_CNL (int16 n); +export void VT100_CPL (int16 n); +export void VT100_CUB (int16 n); +export void VT100_CUD (int16 n); +export void VT100_CUF (int16 n); +export void VT100_CUP (int16 n, int16 m); +export void VT100_CUU (int16 n); +export void VT100_DECTCEMh (void); +export void VT100_DECTCEMl (void); +export void VT100_DSR (int16 n); +export void VT100_ED (int16 n); +export void VT100_EL (int16 n); +static void VT100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len); +static void VT100_EscSeq0 (CHAR *letter, LONGINT letter__len); +static void VT100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len); +static void VT100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len); +export void VT100_HVP (int16 n, int16 m); +export void VT100_IntToStr (int32 int_, CHAR *str, LONGINT str__len); +export void VT100_RCP (void); +static void VT100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end); +export void VT100_SCP (void); +export void VT100_SD (int16 n); +export void VT100_SGR (int16 n); +export void VT100_SGR2 (int16 n, int16 m); +export void VT100_SU (int16 n); +export void VT100_SetAttr (CHAR *attr, LONGINT attr__len); -static void vt100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end) +static void VT100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end) { CHAR h; while (start < end) { @@ -55,7 +55,7 @@ static void vt100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end) } } -void vt100_IntToStr (int32 int_, CHAR *str, LONGINT str__len) +void VT100_IntToStr (int32 int_, CHAR *str, LONGINT str__len) { CHAR b[21]; int16 s, e; @@ -79,55 +79,55 @@ void vt100_IntToStr (int32 int_, CHAR *str, LONGINT str__len) e += 1; } while (!(int_ == 0)); b[__X(e, 21)] = 0x00; - vt100_Reverse0((void*)b, 21, s, e - 1); + VT100_Reverse0((void*)b, 21, s, e - 1); } __COPY(b, str, str__len); } -static void vt100_EscSeq0 (CHAR *letter, LONGINT letter__len) +static void VT100_EscSeq0 (CHAR *letter, LONGINT letter__len) { CHAR cmd[9]; __DUP(letter, letter__len, CHAR); - __COPY(vt100_CSI, cmd, 9); + __COPY(VT100_CSI, cmd, 9); Strings_Append(letter, letter__len, (void*)cmd, 9); Out_String(cmd, 9); __DEL(letter); } -static void vt100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len) +static void VT100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len) { CHAR nstr[2]; CHAR cmd[7]; __DUP(letter, letter__len, CHAR); - vt100_IntToStr(n, (void*)nstr, 2); - __COPY(vt100_CSI, cmd, 7); + VT100_IntToStr(n, (void*)nstr, 2); + __COPY(VT100_CSI, cmd, 7); Strings_Append(nstr, 2, (void*)cmd, 7); Strings_Append(letter, letter__len, (void*)cmd, 7); Out_String(cmd, 7); __DEL(letter); } -static void vt100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len) +static void VT100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len) { CHAR nstr[2]; CHAR cmd[7]; __DUP(letter, letter__len, CHAR); - vt100_IntToStr(n, (void*)nstr, 2); - __COPY(vt100_CSI, cmd, 7); + VT100_IntToStr(n, (void*)nstr, 2); + __COPY(VT100_CSI, cmd, 7); Strings_Append(letter, letter__len, (void*)cmd, 7); Strings_Append(nstr, 2, (void*)cmd, 7); Out_String(cmd, 7); __DEL(letter); } -static void vt100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len) +static void VT100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len) { CHAR nstr[5], mstr[5]; CHAR cmd[12]; __DUP(letter, letter__len, CHAR); - vt100_IntToStr(n, (void*)nstr, 5); - vt100_IntToStr(m, (void*)mstr, 5); - __COPY(vt100_CSI, cmd, 12); + VT100_IntToStr(n, (void*)nstr, 5); + VT100_IntToStr(m, (void*)mstr, 5); + __COPY(VT100_CSI, cmd, 12); Strings_Append(nstr, 5, (void*)cmd, 12); Strings_Append((CHAR*)";", 2, (void*)cmd, 12); Strings_Append(mstr, 5, (void*)cmd, 12); @@ -136,129 +136,129 @@ static void vt100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len) __DEL(letter); } -void vt100_CUU (int16 n) +void VT100_CUU (int16 n) { - vt100_EscSeq(n, (CHAR*)"A", 2); + VT100_EscSeq(n, (CHAR*)"A", 2); } -void vt100_CUD (int16 n) +void VT100_CUD (int16 n) { - vt100_EscSeq(n, (CHAR*)"B", 2); + VT100_EscSeq(n, (CHAR*)"B", 2); } -void vt100_CUF (int16 n) +void VT100_CUF (int16 n) { - vt100_EscSeq(n, (CHAR*)"C", 2); + VT100_EscSeq(n, (CHAR*)"C", 2); } -void vt100_CUB (int16 n) +void VT100_CUB (int16 n) { - vt100_EscSeq(n, (CHAR*)"D", 2); + VT100_EscSeq(n, (CHAR*)"D", 2); } -void vt100_CNL (int16 n) +void VT100_CNL (int16 n) { - vt100_EscSeq(n, (CHAR*)"E", 2); + VT100_EscSeq(n, (CHAR*)"E", 2); } -void vt100_CPL (int16 n) +void VT100_CPL (int16 n) { - vt100_EscSeq(n, (CHAR*)"F", 2); + VT100_EscSeq(n, (CHAR*)"F", 2); } -void vt100_CHA (int16 n) +void VT100_CHA (int16 n) { - vt100_EscSeq(n, (CHAR*)"G", 2); + VT100_EscSeq(n, (CHAR*)"G", 2); } -void vt100_CUP (int16 n, int16 m) +void VT100_CUP (int16 n, int16 m) { - vt100_EscSeq2(n, m, (CHAR*)"H", 2); + VT100_EscSeq2(n, m, (CHAR*)"H", 2); } -void vt100_ED (int16 n) +void VT100_ED (int16 n) { - vt100_EscSeq(n, (CHAR*)"J", 2); + VT100_EscSeq(n, (CHAR*)"J", 2); } -void vt100_EL (int16 n) +void VT100_EL (int16 n) { - vt100_EscSeq(n, (CHAR*)"K", 2); + VT100_EscSeq(n, (CHAR*)"K", 2); } -void vt100_SU (int16 n) +void VT100_SU (int16 n) { - vt100_EscSeq(n, (CHAR*)"S", 2); + VT100_EscSeq(n, (CHAR*)"S", 2); } -void vt100_SD (int16 n) +void VT100_SD (int16 n) { - vt100_EscSeq(n, (CHAR*)"T", 2); + VT100_EscSeq(n, (CHAR*)"T", 2); } -void vt100_HVP (int16 n, int16 m) +void VT100_HVP (int16 n, int16 m) { - vt100_EscSeq2(n, m, (CHAR*)"f", 2); + VT100_EscSeq2(n, m, (CHAR*)"f", 2); } -void vt100_SGR (int16 n) +void VT100_SGR (int16 n) { - vt100_EscSeq(n, (CHAR*)"m", 2); + VT100_EscSeq(n, (CHAR*)"m", 2); } -void vt100_SGR2 (int16 n, int16 m) +void VT100_SGR2 (int16 n, int16 m) { - vt100_EscSeq2(n, m, (CHAR*)"m", 2); + VT100_EscSeq2(n, m, (CHAR*)"m", 2); } -void vt100_DSR (int16 n) +void VT100_DSR (int16 n) { - vt100_EscSeq(6, (CHAR*)"n", 2); + VT100_EscSeq(6, (CHAR*)"n", 2); } -void vt100_SCP (void) +void VT100_SCP (void) { - vt100_EscSeq0((CHAR*)"s", 2); + VT100_EscSeq0((CHAR*)"s", 2); } -void vt100_RCP (void) +void VT100_RCP (void) { - vt100_EscSeq0((CHAR*)"u", 2); + VT100_EscSeq0((CHAR*)"u", 2); } -void vt100_DECTCEMl (void) +void VT100_DECTCEMl (void) { - vt100_EscSeq0((CHAR*)"\?25l", 5); + VT100_EscSeq0((CHAR*)"\?25l", 5); } -void vt100_DECTCEMh (void) +void VT100_DECTCEMh (void) { - vt100_EscSeq0((CHAR*)"\?25h", 5); + VT100_EscSeq0((CHAR*)"\?25h", 5); } -void vt100_SetAttr (CHAR *attr, LONGINT attr__len) +void VT100_SetAttr (CHAR *attr, LONGINT attr__len) { CHAR tmpstr[16]; __DUP(attr, attr__len, CHAR); - __COPY(vt100_CSI, tmpstr, 16); + __COPY(VT100_CSI, tmpstr, 16); Strings_Append(attr, attr__len, (void*)tmpstr, 16); Out_String(tmpstr, 16); __DEL(attr); } -export void *vt100__init(void) +export void *VT100__init(void) { __DEFMOD; __MODULE_IMPORT(Out); __MODULE_IMPORT(Strings); - __REGMOD("vt100", 0); - __REGCMD("DECTCEMh", vt100_DECTCEMh); - __REGCMD("DECTCEMl", vt100_DECTCEMl); - __REGCMD("RCP", vt100_RCP); - __REGCMD("SCP", vt100_SCP); + __REGMOD("VT100", 0); + __REGCMD("DECTCEMh", VT100_DECTCEMh); + __REGCMD("DECTCEMl", VT100_DECTCEMl); + __REGCMD("RCP", VT100_RCP); + __REGCMD("SCP", VT100_SCP); /* BEGIN */ - __COPY("\033", vt100_CSI, 5); - Strings_Append((CHAR*)"[", 2, (void*)vt100_CSI, 5); + __COPY("\033", VT100_CSI, 5); + Strings_Append((CHAR*)"[", 2, (void*)VT100_CSI, 5); __ENDMOD; } diff --git a/bootstrap/unix-48/vt100.h b/bootstrap/unix-48/vt100.h index 03038059..64913ea9 100644 --- a/bootstrap/unix-48/vt100.h +++ b/bootstrap/unix-48/vt100.h @@ -1,37 +1,37 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#ifndef vt100__h -#define vt100__h +#ifndef VT100__h +#define VT100__h #include "SYSTEM.h" -import CHAR vt100_CSI[5]; +import CHAR VT100_CSI[5]; -import void vt100_CHA (int16 n); -import void vt100_CNL (int16 n); -import void vt100_CPL (int16 n); -import void vt100_CUB (int16 n); -import void vt100_CUD (int16 n); -import void vt100_CUF (int16 n); -import void vt100_CUP (int16 n, int16 m); -import void vt100_CUU (int16 n); -import void vt100_DECTCEMh (void); -import void vt100_DECTCEMl (void); -import void vt100_DSR (int16 n); -import void vt100_ED (int16 n); -import void vt100_EL (int16 n); -import void vt100_HVP (int16 n, int16 m); -import void vt100_IntToStr (int32 int_, CHAR *str, LONGINT str__len); -import void vt100_RCP (void); -import void vt100_SCP (void); -import void vt100_SD (int16 n); -import void vt100_SGR (int16 n); -import void vt100_SGR2 (int16 n, int16 m); -import void vt100_SU (int16 n); -import void vt100_SetAttr (CHAR *attr, LONGINT attr__len); -import void *vt100__init(void); +import void VT100_CHA (int16 n); +import void VT100_CNL (int16 n); +import void VT100_CPL (int16 n); +import void VT100_CUB (int16 n); +import void VT100_CUD (int16 n); +import void VT100_CUF (int16 n); +import void VT100_CUP (int16 n, int16 m); +import void VT100_CUU (int16 n); +import void VT100_DECTCEMh (void); +import void VT100_DECTCEMl (void); +import void VT100_DSR (int16 n); +import void VT100_ED (int16 n); +import void VT100_EL (int16 n); +import void VT100_HVP (int16 n, int16 m); +import void VT100_IntToStr (int32 int_, CHAR *str, LONGINT str__len); +import void VT100_RCP (void); +import void VT100_SCP (void); +import void VT100_SD (int16 n); +import void VT100_SGR (int16 n); +import void VT100_SGR2 (int16 n, int16 m); +import void VT100_SU (int16 n); +import void VT100_SetAttr (CHAR *attr, LONGINT attr__len); +import void *VT100__init(void); -#endif // vt100 +#endif // VT100 diff --git a/bootstrap/unix-88/Compiler.c b/bootstrap/unix-88/Compiler.c index 5ec069b8..82f1ab48 100644 --- a/bootstrap/unix-88/Compiler.c +++ b/bootstrap/unix-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 @@ -16,8 +16,8 @@ #include "OPV.h" #include "Platform.h" #include "Strings.h" +#include "VT100.h" #include "extTools.h" -#include "vt100.h" static CHAR Compiler_mname[256]; @@ -47,20 +47,20 @@ void Compiler_Module (BOOLEAN *done) if ((__IN(10, OPM_Options, 32) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { OPM_DeleteNewSym(); if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"32m", 4); + VT100_SetAttr((CHAR*)"32m", 4); } OPM_LogWStr((CHAR*)" Main program.", 16); if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"0m", 3); + VT100_SetAttr((CHAR*)"0m", 3); } } else { if (new) { if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"32m", 4); + VT100_SetAttr((CHAR*)"32m", 4); } OPM_LogWStr((CHAR*)" New symbol file.", 19); if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"0m", 3); + VT100_SetAttr((CHAR*)"0m", 3); } OPM_RegisterNewSym(); } else if (ext) { @@ -175,8 +175,8 @@ export int main(int argc, char **argv) __MODULE_IMPORT(OPV); __MODULE_IMPORT(Platform); __MODULE_IMPORT(Strings); + __MODULE_IMPORT(VT100); __MODULE_IMPORT(extTools); - __MODULE_IMPORT(vt100); __REGMAIN("Compiler", 0); __REGCMD("Translate", Compiler_Translate); /* BEGIN */ diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index 0bef890f..b9310392 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index 286f28c0..c760742c 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index e380bc50..22e659a7 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 5c717742..42a47cdf 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index 1a82d9e8..42134b68 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index abcafa6a..521ccc74 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 5fdce638..2a860e62 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index 77ec53de..e6fcdbbe 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index aab1b7fe..aa7126c9 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index eb00fcda..b63ca81f 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index 84393696..d2a4419b 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index d6a60b2e..4da49877 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index ca25d1e6..686c674e 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -12,8 +12,8 @@ #include "Platform.h" #include "Strings.h" #include "Texts.h" +#include "VT100.h" #include "errors.h" -#include "vt100.h" typedef CHAR OPM_FileName[32]; @@ -325,7 +325,7 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWLn(); OPM_LogWStr((CHAR*)" Miscellaneous", 16); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -f Disable vt100 control characters in status output.", 60); + OPM_LogWStr((CHAR*)" -f Disable VT100 control characters in status output.", 60); OPM_LogWLn(); OPM_LogWStr((CHAR*)" -V Display compiler debugging messages.", 46); OPM_LogWLn(); @@ -555,20 +555,20 @@ static void OPM_LogErrMsg (int16 n) CHAR buf[1024]; if (n >= 0) { if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"31m", 4); + VT100_SetAttr((CHAR*)"31m", 4); } OPM_LogWStr((CHAR*)" err ", 7); if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"0m", 3); + VT100_SetAttr((CHAR*)"0m", 3); } } else { if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"35m", 4); + VT100_SetAttr((CHAR*)"35m", 4); } OPM_LogWStr((CHAR*)" warning ", 11); n = -n; if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"0m", 3); + VT100_SetAttr((CHAR*)"0m", 3); } } OPM_LogWNum(n, 1); @@ -641,11 +641,11 @@ static void OPM_ShowLine (int64 pos) i -= 1; } if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"32m", 4); + VT100_SetAttr((CHAR*)"32m", 4); } OPM_LogW('^'); if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"0m", 3); + VT100_SetAttr((CHAR*)"0m", 3); } Files_Close(f); } @@ -1079,8 +1079,8 @@ export void *OPM__init(void) __MODULE_IMPORT(Platform); __MODULE_IMPORT(Strings); __MODULE_IMPORT(Texts); + __MODULE_IMPORT(VT100); __MODULE_IMPORT(errors); - __MODULE_IMPORT(vt100); __REGMOD("OPM", EnumPtrs); __REGCMD("CloseFiles", OPM_CloseFiles); __REGCMD("CloseOldSym", OPM_CloseOldSym); diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index b7b19fb7..b088cc93 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index 64a861ac..29f9ae66 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index 1f2ff59f..57f41cf8 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index 72800d6b..e7cd3549 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index 595b3668..0a75e9c7 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index 7be03e0d..85221274 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index d40fcd25..d8da229b 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 90adf5f7..7e6d40e5 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index fa176ddf..48195728 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Out.c b/bootstrap/unix-88/Out.c index 944cc0e5..67b82ce9 100644 --- a/bootstrap/unix-88/Out.c +++ b/bootstrap/unix-88/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -315,5 +315,6 @@ export void *Out__init(void) __REGCMD("Ln", Out_Ln); __REGCMD("Open", Out_Open); /* BEGIN */ + Out_in = 0; __ENDMOD; } diff --git a/bootstrap/unix-88/Out.h b/bootstrap/unix-88/Out.h index 418e17e2..f91ee6a4 100644 --- a/bootstrap/unix-88/Out.h +++ b/bootstrap/unix-88/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 4d742327..d58fec88 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index 1df437c2..9216622f 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index ece1bf1d..6135ec40 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index 523e9f9e..86321454 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index c86ccc0e..92ce5fe0 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index c12329ab..76b31eb9 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index 6033652e..09708beb 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index 54f5d5ee..14846883 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/errors.c b/bootstrap/unix-88/errors.c index 44990c71..70424462 100644 --- a/bootstrap/unix-88/errors.c +++ b/bootstrap/unix-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/errors.h b/bootstrap/unix-88/errors.h index e0bb109d..80c4a045 100644 --- a/bootstrap/unix-88/errors.h +++ b/bootstrap/unix-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index c83fd7dd..a6e5fe94 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -102,6 +102,7 @@ void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN stati Strings_Append((CHAR*)"", 1, (void*)cmd, 1023); Strings_Append((CHAR*)"/lib\"", 6, (void*)cmd, 1023); Strings_Append((CHAR*)" -l voc", 8, (void*)cmd, 1023); + Strings_Append((CHAR*)"-O", 3, (void*)cmd, 1023); Strings_Append(OPM_Model, 10, (void*)cmd, 1023); extTools_execute((CHAR*)"Assemble and link: ", 20, cmd, 1023); __DEL(additionalopts); diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index 21016d9e..d945916e 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/vt100.c b/bootstrap/unix-88/vt100.c index afa2b377..7c1212f5 100644 --- a/bootstrap/unix-88/vt100.c +++ b/bootstrap/unix-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -10,40 +10,40 @@ #include "Strings.h" -export CHAR vt100_CSI[5]; -static CHAR vt100_tmpstr[32]; +export CHAR VT100_CSI[5]; +static CHAR VT100_tmpstr[32]; -export void vt100_CHA (int16 n); -export void vt100_CNL (int16 n); -export void vt100_CPL (int16 n); -export void vt100_CUB (int16 n); -export void vt100_CUD (int16 n); -export void vt100_CUF (int16 n); -export void vt100_CUP (int16 n, int16 m); -export void vt100_CUU (int16 n); -export void vt100_DECTCEMh (void); -export void vt100_DECTCEMl (void); -export void vt100_DSR (int16 n); -export void vt100_ED (int16 n); -export void vt100_EL (int16 n); -static void vt100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len); -static void vt100_EscSeq0 (CHAR *letter, LONGINT letter__len); -static void vt100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len); -static void vt100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len); -export void vt100_HVP (int16 n, int16 m); -export void vt100_IntToStr (int32 int_, CHAR *str, LONGINT str__len); -export void vt100_RCP (void); -static void vt100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end); -export void vt100_SCP (void); -export void vt100_SD (int16 n); -export void vt100_SGR (int16 n); -export void vt100_SGR2 (int16 n, int16 m); -export void vt100_SU (int16 n); -export void vt100_SetAttr (CHAR *attr, LONGINT attr__len); +export void VT100_CHA (int16 n); +export void VT100_CNL (int16 n); +export void VT100_CPL (int16 n); +export void VT100_CUB (int16 n); +export void VT100_CUD (int16 n); +export void VT100_CUF (int16 n); +export void VT100_CUP (int16 n, int16 m); +export void VT100_CUU (int16 n); +export void VT100_DECTCEMh (void); +export void VT100_DECTCEMl (void); +export void VT100_DSR (int16 n); +export void VT100_ED (int16 n); +export void VT100_EL (int16 n); +static void VT100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len); +static void VT100_EscSeq0 (CHAR *letter, LONGINT letter__len); +static void VT100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len); +static void VT100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len); +export void VT100_HVP (int16 n, int16 m); +export void VT100_IntToStr (int32 int_, CHAR *str, LONGINT str__len); +export void VT100_RCP (void); +static void VT100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end); +export void VT100_SCP (void); +export void VT100_SD (int16 n); +export void VT100_SGR (int16 n); +export void VT100_SGR2 (int16 n, int16 m); +export void VT100_SU (int16 n); +export void VT100_SetAttr (CHAR *attr, LONGINT attr__len); -static void vt100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end) +static void VT100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end) { CHAR h; while (start < end) { @@ -55,7 +55,7 @@ static void vt100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end) } } -void vt100_IntToStr (int32 int_, CHAR *str, LONGINT str__len) +void VT100_IntToStr (int32 int_, CHAR *str, LONGINT str__len) { CHAR b[21]; int16 s, e; @@ -79,55 +79,55 @@ void vt100_IntToStr (int32 int_, CHAR *str, LONGINT str__len) e += 1; } while (!(int_ == 0)); b[__X(e, 21)] = 0x00; - vt100_Reverse0((void*)b, 21, s, e - 1); + VT100_Reverse0((void*)b, 21, s, e - 1); } __COPY(b, str, str__len); } -static void vt100_EscSeq0 (CHAR *letter, LONGINT letter__len) +static void VT100_EscSeq0 (CHAR *letter, LONGINT letter__len) { CHAR cmd[9]; __DUP(letter, letter__len, CHAR); - __COPY(vt100_CSI, cmd, 9); + __COPY(VT100_CSI, cmd, 9); Strings_Append(letter, letter__len, (void*)cmd, 9); Out_String(cmd, 9); __DEL(letter); } -static void vt100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len) +static void VT100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len) { CHAR nstr[2]; CHAR cmd[7]; __DUP(letter, letter__len, CHAR); - vt100_IntToStr(n, (void*)nstr, 2); - __COPY(vt100_CSI, cmd, 7); + VT100_IntToStr(n, (void*)nstr, 2); + __COPY(VT100_CSI, cmd, 7); Strings_Append(nstr, 2, (void*)cmd, 7); Strings_Append(letter, letter__len, (void*)cmd, 7); Out_String(cmd, 7); __DEL(letter); } -static void vt100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len) +static void VT100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len) { CHAR nstr[2]; CHAR cmd[7]; __DUP(letter, letter__len, CHAR); - vt100_IntToStr(n, (void*)nstr, 2); - __COPY(vt100_CSI, cmd, 7); + VT100_IntToStr(n, (void*)nstr, 2); + __COPY(VT100_CSI, cmd, 7); Strings_Append(letter, letter__len, (void*)cmd, 7); Strings_Append(nstr, 2, (void*)cmd, 7); Out_String(cmd, 7); __DEL(letter); } -static void vt100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len) +static void VT100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len) { CHAR nstr[5], mstr[5]; CHAR cmd[12]; __DUP(letter, letter__len, CHAR); - vt100_IntToStr(n, (void*)nstr, 5); - vt100_IntToStr(m, (void*)mstr, 5); - __COPY(vt100_CSI, cmd, 12); + VT100_IntToStr(n, (void*)nstr, 5); + VT100_IntToStr(m, (void*)mstr, 5); + __COPY(VT100_CSI, cmd, 12); Strings_Append(nstr, 5, (void*)cmd, 12); Strings_Append((CHAR*)";", 2, (void*)cmd, 12); Strings_Append(mstr, 5, (void*)cmd, 12); @@ -136,129 +136,129 @@ static void vt100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len) __DEL(letter); } -void vt100_CUU (int16 n) +void VT100_CUU (int16 n) { - vt100_EscSeq(n, (CHAR*)"A", 2); + VT100_EscSeq(n, (CHAR*)"A", 2); } -void vt100_CUD (int16 n) +void VT100_CUD (int16 n) { - vt100_EscSeq(n, (CHAR*)"B", 2); + VT100_EscSeq(n, (CHAR*)"B", 2); } -void vt100_CUF (int16 n) +void VT100_CUF (int16 n) { - vt100_EscSeq(n, (CHAR*)"C", 2); + VT100_EscSeq(n, (CHAR*)"C", 2); } -void vt100_CUB (int16 n) +void VT100_CUB (int16 n) { - vt100_EscSeq(n, (CHAR*)"D", 2); + VT100_EscSeq(n, (CHAR*)"D", 2); } -void vt100_CNL (int16 n) +void VT100_CNL (int16 n) { - vt100_EscSeq(n, (CHAR*)"E", 2); + VT100_EscSeq(n, (CHAR*)"E", 2); } -void vt100_CPL (int16 n) +void VT100_CPL (int16 n) { - vt100_EscSeq(n, (CHAR*)"F", 2); + VT100_EscSeq(n, (CHAR*)"F", 2); } -void vt100_CHA (int16 n) +void VT100_CHA (int16 n) { - vt100_EscSeq(n, (CHAR*)"G", 2); + VT100_EscSeq(n, (CHAR*)"G", 2); } -void vt100_CUP (int16 n, int16 m) +void VT100_CUP (int16 n, int16 m) { - vt100_EscSeq2(n, m, (CHAR*)"H", 2); + VT100_EscSeq2(n, m, (CHAR*)"H", 2); } -void vt100_ED (int16 n) +void VT100_ED (int16 n) { - vt100_EscSeq(n, (CHAR*)"J", 2); + VT100_EscSeq(n, (CHAR*)"J", 2); } -void vt100_EL (int16 n) +void VT100_EL (int16 n) { - vt100_EscSeq(n, (CHAR*)"K", 2); + VT100_EscSeq(n, (CHAR*)"K", 2); } -void vt100_SU (int16 n) +void VT100_SU (int16 n) { - vt100_EscSeq(n, (CHAR*)"S", 2); + VT100_EscSeq(n, (CHAR*)"S", 2); } -void vt100_SD (int16 n) +void VT100_SD (int16 n) { - vt100_EscSeq(n, (CHAR*)"T", 2); + VT100_EscSeq(n, (CHAR*)"T", 2); } -void vt100_HVP (int16 n, int16 m) +void VT100_HVP (int16 n, int16 m) { - vt100_EscSeq2(n, m, (CHAR*)"f", 2); + VT100_EscSeq2(n, m, (CHAR*)"f", 2); } -void vt100_SGR (int16 n) +void VT100_SGR (int16 n) { - vt100_EscSeq(n, (CHAR*)"m", 2); + VT100_EscSeq(n, (CHAR*)"m", 2); } -void vt100_SGR2 (int16 n, int16 m) +void VT100_SGR2 (int16 n, int16 m) { - vt100_EscSeq2(n, m, (CHAR*)"m", 2); + VT100_EscSeq2(n, m, (CHAR*)"m", 2); } -void vt100_DSR (int16 n) +void VT100_DSR (int16 n) { - vt100_EscSeq(6, (CHAR*)"n", 2); + VT100_EscSeq(6, (CHAR*)"n", 2); } -void vt100_SCP (void) +void VT100_SCP (void) { - vt100_EscSeq0((CHAR*)"s", 2); + VT100_EscSeq0((CHAR*)"s", 2); } -void vt100_RCP (void) +void VT100_RCP (void) { - vt100_EscSeq0((CHAR*)"u", 2); + VT100_EscSeq0((CHAR*)"u", 2); } -void vt100_DECTCEMl (void) +void VT100_DECTCEMl (void) { - vt100_EscSeq0((CHAR*)"\?25l", 5); + VT100_EscSeq0((CHAR*)"\?25l", 5); } -void vt100_DECTCEMh (void) +void VT100_DECTCEMh (void) { - vt100_EscSeq0((CHAR*)"\?25h", 5); + VT100_EscSeq0((CHAR*)"\?25h", 5); } -void vt100_SetAttr (CHAR *attr, LONGINT attr__len) +void VT100_SetAttr (CHAR *attr, LONGINT attr__len) { CHAR tmpstr[16]; __DUP(attr, attr__len, CHAR); - __COPY(vt100_CSI, tmpstr, 16); + __COPY(VT100_CSI, tmpstr, 16); Strings_Append(attr, attr__len, (void*)tmpstr, 16); Out_String(tmpstr, 16); __DEL(attr); } -export void *vt100__init(void) +export void *VT100__init(void) { __DEFMOD; __MODULE_IMPORT(Out); __MODULE_IMPORT(Strings); - __REGMOD("vt100", 0); - __REGCMD("DECTCEMh", vt100_DECTCEMh); - __REGCMD("DECTCEMl", vt100_DECTCEMl); - __REGCMD("RCP", vt100_RCP); - __REGCMD("SCP", vt100_SCP); + __REGMOD("VT100", 0); + __REGCMD("DECTCEMh", VT100_DECTCEMh); + __REGCMD("DECTCEMl", VT100_DECTCEMl); + __REGCMD("RCP", VT100_RCP); + __REGCMD("SCP", VT100_SCP); /* BEGIN */ - __COPY("\033", vt100_CSI, 5); - Strings_Append((CHAR*)"[", 2, (void*)vt100_CSI, 5); + __COPY("\033", VT100_CSI, 5); + Strings_Append((CHAR*)"[", 2, (void*)VT100_CSI, 5); __ENDMOD; } diff --git a/bootstrap/unix-88/vt100.h b/bootstrap/unix-88/vt100.h index 03038059..64913ea9 100644 --- a/bootstrap/unix-88/vt100.h +++ b/bootstrap/unix-88/vt100.h @@ -1,37 +1,37 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#ifndef vt100__h -#define vt100__h +#ifndef VT100__h +#define VT100__h #include "SYSTEM.h" -import CHAR vt100_CSI[5]; +import CHAR VT100_CSI[5]; -import void vt100_CHA (int16 n); -import void vt100_CNL (int16 n); -import void vt100_CPL (int16 n); -import void vt100_CUB (int16 n); -import void vt100_CUD (int16 n); -import void vt100_CUF (int16 n); -import void vt100_CUP (int16 n, int16 m); -import void vt100_CUU (int16 n); -import void vt100_DECTCEMh (void); -import void vt100_DECTCEMl (void); -import void vt100_DSR (int16 n); -import void vt100_ED (int16 n); -import void vt100_EL (int16 n); -import void vt100_HVP (int16 n, int16 m); -import void vt100_IntToStr (int32 int_, CHAR *str, LONGINT str__len); -import void vt100_RCP (void); -import void vt100_SCP (void); -import void vt100_SD (int16 n); -import void vt100_SGR (int16 n); -import void vt100_SGR2 (int16 n, int16 m); -import void vt100_SU (int16 n); -import void vt100_SetAttr (CHAR *attr, LONGINT attr__len); -import void *vt100__init(void); +import void VT100_CHA (int16 n); +import void VT100_CNL (int16 n); +import void VT100_CPL (int16 n); +import void VT100_CUB (int16 n); +import void VT100_CUD (int16 n); +import void VT100_CUF (int16 n); +import void VT100_CUP (int16 n, int16 m); +import void VT100_CUU (int16 n); +import void VT100_DECTCEMh (void); +import void VT100_DECTCEMl (void); +import void VT100_DSR (int16 n); +import void VT100_ED (int16 n); +import void VT100_EL (int16 n); +import void VT100_HVP (int16 n, int16 m); +import void VT100_IntToStr (int32 int_, CHAR *str, LONGINT str__len); +import void VT100_RCP (void); +import void VT100_SCP (void); +import void VT100_SD (int16 n); +import void VT100_SGR (int16 n); +import void VT100_SGR2 (int16 n, int16 m); +import void VT100_SU (int16 n); +import void VT100_SetAttr (CHAR *attr, LONGINT attr__len); +import void *VT100__init(void); -#endif // vt100 +#endif // VT100 diff --git a/bootstrap/windows-48/Compiler.c b/bootstrap/windows-48/Compiler.c index 5ec069b8..82f1ab48 100644 --- a/bootstrap/windows-48/Compiler.c +++ b/bootstrap/windows-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 @@ -16,8 +16,8 @@ #include "OPV.h" #include "Platform.h" #include "Strings.h" +#include "VT100.h" #include "extTools.h" -#include "vt100.h" static CHAR Compiler_mname[256]; @@ -47,20 +47,20 @@ void Compiler_Module (BOOLEAN *done) if ((__IN(10, OPM_Options, 32) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { OPM_DeleteNewSym(); if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"32m", 4); + VT100_SetAttr((CHAR*)"32m", 4); } OPM_LogWStr((CHAR*)" Main program.", 16); if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"0m", 3); + VT100_SetAttr((CHAR*)"0m", 3); } } else { if (new) { if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"32m", 4); + VT100_SetAttr((CHAR*)"32m", 4); } OPM_LogWStr((CHAR*)" New symbol file.", 19); if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"0m", 3); + VT100_SetAttr((CHAR*)"0m", 3); } OPM_RegisterNewSym(); } else if (ext) { @@ -175,8 +175,8 @@ export int main(int argc, char **argv) __MODULE_IMPORT(OPV); __MODULE_IMPORT(Platform); __MODULE_IMPORT(Strings); + __MODULE_IMPORT(VT100); __MODULE_IMPORT(extTools); - __MODULE_IMPORT(vt100); __REGMAIN("Compiler", 0); __REGCMD("Translate", Compiler_Translate); /* BEGIN */ diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index 0bef890f..b9310392 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index 286f28c0..c760742c 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 9b51335b..03f1e2aa 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index 3ca0b501..b5337e4a 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index cb386d17..948db354 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index c6dbfb3e..7712f182 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index e5227fba..5cdcbe9c 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index 77ec53de..e6fcdbbe 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index aab1b7fe..aa7126c9 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index eb00fcda..b63ca81f 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 84393696..d2a4419b 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index d6a60b2e..4da49877 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 76cc2b7c..d202f2cd 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -12,8 +12,8 @@ #include "Platform.h" #include "Strings.h" #include "Texts.h" +#include "VT100.h" #include "errors.h" -#include "vt100.h" typedef CHAR OPM_FileName[32]; @@ -325,7 +325,7 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWLn(); OPM_LogWStr((CHAR*)" Miscellaneous", 16); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -f Disable vt100 control characters in status output.", 60); + OPM_LogWStr((CHAR*)" -f Disable VT100 control characters in status output.", 60); OPM_LogWLn(); OPM_LogWStr((CHAR*)" -V Display compiler debugging messages.", 46); OPM_LogWLn(); @@ -555,20 +555,20 @@ static void OPM_LogErrMsg (int16 n) CHAR buf[1024]; if (n >= 0) { if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"31m", 4); + VT100_SetAttr((CHAR*)"31m", 4); } OPM_LogWStr((CHAR*)" err ", 7); if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"0m", 3); + VT100_SetAttr((CHAR*)"0m", 3); } } else { if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"35m", 4); + VT100_SetAttr((CHAR*)"35m", 4); } OPM_LogWStr((CHAR*)" warning ", 11); n = -n; if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"0m", 3); + VT100_SetAttr((CHAR*)"0m", 3); } } OPM_LogWNum(n, 1); @@ -641,11 +641,11 @@ static void OPM_ShowLine (int64 pos) i -= 1; } if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"32m", 4); + VT100_SetAttr((CHAR*)"32m", 4); } OPM_LogW('^'); if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"0m", 3); + VT100_SetAttr((CHAR*)"0m", 3); } Files_Close(f); } @@ -1079,8 +1079,8 @@ export void *OPM__init(void) __MODULE_IMPORT(Platform); __MODULE_IMPORT(Strings); __MODULE_IMPORT(Texts); + __MODULE_IMPORT(VT100); __MODULE_IMPORT(errors); - __MODULE_IMPORT(vt100); __REGMOD("OPM", EnumPtrs); __REGCMD("CloseFiles", OPM_CloseFiles); __REGCMD("CloseOldSym", OPM_CloseOldSym); diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index b7b19fb7..b088cc93 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index e3a26a86..63fb92b5 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index 1f2ff59f..57f41cf8 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index 72800d6b..e7cd3549 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index 595b3668..0a75e9c7 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index bc22f7e2..6f466b3e 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index d40fcd25..d8da229b 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index 19522c13..fd02ab90 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index fa176ddf..48195728 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Out.c b/bootstrap/windows-48/Out.c index 146364f1..31b8cd52 100644 --- a/bootstrap/windows-48/Out.c +++ b/bootstrap/windows-48/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -315,5 +315,6 @@ export void *Out__init(void) __REGCMD("Ln", Out_Ln); __REGCMD("Open", Out_Open); /* BEGIN */ + Out_in = 0; __ENDMOD; } diff --git a/bootstrap/windows-48/Out.h b/bootstrap/windows-48/Out.h index 418e17e2..f91ee6a4 100644 --- a/bootstrap/windows-48/Out.h +++ b/bootstrap/windows-48/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 10094e2d..6bc9bf9f 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index 76bb3755..79119240 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index ece1bf1d..6135ec40 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index 523e9f9e..86321454 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index c86ccc0e..92ce5fe0 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index c12329ab..76b31eb9 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index 672171ee..b5634f26 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index 802df5a7..7709374b 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/errors.c b/bootstrap/windows-48/errors.c index 44990c71..70424462 100644 --- a/bootstrap/windows-48/errors.c +++ b/bootstrap/windows-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/errors.h b/bootstrap/windows-48/errors.h index e0bb109d..80c4a045 100644 --- a/bootstrap/windows-48/errors.h +++ b/bootstrap/windows-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index c83fd7dd..a6e5fe94 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -102,6 +102,7 @@ void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN stati Strings_Append((CHAR*)"", 1, (void*)cmd, 1023); Strings_Append((CHAR*)"/lib\"", 6, (void*)cmd, 1023); Strings_Append((CHAR*)" -l voc", 8, (void*)cmd, 1023); + Strings_Append((CHAR*)"-O", 3, (void*)cmd, 1023); Strings_Append(OPM_Model, 10, (void*)cmd, 1023); extTools_execute((CHAR*)"Assemble and link: ", 20, cmd, 1023); __DEL(additionalopts); diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index 21016d9e..d945916e 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/vt100.c b/bootstrap/windows-48/vt100.c index afa2b377..7c1212f5 100644 --- a/bootstrap/windows-48/vt100.c +++ b/bootstrap/windows-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -10,40 +10,40 @@ #include "Strings.h" -export CHAR vt100_CSI[5]; -static CHAR vt100_tmpstr[32]; +export CHAR VT100_CSI[5]; +static CHAR VT100_tmpstr[32]; -export void vt100_CHA (int16 n); -export void vt100_CNL (int16 n); -export void vt100_CPL (int16 n); -export void vt100_CUB (int16 n); -export void vt100_CUD (int16 n); -export void vt100_CUF (int16 n); -export void vt100_CUP (int16 n, int16 m); -export void vt100_CUU (int16 n); -export void vt100_DECTCEMh (void); -export void vt100_DECTCEMl (void); -export void vt100_DSR (int16 n); -export void vt100_ED (int16 n); -export void vt100_EL (int16 n); -static void vt100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len); -static void vt100_EscSeq0 (CHAR *letter, LONGINT letter__len); -static void vt100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len); -static void vt100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len); -export void vt100_HVP (int16 n, int16 m); -export void vt100_IntToStr (int32 int_, CHAR *str, LONGINT str__len); -export void vt100_RCP (void); -static void vt100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end); -export void vt100_SCP (void); -export void vt100_SD (int16 n); -export void vt100_SGR (int16 n); -export void vt100_SGR2 (int16 n, int16 m); -export void vt100_SU (int16 n); -export void vt100_SetAttr (CHAR *attr, LONGINT attr__len); +export void VT100_CHA (int16 n); +export void VT100_CNL (int16 n); +export void VT100_CPL (int16 n); +export void VT100_CUB (int16 n); +export void VT100_CUD (int16 n); +export void VT100_CUF (int16 n); +export void VT100_CUP (int16 n, int16 m); +export void VT100_CUU (int16 n); +export void VT100_DECTCEMh (void); +export void VT100_DECTCEMl (void); +export void VT100_DSR (int16 n); +export void VT100_ED (int16 n); +export void VT100_EL (int16 n); +static void VT100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len); +static void VT100_EscSeq0 (CHAR *letter, LONGINT letter__len); +static void VT100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len); +static void VT100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len); +export void VT100_HVP (int16 n, int16 m); +export void VT100_IntToStr (int32 int_, CHAR *str, LONGINT str__len); +export void VT100_RCP (void); +static void VT100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end); +export void VT100_SCP (void); +export void VT100_SD (int16 n); +export void VT100_SGR (int16 n); +export void VT100_SGR2 (int16 n, int16 m); +export void VT100_SU (int16 n); +export void VT100_SetAttr (CHAR *attr, LONGINT attr__len); -static void vt100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end) +static void VT100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end) { CHAR h; while (start < end) { @@ -55,7 +55,7 @@ static void vt100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end) } } -void vt100_IntToStr (int32 int_, CHAR *str, LONGINT str__len) +void VT100_IntToStr (int32 int_, CHAR *str, LONGINT str__len) { CHAR b[21]; int16 s, e; @@ -79,55 +79,55 @@ void vt100_IntToStr (int32 int_, CHAR *str, LONGINT str__len) e += 1; } while (!(int_ == 0)); b[__X(e, 21)] = 0x00; - vt100_Reverse0((void*)b, 21, s, e - 1); + VT100_Reverse0((void*)b, 21, s, e - 1); } __COPY(b, str, str__len); } -static void vt100_EscSeq0 (CHAR *letter, LONGINT letter__len) +static void VT100_EscSeq0 (CHAR *letter, LONGINT letter__len) { CHAR cmd[9]; __DUP(letter, letter__len, CHAR); - __COPY(vt100_CSI, cmd, 9); + __COPY(VT100_CSI, cmd, 9); Strings_Append(letter, letter__len, (void*)cmd, 9); Out_String(cmd, 9); __DEL(letter); } -static void vt100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len) +static void VT100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len) { CHAR nstr[2]; CHAR cmd[7]; __DUP(letter, letter__len, CHAR); - vt100_IntToStr(n, (void*)nstr, 2); - __COPY(vt100_CSI, cmd, 7); + VT100_IntToStr(n, (void*)nstr, 2); + __COPY(VT100_CSI, cmd, 7); Strings_Append(nstr, 2, (void*)cmd, 7); Strings_Append(letter, letter__len, (void*)cmd, 7); Out_String(cmd, 7); __DEL(letter); } -static void vt100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len) +static void VT100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len) { CHAR nstr[2]; CHAR cmd[7]; __DUP(letter, letter__len, CHAR); - vt100_IntToStr(n, (void*)nstr, 2); - __COPY(vt100_CSI, cmd, 7); + VT100_IntToStr(n, (void*)nstr, 2); + __COPY(VT100_CSI, cmd, 7); Strings_Append(letter, letter__len, (void*)cmd, 7); Strings_Append(nstr, 2, (void*)cmd, 7); Out_String(cmd, 7); __DEL(letter); } -static void vt100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len) +static void VT100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len) { CHAR nstr[5], mstr[5]; CHAR cmd[12]; __DUP(letter, letter__len, CHAR); - vt100_IntToStr(n, (void*)nstr, 5); - vt100_IntToStr(m, (void*)mstr, 5); - __COPY(vt100_CSI, cmd, 12); + VT100_IntToStr(n, (void*)nstr, 5); + VT100_IntToStr(m, (void*)mstr, 5); + __COPY(VT100_CSI, cmd, 12); Strings_Append(nstr, 5, (void*)cmd, 12); Strings_Append((CHAR*)";", 2, (void*)cmd, 12); Strings_Append(mstr, 5, (void*)cmd, 12); @@ -136,129 +136,129 @@ static void vt100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len) __DEL(letter); } -void vt100_CUU (int16 n) +void VT100_CUU (int16 n) { - vt100_EscSeq(n, (CHAR*)"A", 2); + VT100_EscSeq(n, (CHAR*)"A", 2); } -void vt100_CUD (int16 n) +void VT100_CUD (int16 n) { - vt100_EscSeq(n, (CHAR*)"B", 2); + VT100_EscSeq(n, (CHAR*)"B", 2); } -void vt100_CUF (int16 n) +void VT100_CUF (int16 n) { - vt100_EscSeq(n, (CHAR*)"C", 2); + VT100_EscSeq(n, (CHAR*)"C", 2); } -void vt100_CUB (int16 n) +void VT100_CUB (int16 n) { - vt100_EscSeq(n, (CHAR*)"D", 2); + VT100_EscSeq(n, (CHAR*)"D", 2); } -void vt100_CNL (int16 n) +void VT100_CNL (int16 n) { - vt100_EscSeq(n, (CHAR*)"E", 2); + VT100_EscSeq(n, (CHAR*)"E", 2); } -void vt100_CPL (int16 n) +void VT100_CPL (int16 n) { - vt100_EscSeq(n, (CHAR*)"F", 2); + VT100_EscSeq(n, (CHAR*)"F", 2); } -void vt100_CHA (int16 n) +void VT100_CHA (int16 n) { - vt100_EscSeq(n, (CHAR*)"G", 2); + VT100_EscSeq(n, (CHAR*)"G", 2); } -void vt100_CUP (int16 n, int16 m) +void VT100_CUP (int16 n, int16 m) { - vt100_EscSeq2(n, m, (CHAR*)"H", 2); + VT100_EscSeq2(n, m, (CHAR*)"H", 2); } -void vt100_ED (int16 n) +void VT100_ED (int16 n) { - vt100_EscSeq(n, (CHAR*)"J", 2); + VT100_EscSeq(n, (CHAR*)"J", 2); } -void vt100_EL (int16 n) +void VT100_EL (int16 n) { - vt100_EscSeq(n, (CHAR*)"K", 2); + VT100_EscSeq(n, (CHAR*)"K", 2); } -void vt100_SU (int16 n) +void VT100_SU (int16 n) { - vt100_EscSeq(n, (CHAR*)"S", 2); + VT100_EscSeq(n, (CHAR*)"S", 2); } -void vt100_SD (int16 n) +void VT100_SD (int16 n) { - vt100_EscSeq(n, (CHAR*)"T", 2); + VT100_EscSeq(n, (CHAR*)"T", 2); } -void vt100_HVP (int16 n, int16 m) +void VT100_HVP (int16 n, int16 m) { - vt100_EscSeq2(n, m, (CHAR*)"f", 2); + VT100_EscSeq2(n, m, (CHAR*)"f", 2); } -void vt100_SGR (int16 n) +void VT100_SGR (int16 n) { - vt100_EscSeq(n, (CHAR*)"m", 2); + VT100_EscSeq(n, (CHAR*)"m", 2); } -void vt100_SGR2 (int16 n, int16 m) +void VT100_SGR2 (int16 n, int16 m) { - vt100_EscSeq2(n, m, (CHAR*)"m", 2); + VT100_EscSeq2(n, m, (CHAR*)"m", 2); } -void vt100_DSR (int16 n) +void VT100_DSR (int16 n) { - vt100_EscSeq(6, (CHAR*)"n", 2); + VT100_EscSeq(6, (CHAR*)"n", 2); } -void vt100_SCP (void) +void VT100_SCP (void) { - vt100_EscSeq0((CHAR*)"s", 2); + VT100_EscSeq0((CHAR*)"s", 2); } -void vt100_RCP (void) +void VT100_RCP (void) { - vt100_EscSeq0((CHAR*)"u", 2); + VT100_EscSeq0((CHAR*)"u", 2); } -void vt100_DECTCEMl (void) +void VT100_DECTCEMl (void) { - vt100_EscSeq0((CHAR*)"\?25l", 5); + VT100_EscSeq0((CHAR*)"\?25l", 5); } -void vt100_DECTCEMh (void) +void VT100_DECTCEMh (void) { - vt100_EscSeq0((CHAR*)"\?25h", 5); + VT100_EscSeq0((CHAR*)"\?25h", 5); } -void vt100_SetAttr (CHAR *attr, LONGINT attr__len) +void VT100_SetAttr (CHAR *attr, LONGINT attr__len) { CHAR tmpstr[16]; __DUP(attr, attr__len, CHAR); - __COPY(vt100_CSI, tmpstr, 16); + __COPY(VT100_CSI, tmpstr, 16); Strings_Append(attr, attr__len, (void*)tmpstr, 16); Out_String(tmpstr, 16); __DEL(attr); } -export void *vt100__init(void) +export void *VT100__init(void) { __DEFMOD; __MODULE_IMPORT(Out); __MODULE_IMPORT(Strings); - __REGMOD("vt100", 0); - __REGCMD("DECTCEMh", vt100_DECTCEMh); - __REGCMD("DECTCEMl", vt100_DECTCEMl); - __REGCMD("RCP", vt100_RCP); - __REGCMD("SCP", vt100_SCP); + __REGMOD("VT100", 0); + __REGCMD("DECTCEMh", VT100_DECTCEMh); + __REGCMD("DECTCEMl", VT100_DECTCEMl); + __REGCMD("RCP", VT100_RCP); + __REGCMD("SCP", VT100_SCP); /* BEGIN */ - __COPY("\033", vt100_CSI, 5); - Strings_Append((CHAR*)"[", 2, (void*)vt100_CSI, 5); + __COPY("\033", VT100_CSI, 5); + Strings_Append((CHAR*)"[", 2, (void*)VT100_CSI, 5); __ENDMOD; } diff --git a/bootstrap/windows-48/vt100.h b/bootstrap/windows-48/vt100.h index 03038059..64913ea9 100644 --- a/bootstrap/windows-48/vt100.h +++ b/bootstrap/windows-48/vt100.h @@ -1,37 +1,37 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#ifndef vt100__h -#define vt100__h +#ifndef VT100__h +#define VT100__h #include "SYSTEM.h" -import CHAR vt100_CSI[5]; +import CHAR VT100_CSI[5]; -import void vt100_CHA (int16 n); -import void vt100_CNL (int16 n); -import void vt100_CPL (int16 n); -import void vt100_CUB (int16 n); -import void vt100_CUD (int16 n); -import void vt100_CUF (int16 n); -import void vt100_CUP (int16 n, int16 m); -import void vt100_CUU (int16 n); -import void vt100_DECTCEMh (void); -import void vt100_DECTCEMl (void); -import void vt100_DSR (int16 n); -import void vt100_ED (int16 n); -import void vt100_EL (int16 n); -import void vt100_HVP (int16 n, int16 m); -import void vt100_IntToStr (int32 int_, CHAR *str, LONGINT str__len); -import void vt100_RCP (void); -import void vt100_SCP (void); -import void vt100_SD (int16 n); -import void vt100_SGR (int16 n); -import void vt100_SGR2 (int16 n, int16 m); -import void vt100_SU (int16 n); -import void vt100_SetAttr (CHAR *attr, LONGINT attr__len); -import void *vt100__init(void); +import void VT100_CHA (int16 n); +import void VT100_CNL (int16 n); +import void VT100_CPL (int16 n); +import void VT100_CUB (int16 n); +import void VT100_CUD (int16 n); +import void VT100_CUF (int16 n); +import void VT100_CUP (int16 n, int16 m); +import void VT100_CUU (int16 n); +import void VT100_DECTCEMh (void); +import void VT100_DECTCEMl (void); +import void VT100_DSR (int16 n); +import void VT100_ED (int16 n); +import void VT100_EL (int16 n); +import void VT100_HVP (int16 n, int16 m); +import void VT100_IntToStr (int32 int_, CHAR *str, LONGINT str__len); +import void VT100_RCP (void); +import void VT100_SCP (void); +import void VT100_SD (int16 n); +import void VT100_SGR (int16 n); +import void VT100_SGR2 (int16 n, int16 m); +import void VT100_SU (int16 n); +import void VT100_SetAttr (CHAR *attr, LONGINT attr__len); +import void *VT100__init(void); -#endif // vt100 +#endif // VT100 diff --git a/bootstrap/windows-88/Compiler.c b/bootstrap/windows-88/Compiler.c index 5ec069b8..82f1ab48 100644 --- a/bootstrap/windows-88/Compiler.c +++ b/bootstrap/windows-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 @@ -16,8 +16,8 @@ #include "OPV.h" #include "Platform.h" #include "Strings.h" +#include "VT100.h" #include "extTools.h" -#include "vt100.h" static CHAR Compiler_mname[256]; @@ -47,20 +47,20 @@ void Compiler_Module (BOOLEAN *done) if ((__IN(10, OPM_Options, 32) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { OPM_DeleteNewSym(); if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"32m", 4); + VT100_SetAttr((CHAR*)"32m", 4); } OPM_LogWStr((CHAR*)" Main program.", 16); if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"0m", 3); + VT100_SetAttr((CHAR*)"0m", 3); } } else { if (new) { if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"32m", 4); + VT100_SetAttr((CHAR*)"32m", 4); } OPM_LogWStr((CHAR*)" New symbol file.", 19); if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"0m", 3); + VT100_SetAttr((CHAR*)"0m", 3); } OPM_RegisterNewSym(); } else if (ext) { @@ -175,8 +175,8 @@ export int main(int argc, char **argv) __MODULE_IMPORT(OPV); __MODULE_IMPORT(Platform); __MODULE_IMPORT(Strings); + __MODULE_IMPORT(VT100); __MODULE_IMPORT(extTools); - __MODULE_IMPORT(vt100); __REGMAIN("Compiler", 0); __REGCMD("Translate", Compiler_Translate); /* BEGIN */ diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index 0bef890f..b9310392 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index 286f28c0..c760742c 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 98dcdccb..9986f06f 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index a643f9c2..9b8b7477 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index 1a82d9e8..42134b68 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index abcafa6a..521ccc74 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 5fdce638..2a860e62 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index 77ec53de..e6fcdbbe 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index aab1b7fe..aa7126c9 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index eb00fcda..b63ca81f 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index 84393696..d2a4419b 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index d6a60b2e..4da49877 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index ca25d1e6..686c674e 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -12,8 +12,8 @@ #include "Platform.h" #include "Strings.h" #include "Texts.h" +#include "VT100.h" #include "errors.h" -#include "vt100.h" typedef CHAR OPM_FileName[32]; @@ -325,7 +325,7 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWLn(); OPM_LogWStr((CHAR*)" Miscellaneous", 16); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -f Disable vt100 control characters in status output.", 60); + OPM_LogWStr((CHAR*)" -f Disable VT100 control characters in status output.", 60); OPM_LogWLn(); OPM_LogWStr((CHAR*)" -V Display compiler debugging messages.", 46); OPM_LogWLn(); @@ -555,20 +555,20 @@ static void OPM_LogErrMsg (int16 n) CHAR buf[1024]; if (n >= 0) { if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"31m", 4); + VT100_SetAttr((CHAR*)"31m", 4); } OPM_LogWStr((CHAR*)" err ", 7); if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"0m", 3); + VT100_SetAttr((CHAR*)"0m", 3); } } else { if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"35m", 4); + VT100_SetAttr((CHAR*)"35m", 4); } OPM_LogWStr((CHAR*)" warning ", 11); n = -n; if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"0m", 3); + VT100_SetAttr((CHAR*)"0m", 3); } } OPM_LogWNum(n, 1); @@ -641,11 +641,11 @@ static void OPM_ShowLine (int64 pos) i -= 1; } if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"32m", 4); + VT100_SetAttr((CHAR*)"32m", 4); } OPM_LogW('^'); if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"0m", 3); + VT100_SetAttr((CHAR*)"0m", 3); } Files_Close(f); } @@ -1079,8 +1079,8 @@ export void *OPM__init(void) __MODULE_IMPORT(Platform); __MODULE_IMPORT(Strings); __MODULE_IMPORT(Texts); + __MODULE_IMPORT(VT100); __MODULE_IMPORT(errors); - __MODULE_IMPORT(vt100); __REGMOD("OPM", EnumPtrs); __REGCMD("CloseFiles", OPM_CloseFiles); __REGCMD("CloseOldSym", OPM_CloseOldSym); diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index b7b19fb7..b088cc93 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index 64a861ac..29f9ae66 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index 1f2ff59f..57f41cf8 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index 72800d6b..e7cd3549 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index 595b3668..0a75e9c7 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index 7be03e0d..85221274 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index d40fcd25..d8da229b 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 90adf5f7..7e6d40e5 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index fa176ddf..48195728 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Out.c b/bootstrap/windows-88/Out.c index 146364f1..31b8cd52 100644 --- a/bootstrap/windows-88/Out.c +++ b/bootstrap/windows-88/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -315,5 +315,6 @@ export void *Out__init(void) __REGCMD("Ln", Out_Ln); __REGCMD("Open", Out_Open); /* BEGIN */ + Out_in = 0; __ENDMOD; } diff --git a/bootstrap/windows-88/Out.h b/bootstrap/windows-88/Out.h index 418e17e2..f91ee6a4 100644 --- a/bootstrap/windows-88/Out.h +++ b/bootstrap/windows-88/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 4b4bd5d9..eed18d02 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index bc2df7c8..aacc5cad 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index ece1bf1d..6135ec40 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index 523e9f9e..86321454 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index c86ccc0e..92ce5fe0 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index c12329ab..76b31eb9 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index 6033652e..09708beb 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index 54f5d5ee..14846883 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/errors.c b/bootstrap/windows-88/errors.c index 44990c71..70424462 100644 --- a/bootstrap/windows-88/errors.c +++ b/bootstrap/windows-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/errors.h b/bootstrap/windows-88/errors.h index e0bb109d..80c4a045 100644 --- a/bootstrap/windows-88/errors.h +++ b/bootstrap/windows-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index c83fd7dd..a6e5fe94 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -102,6 +102,7 @@ void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN stati Strings_Append((CHAR*)"", 1, (void*)cmd, 1023); Strings_Append((CHAR*)"/lib\"", 6, (void*)cmd, 1023); Strings_Append((CHAR*)" -l voc", 8, (void*)cmd, 1023); + Strings_Append((CHAR*)"-O", 3, (void*)cmd, 1023); Strings_Append(OPM_Model, 10, (void*)cmd, 1023); extTools_execute((CHAR*)"Assemble and link: ", 20, cmd, 1023); __DEL(additionalopts); diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index 21016d9e..d945916e 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/vt100.c b/bootstrap/windows-88/vt100.c index afa2b377..7c1212f5 100644 --- a/bootstrap/windows-88/vt100.c +++ b/bootstrap/windows-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -10,40 +10,40 @@ #include "Strings.h" -export CHAR vt100_CSI[5]; -static CHAR vt100_tmpstr[32]; +export CHAR VT100_CSI[5]; +static CHAR VT100_tmpstr[32]; -export void vt100_CHA (int16 n); -export void vt100_CNL (int16 n); -export void vt100_CPL (int16 n); -export void vt100_CUB (int16 n); -export void vt100_CUD (int16 n); -export void vt100_CUF (int16 n); -export void vt100_CUP (int16 n, int16 m); -export void vt100_CUU (int16 n); -export void vt100_DECTCEMh (void); -export void vt100_DECTCEMl (void); -export void vt100_DSR (int16 n); -export void vt100_ED (int16 n); -export void vt100_EL (int16 n); -static void vt100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len); -static void vt100_EscSeq0 (CHAR *letter, LONGINT letter__len); -static void vt100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len); -static void vt100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len); -export void vt100_HVP (int16 n, int16 m); -export void vt100_IntToStr (int32 int_, CHAR *str, LONGINT str__len); -export void vt100_RCP (void); -static void vt100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end); -export void vt100_SCP (void); -export void vt100_SD (int16 n); -export void vt100_SGR (int16 n); -export void vt100_SGR2 (int16 n, int16 m); -export void vt100_SU (int16 n); -export void vt100_SetAttr (CHAR *attr, LONGINT attr__len); +export void VT100_CHA (int16 n); +export void VT100_CNL (int16 n); +export void VT100_CPL (int16 n); +export void VT100_CUB (int16 n); +export void VT100_CUD (int16 n); +export void VT100_CUF (int16 n); +export void VT100_CUP (int16 n, int16 m); +export void VT100_CUU (int16 n); +export void VT100_DECTCEMh (void); +export void VT100_DECTCEMl (void); +export void VT100_DSR (int16 n); +export void VT100_ED (int16 n); +export void VT100_EL (int16 n); +static void VT100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len); +static void VT100_EscSeq0 (CHAR *letter, LONGINT letter__len); +static void VT100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len); +static void VT100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len); +export void VT100_HVP (int16 n, int16 m); +export void VT100_IntToStr (int32 int_, CHAR *str, LONGINT str__len); +export void VT100_RCP (void); +static void VT100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end); +export void VT100_SCP (void); +export void VT100_SD (int16 n); +export void VT100_SGR (int16 n); +export void VT100_SGR2 (int16 n, int16 m); +export void VT100_SU (int16 n); +export void VT100_SetAttr (CHAR *attr, LONGINT attr__len); -static void vt100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end) +static void VT100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end) { CHAR h; while (start < end) { @@ -55,7 +55,7 @@ static void vt100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end) } } -void vt100_IntToStr (int32 int_, CHAR *str, LONGINT str__len) +void VT100_IntToStr (int32 int_, CHAR *str, LONGINT str__len) { CHAR b[21]; int16 s, e; @@ -79,55 +79,55 @@ void vt100_IntToStr (int32 int_, CHAR *str, LONGINT str__len) e += 1; } while (!(int_ == 0)); b[__X(e, 21)] = 0x00; - vt100_Reverse0((void*)b, 21, s, e - 1); + VT100_Reverse0((void*)b, 21, s, e - 1); } __COPY(b, str, str__len); } -static void vt100_EscSeq0 (CHAR *letter, LONGINT letter__len) +static void VT100_EscSeq0 (CHAR *letter, LONGINT letter__len) { CHAR cmd[9]; __DUP(letter, letter__len, CHAR); - __COPY(vt100_CSI, cmd, 9); + __COPY(VT100_CSI, cmd, 9); Strings_Append(letter, letter__len, (void*)cmd, 9); Out_String(cmd, 9); __DEL(letter); } -static void vt100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len) +static void VT100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len) { CHAR nstr[2]; CHAR cmd[7]; __DUP(letter, letter__len, CHAR); - vt100_IntToStr(n, (void*)nstr, 2); - __COPY(vt100_CSI, cmd, 7); + VT100_IntToStr(n, (void*)nstr, 2); + __COPY(VT100_CSI, cmd, 7); Strings_Append(nstr, 2, (void*)cmd, 7); Strings_Append(letter, letter__len, (void*)cmd, 7); Out_String(cmd, 7); __DEL(letter); } -static void vt100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len) +static void VT100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len) { CHAR nstr[2]; CHAR cmd[7]; __DUP(letter, letter__len, CHAR); - vt100_IntToStr(n, (void*)nstr, 2); - __COPY(vt100_CSI, cmd, 7); + VT100_IntToStr(n, (void*)nstr, 2); + __COPY(VT100_CSI, cmd, 7); Strings_Append(letter, letter__len, (void*)cmd, 7); Strings_Append(nstr, 2, (void*)cmd, 7); Out_String(cmd, 7); __DEL(letter); } -static void vt100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len) +static void VT100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len) { CHAR nstr[5], mstr[5]; CHAR cmd[12]; __DUP(letter, letter__len, CHAR); - vt100_IntToStr(n, (void*)nstr, 5); - vt100_IntToStr(m, (void*)mstr, 5); - __COPY(vt100_CSI, cmd, 12); + VT100_IntToStr(n, (void*)nstr, 5); + VT100_IntToStr(m, (void*)mstr, 5); + __COPY(VT100_CSI, cmd, 12); Strings_Append(nstr, 5, (void*)cmd, 12); Strings_Append((CHAR*)";", 2, (void*)cmd, 12); Strings_Append(mstr, 5, (void*)cmd, 12); @@ -136,129 +136,129 @@ static void vt100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len) __DEL(letter); } -void vt100_CUU (int16 n) +void VT100_CUU (int16 n) { - vt100_EscSeq(n, (CHAR*)"A", 2); + VT100_EscSeq(n, (CHAR*)"A", 2); } -void vt100_CUD (int16 n) +void VT100_CUD (int16 n) { - vt100_EscSeq(n, (CHAR*)"B", 2); + VT100_EscSeq(n, (CHAR*)"B", 2); } -void vt100_CUF (int16 n) +void VT100_CUF (int16 n) { - vt100_EscSeq(n, (CHAR*)"C", 2); + VT100_EscSeq(n, (CHAR*)"C", 2); } -void vt100_CUB (int16 n) +void VT100_CUB (int16 n) { - vt100_EscSeq(n, (CHAR*)"D", 2); + VT100_EscSeq(n, (CHAR*)"D", 2); } -void vt100_CNL (int16 n) +void VT100_CNL (int16 n) { - vt100_EscSeq(n, (CHAR*)"E", 2); + VT100_EscSeq(n, (CHAR*)"E", 2); } -void vt100_CPL (int16 n) +void VT100_CPL (int16 n) { - vt100_EscSeq(n, (CHAR*)"F", 2); + VT100_EscSeq(n, (CHAR*)"F", 2); } -void vt100_CHA (int16 n) +void VT100_CHA (int16 n) { - vt100_EscSeq(n, (CHAR*)"G", 2); + VT100_EscSeq(n, (CHAR*)"G", 2); } -void vt100_CUP (int16 n, int16 m) +void VT100_CUP (int16 n, int16 m) { - vt100_EscSeq2(n, m, (CHAR*)"H", 2); + VT100_EscSeq2(n, m, (CHAR*)"H", 2); } -void vt100_ED (int16 n) +void VT100_ED (int16 n) { - vt100_EscSeq(n, (CHAR*)"J", 2); + VT100_EscSeq(n, (CHAR*)"J", 2); } -void vt100_EL (int16 n) +void VT100_EL (int16 n) { - vt100_EscSeq(n, (CHAR*)"K", 2); + VT100_EscSeq(n, (CHAR*)"K", 2); } -void vt100_SU (int16 n) +void VT100_SU (int16 n) { - vt100_EscSeq(n, (CHAR*)"S", 2); + VT100_EscSeq(n, (CHAR*)"S", 2); } -void vt100_SD (int16 n) +void VT100_SD (int16 n) { - vt100_EscSeq(n, (CHAR*)"T", 2); + VT100_EscSeq(n, (CHAR*)"T", 2); } -void vt100_HVP (int16 n, int16 m) +void VT100_HVP (int16 n, int16 m) { - vt100_EscSeq2(n, m, (CHAR*)"f", 2); + VT100_EscSeq2(n, m, (CHAR*)"f", 2); } -void vt100_SGR (int16 n) +void VT100_SGR (int16 n) { - vt100_EscSeq(n, (CHAR*)"m", 2); + VT100_EscSeq(n, (CHAR*)"m", 2); } -void vt100_SGR2 (int16 n, int16 m) +void VT100_SGR2 (int16 n, int16 m) { - vt100_EscSeq2(n, m, (CHAR*)"m", 2); + VT100_EscSeq2(n, m, (CHAR*)"m", 2); } -void vt100_DSR (int16 n) +void VT100_DSR (int16 n) { - vt100_EscSeq(6, (CHAR*)"n", 2); + VT100_EscSeq(6, (CHAR*)"n", 2); } -void vt100_SCP (void) +void VT100_SCP (void) { - vt100_EscSeq0((CHAR*)"s", 2); + VT100_EscSeq0((CHAR*)"s", 2); } -void vt100_RCP (void) +void VT100_RCP (void) { - vt100_EscSeq0((CHAR*)"u", 2); + VT100_EscSeq0((CHAR*)"u", 2); } -void vt100_DECTCEMl (void) +void VT100_DECTCEMl (void) { - vt100_EscSeq0((CHAR*)"\?25l", 5); + VT100_EscSeq0((CHAR*)"\?25l", 5); } -void vt100_DECTCEMh (void) +void VT100_DECTCEMh (void) { - vt100_EscSeq0((CHAR*)"\?25h", 5); + VT100_EscSeq0((CHAR*)"\?25h", 5); } -void vt100_SetAttr (CHAR *attr, LONGINT attr__len) +void VT100_SetAttr (CHAR *attr, LONGINT attr__len) { CHAR tmpstr[16]; __DUP(attr, attr__len, CHAR); - __COPY(vt100_CSI, tmpstr, 16); + __COPY(VT100_CSI, tmpstr, 16); Strings_Append(attr, attr__len, (void*)tmpstr, 16); Out_String(tmpstr, 16); __DEL(attr); } -export void *vt100__init(void) +export void *VT100__init(void) { __DEFMOD; __MODULE_IMPORT(Out); __MODULE_IMPORT(Strings); - __REGMOD("vt100", 0); - __REGCMD("DECTCEMh", vt100_DECTCEMh); - __REGCMD("DECTCEMl", vt100_DECTCEMl); - __REGCMD("RCP", vt100_RCP); - __REGCMD("SCP", vt100_SCP); + __REGMOD("VT100", 0); + __REGCMD("DECTCEMh", VT100_DECTCEMh); + __REGCMD("DECTCEMl", VT100_DECTCEMl); + __REGCMD("RCP", VT100_RCP); + __REGCMD("SCP", VT100_SCP); /* BEGIN */ - __COPY("\033", vt100_CSI, 5); - Strings_Append((CHAR*)"[", 2, (void*)vt100_CSI, 5); + __COPY("\033", VT100_CSI, 5); + Strings_Append((CHAR*)"[", 2, (void*)VT100_CSI, 5); __ENDMOD; } diff --git a/bootstrap/windows-88/vt100.h b/bootstrap/windows-88/vt100.h index 03038059..64913ea9 100644 --- a/bootstrap/windows-88/vt100.h +++ b/bootstrap/windows-88/vt100.h @@ -1,37 +1,37 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#ifndef vt100__h -#define vt100__h +#ifndef VT100__h +#define VT100__h #include "SYSTEM.h" -import CHAR vt100_CSI[5]; +import CHAR VT100_CSI[5]; -import void vt100_CHA (int16 n); -import void vt100_CNL (int16 n); -import void vt100_CPL (int16 n); -import void vt100_CUB (int16 n); -import void vt100_CUD (int16 n); -import void vt100_CUF (int16 n); -import void vt100_CUP (int16 n, int16 m); -import void vt100_CUU (int16 n); -import void vt100_DECTCEMh (void); -import void vt100_DECTCEMl (void); -import void vt100_DSR (int16 n); -import void vt100_ED (int16 n); -import void vt100_EL (int16 n); -import void vt100_HVP (int16 n, int16 m); -import void vt100_IntToStr (int32 int_, CHAR *str, LONGINT str__len); -import void vt100_RCP (void); -import void vt100_SCP (void); -import void vt100_SD (int16 n); -import void vt100_SGR (int16 n); -import void vt100_SGR2 (int16 n, int16 m); -import void vt100_SU (int16 n); -import void vt100_SetAttr (CHAR *attr, LONGINT attr__len); -import void *vt100__init(void); +import void VT100_CHA (int16 n); +import void VT100_CNL (int16 n); +import void VT100_CPL (int16 n); +import void VT100_CUB (int16 n); +import void VT100_CUD (int16 n); +import void VT100_CUF (int16 n); +import void VT100_CUP (int16 n, int16 m); +import void VT100_CUU (int16 n); +import void VT100_DECTCEMh (void); +import void VT100_DECTCEMl (void); +import void VT100_DSR (int16 n); +import void VT100_ED (int16 n); +import void VT100_EL (int16 n); +import void VT100_HVP (int16 n, int16 m); +import void VT100_IntToStr (int32 int_, CHAR *str, LONGINT str__len); +import void VT100_RCP (void); +import void VT100_SCP (void); +import void VT100_SD (int16 n); +import void VT100_SGR (int16 n); +import void VT100_SGR2 (int16 n, int16 m); +import void VT100_SU (int16 n); +import void VT100_SetAttr (CHAR *attr, LONGINT attr__len); +import void *VT100__init(void); -#endif // vt100 +#endif // VT100 diff --git a/makefile b/makefile index b8323eea..499b5bf0 100644 --- a/makefile +++ b/makefile @@ -156,8 +156,8 @@ full: configuration @printf "\n\n--- Compiler build successfull ---\n\n" @make -f src/tools/make/oberon.mk -s browsercmd MODEL=2 @printf "\n\n--- Library build started ---\n\n" - @make -f src/tools/make/oberon.mk -s O2library - @make -f src/tools/make/oberon.mk -s runtime MODEL=C + @make -f src/tools/make/oberon.mk -s library MODEL=2 + @make -f src/tools/make/oberon.mk -s library MODEL=C @printf "\n\n--- Library build successfull ---\n\n" @make -f src/tools/make/oberon.mk -s sourcechanges @make -f src/tools/make/oberon.mk -s install @@ -190,12 +190,11 @@ browsercmd: configuration # library: build all directories under src/library -library: configuration - @make -f src/tools/make/oberon.mk -s O2library - @make -f src/tools/make/oberon.mk -s runtime MODEL=C +O2library: configuration + @make -f src/tools/make/oberon.mk -s library MODEL=2 -runtime: configuration - @make -f src/tools/make/oberon.mk -s runtime MODEL=C +OClibrary: configuration + @make -f src/tools/make/oberon.mk -s library MODEL=C diff --git a/src/compiler/Compiler.Mod b/src/compiler/Compiler.Mod index f21ef95d..d8c688a7 100644 --- a/src/compiler/Compiler.Mod +++ b/src/compiler/Compiler.Mod @@ -4,7 +4,7 @@ MODULE Compiler; (* J. Templ 3.2.95 *) SYSTEM, Heap, Platform, Configuration, OPP, OPB, OPT, OPV, OPC, OPM, - extTools, Strings, vt100; + extTools, Strings, VT100; VAR mname: ARRAY 256 OF CHAR; (* noch *) @@ -25,14 +25,14 @@ MODULE Compiler; (* J. Templ 3.2.95 *) IF OPM.noerr THEN IF (OPM.mainprog IN OPM.Options) & (OPM.modName # "SYSTEM") THEN OPM.DeleteNewSym; - IF ~(OPM.notcoloroutput IN OPM.Options) THEN vt100.SetAttr(vt100.Green) END; + IF ~(OPM.notcoloroutput IN OPM.Options) THEN VT100.SetAttr(VT100.Green) END; OPM.LogWStr(" Main program."); - IF ~(OPM.notcoloroutput IN OPM.Options) THEN vt100.SetAttr(vt100.ResetAll) END; + IF ~(OPM.notcoloroutput IN OPM.Options) THEN VT100.SetAttr(VT100.ResetAll) END; ELSE IF new THEN - IF ~(OPM.notcoloroutput IN OPM.Options) THEN vt100.SetAttr(vt100.Green) END; + IF ~(OPM.notcoloroutput IN OPM.Options) THEN VT100.SetAttr(VT100.Green) END; OPM.LogWStr(" New symbol file."); - IF ~(OPM.notcoloroutput IN OPM.Options) THEN vt100.SetAttr(vt100.ResetAll) END; + IF ~(OPM.notcoloroutput IN OPM.Options) THEN VT100.SetAttr(VT100.ResetAll) END; OPM.RegisterNewSym ELSIF ext THEN OPM.LogWStr(" Extended symbol file."); diff --git a/src/compiler/OPM.Mod b/src/compiler/OPM.Mod index 703ff236..1ecaa7e0 100644 --- a/src/compiler/OPM.Mod +++ b/src/compiler/OPM.Mod @@ -4,7 +4,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) 31.1.2007 jt synchronized with BlackBox version, in particular PromoteIntConstToLInt added *) - IMPORT SYSTEM, Texts, Files, Platform, Out, errors, Configuration, vt100, Strings; + IMPORT SYSTEM, Texts, Files, Platform, Out, errors, Configuration, VT100, Strings; CONST OptionChar* = "-"; @@ -183,7 +183,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) | "c": Options := Options / {dontlink} (* Don't link. *) (* Miscellaneous *) - | "f": Options := Options / {notcoloroutput} (* Disable vt100 control characters in status output. *) + | "f": Options := Options / {notcoloroutput} (* Disable VT100 control characters in status output. *) | "V": Options := Options / {verbose} (* Elementary type size model *) @@ -264,7 +264,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) LogWStr(" -c Don't link."); LogWLn; LogWLn; LogWStr(" Miscellaneous"); LogWLn; - LogWStr(" -f Disable vt100 control characters in status output."); LogWLn; + LogWStr(" -f Disable VT100 control characters in status output."); LogWLn; LogWStr(" -V Display compiler debugging messages."); LogWLn; LogWLn; LogWStr(" Size model for elementary types (default O2)"); LogWLn; @@ -426,13 +426,13 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) buf: ARRAY 1024 OF CHAR; BEGIN IF n >= 0 THEN - IF ~(notcoloroutput IN Options) THEN vt100.SetAttr(vt100.Red) END; + IF ~(notcoloroutput IN Options) THEN VT100.SetAttr(VT100.Red) END; LogWStr(" err "); - IF ~(notcoloroutput IN Options) THEN vt100.SetAttr(vt100.ResetAll) END; + IF ~(notcoloroutput IN Options) THEN VT100.SetAttr(VT100.ResetAll) END; ELSE - IF ~(notcoloroutput IN Options) THEN vt100.SetAttr(vt100.Magenta) END; + IF ~(notcoloroutput IN Options) THEN VT100.SetAttr(VT100.Magenta) END; LogWStr(" warning "); n := -n; - IF ~(notcoloroutput IN Options) THEN vt100.SetAttr(vt100.ResetAll) END; + IF ~(notcoloroutput IN Options) THEN VT100.SetAttr(VT100.ResetAll) END; END ; LogWNum(n, 1); LogWStr(" "); @@ -505,9 +505,9 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) i := SHORT(Longint(pos - ErrorLineStartPos)); WHILE i > 0 DO LogW(" "); DEC(i) END; - IF ~(notcoloroutput IN Options) THEN vt100.SetAttr(vt100.Green) END; + IF ~(notcoloroutput IN Options) THEN VT100.SetAttr(VT100.Green) END; LogW("^"); - IF ~(notcoloroutput IN Options) THEN vt100.SetAttr(vt100.ResetAll) END; + IF ~(notcoloroutput IN Options) THEN VT100.SetAttr(VT100.ResetAll) END; Files.Close(f); END ShowLine; diff --git a/src/compiler/extTools.Mod b/src/compiler/extTools.Mod index c241eaac..062e8014 100644 --- a/src/compiler/extTools.Mod +++ b/src/compiler/extTools.Mod @@ -70,6 +70,7 @@ PROCEDURE LinkMain*(VAR moduleName: ARRAY OF CHAR; statically: BOOLEAN; addition Strings.Append(Configuration.installdir, cmd); Strings.Append('/lib"', cmd); Strings.Append(Configuration.libspec, cmd); + Strings.Append('-O', cmd); Strings.Append(OPM.Model, cmd); execute("Assemble and link: ", cmd); END LinkMain; diff --git a/src/library/misc/crt.Mod b/src/library/misc/crt.Mod index ab6e36b9..eebc5678 100644 --- a/src/library/misc/crt.Mod +++ b/src/library/misc/crt.Mod @@ -1,7 +1,6 @@ MODULE crt; -IMPORT vt100, Platform, Console, - Strings; (* strings to remove later ? *) +IMPORT VT100, Platform, Out, Strings; CONST @@ -30,27 +29,27 @@ CONST PROCEDURE EraseDisplay*; BEGIN - vt100.ED(2); + VT100.ED(2); END EraseDisplay; PROCEDURE ClrScr*; BEGIN - vt100.ED(2); + VT100.ED(2); END ClrScr; PROCEDURE ClrEol*; BEGIN - vt100.EL(0); + VT100.EL(0); END ClrEol; PROCEDURE cursoroff*; BEGIN - vt100.DECTCEMl; + VT100.DECTCEMl; END cursoroff; PROCEDURE cursoron*; BEGIN - vt100.DECTCEMh; + VT100.DECTCEMh; END cursoron; PROCEDURE Delay*(ms: INTEGER); @@ -58,116 +57,116 @@ CONST PROCEDURE GotoXY* (x, y: INTEGER); BEGIN - vt100.CUP (y, x); + VT100.CUP (y, x); END GotoXY; PROCEDURE HighVideo*; VAR tmpstr: ARRAY 5 OF CHAR; BEGIN - COPY (vt100.CSI, tmpstr); - Strings.Append(vt100.Bold, tmpstr); - Console.String(tmpstr); + COPY (VT100.CSI, tmpstr); + Strings.Append(VT100.Bold, tmpstr); + Out.String(tmpstr); END HighVideo; - + PROCEDURE DelLine*; BEGIN - vt100.EL(2); + VT100.EL(2); END DelLine; PROCEDURE InsLine*; BEGIN - vt100.SCP; - Console.Ln; - vt100.RCP; + VT100.SCP; + Out.Ln; + VT100.RCP; END InsLine; PROCEDURE LowVideo*; VAR tmpstr : ARRAY 7 OF CHAR; BEGIN - COPY (vt100.CSI, tmpstr); - Strings.Append(vt100.ResetBold, tmpstr); - Console.String(tmpstr); + COPY (VT100.CSI, tmpstr); + Strings.Append(VT100.ResetBold, tmpstr); + Out.String(tmpstr); END LowVideo; PROCEDURE NormVideo*; VAR tmpstr : ARRAY 7 OF CHAR; BEGIN - COPY(vt100.CSI, tmpstr); - Strings.Append(vt100.ResetAll, tmpstr); - Console.String(tmpstr); + COPY(VT100.CSI, tmpstr); + Strings.Append(VT100.ResetAll, tmpstr); + Out.String(tmpstr); END NormVideo; PROCEDURE TextBackground*(color : SHORTINT); BEGIN IF color = Black THEN - vt100.SetAttr(vt100.BBlack) + VT100.SetAttr(VT100.BBlack) ELSIF color = Blue THEN - vt100.SetAttr(vt100.BBlue) + VT100.SetAttr(VT100.BBlue) ELSIF color = Green THEN - vt100.SetAttr(vt100.BGreen) + VT100.SetAttr(VT100.BGreen) ELSIF color = Cyan THEN - vt100.SetAttr(vt100.BCyan) + VT100.SetAttr(VT100.BCyan) ELSIF color = Red THEN - vt100.SetAttr(vt100.BRed) + VT100.SetAttr(VT100.BRed) ELSIF color = Magenta THEN - vt100.SetAttr(vt100.BMagenta) + VT100.SetAttr(VT100.BMagenta) ELSIF color = Brown THEN - vt100.SetAttr(vt100.BYellow) + VT100.SetAttr(VT100.BYellow) ELSIF color = LightGray THEN - vt100.SetAttr(vt100.BLightGray) + VT100.SetAttr(VT100.BLightGray) ELSIF color = DarkGray THEN - vt100.SetAttr(vt100.BDarkGray) + VT100.SetAttr(VT100.BDarkGray) ELSIF color = LightBlue THEN - vt100.SetAttr(vt100.BLightBlue) + VT100.SetAttr(VT100.BLightBlue) ELSIF color = LightGreen THEN - vt100.SetAttr(vt100.BLightBlue) + VT100.SetAttr(VT100.BLightBlue) ELSIF color = LightCyan THEN - vt100.SetAttr(vt100.BLightCyan) + VT100.SetAttr(VT100.BLightCyan) ELSIF color = LightRed THEN - vt100.SetAttr(vt100.BLightRed) + VT100.SetAttr(VT100.BLightRed) ELSIF color = LightMagenta THEN - vt100.SetAttr(vt100.BLightMagenta) + VT100.SetAttr(VT100.BLightMagenta) ELSIF color = Yellow THEN - vt100.SetAttr(vt100.BLightYellow) + VT100.SetAttr(VT100.BLightYellow) ELSIF color = White THEN - vt100.SetAttr(vt100.BWhite) + VT100.SetAttr(VT100.BWhite) END; END TextBackground; PROCEDURE TextColor*(color : SHORTINT); BEGIN IF color = Black THEN - vt100.SetAttr(vt100.Black) + VT100.SetAttr(VT100.Black) ELSIF color = Blue THEN - vt100.SetAttr(vt100.Blue) + VT100.SetAttr(VT100.Blue) ELSIF color = Green THEN - vt100.SetAttr(vt100.Green) + VT100.SetAttr(VT100.Green) ELSIF color = Cyan THEN - vt100.SetAttr(vt100.Cyan) + VT100.SetAttr(VT100.Cyan) ELSIF color = Red THEN - vt100.SetAttr(vt100.Red) + VT100.SetAttr(VT100.Red) ELSIF color = Magenta THEN - vt100.SetAttr(vt100.Magenta) + VT100.SetAttr(VT100.Magenta) ELSIF color = Brown THEN - vt100.SetAttr(vt100.Yellow) + VT100.SetAttr(VT100.Yellow) ELSIF color = LightGray THEN - vt100.SetAttr(vt100.LightGray) + VT100.SetAttr(VT100.LightGray) ELSIF color = DarkGray THEN - vt100.SetAttr(vt100.DarkGray) + VT100.SetAttr(VT100.DarkGray) ELSIF color = LightBlue THEN - vt100.SetAttr(vt100.LightBlue) + VT100.SetAttr(VT100.LightBlue) ELSIF color = LightGreen THEN - vt100.SetAttr(vt100.LightBlue) + VT100.SetAttr(VT100.LightBlue) ELSIF color = LightCyan THEN - vt100.SetAttr(vt100.LightCyan) + VT100.SetAttr(VT100.LightCyan) ELSIF color = LightRed THEN - vt100.SetAttr(vt100.LightRed) + VT100.SetAttr(VT100.LightRed) ELSIF color = LightMagenta THEN - vt100.SetAttr(vt100.LightMagenta) + VT100.SetAttr(VT100.LightMagenta) ELSIF color = Yellow THEN - vt100.SetAttr(vt100.LightYellow) + VT100.SetAttr(VT100.LightYellow) ELSIF color = White THEN - vt100.SetAttr(vt100.White) + VT100.SetAttr(VT100.White) END; END TextColor; diff --git a/src/library/misc/vt100.Mod b/src/library/misc/vt100.Mod deleted file mode 100644 index 37ab5895..00000000 --- a/src/library/misc/vt100.Mod +++ /dev/null @@ -1,342 +0,0 @@ -MODULE vt100; - -IMPORT Console, Strings; - (* reference http://en.wikipedia.org/wiki/ANSI_escape_code - & http://misc.flogisoft.com/bash/tip_colors_and_formatting - *) -CONST - - Escape* = 1BX; - SynchronousIdle* = 16X; - LeftCrotchet* = '['; - - (* formatting *) - Bold* = "1m"; - Dim* = "2m"; - Underlined* = "4m"; - Blink* = "5m"; (* does not work with most emulators, works in tty and xterm *) - Reverse* = "7m"; (* invert the foreground and background colors *) - Hidden* = "8m"; (* useful for passwords *) - - (* reset *) - ResetAll* = "0m"; - ResetBold* = "21m"; - ResetDim* = "22m"; - ResetUnderlined* = "24m"; - ResetBlink* = "25m"; - ResetReverse* = "27m"; - ResetHidden* = "28m"; - - (* foreground colors *) - Black* = "30m"; - Red* = "31m"; - Green* = "32m"; - Yellow* = "33m"; - Blue* = "34m"; - Magenta* = "35m"; - Cyan* = "36m"; - LightGray* = "37m"; - Default* = "39m"; - DarkGray* = "90m"; - LightRed* = "91m"; - LightGreen* = "92m"; - LightYellow* = "93m"; - LightBlue* = "94m"; - LightMagenta* = "95m"; - LightCyan* = "96m"; - White* = "97m"; - - (* background colors *) - BBlack* = "40m"; - BRed* = "41m"; - BGreen* = "42m"; - BYellow* = "43m"; - BBlue* = "44m"; - BMagenta* = "45m"; - BCyan* = "46m"; - BLightGray* = "47m"; - BDefault* = "49m"; - BDarkGray* = "100m"; - BLightRed* = "101m"; - BLightGreen* = "102m"; - BLightYellow* = "103m"; - BLightBlue* = "104m"; - BLightMagenta*= "105m"; - BLightCyan* = "106m"; - BWhite* = "107m"; - - VAR - CSI* : ARRAY 5 OF CHAR; - tmpstr : ARRAY 32 OF CHAR; - - (* IntToStr routine taken from - https://github.com/romiras/Oberon-F-components/blob/master/Ott/Mod/IntStr.cp - and modified to work on 64bit system, - in order to avoid using oocIntStr, which has many dependencies *) - PROCEDURE Reverse0 (VAR str : ARRAY OF CHAR; start, end : INTEGER); - (* Reverses order of characters in the interval [start..end]. *) - VAR - h : CHAR; - BEGIN - WHILE start < end DO - h := str[start]; str[start] := str[end]; str[end] := h; - INC(start); DEC(end) - END - END Reverse0; - - PROCEDURE IntToStr*(int: LONGINT; VAR str: ARRAY OF CHAR); - (* Converts the value of `int' to string form and copies the possibly truncated - result to `str'. *) - VAR - b : ARRAY 21 OF CHAR; - s, e: INTEGER; - maxLength : SHORTINT; (* maximum number of digits representing a LONGINT value *) - BEGIN - IF SIZE(LONGINT) = 4 THEN maxLength := 11 END; - IF SIZE(LONGINT) = 8 THEN maxLength := 20 END; - (* build representation in string 'b' *) - IF int = MIN(LONGINT) THEN (* smallest LONGINT, -int is an overflow *) - IF SIZE(LONGINT) = 4 THEN - b := "-2147483648"; - e := 11 - ELSE (* SIZE(LONGINT) = 8 *) - b := "-9223372036854775808"; - e := 20 - END - ELSE - IF int < 0 THEN (* negative sign *) - b[0] := "-"; int := -int; s := 1 - ELSE (* no sign *) - s := 0 - END; - e := s; (* 's' holds starting position of string *) - REPEAT - b[e] := CHR(int MOD 10+ORD("0")); - int := int DIV 10; - INC(e) - UNTIL int = 0; - b[e] := 0X; - Reverse0(b, s, e-1); - END; - COPY(b, str) (* truncate output if necessary *) - END IntToStr; - - PROCEDURE EscSeq0 (letter : ARRAY OF CHAR); - VAR - cmd : ARRAY 9 OF CHAR; - BEGIN - COPY(CSI, cmd); - Strings.Append (letter, cmd); - Console.String (cmd); - END EscSeq0; - - PROCEDURE EscSeq (n : INTEGER; letter : ARRAY OF CHAR); - VAR nstr : ARRAY 2 OF CHAR; - cmd : ARRAY 7 OF CHAR; - BEGIN - IntToStr (n, nstr); - COPY(CSI, cmd); - Strings.Append (nstr, cmd); - Strings.Append (letter, cmd); - Console.String (cmd); - END EscSeq; - - PROCEDURE EscSeqSwapped (n : INTEGER; letter : ARRAY OF CHAR); - VAR nstr : ARRAY 2 OF CHAR; - cmd : ARRAY 7 OF CHAR; - BEGIN - IntToStr (n, nstr); - COPY(CSI, cmd); - Strings.Append (letter, cmd); - Strings.Append (nstr, cmd); - Console.String (cmd); - END EscSeqSwapped; - - PROCEDURE EscSeq2(n, m : INTEGER; letter : ARRAY OF CHAR); - VAR nstr, mstr : ARRAY 5 OF CHAR; - cmd : ARRAY 12 OF CHAR; - BEGIN - IntToStr(n, nstr); - IntToStr(m, mstr); - - COPY (CSI, cmd); - Strings.Append (nstr, cmd); - Strings.Append (';', cmd); - Strings.Append (mstr, cmd); - Strings.Append (letter, cmd); - Console.String (cmd); - - END EscSeq2; - - - -(* Cursor up - moves cursor n cells in the given direction. if the cursor is already at the edge of the screen, this has no effect *) - - PROCEDURE CUU*(n : INTEGER); - BEGIN - EscSeq (n, 'A'); - END CUU; - -(* Cursor down - moves cursor n cells in the given direction. if the cursor is already at the edge of the screen, this has no effect *) - - PROCEDURE CUD*(n : INTEGER); - BEGIN - EscSeq (n, 'B'); - END CUD; - - -(* Cursor forward - moves cursor n cells in the given direction. if the cursor is already at the edge of the screen, this has no effect *) - - PROCEDURE CUF*(n : INTEGER); - BEGIN - EscSeq (n, 'C'); - END CUF; - -(* Cursor back - moves cursor n cells in the given direction. if the cursor is already at the edge of the screen, this has no effect *) - - PROCEDURE CUB*(n : INTEGER); - BEGIN - EscSeq (n, 'D'); - END CUB; - -(* Curnser Next Line - moves cursor to beginning of the line n lines down *) - - PROCEDURE CNL*( n: INTEGER); - BEGIN - EscSeq (n, 'E'); - END CNL; - - -(* Cursor Previous Line - Moves cursor to beginning of the line n lines down *) - - PROCEDURE CPL*( n : INTEGER); - BEGIN - EscSeq (n, 'F'); - END CPL; - -(* Cursor Horizontal Absolute - Moves the cursor to column n *) - - PROCEDURE CHA*( n : INTEGER); - BEGIN - EscSeq (n, 'G'); - END CHA; - - (* Cursor position, moves cursor to row n, column m *) - PROCEDURE CUP*(n, m : INTEGER); - BEGIN - EscSeq2 (n, m, 'H'); - END CUP; - - (* Erase Display - if n = 0 then clears from cursor to end of the screen - if n = 1 then clears from cursor to beginning of the screen - if n = 2 then clears entire screen *) - - PROCEDURE ED* (n : INTEGER); - BEGIN - EscSeq(n, 'J'); - END ED; - - (* Erase in Line - Erases part of the line. If n is zero, clear from cursor to the end of the line. If n is one, clear from cursor to beginning of the line. If n is two, clear entire line. Cursor position does not change *) - PROCEDURE EL*( n : INTEGER); - BEGIN - EscSeq(n, 'K'); - END EL; - -(* Scroll Up - Scroll whole page up by n lines. New lines are added at the bottom *) - PROCEDURE SU*( n : INTEGER); - BEGIN - EscSeq(n, 'S') - END SU; - -(* Scroll Down - Scroll whole page down by n (default 1) lines. New lines are added at the top *) - PROCEDURE SD*( n : INTEGER); - BEGIN - EscSeq(n, 'T'); - END SD; - -(* Horizontal and Vertical Position, - Moves the cursor to row n, column m. Both default to 1 if omitted. Same as CUP *) - PROCEDURE HVP*(n, m : INTEGER); - BEGIN - EscSeq2 (n, m, 'f'); - END HVP; - -(* Select Graphic Rendition - Sets SGR parameters, including text color. After CSI can be zero or more parameters separated with ;. With no parameters, CSI m is treated as CSI 0 m (reset / normal), which is typical of most of the ANSI escape sequences *) - - PROCEDURE SGR*( n : INTEGER); - BEGIN - EscSeq(n, 'm'); - END SGR; - - PROCEDURE SGR2*( n, m : INTEGER); - BEGIN - EscSeq2(n, m, 'm'); - END SGR2; - -(* Device Status Report - Reports the cursor position (CPR) to the application as (as though typed at the keyboard) ESC[n;mR, where n is the row and m is the column.) *) - - PROCEDURE DSR*(n : INTEGER); - BEGIN - EscSeq(6, 'n'); - END DSR; - -(* Save Cursor Position *) - - PROCEDURE SCP*; - BEGIN - EscSeq0('s'); - END SCP; - -(* Restore Cursor Position *) - - PROCEDURE RCP*; - BEGIN - EscSeq0('u'); - END RCP; - -(* Hide the cursor *) - PROCEDURE DECTCEMl*; - BEGIN - EscSeq0("?25l") - END DECTCEMl; - -(* shows the cursor *) - PROCEDURE DECTCEMh*; - BEGIN - EscSeq0("?25h") - END DECTCEMh; - - PROCEDURE SetAttr*(attr : ARRAY OF CHAR); - VAR tmpstr : ARRAY 16 OF CHAR; - BEGIN - COPY(CSI, tmpstr); - Strings.Append(attr, tmpstr); - Console.String(tmpstr); - END SetAttr; - - BEGIN - (* init CSI sequence *) - COPY(Escape, CSI); - Strings.Append(LeftCrotchet, CSI); -(* - EraseDisplay; - GotoXY (0, 0); - COPY(CSI, tmpstr); - Strings.Append(Green, tmpstr); - Strings.Append("hello", tmpstr); - Console.String(tmpstr); Console.Ln; -*) - END vt100. diff --git a/src/library/s3/ethReals.Mod b/src/library/s3/ethReals.Mod index 5851cd17..ea2d9d9f 100644 --- a/src/library/s3/ethReals.Mod +++ b/src/library/s3/ethReals.Mod @@ -10,7 +10,7 @@ Implemented by Bernd Moesli, Seminar for Applied Mathematics, Swiss Federal Institute of Technology Z…rich. *) -IMPORT SYSTEM, Platform, Configuration; +IMPORT SYSTEM, Platform; (* Bernd Moesli Seminar for Applied Mathematics diff --git a/src/runtime/MathL.Mod b/src/runtime/MathL.Mod index 69f994bb..3b26e498 100644 --- a/src/runtime/MathL.Mod +++ b/src/runtime/MathL.Mod @@ -131,7 +131,7 @@ PROCEDURE fraction*(x: LONGREAL): LONGREAL; significant) part of `x'. Hence the following relationship shall hold: x = scale(fraction(x), exponent(x)). *) - VAR s: SET; + VAR s: SYSTEM.SET64; BEGIN IF x = ZERO THEN RETURN ZERO ELSE @@ -170,7 +170,7 @@ PROCEDURE scale*(x: LONGREAL; n: INTEGER): LONGREAL; The value of the call scale(x,n) shall be the value x*radix^n if such a value exists; otherwise an execption shall occur and may be raised. *) - VAR exp: LONGINT; lexp: SYSTEM.SET64; + VAR exp: HUGEINT; lexp: SYSTEM.SET64; BEGIN IF x = ZERO THEN RETURN ZERO END; exp := exponent(x) + n; (* new exponent *) diff --git a/src/runtime/Out.Mod b/src/runtime/Out.Mod index 6ba07c09..1de04671 100644 --- a/src/runtime/Out.Mod +++ b/src/runtime/Out.Mod @@ -199,4 +199,5 @@ PROCEDURE LongReal*(x: LONGREAL; n: INTEGER); BEGIN RealP(x, n, TRUE); END LongReal; +BEGIN in := 0 END Out. diff --git a/src/runtime/vt100.Mod b/src/runtime/vt100.Mod index f21df4a6..03cc1d2c 100644 --- a/src/runtime/vt100.Mod +++ b/src/runtime/vt100.Mod @@ -1,4 +1,4 @@ -MODULE vt100; +MODULE VT100; IMPORT Out, Strings; (* reference http://en.wikipedia.org/wiki/ANSI_escape_code @@ -339,4 +339,4 @@ CONST Strings.Append("hello", tmpstr); Out.String(tmpstr); Out.Ln; *) - END vt100. + END VT100. diff --git a/src/tools/make/oberon.mk b/src/tools/make/oberon.mk index d8a8dd6b..8e581356 100644 --- a/src/tools/make/oberon.mk +++ b/src/tools/make/oberon.mk @@ -110,7 +110,7 @@ translate: cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfFx -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Files.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Reals.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Texts.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/vt100.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/VT100.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/errors.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/OPM.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/extTools.Mod @@ -161,17 +161,19 @@ install: @cp $(OBECOMP) "$(INSTALLDIR)/bin/$(OBECOMP)" @-cp $(BUILDDIR)/showdef$(BINEXT) "$(INSTALLDIR)/bin" - @mkdir -p "$(INSTALLDIR)/2/include" && cp $(BUILDDIR)/*.h "$(INSTALLDIR)/2/include/" - @mkdir -p "$(INSTALLDIR)/2/sym" && cp $(BUILDDIR)/*.sym "$(INSTALLDIR)/2/sym/" + @mkdir -p "$(INSTALLDIR)/2/include" && cp $(BUILDDIR)/2/*.h "$(INSTALLDIR)/2/include/" + @mkdir -p "$(INSTALLDIR)/2/sym" && cp $(BUILDDIR)/2/*.sym "$(INSTALLDIR)/2/sym/" @mkdir -p "$(INSTALLDIR)/C/include" && cp $(BUILDDIR)/C/*.h "$(INSTALLDIR)/C/include/" @mkdir -p "$(INSTALLDIR)/C/sym" && cp $(BUILDDIR)/C/*.sym "$(INSTALLDIR)/C/sym/" @mkdir -p "$(INSTALLDIR)/lib" - @cp $(BUILDDIR)/lib$(ONAME)* "$(INSTALLDIR)/lib/" + @cp $(BUILDDIR)/2/lib$(ONAME)* "$(INSTALLDIR)/lib/" @cp $(BUILDDIR)/C/lib$(ONAME)* "$(INSTALLDIR)/lib/" @if which ldconfig >/dev/null 2>&1; then $(LDCONFIG); fi + + # showpath: Describe how to set the PATH variable showpath: @printf "\nNow add $(INSTALLDIR)/bin to your path, for example with the command:\n" @@ -190,190 +192,193 @@ uninstall: runtime: @printf "\nMaking run time library for -O$(MODEL)\n" - mkdir -p $(BUILDDIR)/$(MODEL) - cp src/runtime/*.[ch] $(BUILDDIR)/$(MODEL) - cd $(BUILDDIR)/$(MODEL) && $(COMPILE) -c SYSTEM.c cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Platform$(PLATFORM).Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Heap.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Modules.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Strings.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Out.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/VT100.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Files.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Math.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/MathL.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Reals.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Texts.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Oberon.Mod - @printf "\nMaking lib$(ONAME)$(MODEL)\n" - ar rcs "$(BUILDDIR)/$(MODEL)/lib$(ONAME)$(MODEL).a" $(BUILDDIR)/$(MODEL)/*.o - @cd $(BUILDDIR)/$(MODEL) && $(COMPILE) -shared -o lib$(ONAME)$(MODEL).so *.o - v4: - @printf "\nMaking v4 library\n" - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/v4/Args.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/v4/Console.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/v4/Printer.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/v4/Sets.Mod + @printf "\nMaking v4 library for -O$(MODEL)\n" + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/v4/Args.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/v4/Console.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/v4/Printer.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/v4/Sets.Mod ooc2: - @printf "\nMaking ooc2 library\n" - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc2/ooc2Strings.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc2/ooc2Ascii.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc2/ooc2CharClass.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc2/ooc2ConvTypes.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc2/ooc2IntConv.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc2/ooc2IntStr.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc2/ooc2Real0.Mod - - -TODO: Comment disabled lines contain use of VAL that reads beyond source variable + @printf "\nMaking ooc2 library for -O$(MODEL)\n" + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc2/ooc2Strings.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc2/ooc2Ascii.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc2/ooc2CharClass.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc2/ooc2ConvTypes.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc2/ooc2IntConv.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc2/ooc2IntStr.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc2/ooc2Real0.Mod ooc: - @printf "\nMaking ooc library\n" - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocLowReal.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocLowLReal.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocRealMath.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocOakMath.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocLRealMath.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocLongInts.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocComplexMath.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocLComplexMath.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocAscii.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocCharClass.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocStrings.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocConvTypes.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocLRealConv.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocLRealStr.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocRealConv.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocRealStr.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocIntConv.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocIntStr.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocMsg.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocSysClock.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocTime.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocChannel.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocStrings2.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocRts.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocFilenames.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocTextRider.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocBinaryRider.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocJulianDay.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocFilenames.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocwrapperlibc.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocC$(DATAMODEL).Mod + @printf "\nMaking ooc library for -O$(MODEL)\n" + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocLowReal.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocLowLReal.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocRealMath.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocOakMath.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocLRealMath.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocLongInts.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocComplexMath.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocLComplexMath.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocAscii.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocCharClass.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocStrings.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocConvTypes.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocLRealConv.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocLRealStr.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocRealConv.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocRealStr.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocIntConv.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocIntStr.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocMsg.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocSysClock.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocTime.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocChannel.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocStrings2.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocRts.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocFilenames.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocTextRider.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocBinaryRider.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocJulianDay.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocFilenames.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocwrapperlibc.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocC$(DATAMODEL).Mod oocX11: - @printf "\nMaking oocX11 library\n" - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/oocX11/oocX11.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/oocX11/oocXutil.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/oocX11/oocXYplane.Mod + @printf "\nMaking oocX11 library for -O$(MODEL)\n" + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/oocX11/oocX11.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/oocX11/oocXutil.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/oocX11/oocXYplane.Mod ulm: - @printf "\nMaking ulm library\n" - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmObjects.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmPriorities.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmDisciplines.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmServices.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmSys.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmSYSTEM.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmEvents.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmProcess.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmResources.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmForwarders.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmRelatedEvents.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmTypes.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmStreams.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmStrings.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmSysTypes.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmTexts.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmSysConversions.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmErrors.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmSysErrors.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmSysStat.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmASCII.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmSets.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmIO.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmAssertions.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmIndirectDisciplines.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmStreamDisciplines.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmIEEE.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmMC68881.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmReals.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmPrint.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmWrite.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmConstStrings.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmPlotters.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmSysIO.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmLoader.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmNetIO.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmPersistentObjects.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmPersistentDisciplines.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmOperations.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmScales.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmTimes.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmClocks.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmTimers.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmConditions.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmStreamConditions.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmTimeConditions.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmCiphers.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmCipherOps.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmBlockCiphers.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmAsymmetricCiphers.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmConclusions.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmRandomGenerators.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmTCrypt.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmIntOperations.Mod + @printf "\nMaking ulm library for -O$(MODEL)\n" + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmObjects.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmPriorities.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmDisciplines.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmServices.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmSys.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmSYSTEM.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmEvents.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmProcess.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmResources.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmForwarders.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmRelatedEvents.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmTypes.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmStreams.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmStrings.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmSysTypes.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmTexts.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmSysConversions.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmErrors.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmSysErrors.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmSysStat.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmASCII.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmSets.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmIO.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmAssertions.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmIndirectDisciplines.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmStreamDisciplines.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmIEEE.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmMC68881.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmReals.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmPrint.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmWrite.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmConstStrings.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmPlotters.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmSysIO.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmLoader.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmNetIO.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmPersistentObjects.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmPersistentDisciplines.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmOperations.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmScales.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmTimes.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmClocks.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmTimers.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmConditions.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmStreamConditions.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmTimeConditions.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmCiphers.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmCipherOps.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmBlockCiphers.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmAsymmetricCiphers.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmConclusions.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmRandomGenerators.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmTCrypt.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmIntOperations.Mod pow32: - @printf "\nMaking pow library\n" - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/pow/powStrings.Mod + @printf "\nMaking pow library for -O$(MODEL)\n" + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/pow/powStrings.Mod misc: - @printf "\nMaking misc library\n" - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/runtime/Oberon.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/misc/crt.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/misc/Listen.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/misc/MersenneTwister.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/misc/MultiArrays.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/misc/MultiArrayRiders.Mod + @printf "\nMaking misc library for -O$(MODEL)\n" + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/misc/crt.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/misc/Listen.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/misc/MersenneTwister.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/misc/MultiArrays.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/misc/MultiArrayRiders.Mod s3: - @printf "\nMaking s3 library\n" - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/s3/ethBTrees.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/s3/ethMD5.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/s3/ethSets.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/s3/ethZlib.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/s3/ethZlibBuffers.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/s3/ethZlibInflate.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/s3/ethZlibDeflate.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/s3/ethZlibReaders.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/s3/ethZlibWriters.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/s3/ethZip.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/s3/ethRandomNumbers.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/s3/ethGZReaders.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/s3/ethGZWriters.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/s3/ethUnicode.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/s3/ethDates.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/s3/ethReals.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/s3/ethStrings.Mod + @printf "\nMaking s3 library for -O$(MODEL)\n" + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/s3/ethBTrees.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/s3/ethMD5.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/s3/ethSets.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/s3/ethZlib.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/s3/ethZlibBuffers.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/s3/ethZlibInflate.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/s3/ethZlibDeflate.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/s3/ethZlibReaders.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/s3/ethZlibWriters.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/s3/ethZip.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/s3/ethRandomNumbers.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/s3/ethGZReaders.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/s3/ethGZWriters.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/s3/ethUnicode.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/s3/ethDates.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/s3/ethReals.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/s3/ethStrings.Mod -O2library: v4 ooc2 ooc ulm pow32 misc s3 - @printf "\nMaking lib$(ONAME)2\n" - rm -f $(BUILDDIR)/Compiler.o -# Note: remining compiler files are retained in the library allowing the building -# of utilities like BrowserCmd.Mod (aka showdef). -# Make static library - ar rcs "$(BUILDDIR)/lib$(ONAME)2.a" $(BUILDDIR)/*.o -# Make shared library - @cd $(BUILDDIR) && $(COMPILE) -shared -o lib$(ONAME)2.so *.o +# O2library: v4 ooc2 ooc ulm pow32 misc s3 runtime +# @printf "\nMaking lib$(ONAME)2\n" +# rm -f $(BUILDDIR)/Compiler.o +# # Note: remining compiler files are retained in the library allowing the building +# # of utilities like BrowserCmd.Mod (aka showdef). +# # Make static library +# ar rcs "$(BUILDDIR)/lib$(ONAME)2.a" $(BUILDDIR)/*.o +# # Make shared library +# @cd $(BUILDDIR) && $(COMPILE) -shared -o lib$(ONAME)2.so *.o +O2library: runtime v4 ooc2 ooc ulm pow32 misc s3 +OClibrary: runtime + +library: + @printf "\nCompiling lib$(ONAME)-O$(MODEL) sources\n" + rm -rf $(BUILDDIR)/$(MODEL) + mkdir -p $(BUILDDIR)/$(MODEL) + cp src/runtime/*.[ch] $(BUILDDIR)/$(MODEL) + cd $(BUILDDIR)/$(MODEL) && $(COMPILE) -c SYSTEM.c + @make -f src/tools/make/oberon.mk -s O$(MODEL)library MODEL=$(MODEL) + @printf "\nMaking lib$(ONAME)-O$(MODEL) .a and .so\n" + ar rcs "$(BUILDDIR)/$(MODEL)/lib$(ONAME)-O$(MODEL).a" $(BUILDDIR)/$(MODEL)/*.o + @cd $(BUILDDIR)/$(MODEL) && $(COMPILE) -shared -o lib$(ONAME)-O$(MODEL).so *.o From 1507d9cb0afeb1e14d088f0574753a50dd0e58c1 Mon Sep 17 00:00:00 2001 From: David Brown Date: Sat, 15 Oct 2016 19:05:08 +0100 Subject: [PATCH 283/580] Force git rename of VT100 in bootstrap, make SYSTEM.* mdel independent. --- bootstrap/SYSTEM.c | 22 ++++++++--- bootstrap/SYSTEM.h | 45 +++++++++++------------ bootstrap/unix-44/Compiler.c | 4 +- bootstrap/unix-44/Platform.c | 8 ++-- bootstrap/unix-44/Platform.h | 4 +- bootstrap/unix-44/{vt100.c => VT100.c} | 0 bootstrap/unix-44/{vt100.h => VT100.h} | 0 bootstrap/unix-48/Compiler.c | 4 +- bootstrap/unix-48/Platform.c | 8 ++-- bootstrap/unix-48/Platform.h | 4 +- bootstrap/unix-48/{vt100.c => VT100.c} | 0 bootstrap/unix-48/{vt100.h => VT100.h} | 0 bootstrap/unix-88/Compiler.c | 4 +- bootstrap/unix-88/Platform.c | 8 ++-- bootstrap/unix-88/Platform.h | 4 +- bootstrap/unix-88/{vt100.c => VT100.c} | 0 bootstrap/unix-88/{vt100.h => VT100.h} | 0 bootstrap/windows-48/Compiler.c | 4 +- bootstrap/windows-48/Platform.c | 8 ++-- bootstrap/windows-48/Platform.h | 4 +- bootstrap/windows-48/{vt100.c => VT100.c} | 0 bootstrap/windows-48/{vt100.h => VT100.h} | 0 bootstrap/windows-88/Compiler.c | 4 +- bootstrap/windows-88/Platform.c | 8 ++-- bootstrap/windows-88/Platform.h | 4 +- bootstrap/windows-88/{vt100.c => VT100.c} | 0 bootstrap/windows-88/{vt100.h => VT100.h} | 0 src/compiler/Compiler.Mod | 2 +- src/runtime/Platformunix.Mod | 12 +++--- src/runtime/Platformwindows.Mod | 8 ++-- src/runtime/SYSTEM.c | 22 ++++++++--- src/runtime/SYSTEM.h | 45 +++++++++++------------ src/test/confidence/signal/signal.mod | 4 +- src/tools/make/configure.c | 43 ++++++++++++---------- 34 files changed, 152 insertions(+), 131 deletions(-) rename bootstrap/unix-44/{vt100.c => VT100.c} (100%) rename bootstrap/unix-44/{vt100.h => VT100.h} (100%) rename bootstrap/unix-48/{vt100.c => VT100.c} (100%) rename bootstrap/unix-48/{vt100.h => VT100.h} (100%) rename bootstrap/unix-88/{vt100.c => VT100.c} (100%) rename bootstrap/unix-88/{vt100.h => VT100.h} (100%) rename bootstrap/windows-48/{vt100.c => VT100.c} (100%) rename bootstrap/windows-48/{vt100.h => VT100.h} (100%) rename bootstrap/windows-88/{vt100.c => VT100.c} (100%) rename bootstrap/windows-88/{vt100.h => VT100.h} (100%) diff --git a/bootstrap/SYSTEM.c b/bootstrap/SYSTEM.c index 6efc8321..b97144e7 100644 --- a/bootstrap/SYSTEM.c +++ b/bootstrap/SYSTEM.c @@ -46,20 +46,30 @@ int64 SYSTEM_MOD(int64 x, int64 y) else {return -((-x) % (-y));} } -LONGINT SYSTEM_ENTIER(double x) +// LONGINT SYSTEM_ENTIER(double x) +// { +// LONGINT y; +// if (x >= 0) +// return (LONGINT)x; +// else { +// y = (LONGINT)x; +// if (y <= x) return y; else return y - 1; +// } +// } + +int64 SYSTEM_ENTIER(double x) { - LONGINT y; + int64 y; if (x >= 0) - return (LONGINT)x; + return (int64)x; else { - y = (LONGINT)x; + y = (int64)x; if (y <= x) return y; else return y - 1; } } - void SYSTEM_INHERIT(address *t, address *t0) { t -= __TPROC0OFF; @@ -155,7 +165,7 @@ SYSTEM_PTR SYSTEM_NEWARR(address *typ, address elemsz, int elemalgn, int nofdim, -typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler +typedef void (*SystemSignalHandler)(int32); // = Platform_SignalHandler #ifndef _WIN32 diff --git a/bootstrap/SYSTEM.h b/bootstrap/SYSTEM.h index 4e1bfe18..7cba936e 100644 --- a/bootstrap/SYSTEM.h +++ b/bootstrap/SYSTEM.h @@ -8,20 +8,19 @@ #define __o_64 #endif -// Temporary while bootstrapping and clearing up SYSTEM.c. - - -#ifndef LONGINT - #if defined (__o_64) - #define INTEGER int32 - #define LONGINT int64 - #define SET uint64 - #else - #define INTEGER int16 - #define LONGINT int32 - #define SET uint32 - #endif -#endif +// // Temporary while bootstrapping and clearing up SYSTEM.c. +// +// #ifndef LONGINT +// #if defined (__o_64) +// #define INTEGER int32 +// #define LONGINT int64 +// #define SET uint64 +// #else +// #define INTEGER int16 +// #define LONGINT int32 +// #define SET uint32 +// #endif +// #endif @@ -119,11 +118,11 @@ extern void Platform_OSFree (address addr); // Assertions and Halts -extern void Platform_Halt(LONGINT x); -extern void Platform_AssertFail(LONGINT x); +extern void Platform_Halt(int32 x); +extern void Platform_AssertFail(int32 x); #define __HALT(x) Platform_Halt(x) -#define __ASSERT(cond, x) if (!(cond)) Platform_AssertFail((LONGINT)(x)) +#define __ASSERT(cond, x) if (!(cond)) Platform_AssertFail((int32)(x)) // Index checking @@ -136,7 +135,7 @@ static inline int64 __XF(uint64 i, uint64 ub) {if (i >= ub) {__HALT(-2);} return static inline int64 __RF(uint64 i, uint64 ub) {if (i >= ub) {__HALT(-8);} return i;} #define __R(i, ub) (((i)<(ub))?i:(__HALT(-8),0)) -#define __SHORT(x, ub) ((int)((uLONGINT)(x)+(ub)<(ub)+(ub)?(x):(__HALT(-8),0))) +#define __SHORT(x, ub) ((int)((uint64)(x)+(ub)<(ub)+(ub)?(x):(__HALT(-8),0))) #define __SHORTF(x, ub) ((int)(__RF((x)+(ub),(ub)+(ub))-(ub))) #define __CHR(x) ((CHAR)__R(x, 256)) #define __CHRF(x) ((CHAR)__RF(x, 256)) @@ -157,7 +156,7 @@ static inline int64 __RF(uint64 i, uint64 ub) {if (i >= ub) {__HALT(-8);} return // String comparison static inline int __str_cmp(CHAR *x, CHAR *y){ - LONGINT i = 0; + int64 i = 0; CHAR ch1, ch2; do {ch1 = x[i]; ch2 = y[i]; i++; if (!ch1) return -(int)ch2; @@ -212,7 +211,7 @@ extern int64 SYSTEM_MOD(int64 x, int64 y); #define __MOD(x, y) (((x)>0 && (y)>0) ? (x)%(y) : __MODF(x, y)) -extern LONGINT SYSTEM_ENTIER (double x); +extern int64 SYSTEM_ENTIER (double x); #define __ENTIER(x) SYSTEM_ENTIER(x) @@ -275,10 +274,10 @@ extern void Heap_INCREF(); // Main module initialisation, registration and finalisation -extern void Platform_Init(INTEGER argc, address argv); +extern void Platform_Init(int32 argc, address argv); extern void Heap_FINALL(); -#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (address)&argv); +#define __INIT(argc, argv) static void *m; Platform_Init(argc, (address)&argv); #define __REGMAIN(name, enum) m = Heap_REGMOD((CHAR*)name,enum) #define __FINI Heap_FINALL(); return 0 @@ -287,7 +286,7 @@ extern void Heap_FINALL(); extern SYSTEM_PTR Heap_NEWBLK (address size); extern SYSTEM_PTR Heap_NEWREC (address tag); -extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); +extern SYSTEM_PTR SYSTEM_NEWARR(address*, address, int, int, int, ...); #define __SYSNEW(p, len) p = Heap_NEWBLK((address)(len)) #define __NEW(p, t) p = Heap_NEWREC((address)t##__typ) diff --git a/bootstrap/unix-44/Compiler.c b/bootstrap/unix-44/Compiler.c index 82f1ab48..08a80f54 100644 --- a/bootstrap/unix-44/Compiler.c +++ b/bootstrap/unix-44/Compiler.c @@ -26,7 +26,7 @@ static CHAR Compiler_mname[256]; export void Compiler_Module (BOOLEAN *done); static void Compiler_PropagateElementaryTypeSizes (void); export void Compiler_Translate (void); -static void Compiler_Trap (int16 sig); +static void Compiler_Trap (int32 sig); void Compiler_Module (BOOLEAN *done) @@ -147,7 +147,7 @@ void Compiler_Translate (void) } } -static void Compiler_Trap (int16 sig) +static void Compiler_Trap (int32 sig) { Heap_FINALL(); if (sig == 3) { diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index ff57e9c4..0fe40111 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -28,7 +28,7 @@ typedef void (*Platform_HaltProcedure)(int32); typedef - void (*Platform_SignalHandler)(int16); + void (*Platform_SignalHandler)(int32); export BOOLEAN Platform_LittleEndian; @@ -65,7 +65,7 @@ export void Platform_Halt (int32 code); export int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ); export int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); export BOOLEAN Platform_Inaccessible (int16 e); -export void Platform_Init (int16 argc, int32 argvadr); +export void Platform_Init (int32 argc, int32 argvadr); export BOOLEAN Platform_Interrupted (int16 e); export void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); export int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); @@ -240,11 +240,11 @@ void Platform_OSFree (int32 address) Platform_free(address); } -void Platform_Init (int16 argc, int32 argvadr) +void Platform_Init (int32 argc, int32 argvadr) { Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; - Platform_ArgCount = argc; + Platform_ArgCount = __VAL(int16, argc); av = (Platform_ArgVecPtr)(address)argvadr; Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index 5e6af8ad..68411f33 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -15,7 +15,7 @@ typedef void (*Platform_HaltProcedure)(int32); typedef - void (*Platform_SignalHandler)(int16); + void (*Platform_SignalHandler)(int32); import BOOLEAN Platform_LittleEndian; @@ -49,7 +49,7 @@ import void Platform_Halt (int32 code); import int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ); import int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); import BOOLEAN Platform_Inaccessible (int16 e); -import void Platform_Init (int16 argc, int32 argvadr); +import void Platform_Init (int32 argc, int32 argvadr); import BOOLEAN Platform_Interrupted (int16 e); import void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); import int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); diff --git a/bootstrap/unix-44/vt100.c b/bootstrap/unix-44/VT100.c similarity index 100% rename from bootstrap/unix-44/vt100.c rename to bootstrap/unix-44/VT100.c diff --git a/bootstrap/unix-44/vt100.h b/bootstrap/unix-44/VT100.h similarity index 100% rename from bootstrap/unix-44/vt100.h rename to bootstrap/unix-44/VT100.h diff --git a/bootstrap/unix-48/Compiler.c b/bootstrap/unix-48/Compiler.c index 82f1ab48..08a80f54 100644 --- a/bootstrap/unix-48/Compiler.c +++ b/bootstrap/unix-48/Compiler.c @@ -26,7 +26,7 @@ static CHAR Compiler_mname[256]; export void Compiler_Module (BOOLEAN *done); static void Compiler_PropagateElementaryTypeSizes (void); export void Compiler_Translate (void); -static void Compiler_Trap (int16 sig); +static void Compiler_Trap (int32 sig); void Compiler_Module (BOOLEAN *done) @@ -147,7 +147,7 @@ void Compiler_Translate (void) } } -static void Compiler_Trap (int16 sig) +static void Compiler_Trap (int32 sig) { Heap_FINALL(); if (sig == 3) { diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index ff57e9c4..0fe40111 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -28,7 +28,7 @@ typedef void (*Platform_HaltProcedure)(int32); typedef - void (*Platform_SignalHandler)(int16); + void (*Platform_SignalHandler)(int32); export BOOLEAN Platform_LittleEndian; @@ -65,7 +65,7 @@ export void Platform_Halt (int32 code); export int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ); export int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); export BOOLEAN Platform_Inaccessible (int16 e); -export void Platform_Init (int16 argc, int32 argvadr); +export void Platform_Init (int32 argc, int32 argvadr); export BOOLEAN Platform_Interrupted (int16 e); export void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); export int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); @@ -240,11 +240,11 @@ void Platform_OSFree (int32 address) Platform_free(address); } -void Platform_Init (int16 argc, int32 argvadr) +void Platform_Init (int32 argc, int32 argvadr) { Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; - Platform_ArgCount = argc; + Platform_ArgCount = __VAL(int16, argc); av = (Platform_ArgVecPtr)(address)argvadr; Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index 5e6af8ad..68411f33 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -15,7 +15,7 @@ typedef void (*Platform_HaltProcedure)(int32); typedef - void (*Platform_SignalHandler)(int16); + void (*Platform_SignalHandler)(int32); import BOOLEAN Platform_LittleEndian; @@ -49,7 +49,7 @@ import void Platform_Halt (int32 code); import int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ); import int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); import BOOLEAN Platform_Inaccessible (int16 e); -import void Platform_Init (int16 argc, int32 argvadr); +import void Platform_Init (int32 argc, int32 argvadr); import BOOLEAN Platform_Interrupted (int16 e); import void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); import int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); diff --git a/bootstrap/unix-48/vt100.c b/bootstrap/unix-48/VT100.c similarity index 100% rename from bootstrap/unix-48/vt100.c rename to bootstrap/unix-48/VT100.c diff --git a/bootstrap/unix-48/vt100.h b/bootstrap/unix-48/VT100.h similarity index 100% rename from bootstrap/unix-48/vt100.h rename to bootstrap/unix-48/VT100.h diff --git a/bootstrap/unix-88/Compiler.c b/bootstrap/unix-88/Compiler.c index 82f1ab48..08a80f54 100644 --- a/bootstrap/unix-88/Compiler.c +++ b/bootstrap/unix-88/Compiler.c @@ -26,7 +26,7 @@ static CHAR Compiler_mname[256]; export void Compiler_Module (BOOLEAN *done); static void Compiler_PropagateElementaryTypeSizes (void); export void Compiler_Translate (void); -static void Compiler_Trap (int16 sig); +static void Compiler_Trap (int32 sig); void Compiler_Module (BOOLEAN *done) @@ -147,7 +147,7 @@ void Compiler_Translate (void) } } -static void Compiler_Trap (int16 sig) +static void Compiler_Trap (int32 sig) { Heap_FINALL(); if (sig == 3) { diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index d58fec88..39e05934 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -28,7 +28,7 @@ typedef void (*Platform_HaltProcedure)(int32); typedef - void (*Platform_SignalHandler)(int16); + void (*Platform_SignalHandler)(int32); export BOOLEAN Platform_LittleEndian; @@ -65,7 +65,7 @@ export void Platform_Halt (int32 code); export int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ); export int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); export BOOLEAN Platform_Inaccessible (int16 e); -export void Platform_Init (int16 argc, int64 argvadr); +export void Platform_Init (int32 argc, int64 argvadr); export BOOLEAN Platform_Interrupted (int16 e); export void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); export int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); @@ -240,11 +240,11 @@ void Platform_OSFree (int64 address) Platform_free(address); } -void Platform_Init (int16 argc, int64 argvadr) +void Platform_Init (int32 argc, int64 argvadr) { Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; - Platform_ArgCount = argc; + Platform_ArgCount = __VAL(int16, argc); av = (Platform_ArgVecPtr)(address)argvadr; Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index 9216622f..24d6dbe4 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -15,7 +15,7 @@ typedef void (*Platform_HaltProcedure)(int32); typedef - void (*Platform_SignalHandler)(int16); + void (*Platform_SignalHandler)(int32); import BOOLEAN Platform_LittleEndian; @@ -49,7 +49,7 @@ import void Platform_Halt (int32 code); import int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ); import int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); import BOOLEAN Platform_Inaccessible (int16 e); -import void Platform_Init (int16 argc, int64 argvadr); +import void Platform_Init (int32 argc, int64 argvadr); import BOOLEAN Platform_Interrupted (int16 e); import void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); import int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); diff --git a/bootstrap/unix-88/vt100.c b/bootstrap/unix-88/VT100.c similarity index 100% rename from bootstrap/unix-88/vt100.c rename to bootstrap/unix-88/VT100.c diff --git a/bootstrap/unix-88/vt100.h b/bootstrap/unix-88/VT100.h similarity index 100% rename from bootstrap/unix-88/vt100.h rename to bootstrap/unix-88/VT100.h diff --git a/bootstrap/windows-48/Compiler.c b/bootstrap/windows-48/Compiler.c index 82f1ab48..08a80f54 100644 --- a/bootstrap/windows-48/Compiler.c +++ b/bootstrap/windows-48/Compiler.c @@ -26,7 +26,7 @@ static CHAR Compiler_mname[256]; export void Compiler_Module (BOOLEAN *done); static void Compiler_PropagateElementaryTypeSizes (void); export void Compiler_Translate (void); -static void Compiler_Trap (int16 sig); +static void Compiler_Trap (int32 sig); void Compiler_Module (BOOLEAN *done) @@ -147,7 +147,7 @@ void Compiler_Translate (void) } } -static void Compiler_Trap (int16 sig) +static void Compiler_Trap (int32 sig) { Heap_FINALL(); if (sig == 3) { diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 6bc9bf9f..6092ac08 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -28,7 +28,7 @@ typedef void (*Platform_HaltProcedure)(int32); typedef - void (*Platform_SignalHandler)(int16); + void (*Platform_SignalHandler)(int32); export BOOLEAN Platform_LittleEndian; @@ -67,7 +67,7 @@ export void Platform_Halt (int32 code); export int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ); export int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); export BOOLEAN Platform_Inaccessible (int16 e); -export void Platform_Init (int16 argc, int32 argvadr); +export void Platform_Init (int32 argc, int32 argvadr); export BOOLEAN Platform_Interrupted (int16 e); export void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); export int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); @@ -252,11 +252,11 @@ void Platform_OSFree (int32 address) Platform_free(address); } -void Platform_Init (int16 argc, int32 argvadr) +void Platform_Init (int32 argc, int32 argvadr) { Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; - Platform_ArgCount = argc; + Platform_ArgCount = __VAL(int16, argc); av = (Platform_ArgVecPtr)(address)argvadr; Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index 79119240..c3fa315b 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -15,7 +15,7 @@ typedef void (*Platform_HaltProcedure)(int32); typedef - void (*Platform_SignalHandler)(int16); + void (*Platform_SignalHandler)(int32); import BOOLEAN Platform_LittleEndian; @@ -50,7 +50,7 @@ import void Platform_Halt (int32 code); import int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ); import int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); import BOOLEAN Platform_Inaccessible (int16 e); -import void Platform_Init (int16 argc, int32 argvadr); +import void Platform_Init (int32 argc, int32 argvadr); import BOOLEAN Platform_Interrupted (int16 e); import void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); import int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); diff --git a/bootstrap/windows-48/vt100.c b/bootstrap/windows-48/VT100.c similarity index 100% rename from bootstrap/windows-48/vt100.c rename to bootstrap/windows-48/VT100.c diff --git a/bootstrap/windows-48/vt100.h b/bootstrap/windows-48/VT100.h similarity index 100% rename from bootstrap/windows-48/vt100.h rename to bootstrap/windows-48/VT100.h diff --git a/bootstrap/windows-88/Compiler.c b/bootstrap/windows-88/Compiler.c index 82f1ab48..08a80f54 100644 --- a/bootstrap/windows-88/Compiler.c +++ b/bootstrap/windows-88/Compiler.c @@ -26,7 +26,7 @@ static CHAR Compiler_mname[256]; export void Compiler_Module (BOOLEAN *done); static void Compiler_PropagateElementaryTypeSizes (void); export void Compiler_Translate (void); -static void Compiler_Trap (int16 sig); +static void Compiler_Trap (int32 sig); void Compiler_Module (BOOLEAN *done) @@ -147,7 +147,7 @@ void Compiler_Translate (void) } } -static void Compiler_Trap (int16 sig) +static void Compiler_Trap (int32 sig) { Heap_FINALL(); if (sig == 3) { diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index eed18d02..d3020826 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -28,7 +28,7 @@ typedef void (*Platform_HaltProcedure)(int32); typedef - void (*Platform_SignalHandler)(int16); + void (*Platform_SignalHandler)(int32); export BOOLEAN Platform_LittleEndian; @@ -67,7 +67,7 @@ export void Platform_Halt (int32 code); export int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ); export int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); export BOOLEAN Platform_Inaccessible (int16 e); -export void Platform_Init (int16 argc, int64 argvadr); +export void Platform_Init (int32 argc, int64 argvadr); export BOOLEAN Platform_Interrupted (int16 e); export void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); export int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); @@ -252,11 +252,11 @@ void Platform_OSFree (int64 address) Platform_free(address); } -void Platform_Init (int16 argc, int64 argvadr) +void Platform_Init (int32 argc, int64 argvadr) { Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; - Platform_ArgCount = argc; + Platform_ArgCount = __VAL(int16, argc); av = (Platform_ArgVecPtr)(address)argvadr; Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index aacc5cad..968219dd 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -15,7 +15,7 @@ typedef void (*Platform_HaltProcedure)(int32); typedef - void (*Platform_SignalHandler)(int16); + void (*Platform_SignalHandler)(int32); import BOOLEAN Platform_LittleEndian; @@ -50,7 +50,7 @@ import void Platform_Halt (int32 code); import int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ); import int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); import BOOLEAN Platform_Inaccessible (int16 e); -import void Platform_Init (int16 argc, int64 argvadr); +import void Platform_Init (int32 argc, int64 argvadr); import BOOLEAN Platform_Interrupted (int16 e); import void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); import int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); diff --git a/bootstrap/windows-88/vt100.c b/bootstrap/windows-88/VT100.c similarity index 100% rename from bootstrap/windows-88/vt100.c rename to bootstrap/windows-88/VT100.c diff --git a/bootstrap/windows-88/vt100.h b/bootstrap/windows-88/VT100.h similarity index 100% rename from bootstrap/windows-88/vt100.h rename to bootstrap/windows-88/VT100.h diff --git a/src/compiler/Compiler.Mod b/src/compiler/Compiler.Mod index d8c688a7..c8e3c40f 100644 --- a/src/compiler/Compiler.Mod +++ b/src/compiler/Compiler.Mod @@ -129,7 +129,7 @@ MODULE Compiler; (* J. Templ 3.2.95 *) END END Translate; - PROCEDURE Trap(sig: INTEGER); + PROCEDURE Trap(sig: SYSTEM.INT32); BEGIN Heap.FINALL(); IF sig = 3 THEN diff --git a/src/runtime/Platformunix.Mod b/src/runtime/Platformunix.Mod index 3db3f2d7..5359a664 100644 --- a/src/runtime/Platformunix.Mod +++ b/src/runtime/Platformunix.Mod @@ -7,8 +7,8 @@ CONST StdErr- = 2; TYPE - HaltProcedure = PROCEDURE(n: LONGINT); - SignalHandler = PROCEDURE(signal: INTEGER); + HaltProcedure = PROCEDURE(n: SYSTEM.INT32); + SignalHandler = PROCEDURE(signal: SYSTEM.INT32); ErrorCode* = INTEGER; FileHandle* = LONGINT; @@ -124,11 +124,11 @@ PROCEDURE OSFree*(address: SYSTEM.ADDRESS); BEGIN free(address) END OSFree; PROCEDURE -ExternInitHeap "extern void Heap_InitHeap();"; PROCEDURE -HeapInitHeap() "Heap_InitHeap()"; -PROCEDURE Init*(argc: INTEGER; argvadr: SYSTEM.ADDRESS); +PROCEDURE Init*(argc: SYSTEM.INT32; argvadr: SYSTEM.ADDRESS); VAR av: ArgVecPtr; BEGIN MainStackFrame := argvadr; - ArgCount := argc; + ArgCount := SYSTEM.VAL(INTEGER, argc); av := SYSTEM.VAL(ArgVecPtr, argvadr); ArgVector := av[0]; HaltCode := -128; @@ -502,7 +502,7 @@ BEGIN END END DisplayHaltCode; -PROCEDURE Halt*(code: LONGINT); +PROCEDURE Halt*(code: SYSTEM.INT32); BEGIN HaltCode := code; IF HaltHandler # NIL THEN HaltHandler(code) END; @@ -512,7 +512,7 @@ BEGIN exit(SYSTEM.VAL(INTEGER,code)); END Halt; -PROCEDURE AssertFail*(code: LONGINT); +PROCEDURE AssertFail*(code: SYSTEM.INT32); BEGIN errstring("Assertion failure."); IF code # 0 THEN errstring(" ASSERT code "); errint(code); errstring("."); END; diff --git a/src/runtime/Platformwindows.Mod b/src/runtime/Platformwindows.Mod index 8471eabb..ad9574d1 100644 --- a/src/runtime/Platformwindows.Mod +++ b/src/runtime/Platformwindows.Mod @@ -8,8 +8,8 @@ IMPORT SYSTEM; TYPE - HaltProcedure = PROCEDURE(n: LONGINT); - SignalHandler = PROCEDURE(signal: INTEGER); + HaltProcedure = PROCEDURE(n: SYSTEM.INT32); + SignalHandler = PROCEDURE(signal: SYSTEM.INT32); ErrorCode* = INTEGER; FileHandle* = LONGINT; @@ -122,11 +122,11 @@ PROCEDURE OSFree*(address: SYSTEM.ADDRESS); BEGIN free(address) END OSFree; PROCEDURE -ExternInitHeap "extern void Heap_InitHeap();"; PROCEDURE -HeapInitHeap() "Heap_InitHeap()"; -PROCEDURE Init*(argc: INTEGER; argvadr: SYSTEM.ADDRESS); +PROCEDURE Init*(argc: SYSTEM.INT32; argvadr: SYSTEM.ADDRESS); VAR av: ArgVecPtr; BEGIN MainStackFrame := argvadr; - ArgCount := argc; + ArgCount := SYSTEM.VAL(INTEGER, argc); av := SYSTEM.VAL(ArgVecPtr, argvadr); ArgVector := av[0]; HaltCode := -128; diff --git a/src/runtime/SYSTEM.c b/src/runtime/SYSTEM.c index 6efc8321..b97144e7 100644 --- a/src/runtime/SYSTEM.c +++ b/src/runtime/SYSTEM.c @@ -46,20 +46,30 @@ int64 SYSTEM_MOD(int64 x, int64 y) else {return -((-x) % (-y));} } -LONGINT SYSTEM_ENTIER(double x) +// LONGINT SYSTEM_ENTIER(double x) +// { +// LONGINT y; +// if (x >= 0) +// return (LONGINT)x; +// else { +// y = (LONGINT)x; +// if (y <= x) return y; else return y - 1; +// } +// } + +int64 SYSTEM_ENTIER(double x) { - LONGINT y; + int64 y; if (x >= 0) - return (LONGINT)x; + return (int64)x; else { - y = (LONGINT)x; + y = (int64)x; if (y <= x) return y; else return y - 1; } } - void SYSTEM_INHERIT(address *t, address *t0) { t -= __TPROC0OFF; @@ -155,7 +165,7 @@ SYSTEM_PTR SYSTEM_NEWARR(address *typ, address elemsz, int elemalgn, int nofdim, -typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler +typedef void (*SystemSignalHandler)(int32); // = Platform_SignalHandler #ifndef _WIN32 diff --git a/src/runtime/SYSTEM.h b/src/runtime/SYSTEM.h index 4e1bfe18..7cba936e 100644 --- a/src/runtime/SYSTEM.h +++ b/src/runtime/SYSTEM.h @@ -8,20 +8,19 @@ #define __o_64 #endif -// Temporary while bootstrapping and clearing up SYSTEM.c. - - -#ifndef LONGINT - #if defined (__o_64) - #define INTEGER int32 - #define LONGINT int64 - #define SET uint64 - #else - #define INTEGER int16 - #define LONGINT int32 - #define SET uint32 - #endif -#endif +// // Temporary while bootstrapping and clearing up SYSTEM.c. +// +// #ifndef LONGINT +// #if defined (__o_64) +// #define INTEGER int32 +// #define LONGINT int64 +// #define SET uint64 +// #else +// #define INTEGER int16 +// #define LONGINT int32 +// #define SET uint32 +// #endif +// #endif @@ -119,11 +118,11 @@ extern void Platform_OSFree (address addr); // Assertions and Halts -extern void Platform_Halt(LONGINT x); -extern void Platform_AssertFail(LONGINT x); +extern void Platform_Halt(int32 x); +extern void Platform_AssertFail(int32 x); #define __HALT(x) Platform_Halt(x) -#define __ASSERT(cond, x) if (!(cond)) Platform_AssertFail((LONGINT)(x)) +#define __ASSERT(cond, x) if (!(cond)) Platform_AssertFail((int32)(x)) // Index checking @@ -136,7 +135,7 @@ static inline int64 __XF(uint64 i, uint64 ub) {if (i >= ub) {__HALT(-2);} return static inline int64 __RF(uint64 i, uint64 ub) {if (i >= ub) {__HALT(-8);} return i;} #define __R(i, ub) (((i)<(ub))?i:(__HALT(-8),0)) -#define __SHORT(x, ub) ((int)((uLONGINT)(x)+(ub)<(ub)+(ub)?(x):(__HALT(-8),0))) +#define __SHORT(x, ub) ((int)((uint64)(x)+(ub)<(ub)+(ub)?(x):(__HALT(-8),0))) #define __SHORTF(x, ub) ((int)(__RF((x)+(ub),(ub)+(ub))-(ub))) #define __CHR(x) ((CHAR)__R(x, 256)) #define __CHRF(x) ((CHAR)__RF(x, 256)) @@ -157,7 +156,7 @@ static inline int64 __RF(uint64 i, uint64 ub) {if (i >= ub) {__HALT(-8);} return // String comparison static inline int __str_cmp(CHAR *x, CHAR *y){ - LONGINT i = 0; + int64 i = 0; CHAR ch1, ch2; do {ch1 = x[i]; ch2 = y[i]; i++; if (!ch1) return -(int)ch2; @@ -212,7 +211,7 @@ extern int64 SYSTEM_MOD(int64 x, int64 y); #define __MOD(x, y) (((x)>0 && (y)>0) ? (x)%(y) : __MODF(x, y)) -extern LONGINT SYSTEM_ENTIER (double x); +extern int64 SYSTEM_ENTIER (double x); #define __ENTIER(x) SYSTEM_ENTIER(x) @@ -275,10 +274,10 @@ extern void Heap_INCREF(); // Main module initialisation, registration and finalisation -extern void Platform_Init(INTEGER argc, address argv); +extern void Platform_Init(int32 argc, address argv); extern void Heap_FINALL(); -#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (address)&argv); +#define __INIT(argc, argv) static void *m; Platform_Init(argc, (address)&argv); #define __REGMAIN(name, enum) m = Heap_REGMOD((CHAR*)name,enum) #define __FINI Heap_FINALL(); return 0 @@ -287,7 +286,7 @@ extern void Heap_FINALL(); extern SYSTEM_PTR Heap_NEWBLK (address size); extern SYSTEM_PTR Heap_NEWREC (address tag); -extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); +extern SYSTEM_PTR SYSTEM_NEWARR(address*, address, int, int, int, ...); #define __SYSNEW(p, len) p = Heap_NEWBLK((address)(len)) #define __NEW(p, t) p = Heap_NEWREC((address)t##__typ) diff --git a/src/test/confidence/signal/signal.mod b/src/test/confidence/signal/signal.mod index c7b58a48..3a897392 100644 --- a/src/test/confidence/signal/signal.mod +++ b/src/test/confidence/signal/signal.mod @@ -1,6 +1,6 @@ (* Test that interrupt and quit are handled correctly. *) MODULE SignalTest; -IMPORT Console, Platform, Files; +IMPORT Console, Platform, Files, SYSTEM; VAR result: Files.File; rider: Files.Rider; @@ -24,7 +24,7 @@ BEGIN END wi; -PROCEDURE handle(signal: INTEGER); +PROCEDURE handle(signal: SYSTEM.INT32); BEGIN Console.Ln; Console.String("Signal: "); Console.Int(signal,1); Console.Ln; ws("Signal "); wi(signal); wl; diff --git a/src/tools/make/configure.c b/src/tools/make/configure.c index d3ccc2d1..695fa0e2 100644 --- a/src/tools/make/configure.c +++ b/src/tools/make/configure.c @@ -220,9 +220,9 @@ void determineBuildDate() { struct {char ch; CHAR x;} c; struct {char ch; BOOLEAN x;} b; //struct {char ch; SHORTINT x;} si; -struct {char ch; INTEGER x;} i; -struct {char ch; LONGINT x;} li; -struct {char ch; SET x;} s; +//struct {char ch; INTEGER x;} i; +//struct {char ch; LONGINT x;} li; +//struct {char ch; SET x;} s; struct {char ch; REAL x;} r; struct {char ch; LONGREAL x;} lr; struct {char ch; void* x;} p; @@ -254,9 +254,9 @@ void ReportSizesAndAlignments() { printf("CHAR %4zd %4td\n", sizeof(CHAR), (char*)&c.x - (char*)&c); printf("BOOLEAN %4zd %4td\n", sizeof(BOOLEAN), (char*)&b.x - (char*)&b); //printf("SHORTINT %4zd %4td\n", sizeof(SHORTINT), (char*)&si.x - (char*)&si); - printf("INTEGER %4zd %4td\n", sizeof(INTEGER), (char*)&i.x - (char*)&i); - printf("LONGINT %4zd %4td\n", sizeof(LONGINT), (char*)&li.x - (char*)&li); - printf("SET %4zd %4td\n", sizeof(SET), (char*)&s.x - (char*)&s); +//printf("INTEGER %4zd %4td\n", sizeof(INTEGER), (char*)&i.x - (char*)&i); +//printf("LONGINT %4zd %4td\n", sizeof(LONGINT), (char*)&li.x - (char*)&li); +//printf("SET %4zd %4td\n", sizeof(SET), (char*)&s.x - (char*)&s); printf("REAL %4zd %4td\n", sizeof(REAL), (char*)&r.x - (char*)&r); printf("LONGREAL %4zd %4td\n", sizeof(LONGREAL), (char*)&lr.x - (char*)&lr); printf("void* %4zd %4td\n", sizeof(void*), (char*)&p.x - (char*)&p); @@ -318,11 +318,14 @@ void testSystemDotH() { /* test the __SETRNG macro */ long x = 0; - long y = sizeof(SET)*8 - 1; - if (sizeof(SET) == 4) - assert(__SETRNG(x, y, 32) == -1, "SETRNG(0, MAX(SET)) != -1."); - else - assert(__SETRNG(x, y, 64) == -1, "SETRNG(0, MAX(SET)) != -1."); + long y; + y=31; assert(__SETRNG(x, y, 32) == -1, "SETRNG(0, MAX(SET), 32) != -1."); + y=63; assert(__SETRNG(x, y, 64) == -1, "SETRNG(0, MAX(SET), 32) != -1."); +// long y = sizeof(SET)*8 - 1; +// if (sizeof(SET) == 4) +// assert(__SETRNG(x, y, 32) == -1, "SETRNG(0, MAX(SET)) != -1."); +// else +// assert(__SETRNG(x, y, 64) == -1, "SETRNG(0, MAX(SET)) != -1."); /* test string comparison for extended ascii */ {char a[10], b[10]; @@ -337,11 +340,11 @@ void testSystemDotH() { assert(sizeof(CHAR) == 1, "Size of CHAR not 1."); assert(sizeof(BOOLEAN) == 1, "Size of BOOLEAN not 1."); //assert(sizeof(SHORTINT) == 1, "Size of SHORTINT not 1."); - assert(sizeof(INTEGER) == 2 - || sizeof(INTEGER) == 4, "Size of INTEGER neither 2 nor 4 bytes."); - assert(sizeof(LONGINT) == 4 - || sizeof(LONGINT) == 8, "Size of LONGINT neither 4 nor 8 bytes."); - assert(sizeof(SET) == sizeof(LONGINT), "Size of SET differs from size of LONGINT."); +//assert(sizeof(INTEGER) == 2 +// || sizeof(INTEGER) == 4, "Size of INTEGER neither 2 nor 4 bytes."); +//assert(sizeof(LONGINT) == 4 +// || sizeof(LONGINT) == 8, "Size of LONGINT neither 4 nor 8 bytes."); +//assert(sizeof(SET) == sizeof(LONGINT), "Size of SET differs from size of LONGINT."); assert(sizeof(REAL) == 4, "Size of REAL not 4 bytes."); assert(sizeof(LONGREAL) == 8, "Size of LONGREAL not 8 bytes."); assert(sizeof(f.x) == sizeof(p.x), "Size of function pointer differs from size of data pointer."); @@ -351,10 +354,10 @@ void testSystemDotH() { assert(((char*)&c.x - (char*)&c) == 1, "Alignment of CHAR not 1."); assert(((char*)&b.x - (char*)&b) == 1, "Alignment of BOOLEAN not 1."); //assert(((char*)&si.x - (char*)&si) == 1, "Alignment of SHORTINT not 1."); - //assert(((char*)&i.x - (char*)&i) == 4, "Alignment of INTEGER not 4 bytes."); +//assert(((char*)&i.x - (char*)&i) == 4, "Alignment of INTEGER not 4 bytes."); assert(((char*)&r.x - (char*)&r) == 4, "Alignment of REAL not 4 bytes."); assert(((char*)&lr.x - (char*)&lr) >= 4, "Alignment of LONGREAL less than 4 bytes."); - assert(((char*)&s.x - (char*)&s) == MIN(alignment, sizeof(SET)), "Alignment of SET differs from alignmnet of LONGINT."); +//assert(((char*)&s.x - (char*)&s) == MIN(alignment, sizeof(SET)), "Alignment of SET differs from alignmnet of LONGINT."); assert(((char*)&p.x - (char*)&p) == addressSize, "Alignment of data pointer differs from address size."); assert(((char*)&f.x - (char*)&f) == addressSize, "Alignment of data pointer differs from address size."); assert(((char*)&lr.x - (char*)&lr) == ((char*)&ll.x - (char*)&ll), "Alignment of LONGREAL differs from alignment of long long."); @@ -362,8 +365,8 @@ void testSystemDotH() { assert(sizeof(rec0) == 1, "CHAR wrapped in record aligns differently to CHAR alone."); assert(sizeof(rec2) == 65, "CHAR array wrapped in record aligns differently to CHAR array alone."); - assert(sizeof(LONGINT) >= sizeof(p.x), "LONGINT should have at least the same size as data pointers."); - assert(sizeof(LONGINT) >= sizeof(f.x), "LONGINT should have at least the same size as function pointers."); +//assert(sizeof(LONGINT) >= sizeof(p.x), "LONGINT should have at least the same size as data pointers."); +//assert(sizeof(LONGINT) >= sizeof(f.x), "LONGINT should have at least the same size as function pointers."); if (((sizeof(rec2)==65) == (sizeof(rec0)==1)) && ((sizeof(rec2)-64) != sizeof(rec0))) printf("error: unsupported record layout sizeof(rec0) = %lu sizeof(rec2) = %lu\n", (long)sizeof(rec0), (long)sizeof(rec2)); From a4ca50f71f749206ba007727b91043d74fbba2dc Mon Sep 17 00:00:00 2001 From: David Brown Date: Sat, 15 Oct 2016 21:29:20 +0100 Subject: [PATCH 284/580] Fix case of VT100 in make file. --- src/tools/make/oberon.mk | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/tools/make/oberon.mk b/src/tools/make/oberon.mk index 8e581356..cd4745d8 100644 --- a/src/tools/make/oberon.mk +++ b/src/tools/make/oberon.mk @@ -61,13 +61,13 @@ assemble: cd $(BUILDDIR) && $(COMPILE) -c SYSTEM.c Configuration.c Platform.c Heap.c cd $(BUILDDIR) && $(COMPILE) -c Out.c Strings.c Modules.c Files.c - cd $(BUILDDIR) && $(COMPILE) -c Reals.c Texts.c vt100.c errors.c + cd $(BUILDDIR) && $(COMPILE) -c Reals.c Texts.c VT100.c errors.c cd $(BUILDDIR) && $(COMPILE) -c OPM.c extTools.c OPS.c OPT.c cd $(BUILDDIR) && $(COMPILE) -c OPC.c OPV.c OPB.c OPP.c cd $(BUILDDIR) && $(COMPILE) $(STATICLINK) Compiler.c -o $(ROOTDIR)/$(OBECOMP) \ SYSTEM.o Configuration.o Platform.o Heap.o Out.o Strings.o Modules.o Files.o \ - Reals.o Texts.o vt100.o errors.o OPM.o extTools.o OPS.o OPT.o \ + Reals.o Texts.o VT100.o errors.o OPM.o extTools.o OPS.o OPT.o \ OPC.o OPV.o OPB.o OPP.o cp src/runtime/*.[ch] $(BUILDDIR) @@ -132,7 +132,7 @@ browsercmd: @cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -fSm -O$(MODEL) ../../src/tools/browser/BrowserCmd.Mod @cd $(BUILDDIR); $(COMPILE) BrowserCmd.c -o showdef \ Platform.o Texts.o OPT.o Heap.o Out.o SYSTEM.o OPM.o OPS.o OPV.o \ - Files.o Reals.o Modules.o vt100.o errors.o Configuration.o Strings.o \ + Files.o Reals.o Modules.o VT100.o errors.o Configuration.o Strings.o \ OPC.o From 531e9e090c5e612c27ecc17664f115fb6124f587 Mon Sep 17 00:00:00 2001 From: David Brown Date: Sat, 15 Oct 2016 22:57:48 +0100 Subject: [PATCH 285/580] Oops. Another VT100 file case change. --- src/runtime/{vt100.Mod => VT100.Mod} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/runtime/{vt100.Mod => VT100.Mod} (100%) diff --git a/src/runtime/vt100.Mod b/src/runtime/VT100.Mod similarity index 100% rename from src/runtime/vt100.Mod rename to src/runtime/VT100.Mod From a10c530f98b42395f2c434cab491bcf5bc302b60 Mon Sep 17 00:00:00 2001 From: David Brown Date: Sun, 16 Oct 2016 12:38:32 +0100 Subject: [PATCH 286/580] Trigger rebuild. --- src/tools/make/oberon.mk | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/tools/make/oberon.mk b/src/tools/make/oberon.mk index cd4745d8..dd752faf 100644 --- a/src/tools/make/oberon.mk +++ b/src/tools/make/oberon.mk @@ -353,16 +353,6 @@ s3: cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/s3/ethStrings.Mod -# O2library: v4 ooc2 ooc ulm pow32 misc s3 runtime -# @printf "\nMaking lib$(ONAME)2\n" -# rm -f $(BUILDDIR)/Compiler.o -# # Note: remining compiler files are retained in the library allowing the building -# # of utilities like BrowserCmd.Mod (aka showdef). -# # Make static library -# ar rcs "$(BUILDDIR)/lib$(ONAME)2.a" $(BUILDDIR)/*.o -# # Make shared library -# @cd $(BUILDDIR) && $(COMPILE) -shared -o lib$(ONAME)2.so *.o - O2library: runtime v4 ooc2 ooc ulm pow32 misc s3 From eda7e88185ece558110a52a7d42f0f39ec306232 Mon Sep 17 00:00:00 2001 From: David Brown Date: Sun, 16 Oct 2016 15:21:32 +0100 Subject: [PATCH 287/580] Add test for Math and MathL modules. --- src/runtime/MathL.Mod | 4 +- src/test/confidence/math/expected | 351 ++++++++++++++++++++++ src/test/confidence/math/mathtest.mod | 145 +++++++++ src/test/confidence/math/test.sh | 5 + src/test/confidence/planned-binary-change | 2 +- src/tools/make/oberon.mk | 3 +- 6 files changed, 506 insertions(+), 4 deletions(-) create mode 100644 src/test/confidence/math/expected create mode 100644 src/test/confidence/math/mathtest.mod create mode 100644 src/test/confidence/math/test.sh diff --git a/src/runtime/MathL.Mod b/src/runtime/MathL.Mod index 3b26e498..bd17b490 100644 --- a/src/runtime/MathL.Mod +++ b/src/runtime/MathL.Mod @@ -114,10 +114,10 @@ VAR LnSmall: LONGREAL; (* natural log of very small number *) SqrtInfinity: LONGREAL; (* square root of infinity *) TanhMax: LONGREAL; (* maximum Tanh value *) - t: LONGREAL; (* internal variables *) NumberMask: SYSTEM.SET64; (* Sign and significand, {0..51, 63} *) ExponentMask: SYSTEM.SET64; (* Exponent part, {53..62} *) ZeroExponent: SYSTEM.SET64; (* Zero valued exponent {54..61} *) + t: LONGREAL; (* internal variables *) i: INTEGER; (* For initialisation loops in module body. *) @@ -675,7 +675,7 @@ BEGIN FOR i := 0 TO 51 DO INCL(NumberMask, i) END; ExponentMask := -NumberMask; ZeroExponent := {}; - FOR i := 54 TO 61 DO INCL(ZeroExponent, i) END; + FOR i := 53 TO 61 DO INCL(ZeroExponent, i) END; (* determine some fundamental constants used by hyperbolic trig functions *) em := ulp(ONE); diff --git a/src/test/confidence/math/expected b/src/test/confidence/math/expected new file mode 100644 index 00000000..f20dccd8 --- /dev/null +++ b/src/test/confidence/math/expected @@ -0,0 +1,351 @@ +Math and MathL module tests. + +Math.fraction(8.99999976E-01): 1.79999995E+00. MathL.fraction(9.0000000000000000D-001): 1.8000000000000000D+000 +Math.fraction(1.00000000E+00): 1.00000000E+00. MathL.fraction(1.0000000000000000D+000): 1.0000000000000000D+000 +Math.fraction(1.39999998E+00): 1.39999998E+00. MathL.fraction(1.4000000000000000D+000): 1.4000000000000000D+000 +Math.fraction(1.50000000E+00): 1.50000000E+00. MathL.fraction(1.5000000000000000D+000): 1.5000000000000000D+000 +Math.fraction(1.60000002E+00): 1.60000002E+00. MathL.fraction(1.6000000000000000D+000): 1.6000000000000000D+000 +Math.fraction(1.89999998E+00): 1.89999998E+00. MathL.fraction(1.9000000000000000D+000): 1.9000000000000000D+000 +Math.fraction(2.00000000E+00): 1.00000000E+00. MathL.fraction(2.0000000000000000D+000): 1.0000000000000000D+000 +Math.fraction(2.40000010E+00): 1.20000005E+00. MathL.fraction(2.4000000000000000D+000): 1.2000000000000000D+000 +Math.fraction(2.50000000E+00): 1.25000000E+00. MathL.fraction(2.5000000000000000D+000): 1.2500000000000000D+000 +Math.fraction(3.00000000E+00): 1.50000000E+00. MathL.fraction(3.0000000000000000D+000): 1.5000000000000000D+000 +Math.fraction(4.00000000E+00): 1.00000000E+00. MathL.fraction(4.0000000000000000D+000): 1.0000000000000000D+000 +Math.fraction(-8.9999998E-01): -1.8000000E+00. MathL.fraction(-9.000000000000000D-001): -1.800000000000000D+000 +Math.fraction(-1.0000000E+00): -1.0000000E+00. MathL.fraction(-1.000000000000000D+000): -1.000000000000000D+000 +Math.fraction(-1.4000000E+00): -1.4000000E+00. MathL.fraction(-1.400000000000000D+000): -1.400000000000000D+000 +Math.fraction(-1.5000000E+00): -1.5000000E+00. MathL.fraction(-1.500000000000000D+000): -1.500000000000000D+000 +Math.fraction(-1.6000000E+00): -1.6000000E+00. MathL.fraction(-1.600000000000000D+000): -1.600000000000000D+000 +Math.fraction(-1.9000000E+00): -1.9000000E+00. MathL.fraction(-1.900000000000000D+000): -1.900000000000000D+000 +Math.fraction(-2.0000000E+00): -1.0000000E+00. MathL.fraction(-2.000000000000000D+000): -1.000000000000000D+000 +Math.fraction(-2.4000001E+00): -1.2000000E+00. MathL.fraction(-2.400000000000000D+000): -1.200000000000000D+000 +Math.fraction(-2.5000000E+00): -1.2500000E+00. MathL.fraction(-2.500000000000000D+000): -1.250000000000000D+000 +Math.fraction(-3.0000000E+00): -1.5000000E+00. MathL.fraction(-3.000000000000000D+000): -1.500000000000000D+000 +Math.fraction(-4.0000000E+00): -1.0000000E+00. MathL.fraction(-4.000000000000000D+000): -1.000000000000000D+000 + +Math.round(8.99999976E-01): 1. MathL.round(9.0000000000000000D-001): 1 +Math.round(1.00000000E+00): 1. MathL.round(1.0000000000000000D+000): 1 +Math.round(1.39999998E+00): 1. MathL.round(1.4000000000000000D+000): 1 +Math.round(1.50000000E+00): 2. MathL.round(1.5000000000000000D+000): 2 +Math.round(1.60000002E+00): 2. MathL.round(1.6000000000000000D+000): 2 +Math.round(1.89999998E+00): 2. MathL.round(1.9000000000000000D+000): 2 +Math.round(2.00000000E+00): 2. MathL.round(2.0000000000000000D+000): 2 +Math.round(2.40000010E+00): 2. MathL.round(2.4000000000000000D+000): 2 +Math.round(2.50000000E+00): 3. MathL.round(2.5000000000000000D+000): 3 +Math.round(3.00000000E+00): 3. MathL.round(3.0000000000000000D+000): 3 +Math.round(4.00000000E+00): 4. MathL.round(4.0000000000000000D+000): 4 +Math.round(-8.9999998E-01): -1. MathL.round(-9.000000000000000D-001): -1 +Math.round(-1.0000000E+00): -1. MathL.round(-1.000000000000000D+000): -1 +Math.round(-1.4000000E+00): -1. MathL.round(-1.400000000000000D+000): -1 +Math.round(-1.5000000E+00): -2. MathL.round(-1.500000000000000D+000): -2 +Math.round(-1.6000000E+00): -2. MathL.round(-1.600000000000000D+000): -2 +Math.round(-1.9000000E+00): -2. MathL.round(-1.900000000000000D+000): -2 +Math.round(-2.0000000E+00): -2. MathL.round(-2.000000000000000D+000): -2 +Math.round(-2.4000001E+00): -2. MathL.round(-2.400000000000000D+000): -2 +Math.round(-2.5000000E+00): -3. MathL.round(-2.500000000000000D+000): -3 +Math.round(-3.0000000E+00): -3. MathL.round(-3.000000000000000D+000): -3 +Math.round(-4.0000000E+00): -4. MathL.round(-4.000000000000000D+000): -4 + +Math.sqrt(8.99999976E-01): 9.48683262E-01. MathL.sqrt(9.0000000000000000D-001): 9.4868329805051376D-001 +Math.sqrt(1.00000000E+00): 9.99999940E-01. MathL.sqrt(1.0000000000000000D+000): 1.0000000000000006D+000 +Math.sqrt(1.39999998E+00): 1.18321598E+00. MathL.sqrt(1.4000000000000000D+000): 1.1832159566199240D+000 +Math.sqrt(1.50000000E+00): 1.22474480E+00. MathL.sqrt(1.5000000000000000D+000): 1.2247448713915898D+000 +Math.sqrt(1.60000002E+00): 1.26491106E+00. MathL.sqrt(1.6000000000000000D+000): 1.2649110640673526D+000 +Math.sqrt(1.89999998E+00): 1.37840486E+00. MathL.sqrt(1.9000000000000000D+000): 1.3784048752090230D+000 +Math.sqrt(2.00000000E+00): 1.41421354E+00. MathL.sqrt(2.0000000000000000D+000): 1.4142135623730952D+000 +Math.sqrt(2.40000010E+00): 1.54919338E+00. MathL.sqrt(2.4000000000000000D+000): 1.5491933384829668D+000 +Math.sqrt(2.50000000E+00): 1.58113885E+00. MathL.sqrt(2.5000000000000000D+000): 1.5811388300841898D+000 +Math.sqrt(3.00000000E+00): 1.73205078E+00. MathL.sqrt(3.0000000000000000D+000): 1.7320508075688772D+000 +Math.sqrt(4.00000000E+00): 1.99999988E+00. MathL.sqrt(4.0000000000000000D+000): 2.0000000000000012D+000 +Math.sqrt(-8.9999998E-01): 9.48683262E-01. MathL.sqrt(-9.000000000000000D-001): 9.4868329805051376D-001 +Math.sqrt(-1.0000000E+00): 9.99999940E-01. MathL.sqrt(-1.000000000000000D+000): 1.0000000000000006D+000 +Math.sqrt(-1.4000000E+00): 1.18321598E+00. MathL.sqrt(-1.400000000000000D+000): 1.1832159566199240D+000 +Math.sqrt(-1.5000000E+00): 1.22474480E+00. MathL.sqrt(-1.500000000000000D+000): 1.2247448713915898D+000 +Math.sqrt(-1.6000000E+00): 1.26491106E+00. MathL.sqrt(-1.600000000000000D+000): 1.2649110640673526D+000 +Math.sqrt(-1.9000000E+00): 1.37840486E+00. MathL.sqrt(-1.900000000000000D+000): 1.3784048752090230D+000 +Math.sqrt(-2.0000000E+00): 1.41421354E+00. MathL.sqrt(-2.000000000000000D+000): 1.4142135623730952D+000 +Math.sqrt(-2.4000001E+00): 1.54919338E+00. MathL.sqrt(-2.400000000000000D+000): 1.5491933384829668D+000 +Math.sqrt(-2.5000000E+00): 1.58113885E+00. MathL.sqrt(-2.500000000000000D+000): 1.5811388300841898D+000 +Math.sqrt(-3.0000000E+00): 1.73205078E+00. MathL.sqrt(-3.000000000000000D+000): 1.7320508075688772D+000 +Math.sqrt(-4.0000000E+00): 1.99999988E+00. MathL.sqrt(-4.000000000000000D+000): 2.0000000000000012D+000 + +Math.exp(8.99999976E-01): 2.45960307E+00. MathL.exp(9.0000000000000000D-001): 2.4596031111569500D+000 +Math.exp(1.00000000E+00): 2.71828175E+00. MathL.exp(1.0000000000000000D+000): 2.7182818284590456D+000 +Math.exp(1.39999998E+00): 4.05520010E+00. MathL.exp(1.4000000000000000D+000): 4.0551999668446744D+000 +Math.exp(1.50000000E+00): 4.48168898E+00. MathL.exp(1.5000000000000000D+000): 4.4816890703380648D+000 +Math.exp(1.60000002E+00): 4.95303249E+00. MathL.exp(1.6000000000000000D+000): 4.9530324243951152D+000 +Math.exp(1.89999998E+00): 6.68589401E+00. MathL.exp(1.9000000000000000D+000): 6.6858944422792688D+000 +Math.exp(2.00000000E+00): 7.38905621E+00. MathL.exp(2.0000000000000000D+000): 7.3890560989306512D+000 +Math.exp(2.40000010E+00): 1.10231771E+01. MathL.exp(2.4000000000000000D+000): 1.1023176380641602D+001 +Math.exp(2.50000000E+00): 1.21824942E+01. MathL.exp(2.5000000000000000D+000): 1.2182493960703474D+001 +Math.exp(3.00000000E+00): 2.00855370E+01. MathL.exp(3.0000000000000000D+000): 2.0085536923187668D+001 +Math.exp(4.00000000E+00): 5.45981522E+01. MathL.exp(4.0000000000000000D+000): 5.4598150033144232D+001 +Math.exp(-8.9999998E-01): 4.06569660E-01. MathL.exp(-9.000000000000000D-001): 4.0656965974060152D-001 +Math.exp(-1.0000000E+00): 3.67879450E-01. MathL.exp(-1.000000000000000D+000): 3.6787944117144232D-001 +Math.exp(-1.4000000E+00): 2.46596977E-01. MathL.exp(-1.400000000000000D+000): 2.4659696394176248D-001 +Math.exp(-1.5000000E+00): 2.23130152E-01. MathL.exp(-1.500000000000000D+000): 2.2313016014844684D-001 +Math.exp(-1.6000000E+00): 2.01896518E-01. MathL.exp(-1.600000000000000D+000): 2.0189651799465632D-001 +Math.exp(-1.9000000E+00): 1.49568617E-01. MathL.exp(-1.900000000000000D+000): 1.4956861922474082D-001 +Math.exp(-2.0000000E+00): 1.35335281E-01. MathL.exp(-2.000000000000000D+000): 1.3533528323704446D-001 +Math.exp(-2.4000001E+00): 9.07179415E-02. MathL.exp(-2.400000000000000D+000): 9.0717953289412512D-002 +Math.exp(-2.5000000E+00): 8.20849985E-02. MathL.exp(-2.500000000000000D+000): 8.2084998627778512D-002 +Math.exp(-3.0000000E+00): 4.97870669E-02. MathL.exp(-3.000000000000000D+000): 4.9787068367864088D-002 +Math.exp(-4.0000000E+00): 1.83156393E-02. MathL.exp(-4.000000000000000D+000): 1.8315638888927552D-002 + +Math.ln(8.99999976E-01): -1.0536054E-01. MathL.ln(9.0000000000000000D-001): -1.053605156578263D-001 +Math.ln(1.00000000E+00): 0.00000000E+00. MathL.ln(1.0000000000000000D+000): 0.0000000000000000D+000 +Math.ln(1.39999998E+00): 3.36472213E-01. MathL.ln(1.4000000000000000D+000): 3.3647223662121288D-001 +Math.ln(1.50000000E+00): 4.05465096E-01. MathL.ln(1.5000000000000000D+000): 4.0546510810816440D-001 +Math.ln(1.60000002E+00): 4.70003664E-01. MathL.ln(1.6000000000000000D+000): 4.7000362924573560D-001 +Math.ln(1.89999998E+00): 6.41853869E-01. MathL.ln(1.9000000000000000D+000): 6.4185388617239472D-001 +Math.ln(2.00000000E+00): 6.93147182E-01. MathL.ln(2.0000000000000000D+000): 6.9314718055994528D-001 +Math.ln(2.40000010E+00): 8.75468791E-01. MathL.ln(2.4000000000000000D+000): 8.7546873735390000D-001 +Math.ln(2.50000000E+00): 9.16290760E-01. MathL.ln(2.5000000000000000D+000): 9.1629073187415488D-001 +Math.ln(3.00000000E+00): 1.09861231E+00. MathL.ln(3.0000000000000000D+000): 1.0986122886681098D+000 +Math.ln(4.00000000E+00): 1.38629436E+00. MathL.ln(4.0000000000000000D+000): 1.3862943611198906D+000 +Math.ln(-8.9999998E-01): -3.4028235E+38. MathL.ln(-9.000000000000000D-001): -1.797692963420939D+308 +Math.ln(-1.0000000E+00): -3.4028235E+38. MathL.ln(-1.000000000000000D+000): -1.797692963420939D+308 +Math.ln(-1.4000000E+00): -3.4028235E+38. MathL.ln(-1.400000000000000D+000): -1.797692963420939D+308 +Math.ln(-1.5000000E+00): -3.4028235E+38. MathL.ln(-1.500000000000000D+000): -1.797692963420939D+308 +Math.ln(-1.6000000E+00): -3.4028235E+38. MathL.ln(-1.600000000000000D+000): -1.797692963420939D+308 +Math.ln(-1.9000000E+00): -3.4028235E+38. MathL.ln(-1.900000000000000D+000): -1.797692963420939D+308 +Math.ln(-2.0000000E+00): -3.4028235E+38. MathL.ln(-2.000000000000000D+000): -1.797692963420939D+308 +Math.ln(-2.4000001E+00): -3.4028235E+38. MathL.ln(-2.400000000000000D+000): -1.797692963420939D+308 +Math.ln(-2.5000000E+00): -3.4028235E+38. MathL.ln(-2.500000000000000D+000): -1.797692963420939D+308 +Math.ln(-3.0000000E+00): -3.4028235E+38. MathL.ln(-3.000000000000000D+000): -1.797692963420939D+308 +Math.ln(-4.0000000E+00): -3.4028235E+38. MathL.ln(-4.000000000000000D+000): -1.797692963420939D+308 + +Math.sin(0.00000000E+00): 0.00000000E+00. MathL.sin(0.0000000000000000D+000): 0.0000000000000000D+000 +Math.sin(1.00000001E-01): 9.98334214E-02. MathL.sin(1.0000000000000000D-001): 9.9833416646828144D-002 +Math.sin(1.04719758E+00): 8.66025388E-01. MathL.sin(1.0471975511966000D+000): 8.6602540378443952D-001 +Math.sin(1.57079637E+00): 1.00000000E+00. MathL.sin(1.5707963267949002D+000): 9.9999999999999872D-001 +Math.sin(3.14159274E+00): -3.1086245E-15. MathL.sin(3.1415926535897900D+000): 3.2310867983985708D-015 +Math.sin(-1.0471976E+00): -8.6602539E-01. MathL.sin(-1.047197551196600D+000): -8.660254037844394D-001 +Math.sin(-1.5707964E+00): -1.0000000E+00. MathL.sin(-1.570796326794900D+000): -9.999999999999988D-001 +Math.sin(-3.1415927E+00): 3.10862447E-15. MathL.sin(-3.141592653589790D+000): -3.231086798398571D-015 + +Math.cos(0.00000000E+00): 1.00000000E+00. MathL.cos(0.0000000000000000D+000): 9.9999999999999856D-001 +Math.cos(1.00000001E-01): 9.95004177E-01. MathL.cos(1.0000000000000000D-001): 9.9500416527802480D-001 +Math.cos(1.04719758E+00): 5.00000000E-01. MathL.cos(1.0471975511966000D+000): 4.9999999999999808D-001 +Math.cos(1.57079637E+00): -1.5543122E-15. MathL.cos(1.5707963267949002D+000): -3.491482514076435D-015 +Math.cos(3.14159274E+00): -1.0000000E+00. MathL.cos(3.1415926535897900D+000): -9.999999999999988D-001 +Math.cos(-1.0471976E+00): 5.00000000E-01. MathL.cos(-1.047197551196600D+000): 4.9999999999999808D-001 +Math.cos(-1.5707964E+00): -1.5543122E-15. MathL.cos(-1.570796326794900D+000): -3.491482514076435D-015 +Math.cos(-3.1415927E+00): -1.0000000E+00. MathL.cos(-3.141592653589790D+000): -9.999999999999988D-001 + +Math.tan(0.00000000E+00): 0.00000000E+00. MathL.tan(0.0000000000000000D+000): 0.0000000000000000D+000 +Math.tan(1.00000001E-01): 1.00334682E-01. MathL.tan(1.0000000000000000D-001): 1.0033467208545054D-001 +Math.tan(1.04719758E+00): 1.73205066E+00. MathL.tan(1.0471975511966000D+000): 1.7320508075688840D+000 +Math.tan(1.57079637E+00): 3.00239991E+14. MathL.tan(1.5707963267949002D+000): 2.0234083817726248D+007 +Math.tan(3.14159274E+00): -6.6613381E-15. MathL.tan(3.1415926535897900D+000): 3.2310867983985684D-015 +Math.tan(-1.0471976E+00): -1.7320507E+00. MathL.tan(-1.047197551196600D+000): -1.732050807568884D+000 +Math.tan(-1.5707964E+00): -3.0023999E+14. MathL.tan(-1.570796326794900D+000): -2.023408381772625D+007 +Math.tan(-3.1415927E+00): 6.66133815E-15. MathL.tan(-3.141592653589790D+000): -3.231086798398569D-015 + +Math.arcsin(8.99999976E-01): -4.5102686E-01. MathL.arcsin(9.0000000000000000D-001): 1.1197695149986360D+000 +Math.arcsin(1.00000000E+00): -0.0000000E+00. MathL.arcsin(1.0000000000000000D+000): 1.5707963267949002D+000 +Math.arcsin(1.39999998E+00): 3.40282347E+38. MathL.arcsin(1.4000000000000000D+000): 1.7976929634209390D+308 +Math.arcsin(1.50000000E+00): 3.40282347E+38. MathL.arcsin(1.5000000000000000D+000): 1.7976929634209390D+308 +Math.arcsin(1.60000002E+00): 3.40282347E+38. MathL.arcsin(1.6000000000000000D+000): 1.7976929634209390D+308 +Math.arcsin(1.89999998E+00): 3.40282347E+38. MathL.arcsin(1.9000000000000000D+000): 1.7976929634209390D+308 +Math.arcsin(2.00000000E+00): 3.40282347E+38. MathL.arcsin(2.0000000000000000D+000): 1.7976929634209390D+308 +Math.arcsin(2.40000010E+00): 3.40282347E+38. MathL.arcsin(2.4000000000000000D+000): 1.7976929634209390D+308 +Math.arcsin(2.50000000E+00): 3.40282347E+38. MathL.arcsin(2.5000000000000000D+000): 1.7976929634209390D+308 +Math.arcsin(3.00000000E+00): 3.40282347E+38. MathL.arcsin(3.0000000000000000D+000): 1.7976929634209390D+308 +Math.arcsin(4.00000000E+00): 3.40282347E+38. MathL.arcsin(4.0000000000000000D+000): 1.7976929634209390D+308 +Math.arcsin(-8.9999998E-01): -4.5102686E-01. MathL.arcsin(-9.000000000000000D-001): -1.119769514998636D+000 +Math.arcsin(-1.0000000E+00): -0.0000000E+00. MathL.arcsin(-1.000000000000000D+000): -1.570796326794900D+000 +Math.arcsin(-1.4000000E+00): 3.40282347E+38. MathL.arcsin(-1.400000000000000D+000): 1.7976929634209390D+308 +Math.arcsin(-1.5000000E+00): 3.40282347E+38. MathL.arcsin(-1.500000000000000D+000): 1.7976929634209390D+308 +Math.arcsin(-1.6000000E+00): 3.40282347E+38. MathL.arcsin(-1.600000000000000D+000): 1.7976929634209390D+308 +Math.arcsin(-1.9000000E+00): 3.40282347E+38. MathL.arcsin(-1.900000000000000D+000): 1.7976929634209390D+308 +Math.arcsin(-2.0000000E+00): 3.40282347E+38. MathL.arcsin(-2.000000000000000D+000): 1.7976929634209390D+308 +Math.arcsin(-2.4000001E+00): 3.40282347E+38. MathL.arcsin(-2.400000000000000D+000): 1.7976929634209390D+308 +Math.arcsin(-2.5000000E+00): 3.40282347E+38. MathL.arcsin(-2.500000000000000D+000): 1.7976929634209390D+308 +Math.arcsin(-3.0000000E+00): 3.40282347E+38. MathL.arcsin(-3.000000000000000D+000): 1.7976929634209390D+308 +Math.arcsin(-4.0000000E+00): 3.40282347E+38. MathL.arcsin(-4.000000000000000D+000): 1.7976929634209390D+308 + +Math.arccos(8.99999976E-01): -4.5102686E-01. MathL.arccos(9.0000000000000000D-001): 4.5102681179626320D-001 +Math.arccos(1.00000000E+00): -0.0000000E+00. MathL.arccos(1.0000000000000000D+000): 0.0000000000000000D+000 +Math.arccos(1.39999998E+00): 3.40282347E+38. MathL.arccos(1.4000000000000000D+000): 1.7976929634209390D+308 +Math.arccos(1.50000000E+00): 3.40282347E+38. MathL.arccos(1.5000000000000000D+000): 1.7976929634209390D+308 +Math.arccos(1.60000002E+00): 3.40282347E+38. MathL.arccos(1.6000000000000000D+000): 1.7976929634209390D+308 +Math.arccos(1.89999998E+00): 3.40282347E+38. MathL.arccos(1.9000000000000000D+000): 1.7976929634209390D+308 +Math.arccos(2.00000000E+00): 3.40282347E+38. MathL.arccos(2.0000000000000000D+000): 1.7976929634209390D+308 +Math.arccos(2.40000010E+00): 3.40282347E+38. MathL.arccos(2.4000000000000000D+000): 1.7976929634209390D+308 +Math.arccos(2.50000000E+00): 3.40282347E+38. MathL.arccos(2.5000000000000000D+000): 1.7976929634209390D+308 +Math.arccos(3.00000000E+00): 3.40282347E+38. MathL.arccos(3.0000000000000000D+000): 1.7976929634209390D+308 +Math.arccos(4.00000000E+00): 3.40282347E+38. MathL.arccos(4.0000000000000000D+000): 1.7976929634209390D+308 +Math.arccos(-8.9999998E-01): -4.5102686E-01. MathL.arccos(-9.000000000000000D-001): 2.6905658417935268D+000 +Math.arccos(-1.0000000E+00): -0.0000000E+00. MathL.arccos(-1.000000000000000D+000): 3.1415926535897900D+000 +Math.arccos(-1.4000000E+00): 3.40282347E+38. MathL.arccos(-1.400000000000000D+000): 1.7976929634209390D+308 +Math.arccos(-1.5000000E+00): 3.40282347E+38. MathL.arccos(-1.500000000000000D+000): 1.7976929634209390D+308 +Math.arccos(-1.6000000E+00): 3.40282347E+38. MathL.arccos(-1.600000000000000D+000): 1.7976929634209390D+308 +Math.arccos(-1.9000000E+00): 3.40282347E+38. MathL.arccos(-1.900000000000000D+000): 1.7976929634209390D+308 +Math.arccos(-2.0000000E+00): 3.40282347E+38. MathL.arccos(-2.000000000000000D+000): 1.7976929634209390D+308 +Math.arccos(-2.4000001E+00): 3.40282347E+38. MathL.arccos(-2.400000000000000D+000): 1.7976929634209390D+308 +Math.arccos(-2.5000000E+00): 3.40282347E+38. MathL.arccos(-2.500000000000000D+000): 1.7976929634209390D+308 +Math.arccos(-3.0000000E+00): 3.40282347E+38. MathL.arccos(-3.000000000000000D+000): 1.7976929634209390D+308 +Math.arccos(-4.0000000E+00): 3.40282347E+38. MathL.arccos(-4.000000000000000D+000): 1.7976929634209390D+308 + +Math.arctan(8.99999976E-01): 7.32815087E-01. MathL.arctan(9.0000000000000000D-001): 7.3281510178650752D-001 +Math.arctan(1.00000000E+00): 7.85398126E-01. MathL.arctan(1.0000000000000000D+000): 7.8539816339744912D-001 +Math.arctan(1.39999998E+00): 9.50546861E-01. MathL.arctan(1.4000000000000000D+000): 9.5054684081207680D-001 +Math.arctan(1.50000000E+00): 9.82793748E-01. MathL.arctan(1.5000000000000000D+000): 9.8279372324733072D-001 +Math.arctan(1.60000002E+00): 1.01219702E+00. MathL.arctan(1.6000000000000000D+000): 1.0121970114513358D+000 +Math.arctan(1.89999998E+00): 1.08631849E+00. MathL.arctan(1.9000000000000000D+000): 1.0863183977578750D+000 +Math.arctan(2.00000000E+00): 1.10714877E+00. MathL.arctan(2.0000000000000000D+000): 1.1071487177940922D+000 +Math.arctan(2.40000010E+00): 1.17600524E+00. MathL.arctan(2.4000000000000000D+000): 1.1760052070951368D+000 +Math.arctan(2.50000000E+00): 1.19028997E+00. MathL.arctan(2.5000000000000000D+000): 1.1902899496825334D+000 +Math.arctan(3.00000000E+00): 1.24904585E+00. MathL.arctan(3.0000000000000000D+000): 1.2490457723982562D+000 +Math.arctan(4.00000000E+00): 1.32581770E+00. MathL.arctan(4.0000000000000000D+000): 1.3258176636680358D+000 +Math.arctan(-8.9999998E-01): -7.3281509E-01. MathL.arctan(-9.000000000000000D-001): -7.328151017865076D-001 +Math.arctan(-1.0000000E+00): -7.8539813E-01. MathL.arctan(-1.000000000000000D+000): -7.853981633974492D-001 +Math.arctan(-1.4000000E+00): -9.5054686E-01. MathL.arctan(-1.400000000000000D+000): -9.505468408120768D-001 +Math.arctan(-1.5000000E+00): -9.8279375E-01. MathL.arctan(-1.500000000000000D+000): -9.827937232473306D-001 +Math.arctan(-1.6000000E+00): -1.0121970E+00. MathL.arctan(-1.600000000000000D+000): -1.012197011451336D+000 +Math.arctan(-1.9000000E+00): -1.0863185E+00. MathL.arctan(-1.900000000000000D+000): -1.086318397757875D+000 +Math.arctan(-2.0000000E+00): -1.1071488E+00. MathL.arctan(-2.000000000000000D+000): -1.107148717794092D+000 +Math.arctan(-2.4000001E+00): -1.1760052E+00. MathL.arctan(-2.400000000000000D+000): -1.176005207095137D+000 +Math.arctan(-2.5000000E+00): -1.1902900E+00. MathL.arctan(-2.500000000000000D+000): -1.190289949682534D+000 +Math.arctan(-3.0000000E+00): -1.2490458E+00. MathL.arctan(-3.000000000000000D+000): -1.249045772398256D+000 +Math.arctan(-4.0000000E+00): -1.3258177E+00. MathL.arctan(-4.000000000000000D+000): -1.325817663668036D+000 + +Math.sinh(8.99999976E-01): 1.02651668E+00. MathL.sinh(9.0000000000000000D-001): 1.0265167257081750D+000 +Math.sinh(1.00000000E+00): 1.17520118E+00. MathL.sinh(1.0000000000000000D+000): 1.1752011936438012D+000 +Math.sinh(1.39999998E+00): 1.90430152E+00. MathL.sinh(1.4000000000000000D+000): 1.9043015014515340D+000 +Math.sinh(1.50000000E+00): 2.12927938E+00. MathL.sinh(1.5000000000000000D+000): 2.1292794550948172D+000 +Math.sinh(1.60000002E+00): 2.37556791E+00. MathL.sinh(1.6000000000000000D+000): 2.3755679532002296D+000 +Math.sinh(1.89999998E+00): 3.26816273E+00. MathL.sinh(1.9000000000000000D+000): 3.2681629115283168D+000 +Math.sinh(2.00000000E+00): 3.62686038E+00. MathL.sinh(2.0000000000000000D+000): 3.6268604078470192D+000 +Math.sinh(2.40000010E+00): 5.46622944E+00. MathL.sinh(2.4000000000000000D+000): 5.4662292136760936D+000 +Math.sinh(2.50000000E+00): 6.05020475E+00. MathL.sinh(2.5000000000000000D+000): 6.0502044810397872D+000 +Math.sinh(3.00000000E+00): 1.00178747E+01. MathL.sinh(3.0000000000000000D+000): 1.0017874927409902D+001 +Math.sinh(4.00000000E+00): 2.72899189E+01. MathL.sinh(4.0000000000000000D+000): 2.7289917197127748D+001 +Math.sinh(-8.9999998E-01): -1.0265167E+00. MathL.sinh(-9.000000000000000D-001): -1.026516725708175D+000 +Math.sinh(-1.0000000E+00): -1.1752012E+00. MathL.sinh(-1.000000000000000D+000): -1.175201193643801D+000 +Math.sinh(-1.4000000E+00): -1.9043015E+00. MathL.sinh(-1.400000000000000D+000): -1.904301501451534D+000 +Math.sinh(-1.5000000E+00): -2.1292794E+00. MathL.sinh(-1.500000000000000D+000): -2.129279455094817D+000 +Math.sinh(-1.6000000E+00): -2.3755679E+00. MathL.sinh(-1.600000000000000D+000): -2.375567953200230D+000 +Math.sinh(-1.9000000E+00): -3.2681627E+00. MathL.sinh(-1.900000000000000D+000): -3.268162911528317D+000 +Math.sinh(-2.0000000E+00): -3.6268604E+00. MathL.sinh(-2.000000000000000D+000): -3.626860407847019D+000 +Math.sinh(-2.4000001E+00): -5.4662294E+00. MathL.sinh(-2.400000000000000D+000): -5.466229213676094D+000 +Math.sinh(-2.5000000E+00): -6.0502048E+00. MathL.sinh(-2.500000000000000D+000): -6.050204481039788D+000 +Math.sinh(-3.0000000E+00): -1.0017875E+01. MathL.sinh(-3.000000000000000D+000): -1.001787492740990D+001 +Math.sinh(-4.0000000E+00): -2.7289919E+01. MathL.sinh(-4.000000000000000D+000): -2.728991719712775D+001 + +Math.cosh(8.99999976E-01): 1.43308640E+00. MathL.cosh(9.0000000000000000D-001): 1.4330863854487746D+000 +Math.cosh(1.00000000E+00): 1.54308057E+00. MathL.cosh(1.0000000000000000D+000): 1.5430806348152440D+000 +Math.cosh(1.39999998E+00): 2.15089846E+00. MathL.cosh(1.4000000000000000D+000): 2.1508984653931408D+000 +Math.cosh(1.50000000E+00): 2.35240960E+00. MathL.cosh(1.5000000000000000D+000): 2.3524096152432472D+000 +Math.cosh(1.60000002E+00): 2.57746458E+00. MathL.cosh(1.6000000000000000D+000): 2.5774644711948852D+000 +Math.cosh(1.89999998E+00): 3.41773129E+00. MathL.cosh(1.9000000000000000D+000): 3.4177315307509520D+000 +Math.cosh(2.00000000E+00): 3.76219583E+00. MathL.cosh(2.0000000000000000D+000): 3.7621956910836312D+000 +Math.cosh(2.40000010E+00): 5.55694771E+00. MathL.cosh(2.4000000000000000D+000): 5.5569471669655072D+000 +Math.cosh(2.50000000E+00): 6.13228941E+00. MathL.cosh(2.5000000000000000D+000): 6.1322894796636856D+000 +Math.cosh(3.00000000E+00): 1.00676622E+01. MathL.cosh(3.0000000000000000D+000): 1.0067661995777766D+001 +Math.cosh(4.00000000E+00): 2.73082333E+01. MathL.cosh(4.0000000000000000D+000): 2.7308232836016488D+001 +Math.cosh(-8.9999998E-01): 1.43308640E+00. MathL.cosh(-9.000000000000000D-001): 1.4330863854487746D+000 +Math.cosh(-1.0000000E+00): 1.54308057E+00. MathL.cosh(-1.000000000000000D+000): 1.5430806348152440D+000 +Math.cosh(-1.4000000E+00): 2.15089846E+00. MathL.cosh(-1.400000000000000D+000): 2.1508984653931408D+000 +Math.cosh(-1.5000000E+00): 2.35240960E+00. MathL.cosh(-1.500000000000000D+000): 2.3524096152432472D+000 +Math.cosh(-1.6000000E+00): 2.57746458E+00. MathL.cosh(-1.600000000000000D+000): 2.5774644711948852D+000 +Math.cosh(-1.9000000E+00): 3.41773129E+00. MathL.cosh(-1.900000000000000D+000): 3.4177315307509520D+000 +Math.cosh(-2.0000000E+00): 3.76219583E+00. MathL.cosh(-2.000000000000000D+000): 3.7621956910836312D+000 +Math.cosh(-2.4000001E+00): 5.55694771E+00. MathL.cosh(-2.400000000000000D+000): 5.5569471669655072D+000 +Math.cosh(-2.5000000E+00): 6.13228941E+00. MathL.cosh(-2.500000000000000D+000): 6.1322894796636856D+000 +Math.cosh(-3.0000000E+00): 1.00676622E+01. MathL.cosh(-3.000000000000000D+000): 1.0067661995777766D+001 +Math.cosh(-4.0000000E+00): 2.73082333E+01. MathL.cosh(-4.000000000000000D+000): 2.7308232836016488D+001 + +Math.tanh(8.99999976E-01): 7.16297865E-01. MathL.tanh(9.0000000000000000D-001): 7.1629787019902448D-001 +Math.tanh(1.00000000E+00): 7.61594176E-01. MathL.tanh(1.0000000000000000D+000): 7.6159415595576480D-001 +Math.tanh(1.39999998E+00): 8.85351658E-01. MathL.tanh(1.4000000000000000D+000): 8.8535164820226256D-001 +Math.tanh(1.50000000E+00): 9.05148268E-01. MathL.tanh(1.5000000000000000D+000): 9.0514825364486640D-001 +Math.tanh(1.60000002E+00): 9.21668530E-01. MathL.tanh(1.6000000000000000D+000): 9.2166855440647136D-001 +Math.tanh(1.89999998E+00): 9.56237435E-01. MathL.tanh(1.9000000000000000D+000): 9.5623745812773904D-001 +Math.tanh(2.00000000E+00): 9.64027584E-01. MathL.tanh(2.0000000000000000D+000): 9.6402758007581680D-001 +Math.tanh(2.40000010E+00): 9.83674884E-01. MathL.tanh(2.4000000000000000D+000): 9.8367485769368016D-001 +Math.tanh(2.50000000E+00): 9.86614287E-01. MathL.tanh(2.5000000000000000D+000): 9.8661429815143024D-001 +Math.tanh(3.00000000E+00): 9.95054781E-01. MathL.tanh(3.0000000000000000D+000): 9.9505475368673040D-001 +Math.tanh(4.00000000E+00): 9.99329329E-01. MathL.tanh(4.0000000000000000D+000): 9.9932929973906704D-001 +Math.tanh(-8.9999998E-01): -7.1629786E-01. MathL.tanh(-9.000000000000000D-001): -7.162978701990244D-001 +Math.tanh(-1.0000000E+00): -7.6159418E-01. MathL.tanh(-1.000000000000000D+000): -7.615941559557650D-001 +Math.tanh(-1.4000000E+00): -8.8535166E-01. MathL.tanh(-1.400000000000000D+000): -8.853516482022626D-001 +Math.tanh(-1.5000000E+00): -9.0514827E-01. MathL.tanh(-1.500000000000000D+000): -9.051482536448664D-001 +Math.tanh(-1.6000000E+00): -9.2166853E-01. MathL.tanh(-1.600000000000000D+000): -9.216685544064714D-001 +Math.tanh(-1.9000000E+00): -9.5623744E-01. MathL.tanh(-1.900000000000000D+000): -9.562374581277390D-001 +Math.tanh(-2.0000000E+00): -9.6402758E-01. MathL.tanh(-2.000000000000000D+000): -9.640275800758168D-001 +Math.tanh(-2.4000001E+00): -9.8367488E-01. MathL.tanh(-2.400000000000000D+000): -9.836748576936802D-001 +Math.tanh(-2.5000000E+00): -9.8661429E-01. MathL.tanh(-2.500000000000000D+000): -9.866142981514302D-001 +Math.tanh(-3.0000000E+00): -9.9505478E-01. MathL.tanh(-3.000000000000000D+000): -9.950547536867304D-001 +Math.tanh(-4.0000000E+00): -9.9932933E-01. MathL.tanh(-4.000000000000000D+000): -9.993292997390670D-001 + +Math.arcsinh(8.99999976E-01): 8.08866858E-01. MathL.arcsinh(9.0000000000000000D-001): 8.0886693565278304D-001 +Math.arcsinh(1.00000000E+00): 8.81373644E-01. MathL.arcsinh(1.0000000000000000D+000): 8.8137358701954304D-001 +Math.arcsinh(1.39999998E+00): 1.13798201E+00. MathL.arcsinh(1.4000000000000000D+000): 1.1379820462933672D+000 +Math.arcsinh(1.50000000E+00): 1.19476318E+00. MathL.arcsinh(1.5000000000000000D+000): 1.1947632172871094D+000 +Math.arcsinh(1.60000002E+00): 1.24898338E+00. MathL.arcsinh(1.6000000000000000D+000): 1.2489833279048764D+000 +Math.arcsinh(1.89999998E+00): 1.39799833E+00. MathL.arcsinh(1.9000000000000000D+000): 1.3979983651114348D+000 +Math.arcsinh(2.00000000E+00): 1.44363546E+00. MathL.arcsinh(2.0000000000000000D+000): 1.4436354751788108D+000 +Math.arcsinh(2.40000010E+00): 1.60943794E+00. MathL.arcsinh(2.4000000000000000D+000): 1.6094379124341008D+000 +Math.arcsinh(2.50000000E+00): 1.64723110E+00. MathL.arcsinh(2.5000000000000000D+000): 1.6472311463710960D+000 +Math.arcsinh(3.00000000E+00): 1.81844652E+00. MathL.arcsinh(3.0000000000000000D+000): 1.8184464592320672D+000 +Math.arcsinh(4.00000000E+00): 2.09471250E+00. MathL.arcsinh(4.0000000000000000D+000): 2.0947125472611016D+000 +Math.arcsinh(-8.9999998E-01): -8.0886686E-01. MathL.arcsinh(-9.000000000000000D-001): -8.088669356527832D-001 +Math.arcsinh(-1.0000000E+00): -8.8137364E-01. MathL.arcsinh(-1.000000000000000D+000): -8.813735870195430D-001 +Math.arcsinh(-1.4000000E+00): -1.1379820E+00. MathL.arcsinh(-1.400000000000000D+000): -1.137982046293367D+000 +Math.arcsinh(-1.5000000E+00): -1.1947632E+00. MathL.arcsinh(-1.500000000000000D+000): -1.194763217287110D+000 +Math.arcsinh(-1.6000000E+00): -1.2489834E+00. MathL.arcsinh(-1.600000000000000D+000): -1.248983327904876D+000 +Math.arcsinh(-1.9000000E+00): -1.3979983E+00. MathL.arcsinh(-1.900000000000000D+000): -1.397998365111435D+000 +Math.arcsinh(-2.0000000E+00): -1.4436355E+00. MathL.arcsinh(-2.000000000000000D+000): -1.443635475178811D+000 +Math.arcsinh(-2.4000001E+00): -1.6094379E+00. MathL.arcsinh(-2.400000000000000D+000): -1.609437912434101D+000 +Math.arcsinh(-2.5000000E+00): -1.6472311E+00. MathL.arcsinh(-2.500000000000000D+000): -1.647231146371096D+000 +Math.arcsinh(-3.0000000E+00): -1.8184465E+00. MathL.arcsinh(-3.000000000000000D+000): -1.818446459232067D+000 +Math.arcsinh(-4.0000000E+00): -2.0947125E+00. MathL.arcsinh(-4.000000000000000D+000): -2.094712547261102D+000 + +Math.arccosh(8.99999976E-01): 0.00000000E+00. MathL.arccosh(9.0000000000000000D-001): 0.0000000000000000D+000 +Math.arccosh(1.00000000E+00): 0.00000000E+00. MathL.arccosh(1.0000000000000000D+000): 0.0000000000000000D+000 +Math.arccosh(1.39999998E+00): 8.67014706E-01. MathL.arccosh(1.4000000000000000D+000): 8.6701472649056496D-001 +Math.arccosh(1.50000000E+00): 9.62423623E-01. MathL.arccosh(1.5000000000000000D+000): 9.6242365011920720D-001 +Math.arccosh(1.60000002E+00): 1.04696786E+00. MathL.arccosh(1.6000000000000000D+000): 1.0469679150031890D+000 +Math.arccosh(1.89999998E+00): 1.25719583E+00. MathL.arccosh(1.9000000000000000D+000): 1.2571958266003804D+000 +Math.arccosh(2.00000000E+00): 1.31695795E+00. MathL.arccosh(2.0000000000000000D+000): 1.3169578969248166D+000 +Math.arccosh(2.40000010E+00): 1.52207935E+00. MathL.arccosh(2.4000000000000000D+000): 1.5220793674636536D+000 +Math.arccosh(2.50000000E+00): 1.56679916E+00. MathL.arccosh(2.5000000000000000D+000): 1.5667992369724114D+000 +Math.arccosh(3.00000000E+00): 1.76274717E+00. MathL.arccosh(3.0000000000000000D+000): 1.7627471740390860D+000 +Math.arccosh(4.00000000E+00): 2.06343699E+00. MathL.arccosh(4.0000000000000000D+000): 2.0634370688955608D+000 +Math.arccosh(-8.9999998E-01): 0.00000000E+00. MathL.arccosh(-9.000000000000000D-001): 0.0000000000000000D+000 +Math.arccosh(-1.0000000E+00): 0.00000000E+00. MathL.arccosh(-1.000000000000000D+000): 0.0000000000000000D+000 +Math.arccosh(-1.4000000E+00): 0.00000000E+00. MathL.arccosh(-1.400000000000000D+000): 0.0000000000000000D+000 +Math.arccosh(-1.5000000E+00): 0.00000000E+00. MathL.arccosh(-1.500000000000000D+000): 0.0000000000000000D+000 +Math.arccosh(-1.6000000E+00): 0.00000000E+00. MathL.arccosh(-1.600000000000000D+000): 0.0000000000000000D+000 +Math.arccosh(-1.9000000E+00): 0.00000000E+00. MathL.arccosh(-1.900000000000000D+000): 0.0000000000000000D+000 +Math.arccosh(-2.0000000E+00): 0.00000000E+00. MathL.arccosh(-2.000000000000000D+000): 0.0000000000000000D+000 +Math.arccosh(-2.4000001E+00): 0.00000000E+00. MathL.arccosh(-2.400000000000000D+000): 0.0000000000000000D+000 +Math.arccosh(-2.5000000E+00): 0.00000000E+00. MathL.arccosh(-2.500000000000000D+000): 0.0000000000000000D+000 +Math.arccosh(-3.0000000E+00): 0.00000000E+00. MathL.arccosh(-3.000000000000000D+000): 0.0000000000000000D+000 +Math.arccosh(-4.0000000E+00): 0.00000000E+00. MathL.arccosh(-4.000000000000000D+000): 0.0000000000000000D+000 + +Math.arctanh(8.99999976E-01): 1.47221935E+00. MathL.arctanh(9.0000000000000000D-001): 1.4722194895832210D+000 +Math.arctanh(1.00000000E+00): 8.66434002E+00. MathL.arctanh(1.0000000000000000D+000): 1.8714973875118524D+001 +Math.arctanh(1.39999998E+00): 8.66434002E+00. MathL.arctanh(1.4000000000000000D+000): 1.8714973875118524D+001 +Math.arctanh(1.50000000E+00): 8.66434002E+00. MathL.arctanh(1.5000000000000000D+000): 1.8714973875118524D+001 +Math.arctanh(1.60000002E+00): 8.66434002E+00. MathL.arctanh(1.6000000000000000D+000): 1.8714973875118524D+001 +Math.arctanh(1.89999998E+00): 8.66434002E+00. MathL.arctanh(1.9000000000000000D+000): 1.8714973875118524D+001 +Math.arctanh(2.00000000E+00): 8.66434002E+00. MathL.arctanh(2.0000000000000000D+000): 1.8714973875118524D+001 +Math.arctanh(2.40000010E+00): 8.66434002E+00. MathL.arctanh(2.4000000000000000D+000): 1.8714973875118524D+001 +Math.arctanh(2.50000000E+00): 8.66434002E+00. MathL.arctanh(2.5000000000000000D+000): 1.8714973875118524D+001 +Math.arctanh(3.00000000E+00): 8.66434002E+00. MathL.arctanh(3.0000000000000000D+000): 1.8714973875118524D+001 +Math.arctanh(4.00000000E+00): 8.66434002E+00. MathL.arctanh(4.0000000000000000D+000): 1.8714973875118524D+001 +Math.arctanh(-8.9999998E-01): -1.4722193E+00. MathL.arctanh(-9.000000000000000D-001): -1.472219489583221D+000 +Math.arctanh(-1.0000000E+00): -8.6643400E+00. MathL.arctanh(-1.000000000000000D+000): -1.871497387511852D+001 +Math.arctanh(-1.4000000E+00): -8.6643400E+00. MathL.arctanh(-1.400000000000000D+000): -1.871497387511852D+001 +Math.arctanh(-1.5000000E+00): -8.6643400E+00. MathL.arctanh(-1.500000000000000D+000): -1.871497387511852D+001 +Math.arctanh(-1.6000000E+00): -8.6643400E+00. MathL.arctanh(-1.600000000000000D+000): -1.871497387511852D+001 +Math.arctanh(-1.9000000E+00): -8.6643400E+00. MathL.arctanh(-1.900000000000000D+000): -1.871497387511852D+001 +Math.arctanh(-2.0000000E+00): -8.6643400E+00. MathL.arctanh(-2.000000000000000D+000): -1.871497387511852D+001 +Math.arctanh(-2.4000001E+00): -8.6643400E+00. MathL.arctanh(-2.400000000000000D+000): -1.871497387511852D+001 +Math.arctanh(-2.5000000E+00): -8.6643400E+00. MathL.arctanh(-2.500000000000000D+000): -1.871497387511852D+001 +Math.arctanh(-3.0000000E+00): -8.6643400E+00. MathL.arctanh(-3.000000000000000D+000): -1.871497387511852D+001 +Math.arctanh(-4.0000000E+00): -8.6643400E+00. MathL.arctanh(-4.000000000000000D+000): -1.871497387511852D+001 + diff --git a/src/test/confidence/math/mathtest.mod b/src/test/confidence/math/mathtest.mod new file mode 100644 index 00000000..e0ad0485 --- /dev/null +++ b/src/test/confidence/math/mathtest.mod @@ -0,0 +1,145 @@ +MODULE mathtest; +IMPORT Math, MathL, Out, SYSTEM; + +TYPE + RtoR = PROCEDURE(x: REAL): REAL; + LRtoLR = PROCEDURE(x: LONGREAL): LONGREAL; + RtoLI = PROCEDURE(x: REAL): LONGINT; + LRtoLI = PROCEDURE(x: LONGREAL): LONGINT; + + Values = RECORD + v: ARRAY 100 OF LONGREAL; + n: INTEGER + END; + +VAR + r: REAL; + lr: LONGREAL; + misc: Values; + angles: Values; + + +PROCEDURE wc(c: CHAR); BEGIN Out.Char(c) END wc; +PROCEDURE ws(s: ARRAY OF CHAR); BEGIN Out.String(s) END ws; +PROCEDURE wi(i: HUGEINT); BEGIN Out.Int(i,1) END wi; +PROCEDURE wr(r: REAL); BEGIN Out.Real(r,14) END wr; +PROCEDURE wlr(lr: LONGREAL); BEGIN Out.LongReal(lr,23) END wlr; +PROCEDURE wl; BEGIN Out.Ln END wl; + +PROCEDURE wh(VAR h: ARRAY OF SYSTEM.BYTE); + VAR i: INTEGER; b: SYSTEM.INT8; +BEGIN + i := SHORT(LEN(h)); + WHILE i > 0 DO + DEC(i); b := SYSTEM.VAL(SYSTEM.INT8, h[i]); + IF b DIV 16 MOD 16 < 10 THEN wc(CHR(b DIV 16 MOD 16 + 48)) ELSE wc(CHR(b DIV 16 MOD 16 + 55)) END; + IF b MOD 16 < 10 THEN wc(CHR(b MOD 16 + 48)) ELSE wc(CHR(b MOD 16 + 55)) END; + END +END wh; + +PROCEDURE addvalue(lr: LONGREAL; VAR val: Values); +BEGIN val.v[val.n] := lr; INC(val.n) +END addvalue; + +PROCEDURE MathErrorHandler(error: INTEGER); +BEGIN + ws(" ") +END MathErrorHandler; + +PROCEDURE TestRtoR(s: ARRAY OF CHAR; p: RtoR; lp: LRtoLR; val: Values); + VAR i: INTEGER; r: REAL; +BEGIN + i := 0; + WHILE i < val.n DO + r := SHORT(val.v[i]); + ws("Math."); ws(s); ws("("); wr(r); ws("): "); wr(p(r)); + ws(". MathL."); ws(s); ws("("); wlr(val.v[i]); ws("): "); wlr(lp(val.v[i])); wl; + INC(i) + END; + wl; +END TestRtoR; + +PROCEDURE TestRtoLI(s: ARRAY OF CHAR; p: RtoLI; lp: LRtoLI; val: Values); + VAR i: INTEGER; r: REAL; +BEGIN + i := 0; + WHILE i < val.n DO + r := SHORT(val.v[i]); + ws("Math."); ws(s); ws("("); wr(r); ws("): "); wi(p(r)); + ws(". MathL."); ws(s); ws("("); wlr(val.v[i]); ws("): "); wi(lp(val.v[i])); wl; + INC(i) + END; + wl; +END TestRtoLI; + +PROCEDURE round(lr: LONGREAL); + VAR r: REAL; +BEGIN + r := SHORT(lr); + ws("Math.round("); wr(r); ws("): "); wi(Math.round(r)); + ws(". MathL.round("); wlr(lr); ws("): "); wi(MathL.round(lr)); wl +END round; + +PROCEDURE sqrt(lr: LONGREAL); + VAR r: REAL; +BEGIN + r := SHORT(lr); + ws("Math.sqrt("); wr(r); ws("): "); wr(Math.sqrt(r)); + ws(". MathL.sqrt("); wlr(r); ws("): "); wlr(MathL.sqrt(r)); wl +END sqrt; + + +BEGIN + ws("Math and MathL module tests."); wl; wl; + + misc.n := 0; + addvalue(0.9D0, misc); addvalue(1.0D0, misc); addvalue(1.4D0, misc); addvalue(1.5D0, misc); addvalue(1.6D0, misc); addvalue(1.9D0, misc); + addvalue(2.0D0, misc); addvalue(2.4D0, misc); addvalue(2.5D0, misc); + addvalue(3.0D0, misc); addvalue(4.0D0, misc); + + addvalue(-0.9D0, misc); addvalue(-1.0D0, misc); addvalue(-1.4D0, misc); addvalue(-1.5D0, misc); addvalue(-1.6D0, misc); addvalue(-1.9D0, misc); + addvalue(-2.0D0, misc); addvalue(-2.4D0, misc); addvalue(-2.5D0, misc); + addvalue(-3.0D0, misc); addvalue(-4.0D0, misc); + + angles.n:= 0; + addvalue(0.0D0, angles); addvalue(0.1D0, angles); + addvalue(MathL.pi/3.0D0, angles); addvalue(MathL.pi/2.0D0, angles); addvalue(MathL.pi, angles); + addvalue(-MathL.pi/3.0D0, angles); addvalue(-MathL.pi/2.0D0, angles); addvalue(-MathL.pi, angles); + + TestRtoR("fraction", Math.fraction, MathL.fraction, misc); + TestRtoLI("round", Math.round, MathL.round, misc); + TestRtoR("sqrt", Math.sqrt, MathL.sqrt, misc); + TestRtoR("exp", Math.exp, MathL.exp, misc); + TestRtoR("ln", Math.ln, MathL.ln, misc); + TestRtoR("sin", Math.sin, MathL.sin, angles); + TestRtoR("cos", Math.cos, MathL.cos, angles); + TestRtoR("tan", Math.tan, MathL.tan, angles); + TestRtoR("arcsin", Math.arcsin, MathL.arcsin, misc); + TestRtoR("arccos", Math.arccos, MathL.arccos, misc); + TestRtoR("arctan", Math.arctan, MathL.arctan, misc); + TestRtoR("sinh", Math.sinh, MathL.sinh, misc); + TestRtoR("cosh", Math.cosh, MathL.cosh, misc); + TestRtoR("tanh", Math.tanh, MathL.tanh, misc); + TestRtoR("arcsinh", Math.arcsinh, MathL.arcsinh, misc); + TestRtoR("arccosh", Math.arccosh, MathL.arccosh, misc); + TestRtoR("arctanh", Math.arctanh, MathL.arctanh, misc); + + (* todo power, log, ipower, sincos, arctan2 *) + +END mathtest. diff --git a/src/test/confidence/math/test.sh b/src/test/confidence/math/test.sh new file mode 100644 index 00000000..e8b5b827 --- /dev/null +++ b/src/test/confidence/math/test.sh @@ -0,0 +1,5 @@ +#!/bin/sh +. ../testenv.sh +$OBECOMP mathtest.mod -m -OC +./mathtest >result +. ../testresult.sh diff --git a/src/test/confidence/planned-binary-change b/src/test/confidence/planned-binary-change index 0e593b78..02241a25 100644 --- a/src/test/confidence/planned-binary-change +++ b/src/test/confidence/planned-binary-change @@ -1 +1 @@ -30 Sep 2016 18:58:19 +16 Oct 2016 13:42:18 diff --git a/src/tools/make/oberon.mk b/src/tools/make/oberon.mk index dd752faf..6a4ed69c 100644 --- a/src/tools/make/oberon.mk +++ b/src/tools/make/oberon.mk @@ -382,12 +382,13 @@ RUNTEST = COMPILER=$(COMPILER) OBECOMP="$(OBECOMP) -O$(MODEL)" FLAVOUR=$(FLAVOUR confidence: @printf "\n\n--- Confidence tests ---\n\n" -# cd src/test/confidence/math; $(RUNTEST) + cd src/test/confidence/math; $(RUNTEST) cd src/test/confidence/hello; $(RUNTEST) cd src/test/confidence/out; $(RUNTEST) cd src/test/confidence/intsyntax; $(RUNTEST) cd src/test/confidence/language; $(RUNTEST) cd src/test/confidence/texts; $(RUNTEST) + cd src/test/confidence/math; $(RUNTEST) cd src/test/confidence/library; $(RUNTEST) cd src/test/confidence/lola; $(RUNTEST) cd src/test/confidence/arrayassignment; $(RUNTEST) From 2d8c9c47571f16423f4f12786947cf6dc8792f8e Mon Sep 17 00:00:00 2001 From: David Brown Date: Mon, 17 Oct 2016 12:49:05 +0100 Subject: [PATCH 288/580] Make math test work across x86/x64. --- bootstrap/unix-44/Compiler.c | 2 +- bootstrap/unix-44/Configuration.c | 4 +- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Files.c | 2 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 2 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 2 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 2 +- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 2 +- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 2 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Out.c | 10 +- bootstrap/unix-44/Out.h | 2 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/VT100.c | 2 +- bootstrap/unix-44/VT100.h | 2 +- bootstrap/unix-44/errors.c | 2 +- bootstrap/unix-44/errors.h | 2 +- bootstrap/unix-44/extTools.c | 4 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-48/Compiler.c | 2 +- bootstrap/unix-48/Configuration.c | 4 +- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Files.c | 2 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 2 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 2 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 2 +- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 2 +- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 2 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Out.c | 10 +- bootstrap/unix-48/Out.h | 2 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/VT100.c | 2 +- bootstrap/unix-48/VT100.h | 2 +- bootstrap/unix-48/errors.c | 2 +- bootstrap/unix-48/errors.h | 2 +- bootstrap/unix-48/extTools.c | 4 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-88/Compiler.c | 2 +- bootstrap/unix-88/Configuration.c | 4 +- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Files.c | 2 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 2 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 2 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 2 +- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 2 +- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 2 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Out.c | 10 +- bootstrap/unix-88/Out.h | 2 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/VT100.c | 2 +- bootstrap/unix-88/VT100.h | 2 +- bootstrap/unix-88/errors.c | 2 +- bootstrap/unix-88/errors.h | 2 +- bootstrap/unix-88/extTools.c | 4 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/windows-48/Compiler.c | 2 +- bootstrap/windows-48/Configuration.c | 4 +- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Files.c | 2 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 2 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 2 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 2 +- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 2 +- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 2 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Out.c | 10 +- bootstrap/windows-48/Out.h | 2 +- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/VT100.c | 2 +- bootstrap/windows-48/VT100.h | 2 +- bootstrap/windows-48/errors.c | 2 +- bootstrap/windows-48/errors.h | 2 +- bootstrap/windows-48/extTools.c | 4 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-88/Compiler.c | 2 +- bootstrap/windows-88/Configuration.c | 4 +- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Files.c | 2 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 2 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 2 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 2 +- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 2 +- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 2 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Out.c | 10 +- bootstrap/windows-88/Out.h | 2 +- bootstrap/windows-88/Platform.c | 2 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/VT100.c | 2 +- bootstrap/windows-88/VT100.h | 2 +- bootstrap/windows-88/errors.c | 2 +- bootstrap/windows-88/errors.h | 2 +- bootstrap/windows-88/extTools.c | 4 +- bootstrap/windows-88/extTools.h | 2 +- src/runtime/Out.Mod | 4 +- src/test/confidence/math/expected | 643 +++++++++++++------------- src/test/confidence/math/mathtest.mod | 6 +- src/test/confidence/out/expected | 4 +- src/tools/make/configure.c | 4 +- src/tools/make/oberon.mk | 2 +- 201 files changed, 545 insertions(+), 568 deletions(-) diff --git a/bootstrap/unix-44/Compiler.c b/bootstrap/unix-44/Compiler.c index 08a80f54..5d283015 100644 --- a/bootstrap/unix-44/Compiler.c +++ b/bootstrap/unix-44/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index b9310392..d683fe2f 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index c760742c..90611872 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index e46e005c..4a2cb111 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index 33cfbbec..b6252d6a 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index 948db354..f273580a 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index 7712f182..7fa42c0b 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index 5cdcbe9c..c647f9ac 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index e6fcdbbe..14e787d6 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index aa7126c9..5427f4fa 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index b63ca81f..3ff1bcb7 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index d2a4419b..339c3dfb 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index 4da49877..e977b3bc 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index d202f2cd..10852426 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index b088cc93..00fd6e1b 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index 63fb92b5..554f232f 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index 57f41cf8..7b603db0 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index e7cd3549..a6450b26 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index 0a75e9c7..10816274 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index c5d47d14..c6b8263f 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index d8da229b..3f43db54 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index fd02ab90..c0973832 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index 48195728..acd590a5 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Out.c b/bootstrap/unix-44/Out.c index 67b82ce9..7aa2ea0f 100644 --- a/bootstrap/unix-44/Out.c +++ b/bootstrap/unix-44/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -198,8 +198,8 @@ static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_) dr = 17; } d = dr; - if (d < 16) { - d = 16; + if (d < 15) { + d = 15; } } else { el = 2; @@ -208,8 +208,8 @@ static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_) dr = 9; } d = dr; - if (d < 7) { - d = 7; + if (d < 6) { + d = 6; } } if (e == 0) { diff --git a/bootstrap/unix-44/Out.h b/bootstrap/unix-44/Out.h index f91ee6a4..79d13967 100644 --- a/bootstrap/unix-44/Out.h +++ b/bootstrap/unix-44/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 0fe40111..4654539d 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index 68411f33..e1461593 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 6135ec40..67a2e86b 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index 86321454..16683728 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index 92ce5fe0..fdabc0a6 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index 76b31eb9..80d04256 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index ac65c9f1..27223430 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index 60f267ed..e3920989 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/VT100.c b/bootstrap/unix-44/VT100.c index 7c1212f5..26d4f1f2 100644 --- a/bootstrap/unix-44/VT100.c +++ b/bootstrap/unix-44/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/VT100.h b/bootstrap/unix-44/VT100.h index 64913ea9..81a745bc 100644 --- a/bootstrap/unix-44/VT100.h +++ b/bootstrap/unix-44/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-44/errors.c b/bootstrap/unix-44/errors.c index 70424462..2f957698 100644 --- a/bootstrap/unix-44/errors.c +++ b/bootstrap/unix-44/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/errors.h b/bootstrap/unix-44/errors.h index 80c4a045..a4d3fdb2 100644 --- a/bootstrap/unix-44/errors.h +++ b/bootstrap/unix-44/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index a6e5fe94..3b663078 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -64,7 +64,7 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN static void extTools_InitialiseCompilerCommand (CHAR *s, LONGINT s__len) { - __COPY("gcc -g", s, s__len); + __COPY("gcc -g -msse2", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index d945916e..4f69f786 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/Compiler.c b/bootstrap/unix-48/Compiler.c index 08a80f54..5d283015 100644 --- a/bootstrap/unix-48/Compiler.c +++ b/bootstrap/unix-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index b9310392..d683fe2f 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index c760742c..90611872 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index e46e005c..4a2cb111 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index 33cfbbec..b6252d6a 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index 948db354..f273580a 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index 7712f182..7fa42c0b 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index 5cdcbe9c..c647f9ac 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index e6fcdbbe..14e787d6 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index aa7126c9..5427f4fa 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index b63ca81f..3ff1bcb7 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index d2a4419b..339c3dfb 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index 4da49877..e977b3bc 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index d202f2cd..10852426 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index b088cc93..00fd6e1b 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index 63fb92b5..554f232f 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index 57f41cf8..7b603db0 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index e7cd3549..a6450b26 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index 0a75e9c7..10816274 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 6f466b3e..655ea955 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index d8da229b..3f43db54 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index fd02ab90..c0973832 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index 48195728..acd590a5 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Out.c b/bootstrap/unix-48/Out.c index 67b82ce9..7aa2ea0f 100644 --- a/bootstrap/unix-48/Out.c +++ b/bootstrap/unix-48/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -198,8 +198,8 @@ static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_) dr = 17; } d = dr; - if (d < 16) { - d = 16; + if (d < 15) { + d = 15; } } else { el = 2; @@ -208,8 +208,8 @@ static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_) dr = 9; } d = dr; - if (d < 7) { - d = 7; + if (d < 6) { + d = 6; } } if (e == 0) { diff --git a/bootstrap/unix-48/Out.h b/bootstrap/unix-48/Out.h index f91ee6a4..79d13967 100644 --- a/bootstrap/unix-48/Out.h +++ b/bootstrap/unix-48/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 0fe40111..4654539d 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index 68411f33..e1461593 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 6135ec40..67a2e86b 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index 86321454..16683728 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index 92ce5fe0..fdabc0a6 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index 76b31eb9..80d04256 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index b5634f26..b9464942 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index 7709374b..0ca902fe 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/VT100.c b/bootstrap/unix-48/VT100.c index 7c1212f5..26d4f1f2 100644 --- a/bootstrap/unix-48/VT100.c +++ b/bootstrap/unix-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/VT100.h b/bootstrap/unix-48/VT100.h index 64913ea9..81a745bc 100644 --- a/bootstrap/unix-48/VT100.h +++ b/bootstrap/unix-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-48/errors.c b/bootstrap/unix-48/errors.c index 70424462..2f957698 100644 --- a/bootstrap/unix-48/errors.c +++ b/bootstrap/unix-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/errors.h b/bootstrap/unix-48/errors.h index 80c4a045..a4d3fdb2 100644 --- a/bootstrap/unix-48/errors.h +++ b/bootstrap/unix-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index a6e5fe94..3b663078 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -64,7 +64,7 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN static void extTools_InitialiseCompilerCommand (CHAR *s, LONGINT s__len) { - __COPY("gcc -g", s, s__len); + __COPY("gcc -g -msse2", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index d945916e..4f69f786 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/Compiler.c b/bootstrap/unix-88/Compiler.c index 08a80f54..5d283015 100644 --- a/bootstrap/unix-88/Compiler.c +++ b/bootstrap/unix-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index b9310392..d683fe2f 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index c760742c..90611872 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 22e659a7..cc5863c6 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 42a47cdf..b3e2bc58 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index 42134b68..f5ed9956 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index 521ccc74..1056abb7 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 2a860e62..8f08ca7d 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index e6fcdbbe..14e787d6 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index aa7126c9..5427f4fa 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index b63ca81f..3ff1bcb7 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index d2a4419b..339c3dfb 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index 4da49877..e977b3bc 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 686c674e..a3a2d7c0 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index b088cc93..00fd6e1b 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index 29f9ae66..cfde1aba 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index 57f41cf8..7b603db0 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index e7cd3549..a6450b26 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index 0a75e9c7..10816274 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index 85221274..857ae626 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index d8da229b..3f43db54 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 7e6d40e5..95e1de51 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index 48195728..acd590a5 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Out.c b/bootstrap/unix-88/Out.c index 67b82ce9..7aa2ea0f 100644 --- a/bootstrap/unix-88/Out.c +++ b/bootstrap/unix-88/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -198,8 +198,8 @@ static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_) dr = 17; } d = dr; - if (d < 16) { - d = 16; + if (d < 15) { + d = 15; } } else { el = 2; @@ -208,8 +208,8 @@ static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_) dr = 9; } d = dr; - if (d < 7) { - d = 7; + if (d < 6) { + d = 6; } } if (e == 0) { diff --git a/bootstrap/unix-88/Out.h b/bootstrap/unix-88/Out.h index f91ee6a4..79d13967 100644 --- a/bootstrap/unix-88/Out.h +++ b/bootstrap/unix-88/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 39e05934..d8e7514a 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index 24d6dbe4..3c49b437 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 6135ec40..67a2e86b 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index 86321454..16683728 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index 92ce5fe0..fdabc0a6 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index 76b31eb9..80d04256 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index 09708beb..dc6db203 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index 14846883..1fb2d081 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/VT100.c b/bootstrap/unix-88/VT100.c index 7c1212f5..26d4f1f2 100644 --- a/bootstrap/unix-88/VT100.c +++ b/bootstrap/unix-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/VT100.h b/bootstrap/unix-88/VT100.h index 64913ea9..81a745bc 100644 --- a/bootstrap/unix-88/VT100.h +++ b/bootstrap/unix-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-88/errors.c b/bootstrap/unix-88/errors.c index 70424462..2f957698 100644 --- a/bootstrap/unix-88/errors.c +++ b/bootstrap/unix-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/errors.h b/bootstrap/unix-88/errors.h index 80c4a045..a4d3fdb2 100644 --- a/bootstrap/unix-88/errors.h +++ b/bootstrap/unix-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index a6e5fe94..3b663078 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -64,7 +64,7 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN static void extTools_InitialiseCompilerCommand (CHAR *s, LONGINT s__len) { - __COPY("gcc -g", s, s__len); + __COPY("gcc -g -msse2", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index d945916e..4f69f786 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/Compiler.c b/bootstrap/windows-48/Compiler.c index 08a80f54..5d283015 100644 --- a/bootstrap/windows-48/Compiler.c +++ b/bootstrap/windows-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index b9310392..d683fe2f 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index c760742c..90611872 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 03f1e2aa..03e68742 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index b5337e4a..7ebffaa8 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index 948db354..f273580a 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index 7712f182..7fa42c0b 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index 5cdcbe9c..c647f9ac 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index e6fcdbbe..14e787d6 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index aa7126c9..5427f4fa 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index b63ca81f..3ff1bcb7 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index d2a4419b..339c3dfb 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index 4da49877..e977b3bc 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index d202f2cd..10852426 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index b088cc93..00fd6e1b 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index 63fb92b5..554f232f 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index 57f41cf8..7b603db0 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index e7cd3549..a6450b26 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index 0a75e9c7..10816274 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 6f466b3e..655ea955 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index d8da229b..3f43db54 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index fd02ab90..c0973832 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index 48195728..acd590a5 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Out.c b/bootstrap/windows-48/Out.c index 31b8cd52..3937bd93 100644 --- a/bootstrap/windows-48/Out.c +++ b/bootstrap/windows-48/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -198,8 +198,8 @@ static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_) dr = 17; } d = dr; - if (d < 16) { - d = 16; + if (d < 15) { + d = 15; } } else { el = 2; @@ -208,8 +208,8 @@ static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_) dr = 9; } d = dr; - if (d < 7) { - d = 7; + if (d < 6) { + d = 6; } } if (e == 0) { diff --git a/bootstrap/windows-48/Out.h b/bootstrap/windows-48/Out.h index f91ee6a4..79d13967 100644 --- a/bootstrap/windows-48/Out.h +++ b/bootstrap/windows-48/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 6092ac08..9773ed7c 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index c3fa315b..819d1704 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 6135ec40..67a2e86b 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index 86321454..16683728 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index 92ce5fe0..fdabc0a6 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index 76b31eb9..80d04256 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index b5634f26..b9464942 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index 7709374b..0ca902fe 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/VT100.c b/bootstrap/windows-48/VT100.c index 7c1212f5..26d4f1f2 100644 --- a/bootstrap/windows-48/VT100.c +++ b/bootstrap/windows-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/VT100.h b/bootstrap/windows-48/VT100.h index 64913ea9..81a745bc 100644 --- a/bootstrap/windows-48/VT100.h +++ b/bootstrap/windows-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-48/errors.c b/bootstrap/windows-48/errors.c index 70424462..2f957698 100644 --- a/bootstrap/windows-48/errors.c +++ b/bootstrap/windows-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/errors.h b/bootstrap/windows-48/errors.h index 80c4a045..a4d3fdb2 100644 --- a/bootstrap/windows-48/errors.h +++ b/bootstrap/windows-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index a6e5fe94..3b663078 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -64,7 +64,7 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN static void extTools_InitialiseCompilerCommand (CHAR *s, LONGINT s__len) { - __COPY("gcc -g", s, s__len); + __COPY("gcc -g -msse2", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index d945916e..4f69f786 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/Compiler.c b/bootstrap/windows-88/Compiler.c index 08a80f54..5d283015 100644 --- a/bootstrap/windows-88/Compiler.c +++ b/bootstrap/windows-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index b9310392..d683fe2f 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index c760742c..90611872 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 9986f06f..1c68856c 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 9b8b7477..eeab80bb 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index 42134b68..f5ed9956 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index 521ccc74..1056abb7 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 2a860e62..8f08ca7d 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index e6fcdbbe..14e787d6 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index aa7126c9..5427f4fa 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index b63ca81f..3ff1bcb7 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index d2a4419b..339c3dfb 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index 4da49877..e977b3bc 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 686c674e..a3a2d7c0 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index b088cc93..00fd6e1b 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index 29f9ae66..cfde1aba 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index 57f41cf8..7b603db0 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index e7cd3549..a6450b26 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index 0a75e9c7..10816274 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index 85221274..857ae626 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index d8da229b..3f43db54 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 7e6d40e5..95e1de51 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index 48195728..acd590a5 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Out.c b/bootstrap/windows-88/Out.c index 31b8cd52..3937bd93 100644 --- a/bootstrap/windows-88/Out.c +++ b/bootstrap/windows-88/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -198,8 +198,8 @@ static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_) dr = 17; } d = dr; - if (d < 16) { - d = 16; + if (d < 15) { + d = 15; } } else { el = 2; @@ -208,8 +208,8 @@ static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_) dr = 9; } d = dr; - if (d < 7) { - d = 7; + if (d < 6) { + d = 6; } } if (e == 0) { diff --git a/bootstrap/windows-88/Out.h b/bootstrap/windows-88/Out.h index f91ee6a4..79d13967 100644 --- a/bootstrap/windows-88/Out.h +++ b/bootstrap/windows-88/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index d3020826..c7db3c7a 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index 968219dd..920f8aef 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 6135ec40..67a2e86b 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index 86321454..16683728 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index 92ce5fe0..fdabc0a6 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index 76b31eb9..80d04256 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index 09708beb..dc6db203 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index 14846883..1fb2d081 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/VT100.c b/bootstrap/windows-88/VT100.c index 7c1212f5..26d4f1f2 100644 --- a/bootstrap/windows-88/VT100.c +++ b/bootstrap/windows-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/VT100.h b/bootstrap/windows-88/VT100.h index 64913ea9..81a745bc 100644 --- a/bootstrap/windows-88/VT100.h +++ b/bootstrap/windows-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-88/errors.c b/bootstrap/windows-88/errors.c index 70424462..2f957698 100644 --- a/bootstrap/windows-88/errors.c +++ b/bootstrap/windows-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/errors.h b/bootstrap/windows-88/errors.h index 80c4a045..a4d3fdb2 100644 --- a/bootstrap/windows-88/errors.h +++ b/bootstrap/windows-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index a6e5fe94..3b663078 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -64,7 +64,7 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN static void extTools_InitialiseCompilerCommand (CHAR *s, LONGINT s__len) { - __COPY("gcc -g", s, s__len); + __COPY("gcc -g -msse2", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index d945916e..4f69f786 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/src/runtime/Out.Mod b/src/runtime/Out.Mod index 1de04671..52157484 100644 --- a/src/runtime/Out.Mod +++ b/src/runtime/Out.Mod @@ -133,13 +133,13 @@ BEGIN dr := n-6; (* Leave room for dp and '+D000' *) IF dr > 17 THEN dr := 17 END; (* Limit to max useful significant digits *) d := dr; (* Number of digits to generate *) - IF d < 16 THEN d := 16 END (* Generate enough digits to do trailing zero supporession *) + IF d < 15 THEN d := 15 END (* Generate enough digits to do trailing zero supporession *) ELSE el := 2; dr := n-5; (* Leave room for dp and '+E00' *) IF dr > 9 THEN dr := 9 END; (* Limit to max useful significant digits *) d := dr; (* Number of digits to generate *) - IF d < 7 THEN d := 7 END (* Generate enough digits to do trailing zero supporession *) + IF d < 6 THEN d := 6 END (* Generate enough digits to do trailing zero supporession *) END; IF e = 0 THEN diff --git a/src/test/confidence/math/expected b/src/test/confidence/math/expected index f20dccd8..fb01dc20 100644 --- a/src/test/confidence/math/expected +++ b/src/test/confidence/math/expected @@ -1,351 +1,328 @@ Math and MathL module tests. -Math.fraction(8.99999976E-01): 1.79999995E+00. MathL.fraction(9.0000000000000000D-001): 1.8000000000000000D+000 -Math.fraction(1.00000000E+00): 1.00000000E+00. MathL.fraction(1.0000000000000000D+000): 1.0000000000000000D+000 -Math.fraction(1.39999998E+00): 1.39999998E+00. MathL.fraction(1.4000000000000000D+000): 1.4000000000000000D+000 -Math.fraction(1.50000000E+00): 1.50000000E+00. MathL.fraction(1.5000000000000000D+000): 1.5000000000000000D+000 -Math.fraction(1.60000002E+00): 1.60000002E+00. MathL.fraction(1.6000000000000000D+000): 1.6000000000000000D+000 -Math.fraction(1.89999998E+00): 1.89999998E+00. MathL.fraction(1.9000000000000000D+000): 1.9000000000000000D+000 -Math.fraction(2.00000000E+00): 1.00000000E+00. MathL.fraction(2.0000000000000000D+000): 1.0000000000000000D+000 -Math.fraction(2.40000010E+00): 1.20000005E+00. MathL.fraction(2.4000000000000000D+000): 1.2000000000000000D+000 -Math.fraction(2.50000000E+00): 1.25000000E+00. MathL.fraction(2.5000000000000000D+000): 1.2500000000000000D+000 -Math.fraction(3.00000000E+00): 1.50000000E+00. MathL.fraction(3.0000000000000000D+000): 1.5000000000000000D+000 -Math.fraction(4.00000000E+00): 1.00000000E+00. MathL.fraction(4.0000000000000000D+000): 1.0000000000000000D+000 -Math.fraction(-8.9999998E-01): -1.8000000E+00. MathL.fraction(-9.000000000000000D-001): -1.800000000000000D+000 -Math.fraction(-1.0000000E+00): -1.0000000E+00. MathL.fraction(-1.000000000000000D+000): -1.000000000000000D+000 -Math.fraction(-1.4000000E+00): -1.4000000E+00. MathL.fraction(-1.400000000000000D+000): -1.400000000000000D+000 -Math.fraction(-1.5000000E+00): -1.5000000E+00. MathL.fraction(-1.500000000000000D+000): -1.500000000000000D+000 -Math.fraction(-1.6000000E+00): -1.6000000E+00. MathL.fraction(-1.600000000000000D+000): -1.600000000000000D+000 -Math.fraction(-1.9000000E+00): -1.9000000E+00. MathL.fraction(-1.900000000000000D+000): -1.900000000000000D+000 -Math.fraction(-2.0000000E+00): -1.0000000E+00. MathL.fraction(-2.000000000000000D+000): -1.000000000000000D+000 -Math.fraction(-2.4000001E+00): -1.2000000E+00. MathL.fraction(-2.400000000000000D+000): -1.200000000000000D+000 -Math.fraction(-2.5000000E+00): -1.2500000E+00. MathL.fraction(-2.500000000000000D+000): -1.250000000000000D+000 -Math.fraction(-3.0000000E+00): -1.5000000E+00. MathL.fraction(-3.000000000000000D+000): -1.500000000000000D+000 -Math.fraction(-4.0000000E+00): -1.0000000E+00. MathL.fraction(-4.000000000000000D+000): -1.000000000000000D+000 +Math.fraction(9.00000E-01): 1.80000E+00. MathL.fraction(9.00000000000000D-001): 1.80000000000000D+000 +Math.fraction(1.00000E+00): 1.00000E+00. MathL.fraction(1.00000000000000D+000): 1.00000000000000D+000 +Math.fraction(1.40000E+00): 1.40000E+00. MathL.fraction(1.40000000000000D+000): 1.40000000000000D+000 +Math.fraction(1.50000E+00): 1.50000E+00. MathL.fraction(1.50000000000000D+000): 1.50000000000000D+000 +Math.fraction(1.60000E+00): 1.60000E+00. MathL.fraction(1.60000000000000D+000): 1.60000000000000D+000 +Math.fraction(1.90000E+00): 1.90000E+00. MathL.fraction(1.90000000000000D+000): 1.90000000000000D+000 +Math.fraction(2.00000E+00): 1.00000E+00. MathL.fraction(2.00000000000000D+000): 1.00000000000000D+000 +Math.fraction(2.40000E+00): 1.20000E+00. MathL.fraction(2.40000000000000D+000): 1.20000000000000D+000 +Math.fraction(2.50000E+00): 1.25000E+00. MathL.fraction(2.50000000000000D+000): 1.25000000000000D+000 +Math.fraction(3.00000E+00): 1.50000E+00. MathL.fraction(3.00000000000000D+000): 1.50000000000000D+000 +Math.fraction(4.00000E+00): 1.00000E+00. MathL.fraction(4.00000000000000D+000): 1.00000000000000D+000 +Math.fraction(-9.0000E-01): -1.8000E+00. MathL.fraction(-9.0000000000000D-001): -1.8000000000000D+000 +Math.fraction(-1.0000E+00): -1.0000E+00. MathL.fraction(-1.0000000000000D+000): -1.0000000000000D+000 +Math.fraction(-1.4000E+00): -1.4000E+00. MathL.fraction(-1.4000000000000D+000): -1.4000000000000D+000 +Math.fraction(-1.5000E+00): -1.5000E+00. MathL.fraction(-1.5000000000000D+000): -1.5000000000000D+000 +Math.fraction(-1.6000E+00): -1.6000E+00. MathL.fraction(-1.6000000000000D+000): -1.6000000000000D+000 +Math.fraction(-1.9000E+00): -1.9000E+00. MathL.fraction(-1.9000000000000D+000): -1.9000000000000D+000 +Math.fraction(-2.0000E+00): -1.0000E+00. MathL.fraction(-2.0000000000000D+000): -1.0000000000000D+000 +Math.fraction(-2.4000E+00): -1.2000E+00. MathL.fraction(-2.4000000000000D+000): -1.2000000000000D+000 +Math.fraction(-2.5000E+00): -1.2500E+00. MathL.fraction(-2.5000000000000D+000): -1.2500000000000D+000 +Math.fraction(-3.0000E+00): -1.5000E+00. MathL.fraction(-3.0000000000000D+000): -1.5000000000000D+000 +Math.fraction(-4.0000E+00): -1.0000E+00. MathL.fraction(-4.0000000000000D+000): -1.0000000000000D+000 -Math.round(8.99999976E-01): 1. MathL.round(9.0000000000000000D-001): 1 -Math.round(1.00000000E+00): 1. MathL.round(1.0000000000000000D+000): 1 -Math.round(1.39999998E+00): 1. MathL.round(1.4000000000000000D+000): 1 -Math.round(1.50000000E+00): 2. MathL.round(1.5000000000000000D+000): 2 -Math.round(1.60000002E+00): 2. MathL.round(1.6000000000000000D+000): 2 -Math.round(1.89999998E+00): 2. MathL.round(1.9000000000000000D+000): 2 -Math.round(2.00000000E+00): 2. MathL.round(2.0000000000000000D+000): 2 -Math.round(2.40000010E+00): 2. MathL.round(2.4000000000000000D+000): 2 -Math.round(2.50000000E+00): 3. MathL.round(2.5000000000000000D+000): 3 -Math.round(3.00000000E+00): 3. MathL.round(3.0000000000000000D+000): 3 -Math.round(4.00000000E+00): 4. MathL.round(4.0000000000000000D+000): 4 -Math.round(-8.9999998E-01): -1. MathL.round(-9.000000000000000D-001): -1 -Math.round(-1.0000000E+00): -1. MathL.round(-1.000000000000000D+000): -1 -Math.round(-1.4000000E+00): -1. MathL.round(-1.400000000000000D+000): -1 -Math.round(-1.5000000E+00): -2. MathL.round(-1.500000000000000D+000): -2 -Math.round(-1.6000000E+00): -2. MathL.round(-1.600000000000000D+000): -2 -Math.round(-1.9000000E+00): -2. MathL.round(-1.900000000000000D+000): -2 -Math.round(-2.0000000E+00): -2. MathL.round(-2.000000000000000D+000): -2 -Math.round(-2.4000001E+00): -2. MathL.round(-2.400000000000000D+000): -2 -Math.round(-2.5000000E+00): -3. MathL.round(-2.500000000000000D+000): -3 -Math.round(-3.0000000E+00): -3. MathL.round(-3.000000000000000D+000): -3 -Math.round(-4.0000000E+00): -4. MathL.round(-4.000000000000000D+000): -4 +Math.round(9.00000E-01): 1. MathL.round(9.00000000000000D-001): 1 +Math.round(1.00000E+00): 1. MathL.round(1.00000000000000D+000): 1 +Math.round(1.40000E+00): 1. MathL.round(1.40000000000000D+000): 1 +Math.round(1.50000E+00): 2. MathL.round(1.50000000000000D+000): 2 +Math.round(1.60000E+00): 2. MathL.round(1.60000000000000D+000): 2 +Math.round(1.90000E+00): 2. MathL.round(1.90000000000000D+000): 2 +Math.round(2.00000E+00): 2. MathL.round(2.00000000000000D+000): 2 +Math.round(2.40000E+00): 2. MathL.round(2.40000000000000D+000): 2 +Math.round(2.50000E+00): 3. MathL.round(2.50000000000000D+000): 3 +Math.round(3.00000E+00): 3. MathL.round(3.00000000000000D+000): 3 +Math.round(4.00000E+00): 4. MathL.round(4.00000000000000D+000): 4 +Math.round(-9.0000E-01): -1. MathL.round(-9.0000000000000D-001): -1 +Math.round(-1.0000E+00): -1. MathL.round(-1.0000000000000D+000): -1 +Math.round(-1.4000E+00): -1. MathL.round(-1.4000000000000D+000): -1 +Math.round(-1.5000E+00): -2. MathL.round(-1.5000000000000D+000): -2 +Math.round(-1.6000E+00): -2. MathL.round(-1.6000000000000D+000): -2 +Math.round(-1.9000E+00): -2. MathL.round(-1.9000000000000D+000): -2 +Math.round(-2.0000E+00): -2. MathL.round(-2.0000000000000D+000): -2 +Math.round(-2.4000E+00): -2. MathL.round(-2.4000000000000D+000): -2 +Math.round(-2.5000E+00): -3. MathL.round(-2.5000000000000D+000): -3 +Math.round(-3.0000E+00): -3. MathL.round(-3.0000000000000D+000): -3 +Math.round(-4.0000E+00): -4. MathL.round(-4.0000000000000D+000): -4 -Math.sqrt(8.99999976E-01): 9.48683262E-01. MathL.sqrt(9.0000000000000000D-001): 9.4868329805051376D-001 -Math.sqrt(1.00000000E+00): 9.99999940E-01. MathL.sqrt(1.0000000000000000D+000): 1.0000000000000006D+000 -Math.sqrt(1.39999998E+00): 1.18321598E+00. MathL.sqrt(1.4000000000000000D+000): 1.1832159566199240D+000 -Math.sqrt(1.50000000E+00): 1.22474480E+00. MathL.sqrt(1.5000000000000000D+000): 1.2247448713915898D+000 -Math.sqrt(1.60000002E+00): 1.26491106E+00. MathL.sqrt(1.6000000000000000D+000): 1.2649110640673526D+000 -Math.sqrt(1.89999998E+00): 1.37840486E+00. MathL.sqrt(1.9000000000000000D+000): 1.3784048752090230D+000 -Math.sqrt(2.00000000E+00): 1.41421354E+00. MathL.sqrt(2.0000000000000000D+000): 1.4142135623730952D+000 -Math.sqrt(2.40000010E+00): 1.54919338E+00. MathL.sqrt(2.4000000000000000D+000): 1.5491933384829668D+000 -Math.sqrt(2.50000000E+00): 1.58113885E+00. MathL.sqrt(2.5000000000000000D+000): 1.5811388300841898D+000 -Math.sqrt(3.00000000E+00): 1.73205078E+00. MathL.sqrt(3.0000000000000000D+000): 1.7320508075688772D+000 -Math.sqrt(4.00000000E+00): 1.99999988E+00. MathL.sqrt(4.0000000000000000D+000): 2.0000000000000012D+000 -Math.sqrt(-8.9999998E-01): 9.48683262E-01. MathL.sqrt(-9.000000000000000D-001): 9.4868329805051376D-001 -Math.sqrt(-1.0000000E+00): 9.99999940E-01. MathL.sqrt(-1.000000000000000D+000): 1.0000000000000006D+000 -Math.sqrt(-1.4000000E+00): 1.18321598E+00. MathL.sqrt(-1.400000000000000D+000): 1.1832159566199240D+000 -Math.sqrt(-1.5000000E+00): 1.22474480E+00. MathL.sqrt(-1.500000000000000D+000): 1.2247448713915898D+000 -Math.sqrt(-1.6000000E+00): 1.26491106E+00. MathL.sqrt(-1.600000000000000D+000): 1.2649110640673526D+000 -Math.sqrt(-1.9000000E+00): 1.37840486E+00. MathL.sqrt(-1.900000000000000D+000): 1.3784048752090230D+000 -Math.sqrt(-2.0000000E+00): 1.41421354E+00. MathL.sqrt(-2.000000000000000D+000): 1.4142135623730952D+000 -Math.sqrt(-2.4000001E+00): 1.54919338E+00. MathL.sqrt(-2.400000000000000D+000): 1.5491933384829668D+000 -Math.sqrt(-2.5000000E+00): 1.58113885E+00. MathL.sqrt(-2.500000000000000D+000): 1.5811388300841898D+000 -Math.sqrt(-3.0000000E+00): 1.73205078E+00. MathL.sqrt(-3.000000000000000D+000): 1.7320508075688772D+000 -Math.sqrt(-4.0000000E+00): 1.99999988E+00. MathL.sqrt(-4.000000000000000D+000): 2.0000000000000012D+000 +Math.sqrt(9.00000E-01): 9.48683E-01. MathL.sqrt(9.00000000000000D-001): 9.48683298050514D-001 +Math.sqrt(1.00000E+00): 1.00000E-01. MathL.sqrt(1.00000000000000D+000): 1.00000000000000D+000 +Math.sqrt(1.40000E+00): 1.18322E+00. MathL.sqrt(1.40000000000000D+000): 1.18321595661992D+000 +Math.sqrt(1.50000E+00): 1.22474E+00. MathL.sqrt(1.50000000000000D+000): 1.22474487139159D+000 +Math.sqrt(1.60000E+00): 1.26491E+00. MathL.sqrt(1.60000000000000D+000): 1.26491106406735D+000 +Math.sqrt(1.90000E+00): 1.37840E+00. MathL.sqrt(1.90000000000000D+000): 1.37840487520902D+000 +Math.sqrt(2.00000E+00): 1.41421E+00. MathL.sqrt(2.00000000000000D+000): 1.41421356237310D+000 +Math.sqrt(2.40000E+00): 1.54919E+00. MathL.sqrt(2.40000000000000D+000): 1.54919333848297D+000 +Math.sqrt(2.50000E+00): 1.58114E+00. MathL.sqrt(2.50000000000000D+000): 1.58113883008419D+000 +Math.sqrt(3.00000E+00): 1.73205E+00. MathL.sqrt(3.00000000000000D+000): 1.73205080756888D+000 +Math.sqrt(4.00000E+00): 2.00000E+00. MathL.sqrt(4.00000000000000D+000): 2.00000000000000D+000 +Math.sqrt(-9.0000E-01): 9.48683E-01. MathL.sqrt(-9.0000000000000D-001): 9.48683298050514D-001 +Math.sqrt(-1.0000E+00): 1.00000E-01. MathL.sqrt(-1.0000000000000D+000): 1.00000000000000D+000 +Math.sqrt(-1.4000E+00): 1.18322E+00. MathL.sqrt(-1.4000000000000D+000): 1.18321595661992D+000 +Math.sqrt(-1.5000E+00): 1.22474E+00. MathL.sqrt(-1.5000000000000D+000): 1.22474487139159D+000 +Math.sqrt(-1.6000E+00): 1.26491E+00. MathL.sqrt(-1.6000000000000D+000): 1.26491106406735D+000 +Math.sqrt(-1.9000E+00): 1.37840E+00. MathL.sqrt(-1.9000000000000D+000): 1.37840487520902D+000 +Math.sqrt(-2.0000E+00): 1.41421E+00. MathL.sqrt(-2.0000000000000D+000): 1.41421356237310D+000 +Math.sqrt(-2.4000E+00): 1.54919E+00. MathL.sqrt(-2.4000000000000D+000): 1.54919333848297D+000 +Math.sqrt(-2.5000E+00): 1.58114E+00. MathL.sqrt(-2.5000000000000D+000): 1.58113883008419D+000 +Math.sqrt(-3.0000E+00): 1.73205E+00. MathL.sqrt(-3.0000000000000D+000): 1.73205080756888D+000 +Math.sqrt(-4.0000E+00): 2.00000E+00. MathL.sqrt(-4.0000000000000D+000): 2.00000000000000D+000 -Math.exp(8.99999976E-01): 2.45960307E+00. MathL.exp(9.0000000000000000D-001): 2.4596031111569500D+000 -Math.exp(1.00000000E+00): 2.71828175E+00. MathL.exp(1.0000000000000000D+000): 2.7182818284590456D+000 -Math.exp(1.39999998E+00): 4.05520010E+00. MathL.exp(1.4000000000000000D+000): 4.0551999668446744D+000 -Math.exp(1.50000000E+00): 4.48168898E+00. MathL.exp(1.5000000000000000D+000): 4.4816890703380648D+000 -Math.exp(1.60000002E+00): 4.95303249E+00. MathL.exp(1.6000000000000000D+000): 4.9530324243951152D+000 -Math.exp(1.89999998E+00): 6.68589401E+00. MathL.exp(1.9000000000000000D+000): 6.6858944422792688D+000 -Math.exp(2.00000000E+00): 7.38905621E+00. MathL.exp(2.0000000000000000D+000): 7.3890560989306512D+000 -Math.exp(2.40000010E+00): 1.10231771E+01. MathL.exp(2.4000000000000000D+000): 1.1023176380641602D+001 -Math.exp(2.50000000E+00): 1.21824942E+01. MathL.exp(2.5000000000000000D+000): 1.2182493960703474D+001 -Math.exp(3.00000000E+00): 2.00855370E+01. MathL.exp(3.0000000000000000D+000): 2.0085536923187668D+001 -Math.exp(4.00000000E+00): 5.45981522E+01. MathL.exp(4.0000000000000000D+000): 5.4598150033144232D+001 -Math.exp(-8.9999998E-01): 4.06569660E-01. MathL.exp(-9.000000000000000D-001): 4.0656965974060152D-001 -Math.exp(-1.0000000E+00): 3.67879450E-01. MathL.exp(-1.000000000000000D+000): 3.6787944117144232D-001 -Math.exp(-1.4000000E+00): 2.46596977E-01. MathL.exp(-1.400000000000000D+000): 2.4659696394176248D-001 -Math.exp(-1.5000000E+00): 2.23130152E-01. MathL.exp(-1.500000000000000D+000): 2.2313016014844684D-001 -Math.exp(-1.6000000E+00): 2.01896518E-01. MathL.exp(-1.600000000000000D+000): 2.0189651799465632D-001 -Math.exp(-1.9000000E+00): 1.49568617E-01. MathL.exp(-1.900000000000000D+000): 1.4956861922474082D-001 -Math.exp(-2.0000000E+00): 1.35335281E-01. MathL.exp(-2.000000000000000D+000): 1.3533528323704446D-001 -Math.exp(-2.4000001E+00): 9.07179415E-02. MathL.exp(-2.400000000000000D+000): 9.0717953289412512D-002 -Math.exp(-2.5000000E+00): 8.20849985E-02. MathL.exp(-2.500000000000000D+000): 8.2084998627778512D-002 -Math.exp(-3.0000000E+00): 4.97870669E-02. MathL.exp(-3.000000000000000D+000): 4.9787068367864088D-002 -Math.exp(-4.0000000E+00): 1.83156393E-02. MathL.exp(-4.000000000000000D+000): 1.8315638888927552D-002 +Math.ln(9.00000E-01): -1.05361E-01. MathL.ln(9.00000000000000D-001): -1.05360515657826D-001 +Math.ln(1.00000E+00): 0.00000E+00. MathL.ln(1.00000000000000D+000): 0.00000000000000D+000 +Math.ln(1.40000E+00): 3.36472E-01. MathL.ln(1.40000000000000D+000): 3.36472236621213D-001 +Math.ln(1.50000E+00): 4.05465E-01. MathL.ln(1.50000000000000D+000): 4.05465108108164D-001 +Math.ln(1.60000E+00): 4.70004E-01. MathL.ln(1.60000000000000D+000): 4.70003629245736D-001 +Math.ln(1.90000E+00): 6.41854E-01. MathL.ln(1.90000000000000D+000): 6.41853886172395D-001 +Math.ln(2.00000E+00): 6.93147E-01. MathL.ln(2.00000000000000D+000): 6.93147180559945D-001 +Math.ln(2.40000E+00): 8.75469E-01. MathL.ln(2.40000000000000D+000): 8.75468737353900D-001 +Math.ln(2.50000E+00): 9.16291E-01. MathL.ln(2.50000000000000D+000): 9.16290731874155D-001 +Math.ln(3.00000E+00): 1.09861E+00. MathL.ln(3.00000000000000D+000): 1.09861228866811D+000 +Math.ln(4.00000E+00): 1.38629E+00. MathL.ln(4.00000000000000D+000): 1.38629436111989D+000 +Math.ln(-9.0000E-01): -3.40282E+38. MathL.ln(-9.0000000000000D-001): -1.79769296342094D+308 +Math.ln(-1.0000E+00): -3.40282E+38. MathL.ln(-1.0000000000000D+000): -1.79769296342094D+308 +Math.ln(-1.4000E+00): -3.40282E+38. MathL.ln(-1.4000000000000D+000): -1.79769296342094D+308 +Math.ln(-1.5000E+00): -3.40282E+38. MathL.ln(-1.5000000000000D+000): -1.79769296342094D+308 +Math.ln(-1.6000E+00): -3.40282E+38. MathL.ln(-1.6000000000000D+000): -1.79769296342094D+308 +Math.ln(-1.9000E+00): -3.40282E+38. MathL.ln(-1.9000000000000D+000): -1.79769296342094D+308 +Math.ln(-2.0000E+00): -3.40282E+38. MathL.ln(-2.0000000000000D+000): -1.79769296342094D+308 +Math.ln(-2.4000E+00): -3.40282E+38. MathL.ln(-2.4000000000000D+000): -1.79769296342094D+308 +Math.ln(-2.5000E+00): -3.40282E+38. MathL.ln(-2.5000000000000D+000): -1.79769296342094D+308 +Math.ln(-3.0000E+00): -3.40282E+38. MathL.ln(-3.0000000000000D+000): -1.79769296342094D+308 +Math.ln(-4.0000E+00): -3.40282E+38. MathL.ln(-4.0000000000000D+000): -1.79769296342094D+308 -Math.ln(8.99999976E-01): -1.0536054E-01. MathL.ln(9.0000000000000000D-001): -1.053605156578263D-001 -Math.ln(1.00000000E+00): 0.00000000E+00. MathL.ln(1.0000000000000000D+000): 0.0000000000000000D+000 -Math.ln(1.39999998E+00): 3.36472213E-01. MathL.ln(1.4000000000000000D+000): 3.3647223662121288D-001 -Math.ln(1.50000000E+00): 4.05465096E-01. MathL.ln(1.5000000000000000D+000): 4.0546510810816440D-001 -Math.ln(1.60000002E+00): 4.70003664E-01. MathL.ln(1.6000000000000000D+000): 4.7000362924573560D-001 -Math.ln(1.89999998E+00): 6.41853869E-01. MathL.ln(1.9000000000000000D+000): 6.4185388617239472D-001 -Math.ln(2.00000000E+00): 6.93147182E-01. MathL.ln(2.0000000000000000D+000): 6.9314718055994528D-001 -Math.ln(2.40000010E+00): 8.75468791E-01. MathL.ln(2.4000000000000000D+000): 8.7546873735390000D-001 -Math.ln(2.50000000E+00): 9.16290760E-01. MathL.ln(2.5000000000000000D+000): 9.1629073187415488D-001 -Math.ln(3.00000000E+00): 1.09861231E+00. MathL.ln(3.0000000000000000D+000): 1.0986122886681098D+000 -Math.ln(4.00000000E+00): 1.38629436E+00. MathL.ln(4.0000000000000000D+000): 1.3862943611198906D+000 -Math.ln(-8.9999998E-01): -3.4028235E+38. MathL.ln(-9.000000000000000D-001): -1.797692963420939D+308 -Math.ln(-1.0000000E+00): -3.4028235E+38. MathL.ln(-1.000000000000000D+000): -1.797692963420939D+308 -Math.ln(-1.4000000E+00): -3.4028235E+38. MathL.ln(-1.400000000000000D+000): -1.797692963420939D+308 -Math.ln(-1.5000000E+00): -3.4028235E+38. MathL.ln(-1.500000000000000D+000): -1.797692963420939D+308 -Math.ln(-1.6000000E+00): -3.4028235E+38. MathL.ln(-1.600000000000000D+000): -1.797692963420939D+308 -Math.ln(-1.9000000E+00): -3.4028235E+38. MathL.ln(-1.900000000000000D+000): -1.797692963420939D+308 -Math.ln(-2.0000000E+00): -3.4028235E+38. MathL.ln(-2.000000000000000D+000): -1.797692963420939D+308 -Math.ln(-2.4000001E+00): -3.4028235E+38. MathL.ln(-2.400000000000000D+000): -1.797692963420939D+308 -Math.ln(-2.5000000E+00): -3.4028235E+38. MathL.ln(-2.500000000000000D+000): -1.797692963420939D+308 -Math.ln(-3.0000000E+00): -3.4028235E+38. MathL.ln(-3.000000000000000D+000): -1.797692963420939D+308 -Math.ln(-4.0000000E+00): -3.4028235E+38. MathL.ln(-4.000000000000000D+000): -1.797692963420939D+308 +Math.sin(0.00000E+00): 0.00000E+00. MathL.sin(0.00000000000000D+000): 0.00000000000000D+000 +Math.sin(1.00000E-01): 9.98334E-02. MathL.sin(1.00000000000000D-001): 9.98334166468282D-002 +Math.sin(1.04720E+00): 8.66025E-01. MathL.sin(1.04719755119660D+000): 8.66025403784440D-001 +Math.sin(1.57080E+00): 1.00000E+00. MathL.sin(1.57079632679490D+000): 9.99999999999999D-001 +Math.sin(3.14159E+00): -3.10862E-15. MathL.sin(3.14159265358979D+000): 3.23108679839857D-015 +Math.sin(-1.0472E+00): -8.66025E-01. MathL.sin(-1.0471975511966D+000): -8.6602540378444D-001 +Math.sin(-1.5708E+00): -1.0000E+00. MathL.sin(-1.5707963267949D+000): -9.99999999999999D-001 +Math.sin(-3.14159E+00): 3.10862E-15. MathL.sin(-3.14159265358979D+000): -3.23108679839857D-015 -Math.sin(0.00000000E+00): 0.00000000E+00. MathL.sin(0.0000000000000000D+000): 0.0000000000000000D+000 -Math.sin(1.00000001E-01): 9.98334214E-02. MathL.sin(1.0000000000000000D-001): 9.9833416646828144D-002 -Math.sin(1.04719758E+00): 8.66025388E-01. MathL.sin(1.0471975511966000D+000): 8.6602540378443952D-001 -Math.sin(1.57079637E+00): 1.00000000E+00. MathL.sin(1.5707963267949002D+000): 9.9999999999999872D-001 -Math.sin(3.14159274E+00): -3.1086245E-15. MathL.sin(3.1415926535897900D+000): 3.2310867983985708D-015 -Math.sin(-1.0471976E+00): -8.6602539E-01. MathL.sin(-1.047197551196600D+000): -8.660254037844394D-001 -Math.sin(-1.5707964E+00): -1.0000000E+00. MathL.sin(-1.570796326794900D+000): -9.999999999999988D-001 -Math.sin(-3.1415927E+00): 3.10862447E-15. MathL.sin(-3.141592653589790D+000): -3.231086798398571D-015 +Math.cos(0.00000E+00): 1.00000E+00. MathL.cos(0.00000000000000D+000): 9.99999999999999D-001 +Math.cos(1.00000E-01): 9.95004E-01. MathL.cos(1.00000000000000D-001): 9.95004165278025D-001 +Math.cos(1.04720E+00): 5.00000E-01. MathL.cos(1.04719755119660D+000): 4.99999999999998D-001 +Math.cos(1.57080E+00): -1.55431E-15. MathL.cos(1.57079632679490D+000): -3.49148251407644D-015 +Math.cos(3.14159E+00): -1.0000E+00. MathL.cos(3.14159265358979D+000): -9.99999999999999D-001 +Math.cos(-1.0472E+00): 5.00000E-01. MathL.cos(-1.0471975511966D+000): 4.99999999999998D-001 +Math.cos(-1.5708E+00): -1.55431E-15. MathL.cos(-1.5707963267949D+000): -3.49148251407644D-015 +Math.cos(-3.14159E+00): -1.0000E+00. MathL.cos(-3.14159265358979D+000): -9.99999999999999D-001 -Math.cos(0.00000000E+00): 1.00000000E+00. MathL.cos(0.0000000000000000D+000): 9.9999999999999856D-001 -Math.cos(1.00000001E-01): 9.95004177E-01. MathL.cos(1.0000000000000000D-001): 9.9500416527802480D-001 -Math.cos(1.04719758E+00): 5.00000000E-01. MathL.cos(1.0471975511966000D+000): 4.9999999999999808D-001 -Math.cos(1.57079637E+00): -1.5543122E-15. MathL.cos(1.5707963267949002D+000): -3.491482514076435D-015 -Math.cos(3.14159274E+00): -1.0000000E+00. MathL.cos(3.1415926535897900D+000): -9.999999999999988D-001 -Math.cos(-1.0471976E+00): 5.00000000E-01. MathL.cos(-1.047197551196600D+000): 4.9999999999999808D-001 -Math.cos(-1.5707964E+00): -1.5543122E-15. MathL.cos(-1.570796326794900D+000): -3.491482514076435D-015 -Math.cos(-3.1415927E+00): -1.0000000E+00. MathL.cos(-3.141592653589790D+000): -9.999999999999988D-001 +Math.tan(0.00000E+00): 0.00000E+00. MathL.tan(0.00000000000000D+000): 0.00000000000000D+000 +Math.tan(1.00000E-01): 1.00335E-01. MathL.tan(1.00000000000000D-001): 1.00334672085451D-001 +Math.tan(1.04720E+00): 1.73205E+00. MathL.tan(1.04719755119660D+000): 1.73205080756888D+000 +Math.tan(1.57080E+00): 3.00240E+14. MathL.tan(1.57079632679490D+000): 2.02340838177263D+007 +Math.tan(3.14159E+00): -6.66134E-15. MathL.tan(3.14159265358979D+000): 3.23108679839857D-015 +Math.tan(-1.0472E+00): -1.73205E+00. MathL.tan(-1.0471975511966D+000): -1.73205080756888D+000 +Math.tan(-1.5708E+00): -3.0024E+14. MathL.tan(-1.5707963267949D+000): -2.02340838177263D+007 +Math.tan(-3.14159E+00): 6.66134E-15. MathL.tan(-3.14159265358979D+000): -3.23108679839857D-015 -Math.tan(0.00000000E+00): 0.00000000E+00. MathL.tan(0.0000000000000000D+000): 0.0000000000000000D+000 -Math.tan(1.00000001E-01): 1.00334682E-01. MathL.tan(1.0000000000000000D-001): 1.0033467208545054D-001 -Math.tan(1.04719758E+00): 1.73205066E+00. MathL.tan(1.0471975511966000D+000): 1.7320508075688840D+000 -Math.tan(1.57079637E+00): 3.00239991E+14. MathL.tan(1.5707963267949002D+000): 2.0234083817726248D+007 -Math.tan(3.14159274E+00): -6.6613381E-15. MathL.tan(3.1415926535897900D+000): 3.2310867983985684D-015 -Math.tan(-1.0471976E+00): -1.7320507E+00. MathL.tan(-1.047197551196600D+000): -1.732050807568884D+000 -Math.tan(-1.5707964E+00): -3.0023999E+14. MathL.tan(-1.570796326794900D+000): -2.023408381772625D+007 -Math.tan(-3.1415927E+00): 6.66133815E-15. MathL.tan(-3.141592653589790D+000): -3.231086798398569D-015 +Math.arcsin(9.00000E-01): -4.51027E-01. MathL.arcsin(9.00000000000000D-001): 1.11976951499864D+000 +Math.arcsin(1.00000E+00): -0.0000E+00. MathL.arcsin(1.00000000000000D+000): 1.57079632679490D+000 +Math.arcsin(1.40000E+00): 3.40282E+38. MathL.arcsin(1.40000000000000D+000): 1.79769296342094D+308 +Math.arcsin(1.50000E+00): 3.40282E+38. MathL.arcsin(1.50000000000000D+000): 1.79769296342094D+308 +Math.arcsin(1.60000E+00): 3.40282E+38. MathL.arcsin(1.60000000000000D+000): 1.79769296342094D+308 +Math.arcsin(1.90000E+00): 3.40282E+38. MathL.arcsin(1.90000000000000D+000): 1.79769296342094D+308 +Math.arcsin(2.00000E+00): 3.40282E+38. MathL.arcsin(2.00000000000000D+000): 1.79769296342094D+308 +Math.arcsin(2.40000E+00): 3.40282E+38. MathL.arcsin(2.40000000000000D+000): 1.79769296342094D+308 +Math.arcsin(2.50000E+00): 3.40282E+38. MathL.arcsin(2.50000000000000D+000): 1.79769296342094D+308 +Math.arcsin(3.00000E+00): 3.40282E+38. MathL.arcsin(3.00000000000000D+000): 1.79769296342094D+308 +Math.arcsin(4.00000E+00): 3.40282E+38. MathL.arcsin(4.00000000000000D+000): 1.79769296342094D+308 +Math.arcsin(-9.0000E-01): -4.51027E-01. MathL.arcsin(-9.0000000000000D-001): -1.11976951499864D+000 +Math.arcsin(-1.0000E+00): -0.0000E+00. MathL.arcsin(-1.0000000000000D+000): -1.5707963267949D+000 +Math.arcsin(-1.4000E+00): 3.40282E+38. MathL.arcsin(-1.4000000000000D+000): 1.79769296342094D+308 +Math.arcsin(-1.5000E+00): 3.40282E+38. MathL.arcsin(-1.5000000000000D+000): 1.79769296342094D+308 +Math.arcsin(-1.6000E+00): 3.40282E+38. MathL.arcsin(-1.6000000000000D+000): 1.79769296342094D+308 +Math.arcsin(-1.9000E+00): 3.40282E+38. MathL.arcsin(-1.9000000000000D+000): 1.79769296342094D+308 +Math.arcsin(-2.0000E+00): 3.40282E+38. MathL.arcsin(-2.0000000000000D+000): 1.79769296342094D+308 +Math.arcsin(-2.4000E+00): 3.40282E+38. MathL.arcsin(-2.4000000000000D+000): 1.79769296342094D+308 +Math.arcsin(-2.5000E+00): 3.40282E+38. MathL.arcsin(-2.5000000000000D+000): 1.79769296342094D+308 +Math.arcsin(-3.0000E+00): 3.40282E+38. MathL.arcsin(-3.0000000000000D+000): 1.79769296342094D+308 +Math.arcsin(-4.0000E+00): 3.40282E+38. MathL.arcsin(-4.0000000000000D+000): 1.79769296342094D+308 -Math.arcsin(8.99999976E-01): -4.5102686E-01. MathL.arcsin(9.0000000000000000D-001): 1.1197695149986360D+000 -Math.arcsin(1.00000000E+00): -0.0000000E+00. MathL.arcsin(1.0000000000000000D+000): 1.5707963267949002D+000 -Math.arcsin(1.39999998E+00): 3.40282347E+38. MathL.arcsin(1.4000000000000000D+000): 1.7976929634209390D+308 -Math.arcsin(1.50000000E+00): 3.40282347E+38. MathL.arcsin(1.5000000000000000D+000): 1.7976929634209390D+308 -Math.arcsin(1.60000002E+00): 3.40282347E+38. MathL.arcsin(1.6000000000000000D+000): 1.7976929634209390D+308 -Math.arcsin(1.89999998E+00): 3.40282347E+38. MathL.arcsin(1.9000000000000000D+000): 1.7976929634209390D+308 -Math.arcsin(2.00000000E+00): 3.40282347E+38. MathL.arcsin(2.0000000000000000D+000): 1.7976929634209390D+308 -Math.arcsin(2.40000010E+00): 3.40282347E+38. MathL.arcsin(2.4000000000000000D+000): 1.7976929634209390D+308 -Math.arcsin(2.50000000E+00): 3.40282347E+38. MathL.arcsin(2.5000000000000000D+000): 1.7976929634209390D+308 -Math.arcsin(3.00000000E+00): 3.40282347E+38. MathL.arcsin(3.0000000000000000D+000): 1.7976929634209390D+308 -Math.arcsin(4.00000000E+00): 3.40282347E+38. MathL.arcsin(4.0000000000000000D+000): 1.7976929634209390D+308 -Math.arcsin(-8.9999998E-01): -4.5102686E-01. MathL.arcsin(-9.000000000000000D-001): -1.119769514998636D+000 -Math.arcsin(-1.0000000E+00): -0.0000000E+00. MathL.arcsin(-1.000000000000000D+000): -1.570796326794900D+000 -Math.arcsin(-1.4000000E+00): 3.40282347E+38. MathL.arcsin(-1.400000000000000D+000): 1.7976929634209390D+308 -Math.arcsin(-1.5000000E+00): 3.40282347E+38. MathL.arcsin(-1.500000000000000D+000): 1.7976929634209390D+308 -Math.arcsin(-1.6000000E+00): 3.40282347E+38. MathL.arcsin(-1.600000000000000D+000): 1.7976929634209390D+308 -Math.arcsin(-1.9000000E+00): 3.40282347E+38. MathL.arcsin(-1.900000000000000D+000): 1.7976929634209390D+308 -Math.arcsin(-2.0000000E+00): 3.40282347E+38. MathL.arcsin(-2.000000000000000D+000): 1.7976929634209390D+308 -Math.arcsin(-2.4000001E+00): 3.40282347E+38. MathL.arcsin(-2.400000000000000D+000): 1.7976929634209390D+308 -Math.arcsin(-2.5000000E+00): 3.40282347E+38. MathL.arcsin(-2.500000000000000D+000): 1.7976929634209390D+308 -Math.arcsin(-3.0000000E+00): 3.40282347E+38. MathL.arcsin(-3.000000000000000D+000): 1.7976929634209390D+308 -Math.arcsin(-4.0000000E+00): 3.40282347E+38. MathL.arcsin(-4.000000000000000D+000): 1.7976929634209390D+308 +Math.arccos(9.00000E-01): -4.51027E-01. MathL.arccos(9.00000000000000D-001): 4.51026811796263D-001 +Math.arccos(1.00000E+00): -0.0000E+00. MathL.arccos(1.00000000000000D+000): 0.00000000000000D+000 +Math.arccos(1.40000E+00): 3.40282E+38. MathL.arccos(1.40000000000000D+000): 1.79769296342094D+308 +Math.arccos(1.50000E+00): 3.40282E+38. MathL.arccos(1.50000000000000D+000): 1.79769296342094D+308 +Math.arccos(1.60000E+00): 3.40282E+38. MathL.arccos(1.60000000000000D+000): 1.79769296342094D+308 +Math.arccos(1.90000E+00): 3.40282E+38. MathL.arccos(1.90000000000000D+000): 1.79769296342094D+308 +Math.arccos(2.00000E+00): 3.40282E+38. MathL.arccos(2.00000000000000D+000): 1.79769296342094D+308 +Math.arccos(2.40000E+00): 3.40282E+38. MathL.arccos(2.40000000000000D+000): 1.79769296342094D+308 +Math.arccos(2.50000E+00): 3.40282E+38. MathL.arccos(2.50000000000000D+000): 1.79769296342094D+308 +Math.arccos(3.00000E+00): 3.40282E+38. MathL.arccos(3.00000000000000D+000): 1.79769296342094D+308 +Math.arccos(4.00000E+00): 3.40282E+38. MathL.arccos(4.00000000000000D+000): 1.79769296342094D+308 +Math.arccos(-9.0000E-01): -4.51027E-01. MathL.arccos(-9.0000000000000D-001): 2.69056584179353D+000 +Math.arccos(-1.0000E+00): -0.0000E+00. MathL.arccos(-1.0000000000000D+000): 3.14159265358979D+000 +Math.arccos(-1.4000E+00): 3.40282E+38. MathL.arccos(-1.4000000000000D+000): 1.79769296342094D+308 +Math.arccos(-1.5000E+00): 3.40282E+38. MathL.arccos(-1.5000000000000D+000): 1.79769296342094D+308 +Math.arccos(-1.6000E+00): 3.40282E+38. MathL.arccos(-1.6000000000000D+000): 1.79769296342094D+308 +Math.arccos(-1.9000E+00): 3.40282E+38. MathL.arccos(-1.9000000000000D+000): 1.79769296342094D+308 +Math.arccos(-2.0000E+00): 3.40282E+38. MathL.arccos(-2.0000000000000D+000): 1.79769296342094D+308 +Math.arccos(-2.4000E+00): 3.40282E+38. MathL.arccos(-2.4000000000000D+000): 1.79769296342094D+308 +Math.arccos(-2.5000E+00): 3.40282E+38. MathL.arccos(-2.5000000000000D+000): 1.79769296342094D+308 +Math.arccos(-3.0000E+00): 3.40282E+38. MathL.arccos(-3.0000000000000D+000): 1.79769296342094D+308 +Math.arccos(-4.0000E+00): 3.40282E+38. MathL.arccos(-4.0000000000000D+000): 1.79769296342094D+308 -Math.arccos(8.99999976E-01): -4.5102686E-01. MathL.arccos(9.0000000000000000D-001): 4.5102681179626320D-001 -Math.arccos(1.00000000E+00): -0.0000000E+00. MathL.arccos(1.0000000000000000D+000): 0.0000000000000000D+000 -Math.arccos(1.39999998E+00): 3.40282347E+38. MathL.arccos(1.4000000000000000D+000): 1.7976929634209390D+308 -Math.arccos(1.50000000E+00): 3.40282347E+38. MathL.arccos(1.5000000000000000D+000): 1.7976929634209390D+308 -Math.arccos(1.60000002E+00): 3.40282347E+38. MathL.arccos(1.6000000000000000D+000): 1.7976929634209390D+308 -Math.arccos(1.89999998E+00): 3.40282347E+38. MathL.arccos(1.9000000000000000D+000): 1.7976929634209390D+308 -Math.arccos(2.00000000E+00): 3.40282347E+38. MathL.arccos(2.0000000000000000D+000): 1.7976929634209390D+308 -Math.arccos(2.40000010E+00): 3.40282347E+38. MathL.arccos(2.4000000000000000D+000): 1.7976929634209390D+308 -Math.arccos(2.50000000E+00): 3.40282347E+38. MathL.arccos(2.5000000000000000D+000): 1.7976929634209390D+308 -Math.arccos(3.00000000E+00): 3.40282347E+38. MathL.arccos(3.0000000000000000D+000): 1.7976929634209390D+308 -Math.arccos(4.00000000E+00): 3.40282347E+38. MathL.arccos(4.0000000000000000D+000): 1.7976929634209390D+308 -Math.arccos(-8.9999998E-01): -4.5102686E-01. MathL.arccos(-9.000000000000000D-001): 2.6905658417935268D+000 -Math.arccos(-1.0000000E+00): -0.0000000E+00. MathL.arccos(-1.000000000000000D+000): 3.1415926535897900D+000 -Math.arccos(-1.4000000E+00): 3.40282347E+38. MathL.arccos(-1.400000000000000D+000): 1.7976929634209390D+308 -Math.arccos(-1.5000000E+00): 3.40282347E+38. MathL.arccos(-1.500000000000000D+000): 1.7976929634209390D+308 -Math.arccos(-1.6000000E+00): 3.40282347E+38. MathL.arccos(-1.600000000000000D+000): 1.7976929634209390D+308 -Math.arccos(-1.9000000E+00): 3.40282347E+38. MathL.arccos(-1.900000000000000D+000): 1.7976929634209390D+308 -Math.arccos(-2.0000000E+00): 3.40282347E+38. MathL.arccos(-2.000000000000000D+000): 1.7976929634209390D+308 -Math.arccos(-2.4000001E+00): 3.40282347E+38. MathL.arccos(-2.400000000000000D+000): 1.7976929634209390D+308 -Math.arccos(-2.5000000E+00): 3.40282347E+38. MathL.arccos(-2.500000000000000D+000): 1.7976929634209390D+308 -Math.arccos(-3.0000000E+00): 3.40282347E+38. MathL.arccos(-3.000000000000000D+000): 1.7976929634209390D+308 -Math.arccos(-4.0000000E+00): 3.40282347E+38. MathL.arccos(-4.000000000000000D+000): 1.7976929634209390D+308 +Math.arctan(9.00000E-01): 7.32815E-01. MathL.arctan(9.00000000000000D-001): 7.32815101786508D-001 +Math.arctan(1.00000E+00): 7.85398E-01. MathL.arctan(1.00000000000000D+000): 7.85398163397449D-001 +Math.arctan(1.40000E+00): 9.50547E-01. MathL.arctan(1.40000000000000D+000): 9.50546840812077D-001 +Math.arctan(1.50000E+00): 9.82794E-01. MathL.arctan(1.50000000000000D+000): 9.82793723247331D-001 +Math.arctan(1.60000E+00): 1.01220E+00. MathL.arctan(1.60000000000000D+000): 1.01219701145134D+000 +Math.arctan(1.90000E+00): 1.08632E+00. MathL.arctan(1.90000000000000D+000): 1.08631839775788D+000 +Math.arctan(2.00000E+00): 1.10715E+00. MathL.arctan(2.00000000000000D+000): 1.10714871779409D+000 +Math.arctan(2.40000E+00): 1.17601E+00. MathL.arctan(2.40000000000000D+000): 1.17600520709514D+000 +Math.arctan(2.50000E+00): 1.19029E+00. MathL.arctan(2.50000000000000D+000): 1.19028994968253D+000 +Math.arctan(3.00000E+00): 1.24905E+00. MathL.arctan(3.00000000000000D+000): 1.24904577239826D+000 +Math.arctan(4.00000E+00): 1.32582E+00. MathL.arctan(4.00000000000000D+000): 1.32581766366804D+000 +Math.arctan(-9.0000E-01): -7.32815E-01. MathL.arctan(-9.0000000000000D-001): -7.32815101786508D-001 +Math.arctan(-1.0000E+00): -7.85398E-01. MathL.arctan(-1.0000000000000D+000): -7.85398163397449D-001 +Math.arctan(-1.4000E+00): -9.50547E-01. MathL.arctan(-1.4000000000000D+000): -9.50546840812077D-001 +Math.arctan(-1.5000E+00): -9.82794E-01. MathL.arctan(-1.5000000000000D+000): -9.82793723247331D-001 +Math.arctan(-1.6000E+00): -1.0122E+00. MathL.arctan(-1.6000000000000D+000): -1.01219701145134D+000 +Math.arctan(-1.9000E+00): -1.08632E+00. MathL.arctan(-1.9000000000000D+000): -1.08631839775788D+000 +Math.arctan(-2.0000E+00): -1.10715E+00. MathL.arctan(-2.0000000000000D+000): -1.10714871779409D+000 +Math.arctan(-2.4000E+00): -1.17601E+00. MathL.arctan(-2.4000000000000D+000): -1.17600520709514D+000 +Math.arctan(-2.5000E+00): -1.19029E+00. MathL.arctan(-2.5000000000000D+000): -1.19028994968253D+000 +Math.arctan(-3.0000E+00): -1.24905E+00. MathL.arctan(-3.0000000000000D+000): -1.24904577239826D+000 +Math.arctan(-4.0000E+00): -1.32582E+00. MathL.arctan(-4.0000000000000D+000): -1.32581766366804D+000 -Math.arctan(8.99999976E-01): 7.32815087E-01. MathL.arctan(9.0000000000000000D-001): 7.3281510178650752D-001 -Math.arctan(1.00000000E+00): 7.85398126E-01. MathL.arctan(1.0000000000000000D+000): 7.8539816339744912D-001 -Math.arctan(1.39999998E+00): 9.50546861E-01. MathL.arctan(1.4000000000000000D+000): 9.5054684081207680D-001 -Math.arctan(1.50000000E+00): 9.82793748E-01. MathL.arctan(1.5000000000000000D+000): 9.8279372324733072D-001 -Math.arctan(1.60000002E+00): 1.01219702E+00. MathL.arctan(1.6000000000000000D+000): 1.0121970114513358D+000 -Math.arctan(1.89999998E+00): 1.08631849E+00. MathL.arctan(1.9000000000000000D+000): 1.0863183977578750D+000 -Math.arctan(2.00000000E+00): 1.10714877E+00. MathL.arctan(2.0000000000000000D+000): 1.1071487177940922D+000 -Math.arctan(2.40000010E+00): 1.17600524E+00. MathL.arctan(2.4000000000000000D+000): 1.1760052070951368D+000 -Math.arctan(2.50000000E+00): 1.19028997E+00. MathL.arctan(2.5000000000000000D+000): 1.1902899496825334D+000 -Math.arctan(3.00000000E+00): 1.24904585E+00. MathL.arctan(3.0000000000000000D+000): 1.2490457723982562D+000 -Math.arctan(4.00000000E+00): 1.32581770E+00. MathL.arctan(4.0000000000000000D+000): 1.3258176636680358D+000 -Math.arctan(-8.9999998E-01): -7.3281509E-01. MathL.arctan(-9.000000000000000D-001): -7.328151017865076D-001 -Math.arctan(-1.0000000E+00): -7.8539813E-01. MathL.arctan(-1.000000000000000D+000): -7.853981633974492D-001 -Math.arctan(-1.4000000E+00): -9.5054686E-01. MathL.arctan(-1.400000000000000D+000): -9.505468408120768D-001 -Math.arctan(-1.5000000E+00): -9.8279375E-01. MathL.arctan(-1.500000000000000D+000): -9.827937232473306D-001 -Math.arctan(-1.6000000E+00): -1.0121970E+00. MathL.arctan(-1.600000000000000D+000): -1.012197011451336D+000 -Math.arctan(-1.9000000E+00): -1.0863185E+00. MathL.arctan(-1.900000000000000D+000): -1.086318397757875D+000 -Math.arctan(-2.0000000E+00): -1.1071488E+00. MathL.arctan(-2.000000000000000D+000): -1.107148717794092D+000 -Math.arctan(-2.4000001E+00): -1.1760052E+00. MathL.arctan(-2.400000000000000D+000): -1.176005207095137D+000 -Math.arctan(-2.5000000E+00): -1.1902900E+00. MathL.arctan(-2.500000000000000D+000): -1.190289949682534D+000 -Math.arctan(-3.0000000E+00): -1.2490458E+00. MathL.arctan(-3.000000000000000D+000): -1.249045772398256D+000 -Math.arctan(-4.0000000E+00): -1.3258177E+00. MathL.arctan(-4.000000000000000D+000): -1.325817663668036D+000 +Math.sinh(9.00000E-01): 1.02652E+00. MathL.sinh(9.00000000000000D-001): 1.02651672570818D+000 +Math.sinh(1.00000E+00): 1.17520E+00. MathL.sinh(1.00000000000000D+000): 1.17520119364380D+000 +Math.sinh(1.40000E+00): 1.90430E+00. MathL.sinh(1.40000000000000D+000): 1.90430150145153D+000 +Math.sinh(1.50000E+00): 2.12928E+00. MathL.sinh(1.50000000000000D+000): 2.12927945509482D+000 +Math.sinh(1.60000E+00): 2.37557E+00. MathL.sinh(1.60000000000000D+000): 2.37556795320023D+000 +Math.sinh(1.90000E+00): 3.26816E+00. MathL.sinh(1.90000000000000D+000): 3.26816291152832D+000 +Math.sinh(2.00000E+00): 3.62686E+00. MathL.sinh(2.00000000000000D+000): 3.62686040784702D+000 +Math.sinh(2.40000E+00): 5.46623E+00. MathL.sinh(2.40000000000000D+000): 5.46622921367609D+000 +Math.sinh(2.50000E+00): 6.05020E+00. MathL.sinh(2.50000000000000D+000): 6.05020448103979D+000 +Math.sinh(3.00000E+00): 1.00179E+01. MathL.sinh(3.00000000000000D+000): 1.00178749274099D+001 +Math.sinh(4.00000E+00): 2.72899E+01. MathL.sinh(4.00000000000000D+000): 2.72899171971278D+001 +Math.sinh(-9.0000E-01): -1.02652E+00. MathL.sinh(-9.0000000000000D-001): -1.02651672570818D+000 +Math.sinh(-1.0000E+00): -1.1752E+00. MathL.sinh(-1.0000000000000D+000): -1.1752011936438D+000 +Math.sinh(-1.4000E+00): -1.9043E+00. MathL.sinh(-1.4000000000000D+000): -1.90430150145153D+000 +Math.sinh(-1.5000E+00): -2.12928E+00. MathL.sinh(-1.5000000000000D+000): -2.12927945509482D+000 +Math.sinh(-1.6000E+00): -2.37557E+00. MathL.sinh(-1.6000000000000D+000): -2.37556795320023D+000 +Math.sinh(-1.9000E+00): -3.26816E+00. MathL.sinh(-1.9000000000000D+000): -3.26816291152832D+000 +Math.sinh(-2.0000E+00): -3.62686E+00. MathL.sinh(-2.0000000000000D+000): -3.62686040784702D+000 +Math.sinh(-2.4000E+00): -5.46623E+00. MathL.sinh(-2.4000000000000D+000): -5.46622921367609D+000 +Math.sinh(-2.5000E+00): -6.0502E+00. MathL.sinh(-2.5000000000000D+000): -6.05020448103979D+000 +Math.sinh(-3.0000E+00): -1.00179E+01. MathL.sinh(-3.0000000000000D+000): -1.00178749274099D+001 +Math.sinh(-4.0000E+00): -2.72899E+01. MathL.sinh(-4.0000000000000D+000): -2.72899171971278D+001 -Math.sinh(8.99999976E-01): 1.02651668E+00. MathL.sinh(9.0000000000000000D-001): 1.0265167257081750D+000 -Math.sinh(1.00000000E+00): 1.17520118E+00. MathL.sinh(1.0000000000000000D+000): 1.1752011936438012D+000 -Math.sinh(1.39999998E+00): 1.90430152E+00. MathL.sinh(1.4000000000000000D+000): 1.9043015014515340D+000 -Math.sinh(1.50000000E+00): 2.12927938E+00. MathL.sinh(1.5000000000000000D+000): 2.1292794550948172D+000 -Math.sinh(1.60000002E+00): 2.37556791E+00. MathL.sinh(1.6000000000000000D+000): 2.3755679532002296D+000 -Math.sinh(1.89999998E+00): 3.26816273E+00. MathL.sinh(1.9000000000000000D+000): 3.2681629115283168D+000 -Math.sinh(2.00000000E+00): 3.62686038E+00. MathL.sinh(2.0000000000000000D+000): 3.6268604078470192D+000 -Math.sinh(2.40000010E+00): 5.46622944E+00. MathL.sinh(2.4000000000000000D+000): 5.4662292136760936D+000 -Math.sinh(2.50000000E+00): 6.05020475E+00. MathL.sinh(2.5000000000000000D+000): 6.0502044810397872D+000 -Math.sinh(3.00000000E+00): 1.00178747E+01. MathL.sinh(3.0000000000000000D+000): 1.0017874927409902D+001 -Math.sinh(4.00000000E+00): 2.72899189E+01. MathL.sinh(4.0000000000000000D+000): 2.7289917197127748D+001 -Math.sinh(-8.9999998E-01): -1.0265167E+00. MathL.sinh(-9.000000000000000D-001): -1.026516725708175D+000 -Math.sinh(-1.0000000E+00): -1.1752012E+00. MathL.sinh(-1.000000000000000D+000): -1.175201193643801D+000 -Math.sinh(-1.4000000E+00): -1.9043015E+00. MathL.sinh(-1.400000000000000D+000): -1.904301501451534D+000 -Math.sinh(-1.5000000E+00): -2.1292794E+00. MathL.sinh(-1.500000000000000D+000): -2.129279455094817D+000 -Math.sinh(-1.6000000E+00): -2.3755679E+00. MathL.sinh(-1.600000000000000D+000): -2.375567953200230D+000 -Math.sinh(-1.9000000E+00): -3.2681627E+00. MathL.sinh(-1.900000000000000D+000): -3.268162911528317D+000 -Math.sinh(-2.0000000E+00): -3.6268604E+00. MathL.sinh(-2.000000000000000D+000): -3.626860407847019D+000 -Math.sinh(-2.4000001E+00): -5.4662294E+00. MathL.sinh(-2.400000000000000D+000): -5.466229213676094D+000 -Math.sinh(-2.5000000E+00): -6.0502048E+00. MathL.sinh(-2.500000000000000D+000): -6.050204481039788D+000 -Math.sinh(-3.0000000E+00): -1.0017875E+01. MathL.sinh(-3.000000000000000D+000): -1.001787492740990D+001 -Math.sinh(-4.0000000E+00): -2.7289919E+01. MathL.sinh(-4.000000000000000D+000): -2.728991719712775D+001 +Math.cosh(9.00000E-01): 1.43309E+00. MathL.cosh(9.00000000000000D-001): 1.43308638544877D+000 +Math.cosh(1.00000E+00): 1.54308E+00. MathL.cosh(1.00000000000000D+000): 1.54308063481524D+000 +Math.cosh(1.40000E+00): 2.15090E+00. MathL.cosh(1.40000000000000D+000): 2.15089846539314D+000 +Math.cosh(1.50000E+00): 2.35241E+00. MathL.cosh(1.50000000000000D+000): 2.35240961524325D+000 +Math.cosh(1.60000E+00): 2.57746E+00. MathL.cosh(1.60000000000000D+000): 2.57746447119489D+000 +Math.cosh(1.90000E+00): 3.41773E+00. MathL.cosh(1.90000000000000D+000): 3.41773153075095D+000 +Math.cosh(2.00000E+00): 3.76220E+00. MathL.cosh(2.00000000000000D+000): 3.76219569108363D+000 +Math.cosh(2.40000E+00): 5.55695E+00. MathL.cosh(2.40000000000000D+000): 5.55694716696551D+000 +Math.cosh(2.50000E+00): 6.13229E+00. MathL.cosh(2.50000000000000D+000): 6.13228947966369D+000 +Math.cosh(3.00000E+00): 1.00677E+01. MathL.cosh(3.00000000000000D+000): 1.00676619957778D+001 +Math.cosh(4.00000E+00): 2.73082E+01. MathL.cosh(4.00000000000000D+000): 2.73082328360165D+001 +Math.cosh(-9.0000E-01): 1.43309E+00. MathL.cosh(-9.0000000000000D-001): 1.43308638544877D+000 +Math.cosh(-1.0000E+00): 1.54308E+00. MathL.cosh(-1.0000000000000D+000): 1.54308063481524D+000 +Math.cosh(-1.4000E+00): 2.15090E+00. MathL.cosh(-1.4000000000000D+000): 2.15089846539314D+000 +Math.cosh(-1.5000E+00): 2.35241E+00. MathL.cosh(-1.5000000000000D+000): 2.35240961524325D+000 +Math.cosh(-1.6000E+00): 2.57746E+00. MathL.cosh(-1.6000000000000D+000): 2.57746447119489D+000 +Math.cosh(-1.9000E+00): 3.41773E+00. MathL.cosh(-1.9000000000000D+000): 3.41773153075095D+000 +Math.cosh(-2.0000E+00): 3.76220E+00. MathL.cosh(-2.0000000000000D+000): 3.76219569108363D+000 +Math.cosh(-2.4000E+00): 5.55695E+00. MathL.cosh(-2.4000000000000D+000): 5.55694716696551D+000 +Math.cosh(-2.5000E+00): 6.13229E+00. MathL.cosh(-2.5000000000000D+000): 6.13228947966369D+000 +Math.cosh(-3.0000E+00): 1.00677E+01. MathL.cosh(-3.0000000000000D+000): 1.00676619957778D+001 +Math.cosh(-4.0000E+00): 2.73082E+01. MathL.cosh(-4.0000000000000D+000): 2.73082328360165D+001 -Math.cosh(8.99999976E-01): 1.43308640E+00. MathL.cosh(9.0000000000000000D-001): 1.4330863854487746D+000 -Math.cosh(1.00000000E+00): 1.54308057E+00. MathL.cosh(1.0000000000000000D+000): 1.5430806348152440D+000 -Math.cosh(1.39999998E+00): 2.15089846E+00. MathL.cosh(1.4000000000000000D+000): 2.1508984653931408D+000 -Math.cosh(1.50000000E+00): 2.35240960E+00. MathL.cosh(1.5000000000000000D+000): 2.3524096152432472D+000 -Math.cosh(1.60000002E+00): 2.57746458E+00. MathL.cosh(1.6000000000000000D+000): 2.5774644711948852D+000 -Math.cosh(1.89999998E+00): 3.41773129E+00. MathL.cosh(1.9000000000000000D+000): 3.4177315307509520D+000 -Math.cosh(2.00000000E+00): 3.76219583E+00. MathL.cosh(2.0000000000000000D+000): 3.7621956910836312D+000 -Math.cosh(2.40000010E+00): 5.55694771E+00. MathL.cosh(2.4000000000000000D+000): 5.5569471669655072D+000 -Math.cosh(2.50000000E+00): 6.13228941E+00. MathL.cosh(2.5000000000000000D+000): 6.1322894796636856D+000 -Math.cosh(3.00000000E+00): 1.00676622E+01. MathL.cosh(3.0000000000000000D+000): 1.0067661995777766D+001 -Math.cosh(4.00000000E+00): 2.73082333E+01. MathL.cosh(4.0000000000000000D+000): 2.7308232836016488D+001 -Math.cosh(-8.9999998E-01): 1.43308640E+00. MathL.cosh(-9.000000000000000D-001): 1.4330863854487746D+000 -Math.cosh(-1.0000000E+00): 1.54308057E+00. MathL.cosh(-1.000000000000000D+000): 1.5430806348152440D+000 -Math.cosh(-1.4000000E+00): 2.15089846E+00. MathL.cosh(-1.400000000000000D+000): 2.1508984653931408D+000 -Math.cosh(-1.5000000E+00): 2.35240960E+00. MathL.cosh(-1.500000000000000D+000): 2.3524096152432472D+000 -Math.cosh(-1.6000000E+00): 2.57746458E+00. MathL.cosh(-1.600000000000000D+000): 2.5774644711948852D+000 -Math.cosh(-1.9000000E+00): 3.41773129E+00. MathL.cosh(-1.900000000000000D+000): 3.4177315307509520D+000 -Math.cosh(-2.0000000E+00): 3.76219583E+00. MathL.cosh(-2.000000000000000D+000): 3.7621956910836312D+000 -Math.cosh(-2.4000001E+00): 5.55694771E+00. MathL.cosh(-2.400000000000000D+000): 5.5569471669655072D+000 -Math.cosh(-2.5000000E+00): 6.13228941E+00. MathL.cosh(-2.500000000000000D+000): 6.1322894796636856D+000 -Math.cosh(-3.0000000E+00): 1.00676622E+01. MathL.cosh(-3.000000000000000D+000): 1.0067661995777766D+001 -Math.cosh(-4.0000000E+00): 2.73082333E+01. MathL.cosh(-4.000000000000000D+000): 2.7308232836016488D+001 +Math.tanh(9.00000E-01): 7.16298E-01. MathL.tanh(9.00000000000000D-001): 7.16297870199025D-001 +Math.tanh(1.00000E+00): 7.61594E-01. MathL.tanh(1.00000000000000D+000): 7.61594155955765D-001 +Math.tanh(1.40000E+00): 8.85352E-01. MathL.tanh(1.40000000000000D+000): 8.85351648202263D-001 +Math.tanh(1.50000E+00): 9.05148E-01. MathL.tanh(1.50000000000000D+000): 9.05148253644866D-001 +Math.tanh(1.60000E+00): 9.21669E-01. MathL.tanh(1.60000000000000D+000): 9.21668554406471D-001 +Math.tanh(1.90000E+00): 9.56237E-01. MathL.tanh(1.90000000000000D+000): 9.56237458127739D-001 +Math.tanh(2.00000E+00): 9.64028E-01. MathL.tanh(2.00000000000000D+000): 9.64027580075817D-001 +Math.tanh(2.40000E+00): 9.83675E-01. MathL.tanh(2.40000000000000D+000): 9.83674857693680D-001 +Math.tanh(2.50000E+00): 9.86614E-01. MathL.tanh(2.50000000000000D+000): 9.86614298151430D-001 +Math.tanh(3.00000E+00): 9.95055E-01. MathL.tanh(3.00000000000000D+000): 9.95054753686731D-001 +Math.tanh(4.00000E+00): 9.99329E-01. MathL.tanh(4.00000000000000D+000): 9.99329299739067D-001 +Math.tanh(-9.0000E-01): -7.16298E-01. MathL.tanh(-9.0000000000000D-001): -7.16297870199025D-001 +Math.tanh(-1.0000E+00): -7.61594E-01. MathL.tanh(-1.0000000000000D+000): -7.61594155955765D-001 +Math.tanh(-1.4000E+00): -8.85352E-01. MathL.tanh(-1.4000000000000D+000): -8.85351648202263D-001 +Math.tanh(-1.5000E+00): -9.05148E-01. MathL.tanh(-1.5000000000000D+000): -9.05148253644866D-001 +Math.tanh(-1.6000E+00): -9.21669E-01. MathL.tanh(-1.6000000000000D+000): -9.21668554406471D-001 +Math.tanh(-1.9000E+00): -9.56237E-01. MathL.tanh(-1.9000000000000D+000): -9.56237458127739D-001 +Math.tanh(-2.0000E+00): -9.64028E-01. MathL.tanh(-2.0000000000000D+000): -9.64027580075817D-001 +Math.tanh(-2.4000E+00): -9.83675E-01. MathL.tanh(-2.4000000000000D+000): -9.8367485769368D-001 +Math.tanh(-2.5000E+00): -9.86614E-01. MathL.tanh(-2.5000000000000D+000): -9.8661429815143D-001 +Math.tanh(-3.0000E+00): -9.95055E-01. MathL.tanh(-3.0000000000000D+000): -9.95054753686731D-001 +Math.tanh(-4.0000E+00): -9.99329E-01. MathL.tanh(-4.0000000000000D+000): -9.99329299739067D-001 -Math.tanh(8.99999976E-01): 7.16297865E-01. MathL.tanh(9.0000000000000000D-001): 7.1629787019902448D-001 -Math.tanh(1.00000000E+00): 7.61594176E-01. MathL.tanh(1.0000000000000000D+000): 7.6159415595576480D-001 -Math.tanh(1.39999998E+00): 8.85351658E-01. MathL.tanh(1.4000000000000000D+000): 8.8535164820226256D-001 -Math.tanh(1.50000000E+00): 9.05148268E-01. MathL.tanh(1.5000000000000000D+000): 9.0514825364486640D-001 -Math.tanh(1.60000002E+00): 9.21668530E-01. MathL.tanh(1.6000000000000000D+000): 9.2166855440647136D-001 -Math.tanh(1.89999998E+00): 9.56237435E-01. MathL.tanh(1.9000000000000000D+000): 9.5623745812773904D-001 -Math.tanh(2.00000000E+00): 9.64027584E-01. MathL.tanh(2.0000000000000000D+000): 9.6402758007581680D-001 -Math.tanh(2.40000010E+00): 9.83674884E-01. MathL.tanh(2.4000000000000000D+000): 9.8367485769368016D-001 -Math.tanh(2.50000000E+00): 9.86614287E-01. MathL.tanh(2.5000000000000000D+000): 9.8661429815143024D-001 -Math.tanh(3.00000000E+00): 9.95054781E-01. MathL.tanh(3.0000000000000000D+000): 9.9505475368673040D-001 -Math.tanh(4.00000000E+00): 9.99329329E-01. MathL.tanh(4.0000000000000000D+000): 9.9932929973906704D-001 -Math.tanh(-8.9999998E-01): -7.1629786E-01. MathL.tanh(-9.000000000000000D-001): -7.162978701990244D-001 -Math.tanh(-1.0000000E+00): -7.6159418E-01. MathL.tanh(-1.000000000000000D+000): -7.615941559557650D-001 -Math.tanh(-1.4000000E+00): -8.8535166E-01. MathL.tanh(-1.400000000000000D+000): -8.853516482022626D-001 -Math.tanh(-1.5000000E+00): -9.0514827E-01. MathL.tanh(-1.500000000000000D+000): -9.051482536448664D-001 -Math.tanh(-1.6000000E+00): -9.2166853E-01. MathL.tanh(-1.600000000000000D+000): -9.216685544064714D-001 -Math.tanh(-1.9000000E+00): -9.5623744E-01. MathL.tanh(-1.900000000000000D+000): -9.562374581277390D-001 -Math.tanh(-2.0000000E+00): -9.6402758E-01. MathL.tanh(-2.000000000000000D+000): -9.640275800758168D-001 -Math.tanh(-2.4000001E+00): -9.8367488E-01. MathL.tanh(-2.400000000000000D+000): -9.836748576936802D-001 -Math.tanh(-2.5000000E+00): -9.8661429E-01. MathL.tanh(-2.500000000000000D+000): -9.866142981514302D-001 -Math.tanh(-3.0000000E+00): -9.9505478E-01. MathL.tanh(-3.000000000000000D+000): -9.950547536867304D-001 -Math.tanh(-4.0000000E+00): -9.9932933E-01. MathL.tanh(-4.000000000000000D+000): -9.993292997390670D-001 +Math.arcsinh(9.00000E-01): 8.08867E-01. MathL.arcsinh(9.00000000000000D-001): 8.08866935652783D-001 +Math.arcsinh(1.00000E+00): 8.81374E-01. MathL.arcsinh(1.00000000000000D+000): 8.81373587019543D-001 +Math.arcsinh(1.40000E+00): 1.13798E+00. MathL.arcsinh(1.40000000000000D+000): 1.13798204629337D+000 +Math.arcsinh(1.50000E+00): 1.19476E+00. MathL.arcsinh(1.50000000000000D+000): 1.19476321728711D+000 +Math.arcsinh(1.60000E+00): 1.24898E+00. MathL.arcsinh(1.60000000000000D+000): 1.24898332790488D+000 +Math.arcsinh(1.90000E+00): 1.39800E+00. MathL.arcsinh(1.90000000000000D+000): 1.39799836511143D+000 +Math.arcsinh(2.00000E+00): 1.44364E+00. MathL.arcsinh(2.00000000000000D+000): 1.44363547517881D+000 +Math.arcsinh(2.40000E+00): 1.60944E+00. MathL.arcsinh(2.40000000000000D+000): 1.60943791243410D+000 +Math.arcsinh(2.50000E+00): 1.64723E+00. MathL.arcsinh(2.50000000000000D+000): 1.64723114637110D+000 +Math.arcsinh(3.00000E+00): 1.81845E+00. MathL.arcsinh(3.00000000000000D+000): 1.81844645923207D+000 +Math.arcsinh(4.00000E+00): 2.09471E+00. MathL.arcsinh(4.00000000000000D+000): 2.09471254726110D+000 +Math.arcsinh(-9.0000E-01): -8.08867E-01. MathL.arcsinh(-9.0000000000000D-001): -8.08866935652783D-001 +Math.arcsinh(-1.0000E+00): -8.81374E-01. MathL.arcsinh(-1.0000000000000D+000): -8.81373587019543D-001 +Math.arcsinh(-1.4000E+00): -1.13798E+00. MathL.arcsinh(-1.4000000000000D+000): -1.13798204629337D+000 +Math.arcsinh(-1.5000E+00): -1.19476E+00. MathL.arcsinh(-1.5000000000000D+000): -1.19476321728711D+000 +Math.arcsinh(-1.6000E+00): -1.24898E+00. MathL.arcsinh(-1.6000000000000D+000): -1.24898332790488D+000 +Math.arcsinh(-1.9000E+00): -1.3980E+00. MathL.arcsinh(-1.9000000000000D+000): -1.39799836511143D+000 +Math.arcsinh(-2.0000E+00): -1.44364E+00. MathL.arcsinh(-2.0000000000000D+000): -1.44363547517881D+000 +Math.arcsinh(-2.4000E+00): -1.60944E+00. MathL.arcsinh(-2.4000000000000D+000): -1.6094379124341D+000 +Math.arcsinh(-2.5000E+00): -1.64723E+00. MathL.arcsinh(-2.5000000000000D+000): -1.6472311463711D+000 +Math.arcsinh(-3.0000E+00): -1.81845E+00. MathL.arcsinh(-3.0000000000000D+000): -1.81844645923207D+000 +Math.arcsinh(-4.0000E+00): -2.09471E+00. MathL.arcsinh(-4.0000000000000D+000): -2.0947125472611D+000 -Math.arcsinh(8.99999976E-01): 8.08866858E-01. MathL.arcsinh(9.0000000000000000D-001): 8.0886693565278304D-001 -Math.arcsinh(1.00000000E+00): 8.81373644E-01. MathL.arcsinh(1.0000000000000000D+000): 8.8137358701954304D-001 -Math.arcsinh(1.39999998E+00): 1.13798201E+00. MathL.arcsinh(1.4000000000000000D+000): 1.1379820462933672D+000 -Math.arcsinh(1.50000000E+00): 1.19476318E+00. MathL.arcsinh(1.5000000000000000D+000): 1.1947632172871094D+000 -Math.arcsinh(1.60000002E+00): 1.24898338E+00. MathL.arcsinh(1.6000000000000000D+000): 1.2489833279048764D+000 -Math.arcsinh(1.89999998E+00): 1.39799833E+00. MathL.arcsinh(1.9000000000000000D+000): 1.3979983651114348D+000 -Math.arcsinh(2.00000000E+00): 1.44363546E+00. MathL.arcsinh(2.0000000000000000D+000): 1.4436354751788108D+000 -Math.arcsinh(2.40000010E+00): 1.60943794E+00. MathL.arcsinh(2.4000000000000000D+000): 1.6094379124341008D+000 -Math.arcsinh(2.50000000E+00): 1.64723110E+00. MathL.arcsinh(2.5000000000000000D+000): 1.6472311463710960D+000 -Math.arcsinh(3.00000000E+00): 1.81844652E+00. MathL.arcsinh(3.0000000000000000D+000): 1.8184464592320672D+000 -Math.arcsinh(4.00000000E+00): 2.09471250E+00. MathL.arcsinh(4.0000000000000000D+000): 2.0947125472611016D+000 -Math.arcsinh(-8.9999998E-01): -8.0886686E-01. MathL.arcsinh(-9.000000000000000D-001): -8.088669356527832D-001 -Math.arcsinh(-1.0000000E+00): -8.8137364E-01. MathL.arcsinh(-1.000000000000000D+000): -8.813735870195430D-001 -Math.arcsinh(-1.4000000E+00): -1.1379820E+00. MathL.arcsinh(-1.400000000000000D+000): -1.137982046293367D+000 -Math.arcsinh(-1.5000000E+00): -1.1947632E+00. MathL.arcsinh(-1.500000000000000D+000): -1.194763217287110D+000 -Math.arcsinh(-1.6000000E+00): -1.2489834E+00. MathL.arcsinh(-1.600000000000000D+000): -1.248983327904876D+000 -Math.arcsinh(-1.9000000E+00): -1.3979983E+00. MathL.arcsinh(-1.900000000000000D+000): -1.397998365111435D+000 -Math.arcsinh(-2.0000000E+00): -1.4436355E+00. MathL.arcsinh(-2.000000000000000D+000): -1.443635475178811D+000 -Math.arcsinh(-2.4000001E+00): -1.6094379E+00. MathL.arcsinh(-2.400000000000000D+000): -1.609437912434101D+000 -Math.arcsinh(-2.5000000E+00): -1.6472311E+00. MathL.arcsinh(-2.500000000000000D+000): -1.647231146371096D+000 -Math.arcsinh(-3.0000000E+00): -1.8184465E+00. MathL.arcsinh(-3.000000000000000D+000): -1.818446459232067D+000 -Math.arcsinh(-4.0000000E+00): -2.0947125E+00. MathL.arcsinh(-4.000000000000000D+000): -2.094712547261102D+000 +Math.arccosh(9.00000E-01): 0.00000E+00. MathL.arccosh(9.00000000000000D-001): 0.00000000000000D+000 +Math.arccosh(1.00000E+00): 0.00000E+00. MathL.arccosh(1.00000000000000D+000): 0.00000000000000D+000 +Math.arccosh(1.40000E+00): 8.67015E-01. MathL.arccosh(1.40000000000000D+000): 8.67014726490565D-001 +Math.arccosh(1.50000E+00): 9.62424E-01. MathL.arccosh(1.50000000000000D+000): 9.62423650119207D-001 +Math.arccosh(1.60000E+00): 1.04697E+00. MathL.arccosh(1.60000000000000D+000): 1.04696791500319D+000 +Math.arccosh(1.90000E+00): 1.25720E+00. MathL.arccosh(1.90000000000000D+000): 1.25719582660038D+000 +Math.arccosh(2.00000E+00): 1.31696E+00. MathL.arccosh(2.00000000000000D+000): 1.31695789692482D+000 +Math.arccosh(2.40000E+00): 1.52208E+00. MathL.arccosh(2.40000000000000D+000): 1.52207936746365D+000 +Math.arccosh(2.50000E+00): 1.56680E+00. MathL.arccosh(2.50000000000000D+000): 1.56679923697241D+000 +Math.arccosh(3.00000E+00): 1.76275E+00. MathL.arccosh(3.00000000000000D+000): 1.76274717403909D+000 +Math.arccosh(4.00000E+00): 2.06344E+00. MathL.arccosh(4.00000000000000D+000): 2.06343706889556D+000 +Math.arccosh(-9.0000E-01): 0.00000E+00. MathL.arccosh(-9.0000000000000D-001): 0.00000000000000D+000 +Math.arccosh(-1.0000E+00): 0.00000E+00. MathL.arccosh(-1.0000000000000D+000): 0.00000000000000D+000 +Math.arccosh(-1.4000E+00): 0.00000E+00. MathL.arccosh(-1.4000000000000D+000): 0.00000000000000D+000 +Math.arccosh(-1.5000E+00): 0.00000E+00. MathL.arccosh(-1.5000000000000D+000): 0.00000000000000D+000 +Math.arccosh(-1.6000E+00): 0.00000E+00. MathL.arccosh(-1.6000000000000D+000): 0.00000000000000D+000 +Math.arccosh(-1.9000E+00): 0.00000E+00. MathL.arccosh(-1.9000000000000D+000): 0.00000000000000D+000 +Math.arccosh(-2.0000E+00): 0.00000E+00. MathL.arccosh(-2.0000000000000D+000): 0.00000000000000D+000 +Math.arccosh(-2.4000E+00): 0.00000E+00. MathL.arccosh(-2.4000000000000D+000): 0.00000000000000D+000 +Math.arccosh(-2.5000E+00): 0.00000E+00. MathL.arccosh(-2.5000000000000D+000): 0.00000000000000D+000 +Math.arccosh(-3.0000E+00): 0.00000E+00. MathL.arccosh(-3.0000000000000D+000): 0.00000000000000D+000 +Math.arccosh(-4.0000E+00): 0.00000E+00. MathL.arccosh(-4.0000000000000D+000): 0.00000000000000D+000 -Math.arccosh(8.99999976E-01): 0.00000000E+00. MathL.arccosh(9.0000000000000000D-001): 0.0000000000000000D+000 -Math.arccosh(1.00000000E+00): 0.00000000E+00. MathL.arccosh(1.0000000000000000D+000): 0.0000000000000000D+000 -Math.arccosh(1.39999998E+00): 8.67014706E-01. MathL.arccosh(1.4000000000000000D+000): 8.6701472649056496D-001 -Math.arccosh(1.50000000E+00): 9.62423623E-01. MathL.arccosh(1.5000000000000000D+000): 9.6242365011920720D-001 -Math.arccosh(1.60000002E+00): 1.04696786E+00. MathL.arccosh(1.6000000000000000D+000): 1.0469679150031890D+000 -Math.arccosh(1.89999998E+00): 1.25719583E+00. MathL.arccosh(1.9000000000000000D+000): 1.2571958266003804D+000 -Math.arccosh(2.00000000E+00): 1.31695795E+00. MathL.arccosh(2.0000000000000000D+000): 1.3169578969248166D+000 -Math.arccosh(2.40000010E+00): 1.52207935E+00. MathL.arccosh(2.4000000000000000D+000): 1.5220793674636536D+000 -Math.arccosh(2.50000000E+00): 1.56679916E+00. MathL.arccosh(2.5000000000000000D+000): 1.5667992369724114D+000 -Math.arccosh(3.00000000E+00): 1.76274717E+00. MathL.arccosh(3.0000000000000000D+000): 1.7627471740390860D+000 -Math.arccosh(4.00000000E+00): 2.06343699E+00. MathL.arccosh(4.0000000000000000D+000): 2.0634370688955608D+000 -Math.arccosh(-8.9999998E-01): 0.00000000E+00. MathL.arccosh(-9.000000000000000D-001): 0.0000000000000000D+000 -Math.arccosh(-1.0000000E+00): 0.00000000E+00. MathL.arccosh(-1.000000000000000D+000): 0.0000000000000000D+000 -Math.arccosh(-1.4000000E+00): 0.00000000E+00. MathL.arccosh(-1.400000000000000D+000): 0.0000000000000000D+000 -Math.arccosh(-1.5000000E+00): 0.00000000E+00. MathL.arccosh(-1.500000000000000D+000): 0.0000000000000000D+000 -Math.arccosh(-1.6000000E+00): 0.00000000E+00. MathL.arccosh(-1.600000000000000D+000): 0.0000000000000000D+000 -Math.arccosh(-1.9000000E+00): 0.00000000E+00. MathL.arccosh(-1.900000000000000D+000): 0.0000000000000000D+000 -Math.arccosh(-2.0000000E+00): 0.00000000E+00. MathL.arccosh(-2.000000000000000D+000): 0.0000000000000000D+000 -Math.arccosh(-2.4000001E+00): 0.00000000E+00. MathL.arccosh(-2.400000000000000D+000): 0.0000000000000000D+000 -Math.arccosh(-2.5000000E+00): 0.00000000E+00. MathL.arccosh(-2.500000000000000D+000): 0.0000000000000000D+000 -Math.arccosh(-3.0000000E+00): 0.00000000E+00. MathL.arccosh(-3.000000000000000D+000): 0.0000000000000000D+000 -Math.arccosh(-4.0000000E+00): 0.00000000E+00. MathL.arccosh(-4.000000000000000D+000): 0.0000000000000000D+000 - -Math.arctanh(8.99999976E-01): 1.47221935E+00. MathL.arctanh(9.0000000000000000D-001): 1.4722194895832210D+000 -Math.arctanh(1.00000000E+00): 8.66434002E+00. MathL.arctanh(1.0000000000000000D+000): 1.8714973875118524D+001 -Math.arctanh(1.39999998E+00): 8.66434002E+00. MathL.arctanh(1.4000000000000000D+000): 1.8714973875118524D+001 -Math.arctanh(1.50000000E+00): 8.66434002E+00. MathL.arctanh(1.5000000000000000D+000): 1.8714973875118524D+001 -Math.arctanh(1.60000002E+00): 8.66434002E+00. MathL.arctanh(1.6000000000000000D+000): 1.8714973875118524D+001 -Math.arctanh(1.89999998E+00): 8.66434002E+00. MathL.arctanh(1.9000000000000000D+000): 1.8714973875118524D+001 -Math.arctanh(2.00000000E+00): 8.66434002E+00. MathL.arctanh(2.0000000000000000D+000): 1.8714973875118524D+001 -Math.arctanh(2.40000010E+00): 8.66434002E+00. MathL.arctanh(2.4000000000000000D+000): 1.8714973875118524D+001 -Math.arctanh(2.50000000E+00): 8.66434002E+00. MathL.arctanh(2.5000000000000000D+000): 1.8714973875118524D+001 -Math.arctanh(3.00000000E+00): 8.66434002E+00. MathL.arctanh(3.0000000000000000D+000): 1.8714973875118524D+001 -Math.arctanh(4.00000000E+00): 8.66434002E+00. MathL.arctanh(4.0000000000000000D+000): 1.8714973875118524D+001 -Math.arctanh(-8.9999998E-01): -1.4722193E+00. MathL.arctanh(-9.000000000000000D-001): -1.472219489583221D+000 -Math.arctanh(-1.0000000E+00): -8.6643400E+00. MathL.arctanh(-1.000000000000000D+000): -1.871497387511852D+001 -Math.arctanh(-1.4000000E+00): -8.6643400E+00. MathL.arctanh(-1.400000000000000D+000): -1.871497387511852D+001 -Math.arctanh(-1.5000000E+00): -8.6643400E+00. MathL.arctanh(-1.500000000000000D+000): -1.871497387511852D+001 -Math.arctanh(-1.6000000E+00): -8.6643400E+00. MathL.arctanh(-1.600000000000000D+000): -1.871497387511852D+001 -Math.arctanh(-1.9000000E+00): -8.6643400E+00. MathL.arctanh(-1.900000000000000D+000): -1.871497387511852D+001 -Math.arctanh(-2.0000000E+00): -8.6643400E+00. MathL.arctanh(-2.000000000000000D+000): -1.871497387511852D+001 -Math.arctanh(-2.4000001E+00): -8.6643400E+00. MathL.arctanh(-2.400000000000000D+000): -1.871497387511852D+001 -Math.arctanh(-2.5000000E+00): -8.6643400E+00. MathL.arctanh(-2.500000000000000D+000): -1.871497387511852D+001 -Math.arctanh(-3.0000000E+00): -8.6643400E+00. MathL.arctanh(-3.000000000000000D+000): -1.871497387511852D+001 -Math.arctanh(-4.0000000E+00): -8.6643400E+00. MathL.arctanh(-4.000000000000000D+000): -1.871497387511852D+001 +Math.arctanh(9.00000E-01): 1.47222E+00. MathL.arctanh(9.00000000000000D-001): 1.47221948958322D+000 +Math.arctanh(1.00000E+00): 8.66434E+00. MathL.arctanh(1.00000000000000D+000): 1.87149738751185D+001 +Math.arctanh(1.40000E+00): 8.66434E+00. MathL.arctanh(1.40000000000000D+000): 1.87149738751185D+001 +Math.arctanh(1.50000E+00): 8.66434E+00. MathL.arctanh(1.50000000000000D+000): 1.87149738751185D+001 +Math.arctanh(1.60000E+00): 8.66434E+00. MathL.arctanh(1.60000000000000D+000): 1.87149738751185D+001 +Math.arctanh(1.90000E+00): 8.66434E+00. MathL.arctanh(1.90000000000000D+000): 1.87149738751185D+001 +Math.arctanh(2.00000E+00): 8.66434E+00. MathL.arctanh(2.00000000000000D+000): 1.87149738751185D+001 +Math.arctanh(2.40000E+00): 8.66434E+00. MathL.arctanh(2.40000000000000D+000): 1.87149738751185D+001 +Math.arctanh(2.50000E+00): 8.66434E+00. MathL.arctanh(2.50000000000000D+000): 1.87149738751185D+001 +Math.arctanh(3.00000E+00): 8.66434E+00. MathL.arctanh(3.00000000000000D+000): 1.87149738751185D+001 +Math.arctanh(4.00000E+00): 8.66434E+00. MathL.arctanh(4.00000000000000D+000): 1.87149738751185D+001 +Math.arctanh(-9.0000E-01): -1.47222E+00. MathL.arctanh(-9.0000000000000D-001): -1.47221948958322D+000 +Math.arctanh(-1.0000E+00): -8.66434E+00. MathL.arctanh(-1.0000000000000D+000): -1.87149738751185D+001 +Math.arctanh(-1.4000E+00): -8.66434E+00. MathL.arctanh(-1.4000000000000D+000): -1.87149738751185D+001 +Math.arctanh(-1.5000E+00): -8.66434E+00. MathL.arctanh(-1.5000000000000D+000): -1.87149738751185D+001 +Math.arctanh(-1.6000E+00): -8.66434E+00. MathL.arctanh(-1.6000000000000D+000): -1.87149738751185D+001 +Math.arctanh(-1.9000E+00): -8.66434E+00. MathL.arctanh(-1.9000000000000D+000): -1.87149738751185D+001 +Math.arctanh(-2.0000E+00): -8.66434E+00. MathL.arctanh(-2.0000000000000D+000): -1.87149738751185D+001 +Math.arctanh(-2.4000E+00): -8.66434E+00. MathL.arctanh(-2.4000000000000D+000): -1.87149738751185D+001 +Math.arctanh(-2.5000E+00): -8.66434E+00. MathL.arctanh(-2.5000000000000D+000): -1.87149738751185D+001 +Math.arctanh(-3.0000E+00): -8.66434E+00. MathL.arctanh(-3.0000000000000D+000): -1.87149738751185D+001 +Math.arctanh(-4.0000E+00): -8.66434E+00. MathL.arctanh(-4.0000000000000D+000): -1.87149738751185D+001 diff --git a/src/test/confidence/math/mathtest.mod b/src/test/confidence/math/mathtest.mod index e0ad0485..b062c844 100644 --- a/src/test/confidence/math/mathtest.mod +++ b/src/test/confidence/math/mathtest.mod @@ -22,8 +22,8 @@ VAR PROCEDURE wc(c: CHAR); BEGIN Out.Char(c) END wc; PROCEDURE ws(s: ARRAY OF CHAR); BEGIN Out.String(s) END ws; PROCEDURE wi(i: HUGEINT); BEGIN Out.Int(i,1) END wi; -PROCEDURE wr(r: REAL); BEGIN Out.Real(r,14) END wr; -PROCEDURE wlr(lr: LONGREAL); BEGIN Out.LongReal(lr,23) END wlr; +PROCEDURE wr(r: REAL); BEGIN Out.Real(r,11) END wr; +PROCEDURE wlr(lr: LONGREAL); BEGIN Out.LongReal(lr,21) END wlr; PROCEDURE wl; BEGIN Out.Ln END wl; PROCEDURE wh(VAR h: ARRAY OF SYSTEM.BYTE); @@ -125,7 +125,7 @@ BEGIN TestRtoR("fraction", Math.fraction, MathL.fraction, misc); TestRtoLI("round", Math.round, MathL.round, misc); TestRtoR("sqrt", Math.sqrt, MathL.sqrt, misc); - TestRtoR("exp", Math.exp, MathL.exp, misc); +(*TestRtoR("exp", Math.exp, MathL.exp, misc);*) (* bypass exp test as MathL result differs between x86 and x64. *) TestRtoR("ln", Math.ln, MathL.ln, misc); TestRtoR("sin", Math.sin, MathL.sin, angles); TestRtoR("cos", Math.cos, MathL.cos, angles); diff --git a/src/test/confidence/out/expected b/src/test/confidence/out/expected index 586814dc..dab1e079 100644 --- a/src/test/confidence/out/expected +++ b/src/test/confidence/out/expected @@ -87,7 +87,7 @@ Testing REAL. -1.1E0: -1.1E+00 1.1E3: 1.1E+03 1.1E-3: 1.1E-03 - 1.2345678987654321E3: 1.234568E+03 + 1.2345678987654321E3: 1.23457E+03 0.0: 0.0E+00 0.000123E0: 1.23E-04 1/0.0: Infinity @@ -215,7 +215,7 @@ Testing REAL. -1.1E0: -1.1E+00 1.1E3: 1.1E+03 1.1E-3: 1.1E-03 - 1.2345678987654321E3: 1.234568E+03 + 1.2345678987654321E3: 1.23457E+03 0.0: 0.0E+00 0.000123E0: 1.23E-04 1/0.0: Infinity diff --git a/src/tools/make/configure.c b/src/tools/make/configure.c index 695fa0e2..4a3a7c6e 100644 --- a/src/tools/make/configure.c +++ b/src/tools/make/configure.c @@ -144,9 +144,9 @@ void determineCCompiler() { compiler = "gcc"; if (strncasecmp(os, "cygwin", 6) == 0) { // Avoid cygwin specific warning that -fPIC is ignored. - cc = "gcc -g" optimize; + cc = "gcc -g -msse2" optimize; } else { - cc = "gcc -fPIC -g" optimize; + cc = "gcc -fPIC -g -msse2" optimize; } #elif defined(_MSC_VER) compiler = "MSC"; diff --git a/src/tools/make/oberon.mk b/src/tools/make/oberon.mk index 6a4ed69c..1924acfa 100644 --- a/src/tools/make/oberon.mk +++ b/src/tools/make/oberon.mk @@ -382,9 +382,9 @@ RUNTEST = COMPILER=$(COMPILER) OBECOMP="$(OBECOMP) -O$(MODEL)" FLAVOUR=$(FLAVOUR confidence: @printf "\n\n--- Confidence tests ---\n\n" - cd src/test/confidence/math; $(RUNTEST) cd src/test/confidence/hello; $(RUNTEST) cd src/test/confidence/out; $(RUNTEST) + cd src/test/confidence/math; $(RUNTEST) cd src/test/confidence/intsyntax; $(RUNTEST) cd src/test/confidence/language; $(RUNTEST) cd src/test/confidence/texts; $(RUNTEST) From 4a9f674b10f41e18912c398e83ba54396c78ba5d Mon Sep 17 00:00:00 2001 From: David Brown Date: Tue, 18 Oct 2016 12:09:35 +0100 Subject: [PATCH 289/580] Don't build oocFilenames.Mod twice. --- src/tools/make/oberon.mk | 1 - 1 file changed, 1 deletion(-) diff --git a/src/tools/make/oberon.mk b/src/tools/make/oberon.mk index 1924acfa..c0073202 100644 --- a/src/tools/make/oberon.mk +++ b/src/tools/make/oberon.mk @@ -253,7 +253,6 @@ ooc: cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocTextRider.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocBinaryRider.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocJulianDay.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocFilenames.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocwrapperlibc.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocC$(DATAMODEL).Mod From 300b67a572716cf9fa40de76ff851f04cf57c060 Mon Sep 17 00:00:00 2001 From: David Brown Date: Tue, 18 Oct 2016 18:12:33 +0100 Subject: [PATCH 290/580] Remove -msse2, fix halt code type on windows platform. --- bootstrap/unix-44/Compiler.c | 2 +- bootstrap/unix-44/Configuration.c | 4 ++-- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Files.c | 2 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 2 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 2 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 2 +- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 2 +- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 2 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Out.c | 2 +- bootstrap/unix-44/Out.h | 2 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/VT100.c | 2 +- bootstrap/unix-44/VT100.h | 2 +- bootstrap/unix-44/errors.c | 2 +- bootstrap/unix-44/errors.h | 2 +- bootstrap/unix-44/extTools.c | 4 ++-- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-48/Compiler.c | 2 +- bootstrap/unix-48/Configuration.c | 4 ++-- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Files.c | 2 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 2 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 2 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 2 +- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 2 +- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 2 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Out.c | 2 +- bootstrap/unix-48/Out.h | 2 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/VT100.c | 2 +- bootstrap/unix-48/VT100.h | 2 +- bootstrap/unix-48/errors.c | 2 +- bootstrap/unix-48/errors.h | 2 +- bootstrap/unix-48/extTools.c | 4 ++-- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-88/Compiler.c | 2 +- bootstrap/unix-88/Configuration.c | 4 ++-- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Files.c | 2 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 2 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 2 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 2 +- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 2 +- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 2 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Out.c | 2 +- bootstrap/unix-88/Out.h | 2 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/VT100.c | 2 +- bootstrap/unix-88/VT100.h | 2 +- bootstrap/unix-88/errors.c | 2 +- bootstrap/unix-88/errors.h | 2 +- bootstrap/unix-88/extTools.c | 4 ++-- bootstrap/unix-88/extTools.h | 2 +- bootstrap/windows-48/Compiler.c | 2 +- bootstrap/windows-48/Configuration.c | 4 ++-- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Files.c | 2 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 2 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 2 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 2 +- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 2 +- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 2 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Out.c | 2 +- bootstrap/windows-48/Out.h | 2 +- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/VT100.c | 2 +- bootstrap/windows-48/VT100.h | 2 +- bootstrap/windows-48/errors.c | 2 +- bootstrap/windows-48/errors.h | 2 +- bootstrap/windows-48/extTools.c | 4 ++-- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-88/Compiler.c | 2 +- bootstrap/windows-88/Configuration.c | 4 ++-- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Files.c | 2 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 2 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 2 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 2 +- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 2 +- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 2 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Out.c | 2 +- bootstrap/windows-88/Out.h | 2 +- bootstrap/windows-88/Platform.c | 2 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/VT100.c | 2 +- bootstrap/windows-88/VT100.h | 2 +- bootstrap/windows-88/errors.c | 2 +- bootstrap/windows-88/errors.h | 2 +- bootstrap/windows-88/extTools.c | 4 ++-- bootstrap/windows-88/extTools.h | 2 +- src/runtime/Platformwindows.Mod | 2 +- src/test/confidence/planned-binary-change | 2 +- src/tools/make/configure.c | 4 ++-- 198 files changed, 209 insertions(+), 209 deletions(-) diff --git a/bootstrap/unix-44/Compiler.c b/bootstrap/unix-44/Compiler.c index 5d283015..965cd082 100644 --- a/bootstrap/unix-44/Compiler.c +++ b/bootstrap/unix-44/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index d683fe2f..da05f57a 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index 90611872..97ccb9b4 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 4a2cb111..698bdfec 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index b6252d6a..54424759 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index f273580a..20373a54 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index 7fa42c0b..fe843fd2 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index c647f9ac..c47b83d3 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index 14e787d6..b6fd8dd7 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index 5427f4fa..42ccafe2 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index 3ff1bcb7..639b8015 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 339c3dfb..5eb839d6 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index e977b3bc..c0d35b19 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 10852426..9fbbbc49 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index 00fd6e1b..39474670 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index 554f232f..dad7e185 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index 7b603db0..287514a0 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index a6450b26..e76fa4d6 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index 10816274..42cecab6 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index c6b8263f..d9550e62 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index 3f43db54..9cfc72df 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index c0973832..3b2e9f4d 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index acd590a5..626e9505 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Out.c b/bootstrap/unix-44/Out.c index 7aa2ea0f..66922bc1 100644 --- a/bootstrap/unix-44/Out.c +++ b/bootstrap/unix-44/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Out.h b/bootstrap/unix-44/Out.h index 79d13967..0d5df379 100644 --- a/bootstrap/unix-44/Out.h +++ b/bootstrap/unix-44/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 4654539d..e79917c0 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index e1461593..6354f985 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 67a2e86b..291703b5 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index 16683728..7e26560f 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index fdabc0a6..b6b9725d 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index 80d04256..0298718d 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index 27223430..dd64a7d3 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index e3920989..15b00c61 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/VT100.c b/bootstrap/unix-44/VT100.c index 26d4f1f2..31069c13 100644 --- a/bootstrap/unix-44/VT100.c +++ b/bootstrap/unix-44/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/VT100.h b/bootstrap/unix-44/VT100.h index 81a745bc..a82dbdb6 100644 --- a/bootstrap/unix-44/VT100.h +++ b/bootstrap/unix-44/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-44/errors.c b/bootstrap/unix-44/errors.c index 2f957698..d4bc8b00 100644 --- a/bootstrap/unix-44/errors.c +++ b/bootstrap/unix-44/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/errors.h b/bootstrap/unix-44/errors.h index a4d3fdb2..7d7ab568 100644 --- a/bootstrap/unix-44/errors.h +++ b/bootstrap/unix-44/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index 3b663078..4ad21fe0 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -64,7 +64,7 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN static void extTools_InitialiseCompilerCommand (CHAR *s, LONGINT s__len) { - __COPY("gcc -g -msse2", s, s__len); + __COPY("gcc -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index 4f69f786..cc3b21ef 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/Compiler.c b/bootstrap/unix-48/Compiler.c index 5d283015..965cd082 100644 --- a/bootstrap/unix-48/Compiler.c +++ b/bootstrap/unix-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index d683fe2f..da05f57a 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index 90611872..97ccb9b4 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 4a2cb111..698bdfec 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index b6252d6a..54424759 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index f273580a..20373a54 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index 7fa42c0b..fe843fd2 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index c647f9ac..c47b83d3 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index 14e787d6..b6fd8dd7 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index 5427f4fa..42ccafe2 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index 3ff1bcb7..639b8015 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 339c3dfb..5eb839d6 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index e977b3bc..c0d35b19 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 10852426..9fbbbc49 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index 00fd6e1b..39474670 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index 554f232f..dad7e185 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index 7b603db0..287514a0 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index a6450b26..e76fa4d6 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index 10816274..42cecab6 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 655ea955..3d9f63cf 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index 3f43db54..9cfc72df 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index c0973832..3b2e9f4d 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index acd590a5..626e9505 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Out.c b/bootstrap/unix-48/Out.c index 7aa2ea0f..66922bc1 100644 --- a/bootstrap/unix-48/Out.c +++ b/bootstrap/unix-48/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Out.h b/bootstrap/unix-48/Out.h index 79d13967..0d5df379 100644 --- a/bootstrap/unix-48/Out.h +++ b/bootstrap/unix-48/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 4654539d..e79917c0 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index e1461593..6354f985 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 67a2e86b..291703b5 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index 16683728..7e26560f 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index fdabc0a6..b6b9725d 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index 80d04256..0298718d 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index b9464942..dd394ddd 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index 0ca902fe..67f5b23d 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/VT100.c b/bootstrap/unix-48/VT100.c index 26d4f1f2..31069c13 100644 --- a/bootstrap/unix-48/VT100.c +++ b/bootstrap/unix-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/VT100.h b/bootstrap/unix-48/VT100.h index 81a745bc..a82dbdb6 100644 --- a/bootstrap/unix-48/VT100.h +++ b/bootstrap/unix-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-48/errors.c b/bootstrap/unix-48/errors.c index 2f957698..d4bc8b00 100644 --- a/bootstrap/unix-48/errors.c +++ b/bootstrap/unix-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/errors.h b/bootstrap/unix-48/errors.h index a4d3fdb2..7d7ab568 100644 --- a/bootstrap/unix-48/errors.h +++ b/bootstrap/unix-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index 3b663078..4ad21fe0 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -64,7 +64,7 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN static void extTools_InitialiseCompilerCommand (CHAR *s, LONGINT s__len) { - __COPY("gcc -g -msse2", s, s__len); + __COPY("gcc -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index 4f69f786..cc3b21ef 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/Compiler.c b/bootstrap/unix-88/Compiler.c index 5d283015..965cd082 100644 --- a/bootstrap/unix-88/Compiler.c +++ b/bootstrap/unix-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index d683fe2f..da05f57a 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index 90611872..97ccb9b4 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index cc5863c6..dcaa4d84 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index b3e2bc58..5e3c733a 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index f5ed9956..cffc17c7 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index 1056abb7..6eb9ef88 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 8f08ca7d..6c0e3e92 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index 14e787d6..b6fd8dd7 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index 5427f4fa..42ccafe2 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index 3ff1bcb7..639b8015 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index 339c3dfb..5eb839d6 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index e977b3bc..c0d35b19 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index a3a2d7c0..0401d1b4 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index 00fd6e1b..39474670 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index cfde1aba..d762e2d9 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index 7b603db0..287514a0 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index a6450b26..e76fa4d6 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index 10816274..42cecab6 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index 857ae626..25bc240a 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 3f43db54..9cfc72df 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 95e1de51..ee5b452f 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index acd590a5..626e9505 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Out.c b/bootstrap/unix-88/Out.c index 7aa2ea0f..66922bc1 100644 --- a/bootstrap/unix-88/Out.c +++ b/bootstrap/unix-88/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Out.h b/bootstrap/unix-88/Out.h index 79d13967..0d5df379 100644 --- a/bootstrap/unix-88/Out.h +++ b/bootstrap/unix-88/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index d8e7514a..bc57967b 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index 3c49b437..20722ed5 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 67a2e86b..291703b5 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index 16683728..7e26560f 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index fdabc0a6..b6b9725d 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index 80d04256..0298718d 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index dc6db203..9a5a9fdd 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index 1fb2d081..e86531bf 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/VT100.c b/bootstrap/unix-88/VT100.c index 26d4f1f2..31069c13 100644 --- a/bootstrap/unix-88/VT100.c +++ b/bootstrap/unix-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/VT100.h b/bootstrap/unix-88/VT100.h index 81a745bc..a82dbdb6 100644 --- a/bootstrap/unix-88/VT100.h +++ b/bootstrap/unix-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-88/errors.c b/bootstrap/unix-88/errors.c index 2f957698..d4bc8b00 100644 --- a/bootstrap/unix-88/errors.c +++ b/bootstrap/unix-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/errors.h b/bootstrap/unix-88/errors.h index a4d3fdb2..7d7ab568 100644 --- a/bootstrap/unix-88/errors.h +++ b/bootstrap/unix-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index 3b663078..4ad21fe0 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -64,7 +64,7 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN static void extTools_InitialiseCompilerCommand (CHAR *s, LONGINT s__len) { - __COPY("gcc -g -msse2", s, s__len); + __COPY("gcc -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index 4f69f786..cc3b21ef 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/Compiler.c b/bootstrap/windows-48/Compiler.c index 5d283015..965cd082 100644 --- a/bootstrap/windows-48/Compiler.c +++ b/bootstrap/windows-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index d683fe2f..da05f57a 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index 90611872..97ccb9b4 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 03e68742..98acafdf 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index 7ebffaa8..eb54b165 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index f273580a..20373a54 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index 7fa42c0b..fe843fd2 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index c647f9ac..c47b83d3 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index 14e787d6..b6fd8dd7 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index 5427f4fa..42ccafe2 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index 3ff1bcb7..639b8015 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 339c3dfb..5eb839d6 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index e977b3bc..c0d35b19 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 10852426..9fbbbc49 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index 00fd6e1b..39474670 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index 554f232f..dad7e185 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index 7b603db0..287514a0 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index a6450b26..e76fa4d6 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index 10816274..42cecab6 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 655ea955..3d9f63cf 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index 3f43db54..9cfc72df 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index c0973832..3b2e9f4d 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index acd590a5..626e9505 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Out.c b/bootstrap/windows-48/Out.c index 3937bd93..4c16f06a 100644 --- a/bootstrap/windows-48/Out.c +++ b/bootstrap/windows-48/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Out.h b/bootstrap/windows-48/Out.h index 79d13967..0d5df379 100644 --- a/bootstrap/windows-48/Out.h +++ b/bootstrap/windows-48/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 9773ed7c..ab0aeef3 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index 819d1704..0c6f1ba4 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 67a2e86b..291703b5 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index 16683728..7e26560f 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index fdabc0a6..b6b9725d 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index 80d04256..0298718d 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index b9464942..dd394ddd 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index 0ca902fe..67f5b23d 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/VT100.c b/bootstrap/windows-48/VT100.c index 26d4f1f2..31069c13 100644 --- a/bootstrap/windows-48/VT100.c +++ b/bootstrap/windows-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/VT100.h b/bootstrap/windows-48/VT100.h index 81a745bc..a82dbdb6 100644 --- a/bootstrap/windows-48/VT100.h +++ b/bootstrap/windows-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-48/errors.c b/bootstrap/windows-48/errors.c index 2f957698..d4bc8b00 100644 --- a/bootstrap/windows-48/errors.c +++ b/bootstrap/windows-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/errors.h b/bootstrap/windows-48/errors.h index a4d3fdb2..7d7ab568 100644 --- a/bootstrap/windows-48/errors.h +++ b/bootstrap/windows-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index 3b663078..4ad21fe0 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -64,7 +64,7 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN static void extTools_InitialiseCompilerCommand (CHAR *s, LONGINT s__len) { - __COPY("gcc -g -msse2", s, s__len); + __COPY("gcc -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index 4f69f786..cc3b21ef 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/Compiler.c b/bootstrap/windows-88/Compiler.c index 5d283015..965cd082 100644 --- a/bootstrap/windows-88/Compiler.c +++ b/bootstrap/windows-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index d683fe2f..da05f57a 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index 90611872..97ccb9b4 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 1c68856c..1f8984a1 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index eeab80bb..f233377b 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index f5ed9956..cffc17c7 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index 1056abb7..6eb9ef88 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 8f08ca7d..6c0e3e92 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index 14e787d6..b6fd8dd7 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index 5427f4fa..42ccafe2 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index 3ff1bcb7..639b8015 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index 339c3dfb..5eb839d6 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index e977b3bc..c0d35b19 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index a3a2d7c0..0401d1b4 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index 00fd6e1b..39474670 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index cfde1aba..d762e2d9 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index 7b603db0..287514a0 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index a6450b26..e76fa4d6 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index 10816274..42cecab6 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index 857ae626..25bc240a 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 3f43db54..9cfc72df 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 95e1de51..ee5b452f 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index acd590a5..626e9505 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Out.c b/bootstrap/windows-88/Out.c index 3937bd93..4c16f06a 100644 --- a/bootstrap/windows-88/Out.c +++ b/bootstrap/windows-88/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Out.h b/bootstrap/windows-88/Out.h index 79d13967..0d5df379 100644 --- a/bootstrap/windows-88/Out.h +++ b/bootstrap/windows-88/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index c7db3c7a..e47478bc 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index 920f8aef..d09c4a89 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 67a2e86b..291703b5 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index 16683728..7e26560f 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index fdabc0a6..b6b9725d 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index 80d04256..0298718d 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index dc6db203..9a5a9fdd 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index 1fb2d081..e86531bf 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/VT100.c b/bootstrap/windows-88/VT100.c index 26d4f1f2..31069c13 100644 --- a/bootstrap/windows-88/VT100.c +++ b/bootstrap/windows-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/VT100.h b/bootstrap/windows-88/VT100.h index 81a745bc..a82dbdb6 100644 --- a/bootstrap/windows-88/VT100.h +++ b/bootstrap/windows-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-88/errors.c b/bootstrap/windows-88/errors.c index 2f957698..d4bc8b00 100644 --- a/bootstrap/windows-88/errors.c +++ b/bootstrap/windows-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/errors.h b/bootstrap/windows-88/errors.h index a4d3fdb2..7d7ab568 100644 --- a/bootstrap/windows-88/errors.h +++ b/bootstrap/windows-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index 3b663078..4ad21fe0 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -64,7 +64,7 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN static void extTools_InitialiseCompilerCommand (CHAR *s, LONGINT s__len) { - __COPY("gcc -g -msse2", s, s__len); + __COPY("gcc -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index 4f69f786..cc3b21ef 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/src/runtime/Platformwindows.Mod b/src/runtime/Platformwindows.Mod index ad9574d1..3c74019b 100644 --- a/src/runtime/Platformwindows.Mod +++ b/src/runtime/Platformwindows.Mod @@ -565,7 +565,7 @@ BEGIN END END DisplayHaltCode; -PROCEDURE Halt*(code: LONGINT); +PROCEDURE Halt*(code: SYSTEM.INT32); BEGIN HaltCode := code; IF HaltHandler # NIL THEN HaltHandler(code) END; diff --git a/src/test/confidence/planned-binary-change b/src/test/confidence/planned-binary-change index 02241a25..d7a05d09 100644 --- a/src/test/confidence/planned-binary-change +++ b/src/test/confidence/planned-binary-change @@ -1 +1 @@ -16 Oct 2016 13:42:18 +18 Oct 2016 18:12:01 diff --git a/src/tools/make/configure.c b/src/tools/make/configure.c index 4a3a7c6e..695fa0e2 100644 --- a/src/tools/make/configure.c +++ b/src/tools/make/configure.c @@ -144,9 +144,9 @@ void determineCCompiler() { compiler = "gcc"; if (strncasecmp(os, "cygwin", 6) == 0) { // Avoid cygwin specific warning that -fPIC is ignored. - cc = "gcc -g -msse2" optimize; + cc = "gcc -g" optimize; } else { - cc = "gcc -fPIC -g -msse2" optimize; + cc = "gcc -fPIC -g" optimize; } #elif defined(_MSC_VER) compiler = "MSC"; From a4c372253baec32323a9c13a6670797ef90417cc Mon Sep 17 00:00:00 2001 From: David Brown Date: Tue, 18 Oct 2016 18:52:10 +0100 Subject: [PATCH 291/580] Fix AssertFail parameter type in Platformwindows.Mod. --- bootstrap/windows-48/Platform.c | 22 +++++++++++----------- bootstrap/windows-88/Platform.c | 22 +++++++++++----------- src/runtime/Platformwindows.Mod | 24 ++++++++++++------------ 3 files changed, 34 insertions(+), 34 deletions(-) diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index ab0aeef3..43a3fe2d 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -130,22 +130,22 @@ extern void Heap_InitHeap(); #define Platform_bhfiVsn() (LONGINT)bhfi.dwVolumeSerialNumber #define Platform_byHandleFileInformation() BY_HANDLE_FILE_INFORMATION bhfi #define Platform_cleanupProcess() CloseHandle(pi.hProcess); CloseHandle(pi.hThread); -#define Platform_closeHandle(h) (INTEGER)CloseHandle((HANDLE)(address)h) +#define Platform_closeHandle(h) (INTEGER)CloseHandle((address)h) #define Platform_createProcess(str, str__len) (INTEGER)CreateProcess(0, (char*)str, 0,0,0,0,0,0,&si,&pi) #define Platform_deleteFile(n, n__len) (INTEGER)DeleteFile((char*)n) #define Platform_err() (INTEGER)GetLastError() -#define Platform_errc(c) WriteFile((HANDLE)(address)Platform_StdOut, &c, 1, 0,0) -#define Platform_errstring(s, s__len) WriteFile((HANDLE)(address)Platform_StdOut, s, s__len-1, 0,0) +#define Platform_errc(c) WriteFile((address)Platform_StdOut, &c, 1, 0,0) +#define Platform_errstring(s, s__len) WriteFile((address)Platform_StdOut, s, s__len-1, 0,0) #define Platform_exit(code) ExitProcess((UINT)code) #define Platform_fileTimeToSysTime() SYSTEMTIME st; FileTimeToSystemTime(&ft, &st) -#define Platform_flushFileBuffers(h) (INTEGER)FlushFileBuffers((HANDLE)h) +#define Platform_flushFileBuffers(h) (INTEGER)FlushFileBuffers((address)h) #define Platform_free(address) HeapFree(GetProcessHeap(), 0, (void*)address) #define Platform_ftToUli() ULARGE_INTEGER ul; ul.LowPart=ft.dwLowDateTime; ul.HighPart=ft.dwHighDateTime #define Platform_getCurrentDirectory(n, n__len) GetCurrentDirectory(n__len, (char*)n) #define Platform_getExitCodeProcess(exitcode) GetExitCodeProcess(pi.hProcess, (DWORD*)exitcode); -#define Platform_getFileInformationByHandle(h) (INTEGER)GetFileInformationByHandle((HANDLE)(address)h, &bhfi) -#define Platform_getFilePos(h, r, rc) LARGE_INTEGER liz = {0}; *rc = (INTEGER)SetFilePointerEx((HANDLE)(address)h, liz, &li, FILE_CURRENT); *r = (LONGINT)li.QuadPart -#define Platform_getFileSize(h) (INTEGER)GetFileSizeEx((HANDLE)(address)h, &li) +#define Platform_getFileInformationByHandle(h) (INTEGER)GetFileInformationByHandle((address)h, &bhfi) +#define Platform_getFilePos(h, r, rc) LARGE_INTEGER liz = {0}; *rc = (INTEGER)SetFilePointerEx((address)h, liz, &li, FILE_CURRENT); *r = (LONGINT)li.QuadPart +#define Platform_getFileSize(h) (INTEGER)GetFileSizeEx((address)h, &li) #define Platform_getLocalTime() SYSTEMTIME st; GetLocalTime(&st) #define Platform_getenv(name, name__len, buf, buf__len) (INTEGER)GetEnvironmentVariable((char*)name, (char*)buf, buf__len) #define Platform_getpid() (INTEGER)GetCurrentProcessId() @@ -161,13 +161,13 @@ extern void Heap_InitHeap(); #define Platform_openro(n, n__len) (LONGINT)(address)CreateFile((char*)n, GENERIC_READ , FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) #define Platform_openrw(n, n__len) (LONGINT)(address)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) #define Platform_processInfo() PROCESS_INFORMATION pi = {0}; -#define Platform_readfile(fd, p, l, n) (INTEGER)ReadFile((HANDLE)fd, (void*)p, (DWORD)l, (DWORD*)n, 0) +#define Platform_readfile(fd, p, l, n) (INTEGER)ReadFile((address)fd, (void*)p, (DWORD)l, (DWORD*)n, 0) #define Platform_seekcur() FILE_CURRENT #define Platform_seekend() FILE_END #define Platform_seekset() FILE_BEGIN #define Platform_setCurrentDirectory(n, n__len) (INTEGER)SetCurrentDirectory((char*)n) -#define Platform_setEndOfFile(h) (INTEGER)SetEndOfFile((HANDLE)(address)h) -#define Platform_setFilePointerEx(h, o, r, rc) li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((HANDLE)(address)h, li, 0, (DWORD)r) +#define Platform_setEndOfFile(h) (INTEGER)SetEndOfFile((address)h) +#define Platform_setFilePointerEx(h, o, r, rc) li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((address)h, li, 0, (DWORD)r) #define Platform_sleep(ms) Sleep((DWORD)ms) #define Platform_stToFt() FILETIME ft; SystemTimeToFileTime(&st, &ft) #define Platform_startupInfo() STARTUPINFO si = {0}; si.cb = sizeof(si); @@ -182,7 +182,7 @@ extern void Heap_InitHeap(); #define Platform_ulSec() (LONGINT)(ul.QuadPart / 1000000LL) #define Platform_uluSec() (LONGINT)(ul.QuadPart % 1000000LL) #define Platform_waitForProcess() (INTEGER)WaitForSingleObject(pi.hProcess, INFINITE) -#define Platform_writefile(fd, p, l) (INTEGER)WriteFile((HANDLE)fd, (void*)(p), (DWORD)l, 0,0) +#define Platform_writefile(fd, p, l) (INTEGER)WriteFile((address)fd, (void*)(p), (DWORD)l, 0,0) BOOLEAN Platform_TooManyFiles (int16 e) { diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index e47478bc..a802c149 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -130,22 +130,22 @@ extern void Heap_InitHeap(); #define Platform_bhfiVsn() (LONGINT)bhfi.dwVolumeSerialNumber #define Platform_byHandleFileInformation() BY_HANDLE_FILE_INFORMATION bhfi #define Platform_cleanupProcess() CloseHandle(pi.hProcess); CloseHandle(pi.hThread); -#define Platform_closeHandle(h) (INTEGER)CloseHandle((HANDLE)(address)h) +#define Platform_closeHandle(h) (INTEGER)CloseHandle((address)h) #define Platform_createProcess(str, str__len) (INTEGER)CreateProcess(0, (char*)str, 0,0,0,0,0,0,&si,&pi) #define Platform_deleteFile(n, n__len) (INTEGER)DeleteFile((char*)n) #define Platform_err() (INTEGER)GetLastError() -#define Platform_errc(c) WriteFile((HANDLE)(address)Platform_StdOut, &c, 1, 0,0) -#define Platform_errstring(s, s__len) WriteFile((HANDLE)(address)Platform_StdOut, s, s__len-1, 0,0) +#define Platform_errc(c) WriteFile((address)Platform_StdOut, &c, 1, 0,0) +#define Platform_errstring(s, s__len) WriteFile((address)Platform_StdOut, s, s__len-1, 0,0) #define Platform_exit(code) ExitProcess((UINT)code) #define Platform_fileTimeToSysTime() SYSTEMTIME st; FileTimeToSystemTime(&ft, &st) -#define Platform_flushFileBuffers(h) (INTEGER)FlushFileBuffers((HANDLE)h) +#define Platform_flushFileBuffers(h) (INTEGER)FlushFileBuffers((address)h) #define Platform_free(address) HeapFree(GetProcessHeap(), 0, (void*)address) #define Platform_ftToUli() ULARGE_INTEGER ul; ul.LowPart=ft.dwLowDateTime; ul.HighPart=ft.dwHighDateTime #define Platform_getCurrentDirectory(n, n__len) GetCurrentDirectory(n__len, (char*)n) #define Platform_getExitCodeProcess(exitcode) GetExitCodeProcess(pi.hProcess, (DWORD*)exitcode); -#define Platform_getFileInformationByHandle(h) (INTEGER)GetFileInformationByHandle((HANDLE)(address)h, &bhfi) -#define Platform_getFilePos(h, r, rc) LARGE_INTEGER liz = {0}; *rc = (INTEGER)SetFilePointerEx((HANDLE)(address)h, liz, &li, FILE_CURRENT); *r = (LONGINT)li.QuadPart -#define Platform_getFileSize(h) (INTEGER)GetFileSizeEx((HANDLE)(address)h, &li) +#define Platform_getFileInformationByHandle(h) (INTEGER)GetFileInformationByHandle((address)h, &bhfi) +#define Platform_getFilePos(h, r, rc) LARGE_INTEGER liz = {0}; *rc = (INTEGER)SetFilePointerEx((address)h, liz, &li, FILE_CURRENT); *r = (LONGINT)li.QuadPart +#define Platform_getFileSize(h) (INTEGER)GetFileSizeEx((address)h, &li) #define Platform_getLocalTime() SYSTEMTIME st; GetLocalTime(&st) #define Platform_getenv(name, name__len, buf, buf__len) (INTEGER)GetEnvironmentVariable((char*)name, (char*)buf, buf__len) #define Platform_getpid() (INTEGER)GetCurrentProcessId() @@ -161,13 +161,13 @@ extern void Heap_InitHeap(); #define Platform_openro(n, n__len) (LONGINT)(address)CreateFile((char*)n, GENERIC_READ , FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) #define Platform_openrw(n, n__len) (LONGINT)(address)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) #define Platform_processInfo() PROCESS_INFORMATION pi = {0}; -#define Platform_readfile(fd, p, l, n) (INTEGER)ReadFile((HANDLE)fd, (void*)p, (DWORD)l, (DWORD*)n, 0) +#define Platform_readfile(fd, p, l, n) (INTEGER)ReadFile((address)fd, (void*)p, (DWORD)l, (DWORD*)n, 0) #define Platform_seekcur() FILE_CURRENT #define Platform_seekend() FILE_END #define Platform_seekset() FILE_BEGIN #define Platform_setCurrentDirectory(n, n__len) (INTEGER)SetCurrentDirectory((char*)n) -#define Platform_setEndOfFile(h) (INTEGER)SetEndOfFile((HANDLE)(address)h) -#define Platform_setFilePointerEx(h, o, r, rc) li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((HANDLE)(address)h, li, 0, (DWORD)r) +#define Platform_setEndOfFile(h) (INTEGER)SetEndOfFile((address)h) +#define Platform_setFilePointerEx(h, o, r, rc) li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((address)h, li, 0, (DWORD)r) #define Platform_sleep(ms) Sleep((DWORD)ms) #define Platform_stToFt() FILETIME ft; SystemTimeToFileTime(&st, &ft) #define Platform_startupInfo() STARTUPINFO si = {0}; si.cb = sizeof(si); @@ -182,7 +182,7 @@ extern void Heap_InitHeap(); #define Platform_ulSec() (LONGINT)(ul.QuadPart / 1000000LL) #define Platform_uluSec() (LONGINT)(ul.QuadPart % 1000000LL) #define Platform_waitForProcess() (INTEGER)WaitForSingleObject(pi.hProcess, INFINITE) -#define Platform_writefile(fd, p, l) (INTEGER)WriteFile((HANDLE)fd, (void*)(p), (DWORD)l, 0,0) +#define Platform_writefile(fd, p, l) (INTEGER)WriteFile((address)fd, (void*)(p), (DWORD)l, 0,0) BOOLEAN Platform_TooManyFiles (int16 e) { diff --git a/src/runtime/Platformwindows.Mod b/src/runtime/Platformwindows.Mod index 3c74019b..349fac4f 100644 --- a/src/runtime/Platformwindows.Mod +++ b/src/runtime/Platformwindows.Mod @@ -336,7 +336,7 @@ END New; -PROCEDURE -closeHandle(h: FileHandle): INTEGER "(INTEGER)CloseHandle((HANDLE)(address)h)"; +PROCEDURE -closeHandle(h: FileHandle): INTEGER "(INTEGER)CloseHandle((address)h)"; PROCEDURE Close*(h: FileHandle): ErrorCode; BEGIN @@ -346,7 +346,7 @@ END Close; PROCEDURE -byHandleFileInformation "BY_HANDLE_FILE_INFORMATION bhfi"; -PROCEDURE -getFileInformationByHandle(h: FileHandle): INTEGER "(INTEGER)GetFileInformationByHandle((HANDLE)(address)h, &bhfi)"; +PROCEDURE -getFileInformationByHandle(h: FileHandle): INTEGER "(INTEGER)GetFileInformationByHandle((address)h, &bhfi)"; PROCEDURE -bhfiMtimeHigh(): LONGINT "(LONGINT)bhfi.ftLastWriteTime.dwHighDateTime"; PROCEDURE -bhfiMtimeLow(): LONGINT "(LONGINT)bhfi.ftLastWriteTime.dwLowDateTime"; PROCEDURE -bhfiVsn(): LONGINT "(LONGINT)bhfi.dwVolumeSerialNumber"; @@ -405,7 +405,7 @@ END MTimeAsClock; PROCEDURE -largeInteger "LARGE_INTEGER li"; PROCEDURE -liLongint(): LONGINT "(LONGINT)li.QuadPart"; -PROCEDURE -getFileSize(h: FileHandle): INTEGER "(INTEGER)GetFileSizeEx((HANDLE)(address)h, &li)"; +PROCEDURE -getFileSize(h: FileHandle): INTEGER "(INTEGER)GetFileSizeEx((address)h, &li)"; PROCEDURE Size*(h: FileHandle; VAR l: LONGINT): ErrorCode; BEGIN @@ -417,7 +417,7 @@ END Size; PROCEDURE -readfile (fd: LONGINT; p: SYSTEM.ADDRESS; l: LONGINT; VAR n: SYSTEM.INT32): INTEGER -"(INTEGER)ReadFile((HANDLE)fd, (void*)p, (DWORD)l, (DWORD*)n, 0)"; +"(INTEGER)ReadFile((address)fd, (void*)p, (DWORD)l, (DWORD*)n, 0)"; PROCEDURE Read*(h: FileHandle; p: SYSTEM.ADDRESS; l: LONGINT; VAR n: LONGINT): ErrorCode; VAR result: INTEGER; lengthread: SYSTEM.INT32; @@ -436,7 +436,7 @@ END ReadBuf; PROCEDURE -writefile(fd: LONGINT; p: SYSTEM.ADDRESS; l: LONGINT): INTEGER -"(INTEGER)WriteFile((HANDLE)fd, (void*)(p), (DWORD)l, 0,0)"; +"(INTEGER)WriteFile((address)fd, (void*)(p), (DWORD)l, 0,0)"; PROCEDURE Write*(h: FileHandle; p: SYSTEM.ADDRESS; l: LONGINT): ErrorCode; BEGIN @@ -445,7 +445,7 @@ END Write; -PROCEDURE -flushFileBuffers(h: FileHandle): INTEGER "(INTEGER)FlushFileBuffers((HANDLE)h)"; +PROCEDURE -flushFileBuffers(h: FileHandle): INTEGER "(INTEGER)FlushFileBuffers((address)h)"; PROCEDURE Sync*(h: FileHandle): ErrorCode; BEGIN @@ -455,7 +455,7 @@ END Sync; PROCEDURE -setFilePointerEx(h: FileHandle; o: LONGINT; r: INTEGER; VAR rc: INTEGER) -"li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((HANDLE)(address)h, li, 0, (DWORD)r)"; +"li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((address)h, li, 0, (DWORD)r)"; PROCEDURE -seekset(): INTEGER "FILE_BEGIN"; PROCEDURE -seekcur(): INTEGER "FILE_CURRENT"; @@ -471,9 +471,9 @@ END Seek; -PROCEDURE -setEndOfFile(h: FileHandle): INTEGER "(INTEGER)SetEndOfFile((HANDLE)(address)h)"; +PROCEDURE -setEndOfFile(h: FileHandle): INTEGER "(INTEGER)SetEndOfFile((address)h)"; PROCEDURE -getFilePos(h: FileHandle; VAR r: LONGINT; VAR rc: INTEGER) -"LARGE_INTEGER liz = {0}; *rc = (INTEGER)SetFilePointerEx((HANDLE)(address)h, liz, &li, FILE_CURRENT); *r = (LONGINT)li.QuadPart"; +"LARGE_INTEGER liz = {0}; *rc = (INTEGER)SetFilePointerEx((address)h, liz, &li, FILE_CURRENT); *r = (LONGINT)li.QuadPart"; PROCEDURE Truncate*(h: FileHandle; limit: LONGINT): ErrorCode; VAR rc: INTEGER; oldpos: LONGINT; @@ -531,8 +531,8 @@ PROCEDURE Exit*(code: INTEGER); BEGIN exit(code) END Exit; -PROCEDURE -errstring(s: ARRAY OF CHAR) 'WriteFile((HANDLE)(address)Platform_StdOut, s, s__len-1, 0,0)'; -PROCEDURE -errc (c: CHAR) 'WriteFile((HANDLE)(address)Platform_StdOut, &c, 1, 0,0)'; +PROCEDURE -errstring(s: ARRAY OF CHAR) 'WriteFile((address)Platform_StdOut, s, s__len-1, 0,0)'; +PROCEDURE -errc (c: CHAR) 'WriteFile((address)Platform_StdOut, &c, 1, 0,0)'; PROCEDURE errch(c: CHAR); BEGIN errc(c) END errch; PROCEDURE errln; BEGIN errch(0DX); errch(0AX) END errln; @@ -575,7 +575,7 @@ BEGIN exit(SYSTEM.VAL(INTEGER,code)); END Halt; -PROCEDURE AssertFail*(code: LONGINT); +PROCEDURE AssertFail*(code: SYSTEM.INT32); BEGIN errstring("Assertion failure."); IF code # 0 THEN errstring(" ASSERT code "); errint(code); errstring("."); END; From 1e7d3ca4fdb784c2ff1a78351496d6ea7ccdf2db Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 20 Oct 2016 19:20:25 +0100 Subject: [PATCH 292/580] Add isptest (active) and In.Mod (not yet used). --- src/runtime/In.Mod | 128 +++ src/runtime/SYSTEM.h | 17 - src/test/confidence/isptest/expected | 1148 +++++++++++++++++++++++ src/test/confidence/isptest/isptest.mod | 27 + src/test/confidence/isptest/test.sh | 13 + src/tools/make/oberon.mk | 2 +- 6 files changed, 1317 insertions(+), 18 deletions(-) create mode 100644 src/test/confidence/isptest/expected create mode 100644 src/test/confidence/isptest/isptest.mod create mode 100644 src/test/confidence/isptest/test.sh diff --git a/src/runtime/In.Mod b/src/runtime/In.Mod index e69de29b..aa67e4e7 100644 --- a/src/runtime/In.Mod +++ b/src/runtime/In.Mod @@ -0,0 +1,128 @@ +MODULE In; + +IMPORT Platform, SYSTEM, Out; + +VAR + nextch: CHAR; + ready: BOOLEAN; + initialized: BOOLEAN; + + Done-: BOOLEAN; + +PROCEDURE ReadChar; +VAR error: Platform.ErrorCode; n: LONGINT; ch: CHAR; +BEGIN + error := Platform.ReadBuf(Platform.StdIn, ch, n); + ready := (error = 0) & (n = 1); + IF ready & (nextch = 0DX) & (ch = 0AX) THEN + ready := (error = 0) & (n = 1) + END; + IF ready THEN nextch := ch ELSE nextch := 0X END +END ReadChar; + +PROCEDURE Flush; +BEGIN Out.Flush; IF ~initialized THEN ReadChar END; initialized := TRUE +END Flush; + +PROCEDURE Open*; + VAR error: Platform.ErrorCode; +BEGIN + error := Platform.Seek(Platform.StdIn, 0, Platform.SeekSet); (* Rewind STDIN to beginning of file. *) + ready := TRUE; initialized := FALSE; +END Open; + +PROCEDURE Char*(VAR ch: CHAR); +BEGIN Flush; + Done := ready; + IF ready THEN ch := nextch; ReadChar ELSE ch := 0X END +END Char; + +PROCEDURE Skip; +BEGIN + WHILE ready & (nextch <= " ") DO ReadChar END; (* Skip leading blanks, CR, LF, tab etc. *) +END Skip; + +PROCEDURE HugeInt*(VAR h: HUGEINT); +VAR + neg, hex, decdigit, hexdigit: BOOLEAN; + decacc, hexacc, digit: HUGEINT; +BEGIN + Flush; Skip; + + neg := nextch = '-'; IF neg THEN ReadChar END; + hex := FALSE; + endofnum := FALSE; + decacc := 0; + hexacc := 0; + Done := FALSE; + + WHILE ready & ~endofnum DO + decdigit := (nextch >= "0") & (nextch <= "9"); + IF decdigit THEN digit := ORD(nextch) MOD 16 END; + + hexdigit := (nextch >= "f") & (nextch <= "f") OR (nextch >= "A") & (nextch <= "F"); + IF hexdigit THEN ORD(nextch) MOD 16 + 9; hex := TRUE END; + + IF decdigit OR hexdigit THEN + Done := TRUE; + decacc := decacc * 10 + digit; + hexacc := hexacc * 16 + digit; + ReadChar + ELSIF nextch = "H" THEN + hex := TRUE; endofnum := TRUE; ReadChar + ELSE + endofnum := TRUE + END + END; + IF Done THEN + IF hex THEN h := hexacc ELSE h := decacc END; + IF neg THEN h := -h END + ELSE + h := 0 + END +END HugeInt; + +PROCEDURE Int*(VAR i: INTEGER); + VAR h: HUGEINT; +BEGIN HugeInt(h); i := SYSTEM.VAL(INTEGER, h) +END Int; + +PROCEDURE LongInt*(VAR i: LONGINT); + VAR h: HUGEINT; +BEGIN HugeInt(h); i := SYSTEM.VAL(LONGINT, h) +END LongInt; + +PROCEDURE Real*(VAR x: REAL); +BEGIN ASSERT(FALSE) (* Not implemented *) +END Real; + +PROCEDURE LongReal*(VAR y: LONGREAL); +BEGIN ASSERT(FALSE) (* Not implemented *) +END LongReal; + +PROCEDURE String*(VAR str: ARRAY OF CHAR); + VAR i: INTEGER; +BEGIN Flush; Skip; i := 0; + IF ready AND nextch = '"' THEN (* " *) + ReadChar; + WHILE ready & (i < LEN(str)-1) & (nextch >= " ") & (nextch # '"') DO (* " *) + str[i] := nextch; INC(i) + END + END; + Done := ready & (i < LEN(str)-1) & (nextch = '"'); (* " *) + IF Done THEN + ReadChar; str[i] := 0X + ELSE + str[0] := 0X + END +END String; + +PROCEDURE Name*(VAR name: ARRAY OF CHAR); (* Read filename. Presumably using shell semantics. *) +BEGIN ASSERT(FALSE) (* Not implemented *) +END Name; + +BEGIN + nextch := 0X; + ready := FALSE; + initialized := FALSE; +END In. diff --git a/src/runtime/SYSTEM.h b/src/runtime/SYSTEM.h index 7cba936e..8ded6b23 100644 --- a/src/runtime/SYSTEM.h +++ b/src/runtime/SYSTEM.h @@ -8,23 +8,6 @@ #define __o_64 #endif -// // Temporary while bootstrapping and clearing up SYSTEM.c. -// -// #ifndef LONGINT -// #if defined (__o_64) -// #define INTEGER int32 -// #define LONGINT int64 -// #define SET uint64 -// #else -// #define INTEGER int16 -// #define LONGINT int32 -// #define SET uint32 -// #endif -// #endif - - - - // Declare memcpy in a way compatible with C compilers intrinsic // built in implementations. diff --git a/src/test/confidence/isptest/expected b/src/test/confidence/isptest/expected new file mode 100644 index 00000000..ef0f3a55 --- /dev/null +++ b/src/test/confidence/isptest/expected @@ -0,0 +1,1148 @@ +--- Testing with Oberon 2 variable model --- +pos=2 char=O +pos=3 char=D +pos=4 char=U +pos=5 char=L +pos=6 char=E +pos=7 char= +pos=8 char=i +pos=9 char=s +pos=10 char=p +pos=11 char=t +pos=12 char=e +pos=13 char=s +pos=14 char=t +pos=15 char=; +pos=17 char= +pos=19 char= +pos=20 char=I +pos=21 char=M +pos=22 char=P +pos=23 char=O +pos=24 char=R +pos=25 char=T +pos=26 char= +pos=27 char=F +pos=28 char=i +pos=29 char=l +pos=30 char=e +pos=31 char=s +pos=32 char=, +pos=33 char= +pos=34 char=T +pos=35 char=e +pos=36 char=x +pos=37 char=t +pos=38 char=s +pos=39 char=, +pos=40 char= +pos=41 char=O +pos=42 char=u +pos=43 char=t +pos=44 char=, +pos=45 char= +pos=46 char=P +pos=47 char=l +pos=48 char=a +pos=49 char=t +pos=50 char=f +pos=51 char=o +pos=52 char=r +pos=53 char=m +pos=54 char=; +pos=56 char= +pos=58 char= +pos=59 char=C +pos=60 char=O +pos=61 char=N +pos=62 char=S +pos=63 char=T +pos=64 char= +pos=65 char=p +pos=66 char=a +pos=67 char=t +pos=68 char=h +pos=69 char== +pos=70 char=" +pos=71 char=i +pos=72 char=s +pos=73 char=p +pos=74 char=t +pos=75 char=e +pos=76 char=s +pos=77 char=t +pos=78 char=. +pos=79 char=m +pos=80 char=o +pos=81 char=d +pos=82 char=" +pos=83 char=; +pos=85 char= +pos=87 char= +pos=88 char=V +pos=89 char=A +pos=90 char=R +pos=92 char= +pos=93 char= +pos=94 char= +pos=95 char=T +pos=96 char=: +pos=97 char= +pos=98 char=T +pos=99 char=e +pos=100 char=x +pos=101 char=t +pos=102 char=s +pos=103 char=. +pos=104 char=T +pos=105 char=e +pos=106 char=x +pos=107 char=t +pos=108 char=; +pos=110 char= +pos=111 char= +pos=112 char= +pos=113 char=R +pos=114 char=: +pos=115 char= +pos=116 char=T +pos=117 char=e +pos=118 char=x +pos=119 char=t +pos=120 char=s +pos=121 char=. +pos=122 char=R +pos=123 char=e +pos=124 char=a +pos=125 char=d +pos=126 char=e +pos=127 char=r +pos=128 char=; +pos=130 char= +pos=131 char= +pos=132 char= +pos=133 char=c +pos=134 char=h +pos=135 char=: +pos=136 char= +pos=137 char=C +pos=138 char=H +pos=139 char=A +pos=140 char=R +pos=141 char=; +pos=143 char= +pos=144 char= +pos=145 char= +pos=146 char=i +pos=147 char=, +pos=148 char= +pos=149 char=j +pos=150 char=, +pos=151 char= +pos=152 char=k +pos=153 char= +pos=154 char=: +pos=155 char= +pos=156 char=L +pos=157 char=O +pos=158 char=N +pos=159 char=G +pos=160 char=I +pos=161 char=N +pos=162 char=T +pos=163 char=; +pos=165 char= +pos=166 char=B +pos=167 char=E +pos=168 char=G +pos=169 char=I +pos=170 char=N +pos=172 char= +pos=173 char= +pos=174 char= +pos=175 char=N +pos=176 char=E +pos=177 char=W +pos=178 char=( +pos=179 char=T +pos=180 char=) +pos=181 char=; +pos=183 char= +pos=184 char= +pos=185 char= +pos=186 char=I +pos=187 char=F +pos=188 char= +pos=189 char=F +pos=190 char=i +pos=191 char=l +pos=192 char=e +pos=193 char=s +pos=194 char=. +pos=195 char=O +pos=196 char=l +pos=197 char=d +pos=198 char=( +pos=199 char=p +pos=200 char=a +pos=201 char=t +pos=202 char=h +pos=203 char=) +pos=204 char= +pos=205 char=# +pos=206 char= +pos=207 char=N +pos=208 char=I +pos=209 char=L +pos=210 char= +pos=211 char=T +pos=212 char=H +pos=213 char=E +pos=214 char=N +pos=216 char= +pos=217 char= +pos=218 char= +pos=219 char= +pos=220 char= +pos=221 char=T +pos=222 char=e +pos=223 char=x +pos=224 char=t +pos=225 char=s +pos=226 char=. +pos=227 char=O +pos=228 char=p +pos=229 char=e +pos=230 char=n +pos=231 char=( +pos=232 char=T +pos=233 char=, +pos=234 char= +pos=235 char=p +pos=236 char=a +pos=237 char=t +pos=238 char=h +pos=239 char=) +pos=240 char=; +pos=242 char= +pos=243 char= +pos=244 char= +pos=245 char= +pos=246 char= +pos=247 char=T +pos=248 char=e +pos=249 char=x +pos=250 char=t +pos=251 char=s +pos=252 char=. +pos=253 char=O +pos=254 char=p +pos=255 char=e +pos=256 char=n +pos=257 char=R +pos=258 char=e +pos=259 char=a +pos=260 char=d +pos=261 char=e +pos=262 char=r +pos=263 char=( +pos=264 char=R +pos=265 char=, +pos=266 char= +pos=267 char=T +pos=268 char=, +pos=269 char= +pos=270 char=0 +pos=271 char=) +pos=272 char=; +pos=273 char= +pos=274 char=T +pos=275 char=e +pos=276 char=x +pos=277 char=t +pos=278 char=s +pos=279 char=. +pos=280 char=R +pos=281 char=e +pos=282 char=a +pos=283 char=d +pos=284 char=( +pos=285 char=R +pos=286 char=, +pos=287 char= +pos=288 char=c +pos=289 char=h +pos=290 char=) +pos=291 char=; +pos=293 char= +pos=294 char= +pos=295 char= +pos=296 char= +pos=297 char= +pos=298 char=W +pos=299 char=H +pos=300 char=I +pos=301 char=L +pos=302 char=E +pos=303 char= +pos=304 char=~ +pos=305 char=R +pos=306 char=. +pos=307 char=e +pos=308 char=o +pos=309 char=t +pos=310 char= +pos=311 char=D +pos=312 char=O +pos=314 char= +pos=315 char= +pos=316 char= +pos=317 char= +pos=318 char= +pos=319 char= +pos=320 char= +pos=321 char= +pos=322 char=T +pos=323 char=e +pos=324 char=x +pos=325 char=t +pos=326 char=s +pos=327 char=. +pos=328 char=R +pos=329 char=e +pos=330 char=a +pos=331 char=d +pos=332 char=( +pos=333 char=R +pos=334 char=, +pos=335 char= +pos=336 char=c +pos=337 char=h +pos=338 char=) +pos=339 char=; +pos=341 char= +pos=342 char= +pos=343 char= +pos=344 char= +pos=345 char= +pos=346 char= +pos=347 char= +pos=348 char= +pos=349 char=i +pos=350 char= +pos=351 char=: +pos=352 char== +pos=353 char= +pos=354 char=T +pos=355 char=e +pos=356 char=x +pos=357 char=t +pos=358 char=s +pos=359 char=. +pos=360 char=P +pos=361 char=o +pos=362 char=s +pos=363 char=( +pos=364 char=R +pos=365 char=) +pos=366 char=; +pos=368 char= +pos=369 char= +pos=370 char= +pos=371 char= +pos=372 char= +pos=373 char= +pos=374 char= +pos=375 char= +pos=376 char=O +pos=377 char=u +pos=378 char=t +pos=379 char=. +pos=380 char=S +pos=381 char=t +pos=382 char=r +pos=383 char=i +pos=384 char=n +pos=385 char=g +pos=386 char=( +pos=387 char=" +pos=388 char=p +pos=389 char=o +pos=390 char=s +pos=391 char== +pos=392 char=" +pos=393 char=) +pos=394 char=; +pos=395 char= +pos=396 char=O +pos=397 char=u +pos=398 char=t +pos=399 char=. +pos=400 char=I +pos=401 char=n +pos=402 char=t +pos=403 char=( +pos=404 char=i +pos=405 char=, +pos=406 char=0 +pos=407 char=) +pos=408 char=; +pos=409 char= +pos=410 char=O +pos=411 char=u +pos=412 char=t +pos=413 char=. +pos=414 char=S +pos=415 char=t +pos=416 char=r +pos=417 char=i +pos=418 char=n +pos=419 char=g +pos=420 char=( +pos=421 char=" +pos=422 char= +pos=423 char=c +pos=424 char=h +pos=425 char=a +pos=426 char=r +pos=427 char== +pos=428 char=" +pos=429 char=) +pos=430 char=; +pos=431 char= +pos=432 char=O +pos=433 char=u +pos=434 char=t +pos=435 char=. +pos=436 char=C +pos=437 char=h +pos=438 char=a +pos=439 char=r +pos=440 char=( +pos=441 char=c +pos=442 char=h +pos=443 char=) +pos=444 char=; +pos=445 char= +pos=446 char=O +pos=447 char=u +pos=448 char=t +pos=449 char=. +pos=450 char=L +pos=451 char=n +pos=452 char=; +pos=454 char= +pos=455 char= +pos=456 char= +pos=457 char= +pos=458 char= +pos=459 char= +pos=460 char= +pos=461 char= +pos=462 char=I +pos=463 char=F +pos=464 char= +pos=465 char=i +pos=466 char= +pos=467 char== +pos=468 char= +pos=469 char=2 +pos=470 char=1 +pos=471 char=9 +pos=472 char=0 +pos=473 char=6 +pos=474 char= +pos=475 char=T +pos=476 char=H +pos=477 char=E +pos=478 char=N +pos=480 char= +pos=481 char= +pos=482 char= +pos=483 char= +pos=484 char= +pos=485 char= +pos=486 char= +pos=487 char= +pos=488 char= +pos=489 char= +pos=490 char=O +pos=491 char=u +pos=492 char=t +pos=493 char=. +pos=494 char=S +pos=495 char=t +pos=496 char=r +pos=497 char=i +pos=498 char=n +pos=499 char=g +pos=500 char=( +pos=501 char=" +pos=502 char=2 +pos=503 char=1 +pos=504 char=9 +pos=505 char=0 +pos=506 char=6 +pos=507 char=" +pos=508 char=) +pos=509 char=; +pos=510 char= +pos=511 char=O +pos=512 char=u +pos=513 char=t +pos=514 char=. +pos=515 char=L +pos=516 char=n +pos=517 char=; +pos=519 char= +pos=520 char= +pos=521 char= +pos=522 char= +pos=523 char= +pos=524 char= +pos=525 char= +pos=526 char= +pos=527 char= +pos=528 char= +pos=529 char=( +pos=530 char=* +pos=531 char=P +pos=532 char=l +pos=533 char=a +pos=534 char=t +pos=535 char=f +pos=536 char=o +pos=537 char=r +pos=538 char=m +pos=539 char=. +pos=540 char=D +pos=541 char=e +pos=542 char=l +pos=543 char=a +pos=544 char=y +pos=545 char=( +pos=546 char=1 +pos=547 char=0 +pos=548 char=0 +pos=549 char=0 +pos=550 char=0 +pos=551 char=) +pos=552 char=; +pos=553 char=* +pos=554 char=) +pos=556 char= +pos=557 char= +pos=558 char= +pos=559 char= +pos=560 char= +pos=561 char= +pos=562 char= +pos=563 char= +pos=564 char=E +pos=565 char=N +pos=566 char=D +pos=567 char=; +pos=569 char= +pos=570 char= +pos=571 char= +pos=572 char= +pos=573 char= +pos=574 char=E +pos=575 char=N +pos=576 char=D +pos=577 char=; +pos=579 char= +pos=580 char= +pos=581 char= +pos=582 char=E +pos=583 char=N +pos=584 char=D +pos=586 char= +pos=587 char=E +pos=588 char=N +pos=589 char=D +pos=590 char= +pos=591 char=i +pos=592 char=s +pos=593 char=p +pos=594 char=t +pos=595 char=e +pos=596 char=s +pos=597 char=t +pos=598 char=. +pos=599 char= + + +--- Testing with Component Pascal variable model --- +pos=2 char=O +pos=3 char=D +pos=4 char=U +pos=5 char=L +pos=6 char=E +pos=7 char= +pos=8 char=i +pos=9 char=s +pos=10 char=p +pos=11 char=t +pos=12 char=e +pos=13 char=s +pos=14 char=t +pos=15 char=; +pos=17 char= +pos=19 char= +pos=20 char=I +pos=21 char=M +pos=22 char=P +pos=23 char=O +pos=24 char=R +pos=25 char=T +pos=26 char= +pos=27 char=F +pos=28 char=i +pos=29 char=l +pos=30 char=e +pos=31 char=s +pos=32 char=, +pos=33 char= +pos=34 char=T +pos=35 char=e +pos=36 char=x +pos=37 char=t +pos=38 char=s +pos=39 char=, +pos=40 char= +pos=41 char=O +pos=42 char=u +pos=43 char=t +pos=44 char=, +pos=45 char= +pos=46 char=P +pos=47 char=l +pos=48 char=a +pos=49 char=t +pos=50 char=f +pos=51 char=o +pos=52 char=r +pos=53 char=m +pos=54 char=; +pos=56 char= +pos=58 char= +pos=59 char=C +pos=60 char=O +pos=61 char=N +pos=62 char=S +pos=63 char=T +pos=64 char= +pos=65 char=p +pos=66 char=a +pos=67 char=t +pos=68 char=h +pos=69 char== +pos=70 char=" +pos=71 char=i +pos=72 char=s +pos=73 char=p +pos=74 char=t +pos=75 char=e +pos=76 char=s +pos=77 char=t +pos=78 char=. +pos=79 char=m +pos=80 char=o +pos=81 char=d +pos=82 char=" +pos=83 char=; +pos=85 char= +pos=87 char= +pos=88 char=V +pos=89 char=A +pos=90 char=R +pos=92 char= +pos=93 char= +pos=94 char= +pos=95 char=T +pos=96 char=: +pos=97 char= +pos=98 char=T +pos=99 char=e +pos=100 char=x +pos=101 char=t +pos=102 char=s +pos=103 char=. +pos=104 char=T +pos=105 char=e +pos=106 char=x +pos=107 char=t +pos=108 char=; +pos=110 char= +pos=111 char= +pos=112 char= +pos=113 char=R +pos=114 char=: +pos=115 char= +pos=116 char=T +pos=117 char=e +pos=118 char=x +pos=119 char=t +pos=120 char=s +pos=121 char=. +pos=122 char=R +pos=123 char=e +pos=124 char=a +pos=125 char=d +pos=126 char=e +pos=127 char=r +pos=128 char=; +pos=130 char= +pos=131 char= +pos=132 char= +pos=133 char=c +pos=134 char=h +pos=135 char=: +pos=136 char= +pos=137 char=C +pos=138 char=H +pos=139 char=A +pos=140 char=R +pos=141 char=; +pos=143 char= +pos=144 char= +pos=145 char= +pos=146 char=i +pos=147 char=, +pos=148 char= +pos=149 char=j +pos=150 char=, +pos=151 char= +pos=152 char=k +pos=153 char= +pos=154 char=: +pos=155 char= +pos=156 char=L +pos=157 char=O +pos=158 char=N +pos=159 char=G +pos=160 char=I +pos=161 char=N +pos=162 char=T +pos=163 char=; +pos=165 char= +pos=166 char=B +pos=167 char=E +pos=168 char=G +pos=169 char=I +pos=170 char=N +pos=172 char= +pos=173 char= +pos=174 char= +pos=175 char=N +pos=176 char=E +pos=177 char=W +pos=178 char=( +pos=179 char=T +pos=180 char=) +pos=181 char=; +pos=183 char= +pos=184 char= +pos=185 char= +pos=186 char=I +pos=187 char=F +pos=188 char= +pos=189 char=F +pos=190 char=i +pos=191 char=l +pos=192 char=e +pos=193 char=s +pos=194 char=. +pos=195 char=O +pos=196 char=l +pos=197 char=d +pos=198 char=( +pos=199 char=p +pos=200 char=a +pos=201 char=t +pos=202 char=h +pos=203 char=) +pos=204 char= +pos=205 char=# +pos=206 char= +pos=207 char=N +pos=208 char=I +pos=209 char=L +pos=210 char= +pos=211 char=T +pos=212 char=H +pos=213 char=E +pos=214 char=N +pos=216 char= +pos=217 char= +pos=218 char= +pos=219 char= +pos=220 char= +pos=221 char=T +pos=222 char=e +pos=223 char=x +pos=224 char=t +pos=225 char=s +pos=226 char=. +pos=227 char=O +pos=228 char=p +pos=229 char=e +pos=230 char=n +pos=231 char=( +pos=232 char=T +pos=233 char=, +pos=234 char= +pos=235 char=p +pos=236 char=a +pos=237 char=t +pos=238 char=h +pos=239 char=) +pos=240 char=; +pos=242 char= +pos=243 char= +pos=244 char= +pos=245 char= +pos=246 char= +pos=247 char=T +pos=248 char=e +pos=249 char=x +pos=250 char=t +pos=251 char=s +pos=252 char=. +pos=253 char=O +pos=254 char=p +pos=255 char=e +pos=256 char=n +pos=257 char=R +pos=258 char=e +pos=259 char=a +pos=260 char=d +pos=261 char=e +pos=262 char=r +pos=263 char=( +pos=264 char=R +pos=265 char=, +pos=266 char= +pos=267 char=T +pos=268 char=, +pos=269 char= +pos=270 char=0 +pos=271 char=) +pos=272 char=; +pos=273 char= +pos=274 char=T +pos=275 char=e +pos=276 char=x +pos=277 char=t +pos=278 char=s +pos=279 char=. +pos=280 char=R +pos=281 char=e +pos=282 char=a +pos=283 char=d +pos=284 char=( +pos=285 char=R +pos=286 char=, +pos=287 char= +pos=288 char=c +pos=289 char=h +pos=290 char=) +pos=291 char=; +pos=293 char= +pos=294 char= +pos=295 char= +pos=296 char= +pos=297 char= +pos=298 char=W +pos=299 char=H +pos=300 char=I +pos=301 char=L +pos=302 char=E +pos=303 char= +pos=304 char=~ +pos=305 char=R +pos=306 char=. +pos=307 char=e +pos=308 char=o +pos=309 char=t +pos=310 char= +pos=311 char=D +pos=312 char=O +pos=314 char= +pos=315 char= +pos=316 char= +pos=317 char= +pos=318 char= +pos=319 char= +pos=320 char= +pos=321 char= +pos=322 char=T +pos=323 char=e +pos=324 char=x +pos=325 char=t +pos=326 char=s +pos=327 char=. +pos=328 char=R +pos=329 char=e +pos=330 char=a +pos=331 char=d +pos=332 char=( +pos=333 char=R +pos=334 char=, +pos=335 char= +pos=336 char=c +pos=337 char=h +pos=338 char=) +pos=339 char=; +pos=341 char= +pos=342 char= +pos=343 char= +pos=344 char= +pos=345 char= +pos=346 char= +pos=347 char= +pos=348 char= +pos=349 char=i +pos=350 char= +pos=351 char=: +pos=352 char== +pos=353 char= +pos=354 char=T +pos=355 char=e +pos=356 char=x +pos=357 char=t +pos=358 char=s +pos=359 char=. +pos=360 char=P +pos=361 char=o +pos=362 char=s +pos=363 char=( +pos=364 char=R +pos=365 char=) +pos=366 char=; +pos=368 char= +pos=369 char= +pos=370 char= +pos=371 char= +pos=372 char= +pos=373 char= +pos=374 char= +pos=375 char= +pos=376 char=O +pos=377 char=u +pos=378 char=t +pos=379 char=. +pos=380 char=S +pos=381 char=t +pos=382 char=r +pos=383 char=i +pos=384 char=n +pos=385 char=g +pos=386 char=( +pos=387 char=" +pos=388 char=p +pos=389 char=o +pos=390 char=s +pos=391 char== +pos=392 char=" +pos=393 char=) +pos=394 char=; +pos=395 char= +pos=396 char=O +pos=397 char=u +pos=398 char=t +pos=399 char=. +pos=400 char=I +pos=401 char=n +pos=402 char=t +pos=403 char=( +pos=404 char=i +pos=405 char=, +pos=406 char=0 +pos=407 char=) +pos=408 char=; +pos=409 char= +pos=410 char=O +pos=411 char=u +pos=412 char=t +pos=413 char=. +pos=414 char=S +pos=415 char=t +pos=416 char=r +pos=417 char=i +pos=418 char=n +pos=419 char=g +pos=420 char=( +pos=421 char=" +pos=422 char= +pos=423 char=c +pos=424 char=h +pos=425 char=a +pos=426 char=r +pos=427 char== +pos=428 char=" +pos=429 char=) +pos=430 char=; +pos=431 char= +pos=432 char=O +pos=433 char=u +pos=434 char=t +pos=435 char=. +pos=436 char=C +pos=437 char=h +pos=438 char=a +pos=439 char=r +pos=440 char=( +pos=441 char=c +pos=442 char=h +pos=443 char=) +pos=444 char=; +pos=445 char= +pos=446 char=O +pos=447 char=u +pos=448 char=t +pos=449 char=. +pos=450 char=L +pos=451 char=n +pos=452 char=; +pos=454 char= +pos=455 char= +pos=456 char= +pos=457 char= +pos=458 char= +pos=459 char= +pos=460 char= +pos=461 char= +pos=462 char=I +pos=463 char=F +pos=464 char= +pos=465 char=i +pos=466 char= +pos=467 char== +pos=468 char= +pos=469 char=2 +pos=470 char=1 +pos=471 char=9 +pos=472 char=0 +pos=473 char=6 +pos=474 char= +pos=475 char=T +pos=476 char=H +pos=477 char=E +pos=478 char=N +pos=480 char= +pos=481 char= +pos=482 char= +pos=483 char= +pos=484 char= +pos=485 char= +pos=486 char= +pos=487 char= +pos=488 char= +pos=489 char= +pos=490 char=O +pos=491 char=u +pos=492 char=t +pos=493 char=. +pos=494 char=S +pos=495 char=t +pos=496 char=r +pos=497 char=i +pos=498 char=n +pos=499 char=g +pos=500 char=( +pos=501 char=" +pos=502 char=2 +pos=503 char=1 +pos=504 char=9 +pos=505 char=0 +pos=506 char=6 +pos=507 char=" +pos=508 char=) +pos=509 char=; +pos=510 char= +pos=511 char=O +pos=512 char=u +pos=513 char=t +pos=514 char=. +pos=515 char=L +pos=516 char=n +pos=517 char=; +pos=519 char= +pos=520 char= +pos=521 char= +pos=522 char= +pos=523 char= +pos=524 char= +pos=525 char= +pos=526 char= +pos=527 char= +pos=528 char= +pos=529 char=( +pos=530 char=* +pos=531 char=P +pos=532 char=l +pos=533 char=a +pos=534 char=t +pos=535 char=f +pos=536 char=o +pos=537 char=r +pos=538 char=m +pos=539 char=. +pos=540 char=D +pos=541 char=e +pos=542 char=l +pos=543 char=a +pos=544 char=y +pos=545 char=( +pos=546 char=1 +pos=547 char=0 +pos=548 char=0 +pos=549 char=0 +pos=550 char=0 +pos=551 char=) +pos=552 char=; +pos=553 char=* +pos=554 char=) +pos=556 char= +pos=557 char= +pos=558 char= +pos=559 char= +pos=560 char= +pos=561 char= +pos=562 char= +pos=563 char= +pos=564 char=E +pos=565 char=N +pos=566 char=D +pos=567 char=; +pos=569 char= +pos=570 char= +pos=571 char= +pos=572 char= +pos=573 char= +pos=574 char=E +pos=575 char=N +pos=576 char=D +pos=577 char=; +pos=579 char= +pos=580 char= +pos=581 char= +pos=582 char=E +pos=583 char=N +pos=584 char=D +pos=586 char= +pos=587 char=E +pos=588 char=N +pos=589 char=D +pos=590 char= +pos=591 char=i +pos=592 char=s +pos=593 char=p +pos=594 char=t +pos=595 char=e +pos=596 char=s +pos=597 char=t +pos=598 char=. +pos=599 char= diff --git a/src/test/confidence/isptest/isptest.mod b/src/test/confidence/isptest/isptest.mod new file mode 100644 index 00000000..cc6313e3 --- /dev/null +++ b/src/test/confidence/isptest/isptest.mod @@ -0,0 +1,27 @@ +MODULE isptest; + +IMPORT Files, Texts, Out, Platform; + +CONST path="isptest.mod"; + +VAR + T: Texts.Text; + R: Texts.Reader; + ch: CHAR; + i, j, k : LONGINT; +BEGIN + NEW(T); + IF Files.Old(path) # NIL THEN + Texts.Open(T, path); + Texts.OpenReader(R, T, 0); Texts.Read(R, ch); + WHILE ~R.eot DO + Texts.Read(R, ch); + i := Texts.Pos(R); + Out.String("pos="); Out.Int(i,0); Out.String(" char="); Out.Char(ch); Out.Ln; + IF i = 21906 THEN + Out.String("21906"); Out.Ln; + (*Platform.Delay(10000);*) + END; + END; + END +END isptest. \ No newline at end of file diff --git a/src/test/confidence/isptest/test.sh b/src/test/confidence/isptest/test.sh new file mode 100644 index 00000000..49e2dfdd --- /dev/null +++ b/src/test/confidence/isptest/test.sh @@ -0,0 +1,13 @@ +#!/bin/sh +. ../testenv.sh +$OBECOMP isptest.mod -m -O2 +./isptest >result-O2 +$OBECOMP isptest.mod -m -OC +./isptest >result-OC +echo --- Testing with Oberon 2 variable model --- >result +cat result-O2 >>result +echo "" >>result +echo "" >>result +echo --- Testing with Component Pascal variable model --- >>result +cat result-OC >>result +. ../testresult.sh diff --git a/src/tools/make/oberon.mk b/src/tools/make/oberon.mk index c0073202..ffdbded1 100644 --- a/src/tools/make/oberon.mk +++ b/src/tools/make/oberon.mk @@ -382,12 +382,12 @@ RUNTEST = COMPILER=$(COMPILER) OBECOMP="$(OBECOMP) -O$(MODEL)" FLAVOUR=$(FLAVOUR confidence: @printf "\n\n--- Confidence tests ---\n\n" cd src/test/confidence/hello; $(RUNTEST) + cd src/test/confidence/isptest; $(RUNTEST) cd src/test/confidence/out; $(RUNTEST) cd src/test/confidence/math; $(RUNTEST) cd src/test/confidence/intsyntax; $(RUNTEST) cd src/test/confidence/language; $(RUNTEST) cd src/test/confidence/texts; $(RUNTEST) - cd src/test/confidence/math; $(RUNTEST) cd src/test/confidence/library; $(RUNTEST) cd src/test/confidence/lola; $(RUNTEST) cd src/test/confidence/arrayassignment; $(RUNTEST) From c3515d8e4b116436cb4e29a4c467cd412f7c0760 Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 20 Oct 2016 19:48:23 +0100 Subject: [PATCH 293/580] Use Unix line endings for isptest.mod. --- src/test/confidence/isptest/expected | 2128 +++++++++++++------------- 1 file changed, 1064 insertions(+), 1064 deletions(-) diff --git a/src/test/confidence/isptest/expected b/src/test/confidence/isptest/expected index ef0f3a55..4ce25153 100644 --- a/src/test/confidence/isptest/expected +++ b/src/test/confidence/isptest/expected @@ -13,564 +13,564 @@ pos=12 char=e pos=13 char=s pos=14 char=t pos=15 char=; +pos=16 char= pos=17 char= -pos=19 char= -pos=20 char=I -pos=21 char=M -pos=22 char=P -pos=23 char=O -pos=24 char=R -pos=25 char=T -pos=26 char= -pos=27 char=F -pos=28 char=i -pos=29 char=l -pos=30 char=e -pos=31 char=s -pos=32 char=, -pos=33 char= -pos=34 char=T -pos=35 char=e -pos=36 char=x -pos=37 char=t -pos=38 char=s -pos=39 char=, -pos=40 char= -pos=41 char=O -pos=42 char=u -pos=43 char=t -pos=44 char=, -pos=45 char= -pos=46 char=P -pos=47 char=l -pos=48 char=a -pos=49 char=t -pos=50 char=f -pos=51 char=o -pos=52 char=r -pos=53 char=m -pos=54 char=; -pos=56 char= -pos=58 char= -pos=59 char=C -pos=60 char=O -pos=61 char=N -pos=62 char=S -pos=63 char=T -pos=64 char= -pos=65 char=p -pos=66 char=a -pos=67 char=t -pos=68 char=h -pos=69 char== -pos=70 char=" -pos=71 char=i +pos=18 char=I +pos=19 char=M +pos=20 char=P +pos=21 char=O +pos=22 char=R +pos=23 char=T +pos=24 char= +pos=25 char=F +pos=26 char=i +pos=27 char=l +pos=28 char=e +pos=29 char=s +pos=30 char=, +pos=31 char= +pos=32 char=T +pos=33 char=e +pos=34 char=x +pos=35 char=t +pos=36 char=s +pos=37 char=, +pos=38 char= +pos=39 char=O +pos=40 char=u +pos=41 char=t +pos=42 char=, +pos=43 char= +pos=44 char=P +pos=45 char=l +pos=46 char=a +pos=47 char=t +pos=48 char=f +pos=49 char=o +pos=50 char=r +pos=51 char=m +pos=52 char=; +pos=53 char= +pos=54 char= +pos=55 char=C +pos=56 char=O +pos=57 char=N +pos=58 char=S +pos=59 char=T +pos=60 char= +pos=61 char=p +pos=62 char=a +pos=63 char=t +pos=64 char=h +pos=65 char== +pos=66 char=" +pos=67 char=i +pos=68 char=s +pos=69 char=p +pos=70 char=t +pos=71 char=e pos=72 char=s -pos=73 char=p -pos=74 char=t -pos=75 char=e -pos=76 char=s -pos=77 char=t -pos=78 char=. -pos=79 char=m -pos=80 char=o -pos=81 char=d -pos=82 char=" -pos=83 char=; +pos=73 char=t +pos=74 char=. +pos=75 char=m +pos=76 char=o +pos=77 char=d +pos=78 char=" +pos=79 char=; +pos=80 char= +pos=81 char= +pos=82 char=V +pos=83 char=A +pos=84 char=R pos=85 char= -pos=87 char= -pos=88 char=V -pos=89 char=A -pos=90 char=R -pos=92 char= -pos=93 char= -pos=94 char= -pos=95 char=T -pos=96 char=: -pos=97 char= -pos=98 char=T -pos=99 char=e -pos=100 char=x -pos=101 char=t -pos=102 char=s -pos=103 char=. -pos=104 char=T -pos=105 char=e -pos=106 char=x -pos=107 char=t -pos=108 char=; -pos=110 char= -pos=111 char= -pos=112 char= -pos=113 char=R -pos=114 char=: -pos=115 char= -pos=116 char=T -pos=117 char=e -pos=118 char=x -pos=119 char=t -pos=120 char=s -pos=121 char=. -pos=122 char=R -pos=123 char=e -pos=124 char=a -pos=125 char=d -pos=126 char=e -pos=127 char=r -pos=128 char=; -pos=130 char= -pos=131 char= -pos=132 char= -pos=133 char=c -pos=134 char=h -pos=135 char=: -pos=136 char= -pos=137 char=C -pos=138 char=H -pos=139 char=A -pos=140 char=R -pos=141 char=; -pos=143 char= -pos=144 char= +pos=86 char= +pos=87 char= +pos=88 char=T +pos=89 char=: +pos=90 char= +pos=91 char=T +pos=92 char=e +pos=93 char=x +pos=94 char=t +pos=95 char=s +pos=96 char=. +pos=97 char=T +pos=98 char=e +pos=99 char=x +pos=100 char=t +pos=101 char=; +pos=102 char= +pos=103 char= +pos=104 char= +pos=105 char=R +pos=106 char=: +pos=107 char= +pos=108 char=T +pos=109 char=e +pos=110 char=x +pos=111 char=t +pos=112 char=s +pos=113 char=. +pos=114 char=R +pos=115 char=e +pos=116 char=a +pos=117 char=d +pos=118 char=e +pos=119 char=r +pos=120 char=; +pos=121 char= +pos=122 char= +pos=123 char= +pos=124 char=c +pos=125 char=h +pos=126 char=: +pos=127 char= +pos=128 char=C +pos=129 char=H +pos=130 char=A +pos=131 char=R +pos=132 char=; +pos=133 char= +pos=134 char= +pos=135 char= +pos=136 char=i +pos=137 char=, +pos=138 char= +pos=139 char=j +pos=140 char=, +pos=141 char= +pos=142 char=k +pos=143 char= +pos=144 char=: pos=145 char= -pos=146 char=i -pos=147 char=, -pos=148 char= -pos=149 char=j -pos=150 char=, -pos=151 char= -pos=152 char=k -pos=153 char= -pos=154 char=: -pos=155 char= -pos=156 char=L -pos=157 char=O -pos=158 char=N -pos=159 char=G -pos=160 char=I -pos=161 char=N -pos=162 char=T -pos=163 char=; -pos=165 char= -pos=166 char=B -pos=167 char=E -pos=168 char=G -pos=169 char=I -pos=170 char=N -pos=172 char= -pos=173 char= -pos=174 char= -pos=175 char=N -pos=176 char=E -pos=177 char=W -pos=178 char=( -pos=179 char=T -pos=180 char=) -pos=181 char=; -pos=183 char= -pos=184 char= -pos=185 char= -pos=186 char=I -pos=187 char=F -pos=188 char= -pos=189 char=F -pos=190 char=i -pos=191 char=l -pos=192 char=e -pos=193 char=s -pos=194 char=. -pos=195 char=O -pos=196 char=l -pos=197 char=d -pos=198 char=( -pos=199 char=p -pos=200 char=a -pos=201 char=t -pos=202 char=h -pos=203 char=) +pos=146 char=L +pos=147 char=O +pos=148 char=N +pos=149 char=G +pos=150 char=I +pos=151 char=N +pos=152 char=T +pos=153 char=; +pos=154 char= +pos=155 char=B +pos=156 char=E +pos=157 char=G +pos=158 char=I +pos=159 char=N +pos=160 char= +pos=161 char= +pos=162 char= +pos=163 char=N +pos=164 char=E +pos=165 char=W +pos=166 char=( +pos=167 char=T +pos=168 char=) +pos=169 char=; +pos=170 char= +pos=171 char= +pos=172 char= +pos=173 char=I +pos=174 char=F +pos=175 char= +pos=176 char=F +pos=177 char=i +pos=178 char=l +pos=179 char=e +pos=180 char=s +pos=181 char=. +pos=182 char=O +pos=183 char=l +pos=184 char=d +pos=185 char=( +pos=186 char=p +pos=187 char=a +pos=188 char=t +pos=189 char=h +pos=190 char=) +pos=191 char= +pos=192 char=# +pos=193 char= +pos=194 char=N +pos=195 char=I +pos=196 char=L +pos=197 char= +pos=198 char=T +pos=199 char=H +pos=200 char=E +pos=201 char=N +pos=202 char= +pos=203 char= pos=204 char= -pos=205 char=# +pos=205 char= pos=206 char= -pos=207 char=N -pos=208 char=I -pos=209 char=L -pos=210 char= -pos=211 char=T -pos=212 char=H -pos=213 char=E -pos=214 char=N -pos=216 char= -pos=217 char= -pos=218 char= -pos=219 char= +pos=207 char=T +pos=208 char=e +pos=209 char=x +pos=210 char=t +pos=211 char=s +pos=212 char=. +pos=213 char=O +pos=214 char=p +pos=215 char=e +pos=216 char=n +pos=217 char=( +pos=218 char=T +pos=219 char=, pos=220 char= -pos=221 char=T -pos=222 char=e -pos=223 char=x -pos=224 char=t -pos=225 char=s -pos=226 char=. -pos=227 char=O -pos=228 char=p -pos=229 char=e -pos=230 char=n -pos=231 char=( +pos=221 char=p +pos=222 char=a +pos=223 char=t +pos=224 char=h +pos=225 char=) +pos=226 char=; +pos=227 char= +pos=228 char= +pos=229 char= +pos=230 char= +pos=231 char= pos=232 char=T -pos=233 char=, -pos=234 char= -pos=235 char=p -pos=236 char=a -pos=237 char=t -pos=238 char=h -pos=239 char=) -pos=240 char=; -pos=242 char= -pos=243 char= -pos=244 char= -pos=245 char= -pos=246 char= -pos=247 char=T -pos=248 char=e -pos=249 char=x -pos=250 char=t -pos=251 char=s -pos=252 char=. -pos=253 char=O -pos=254 char=p -pos=255 char=e -pos=256 char=n -pos=257 char=R -pos=258 char=e -pos=259 char=a -pos=260 char=d -pos=261 char=e -pos=262 char=r -pos=263 char=( -pos=264 char=R -pos=265 char=, -pos=266 char= -pos=267 char=T -pos=268 char=, -pos=269 char= -pos=270 char=0 -pos=271 char=) -pos=272 char=; -pos=273 char= -pos=274 char=T -pos=275 char=e -pos=276 char=x -pos=277 char=t -pos=278 char=s -pos=279 char=. -pos=280 char=R -pos=281 char=e -pos=282 char=a -pos=283 char=d -pos=284 char=( -pos=285 char=R -pos=286 char=, +pos=233 char=e +pos=234 char=x +pos=235 char=t +pos=236 char=s +pos=237 char=. +pos=238 char=O +pos=239 char=p +pos=240 char=e +pos=241 char=n +pos=242 char=R +pos=243 char=e +pos=244 char=a +pos=245 char=d +pos=246 char=e +pos=247 char=r +pos=248 char=( +pos=249 char=R +pos=250 char=, +pos=251 char= +pos=252 char=T +pos=253 char=, +pos=254 char= +pos=255 char=0 +pos=256 char=) +pos=257 char=; +pos=258 char= +pos=259 char=T +pos=260 char=e +pos=261 char=x +pos=262 char=t +pos=263 char=s +pos=264 char=. +pos=265 char=R +pos=266 char=e +pos=267 char=a +pos=268 char=d +pos=269 char=( +pos=270 char=R +pos=271 char=, +pos=272 char= +pos=273 char=c +pos=274 char=h +pos=275 char=) +pos=276 char=; +pos=277 char= +pos=278 char= +pos=279 char= +pos=280 char= +pos=281 char= +pos=282 char=W +pos=283 char=H +pos=284 char=I +pos=285 char=L +pos=286 char=E pos=287 char= -pos=288 char=c -pos=289 char=h -pos=290 char=) -pos=291 char=; -pos=293 char= +pos=288 char=~ +pos=289 char=R +pos=290 char=. +pos=291 char=e +pos=292 char=o +pos=293 char=t pos=294 char= -pos=295 char= -pos=296 char= -pos=297 char= -pos=298 char=W -pos=299 char=H -pos=300 char=I -pos=301 char=L -pos=302 char=E +pos=295 char=D +pos=296 char=O +pos=297 char= +pos=298 char= +pos=299 char= +pos=300 char= +pos=301 char= +pos=302 char= pos=303 char= -pos=304 char=~ -pos=305 char=R -pos=306 char=. -pos=307 char=e -pos=308 char=o -pos=309 char=t -pos=310 char= -pos=311 char=D -pos=312 char=O -pos=314 char= -pos=315 char= -pos=316 char= -pos=317 char= +pos=304 char= +pos=305 char=T +pos=306 char=e +pos=307 char=x +pos=308 char=t +pos=309 char=s +pos=310 char=. +pos=311 char=R +pos=312 char=e +pos=313 char=a +pos=314 char=d +pos=315 char=( +pos=316 char=R +pos=317 char=, pos=318 char= -pos=319 char= -pos=320 char= -pos=321 char= -pos=322 char=T -pos=323 char=e -pos=324 char=x -pos=325 char=t -pos=326 char=s -pos=327 char=. -pos=328 char=R -pos=329 char=e -pos=330 char=a -pos=331 char=d -pos=332 char=( -pos=333 char=R -pos=334 char=, +pos=319 char=c +pos=320 char=h +pos=321 char=) +pos=322 char=; +pos=323 char= +pos=324 char= +pos=325 char= +pos=326 char= +pos=327 char= +pos=328 char= +pos=329 char= +pos=330 char= +pos=331 char=i +pos=332 char= +pos=333 char=: +pos=334 char== pos=335 char= -pos=336 char=c -pos=337 char=h -pos=338 char=) -pos=339 char=; -pos=341 char= -pos=342 char= -pos=343 char= -pos=344 char= -pos=345 char= -pos=346 char= -pos=347 char= -pos=348 char= -pos=349 char=i +pos=336 char=T +pos=337 char=e +pos=338 char=x +pos=339 char=t +pos=340 char=s +pos=341 char=. +pos=342 char=P +pos=343 char=o +pos=344 char=s +pos=345 char=( +pos=346 char=R +pos=347 char=) +pos=348 char=; +pos=349 char= pos=350 char= -pos=351 char=: -pos=352 char== +pos=351 char= +pos=352 char= pos=353 char= -pos=354 char=T -pos=355 char=e -pos=356 char=x -pos=357 char=t -pos=358 char=s -pos=359 char=. -pos=360 char=P -pos=361 char=o -pos=362 char=s -pos=363 char=( -pos=364 char=R -pos=365 char=) -pos=366 char=; -pos=368 char= -pos=369 char= -pos=370 char= -pos=371 char= -pos=372 char= -pos=373 char= -pos=374 char= -pos=375 char= -pos=376 char=O -pos=377 char=u -pos=378 char=t -pos=379 char=. -pos=380 char=S -pos=381 char=t -pos=382 char=r -pos=383 char=i -pos=384 char=n -pos=385 char=g -pos=386 char=( -pos=387 char=" -pos=388 char=p -pos=389 char=o -pos=390 char=s -pos=391 char== -pos=392 char=" -pos=393 char=) -pos=394 char=; -pos=395 char= -pos=396 char=O -pos=397 char=u -pos=398 char=t -pos=399 char=. -pos=400 char=I -pos=401 char=n -pos=402 char=t -pos=403 char=( -pos=404 char=i -pos=405 char=, -pos=406 char=0 -pos=407 char=) -pos=408 char=; -pos=409 char= -pos=410 char=O -pos=411 char=u -pos=412 char=t -pos=413 char=. -pos=414 char=S +pos=354 char= +pos=355 char= +pos=356 char= +pos=357 char=O +pos=358 char=u +pos=359 char=t +pos=360 char=. +pos=361 char=S +pos=362 char=t +pos=363 char=r +pos=364 char=i +pos=365 char=n +pos=366 char=g +pos=367 char=( +pos=368 char=" +pos=369 char=p +pos=370 char=o +pos=371 char=s +pos=372 char== +pos=373 char=" +pos=374 char=) +pos=375 char=; +pos=376 char= +pos=377 char=O +pos=378 char=u +pos=379 char=t +pos=380 char=. +pos=381 char=I +pos=382 char=n +pos=383 char=t +pos=384 char=( +pos=385 char=i +pos=386 char=, +pos=387 char=0 +pos=388 char=) +pos=389 char=; +pos=390 char= +pos=391 char=O +pos=392 char=u +pos=393 char=t +pos=394 char=. +pos=395 char=S +pos=396 char=t +pos=397 char=r +pos=398 char=i +pos=399 char=n +pos=400 char=g +pos=401 char=( +pos=402 char=" +pos=403 char= +pos=404 char=c +pos=405 char=h +pos=406 char=a +pos=407 char=r +pos=408 char== +pos=409 char=" +pos=410 char=) +pos=411 char=; +pos=412 char= +pos=413 char=O +pos=414 char=u pos=415 char=t -pos=416 char=r -pos=417 char=i -pos=418 char=n -pos=419 char=g -pos=420 char=( -pos=421 char=" -pos=422 char= -pos=423 char=c -pos=424 char=h -pos=425 char=a -pos=426 char=r -pos=427 char== -pos=428 char=" -pos=429 char=) -pos=430 char=; -pos=431 char= -pos=432 char=O -pos=433 char=u -pos=434 char=t -pos=435 char=. -pos=436 char=C -pos=437 char=h -pos=438 char=a -pos=439 char=r -pos=440 char=( -pos=441 char=c -pos=442 char=h -pos=443 char=) -pos=444 char=; -pos=445 char= -pos=446 char=O -pos=447 char=u -pos=448 char=t -pos=449 char=. -pos=450 char=L -pos=451 char=n -pos=452 char=; -pos=454 char= -pos=455 char= -pos=456 char= -pos=457 char= -pos=458 char= -pos=459 char= +pos=416 char=. +pos=417 char=C +pos=418 char=h +pos=419 char=a +pos=420 char=r +pos=421 char=( +pos=422 char=c +pos=423 char=h +pos=424 char=) +pos=425 char=; +pos=426 char= +pos=427 char=O +pos=428 char=u +pos=429 char=t +pos=430 char=. +pos=431 char=L +pos=432 char=n +pos=433 char=; +pos=434 char= +pos=435 char= +pos=436 char= +pos=437 char= +pos=438 char= +pos=439 char= +pos=440 char= +pos=441 char= +pos=442 char=I +pos=443 char=F +pos=444 char= +pos=445 char=i +pos=446 char= +pos=447 char== +pos=448 char= +pos=449 char=2 +pos=450 char=1 +pos=451 char=9 +pos=452 char=0 +pos=453 char=6 +pos=454 char= +pos=455 char=T +pos=456 char=H +pos=457 char=E +pos=458 char=N +pos=459 char= pos=460 char= pos=461 char= -pos=462 char=I -pos=463 char=F +pos=462 char= +pos=463 char= pos=464 char= -pos=465 char=i +pos=465 char= pos=466 char= -pos=467 char== +pos=467 char= pos=468 char= -pos=469 char=2 -pos=470 char=1 -pos=471 char=9 -pos=472 char=0 -pos=473 char=6 -pos=474 char= -pos=475 char=T -pos=476 char=H -pos=477 char=E -pos=478 char=N -pos=480 char= -pos=481 char= -pos=482 char= -pos=483 char= -pos=484 char= -pos=485 char= -pos=486 char= -pos=487 char= -pos=488 char= +pos=469 char=O +pos=470 char=u +pos=471 char=t +pos=472 char=. +pos=473 char=S +pos=474 char=t +pos=475 char=r +pos=476 char=i +pos=477 char=n +pos=478 char=g +pos=479 char=( +pos=480 char=" +pos=481 char=2 +pos=482 char=1 +pos=483 char=9 +pos=484 char=0 +pos=485 char=6 +pos=486 char=" +pos=487 char=) +pos=488 char=; pos=489 char= pos=490 char=O pos=491 char=u pos=492 char=t pos=493 char=. -pos=494 char=S -pos=495 char=t -pos=496 char=r -pos=497 char=i -pos=498 char=n -pos=499 char=g -pos=500 char=( -pos=501 char=" -pos=502 char=2 -pos=503 char=1 -pos=504 char=9 -pos=505 char=0 -pos=506 char=6 -pos=507 char=" -pos=508 char=) -pos=509 char=; -pos=510 char= -pos=511 char=O -pos=512 char=u -pos=513 char=t -pos=514 char=. -pos=515 char=L -pos=516 char=n -pos=517 char=; -pos=519 char= -pos=520 char= -pos=521 char= -pos=522 char= -pos=523 char= -pos=524 char= -pos=525 char= -pos=526 char= -pos=527 char= -pos=528 char= -pos=529 char=( -pos=530 char=* -pos=531 char=P -pos=532 char=l -pos=533 char=a -pos=534 char=t -pos=535 char=f -pos=536 char=o -pos=537 char=r -pos=538 char=m -pos=539 char=. -pos=540 char=D -pos=541 char=e -pos=542 char=l -pos=543 char=a -pos=544 char=y -pos=545 char=( -pos=546 char=1 -pos=547 char=0 -pos=548 char=0 -pos=549 char=0 -pos=550 char=0 -pos=551 char=) -pos=552 char=; -pos=553 char=* -pos=554 char=) -pos=556 char= -pos=557 char= -pos=558 char= -pos=559 char= -pos=560 char= -pos=561 char= -pos=562 char= -pos=563 char= -pos=564 char=E -pos=565 char=N -pos=566 char=D -pos=567 char=; -pos=569 char= -pos=570 char= -pos=571 char= -pos=572 char= -pos=573 char= -pos=574 char=E -pos=575 char=N -pos=576 char=D -pos=577 char=; -pos=579 char= -pos=580 char= -pos=581 char= -pos=582 char=E -pos=583 char=N -pos=584 char=D -pos=586 char= -pos=587 char=E -pos=588 char=N -pos=589 char=D -pos=590 char= -pos=591 char=i -pos=592 char=s -pos=593 char=p -pos=594 char=t -pos=595 char=e -pos=596 char=s -pos=597 char=t -pos=598 char=. -pos=599 char= +pos=494 char=L +pos=495 char=n +pos=496 char=; +pos=497 char= +pos=498 char= +pos=499 char= +pos=500 char= +pos=501 char= +pos=502 char= +pos=503 char= +pos=504 char= +pos=505 char= +pos=506 char= +pos=507 char=( +pos=508 char=* +pos=509 char=P +pos=510 char=l +pos=511 char=a +pos=512 char=t +pos=513 char=f +pos=514 char=o +pos=515 char=r +pos=516 char=m +pos=517 char=. +pos=518 char=D +pos=519 char=e +pos=520 char=l +pos=521 char=a +pos=522 char=y +pos=523 char=( +pos=524 char=1 +pos=525 char=0 +pos=526 char=0 +pos=527 char=0 +pos=528 char=0 +pos=529 char=) +pos=530 char=; +pos=531 char=* +pos=532 char=) +pos=533 char= +pos=534 char= +pos=535 char= +pos=536 char= +pos=537 char= +pos=538 char= +pos=539 char= +pos=540 char= +pos=541 char=E +pos=542 char=N +pos=543 char=D +pos=544 char=; +pos=545 char= +pos=546 char= +pos=547 char= +pos=548 char= +pos=549 char= +pos=550 char=E +pos=551 char=N +pos=552 char=D +pos=553 char=; +pos=554 char= +pos=555 char= +pos=556 char= +pos=557 char=E +pos=558 char=N +pos=559 char=D +pos=560 char= +pos=561 char=E +pos=562 char=N +pos=563 char=D +pos=564 char= +pos=565 char=i +pos=566 char=s +pos=567 char=p +pos=568 char=t +pos=569 char=e +pos=570 char=s +pos=571 char=t +pos=572 char=. +pos=573 char= --- Testing with Component Pascal variable model --- @@ -588,561 +588,561 @@ pos=12 char=e pos=13 char=s pos=14 char=t pos=15 char=; +pos=16 char= pos=17 char= -pos=19 char= -pos=20 char=I -pos=21 char=M -pos=22 char=P -pos=23 char=O -pos=24 char=R -pos=25 char=T -pos=26 char= -pos=27 char=F -pos=28 char=i -pos=29 char=l -pos=30 char=e -pos=31 char=s -pos=32 char=, -pos=33 char= -pos=34 char=T -pos=35 char=e -pos=36 char=x -pos=37 char=t -pos=38 char=s -pos=39 char=, -pos=40 char= -pos=41 char=O -pos=42 char=u -pos=43 char=t -pos=44 char=, -pos=45 char= -pos=46 char=P -pos=47 char=l -pos=48 char=a -pos=49 char=t -pos=50 char=f -pos=51 char=o -pos=52 char=r -pos=53 char=m -pos=54 char=; -pos=56 char= -pos=58 char= -pos=59 char=C -pos=60 char=O -pos=61 char=N -pos=62 char=S -pos=63 char=T -pos=64 char= -pos=65 char=p -pos=66 char=a -pos=67 char=t -pos=68 char=h -pos=69 char== -pos=70 char=" -pos=71 char=i +pos=18 char=I +pos=19 char=M +pos=20 char=P +pos=21 char=O +pos=22 char=R +pos=23 char=T +pos=24 char= +pos=25 char=F +pos=26 char=i +pos=27 char=l +pos=28 char=e +pos=29 char=s +pos=30 char=, +pos=31 char= +pos=32 char=T +pos=33 char=e +pos=34 char=x +pos=35 char=t +pos=36 char=s +pos=37 char=, +pos=38 char= +pos=39 char=O +pos=40 char=u +pos=41 char=t +pos=42 char=, +pos=43 char= +pos=44 char=P +pos=45 char=l +pos=46 char=a +pos=47 char=t +pos=48 char=f +pos=49 char=o +pos=50 char=r +pos=51 char=m +pos=52 char=; +pos=53 char= +pos=54 char= +pos=55 char=C +pos=56 char=O +pos=57 char=N +pos=58 char=S +pos=59 char=T +pos=60 char= +pos=61 char=p +pos=62 char=a +pos=63 char=t +pos=64 char=h +pos=65 char== +pos=66 char=" +pos=67 char=i +pos=68 char=s +pos=69 char=p +pos=70 char=t +pos=71 char=e pos=72 char=s -pos=73 char=p -pos=74 char=t -pos=75 char=e -pos=76 char=s -pos=77 char=t -pos=78 char=. -pos=79 char=m -pos=80 char=o -pos=81 char=d -pos=82 char=" -pos=83 char=; +pos=73 char=t +pos=74 char=. +pos=75 char=m +pos=76 char=o +pos=77 char=d +pos=78 char=" +pos=79 char=; +pos=80 char= +pos=81 char= +pos=82 char=V +pos=83 char=A +pos=84 char=R pos=85 char= -pos=87 char= -pos=88 char=V -pos=89 char=A -pos=90 char=R -pos=92 char= -pos=93 char= -pos=94 char= -pos=95 char=T -pos=96 char=: -pos=97 char= -pos=98 char=T -pos=99 char=e -pos=100 char=x -pos=101 char=t -pos=102 char=s -pos=103 char=. -pos=104 char=T -pos=105 char=e -pos=106 char=x -pos=107 char=t -pos=108 char=; -pos=110 char= -pos=111 char= -pos=112 char= -pos=113 char=R -pos=114 char=: -pos=115 char= -pos=116 char=T -pos=117 char=e -pos=118 char=x -pos=119 char=t -pos=120 char=s -pos=121 char=. -pos=122 char=R -pos=123 char=e -pos=124 char=a -pos=125 char=d -pos=126 char=e -pos=127 char=r -pos=128 char=; -pos=130 char= -pos=131 char= -pos=132 char= -pos=133 char=c -pos=134 char=h -pos=135 char=: -pos=136 char= -pos=137 char=C -pos=138 char=H -pos=139 char=A -pos=140 char=R -pos=141 char=; -pos=143 char= -pos=144 char= +pos=86 char= +pos=87 char= +pos=88 char=T +pos=89 char=: +pos=90 char= +pos=91 char=T +pos=92 char=e +pos=93 char=x +pos=94 char=t +pos=95 char=s +pos=96 char=. +pos=97 char=T +pos=98 char=e +pos=99 char=x +pos=100 char=t +pos=101 char=; +pos=102 char= +pos=103 char= +pos=104 char= +pos=105 char=R +pos=106 char=: +pos=107 char= +pos=108 char=T +pos=109 char=e +pos=110 char=x +pos=111 char=t +pos=112 char=s +pos=113 char=. +pos=114 char=R +pos=115 char=e +pos=116 char=a +pos=117 char=d +pos=118 char=e +pos=119 char=r +pos=120 char=; +pos=121 char= +pos=122 char= +pos=123 char= +pos=124 char=c +pos=125 char=h +pos=126 char=: +pos=127 char= +pos=128 char=C +pos=129 char=H +pos=130 char=A +pos=131 char=R +pos=132 char=; +pos=133 char= +pos=134 char= +pos=135 char= +pos=136 char=i +pos=137 char=, +pos=138 char= +pos=139 char=j +pos=140 char=, +pos=141 char= +pos=142 char=k +pos=143 char= +pos=144 char=: pos=145 char= -pos=146 char=i -pos=147 char=, -pos=148 char= -pos=149 char=j -pos=150 char=, -pos=151 char= -pos=152 char=k -pos=153 char= -pos=154 char=: -pos=155 char= -pos=156 char=L -pos=157 char=O -pos=158 char=N -pos=159 char=G -pos=160 char=I -pos=161 char=N -pos=162 char=T -pos=163 char=; -pos=165 char= -pos=166 char=B -pos=167 char=E -pos=168 char=G -pos=169 char=I -pos=170 char=N -pos=172 char= -pos=173 char= -pos=174 char= -pos=175 char=N -pos=176 char=E -pos=177 char=W -pos=178 char=( -pos=179 char=T -pos=180 char=) -pos=181 char=; -pos=183 char= -pos=184 char= -pos=185 char= -pos=186 char=I -pos=187 char=F -pos=188 char= -pos=189 char=F -pos=190 char=i -pos=191 char=l -pos=192 char=e -pos=193 char=s -pos=194 char=. -pos=195 char=O -pos=196 char=l -pos=197 char=d -pos=198 char=( -pos=199 char=p -pos=200 char=a -pos=201 char=t -pos=202 char=h -pos=203 char=) +pos=146 char=L +pos=147 char=O +pos=148 char=N +pos=149 char=G +pos=150 char=I +pos=151 char=N +pos=152 char=T +pos=153 char=; +pos=154 char= +pos=155 char=B +pos=156 char=E +pos=157 char=G +pos=158 char=I +pos=159 char=N +pos=160 char= +pos=161 char= +pos=162 char= +pos=163 char=N +pos=164 char=E +pos=165 char=W +pos=166 char=( +pos=167 char=T +pos=168 char=) +pos=169 char=; +pos=170 char= +pos=171 char= +pos=172 char= +pos=173 char=I +pos=174 char=F +pos=175 char= +pos=176 char=F +pos=177 char=i +pos=178 char=l +pos=179 char=e +pos=180 char=s +pos=181 char=. +pos=182 char=O +pos=183 char=l +pos=184 char=d +pos=185 char=( +pos=186 char=p +pos=187 char=a +pos=188 char=t +pos=189 char=h +pos=190 char=) +pos=191 char= +pos=192 char=# +pos=193 char= +pos=194 char=N +pos=195 char=I +pos=196 char=L +pos=197 char= +pos=198 char=T +pos=199 char=H +pos=200 char=E +pos=201 char=N +pos=202 char= +pos=203 char= pos=204 char= -pos=205 char=# +pos=205 char= pos=206 char= -pos=207 char=N -pos=208 char=I -pos=209 char=L -pos=210 char= -pos=211 char=T -pos=212 char=H -pos=213 char=E -pos=214 char=N -pos=216 char= -pos=217 char= -pos=218 char= -pos=219 char= +pos=207 char=T +pos=208 char=e +pos=209 char=x +pos=210 char=t +pos=211 char=s +pos=212 char=. +pos=213 char=O +pos=214 char=p +pos=215 char=e +pos=216 char=n +pos=217 char=( +pos=218 char=T +pos=219 char=, pos=220 char= -pos=221 char=T -pos=222 char=e -pos=223 char=x -pos=224 char=t -pos=225 char=s -pos=226 char=. -pos=227 char=O -pos=228 char=p -pos=229 char=e -pos=230 char=n -pos=231 char=( +pos=221 char=p +pos=222 char=a +pos=223 char=t +pos=224 char=h +pos=225 char=) +pos=226 char=; +pos=227 char= +pos=228 char= +pos=229 char= +pos=230 char= +pos=231 char= pos=232 char=T -pos=233 char=, -pos=234 char= -pos=235 char=p -pos=236 char=a -pos=237 char=t -pos=238 char=h -pos=239 char=) -pos=240 char=; -pos=242 char= -pos=243 char= -pos=244 char= -pos=245 char= -pos=246 char= -pos=247 char=T -pos=248 char=e -pos=249 char=x -pos=250 char=t -pos=251 char=s -pos=252 char=. -pos=253 char=O -pos=254 char=p -pos=255 char=e -pos=256 char=n -pos=257 char=R -pos=258 char=e -pos=259 char=a -pos=260 char=d -pos=261 char=e -pos=262 char=r -pos=263 char=( -pos=264 char=R -pos=265 char=, -pos=266 char= -pos=267 char=T -pos=268 char=, -pos=269 char= -pos=270 char=0 -pos=271 char=) -pos=272 char=; -pos=273 char= -pos=274 char=T -pos=275 char=e -pos=276 char=x -pos=277 char=t -pos=278 char=s -pos=279 char=. -pos=280 char=R -pos=281 char=e -pos=282 char=a -pos=283 char=d -pos=284 char=( -pos=285 char=R -pos=286 char=, +pos=233 char=e +pos=234 char=x +pos=235 char=t +pos=236 char=s +pos=237 char=. +pos=238 char=O +pos=239 char=p +pos=240 char=e +pos=241 char=n +pos=242 char=R +pos=243 char=e +pos=244 char=a +pos=245 char=d +pos=246 char=e +pos=247 char=r +pos=248 char=( +pos=249 char=R +pos=250 char=, +pos=251 char= +pos=252 char=T +pos=253 char=, +pos=254 char= +pos=255 char=0 +pos=256 char=) +pos=257 char=; +pos=258 char= +pos=259 char=T +pos=260 char=e +pos=261 char=x +pos=262 char=t +pos=263 char=s +pos=264 char=. +pos=265 char=R +pos=266 char=e +pos=267 char=a +pos=268 char=d +pos=269 char=( +pos=270 char=R +pos=271 char=, +pos=272 char= +pos=273 char=c +pos=274 char=h +pos=275 char=) +pos=276 char=; +pos=277 char= +pos=278 char= +pos=279 char= +pos=280 char= +pos=281 char= +pos=282 char=W +pos=283 char=H +pos=284 char=I +pos=285 char=L +pos=286 char=E pos=287 char= -pos=288 char=c -pos=289 char=h -pos=290 char=) -pos=291 char=; -pos=293 char= +pos=288 char=~ +pos=289 char=R +pos=290 char=. +pos=291 char=e +pos=292 char=o +pos=293 char=t pos=294 char= -pos=295 char= -pos=296 char= -pos=297 char= -pos=298 char=W -pos=299 char=H -pos=300 char=I -pos=301 char=L -pos=302 char=E +pos=295 char=D +pos=296 char=O +pos=297 char= +pos=298 char= +pos=299 char= +pos=300 char= +pos=301 char= +pos=302 char= pos=303 char= -pos=304 char=~ -pos=305 char=R -pos=306 char=. -pos=307 char=e -pos=308 char=o -pos=309 char=t -pos=310 char= -pos=311 char=D -pos=312 char=O -pos=314 char= -pos=315 char= -pos=316 char= -pos=317 char= +pos=304 char= +pos=305 char=T +pos=306 char=e +pos=307 char=x +pos=308 char=t +pos=309 char=s +pos=310 char=. +pos=311 char=R +pos=312 char=e +pos=313 char=a +pos=314 char=d +pos=315 char=( +pos=316 char=R +pos=317 char=, pos=318 char= -pos=319 char= -pos=320 char= -pos=321 char= -pos=322 char=T -pos=323 char=e -pos=324 char=x -pos=325 char=t -pos=326 char=s -pos=327 char=. -pos=328 char=R -pos=329 char=e -pos=330 char=a -pos=331 char=d -pos=332 char=( -pos=333 char=R -pos=334 char=, +pos=319 char=c +pos=320 char=h +pos=321 char=) +pos=322 char=; +pos=323 char= +pos=324 char= +pos=325 char= +pos=326 char= +pos=327 char= +pos=328 char= +pos=329 char= +pos=330 char= +pos=331 char=i +pos=332 char= +pos=333 char=: +pos=334 char== pos=335 char= -pos=336 char=c -pos=337 char=h -pos=338 char=) -pos=339 char=; -pos=341 char= -pos=342 char= -pos=343 char= -pos=344 char= -pos=345 char= -pos=346 char= -pos=347 char= -pos=348 char= -pos=349 char=i +pos=336 char=T +pos=337 char=e +pos=338 char=x +pos=339 char=t +pos=340 char=s +pos=341 char=. +pos=342 char=P +pos=343 char=o +pos=344 char=s +pos=345 char=( +pos=346 char=R +pos=347 char=) +pos=348 char=; +pos=349 char= pos=350 char= -pos=351 char=: -pos=352 char== +pos=351 char= +pos=352 char= pos=353 char= -pos=354 char=T -pos=355 char=e -pos=356 char=x -pos=357 char=t -pos=358 char=s -pos=359 char=. -pos=360 char=P -pos=361 char=o -pos=362 char=s -pos=363 char=( -pos=364 char=R -pos=365 char=) -pos=366 char=; -pos=368 char= -pos=369 char= -pos=370 char= -pos=371 char= -pos=372 char= -pos=373 char= -pos=374 char= -pos=375 char= -pos=376 char=O -pos=377 char=u -pos=378 char=t -pos=379 char=. -pos=380 char=S -pos=381 char=t -pos=382 char=r -pos=383 char=i -pos=384 char=n -pos=385 char=g -pos=386 char=( -pos=387 char=" -pos=388 char=p -pos=389 char=o -pos=390 char=s -pos=391 char== -pos=392 char=" -pos=393 char=) -pos=394 char=; -pos=395 char= -pos=396 char=O -pos=397 char=u -pos=398 char=t -pos=399 char=. -pos=400 char=I -pos=401 char=n -pos=402 char=t -pos=403 char=( -pos=404 char=i -pos=405 char=, -pos=406 char=0 -pos=407 char=) -pos=408 char=; -pos=409 char= -pos=410 char=O -pos=411 char=u -pos=412 char=t -pos=413 char=. -pos=414 char=S +pos=354 char= +pos=355 char= +pos=356 char= +pos=357 char=O +pos=358 char=u +pos=359 char=t +pos=360 char=. +pos=361 char=S +pos=362 char=t +pos=363 char=r +pos=364 char=i +pos=365 char=n +pos=366 char=g +pos=367 char=( +pos=368 char=" +pos=369 char=p +pos=370 char=o +pos=371 char=s +pos=372 char== +pos=373 char=" +pos=374 char=) +pos=375 char=; +pos=376 char= +pos=377 char=O +pos=378 char=u +pos=379 char=t +pos=380 char=. +pos=381 char=I +pos=382 char=n +pos=383 char=t +pos=384 char=( +pos=385 char=i +pos=386 char=, +pos=387 char=0 +pos=388 char=) +pos=389 char=; +pos=390 char= +pos=391 char=O +pos=392 char=u +pos=393 char=t +pos=394 char=. +pos=395 char=S +pos=396 char=t +pos=397 char=r +pos=398 char=i +pos=399 char=n +pos=400 char=g +pos=401 char=( +pos=402 char=" +pos=403 char= +pos=404 char=c +pos=405 char=h +pos=406 char=a +pos=407 char=r +pos=408 char== +pos=409 char=" +pos=410 char=) +pos=411 char=; +pos=412 char= +pos=413 char=O +pos=414 char=u pos=415 char=t -pos=416 char=r -pos=417 char=i -pos=418 char=n -pos=419 char=g -pos=420 char=( -pos=421 char=" -pos=422 char= -pos=423 char=c -pos=424 char=h -pos=425 char=a -pos=426 char=r -pos=427 char== -pos=428 char=" -pos=429 char=) -pos=430 char=; -pos=431 char= -pos=432 char=O -pos=433 char=u -pos=434 char=t -pos=435 char=. -pos=436 char=C -pos=437 char=h -pos=438 char=a -pos=439 char=r -pos=440 char=( -pos=441 char=c -pos=442 char=h -pos=443 char=) -pos=444 char=; -pos=445 char= -pos=446 char=O -pos=447 char=u -pos=448 char=t -pos=449 char=. -pos=450 char=L -pos=451 char=n -pos=452 char=; -pos=454 char= -pos=455 char= -pos=456 char= -pos=457 char= -pos=458 char= -pos=459 char= +pos=416 char=. +pos=417 char=C +pos=418 char=h +pos=419 char=a +pos=420 char=r +pos=421 char=( +pos=422 char=c +pos=423 char=h +pos=424 char=) +pos=425 char=; +pos=426 char= +pos=427 char=O +pos=428 char=u +pos=429 char=t +pos=430 char=. +pos=431 char=L +pos=432 char=n +pos=433 char=; +pos=434 char= +pos=435 char= +pos=436 char= +pos=437 char= +pos=438 char= +pos=439 char= +pos=440 char= +pos=441 char= +pos=442 char=I +pos=443 char=F +pos=444 char= +pos=445 char=i +pos=446 char= +pos=447 char== +pos=448 char= +pos=449 char=2 +pos=450 char=1 +pos=451 char=9 +pos=452 char=0 +pos=453 char=6 +pos=454 char= +pos=455 char=T +pos=456 char=H +pos=457 char=E +pos=458 char=N +pos=459 char= pos=460 char= pos=461 char= -pos=462 char=I -pos=463 char=F +pos=462 char= +pos=463 char= pos=464 char= -pos=465 char=i +pos=465 char= pos=466 char= -pos=467 char== +pos=467 char= pos=468 char= -pos=469 char=2 -pos=470 char=1 -pos=471 char=9 -pos=472 char=0 -pos=473 char=6 -pos=474 char= -pos=475 char=T -pos=476 char=H -pos=477 char=E -pos=478 char=N -pos=480 char= -pos=481 char= -pos=482 char= -pos=483 char= -pos=484 char= -pos=485 char= -pos=486 char= -pos=487 char= -pos=488 char= +pos=469 char=O +pos=470 char=u +pos=471 char=t +pos=472 char=. +pos=473 char=S +pos=474 char=t +pos=475 char=r +pos=476 char=i +pos=477 char=n +pos=478 char=g +pos=479 char=( +pos=480 char=" +pos=481 char=2 +pos=482 char=1 +pos=483 char=9 +pos=484 char=0 +pos=485 char=6 +pos=486 char=" +pos=487 char=) +pos=488 char=; pos=489 char= pos=490 char=O pos=491 char=u pos=492 char=t pos=493 char=. -pos=494 char=S -pos=495 char=t -pos=496 char=r -pos=497 char=i -pos=498 char=n -pos=499 char=g -pos=500 char=( -pos=501 char=" -pos=502 char=2 -pos=503 char=1 -pos=504 char=9 -pos=505 char=0 -pos=506 char=6 -pos=507 char=" -pos=508 char=) -pos=509 char=; -pos=510 char= -pos=511 char=O -pos=512 char=u -pos=513 char=t -pos=514 char=. -pos=515 char=L -pos=516 char=n -pos=517 char=; -pos=519 char= -pos=520 char= -pos=521 char= -pos=522 char= -pos=523 char= -pos=524 char= -pos=525 char= -pos=526 char= -pos=527 char= -pos=528 char= -pos=529 char=( -pos=530 char=* -pos=531 char=P -pos=532 char=l -pos=533 char=a -pos=534 char=t -pos=535 char=f -pos=536 char=o -pos=537 char=r -pos=538 char=m -pos=539 char=. -pos=540 char=D -pos=541 char=e -pos=542 char=l -pos=543 char=a -pos=544 char=y -pos=545 char=( -pos=546 char=1 -pos=547 char=0 -pos=548 char=0 -pos=549 char=0 -pos=550 char=0 -pos=551 char=) -pos=552 char=; -pos=553 char=* -pos=554 char=) -pos=556 char= -pos=557 char= -pos=558 char= -pos=559 char= -pos=560 char= -pos=561 char= -pos=562 char= -pos=563 char= -pos=564 char=E -pos=565 char=N -pos=566 char=D -pos=567 char=; -pos=569 char= -pos=570 char= -pos=571 char= -pos=572 char= -pos=573 char= -pos=574 char=E -pos=575 char=N -pos=576 char=D -pos=577 char=; -pos=579 char= -pos=580 char= -pos=581 char= -pos=582 char=E -pos=583 char=N -pos=584 char=D -pos=586 char= -pos=587 char=E -pos=588 char=N -pos=589 char=D -pos=590 char= -pos=591 char=i -pos=592 char=s -pos=593 char=p -pos=594 char=t -pos=595 char=e -pos=596 char=s -pos=597 char=t -pos=598 char=. -pos=599 char= +pos=494 char=L +pos=495 char=n +pos=496 char=; +pos=497 char= +pos=498 char= +pos=499 char= +pos=500 char= +pos=501 char= +pos=502 char= +pos=503 char= +pos=504 char= +pos=505 char= +pos=506 char= +pos=507 char=( +pos=508 char=* +pos=509 char=P +pos=510 char=l +pos=511 char=a +pos=512 char=t +pos=513 char=f +pos=514 char=o +pos=515 char=r +pos=516 char=m +pos=517 char=. +pos=518 char=D +pos=519 char=e +pos=520 char=l +pos=521 char=a +pos=522 char=y +pos=523 char=( +pos=524 char=1 +pos=525 char=0 +pos=526 char=0 +pos=527 char=0 +pos=528 char=0 +pos=529 char=) +pos=530 char=; +pos=531 char=* +pos=532 char=) +pos=533 char= +pos=534 char= +pos=535 char= +pos=536 char= +pos=537 char= +pos=538 char= +pos=539 char= +pos=540 char= +pos=541 char=E +pos=542 char=N +pos=543 char=D +pos=544 char=; +pos=545 char= +pos=546 char= +pos=547 char= +pos=548 char= +pos=549 char= +pos=550 char=E +pos=551 char=N +pos=552 char=D +pos=553 char=; +pos=554 char= +pos=555 char= +pos=556 char= +pos=557 char=E +pos=558 char=N +pos=559 char=D +pos=560 char= +pos=561 char=E +pos=562 char=N +pos=563 char=D +pos=564 char= +pos=565 char=i +pos=566 char=s +pos=567 char=p +pos=568 char=t +pos=569 char=e +pos=570 char=s +pos=571 char=t +pos=572 char=. +pos=573 char= From d906629d2aa635639b8a4d80aab83221dc1412a6 Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 28 Oct 2016 12:21:34 +0100 Subject: [PATCH 294/580] Close old symbol file before reopening it to rewrite it. --- src/compiler/OPM.Mod | 1 + 1 file changed, 1 insertion(+) diff --git a/src/compiler/OPM.Mod b/src/compiler/OPM.Mod index 1ecaa7e0..68215490 100644 --- a/src/compiler/OPM.Mod +++ b/src/compiler/OPM.Mod @@ -614,6 +614,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) END SymRLReal; PROCEDURE CloseOldSym*; + BEGIN Files.Close(Files.Base(oldSF)) END CloseOldSym; PROCEDURE OldSym*(VAR modName: ARRAY OF CHAR; VAR done: BOOLEAN); From cf49ec30b94ac529e923ada9558765dcd391adb9 Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 28 Oct 2016 18:13:42 +0100 Subject: [PATCH 295/580] Restore use of alloca for string value copies. mingw build fixes. Support Linux subsystem for Windows. --- bootstrap/SYSTEM.h | 34 +- bootstrap/unix-44/Compiler.c | 2 +- bootstrap/unix-44/Configuration.c | 4 +- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Files.c | 2 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 2 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 2 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 3 +- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 2 +- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 2 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Out.c | 2 +- bootstrap/unix-44/Out.h | 2 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/VT100.c | 2 +- bootstrap/unix-44/VT100.h | 2 +- bootstrap/unix-44/errors.c | 2 +- bootstrap/unix-44/errors.h | 2 +- bootstrap/unix-44/extTools.c | 2 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-48/Compiler.c | 2 +- bootstrap/unix-48/Configuration.c | 4 +- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Files.c | 2 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 2 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 2 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 3 +- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 2 +- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 2 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Out.c | 2 +- bootstrap/unix-48/Out.h | 2 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/VT100.c | 2 +- bootstrap/unix-48/VT100.h | 2 +- bootstrap/unix-48/errors.c | 2 +- bootstrap/unix-48/errors.h | 2 +- bootstrap/unix-48/extTools.c | 2 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-88/Compiler.c | 2 +- bootstrap/unix-88/Configuration.c | 4 +- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Files.c | 2 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 2 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 2 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 3 +- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 2 +- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 2 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Out.c | 2 +- bootstrap/unix-88/Out.h | 2 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/VT100.c | 2 +- bootstrap/unix-88/VT100.h | 2 +- bootstrap/unix-88/errors.c | 2 +- bootstrap/unix-88/errors.h | 2 +- bootstrap/unix-88/extTools.c | 2 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/windows-48/Compiler.c | 2 +- bootstrap/windows-48/Configuration.c | 4 +- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Files.c | 2 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 2 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 2 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 3 +- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 2 +- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 2 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Out.c | 2 +- bootstrap/windows-48/Out.h | 2 +- bootstrap/windows-48/Platform.c | 30 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/VT100.c | 2 +- bootstrap/windows-48/VT100.h | 2 +- bootstrap/windows-48/errors.c | 2 +- bootstrap/windows-48/errors.h | 2 +- bootstrap/windows-48/extTools.c | 2 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-88/Compiler.c | 2 +- bootstrap/windows-88/Configuration.c | 4 +- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Files.c | 2 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 2 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 2 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 3 +- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 2 +- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 2 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Out.c | 2 +- bootstrap/windows-88/Out.h | 2 +- bootstrap/windows-88/Platform.c | 30 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/VT100.c | 2 +- bootstrap/windows-88/VT100.h | 2 +- bootstrap/windows-88/errors.c | 2 +- bootstrap/windows-88/errors.h | 2 +- bootstrap/windows-88/extTools.c | 2 +- bootstrap/windows-88/extTools.h | 2 +- src/runtime/Platformwindows.Mod | 28 +- src/runtime/SYSTEM.h | 17 +- src/test/confidence/arrayassignment/test.sh | 1 + src/test/confidence/isptest/expected | 564 ++++++++++---------- src/test/confidence/isptest/isptest.mod | 4 +- src/test/confidence/language/test.sh | 1 + src/test/confidence/library/test.sh | 1 + src/test/confidence/math/test.sh | 1 + src/test/confidence/out/test.sh | 3 +- src/test/confidence/signal/test.sh | 1 + src/test/confidence/testenv.sh | 2 +- src/test/confidence/texts/test.sh | 1 + 208 files changed, 575 insertions(+), 544 deletions(-) diff --git a/bootstrap/SYSTEM.h b/bootstrap/SYSTEM.h index 7cba936e..165b5ec8 100644 --- a/bootstrap/SYSTEM.h +++ b/bootstrap/SYSTEM.h @@ -5,31 +5,14 @@ // 64 bit system detection #if (__SIZEOF_POINTER__ == 8) || defined (_LP64) || defined(__LP64__) || defined(_WIN64) - #define __o_64 + #define o__64 #endif -// // Temporary while bootstrapping and clearing up SYSTEM.c. -// -// #ifndef LONGINT -// #if defined (__o_64) -// #define INTEGER int32 -// #define LONGINT int64 -// #define SET uint64 -// #else -// #define INTEGER int16 -// #define LONGINT int32 -// #define SET uint32 -// #endif -// #endif - - - - // Declare memcpy in a way compatible with C compilers intrinsic // built in implementations. -#if defined (__o_64) +#if defined (o__64) #if defined(_WIN64) typedef unsigned long long size_t; #else @@ -43,11 +26,12 @@ #define _SIZE_T_DEFINED_ // For OpenBSD void *memcpy(void *dest, const void *source, size_t size); +void *alloca(size_t size); // Declare fixed size versions of basic intger types -#if defined (__o_64) && !defined(_WIN64) +#if defined (o__64) && !defined(_WIN64) // LP64 typedef long int64; typedef unsigned long uint64; @@ -95,7 +79,7 @@ typedef void* SYSTEM_PTR; // 'address' is a synonym for an int of pointer size -#if defined (__o_64) +#if defined (o__64) #define address int64 #else #define address int32 @@ -171,9 +155,13 @@ static inline int __str_cmp(CHAR *x, CHAR *y){ #define __COPY(s, d, n) {char*_a=(void*)s,*_b=(void*)d; LONGINT _i=0,_t=n-1; \ while(_i<_t&&((_b[_i]=_a[_i])!=0)){_i++;};_b[_i]=0;} -#define __DUP(x, l, t) x=(void*)memcpy((void*)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) #define __DUPARR(v, t) v=(void*)memcpy(v##__copy,v,sizeof(t)) -#define __DEL(x) Platform_OSFree((address)x) + +//#define __DUP(x, l, t) x=(void*)memcpy((void*)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) +//#define __DEL(x) Platform_OSFree((address)x) + +#define __DUP(x, l, t) x=(void*)memcpy(alloca(l*sizeof(t)),x,l*sizeof(t)) +#define __DEL(x) /* SYSTEM ops */ diff --git a/bootstrap/unix-44/Compiler.c b/bootstrap/unix-44/Compiler.c index 965cd082..759e721b 100644 --- a/bootstrap/unix-44/Compiler.c +++ b/bootstrap/unix-44/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index da05f57a..95ddb569 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index 97ccb9b4..f6a548e4 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 698bdfec..e0fc2e86 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index 54424759..8f575f62 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index 20373a54..37062b0b 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index fe843fd2..1a319646 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index c47b83d3..45b91f7f 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index b6fd8dd7..a7b62fe3 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index 42ccafe2..038bd92c 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index 639b8015..22742961 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 5eb839d6..20c369e9 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index c0d35b19..c09a1524 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 9fbbbc49..d0b09b3d 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -774,6 +774,7 @@ void OPM_SymRLReal (LONGREAL *lr) void OPM_CloseOldSym (void) { + Files_Close(Files_Base(&OPM_oldSF, Files_Rider__typ)); } void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done) diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index 39474670..be9e98bd 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index dad7e185..90f35dd5 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index 287514a0..de0e599a 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index e76fa4d6..b3c52f3c 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index 42cecab6..a452da84 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index d9550e62..5b0f725b 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index 9cfc72df..38cd17c7 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index 3b2e9f4d..5b51ba36 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index 626e9505..2fa9186d 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Out.c b/bootstrap/unix-44/Out.c index 66922bc1..67a6c27b 100644 --- a/bootstrap/unix-44/Out.c +++ b/bootstrap/unix-44/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Out.h b/bootstrap/unix-44/Out.h index 0d5df379..fbaed75f 100644 --- a/bootstrap/unix-44/Out.h +++ b/bootstrap/unix-44/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index e79917c0..aa55dd0d 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index 6354f985..18456e59 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 291703b5..87ddfb2a 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index 7e26560f..664fe2ec 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index b6b9725d..5bbe808d 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index 0298718d..24f35c02 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index dd64a7d3..ed55dfca 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index 15b00c61..be04a384 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/VT100.c b/bootstrap/unix-44/VT100.c index 31069c13..c3a9491f 100644 --- a/bootstrap/unix-44/VT100.c +++ b/bootstrap/unix-44/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/VT100.h b/bootstrap/unix-44/VT100.h index a82dbdb6..ee0408bb 100644 --- a/bootstrap/unix-44/VT100.h +++ b/bootstrap/unix-44/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-44/errors.c b/bootstrap/unix-44/errors.c index d4bc8b00..cce1644f 100644 --- a/bootstrap/unix-44/errors.c +++ b/bootstrap/unix-44/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/errors.h b/bootstrap/unix-44/errors.h index 7d7ab568..9d34f721 100644 --- a/bootstrap/unix-44/errors.h +++ b/bootstrap/unix-44/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index 4ad21fe0..d2dcce53 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index cc3b21ef..2e262037 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/Compiler.c b/bootstrap/unix-48/Compiler.c index 965cd082..759e721b 100644 --- a/bootstrap/unix-48/Compiler.c +++ b/bootstrap/unix-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index da05f57a..95ddb569 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index 97ccb9b4..f6a548e4 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 698bdfec..e0fc2e86 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index 54424759..8f575f62 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index 20373a54..37062b0b 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index fe843fd2..1a319646 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index c47b83d3..45b91f7f 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index b6fd8dd7..a7b62fe3 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index 42ccafe2..038bd92c 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index 639b8015..22742961 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 5eb839d6..20c369e9 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index c0d35b19..c09a1524 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 9fbbbc49..d0b09b3d 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -774,6 +774,7 @@ void OPM_SymRLReal (LONGREAL *lr) void OPM_CloseOldSym (void) { + Files_Close(Files_Base(&OPM_oldSF, Files_Rider__typ)); } void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done) diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index 39474670..be9e98bd 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index dad7e185..90f35dd5 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index 287514a0..de0e599a 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index e76fa4d6..b3c52f3c 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index 42cecab6..a452da84 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 3d9f63cf..2a8e00ab 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index 9cfc72df..38cd17c7 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index 3b2e9f4d..5b51ba36 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index 626e9505..2fa9186d 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Out.c b/bootstrap/unix-48/Out.c index 66922bc1..67a6c27b 100644 --- a/bootstrap/unix-48/Out.c +++ b/bootstrap/unix-48/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Out.h b/bootstrap/unix-48/Out.h index 0d5df379..fbaed75f 100644 --- a/bootstrap/unix-48/Out.h +++ b/bootstrap/unix-48/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index e79917c0..aa55dd0d 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index 6354f985..18456e59 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 291703b5..87ddfb2a 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index 7e26560f..664fe2ec 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index b6b9725d..5bbe808d 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index 0298718d..24f35c02 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index dd394ddd..6676d700 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index 67f5b23d..891c877a 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/VT100.c b/bootstrap/unix-48/VT100.c index 31069c13..c3a9491f 100644 --- a/bootstrap/unix-48/VT100.c +++ b/bootstrap/unix-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/VT100.h b/bootstrap/unix-48/VT100.h index a82dbdb6..ee0408bb 100644 --- a/bootstrap/unix-48/VT100.h +++ b/bootstrap/unix-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-48/errors.c b/bootstrap/unix-48/errors.c index d4bc8b00..cce1644f 100644 --- a/bootstrap/unix-48/errors.c +++ b/bootstrap/unix-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/errors.h b/bootstrap/unix-48/errors.h index 7d7ab568..9d34f721 100644 --- a/bootstrap/unix-48/errors.h +++ b/bootstrap/unix-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index 4ad21fe0..d2dcce53 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index cc3b21ef..2e262037 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/Compiler.c b/bootstrap/unix-88/Compiler.c index 965cd082..759e721b 100644 --- a/bootstrap/unix-88/Compiler.c +++ b/bootstrap/unix-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index da05f57a..95ddb569 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index 97ccb9b4..f6a548e4 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index dcaa4d84..c2373ac4 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 5e3c733a..06ca3f58 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index cffc17c7..0da695a9 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index 6eb9ef88..b0c90472 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 6c0e3e92..9f7407f0 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index b6fd8dd7..a7b62fe3 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index 42ccafe2..038bd92c 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index 639b8015..22742961 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index 5eb839d6..20c369e9 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index c0d35b19..c09a1524 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 0401d1b4..47d8fab3 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -774,6 +774,7 @@ void OPM_SymRLReal (LONGREAL *lr) void OPM_CloseOldSym (void) { + Files_Close(Files_Base(&OPM_oldSF, Files_Rider__typ)); } void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done) diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index 39474670..be9e98bd 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index d762e2d9..0325d7f2 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index 287514a0..de0e599a 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index e76fa4d6..b3c52f3c 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index 42cecab6..a452da84 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index 25bc240a..fe2c4bd5 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 9cfc72df..38cd17c7 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index ee5b452f..64c3f578 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index 626e9505..2fa9186d 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Out.c b/bootstrap/unix-88/Out.c index 66922bc1..67a6c27b 100644 --- a/bootstrap/unix-88/Out.c +++ b/bootstrap/unix-88/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Out.h b/bootstrap/unix-88/Out.h index 0d5df379..fbaed75f 100644 --- a/bootstrap/unix-88/Out.h +++ b/bootstrap/unix-88/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index bc57967b..5c2fada7 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index 20722ed5..4ed02d04 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 291703b5..87ddfb2a 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index 7e26560f..664fe2ec 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index b6b9725d..5bbe808d 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index 0298718d..24f35c02 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index 9a5a9fdd..3271c367 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index e86531bf..1d663861 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/VT100.c b/bootstrap/unix-88/VT100.c index 31069c13..c3a9491f 100644 --- a/bootstrap/unix-88/VT100.c +++ b/bootstrap/unix-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/VT100.h b/bootstrap/unix-88/VT100.h index a82dbdb6..ee0408bb 100644 --- a/bootstrap/unix-88/VT100.h +++ b/bootstrap/unix-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-88/errors.c b/bootstrap/unix-88/errors.c index d4bc8b00..cce1644f 100644 --- a/bootstrap/unix-88/errors.c +++ b/bootstrap/unix-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/errors.h b/bootstrap/unix-88/errors.h index 7d7ab568..9d34f721 100644 --- a/bootstrap/unix-88/errors.h +++ b/bootstrap/unix-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index 4ad21fe0..d2dcce53 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index cc3b21ef..2e262037 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/Compiler.c b/bootstrap/windows-48/Compiler.c index 965cd082..759e721b 100644 --- a/bootstrap/windows-48/Compiler.c +++ b/bootstrap/windows-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index da05f57a..95ddb569 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index 97ccb9b4..f6a548e4 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 98acafdf..3a0ce191 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index eb54b165..10b85a66 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index 20373a54..37062b0b 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index fe843fd2..1a319646 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index c47b83d3..45b91f7f 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index b6fd8dd7..a7b62fe3 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index 42ccafe2..038bd92c 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index 639b8015..22742961 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 5eb839d6..20c369e9 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index c0d35b19..c09a1524 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 9fbbbc49..d0b09b3d 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -774,6 +774,7 @@ void OPM_SymRLReal (LONGREAL *lr) void OPM_CloseOldSym (void) { + Files_Close(Files_Base(&OPM_oldSF, Files_Rider__typ)); } void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done) diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index 39474670..be9e98bd 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index dad7e185..90f35dd5 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index 287514a0..de0e599a 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index e76fa4d6..b3c52f3c 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index 42cecab6..a452da84 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 3d9f63cf..2a8e00ab 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index 9cfc72df..38cd17c7 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index 3b2e9f4d..5b51ba36 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index 626e9505..2fa9186d 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Out.c b/bootstrap/windows-48/Out.c index 4c16f06a..3d2d0c84 100644 --- a/bootstrap/windows-48/Out.c +++ b/bootstrap/windows-48/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Out.h b/bootstrap/windows-48/Out.h index 0d5df379..fbaed75f 100644 --- a/bootstrap/windows-48/Out.h +++ b/bootstrap/windows-48/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 43a3fe2d..22e39c16 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -130,28 +130,28 @@ extern void Heap_InitHeap(); #define Platform_bhfiVsn() (LONGINT)bhfi.dwVolumeSerialNumber #define Platform_byHandleFileInformation() BY_HANDLE_FILE_INFORMATION bhfi #define Platform_cleanupProcess() CloseHandle(pi.hProcess); CloseHandle(pi.hThread); -#define Platform_closeHandle(h) (INTEGER)CloseHandle((address)h) +#define Platform_closeHandle(h) (INTEGER)CloseHandle((HANDLE)(address)h) #define Platform_createProcess(str, str__len) (INTEGER)CreateProcess(0, (char*)str, 0,0,0,0,0,0,&si,&pi) #define Platform_deleteFile(n, n__len) (INTEGER)DeleteFile((char*)n) #define Platform_err() (INTEGER)GetLastError() -#define Platform_errc(c) WriteFile((address)Platform_StdOut, &c, 1, 0,0) -#define Platform_errstring(s, s__len) WriteFile((address)Platform_StdOut, s, s__len-1, 0,0) +#define Platform_errc(c) WriteFile((HANDLE)(address)Platform_StdOut, &c, 1, 0,0) +#define Platform_errstring(s, s__len) WriteFile((HANDLE)(address)Platform_StdOut, s, s__len-1, 0,0) #define Platform_exit(code) ExitProcess((UINT)code) #define Platform_fileTimeToSysTime() SYSTEMTIME st; FileTimeToSystemTime(&ft, &st) -#define Platform_flushFileBuffers(h) (INTEGER)FlushFileBuffers((address)h) +#define Platform_flushFileBuffers(h) (INTEGER)FlushFileBuffers((HANDLE)(address)h) #define Platform_free(address) HeapFree(GetProcessHeap(), 0, (void*)address) #define Platform_ftToUli() ULARGE_INTEGER ul; ul.LowPart=ft.dwLowDateTime; ul.HighPart=ft.dwHighDateTime #define Platform_getCurrentDirectory(n, n__len) GetCurrentDirectory(n__len, (char*)n) #define Platform_getExitCodeProcess(exitcode) GetExitCodeProcess(pi.hProcess, (DWORD*)exitcode); -#define Platform_getFileInformationByHandle(h) (INTEGER)GetFileInformationByHandle((address)h, &bhfi) -#define Platform_getFilePos(h, r, rc) LARGE_INTEGER liz = {0}; *rc = (INTEGER)SetFilePointerEx((address)h, liz, &li, FILE_CURRENT); *r = (LONGINT)li.QuadPart -#define Platform_getFileSize(h) (INTEGER)GetFileSizeEx((address)h, &li) +#define Platform_getFileInformationByHandle(h) (INTEGER)GetFileInformationByHandle((HANDLE)(address)h, &bhfi) +#define Platform_getFilePos(h, r, rc) LARGE_INTEGER liz = {0}; *rc = (INTEGER)SetFilePointerEx((HANDLE)(address)h, liz, &li, FILE_CURRENT); *r = (LONGINT)li.QuadPart +#define Platform_getFileSize(h) (INTEGER)GetFileSizeEx((HANDLE)(address)h, &li) #define Platform_getLocalTime() SYSTEMTIME st; GetLocalTime(&st) #define Platform_getenv(name, name__len, buf, buf__len) (INTEGER)GetEnvironmentVariable((char*)name, (char*)buf, buf__len) #define Platform_getpid() (INTEGER)GetCurrentProcessId() -#define Platform_getstderrhandle() (address)GetStdHandle(STD_ERROR_HANDLE) -#define Platform_getstdinhandle() (address)GetStdHandle(STD_INPUT_HANDLE) -#define Platform_getstdouthandle() (address)GetStdHandle(STD_OUTPUT_HANDLE) +#define Platform_getstderrhandle() (LONGINT)(address)GetStdHandle(STD_ERROR_HANDLE) +#define Platform_getstdinhandle() (LONGINT)(address)GetStdHandle(STD_INPUT_HANDLE) +#define Platform_getstdouthandle() (LONGINT)(address)GetStdHandle(STD_OUTPUT_HANDLE) #define Platform_identityToFileTime(i) FILETIME ft; ft.dwHighDateTime = i.mtimehigh; ft.dwLowDateTime = i.mtimelow #define Platform_invalidHandleValue() ((LONGINT)(address)INVALID_HANDLE_VALUE) #define Platform_largeInteger() LARGE_INTEGER li @@ -161,13 +161,13 @@ extern void Heap_InitHeap(); #define Platform_openro(n, n__len) (LONGINT)(address)CreateFile((char*)n, GENERIC_READ , FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) #define Platform_openrw(n, n__len) (LONGINT)(address)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) #define Platform_processInfo() PROCESS_INFORMATION pi = {0}; -#define Platform_readfile(fd, p, l, n) (INTEGER)ReadFile((address)fd, (void*)p, (DWORD)l, (DWORD*)n, 0) +#define Platform_readfile(fd, p, l, n) (INTEGER)ReadFile((HANDLE)(address)fd, (void*)p, (DWORD)l, (DWORD*)n, 0) #define Platform_seekcur() FILE_CURRENT #define Platform_seekend() FILE_END #define Platform_seekset() FILE_BEGIN #define Platform_setCurrentDirectory(n, n__len) (INTEGER)SetCurrentDirectory((char*)n) -#define Platform_setEndOfFile(h) (INTEGER)SetEndOfFile((address)h) -#define Platform_setFilePointerEx(h, o, r, rc) li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((address)h, li, 0, (DWORD)r) +#define Platform_setEndOfFile(h) (INTEGER)SetEndOfFile((HANDLE)(address)h) +#define Platform_setFilePointerEx(h, o, r, rc) li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((HANDLE)(address)h, li, 0, (DWORD)r) #define Platform_sleep(ms) Sleep((DWORD)ms) #define Platform_stToFt() FILETIME ft; SystemTimeToFileTime(&st, &ft) #define Platform_startupInfo() STARTUPINFO si = {0}; si.cb = sizeof(si); @@ -182,7 +182,7 @@ extern void Heap_InitHeap(); #define Platform_ulSec() (LONGINT)(ul.QuadPart / 1000000LL) #define Platform_uluSec() (LONGINT)(ul.QuadPart % 1000000LL) #define Platform_waitForProcess() (INTEGER)WaitForSingleObject(pi.hProcess, INFINITE) -#define Platform_writefile(fd, p, l) (INTEGER)WriteFile((address)fd, (void*)(p), (DWORD)l, 0,0) +#define Platform_writefile(fd, p, l) (INTEGER)WriteFile((HANDLE)(address)fd, (void*)(p), (DWORD)l, 0,0) BOOLEAN Platform_TooManyFiles (int16 e) { diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index 0c6f1ba4..bf14c58e 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 291703b5..87ddfb2a 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index 7e26560f..664fe2ec 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index b6b9725d..5bbe808d 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index 0298718d..24f35c02 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index dd394ddd..6676d700 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index 67f5b23d..891c877a 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/VT100.c b/bootstrap/windows-48/VT100.c index 31069c13..c3a9491f 100644 --- a/bootstrap/windows-48/VT100.c +++ b/bootstrap/windows-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/VT100.h b/bootstrap/windows-48/VT100.h index a82dbdb6..ee0408bb 100644 --- a/bootstrap/windows-48/VT100.h +++ b/bootstrap/windows-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-48/errors.c b/bootstrap/windows-48/errors.c index d4bc8b00..cce1644f 100644 --- a/bootstrap/windows-48/errors.c +++ b/bootstrap/windows-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/errors.h b/bootstrap/windows-48/errors.h index 7d7ab568..9d34f721 100644 --- a/bootstrap/windows-48/errors.h +++ b/bootstrap/windows-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index 4ad21fe0..d2dcce53 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index cc3b21ef..2e262037 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/Compiler.c b/bootstrap/windows-88/Compiler.c index 965cd082..759e721b 100644 --- a/bootstrap/windows-88/Compiler.c +++ b/bootstrap/windows-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index da05f57a..95ddb569 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index 97ccb9b4..f6a548e4 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 1f8984a1..8d8ec59f 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index f233377b..2e014659 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index cffc17c7..0da695a9 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index 6eb9ef88..b0c90472 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 6c0e3e92..9f7407f0 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index b6fd8dd7..a7b62fe3 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index 42ccafe2..038bd92c 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index 639b8015..22742961 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index 5eb839d6..20c369e9 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index c0d35b19..c09a1524 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 0401d1b4..47d8fab3 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -774,6 +774,7 @@ void OPM_SymRLReal (LONGREAL *lr) void OPM_CloseOldSym (void) { + Files_Close(Files_Base(&OPM_oldSF, Files_Rider__typ)); } void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done) diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index 39474670..be9e98bd 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index d762e2d9..0325d7f2 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index 287514a0..de0e599a 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index e76fa4d6..b3c52f3c 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index 42cecab6..a452da84 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index 25bc240a..fe2c4bd5 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 9cfc72df..38cd17c7 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index ee5b452f..64c3f578 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index 626e9505..2fa9186d 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Out.c b/bootstrap/windows-88/Out.c index 4c16f06a..3d2d0c84 100644 --- a/bootstrap/windows-88/Out.c +++ b/bootstrap/windows-88/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Out.h b/bootstrap/windows-88/Out.h index 0d5df379..fbaed75f 100644 --- a/bootstrap/windows-88/Out.h +++ b/bootstrap/windows-88/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index a802c149..845872c3 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -130,28 +130,28 @@ extern void Heap_InitHeap(); #define Platform_bhfiVsn() (LONGINT)bhfi.dwVolumeSerialNumber #define Platform_byHandleFileInformation() BY_HANDLE_FILE_INFORMATION bhfi #define Platform_cleanupProcess() CloseHandle(pi.hProcess); CloseHandle(pi.hThread); -#define Platform_closeHandle(h) (INTEGER)CloseHandle((address)h) +#define Platform_closeHandle(h) (INTEGER)CloseHandle((HANDLE)(address)h) #define Platform_createProcess(str, str__len) (INTEGER)CreateProcess(0, (char*)str, 0,0,0,0,0,0,&si,&pi) #define Platform_deleteFile(n, n__len) (INTEGER)DeleteFile((char*)n) #define Platform_err() (INTEGER)GetLastError() -#define Platform_errc(c) WriteFile((address)Platform_StdOut, &c, 1, 0,0) -#define Platform_errstring(s, s__len) WriteFile((address)Platform_StdOut, s, s__len-1, 0,0) +#define Platform_errc(c) WriteFile((HANDLE)(address)Platform_StdOut, &c, 1, 0,0) +#define Platform_errstring(s, s__len) WriteFile((HANDLE)(address)Platform_StdOut, s, s__len-1, 0,0) #define Platform_exit(code) ExitProcess((UINT)code) #define Platform_fileTimeToSysTime() SYSTEMTIME st; FileTimeToSystemTime(&ft, &st) -#define Platform_flushFileBuffers(h) (INTEGER)FlushFileBuffers((address)h) +#define Platform_flushFileBuffers(h) (INTEGER)FlushFileBuffers((HANDLE)(address)h) #define Platform_free(address) HeapFree(GetProcessHeap(), 0, (void*)address) #define Platform_ftToUli() ULARGE_INTEGER ul; ul.LowPart=ft.dwLowDateTime; ul.HighPart=ft.dwHighDateTime #define Platform_getCurrentDirectory(n, n__len) GetCurrentDirectory(n__len, (char*)n) #define Platform_getExitCodeProcess(exitcode) GetExitCodeProcess(pi.hProcess, (DWORD*)exitcode); -#define Platform_getFileInformationByHandle(h) (INTEGER)GetFileInformationByHandle((address)h, &bhfi) -#define Platform_getFilePos(h, r, rc) LARGE_INTEGER liz = {0}; *rc = (INTEGER)SetFilePointerEx((address)h, liz, &li, FILE_CURRENT); *r = (LONGINT)li.QuadPart -#define Platform_getFileSize(h) (INTEGER)GetFileSizeEx((address)h, &li) +#define Platform_getFileInformationByHandle(h) (INTEGER)GetFileInformationByHandle((HANDLE)(address)h, &bhfi) +#define Platform_getFilePos(h, r, rc) LARGE_INTEGER liz = {0}; *rc = (INTEGER)SetFilePointerEx((HANDLE)(address)h, liz, &li, FILE_CURRENT); *r = (LONGINT)li.QuadPart +#define Platform_getFileSize(h) (INTEGER)GetFileSizeEx((HANDLE)(address)h, &li) #define Platform_getLocalTime() SYSTEMTIME st; GetLocalTime(&st) #define Platform_getenv(name, name__len, buf, buf__len) (INTEGER)GetEnvironmentVariable((char*)name, (char*)buf, buf__len) #define Platform_getpid() (INTEGER)GetCurrentProcessId() -#define Platform_getstderrhandle() (address)GetStdHandle(STD_ERROR_HANDLE) -#define Platform_getstdinhandle() (address)GetStdHandle(STD_INPUT_HANDLE) -#define Platform_getstdouthandle() (address)GetStdHandle(STD_OUTPUT_HANDLE) +#define Platform_getstderrhandle() (LONGINT)(address)GetStdHandle(STD_ERROR_HANDLE) +#define Platform_getstdinhandle() (LONGINT)(address)GetStdHandle(STD_INPUT_HANDLE) +#define Platform_getstdouthandle() (LONGINT)(address)GetStdHandle(STD_OUTPUT_HANDLE) #define Platform_identityToFileTime(i) FILETIME ft; ft.dwHighDateTime = i.mtimehigh; ft.dwLowDateTime = i.mtimelow #define Platform_invalidHandleValue() ((LONGINT)(address)INVALID_HANDLE_VALUE) #define Platform_largeInteger() LARGE_INTEGER li @@ -161,13 +161,13 @@ extern void Heap_InitHeap(); #define Platform_openro(n, n__len) (LONGINT)(address)CreateFile((char*)n, GENERIC_READ , FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) #define Platform_openrw(n, n__len) (LONGINT)(address)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) #define Platform_processInfo() PROCESS_INFORMATION pi = {0}; -#define Platform_readfile(fd, p, l, n) (INTEGER)ReadFile((address)fd, (void*)p, (DWORD)l, (DWORD*)n, 0) +#define Platform_readfile(fd, p, l, n) (INTEGER)ReadFile((HANDLE)(address)fd, (void*)p, (DWORD)l, (DWORD*)n, 0) #define Platform_seekcur() FILE_CURRENT #define Platform_seekend() FILE_END #define Platform_seekset() FILE_BEGIN #define Platform_setCurrentDirectory(n, n__len) (INTEGER)SetCurrentDirectory((char*)n) -#define Platform_setEndOfFile(h) (INTEGER)SetEndOfFile((address)h) -#define Platform_setFilePointerEx(h, o, r, rc) li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((address)h, li, 0, (DWORD)r) +#define Platform_setEndOfFile(h) (INTEGER)SetEndOfFile((HANDLE)(address)h) +#define Platform_setFilePointerEx(h, o, r, rc) li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((HANDLE)(address)h, li, 0, (DWORD)r) #define Platform_sleep(ms) Sleep((DWORD)ms) #define Platform_stToFt() FILETIME ft; SystemTimeToFileTime(&st, &ft) #define Platform_startupInfo() STARTUPINFO si = {0}; si.cb = sizeof(si); @@ -182,7 +182,7 @@ extern void Heap_InitHeap(); #define Platform_ulSec() (LONGINT)(ul.QuadPart / 1000000LL) #define Platform_uluSec() (LONGINT)(ul.QuadPart % 1000000LL) #define Platform_waitForProcess() (INTEGER)WaitForSingleObject(pi.hProcess, INFINITE) -#define Platform_writefile(fd, p, l) (INTEGER)WriteFile((address)fd, (void*)(p), (DWORD)l, 0,0) +#define Platform_writefile(fd, p, l) (INTEGER)WriteFile((HANDLE)(address)fd, (void*)(p), (DWORD)l, 0,0) BOOLEAN Platform_TooManyFiles (int16 e) { diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index d09c4a89..809c60fc 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 291703b5..87ddfb2a 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index 7e26560f..664fe2ec 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index b6b9725d..5bbe808d 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index 0298718d..24f35c02 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index 9a5a9fdd..3271c367 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index e86531bf..1d663861 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/VT100.c b/bootstrap/windows-88/VT100.c index 31069c13..c3a9491f 100644 --- a/bootstrap/windows-88/VT100.c +++ b/bootstrap/windows-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/VT100.h b/bootstrap/windows-88/VT100.h index a82dbdb6..ee0408bb 100644 --- a/bootstrap/windows-88/VT100.h +++ b/bootstrap/windows-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-88/errors.c b/bootstrap/windows-88/errors.c index d4bc8b00..cce1644f 100644 --- a/bootstrap/windows-88/errors.c +++ b/bootstrap/windows-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/errors.h b/bootstrap/windows-88/errors.h index 7d7ab568..9d34f721 100644 --- a/bootstrap/windows-88/errors.h +++ b/bootstrap/windows-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index 4ad21fe0..d2dcce53 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index cc3b21ef..2e262037 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/src/runtime/Platformwindows.Mod b/src/runtime/Platformwindows.Mod index 349fac4f..65c97d24 100644 --- a/src/runtime/Platformwindows.Mod +++ b/src/runtime/Platformwindows.Mod @@ -336,7 +336,7 @@ END New; -PROCEDURE -closeHandle(h: FileHandle): INTEGER "(INTEGER)CloseHandle((address)h)"; +PROCEDURE -closeHandle(h: FileHandle): INTEGER "(INTEGER)CloseHandle((HANDLE)(address)h)"; PROCEDURE Close*(h: FileHandle): ErrorCode; BEGIN @@ -346,7 +346,7 @@ END Close; PROCEDURE -byHandleFileInformation "BY_HANDLE_FILE_INFORMATION bhfi"; -PROCEDURE -getFileInformationByHandle(h: FileHandle): INTEGER "(INTEGER)GetFileInformationByHandle((address)h, &bhfi)"; +PROCEDURE -getFileInformationByHandle(h: FileHandle): INTEGER "(INTEGER)GetFileInformationByHandle((HANDLE)(address)h, &bhfi)"; PROCEDURE -bhfiMtimeHigh(): LONGINT "(LONGINT)bhfi.ftLastWriteTime.dwHighDateTime"; PROCEDURE -bhfiMtimeLow(): LONGINT "(LONGINT)bhfi.ftLastWriteTime.dwLowDateTime"; PROCEDURE -bhfiVsn(): LONGINT "(LONGINT)bhfi.dwVolumeSerialNumber"; @@ -405,7 +405,7 @@ END MTimeAsClock; PROCEDURE -largeInteger "LARGE_INTEGER li"; PROCEDURE -liLongint(): LONGINT "(LONGINT)li.QuadPart"; -PROCEDURE -getFileSize(h: FileHandle): INTEGER "(INTEGER)GetFileSizeEx((address)h, &li)"; +PROCEDURE -getFileSize(h: FileHandle): INTEGER "(INTEGER)GetFileSizeEx((HANDLE)(address)h, &li)"; PROCEDURE Size*(h: FileHandle; VAR l: LONGINT): ErrorCode; BEGIN @@ -417,7 +417,7 @@ END Size; PROCEDURE -readfile (fd: LONGINT; p: SYSTEM.ADDRESS; l: LONGINT; VAR n: SYSTEM.INT32): INTEGER -"(INTEGER)ReadFile((address)fd, (void*)p, (DWORD)l, (DWORD*)n, 0)"; +"(INTEGER)ReadFile((HANDLE)(address)fd, (void*)p, (DWORD)l, (DWORD*)n, 0)"; PROCEDURE Read*(h: FileHandle; p: SYSTEM.ADDRESS; l: LONGINT; VAR n: LONGINT): ErrorCode; VAR result: INTEGER; lengthread: SYSTEM.INT32; @@ -436,7 +436,7 @@ END ReadBuf; PROCEDURE -writefile(fd: LONGINT; p: SYSTEM.ADDRESS; l: LONGINT): INTEGER -"(INTEGER)WriteFile((address)fd, (void*)(p), (DWORD)l, 0,0)"; +"(INTEGER)WriteFile((HANDLE)(address)fd, (void*)(p), (DWORD)l, 0,0)"; PROCEDURE Write*(h: FileHandle; p: SYSTEM.ADDRESS; l: LONGINT): ErrorCode; BEGIN @@ -445,7 +445,7 @@ END Write; -PROCEDURE -flushFileBuffers(h: FileHandle): INTEGER "(INTEGER)FlushFileBuffers((address)h)"; +PROCEDURE -flushFileBuffers(h: FileHandle): INTEGER "(INTEGER)FlushFileBuffers((HANDLE)(address)h)"; PROCEDURE Sync*(h: FileHandle): ErrorCode; BEGIN @@ -455,7 +455,7 @@ END Sync; PROCEDURE -setFilePointerEx(h: FileHandle; o: LONGINT; r: INTEGER; VAR rc: INTEGER) -"li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((address)h, li, 0, (DWORD)r)"; +"li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((HANDLE)(address)h, li, 0, (DWORD)r)"; PROCEDURE -seekset(): INTEGER "FILE_BEGIN"; PROCEDURE -seekcur(): INTEGER "FILE_CURRENT"; @@ -471,9 +471,9 @@ END Seek; -PROCEDURE -setEndOfFile(h: FileHandle): INTEGER "(INTEGER)SetEndOfFile((address)h)"; +PROCEDURE -setEndOfFile(h: FileHandle): INTEGER "(INTEGER)SetEndOfFile((HANDLE)(address)h)"; PROCEDURE -getFilePos(h: FileHandle; VAR r: LONGINT; VAR rc: INTEGER) -"LARGE_INTEGER liz = {0}; *rc = (INTEGER)SetFilePointerEx((address)h, liz, &li, FILE_CURRENT); *r = (LONGINT)li.QuadPart"; +"LARGE_INTEGER liz = {0}; *rc = (INTEGER)SetFilePointerEx((HANDLE)(address)h, liz, &li, FILE_CURRENT); *r = (LONGINT)li.QuadPart"; PROCEDURE Truncate*(h: FileHandle; limit: LONGINT): ErrorCode; VAR rc: INTEGER; oldpos: LONGINT; @@ -531,8 +531,8 @@ PROCEDURE Exit*(code: INTEGER); BEGIN exit(code) END Exit; -PROCEDURE -errstring(s: ARRAY OF CHAR) 'WriteFile((address)Platform_StdOut, s, s__len-1, 0,0)'; -PROCEDURE -errc (c: CHAR) 'WriteFile((address)Platform_StdOut, &c, 1, 0,0)'; +PROCEDURE -errstring(s: ARRAY OF CHAR) 'WriteFile((HANDLE)(address)Platform_StdOut, s, s__len-1, 0,0)'; +PROCEDURE -errc (c: CHAR) 'WriteFile((HANDLE)(address)Platform_StdOut, &c, 1, 0,0)'; PROCEDURE errch(c: CHAR); BEGIN errc(c) END errch; PROCEDURE errln; BEGIN errch(0DX); errch(0AX) END errln; @@ -594,9 +594,9 @@ PROCEDURE TestLittleEndian; BEGIN i := 1; SYSTEM.GET(SYSTEM.ADR(i), LittleEndian); END TestLittleEndian; -PROCEDURE -getstdinhandle(): FileHandle "(address)GetStdHandle(STD_INPUT_HANDLE)"; -PROCEDURE -getstdouthandle(): FileHandle "(address)GetStdHandle(STD_OUTPUT_HANDLE)"; -PROCEDURE -getstderrhandle(): FileHandle "(address)GetStdHandle(STD_ERROR_HANDLE)"; +PROCEDURE -getstdinhandle(): FileHandle "(LONGINT)(address)GetStdHandle(STD_INPUT_HANDLE)"; +PROCEDURE -getstdouthandle(): FileHandle "(LONGINT)(address)GetStdHandle(STD_OUTPUT_HANDLE)"; +PROCEDURE -getstderrhandle(): FileHandle "(LONGINT)(address)GetStdHandle(STD_ERROR_HANDLE)"; PROCEDURE -getpid(): INTEGER "(INTEGER)GetCurrentProcessId()"; BEGIN diff --git a/src/runtime/SYSTEM.h b/src/runtime/SYSTEM.h index 8ded6b23..165b5ec8 100644 --- a/src/runtime/SYSTEM.h +++ b/src/runtime/SYSTEM.h @@ -5,14 +5,14 @@ // 64 bit system detection #if (__SIZEOF_POINTER__ == 8) || defined (_LP64) || defined(__LP64__) || defined(_WIN64) - #define __o_64 + #define o__64 #endif // Declare memcpy in a way compatible with C compilers intrinsic // built in implementations. -#if defined (__o_64) +#if defined (o__64) #if defined(_WIN64) typedef unsigned long long size_t; #else @@ -26,11 +26,12 @@ #define _SIZE_T_DEFINED_ // For OpenBSD void *memcpy(void *dest, const void *source, size_t size); +void *alloca(size_t size); // Declare fixed size versions of basic intger types -#if defined (__o_64) && !defined(_WIN64) +#if defined (o__64) && !defined(_WIN64) // LP64 typedef long int64; typedef unsigned long uint64; @@ -78,7 +79,7 @@ typedef void* SYSTEM_PTR; // 'address' is a synonym for an int of pointer size -#if defined (__o_64) +#if defined (o__64) #define address int64 #else #define address int32 @@ -154,9 +155,13 @@ static inline int __str_cmp(CHAR *x, CHAR *y){ #define __COPY(s, d, n) {char*_a=(void*)s,*_b=(void*)d; LONGINT _i=0,_t=n-1; \ while(_i<_t&&((_b[_i]=_a[_i])!=0)){_i++;};_b[_i]=0;} -#define __DUP(x, l, t) x=(void*)memcpy((void*)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) #define __DUPARR(v, t) v=(void*)memcpy(v##__copy,v,sizeof(t)) -#define __DEL(x) Platform_OSFree((address)x) + +//#define __DUP(x, l, t) x=(void*)memcpy((void*)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) +//#define __DEL(x) Platform_OSFree((address)x) + +#define __DUP(x, l, t) x=(void*)memcpy(alloca(l*sizeof(t)),x,l*sizeof(t)) +#define __DEL(x) /* SYSTEM ops */ diff --git a/src/test/confidence/arrayassignment/test.sh b/src/test/confidence/arrayassignment/test.sh index 115040ef..c4fd00f5 100755 --- a/src/test/confidence/arrayassignment/test.sh +++ b/src/test/confidence/arrayassignment/test.sh @@ -1,5 +1,6 @@ #!/bin/sh . ../testenv.sh +rm -f aa # Remove LSW binary so it doesn't hide Cygwin binary. $OBECOMP aa.mod -m ./aa >result . ../testresult.sh diff --git a/src/test/confidence/isptest/expected b/src/test/confidence/isptest/expected index 4ce25153..b5af3090 100644 --- a/src/test/confidence/isptest/expected +++ b/src/test/confidence/isptest/expected @@ -428,149 +428,163 @@ pos=427 char=O pos=428 char=u pos=429 char=t pos=430 char=. -pos=431 char=L -pos=432 char=n -pos=433 char=; -pos=434 char= -pos=435 char= -pos=436 char= -pos=437 char= -pos=438 char= -pos=439 char= -pos=440 char= -pos=441 char= -pos=442 char=I -pos=443 char=F +pos=431 char=C +pos=432 char=h +pos=433 char=a +pos=434 char=r +pos=435 char=( +pos=436 char=0 +pos=437 char=A +pos=438 char=X +pos=439 char=) +pos=440 char=; +pos=441 char= +pos=442 char= +pos=443 char= pos=444 char= -pos=445 char=i +pos=445 char= pos=446 char= -pos=447 char== +pos=447 char= pos=448 char= -pos=449 char=2 -pos=450 char=1 -pos=451 char=9 -pos=452 char=0 -pos=453 char=6 -pos=454 char= -pos=455 char=T -pos=456 char=H -pos=457 char=E -pos=458 char=N -pos=459 char= -pos=460 char= +pos=449 char=I +pos=450 char=F +pos=451 char= +pos=452 char=i +pos=453 char= +pos=454 char== +pos=455 char= +pos=456 char=2 +pos=457 char=1 +pos=458 char=9 +pos=459 char=0 +pos=460 char=6 pos=461 char= -pos=462 char= -pos=463 char= -pos=464 char= -pos=465 char= -pos=466 char= +pos=462 char=T +pos=463 char=H +pos=464 char=E +pos=465 char=N +pos=466 char= pos=467 char= pos=468 char= -pos=469 char=O -pos=470 char=u -pos=471 char=t -pos=472 char=. -pos=473 char=S -pos=474 char=t -pos=475 char=r -pos=476 char=i -pos=477 char=n -pos=478 char=g -pos=479 char=( -pos=480 char=" -pos=481 char=2 -pos=482 char=1 -pos=483 char=9 -pos=484 char=0 -pos=485 char=6 -pos=486 char=" -pos=487 char=) -pos=488 char=; -pos=489 char= -pos=490 char=O -pos=491 char=u -pos=492 char=t -pos=493 char=. -pos=494 char=L -pos=495 char=n -pos=496 char=; -pos=497 char= -pos=498 char= -pos=499 char= -pos=500 char= -pos=501 char= -pos=502 char= -pos=503 char= -pos=504 char= -pos=505 char= -pos=506 char= -pos=507 char=( -pos=508 char=* -pos=509 char=P -pos=510 char=l -pos=511 char=a -pos=512 char=t -pos=513 char=f -pos=514 char=o -pos=515 char=r -pos=516 char=m -pos=517 char=. -pos=518 char=D -pos=519 char=e -pos=520 char=l -pos=521 char=a -pos=522 char=y -pos=523 char=( -pos=524 char=1 -pos=525 char=0 -pos=526 char=0 -pos=527 char=0 -pos=528 char=0 -pos=529 char=) -pos=530 char=; -pos=531 char=* -pos=532 char=) -pos=533 char= -pos=534 char= -pos=535 char= -pos=536 char= -pos=537 char= -pos=538 char= -pos=539 char= -pos=540 char= -pos=541 char=E -pos=542 char=N -pos=543 char=D +pos=469 char= +pos=470 char= +pos=471 char= +pos=472 char= +pos=473 char= +pos=474 char= +pos=475 char= +pos=476 char=O +pos=477 char=u +pos=478 char=t +pos=479 char=. +pos=480 char=S +pos=481 char=t +pos=482 char=r +pos=483 char=i +pos=484 char=n +pos=485 char=g +pos=486 char=( +pos=487 char=" +pos=488 char=2 +pos=489 char=1 +pos=490 char=9 +pos=491 char=0 +pos=492 char=6 +pos=493 char=" +pos=494 char=) +pos=495 char=; +pos=496 char= +pos=497 char=O +pos=498 char=u +pos=499 char=t +pos=500 char=. +pos=501 char=C +pos=502 char=h +pos=503 char=a +pos=504 char=r +pos=505 char=( +pos=506 char=0 +pos=507 char=A +pos=508 char=X +pos=509 char=) +pos=510 char=; +pos=511 char= +pos=512 char= +pos=513 char= +pos=514 char= +pos=515 char= +pos=516 char= +pos=517 char= +pos=518 char= +pos=519 char= +pos=520 char= +pos=521 char=( +pos=522 char=* +pos=523 char=P +pos=524 char=l +pos=525 char=a +pos=526 char=t +pos=527 char=f +pos=528 char=o +pos=529 char=r +pos=530 char=m +pos=531 char=. +pos=532 char=D +pos=533 char=e +pos=534 char=l +pos=535 char=a +pos=536 char=y +pos=537 char=( +pos=538 char=1 +pos=539 char=0 +pos=540 char=0 +pos=541 char=0 +pos=542 char=0 +pos=543 char=) pos=544 char=; -pos=545 char= -pos=546 char= -pos=547 char= +pos=545 char=* +pos=546 char=) +pos=547 char= pos=548 char= pos=549 char= -pos=550 char=E -pos=551 char=N -pos=552 char=D -pos=553 char=; -pos=554 char= -pos=555 char= -pos=556 char= -pos=557 char=E -pos=558 char=N -pos=559 char=D -pos=560 char= -pos=561 char=E -pos=562 char=N -pos=563 char=D -pos=564 char= -pos=565 char=i -pos=566 char=s -pos=567 char=p -pos=568 char=t -pos=569 char=e -pos=570 char=s -pos=571 char=t -pos=572 char=. -pos=573 char= +pos=550 char= +pos=551 char= +pos=552 char= +pos=553 char= +pos=554 char= +pos=555 char=E +pos=556 char=N +pos=557 char=D +pos=558 char=; +pos=559 char= +pos=560 char= +pos=561 char= +pos=562 char= +pos=563 char= +pos=564 char=E +pos=565 char=N +pos=566 char=D +pos=567 char=; +pos=568 char= +pos=569 char= +pos=570 char= +pos=571 char=E +pos=572 char=N +pos=573 char=D +pos=574 char= +pos=575 char=E +pos=576 char=N +pos=577 char=D +pos=578 char= +pos=579 char=i +pos=580 char=s +pos=581 char=p +pos=582 char=t +pos=583 char=e +pos=584 char=s +pos=585 char=t +pos=586 char=. +pos=587 char= --- Testing with Component Pascal variable model --- @@ -1003,146 +1017,160 @@ pos=427 char=O pos=428 char=u pos=429 char=t pos=430 char=. -pos=431 char=L -pos=432 char=n -pos=433 char=; -pos=434 char= -pos=435 char= -pos=436 char= -pos=437 char= -pos=438 char= -pos=439 char= -pos=440 char= -pos=441 char= -pos=442 char=I -pos=443 char=F +pos=431 char=C +pos=432 char=h +pos=433 char=a +pos=434 char=r +pos=435 char=( +pos=436 char=0 +pos=437 char=A +pos=438 char=X +pos=439 char=) +pos=440 char=; +pos=441 char= +pos=442 char= +pos=443 char= pos=444 char= -pos=445 char=i +pos=445 char= pos=446 char= -pos=447 char== +pos=447 char= pos=448 char= -pos=449 char=2 -pos=450 char=1 -pos=451 char=9 -pos=452 char=0 -pos=453 char=6 -pos=454 char= -pos=455 char=T -pos=456 char=H -pos=457 char=E -pos=458 char=N -pos=459 char= -pos=460 char= +pos=449 char=I +pos=450 char=F +pos=451 char= +pos=452 char=i +pos=453 char= +pos=454 char== +pos=455 char= +pos=456 char=2 +pos=457 char=1 +pos=458 char=9 +pos=459 char=0 +pos=460 char=6 pos=461 char= -pos=462 char= -pos=463 char= -pos=464 char= -pos=465 char= -pos=466 char= +pos=462 char=T +pos=463 char=H +pos=464 char=E +pos=465 char=N +pos=466 char= pos=467 char= pos=468 char= -pos=469 char=O -pos=470 char=u -pos=471 char=t -pos=472 char=. -pos=473 char=S -pos=474 char=t -pos=475 char=r -pos=476 char=i -pos=477 char=n -pos=478 char=g -pos=479 char=( -pos=480 char=" -pos=481 char=2 -pos=482 char=1 -pos=483 char=9 -pos=484 char=0 -pos=485 char=6 -pos=486 char=" -pos=487 char=) -pos=488 char=; -pos=489 char= -pos=490 char=O -pos=491 char=u -pos=492 char=t -pos=493 char=. -pos=494 char=L -pos=495 char=n -pos=496 char=; -pos=497 char= -pos=498 char= -pos=499 char= -pos=500 char= -pos=501 char= -pos=502 char= -pos=503 char= -pos=504 char= -pos=505 char= -pos=506 char= -pos=507 char=( -pos=508 char=* -pos=509 char=P -pos=510 char=l -pos=511 char=a -pos=512 char=t -pos=513 char=f -pos=514 char=o -pos=515 char=r -pos=516 char=m -pos=517 char=. -pos=518 char=D -pos=519 char=e -pos=520 char=l -pos=521 char=a -pos=522 char=y -pos=523 char=( -pos=524 char=1 -pos=525 char=0 -pos=526 char=0 -pos=527 char=0 -pos=528 char=0 -pos=529 char=) -pos=530 char=; -pos=531 char=* -pos=532 char=) -pos=533 char= -pos=534 char= -pos=535 char= -pos=536 char= -pos=537 char= -pos=538 char= -pos=539 char= -pos=540 char= -pos=541 char=E -pos=542 char=N -pos=543 char=D +pos=469 char= +pos=470 char= +pos=471 char= +pos=472 char= +pos=473 char= +pos=474 char= +pos=475 char= +pos=476 char=O +pos=477 char=u +pos=478 char=t +pos=479 char=. +pos=480 char=S +pos=481 char=t +pos=482 char=r +pos=483 char=i +pos=484 char=n +pos=485 char=g +pos=486 char=( +pos=487 char=" +pos=488 char=2 +pos=489 char=1 +pos=490 char=9 +pos=491 char=0 +pos=492 char=6 +pos=493 char=" +pos=494 char=) +pos=495 char=; +pos=496 char= +pos=497 char=O +pos=498 char=u +pos=499 char=t +pos=500 char=. +pos=501 char=C +pos=502 char=h +pos=503 char=a +pos=504 char=r +pos=505 char=( +pos=506 char=0 +pos=507 char=A +pos=508 char=X +pos=509 char=) +pos=510 char=; +pos=511 char= +pos=512 char= +pos=513 char= +pos=514 char= +pos=515 char= +pos=516 char= +pos=517 char= +pos=518 char= +pos=519 char= +pos=520 char= +pos=521 char=( +pos=522 char=* +pos=523 char=P +pos=524 char=l +pos=525 char=a +pos=526 char=t +pos=527 char=f +pos=528 char=o +pos=529 char=r +pos=530 char=m +pos=531 char=. +pos=532 char=D +pos=533 char=e +pos=534 char=l +pos=535 char=a +pos=536 char=y +pos=537 char=( +pos=538 char=1 +pos=539 char=0 +pos=540 char=0 +pos=541 char=0 +pos=542 char=0 +pos=543 char=) pos=544 char=; -pos=545 char= -pos=546 char= -pos=547 char= +pos=545 char=* +pos=546 char=) +pos=547 char= pos=548 char= pos=549 char= -pos=550 char=E -pos=551 char=N -pos=552 char=D -pos=553 char=; -pos=554 char= -pos=555 char= -pos=556 char= -pos=557 char=E -pos=558 char=N -pos=559 char=D -pos=560 char= -pos=561 char=E -pos=562 char=N -pos=563 char=D -pos=564 char= -pos=565 char=i -pos=566 char=s -pos=567 char=p -pos=568 char=t -pos=569 char=e -pos=570 char=s -pos=571 char=t -pos=572 char=. -pos=573 char= +pos=550 char= +pos=551 char= +pos=552 char= +pos=553 char= +pos=554 char= +pos=555 char=E +pos=556 char=N +pos=557 char=D +pos=558 char=; +pos=559 char= +pos=560 char= +pos=561 char= +pos=562 char= +pos=563 char= +pos=564 char=E +pos=565 char=N +pos=566 char=D +pos=567 char=; +pos=568 char= +pos=569 char= +pos=570 char= +pos=571 char=E +pos=572 char=N +pos=573 char=D +pos=574 char= +pos=575 char=E +pos=576 char=N +pos=577 char=D +pos=578 char= +pos=579 char=i +pos=580 char=s +pos=581 char=p +pos=582 char=t +pos=583 char=e +pos=584 char=s +pos=585 char=t +pos=586 char=. +pos=587 char= diff --git a/src/test/confidence/isptest/isptest.mod b/src/test/confidence/isptest/isptest.mod index cc6313e3..86fb0fb9 100644 --- a/src/test/confidence/isptest/isptest.mod +++ b/src/test/confidence/isptest/isptest.mod @@ -17,9 +17,9 @@ BEGIN WHILE ~R.eot DO Texts.Read(R, ch); i := Texts.Pos(R); - Out.String("pos="); Out.Int(i,0); Out.String(" char="); Out.Char(ch); Out.Ln; + Out.String("pos="); Out.Int(i,0); Out.String(" char="); Out.Char(ch); Out.Char(0AX); IF i = 21906 THEN - Out.String("21906"); Out.Ln; + Out.String("21906"); Out.Char(0AX); (*Platform.Delay(10000);*) END; END; diff --git a/src/test/confidence/language/test.sh b/src/test/confidence/language/test.sh index 82f3efbf..27b9f951 100755 --- a/src/test/confidence/language/test.sh +++ b/src/test/confidence/language/test.sh @@ -1,6 +1,7 @@ #!/bin/sh . ../testenv.sh # Generate mixed source and assembly code listing +rm -f TestLanguage # Remove LSW binary so it doesn't hide Cygwin binary. $OBECOMP TestLanguage.mod -m ./TestLanguage >result . ../testresult.sh diff --git a/src/test/confidence/library/test.sh b/src/test/confidence/library/test.sh index e59c074c..91780313 100644 --- a/src/test/confidence/library/test.sh +++ b/src/test/confidence/library/test.sh @@ -1,6 +1,7 @@ #!/bin/sh . ../testenv.sh # Generate mixed source and assembly code listing +rm -f TestLibrary # Remove LSW binary so it doesn't hide Cygwin binary. $OBECOMP TestLibrary.mod -m ./TestLibrary >result . ../testresult.sh diff --git a/src/test/confidence/math/test.sh b/src/test/confidence/math/test.sh index e8b5b827..c64bde88 100644 --- a/src/test/confidence/math/test.sh +++ b/src/test/confidence/math/test.sh @@ -1,5 +1,6 @@ #!/bin/sh . ../testenv.sh +rm -f mathtest # Remove LSW binary so it doesn't hide Cygwin binary. $OBECOMP mathtest.mod -m -OC ./mathtest >result . ../testresult.sh diff --git a/src/test/confidence/out/test.sh b/src/test/confidence/out/test.sh index 48198a64..16bf63be 100644 --- a/src/test/confidence/out/test.sh +++ b/src/test/confidence/out/test.sh @@ -1,10 +1,9 @@ #!/bin/sh . ../testenv.sh +rm -f outtest # Remove LSW binary so it doesn't hide Cygwin binary. $OBECOMP outtest.mod -m -O2 -#../../../../voc outtest.mod -m -O2 ./outtest >result-O2 $OBECOMP outtest.mod -m -OC -#../../../../voc outtest.mod -m -OC ./outtest >result-OC echo --- Testing with Oberon 2 variable model --- >result cat result-O2 >>result diff --git a/src/test/confidence/signal/test.sh b/src/test/confidence/signal/test.sh index fadc1879..b9131862 100755 --- a/src/test/confidence/signal/test.sh +++ b/src/test/confidence/signal/test.sh @@ -1,5 +1,6 @@ #!/bin/sh . ../testenv.sh +rm -f SignalTest # Remove LSW binary so it doesn't hide Cygwin binary. $OBECOMP signal.mod -m ./SignalTest x & sleep 1 diff --git a/src/test/confidence/testenv.sh b/src/test/confidence/testenv.sh index d61ba439..de1630fa 100755 --- a/src/test/confidence/testenv.sh +++ b/src/test/confidence/testenv.sh @@ -11,7 +11,7 @@ fi # Set ibrary paths for darwin and termux(android) export DYLD_LIBRARY_PATH=$1/lib:$DYLD_LIBRARY_PATH export LD_LIBRARY_PATH=$1/lib:$LD_LIBRARY_PATH -rm -f *.o *.obj *.exe *.sym *.c *.h result new.asm +rm -f *.o *.obj *.exe *.sym *.c *.h result new.asm $(basename $PWD) # Under gcc generate assembly source for source change test. # NOTE: The following CFLAGS causes the assembler to write source diff --git a/src/test/confidence/texts/test.sh b/src/test/confidence/texts/test.sh index 6a798eee..d84c0df4 100644 --- a/src/test/confidence/texts/test.sh +++ b/src/test/confidence/texts/test.sh @@ -1,5 +1,6 @@ #!/bin/sh . ../testenv.sh +rm -f testTexts # Remove LSW binary so it doesn't hide Cygwin binary. $OBECOMP testTexts.mod -m ./testTexts >result . ../testresult.sh From 126ef6d479904653d15fe634831952a29371f9c5 Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 28 Oct 2016 19:06:08 +0100 Subject: [PATCH 296/580] Remove o_result variable obsoleted by restoration of alloca usage. --- src/compiler/OPC.Mod | 16 +++------------- src/compiler/OPM.Mod | 4 ++-- src/compiler/OPV.Mod | 12 ++++-------- src/runtime/SYSTEM.h | 5 ----- 4 files changed, 9 insertions(+), 28 deletions(-) diff --git a/src/compiler/OPC.Mod b/src/compiler/OPC.Mod index 72e13291..d30cb712 100644 --- a/src/compiler/OPC.Mod +++ b/src/compiler/OPC.Mod @@ -478,11 +478,10 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) END DefineType; PROCEDURE Prefixed(x: OPT.ConstExt; y: ARRAY OF CHAR): BOOLEAN; - VAR i: INTEGER; r: BOOLEAN; + VAR i: INTEGER; BEGIN i := 0; - WHILE x[i+1] = y[i] DO INC(i) END ; - r := y[i] = 0X; - RETURN r; + WHILE x[i+1] = y[i] DO INC(i) END; + RETURN y[i] = 0X; END Prefixed; PROCEDURE CProcDefs(obj: OPT.Object; vis: INTEGER); @@ -957,15 +956,6 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) IF proc^.vis # OPT.external THEN OPM.WriteString('static ') END ; ProcHeader(proc, TRUE); BegBlk; - - (* If there will be a result, provide a result variable. *) - IF proc^.typ # OPT.notyp THEN - BegStat; - Ident(proc^.typ^.strobj); - OPM.WriteString(" _o_result;"); - OPM.WriteLn; - END; - scope := proc^.scope; IdentList(scope^.scope, 0); IF ~scope^.leaf THEN (* declare intermediate procedure scope record variable*) diff --git a/src/compiler/OPM.Mod b/src/compiler/OPM.Mod index 68215490..e17c4614 100644 --- a/src/compiler/OPM.Mod +++ b/src/compiler/OPM.Mod @@ -236,14 +236,14 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) IF Platform.ArgCount = 1 THEN LogWLn; LogWStr("Oberon-2 compiler v"); LogWStr(Configuration.versionLong); LogW("."); LogWLn; - LogWStr("Based on Ofront by Software Templ OEG."); LogWLn; + LogWStr("Based on Ofront by J. Templ and Software Templ OEG."); LogWLn; LogWStr("Further development by Norayr Chilingarian, David Brown and others."); LogWLn; LogWLn; LogWStr("Usage:"); LogWLn; LogWLn; LogWStr(" "); LogWStr(Configuration.name); LogWStr(" options {files {options}}."); LogWLn; LogWLn; - LogWStr('Where options = ["-" {option} ].'); LogWLn; + LogWStr('Options:'); LogWLn; LogWLn; LogWStr(" Run time safety"); LogWLn; LogWStr(" -p Initialise pointers to NIL. On by default."); LogWLn; diff --git a/src/compiler/OPV.Mod b/src/compiler/OPV.Mod index dd089baf..83c451c3 100644 --- a/src/compiler/OPV.Mod +++ b/src/compiler/OPV.Mod @@ -876,19 +876,15 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 | OPT.Nreturn: IF OPM.level = 0 THEN IF OPM.mainprog IN OPM.Options THEN OPM.WriteString("__FINI") ELSE OPM.WriteString("__ENDMOD") END ELSE + OPC.ExitProc(outerProc, FALSE, FALSE); + OPM.WriteString("return"); IF n^.left # NIL THEN - (* Make local copy of result before ExitProc deletes dynamic vars *) - OPM.WriteString("_o_result = "); + OPM.Write(Blank); IF (n^.left^.typ^.form = OPT.Pointer) & (n^.obj^.typ # n^.left^.typ) THEN OPM.WriteString("(void*)"); expr(n^.left, 10) ELSE expr(n^.left, MinPrec) - END; - OPM.WriteString(";"); OPM.WriteLn; OPC.BegStat; - OPC.ExitProc(outerProc, FALSE, FALSE); - OPM.WriteString("return _o_result"); - ELSE - OPM.WriteString("return"); + END END END | OPT.Nwith: IfStat(n, n^.subcl = 0, outerProc) diff --git a/src/runtime/SYSTEM.h b/src/runtime/SYSTEM.h index 165b5ec8..cb7c8815 100644 --- a/src/runtime/SYSTEM.h +++ b/src/runtime/SYSTEM.h @@ -156,10 +156,6 @@ static inline int __str_cmp(CHAR *x, CHAR *y){ #define __COPY(s, d, n) {char*_a=(void*)s,*_b=(void*)d; LONGINT _i=0,_t=n-1; \ while(_i<_t&&((_b[_i]=_a[_i])!=0)){_i++;};_b[_i]=0;} #define __DUPARR(v, t) v=(void*)memcpy(v##__copy,v,sizeof(t)) - -//#define __DUP(x, l, t) x=(void*)memcpy((void*)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) -//#define __DEL(x) Platform_OSFree((address)x) - #define __DUP(x, l, t) x=(void*)memcpy(alloca(l*sizeof(t)),x,l*sizeof(t)) #define __DEL(x) @@ -168,7 +164,6 @@ static inline int __str_cmp(CHAR *x, CHAR *y){ #define __VAL(t, x) (*(t*)&(x)) - #define __GET(a, x, t) x=*(t*)(address)(a) #define __PUT(a, x, t) *(t*)(address)(a)=x From 6a4748e2af674b8103dc6250a0b25e2ebe31d62d Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 28 Oct 2016 20:06:30 +0100 Subject: [PATCH 297/580] Update bootstrap and fix source change tests. Typo in command ine help. --- bootstrap/SYSTEM.h | 5 - bootstrap/unix-44/Files.c | 46 +++----- bootstrap/unix-44/Heap.c | 22 +--- bootstrap/unix-44/Modules.c | 11 +- bootstrap/unix-44/OPB.c | 63 +++-------- bootstrap/unix-44/OPC.c | 41 ++----- bootstrap/unix-44/OPM.c | 41 ++----- bootstrap/unix-44/OPP.c | 4 +- bootstrap/unix-44/OPS.c | 15 +-- bootstrap/unix-44/OPT.c | 99 +++++------------ bootstrap/unix-44/OPV.c | 99 ++++++----------- bootstrap/unix-44/Out.c | 8 +- bootstrap/unix-44/Platform.c | 176 ++++++++---------------------- bootstrap/unix-44/Reals.c | 23 +--- bootstrap/unix-44/Strings.c | 39 +++---- bootstrap/unix-44/Texts.c | 24 +--- bootstrap/unix-48/Files.c | 46 +++----- bootstrap/unix-48/Heap.c | 22 +--- bootstrap/unix-48/Modules.c | 11 +- bootstrap/unix-48/OPB.c | 63 +++-------- bootstrap/unix-48/OPC.c | 41 ++----- bootstrap/unix-48/OPM.c | 41 ++----- bootstrap/unix-48/OPP.c | 4 +- bootstrap/unix-48/OPS.c | 15 +-- bootstrap/unix-48/OPT.c | 99 +++++------------ bootstrap/unix-48/OPV.c | 99 ++++++----------- bootstrap/unix-48/Out.c | 8 +- bootstrap/unix-48/Platform.c | 176 ++++++++---------------------- bootstrap/unix-48/Reals.c | 23 +--- bootstrap/unix-48/Strings.c | 39 +++---- bootstrap/unix-48/Texts.c | 24 +--- bootstrap/unix-88/Files.c | 46 +++----- bootstrap/unix-88/Heap.c | 22 +--- bootstrap/unix-88/Modules.c | 11 +- bootstrap/unix-88/OPB.c | 63 +++-------- bootstrap/unix-88/OPC.c | 41 ++----- bootstrap/unix-88/OPM.c | 41 ++----- bootstrap/unix-88/OPP.c | 4 +- bootstrap/unix-88/OPS.c | 15 +-- bootstrap/unix-88/OPT.c | 99 +++++------------ bootstrap/unix-88/OPV.c | 99 ++++++----------- bootstrap/unix-88/Out.c | 8 +- bootstrap/unix-88/Platform.c | 176 ++++++++---------------------- bootstrap/unix-88/Reals.c | 23 +--- bootstrap/unix-88/Strings.c | 39 +++---- bootstrap/unix-88/Texts.c | 24 +--- bootstrap/windows-48/Files.c | 46 +++----- bootstrap/windows-48/Heap.c | 22 +--- bootstrap/windows-48/Modules.c | 11 +- bootstrap/windows-48/OPB.c | 63 +++-------- bootstrap/windows-48/OPC.c | 41 ++----- bootstrap/windows-48/OPM.c | 41 ++----- bootstrap/windows-48/OPP.c | 4 +- bootstrap/windows-48/OPS.c | 15 +-- bootstrap/windows-48/OPT.c | 99 +++++------------ bootstrap/windows-48/OPV.c | 99 ++++++----------- bootstrap/windows-48/Out.c | 8 +- bootstrap/windows-48/Platform.c | 188 +++++++++----------------------- bootstrap/windows-48/Reals.c | 23 +--- bootstrap/windows-48/Strings.c | 39 +++---- bootstrap/windows-48/Texts.c | 24 +--- bootstrap/windows-88/Files.c | 46 +++----- bootstrap/windows-88/Heap.c | 22 +--- bootstrap/windows-88/Modules.c | 11 +- bootstrap/windows-88/OPB.c | 63 +++-------- bootstrap/windows-88/OPC.c | 41 ++----- bootstrap/windows-88/OPM.c | 41 ++----- bootstrap/windows-88/OPP.c | 4 +- bootstrap/windows-88/OPS.c | 15 +-- bootstrap/windows-88/OPT.c | 99 +++++------------ bootstrap/windows-88/OPV.c | 99 ++++++----------- bootstrap/windows-88/Out.c | 8 +- bootstrap/windows-88/Platform.c | 188 +++++++++----------------------- bootstrap/windows-88/Reals.c | 23 +--- bootstrap/windows-88/Strings.c | 39 +++---- bootstrap/windows-88/Texts.c | 24 +--- src/compiler/OPM.Mod | 2 +- src/tools/make/sourcechanges.sh | 4 +- 78 files changed, 1026 insertions(+), 2564 deletions(-) diff --git a/bootstrap/SYSTEM.h b/bootstrap/SYSTEM.h index 165b5ec8..cb7c8815 100644 --- a/bootstrap/SYSTEM.h +++ b/bootstrap/SYSTEM.h @@ -156,10 +156,6 @@ static inline int __str_cmp(CHAR *x, CHAR *y){ #define __COPY(s, d, n) {char*_a=(void*)s,*_b=(void*)d; LONGINT _i=0,_t=n-1; \ while(_i<_t&&((_b[_i]=_a[_i])!=0)){_i++;};_b[_i]=0;} #define __DUPARR(v, t) v=(void*)memcpy(v##__copy,v,sizeof(t)) - -//#define __DUP(x, l, t) x=(void*)memcpy((void*)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) -//#define __DEL(x) Platform_OSFree((address)x) - #define __DUP(x, l, t) x=(void*)memcpy(alloca(l*sizeof(t)),x,l*sizeof(t)) #define __DEL(x) @@ -168,7 +164,6 @@ static inline int __str_cmp(CHAR *x, CHAR *y){ #define __VAL(t, x) (*(t*)&(x)) - #define __GET(a, x, t) x=*(t*)(address)(a) #define __PUT(a, x, t) *(t*)(address)(a)=x diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index e0fc2e86..ddeec08e 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -317,14 +317,11 @@ void Files_Close (Files_File f) int32 Files_Length (Files_File f) { - int32 _o_result; - _o_result = f->len; - return _o_result; + return f->len; } Files_File Files_New (CHAR *name, LONGINT name__len) { - Files_File _o_result; Files_File f = NIL; __DUP(name, name__len, CHAR); __NEW(f, Files_FileDesc); @@ -335,9 +332,8 @@ Files_File Files_New (CHAR *name, LONGINT name__len) f->len = 0; f->pos = 0; f->swapper = -1; - _o_result = f; __DEL(name); - return _o_result; + return f; } static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len) @@ -385,7 +381,6 @@ static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len) static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len) { - BOOLEAN _o_result; int16 i; CHAR ch; i = 0; @@ -394,13 +389,11 @@ static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len) i += 1; ch = name[i]; } - _o_result = ch == '/'; - return _o_result; + return ch == '/'; } static Files_File Files_CacheEntry (Platform_FileIdentity identity) { - Files_File _o_result; Files_File f = NIL; int16 i, error; f = Files_files; @@ -419,18 +412,15 @@ static Files_File Files_CacheEntry (Platform_FileIdentity identity) f->identity = identity; error = Platform_Size(f->fd, &f->len); } - _o_result = f; - return _o_result; + return f; } f = f->next; } - _o_result = NIL; - return _o_result; + return NIL; } Files_File Files_Old (CHAR *name, LONGINT name__len) { - Files_File _o_result; Files_File f = NIL; int32 fd; int16 pos; @@ -470,9 +460,8 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) error = Platform_Identify(fd, &identity, Platform_FileIdentity__typ); f = Files_CacheEntry(identity); if (f != NIL) { - _o_result = f; __DEL(name); - return _o_result; + return f; } else { __NEW(f, Files_FileDesc); Heap_RegisterFinalizer((void*)f, Files_Finalize); @@ -488,23 +477,20 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) f->next = Files_files; Files_files = f; Heap_FileCount += 1; - _o_result = f; __DEL(name); - return _o_result; + return f; } } else if (dir[0] == 0x00) { - _o_result = NIL; __DEL(name); - return _o_result; + return NIL; } else { Files_MakeFileName(dir, 256, name, name__len, (void*)path, 256); Files_ScanPath(&pos, (void*)dir, 256); } } } else { - _o_result = NIL; __DEL(name); - return _o_result; + return NIL; } __RETCHK; } @@ -544,9 +530,7 @@ void Files_GetDate (Files_File f, int32 *t, int32 *d) int32 Files_Pos (Files_Rider *r, address *r__typ) { - int32 _o_result; - _o_result = (*r).org + (*r).offset; - return _o_result; + return (*r).org + (*r).offset; } void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos) @@ -673,9 +657,7 @@ void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x Files_File Files_Base (Files_Rider *r, address *r__typ) { - Files_File _o_result; - _o_result = (*r).buf->f; - return _o_result; + return (*r).buf->f; } void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x) @@ -759,17 +741,23 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int error = Platform_Rename((void*)old, old__len, (void*)new, new__len); if (!Platform_DifferentFilesystems(error)) { *res = error; + __DEL(old); + __DEL(new); return; } else { error = Platform_OldRO((void*)old, old__len, &fdold); if (error != 0) { *res = 2; + __DEL(old); + __DEL(new); return; } error = Platform_New((void*)new, new__len, &fdnew); if (error != 0) { error = Platform_Close(fdold); *res = 3; + __DEL(old); + __DEL(new); return; } error = Platform_Read(fdold, (address)buf, 4096, &n); diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index 37062b0b..4bc74170 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -127,7 +127,6 @@ void Heap_Unlock (void) SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) { - SYSTEM_PTR _o_result; Heap_Module m; if (__STRCMP(name, "Heap") == 0) { __SYSNEW(m, 48); @@ -141,8 +140,7 @@ SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) m->enumPtrs = enumPtrs; m->next = (Heap_Module)(address)Heap_modules; Heap_modules = (SYSTEM_PTR)m; - _o_result = (void*)m; - return _o_result; + return (void*)m; } void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) @@ -172,7 +170,6 @@ void Heap_INCREF (Heap_Module m) static int32 Heap_NewChunk (int32 blksz) { - int32 _o_result; int32 chnk; chnk = Heap_OSAllocate(blksz + 12); if (chnk != 0) { @@ -184,8 +181,7 @@ static int32 Heap_NewChunk (int32 blksz) Heap_bigBlocks = chnk + 12; Heap_heapsize += blksz; } - _o_result = chnk; - return _o_result; + return chnk; } static void Heap_ExtendHeap (int32 blksz) @@ -219,7 +215,6 @@ static void Heap_ExtendHeap (int32 blksz) SYSTEM_PTR Heap_NEWREC (int32 tag) { - SYSTEM_PTR _o_result; int32 i, i0, di, blksz, restsize, t, adr, end, next, prev; SYSTEM_PTR new; Heap_Lock(); @@ -267,12 +262,10 @@ SYSTEM_PTR Heap_NEWREC (int32 tag) new = Heap_NEWREC(tag); } Heap_Unlock(); - _o_result = new; - return _o_result; + return new; } else { Heap_Unlock(); - _o_result = NIL; - return _o_result; + return NIL; } } __GET(adr + 4, t, int32); @@ -320,13 +313,11 @@ SYSTEM_PTR Heap_NEWREC (int32 tag) __PUT(adr + 8, 0, int32); Heap_allocated += blksz; Heap_Unlock(); - _o_result = (SYSTEM_PTR)(address)(adr + 4); - return _o_result; + return (SYSTEM_PTR)(address)(adr + 4); } SYSTEM_PTR Heap_NEWBLK (int32 size) { - SYSTEM_PTR _o_result; int32 blksz, tag; SYSTEM_PTR new; Heap_Lock(); @@ -338,8 +329,7 @@ SYSTEM_PTR Heap_NEWBLK (int32 size) __PUT(tag + 4, -4, int32); __PUT((int32)(address)new - 4, tag, int32); Heap_Unlock(); - _o_result = new; - return _o_result; + return new; } static void Heap_Mark (int32 q) diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index 45b91f7f..bb6774da 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -74,7 +74,6 @@ static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len) Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len) { - Modules_Module _o_result; Modules_Module m = NIL; CHAR bodyname[64]; Modules_Command body; @@ -93,14 +92,12 @@ Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len) Modules_Append((void*)Modules_resMsg, 256, name, name__len); Modules_Append((void*)Modules_resMsg, 256, (CHAR*)"\" not found", 12); } - _o_result = m; __DEL(name); - return _o_result; + return m; } Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len) { - Modules_Command _o_result; Modules_Cmd c = NIL; __DUP(name, name__len, CHAR); c = mod->cmds; @@ -110,9 +107,8 @@ Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT nam if (c != NIL) { Modules_res = 0; Modules_resMsg[0] = 0x00; - _o_result = c->cmd; __DEL(name); - return _o_result; + return c->cmd; } else { Modules_res = 2; __MOVE(" command \"", Modules_resMsg, 11); @@ -121,9 +117,8 @@ Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT nam Modules_Append((void*)Modules_resMsg, 256, (CHAR*)".", 2); Modules_Append((void*)Modules_resMsg, 256, name, name__len); Modules_Append((void*)Modules_resMsg, 256, (CHAR*)"\" not found", 12); - _o_result = NIL; __DEL(name); - return _o_result; + return NIL; } __RETCHK; } diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index 038bd92c..dff6adc6 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -74,7 +74,6 @@ static void OPB_err (int16 n) OPT_Node OPB_NewLeaf (OPT_Object obj) { - OPT_Node _o_result; OPT_Node node = NIL; switch (obj->mode) { case 1: @@ -102,8 +101,7 @@ OPT_Node OPB_NewLeaf (OPT_Object obj) } node->obj = obj; node->typ = obj->typ; - _o_result = node; - return _o_result; + return node; } void OPB_Construct (int8 class, OPT_Node *x, OPT_Node y) @@ -131,34 +129,27 @@ void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y) static int16 OPB_BoolToInt (BOOLEAN b) { - int16 _o_result; if (b) { - _o_result = 1; - return _o_result; + return 1; } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } static BOOLEAN OPB_IntToBool (int64 i) { - BOOLEAN _o_result; - _o_result = i != 0; - return _o_result; + return i != 0; } OPT_Node OPB_NewBoolConst (BOOLEAN boolval) { - OPT_Node _o_result; OPT_Node x = NIL; x = OPT_NewNode(7); x->typ = OPT_booltyp; x->conval = OPT_NewConst(); x->conval->intval = OPB_BoolToInt(boolval); - _o_result = x; - return _o_result; + return x; } void OPB_OptIf (OPT_Node *x) @@ -198,26 +189,22 @@ void OPB_OptIf (OPT_Node *x) OPT_Node OPB_Nil (void) { - OPT_Node _o_result; OPT_Node x = NIL; x = OPT_NewNode(7); x->typ = OPT_niltyp; x->conval = OPT_NewConst(); x->conval->intval = 0; - _o_result = x; - return _o_result; + return x; } OPT_Node OPB_EmptySet (void) { - OPT_Node _o_result; OPT_Node x = NIL; x = OPT_NewNode(7); x->typ = OPT_settyp; x->conval = OPT_NewConst(); x->conval->setval = 0x0; - _o_result = x; - return _o_result; + return x; } static void OPB_SetIntType (OPT_Node node) @@ -238,32 +225,27 @@ static void OPB_SetSetType (OPT_Node node) OPT_Node OPB_NewIntConst (int64 intval) { - OPT_Node _o_result; OPT_Node x = NIL; x = OPT_NewNode(7); x->conval = OPT_NewConst(); x->conval->intval = intval; OPB_SetIntType(x); - _o_result = x; - return _o_result; + return x; } OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ) { - OPT_Node _o_result; OPT_Node x = NIL; x = OPT_NewNode(7); x->conval = OPT_NewConst(); x->conval->realval = realval; x->typ = typ; x->conval->intval = -1; - _o_result = x; - return _o_result; + return x; } OPT_Node OPB_NewString (OPS_String str, int64 len) { - OPT_Node _o_result; OPT_Node x = NIL; x = OPT_NewNode(7); x->conval = OPT_NewConst(); @@ -272,8 +254,7 @@ OPT_Node OPB_NewString (OPS_String str, int64 len) x->conval->intval2 = OPM_Longint(len); x->conval->ext = OPT_NewExt(); __COPY(str, *x->conval->ext, 256); - _o_result = x; - return _o_result; + return x; } static void OPB_CharToString (OPT_Node n) @@ -305,9 +286,7 @@ static void OPB_BindNodes (int8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y) static BOOLEAN OPB_NotVar (OPT_Node x) { - BOOLEAN _o_result; - _o_result = (x->class >= 7 && ((x->class != 11 || x->subcl != 29) || x->left->class >= 7)); - return _o_result; + return (x->class >= 7 && ((x->class != 11 || x->subcl != 29) || x->left->class >= 7)); } void OPB_DeRef (OPT_Node *x) @@ -489,7 +468,6 @@ void OPB_In (OPT_Node *x, OPT_Node y) static int64 OPB_log (int64 x) { - int64 _o_result; OPB_exp = 0; if (x > 0) { while (!__ODD(x)) { @@ -497,8 +475,7 @@ static int64 OPB_log (int64 x) OPB_exp += 1; } } - _o_result = x; - return _o_result; + return x; } static void OPB_CheckRealType (int16 f, int16 nr, OPT_Const x) @@ -529,14 +506,12 @@ static OPT_Node NewOp__29 (int8 op, OPT_Struct typ, OPT_Node z); static OPT_Node NewOp__29 (int8 op, OPT_Struct typ, OPT_Node z) { - OPT_Node _o_result; OPT_Node node = NIL; node = OPT_NewNode(11); node->subcl = op; node->typ = typ; node->left = z; - _o_result = node; - return _o_result; + return node; } void OPB_MOp (int8 op, OPT_Node *x) @@ -775,7 +750,6 @@ static int16 ConstCmp__14 (void); static int16 ConstCmp__14 (void) { - int16 _o_result; int16 res; switch (*ConstOp__13_s->f) { case 0: @@ -836,8 +810,7 @@ static int16 ConstCmp__14 (void) break; } (*ConstOp__13_s->x)->typ = OPT_booltyp; - _o_result = res; - return _o_result; + return res; } static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) @@ -1202,7 +1175,6 @@ static void NewOp__39 (int8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y) static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) { - BOOLEAN _o_result; BOOLEAN ok, xCharArr, yCharArr; xCharArr = (__IN((*x)->typ->comp, 0x0c, 32) && (*x)->typ->BaseTyp->form == 3) || *Op__38_s->f == 8; yCharArr = (__IN((*y)->typ->comp, 0x0c, 32) && (*y)->typ->BaseTyp->form == 3) || *Op__38_s->g == 8; @@ -1228,8 +1200,7 @@ static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) OPB_Index(&*x, OPB_NewIntConst(0)); } } - _o_result = ok; - return _o_result; + return ok; } void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) @@ -2016,14 +1987,12 @@ static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right) { - OPT_Node _o_result; OPT_Node node = NIL; node = OPT_NewNode(class); node->subcl = subcl; node->left = left; node->right = right; - _o_result = node; - return _o_result; + return node; } void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 20c369e9..9401b9a7 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -157,19 +157,16 @@ static void OPC_Str1 (CHAR *s, LONGINT s__len, int32 x) static int16 OPC_Length (CHAR *s, LONGINT s__len) { - int16 _o_result; int16 i; i = 0; while (s[__X(i, s__len)] != 0x00) { i += 1; } - _o_result = i; - return _o_result; + return i; } static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len) { - int16 _o_result; int16 i, h; i = 0; h = 0; @@ -177,8 +174,7 @@ static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len) h = 3 * h + (int16)s[__X(i, s__len)]; i += 1; } - _o_result = (int)__MOD(h, 105); - return _o_result; + return (int)__MOD(h, 105); } void OPC_Ident (OPT_Object obj) @@ -320,9 +316,7 @@ void OPC_Andent (OPT_Struct typ) static BOOLEAN OPC_Undefined (OPT_Object obj) { - BOOLEAN _o_result; - _o_result = obj->name[0] == 0x00 || (((obj->mnolev >= 0 && obj->linkadr != (3 + OPM_currFile))) && obj->linkadr != 2); - return _o_result; + return obj->name[0] == 0x00 || (((obj->mnolev >= 0 && obj->linkadr != (3 + OPM_currFile))) && obj->linkadr != 2); } static void OPC_DeclareBase (OPT_Object dcl) @@ -391,13 +385,11 @@ static void OPC_DeclareBase (OPT_Object dcl) int32 OPC_NofPtrs (OPT_Struct typ) { - int32 _o_result; OPT_Object fld = NIL; OPT_Struct btyp = NIL; int32 n; if ((typ->form == 11 && typ->sysflag == 0)) { - _o_result = 1; - return _o_result; + return 1; } else if ((typ->comp == 4 && __MASK(typ->sysflag, -256) == 0)) { btyp = typ->BaseTyp; if (btyp != NIL) { @@ -414,8 +406,7 @@ int32 OPC_NofPtrs (OPT_Struct typ) } fld = fld->link; } - _o_result = n; - return _o_result; + return n; } else if (typ->comp == 2) { btyp = typ->BaseTyp; n = typ->n; @@ -423,11 +414,9 @@ int32 OPC_NofPtrs (OPT_Struct typ) n = btyp->n * n; btyp = btyp->BaseTyp; } - _o_result = OPC_NofPtrs(btyp) * n; - return _o_result; + return OPC_NofPtrs(btyp) * n; } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } @@ -608,7 +597,6 @@ static void OPC_DeclareTProcs (OPT_Object obj, BOOLEAN *empty) OPT_Object OPC_BaseTProc (OPT_Object obj) { - OPT_Object _o_result; OPT_Struct typ = NIL, base = NIL; int32 mno; typ = obj->link->typ; @@ -622,8 +610,7 @@ OPT_Object OPC_BaseTProc (OPT_Object obj) base = typ->BaseTyp; } OPT_FindField(obj->name, typ, &obj); - _o_result = obj; - return _o_result; + return obj; } static void OPC_DefineTProcMacros (OPT_Object obj, BOOLEAN *empty) @@ -734,18 +721,14 @@ static void OPC_DefineType (OPT_Struct str) static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len) { - BOOLEAN _o_result; int16 i; - BOOLEAN r; __DUP(y, y__len, CHAR); i = 0; while ((*x)[__X(i + 1, 256)] == y[__X(i, y__len)]) { i += 1; } - r = y[__X(i, y__len)] == 0x00; - _o_result = r; __DEL(y); - return _o_result; + return y[__X(i, y__len)] == 0x00; } static void OPC_CProcDefs (OPT_Object obj, int16 vis) @@ -1455,12 +1438,6 @@ void OPC_EnterProc (OPT_Object proc) } OPC_ProcHeader(proc, 1); OPC_BegBlk(); - if (proc->typ != OPT_notyp) { - OPC_BegStat(); - OPC_Ident(proc->typ->strobj); - OPM_WriteString((CHAR*)" _o_result;", 12); - OPM_WriteLn(); - } scope = proc->scope; OPC_IdentList(scope->scope, 0); if (!scope->leaf) { diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index d0b09b3d..458de3f2 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -124,33 +124,25 @@ void OPM_LogWLn (void) int64 OPM_SignedMaximum (int32 bytecount) { - int64 _o_result; int64 result; result = 1; result = __LSH(result, __ASHL(bytecount, 3) - 1, 64); - _o_result = result - 1; - return _o_result; + return result - 1; } int64 OPM_SignedMinimum (int32 bytecount) { - int64 _o_result; - _o_result = -OPM_SignedMaximum(bytecount) - 1; - return _o_result; + return -OPM_SignedMaximum(bytecount) - 1; } int32 OPM_Longint (int64 n) { - int32 _o_result; - _o_result = __VAL(int32, n); - return _o_result; + return __VAL(int32, n); } int16 OPM_Integer (int64 n) { - int16 _o_result; - _o_result = __VAL(int16, n); - return _o_result; + return __VAL(int16, n); } static void OPM_ScanOptions (CHAR *s, LONGINT s__len) @@ -266,7 +258,6 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len) BOOLEAN OPM_OpenPar (void) { - BOOLEAN _o_result; CHAR s[256]; if (Platform_ArgCount == 1) { OPM_LogWLn(); @@ -274,7 +265,7 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWStr(Configuration_versionLong, 75); OPM_LogW('.'); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Based on Ofront by Software Templ OEG.", 39); + OPM_LogWStr((CHAR*)"Based on Ofront by J. Templ and Software Templ OEG.", 52); OPM_LogWLn(); OPM_LogWStr((CHAR*)"Further development by Norayr Chilingarian, David Brown and others.", 68); OPM_LogWLn(); @@ -287,7 +278,7 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWStr((CHAR*)" options {files {options}}.", 28); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Where options = [\"-\" {option} ].", 33); + OPM_LogWStr((CHAR*)"Options:", 9); OPM_LogWLn(); OPM_LogWLn(); OPM_LogWStr((CHAR*)" Run time safety", 18); @@ -345,7 +336,7 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWLn(); OPM_LogWStr((CHAR*)" -A48 32 bit addresses, 64 bit alignment (e.g. Windows 32 bit on x86, linux 32 bit on arm).", 97); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -A88 66 bit addresses, 64 bit alignment (e.g. 64 bit platforms).", 71); + OPM_LogWStr((CHAR*)" -A88 64 bit addresses, 64 bit alignment (e.g. 64 bit platforms).", 71); OPM_LogWLn(); OPM_LogWLn(); OPM_LogWStr((CHAR*)"All options are off by default, except where noted above.", 58); @@ -356,8 +347,7 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWLn(); OPM_LogWStr((CHAR*)"Repeating an option toggles its value.", 39); OPM_LogWLn(); - _o_result = 0; - return _o_result; + return 0; } else { OPM_AddressSize = 4; OPM_GetAlignment(&OPM_Alignment); @@ -376,8 +366,7 @@ BOOLEAN OPM_OpenPar (void) OPM_GlobalAlignment = OPM_Alignment; __COPY(OPM_Model, OPM_GlobalModel, 10); OPM_GlobalOptions = OPM_Options; - _o_result = 1; - return _o_result; + return 1; } __RETCHK; } @@ -741,20 +730,16 @@ void OPM_SymRCh (CHAR *ch) int32 OPM_SymRInt (void) { - int32 _o_result; int32 k; Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&k, 4); - _o_result = k; - return _o_result; + return k; } int64 OPM_SymRInt64 (void) { - int64 _o_result; int64 k; Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&k, 8); - _o_result = k; - return _o_result; + return k; } void OPM_SymRSet (uint64 *s) @@ -797,9 +782,7 @@ void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done) BOOLEAN OPM_eofSF (void) { - BOOLEAN _o_result; - _o_result = OPM_oldSF.eof; - return _o_result; + return OPM_oldSF.eof; } void OPM_SymWCh (CHAR ch) diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index 90f35dd5..5e181cb9 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -901,7 +901,6 @@ static void OPP_Receiver (int8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct static BOOLEAN OPP_Extends (OPT_Struct x, OPT_Struct b) { - BOOLEAN _o_result; if ((b->form == 11 && x->form == 11)) { b = b->BaseTyp; x = x->BaseTyp; @@ -911,8 +910,7 @@ static BOOLEAN OPP_Extends (OPT_Struct x, OPT_Struct b) x = x->BaseTyp; } while (!(x == NIL || x == b)); } - _o_result = x == b; - return _o_result; + return x == b; } static struct ProcedureDeclaration__16 { diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index b3c52f3c..5a34663d 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -97,7 +97,6 @@ static LONGREAL Ten__9 (int16 e); static LONGREAL Ten__9 (int16 e) { - LONGREAL _o_result; LONGREAL x, p; x = (LONGREAL)1; p = (LONGREAL)10; @@ -110,23 +109,18 @@ static LONGREAL Ten__9 (int16 e) p = p * p; } } - _o_result = x; - return _o_result; + return x; } static int16 Ord__7 (CHAR ch, BOOLEAN hex) { - int16 _o_result; if (ch <= '9') { - _o_result = (int16)ch - 48; - return _o_result; + return (int16)ch - 48; } else if (hex) { - _o_result = ((int16)ch - 65) + 10; - return _o_result; + return ((int16)ch - 65) + 10; } else { OPS_err(2); - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } @@ -324,6 +318,7 @@ void OPS_Get (int8 *sym) while (OPS_ch <= ' ') { if (OPS_ch == 0x00) { *sym = 64; + Get__1_s = _s.lnk; return; } else { OPM_Get(&OPS_ch); diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index 5b0f725b..abf8a8f1 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -179,7 +179,6 @@ static void OPT_err (int16 n) int16 OPT_IntSize (int64 n) { - int16 _o_result; int16 bytes; if (n < 0) { n = -(n + 1); @@ -188,77 +187,59 @@ int16 OPT_IntSize (int64 n) while ((bytes < 8 && __ASH(n, -(__ASHL(bytes, 3) - 1)) != 0)) { bytes += 1; } - _o_result = bytes; - return _o_result; + return bytes; } OPT_Struct OPT_IntType (int32 size) { - OPT_Struct _o_result; if (size <= OPT_int8typ->size) { - _o_result = OPT_int8typ; - return _o_result; + return OPT_int8typ; } if (size <= OPT_int16typ->size) { - _o_result = OPT_int16typ; - return _o_result; + return OPT_int16typ; } if (size <= OPT_int32typ->size) { - _o_result = OPT_int32typ; - return _o_result; + return OPT_int32typ; } - _o_result = OPT_int64typ; - return _o_result; + return OPT_int64typ; } OPT_Struct OPT_SetType (int32 size) { - OPT_Struct _o_result; if (size == OPT_set32typ->size) { - _o_result = OPT_set32typ; - return _o_result; + return OPT_set32typ; } - _o_result = OPT_set64typ; - return _o_result; + return OPT_set64typ; } OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir) { - OPT_Struct _o_result; int16 i; __ASSERT(x->form == 4, 0); __ASSERT(x->BaseTyp == OPT_undftyp, 0); __ASSERT(dir == 1 || dir == -1, 0); if (dir > 0) { if (x->size < OPT_sinttyp->size) { - _o_result = OPT_sinttyp; - return _o_result; + return OPT_sinttyp; } if (x->size < OPT_inttyp->size) { - _o_result = OPT_inttyp; - return _o_result; + return OPT_inttyp; } if (x->size < OPT_linttyp->size) { - _o_result = OPT_linttyp; - return _o_result; + return OPT_linttyp; } - _o_result = OPT_int64typ; - return _o_result; + return OPT_int64typ; } else { if (x->size > OPT_linttyp->size) { - _o_result = OPT_linttyp; - return _o_result; + return OPT_linttyp; } if (x->size > OPT_inttyp->size) { - _o_result = OPT_inttyp; - return _o_result; + return OPT_inttyp; } if (x->size > OPT_sinttyp->size) { - _o_result = OPT_sinttyp; - return _o_result; + return OPT_sinttyp; } - _o_result = OPT_int8typ; - return _o_result; + return OPT_int8typ; } __RETCHK; } @@ -285,7 +266,6 @@ void OPT_Align (int32 *adr, int32 base) int32 OPT_SizeAlignment (int32 size) { - int32 _o_result; int32 alignment; if (size < OPM_Alignment) { alignment = 1; @@ -295,13 +275,11 @@ int32 OPT_SizeAlignment (int32 size) } else { alignment = OPM_Alignment; } - _o_result = alignment; - return _o_result; + return alignment; } int32 OPT_BaseAlignment (OPT_Struct typ) { - int32 _o_result; int32 alignment; if (typ->form == 13) { if (typ->comp == 4) { @@ -312,8 +290,7 @@ int32 OPT_BaseAlignment (OPT_Struct typ) } else { alignment = OPT_SizeAlignment(typ->size); } - _o_result = alignment; - return _o_result; + return alignment; } void OPT_TypSize (OPT_Struct typ) @@ -389,25 +366,20 @@ void OPT_TypSize (OPT_Struct typ) OPT_Const OPT_NewConst (void) { - OPT_Const _o_result; OPT_Const const_ = NIL; __NEW(const_, OPT_ConstDesc); - _o_result = const_; - return _o_result; + return const_; } OPT_Object OPT_NewObj (void) { - OPT_Object _o_result; OPT_Object obj = NIL; __NEW(obj, OPT_ObjDesc); - _o_result = obj; - return _o_result; + return obj; } OPT_Struct OPT_NewStr (int8 form, int8 comp) { - OPT_Struct _o_result; OPT_Struct typ = NIL; __NEW(typ, OPT_StrDesc); typ->form = form; @@ -418,27 +390,22 @@ OPT_Struct OPT_NewStr (int8 form, int8 comp) } typ->size = -1; typ->BaseTyp = OPT_undftyp; - _o_result = typ; - return _o_result; + return typ; } OPT_Node OPT_NewNode (int8 class) { - OPT_Node _o_result; OPT_Node node = NIL; __NEW(node, OPT_NodeDesc); node->class = class; - _o_result = node; - return _o_result; + return node; } OPT_ConstExt OPT_NewExt (void) { - OPT_ConstExt _o_result; OPT_ConstExt ext = NIL; ext = __NEWARR(NIL, 1, 1, 1, 0, 256); - _o_result = ext; - return _o_result; + return ext; } void OPT_OpenScope (int8 level, OPT_Object owner) @@ -1120,7 +1087,6 @@ static void OPT_InSign (int8 mno, OPT_Struct *res, OPT_Object *par) static OPT_Object OPT_InFld (void) { - OPT_Object _o_result; int32 tag; OPT_Object obj = NIL; tag = OPT_impCtxt.nextTag; @@ -1146,13 +1112,11 @@ static OPT_Object OPT_InFld (void) obj->vis = 0; obj->adr = OPM_SymRInt(); } - _o_result = obj; - return _o_result; + return obj; } static OPT_Object OPT_InTProc (int8 mno) { - OPT_Object _o_result; int32 tag; OPT_Object obj = NIL; tag = OPT_impCtxt.nextTag; @@ -1174,22 +1138,17 @@ static OPT_Object OPT_InTProc (int8 mno) obj->vis = 0; obj->adr = __ASHL(OPM_SymRInt(), 16); } - _o_result = obj; - return _o_result; + return obj; } static OPT_Struct OPT_InTyp (int32 tag) { - OPT_Struct _o_result; if (tag == 4) { - _o_result = OPT_IntType(OPM_SymRInt()); - return _o_result; + return OPT_IntType(OPM_SymRInt()); } else if (tag == 7) { - _o_result = OPT_SetType(OPM_SymRInt()); - return _o_result; + return OPT_SetType(OPM_SymRInt()); } else { - _o_result = OPT_impCtxt.ref[__X(tag, 255)]; - return _o_result; + return OPT_impCtxt.ref[__X(tag, 255)]; } __RETCHK; } @@ -1378,7 +1337,6 @@ static void OPT_InStruct (OPT_Struct *typ) static OPT_Object OPT_InObj (int8 mno) { - OPT_Object _o_result; int16 i, s; CHAR ch; OPT_Object obj = NIL, old = NIL; @@ -1475,8 +1433,7 @@ static OPT_Object OPT_InObj (int8 mno) } } } - _o_result = obj; - return _o_result; + return obj; } void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index 5b51ba36..787ce143 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -207,44 +207,35 @@ void OPV_AdrAndSize (OPT_Object topScope) static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp) { - int16 _o_result; switch (class) { case 7: case 0: case 2: case 4: case 9: case 13: - _o_result = 10; - return _o_result; + return 10; break; case 5: if (__IN(3, OPM_Options, 32)) { - _o_result = 10; - return _o_result; + return 10; } else { - _o_result = 9; - return _o_result; + return 9; } break; case 1: if (__IN(comp, 0x0c, 32)) { - _o_result = 10; - return _o_result; + return 10; } else { - _o_result = 9; - return _o_result; + return 9; } break; case 3: - _o_result = 9; - return _o_result; + return 9; break; case 11: switch (subclass) { case 33: case 7: case 24: case 29: case 20: - _o_result = 9; - return _o_result; + return 9; break; case 16: case 21: case 22: case 23: case 25: - _o_result = 10; - return _o_result; + return 10; break; default: OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Nmop, subclass = ", 55); @@ -257,64 +248,50 @@ static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp switch (subclass) { case 1: if (form == 7) { - _o_result = 4; - return _o_result; + return 4; } else { - _o_result = 8; - return _o_result; + return 8; } break; case 2: if (form == 7) { - _o_result = 3; - return _o_result; + return 3; } else { - _o_result = 8; - return _o_result; + return 8; } break; case 3: case 4: - _o_result = 10; - return _o_result; + return 10; break; case 6: if (form == 7) { - _o_result = 2; - return _o_result; + return 2; } else { - _o_result = 7; - return _o_result; + return 7; } break; case 7: if (form == 7) { - _o_result = 4; - return _o_result; + return 4; } else { - _o_result = 7; - return _o_result; + return 7; } break; case 11: case 12: case 13: case 14: - _o_result = 6; - return _o_result; + return 6; break; case 9: case 10: - _o_result = 5; - return _o_result; + return 5; break; case 5: - _o_result = 1; - return _o_result; + return 1; break; case 8: - _o_result = 0; - return _o_result; + return 0; break; case 19: case 15: case 17: case 18: case 26: case 27: case 28: - _o_result = 10; - return _o_result; + return 10; break; default: OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Ndop, subclass = ", 55); @@ -324,12 +301,10 @@ static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp } break; case 10: - _o_result = 10; - return _o_result; + return 10; break; case 8: case 6: - _o_result = 12; - return _o_result; + return 12; break; default: OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence, class = ", 43); @@ -358,13 +333,10 @@ static void OPV_Len (OPT_Node n, int64 dim) static BOOLEAN OPV_SideEffects (OPT_Node n) { - BOOLEAN _o_result; if (n != NIL) { - _o_result = (n->class == 13 || OPV_SideEffects(n->left)) || OPV_SideEffects(n->right); - return _o_result; + return (n->class == 13 || OPV_SideEffects(n->left)) || OPV_SideEffects(n->right); } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } @@ -744,7 +716,6 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) static OPT_Object OPV_SuperProc (OPT_Node n) { - OPT_Object _o_result; OPT_Object obj = NIL; OPT_Struct typ = NIL; typ = n->right->typ; @@ -752,8 +723,7 @@ static OPT_Object OPV_SuperProc (OPT_Node n) typ = typ->BaseTyp; } OPT_FindField(n->left->obj->name, typ->BaseTyp, &obj); - _o_result = obj; - return _o_result; + return obj; } static void OPV_expr (OPT_Node n, int16 prec) @@ -1187,12 +1157,10 @@ static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc) static BOOLEAN OPV_ImplicitReturn (OPT_Node n) { - BOOLEAN _o_result; while ((n != NIL && n->class != 26)) { n = n->link; } - _o_result = n == NIL; - return _o_result; + return n == NIL; } static void OPV_NewArr (OPT_Node d, OPT_Node x) @@ -1523,21 +1491,16 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPM_WriteString((CHAR*)"__ENDMOD", 9); } } else { + OPC_ExitProc(outerProc, 0, 0); + OPM_WriteString((CHAR*)"return", 7); if (n->left != NIL) { - OPM_WriteString((CHAR*)"_o_result = ", 13); + OPM_Write(' '); if ((n->left->typ->form == 11 && n->obj->typ != n->left->typ)) { OPM_WriteString((CHAR*)"(void*)", 8); OPV_expr(n->left, 10); } else { OPV_expr(n->left, -1); } - OPM_WriteString((CHAR*)";", 2); - OPM_WriteLn(); - OPC_BegStat(); - OPC_ExitProc(outerProc, 0, 0); - OPM_WriteString((CHAR*)"return _o_result", 17); - } else { - OPM_WriteString((CHAR*)"return", 7); } } break; diff --git a/bootstrap/unix-44/Out.c b/bootstrap/unix-44/Out.c index 67a6c27b..0f0b9f79 100644 --- a/bootstrap/unix-44/Out.c +++ b/bootstrap/unix-44/Out.c @@ -56,14 +56,12 @@ void Out_Char (CHAR ch) static int32 Out_Length (CHAR *s, LONGINT s__len) { - int32 _o_result; int32 l; l = 0; while ((l < s__len && s[__X(l, s__len)] != 0x00)) { l += 1; } - _o_result = l; - return _o_result; + return l; } void Out_String (CHAR *str, LONGINT str__len) @@ -152,7 +150,6 @@ static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16 LONGREAL Out_Ten (int16 e) { - LONGREAL _o_result; LONGREAL r, power; r = (LONGREAL)1; power = (LONGREAL)10; @@ -163,8 +160,7 @@ LONGREAL Out_Ten (int16 e) power = power * power; e = __ASHR(e, 1); } - _o_result = r; - return _o_result; + return r; } static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_) diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index aa55dd0d..5c021003 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -174,65 +174,47 @@ extern void Heap_InitHeap(); BOOLEAN Platform_TooManyFiles (int16 e) { - BOOLEAN _o_result; - _o_result = e == Platform_EMFILE() || e == Platform_ENFILE(); - return _o_result; + return e == Platform_EMFILE() || e == Platform_ENFILE(); } BOOLEAN Platform_NoSuchDirectory (int16 e) { - BOOLEAN _o_result; - _o_result = e == Platform_ENOENT(); - return _o_result; + return e == Platform_ENOENT(); } BOOLEAN Platform_DifferentFilesystems (int16 e) { - BOOLEAN _o_result; - _o_result = e == Platform_EXDEV(); - return _o_result; + return e == Platform_EXDEV(); } BOOLEAN Platform_Inaccessible (int16 e) { - BOOLEAN _o_result; - _o_result = (e == Platform_EACCES() || e == Platform_EROFS()) || e == Platform_EAGAIN(); - return _o_result; + return (e == Platform_EACCES() || e == Platform_EROFS()) || e == Platform_EAGAIN(); } BOOLEAN Platform_Absent (int16 e) { - BOOLEAN _o_result; - _o_result = e == Platform_ENOENT(); - return _o_result; + return e == Platform_ENOENT(); } BOOLEAN Platform_TimedOut (int16 e) { - BOOLEAN _o_result; - _o_result = e == Platform_ETIMEDOUT(); - return _o_result; + return e == Platform_ETIMEDOUT(); } BOOLEAN Platform_ConnectionFailed (int16 e) { - BOOLEAN _o_result; - _o_result = ((e == Platform_ECONNREFUSED() || e == Platform_ECONNABORTED()) || e == Platform_ENETUNREACH()) || e == Platform_EHOSTUNREACH(); - return _o_result; + return ((e == Platform_ECONNREFUSED() || e == Platform_ECONNABORTED()) || e == Platform_ENETUNREACH()) || e == Platform_EHOSTUNREACH(); } BOOLEAN Platform_Interrupted (int16 e) { - BOOLEAN _o_result; - _o_result = e == Platform_EINTR(); - return _o_result; + return e == Platform_EINTR(); } int32 Platform_OSAllocate (int32 size) { - int32 _o_result; - _o_result = Platform_allocate(size); - return _o_result; + return Platform_allocate(size); } void Platform_OSFree (int32 address) @@ -253,16 +235,14 @@ void Platform_Init (int32 argc, int32 argvadr) BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len) { - BOOLEAN _o_result; Platform_EnvPtr p = NIL; __DUP(var, var__len, CHAR); p = Platform_getenv(var, var__len); if (p != NIL) { __COPY(*p, val, val__len); } - _o_result = p != NIL; __DEL(var); - return _o_result; + return p != NIL; } void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len) @@ -311,7 +291,6 @@ void Platform_GetIntArg (int16 n, int32 *val) int16 Platform_ArgPos (CHAR *s, LONGINT s__len) { - int16 _o_result; int16 i; CHAR arg[256]; __DUP(s, s__len, CHAR); @@ -321,9 +300,8 @@ int16 Platform_ArgPos (CHAR *s, LONGINT s__len) i += 1; Platform_GetArg(i, (void*)arg, 256); } - _o_result = i; __DEL(s); - return _o_result; + return i; } void Platform_SetInterruptHandler (Platform_SignalHandler handler) @@ -363,12 +341,10 @@ void Platform_GetTimeOfDay (int32 *sec, int32 *usec) int32 Platform_Time (void) { - int32 _o_result; int32 ms; Platform_gettimeval(); ms = (int)__DIVF(Platform_tvusec(), 1000) + Platform_tvsec() * 1000; - _o_result = (int)__MOD(ms - Platform_TimeStart, 2147483647); - return _o_result; + return (int)__MOD(ms - Platform_TimeStart, 2147483647); } void Platform_Delay (int32 ms) @@ -381,126 +357,100 @@ void Platform_Delay (int32 ms) int16 Platform_System (CHAR *cmd, LONGINT cmd__len) { - int16 _o_result; __DUP(cmd, cmd__len, CHAR); - _o_result = Platform_system(cmd, cmd__len); __DEL(cmd); - return _o_result; + return Platform_system(cmd, cmd__len); } int16 Platform_Error (void) { - int16 _o_result; - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h) { - int16 _o_result; int16 fd; fd = Platform_openro(n, n__len); if (fd < 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { *h = fd; - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h) { - int16 _o_result; int16 fd; fd = Platform_openrw(n, n__len); if (fd < 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { *h = fd; - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h) { - int16 _o_result; int16 fd; fd = Platform_opennew(n, n__len); if (fd < 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { *h = fd; - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_Close (int32 h) { - int16 _o_result; if (Platform_closefile(h) < 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ) { - int16 _o_result; Platform_structstats(); if (Platform_fstat(h) < 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } (*identity).volume = Platform_statdev(); (*identity).index = Platform_statino(); (*identity).mtime = Platform_statmtime(); - _o_result = 0; - return _o_result; + return 0; } int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ) { - int16 _o_result; __DUP(n, n__len, CHAR); Platform_structstats(); if (Platform_stat(n, n__len) < 0) { - _o_result = Platform_err(); __DEL(n); - return _o_result; + return Platform_err(); } (*identity).volume = Platform_statdev(); (*identity).index = Platform_statino(); (*identity).mtime = Platform_statmtime(); - _o_result = 0; __DEL(n); - return _o_result; + return 0; } BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2) { - BOOLEAN _o_result; - _o_result = (i1.index == i2.index && i1.volume == i2.volume); - return _o_result; + return (i1.index == i2.index && i1.volume == i2.volume); } BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2) { - BOOLEAN _o_result; - _o_result = i1.mtime == i2.mtime; - return _o_result; + return i1.mtime == i2.mtime; } void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Platform_FileIdentity source) @@ -516,137 +466,107 @@ void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d) int16 Platform_Size (int32 h, int32 *l) { - int16 _o_result; Platform_structstats(); if (Platform_fstat(h) < 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } *l = Platform_statsize(); - _o_result = 0; - return _o_result; + return 0; } int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n) { - int16 _o_result; *n = Platform_readfile(h, p, l); if (*n < 0) { *n = 0; - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n) { - int16 _o_result; *n = Platform_readfile(h, (address)b, b__len); if (*n < 0) { *n = 0; - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_Write (int32 h, int32 p, int32 l) { - int16 _o_result; int32 written; written = Platform_writefile(h, p, l); if (written < 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_Sync (int32 h) { - int16 _o_result; if (Platform_fsync(h) < 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_Seek (int32 h, int32 offset, int16 whence) { - int16 _o_result; if (Platform_lseek(h, offset, whence) < 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_Truncate (int32 h, int32 l) { - int16 _o_result; if (Platform_ftruncate(h, l) < 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_Unlink (CHAR *n, LONGINT n__len) { - int16 _o_result; if (Platform_unlink(n, n__len) < 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_Chdir (CHAR *n, LONGINT n__len) { - int16 _o_result; int16 r; if ((Platform_chdir(n, n__len) >= 0 && Platform_getcwd((void*)Platform_CWD, 256) != NIL)) { - _o_result = 0; - return _o_result; + return 0; } else { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } __RETCHK; } int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) { - int16 _o_result; if (Platform_rename(o, o__len, n, n__len) < 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 87ddfb2a..0aca5733 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -25,7 +25,6 @@ static CHAR Reals_ToHex (int16 i); REAL Reals_Ten (int16 e) { - REAL _o_result; LONGREAL r, power; r = (LONGREAL)1; power = (LONGREAL)10; @@ -36,13 +35,11 @@ REAL Reals_Ten (int16 e) power = power * power; e = __ASHR(e, 1); } - _o_result = r; - return _o_result; + return r; } LONGREAL Reals_TenL (int16 e) { - LONGREAL _o_result; LONGREAL r, power; r = (LONGREAL)1; power = (LONGREAL)10; @@ -52,8 +49,7 @@ LONGREAL Reals_TenL (int16 e) } e = __ASHR(e, 1); if (e <= 0) { - _o_result = r; - return _o_result; + return r; } power = power * power; } @@ -62,11 +58,9 @@ LONGREAL Reals_TenL (int16 e) int16 Reals_Expo (REAL x) { - int16 _o_result; int16 i; __GET((address)&x + 2, i, int16); - _o_result = __MASK(__ASHR(i, 7), -256); - return _o_result; + return __MASK(__ASHR(i, 7), -256); } void Reals_SetExpo (REAL *x, int16 ex) @@ -80,11 +74,9 @@ void Reals_SetExpo (REAL *x, int16 ex) int16 Reals_ExpoL (LONGREAL x) { - int16 _o_result; int16 i; __GET((address)&x + 6, i, int16); - _o_result = __MASK(__ASHR(i, 4), -2048); - return _o_result; + return __MASK(__ASHR(i, 4), -2048); } void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len) @@ -122,13 +114,10 @@ void Reals_Convert (REAL x, int16 n, CHAR *d, LONGINT d__len) static CHAR Reals_ToHex (int16 i) { - CHAR _o_result; if (i < 10) { - _o_result = (CHAR)(i + 48); - return _o_result; + return (CHAR)(i + 48); } else { - _o_result = (CHAR)(i + 55); - return _o_result; + return (CHAR)(i + 55); } __RETCHK; } diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index 5bbe808d..000c09c8 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -23,7 +23,6 @@ export void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR int16 Strings_Length (CHAR *s, LONGINT s__len) { - int16 _o_result; int32 i; __DUP(s, s__len, CHAR); i = 0; @@ -31,13 +30,11 @@ int16 Strings_Length (CHAR *s, LONGINT s__len) i += 1; } if (i <= 32767) { - _o_result = (int16)i; __DEL(s); - return _o_result; + return (int16)i; } else { - _o_result = 32767; __DEL(s); - return _o_result; + return 32767; } __RETCHK; } @@ -70,6 +67,7 @@ void Strings_Insert (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, L } if (pos > n1) { Strings_Append(dest, dest__len, (void*)source, source__len); + __DEL(source); return; } if ((pos + n2) < dest__len) { @@ -131,6 +129,7 @@ void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHA } if (pos >= len) { dest[0] = 0x00; + __DEL(source); return; } i = 0; @@ -146,17 +145,15 @@ void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHA int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int16 pos) { - int16 _o_result; int16 n1, n2, i, j; __DUP(pattern, pattern__len, CHAR); __DUP(s, s__len, CHAR); n1 = Strings_Length(s, s__len); n2 = Strings_Length(pattern, pattern__len); if (n2 == 0) { - _o_result = 0; __DEL(pattern); __DEL(s); - return _o_result; + return 0; } i = pos; while (i <= n1 - n2) { @@ -166,18 +163,16 @@ int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, j += 1; } if (j == n2) { - _o_result = i; __DEL(pattern); __DEL(s); - return _o_result; + return i; } } i += 1; } - _o_result = -1; __DEL(pattern); __DEL(s); - return _o_result; + return -1; } void Strings_Cap (CHAR *s, LONGINT s__len) @@ -200,50 +195,42 @@ static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__le static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, int16 n, int16 m) { - BOOLEAN _o_result; while ((((n >= 0 && m >= 0)) && mask[__X(m, mask__len)] != '*')) { if (name[__X(n, name__len)] != mask[__X(m, mask__len)]) { - _o_result = 0; - return _o_result; + return 0; } n -= 1; m -= 1; } if (m < 0) { - _o_result = n < 0; - return _o_result; + return n < 0; } while ((m >= 0 && mask[__X(m, mask__len)] == '*')) { m -= 1; } if (m < 0) { - _o_result = 1; - return _o_result; + return 1; } while (n >= 0) { if (M__8(name, name__len, mask, mask__len, n, m)) { - _o_result = 1; - return _o_result; + return 1; } n -= 1; } - _o_result = 0; - return _o_result; + return 0; } BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len) { - BOOLEAN _o_result; struct Match__7 _s; __DUP(string, string__len, CHAR); __DUP(pattern, pattern__len, CHAR); _s.lnk = Match__7_s; Match__7_s = &_s; - _o_result = M__8((void*)string, string__len, (void*)pattern, pattern__len, Strings_Length(string, string__len) - 1, Strings_Length(pattern, pattern__len) - 1); Match__7_s = _s.lnk; __DEL(string); __DEL(pattern); - return _o_result; + return M__8((void*)string, string__len, (void*)pattern, pattern__len, Strings_Length(string, string__len) - 1, Strings_Length(pattern, pattern__len) - 1); } diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index ed55dfca..02d87d28 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -234,12 +234,10 @@ export void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGIN static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len) { - Texts_FontsFont _o_result; Texts_FontsFont F = NIL; __NEW(F, Texts_FontDesc); __COPY(name, F->name, 32); - _o_result = F; - return _o_result; + return F; } static void Texts_Find (Texts_Text T, int32 *pos, Texts_Run *u, int32 *org, int32 *off) @@ -338,22 +336,18 @@ static void Texts_Splice (Texts_Run un, Texts_Run v, Texts_Run w, Texts_Text bas static Texts_Piece Texts_ClonePiece (Texts_Piece p) { - Texts_Piece _o_result; Texts_Piece q = NIL; __NEW(q, Texts_PieceDesc); __GUARDEQP(q, Texts_PieceDesc) = *p; - _o_result = q; - return _o_result; + return q; } static Texts_Elem Texts_CloneElem (Texts_Elem e) { - Texts_Elem _o_result; Texts_CopyMsg msg; msg.e = NIL; (*e->handle)(e, (void*)&msg, Texts_CopyMsg__typ); - _o_result = msg.e; - return _o_result; + return msg.e; } void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE) @@ -369,14 +363,11 @@ void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE) Texts_Text Texts_ElemBase (Texts_Elem E) { - Texts_Text _o_result; - _o_result = E->base; - return _o_result; + return E->base; } int32 Texts_ElemPos (Texts_Elem E) { - int32 _o_result; Texts_Run u = NIL; int32 pos; u = E->base->head->next; @@ -385,8 +376,7 @@ int32 Texts_ElemPos (Texts_Elem E) pos = pos + u->len; u = u->next; } - _o_result = pos; - return _o_result; + return pos; } static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, address *msg__typ) @@ -716,9 +706,7 @@ void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ) int32 Texts_Pos (Texts_Reader *R, address *R__typ) { - int32 _o_result; - _o_result = (*R).org + (*R).off; - return _o_result; + return (*R).org + (*R).off; } void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int32 pos) diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index e0fc2e86..ddeec08e 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -317,14 +317,11 @@ void Files_Close (Files_File f) int32 Files_Length (Files_File f) { - int32 _o_result; - _o_result = f->len; - return _o_result; + return f->len; } Files_File Files_New (CHAR *name, LONGINT name__len) { - Files_File _o_result; Files_File f = NIL; __DUP(name, name__len, CHAR); __NEW(f, Files_FileDesc); @@ -335,9 +332,8 @@ Files_File Files_New (CHAR *name, LONGINT name__len) f->len = 0; f->pos = 0; f->swapper = -1; - _o_result = f; __DEL(name); - return _o_result; + return f; } static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len) @@ -385,7 +381,6 @@ static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len) static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len) { - BOOLEAN _o_result; int16 i; CHAR ch; i = 0; @@ -394,13 +389,11 @@ static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len) i += 1; ch = name[i]; } - _o_result = ch == '/'; - return _o_result; + return ch == '/'; } static Files_File Files_CacheEntry (Platform_FileIdentity identity) { - Files_File _o_result; Files_File f = NIL; int16 i, error; f = Files_files; @@ -419,18 +412,15 @@ static Files_File Files_CacheEntry (Platform_FileIdentity identity) f->identity = identity; error = Platform_Size(f->fd, &f->len); } - _o_result = f; - return _o_result; + return f; } f = f->next; } - _o_result = NIL; - return _o_result; + return NIL; } Files_File Files_Old (CHAR *name, LONGINT name__len) { - Files_File _o_result; Files_File f = NIL; int32 fd; int16 pos; @@ -470,9 +460,8 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) error = Platform_Identify(fd, &identity, Platform_FileIdentity__typ); f = Files_CacheEntry(identity); if (f != NIL) { - _o_result = f; __DEL(name); - return _o_result; + return f; } else { __NEW(f, Files_FileDesc); Heap_RegisterFinalizer((void*)f, Files_Finalize); @@ -488,23 +477,20 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) f->next = Files_files; Files_files = f; Heap_FileCount += 1; - _o_result = f; __DEL(name); - return _o_result; + return f; } } else if (dir[0] == 0x00) { - _o_result = NIL; __DEL(name); - return _o_result; + return NIL; } else { Files_MakeFileName(dir, 256, name, name__len, (void*)path, 256); Files_ScanPath(&pos, (void*)dir, 256); } } } else { - _o_result = NIL; __DEL(name); - return _o_result; + return NIL; } __RETCHK; } @@ -544,9 +530,7 @@ void Files_GetDate (Files_File f, int32 *t, int32 *d) int32 Files_Pos (Files_Rider *r, address *r__typ) { - int32 _o_result; - _o_result = (*r).org + (*r).offset; - return _o_result; + return (*r).org + (*r).offset; } void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos) @@ -673,9 +657,7 @@ void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x Files_File Files_Base (Files_Rider *r, address *r__typ) { - Files_File _o_result; - _o_result = (*r).buf->f; - return _o_result; + return (*r).buf->f; } void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x) @@ -759,17 +741,23 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int error = Platform_Rename((void*)old, old__len, (void*)new, new__len); if (!Platform_DifferentFilesystems(error)) { *res = error; + __DEL(old); + __DEL(new); return; } else { error = Platform_OldRO((void*)old, old__len, &fdold); if (error != 0) { *res = 2; + __DEL(old); + __DEL(new); return; } error = Platform_New((void*)new, new__len, &fdnew); if (error != 0) { error = Platform_Close(fdold); *res = 3; + __DEL(old); + __DEL(new); return; } error = Platform_Read(fdold, (address)buf, 4096, &n); diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index 37062b0b..4bc74170 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -127,7 +127,6 @@ void Heap_Unlock (void) SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) { - SYSTEM_PTR _o_result; Heap_Module m; if (__STRCMP(name, "Heap") == 0) { __SYSNEW(m, 48); @@ -141,8 +140,7 @@ SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) m->enumPtrs = enumPtrs; m->next = (Heap_Module)(address)Heap_modules; Heap_modules = (SYSTEM_PTR)m; - _o_result = (void*)m; - return _o_result; + return (void*)m; } void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) @@ -172,7 +170,6 @@ void Heap_INCREF (Heap_Module m) static int32 Heap_NewChunk (int32 blksz) { - int32 _o_result; int32 chnk; chnk = Heap_OSAllocate(blksz + 12); if (chnk != 0) { @@ -184,8 +181,7 @@ static int32 Heap_NewChunk (int32 blksz) Heap_bigBlocks = chnk + 12; Heap_heapsize += blksz; } - _o_result = chnk; - return _o_result; + return chnk; } static void Heap_ExtendHeap (int32 blksz) @@ -219,7 +215,6 @@ static void Heap_ExtendHeap (int32 blksz) SYSTEM_PTR Heap_NEWREC (int32 tag) { - SYSTEM_PTR _o_result; int32 i, i0, di, blksz, restsize, t, adr, end, next, prev; SYSTEM_PTR new; Heap_Lock(); @@ -267,12 +262,10 @@ SYSTEM_PTR Heap_NEWREC (int32 tag) new = Heap_NEWREC(tag); } Heap_Unlock(); - _o_result = new; - return _o_result; + return new; } else { Heap_Unlock(); - _o_result = NIL; - return _o_result; + return NIL; } } __GET(adr + 4, t, int32); @@ -320,13 +313,11 @@ SYSTEM_PTR Heap_NEWREC (int32 tag) __PUT(adr + 8, 0, int32); Heap_allocated += blksz; Heap_Unlock(); - _o_result = (SYSTEM_PTR)(address)(adr + 4); - return _o_result; + return (SYSTEM_PTR)(address)(adr + 4); } SYSTEM_PTR Heap_NEWBLK (int32 size) { - SYSTEM_PTR _o_result; int32 blksz, tag; SYSTEM_PTR new; Heap_Lock(); @@ -338,8 +329,7 @@ SYSTEM_PTR Heap_NEWBLK (int32 size) __PUT(tag + 4, -4, int32); __PUT((int32)(address)new - 4, tag, int32); Heap_Unlock(); - _o_result = new; - return _o_result; + return new; } static void Heap_Mark (int32 q) diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index 45b91f7f..bb6774da 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -74,7 +74,6 @@ static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len) Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len) { - Modules_Module _o_result; Modules_Module m = NIL; CHAR bodyname[64]; Modules_Command body; @@ -93,14 +92,12 @@ Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len) Modules_Append((void*)Modules_resMsg, 256, name, name__len); Modules_Append((void*)Modules_resMsg, 256, (CHAR*)"\" not found", 12); } - _o_result = m; __DEL(name); - return _o_result; + return m; } Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len) { - Modules_Command _o_result; Modules_Cmd c = NIL; __DUP(name, name__len, CHAR); c = mod->cmds; @@ -110,9 +107,8 @@ Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT nam if (c != NIL) { Modules_res = 0; Modules_resMsg[0] = 0x00; - _o_result = c->cmd; __DEL(name); - return _o_result; + return c->cmd; } else { Modules_res = 2; __MOVE(" command \"", Modules_resMsg, 11); @@ -121,9 +117,8 @@ Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT nam Modules_Append((void*)Modules_resMsg, 256, (CHAR*)".", 2); Modules_Append((void*)Modules_resMsg, 256, name, name__len); Modules_Append((void*)Modules_resMsg, 256, (CHAR*)"\" not found", 12); - _o_result = NIL; __DEL(name); - return _o_result; + return NIL; } __RETCHK; } diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index 038bd92c..dff6adc6 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -74,7 +74,6 @@ static void OPB_err (int16 n) OPT_Node OPB_NewLeaf (OPT_Object obj) { - OPT_Node _o_result; OPT_Node node = NIL; switch (obj->mode) { case 1: @@ -102,8 +101,7 @@ OPT_Node OPB_NewLeaf (OPT_Object obj) } node->obj = obj; node->typ = obj->typ; - _o_result = node; - return _o_result; + return node; } void OPB_Construct (int8 class, OPT_Node *x, OPT_Node y) @@ -131,34 +129,27 @@ void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y) static int16 OPB_BoolToInt (BOOLEAN b) { - int16 _o_result; if (b) { - _o_result = 1; - return _o_result; + return 1; } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } static BOOLEAN OPB_IntToBool (int64 i) { - BOOLEAN _o_result; - _o_result = i != 0; - return _o_result; + return i != 0; } OPT_Node OPB_NewBoolConst (BOOLEAN boolval) { - OPT_Node _o_result; OPT_Node x = NIL; x = OPT_NewNode(7); x->typ = OPT_booltyp; x->conval = OPT_NewConst(); x->conval->intval = OPB_BoolToInt(boolval); - _o_result = x; - return _o_result; + return x; } void OPB_OptIf (OPT_Node *x) @@ -198,26 +189,22 @@ void OPB_OptIf (OPT_Node *x) OPT_Node OPB_Nil (void) { - OPT_Node _o_result; OPT_Node x = NIL; x = OPT_NewNode(7); x->typ = OPT_niltyp; x->conval = OPT_NewConst(); x->conval->intval = 0; - _o_result = x; - return _o_result; + return x; } OPT_Node OPB_EmptySet (void) { - OPT_Node _o_result; OPT_Node x = NIL; x = OPT_NewNode(7); x->typ = OPT_settyp; x->conval = OPT_NewConst(); x->conval->setval = 0x0; - _o_result = x; - return _o_result; + return x; } static void OPB_SetIntType (OPT_Node node) @@ -238,32 +225,27 @@ static void OPB_SetSetType (OPT_Node node) OPT_Node OPB_NewIntConst (int64 intval) { - OPT_Node _o_result; OPT_Node x = NIL; x = OPT_NewNode(7); x->conval = OPT_NewConst(); x->conval->intval = intval; OPB_SetIntType(x); - _o_result = x; - return _o_result; + return x; } OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ) { - OPT_Node _o_result; OPT_Node x = NIL; x = OPT_NewNode(7); x->conval = OPT_NewConst(); x->conval->realval = realval; x->typ = typ; x->conval->intval = -1; - _o_result = x; - return _o_result; + return x; } OPT_Node OPB_NewString (OPS_String str, int64 len) { - OPT_Node _o_result; OPT_Node x = NIL; x = OPT_NewNode(7); x->conval = OPT_NewConst(); @@ -272,8 +254,7 @@ OPT_Node OPB_NewString (OPS_String str, int64 len) x->conval->intval2 = OPM_Longint(len); x->conval->ext = OPT_NewExt(); __COPY(str, *x->conval->ext, 256); - _o_result = x; - return _o_result; + return x; } static void OPB_CharToString (OPT_Node n) @@ -305,9 +286,7 @@ static void OPB_BindNodes (int8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y) static BOOLEAN OPB_NotVar (OPT_Node x) { - BOOLEAN _o_result; - _o_result = (x->class >= 7 && ((x->class != 11 || x->subcl != 29) || x->left->class >= 7)); - return _o_result; + return (x->class >= 7 && ((x->class != 11 || x->subcl != 29) || x->left->class >= 7)); } void OPB_DeRef (OPT_Node *x) @@ -489,7 +468,6 @@ void OPB_In (OPT_Node *x, OPT_Node y) static int64 OPB_log (int64 x) { - int64 _o_result; OPB_exp = 0; if (x > 0) { while (!__ODD(x)) { @@ -497,8 +475,7 @@ static int64 OPB_log (int64 x) OPB_exp += 1; } } - _o_result = x; - return _o_result; + return x; } static void OPB_CheckRealType (int16 f, int16 nr, OPT_Const x) @@ -529,14 +506,12 @@ static OPT_Node NewOp__29 (int8 op, OPT_Struct typ, OPT_Node z); static OPT_Node NewOp__29 (int8 op, OPT_Struct typ, OPT_Node z) { - OPT_Node _o_result; OPT_Node node = NIL; node = OPT_NewNode(11); node->subcl = op; node->typ = typ; node->left = z; - _o_result = node; - return _o_result; + return node; } void OPB_MOp (int8 op, OPT_Node *x) @@ -775,7 +750,6 @@ static int16 ConstCmp__14 (void); static int16 ConstCmp__14 (void) { - int16 _o_result; int16 res; switch (*ConstOp__13_s->f) { case 0: @@ -836,8 +810,7 @@ static int16 ConstCmp__14 (void) break; } (*ConstOp__13_s->x)->typ = OPT_booltyp; - _o_result = res; - return _o_result; + return res; } static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) @@ -1202,7 +1175,6 @@ static void NewOp__39 (int8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y) static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) { - BOOLEAN _o_result; BOOLEAN ok, xCharArr, yCharArr; xCharArr = (__IN((*x)->typ->comp, 0x0c, 32) && (*x)->typ->BaseTyp->form == 3) || *Op__38_s->f == 8; yCharArr = (__IN((*y)->typ->comp, 0x0c, 32) && (*y)->typ->BaseTyp->form == 3) || *Op__38_s->g == 8; @@ -1228,8 +1200,7 @@ static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) OPB_Index(&*x, OPB_NewIntConst(0)); } } - _o_result = ok; - return _o_result; + return ok; } void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) @@ -2016,14 +1987,12 @@ static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right) { - OPT_Node _o_result; OPT_Node node = NIL; node = OPT_NewNode(class); node->subcl = subcl; node->left = left; node->right = right; - _o_result = node; - return _o_result; + return node; } void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 20c369e9..9401b9a7 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -157,19 +157,16 @@ static void OPC_Str1 (CHAR *s, LONGINT s__len, int32 x) static int16 OPC_Length (CHAR *s, LONGINT s__len) { - int16 _o_result; int16 i; i = 0; while (s[__X(i, s__len)] != 0x00) { i += 1; } - _o_result = i; - return _o_result; + return i; } static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len) { - int16 _o_result; int16 i, h; i = 0; h = 0; @@ -177,8 +174,7 @@ static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len) h = 3 * h + (int16)s[__X(i, s__len)]; i += 1; } - _o_result = (int)__MOD(h, 105); - return _o_result; + return (int)__MOD(h, 105); } void OPC_Ident (OPT_Object obj) @@ -320,9 +316,7 @@ void OPC_Andent (OPT_Struct typ) static BOOLEAN OPC_Undefined (OPT_Object obj) { - BOOLEAN _o_result; - _o_result = obj->name[0] == 0x00 || (((obj->mnolev >= 0 && obj->linkadr != (3 + OPM_currFile))) && obj->linkadr != 2); - return _o_result; + return obj->name[0] == 0x00 || (((obj->mnolev >= 0 && obj->linkadr != (3 + OPM_currFile))) && obj->linkadr != 2); } static void OPC_DeclareBase (OPT_Object dcl) @@ -391,13 +385,11 @@ static void OPC_DeclareBase (OPT_Object dcl) int32 OPC_NofPtrs (OPT_Struct typ) { - int32 _o_result; OPT_Object fld = NIL; OPT_Struct btyp = NIL; int32 n; if ((typ->form == 11 && typ->sysflag == 0)) { - _o_result = 1; - return _o_result; + return 1; } else if ((typ->comp == 4 && __MASK(typ->sysflag, -256) == 0)) { btyp = typ->BaseTyp; if (btyp != NIL) { @@ -414,8 +406,7 @@ int32 OPC_NofPtrs (OPT_Struct typ) } fld = fld->link; } - _o_result = n; - return _o_result; + return n; } else if (typ->comp == 2) { btyp = typ->BaseTyp; n = typ->n; @@ -423,11 +414,9 @@ int32 OPC_NofPtrs (OPT_Struct typ) n = btyp->n * n; btyp = btyp->BaseTyp; } - _o_result = OPC_NofPtrs(btyp) * n; - return _o_result; + return OPC_NofPtrs(btyp) * n; } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } @@ -608,7 +597,6 @@ static void OPC_DeclareTProcs (OPT_Object obj, BOOLEAN *empty) OPT_Object OPC_BaseTProc (OPT_Object obj) { - OPT_Object _o_result; OPT_Struct typ = NIL, base = NIL; int32 mno; typ = obj->link->typ; @@ -622,8 +610,7 @@ OPT_Object OPC_BaseTProc (OPT_Object obj) base = typ->BaseTyp; } OPT_FindField(obj->name, typ, &obj); - _o_result = obj; - return _o_result; + return obj; } static void OPC_DefineTProcMacros (OPT_Object obj, BOOLEAN *empty) @@ -734,18 +721,14 @@ static void OPC_DefineType (OPT_Struct str) static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len) { - BOOLEAN _o_result; int16 i; - BOOLEAN r; __DUP(y, y__len, CHAR); i = 0; while ((*x)[__X(i + 1, 256)] == y[__X(i, y__len)]) { i += 1; } - r = y[__X(i, y__len)] == 0x00; - _o_result = r; __DEL(y); - return _o_result; + return y[__X(i, y__len)] == 0x00; } static void OPC_CProcDefs (OPT_Object obj, int16 vis) @@ -1455,12 +1438,6 @@ void OPC_EnterProc (OPT_Object proc) } OPC_ProcHeader(proc, 1); OPC_BegBlk(); - if (proc->typ != OPT_notyp) { - OPC_BegStat(); - OPC_Ident(proc->typ->strobj); - OPM_WriteString((CHAR*)" _o_result;", 12); - OPM_WriteLn(); - } scope = proc->scope; OPC_IdentList(scope->scope, 0); if (!scope->leaf) { diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index d0b09b3d..458de3f2 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -124,33 +124,25 @@ void OPM_LogWLn (void) int64 OPM_SignedMaximum (int32 bytecount) { - int64 _o_result; int64 result; result = 1; result = __LSH(result, __ASHL(bytecount, 3) - 1, 64); - _o_result = result - 1; - return _o_result; + return result - 1; } int64 OPM_SignedMinimum (int32 bytecount) { - int64 _o_result; - _o_result = -OPM_SignedMaximum(bytecount) - 1; - return _o_result; + return -OPM_SignedMaximum(bytecount) - 1; } int32 OPM_Longint (int64 n) { - int32 _o_result; - _o_result = __VAL(int32, n); - return _o_result; + return __VAL(int32, n); } int16 OPM_Integer (int64 n) { - int16 _o_result; - _o_result = __VAL(int16, n); - return _o_result; + return __VAL(int16, n); } static void OPM_ScanOptions (CHAR *s, LONGINT s__len) @@ -266,7 +258,6 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len) BOOLEAN OPM_OpenPar (void) { - BOOLEAN _o_result; CHAR s[256]; if (Platform_ArgCount == 1) { OPM_LogWLn(); @@ -274,7 +265,7 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWStr(Configuration_versionLong, 75); OPM_LogW('.'); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Based on Ofront by Software Templ OEG.", 39); + OPM_LogWStr((CHAR*)"Based on Ofront by J. Templ and Software Templ OEG.", 52); OPM_LogWLn(); OPM_LogWStr((CHAR*)"Further development by Norayr Chilingarian, David Brown and others.", 68); OPM_LogWLn(); @@ -287,7 +278,7 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWStr((CHAR*)" options {files {options}}.", 28); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Where options = [\"-\" {option} ].", 33); + OPM_LogWStr((CHAR*)"Options:", 9); OPM_LogWLn(); OPM_LogWLn(); OPM_LogWStr((CHAR*)" Run time safety", 18); @@ -345,7 +336,7 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWLn(); OPM_LogWStr((CHAR*)" -A48 32 bit addresses, 64 bit alignment (e.g. Windows 32 bit on x86, linux 32 bit on arm).", 97); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -A88 66 bit addresses, 64 bit alignment (e.g. 64 bit platforms).", 71); + OPM_LogWStr((CHAR*)" -A88 64 bit addresses, 64 bit alignment (e.g. 64 bit platforms).", 71); OPM_LogWLn(); OPM_LogWLn(); OPM_LogWStr((CHAR*)"All options are off by default, except where noted above.", 58); @@ -356,8 +347,7 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWLn(); OPM_LogWStr((CHAR*)"Repeating an option toggles its value.", 39); OPM_LogWLn(); - _o_result = 0; - return _o_result; + return 0; } else { OPM_AddressSize = 4; OPM_GetAlignment(&OPM_Alignment); @@ -376,8 +366,7 @@ BOOLEAN OPM_OpenPar (void) OPM_GlobalAlignment = OPM_Alignment; __COPY(OPM_Model, OPM_GlobalModel, 10); OPM_GlobalOptions = OPM_Options; - _o_result = 1; - return _o_result; + return 1; } __RETCHK; } @@ -741,20 +730,16 @@ void OPM_SymRCh (CHAR *ch) int32 OPM_SymRInt (void) { - int32 _o_result; int32 k; Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&k, 4); - _o_result = k; - return _o_result; + return k; } int64 OPM_SymRInt64 (void) { - int64 _o_result; int64 k; Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&k, 8); - _o_result = k; - return _o_result; + return k; } void OPM_SymRSet (uint64 *s) @@ -797,9 +782,7 @@ void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done) BOOLEAN OPM_eofSF (void) { - BOOLEAN _o_result; - _o_result = OPM_oldSF.eof; - return _o_result; + return OPM_oldSF.eof; } void OPM_SymWCh (CHAR ch) diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index 90f35dd5..5e181cb9 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -901,7 +901,6 @@ static void OPP_Receiver (int8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct static BOOLEAN OPP_Extends (OPT_Struct x, OPT_Struct b) { - BOOLEAN _o_result; if ((b->form == 11 && x->form == 11)) { b = b->BaseTyp; x = x->BaseTyp; @@ -911,8 +910,7 @@ static BOOLEAN OPP_Extends (OPT_Struct x, OPT_Struct b) x = x->BaseTyp; } while (!(x == NIL || x == b)); } - _o_result = x == b; - return _o_result; + return x == b; } static struct ProcedureDeclaration__16 { diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index b3c52f3c..5a34663d 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -97,7 +97,6 @@ static LONGREAL Ten__9 (int16 e); static LONGREAL Ten__9 (int16 e) { - LONGREAL _o_result; LONGREAL x, p; x = (LONGREAL)1; p = (LONGREAL)10; @@ -110,23 +109,18 @@ static LONGREAL Ten__9 (int16 e) p = p * p; } } - _o_result = x; - return _o_result; + return x; } static int16 Ord__7 (CHAR ch, BOOLEAN hex) { - int16 _o_result; if (ch <= '9') { - _o_result = (int16)ch - 48; - return _o_result; + return (int16)ch - 48; } else if (hex) { - _o_result = ((int16)ch - 65) + 10; - return _o_result; + return ((int16)ch - 65) + 10; } else { OPS_err(2); - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } @@ -324,6 +318,7 @@ void OPS_Get (int8 *sym) while (OPS_ch <= ' ') { if (OPS_ch == 0x00) { *sym = 64; + Get__1_s = _s.lnk; return; } else { OPM_Get(&OPS_ch); diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 2a8e00ab..f55e7e01 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -179,7 +179,6 @@ static void OPT_err (int16 n) int16 OPT_IntSize (int64 n) { - int16 _o_result; int16 bytes; if (n < 0) { n = -(n + 1); @@ -188,77 +187,59 @@ int16 OPT_IntSize (int64 n) while ((bytes < 8 && __ASH(n, -(__ASHL(bytes, 3) - 1)) != 0)) { bytes += 1; } - _o_result = bytes; - return _o_result; + return bytes; } OPT_Struct OPT_IntType (int32 size) { - OPT_Struct _o_result; if (size <= OPT_int8typ->size) { - _o_result = OPT_int8typ; - return _o_result; + return OPT_int8typ; } if (size <= OPT_int16typ->size) { - _o_result = OPT_int16typ; - return _o_result; + return OPT_int16typ; } if (size <= OPT_int32typ->size) { - _o_result = OPT_int32typ; - return _o_result; + return OPT_int32typ; } - _o_result = OPT_int64typ; - return _o_result; + return OPT_int64typ; } OPT_Struct OPT_SetType (int32 size) { - OPT_Struct _o_result; if (size == OPT_set32typ->size) { - _o_result = OPT_set32typ; - return _o_result; + return OPT_set32typ; } - _o_result = OPT_set64typ; - return _o_result; + return OPT_set64typ; } OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir) { - OPT_Struct _o_result; int16 i; __ASSERT(x->form == 4, 0); __ASSERT(x->BaseTyp == OPT_undftyp, 0); __ASSERT(dir == 1 || dir == -1, 0); if (dir > 0) { if (x->size < OPT_sinttyp->size) { - _o_result = OPT_sinttyp; - return _o_result; + return OPT_sinttyp; } if (x->size < OPT_inttyp->size) { - _o_result = OPT_inttyp; - return _o_result; + return OPT_inttyp; } if (x->size < OPT_linttyp->size) { - _o_result = OPT_linttyp; - return _o_result; + return OPT_linttyp; } - _o_result = OPT_int64typ; - return _o_result; + return OPT_int64typ; } else { if (x->size > OPT_linttyp->size) { - _o_result = OPT_linttyp; - return _o_result; + return OPT_linttyp; } if (x->size > OPT_inttyp->size) { - _o_result = OPT_inttyp; - return _o_result; + return OPT_inttyp; } if (x->size > OPT_sinttyp->size) { - _o_result = OPT_sinttyp; - return _o_result; + return OPT_sinttyp; } - _o_result = OPT_int8typ; - return _o_result; + return OPT_int8typ; } __RETCHK; } @@ -285,7 +266,6 @@ void OPT_Align (int32 *adr, int32 base) int32 OPT_SizeAlignment (int32 size) { - int32 _o_result; int32 alignment; if (size < OPM_Alignment) { alignment = 1; @@ -295,13 +275,11 @@ int32 OPT_SizeAlignment (int32 size) } else { alignment = OPM_Alignment; } - _o_result = alignment; - return _o_result; + return alignment; } int32 OPT_BaseAlignment (OPT_Struct typ) { - int32 _o_result; int32 alignment; if (typ->form == 13) { if (typ->comp == 4) { @@ -312,8 +290,7 @@ int32 OPT_BaseAlignment (OPT_Struct typ) } else { alignment = OPT_SizeAlignment(typ->size); } - _o_result = alignment; - return _o_result; + return alignment; } void OPT_TypSize (OPT_Struct typ) @@ -389,25 +366,20 @@ void OPT_TypSize (OPT_Struct typ) OPT_Const OPT_NewConst (void) { - OPT_Const _o_result; OPT_Const const_ = NIL; __NEW(const_, OPT_ConstDesc); - _o_result = const_; - return _o_result; + return const_; } OPT_Object OPT_NewObj (void) { - OPT_Object _o_result; OPT_Object obj = NIL; __NEW(obj, OPT_ObjDesc); - _o_result = obj; - return _o_result; + return obj; } OPT_Struct OPT_NewStr (int8 form, int8 comp) { - OPT_Struct _o_result; OPT_Struct typ = NIL; __NEW(typ, OPT_StrDesc); typ->form = form; @@ -418,27 +390,22 @@ OPT_Struct OPT_NewStr (int8 form, int8 comp) } typ->size = -1; typ->BaseTyp = OPT_undftyp; - _o_result = typ; - return _o_result; + return typ; } OPT_Node OPT_NewNode (int8 class) { - OPT_Node _o_result; OPT_Node node = NIL; __NEW(node, OPT_NodeDesc); node->class = class; - _o_result = node; - return _o_result; + return node; } OPT_ConstExt OPT_NewExt (void) { - OPT_ConstExt _o_result; OPT_ConstExt ext = NIL; ext = __NEWARR(NIL, 1, 1, 1, 0, 256); - _o_result = ext; - return _o_result; + return ext; } void OPT_OpenScope (int8 level, OPT_Object owner) @@ -1120,7 +1087,6 @@ static void OPT_InSign (int8 mno, OPT_Struct *res, OPT_Object *par) static OPT_Object OPT_InFld (void) { - OPT_Object _o_result; int32 tag; OPT_Object obj = NIL; tag = OPT_impCtxt.nextTag; @@ -1146,13 +1112,11 @@ static OPT_Object OPT_InFld (void) obj->vis = 0; obj->adr = OPM_SymRInt(); } - _o_result = obj; - return _o_result; + return obj; } static OPT_Object OPT_InTProc (int8 mno) { - OPT_Object _o_result; int32 tag; OPT_Object obj = NIL; tag = OPT_impCtxt.nextTag; @@ -1174,22 +1138,17 @@ static OPT_Object OPT_InTProc (int8 mno) obj->vis = 0; obj->adr = __ASHL(OPM_SymRInt(), 16); } - _o_result = obj; - return _o_result; + return obj; } static OPT_Struct OPT_InTyp (int32 tag) { - OPT_Struct _o_result; if (tag == 4) { - _o_result = OPT_IntType(OPM_SymRInt()); - return _o_result; + return OPT_IntType(OPM_SymRInt()); } else if (tag == 7) { - _o_result = OPT_SetType(OPM_SymRInt()); - return _o_result; + return OPT_SetType(OPM_SymRInt()); } else { - _o_result = OPT_impCtxt.ref[__X(tag, 255)]; - return _o_result; + return OPT_impCtxt.ref[__X(tag, 255)]; } __RETCHK; } @@ -1378,7 +1337,6 @@ static void OPT_InStruct (OPT_Struct *typ) static OPT_Object OPT_InObj (int8 mno) { - OPT_Object _o_result; int16 i, s; CHAR ch; OPT_Object obj = NIL, old = NIL; @@ -1475,8 +1433,7 @@ static OPT_Object OPT_InObj (int8 mno) } } } - _o_result = obj; - return _o_result; + return obj; } void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index 5b51ba36..787ce143 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -207,44 +207,35 @@ void OPV_AdrAndSize (OPT_Object topScope) static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp) { - int16 _o_result; switch (class) { case 7: case 0: case 2: case 4: case 9: case 13: - _o_result = 10; - return _o_result; + return 10; break; case 5: if (__IN(3, OPM_Options, 32)) { - _o_result = 10; - return _o_result; + return 10; } else { - _o_result = 9; - return _o_result; + return 9; } break; case 1: if (__IN(comp, 0x0c, 32)) { - _o_result = 10; - return _o_result; + return 10; } else { - _o_result = 9; - return _o_result; + return 9; } break; case 3: - _o_result = 9; - return _o_result; + return 9; break; case 11: switch (subclass) { case 33: case 7: case 24: case 29: case 20: - _o_result = 9; - return _o_result; + return 9; break; case 16: case 21: case 22: case 23: case 25: - _o_result = 10; - return _o_result; + return 10; break; default: OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Nmop, subclass = ", 55); @@ -257,64 +248,50 @@ static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp switch (subclass) { case 1: if (form == 7) { - _o_result = 4; - return _o_result; + return 4; } else { - _o_result = 8; - return _o_result; + return 8; } break; case 2: if (form == 7) { - _o_result = 3; - return _o_result; + return 3; } else { - _o_result = 8; - return _o_result; + return 8; } break; case 3: case 4: - _o_result = 10; - return _o_result; + return 10; break; case 6: if (form == 7) { - _o_result = 2; - return _o_result; + return 2; } else { - _o_result = 7; - return _o_result; + return 7; } break; case 7: if (form == 7) { - _o_result = 4; - return _o_result; + return 4; } else { - _o_result = 7; - return _o_result; + return 7; } break; case 11: case 12: case 13: case 14: - _o_result = 6; - return _o_result; + return 6; break; case 9: case 10: - _o_result = 5; - return _o_result; + return 5; break; case 5: - _o_result = 1; - return _o_result; + return 1; break; case 8: - _o_result = 0; - return _o_result; + return 0; break; case 19: case 15: case 17: case 18: case 26: case 27: case 28: - _o_result = 10; - return _o_result; + return 10; break; default: OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Ndop, subclass = ", 55); @@ -324,12 +301,10 @@ static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp } break; case 10: - _o_result = 10; - return _o_result; + return 10; break; case 8: case 6: - _o_result = 12; - return _o_result; + return 12; break; default: OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence, class = ", 43); @@ -358,13 +333,10 @@ static void OPV_Len (OPT_Node n, int64 dim) static BOOLEAN OPV_SideEffects (OPT_Node n) { - BOOLEAN _o_result; if (n != NIL) { - _o_result = (n->class == 13 || OPV_SideEffects(n->left)) || OPV_SideEffects(n->right); - return _o_result; + return (n->class == 13 || OPV_SideEffects(n->left)) || OPV_SideEffects(n->right); } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } @@ -744,7 +716,6 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) static OPT_Object OPV_SuperProc (OPT_Node n) { - OPT_Object _o_result; OPT_Object obj = NIL; OPT_Struct typ = NIL; typ = n->right->typ; @@ -752,8 +723,7 @@ static OPT_Object OPV_SuperProc (OPT_Node n) typ = typ->BaseTyp; } OPT_FindField(n->left->obj->name, typ->BaseTyp, &obj); - _o_result = obj; - return _o_result; + return obj; } static void OPV_expr (OPT_Node n, int16 prec) @@ -1187,12 +1157,10 @@ static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc) static BOOLEAN OPV_ImplicitReturn (OPT_Node n) { - BOOLEAN _o_result; while ((n != NIL && n->class != 26)) { n = n->link; } - _o_result = n == NIL; - return _o_result; + return n == NIL; } static void OPV_NewArr (OPT_Node d, OPT_Node x) @@ -1523,21 +1491,16 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPM_WriteString((CHAR*)"__ENDMOD", 9); } } else { + OPC_ExitProc(outerProc, 0, 0); + OPM_WriteString((CHAR*)"return", 7); if (n->left != NIL) { - OPM_WriteString((CHAR*)"_o_result = ", 13); + OPM_Write(' '); if ((n->left->typ->form == 11 && n->obj->typ != n->left->typ)) { OPM_WriteString((CHAR*)"(void*)", 8); OPV_expr(n->left, 10); } else { OPV_expr(n->left, -1); } - OPM_WriteString((CHAR*)";", 2); - OPM_WriteLn(); - OPC_BegStat(); - OPC_ExitProc(outerProc, 0, 0); - OPM_WriteString((CHAR*)"return _o_result", 17); - } else { - OPM_WriteString((CHAR*)"return", 7); } } break; diff --git a/bootstrap/unix-48/Out.c b/bootstrap/unix-48/Out.c index 67a6c27b..0f0b9f79 100644 --- a/bootstrap/unix-48/Out.c +++ b/bootstrap/unix-48/Out.c @@ -56,14 +56,12 @@ void Out_Char (CHAR ch) static int32 Out_Length (CHAR *s, LONGINT s__len) { - int32 _o_result; int32 l; l = 0; while ((l < s__len && s[__X(l, s__len)] != 0x00)) { l += 1; } - _o_result = l; - return _o_result; + return l; } void Out_String (CHAR *str, LONGINT str__len) @@ -152,7 +150,6 @@ static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16 LONGREAL Out_Ten (int16 e) { - LONGREAL _o_result; LONGREAL r, power; r = (LONGREAL)1; power = (LONGREAL)10; @@ -163,8 +160,7 @@ LONGREAL Out_Ten (int16 e) power = power * power; e = __ASHR(e, 1); } - _o_result = r; - return _o_result; + return r; } static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_) diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index aa55dd0d..5c021003 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -174,65 +174,47 @@ extern void Heap_InitHeap(); BOOLEAN Platform_TooManyFiles (int16 e) { - BOOLEAN _o_result; - _o_result = e == Platform_EMFILE() || e == Platform_ENFILE(); - return _o_result; + return e == Platform_EMFILE() || e == Platform_ENFILE(); } BOOLEAN Platform_NoSuchDirectory (int16 e) { - BOOLEAN _o_result; - _o_result = e == Platform_ENOENT(); - return _o_result; + return e == Platform_ENOENT(); } BOOLEAN Platform_DifferentFilesystems (int16 e) { - BOOLEAN _o_result; - _o_result = e == Platform_EXDEV(); - return _o_result; + return e == Platform_EXDEV(); } BOOLEAN Platform_Inaccessible (int16 e) { - BOOLEAN _o_result; - _o_result = (e == Platform_EACCES() || e == Platform_EROFS()) || e == Platform_EAGAIN(); - return _o_result; + return (e == Platform_EACCES() || e == Platform_EROFS()) || e == Platform_EAGAIN(); } BOOLEAN Platform_Absent (int16 e) { - BOOLEAN _o_result; - _o_result = e == Platform_ENOENT(); - return _o_result; + return e == Platform_ENOENT(); } BOOLEAN Platform_TimedOut (int16 e) { - BOOLEAN _o_result; - _o_result = e == Platform_ETIMEDOUT(); - return _o_result; + return e == Platform_ETIMEDOUT(); } BOOLEAN Platform_ConnectionFailed (int16 e) { - BOOLEAN _o_result; - _o_result = ((e == Platform_ECONNREFUSED() || e == Platform_ECONNABORTED()) || e == Platform_ENETUNREACH()) || e == Platform_EHOSTUNREACH(); - return _o_result; + return ((e == Platform_ECONNREFUSED() || e == Platform_ECONNABORTED()) || e == Platform_ENETUNREACH()) || e == Platform_EHOSTUNREACH(); } BOOLEAN Platform_Interrupted (int16 e) { - BOOLEAN _o_result; - _o_result = e == Platform_EINTR(); - return _o_result; + return e == Platform_EINTR(); } int32 Platform_OSAllocate (int32 size) { - int32 _o_result; - _o_result = Platform_allocate(size); - return _o_result; + return Platform_allocate(size); } void Platform_OSFree (int32 address) @@ -253,16 +235,14 @@ void Platform_Init (int32 argc, int32 argvadr) BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len) { - BOOLEAN _o_result; Platform_EnvPtr p = NIL; __DUP(var, var__len, CHAR); p = Platform_getenv(var, var__len); if (p != NIL) { __COPY(*p, val, val__len); } - _o_result = p != NIL; __DEL(var); - return _o_result; + return p != NIL; } void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len) @@ -311,7 +291,6 @@ void Platform_GetIntArg (int16 n, int32 *val) int16 Platform_ArgPos (CHAR *s, LONGINT s__len) { - int16 _o_result; int16 i; CHAR arg[256]; __DUP(s, s__len, CHAR); @@ -321,9 +300,8 @@ int16 Platform_ArgPos (CHAR *s, LONGINT s__len) i += 1; Platform_GetArg(i, (void*)arg, 256); } - _o_result = i; __DEL(s); - return _o_result; + return i; } void Platform_SetInterruptHandler (Platform_SignalHandler handler) @@ -363,12 +341,10 @@ void Platform_GetTimeOfDay (int32 *sec, int32 *usec) int32 Platform_Time (void) { - int32 _o_result; int32 ms; Platform_gettimeval(); ms = (int)__DIVF(Platform_tvusec(), 1000) + Platform_tvsec() * 1000; - _o_result = (int)__MOD(ms - Platform_TimeStart, 2147483647); - return _o_result; + return (int)__MOD(ms - Platform_TimeStart, 2147483647); } void Platform_Delay (int32 ms) @@ -381,126 +357,100 @@ void Platform_Delay (int32 ms) int16 Platform_System (CHAR *cmd, LONGINT cmd__len) { - int16 _o_result; __DUP(cmd, cmd__len, CHAR); - _o_result = Platform_system(cmd, cmd__len); __DEL(cmd); - return _o_result; + return Platform_system(cmd, cmd__len); } int16 Platform_Error (void) { - int16 _o_result; - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h) { - int16 _o_result; int16 fd; fd = Platform_openro(n, n__len); if (fd < 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { *h = fd; - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h) { - int16 _o_result; int16 fd; fd = Platform_openrw(n, n__len); if (fd < 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { *h = fd; - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h) { - int16 _o_result; int16 fd; fd = Platform_opennew(n, n__len); if (fd < 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { *h = fd; - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_Close (int32 h) { - int16 _o_result; if (Platform_closefile(h) < 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ) { - int16 _o_result; Platform_structstats(); if (Platform_fstat(h) < 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } (*identity).volume = Platform_statdev(); (*identity).index = Platform_statino(); (*identity).mtime = Platform_statmtime(); - _o_result = 0; - return _o_result; + return 0; } int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ) { - int16 _o_result; __DUP(n, n__len, CHAR); Platform_structstats(); if (Platform_stat(n, n__len) < 0) { - _o_result = Platform_err(); __DEL(n); - return _o_result; + return Platform_err(); } (*identity).volume = Platform_statdev(); (*identity).index = Platform_statino(); (*identity).mtime = Platform_statmtime(); - _o_result = 0; __DEL(n); - return _o_result; + return 0; } BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2) { - BOOLEAN _o_result; - _o_result = (i1.index == i2.index && i1.volume == i2.volume); - return _o_result; + return (i1.index == i2.index && i1.volume == i2.volume); } BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2) { - BOOLEAN _o_result; - _o_result = i1.mtime == i2.mtime; - return _o_result; + return i1.mtime == i2.mtime; } void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Platform_FileIdentity source) @@ -516,137 +466,107 @@ void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d) int16 Platform_Size (int32 h, int32 *l) { - int16 _o_result; Platform_structstats(); if (Platform_fstat(h) < 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } *l = Platform_statsize(); - _o_result = 0; - return _o_result; + return 0; } int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n) { - int16 _o_result; *n = Platform_readfile(h, p, l); if (*n < 0) { *n = 0; - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n) { - int16 _o_result; *n = Platform_readfile(h, (address)b, b__len); if (*n < 0) { *n = 0; - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_Write (int32 h, int32 p, int32 l) { - int16 _o_result; int32 written; written = Platform_writefile(h, p, l); if (written < 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_Sync (int32 h) { - int16 _o_result; if (Platform_fsync(h) < 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_Seek (int32 h, int32 offset, int16 whence) { - int16 _o_result; if (Platform_lseek(h, offset, whence) < 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_Truncate (int32 h, int32 l) { - int16 _o_result; if (Platform_ftruncate(h, l) < 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_Unlink (CHAR *n, LONGINT n__len) { - int16 _o_result; if (Platform_unlink(n, n__len) < 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_Chdir (CHAR *n, LONGINT n__len) { - int16 _o_result; int16 r; if ((Platform_chdir(n, n__len) >= 0 && Platform_getcwd((void*)Platform_CWD, 256) != NIL)) { - _o_result = 0; - return _o_result; + return 0; } else { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } __RETCHK; } int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) { - int16 _o_result; if (Platform_rename(o, o__len, n, n__len) < 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 87ddfb2a..0aca5733 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -25,7 +25,6 @@ static CHAR Reals_ToHex (int16 i); REAL Reals_Ten (int16 e) { - REAL _o_result; LONGREAL r, power; r = (LONGREAL)1; power = (LONGREAL)10; @@ -36,13 +35,11 @@ REAL Reals_Ten (int16 e) power = power * power; e = __ASHR(e, 1); } - _o_result = r; - return _o_result; + return r; } LONGREAL Reals_TenL (int16 e) { - LONGREAL _o_result; LONGREAL r, power; r = (LONGREAL)1; power = (LONGREAL)10; @@ -52,8 +49,7 @@ LONGREAL Reals_TenL (int16 e) } e = __ASHR(e, 1); if (e <= 0) { - _o_result = r; - return _o_result; + return r; } power = power * power; } @@ -62,11 +58,9 @@ LONGREAL Reals_TenL (int16 e) int16 Reals_Expo (REAL x) { - int16 _o_result; int16 i; __GET((address)&x + 2, i, int16); - _o_result = __MASK(__ASHR(i, 7), -256); - return _o_result; + return __MASK(__ASHR(i, 7), -256); } void Reals_SetExpo (REAL *x, int16 ex) @@ -80,11 +74,9 @@ void Reals_SetExpo (REAL *x, int16 ex) int16 Reals_ExpoL (LONGREAL x) { - int16 _o_result; int16 i; __GET((address)&x + 6, i, int16); - _o_result = __MASK(__ASHR(i, 4), -2048); - return _o_result; + return __MASK(__ASHR(i, 4), -2048); } void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len) @@ -122,13 +114,10 @@ void Reals_Convert (REAL x, int16 n, CHAR *d, LONGINT d__len) static CHAR Reals_ToHex (int16 i) { - CHAR _o_result; if (i < 10) { - _o_result = (CHAR)(i + 48); - return _o_result; + return (CHAR)(i + 48); } else { - _o_result = (CHAR)(i + 55); - return _o_result; + return (CHAR)(i + 55); } __RETCHK; } diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index 5bbe808d..000c09c8 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -23,7 +23,6 @@ export void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR int16 Strings_Length (CHAR *s, LONGINT s__len) { - int16 _o_result; int32 i; __DUP(s, s__len, CHAR); i = 0; @@ -31,13 +30,11 @@ int16 Strings_Length (CHAR *s, LONGINT s__len) i += 1; } if (i <= 32767) { - _o_result = (int16)i; __DEL(s); - return _o_result; + return (int16)i; } else { - _o_result = 32767; __DEL(s); - return _o_result; + return 32767; } __RETCHK; } @@ -70,6 +67,7 @@ void Strings_Insert (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, L } if (pos > n1) { Strings_Append(dest, dest__len, (void*)source, source__len); + __DEL(source); return; } if ((pos + n2) < dest__len) { @@ -131,6 +129,7 @@ void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHA } if (pos >= len) { dest[0] = 0x00; + __DEL(source); return; } i = 0; @@ -146,17 +145,15 @@ void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHA int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int16 pos) { - int16 _o_result; int16 n1, n2, i, j; __DUP(pattern, pattern__len, CHAR); __DUP(s, s__len, CHAR); n1 = Strings_Length(s, s__len); n2 = Strings_Length(pattern, pattern__len); if (n2 == 0) { - _o_result = 0; __DEL(pattern); __DEL(s); - return _o_result; + return 0; } i = pos; while (i <= n1 - n2) { @@ -166,18 +163,16 @@ int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, j += 1; } if (j == n2) { - _o_result = i; __DEL(pattern); __DEL(s); - return _o_result; + return i; } } i += 1; } - _o_result = -1; __DEL(pattern); __DEL(s); - return _o_result; + return -1; } void Strings_Cap (CHAR *s, LONGINT s__len) @@ -200,50 +195,42 @@ static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__le static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, int16 n, int16 m) { - BOOLEAN _o_result; while ((((n >= 0 && m >= 0)) && mask[__X(m, mask__len)] != '*')) { if (name[__X(n, name__len)] != mask[__X(m, mask__len)]) { - _o_result = 0; - return _o_result; + return 0; } n -= 1; m -= 1; } if (m < 0) { - _o_result = n < 0; - return _o_result; + return n < 0; } while ((m >= 0 && mask[__X(m, mask__len)] == '*')) { m -= 1; } if (m < 0) { - _o_result = 1; - return _o_result; + return 1; } while (n >= 0) { if (M__8(name, name__len, mask, mask__len, n, m)) { - _o_result = 1; - return _o_result; + return 1; } n -= 1; } - _o_result = 0; - return _o_result; + return 0; } BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len) { - BOOLEAN _o_result; struct Match__7 _s; __DUP(string, string__len, CHAR); __DUP(pattern, pattern__len, CHAR); _s.lnk = Match__7_s; Match__7_s = &_s; - _o_result = M__8((void*)string, string__len, (void*)pattern, pattern__len, Strings_Length(string, string__len) - 1, Strings_Length(pattern, pattern__len) - 1); Match__7_s = _s.lnk; __DEL(string); __DEL(pattern); - return _o_result; + return M__8((void*)string, string__len, (void*)pattern, pattern__len, Strings_Length(string, string__len) - 1, Strings_Length(pattern, pattern__len) - 1); } diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index 6676d700..961ebbe7 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -234,12 +234,10 @@ export void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGIN static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len) { - Texts_FontsFont _o_result; Texts_FontsFont F = NIL; __NEW(F, Texts_FontDesc); __COPY(name, F->name, 32); - _o_result = F; - return _o_result; + return F; } static void Texts_Find (Texts_Text T, int32 *pos, Texts_Run *u, int32 *org, int32 *off) @@ -338,22 +336,18 @@ static void Texts_Splice (Texts_Run un, Texts_Run v, Texts_Run w, Texts_Text bas static Texts_Piece Texts_ClonePiece (Texts_Piece p) { - Texts_Piece _o_result; Texts_Piece q = NIL; __NEW(q, Texts_PieceDesc); __GUARDEQP(q, Texts_PieceDesc) = *p; - _o_result = q; - return _o_result; + return q; } static Texts_Elem Texts_CloneElem (Texts_Elem e) { - Texts_Elem _o_result; Texts_CopyMsg msg; msg.e = NIL; (*e->handle)(e, (void*)&msg, Texts_CopyMsg__typ); - _o_result = msg.e; - return _o_result; + return msg.e; } void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE) @@ -369,14 +363,11 @@ void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE) Texts_Text Texts_ElemBase (Texts_Elem E) { - Texts_Text _o_result; - _o_result = E->base; - return _o_result; + return E->base; } int32 Texts_ElemPos (Texts_Elem E) { - int32 _o_result; Texts_Run u = NIL; int32 pos; u = E->base->head->next; @@ -385,8 +376,7 @@ int32 Texts_ElemPos (Texts_Elem E) pos = pos + u->len; u = u->next; } - _o_result = pos; - return _o_result; + return pos; } static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, address *msg__typ) @@ -716,9 +706,7 @@ void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ) int32 Texts_Pos (Texts_Reader *R, address *R__typ) { - int32 _o_result; - _o_result = (*R).org + (*R).off; - return _o_result; + return (*R).org + (*R).off; } void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int32 pos) diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index c2373ac4..686dbfbf 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -317,14 +317,11 @@ void Files_Close (Files_File f) int32 Files_Length (Files_File f) { - int32 _o_result; - _o_result = f->len; - return _o_result; + return f->len; } Files_File Files_New (CHAR *name, LONGINT name__len) { - Files_File _o_result; Files_File f = NIL; __DUP(name, name__len, CHAR); __NEW(f, Files_FileDesc); @@ -335,9 +332,8 @@ Files_File Files_New (CHAR *name, LONGINT name__len) f->len = 0; f->pos = 0; f->swapper = -1; - _o_result = f; __DEL(name); - return _o_result; + return f; } static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len) @@ -385,7 +381,6 @@ static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len) static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len) { - BOOLEAN _o_result; int16 i; CHAR ch; i = 0; @@ -394,13 +389,11 @@ static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len) i += 1; ch = name[i]; } - _o_result = ch == '/'; - return _o_result; + return ch == '/'; } static Files_File Files_CacheEntry (Platform_FileIdentity identity) { - Files_File _o_result; Files_File f = NIL; int16 i, error; f = Files_files; @@ -419,18 +412,15 @@ static Files_File Files_CacheEntry (Platform_FileIdentity identity) f->identity = identity; error = Platform_Size(f->fd, &f->len); } - _o_result = f; - return _o_result; + return f; } f = f->next; } - _o_result = NIL; - return _o_result; + return NIL; } Files_File Files_Old (CHAR *name, LONGINT name__len) { - Files_File _o_result; Files_File f = NIL; int32 fd; int16 pos; @@ -470,9 +460,8 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) error = Platform_Identify(fd, &identity, Platform_FileIdentity__typ); f = Files_CacheEntry(identity); if (f != NIL) { - _o_result = f; __DEL(name); - return _o_result; + return f; } else { __NEW(f, Files_FileDesc); Heap_RegisterFinalizer((void*)f, Files_Finalize); @@ -488,23 +477,20 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) f->next = Files_files; Files_files = f; Heap_FileCount += 1; - _o_result = f; __DEL(name); - return _o_result; + return f; } } else if (dir[0] == 0x00) { - _o_result = NIL; __DEL(name); - return _o_result; + return NIL; } else { Files_MakeFileName(dir, 256, name, name__len, (void*)path, 256); Files_ScanPath(&pos, (void*)dir, 256); } } } else { - _o_result = NIL; __DEL(name); - return _o_result; + return NIL; } __RETCHK; } @@ -544,9 +530,7 @@ void Files_GetDate (Files_File f, int32 *t, int32 *d) int32 Files_Pos (Files_Rider *r, address *r__typ) { - int32 _o_result; - _o_result = (*r).org + (*r).offset; - return _o_result; + return (*r).org + (*r).offset; } void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos) @@ -673,9 +657,7 @@ void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x Files_File Files_Base (Files_Rider *r, address *r__typ) { - Files_File _o_result; - _o_result = (*r).buf->f; - return _o_result; + return (*r).buf->f; } void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x) @@ -759,17 +741,23 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int error = Platform_Rename((void*)old, old__len, (void*)new, new__len); if (!Platform_DifferentFilesystems(error)) { *res = error; + __DEL(old); + __DEL(new); return; } else { error = Platform_OldRO((void*)old, old__len, &fdold); if (error != 0) { *res = 2; + __DEL(old); + __DEL(new); return; } error = Platform_New((void*)new, new__len, &fdnew); if (error != 0) { error = Platform_Close(fdold); *res = 3; + __DEL(old); + __DEL(new); return; } error = Platform_Read(fdold, (address)buf, 4096, &n); diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index 0da695a9..5117800b 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -127,7 +127,6 @@ void Heap_Unlock (void) SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) { - SYSTEM_PTR _o_result; Heap_Module m; if (__STRCMP(name, "Heap") == 0) { __SYSNEW(m, 64); @@ -141,8 +140,7 @@ SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) m->enumPtrs = enumPtrs; m->next = (Heap_Module)(address)Heap_modules; Heap_modules = (SYSTEM_PTR)m; - _o_result = (void*)m; - return _o_result; + return (void*)m; } void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) @@ -172,7 +170,6 @@ void Heap_INCREF (Heap_Module m) static int64 Heap_NewChunk (int64 blksz) { - int64 _o_result; int64 chnk; chnk = Heap_OSAllocate(blksz + 24); if (chnk != 0) { @@ -184,8 +181,7 @@ static int64 Heap_NewChunk (int64 blksz) Heap_bigBlocks = chnk + 24; Heap_heapsize += blksz; } - _o_result = chnk; - return _o_result; + return chnk; } static void Heap_ExtendHeap (int64 blksz) @@ -219,7 +215,6 @@ static void Heap_ExtendHeap (int64 blksz) SYSTEM_PTR Heap_NEWREC (int64 tag) { - SYSTEM_PTR _o_result; int64 i, i0, di, blksz, restsize, t, adr, end, next, prev; SYSTEM_PTR new; Heap_Lock(); @@ -267,12 +262,10 @@ SYSTEM_PTR Heap_NEWREC (int64 tag) new = Heap_NEWREC(tag); } Heap_Unlock(); - _o_result = new; - return _o_result; + return new; } else { Heap_Unlock(); - _o_result = NIL; - return _o_result; + return NIL; } } __GET(adr + 8, t, int64); @@ -320,13 +313,11 @@ SYSTEM_PTR Heap_NEWREC (int64 tag) __PUT(adr + 16, 0, int64); Heap_allocated += blksz; Heap_Unlock(); - _o_result = (SYSTEM_PTR)(address)(adr + 8); - return _o_result; + return (SYSTEM_PTR)(address)(adr + 8); } SYSTEM_PTR Heap_NEWBLK (int64 size) { - SYSTEM_PTR _o_result; int64 blksz, tag; SYSTEM_PTR new; Heap_Lock(); @@ -338,8 +329,7 @@ SYSTEM_PTR Heap_NEWBLK (int64 size) __PUT(tag + 8, -8, int64); __PUT((int64)(address)new - 8, tag, int64); Heap_Unlock(); - _o_result = new; - return _o_result; + return new; } static void Heap_Mark (int64 q) diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 9f7407f0..97e17ad2 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -74,7 +74,6 @@ static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len) Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len) { - Modules_Module _o_result; Modules_Module m = NIL; CHAR bodyname[64]; Modules_Command body; @@ -93,14 +92,12 @@ Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len) Modules_Append((void*)Modules_resMsg, 256, name, name__len); Modules_Append((void*)Modules_resMsg, 256, (CHAR*)"\" not found", 12); } - _o_result = m; __DEL(name); - return _o_result; + return m; } Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len) { - Modules_Command _o_result; Modules_Cmd c = NIL; __DUP(name, name__len, CHAR); c = mod->cmds; @@ -110,9 +107,8 @@ Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT nam if (c != NIL) { Modules_res = 0; Modules_resMsg[0] = 0x00; - _o_result = c->cmd; __DEL(name); - return _o_result; + return c->cmd; } else { Modules_res = 2; __MOVE(" command \"", Modules_resMsg, 11); @@ -121,9 +117,8 @@ Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT nam Modules_Append((void*)Modules_resMsg, 256, (CHAR*)".", 2); Modules_Append((void*)Modules_resMsg, 256, name, name__len); Modules_Append((void*)Modules_resMsg, 256, (CHAR*)"\" not found", 12); - _o_result = NIL; __DEL(name); - return _o_result; + return NIL; } __RETCHK; } diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index 038bd92c..dff6adc6 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -74,7 +74,6 @@ static void OPB_err (int16 n) OPT_Node OPB_NewLeaf (OPT_Object obj) { - OPT_Node _o_result; OPT_Node node = NIL; switch (obj->mode) { case 1: @@ -102,8 +101,7 @@ OPT_Node OPB_NewLeaf (OPT_Object obj) } node->obj = obj; node->typ = obj->typ; - _o_result = node; - return _o_result; + return node; } void OPB_Construct (int8 class, OPT_Node *x, OPT_Node y) @@ -131,34 +129,27 @@ void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y) static int16 OPB_BoolToInt (BOOLEAN b) { - int16 _o_result; if (b) { - _o_result = 1; - return _o_result; + return 1; } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } static BOOLEAN OPB_IntToBool (int64 i) { - BOOLEAN _o_result; - _o_result = i != 0; - return _o_result; + return i != 0; } OPT_Node OPB_NewBoolConst (BOOLEAN boolval) { - OPT_Node _o_result; OPT_Node x = NIL; x = OPT_NewNode(7); x->typ = OPT_booltyp; x->conval = OPT_NewConst(); x->conval->intval = OPB_BoolToInt(boolval); - _o_result = x; - return _o_result; + return x; } void OPB_OptIf (OPT_Node *x) @@ -198,26 +189,22 @@ void OPB_OptIf (OPT_Node *x) OPT_Node OPB_Nil (void) { - OPT_Node _o_result; OPT_Node x = NIL; x = OPT_NewNode(7); x->typ = OPT_niltyp; x->conval = OPT_NewConst(); x->conval->intval = 0; - _o_result = x; - return _o_result; + return x; } OPT_Node OPB_EmptySet (void) { - OPT_Node _o_result; OPT_Node x = NIL; x = OPT_NewNode(7); x->typ = OPT_settyp; x->conval = OPT_NewConst(); x->conval->setval = 0x0; - _o_result = x; - return _o_result; + return x; } static void OPB_SetIntType (OPT_Node node) @@ -238,32 +225,27 @@ static void OPB_SetSetType (OPT_Node node) OPT_Node OPB_NewIntConst (int64 intval) { - OPT_Node _o_result; OPT_Node x = NIL; x = OPT_NewNode(7); x->conval = OPT_NewConst(); x->conval->intval = intval; OPB_SetIntType(x); - _o_result = x; - return _o_result; + return x; } OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ) { - OPT_Node _o_result; OPT_Node x = NIL; x = OPT_NewNode(7); x->conval = OPT_NewConst(); x->conval->realval = realval; x->typ = typ; x->conval->intval = -1; - _o_result = x; - return _o_result; + return x; } OPT_Node OPB_NewString (OPS_String str, int64 len) { - OPT_Node _o_result; OPT_Node x = NIL; x = OPT_NewNode(7); x->conval = OPT_NewConst(); @@ -272,8 +254,7 @@ OPT_Node OPB_NewString (OPS_String str, int64 len) x->conval->intval2 = OPM_Longint(len); x->conval->ext = OPT_NewExt(); __COPY(str, *x->conval->ext, 256); - _o_result = x; - return _o_result; + return x; } static void OPB_CharToString (OPT_Node n) @@ -305,9 +286,7 @@ static void OPB_BindNodes (int8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y) static BOOLEAN OPB_NotVar (OPT_Node x) { - BOOLEAN _o_result; - _o_result = (x->class >= 7 && ((x->class != 11 || x->subcl != 29) || x->left->class >= 7)); - return _o_result; + return (x->class >= 7 && ((x->class != 11 || x->subcl != 29) || x->left->class >= 7)); } void OPB_DeRef (OPT_Node *x) @@ -489,7 +468,6 @@ void OPB_In (OPT_Node *x, OPT_Node y) static int64 OPB_log (int64 x) { - int64 _o_result; OPB_exp = 0; if (x > 0) { while (!__ODD(x)) { @@ -497,8 +475,7 @@ static int64 OPB_log (int64 x) OPB_exp += 1; } } - _o_result = x; - return _o_result; + return x; } static void OPB_CheckRealType (int16 f, int16 nr, OPT_Const x) @@ -529,14 +506,12 @@ static OPT_Node NewOp__29 (int8 op, OPT_Struct typ, OPT_Node z); static OPT_Node NewOp__29 (int8 op, OPT_Struct typ, OPT_Node z) { - OPT_Node _o_result; OPT_Node node = NIL; node = OPT_NewNode(11); node->subcl = op; node->typ = typ; node->left = z; - _o_result = node; - return _o_result; + return node; } void OPB_MOp (int8 op, OPT_Node *x) @@ -775,7 +750,6 @@ static int16 ConstCmp__14 (void); static int16 ConstCmp__14 (void) { - int16 _o_result; int16 res; switch (*ConstOp__13_s->f) { case 0: @@ -836,8 +810,7 @@ static int16 ConstCmp__14 (void) break; } (*ConstOp__13_s->x)->typ = OPT_booltyp; - _o_result = res; - return _o_result; + return res; } static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) @@ -1202,7 +1175,6 @@ static void NewOp__39 (int8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y) static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) { - BOOLEAN _o_result; BOOLEAN ok, xCharArr, yCharArr; xCharArr = (__IN((*x)->typ->comp, 0x0c, 32) && (*x)->typ->BaseTyp->form == 3) || *Op__38_s->f == 8; yCharArr = (__IN((*y)->typ->comp, 0x0c, 32) && (*y)->typ->BaseTyp->form == 3) || *Op__38_s->g == 8; @@ -1228,8 +1200,7 @@ static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) OPB_Index(&*x, OPB_NewIntConst(0)); } } - _o_result = ok; - return _o_result; + return ok; } void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) @@ -2016,14 +1987,12 @@ static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right) { - OPT_Node _o_result; OPT_Node node = NIL; node = OPT_NewNode(class); node->subcl = subcl; node->left = left; node->right = right; - _o_result = node; - return _o_result; + return node; } void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index 20c369e9..9401b9a7 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -157,19 +157,16 @@ static void OPC_Str1 (CHAR *s, LONGINT s__len, int32 x) static int16 OPC_Length (CHAR *s, LONGINT s__len) { - int16 _o_result; int16 i; i = 0; while (s[__X(i, s__len)] != 0x00) { i += 1; } - _o_result = i; - return _o_result; + return i; } static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len) { - int16 _o_result; int16 i, h; i = 0; h = 0; @@ -177,8 +174,7 @@ static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len) h = 3 * h + (int16)s[__X(i, s__len)]; i += 1; } - _o_result = (int)__MOD(h, 105); - return _o_result; + return (int)__MOD(h, 105); } void OPC_Ident (OPT_Object obj) @@ -320,9 +316,7 @@ void OPC_Andent (OPT_Struct typ) static BOOLEAN OPC_Undefined (OPT_Object obj) { - BOOLEAN _o_result; - _o_result = obj->name[0] == 0x00 || (((obj->mnolev >= 0 && obj->linkadr != (3 + OPM_currFile))) && obj->linkadr != 2); - return _o_result; + return obj->name[0] == 0x00 || (((obj->mnolev >= 0 && obj->linkadr != (3 + OPM_currFile))) && obj->linkadr != 2); } static void OPC_DeclareBase (OPT_Object dcl) @@ -391,13 +385,11 @@ static void OPC_DeclareBase (OPT_Object dcl) int32 OPC_NofPtrs (OPT_Struct typ) { - int32 _o_result; OPT_Object fld = NIL; OPT_Struct btyp = NIL; int32 n; if ((typ->form == 11 && typ->sysflag == 0)) { - _o_result = 1; - return _o_result; + return 1; } else if ((typ->comp == 4 && __MASK(typ->sysflag, -256) == 0)) { btyp = typ->BaseTyp; if (btyp != NIL) { @@ -414,8 +406,7 @@ int32 OPC_NofPtrs (OPT_Struct typ) } fld = fld->link; } - _o_result = n; - return _o_result; + return n; } else if (typ->comp == 2) { btyp = typ->BaseTyp; n = typ->n; @@ -423,11 +414,9 @@ int32 OPC_NofPtrs (OPT_Struct typ) n = btyp->n * n; btyp = btyp->BaseTyp; } - _o_result = OPC_NofPtrs(btyp) * n; - return _o_result; + return OPC_NofPtrs(btyp) * n; } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } @@ -608,7 +597,6 @@ static void OPC_DeclareTProcs (OPT_Object obj, BOOLEAN *empty) OPT_Object OPC_BaseTProc (OPT_Object obj) { - OPT_Object _o_result; OPT_Struct typ = NIL, base = NIL; int32 mno; typ = obj->link->typ; @@ -622,8 +610,7 @@ OPT_Object OPC_BaseTProc (OPT_Object obj) base = typ->BaseTyp; } OPT_FindField(obj->name, typ, &obj); - _o_result = obj; - return _o_result; + return obj; } static void OPC_DefineTProcMacros (OPT_Object obj, BOOLEAN *empty) @@ -734,18 +721,14 @@ static void OPC_DefineType (OPT_Struct str) static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len) { - BOOLEAN _o_result; int16 i; - BOOLEAN r; __DUP(y, y__len, CHAR); i = 0; while ((*x)[__X(i + 1, 256)] == y[__X(i, y__len)]) { i += 1; } - r = y[__X(i, y__len)] == 0x00; - _o_result = r; __DEL(y); - return _o_result; + return y[__X(i, y__len)] == 0x00; } static void OPC_CProcDefs (OPT_Object obj, int16 vis) @@ -1455,12 +1438,6 @@ void OPC_EnterProc (OPT_Object proc) } OPC_ProcHeader(proc, 1); OPC_BegBlk(); - if (proc->typ != OPT_notyp) { - OPC_BegStat(); - OPC_Ident(proc->typ->strobj); - OPM_WriteString((CHAR*)" _o_result;", 12); - OPM_WriteLn(); - } scope = proc->scope; OPC_IdentList(scope->scope, 0); if (!scope->leaf) { diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 47d8fab3..5b67d672 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -124,33 +124,25 @@ void OPM_LogWLn (void) int64 OPM_SignedMaximum (int32 bytecount) { - int64 _o_result; int64 result; result = 1; result = __LSH(result, __ASHL(bytecount, 3) - 1, 64); - _o_result = result - 1; - return _o_result; + return result - 1; } int64 OPM_SignedMinimum (int32 bytecount) { - int64 _o_result; - _o_result = -OPM_SignedMaximum(bytecount) - 1; - return _o_result; + return -OPM_SignedMaximum(bytecount) - 1; } int32 OPM_Longint (int64 n) { - int32 _o_result; - _o_result = __VAL(int32, n); - return _o_result; + return __VAL(int32, n); } int16 OPM_Integer (int64 n) { - int16 _o_result; - _o_result = __VAL(int16, n); - return _o_result; + return __VAL(int16, n); } static void OPM_ScanOptions (CHAR *s, LONGINT s__len) @@ -266,7 +258,6 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len) BOOLEAN OPM_OpenPar (void) { - BOOLEAN _o_result; CHAR s[256]; if (Platform_ArgCount == 1) { OPM_LogWLn(); @@ -274,7 +265,7 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWStr(Configuration_versionLong, 75); OPM_LogW('.'); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Based on Ofront by Software Templ OEG.", 39); + OPM_LogWStr((CHAR*)"Based on Ofront by J. Templ and Software Templ OEG.", 52); OPM_LogWLn(); OPM_LogWStr((CHAR*)"Further development by Norayr Chilingarian, David Brown and others.", 68); OPM_LogWLn(); @@ -287,7 +278,7 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWStr((CHAR*)" options {files {options}}.", 28); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Where options = [\"-\" {option} ].", 33); + OPM_LogWStr((CHAR*)"Options:", 9); OPM_LogWLn(); OPM_LogWLn(); OPM_LogWStr((CHAR*)" Run time safety", 18); @@ -345,7 +336,7 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWLn(); OPM_LogWStr((CHAR*)" -A48 32 bit addresses, 64 bit alignment (e.g. Windows 32 bit on x86, linux 32 bit on arm).", 97); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -A88 66 bit addresses, 64 bit alignment (e.g. 64 bit platforms).", 71); + OPM_LogWStr((CHAR*)" -A88 64 bit addresses, 64 bit alignment (e.g. 64 bit platforms).", 71); OPM_LogWLn(); OPM_LogWLn(); OPM_LogWStr((CHAR*)"All options are off by default, except where noted above.", 58); @@ -356,8 +347,7 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWLn(); OPM_LogWStr((CHAR*)"Repeating an option toggles its value.", 39); OPM_LogWLn(); - _o_result = 0; - return _o_result; + return 0; } else { OPM_AddressSize = 8; OPM_GetAlignment(&OPM_Alignment); @@ -376,8 +366,7 @@ BOOLEAN OPM_OpenPar (void) OPM_GlobalAlignment = OPM_Alignment; __COPY(OPM_Model, OPM_GlobalModel, 10); OPM_GlobalOptions = OPM_Options; - _o_result = 1; - return _o_result; + return 1; } __RETCHK; } @@ -741,20 +730,16 @@ void OPM_SymRCh (CHAR *ch) int32 OPM_SymRInt (void) { - int32 _o_result; int32 k; Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&k, 4); - _o_result = k; - return _o_result; + return k; } int64 OPM_SymRInt64 (void) { - int64 _o_result; int64 k; Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&k, 8); - _o_result = k; - return _o_result; + return k; } void OPM_SymRSet (uint64 *s) @@ -797,9 +782,7 @@ void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done) BOOLEAN OPM_eofSF (void) { - BOOLEAN _o_result; - _o_result = OPM_oldSF.eof; - return _o_result; + return OPM_oldSF.eof; } void OPM_SymWCh (CHAR ch) diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index 0325d7f2..615109df 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -901,7 +901,6 @@ static void OPP_Receiver (int8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct static BOOLEAN OPP_Extends (OPT_Struct x, OPT_Struct b) { - BOOLEAN _o_result; if ((b->form == 11 && x->form == 11)) { b = b->BaseTyp; x = x->BaseTyp; @@ -911,8 +910,7 @@ static BOOLEAN OPP_Extends (OPT_Struct x, OPT_Struct b) x = x->BaseTyp; } while (!(x == NIL || x == b)); } - _o_result = x == b; - return _o_result; + return x == b; } static struct ProcedureDeclaration__16 { diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index b3c52f3c..5a34663d 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -97,7 +97,6 @@ static LONGREAL Ten__9 (int16 e); static LONGREAL Ten__9 (int16 e) { - LONGREAL _o_result; LONGREAL x, p; x = (LONGREAL)1; p = (LONGREAL)10; @@ -110,23 +109,18 @@ static LONGREAL Ten__9 (int16 e) p = p * p; } } - _o_result = x; - return _o_result; + return x; } static int16 Ord__7 (CHAR ch, BOOLEAN hex) { - int16 _o_result; if (ch <= '9') { - _o_result = (int16)ch - 48; - return _o_result; + return (int16)ch - 48; } else if (hex) { - _o_result = ((int16)ch - 65) + 10; - return _o_result; + return ((int16)ch - 65) + 10; } else { OPS_err(2); - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } @@ -324,6 +318,7 @@ void OPS_Get (int8 *sym) while (OPS_ch <= ' ') { if (OPS_ch == 0x00) { *sym = 64; + Get__1_s = _s.lnk; return; } else { OPM_Get(&OPS_ch); diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index fe2c4bd5..48352c94 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -179,7 +179,6 @@ static void OPT_err (int16 n) int16 OPT_IntSize (int64 n) { - int16 _o_result; int16 bytes; if (n < 0) { n = -(n + 1); @@ -188,77 +187,59 @@ int16 OPT_IntSize (int64 n) while ((bytes < 8 && __ASH(n, -(__ASHL(bytes, 3) - 1)) != 0)) { bytes += 1; } - _o_result = bytes; - return _o_result; + return bytes; } OPT_Struct OPT_IntType (int32 size) { - OPT_Struct _o_result; if (size <= OPT_int8typ->size) { - _o_result = OPT_int8typ; - return _o_result; + return OPT_int8typ; } if (size <= OPT_int16typ->size) { - _o_result = OPT_int16typ; - return _o_result; + return OPT_int16typ; } if (size <= OPT_int32typ->size) { - _o_result = OPT_int32typ; - return _o_result; + return OPT_int32typ; } - _o_result = OPT_int64typ; - return _o_result; + return OPT_int64typ; } OPT_Struct OPT_SetType (int32 size) { - OPT_Struct _o_result; if (size == OPT_set32typ->size) { - _o_result = OPT_set32typ; - return _o_result; + return OPT_set32typ; } - _o_result = OPT_set64typ; - return _o_result; + return OPT_set64typ; } OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir) { - OPT_Struct _o_result; int16 i; __ASSERT(x->form == 4, 0); __ASSERT(x->BaseTyp == OPT_undftyp, 0); __ASSERT(dir == 1 || dir == -1, 0); if (dir > 0) { if (x->size < OPT_sinttyp->size) { - _o_result = OPT_sinttyp; - return _o_result; + return OPT_sinttyp; } if (x->size < OPT_inttyp->size) { - _o_result = OPT_inttyp; - return _o_result; + return OPT_inttyp; } if (x->size < OPT_linttyp->size) { - _o_result = OPT_linttyp; - return _o_result; + return OPT_linttyp; } - _o_result = OPT_int64typ; - return _o_result; + return OPT_int64typ; } else { if (x->size > OPT_linttyp->size) { - _o_result = OPT_linttyp; - return _o_result; + return OPT_linttyp; } if (x->size > OPT_inttyp->size) { - _o_result = OPT_inttyp; - return _o_result; + return OPT_inttyp; } if (x->size > OPT_sinttyp->size) { - _o_result = OPT_sinttyp; - return _o_result; + return OPT_sinttyp; } - _o_result = OPT_int8typ; - return _o_result; + return OPT_int8typ; } __RETCHK; } @@ -285,7 +266,6 @@ void OPT_Align (int32 *adr, int32 base) int32 OPT_SizeAlignment (int32 size) { - int32 _o_result; int32 alignment; if (size < OPM_Alignment) { alignment = 1; @@ -295,13 +275,11 @@ int32 OPT_SizeAlignment (int32 size) } else { alignment = OPM_Alignment; } - _o_result = alignment; - return _o_result; + return alignment; } int32 OPT_BaseAlignment (OPT_Struct typ) { - int32 _o_result; int32 alignment; if (typ->form == 13) { if (typ->comp == 4) { @@ -312,8 +290,7 @@ int32 OPT_BaseAlignment (OPT_Struct typ) } else { alignment = OPT_SizeAlignment(typ->size); } - _o_result = alignment; - return _o_result; + return alignment; } void OPT_TypSize (OPT_Struct typ) @@ -389,25 +366,20 @@ void OPT_TypSize (OPT_Struct typ) OPT_Const OPT_NewConst (void) { - OPT_Const _o_result; OPT_Const const_ = NIL; __NEW(const_, OPT_ConstDesc); - _o_result = const_; - return _o_result; + return const_; } OPT_Object OPT_NewObj (void) { - OPT_Object _o_result; OPT_Object obj = NIL; __NEW(obj, OPT_ObjDesc); - _o_result = obj; - return _o_result; + return obj; } OPT_Struct OPT_NewStr (int8 form, int8 comp) { - OPT_Struct _o_result; OPT_Struct typ = NIL; __NEW(typ, OPT_StrDesc); typ->form = form; @@ -418,27 +390,22 @@ OPT_Struct OPT_NewStr (int8 form, int8 comp) } typ->size = -1; typ->BaseTyp = OPT_undftyp; - _o_result = typ; - return _o_result; + return typ; } OPT_Node OPT_NewNode (int8 class) { - OPT_Node _o_result; OPT_Node node = NIL; __NEW(node, OPT_NodeDesc); node->class = class; - _o_result = node; - return _o_result; + return node; } OPT_ConstExt OPT_NewExt (void) { - OPT_ConstExt _o_result; OPT_ConstExt ext = NIL; ext = __NEWARR(NIL, 1, 1, 1, 0, ((int64)(256))); - _o_result = ext; - return _o_result; + return ext; } void OPT_OpenScope (int8 level, OPT_Object owner) @@ -1120,7 +1087,6 @@ static void OPT_InSign (int8 mno, OPT_Struct *res, OPT_Object *par) static OPT_Object OPT_InFld (void) { - OPT_Object _o_result; int32 tag; OPT_Object obj = NIL; tag = OPT_impCtxt.nextTag; @@ -1146,13 +1112,11 @@ static OPT_Object OPT_InFld (void) obj->vis = 0; obj->adr = OPM_SymRInt(); } - _o_result = obj; - return _o_result; + return obj; } static OPT_Object OPT_InTProc (int8 mno) { - OPT_Object _o_result; int32 tag; OPT_Object obj = NIL; tag = OPT_impCtxt.nextTag; @@ -1174,22 +1138,17 @@ static OPT_Object OPT_InTProc (int8 mno) obj->vis = 0; obj->adr = __ASHL(OPM_SymRInt(), 16); } - _o_result = obj; - return _o_result; + return obj; } static OPT_Struct OPT_InTyp (int32 tag) { - OPT_Struct _o_result; if (tag == 4) { - _o_result = OPT_IntType(OPM_SymRInt()); - return _o_result; + return OPT_IntType(OPM_SymRInt()); } else if (tag == 7) { - _o_result = OPT_SetType(OPM_SymRInt()); - return _o_result; + return OPT_SetType(OPM_SymRInt()); } else { - _o_result = OPT_impCtxt.ref[__X(tag, 255)]; - return _o_result; + return OPT_impCtxt.ref[__X(tag, 255)]; } __RETCHK; } @@ -1378,7 +1337,6 @@ static void OPT_InStruct (OPT_Struct *typ) static OPT_Object OPT_InObj (int8 mno) { - OPT_Object _o_result; int16 i, s; CHAR ch; OPT_Object obj = NIL, old = NIL; @@ -1475,8 +1433,7 @@ static OPT_Object OPT_InObj (int8 mno) } } } - _o_result = obj; - return _o_result; + return obj; } void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 64c3f578..c7a907db 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -207,44 +207,35 @@ void OPV_AdrAndSize (OPT_Object topScope) static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp) { - int16 _o_result; switch (class) { case 7: case 0: case 2: case 4: case 9: case 13: - _o_result = 10; - return _o_result; + return 10; break; case 5: if (__IN(3, OPM_Options, 32)) { - _o_result = 10; - return _o_result; + return 10; } else { - _o_result = 9; - return _o_result; + return 9; } break; case 1: if (__IN(comp, 0x0c, 32)) { - _o_result = 10; - return _o_result; + return 10; } else { - _o_result = 9; - return _o_result; + return 9; } break; case 3: - _o_result = 9; - return _o_result; + return 9; break; case 11: switch (subclass) { case 33: case 7: case 24: case 29: case 20: - _o_result = 9; - return _o_result; + return 9; break; case 16: case 21: case 22: case 23: case 25: - _o_result = 10; - return _o_result; + return 10; break; default: OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Nmop, subclass = ", 55); @@ -257,64 +248,50 @@ static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp switch (subclass) { case 1: if (form == 7) { - _o_result = 4; - return _o_result; + return 4; } else { - _o_result = 8; - return _o_result; + return 8; } break; case 2: if (form == 7) { - _o_result = 3; - return _o_result; + return 3; } else { - _o_result = 8; - return _o_result; + return 8; } break; case 3: case 4: - _o_result = 10; - return _o_result; + return 10; break; case 6: if (form == 7) { - _o_result = 2; - return _o_result; + return 2; } else { - _o_result = 7; - return _o_result; + return 7; } break; case 7: if (form == 7) { - _o_result = 4; - return _o_result; + return 4; } else { - _o_result = 7; - return _o_result; + return 7; } break; case 11: case 12: case 13: case 14: - _o_result = 6; - return _o_result; + return 6; break; case 9: case 10: - _o_result = 5; - return _o_result; + return 5; break; case 5: - _o_result = 1; - return _o_result; + return 1; break; case 8: - _o_result = 0; - return _o_result; + return 0; break; case 19: case 15: case 17: case 18: case 26: case 27: case 28: - _o_result = 10; - return _o_result; + return 10; break; default: OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Ndop, subclass = ", 55); @@ -324,12 +301,10 @@ static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp } break; case 10: - _o_result = 10; - return _o_result; + return 10; break; case 8: case 6: - _o_result = 12; - return _o_result; + return 12; break; default: OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence, class = ", 43); @@ -358,13 +333,10 @@ static void OPV_Len (OPT_Node n, int64 dim) static BOOLEAN OPV_SideEffects (OPT_Node n) { - BOOLEAN _o_result; if (n != NIL) { - _o_result = (n->class == 13 || OPV_SideEffects(n->left)) || OPV_SideEffects(n->right); - return _o_result; + return (n->class == 13 || OPV_SideEffects(n->left)) || OPV_SideEffects(n->right); } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } @@ -744,7 +716,6 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) static OPT_Object OPV_SuperProc (OPT_Node n) { - OPT_Object _o_result; OPT_Object obj = NIL; OPT_Struct typ = NIL; typ = n->right->typ; @@ -752,8 +723,7 @@ static OPT_Object OPV_SuperProc (OPT_Node n) typ = typ->BaseTyp; } OPT_FindField(n->left->obj->name, typ->BaseTyp, &obj); - _o_result = obj; - return _o_result; + return obj; } static void OPV_expr (OPT_Node n, int16 prec) @@ -1187,12 +1157,10 @@ static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc) static BOOLEAN OPV_ImplicitReturn (OPT_Node n) { - BOOLEAN _o_result; while ((n != NIL && n->class != 26)) { n = n->link; } - _o_result = n == NIL; - return _o_result; + return n == NIL; } static void OPV_NewArr (OPT_Node d, OPT_Node x) @@ -1523,21 +1491,16 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPM_WriteString((CHAR*)"__ENDMOD", 9); } } else { + OPC_ExitProc(outerProc, 0, 0); + OPM_WriteString((CHAR*)"return", 7); if (n->left != NIL) { - OPM_WriteString((CHAR*)"_o_result = ", 13); + OPM_Write(' '); if ((n->left->typ->form == 11 && n->obj->typ != n->left->typ)) { OPM_WriteString((CHAR*)"(void*)", 8); OPV_expr(n->left, 10); } else { OPV_expr(n->left, -1); } - OPM_WriteString((CHAR*)";", 2); - OPM_WriteLn(); - OPC_BegStat(); - OPC_ExitProc(outerProc, 0, 0); - OPM_WriteString((CHAR*)"return _o_result", 17); - } else { - OPM_WriteString((CHAR*)"return", 7); } } break; diff --git a/bootstrap/unix-88/Out.c b/bootstrap/unix-88/Out.c index 67a6c27b..0f0b9f79 100644 --- a/bootstrap/unix-88/Out.c +++ b/bootstrap/unix-88/Out.c @@ -56,14 +56,12 @@ void Out_Char (CHAR ch) static int32 Out_Length (CHAR *s, LONGINT s__len) { - int32 _o_result; int32 l; l = 0; while ((l < s__len && s[__X(l, s__len)] != 0x00)) { l += 1; } - _o_result = l; - return _o_result; + return l; } void Out_String (CHAR *str, LONGINT str__len) @@ -152,7 +150,6 @@ static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16 LONGREAL Out_Ten (int16 e) { - LONGREAL _o_result; LONGREAL r, power; r = (LONGREAL)1; power = (LONGREAL)10; @@ -163,8 +160,7 @@ LONGREAL Out_Ten (int16 e) power = power * power; e = __ASHR(e, 1); } - _o_result = r; - return _o_result; + return r; } static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_) diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 5c2fada7..22ecf90b 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -174,65 +174,47 @@ extern void Heap_InitHeap(); BOOLEAN Platform_TooManyFiles (int16 e) { - BOOLEAN _o_result; - _o_result = e == Platform_EMFILE() || e == Platform_ENFILE(); - return _o_result; + return e == Platform_EMFILE() || e == Platform_ENFILE(); } BOOLEAN Platform_NoSuchDirectory (int16 e) { - BOOLEAN _o_result; - _o_result = e == Platform_ENOENT(); - return _o_result; + return e == Platform_ENOENT(); } BOOLEAN Platform_DifferentFilesystems (int16 e) { - BOOLEAN _o_result; - _o_result = e == Platform_EXDEV(); - return _o_result; + return e == Platform_EXDEV(); } BOOLEAN Platform_Inaccessible (int16 e) { - BOOLEAN _o_result; - _o_result = (e == Platform_EACCES() || e == Platform_EROFS()) || e == Platform_EAGAIN(); - return _o_result; + return (e == Platform_EACCES() || e == Platform_EROFS()) || e == Platform_EAGAIN(); } BOOLEAN Platform_Absent (int16 e) { - BOOLEAN _o_result; - _o_result = e == Platform_ENOENT(); - return _o_result; + return e == Platform_ENOENT(); } BOOLEAN Platform_TimedOut (int16 e) { - BOOLEAN _o_result; - _o_result = e == Platform_ETIMEDOUT(); - return _o_result; + return e == Platform_ETIMEDOUT(); } BOOLEAN Platform_ConnectionFailed (int16 e) { - BOOLEAN _o_result; - _o_result = ((e == Platform_ECONNREFUSED() || e == Platform_ECONNABORTED()) || e == Platform_ENETUNREACH()) || e == Platform_EHOSTUNREACH(); - return _o_result; + return ((e == Platform_ECONNREFUSED() || e == Platform_ECONNABORTED()) || e == Platform_ENETUNREACH()) || e == Platform_EHOSTUNREACH(); } BOOLEAN Platform_Interrupted (int16 e) { - BOOLEAN _o_result; - _o_result = e == Platform_EINTR(); - return _o_result; + return e == Platform_EINTR(); } int64 Platform_OSAllocate (int64 size) { - int64 _o_result; - _o_result = Platform_allocate(size); - return _o_result; + return Platform_allocate(size); } void Platform_OSFree (int64 address) @@ -253,16 +235,14 @@ void Platform_Init (int32 argc, int64 argvadr) BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len) { - BOOLEAN _o_result; Platform_EnvPtr p = NIL; __DUP(var, var__len, CHAR); p = Platform_getenv(var, var__len); if (p != NIL) { __COPY(*p, val, val__len); } - _o_result = p != NIL; __DEL(var); - return _o_result; + return p != NIL; } void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len) @@ -311,7 +291,6 @@ void Platform_GetIntArg (int16 n, int32 *val) int16 Platform_ArgPos (CHAR *s, LONGINT s__len) { - int16 _o_result; int16 i; CHAR arg[256]; __DUP(s, s__len, CHAR); @@ -321,9 +300,8 @@ int16 Platform_ArgPos (CHAR *s, LONGINT s__len) i += 1; Platform_GetArg(i, (void*)arg, 256); } - _o_result = i; __DEL(s); - return _o_result; + return i; } void Platform_SetInterruptHandler (Platform_SignalHandler handler) @@ -363,12 +341,10 @@ void Platform_GetTimeOfDay (int32 *sec, int32 *usec) int32 Platform_Time (void) { - int32 _o_result; int32 ms; Platform_gettimeval(); ms = (int)__DIVF(Platform_tvusec(), 1000) + Platform_tvsec() * 1000; - _o_result = (int)__MOD(ms - Platform_TimeStart, 2147483647); - return _o_result; + return (int)__MOD(ms - Platform_TimeStart, 2147483647); } void Platform_Delay (int32 ms) @@ -381,126 +357,100 @@ void Platform_Delay (int32 ms) int16 Platform_System (CHAR *cmd, LONGINT cmd__len) { - int16 _o_result; __DUP(cmd, cmd__len, CHAR); - _o_result = Platform_system(cmd, cmd__len); __DEL(cmd); - return _o_result; + return Platform_system(cmd, cmd__len); } int16 Platform_Error (void) { - int16 _o_result; - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h) { - int16 _o_result; int16 fd; fd = Platform_openro(n, n__len); if (fd < 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { *h = fd; - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h) { - int16 _o_result; int16 fd; fd = Platform_openrw(n, n__len); if (fd < 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { *h = fd; - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h) { - int16 _o_result; int16 fd; fd = Platform_opennew(n, n__len); if (fd < 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { *h = fd; - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_Close (int32 h) { - int16 _o_result; if (Platform_closefile(h) < 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ) { - int16 _o_result; Platform_structstats(); if (Platform_fstat(h) < 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } (*identity).volume = Platform_statdev(); (*identity).index = Platform_statino(); (*identity).mtime = Platform_statmtime(); - _o_result = 0; - return _o_result; + return 0; } int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ) { - int16 _o_result; __DUP(n, n__len, CHAR); Platform_structstats(); if (Platform_stat(n, n__len) < 0) { - _o_result = Platform_err(); __DEL(n); - return _o_result; + return Platform_err(); } (*identity).volume = Platform_statdev(); (*identity).index = Platform_statino(); (*identity).mtime = Platform_statmtime(); - _o_result = 0; __DEL(n); - return _o_result; + return 0; } BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2) { - BOOLEAN _o_result; - _o_result = (i1.index == i2.index && i1.volume == i2.volume); - return _o_result; + return (i1.index == i2.index && i1.volume == i2.volume); } BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2) { - BOOLEAN _o_result; - _o_result = i1.mtime == i2.mtime; - return _o_result; + return i1.mtime == i2.mtime; } void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Platform_FileIdentity source) @@ -516,137 +466,107 @@ void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d) int16 Platform_Size (int32 h, int32 *l) { - int16 _o_result; Platform_structstats(); if (Platform_fstat(h) < 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } *l = Platform_statsize(); - _o_result = 0; - return _o_result; + return 0; } int16 Platform_Read (int32 h, int64 p, int32 l, int32 *n) { - int16 _o_result; *n = Platform_readfile(h, p, l); if (*n < 0) { *n = 0; - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n) { - int16 _o_result; *n = Platform_readfile(h, (address)b, b__len); if (*n < 0) { *n = 0; - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_Write (int32 h, int64 p, int32 l) { - int16 _o_result; int64 written; written = Platform_writefile(h, p, l); if (written < 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_Sync (int32 h) { - int16 _o_result; if (Platform_fsync(h) < 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_Seek (int32 h, int32 offset, int16 whence) { - int16 _o_result; if (Platform_lseek(h, offset, whence) < 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_Truncate (int32 h, int32 l) { - int16 _o_result; if (Platform_ftruncate(h, l) < 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_Unlink (CHAR *n, LONGINT n__len) { - int16 _o_result; if (Platform_unlink(n, n__len) < 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_Chdir (CHAR *n, LONGINT n__len) { - int16 _o_result; int16 r; if ((Platform_chdir(n, n__len) >= 0 && Platform_getcwd((void*)Platform_CWD, 256) != NIL)) { - _o_result = 0; - return _o_result; + return 0; } else { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } __RETCHK; } int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) { - int16 _o_result; if (Platform_rename(o, o__len, n, n__len) < 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 87ddfb2a..0aca5733 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -25,7 +25,6 @@ static CHAR Reals_ToHex (int16 i); REAL Reals_Ten (int16 e) { - REAL _o_result; LONGREAL r, power; r = (LONGREAL)1; power = (LONGREAL)10; @@ -36,13 +35,11 @@ REAL Reals_Ten (int16 e) power = power * power; e = __ASHR(e, 1); } - _o_result = r; - return _o_result; + return r; } LONGREAL Reals_TenL (int16 e) { - LONGREAL _o_result; LONGREAL r, power; r = (LONGREAL)1; power = (LONGREAL)10; @@ -52,8 +49,7 @@ LONGREAL Reals_TenL (int16 e) } e = __ASHR(e, 1); if (e <= 0) { - _o_result = r; - return _o_result; + return r; } power = power * power; } @@ -62,11 +58,9 @@ LONGREAL Reals_TenL (int16 e) int16 Reals_Expo (REAL x) { - int16 _o_result; int16 i; __GET((address)&x + 2, i, int16); - _o_result = __MASK(__ASHR(i, 7), -256); - return _o_result; + return __MASK(__ASHR(i, 7), -256); } void Reals_SetExpo (REAL *x, int16 ex) @@ -80,11 +74,9 @@ void Reals_SetExpo (REAL *x, int16 ex) int16 Reals_ExpoL (LONGREAL x) { - int16 _o_result; int16 i; __GET((address)&x + 6, i, int16); - _o_result = __MASK(__ASHR(i, 4), -2048); - return _o_result; + return __MASK(__ASHR(i, 4), -2048); } void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len) @@ -122,13 +114,10 @@ void Reals_Convert (REAL x, int16 n, CHAR *d, LONGINT d__len) static CHAR Reals_ToHex (int16 i) { - CHAR _o_result; if (i < 10) { - _o_result = (CHAR)(i + 48); - return _o_result; + return (CHAR)(i + 48); } else { - _o_result = (CHAR)(i + 55); - return _o_result; + return (CHAR)(i + 55); } __RETCHK; } diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index 5bbe808d..000c09c8 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -23,7 +23,6 @@ export void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR int16 Strings_Length (CHAR *s, LONGINT s__len) { - int16 _o_result; int32 i; __DUP(s, s__len, CHAR); i = 0; @@ -31,13 +30,11 @@ int16 Strings_Length (CHAR *s, LONGINT s__len) i += 1; } if (i <= 32767) { - _o_result = (int16)i; __DEL(s); - return _o_result; + return (int16)i; } else { - _o_result = 32767; __DEL(s); - return _o_result; + return 32767; } __RETCHK; } @@ -70,6 +67,7 @@ void Strings_Insert (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, L } if (pos > n1) { Strings_Append(dest, dest__len, (void*)source, source__len); + __DEL(source); return; } if ((pos + n2) < dest__len) { @@ -131,6 +129,7 @@ void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHA } if (pos >= len) { dest[0] = 0x00; + __DEL(source); return; } i = 0; @@ -146,17 +145,15 @@ void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHA int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int16 pos) { - int16 _o_result; int16 n1, n2, i, j; __DUP(pattern, pattern__len, CHAR); __DUP(s, s__len, CHAR); n1 = Strings_Length(s, s__len); n2 = Strings_Length(pattern, pattern__len); if (n2 == 0) { - _o_result = 0; __DEL(pattern); __DEL(s); - return _o_result; + return 0; } i = pos; while (i <= n1 - n2) { @@ -166,18 +163,16 @@ int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, j += 1; } if (j == n2) { - _o_result = i; __DEL(pattern); __DEL(s); - return _o_result; + return i; } } i += 1; } - _o_result = -1; __DEL(pattern); __DEL(s); - return _o_result; + return -1; } void Strings_Cap (CHAR *s, LONGINT s__len) @@ -200,50 +195,42 @@ static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__le static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, int16 n, int16 m) { - BOOLEAN _o_result; while ((((n >= 0 && m >= 0)) && mask[__X(m, mask__len)] != '*')) { if (name[__X(n, name__len)] != mask[__X(m, mask__len)]) { - _o_result = 0; - return _o_result; + return 0; } n -= 1; m -= 1; } if (m < 0) { - _o_result = n < 0; - return _o_result; + return n < 0; } while ((m >= 0 && mask[__X(m, mask__len)] == '*')) { m -= 1; } if (m < 0) { - _o_result = 1; - return _o_result; + return 1; } while (n >= 0) { if (M__8(name, name__len, mask, mask__len, n, m)) { - _o_result = 1; - return _o_result; + return 1; } n -= 1; } - _o_result = 0; - return _o_result; + return 0; } BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len) { - BOOLEAN _o_result; struct Match__7 _s; __DUP(string, string__len, CHAR); __DUP(pattern, pattern__len, CHAR); _s.lnk = Match__7_s; Match__7_s = &_s; - _o_result = M__8((void*)string, string__len, (void*)pattern, pattern__len, Strings_Length(string, string__len) - 1, Strings_Length(pattern, pattern__len) - 1); Match__7_s = _s.lnk; __DEL(string); __DEL(pattern); - return _o_result; + return M__8((void*)string, string__len, (void*)pattern, pattern__len, Strings_Length(string, string__len) - 1, Strings_Length(pattern, pattern__len) - 1); } diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index 3271c367..e84157d1 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -234,12 +234,10 @@ export void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGIN static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len) { - Texts_FontsFont _o_result; Texts_FontsFont F = NIL; __NEW(F, Texts_FontDesc); __COPY(name, F->name, 32); - _o_result = F; - return _o_result; + return F; } static void Texts_Find (Texts_Text T, int32 *pos, Texts_Run *u, int32 *org, int32 *off) @@ -338,22 +336,18 @@ static void Texts_Splice (Texts_Run un, Texts_Run v, Texts_Run w, Texts_Text bas static Texts_Piece Texts_ClonePiece (Texts_Piece p) { - Texts_Piece _o_result; Texts_Piece q = NIL; __NEW(q, Texts_PieceDesc); __GUARDEQP(q, Texts_PieceDesc) = *p; - _o_result = q; - return _o_result; + return q; } static Texts_Elem Texts_CloneElem (Texts_Elem e) { - Texts_Elem _o_result; Texts_CopyMsg msg; msg.e = NIL; (*e->handle)(e, (void*)&msg, Texts_CopyMsg__typ); - _o_result = msg.e; - return _o_result; + return msg.e; } void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE) @@ -369,14 +363,11 @@ void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE) Texts_Text Texts_ElemBase (Texts_Elem E) { - Texts_Text _o_result; - _o_result = E->base; - return _o_result; + return E->base; } int32 Texts_ElemPos (Texts_Elem E) { - int32 _o_result; Texts_Run u = NIL; int32 pos; u = E->base->head->next; @@ -385,8 +376,7 @@ int32 Texts_ElemPos (Texts_Elem E) pos = pos + u->len; u = u->next; } - _o_result = pos; - return _o_result; + return pos; } static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, address *msg__typ) @@ -716,9 +706,7 @@ void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ) int32 Texts_Pos (Texts_Reader *R, address *R__typ) { - int32 _o_result; - _o_result = (*R).org + (*R).off; - return _o_result; + return (*R).org + (*R).off; } void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int32 pos) diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 3a0ce191..acf98586 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -317,14 +317,11 @@ void Files_Close (Files_File f) int32 Files_Length (Files_File f) { - int32 _o_result; - _o_result = f->len; - return _o_result; + return f->len; } Files_File Files_New (CHAR *name, LONGINT name__len) { - Files_File _o_result; Files_File f = NIL; __DUP(name, name__len, CHAR); __NEW(f, Files_FileDesc); @@ -335,9 +332,8 @@ Files_File Files_New (CHAR *name, LONGINT name__len) f->len = 0; f->pos = 0; f->swapper = -1; - _o_result = f; __DEL(name); - return _o_result; + return f; } static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len) @@ -385,7 +381,6 @@ static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len) static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len) { - BOOLEAN _o_result; int16 i; CHAR ch; i = 0; @@ -394,13 +389,11 @@ static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len) i += 1; ch = name[i]; } - _o_result = ch == '/'; - return _o_result; + return ch == '/'; } static Files_File Files_CacheEntry (Platform_FileIdentity identity) { - Files_File _o_result; Files_File f = NIL; int16 i, error; f = Files_files; @@ -419,18 +412,15 @@ static Files_File Files_CacheEntry (Platform_FileIdentity identity) f->identity = identity; error = Platform_Size(f->fd, &f->len); } - _o_result = f; - return _o_result; + return f; } f = f->next; } - _o_result = NIL; - return _o_result; + return NIL; } Files_File Files_Old (CHAR *name, LONGINT name__len) { - Files_File _o_result; Files_File f = NIL; int32 fd; int16 pos; @@ -470,9 +460,8 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) error = Platform_Identify(fd, &identity, Platform_FileIdentity__typ); f = Files_CacheEntry(identity); if (f != NIL) { - _o_result = f; __DEL(name); - return _o_result; + return f; } else { __NEW(f, Files_FileDesc); Heap_RegisterFinalizer((void*)f, Files_Finalize); @@ -488,23 +477,20 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) f->next = Files_files; Files_files = f; Heap_FileCount += 1; - _o_result = f; __DEL(name); - return _o_result; + return f; } } else if (dir[0] == 0x00) { - _o_result = NIL; __DEL(name); - return _o_result; + return NIL; } else { Files_MakeFileName(dir, 256, name, name__len, (void*)path, 256); Files_ScanPath(&pos, (void*)dir, 256); } } } else { - _o_result = NIL; __DEL(name); - return _o_result; + return NIL; } __RETCHK; } @@ -544,9 +530,7 @@ void Files_GetDate (Files_File f, int32 *t, int32 *d) int32 Files_Pos (Files_Rider *r, address *r__typ) { - int32 _o_result; - _o_result = (*r).org + (*r).offset; - return _o_result; + return (*r).org + (*r).offset; } void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos) @@ -673,9 +657,7 @@ void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x Files_File Files_Base (Files_Rider *r, address *r__typ) { - Files_File _o_result; - _o_result = (*r).buf->f; - return _o_result; + return (*r).buf->f; } void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x) @@ -759,17 +741,23 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int error = Platform_Rename((void*)old, old__len, (void*)new, new__len); if (!Platform_DifferentFilesystems(error)) { *res = error; + __DEL(old); + __DEL(new); return; } else { error = Platform_OldRO((void*)old, old__len, &fdold); if (error != 0) { *res = 2; + __DEL(old); + __DEL(new); return; } error = Platform_New((void*)new, new__len, &fdnew); if (error != 0) { error = Platform_Close(fdold); *res = 3; + __DEL(old); + __DEL(new); return; } error = Platform_Read(fdold, (address)buf, 4096, &n); diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index 37062b0b..4bc74170 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -127,7 +127,6 @@ void Heap_Unlock (void) SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) { - SYSTEM_PTR _o_result; Heap_Module m; if (__STRCMP(name, "Heap") == 0) { __SYSNEW(m, 48); @@ -141,8 +140,7 @@ SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) m->enumPtrs = enumPtrs; m->next = (Heap_Module)(address)Heap_modules; Heap_modules = (SYSTEM_PTR)m; - _o_result = (void*)m; - return _o_result; + return (void*)m; } void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) @@ -172,7 +170,6 @@ void Heap_INCREF (Heap_Module m) static int32 Heap_NewChunk (int32 blksz) { - int32 _o_result; int32 chnk; chnk = Heap_OSAllocate(blksz + 12); if (chnk != 0) { @@ -184,8 +181,7 @@ static int32 Heap_NewChunk (int32 blksz) Heap_bigBlocks = chnk + 12; Heap_heapsize += blksz; } - _o_result = chnk; - return _o_result; + return chnk; } static void Heap_ExtendHeap (int32 blksz) @@ -219,7 +215,6 @@ static void Heap_ExtendHeap (int32 blksz) SYSTEM_PTR Heap_NEWREC (int32 tag) { - SYSTEM_PTR _o_result; int32 i, i0, di, blksz, restsize, t, adr, end, next, prev; SYSTEM_PTR new; Heap_Lock(); @@ -267,12 +262,10 @@ SYSTEM_PTR Heap_NEWREC (int32 tag) new = Heap_NEWREC(tag); } Heap_Unlock(); - _o_result = new; - return _o_result; + return new; } else { Heap_Unlock(); - _o_result = NIL; - return _o_result; + return NIL; } } __GET(adr + 4, t, int32); @@ -320,13 +313,11 @@ SYSTEM_PTR Heap_NEWREC (int32 tag) __PUT(adr + 8, 0, int32); Heap_allocated += blksz; Heap_Unlock(); - _o_result = (SYSTEM_PTR)(address)(adr + 4); - return _o_result; + return (SYSTEM_PTR)(address)(adr + 4); } SYSTEM_PTR Heap_NEWBLK (int32 size) { - SYSTEM_PTR _o_result; int32 blksz, tag; SYSTEM_PTR new; Heap_Lock(); @@ -338,8 +329,7 @@ SYSTEM_PTR Heap_NEWBLK (int32 size) __PUT(tag + 4, -4, int32); __PUT((int32)(address)new - 4, tag, int32); Heap_Unlock(); - _o_result = new; - return _o_result; + return new; } static void Heap_Mark (int32 q) diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index 45b91f7f..bb6774da 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -74,7 +74,6 @@ static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len) Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len) { - Modules_Module _o_result; Modules_Module m = NIL; CHAR bodyname[64]; Modules_Command body; @@ -93,14 +92,12 @@ Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len) Modules_Append((void*)Modules_resMsg, 256, name, name__len); Modules_Append((void*)Modules_resMsg, 256, (CHAR*)"\" not found", 12); } - _o_result = m; __DEL(name); - return _o_result; + return m; } Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len) { - Modules_Command _o_result; Modules_Cmd c = NIL; __DUP(name, name__len, CHAR); c = mod->cmds; @@ -110,9 +107,8 @@ Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT nam if (c != NIL) { Modules_res = 0; Modules_resMsg[0] = 0x00; - _o_result = c->cmd; __DEL(name); - return _o_result; + return c->cmd; } else { Modules_res = 2; __MOVE(" command \"", Modules_resMsg, 11); @@ -121,9 +117,8 @@ Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT nam Modules_Append((void*)Modules_resMsg, 256, (CHAR*)".", 2); Modules_Append((void*)Modules_resMsg, 256, name, name__len); Modules_Append((void*)Modules_resMsg, 256, (CHAR*)"\" not found", 12); - _o_result = NIL; __DEL(name); - return _o_result; + return NIL; } __RETCHK; } diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index 038bd92c..dff6adc6 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -74,7 +74,6 @@ static void OPB_err (int16 n) OPT_Node OPB_NewLeaf (OPT_Object obj) { - OPT_Node _o_result; OPT_Node node = NIL; switch (obj->mode) { case 1: @@ -102,8 +101,7 @@ OPT_Node OPB_NewLeaf (OPT_Object obj) } node->obj = obj; node->typ = obj->typ; - _o_result = node; - return _o_result; + return node; } void OPB_Construct (int8 class, OPT_Node *x, OPT_Node y) @@ -131,34 +129,27 @@ void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y) static int16 OPB_BoolToInt (BOOLEAN b) { - int16 _o_result; if (b) { - _o_result = 1; - return _o_result; + return 1; } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } static BOOLEAN OPB_IntToBool (int64 i) { - BOOLEAN _o_result; - _o_result = i != 0; - return _o_result; + return i != 0; } OPT_Node OPB_NewBoolConst (BOOLEAN boolval) { - OPT_Node _o_result; OPT_Node x = NIL; x = OPT_NewNode(7); x->typ = OPT_booltyp; x->conval = OPT_NewConst(); x->conval->intval = OPB_BoolToInt(boolval); - _o_result = x; - return _o_result; + return x; } void OPB_OptIf (OPT_Node *x) @@ -198,26 +189,22 @@ void OPB_OptIf (OPT_Node *x) OPT_Node OPB_Nil (void) { - OPT_Node _o_result; OPT_Node x = NIL; x = OPT_NewNode(7); x->typ = OPT_niltyp; x->conval = OPT_NewConst(); x->conval->intval = 0; - _o_result = x; - return _o_result; + return x; } OPT_Node OPB_EmptySet (void) { - OPT_Node _o_result; OPT_Node x = NIL; x = OPT_NewNode(7); x->typ = OPT_settyp; x->conval = OPT_NewConst(); x->conval->setval = 0x0; - _o_result = x; - return _o_result; + return x; } static void OPB_SetIntType (OPT_Node node) @@ -238,32 +225,27 @@ static void OPB_SetSetType (OPT_Node node) OPT_Node OPB_NewIntConst (int64 intval) { - OPT_Node _o_result; OPT_Node x = NIL; x = OPT_NewNode(7); x->conval = OPT_NewConst(); x->conval->intval = intval; OPB_SetIntType(x); - _o_result = x; - return _o_result; + return x; } OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ) { - OPT_Node _o_result; OPT_Node x = NIL; x = OPT_NewNode(7); x->conval = OPT_NewConst(); x->conval->realval = realval; x->typ = typ; x->conval->intval = -1; - _o_result = x; - return _o_result; + return x; } OPT_Node OPB_NewString (OPS_String str, int64 len) { - OPT_Node _o_result; OPT_Node x = NIL; x = OPT_NewNode(7); x->conval = OPT_NewConst(); @@ -272,8 +254,7 @@ OPT_Node OPB_NewString (OPS_String str, int64 len) x->conval->intval2 = OPM_Longint(len); x->conval->ext = OPT_NewExt(); __COPY(str, *x->conval->ext, 256); - _o_result = x; - return _o_result; + return x; } static void OPB_CharToString (OPT_Node n) @@ -305,9 +286,7 @@ static void OPB_BindNodes (int8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y) static BOOLEAN OPB_NotVar (OPT_Node x) { - BOOLEAN _o_result; - _o_result = (x->class >= 7 && ((x->class != 11 || x->subcl != 29) || x->left->class >= 7)); - return _o_result; + return (x->class >= 7 && ((x->class != 11 || x->subcl != 29) || x->left->class >= 7)); } void OPB_DeRef (OPT_Node *x) @@ -489,7 +468,6 @@ void OPB_In (OPT_Node *x, OPT_Node y) static int64 OPB_log (int64 x) { - int64 _o_result; OPB_exp = 0; if (x > 0) { while (!__ODD(x)) { @@ -497,8 +475,7 @@ static int64 OPB_log (int64 x) OPB_exp += 1; } } - _o_result = x; - return _o_result; + return x; } static void OPB_CheckRealType (int16 f, int16 nr, OPT_Const x) @@ -529,14 +506,12 @@ static OPT_Node NewOp__29 (int8 op, OPT_Struct typ, OPT_Node z); static OPT_Node NewOp__29 (int8 op, OPT_Struct typ, OPT_Node z) { - OPT_Node _o_result; OPT_Node node = NIL; node = OPT_NewNode(11); node->subcl = op; node->typ = typ; node->left = z; - _o_result = node; - return _o_result; + return node; } void OPB_MOp (int8 op, OPT_Node *x) @@ -775,7 +750,6 @@ static int16 ConstCmp__14 (void); static int16 ConstCmp__14 (void) { - int16 _o_result; int16 res; switch (*ConstOp__13_s->f) { case 0: @@ -836,8 +810,7 @@ static int16 ConstCmp__14 (void) break; } (*ConstOp__13_s->x)->typ = OPT_booltyp; - _o_result = res; - return _o_result; + return res; } static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) @@ -1202,7 +1175,6 @@ static void NewOp__39 (int8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y) static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) { - BOOLEAN _o_result; BOOLEAN ok, xCharArr, yCharArr; xCharArr = (__IN((*x)->typ->comp, 0x0c, 32) && (*x)->typ->BaseTyp->form == 3) || *Op__38_s->f == 8; yCharArr = (__IN((*y)->typ->comp, 0x0c, 32) && (*y)->typ->BaseTyp->form == 3) || *Op__38_s->g == 8; @@ -1228,8 +1200,7 @@ static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) OPB_Index(&*x, OPB_NewIntConst(0)); } } - _o_result = ok; - return _o_result; + return ok; } void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) @@ -2016,14 +1987,12 @@ static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right) { - OPT_Node _o_result; OPT_Node node = NIL; node = OPT_NewNode(class); node->subcl = subcl; node->left = left; node->right = right; - _o_result = node; - return _o_result; + return node; } void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 20c369e9..9401b9a7 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -157,19 +157,16 @@ static void OPC_Str1 (CHAR *s, LONGINT s__len, int32 x) static int16 OPC_Length (CHAR *s, LONGINT s__len) { - int16 _o_result; int16 i; i = 0; while (s[__X(i, s__len)] != 0x00) { i += 1; } - _o_result = i; - return _o_result; + return i; } static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len) { - int16 _o_result; int16 i, h; i = 0; h = 0; @@ -177,8 +174,7 @@ static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len) h = 3 * h + (int16)s[__X(i, s__len)]; i += 1; } - _o_result = (int)__MOD(h, 105); - return _o_result; + return (int)__MOD(h, 105); } void OPC_Ident (OPT_Object obj) @@ -320,9 +316,7 @@ void OPC_Andent (OPT_Struct typ) static BOOLEAN OPC_Undefined (OPT_Object obj) { - BOOLEAN _o_result; - _o_result = obj->name[0] == 0x00 || (((obj->mnolev >= 0 && obj->linkadr != (3 + OPM_currFile))) && obj->linkadr != 2); - return _o_result; + return obj->name[0] == 0x00 || (((obj->mnolev >= 0 && obj->linkadr != (3 + OPM_currFile))) && obj->linkadr != 2); } static void OPC_DeclareBase (OPT_Object dcl) @@ -391,13 +385,11 @@ static void OPC_DeclareBase (OPT_Object dcl) int32 OPC_NofPtrs (OPT_Struct typ) { - int32 _o_result; OPT_Object fld = NIL; OPT_Struct btyp = NIL; int32 n; if ((typ->form == 11 && typ->sysflag == 0)) { - _o_result = 1; - return _o_result; + return 1; } else if ((typ->comp == 4 && __MASK(typ->sysflag, -256) == 0)) { btyp = typ->BaseTyp; if (btyp != NIL) { @@ -414,8 +406,7 @@ int32 OPC_NofPtrs (OPT_Struct typ) } fld = fld->link; } - _o_result = n; - return _o_result; + return n; } else if (typ->comp == 2) { btyp = typ->BaseTyp; n = typ->n; @@ -423,11 +414,9 @@ int32 OPC_NofPtrs (OPT_Struct typ) n = btyp->n * n; btyp = btyp->BaseTyp; } - _o_result = OPC_NofPtrs(btyp) * n; - return _o_result; + return OPC_NofPtrs(btyp) * n; } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } @@ -608,7 +597,6 @@ static void OPC_DeclareTProcs (OPT_Object obj, BOOLEAN *empty) OPT_Object OPC_BaseTProc (OPT_Object obj) { - OPT_Object _o_result; OPT_Struct typ = NIL, base = NIL; int32 mno; typ = obj->link->typ; @@ -622,8 +610,7 @@ OPT_Object OPC_BaseTProc (OPT_Object obj) base = typ->BaseTyp; } OPT_FindField(obj->name, typ, &obj); - _o_result = obj; - return _o_result; + return obj; } static void OPC_DefineTProcMacros (OPT_Object obj, BOOLEAN *empty) @@ -734,18 +721,14 @@ static void OPC_DefineType (OPT_Struct str) static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len) { - BOOLEAN _o_result; int16 i; - BOOLEAN r; __DUP(y, y__len, CHAR); i = 0; while ((*x)[__X(i + 1, 256)] == y[__X(i, y__len)]) { i += 1; } - r = y[__X(i, y__len)] == 0x00; - _o_result = r; __DEL(y); - return _o_result; + return y[__X(i, y__len)] == 0x00; } static void OPC_CProcDefs (OPT_Object obj, int16 vis) @@ -1455,12 +1438,6 @@ void OPC_EnterProc (OPT_Object proc) } OPC_ProcHeader(proc, 1); OPC_BegBlk(); - if (proc->typ != OPT_notyp) { - OPC_BegStat(); - OPC_Ident(proc->typ->strobj); - OPM_WriteString((CHAR*)" _o_result;", 12); - OPM_WriteLn(); - } scope = proc->scope; OPC_IdentList(scope->scope, 0); if (!scope->leaf) { diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index d0b09b3d..458de3f2 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -124,33 +124,25 @@ void OPM_LogWLn (void) int64 OPM_SignedMaximum (int32 bytecount) { - int64 _o_result; int64 result; result = 1; result = __LSH(result, __ASHL(bytecount, 3) - 1, 64); - _o_result = result - 1; - return _o_result; + return result - 1; } int64 OPM_SignedMinimum (int32 bytecount) { - int64 _o_result; - _o_result = -OPM_SignedMaximum(bytecount) - 1; - return _o_result; + return -OPM_SignedMaximum(bytecount) - 1; } int32 OPM_Longint (int64 n) { - int32 _o_result; - _o_result = __VAL(int32, n); - return _o_result; + return __VAL(int32, n); } int16 OPM_Integer (int64 n) { - int16 _o_result; - _o_result = __VAL(int16, n); - return _o_result; + return __VAL(int16, n); } static void OPM_ScanOptions (CHAR *s, LONGINT s__len) @@ -266,7 +258,6 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len) BOOLEAN OPM_OpenPar (void) { - BOOLEAN _o_result; CHAR s[256]; if (Platform_ArgCount == 1) { OPM_LogWLn(); @@ -274,7 +265,7 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWStr(Configuration_versionLong, 75); OPM_LogW('.'); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Based on Ofront by Software Templ OEG.", 39); + OPM_LogWStr((CHAR*)"Based on Ofront by J. Templ and Software Templ OEG.", 52); OPM_LogWLn(); OPM_LogWStr((CHAR*)"Further development by Norayr Chilingarian, David Brown and others.", 68); OPM_LogWLn(); @@ -287,7 +278,7 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWStr((CHAR*)" options {files {options}}.", 28); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Where options = [\"-\" {option} ].", 33); + OPM_LogWStr((CHAR*)"Options:", 9); OPM_LogWLn(); OPM_LogWLn(); OPM_LogWStr((CHAR*)" Run time safety", 18); @@ -345,7 +336,7 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWLn(); OPM_LogWStr((CHAR*)" -A48 32 bit addresses, 64 bit alignment (e.g. Windows 32 bit on x86, linux 32 bit on arm).", 97); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -A88 66 bit addresses, 64 bit alignment (e.g. 64 bit platforms).", 71); + OPM_LogWStr((CHAR*)" -A88 64 bit addresses, 64 bit alignment (e.g. 64 bit platforms).", 71); OPM_LogWLn(); OPM_LogWLn(); OPM_LogWStr((CHAR*)"All options are off by default, except where noted above.", 58); @@ -356,8 +347,7 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWLn(); OPM_LogWStr((CHAR*)"Repeating an option toggles its value.", 39); OPM_LogWLn(); - _o_result = 0; - return _o_result; + return 0; } else { OPM_AddressSize = 4; OPM_GetAlignment(&OPM_Alignment); @@ -376,8 +366,7 @@ BOOLEAN OPM_OpenPar (void) OPM_GlobalAlignment = OPM_Alignment; __COPY(OPM_Model, OPM_GlobalModel, 10); OPM_GlobalOptions = OPM_Options; - _o_result = 1; - return _o_result; + return 1; } __RETCHK; } @@ -741,20 +730,16 @@ void OPM_SymRCh (CHAR *ch) int32 OPM_SymRInt (void) { - int32 _o_result; int32 k; Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&k, 4); - _o_result = k; - return _o_result; + return k; } int64 OPM_SymRInt64 (void) { - int64 _o_result; int64 k; Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&k, 8); - _o_result = k; - return _o_result; + return k; } void OPM_SymRSet (uint64 *s) @@ -797,9 +782,7 @@ void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done) BOOLEAN OPM_eofSF (void) { - BOOLEAN _o_result; - _o_result = OPM_oldSF.eof; - return _o_result; + return OPM_oldSF.eof; } void OPM_SymWCh (CHAR ch) diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index 90f35dd5..5e181cb9 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -901,7 +901,6 @@ static void OPP_Receiver (int8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct static BOOLEAN OPP_Extends (OPT_Struct x, OPT_Struct b) { - BOOLEAN _o_result; if ((b->form == 11 && x->form == 11)) { b = b->BaseTyp; x = x->BaseTyp; @@ -911,8 +910,7 @@ static BOOLEAN OPP_Extends (OPT_Struct x, OPT_Struct b) x = x->BaseTyp; } while (!(x == NIL || x == b)); } - _o_result = x == b; - return _o_result; + return x == b; } static struct ProcedureDeclaration__16 { diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index b3c52f3c..5a34663d 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -97,7 +97,6 @@ static LONGREAL Ten__9 (int16 e); static LONGREAL Ten__9 (int16 e) { - LONGREAL _o_result; LONGREAL x, p; x = (LONGREAL)1; p = (LONGREAL)10; @@ -110,23 +109,18 @@ static LONGREAL Ten__9 (int16 e) p = p * p; } } - _o_result = x; - return _o_result; + return x; } static int16 Ord__7 (CHAR ch, BOOLEAN hex) { - int16 _o_result; if (ch <= '9') { - _o_result = (int16)ch - 48; - return _o_result; + return (int16)ch - 48; } else if (hex) { - _o_result = ((int16)ch - 65) + 10; - return _o_result; + return ((int16)ch - 65) + 10; } else { OPS_err(2); - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } @@ -324,6 +318,7 @@ void OPS_Get (int8 *sym) while (OPS_ch <= ' ') { if (OPS_ch == 0x00) { *sym = 64; + Get__1_s = _s.lnk; return; } else { OPM_Get(&OPS_ch); diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 2a8e00ab..f55e7e01 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -179,7 +179,6 @@ static void OPT_err (int16 n) int16 OPT_IntSize (int64 n) { - int16 _o_result; int16 bytes; if (n < 0) { n = -(n + 1); @@ -188,77 +187,59 @@ int16 OPT_IntSize (int64 n) while ((bytes < 8 && __ASH(n, -(__ASHL(bytes, 3) - 1)) != 0)) { bytes += 1; } - _o_result = bytes; - return _o_result; + return bytes; } OPT_Struct OPT_IntType (int32 size) { - OPT_Struct _o_result; if (size <= OPT_int8typ->size) { - _o_result = OPT_int8typ; - return _o_result; + return OPT_int8typ; } if (size <= OPT_int16typ->size) { - _o_result = OPT_int16typ; - return _o_result; + return OPT_int16typ; } if (size <= OPT_int32typ->size) { - _o_result = OPT_int32typ; - return _o_result; + return OPT_int32typ; } - _o_result = OPT_int64typ; - return _o_result; + return OPT_int64typ; } OPT_Struct OPT_SetType (int32 size) { - OPT_Struct _o_result; if (size == OPT_set32typ->size) { - _o_result = OPT_set32typ; - return _o_result; + return OPT_set32typ; } - _o_result = OPT_set64typ; - return _o_result; + return OPT_set64typ; } OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir) { - OPT_Struct _o_result; int16 i; __ASSERT(x->form == 4, 0); __ASSERT(x->BaseTyp == OPT_undftyp, 0); __ASSERT(dir == 1 || dir == -1, 0); if (dir > 0) { if (x->size < OPT_sinttyp->size) { - _o_result = OPT_sinttyp; - return _o_result; + return OPT_sinttyp; } if (x->size < OPT_inttyp->size) { - _o_result = OPT_inttyp; - return _o_result; + return OPT_inttyp; } if (x->size < OPT_linttyp->size) { - _o_result = OPT_linttyp; - return _o_result; + return OPT_linttyp; } - _o_result = OPT_int64typ; - return _o_result; + return OPT_int64typ; } else { if (x->size > OPT_linttyp->size) { - _o_result = OPT_linttyp; - return _o_result; + return OPT_linttyp; } if (x->size > OPT_inttyp->size) { - _o_result = OPT_inttyp; - return _o_result; + return OPT_inttyp; } if (x->size > OPT_sinttyp->size) { - _o_result = OPT_sinttyp; - return _o_result; + return OPT_sinttyp; } - _o_result = OPT_int8typ; - return _o_result; + return OPT_int8typ; } __RETCHK; } @@ -285,7 +266,6 @@ void OPT_Align (int32 *adr, int32 base) int32 OPT_SizeAlignment (int32 size) { - int32 _o_result; int32 alignment; if (size < OPM_Alignment) { alignment = 1; @@ -295,13 +275,11 @@ int32 OPT_SizeAlignment (int32 size) } else { alignment = OPM_Alignment; } - _o_result = alignment; - return _o_result; + return alignment; } int32 OPT_BaseAlignment (OPT_Struct typ) { - int32 _o_result; int32 alignment; if (typ->form == 13) { if (typ->comp == 4) { @@ -312,8 +290,7 @@ int32 OPT_BaseAlignment (OPT_Struct typ) } else { alignment = OPT_SizeAlignment(typ->size); } - _o_result = alignment; - return _o_result; + return alignment; } void OPT_TypSize (OPT_Struct typ) @@ -389,25 +366,20 @@ void OPT_TypSize (OPT_Struct typ) OPT_Const OPT_NewConst (void) { - OPT_Const _o_result; OPT_Const const_ = NIL; __NEW(const_, OPT_ConstDesc); - _o_result = const_; - return _o_result; + return const_; } OPT_Object OPT_NewObj (void) { - OPT_Object _o_result; OPT_Object obj = NIL; __NEW(obj, OPT_ObjDesc); - _o_result = obj; - return _o_result; + return obj; } OPT_Struct OPT_NewStr (int8 form, int8 comp) { - OPT_Struct _o_result; OPT_Struct typ = NIL; __NEW(typ, OPT_StrDesc); typ->form = form; @@ -418,27 +390,22 @@ OPT_Struct OPT_NewStr (int8 form, int8 comp) } typ->size = -1; typ->BaseTyp = OPT_undftyp; - _o_result = typ; - return _o_result; + return typ; } OPT_Node OPT_NewNode (int8 class) { - OPT_Node _o_result; OPT_Node node = NIL; __NEW(node, OPT_NodeDesc); node->class = class; - _o_result = node; - return _o_result; + return node; } OPT_ConstExt OPT_NewExt (void) { - OPT_ConstExt _o_result; OPT_ConstExt ext = NIL; ext = __NEWARR(NIL, 1, 1, 1, 0, 256); - _o_result = ext; - return _o_result; + return ext; } void OPT_OpenScope (int8 level, OPT_Object owner) @@ -1120,7 +1087,6 @@ static void OPT_InSign (int8 mno, OPT_Struct *res, OPT_Object *par) static OPT_Object OPT_InFld (void) { - OPT_Object _o_result; int32 tag; OPT_Object obj = NIL; tag = OPT_impCtxt.nextTag; @@ -1146,13 +1112,11 @@ static OPT_Object OPT_InFld (void) obj->vis = 0; obj->adr = OPM_SymRInt(); } - _o_result = obj; - return _o_result; + return obj; } static OPT_Object OPT_InTProc (int8 mno) { - OPT_Object _o_result; int32 tag; OPT_Object obj = NIL; tag = OPT_impCtxt.nextTag; @@ -1174,22 +1138,17 @@ static OPT_Object OPT_InTProc (int8 mno) obj->vis = 0; obj->adr = __ASHL(OPM_SymRInt(), 16); } - _o_result = obj; - return _o_result; + return obj; } static OPT_Struct OPT_InTyp (int32 tag) { - OPT_Struct _o_result; if (tag == 4) { - _o_result = OPT_IntType(OPM_SymRInt()); - return _o_result; + return OPT_IntType(OPM_SymRInt()); } else if (tag == 7) { - _o_result = OPT_SetType(OPM_SymRInt()); - return _o_result; + return OPT_SetType(OPM_SymRInt()); } else { - _o_result = OPT_impCtxt.ref[__X(tag, 255)]; - return _o_result; + return OPT_impCtxt.ref[__X(tag, 255)]; } __RETCHK; } @@ -1378,7 +1337,6 @@ static void OPT_InStruct (OPT_Struct *typ) static OPT_Object OPT_InObj (int8 mno) { - OPT_Object _o_result; int16 i, s; CHAR ch; OPT_Object obj = NIL, old = NIL; @@ -1475,8 +1433,7 @@ static OPT_Object OPT_InObj (int8 mno) } } } - _o_result = obj; - return _o_result; + return obj; } void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index 5b51ba36..787ce143 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -207,44 +207,35 @@ void OPV_AdrAndSize (OPT_Object topScope) static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp) { - int16 _o_result; switch (class) { case 7: case 0: case 2: case 4: case 9: case 13: - _o_result = 10; - return _o_result; + return 10; break; case 5: if (__IN(3, OPM_Options, 32)) { - _o_result = 10; - return _o_result; + return 10; } else { - _o_result = 9; - return _o_result; + return 9; } break; case 1: if (__IN(comp, 0x0c, 32)) { - _o_result = 10; - return _o_result; + return 10; } else { - _o_result = 9; - return _o_result; + return 9; } break; case 3: - _o_result = 9; - return _o_result; + return 9; break; case 11: switch (subclass) { case 33: case 7: case 24: case 29: case 20: - _o_result = 9; - return _o_result; + return 9; break; case 16: case 21: case 22: case 23: case 25: - _o_result = 10; - return _o_result; + return 10; break; default: OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Nmop, subclass = ", 55); @@ -257,64 +248,50 @@ static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp switch (subclass) { case 1: if (form == 7) { - _o_result = 4; - return _o_result; + return 4; } else { - _o_result = 8; - return _o_result; + return 8; } break; case 2: if (form == 7) { - _o_result = 3; - return _o_result; + return 3; } else { - _o_result = 8; - return _o_result; + return 8; } break; case 3: case 4: - _o_result = 10; - return _o_result; + return 10; break; case 6: if (form == 7) { - _o_result = 2; - return _o_result; + return 2; } else { - _o_result = 7; - return _o_result; + return 7; } break; case 7: if (form == 7) { - _o_result = 4; - return _o_result; + return 4; } else { - _o_result = 7; - return _o_result; + return 7; } break; case 11: case 12: case 13: case 14: - _o_result = 6; - return _o_result; + return 6; break; case 9: case 10: - _o_result = 5; - return _o_result; + return 5; break; case 5: - _o_result = 1; - return _o_result; + return 1; break; case 8: - _o_result = 0; - return _o_result; + return 0; break; case 19: case 15: case 17: case 18: case 26: case 27: case 28: - _o_result = 10; - return _o_result; + return 10; break; default: OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Ndop, subclass = ", 55); @@ -324,12 +301,10 @@ static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp } break; case 10: - _o_result = 10; - return _o_result; + return 10; break; case 8: case 6: - _o_result = 12; - return _o_result; + return 12; break; default: OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence, class = ", 43); @@ -358,13 +333,10 @@ static void OPV_Len (OPT_Node n, int64 dim) static BOOLEAN OPV_SideEffects (OPT_Node n) { - BOOLEAN _o_result; if (n != NIL) { - _o_result = (n->class == 13 || OPV_SideEffects(n->left)) || OPV_SideEffects(n->right); - return _o_result; + return (n->class == 13 || OPV_SideEffects(n->left)) || OPV_SideEffects(n->right); } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } @@ -744,7 +716,6 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) static OPT_Object OPV_SuperProc (OPT_Node n) { - OPT_Object _o_result; OPT_Object obj = NIL; OPT_Struct typ = NIL; typ = n->right->typ; @@ -752,8 +723,7 @@ static OPT_Object OPV_SuperProc (OPT_Node n) typ = typ->BaseTyp; } OPT_FindField(n->left->obj->name, typ->BaseTyp, &obj); - _o_result = obj; - return _o_result; + return obj; } static void OPV_expr (OPT_Node n, int16 prec) @@ -1187,12 +1157,10 @@ static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc) static BOOLEAN OPV_ImplicitReturn (OPT_Node n) { - BOOLEAN _o_result; while ((n != NIL && n->class != 26)) { n = n->link; } - _o_result = n == NIL; - return _o_result; + return n == NIL; } static void OPV_NewArr (OPT_Node d, OPT_Node x) @@ -1523,21 +1491,16 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPM_WriteString((CHAR*)"__ENDMOD", 9); } } else { + OPC_ExitProc(outerProc, 0, 0); + OPM_WriteString((CHAR*)"return", 7); if (n->left != NIL) { - OPM_WriteString((CHAR*)"_o_result = ", 13); + OPM_Write(' '); if ((n->left->typ->form == 11 && n->obj->typ != n->left->typ)) { OPM_WriteString((CHAR*)"(void*)", 8); OPV_expr(n->left, 10); } else { OPV_expr(n->left, -1); } - OPM_WriteString((CHAR*)";", 2); - OPM_WriteLn(); - OPC_BegStat(); - OPC_ExitProc(outerProc, 0, 0); - OPM_WriteString((CHAR*)"return _o_result", 17); - } else { - OPM_WriteString((CHAR*)"return", 7); } } break; diff --git a/bootstrap/windows-48/Out.c b/bootstrap/windows-48/Out.c index 3d2d0c84..6098e568 100644 --- a/bootstrap/windows-48/Out.c +++ b/bootstrap/windows-48/Out.c @@ -56,14 +56,12 @@ void Out_Char (CHAR ch) static int32 Out_Length (CHAR *s, LONGINT s__len) { - int32 _o_result; int32 l; l = 0; while ((l < s__len && s[__X(l, s__len)] != 0x00)) { l += 1; } - _o_result = l; - return _o_result; + return l; } void Out_String (CHAR *str, LONGINT str__len) @@ -152,7 +150,6 @@ static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16 LONGREAL Out_Ten (int16 e) { - LONGREAL _o_result; LONGREAL r, power; r = (LONGREAL)1; power = (LONGREAL)10; @@ -163,8 +160,7 @@ LONGREAL Out_Ten (int16 e) power = power * power; e = __ASHR(e, 1); } - _o_result = r; - return _o_result; + return r; } static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_) diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 22e39c16..39e59543 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -186,65 +186,47 @@ extern void Heap_InitHeap(); BOOLEAN Platform_TooManyFiles (int16 e) { - BOOLEAN _o_result; - _o_result = e == Platform_ERRORTOOMANYOPENFILES(); - return _o_result; + return e == Platform_ERRORTOOMANYOPENFILES(); } BOOLEAN Platform_NoSuchDirectory (int16 e) { - BOOLEAN _o_result; - _o_result = e == Platform_ERRORPATHNOTFOUND(); - return _o_result; + return e == Platform_ERRORPATHNOTFOUND(); } BOOLEAN Platform_DifferentFilesystems (int16 e) { - BOOLEAN _o_result; - _o_result = e == Platform_ERRORNOTSAMEDEVICE(); - return _o_result; + return e == Platform_ERRORNOTSAMEDEVICE(); } BOOLEAN Platform_Inaccessible (int16 e) { - BOOLEAN _o_result; - _o_result = ((e == Platform_ERRORACCESSDENIED() || e == Platform_ERRORWRITEPROTECT()) || e == Platform_ERRORNOTREADY()) || e == Platform_ERRORSHARINGVIOLATION(); - return _o_result; + return ((e == Platform_ERRORACCESSDENIED() || e == Platform_ERRORWRITEPROTECT()) || e == Platform_ERRORNOTREADY()) || e == Platform_ERRORSHARINGVIOLATION(); } BOOLEAN Platform_Absent (int16 e) { - BOOLEAN _o_result; - _o_result = e == Platform_ERRORFILENOTFOUND() || e == Platform_ERRORPATHNOTFOUND(); - return _o_result; + return e == Platform_ERRORFILENOTFOUND() || e == Platform_ERRORPATHNOTFOUND(); } BOOLEAN Platform_TimedOut (int16 e) { - BOOLEAN _o_result; - _o_result = e == Platform_ETIMEDOUT(); - return _o_result; + return e == Platform_ETIMEDOUT(); } BOOLEAN Platform_ConnectionFailed (int16 e) { - BOOLEAN _o_result; - _o_result = ((e == Platform_ECONNREFUSED() || e == Platform_ECONNABORTED()) || e == Platform_ENETUNREACH()) || e == Platform_EHOSTUNREACH(); - return _o_result; + return ((e == Platform_ECONNREFUSED() || e == Platform_ECONNABORTED()) || e == Platform_ENETUNREACH()) || e == Platform_EHOSTUNREACH(); } BOOLEAN Platform_Interrupted (int16 e) { - BOOLEAN _o_result; - _o_result = e == Platform_EINTR(); - return _o_result; + return e == Platform_EINTR(); } int32 Platform_OSAllocate (int32 size) { - int32 _o_result; - _o_result = Platform_allocate(size); - return _o_result; + return Platform_allocate(size); } void Platform_OSFree (int32 address) @@ -265,20 +247,17 @@ void Platform_Init (int32 argc, int32 argvadr) BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len) { - BOOLEAN _o_result; CHAR buf[4096]; int16 res; __DUP(var, var__len, CHAR); res = Platform_getenv(var, var__len, (void*)buf, 4096); if ((res > 0 && res < 4096)) { __COPY(buf, val, val__len); - _o_result = 1; __DEL(var); - return _o_result; + return 1; } else { - _o_result = 0; __DEL(var); - return _o_result; + return 0; } __RETCHK; } @@ -329,7 +308,6 @@ void Platform_GetIntArg (int16 n, int32 *val) int16 Platform_ArgPos (CHAR *s, LONGINT s__len) { - int16 _o_result; int16 i; CHAR arg[256]; __DUP(s, s__len, CHAR); @@ -339,9 +317,8 @@ int16 Platform_ArgPos (CHAR *s, LONGINT s__len) i += 1; Platform_GetArg(i, (void*)arg, 256); } - _o_result = i; __DEL(s); - return _o_result; + return i; } void Platform_SetBadInstructionHandler (Platform_SignalHandler handler) @@ -362,11 +339,9 @@ void Platform_GetClock (int32 *t, int32 *d) int32 Platform_Time (void) { - int32 _o_result; int32 ms; ms = Platform_GetTickCount(); - _o_result = (int)__MOD(ms - Platform_TimeStart, 2147483647); - return _o_result; + return (int)__MOD(ms - Platform_TimeStart, 2147483647); } void Platform_Delay (int32 ms) @@ -392,7 +367,6 @@ void Platform_GetTimeOfDay (int32 *sec, int32 *usec) int16 Platform_System (CHAR *cmd, LONGINT cmd__len) { - int16 _o_result; int16 result; __DUP(cmd, cmd__len, CHAR); result = 127; @@ -404,127 +378,102 @@ int16 Platform_System (CHAR *cmd, LONGINT cmd__len) } Platform_cleanupProcess(); } - _o_result = __ASHL(result, 8); __DEL(cmd); - return _o_result; + return __ASHL(result, 8); } int16 Platform_Error (void) { - int16 _o_result; - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h) { - int16 _o_result; int32 fd; fd = Platform_openro(n, n__len); if (fd == Platform_invalidHandleValue()) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { *h = fd; - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h) { - int16 _o_result; int32 fd; fd = Platform_openrw(n, n__len); if (fd == Platform_invalidHandleValue()) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { *h = fd; - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h) { - int16 _o_result; int32 fd; fd = Platform_opennew(n, n__len); if (fd == Platform_invalidHandleValue()) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { *h = fd; - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_Close (int32 h) { - int16 _o_result; if (Platform_closeHandle(h) == 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ) { - int16 _o_result; Platform_byHandleFileInformation(); if (Platform_getFileInformationByHandle(h) == 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } (*identity).volume = Platform_bhfiVsn(); (*identity).indexhigh = Platform_bhfiIndexHigh(); (*identity).indexlow = Platform_bhfiIndexLow(); (*identity).mtimehigh = Platform_bhfiMtimeHigh(); (*identity).mtimelow = Platform_bhfiMtimeLow(); - _o_result = 0; - return _o_result; + return 0; } int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ) { - int16 _o_result; int32 h; int16 e, i; __DUP(n, n__len, CHAR); e = Platform_OldRO((void*)n, n__len, &h); if (e != 0) { - _o_result = e; __DEL(n); - return _o_result; + return e; } e = Platform_Identify(h, &*identity, identity__typ); i = Platform_Close(h); - _o_result = e; __DEL(n); - return _o_result; + return e; } BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2) { - BOOLEAN _o_result; - _o_result = (((i1.indexhigh == i2.indexhigh && i1.indexlow == i2.indexlow)) && i1.volume == i2.volume); - return _o_result; + return (((i1.indexhigh == i2.indexhigh && i1.indexlow == i2.indexlow)) && i1.volume == i2.volume); } BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2) { - BOOLEAN _o_result; - _o_result = (i1.mtimehigh == i2.mtimehigh && i1.mtimelow == i2.mtimelow); - return _o_result; + return (i1.mtimehigh == i2.mtimehigh && i1.mtimelow == i2.mtimelow); } void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Platform_FileIdentity source) @@ -542,160 +491,127 @@ void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d) int16 Platform_Size (int32 h, int32 *l) { - int16 _o_result; Platform_largeInteger(); if (Platform_getFileSize(h) == 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } *l = Platform_liLongint(); - _o_result = 0; - return _o_result; + return 0; } int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n) { - int16 _o_result; int16 result; int32 lengthread; result = Platform_readfile(h, p, l, &lengthread); if (result == 0) { *n = 0; - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { *n = lengthread; - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n) { - int16 _o_result; int16 result; int32 lengthread; result = Platform_readfile(h, (address)b, b__len, &lengthread); if (result == 0) { *n = 0; - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { *n = lengthread; - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_Write (int32 h, int32 p, int32 l) { - int16 _o_result; if (Platform_writefile(h, p, l) == 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_Sync (int32 h) { - int16 _o_result; if (Platform_flushFileBuffers(h) == 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_Seek (int32 h, int32 o, int16 r) { - int16 _o_result; int16 rc; Platform_largeInteger(); Platform_setFilePointerEx(h, o, r, &rc); if (rc == 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_Truncate (int32 h, int32 limit) { - int16 _o_result; int16 rc; int32 oldpos; Platform_largeInteger(); Platform_getFilePos(h, &oldpos, &rc); if (rc == 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } Platform_setFilePointerEx(h, limit, Platform_seekset(), &rc); if (rc == 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } if (Platform_setEndOfFile(h) == 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } Platform_setFilePointerEx(h, oldpos, Platform_seekset(), &rc); if (rc == 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } - _o_result = 0; - return _o_result; + return 0; } int16 Platform_Unlink (CHAR *n, LONGINT n__len) { - int16 _o_result; if (Platform_deleteFile(n, n__len) == 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_Chdir (CHAR *n, LONGINT n__len) { - int16 _o_result; int16 r; r = Platform_setCurrentDirectory(n, n__len); if (r == 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } Platform_getCurrentDirectory((void*)Platform_CWD, 4096); - _o_result = 0; - return _o_result; + return 0; } int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) { - int16 _o_result; if (Platform_moveFile(o, o__len, n, n__len) == 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 87ddfb2a..0aca5733 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -25,7 +25,6 @@ static CHAR Reals_ToHex (int16 i); REAL Reals_Ten (int16 e) { - REAL _o_result; LONGREAL r, power; r = (LONGREAL)1; power = (LONGREAL)10; @@ -36,13 +35,11 @@ REAL Reals_Ten (int16 e) power = power * power; e = __ASHR(e, 1); } - _o_result = r; - return _o_result; + return r; } LONGREAL Reals_TenL (int16 e) { - LONGREAL _o_result; LONGREAL r, power; r = (LONGREAL)1; power = (LONGREAL)10; @@ -52,8 +49,7 @@ LONGREAL Reals_TenL (int16 e) } e = __ASHR(e, 1); if (e <= 0) { - _o_result = r; - return _o_result; + return r; } power = power * power; } @@ -62,11 +58,9 @@ LONGREAL Reals_TenL (int16 e) int16 Reals_Expo (REAL x) { - int16 _o_result; int16 i; __GET((address)&x + 2, i, int16); - _o_result = __MASK(__ASHR(i, 7), -256); - return _o_result; + return __MASK(__ASHR(i, 7), -256); } void Reals_SetExpo (REAL *x, int16 ex) @@ -80,11 +74,9 @@ void Reals_SetExpo (REAL *x, int16 ex) int16 Reals_ExpoL (LONGREAL x) { - int16 _o_result; int16 i; __GET((address)&x + 6, i, int16); - _o_result = __MASK(__ASHR(i, 4), -2048); - return _o_result; + return __MASK(__ASHR(i, 4), -2048); } void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len) @@ -122,13 +114,10 @@ void Reals_Convert (REAL x, int16 n, CHAR *d, LONGINT d__len) static CHAR Reals_ToHex (int16 i) { - CHAR _o_result; if (i < 10) { - _o_result = (CHAR)(i + 48); - return _o_result; + return (CHAR)(i + 48); } else { - _o_result = (CHAR)(i + 55); - return _o_result; + return (CHAR)(i + 55); } __RETCHK; } diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index 5bbe808d..000c09c8 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -23,7 +23,6 @@ export void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR int16 Strings_Length (CHAR *s, LONGINT s__len) { - int16 _o_result; int32 i; __DUP(s, s__len, CHAR); i = 0; @@ -31,13 +30,11 @@ int16 Strings_Length (CHAR *s, LONGINT s__len) i += 1; } if (i <= 32767) { - _o_result = (int16)i; __DEL(s); - return _o_result; + return (int16)i; } else { - _o_result = 32767; __DEL(s); - return _o_result; + return 32767; } __RETCHK; } @@ -70,6 +67,7 @@ void Strings_Insert (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, L } if (pos > n1) { Strings_Append(dest, dest__len, (void*)source, source__len); + __DEL(source); return; } if ((pos + n2) < dest__len) { @@ -131,6 +129,7 @@ void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHA } if (pos >= len) { dest[0] = 0x00; + __DEL(source); return; } i = 0; @@ -146,17 +145,15 @@ void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHA int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int16 pos) { - int16 _o_result; int16 n1, n2, i, j; __DUP(pattern, pattern__len, CHAR); __DUP(s, s__len, CHAR); n1 = Strings_Length(s, s__len); n2 = Strings_Length(pattern, pattern__len); if (n2 == 0) { - _o_result = 0; __DEL(pattern); __DEL(s); - return _o_result; + return 0; } i = pos; while (i <= n1 - n2) { @@ -166,18 +163,16 @@ int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, j += 1; } if (j == n2) { - _o_result = i; __DEL(pattern); __DEL(s); - return _o_result; + return i; } } i += 1; } - _o_result = -1; __DEL(pattern); __DEL(s); - return _o_result; + return -1; } void Strings_Cap (CHAR *s, LONGINT s__len) @@ -200,50 +195,42 @@ static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__le static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, int16 n, int16 m) { - BOOLEAN _o_result; while ((((n >= 0 && m >= 0)) && mask[__X(m, mask__len)] != '*')) { if (name[__X(n, name__len)] != mask[__X(m, mask__len)]) { - _o_result = 0; - return _o_result; + return 0; } n -= 1; m -= 1; } if (m < 0) { - _o_result = n < 0; - return _o_result; + return n < 0; } while ((m >= 0 && mask[__X(m, mask__len)] == '*')) { m -= 1; } if (m < 0) { - _o_result = 1; - return _o_result; + return 1; } while (n >= 0) { if (M__8(name, name__len, mask, mask__len, n, m)) { - _o_result = 1; - return _o_result; + return 1; } n -= 1; } - _o_result = 0; - return _o_result; + return 0; } BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len) { - BOOLEAN _o_result; struct Match__7 _s; __DUP(string, string__len, CHAR); __DUP(pattern, pattern__len, CHAR); _s.lnk = Match__7_s; Match__7_s = &_s; - _o_result = M__8((void*)string, string__len, (void*)pattern, pattern__len, Strings_Length(string, string__len) - 1, Strings_Length(pattern, pattern__len) - 1); Match__7_s = _s.lnk; __DEL(string); __DEL(pattern); - return _o_result; + return M__8((void*)string, string__len, (void*)pattern, pattern__len, Strings_Length(string, string__len) - 1, Strings_Length(pattern, pattern__len) - 1); } diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index 6676d700..961ebbe7 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -234,12 +234,10 @@ export void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGIN static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len) { - Texts_FontsFont _o_result; Texts_FontsFont F = NIL; __NEW(F, Texts_FontDesc); __COPY(name, F->name, 32); - _o_result = F; - return _o_result; + return F; } static void Texts_Find (Texts_Text T, int32 *pos, Texts_Run *u, int32 *org, int32 *off) @@ -338,22 +336,18 @@ static void Texts_Splice (Texts_Run un, Texts_Run v, Texts_Run w, Texts_Text bas static Texts_Piece Texts_ClonePiece (Texts_Piece p) { - Texts_Piece _o_result; Texts_Piece q = NIL; __NEW(q, Texts_PieceDesc); __GUARDEQP(q, Texts_PieceDesc) = *p; - _o_result = q; - return _o_result; + return q; } static Texts_Elem Texts_CloneElem (Texts_Elem e) { - Texts_Elem _o_result; Texts_CopyMsg msg; msg.e = NIL; (*e->handle)(e, (void*)&msg, Texts_CopyMsg__typ); - _o_result = msg.e; - return _o_result; + return msg.e; } void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE) @@ -369,14 +363,11 @@ void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE) Texts_Text Texts_ElemBase (Texts_Elem E) { - Texts_Text _o_result; - _o_result = E->base; - return _o_result; + return E->base; } int32 Texts_ElemPos (Texts_Elem E) { - int32 _o_result; Texts_Run u = NIL; int32 pos; u = E->base->head->next; @@ -385,8 +376,7 @@ int32 Texts_ElemPos (Texts_Elem E) pos = pos + u->len; u = u->next; } - _o_result = pos; - return _o_result; + return pos; } static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, address *msg__typ) @@ -716,9 +706,7 @@ void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ) int32 Texts_Pos (Texts_Reader *R, address *R__typ) { - int32 _o_result; - _o_result = (*R).org + (*R).off; - return _o_result; + return (*R).org + (*R).off; } void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int32 pos) diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 8d8ec59f..9b1abaed 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -317,14 +317,11 @@ void Files_Close (Files_File f) int32 Files_Length (Files_File f) { - int32 _o_result; - _o_result = f->len; - return _o_result; + return f->len; } Files_File Files_New (CHAR *name, LONGINT name__len) { - Files_File _o_result; Files_File f = NIL; __DUP(name, name__len, CHAR); __NEW(f, Files_FileDesc); @@ -335,9 +332,8 @@ Files_File Files_New (CHAR *name, LONGINT name__len) f->len = 0; f->pos = 0; f->swapper = -1; - _o_result = f; __DEL(name); - return _o_result; + return f; } static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len) @@ -385,7 +381,6 @@ static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len) static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len) { - BOOLEAN _o_result; int16 i; CHAR ch; i = 0; @@ -394,13 +389,11 @@ static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len) i += 1; ch = name[i]; } - _o_result = ch == '/'; - return _o_result; + return ch == '/'; } static Files_File Files_CacheEntry (Platform_FileIdentity identity) { - Files_File _o_result; Files_File f = NIL; int16 i, error; f = Files_files; @@ -419,18 +412,15 @@ static Files_File Files_CacheEntry (Platform_FileIdentity identity) f->identity = identity; error = Platform_Size(f->fd, &f->len); } - _o_result = f; - return _o_result; + return f; } f = f->next; } - _o_result = NIL; - return _o_result; + return NIL; } Files_File Files_Old (CHAR *name, LONGINT name__len) { - Files_File _o_result; Files_File f = NIL; int32 fd; int16 pos; @@ -470,9 +460,8 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) error = Platform_Identify(fd, &identity, Platform_FileIdentity__typ); f = Files_CacheEntry(identity); if (f != NIL) { - _o_result = f; __DEL(name); - return _o_result; + return f; } else { __NEW(f, Files_FileDesc); Heap_RegisterFinalizer((void*)f, Files_Finalize); @@ -488,23 +477,20 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) f->next = Files_files; Files_files = f; Heap_FileCount += 1; - _o_result = f; __DEL(name); - return _o_result; + return f; } } else if (dir[0] == 0x00) { - _o_result = NIL; __DEL(name); - return _o_result; + return NIL; } else { Files_MakeFileName(dir, 256, name, name__len, (void*)path, 256); Files_ScanPath(&pos, (void*)dir, 256); } } } else { - _o_result = NIL; __DEL(name); - return _o_result; + return NIL; } __RETCHK; } @@ -544,9 +530,7 @@ void Files_GetDate (Files_File f, int32 *t, int32 *d) int32 Files_Pos (Files_Rider *r, address *r__typ) { - int32 _o_result; - _o_result = (*r).org + (*r).offset; - return _o_result; + return (*r).org + (*r).offset; } void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos) @@ -673,9 +657,7 @@ void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x Files_File Files_Base (Files_Rider *r, address *r__typ) { - Files_File _o_result; - _o_result = (*r).buf->f; - return _o_result; + return (*r).buf->f; } void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x) @@ -759,17 +741,23 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int error = Platform_Rename((void*)old, old__len, (void*)new, new__len); if (!Platform_DifferentFilesystems(error)) { *res = error; + __DEL(old); + __DEL(new); return; } else { error = Platform_OldRO((void*)old, old__len, &fdold); if (error != 0) { *res = 2; + __DEL(old); + __DEL(new); return; } error = Platform_New((void*)new, new__len, &fdnew); if (error != 0) { error = Platform_Close(fdold); *res = 3; + __DEL(old); + __DEL(new); return; } error = Platform_Read(fdold, (address)buf, 4096, &n); diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index 0da695a9..5117800b 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -127,7 +127,6 @@ void Heap_Unlock (void) SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) { - SYSTEM_PTR _o_result; Heap_Module m; if (__STRCMP(name, "Heap") == 0) { __SYSNEW(m, 64); @@ -141,8 +140,7 @@ SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) m->enumPtrs = enumPtrs; m->next = (Heap_Module)(address)Heap_modules; Heap_modules = (SYSTEM_PTR)m; - _o_result = (void*)m; - return _o_result; + return (void*)m; } void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) @@ -172,7 +170,6 @@ void Heap_INCREF (Heap_Module m) static int64 Heap_NewChunk (int64 blksz) { - int64 _o_result; int64 chnk; chnk = Heap_OSAllocate(blksz + 24); if (chnk != 0) { @@ -184,8 +181,7 @@ static int64 Heap_NewChunk (int64 blksz) Heap_bigBlocks = chnk + 24; Heap_heapsize += blksz; } - _o_result = chnk; - return _o_result; + return chnk; } static void Heap_ExtendHeap (int64 blksz) @@ -219,7 +215,6 @@ static void Heap_ExtendHeap (int64 blksz) SYSTEM_PTR Heap_NEWREC (int64 tag) { - SYSTEM_PTR _o_result; int64 i, i0, di, blksz, restsize, t, adr, end, next, prev; SYSTEM_PTR new; Heap_Lock(); @@ -267,12 +262,10 @@ SYSTEM_PTR Heap_NEWREC (int64 tag) new = Heap_NEWREC(tag); } Heap_Unlock(); - _o_result = new; - return _o_result; + return new; } else { Heap_Unlock(); - _o_result = NIL; - return _o_result; + return NIL; } } __GET(adr + 8, t, int64); @@ -320,13 +313,11 @@ SYSTEM_PTR Heap_NEWREC (int64 tag) __PUT(adr + 16, 0, int64); Heap_allocated += blksz; Heap_Unlock(); - _o_result = (SYSTEM_PTR)(address)(adr + 8); - return _o_result; + return (SYSTEM_PTR)(address)(adr + 8); } SYSTEM_PTR Heap_NEWBLK (int64 size) { - SYSTEM_PTR _o_result; int64 blksz, tag; SYSTEM_PTR new; Heap_Lock(); @@ -338,8 +329,7 @@ SYSTEM_PTR Heap_NEWBLK (int64 size) __PUT(tag + 8, -8, int64); __PUT((int64)(address)new - 8, tag, int64); Heap_Unlock(); - _o_result = new; - return _o_result; + return new; } static void Heap_Mark (int64 q) diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 9f7407f0..97e17ad2 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -74,7 +74,6 @@ static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len) Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len) { - Modules_Module _o_result; Modules_Module m = NIL; CHAR bodyname[64]; Modules_Command body; @@ -93,14 +92,12 @@ Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len) Modules_Append((void*)Modules_resMsg, 256, name, name__len); Modules_Append((void*)Modules_resMsg, 256, (CHAR*)"\" not found", 12); } - _o_result = m; __DEL(name); - return _o_result; + return m; } Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len) { - Modules_Command _o_result; Modules_Cmd c = NIL; __DUP(name, name__len, CHAR); c = mod->cmds; @@ -110,9 +107,8 @@ Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT nam if (c != NIL) { Modules_res = 0; Modules_resMsg[0] = 0x00; - _o_result = c->cmd; __DEL(name); - return _o_result; + return c->cmd; } else { Modules_res = 2; __MOVE(" command \"", Modules_resMsg, 11); @@ -121,9 +117,8 @@ Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT nam Modules_Append((void*)Modules_resMsg, 256, (CHAR*)".", 2); Modules_Append((void*)Modules_resMsg, 256, name, name__len); Modules_Append((void*)Modules_resMsg, 256, (CHAR*)"\" not found", 12); - _o_result = NIL; __DEL(name); - return _o_result; + return NIL; } __RETCHK; } diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index 038bd92c..dff6adc6 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -74,7 +74,6 @@ static void OPB_err (int16 n) OPT_Node OPB_NewLeaf (OPT_Object obj) { - OPT_Node _o_result; OPT_Node node = NIL; switch (obj->mode) { case 1: @@ -102,8 +101,7 @@ OPT_Node OPB_NewLeaf (OPT_Object obj) } node->obj = obj; node->typ = obj->typ; - _o_result = node; - return _o_result; + return node; } void OPB_Construct (int8 class, OPT_Node *x, OPT_Node y) @@ -131,34 +129,27 @@ void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y) static int16 OPB_BoolToInt (BOOLEAN b) { - int16 _o_result; if (b) { - _o_result = 1; - return _o_result; + return 1; } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } static BOOLEAN OPB_IntToBool (int64 i) { - BOOLEAN _o_result; - _o_result = i != 0; - return _o_result; + return i != 0; } OPT_Node OPB_NewBoolConst (BOOLEAN boolval) { - OPT_Node _o_result; OPT_Node x = NIL; x = OPT_NewNode(7); x->typ = OPT_booltyp; x->conval = OPT_NewConst(); x->conval->intval = OPB_BoolToInt(boolval); - _o_result = x; - return _o_result; + return x; } void OPB_OptIf (OPT_Node *x) @@ -198,26 +189,22 @@ void OPB_OptIf (OPT_Node *x) OPT_Node OPB_Nil (void) { - OPT_Node _o_result; OPT_Node x = NIL; x = OPT_NewNode(7); x->typ = OPT_niltyp; x->conval = OPT_NewConst(); x->conval->intval = 0; - _o_result = x; - return _o_result; + return x; } OPT_Node OPB_EmptySet (void) { - OPT_Node _o_result; OPT_Node x = NIL; x = OPT_NewNode(7); x->typ = OPT_settyp; x->conval = OPT_NewConst(); x->conval->setval = 0x0; - _o_result = x; - return _o_result; + return x; } static void OPB_SetIntType (OPT_Node node) @@ -238,32 +225,27 @@ static void OPB_SetSetType (OPT_Node node) OPT_Node OPB_NewIntConst (int64 intval) { - OPT_Node _o_result; OPT_Node x = NIL; x = OPT_NewNode(7); x->conval = OPT_NewConst(); x->conval->intval = intval; OPB_SetIntType(x); - _o_result = x; - return _o_result; + return x; } OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ) { - OPT_Node _o_result; OPT_Node x = NIL; x = OPT_NewNode(7); x->conval = OPT_NewConst(); x->conval->realval = realval; x->typ = typ; x->conval->intval = -1; - _o_result = x; - return _o_result; + return x; } OPT_Node OPB_NewString (OPS_String str, int64 len) { - OPT_Node _o_result; OPT_Node x = NIL; x = OPT_NewNode(7); x->conval = OPT_NewConst(); @@ -272,8 +254,7 @@ OPT_Node OPB_NewString (OPS_String str, int64 len) x->conval->intval2 = OPM_Longint(len); x->conval->ext = OPT_NewExt(); __COPY(str, *x->conval->ext, 256); - _o_result = x; - return _o_result; + return x; } static void OPB_CharToString (OPT_Node n) @@ -305,9 +286,7 @@ static void OPB_BindNodes (int8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y) static BOOLEAN OPB_NotVar (OPT_Node x) { - BOOLEAN _o_result; - _o_result = (x->class >= 7 && ((x->class != 11 || x->subcl != 29) || x->left->class >= 7)); - return _o_result; + return (x->class >= 7 && ((x->class != 11 || x->subcl != 29) || x->left->class >= 7)); } void OPB_DeRef (OPT_Node *x) @@ -489,7 +468,6 @@ void OPB_In (OPT_Node *x, OPT_Node y) static int64 OPB_log (int64 x) { - int64 _o_result; OPB_exp = 0; if (x > 0) { while (!__ODD(x)) { @@ -497,8 +475,7 @@ static int64 OPB_log (int64 x) OPB_exp += 1; } } - _o_result = x; - return _o_result; + return x; } static void OPB_CheckRealType (int16 f, int16 nr, OPT_Const x) @@ -529,14 +506,12 @@ static OPT_Node NewOp__29 (int8 op, OPT_Struct typ, OPT_Node z); static OPT_Node NewOp__29 (int8 op, OPT_Struct typ, OPT_Node z) { - OPT_Node _o_result; OPT_Node node = NIL; node = OPT_NewNode(11); node->subcl = op; node->typ = typ; node->left = z; - _o_result = node; - return _o_result; + return node; } void OPB_MOp (int8 op, OPT_Node *x) @@ -775,7 +750,6 @@ static int16 ConstCmp__14 (void); static int16 ConstCmp__14 (void) { - int16 _o_result; int16 res; switch (*ConstOp__13_s->f) { case 0: @@ -836,8 +810,7 @@ static int16 ConstCmp__14 (void) break; } (*ConstOp__13_s->x)->typ = OPT_booltyp; - _o_result = res; - return _o_result; + return res; } static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) @@ -1202,7 +1175,6 @@ static void NewOp__39 (int8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y) static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) { - BOOLEAN _o_result; BOOLEAN ok, xCharArr, yCharArr; xCharArr = (__IN((*x)->typ->comp, 0x0c, 32) && (*x)->typ->BaseTyp->form == 3) || *Op__38_s->f == 8; yCharArr = (__IN((*y)->typ->comp, 0x0c, 32) && (*y)->typ->BaseTyp->form == 3) || *Op__38_s->g == 8; @@ -1228,8 +1200,7 @@ static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) OPB_Index(&*x, OPB_NewIntConst(0)); } } - _o_result = ok; - return _o_result; + return ok; } void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) @@ -2016,14 +1987,12 @@ static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right) { - OPT_Node _o_result; OPT_Node node = NIL; node = OPT_NewNode(class); node->subcl = subcl; node->left = left; node->right = right; - _o_result = node; - return _o_result; + return node; } void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index 20c369e9..9401b9a7 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -157,19 +157,16 @@ static void OPC_Str1 (CHAR *s, LONGINT s__len, int32 x) static int16 OPC_Length (CHAR *s, LONGINT s__len) { - int16 _o_result; int16 i; i = 0; while (s[__X(i, s__len)] != 0x00) { i += 1; } - _o_result = i; - return _o_result; + return i; } static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len) { - int16 _o_result; int16 i, h; i = 0; h = 0; @@ -177,8 +174,7 @@ static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len) h = 3 * h + (int16)s[__X(i, s__len)]; i += 1; } - _o_result = (int)__MOD(h, 105); - return _o_result; + return (int)__MOD(h, 105); } void OPC_Ident (OPT_Object obj) @@ -320,9 +316,7 @@ void OPC_Andent (OPT_Struct typ) static BOOLEAN OPC_Undefined (OPT_Object obj) { - BOOLEAN _o_result; - _o_result = obj->name[0] == 0x00 || (((obj->mnolev >= 0 && obj->linkadr != (3 + OPM_currFile))) && obj->linkadr != 2); - return _o_result; + return obj->name[0] == 0x00 || (((obj->mnolev >= 0 && obj->linkadr != (3 + OPM_currFile))) && obj->linkadr != 2); } static void OPC_DeclareBase (OPT_Object dcl) @@ -391,13 +385,11 @@ static void OPC_DeclareBase (OPT_Object dcl) int32 OPC_NofPtrs (OPT_Struct typ) { - int32 _o_result; OPT_Object fld = NIL; OPT_Struct btyp = NIL; int32 n; if ((typ->form == 11 && typ->sysflag == 0)) { - _o_result = 1; - return _o_result; + return 1; } else if ((typ->comp == 4 && __MASK(typ->sysflag, -256) == 0)) { btyp = typ->BaseTyp; if (btyp != NIL) { @@ -414,8 +406,7 @@ int32 OPC_NofPtrs (OPT_Struct typ) } fld = fld->link; } - _o_result = n; - return _o_result; + return n; } else if (typ->comp == 2) { btyp = typ->BaseTyp; n = typ->n; @@ -423,11 +414,9 @@ int32 OPC_NofPtrs (OPT_Struct typ) n = btyp->n * n; btyp = btyp->BaseTyp; } - _o_result = OPC_NofPtrs(btyp) * n; - return _o_result; + return OPC_NofPtrs(btyp) * n; } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } @@ -608,7 +597,6 @@ static void OPC_DeclareTProcs (OPT_Object obj, BOOLEAN *empty) OPT_Object OPC_BaseTProc (OPT_Object obj) { - OPT_Object _o_result; OPT_Struct typ = NIL, base = NIL; int32 mno; typ = obj->link->typ; @@ -622,8 +610,7 @@ OPT_Object OPC_BaseTProc (OPT_Object obj) base = typ->BaseTyp; } OPT_FindField(obj->name, typ, &obj); - _o_result = obj; - return _o_result; + return obj; } static void OPC_DefineTProcMacros (OPT_Object obj, BOOLEAN *empty) @@ -734,18 +721,14 @@ static void OPC_DefineType (OPT_Struct str) static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len) { - BOOLEAN _o_result; int16 i; - BOOLEAN r; __DUP(y, y__len, CHAR); i = 0; while ((*x)[__X(i + 1, 256)] == y[__X(i, y__len)]) { i += 1; } - r = y[__X(i, y__len)] == 0x00; - _o_result = r; __DEL(y); - return _o_result; + return y[__X(i, y__len)] == 0x00; } static void OPC_CProcDefs (OPT_Object obj, int16 vis) @@ -1455,12 +1438,6 @@ void OPC_EnterProc (OPT_Object proc) } OPC_ProcHeader(proc, 1); OPC_BegBlk(); - if (proc->typ != OPT_notyp) { - OPC_BegStat(); - OPC_Ident(proc->typ->strobj); - OPM_WriteString((CHAR*)" _o_result;", 12); - OPM_WriteLn(); - } scope = proc->scope; OPC_IdentList(scope->scope, 0); if (!scope->leaf) { diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 47d8fab3..5b67d672 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -124,33 +124,25 @@ void OPM_LogWLn (void) int64 OPM_SignedMaximum (int32 bytecount) { - int64 _o_result; int64 result; result = 1; result = __LSH(result, __ASHL(bytecount, 3) - 1, 64); - _o_result = result - 1; - return _o_result; + return result - 1; } int64 OPM_SignedMinimum (int32 bytecount) { - int64 _o_result; - _o_result = -OPM_SignedMaximum(bytecount) - 1; - return _o_result; + return -OPM_SignedMaximum(bytecount) - 1; } int32 OPM_Longint (int64 n) { - int32 _o_result; - _o_result = __VAL(int32, n); - return _o_result; + return __VAL(int32, n); } int16 OPM_Integer (int64 n) { - int16 _o_result; - _o_result = __VAL(int16, n); - return _o_result; + return __VAL(int16, n); } static void OPM_ScanOptions (CHAR *s, LONGINT s__len) @@ -266,7 +258,6 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len) BOOLEAN OPM_OpenPar (void) { - BOOLEAN _o_result; CHAR s[256]; if (Platform_ArgCount == 1) { OPM_LogWLn(); @@ -274,7 +265,7 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWStr(Configuration_versionLong, 75); OPM_LogW('.'); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Based on Ofront by Software Templ OEG.", 39); + OPM_LogWStr((CHAR*)"Based on Ofront by J. Templ and Software Templ OEG.", 52); OPM_LogWLn(); OPM_LogWStr((CHAR*)"Further development by Norayr Chilingarian, David Brown and others.", 68); OPM_LogWLn(); @@ -287,7 +278,7 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWStr((CHAR*)" options {files {options}}.", 28); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Where options = [\"-\" {option} ].", 33); + OPM_LogWStr((CHAR*)"Options:", 9); OPM_LogWLn(); OPM_LogWLn(); OPM_LogWStr((CHAR*)" Run time safety", 18); @@ -345,7 +336,7 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWLn(); OPM_LogWStr((CHAR*)" -A48 32 bit addresses, 64 bit alignment (e.g. Windows 32 bit on x86, linux 32 bit on arm).", 97); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -A88 66 bit addresses, 64 bit alignment (e.g. 64 bit platforms).", 71); + OPM_LogWStr((CHAR*)" -A88 64 bit addresses, 64 bit alignment (e.g. 64 bit platforms).", 71); OPM_LogWLn(); OPM_LogWLn(); OPM_LogWStr((CHAR*)"All options are off by default, except where noted above.", 58); @@ -356,8 +347,7 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWLn(); OPM_LogWStr((CHAR*)"Repeating an option toggles its value.", 39); OPM_LogWLn(); - _o_result = 0; - return _o_result; + return 0; } else { OPM_AddressSize = 8; OPM_GetAlignment(&OPM_Alignment); @@ -376,8 +366,7 @@ BOOLEAN OPM_OpenPar (void) OPM_GlobalAlignment = OPM_Alignment; __COPY(OPM_Model, OPM_GlobalModel, 10); OPM_GlobalOptions = OPM_Options; - _o_result = 1; - return _o_result; + return 1; } __RETCHK; } @@ -741,20 +730,16 @@ void OPM_SymRCh (CHAR *ch) int32 OPM_SymRInt (void) { - int32 _o_result; int32 k; Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&k, 4); - _o_result = k; - return _o_result; + return k; } int64 OPM_SymRInt64 (void) { - int64 _o_result; int64 k; Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&k, 8); - _o_result = k; - return _o_result; + return k; } void OPM_SymRSet (uint64 *s) @@ -797,9 +782,7 @@ void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done) BOOLEAN OPM_eofSF (void) { - BOOLEAN _o_result; - _o_result = OPM_oldSF.eof; - return _o_result; + return OPM_oldSF.eof; } void OPM_SymWCh (CHAR ch) diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index 0325d7f2..615109df 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -901,7 +901,6 @@ static void OPP_Receiver (int8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct static BOOLEAN OPP_Extends (OPT_Struct x, OPT_Struct b) { - BOOLEAN _o_result; if ((b->form == 11 && x->form == 11)) { b = b->BaseTyp; x = x->BaseTyp; @@ -911,8 +910,7 @@ static BOOLEAN OPP_Extends (OPT_Struct x, OPT_Struct b) x = x->BaseTyp; } while (!(x == NIL || x == b)); } - _o_result = x == b; - return _o_result; + return x == b; } static struct ProcedureDeclaration__16 { diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index b3c52f3c..5a34663d 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -97,7 +97,6 @@ static LONGREAL Ten__9 (int16 e); static LONGREAL Ten__9 (int16 e) { - LONGREAL _o_result; LONGREAL x, p; x = (LONGREAL)1; p = (LONGREAL)10; @@ -110,23 +109,18 @@ static LONGREAL Ten__9 (int16 e) p = p * p; } } - _o_result = x; - return _o_result; + return x; } static int16 Ord__7 (CHAR ch, BOOLEAN hex) { - int16 _o_result; if (ch <= '9') { - _o_result = (int16)ch - 48; - return _o_result; + return (int16)ch - 48; } else if (hex) { - _o_result = ((int16)ch - 65) + 10; - return _o_result; + return ((int16)ch - 65) + 10; } else { OPS_err(2); - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } @@ -324,6 +318,7 @@ void OPS_Get (int8 *sym) while (OPS_ch <= ' ') { if (OPS_ch == 0x00) { *sym = 64; + Get__1_s = _s.lnk; return; } else { OPM_Get(&OPS_ch); diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index fe2c4bd5..48352c94 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -179,7 +179,6 @@ static void OPT_err (int16 n) int16 OPT_IntSize (int64 n) { - int16 _o_result; int16 bytes; if (n < 0) { n = -(n + 1); @@ -188,77 +187,59 @@ int16 OPT_IntSize (int64 n) while ((bytes < 8 && __ASH(n, -(__ASHL(bytes, 3) - 1)) != 0)) { bytes += 1; } - _o_result = bytes; - return _o_result; + return bytes; } OPT_Struct OPT_IntType (int32 size) { - OPT_Struct _o_result; if (size <= OPT_int8typ->size) { - _o_result = OPT_int8typ; - return _o_result; + return OPT_int8typ; } if (size <= OPT_int16typ->size) { - _o_result = OPT_int16typ; - return _o_result; + return OPT_int16typ; } if (size <= OPT_int32typ->size) { - _o_result = OPT_int32typ; - return _o_result; + return OPT_int32typ; } - _o_result = OPT_int64typ; - return _o_result; + return OPT_int64typ; } OPT_Struct OPT_SetType (int32 size) { - OPT_Struct _o_result; if (size == OPT_set32typ->size) { - _o_result = OPT_set32typ; - return _o_result; + return OPT_set32typ; } - _o_result = OPT_set64typ; - return _o_result; + return OPT_set64typ; } OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir) { - OPT_Struct _o_result; int16 i; __ASSERT(x->form == 4, 0); __ASSERT(x->BaseTyp == OPT_undftyp, 0); __ASSERT(dir == 1 || dir == -1, 0); if (dir > 0) { if (x->size < OPT_sinttyp->size) { - _o_result = OPT_sinttyp; - return _o_result; + return OPT_sinttyp; } if (x->size < OPT_inttyp->size) { - _o_result = OPT_inttyp; - return _o_result; + return OPT_inttyp; } if (x->size < OPT_linttyp->size) { - _o_result = OPT_linttyp; - return _o_result; + return OPT_linttyp; } - _o_result = OPT_int64typ; - return _o_result; + return OPT_int64typ; } else { if (x->size > OPT_linttyp->size) { - _o_result = OPT_linttyp; - return _o_result; + return OPT_linttyp; } if (x->size > OPT_inttyp->size) { - _o_result = OPT_inttyp; - return _o_result; + return OPT_inttyp; } if (x->size > OPT_sinttyp->size) { - _o_result = OPT_sinttyp; - return _o_result; + return OPT_sinttyp; } - _o_result = OPT_int8typ; - return _o_result; + return OPT_int8typ; } __RETCHK; } @@ -285,7 +266,6 @@ void OPT_Align (int32 *adr, int32 base) int32 OPT_SizeAlignment (int32 size) { - int32 _o_result; int32 alignment; if (size < OPM_Alignment) { alignment = 1; @@ -295,13 +275,11 @@ int32 OPT_SizeAlignment (int32 size) } else { alignment = OPM_Alignment; } - _o_result = alignment; - return _o_result; + return alignment; } int32 OPT_BaseAlignment (OPT_Struct typ) { - int32 _o_result; int32 alignment; if (typ->form == 13) { if (typ->comp == 4) { @@ -312,8 +290,7 @@ int32 OPT_BaseAlignment (OPT_Struct typ) } else { alignment = OPT_SizeAlignment(typ->size); } - _o_result = alignment; - return _o_result; + return alignment; } void OPT_TypSize (OPT_Struct typ) @@ -389,25 +366,20 @@ void OPT_TypSize (OPT_Struct typ) OPT_Const OPT_NewConst (void) { - OPT_Const _o_result; OPT_Const const_ = NIL; __NEW(const_, OPT_ConstDesc); - _o_result = const_; - return _o_result; + return const_; } OPT_Object OPT_NewObj (void) { - OPT_Object _o_result; OPT_Object obj = NIL; __NEW(obj, OPT_ObjDesc); - _o_result = obj; - return _o_result; + return obj; } OPT_Struct OPT_NewStr (int8 form, int8 comp) { - OPT_Struct _o_result; OPT_Struct typ = NIL; __NEW(typ, OPT_StrDesc); typ->form = form; @@ -418,27 +390,22 @@ OPT_Struct OPT_NewStr (int8 form, int8 comp) } typ->size = -1; typ->BaseTyp = OPT_undftyp; - _o_result = typ; - return _o_result; + return typ; } OPT_Node OPT_NewNode (int8 class) { - OPT_Node _o_result; OPT_Node node = NIL; __NEW(node, OPT_NodeDesc); node->class = class; - _o_result = node; - return _o_result; + return node; } OPT_ConstExt OPT_NewExt (void) { - OPT_ConstExt _o_result; OPT_ConstExt ext = NIL; ext = __NEWARR(NIL, 1, 1, 1, 0, ((int64)(256))); - _o_result = ext; - return _o_result; + return ext; } void OPT_OpenScope (int8 level, OPT_Object owner) @@ -1120,7 +1087,6 @@ static void OPT_InSign (int8 mno, OPT_Struct *res, OPT_Object *par) static OPT_Object OPT_InFld (void) { - OPT_Object _o_result; int32 tag; OPT_Object obj = NIL; tag = OPT_impCtxt.nextTag; @@ -1146,13 +1112,11 @@ static OPT_Object OPT_InFld (void) obj->vis = 0; obj->adr = OPM_SymRInt(); } - _o_result = obj; - return _o_result; + return obj; } static OPT_Object OPT_InTProc (int8 mno) { - OPT_Object _o_result; int32 tag; OPT_Object obj = NIL; tag = OPT_impCtxt.nextTag; @@ -1174,22 +1138,17 @@ static OPT_Object OPT_InTProc (int8 mno) obj->vis = 0; obj->adr = __ASHL(OPM_SymRInt(), 16); } - _o_result = obj; - return _o_result; + return obj; } static OPT_Struct OPT_InTyp (int32 tag) { - OPT_Struct _o_result; if (tag == 4) { - _o_result = OPT_IntType(OPM_SymRInt()); - return _o_result; + return OPT_IntType(OPM_SymRInt()); } else if (tag == 7) { - _o_result = OPT_SetType(OPM_SymRInt()); - return _o_result; + return OPT_SetType(OPM_SymRInt()); } else { - _o_result = OPT_impCtxt.ref[__X(tag, 255)]; - return _o_result; + return OPT_impCtxt.ref[__X(tag, 255)]; } __RETCHK; } @@ -1378,7 +1337,6 @@ static void OPT_InStruct (OPT_Struct *typ) static OPT_Object OPT_InObj (int8 mno) { - OPT_Object _o_result; int16 i, s; CHAR ch; OPT_Object obj = NIL, old = NIL; @@ -1475,8 +1433,7 @@ static OPT_Object OPT_InObj (int8 mno) } } } - _o_result = obj; - return _o_result; + return obj; } void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 64c3f578..c7a907db 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -207,44 +207,35 @@ void OPV_AdrAndSize (OPT_Object topScope) static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp) { - int16 _o_result; switch (class) { case 7: case 0: case 2: case 4: case 9: case 13: - _o_result = 10; - return _o_result; + return 10; break; case 5: if (__IN(3, OPM_Options, 32)) { - _o_result = 10; - return _o_result; + return 10; } else { - _o_result = 9; - return _o_result; + return 9; } break; case 1: if (__IN(comp, 0x0c, 32)) { - _o_result = 10; - return _o_result; + return 10; } else { - _o_result = 9; - return _o_result; + return 9; } break; case 3: - _o_result = 9; - return _o_result; + return 9; break; case 11: switch (subclass) { case 33: case 7: case 24: case 29: case 20: - _o_result = 9; - return _o_result; + return 9; break; case 16: case 21: case 22: case 23: case 25: - _o_result = 10; - return _o_result; + return 10; break; default: OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Nmop, subclass = ", 55); @@ -257,64 +248,50 @@ static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp switch (subclass) { case 1: if (form == 7) { - _o_result = 4; - return _o_result; + return 4; } else { - _o_result = 8; - return _o_result; + return 8; } break; case 2: if (form == 7) { - _o_result = 3; - return _o_result; + return 3; } else { - _o_result = 8; - return _o_result; + return 8; } break; case 3: case 4: - _o_result = 10; - return _o_result; + return 10; break; case 6: if (form == 7) { - _o_result = 2; - return _o_result; + return 2; } else { - _o_result = 7; - return _o_result; + return 7; } break; case 7: if (form == 7) { - _o_result = 4; - return _o_result; + return 4; } else { - _o_result = 7; - return _o_result; + return 7; } break; case 11: case 12: case 13: case 14: - _o_result = 6; - return _o_result; + return 6; break; case 9: case 10: - _o_result = 5; - return _o_result; + return 5; break; case 5: - _o_result = 1; - return _o_result; + return 1; break; case 8: - _o_result = 0; - return _o_result; + return 0; break; case 19: case 15: case 17: case 18: case 26: case 27: case 28: - _o_result = 10; - return _o_result; + return 10; break; default: OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Ndop, subclass = ", 55); @@ -324,12 +301,10 @@ static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp } break; case 10: - _o_result = 10; - return _o_result; + return 10; break; case 8: case 6: - _o_result = 12; - return _o_result; + return 12; break; default: OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence, class = ", 43); @@ -358,13 +333,10 @@ static void OPV_Len (OPT_Node n, int64 dim) static BOOLEAN OPV_SideEffects (OPT_Node n) { - BOOLEAN _o_result; if (n != NIL) { - _o_result = (n->class == 13 || OPV_SideEffects(n->left)) || OPV_SideEffects(n->right); - return _o_result; + return (n->class == 13 || OPV_SideEffects(n->left)) || OPV_SideEffects(n->right); } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } @@ -744,7 +716,6 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) static OPT_Object OPV_SuperProc (OPT_Node n) { - OPT_Object _o_result; OPT_Object obj = NIL; OPT_Struct typ = NIL; typ = n->right->typ; @@ -752,8 +723,7 @@ static OPT_Object OPV_SuperProc (OPT_Node n) typ = typ->BaseTyp; } OPT_FindField(n->left->obj->name, typ->BaseTyp, &obj); - _o_result = obj; - return _o_result; + return obj; } static void OPV_expr (OPT_Node n, int16 prec) @@ -1187,12 +1157,10 @@ static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc) static BOOLEAN OPV_ImplicitReturn (OPT_Node n) { - BOOLEAN _o_result; while ((n != NIL && n->class != 26)) { n = n->link; } - _o_result = n == NIL; - return _o_result; + return n == NIL; } static void OPV_NewArr (OPT_Node d, OPT_Node x) @@ -1523,21 +1491,16 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPM_WriteString((CHAR*)"__ENDMOD", 9); } } else { + OPC_ExitProc(outerProc, 0, 0); + OPM_WriteString((CHAR*)"return", 7); if (n->left != NIL) { - OPM_WriteString((CHAR*)"_o_result = ", 13); + OPM_Write(' '); if ((n->left->typ->form == 11 && n->obj->typ != n->left->typ)) { OPM_WriteString((CHAR*)"(void*)", 8); OPV_expr(n->left, 10); } else { OPV_expr(n->left, -1); } - OPM_WriteString((CHAR*)";", 2); - OPM_WriteLn(); - OPC_BegStat(); - OPC_ExitProc(outerProc, 0, 0); - OPM_WriteString((CHAR*)"return _o_result", 17); - } else { - OPM_WriteString((CHAR*)"return", 7); } } break; diff --git a/bootstrap/windows-88/Out.c b/bootstrap/windows-88/Out.c index 3d2d0c84..6098e568 100644 --- a/bootstrap/windows-88/Out.c +++ b/bootstrap/windows-88/Out.c @@ -56,14 +56,12 @@ void Out_Char (CHAR ch) static int32 Out_Length (CHAR *s, LONGINT s__len) { - int32 _o_result; int32 l; l = 0; while ((l < s__len && s[__X(l, s__len)] != 0x00)) { l += 1; } - _o_result = l; - return _o_result; + return l; } void Out_String (CHAR *str, LONGINT str__len) @@ -152,7 +150,6 @@ static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16 LONGREAL Out_Ten (int16 e) { - LONGREAL _o_result; LONGREAL r, power; r = (LONGREAL)1; power = (LONGREAL)10; @@ -163,8 +160,7 @@ LONGREAL Out_Ten (int16 e) power = power * power; e = __ASHR(e, 1); } - _o_result = r; - return _o_result; + return r; } static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_) diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 845872c3..9eee96c2 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -186,65 +186,47 @@ extern void Heap_InitHeap(); BOOLEAN Platform_TooManyFiles (int16 e) { - BOOLEAN _o_result; - _o_result = e == Platform_ERRORTOOMANYOPENFILES(); - return _o_result; + return e == Platform_ERRORTOOMANYOPENFILES(); } BOOLEAN Platform_NoSuchDirectory (int16 e) { - BOOLEAN _o_result; - _o_result = e == Platform_ERRORPATHNOTFOUND(); - return _o_result; + return e == Platform_ERRORPATHNOTFOUND(); } BOOLEAN Platform_DifferentFilesystems (int16 e) { - BOOLEAN _o_result; - _o_result = e == Platform_ERRORNOTSAMEDEVICE(); - return _o_result; + return e == Platform_ERRORNOTSAMEDEVICE(); } BOOLEAN Platform_Inaccessible (int16 e) { - BOOLEAN _o_result; - _o_result = ((e == Platform_ERRORACCESSDENIED() || e == Platform_ERRORWRITEPROTECT()) || e == Platform_ERRORNOTREADY()) || e == Platform_ERRORSHARINGVIOLATION(); - return _o_result; + return ((e == Platform_ERRORACCESSDENIED() || e == Platform_ERRORWRITEPROTECT()) || e == Platform_ERRORNOTREADY()) || e == Platform_ERRORSHARINGVIOLATION(); } BOOLEAN Platform_Absent (int16 e) { - BOOLEAN _o_result; - _o_result = e == Platform_ERRORFILENOTFOUND() || e == Platform_ERRORPATHNOTFOUND(); - return _o_result; + return e == Platform_ERRORFILENOTFOUND() || e == Platform_ERRORPATHNOTFOUND(); } BOOLEAN Platform_TimedOut (int16 e) { - BOOLEAN _o_result; - _o_result = e == Platform_ETIMEDOUT(); - return _o_result; + return e == Platform_ETIMEDOUT(); } BOOLEAN Platform_ConnectionFailed (int16 e) { - BOOLEAN _o_result; - _o_result = ((e == Platform_ECONNREFUSED() || e == Platform_ECONNABORTED()) || e == Platform_ENETUNREACH()) || e == Platform_EHOSTUNREACH(); - return _o_result; + return ((e == Platform_ECONNREFUSED() || e == Platform_ECONNABORTED()) || e == Platform_ENETUNREACH()) || e == Platform_EHOSTUNREACH(); } BOOLEAN Platform_Interrupted (int16 e) { - BOOLEAN _o_result; - _o_result = e == Platform_EINTR(); - return _o_result; + return e == Platform_EINTR(); } int64 Platform_OSAllocate (int64 size) { - int64 _o_result; - _o_result = Platform_allocate(size); - return _o_result; + return Platform_allocate(size); } void Platform_OSFree (int64 address) @@ -265,20 +247,17 @@ void Platform_Init (int32 argc, int64 argvadr) BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len) { - BOOLEAN _o_result; CHAR buf[4096]; int16 res; __DUP(var, var__len, CHAR); res = Platform_getenv(var, var__len, (void*)buf, 4096); if ((res > 0 && res < 4096)) { __COPY(buf, val, val__len); - _o_result = 1; __DEL(var); - return _o_result; + return 1; } else { - _o_result = 0; __DEL(var); - return _o_result; + return 0; } __RETCHK; } @@ -329,7 +308,6 @@ void Platform_GetIntArg (int16 n, int32 *val) int16 Platform_ArgPos (CHAR *s, LONGINT s__len) { - int16 _o_result; int16 i; CHAR arg[256]; __DUP(s, s__len, CHAR); @@ -339,9 +317,8 @@ int16 Platform_ArgPos (CHAR *s, LONGINT s__len) i += 1; Platform_GetArg(i, (void*)arg, 256); } - _o_result = i; __DEL(s); - return _o_result; + return i; } void Platform_SetBadInstructionHandler (Platform_SignalHandler handler) @@ -362,11 +339,9 @@ void Platform_GetClock (int32 *t, int32 *d) int32 Platform_Time (void) { - int32 _o_result; int32 ms; ms = Platform_GetTickCount(); - _o_result = (int)__MOD(ms - Platform_TimeStart, 2147483647); - return _o_result; + return (int)__MOD(ms - Platform_TimeStart, 2147483647); } void Platform_Delay (int32 ms) @@ -392,7 +367,6 @@ void Platform_GetTimeOfDay (int32 *sec, int32 *usec) int16 Platform_System (CHAR *cmd, LONGINT cmd__len) { - int16 _o_result; int16 result; __DUP(cmd, cmd__len, CHAR); result = 127; @@ -404,127 +378,102 @@ int16 Platform_System (CHAR *cmd, LONGINT cmd__len) } Platform_cleanupProcess(); } - _o_result = __ASHL(result, 8); __DEL(cmd); - return _o_result; + return __ASHL(result, 8); } int16 Platform_Error (void) { - int16 _o_result; - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h) { - int16 _o_result; int32 fd; fd = Platform_openro(n, n__len); if (fd == Platform_invalidHandleValue()) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { *h = fd; - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h) { - int16 _o_result; int32 fd; fd = Platform_openrw(n, n__len); if (fd == Platform_invalidHandleValue()) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { *h = fd; - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h) { - int16 _o_result; int32 fd; fd = Platform_opennew(n, n__len); if (fd == Platform_invalidHandleValue()) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { *h = fd; - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_Close (int32 h) { - int16 _o_result; if (Platform_closeHandle(h) == 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ) { - int16 _o_result; Platform_byHandleFileInformation(); if (Platform_getFileInformationByHandle(h) == 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } (*identity).volume = Platform_bhfiVsn(); (*identity).indexhigh = Platform_bhfiIndexHigh(); (*identity).indexlow = Platform_bhfiIndexLow(); (*identity).mtimehigh = Platform_bhfiMtimeHigh(); (*identity).mtimelow = Platform_bhfiMtimeLow(); - _o_result = 0; - return _o_result; + return 0; } int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ) { - int16 _o_result; int32 h; int16 e, i; __DUP(n, n__len, CHAR); e = Platform_OldRO((void*)n, n__len, &h); if (e != 0) { - _o_result = e; __DEL(n); - return _o_result; + return e; } e = Platform_Identify(h, &*identity, identity__typ); i = Platform_Close(h); - _o_result = e; __DEL(n); - return _o_result; + return e; } BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2) { - BOOLEAN _o_result; - _o_result = (((i1.indexhigh == i2.indexhigh && i1.indexlow == i2.indexlow)) && i1.volume == i2.volume); - return _o_result; + return (((i1.indexhigh == i2.indexhigh && i1.indexlow == i2.indexlow)) && i1.volume == i2.volume); } BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2) { - BOOLEAN _o_result; - _o_result = (i1.mtimehigh == i2.mtimehigh && i1.mtimelow == i2.mtimelow); - return _o_result; + return (i1.mtimehigh == i2.mtimehigh && i1.mtimelow == i2.mtimelow); } void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Platform_FileIdentity source) @@ -542,160 +491,127 @@ void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d) int16 Platform_Size (int32 h, int32 *l) { - int16 _o_result; Platform_largeInteger(); if (Platform_getFileSize(h) == 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } *l = Platform_liLongint(); - _o_result = 0; - return _o_result; + return 0; } int16 Platform_Read (int32 h, int64 p, int32 l, int32 *n) { - int16 _o_result; int16 result; int32 lengthread; result = Platform_readfile(h, p, l, &lengthread); if (result == 0) { *n = 0; - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { *n = lengthread; - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n) { - int16 _o_result; int16 result; int32 lengthread; result = Platform_readfile(h, (address)b, b__len, &lengthread); if (result == 0) { *n = 0; - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { *n = lengthread; - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_Write (int32 h, int64 p, int32 l) { - int16 _o_result; if (Platform_writefile(h, p, l) == 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_Sync (int32 h) { - int16 _o_result; if (Platform_flushFileBuffers(h) == 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_Seek (int32 h, int32 o, int16 r) { - int16 _o_result; int16 rc; Platform_largeInteger(); Platform_setFilePointerEx(h, o, r, &rc); if (rc == 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_Truncate (int32 h, int32 limit) { - int16 _o_result; int16 rc; int32 oldpos; Platform_largeInteger(); Platform_getFilePos(h, &oldpos, &rc); if (rc == 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } Platform_setFilePointerEx(h, limit, Platform_seekset(), &rc); if (rc == 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } if (Platform_setEndOfFile(h) == 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } Platform_setFilePointerEx(h, oldpos, Platform_seekset(), &rc); if (rc == 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } - _o_result = 0; - return _o_result; + return 0; } int16 Platform_Unlink (CHAR *n, LONGINT n__len) { - int16 _o_result; if (Platform_deleteFile(n, n__len) == 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_Chdir (CHAR *n, LONGINT n__len) { - int16 _o_result; int16 r; r = Platform_setCurrentDirectory(n, n__len); if (r == 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } Platform_getCurrentDirectory((void*)Platform_CWD, 4096); - _o_result = 0; - return _o_result; + return 0; } int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) { - int16 _o_result; if (Platform_moveFile(o, o__len, n, n__len) == 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 87ddfb2a..0aca5733 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -25,7 +25,6 @@ static CHAR Reals_ToHex (int16 i); REAL Reals_Ten (int16 e) { - REAL _o_result; LONGREAL r, power; r = (LONGREAL)1; power = (LONGREAL)10; @@ -36,13 +35,11 @@ REAL Reals_Ten (int16 e) power = power * power; e = __ASHR(e, 1); } - _o_result = r; - return _o_result; + return r; } LONGREAL Reals_TenL (int16 e) { - LONGREAL _o_result; LONGREAL r, power; r = (LONGREAL)1; power = (LONGREAL)10; @@ -52,8 +49,7 @@ LONGREAL Reals_TenL (int16 e) } e = __ASHR(e, 1); if (e <= 0) { - _o_result = r; - return _o_result; + return r; } power = power * power; } @@ -62,11 +58,9 @@ LONGREAL Reals_TenL (int16 e) int16 Reals_Expo (REAL x) { - int16 _o_result; int16 i; __GET((address)&x + 2, i, int16); - _o_result = __MASK(__ASHR(i, 7), -256); - return _o_result; + return __MASK(__ASHR(i, 7), -256); } void Reals_SetExpo (REAL *x, int16 ex) @@ -80,11 +74,9 @@ void Reals_SetExpo (REAL *x, int16 ex) int16 Reals_ExpoL (LONGREAL x) { - int16 _o_result; int16 i; __GET((address)&x + 6, i, int16); - _o_result = __MASK(__ASHR(i, 4), -2048); - return _o_result; + return __MASK(__ASHR(i, 4), -2048); } void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len) @@ -122,13 +114,10 @@ void Reals_Convert (REAL x, int16 n, CHAR *d, LONGINT d__len) static CHAR Reals_ToHex (int16 i) { - CHAR _o_result; if (i < 10) { - _o_result = (CHAR)(i + 48); - return _o_result; + return (CHAR)(i + 48); } else { - _o_result = (CHAR)(i + 55); - return _o_result; + return (CHAR)(i + 55); } __RETCHK; } diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index 5bbe808d..000c09c8 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -23,7 +23,6 @@ export void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR int16 Strings_Length (CHAR *s, LONGINT s__len) { - int16 _o_result; int32 i; __DUP(s, s__len, CHAR); i = 0; @@ -31,13 +30,11 @@ int16 Strings_Length (CHAR *s, LONGINT s__len) i += 1; } if (i <= 32767) { - _o_result = (int16)i; __DEL(s); - return _o_result; + return (int16)i; } else { - _o_result = 32767; __DEL(s); - return _o_result; + return 32767; } __RETCHK; } @@ -70,6 +67,7 @@ void Strings_Insert (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, L } if (pos > n1) { Strings_Append(dest, dest__len, (void*)source, source__len); + __DEL(source); return; } if ((pos + n2) < dest__len) { @@ -131,6 +129,7 @@ void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHA } if (pos >= len) { dest[0] = 0x00; + __DEL(source); return; } i = 0; @@ -146,17 +145,15 @@ void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHA int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int16 pos) { - int16 _o_result; int16 n1, n2, i, j; __DUP(pattern, pattern__len, CHAR); __DUP(s, s__len, CHAR); n1 = Strings_Length(s, s__len); n2 = Strings_Length(pattern, pattern__len); if (n2 == 0) { - _o_result = 0; __DEL(pattern); __DEL(s); - return _o_result; + return 0; } i = pos; while (i <= n1 - n2) { @@ -166,18 +163,16 @@ int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, j += 1; } if (j == n2) { - _o_result = i; __DEL(pattern); __DEL(s); - return _o_result; + return i; } } i += 1; } - _o_result = -1; __DEL(pattern); __DEL(s); - return _o_result; + return -1; } void Strings_Cap (CHAR *s, LONGINT s__len) @@ -200,50 +195,42 @@ static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__le static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, int16 n, int16 m) { - BOOLEAN _o_result; while ((((n >= 0 && m >= 0)) && mask[__X(m, mask__len)] != '*')) { if (name[__X(n, name__len)] != mask[__X(m, mask__len)]) { - _o_result = 0; - return _o_result; + return 0; } n -= 1; m -= 1; } if (m < 0) { - _o_result = n < 0; - return _o_result; + return n < 0; } while ((m >= 0 && mask[__X(m, mask__len)] == '*')) { m -= 1; } if (m < 0) { - _o_result = 1; - return _o_result; + return 1; } while (n >= 0) { if (M__8(name, name__len, mask, mask__len, n, m)) { - _o_result = 1; - return _o_result; + return 1; } n -= 1; } - _o_result = 0; - return _o_result; + return 0; } BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len) { - BOOLEAN _o_result; struct Match__7 _s; __DUP(string, string__len, CHAR); __DUP(pattern, pattern__len, CHAR); _s.lnk = Match__7_s; Match__7_s = &_s; - _o_result = M__8((void*)string, string__len, (void*)pattern, pattern__len, Strings_Length(string, string__len) - 1, Strings_Length(pattern, pattern__len) - 1); Match__7_s = _s.lnk; __DEL(string); __DEL(pattern); - return _o_result; + return M__8((void*)string, string__len, (void*)pattern, pattern__len, Strings_Length(string, string__len) - 1, Strings_Length(pattern, pattern__len) - 1); } diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index 3271c367..e84157d1 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -234,12 +234,10 @@ export void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGIN static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len) { - Texts_FontsFont _o_result; Texts_FontsFont F = NIL; __NEW(F, Texts_FontDesc); __COPY(name, F->name, 32); - _o_result = F; - return _o_result; + return F; } static void Texts_Find (Texts_Text T, int32 *pos, Texts_Run *u, int32 *org, int32 *off) @@ -338,22 +336,18 @@ static void Texts_Splice (Texts_Run un, Texts_Run v, Texts_Run w, Texts_Text bas static Texts_Piece Texts_ClonePiece (Texts_Piece p) { - Texts_Piece _o_result; Texts_Piece q = NIL; __NEW(q, Texts_PieceDesc); __GUARDEQP(q, Texts_PieceDesc) = *p; - _o_result = q; - return _o_result; + return q; } static Texts_Elem Texts_CloneElem (Texts_Elem e) { - Texts_Elem _o_result; Texts_CopyMsg msg; msg.e = NIL; (*e->handle)(e, (void*)&msg, Texts_CopyMsg__typ); - _o_result = msg.e; - return _o_result; + return msg.e; } void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE) @@ -369,14 +363,11 @@ void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE) Texts_Text Texts_ElemBase (Texts_Elem E) { - Texts_Text _o_result; - _o_result = E->base; - return _o_result; + return E->base; } int32 Texts_ElemPos (Texts_Elem E) { - int32 _o_result; Texts_Run u = NIL; int32 pos; u = E->base->head->next; @@ -385,8 +376,7 @@ int32 Texts_ElemPos (Texts_Elem E) pos = pos + u->len; u = u->next; } - _o_result = pos; - return _o_result; + return pos; } static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, address *msg__typ) @@ -716,9 +706,7 @@ void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ) int32 Texts_Pos (Texts_Reader *R, address *R__typ) { - int32 _o_result; - _o_result = (*R).org + (*R).off; - return _o_result; + return (*R).org + (*R).off; } void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int32 pos) diff --git a/src/compiler/OPM.Mod b/src/compiler/OPM.Mod index e17c4614..c0abf4e3 100644 --- a/src/compiler/OPM.Mod +++ b/src/compiler/OPM.Mod @@ -275,7 +275,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) LogWStr(" Target machine address size and alignment (default is that of the running compiler binary)"); LogWLn; LogWStr(" -A44 32 bit addresses, 32 bit alignment (e.g. Unix/linux 32 bit on x86)."); LogWLn; LogWStr(" -A48 32 bit addresses, 64 bit alignment (e.g. Windows 32 bit on x86, linux 32 bit on arm)."); LogWLn; - LogWStr(" -A88 66 bit addresses, 64 bit alignment (e.g. 64 bit platforms)."); LogWLn; + LogWStr(" -A88 64 bit addresses, 64 bit alignment (e.g. 64 bit platforms)."); LogWLn; LogWLn; LogWStr("All options are off by default, except where noted above."); LogWLn; LogWStr("Initial options specify defaults for all files."); LogWLn; diff --git a/src/tools/make/sourcechanges.sh b/src/tools/make/sourcechanges.sh index 08aa873b..53f7843e 100644 --- a/src/tools/make/sourcechanges.sh +++ b/src/tools/make/sourcechanges.sh @@ -14,8 +14,8 @@ changes="0" for f in $1/*; do fn=$(basename $f) - egrep -v "(^/\* voc +)|Configuration_|__MOVE.* cmd, |OPM_(IntSize|PointerSize|Alignment) =|Strings_Append.+void\*\)(cmd|OPM_OBERON|extTools_comp)" $f >$fn.old - egrep -v "(^/\* voc +)|Configuration_|__MOVE.* cmd, |OPM_(IntSize|PointerSize|Alignment) =|Strings_Append.+void\*\)(cmd|OPM_OBERON|extTools_comp)" $fn >$fn.new + egrep -v "(^/\* voc +)|Configuration_|OPM_ResourceDir|__MOVE.* cmd, |OPM_(IntSize|PointerSize|Alignment) =|Strings_Append.+void\*\)(cmd|OPM_OBERON|extTools_comp)" $f >$fn.old + egrep -v "(^/\* voc +)|Configuration_|OPM_ResourceDir|__MOVE.* cmd, |OPM_(IntSize|PointerSize|Alignment) =|Strings_Append.+void\*\)(cmd|OPM_OBERON|extTools_comp)" $fn >$fn.new if ! diff -U 2 -b $fn.old $fn.new >$fn.diff; then echo "" echo "" From 03556336ce3f987da6d1edab0b1848200d5966fe Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 28 Oct 2016 21:00:07 +0100 Subject: [PATCH 298/580] Restore result variable just for issue #40 using same fix as J. Templ. --- bootstrap/unix-44/OPC.c | 12 ++++++++++++ bootstrap/unix-44/OPC.h | 1 + bootstrap/unix-44/OPV.c | 14 ++++++++++++++ bootstrap/unix-44/Strings.c | 5 ++++- bootstrap/unix-48/OPC.c | 12 ++++++++++++ bootstrap/unix-48/OPC.h | 1 + bootstrap/unix-48/OPV.c | 14 ++++++++++++++ bootstrap/unix-48/Strings.c | 5 ++++- bootstrap/unix-88/OPC.c | 12 ++++++++++++ bootstrap/unix-88/OPC.h | 1 + bootstrap/unix-88/OPV.c | 14 ++++++++++++++ bootstrap/unix-88/Strings.c | 5 ++++- bootstrap/windows-48/OPC.c | 12 ++++++++++++ bootstrap/windows-48/OPC.h | 1 + bootstrap/windows-48/OPV.c | 14 ++++++++++++++ bootstrap/windows-48/Strings.c | 5 ++++- bootstrap/windows-88/OPC.c | 12 ++++++++++++ bootstrap/windows-88/OPC.h | 1 + bootstrap/windows-88/OPV.c | 14 ++++++++++++++ bootstrap/windows-88/Strings.c | 5 ++++- src/compiler/OPC.Mod | 6 ++++++ src/compiler/OPV.Mod | 10 ++++++++++ 22 files changed, 171 insertions(+), 5 deletions(-) diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 9401b9a7..27ab3d15 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -69,6 +69,7 @@ export void OPC_IntLiteral (int64 n, int32 size); export void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim); static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName); static int16 OPC_Length (CHAR *s, LONGINT s__len); +export BOOLEAN OPC_NeedsRetval (OPT_Object proc); export int32 OPC_NofPtrs (OPT_Struct typ); static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len); static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len); @@ -1428,6 +1429,11 @@ void OPC_DefineInter (OPT_Object proc) OPM_WriteLn(); } +BOOLEAN OPC_NeedsRetval (OPT_Object proc) +{ + return (proc->typ != OPT_notyp && !proc->scope->leaf); +} + void OPC_EnterProc (OPT_Object proc) { OPT_Object var = NIL, scope = NIL; @@ -1448,6 +1454,12 @@ void OPC_EnterProc (OPT_Object proc) OPM_WriteString((CHAR*)"_s", 3); OPC_EndStat(); } + if (OPC_NeedsRetval(proc)) { + OPC_BegStat(); + OPC_Ident(proc->typ->strobj); + OPM_WriteString((CHAR*)" __retval", 10); + OPC_EndStat(); + } var = proc->link; while (var != NIL) { if ((var->typ->comp == 2 && var->mode == 1)) { diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index c09a1524..bbfd1911 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -37,6 +37,7 @@ import void OPC_Init (void); import void OPC_InitTDesc (OPT_Struct typ); import void OPC_IntLiteral (int64 n, int32 size); import void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim); +import BOOLEAN OPC_NeedsRetval (OPT_Object proc); import int32 OPC_NofPtrs (OPT_Struct typ); import void OPC_SetInclude (BOOLEAN exclude); import void OPC_TDescDecl (OPT_Struct typ); diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index 787ce143..f44318ed 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1490,6 +1490,20 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) } else { OPM_WriteString((CHAR*)"__ENDMOD", 9); } + } else if (OPC_NeedsRetval(outerProc)) { + OPM_WriteString((CHAR*)"__retval = ", 12); + if ((n->left->typ->form == 11 && n->obj->typ != n->left->typ)) { + OPM_WriteString((CHAR*)"(void*)", 8); + OPV_expr(n->left, 10); + } else { + OPV_expr(n->left, -1); + } + OPC_EndStat(); + OPC_BegStat(); + OPC_ExitProc(outerProc, 0, 0); + OPC_EndStat(); + OPC_BegStat(); + OPM_WriteString((CHAR*)"return __retval", 16); } else { OPC_ExitProc(outerProc, 0, 0); OPM_WriteString((CHAR*)"return", 7); diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index 000c09c8..104a0fb7 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -223,14 +223,17 @@ static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__le BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len) { struct Match__7 _s; + BOOLEAN __retval; __DUP(string, string__len, CHAR); __DUP(pattern, pattern__len, CHAR); _s.lnk = Match__7_s; Match__7_s = &_s; + __retval = M__8((void*)string, string__len, (void*)pattern, pattern__len, Strings_Length(string, string__len) - 1, Strings_Length(pattern, pattern__len) - 1); Match__7_s = _s.lnk; __DEL(string); __DEL(pattern); - return M__8((void*)string, string__len, (void*)pattern, pattern__len, Strings_Length(string, string__len) - 1, Strings_Length(pattern, pattern__len) - 1); + ; + return __retval; } diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 9401b9a7..27ab3d15 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -69,6 +69,7 @@ export void OPC_IntLiteral (int64 n, int32 size); export void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim); static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName); static int16 OPC_Length (CHAR *s, LONGINT s__len); +export BOOLEAN OPC_NeedsRetval (OPT_Object proc); export int32 OPC_NofPtrs (OPT_Struct typ); static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len); static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len); @@ -1428,6 +1429,11 @@ void OPC_DefineInter (OPT_Object proc) OPM_WriteLn(); } +BOOLEAN OPC_NeedsRetval (OPT_Object proc) +{ + return (proc->typ != OPT_notyp && !proc->scope->leaf); +} + void OPC_EnterProc (OPT_Object proc) { OPT_Object var = NIL, scope = NIL; @@ -1448,6 +1454,12 @@ void OPC_EnterProc (OPT_Object proc) OPM_WriteString((CHAR*)"_s", 3); OPC_EndStat(); } + if (OPC_NeedsRetval(proc)) { + OPC_BegStat(); + OPC_Ident(proc->typ->strobj); + OPM_WriteString((CHAR*)" __retval", 10); + OPC_EndStat(); + } var = proc->link; while (var != NIL) { if ((var->typ->comp == 2 && var->mode == 1)) { diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index c09a1524..bbfd1911 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -37,6 +37,7 @@ import void OPC_Init (void); import void OPC_InitTDesc (OPT_Struct typ); import void OPC_IntLiteral (int64 n, int32 size); import void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim); +import BOOLEAN OPC_NeedsRetval (OPT_Object proc); import int32 OPC_NofPtrs (OPT_Struct typ); import void OPC_SetInclude (BOOLEAN exclude); import void OPC_TDescDecl (OPT_Struct typ); diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index 787ce143..f44318ed 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1490,6 +1490,20 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) } else { OPM_WriteString((CHAR*)"__ENDMOD", 9); } + } else if (OPC_NeedsRetval(outerProc)) { + OPM_WriteString((CHAR*)"__retval = ", 12); + if ((n->left->typ->form == 11 && n->obj->typ != n->left->typ)) { + OPM_WriteString((CHAR*)"(void*)", 8); + OPV_expr(n->left, 10); + } else { + OPV_expr(n->left, -1); + } + OPC_EndStat(); + OPC_BegStat(); + OPC_ExitProc(outerProc, 0, 0); + OPC_EndStat(); + OPC_BegStat(); + OPM_WriteString((CHAR*)"return __retval", 16); } else { OPC_ExitProc(outerProc, 0, 0); OPM_WriteString((CHAR*)"return", 7); diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index 000c09c8..104a0fb7 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -223,14 +223,17 @@ static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__le BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len) { struct Match__7 _s; + BOOLEAN __retval; __DUP(string, string__len, CHAR); __DUP(pattern, pattern__len, CHAR); _s.lnk = Match__7_s; Match__7_s = &_s; + __retval = M__8((void*)string, string__len, (void*)pattern, pattern__len, Strings_Length(string, string__len) - 1, Strings_Length(pattern, pattern__len) - 1); Match__7_s = _s.lnk; __DEL(string); __DEL(pattern); - return M__8((void*)string, string__len, (void*)pattern, pattern__len, Strings_Length(string, string__len) - 1, Strings_Length(pattern, pattern__len) - 1); + ; + return __retval; } diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index 9401b9a7..27ab3d15 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -69,6 +69,7 @@ export void OPC_IntLiteral (int64 n, int32 size); export void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim); static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName); static int16 OPC_Length (CHAR *s, LONGINT s__len); +export BOOLEAN OPC_NeedsRetval (OPT_Object proc); export int32 OPC_NofPtrs (OPT_Struct typ); static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len); static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len); @@ -1428,6 +1429,11 @@ void OPC_DefineInter (OPT_Object proc) OPM_WriteLn(); } +BOOLEAN OPC_NeedsRetval (OPT_Object proc) +{ + return (proc->typ != OPT_notyp && !proc->scope->leaf); +} + void OPC_EnterProc (OPT_Object proc) { OPT_Object var = NIL, scope = NIL; @@ -1448,6 +1454,12 @@ void OPC_EnterProc (OPT_Object proc) OPM_WriteString((CHAR*)"_s", 3); OPC_EndStat(); } + if (OPC_NeedsRetval(proc)) { + OPC_BegStat(); + OPC_Ident(proc->typ->strobj); + OPM_WriteString((CHAR*)" __retval", 10); + OPC_EndStat(); + } var = proc->link; while (var != NIL) { if ((var->typ->comp == 2 && var->mode == 1)) { diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index c09a1524..bbfd1911 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -37,6 +37,7 @@ import void OPC_Init (void); import void OPC_InitTDesc (OPT_Struct typ); import void OPC_IntLiteral (int64 n, int32 size); import void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim); +import BOOLEAN OPC_NeedsRetval (OPT_Object proc); import int32 OPC_NofPtrs (OPT_Struct typ); import void OPC_SetInclude (BOOLEAN exclude); import void OPC_TDescDecl (OPT_Struct typ); diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index c7a907db..452a1182 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1490,6 +1490,20 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) } else { OPM_WriteString((CHAR*)"__ENDMOD", 9); } + } else if (OPC_NeedsRetval(outerProc)) { + OPM_WriteString((CHAR*)"__retval = ", 12); + if ((n->left->typ->form == 11 && n->obj->typ != n->left->typ)) { + OPM_WriteString((CHAR*)"(void*)", 8); + OPV_expr(n->left, 10); + } else { + OPV_expr(n->left, -1); + } + OPC_EndStat(); + OPC_BegStat(); + OPC_ExitProc(outerProc, 0, 0); + OPC_EndStat(); + OPC_BegStat(); + OPM_WriteString((CHAR*)"return __retval", 16); } else { OPC_ExitProc(outerProc, 0, 0); OPM_WriteString((CHAR*)"return", 7); diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index 000c09c8..104a0fb7 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -223,14 +223,17 @@ static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__le BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len) { struct Match__7 _s; + BOOLEAN __retval; __DUP(string, string__len, CHAR); __DUP(pattern, pattern__len, CHAR); _s.lnk = Match__7_s; Match__7_s = &_s; + __retval = M__8((void*)string, string__len, (void*)pattern, pattern__len, Strings_Length(string, string__len) - 1, Strings_Length(pattern, pattern__len) - 1); Match__7_s = _s.lnk; __DEL(string); __DEL(pattern); - return M__8((void*)string, string__len, (void*)pattern, pattern__len, Strings_Length(string, string__len) - 1, Strings_Length(pattern, pattern__len) - 1); + ; + return __retval; } diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 9401b9a7..27ab3d15 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -69,6 +69,7 @@ export void OPC_IntLiteral (int64 n, int32 size); export void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim); static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName); static int16 OPC_Length (CHAR *s, LONGINT s__len); +export BOOLEAN OPC_NeedsRetval (OPT_Object proc); export int32 OPC_NofPtrs (OPT_Struct typ); static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len); static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len); @@ -1428,6 +1429,11 @@ void OPC_DefineInter (OPT_Object proc) OPM_WriteLn(); } +BOOLEAN OPC_NeedsRetval (OPT_Object proc) +{ + return (proc->typ != OPT_notyp && !proc->scope->leaf); +} + void OPC_EnterProc (OPT_Object proc) { OPT_Object var = NIL, scope = NIL; @@ -1448,6 +1454,12 @@ void OPC_EnterProc (OPT_Object proc) OPM_WriteString((CHAR*)"_s", 3); OPC_EndStat(); } + if (OPC_NeedsRetval(proc)) { + OPC_BegStat(); + OPC_Ident(proc->typ->strobj); + OPM_WriteString((CHAR*)" __retval", 10); + OPC_EndStat(); + } var = proc->link; while (var != NIL) { if ((var->typ->comp == 2 && var->mode == 1)) { diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index c09a1524..bbfd1911 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -37,6 +37,7 @@ import void OPC_Init (void); import void OPC_InitTDesc (OPT_Struct typ); import void OPC_IntLiteral (int64 n, int32 size); import void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim); +import BOOLEAN OPC_NeedsRetval (OPT_Object proc); import int32 OPC_NofPtrs (OPT_Struct typ); import void OPC_SetInclude (BOOLEAN exclude); import void OPC_TDescDecl (OPT_Struct typ); diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index 787ce143..f44318ed 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1490,6 +1490,20 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) } else { OPM_WriteString((CHAR*)"__ENDMOD", 9); } + } else if (OPC_NeedsRetval(outerProc)) { + OPM_WriteString((CHAR*)"__retval = ", 12); + if ((n->left->typ->form == 11 && n->obj->typ != n->left->typ)) { + OPM_WriteString((CHAR*)"(void*)", 8); + OPV_expr(n->left, 10); + } else { + OPV_expr(n->left, -1); + } + OPC_EndStat(); + OPC_BegStat(); + OPC_ExitProc(outerProc, 0, 0); + OPC_EndStat(); + OPC_BegStat(); + OPM_WriteString((CHAR*)"return __retval", 16); } else { OPC_ExitProc(outerProc, 0, 0); OPM_WriteString((CHAR*)"return", 7); diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index 000c09c8..104a0fb7 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -223,14 +223,17 @@ static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__le BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len) { struct Match__7 _s; + BOOLEAN __retval; __DUP(string, string__len, CHAR); __DUP(pattern, pattern__len, CHAR); _s.lnk = Match__7_s; Match__7_s = &_s; + __retval = M__8((void*)string, string__len, (void*)pattern, pattern__len, Strings_Length(string, string__len) - 1, Strings_Length(pattern, pattern__len) - 1); Match__7_s = _s.lnk; __DEL(string); __DEL(pattern); - return M__8((void*)string, string__len, (void*)pattern, pattern__len, Strings_Length(string, string__len) - 1, Strings_Length(pattern, pattern__len) - 1); + ; + return __retval; } diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index 9401b9a7..27ab3d15 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -69,6 +69,7 @@ export void OPC_IntLiteral (int64 n, int32 size); export void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim); static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName); static int16 OPC_Length (CHAR *s, LONGINT s__len); +export BOOLEAN OPC_NeedsRetval (OPT_Object proc); export int32 OPC_NofPtrs (OPT_Struct typ); static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len); static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len); @@ -1428,6 +1429,11 @@ void OPC_DefineInter (OPT_Object proc) OPM_WriteLn(); } +BOOLEAN OPC_NeedsRetval (OPT_Object proc) +{ + return (proc->typ != OPT_notyp && !proc->scope->leaf); +} + void OPC_EnterProc (OPT_Object proc) { OPT_Object var = NIL, scope = NIL; @@ -1448,6 +1454,12 @@ void OPC_EnterProc (OPT_Object proc) OPM_WriteString((CHAR*)"_s", 3); OPC_EndStat(); } + if (OPC_NeedsRetval(proc)) { + OPC_BegStat(); + OPC_Ident(proc->typ->strobj); + OPM_WriteString((CHAR*)" __retval", 10); + OPC_EndStat(); + } var = proc->link; while (var != NIL) { if ((var->typ->comp == 2 && var->mode == 1)) { diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index c09a1524..bbfd1911 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -37,6 +37,7 @@ import void OPC_Init (void); import void OPC_InitTDesc (OPT_Struct typ); import void OPC_IntLiteral (int64 n, int32 size); import void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim); +import BOOLEAN OPC_NeedsRetval (OPT_Object proc); import int32 OPC_NofPtrs (OPT_Struct typ); import void OPC_SetInclude (BOOLEAN exclude); import void OPC_TDescDecl (OPT_Struct typ); diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index c7a907db..452a1182 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1490,6 +1490,20 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) } else { OPM_WriteString((CHAR*)"__ENDMOD", 9); } + } else if (OPC_NeedsRetval(outerProc)) { + OPM_WriteString((CHAR*)"__retval = ", 12); + if ((n->left->typ->form == 11 && n->obj->typ != n->left->typ)) { + OPM_WriteString((CHAR*)"(void*)", 8); + OPV_expr(n->left, 10); + } else { + OPV_expr(n->left, -1); + } + OPC_EndStat(); + OPC_BegStat(); + OPC_ExitProc(outerProc, 0, 0); + OPC_EndStat(); + OPC_BegStat(); + OPM_WriteString((CHAR*)"return __retval", 16); } else { OPC_ExitProc(outerProc, 0, 0); OPM_WriteString((CHAR*)"return", 7); diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index 000c09c8..104a0fb7 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -223,14 +223,17 @@ static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__le BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len) { struct Match__7 _s; + BOOLEAN __retval; __DUP(string, string__len, CHAR); __DUP(pattern, pattern__len, CHAR); _s.lnk = Match__7_s; Match__7_s = &_s; + __retval = M__8((void*)string, string__len, (void*)pattern, pattern__len, Strings_Length(string, string__len) - 1, Strings_Length(pattern, pattern__len) - 1); Match__7_s = _s.lnk; __DEL(string); __DEL(pattern); - return M__8((void*)string, string__len, (void*)pattern, pattern__len, Strings_Length(string, string__len) - 1, Strings_Length(pattern, pattern__len) - 1); + ; + return __retval; } diff --git a/src/compiler/OPC.Mod b/src/compiler/OPC.Mod index d30cb712..ba59ef22 100644 --- a/src/compiler/OPC.Mod +++ b/src/compiler/OPC.Mod @@ -950,6 +950,11 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) OPM.WriteLn; END DefineInter; + PROCEDURE NeedsRetval*(proc: OPT.Object): BOOLEAN; (* aux. variable __retval needed for return *) + BEGIN (* simple rule; ignores DUPlicated value arrays because they use alloca. *) + RETURN (proc^.typ # OPT.notyp) & ~proc^.scope^.leaf + END NeedsRetval; + PROCEDURE EnterProc* (proc: OPT.Object); VAR var, scope: OPT.Object; typ: OPT.Struct; dim: INTEGER; BEGIN @@ -962,6 +967,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) BegStat; OPM.WriteString('struct '); OPM.WriteStringVar (scope^.name); OPM.Write(' '); OPM.WriteString(LocalScope); EndStat END ; + IF NeedsRetval(proc) THEN BegStat; Ident(proc^.typ^.strobj); OPM.WriteString(" __retval"); EndStat END; var := proc^.link; WHILE var # NIL DO (* declare copy of fixed size value array parameters *) IF (var^.typ^.comp = OPT.Array) & (var^.mode = OPT.Var) THEN diff --git a/src/compiler/OPV.Mod b/src/compiler/OPV.Mod index 83c451c3..cc3c93ef 100644 --- a/src/compiler/OPV.Mod +++ b/src/compiler/OPV.Mod @@ -875,6 +875,16 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 END | OPT.Nreturn: IF OPM.level = 0 THEN IF OPM.mainprog IN OPM.Options THEN OPM.WriteString("__FINI") ELSE OPM.WriteString("__ENDMOD") END + ELSIF OPC.NeedsRetval(outerProc) THEN + OPM.WriteString("__retval = "); + IF (n^.left^.typ^.form = OPT.Pointer) & (n^.obj^.typ # n^.left^.typ) THEN + OPM.WriteString("(void*)"); expr(n^.left, 10) + ELSE + expr(n^.left, MinPrec) + END ; + OPC.EndStat; + OPC.BegStat; OPC.ExitProc(outerProc, FALSE, FALSE); OPC.EndStat; + OPC.BegStat; OPM.WriteString("return __retval"); ELSE OPC.ExitProc(outerProc, FALSE, FALSE); OPM.WriteString("return"); From 2a242ae9608385ed77b0c6be9ece1728d7b74f6d Mon Sep 17 00:00:00 2001 From: David Brown Date: Sun, 30 Oct 2016 14:22:10 +0000 Subject: [PATCH 299/580] Add Oakwood 'In' module and a test for it. --- .gitignore | 1 + src/runtime/In.Mod | 175 +++++++++++++++++------------- src/runtime/Out.Mod | 2 +- src/test/confidence/in/expected | 14 +++ src/test/confidence/in/intest.mod | 16 +++ src/test/confidence/in/test.sh | 16 +++ src/tools/make/oberon.mk | 6 +- 7 files changed, 151 insertions(+), 79 deletions(-) create mode 100644 src/test/confidence/in/expected create mode 100644 src/test/confidence/in/intest.mod create mode 100644 src/test/confidence/in/test.sh diff --git a/.gitignore b/.gitignore index db4032e0..a8e5ff00 100644 --- a/.gitignore +++ b/.gitignore @@ -18,6 +18,7 @@ /src/test/**/*.obj /src/test/**/*.sym **/*.stackdump +/src/test/confidence/**/input /src/test/confidence/**/result /src/test/confidence/**/result-* /src/test/confidence/**/*.asm diff --git a/src/runtime/In.Mod b/src/runtime/In.Mod index aa67e4e7..873a00d9 100644 --- a/src/runtime/In.Mod +++ b/src/runtime/In.Mod @@ -3,113 +3,136 @@ MODULE In; IMPORT Platform, SYSTEM, Out; VAR - nextch: CHAR; - ready: BOOLEAN; - initialized: BOOLEAN; + Done-: BOOLEAN; + nextch: CHAR; (* Maintains 1 character read ahaead except at end of line. *) + readstate: INTEGER; - Done-: BOOLEAN; - -PROCEDURE ReadChar; -VAR error: Platform.ErrorCode; n: LONGINT; ch: CHAR; -BEGIN - error := Platform.ReadBuf(Platform.StdIn, ch, n); - ready := (error = 0) & (n = 1); - IF ready & (nextch = 0DX) & (ch = 0AX) THEN - ready := (error = 0) & (n = 1) - END; - IF ready THEN nextch := ch ELSE nextch := 0X END -END ReadChar; - -PROCEDURE Flush; -BEGIN Out.Flush; IF ~initialized THEN ReadChar END; initialized := TRUE -END Flush; +CONST + pending = 0; (* readstate when at start of input or end of line. Implies nextch undefined. *) + ready = 1; (* readstate when nextch is defined and contains next character on current line. *) + eof = 2; (* readstate when at end of file. *) PROCEDURE Open*; - VAR error: Platform.ErrorCode; +VAR error: Platform.ErrorCode; BEGIN - error := Platform.Seek(Platform.StdIn, 0, Platform.SeekSet); (* Rewind STDIN to beginning of file. *) - ready := TRUE; initialized := FALSE; + error := Platform.Seek(Platform.StdIn, 0, Platform.SeekSet); (* Rewind STDIN to beginning of file. *) + readstate := pending; + Done := TRUE; END Open; -PROCEDURE Char*(VAR ch: CHAR); -BEGIN Flush; - Done := ready; - IF ready THEN ch := nextch; ReadChar ELSE ch := 0X END -END Char; - -PROCEDURE Skip; +PROCEDURE ReadChar; +VAR error: Platform.ErrorCode; n: LONGINT; BEGIN - WHILE ready & (nextch <= " ") DO ReadChar END; (* Skip leading blanks, CR, LF, tab etc. *) -END Skip; + error := Platform.ReadBuf(Platform.StdIn, nextch, n); + IF (error = 0) & (n = 1) THEN readstate := ready ELSE readstate := eof END +END ReadChar; + +PROCEDURE StartRead; (* Ensure either nextch is valid or we're at EOF. *) +BEGIN Out.Flush; IF readstate = pending THEN ReadChar END; +END StartRead; + +PROCEDURE StartAndSkip; (* Like StartRead, but also skip over blanks, CR, LF, tab. *) +BEGIN StartRead; + WHILE (readstate = ready) & (nextch <= " ") DO ReadChar END +END StartAndSkip; + +PROCEDURE Char*(VAR ch: CHAR); +BEGIN + StartRead; + Done := readstate = ready; + IF Done THEN + ch := nextch; + IF ch = 0AX THEN readstate := pending ELSE ReadChar END + ELSE + ch := 0X + END +END Char; PROCEDURE HugeInt*(VAR h: HUGEINT); VAR - neg, hex, decdigit, hexdigit: BOOLEAN; + neg, hex, endofnum: BOOLEAN; decacc, hexacc, digit: HUGEINT; BEGIN - Flush; Skip; - - neg := nextch = '-'; IF neg THEN ReadChar END; - hex := FALSE; - endofnum := FALSE; - decacc := 0; - hexacc := 0; - Done := FALSE; - - WHILE ready & ~endofnum DO - decdigit := (nextch >= "0") & (nextch <= "9"); - IF decdigit THEN digit := ORD(nextch) MOD 16 END; - - hexdigit := (nextch >= "f") & (nextch <= "f") OR (nextch >= "A") & (nextch <= "F"); - IF hexdigit THEN ORD(nextch) MOD 16 + 9; hex := TRUE END; - - IF decdigit OR hexdigit THEN - Done := TRUE; - decacc := decacc * 10 + digit; - hexacc := hexacc * 16 + digit; - ReadChar - ELSIF nextch = "H" THEN - hex := TRUE; endofnum := TRUE; ReadChar + StartAndSkip; + Done := FALSE; + IF readstate = ready THEN + neg := nextch = '-'; IF neg THEN ReadChar END; + hex := FALSE; + endofnum := FALSE; + decacc := 0; + hexacc := 0; + WHILE (readstate = ready) & ~endofnum DO + digit := -1; + IF (nextch >= "0") & (nextch <= "9") THEN + digit := ORD(nextch) MOD 16 + ELSIF (nextch >= "a") & (nextch <= "f") + OR (nextch >= "A") & (nextch <= "F") THEN + digit := ORD(nextch) MOD 16 + 9; hex := TRUE + END; + IF digit >= 0 THEN + Done := TRUE; + decacc := decacc * 10 + digit; + hexacc := hexacc * 16 + digit; + ReadChar + ELSIF nextch = "H" THEN + hex := TRUE; endofnum := TRUE; ReadChar + ELSE + endofnum := TRUE + END + END; + IF Done THEN + IF hex THEN h := hexacc ELSE h := decacc END; + IF neg THEN h := -h END ELSE - endofnum := TRUE + h := 0 END - END; - IF Done THEN - IF hex THEN h := hexacc ELSE h := decacc END; - IF neg THEN h := -h END - ELSE - h := 0 END END HugeInt; PROCEDURE Int*(VAR i: INTEGER); - VAR h: HUGEINT; +VAR h: HUGEINT; BEGIN HugeInt(h); i := SYSTEM.VAL(INTEGER, h) END Int; PROCEDURE LongInt*(VAR i: LONGINT); - VAR h: HUGEINT; +VAR h: HUGEINT; BEGIN HugeInt(h); i := SYSTEM.VAL(LONGINT, h) END LongInt; PROCEDURE Real*(VAR x: REAL); -BEGIN ASSERT(FALSE) (* Not implemented *) +BEGIN HALT(99) (* Not implemented *) END Real; PROCEDURE LongReal*(VAR y: LONGREAL); -BEGIN ASSERT(FALSE) (* Not implemented *) +BEGIN HALT(99) (* Not implemented *) END LongReal; +PROCEDURE Line*(VAR line: ARRAY OF CHAR); +VAR i: INTEGER; +BEGIN StartRead; i := 0; Done := readstate = ready; + WHILE (readstate = ready) & (nextch # 0DX) & (nextch # 0AX) & (i < LEN(line)-1) DO + line[i] := nextch; INC(i); ReadChar + END; + line[i] := 0X; + IF (readstate = ready) & (nextch = 0DX) THEN ReadChar END; + IF (readstate = ready) & (nextch = 0AX) THEN readstate := pending END; +END Line; + PROCEDURE String*(VAR str: ARRAY OF CHAR); - VAR i: INTEGER; -BEGIN Flush; Skip; i := 0; - IF ready AND nextch = '"' THEN (* " *) +VAR i: INTEGER; +BEGIN StartAndSkip; i := 0; + IF (readstate = ready) & (nextch = '"') THEN (* " *) ReadChar; - WHILE ready & (i < LEN(str)-1) & (nextch >= " ") & (nextch # '"') DO (* " *) - str[i] := nextch; INC(i) + WHILE (readstate = ready) + & (i < LEN(str)-1) + & (nextch >= " ") + & (nextch # '"') DO (* " *) + str[i] := nextch; ReadChar; INC(i) END END; - Done := ready & (i < LEN(str)-1) & (nextch = '"'); (* " *) + Done := (readstate = ready) + & (i < LEN(str)-1) + & (nextch = '"'); (* " *) IF Done THEN ReadChar; str[i] := 0X ELSE @@ -118,11 +141,11 @@ BEGIN Flush; Skip; i := 0; END String; PROCEDURE Name*(VAR name: ARRAY OF CHAR); (* Read filename. Presumably using shell semantics. *) -BEGIN ASSERT(FALSE) (* Not implemented *) +BEGIN HALT(99) (* Not implemented *) END Name; BEGIN - nextch := 0X; - ready := FALSE; - initialized := FALSE; + nextch := 0X; + readstate := pending; + Done := TRUE; END In. diff --git a/src/runtime/Out.Mod b/src/runtime/Out.Mod index 52157484..c6429527 100644 --- a/src/runtime/Out.Mod +++ b/src/runtime/Out.Mod @@ -97,7 +97,7 @@ PROCEDURE -Entier64(x: LONGREAL): SYSTEM.INT64 "(int64)(x)"; PROCEDURE RealP(x: LONGREAL; n: INTEGER; long: BOOLEAN); -(* LongReal(x, n) writes the long real number x to the end of the output stream using an +(* RealP(x, n) writes the long real number x to the end of the output stream using an exponential form. If the textual representation of x requires m characters (including a three-digit signed exponent), x is right adjusted in a ï¬eld of Max(n, m) characters padded with blanks at the left end. A plus sign of the mantissa is not written. diff --git a/src/test/confidence/in/expected b/src/test/confidence/in/expected new file mode 100644 index 00000000..df0db21e --- /dev/null +++ b/src/test/confidence/in/expected @@ -0,0 +1,14 @@ +--- Testing with Oberon 2 variable model --- +chars: Splurdle +integer: 37 +string: "Bert" +line: rest of line +line: another line + + +--- Testing with Component Pascal variable model --- +chars: Splurdle +integer: 37 +string: "Bert" +line: rest of line +line: another line diff --git a/src/test/confidence/in/intest.mod b/src/test/confidence/in/intest.mod new file mode 100644 index 00000000..cb8d2963 --- /dev/null +++ b/src/test/confidence/in/intest.mod @@ -0,0 +1,16 @@ +MODULE intest; +IMPORT Out, In; + +VAR ch: CHAR; i: INTEGER; s: ARRAY 100 OF CHAR; + +BEGIN + In.Char(ch); Out.String("chars: "); + WHILE In.Done & (ch # ".") DO Out.Char(ch); In.Char(ch) END; + Out.Ln; + In.Int(i); IF In.Done THEN Out.String("integer: "); Out.Int(i,1); Out.Ln END; + In.String(s); IF In.Done THEN Out.String('string: "'); Out.String(s); Out.String('"'); Out.Ln END; + In.Line(s); + WHILE In.Done DO + Out.String("line: "); Out.String(s); Out.Ln; In.Line(s) + END +END intest. diff --git a/src/test/confidence/in/test.sh b/src/test/confidence/in/test.sh new file mode 100644 index 00000000..ee738ab4 --- /dev/null +++ b/src/test/confidence/in/test.sh @@ -0,0 +1,16 @@ +#!/bin/sh +. ../testenv.sh +rm -f intest # Remove LSW binary so it doesn't hide Cygwin binary. +echo 'Splurdle.25H "Bert"rest of line'>input +echo another line>>input +$OBECOMP intest.mod -m -O2 +./intest result-O2 +$OBECOMP intest.mod -m -OC +./intest result-OC +echo --- Testing with Oberon 2 variable model --- >result +cat result-O2 >>result +echo "" >>result +echo "" >>result +echo --- Testing with Component Pascal variable model --- >>result +cat result-OC >>result +. ../testresult.sh diff --git a/src/tools/make/oberon.mk b/src/tools/make/oberon.mk index ffdbded1..c67dfe10 100644 --- a/src/tools/make/oberon.mk +++ b/src/tools/make/oberon.mk @@ -197,6 +197,7 @@ runtime: cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Modules.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Strings.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Out.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/In.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/VT100.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Files.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Math.Mod @@ -382,14 +383,15 @@ RUNTEST = COMPILER=$(COMPILER) OBECOMP="$(OBECOMP) -O$(MODEL)" FLAVOUR=$(FLAVOUR confidence: @printf "\n\n--- Confidence tests ---\n\n" cd src/test/confidence/hello; $(RUNTEST) - cd src/test/confidence/isptest; $(RUNTEST) cd src/test/confidence/out; $(RUNTEST) + cd src/test/confidence/in; $(RUNTEST) cd src/test/confidence/math; $(RUNTEST) cd src/test/confidence/intsyntax; $(RUNTEST) cd src/test/confidence/language; $(RUNTEST) + cd src/test/confidence/arrayassignment; $(RUNTEST) cd src/test/confidence/texts; $(RUNTEST) cd src/test/confidence/library; $(RUNTEST) + cd src/test/confidence/isptest; $(RUNTEST) cd src/test/confidence/lola; $(RUNTEST) - cd src/test/confidence/arrayassignment; $(RUNTEST) if [ "$(PLATFORM)" != "windows" ] ; then cd src/test/confidence/signal; $(RUNTEST); fi @printf "\n\n--- Confidence tests passed ---\n\n" From 4f74364b59dcbdf59170563d14dc149dd08ab56b Mon Sep 17 00:00:00 2001 From: David Brown Date: Mon, 31 Oct 2016 11:47:51 +0000 Subject: [PATCH 300/580] Don't let expected differences between bootstrap and built compiler show as changes. Update Readme. --- ReadMe.md | 68 ++++++++++++++++++++------------- src/tools/make/ignore | 7 ++++ src/tools/make/sourcechanges.sh | 4 +- 3 files changed, 51 insertions(+), 28 deletions(-) create mode 100644 src/tools/make/ignore diff --git a/ReadMe.md b/ReadMe.md index be623b82..50d4d38e 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -63,7 +63,7 @@ Also see [Installation](/doc/Installation.md). ## A 'Hello' application -Anything appended to Oberon.Log is automatically displayed on the console, so the +Anything appended to Oberon.Log is automatically written to stdout, so the following conventional Oberon program will display 'Hello.': ```Modula-2 @@ -77,13 +77,13 @@ BEGIN END hello. ``` -Alternatively the Console may be accessed directly as follows: +Alternatively the Oakwood module Out can be used to write directly to stdout: ```Modula-2 MODULE hello; - IMPORT Console; + IMPORT Out; BEGIN - Console.String("Hello."); Console.Ln; + Out.String("Hello."); Out.Ln; END hello. ``` @@ -102,7 +102,7 @@ Also see [Compiling](/doc/Compiling.md). ## Licensing Vishap Oberon's frontend and C backend engine is a fork of Josef Templ’s Ofront, which has been released -under the FreeBSD License. Unlike Ofront, Vishap Oberon does not include the Oberon v4 environment. +under the FreeBSD License. Unlike Ofront, Vishap Oberon does not include the Oberon v4 GUI environment. The Ulm Oberon Library and the Ooc libraries are distributed under GPL. Proprietry code using these libraries may not be statically linked. @@ -138,20 +138,32 @@ For details, see [Porting](/doc/Porting.md). ## Language support and libraries -Vishap Oberon supports the Oberon 2 programming language, including type-bound procedures. +Vishap Oberon supports the Oberon 2 programming language, including type-bound procedures. SYSTEM.Mod includes additional functionality and some changes for 64 bit support. -It also supports some features of Oberon-07. +##### Integer and set type sizes: -Vishap Oberon comes with libraries easing the porting of code from the major -Oberon systems: +| Type | -O2 option (default) | -OC option | +| --- | --- | --- | +| SHORTINT | 8 bit | 16 bit | +| INTEGER | 16 bit | 32 bit | +| LONGINT | 32 bit | 64 bit | +| SET | 32 bit | 64 bit | + +##### Libraries + +Included libraries ease porting of code from the major Oberon systems: - Oberon V4 and S3 compatible library set. - - ooc (optimizing oberon-2 compiler) library port. - - Ulm’s Oberon system library port. + - Okwood standard libraries. + - Some other freely redistributable libraries. + +Oakwood libraries are supported for both -O2 and -OC options, whereas the ULM, OOC and ETH system 3 libraries are only available on -O2 (default) compilations. + + +Vishap Oberon also supports some features of Oberon-07. -Some other freely redistributable libraries are available as a part of voc distribution. See also [Features](/doc/Features.md). @@ -165,25 +177,20 @@ See [Roadmap](/doc/Roadmap.md). ## Contributors -Originally developed as a cross platform implementation of the -Oberon system by Joseph Templ. +Joseph Templ developed ofront as a tool to translate Oberon-2 programs into semantically equivalent +C programs. It was Copyrighted in 1995, and transferred to the Free BSD license in 2012. -Updated for 64 bit support, refactored as a standalone compiler and brought -to new platforms by Norayr Chilingarian. +From Joseph's github repository: -Build process simplified for more platform support and bugs fixed by David -C W Brown. +> Design and implementation of ofront is due to Josef Templ ... ofront has been based in part on Regis Crelier's PhD thesis and Stefan Gehring's diploma thesis, both at ETH Zurich, Institute for Computer Systems. + +Norayr Chilingarian forked ofront in 2013, porting extensive libraries from [ULM Oberon](http://www.mathematik.uni-ulm.de/oberon/), [OO2C](https://github.com/Spirit-of-Oberon/oo2c) and ETH Oberon System 3, and adding support for more platforms including 64 bit systems, and . + +David Brown has worked on adding support for more platforms incuding windows using MSC, cygwin or mingw since January 2016. More recently he has generalised basic type support within the compiler to allow e.g. 64 bit LONGINT on 32 bit systems, and 32 bit LONGINT on 64 bit systems. ## Origin of the name "Ñ´ishap Oberon" -###### Ñ´ishap - -Vishaps are dragons inhabiting the Armenian Highlands. -We decided to name the project “Vishap†because ties between compilers and dragons have ancient traditions. - -Also, Vishaps are known in tales, fiction. [This page](http://blog.fogus.me/2015/04/27/six-works-of-computer-science-fiction/) refers to some technologies as “computer science fictionâ€. Among them to Oberon. This brings another meaning, Oberon is like aliens, ghosts. And Vishaps. - -###### Oberon - System and Programming Language +###### Oberon Oberon is a programming language, an operating system and a graphical user interface. Originally designed and implemented by by Niklaus Wirth and @@ -202,6 +209,13 @@ of Einstein and Antoine de Saint-Exupéry: > when there is no longer anything to take away. (Antoine de Saint-Exupéry, > translated by Lewis Galantière.) +###### Ñ´ishap + +Vishaps are dragons inhabiting the Armenian Highlands. +We decided to name the project “Vishap†because ties between compilers and dragons have ancient traditions. + +Also, Vishaps are known in tales, fiction. [This page](http://blog.fogus.me/2015/04/27/six-works-of-computer-science-fiction/) refers to some technologies as “computer science fictionâ€. Among them to Oberon. This brings another meaning, Oberon is like aliens, ghosts. And Vishaps. + ## References ###### Oberon @@ -224,4 +238,6 @@ of Einstein and Antoine de Saint-Exupéry: ###### Links - [Niklaus Wirth's personal page at ETH Zurich](https://www.inf.ethz.ch/personal/wirth/) - [ETH Zurich's Wirth publications page](http://www.ethoberon.ethz.ch/WirthPubl/) + - [Joseph Templ's ofront on github](https://hithub.com/jtempl/ofront) + - [Software Templ OG](http://www.software-templ.com) - [Oberon: Steps beyond Pascal and Modula](http://fruttenboel.verhoeven272.nl/Oberon/) diff --git a/src/tools/make/ignore b/src/tools/make/ignore new file mode 100644 index 00000000..f25566d8 --- /dev/null +++ b/src/tools/make/ignore @@ -0,0 +1,7 @@ +^/\* voc + +Configuration_ +OPM_ResourceDir +__MOVE.* cmd, +OPM_(IntSize|PointerSize|Alignment) = +Strings_Append.+void\*\)(cmd|OPM_OBERON|extTools_comp) +__COPY\("(gcc|clang|msc|i686-w64-mingw \ No newline at end of file diff --git a/src/tools/make/sourcechanges.sh b/src/tools/make/sourcechanges.sh index 53f7843e..1439ce4e 100644 --- a/src/tools/make/sourcechanges.sh +++ b/src/tools/make/sourcechanges.sh @@ -14,8 +14,8 @@ changes="0" for f in $1/*; do fn=$(basename $f) - egrep -v "(^/\* voc +)|Configuration_|OPM_ResourceDir|__MOVE.* cmd, |OPM_(IntSize|PointerSize|Alignment) =|Strings_Append.+void\*\)(cmd|OPM_OBERON|extTools_comp)" $f >$fn.old - egrep -v "(^/\* voc +)|Configuration_|OPM_ResourceDir|__MOVE.* cmd, |OPM_(IntSize|PointerSize|Alignment) =|Strings_Append.+void\*\)(cmd|OPM_OBERON|extTools_comp)" $fn >$fn.new + egrep -v -f ../../src/tools/make/ignore $f >$fn.old + egrep -v -f ../../src/tools/make/ignore $fn >$fn.new if ! diff -U 2 -b $fn.old $fn.new >$fn.diff; then echo "" echo "" From 6a9861355fe868ff42eb1074efeef89227c57b84 Mon Sep 17 00:00:00 2001 From: David Brown Date: Mon, 31 Oct 2016 18:51:38 +0000 Subject: [PATCH 301/580] Update features documentation for -O2/-OC --- ReadMe.md | 26 ++--- doc/BasicTypeSize.md | 172 -------------------------------- doc/Features.md | 137 ++++++++++++++++++++++--- doc/Roadmap.md | 150 ---------------------------- src/compiler/OPT.Mod | 3 +- src/runtime/Platformwindows.Mod | 2 +- 6 files changed, 134 insertions(+), 356 deletions(-) delete mode 100644 doc/BasicTypeSize.md delete mode 100644 doc/Roadmap.md diff --git a/ReadMe.md b/ReadMe.md index 50d4d38e..7832f2ea 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -13,15 +13,15 @@ default libraries complying with the Oakwood Guidelines for Oberon-2 compilers. ###### Contents -> [Installation](#installation) -> [A 'Hello' application](#a-hello-application) -> [Licensing](#licensing) -> [Platform support and porting](#platform-support-and-porting) -> [Language support and libraries](#language-support-and-libraries) -> [History](#history) -> [Roadmap](#roadmap) -> [Contributors](#contributors) -> [Origin of the name "Ñ´ishap Oberon"](#origin-of-the-name-Ñ´ishap-oberon) +> [Installation](#installation) +> [A 'Hello' application](#a-hello-application) +> [Licensing](#licensing) +> [Platform support and porting](#platform-support-and-porting) +> [Language support and libraries](#language-support-and-libraries) +> [History](#history) +> [Roadmap](#roadmap) +> [Contributors](#contributors) +> [Origin of the name "Ñ´ishap Oberon"](#origin-of-the-name-Ñ´ishap-oberon) > [References](#references) @@ -171,16 +171,12 @@ See also [Features](/doc/Features.md). See [History](/doc/History.md). -## Roadmap - -See [Roadmap](/doc/Roadmap.md). - ## Contributors Joseph Templ developed ofront as a tool to translate Oberon-2 programs into semantically equivalent -C programs. It was Copyrighted in 1995, and transferred to the Free BSD license in 2012. +C programs. It was Copyrighted in 1995, and transferred to the Free BSD license in 2012. -From Joseph's github repository: +From Joseph's github repository: > Design and implementation of ofront is due to Josef Templ ... ofront has been based in part on Regis Crelier's PhD thesis and Stefan Gehring's diploma thesis, both at ETH Zurich, Institute for Computer Systems. diff --git a/doc/BasicTypeSize.md b/doc/BasicTypeSize.md deleted file mode 100644 index a6dc52ef..00000000 --- a/doc/BasicTypeSize.md +++ /dev/null @@ -1,172 +0,0 @@ -## Cross Platform Compatibility and Basic Type Sizes in Vishap Oberon - -###### Abstract - -Vishap Oberon needs to support 32 and 64 bit machine architectures. 16 and -possibly 8 bits would be good too. - -Currently Vishap Oberon has different INTEGER, LONGINT and SET sizes on 16 -and 32 bit architectures. While this enables memory management code to use -LONGINT on all architectures, it breaks library and user code which makes -assumptions about type sizes. - -The goal is to specify changes to the Vishap compiler and library to allow C -code generation for multiple machine architectures without breaking existing -code, and to allow serialized data to be interchangeable between machine -architectures. - -###### Motivation - -Current type sizes are loosely specified and vary between implementations. There -are conflicting general assumptions, for example: that LONGINT is large enough -to contain any machine address; but also that LONGINT always take 32 bits when -serialised to files. (See Oakwood guidelines appendix A 1.2.5.4.) - -The compiler has ended up with a number of INTEGER types, each with its own -set of code to handle declaration, access, storage etc. There is a good -opportunity to refactor and simplify the current duplicated code. - -Neither C's basic types, nor Oberon's are fixed in size. Yet for cross platform -compatability we need fixed size types. - -###### Basis of implementation - integers and sets - -In the generated C code we use these types for all integer and set variables: - -| Unsigned | Signed | Sets | -| ----------- | ----------- | ------ | -| INTEGER_U8 | INTEGER_S8 | SET_8 | -| INTEGER_U16 | INTEGER_S16 | SET_16 | -| INTEGER_U32 | INTEGER_S32 | SET_32 | -| INTEGER_U64 | INTEGER_S64 | SET_64 | - -SYSTEM.H uses conditional compilation to derive these types from the types -available in the C compiler we are building on. - -Then, with suitable compiler options we control the mapping of compiler types -to these C types. - -There are three strategies that clients may wish to use: - -1) Emphasizing compatability with serialised data and existing code. Here - we fix Oberon type sizes across platforms, and introduce a new LONG64 type - as follows: - -| Oberon type | Size | -| ----------- | ---------------- | -| BOOLEAN | 8 bits | -| BYTE | 8 bits unsigned | -| SHORTINT | 8 bits signed | -| INTEGER | 16 bits signed | -| LONGINT | 32 bits signed | -| SET | 32 flag bits | -| LONG64 | 64 bits signed | - - This gives a set of sizes that are available on all platforms (even SDCC - supports 64 bit ints), and which have fixed characteristics (e.g. the size of - character array sufficient to support any LONGINT values is fixed.) - - Note that these sizes match current Vishap Oberon behaviour on x86. - -2) Emphasizing performant maxima. Here we make e.g. LONGINT the largest - efficient size available. On x86 we stick with the sizes as above, but for - x64 we make changes to INTEGER, LONGINT and SET as follows: - -| Oberon type | Size on x64 | -| ----------- | ---------------- | -| INTEGER | 32 bits signed | -| LONGINT | 64 bits signed | -| SET | 64 flag bits | - -3) Supporting system code, especially memory management. - - With SYSTEM imported, we extend the parsing of type INTEGER to accept a - subsequent qualifier which may be U8, S8, U16, S16, U32, S32, U64, S64 or - ADDRESS. - - Thus the type `INTEGER ADDRESS` takes over the role of `LONGINT` in existing - memory management code. The compiler will map `INTEGER ADDRESS` to the - relevant `INTEGER_U32` or `INTEGER_U64` in generated C code. - - Additionally the fixed size qualifiers U8, S8, U16, etc. allow the writing of - Oberon source code that generates the same C code regardless of compilation - options used. - -###### Cross platform libraries - -Many integral input parameters are currently coded as LONGINT with the intention -of accepting any size of integer. E.g. Texts.WriteInt. All such code needs -upgrading to accept LONG64 with implementation changes where necessary to -account for the larger values. Boring, but straightforward. - -Some integral output parameter are currently coded as `VAR LONGINT`, for example -the integer value field `i` in RECORD type `Scanner`. This is a problem: - -Assuming scenario 1 - LONGINT is always 32 bits. - - - If retained as LONGINT, Scanner won't be able to handle 64 bit integers. - - If changed to LONG64, existing code will compile with type compatibility - errors. - -So neither option is possible on its own. - -The simplest workaround is to add a new field `l` and a new scanner class -Long64 (similar to the pair of REAL and LONGREAL values already in Scanner). - -Existing code will continue to work with values in the 32 bit range (which is -OK, because that's all the existing code can generate). New code can allow for -thye LongReal case. - -(Ugly but workable). - -Oakwood says that INTEGER must be stored as 2 bytes little endian, so Files.Mod -must use 16 bits on file for Files.ReadInt and Files.WriteInt. So what happens -in scenario 2 above? Since INTEGER is 32 bits in scenario 2, it would be -necessary to call Files.WriteLInt Files.ReadLInt. This is not obvious, and will -need the coder to work around the apparent type incompatibility. - -If only the type compatibility of passing a smaller integer variable to a larger -value parameter also worked for a larger var parameter. - -Would this be possible? - -e.g. - -```Modula-2 - PROCEDURE p(VAR x: LONGINT); BEGIN ... END p; - - PROCEDURE q; - VAR r: INTEGER; - BEGIN p(r) END q; -``` - -q passes an `INTEGER` to the `VAR x: LONGINT` parameter of p. Normally this -would be a type compatability error. - -If we want to defer value range checking until runtime, the compiler would have -to behave as if q was written with a temp LONGINT variable like this: - -```Modula-2 - PROCEDURE q; - VAR r: INTEGER; temp: LONGINT; - BEGIN p(temp); r := SHORT(temp) END q; -``` - -Not simple enough. - - -###### IMPORT SYSTEM - -With SYSTEM imported, we allow the type INTEGER to be followed by a size and -sign specification consiting of a letter (U for unsigned or S for signed) -followed by a numeric bit count which may be 8, 16, 32 or 64. Additionally -INTEGER may be followed by the word ADDRESS to request an unsigned integer type -of the same size as a machine address. - -Thus we could define - -###### Not supported - -This solution does not seek to handle architectures such as the 8086/80286 where -a generalised address is not a single numeric value. TopSpeed Modula handled -this nicely, but we don't go that far. diff --git a/doc/Features.md b/doc/Features.md index e7e8a39d..6ed5d420 100644 --- a/doc/Features.md +++ b/doc/Features.md @@ -1,25 +1,130 @@ -#### (Work in progress) +### Features + +#### 32 bit and 64 bit systems vs integer, set and address size. + +The Oberon language specification sets explicit lower bounds on the maximum and minimum +values supported by SHORTINT, INTEGER and LONGINT, and the maximum number of items supported +by SET. + +Most Oberon systems implemented these lower bounds, however a few more recent systems allow +wider ranges of values. + +While it may seem safe to compile code developed on earlier systems with the newer, larger +integer and set types, it is not. Some examples: + + - Code that uses MIN(INTEGER), MAX(INTEGER) etc. as a flag values will run into problems if + it tries to store the flag value to a file using standard library functions. The Oakwood + guidelines specify that INTEGER be stored in 16 bits on file regardless of it's size in + memory*. + + - Code that assumes that INTEGER values wrap around at known values will fail. For example + i: SHORTINT; ... i := 127; INC(i); will produce -128 on original systems, but +128 on + systems with a larger SHORTINT representation. + + - Bit manipulation code that uses SYSTEM.VAL to access parts of values will access the + wrong number of bits. For example, the implementation of REAL and LONGREAL library functions + use SYSTEM.VAL(SET, realvalue) to access and change the sign, mantissa and exponent of REALs. + +Therefore we provide compilation options to select the representation of SHORTINT, INTEGER, LONGINT and SET. + +\* It makes sense for Oakwood to insist on fixed sizes for the standard types as this is a pre-requisite +for stable file exchange between different builds of applications, and between different applications following a standard file format. + + +#### Compiler options for integer and set sizes. + +The -O2 and -OC compiler options select nbetween the two most commonly used integer and set +type implementations. + +| Type | -O2 option (default) | -OC option | +| --- | --- | --- | +| SHORTINT | 8 bit | 16 bit | +| INTEGER | 16 bit | 32 bit | +| LONGINT | 32 bit | 64 bit | +| SET | 32 bit | 64 bit | + The following Oberon types are independent of compiler size: -| Types | Size | -| ----- | -------| -| CHAR, SHORTINT | 8 bit | -| REAL | 32 bit | -| LONGREAL | 64 bit | +| Types | Size | +| ----- | -------| +| REAL | 32 bit | +| LONGREAL | 64 bit | +| HUGEINT* | 64 bit | +| CHAR** | 8 bit | -The following type sizes follow the built compiler size: +\* The additional type HUGEINT is predefined as a 64 bit integer, providing 64 bit support even +in -O2 compilations. -| Types | 32 bit builds | 64 bit builds | -| ----- | ------------- | ------------- | -| INTEGER | 16 bit | 32 bit | -| LONGINT, SET | 32 bit | 16 bit | +\** No built-in support is provided for the UTF-16 or UCS-2 Unicode encodings. UTF-8 is the recommended Unicode encoding for text. + - 16 bits has been insufficient for the Unicode character repetoire for at least 15 years. + - Writing systems often require more than one unicode codepoint to represent a single character (and what constitutes a character can vary according to context). + - UTF-8 is now widely used. -HALT/exit code has been simplified. Exit now just calls the system exit API rather than calling the kill API and passing our own process ID. For runtime errors it now displayes the appropriate error message (e.g. Index out of range). - -Compilation errors now include the line number at the start of the displayed source line. The pos (character offset) is still displayed on the error message line. The error handling code was already doing some walking of the source file to find start and end of line - I changed this to walk through the source file from the start identifying line end positions, counting lines and caching the position at the start of the last error line. The resultant code is simpler, and displays the line number without losing the pos. The performance cost of walking the source file is not an issue. +See [UTF-8 Everywhere](http://utf8everywhere.org/) for much more background on this recommendation. - - In his latest specs (around 2013) Wirth removed the 'COPY(a, b)' character array copy procedure, replacing it with 'b := a'. I have accordingly enabled 'b := a' in voc as an alternative to 'COPY(a, b)' (COPY is still supported.). +#### SYSTEM.Mod support for fixed size integers and sets. + +SYSTEM.Mod includes the following additional types: + +| Type | Size | Range | +| --- | --- | --- | +| SYSTEM.INT8 | 8 bit | -128 .. 127 | +| SYSTEM.INT16 | 16 bit | -32,768 .. 32,767 | +| SYSTEM.INT32 | 32 bit | -2,147,483,6478 .. ‭2,147,483,647‬ | +| SYSTEM.INT64 | 64 bit | -‭9,223,372,036,854,775,808 .. ‭9,223,372,036,854,775,807‬ | +| SYSTEM.SET32 | 32 bit | 0 .. 31 | +| SYSTEM.SET64 | 64 bit | 0 .. 63 | + +Integer literals are recognised within the full signed 64 bit integer range MIN(SYSTEM.INT64) to MAX(SYSTEM.INT64). Additionally the parsing of hex notation allows negative values to be entered as a full 16 hex digits with top bit set. For example, -1 may be represented in Oberon source as 0FFFFFFFFFFFFFFFFH. + + +#### The SHORT and LONG functions + +SHORT() of LONGINT and INTEGER values, and LONG() of SHORTINT and INTEGER values behave as +originally specified by Oberon-2. + +In -O2, where LONGINT is 32 bits, LONG() now accepts a LONGINT value returning a HUGEINT value. + +In -OC, where SHORTINT is 16 bits, SHORT() now accepts a SHORTINT value returning a SYSTEM.INT8 value. + + +#### Pointers and Addresses + +Most Oberon systems have implicitly or explicitly assumed that LONGINT is large enough to hold +machine addresses. With the requirement to support 32 bit LONGINT on 64 bit systems, this is no +longer possible. + +The type SYSTEM.ADDRESS is added, a signed integer type equivalent to either SYSTEM.INT32 or SYSTEM.INT64 according to the system address size. + +The following SYSTEM module predefined functions and procedures now use SYSTEM.ADDRESS instead of LONGINT. + +*Function procedures* + +| Name | Argument types | Result Type | Function | +| ---- | --- | --- | --- | +| SYSTEM.ADR(*v*) | any | SYSTEM.ADDRESS | Address of argument | +| SYSTEM.BIT(*a*, *n*) | *a*: SYSTEM.ADDESS; *n*: integer | BOOLEAN | bit *n* of Mem[*a*] | + +*Proper procedures* + +| Name | Argument types | Function | +| ---- | --- | --- | +| SYSTEM.GET(*a*, *v*) | *a*: SYSTEM.ADDRESS; *v*: any basic type, pointer, procedure type | *v* := Mem[*a*] | +| SYSTEM.PUT(*a*, *x*) | *a*: SYSTEM.ADDRESS; *x*: any basic type, pointer, procedure type | Mem[*a*] := *v* | +| SYSTEM.MOVE(*a0*, *a1*, *n*) | *a0*, *a1*: SYSTEM.ADDRESS; *n*: integer | Mem[*a1*..*a1*+*n*-1] := Mem[*a0*..*a0*+*n*-1] | + +Note that the standard function LEN() still returns LONGINT. + + +#### Runtime error and exit handling + +When passed FALSE, ASSERT displays the message 'Assertion failure.'. If a second, nonzero value is passed to ASSERT it will also be displayed. ASSERT then exits to the OS passing the assert value or zero. + +HALT displays the message 'Terminated by Halt(n)'. For negative values that correspond to a standard runtime error a descriptive string is also printed. Finally Halt exits to the oprerating system passing the error code. + +Bear in mind that both Linux and Windows generally treat the return code as a signed 8 bit value, ignoring higher order bits. Therefore it is best to restrict HALT and ASSERT codes to the range -128 .. 127. + +A client application may register a halt handler by calling Platform.SetHalt(p) where p: PROCEDURE(n: SYSTEM.INT32). This procedure will be called before Halt displays it's message. The procedure may suppress the Halt message by calling Platform.Exit(code: INTEGER) directly. - - Oberon code often writes to Oberon.Log expecting the text to appear on the screen. While voc has an Oberon.DumpLog procedure, I looked into making the behaviour automatic. Interestingly the voc source declares the Text notifier constants replace, insert and delete, but omits implementation of the notifier calls. The implementation turned out to be very little code, and I have used it to echo all text written to Oberon.Log to the console. This has the advantage over DumpLog that text is written immediately rather than only when DumpLog is called, and allows existing program source to work unchanged. diff --git a/doc/Roadmap.md b/doc/Roadmap.md deleted file mode 100644 index 5fac7121..00000000 --- a/doc/Roadmap.md +++ /dev/null @@ -1,150 +0,0 @@ - -#### (Work in progress) - -#### Machine size issues - -I don't see any really good solutions to different machine sizes. Existing code, -such as the libraries, assumes that INTEGER is 16 bit and LONGINT is 32 bit and -so is broken on 64 bit builds of voc. - -Could the implementation of INTnn types help? It would not solve (for example) -the need for a type that always matches address size. Nor would it provide -unsigned types. Implementation of low level memory management needs both. - -Wirth's latest spec includes a BYTE type (not SYSTEM.BYTE, just BYTE) that -behaves as an unsigned 8 bit integer, for use in low level code. BYTE thus -avoids the need for SYSTEM.VAL when manipulating 8 bit unsigned numeric values, -making code easier to write and, more importantly, easier to read. A BYTE type -would be useful for microcontroller C support. So I believe it makes sense to -add Wirths's BYTE to voc. - -Linux/Unix specifies many API datatypes and structure fields in terms of named C -numeric types, with the result that they vary in size between implementations. -This is perhaps the strongest driving force for adding support for various -numeric types to voc - but they would better match the C types than be of fixed -size. - -So maybe one could provide Platform.int, Platform.long, Platform.longlong, -Platform.unsignedint, Platform.unsignedlong, Platform.unsignedlonglong and, -importantly for memory management, Platform.uintptr. - -Personally I miss Pascal and Modula's subrange variables. As well as being great -for error detection (assuming value checking code is generated), they can also -be used to imply variables of arbitrary sizes (e.g. 'VAR mybyte = 0..255;'). -With these one could remove the Platform.int* types and replace them with -constants Platform.MaxInt, Platform.MaxLong etc. I think this would be a cleaner -more generalised option - but maybe, probably, it is a step too far. Always -beware of over-generalising. Wirth found that most programmers did not use, or -very rarely used, subrange types. - -#### More thoughts about 64 bit support and what INTEGER and LONGINT mean - -Arguably, because Oberon says LONGINT is big enough for addresses, -it seems that LONGINT has to be 64 bits on a 64 bit system. - -But I'm having second thoughts. - -There's a lot of code out there that assumes the size of INTEGER and LONGINT -and is broken if they are not 16 and 32 bits respectively. Frustratingly a -lot of the broken code doesn't go wrong until it encounters values outside the -16 and 32 bit ranges - like Texts.WriteInt which handles values up 2**32 fine, -and then aborts the program with an index out of range error when the number -is more than 11 characters long. - -I suggest use of LONGINT for addresses is a small subset of use cases of LONGINT. - -Instead I propose we - - keep INTEGER at 16 bits and LONGINT at 32 bits. - - Add LONG64 for 64 bit signed integers, to be available on both 32 and 64 - bit systems, (quite possible as C has an int64_t on both systems). - - add a SYSTEM.ADDRESS type for address manipulation - - an unsigned type that always matches the machine address size (32, 64 or even 16 bit). - - is compatible with SHORTINT, INTEGER, LONGINT and LONG64. - -It means changing the memory management and platform interface code, but it -means client code does not need changing. - -This fixes the current 16 bit hole in the range of INTEGER types on 64 bit systems. - -#### Oakwood Guidelines on type sizes - -The Oakwood guidelines are interesting. - - - 5.2 requires that e.g. LONGINT is 32 bits *or more*, - -but - - Appendix A 1.2.5.4 requires that MODULE Files *always* reads and writes - LONGINT as 4 bytes. - -The restriction for the Files module makes sense as it is intended to produce -and consume files in a compatible way between platforms. Thus if a system uses -64 bit LONGINT, it is an error (detected or not) to write -to MODULE Files any LONGINT values outside the 32 bit range. - -To put it shockingly, it is an error to write the vast majority of possible -LONGINT values - specifically over 99.998% of LONGINT values are invalid for -MODULE Files. - -I see this as another argument in favour of locking LONGINT down as 32 bits. - -#### It's all the same to C - -It should be possible to make the 32/64 bit compilation a compiler option -available whether the compiler binary itself was built with 32 or 64 bit C. - -Indeed - is there any benefit in a 64 bit compiler binary? A 32 bit compiler -binary will be smaller and faster. The memory requirements of the compiler are -orders of magnitude less than those that would need a 64 bit implementation. - -The only need for a 64 bit compiler binary is for systems that can only run -64 bit binaries. - -Point being - the bit size of the compiler binary should be independent of the -bit size of the target machine of the C code being generated. - -So the compiler options could be: - - 1. Generated binary bit size - 32 or 64 bit. Determines bit size of - SYSTEM.ADDRESS. Add 16 bit option for controllers. - 2. Size of INTEGER, SET and LONGINT. Defaulting to 16,32,32 the parameter would - also allow 32/64/64. - -The libraries would be written and compiled to handle all cases. e.g. - - A WriteInt routine needs it's value parameter to accept integers of all - sizes and would be coded as LONG64. - - ReadInt is slightly more difficult because the parameter is VAR. Make the - parameter ARRAY OF BYTE and process according to SIZE(param). - -#### A feature I'd really like to see - -We should report .Mod file name and line number at fault when exiting abnormally, -e.g. due to index out of range. Followed by a stack trace. - -Wirth's original Pascal (Pascal 6000 on the CDC mainframe at ETHZ) had this at -least by 1975. This could be achieved by including a table of .Mod file line -number vs code address, and having the runtime seach this table for the failure -address. It would be quite a lot of work! - -The current position tracking code in the compiler is buggy - for example the -position at the end of the `expr` in `WHILE expr DO stmt END` is recorded as -the position of the END when it should be of the 'DO'. This makes compiler error -reporting a bit unhelpful, but it's worse for runtime error reporting as we end -up with duplicate entries in the line number table. The position handling code -is somewhat obscure as it uses a convenient but misnamed spare integer field in -the symbol record and it's difficult to follow just when it patches it. - -#### Oberon 07/15 mode - - - Add standard BYTE type being an unsigned integer between 0 and 255. - - Structured value parameters become read-only and get passed the same way as - VAR parameters - i.e. no copying. - - CASE statements only support INTEGER (with low positive values) and CHAR. - - Reject LOOP statements. - - All imported variables are read-only. - -See [Difference between Oberon-07 and Oberon](https://www.inf.ethz.ch/personal/wirth/Oberon/Oberon07.pdf). - -#### To be left out? - -Work on other compatibility layers is in progress. -voc team also works on bindings to existing C/Pascal libraries. diff --git a/src/compiler/OPT.Mod b/src/compiler/OPT.Mod index 93db3e5e..c2e7412f 100644 --- a/src/compiler/OPT.Mod +++ b/src/compiler/OPT.Mod @@ -1323,13 +1323,12 @@ BEGIN topScope := NIL; OpenScope(0, NIL); OPM.errpos := 0; EnterProc("NEW", sysnewfn); EnterProc("MOVE", movefn); - syslink := topScope^.right; + syslink := topScope^.right; universe := topScope; topScope^.right := NIL; EnterTyp("BOOLEAN", Bool, 1, booltyp); EnterTyp("CHAR", Char, 1, chartyp); -(*EnterTyp("SET", Set, -1, settyp);*) (* Size set in Compiler.PropagateElementaryTypeSize *) EnterTyp("REAL", Real, 4, realtyp); EnterTyp("LONGREAL", LReal, 8, lrltyp); EnterTyp("HUGEINT", Int, 8, hinttyp); diff --git a/src/runtime/Platformwindows.Mod b/src/runtime/Platformwindows.Mod index 65c97d24..bc9e4fd3 100644 --- a/src/runtime/Platformwindows.Mod +++ b/src/runtime/Platformwindows.Mod @@ -545,7 +545,7 @@ BEGIN IF l<0 THEN errch('-'); l := -l END; errposint(l) END errint; PROCEDURE DisplayHaltCode(code: LONGINT); BEGIN CASE code OF - | -1: errstring("Rider ReadBuf/WriteBuf transfer size longer than buffer.") + | -1: errstring("Assertion failure.") | -2: errstring("Index out of range.") | -3: errstring("Reached end of function without reaching RETURN.") | -4: errstring("CASE statement: no matching label and no ELSE.") From c63bc9e093dc8fc43ffa769ac3641886379e8eee Mon Sep 17 00:00:00 2001 From: David Brown Date: Tue, 1 Nov 2016 11:58:54 +0000 Subject: [PATCH 302/580] Fix readme table of contents layout. --- ReadMe.md | 35 ++++++++++++++++------------------- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/ReadMe.md b/ReadMe.md index 7832f2ea..fc974684 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -11,18 +11,18 @@ Oberon programs under Unix, Mac or Windows. Vishap Oberon includes libraries from the Ulm, oo2c and Ofront Oberon compilers, as well as default libraries complying with the Oakwood Guidelines for Oberon-2 compilers. -###### Contents +#### Contents -> [Installation](#installation) -> [A 'Hello' application](#a-hello-application) -> [Licensing](#licensing) -> [Platform support and porting](#platform-support-and-porting) -> [Language support and libraries](#language-support-and-libraries) -> [History](#history) -> [Roadmap](#roadmap) -> [Contributors](#contributors) -> [Origin of the name "Ñ´ishap Oberon"](#origin-of-the-name-Ñ´ishap-oberon) -> [References](#references) +    [**Installation**](#installation)
+    [**A 'Hello' application**](#a-hello-application)
+    [**Licensing**](#licensing)
+    [**Platform support and porting**](#platform-support-and-porting)
+    [**Language support and libraries**](#language-support-and-libraries)
+    [**History**](#history)
+    [**Roadmap**](#roadmap)
+    [**Contributors**](#contributors)
+    [**Origin of the name "Ñ´ishap Oberon"**](#origin-of-the-name-Ñ´ishap-oberon)
+    [**References**](#references)
## Installation @@ -37,7 +37,7 @@ default libraries complying with the Oakwood Guidelines for Oberon-2 compilers. | Cygwin | use setup-x86[_x64] to add packages git, make and gcc-core | | Darwin | type 'git' at the command line and accept the prompt to install it. | -More details, including for MingW and MS C, in [Installation](/doc/Installation.md). +More details, including for MingW and MS C, in [**Installation**](/doc/Installation.md). ###### Build and install @@ -59,7 +59,7 @@ by make full, e.g. | Windows | See [Installation](/doc/Installation.md) | | Termux | `export PATH="/data/data/com.termux/files/opt/voc/bin:$PATH"` | -Also see [Installation](/doc/Installation.md). +Also see [**Installation**](/doc/Installation.md). ## A 'Hello' application @@ -97,7 +97,7 @@ executable binary. Execute as usual on Linux ('./hello') or Windows ('hello'). -Also see [Compiling](/doc/Compiling.md). +Also see [**Compiling**](/doc/Compiling.md). ## Licensing @@ -134,7 +134,7 @@ In some cases manual work will be required: necessary to implement a new variant of Platform.Mod providing the same interface as Platformunix.Mod and Platform Windows.Mod. -For details, see [Porting](/doc/Porting.md). +For details, see [**Porting**](/doc/Porting.md). ## Language support and libraries @@ -165,11 +165,8 @@ Oakwood libraries are supported for both -O2 and -OC options, whereas the ULM, O Vishap Oberon also supports some features of Oberon-07. -See also [Features](/doc/Features.md). +See also [**Features**](/doc/Features.md). -## History - -See [History](/doc/History.md). ## Contributors From 668c2ef508ba062913678244667b895ee390884a Mon Sep 17 00:00:00 2001 From: David Brown Date: Wed, 2 Nov 2016 12:12:59 +0000 Subject: [PATCH 303/580] Minor documentation updates. --- ReadMe.md | 27 +++++++++++++-------------- doc/Porting.md | 40 +++++++++------------------------------- 2 files changed, 22 insertions(+), 45 deletions(-) diff --git a/ReadMe.md b/ReadMe.md index fc974684..fa3f6ffe 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -121,20 +121,19 @@ It compiles under gcc, clang and Microsoft Visual C. Installation supports GNU/Linux, MAC OSX, BSD and Windows (native and cygwin). A C program (src/tools/make/configure.c) detects the details of the C compiler -and operating system on which it is running. In most cases it will automatically -determine all that is needed for the port to a new platform. and 'make full' -will just work. +and operating system on which it is running. -In some cases manual work will be required: +The following systems are recognised: - - If configure.c cannot recognise the operating system on which it is running - a few lines will need to be added to detect and set the make variables - correctly. - - If porting to a system that does not provide a Unix style API, it will be - necessary to implement a new variant of Platform.Mod providing the same - interface as Platformunix.Mod and Platform Windows.Mod. + - Linux, including Ubuntu and Centos derivatives. + - The BSDs, including OpenBSD and FreeBSD. + - Cygwin under Windows, MingW under Cygwin, Bash on Ubuntu on Windows. + +Additionally a Windows .cmd is provided for building with Microsoft C. + +For details, including how to add support for unrecognised systems, see +[**Porting**](/doc/Porting.md). -For details, see [**Porting**](/doc/Porting.md). ## Language support and libraries @@ -154,9 +153,9 @@ Vishap Oberon supports the Oberon 2 programming language, including type-bound p Included libraries ease porting of code from the major Oberon systems: - Oberon V4 and S3 compatible library set. - - ooc (optimizing oberon-2 compiler) library port. + - Ooc (optimizing oberon-2 compiler) library port. - Ulm’s Oberon system library port. - - Okwood standard libraries. + - Oakwood standard libraries. - Some other freely redistributable libraries. Oakwood libraries are supported for both -O2 and -OC options, whereas the ULM, OOC and ETH system 3 libraries are only available on -O2 (default) compilations. @@ -177,7 +176,7 @@ From Joseph's github repository: > Design and implementation of ofront is due to Josef Templ ... ofront has been based in part on Regis Crelier's PhD thesis and Stefan Gehring's diploma thesis, both at ETH Zurich, Institute for Computer Systems. -Norayr Chilingarian forked ofront in 2013, porting extensive libraries from [ULM Oberon](http://www.mathematik.uni-ulm.de/oberon/), [OO2C](https://github.com/Spirit-of-Oberon/oo2c) and ETH Oberon System 3, and adding support for more platforms including 64 bit systems, and . +Norayr Chilingarian forked ofront in 2013, porting extensive libraries from [ULM Oberon](http://www.mathematik.uni-ulm.de/oberon/), [OO2C](https://github.com/Spirit-of-Oberon/oo2c) and ETH Oberon System 3, and adding support for more platforms including 64 bit systems. David Brown has worked on adding support for more platforms incuding windows using MSC, cygwin or mingw since January 2016. More recently he has generalised basic type support within the compiler to allow e.g. 64 bit LONGINT on 32 bit systems, and 32 bit LONGINT on 64 bit systems. diff --git a/doc/Porting.md b/doc/Porting.md index 94707e04..8bb2e74e 100644 --- a/doc/Porting.md +++ b/doc/Porting.md @@ -1,8 +1,6 @@ -#### (Work in progress) - ### Porting to a new platform -Porting to a new 32 or 64 bits platform is usually automatically handled +Porting to a new 32 or 64 bit platform is usually automatically handled by `make full`: - The makefile compiles `src/tools/make/configure.c` with the @@ -13,7 +11,7 @@ by `make full`: operating system it is running on and what the appropriate installation directory will be. - `configure.c` sets makefile variables that are used to select - which of 5 sets of preprepared C source files to build to create + which of 5 sets of pre-prepared C source files to build to create the bootstrap compiler. On most systems this will be sufficient for `make full` to build @@ -23,10 +21,11 @@ and install the compiler and libraries. `--- Branch v2docs freebsd gcc LP64 confidence tests passed ---` + #### Updating configure.c -It should only be necessary to change `configure.c` if it -cannot determine the correct install directory. +Most likely you will only need to change `configure.c` if it cannot determine +the correct install directory. In this case add code to `src/tools/make/configure.c`'s function `determineOS()` to set the `os` variable to the name @@ -41,7 +40,7 @@ variable | set to | example `binext` | Binary file extension | `""` `staticlink` | Static linking option | `"-static"` -If your new platform does not support static removing, set the +If your new platform does not support static linking, set the `staticlink` variable to `""`. Then modify `determineInstallDirectory()` to select the correct @@ -53,28 +52,7 @@ to the Windows API (`Platformwindows.Mod`), and one suitable for Unix-like systems including Linux, BSD, Android and cygwin (`Platformunix.Mod`). +If you are porting to a system that does not provide a Unix style API, it will +be necessary to implement a new variant of Platform.Mod providing the same +interface as Platformunix.Mod and Platform Windows.Mod. -#### How to add a new compiler option - - - Define it in OPM as a constant before defopt is defined. - - Define a BOOLEAN variable in OPM which will describe if setting is set. - - Add handling of a new option in OPM.ScanOptions - - Set your BOOLEAN value in OPM.OpenPari (or in ScanOptions, after the - CASE) so you can check it later. - - Check your boolean when necessary, (see useParFile in OPM.GetOptions) - - Add it in OPC.GenHeaderMsg function. - -#### Known bugs - -When using SYSTEM.LSH(s, n) where s is SET, -the C compiler generates an error like -`error: duplicate 'unsigned'`, -that's because SET is defined as unsigned in SYSTEM.h, -while LSH is defined in SYSTEM.h as ((t)((unsigned t)(x)<<(n))), -and it makes not possible to make SYSTEM.LSH with type SET. - -I don't want to prohibit it at the parser level -because C backend is only one of possible backends. - -The solution currently is to cast set type to longint before lsh-ing it. -And then casting it back to set if necessary. From 1935f63cd6835714b5a66799267123270e35263c Mon Sep 17 00:00:00 2001 From: David Brown Date: Wed, 2 Nov 2016 12:59:51 +0000 Subject: [PATCH 304/580] Fix ABS in SYSTEM.h and fix tools/make/ignore. --- src/runtime/SYSTEM.h | 2 +- src/tools/make/ignore | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/runtime/SYSTEM.h b/src/runtime/SYSTEM.h index cb7c8815..4600fe8b 100644 --- a/src/runtime/SYSTEM.h +++ b/src/runtime/SYSTEM.h @@ -202,7 +202,7 @@ extern int64 SYSTEM_ENTIER (double x); static inline int32 SYSTEM_ABS64(int64 i) {return i >= 0 ? i : -i;} static inline int64 SYSTEM_ABS32(int32 i) {return i >= 0 ? i : -i;} -#define __ABSF(x) ((sizeof(x) <= 4) ? SYSTEM_ABS32(i) : SYSTEM_ABS64(i)) +#define __ABSF(x) ((sizeof(x) <= 4) ? SYSTEM_ABS32(x) : SYSTEM_ABS64(x)) static inline double SYSTEM_ABSD(double i) {return i >= 0.0 ? i : -i;} #define __ABSFD(x) SYSTEM_ABSD(x) diff --git a/src/tools/make/ignore b/src/tools/make/ignore index f25566d8..1f2cafbe 100644 --- a/src/tools/make/ignore +++ b/src/tools/make/ignore @@ -4,4 +4,4 @@ OPM_ResourceDir __MOVE.* cmd, OPM_(IntSize|PointerSize|Alignment) = Strings_Append.+void\*\)(cmd|OPM_OBERON|extTools_comp) -__COPY\("(gcc|clang|msc|i686-w64-mingw \ No newline at end of file +__COPY\("(gcc|clang|msc|i686-w64-mingw) From baeb2db81f50bbd42dee69963082b7a04a4cc3ca Mon Sep 17 00:00:00 2001 From: David Brown Date: Tue, 8 Nov 2016 11:48:33 +0000 Subject: [PATCH 305/580] Uppercase internal SYSTEM.H types address, int*, uint*. Phase 1. --- ReadMe.md | 10 +- bootstrap/SYSTEM.c | 75 +++--- bootstrap/SYSTEM.h | 162 ++++++------ bootstrap/unix-44/Compiler.c | 14 +- bootstrap/unix-44/Configuration.c | 12 +- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Files.c | 234 +++++++++--------- bootstrap/unix-44/Files.h | 68 ++--- bootstrap/unix-44/Heap.c | 266 ++++++++++---------- bootstrap/unix-44/Heap.h | 16 +- bootstrap/unix-44/Modules.c | 26 +- bootstrap/unix-44/Modules.h | 14 +- bootstrap/unix-44/OPB.c | 166 ++++++------- bootstrap/unix-44/OPB.h | 22 +- bootstrap/unix-44/OPC.c | 241 +++++++++--------- bootstrap/unix-44/OPC.h | 20 +- bootstrap/unix-44/OPM.c | 198 +++++++-------- bootstrap/unix-44/OPM.h | 50 ++-- bootstrap/unix-44/OPP.c | 106 ++++---- bootstrap/unix-44/OPP.h | 4 +- bootstrap/unix-44/OPS.c | 60 ++--- bootstrap/unix-44/OPS.h | 8 +- bootstrap/unix-44/OPT.c | 278 ++++++++++----------- bootstrap/unix-44/OPT.h | 58 ++--- bootstrap/unix-44/OPV.c | 84 +++---- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Out.c | 82 +++---- bootstrap/unix-44/Out.h | 10 +- bootstrap/unix-44/Platform.c | 252 +++++++++---------- bootstrap/unix-44/Platform.h | 104 ++++---- bootstrap/unix-44/Reals.c | 70 +++--- bootstrap/unix-44/Reals.h | 16 +- bootstrap/unix-44/Strings.c | 56 ++--- bootstrap/unix-44/Strings.h | 14 +- bootstrap/unix-44/Texts.c | 354 +++++++++++++-------------- bootstrap/unix-44/Texts.h | 114 ++++----- bootstrap/unix-44/VT100.c | 98 ++++---- bootstrap/unix-44/VT100.h | 36 +-- bootstrap/unix-44/errors.c | 10 +- bootstrap/unix-44/errors.h | 2 +- bootstrap/unix-44/extTools.c | 12 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-48/Compiler.c | 14 +- bootstrap/unix-48/Configuration.c | 12 +- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Files.c | 234 +++++++++--------- bootstrap/unix-48/Files.h | 68 ++--- bootstrap/unix-48/Heap.c | 266 ++++++++++---------- bootstrap/unix-48/Heap.h | 16 +- bootstrap/unix-48/Modules.c | 26 +- bootstrap/unix-48/Modules.h | 14 +- bootstrap/unix-48/OPB.c | 166 ++++++------- bootstrap/unix-48/OPB.h | 22 +- bootstrap/unix-48/OPC.c | 241 +++++++++--------- bootstrap/unix-48/OPC.h | 20 +- bootstrap/unix-48/OPM.c | 198 +++++++-------- bootstrap/unix-48/OPM.h | 50 ++-- bootstrap/unix-48/OPP.c | 106 ++++---- bootstrap/unix-48/OPP.h | 4 +- bootstrap/unix-48/OPS.c | 60 ++--- bootstrap/unix-48/OPS.h | 8 +- bootstrap/unix-48/OPT.c | 278 ++++++++++----------- bootstrap/unix-48/OPT.h | 58 ++--- bootstrap/unix-48/OPV.c | 84 +++---- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Out.c | 82 +++---- bootstrap/unix-48/Out.h | 10 +- bootstrap/unix-48/Platform.c | 252 +++++++++---------- bootstrap/unix-48/Platform.h | 104 ++++---- bootstrap/unix-48/Reals.c | 70 +++--- bootstrap/unix-48/Reals.h | 16 +- bootstrap/unix-48/Strings.c | 56 ++--- bootstrap/unix-48/Strings.h | 14 +- bootstrap/unix-48/Texts.c | 354 +++++++++++++-------------- bootstrap/unix-48/Texts.h | 116 ++++----- bootstrap/unix-48/VT100.c | 98 ++++---- bootstrap/unix-48/VT100.h | 36 +-- bootstrap/unix-48/errors.c | 10 +- bootstrap/unix-48/errors.h | 2 +- bootstrap/unix-48/extTools.c | 12 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-88/Compiler.c | 14 +- bootstrap/unix-88/Configuration.c | 12 +- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Files.c | 234 +++++++++--------- bootstrap/unix-88/Files.h | 72 +++--- bootstrap/unix-88/Heap.c | 268 ++++++++++---------- bootstrap/unix-88/Heap.h | 16 +- bootstrap/unix-88/Modules.c | 26 +- bootstrap/unix-88/Modules.h | 14 +- bootstrap/unix-88/OPB.c | 166 ++++++------- bootstrap/unix-88/OPB.h | 22 +- bootstrap/unix-88/OPC.c | 241 +++++++++--------- bootstrap/unix-88/OPC.h | 20 +- bootstrap/unix-88/OPM.c | 198 +++++++-------- bootstrap/unix-88/OPM.h | 50 ++-- bootstrap/unix-88/OPP.c | 106 ++++---- bootstrap/unix-88/OPP.h | 4 +- bootstrap/unix-88/OPS.c | 60 ++--- bootstrap/unix-88/OPS.h | 8 +- bootstrap/unix-88/OPT.c | 280 ++++++++++----------- bootstrap/unix-88/OPT.h | 58 ++--- bootstrap/unix-88/OPV.c | 84 +++---- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Out.c | 82 +++---- bootstrap/unix-88/Out.h | 10 +- bootstrap/unix-88/Platform.c | 252 +++++++++---------- bootstrap/unix-88/Platform.h | 104 ++++---- bootstrap/unix-88/Reals.c | 70 +++--- bootstrap/unix-88/Reals.h | 16 +- bootstrap/unix-88/Strings.c | 56 ++--- bootstrap/unix-88/Strings.h | 14 +- bootstrap/unix-88/Texts.c | 354 +++++++++++++-------------- bootstrap/unix-88/Texts.h | 118 ++++----- bootstrap/unix-88/VT100.c | 98 ++++---- bootstrap/unix-88/VT100.h | 36 +-- bootstrap/unix-88/errors.c | 10 +- bootstrap/unix-88/errors.h | 2 +- bootstrap/unix-88/extTools.c | 12 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/windows-48/Compiler.c | 14 +- bootstrap/windows-48/Configuration.c | 12 +- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Files.c | 234 +++++++++--------- bootstrap/windows-48/Files.h | 68 ++--- bootstrap/windows-48/Heap.c | 266 ++++++++++---------- bootstrap/windows-48/Heap.h | 16 +- bootstrap/windows-48/Modules.c | 26 +- bootstrap/windows-48/Modules.h | 14 +- bootstrap/windows-48/OPB.c | 166 ++++++------- bootstrap/windows-48/OPB.h | 22 +- bootstrap/windows-48/OPC.c | 241 +++++++++--------- bootstrap/windows-48/OPC.h | 20 +- bootstrap/windows-48/OPM.c | 198 +++++++-------- bootstrap/windows-48/OPM.h | 50 ++-- bootstrap/windows-48/OPP.c | 106 ++++---- bootstrap/windows-48/OPP.h | 4 +- bootstrap/windows-48/OPS.c | 60 ++--- bootstrap/windows-48/OPS.h | 8 +- bootstrap/windows-48/OPT.c | 278 ++++++++++----------- bootstrap/windows-48/OPT.h | 58 ++--- bootstrap/windows-48/OPV.c | 84 +++---- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Out.c | 82 +++---- bootstrap/windows-48/Out.h | 10 +- bootstrap/windows-48/Platform.c | 310 +++++++++++------------ bootstrap/windows-48/Platform.h | 110 ++++----- bootstrap/windows-48/Reals.c | 70 +++--- bootstrap/windows-48/Reals.h | 16 +- bootstrap/windows-48/Strings.c | 56 ++--- bootstrap/windows-48/Strings.h | 14 +- bootstrap/windows-48/Texts.c | 354 +++++++++++++-------------- bootstrap/windows-48/Texts.h | 116 ++++----- bootstrap/windows-48/VT100.c | 98 ++++---- bootstrap/windows-48/VT100.h | 36 +-- bootstrap/windows-48/errors.c | 10 +- bootstrap/windows-48/errors.h | 2 +- bootstrap/windows-48/extTools.c | 12 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-88/Compiler.c | 14 +- bootstrap/windows-88/Configuration.c | 12 +- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Files.c | 234 +++++++++--------- bootstrap/windows-88/Files.h | 72 +++--- bootstrap/windows-88/Heap.c | 268 ++++++++++---------- bootstrap/windows-88/Heap.h | 16 +- bootstrap/windows-88/Modules.c | 26 +- bootstrap/windows-88/Modules.h | 14 +- bootstrap/windows-88/OPB.c | 166 ++++++------- bootstrap/windows-88/OPB.h | 22 +- bootstrap/windows-88/OPC.c | 241 +++++++++--------- bootstrap/windows-88/OPC.h | 20 +- bootstrap/windows-88/OPM.c | 198 +++++++-------- bootstrap/windows-88/OPM.h | 50 ++-- bootstrap/windows-88/OPP.c | 106 ++++---- bootstrap/windows-88/OPP.h | 4 +- bootstrap/windows-88/OPS.c | 60 ++--- bootstrap/windows-88/OPS.h | 8 +- bootstrap/windows-88/OPT.c | 280 ++++++++++----------- bootstrap/windows-88/OPT.h | 58 ++--- bootstrap/windows-88/OPV.c | 84 +++---- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Out.c | 82 +++---- bootstrap/windows-88/Out.h | 10 +- bootstrap/windows-88/Platform.c | 310 +++++++++++------------ bootstrap/windows-88/Platform.h | 110 ++++----- bootstrap/windows-88/Reals.c | 70 +++--- bootstrap/windows-88/Reals.h | 16 +- bootstrap/windows-88/Strings.c | 56 ++--- bootstrap/windows-88/Strings.h | 14 +- bootstrap/windows-88/Texts.c | 354 +++++++++++++-------------- bootstrap/windows-88/Texts.h | 118 ++++----- bootstrap/windows-88/VT100.c | 98 ++++---- bootstrap/windows-88/VT100.h | 36 +-- bootstrap/windows-88/errors.c | 10 +- bootstrap/windows-88/errors.h | 2 +- bootstrap/windows-88/extTools.c | 12 +- bootstrap/windows-88/extTools.h | 2 +- doc/Features.md | 45 ++-- src/compiler/OPC.Mod | 57 +++-- src/compiler/OPV.Mod | 2 +- src/runtime/Platformunix.Mod | 8 +- src/runtime/Platformwindows.Mod | 44 ++-- src/runtime/SYSTEM.c | 75 +++--- src/runtime/SYSTEM.h | 160 ++++++------ 205 files changed, 8388 insertions(+), 8311 deletions(-) diff --git a/ReadMe.md b/ReadMe.md index fa3f6ffe..30d63d60 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -27,7 +27,10 @@ default libraries complying with the Oakwood Guidelines for Oberon-2 compilers. ## Installation -###### Prerequisites +While pre-built packages are not provided, it is easy to install the Oberon compiler and libraries +with the following simple steps. + +###### 1. Install prerequisites | Platform | Packages | | --------- | ------------ | @@ -39,7 +42,7 @@ default libraries complying with the Oakwood Guidelines for Oberon-2 compilers. More details, including for MingW and MS C, in [**Installation**](/doc/Installation.md). -###### Build and install +###### 2. Build and install the compiler and libraries 1. `git clone https://github.com/vishaps/voc` 2. `cd voc` @@ -47,7 +50,7 @@ More details, including for MingW and MS C, in [**Installation**](/doc/Installat Since 'make full' will install the compiler and libraries, it needs root (unix) or administrator (windows) privileges. -###### PATH environment variable +###### 3. Stet your PATH environment variable Set your path to the installed compiler binary location as reported by make full, e.g. @@ -61,6 +64,7 @@ by make full, e.g. Also see [**Installation**](/doc/Installation.md). + ## A 'Hello' application Anything appended to Oberon.Log is automatically written to stdout, so the diff --git a/bootstrap/SYSTEM.c b/bootstrap/SYSTEM.c index b97144e7..a1b2cb14 100644 --- a/bootstrap/SYSTEM.c +++ b/bootstrap/SYSTEM.c @@ -24,7 +24,7 @@ -int64 SYSTEM_DIV(int64 x, int64 y) +INT64 SYSTEM_DIV(INT64 x, INT64 y) { if (x == 0) return 0; if (x >= 0) @@ -35,7 +35,7 @@ int64 SYSTEM_DIV(int64 x, int64 y) else {return (-x)/(-y);} } -int64 SYSTEM_MOD(int64 x, int64 y) +INT64 SYSTEM_MOD(INT64 x, INT64 y) { if (x == 0) return 0; if (x >= 0) @@ -46,31 +46,20 @@ int64 SYSTEM_MOD(int64 x, int64 y) else {return -((-x) % (-y));} } -// LONGINT SYSTEM_ENTIER(double x) -// { -// LONGINT y; -// if (x >= 0) -// return (LONGINT)x; -// else { -// y = (LONGINT)x; -// if (y <= x) return y; else return y - 1; -// } -// } - -int64 SYSTEM_ENTIER(double x) +INT64 SYSTEM_ENTIER(double x) { - int64 y; + INT64 y; if (x >= 0) - return (int64)x; + return (INT64)x; else { - y = (int64)x; + y = (INT64)x; if (y <= x) return y; else return y - 1; } } -void SYSTEM_INHERIT(address *t, address *t0) +void SYSTEM_INHERIT(ADDRESS *t, ADDRESS *t0) { t -= __TPROC0OFF; t0 -= __TPROC0OFF; @@ -78,23 +67,23 @@ void SYSTEM_INHERIT(address *t, address *t0) } -void SYSTEM_ENUMP(void *adr, address n, void (*P)()) +void SYSTEM_ENUMP(void *adr, ADDRESS n, void (*P)()) { while (n > 0) { - P((address)(*((void**)(adr)))); + P((ADDRESS)(*((void**)(adr)))); adr = ((void**)adr) + 1; n--; } } -void SYSTEM_ENUMR(void *adr, address *typ, address size, address n, void (*P)()) +void SYSTEM_ENUMR(void *adr, ADDRESS *typ, ADDRESS size, ADDRESS n, void (*P)()) { - address *t, off; + ADDRESS *t, off; typ++; while (n > 0) { t = typ; off = *t; - while (off >= 0) {P(*(address*)((char*)adr+off)); t++; off = *t;} + while (off >= 0) {P(*(ADDRESS*)((char*)adr+off)); t++; off = *t;} adr = ((char*)adr) + size; n--; } @@ -103,19 +92,19 @@ void SYSTEM_ENUMR(void *adr, address *typ, address size, address n, void (*P)()) extern void Heap_Lock(); extern void Heap_Unlock(); -SYSTEM_PTR SYSTEM_NEWARR(address *typ, address elemsz, int elemalgn, int nofdim, int nofdyn, ...) +SYSTEM_PTR SYSTEM_NEWARR(ADDRESS *typ, ADDRESS elemsz, int elemalgn, int nofdim, int nofdyn, ...) { - address nofelems, size, dataoff, n, nptr, *x, *p, nofptrs, i, *ptab, off; + ADDRESS nofelems, size, dataoff, n, nptr, *x, *p, nofptrs, i, *ptab, off; va_list ap; va_start(ap, nofdyn); nofelems = 1; while (nofdim > 0) { - nofelems = nofelems * va_arg(ap, address); nofdim--; + nofelems = nofelems * va_arg(ap, ADDRESS); nofdim--; if (nofelems <= 0) __HALT(-20); } va_end(ap); - dataoff = nofdyn * sizeof(address); - if (elemalgn > sizeof(address)) { + dataoff = nofdyn * sizeof(ADDRESS); + if (elemalgn > sizeof(ADDRESS)) { n = dataoff % elemalgn; if (n != 0) dataoff += elemalgn - n; } @@ -125,37 +114,37 @@ SYSTEM_PTR SYSTEM_NEWARR(address *typ, address elemsz, int elemalgn, int nofdim, /* element typ does not contain pointers */ x = Heap_NEWBLK(size); } - else if (typ == (address*)POINTER__typ) { + else if (typ == (ADDRESS*)POINTER__typ) { /* element type is a pointer */ - x = Heap_NEWBLK(size + nofelems * sizeof(address)); - p = (address*)(address)x[-1]; + x = Heap_NEWBLK(size + nofelems * sizeof(ADDRESS)); + p = (ADDRESS*)(ADDRESS)x[-1]; p[-nofelems] = *p; /* build new type desc in situ: 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nofelems - 1; n = 1; /* n =1 for skipping the size field */ - while (n <= nofelems) {*p = n*sizeof(address); p++; n++;} - *p = - (nofelems + 1) * sizeof(address); /* sentinel */ - x[-1] -= nofelems * sizeof(address); + while (n <= nofelems) {*p = n*sizeof(ADDRESS); p++; n++;} + *p = - (nofelems + 1) * sizeof(ADDRESS); /* sentinel */ + x[-1] -= nofelems * sizeof(ADDRESS); } else { /* element type is a record that contains pointers */ ptab = typ + 1; nofptrs = 0; while (ptab[nofptrs] >= 0) {nofptrs++;} /* number of pointers per element */ nptr = nofelems * nofptrs; /* total number of pointers */ - x = Heap_NEWBLK(size + nptr * sizeof(address)); - p = (address*)(address)x[- 1]; + x = Heap_NEWBLK(size + nptr * sizeof(ADDRESS)); + p = (ADDRESS*)(ADDRESS)x[- 1]; p[-nptr] = *p; /* build new type desc in situ; 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nptr - 1; n = 0; off = dataoff; while (n < nofelems) {i = 0; while (i < nofptrs) {*p = off + ptab[i]; p++; i++;} off += elemsz; n++; } - *p = - (nptr + 1) * sizeof(address); /* sentinel */ - x[-1] -= nptr * sizeof(address); + *p = - (nptr + 1) * sizeof(ADDRESS); /* sentinel */ + x[-1] -= nptr * sizeof(ADDRESS); } if (nofdyn != 0) { /* setup len vector for index checks */ va_start(ap, nofdyn); p = x; - while (nofdyn > 0) {*p = va_arg(ap, address); p++, nofdyn--;} + while (nofdyn > 0) {*p = va_arg(ap, ADDRESS); p++, nofdyn--;} va_end(ap); } Heap_Unlock(); @@ -165,7 +154,7 @@ SYSTEM_PTR SYSTEM_NEWARR(address *typ, address elemsz, int elemalgn, int nofdim, -typedef void (*SystemSignalHandler)(int32); // = Platform_SignalHandler +typedef void (*SystemSignalHandler)(INT32); // = Platform_SignalHandler #ifndef _WIN32 @@ -177,7 +166,7 @@ typedef void (*SystemSignalHandler)(int32); // = Platform_SignalHandler // (Ignore other signals) } - void SystemSetHandler(int s, address h) { + void SystemSetHandler(int s, ADDRESS h) { if (s >= 2 && s <= 4) { int needtosetsystemhandler = handler[s-2] == 0; handler[s-2] = (SystemSignalHandler)h; @@ -216,12 +205,12 @@ typedef void (*SystemSignalHandler)(int32); // = Platform_SignalHandler } } - void SystemSetInterruptHandler(address h) { + void SystemSetInterruptHandler(ADDRESS h) { EnsureConsoleCtrlHandler(); SystemInterruptHandler = (SystemSignalHandler)h; } - void SystemSetQuitHandler(address h) { + void SystemSetQuitHandler(ADDRESS h) { EnsureConsoleCtrlHandler(); SystemQuitHandler = (SystemSignalHandler)h; } diff --git a/bootstrap/SYSTEM.h b/bootstrap/SYSTEM.h index cb7c8815..481cded9 100644 --- a/bootstrap/SYSTEM.h +++ b/bootstrap/SYSTEM.h @@ -33,22 +33,22 @@ void *alloca(size_t size); #if defined (o__64) && !defined(_WIN64) // LP64 - typedef long int64; - typedef unsigned long uint64; + typedef long INT64; + typedef unsigned long UINT64; #else // ILP32 or LLP64 - typedef long long int64; - typedef unsigned long long uint64; + typedef long long INT64; + typedef unsigned long long UINT64; #endif -typedef int int32; -typedef unsigned int uint32; +typedef int INT32; +typedef unsigned int UINT32; -typedef short int int16; -typedef unsigned short int uint16; +typedef short int INT16; +typedef unsigned short int UINT16; -typedef signed char int8; -typedef unsigned char uint8; +typedef signed char INT8; +typedef unsigned char UINT8; // The compiler uses 'import' and 'export' which translate to 'extern' and @@ -63,29 +63,41 @@ typedef unsigned char uint8; #define NIL ((void*)0) #define __MAXEXT 16 -#define POINTER__typ ((address*)(1)) // not NIL and not a valid type +#define POINTER__typ ((ADDRESS*)(1)) // not NIL and not a valid type // Oberon types -typedef int8 BOOLEAN; -typedef int8 SYSTEM_BYTE; -typedef uint8 CHAR; +typedef INT8 BOOLEAN; +typedef INT8 SYSTEM_BYTE; +typedef UINT8 CHAR; typedef float REAL; typedef double LONGREAL; typedef void* SYSTEM_PTR; -// 'address' is a synonym for an int of pointer size +// 'ADDRESS' is a synonym for an integer of pointer size #if defined (o__64) - #define address int64 + #define ADDRESS INT64 #else - #define address int32 + #define ADDRESS INT32 #endif +// Temporary build support - which changing lowercase int* and address to uppercase + +#define int8 INT8 +#define int16 INT16 +#define int32 INT32 +#define int64 INT64 +#define uint8 UINT8 +#define uint16 UINT16 +#define uint32 UINT32 +#define uint64 UINT64 +#define address ADDRESS + @@ -96,30 +108,30 @@ typedef void* SYSTEM_PTR; // OS Memory allocation interfaces are in PlatformXXX.Mod -extern address Platform_OSAllocate (address size); -extern void Platform_OSFree (address addr); +extern ADDRESS Platform_OSAllocate (ADDRESS size); +extern void Platform_OSFree (ADDRESS addr); // Assertions and Halts -extern void Platform_Halt(int32 x); -extern void Platform_AssertFail(int32 x); +extern void Platform_Halt(INT32 x); +extern void Platform_AssertFail(INT32 x); #define __HALT(x) Platform_Halt(x) -#define __ASSERT(cond, x) if (!(cond)) Platform_AssertFail((int32)(x)) +#define __ASSERT(cond, x) if (!(cond)) Platform_AssertFail((INT32)(x)) // Index checking -static inline int64 __XF(uint64 i, uint64 ub) {if (i >= ub) {__HALT(-2);} return i;} +static inline INT64 __XF(UINT64 i, UINT64 ub) {if (i >= ub) {__HALT(-2);} return i;} #define __X(i, ub) (((i)<(ub))?i:(__HALT(-2),0)) // Range checking, and checked SHORT and CHR functions -static inline int64 __RF(uint64 i, uint64 ub) {if (i >= ub) {__HALT(-8);} return i;} +static inline INT64 __RF(UINT64 i, UINT64 ub) {if (i >= ub) {__HALT(-8);} return i;} #define __R(i, ub) (((i)<(ub))?i:(__HALT(-8),0)) -#define __SHORT(x, ub) ((int)((uint64)(x)+(ub)<(ub)+(ub)?(x):(__HALT(-8),0))) +#define __SHORT(x, ub) ((int)((UINT64)(x)+(ub)<(ub)+(ub)?(x):(__HALT(-8),0))) #define __SHORTF(x, ub) ((int)(__RF((x)+(ub),(ub)+(ub))-(ub))) #define __CHR(x) ((CHAR)__R(x, 256)) #define __CHRF(x) ((CHAR)__RF(x, 256)) @@ -129,10 +141,10 @@ static inline int64 __RF(uint64 i, uint64 ub) {if (i >= ub) {__HALT(-8);} return // Signal handling in SYSTEM.c #ifndef _WIN32 - extern void SystemSetHandler(int s, address h); + extern void SystemSetHandler(int s, ADDRESS h); #else - extern void SystemSetInterruptHandler(address h); - extern void SystemSetQuitHandler (address h); + extern void SystemSetInterruptHandler(ADDRESS h); + extern void SystemSetQuitHandler (ADDRESS h); #endif @@ -140,7 +152,7 @@ static inline int64 __RF(uint64 i, uint64 ub) {if (i >= ub) {__HALT(-8);} return // String comparison static inline int __str_cmp(CHAR *x, CHAR *y){ - int64 i = 0; + INT64 i = 0; CHAR ch1, ch2; do {ch1 = x[i]; ch2 = y[i]; i++; if (!ch1) return -(int)ch2; @@ -164,8 +176,8 @@ static inline int __str_cmp(CHAR *x, CHAR *y){ #define __VAL(t, x) (*(t*)&(x)) -#define __GET(a, x, t) x=*(t*)(address)(a) -#define __PUT(a, x, t) *(t*)(address)(a)=x +#define __GET(a, x, t) x=*(t*)(ADDRESS)(a) +#define __PUT(a, x, t) *(t*)(ADDRESS)(a)=x #define __LSHL(x, n, s) ((int##s)((uint##s)(x)<<(n))) #define __LSHR(x, n, s) ((int##s)((uint##s)(x)>>(n))) @@ -175,34 +187,34 @@ static inline int __str_cmp(CHAR *x, CHAR *y){ #define __ROTR(x, n, s) ((int##s)((uint##s)(x)>>(n)|(uint##s)(x)<<(s-(n)))) #define __ROT(x, n, s) ((n)>=0? __ROTL(x, n, s): __ROTR(x, -(n), s)) -#define __ASHL(x, n) ((int64)(x)<<(n)) -#define __ASHR(x, n) ((int64)(x)>>(n)) +#define __ASHL(x, n) ((INT64)(x)<<(n)) +#define __ASHR(x, n) ((INT64)(x)>>(n)) #define __ASH(x, n) ((n)>=0?__ASHL(x,n):__ASHR(x,-(n))) -static inline int64 SYSTEM_ASH(int64 x, int64 n) {return __ASH(x,n);} -#define __ASHF(x, n) SYSTEM_ASH((int64)(x), (int64)(n)) +static inline INT64 SYSTEM_ASH(INT64 x, INT64 n) {return __ASH(x,n);} +#define __ASHF(x, n) SYSTEM_ASH((INT64)(x), (INT64)(n)) -#define __MOVE(s, d, n) memcpy((char*)(address)(d),(char*)(address)(s),n) +#define __MOVE(s, d, n) memcpy((char*)(ADDRESS)(d),(char*)(ADDRESS)(s),n) -extern int64 SYSTEM_DIV(int64 x, int64 y); +extern INT64 SYSTEM_DIV(INT64 x, INT64 y); #define __DIVF(x, y) SYSTEM_DIV(x, y) #define __DIV(x, y) (((x)>0 && (y)>0) ? (x)/(y) : __DIVF(x, y)) -extern int64 SYSTEM_MOD(int64 x, int64 y); +extern INT64 SYSTEM_MOD(INT64 x, INT64 y); #define __MODF(x, y) SYSTEM_MOD(x, y) #define __MOD(x, y) (((x)>0 && (y)>0) ? (x)%(y) : __MODF(x, y)) -extern int64 SYSTEM_ENTIER (double x); +extern INT64 SYSTEM_ENTIER (double x); #define __ENTIER(x) SYSTEM_ENTIER(x) #define __ABS(x) (((x)<0)?-(x):(x)) -static inline int32 SYSTEM_ABS64(int64 i) {return i >= 0 ? i : -i;} -static inline int64 SYSTEM_ABS32(int32 i) {return i >= 0 ? i : -i;} -#define __ABSF(x) ((sizeof(x) <= 4) ? SYSTEM_ABS32(i) : SYSTEM_ABS64(i)) +static inline INT32 SYSTEM_ABS64(INT64 i) {return i >= 0 ? i : -i;} +static inline INT64 SYSTEM_ABS32(INT32 i) {return i >= 0 ? i : -i;} +#define __ABSF(x) ((sizeof(x) <= 4) ? SYSTEM_ABS32(x) : SYSTEM_ABS64(x)) static inline double SYSTEM_ABSD(double i) {return i >= 0.0 ? i : -i;} #define __ABSFD(x) SYSTEM_ABSD(x) @@ -216,7 +228,7 @@ static inline double SYSTEM_ABSD(double i) {return i >= 0.0 ? i : -i;} #define __SETRNG(l, h, size) ((~(uint##size)0<<(l))&~(uint##size)0>>(size-1-(h))) #define __MASK(x, m) ((x)&~(m)) -#define __BIT(x, n) (*(uint64*)(x)>>(n)&1) +#define __BIT(x, n) (*(UINT64*)(x)>>(n)&1) @@ -227,8 +239,8 @@ static inline double SYSTEM_ABSD(double i) {return i >= 0.0 ? i : -i;} #define __WITHCHK __HALT(-7) -#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(address)typ##__typ) -#define __TYPEOF(p) (*(((address**)(p))-1)) +#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(ADDRESS)typ##__typ) +#define __TYPEOF(p) (*(((ADDRESS**)(p))-1)) #define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) @@ -257,67 +269,67 @@ extern void Heap_INCREF(); // Main module initialisation, registration and finalisation -extern void Platform_Init(int32 argc, address argv); +extern void Platform_Init(INT32 argc, ADDRESS argv); extern void Heap_FINALL(); -#define __INIT(argc, argv) static void *m; Platform_Init(argc, (address)&argv); +#define __INIT(argc, argv) static void *m; Platform_Init(argc, (ADDRESS)&argv); #define __REGMAIN(name, enum) m = Heap_REGMOD((CHAR*)name,enum) #define __FINI Heap_FINALL(); return 0 // Memory allocation -extern SYSTEM_PTR Heap_NEWBLK (address size); -extern SYSTEM_PTR Heap_NEWREC (address tag); -extern SYSTEM_PTR SYSTEM_NEWARR(address*, address, int, int, int, ...); +extern SYSTEM_PTR Heap_NEWBLK (ADDRESS size); +extern SYSTEM_PTR Heap_NEWREC (ADDRESS tag); +extern SYSTEM_PTR SYSTEM_NEWARR(ADDRESS*, ADDRESS, int, int, int, ...); -#define __SYSNEW(p, len) p = Heap_NEWBLK((address)(len)) -#define __NEW(p, t) p = Heap_NEWREC((address)t##__typ) +#define __SYSNEW(p, len) p = Heap_NEWBLK((ADDRESS)(len)) +#define __NEW(p, t) p = Heap_NEWREC((ADDRESS)t##__typ) #define __NEWARR SYSTEM_NEWARR /* Type handling */ -extern void SYSTEM_INHERIT(address *t, address *t0); -extern void SYSTEM_ENUMP (void *adr, address n, void (*P)()); -extern void SYSTEM_ENUMR (void *adr, address *typ, address size, address n, void (*P)()); +extern void SYSTEM_INHERIT(ADDRESS *t, ADDRESS *t0); +extern void SYSTEM_ENUMP (void *adr, ADDRESS n, void (*P)()); +extern void SYSTEM_ENUMR (void *adr, ADDRESS *typ, ADDRESS size, ADDRESS n, void (*P)()); #define __TDESC(t, m, n) \ static struct t##__desc { \ - address tproc[m]; /* Proc for each ptr field */ \ - address tag; \ - address next; /* Module table type list points here */ \ - address level; \ - address module; \ + ADDRESS tproc[m]; /* Proc for each ptr field */ \ + ADDRESS tag; \ + ADDRESS next; /* Module table type list points here */ \ + ADDRESS level; \ + ADDRESS module; \ char name[24]; \ - address basep[__MAXEXT]; /* List of bases this extends */ \ - address reserved; \ - address blksz; /* xxx_typ points here */ \ - address ptr[n+1]; /* Offsets of ptrs up to -ve sentinel */ \ + ADDRESS basep[__MAXEXT]; /* List of bases this extends */ \ + ADDRESS reserved; \ + ADDRESS blksz; /* xxx_typ points here */ \ + ADDRESS ptr[n+1]; /* Offsets of ptrs up to -ve sentinel */ \ } t##__desc #define __BASEOFF (__MAXEXT+1) // blksz as index to base. -#define __TPROC0OFF (__BASEOFF+24/sizeof(address)+5) // blksz as index to tproc IFF m=1. +#define __TPROC0OFF (__BASEOFF+24/sizeof(ADDRESS)+5) // blksz as index to tproc IFF m=1. #define __EOM 1 #define __TDFLDS(name, size) {__EOM}, 1, 0, 0, 0, name, {0}, 0, size -#define __ENUMP(adr, n, P) SYSTEM_ENUMP(adr, (address)(n), P) -#define __ENUMR(adr, typ, size, n, P) SYSTEM_ENUMR(adr, typ, (address)(size), (address)(n), P) +#define __ENUMP(adr, n, P) SYSTEM_ENUMP(adr, (ADDRESS)(n), P) +#define __ENUMR(adr, typ, size, n, P) SYSTEM_ENUMR(adr, typ, (ADDRESS)(size), (ADDRESS)(n), P) #define __INITYP(t, t0, level) \ - t##__typ = (address*)&t##__desc.blksz; \ - memcpy(t##__desc.basep, t0##__typ - __BASEOFF, level*sizeof(address)); \ - t##__desc.basep[level] = (address)t##__typ; \ - t##__desc.module = (address)m; \ + t##__typ = (ADDRESS*)&t##__desc.blksz; \ + memcpy(t##__desc.basep, t0##__typ - __BASEOFF, level*sizeof(ADDRESS)); \ + t##__desc.basep[level] = (ADDRESS)t##__typ; \ + t##__desc.module = (ADDRESS)m; \ if(t##__desc.blksz!=sizeof(struct t)) __HALT(-15); \ - t##__desc.blksz = (t##__desc.blksz+5*sizeof(address)-1)/(4*sizeof(address))*(4*sizeof(address)); \ - Heap_REGTYP(m, (address)&t##__desc.next); \ + t##__desc.blksz = (t##__desc.blksz+5*sizeof(ADDRESS)-1)/(4*sizeof(ADDRESS))*(4*sizeof(ADDRESS)); \ + Heap_REGTYP(m, (ADDRESS)&t##__desc.next); \ SYSTEM_INHERIT(t##__typ, t0##__typ) // Oberon-2 type bound procedures support -#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(address)proc -#define __SEND(typ, num, funtyp, parlist) ((funtyp)((address)*(typ-(__TPROC0OFF+num))))parlist +#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(ADDRESS)proc +#define __SEND(typ, num, funtyp, parlist) ((funtyp)((ADDRESS)*(typ-(__TPROC0OFF+num))))parlist diff --git a/bootstrap/unix-44/Compiler.c b/bootstrap/unix-44/Compiler.c index 759e721b..86c4c1fd 100644 --- a/bootstrap/unix-44/Compiler.c +++ b/bootstrap/unix-44/Compiler.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "Configuration.h" @@ -26,7 +26,7 @@ static CHAR Compiler_mname[256]; export void Compiler_Module (BOOLEAN *done); static void Compiler_PropagateElementaryTypeSizes (void); export void Compiler_Translate (void); -static void Compiler_Trap (int32 sig); +static void Compiler_Trap (INT32 sig); void Compiler_Module (BOOLEAN *done) @@ -147,7 +147,7 @@ void Compiler_Translate (void) } } -static void Compiler_Trap (int32 sig) +static void Compiler_Trap (INT32 sig) { Heap_FINALL(); if (sig == 3) { diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index 95ddb569..3f8c68d8 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index f6a548e4..6abf2414 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index ddeec08e..998a53d3 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "Heap.h" @@ -18,7 +18,7 @@ typedef struct Files_BufDesc { Files_File f; BOOLEAN chg; - int32 org, size; + INT32 org, size; SYSTEM_BYTE data[4096]; } Files_BufDesc; @@ -33,85 +33,85 @@ typedef Files_FileName workName, registerName; BOOLEAN tempFile; Platform_FileIdentity identity; - int32 fd, len, pos; + INT32 fd, len, pos; Files_Buffer bufs[4]; - int16 swapper, state; + INT16 swapper, state; Files_File next; } Files_FileDesc; typedef struct Files_Rider { - int32 res; + INT32 res; BOOLEAN eof; Files_Buffer buf; - int32 org, offset; + INT32 org, offset; } Files_Rider; static Files_File Files_files; -static int16 Files_tempno; +static INT16 Files_tempno; static CHAR Files_HOME[1024]; static struct { LONGINT len[1]; CHAR data[1]; } *Files_SearchPath; -export address *Files_FileDesc__typ; -export address *Files_BufDesc__typ; -export address *Files_Rider__typ; +export ADDRESS *Files_FileDesc__typ; +export ADDRESS *Files_BufDesc__typ; +export ADDRESS *Files_Rider__typ; -export Files_File Files_Base (Files_Rider *r, address *r__typ); +export Files_File Files_Base (Files_Rider *r, ADDRESS *r__typ); static Files_File Files_CacheEntry (Platform_FileIdentity identity); -export void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int16 *res); +export void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INT16 *res); export void Files_Close (Files_File f); static void Files_CloseOSFile (Files_File f); static void Files_Create (Files_File f); -export void Files_Delete (CHAR *name, LONGINT name__len, int16 *res); -static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int16 errcode); +export void Files_Delete (CHAR *name, LONGINT name__len, INT16 *res); +static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INT16 errcode); static void Files_Finalize (SYSTEM_PTR o); static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *dest, LONGINT dest__len); static void Files_Flush (Files_Buffer buf); -export void Files_GetDate (Files_File f, int32 *t, int32 *d); +export void Files_GetDate (Files_File f, INT32 *t, INT32 *d); export void Files_GetName (Files_File f, CHAR *name, LONGINT name__len); static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *name, LONGINT name__len); static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len); -export int32 Files_Length (Files_File f); +export INT32 Files_Length (Files_File f); static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT name__len, CHAR *dest, LONGINT dest__len); export Files_File Files_New (CHAR *name, LONGINT name__len); export Files_File Files_Old (CHAR *name, LONGINT name__len); -export int32 Files_Pos (Files_Rider *r, address *r__typ); +export INT32 Files_Pos (Files_Rider *r, ADDRESS *r__typ); export void Files_Purge (Files_File f); -export void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x); -export void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x); -export void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); -export void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x); -export void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); -export void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); -export void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); -export void Files_ReadNum (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len); -export void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); -export void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x); -export void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); +export void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x); +export void Files_ReadBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN *x); +export void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n); +export void Files_ReadInt (Files_Rider *R, ADDRESS *R__typ, INT16 *x); +export void Files_ReadLInt (Files_Rider *R, ADDRESS *R__typ, INT32 *x); +export void Files_ReadLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL *x); +export void Files_ReadLine (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); +export void Files_ReadNum (Files_Rider *R, ADDRESS *R__typ, SYSTEM_BYTE *x, LONGINT x__len); +export void Files_ReadReal (Files_Rider *R, ADDRESS *R__typ, REAL *x); +export void Files_ReadSet (Files_Rider *R, ADDRESS *R__typ, UINT32 *x); +export void Files_ReadString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); export void Files_Register (Files_File f); -export void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res); -static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len); -export void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos); +export void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT16 *res); +static void Files_ScanPath (INT16 *pos, CHAR *dir, LONGINT dir__len); +export void Files_Set (Files_Rider *r, ADDRESS *r__typ, Files_File f, INT32 pos); export void Files_SetSearchPath (CHAR *path, LONGINT path__len); -export void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x); -export void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x); -export void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); -export void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x); -export void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x); -export void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x); -export void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x); -export void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x); -export void Files_WriteSet (Files_Rider *R, address *R__typ, uint32 x); -export void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); +export void Files_Write (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE x); +export void Files_WriteBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN x); +export void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n); +export void Files_WriteInt (Files_Rider *R, ADDRESS *R__typ, INT16 x); +export void Files_WriteLInt (Files_Rider *R, ADDRESS *R__typ, INT32 x); +export void Files_WriteLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL x); +export void Files_WriteNum (Files_Rider *R, ADDRESS *R__typ, INT64 x); +export void Files_WriteReal (Files_Rider *R, ADDRESS *R__typ, REAL x); +export void Files_WriteSet (Files_Rider *R, ADDRESS *R__typ, UINT32 x); +export void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); #define Files_IdxTrap() __HALT(-1) #define Files_ToAdr(x) (address)x -static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int16 errcode) +static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INT16 errcode) { __DUP(s, s__len, CHAR); Out_Ln(); @@ -140,7 +140,7 @@ static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int16 errcode) static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT name__len, CHAR *dest, LONGINT dest__len) { - int16 i, j; + INT16 i, j; __DUP(dir, dir__len, CHAR); __DUP(name, name__len, CHAR); i = 0; @@ -165,7 +165,7 @@ static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *name, LONGINT name__len) { - int32 n, i, j; + INT32 n, i, j; __DUP(finalName, finalName__len, CHAR); Files_tempno += 1; n = Files_tempno; @@ -217,7 +217,7 @@ static void Files_Create (Files_File f) { Platform_FileIdentity identity; BOOLEAN done; - int16 error; + INT16 error; CHAR err[32]; if (f->fd == -1) { if (f->state == 1) { @@ -254,7 +254,7 @@ static void Files_Create (Files_File f) static void Files_Flush (Files_Buffer buf) { - int16 error; + INT16 error; Files_File f = NIL; if (buf->chg) { f = buf->f; @@ -278,7 +278,7 @@ static void Files_Flush (Files_Buffer buf) static void Files_CloseOSFile (Files_File f) { Files_File prev = NIL; - int16 error; + INT16 error; if (Files_files == f) { Files_files = f->next; } else { @@ -298,8 +298,8 @@ static void Files_CloseOSFile (Files_File f) void Files_Close (Files_File f) { - int32 i; - int16 error; + INT32 i; + INT16 error; if (f->state != 1 || f->registerName[0] != 0x00) { Files_Create(f); i = 0; @@ -315,7 +315,7 @@ void Files_Close (Files_File f) } } -int32 Files_Length (Files_File f) +INT32 Files_Length (Files_File f) { return f->len; } @@ -336,9 +336,9 @@ Files_File Files_New (CHAR *name, LONGINT name__len) return f; } -static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len) +static void Files_ScanPath (INT16 *pos, CHAR *dir, LONGINT dir__len) { - int16 i; + INT16 i; CHAR ch; i = 0; if (Files_SearchPath == NIL) { @@ -381,7 +381,7 @@ static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len) static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len) { - int16 i; + INT16 i; CHAR ch; i = 0; ch = name[0]; @@ -395,7 +395,7 @@ static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len) static Files_File Files_CacheEntry (Platform_FileIdentity identity) { Files_File f = NIL; - int16 i, error; + INT16 i, error; f = Files_files; while (f != NIL) { if (Platform_SameFile(identity, f->identity)) { @@ -422,11 +422,11 @@ static Files_File Files_CacheEntry (Platform_FileIdentity identity) Files_File Files_Old (CHAR *name, LONGINT name__len) { Files_File f = NIL; - int32 fd; - int16 pos; + INT32 fd; + INT16 pos; BOOLEAN done; CHAR dir[256], path[256]; - int16 error; + INT16 error; Platform_FileIdentity identity; __DUP(name, name__len, CHAR); if (name[0] != 0x00) { @@ -497,9 +497,9 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) void Files_Purge (Files_File f) { - int16 i; + INT16 i; Platform_FileIdentity identity; - int16 error; + INT16 error; i = 0; while (i < 4) { if (f->bufs[i] != NIL) { @@ -519,25 +519,25 @@ void Files_Purge (Files_File f) Platform_SetMTime(&f->identity, Platform_FileIdentity__typ, identity); } -void Files_GetDate (Files_File f, int32 *t, int32 *d) +void Files_GetDate (Files_File f, INT32 *t, INT32 *d) { Platform_FileIdentity identity; - int16 error; + INT16 error; Files_Create(f); error = Platform_Identify(f->fd, &identity, Platform_FileIdentity__typ); Platform_MTimeAsClock(identity, &*t, &*d); } -int32 Files_Pos (Files_Rider *r, address *r__typ) +INT32 Files_Pos (Files_Rider *r, ADDRESS *r__typ) { return (*r).org + (*r).offset; } -void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos) +void Files_Set (Files_Rider *r, ADDRESS *r__typ, Files_File f, INT32 pos) { - int32 org, offset, i, n; + INT32 org, offset, i, n; Files_Buffer buf = NIL; - int16 error; + INT16 error; if (f != NIL) { if (pos > f->len) { pos = f->len; @@ -595,9 +595,9 @@ void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos) (*r).res = 0; } -void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x) +void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x) { - int32 offset; + INT32 offset; Files_Buffer buf = NIL; buf = (*r).buf; offset = (*r).offset; @@ -619,9 +619,9 @@ void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x) } } -void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n) +void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n) { - int32 xpos, min, restInBuf, offset; + INT32 xpos, min, restInBuf, offset; Files_Buffer buf = NIL; if (n > x__len) { Files_IdxTrap(); @@ -655,15 +655,15 @@ void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x (*r).eof = 0; } -Files_File Files_Base (Files_Rider *r, address *r__typ) +Files_File Files_Base (Files_Rider *r, ADDRESS *r__typ) { return (*r).buf->f; } -void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x) +void Files_Write (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE x) { Files_Buffer buf = NIL; - int32 offset; + INT32 offset; buf = (*r).buf; offset = (*r).offset; if ((*r).org != buf->org || offset >= 4096) { @@ -681,9 +681,9 @@ void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x) (*r).res = 0; } -void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n) +void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n) { - int32 xpos, min, restInBuf, offset; + INT32 xpos, min, restInBuf, offset; Files_Buffer buf = NIL; if (n > x__len) { Files_IdxTrap(); @@ -717,17 +717,17 @@ void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT (*r).res = 0; } -void Files_Delete (CHAR *name, LONGINT name__len, int16 *res) +void Files_Delete (CHAR *name, LONGINT name__len, INT16 *res) { __DUP(name, name__len, CHAR); *res = Platform_Unlink((void*)name, name__len); __DEL(name); } -void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res) +void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT16 *res) { - int32 fdold, fdnew, n; - int16 error, ignore; + INT32 fdold, fdnew, n; + INT16 error, ignore; Platform_FileIdentity oldidentity, newidentity; CHAR buf[4096]; __DUP(old, old__len, CHAR); @@ -788,7 +788,7 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int void Files_Register (Files_File f) { - int16 idx, errcode; + INT16 idx, errcode; Files_File f1 = NIL; CHAR file[104]; if ((f->state == 1 && f->registerName[0] != 0x00)) { @@ -807,7 +807,7 @@ void Files_Register (Files_File f) } } -void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int16 *res) +void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INT16 *res) { __DUP(path, path__len, CHAR); *res = Platform_Chdir((void*)path, path__len); @@ -816,7 +816,7 @@ void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int16 *res) static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *dest, LONGINT dest__len) { - int32 i, j; + INT32 i, j; if (!Platform_LittleEndian) { i = src__len; j = 0; @@ -830,51 +830,51 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *de } } -void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x) +void Files_ReadBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN *x) { Files_Read(&*R, R__typ, (CHAR*)(void*)&*x); } -void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x) +void Files_ReadInt (Files_Rider *R, ADDRESS *R__typ, INT16 *x) { CHAR b[2]; Files_ReadBytes(&*R, R__typ, (void*)b, 2, 2); - *x = (int16)b[0] + __ASHL((int16)b[1], 8); + *x = (INT16)b[0] + __ASHL((INT16)b[1], 8); } -void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x) +void Files_ReadLInt (Files_Rider *R, ADDRESS *R__typ, INT32 *x) { CHAR b[4]; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); - *x = (((int16)b[0] + __ASHL((int16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); + *x = (((INT16)b[0] + __ASHL((INT16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); } -void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x) +void Files_ReadSet (Files_Rider *R, ADDRESS *R__typ, UINT32 *x) { CHAR b[4]; - int32 l; + INT32 l; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); - l = (((int16)b[0] + __ASHL((int16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); - *x = (uint32)l; + l = (((INT16)b[0] + __ASHL((INT16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); + *x = (UINT32)l; } -void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x) +void Files_ReadReal (Files_Rider *R, ADDRESS *R__typ, REAL *x) { CHAR b[4]; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); Files_FlipBytes((void*)b, 4, (void*)&*x, 4); } -void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x) +void Files_ReadLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL *x) { CHAR b[8]; Files_ReadBytes(&*R, R__typ, (void*)b, 8, 8); Files_FlipBytes((void*)b, 8, (void*)&*x, 8); } -void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) +void Files_ReadString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len) { - int16 i; + INT16 i; CHAR ch; i = 0; do { @@ -884,9 +884,9 @@ void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) } while (!(ch == 0x00)); } -void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) +void Files_ReadLine (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len) { - int16 i; + INT16 i; CHAR ch; BOOLEAN b; i = 0; @@ -902,29 +902,29 @@ void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) } while (!b); } -void Files_ReadNum (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len) +void Files_ReadNum (Files_Rider *R, ADDRESS *R__typ, SYSTEM_BYTE *x, LONGINT x__len) { - int8 s, b; - int64 q; + INT8 s, b; + INT64 q; s = 0; q = 0; Files_Read(&*R, R__typ, (void*)&b); while (b < 0) { - q += (int64)__ASH(((int16)b + 128), s); + q += (INT64)__ASH(((INT16)b + 128), s); s += 7; Files_Read(&*R, R__typ, (void*)&b); } - q += (int64)__ASH((__MASK(b, -64) - __ASHL(__ASHR(b, 6), 6)), s); + q += (INT64)__ASH((__MASK(b, -64) - __ASHL(__ASHR(b, 6), 6)), s); __ASSERT(x__len <= 8, 0); __MOVE((address)&q, (address)x, x__len); } -void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x) +void Files_WriteBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN x) { Files_Write(&*R, R__typ, __VAL(CHAR, x)); } -void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x) +void Files_WriteInt (Files_Rider *R, ADDRESS *R__typ, INT16 x) { CHAR b[2]; b[0] = (CHAR)x; @@ -932,7 +932,7 @@ void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x) Files_WriteBytes(&*R, R__typ, (void*)b, 2, 2); } -void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x) +void Files_WriteLInt (Files_Rider *R, ADDRESS *R__typ, INT32 x) { CHAR b[4]; b[0] = (CHAR)x; @@ -942,11 +942,11 @@ void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x) Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } -void Files_WriteSet (Files_Rider *R, address *R__typ, uint32 x) +void Files_WriteSet (Files_Rider *R, ADDRESS *R__typ, UINT32 x) { CHAR b[4]; - int32 i; - i = (int32)x; + INT32 i; + i = (INT32)x; b[0] = (CHAR)i; b[1] = (CHAR)__ASHR(i, 8); b[2] = (CHAR)__ASHR(i, 16); @@ -954,23 +954,23 @@ void Files_WriteSet (Files_Rider *R, address *R__typ, uint32 x) Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } -void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x) +void Files_WriteReal (Files_Rider *R, ADDRESS *R__typ, REAL x) { CHAR b[4]; Files_FlipBytes((void*)&x, 4, (void*)b, 4); Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } -void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x) +void Files_WriteLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL x) { CHAR b[8]; Files_FlipBytes((void*)&x, 8, (void*)b, 8); Files_WriteBytes(&*R, R__typ, (void*)b, 8, 8); } -void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) +void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len) { - int16 i; + INT16 i; i = 0; while (x[i] != 0x00) { i += 1; @@ -978,7 +978,7 @@ void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len Files_WriteBytes(&*R, R__typ, (void*)x, x__len * 1, i + 1); } -void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x) +void Files_WriteNum (Files_Rider *R, ADDRESS *R__typ, INT64 x) { while (x < -64 || x > 63) { Files_Write(&*R, R__typ, (CHAR)(__MASK(x, -128) + 128)); @@ -995,7 +995,7 @@ void Files_GetName (Files_File f, CHAR *name, LONGINT name__len) static void Files_Finalize (SYSTEM_PTR o) { Files_File f = NIL; - int32 res; + INT32 res; f = (Files_File)(address)o; if (f->fd >= 0) { Files_CloseOSFile(f); diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index 8f575f62..93b5757c 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h @@ -11,58 +11,58 @@ typedef typedef struct Files_FileDesc { char _prvt0[216]; - int32 fd; + INT32 fd; char _prvt1[32]; } Files_FileDesc; typedef struct Files_Rider { - int32 res; + INT32 res; BOOLEAN eof; char _prvt0[15]; } Files_Rider; -import address *Files_FileDesc__typ; -import address *Files_Rider__typ; +import ADDRESS *Files_FileDesc__typ; +import ADDRESS *Files_Rider__typ; -import Files_File Files_Base (Files_Rider *r, address *r__typ); -import void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int16 *res); +import Files_File Files_Base (Files_Rider *r, ADDRESS *r__typ); +import void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INT16 *res); import void Files_Close (Files_File f); -import void Files_Delete (CHAR *name, LONGINT name__len, int16 *res); -import void Files_GetDate (Files_File f, int32 *t, int32 *d); +import void Files_Delete (CHAR *name, LONGINT name__len, INT16 *res); +import void Files_GetDate (Files_File f, INT32 *t, INT32 *d); import void Files_GetName (Files_File f, CHAR *name, LONGINT name__len); -import int32 Files_Length (Files_File f); +import INT32 Files_Length (Files_File f); import Files_File Files_New (CHAR *name, LONGINT name__len); import Files_File Files_Old (CHAR *name, LONGINT name__len); -import int32 Files_Pos (Files_Rider *r, address *r__typ); +import INT32 Files_Pos (Files_Rider *r, ADDRESS *r__typ); import void Files_Purge (Files_File f); -import void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x); -import void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x); -import void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); -import void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x); -import void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); -import void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); -import void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); -import void Files_ReadNum (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len); -import void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); -import void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x); -import void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); +import void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x); +import void Files_ReadBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN *x); +import void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n); +import void Files_ReadInt (Files_Rider *R, ADDRESS *R__typ, INT16 *x); +import void Files_ReadLInt (Files_Rider *R, ADDRESS *R__typ, INT32 *x); +import void Files_ReadLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL *x); +import void Files_ReadLine (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); +import void Files_ReadNum (Files_Rider *R, ADDRESS *R__typ, SYSTEM_BYTE *x, LONGINT x__len); +import void Files_ReadReal (Files_Rider *R, ADDRESS *R__typ, REAL *x); +import void Files_ReadSet (Files_Rider *R, ADDRESS *R__typ, UINT32 *x); +import void Files_ReadString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); import void Files_Register (Files_File f); -import void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res); -import void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos); +import void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT16 *res); +import void Files_Set (Files_Rider *r, ADDRESS *r__typ, Files_File f, INT32 pos); import void Files_SetSearchPath (CHAR *path, LONGINT path__len); -import void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x); -import void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x); -import void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); -import void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x); -import void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x); -import void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x); -import void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x); -import void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x); -import void Files_WriteSet (Files_Rider *R, address *R__typ, uint32 x); -import void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); +import void Files_Write (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE x); +import void Files_WriteBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN x); +import void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n); +import void Files_WriteInt (Files_Rider *R, ADDRESS *R__typ, INT16 x); +import void Files_WriteLInt (Files_Rider *R, ADDRESS *R__typ, INT32 x); +import void Files_WriteLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL x); +import void Files_WriteNum (Files_Rider *R, ADDRESS *R__typ, INT64 x); +import void Files_WriteReal (Files_Rider *R, ADDRESS *R__typ, REAL x); +import void Files_WriteSet (Files_Rider *R, ADDRESS *R__typ, UINT32 x); +import void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); import void *Files__init(void); diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index 4bc74170..ca99053e 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" @@ -40,7 +40,7 @@ typedef typedef struct Heap_FinDesc { Heap_FinNode next; - int32 obj; + INT32 obj; BOOLEAN marked; Heap_Finalizer finalize; } Heap_FinDesc; @@ -55,53 +55,53 @@ typedef struct Heap_ModuleDesc { Heap_Module next; Heap_ModuleName name; - int32 refcnt; + INT32 refcnt; Heap_Cmd cmds; - int32 types; + INT32 types; Heap_EnumProc enumPtrs; - int32 reserved1, reserved2; + INT32 reserved1, reserved2; } Heap_ModuleDesc; export SYSTEM_PTR Heap_modules; -static int32 Heap_freeList[10]; -static int32 Heap_bigBlocks; -export int32 Heap_allocated; +static INT32 Heap_freeList[10]; +static INT32 Heap_bigBlocks; +export INT32 Heap_allocated; static BOOLEAN Heap_firstTry; -static int32 Heap_heap, Heap_heapend; -export int32 Heap_heapsize; +static INT32 Heap_heap, Heap_heapend; +export INT32 Heap_heapsize; static Heap_FinNode Heap_fin; -static int16 Heap_lockdepth; +static INT16 Heap_lockdepth; static BOOLEAN Heap_interrupted; -export int16 Heap_FileCount; +export INT16 Heap_FileCount; -export address *Heap_ModuleDesc__typ; -export address *Heap_CmdDesc__typ; -export address *Heap_FinDesc__typ; -export address *Heap__1__typ; +export ADDRESS *Heap_ModuleDesc__typ; +export ADDRESS *Heap_CmdDesc__typ; +export ADDRESS *Heap_FinDesc__typ; +export ADDRESS *Heap__1__typ; static void Heap_CheckFin (void); -static void Heap_ExtendHeap (int32 blksz); +static void Heap_ExtendHeap (INT32 blksz); export void Heap_FINALL (void); static void Heap_Finalize (void); export void Heap_GC (BOOLEAN markStack); -static void Heap_HeapSort (int32 n, int32 *a, LONGINT a__len); +static void Heap_HeapSort (INT32 n, INT32 *a, LONGINT a__len); export void Heap_INCREF (Heap_Module m); export void Heap_InitHeap (void); export void Heap_Lock (void); -static void Heap_Mark (int32 q); -static void Heap_MarkCandidates (int32 n, int32 *cand, LONGINT cand__len); +static void Heap_Mark (INT32 q); +static void Heap_MarkCandidates (INT32 n, INT32 *cand, LONGINT cand__len); static void Heap_MarkP (SYSTEM_PTR p); -static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len); -export SYSTEM_PTR Heap_NEWBLK (int32 size); -export SYSTEM_PTR Heap_NEWREC (int32 tag); -static int32 Heap_NewChunk (int32 blksz); +static void Heap_MarkStack (INT32 n, INT32 *cand, LONGINT cand__len); +export SYSTEM_PTR Heap_NEWBLK (INT32 size); +export SYSTEM_PTR Heap_NEWREC (INT32 tag); +static INT32 Heap_NewChunk (INT32 blksz); export void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); export SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -export void Heap_REGTYP (Heap_Module m, int32 typ); +export void Heap_REGTYP (Heap_Module m, INT32 typ); export void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); static void Heap_Scan (void); -static void Heap_Sift (int32 l, int32 r, int32 *a, LONGINT a__len); +static void Heap_Sift (INT32 l, INT32 r, INT32 *a, LONGINT a__len); export void Heap_Unlock (void); extern void *Heap__init(); @@ -157,9 +157,9 @@ void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) m->cmds = c; } -void Heap_REGTYP (Heap_Module m, int32 typ) +void Heap_REGTYP (Heap_Module m, INT32 typ) { - __PUT(typ, m->types, int32); + __PUT(typ, m->types, INT32); m->types = typ; } @@ -168,25 +168,25 @@ void Heap_INCREF (Heap_Module m) m->refcnt += 1; } -static int32 Heap_NewChunk (int32 blksz) +static INT32 Heap_NewChunk (INT32 blksz) { - int32 chnk; + INT32 chnk; chnk = Heap_OSAllocate(blksz + 12); if (chnk != 0) { - __PUT(chnk + 4, chnk + (12 + blksz), int32); - __PUT(chnk + 12, chnk + 16, int32); - __PUT(chnk + 16, blksz, int32); - __PUT(chnk + 20, -4, int32); - __PUT(chnk + 24, Heap_bigBlocks, int32); + __PUT(chnk + 4, chnk + (12 + blksz), INT32); + __PUT(chnk + 12, chnk + 16, INT32); + __PUT(chnk + 16, blksz, INT32); + __PUT(chnk + 20, -4, INT32); + __PUT(chnk + 24, Heap_bigBlocks, INT32); Heap_bigBlocks = chnk + 12; Heap_heapsize += blksz; } return chnk; } -static void Heap_ExtendHeap (int32 blksz) +static void Heap_ExtendHeap (INT32 blksz) { - int32 size, chnk, j, next; + INT32 size, chnk, j, next; if (blksz > 160000) { size = blksz; } else { @@ -195,30 +195,30 @@ static void Heap_ExtendHeap (int32 blksz) chnk = Heap_NewChunk(size); if (chnk != 0) { if (chnk < Heap_heap) { - __PUT(chnk, Heap_heap, int32); + __PUT(chnk, Heap_heap, INT32); Heap_heap = chnk; } else { j = Heap_heap; - __GET(j, next, int32); + __GET(j, next, INT32); while ((next != 0 && chnk > next)) { j = next; - __GET(j, next, int32); + __GET(j, next, INT32); } - __PUT(chnk, next, int32); - __PUT(j, chnk, int32); + __PUT(chnk, next, INT32); + __PUT(j, chnk, INT32); } if (next == 0) { - __GET(chnk + 4, Heap_heapend, int32); + __GET(chnk + 4, Heap_heapend, INT32); } } } -SYSTEM_PTR Heap_NEWREC (int32 tag) +SYSTEM_PTR Heap_NEWREC (INT32 tag) { - int32 i, i0, di, blksz, restsize, t, adr, end, next, prev; + INT32 i, i0, di, blksz, restsize, t, adr, end, next, prev; SYSTEM_PTR new; Heap_Lock(); - __GET(tag, blksz, int32); + __GET(tag, blksz, INT32); i0 = __ASHR(blksz, 4); i = i0; if (i < 9) { @@ -229,17 +229,17 @@ SYSTEM_PTR Heap_NEWREC (int32 tag) } } if (i < 9) { - __GET(adr + 12, next, int32); + __GET(adr + 12, next, INT32); Heap_freeList[i] = next; if (i != i0) { di = i - i0; restsize = __ASHL(di, 4); end = adr + restsize; - __PUT(end + 4, blksz, int32); - __PUT(end + 8, -4, int32); - __PUT(end, end + 4, int32); - __PUT(adr + 4, restsize, int32); - __PUT(adr + 12, Heap_freeList[di], int32); + __PUT(end + 4, blksz, INT32); + __PUT(end + 8, -4, INT32); + __PUT(end, end + 4, INT32); + __PUT(adr + 4, restsize, INT32); + __PUT(adr + 12, Heap_freeList[di], INT32); Heap_freeList[di] = adr; adr += restsize; } @@ -268,31 +268,31 @@ SYSTEM_PTR Heap_NEWREC (int32 tag) return NIL; } } - __GET(adr + 4, t, int32); + __GET(adr + 4, t, INT32); if (t >= blksz) { break; } prev = adr; - __GET(adr + 12, adr, int32); + __GET(adr + 12, adr, INT32); } restsize = t - blksz; end = adr + restsize; - __PUT(end + 4, blksz, int32); - __PUT(end + 8, -4, int32); - __PUT(end, end + 4, int32); + __PUT(end + 4, blksz, INT32); + __PUT(end + 8, -4, INT32); + __PUT(end, end + 4, INT32); if (restsize > 144) { - __PUT(adr + 4, restsize, int32); + __PUT(adr + 4, restsize, INT32); } else { - __GET(adr + 12, next, int32); + __GET(adr + 12, next, INT32); if (prev == 0) { Heap_bigBlocks = next; } else { - __PUT(prev + 12, next, int32); + __PUT(prev + 12, next, INT32); } if (restsize > 0) { di = __ASHR(restsize, 4); - __PUT(adr + 4, restsize, int32); - __PUT(adr + 12, Heap_freeList[di], int32); + __PUT(adr + 4, restsize, INT32); + __PUT(adr + 12, Heap_freeList[di], INT32); Heap_freeList[di] = adr; } } @@ -301,69 +301,69 @@ SYSTEM_PTR Heap_NEWREC (int32 tag) i = adr + 16; end = adr + blksz; while (i < end) { - __PUT(i, 0, int32); - __PUT(i + 4, 0, int32); - __PUT(i + 8, 0, int32); - __PUT(i + 12, 0, int32); + __PUT(i, 0, INT32); + __PUT(i + 4, 0, INT32); + __PUT(i + 8, 0, INT32); + __PUT(i + 12, 0, INT32); i += 16; } - __PUT(adr + 12, 0, int32); - __PUT(adr, tag, int32); - __PUT(adr + 4, 0, int32); - __PUT(adr + 8, 0, int32); + __PUT(adr + 12, 0, INT32); + __PUT(adr, tag, INT32); + __PUT(adr + 4, 0, INT32); + __PUT(adr + 8, 0, INT32); Heap_allocated += blksz; Heap_Unlock(); return (SYSTEM_PTR)(address)(adr + 4); } -SYSTEM_PTR Heap_NEWBLK (int32 size) +SYSTEM_PTR Heap_NEWBLK (INT32 size) { - int32 blksz, tag; + INT32 blksz, tag; SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 31, 4), 4); new = Heap_NEWREC((address)&blksz); - tag = ((int32)(address)new + blksz) - 12; - __PUT(tag - 4, 0, int32); - __PUT(tag, blksz, int32); - __PUT(tag + 4, -4, int32); - __PUT((int32)(address)new - 4, tag, int32); + tag = ((INT32)(address)new + blksz) - 12; + __PUT(tag - 4, 0, INT32); + __PUT(tag, blksz, INT32); + __PUT(tag + 4, -4, INT32); + __PUT((INT32)(address)new - 4, tag, INT32); Heap_Unlock(); return new; } -static void Heap_Mark (int32 q) +static void Heap_Mark (INT32 q) { - int32 p, tag, offset, fld, n, tagbits; + INT32 p, tag, offset, fld, n, tagbits; if (q != 0) { - __GET(q - 4, tagbits, int32); + __GET(q - 4, tagbits, INT32); if (!__ODD(tagbits)) { - __PUT(q - 4, tagbits + 1, int32); + __PUT(q - 4, tagbits + 1, INT32); p = 0; tag = tagbits + 4; for (;;) { - __GET(tag, offset, int32); + __GET(tag, offset, INT32); if (offset < 0) { - __PUT(q - 4, (tag + offset) + 1, int32); + __PUT(q - 4, (tag + offset) + 1, INT32); if (p == 0) { break; } n = q; q = p; - __GET(q - 4, tag, int32); + __GET(q - 4, tag, INT32); tag -= 1; - __GET(tag, offset, int32); + __GET(tag, offset, INT32); fld = q + offset; - __GET(fld, p, int32); + __GET(fld, p, INT32); __PUT(fld, (SYSTEM_PTR)(address)n, SYSTEM_PTR); } else { fld = q + offset; - __GET(fld, n, int32); + __GET(fld, n, INT32); if (n != 0) { - __GET(n - 4, tagbits, int32); + __GET(n - 4, tagbits, INT32); if (!__ODD(tagbits)) { - __PUT(n - 4, tagbits + 1, int32); - __PUT(q - 4, tag + 1, int32); + __PUT(n - 4, tagbits + 1, INT32); + __PUT(q - 4, tag + 1, INT32); __PUT(fld, (SYSTEM_PTR)(address)p, SYSTEM_PTR); p = q; q = n; @@ -379,12 +379,12 @@ static void Heap_Mark (int32 q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((int32)(address)p); + Heap_Mark((INT32)(address)p); } static void Heap_Scan (void) { - int32 chnk, adr, end, start, tag, i, size, freesize; + INT32 chnk, adr, end, start, tag, i, size, freesize; Heap_bigBlocks = 0; i = 1; while (i < 9) { @@ -396,58 +396,58 @@ static void Heap_Scan (void) chnk = Heap_heap; while (chnk != 0) { adr = chnk + 12; - __GET(chnk + 4, end, int32); + __GET(chnk + 4, end, INT32); while (adr < end) { - __GET(adr, tag, int32); + __GET(adr, tag, INT32); if (__ODD(tag)) { if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 4, int32); - __PUT(start + 4, freesize, int32); - __PUT(start + 8, -4, int32); + __PUT(start, start + 4, INT32); + __PUT(start + 4, freesize, INT32); + __PUT(start + 8, -4, INT32); i = __ASHR(freesize, 4); freesize = 0; if (i < 9) { - __PUT(start + 12, Heap_freeList[i], int32); + __PUT(start + 12, Heap_freeList[i], INT32); Heap_freeList[i] = start; } else { - __PUT(start + 12, Heap_bigBlocks, int32); + __PUT(start + 12, Heap_bigBlocks, INT32); Heap_bigBlocks = start; } } tag -= 1; - __PUT(adr, tag, int32); - __GET(tag, size, int32); + __PUT(adr, tag, INT32); + __GET(tag, size, INT32); Heap_allocated += size; adr += size; } else { - __GET(tag, size, int32); + __GET(tag, size, INT32); freesize += size; adr += size; } } if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 4, int32); - __PUT(start + 4, freesize, int32); - __PUT(start + 8, -4, int32); + __PUT(start, start + 4, INT32); + __PUT(start + 4, freesize, INT32); + __PUT(start + 8, -4, INT32); i = __ASHR(freesize, 4); freesize = 0; if (i < 9) { - __PUT(start + 12, Heap_freeList[i], int32); + __PUT(start + 12, Heap_freeList[i], INT32); Heap_freeList[i] = start; } else { - __PUT(start + 12, Heap_bigBlocks, int32); + __PUT(start + 12, Heap_bigBlocks, INT32); Heap_bigBlocks = start; } } - __GET(chnk, chnk, int32); + __GET(chnk, chnk, INT32); } } -static void Heap_Sift (int32 l, int32 r, int32 *a, LONGINT a__len) +static void Heap_Sift (INT32 l, INT32 r, INT32 *a, LONGINT a__len) { - int32 i, j, x; + INT32 i, j, x; j = l; x = a[j]; for (;;) { @@ -464,9 +464,9 @@ static void Heap_Sift (int32 l, int32 r, int32 *a, LONGINT a__len) a[i] = x; } -static void Heap_HeapSort (int32 n, int32 *a, LONGINT a__len) +static void Heap_HeapSort (INT32 n, INT32 *a, LONGINT a__len) { - int32 l, r, x; + INT32 l, r, x; l = __ASHR(n, 1); r = n - 1; while (l > 0) { @@ -482,25 +482,25 @@ static void Heap_HeapSort (int32 n, int32 *a, LONGINT a__len) } } -static void Heap_MarkCandidates (int32 n, int32 *cand, LONGINT cand__len) +static void Heap_MarkCandidates (INT32 n, INT32 *cand, LONGINT cand__len) { - int32 chnk, adr, tag, next, lim, lim1, i, ptr, size; + INT32 chnk, adr, tag, next, lim, lim1, i, ptr, size; chnk = Heap_heap; i = 0; lim = cand[n - 1]; while ((chnk != 0 && chnk < lim)) { adr = chnk + 12; - __GET(chnk + 4, lim1, int32); + __GET(chnk + 4, lim1, INT32); if (lim < lim1) { lim1 = lim; } while (adr < lim1) { - __GET(adr, tag, int32); + __GET(adr, tag, INT32); if (__ODD(tag)) { - __GET(tag - 1, size, int32); + __GET(tag - 1, size, INT32); adr += size; } else { - __GET(tag, size, int32); + __GET(tag, size, INT32); ptr = adr + 4; while (cand[i] < ptr) { i += 1; @@ -515,17 +515,17 @@ static void Heap_MarkCandidates (int32 n, int32 *cand, LONGINT cand__len) adr = next; } } - __GET(chnk, chnk, int32); + __GET(chnk, chnk, INT32); } } static void Heap_CheckFin (void) { Heap_FinNode n; - int32 tag; + INT32 tag; n = Heap_fin; while (n != NIL) { - __GET(n->obj - 4, tag, int32); + __GET(n->obj - 4, tag, INT32); if (!__ODD(tag)) { n->marked = 0; Heap_Mark(n->obj); @@ -571,10 +571,10 @@ void Heap_FINALL (void) } } -static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len) +static void Heap_MarkStack (INT32 n, INT32 *cand, LONGINT cand__len) { SYSTEM_PTR frame; - int32 inc, nofcand, sp, p, stack0; + INT32 inc, nofcand, sp, p, stack0; struct Heap__1 align; if (n > 0) { Heap_MarkStack(n - 1, cand, cand__len); @@ -591,7 +591,7 @@ static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len) inc = -inc; } while (sp != stack0) { - __GET(sp, p, int32); + __GET(sp, p, INT32); if ((p > Heap_heap && p < Heap_heapend)) { if (nofcand == cand__len) { Heap_HeapSort(nofcand, (void*)cand, cand__len); @@ -613,8 +613,8 @@ static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len) void Heap_GC (BOOLEAN markStack) { Heap_Module m; - int32 i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; - int32 cand[10000]; + INT32 i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; + INT32 cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); m = (Heap_Module)(address)Heap_modules; @@ -694,7 +694,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (int32)(address)obj; + f->obj = (INT32)(address)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; @@ -704,8 +704,8 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) void Heap_InitHeap (void) { Heap_heap = Heap_NewChunk(128000); - __GET(Heap_heap + 4, Heap_heapend, int32); - __PUT(Heap_heap, 0, int32); + __GET(Heap_heap + 4, Heap_heapend, INT32); + __PUT(Heap_heap, 0, INT32); Heap_allocated = 0; Heap_firstTry = 1; Heap_freeList[9] = 1; diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index 1a319646..dbc3fcd7 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h @@ -22,7 +22,7 @@ typedef typedef struct Heap_ModuleDesc { - int32 _prvt0; + INT32 _prvt0; char _prvt1[44]; } Heap_ModuleDesc; @@ -31,21 +31,21 @@ typedef import SYSTEM_PTR Heap_modules; -import int32 Heap_allocated, Heap_heapsize; -import int16 Heap_FileCount; +import INT32 Heap_allocated, Heap_heapsize; +import INT16 Heap_FileCount; -import address *Heap_ModuleDesc__typ; +import ADDRESS *Heap_ModuleDesc__typ; import void Heap_FINALL (void); import void Heap_GC (BOOLEAN markStack); import void Heap_INCREF (Heap_Module m); import void Heap_InitHeap (void); import void Heap_Lock (void); -import SYSTEM_PTR Heap_NEWBLK (int32 size); -import SYSTEM_PTR Heap_NEWREC (int32 tag); +import SYSTEM_PTR Heap_NEWBLK (INT32 size); +import SYSTEM_PTR Heap_NEWREC (INT32 tag); import void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); import SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -import void Heap_REGTYP (Heap_Module m, int32 typ); +import void Heap_REGTYP (Heap_Module m, INT32 typ); import void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); import void Heap_Unlock (void); import void *Heap__init(void); diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index bb6774da..d8293ed7 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "Heap.h" @@ -31,20 +31,20 @@ typedef struct Modules_ModuleDesc { Modules_Module next; Modules_ModuleName name; - int32 refcnt; + INT32 refcnt; Modules_Cmd cmds; - int32 types; - void (*enumPtrs)(void(*)(int32)); - int32 reserved1, reserved2; + INT32 types; + void (*enumPtrs)(void(*)(INT32)); + INT32 reserved1, reserved2; } Modules_ModuleDesc; -export int16 Modules_res; +export INT16 Modules_res; export CHAR Modules_resMsg[256]; export Modules_ModuleName Modules_imported, Modules_importing; -export address *Modules_ModuleDesc__typ; -export address *Modules_CmdDesc__typ; +export ADDRESS *Modules_ModuleDesc__typ; +export ADDRESS *Modules_CmdDesc__typ; static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len); export void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all); @@ -56,7 +56,7 @@ export Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len); static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len) { - int16 i, j; + INT16 i, j; __DUP(b, b__len, CHAR); i = 0; while (a[__X(i, a__len)] != 0x00) { diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index a7b62fe3..c2afbd3c 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h @@ -28,20 +28,20 @@ typedef struct Modules_ModuleDesc { Modules_Module next; Modules_ModuleName name; - int32 refcnt; + INT32 refcnt; Modules_Cmd cmds; - int32 types; - void (*enumPtrs)(void(*)(int32)); + INT32 types; + void (*enumPtrs)(void(*)(INT32)); char _prvt0[8]; } Modules_ModuleDesc; -import int16 Modules_res; +import INT16 Modules_res; import CHAR Modules_resMsg[256]; import Modules_ModuleName Modules_imported, Modules_importing; -import address *Modules_ModuleDesc__typ; -import address *Modules_CmdDesc__typ; +import ADDRESS *Modules_ModuleDesc__typ; +import ADDRESS *Modules_CmdDesc__typ; import void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all); import Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len); diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index dff6adc6..60993ebe 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "OPM.h" @@ -11,13 +11,13 @@ #include "OPT.h" -static int16 OPB_exp; -static int64 OPB_maxExp; +static INT16 OPB_exp; +static INT64 OPB_maxExp; export void OPB_Assign (OPT_Node *x, OPT_Node y); -static void OPB_BindNodes (int8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y); -static int16 OPB_BoolToInt (BOOLEAN b); +static void OPB_BindNodes (INT8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y); +static INT16 OPB_BoolToInt (BOOLEAN b); export void OPB_Call (OPT_Node *x, OPT_Node apar, OPT_Object fp); static void OPB_CharToString (OPT_Node n); static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode); @@ -25,10 +25,10 @@ static void OPB_CheckLeaf (OPT_Node x, BOOLEAN dynArrToo); export void OPB_CheckParameters (OPT_Object fp, OPT_Object ap, BOOLEAN checkNames); static void OPB_CheckProc (OPT_Struct x, OPT_Object y); static void OPB_CheckPtr (OPT_Node x, OPT_Node y); -static void OPB_CheckRealType (int16 f, int16 nr, OPT_Const x); +static void OPB_CheckRealType (INT16 f, INT16 nr, OPT_Const x); static void OPB_CheckReceiver (OPT_Node *x, OPT_Object fp); -static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y); -export void OPB_Construct (int8 class, OPT_Node *x, OPT_Node y); +static void OPB_ConstOp (INT16 op, OPT_Node x, OPT_Node y); +export void OPB_Construct (INT8 class, OPT_Node *x, OPT_Node y); static void OPB_Convert (OPT_Node *x, OPT_Struct typ); export void OPB_DeRef (OPT_Node *x); static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpar); @@ -38,17 +38,17 @@ export void OPB_Field (OPT_Node *x, OPT_Object y); export void OPB_In (OPT_Node *x, OPT_Node y); export void OPB_Index (OPT_Node *x, OPT_Node y); export void OPB_Inittd (OPT_Node *inittd, OPT_Node *last, OPT_Struct typ); -static BOOLEAN OPB_IntToBool (int64 i); +static BOOLEAN OPB_IntToBool (INT64 i); export void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y); -export void OPB_MOp (int8 op, OPT_Node *x); +export void OPB_MOp (INT8 op, OPT_Node *x); export OPT_Node OPB_NewBoolConst (BOOLEAN boolval); -export OPT_Node OPB_NewIntConst (int64 intval); +export OPT_Node OPB_NewIntConst (INT64 intval); export OPT_Node OPB_NewLeaf (OPT_Object obj); export OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ); -export OPT_Node OPB_NewString (OPS_String str, int64 len); +export OPT_Node OPB_NewString (OPS_String str, INT64 len); export OPT_Node OPB_Nil (void); static BOOLEAN OPB_NotVar (OPT_Node x); -export void OPB_Op (int8 op, OPT_Node *x, OPT_Node y); +export void OPB_Op (INT8 op, OPT_Node *x, OPT_Node y); export void OPB_OptIf (OPT_Node *x); export void OPB_Param (OPT_Node ap, OPT_Object fp); export void OPB_PrepCall (OPT_Node *x, OPT_Object *fpar); @@ -57,17 +57,17 @@ export void OPB_SetElem (OPT_Node *x); static void OPB_SetIntType (OPT_Node node); export void OPB_SetRange (OPT_Node *x, OPT_Node y); static void OPB_SetSetType (OPT_Node node); -export void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno); -export void OPB_StPar0 (OPT_Node *par0, int16 fctno); -export void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno); -export void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n); -export void OPB_StaticLink (int8 dlev); +export void OPB_StFct (OPT_Node *par0, INT8 fctno, INT16 parno); +export void OPB_StPar0 (OPT_Node *par0, INT16 fctno); +export void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno); +export void OPB_StParN (OPT_Node *par0, OPT_Node x, INT16 fctno, INT16 n); +export void OPB_StaticLink (INT8 dlev); export void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard); -static void OPB_err (int16 n); -static int64 OPB_log (int64 x); +static void OPB_err (INT16 n); +static INT64 OPB_log (INT64 x); -static void OPB_err (int16 n) +static void OPB_err (INT16 n) { OPM_err(n); } @@ -104,7 +104,7 @@ OPT_Node OPB_NewLeaf (OPT_Object obj) return node; } -void OPB_Construct (int8 class, OPT_Node *x, OPT_Node y) +void OPB_Construct (INT8 class, OPT_Node *x, OPT_Node y) { OPT_Node node = NIL; node = OPT_NewNode(class); @@ -127,7 +127,7 @@ void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y) *last = y; } -static int16 OPB_BoolToInt (BOOLEAN b) +static INT16 OPB_BoolToInt (BOOLEAN b) { if (b) { return 1; @@ -137,7 +137,7 @@ static int16 OPB_BoolToInt (BOOLEAN b) __RETCHK; } -static BOOLEAN OPB_IntToBool (int64 i) +static BOOLEAN OPB_IntToBool (INT64 i) { return i != 0; } @@ -214,8 +214,8 @@ static void OPB_SetIntType (OPT_Node node) static void OPB_SetSetType (OPT_Node node) { - int32 i32; - __GET((address)&node->conval->setval + 4, i32, int32); + INT32 i32; + __GET((address)&node->conval->setval + 4, i32, INT32); if (i32 == 0) { node->typ = OPT_set32typ; } else { @@ -223,7 +223,7 @@ static void OPB_SetSetType (OPT_Node node) } } -OPT_Node OPB_NewIntConst (int64 intval) +OPT_Node OPB_NewIntConst (INT64 intval) { OPT_Node x = NIL; x = OPT_NewNode(7); @@ -244,7 +244,7 @@ OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ) return x; } -OPT_Node OPB_NewString (OPS_String str, int64 len) +OPT_Node OPB_NewString (OPS_String str, INT64 len) { OPT_Node x = NIL; x = OPT_NewNode(7); @@ -274,7 +274,7 @@ static void OPB_CharToString (OPT_Node n) n->obj = NIL; } -static void OPB_BindNodes (int8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y) +static void OPB_BindNodes (INT8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y) { OPT_Node node = NIL; node = OPT_NewNode(class); @@ -314,7 +314,7 @@ void OPB_DeRef (OPT_Node *x) void OPB_Index (OPT_Node *x, OPT_Node y) { - int16 f; + INT16 f; OPT_Struct typ = NIL; f = y->typ->form; if ((*x)->class >= 7) { @@ -325,7 +325,7 @@ void OPB_Index (OPT_Node *x, OPT_Node y) } if ((*x)->typ->comp == 2) { typ = (*x)->typ->BaseTyp; - if ((y->class == 7 && (y->conval->intval < 0 || y->conval->intval >= (int64)(*x)->typ->n))) { + if ((y->class == 7 && (y->conval->intval < 0 || y->conval->intval >= (INT64)(*x)->typ->n))) { OPB_err(81); } } else if ((*x)->typ->comp == 3) { @@ -439,15 +439,15 @@ void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) void OPB_In (OPT_Node *x, OPT_Node y) { - int16 f; - int64 k; + INT16 f; + INT64 k; f = (*x)->typ->form; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); } else if ((f == 4 && y->typ->form == 7)) { if ((*x)->class == 7) { k = (*x)->conval->intval; - if (k < 0 || k >= (int64)__ASHL(y->typ->size, 3)) { + if (k < 0 || k >= (INT64)__ASHL(y->typ->size, 3)) { OPB_err(202); } else if (y->class == 7) { (*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval, 64)); @@ -466,7 +466,7 @@ void OPB_In (OPT_Node *x, OPT_Node y) (*x)->typ = OPT_booltyp; } -static int64 OPB_log (int64 x) +static INT64 OPB_log (INT64 x) { OPB_exp = 0; if (x > 0) { @@ -478,7 +478,7 @@ static int64 OPB_log (int64 x) return x; } -static void OPB_CheckRealType (int16 f, int16 nr, OPT_Const x) +static void OPB_CheckRealType (INT16 f, INT16 nr, OPT_Const x) { LONGREAL min, max, r; if (f == 5) { @@ -502,9 +502,9 @@ static struct MOp__28 { struct MOp__28 *lnk; } *MOp__28_s; -static OPT_Node NewOp__29 (int8 op, OPT_Struct typ, OPT_Node z); +static OPT_Node NewOp__29 (INT8 op, OPT_Struct typ, OPT_Node z); -static OPT_Node NewOp__29 (int8 op, OPT_Struct typ, OPT_Node z) +static OPT_Node NewOp__29 (INT8 op, OPT_Struct typ, OPT_Node z) { OPT_Node node = NIL; node = OPT_NewNode(11); @@ -514,9 +514,9 @@ static OPT_Node NewOp__29 (int8 op, OPT_Struct typ, OPT_Node z) return node; } -void OPB_MOp (int8 op, OPT_Node *x) +void OPB_MOp (INT8 op, OPT_Node *x) { - int16 f; + INT16 f; OPT_Struct typ = NIL; OPT_Node z = NIL; struct MOp__28 _s; @@ -597,7 +597,7 @@ void OPB_MOp (int8 op, OPT_Node *x) case 22: if (f == 3) { if (z->class == 7) { - z->conval->intval = (int16)__CAP((CHAR)z->conval->intval); + z->conval->intval = (INT16)__CAP((CHAR)z->conval->intval); z->obj = NIL; } else { z = NewOp__29(op, typ, z); @@ -657,7 +657,7 @@ void OPB_MOp (int8 op, OPT_Node *x) static void OPB_CheckPtr (OPT_Node x, OPT_Node y) { - int16 g; + INT16 g; OPT_Struct p = NIL, q = NIL, t = NIL; g = y->typ->form; if (g == 11) { @@ -741,16 +741,16 @@ static void OPB_CheckProc (OPT_Struct x, OPT_Object y) static struct ConstOp__13 { OPT_Node *x; - int16 *f; + INT16 *f; OPT_Const *xval, *yval; struct ConstOp__13 *lnk; } *ConstOp__13_s; -static int16 ConstCmp__14 (void); +static INT16 ConstCmp__14 (void); -static int16 ConstCmp__14 (void) +static INT16 ConstCmp__14 (void) { - int16 res; + INT16 res; switch (*ConstOp__13_s->f) { case 0: res = 9; @@ -813,11 +813,11 @@ static int16 ConstCmp__14 (void) return res; } -static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) +static void OPB_ConstOp (INT16 op, OPT_Node x, OPT_Node y) { - int16 f, g; + INT16 f, g; OPT_Const xval = NIL, yval = NIL; - int64 xv, yv; + INT64 xv, yv; BOOLEAN temp; struct ConstOp__13 _s; _s.x = &x; @@ -1097,8 +1097,8 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) static void OPB_Convert (OPT_Node *x, OPT_Struct typ) { OPT_Node node = NIL; - int16 f, g; - int64 k; + INT16 f, g; + INT64 k; LONGREAL r; f = (*x)->typ->form; g = typ->form; @@ -1136,12 +1136,12 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) OPB_err(203); r = (LONGREAL)1; } - (*x)->conval->intval = (int32)__ENTIER(r); + (*x)->conval->intval = (INT32)__ENTIER(r); OPB_SetIntType(*x); } } (*x)->obj = NIL; - } else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((int16)(*x)->left->typ->form < f || f > g))) { + } else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((INT16)(*x)->left->typ->form < f || f > g))) { if ((*x)->left->typ == typ) { *x = (*x)->left; } @@ -1155,14 +1155,14 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) } static struct Op__38 { - int16 *f, *g; + INT16 *f, *g; struct Op__38 *lnk; } *Op__38_s; -static void NewOp__39 (int8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y); +static void NewOp__39 (INT8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y); static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y); -static void NewOp__39 (int8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y) +static void NewOp__39 (INT8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y) { OPT_Node node = NIL; node = OPT_NewNode(12); @@ -1203,13 +1203,13 @@ static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) return ok; } -void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) +void OPB_Op (INT8 op, OPT_Node *x, OPT_Node y) { - int16 f, g; + INT16 f, g; OPT_Node t = NIL, z = NIL; OPT_Struct typ = NIL; BOOLEAN do_; - int64 val; + INT64 val; struct Op__38 _s; _s.f = &f; _s.g = &g; @@ -1489,7 +1489,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) void OPB_SetRange (OPT_Node *x, OPT_Node y) { - int64 k, l; + INT64 k, l; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); } else if (((*x)->typ->form == 4 && y->typ->form == 4)) { @@ -1525,7 +1525,7 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y) void OPB_SetElem (OPT_Node *x) { - int64 k; + INT64 k; if ((*x)->class == 8 || (*x)->class == 9) { OPB_err(126); } else if ((*x)->typ->form != 4) { @@ -1549,7 +1549,7 @@ void OPB_SetElem (OPT_Node *x) static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) { OPT_Struct y = NIL; - int16 f, g; + INT16 f, g; OPT_Struct p = NIL, q = NIL; y = ynode->typ; f = x->form; @@ -1673,9 +1673,9 @@ static void OPB_CheckLeaf (OPT_Node x, BOOLEAN dynArrToo) { } -void OPB_StPar0 (OPT_Node *par0, int16 fctno) +void OPB_StPar0 (OPT_Node *par0, INT16 fctno) { - int16 f; + INT16 f; OPT_Struct typ = NIL; OPT_Node x = NIL; x = *par0; @@ -1983,9 +1983,9 @@ static struct StPar1__53 { struct StPar1__53 *lnk; } *StPar1__53_s; -static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right); +static OPT_Node NewOp__54 (INT8 class, INT8 subcl, OPT_Node left, OPT_Node right); -static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right) +static OPT_Node NewOp__54 (INT8 class, INT8 subcl, OPT_Node left, OPT_Node right) { OPT_Node node = NIL; node = OPT_NewNode(class); @@ -1995,9 +1995,9 @@ static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right return node; } -void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) +void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno) { - int16 f, L; + INT16 f, L; OPT_Struct typ = NIL; OPT_Node p = NIL, t = NIL; struct StPar1__53 _s; @@ -2026,7 +2026,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (f == 4) { - if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval >= (int64)__ASHL(p->typ->size, 3)))) { + if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval >= (INT64)__ASHL(p->typ->size, 3)))) { OPB_err(202); } p = NewOp__54(19, fctno, p, x); @@ -2091,8 +2091,8 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) OPB_err(208); p->conval->intval = 1; } else if (x->conval->intval >= 0) { - if (__ABS(p->conval->intval) <= __DIV(9223372036854775807, (int64)__ASH(1, x->conval->intval))) { - p->conval->intval = p->conval->intval * (int64)__ASH(1, x->conval->intval); + if (__ABS(p->conval->intval) <= __DIV(9223372036854775807, (INT64)__ASH(1, x->conval->intval))) { + p->conval->intval = p->conval->intval * (INT64)__ASH(1, x->conval->intval); } else { OPB_err(208); p->conval->intval = 1; @@ -2239,10 +2239,10 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) StPar1__53_s = _s.lnk; } -void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n) +void OPB_StParN (OPT_Node *par0, OPT_Node x, INT16 fctno, INT16 n) { OPT_Node node = NIL; - int16 f; + INT16 f; OPT_Node p = NIL; p = *par0; f = x->typ->form; @@ -2284,9 +2284,9 @@ void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n) *par0 = p; } -void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno) +void OPB_StFct (OPT_Node *par0, INT8 fctno, INT16 parno) { - int16 dim; + INT16 dim; OPT_Node x = NIL, p = NIL; p = *par0; if (fctno <= 19) { @@ -2350,7 +2350,7 @@ void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno) static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpar) { - int16 f; + INT16 f; f = atyp->comp; ftyp = ftyp->BaseTyp; atyp = atyp->BaseTyp; @@ -2459,7 +2459,7 @@ void OPB_Param (OPT_Node ap, OPT_Object fp) } } -void OPB_StaticLink (int8 dlev) +void OPB_StaticLink (INT8 dlev) { OPT_Object scope = NIL; scope = OPT_topScope; @@ -2474,7 +2474,7 @@ void OPB_Call (OPT_Node *x, OPT_Node apar, OPT_Object fp) { OPT_Struct typ = NIL; OPT_Node p = NIL; - int8 lev; + INT8 lev; if ((*x)->class == 9) { typ = (*x)->typ; lev = (*x)->obj->mnolev; @@ -2534,7 +2534,7 @@ void OPB_Return (OPT_Node *x, OPT_Object proc) void OPB_Assign (OPT_Node *x, OPT_Node y) { OPT_Node z = NIL; - int8 subcl; + INT8 subcl; if ((*x)->class >= 7) { OPB_err(56); } diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index 22742961..bc644f4c 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h @@ -13,7 +13,7 @@ import void OPB_Assign (OPT_Node *x, OPT_Node y); import void OPB_Call (OPT_Node *x, OPT_Node apar, OPT_Object fp); import void OPB_CheckParameters (OPT_Object fp, OPT_Object ap, BOOLEAN checkNames); -import void OPB_Construct (int8 class, OPT_Node *x, OPT_Node y); +import void OPB_Construct (INT8 class, OPT_Node *x, OPT_Node y); import void OPB_DeRef (OPT_Node *x); import OPT_Node OPB_EmptySet (void); import void OPB_Enter (OPT_Node *procdec, OPT_Node stat, OPT_Object proc); @@ -22,25 +22,25 @@ import void OPB_In (OPT_Node *x, OPT_Node y); import void OPB_Index (OPT_Node *x, OPT_Node y); import void OPB_Inittd (OPT_Node *inittd, OPT_Node *last, OPT_Struct typ); import void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y); -import void OPB_MOp (int8 op, OPT_Node *x); +import void OPB_MOp (INT8 op, OPT_Node *x); import OPT_Node OPB_NewBoolConst (BOOLEAN boolval); -import OPT_Node OPB_NewIntConst (int64 intval); +import OPT_Node OPB_NewIntConst (INT64 intval); import OPT_Node OPB_NewLeaf (OPT_Object obj); import OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ); -import OPT_Node OPB_NewString (OPS_String str, int64 len); +import OPT_Node OPB_NewString (OPS_String str, INT64 len); import OPT_Node OPB_Nil (void); -import void OPB_Op (int8 op, OPT_Node *x, OPT_Node y); +import void OPB_Op (INT8 op, OPT_Node *x, OPT_Node y); import void OPB_OptIf (OPT_Node *x); import void OPB_Param (OPT_Node ap, OPT_Object fp); import void OPB_PrepCall (OPT_Node *x, OPT_Object *fpar); import void OPB_Return (OPT_Node *x, OPT_Object proc); import void OPB_SetElem (OPT_Node *x); import void OPB_SetRange (OPT_Node *x, OPT_Node y); -import void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno); -import void OPB_StPar0 (OPT_Node *par0, int16 fctno); -import void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno); -import void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n); -import void OPB_StaticLink (int8 dlev); +import void OPB_StFct (OPT_Node *par0, INT8 fctno, INT16 parno); +import void OPB_StPar0 (OPT_Node *par0, INT16 fctno); +import void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno); +import void OPB_StParN (OPT_Node *par0, OPT_Node x, INT16 fctno, INT16 n); +import void OPB_StaticLink (INT8 dlev); import void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard); import void *OPB__init(void); diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 27ab3d15..0ed7bf75 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "Configuration.h" @@ -11,9 +11,9 @@ #include "OPT.h" -static int16 OPC_indentLevel; -static int8 OPC_hashtab[105]; -static CHAR OPC_keytab[50][9]; +static INT16 OPC_indentLevel; +static INT8 OPC_hashtab[105]; +static CHAR OPC_keytab[60][9]; static BOOLEAN OPC_GlbPtrs; static CHAR OPC_BodyNameExt[13]; @@ -23,12 +23,12 @@ static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames); export OPT_Object OPC_BaseTProc (OPT_Object obj); export void OPC_BegBlk (void); export void OPC_BegStat (void); -static void OPC_CProcDefs (OPT_Object obj, int16 vis); -export void OPC_Case (int64 caseVal, int16 form); -static void OPC_CharacterLiteral (int64 c); -export void OPC_Cmp (int16 rel); +static void OPC_CProcDefs (OPT_Object obj, INT16 vis); +export void OPC_Case (INT64 caseVal, INT16 form); +static void OPC_CharacterLiteral (INT64 c); +export void OPC_Cmp (INT16 rel); export void OPC_CompleteIdent (OPT_Object obj); -export void OPC_Constant (OPT_Const con, int16 form); +export void OPC_Constant (OPT_Const con, INT16 form); static void OPC_DeclareBase (OPT_Object dcl); static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef); static void OPC_DeclareParams (OPT_Object par, BOOLEAN macro); @@ -45,45 +45,45 @@ export void OPC_EnterBody (void); export void OPC_EnterProc (OPT_Object proc); export void OPC_ExitBody (void); export void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet); -static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, int32 *off, int32 *n, int32 *curAlign); -static void OPC_FillGap (int32 gap, int32 off, int32 align, int32 *n, int32 *curAlign); +static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, INT32 *off, INT32 *n, INT32 *curAlign); +static void OPC_FillGap (INT32 gap, INT32 off, INT32 align, INT32 *n, INT32 *curAlign); export void OPC_GenBdy (OPT_Node n); -static void OPC_GenDynTypes (OPT_Node n, int16 vis); +static void OPC_GenDynTypes (OPT_Node n, INT16 vis); export void OPC_GenEnumPtrs (OPT_Object var); export void OPC_GenHdr (OPT_Node n); export void OPC_GenHdrIncludes (void); static void OPC_GenHeaderMsg (void); -export void OPC_Halt (int32 n); +export void OPC_Halt (INT32 n); export void OPC_Ident (OPT_Object obj); -static void OPC_IdentList (OPT_Object obj, int16 vis); +static void OPC_IdentList (OPT_Object obj, INT16 vis); static void OPC_Include (CHAR *name, LONGINT name__len); -static void OPC_IncludeImports (OPT_Object obj, int16 vis); +static void OPC_IncludeImports (OPT_Object obj, INT16 vis); export void OPC_Increment (BOOLEAN decrement); -export void OPC_Indent (int16 count); +export void OPC_Indent (INT16 count); export void OPC_Init (void); static void OPC_InitImports (OPT_Object obj); static void OPC_InitKeywords (void); export void OPC_InitTDesc (OPT_Struct typ); static void OPC_InitTProcs (OPT_Object typ, OPT_Object obj); -export void OPC_IntLiteral (int64 n, int32 size); -export void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim); +export void OPC_IntLiteral (INT64 n, INT32 size); +export void OPC_Len (OPT_Object obj, OPT_Struct array, INT64 dim); static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName); -static int16 OPC_Length (CHAR *s, LONGINT s__len); +static INT16 OPC_Length (CHAR *s, LONGINT s__len); export BOOLEAN OPC_NeedsRetval (OPT_Object proc); -export int32 OPC_NofPtrs (OPT_Struct typ); -static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len); +export INT32 OPC_NofPtrs (OPT_Struct typ); +static INT16 OPC_PerfectHash (CHAR *s, LONGINT s__len); static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len); static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define); -static void OPC_ProcPredefs (OPT_Object obj, int8 vis); +static void OPC_ProcPredefs (OPT_Object obj, INT8 vis); static void OPC_PutBase (OPT_Struct typ); -static void OPC_PutPtrOffsets (OPT_Struct typ, int32 adr, int32 *cnt); +static void OPC_PutPtrOffsets (OPT_Struct typ, INT32 adr, INT32 *cnt); static void OPC_RegCmds (OPT_Object obj); export void OPC_SetInclude (BOOLEAN exclude); static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause); -static void OPC_Str1 (CHAR *s, LONGINT s__len, int32 x); -static void OPC_StringLiteral (CHAR *s, LONGINT s__len, int32 l); +static void OPC_Str1 (CHAR *s, LONGINT s__len, INT32 x); +static void OPC_StringLiteral (CHAR *s, LONGINT s__len, INT32 l); export void OPC_TDescDecl (OPT_Struct typ); -export void OPC_TypeDefs (OPT_Object obj, int16 vis); +export void OPC_TypeDefs (OPT_Object obj, INT16 vis); export void OPC_TypeOf (OPT_Object ap); static BOOLEAN OPC_Undefined (OPT_Object obj); @@ -94,14 +94,14 @@ void OPC_Init (void) __MOVE("__init(void)", OPC_BodyNameExt, 13); } -void OPC_Indent (int16 count) +void OPC_Indent (INT16 count) { OPC_indentLevel += count; } void OPC_BegStat (void) { - int16 i; + INT16 i; i = OPC_indentLevel; while (i > 0) { OPM_Write(0x09); @@ -137,10 +137,10 @@ void OPC_EndBlk0 (void) OPM_Write('}'); } -static void OPC_Str1 (CHAR *s, LONGINT s__len, int32 x) +static void OPC_Str1 (CHAR *s, LONGINT s__len, INT32 x) { CHAR ch; - int16 i; + INT16 i; __DUP(s, s__len, CHAR); ch = s[0]; i = 0; @@ -156,9 +156,9 @@ static void OPC_Str1 (CHAR *s, LONGINT s__len, int32 x) __DEL(s); } -static int16 OPC_Length (CHAR *s, LONGINT s__len) +static INT16 OPC_Length (CHAR *s, LONGINT s__len) { - int16 i; + INT16 i; i = 0; while (s[__X(i, s__len)] != 0x00) { i += 1; @@ -166,13 +166,13 @@ static int16 OPC_Length (CHAR *s, LONGINT s__len) return i; } -static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len) +static INT16 OPC_PerfectHash (CHAR *s, LONGINT s__len) { - int16 i, h; + INT16 i, h; i = 0; h = 0; while ((s[__X(i, s__len)] != 0x00 && i < 5)) { - h = 3 * h + (int16)s[__X(i, s__len)]; + h = 3 * h + (INT16)s[__X(i, s__len)]; i += 1; } return (int)__MOD(h, 105); @@ -180,25 +180,25 @@ static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len) void OPC_Ident (OPT_Object obj) { - int16 mode, level, h; + INT16 mode, level, h; mode = obj->mode; level = obj->mnolev; if ((__IN(mode, 0x62, 32) && level > 0) || __IN(mode, 0x14, 32)) { OPM_WriteStringVar((void*)obj->name, 256); h = OPC_PerfectHash((void*)obj->name, 256); if (OPC_hashtab[__X(h, 105)] >= 0) { - if (__STRCMP(OPC_keytab[__X(OPC_hashtab[__X(h, 105)], 50)], obj->name) == 0) { + if (__STRCMP(OPC_keytab[__X(OPC_hashtab[__X(h, 105)], 60)], obj->name) == 0) { OPM_Write('_'); } } } else if ((mode == 5 && __IN(obj->typ->form, 0x90, 32))) { if (obj->typ == OPT_adrtyp) { - OPM_WriteString((CHAR*)"address", 8); + OPM_WriteString((CHAR*)"ADDRESS", 8); } else { if (obj->typ->form == 4) { - OPM_WriteString((CHAR*)"int", 4); + OPM_WriteString((CHAR*)"INT", 4); } else { - OPM_WriteString((CHAR*)"uint", 5); + OPM_WriteString((CHAR*)"UINT", 5); } OPM_WriteInt(__ASHL(obj->typ->size, 3)); } @@ -224,7 +224,7 @@ void OPC_Ident (OPT_Object obj) static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause) { - int16 pointers; + INT16 pointers; *openClause = 0; if (((typ->strobj == NIL || typ->strobj->name[0] == 0x00) && typ->comp != 4)) { if (__IN(typ->comp, 0x0c, 32)) { @@ -260,7 +260,7 @@ static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef) { OPT_Struct typ = NIL; BOOLEAN varPar, openClause; - int16 form, comp; + INT16 form, comp; typ = dcl->typ; varPar = ((dcl->mode == 2 && typ->comp != 2) || typ->comp == 3) || scopeDef; OPC_Stars(typ, &openClause); @@ -324,8 +324,8 @@ static void OPC_DeclareBase (OPT_Object dcl) { OPT_Struct typ = NIL, prev = NIL; OPT_Object obj = NIL; - int16 nofdims; - int32 off, n, dummy; + INT16 nofdims; + INT32 off, n, dummy; typ = dcl->typ; prev = typ; while ((((((((typ->strobj == NIL || typ->comp == 3) || OPC_Undefined(typ->strobj)) && typ->comp != 4)) && typ->form != 10)) && !((typ->form == 11 && typ->BaseTyp->comp == 3)))) { @@ -384,11 +384,11 @@ static void OPC_DeclareBase (OPT_Object dcl) } } -int32 OPC_NofPtrs (OPT_Struct typ) +INT32 OPC_NofPtrs (OPT_Struct typ) { OPT_Object fld = NIL; OPT_Struct btyp = NIL; - int32 n; + INT32 n; if ((typ->form == 11 && typ->sysflag == 0)) { return 1; } else if ((typ->comp == 4 && __MASK(typ->sysflag, -256) == 0)) { @@ -422,11 +422,11 @@ int32 OPC_NofPtrs (OPT_Struct typ) __RETCHK; } -static void OPC_PutPtrOffsets (OPT_Struct typ, int32 adr, int32 *cnt) +static void OPC_PutPtrOffsets (OPT_Struct typ, INT32 adr, INT32 *cnt) { OPT_Object fld = NIL; OPT_Struct btyp = NIL; - int32 n, i; + INT32 n, i; if ((typ->form == 11 && typ->sysflag == 0)) { OPM_WriteInt(adr); OPM_WriteString((CHAR*)", ", 3); @@ -502,7 +502,7 @@ static void OPC_PutBase (OPT_Struct typ) static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName) { OPT_Struct typ = NIL; - int16 dim; + INT16 dim; if (showParamName) { OPC_Ident(par); OPM_WriteString((CHAR*)"__len", 6); @@ -599,7 +599,7 @@ static void OPC_DeclareTProcs (OPT_Object obj, BOOLEAN *empty) OPT_Object OPC_BaseTProc (OPT_Object obj) { OPT_Struct typ = NIL, base = NIL; - int32 mno; + INT32 mno; typ = obj->link->typ; if (typ->form == 11) { typ = typ->BaseTyp; @@ -722,7 +722,7 @@ static void OPC_DefineType (OPT_Struct str) static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len) { - int16 i; + INT16 i; __DUP(y, y__len, CHAR); i = 0; while ((*x)[__X(i + 1, 256)] == y[__X(i, y__len)]) { @@ -732,14 +732,14 @@ static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len) return y[__X(i, y__len)] == 0x00; } -static void OPC_CProcDefs (OPT_Object obj, int16 vis) +static void OPC_CProcDefs (OPT_Object obj, INT16 vis) { - int16 i; + INT16 i; OPT_ConstExt ext = NIL; - int16 _for__7; + INT16 _for__7; if (obj != NIL) { OPC_CProcDefs(obj->left, vis); - if ((((obj->mode == 9 && (int16)obj->vis >= vis)) && obj->adr == 1)) { + if ((((obj->mode == 9 && (INT16)obj->vis >= vis)) && obj->adr == 1)) { ext = obj->conval->ext; i = 1; if (((*ext)[1] != '#' && !(OPC_Prefixed(ext, (CHAR*)"extern ", 8) || OPC_Prefixed(ext, (CHAR*)"import ", 8)))) { @@ -748,7 +748,7 @@ static void OPC_CProcDefs (OPT_Object obj, int16 vis) OPC_DeclareParams(obj->link, 1); OPM_Write(0x09); } - _for__7 = (int16)(*obj->conval->ext)[0]; + _for__7 = (INT16)(*obj->conval->ext)[0]; i = i; while (i <= _for__7) { OPM_Write((*obj->conval->ext)[__X(i, 256)]); @@ -760,7 +760,7 @@ static void OPC_CProcDefs (OPT_Object obj, int16 vis) } } -void OPC_TypeDefs (OPT_Object obj, int16 vis) +void OPC_TypeDefs (OPT_Object obj, INT16 vis) { if (obj != NIL) { OPC_TypeDefs(obj->left, vis); @@ -792,7 +792,7 @@ static void OPC_DefAnonRecs (OPT_Node n) void OPC_TDescDecl (OPT_Struct typ) { - int32 nofptrs; + INT32 nofptrs; OPT_Object o = NIL; OPC_BegStat(); OPM_WriteString((CHAR*)"__TDESC(", 9); @@ -829,9 +829,9 @@ void OPC_InitTDesc (OPT_Struct typ) } } -static void OPC_FillGap (int32 gap, int32 off, int32 align, int32 *n, int32 *curAlign) +static void OPC_FillGap (INT32 gap, INT32 off, INT32 align, INT32 *n, INT32 *curAlign) { - int32 adr; + INT32 adr; adr = off; OPT_Align(&adr, align); if ((*curAlign < align && gap - (adr - off) >= align)) { @@ -839,13 +839,13 @@ static void OPC_FillGap (int32 gap, int32 off, int32 align, int32 *n, int32 *cur OPC_BegStat(); switch (align) { case 2: - OPM_WriteString((CHAR*)"int16", 6); + OPM_WriteString((CHAR*)"INT16", 6); break; case 4: - OPM_WriteString((CHAR*)"int32", 6); + OPM_WriteString((CHAR*)"INT32", 6); break; case 8: - OPM_WriteString((CHAR*)"int64", 6); + OPM_WriteString((CHAR*)"INT64", 6); break; default: OPM_LogWLn(); @@ -866,11 +866,11 @@ static void OPC_FillGap (int32 gap, int32 off, int32 align, int32 *n, int32 *cur } } -static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, int32 *off, int32 *n, int32 *curAlign) +static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, INT32 *off, INT32 *n, INT32 *curAlign) { OPT_Object fld = NIL; OPT_Struct base = NIL; - int32 gap, adr, align, fldAlign; + INT32 gap, adr, align, fldAlign; fld = typ->link; align = __MASK(typ->align, -65536); if (typ->BaseTyp != NIL) { @@ -926,16 +926,16 @@ static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, int32 *off, int32 *n, i } } -static void OPC_IdentList (OPT_Object obj, int16 vis) +static void OPC_IdentList (OPT_Object obj, INT16 vis) { OPT_Struct base = NIL; BOOLEAN first; - int16 lastvis; + INT16 lastvis; base = NIL; first = 1; while ((obj != NIL && obj->mode != 13)) { if ((__IN(vis, 0x05, 32) || (vis == 1 && obj->vis != 0)) || (vis == 3 && !obj->leaf)) { - if (obj->typ != base || (int16)obj->vis != lastvis) { + if (obj->typ != base || (INT16)obj->vis != lastvis) { if (!first) { OPC_EndStat(); } @@ -974,7 +974,7 @@ static void OPC_IdentList (OPT_Object obj, int16 vis) } else if ((obj->mode == 2 && obj->typ->comp == 4)) { OPC_EndStat(); OPC_BegStat(); - OPM_WriteString((CHAR*)"address *", 10); + OPM_WriteString((CHAR*)"ADDRESS *", 10); OPC_Ident(obj); OPM_WriteString((CHAR*)"__typ", 6); base = NIL; @@ -1011,7 +1011,7 @@ static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames) OPM_WriteString((CHAR*)", LONGINT ", 11); OPC_LenList(obj, 1, showParamNames); } else if ((obj->mode == 2 && obj->typ->comp == 4)) { - OPM_WriteString((CHAR*)", address *", 12); + OPM_WriteString((CHAR*)", ADDRESS *", 12); if (showParamNames) { OPC_Ident(obj); OPM_WriteString((CHAR*)"__typ", 6); @@ -1044,7 +1044,7 @@ static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define) OPM_WriteLn(); } -static void OPC_ProcPredefs (OPT_Object obj, int8 vis) +static void OPC_ProcPredefs (OPT_Object obj, INT8 vis) { if (obj != NIL) { OPC_ProcPredefs(obj->left, vis); @@ -1074,18 +1074,18 @@ static void OPC_Include (CHAR *name, LONGINT name__len) __DEL(name); } -static void OPC_IncludeImports (OPT_Object obj, int16 vis) +static void OPC_IncludeImports (OPT_Object obj, INT16 vis) { if (obj != NIL) { OPC_IncludeImports(obj->left, vis); - if ((((obj->mode == 11 && obj->mnolev != 0)) && (int16)OPT_GlbMod[__X(-obj->mnolev, 64)]->vis >= vis)) { + if ((((obj->mode == 11 && obj->mnolev != 0)) && (INT16)OPT_GlbMod[__X(-obj->mnolev, 64)]->vis >= vis)) { OPC_Include(OPT_GlbMod[__X(-obj->mnolev, 64)]->name, 256); } OPC_IncludeImports(obj->right, vis); } } -static void OPC_GenDynTypes (OPT_Node n, int16 vis) +static void OPC_GenDynTypes (OPT_Node n, INT16 vis) { OPT_Struct typ = NIL; while ((n != NIL && n->class == 14)) { @@ -1099,7 +1099,7 @@ static void OPC_GenDynTypes (OPT_Node n, int16 vis) } else { OPM_WriteString((CHAR*)"export ", 8); } - OPM_WriteString((CHAR*)"address *", 10); + OPM_WriteString((CHAR*)"ADDRESS *", 10); OPC_Andent(typ); OPM_WriteString((CHAR*)"__typ", 6); OPC_EndStat(); @@ -1134,7 +1134,7 @@ void OPC_GenHdr (OPT_Node n) static void OPC_GenHeaderMsg (void) { - int16 i; + INT16 i; OPM_WriteString((CHAR*)"/* ", 4); OPM_WriteString((CHAR*)"voc", 4); OPM_Write(' '); @@ -1222,16 +1222,16 @@ void OPC_GenBdy (OPT_Node n) OPM_currFile = 1; OPC_GenHeaderMsg(); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#define SHORTINT int", 21); + OPM_WriteString((CHAR*)"#define SHORTINT INT", 21); OPM_WriteInt(__ASHL(OPT_sinttyp->size, 3)); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#define INTEGER int", 21); + OPM_WriteString((CHAR*)"#define INTEGER INT", 21); OPM_WriteInt(__ASHL(OPT_inttyp->size, 3)); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#define LONGINT int", 21); + OPM_WriteString((CHAR*)"#define LONGINT INT", 21); OPM_WriteInt(__ASHL(OPT_linttyp->size, 3)); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#define SET uint", 22); + OPM_WriteString((CHAR*)"#define SET UINT", 22); OPM_WriteInt(__ASHL(OPT_settyp->size, 3)); OPM_WriteLn(); OPM_WriteLn(); @@ -1288,7 +1288,7 @@ static void OPC_InitImports (OPT_Object obj) void OPC_GenEnumPtrs (OPT_Object var) { OPT_Struct typ = NIL; - int32 n; + INT32 n; OPC_GlbPtrs = 0; while (var != NIL) { typ = var->typ; @@ -1438,7 +1438,7 @@ void OPC_EnterProc (OPT_Object proc) { OPT_Object var = NIL, scope = NIL; OPT_Struct typ = NIL; - int16 dim; + INT16 dim; if (proc->vis != 1) { OPM_WriteString((CHAR*)"static ", 8); } @@ -1652,7 +1652,7 @@ void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet) void OPC_CompleteIdent (OPT_Object obj) { - int16 comp, level; + INT16 comp, level; level = obj->mnolev; if (obj->adr == 1) { if (obj->typ->comp == 4) { @@ -1681,10 +1681,10 @@ void OPC_CompleteIdent (OPT_Object obj) void OPC_TypeOf (OPT_Object ap) { - int16 i; + INT16 i; __ASSERT(ap->typ->comp == 4, 0); if (ap->mode == 2) { - if ((int16)ap->mnolev != OPM_level) { + if ((INT16)ap->mnolev != OPM_level) { OPM_WriteStringVar((void*)ap->scope->name, 256); OPM_WriteString((CHAR*)"_s->", 5); OPC_Ident(ap); @@ -1700,7 +1700,7 @@ void OPC_TypeOf (OPT_Object ap) } } -void OPC_Cmp (int16 rel) +void OPC_Cmp (INT16 rel) { switch (rel) { case 9: @@ -1729,7 +1729,7 @@ void OPC_Cmp (int16 rel) } } -static void OPC_CharacterLiteral (int64 c) +static void OPC_CharacterLiteral (INT64 c) { if (c < 32 || c > 126) { OPM_WriteString((CHAR*)"0x", 3); @@ -1744,15 +1744,15 @@ static void OPC_CharacterLiteral (int64 c) } } -static void OPC_StringLiteral (CHAR *s, LONGINT s__len, int32 l) +static void OPC_StringLiteral (CHAR *s, LONGINT s__len, INT32 l) { - int32 i; - int16 c; + INT32 i; + INT16 c; __DUP(s, s__len, CHAR); OPM_Write('"'); i = 0; while (i < l) { - c = (int16)s[__X(i, s__len)]; + c = (INT16)s[__X(i, s__len)]; if (c < 32 || c > 126) { OPM_Write('\\'); OPM_Write((CHAR)(48 + __ASHR(c, 6))); @@ -1772,7 +1772,7 @@ static void OPC_StringLiteral (CHAR *s, LONGINT s__len, int32 l) __DEL(s); } -void OPC_Case (int64 caseVal, int16 form) +void OPC_Case (INT64 caseVal, INT16 form) { CHAR ch; OPM_WriteString((CHAR*)"case ", 6); @@ -1810,15 +1810,15 @@ void OPC_Increment (BOOLEAN decrement) } } -void OPC_Halt (int32 n) +void OPC_Halt (INT32 n) { OPC_Str1((CHAR*)"__HALT(#)", 10, n); } -void OPC_IntLiteral (int64 n, int32 size) +void OPC_IntLiteral (INT64 n, INT32 size) { if ((((size > 4 && n <= 2147483647)) && n > (-2147483647-1))) { - OPM_WriteString((CHAR*)"((int", 6); + OPM_WriteString((CHAR*)"((INT", 6); OPM_WriteInt(__ASHL(size, 3)); OPM_WriteString((CHAR*)")(", 3); OPM_WriteInt(n); @@ -1828,7 +1828,7 @@ void OPC_IntLiteral (int64 n, int32 size) } } -void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim) +void OPC_Len (OPT_Object obj, OPT_Struct array, INT64 dim) { if (array->comp == 3) { OPC_CompleteIdent(obj); @@ -1845,11 +1845,11 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim) } } -void OPC_Constant (OPT_Const con, int16 form) +void OPC_Constant (OPT_Const con, INT16 form) { - int16 i; - uint64 s; - int64 hex; + INT16 i; + UINT64 s; + INT64 hex; BOOLEAN skipLeading; switch (form) { case 1: @@ -1908,7 +1908,7 @@ void OPC_Constant (OPT_Const con, int16 form) } static struct InitKeywords__46 { - int8 *n; + INT8 *n; struct InitKeywords__46 *lnk; } *InitKeywords__46_s; @@ -1916,18 +1916,18 @@ static void Enter__47 (CHAR *s, LONGINT s__len); static void Enter__47 (CHAR *s, LONGINT s__len) { - int16 h; + INT16 h; __DUP(s, s__len, CHAR); h = OPC_PerfectHash((void*)s, s__len); OPC_hashtab[__X(h, 105)] = *InitKeywords__46_s->n; - __COPY(s, OPC_keytab[__X(*InitKeywords__46_s->n, 50)], 9); + __COPY(s, OPC_keytab[__X(*InitKeywords__46_s->n, 60)], 9); *InitKeywords__46_s->n += 1; __DEL(s); } static void OPC_InitKeywords (void) { - int8 n, i; + INT8 n, i; struct InitKeywords__46 _s; _s.n = &n; _s.lnk = InitKeywords__46_s; @@ -1938,7 +1938,24 @@ static void OPC_InitKeywords (void) OPC_hashtab[__X(i, 105)] = -1; i += 1; } + Enter__47((CHAR*)"ADDRESS", 8); + Enter__47((CHAR*)"INT16", 6); + Enter__47((CHAR*)"INT32", 6); + Enter__47((CHAR*)"INT64", 6); + Enter__47((CHAR*)"INT8", 5); + Enter__47((CHAR*)"UINT16", 7); + Enter__47((CHAR*)"UINT32", 7); + Enter__47((CHAR*)"UINT64", 7); + Enter__47((CHAR*)"UINT8", 6); Enter__47((CHAR*)"address", 8); + Enter__47((CHAR*)"int16", 6); + Enter__47((CHAR*)"int32", 6); + Enter__47((CHAR*)"int64", 6); + Enter__47((CHAR*)"int8", 5); + Enter__47((CHAR*)"uint16", 7); + Enter__47((CHAR*)"uint32", 7); + Enter__47((CHAR*)"uint64", 7); + Enter__47((CHAR*)"uint8", 6); Enter__47((CHAR*)"asm", 4); Enter__47((CHAR*)"auto", 5); Enter__47((CHAR*)"break", 6); @@ -1960,10 +1977,6 @@ static void OPC_InitKeywords (void) Enter__47((CHAR*)"if", 3); Enter__47((CHAR*)"import", 7); Enter__47((CHAR*)"int", 4); - Enter__47((CHAR*)"int16", 6); - Enter__47((CHAR*)"int32", 6); - Enter__47((CHAR*)"int64", 6); - Enter__47((CHAR*)"int8", 5); Enter__47((CHAR*)"long", 5); Enter__47((CHAR*)"register", 9); Enter__47((CHAR*)"return", 7); @@ -1975,10 +1988,6 @@ static void OPC_InitKeywords (void) Enter__47((CHAR*)"struct", 7); Enter__47((CHAR*)"switch", 7); Enter__47((CHAR*)"typedef", 8); - Enter__47((CHAR*)"uint16", 7); - Enter__47((CHAR*)"uint32", 7); - Enter__47((CHAR*)"uint64", 7); - Enter__47((CHAR*)"uint8", 6); Enter__47((CHAR*)"union", 6); Enter__47((CHAR*)"unsigned", 9); Enter__47((CHAR*)"void", 5); diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index bbfd1911..f7fc51f9 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h @@ -13,10 +13,10 @@ import void OPC_Andent (OPT_Struct typ); import OPT_Object OPC_BaseTProc (OPT_Object obj); import void OPC_BegBlk (void); import void OPC_BegStat (void); -import void OPC_Case (int64 caseVal, int16 form); -import void OPC_Cmp (int16 rel); +import void OPC_Case (INT64 caseVal, INT16 form); +import void OPC_Cmp (INT16 rel); import void OPC_CompleteIdent (OPT_Object obj); -import void OPC_Constant (OPT_Const con, int16 form); +import void OPC_Constant (OPT_Const con, INT16 form); import void OPC_DefineInter (OPT_Object proc); import void OPC_EndBlk (void); import void OPC_EndBlk0 (void); @@ -29,19 +29,19 @@ import void OPC_GenBdy (OPT_Node n); import void OPC_GenEnumPtrs (OPT_Object var); import void OPC_GenHdr (OPT_Node n); import void OPC_GenHdrIncludes (void); -import void OPC_Halt (int32 n); +import void OPC_Halt (INT32 n); import void OPC_Ident (OPT_Object obj); import void OPC_Increment (BOOLEAN decrement); -import void OPC_Indent (int16 count); +import void OPC_Indent (INT16 count); import void OPC_Init (void); import void OPC_InitTDesc (OPT_Struct typ); -import void OPC_IntLiteral (int64 n, int32 size); -import void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim); +import void OPC_IntLiteral (INT64 n, INT32 size); +import void OPC_Len (OPT_Object obj, OPT_Struct array, INT64 dim); import BOOLEAN OPC_NeedsRetval (OPT_Object proc); -import int32 OPC_NofPtrs (OPT_Struct typ); +import INT32 OPC_NofPtrs (OPT_Struct typ); import void OPC_SetInclude (BOOLEAN exclude); import void OPC_TDescDecl (OPT_Struct typ); -import void OPC_TypeDefs (OPT_Object obj, int16 vis); +import void OPC_TypeDefs (OPT_Object obj, INT16 vis); import void OPC_TypeOf (OPT_Object ap); import void *OPC__init(void); diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 458de3f2..be4ec200 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "Configuration.h" @@ -22,81 +22,81 @@ typedef static CHAR OPM_SourceFileName[256]; static CHAR OPM_GlobalModel[10]; export CHAR OPM_Model[10]; -static int16 OPM_GlobalAddressSize; -export int16 OPM_AddressSize; -static int16 OPM_GlobalAlignment; -export int16 OPM_Alignment; -export uint32 OPM_GlobalOptions, OPM_Options; -export int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; -export int64 OPM_MaxIndex; +static INT16 OPM_GlobalAddressSize; +export INT16 OPM_AddressSize; +static INT16 OPM_GlobalAlignment; +export INT16 OPM_Alignment; +export UINT32 OPM_GlobalOptions, OPM_Options; +export INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; +export INT64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; -export int32 OPM_curpos, OPM_errpos, OPM_breakpc; -export int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; +export INT32 OPM_curpos, OPM_errpos, OPM_breakpc; +export INT16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; export CHAR OPM_modName[32]; export CHAR OPM_objname[64]; -static int32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; +static INT32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; static Texts_Reader OPM_inR; static Texts_Text OPM_Log; static Texts_Writer OPM_W; static Files_Rider OPM_oldSF, OPM_newSF; static Files_Rider OPM_R[3]; static Files_File OPM_oldSFile, OPM_newSFile, OPM_HFile, OPM_BFile, OPM_HIFile; -static int16 OPM_S; +static INT16 OPM_S; export CHAR OPM_ResourceDir[1024]; -static void OPM_Append (Files_Rider *R, address *R__typ, Files_File F); +static void OPM_Append (Files_Rider *R, ADDRESS *R__typ, Files_File F); export void OPM_CloseFiles (void); export void OPM_CloseOldSym (void); export void OPM_DeleteNewSym (void); -export void OPM_FPrint (int32 *fp, int64 val); -export void OPM_FPrintLReal (int32 *fp, LONGREAL lr); -export void OPM_FPrintReal (int32 *fp, REAL real); -export void OPM_FPrintSet (int32 *fp, uint64 set); -static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 pos); +export void OPM_FPrint (INT32 *fp, INT64 val); +export void OPM_FPrintLReal (INT32 *fp, LONGREAL lr); +export void OPM_FPrintReal (INT32 *fp, REAL real); +export void OPM_FPrintSet (INT32 *fp, UINT64 set); +static void OPM_FindLine (Files_File f, Files_Rider *r, ADDRESS *r__typ, INT64 pos); export void OPM_Get (CHAR *ch); export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); export void OPM_InitOptions (void); -export int16 OPM_Integer (int64 n); -static void OPM_LogErrMsg (int16 n); +export INT16 OPM_Integer (INT64 n); +static void OPM_LogErrMsg (INT16 n); export void OPM_LogW (CHAR ch); export void OPM_LogWLn (void); -export void OPM_LogWNum (int64 i, int64 len); +export void OPM_LogWNum (INT64 i, INT64 len); export void OPM_LogWStr (CHAR *s, LONGINT s__len); -export int32 OPM_Longint (int64 n); +export INT32 OPM_Longint (INT64 n); static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len); -export void OPM_Mark (int16 n, int32 pos); +export void OPM_Mark (INT16 n, INT32 pos); export void OPM_NewSym (CHAR *modName, LONGINT modName__len); export void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); export void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); export BOOLEAN OPM_OpenPar (void); export void OPM_RegisterNewSym (void); static void OPM_ScanOptions (CHAR *s, LONGINT s__len); -static void OPM_ShowLine (int64 pos); -export int64 OPM_SignedMaximum (int32 bytecount); -export int64 OPM_SignedMinimum (int32 bytecount); +static void OPM_ShowLine (INT64 pos); +export INT64 OPM_SignedMaximum (INT32 bytecount); +export INT64 OPM_SignedMinimum (INT32 bytecount); export void OPM_SymRCh (CHAR *ch); -export int32 OPM_SymRInt (void); -export int64 OPM_SymRInt64 (void); +export INT32 OPM_SymRInt (void); +export INT64 OPM_SymRInt64 (void); export void OPM_SymRLReal (LONGREAL *lr); export void OPM_SymRReal (REAL *r); -export void OPM_SymRSet (uint64 *s); +export void OPM_SymRSet (UINT64 *s); export void OPM_SymWCh (CHAR ch); -export void OPM_SymWInt (int64 i); +export void OPM_SymWInt (INT64 i); export void OPM_SymWLReal (LONGREAL lr); export void OPM_SymWReal (REAL r); -export void OPM_SymWSet (uint64 s); +export void OPM_SymWSet (UINT64 s); static void OPM_VerboseListSizes (void); export void OPM_Write (CHAR ch); -export void OPM_WriteHex (int64 i); -export void OPM_WriteInt (int64 i); +export void OPM_WriteHex (INT64 i); +export void OPM_WriteInt (INT64 i); export void OPM_WriteLn (void); export void OPM_WriteReal (LONGREAL r, CHAR suffx); export void OPM_WriteString (CHAR *s, LONGINT s__len); export void OPM_WriteStringVar (CHAR *s, LONGINT s__len); export BOOLEAN OPM_eofSF (void); -export void OPM_err (int16 n); +export void OPM_err (INT16 n); #define OPM_GetAlignment(a) struct {char c; long long l;} _s; *a = (char*)&_s.l - (char*)&_s @@ -112,7 +112,7 @@ void OPM_LogWStr (CHAR *s, LONGINT s__len) __DEL(s); } -void OPM_LogWNum (int64 i, int64 len) +void OPM_LogWNum (INT64 i, INT64 len) { Out_Int(i, len); } @@ -122,32 +122,32 @@ void OPM_LogWLn (void) Out_Ln(); } -int64 OPM_SignedMaximum (int32 bytecount) +INT64 OPM_SignedMaximum (INT32 bytecount) { - int64 result; + INT64 result; result = 1; result = __LSH(result, __ASHL(bytecount, 3) - 1, 64); return result - 1; } -int64 OPM_SignedMinimum (int32 bytecount) +INT64 OPM_SignedMinimum (INT32 bytecount) { return -OPM_SignedMaximum(bytecount) - 1; } -int32 OPM_Longint (int64 n) +INT32 OPM_Longint (INT64 n) { - return __VAL(int32, n); + return __VAL(INT32, n); } -int16 OPM_Integer (int64 n) +INT16 OPM_Integer (INT64 n) { - return __VAL(int16, n); + return __VAL(INT16, n); } static void OPM_ScanOptions (CHAR *s, LONGINT s__len) { - int16 i; + INT16 i; __DUP(s, s__len, CHAR); i = 1; while (s[__X(i, s__len)] != 0x00) { @@ -213,23 +213,23 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len) OPM_LogWStr((CHAR*)"-M option requires two following digits.", 41); OPM_LogWLn(); } else { - OPM_AddressSize = (int16)s[__X(i + 1, s__len)] - 48; - OPM_Alignment = (int16)s[__X(i + 2, s__len)] - 48; + OPM_AddressSize = (INT16)s[__X(i + 1, s__len)] - 48; + OPM_Alignment = (INT16)s[__X(i + 2, s__len)] - 48; i += 2; } break; case 'B': if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_IntegerSize = (int16)s[__X(i, s__len)] - 48; + OPM_IntegerSize = (INT16)s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_AddressSize = (int16)s[__X(i, s__len)] - 48; + OPM_AddressSize = (INT16)s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_Alignment = (int16)s[__X(i, s__len)] - 48; + OPM_Alignment = (INT16)s[__X(i, s__len)] - 48; } __ASSERT(OPM_IntegerSize == 2 || OPM_IntegerSize == 4, 0); __ASSERT(OPM_AddressSize == 4 || OPM_AddressSize == 8, 0); @@ -465,7 +465,7 @@ void OPM_InitOptions (void) void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len) { Texts_Text T = NIL; - int32 beg, end, time; + INT32 beg, end, time; CHAR s[256]; *done = 0; OPM_curpos = 0; @@ -513,7 +513,7 @@ void OPM_Get (CHAR *ch) static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len) { - int16 i, j; + INT16 i, j; CHAR ch; __DUP(ext, ext__len, CHAR); i = 0; @@ -535,12 +535,12 @@ static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGIN __DEL(ext); } -static void OPM_LogErrMsg (int16 n) +static void OPM_LogErrMsg (INT16 n) { Texts_Scanner S; Texts_Text T = NIL; CHAR ch; - int16 i; + INT16 i; CHAR buf[1024]; if (n >= 0) { if (!__IN(16, OPM_Options, 32)) { @@ -565,21 +565,21 @@ static void OPM_LogErrMsg (int16 n) OPM_LogWStr(errors_errors[__X(n, 350)], 128); } -static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 pos) +static void OPM_FindLine (Files_File f, Files_Rider *r, ADDRESS *r__typ, INT64 pos) { CHAR ch, cheol; - if (pos < (int64)OPM_ErrorLineStartPos) { + if (pos < (INT64)OPM_ErrorLineStartPos) { OPM_ErrorLineStartPos = 0; OPM_ErrorLineLimitPos = 0; OPM_ErrorLineNumber = 0; } - if (pos < (int64)OPM_ErrorLineLimitPos) { + if (pos < (INT64)OPM_ErrorLineLimitPos) { Files_Set(&*r, r__typ, f, OPM_ErrorLineStartPos); return; } Files_Set(&*r, r__typ, f, OPM_ErrorLineLimitPos); Files_Read(&*r, r__typ, (void*)&ch); - while (((int64)OPM_ErrorLineLimitPos < pos && !(*r).eof)) { + while (((INT64)OPM_ErrorLineLimitPos < pos && !(*r).eof)) { OPM_ErrorLineStartPos = OPM_ErrorLineLimitPos; OPM_ErrorLineNumber += 1; while ((((ch != 0x00 && ch != 0x0d)) && ch != 0x0a)) { @@ -597,12 +597,12 @@ static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 p Files_Set(&*r, r__typ, f, OPM_ErrorLineStartPos); } -static void OPM_ShowLine (int64 pos) +static void OPM_ShowLine (INT64 pos) { Files_File f = NIL; Files_Rider r; CHAR line[1023]; - int16 i; + INT16 i; CHAR ch; f = Files_Old(OPM_SourceFileName, 256); OPM_FindLine(f, &r, Files_Rider__typ, pos); @@ -621,10 +621,10 @@ static void OPM_ShowLine (int64 pos) OPM_LogWStr(line, 1023); OPM_LogWLn(); OPM_LogWStr((CHAR*)" ", 7); - if (pos >= (int64)OPM_ErrorLineLimitPos) { + if (pos >= (INT64)OPM_ErrorLineLimitPos) { pos = OPM_ErrorLineLimitPos - 1; } - i = (int16)OPM_Longint(pos - (int64)OPM_ErrorLineStartPos); + i = (INT16)OPM_Longint(pos - (INT64)OPM_ErrorLineStartPos); while (i > 0) { OPM_LogW(' '); i -= 1; @@ -639,7 +639,7 @@ static void OPM_ShowLine (int64 pos) Files_Close(f); } -void OPM_Mark (int16 n, int32 pos) +void OPM_Mark (INT16 n, INT32 pos) { if (pos == -1) { pos = 0; @@ -691,34 +691,34 @@ void OPM_Mark (int16 n, int32 pos) } } -void OPM_err (int16 n) +void OPM_err (INT16 n) { OPM_Mark(n, OPM_errpos); } -void OPM_FPrint (int32 *fp, int64 val) +void OPM_FPrint (INT32 *fp, INT64 val) { - *fp = __ROTL((int32)((uint32)*fp ^ __VAL(uint32, val)), 1, 32); + *fp = __ROTL((INT32)((UINT32)*fp ^ __VAL(UINT32, val)), 1, 32); } -void OPM_FPrintSet (int32 *fp, uint64 set) +void OPM_FPrintSet (INT32 *fp, UINT64 set) { - OPM_FPrint(&*fp, __VAL(int32, set)); + OPM_FPrint(&*fp, __VAL(INT32, set)); } -void OPM_FPrintReal (int32 *fp, REAL real) +void OPM_FPrintReal (INT32 *fp, REAL real) { - int16 i; - int32 l; - __GET((address)&real, l, int32); + INT16 i; + INT32 l; + __GET((address)&real, l, INT32); OPM_FPrint(&*fp, l); } -void OPM_FPrintLReal (int32 *fp, LONGREAL lr) +void OPM_FPrintLReal (INT32 *fp, LONGREAL lr) { - int32 l, h; - __GET((address)&lr, l, int32); - __GET((address)&lr + 4, h, int32); + INT32 l, h; + __GET((address)&lr, l, INT32); + __GET((address)&lr + 4, h, INT32); OPM_FPrint(&*fp, l); OPM_FPrint(&*fp, h); } @@ -728,21 +728,21 @@ void OPM_SymRCh (CHAR *ch) Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&*ch); } -int32 OPM_SymRInt (void) +INT32 OPM_SymRInt (void) { - int32 k; + INT32 k; Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&k, 4); return k; } -int64 OPM_SymRInt64 (void) +INT64 OPM_SymRInt64 (void) { - int64 k; + INT64 k; Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&k, 8); return k; } -void OPM_SymRSet (uint64 *s) +void OPM_SymRSet (UINT64 *s) { Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&*s, 8); } @@ -790,14 +790,14 @@ void OPM_SymWCh (CHAR ch) Files_Write(&OPM_newSF, Files_Rider__typ, ch); } -void OPM_SymWInt (int64 i) +void OPM_SymWInt (INT64 i) { Files_WriteNum(&OPM_newSF, Files_Rider__typ, i); } -void OPM_SymWSet (uint64 s) +void OPM_SymWSet (UINT64 s) { - Files_WriteNum(&OPM_newSF, Files_Rider__typ, (int64)s); + Files_WriteNum(&OPM_newSF, Files_Rider__typ, (INT64)s); } void OPM_SymWReal (REAL r) @@ -841,7 +841,7 @@ void OPM_Write (CHAR ch) void OPM_WriteString (CHAR *s, LONGINT s__len) { - int16 i; + INT16 i; i = 0; while (s[__X(i, s__len)] != 0x00) { i += 1; @@ -851,7 +851,7 @@ void OPM_WriteString (CHAR *s, LONGINT s__len) void OPM_WriteStringVar (CHAR *s, LONGINT s__len) { - int16 i; + INT16 i; i = 0; while (s[__X(i, s__len)] != 0x00) { i += 1; @@ -859,17 +859,17 @@ void OPM_WriteStringVar (CHAR *s, LONGINT s__len) Files_WriteBytes(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, (void*)s, s__len * 1, i); } -void OPM_WriteHex (int64 i) +void OPM_WriteHex (INT64 i) { CHAR s[3]; - int32 digit; - digit = __ASHR((int32)i, 4); + INT32 digit; + digit = __ASHR((INT32)i, 4); if (digit < 10) { s[0] = (CHAR)(48 + digit); } else { s[0] = (CHAR)(87 + digit); } - digit = __MASK((int32)i, -16); + digit = __MASK((INT32)i, -16); if (digit < 10) { s[1] = (CHAR)(48 + digit); } else { @@ -879,10 +879,10 @@ void OPM_WriteHex (int64 i) OPM_WriteString(s, 3); } -void OPM_WriteInt (int64 i) +void OPM_WriteInt (INT64 i) { CHAR s[24]; - int64 i1, k; + INT64 i1, k; if ((i == OPM_SignedMinimum(2) || i == OPM_SignedMinimum(4)) || i == OPM_SignedMinimum(8)) { OPM_Write('('); OPM_WriteInt(i + 1); @@ -915,14 +915,14 @@ void OPM_WriteReal (LONGREAL r, CHAR suffx) Texts_Reader R; CHAR s[32]; CHAR ch; - int16 i; - if ((((r < OPM_SignedMaximum(OPM_LongintSize) && r > OPM_SignedMinimum(OPM_LongintSize))) && r == ((int32)__ENTIER(r)))) { + INT16 i; + if ((((r < OPM_SignedMaximum(OPM_LongintSize) && r > OPM_SignedMinimum(OPM_LongintSize))) && r == ((INT32)__ENTIER(r)))) { if (suffx == 'f') { OPM_WriteString((CHAR*)"(REAL)", 7); } else { OPM_WriteString((CHAR*)"(LONGREAL)", 11); } - OPM_WriteInt((int32)__ENTIER(r)); + OPM_WriteInt((INT32)__ENTIER(r)); } else { Texts_OpenWriter(&W, Texts_Writer__typ); if (suffx == 'f') { @@ -960,7 +960,7 @@ void OPM_WriteLn (void) Files_Write(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, 0x0a); } -static void OPM_Append (Files_Rider *R, address *R__typ, Files_File F) +static void OPM_Append (Files_Rider *R, ADDRESS *R__typ, Files_File F) { Files_Rider R1; CHAR buffer[4096]; @@ -1003,7 +1003,7 @@ void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len) void OPM_CloseFiles (void) { CHAR FName[32]; - int16 res; + INT16 res; if (OPM_noerr) { OPM_LogWStr((CHAR*)" ", 3); OPM_LogWNum(Files_Pos(&OPM_R[1], Files_Rider__typ), 0); diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index be9e98bd..42866571 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h @@ -7,14 +7,14 @@ import CHAR OPM_Model[10]; -import int16 OPM_AddressSize, OPM_Alignment; -import uint32 OPM_GlobalOptions, OPM_Options; -import int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; -import int64 OPM_MaxIndex; +import INT16 OPM_AddressSize, OPM_Alignment; +import UINT32 OPM_GlobalOptions, OPM_Options; +import INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; +import INT64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; -import int32 OPM_curpos, OPM_errpos, OPM_breakpc; -import int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; +import INT32 OPM_curpos, OPM_errpos, OPM_breakpc; +import INT16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; import CHAR OPM_modName[32]; import CHAR OPM_objname[64]; import CHAR OPM_ResourceDir[1024]; @@ -23,47 +23,47 @@ import CHAR OPM_ResourceDir[1024]; import void OPM_CloseFiles (void); import void OPM_CloseOldSym (void); import void OPM_DeleteNewSym (void); -import void OPM_FPrint (int32 *fp, int64 val); -import void OPM_FPrintLReal (int32 *fp, LONGREAL lr); -import void OPM_FPrintReal (int32 *fp, REAL real); -import void OPM_FPrintSet (int32 *fp, uint64 set); +import void OPM_FPrint (INT32 *fp, INT64 val); +import void OPM_FPrintLReal (INT32 *fp, LONGREAL lr); +import void OPM_FPrintReal (INT32 *fp, REAL real); +import void OPM_FPrintSet (INT32 *fp, UINT64 set); import void OPM_Get (CHAR *ch); import void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); import void OPM_InitOptions (void); -import int16 OPM_Integer (int64 n); +import INT16 OPM_Integer (INT64 n); import void OPM_LogW (CHAR ch); import void OPM_LogWLn (void); -import void OPM_LogWNum (int64 i, int64 len); +import void OPM_LogWNum (INT64 i, INT64 len); import void OPM_LogWStr (CHAR *s, LONGINT s__len); -import int32 OPM_Longint (int64 n); -import void OPM_Mark (int16 n, int32 pos); +import INT32 OPM_Longint (INT64 n); +import void OPM_Mark (INT16 n, INT32 pos); import void OPM_NewSym (CHAR *modName, LONGINT modName__len); import void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); import void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); import BOOLEAN OPM_OpenPar (void); import void OPM_RegisterNewSym (void); -import int64 OPM_SignedMaximum (int32 bytecount); -import int64 OPM_SignedMinimum (int32 bytecount); +import INT64 OPM_SignedMaximum (INT32 bytecount); +import INT64 OPM_SignedMinimum (INT32 bytecount); import void OPM_SymRCh (CHAR *ch); -import int32 OPM_SymRInt (void); -import int64 OPM_SymRInt64 (void); +import INT32 OPM_SymRInt (void); +import INT64 OPM_SymRInt64 (void); import void OPM_SymRLReal (LONGREAL *lr); import void OPM_SymRReal (REAL *r); -import void OPM_SymRSet (uint64 *s); +import void OPM_SymRSet (UINT64 *s); import void OPM_SymWCh (CHAR ch); -import void OPM_SymWInt (int64 i); +import void OPM_SymWInt (INT64 i); import void OPM_SymWLReal (LONGREAL lr); import void OPM_SymWReal (REAL r); -import void OPM_SymWSet (uint64 s); +import void OPM_SymWSet (UINT64 s); import void OPM_Write (CHAR ch); -import void OPM_WriteHex (int64 i); -import void OPM_WriteInt (int64 i); +import void OPM_WriteHex (INT64 i); +import void OPM_WriteInt (INT64 i); import void OPM_WriteLn (void); import void OPM_WriteReal (LONGREAL r, CHAR suffx); import void OPM_WriteString (CHAR *s, LONGINT s__len); import void OPM_WriteStringVar (CHAR *s, LONGINT s__len); import BOOLEAN OPM_eofSF (void); -import void OPM_err (int16 n); +import void OPM_err (INT16 n); import void *OPM__init(void); diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index 5e181cb9..45f4db77 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "OPB.h" @@ -12,38 +12,38 @@ #include "OPT.h" struct OPP__1 { - int32 low, high; + INT32 low, high; }; typedef struct OPP__1 OPP_CaseTable[128]; -static int8 OPP_sym, OPP_level; -static int16 OPP_LoopLevel; +static INT8 OPP_sym, OPP_level; +static INT16 OPP_LoopLevel; static OPT_Node OPP_TDinit, OPP_lastTDinit; -static int16 OPP_nofFwdPtr; +static INT16 OPP_nofFwdPtr; static OPT_Struct OPP_FwdPtr[64]; -export address *OPP__1__typ; +export ADDRESS *OPP__1__typ; static void OPP_ActualParameters (OPT_Node *aparlist, OPT_Object fpar); static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned); static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq); -static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int16 *n, OPP_CaseTable tab); -static void OPP_CheckMark (int8 *vis); -static void OPP_CheckSym (int16 s); -static void OPP_CheckSysFlag (int16 *sysflag, int16 default_); +static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INT16 *n, OPP_CaseTable tab); +static void OPP_CheckMark (INT8 *vis); +static void OPP_CheckSym (INT16 s); +static void OPP_CheckSysFlag (INT16 *sysflag, INT16 default_); static void OPP_ConstExpression (OPT_Node *x); static void OPP_Element (OPT_Node *x); static void OPP_Expression (OPT_Node *x); static BOOLEAN OPP_Extends (OPT_Struct x, OPT_Struct b); static void OPP_Factor (OPT_Node *x); static void OPP_FormalParameters (OPT_Object *firstPar, OPT_Struct *resTyp); -export void OPP_Module (OPT_Node *prog, uint32 opt); +export void OPP_Module (OPT_Node *prog, UINT32 opt); static void OPP_PointerType (OPT_Struct *typ); static void OPP_ProcedureDeclaration (OPT_Node *x); -static void OPP_Receiver (int8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec); +static void OPP_Receiver (INT8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec); static void OPP_RecordType (OPT_Struct *typ, OPT_Struct *banned); static void OPP_Sets (OPT_Node *x); static void OPP_SimpleExpression (OPT_Node *x); @@ -52,19 +52,19 @@ static void OPP_StatSeq (OPT_Node *stat); static void OPP_Term (OPT_Node *x); static void OPP_Type (OPT_Struct *typ, OPT_Struct *banned); static void OPP_TypeDecl (OPT_Struct *typ, OPT_Struct *banned); -static void OPP_err (int16 n); +static void OPP_err (INT16 n); static void OPP_qualident (OPT_Object *id); static void OPP_selector (OPT_Node *x); -static void OPP_err (int16 n) +static void OPP_err (INT16 n) { OPM_err(n); } -static void OPP_CheckSym (int16 s) +static void OPP_CheckSym (INT16 s) { - if ((int16)OPP_sym == s) { + if ((INT16)OPP_sym == s) { OPS_Get(&OPP_sym); } else { OPM_err(s); @@ -74,7 +74,7 @@ static void OPP_CheckSym (int16 s) static void OPP_qualident (OPT_Object *id) { OPT_Object obj = NIL; - int8 lev; + INT8 lev; OPT_Find(&obj); OPS_Get(&OPP_sym); if ((((OPP_sym == 18 && obj != NIL)) && obj->mode == 11)) { @@ -114,7 +114,7 @@ static void OPP_ConstExpression (OPT_Node *x) } } -static void OPP_CheckMark (int8 *vis) +static void OPP_CheckMark (INT8 *vis) { OPS_Get(&OPP_sym); if (OPP_sym == 1 || OPP_sym == 7) { @@ -132,10 +132,10 @@ static void OPP_CheckMark (int8 *vis) } } -static void OPP_CheckSysFlag (int16 *sysflag, int16 default_) +static void OPP_CheckSysFlag (INT16 *sysflag, INT16 default_) { OPT_Node x = NIL; - int64 sf; + INT64 sf; if (OPP_sym == 31) { OPS_Get(&OPP_sym); if (!OPT_SYSimported) { @@ -163,7 +163,7 @@ static void OPP_RecordType (OPT_Struct *typ, OPT_Struct *banned) { OPT_Object fld = NIL, first = NIL, last = NIL, base = NIL; OPT_Struct ftyp = NIL; - int16 sysflag; + INT16 sysflag; *typ = OPT_NewStr(13, 4); (*typ)->BaseTyp = NIL; OPP_CheckSysFlag(&sysflag, -1); @@ -255,8 +255,8 @@ static void OPP_RecordType (OPT_Struct *typ, OPT_Struct *banned) static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) { OPT_Node x = NIL; - int64 n; - int16 sysflag; + INT64 n; + INT16 sysflag; OPP_CheckSysFlag(&sysflag, 0); if (OPP_sym == 25) { *typ = OPT_NewStr(13, 3); @@ -348,7 +348,7 @@ static void OPP_PointerType (OPT_Struct *typ) static void OPP_FormalParameters (OPT_Object *firstPar, OPT_Struct *resTyp) { - int8 mode; + INT8 mode; OPT_Object par = NIL, first = NIL, last = NIL, res = NIL; OPT_Struct typ = NIL; first = NIL; @@ -629,9 +629,9 @@ static void OPP_ActualParameters (OPT_Node *aparlist, OPT_Object fpar) static void OPP_StandProcCall (OPT_Node *x) { OPT_Node y = NIL; - int8 m; - int16 n; - m = (int8)((int16)(*x)->obj->adr); + INT8 m; + INT16 n; + m = (INT8)((INT16)(*x)->obj->adr); n = 0; if (OPP_sym == 30) { OPS_Get(&OPP_sym); @@ -790,7 +790,7 @@ static void OPP_Factor (OPT_Node *x) static void OPP_Term (OPT_Node *x) { OPT_Node y = NIL; - int8 mulop; + INT8 mulop; OPP_Factor(&*x); while ((1 <= OPP_sym && OPP_sym <= 5)) { mulop = OPP_sym; @@ -803,7 +803,7 @@ static void OPP_Term (OPT_Node *x) static void OPP_SimpleExpression (OPT_Node *x) { OPT_Node y = NIL; - int8 addop; + INT8 addop; if (OPP_sym == 7) { OPS_Get(&OPP_sym); OPP_Term(&*x); @@ -827,7 +827,7 @@ static void OPP_Expression (OPT_Node *x) { OPT_Node y = NIL; OPT_Object obj = NIL; - int8 relation; + INT8 relation; OPP_SimpleExpression(&*x); if ((9 <= OPP_sym && OPP_sym <= 14)) { relation = OPP_sym; @@ -853,7 +853,7 @@ static void OPP_Expression (OPT_Node *x) } } -static void OPP_Receiver (int8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec) +static void OPP_Receiver (INT8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec) { OPT_Object obj = NIL; *typ = OPT_undftyp; @@ -917,7 +917,7 @@ static struct ProcedureDeclaration__16 { OPT_Node *x; OPT_Object *proc, *fwd; OPS_Name *name; - int8 *mode, *vis; + INT8 *mode, *vis; BOOLEAN *forward; struct ProcedureDeclaration__16 *lnk; } *ProcedureDeclaration__16_s; @@ -930,8 +930,8 @@ static void TProcDecl__23 (void); static void GetCode__19 (void) { OPT_ConstExt ext = NIL; - int16 n; - int64 c; + INT16 n; + INT64 c; ext = OPT_NewExt(); (*ProcedureDeclaration__16_s->proc)->conval->ext = ext; n = 0; @@ -995,7 +995,7 @@ static void GetParams__21 (void) static void Body__17 (void) { OPT_Node procdec = NIL, statseq = NIL; - int32 c; + INT32 c; c = OPM_errpos; (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1,64); OPP_CheckSym(39); @@ -1018,7 +1018,7 @@ static void TProcDecl__23 (void) { OPT_Object baseProc = NIL; OPT_Struct objTyp = NIL, recTyp = NIL; - int8 objMode; + INT8 objMode; OPS_Name objName; OPS_Get(&OPP_sym); *ProcedureDeclaration__16_s->mode = 13; @@ -1090,7 +1090,7 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) { OPT_Object proc = NIL, fwd = NIL; OPS_Name name; - int8 mode, vis; + INT8 mode, vis; BOOLEAN forward; struct ProcedureDeclaration__16 _s; _s.x = x; @@ -1167,11 +1167,11 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) ProcedureDeclaration__16_s = _s.lnk; } -static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int16 *n, OPP_CaseTable tab) +static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INT16 *n, OPP_CaseTable tab) { OPT_Node x = NIL, y = NIL, lastlab = NIL; - int16 i, f; - int32 xval, yval; + INT16 i, f; + INT32 xval, yval; *lab = NIL; lastlab = NIL; for (;;) { @@ -1187,14 +1187,14 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int16 *n, OPP if (!(LabelTyp->form == 4) || LabelTyp->size < x->typ->size) { OPP_err(60); } - } else if ((int16)LabelTyp->form != f) { + } else if ((INT16)LabelTyp->form != f) { OPP_err(60); } if (OPP_sym == 21) { OPS_Get(&OPP_sym); OPP_ConstExpression(&y); yval = OPM_Longint(y->conval->intval); - if (((int16)y->typ->form != f && !((f == 4 && y->typ->form == 4)))) { + if (((INT16)y->typ->form != f && !((f == 4 && y->typ->form == 4)))) { OPP_err(60); } if (yval < xval) { @@ -1238,7 +1238,7 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int16 *n, OPP } static struct StatSeq__30 { - int32 *pos; + INT32 *pos; struct StatSeq__30 *lnk; } *StatSeq__30_s; @@ -1248,8 +1248,8 @@ static void SetPos__35 (OPT_Node x); static void CasePart__31 (OPT_Node *x) { - int16 n; - int32 low, high; + INT16 n; + INT32 low, high; BOOLEAN e; OPP_CaseTable tab; OPT_Node cases = NIL, lab = NIL, y = NIL, lastcase = NIL; @@ -1332,7 +1332,7 @@ static void OPP_StatSeq (OPT_Node *stat) OPT_Struct idtyp = NIL; BOOLEAN e; OPT_Node s = NIL, x = NIL, y = NIL, z = NIL, apar = NIL, last = NIL, lastif = NIL; - int32 pos; + INT32 pos; OPS_Name name; struct StatSeq__30 _s; _s.pos = &pos; @@ -1625,7 +1625,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) OPT_Struct typ = NIL; OPT_Object obj = NIL, first = NIL, last = NIL; OPT_Node x = NIL, lastdec = NIL; - int16 i; + INT16 i; first = NIL; last = NIL; OPP_nofFwdPtr = 0; @@ -1774,11 +1774,11 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) OPP_CheckSym(41); } -void OPP_Module (OPT_Node *prog, uint32 opt) +void OPP_Module (OPT_Node *prog, UINT32 opt) { OPS_Name impName, aliasName; OPT_Node procdec = NIL, statseq = NIL; - int32 c; + INT32 c; BOOLEAN done; OPS_Init(); OPP_LoopLevel = 0; diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index de0e599a..cb3aabc8 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h @@ -9,7 +9,7 @@ -import void OPP_Module (OPT_Node *prog, uint32 opt); +import void OPP_Module (OPT_Node *prog, UINT32 opt); import void *OPP__init(void); diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index 5a34663d..5d7b776f 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "OPM.h" @@ -17,29 +17,29 @@ typedef export OPS_Name OPS_name; export OPS_String OPS_str; -export int16 OPS_numtyp; -export int64 OPS_intval; +export INT16 OPS_numtyp; +export INT64 OPS_intval; export REAL OPS_realval; export LONGREAL OPS_lrlval; static CHAR OPS_ch; -export void OPS_Get (int8 *sym); -static void OPS_Identifier (int8 *sym); +export void OPS_Get (INT8 *sym); +static void OPS_Identifier (INT8 *sym); export void OPS_Init (void); static void OPS_Number (void); -static void OPS_Str (int8 *sym); -static void OPS_err (int16 n); +static void OPS_Str (INT8 *sym); +static void OPS_err (INT16 n); -static void OPS_err (int16 n) +static void OPS_err (INT16 n) { OPM_err(n); } -static void OPS_Str (int8 *sym) +static void OPS_Str (INT8 *sym) { - int16 i; + INT16 i; CHAR och; i = 0; och = OPS_ch; @@ -65,15 +65,15 @@ static void OPS_Str (int8 *sym) if (OPS_intval == 2) { *sym = 35; OPS_numtyp = 1; - OPS_intval = (int16)OPS_str[0]; + OPS_intval = (INT16)OPS_str[0]; } else { *sym = 37; } } -static void OPS_Identifier (int8 *sym) +static void OPS_Identifier (INT8 *sym) { - int16 i; + INT16 i; i = 0; do { OPS_name[i] = OPS_ch; @@ -92,10 +92,10 @@ static struct Number__6 { struct Number__6 *lnk; } *Number__6_s; -static int16 Ord__7 (CHAR ch, BOOLEAN hex); -static LONGREAL Ten__9 (int16 e); +static INT16 Ord__7 (CHAR ch, BOOLEAN hex); +static LONGREAL Ten__9 (INT16 e); -static LONGREAL Ten__9 (int16 e) +static LONGREAL Ten__9 (INT16 e) { LONGREAL x, p; x = (LONGREAL)1; @@ -112,12 +112,12 @@ static LONGREAL Ten__9 (int16 e) return x; } -static int16 Ord__7 (CHAR ch, BOOLEAN hex) +static INT16 Ord__7 (CHAR ch, BOOLEAN hex) { if (ch <= '9') { - return (int16)ch - 48; + return (INT16)ch - 48; } else if (hex) { - return ((int16)ch - 65) + 10; + return ((INT16)ch - 65) + 10; } else { OPS_err(2); return 0; @@ -127,7 +127,7 @@ static int16 Ord__7 (CHAR ch, BOOLEAN hex) static void OPS_Number (void) { - int16 i, m, n, d, e; + INT16 i, m, n, d, e; CHAR dig[24]; LONGREAL f; CHAR expCh; @@ -173,7 +173,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) + (INT64)Ord__7(dig[i], 1); i += 1; } } else { @@ -187,7 +187,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) + (INT64)Ord__7(dig[i], 1); i += 1; } } else { @@ -198,8 +198,8 @@ static void OPS_Number (void) while (i < n) { d = Ord__7(dig[i], 0); i += 1; - if (OPS_intval <= __DIV(9223372036854775807 - (int64)d, 10)) { - OPS_intval = OPS_intval * 10 + (int64)d; + if (OPS_intval <= __DIV(9223372036854775807 - (INT64)d, 10)) { + OPS_intval = OPS_intval * 10 + (INT64)d; } else { OPS_err(203); } @@ -308,9 +308,9 @@ static void Comment__2 (void) } } -void OPS_Get (int8 *sym) +void OPS_Get (INT8 *sym) { - int8 s; + INT8 s; struct Get__1 _s; _s.lnk = Get__1_s; Get__1_s = &_s; diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index a452da84..01ffbd17 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h @@ -14,13 +14,13 @@ typedef import OPS_Name OPS_name; import OPS_String OPS_str; -import int16 OPS_numtyp; -import int64 OPS_intval; +import INT16 OPS_numtyp; +import INT64 OPS_intval; import REAL OPS_realval; import LONGREAL OPS_lrlval; -import void OPS_Get (int8 *sym); +import void OPS_Get (INT8 *sym); import void OPS_Init (void); import void *OPS__init(void); diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index abf8a8f1..37631f98 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "OPM.h" @@ -18,18 +18,18 @@ typedef typedef struct OPT_ConstDesc { OPT_ConstExt ext; - int64 intval; - int32 intval2; - uint64 setval; + INT64 intval; + INT32 intval2; + UINT64 setval; LONGREAL realval; } OPT_ConstDesc; typedef struct OPT_ExpCtxt { - int32 reffp; - int16 ref; - int8 nofm; - int8 locmno[64]; + INT32 reffp; + INT16 ref; + INT8 nofm; + INT8 locmno[64]; } OPT_ExpCtxt; typedef @@ -40,13 +40,13 @@ typedef typedef struct OPT_ImpCtxt { - int32 nextTag, reffp; - int16 nofr, minr, nofm; + INT32 nextTag, reffp; + INT16 nofr, minr, nofm; BOOLEAN self; OPT_Struct ref[255]; OPT_Object old[255]; - int32 pvfp[255]; - int8 glbmno[64]; + INT32 pvfp[255]; + INT8 glbmno[64]; } OPT_ImpCtxt; typedef @@ -55,7 +55,7 @@ typedef typedef struct OPT_NodeDesc { OPT_Node left, right, link; - int8 class, subcl; + INT8 class, subcl; BOOLEAN readonly; OPT_Struct typ; OPT_Object obj; @@ -67,22 +67,22 @@ typedef OPT_Object left, right, link, scope; OPS_Name name; BOOLEAN leaf; - int8 mode, mnolev, vis, history; + INT8 mode, mnolev, vis, history; BOOLEAN used, fpdone; - int32 fprint; + INT32 fprint; OPT_Struct typ; OPT_Const conval; - int32 adr, linkadr; - int16 x; + INT32 adr, linkadr; + INT16 x; } OPT_ObjDesc; typedef struct OPT_StrDesc { - int8 form, comp, mno, extlev; - int16 ref, sysflag; - int32 n, size, align, txtpos; + INT8 form, comp, mno, extlev; + INT16 ref, sysflag; + INT32 n, size, align, txtpos; BOOLEAN allocated, pbused, pvused, fpdone, idfpdone; - int32 idfp, pbfp, pvfp; + INT32 idfp, pbfp, pvfp; OPT_Struct BaseTyp; OPT_Object link, strobj; } OPT_StrDesc; @@ -91,80 +91,80 @@ typedef export OPT_Object OPT_topScope; export OPT_Struct OPT_undftyp, OPT_niltyp, OPT_notyp, OPT_bytetyp, OPT_cpbytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_settyp, OPT_set32typ, OPT_set64typ, OPT_realtyp, OPT_lrltyp, OPT_stringtyp, OPT_adrtyp, OPT_sysptrtyp; export OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj, OPT_setobj; -export int8 OPT_nofGmod; +export INT8 OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; export BOOLEAN OPT_SYSimported; static OPT_Object OPT_universe, OPT_syslink; static OPT_ImpCtxt OPT_impCtxt; static OPT_ExpCtxt OPT_expCtxt; -static int32 OPT_nofhdfld; +static INT32 OPT_nofhdfld; static BOOLEAN OPT_newsf, OPT_findpc, OPT_extsf, OPT_sfpresent, OPT_symExtended, OPT_symNew; -static int32 OPT_recno; +static INT32 OPT_recno; -export address *OPT_ConstDesc__typ; -export address *OPT_ObjDesc__typ; -export address *OPT_StrDesc__typ; -export address *OPT_NodeDesc__typ; -export address *OPT_ImpCtxt__typ; -export address *OPT_ExpCtxt__typ; +export ADDRESS *OPT_ConstDesc__typ; +export ADDRESS *OPT_ObjDesc__typ; +export ADDRESS *OPT_StrDesc__typ; +export ADDRESS *OPT_NodeDesc__typ; +export ADDRESS *OPT_ImpCtxt__typ; +export ADDRESS *OPT_ExpCtxt__typ; -export void OPT_Align (int32 *adr, int32 base); -export int32 OPT_BaseAlignment (OPT_Struct typ); +export void OPT_Align (INT32 *adr, INT32 base); +export INT32 OPT_BaseAlignment (OPT_Struct typ); export void OPT_Close (void); export void OPT_CloseScope (void); static void OPT_DebugStruct (OPT_Struct btyp); -static void OPT_EnterBoolConst (OPS_Name name, int32 value); -static void OPT_EnterProc (OPS_Name name, int16 num); -static void OPT_EnterTyp (OPS_Name name, int8 form, int16 size, OPT_Struct *res); +static void OPT_EnterBoolConst (OPS_Name name, INT32 value); +static void OPT_EnterProc (OPS_Name name, INT16 num); +static void OPT_EnterTyp (OPS_Name name, INT8 form, INT16 size, OPT_Struct *res); static void OPT_EnterTypeAlias (OPS_Name name, OPT_Object *res); export void OPT_Export (BOOLEAN *ext, BOOLEAN *new); -export void OPT_FPrintErr (OPT_Object obj, int16 errcode); -static void OPT_FPrintName (int32 *fp, CHAR *name, LONGINT name__len); +export void OPT_FPrintErr (OPT_Object obj, INT16 errcode); +static void OPT_FPrintName (INT32 *fp, CHAR *name, LONGINT name__len); export void OPT_FPrintObj (OPT_Object obj); -static void OPT_FPrintSign (int32 *fp, OPT_Struct result, OPT_Object par); +static void OPT_FPrintSign (INT32 *fp, OPT_Struct result, OPT_Object par); export void OPT_FPrintStr (OPT_Struct typ); export void OPT_Find (OPT_Object *res); export void OPT_FindField (OPS_Name name, OPT_Struct typ, OPT_Object *res); export void OPT_FindImport (OPT_Object mod, OPT_Object *res); export void OPT_IdFPrint (OPT_Struct typ); export void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); -static void OPT_InConstant (int32 f, OPT_Const conval); +static void OPT_InConstant (INT32 f, OPT_Const conval); static OPT_Object OPT_InFld (void); -static void OPT_InMod (int8 *mno); +static void OPT_InMod (INT8 *mno); static void OPT_InName (CHAR *name, LONGINT name__len); -static OPT_Object OPT_InObj (int8 mno); -static void OPT_InSign (int8 mno, OPT_Struct *res, OPT_Object *par); +static OPT_Object OPT_InObj (INT8 mno); +static void OPT_InSign (INT8 mno, OPT_Struct *res, OPT_Object *par); static void OPT_InStruct (OPT_Struct *typ); -static OPT_Object OPT_InTProc (int8 mno); -static OPT_Struct OPT_InTyp (int32 tag); -export void OPT_Init (OPS_Name name, uint32 opt); +static OPT_Object OPT_InTProc (INT8 mno); +static OPT_Struct OPT_InTyp (INT32 tag); +export void OPT_Init (OPS_Name name, UINT32 opt); export void OPT_InitRecno (void); -static void OPT_InitStruct (OPT_Struct *typ, int8 form); +static void OPT_InitStruct (OPT_Struct *typ, INT8 form); export void OPT_Insert (OPS_Name name, OPT_Object *obj); export void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); -export int16 OPT_IntSize (int64 n); -export OPT_Struct OPT_IntType (int32 size); +export INT16 OPT_IntSize (INT64 n); +export OPT_Struct OPT_IntType (INT32 size); export OPT_Const OPT_NewConst (void); export OPT_ConstExt OPT_NewExt (void); -export OPT_Node OPT_NewNode (int8 class); +export OPT_Node OPT_NewNode (INT8 class); export OPT_Object OPT_NewObj (void); -export OPT_Struct OPT_NewStr (int8 form, int8 comp); -export void OPT_OpenScope (int8 level, OPT_Object owner); +export OPT_Struct OPT_NewStr (INT8 form, INT8 comp); +export void OPT_OpenScope (INT8 level, OPT_Object owner); static void OPT_OutConstant (OPT_Object obj); -static void OPT_OutFlds (OPT_Object fld, int32 adr, BOOLEAN visible); -static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, int32 adr); -static void OPT_OutMod (int16 mno); +static void OPT_OutFlds (OPT_Object fld, INT32 adr, BOOLEAN visible); +static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, INT32 adr); +static void OPT_OutMod (INT16 mno); static void OPT_OutName (CHAR *name, LONGINT name__len); static void OPT_OutObj (OPT_Object obj); static void OPT_OutSign (OPT_Struct result, OPT_Object par); static void OPT_OutStr (OPT_Struct typ); static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj); -export OPT_Struct OPT_SetType (int32 size); -export OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir); -export int32 OPT_SizeAlignment (int32 size); +export OPT_Struct OPT_SetType (INT32 size); +export OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INT16 dir); +export INT32 OPT_SizeAlignment (INT32 size); export void OPT_TypSize (OPT_Struct typ); -static void OPT_err (int16 n); +static void OPT_err (INT16 n); void OPT_InitRecno (void) @@ -172,14 +172,14 @@ void OPT_InitRecno (void) OPT_recno = 0; } -static void OPT_err (int16 n) +static void OPT_err (INT16 n) { OPM_err(n); } -int16 OPT_IntSize (int64 n) +INT16 OPT_IntSize (INT64 n) { - int16 bytes; + INT16 bytes; if (n < 0) { n = -(n + 1); } @@ -190,7 +190,7 @@ int16 OPT_IntSize (int64 n) return bytes; } -OPT_Struct OPT_IntType (int32 size) +OPT_Struct OPT_IntType (INT32 size) { if (size <= OPT_int8typ->size) { return OPT_int8typ; @@ -204,7 +204,7 @@ OPT_Struct OPT_IntType (int32 size) return OPT_int64typ; } -OPT_Struct OPT_SetType (int32 size) +OPT_Struct OPT_SetType (INT32 size) { if (size == OPT_set32typ->size) { return OPT_set32typ; @@ -212,9 +212,9 @@ OPT_Struct OPT_SetType (int32 size) return OPT_set64typ; } -OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir) +OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INT16 dir) { - int16 i; + INT16 i; __ASSERT(x->form == 4, 0); __ASSERT(x->BaseTyp == OPT_undftyp, 0); __ASSERT(dir == 1 || dir == -1, 0); @@ -244,7 +244,7 @@ OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir) __RETCHK; } -void OPT_Align (int32 *adr, int32 base) +void OPT_Align (INT32 *adr, INT32 base) { switch (base) { case 2: @@ -264,9 +264,9 @@ void OPT_Align (int32 *adr, int32 base) } } -int32 OPT_SizeAlignment (int32 size) +INT32 OPT_SizeAlignment (INT32 size) { - int32 alignment; + INT32 alignment; if (size < OPM_Alignment) { alignment = 1; while (alignment < size) { @@ -278,9 +278,9 @@ int32 OPT_SizeAlignment (int32 size) return alignment; } -int32 OPT_BaseAlignment (OPT_Struct typ) +INT32 OPT_BaseAlignment (OPT_Struct typ) { - int32 alignment; + INT32 alignment; if (typ->form == 13) { if (typ->comp == 4) { alignment = __MASK(typ->align, -65536); @@ -295,8 +295,8 @@ int32 OPT_BaseAlignment (OPT_Struct typ) void OPT_TypSize (OPT_Struct typ) { - int16 f, c; - int32 offset, size, base, fbase, off0; + INT16 f, c; + INT32 offset, size, base, fbase, off0; OPT_Object fld = NIL; OPT_Struct btyp = NIL; if (typ == OPT_undftyp) { @@ -339,7 +339,7 @@ void OPT_TypSize (OPT_Struct typ) } typ->size = offset; typ->align = base; - typ->sysflag = __MASK(typ->sysflag, -256) + (int16)__ASHL(offset - off0, 8); + typ->sysflag = __MASK(typ->sysflag, -256) + (INT16)__ASHL(offset - off0, 8); } else if (c == 2) { OPT_TypSize(typ->BaseTyp); typ->size = typ->n * typ->BaseTyp->size; @@ -378,7 +378,7 @@ OPT_Object OPT_NewObj (void) return obj; } -OPT_Struct OPT_NewStr (int8 form, int8 comp) +OPT_Struct OPT_NewStr (INT8 form, INT8 comp) { OPT_Struct typ = NIL; __NEW(typ, OPT_StrDesc); @@ -393,7 +393,7 @@ OPT_Struct OPT_NewStr (int8 form, int8 comp) return typ; } -OPT_Node OPT_NewNode (int8 class) +OPT_Node OPT_NewNode (INT8 class) { OPT_Node node = NIL; __NEW(node, OPT_NodeDesc); @@ -408,7 +408,7 @@ OPT_ConstExt OPT_NewExt (void) return ext; } -void OPT_OpenScope (int8 level, OPT_Object owner) +void OPT_OpenScope (INT8 level, OPT_Object owner) { OPT_Object head = NIL; head = OPT_NewObj(); @@ -429,7 +429,7 @@ void OPT_CloseScope (void) OPT_topScope = OPT_topScope->left; } -void OPT_Init (OPS_Name name, uint32 opt) +void OPT_Init (OPS_Name name, UINT32 opt) { OPT_topScope = OPT_universe; OPT_OpenScope(0, NIL); @@ -446,7 +446,7 @@ void OPT_Init (OPS_Name name, uint32 opt) void OPT_Close (void) { - int16 i; + INT16 i; OPT_CloseScope(); i = 0; while (i < 64) { @@ -538,7 +538,7 @@ void OPT_Insert (OPS_Name name, OPT_Object *obj) { OPT_Object ob0 = NIL, ob1 = NIL; BOOLEAN left; - int8 mnolev; + INT8 mnolev; ob0 = OPT_topScope; ob1 = ob0->right; left = 0; @@ -576,14 +576,14 @@ void OPT_Insert (OPS_Name name, OPT_Object *obj) *obj = ob1; } -static void OPT_FPrintName (int32 *fp, CHAR *name, LONGINT name__len) +static void OPT_FPrintName (INT32 *fp, CHAR *name, LONGINT name__len) { - int16 i; + INT16 i; CHAR ch; i = 0; do { ch = name[__X(i, name__len)]; - OPM_FPrint(&*fp, (int16)ch); + OPM_FPrint(&*fp, (INT16)ch); i += 1; } while (!(ch == 0x00)); } @@ -621,7 +621,7 @@ static void OPT_DebugStruct (OPT_Struct btyp) OPM_LogWLn(); } -static void OPT_FPrintSign (int32 *fp, OPT_Struct result, OPT_Object par) +static void OPT_FPrintSign (INT32 *fp, OPT_Struct result, OPT_Object par) { OPT_IdFPrint(result); OPM_FPrint(&*fp, result->idfp); @@ -637,8 +637,8 @@ void OPT_IdFPrint (OPT_Struct typ) { OPT_Struct btyp = NIL; OPT_Object strobj = NIL; - int32 idfp; - int16 f, c; + INT32 idfp; + INT16 f, c; if (!typ->idfpdone) { typ->idfpdone = 1; idfp = 0; @@ -667,17 +667,17 @@ void OPT_IdFPrint (OPT_Struct typ) } static struct FPrintStr__15 { - int32 *pbfp, *pvfp; + INT32 *pbfp, *pvfp; struct FPrintStr__15 *lnk; } *FPrintStr__15_s; -static void FPrintFlds__16 (OPT_Object fld, int32 adr, BOOLEAN visible); -static void FPrintHdFld__18 (OPT_Struct typ, OPT_Object fld, int32 adr); +static void FPrintFlds__16 (OPT_Object fld, INT32 adr, BOOLEAN visible); +static void FPrintHdFld__18 (OPT_Struct typ, OPT_Object fld, INT32 adr); static void FPrintTProcs__20 (OPT_Object obj); -static void FPrintHdFld__18 (OPT_Struct typ, OPT_Object fld, int32 adr) +static void FPrintHdFld__18 (OPT_Struct typ, OPT_Object fld, INT32 adr) { - int32 i, j, n; + INT32 i, j, n; OPT_Struct btyp = NIL; if (typ->comp == 4) { FPrintFlds__16(typ->link, adr, 0); @@ -707,7 +707,7 @@ static void FPrintHdFld__18 (OPT_Struct typ, OPT_Object fld, int32 adr) } } -static void FPrintFlds__16 (OPT_Object fld, int32 adr, BOOLEAN visible) +static void FPrintFlds__16 (OPT_Object fld, INT32 adr, BOOLEAN visible) { while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { @@ -742,10 +742,10 @@ static void FPrintTProcs__20 (OPT_Object obj) void OPT_FPrintStr (OPT_Struct typ) { - int16 f, c; + INT16 f, c; OPT_Struct btyp = NIL; OPT_Object strobj = NIL, bstrobj = NIL; - int32 pbfp, pvfp; + INT32 pbfp, pvfp; struct FPrintStr__15 _s; _s.pbfp = &pbfp; _s.pvfp = &pvfp; @@ -806,8 +806,8 @@ void OPT_FPrintStr (OPT_Struct typ) void OPT_FPrintObj (OPT_Object obj) { - int32 fprint; - int16 f, m; + INT32 fprint; + INT16 f, m; REAL rval; OPT_ConstExt ext = NIL; if (!obj->fpdone) { @@ -849,11 +849,11 @@ void OPT_FPrintObj (OPT_Object obj) } else if (obj->mode == 9) { OPT_FPrintSign(&fprint, obj->typ, obj->link); ext = obj->conval->ext; - m = (int16)(*ext)[0]; + m = (INT16)(*ext)[0]; f = 1; OPM_FPrint(&fprint, m); while (f <= m) { - OPM_FPrint(&fprint, (int16)(*ext)[__X(f, 256)]); + OPM_FPrint(&fprint, (INT16)(*ext)[__X(f, 256)]); f += 1; } } else if (obj->mode == 5) { @@ -864,9 +864,9 @@ void OPT_FPrintObj (OPT_Object obj) } } -void OPT_FPrintErr (OPT_Object obj, int16 errcode) +void OPT_FPrintErr (OPT_Object obj, INT16 errcode) { - int16 i, j; + INT16 i, j; CHAR ch; if (obj->mnolev != 0) { __COPY(OPT_GlbMod[__X(-obj->mnolev, 64)]->name, OPM_objname, 64); @@ -956,7 +956,7 @@ void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old) static void OPT_InName (CHAR *name, LONGINT name__len) { - int16 i; + INT16 i; CHAR ch; i = 0; do { @@ -966,12 +966,12 @@ static void OPT_InName (CHAR *name, LONGINT name__len) } while (!(ch == 0x00)); } -static void OPT_InMod (int8 *mno) +static void OPT_InMod (INT8 *mno) { OPT_Object head = NIL; OPS_Name name; - int32 mn; - int8 i; + INT32 mn; + INT8 i; mn = OPM_SymRInt(); if (mn == 0) { *mno = OPT_impCtxt.glbmno[0]; @@ -1008,16 +1008,16 @@ static void OPT_InMod (int8 *mno) } } -static void OPT_InConstant (int32 f, OPT_Const conval) +static void OPT_InConstant (INT32 f, OPT_Const conval) { CHAR ch; - int16 i; + INT16 i; OPT_ConstExt ext = NIL; REAL rval; switch (f) { case 1: case 3: case 2: OPM_SymRCh(&ch); - conval->intval = (int16)ch; + conval->intval = (INT16)ch; break; case 4: conval->intval = OPM_SymRInt(); @@ -1057,10 +1057,10 @@ static void OPT_InConstant (int32 f, OPT_Const conval) } } -static void OPT_InSign (int8 mno, OPT_Struct *res, OPT_Object *par) +static void OPT_InSign (INT8 mno, OPT_Struct *res, OPT_Object *par) { OPT_Object last = NIL, new = NIL; - int32 tag; + INT32 tag; OPT_InStruct(&*res); tag = OPM_SymRInt(); last = NIL; @@ -1087,7 +1087,7 @@ static void OPT_InSign (int8 mno, OPT_Struct *res, OPT_Object *par) static OPT_Object OPT_InFld (void) { - int32 tag; + INT32 tag; OPT_Object obj = NIL; tag = OPT_impCtxt.nextTag; obj = OPT_NewObj(); @@ -1115,9 +1115,9 @@ static OPT_Object OPT_InFld (void) return obj; } -static OPT_Object OPT_InTProc (int8 mno) +static OPT_Object OPT_InTProc (INT8 mno) { - int32 tag; + INT32 tag; OPT_Object obj = NIL; tag = OPT_impCtxt.nextTag; obj = OPT_NewObj(); @@ -1141,7 +1141,7 @@ static OPT_Object OPT_InTProc (int8 mno) return obj; } -static OPT_Struct OPT_InTyp (int32 tag) +static OPT_Struct OPT_InTyp (INT32 tag) { if (tag == 4) { return OPT_IntType(OPM_SymRInt()); @@ -1155,9 +1155,9 @@ static OPT_Struct OPT_InTyp (int32 tag) static void OPT_InStruct (OPT_Struct *typ) { - int8 mno; - int16 ref; - int32 tag; + INT8 mno; + INT16 ref; + INT32 tag; OPS_Name name; OPT_Struct t = NIL; OPT_Object obj = NIL, last = NIL, fld = NIL, old = NIL, dummy = NIL; @@ -1213,7 +1213,7 @@ static void OPT_InStruct (OPT_Struct *typ) obj->vis = 0; tag = OPM_SymRInt(); if (tag == 35) { - (*typ)->sysflag = (int16)OPM_SymRInt(); + (*typ)->sysflag = (INT16)OPM_SymRInt(); tag = OPM_SymRInt(); } switch (tag) { @@ -1335,13 +1335,13 @@ static void OPT_InStruct (OPT_Struct *typ) } } -static OPT_Object OPT_InObj (int8 mno) +static OPT_Object OPT_InObj (INT8 mno) { - int16 i, s; + INT16 i, s; CHAR ch; OPT_Object obj = NIL, old = NIL; OPT_Struct typ = NIL; - int32 tag; + INT32 tag; OPT_ConstExt ext = NIL; tag = OPT_impCtxt.nextTag; if (tag == 19) { @@ -1374,7 +1374,7 @@ static OPT_Object OPT_InObj (int8 mno) obj->mode = 9; ext = OPT_NewExt(); obj->conval->ext = ext; - s = (int16)OPM_SymRInt(); + s = (INT16)OPM_SymRInt(); (*ext)[0] = (CHAR)s; i = 1; while (i <= s) { @@ -1439,7 +1439,7 @@ static OPT_Object OPT_InObj (int8 mno) void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) { OPT_Object obj = NIL; - int8 mno; + INT8 mno; OPS_Name aliasName__copy; __DUPARR(aliasName, OPS_Name); if (__STRCMP(name, "SYSTEM") == 0) { @@ -1482,7 +1482,7 @@ void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) static void OPT_OutName (CHAR *name, LONGINT name__len) { - int16 i; + INT16 i; CHAR ch; i = 0; do { @@ -1492,7 +1492,7 @@ static void OPT_OutName (CHAR *name, LONGINT name__len) } while (!(ch == 0x00)); } -static void OPT_OutMod (int16 mno) +static void OPT_OutMod (INT16 mno) { if (OPT_expCtxt.locmno[__X(mno, 64)] < 0) { OPM_SymWInt(16); @@ -1504,9 +1504,9 @@ static void OPT_OutMod (int16 mno) } } -static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, int32 adr) +static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, INT32 adr) { - int32 i, j, n; + INT32 i, j, n; OPT_Struct btyp = NIL; if (typ->comp == 4) { OPT_OutFlds(typ->link, adr, 0); @@ -1536,7 +1536,7 @@ static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, int32 adr) } } -static void OPT_OutFlds (OPT_Object fld, int32 adr, BOOLEAN visible) +static void OPT_OutFlds (OPT_Object fld, INT32 adr, BOOLEAN visible) { while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { @@ -1691,7 +1691,7 @@ static void OPT_OutStr (OPT_Struct typ) static void OPT_OutConstant (OPT_Object obj) { - int16 f; + INT16 f; REAL rval; f = obj->typ->form; OPM_SymWInt(f); @@ -1727,7 +1727,7 @@ static void OPT_OutConstant (OPT_Object obj) static void OPT_OutObj (OPT_Object obj) { - int16 i, j; + INT16 i, j; OPT_ConstExt ext = NIL; if (obj != NIL) { OPT_OutObj(obj->left); @@ -1794,7 +1794,7 @@ static void OPT_OutObj (OPT_Object obj) OPM_SymWInt(33); OPT_OutSign(obj->typ, obj->link); ext = obj->conval->ext; - j = (int16)(*ext)[0]; + j = (INT16)(*ext)[0]; i = 1; OPM_SymWInt(j); while (i <= j) { @@ -1817,8 +1817,8 @@ static void OPT_OutObj (OPT_Object obj) void OPT_Export (BOOLEAN *ext, BOOLEAN *new) { - int16 i; - int8 nofmod; + INT16 i; + INT8 nofmod; BOOLEAN done; OPT_symExtended = 0; OPT_symNew = 0; @@ -1857,7 +1857,7 @@ void OPT_Export (BOOLEAN *ext, BOOLEAN *new) } } -static void OPT_InitStruct (OPT_Struct *typ, int8 form) +static void OPT_InitStruct (OPT_Struct *typ, INT8 form) { *typ = OPT_NewStr(form, 1); (*typ)->ref = form; @@ -1871,7 +1871,7 @@ static void OPT_InitStruct (OPT_Struct *typ, int8 form) (*typ)->idfpdone = 1; } -static void OPT_EnterBoolConst (OPS_Name name, int32 value) +static void OPT_EnterBoolConst (OPS_Name name, INT32 value) { OPT_Object obj = NIL; OPS_Name name__copy; @@ -1883,7 +1883,7 @@ static void OPT_EnterBoolConst (OPS_Name name, int32 value) obj->conval->intval = value; } -static void OPT_EnterTyp (OPS_Name name, int8 form, int16 size, OPT_Struct *res) +static void OPT_EnterTyp (OPS_Name name, INT8 form, INT16 size, OPT_Struct *res) { OPT_Object obj = NIL; OPT_Struct typ = NIL; @@ -1918,7 +1918,7 @@ static void OPT_EnterTypeAlias (OPS_Name name, OPT_Object *res) *res = obj; } -static void OPT_EnterProc (OPS_Name name, int16 num) +static void OPT_EnterProc (OPS_Name name, INT16 num) { OPT_Object obj = NIL; OPS_Name name__copy; diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index 38cd17c7..66f25d3d 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h @@ -15,9 +15,9 @@ typedef typedef struct OPT_ConstDesc { OPT_ConstExt ext; - int64 intval; - int32 intval2; - uint64 setval; + INT64 intval; + INT32 intval2; + UINT64 setval; LONGREAL realval; } OPT_ConstDesc; @@ -33,7 +33,7 @@ typedef typedef struct OPT_NodeDesc { OPT_Node left, right, link; - int8 class, subcl; + INT8 class, subcl; BOOLEAN readonly; OPT_Struct typ; OPT_Object obj; @@ -45,20 +45,20 @@ typedef OPT_Object left, right, link, scope; OPS_Name name; BOOLEAN leaf; - int8 mode, mnolev, vis, history; + INT8 mode, mnolev, vis, history; BOOLEAN used, fpdone; - int32 fprint; + INT32 fprint; OPT_Struct typ; OPT_Const conval; - int32 adr, linkadr; - int16 x; + INT32 adr, linkadr; + INT16 x; } OPT_ObjDesc; typedef struct OPT_StrDesc { - int8 form, comp, mno, extlev; - int16 ref, sysflag; - int32 n, size, align, txtpos; + INT8 form, comp, mno, extlev; + INT16 ref, sysflag; + INT32 n, size, align, txtpos; BOOLEAN allocated, pbused, pvused; char _prvt0[16]; OPT_Struct BaseTyp; @@ -69,22 +69,22 @@ typedef import OPT_Object OPT_topScope; import OPT_Struct OPT_undftyp, OPT_niltyp, OPT_notyp, OPT_bytetyp, OPT_cpbytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_settyp, OPT_set32typ, OPT_set64typ, OPT_realtyp, OPT_lrltyp, OPT_stringtyp, OPT_adrtyp, OPT_sysptrtyp; import OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj, OPT_setobj; -import int8 OPT_nofGmod; +import INT8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; import BOOLEAN OPT_SYSimported; -import address *OPT_ConstDesc__typ; -import address *OPT_ObjDesc__typ; -import address *OPT_StrDesc__typ; -import address *OPT_NodeDesc__typ; +import ADDRESS *OPT_ConstDesc__typ; +import ADDRESS *OPT_ObjDesc__typ; +import ADDRESS *OPT_StrDesc__typ; +import ADDRESS *OPT_NodeDesc__typ; -import void OPT_Align (int32 *adr, int32 base); -import int32 OPT_BaseAlignment (OPT_Struct typ); +import void OPT_Align (INT32 *adr, INT32 base); +import INT32 OPT_BaseAlignment (OPT_Struct typ); import void OPT_Close (void); import void OPT_CloseScope (void); import void OPT_Export (BOOLEAN *ext, BOOLEAN *new); -import void OPT_FPrintErr (OPT_Object obj, int16 errcode); +import void OPT_FPrintErr (OPT_Object obj, INT16 errcode); import void OPT_FPrintObj (OPT_Object obj); import void OPT_FPrintStr (OPT_Struct typ); import void OPT_Find (OPT_Object *res); @@ -92,21 +92,21 @@ import void OPT_FindField (OPS_Name name, OPT_Struct typ, OPT_Object *res); import void OPT_FindImport (OPT_Object mod, OPT_Object *res); import void OPT_IdFPrint (OPT_Struct typ); import void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); -import void OPT_Init (OPS_Name name, uint32 opt); +import void OPT_Init (OPS_Name name, UINT32 opt); import void OPT_InitRecno (void); import void OPT_Insert (OPS_Name name, OPT_Object *obj); import void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); -import int16 OPT_IntSize (int64 n); -import OPT_Struct OPT_IntType (int32 size); +import INT16 OPT_IntSize (INT64 n); +import OPT_Struct OPT_IntType (INT32 size); import OPT_Const OPT_NewConst (void); import OPT_ConstExt OPT_NewExt (void); -import OPT_Node OPT_NewNode (int8 class); +import OPT_Node OPT_NewNode (INT8 class); import OPT_Object OPT_NewObj (void); -import OPT_Struct OPT_NewStr (int8 form, int8 comp); -import void OPT_OpenScope (int8 level, OPT_Object owner); -import OPT_Struct OPT_SetType (int32 size); -import OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir); -import int32 OPT_SizeAlignment (int32 size); +import OPT_Struct OPT_NewStr (INT8 form, INT8 comp); +import void OPT_OpenScope (INT8 level, OPT_Object owner); +import OPT_Struct OPT_SetType (INT32 size); +import OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INT16 dir); +import INT32 OPT_SizeAlignment (INT32 size); import void OPT_TypSize (OPT_Struct typ); import void *OPT__init(void); diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index f44318ed..8854dd67 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "OPC.h" @@ -13,42 +13,42 @@ typedef struct OPV_ExitInfo { - int16 level, label; + INT16 level, label; } OPV_ExitInfo; -static int16 OPV_stamp; +static INT16 OPV_stamp; static OPV_ExitInfo OPV_exit; -static int16 OPV_nofExitLabels; +static INT16 OPV_nofExitLabels; -export address *OPV_ExitInfo__typ; +export ADDRESS *OPV_ExitInfo__typ; static void OPV_ActualPar (OPT_Node n, OPT_Object fp); export void OPV_AdrAndSize (OPT_Object topScope); static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc); -static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int16 prec); +static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INT16 prec); static void OPV_DefineTDescs (OPT_Node n); -static void OPV_Entier (OPT_Node n, int16 prec); +static void OPV_Entier (OPT_Node n, INT16 prec); static void OPV_GetTProcNum (OPT_Object obj); static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc); static BOOLEAN OPV_ImplicitReturn (OPT_Node n); -static void OPV_Index (OPT_Node n, OPT_Node d, int16 prec, int16 dim); +static void OPV_Index (OPT_Node n, OPT_Node d, INT16 prec, INT16 dim); export void OPV_Init (void); static void OPV_InitTDescs (OPT_Node n); -static void OPV_Len (OPT_Node n, int64 dim); +static void OPV_Len (OPT_Node n, INT64 dim); export void OPV_Module (OPT_Node prog); static void OPV_NewArr (OPT_Node d, OPT_Node x); -static void OPV_ParIntLiteral (int64 n, int32 size); -static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp); +static void OPV_ParIntLiteral (INT64 n, INT32 size); +static INT16 OPV_Precedence (INT16 class, INT16 subclass, INT16 form, INT16 comp); static BOOLEAN OPV_SideEffects (OPT_Node n); -static void OPV_SizeCast (OPT_Node n, int32 to); +static void OPV_SizeCast (OPT_Node n, INT32 to); static void OPV_Stamp (OPS_Name s); static OPT_Object OPV_SuperProc (OPT_Node n); static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported); static void OPV_TraverseRecord (OPT_Struct typ); static void OPV_TypeOf (OPT_Node n); -static void OPV_design (OPT_Node n, int16 prec); -static void OPV_expr (OPT_Node n, int16 prec); +static void OPV_design (OPT_Node n, INT16 prec); +static void OPV_expr (OPT_Node n, INT16 prec); static void OPV_stat (OPT_Node n, OPT_Object outerProc); @@ -60,7 +60,7 @@ void OPV_Init (void) static void OPV_GetTProcNum (OPT_Object obj) { - int32 oldPos; + INT32 oldPos; OPT_Struct typ = NIL; OPT_Object redef = NIL; oldPos = OPM_errpos; @@ -96,7 +96,7 @@ static void OPV_TraverseRecord (OPT_Struct typ) static void OPV_Stamp (OPS_Name s) { - int16 i, j, k; + INT16 i, j, k; CHAR n[10]; OPV_stamp += 1; i = 0; @@ -126,7 +126,7 @@ static void OPV_Stamp (OPS_Name s) static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported) { - int16 mode; + INT16 mode; OPT_Object scope = NIL; OPT_Struct typ = NIL; if (obj != NIL) { @@ -205,7 +205,7 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_sysptrtyp->strobj->linkadr = 2; } -static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp) +static INT16 OPV_Precedence (INT16 class, INT16 subclass, INT16 form, INT16 comp) { switch (class) { case 7: case 0: case 2: case 4: case 9: @@ -315,7 +315,7 @@ static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp __RETCHK; } -static void OPV_Len (OPT_Node n, int64 dim) +static void OPV_Len (OPT_Node n, INT64 dim) { while ((n->class == 4 && n->typ->comp == 3)) { dim += 1; @@ -341,7 +341,7 @@ static BOOLEAN OPV_SideEffects (OPT_Node n) __RETCHK; } -static void OPV_Entier (OPT_Node n, int16 prec) +static void OPV_Entier (OPT_Node n, INT16 prec) { if (__IN(n->typ->form, 0x60, 32)) { OPM_WriteString((CHAR*)"__ENTIER(", 10); @@ -352,7 +352,7 @@ static void OPV_Entier (OPT_Node n, int16 prec) } } -static void OPV_SizeCast (OPT_Node n, int32 to) +static void OPV_SizeCast (OPT_Node n, INT32 to) { if ((to < n->typ->size && __IN(2, OPM_Options, 32))) { OPM_WriteString((CHAR*)"__SHORT", 8); @@ -366,16 +366,16 @@ static void OPV_SizeCast (OPT_Node n, int32 to) OPM_Write(')'); } else { if ((n->typ->size != to && (n->typ->size > 4 || to != 4))) { - OPM_WriteString((CHAR*)"(int", 5); + OPM_WriteString((CHAR*)"(INT", 5); OPM_WriteInt(__ASHL(to, 3)); OPM_WriteString((CHAR*)")", 2); } } } -static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int16 prec) +static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INT16 prec) { - int16 from, to; + INT16 from, to; from = n->typ->form; to = newtype->form; if (to == 7) { @@ -432,7 +432,7 @@ static void OPV_TypeOf (OPT_Node n) } } -static void OPV_Index (OPT_Node n, OPT_Node d, int16 prec, int16 dim) +static void OPV_Index (OPT_Node n, OPT_Node d, INT16 prec, INT16 dim) { if (!__IN(0, OPM_Options, 32) || (n->right->class == 7 && (n->right->conval->intval == 0 || n->left->typ->comp != 3))) { OPV_expr(n->right, prec); @@ -449,18 +449,18 @@ static void OPV_Index (OPT_Node n, OPT_Node d, int16 prec, int16 dim) } } -static void OPV_design (OPT_Node n, int16 prec) +static void OPV_design (OPT_Node n, INT16 prec) { OPT_Object obj = NIL; OPT_Struct typ = NIL; - int16 class, designPrec, comp; + INT16 class, designPrec, comp; OPT_Node d = NIL, x = NIL; - int16 dims, i, _for__26; + INT16 dims, i, _for__26; comp = n->typ->comp; obj = n->obj; class = n->class; designPrec = OPV_Precedence(class, n->subcl, n->typ->form, comp); - if ((((((class == 0 && obj->mnolev > 0)) && (int16)obj->mnolev != OPM_level)) && prec == 10)) { + if ((((((class == 0 && obj->mnolev > 0)) && (INT16)obj->mnolev != OPM_level)) && prec == 10)) { designPrec = 9; } if (prec > designPrec) { @@ -559,7 +559,7 @@ static void OPV_design (OPT_Node n, int16 prec) if (__IN(3, OPM_Options, 32)) { if (typ->comp == 4) { OPM_WriteString((CHAR*)"__GUARDR(", 10); - if ((int16)obj->mnolev != OPM_level) { + if ((INT16)obj->mnolev != OPM_level) { OPM_WriteStringVar((void*)obj->scope->name, 256); OPM_WriteString((CHAR*)"__curr->", 9); OPC_Ident(obj); @@ -628,7 +628,7 @@ static void OPV_design (OPT_Node n, int16 prec) } } -static void OPV_ParIntLiteral (int64 n, int32 size) +static void OPV_ParIntLiteral (INT64 n, INT32 size) { OPM_WriteInt(n); } @@ -636,7 +636,7 @@ static void OPV_ParIntLiteral (int64 n, int32 size) static void OPV_ActualPar (OPT_Node n, OPT_Object fp) { OPT_Struct typ = NIL, aptyp = NIL; - int16 comp, form, mode, prec, dim; + INT16 comp, form, mode, prec, dim; OPM_Write('('); while (n != NIL) { typ = fp->typ; @@ -726,9 +726,9 @@ static OPT_Object OPV_SuperProc (OPT_Node n) return obj; } -static void OPV_expr (OPT_Node n, int16 prec) +static void OPV_expr (OPT_Node n, INT16 prec) { - int16 class, subclass, form, exprPrec; + INT16 class, subclass, form, exprPrec; OPT_Struct typ = NIL; OPT_Node l = NIL, r = NIL; OPT_Object proc = NIL; @@ -1050,7 +1050,7 @@ static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) OPT_Node if_ = NIL; OPT_Object obj = NIL; OPT_Struct typ = NIL; - int32 adr; + INT32 adr; if_ = n->left; while (if_ != NIL) { OPM_WriteString((CHAR*)"if ", 4); @@ -1100,8 +1100,8 @@ static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc) { OPT_Node switchCase = NIL, label = NIL; - int64 low, high; - int16 form, i; + INT64 low, high; + INT16 form, i; OPM_WriteString((CHAR*)"switch ", 8); OPV_expr(n->left, 12); OPM_Write(' '); @@ -1166,7 +1166,7 @@ static BOOLEAN OPV_ImplicitReturn (OPT_Node n) static void OPV_NewArr (OPT_Node d, OPT_Node x) { OPT_Struct typ = NIL, base = NIL; - int16 nofdim, nofdyn; + INT16 nofdim, nofdyn; typ = d->typ->BaseTyp; base = typ; nofdim = 0; diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index 2fa9186d..513d8dfa 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Out.c b/bootstrap/unix-44/Out.c index 0f0b9f79..04b1e484 100644 --- a/bootstrap/unix-44/Out.c +++ b/bootstrap/unix-44/Out.c @@ -1,37 +1,37 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "Platform.h" static CHAR Out_buf[128]; -static int16 Out_in; +static INT16 Out_in; export void Out_Char (CHAR ch); export void Out_Flush (void); -export void Out_Int (int64 x, int64 n); -static int32 Out_Length (CHAR *s, LONGINT s__len); +export void Out_Int (INT64 x, INT64 n); +static INT32 Out_Length (CHAR *s, LONGINT s__len); export void Out_Ln (void); -export void Out_LongReal (LONGREAL x, int16 n); +export void Out_LongReal (LONGREAL x, INT16 n); export void Out_Open (void); -export void Out_Real (REAL x, int16 n); -static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_); +export void Out_Real (REAL x, INT16 n); +static void Out_RealP (LONGREAL x, INT16 n, BOOLEAN long_); export void Out_String (CHAR *str, LONGINT str__len); -export LONGREAL Out_Ten (int16 e); -static void Out_digit (int64 n, CHAR *s, LONGINT s__len, int16 *i); -static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16 *i); +export LONGREAL Out_Ten (INT16 e); +static void Out_digit (INT64 n, CHAR *s, LONGINT s__len, INT16 *i); +static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, INT16 *i); #define Out_Entier64(x) (int64)(x) void Out_Flush (void) { - int16 error; + INT16 error; if (Out_in > 0) { error = Platform_Write(1, (address)Out_buf, Out_in); } @@ -54,9 +54,9 @@ void Out_Char (CHAR ch) } } -static int32 Out_Length (CHAR *s, LONGINT s__len) +static INT32 Out_Length (CHAR *s, LONGINT s__len) { - int32 l; + INT32 l; l = 0; while ((l < s__len && s[__X(l, s__len)] != 0x00)) { l += 1; @@ -66,8 +66,8 @@ static int32 Out_Length (CHAR *s, LONGINT s__len) void Out_String (CHAR *str, LONGINT str__len) { - int32 l; - int16 error; + INT32 l; + INT16 error; __DUP(str, str__len, CHAR); l = Out_Length((void*)str, str__len); if (Out_in + l > 128) { @@ -77,15 +77,15 @@ void Out_String (CHAR *str, LONGINT str__len) error = Platform_Write(1, (address)str, l); } else { __MOVE((address)str, (address)&Out_buf[__X(Out_in, 128)], l); - Out_in += (int16)l; + Out_in += (INT16)l; } __DEL(str); } -void Out_Int (int64 x, int64 n) +void Out_Int (INT64 x, INT64 n) { CHAR s[22]; - int16 i; + INT16 i; BOOLEAN negative; negative = x < 0; if (x == (-9223372036854775807-1)) { @@ -108,7 +108,7 @@ void Out_Int (int64 x, int64 n) s[__X(i, 22)] = '-'; i += 1; } - while (n > (int64)i) { + while (n > (INT64)i) { Out_Char(' '); n -= 1; } @@ -124,22 +124,22 @@ void Out_Ln (void) Out_Flush(); } -static void Out_digit (int64 n, CHAR *s, LONGINT s__len, int16 *i) +static void Out_digit (INT64 n, CHAR *s, LONGINT s__len, INT16 *i) { *i -= 1; s[__X(*i, s__len)] = (CHAR)(__MOD(n, 10) + 48); } -static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16 *i) +static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, INT16 *i) { - int16 j; - int32 l; + INT16 j; + INT32 l; __DUP(t, t__len, CHAR); l = Out_Length((void*)t, t__len); if (l > *i) { l = *i; } - *i -= (int16)l; + *i -= (INT16)l; j = 0; while (j < l) { s[__X(*i + j, s__len)] = t[__X(j, t__len)]; @@ -148,7 +148,7 @@ static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16 __DEL(t); } -LONGREAL Out_Ten (int16 e) +LONGREAL Out_Ten (INT16 e) { LONGREAL r, power; r = (LONGREAL)1; @@ -163,19 +163,19 @@ LONGREAL Out_Ten (int16 e) return r; } -static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_) +static void Out_RealP (LONGREAL x, INT16 n, BOOLEAN long_) { - int16 e; - int64 f; + INT16 e; + INT64 f; CHAR s[30]; - int16 i, el; + INT16 i, el; LONGREAL x0; BOOLEAN nn, en; - int64 m; - int16 d, dr; - e = (int16)__MASK(__ASHR((__VAL(int64, x)), 52), -2048); - f = __MASK((__VAL(int64, x)), -4503599627370496); - nn = (__VAL(int64, x) < 0 && !((e == 2047 && f != 0))); + INT64 m; + INT16 d, dr; + e = (INT16)__MASK(__ASHR((__VAL(INT64, x)), 52), -2048); + f = __MASK((__VAL(INT64, x)), -4503599627370496); + nn = (__VAL(INT64, x) < 0 && !((e == 2047 && f != 0))); if (nn) { n -= 1; } @@ -221,7 +221,7 @@ static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_) if (nn) { x = -x; } - e = (int16)__ASHR((e - 1023) * 77, 8); + e = (INT16)__ASHR((e - 1023) * 77, 8); if (e >= 0) { x = x / (LONGREAL)Out_Ten(e); } else { @@ -291,12 +291,12 @@ static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_) } } -void Out_Real (REAL x, int16 n) +void Out_Real (REAL x, INT16 n) { Out_RealP(x, n, 0); } -void Out_LongReal (LONGREAL x, int16 n) +void Out_LongReal (LONGREAL x, INT16 n) { Out_RealP(x, n, 1); } diff --git a/bootstrap/unix-44/Out.h b/bootstrap/unix-44/Out.h index fbaed75f..a685b291 100644 --- a/bootstrap/unix-44/Out.h +++ b/bootstrap/unix-44/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h @@ -10,13 +10,13 @@ import void Out_Char (CHAR ch); import void Out_Flush (void); -import void Out_Int (int64 x, int64 n); +import void Out_Int (INT64 x, INT64 n); import void Out_Ln (void); -import void Out_LongReal (LONGREAL x, int16 n); +import void Out_LongReal (LONGREAL x, INT16 n); import void Out_Open (void); -import void Out_Real (REAL x, int16 n); +import void Out_Real (REAL x, INT16 n); import void Out_String (CHAR *str, LONGINT str__len); -import LONGREAL Out_Ten (int16 e); +import LONGREAL Out_Ten (INT16 e); import void *Out__init(void); diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 5c021003..f130d638 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" @@ -14,92 +14,92 @@ typedef Platform_ArgPtr (*Platform_ArgVec)[1024]; typedef - int32 (*Platform_ArgVecPtr)[1]; + INT32 (*Platform_ArgVecPtr)[1]; typedef CHAR (*Platform_EnvPtr)[1024]; typedef struct Platform_FileIdentity { - int32 volume, index, mtime; + INT32 volume, index, mtime; } Platform_FileIdentity; typedef - void (*Platform_HaltProcedure)(int32); + void (*Platform_HaltProcedure)(INT32); typedef - void (*Platform_SignalHandler)(int32); + void (*Platform_SignalHandler)(INT32); export BOOLEAN Platform_LittleEndian; -export int32 Platform_MainStackFrame; -export int32 Platform_HaltCode; -export int16 Platform_PID; +export INT32 Platform_MainStackFrame; +export INT32 Platform_HaltCode; +export INT16 Platform_PID; export CHAR Platform_CWD[256]; -export int16 Platform_ArgCount; -export int32 Platform_ArgVector; +export INT16 Platform_ArgCount; +export INT32 Platform_ArgVector; static Platform_HaltProcedure Platform_HaltHandler; -static int32 Platform_TimeStart; -export int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; +static INT32 Platform_TimeStart; +export INT16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; export CHAR Platform_NL[3]; -export address *Platform_FileIdentity__typ; +export ADDRESS *Platform_FileIdentity__typ; -export BOOLEAN Platform_Absent (int16 e); -export int16 Platform_ArgPos (CHAR *s, LONGINT s__len); -export void Platform_AssertFail (int32 code); -export int16 Platform_Chdir (CHAR *n, LONGINT n__len); -export int16 Platform_Close (int32 h); -export BOOLEAN Platform_ConnectionFailed (int16 e); -export void Platform_Delay (int32 ms); -export BOOLEAN Platform_DifferentFilesystems (int16 e); -static void Platform_DisplayHaltCode (int32 code); -export int16 Platform_Error (void); -export void Platform_Exit (int16 code); -export void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len); -export void Platform_GetClock (int32 *t, int32 *d); +export BOOLEAN Platform_Absent (INT16 e); +export INT16 Platform_ArgPos (CHAR *s, LONGINT s__len); +export void Platform_AssertFail (INT32 code); +export INT16 Platform_Chdir (CHAR *n, LONGINT n__len); +export INT16 Platform_Close (INT32 h); +export BOOLEAN Platform_ConnectionFailed (INT16 e); +export void Platform_Delay (INT32 ms); +export BOOLEAN Platform_DifferentFilesystems (INT16 e); +static void Platform_DisplayHaltCode (INT32 code); +export INT16 Platform_Error (void); +export void Platform_Exit (INT16 code); +export void Platform_GetArg (INT16 n, CHAR *val, LONGINT val__len); +export void Platform_GetClock (INT32 *t, INT32 *d); export void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); -export void Platform_GetIntArg (int16 n, int32 *val); -export void Platform_GetTimeOfDay (int32 *sec, int32 *usec); -export void Platform_Halt (int32 code); -export int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ); -export int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); -export BOOLEAN Platform_Inaccessible (int16 e); -export void Platform_Init (int32 argc, int32 argvadr); -export BOOLEAN Platform_Interrupted (int16 e); -export void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); -export int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); -export BOOLEAN Platform_NoSuchDirectory (int16 e); -export int32 Platform_OSAllocate (int32 size); -export void Platform_OSFree (int32 address); -export int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); -export int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); -export int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n); -export int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n); -export int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); +export void Platform_GetIntArg (INT16 n, INT32 *val); +export void Platform_GetTimeOfDay (INT32 *sec, INT32 *usec); +export void Platform_Halt (INT32 code); +export INT16 Platform_Identify (INT32 h, Platform_FileIdentity *identity, ADDRESS *identity__typ); +export INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ); +export BOOLEAN Platform_Inaccessible (INT16 e); +export void Platform_Init (INT32 argc, INT32 argvadr); +export BOOLEAN Platform_Interrupted (INT16 e); +export void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d); +export INT16 Platform_New (CHAR *n, LONGINT n__len, INT32 *h); +export BOOLEAN Platform_NoSuchDirectory (INT16 e); +export INT32 Platform_OSAllocate (INT32 size); +export void Platform_OSFree (INT32 address); +export INT16 Platform_OldRO (CHAR *n, LONGINT n__len, INT32 *h); +export INT16 Platform_OldRW (CHAR *n, LONGINT n__len, INT32 *h); +export INT16 Platform_Read (INT32 h, INT32 p, INT32 l, INT32 *n); +export INT16 Platform_ReadBuf (INT32 h, SYSTEM_BYTE *b, LONGINT b__len, INT32 *n); +export INT16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); export BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); export BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); -export int16 Platform_Seek (int32 h, int32 offset, int16 whence); +export INT16 Platform_Seek (INT32 h, INT32 offset, INT16 whence); export void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); export void Platform_SetHalt (Platform_HaltProcedure p); export void Platform_SetInterruptHandler (Platform_SignalHandler handler); -export void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Platform_FileIdentity source); +export void Platform_SetMTime (Platform_FileIdentity *target, ADDRESS *target__typ, Platform_FileIdentity source); export void Platform_SetQuitHandler (Platform_SignalHandler handler); -export int16 Platform_Size (int32 h, int32 *l); -export int16 Platform_Sync (int32 h); -export int16 Platform_System (CHAR *cmd, LONGINT cmd__len); +export INT16 Platform_Size (INT32 h, INT32 *l); +export INT16 Platform_Sync (INT32 h); +export INT16 Platform_System (CHAR *cmd, LONGINT cmd__len); static void Platform_TestLittleEndian (void); -export int32 Platform_Time (void); -export BOOLEAN Platform_TimedOut (int16 e); -export BOOLEAN Platform_TooManyFiles (int16 e); -export int16 Platform_Truncate (int32 h, int32 l); -export int16 Platform_Unlink (CHAR *n, LONGINT n__len); -export int16 Platform_Write (int32 h, int32 p, int32 l); -static void Platform_YMDHMStoClock (int32 ye, int32 mo, int32 da, int32 ho, int32 mi, int32 se, int32 *t, int32 *d); +export INT32 Platform_Time (void); +export BOOLEAN Platform_TimedOut (INT16 e); +export BOOLEAN Platform_TooManyFiles (INT16 e); +export INT16 Platform_Truncate (INT32 h, INT32 l); +export INT16 Platform_Unlink (CHAR *n, LONGINT n__len); +export INT16 Platform_Write (INT32 h, INT32 p, INT32 l); +static void Platform_YMDHMStoClock (INT32 ye, INT32 mo, INT32 da, INT32 ho, INT32 mi, INT32 se, INT32 *t, INT32 *d); static void Platform_errch (CHAR c); -static void Platform_errint (int32 l); +static void Platform_errint (INT32 l); static void Platform_errln (void); -static void Platform_errposint (int32 l); +static void Platform_errposint (INT32 l); export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); #include @@ -127,7 +127,7 @@ export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT #define Platform_EXDEV() EXDEV extern void Heap_InitHeap(); #define Platform_HeapInitHeap() Heap_InitHeap() -#define Platform_allocate(size) (address)((void*)malloc((size_t)size)) +#define Platform_allocate(size) (ADDRESS)((void*)malloc((size_t)size)) #define Platform_chdir(n, n__len) chdir((char*)n) #define Platform_closefile(fd) close(fd) #define Platform_err() errno @@ -147,13 +147,13 @@ extern void Heap_InitHeap(); #define Platform_opennew(n, n__len) open((char*)n, O_CREAT | O_TRUNC | O_RDWR, 0664) #define Platform_openro(n, n__len) open((char*)n, O_RDONLY) #define Platform_openrw(n, n__len) open((char*)n, O_RDWR) -#define Platform_readfile(fd, p, l) (LONGINT)read(fd, (void*)(address)(p), l) +#define Platform_readfile(fd, p, l) (LONGINT)read(fd, (void*)(ADDRESS)(p), l) #define Platform_rename(o, o__len, n, n__len) rename((char*)o, (char*)n) #define Platform_sectotm(s) struct tm *time = localtime((time_t*)&s) #define Platform_seekcur() SEEK_CUR #define Platform_seekend() SEEK_END #define Platform_seekset() SEEK_SET -#define Platform_sethandler(s, h) SystemSetHandler(s, (address)h) +#define Platform_sethandler(s, h) SystemSetHandler(s, (ADDRESS)h) #define Platform_stat(n, n__len) stat((char*)n, &s) #define Platform_statdev() (LONGINT)s.st_dev #define Platform_statino() (LONGINT)s.st_ino @@ -170,63 +170,63 @@ extern void Heap_InitHeap(); #define Platform_tvsec() tv.tv_sec #define Platform_tvusec() tv.tv_usec #define Platform_unlink(n, n__len) unlink((char*)n) -#define Platform_writefile(fd, p, l) write(fd, (void*)(address)(p), l) +#define Platform_writefile(fd, p, l) write(fd, (void*)(ADDRESS)(p), l) -BOOLEAN Platform_TooManyFiles (int16 e) +BOOLEAN Platform_TooManyFiles (INT16 e) { return e == Platform_EMFILE() || e == Platform_ENFILE(); } -BOOLEAN Platform_NoSuchDirectory (int16 e) +BOOLEAN Platform_NoSuchDirectory (INT16 e) { return e == Platform_ENOENT(); } -BOOLEAN Platform_DifferentFilesystems (int16 e) +BOOLEAN Platform_DifferentFilesystems (INT16 e) { return e == Platform_EXDEV(); } -BOOLEAN Platform_Inaccessible (int16 e) +BOOLEAN Platform_Inaccessible (INT16 e) { return (e == Platform_EACCES() || e == Platform_EROFS()) || e == Platform_EAGAIN(); } -BOOLEAN Platform_Absent (int16 e) +BOOLEAN Platform_Absent (INT16 e) { return e == Platform_ENOENT(); } -BOOLEAN Platform_TimedOut (int16 e) +BOOLEAN Platform_TimedOut (INT16 e) { return e == Platform_ETIMEDOUT(); } -BOOLEAN Platform_ConnectionFailed (int16 e) +BOOLEAN Platform_ConnectionFailed (INT16 e) { return ((e == Platform_ECONNREFUSED() || e == Platform_ECONNABORTED()) || e == Platform_ENETUNREACH()) || e == Platform_EHOSTUNREACH(); } -BOOLEAN Platform_Interrupted (int16 e) +BOOLEAN Platform_Interrupted (INT16 e) { return e == Platform_EINTR(); } -int32 Platform_OSAllocate (int32 size) +INT32 Platform_OSAllocate (INT32 size) { return Platform_allocate(size); } -void Platform_OSFree (int32 address) +void Platform_OSFree (INT32 address) { Platform_free(address); } -void Platform_Init (int32 argc, int32 argvadr) +void Platform_Init (INT32 argc, INT32 argvadr) { Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; - Platform_ArgCount = __VAL(int16, argc); + Platform_ArgCount = __VAL(INT16, argc); av = (Platform_ArgVecPtr)(address)argvadr; Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; @@ -254,7 +254,7 @@ void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len) __DEL(var); } -void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len) +void Platform_GetArg (INT16 n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { @@ -263,10 +263,10 @@ void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len) } } -void Platform_GetIntArg (int16 n, int32 *val) +void Platform_GetIntArg (INT16 n, INT32 *val) { CHAR s[64]; - int32 k, d, i; + INT32 k, d, i; s[0] = 0x00; Platform_GetArg(n, (void*)s, 64); i = 0; @@ -274,11 +274,11 @@ void Platform_GetIntArg (int16 n, int32 *val) i = 1; } k = 0; - d = (int16)s[__X(i, 64)] - 48; + d = (INT16)s[__X(i, 64)] - 48; while ((d >= 0 && d <= 9)) { k = k * 10 + d; i += 1; - d = (int16)s[__X(i, 64)] - 48; + d = (INT16)s[__X(i, 64)] - 48; } if (s[0] == '-') { k = -k; @@ -289,9 +289,9 @@ void Platform_GetIntArg (int16 n, int32 *val) } } -int16 Platform_ArgPos (CHAR *s, LONGINT s__len) +INT16 Platform_ArgPos (CHAR *s, LONGINT s__len) { - int16 i; + INT16 i; CHAR arg[256]; __DUP(s, s__len, CHAR); i = 0; @@ -319,57 +319,57 @@ void Platform_SetBadInstructionHandler (Platform_SignalHandler handler) Platform_sethandler(4, handler); } -static void Platform_YMDHMStoClock (int32 ye, int32 mo, int32 da, int32 ho, int32 mi, int32 se, int32 *t, int32 *d) +static void Platform_YMDHMStoClock (INT32 ye, INT32 mo, INT32 da, INT32 ho, INT32 mi, INT32 se, INT32 *t, INT32 *d) { *d = (__ASHL((int)__MOD(ye, 100), 9) + __ASHL(mo + 1, 5)) + da; *t = (__ASHL(ho, 12) + __ASHL(mi, 6)) + se; } -void Platform_GetClock (int32 *t, int32 *d) +void Platform_GetClock (INT32 *t, INT32 *d) { Platform_gettimeval(); Platform_sectotm(Platform_tvsec()); Platform_YMDHMStoClock(Platform_tmyear(), Platform_tmmon(), Platform_tmmday(), Platform_tmhour(), Platform_tmmin(), Platform_tmsec(), &*t, &*d); } -void Platform_GetTimeOfDay (int32 *sec, int32 *usec) +void Platform_GetTimeOfDay (INT32 *sec, INT32 *usec) { Platform_gettimeval(); *sec = Platform_tvsec(); *usec = Platform_tvusec(); } -int32 Platform_Time (void) +INT32 Platform_Time (void) { - int32 ms; + INT32 ms; Platform_gettimeval(); ms = (int)__DIVF(Platform_tvusec(), 1000) + Platform_tvsec() * 1000; return (int)__MOD(ms - Platform_TimeStart, 2147483647); } -void Platform_Delay (int32 ms) +void Platform_Delay (INT32 ms) { - int32 s, ns; + INT32 s, ns; s = __DIV(ms, 1000); ns = (int)__MOD(ms, 1000) * 1000000; Platform_nanosleep(s, ns); } -int16 Platform_System (CHAR *cmd, LONGINT cmd__len) +INT16 Platform_System (CHAR *cmd, LONGINT cmd__len) { __DUP(cmd, cmd__len, CHAR); __DEL(cmd); return Platform_system(cmd, cmd__len); } -int16 Platform_Error (void) +INT16 Platform_Error (void) { return Platform_err(); } -int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h) +INT16 Platform_OldRO (CHAR *n, LONGINT n__len, INT32 *h) { - int16 fd; + INT16 fd; fd = Platform_openro(n, n__len); if (fd < 0) { return Platform_err(); @@ -380,9 +380,9 @@ int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h) __RETCHK; } -int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h) +INT16 Platform_OldRW (CHAR *n, LONGINT n__len, INT32 *h) { - int16 fd; + INT16 fd; fd = Platform_openrw(n, n__len); if (fd < 0) { return Platform_err(); @@ -393,9 +393,9 @@ int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h) __RETCHK; } -int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h) +INT16 Platform_New (CHAR *n, LONGINT n__len, INT32 *h) { - int16 fd; + INT16 fd; fd = Platform_opennew(n, n__len); if (fd < 0) { return Platform_err(); @@ -406,7 +406,7 @@ int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h) __RETCHK; } -int16 Platform_Close (int32 h) +INT16 Platform_Close (INT32 h) { if (Platform_closefile(h) < 0) { return Platform_err(); @@ -416,7 +416,7 @@ int16 Platform_Close (int32 h) __RETCHK; } -int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ) +INT16 Platform_Identify (INT32 h, Platform_FileIdentity *identity, ADDRESS *identity__typ) { Platform_structstats(); if (Platform_fstat(h) < 0) { @@ -428,7 +428,7 @@ int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *iden return 0; } -int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ) +INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ) { __DUP(n, n__len, CHAR); Platform_structstats(); @@ -453,18 +453,18 @@ BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i return i1.mtime == i2.mtime; } -void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Platform_FileIdentity source) +void Platform_SetMTime (Platform_FileIdentity *target, ADDRESS *target__typ, Platform_FileIdentity source) { (*target).mtime = source.mtime; } -void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d) +void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d) { Platform_sectotm(i.mtime); Platform_YMDHMStoClock(Platform_tmyear(), Platform_tmmon(), Platform_tmmday(), Platform_tmhour(), Platform_tmmin(), Platform_tmsec(), &*t, &*d); } -int16 Platform_Size (int32 h, int32 *l) +INT16 Platform_Size (INT32 h, INT32 *l) { Platform_structstats(); if (Platform_fstat(h) < 0) { @@ -474,7 +474,7 @@ int16 Platform_Size (int32 h, int32 *l) return 0; } -int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n) +INT16 Platform_Read (INT32 h, INT32 p, INT32 l, INT32 *n) { *n = Platform_readfile(h, p, l); if (*n < 0) { @@ -486,7 +486,7 @@ int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n) __RETCHK; } -int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n) +INT16 Platform_ReadBuf (INT32 h, SYSTEM_BYTE *b, LONGINT b__len, INT32 *n) { *n = Platform_readfile(h, (address)b, b__len); if (*n < 0) { @@ -498,9 +498,9 @@ int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n) __RETCHK; } -int16 Platform_Write (int32 h, int32 p, int32 l) +INT16 Platform_Write (INT32 h, INT32 p, INT32 l) { - int32 written; + INT32 written; written = Platform_writefile(h, p, l); if (written < 0) { return Platform_err(); @@ -510,7 +510,7 @@ int16 Platform_Write (int32 h, int32 p, int32 l) __RETCHK; } -int16 Platform_Sync (int32 h) +INT16 Platform_Sync (INT32 h) { if (Platform_fsync(h) < 0) { return Platform_err(); @@ -520,7 +520,7 @@ int16 Platform_Sync (int32 h) __RETCHK; } -int16 Platform_Seek (int32 h, int32 offset, int16 whence) +INT16 Platform_Seek (INT32 h, INT32 offset, INT16 whence) { if (Platform_lseek(h, offset, whence) < 0) { return Platform_err(); @@ -530,7 +530,7 @@ int16 Platform_Seek (int32 h, int32 offset, int16 whence) __RETCHK; } -int16 Platform_Truncate (int32 h, int32 l) +INT16 Platform_Truncate (INT32 h, INT32 l) { if (Platform_ftruncate(h, l) < 0) { return Platform_err(); @@ -540,7 +540,7 @@ int16 Platform_Truncate (int32 h, int32 l) __RETCHK; } -int16 Platform_Unlink (CHAR *n, LONGINT n__len) +INT16 Platform_Unlink (CHAR *n, LONGINT n__len) { if (Platform_unlink(n, n__len) < 0) { return Platform_err(); @@ -550,9 +550,9 @@ int16 Platform_Unlink (CHAR *n, LONGINT n__len) __RETCHK; } -int16 Platform_Chdir (CHAR *n, LONGINT n__len) +INT16 Platform_Chdir (CHAR *n, LONGINT n__len) { - int16 r; + INT16 r; if ((Platform_chdir(n, n__len) >= 0 && Platform_getcwd((void*)Platform_CWD, 256) != NIL)) { return 0; } else { @@ -561,7 +561,7 @@ int16 Platform_Chdir (CHAR *n, LONGINT n__len) __RETCHK; } -int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) +INT16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) { if (Platform_rename(o, o__len, n, n__len) < 0) { return Platform_err(); @@ -571,7 +571,7 @@ int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) __RETCHK; } -void Platform_Exit (int16 code) +void Platform_Exit (INT16 code) { Platform_exit(code); } @@ -586,7 +586,7 @@ static void Platform_errln (void) Platform_errch(0x0a); } -static void Platform_errposint (int32 l) +static void Platform_errposint (INT32 l) { if (l > 10) { Platform_errposint(__DIV(l, 10)); @@ -594,7 +594,7 @@ static void Platform_errposint (int32 l) Platform_errch((CHAR)(48 + (int)__MOD(l, 10))); } -static void Platform_errint (int32 l) +static void Platform_errint (INT32 l) { if (l < 0) { Platform_errch('-'); @@ -603,7 +603,7 @@ static void Platform_errint (int32 l) Platform_errposint(l); } -static void Platform_DisplayHaltCode (int32 code) +static void Platform_DisplayHaltCode (INT32 code) { switch (code) { case -1: @@ -659,7 +659,7 @@ static void Platform_DisplayHaltCode (int32 code) } } -void Platform_Halt (int32 code) +void Platform_Halt (INT32 code) { Platform_HaltCode = code; if (Platform_HaltHandler != NIL) { @@ -672,10 +672,10 @@ void Platform_Halt (int32 code) Platform_DisplayHaltCode(code); } Platform_errln(); - Platform_exit(__VAL(int16, code)); + Platform_exit(__VAL(INT16, code)); } -void Platform_AssertFail (int32 code) +void Platform_AssertFail (INT32 code) { Platform_errstring((CHAR*)"Assertion failure.", 19); if (code != 0) { @@ -684,7 +684,7 @@ void Platform_AssertFail (int32 code) Platform_errstring((CHAR*)".", 2); } Platform_errln(); - Platform_exit(__VAL(int16, code)); + Platform_exit(__VAL(INT16, code)); } void Platform_SetHalt (Platform_HaltProcedure p) @@ -694,7 +694,7 @@ void Platform_SetHalt (Platform_HaltProcedure p) static void Platform_TestLittleEndian (void) { - int16 i; + INT16 i; i = 1; __GET((address)&i, Platform_LittleEndian, BOOLEAN); } diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index 18456e59..ff45e732 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h @@ -7,77 +7,77 @@ typedef struct Platform_FileIdentity { - int32 _prvt0; + INT32 _prvt0; char _prvt1[8]; } Platform_FileIdentity; typedef - void (*Platform_HaltProcedure)(int32); + void (*Platform_HaltProcedure)(INT32); typedef - void (*Platform_SignalHandler)(int32); + void (*Platform_SignalHandler)(INT32); import BOOLEAN Platform_LittleEndian; -import int32 Platform_MainStackFrame; -import int32 Platform_HaltCode; -import int16 Platform_PID; +import INT32 Platform_MainStackFrame; +import INT32 Platform_HaltCode; +import INT16 Platform_PID; import CHAR Platform_CWD[256]; -import int16 Platform_ArgCount; -import int32 Platform_ArgVector; -import int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; +import INT16 Platform_ArgCount; +import INT32 Platform_ArgVector; +import INT16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; import CHAR Platform_NL[3]; -import address *Platform_FileIdentity__typ; +import ADDRESS *Platform_FileIdentity__typ; -import BOOLEAN Platform_Absent (int16 e); -import int16 Platform_ArgPos (CHAR *s, LONGINT s__len); -import void Platform_AssertFail (int32 code); -import int16 Platform_Chdir (CHAR *n, LONGINT n__len); -import int16 Platform_Close (int32 h); -import BOOLEAN Platform_ConnectionFailed (int16 e); -import void Platform_Delay (int32 ms); -import BOOLEAN Platform_DifferentFilesystems (int16 e); -import int16 Platform_Error (void); -import void Platform_Exit (int16 code); -import void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len); -import void Platform_GetClock (int32 *t, int32 *d); +import BOOLEAN Platform_Absent (INT16 e); +import INT16 Platform_ArgPos (CHAR *s, LONGINT s__len); +import void Platform_AssertFail (INT32 code); +import INT16 Platform_Chdir (CHAR *n, LONGINT n__len); +import INT16 Platform_Close (INT32 h); +import BOOLEAN Platform_ConnectionFailed (INT16 e); +import void Platform_Delay (INT32 ms); +import BOOLEAN Platform_DifferentFilesystems (INT16 e); +import INT16 Platform_Error (void); +import void Platform_Exit (INT16 code); +import void Platform_GetArg (INT16 n, CHAR *val, LONGINT val__len); +import void Platform_GetClock (INT32 *t, INT32 *d); import void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); -import void Platform_GetIntArg (int16 n, int32 *val); -import void Platform_GetTimeOfDay (int32 *sec, int32 *usec); -import void Platform_Halt (int32 code); -import int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ); -import int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); -import BOOLEAN Platform_Inaccessible (int16 e); -import void Platform_Init (int32 argc, int32 argvadr); -import BOOLEAN Platform_Interrupted (int16 e); -import void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); -import int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); -import BOOLEAN Platform_NoSuchDirectory (int16 e); -import int32 Platform_OSAllocate (int32 size); -import void Platform_OSFree (int32 address); -import int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); -import int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); -import int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n); -import int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n); -import int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); +import void Platform_GetIntArg (INT16 n, INT32 *val); +import void Platform_GetTimeOfDay (INT32 *sec, INT32 *usec); +import void Platform_Halt (INT32 code); +import INT16 Platform_Identify (INT32 h, Platform_FileIdentity *identity, ADDRESS *identity__typ); +import INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ); +import BOOLEAN Platform_Inaccessible (INT16 e); +import void Platform_Init (INT32 argc, INT32 argvadr); +import BOOLEAN Platform_Interrupted (INT16 e); +import void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d); +import INT16 Platform_New (CHAR *n, LONGINT n__len, INT32 *h); +import BOOLEAN Platform_NoSuchDirectory (INT16 e); +import INT32 Platform_OSAllocate (INT32 size); +import void Platform_OSFree (INT32 address); +import INT16 Platform_OldRO (CHAR *n, LONGINT n__len, INT32 *h); +import INT16 Platform_OldRW (CHAR *n, LONGINT n__len, INT32 *h); +import INT16 Platform_Read (INT32 h, INT32 p, INT32 l, INT32 *n); +import INT16 Platform_ReadBuf (INT32 h, SYSTEM_BYTE *b, LONGINT b__len, INT32 *n); +import INT16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); import BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); import BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); -import int16 Platform_Seek (int32 h, int32 offset, int16 whence); +import INT16 Platform_Seek (INT32 h, INT32 offset, INT16 whence); import void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); import void Platform_SetHalt (Platform_HaltProcedure p); import void Platform_SetInterruptHandler (Platform_SignalHandler handler); -import void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Platform_FileIdentity source); +import void Platform_SetMTime (Platform_FileIdentity *target, ADDRESS *target__typ, Platform_FileIdentity source); import void Platform_SetQuitHandler (Platform_SignalHandler handler); -import int16 Platform_Size (int32 h, int32 *l); -import int16 Platform_Sync (int32 h); -import int16 Platform_System (CHAR *cmd, LONGINT cmd__len); -import int32 Platform_Time (void); -import BOOLEAN Platform_TimedOut (int16 e); -import BOOLEAN Platform_TooManyFiles (int16 e); -import int16 Platform_Truncate (int32 h, int32 l); -import int16 Platform_Unlink (CHAR *n, LONGINT n__len); -import int16 Platform_Write (int32 h, int32 p, int32 l); +import INT16 Platform_Size (INT32 h, INT32 *l); +import INT16 Platform_Sync (INT32 h); +import INT16 Platform_System (CHAR *cmd, LONGINT cmd__len); +import INT32 Platform_Time (void); +import BOOLEAN Platform_TimedOut (INT16 e); +import BOOLEAN Platform_TooManyFiles (INT16 e); +import INT16 Platform_Truncate (INT32 h, INT32 l); +import INT16 Platform_Unlink (CHAR *n, LONGINT n__len); +import INT16 Platform_Write (INT32 h, INT32 p, INT32 l); import BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); import void *Platform__init(void); diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 0aca5733..d6788751 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" @@ -11,19 +11,19 @@ static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LONGINT d__len); -export void Reals_Convert (REAL x, int16 n, CHAR *d, LONGINT d__len); +export void Reals_Convert (REAL x, INT16 n, CHAR *d, LONGINT d__len); export void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len); export void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len); -export void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len); -export int16 Reals_Expo (REAL x); -export int16 Reals_ExpoL (LONGREAL x); -export void Reals_SetExpo (REAL *x, int16 ex); -export REAL Reals_Ten (int16 e); -export LONGREAL Reals_TenL (int16 e); -static CHAR Reals_ToHex (int16 i); +export void Reals_ConvertL (LONGREAL x, INT16 n, CHAR *d, LONGINT d__len); +export INT16 Reals_Expo (REAL x); +export INT16 Reals_ExpoL (LONGREAL x); +export void Reals_SetExpo (REAL *x, INT16 ex); +export REAL Reals_Ten (INT16 e); +export LONGREAL Reals_TenL (INT16 e); +static CHAR Reals_ToHex (INT16 i); -REAL Reals_Ten (int16 e) +REAL Reals_Ten (INT16 e) { LONGREAL r, power; r = (LONGREAL)1; @@ -38,7 +38,7 @@ REAL Reals_Ten (int16 e) return r; } -LONGREAL Reals_TenL (int16 e) +LONGREAL Reals_TenL (INT16 e) { LONGREAL r, power; r = (LONGREAL)1; @@ -56,39 +56,39 @@ LONGREAL Reals_TenL (int16 e) __RETCHK; } -int16 Reals_Expo (REAL x) +INT16 Reals_Expo (REAL x) { - int16 i; - __GET((address)&x + 2, i, int16); + INT16 i; + __GET((address)&x + 2, i, INT16); return __MASK(__ASHR(i, 7), -256); } -void Reals_SetExpo (REAL *x, int16 ex) +void Reals_SetExpo (REAL *x, INT16 ex) { CHAR c; __GET((address)x + 3, c, CHAR); - __PUT((address)x + 3, (CHAR)(__ASHL(__ASHR((int16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __PUT((address)x + 3, (CHAR)(__ASHL(__ASHR((INT16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); __GET((address)x + 2, c, CHAR); - __PUT((address)x + 2, (CHAR)(__MASK((int16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); + __PUT((address)x + 2, (CHAR)(__MASK((INT16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } -int16 Reals_ExpoL (LONGREAL x) +INT16 Reals_ExpoL (LONGREAL x) { - int16 i; - __GET((address)&x + 6, i, int16); + INT16 i; + __GET((address)&x + 6, i, INT16); return __MASK(__ASHR(i, 4), -2048); } -void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len) +void Reals_ConvertL (LONGREAL x, INT16 n, CHAR *d, LONGINT d__len) { - int32 i, j, k; + INT32 i, j, k; if (x < (LONGREAL)0) { x = -x; } k = 0; if (n > 9) { - i = (int32)__ENTIER(x / (LONGREAL)(LONGREAL)1000000000); - j = (int32)__ENTIER(x - i * (LONGREAL)1000000000); + i = (INT32)__ENTIER(x / (LONGREAL)(LONGREAL)1000000000); + j = (INT32)__ENTIER(x - i * (LONGREAL)1000000000); if (j < 0) { j = 0; } @@ -98,7 +98,7 @@ void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len) k += 1; } } else { - i = (int32)__ENTIER(x); + i = (INT32)__ENTIER(x); } while (k < n) { d[__X(k, d__len)] = (CHAR)((int)__MOD(i, 10) + 48); @@ -107,12 +107,12 @@ void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len) } } -void Reals_Convert (REAL x, int16 n, CHAR *d, LONGINT d__len) +void Reals_Convert (REAL x, INT16 n, CHAR *d, LONGINT d__len) { Reals_ConvertL(x, n, (void*)d, d__len); } -static CHAR Reals_ToHex (int16 i) +static CHAR Reals_ToHex (INT16 i) { if (i < 10) { return (CHAR)(i + 48); @@ -124,15 +124,15 @@ static CHAR Reals_ToHex (int16 i) static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LONGINT d__len) { - int16 i; - int32 l; + INT16 i; + INT32 l; CHAR by; i = 0; l = b__len; while (i < l) { by = __VAL(CHAR, b[__X(i, b__len)]); - d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((int16)by, 4)); - d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((int16)by, -16)); + d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((INT16)by, 4)); + d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((INT16)by, -16)); i += 1; } } diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index 664fe2ec..07688e3c 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h @@ -8,15 +8,15 @@ -import void Reals_Convert (REAL x, int16 n, CHAR *d, LONGINT d__len); +import void Reals_Convert (REAL x, INT16 n, CHAR *d, LONGINT d__len); import void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len); import void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len); -import void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len); -import int16 Reals_Expo (REAL x); -import int16 Reals_ExpoL (LONGREAL x); -import void Reals_SetExpo (REAL *x, int16 ex); -import REAL Reals_Ten (int16 e); -import LONGREAL Reals_TenL (int16 e); +import void Reals_ConvertL (LONGREAL x, INT16 n, CHAR *d, LONGINT d__len); +import INT16 Reals_Expo (REAL x); +import INT16 Reals_ExpoL (LONGREAL x); +import void Reals_SetExpo (REAL *x, INT16 ex); +import REAL Reals_Ten (INT16 e); +import LONGREAL Reals_TenL (INT16 e); import void *Reals__init(void); diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index 104a0fb7..141a9976 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" @@ -12,18 +12,18 @@ export void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len); export void Strings_Cap (CHAR *s, LONGINT s__len); -export void Strings_Delete (CHAR *s, LONGINT s__len, int16 pos, int16 n); -export void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHAR *dest, LONGINT dest__len); -export void Strings_Insert (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len); -export int16 Strings_Length (CHAR *s, LONGINT s__len); +export void Strings_Delete (CHAR *s, LONGINT s__len, INT16 pos, INT16 n); +export void Strings_Extract (CHAR *source, LONGINT source__len, INT16 pos, INT16 n, CHAR *dest, LONGINT dest__len); +export void Strings_Insert (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len); +export INT16 Strings_Length (CHAR *s, LONGINT s__len); export BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len); -export int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int16 pos); -export void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len); +export INT16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, INT16 pos); +export void Strings_Replace (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len); -int16 Strings_Length (CHAR *s, LONGINT s__len) +INT16 Strings_Length (CHAR *s, LONGINT s__len) { - int32 i; + INT32 i; __DUP(s, s__len, CHAR); i = 0; while ((i < s__len && s[__X(i, s__len)] != 0x00)) { @@ -31,7 +31,7 @@ int16 Strings_Length (CHAR *s, LONGINT s__len) } if (i <= 32767) { __DEL(s); - return (int16)i; + return (INT16)i; } else { __DEL(s); return 32767; @@ -41,7 +41,7 @@ int16 Strings_Length (CHAR *s, LONGINT s__len) void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len) { - int16 n1, n2, i; + INT16 n1, n2, i; __DUP(extra, extra__len, CHAR); n1 = Strings_Length(dest, dest__len); n2 = Strings_Length(extra, extra__len); @@ -56,9 +56,9 @@ void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__ __DEL(extra); } -void Strings_Insert (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len) +void Strings_Insert (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len) { - int16 n1, n2, i; + INT16 n1, n2, i; __DUP(source, source__len, CHAR); n1 = Strings_Length(dest, dest__len); n2 = Strings_Length(source, source__len); @@ -87,9 +87,9 @@ void Strings_Insert (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, L __DEL(source); } -void Strings_Delete (CHAR *s, LONGINT s__len, int16 pos, int16 n) +void Strings_Delete (CHAR *s, LONGINT s__len, INT16 pos, INT16 n) { - int16 len, i; + INT16 len, i; len = Strings_Length(s, s__len); if (pos < 0) { pos = 0; @@ -110,7 +110,7 @@ void Strings_Delete (CHAR *s, LONGINT s__len, int16 pos, int16 n) } } -void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len) +void Strings_Replace (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len) { __DUP(source, source__len, CHAR); Strings_Delete((void*)dest, dest__len, pos, pos + Strings_Length(source, source__len)); @@ -118,12 +118,12 @@ void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, __DEL(source); } -void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHAR *dest, LONGINT dest__len) +void Strings_Extract (CHAR *source, LONGINT source__len, INT16 pos, INT16 n, CHAR *dest, LONGINT dest__len) { - int16 len, destLen, i; + INT16 len, destLen, i; __DUP(source, source__len, CHAR); len = Strings_Length(source, source__len); - destLen = (int16)dest__len - 1; + destLen = (INT16)dest__len - 1; if (pos < 0) { pos = 0; } @@ -143,9 +143,9 @@ void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHA __DEL(source); } -int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int16 pos) +INT16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, INT16 pos) { - int16 n1, n2, i, j; + INT16 n1, n2, i, j; __DUP(pattern, pattern__len, CHAR); __DUP(s, s__len, CHAR); n1 = Strings_Length(s, s__len); @@ -177,7 +177,7 @@ int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, void Strings_Cap (CHAR *s, LONGINT s__len) { - int16 i; + INT16 i; i = 0; while (s[__X(i, s__len)] != 0x00) { if (('a' <= s[__X(i, s__len)] && s[__X(i, s__len)] <= 'z')) { @@ -191,9 +191,9 @@ static struct Match__7 { struct Match__7 *lnk; } *Match__7_s; -static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, int16 n, int16 m); +static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, INT16 n, INT16 m); -static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, int16 n, int16 m) +static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, INT16 n, INT16 m) { while ((((n >= 0 && m >= 0)) && mask[__X(m, mask__len)] != '*')) { if (name[__X(n, name__len)] != mask[__X(m, mask__len)]) { diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index 24f35c02..4319e8c8 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h @@ -10,13 +10,13 @@ import void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len); import void Strings_Cap (CHAR *s, LONGINT s__len); -import void Strings_Delete (CHAR *s, LONGINT s__len, int16 pos, int16 n); -import void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHAR *dest, LONGINT dest__len); -import void Strings_Insert (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len); -import int16 Strings_Length (CHAR *s, LONGINT s__len); +import void Strings_Delete (CHAR *s, LONGINT s__len, INT16 pos, INT16 n); +import void Strings_Extract (CHAR *source, LONGINT source__len, INT16 pos, INT16 n, CHAR *dest, LONGINT dest__len); +import void Strings_Insert (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len); +import INT16 Strings_Length (CHAR *s, LONGINT s__len); import BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len); -import int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int16 pos); -import void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len); +import INT16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, INT16 pos); +import void Strings_Replace (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len); import void *Strings__init(void); diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index 02d87d28..92b17de0 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "Files.h" @@ -19,9 +19,9 @@ typedef typedef struct Texts_RunDesc { Texts_Run prev, next; - int32 len; + INT32 len; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; BOOLEAN ascii; } Texts_RunDesc; @@ -34,7 +34,7 @@ typedef } Texts_ElemMsg; typedef - void (*Texts_Handler)(Texts_Elem, Texts_ElemMsg*, address *); + void (*Texts_Handler)(Texts_Elem, Texts_ElemMsg*, ADDRESS *); typedef struct Texts_TextDesc *Texts_Text; @@ -42,26 +42,26 @@ typedef typedef struct Texts_ElemDesc { Texts_Run prev, next; - int32 len; + INT32 len; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; BOOLEAN ascii; - int32 W, H; + INT32 W, H; Texts_Handler handle; Texts_Text base; } Texts_ElemDesc; struct Texts__1 { /* Texts_ElemDesc */ Texts_Run prev, next; - int32 len; + INT32 len; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; BOOLEAN ascii; - int32 W, H; + INT32 W, H; Texts_Handler handle; Texts_Text base; Files_File file; - int32 org, span; + INT32 org, span; CHAR mod[32], proc[32]; }; @@ -70,7 +70,7 @@ typedef typedef struct Texts_BufDesc { - int32 len; + INT32 len; Texts_Run head; } Texts_BufDesc; @@ -84,8 +84,8 @@ typedef typedef struct Texts_FileMsg { /* Texts_ElemMsg */ - int16 id; - int32 pos; + INT16 id; + INT32 pos; Files_Rider r; } Texts_FileMsg; @@ -100,7 +100,7 @@ typedef } Texts_IdentifyMsg; typedef - void (*Texts_Notifier)(Texts_Text, int16, int32, int32); + void (*Texts_Notifier)(Texts_Text, INT16, INT32, INT32); typedef struct Texts_PieceDesc *Texts_Piece; @@ -108,57 +108,57 @@ typedef typedef struct Texts_PieceDesc { Texts_Run prev, next; - int32 len; + INT32 len; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; BOOLEAN ascii; Files_File file; - int32 org; + INT32 org; } Texts_PieceDesc; typedef struct Texts_Reader { BOOLEAN eot; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; Texts_Elem elem; Files_Rider rider; Texts_Run run; - int32 org, off; + INT32 org, off; } Texts_Reader; typedef struct Texts_Scanner { /* Texts_Reader */ BOOLEAN eot; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; Texts_Elem elem; Files_Rider rider; Texts_Run run; - int32 org, off; + INT32 org, off; CHAR nextCh; - int16 line, class; - int32 i; + INT16 line, class; + INT32 i; REAL x; LONGREAL y; CHAR c; - int8 len; + INT8 len; CHAR s[64]; } Texts_Scanner; typedef struct Texts_TextDesc { - int32 len; + INT32 len; Texts_Notifier notify; Texts_Run head, cache; - int32 corg; + INT32 corg; } Texts_TextDesc; typedef struct Texts_Writer { Texts_Buffer buf; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; Files_Rider rider; Files_File file; } Texts_Writer; @@ -168,68 +168,68 @@ export Texts_Elem Texts_new; static Texts_Buffer Texts_del; static Texts_FontsFont Texts_FontsDefault; -export address *Texts_FontDesc__typ; -export address *Texts_RunDesc__typ; -export address *Texts_PieceDesc__typ; -export address *Texts_ElemMsg__typ; -export address *Texts_ElemDesc__typ; -export address *Texts_FileMsg__typ; -export address *Texts_CopyMsg__typ; -export address *Texts_IdentifyMsg__typ; -export address *Texts_BufDesc__typ; -export address *Texts_TextDesc__typ; -export address *Texts_Reader__typ; -export address *Texts_Scanner__typ; -export address *Texts_Writer__typ; -export address *Texts__1__typ; +export ADDRESS *Texts_FontDesc__typ; +export ADDRESS *Texts_RunDesc__typ; +export ADDRESS *Texts_PieceDesc__typ; +export ADDRESS *Texts_ElemMsg__typ; +export ADDRESS *Texts_ElemDesc__typ; +export ADDRESS *Texts_FileMsg__typ; +export ADDRESS *Texts_CopyMsg__typ; +export ADDRESS *Texts_IdentifyMsg__typ; +export ADDRESS *Texts_BufDesc__typ; +export ADDRESS *Texts_TextDesc__typ; +export ADDRESS *Texts_Reader__typ; +export ADDRESS *Texts_Scanner__typ; +export ADDRESS *Texts_Writer__typ; +export ADDRESS *Texts__1__typ; export void Texts_Append (Texts_Text T, Texts_Buffer B); -export void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, uint32 sel, Texts_FontsFont fnt, int8 col, int8 voff); +export void Texts_ChangeLooks (Texts_Text T, INT32 beg, INT32 end, UINT32 sel, Texts_FontsFont fnt, INT8 col, INT8 voff); static Texts_Elem Texts_CloneElem (Texts_Elem e); static Texts_Piece Texts_ClonePiece (Texts_Piece p); export void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len); export void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); export void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); -export void Texts_Delete (Texts_Text T, int32 beg, int32 end); +export void Texts_Delete (Texts_Text T, INT32 beg, INT32 end); export Texts_Text Texts_ElemBase (Texts_Elem E); -export int32 Texts_ElemPos (Texts_Elem E); -static void Texts_Find (Texts_Text T, int32 *pos, Texts_Run *u, int32 *org, int32 *off); +export INT32 Texts_ElemPos (Texts_Elem E); +static void Texts_Find (Texts_Text T, INT32 *pos, Texts_Run *u, INT32 *org, INT32 *off); static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len); -static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, address *msg__typ); -export void Texts_Insert (Texts_Text T, int32 pos, Texts_Buffer B); -export void Texts_Load (Files_Rider *r, address *r__typ, Texts_Text T); -static void Texts_Load0 (Files_Rider *r, address *r__typ, Texts_Text T); +static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, ADDRESS *msg__typ); +export void Texts_Insert (Texts_Text T, INT32 pos, Texts_Buffer B); +export void Texts_Load (Files_Rider *r, ADDRESS *r__typ, Texts_Text T); +static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T); static void Texts_Merge (Texts_Text T, Texts_Run u, Texts_Run *v); export void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len); export void Texts_OpenBuf (Texts_Buffer B); -export void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int32 pos); -export void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int32 pos); -export void Texts_OpenWriter (Texts_Writer *W, address *W__typ); -export int32 Texts_Pos (Texts_Reader *R, address *R__typ); -export void Texts_Read (Texts_Reader *R, address *R__typ, CHAR *ch); -export void Texts_ReadElem (Texts_Reader *R, address *R__typ); -export void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ); +export void Texts_OpenReader (Texts_Reader *R, ADDRESS *R__typ, Texts_Text T, INT32 pos); +export void Texts_OpenScanner (Texts_Scanner *S, ADDRESS *S__typ, Texts_Text T, INT32 pos); +export void Texts_OpenWriter (Texts_Writer *W, ADDRESS *W__typ); +export INT32 Texts_Pos (Texts_Reader *R, ADDRESS *R__typ); +export void Texts_Read (Texts_Reader *R, ADDRESS *R__typ, CHAR *ch); +export void Texts_ReadElem (Texts_Reader *R, ADDRESS *R__typ); +export void Texts_ReadPrevElem (Texts_Reader *R, ADDRESS *R__typ); export void Texts_Recall (Texts_Buffer *B); -export void Texts_Save (Texts_Text T, int32 beg, int32 end, Texts_Buffer B); -export void Texts_Scan (Texts_Scanner *S, address *S__typ); -export void Texts_SetColor (Texts_Writer *W, address *W__typ, int8 col); -export void Texts_SetFont (Texts_Writer *W, address *W__typ, Texts_FontsFont fnt); -export void Texts_SetOffset (Texts_Writer *W, address *W__typ, int8 voff); +export void Texts_Save (Texts_Text T, INT32 beg, INT32 end, Texts_Buffer B); +export void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ); +export void Texts_SetColor (Texts_Writer *W, ADDRESS *W__typ, INT8 col); +export void Texts_SetFont (Texts_Writer *W, ADDRESS *W__typ, Texts_FontsFont fnt); +export void Texts_SetOffset (Texts_Writer *W, ADDRESS *W__typ, INT8 voff); static void Texts_Splice (Texts_Run un, Texts_Run v, Texts_Run w, Texts_Text base); -static void Texts_Split (int32 off, Texts_Run *u, Texts_Run *un); -export void Texts_Store (Files_Rider *r, address *r__typ, Texts_Text T); -export void Texts_Write (Texts_Writer *W, address *W__typ, CHAR ch); -export void Texts_WriteDate (Texts_Writer *W, address *W__typ, int32 t, int32 d); -export void Texts_WriteElem (Texts_Writer *W, address *W__typ, Texts_Elem e); -export void Texts_WriteHex (Texts_Writer *W, address *W__typ, int32 x); -export void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n); -export void Texts_WriteLn (Texts_Writer *W, address *W__typ); -export void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int16 n); -export void Texts_WriteLongRealHex (Texts_Writer *W, address *W__typ, LONGREAL x); -export void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int16 n); -export void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int16 n, int16 k); -export void Texts_WriteRealHex (Texts_Writer *W, address *W__typ, REAL x); -export void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGINT s__len); +static void Texts_Split (INT32 off, Texts_Run *u, Texts_Run *un); +export void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T); +export void Texts_Write (Texts_Writer *W, ADDRESS *W__typ, CHAR ch); +export void Texts_WriteDate (Texts_Writer *W, ADDRESS *W__typ, INT32 t, INT32 d); +export void Texts_WriteElem (Texts_Writer *W, ADDRESS *W__typ, Texts_Elem e); +export void Texts_WriteHex (Texts_Writer *W, ADDRESS *W__typ, INT32 x); +export void Texts_WriteInt (Texts_Writer *W, ADDRESS *W__typ, INT64 x, INT64 n); +export void Texts_WriteLn (Texts_Writer *W, ADDRESS *W__typ); +export void Texts_WriteLongReal (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x, INT16 n); +export void Texts_WriteLongRealHex (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x); +export void Texts_WriteReal (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n); +export void Texts_WriteRealFix (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n, INT16 k); +export void Texts_WriteRealHex (Texts_Writer *W, ADDRESS *W__typ, REAL x); +export void Texts_WriteString (Texts_Writer *W, ADDRESS *W__typ, CHAR *s, LONGINT s__len); static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len) @@ -240,10 +240,10 @@ static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len) return F; } -static void Texts_Find (Texts_Text T, int32 *pos, Texts_Run *u, int32 *org, int32 *off) +static void Texts_Find (Texts_Text T, INT32 *pos, Texts_Run *u, INT32 *org, INT32 *off) { Texts_Run v = NIL; - int32 m; + INT32 m; if (*pos >= T->len) { *pos = T->len; *u = T->head; @@ -273,7 +273,7 @@ static void Texts_Find (Texts_Text T, int32 *pos, Texts_Run *u, int32 *org, int3 } } -static void Texts_Split (int32 off, Texts_Run *u, Texts_Run *un) +static void Texts_Split (INT32 off, Texts_Run *u, Texts_Run *un) { Texts_Piece p = NIL, U = NIL; if (off == 0) { @@ -366,10 +366,10 @@ Texts_Text Texts_ElemBase (Texts_Elem E) return E->base; } -int32 Texts_ElemPos (Texts_Elem E) +INT32 Texts_ElemPos (Texts_Elem E) { Texts_Run u = NIL; - int32 pos; + INT32 pos; u = E->base->head->next; pos = 0; while (u != (void *) E) { @@ -379,11 +379,11 @@ int32 Texts_ElemPos (Texts_Elem E) return pos; } -static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, address *msg__typ) +static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, ADDRESS *msg__typ) { Texts_Alien e = NIL; Files_Rider r; - int32 i; + INT32 i; CHAR ch; if (__ISP(E, Texts__1, 2)) { if (__IS(msg__typ, Texts_CopyMsg, 1)) { @@ -459,10 +459,10 @@ void Texts_Recall (Texts_Buffer *B) Texts_del = NIL; } -void Texts_Save (Texts_Text T, int32 beg, int32 end, Texts_Buffer B) +void Texts_Save (Texts_Text T, INT32 beg, INT32 end, Texts_Buffer B) { Texts_Run u = NIL, v = NIL, w = NIL, wn = NIL; - int32 uo, ud, vo, vd; + INT32 uo, ud, vo, vd; Texts_Find(T, &beg, &u, &uo, &ud); Texts_Find(T, &end, &v, &vo, &vd); w = B->head->prev; @@ -493,11 +493,11 @@ void Texts_Save (Texts_Text T, int32 beg, int32 end, Texts_Buffer B) B->len += end - beg; } -void Texts_Insert (Texts_Text T, int32 pos, Texts_Buffer B) +void Texts_Insert (Texts_Text T, INT32 pos, Texts_Buffer B) { Texts_Run u = NIL, un = NIL, v = NIL; Texts_Piece p = NIL, q = NIL; - int32 uo, ud, len; + INT32 uo, ud, len; Texts_Find(T, &pos, &u, &uo, &ud); Texts_Split(ud, &u, &un); len = B->len; @@ -516,7 +516,7 @@ void Texts_Insert (Texts_Text T, int32 pos, Texts_Buffer B) void Texts_Append (Texts_Text T, Texts_Buffer B) { Texts_Run v = NIL; - int32 pos, len; + INT32 pos, len; pos = T->len; len = B->len; v = B->head->next; @@ -531,10 +531,10 @@ void Texts_Append (Texts_Text T, Texts_Buffer B) } } -void Texts_Delete (Texts_Text T, int32 beg, int32 end) +void Texts_Delete (Texts_Text T, INT32 beg, INT32 end) { Texts_Run c = NIL, u = NIL, un = NIL, v = NIL, vn = NIL; - int32 co, uo, ud, vo, vd; + INT32 co, uo, ud, vo, vd; Texts_Find(T, &beg, &u, &uo, &ud); Texts_Split(ud, &u, &un); c = T->cache; @@ -556,10 +556,10 @@ void Texts_Delete (Texts_Text T, int32 beg, int32 end) } } -void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, uint32 sel, Texts_FontsFont fnt, int8 col, int8 voff) +void Texts_ChangeLooks (Texts_Text T, INT32 beg, INT32 end, UINT32 sel, Texts_FontsFont fnt, INT8 col, INT8 voff) { Texts_Run c = NIL, u = NIL, un = NIL, v = NIL, vn = NIL; - int32 co, uo, ud, vo, vd; + INT32 co, uo, ud, vo, vd; Texts_Find(T, &beg, &u, &uo, &ud); Texts_Split(ud, &u, &un); c = T->cache; @@ -595,7 +595,7 @@ void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, uint32 sel, Texts_Fo } } -void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int32 pos) +void Texts_OpenReader (Texts_Reader *R, ADDRESS *R__typ, Texts_Text T, INT32 pos) { Texts_Run u = NIL; if (pos >= T->len) { @@ -609,10 +609,10 @@ void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int32 pos } } -void Texts_Read (Texts_Reader *R, address *R__typ, CHAR *ch) +void Texts_Read (Texts_Reader *R, ADDRESS *R__typ, CHAR *ch) { Texts_Run u = NIL; - int32 pos; + INT32 pos; CHAR nextch; u = (*R).run; (*R).fnt = u->fnt; @@ -654,7 +654,7 @@ void Texts_Read (Texts_Reader *R, address *R__typ, CHAR *ch) } } -void Texts_ReadElem (Texts_Reader *R, address *R__typ) +void Texts_ReadElem (Texts_Reader *R, ADDRESS *R__typ) { Texts_Run u = NIL, un = NIL; u = (*R).run; @@ -682,7 +682,7 @@ void Texts_ReadElem (Texts_Reader *R, address *R__typ) } } -void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ) +void Texts_ReadPrevElem (Texts_Reader *R, ADDRESS *R__typ) { Texts_Run u = NIL; u = (*R).run->prev; @@ -704,12 +704,12 @@ void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ) } } -int32 Texts_Pos (Texts_Reader *R, address *R__typ) +INT32 Texts_Pos (Texts_Reader *R, ADDRESS *R__typ) { return (*R).org + (*R).off; } -void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int32 pos) +void Texts_OpenScanner (Texts_Scanner *S, ADDRESS *S__typ, Texts_Text T, INT32 pos) { Texts_OpenReader((void*)&*S, S__typ, T, pos); (*S).line = 0; @@ -718,10 +718,10 @@ void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int32 p static struct Scan__31 { Texts_Scanner *S; - address *S__typ; + ADDRESS *S__typ; CHAR *ch; BOOLEAN *negE; - int16 *e; + INT16 *e; struct Scan__31 *lnk; } *Scan__31_s; @@ -740,18 +740,18 @@ static void ReadScaleFactor__32 (void) } } while (('0' <= *Scan__31_s->ch && *Scan__31_s->ch <= '9')) { - *Scan__31_s->e = (*Scan__31_s->e * 10 + (int16)*Scan__31_s->ch) - 48; + *Scan__31_s->e = (*Scan__31_s->e * 10 + (INT16)*Scan__31_s->ch) - 48; Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); } } -void Texts_Scan (Texts_Scanner *S, address *S__typ) +void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) { CHAR ch, term; BOOLEAN neg, negE, hex; - int8 i, j, h; - int16 e; - int32 k; + INT8 i, j, h; + INT16 e; + INT32 k; REAL x, f; LONGREAL y, g; CHAR d[32]; @@ -812,10 +812,10 @@ void Texts_Scan (Texts_Scanner *S, address *S__typ) if ('9' < ch) { if (('A' <= ch && ch <= 'F')) { hex = 1; - ch = (CHAR)((int16)ch - 7); + ch = (CHAR)((INT16)ch - 7); } else if (('a' <= ch && ch <= 'f')) { hex = 1; - ch = (CHAR)((int16)ch - 39); + ch = (CHAR)((INT16)ch - 39); } else { break; } @@ -827,13 +827,13 @@ void Texts_Scan (Texts_Scanner *S, address *S__typ) if (i - j > 8) { j = i - 8; } - k = (int16)d[__X(j, 32)] - 48; + k = (INT16)d[__X(j, 32)] - 48; j += 1; if ((i - j == 7 && k >= 8)) { k -= 16; } while (j < i) { - k = __ASHL(k, 4) + ((int16)d[__X(j, 32)] - 48); + k = __ASHL(k, 4) + ((INT16)d[__X(j, 32)] - 48); j += 1; } if (neg) { @@ -854,12 +854,12 @@ void Texts_Scan (Texts_Scanner *S, address *S__typ) y = (LONGREAL)0; g = (LONGREAL)1; do { - y = y * (LONGREAL)10 + ((int16)d[__X(j, 32)] - 48); + y = y * (LONGREAL)10 + ((INT16)d[__X(j, 32)] - 48); j += 1; } while (!(j == h)); while (j < i) { g = g / (LONGREAL)(LONGREAL)10; - y = ((int16)d[__X(j, 32)] - 48) * g + y; + y = ((INT16)d[__X(j, 32)] - 48) * g + y; j += 1; } ReadScaleFactor__32(); @@ -886,12 +886,12 @@ void Texts_Scan (Texts_Scanner *S, address *S__typ) x = (REAL)0; f = (REAL)1; do { - x = x * (REAL)10 + ((int16)d[__X(j, 32)] - 48); + x = x * (REAL)10 + ((INT16)d[__X(j, 32)] - 48); j += 1; } while (!(j == h)); while (j < i) { f = f / (REAL)(REAL)10; - x = ((int16)d[__X(j, 32)] - 48) * f + x; + x = ((INT16)d[__X(j, 32)] - 48) * f + x; j += 1; } if (ch == 'E') { @@ -923,7 +923,7 @@ void Texts_Scan (Texts_Scanner *S, address *S__typ) (*S).class = 3; k = 0; do { - k = k * 10 + ((int16)d[__X(j, 32)] - 48); + k = k * 10 + ((INT16)d[__X(j, 32)] - 48); j += 1; } while (!(j == i)); if (neg) { @@ -951,7 +951,7 @@ void Texts_Scan (Texts_Scanner *S, address *S__typ) Scan__31_s = _s.lnk; } -void Texts_OpenWriter (Texts_Writer *W, address *W__typ) +void Texts_OpenWriter (Texts_Writer *W, ADDRESS *W__typ) { __NEW((*W).buf, Texts_BufDesc); Texts_OpenBuf((*W).buf); @@ -962,22 +962,22 @@ void Texts_OpenWriter (Texts_Writer *W, address *W__typ) Files_Set(&(*W).rider, Files_Rider__typ, (*W).file, 0); } -void Texts_SetFont (Texts_Writer *W, address *W__typ, Texts_FontsFont fnt) +void Texts_SetFont (Texts_Writer *W, ADDRESS *W__typ, Texts_FontsFont fnt) { (*W).fnt = fnt; } -void Texts_SetColor (Texts_Writer *W, address *W__typ, int8 col) +void Texts_SetColor (Texts_Writer *W, ADDRESS *W__typ, INT8 col) { (*W).col = col; } -void Texts_SetOffset (Texts_Writer *W, address *W__typ, int8 voff) +void Texts_SetOffset (Texts_Writer *W, ADDRESS *W__typ, INT8 voff) { (*W).voff = voff; } -void Texts_Write (Texts_Writer *W, address *W__typ, CHAR ch) +void Texts_Write (Texts_Writer *W, ADDRESS *W__typ, CHAR ch) { Texts_Run u = NIL, un = NIL; Texts_Piece p = NIL; @@ -1003,7 +1003,7 @@ void Texts_Write (Texts_Writer *W, address *W__typ, CHAR ch) } } -void Texts_WriteElem (Texts_Writer *W, address *W__typ, Texts_Elem e) +void Texts_WriteElem (Texts_Writer *W, ADDRESS *W__typ, Texts_Elem e) { Texts_Run u = NIL, un = NIL; if (e->base != NIL) { @@ -1022,14 +1022,14 @@ void Texts_WriteElem (Texts_Writer *W, address *W__typ, Texts_Elem e) un->prev = (Texts_Run)e; } -void Texts_WriteLn (Texts_Writer *W, address *W__typ) +void Texts_WriteLn (Texts_Writer *W, ADDRESS *W__typ) { Texts_Write(&*W, W__typ, 0x0d); } -void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGINT s__len) +void Texts_WriteString (Texts_Writer *W, ADDRESS *W__typ, CHAR *s, LONGINT s__len) { - int16 i; + INT16 i; __DUP(s, s__len, CHAR); i = 0; while (s[__X(i, s__len)] >= ' ') { @@ -1039,10 +1039,10 @@ void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGINT s__le __DEL(s); } -void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n) +void Texts_WriteInt (Texts_Writer *W, ADDRESS *W__typ, INT64 x, INT64 n) { - int16 i; - int64 x0; + INT16 i; + INT64 x0; CHAR a[24]; i = 0; if (x < 0) { @@ -1061,7 +1061,7 @@ void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n) x0 = __DIV(x0, 10); i += 1; } while (!(x0 == 0)); - while (n > (int64)i) { + while (n > (INT64)i) { Texts_Write(&*W, W__typ, ' '); n -= 1; } @@ -1074,10 +1074,10 @@ void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n) } while (!(i == 0)); } -void Texts_WriteHex (Texts_Writer *W, address *W__typ, int32 x) +void Texts_WriteHex (Texts_Writer *W, ADDRESS *W__typ, INT32 x) { - int16 i; - int32 y; + INT16 i; + INT32 y; CHAR a[20]; i = 0; Texts_Write(&*W, W__typ, ' '); @@ -1097,9 +1097,9 @@ void Texts_WriteHex (Texts_Writer *W, address *W__typ, int32 x) } while (!(i == 0)); } -void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int16 n) +void Texts_WriteReal (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n) { - int16 e; + INT16 e; REAL x0; CHAR d[9]; e = Reals_Expo(x); @@ -1169,16 +1169,16 @@ void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int16 n) static struct WriteRealFix__53 { Texts_Writer *W; - address *W__typ; - int16 *i; + ADDRESS *W__typ; + INT16 *i; CHAR (*d)[9]; struct WriteRealFix__53 *lnk; } *WriteRealFix__53_s; -static void dig__54 (int16 n); -static void seq__56 (CHAR ch, int16 n); +static void dig__54 (INT16 n); +static void seq__56 (CHAR ch, INT16 n); -static void seq__56 (CHAR ch, int16 n) +static void seq__56 (CHAR ch, INT16 n) { while (n > 0) { Texts_Write(&*WriteRealFix__53_s->W, WriteRealFix__53_s->W__typ, ch); @@ -1186,7 +1186,7 @@ static void seq__56 (CHAR ch, int16 n) } } -static void dig__54 (int16 n) +static void dig__54 (INT16 n) { while (n > 0) { *WriteRealFix__53_s->i -= 1; @@ -1195,9 +1195,9 @@ static void dig__54 (int16 n) } } -void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int16 n, int16 k) +void Texts_WriteRealFix (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n, INT16 k) { - int16 e, i; + INT16 e, i; CHAR sign; REAL x0; CHAR d[9]; @@ -1267,9 +1267,9 @@ void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int16 n, int1 WriteRealFix__53_s = _s.lnk; } -void Texts_WriteRealHex (Texts_Writer *W, address *W__typ, REAL x) +void Texts_WriteRealHex (Texts_Writer *W, ADDRESS *W__typ, REAL x) { - int16 i; + INT16 i; CHAR d[8]; Reals_ConvertH(x, (void*)d, 8); i = 0; @@ -1279,9 +1279,9 @@ void Texts_WriteRealHex (Texts_Writer *W, address *W__typ, REAL x) } while (!(i == 8)); } -void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int16 n) +void Texts_WriteLongReal (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x, INT16 n) { - int16 e; + INT16 e; LONGREAL x0; CHAR d[16]; e = Reals_ExpoL(x); @@ -1313,7 +1313,7 @@ void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int16 n) } else { Texts_Write(&*W, W__typ, ' '); } - e = (int16)__ASHR((e - 1023) * 77, 8); + e = (INT16)__ASHR((e - 1023) * 77, 8); if (e >= 0) { x = x / (LONGREAL)Reals_TenL(e); } else { @@ -1351,9 +1351,9 @@ void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int16 n) } } -void Texts_WriteLongRealHex (Texts_Writer *W, address *W__typ, LONGREAL x) +void Texts_WriteLongRealHex (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x) { - int16 i; + INT16 i; CHAR d[16]; Reals_ConvertHL(x, (void*)d, 16); i = 0; @@ -1365,20 +1365,20 @@ void Texts_WriteLongRealHex (Texts_Writer *W, address *W__typ, LONGREAL x) static struct WriteDate__43 { Texts_Writer *W; - address *W__typ; + ADDRESS *W__typ; struct WriteDate__43 *lnk; } *WriteDate__43_s; -static void WritePair__44 (CHAR ch, int32 x); +static void WritePair__44 (CHAR ch, INT32 x); -static void WritePair__44 (CHAR ch, int32 x) +static void WritePair__44 (CHAR ch, INT32 x) { Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, ch); Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)(__DIV(x, 10) + 48)); Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)((int)__MOD(x, 10) + 48)); } -void Texts_WriteDate (Texts_Writer *W, address *W__typ, int32 t, int32 d) +void Texts_WriteDate (Texts_Writer *W, ADDRESS *W__typ, INT32 t, INT32 d) { struct WriteDate__43 _s; _s.W = W; _s.W__typ = W__typ; @@ -1395,22 +1395,22 @@ void Texts_WriteDate (Texts_Writer *W, address *W__typ, int32 t, int32 d) static struct Load0__16 { Texts_Text *T; - int8 *ecnt; + INT8 *ecnt; Files_File *f; Texts_FileMsg *msg; CHAR (*mods)[64][32], (*procs)[64][32]; struct Load0__16 *lnk; } *Load0__16_s; -static void LoadElem__17 (Files_Rider *r, address *r__typ, int32 pos, int32 span, Texts_Elem *e); +static void LoadElem__17 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e); -static void LoadElem__17 (Files_Rider *r, address *r__typ, int32 pos, int32 span, Texts_Elem *e) +static void LoadElem__17 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e) { Modules_Module M = NIL; Modules_Command Cmd; Texts_Alien a = NIL; - int32 org, ew, eh; - int8 eno; + INT32 org, ew, eh; + INT8 eno; Texts_new = NIL; Files_ReadLInt(&*r, r__typ, &ew); Files_ReadLInt(&*r, r__typ, &eh); @@ -1455,13 +1455,13 @@ static void LoadElem__17 (Files_Rider *r, address *r__typ, int32 pos, int32 span } } -static void Texts_Load0 (Files_Rider *r, address *r__typ, Texts_Text T) +static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) { Texts_Run u = NIL, un = NIL; Texts_Piece p = NIL; Texts_Elem e = NIL; - int32 org, pos, hlen, plen; - int8 ecnt, fcnt, fno, col, voff; + INT32 org, pos, hlen, plen; + INT8 ecnt, fcnt, fno, col, voff; Files_File f = NIL; Texts_FileMsg msg; CHAR mods[64][32], procs[64][32]; @@ -1529,9 +1529,9 @@ static void Texts_Load0 (Files_Rider *r, address *r__typ, Texts_Text T) Load0__16_s = _s.lnk; } -void Texts_Load (Files_Rider *r, address *r__typ, Texts_Text T) +void Texts_Load (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) { - int16 tag; + INT16 tag; Files_ReadInt(&*r, r__typ, &tag); if (tag != -4095) { Files_Set(&*r, r__typ, Files_Base(&*r, r__typ), Files_Pos(&*r, r__typ) - 2); @@ -1546,7 +1546,7 @@ void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len) Texts_Run u = NIL; Texts_Piece p = NIL; CHAR tag, version; - int32 hlen; + INT32 hlen; __DUP(name, name__len, CHAR); f = Files_Old(name, name__len); if (f == NIL) { @@ -1596,20 +1596,20 @@ void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len) } static struct Store__39 { - int8 *ecnt; + INT8 *ecnt; Texts_FileMsg *msg; Texts_IdentifyMsg *iden; CHAR (*mods)[64][32], (*procs)[64][32]; struct Store__39 *lnk; } *Store__39_s; -static void StoreElem__40 (Files_Rider *r, address *r__typ, int32 pos, Texts_Elem e); +static void StoreElem__40 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e); -static void StoreElem__40 (Files_Rider *r, address *r__typ, int32 pos, Texts_Elem e) +static void StoreElem__40 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e) { Files_Rider r1; - int32 org, span; - int8 eno; + INT32 org, span; + INT8 eno; __COPY((*Store__39_s->iden).mod, (*Store__39_s->mods)[__X(*Store__39_s->ecnt, 64)], 32); __COPY((*Store__39_s->iden).proc, (*Store__39_s->procs)[__X(*Store__39_s->ecnt, 64)], 32); eno = 1; @@ -1635,15 +1635,15 @@ static void StoreElem__40 (Files_Rider *r, address *r__typ, int32 pos, Texts_Ele Files_WriteLInt(&r1, Files_Rider__typ, e->H); } -void Texts_Store (Files_Rider *r, address *r__typ, Texts_Text T) +void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) { Files_Rider r1; Texts_Run u = NIL, un = NIL; Texts_Elem e = NIL; - int32 org, pos, delta, hlen, rlen; - int8 ecnt, fcnt; + INT32 org, pos, delta, hlen, rlen; + INT8 ecnt, fcnt; CHAR ch; - int8 fno; + INT8 fno; Texts_FileMsg msg; Texts_IdentifyMsg iden; CHAR mods[64][32], procs[64][32]; @@ -1759,7 +1759,7 @@ void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len) { Files_File f = NIL; Files_Rider r; - int16 i, res; + INT16 i, res; CHAR bak[64]; __DUP(name, name__len, CHAR); f = Files_New(name, name__len); diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index be04a384..19f2a2f5 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h @@ -8,7 +8,7 @@ typedef struct Texts_BufDesc { - int32 len; + INT32 len; char _prvt0[4]; } Texts_BufDesc; @@ -30,25 +30,25 @@ typedef typedef struct Texts_RunDesc { - int32 _prvt0; + INT32 _prvt0; char _prvt1[15]; } Texts_RunDesc; typedef - void (*Texts_Handler)(Texts_Elem, Texts_ElemMsg*, address *); + void (*Texts_Handler)(Texts_Elem, Texts_ElemMsg*, ADDRESS *); typedef struct Texts_ElemDesc { char _prvt0[20]; - int32 W, H; + INT32 W, H; Texts_Handler handle; char _prvt1[4]; } Texts_ElemDesc; typedef struct Texts_FileMsg { /* Texts_ElemMsg */ - int16 id; - int32 pos; + INT16 id; + INT32 pos; Files_Rider r; } Texts_FileMsg; @@ -69,13 +69,13 @@ typedef struct Texts_TextDesc *Texts_Text; typedef - void (*Texts_Notifier)(Texts_Text, int16, int32, int32); + void (*Texts_Notifier)(Texts_Text, INT16, INT32, INT32); typedef struct Texts_Reader { BOOLEAN eot; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; Texts_Elem elem; char _prvt0[32]; } Texts_Reader; @@ -84,22 +84,22 @@ typedef struct Texts_Scanner { /* Texts_Reader */ BOOLEAN eot; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; Texts_Elem elem; char _prvt0[32]; CHAR nextCh; - int16 line, class; - int32 i; + INT16 line, class; + INT32 i; REAL x; LONGREAL y; CHAR c; - int8 len; + INT8 len; CHAR s[64]; } Texts_Scanner; typedef struct Texts_TextDesc { - int32 len; + INT32 len; Texts_Notifier notify; char _prvt0[12]; } Texts_TextDesc; @@ -108,64 +108,64 @@ typedef struct Texts_Writer { Texts_Buffer buf; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; char _prvt0[26]; } Texts_Writer; import Texts_Elem Texts_new; -import address *Texts_FontDesc__typ; -import address *Texts_RunDesc__typ; -import address *Texts_ElemMsg__typ; -import address *Texts_ElemDesc__typ; -import address *Texts_FileMsg__typ; -import address *Texts_CopyMsg__typ; -import address *Texts_IdentifyMsg__typ; -import address *Texts_BufDesc__typ; -import address *Texts_TextDesc__typ; -import address *Texts_Reader__typ; -import address *Texts_Scanner__typ; -import address *Texts_Writer__typ; +import ADDRESS *Texts_FontDesc__typ; +import ADDRESS *Texts_RunDesc__typ; +import ADDRESS *Texts_ElemMsg__typ; +import ADDRESS *Texts_ElemDesc__typ; +import ADDRESS *Texts_FileMsg__typ; +import ADDRESS *Texts_CopyMsg__typ; +import ADDRESS *Texts_IdentifyMsg__typ; +import ADDRESS *Texts_BufDesc__typ; +import ADDRESS *Texts_TextDesc__typ; +import ADDRESS *Texts_Reader__typ; +import ADDRESS *Texts_Scanner__typ; +import ADDRESS *Texts_Writer__typ; import void Texts_Append (Texts_Text T, Texts_Buffer B); -import void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, uint32 sel, Texts_FontsFont fnt, int8 col, int8 voff); +import void Texts_ChangeLooks (Texts_Text T, INT32 beg, INT32 end, UINT32 sel, Texts_FontsFont fnt, INT8 col, INT8 voff); import void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len); import void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); import void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); -import void Texts_Delete (Texts_Text T, int32 beg, int32 end); +import void Texts_Delete (Texts_Text T, INT32 beg, INT32 end); import Texts_Text Texts_ElemBase (Texts_Elem E); -import int32 Texts_ElemPos (Texts_Elem E); -import void Texts_Insert (Texts_Text T, int32 pos, Texts_Buffer B); -import void Texts_Load (Files_Rider *r, address *r__typ, Texts_Text T); +import INT32 Texts_ElemPos (Texts_Elem E); +import void Texts_Insert (Texts_Text T, INT32 pos, Texts_Buffer B); +import void Texts_Load (Files_Rider *r, ADDRESS *r__typ, Texts_Text T); import void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len); import void Texts_OpenBuf (Texts_Buffer B); -import void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int32 pos); -import void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int32 pos); -import void Texts_OpenWriter (Texts_Writer *W, address *W__typ); -import int32 Texts_Pos (Texts_Reader *R, address *R__typ); -import void Texts_Read (Texts_Reader *R, address *R__typ, CHAR *ch); -import void Texts_ReadElem (Texts_Reader *R, address *R__typ); -import void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ); +import void Texts_OpenReader (Texts_Reader *R, ADDRESS *R__typ, Texts_Text T, INT32 pos); +import void Texts_OpenScanner (Texts_Scanner *S, ADDRESS *S__typ, Texts_Text T, INT32 pos); +import void Texts_OpenWriter (Texts_Writer *W, ADDRESS *W__typ); +import INT32 Texts_Pos (Texts_Reader *R, ADDRESS *R__typ); +import void Texts_Read (Texts_Reader *R, ADDRESS *R__typ, CHAR *ch); +import void Texts_ReadElem (Texts_Reader *R, ADDRESS *R__typ); +import void Texts_ReadPrevElem (Texts_Reader *R, ADDRESS *R__typ); import void Texts_Recall (Texts_Buffer *B); -import void Texts_Save (Texts_Text T, int32 beg, int32 end, Texts_Buffer B); -import void Texts_Scan (Texts_Scanner *S, address *S__typ); -import void Texts_SetColor (Texts_Writer *W, address *W__typ, int8 col); -import void Texts_SetFont (Texts_Writer *W, address *W__typ, Texts_FontsFont fnt); -import void Texts_SetOffset (Texts_Writer *W, address *W__typ, int8 voff); -import void Texts_Store (Files_Rider *r, address *r__typ, Texts_Text T); -import void Texts_Write (Texts_Writer *W, address *W__typ, CHAR ch); -import void Texts_WriteDate (Texts_Writer *W, address *W__typ, int32 t, int32 d); -import void Texts_WriteElem (Texts_Writer *W, address *W__typ, Texts_Elem e); -import void Texts_WriteHex (Texts_Writer *W, address *W__typ, int32 x); -import void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n); -import void Texts_WriteLn (Texts_Writer *W, address *W__typ); -import void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int16 n); -import void Texts_WriteLongRealHex (Texts_Writer *W, address *W__typ, LONGREAL x); -import void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int16 n); -import void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int16 n, int16 k); -import void Texts_WriteRealHex (Texts_Writer *W, address *W__typ, REAL x); -import void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGINT s__len); +import void Texts_Save (Texts_Text T, INT32 beg, INT32 end, Texts_Buffer B); +import void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ); +import void Texts_SetColor (Texts_Writer *W, ADDRESS *W__typ, INT8 col); +import void Texts_SetFont (Texts_Writer *W, ADDRESS *W__typ, Texts_FontsFont fnt); +import void Texts_SetOffset (Texts_Writer *W, ADDRESS *W__typ, INT8 voff); +import void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T); +import void Texts_Write (Texts_Writer *W, ADDRESS *W__typ, CHAR ch); +import void Texts_WriteDate (Texts_Writer *W, ADDRESS *W__typ, INT32 t, INT32 d); +import void Texts_WriteElem (Texts_Writer *W, ADDRESS *W__typ, Texts_Elem e); +import void Texts_WriteHex (Texts_Writer *W, ADDRESS *W__typ, INT32 x); +import void Texts_WriteInt (Texts_Writer *W, ADDRESS *W__typ, INT64 x, INT64 n); +import void Texts_WriteLn (Texts_Writer *W, ADDRESS *W__typ); +import void Texts_WriteLongReal (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x, INT16 n); +import void Texts_WriteLongRealHex (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x); +import void Texts_WriteReal (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n); +import void Texts_WriteRealFix (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n, INT16 k); +import void Texts_WriteRealHex (Texts_Writer *W, ADDRESS *W__typ, REAL x); +import void Texts_WriteString (Texts_Writer *W, ADDRESS *W__typ, CHAR *s, LONGINT s__len); import void *Texts__init(void); diff --git a/bootstrap/unix-44/VT100.c b/bootstrap/unix-44/VT100.c index c3a9491f..b5067d33 100644 --- a/bootstrap/unix-44/VT100.c +++ b/bootstrap/unix-44/VT100.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "Out.h" @@ -14,36 +14,36 @@ export CHAR VT100_CSI[5]; static CHAR VT100_tmpstr[32]; -export void VT100_CHA (int16 n); -export void VT100_CNL (int16 n); -export void VT100_CPL (int16 n); -export void VT100_CUB (int16 n); -export void VT100_CUD (int16 n); -export void VT100_CUF (int16 n); -export void VT100_CUP (int16 n, int16 m); -export void VT100_CUU (int16 n); +export void VT100_CHA (INT16 n); +export void VT100_CNL (INT16 n); +export void VT100_CPL (INT16 n); +export void VT100_CUB (INT16 n); +export void VT100_CUD (INT16 n); +export void VT100_CUF (INT16 n); +export void VT100_CUP (INT16 n, INT16 m); +export void VT100_CUU (INT16 n); export void VT100_DECTCEMh (void); export void VT100_DECTCEMl (void); -export void VT100_DSR (int16 n); -export void VT100_ED (int16 n); -export void VT100_EL (int16 n); -static void VT100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len); +export void VT100_DSR (INT16 n); +export void VT100_ED (INT16 n); +export void VT100_EL (INT16 n); +static void VT100_EscSeq (INT16 n, CHAR *letter, LONGINT letter__len); static void VT100_EscSeq0 (CHAR *letter, LONGINT letter__len); -static void VT100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len); -static void VT100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len); -export void VT100_HVP (int16 n, int16 m); -export void VT100_IntToStr (int32 int_, CHAR *str, LONGINT str__len); +static void VT100_EscSeq2 (INT16 n, INT16 m, CHAR *letter, LONGINT letter__len); +static void VT100_EscSeqSwapped (INT16 n, CHAR *letter, LONGINT letter__len); +export void VT100_HVP (INT16 n, INT16 m); +export void VT100_IntToStr (INT32 int_, CHAR *str, LONGINT str__len); export void VT100_RCP (void); -static void VT100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end); +static void VT100_Reverse0 (CHAR *str, LONGINT str__len, INT16 start, INT16 end); export void VT100_SCP (void); -export void VT100_SD (int16 n); -export void VT100_SGR (int16 n); -export void VT100_SGR2 (int16 n, int16 m); -export void VT100_SU (int16 n); +export void VT100_SD (INT16 n); +export void VT100_SGR (INT16 n); +export void VT100_SGR2 (INT16 n, INT16 m); +export void VT100_SU (INT16 n); export void VT100_SetAttr (CHAR *attr, LONGINT attr__len); -static void VT100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end) +static void VT100_Reverse0 (CHAR *str, LONGINT str__len, INT16 start, INT16 end) { CHAR h; while (start < end) { @@ -55,11 +55,11 @@ static void VT100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end) } } -void VT100_IntToStr (int32 int_, CHAR *str, LONGINT str__len) +void VT100_IntToStr (INT32 int_, CHAR *str, LONGINT str__len) { CHAR b[21]; - int16 s, e; - int8 maxLength; + INT16 s, e; + INT8 maxLength; maxLength = 11; if (int_ == (-2147483647-1)) { __MOVE("-2147483648", b, 12); @@ -94,7 +94,7 @@ static void VT100_EscSeq0 (CHAR *letter, LONGINT letter__len) __DEL(letter); } -static void VT100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len) +static void VT100_EscSeq (INT16 n, CHAR *letter, LONGINT letter__len) { CHAR nstr[2]; CHAR cmd[7]; @@ -107,7 +107,7 @@ static void VT100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len) __DEL(letter); } -static void VT100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len) +static void VT100_EscSeqSwapped (INT16 n, CHAR *letter, LONGINT letter__len) { CHAR nstr[2]; CHAR cmd[7]; @@ -120,7 +120,7 @@ static void VT100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len) __DEL(letter); } -static void VT100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len) +static void VT100_EscSeq2 (INT16 n, INT16 m, CHAR *letter, LONGINT letter__len) { CHAR nstr[5], mstr[5]; CHAR cmd[12]; @@ -136,82 +136,82 @@ static void VT100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len) __DEL(letter); } -void VT100_CUU (int16 n) +void VT100_CUU (INT16 n) { VT100_EscSeq(n, (CHAR*)"A", 2); } -void VT100_CUD (int16 n) +void VT100_CUD (INT16 n) { VT100_EscSeq(n, (CHAR*)"B", 2); } -void VT100_CUF (int16 n) +void VT100_CUF (INT16 n) { VT100_EscSeq(n, (CHAR*)"C", 2); } -void VT100_CUB (int16 n) +void VT100_CUB (INT16 n) { VT100_EscSeq(n, (CHAR*)"D", 2); } -void VT100_CNL (int16 n) +void VT100_CNL (INT16 n) { VT100_EscSeq(n, (CHAR*)"E", 2); } -void VT100_CPL (int16 n) +void VT100_CPL (INT16 n) { VT100_EscSeq(n, (CHAR*)"F", 2); } -void VT100_CHA (int16 n) +void VT100_CHA (INT16 n) { VT100_EscSeq(n, (CHAR*)"G", 2); } -void VT100_CUP (int16 n, int16 m) +void VT100_CUP (INT16 n, INT16 m) { VT100_EscSeq2(n, m, (CHAR*)"H", 2); } -void VT100_ED (int16 n) +void VT100_ED (INT16 n) { VT100_EscSeq(n, (CHAR*)"J", 2); } -void VT100_EL (int16 n) +void VT100_EL (INT16 n) { VT100_EscSeq(n, (CHAR*)"K", 2); } -void VT100_SU (int16 n) +void VT100_SU (INT16 n) { VT100_EscSeq(n, (CHAR*)"S", 2); } -void VT100_SD (int16 n) +void VT100_SD (INT16 n) { VT100_EscSeq(n, (CHAR*)"T", 2); } -void VT100_HVP (int16 n, int16 m) +void VT100_HVP (INT16 n, INT16 m) { VT100_EscSeq2(n, m, (CHAR*)"f", 2); } -void VT100_SGR (int16 n) +void VT100_SGR (INT16 n) { VT100_EscSeq(n, (CHAR*)"m", 2); } -void VT100_SGR2 (int16 n, int16 m) +void VT100_SGR2 (INT16 n, INT16 m) { VT100_EscSeq2(n, m, (CHAR*)"m", 2); } -void VT100_DSR (int16 n) +void VT100_DSR (INT16 n) { VT100_EscSeq(6, (CHAR*)"n", 2); } diff --git a/bootstrap/unix-44/VT100.h b/bootstrap/unix-44/VT100.h index ee0408bb..d9aa6ab7 100644 --- a/bootstrap/unix-44/VT100.h +++ b/bootstrap/unix-44/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef VT100__h #define VT100__h @@ -9,27 +9,27 @@ import CHAR VT100_CSI[5]; -import void VT100_CHA (int16 n); -import void VT100_CNL (int16 n); -import void VT100_CPL (int16 n); -import void VT100_CUB (int16 n); -import void VT100_CUD (int16 n); -import void VT100_CUF (int16 n); -import void VT100_CUP (int16 n, int16 m); -import void VT100_CUU (int16 n); +import void VT100_CHA (INT16 n); +import void VT100_CNL (INT16 n); +import void VT100_CPL (INT16 n); +import void VT100_CUB (INT16 n); +import void VT100_CUD (INT16 n); +import void VT100_CUF (INT16 n); +import void VT100_CUP (INT16 n, INT16 m); +import void VT100_CUU (INT16 n); import void VT100_DECTCEMh (void); import void VT100_DECTCEMl (void); -import void VT100_DSR (int16 n); -import void VT100_ED (int16 n); -import void VT100_EL (int16 n); -import void VT100_HVP (int16 n, int16 m); -import void VT100_IntToStr (int32 int_, CHAR *str, LONGINT str__len); +import void VT100_DSR (INT16 n); +import void VT100_ED (INT16 n); +import void VT100_EL (INT16 n); +import void VT100_HVP (INT16 n, INT16 m); +import void VT100_IntToStr (INT32 int_, CHAR *str, LONGINT str__len); import void VT100_RCP (void); import void VT100_SCP (void); -import void VT100_SD (int16 n); -import void VT100_SGR (int16 n); -import void VT100_SGR2 (int16 n, int16 m); -import void VT100_SU (int16 n); +import void VT100_SD (INT16 n); +import void VT100_SGR (INT16 n); +import void VT100_SGR2 (INT16 n, INT16 m); +import void VT100_SU (INT16 n); import void VT100_SetAttr (CHAR *attr, LONGINT attr__len); import void *VT100__init(void); diff --git a/bootstrap/unix-44/errors.c b/bootstrap/unix-44/errors.c index cce1644f..2a1a7a02 100644 --- a/bootstrap/unix-44/errors.c +++ b/bootstrap/unix-44/errors.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" diff --git a/bootstrap/unix-44/errors.h b/bootstrap/unix-44/errors.h index 9d34f721..5555899e 100644 --- a/bootstrap/unix-44/errors.h +++ b/bootstrap/unix-44/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index d2dcce53..8ed00f14 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "Configuration.h" @@ -24,7 +24,7 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGINT cmd__len) { - int16 r, status, exitcode; + INT16 r, status, exitcode; __DUP(title, title__len, CHAR); __DUP(cmd, cmd__len, CHAR); if (__IN(18, OPM_Options, 32)) { diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index 2e262037..ad76f7b6 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/Compiler.c b/bootstrap/unix-48/Compiler.c index 759e721b..86c4c1fd 100644 --- a/bootstrap/unix-48/Compiler.c +++ b/bootstrap/unix-48/Compiler.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "Configuration.h" @@ -26,7 +26,7 @@ static CHAR Compiler_mname[256]; export void Compiler_Module (BOOLEAN *done); static void Compiler_PropagateElementaryTypeSizes (void); export void Compiler_Translate (void); -static void Compiler_Trap (int32 sig); +static void Compiler_Trap (INT32 sig); void Compiler_Module (BOOLEAN *done) @@ -147,7 +147,7 @@ void Compiler_Translate (void) } } -static void Compiler_Trap (int32 sig) +static void Compiler_Trap (INT32 sig) { Heap_FINALL(); if (sig == 3) { diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index 95ddb569..3f8c68d8 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index f6a548e4..6abf2414 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index ddeec08e..998a53d3 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "Heap.h" @@ -18,7 +18,7 @@ typedef struct Files_BufDesc { Files_File f; BOOLEAN chg; - int32 org, size; + INT32 org, size; SYSTEM_BYTE data[4096]; } Files_BufDesc; @@ -33,85 +33,85 @@ typedef Files_FileName workName, registerName; BOOLEAN tempFile; Platform_FileIdentity identity; - int32 fd, len, pos; + INT32 fd, len, pos; Files_Buffer bufs[4]; - int16 swapper, state; + INT16 swapper, state; Files_File next; } Files_FileDesc; typedef struct Files_Rider { - int32 res; + INT32 res; BOOLEAN eof; Files_Buffer buf; - int32 org, offset; + INT32 org, offset; } Files_Rider; static Files_File Files_files; -static int16 Files_tempno; +static INT16 Files_tempno; static CHAR Files_HOME[1024]; static struct { LONGINT len[1]; CHAR data[1]; } *Files_SearchPath; -export address *Files_FileDesc__typ; -export address *Files_BufDesc__typ; -export address *Files_Rider__typ; +export ADDRESS *Files_FileDesc__typ; +export ADDRESS *Files_BufDesc__typ; +export ADDRESS *Files_Rider__typ; -export Files_File Files_Base (Files_Rider *r, address *r__typ); +export Files_File Files_Base (Files_Rider *r, ADDRESS *r__typ); static Files_File Files_CacheEntry (Platform_FileIdentity identity); -export void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int16 *res); +export void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INT16 *res); export void Files_Close (Files_File f); static void Files_CloseOSFile (Files_File f); static void Files_Create (Files_File f); -export void Files_Delete (CHAR *name, LONGINT name__len, int16 *res); -static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int16 errcode); +export void Files_Delete (CHAR *name, LONGINT name__len, INT16 *res); +static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INT16 errcode); static void Files_Finalize (SYSTEM_PTR o); static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *dest, LONGINT dest__len); static void Files_Flush (Files_Buffer buf); -export void Files_GetDate (Files_File f, int32 *t, int32 *d); +export void Files_GetDate (Files_File f, INT32 *t, INT32 *d); export void Files_GetName (Files_File f, CHAR *name, LONGINT name__len); static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *name, LONGINT name__len); static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len); -export int32 Files_Length (Files_File f); +export INT32 Files_Length (Files_File f); static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT name__len, CHAR *dest, LONGINT dest__len); export Files_File Files_New (CHAR *name, LONGINT name__len); export Files_File Files_Old (CHAR *name, LONGINT name__len); -export int32 Files_Pos (Files_Rider *r, address *r__typ); +export INT32 Files_Pos (Files_Rider *r, ADDRESS *r__typ); export void Files_Purge (Files_File f); -export void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x); -export void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x); -export void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); -export void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x); -export void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); -export void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); -export void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); -export void Files_ReadNum (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len); -export void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); -export void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x); -export void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); +export void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x); +export void Files_ReadBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN *x); +export void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n); +export void Files_ReadInt (Files_Rider *R, ADDRESS *R__typ, INT16 *x); +export void Files_ReadLInt (Files_Rider *R, ADDRESS *R__typ, INT32 *x); +export void Files_ReadLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL *x); +export void Files_ReadLine (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); +export void Files_ReadNum (Files_Rider *R, ADDRESS *R__typ, SYSTEM_BYTE *x, LONGINT x__len); +export void Files_ReadReal (Files_Rider *R, ADDRESS *R__typ, REAL *x); +export void Files_ReadSet (Files_Rider *R, ADDRESS *R__typ, UINT32 *x); +export void Files_ReadString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); export void Files_Register (Files_File f); -export void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res); -static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len); -export void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos); +export void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT16 *res); +static void Files_ScanPath (INT16 *pos, CHAR *dir, LONGINT dir__len); +export void Files_Set (Files_Rider *r, ADDRESS *r__typ, Files_File f, INT32 pos); export void Files_SetSearchPath (CHAR *path, LONGINT path__len); -export void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x); -export void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x); -export void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); -export void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x); -export void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x); -export void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x); -export void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x); -export void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x); -export void Files_WriteSet (Files_Rider *R, address *R__typ, uint32 x); -export void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); +export void Files_Write (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE x); +export void Files_WriteBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN x); +export void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n); +export void Files_WriteInt (Files_Rider *R, ADDRESS *R__typ, INT16 x); +export void Files_WriteLInt (Files_Rider *R, ADDRESS *R__typ, INT32 x); +export void Files_WriteLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL x); +export void Files_WriteNum (Files_Rider *R, ADDRESS *R__typ, INT64 x); +export void Files_WriteReal (Files_Rider *R, ADDRESS *R__typ, REAL x); +export void Files_WriteSet (Files_Rider *R, ADDRESS *R__typ, UINT32 x); +export void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); #define Files_IdxTrap() __HALT(-1) #define Files_ToAdr(x) (address)x -static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int16 errcode) +static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INT16 errcode) { __DUP(s, s__len, CHAR); Out_Ln(); @@ -140,7 +140,7 @@ static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int16 errcode) static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT name__len, CHAR *dest, LONGINT dest__len) { - int16 i, j; + INT16 i, j; __DUP(dir, dir__len, CHAR); __DUP(name, name__len, CHAR); i = 0; @@ -165,7 +165,7 @@ static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *name, LONGINT name__len) { - int32 n, i, j; + INT32 n, i, j; __DUP(finalName, finalName__len, CHAR); Files_tempno += 1; n = Files_tempno; @@ -217,7 +217,7 @@ static void Files_Create (Files_File f) { Platform_FileIdentity identity; BOOLEAN done; - int16 error; + INT16 error; CHAR err[32]; if (f->fd == -1) { if (f->state == 1) { @@ -254,7 +254,7 @@ static void Files_Create (Files_File f) static void Files_Flush (Files_Buffer buf) { - int16 error; + INT16 error; Files_File f = NIL; if (buf->chg) { f = buf->f; @@ -278,7 +278,7 @@ static void Files_Flush (Files_Buffer buf) static void Files_CloseOSFile (Files_File f) { Files_File prev = NIL; - int16 error; + INT16 error; if (Files_files == f) { Files_files = f->next; } else { @@ -298,8 +298,8 @@ static void Files_CloseOSFile (Files_File f) void Files_Close (Files_File f) { - int32 i; - int16 error; + INT32 i; + INT16 error; if (f->state != 1 || f->registerName[0] != 0x00) { Files_Create(f); i = 0; @@ -315,7 +315,7 @@ void Files_Close (Files_File f) } } -int32 Files_Length (Files_File f) +INT32 Files_Length (Files_File f) { return f->len; } @@ -336,9 +336,9 @@ Files_File Files_New (CHAR *name, LONGINT name__len) return f; } -static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len) +static void Files_ScanPath (INT16 *pos, CHAR *dir, LONGINT dir__len) { - int16 i; + INT16 i; CHAR ch; i = 0; if (Files_SearchPath == NIL) { @@ -381,7 +381,7 @@ static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len) static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len) { - int16 i; + INT16 i; CHAR ch; i = 0; ch = name[0]; @@ -395,7 +395,7 @@ static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len) static Files_File Files_CacheEntry (Platform_FileIdentity identity) { Files_File f = NIL; - int16 i, error; + INT16 i, error; f = Files_files; while (f != NIL) { if (Platform_SameFile(identity, f->identity)) { @@ -422,11 +422,11 @@ static Files_File Files_CacheEntry (Platform_FileIdentity identity) Files_File Files_Old (CHAR *name, LONGINT name__len) { Files_File f = NIL; - int32 fd; - int16 pos; + INT32 fd; + INT16 pos; BOOLEAN done; CHAR dir[256], path[256]; - int16 error; + INT16 error; Platform_FileIdentity identity; __DUP(name, name__len, CHAR); if (name[0] != 0x00) { @@ -497,9 +497,9 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) void Files_Purge (Files_File f) { - int16 i; + INT16 i; Platform_FileIdentity identity; - int16 error; + INT16 error; i = 0; while (i < 4) { if (f->bufs[i] != NIL) { @@ -519,25 +519,25 @@ void Files_Purge (Files_File f) Platform_SetMTime(&f->identity, Platform_FileIdentity__typ, identity); } -void Files_GetDate (Files_File f, int32 *t, int32 *d) +void Files_GetDate (Files_File f, INT32 *t, INT32 *d) { Platform_FileIdentity identity; - int16 error; + INT16 error; Files_Create(f); error = Platform_Identify(f->fd, &identity, Platform_FileIdentity__typ); Platform_MTimeAsClock(identity, &*t, &*d); } -int32 Files_Pos (Files_Rider *r, address *r__typ) +INT32 Files_Pos (Files_Rider *r, ADDRESS *r__typ) { return (*r).org + (*r).offset; } -void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos) +void Files_Set (Files_Rider *r, ADDRESS *r__typ, Files_File f, INT32 pos) { - int32 org, offset, i, n; + INT32 org, offset, i, n; Files_Buffer buf = NIL; - int16 error; + INT16 error; if (f != NIL) { if (pos > f->len) { pos = f->len; @@ -595,9 +595,9 @@ void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos) (*r).res = 0; } -void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x) +void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x) { - int32 offset; + INT32 offset; Files_Buffer buf = NIL; buf = (*r).buf; offset = (*r).offset; @@ -619,9 +619,9 @@ void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x) } } -void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n) +void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n) { - int32 xpos, min, restInBuf, offset; + INT32 xpos, min, restInBuf, offset; Files_Buffer buf = NIL; if (n > x__len) { Files_IdxTrap(); @@ -655,15 +655,15 @@ void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x (*r).eof = 0; } -Files_File Files_Base (Files_Rider *r, address *r__typ) +Files_File Files_Base (Files_Rider *r, ADDRESS *r__typ) { return (*r).buf->f; } -void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x) +void Files_Write (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE x) { Files_Buffer buf = NIL; - int32 offset; + INT32 offset; buf = (*r).buf; offset = (*r).offset; if ((*r).org != buf->org || offset >= 4096) { @@ -681,9 +681,9 @@ void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x) (*r).res = 0; } -void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n) +void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n) { - int32 xpos, min, restInBuf, offset; + INT32 xpos, min, restInBuf, offset; Files_Buffer buf = NIL; if (n > x__len) { Files_IdxTrap(); @@ -717,17 +717,17 @@ void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT (*r).res = 0; } -void Files_Delete (CHAR *name, LONGINT name__len, int16 *res) +void Files_Delete (CHAR *name, LONGINT name__len, INT16 *res) { __DUP(name, name__len, CHAR); *res = Platform_Unlink((void*)name, name__len); __DEL(name); } -void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res) +void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT16 *res) { - int32 fdold, fdnew, n; - int16 error, ignore; + INT32 fdold, fdnew, n; + INT16 error, ignore; Platform_FileIdentity oldidentity, newidentity; CHAR buf[4096]; __DUP(old, old__len, CHAR); @@ -788,7 +788,7 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int void Files_Register (Files_File f) { - int16 idx, errcode; + INT16 idx, errcode; Files_File f1 = NIL; CHAR file[104]; if ((f->state == 1 && f->registerName[0] != 0x00)) { @@ -807,7 +807,7 @@ void Files_Register (Files_File f) } } -void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int16 *res) +void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INT16 *res) { __DUP(path, path__len, CHAR); *res = Platform_Chdir((void*)path, path__len); @@ -816,7 +816,7 @@ void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int16 *res) static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *dest, LONGINT dest__len) { - int32 i, j; + INT32 i, j; if (!Platform_LittleEndian) { i = src__len; j = 0; @@ -830,51 +830,51 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *de } } -void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x) +void Files_ReadBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN *x) { Files_Read(&*R, R__typ, (CHAR*)(void*)&*x); } -void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x) +void Files_ReadInt (Files_Rider *R, ADDRESS *R__typ, INT16 *x) { CHAR b[2]; Files_ReadBytes(&*R, R__typ, (void*)b, 2, 2); - *x = (int16)b[0] + __ASHL((int16)b[1], 8); + *x = (INT16)b[0] + __ASHL((INT16)b[1], 8); } -void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x) +void Files_ReadLInt (Files_Rider *R, ADDRESS *R__typ, INT32 *x) { CHAR b[4]; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); - *x = (((int16)b[0] + __ASHL((int16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); + *x = (((INT16)b[0] + __ASHL((INT16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); } -void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x) +void Files_ReadSet (Files_Rider *R, ADDRESS *R__typ, UINT32 *x) { CHAR b[4]; - int32 l; + INT32 l; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); - l = (((int16)b[0] + __ASHL((int16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); - *x = (uint32)l; + l = (((INT16)b[0] + __ASHL((INT16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); + *x = (UINT32)l; } -void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x) +void Files_ReadReal (Files_Rider *R, ADDRESS *R__typ, REAL *x) { CHAR b[4]; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); Files_FlipBytes((void*)b, 4, (void*)&*x, 4); } -void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x) +void Files_ReadLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL *x) { CHAR b[8]; Files_ReadBytes(&*R, R__typ, (void*)b, 8, 8); Files_FlipBytes((void*)b, 8, (void*)&*x, 8); } -void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) +void Files_ReadString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len) { - int16 i; + INT16 i; CHAR ch; i = 0; do { @@ -884,9 +884,9 @@ void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) } while (!(ch == 0x00)); } -void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) +void Files_ReadLine (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len) { - int16 i; + INT16 i; CHAR ch; BOOLEAN b; i = 0; @@ -902,29 +902,29 @@ void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) } while (!b); } -void Files_ReadNum (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len) +void Files_ReadNum (Files_Rider *R, ADDRESS *R__typ, SYSTEM_BYTE *x, LONGINT x__len) { - int8 s, b; - int64 q; + INT8 s, b; + INT64 q; s = 0; q = 0; Files_Read(&*R, R__typ, (void*)&b); while (b < 0) { - q += (int64)__ASH(((int16)b + 128), s); + q += (INT64)__ASH(((INT16)b + 128), s); s += 7; Files_Read(&*R, R__typ, (void*)&b); } - q += (int64)__ASH((__MASK(b, -64) - __ASHL(__ASHR(b, 6), 6)), s); + q += (INT64)__ASH((__MASK(b, -64) - __ASHL(__ASHR(b, 6), 6)), s); __ASSERT(x__len <= 8, 0); __MOVE((address)&q, (address)x, x__len); } -void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x) +void Files_WriteBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN x) { Files_Write(&*R, R__typ, __VAL(CHAR, x)); } -void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x) +void Files_WriteInt (Files_Rider *R, ADDRESS *R__typ, INT16 x) { CHAR b[2]; b[0] = (CHAR)x; @@ -932,7 +932,7 @@ void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x) Files_WriteBytes(&*R, R__typ, (void*)b, 2, 2); } -void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x) +void Files_WriteLInt (Files_Rider *R, ADDRESS *R__typ, INT32 x) { CHAR b[4]; b[0] = (CHAR)x; @@ -942,11 +942,11 @@ void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x) Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } -void Files_WriteSet (Files_Rider *R, address *R__typ, uint32 x) +void Files_WriteSet (Files_Rider *R, ADDRESS *R__typ, UINT32 x) { CHAR b[4]; - int32 i; - i = (int32)x; + INT32 i; + i = (INT32)x; b[0] = (CHAR)i; b[1] = (CHAR)__ASHR(i, 8); b[2] = (CHAR)__ASHR(i, 16); @@ -954,23 +954,23 @@ void Files_WriteSet (Files_Rider *R, address *R__typ, uint32 x) Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } -void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x) +void Files_WriteReal (Files_Rider *R, ADDRESS *R__typ, REAL x) { CHAR b[4]; Files_FlipBytes((void*)&x, 4, (void*)b, 4); Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } -void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x) +void Files_WriteLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL x) { CHAR b[8]; Files_FlipBytes((void*)&x, 8, (void*)b, 8); Files_WriteBytes(&*R, R__typ, (void*)b, 8, 8); } -void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) +void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len) { - int16 i; + INT16 i; i = 0; while (x[i] != 0x00) { i += 1; @@ -978,7 +978,7 @@ void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len Files_WriteBytes(&*R, R__typ, (void*)x, x__len * 1, i + 1); } -void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x) +void Files_WriteNum (Files_Rider *R, ADDRESS *R__typ, INT64 x) { while (x < -64 || x > 63) { Files_Write(&*R, R__typ, (CHAR)(__MASK(x, -128) + 128)); @@ -995,7 +995,7 @@ void Files_GetName (Files_File f, CHAR *name, LONGINT name__len) static void Files_Finalize (SYSTEM_PTR o) { Files_File f = NIL; - int32 res; + INT32 res; f = (Files_File)(address)o; if (f->fd >= 0) { Files_CloseOSFile(f); diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index 8f575f62..93b5757c 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h @@ -11,58 +11,58 @@ typedef typedef struct Files_FileDesc { char _prvt0[216]; - int32 fd; + INT32 fd; char _prvt1[32]; } Files_FileDesc; typedef struct Files_Rider { - int32 res; + INT32 res; BOOLEAN eof; char _prvt0[15]; } Files_Rider; -import address *Files_FileDesc__typ; -import address *Files_Rider__typ; +import ADDRESS *Files_FileDesc__typ; +import ADDRESS *Files_Rider__typ; -import Files_File Files_Base (Files_Rider *r, address *r__typ); -import void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int16 *res); +import Files_File Files_Base (Files_Rider *r, ADDRESS *r__typ); +import void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INT16 *res); import void Files_Close (Files_File f); -import void Files_Delete (CHAR *name, LONGINT name__len, int16 *res); -import void Files_GetDate (Files_File f, int32 *t, int32 *d); +import void Files_Delete (CHAR *name, LONGINT name__len, INT16 *res); +import void Files_GetDate (Files_File f, INT32 *t, INT32 *d); import void Files_GetName (Files_File f, CHAR *name, LONGINT name__len); -import int32 Files_Length (Files_File f); +import INT32 Files_Length (Files_File f); import Files_File Files_New (CHAR *name, LONGINT name__len); import Files_File Files_Old (CHAR *name, LONGINT name__len); -import int32 Files_Pos (Files_Rider *r, address *r__typ); +import INT32 Files_Pos (Files_Rider *r, ADDRESS *r__typ); import void Files_Purge (Files_File f); -import void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x); -import void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x); -import void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); -import void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x); -import void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); -import void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); -import void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); -import void Files_ReadNum (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len); -import void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); -import void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x); -import void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); +import void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x); +import void Files_ReadBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN *x); +import void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n); +import void Files_ReadInt (Files_Rider *R, ADDRESS *R__typ, INT16 *x); +import void Files_ReadLInt (Files_Rider *R, ADDRESS *R__typ, INT32 *x); +import void Files_ReadLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL *x); +import void Files_ReadLine (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); +import void Files_ReadNum (Files_Rider *R, ADDRESS *R__typ, SYSTEM_BYTE *x, LONGINT x__len); +import void Files_ReadReal (Files_Rider *R, ADDRESS *R__typ, REAL *x); +import void Files_ReadSet (Files_Rider *R, ADDRESS *R__typ, UINT32 *x); +import void Files_ReadString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); import void Files_Register (Files_File f); -import void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res); -import void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos); +import void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT16 *res); +import void Files_Set (Files_Rider *r, ADDRESS *r__typ, Files_File f, INT32 pos); import void Files_SetSearchPath (CHAR *path, LONGINT path__len); -import void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x); -import void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x); -import void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); -import void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x); -import void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x); -import void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x); -import void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x); -import void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x); -import void Files_WriteSet (Files_Rider *R, address *R__typ, uint32 x); -import void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); +import void Files_Write (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE x); +import void Files_WriteBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN x); +import void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n); +import void Files_WriteInt (Files_Rider *R, ADDRESS *R__typ, INT16 x); +import void Files_WriteLInt (Files_Rider *R, ADDRESS *R__typ, INT32 x); +import void Files_WriteLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL x); +import void Files_WriteNum (Files_Rider *R, ADDRESS *R__typ, INT64 x); +import void Files_WriteReal (Files_Rider *R, ADDRESS *R__typ, REAL x); +import void Files_WriteSet (Files_Rider *R, ADDRESS *R__typ, UINT32 x); +import void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); import void *Files__init(void); diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index 4bc74170..ca99053e 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" @@ -40,7 +40,7 @@ typedef typedef struct Heap_FinDesc { Heap_FinNode next; - int32 obj; + INT32 obj; BOOLEAN marked; Heap_Finalizer finalize; } Heap_FinDesc; @@ -55,53 +55,53 @@ typedef struct Heap_ModuleDesc { Heap_Module next; Heap_ModuleName name; - int32 refcnt; + INT32 refcnt; Heap_Cmd cmds; - int32 types; + INT32 types; Heap_EnumProc enumPtrs; - int32 reserved1, reserved2; + INT32 reserved1, reserved2; } Heap_ModuleDesc; export SYSTEM_PTR Heap_modules; -static int32 Heap_freeList[10]; -static int32 Heap_bigBlocks; -export int32 Heap_allocated; +static INT32 Heap_freeList[10]; +static INT32 Heap_bigBlocks; +export INT32 Heap_allocated; static BOOLEAN Heap_firstTry; -static int32 Heap_heap, Heap_heapend; -export int32 Heap_heapsize; +static INT32 Heap_heap, Heap_heapend; +export INT32 Heap_heapsize; static Heap_FinNode Heap_fin; -static int16 Heap_lockdepth; +static INT16 Heap_lockdepth; static BOOLEAN Heap_interrupted; -export int16 Heap_FileCount; +export INT16 Heap_FileCount; -export address *Heap_ModuleDesc__typ; -export address *Heap_CmdDesc__typ; -export address *Heap_FinDesc__typ; -export address *Heap__1__typ; +export ADDRESS *Heap_ModuleDesc__typ; +export ADDRESS *Heap_CmdDesc__typ; +export ADDRESS *Heap_FinDesc__typ; +export ADDRESS *Heap__1__typ; static void Heap_CheckFin (void); -static void Heap_ExtendHeap (int32 blksz); +static void Heap_ExtendHeap (INT32 blksz); export void Heap_FINALL (void); static void Heap_Finalize (void); export void Heap_GC (BOOLEAN markStack); -static void Heap_HeapSort (int32 n, int32 *a, LONGINT a__len); +static void Heap_HeapSort (INT32 n, INT32 *a, LONGINT a__len); export void Heap_INCREF (Heap_Module m); export void Heap_InitHeap (void); export void Heap_Lock (void); -static void Heap_Mark (int32 q); -static void Heap_MarkCandidates (int32 n, int32 *cand, LONGINT cand__len); +static void Heap_Mark (INT32 q); +static void Heap_MarkCandidates (INT32 n, INT32 *cand, LONGINT cand__len); static void Heap_MarkP (SYSTEM_PTR p); -static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len); -export SYSTEM_PTR Heap_NEWBLK (int32 size); -export SYSTEM_PTR Heap_NEWREC (int32 tag); -static int32 Heap_NewChunk (int32 blksz); +static void Heap_MarkStack (INT32 n, INT32 *cand, LONGINT cand__len); +export SYSTEM_PTR Heap_NEWBLK (INT32 size); +export SYSTEM_PTR Heap_NEWREC (INT32 tag); +static INT32 Heap_NewChunk (INT32 blksz); export void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); export SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -export void Heap_REGTYP (Heap_Module m, int32 typ); +export void Heap_REGTYP (Heap_Module m, INT32 typ); export void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); static void Heap_Scan (void); -static void Heap_Sift (int32 l, int32 r, int32 *a, LONGINT a__len); +static void Heap_Sift (INT32 l, INT32 r, INT32 *a, LONGINT a__len); export void Heap_Unlock (void); extern void *Heap__init(); @@ -157,9 +157,9 @@ void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) m->cmds = c; } -void Heap_REGTYP (Heap_Module m, int32 typ) +void Heap_REGTYP (Heap_Module m, INT32 typ) { - __PUT(typ, m->types, int32); + __PUT(typ, m->types, INT32); m->types = typ; } @@ -168,25 +168,25 @@ void Heap_INCREF (Heap_Module m) m->refcnt += 1; } -static int32 Heap_NewChunk (int32 blksz) +static INT32 Heap_NewChunk (INT32 blksz) { - int32 chnk; + INT32 chnk; chnk = Heap_OSAllocate(blksz + 12); if (chnk != 0) { - __PUT(chnk + 4, chnk + (12 + blksz), int32); - __PUT(chnk + 12, chnk + 16, int32); - __PUT(chnk + 16, blksz, int32); - __PUT(chnk + 20, -4, int32); - __PUT(chnk + 24, Heap_bigBlocks, int32); + __PUT(chnk + 4, chnk + (12 + blksz), INT32); + __PUT(chnk + 12, chnk + 16, INT32); + __PUT(chnk + 16, blksz, INT32); + __PUT(chnk + 20, -4, INT32); + __PUT(chnk + 24, Heap_bigBlocks, INT32); Heap_bigBlocks = chnk + 12; Heap_heapsize += blksz; } return chnk; } -static void Heap_ExtendHeap (int32 blksz) +static void Heap_ExtendHeap (INT32 blksz) { - int32 size, chnk, j, next; + INT32 size, chnk, j, next; if (blksz > 160000) { size = blksz; } else { @@ -195,30 +195,30 @@ static void Heap_ExtendHeap (int32 blksz) chnk = Heap_NewChunk(size); if (chnk != 0) { if (chnk < Heap_heap) { - __PUT(chnk, Heap_heap, int32); + __PUT(chnk, Heap_heap, INT32); Heap_heap = chnk; } else { j = Heap_heap; - __GET(j, next, int32); + __GET(j, next, INT32); while ((next != 0 && chnk > next)) { j = next; - __GET(j, next, int32); + __GET(j, next, INT32); } - __PUT(chnk, next, int32); - __PUT(j, chnk, int32); + __PUT(chnk, next, INT32); + __PUT(j, chnk, INT32); } if (next == 0) { - __GET(chnk + 4, Heap_heapend, int32); + __GET(chnk + 4, Heap_heapend, INT32); } } } -SYSTEM_PTR Heap_NEWREC (int32 tag) +SYSTEM_PTR Heap_NEWREC (INT32 tag) { - int32 i, i0, di, blksz, restsize, t, adr, end, next, prev; + INT32 i, i0, di, blksz, restsize, t, adr, end, next, prev; SYSTEM_PTR new; Heap_Lock(); - __GET(tag, blksz, int32); + __GET(tag, blksz, INT32); i0 = __ASHR(blksz, 4); i = i0; if (i < 9) { @@ -229,17 +229,17 @@ SYSTEM_PTR Heap_NEWREC (int32 tag) } } if (i < 9) { - __GET(adr + 12, next, int32); + __GET(adr + 12, next, INT32); Heap_freeList[i] = next; if (i != i0) { di = i - i0; restsize = __ASHL(di, 4); end = adr + restsize; - __PUT(end + 4, blksz, int32); - __PUT(end + 8, -4, int32); - __PUT(end, end + 4, int32); - __PUT(adr + 4, restsize, int32); - __PUT(adr + 12, Heap_freeList[di], int32); + __PUT(end + 4, blksz, INT32); + __PUT(end + 8, -4, INT32); + __PUT(end, end + 4, INT32); + __PUT(adr + 4, restsize, INT32); + __PUT(adr + 12, Heap_freeList[di], INT32); Heap_freeList[di] = adr; adr += restsize; } @@ -268,31 +268,31 @@ SYSTEM_PTR Heap_NEWREC (int32 tag) return NIL; } } - __GET(adr + 4, t, int32); + __GET(adr + 4, t, INT32); if (t >= blksz) { break; } prev = adr; - __GET(adr + 12, adr, int32); + __GET(adr + 12, adr, INT32); } restsize = t - blksz; end = adr + restsize; - __PUT(end + 4, blksz, int32); - __PUT(end + 8, -4, int32); - __PUT(end, end + 4, int32); + __PUT(end + 4, blksz, INT32); + __PUT(end + 8, -4, INT32); + __PUT(end, end + 4, INT32); if (restsize > 144) { - __PUT(adr + 4, restsize, int32); + __PUT(adr + 4, restsize, INT32); } else { - __GET(adr + 12, next, int32); + __GET(adr + 12, next, INT32); if (prev == 0) { Heap_bigBlocks = next; } else { - __PUT(prev + 12, next, int32); + __PUT(prev + 12, next, INT32); } if (restsize > 0) { di = __ASHR(restsize, 4); - __PUT(adr + 4, restsize, int32); - __PUT(adr + 12, Heap_freeList[di], int32); + __PUT(adr + 4, restsize, INT32); + __PUT(adr + 12, Heap_freeList[di], INT32); Heap_freeList[di] = adr; } } @@ -301,69 +301,69 @@ SYSTEM_PTR Heap_NEWREC (int32 tag) i = adr + 16; end = adr + blksz; while (i < end) { - __PUT(i, 0, int32); - __PUT(i + 4, 0, int32); - __PUT(i + 8, 0, int32); - __PUT(i + 12, 0, int32); + __PUT(i, 0, INT32); + __PUT(i + 4, 0, INT32); + __PUT(i + 8, 0, INT32); + __PUT(i + 12, 0, INT32); i += 16; } - __PUT(adr + 12, 0, int32); - __PUT(adr, tag, int32); - __PUT(adr + 4, 0, int32); - __PUT(adr + 8, 0, int32); + __PUT(adr + 12, 0, INT32); + __PUT(adr, tag, INT32); + __PUT(adr + 4, 0, INT32); + __PUT(adr + 8, 0, INT32); Heap_allocated += blksz; Heap_Unlock(); return (SYSTEM_PTR)(address)(adr + 4); } -SYSTEM_PTR Heap_NEWBLK (int32 size) +SYSTEM_PTR Heap_NEWBLK (INT32 size) { - int32 blksz, tag; + INT32 blksz, tag; SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 31, 4), 4); new = Heap_NEWREC((address)&blksz); - tag = ((int32)(address)new + blksz) - 12; - __PUT(tag - 4, 0, int32); - __PUT(tag, blksz, int32); - __PUT(tag + 4, -4, int32); - __PUT((int32)(address)new - 4, tag, int32); + tag = ((INT32)(address)new + blksz) - 12; + __PUT(tag - 4, 0, INT32); + __PUT(tag, blksz, INT32); + __PUT(tag + 4, -4, INT32); + __PUT((INT32)(address)new - 4, tag, INT32); Heap_Unlock(); return new; } -static void Heap_Mark (int32 q) +static void Heap_Mark (INT32 q) { - int32 p, tag, offset, fld, n, tagbits; + INT32 p, tag, offset, fld, n, tagbits; if (q != 0) { - __GET(q - 4, tagbits, int32); + __GET(q - 4, tagbits, INT32); if (!__ODD(tagbits)) { - __PUT(q - 4, tagbits + 1, int32); + __PUT(q - 4, tagbits + 1, INT32); p = 0; tag = tagbits + 4; for (;;) { - __GET(tag, offset, int32); + __GET(tag, offset, INT32); if (offset < 0) { - __PUT(q - 4, (tag + offset) + 1, int32); + __PUT(q - 4, (tag + offset) + 1, INT32); if (p == 0) { break; } n = q; q = p; - __GET(q - 4, tag, int32); + __GET(q - 4, tag, INT32); tag -= 1; - __GET(tag, offset, int32); + __GET(tag, offset, INT32); fld = q + offset; - __GET(fld, p, int32); + __GET(fld, p, INT32); __PUT(fld, (SYSTEM_PTR)(address)n, SYSTEM_PTR); } else { fld = q + offset; - __GET(fld, n, int32); + __GET(fld, n, INT32); if (n != 0) { - __GET(n - 4, tagbits, int32); + __GET(n - 4, tagbits, INT32); if (!__ODD(tagbits)) { - __PUT(n - 4, tagbits + 1, int32); - __PUT(q - 4, tag + 1, int32); + __PUT(n - 4, tagbits + 1, INT32); + __PUT(q - 4, tag + 1, INT32); __PUT(fld, (SYSTEM_PTR)(address)p, SYSTEM_PTR); p = q; q = n; @@ -379,12 +379,12 @@ static void Heap_Mark (int32 q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((int32)(address)p); + Heap_Mark((INT32)(address)p); } static void Heap_Scan (void) { - int32 chnk, adr, end, start, tag, i, size, freesize; + INT32 chnk, adr, end, start, tag, i, size, freesize; Heap_bigBlocks = 0; i = 1; while (i < 9) { @@ -396,58 +396,58 @@ static void Heap_Scan (void) chnk = Heap_heap; while (chnk != 0) { adr = chnk + 12; - __GET(chnk + 4, end, int32); + __GET(chnk + 4, end, INT32); while (adr < end) { - __GET(adr, tag, int32); + __GET(adr, tag, INT32); if (__ODD(tag)) { if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 4, int32); - __PUT(start + 4, freesize, int32); - __PUT(start + 8, -4, int32); + __PUT(start, start + 4, INT32); + __PUT(start + 4, freesize, INT32); + __PUT(start + 8, -4, INT32); i = __ASHR(freesize, 4); freesize = 0; if (i < 9) { - __PUT(start + 12, Heap_freeList[i], int32); + __PUT(start + 12, Heap_freeList[i], INT32); Heap_freeList[i] = start; } else { - __PUT(start + 12, Heap_bigBlocks, int32); + __PUT(start + 12, Heap_bigBlocks, INT32); Heap_bigBlocks = start; } } tag -= 1; - __PUT(adr, tag, int32); - __GET(tag, size, int32); + __PUT(adr, tag, INT32); + __GET(tag, size, INT32); Heap_allocated += size; adr += size; } else { - __GET(tag, size, int32); + __GET(tag, size, INT32); freesize += size; adr += size; } } if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 4, int32); - __PUT(start + 4, freesize, int32); - __PUT(start + 8, -4, int32); + __PUT(start, start + 4, INT32); + __PUT(start + 4, freesize, INT32); + __PUT(start + 8, -4, INT32); i = __ASHR(freesize, 4); freesize = 0; if (i < 9) { - __PUT(start + 12, Heap_freeList[i], int32); + __PUT(start + 12, Heap_freeList[i], INT32); Heap_freeList[i] = start; } else { - __PUT(start + 12, Heap_bigBlocks, int32); + __PUT(start + 12, Heap_bigBlocks, INT32); Heap_bigBlocks = start; } } - __GET(chnk, chnk, int32); + __GET(chnk, chnk, INT32); } } -static void Heap_Sift (int32 l, int32 r, int32 *a, LONGINT a__len) +static void Heap_Sift (INT32 l, INT32 r, INT32 *a, LONGINT a__len) { - int32 i, j, x; + INT32 i, j, x; j = l; x = a[j]; for (;;) { @@ -464,9 +464,9 @@ static void Heap_Sift (int32 l, int32 r, int32 *a, LONGINT a__len) a[i] = x; } -static void Heap_HeapSort (int32 n, int32 *a, LONGINT a__len) +static void Heap_HeapSort (INT32 n, INT32 *a, LONGINT a__len) { - int32 l, r, x; + INT32 l, r, x; l = __ASHR(n, 1); r = n - 1; while (l > 0) { @@ -482,25 +482,25 @@ static void Heap_HeapSort (int32 n, int32 *a, LONGINT a__len) } } -static void Heap_MarkCandidates (int32 n, int32 *cand, LONGINT cand__len) +static void Heap_MarkCandidates (INT32 n, INT32 *cand, LONGINT cand__len) { - int32 chnk, adr, tag, next, lim, lim1, i, ptr, size; + INT32 chnk, adr, tag, next, lim, lim1, i, ptr, size; chnk = Heap_heap; i = 0; lim = cand[n - 1]; while ((chnk != 0 && chnk < lim)) { adr = chnk + 12; - __GET(chnk + 4, lim1, int32); + __GET(chnk + 4, lim1, INT32); if (lim < lim1) { lim1 = lim; } while (adr < lim1) { - __GET(adr, tag, int32); + __GET(adr, tag, INT32); if (__ODD(tag)) { - __GET(tag - 1, size, int32); + __GET(tag - 1, size, INT32); adr += size; } else { - __GET(tag, size, int32); + __GET(tag, size, INT32); ptr = adr + 4; while (cand[i] < ptr) { i += 1; @@ -515,17 +515,17 @@ static void Heap_MarkCandidates (int32 n, int32 *cand, LONGINT cand__len) adr = next; } } - __GET(chnk, chnk, int32); + __GET(chnk, chnk, INT32); } } static void Heap_CheckFin (void) { Heap_FinNode n; - int32 tag; + INT32 tag; n = Heap_fin; while (n != NIL) { - __GET(n->obj - 4, tag, int32); + __GET(n->obj - 4, tag, INT32); if (!__ODD(tag)) { n->marked = 0; Heap_Mark(n->obj); @@ -571,10 +571,10 @@ void Heap_FINALL (void) } } -static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len) +static void Heap_MarkStack (INT32 n, INT32 *cand, LONGINT cand__len) { SYSTEM_PTR frame; - int32 inc, nofcand, sp, p, stack0; + INT32 inc, nofcand, sp, p, stack0; struct Heap__1 align; if (n > 0) { Heap_MarkStack(n - 1, cand, cand__len); @@ -591,7 +591,7 @@ static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len) inc = -inc; } while (sp != stack0) { - __GET(sp, p, int32); + __GET(sp, p, INT32); if ((p > Heap_heap && p < Heap_heapend)) { if (nofcand == cand__len) { Heap_HeapSort(nofcand, (void*)cand, cand__len); @@ -613,8 +613,8 @@ static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len) void Heap_GC (BOOLEAN markStack) { Heap_Module m; - int32 i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; - int32 cand[10000]; + INT32 i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; + INT32 cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); m = (Heap_Module)(address)Heap_modules; @@ -694,7 +694,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (int32)(address)obj; + f->obj = (INT32)(address)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; @@ -704,8 +704,8 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) void Heap_InitHeap (void) { Heap_heap = Heap_NewChunk(128000); - __GET(Heap_heap + 4, Heap_heapend, int32); - __PUT(Heap_heap, 0, int32); + __GET(Heap_heap + 4, Heap_heapend, INT32); + __PUT(Heap_heap, 0, INT32); Heap_allocated = 0; Heap_firstTry = 1; Heap_freeList[9] = 1; diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index 1a319646..dbc3fcd7 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h @@ -22,7 +22,7 @@ typedef typedef struct Heap_ModuleDesc { - int32 _prvt0; + INT32 _prvt0; char _prvt1[44]; } Heap_ModuleDesc; @@ -31,21 +31,21 @@ typedef import SYSTEM_PTR Heap_modules; -import int32 Heap_allocated, Heap_heapsize; -import int16 Heap_FileCount; +import INT32 Heap_allocated, Heap_heapsize; +import INT16 Heap_FileCount; -import address *Heap_ModuleDesc__typ; +import ADDRESS *Heap_ModuleDesc__typ; import void Heap_FINALL (void); import void Heap_GC (BOOLEAN markStack); import void Heap_INCREF (Heap_Module m); import void Heap_InitHeap (void); import void Heap_Lock (void); -import SYSTEM_PTR Heap_NEWBLK (int32 size); -import SYSTEM_PTR Heap_NEWREC (int32 tag); +import SYSTEM_PTR Heap_NEWBLK (INT32 size); +import SYSTEM_PTR Heap_NEWREC (INT32 tag); import void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); import SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -import void Heap_REGTYP (Heap_Module m, int32 typ); +import void Heap_REGTYP (Heap_Module m, INT32 typ); import void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); import void Heap_Unlock (void); import void *Heap__init(void); diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index bb6774da..d8293ed7 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "Heap.h" @@ -31,20 +31,20 @@ typedef struct Modules_ModuleDesc { Modules_Module next; Modules_ModuleName name; - int32 refcnt; + INT32 refcnt; Modules_Cmd cmds; - int32 types; - void (*enumPtrs)(void(*)(int32)); - int32 reserved1, reserved2; + INT32 types; + void (*enumPtrs)(void(*)(INT32)); + INT32 reserved1, reserved2; } Modules_ModuleDesc; -export int16 Modules_res; +export INT16 Modules_res; export CHAR Modules_resMsg[256]; export Modules_ModuleName Modules_imported, Modules_importing; -export address *Modules_ModuleDesc__typ; -export address *Modules_CmdDesc__typ; +export ADDRESS *Modules_ModuleDesc__typ; +export ADDRESS *Modules_CmdDesc__typ; static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len); export void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all); @@ -56,7 +56,7 @@ export Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len); static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len) { - int16 i, j; + INT16 i, j; __DUP(b, b__len, CHAR); i = 0; while (a[__X(i, a__len)] != 0x00) { diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index a7b62fe3..c2afbd3c 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h @@ -28,20 +28,20 @@ typedef struct Modules_ModuleDesc { Modules_Module next; Modules_ModuleName name; - int32 refcnt; + INT32 refcnt; Modules_Cmd cmds; - int32 types; - void (*enumPtrs)(void(*)(int32)); + INT32 types; + void (*enumPtrs)(void(*)(INT32)); char _prvt0[8]; } Modules_ModuleDesc; -import int16 Modules_res; +import INT16 Modules_res; import CHAR Modules_resMsg[256]; import Modules_ModuleName Modules_imported, Modules_importing; -import address *Modules_ModuleDesc__typ; -import address *Modules_CmdDesc__typ; +import ADDRESS *Modules_ModuleDesc__typ; +import ADDRESS *Modules_CmdDesc__typ; import void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all); import Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len); diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index dff6adc6..60993ebe 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "OPM.h" @@ -11,13 +11,13 @@ #include "OPT.h" -static int16 OPB_exp; -static int64 OPB_maxExp; +static INT16 OPB_exp; +static INT64 OPB_maxExp; export void OPB_Assign (OPT_Node *x, OPT_Node y); -static void OPB_BindNodes (int8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y); -static int16 OPB_BoolToInt (BOOLEAN b); +static void OPB_BindNodes (INT8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y); +static INT16 OPB_BoolToInt (BOOLEAN b); export void OPB_Call (OPT_Node *x, OPT_Node apar, OPT_Object fp); static void OPB_CharToString (OPT_Node n); static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode); @@ -25,10 +25,10 @@ static void OPB_CheckLeaf (OPT_Node x, BOOLEAN dynArrToo); export void OPB_CheckParameters (OPT_Object fp, OPT_Object ap, BOOLEAN checkNames); static void OPB_CheckProc (OPT_Struct x, OPT_Object y); static void OPB_CheckPtr (OPT_Node x, OPT_Node y); -static void OPB_CheckRealType (int16 f, int16 nr, OPT_Const x); +static void OPB_CheckRealType (INT16 f, INT16 nr, OPT_Const x); static void OPB_CheckReceiver (OPT_Node *x, OPT_Object fp); -static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y); -export void OPB_Construct (int8 class, OPT_Node *x, OPT_Node y); +static void OPB_ConstOp (INT16 op, OPT_Node x, OPT_Node y); +export void OPB_Construct (INT8 class, OPT_Node *x, OPT_Node y); static void OPB_Convert (OPT_Node *x, OPT_Struct typ); export void OPB_DeRef (OPT_Node *x); static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpar); @@ -38,17 +38,17 @@ export void OPB_Field (OPT_Node *x, OPT_Object y); export void OPB_In (OPT_Node *x, OPT_Node y); export void OPB_Index (OPT_Node *x, OPT_Node y); export void OPB_Inittd (OPT_Node *inittd, OPT_Node *last, OPT_Struct typ); -static BOOLEAN OPB_IntToBool (int64 i); +static BOOLEAN OPB_IntToBool (INT64 i); export void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y); -export void OPB_MOp (int8 op, OPT_Node *x); +export void OPB_MOp (INT8 op, OPT_Node *x); export OPT_Node OPB_NewBoolConst (BOOLEAN boolval); -export OPT_Node OPB_NewIntConst (int64 intval); +export OPT_Node OPB_NewIntConst (INT64 intval); export OPT_Node OPB_NewLeaf (OPT_Object obj); export OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ); -export OPT_Node OPB_NewString (OPS_String str, int64 len); +export OPT_Node OPB_NewString (OPS_String str, INT64 len); export OPT_Node OPB_Nil (void); static BOOLEAN OPB_NotVar (OPT_Node x); -export void OPB_Op (int8 op, OPT_Node *x, OPT_Node y); +export void OPB_Op (INT8 op, OPT_Node *x, OPT_Node y); export void OPB_OptIf (OPT_Node *x); export void OPB_Param (OPT_Node ap, OPT_Object fp); export void OPB_PrepCall (OPT_Node *x, OPT_Object *fpar); @@ -57,17 +57,17 @@ export void OPB_SetElem (OPT_Node *x); static void OPB_SetIntType (OPT_Node node); export void OPB_SetRange (OPT_Node *x, OPT_Node y); static void OPB_SetSetType (OPT_Node node); -export void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno); -export void OPB_StPar0 (OPT_Node *par0, int16 fctno); -export void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno); -export void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n); -export void OPB_StaticLink (int8 dlev); +export void OPB_StFct (OPT_Node *par0, INT8 fctno, INT16 parno); +export void OPB_StPar0 (OPT_Node *par0, INT16 fctno); +export void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno); +export void OPB_StParN (OPT_Node *par0, OPT_Node x, INT16 fctno, INT16 n); +export void OPB_StaticLink (INT8 dlev); export void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard); -static void OPB_err (int16 n); -static int64 OPB_log (int64 x); +static void OPB_err (INT16 n); +static INT64 OPB_log (INT64 x); -static void OPB_err (int16 n) +static void OPB_err (INT16 n) { OPM_err(n); } @@ -104,7 +104,7 @@ OPT_Node OPB_NewLeaf (OPT_Object obj) return node; } -void OPB_Construct (int8 class, OPT_Node *x, OPT_Node y) +void OPB_Construct (INT8 class, OPT_Node *x, OPT_Node y) { OPT_Node node = NIL; node = OPT_NewNode(class); @@ -127,7 +127,7 @@ void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y) *last = y; } -static int16 OPB_BoolToInt (BOOLEAN b) +static INT16 OPB_BoolToInt (BOOLEAN b) { if (b) { return 1; @@ -137,7 +137,7 @@ static int16 OPB_BoolToInt (BOOLEAN b) __RETCHK; } -static BOOLEAN OPB_IntToBool (int64 i) +static BOOLEAN OPB_IntToBool (INT64 i) { return i != 0; } @@ -214,8 +214,8 @@ static void OPB_SetIntType (OPT_Node node) static void OPB_SetSetType (OPT_Node node) { - int32 i32; - __GET((address)&node->conval->setval + 4, i32, int32); + INT32 i32; + __GET((address)&node->conval->setval + 4, i32, INT32); if (i32 == 0) { node->typ = OPT_set32typ; } else { @@ -223,7 +223,7 @@ static void OPB_SetSetType (OPT_Node node) } } -OPT_Node OPB_NewIntConst (int64 intval) +OPT_Node OPB_NewIntConst (INT64 intval) { OPT_Node x = NIL; x = OPT_NewNode(7); @@ -244,7 +244,7 @@ OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ) return x; } -OPT_Node OPB_NewString (OPS_String str, int64 len) +OPT_Node OPB_NewString (OPS_String str, INT64 len) { OPT_Node x = NIL; x = OPT_NewNode(7); @@ -274,7 +274,7 @@ static void OPB_CharToString (OPT_Node n) n->obj = NIL; } -static void OPB_BindNodes (int8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y) +static void OPB_BindNodes (INT8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y) { OPT_Node node = NIL; node = OPT_NewNode(class); @@ -314,7 +314,7 @@ void OPB_DeRef (OPT_Node *x) void OPB_Index (OPT_Node *x, OPT_Node y) { - int16 f; + INT16 f; OPT_Struct typ = NIL; f = y->typ->form; if ((*x)->class >= 7) { @@ -325,7 +325,7 @@ void OPB_Index (OPT_Node *x, OPT_Node y) } if ((*x)->typ->comp == 2) { typ = (*x)->typ->BaseTyp; - if ((y->class == 7 && (y->conval->intval < 0 || y->conval->intval >= (int64)(*x)->typ->n))) { + if ((y->class == 7 && (y->conval->intval < 0 || y->conval->intval >= (INT64)(*x)->typ->n))) { OPB_err(81); } } else if ((*x)->typ->comp == 3) { @@ -439,15 +439,15 @@ void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) void OPB_In (OPT_Node *x, OPT_Node y) { - int16 f; - int64 k; + INT16 f; + INT64 k; f = (*x)->typ->form; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); } else if ((f == 4 && y->typ->form == 7)) { if ((*x)->class == 7) { k = (*x)->conval->intval; - if (k < 0 || k >= (int64)__ASHL(y->typ->size, 3)) { + if (k < 0 || k >= (INT64)__ASHL(y->typ->size, 3)) { OPB_err(202); } else if (y->class == 7) { (*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval, 64)); @@ -466,7 +466,7 @@ void OPB_In (OPT_Node *x, OPT_Node y) (*x)->typ = OPT_booltyp; } -static int64 OPB_log (int64 x) +static INT64 OPB_log (INT64 x) { OPB_exp = 0; if (x > 0) { @@ -478,7 +478,7 @@ static int64 OPB_log (int64 x) return x; } -static void OPB_CheckRealType (int16 f, int16 nr, OPT_Const x) +static void OPB_CheckRealType (INT16 f, INT16 nr, OPT_Const x) { LONGREAL min, max, r; if (f == 5) { @@ -502,9 +502,9 @@ static struct MOp__28 { struct MOp__28 *lnk; } *MOp__28_s; -static OPT_Node NewOp__29 (int8 op, OPT_Struct typ, OPT_Node z); +static OPT_Node NewOp__29 (INT8 op, OPT_Struct typ, OPT_Node z); -static OPT_Node NewOp__29 (int8 op, OPT_Struct typ, OPT_Node z) +static OPT_Node NewOp__29 (INT8 op, OPT_Struct typ, OPT_Node z) { OPT_Node node = NIL; node = OPT_NewNode(11); @@ -514,9 +514,9 @@ static OPT_Node NewOp__29 (int8 op, OPT_Struct typ, OPT_Node z) return node; } -void OPB_MOp (int8 op, OPT_Node *x) +void OPB_MOp (INT8 op, OPT_Node *x) { - int16 f; + INT16 f; OPT_Struct typ = NIL; OPT_Node z = NIL; struct MOp__28 _s; @@ -597,7 +597,7 @@ void OPB_MOp (int8 op, OPT_Node *x) case 22: if (f == 3) { if (z->class == 7) { - z->conval->intval = (int16)__CAP((CHAR)z->conval->intval); + z->conval->intval = (INT16)__CAP((CHAR)z->conval->intval); z->obj = NIL; } else { z = NewOp__29(op, typ, z); @@ -657,7 +657,7 @@ void OPB_MOp (int8 op, OPT_Node *x) static void OPB_CheckPtr (OPT_Node x, OPT_Node y) { - int16 g; + INT16 g; OPT_Struct p = NIL, q = NIL, t = NIL; g = y->typ->form; if (g == 11) { @@ -741,16 +741,16 @@ static void OPB_CheckProc (OPT_Struct x, OPT_Object y) static struct ConstOp__13 { OPT_Node *x; - int16 *f; + INT16 *f; OPT_Const *xval, *yval; struct ConstOp__13 *lnk; } *ConstOp__13_s; -static int16 ConstCmp__14 (void); +static INT16 ConstCmp__14 (void); -static int16 ConstCmp__14 (void) +static INT16 ConstCmp__14 (void) { - int16 res; + INT16 res; switch (*ConstOp__13_s->f) { case 0: res = 9; @@ -813,11 +813,11 @@ static int16 ConstCmp__14 (void) return res; } -static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) +static void OPB_ConstOp (INT16 op, OPT_Node x, OPT_Node y) { - int16 f, g; + INT16 f, g; OPT_Const xval = NIL, yval = NIL; - int64 xv, yv; + INT64 xv, yv; BOOLEAN temp; struct ConstOp__13 _s; _s.x = &x; @@ -1097,8 +1097,8 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) static void OPB_Convert (OPT_Node *x, OPT_Struct typ) { OPT_Node node = NIL; - int16 f, g; - int64 k; + INT16 f, g; + INT64 k; LONGREAL r; f = (*x)->typ->form; g = typ->form; @@ -1136,12 +1136,12 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) OPB_err(203); r = (LONGREAL)1; } - (*x)->conval->intval = (int32)__ENTIER(r); + (*x)->conval->intval = (INT32)__ENTIER(r); OPB_SetIntType(*x); } } (*x)->obj = NIL; - } else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((int16)(*x)->left->typ->form < f || f > g))) { + } else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((INT16)(*x)->left->typ->form < f || f > g))) { if ((*x)->left->typ == typ) { *x = (*x)->left; } @@ -1155,14 +1155,14 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) } static struct Op__38 { - int16 *f, *g; + INT16 *f, *g; struct Op__38 *lnk; } *Op__38_s; -static void NewOp__39 (int8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y); +static void NewOp__39 (INT8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y); static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y); -static void NewOp__39 (int8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y) +static void NewOp__39 (INT8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y) { OPT_Node node = NIL; node = OPT_NewNode(12); @@ -1203,13 +1203,13 @@ static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) return ok; } -void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) +void OPB_Op (INT8 op, OPT_Node *x, OPT_Node y) { - int16 f, g; + INT16 f, g; OPT_Node t = NIL, z = NIL; OPT_Struct typ = NIL; BOOLEAN do_; - int64 val; + INT64 val; struct Op__38 _s; _s.f = &f; _s.g = &g; @@ -1489,7 +1489,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) void OPB_SetRange (OPT_Node *x, OPT_Node y) { - int64 k, l; + INT64 k, l; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); } else if (((*x)->typ->form == 4 && y->typ->form == 4)) { @@ -1525,7 +1525,7 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y) void OPB_SetElem (OPT_Node *x) { - int64 k; + INT64 k; if ((*x)->class == 8 || (*x)->class == 9) { OPB_err(126); } else if ((*x)->typ->form != 4) { @@ -1549,7 +1549,7 @@ void OPB_SetElem (OPT_Node *x) static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) { OPT_Struct y = NIL; - int16 f, g; + INT16 f, g; OPT_Struct p = NIL, q = NIL; y = ynode->typ; f = x->form; @@ -1673,9 +1673,9 @@ static void OPB_CheckLeaf (OPT_Node x, BOOLEAN dynArrToo) { } -void OPB_StPar0 (OPT_Node *par0, int16 fctno) +void OPB_StPar0 (OPT_Node *par0, INT16 fctno) { - int16 f; + INT16 f; OPT_Struct typ = NIL; OPT_Node x = NIL; x = *par0; @@ -1983,9 +1983,9 @@ static struct StPar1__53 { struct StPar1__53 *lnk; } *StPar1__53_s; -static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right); +static OPT_Node NewOp__54 (INT8 class, INT8 subcl, OPT_Node left, OPT_Node right); -static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right) +static OPT_Node NewOp__54 (INT8 class, INT8 subcl, OPT_Node left, OPT_Node right) { OPT_Node node = NIL; node = OPT_NewNode(class); @@ -1995,9 +1995,9 @@ static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right return node; } -void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) +void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno) { - int16 f, L; + INT16 f, L; OPT_Struct typ = NIL; OPT_Node p = NIL, t = NIL; struct StPar1__53 _s; @@ -2026,7 +2026,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (f == 4) { - if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval >= (int64)__ASHL(p->typ->size, 3)))) { + if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval >= (INT64)__ASHL(p->typ->size, 3)))) { OPB_err(202); } p = NewOp__54(19, fctno, p, x); @@ -2091,8 +2091,8 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) OPB_err(208); p->conval->intval = 1; } else if (x->conval->intval >= 0) { - if (__ABS(p->conval->intval) <= __DIV(9223372036854775807, (int64)__ASH(1, x->conval->intval))) { - p->conval->intval = p->conval->intval * (int64)__ASH(1, x->conval->intval); + if (__ABS(p->conval->intval) <= __DIV(9223372036854775807, (INT64)__ASH(1, x->conval->intval))) { + p->conval->intval = p->conval->intval * (INT64)__ASH(1, x->conval->intval); } else { OPB_err(208); p->conval->intval = 1; @@ -2239,10 +2239,10 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) StPar1__53_s = _s.lnk; } -void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n) +void OPB_StParN (OPT_Node *par0, OPT_Node x, INT16 fctno, INT16 n) { OPT_Node node = NIL; - int16 f; + INT16 f; OPT_Node p = NIL; p = *par0; f = x->typ->form; @@ -2284,9 +2284,9 @@ void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n) *par0 = p; } -void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno) +void OPB_StFct (OPT_Node *par0, INT8 fctno, INT16 parno) { - int16 dim; + INT16 dim; OPT_Node x = NIL, p = NIL; p = *par0; if (fctno <= 19) { @@ -2350,7 +2350,7 @@ void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno) static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpar) { - int16 f; + INT16 f; f = atyp->comp; ftyp = ftyp->BaseTyp; atyp = atyp->BaseTyp; @@ -2459,7 +2459,7 @@ void OPB_Param (OPT_Node ap, OPT_Object fp) } } -void OPB_StaticLink (int8 dlev) +void OPB_StaticLink (INT8 dlev) { OPT_Object scope = NIL; scope = OPT_topScope; @@ -2474,7 +2474,7 @@ void OPB_Call (OPT_Node *x, OPT_Node apar, OPT_Object fp) { OPT_Struct typ = NIL; OPT_Node p = NIL; - int8 lev; + INT8 lev; if ((*x)->class == 9) { typ = (*x)->typ; lev = (*x)->obj->mnolev; @@ -2534,7 +2534,7 @@ void OPB_Return (OPT_Node *x, OPT_Object proc) void OPB_Assign (OPT_Node *x, OPT_Node y) { OPT_Node z = NIL; - int8 subcl; + INT8 subcl; if ((*x)->class >= 7) { OPB_err(56); } diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index 22742961..bc644f4c 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h @@ -13,7 +13,7 @@ import void OPB_Assign (OPT_Node *x, OPT_Node y); import void OPB_Call (OPT_Node *x, OPT_Node apar, OPT_Object fp); import void OPB_CheckParameters (OPT_Object fp, OPT_Object ap, BOOLEAN checkNames); -import void OPB_Construct (int8 class, OPT_Node *x, OPT_Node y); +import void OPB_Construct (INT8 class, OPT_Node *x, OPT_Node y); import void OPB_DeRef (OPT_Node *x); import OPT_Node OPB_EmptySet (void); import void OPB_Enter (OPT_Node *procdec, OPT_Node stat, OPT_Object proc); @@ -22,25 +22,25 @@ import void OPB_In (OPT_Node *x, OPT_Node y); import void OPB_Index (OPT_Node *x, OPT_Node y); import void OPB_Inittd (OPT_Node *inittd, OPT_Node *last, OPT_Struct typ); import void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y); -import void OPB_MOp (int8 op, OPT_Node *x); +import void OPB_MOp (INT8 op, OPT_Node *x); import OPT_Node OPB_NewBoolConst (BOOLEAN boolval); -import OPT_Node OPB_NewIntConst (int64 intval); +import OPT_Node OPB_NewIntConst (INT64 intval); import OPT_Node OPB_NewLeaf (OPT_Object obj); import OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ); -import OPT_Node OPB_NewString (OPS_String str, int64 len); +import OPT_Node OPB_NewString (OPS_String str, INT64 len); import OPT_Node OPB_Nil (void); -import void OPB_Op (int8 op, OPT_Node *x, OPT_Node y); +import void OPB_Op (INT8 op, OPT_Node *x, OPT_Node y); import void OPB_OptIf (OPT_Node *x); import void OPB_Param (OPT_Node ap, OPT_Object fp); import void OPB_PrepCall (OPT_Node *x, OPT_Object *fpar); import void OPB_Return (OPT_Node *x, OPT_Object proc); import void OPB_SetElem (OPT_Node *x); import void OPB_SetRange (OPT_Node *x, OPT_Node y); -import void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno); -import void OPB_StPar0 (OPT_Node *par0, int16 fctno); -import void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno); -import void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n); -import void OPB_StaticLink (int8 dlev); +import void OPB_StFct (OPT_Node *par0, INT8 fctno, INT16 parno); +import void OPB_StPar0 (OPT_Node *par0, INT16 fctno); +import void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno); +import void OPB_StParN (OPT_Node *par0, OPT_Node x, INT16 fctno, INT16 n); +import void OPB_StaticLink (INT8 dlev); import void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard); import void *OPB__init(void); diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 27ab3d15..0ed7bf75 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "Configuration.h" @@ -11,9 +11,9 @@ #include "OPT.h" -static int16 OPC_indentLevel; -static int8 OPC_hashtab[105]; -static CHAR OPC_keytab[50][9]; +static INT16 OPC_indentLevel; +static INT8 OPC_hashtab[105]; +static CHAR OPC_keytab[60][9]; static BOOLEAN OPC_GlbPtrs; static CHAR OPC_BodyNameExt[13]; @@ -23,12 +23,12 @@ static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames); export OPT_Object OPC_BaseTProc (OPT_Object obj); export void OPC_BegBlk (void); export void OPC_BegStat (void); -static void OPC_CProcDefs (OPT_Object obj, int16 vis); -export void OPC_Case (int64 caseVal, int16 form); -static void OPC_CharacterLiteral (int64 c); -export void OPC_Cmp (int16 rel); +static void OPC_CProcDefs (OPT_Object obj, INT16 vis); +export void OPC_Case (INT64 caseVal, INT16 form); +static void OPC_CharacterLiteral (INT64 c); +export void OPC_Cmp (INT16 rel); export void OPC_CompleteIdent (OPT_Object obj); -export void OPC_Constant (OPT_Const con, int16 form); +export void OPC_Constant (OPT_Const con, INT16 form); static void OPC_DeclareBase (OPT_Object dcl); static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef); static void OPC_DeclareParams (OPT_Object par, BOOLEAN macro); @@ -45,45 +45,45 @@ export void OPC_EnterBody (void); export void OPC_EnterProc (OPT_Object proc); export void OPC_ExitBody (void); export void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet); -static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, int32 *off, int32 *n, int32 *curAlign); -static void OPC_FillGap (int32 gap, int32 off, int32 align, int32 *n, int32 *curAlign); +static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, INT32 *off, INT32 *n, INT32 *curAlign); +static void OPC_FillGap (INT32 gap, INT32 off, INT32 align, INT32 *n, INT32 *curAlign); export void OPC_GenBdy (OPT_Node n); -static void OPC_GenDynTypes (OPT_Node n, int16 vis); +static void OPC_GenDynTypes (OPT_Node n, INT16 vis); export void OPC_GenEnumPtrs (OPT_Object var); export void OPC_GenHdr (OPT_Node n); export void OPC_GenHdrIncludes (void); static void OPC_GenHeaderMsg (void); -export void OPC_Halt (int32 n); +export void OPC_Halt (INT32 n); export void OPC_Ident (OPT_Object obj); -static void OPC_IdentList (OPT_Object obj, int16 vis); +static void OPC_IdentList (OPT_Object obj, INT16 vis); static void OPC_Include (CHAR *name, LONGINT name__len); -static void OPC_IncludeImports (OPT_Object obj, int16 vis); +static void OPC_IncludeImports (OPT_Object obj, INT16 vis); export void OPC_Increment (BOOLEAN decrement); -export void OPC_Indent (int16 count); +export void OPC_Indent (INT16 count); export void OPC_Init (void); static void OPC_InitImports (OPT_Object obj); static void OPC_InitKeywords (void); export void OPC_InitTDesc (OPT_Struct typ); static void OPC_InitTProcs (OPT_Object typ, OPT_Object obj); -export void OPC_IntLiteral (int64 n, int32 size); -export void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim); +export void OPC_IntLiteral (INT64 n, INT32 size); +export void OPC_Len (OPT_Object obj, OPT_Struct array, INT64 dim); static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName); -static int16 OPC_Length (CHAR *s, LONGINT s__len); +static INT16 OPC_Length (CHAR *s, LONGINT s__len); export BOOLEAN OPC_NeedsRetval (OPT_Object proc); -export int32 OPC_NofPtrs (OPT_Struct typ); -static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len); +export INT32 OPC_NofPtrs (OPT_Struct typ); +static INT16 OPC_PerfectHash (CHAR *s, LONGINT s__len); static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len); static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define); -static void OPC_ProcPredefs (OPT_Object obj, int8 vis); +static void OPC_ProcPredefs (OPT_Object obj, INT8 vis); static void OPC_PutBase (OPT_Struct typ); -static void OPC_PutPtrOffsets (OPT_Struct typ, int32 adr, int32 *cnt); +static void OPC_PutPtrOffsets (OPT_Struct typ, INT32 adr, INT32 *cnt); static void OPC_RegCmds (OPT_Object obj); export void OPC_SetInclude (BOOLEAN exclude); static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause); -static void OPC_Str1 (CHAR *s, LONGINT s__len, int32 x); -static void OPC_StringLiteral (CHAR *s, LONGINT s__len, int32 l); +static void OPC_Str1 (CHAR *s, LONGINT s__len, INT32 x); +static void OPC_StringLiteral (CHAR *s, LONGINT s__len, INT32 l); export void OPC_TDescDecl (OPT_Struct typ); -export void OPC_TypeDefs (OPT_Object obj, int16 vis); +export void OPC_TypeDefs (OPT_Object obj, INT16 vis); export void OPC_TypeOf (OPT_Object ap); static BOOLEAN OPC_Undefined (OPT_Object obj); @@ -94,14 +94,14 @@ void OPC_Init (void) __MOVE("__init(void)", OPC_BodyNameExt, 13); } -void OPC_Indent (int16 count) +void OPC_Indent (INT16 count) { OPC_indentLevel += count; } void OPC_BegStat (void) { - int16 i; + INT16 i; i = OPC_indentLevel; while (i > 0) { OPM_Write(0x09); @@ -137,10 +137,10 @@ void OPC_EndBlk0 (void) OPM_Write('}'); } -static void OPC_Str1 (CHAR *s, LONGINT s__len, int32 x) +static void OPC_Str1 (CHAR *s, LONGINT s__len, INT32 x) { CHAR ch; - int16 i; + INT16 i; __DUP(s, s__len, CHAR); ch = s[0]; i = 0; @@ -156,9 +156,9 @@ static void OPC_Str1 (CHAR *s, LONGINT s__len, int32 x) __DEL(s); } -static int16 OPC_Length (CHAR *s, LONGINT s__len) +static INT16 OPC_Length (CHAR *s, LONGINT s__len) { - int16 i; + INT16 i; i = 0; while (s[__X(i, s__len)] != 0x00) { i += 1; @@ -166,13 +166,13 @@ static int16 OPC_Length (CHAR *s, LONGINT s__len) return i; } -static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len) +static INT16 OPC_PerfectHash (CHAR *s, LONGINT s__len) { - int16 i, h; + INT16 i, h; i = 0; h = 0; while ((s[__X(i, s__len)] != 0x00 && i < 5)) { - h = 3 * h + (int16)s[__X(i, s__len)]; + h = 3 * h + (INT16)s[__X(i, s__len)]; i += 1; } return (int)__MOD(h, 105); @@ -180,25 +180,25 @@ static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len) void OPC_Ident (OPT_Object obj) { - int16 mode, level, h; + INT16 mode, level, h; mode = obj->mode; level = obj->mnolev; if ((__IN(mode, 0x62, 32) && level > 0) || __IN(mode, 0x14, 32)) { OPM_WriteStringVar((void*)obj->name, 256); h = OPC_PerfectHash((void*)obj->name, 256); if (OPC_hashtab[__X(h, 105)] >= 0) { - if (__STRCMP(OPC_keytab[__X(OPC_hashtab[__X(h, 105)], 50)], obj->name) == 0) { + if (__STRCMP(OPC_keytab[__X(OPC_hashtab[__X(h, 105)], 60)], obj->name) == 0) { OPM_Write('_'); } } } else if ((mode == 5 && __IN(obj->typ->form, 0x90, 32))) { if (obj->typ == OPT_adrtyp) { - OPM_WriteString((CHAR*)"address", 8); + OPM_WriteString((CHAR*)"ADDRESS", 8); } else { if (obj->typ->form == 4) { - OPM_WriteString((CHAR*)"int", 4); + OPM_WriteString((CHAR*)"INT", 4); } else { - OPM_WriteString((CHAR*)"uint", 5); + OPM_WriteString((CHAR*)"UINT", 5); } OPM_WriteInt(__ASHL(obj->typ->size, 3)); } @@ -224,7 +224,7 @@ void OPC_Ident (OPT_Object obj) static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause) { - int16 pointers; + INT16 pointers; *openClause = 0; if (((typ->strobj == NIL || typ->strobj->name[0] == 0x00) && typ->comp != 4)) { if (__IN(typ->comp, 0x0c, 32)) { @@ -260,7 +260,7 @@ static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef) { OPT_Struct typ = NIL; BOOLEAN varPar, openClause; - int16 form, comp; + INT16 form, comp; typ = dcl->typ; varPar = ((dcl->mode == 2 && typ->comp != 2) || typ->comp == 3) || scopeDef; OPC_Stars(typ, &openClause); @@ -324,8 +324,8 @@ static void OPC_DeclareBase (OPT_Object dcl) { OPT_Struct typ = NIL, prev = NIL; OPT_Object obj = NIL; - int16 nofdims; - int32 off, n, dummy; + INT16 nofdims; + INT32 off, n, dummy; typ = dcl->typ; prev = typ; while ((((((((typ->strobj == NIL || typ->comp == 3) || OPC_Undefined(typ->strobj)) && typ->comp != 4)) && typ->form != 10)) && !((typ->form == 11 && typ->BaseTyp->comp == 3)))) { @@ -384,11 +384,11 @@ static void OPC_DeclareBase (OPT_Object dcl) } } -int32 OPC_NofPtrs (OPT_Struct typ) +INT32 OPC_NofPtrs (OPT_Struct typ) { OPT_Object fld = NIL; OPT_Struct btyp = NIL; - int32 n; + INT32 n; if ((typ->form == 11 && typ->sysflag == 0)) { return 1; } else if ((typ->comp == 4 && __MASK(typ->sysflag, -256) == 0)) { @@ -422,11 +422,11 @@ int32 OPC_NofPtrs (OPT_Struct typ) __RETCHK; } -static void OPC_PutPtrOffsets (OPT_Struct typ, int32 adr, int32 *cnt) +static void OPC_PutPtrOffsets (OPT_Struct typ, INT32 adr, INT32 *cnt) { OPT_Object fld = NIL; OPT_Struct btyp = NIL; - int32 n, i; + INT32 n, i; if ((typ->form == 11 && typ->sysflag == 0)) { OPM_WriteInt(adr); OPM_WriteString((CHAR*)", ", 3); @@ -502,7 +502,7 @@ static void OPC_PutBase (OPT_Struct typ) static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName) { OPT_Struct typ = NIL; - int16 dim; + INT16 dim; if (showParamName) { OPC_Ident(par); OPM_WriteString((CHAR*)"__len", 6); @@ -599,7 +599,7 @@ static void OPC_DeclareTProcs (OPT_Object obj, BOOLEAN *empty) OPT_Object OPC_BaseTProc (OPT_Object obj) { OPT_Struct typ = NIL, base = NIL; - int32 mno; + INT32 mno; typ = obj->link->typ; if (typ->form == 11) { typ = typ->BaseTyp; @@ -722,7 +722,7 @@ static void OPC_DefineType (OPT_Struct str) static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len) { - int16 i; + INT16 i; __DUP(y, y__len, CHAR); i = 0; while ((*x)[__X(i + 1, 256)] == y[__X(i, y__len)]) { @@ -732,14 +732,14 @@ static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len) return y[__X(i, y__len)] == 0x00; } -static void OPC_CProcDefs (OPT_Object obj, int16 vis) +static void OPC_CProcDefs (OPT_Object obj, INT16 vis) { - int16 i; + INT16 i; OPT_ConstExt ext = NIL; - int16 _for__7; + INT16 _for__7; if (obj != NIL) { OPC_CProcDefs(obj->left, vis); - if ((((obj->mode == 9 && (int16)obj->vis >= vis)) && obj->adr == 1)) { + if ((((obj->mode == 9 && (INT16)obj->vis >= vis)) && obj->adr == 1)) { ext = obj->conval->ext; i = 1; if (((*ext)[1] != '#' && !(OPC_Prefixed(ext, (CHAR*)"extern ", 8) || OPC_Prefixed(ext, (CHAR*)"import ", 8)))) { @@ -748,7 +748,7 @@ static void OPC_CProcDefs (OPT_Object obj, int16 vis) OPC_DeclareParams(obj->link, 1); OPM_Write(0x09); } - _for__7 = (int16)(*obj->conval->ext)[0]; + _for__7 = (INT16)(*obj->conval->ext)[0]; i = i; while (i <= _for__7) { OPM_Write((*obj->conval->ext)[__X(i, 256)]); @@ -760,7 +760,7 @@ static void OPC_CProcDefs (OPT_Object obj, int16 vis) } } -void OPC_TypeDefs (OPT_Object obj, int16 vis) +void OPC_TypeDefs (OPT_Object obj, INT16 vis) { if (obj != NIL) { OPC_TypeDefs(obj->left, vis); @@ -792,7 +792,7 @@ static void OPC_DefAnonRecs (OPT_Node n) void OPC_TDescDecl (OPT_Struct typ) { - int32 nofptrs; + INT32 nofptrs; OPT_Object o = NIL; OPC_BegStat(); OPM_WriteString((CHAR*)"__TDESC(", 9); @@ -829,9 +829,9 @@ void OPC_InitTDesc (OPT_Struct typ) } } -static void OPC_FillGap (int32 gap, int32 off, int32 align, int32 *n, int32 *curAlign) +static void OPC_FillGap (INT32 gap, INT32 off, INT32 align, INT32 *n, INT32 *curAlign) { - int32 adr; + INT32 adr; adr = off; OPT_Align(&adr, align); if ((*curAlign < align && gap - (adr - off) >= align)) { @@ -839,13 +839,13 @@ static void OPC_FillGap (int32 gap, int32 off, int32 align, int32 *n, int32 *cur OPC_BegStat(); switch (align) { case 2: - OPM_WriteString((CHAR*)"int16", 6); + OPM_WriteString((CHAR*)"INT16", 6); break; case 4: - OPM_WriteString((CHAR*)"int32", 6); + OPM_WriteString((CHAR*)"INT32", 6); break; case 8: - OPM_WriteString((CHAR*)"int64", 6); + OPM_WriteString((CHAR*)"INT64", 6); break; default: OPM_LogWLn(); @@ -866,11 +866,11 @@ static void OPC_FillGap (int32 gap, int32 off, int32 align, int32 *n, int32 *cur } } -static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, int32 *off, int32 *n, int32 *curAlign) +static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, INT32 *off, INT32 *n, INT32 *curAlign) { OPT_Object fld = NIL; OPT_Struct base = NIL; - int32 gap, adr, align, fldAlign; + INT32 gap, adr, align, fldAlign; fld = typ->link; align = __MASK(typ->align, -65536); if (typ->BaseTyp != NIL) { @@ -926,16 +926,16 @@ static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, int32 *off, int32 *n, i } } -static void OPC_IdentList (OPT_Object obj, int16 vis) +static void OPC_IdentList (OPT_Object obj, INT16 vis) { OPT_Struct base = NIL; BOOLEAN first; - int16 lastvis; + INT16 lastvis; base = NIL; first = 1; while ((obj != NIL && obj->mode != 13)) { if ((__IN(vis, 0x05, 32) || (vis == 1 && obj->vis != 0)) || (vis == 3 && !obj->leaf)) { - if (obj->typ != base || (int16)obj->vis != lastvis) { + if (obj->typ != base || (INT16)obj->vis != lastvis) { if (!first) { OPC_EndStat(); } @@ -974,7 +974,7 @@ static void OPC_IdentList (OPT_Object obj, int16 vis) } else if ((obj->mode == 2 && obj->typ->comp == 4)) { OPC_EndStat(); OPC_BegStat(); - OPM_WriteString((CHAR*)"address *", 10); + OPM_WriteString((CHAR*)"ADDRESS *", 10); OPC_Ident(obj); OPM_WriteString((CHAR*)"__typ", 6); base = NIL; @@ -1011,7 +1011,7 @@ static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames) OPM_WriteString((CHAR*)", LONGINT ", 11); OPC_LenList(obj, 1, showParamNames); } else if ((obj->mode == 2 && obj->typ->comp == 4)) { - OPM_WriteString((CHAR*)", address *", 12); + OPM_WriteString((CHAR*)", ADDRESS *", 12); if (showParamNames) { OPC_Ident(obj); OPM_WriteString((CHAR*)"__typ", 6); @@ -1044,7 +1044,7 @@ static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define) OPM_WriteLn(); } -static void OPC_ProcPredefs (OPT_Object obj, int8 vis) +static void OPC_ProcPredefs (OPT_Object obj, INT8 vis) { if (obj != NIL) { OPC_ProcPredefs(obj->left, vis); @@ -1074,18 +1074,18 @@ static void OPC_Include (CHAR *name, LONGINT name__len) __DEL(name); } -static void OPC_IncludeImports (OPT_Object obj, int16 vis) +static void OPC_IncludeImports (OPT_Object obj, INT16 vis) { if (obj != NIL) { OPC_IncludeImports(obj->left, vis); - if ((((obj->mode == 11 && obj->mnolev != 0)) && (int16)OPT_GlbMod[__X(-obj->mnolev, 64)]->vis >= vis)) { + if ((((obj->mode == 11 && obj->mnolev != 0)) && (INT16)OPT_GlbMod[__X(-obj->mnolev, 64)]->vis >= vis)) { OPC_Include(OPT_GlbMod[__X(-obj->mnolev, 64)]->name, 256); } OPC_IncludeImports(obj->right, vis); } } -static void OPC_GenDynTypes (OPT_Node n, int16 vis) +static void OPC_GenDynTypes (OPT_Node n, INT16 vis) { OPT_Struct typ = NIL; while ((n != NIL && n->class == 14)) { @@ -1099,7 +1099,7 @@ static void OPC_GenDynTypes (OPT_Node n, int16 vis) } else { OPM_WriteString((CHAR*)"export ", 8); } - OPM_WriteString((CHAR*)"address *", 10); + OPM_WriteString((CHAR*)"ADDRESS *", 10); OPC_Andent(typ); OPM_WriteString((CHAR*)"__typ", 6); OPC_EndStat(); @@ -1134,7 +1134,7 @@ void OPC_GenHdr (OPT_Node n) static void OPC_GenHeaderMsg (void) { - int16 i; + INT16 i; OPM_WriteString((CHAR*)"/* ", 4); OPM_WriteString((CHAR*)"voc", 4); OPM_Write(' '); @@ -1222,16 +1222,16 @@ void OPC_GenBdy (OPT_Node n) OPM_currFile = 1; OPC_GenHeaderMsg(); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#define SHORTINT int", 21); + OPM_WriteString((CHAR*)"#define SHORTINT INT", 21); OPM_WriteInt(__ASHL(OPT_sinttyp->size, 3)); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#define INTEGER int", 21); + OPM_WriteString((CHAR*)"#define INTEGER INT", 21); OPM_WriteInt(__ASHL(OPT_inttyp->size, 3)); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#define LONGINT int", 21); + OPM_WriteString((CHAR*)"#define LONGINT INT", 21); OPM_WriteInt(__ASHL(OPT_linttyp->size, 3)); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#define SET uint", 22); + OPM_WriteString((CHAR*)"#define SET UINT", 22); OPM_WriteInt(__ASHL(OPT_settyp->size, 3)); OPM_WriteLn(); OPM_WriteLn(); @@ -1288,7 +1288,7 @@ static void OPC_InitImports (OPT_Object obj) void OPC_GenEnumPtrs (OPT_Object var) { OPT_Struct typ = NIL; - int32 n; + INT32 n; OPC_GlbPtrs = 0; while (var != NIL) { typ = var->typ; @@ -1438,7 +1438,7 @@ void OPC_EnterProc (OPT_Object proc) { OPT_Object var = NIL, scope = NIL; OPT_Struct typ = NIL; - int16 dim; + INT16 dim; if (proc->vis != 1) { OPM_WriteString((CHAR*)"static ", 8); } @@ -1652,7 +1652,7 @@ void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet) void OPC_CompleteIdent (OPT_Object obj) { - int16 comp, level; + INT16 comp, level; level = obj->mnolev; if (obj->adr == 1) { if (obj->typ->comp == 4) { @@ -1681,10 +1681,10 @@ void OPC_CompleteIdent (OPT_Object obj) void OPC_TypeOf (OPT_Object ap) { - int16 i; + INT16 i; __ASSERT(ap->typ->comp == 4, 0); if (ap->mode == 2) { - if ((int16)ap->mnolev != OPM_level) { + if ((INT16)ap->mnolev != OPM_level) { OPM_WriteStringVar((void*)ap->scope->name, 256); OPM_WriteString((CHAR*)"_s->", 5); OPC_Ident(ap); @@ -1700,7 +1700,7 @@ void OPC_TypeOf (OPT_Object ap) } } -void OPC_Cmp (int16 rel) +void OPC_Cmp (INT16 rel) { switch (rel) { case 9: @@ -1729,7 +1729,7 @@ void OPC_Cmp (int16 rel) } } -static void OPC_CharacterLiteral (int64 c) +static void OPC_CharacterLiteral (INT64 c) { if (c < 32 || c > 126) { OPM_WriteString((CHAR*)"0x", 3); @@ -1744,15 +1744,15 @@ static void OPC_CharacterLiteral (int64 c) } } -static void OPC_StringLiteral (CHAR *s, LONGINT s__len, int32 l) +static void OPC_StringLiteral (CHAR *s, LONGINT s__len, INT32 l) { - int32 i; - int16 c; + INT32 i; + INT16 c; __DUP(s, s__len, CHAR); OPM_Write('"'); i = 0; while (i < l) { - c = (int16)s[__X(i, s__len)]; + c = (INT16)s[__X(i, s__len)]; if (c < 32 || c > 126) { OPM_Write('\\'); OPM_Write((CHAR)(48 + __ASHR(c, 6))); @@ -1772,7 +1772,7 @@ static void OPC_StringLiteral (CHAR *s, LONGINT s__len, int32 l) __DEL(s); } -void OPC_Case (int64 caseVal, int16 form) +void OPC_Case (INT64 caseVal, INT16 form) { CHAR ch; OPM_WriteString((CHAR*)"case ", 6); @@ -1810,15 +1810,15 @@ void OPC_Increment (BOOLEAN decrement) } } -void OPC_Halt (int32 n) +void OPC_Halt (INT32 n) { OPC_Str1((CHAR*)"__HALT(#)", 10, n); } -void OPC_IntLiteral (int64 n, int32 size) +void OPC_IntLiteral (INT64 n, INT32 size) { if ((((size > 4 && n <= 2147483647)) && n > (-2147483647-1))) { - OPM_WriteString((CHAR*)"((int", 6); + OPM_WriteString((CHAR*)"((INT", 6); OPM_WriteInt(__ASHL(size, 3)); OPM_WriteString((CHAR*)")(", 3); OPM_WriteInt(n); @@ -1828,7 +1828,7 @@ void OPC_IntLiteral (int64 n, int32 size) } } -void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim) +void OPC_Len (OPT_Object obj, OPT_Struct array, INT64 dim) { if (array->comp == 3) { OPC_CompleteIdent(obj); @@ -1845,11 +1845,11 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim) } } -void OPC_Constant (OPT_Const con, int16 form) +void OPC_Constant (OPT_Const con, INT16 form) { - int16 i; - uint64 s; - int64 hex; + INT16 i; + UINT64 s; + INT64 hex; BOOLEAN skipLeading; switch (form) { case 1: @@ -1908,7 +1908,7 @@ void OPC_Constant (OPT_Const con, int16 form) } static struct InitKeywords__46 { - int8 *n; + INT8 *n; struct InitKeywords__46 *lnk; } *InitKeywords__46_s; @@ -1916,18 +1916,18 @@ static void Enter__47 (CHAR *s, LONGINT s__len); static void Enter__47 (CHAR *s, LONGINT s__len) { - int16 h; + INT16 h; __DUP(s, s__len, CHAR); h = OPC_PerfectHash((void*)s, s__len); OPC_hashtab[__X(h, 105)] = *InitKeywords__46_s->n; - __COPY(s, OPC_keytab[__X(*InitKeywords__46_s->n, 50)], 9); + __COPY(s, OPC_keytab[__X(*InitKeywords__46_s->n, 60)], 9); *InitKeywords__46_s->n += 1; __DEL(s); } static void OPC_InitKeywords (void) { - int8 n, i; + INT8 n, i; struct InitKeywords__46 _s; _s.n = &n; _s.lnk = InitKeywords__46_s; @@ -1938,7 +1938,24 @@ static void OPC_InitKeywords (void) OPC_hashtab[__X(i, 105)] = -1; i += 1; } + Enter__47((CHAR*)"ADDRESS", 8); + Enter__47((CHAR*)"INT16", 6); + Enter__47((CHAR*)"INT32", 6); + Enter__47((CHAR*)"INT64", 6); + Enter__47((CHAR*)"INT8", 5); + Enter__47((CHAR*)"UINT16", 7); + Enter__47((CHAR*)"UINT32", 7); + Enter__47((CHAR*)"UINT64", 7); + Enter__47((CHAR*)"UINT8", 6); Enter__47((CHAR*)"address", 8); + Enter__47((CHAR*)"int16", 6); + Enter__47((CHAR*)"int32", 6); + Enter__47((CHAR*)"int64", 6); + Enter__47((CHAR*)"int8", 5); + Enter__47((CHAR*)"uint16", 7); + Enter__47((CHAR*)"uint32", 7); + Enter__47((CHAR*)"uint64", 7); + Enter__47((CHAR*)"uint8", 6); Enter__47((CHAR*)"asm", 4); Enter__47((CHAR*)"auto", 5); Enter__47((CHAR*)"break", 6); @@ -1960,10 +1977,6 @@ static void OPC_InitKeywords (void) Enter__47((CHAR*)"if", 3); Enter__47((CHAR*)"import", 7); Enter__47((CHAR*)"int", 4); - Enter__47((CHAR*)"int16", 6); - Enter__47((CHAR*)"int32", 6); - Enter__47((CHAR*)"int64", 6); - Enter__47((CHAR*)"int8", 5); Enter__47((CHAR*)"long", 5); Enter__47((CHAR*)"register", 9); Enter__47((CHAR*)"return", 7); @@ -1975,10 +1988,6 @@ static void OPC_InitKeywords (void) Enter__47((CHAR*)"struct", 7); Enter__47((CHAR*)"switch", 7); Enter__47((CHAR*)"typedef", 8); - Enter__47((CHAR*)"uint16", 7); - Enter__47((CHAR*)"uint32", 7); - Enter__47((CHAR*)"uint64", 7); - Enter__47((CHAR*)"uint8", 6); Enter__47((CHAR*)"union", 6); Enter__47((CHAR*)"unsigned", 9); Enter__47((CHAR*)"void", 5); diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index bbfd1911..f7fc51f9 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h @@ -13,10 +13,10 @@ import void OPC_Andent (OPT_Struct typ); import OPT_Object OPC_BaseTProc (OPT_Object obj); import void OPC_BegBlk (void); import void OPC_BegStat (void); -import void OPC_Case (int64 caseVal, int16 form); -import void OPC_Cmp (int16 rel); +import void OPC_Case (INT64 caseVal, INT16 form); +import void OPC_Cmp (INT16 rel); import void OPC_CompleteIdent (OPT_Object obj); -import void OPC_Constant (OPT_Const con, int16 form); +import void OPC_Constant (OPT_Const con, INT16 form); import void OPC_DefineInter (OPT_Object proc); import void OPC_EndBlk (void); import void OPC_EndBlk0 (void); @@ -29,19 +29,19 @@ import void OPC_GenBdy (OPT_Node n); import void OPC_GenEnumPtrs (OPT_Object var); import void OPC_GenHdr (OPT_Node n); import void OPC_GenHdrIncludes (void); -import void OPC_Halt (int32 n); +import void OPC_Halt (INT32 n); import void OPC_Ident (OPT_Object obj); import void OPC_Increment (BOOLEAN decrement); -import void OPC_Indent (int16 count); +import void OPC_Indent (INT16 count); import void OPC_Init (void); import void OPC_InitTDesc (OPT_Struct typ); -import void OPC_IntLiteral (int64 n, int32 size); -import void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim); +import void OPC_IntLiteral (INT64 n, INT32 size); +import void OPC_Len (OPT_Object obj, OPT_Struct array, INT64 dim); import BOOLEAN OPC_NeedsRetval (OPT_Object proc); -import int32 OPC_NofPtrs (OPT_Struct typ); +import INT32 OPC_NofPtrs (OPT_Struct typ); import void OPC_SetInclude (BOOLEAN exclude); import void OPC_TDescDecl (OPT_Struct typ); -import void OPC_TypeDefs (OPT_Object obj, int16 vis); +import void OPC_TypeDefs (OPT_Object obj, INT16 vis); import void OPC_TypeOf (OPT_Object ap); import void *OPC__init(void); diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 458de3f2..be4ec200 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "Configuration.h" @@ -22,81 +22,81 @@ typedef static CHAR OPM_SourceFileName[256]; static CHAR OPM_GlobalModel[10]; export CHAR OPM_Model[10]; -static int16 OPM_GlobalAddressSize; -export int16 OPM_AddressSize; -static int16 OPM_GlobalAlignment; -export int16 OPM_Alignment; -export uint32 OPM_GlobalOptions, OPM_Options; -export int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; -export int64 OPM_MaxIndex; +static INT16 OPM_GlobalAddressSize; +export INT16 OPM_AddressSize; +static INT16 OPM_GlobalAlignment; +export INT16 OPM_Alignment; +export UINT32 OPM_GlobalOptions, OPM_Options; +export INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; +export INT64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; -export int32 OPM_curpos, OPM_errpos, OPM_breakpc; -export int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; +export INT32 OPM_curpos, OPM_errpos, OPM_breakpc; +export INT16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; export CHAR OPM_modName[32]; export CHAR OPM_objname[64]; -static int32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; +static INT32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; static Texts_Reader OPM_inR; static Texts_Text OPM_Log; static Texts_Writer OPM_W; static Files_Rider OPM_oldSF, OPM_newSF; static Files_Rider OPM_R[3]; static Files_File OPM_oldSFile, OPM_newSFile, OPM_HFile, OPM_BFile, OPM_HIFile; -static int16 OPM_S; +static INT16 OPM_S; export CHAR OPM_ResourceDir[1024]; -static void OPM_Append (Files_Rider *R, address *R__typ, Files_File F); +static void OPM_Append (Files_Rider *R, ADDRESS *R__typ, Files_File F); export void OPM_CloseFiles (void); export void OPM_CloseOldSym (void); export void OPM_DeleteNewSym (void); -export void OPM_FPrint (int32 *fp, int64 val); -export void OPM_FPrintLReal (int32 *fp, LONGREAL lr); -export void OPM_FPrintReal (int32 *fp, REAL real); -export void OPM_FPrintSet (int32 *fp, uint64 set); -static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 pos); +export void OPM_FPrint (INT32 *fp, INT64 val); +export void OPM_FPrintLReal (INT32 *fp, LONGREAL lr); +export void OPM_FPrintReal (INT32 *fp, REAL real); +export void OPM_FPrintSet (INT32 *fp, UINT64 set); +static void OPM_FindLine (Files_File f, Files_Rider *r, ADDRESS *r__typ, INT64 pos); export void OPM_Get (CHAR *ch); export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); export void OPM_InitOptions (void); -export int16 OPM_Integer (int64 n); -static void OPM_LogErrMsg (int16 n); +export INT16 OPM_Integer (INT64 n); +static void OPM_LogErrMsg (INT16 n); export void OPM_LogW (CHAR ch); export void OPM_LogWLn (void); -export void OPM_LogWNum (int64 i, int64 len); +export void OPM_LogWNum (INT64 i, INT64 len); export void OPM_LogWStr (CHAR *s, LONGINT s__len); -export int32 OPM_Longint (int64 n); +export INT32 OPM_Longint (INT64 n); static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len); -export void OPM_Mark (int16 n, int32 pos); +export void OPM_Mark (INT16 n, INT32 pos); export void OPM_NewSym (CHAR *modName, LONGINT modName__len); export void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); export void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); export BOOLEAN OPM_OpenPar (void); export void OPM_RegisterNewSym (void); static void OPM_ScanOptions (CHAR *s, LONGINT s__len); -static void OPM_ShowLine (int64 pos); -export int64 OPM_SignedMaximum (int32 bytecount); -export int64 OPM_SignedMinimum (int32 bytecount); +static void OPM_ShowLine (INT64 pos); +export INT64 OPM_SignedMaximum (INT32 bytecount); +export INT64 OPM_SignedMinimum (INT32 bytecount); export void OPM_SymRCh (CHAR *ch); -export int32 OPM_SymRInt (void); -export int64 OPM_SymRInt64 (void); +export INT32 OPM_SymRInt (void); +export INT64 OPM_SymRInt64 (void); export void OPM_SymRLReal (LONGREAL *lr); export void OPM_SymRReal (REAL *r); -export void OPM_SymRSet (uint64 *s); +export void OPM_SymRSet (UINT64 *s); export void OPM_SymWCh (CHAR ch); -export void OPM_SymWInt (int64 i); +export void OPM_SymWInt (INT64 i); export void OPM_SymWLReal (LONGREAL lr); export void OPM_SymWReal (REAL r); -export void OPM_SymWSet (uint64 s); +export void OPM_SymWSet (UINT64 s); static void OPM_VerboseListSizes (void); export void OPM_Write (CHAR ch); -export void OPM_WriteHex (int64 i); -export void OPM_WriteInt (int64 i); +export void OPM_WriteHex (INT64 i); +export void OPM_WriteInt (INT64 i); export void OPM_WriteLn (void); export void OPM_WriteReal (LONGREAL r, CHAR suffx); export void OPM_WriteString (CHAR *s, LONGINT s__len); export void OPM_WriteStringVar (CHAR *s, LONGINT s__len); export BOOLEAN OPM_eofSF (void); -export void OPM_err (int16 n); +export void OPM_err (INT16 n); #define OPM_GetAlignment(a) struct {char c; long long l;} _s; *a = (char*)&_s.l - (char*)&_s @@ -112,7 +112,7 @@ void OPM_LogWStr (CHAR *s, LONGINT s__len) __DEL(s); } -void OPM_LogWNum (int64 i, int64 len) +void OPM_LogWNum (INT64 i, INT64 len) { Out_Int(i, len); } @@ -122,32 +122,32 @@ void OPM_LogWLn (void) Out_Ln(); } -int64 OPM_SignedMaximum (int32 bytecount) +INT64 OPM_SignedMaximum (INT32 bytecount) { - int64 result; + INT64 result; result = 1; result = __LSH(result, __ASHL(bytecount, 3) - 1, 64); return result - 1; } -int64 OPM_SignedMinimum (int32 bytecount) +INT64 OPM_SignedMinimum (INT32 bytecount) { return -OPM_SignedMaximum(bytecount) - 1; } -int32 OPM_Longint (int64 n) +INT32 OPM_Longint (INT64 n) { - return __VAL(int32, n); + return __VAL(INT32, n); } -int16 OPM_Integer (int64 n) +INT16 OPM_Integer (INT64 n) { - return __VAL(int16, n); + return __VAL(INT16, n); } static void OPM_ScanOptions (CHAR *s, LONGINT s__len) { - int16 i; + INT16 i; __DUP(s, s__len, CHAR); i = 1; while (s[__X(i, s__len)] != 0x00) { @@ -213,23 +213,23 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len) OPM_LogWStr((CHAR*)"-M option requires two following digits.", 41); OPM_LogWLn(); } else { - OPM_AddressSize = (int16)s[__X(i + 1, s__len)] - 48; - OPM_Alignment = (int16)s[__X(i + 2, s__len)] - 48; + OPM_AddressSize = (INT16)s[__X(i + 1, s__len)] - 48; + OPM_Alignment = (INT16)s[__X(i + 2, s__len)] - 48; i += 2; } break; case 'B': if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_IntegerSize = (int16)s[__X(i, s__len)] - 48; + OPM_IntegerSize = (INT16)s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_AddressSize = (int16)s[__X(i, s__len)] - 48; + OPM_AddressSize = (INT16)s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_Alignment = (int16)s[__X(i, s__len)] - 48; + OPM_Alignment = (INT16)s[__X(i, s__len)] - 48; } __ASSERT(OPM_IntegerSize == 2 || OPM_IntegerSize == 4, 0); __ASSERT(OPM_AddressSize == 4 || OPM_AddressSize == 8, 0); @@ -465,7 +465,7 @@ void OPM_InitOptions (void) void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len) { Texts_Text T = NIL; - int32 beg, end, time; + INT32 beg, end, time; CHAR s[256]; *done = 0; OPM_curpos = 0; @@ -513,7 +513,7 @@ void OPM_Get (CHAR *ch) static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len) { - int16 i, j; + INT16 i, j; CHAR ch; __DUP(ext, ext__len, CHAR); i = 0; @@ -535,12 +535,12 @@ static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGIN __DEL(ext); } -static void OPM_LogErrMsg (int16 n) +static void OPM_LogErrMsg (INT16 n) { Texts_Scanner S; Texts_Text T = NIL; CHAR ch; - int16 i; + INT16 i; CHAR buf[1024]; if (n >= 0) { if (!__IN(16, OPM_Options, 32)) { @@ -565,21 +565,21 @@ static void OPM_LogErrMsg (int16 n) OPM_LogWStr(errors_errors[__X(n, 350)], 128); } -static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 pos) +static void OPM_FindLine (Files_File f, Files_Rider *r, ADDRESS *r__typ, INT64 pos) { CHAR ch, cheol; - if (pos < (int64)OPM_ErrorLineStartPos) { + if (pos < (INT64)OPM_ErrorLineStartPos) { OPM_ErrorLineStartPos = 0; OPM_ErrorLineLimitPos = 0; OPM_ErrorLineNumber = 0; } - if (pos < (int64)OPM_ErrorLineLimitPos) { + if (pos < (INT64)OPM_ErrorLineLimitPos) { Files_Set(&*r, r__typ, f, OPM_ErrorLineStartPos); return; } Files_Set(&*r, r__typ, f, OPM_ErrorLineLimitPos); Files_Read(&*r, r__typ, (void*)&ch); - while (((int64)OPM_ErrorLineLimitPos < pos && !(*r).eof)) { + while (((INT64)OPM_ErrorLineLimitPos < pos && !(*r).eof)) { OPM_ErrorLineStartPos = OPM_ErrorLineLimitPos; OPM_ErrorLineNumber += 1; while ((((ch != 0x00 && ch != 0x0d)) && ch != 0x0a)) { @@ -597,12 +597,12 @@ static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 p Files_Set(&*r, r__typ, f, OPM_ErrorLineStartPos); } -static void OPM_ShowLine (int64 pos) +static void OPM_ShowLine (INT64 pos) { Files_File f = NIL; Files_Rider r; CHAR line[1023]; - int16 i; + INT16 i; CHAR ch; f = Files_Old(OPM_SourceFileName, 256); OPM_FindLine(f, &r, Files_Rider__typ, pos); @@ -621,10 +621,10 @@ static void OPM_ShowLine (int64 pos) OPM_LogWStr(line, 1023); OPM_LogWLn(); OPM_LogWStr((CHAR*)" ", 7); - if (pos >= (int64)OPM_ErrorLineLimitPos) { + if (pos >= (INT64)OPM_ErrorLineLimitPos) { pos = OPM_ErrorLineLimitPos - 1; } - i = (int16)OPM_Longint(pos - (int64)OPM_ErrorLineStartPos); + i = (INT16)OPM_Longint(pos - (INT64)OPM_ErrorLineStartPos); while (i > 0) { OPM_LogW(' '); i -= 1; @@ -639,7 +639,7 @@ static void OPM_ShowLine (int64 pos) Files_Close(f); } -void OPM_Mark (int16 n, int32 pos) +void OPM_Mark (INT16 n, INT32 pos) { if (pos == -1) { pos = 0; @@ -691,34 +691,34 @@ void OPM_Mark (int16 n, int32 pos) } } -void OPM_err (int16 n) +void OPM_err (INT16 n) { OPM_Mark(n, OPM_errpos); } -void OPM_FPrint (int32 *fp, int64 val) +void OPM_FPrint (INT32 *fp, INT64 val) { - *fp = __ROTL((int32)((uint32)*fp ^ __VAL(uint32, val)), 1, 32); + *fp = __ROTL((INT32)((UINT32)*fp ^ __VAL(UINT32, val)), 1, 32); } -void OPM_FPrintSet (int32 *fp, uint64 set) +void OPM_FPrintSet (INT32 *fp, UINT64 set) { - OPM_FPrint(&*fp, __VAL(int32, set)); + OPM_FPrint(&*fp, __VAL(INT32, set)); } -void OPM_FPrintReal (int32 *fp, REAL real) +void OPM_FPrintReal (INT32 *fp, REAL real) { - int16 i; - int32 l; - __GET((address)&real, l, int32); + INT16 i; + INT32 l; + __GET((address)&real, l, INT32); OPM_FPrint(&*fp, l); } -void OPM_FPrintLReal (int32 *fp, LONGREAL lr) +void OPM_FPrintLReal (INT32 *fp, LONGREAL lr) { - int32 l, h; - __GET((address)&lr, l, int32); - __GET((address)&lr + 4, h, int32); + INT32 l, h; + __GET((address)&lr, l, INT32); + __GET((address)&lr + 4, h, INT32); OPM_FPrint(&*fp, l); OPM_FPrint(&*fp, h); } @@ -728,21 +728,21 @@ void OPM_SymRCh (CHAR *ch) Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&*ch); } -int32 OPM_SymRInt (void) +INT32 OPM_SymRInt (void) { - int32 k; + INT32 k; Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&k, 4); return k; } -int64 OPM_SymRInt64 (void) +INT64 OPM_SymRInt64 (void) { - int64 k; + INT64 k; Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&k, 8); return k; } -void OPM_SymRSet (uint64 *s) +void OPM_SymRSet (UINT64 *s) { Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&*s, 8); } @@ -790,14 +790,14 @@ void OPM_SymWCh (CHAR ch) Files_Write(&OPM_newSF, Files_Rider__typ, ch); } -void OPM_SymWInt (int64 i) +void OPM_SymWInt (INT64 i) { Files_WriteNum(&OPM_newSF, Files_Rider__typ, i); } -void OPM_SymWSet (uint64 s) +void OPM_SymWSet (UINT64 s) { - Files_WriteNum(&OPM_newSF, Files_Rider__typ, (int64)s); + Files_WriteNum(&OPM_newSF, Files_Rider__typ, (INT64)s); } void OPM_SymWReal (REAL r) @@ -841,7 +841,7 @@ void OPM_Write (CHAR ch) void OPM_WriteString (CHAR *s, LONGINT s__len) { - int16 i; + INT16 i; i = 0; while (s[__X(i, s__len)] != 0x00) { i += 1; @@ -851,7 +851,7 @@ void OPM_WriteString (CHAR *s, LONGINT s__len) void OPM_WriteStringVar (CHAR *s, LONGINT s__len) { - int16 i; + INT16 i; i = 0; while (s[__X(i, s__len)] != 0x00) { i += 1; @@ -859,17 +859,17 @@ void OPM_WriteStringVar (CHAR *s, LONGINT s__len) Files_WriteBytes(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, (void*)s, s__len * 1, i); } -void OPM_WriteHex (int64 i) +void OPM_WriteHex (INT64 i) { CHAR s[3]; - int32 digit; - digit = __ASHR((int32)i, 4); + INT32 digit; + digit = __ASHR((INT32)i, 4); if (digit < 10) { s[0] = (CHAR)(48 + digit); } else { s[0] = (CHAR)(87 + digit); } - digit = __MASK((int32)i, -16); + digit = __MASK((INT32)i, -16); if (digit < 10) { s[1] = (CHAR)(48 + digit); } else { @@ -879,10 +879,10 @@ void OPM_WriteHex (int64 i) OPM_WriteString(s, 3); } -void OPM_WriteInt (int64 i) +void OPM_WriteInt (INT64 i) { CHAR s[24]; - int64 i1, k; + INT64 i1, k; if ((i == OPM_SignedMinimum(2) || i == OPM_SignedMinimum(4)) || i == OPM_SignedMinimum(8)) { OPM_Write('('); OPM_WriteInt(i + 1); @@ -915,14 +915,14 @@ void OPM_WriteReal (LONGREAL r, CHAR suffx) Texts_Reader R; CHAR s[32]; CHAR ch; - int16 i; - if ((((r < OPM_SignedMaximum(OPM_LongintSize) && r > OPM_SignedMinimum(OPM_LongintSize))) && r == ((int32)__ENTIER(r)))) { + INT16 i; + if ((((r < OPM_SignedMaximum(OPM_LongintSize) && r > OPM_SignedMinimum(OPM_LongintSize))) && r == ((INT32)__ENTIER(r)))) { if (suffx == 'f') { OPM_WriteString((CHAR*)"(REAL)", 7); } else { OPM_WriteString((CHAR*)"(LONGREAL)", 11); } - OPM_WriteInt((int32)__ENTIER(r)); + OPM_WriteInt((INT32)__ENTIER(r)); } else { Texts_OpenWriter(&W, Texts_Writer__typ); if (suffx == 'f') { @@ -960,7 +960,7 @@ void OPM_WriteLn (void) Files_Write(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, 0x0a); } -static void OPM_Append (Files_Rider *R, address *R__typ, Files_File F) +static void OPM_Append (Files_Rider *R, ADDRESS *R__typ, Files_File F) { Files_Rider R1; CHAR buffer[4096]; @@ -1003,7 +1003,7 @@ void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len) void OPM_CloseFiles (void) { CHAR FName[32]; - int16 res; + INT16 res; if (OPM_noerr) { OPM_LogWStr((CHAR*)" ", 3); OPM_LogWNum(Files_Pos(&OPM_R[1], Files_Rider__typ), 0); diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index be9e98bd..42866571 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h @@ -7,14 +7,14 @@ import CHAR OPM_Model[10]; -import int16 OPM_AddressSize, OPM_Alignment; -import uint32 OPM_GlobalOptions, OPM_Options; -import int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; -import int64 OPM_MaxIndex; +import INT16 OPM_AddressSize, OPM_Alignment; +import UINT32 OPM_GlobalOptions, OPM_Options; +import INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; +import INT64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; -import int32 OPM_curpos, OPM_errpos, OPM_breakpc; -import int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; +import INT32 OPM_curpos, OPM_errpos, OPM_breakpc; +import INT16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; import CHAR OPM_modName[32]; import CHAR OPM_objname[64]; import CHAR OPM_ResourceDir[1024]; @@ -23,47 +23,47 @@ import CHAR OPM_ResourceDir[1024]; import void OPM_CloseFiles (void); import void OPM_CloseOldSym (void); import void OPM_DeleteNewSym (void); -import void OPM_FPrint (int32 *fp, int64 val); -import void OPM_FPrintLReal (int32 *fp, LONGREAL lr); -import void OPM_FPrintReal (int32 *fp, REAL real); -import void OPM_FPrintSet (int32 *fp, uint64 set); +import void OPM_FPrint (INT32 *fp, INT64 val); +import void OPM_FPrintLReal (INT32 *fp, LONGREAL lr); +import void OPM_FPrintReal (INT32 *fp, REAL real); +import void OPM_FPrintSet (INT32 *fp, UINT64 set); import void OPM_Get (CHAR *ch); import void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); import void OPM_InitOptions (void); -import int16 OPM_Integer (int64 n); +import INT16 OPM_Integer (INT64 n); import void OPM_LogW (CHAR ch); import void OPM_LogWLn (void); -import void OPM_LogWNum (int64 i, int64 len); +import void OPM_LogWNum (INT64 i, INT64 len); import void OPM_LogWStr (CHAR *s, LONGINT s__len); -import int32 OPM_Longint (int64 n); -import void OPM_Mark (int16 n, int32 pos); +import INT32 OPM_Longint (INT64 n); +import void OPM_Mark (INT16 n, INT32 pos); import void OPM_NewSym (CHAR *modName, LONGINT modName__len); import void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); import void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); import BOOLEAN OPM_OpenPar (void); import void OPM_RegisterNewSym (void); -import int64 OPM_SignedMaximum (int32 bytecount); -import int64 OPM_SignedMinimum (int32 bytecount); +import INT64 OPM_SignedMaximum (INT32 bytecount); +import INT64 OPM_SignedMinimum (INT32 bytecount); import void OPM_SymRCh (CHAR *ch); -import int32 OPM_SymRInt (void); -import int64 OPM_SymRInt64 (void); +import INT32 OPM_SymRInt (void); +import INT64 OPM_SymRInt64 (void); import void OPM_SymRLReal (LONGREAL *lr); import void OPM_SymRReal (REAL *r); -import void OPM_SymRSet (uint64 *s); +import void OPM_SymRSet (UINT64 *s); import void OPM_SymWCh (CHAR ch); -import void OPM_SymWInt (int64 i); +import void OPM_SymWInt (INT64 i); import void OPM_SymWLReal (LONGREAL lr); import void OPM_SymWReal (REAL r); -import void OPM_SymWSet (uint64 s); +import void OPM_SymWSet (UINT64 s); import void OPM_Write (CHAR ch); -import void OPM_WriteHex (int64 i); -import void OPM_WriteInt (int64 i); +import void OPM_WriteHex (INT64 i); +import void OPM_WriteInt (INT64 i); import void OPM_WriteLn (void); import void OPM_WriteReal (LONGREAL r, CHAR suffx); import void OPM_WriteString (CHAR *s, LONGINT s__len); import void OPM_WriteStringVar (CHAR *s, LONGINT s__len); import BOOLEAN OPM_eofSF (void); -import void OPM_err (int16 n); +import void OPM_err (INT16 n); import void *OPM__init(void); diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index 5e181cb9..45f4db77 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "OPB.h" @@ -12,38 +12,38 @@ #include "OPT.h" struct OPP__1 { - int32 low, high; + INT32 low, high; }; typedef struct OPP__1 OPP_CaseTable[128]; -static int8 OPP_sym, OPP_level; -static int16 OPP_LoopLevel; +static INT8 OPP_sym, OPP_level; +static INT16 OPP_LoopLevel; static OPT_Node OPP_TDinit, OPP_lastTDinit; -static int16 OPP_nofFwdPtr; +static INT16 OPP_nofFwdPtr; static OPT_Struct OPP_FwdPtr[64]; -export address *OPP__1__typ; +export ADDRESS *OPP__1__typ; static void OPP_ActualParameters (OPT_Node *aparlist, OPT_Object fpar); static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned); static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq); -static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int16 *n, OPP_CaseTable tab); -static void OPP_CheckMark (int8 *vis); -static void OPP_CheckSym (int16 s); -static void OPP_CheckSysFlag (int16 *sysflag, int16 default_); +static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INT16 *n, OPP_CaseTable tab); +static void OPP_CheckMark (INT8 *vis); +static void OPP_CheckSym (INT16 s); +static void OPP_CheckSysFlag (INT16 *sysflag, INT16 default_); static void OPP_ConstExpression (OPT_Node *x); static void OPP_Element (OPT_Node *x); static void OPP_Expression (OPT_Node *x); static BOOLEAN OPP_Extends (OPT_Struct x, OPT_Struct b); static void OPP_Factor (OPT_Node *x); static void OPP_FormalParameters (OPT_Object *firstPar, OPT_Struct *resTyp); -export void OPP_Module (OPT_Node *prog, uint32 opt); +export void OPP_Module (OPT_Node *prog, UINT32 opt); static void OPP_PointerType (OPT_Struct *typ); static void OPP_ProcedureDeclaration (OPT_Node *x); -static void OPP_Receiver (int8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec); +static void OPP_Receiver (INT8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec); static void OPP_RecordType (OPT_Struct *typ, OPT_Struct *banned); static void OPP_Sets (OPT_Node *x); static void OPP_SimpleExpression (OPT_Node *x); @@ -52,19 +52,19 @@ static void OPP_StatSeq (OPT_Node *stat); static void OPP_Term (OPT_Node *x); static void OPP_Type (OPT_Struct *typ, OPT_Struct *banned); static void OPP_TypeDecl (OPT_Struct *typ, OPT_Struct *banned); -static void OPP_err (int16 n); +static void OPP_err (INT16 n); static void OPP_qualident (OPT_Object *id); static void OPP_selector (OPT_Node *x); -static void OPP_err (int16 n) +static void OPP_err (INT16 n) { OPM_err(n); } -static void OPP_CheckSym (int16 s) +static void OPP_CheckSym (INT16 s) { - if ((int16)OPP_sym == s) { + if ((INT16)OPP_sym == s) { OPS_Get(&OPP_sym); } else { OPM_err(s); @@ -74,7 +74,7 @@ static void OPP_CheckSym (int16 s) static void OPP_qualident (OPT_Object *id) { OPT_Object obj = NIL; - int8 lev; + INT8 lev; OPT_Find(&obj); OPS_Get(&OPP_sym); if ((((OPP_sym == 18 && obj != NIL)) && obj->mode == 11)) { @@ -114,7 +114,7 @@ static void OPP_ConstExpression (OPT_Node *x) } } -static void OPP_CheckMark (int8 *vis) +static void OPP_CheckMark (INT8 *vis) { OPS_Get(&OPP_sym); if (OPP_sym == 1 || OPP_sym == 7) { @@ -132,10 +132,10 @@ static void OPP_CheckMark (int8 *vis) } } -static void OPP_CheckSysFlag (int16 *sysflag, int16 default_) +static void OPP_CheckSysFlag (INT16 *sysflag, INT16 default_) { OPT_Node x = NIL; - int64 sf; + INT64 sf; if (OPP_sym == 31) { OPS_Get(&OPP_sym); if (!OPT_SYSimported) { @@ -163,7 +163,7 @@ static void OPP_RecordType (OPT_Struct *typ, OPT_Struct *banned) { OPT_Object fld = NIL, first = NIL, last = NIL, base = NIL; OPT_Struct ftyp = NIL; - int16 sysflag; + INT16 sysflag; *typ = OPT_NewStr(13, 4); (*typ)->BaseTyp = NIL; OPP_CheckSysFlag(&sysflag, -1); @@ -255,8 +255,8 @@ static void OPP_RecordType (OPT_Struct *typ, OPT_Struct *banned) static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) { OPT_Node x = NIL; - int64 n; - int16 sysflag; + INT64 n; + INT16 sysflag; OPP_CheckSysFlag(&sysflag, 0); if (OPP_sym == 25) { *typ = OPT_NewStr(13, 3); @@ -348,7 +348,7 @@ static void OPP_PointerType (OPT_Struct *typ) static void OPP_FormalParameters (OPT_Object *firstPar, OPT_Struct *resTyp) { - int8 mode; + INT8 mode; OPT_Object par = NIL, first = NIL, last = NIL, res = NIL; OPT_Struct typ = NIL; first = NIL; @@ -629,9 +629,9 @@ static void OPP_ActualParameters (OPT_Node *aparlist, OPT_Object fpar) static void OPP_StandProcCall (OPT_Node *x) { OPT_Node y = NIL; - int8 m; - int16 n; - m = (int8)((int16)(*x)->obj->adr); + INT8 m; + INT16 n; + m = (INT8)((INT16)(*x)->obj->adr); n = 0; if (OPP_sym == 30) { OPS_Get(&OPP_sym); @@ -790,7 +790,7 @@ static void OPP_Factor (OPT_Node *x) static void OPP_Term (OPT_Node *x) { OPT_Node y = NIL; - int8 mulop; + INT8 mulop; OPP_Factor(&*x); while ((1 <= OPP_sym && OPP_sym <= 5)) { mulop = OPP_sym; @@ -803,7 +803,7 @@ static void OPP_Term (OPT_Node *x) static void OPP_SimpleExpression (OPT_Node *x) { OPT_Node y = NIL; - int8 addop; + INT8 addop; if (OPP_sym == 7) { OPS_Get(&OPP_sym); OPP_Term(&*x); @@ -827,7 +827,7 @@ static void OPP_Expression (OPT_Node *x) { OPT_Node y = NIL; OPT_Object obj = NIL; - int8 relation; + INT8 relation; OPP_SimpleExpression(&*x); if ((9 <= OPP_sym && OPP_sym <= 14)) { relation = OPP_sym; @@ -853,7 +853,7 @@ static void OPP_Expression (OPT_Node *x) } } -static void OPP_Receiver (int8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec) +static void OPP_Receiver (INT8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec) { OPT_Object obj = NIL; *typ = OPT_undftyp; @@ -917,7 +917,7 @@ static struct ProcedureDeclaration__16 { OPT_Node *x; OPT_Object *proc, *fwd; OPS_Name *name; - int8 *mode, *vis; + INT8 *mode, *vis; BOOLEAN *forward; struct ProcedureDeclaration__16 *lnk; } *ProcedureDeclaration__16_s; @@ -930,8 +930,8 @@ static void TProcDecl__23 (void); static void GetCode__19 (void) { OPT_ConstExt ext = NIL; - int16 n; - int64 c; + INT16 n; + INT64 c; ext = OPT_NewExt(); (*ProcedureDeclaration__16_s->proc)->conval->ext = ext; n = 0; @@ -995,7 +995,7 @@ static void GetParams__21 (void) static void Body__17 (void) { OPT_Node procdec = NIL, statseq = NIL; - int32 c; + INT32 c; c = OPM_errpos; (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1,64); OPP_CheckSym(39); @@ -1018,7 +1018,7 @@ static void TProcDecl__23 (void) { OPT_Object baseProc = NIL; OPT_Struct objTyp = NIL, recTyp = NIL; - int8 objMode; + INT8 objMode; OPS_Name objName; OPS_Get(&OPP_sym); *ProcedureDeclaration__16_s->mode = 13; @@ -1090,7 +1090,7 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) { OPT_Object proc = NIL, fwd = NIL; OPS_Name name; - int8 mode, vis; + INT8 mode, vis; BOOLEAN forward; struct ProcedureDeclaration__16 _s; _s.x = x; @@ -1167,11 +1167,11 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) ProcedureDeclaration__16_s = _s.lnk; } -static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int16 *n, OPP_CaseTable tab) +static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INT16 *n, OPP_CaseTable tab) { OPT_Node x = NIL, y = NIL, lastlab = NIL; - int16 i, f; - int32 xval, yval; + INT16 i, f; + INT32 xval, yval; *lab = NIL; lastlab = NIL; for (;;) { @@ -1187,14 +1187,14 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int16 *n, OPP if (!(LabelTyp->form == 4) || LabelTyp->size < x->typ->size) { OPP_err(60); } - } else if ((int16)LabelTyp->form != f) { + } else if ((INT16)LabelTyp->form != f) { OPP_err(60); } if (OPP_sym == 21) { OPS_Get(&OPP_sym); OPP_ConstExpression(&y); yval = OPM_Longint(y->conval->intval); - if (((int16)y->typ->form != f && !((f == 4 && y->typ->form == 4)))) { + if (((INT16)y->typ->form != f && !((f == 4 && y->typ->form == 4)))) { OPP_err(60); } if (yval < xval) { @@ -1238,7 +1238,7 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int16 *n, OPP } static struct StatSeq__30 { - int32 *pos; + INT32 *pos; struct StatSeq__30 *lnk; } *StatSeq__30_s; @@ -1248,8 +1248,8 @@ static void SetPos__35 (OPT_Node x); static void CasePart__31 (OPT_Node *x) { - int16 n; - int32 low, high; + INT16 n; + INT32 low, high; BOOLEAN e; OPP_CaseTable tab; OPT_Node cases = NIL, lab = NIL, y = NIL, lastcase = NIL; @@ -1332,7 +1332,7 @@ static void OPP_StatSeq (OPT_Node *stat) OPT_Struct idtyp = NIL; BOOLEAN e; OPT_Node s = NIL, x = NIL, y = NIL, z = NIL, apar = NIL, last = NIL, lastif = NIL; - int32 pos; + INT32 pos; OPS_Name name; struct StatSeq__30 _s; _s.pos = &pos; @@ -1625,7 +1625,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) OPT_Struct typ = NIL; OPT_Object obj = NIL, first = NIL, last = NIL; OPT_Node x = NIL, lastdec = NIL; - int16 i; + INT16 i; first = NIL; last = NIL; OPP_nofFwdPtr = 0; @@ -1774,11 +1774,11 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) OPP_CheckSym(41); } -void OPP_Module (OPT_Node *prog, uint32 opt) +void OPP_Module (OPT_Node *prog, UINT32 opt) { OPS_Name impName, aliasName; OPT_Node procdec = NIL, statseq = NIL; - int32 c; + INT32 c; BOOLEAN done; OPS_Init(); OPP_LoopLevel = 0; diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index de0e599a..cb3aabc8 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h @@ -9,7 +9,7 @@ -import void OPP_Module (OPT_Node *prog, uint32 opt); +import void OPP_Module (OPT_Node *prog, UINT32 opt); import void *OPP__init(void); diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index 5a34663d..5d7b776f 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "OPM.h" @@ -17,29 +17,29 @@ typedef export OPS_Name OPS_name; export OPS_String OPS_str; -export int16 OPS_numtyp; -export int64 OPS_intval; +export INT16 OPS_numtyp; +export INT64 OPS_intval; export REAL OPS_realval; export LONGREAL OPS_lrlval; static CHAR OPS_ch; -export void OPS_Get (int8 *sym); -static void OPS_Identifier (int8 *sym); +export void OPS_Get (INT8 *sym); +static void OPS_Identifier (INT8 *sym); export void OPS_Init (void); static void OPS_Number (void); -static void OPS_Str (int8 *sym); -static void OPS_err (int16 n); +static void OPS_Str (INT8 *sym); +static void OPS_err (INT16 n); -static void OPS_err (int16 n) +static void OPS_err (INT16 n) { OPM_err(n); } -static void OPS_Str (int8 *sym) +static void OPS_Str (INT8 *sym) { - int16 i; + INT16 i; CHAR och; i = 0; och = OPS_ch; @@ -65,15 +65,15 @@ static void OPS_Str (int8 *sym) if (OPS_intval == 2) { *sym = 35; OPS_numtyp = 1; - OPS_intval = (int16)OPS_str[0]; + OPS_intval = (INT16)OPS_str[0]; } else { *sym = 37; } } -static void OPS_Identifier (int8 *sym) +static void OPS_Identifier (INT8 *sym) { - int16 i; + INT16 i; i = 0; do { OPS_name[i] = OPS_ch; @@ -92,10 +92,10 @@ static struct Number__6 { struct Number__6 *lnk; } *Number__6_s; -static int16 Ord__7 (CHAR ch, BOOLEAN hex); -static LONGREAL Ten__9 (int16 e); +static INT16 Ord__7 (CHAR ch, BOOLEAN hex); +static LONGREAL Ten__9 (INT16 e); -static LONGREAL Ten__9 (int16 e) +static LONGREAL Ten__9 (INT16 e) { LONGREAL x, p; x = (LONGREAL)1; @@ -112,12 +112,12 @@ static LONGREAL Ten__9 (int16 e) return x; } -static int16 Ord__7 (CHAR ch, BOOLEAN hex) +static INT16 Ord__7 (CHAR ch, BOOLEAN hex) { if (ch <= '9') { - return (int16)ch - 48; + return (INT16)ch - 48; } else if (hex) { - return ((int16)ch - 65) + 10; + return ((INT16)ch - 65) + 10; } else { OPS_err(2); return 0; @@ -127,7 +127,7 @@ static int16 Ord__7 (CHAR ch, BOOLEAN hex) static void OPS_Number (void) { - int16 i, m, n, d, e; + INT16 i, m, n, d, e; CHAR dig[24]; LONGREAL f; CHAR expCh; @@ -173,7 +173,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) + (INT64)Ord__7(dig[i], 1); i += 1; } } else { @@ -187,7 +187,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) + (INT64)Ord__7(dig[i], 1); i += 1; } } else { @@ -198,8 +198,8 @@ static void OPS_Number (void) while (i < n) { d = Ord__7(dig[i], 0); i += 1; - if (OPS_intval <= __DIV(9223372036854775807 - (int64)d, 10)) { - OPS_intval = OPS_intval * 10 + (int64)d; + if (OPS_intval <= __DIV(9223372036854775807 - (INT64)d, 10)) { + OPS_intval = OPS_intval * 10 + (INT64)d; } else { OPS_err(203); } @@ -308,9 +308,9 @@ static void Comment__2 (void) } } -void OPS_Get (int8 *sym) +void OPS_Get (INT8 *sym) { - int8 s; + INT8 s; struct Get__1 _s; _s.lnk = Get__1_s; Get__1_s = &_s; diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index a452da84..01ffbd17 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h @@ -14,13 +14,13 @@ typedef import OPS_Name OPS_name; import OPS_String OPS_str; -import int16 OPS_numtyp; -import int64 OPS_intval; +import INT16 OPS_numtyp; +import INT64 OPS_intval; import REAL OPS_realval; import LONGREAL OPS_lrlval; -import void OPS_Get (int8 *sym); +import void OPS_Get (INT8 *sym); import void OPS_Init (void); import void *OPS__init(void); diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index f55e7e01..3340bb93 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "OPM.h" @@ -18,18 +18,18 @@ typedef typedef struct OPT_ConstDesc { OPT_ConstExt ext; - int64 intval; - int32 intval2; - uint64 setval; + INT64 intval; + INT32 intval2; + UINT64 setval; LONGREAL realval; } OPT_ConstDesc; typedef struct OPT_ExpCtxt { - int32 reffp; - int16 ref; - int8 nofm; - int8 locmno[64]; + INT32 reffp; + INT16 ref; + INT8 nofm; + INT8 locmno[64]; } OPT_ExpCtxt; typedef @@ -40,13 +40,13 @@ typedef typedef struct OPT_ImpCtxt { - int32 nextTag, reffp; - int16 nofr, minr, nofm; + INT32 nextTag, reffp; + INT16 nofr, minr, nofm; BOOLEAN self; OPT_Struct ref[255]; OPT_Object old[255]; - int32 pvfp[255]; - int8 glbmno[64]; + INT32 pvfp[255]; + INT8 glbmno[64]; } OPT_ImpCtxt; typedef @@ -55,7 +55,7 @@ typedef typedef struct OPT_NodeDesc { OPT_Node left, right, link; - int8 class, subcl; + INT8 class, subcl; BOOLEAN readonly; OPT_Struct typ; OPT_Object obj; @@ -67,22 +67,22 @@ typedef OPT_Object left, right, link, scope; OPS_Name name; BOOLEAN leaf; - int8 mode, mnolev, vis, history; + INT8 mode, mnolev, vis, history; BOOLEAN used, fpdone; - int32 fprint; + INT32 fprint; OPT_Struct typ; OPT_Const conval; - int32 adr, linkadr; - int16 x; + INT32 adr, linkadr; + INT16 x; } OPT_ObjDesc; typedef struct OPT_StrDesc { - int8 form, comp, mno, extlev; - int16 ref, sysflag; - int32 n, size, align, txtpos; + INT8 form, comp, mno, extlev; + INT16 ref, sysflag; + INT32 n, size, align, txtpos; BOOLEAN allocated, pbused, pvused, fpdone, idfpdone; - int32 idfp, pbfp, pvfp; + INT32 idfp, pbfp, pvfp; OPT_Struct BaseTyp; OPT_Object link, strobj; } OPT_StrDesc; @@ -91,80 +91,80 @@ typedef export OPT_Object OPT_topScope; export OPT_Struct OPT_undftyp, OPT_niltyp, OPT_notyp, OPT_bytetyp, OPT_cpbytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_settyp, OPT_set32typ, OPT_set64typ, OPT_realtyp, OPT_lrltyp, OPT_stringtyp, OPT_adrtyp, OPT_sysptrtyp; export OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj, OPT_setobj; -export int8 OPT_nofGmod; +export INT8 OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; export BOOLEAN OPT_SYSimported; static OPT_Object OPT_universe, OPT_syslink; static OPT_ImpCtxt OPT_impCtxt; static OPT_ExpCtxt OPT_expCtxt; -static int32 OPT_nofhdfld; +static INT32 OPT_nofhdfld; static BOOLEAN OPT_newsf, OPT_findpc, OPT_extsf, OPT_sfpresent, OPT_symExtended, OPT_symNew; -static int32 OPT_recno; +static INT32 OPT_recno; -export address *OPT_ConstDesc__typ; -export address *OPT_ObjDesc__typ; -export address *OPT_StrDesc__typ; -export address *OPT_NodeDesc__typ; -export address *OPT_ImpCtxt__typ; -export address *OPT_ExpCtxt__typ; +export ADDRESS *OPT_ConstDesc__typ; +export ADDRESS *OPT_ObjDesc__typ; +export ADDRESS *OPT_StrDesc__typ; +export ADDRESS *OPT_NodeDesc__typ; +export ADDRESS *OPT_ImpCtxt__typ; +export ADDRESS *OPT_ExpCtxt__typ; -export void OPT_Align (int32 *adr, int32 base); -export int32 OPT_BaseAlignment (OPT_Struct typ); +export void OPT_Align (INT32 *adr, INT32 base); +export INT32 OPT_BaseAlignment (OPT_Struct typ); export void OPT_Close (void); export void OPT_CloseScope (void); static void OPT_DebugStruct (OPT_Struct btyp); -static void OPT_EnterBoolConst (OPS_Name name, int32 value); -static void OPT_EnterProc (OPS_Name name, int16 num); -static void OPT_EnterTyp (OPS_Name name, int8 form, int16 size, OPT_Struct *res); +static void OPT_EnterBoolConst (OPS_Name name, INT32 value); +static void OPT_EnterProc (OPS_Name name, INT16 num); +static void OPT_EnterTyp (OPS_Name name, INT8 form, INT16 size, OPT_Struct *res); static void OPT_EnterTypeAlias (OPS_Name name, OPT_Object *res); export void OPT_Export (BOOLEAN *ext, BOOLEAN *new); -export void OPT_FPrintErr (OPT_Object obj, int16 errcode); -static void OPT_FPrintName (int32 *fp, CHAR *name, LONGINT name__len); +export void OPT_FPrintErr (OPT_Object obj, INT16 errcode); +static void OPT_FPrintName (INT32 *fp, CHAR *name, LONGINT name__len); export void OPT_FPrintObj (OPT_Object obj); -static void OPT_FPrintSign (int32 *fp, OPT_Struct result, OPT_Object par); +static void OPT_FPrintSign (INT32 *fp, OPT_Struct result, OPT_Object par); export void OPT_FPrintStr (OPT_Struct typ); export void OPT_Find (OPT_Object *res); export void OPT_FindField (OPS_Name name, OPT_Struct typ, OPT_Object *res); export void OPT_FindImport (OPT_Object mod, OPT_Object *res); export void OPT_IdFPrint (OPT_Struct typ); export void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); -static void OPT_InConstant (int32 f, OPT_Const conval); +static void OPT_InConstant (INT32 f, OPT_Const conval); static OPT_Object OPT_InFld (void); -static void OPT_InMod (int8 *mno); +static void OPT_InMod (INT8 *mno); static void OPT_InName (CHAR *name, LONGINT name__len); -static OPT_Object OPT_InObj (int8 mno); -static void OPT_InSign (int8 mno, OPT_Struct *res, OPT_Object *par); +static OPT_Object OPT_InObj (INT8 mno); +static void OPT_InSign (INT8 mno, OPT_Struct *res, OPT_Object *par); static void OPT_InStruct (OPT_Struct *typ); -static OPT_Object OPT_InTProc (int8 mno); -static OPT_Struct OPT_InTyp (int32 tag); -export void OPT_Init (OPS_Name name, uint32 opt); +static OPT_Object OPT_InTProc (INT8 mno); +static OPT_Struct OPT_InTyp (INT32 tag); +export void OPT_Init (OPS_Name name, UINT32 opt); export void OPT_InitRecno (void); -static void OPT_InitStruct (OPT_Struct *typ, int8 form); +static void OPT_InitStruct (OPT_Struct *typ, INT8 form); export void OPT_Insert (OPS_Name name, OPT_Object *obj); export void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); -export int16 OPT_IntSize (int64 n); -export OPT_Struct OPT_IntType (int32 size); +export INT16 OPT_IntSize (INT64 n); +export OPT_Struct OPT_IntType (INT32 size); export OPT_Const OPT_NewConst (void); export OPT_ConstExt OPT_NewExt (void); -export OPT_Node OPT_NewNode (int8 class); +export OPT_Node OPT_NewNode (INT8 class); export OPT_Object OPT_NewObj (void); -export OPT_Struct OPT_NewStr (int8 form, int8 comp); -export void OPT_OpenScope (int8 level, OPT_Object owner); +export OPT_Struct OPT_NewStr (INT8 form, INT8 comp); +export void OPT_OpenScope (INT8 level, OPT_Object owner); static void OPT_OutConstant (OPT_Object obj); -static void OPT_OutFlds (OPT_Object fld, int32 adr, BOOLEAN visible); -static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, int32 adr); -static void OPT_OutMod (int16 mno); +static void OPT_OutFlds (OPT_Object fld, INT32 adr, BOOLEAN visible); +static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, INT32 adr); +static void OPT_OutMod (INT16 mno); static void OPT_OutName (CHAR *name, LONGINT name__len); static void OPT_OutObj (OPT_Object obj); static void OPT_OutSign (OPT_Struct result, OPT_Object par); static void OPT_OutStr (OPT_Struct typ); static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj); -export OPT_Struct OPT_SetType (int32 size); -export OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir); -export int32 OPT_SizeAlignment (int32 size); +export OPT_Struct OPT_SetType (INT32 size); +export OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INT16 dir); +export INT32 OPT_SizeAlignment (INT32 size); export void OPT_TypSize (OPT_Struct typ); -static void OPT_err (int16 n); +static void OPT_err (INT16 n); void OPT_InitRecno (void) @@ -172,14 +172,14 @@ void OPT_InitRecno (void) OPT_recno = 0; } -static void OPT_err (int16 n) +static void OPT_err (INT16 n) { OPM_err(n); } -int16 OPT_IntSize (int64 n) +INT16 OPT_IntSize (INT64 n) { - int16 bytes; + INT16 bytes; if (n < 0) { n = -(n + 1); } @@ -190,7 +190,7 @@ int16 OPT_IntSize (int64 n) return bytes; } -OPT_Struct OPT_IntType (int32 size) +OPT_Struct OPT_IntType (INT32 size) { if (size <= OPT_int8typ->size) { return OPT_int8typ; @@ -204,7 +204,7 @@ OPT_Struct OPT_IntType (int32 size) return OPT_int64typ; } -OPT_Struct OPT_SetType (int32 size) +OPT_Struct OPT_SetType (INT32 size) { if (size == OPT_set32typ->size) { return OPT_set32typ; @@ -212,9 +212,9 @@ OPT_Struct OPT_SetType (int32 size) return OPT_set64typ; } -OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir) +OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INT16 dir) { - int16 i; + INT16 i; __ASSERT(x->form == 4, 0); __ASSERT(x->BaseTyp == OPT_undftyp, 0); __ASSERT(dir == 1 || dir == -1, 0); @@ -244,7 +244,7 @@ OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir) __RETCHK; } -void OPT_Align (int32 *adr, int32 base) +void OPT_Align (INT32 *adr, INT32 base) { switch (base) { case 2: @@ -264,9 +264,9 @@ void OPT_Align (int32 *adr, int32 base) } } -int32 OPT_SizeAlignment (int32 size) +INT32 OPT_SizeAlignment (INT32 size) { - int32 alignment; + INT32 alignment; if (size < OPM_Alignment) { alignment = 1; while (alignment < size) { @@ -278,9 +278,9 @@ int32 OPT_SizeAlignment (int32 size) return alignment; } -int32 OPT_BaseAlignment (OPT_Struct typ) +INT32 OPT_BaseAlignment (OPT_Struct typ) { - int32 alignment; + INT32 alignment; if (typ->form == 13) { if (typ->comp == 4) { alignment = __MASK(typ->align, -65536); @@ -295,8 +295,8 @@ int32 OPT_BaseAlignment (OPT_Struct typ) void OPT_TypSize (OPT_Struct typ) { - int16 f, c; - int32 offset, size, base, fbase, off0; + INT16 f, c; + INT32 offset, size, base, fbase, off0; OPT_Object fld = NIL; OPT_Struct btyp = NIL; if (typ == OPT_undftyp) { @@ -339,7 +339,7 @@ void OPT_TypSize (OPT_Struct typ) } typ->size = offset; typ->align = base; - typ->sysflag = __MASK(typ->sysflag, -256) + (int16)__ASHL(offset - off0, 8); + typ->sysflag = __MASK(typ->sysflag, -256) + (INT16)__ASHL(offset - off0, 8); } else if (c == 2) { OPT_TypSize(typ->BaseTyp); typ->size = typ->n * typ->BaseTyp->size; @@ -378,7 +378,7 @@ OPT_Object OPT_NewObj (void) return obj; } -OPT_Struct OPT_NewStr (int8 form, int8 comp) +OPT_Struct OPT_NewStr (INT8 form, INT8 comp) { OPT_Struct typ = NIL; __NEW(typ, OPT_StrDesc); @@ -393,7 +393,7 @@ OPT_Struct OPT_NewStr (int8 form, int8 comp) return typ; } -OPT_Node OPT_NewNode (int8 class) +OPT_Node OPT_NewNode (INT8 class) { OPT_Node node = NIL; __NEW(node, OPT_NodeDesc); @@ -408,7 +408,7 @@ OPT_ConstExt OPT_NewExt (void) return ext; } -void OPT_OpenScope (int8 level, OPT_Object owner) +void OPT_OpenScope (INT8 level, OPT_Object owner) { OPT_Object head = NIL; head = OPT_NewObj(); @@ -429,7 +429,7 @@ void OPT_CloseScope (void) OPT_topScope = OPT_topScope->left; } -void OPT_Init (OPS_Name name, uint32 opt) +void OPT_Init (OPS_Name name, UINT32 opt) { OPT_topScope = OPT_universe; OPT_OpenScope(0, NIL); @@ -446,7 +446,7 @@ void OPT_Init (OPS_Name name, uint32 opt) void OPT_Close (void) { - int16 i; + INT16 i; OPT_CloseScope(); i = 0; while (i < 64) { @@ -538,7 +538,7 @@ void OPT_Insert (OPS_Name name, OPT_Object *obj) { OPT_Object ob0 = NIL, ob1 = NIL; BOOLEAN left; - int8 mnolev; + INT8 mnolev; ob0 = OPT_topScope; ob1 = ob0->right; left = 0; @@ -576,14 +576,14 @@ void OPT_Insert (OPS_Name name, OPT_Object *obj) *obj = ob1; } -static void OPT_FPrintName (int32 *fp, CHAR *name, LONGINT name__len) +static void OPT_FPrintName (INT32 *fp, CHAR *name, LONGINT name__len) { - int16 i; + INT16 i; CHAR ch; i = 0; do { ch = name[__X(i, name__len)]; - OPM_FPrint(&*fp, (int16)ch); + OPM_FPrint(&*fp, (INT16)ch); i += 1; } while (!(ch == 0x00)); } @@ -621,7 +621,7 @@ static void OPT_DebugStruct (OPT_Struct btyp) OPM_LogWLn(); } -static void OPT_FPrintSign (int32 *fp, OPT_Struct result, OPT_Object par) +static void OPT_FPrintSign (INT32 *fp, OPT_Struct result, OPT_Object par) { OPT_IdFPrint(result); OPM_FPrint(&*fp, result->idfp); @@ -637,8 +637,8 @@ void OPT_IdFPrint (OPT_Struct typ) { OPT_Struct btyp = NIL; OPT_Object strobj = NIL; - int32 idfp; - int16 f, c; + INT32 idfp; + INT16 f, c; if (!typ->idfpdone) { typ->idfpdone = 1; idfp = 0; @@ -667,17 +667,17 @@ void OPT_IdFPrint (OPT_Struct typ) } static struct FPrintStr__15 { - int32 *pbfp, *pvfp; + INT32 *pbfp, *pvfp; struct FPrintStr__15 *lnk; } *FPrintStr__15_s; -static void FPrintFlds__16 (OPT_Object fld, int32 adr, BOOLEAN visible); -static void FPrintHdFld__18 (OPT_Struct typ, OPT_Object fld, int32 adr); +static void FPrintFlds__16 (OPT_Object fld, INT32 adr, BOOLEAN visible); +static void FPrintHdFld__18 (OPT_Struct typ, OPT_Object fld, INT32 adr); static void FPrintTProcs__20 (OPT_Object obj); -static void FPrintHdFld__18 (OPT_Struct typ, OPT_Object fld, int32 adr) +static void FPrintHdFld__18 (OPT_Struct typ, OPT_Object fld, INT32 adr) { - int32 i, j, n; + INT32 i, j, n; OPT_Struct btyp = NIL; if (typ->comp == 4) { FPrintFlds__16(typ->link, adr, 0); @@ -707,7 +707,7 @@ static void FPrintHdFld__18 (OPT_Struct typ, OPT_Object fld, int32 adr) } } -static void FPrintFlds__16 (OPT_Object fld, int32 adr, BOOLEAN visible) +static void FPrintFlds__16 (OPT_Object fld, INT32 adr, BOOLEAN visible) { while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { @@ -742,10 +742,10 @@ static void FPrintTProcs__20 (OPT_Object obj) void OPT_FPrintStr (OPT_Struct typ) { - int16 f, c; + INT16 f, c; OPT_Struct btyp = NIL; OPT_Object strobj = NIL, bstrobj = NIL; - int32 pbfp, pvfp; + INT32 pbfp, pvfp; struct FPrintStr__15 _s; _s.pbfp = &pbfp; _s.pvfp = &pvfp; @@ -806,8 +806,8 @@ void OPT_FPrintStr (OPT_Struct typ) void OPT_FPrintObj (OPT_Object obj) { - int32 fprint; - int16 f, m; + INT32 fprint; + INT16 f, m; REAL rval; OPT_ConstExt ext = NIL; if (!obj->fpdone) { @@ -849,11 +849,11 @@ void OPT_FPrintObj (OPT_Object obj) } else if (obj->mode == 9) { OPT_FPrintSign(&fprint, obj->typ, obj->link); ext = obj->conval->ext; - m = (int16)(*ext)[0]; + m = (INT16)(*ext)[0]; f = 1; OPM_FPrint(&fprint, m); while (f <= m) { - OPM_FPrint(&fprint, (int16)(*ext)[__X(f, 256)]); + OPM_FPrint(&fprint, (INT16)(*ext)[__X(f, 256)]); f += 1; } } else if (obj->mode == 5) { @@ -864,9 +864,9 @@ void OPT_FPrintObj (OPT_Object obj) } } -void OPT_FPrintErr (OPT_Object obj, int16 errcode) +void OPT_FPrintErr (OPT_Object obj, INT16 errcode) { - int16 i, j; + INT16 i, j; CHAR ch; if (obj->mnolev != 0) { __COPY(OPT_GlbMod[__X(-obj->mnolev, 64)]->name, OPM_objname, 64); @@ -956,7 +956,7 @@ void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old) static void OPT_InName (CHAR *name, LONGINT name__len) { - int16 i; + INT16 i; CHAR ch; i = 0; do { @@ -966,12 +966,12 @@ static void OPT_InName (CHAR *name, LONGINT name__len) } while (!(ch == 0x00)); } -static void OPT_InMod (int8 *mno) +static void OPT_InMod (INT8 *mno) { OPT_Object head = NIL; OPS_Name name; - int32 mn; - int8 i; + INT32 mn; + INT8 i; mn = OPM_SymRInt(); if (mn == 0) { *mno = OPT_impCtxt.glbmno[0]; @@ -1008,16 +1008,16 @@ static void OPT_InMod (int8 *mno) } } -static void OPT_InConstant (int32 f, OPT_Const conval) +static void OPT_InConstant (INT32 f, OPT_Const conval) { CHAR ch; - int16 i; + INT16 i; OPT_ConstExt ext = NIL; REAL rval; switch (f) { case 1: case 3: case 2: OPM_SymRCh(&ch); - conval->intval = (int16)ch; + conval->intval = (INT16)ch; break; case 4: conval->intval = OPM_SymRInt(); @@ -1057,10 +1057,10 @@ static void OPT_InConstant (int32 f, OPT_Const conval) } } -static void OPT_InSign (int8 mno, OPT_Struct *res, OPT_Object *par) +static void OPT_InSign (INT8 mno, OPT_Struct *res, OPT_Object *par) { OPT_Object last = NIL, new = NIL; - int32 tag; + INT32 tag; OPT_InStruct(&*res); tag = OPM_SymRInt(); last = NIL; @@ -1087,7 +1087,7 @@ static void OPT_InSign (int8 mno, OPT_Struct *res, OPT_Object *par) static OPT_Object OPT_InFld (void) { - int32 tag; + INT32 tag; OPT_Object obj = NIL; tag = OPT_impCtxt.nextTag; obj = OPT_NewObj(); @@ -1115,9 +1115,9 @@ static OPT_Object OPT_InFld (void) return obj; } -static OPT_Object OPT_InTProc (int8 mno) +static OPT_Object OPT_InTProc (INT8 mno) { - int32 tag; + INT32 tag; OPT_Object obj = NIL; tag = OPT_impCtxt.nextTag; obj = OPT_NewObj(); @@ -1141,7 +1141,7 @@ static OPT_Object OPT_InTProc (int8 mno) return obj; } -static OPT_Struct OPT_InTyp (int32 tag) +static OPT_Struct OPT_InTyp (INT32 tag) { if (tag == 4) { return OPT_IntType(OPM_SymRInt()); @@ -1155,9 +1155,9 @@ static OPT_Struct OPT_InTyp (int32 tag) static void OPT_InStruct (OPT_Struct *typ) { - int8 mno; - int16 ref; - int32 tag; + INT8 mno; + INT16 ref; + INT32 tag; OPS_Name name; OPT_Struct t = NIL; OPT_Object obj = NIL, last = NIL, fld = NIL, old = NIL, dummy = NIL; @@ -1213,7 +1213,7 @@ static void OPT_InStruct (OPT_Struct *typ) obj->vis = 0; tag = OPM_SymRInt(); if (tag == 35) { - (*typ)->sysflag = (int16)OPM_SymRInt(); + (*typ)->sysflag = (INT16)OPM_SymRInt(); tag = OPM_SymRInt(); } switch (tag) { @@ -1335,13 +1335,13 @@ static void OPT_InStruct (OPT_Struct *typ) } } -static OPT_Object OPT_InObj (int8 mno) +static OPT_Object OPT_InObj (INT8 mno) { - int16 i, s; + INT16 i, s; CHAR ch; OPT_Object obj = NIL, old = NIL; OPT_Struct typ = NIL; - int32 tag; + INT32 tag; OPT_ConstExt ext = NIL; tag = OPT_impCtxt.nextTag; if (tag == 19) { @@ -1374,7 +1374,7 @@ static OPT_Object OPT_InObj (int8 mno) obj->mode = 9; ext = OPT_NewExt(); obj->conval->ext = ext; - s = (int16)OPM_SymRInt(); + s = (INT16)OPM_SymRInt(); (*ext)[0] = (CHAR)s; i = 1; while (i <= s) { @@ -1439,7 +1439,7 @@ static OPT_Object OPT_InObj (int8 mno) void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) { OPT_Object obj = NIL; - int8 mno; + INT8 mno; OPS_Name aliasName__copy; __DUPARR(aliasName, OPS_Name); if (__STRCMP(name, "SYSTEM") == 0) { @@ -1482,7 +1482,7 @@ void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) static void OPT_OutName (CHAR *name, LONGINT name__len) { - int16 i; + INT16 i; CHAR ch; i = 0; do { @@ -1492,7 +1492,7 @@ static void OPT_OutName (CHAR *name, LONGINT name__len) } while (!(ch == 0x00)); } -static void OPT_OutMod (int16 mno) +static void OPT_OutMod (INT16 mno) { if (OPT_expCtxt.locmno[__X(mno, 64)] < 0) { OPM_SymWInt(16); @@ -1504,9 +1504,9 @@ static void OPT_OutMod (int16 mno) } } -static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, int32 adr) +static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, INT32 adr) { - int32 i, j, n; + INT32 i, j, n; OPT_Struct btyp = NIL; if (typ->comp == 4) { OPT_OutFlds(typ->link, adr, 0); @@ -1536,7 +1536,7 @@ static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, int32 adr) } } -static void OPT_OutFlds (OPT_Object fld, int32 adr, BOOLEAN visible) +static void OPT_OutFlds (OPT_Object fld, INT32 adr, BOOLEAN visible) { while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { @@ -1691,7 +1691,7 @@ static void OPT_OutStr (OPT_Struct typ) static void OPT_OutConstant (OPT_Object obj) { - int16 f; + INT16 f; REAL rval; f = obj->typ->form; OPM_SymWInt(f); @@ -1727,7 +1727,7 @@ static void OPT_OutConstant (OPT_Object obj) static void OPT_OutObj (OPT_Object obj) { - int16 i, j; + INT16 i, j; OPT_ConstExt ext = NIL; if (obj != NIL) { OPT_OutObj(obj->left); @@ -1794,7 +1794,7 @@ static void OPT_OutObj (OPT_Object obj) OPM_SymWInt(33); OPT_OutSign(obj->typ, obj->link); ext = obj->conval->ext; - j = (int16)(*ext)[0]; + j = (INT16)(*ext)[0]; i = 1; OPM_SymWInt(j); while (i <= j) { @@ -1817,8 +1817,8 @@ static void OPT_OutObj (OPT_Object obj) void OPT_Export (BOOLEAN *ext, BOOLEAN *new) { - int16 i; - int8 nofmod; + INT16 i; + INT8 nofmod; BOOLEAN done; OPT_symExtended = 0; OPT_symNew = 0; @@ -1857,7 +1857,7 @@ void OPT_Export (BOOLEAN *ext, BOOLEAN *new) } } -static void OPT_InitStruct (OPT_Struct *typ, int8 form) +static void OPT_InitStruct (OPT_Struct *typ, INT8 form) { *typ = OPT_NewStr(form, 1); (*typ)->ref = form; @@ -1871,7 +1871,7 @@ static void OPT_InitStruct (OPT_Struct *typ, int8 form) (*typ)->idfpdone = 1; } -static void OPT_EnterBoolConst (OPS_Name name, int32 value) +static void OPT_EnterBoolConst (OPS_Name name, INT32 value) { OPT_Object obj = NIL; OPS_Name name__copy; @@ -1883,7 +1883,7 @@ static void OPT_EnterBoolConst (OPS_Name name, int32 value) obj->conval->intval = value; } -static void OPT_EnterTyp (OPS_Name name, int8 form, int16 size, OPT_Struct *res) +static void OPT_EnterTyp (OPS_Name name, INT8 form, INT16 size, OPT_Struct *res) { OPT_Object obj = NIL; OPT_Struct typ = NIL; @@ -1918,7 +1918,7 @@ static void OPT_EnterTypeAlias (OPS_Name name, OPT_Object *res) *res = obj; } -static void OPT_EnterProc (OPS_Name name, int16 num) +static void OPT_EnterProc (OPS_Name name, INT16 num) { OPT_Object obj = NIL; OPS_Name name__copy; diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index 38cd17c7..66f25d3d 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h @@ -15,9 +15,9 @@ typedef typedef struct OPT_ConstDesc { OPT_ConstExt ext; - int64 intval; - int32 intval2; - uint64 setval; + INT64 intval; + INT32 intval2; + UINT64 setval; LONGREAL realval; } OPT_ConstDesc; @@ -33,7 +33,7 @@ typedef typedef struct OPT_NodeDesc { OPT_Node left, right, link; - int8 class, subcl; + INT8 class, subcl; BOOLEAN readonly; OPT_Struct typ; OPT_Object obj; @@ -45,20 +45,20 @@ typedef OPT_Object left, right, link, scope; OPS_Name name; BOOLEAN leaf; - int8 mode, mnolev, vis, history; + INT8 mode, mnolev, vis, history; BOOLEAN used, fpdone; - int32 fprint; + INT32 fprint; OPT_Struct typ; OPT_Const conval; - int32 adr, linkadr; - int16 x; + INT32 adr, linkadr; + INT16 x; } OPT_ObjDesc; typedef struct OPT_StrDesc { - int8 form, comp, mno, extlev; - int16 ref, sysflag; - int32 n, size, align, txtpos; + INT8 form, comp, mno, extlev; + INT16 ref, sysflag; + INT32 n, size, align, txtpos; BOOLEAN allocated, pbused, pvused; char _prvt0[16]; OPT_Struct BaseTyp; @@ -69,22 +69,22 @@ typedef import OPT_Object OPT_topScope; import OPT_Struct OPT_undftyp, OPT_niltyp, OPT_notyp, OPT_bytetyp, OPT_cpbytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_settyp, OPT_set32typ, OPT_set64typ, OPT_realtyp, OPT_lrltyp, OPT_stringtyp, OPT_adrtyp, OPT_sysptrtyp; import OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj, OPT_setobj; -import int8 OPT_nofGmod; +import INT8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; import BOOLEAN OPT_SYSimported; -import address *OPT_ConstDesc__typ; -import address *OPT_ObjDesc__typ; -import address *OPT_StrDesc__typ; -import address *OPT_NodeDesc__typ; +import ADDRESS *OPT_ConstDesc__typ; +import ADDRESS *OPT_ObjDesc__typ; +import ADDRESS *OPT_StrDesc__typ; +import ADDRESS *OPT_NodeDesc__typ; -import void OPT_Align (int32 *adr, int32 base); -import int32 OPT_BaseAlignment (OPT_Struct typ); +import void OPT_Align (INT32 *adr, INT32 base); +import INT32 OPT_BaseAlignment (OPT_Struct typ); import void OPT_Close (void); import void OPT_CloseScope (void); import void OPT_Export (BOOLEAN *ext, BOOLEAN *new); -import void OPT_FPrintErr (OPT_Object obj, int16 errcode); +import void OPT_FPrintErr (OPT_Object obj, INT16 errcode); import void OPT_FPrintObj (OPT_Object obj); import void OPT_FPrintStr (OPT_Struct typ); import void OPT_Find (OPT_Object *res); @@ -92,21 +92,21 @@ import void OPT_FindField (OPS_Name name, OPT_Struct typ, OPT_Object *res); import void OPT_FindImport (OPT_Object mod, OPT_Object *res); import void OPT_IdFPrint (OPT_Struct typ); import void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); -import void OPT_Init (OPS_Name name, uint32 opt); +import void OPT_Init (OPS_Name name, UINT32 opt); import void OPT_InitRecno (void); import void OPT_Insert (OPS_Name name, OPT_Object *obj); import void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); -import int16 OPT_IntSize (int64 n); -import OPT_Struct OPT_IntType (int32 size); +import INT16 OPT_IntSize (INT64 n); +import OPT_Struct OPT_IntType (INT32 size); import OPT_Const OPT_NewConst (void); import OPT_ConstExt OPT_NewExt (void); -import OPT_Node OPT_NewNode (int8 class); +import OPT_Node OPT_NewNode (INT8 class); import OPT_Object OPT_NewObj (void); -import OPT_Struct OPT_NewStr (int8 form, int8 comp); -import void OPT_OpenScope (int8 level, OPT_Object owner); -import OPT_Struct OPT_SetType (int32 size); -import OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir); -import int32 OPT_SizeAlignment (int32 size); +import OPT_Struct OPT_NewStr (INT8 form, INT8 comp); +import void OPT_OpenScope (INT8 level, OPT_Object owner); +import OPT_Struct OPT_SetType (INT32 size); +import OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INT16 dir); +import INT32 OPT_SizeAlignment (INT32 size); import void OPT_TypSize (OPT_Struct typ); import void *OPT__init(void); diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index f44318ed..8854dd67 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "OPC.h" @@ -13,42 +13,42 @@ typedef struct OPV_ExitInfo { - int16 level, label; + INT16 level, label; } OPV_ExitInfo; -static int16 OPV_stamp; +static INT16 OPV_stamp; static OPV_ExitInfo OPV_exit; -static int16 OPV_nofExitLabels; +static INT16 OPV_nofExitLabels; -export address *OPV_ExitInfo__typ; +export ADDRESS *OPV_ExitInfo__typ; static void OPV_ActualPar (OPT_Node n, OPT_Object fp); export void OPV_AdrAndSize (OPT_Object topScope); static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc); -static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int16 prec); +static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INT16 prec); static void OPV_DefineTDescs (OPT_Node n); -static void OPV_Entier (OPT_Node n, int16 prec); +static void OPV_Entier (OPT_Node n, INT16 prec); static void OPV_GetTProcNum (OPT_Object obj); static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc); static BOOLEAN OPV_ImplicitReturn (OPT_Node n); -static void OPV_Index (OPT_Node n, OPT_Node d, int16 prec, int16 dim); +static void OPV_Index (OPT_Node n, OPT_Node d, INT16 prec, INT16 dim); export void OPV_Init (void); static void OPV_InitTDescs (OPT_Node n); -static void OPV_Len (OPT_Node n, int64 dim); +static void OPV_Len (OPT_Node n, INT64 dim); export void OPV_Module (OPT_Node prog); static void OPV_NewArr (OPT_Node d, OPT_Node x); -static void OPV_ParIntLiteral (int64 n, int32 size); -static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp); +static void OPV_ParIntLiteral (INT64 n, INT32 size); +static INT16 OPV_Precedence (INT16 class, INT16 subclass, INT16 form, INT16 comp); static BOOLEAN OPV_SideEffects (OPT_Node n); -static void OPV_SizeCast (OPT_Node n, int32 to); +static void OPV_SizeCast (OPT_Node n, INT32 to); static void OPV_Stamp (OPS_Name s); static OPT_Object OPV_SuperProc (OPT_Node n); static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported); static void OPV_TraverseRecord (OPT_Struct typ); static void OPV_TypeOf (OPT_Node n); -static void OPV_design (OPT_Node n, int16 prec); -static void OPV_expr (OPT_Node n, int16 prec); +static void OPV_design (OPT_Node n, INT16 prec); +static void OPV_expr (OPT_Node n, INT16 prec); static void OPV_stat (OPT_Node n, OPT_Object outerProc); @@ -60,7 +60,7 @@ void OPV_Init (void) static void OPV_GetTProcNum (OPT_Object obj) { - int32 oldPos; + INT32 oldPos; OPT_Struct typ = NIL; OPT_Object redef = NIL; oldPos = OPM_errpos; @@ -96,7 +96,7 @@ static void OPV_TraverseRecord (OPT_Struct typ) static void OPV_Stamp (OPS_Name s) { - int16 i, j, k; + INT16 i, j, k; CHAR n[10]; OPV_stamp += 1; i = 0; @@ -126,7 +126,7 @@ static void OPV_Stamp (OPS_Name s) static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported) { - int16 mode; + INT16 mode; OPT_Object scope = NIL; OPT_Struct typ = NIL; if (obj != NIL) { @@ -205,7 +205,7 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_sysptrtyp->strobj->linkadr = 2; } -static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp) +static INT16 OPV_Precedence (INT16 class, INT16 subclass, INT16 form, INT16 comp) { switch (class) { case 7: case 0: case 2: case 4: case 9: @@ -315,7 +315,7 @@ static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp __RETCHK; } -static void OPV_Len (OPT_Node n, int64 dim) +static void OPV_Len (OPT_Node n, INT64 dim) { while ((n->class == 4 && n->typ->comp == 3)) { dim += 1; @@ -341,7 +341,7 @@ static BOOLEAN OPV_SideEffects (OPT_Node n) __RETCHK; } -static void OPV_Entier (OPT_Node n, int16 prec) +static void OPV_Entier (OPT_Node n, INT16 prec) { if (__IN(n->typ->form, 0x60, 32)) { OPM_WriteString((CHAR*)"__ENTIER(", 10); @@ -352,7 +352,7 @@ static void OPV_Entier (OPT_Node n, int16 prec) } } -static void OPV_SizeCast (OPT_Node n, int32 to) +static void OPV_SizeCast (OPT_Node n, INT32 to) { if ((to < n->typ->size && __IN(2, OPM_Options, 32))) { OPM_WriteString((CHAR*)"__SHORT", 8); @@ -366,16 +366,16 @@ static void OPV_SizeCast (OPT_Node n, int32 to) OPM_Write(')'); } else { if ((n->typ->size != to && (n->typ->size > 4 || to != 4))) { - OPM_WriteString((CHAR*)"(int", 5); + OPM_WriteString((CHAR*)"(INT", 5); OPM_WriteInt(__ASHL(to, 3)); OPM_WriteString((CHAR*)")", 2); } } } -static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int16 prec) +static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INT16 prec) { - int16 from, to; + INT16 from, to; from = n->typ->form; to = newtype->form; if (to == 7) { @@ -432,7 +432,7 @@ static void OPV_TypeOf (OPT_Node n) } } -static void OPV_Index (OPT_Node n, OPT_Node d, int16 prec, int16 dim) +static void OPV_Index (OPT_Node n, OPT_Node d, INT16 prec, INT16 dim) { if (!__IN(0, OPM_Options, 32) || (n->right->class == 7 && (n->right->conval->intval == 0 || n->left->typ->comp != 3))) { OPV_expr(n->right, prec); @@ -449,18 +449,18 @@ static void OPV_Index (OPT_Node n, OPT_Node d, int16 prec, int16 dim) } } -static void OPV_design (OPT_Node n, int16 prec) +static void OPV_design (OPT_Node n, INT16 prec) { OPT_Object obj = NIL; OPT_Struct typ = NIL; - int16 class, designPrec, comp; + INT16 class, designPrec, comp; OPT_Node d = NIL, x = NIL; - int16 dims, i, _for__26; + INT16 dims, i, _for__26; comp = n->typ->comp; obj = n->obj; class = n->class; designPrec = OPV_Precedence(class, n->subcl, n->typ->form, comp); - if ((((((class == 0 && obj->mnolev > 0)) && (int16)obj->mnolev != OPM_level)) && prec == 10)) { + if ((((((class == 0 && obj->mnolev > 0)) && (INT16)obj->mnolev != OPM_level)) && prec == 10)) { designPrec = 9; } if (prec > designPrec) { @@ -559,7 +559,7 @@ static void OPV_design (OPT_Node n, int16 prec) if (__IN(3, OPM_Options, 32)) { if (typ->comp == 4) { OPM_WriteString((CHAR*)"__GUARDR(", 10); - if ((int16)obj->mnolev != OPM_level) { + if ((INT16)obj->mnolev != OPM_level) { OPM_WriteStringVar((void*)obj->scope->name, 256); OPM_WriteString((CHAR*)"__curr->", 9); OPC_Ident(obj); @@ -628,7 +628,7 @@ static void OPV_design (OPT_Node n, int16 prec) } } -static void OPV_ParIntLiteral (int64 n, int32 size) +static void OPV_ParIntLiteral (INT64 n, INT32 size) { OPM_WriteInt(n); } @@ -636,7 +636,7 @@ static void OPV_ParIntLiteral (int64 n, int32 size) static void OPV_ActualPar (OPT_Node n, OPT_Object fp) { OPT_Struct typ = NIL, aptyp = NIL; - int16 comp, form, mode, prec, dim; + INT16 comp, form, mode, prec, dim; OPM_Write('('); while (n != NIL) { typ = fp->typ; @@ -726,9 +726,9 @@ static OPT_Object OPV_SuperProc (OPT_Node n) return obj; } -static void OPV_expr (OPT_Node n, int16 prec) +static void OPV_expr (OPT_Node n, INT16 prec) { - int16 class, subclass, form, exprPrec; + INT16 class, subclass, form, exprPrec; OPT_Struct typ = NIL; OPT_Node l = NIL, r = NIL; OPT_Object proc = NIL; @@ -1050,7 +1050,7 @@ static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) OPT_Node if_ = NIL; OPT_Object obj = NIL; OPT_Struct typ = NIL; - int32 adr; + INT32 adr; if_ = n->left; while (if_ != NIL) { OPM_WriteString((CHAR*)"if ", 4); @@ -1100,8 +1100,8 @@ static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc) { OPT_Node switchCase = NIL, label = NIL; - int64 low, high; - int16 form, i; + INT64 low, high; + INT16 form, i; OPM_WriteString((CHAR*)"switch ", 8); OPV_expr(n->left, 12); OPM_Write(' '); @@ -1166,7 +1166,7 @@ static BOOLEAN OPV_ImplicitReturn (OPT_Node n) static void OPV_NewArr (OPT_Node d, OPT_Node x) { OPT_Struct typ = NIL, base = NIL; - int16 nofdim, nofdyn; + INT16 nofdim, nofdyn; typ = d->typ->BaseTyp; base = typ; nofdim = 0; diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index 2fa9186d..513d8dfa 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Out.c b/bootstrap/unix-48/Out.c index 0f0b9f79..04b1e484 100644 --- a/bootstrap/unix-48/Out.c +++ b/bootstrap/unix-48/Out.c @@ -1,37 +1,37 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "Platform.h" static CHAR Out_buf[128]; -static int16 Out_in; +static INT16 Out_in; export void Out_Char (CHAR ch); export void Out_Flush (void); -export void Out_Int (int64 x, int64 n); -static int32 Out_Length (CHAR *s, LONGINT s__len); +export void Out_Int (INT64 x, INT64 n); +static INT32 Out_Length (CHAR *s, LONGINT s__len); export void Out_Ln (void); -export void Out_LongReal (LONGREAL x, int16 n); +export void Out_LongReal (LONGREAL x, INT16 n); export void Out_Open (void); -export void Out_Real (REAL x, int16 n); -static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_); +export void Out_Real (REAL x, INT16 n); +static void Out_RealP (LONGREAL x, INT16 n, BOOLEAN long_); export void Out_String (CHAR *str, LONGINT str__len); -export LONGREAL Out_Ten (int16 e); -static void Out_digit (int64 n, CHAR *s, LONGINT s__len, int16 *i); -static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16 *i); +export LONGREAL Out_Ten (INT16 e); +static void Out_digit (INT64 n, CHAR *s, LONGINT s__len, INT16 *i); +static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, INT16 *i); #define Out_Entier64(x) (int64)(x) void Out_Flush (void) { - int16 error; + INT16 error; if (Out_in > 0) { error = Platform_Write(1, (address)Out_buf, Out_in); } @@ -54,9 +54,9 @@ void Out_Char (CHAR ch) } } -static int32 Out_Length (CHAR *s, LONGINT s__len) +static INT32 Out_Length (CHAR *s, LONGINT s__len) { - int32 l; + INT32 l; l = 0; while ((l < s__len && s[__X(l, s__len)] != 0x00)) { l += 1; @@ -66,8 +66,8 @@ static int32 Out_Length (CHAR *s, LONGINT s__len) void Out_String (CHAR *str, LONGINT str__len) { - int32 l; - int16 error; + INT32 l; + INT16 error; __DUP(str, str__len, CHAR); l = Out_Length((void*)str, str__len); if (Out_in + l > 128) { @@ -77,15 +77,15 @@ void Out_String (CHAR *str, LONGINT str__len) error = Platform_Write(1, (address)str, l); } else { __MOVE((address)str, (address)&Out_buf[__X(Out_in, 128)], l); - Out_in += (int16)l; + Out_in += (INT16)l; } __DEL(str); } -void Out_Int (int64 x, int64 n) +void Out_Int (INT64 x, INT64 n) { CHAR s[22]; - int16 i; + INT16 i; BOOLEAN negative; negative = x < 0; if (x == (-9223372036854775807-1)) { @@ -108,7 +108,7 @@ void Out_Int (int64 x, int64 n) s[__X(i, 22)] = '-'; i += 1; } - while (n > (int64)i) { + while (n > (INT64)i) { Out_Char(' '); n -= 1; } @@ -124,22 +124,22 @@ void Out_Ln (void) Out_Flush(); } -static void Out_digit (int64 n, CHAR *s, LONGINT s__len, int16 *i) +static void Out_digit (INT64 n, CHAR *s, LONGINT s__len, INT16 *i) { *i -= 1; s[__X(*i, s__len)] = (CHAR)(__MOD(n, 10) + 48); } -static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16 *i) +static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, INT16 *i) { - int16 j; - int32 l; + INT16 j; + INT32 l; __DUP(t, t__len, CHAR); l = Out_Length((void*)t, t__len); if (l > *i) { l = *i; } - *i -= (int16)l; + *i -= (INT16)l; j = 0; while (j < l) { s[__X(*i + j, s__len)] = t[__X(j, t__len)]; @@ -148,7 +148,7 @@ static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16 __DEL(t); } -LONGREAL Out_Ten (int16 e) +LONGREAL Out_Ten (INT16 e) { LONGREAL r, power; r = (LONGREAL)1; @@ -163,19 +163,19 @@ LONGREAL Out_Ten (int16 e) return r; } -static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_) +static void Out_RealP (LONGREAL x, INT16 n, BOOLEAN long_) { - int16 e; - int64 f; + INT16 e; + INT64 f; CHAR s[30]; - int16 i, el; + INT16 i, el; LONGREAL x0; BOOLEAN nn, en; - int64 m; - int16 d, dr; - e = (int16)__MASK(__ASHR((__VAL(int64, x)), 52), -2048); - f = __MASK((__VAL(int64, x)), -4503599627370496); - nn = (__VAL(int64, x) < 0 && !((e == 2047 && f != 0))); + INT64 m; + INT16 d, dr; + e = (INT16)__MASK(__ASHR((__VAL(INT64, x)), 52), -2048); + f = __MASK((__VAL(INT64, x)), -4503599627370496); + nn = (__VAL(INT64, x) < 0 && !((e == 2047 && f != 0))); if (nn) { n -= 1; } @@ -221,7 +221,7 @@ static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_) if (nn) { x = -x; } - e = (int16)__ASHR((e - 1023) * 77, 8); + e = (INT16)__ASHR((e - 1023) * 77, 8); if (e >= 0) { x = x / (LONGREAL)Out_Ten(e); } else { @@ -291,12 +291,12 @@ static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_) } } -void Out_Real (REAL x, int16 n) +void Out_Real (REAL x, INT16 n) { Out_RealP(x, n, 0); } -void Out_LongReal (LONGREAL x, int16 n) +void Out_LongReal (LONGREAL x, INT16 n) { Out_RealP(x, n, 1); } diff --git a/bootstrap/unix-48/Out.h b/bootstrap/unix-48/Out.h index fbaed75f..a685b291 100644 --- a/bootstrap/unix-48/Out.h +++ b/bootstrap/unix-48/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h @@ -10,13 +10,13 @@ import void Out_Char (CHAR ch); import void Out_Flush (void); -import void Out_Int (int64 x, int64 n); +import void Out_Int (INT64 x, INT64 n); import void Out_Ln (void); -import void Out_LongReal (LONGREAL x, int16 n); +import void Out_LongReal (LONGREAL x, INT16 n); import void Out_Open (void); -import void Out_Real (REAL x, int16 n); +import void Out_Real (REAL x, INT16 n); import void Out_String (CHAR *str, LONGINT str__len); -import LONGREAL Out_Ten (int16 e); +import LONGREAL Out_Ten (INT16 e); import void *Out__init(void); diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 5c021003..f130d638 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" @@ -14,92 +14,92 @@ typedef Platform_ArgPtr (*Platform_ArgVec)[1024]; typedef - int32 (*Platform_ArgVecPtr)[1]; + INT32 (*Platform_ArgVecPtr)[1]; typedef CHAR (*Platform_EnvPtr)[1024]; typedef struct Platform_FileIdentity { - int32 volume, index, mtime; + INT32 volume, index, mtime; } Platform_FileIdentity; typedef - void (*Platform_HaltProcedure)(int32); + void (*Platform_HaltProcedure)(INT32); typedef - void (*Platform_SignalHandler)(int32); + void (*Platform_SignalHandler)(INT32); export BOOLEAN Platform_LittleEndian; -export int32 Platform_MainStackFrame; -export int32 Platform_HaltCode; -export int16 Platform_PID; +export INT32 Platform_MainStackFrame; +export INT32 Platform_HaltCode; +export INT16 Platform_PID; export CHAR Platform_CWD[256]; -export int16 Platform_ArgCount; -export int32 Platform_ArgVector; +export INT16 Platform_ArgCount; +export INT32 Platform_ArgVector; static Platform_HaltProcedure Platform_HaltHandler; -static int32 Platform_TimeStart; -export int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; +static INT32 Platform_TimeStart; +export INT16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; export CHAR Platform_NL[3]; -export address *Platform_FileIdentity__typ; +export ADDRESS *Platform_FileIdentity__typ; -export BOOLEAN Platform_Absent (int16 e); -export int16 Platform_ArgPos (CHAR *s, LONGINT s__len); -export void Platform_AssertFail (int32 code); -export int16 Platform_Chdir (CHAR *n, LONGINT n__len); -export int16 Platform_Close (int32 h); -export BOOLEAN Platform_ConnectionFailed (int16 e); -export void Platform_Delay (int32 ms); -export BOOLEAN Platform_DifferentFilesystems (int16 e); -static void Platform_DisplayHaltCode (int32 code); -export int16 Platform_Error (void); -export void Platform_Exit (int16 code); -export void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len); -export void Platform_GetClock (int32 *t, int32 *d); +export BOOLEAN Platform_Absent (INT16 e); +export INT16 Platform_ArgPos (CHAR *s, LONGINT s__len); +export void Platform_AssertFail (INT32 code); +export INT16 Platform_Chdir (CHAR *n, LONGINT n__len); +export INT16 Platform_Close (INT32 h); +export BOOLEAN Platform_ConnectionFailed (INT16 e); +export void Platform_Delay (INT32 ms); +export BOOLEAN Platform_DifferentFilesystems (INT16 e); +static void Platform_DisplayHaltCode (INT32 code); +export INT16 Platform_Error (void); +export void Platform_Exit (INT16 code); +export void Platform_GetArg (INT16 n, CHAR *val, LONGINT val__len); +export void Platform_GetClock (INT32 *t, INT32 *d); export void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); -export void Platform_GetIntArg (int16 n, int32 *val); -export void Platform_GetTimeOfDay (int32 *sec, int32 *usec); -export void Platform_Halt (int32 code); -export int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ); -export int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); -export BOOLEAN Platform_Inaccessible (int16 e); -export void Platform_Init (int32 argc, int32 argvadr); -export BOOLEAN Platform_Interrupted (int16 e); -export void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); -export int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); -export BOOLEAN Platform_NoSuchDirectory (int16 e); -export int32 Platform_OSAllocate (int32 size); -export void Platform_OSFree (int32 address); -export int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); -export int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); -export int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n); -export int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n); -export int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); +export void Platform_GetIntArg (INT16 n, INT32 *val); +export void Platform_GetTimeOfDay (INT32 *sec, INT32 *usec); +export void Platform_Halt (INT32 code); +export INT16 Platform_Identify (INT32 h, Platform_FileIdentity *identity, ADDRESS *identity__typ); +export INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ); +export BOOLEAN Platform_Inaccessible (INT16 e); +export void Platform_Init (INT32 argc, INT32 argvadr); +export BOOLEAN Platform_Interrupted (INT16 e); +export void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d); +export INT16 Platform_New (CHAR *n, LONGINT n__len, INT32 *h); +export BOOLEAN Platform_NoSuchDirectory (INT16 e); +export INT32 Platform_OSAllocate (INT32 size); +export void Platform_OSFree (INT32 address); +export INT16 Platform_OldRO (CHAR *n, LONGINT n__len, INT32 *h); +export INT16 Platform_OldRW (CHAR *n, LONGINT n__len, INT32 *h); +export INT16 Platform_Read (INT32 h, INT32 p, INT32 l, INT32 *n); +export INT16 Platform_ReadBuf (INT32 h, SYSTEM_BYTE *b, LONGINT b__len, INT32 *n); +export INT16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); export BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); export BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); -export int16 Platform_Seek (int32 h, int32 offset, int16 whence); +export INT16 Platform_Seek (INT32 h, INT32 offset, INT16 whence); export void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); export void Platform_SetHalt (Platform_HaltProcedure p); export void Platform_SetInterruptHandler (Platform_SignalHandler handler); -export void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Platform_FileIdentity source); +export void Platform_SetMTime (Platform_FileIdentity *target, ADDRESS *target__typ, Platform_FileIdentity source); export void Platform_SetQuitHandler (Platform_SignalHandler handler); -export int16 Platform_Size (int32 h, int32 *l); -export int16 Platform_Sync (int32 h); -export int16 Platform_System (CHAR *cmd, LONGINT cmd__len); +export INT16 Platform_Size (INT32 h, INT32 *l); +export INT16 Platform_Sync (INT32 h); +export INT16 Platform_System (CHAR *cmd, LONGINT cmd__len); static void Platform_TestLittleEndian (void); -export int32 Platform_Time (void); -export BOOLEAN Platform_TimedOut (int16 e); -export BOOLEAN Platform_TooManyFiles (int16 e); -export int16 Platform_Truncate (int32 h, int32 l); -export int16 Platform_Unlink (CHAR *n, LONGINT n__len); -export int16 Platform_Write (int32 h, int32 p, int32 l); -static void Platform_YMDHMStoClock (int32 ye, int32 mo, int32 da, int32 ho, int32 mi, int32 se, int32 *t, int32 *d); +export INT32 Platform_Time (void); +export BOOLEAN Platform_TimedOut (INT16 e); +export BOOLEAN Platform_TooManyFiles (INT16 e); +export INT16 Platform_Truncate (INT32 h, INT32 l); +export INT16 Platform_Unlink (CHAR *n, LONGINT n__len); +export INT16 Platform_Write (INT32 h, INT32 p, INT32 l); +static void Platform_YMDHMStoClock (INT32 ye, INT32 mo, INT32 da, INT32 ho, INT32 mi, INT32 se, INT32 *t, INT32 *d); static void Platform_errch (CHAR c); -static void Platform_errint (int32 l); +static void Platform_errint (INT32 l); static void Platform_errln (void); -static void Platform_errposint (int32 l); +static void Platform_errposint (INT32 l); export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); #include @@ -127,7 +127,7 @@ export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT #define Platform_EXDEV() EXDEV extern void Heap_InitHeap(); #define Platform_HeapInitHeap() Heap_InitHeap() -#define Platform_allocate(size) (address)((void*)malloc((size_t)size)) +#define Platform_allocate(size) (ADDRESS)((void*)malloc((size_t)size)) #define Platform_chdir(n, n__len) chdir((char*)n) #define Platform_closefile(fd) close(fd) #define Platform_err() errno @@ -147,13 +147,13 @@ extern void Heap_InitHeap(); #define Platform_opennew(n, n__len) open((char*)n, O_CREAT | O_TRUNC | O_RDWR, 0664) #define Platform_openro(n, n__len) open((char*)n, O_RDONLY) #define Platform_openrw(n, n__len) open((char*)n, O_RDWR) -#define Platform_readfile(fd, p, l) (LONGINT)read(fd, (void*)(address)(p), l) +#define Platform_readfile(fd, p, l) (LONGINT)read(fd, (void*)(ADDRESS)(p), l) #define Platform_rename(o, o__len, n, n__len) rename((char*)o, (char*)n) #define Platform_sectotm(s) struct tm *time = localtime((time_t*)&s) #define Platform_seekcur() SEEK_CUR #define Platform_seekend() SEEK_END #define Platform_seekset() SEEK_SET -#define Platform_sethandler(s, h) SystemSetHandler(s, (address)h) +#define Platform_sethandler(s, h) SystemSetHandler(s, (ADDRESS)h) #define Platform_stat(n, n__len) stat((char*)n, &s) #define Platform_statdev() (LONGINT)s.st_dev #define Platform_statino() (LONGINT)s.st_ino @@ -170,63 +170,63 @@ extern void Heap_InitHeap(); #define Platform_tvsec() tv.tv_sec #define Platform_tvusec() tv.tv_usec #define Platform_unlink(n, n__len) unlink((char*)n) -#define Platform_writefile(fd, p, l) write(fd, (void*)(address)(p), l) +#define Platform_writefile(fd, p, l) write(fd, (void*)(ADDRESS)(p), l) -BOOLEAN Platform_TooManyFiles (int16 e) +BOOLEAN Platform_TooManyFiles (INT16 e) { return e == Platform_EMFILE() || e == Platform_ENFILE(); } -BOOLEAN Platform_NoSuchDirectory (int16 e) +BOOLEAN Platform_NoSuchDirectory (INT16 e) { return e == Platform_ENOENT(); } -BOOLEAN Platform_DifferentFilesystems (int16 e) +BOOLEAN Platform_DifferentFilesystems (INT16 e) { return e == Platform_EXDEV(); } -BOOLEAN Platform_Inaccessible (int16 e) +BOOLEAN Platform_Inaccessible (INT16 e) { return (e == Platform_EACCES() || e == Platform_EROFS()) || e == Platform_EAGAIN(); } -BOOLEAN Platform_Absent (int16 e) +BOOLEAN Platform_Absent (INT16 e) { return e == Platform_ENOENT(); } -BOOLEAN Platform_TimedOut (int16 e) +BOOLEAN Platform_TimedOut (INT16 e) { return e == Platform_ETIMEDOUT(); } -BOOLEAN Platform_ConnectionFailed (int16 e) +BOOLEAN Platform_ConnectionFailed (INT16 e) { return ((e == Platform_ECONNREFUSED() || e == Platform_ECONNABORTED()) || e == Platform_ENETUNREACH()) || e == Platform_EHOSTUNREACH(); } -BOOLEAN Platform_Interrupted (int16 e) +BOOLEAN Platform_Interrupted (INT16 e) { return e == Platform_EINTR(); } -int32 Platform_OSAllocate (int32 size) +INT32 Platform_OSAllocate (INT32 size) { return Platform_allocate(size); } -void Platform_OSFree (int32 address) +void Platform_OSFree (INT32 address) { Platform_free(address); } -void Platform_Init (int32 argc, int32 argvadr) +void Platform_Init (INT32 argc, INT32 argvadr) { Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; - Platform_ArgCount = __VAL(int16, argc); + Platform_ArgCount = __VAL(INT16, argc); av = (Platform_ArgVecPtr)(address)argvadr; Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; @@ -254,7 +254,7 @@ void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len) __DEL(var); } -void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len) +void Platform_GetArg (INT16 n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { @@ -263,10 +263,10 @@ void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len) } } -void Platform_GetIntArg (int16 n, int32 *val) +void Platform_GetIntArg (INT16 n, INT32 *val) { CHAR s[64]; - int32 k, d, i; + INT32 k, d, i; s[0] = 0x00; Platform_GetArg(n, (void*)s, 64); i = 0; @@ -274,11 +274,11 @@ void Platform_GetIntArg (int16 n, int32 *val) i = 1; } k = 0; - d = (int16)s[__X(i, 64)] - 48; + d = (INT16)s[__X(i, 64)] - 48; while ((d >= 0 && d <= 9)) { k = k * 10 + d; i += 1; - d = (int16)s[__X(i, 64)] - 48; + d = (INT16)s[__X(i, 64)] - 48; } if (s[0] == '-') { k = -k; @@ -289,9 +289,9 @@ void Platform_GetIntArg (int16 n, int32 *val) } } -int16 Platform_ArgPos (CHAR *s, LONGINT s__len) +INT16 Platform_ArgPos (CHAR *s, LONGINT s__len) { - int16 i; + INT16 i; CHAR arg[256]; __DUP(s, s__len, CHAR); i = 0; @@ -319,57 +319,57 @@ void Platform_SetBadInstructionHandler (Platform_SignalHandler handler) Platform_sethandler(4, handler); } -static void Platform_YMDHMStoClock (int32 ye, int32 mo, int32 da, int32 ho, int32 mi, int32 se, int32 *t, int32 *d) +static void Platform_YMDHMStoClock (INT32 ye, INT32 mo, INT32 da, INT32 ho, INT32 mi, INT32 se, INT32 *t, INT32 *d) { *d = (__ASHL((int)__MOD(ye, 100), 9) + __ASHL(mo + 1, 5)) + da; *t = (__ASHL(ho, 12) + __ASHL(mi, 6)) + se; } -void Platform_GetClock (int32 *t, int32 *d) +void Platform_GetClock (INT32 *t, INT32 *d) { Platform_gettimeval(); Platform_sectotm(Platform_tvsec()); Platform_YMDHMStoClock(Platform_tmyear(), Platform_tmmon(), Platform_tmmday(), Platform_tmhour(), Platform_tmmin(), Platform_tmsec(), &*t, &*d); } -void Platform_GetTimeOfDay (int32 *sec, int32 *usec) +void Platform_GetTimeOfDay (INT32 *sec, INT32 *usec) { Platform_gettimeval(); *sec = Platform_tvsec(); *usec = Platform_tvusec(); } -int32 Platform_Time (void) +INT32 Platform_Time (void) { - int32 ms; + INT32 ms; Platform_gettimeval(); ms = (int)__DIVF(Platform_tvusec(), 1000) + Platform_tvsec() * 1000; return (int)__MOD(ms - Platform_TimeStart, 2147483647); } -void Platform_Delay (int32 ms) +void Platform_Delay (INT32 ms) { - int32 s, ns; + INT32 s, ns; s = __DIV(ms, 1000); ns = (int)__MOD(ms, 1000) * 1000000; Platform_nanosleep(s, ns); } -int16 Platform_System (CHAR *cmd, LONGINT cmd__len) +INT16 Platform_System (CHAR *cmd, LONGINT cmd__len) { __DUP(cmd, cmd__len, CHAR); __DEL(cmd); return Platform_system(cmd, cmd__len); } -int16 Platform_Error (void) +INT16 Platform_Error (void) { return Platform_err(); } -int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h) +INT16 Platform_OldRO (CHAR *n, LONGINT n__len, INT32 *h) { - int16 fd; + INT16 fd; fd = Platform_openro(n, n__len); if (fd < 0) { return Platform_err(); @@ -380,9 +380,9 @@ int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h) __RETCHK; } -int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h) +INT16 Platform_OldRW (CHAR *n, LONGINT n__len, INT32 *h) { - int16 fd; + INT16 fd; fd = Platform_openrw(n, n__len); if (fd < 0) { return Platform_err(); @@ -393,9 +393,9 @@ int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h) __RETCHK; } -int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h) +INT16 Platform_New (CHAR *n, LONGINT n__len, INT32 *h) { - int16 fd; + INT16 fd; fd = Platform_opennew(n, n__len); if (fd < 0) { return Platform_err(); @@ -406,7 +406,7 @@ int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h) __RETCHK; } -int16 Platform_Close (int32 h) +INT16 Platform_Close (INT32 h) { if (Platform_closefile(h) < 0) { return Platform_err(); @@ -416,7 +416,7 @@ int16 Platform_Close (int32 h) __RETCHK; } -int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ) +INT16 Platform_Identify (INT32 h, Platform_FileIdentity *identity, ADDRESS *identity__typ) { Platform_structstats(); if (Platform_fstat(h) < 0) { @@ -428,7 +428,7 @@ int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *iden return 0; } -int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ) +INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ) { __DUP(n, n__len, CHAR); Platform_structstats(); @@ -453,18 +453,18 @@ BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i return i1.mtime == i2.mtime; } -void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Platform_FileIdentity source) +void Platform_SetMTime (Platform_FileIdentity *target, ADDRESS *target__typ, Platform_FileIdentity source) { (*target).mtime = source.mtime; } -void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d) +void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d) { Platform_sectotm(i.mtime); Platform_YMDHMStoClock(Platform_tmyear(), Platform_tmmon(), Platform_tmmday(), Platform_tmhour(), Platform_tmmin(), Platform_tmsec(), &*t, &*d); } -int16 Platform_Size (int32 h, int32 *l) +INT16 Platform_Size (INT32 h, INT32 *l) { Platform_structstats(); if (Platform_fstat(h) < 0) { @@ -474,7 +474,7 @@ int16 Platform_Size (int32 h, int32 *l) return 0; } -int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n) +INT16 Platform_Read (INT32 h, INT32 p, INT32 l, INT32 *n) { *n = Platform_readfile(h, p, l); if (*n < 0) { @@ -486,7 +486,7 @@ int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n) __RETCHK; } -int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n) +INT16 Platform_ReadBuf (INT32 h, SYSTEM_BYTE *b, LONGINT b__len, INT32 *n) { *n = Platform_readfile(h, (address)b, b__len); if (*n < 0) { @@ -498,9 +498,9 @@ int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n) __RETCHK; } -int16 Platform_Write (int32 h, int32 p, int32 l) +INT16 Platform_Write (INT32 h, INT32 p, INT32 l) { - int32 written; + INT32 written; written = Platform_writefile(h, p, l); if (written < 0) { return Platform_err(); @@ -510,7 +510,7 @@ int16 Platform_Write (int32 h, int32 p, int32 l) __RETCHK; } -int16 Platform_Sync (int32 h) +INT16 Platform_Sync (INT32 h) { if (Platform_fsync(h) < 0) { return Platform_err(); @@ -520,7 +520,7 @@ int16 Platform_Sync (int32 h) __RETCHK; } -int16 Platform_Seek (int32 h, int32 offset, int16 whence) +INT16 Platform_Seek (INT32 h, INT32 offset, INT16 whence) { if (Platform_lseek(h, offset, whence) < 0) { return Platform_err(); @@ -530,7 +530,7 @@ int16 Platform_Seek (int32 h, int32 offset, int16 whence) __RETCHK; } -int16 Platform_Truncate (int32 h, int32 l) +INT16 Platform_Truncate (INT32 h, INT32 l) { if (Platform_ftruncate(h, l) < 0) { return Platform_err(); @@ -540,7 +540,7 @@ int16 Platform_Truncate (int32 h, int32 l) __RETCHK; } -int16 Platform_Unlink (CHAR *n, LONGINT n__len) +INT16 Platform_Unlink (CHAR *n, LONGINT n__len) { if (Platform_unlink(n, n__len) < 0) { return Platform_err(); @@ -550,9 +550,9 @@ int16 Platform_Unlink (CHAR *n, LONGINT n__len) __RETCHK; } -int16 Platform_Chdir (CHAR *n, LONGINT n__len) +INT16 Platform_Chdir (CHAR *n, LONGINT n__len) { - int16 r; + INT16 r; if ((Platform_chdir(n, n__len) >= 0 && Platform_getcwd((void*)Platform_CWD, 256) != NIL)) { return 0; } else { @@ -561,7 +561,7 @@ int16 Platform_Chdir (CHAR *n, LONGINT n__len) __RETCHK; } -int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) +INT16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) { if (Platform_rename(o, o__len, n, n__len) < 0) { return Platform_err(); @@ -571,7 +571,7 @@ int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) __RETCHK; } -void Platform_Exit (int16 code) +void Platform_Exit (INT16 code) { Platform_exit(code); } @@ -586,7 +586,7 @@ static void Platform_errln (void) Platform_errch(0x0a); } -static void Platform_errposint (int32 l) +static void Platform_errposint (INT32 l) { if (l > 10) { Platform_errposint(__DIV(l, 10)); @@ -594,7 +594,7 @@ static void Platform_errposint (int32 l) Platform_errch((CHAR)(48 + (int)__MOD(l, 10))); } -static void Platform_errint (int32 l) +static void Platform_errint (INT32 l) { if (l < 0) { Platform_errch('-'); @@ -603,7 +603,7 @@ static void Platform_errint (int32 l) Platform_errposint(l); } -static void Platform_DisplayHaltCode (int32 code) +static void Platform_DisplayHaltCode (INT32 code) { switch (code) { case -1: @@ -659,7 +659,7 @@ static void Platform_DisplayHaltCode (int32 code) } } -void Platform_Halt (int32 code) +void Platform_Halt (INT32 code) { Platform_HaltCode = code; if (Platform_HaltHandler != NIL) { @@ -672,10 +672,10 @@ void Platform_Halt (int32 code) Platform_DisplayHaltCode(code); } Platform_errln(); - Platform_exit(__VAL(int16, code)); + Platform_exit(__VAL(INT16, code)); } -void Platform_AssertFail (int32 code) +void Platform_AssertFail (INT32 code) { Platform_errstring((CHAR*)"Assertion failure.", 19); if (code != 0) { @@ -684,7 +684,7 @@ void Platform_AssertFail (int32 code) Platform_errstring((CHAR*)".", 2); } Platform_errln(); - Platform_exit(__VAL(int16, code)); + Platform_exit(__VAL(INT16, code)); } void Platform_SetHalt (Platform_HaltProcedure p) @@ -694,7 +694,7 @@ void Platform_SetHalt (Platform_HaltProcedure p) static void Platform_TestLittleEndian (void) { - int16 i; + INT16 i; i = 1; __GET((address)&i, Platform_LittleEndian, BOOLEAN); } diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index 18456e59..ff45e732 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h @@ -7,77 +7,77 @@ typedef struct Platform_FileIdentity { - int32 _prvt0; + INT32 _prvt0; char _prvt1[8]; } Platform_FileIdentity; typedef - void (*Platform_HaltProcedure)(int32); + void (*Platform_HaltProcedure)(INT32); typedef - void (*Platform_SignalHandler)(int32); + void (*Platform_SignalHandler)(INT32); import BOOLEAN Platform_LittleEndian; -import int32 Platform_MainStackFrame; -import int32 Platform_HaltCode; -import int16 Platform_PID; +import INT32 Platform_MainStackFrame; +import INT32 Platform_HaltCode; +import INT16 Platform_PID; import CHAR Platform_CWD[256]; -import int16 Platform_ArgCount; -import int32 Platform_ArgVector; -import int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; +import INT16 Platform_ArgCount; +import INT32 Platform_ArgVector; +import INT16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; import CHAR Platform_NL[3]; -import address *Platform_FileIdentity__typ; +import ADDRESS *Platform_FileIdentity__typ; -import BOOLEAN Platform_Absent (int16 e); -import int16 Platform_ArgPos (CHAR *s, LONGINT s__len); -import void Platform_AssertFail (int32 code); -import int16 Platform_Chdir (CHAR *n, LONGINT n__len); -import int16 Platform_Close (int32 h); -import BOOLEAN Platform_ConnectionFailed (int16 e); -import void Platform_Delay (int32 ms); -import BOOLEAN Platform_DifferentFilesystems (int16 e); -import int16 Platform_Error (void); -import void Platform_Exit (int16 code); -import void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len); -import void Platform_GetClock (int32 *t, int32 *d); +import BOOLEAN Platform_Absent (INT16 e); +import INT16 Platform_ArgPos (CHAR *s, LONGINT s__len); +import void Platform_AssertFail (INT32 code); +import INT16 Platform_Chdir (CHAR *n, LONGINT n__len); +import INT16 Platform_Close (INT32 h); +import BOOLEAN Platform_ConnectionFailed (INT16 e); +import void Platform_Delay (INT32 ms); +import BOOLEAN Platform_DifferentFilesystems (INT16 e); +import INT16 Platform_Error (void); +import void Platform_Exit (INT16 code); +import void Platform_GetArg (INT16 n, CHAR *val, LONGINT val__len); +import void Platform_GetClock (INT32 *t, INT32 *d); import void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); -import void Platform_GetIntArg (int16 n, int32 *val); -import void Platform_GetTimeOfDay (int32 *sec, int32 *usec); -import void Platform_Halt (int32 code); -import int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ); -import int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); -import BOOLEAN Platform_Inaccessible (int16 e); -import void Platform_Init (int32 argc, int32 argvadr); -import BOOLEAN Platform_Interrupted (int16 e); -import void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); -import int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); -import BOOLEAN Platform_NoSuchDirectory (int16 e); -import int32 Platform_OSAllocate (int32 size); -import void Platform_OSFree (int32 address); -import int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); -import int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); -import int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n); -import int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n); -import int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); +import void Platform_GetIntArg (INT16 n, INT32 *val); +import void Platform_GetTimeOfDay (INT32 *sec, INT32 *usec); +import void Platform_Halt (INT32 code); +import INT16 Platform_Identify (INT32 h, Platform_FileIdentity *identity, ADDRESS *identity__typ); +import INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ); +import BOOLEAN Platform_Inaccessible (INT16 e); +import void Platform_Init (INT32 argc, INT32 argvadr); +import BOOLEAN Platform_Interrupted (INT16 e); +import void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d); +import INT16 Platform_New (CHAR *n, LONGINT n__len, INT32 *h); +import BOOLEAN Platform_NoSuchDirectory (INT16 e); +import INT32 Platform_OSAllocate (INT32 size); +import void Platform_OSFree (INT32 address); +import INT16 Platform_OldRO (CHAR *n, LONGINT n__len, INT32 *h); +import INT16 Platform_OldRW (CHAR *n, LONGINT n__len, INT32 *h); +import INT16 Platform_Read (INT32 h, INT32 p, INT32 l, INT32 *n); +import INT16 Platform_ReadBuf (INT32 h, SYSTEM_BYTE *b, LONGINT b__len, INT32 *n); +import INT16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); import BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); import BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); -import int16 Platform_Seek (int32 h, int32 offset, int16 whence); +import INT16 Platform_Seek (INT32 h, INT32 offset, INT16 whence); import void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); import void Platform_SetHalt (Platform_HaltProcedure p); import void Platform_SetInterruptHandler (Platform_SignalHandler handler); -import void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Platform_FileIdentity source); +import void Platform_SetMTime (Platform_FileIdentity *target, ADDRESS *target__typ, Platform_FileIdentity source); import void Platform_SetQuitHandler (Platform_SignalHandler handler); -import int16 Platform_Size (int32 h, int32 *l); -import int16 Platform_Sync (int32 h); -import int16 Platform_System (CHAR *cmd, LONGINT cmd__len); -import int32 Platform_Time (void); -import BOOLEAN Platform_TimedOut (int16 e); -import BOOLEAN Platform_TooManyFiles (int16 e); -import int16 Platform_Truncate (int32 h, int32 l); -import int16 Platform_Unlink (CHAR *n, LONGINT n__len); -import int16 Platform_Write (int32 h, int32 p, int32 l); +import INT16 Platform_Size (INT32 h, INT32 *l); +import INT16 Platform_Sync (INT32 h); +import INT16 Platform_System (CHAR *cmd, LONGINT cmd__len); +import INT32 Platform_Time (void); +import BOOLEAN Platform_TimedOut (INT16 e); +import BOOLEAN Platform_TooManyFiles (INT16 e); +import INT16 Platform_Truncate (INT32 h, INT32 l); +import INT16 Platform_Unlink (CHAR *n, LONGINT n__len); +import INT16 Platform_Write (INT32 h, INT32 p, INT32 l); import BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); import void *Platform__init(void); diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 0aca5733..d6788751 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" @@ -11,19 +11,19 @@ static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LONGINT d__len); -export void Reals_Convert (REAL x, int16 n, CHAR *d, LONGINT d__len); +export void Reals_Convert (REAL x, INT16 n, CHAR *d, LONGINT d__len); export void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len); export void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len); -export void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len); -export int16 Reals_Expo (REAL x); -export int16 Reals_ExpoL (LONGREAL x); -export void Reals_SetExpo (REAL *x, int16 ex); -export REAL Reals_Ten (int16 e); -export LONGREAL Reals_TenL (int16 e); -static CHAR Reals_ToHex (int16 i); +export void Reals_ConvertL (LONGREAL x, INT16 n, CHAR *d, LONGINT d__len); +export INT16 Reals_Expo (REAL x); +export INT16 Reals_ExpoL (LONGREAL x); +export void Reals_SetExpo (REAL *x, INT16 ex); +export REAL Reals_Ten (INT16 e); +export LONGREAL Reals_TenL (INT16 e); +static CHAR Reals_ToHex (INT16 i); -REAL Reals_Ten (int16 e) +REAL Reals_Ten (INT16 e) { LONGREAL r, power; r = (LONGREAL)1; @@ -38,7 +38,7 @@ REAL Reals_Ten (int16 e) return r; } -LONGREAL Reals_TenL (int16 e) +LONGREAL Reals_TenL (INT16 e) { LONGREAL r, power; r = (LONGREAL)1; @@ -56,39 +56,39 @@ LONGREAL Reals_TenL (int16 e) __RETCHK; } -int16 Reals_Expo (REAL x) +INT16 Reals_Expo (REAL x) { - int16 i; - __GET((address)&x + 2, i, int16); + INT16 i; + __GET((address)&x + 2, i, INT16); return __MASK(__ASHR(i, 7), -256); } -void Reals_SetExpo (REAL *x, int16 ex) +void Reals_SetExpo (REAL *x, INT16 ex) { CHAR c; __GET((address)x + 3, c, CHAR); - __PUT((address)x + 3, (CHAR)(__ASHL(__ASHR((int16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __PUT((address)x + 3, (CHAR)(__ASHL(__ASHR((INT16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); __GET((address)x + 2, c, CHAR); - __PUT((address)x + 2, (CHAR)(__MASK((int16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); + __PUT((address)x + 2, (CHAR)(__MASK((INT16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } -int16 Reals_ExpoL (LONGREAL x) +INT16 Reals_ExpoL (LONGREAL x) { - int16 i; - __GET((address)&x + 6, i, int16); + INT16 i; + __GET((address)&x + 6, i, INT16); return __MASK(__ASHR(i, 4), -2048); } -void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len) +void Reals_ConvertL (LONGREAL x, INT16 n, CHAR *d, LONGINT d__len) { - int32 i, j, k; + INT32 i, j, k; if (x < (LONGREAL)0) { x = -x; } k = 0; if (n > 9) { - i = (int32)__ENTIER(x / (LONGREAL)(LONGREAL)1000000000); - j = (int32)__ENTIER(x - i * (LONGREAL)1000000000); + i = (INT32)__ENTIER(x / (LONGREAL)(LONGREAL)1000000000); + j = (INT32)__ENTIER(x - i * (LONGREAL)1000000000); if (j < 0) { j = 0; } @@ -98,7 +98,7 @@ void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len) k += 1; } } else { - i = (int32)__ENTIER(x); + i = (INT32)__ENTIER(x); } while (k < n) { d[__X(k, d__len)] = (CHAR)((int)__MOD(i, 10) + 48); @@ -107,12 +107,12 @@ void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len) } } -void Reals_Convert (REAL x, int16 n, CHAR *d, LONGINT d__len) +void Reals_Convert (REAL x, INT16 n, CHAR *d, LONGINT d__len) { Reals_ConvertL(x, n, (void*)d, d__len); } -static CHAR Reals_ToHex (int16 i) +static CHAR Reals_ToHex (INT16 i) { if (i < 10) { return (CHAR)(i + 48); @@ -124,15 +124,15 @@ static CHAR Reals_ToHex (int16 i) static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LONGINT d__len) { - int16 i; - int32 l; + INT16 i; + INT32 l; CHAR by; i = 0; l = b__len; while (i < l) { by = __VAL(CHAR, b[__X(i, b__len)]); - d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((int16)by, 4)); - d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((int16)by, -16)); + d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((INT16)by, 4)); + d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((INT16)by, -16)); i += 1; } } diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index 664fe2ec..07688e3c 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h @@ -8,15 +8,15 @@ -import void Reals_Convert (REAL x, int16 n, CHAR *d, LONGINT d__len); +import void Reals_Convert (REAL x, INT16 n, CHAR *d, LONGINT d__len); import void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len); import void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len); -import void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len); -import int16 Reals_Expo (REAL x); -import int16 Reals_ExpoL (LONGREAL x); -import void Reals_SetExpo (REAL *x, int16 ex); -import REAL Reals_Ten (int16 e); -import LONGREAL Reals_TenL (int16 e); +import void Reals_ConvertL (LONGREAL x, INT16 n, CHAR *d, LONGINT d__len); +import INT16 Reals_Expo (REAL x); +import INT16 Reals_ExpoL (LONGREAL x); +import void Reals_SetExpo (REAL *x, INT16 ex); +import REAL Reals_Ten (INT16 e); +import LONGREAL Reals_TenL (INT16 e); import void *Reals__init(void); diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index 104a0fb7..141a9976 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" @@ -12,18 +12,18 @@ export void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len); export void Strings_Cap (CHAR *s, LONGINT s__len); -export void Strings_Delete (CHAR *s, LONGINT s__len, int16 pos, int16 n); -export void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHAR *dest, LONGINT dest__len); -export void Strings_Insert (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len); -export int16 Strings_Length (CHAR *s, LONGINT s__len); +export void Strings_Delete (CHAR *s, LONGINT s__len, INT16 pos, INT16 n); +export void Strings_Extract (CHAR *source, LONGINT source__len, INT16 pos, INT16 n, CHAR *dest, LONGINT dest__len); +export void Strings_Insert (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len); +export INT16 Strings_Length (CHAR *s, LONGINT s__len); export BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len); -export int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int16 pos); -export void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len); +export INT16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, INT16 pos); +export void Strings_Replace (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len); -int16 Strings_Length (CHAR *s, LONGINT s__len) +INT16 Strings_Length (CHAR *s, LONGINT s__len) { - int32 i; + INT32 i; __DUP(s, s__len, CHAR); i = 0; while ((i < s__len && s[__X(i, s__len)] != 0x00)) { @@ -31,7 +31,7 @@ int16 Strings_Length (CHAR *s, LONGINT s__len) } if (i <= 32767) { __DEL(s); - return (int16)i; + return (INT16)i; } else { __DEL(s); return 32767; @@ -41,7 +41,7 @@ int16 Strings_Length (CHAR *s, LONGINT s__len) void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len) { - int16 n1, n2, i; + INT16 n1, n2, i; __DUP(extra, extra__len, CHAR); n1 = Strings_Length(dest, dest__len); n2 = Strings_Length(extra, extra__len); @@ -56,9 +56,9 @@ void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__ __DEL(extra); } -void Strings_Insert (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len) +void Strings_Insert (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len) { - int16 n1, n2, i; + INT16 n1, n2, i; __DUP(source, source__len, CHAR); n1 = Strings_Length(dest, dest__len); n2 = Strings_Length(source, source__len); @@ -87,9 +87,9 @@ void Strings_Insert (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, L __DEL(source); } -void Strings_Delete (CHAR *s, LONGINT s__len, int16 pos, int16 n) +void Strings_Delete (CHAR *s, LONGINT s__len, INT16 pos, INT16 n) { - int16 len, i; + INT16 len, i; len = Strings_Length(s, s__len); if (pos < 0) { pos = 0; @@ -110,7 +110,7 @@ void Strings_Delete (CHAR *s, LONGINT s__len, int16 pos, int16 n) } } -void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len) +void Strings_Replace (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len) { __DUP(source, source__len, CHAR); Strings_Delete((void*)dest, dest__len, pos, pos + Strings_Length(source, source__len)); @@ -118,12 +118,12 @@ void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, __DEL(source); } -void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHAR *dest, LONGINT dest__len) +void Strings_Extract (CHAR *source, LONGINT source__len, INT16 pos, INT16 n, CHAR *dest, LONGINT dest__len) { - int16 len, destLen, i; + INT16 len, destLen, i; __DUP(source, source__len, CHAR); len = Strings_Length(source, source__len); - destLen = (int16)dest__len - 1; + destLen = (INT16)dest__len - 1; if (pos < 0) { pos = 0; } @@ -143,9 +143,9 @@ void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHA __DEL(source); } -int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int16 pos) +INT16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, INT16 pos) { - int16 n1, n2, i, j; + INT16 n1, n2, i, j; __DUP(pattern, pattern__len, CHAR); __DUP(s, s__len, CHAR); n1 = Strings_Length(s, s__len); @@ -177,7 +177,7 @@ int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, void Strings_Cap (CHAR *s, LONGINT s__len) { - int16 i; + INT16 i; i = 0; while (s[__X(i, s__len)] != 0x00) { if (('a' <= s[__X(i, s__len)] && s[__X(i, s__len)] <= 'z')) { @@ -191,9 +191,9 @@ static struct Match__7 { struct Match__7 *lnk; } *Match__7_s; -static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, int16 n, int16 m); +static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, INT16 n, INT16 m); -static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, int16 n, int16 m) +static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, INT16 n, INT16 m) { while ((((n >= 0 && m >= 0)) && mask[__X(m, mask__len)] != '*')) { if (name[__X(n, name__len)] != mask[__X(m, mask__len)]) { diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index 24f35c02..4319e8c8 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h @@ -10,13 +10,13 @@ import void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len); import void Strings_Cap (CHAR *s, LONGINT s__len); -import void Strings_Delete (CHAR *s, LONGINT s__len, int16 pos, int16 n); -import void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHAR *dest, LONGINT dest__len); -import void Strings_Insert (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len); -import int16 Strings_Length (CHAR *s, LONGINT s__len); +import void Strings_Delete (CHAR *s, LONGINT s__len, INT16 pos, INT16 n); +import void Strings_Extract (CHAR *source, LONGINT source__len, INT16 pos, INT16 n, CHAR *dest, LONGINT dest__len); +import void Strings_Insert (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len); +import INT16 Strings_Length (CHAR *s, LONGINT s__len); import BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len); -import int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int16 pos); -import void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len); +import INT16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, INT16 pos); +import void Strings_Replace (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len); import void *Strings__init(void); diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index 961ebbe7..ac0a3850 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "Files.h" @@ -19,9 +19,9 @@ typedef typedef struct Texts_RunDesc { Texts_Run prev, next; - int32 len; + INT32 len; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; BOOLEAN ascii; } Texts_RunDesc; @@ -34,7 +34,7 @@ typedef } Texts_ElemMsg; typedef - void (*Texts_Handler)(Texts_Elem, Texts_ElemMsg*, address *); + void (*Texts_Handler)(Texts_Elem, Texts_ElemMsg*, ADDRESS *); typedef struct Texts_TextDesc *Texts_Text; @@ -42,26 +42,26 @@ typedef typedef struct Texts_ElemDesc { Texts_Run prev, next; - int32 len; + INT32 len; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; BOOLEAN ascii; - int32 W, H; + INT32 W, H; Texts_Handler handle; Texts_Text base; } Texts_ElemDesc; struct Texts__1 { /* Texts_ElemDesc */ Texts_Run prev, next; - int32 len; + INT32 len; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; BOOLEAN ascii; - int32 W, H; + INT32 W, H; Texts_Handler handle; Texts_Text base; Files_File file; - int32 org, span; + INT32 org, span; CHAR mod[32], proc[32]; }; @@ -70,7 +70,7 @@ typedef typedef struct Texts_BufDesc { - int32 len; + INT32 len; Texts_Run head; } Texts_BufDesc; @@ -84,8 +84,8 @@ typedef typedef struct Texts_FileMsg { /* Texts_ElemMsg */ - int16 id; - int32 pos; + INT16 id; + INT32 pos; Files_Rider r; } Texts_FileMsg; @@ -100,7 +100,7 @@ typedef } Texts_IdentifyMsg; typedef - void (*Texts_Notifier)(Texts_Text, int16, int32, int32); + void (*Texts_Notifier)(Texts_Text, INT16, INT32, INT32); typedef struct Texts_PieceDesc *Texts_Piece; @@ -108,57 +108,57 @@ typedef typedef struct Texts_PieceDesc { Texts_Run prev, next; - int32 len; + INT32 len; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; BOOLEAN ascii; Files_File file; - int32 org; + INT32 org; } Texts_PieceDesc; typedef struct Texts_Reader { BOOLEAN eot; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; Texts_Elem elem; Files_Rider rider; Texts_Run run; - int32 org, off; + INT32 org, off; } Texts_Reader; typedef struct Texts_Scanner { /* Texts_Reader */ BOOLEAN eot; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; Texts_Elem elem; Files_Rider rider; Texts_Run run; - int32 org, off; + INT32 org, off; CHAR nextCh; - int16 line, class; - int32 i; + INT16 line, class; + INT32 i; REAL x; LONGREAL y; CHAR c; - int8 len; + INT8 len; CHAR s[64]; } Texts_Scanner; typedef struct Texts_TextDesc { - int32 len; + INT32 len; Texts_Notifier notify; Texts_Run head, cache; - int32 corg; + INT32 corg; } Texts_TextDesc; typedef struct Texts_Writer { Texts_Buffer buf; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; Files_Rider rider; Files_File file; } Texts_Writer; @@ -168,68 +168,68 @@ export Texts_Elem Texts_new; static Texts_Buffer Texts_del; static Texts_FontsFont Texts_FontsDefault; -export address *Texts_FontDesc__typ; -export address *Texts_RunDesc__typ; -export address *Texts_PieceDesc__typ; -export address *Texts_ElemMsg__typ; -export address *Texts_ElemDesc__typ; -export address *Texts_FileMsg__typ; -export address *Texts_CopyMsg__typ; -export address *Texts_IdentifyMsg__typ; -export address *Texts_BufDesc__typ; -export address *Texts_TextDesc__typ; -export address *Texts_Reader__typ; -export address *Texts_Scanner__typ; -export address *Texts_Writer__typ; -export address *Texts__1__typ; +export ADDRESS *Texts_FontDesc__typ; +export ADDRESS *Texts_RunDesc__typ; +export ADDRESS *Texts_PieceDesc__typ; +export ADDRESS *Texts_ElemMsg__typ; +export ADDRESS *Texts_ElemDesc__typ; +export ADDRESS *Texts_FileMsg__typ; +export ADDRESS *Texts_CopyMsg__typ; +export ADDRESS *Texts_IdentifyMsg__typ; +export ADDRESS *Texts_BufDesc__typ; +export ADDRESS *Texts_TextDesc__typ; +export ADDRESS *Texts_Reader__typ; +export ADDRESS *Texts_Scanner__typ; +export ADDRESS *Texts_Writer__typ; +export ADDRESS *Texts__1__typ; export void Texts_Append (Texts_Text T, Texts_Buffer B); -export void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, uint32 sel, Texts_FontsFont fnt, int8 col, int8 voff); +export void Texts_ChangeLooks (Texts_Text T, INT32 beg, INT32 end, UINT32 sel, Texts_FontsFont fnt, INT8 col, INT8 voff); static Texts_Elem Texts_CloneElem (Texts_Elem e); static Texts_Piece Texts_ClonePiece (Texts_Piece p); export void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len); export void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); export void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); -export void Texts_Delete (Texts_Text T, int32 beg, int32 end); +export void Texts_Delete (Texts_Text T, INT32 beg, INT32 end); export Texts_Text Texts_ElemBase (Texts_Elem E); -export int32 Texts_ElemPos (Texts_Elem E); -static void Texts_Find (Texts_Text T, int32 *pos, Texts_Run *u, int32 *org, int32 *off); +export INT32 Texts_ElemPos (Texts_Elem E); +static void Texts_Find (Texts_Text T, INT32 *pos, Texts_Run *u, INT32 *org, INT32 *off); static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len); -static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, address *msg__typ); -export void Texts_Insert (Texts_Text T, int32 pos, Texts_Buffer B); -export void Texts_Load (Files_Rider *r, address *r__typ, Texts_Text T); -static void Texts_Load0 (Files_Rider *r, address *r__typ, Texts_Text T); +static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, ADDRESS *msg__typ); +export void Texts_Insert (Texts_Text T, INT32 pos, Texts_Buffer B); +export void Texts_Load (Files_Rider *r, ADDRESS *r__typ, Texts_Text T); +static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T); static void Texts_Merge (Texts_Text T, Texts_Run u, Texts_Run *v); export void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len); export void Texts_OpenBuf (Texts_Buffer B); -export void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int32 pos); -export void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int32 pos); -export void Texts_OpenWriter (Texts_Writer *W, address *W__typ); -export int32 Texts_Pos (Texts_Reader *R, address *R__typ); -export void Texts_Read (Texts_Reader *R, address *R__typ, CHAR *ch); -export void Texts_ReadElem (Texts_Reader *R, address *R__typ); -export void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ); +export void Texts_OpenReader (Texts_Reader *R, ADDRESS *R__typ, Texts_Text T, INT32 pos); +export void Texts_OpenScanner (Texts_Scanner *S, ADDRESS *S__typ, Texts_Text T, INT32 pos); +export void Texts_OpenWriter (Texts_Writer *W, ADDRESS *W__typ); +export INT32 Texts_Pos (Texts_Reader *R, ADDRESS *R__typ); +export void Texts_Read (Texts_Reader *R, ADDRESS *R__typ, CHAR *ch); +export void Texts_ReadElem (Texts_Reader *R, ADDRESS *R__typ); +export void Texts_ReadPrevElem (Texts_Reader *R, ADDRESS *R__typ); export void Texts_Recall (Texts_Buffer *B); -export void Texts_Save (Texts_Text T, int32 beg, int32 end, Texts_Buffer B); -export void Texts_Scan (Texts_Scanner *S, address *S__typ); -export void Texts_SetColor (Texts_Writer *W, address *W__typ, int8 col); -export void Texts_SetFont (Texts_Writer *W, address *W__typ, Texts_FontsFont fnt); -export void Texts_SetOffset (Texts_Writer *W, address *W__typ, int8 voff); +export void Texts_Save (Texts_Text T, INT32 beg, INT32 end, Texts_Buffer B); +export void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ); +export void Texts_SetColor (Texts_Writer *W, ADDRESS *W__typ, INT8 col); +export void Texts_SetFont (Texts_Writer *W, ADDRESS *W__typ, Texts_FontsFont fnt); +export void Texts_SetOffset (Texts_Writer *W, ADDRESS *W__typ, INT8 voff); static void Texts_Splice (Texts_Run un, Texts_Run v, Texts_Run w, Texts_Text base); -static void Texts_Split (int32 off, Texts_Run *u, Texts_Run *un); -export void Texts_Store (Files_Rider *r, address *r__typ, Texts_Text T); -export void Texts_Write (Texts_Writer *W, address *W__typ, CHAR ch); -export void Texts_WriteDate (Texts_Writer *W, address *W__typ, int32 t, int32 d); -export void Texts_WriteElem (Texts_Writer *W, address *W__typ, Texts_Elem e); -export void Texts_WriteHex (Texts_Writer *W, address *W__typ, int32 x); -export void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n); -export void Texts_WriteLn (Texts_Writer *W, address *W__typ); -export void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int16 n); -export void Texts_WriteLongRealHex (Texts_Writer *W, address *W__typ, LONGREAL x); -export void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int16 n); -export void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int16 n, int16 k); -export void Texts_WriteRealHex (Texts_Writer *W, address *W__typ, REAL x); -export void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGINT s__len); +static void Texts_Split (INT32 off, Texts_Run *u, Texts_Run *un); +export void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T); +export void Texts_Write (Texts_Writer *W, ADDRESS *W__typ, CHAR ch); +export void Texts_WriteDate (Texts_Writer *W, ADDRESS *W__typ, INT32 t, INT32 d); +export void Texts_WriteElem (Texts_Writer *W, ADDRESS *W__typ, Texts_Elem e); +export void Texts_WriteHex (Texts_Writer *W, ADDRESS *W__typ, INT32 x); +export void Texts_WriteInt (Texts_Writer *W, ADDRESS *W__typ, INT64 x, INT64 n); +export void Texts_WriteLn (Texts_Writer *W, ADDRESS *W__typ); +export void Texts_WriteLongReal (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x, INT16 n); +export void Texts_WriteLongRealHex (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x); +export void Texts_WriteReal (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n); +export void Texts_WriteRealFix (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n, INT16 k); +export void Texts_WriteRealHex (Texts_Writer *W, ADDRESS *W__typ, REAL x); +export void Texts_WriteString (Texts_Writer *W, ADDRESS *W__typ, CHAR *s, LONGINT s__len); static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len) @@ -240,10 +240,10 @@ static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len) return F; } -static void Texts_Find (Texts_Text T, int32 *pos, Texts_Run *u, int32 *org, int32 *off) +static void Texts_Find (Texts_Text T, INT32 *pos, Texts_Run *u, INT32 *org, INT32 *off) { Texts_Run v = NIL; - int32 m; + INT32 m; if (*pos >= T->len) { *pos = T->len; *u = T->head; @@ -273,7 +273,7 @@ static void Texts_Find (Texts_Text T, int32 *pos, Texts_Run *u, int32 *org, int3 } } -static void Texts_Split (int32 off, Texts_Run *u, Texts_Run *un) +static void Texts_Split (INT32 off, Texts_Run *u, Texts_Run *un) { Texts_Piece p = NIL, U = NIL; if (off == 0) { @@ -366,10 +366,10 @@ Texts_Text Texts_ElemBase (Texts_Elem E) return E->base; } -int32 Texts_ElemPos (Texts_Elem E) +INT32 Texts_ElemPos (Texts_Elem E) { Texts_Run u = NIL; - int32 pos; + INT32 pos; u = E->base->head->next; pos = 0; while (u != (void *) E) { @@ -379,11 +379,11 @@ int32 Texts_ElemPos (Texts_Elem E) return pos; } -static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, address *msg__typ) +static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, ADDRESS *msg__typ) { Texts_Alien e = NIL; Files_Rider r; - int32 i; + INT32 i; CHAR ch; if (__ISP(E, Texts__1, 2)) { if (__IS(msg__typ, Texts_CopyMsg, 1)) { @@ -459,10 +459,10 @@ void Texts_Recall (Texts_Buffer *B) Texts_del = NIL; } -void Texts_Save (Texts_Text T, int32 beg, int32 end, Texts_Buffer B) +void Texts_Save (Texts_Text T, INT32 beg, INT32 end, Texts_Buffer B) { Texts_Run u = NIL, v = NIL, w = NIL, wn = NIL; - int32 uo, ud, vo, vd; + INT32 uo, ud, vo, vd; Texts_Find(T, &beg, &u, &uo, &ud); Texts_Find(T, &end, &v, &vo, &vd); w = B->head->prev; @@ -493,11 +493,11 @@ void Texts_Save (Texts_Text T, int32 beg, int32 end, Texts_Buffer B) B->len += end - beg; } -void Texts_Insert (Texts_Text T, int32 pos, Texts_Buffer B) +void Texts_Insert (Texts_Text T, INT32 pos, Texts_Buffer B) { Texts_Run u = NIL, un = NIL, v = NIL; Texts_Piece p = NIL, q = NIL; - int32 uo, ud, len; + INT32 uo, ud, len; Texts_Find(T, &pos, &u, &uo, &ud); Texts_Split(ud, &u, &un); len = B->len; @@ -516,7 +516,7 @@ void Texts_Insert (Texts_Text T, int32 pos, Texts_Buffer B) void Texts_Append (Texts_Text T, Texts_Buffer B) { Texts_Run v = NIL; - int32 pos, len; + INT32 pos, len; pos = T->len; len = B->len; v = B->head->next; @@ -531,10 +531,10 @@ void Texts_Append (Texts_Text T, Texts_Buffer B) } } -void Texts_Delete (Texts_Text T, int32 beg, int32 end) +void Texts_Delete (Texts_Text T, INT32 beg, INT32 end) { Texts_Run c = NIL, u = NIL, un = NIL, v = NIL, vn = NIL; - int32 co, uo, ud, vo, vd; + INT32 co, uo, ud, vo, vd; Texts_Find(T, &beg, &u, &uo, &ud); Texts_Split(ud, &u, &un); c = T->cache; @@ -556,10 +556,10 @@ void Texts_Delete (Texts_Text T, int32 beg, int32 end) } } -void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, uint32 sel, Texts_FontsFont fnt, int8 col, int8 voff) +void Texts_ChangeLooks (Texts_Text T, INT32 beg, INT32 end, UINT32 sel, Texts_FontsFont fnt, INT8 col, INT8 voff) { Texts_Run c = NIL, u = NIL, un = NIL, v = NIL, vn = NIL; - int32 co, uo, ud, vo, vd; + INT32 co, uo, ud, vo, vd; Texts_Find(T, &beg, &u, &uo, &ud); Texts_Split(ud, &u, &un); c = T->cache; @@ -595,7 +595,7 @@ void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, uint32 sel, Texts_Fo } } -void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int32 pos) +void Texts_OpenReader (Texts_Reader *R, ADDRESS *R__typ, Texts_Text T, INT32 pos) { Texts_Run u = NIL; if (pos >= T->len) { @@ -609,10 +609,10 @@ void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int32 pos } } -void Texts_Read (Texts_Reader *R, address *R__typ, CHAR *ch) +void Texts_Read (Texts_Reader *R, ADDRESS *R__typ, CHAR *ch) { Texts_Run u = NIL; - int32 pos; + INT32 pos; CHAR nextch; u = (*R).run; (*R).fnt = u->fnt; @@ -654,7 +654,7 @@ void Texts_Read (Texts_Reader *R, address *R__typ, CHAR *ch) } } -void Texts_ReadElem (Texts_Reader *R, address *R__typ) +void Texts_ReadElem (Texts_Reader *R, ADDRESS *R__typ) { Texts_Run u = NIL, un = NIL; u = (*R).run; @@ -682,7 +682,7 @@ void Texts_ReadElem (Texts_Reader *R, address *R__typ) } } -void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ) +void Texts_ReadPrevElem (Texts_Reader *R, ADDRESS *R__typ) { Texts_Run u = NIL; u = (*R).run->prev; @@ -704,12 +704,12 @@ void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ) } } -int32 Texts_Pos (Texts_Reader *R, address *R__typ) +INT32 Texts_Pos (Texts_Reader *R, ADDRESS *R__typ) { return (*R).org + (*R).off; } -void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int32 pos) +void Texts_OpenScanner (Texts_Scanner *S, ADDRESS *S__typ, Texts_Text T, INT32 pos) { Texts_OpenReader((void*)&*S, S__typ, T, pos); (*S).line = 0; @@ -718,10 +718,10 @@ void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int32 p static struct Scan__31 { Texts_Scanner *S; - address *S__typ; + ADDRESS *S__typ; CHAR *ch; BOOLEAN *negE; - int16 *e; + INT16 *e; struct Scan__31 *lnk; } *Scan__31_s; @@ -740,18 +740,18 @@ static void ReadScaleFactor__32 (void) } } while (('0' <= *Scan__31_s->ch && *Scan__31_s->ch <= '9')) { - *Scan__31_s->e = (*Scan__31_s->e * 10 + (int16)*Scan__31_s->ch) - 48; + *Scan__31_s->e = (*Scan__31_s->e * 10 + (INT16)*Scan__31_s->ch) - 48; Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); } } -void Texts_Scan (Texts_Scanner *S, address *S__typ) +void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) { CHAR ch, term; BOOLEAN neg, negE, hex; - int8 i, j, h; - int16 e; - int32 k; + INT8 i, j, h; + INT16 e; + INT32 k; REAL x, f; LONGREAL y, g; CHAR d[32]; @@ -812,10 +812,10 @@ void Texts_Scan (Texts_Scanner *S, address *S__typ) if ('9' < ch) { if (('A' <= ch && ch <= 'F')) { hex = 1; - ch = (CHAR)((int16)ch - 7); + ch = (CHAR)((INT16)ch - 7); } else if (('a' <= ch && ch <= 'f')) { hex = 1; - ch = (CHAR)((int16)ch - 39); + ch = (CHAR)((INT16)ch - 39); } else { break; } @@ -827,13 +827,13 @@ void Texts_Scan (Texts_Scanner *S, address *S__typ) if (i - j > 8) { j = i - 8; } - k = (int16)d[__X(j, 32)] - 48; + k = (INT16)d[__X(j, 32)] - 48; j += 1; if ((i - j == 7 && k >= 8)) { k -= 16; } while (j < i) { - k = __ASHL(k, 4) + ((int16)d[__X(j, 32)] - 48); + k = __ASHL(k, 4) + ((INT16)d[__X(j, 32)] - 48); j += 1; } if (neg) { @@ -854,12 +854,12 @@ void Texts_Scan (Texts_Scanner *S, address *S__typ) y = (LONGREAL)0; g = (LONGREAL)1; do { - y = y * (LONGREAL)10 + ((int16)d[__X(j, 32)] - 48); + y = y * (LONGREAL)10 + ((INT16)d[__X(j, 32)] - 48); j += 1; } while (!(j == h)); while (j < i) { g = g / (LONGREAL)(LONGREAL)10; - y = ((int16)d[__X(j, 32)] - 48) * g + y; + y = ((INT16)d[__X(j, 32)] - 48) * g + y; j += 1; } ReadScaleFactor__32(); @@ -886,12 +886,12 @@ void Texts_Scan (Texts_Scanner *S, address *S__typ) x = (REAL)0; f = (REAL)1; do { - x = x * (REAL)10 + ((int16)d[__X(j, 32)] - 48); + x = x * (REAL)10 + ((INT16)d[__X(j, 32)] - 48); j += 1; } while (!(j == h)); while (j < i) { f = f / (REAL)(REAL)10; - x = ((int16)d[__X(j, 32)] - 48) * f + x; + x = ((INT16)d[__X(j, 32)] - 48) * f + x; j += 1; } if (ch == 'E') { @@ -923,7 +923,7 @@ void Texts_Scan (Texts_Scanner *S, address *S__typ) (*S).class = 3; k = 0; do { - k = k * 10 + ((int16)d[__X(j, 32)] - 48); + k = k * 10 + ((INT16)d[__X(j, 32)] - 48); j += 1; } while (!(j == i)); if (neg) { @@ -951,7 +951,7 @@ void Texts_Scan (Texts_Scanner *S, address *S__typ) Scan__31_s = _s.lnk; } -void Texts_OpenWriter (Texts_Writer *W, address *W__typ) +void Texts_OpenWriter (Texts_Writer *W, ADDRESS *W__typ) { __NEW((*W).buf, Texts_BufDesc); Texts_OpenBuf((*W).buf); @@ -962,22 +962,22 @@ void Texts_OpenWriter (Texts_Writer *W, address *W__typ) Files_Set(&(*W).rider, Files_Rider__typ, (*W).file, 0); } -void Texts_SetFont (Texts_Writer *W, address *W__typ, Texts_FontsFont fnt) +void Texts_SetFont (Texts_Writer *W, ADDRESS *W__typ, Texts_FontsFont fnt) { (*W).fnt = fnt; } -void Texts_SetColor (Texts_Writer *W, address *W__typ, int8 col) +void Texts_SetColor (Texts_Writer *W, ADDRESS *W__typ, INT8 col) { (*W).col = col; } -void Texts_SetOffset (Texts_Writer *W, address *W__typ, int8 voff) +void Texts_SetOffset (Texts_Writer *W, ADDRESS *W__typ, INT8 voff) { (*W).voff = voff; } -void Texts_Write (Texts_Writer *W, address *W__typ, CHAR ch) +void Texts_Write (Texts_Writer *W, ADDRESS *W__typ, CHAR ch) { Texts_Run u = NIL, un = NIL; Texts_Piece p = NIL; @@ -1003,7 +1003,7 @@ void Texts_Write (Texts_Writer *W, address *W__typ, CHAR ch) } } -void Texts_WriteElem (Texts_Writer *W, address *W__typ, Texts_Elem e) +void Texts_WriteElem (Texts_Writer *W, ADDRESS *W__typ, Texts_Elem e) { Texts_Run u = NIL, un = NIL; if (e->base != NIL) { @@ -1022,14 +1022,14 @@ void Texts_WriteElem (Texts_Writer *W, address *W__typ, Texts_Elem e) un->prev = (Texts_Run)e; } -void Texts_WriteLn (Texts_Writer *W, address *W__typ) +void Texts_WriteLn (Texts_Writer *W, ADDRESS *W__typ) { Texts_Write(&*W, W__typ, 0x0d); } -void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGINT s__len) +void Texts_WriteString (Texts_Writer *W, ADDRESS *W__typ, CHAR *s, LONGINT s__len) { - int16 i; + INT16 i; __DUP(s, s__len, CHAR); i = 0; while (s[__X(i, s__len)] >= ' ') { @@ -1039,10 +1039,10 @@ void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGINT s__le __DEL(s); } -void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n) +void Texts_WriteInt (Texts_Writer *W, ADDRESS *W__typ, INT64 x, INT64 n) { - int16 i; - int64 x0; + INT16 i; + INT64 x0; CHAR a[24]; i = 0; if (x < 0) { @@ -1061,7 +1061,7 @@ void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n) x0 = __DIV(x0, 10); i += 1; } while (!(x0 == 0)); - while (n > (int64)i) { + while (n > (INT64)i) { Texts_Write(&*W, W__typ, ' '); n -= 1; } @@ -1074,10 +1074,10 @@ void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n) } while (!(i == 0)); } -void Texts_WriteHex (Texts_Writer *W, address *W__typ, int32 x) +void Texts_WriteHex (Texts_Writer *W, ADDRESS *W__typ, INT32 x) { - int16 i; - int32 y; + INT16 i; + INT32 y; CHAR a[20]; i = 0; Texts_Write(&*W, W__typ, ' '); @@ -1097,9 +1097,9 @@ void Texts_WriteHex (Texts_Writer *W, address *W__typ, int32 x) } while (!(i == 0)); } -void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int16 n) +void Texts_WriteReal (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n) { - int16 e; + INT16 e; REAL x0; CHAR d[9]; e = Reals_Expo(x); @@ -1169,16 +1169,16 @@ void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int16 n) static struct WriteRealFix__53 { Texts_Writer *W; - address *W__typ; - int16 *i; + ADDRESS *W__typ; + INT16 *i; CHAR (*d)[9]; struct WriteRealFix__53 *lnk; } *WriteRealFix__53_s; -static void dig__54 (int16 n); -static void seq__56 (CHAR ch, int16 n); +static void dig__54 (INT16 n); +static void seq__56 (CHAR ch, INT16 n); -static void seq__56 (CHAR ch, int16 n) +static void seq__56 (CHAR ch, INT16 n) { while (n > 0) { Texts_Write(&*WriteRealFix__53_s->W, WriteRealFix__53_s->W__typ, ch); @@ -1186,7 +1186,7 @@ static void seq__56 (CHAR ch, int16 n) } } -static void dig__54 (int16 n) +static void dig__54 (INT16 n) { while (n > 0) { *WriteRealFix__53_s->i -= 1; @@ -1195,9 +1195,9 @@ static void dig__54 (int16 n) } } -void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int16 n, int16 k) +void Texts_WriteRealFix (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n, INT16 k) { - int16 e, i; + INT16 e, i; CHAR sign; REAL x0; CHAR d[9]; @@ -1267,9 +1267,9 @@ void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int16 n, int1 WriteRealFix__53_s = _s.lnk; } -void Texts_WriteRealHex (Texts_Writer *W, address *W__typ, REAL x) +void Texts_WriteRealHex (Texts_Writer *W, ADDRESS *W__typ, REAL x) { - int16 i; + INT16 i; CHAR d[8]; Reals_ConvertH(x, (void*)d, 8); i = 0; @@ -1279,9 +1279,9 @@ void Texts_WriteRealHex (Texts_Writer *W, address *W__typ, REAL x) } while (!(i == 8)); } -void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int16 n) +void Texts_WriteLongReal (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x, INT16 n) { - int16 e; + INT16 e; LONGREAL x0; CHAR d[16]; e = Reals_ExpoL(x); @@ -1313,7 +1313,7 @@ void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int16 n) } else { Texts_Write(&*W, W__typ, ' '); } - e = (int16)__ASHR((e - 1023) * 77, 8); + e = (INT16)__ASHR((e - 1023) * 77, 8); if (e >= 0) { x = x / (LONGREAL)Reals_TenL(e); } else { @@ -1351,9 +1351,9 @@ void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int16 n) } } -void Texts_WriteLongRealHex (Texts_Writer *W, address *W__typ, LONGREAL x) +void Texts_WriteLongRealHex (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x) { - int16 i; + INT16 i; CHAR d[16]; Reals_ConvertHL(x, (void*)d, 16); i = 0; @@ -1365,20 +1365,20 @@ void Texts_WriteLongRealHex (Texts_Writer *W, address *W__typ, LONGREAL x) static struct WriteDate__43 { Texts_Writer *W; - address *W__typ; + ADDRESS *W__typ; struct WriteDate__43 *lnk; } *WriteDate__43_s; -static void WritePair__44 (CHAR ch, int32 x); +static void WritePair__44 (CHAR ch, INT32 x); -static void WritePair__44 (CHAR ch, int32 x) +static void WritePair__44 (CHAR ch, INT32 x) { Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, ch); Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)(__DIV(x, 10) + 48)); Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)((int)__MOD(x, 10) + 48)); } -void Texts_WriteDate (Texts_Writer *W, address *W__typ, int32 t, int32 d) +void Texts_WriteDate (Texts_Writer *W, ADDRESS *W__typ, INT32 t, INT32 d) { struct WriteDate__43 _s; _s.W = W; _s.W__typ = W__typ; @@ -1395,22 +1395,22 @@ void Texts_WriteDate (Texts_Writer *W, address *W__typ, int32 t, int32 d) static struct Load0__16 { Texts_Text *T; - int8 *ecnt; + INT8 *ecnt; Files_File *f; Texts_FileMsg *msg; CHAR (*mods)[64][32], (*procs)[64][32]; struct Load0__16 *lnk; } *Load0__16_s; -static void LoadElem__17 (Files_Rider *r, address *r__typ, int32 pos, int32 span, Texts_Elem *e); +static void LoadElem__17 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e); -static void LoadElem__17 (Files_Rider *r, address *r__typ, int32 pos, int32 span, Texts_Elem *e) +static void LoadElem__17 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e) { Modules_Module M = NIL; Modules_Command Cmd; Texts_Alien a = NIL; - int32 org, ew, eh; - int8 eno; + INT32 org, ew, eh; + INT8 eno; Texts_new = NIL; Files_ReadLInt(&*r, r__typ, &ew); Files_ReadLInt(&*r, r__typ, &eh); @@ -1455,13 +1455,13 @@ static void LoadElem__17 (Files_Rider *r, address *r__typ, int32 pos, int32 span } } -static void Texts_Load0 (Files_Rider *r, address *r__typ, Texts_Text T) +static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) { Texts_Run u = NIL, un = NIL; Texts_Piece p = NIL; Texts_Elem e = NIL; - int32 org, pos, hlen, plen; - int8 ecnt, fcnt, fno, col, voff; + INT32 org, pos, hlen, plen; + INT8 ecnt, fcnt, fno, col, voff; Files_File f = NIL; Texts_FileMsg msg; CHAR mods[64][32], procs[64][32]; @@ -1529,9 +1529,9 @@ static void Texts_Load0 (Files_Rider *r, address *r__typ, Texts_Text T) Load0__16_s = _s.lnk; } -void Texts_Load (Files_Rider *r, address *r__typ, Texts_Text T) +void Texts_Load (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) { - int16 tag; + INT16 tag; Files_ReadInt(&*r, r__typ, &tag); if (tag != -4095) { Files_Set(&*r, r__typ, Files_Base(&*r, r__typ), Files_Pos(&*r, r__typ) - 2); @@ -1546,7 +1546,7 @@ void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len) Texts_Run u = NIL; Texts_Piece p = NIL; CHAR tag, version; - int32 hlen; + INT32 hlen; __DUP(name, name__len, CHAR); f = Files_Old(name, name__len); if (f == NIL) { @@ -1596,20 +1596,20 @@ void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len) } static struct Store__39 { - int8 *ecnt; + INT8 *ecnt; Texts_FileMsg *msg; Texts_IdentifyMsg *iden; CHAR (*mods)[64][32], (*procs)[64][32]; struct Store__39 *lnk; } *Store__39_s; -static void StoreElem__40 (Files_Rider *r, address *r__typ, int32 pos, Texts_Elem e); +static void StoreElem__40 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e); -static void StoreElem__40 (Files_Rider *r, address *r__typ, int32 pos, Texts_Elem e) +static void StoreElem__40 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e) { Files_Rider r1; - int32 org, span; - int8 eno; + INT32 org, span; + INT8 eno; __COPY((*Store__39_s->iden).mod, (*Store__39_s->mods)[__X(*Store__39_s->ecnt, 64)], 32); __COPY((*Store__39_s->iden).proc, (*Store__39_s->procs)[__X(*Store__39_s->ecnt, 64)], 32); eno = 1; @@ -1635,15 +1635,15 @@ static void StoreElem__40 (Files_Rider *r, address *r__typ, int32 pos, Texts_Ele Files_WriteLInt(&r1, Files_Rider__typ, e->H); } -void Texts_Store (Files_Rider *r, address *r__typ, Texts_Text T) +void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) { Files_Rider r1; Texts_Run u = NIL, un = NIL; Texts_Elem e = NIL; - int32 org, pos, delta, hlen, rlen; - int8 ecnt, fcnt; + INT32 org, pos, delta, hlen, rlen; + INT8 ecnt, fcnt; CHAR ch; - int8 fno; + INT8 fno; Texts_FileMsg msg; Texts_IdentifyMsg iden; CHAR mods[64][32], procs[64][32]; @@ -1759,7 +1759,7 @@ void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len) { Files_File f = NIL; Files_Rider r; - int16 i, res; + INT16 i, res; CHAR bak[64]; __DUP(name, name__len, CHAR); f = Files_New(name, name__len); diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index 891c877a..f2c8d90e 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h @@ -8,7 +8,7 @@ typedef struct Texts_BufDesc { - int32 len; + INT32 len; char _prvt0[4]; } Texts_BufDesc; @@ -30,25 +30,25 @@ typedef typedef struct Texts_RunDesc { - int32 _prvt0; + INT32 _prvt0; char _prvt1[15]; } Texts_RunDesc; typedef - void (*Texts_Handler)(Texts_Elem, Texts_ElemMsg*, address *); + void (*Texts_Handler)(Texts_Elem, Texts_ElemMsg*, ADDRESS *); typedef struct Texts_ElemDesc { char _prvt0[20]; - int32 W, H; + INT32 W, H; Texts_Handler handle; char _prvt1[4]; } Texts_ElemDesc; typedef struct Texts_FileMsg { /* Texts_ElemMsg */ - int16 id; - int32 pos; + INT16 id; + INT32 pos; Files_Rider r; } Texts_FileMsg; @@ -69,13 +69,13 @@ typedef struct Texts_TextDesc *Texts_Text; typedef - void (*Texts_Notifier)(Texts_Text, int16, int32, int32); + void (*Texts_Notifier)(Texts_Text, INT16, INT32, INT32); typedef struct Texts_Reader { BOOLEAN eot; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; Texts_Elem elem; char _prvt0[32]; } Texts_Reader; @@ -84,23 +84,23 @@ typedef struct Texts_Scanner { /* Texts_Reader */ BOOLEAN eot; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; Texts_Elem elem; - int64 _prvt0; + INT64 _prvt0; char _prvt1[24]; CHAR nextCh; - int16 line, class; - int32 i; + INT16 line, class; + INT32 i; REAL x; LONGREAL y; CHAR c; - int8 len; + INT8 len; CHAR s[64]; } Texts_Scanner; typedef struct Texts_TextDesc { - int32 len; + INT32 len; Texts_Notifier notify; char _prvt0[12]; } Texts_TextDesc; @@ -109,64 +109,64 @@ typedef struct Texts_Writer { Texts_Buffer buf; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; char _prvt0[26]; } Texts_Writer; import Texts_Elem Texts_new; -import address *Texts_FontDesc__typ; -import address *Texts_RunDesc__typ; -import address *Texts_ElemMsg__typ; -import address *Texts_ElemDesc__typ; -import address *Texts_FileMsg__typ; -import address *Texts_CopyMsg__typ; -import address *Texts_IdentifyMsg__typ; -import address *Texts_BufDesc__typ; -import address *Texts_TextDesc__typ; -import address *Texts_Reader__typ; -import address *Texts_Scanner__typ; -import address *Texts_Writer__typ; +import ADDRESS *Texts_FontDesc__typ; +import ADDRESS *Texts_RunDesc__typ; +import ADDRESS *Texts_ElemMsg__typ; +import ADDRESS *Texts_ElemDesc__typ; +import ADDRESS *Texts_FileMsg__typ; +import ADDRESS *Texts_CopyMsg__typ; +import ADDRESS *Texts_IdentifyMsg__typ; +import ADDRESS *Texts_BufDesc__typ; +import ADDRESS *Texts_TextDesc__typ; +import ADDRESS *Texts_Reader__typ; +import ADDRESS *Texts_Scanner__typ; +import ADDRESS *Texts_Writer__typ; import void Texts_Append (Texts_Text T, Texts_Buffer B); -import void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, uint32 sel, Texts_FontsFont fnt, int8 col, int8 voff); +import void Texts_ChangeLooks (Texts_Text T, INT32 beg, INT32 end, UINT32 sel, Texts_FontsFont fnt, INT8 col, INT8 voff); import void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len); import void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); import void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); -import void Texts_Delete (Texts_Text T, int32 beg, int32 end); +import void Texts_Delete (Texts_Text T, INT32 beg, INT32 end); import Texts_Text Texts_ElemBase (Texts_Elem E); -import int32 Texts_ElemPos (Texts_Elem E); -import void Texts_Insert (Texts_Text T, int32 pos, Texts_Buffer B); -import void Texts_Load (Files_Rider *r, address *r__typ, Texts_Text T); +import INT32 Texts_ElemPos (Texts_Elem E); +import void Texts_Insert (Texts_Text T, INT32 pos, Texts_Buffer B); +import void Texts_Load (Files_Rider *r, ADDRESS *r__typ, Texts_Text T); import void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len); import void Texts_OpenBuf (Texts_Buffer B); -import void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int32 pos); -import void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int32 pos); -import void Texts_OpenWriter (Texts_Writer *W, address *W__typ); -import int32 Texts_Pos (Texts_Reader *R, address *R__typ); -import void Texts_Read (Texts_Reader *R, address *R__typ, CHAR *ch); -import void Texts_ReadElem (Texts_Reader *R, address *R__typ); -import void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ); +import void Texts_OpenReader (Texts_Reader *R, ADDRESS *R__typ, Texts_Text T, INT32 pos); +import void Texts_OpenScanner (Texts_Scanner *S, ADDRESS *S__typ, Texts_Text T, INT32 pos); +import void Texts_OpenWriter (Texts_Writer *W, ADDRESS *W__typ); +import INT32 Texts_Pos (Texts_Reader *R, ADDRESS *R__typ); +import void Texts_Read (Texts_Reader *R, ADDRESS *R__typ, CHAR *ch); +import void Texts_ReadElem (Texts_Reader *R, ADDRESS *R__typ); +import void Texts_ReadPrevElem (Texts_Reader *R, ADDRESS *R__typ); import void Texts_Recall (Texts_Buffer *B); -import void Texts_Save (Texts_Text T, int32 beg, int32 end, Texts_Buffer B); -import void Texts_Scan (Texts_Scanner *S, address *S__typ); -import void Texts_SetColor (Texts_Writer *W, address *W__typ, int8 col); -import void Texts_SetFont (Texts_Writer *W, address *W__typ, Texts_FontsFont fnt); -import void Texts_SetOffset (Texts_Writer *W, address *W__typ, int8 voff); -import void Texts_Store (Files_Rider *r, address *r__typ, Texts_Text T); -import void Texts_Write (Texts_Writer *W, address *W__typ, CHAR ch); -import void Texts_WriteDate (Texts_Writer *W, address *W__typ, int32 t, int32 d); -import void Texts_WriteElem (Texts_Writer *W, address *W__typ, Texts_Elem e); -import void Texts_WriteHex (Texts_Writer *W, address *W__typ, int32 x); -import void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n); -import void Texts_WriteLn (Texts_Writer *W, address *W__typ); -import void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int16 n); -import void Texts_WriteLongRealHex (Texts_Writer *W, address *W__typ, LONGREAL x); -import void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int16 n); -import void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int16 n, int16 k); -import void Texts_WriteRealHex (Texts_Writer *W, address *W__typ, REAL x); -import void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGINT s__len); +import void Texts_Save (Texts_Text T, INT32 beg, INT32 end, Texts_Buffer B); +import void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ); +import void Texts_SetColor (Texts_Writer *W, ADDRESS *W__typ, INT8 col); +import void Texts_SetFont (Texts_Writer *W, ADDRESS *W__typ, Texts_FontsFont fnt); +import void Texts_SetOffset (Texts_Writer *W, ADDRESS *W__typ, INT8 voff); +import void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T); +import void Texts_Write (Texts_Writer *W, ADDRESS *W__typ, CHAR ch); +import void Texts_WriteDate (Texts_Writer *W, ADDRESS *W__typ, INT32 t, INT32 d); +import void Texts_WriteElem (Texts_Writer *W, ADDRESS *W__typ, Texts_Elem e); +import void Texts_WriteHex (Texts_Writer *W, ADDRESS *W__typ, INT32 x); +import void Texts_WriteInt (Texts_Writer *W, ADDRESS *W__typ, INT64 x, INT64 n); +import void Texts_WriteLn (Texts_Writer *W, ADDRESS *W__typ); +import void Texts_WriteLongReal (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x, INT16 n); +import void Texts_WriteLongRealHex (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x); +import void Texts_WriteReal (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n); +import void Texts_WriteRealFix (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n, INT16 k); +import void Texts_WriteRealHex (Texts_Writer *W, ADDRESS *W__typ, REAL x); +import void Texts_WriteString (Texts_Writer *W, ADDRESS *W__typ, CHAR *s, LONGINT s__len); import void *Texts__init(void); diff --git a/bootstrap/unix-48/VT100.c b/bootstrap/unix-48/VT100.c index c3a9491f..b5067d33 100644 --- a/bootstrap/unix-48/VT100.c +++ b/bootstrap/unix-48/VT100.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "Out.h" @@ -14,36 +14,36 @@ export CHAR VT100_CSI[5]; static CHAR VT100_tmpstr[32]; -export void VT100_CHA (int16 n); -export void VT100_CNL (int16 n); -export void VT100_CPL (int16 n); -export void VT100_CUB (int16 n); -export void VT100_CUD (int16 n); -export void VT100_CUF (int16 n); -export void VT100_CUP (int16 n, int16 m); -export void VT100_CUU (int16 n); +export void VT100_CHA (INT16 n); +export void VT100_CNL (INT16 n); +export void VT100_CPL (INT16 n); +export void VT100_CUB (INT16 n); +export void VT100_CUD (INT16 n); +export void VT100_CUF (INT16 n); +export void VT100_CUP (INT16 n, INT16 m); +export void VT100_CUU (INT16 n); export void VT100_DECTCEMh (void); export void VT100_DECTCEMl (void); -export void VT100_DSR (int16 n); -export void VT100_ED (int16 n); -export void VT100_EL (int16 n); -static void VT100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len); +export void VT100_DSR (INT16 n); +export void VT100_ED (INT16 n); +export void VT100_EL (INT16 n); +static void VT100_EscSeq (INT16 n, CHAR *letter, LONGINT letter__len); static void VT100_EscSeq0 (CHAR *letter, LONGINT letter__len); -static void VT100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len); -static void VT100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len); -export void VT100_HVP (int16 n, int16 m); -export void VT100_IntToStr (int32 int_, CHAR *str, LONGINT str__len); +static void VT100_EscSeq2 (INT16 n, INT16 m, CHAR *letter, LONGINT letter__len); +static void VT100_EscSeqSwapped (INT16 n, CHAR *letter, LONGINT letter__len); +export void VT100_HVP (INT16 n, INT16 m); +export void VT100_IntToStr (INT32 int_, CHAR *str, LONGINT str__len); export void VT100_RCP (void); -static void VT100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end); +static void VT100_Reverse0 (CHAR *str, LONGINT str__len, INT16 start, INT16 end); export void VT100_SCP (void); -export void VT100_SD (int16 n); -export void VT100_SGR (int16 n); -export void VT100_SGR2 (int16 n, int16 m); -export void VT100_SU (int16 n); +export void VT100_SD (INT16 n); +export void VT100_SGR (INT16 n); +export void VT100_SGR2 (INT16 n, INT16 m); +export void VT100_SU (INT16 n); export void VT100_SetAttr (CHAR *attr, LONGINT attr__len); -static void VT100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end) +static void VT100_Reverse0 (CHAR *str, LONGINT str__len, INT16 start, INT16 end) { CHAR h; while (start < end) { @@ -55,11 +55,11 @@ static void VT100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end) } } -void VT100_IntToStr (int32 int_, CHAR *str, LONGINT str__len) +void VT100_IntToStr (INT32 int_, CHAR *str, LONGINT str__len) { CHAR b[21]; - int16 s, e; - int8 maxLength; + INT16 s, e; + INT8 maxLength; maxLength = 11; if (int_ == (-2147483647-1)) { __MOVE("-2147483648", b, 12); @@ -94,7 +94,7 @@ static void VT100_EscSeq0 (CHAR *letter, LONGINT letter__len) __DEL(letter); } -static void VT100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len) +static void VT100_EscSeq (INT16 n, CHAR *letter, LONGINT letter__len) { CHAR nstr[2]; CHAR cmd[7]; @@ -107,7 +107,7 @@ static void VT100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len) __DEL(letter); } -static void VT100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len) +static void VT100_EscSeqSwapped (INT16 n, CHAR *letter, LONGINT letter__len) { CHAR nstr[2]; CHAR cmd[7]; @@ -120,7 +120,7 @@ static void VT100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len) __DEL(letter); } -static void VT100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len) +static void VT100_EscSeq2 (INT16 n, INT16 m, CHAR *letter, LONGINT letter__len) { CHAR nstr[5], mstr[5]; CHAR cmd[12]; @@ -136,82 +136,82 @@ static void VT100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len) __DEL(letter); } -void VT100_CUU (int16 n) +void VT100_CUU (INT16 n) { VT100_EscSeq(n, (CHAR*)"A", 2); } -void VT100_CUD (int16 n) +void VT100_CUD (INT16 n) { VT100_EscSeq(n, (CHAR*)"B", 2); } -void VT100_CUF (int16 n) +void VT100_CUF (INT16 n) { VT100_EscSeq(n, (CHAR*)"C", 2); } -void VT100_CUB (int16 n) +void VT100_CUB (INT16 n) { VT100_EscSeq(n, (CHAR*)"D", 2); } -void VT100_CNL (int16 n) +void VT100_CNL (INT16 n) { VT100_EscSeq(n, (CHAR*)"E", 2); } -void VT100_CPL (int16 n) +void VT100_CPL (INT16 n) { VT100_EscSeq(n, (CHAR*)"F", 2); } -void VT100_CHA (int16 n) +void VT100_CHA (INT16 n) { VT100_EscSeq(n, (CHAR*)"G", 2); } -void VT100_CUP (int16 n, int16 m) +void VT100_CUP (INT16 n, INT16 m) { VT100_EscSeq2(n, m, (CHAR*)"H", 2); } -void VT100_ED (int16 n) +void VT100_ED (INT16 n) { VT100_EscSeq(n, (CHAR*)"J", 2); } -void VT100_EL (int16 n) +void VT100_EL (INT16 n) { VT100_EscSeq(n, (CHAR*)"K", 2); } -void VT100_SU (int16 n) +void VT100_SU (INT16 n) { VT100_EscSeq(n, (CHAR*)"S", 2); } -void VT100_SD (int16 n) +void VT100_SD (INT16 n) { VT100_EscSeq(n, (CHAR*)"T", 2); } -void VT100_HVP (int16 n, int16 m) +void VT100_HVP (INT16 n, INT16 m) { VT100_EscSeq2(n, m, (CHAR*)"f", 2); } -void VT100_SGR (int16 n) +void VT100_SGR (INT16 n) { VT100_EscSeq(n, (CHAR*)"m", 2); } -void VT100_SGR2 (int16 n, int16 m) +void VT100_SGR2 (INT16 n, INT16 m) { VT100_EscSeq2(n, m, (CHAR*)"m", 2); } -void VT100_DSR (int16 n) +void VT100_DSR (INT16 n) { VT100_EscSeq(6, (CHAR*)"n", 2); } diff --git a/bootstrap/unix-48/VT100.h b/bootstrap/unix-48/VT100.h index ee0408bb..d9aa6ab7 100644 --- a/bootstrap/unix-48/VT100.h +++ b/bootstrap/unix-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef VT100__h #define VT100__h @@ -9,27 +9,27 @@ import CHAR VT100_CSI[5]; -import void VT100_CHA (int16 n); -import void VT100_CNL (int16 n); -import void VT100_CPL (int16 n); -import void VT100_CUB (int16 n); -import void VT100_CUD (int16 n); -import void VT100_CUF (int16 n); -import void VT100_CUP (int16 n, int16 m); -import void VT100_CUU (int16 n); +import void VT100_CHA (INT16 n); +import void VT100_CNL (INT16 n); +import void VT100_CPL (INT16 n); +import void VT100_CUB (INT16 n); +import void VT100_CUD (INT16 n); +import void VT100_CUF (INT16 n); +import void VT100_CUP (INT16 n, INT16 m); +import void VT100_CUU (INT16 n); import void VT100_DECTCEMh (void); import void VT100_DECTCEMl (void); -import void VT100_DSR (int16 n); -import void VT100_ED (int16 n); -import void VT100_EL (int16 n); -import void VT100_HVP (int16 n, int16 m); -import void VT100_IntToStr (int32 int_, CHAR *str, LONGINT str__len); +import void VT100_DSR (INT16 n); +import void VT100_ED (INT16 n); +import void VT100_EL (INT16 n); +import void VT100_HVP (INT16 n, INT16 m); +import void VT100_IntToStr (INT32 int_, CHAR *str, LONGINT str__len); import void VT100_RCP (void); import void VT100_SCP (void); -import void VT100_SD (int16 n); -import void VT100_SGR (int16 n); -import void VT100_SGR2 (int16 n, int16 m); -import void VT100_SU (int16 n); +import void VT100_SD (INT16 n); +import void VT100_SGR (INT16 n); +import void VT100_SGR2 (INT16 n, INT16 m); +import void VT100_SU (INT16 n); import void VT100_SetAttr (CHAR *attr, LONGINT attr__len); import void *VT100__init(void); diff --git a/bootstrap/unix-48/errors.c b/bootstrap/unix-48/errors.c index cce1644f..2a1a7a02 100644 --- a/bootstrap/unix-48/errors.c +++ b/bootstrap/unix-48/errors.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" diff --git a/bootstrap/unix-48/errors.h b/bootstrap/unix-48/errors.h index 9d34f721..5555899e 100644 --- a/bootstrap/unix-48/errors.h +++ b/bootstrap/unix-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index d2dcce53..8ed00f14 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "Configuration.h" @@ -24,7 +24,7 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGINT cmd__len) { - int16 r, status, exitcode; + INT16 r, status, exitcode; __DUP(title, title__len, CHAR); __DUP(cmd, cmd__len, CHAR); if (__IN(18, OPM_Options, 32)) { diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index 2e262037..ad76f7b6 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/Compiler.c b/bootstrap/unix-88/Compiler.c index 759e721b..86c4c1fd 100644 --- a/bootstrap/unix-88/Compiler.c +++ b/bootstrap/unix-88/Compiler.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "Configuration.h" @@ -26,7 +26,7 @@ static CHAR Compiler_mname[256]; export void Compiler_Module (BOOLEAN *done); static void Compiler_PropagateElementaryTypeSizes (void); export void Compiler_Translate (void); -static void Compiler_Trap (int32 sig); +static void Compiler_Trap (INT32 sig); void Compiler_Module (BOOLEAN *done) @@ -147,7 +147,7 @@ void Compiler_Translate (void) } } -static void Compiler_Trap (int32 sig) +static void Compiler_Trap (INT32 sig) { Heap_FINALL(); if (sig == 3) { diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index 95ddb569..3f8c68d8 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index f6a548e4..6abf2414 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 686dbfbf..d5fefc27 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "Heap.h" @@ -18,7 +18,7 @@ typedef struct Files_BufDesc { Files_File f; BOOLEAN chg; - int32 org, size; + INT32 org, size; SYSTEM_BYTE data[4096]; } Files_BufDesc; @@ -33,85 +33,85 @@ typedef Files_FileName workName, registerName; BOOLEAN tempFile; Platform_FileIdentity identity; - int32 fd, len, pos; + INT32 fd, len, pos; Files_Buffer bufs[4]; - int16 swapper, state; + INT16 swapper, state; Files_File next; } Files_FileDesc; typedef struct Files_Rider { - int32 res; + INT32 res; BOOLEAN eof; Files_Buffer buf; - int32 org, offset; + INT32 org, offset; } Files_Rider; static Files_File Files_files; -static int16 Files_tempno; +static INT16 Files_tempno; static CHAR Files_HOME[1024]; static struct { LONGINT len[1]; CHAR data[1]; } *Files_SearchPath; -export address *Files_FileDesc__typ; -export address *Files_BufDesc__typ; -export address *Files_Rider__typ; +export ADDRESS *Files_FileDesc__typ; +export ADDRESS *Files_BufDesc__typ; +export ADDRESS *Files_Rider__typ; -export Files_File Files_Base (Files_Rider *r, address *r__typ); +export Files_File Files_Base (Files_Rider *r, ADDRESS *r__typ); static Files_File Files_CacheEntry (Platform_FileIdentity identity); -export void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int16 *res); +export void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INT16 *res); export void Files_Close (Files_File f); static void Files_CloseOSFile (Files_File f); static void Files_Create (Files_File f); -export void Files_Delete (CHAR *name, LONGINT name__len, int16 *res); -static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int16 errcode); +export void Files_Delete (CHAR *name, LONGINT name__len, INT16 *res); +static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INT16 errcode); static void Files_Finalize (SYSTEM_PTR o); static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *dest, LONGINT dest__len); static void Files_Flush (Files_Buffer buf); -export void Files_GetDate (Files_File f, int32 *t, int32 *d); +export void Files_GetDate (Files_File f, INT32 *t, INT32 *d); export void Files_GetName (Files_File f, CHAR *name, LONGINT name__len); static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *name, LONGINT name__len); static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len); -export int32 Files_Length (Files_File f); +export INT32 Files_Length (Files_File f); static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT name__len, CHAR *dest, LONGINT dest__len); export Files_File Files_New (CHAR *name, LONGINT name__len); export Files_File Files_Old (CHAR *name, LONGINT name__len); -export int32 Files_Pos (Files_Rider *r, address *r__typ); +export INT32 Files_Pos (Files_Rider *r, ADDRESS *r__typ); export void Files_Purge (Files_File f); -export void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x); -export void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x); -export void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); -export void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x); -export void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); -export void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); -export void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); -export void Files_ReadNum (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len); -export void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); -export void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x); -export void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); +export void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x); +export void Files_ReadBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN *x); +export void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n); +export void Files_ReadInt (Files_Rider *R, ADDRESS *R__typ, INT16 *x); +export void Files_ReadLInt (Files_Rider *R, ADDRESS *R__typ, INT32 *x); +export void Files_ReadLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL *x); +export void Files_ReadLine (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); +export void Files_ReadNum (Files_Rider *R, ADDRESS *R__typ, SYSTEM_BYTE *x, LONGINT x__len); +export void Files_ReadReal (Files_Rider *R, ADDRESS *R__typ, REAL *x); +export void Files_ReadSet (Files_Rider *R, ADDRESS *R__typ, UINT32 *x); +export void Files_ReadString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); export void Files_Register (Files_File f); -export void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res); -static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len); -export void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos); +export void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT16 *res); +static void Files_ScanPath (INT16 *pos, CHAR *dir, LONGINT dir__len); +export void Files_Set (Files_Rider *r, ADDRESS *r__typ, Files_File f, INT32 pos); export void Files_SetSearchPath (CHAR *path, LONGINT path__len); -export void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x); -export void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x); -export void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); -export void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x); -export void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x); -export void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x); -export void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x); -export void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x); -export void Files_WriteSet (Files_Rider *R, address *R__typ, uint32 x); -export void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); +export void Files_Write (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE x); +export void Files_WriteBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN x); +export void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n); +export void Files_WriteInt (Files_Rider *R, ADDRESS *R__typ, INT16 x); +export void Files_WriteLInt (Files_Rider *R, ADDRESS *R__typ, INT32 x); +export void Files_WriteLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL x); +export void Files_WriteNum (Files_Rider *R, ADDRESS *R__typ, INT64 x); +export void Files_WriteReal (Files_Rider *R, ADDRESS *R__typ, REAL x); +export void Files_WriteSet (Files_Rider *R, ADDRESS *R__typ, UINT32 x); +export void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); #define Files_IdxTrap() __HALT(-1) #define Files_ToAdr(x) (address)x -static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int16 errcode) +static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INT16 errcode) { __DUP(s, s__len, CHAR); Out_Ln(); @@ -140,7 +140,7 @@ static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int16 errcode) static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT name__len, CHAR *dest, LONGINT dest__len) { - int16 i, j; + INT16 i, j; __DUP(dir, dir__len, CHAR); __DUP(name, name__len, CHAR); i = 0; @@ -165,7 +165,7 @@ static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *name, LONGINT name__len) { - int32 n, i, j; + INT32 n, i, j; __DUP(finalName, finalName__len, CHAR); Files_tempno += 1; n = Files_tempno; @@ -217,7 +217,7 @@ static void Files_Create (Files_File f) { Platform_FileIdentity identity; BOOLEAN done; - int16 error; + INT16 error; CHAR err[32]; if (f->fd == -1) { if (f->state == 1) { @@ -254,7 +254,7 @@ static void Files_Create (Files_File f) static void Files_Flush (Files_Buffer buf) { - int16 error; + INT16 error; Files_File f = NIL; if (buf->chg) { f = buf->f; @@ -278,7 +278,7 @@ static void Files_Flush (Files_Buffer buf) static void Files_CloseOSFile (Files_File f) { Files_File prev = NIL; - int16 error; + INT16 error; if (Files_files == f) { Files_files = f->next; } else { @@ -298,8 +298,8 @@ static void Files_CloseOSFile (Files_File f) void Files_Close (Files_File f) { - int32 i; - int16 error; + INT32 i; + INT16 error; if (f->state != 1 || f->registerName[0] != 0x00) { Files_Create(f); i = 0; @@ -315,7 +315,7 @@ void Files_Close (Files_File f) } } -int32 Files_Length (Files_File f) +INT32 Files_Length (Files_File f) { return f->len; } @@ -336,9 +336,9 @@ Files_File Files_New (CHAR *name, LONGINT name__len) return f; } -static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len) +static void Files_ScanPath (INT16 *pos, CHAR *dir, LONGINT dir__len) { - int16 i; + INT16 i; CHAR ch; i = 0; if (Files_SearchPath == NIL) { @@ -381,7 +381,7 @@ static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len) static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len) { - int16 i; + INT16 i; CHAR ch; i = 0; ch = name[0]; @@ -395,7 +395,7 @@ static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len) static Files_File Files_CacheEntry (Platform_FileIdentity identity) { Files_File f = NIL; - int16 i, error; + INT16 i, error; f = Files_files; while (f != NIL) { if (Platform_SameFile(identity, f->identity)) { @@ -422,11 +422,11 @@ static Files_File Files_CacheEntry (Platform_FileIdentity identity) Files_File Files_Old (CHAR *name, LONGINT name__len) { Files_File f = NIL; - int32 fd; - int16 pos; + INT32 fd; + INT16 pos; BOOLEAN done; CHAR dir[256], path[256]; - int16 error; + INT16 error; Platform_FileIdentity identity; __DUP(name, name__len, CHAR); if (name[0] != 0x00) { @@ -497,9 +497,9 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) void Files_Purge (Files_File f) { - int16 i; + INT16 i; Platform_FileIdentity identity; - int16 error; + INT16 error; i = 0; while (i < 4) { if (f->bufs[i] != NIL) { @@ -519,25 +519,25 @@ void Files_Purge (Files_File f) Platform_SetMTime(&f->identity, Platform_FileIdentity__typ, identity); } -void Files_GetDate (Files_File f, int32 *t, int32 *d) +void Files_GetDate (Files_File f, INT32 *t, INT32 *d) { Platform_FileIdentity identity; - int16 error; + INT16 error; Files_Create(f); error = Platform_Identify(f->fd, &identity, Platform_FileIdentity__typ); Platform_MTimeAsClock(identity, &*t, &*d); } -int32 Files_Pos (Files_Rider *r, address *r__typ) +INT32 Files_Pos (Files_Rider *r, ADDRESS *r__typ) { return (*r).org + (*r).offset; } -void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos) +void Files_Set (Files_Rider *r, ADDRESS *r__typ, Files_File f, INT32 pos) { - int32 org, offset, i, n; + INT32 org, offset, i, n; Files_Buffer buf = NIL; - int16 error; + INT16 error; if (f != NIL) { if (pos > f->len) { pos = f->len; @@ -595,9 +595,9 @@ void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos) (*r).res = 0; } -void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x) +void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x) { - int32 offset; + INT32 offset; Files_Buffer buf = NIL; buf = (*r).buf; offset = (*r).offset; @@ -619,9 +619,9 @@ void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x) } } -void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n) +void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n) { - int32 xpos, min, restInBuf, offset; + INT32 xpos, min, restInBuf, offset; Files_Buffer buf = NIL; if (n > x__len) { Files_IdxTrap(); @@ -655,15 +655,15 @@ void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x (*r).eof = 0; } -Files_File Files_Base (Files_Rider *r, address *r__typ) +Files_File Files_Base (Files_Rider *r, ADDRESS *r__typ) { return (*r).buf->f; } -void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x) +void Files_Write (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE x) { Files_Buffer buf = NIL; - int32 offset; + INT32 offset; buf = (*r).buf; offset = (*r).offset; if ((*r).org != buf->org || offset >= 4096) { @@ -681,9 +681,9 @@ void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x) (*r).res = 0; } -void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n) +void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n) { - int32 xpos, min, restInBuf, offset; + INT32 xpos, min, restInBuf, offset; Files_Buffer buf = NIL; if (n > x__len) { Files_IdxTrap(); @@ -717,17 +717,17 @@ void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT (*r).res = 0; } -void Files_Delete (CHAR *name, LONGINT name__len, int16 *res) +void Files_Delete (CHAR *name, LONGINT name__len, INT16 *res) { __DUP(name, name__len, CHAR); *res = Platform_Unlink((void*)name, name__len); __DEL(name); } -void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res) +void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT16 *res) { - int32 fdold, fdnew, n; - int16 error, ignore; + INT32 fdold, fdnew, n; + INT16 error, ignore; Platform_FileIdentity oldidentity, newidentity; CHAR buf[4096]; __DUP(old, old__len, CHAR); @@ -788,7 +788,7 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int void Files_Register (Files_File f) { - int16 idx, errcode; + INT16 idx, errcode; Files_File f1 = NIL; CHAR file[104]; if ((f->state == 1 && f->registerName[0] != 0x00)) { @@ -807,7 +807,7 @@ void Files_Register (Files_File f) } } -void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int16 *res) +void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INT16 *res) { __DUP(path, path__len, CHAR); *res = Platform_Chdir((void*)path, path__len); @@ -816,7 +816,7 @@ void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int16 *res) static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *dest, LONGINT dest__len) { - int32 i, j; + INT32 i, j; if (!Platform_LittleEndian) { i = src__len; j = 0; @@ -830,51 +830,51 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *de } } -void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x) +void Files_ReadBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN *x) { Files_Read(&*R, R__typ, (CHAR*)(void*)&*x); } -void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x) +void Files_ReadInt (Files_Rider *R, ADDRESS *R__typ, INT16 *x) { CHAR b[2]; Files_ReadBytes(&*R, R__typ, (void*)b, 2, 2); - *x = (int16)b[0] + __ASHL((int16)b[1], 8); + *x = (INT16)b[0] + __ASHL((INT16)b[1], 8); } -void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x) +void Files_ReadLInt (Files_Rider *R, ADDRESS *R__typ, INT32 *x) { CHAR b[4]; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); - *x = (((int16)b[0] + __ASHL((int16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); + *x = (((INT16)b[0] + __ASHL((INT16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); } -void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x) +void Files_ReadSet (Files_Rider *R, ADDRESS *R__typ, UINT32 *x) { CHAR b[4]; - int32 l; + INT32 l; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); - l = (((int16)b[0] + __ASHL((int16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); - *x = (uint32)l; + l = (((INT16)b[0] + __ASHL((INT16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); + *x = (UINT32)l; } -void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x) +void Files_ReadReal (Files_Rider *R, ADDRESS *R__typ, REAL *x) { CHAR b[4]; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); Files_FlipBytes((void*)b, 4, (void*)&*x, 4); } -void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x) +void Files_ReadLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL *x) { CHAR b[8]; Files_ReadBytes(&*R, R__typ, (void*)b, 8, 8); Files_FlipBytes((void*)b, 8, (void*)&*x, 8); } -void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) +void Files_ReadString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len) { - int16 i; + INT16 i; CHAR ch; i = 0; do { @@ -884,9 +884,9 @@ void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) } while (!(ch == 0x00)); } -void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) +void Files_ReadLine (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len) { - int16 i; + INT16 i; CHAR ch; BOOLEAN b; i = 0; @@ -902,29 +902,29 @@ void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) } while (!b); } -void Files_ReadNum (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len) +void Files_ReadNum (Files_Rider *R, ADDRESS *R__typ, SYSTEM_BYTE *x, LONGINT x__len) { - int8 s, b; - int64 q; + INT8 s, b; + INT64 q; s = 0; q = 0; Files_Read(&*R, R__typ, (void*)&b); while (b < 0) { - q += (int64)__ASH(((int16)b + 128), s); + q += (INT64)__ASH(((INT16)b + 128), s); s += 7; Files_Read(&*R, R__typ, (void*)&b); } - q += (int64)__ASH((__MASK(b, -64) - __ASHL(__ASHR(b, 6), 6)), s); + q += (INT64)__ASH((__MASK(b, -64) - __ASHL(__ASHR(b, 6), 6)), s); __ASSERT(x__len <= 8, 0); __MOVE((address)&q, (address)x, x__len); } -void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x) +void Files_WriteBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN x) { Files_Write(&*R, R__typ, __VAL(CHAR, x)); } -void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x) +void Files_WriteInt (Files_Rider *R, ADDRESS *R__typ, INT16 x) { CHAR b[2]; b[0] = (CHAR)x; @@ -932,7 +932,7 @@ void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x) Files_WriteBytes(&*R, R__typ, (void*)b, 2, 2); } -void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x) +void Files_WriteLInt (Files_Rider *R, ADDRESS *R__typ, INT32 x) { CHAR b[4]; b[0] = (CHAR)x; @@ -942,11 +942,11 @@ void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x) Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } -void Files_WriteSet (Files_Rider *R, address *R__typ, uint32 x) +void Files_WriteSet (Files_Rider *R, ADDRESS *R__typ, UINT32 x) { CHAR b[4]; - int32 i; - i = (int32)x; + INT32 i; + i = (INT32)x; b[0] = (CHAR)i; b[1] = (CHAR)__ASHR(i, 8); b[2] = (CHAR)__ASHR(i, 16); @@ -954,23 +954,23 @@ void Files_WriteSet (Files_Rider *R, address *R__typ, uint32 x) Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } -void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x) +void Files_WriteReal (Files_Rider *R, ADDRESS *R__typ, REAL x) { CHAR b[4]; Files_FlipBytes((void*)&x, 4, (void*)b, 4); Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } -void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x) +void Files_WriteLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL x) { CHAR b[8]; Files_FlipBytes((void*)&x, 8, (void*)b, 8); Files_WriteBytes(&*R, R__typ, (void*)b, 8, 8); } -void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) +void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len) { - int16 i; + INT16 i; i = 0; while (x[i] != 0x00) { i += 1; @@ -978,7 +978,7 @@ void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len Files_WriteBytes(&*R, R__typ, (void*)x, x__len * 1, i + 1); } -void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x) +void Files_WriteNum (Files_Rider *R, ADDRESS *R__typ, INT64 x) { while (x < -64 || x > 63) { Files_Write(&*R, R__typ, (CHAR)(__MASK(x, -128) + 128)); @@ -995,7 +995,7 @@ void Files_GetName (Files_File f, CHAR *name, LONGINT name__len) static void Files_Finalize (SYSTEM_PTR o) { Files_File f = NIL; - int32 res; + INT32 res; f = (Files_File)(address)o; if (f->fd >= 0) { Files_CloseOSFile(f); diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 06ca3f58..47c54d97 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h @@ -10,61 +10,61 @@ typedef typedef struct Files_FileDesc { - int64 _prvt0; + INT64 _prvt0; char _prvt1[208]; - int32 fd; + INT32 fd; char _prvt2[60]; } Files_FileDesc; typedef struct Files_Rider { - int32 res; + INT32 res; BOOLEAN eof; - int64 _prvt0; + INT64 _prvt0; char _prvt1[8]; } Files_Rider; -import address *Files_FileDesc__typ; -import address *Files_Rider__typ; +import ADDRESS *Files_FileDesc__typ; +import ADDRESS *Files_Rider__typ; -import Files_File Files_Base (Files_Rider *r, address *r__typ); -import void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int16 *res); +import Files_File Files_Base (Files_Rider *r, ADDRESS *r__typ); +import void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INT16 *res); import void Files_Close (Files_File f); -import void Files_Delete (CHAR *name, LONGINT name__len, int16 *res); -import void Files_GetDate (Files_File f, int32 *t, int32 *d); +import void Files_Delete (CHAR *name, LONGINT name__len, INT16 *res); +import void Files_GetDate (Files_File f, INT32 *t, INT32 *d); import void Files_GetName (Files_File f, CHAR *name, LONGINT name__len); -import int32 Files_Length (Files_File f); +import INT32 Files_Length (Files_File f); import Files_File Files_New (CHAR *name, LONGINT name__len); import Files_File Files_Old (CHAR *name, LONGINT name__len); -import int32 Files_Pos (Files_Rider *r, address *r__typ); +import INT32 Files_Pos (Files_Rider *r, ADDRESS *r__typ); import void Files_Purge (Files_File f); -import void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x); -import void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x); -import void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); -import void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x); -import void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); -import void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); -import void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); -import void Files_ReadNum (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len); -import void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); -import void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x); -import void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); +import void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x); +import void Files_ReadBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN *x); +import void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n); +import void Files_ReadInt (Files_Rider *R, ADDRESS *R__typ, INT16 *x); +import void Files_ReadLInt (Files_Rider *R, ADDRESS *R__typ, INT32 *x); +import void Files_ReadLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL *x); +import void Files_ReadLine (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); +import void Files_ReadNum (Files_Rider *R, ADDRESS *R__typ, SYSTEM_BYTE *x, LONGINT x__len); +import void Files_ReadReal (Files_Rider *R, ADDRESS *R__typ, REAL *x); +import void Files_ReadSet (Files_Rider *R, ADDRESS *R__typ, UINT32 *x); +import void Files_ReadString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); import void Files_Register (Files_File f); -import void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res); -import void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos); +import void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT16 *res); +import void Files_Set (Files_Rider *r, ADDRESS *r__typ, Files_File f, INT32 pos); import void Files_SetSearchPath (CHAR *path, LONGINT path__len); -import void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x); -import void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x); -import void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); -import void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x); -import void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x); -import void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x); -import void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x); -import void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x); -import void Files_WriteSet (Files_Rider *R, address *R__typ, uint32 x); -import void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); +import void Files_Write (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE x); +import void Files_WriteBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN x); +import void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n); +import void Files_WriteInt (Files_Rider *R, ADDRESS *R__typ, INT16 x); +import void Files_WriteLInt (Files_Rider *R, ADDRESS *R__typ, INT32 x); +import void Files_WriteLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL x); +import void Files_WriteNum (Files_Rider *R, ADDRESS *R__typ, INT64 x); +import void Files_WriteReal (Files_Rider *R, ADDRESS *R__typ, REAL x); +import void Files_WriteSet (Files_Rider *R, ADDRESS *R__typ, UINT32 x); +import void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); import void *Files__init(void); diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index 5117800b..a162ea04 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" @@ -40,7 +40,7 @@ typedef typedef struct Heap_FinDesc { Heap_FinNode next; - int64 obj; + INT64 obj; BOOLEAN marked; Heap_Finalizer finalize; } Heap_FinDesc; @@ -55,53 +55,53 @@ typedef struct Heap_ModuleDesc { Heap_Module next; Heap_ModuleName name; - int32 refcnt; + INT32 refcnt; Heap_Cmd cmds; - int64 types; + INT64 types; Heap_EnumProc enumPtrs; - int32 reserved1, reserved2; + INT32 reserved1, reserved2; } Heap_ModuleDesc; export SYSTEM_PTR Heap_modules; -static int64 Heap_freeList[10]; -static int64 Heap_bigBlocks; -export int64 Heap_allocated; +static INT64 Heap_freeList[10]; +static INT64 Heap_bigBlocks; +export INT64 Heap_allocated; static BOOLEAN Heap_firstTry; -static int64 Heap_heap, Heap_heapend; -export int64 Heap_heapsize; +static INT64 Heap_heap, Heap_heapend; +export INT64 Heap_heapsize; static Heap_FinNode Heap_fin; -static int16 Heap_lockdepth; +static INT16 Heap_lockdepth; static BOOLEAN Heap_interrupted; -export int16 Heap_FileCount; +export INT16 Heap_FileCount; -export address *Heap_ModuleDesc__typ; -export address *Heap_CmdDesc__typ; -export address *Heap_FinDesc__typ; -export address *Heap__1__typ; +export ADDRESS *Heap_ModuleDesc__typ; +export ADDRESS *Heap_CmdDesc__typ; +export ADDRESS *Heap_FinDesc__typ; +export ADDRESS *Heap__1__typ; static void Heap_CheckFin (void); -static void Heap_ExtendHeap (int64 blksz); +static void Heap_ExtendHeap (INT64 blksz); export void Heap_FINALL (void); static void Heap_Finalize (void); export void Heap_GC (BOOLEAN markStack); -static void Heap_HeapSort (int64 n, int64 *a, LONGINT a__len); +static void Heap_HeapSort (INT64 n, INT64 *a, LONGINT a__len); export void Heap_INCREF (Heap_Module m); export void Heap_InitHeap (void); export void Heap_Lock (void); -static void Heap_Mark (int64 q); -static void Heap_MarkCandidates (int64 n, int64 *cand, LONGINT cand__len); +static void Heap_Mark (INT64 q); +static void Heap_MarkCandidates (INT64 n, INT64 *cand, LONGINT cand__len); static void Heap_MarkP (SYSTEM_PTR p); -static void Heap_MarkStack (int64 n, int64 *cand, LONGINT cand__len); -export SYSTEM_PTR Heap_NEWBLK (int64 size); -export SYSTEM_PTR Heap_NEWREC (int64 tag); -static int64 Heap_NewChunk (int64 blksz); +static void Heap_MarkStack (INT64 n, INT64 *cand, LONGINT cand__len); +export SYSTEM_PTR Heap_NEWBLK (INT64 size); +export SYSTEM_PTR Heap_NEWREC (INT64 tag); +static INT64 Heap_NewChunk (INT64 blksz); export void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); export SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -export void Heap_REGTYP (Heap_Module m, int64 typ); +export void Heap_REGTYP (Heap_Module m, INT64 typ); export void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); static void Heap_Scan (void); -static void Heap_Sift (int64 l, int64 r, int64 *a, LONGINT a__len); +static void Heap_Sift (INT64 l, INT64 r, INT64 *a, LONGINT a__len); export void Heap_Unlock (void); extern void *Heap__init(); @@ -157,9 +157,9 @@ void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) m->cmds = c; } -void Heap_REGTYP (Heap_Module m, int64 typ) +void Heap_REGTYP (Heap_Module m, INT64 typ) { - __PUT(typ, m->types, int64); + __PUT(typ, m->types, INT64); m->types = typ; } @@ -168,25 +168,25 @@ void Heap_INCREF (Heap_Module m) m->refcnt += 1; } -static int64 Heap_NewChunk (int64 blksz) +static INT64 Heap_NewChunk (INT64 blksz) { - int64 chnk; + INT64 chnk; chnk = Heap_OSAllocate(blksz + 24); if (chnk != 0) { - __PUT(chnk + 8, chnk + (24 + blksz), int64); - __PUT(chnk + 24, chnk + 32, int64); - __PUT(chnk + 32, blksz, int64); - __PUT(chnk + 40, -8, int64); - __PUT(chnk + 48, Heap_bigBlocks, int64); + __PUT(chnk + 8, chnk + (24 + blksz), INT64); + __PUT(chnk + 24, chnk + 32, INT64); + __PUT(chnk + 32, blksz, INT64); + __PUT(chnk + 40, -8, INT64); + __PUT(chnk + 48, Heap_bigBlocks, INT64); Heap_bigBlocks = chnk + 24; Heap_heapsize += blksz; } return chnk; } -static void Heap_ExtendHeap (int64 blksz) +static void Heap_ExtendHeap (INT64 blksz) { - int64 size, chnk, j, next; + INT64 size, chnk, j, next; if (blksz > 320000) { size = blksz; } else { @@ -195,30 +195,30 @@ static void Heap_ExtendHeap (int64 blksz) chnk = Heap_NewChunk(size); if (chnk != 0) { if (chnk < Heap_heap) { - __PUT(chnk, Heap_heap, int64); + __PUT(chnk, Heap_heap, INT64); Heap_heap = chnk; } else { j = Heap_heap; - __GET(j, next, int64); + __GET(j, next, INT64); while ((next != 0 && chnk > next)) { j = next; - __GET(j, next, int64); + __GET(j, next, INT64); } - __PUT(chnk, next, int64); - __PUT(j, chnk, int64); + __PUT(chnk, next, INT64); + __PUT(j, chnk, INT64); } if (next == 0) { - __GET(chnk + 8, Heap_heapend, int64); + __GET(chnk + 8, Heap_heapend, INT64); } } } -SYSTEM_PTR Heap_NEWREC (int64 tag) +SYSTEM_PTR Heap_NEWREC (INT64 tag) { - int64 i, i0, di, blksz, restsize, t, adr, end, next, prev; + INT64 i, i0, di, blksz, restsize, t, adr, end, next, prev; SYSTEM_PTR new; Heap_Lock(); - __GET(tag, blksz, int64); + __GET(tag, blksz, INT64); i0 = __ASHR(blksz, 5); i = i0; if (i < 9) { @@ -229,17 +229,17 @@ SYSTEM_PTR Heap_NEWREC (int64 tag) } } if (i < 9) { - __GET(adr + 24, next, int64); + __GET(adr + 24, next, INT64); Heap_freeList[i] = next; if (i != i0) { di = i - i0; restsize = __ASHL(di, 5); end = adr + restsize; - __PUT(end + 8, blksz, int64); - __PUT(end + 16, -8, int64); - __PUT(end, end + 8, int64); - __PUT(adr + 8, restsize, int64); - __PUT(adr + 24, Heap_freeList[di], int64); + __PUT(end + 8, blksz, INT64); + __PUT(end + 16, -8, INT64); + __PUT(end, end + 8, INT64); + __PUT(adr + 8, restsize, INT64); + __PUT(adr + 24, Heap_freeList[di], INT64); Heap_freeList[di] = adr; adr += restsize; } @@ -268,31 +268,31 @@ SYSTEM_PTR Heap_NEWREC (int64 tag) return NIL; } } - __GET(adr + 8, t, int64); + __GET(adr + 8, t, INT64); if (t >= blksz) { break; } prev = adr; - __GET(adr + 24, adr, int64); + __GET(adr + 24, adr, INT64); } restsize = t - blksz; end = adr + restsize; - __PUT(end + 8, blksz, int64); - __PUT(end + 16, -8, int64); - __PUT(end, end + 8, int64); + __PUT(end + 8, blksz, INT64); + __PUT(end + 16, -8, INT64); + __PUT(end, end + 8, INT64); if (restsize > 288) { - __PUT(adr + 8, restsize, int64); + __PUT(adr + 8, restsize, INT64); } else { - __GET(adr + 24, next, int64); + __GET(adr + 24, next, INT64); if (prev == 0) { Heap_bigBlocks = next; } else { - __PUT(prev + 24, next, int64); + __PUT(prev + 24, next, INT64); } if (restsize > 0) { di = __ASHR(restsize, 5); - __PUT(adr + 8, restsize, int64); - __PUT(adr + 24, Heap_freeList[di], int64); + __PUT(adr + 8, restsize, INT64); + __PUT(adr + 24, Heap_freeList[di], INT64); Heap_freeList[di] = adr; } } @@ -301,69 +301,69 @@ SYSTEM_PTR Heap_NEWREC (int64 tag) i = adr + 32; end = adr + blksz; while (i < end) { - __PUT(i, 0, int64); - __PUT(i + 8, 0, int64); - __PUT(i + 16, 0, int64); - __PUT(i + 24, 0, int64); + __PUT(i, 0, INT64); + __PUT(i + 8, 0, INT64); + __PUT(i + 16, 0, INT64); + __PUT(i + 24, 0, INT64); i += 32; } - __PUT(adr + 24, 0, int64); - __PUT(adr, tag, int64); - __PUT(adr + 8, 0, int64); - __PUT(adr + 16, 0, int64); + __PUT(adr + 24, 0, INT64); + __PUT(adr, tag, INT64); + __PUT(adr + 8, 0, INT64); + __PUT(adr + 16, 0, INT64); Heap_allocated += blksz; Heap_Unlock(); return (SYSTEM_PTR)(address)(adr + 8); } -SYSTEM_PTR Heap_NEWBLK (int64 size) +SYSTEM_PTR Heap_NEWBLK (INT64 size) { - int64 blksz, tag; + INT64 blksz, tag; SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 63, 5), 5); new = Heap_NEWREC((address)&blksz); - tag = ((int64)(address)new + blksz) - 24; - __PUT(tag - 8, 0, int64); - __PUT(tag, blksz, int64); - __PUT(tag + 8, -8, int64); - __PUT((int64)(address)new - 8, tag, int64); + tag = ((INT64)(address)new + blksz) - 24; + __PUT(tag - 8, 0, INT64); + __PUT(tag, blksz, INT64); + __PUT(tag + 8, -8, INT64); + __PUT((INT64)(address)new - 8, tag, INT64); Heap_Unlock(); return new; } -static void Heap_Mark (int64 q) +static void Heap_Mark (INT64 q) { - int64 p, tag, offset, fld, n, tagbits; + INT64 p, tag, offset, fld, n, tagbits; if (q != 0) { - __GET(q - 8, tagbits, int64); + __GET(q - 8, tagbits, INT64); if (!__ODD(tagbits)) { - __PUT(q - 8, tagbits + 1, int64); + __PUT(q - 8, tagbits + 1, INT64); p = 0; tag = tagbits + 8; for (;;) { - __GET(tag, offset, int64); + __GET(tag, offset, INT64); if (offset < 0) { - __PUT(q - 8, (tag + offset) + 1, int64); + __PUT(q - 8, (tag + offset) + 1, INT64); if (p == 0) { break; } n = q; q = p; - __GET(q - 8, tag, int64); + __GET(q - 8, tag, INT64); tag -= 1; - __GET(tag, offset, int64); + __GET(tag, offset, INT64); fld = q + offset; - __GET(fld, p, int64); + __GET(fld, p, INT64); __PUT(fld, (SYSTEM_PTR)(address)n, SYSTEM_PTR); } else { fld = q + offset; - __GET(fld, n, int64); + __GET(fld, n, INT64); if (n != 0) { - __GET(n - 8, tagbits, int64); + __GET(n - 8, tagbits, INT64); if (!__ODD(tagbits)) { - __PUT(n - 8, tagbits + 1, int64); - __PUT(q - 8, tag + 1, int64); + __PUT(n - 8, tagbits + 1, INT64); + __PUT(q - 8, tag + 1, INT64); __PUT(fld, (SYSTEM_PTR)(address)p, SYSTEM_PTR); p = q; q = n; @@ -379,12 +379,12 @@ static void Heap_Mark (int64 q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((int64)(address)p); + Heap_Mark((INT64)(address)p); } static void Heap_Scan (void) { - int64 chnk, adr, end, start, tag, i, size, freesize; + INT64 chnk, adr, end, start, tag, i, size, freesize; Heap_bigBlocks = 0; i = 1; while (i < 9) { @@ -396,58 +396,58 @@ static void Heap_Scan (void) chnk = Heap_heap; while (chnk != 0) { adr = chnk + 24; - __GET(chnk + 8, end, int64); + __GET(chnk + 8, end, INT64); while (adr < end) { - __GET(adr, tag, int64); + __GET(adr, tag, INT64); if (__ODD(tag)) { if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 8, int64); - __PUT(start + 8, freesize, int64); - __PUT(start + 16, -8, int64); + __PUT(start, start + 8, INT64); + __PUT(start + 8, freesize, INT64); + __PUT(start + 16, -8, INT64); i = __ASHR(freesize, 5); freesize = 0; if (i < 9) { - __PUT(start + 24, Heap_freeList[i], int64); + __PUT(start + 24, Heap_freeList[i], INT64); Heap_freeList[i] = start; } else { - __PUT(start + 24, Heap_bigBlocks, int64); + __PUT(start + 24, Heap_bigBlocks, INT64); Heap_bigBlocks = start; } } tag -= 1; - __PUT(adr, tag, int64); - __GET(tag, size, int64); + __PUT(adr, tag, INT64); + __GET(tag, size, INT64); Heap_allocated += size; adr += size; } else { - __GET(tag, size, int64); + __GET(tag, size, INT64); freesize += size; adr += size; } } if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 8, int64); - __PUT(start + 8, freesize, int64); - __PUT(start + 16, -8, int64); + __PUT(start, start + 8, INT64); + __PUT(start + 8, freesize, INT64); + __PUT(start + 16, -8, INT64); i = __ASHR(freesize, 5); freesize = 0; if (i < 9) { - __PUT(start + 24, Heap_freeList[i], int64); + __PUT(start + 24, Heap_freeList[i], INT64); Heap_freeList[i] = start; } else { - __PUT(start + 24, Heap_bigBlocks, int64); + __PUT(start + 24, Heap_bigBlocks, INT64); Heap_bigBlocks = start; } } - __GET(chnk, chnk, int64); + __GET(chnk, chnk, INT64); } } -static void Heap_Sift (int64 l, int64 r, int64 *a, LONGINT a__len) +static void Heap_Sift (INT64 l, INT64 r, INT64 *a, LONGINT a__len) { - int64 i, j, x; + INT64 i, j, x; j = l; x = a[j]; for (;;) { @@ -464,9 +464,9 @@ static void Heap_Sift (int64 l, int64 r, int64 *a, LONGINT a__len) a[i] = x; } -static void Heap_HeapSort (int64 n, int64 *a, LONGINT a__len) +static void Heap_HeapSort (INT64 n, INT64 *a, LONGINT a__len) { - int64 l, r, x; + INT64 l, r, x; l = __ASHR(n, 1); r = n - 1; while (l > 0) { @@ -482,25 +482,25 @@ static void Heap_HeapSort (int64 n, int64 *a, LONGINT a__len) } } -static void Heap_MarkCandidates (int64 n, int64 *cand, LONGINT cand__len) +static void Heap_MarkCandidates (INT64 n, INT64 *cand, LONGINT cand__len) { - int64 chnk, adr, tag, next, lim, lim1, i, ptr, size; + INT64 chnk, adr, tag, next, lim, lim1, i, ptr, size; chnk = Heap_heap; i = 0; lim = cand[n - 1]; while ((chnk != 0 && chnk < lim)) { adr = chnk + 24; - __GET(chnk + 8, lim1, int64); + __GET(chnk + 8, lim1, INT64); if (lim < lim1) { lim1 = lim; } while (adr < lim1) { - __GET(adr, tag, int64); + __GET(adr, tag, INT64); if (__ODD(tag)) { - __GET(tag - 1, size, int64); + __GET(tag - 1, size, INT64); adr += size; } else { - __GET(tag, size, int64); + __GET(tag, size, INT64); ptr = adr + 8; while (cand[i] < ptr) { i += 1; @@ -515,17 +515,17 @@ static void Heap_MarkCandidates (int64 n, int64 *cand, LONGINT cand__len) adr = next; } } - __GET(chnk, chnk, int64); + __GET(chnk, chnk, INT64); } } static void Heap_CheckFin (void) { Heap_FinNode n; - int64 tag; + INT64 tag; n = Heap_fin; while (n != NIL) { - __GET(n->obj - 8, tag, int64); + __GET(n->obj - 8, tag, INT64); if (!__ODD(tag)) { n->marked = 0; Heap_Mark(n->obj); @@ -571,10 +571,10 @@ void Heap_FINALL (void) } } -static void Heap_MarkStack (int64 n, int64 *cand, LONGINT cand__len) +static void Heap_MarkStack (INT64 n, INT64 *cand, LONGINT cand__len) { SYSTEM_PTR frame; - int64 inc, nofcand, sp, p, stack0; + INT64 inc, nofcand, sp, p, stack0; struct Heap__1 align; if (n > 0) { Heap_MarkStack(n - 1, cand, cand__len); @@ -591,9 +591,9 @@ static void Heap_MarkStack (int64 n, int64 *cand, LONGINT cand__len) inc = -inc; } while (sp != stack0) { - __GET(sp, p, int64); + __GET(sp, p, INT64); if ((p > Heap_heap && p < Heap_heapend)) { - if (nofcand == (int64)cand__len) { + if (nofcand == (INT64)cand__len) { Heap_HeapSort(nofcand, (void*)cand, cand__len); Heap_MarkCandidates(nofcand, (void*)cand, cand__len); nofcand = 0; @@ -613,8 +613,8 @@ static void Heap_MarkStack (int64 n, int64 *cand, LONGINT cand__len) void Heap_GC (BOOLEAN markStack) { Heap_Module m; - int64 i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; - int64 cand[10000]; + INT64 i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; + INT64 cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); m = (Heap_Module)(address)Heap_modules; @@ -694,7 +694,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (int64)(address)obj; + f->obj = (INT64)(address)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; @@ -704,8 +704,8 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) void Heap_InitHeap (void) { Heap_heap = Heap_NewChunk(256000); - __GET(Heap_heap + 8, Heap_heapend, int64); - __PUT(Heap_heap, 0, int64); + __GET(Heap_heap + 8, Heap_heapend, INT64); + __PUT(Heap_heap, 0, INT64); Heap_allocated = 0; Heap_firstTry = 1; Heap_freeList[9] = 1; diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index b0c90472..0b6a9d03 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h @@ -22,7 +22,7 @@ typedef typedef struct Heap_ModuleDesc { - int64 _prvt0; + INT64 _prvt0; char _prvt1[56]; } Heap_ModuleDesc; @@ -31,21 +31,21 @@ typedef import SYSTEM_PTR Heap_modules; -import int64 Heap_allocated, Heap_heapsize; -import int16 Heap_FileCount; +import INT64 Heap_allocated, Heap_heapsize; +import INT16 Heap_FileCount; -import address *Heap_ModuleDesc__typ; +import ADDRESS *Heap_ModuleDesc__typ; import void Heap_FINALL (void); import void Heap_GC (BOOLEAN markStack); import void Heap_INCREF (Heap_Module m); import void Heap_InitHeap (void); import void Heap_Lock (void); -import SYSTEM_PTR Heap_NEWBLK (int64 size); -import SYSTEM_PTR Heap_NEWREC (int64 tag); +import SYSTEM_PTR Heap_NEWBLK (INT64 size); +import SYSTEM_PTR Heap_NEWREC (INT64 tag); import void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); import SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -import void Heap_REGTYP (Heap_Module m, int64 typ); +import void Heap_REGTYP (Heap_Module m, INT64 typ); import void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); import void Heap_Unlock (void); import void *Heap__init(void); diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 97e17ad2..39e2d6ca 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "Heap.h" @@ -31,20 +31,20 @@ typedef struct Modules_ModuleDesc { Modules_Module next; Modules_ModuleName name; - int32 refcnt; + INT32 refcnt; Modules_Cmd cmds; - int32 types; - void (*enumPtrs)(void(*)(int32)); - int32 reserved1, reserved2; + INT32 types; + void (*enumPtrs)(void(*)(INT32)); + INT32 reserved1, reserved2; } Modules_ModuleDesc; -export int16 Modules_res; +export INT16 Modules_res; export CHAR Modules_resMsg[256]; export Modules_ModuleName Modules_imported, Modules_importing; -export address *Modules_ModuleDesc__typ; -export address *Modules_CmdDesc__typ; +export ADDRESS *Modules_ModuleDesc__typ; +export ADDRESS *Modules_CmdDesc__typ; static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len); export void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all); @@ -56,7 +56,7 @@ export Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len); static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len) { - int16 i, j; + INT16 i, j; __DUP(b, b__len, CHAR); i = 0; while (a[__X(i, a__len)] != 0x00) { diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index a7b62fe3..c2afbd3c 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h @@ -28,20 +28,20 @@ typedef struct Modules_ModuleDesc { Modules_Module next; Modules_ModuleName name; - int32 refcnt; + INT32 refcnt; Modules_Cmd cmds; - int32 types; - void (*enumPtrs)(void(*)(int32)); + INT32 types; + void (*enumPtrs)(void(*)(INT32)); char _prvt0[8]; } Modules_ModuleDesc; -import int16 Modules_res; +import INT16 Modules_res; import CHAR Modules_resMsg[256]; import Modules_ModuleName Modules_imported, Modules_importing; -import address *Modules_ModuleDesc__typ; -import address *Modules_CmdDesc__typ; +import ADDRESS *Modules_ModuleDesc__typ; +import ADDRESS *Modules_CmdDesc__typ; import void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all); import Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len); diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index dff6adc6..60993ebe 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "OPM.h" @@ -11,13 +11,13 @@ #include "OPT.h" -static int16 OPB_exp; -static int64 OPB_maxExp; +static INT16 OPB_exp; +static INT64 OPB_maxExp; export void OPB_Assign (OPT_Node *x, OPT_Node y); -static void OPB_BindNodes (int8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y); -static int16 OPB_BoolToInt (BOOLEAN b); +static void OPB_BindNodes (INT8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y); +static INT16 OPB_BoolToInt (BOOLEAN b); export void OPB_Call (OPT_Node *x, OPT_Node apar, OPT_Object fp); static void OPB_CharToString (OPT_Node n); static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode); @@ -25,10 +25,10 @@ static void OPB_CheckLeaf (OPT_Node x, BOOLEAN dynArrToo); export void OPB_CheckParameters (OPT_Object fp, OPT_Object ap, BOOLEAN checkNames); static void OPB_CheckProc (OPT_Struct x, OPT_Object y); static void OPB_CheckPtr (OPT_Node x, OPT_Node y); -static void OPB_CheckRealType (int16 f, int16 nr, OPT_Const x); +static void OPB_CheckRealType (INT16 f, INT16 nr, OPT_Const x); static void OPB_CheckReceiver (OPT_Node *x, OPT_Object fp); -static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y); -export void OPB_Construct (int8 class, OPT_Node *x, OPT_Node y); +static void OPB_ConstOp (INT16 op, OPT_Node x, OPT_Node y); +export void OPB_Construct (INT8 class, OPT_Node *x, OPT_Node y); static void OPB_Convert (OPT_Node *x, OPT_Struct typ); export void OPB_DeRef (OPT_Node *x); static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpar); @@ -38,17 +38,17 @@ export void OPB_Field (OPT_Node *x, OPT_Object y); export void OPB_In (OPT_Node *x, OPT_Node y); export void OPB_Index (OPT_Node *x, OPT_Node y); export void OPB_Inittd (OPT_Node *inittd, OPT_Node *last, OPT_Struct typ); -static BOOLEAN OPB_IntToBool (int64 i); +static BOOLEAN OPB_IntToBool (INT64 i); export void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y); -export void OPB_MOp (int8 op, OPT_Node *x); +export void OPB_MOp (INT8 op, OPT_Node *x); export OPT_Node OPB_NewBoolConst (BOOLEAN boolval); -export OPT_Node OPB_NewIntConst (int64 intval); +export OPT_Node OPB_NewIntConst (INT64 intval); export OPT_Node OPB_NewLeaf (OPT_Object obj); export OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ); -export OPT_Node OPB_NewString (OPS_String str, int64 len); +export OPT_Node OPB_NewString (OPS_String str, INT64 len); export OPT_Node OPB_Nil (void); static BOOLEAN OPB_NotVar (OPT_Node x); -export void OPB_Op (int8 op, OPT_Node *x, OPT_Node y); +export void OPB_Op (INT8 op, OPT_Node *x, OPT_Node y); export void OPB_OptIf (OPT_Node *x); export void OPB_Param (OPT_Node ap, OPT_Object fp); export void OPB_PrepCall (OPT_Node *x, OPT_Object *fpar); @@ -57,17 +57,17 @@ export void OPB_SetElem (OPT_Node *x); static void OPB_SetIntType (OPT_Node node); export void OPB_SetRange (OPT_Node *x, OPT_Node y); static void OPB_SetSetType (OPT_Node node); -export void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno); -export void OPB_StPar0 (OPT_Node *par0, int16 fctno); -export void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno); -export void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n); -export void OPB_StaticLink (int8 dlev); +export void OPB_StFct (OPT_Node *par0, INT8 fctno, INT16 parno); +export void OPB_StPar0 (OPT_Node *par0, INT16 fctno); +export void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno); +export void OPB_StParN (OPT_Node *par0, OPT_Node x, INT16 fctno, INT16 n); +export void OPB_StaticLink (INT8 dlev); export void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard); -static void OPB_err (int16 n); -static int64 OPB_log (int64 x); +static void OPB_err (INT16 n); +static INT64 OPB_log (INT64 x); -static void OPB_err (int16 n) +static void OPB_err (INT16 n) { OPM_err(n); } @@ -104,7 +104,7 @@ OPT_Node OPB_NewLeaf (OPT_Object obj) return node; } -void OPB_Construct (int8 class, OPT_Node *x, OPT_Node y) +void OPB_Construct (INT8 class, OPT_Node *x, OPT_Node y) { OPT_Node node = NIL; node = OPT_NewNode(class); @@ -127,7 +127,7 @@ void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y) *last = y; } -static int16 OPB_BoolToInt (BOOLEAN b) +static INT16 OPB_BoolToInt (BOOLEAN b) { if (b) { return 1; @@ -137,7 +137,7 @@ static int16 OPB_BoolToInt (BOOLEAN b) __RETCHK; } -static BOOLEAN OPB_IntToBool (int64 i) +static BOOLEAN OPB_IntToBool (INT64 i) { return i != 0; } @@ -214,8 +214,8 @@ static void OPB_SetIntType (OPT_Node node) static void OPB_SetSetType (OPT_Node node) { - int32 i32; - __GET((address)&node->conval->setval + 4, i32, int32); + INT32 i32; + __GET((address)&node->conval->setval + 4, i32, INT32); if (i32 == 0) { node->typ = OPT_set32typ; } else { @@ -223,7 +223,7 @@ static void OPB_SetSetType (OPT_Node node) } } -OPT_Node OPB_NewIntConst (int64 intval) +OPT_Node OPB_NewIntConst (INT64 intval) { OPT_Node x = NIL; x = OPT_NewNode(7); @@ -244,7 +244,7 @@ OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ) return x; } -OPT_Node OPB_NewString (OPS_String str, int64 len) +OPT_Node OPB_NewString (OPS_String str, INT64 len) { OPT_Node x = NIL; x = OPT_NewNode(7); @@ -274,7 +274,7 @@ static void OPB_CharToString (OPT_Node n) n->obj = NIL; } -static void OPB_BindNodes (int8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y) +static void OPB_BindNodes (INT8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y) { OPT_Node node = NIL; node = OPT_NewNode(class); @@ -314,7 +314,7 @@ void OPB_DeRef (OPT_Node *x) void OPB_Index (OPT_Node *x, OPT_Node y) { - int16 f; + INT16 f; OPT_Struct typ = NIL; f = y->typ->form; if ((*x)->class >= 7) { @@ -325,7 +325,7 @@ void OPB_Index (OPT_Node *x, OPT_Node y) } if ((*x)->typ->comp == 2) { typ = (*x)->typ->BaseTyp; - if ((y->class == 7 && (y->conval->intval < 0 || y->conval->intval >= (int64)(*x)->typ->n))) { + if ((y->class == 7 && (y->conval->intval < 0 || y->conval->intval >= (INT64)(*x)->typ->n))) { OPB_err(81); } } else if ((*x)->typ->comp == 3) { @@ -439,15 +439,15 @@ void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) void OPB_In (OPT_Node *x, OPT_Node y) { - int16 f; - int64 k; + INT16 f; + INT64 k; f = (*x)->typ->form; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); } else if ((f == 4 && y->typ->form == 7)) { if ((*x)->class == 7) { k = (*x)->conval->intval; - if (k < 0 || k >= (int64)__ASHL(y->typ->size, 3)) { + if (k < 0 || k >= (INT64)__ASHL(y->typ->size, 3)) { OPB_err(202); } else if (y->class == 7) { (*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval, 64)); @@ -466,7 +466,7 @@ void OPB_In (OPT_Node *x, OPT_Node y) (*x)->typ = OPT_booltyp; } -static int64 OPB_log (int64 x) +static INT64 OPB_log (INT64 x) { OPB_exp = 0; if (x > 0) { @@ -478,7 +478,7 @@ static int64 OPB_log (int64 x) return x; } -static void OPB_CheckRealType (int16 f, int16 nr, OPT_Const x) +static void OPB_CheckRealType (INT16 f, INT16 nr, OPT_Const x) { LONGREAL min, max, r; if (f == 5) { @@ -502,9 +502,9 @@ static struct MOp__28 { struct MOp__28 *lnk; } *MOp__28_s; -static OPT_Node NewOp__29 (int8 op, OPT_Struct typ, OPT_Node z); +static OPT_Node NewOp__29 (INT8 op, OPT_Struct typ, OPT_Node z); -static OPT_Node NewOp__29 (int8 op, OPT_Struct typ, OPT_Node z) +static OPT_Node NewOp__29 (INT8 op, OPT_Struct typ, OPT_Node z) { OPT_Node node = NIL; node = OPT_NewNode(11); @@ -514,9 +514,9 @@ static OPT_Node NewOp__29 (int8 op, OPT_Struct typ, OPT_Node z) return node; } -void OPB_MOp (int8 op, OPT_Node *x) +void OPB_MOp (INT8 op, OPT_Node *x) { - int16 f; + INT16 f; OPT_Struct typ = NIL; OPT_Node z = NIL; struct MOp__28 _s; @@ -597,7 +597,7 @@ void OPB_MOp (int8 op, OPT_Node *x) case 22: if (f == 3) { if (z->class == 7) { - z->conval->intval = (int16)__CAP((CHAR)z->conval->intval); + z->conval->intval = (INT16)__CAP((CHAR)z->conval->intval); z->obj = NIL; } else { z = NewOp__29(op, typ, z); @@ -657,7 +657,7 @@ void OPB_MOp (int8 op, OPT_Node *x) static void OPB_CheckPtr (OPT_Node x, OPT_Node y) { - int16 g; + INT16 g; OPT_Struct p = NIL, q = NIL, t = NIL; g = y->typ->form; if (g == 11) { @@ -741,16 +741,16 @@ static void OPB_CheckProc (OPT_Struct x, OPT_Object y) static struct ConstOp__13 { OPT_Node *x; - int16 *f; + INT16 *f; OPT_Const *xval, *yval; struct ConstOp__13 *lnk; } *ConstOp__13_s; -static int16 ConstCmp__14 (void); +static INT16 ConstCmp__14 (void); -static int16 ConstCmp__14 (void) +static INT16 ConstCmp__14 (void) { - int16 res; + INT16 res; switch (*ConstOp__13_s->f) { case 0: res = 9; @@ -813,11 +813,11 @@ static int16 ConstCmp__14 (void) return res; } -static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) +static void OPB_ConstOp (INT16 op, OPT_Node x, OPT_Node y) { - int16 f, g; + INT16 f, g; OPT_Const xval = NIL, yval = NIL; - int64 xv, yv; + INT64 xv, yv; BOOLEAN temp; struct ConstOp__13 _s; _s.x = &x; @@ -1097,8 +1097,8 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) static void OPB_Convert (OPT_Node *x, OPT_Struct typ) { OPT_Node node = NIL; - int16 f, g; - int64 k; + INT16 f, g; + INT64 k; LONGREAL r; f = (*x)->typ->form; g = typ->form; @@ -1136,12 +1136,12 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) OPB_err(203); r = (LONGREAL)1; } - (*x)->conval->intval = (int32)__ENTIER(r); + (*x)->conval->intval = (INT32)__ENTIER(r); OPB_SetIntType(*x); } } (*x)->obj = NIL; - } else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((int16)(*x)->left->typ->form < f || f > g))) { + } else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((INT16)(*x)->left->typ->form < f || f > g))) { if ((*x)->left->typ == typ) { *x = (*x)->left; } @@ -1155,14 +1155,14 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) } static struct Op__38 { - int16 *f, *g; + INT16 *f, *g; struct Op__38 *lnk; } *Op__38_s; -static void NewOp__39 (int8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y); +static void NewOp__39 (INT8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y); static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y); -static void NewOp__39 (int8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y) +static void NewOp__39 (INT8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y) { OPT_Node node = NIL; node = OPT_NewNode(12); @@ -1203,13 +1203,13 @@ static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) return ok; } -void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) +void OPB_Op (INT8 op, OPT_Node *x, OPT_Node y) { - int16 f, g; + INT16 f, g; OPT_Node t = NIL, z = NIL; OPT_Struct typ = NIL; BOOLEAN do_; - int64 val; + INT64 val; struct Op__38 _s; _s.f = &f; _s.g = &g; @@ -1489,7 +1489,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) void OPB_SetRange (OPT_Node *x, OPT_Node y) { - int64 k, l; + INT64 k, l; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); } else if (((*x)->typ->form == 4 && y->typ->form == 4)) { @@ -1525,7 +1525,7 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y) void OPB_SetElem (OPT_Node *x) { - int64 k; + INT64 k; if ((*x)->class == 8 || (*x)->class == 9) { OPB_err(126); } else if ((*x)->typ->form != 4) { @@ -1549,7 +1549,7 @@ void OPB_SetElem (OPT_Node *x) static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) { OPT_Struct y = NIL; - int16 f, g; + INT16 f, g; OPT_Struct p = NIL, q = NIL; y = ynode->typ; f = x->form; @@ -1673,9 +1673,9 @@ static void OPB_CheckLeaf (OPT_Node x, BOOLEAN dynArrToo) { } -void OPB_StPar0 (OPT_Node *par0, int16 fctno) +void OPB_StPar0 (OPT_Node *par0, INT16 fctno) { - int16 f; + INT16 f; OPT_Struct typ = NIL; OPT_Node x = NIL; x = *par0; @@ -1983,9 +1983,9 @@ static struct StPar1__53 { struct StPar1__53 *lnk; } *StPar1__53_s; -static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right); +static OPT_Node NewOp__54 (INT8 class, INT8 subcl, OPT_Node left, OPT_Node right); -static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right) +static OPT_Node NewOp__54 (INT8 class, INT8 subcl, OPT_Node left, OPT_Node right) { OPT_Node node = NIL; node = OPT_NewNode(class); @@ -1995,9 +1995,9 @@ static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right return node; } -void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) +void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno) { - int16 f, L; + INT16 f, L; OPT_Struct typ = NIL; OPT_Node p = NIL, t = NIL; struct StPar1__53 _s; @@ -2026,7 +2026,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (f == 4) { - if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval >= (int64)__ASHL(p->typ->size, 3)))) { + if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval >= (INT64)__ASHL(p->typ->size, 3)))) { OPB_err(202); } p = NewOp__54(19, fctno, p, x); @@ -2091,8 +2091,8 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) OPB_err(208); p->conval->intval = 1; } else if (x->conval->intval >= 0) { - if (__ABS(p->conval->intval) <= __DIV(9223372036854775807, (int64)__ASH(1, x->conval->intval))) { - p->conval->intval = p->conval->intval * (int64)__ASH(1, x->conval->intval); + if (__ABS(p->conval->intval) <= __DIV(9223372036854775807, (INT64)__ASH(1, x->conval->intval))) { + p->conval->intval = p->conval->intval * (INT64)__ASH(1, x->conval->intval); } else { OPB_err(208); p->conval->intval = 1; @@ -2239,10 +2239,10 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) StPar1__53_s = _s.lnk; } -void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n) +void OPB_StParN (OPT_Node *par0, OPT_Node x, INT16 fctno, INT16 n) { OPT_Node node = NIL; - int16 f; + INT16 f; OPT_Node p = NIL; p = *par0; f = x->typ->form; @@ -2284,9 +2284,9 @@ void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n) *par0 = p; } -void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno) +void OPB_StFct (OPT_Node *par0, INT8 fctno, INT16 parno) { - int16 dim; + INT16 dim; OPT_Node x = NIL, p = NIL; p = *par0; if (fctno <= 19) { @@ -2350,7 +2350,7 @@ void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno) static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpar) { - int16 f; + INT16 f; f = atyp->comp; ftyp = ftyp->BaseTyp; atyp = atyp->BaseTyp; @@ -2459,7 +2459,7 @@ void OPB_Param (OPT_Node ap, OPT_Object fp) } } -void OPB_StaticLink (int8 dlev) +void OPB_StaticLink (INT8 dlev) { OPT_Object scope = NIL; scope = OPT_topScope; @@ -2474,7 +2474,7 @@ void OPB_Call (OPT_Node *x, OPT_Node apar, OPT_Object fp) { OPT_Struct typ = NIL; OPT_Node p = NIL; - int8 lev; + INT8 lev; if ((*x)->class == 9) { typ = (*x)->typ; lev = (*x)->obj->mnolev; @@ -2534,7 +2534,7 @@ void OPB_Return (OPT_Node *x, OPT_Object proc) void OPB_Assign (OPT_Node *x, OPT_Node y) { OPT_Node z = NIL; - int8 subcl; + INT8 subcl; if ((*x)->class >= 7) { OPB_err(56); } diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index 22742961..bc644f4c 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h @@ -13,7 +13,7 @@ import void OPB_Assign (OPT_Node *x, OPT_Node y); import void OPB_Call (OPT_Node *x, OPT_Node apar, OPT_Object fp); import void OPB_CheckParameters (OPT_Object fp, OPT_Object ap, BOOLEAN checkNames); -import void OPB_Construct (int8 class, OPT_Node *x, OPT_Node y); +import void OPB_Construct (INT8 class, OPT_Node *x, OPT_Node y); import void OPB_DeRef (OPT_Node *x); import OPT_Node OPB_EmptySet (void); import void OPB_Enter (OPT_Node *procdec, OPT_Node stat, OPT_Object proc); @@ -22,25 +22,25 @@ import void OPB_In (OPT_Node *x, OPT_Node y); import void OPB_Index (OPT_Node *x, OPT_Node y); import void OPB_Inittd (OPT_Node *inittd, OPT_Node *last, OPT_Struct typ); import void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y); -import void OPB_MOp (int8 op, OPT_Node *x); +import void OPB_MOp (INT8 op, OPT_Node *x); import OPT_Node OPB_NewBoolConst (BOOLEAN boolval); -import OPT_Node OPB_NewIntConst (int64 intval); +import OPT_Node OPB_NewIntConst (INT64 intval); import OPT_Node OPB_NewLeaf (OPT_Object obj); import OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ); -import OPT_Node OPB_NewString (OPS_String str, int64 len); +import OPT_Node OPB_NewString (OPS_String str, INT64 len); import OPT_Node OPB_Nil (void); -import void OPB_Op (int8 op, OPT_Node *x, OPT_Node y); +import void OPB_Op (INT8 op, OPT_Node *x, OPT_Node y); import void OPB_OptIf (OPT_Node *x); import void OPB_Param (OPT_Node ap, OPT_Object fp); import void OPB_PrepCall (OPT_Node *x, OPT_Object *fpar); import void OPB_Return (OPT_Node *x, OPT_Object proc); import void OPB_SetElem (OPT_Node *x); import void OPB_SetRange (OPT_Node *x, OPT_Node y); -import void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno); -import void OPB_StPar0 (OPT_Node *par0, int16 fctno); -import void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno); -import void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n); -import void OPB_StaticLink (int8 dlev); +import void OPB_StFct (OPT_Node *par0, INT8 fctno, INT16 parno); +import void OPB_StPar0 (OPT_Node *par0, INT16 fctno); +import void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno); +import void OPB_StParN (OPT_Node *par0, OPT_Node x, INT16 fctno, INT16 n); +import void OPB_StaticLink (INT8 dlev); import void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard); import void *OPB__init(void); diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index 27ab3d15..0ed7bf75 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "Configuration.h" @@ -11,9 +11,9 @@ #include "OPT.h" -static int16 OPC_indentLevel; -static int8 OPC_hashtab[105]; -static CHAR OPC_keytab[50][9]; +static INT16 OPC_indentLevel; +static INT8 OPC_hashtab[105]; +static CHAR OPC_keytab[60][9]; static BOOLEAN OPC_GlbPtrs; static CHAR OPC_BodyNameExt[13]; @@ -23,12 +23,12 @@ static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames); export OPT_Object OPC_BaseTProc (OPT_Object obj); export void OPC_BegBlk (void); export void OPC_BegStat (void); -static void OPC_CProcDefs (OPT_Object obj, int16 vis); -export void OPC_Case (int64 caseVal, int16 form); -static void OPC_CharacterLiteral (int64 c); -export void OPC_Cmp (int16 rel); +static void OPC_CProcDefs (OPT_Object obj, INT16 vis); +export void OPC_Case (INT64 caseVal, INT16 form); +static void OPC_CharacterLiteral (INT64 c); +export void OPC_Cmp (INT16 rel); export void OPC_CompleteIdent (OPT_Object obj); -export void OPC_Constant (OPT_Const con, int16 form); +export void OPC_Constant (OPT_Const con, INT16 form); static void OPC_DeclareBase (OPT_Object dcl); static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef); static void OPC_DeclareParams (OPT_Object par, BOOLEAN macro); @@ -45,45 +45,45 @@ export void OPC_EnterBody (void); export void OPC_EnterProc (OPT_Object proc); export void OPC_ExitBody (void); export void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet); -static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, int32 *off, int32 *n, int32 *curAlign); -static void OPC_FillGap (int32 gap, int32 off, int32 align, int32 *n, int32 *curAlign); +static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, INT32 *off, INT32 *n, INT32 *curAlign); +static void OPC_FillGap (INT32 gap, INT32 off, INT32 align, INT32 *n, INT32 *curAlign); export void OPC_GenBdy (OPT_Node n); -static void OPC_GenDynTypes (OPT_Node n, int16 vis); +static void OPC_GenDynTypes (OPT_Node n, INT16 vis); export void OPC_GenEnumPtrs (OPT_Object var); export void OPC_GenHdr (OPT_Node n); export void OPC_GenHdrIncludes (void); static void OPC_GenHeaderMsg (void); -export void OPC_Halt (int32 n); +export void OPC_Halt (INT32 n); export void OPC_Ident (OPT_Object obj); -static void OPC_IdentList (OPT_Object obj, int16 vis); +static void OPC_IdentList (OPT_Object obj, INT16 vis); static void OPC_Include (CHAR *name, LONGINT name__len); -static void OPC_IncludeImports (OPT_Object obj, int16 vis); +static void OPC_IncludeImports (OPT_Object obj, INT16 vis); export void OPC_Increment (BOOLEAN decrement); -export void OPC_Indent (int16 count); +export void OPC_Indent (INT16 count); export void OPC_Init (void); static void OPC_InitImports (OPT_Object obj); static void OPC_InitKeywords (void); export void OPC_InitTDesc (OPT_Struct typ); static void OPC_InitTProcs (OPT_Object typ, OPT_Object obj); -export void OPC_IntLiteral (int64 n, int32 size); -export void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim); +export void OPC_IntLiteral (INT64 n, INT32 size); +export void OPC_Len (OPT_Object obj, OPT_Struct array, INT64 dim); static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName); -static int16 OPC_Length (CHAR *s, LONGINT s__len); +static INT16 OPC_Length (CHAR *s, LONGINT s__len); export BOOLEAN OPC_NeedsRetval (OPT_Object proc); -export int32 OPC_NofPtrs (OPT_Struct typ); -static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len); +export INT32 OPC_NofPtrs (OPT_Struct typ); +static INT16 OPC_PerfectHash (CHAR *s, LONGINT s__len); static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len); static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define); -static void OPC_ProcPredefs (OPT_Object obj, int8 vis); +static void OPC_ProcPredefs (OPT_Object obj, INT8 vis); static void OPC_PutBase (OPT_Struct typ); -static void OPC_PutPtrOffsets (OPT_Struct typ, int32 adr, int32 *cnt); +static void OPC_PutPtrOffsets (OPT_Struct typ, INT32 adr, INT32 *cnt); static void OPC_RegCmds (OPT_Object obj); export void OPC_SetInclude (BOOLEAN exclude); static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause); -static void OPC_Str1 (CHAR *s, LONGINT s__len, int32 x); -static void OPC_StringLiteral (CHAR *s, LONGINT s__len, int32 l); +static void OPC_Str1 (CHAR *s, LONGINT s__len, INT32 x); +static void OPC_StringLiteral (CHAR *s, LONGINT s__len, INT32 l); export void OPC_TDescDecl (OPT_Struct typ); -export void OPC_TypeDefs (OPT_Object obj, int16 vis); +export void OPC_TypeDefs (OPT_Object obj, INT16 vis); export void OPC_TypeOf (OPT_Object ap); static BOOLEAN OPC_Undefined (OPT_Object obj); @@ -94,14 +94,14 @@ void OPC_Init (void) __MOVE("__init(void)", OPC_BodyNameExt, 13); } -void OPC_Indent (int16 count) +void OPC_Indent (INT16 count) { OPC_indentLevel += count; } void OPC_BegStat (void) { - int16 i; + INT16 i; i = OPC_indentLevel; while (i > 0) { OPM_Write(0x09); @@ -137,10 +137,10 @@ void OPC_EndBlk0 (void) OPM_Write('}'); } -static void OPC_Str1 (CHAR *s, LONGINT s__len, int32 x) +static void OPC_Str1 (CHAR *s, LONGINT s__len, INT32 x) { CHAR ch; - int16 i; + INT16 i; __DUP(s, s__len, CHAR); ch = s[0]; i = 0; @@ -156,9 +156,9 @@ static void OPC_Str1 (CHAR *s, LONGINT s__len, int32 x) __DEL(s); } -static int16 OPC_Length (CHAR *s, LONGINT s__len) +static INT16 OPC_Length (CHAR *s, LONGINT s__len) { - int16 i; + INT16 i; i = 0; while (s[__X(i, s__len)] != 0x00) { i += 1; @@ -166,13 +166,13 @@ static int16 OPC_Length (CHAR *s, LONGINT s__len) return i; } -static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len) +static INT16 OPC_PerfectHash (CHAR *s, LONGINT s__len) { - int16 i, h; + INT16 i, h; i = 0; h = 0; while ((s[__X(i, s__len)] != 0x00 && i < 5)) { - h = 3 * h + (int16)s[__X(i, s__len)]; + h = 3 * h + (INT16)s[__X(i, s__len)]; i += 1; } return (int)__MOD(h, 105); @@ -180,25 +180,25 @@ static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len) void OPC_Ident (OPT_Object obj) { - int16 mode, level, h; + INT16 mode, level, h; mode = obj->mode; level = obj->mnolev; if ((__IN(mode, 0x62, 32) && level > 0) || __IN(mode, 0x14, 32)) { OPM_WriteStringVar((void*)obj->name, 256); h = OPC_PerfectHash((void*)obj->name, 256); if (OPC_hashtab[__X(h, 105)] >= 0) { - if (__STRCMP(OPC_keytab[__X(OPC_hashtab[__X(h, 105)], 50)], obj->name) == 0) { + if (__STRCMP(OPC_keytab[__X(OPC_hashtab[__X(h, 105)], 60)], obj->name) == 0) { OPM_Write('_'); } } } else if ((mode == 5 && __IN(obj->typ->form, 0x90, 32))) { if (obj->typ == OPT_adrtyp) { - OPM_WriteString((CHAR*)"address", 8); + OPM_WriteString((CHAR*)"ADDRESS", 8); } else { if (obj->typ->form == 4) { - OPM_WriteString((CHAR*)"int", 4); + OPM_WriteString((CHAR*)"INT", 4); } else { - OPM_WriteString((CHAR*)"uint", 5); + OPM_WriteString((CHAR*)"UINT", 5); } OPM_WriteInt(__ASHL(obj->typ->size, 3)); } @@ -224,7 +224,7 @@ void OPC_Ident (OPT_Object obj) static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause) { - int16 pointers; + INT16 pointers; *openClause = 0; if (((typ->strobj == NIL || typ->strobj->name[0] == 0x00) && typ->comp != 4)) { if (__IN(typ->comp, 0x0c, 32)) { @@ -260,7 +260,7 @@ static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef) { OPT_Struct typ = NIL; BOOLEAN varPar, openClause; - int16 form, comp; + INT16 form, comp; typ = dcl->typ; varPar = ((dcl->mode == 2 && typ->comp != 2) || typ->comp == 3) || scopeDef; OPC_Stars(typ, &openClause); @@ -324,8 +324,8 @@ static void OPC_DeclareBase (OPT_Object dcl) { OPT_Struct typ = NIL, prev = NIL; OPT_Object obj = NIL; - int16 nofdims; - int32 off, n, dummy; + INT16 nofdims; + INT32 off, n, dummy; typ = dcl->typ; prev = typ; while ((((((((typ->strobj == NIL || typ->comp == 3) || OPC_Undefined(typ->strobj)) && typ->comp != 4)) && typ->form != 10)) && !((typ->form == 11 && typ->BaseTyp->comp == 3)))) { @@ -384,11 +384,11 @@ static void OPC_DeclareBase (OPT_Object dcl) } } -int32 OPC_NofPtrs (OPT_Struct typ) +INT32 OPC_NofPtrs (OPT_Struct typ) { OPT_Object fld = NIL; OPT_Struct btyp = NIL; - int32 n; + INT32 n; if ((typ->form == 11 && typ->sysflag == 0)) { return 1; } else if ((typ->comp == 4 && __MASK(typ->sysflag, -256) == 0)) { @@ -422,11 +422,11 @@ int32 OPC_NofPtrs (OPT_Struct typ) __RETCHK; } -static void OPC_PutPtrOffsets (OPT_Struct typ, int32 adr, int32 *cnt) +static void OPC_PutPtrOffsets (OPT_Struct typ, INT32 adr, INT32 *cnt) { OPT_Object fld = NIL; OPT_Struct btyp = NIL; - int32 n, i; + INT32 n, i; if ((typ->form == 11 && typ->sysflag == 0)) { OPM_WriteInt(adr); OPM_WriteString((CHAR*)", ", 3); @@ -502,7 +502,7 @@ static void OPC_PutBase (OPT_Struct typ) static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName) { OPT_Struct typ = NIL; - int16 dim; + INT16 dim; if (showParamName) { OPC_Ident(par); OPM_WriteString((CHAR*)"__len", 6); @@ -599,7 +599,7 @@ static void OPC_DeclareTProcs (OPT_Object obj, BOOLEAN *empty) OPT_Object OPC_BaseTProc (OPT_Object obj) { OPT_Struct typ = NIL, base = NIL; - int32 mno; + INT32 mno; typ = obj->link->typ; if (typ->form == 11) { typ = typ->BaseTyp; @@ -722,7 +722,7 @@ static void OPC_DefineType (OPT_Struct str) static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len) { - int16 i; + INT16 i; __DUP(y, y__len, CHAR); i = 0; while ((*x)[__X(i + 1, 256)] == y[__X(i, y__len)]) { @@ -732,14 +732,14 @@ static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len) return y[__X(i, y__len)] == 0x00; } -static void OPC_CProcDefs (OPT_Object obj, int16 vis) +static void OPC_CProcDefs (OPT_Object obj, INT16 vis) { - int16 i; + INT16 i; OPT_ConstExt ext = NIL; - int16 _for__7; + INT16 _for__7; if (obj != NIL) { OPC_CProcDefs(obj->left, vis); - if ((((obj->mode == 9 && (int16)obj->vis >= vis)) && obj->adr == 1)) { + if ((((obj->mode == 9 && (INT16)obj->vis >= vis)) && obj->adr == 1)) { ext = obj->conval->ext; i = 1; if (((*ext)[1] != '#' && !(OPC_Prefixed(ext, (CHAR*)"extern ", 8) || OPC_Prefixed(ext, (CHAR*)"import ", 8)))) { @@ -748,7 +748,7 @@ static void OPC_CProcDefs (OPT_Object obj, int16 vis) OPC_DeclareParams(obj->link, 1); OPM_Write(0x09); } - _for__7 = (int16)(*obj->conval->ext)[0]; + _for__7 = (INT16)(*obj->conval->ext)[0]; i = i; while (i <= _for__7) { OPM_Write((*obj->conval->ext)[__X(i, 256)]); @@ -760,7 +760,7 @@ static void OPC_CProcDefs (OPT_Object obj, int16 vis) } } -void OPC_TypeDefs (OPT_Object obj, int16 vis) +void OPC_TypeDefs (OPT_Object obj, INT16 vis) { if (obj != NIL) { OPC_TypeDefs(obj->left, vis); @@ -792,7 +792,7 @@ static void OPC_DefAnonRecs (OPT_Node n) void OPC_TDescDecl (OPT_Struct typ) { - int32 nofptrs; + INT32 nofptrs; OPT_Object o = NIL; OPC_BegStat(); OPM_WriteString((CHAR*)"__TDESC(", 9); @@ -829,9 +829,9 @@ void OPC_InitTDesc (OPT_Struct typ) } } -static void OPC_FillGap (int32 gap, int32 off, int32 align, int32 *n, int32 *curAlign) +static void OPC_FillGap (INT32 gap, INT32 off, INT32 align, INT32 *n, INT32 *curAlign) { - int32 adr; + INT32 adr; adr = off; OPT_Align(&adr, align); if ((*curAlign < align && gap - (adr - off) >= align)) { @@ -839,13 +839,13 @@ static void OPC_FillGap (int32 gap, int32 off, int32 align, int32 *n, int32 *cur OPC_BegStat(); switch (align) { case 2: - OPM_WriteString((CHAR*)"int16", 6); + OPM_WriteString((CHAR*)"INT16", 6); break; case 4: - OPM_WriteString((CHAR*)"int32", 6); + OPM_WriteString((CHAR*)"INT32", 6); break; case 8: - OPM_WriteString((CHAR*)"int64", 6); + OPM_WriteString((CHAR*)"INT64", 6); break; default: OPM_LogWLn(); @@ -866,11 +866,11 @@ static void OPC_FillGap (int32 gap, int32 off, int32 align, int32 *n, int32 *cur } } -static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, int32 *off, int32 *n, int32 *curAlign) +static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, INT32 *off, INT32 *n, INT32 *curAlign) { OPT_Object fld = NIL; OPT_Struct base = NIL; - int32 gap, adr, align, fldAlign; + INT32 gap, adr, align, fldAlign; fld = typ->link; align = __MASK(typ->align, -65536); if (typ->BaseTyp != NIL) { @@ -926,16 +926,16 @@ static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, int32 *off, int32 *n, i } } -static void OPC_IdentList (OPT_Object obj, int16 vis) +static void OPC_IdentList (OPT_Object obj, INT16 vis) { OPT_Struct base = NIL; BOOLEAN first; - int16 lastvis; + INT16 lastvis; base = NIL; first = 1; while ((obj != NIL && obj->mode != 13)) { if ((__IN(vis, 0x05, 32) || (vis == 1 && obj->vis != 0)) || (vis == 3 && !obj->leaf)) { - if (obj->typ != base || (int16)obj->vis != lastvis) { + if (obj->typ != base || (INT16)obj->vis != lastvis) { if (!first) { OPC_EndStat(); } @@ -974,7 +974,7 @@ static void OPC_IdentList (OPT_Object obj, int16 vis) } else if ((obj->mode == 2 && obj->typ->comp == 4)) { OPC_EndStat(); OPC_BegStat(); - OPM_WriteString((CHAR*)"address *", 10); + OPM_WriteString((CHAR*)"ADDRESS *", 10); OPC_Ident(obj); OPM_WriteString((CHAR*)"__typ", 6); base = NIL; @@ -1011,7 +1011,7 @@ static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames) OPM_WriteString((CHAR*)", LONGINT ", 11); OPC_LenList(obj, 1, showParamNames); } else if ((obj->mode == 2 && obj->typ->comp == 4)) { - OPM_WriteString((CHAR*)", address *", 12); + OPM_WriteString((CHAR*)", ADDRESS *", 12); if (showParamNames) { OPC_Ident(obj); OPM_WriteString((CHAR*)"__typ", 6); @@ -1044,7 +1044,7 @@ static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define) OPM_WriteLn(); } -static void OPC_ProcPredefs (OPT_Object obj, int8 vis) +static void OPC_ProcPredefs (OPT_Object obj, INT8 vis) { if (obj != NIL) { OPC_ProcPredefs(obj->left, vis); @@ -1074,18 +1074,18 @@ static void OPC_Include (CHAR *name, LONGINT name__len) __DEL(name); } -static void OPC_IncludeImports (OPT_Object obj, int16 vis) +static void OPC_IncludeImports (OPT_Object obj, INT16 vis) { if (obj != NIL) { OPC_IncludeImports(obj->left, vis); - if ((((obj->mode == 11 && obj->mnolev != 0)) && (int16)OPT_GlbMod[__X(-obj->mnolev, 64)]->vis >= vis)) { + if ((((obj->mode == 11 && obj->mnolev != 0)) && (INT16)OPT_GlbMod[__X(-obj->mnolev, 64)]->vis >= vis)) { OPC_Include(OPT_GlbMod[__X(-obj->mnolev, 64)]->name, 256); } OPC_IncludeImports(obj->right, vis); } } -static void OPC_GenDynTypes (OPT_Node n, int16 vis) +static void OPC_GenDynTypes (OPT_Node n, INT16 vis) { OPT_Struct typ = NIL; while ((n != NIL && n->class == 14)) { @@ -1099,7 +1099,7 @@ static void OPC_GenDynTypes (OPT_Node n, int16 vis) } else { OPM_WriteString((CHAR*)"export ", 8); } - OPM_WriteString((CHAR*)"address *", 10); + OPM_WriteString((CHAR*)"ADDRESS *", 10); OPC_Andent(typ); OPM_WriteString((CHAR*)"__typ", 6); OPC_EndStat(); @@ -1134,7 +1134,7 @@ void OPC_GenHdr (OPT_Node n) static void OPC_GenHeaderMsg (void) { - int16 i; + INT16 i; OPM_WriteString((CHAR*)"/* ", 4); OPM_WriteString((CHAR*)"voc", 4); OPM_Write(' '); @@ -1222,16 +1222,16 @@ void OPC_GenBdy (OPT_Node n) OPM_currFile = 1; OPC_GenHeaderMsg(); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#define SHORTINT int", 21); + OPM_WriteString((CHAR*)"#define SHORTINT INT", 21); OPM_WriteInt(__ASHL(OPT_sinttyp->size, 3)); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#define INTEGER int", 21); + OPM_WriteString((CHAR*)"#define INTEGER INT", 21); OPM_WriteInt(__ASHL(OPT_inttyp->size, 3)); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#define LONGINT int", 21); + OPM_WriteString((CHAR*)"#define LONGINT INT", 21); OPM_WriteInt(__ASHL(OPT_linttyp->size, 3)); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#define SET uint", 22); + OPM_WriteString((CHAR*)"#define SET UINT", 22); OPM_WriteInt(__ASHL(OPT_settyp->size, 3)); OPM_WriteLn(); OPM_WriteLn(); @@ -1288,7 +1288,7 @@ static void OPC_InitImports (OPT_Object obj) void OPC_GenEnumPtrs (OPT_Object var) { OPT_Struct typ = NIL; - int32 n; + INT32 n; OPC_GlbPtrs = 0; while (var != NIL) { typ = var->typ; @@ -1438,7 +1438,7 @@ void OPC_EnterProc (OPT_Object proc) { OPT_Object var = NIL, scope = NIL; OPT_Struct typ = NIL; - int16 dim; + INT16 dim; if (proc->vis != 1) { OPM_WriteString((CHAR*)"static ", 8); } @@ -1652,7 +1652,7 @@ void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet) void OPC_CompleteIdent (OPT_Object obj) { - int16 comp, level; + INT16 comp, level; level = obj->mnolev; if (obj->adr == 1) { if (obj->typ->comp == 4) { @@ -1681,10 +1681,10 @@ void OPC_CompleteIdent (OPT_Object obj) void OPC_TypeOf (OPT_Object ap) { - int16 i; + INT16 i; __ASSERT(ap->typ->comp == 4, 0); if (ap->mode == 2) { - if ((int16)ap->mnolev != OPM_level) { + if ((INT16)ap->mnolev != OPM_level) { OPM_WriteStringVar((void*)ap->scope->name, 256); OPM_WriteString((CHAR*)"_s->", 5); OPC_Ident(ap); @@ -1700,7 +1700,7 @@ void OPC_TypeOf (OPT_Object ap) } } -void OPC_Cmp (int16 rel) +void OPC_Cmp (INT16 rel) { switch (rel) { case 9: @@ -1729,7 +1729,7 @@ void OPC_Cmp (int16 rel) } } -static void OPC_CharacterLiteral (int64 c) +static void OPC_CharacterLiteral (INT64 c) { if (c < 32 || c > 126) { OPM_WriteString((CHAR*)"0x", 3); @@ -1744,15 +1744,15 @@ static void OPC_CharacterLiteral (int64 c) } } -static void OPC_StringLiteral (CHAR *s, LONGINT s__len, int32 l) +static void OPC_StringLiteral (CHAR *s, LONGINT s__len, INT32 l) { - int32 i; - int16 c; + INT32 i; + INT16 c; __DUP(s, s__len, CHAR); OPM_Write('"'); i = 0; while (i < l) { - c = (int16)s[__X(i, s__len)]; + c = (INT16)s[__X(i, s__len)]; if (c < 32 || c > 126) { OPM_Write('\\'); OPM_Write((CHAR)(48 + __ASHR(c, 6))); @@ -1772,7 +1772,7 @@ static void OPC_StringLiteral (CHAR *s, LONGINT s__len, int32 l) __DEL(s); } -void OPC_Case (int64 caseVal, int16 form) +void OPC_Case (INT64 caseVal, INT16 form) { CHAR ch; OPM_WriteString((CHAR*)"case ", 6); @@ -1810,15 +1810,15 @@ void OPC_Increment (BOOLEAN decrement) } } -void OPC_Halt (int32 n) +void OPC_Halt (INT32 n) { OPC_Str1((CHAR*)"__HALT(#)", 10, n); } -void OPC_IntLiteral (int64 n, int32 size) +void OPC_IntLiteral (INT64 n, INT32 size) { if ((((size > 4 && n <= 2147483647)) && n > (-2147483647-1))) { - OPM_WriteString((CHAR*)"((int", 6); + OPM_WriteString((CHAR*)"((INT", 6); OPM_WriteInt(__ASHL(size, 3)); OPM_WriteString((CHAR*)")(", 3); OPM_WriteInt(n); @@ -1828,7 +1828,7 @@ void OPC_IntLiteral (int64 n, int32 size) } } -void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim) +void OPC_Len (OPT_Object obj, OPT_Struct array, INT64 dim) { if (array->comp == 3) { OPC_CompleteIdent(obj); @@ -1845,11 +1845,11 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim) } } -void OPC_Constant (OPT_Const con, int16 form) +void OPC_Constant (OPT_Const con, INT16 form) { - int16 i; - uint64 s; - int64 hex; + INT16 i; + UINT64 s; + INT64 hex; BOOLEAN skipLeading; switch (form) { case 1: @@ -1908,7 +1908,7 @@ void OPC_Constant (OPT_Const con, int16 form) } static struct InitKeywords__46 { - int8 *n; + INT8 *n; struct InitKeywords__46 *lnk; } *InitKeywords__46_s; @@ -1916,18 +1916,18 @@ static void Enter__47 (CHAR *s, LONGINT s__len); static void Enter__47 (CHAR *s, LONGINT s__len) { - int16 h; + INT16 h; __DUP(s, s__len, CHAR); h = OPC_PerfectHash((void*)s, s__len); OPC_hashtab[__X(h, 105)] = *InitKeywords__46_s->n; - __COPY(s, OPC_keytab[__X(*InitKeywords__46_s->n, 50)], 9); + __COPY(s, OPC_keytab[__X(*InitKeywords__46_s->n, 60)], 9); *InitKeywords__46_s->n += 1; __DEL(s); } static void OPC_InitKeywords (void) { - int8 n, i; + INT8 n, i; struct InitKeywords__46 _s; _s.n = &n; _s.lnk = InitKeywords__46_s; @@ -1938,7 +1938,24 @@ static void OPC_InitKeywords (void) OPC_hashtab[__X(i, 105)] = -1; i += 1; } + Enter__47((CHAR*)"ADDRESS", 8); + Enter__47((CHAR*)"INT16", 6); + Enter__47((CHAR*)"INT32", 6); + Enter__47((CHAR*)"INT64", 6); + Enter__47((CHAR*)"INT8", 5); + Enter__47((CHAR*)"UINT16", 7); + Enter__47((CHAR*)"UINT32", 7); + Enter__47((CHAR*)"UINT64", 7); + Enter__47((CHAR*)"UINT8", 6); Enter__47((CHAR*)"address", 8); + Enter__47((CHAR*)"int16", 6); + Enter__47((CHAR*)"int32", 6); + Enter__47((CHAR*)"int64", 6); + Enter__47((CHAR*)"int8", 5); + Enter__47((CHAR*)"uint16", 7); + Enter__47((CHAR*)"uint32", 7); + Enter__47((CHAR*)"uint64", 7); + Enter__47((CHAR*)"uint8", 6); Enter__47((CHAR*)"asm", 4); Enter__47((CHAR*)"auto", 5); Enter__47((CHAR*)"break", 6); @@ -1960,10 +1977,6 @@ static void OPC_InitKeywords (void) Enter__47((CHAR*)"if", 3); Enter__47((CHAR*)"import", 7); Enter__47((CHAR*)"int", 4); - Enter__47((CHAR*)"int16", 6); - Enter__47((CHAR*)"int32", 6); - Enter__47((CHAR*)"int64", 6); - Enter__47((CHAR*)"int8", 5); Enter__47((CHAR*)"long", 5); Enter__47((CHAR*)"register", 9); Enter__47((CHAR*)"return", 7); @@ -1975,10 +1988,6 @@ static void OPC_InitKeywords (void) Enter__47((CHAR*)"struct", 7); Enter__47((CHAR*)"switch", 7); Enter__47((CHAR*)"typedef", 8); - Enter__47((CHAR*)"uint16", 7); - Enter__47((CHAR*)"uint32", 7); - Enter__47((CHAR*)"uint64", 7); - Enter__47((CHAR*)"uint8", 6); Enter__47((CHAR*)"union", 6); Enter__47((CHAR*)"unsigned", 9); Enter__47((CHAR*)"void", 5); diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index bbfd1911..f7fc51f9 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h @@ -13,10 +13,10 @@ import void OPC_Andent (OPT_Struct typ); import OPT_Object OPC_BaseTProc (OPT_Object obj); import void OPC_BegBlk (void); import void OPC_BegStat (void); -import void OPC_Case (int64 caseVal, int16 form); -import void OPC_Cmp (int16 rel); +import void OPC_Case (INT64 caseVal, INT16 form); +import void OPC_Cmp (INT16 rel); import void OPC_CompleteIdent (OPT_Object obj); -import void OPC_Constant (OPT_Const con, int16 form); +import void OPC_Constant (OPT_Const con, INT16 form); import void OPC_DefineInter (OPT_Object proc); import void OPC_EndBlk (void); import void OPC_EndBlk0 (void); @@ -29,19 +29,19 @@ import void OPC_GenBdy (OPT_Node n); import void OPC_GenEnumPtrs (OPT_Object var); import void OPC_GenHdr (OPT_Node n); import void OPC_GenHdrIncludes (void); -import void OPC_Halt (int32 n); +import void OPC_Halt (INT32 n); import void OPC_Ident (OPT_Object obj); import void OPC_Increment (BOOLEAN decrement); -import void OPC_Indent (int16 count); +import void OPC_Indent (INT16 count); import void OPC_Init (void); import void OPC_InitTDesc (OPT_Struct typ); -import void OPC_IntLiteral (int64 n, int32 size); -import void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim); +import void OPC_IntLiteral (INT64 n, INT32 size); +import void OPC_Len (OPT_Object obj, OPT_Struct array, INT64 dim); import BOOLEAN OPC_NeedsRetval (OPT_Object proc); -import int32 OPC_NofPtrs (OPT_Struct typ); +import INT32 OPC_NofPtrs (OPT_Struct typ); import void OPC_SetInclude (BOOLEAN exclude); import void OPC_TDescDecl (OPT_Struct typ); -import void OPC_TypeDefs (OPT_Object obj, int16 vis); +import void OPC_TypeDefs (OPT_Object obj, INT16 vis); import void OPC_TypeOf (OPT_Object ap); import void *OPC__init(void); diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 5b67d672..46b6c33e 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "Configuration.h" @@ -22,81 +22,81 @@ typedef static CHAR OPM_SourceFileName[256]; static CHAR OPM_GlobalModel[10]; export CHAR OPM_Model[10]; -static int16 OPM_GlobalAddressSize; -export int16 OPM_AddressSize; -static int16 OPM_GlobalAlignment; -export int16 OPM_Alignment; -export uint32 OPM_GlobalOptions, OPM_Options; -export int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; -export int64 OPM_MaxIndex; +static INT16 OPM_GlobalAddressSize; +export INT16 OPM_AddressSize; +static INT16 OPM_GlobalAlignment; +export INT16 OPM_Alignment; +export UINT32 OPM_GlobalOptions, OPM_Options; +export INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; +export INT64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; -export int32 OPM_curpos, OPM_errpos, OPM_breakpc; -export int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; +export INT32 OPM_curpos, OPM_errpos, OPM_breakpc; +export INT16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; export CHAR OPM_modName[32]; export CHAR OPM_objname[64]; -static int32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; +static INT32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; static Texts_Reader OPM_inR; static Texts_Text OPM_Log; static Texts_Writer OPM_W; static Files_Rider OPM_oldSF, OPM_newSF; static Files_Rider OPM_R[3]; static Files_File OPM_oldSFile, OPM_newSFile, OPM_HFile, OPM_BFile, OPM_HIFile; -static int16 OPM_S; +static INT16 OPM_S; export CHAR OPM_ResourceDir[1024]; -static void OPM_Append (Files_Rider *R, address *R__typ, Files_File F); +static void OPM_Append (Files_Rider *R, ADDRESS *R__typ, Files_File F); export void OPM_CloseFiles (void); export void OPM_CloseOldSym (void); export void OPM_DeleteNewSym (void); -export void OPM_FPrint (int32 *fp, int64 val); -export void OPM_FPrintLReal (int32 *fp, LONGREAL lr); -export void OPM_FPrintReal (int32 *fp, REAL real); -export void OPM_FPrintSet (int32 *fp, uint64 set); -static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 pos); +export void OPM_FPrint (INT32 *fp, INT64 val); +export void OPM_FPrintLReal (INT32 *fp, LONGREAL lr); +export void OPM_FPrintReal (INT32 *fp, REAL real); +export void OPM_FPrintSet (INT32 *fp, UINT64 set); +static void OPM_FindLine (Files_File f, Files_Rider *r, ADDRESS *r__typ, INT64 pos); export void OPM_Get (CHAR *ch); export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); export void OPM_InitOptions (void); -export int16 OPM_Integer (int64 n); -static void OPM_LogErrMsg (int16 n); +export INT16 OPM_Integer (INT64 n); +static void OPM_LogErrMsg (INT16 n); export void OPM_LogW (CHAR ch); export void OPM_LogWLn (void); -export void OPM_LogWNum (int64 i, int64 len); +export void OPM_LogWNum (INT64 i, INT64 len); export void OPM_LogWStr (CHAR *s, LONGINT s__len); -export int32 OPM_Longint (int64 n); +export INT32 OPM_Longint (INT64 n); static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len); -export void OPM_Mark (int16 n, int32 pos); +export void OPM_Mark (INT16 n, INT32 pos); export void OPM_NewSym (CHAR *modName, LONGINT modName__len); export void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); export void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); export BOOLEAN OPM_OpenPar (void); export void OPM_RegisterNewSym (void); static void OPM_ScanOptions (CHAR *s, LONGINT s__len); -static void OPM_ShowLine (int64 pos); -export int64 OPM_SignedMaximum (int32 bytecount); -export int64 OPM_SignedMinimum (int32 bytecount); +static void OPM_ShowLine (INT64 pos); +export INT64 OPM_SignedMaximum (INT32 bytecount); +export INT64 OPM_SignedMinimum (INT32 bytecount); export void OPM_SymRCh (CHAR *ch); -export int32 OPM_SymRInt (void); -export int64 OPM_SymRInt64 (void); +export INT32 OPM_SymRInt (void); +export INT64 OPM_SymRInt64 (void); export void OPM_SymRLReal (LONGREAL *lr); export void OPM_SymRReal (REAL *r); -export void OPM_SymRSet (uint64 *s); +export void OPM_SymRSet (UINT64 *s); export void OPM_SymWCh (CHAR ch); -export void OPM_SymWInt (int64 i); +export void OPM_SymWInt (INT64 i); export void OPM_SymWLReal (LONGREAL lr); export void OPM_SymWReal (REAL r); -export void OPM_SymWSet (uint64 s); +export void OPM_SymWSet (UINT64 s); static void OPM_VerboseListSizes (void); export void OPM_Write (CHAR ch); -export void OPM_WriteHex (int64 i); -export void OPM_WriteInt (int64 i); +export void OPM_WriteHex (INT64 i); +export void OPM_WriteInt (INT64 i); export void OPM_WriteLn (void); export void OPM_WriteReal (LONGREAL r, CHAR suffx); export void OPM_WriteString (CHAR *s, LONGINT s__len); export void OPM_WriteStringVar (CHAR *s, LONGINT s__len); export BOOLEAN OPM_eofSF (void); -export void OPM_err (int16 n); +export void OPM_err (INT16 n); #define OPM_GetAlignment(a) struct {char c; long long l;} _s; *a = (char*)&_s.l - (char*)&_s @@ -112,7 +112,7 @@ void OPM_LogWStr (CHAR *s, LONGINT s__len) __DEL(s); } -void OPM_LogWNum (int64 i, int64 len) +void OPM_LogWNum (INT64 i, INT64 len) { Out_Int(i, len); } @@ -122,32 +122,32 @@ void OPM_LogWLn (void) Out_Ln(); } -int64 OPM_SignedMaximum (int32 bytecount) +INT64 OPM_SignedMaximum (INT32 bytecount) { - int64 result; + INT64 result; result = 1; result = __LSH(result, __ASHL(bytecount, 3) - 1, 64); return result - 1; } -int64 OPM_SignedMinimum (int32 bytecount) +INT64 OPM_SignedMinimum (INT32 bytecount) { return -OPM_SignedMaximum(bytecount) - 1; } -int32 OPM_Longint (int64 n) +INT32 OPM_Longint (INT64 n) { - return __VAL(int32, n); + return __VAL(INT32, n); } -int16 OPM_Integer (int64 n) +INT16 OPM_Integer (INT64 n) { - return __VAL(int16, n); + return __VAL(INT16, n); } static void OPM_ScanOptions (CHAR *s, LONGINT s__len) { - int16 i; + INT16 i; __DUP(s, s__len, CHAR); i = 1; while (s[__X(i, s__len)] != 0x00) { @@ -213,23 +213,23 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len) OPM_LogWStr((CHAR*)"-M option requires two following digits.", 41); OPM_LogWLn(); } else { - OPM_AddressSize = (int16)s[__X(i + 1, s__len)] - 48; - OPM_Alignment = (int16)s[__X(i + 2, s__len)] - 48; + OPM_AddressSize = (INT16)s[__X(i + 1, s__len)] - 48; + OPM_Alignment = (INT16)s[__X(i + 2, s__len)] - 48; i += 2; } break; case 'B': if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_IntegerSize = (int16)s[__X(i, s__len)] - 48; + OPM_IntegerSize = (INT16)s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_AddressSize = (int16)s[__X(i, s__len)] - 48; + OPM_AddressSize = (INT16)s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_Alignment = (int16)s[__X(i, s__len)] - 48; + OPM_Alignment = (INT16)s[__X(i, s__len)] - 48; } __ASSERT(OPM_IntegerSize == 2 || OPM_IntegerSize == 4, 0); __ASSERT(OPM_AddressSize == 4 || OPM_AddressSize == 8, 0); @@ -465,7 +465,7 @@ void OPM_InitOptions (void) void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len) { Texts_Text T = NIL; - int32 beg, end, time; + INT32 beg, end, time; CHAR s[256]; *done = 0; OPM_curpos = 0; @@ -513,7 +513,7 @@ void OPM_Get (CHAR *ch) static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len) { - int16 i, j; + INT16 i, j; CHAR ch; __DUP(ext, ext__len, CHAR); i = 0; @@ -535,12 +535,12 @@ static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGIN __DEL(ext); } -static void OPM_LogErrMsg (int16 n) +static void OPM_LogErrMsg (INT16 n) { Texts_Scanner S; Texts_Text T = NIL; CHAR ch; - int16 i; + INT16 i; CHAR buf[1024]; if (n >= 0) { if (!__IN(16, OPM_Options, 32)) { @@ -565,21 +565,21 @@ static void OPM_LogErrMsg (int16 n) OPM_LogWStr(errors_errors[__X(n, 350)], 128); } -static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 pos) +static void OPM_FindLine (Files_File f, Files_Rider *r, ADDRESS *r__typ, INT64 pos) { CHAR ch, cheol; - if (pos < (int64)OPM_ErrorLineStartPos) { + if (pos < (INT64)OPM_ErrorLineStartPos) { OPM_ErrorLineStartPos = 0; OPM_ErrorLineLimitPos = 0; OPM_ErrorLineNumber = 0; } - if (pos < (int64)OPM_ErrorLineLimitPos) { + if (pos < (INT64)OPM_ErrorLineLimitPos) { Files_Set(&*r, r__typ, f, OPM_ErrorLineStartPos); return; } Files_Set(&*r, r__typ, f, OPM_ErrorLineLimitPos); Files_Read(&*r, r__typ, (void*)&ch); - while (((int64)OPM_ErrorLineLimitPos < pos && !(*r).eof)) { + while (((INT64)OPM_ErrorLineLimitPos < pos && !(*r).eof)) { OPM_ErrorLineStartPos = OPM_ErrorLineLimitPos; OPM_ErrorLineNumber += 1; while ((((ch != 0x00 && ch != 0x0d)) && ch != 0x0a)) { @@ -597,12 +597,12 @@ static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 p Files_Set(&*r, r__typ, f, OPM_ErrorLineStartPos); } -static void OPM_ShowLine (int64 pos) +static void OPM_ShowLine (INT64 pos) { Files_File f = NIL; Files_Rider r; CHAR line[1023]; - int16 i; + INT16 i; CHAR ch; f = Files_Old(OPM_SourceFileName, 256); OPM_FindLine(f, &r, Files_Rider__typ, pos); @@ -621,10 +621,10 @@ static void OPM_ShowLine (int64 pos) OPM_LogWStr(line, 1023); OPM_LogWLn(); OPM_LogWStr((CHAR*)" ", 7); - if (pos >= (int64)OPM_ErrorLineLimitPos) { + if (pos >= (INT64)OPM_ErrorLineLimitPos) { pos = OPM_ErrorLineLimitPos - 1; } - i = (int16)OPM_Longint(pos - (int64)OPM_ErrorLineStartPos); + i = (INT16)OPM_Longint(pos - (INT64)OPM_ErrorLineStartPos); while (i > 0) { OPM_LogW(' '); i -= 1; @@ -639,7 +639,7 @@ static void OPM_ShowLine (int64 pos) Files_Close(f); } -void OPM_Mark (int16 n, int32 pos) +void OPM_Mark (INT16 n, INT32 pos) { if (pos == -1) { pos = 0; @@ -691,34 +691,34 @@ void OPM_Mark (int16 n, int32 pos) } } -void OPM_err (int16 n) +void OPM_err (INT16 n) { OPM_Mark(n, OPM_errpos); } -void OPM_FPrint (int32 *fp, int64 val) +void OPM_FPrint (INT32 *fp, INT64 val) { - *fp = __ROTL((int32)((uint32)*fp ^ __VAL(uint32, val)), 1, 32); + *fp = __ROTL((INT32)((UINT32)*fp ^ __VAL(UINT32, val)), 1, 32); } -void OPM_FPrintSet (int32 *fp, uint64 set) +void OPM_FPrintSet (INT32 *fp, UINT64 set) { - OPM_FPrint(&*fp, __VAL(int32, set)); + OPM_FPrint(&*fp, __VAL(INT32, set)); } -void OPM_FPrintReal (int32 *fp, REAL real) +void OPM_FPrintReal (INT32 *fp, REAL real) { - int16 i; - int32 l; - __GET((address)&real, l, int32); + INT16 i; + INT32 l; + __GET((address)&real, l, INT32); OPM_FPrint(&*fp, l); } -void OPM_FPrintLReal (int32 *fp, LONGREAL lr) +void OPM_FPrintLReal (INT32 *fp, LONGREAL lr) { - int32 l, h; - __GET((address)&lr, l, int32); - __GET((address)&lr + 4, h, int32); + INT32 l, h; + __GET((address)&lr, l, INT32); + __GET((address)&lr + 4, h, INT32); OPM_FPrint(&*fp, l); OPM_FPrint(&*fp, h); } @@ -728,21 +728,21 @@ void OPM_SymRCh (CHAR *ch) Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&*ch); } -int32 OPM_SymRInt (void) +INT32 OPM_SymRInt (void) { - int32 k; + INT32 k; Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&k, 4); return k; } -int64 OPM_SymRInt64 (void) +INT64 OPM_SymRInt64 (void) { - int64 k; + INT64 k; Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&k, 8); return k; } -void OPM_SymRSet (uint64 *s) +void OPM_SymRSet (UINT64 *s) { Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&*s, 8); } @@ -790,14 +790,14 @@ void OPM_SymWCh (CHAR ch) Files_Write(&OPM_newSF, Files_Rider__typ, ch); } -void OPM_SymWInt (int64 i) +void OPM_SymWInt (INT64 i) { Files_WriteNum(&OPM_newSF, Files_Rider__typ, i); } -void OPM_SymWSet (uint64 s) +void OPM_SymWSet (UINT64 s) { - Files_WriteNum(&OPM_newSF, Files_Rider__typ, (int64)s); + Files_WriteNum(&OPM_newSF, Files_Rider__typ, (INT64)s); } void OPM_SymWReal (REAL r) @@ -841,7 +841,7 @@ void OPM_Write (CHAR ch) void OPM_WriteString (CHAR *s, LONGINT s__len) { - int16 i; + INT16 i; i = 0; while (s[__X(i, s__len)] != 0x00) { i += 1; @@ -851,7 +851,7 @@ void OPM_WriteString (CHAR *s, LONGINT s__len) void OPM_WriteStringVar (CHAR *s, LONGINT s__len) { - int16 i; + INT16 i; i = 0; while (s[__X(i, s__len)] != 0x00) { i += 1; @@ -859,17 +859,17 @@ void OPM_WriteStringVar (CHAR *s, LONGINT s__len) Files_WriteBytes(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, (void*)s, s__len * 1, i); } -void OPM_WriteHex (int64 i) +void OPM_WriteHex (INT64 i) { CHAR s[3]; - int32 digit; - digit = __ASHR((int32)i, 4); + INT32 digit; + digit = __ASHR((INT32)i, 4); if (digit < 10) { s[0] = (CHAR)(48 + digit); } else { s[0] = (CHAR)(87 + digit); } - digit = __MASK((int32)i, -16); + digit = __MASK((INT32)i, -16); if (digit < 10) { s[1] = (CHAR)(48 + digit); } else { @@ -879,10 +879,10 @@ void OPM_WriteHex (int64 i) OPM_WriteString(s, 3); } -void OPM_WriteInt (int64 i) +void OPM_WriteInt (INT64 i) { CHAR s[24]; - int64 i1, k; + INT64 i1, k; if ((i == OPM_SignedMinimum(2) || i == OPM_SignedMinimum(4)) || i == OPM_SignedMinimum(8)) { OPM_Write('('); OPM_WriteInt(i + 1); @@ -915,14 +915,14 @@ void OPM_WriteReal (LONGREAL r, CHAR suffx) Texts_Reader R; CHAR s[32]; CHAR ch; - int16 i; - if ((((r < OPM_SignedMaximum(OPM_LongintSize) && r > OPM_SignedMinimum(OPM_LongintSize))) && r == ((int32)__ENTIER(r)))) { + INT16 i; + if ((((r < OPM_SignedMaximum(OPM_LongintSize) && r > OPM_SignedMinimum(OPM_LongintSize))) && r == ((INT32)__ENTIER(r)))) { if (suffx == 'f') { OPM_WriteString((CHAR*)"(REAL)", 7); } else { OPM_WriteString((CHAR*)"(LONGREAL)", 11); } - OPM_WriteInt((int32)__ENTIER(r)); + OPM_WriteInt((INT32)__ENTIER(r)); } else { Texts_OpenWriter(&W, Texts_Writer__typ); if (suffx == 'f') { @@ -960,7 +960,7 @@ void OPM_WriteLn (void) Files_Write(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, 0x0a); } -static void OPM_Append (Files_Rider *R, address *R__typ, Files_File F) +static void OPM_Append (Files_Rider *R, ADDRESS *R__typ, Files_File F) { Files_Rider R1; CHAR buffer[4096]; @@ -1003,7 +1003,7 @@ void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len) void OPM_CloseFiles (void) { CHAR FName[32]; - int16 res; + INT16 res; if (OPM_noerr) { OPM_LogWStr((CHAR*)" ", 3); OPM_LogWNum(Files_Pos(&OPM_R[1], Files_Rider__typ), 0); diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index be9e98bd..42866571 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h @@ -7,14 +7,14 @@ import CHAR OPM_Model[10]; -import int16 OPM_AddressSize, OPM_Alignment; -import uint32 OPM_GlobalOptions, OPM_Options; -import int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; -import int64 OPM_MaxIndex; +import INT16 OPM_AddressSize, OPM_Alignment; +import UINT32 OPM_GlobalOptions, OPM_Options; +import INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; +import INT64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; -import int32 OPM_curpos, OPM_errpos, OPM_breakpc; -import int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; +import INT32 OPM_curpos, OPM_errpos, OPM_breakpc; +import INT16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; import CHAR OPM_modName[32]; import CHAR OPM_objname[64]; import CHAR OPM_ResourceDir[1024]; @@ -23,47 +23,47 @@ import CHAR OPM_ResourceDir[1024]; import void OPM_CloseFiles (void); import void OPM_CloseOldSym (void); import void OPM_DeleteNewSym (void); -import void OPM_FPrint (int32 *fp, int64 val); -import void OPM_FPrintLReal (int32 *fp, LONGREAL lr); -import void OPM_FPrintReal (int32 *fp, REAL real); -import void OPM_FPrintSet (int32 *fp, uint64 set); +import void OPM_FPrint (INT32 *fp, INT64 val); +import void OPM_FPrintLReal (INT32 *fp, LONGREAL lr); +import void OPM_FPrintReal (INT32 *fp, REAL real); +import void OPM_FPrintSet (INT32 *fp, UINT64 set); import void OPM_Get (CHAR *ch); import void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); import void OPM_InitOptions (void); -import int16 OPM_Integer (int64 n); +import INT16 OPM_Integer (INT64 n); import void OPM_LogW (CHAR ch); import void OPM_LogWLn (void); -import void OPM_LogWNum (int64 i, int64 len); +import void OPM_LogWNum (INT64 i, INT64 len); import void OPM_LogWStr (CHAR *s, LONGINT s__len); -import int32 OPM_Longint (int64 n); -import void OPM_Mark (int16 n, int32 pos); +import INT32 OPM_Longint (INT64 n); +import void OPM_Mark (INT16 n, INT32 pos); import void OPM_NewSym (CHAR *modName, LONGINT modName__len); import void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); import void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); import BOOLEAN OPM_OpenPar (void); import void OPM_RegisterNewSym (void); -import int64 OPM_SignedMaximum (int32 bytecount); -import int64 OPM_SignedMinimum (int32 bytecount); +import INT64 OPM_SignedMaximum (INT32 bytecount); +import INT64 OPM_SignedMinimum (INT32 bytecount); import void OPM_SymRCh (CHAR *ch); -import int32 OPM_SymRInt (void); -import int64 OPM_SymRInt64 (void); +import INT32 OPM_SymRInt (void); +import INT64 OPM_SymRInt64 (void); import void OPM_SymRLReal (LONGREAL *lr); import void OPM_SymRReal (REAL *r); -import void OPM_SymRSet (uint64 *s); +import void OPM_SymRSet (UINT64 *s); import void OPM_SymWCh (CHAR ch); -import void OPM_SymWInt (int64 i); +import void OPM_SymWInt (INT64 i); import void OPM_SymWLReal (LONGREAL lr); import void OPM_SymWReal (REAL r); -import void OPM_SymWSet (uint64 s); +import void OPM_SymWSet (UINT64 s); import void OPM_Write (CHAR ch); -import void OPM_WriteHex (int64 i); -import void OPM_WriteInt (int64 i); +import void OPM_WriteHex (INT64 i); +import void OPM_WriteInt (INT64 i); import void OPM_WriteLn (void); import void OPM_WriteReal (LONGREAL r, CHAR suffx); import void OPM_WriteString (CHAR *s, LONGINT s__len); import void OPM_WriteStringVar (CHAR *s, LONGINT s__len); import BOOLEAN OPM_eofSF (void); -import void OPM_err (int16 n); +import void OPM_err (INT16 n); import void *OPM__init(void); diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index 615109df..3eabde0b 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "OPB.h" @@ -12,38 +12,38 @@ #include "OPT.h" struct OPP__1 { - int32 low, high; + INT32 low, high; }; typedef struct OPP__1 OPP_CaseTable[128]; -static int8 OPP_sym, OPP_level; -static int16 OPP_LoopLevel; +static INT8 OPP_sym, OPP_level; +static INT16 OPP_LoopLevel; static OPT_Node OPP_TDinit, OPP_lastTDinit; -static int16 OPP_nofFwdPtr; +static INT16 OPP_nofFwdPtr; static OPT_Struct OPP_FwdPtr[64]; -export address *OPP__1__typ; +export ADDRESS *OPP__1__typ; static void OPP_ActualParameters (OPT_Node *aparlist, OPT_Object fpar); static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned); static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq); -static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int16 *n, OPP_CaseTable tab); -static void OPP_CheckMark (int8 *vis); -static void OPP_CheckSym (int16 s); -static void OPP_CheckSysFlag (int16 *sysflag, int16 default_); +static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INT16 *n, OPP_CaseTable tab); +static void OPP_CheckMark (INT8 *vis); +static void OPP_CheckSym (INT16 s); +static void OPP_CheckSysFlag (INT16 *sysflag, INT16 default_); static void OPP_ConstExpression (OPT_Node *x); static void OPP_Element (OPT_Node *x); static void OPP_Expression (OPT_Node *x); static BOOLEAN OPP_Extends (OPT_Struct x, OPT_Struct b); static void OPP_Factor (OPT_Node *x); static void OPP_FormalParameters (OPT_Object *firstPar, OPT_Struct *resTyp); -export void OPP_Module (OPT_Node *prog, uint32 opt); +export void OPP_Module (OPT_Node *prog, UINT32 opt); static void OPP_PointerType (OPT_Struct *typ); static void OPP_ProcedureDeclaration (OPT_Node *x); -static void OPP_Receiver (int8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec); +static void OPP_Receiver (INT8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec); static void OPP_RecordType (OPT_Struct *typ, OPT_Struct *banned); static void OPP_Sets (OPT_Node *x); static void OPP_SimpleExpression (OPT_Node *x); @@ -52,19 +52,19 @@ static void OPP_StatSeq (OPT_Node *stat); static void OPP_Term (OPT_Node *x); static void OPP_Type (OPT_Struct *typ, OPT_Struct *banned); static void OPP_TypeDecl (OPT_Struct *typ, OPT_Struct *banned); -static void OPP_err (int16 n); +static void OPP_err (INT16 n); static void OPP_qualident (OPT_Object *id); static void OPP_selector (OPT_Node *x); -static void OPP_err (int16 n) +static void OPP_err (INT16 n) { OPM_err(n); } -static void OPP_CheckSym (int16 s) +static void OPP_CheckSym (INT16 s) { - if ((int16)OPP_sym == s) { + if ((INT16)OPP_sym == s) { OPS_Get(&OPP_sym); } else { OPM_err(s); @@ -74,7 +74,7 @@ static void OPP_CheckSym (int16 s) static void OPP_qualident (OPT_Object *id) { OPT_Object obj = NIL; - int8 lev; + INT8 lev; OPT_Find(&obj); OPS_Get(&OPP_sym); if ((((OPP_sym == 18 && obj != NIL)) && obj->mode == 11)) { @@ -114,7 +114,7 @@ static void OPP_ConstExpression (OPT_Node *x) } } -static void OPP_CheckMark (int8 *vis) +static void OPP_CheckMark (INT8 *vis) { OPS_Get(&OPP_sym); if (OPP_sym == 1 || OPP_sym == 7) { @@ -132,10 +132,10 @@ static void OPP_CheckMark (int8 *vis) } } -static void OPP_CheckSysFlag (int16 *sysflag, int16 default_) +static void OPP_CheckSysFlag (INT16 *sysflag, INT16 default_) { OPT_Node x = NIL; - int64 sf; + INT64 sf; if (OPP_sym == 31) { OPS_Get(&OPP_sym); if (!OPT_SYSimported) { @@ -163,7 +163,7 @@ static void OPP_RecordType (OPT_Struct *typ, OPT_Struct *banned) { OPT_Object fld = NIL, first = NIL, last = NIL, base = NIL; OPT_Struct ftyp = NIL; - int16 sysflag; + INT16 sysflag; *typ = OPT_NewStr(13, 4); (*typ)->BaseTyp = NIL; OPP_CheckSysFlag(&sysflag, -1); @@ -255,8 +255,8 @@ static void OPP_RecordType (OPT_Struct *typ, OPT_Struct *banned) static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) { OPT_Node x = NIL; - int64 n; - int16 sysflag; + INT64 n; + INT16 sysflag; OPP_CheckSysFlag(&sysflag, 0); if (OPP_sym == 25) { *typ = OPT_NewStr(13, 3); @@ -348,7 +348,7 @@ static void OPP_PointerType (OPT_Struct *typ) static void OPP_FormalParameters (OPT_Object *firstPar, OPT_Struct *resTyp) { - int8 mode; + INT8 mode; OPT_Object par = NIL, first = NIL, last = NIL, res = NIL; OPT_Struct typ = NIL; first = NIL; @@ -629,9 +629,9 @@ static void OPP_ActualParameters (OPT_Node *aparlist, OPT_Object fpar) static void OPP_StandProcCall (OPT_Node *x) { OPT_Node y = NIL; - int8 m; - int16 n; - m = (int8)((int16)(*x)->obj->adr); + INT8 m; + INT16 n; + m = (INT8)((INT16)(*x)->obj->adr); n = 0; if (OPP_sym == 30) { OPS_Get(&OPP_sym); @@ -790,7 +790,7 @@ static void OPP_Factor (OPT_Node *x) static void OPP_Term (OPT_Node *x) { OPT_Node y = NIL; - int8 mulop; + INT8 mulop; OPP_Factor(&*x); while ((1 <= OPP_sym && OPP_sym <= 5)) { mulop = OPP_sym; @@ -803,7 +803,7 @@ static void OPP_Term (OPT_Node *x) static void OPP_SimpleExpression (OPT_Node *x) { OPT_Node y = NIL; - int8 addop; + INT8 addop; if (OPP_sym == 7) { OPS_Get(&OPP_sym); OPP_Term(&*x); @@ -827,7 +827,7 @@ static void OPP_Expression (OPT_Node *x) { OPT_Node y = NIL; OPT_Object obj = NIL; - int8 relation; + INT8 relation; OPP_SimpleExpression(&*x); if ((9 <= OPP_sym && OPP_sym <= 14)) { relation = OPP_sym; @@ -853,7 +853,7 @@ static void OPP_Expression (OPT_Node *x) } } -static void OPP_Receiver (int8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec) +static void OPP_Receiver (INT8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec) { OPT_Object obj = NIL; *typ = OPT_undftyp; @@ -917,7 +917,7 @@ static struct ProcedureDeclaration__16 { OPT_Node *x; OPT_Object *proc, *fwd; OPS_Name *name; - int8 *mode, *vis; + INT8 *mode, *vis; BOOLEAN *forward; struct ProcedureDeclaration__16 *lnk; } *ProcedureDeclaration__16_s; @@ -930,8 +930,8 @@ static void TProcDecl__23 (void); static void GetCode__19 (void) { OPT_ConstExt ext = NIL; - int16 n; - int64 c; + INT16 n; + INT64 c; ext = OPT_NewExt(); (*ProcedureDeclaration__16_s->proc)->conval->ext = ext; n = 0; @@ -995,7 +995,7 @@ static void GetParams__21 (void) static void Body__17 (void) { OPT_Node procdec = NIL, statseq = NIL; - int32 c; + INT32 c; c = OPM_errpos; (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1,64); OPP_CheckSym(39); @@ -1018,7 +1018,7 @@ static void TProcDecl__23 (void) { OPT_Object baseProc = NIL; OPT_Struct objTyp = NIL, recTyp = NIL; - int8 objMode; + INT8 objMode; OPS_Name objName; OPS_Get(&OPP_sym); *ProcedureDeclaration__16_s->mode = 13; @@ -1090,7 +1090,7 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) { OPT_Object proc = NIL, fwd = NIL; OPS_Name name; - int8 mode, vis; + INT8 mode, vis; BOOLEAN forward; struct ProcedureDeclaration__16 _s; _s.x = x; @@ -1167,11 +1167,11 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) ProcedureDeclaration__16_s = _s.lnk; } -static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int16 *n, OPP_CaseTable tab) +static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INT16 *n, OPP_CaseTable tab) { OPT_Node x = NIL, y = NIL, lastlab = NIL; - int16 i, f; - int32 xval, yval; + INT16 i, f; + INT32 xval, yval; *lab = NIL; lastlab = NIL; for (;;) { @@ -1187,14 +1187,14 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int16 *n, OPP if (!(LabelTyp->form == 4) || LabelTyp->size < x->typ->size) { OPP_err(60); } - } else if ((int16)LabelTyp->form != f) { + } else if ((INT16)LabelTyp->form != f) { OPP_err(60); } if (OPP_sym == 21) { OPS_Get(&OPP_sym); OPP_ConstExpression(&y); yval = OPM_Longint(y->conval->intval); - if (((int16)y->typ->form != f && !((f == 4 && y->typ->form == 4)))) { + if (((INT16)y->typ->form != f && !((f == 4 && y->typ->form == 4)))) { OPP_err(60); } if (yval < xval) { @@ -1238,7 +1238,7 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int16 *n, OPP } static struct StatSeq__30 { - int32 *pos; + INT32 *pos; struct StatSeq__30 *lnk; } *StatSeq__30_s; @@ -1248,8 +1248,8 @@ static void SetPos__35 (OPT_Node x); static void CasePart__31 (OPT_Node *x) { - int16 n; - int32 low, high; + INT16 n; + INT32 low, high; BOOLEAN e; OPP_CaseTable tab; OPT_Node cases = NIL, lab = NIL, y = NIL, lastcase = NIL; @@ -1332,7 +1332,7 @@ static void OPP_StatSeq (OPT_Node *stat) OPT_Struct idtyp = NIL; BOOLEAN e; OPT_Node s = NIL, x = NIL, y = NIL, z = NIL, apar = NIL, last = NIL, lastif = NIL; - int32 pos; + INT32 pos; OPS_Name name; struct StatSeq__30 _s; _s.pos = &pos; @@ -1625,7 +1625,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) OPT_Struct typ = NIL; OPT_Object obj = NIL, first = NIL, last = NIL; OPT_Node x = NIL, lastdec = NIL; - int16 i; + INT16 i; first = NIL; last = NIL; OPP_nofFwdPtr = 0; @@ -1774,11 +1774,11 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) OPP_CheckSym(41); } -void OPP_Module (OPT_Node *prog, uint32 opt) +void OPP_Module (OPT_Node *prog, UINT32 opt) { OPS_Name impName, aliasName; OPT_Node procdec = NIL, statseq = NIL; - int32 c; + INT32 c; BOOLEAN done; OPS_Init(); OPP_LoopLevel = 0; diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index de0e599a..cb3aabc8 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h @@ -9,7 +9,7 @@ -import void OPP_Module (OPT_Node *prog, uint32 opt); +import void OPP_Module (OPT_Node *prog, UINT32 opt); import void *OPP__init(void); diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index 5a34663d..5d7b776f 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "OPM.h" @@ -17,29 +17,29 @@ typedef export OPS_Name OPS_name; export OPS_String OPS_str; -export int16 OPS_numtyp; -export int64 OPS_intval; +export INT16 OPS_numtyp; +export INT64 OPS_intval; export REAL OPS_realval; export LONGREAL OPS_lrlval; static CHAR OPS_ch; -export void OPS_Get (int8 *sym); -static void OPS_Identifier (int8 *sym); +export void OPS_Get (INT8 *sym); +static void OPS_Identifier (INT8 *sym); export void OPS_Init (void); static void OPS_Number (void); -static void OPS_Str (int8 *sym); -static void OPS_err (int16 n); +static void OPS_Str (INT8 *sym); +static void OPS_err (INT16 n); -static void OPS_err (int16 n) +static void OPS_err (INT16 n) { OPM_err(n); } -static void OPS_Str (int8 *sym) +static void OPS_Str (INT8 *sym) { - int16 i; + INT16 i; CHAR och; i = 0; och = OPS_ch; @@ -65,15 +65,15 @@ static void OPS_Str (int8 *sym) if (OPS_intval == 2) { *sym = 35; OPS_numtyp = 1; - OPS_intval = (int16)OPS_str[0]; + OPS_intval = (INT16)OPS_str[0]; } else { *sym = 37; } } -static void OPS_Identifier (int8 *sym) +static void OPS_Identifier (INT8 *sym) { - int16 i; + INT16 i; i = 0; do { OPS_name[i] = OPS_ch; @@ -92,10 +92,10 @@ static struct Number__6 { struct Number__6 *lnk; } *Number__6_s; -static int16 Ord__7 (CHAR ch, BOOLEAN hex); -static LONGREAL Ten__9 (int16 e); +static INT16 Ord__7 (CHAR ch, BOOLEAN hex); +static LONGREAL Ten__9 (INT16 e); -static LONGREAL Ten__9 (int16 e) +static LONGREAL Ten__9 (INT16 e) { LONGREAL x, p; x = (LONGREAL)1; @@ -112,12 +112,12 @@ static LONGREAL Ten__9 (int16 e) return x; } -static int16 Ord__7 (CHAR ch, BOOLEAN hex) +static INT16 Ord__7 (CHAR ch, BOOLEAN hex) { if (ch <= '9') { - return (int16)ch - 48; + return (INT16)ch - 48; } else if (hex) { - return ((int16)ch - 65) + 10; + return ((INT16)ch - 65) + 10; } else { OPS_err(2); return 0; @@ -127,7 +127,7 @@ static int16 Ord__7 (CHAR ch, BOOLEAN hex) static void OPS_Number (void) { - int16 i, m, n, d, e; + INT16 i, m, n, d, e; CHAR dig[24]; LONGREAL f; CHAR expCh; @@ -173,7 +173,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) + (INT64)Ord__7(dig[i], 1); i += 1; } } else { @@ -187,7 +187,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) + (INT64)Ord__7(dig[i], 1); i += 1; } } else { @@ -198,8 +198,8 @@ static void OPS_Number (void) while (i < n) { d = Ord__7(dig[i], 0); i += 1; - if (OPS_intval <= __DIV(9223372036854775807 - (int64)d, 10)) { - OPS_intval = OPS_intval * 10 + (int64)d; + if (OPS_intval <= __DIV(9223372036854775807 - (INT64)d, 10)) { + OPS_intval = OPS_intval * 10 + (INT64)d; } else { OPS_err(203); } @@ -308,9 +308,9 @@ static void Comment__2 (void) } } -void OPS_Get (int8 *sym) +void OPS_Get (INT8 *sym) { - int8 s; + INT8 s; struct Get__1 _s; _s.lnk = Get__1_s; Get__1_s = &_s; diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index a452da84..01ffbd17 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h @@ -14,13 +14,13 @@ typedef import OPS_Name OPS_name; import OPS_String OPS_str; -import int16 OPS_numtyp; -import int64 OPS_intval; +import INT16 OPS_numtyp; +import INT64 OPS_intval; import REAL OPS_realval; import LONGREAL OPS_lrlval; -import void OPS_Get (int8 *sym); +import void OPS_Get (INT8 *sym); import void OPS_Init (void); import void *OPS__init(void); diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index 48352c94..e1405ce9 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "OPM.h" @@ -18,18 +18,18 @@ typedef typedef struct OPT_ConstDesc { OPT_ConstExt ext; - int64 intval; - int32 intval2; - uint64 setval; + INT64 intval; + INT32 intval2; + UINT64 setval; LONGREAL realval; } OPT_ConstDesc; typedef struct OPT_ExpCtxt { - int32 reffp; - int16 ref; - int8 nofm; - int8 locmno[64]; + INT32 reffp; + INT16 ref; + INT8 nofm; + INT8 locmno[64]; } OPT_ExpCtxt; typedef @@ -40,13 +40,13 @@ typedef typedef struct OPT_ImpCtxt { - int32 nextTag, reffp; - int16 nofr, minr, nofm; + INT32 nextTag, reffp; + INT16 nofr, minr, nofm; BOOLEAN self; OPT_Struct ref[255]; OPT_Object old[255]; - int32 pvfp[255]; - int8 glbmno[64]; + INT32 pvfp[255]; + INT8 glbmno[64]; } OPT_ImpCtxt; typedef @@ -55,7 +55,7 @@ typedef typedef struct OPT_NodeDesc { OPT_Node left, right, link; - int8 class, subcl; + INT8 class, subcl; BOOLEAN readonly; OPT_Struct typ; OPT_Object obj; @@ -67,22 +67,22 @@ typedef OPT_Object left, right, link, scope; OPS_Name name; BOOLEAN leaf; - int8 mode, mnolev, vis, history; + INT8 mode, mnolev, vis, history; BOOLEAN used, fpdone; - int32 fprint; + INT32 fprint; OPT_Struct typ; OPT_Const conval; - int32 adr, linkadr; - int16 x; + INT32 adr, linkadr; + INT16 x; } OPT_ObjDesc; typedef struct OPT_StrDesc { - int8 form, comp, mno, extlev; - int16 ref, sysflag; - int32 n, size, align, txtpos; + INT8 form, comp, mno, extlev; + INT16 ref, sysflag; + INT32 n, size, align, txtpos; BOOLEAN allocated, pbused, pvused, fpdone, idfpdone; - int32 idfp, pbfp, pvfp; + INT32 idfp, pbfp, pvfp; OPT_Struct BaseTyp; OPT_Object link, strobj; } OPT_StrDesc; @@ -91,80 +91,80 @@ typedef export OPT_Object OPT_topScope; export OPT_Struct OPT_undftyp, OPT_niltyp, OPT_notyp, OPT_bytetyp, OPT_cpbytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_settyp, OPT_set32typ, OPT_set64typ, OPT_realtyp, OPT_lrltyp, OPT_stringtyp, OPT_adrtyp, OPT_sysptrtyp; export OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj, OPT_setobj; -export int8 OPT_nofGmod; +export INT8 OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; export BOOLEAN OPT_SYSimported; static OPT_Object OPT_universe, OPT_syslink; static OPT_ImpCtxt OPT_impCtxt; static OPT_ExpCtxt OPT_expCtxt; -static int32 OPT_nofhdfld; +static INT32 OPT_nofhdfld; static BOOLEAN OPT_newsf, OPT_findpc, OPT_extsf, OPT_sfpresent, OPT_symExtended, OPT_symNew; -static int32 OPT_recno; +static INT32 OPT_recno; -export address *OPT_ConstDesc__typ; -export address *OPT_ObjDesc__typ; -export address *OPT_StrDesc__typ; -export address *OPT_NodeDesc__typ; -export address *OPT_ImpCtxt__typ; -export address *OPT_ExpCtxt__typ; +export ADDRESS *OPT_ConstDesc__typ; +export ADDRESS *OPT_ObjDesc__typ; +export ADDRESS *OPT_StrDesc__typ; +export ADDRESS *OPT_NodeDesc__typ; +export ADDRESS *OPT_ImpCtxt__typ; +export ADDRESS *OPT_ExpCtxt__typ; -export void OPT_Align (int32 *adr, int32 base); -export int32 OPT_BaseAlignment (OPT_Struct typ); +export void OPT_Align (INT32 *adr, INT32 base); +export INT32 OPT_BaseAlignment (OPT_Struct typ); export void OPT_Close (void); export void OPT_CloseScope (void); static void OPT_DebugStruct (OPT_Struct btyp); -static void OPT_EnterBoolConst (OPS_Name name, int32 value); -static void OPT_EnterProc (OPS_Name name, int16 num); -static void OPT_EnterTyp (OPS_Name name, int8 form, int16 size, OPT_Struct *res); +static void OPT_EnterBoolConst (OPS_Name name, INT32 value); +static void OPT_EnterProc (OPS_Name name, INT16 num); +static void OPT_EnterTyp (OPS_Name name, INT8 form, INT16 size, OPT_Struct *res); static void OPT_EnterTypeAlias (OPS_Name name, OPT_Object *res); export void OPT_Export (BOOLEAN *ext, BOOLEAN *new); -export void OPT_FPrintErr (OPT_Object obj, int16 errcode); -static void OPT_FPrintName (int32 *fp, CHAR *name, LONGINT name__len); +export void OPT_FPrintErr (OPT_Object obj, INT16 errcode); +static void OPT_FPrintName (INT32 *fp, CHAR *name, LONGINT name__len); export void OPT_FPrintObj (OPT_Object obj); -static void OPT_FPrintSign (int32 *fp, OPT_Struct result, OPT_Object par); +static void OPT_FPrintSign (INT32 *fp, OPT_Struct result, OPT_Object par); export void OPT_FPrintStr (OPT_Struct typ); export void OPT_Find (OPT_Object *res); export void OPT_FindField (OPS_Name name, OPT_Struct typ, OPT_Object *res); export void OPT_FindImport (OPT_Object mod, OPT_Object *res); export void OPT_IdFPrint (OPT_Struct typ); export void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); -static void OPT_InConstant (int32 f, OPT_Const conval); +static void OPT_InConstant (INT32 f, OPT_Const conval); static OPT_Object OPT_InFld (void); -static void OPT_InMod (int8 *mno); +static void OPT_InMod (INT8 *mno); static void OPT_InName (CHAR *name, LONGINT name__len); -static OPT_Object OPT_InObj (int8 mno); -static void OPT_InSign (int8 mno, OPT_Struct *res, OPT_Object *par); +static OPT_Object OPT_InObj (INT8 mno); +static void OPT_InSign (INT8 mno, OPT_Struct *res, OPT_Object *par); static void OPT_InStruct (OPT_Struct *typ); -static OPT_Object OPT_InTProc (int8 mno); -static OPT_Struct OPT_InTyp (int32 tag); -export void OPT_Init (OPS_Name name, uint32 opt); +static OPT_Object OPT_InTProc (INT8 mno); +static OPT_Struct OPT_InTyp (INT32 tag); +export void OPT_Init (OPS_Name name, UINT32 opt); export void OPT_InitRecno (void); -static void OPT_InitStruct (OPT_Struct *typ, int8 form); +static void OPT_InitStruct (OPT_Struct *typ, INT8 form); export void OPT_Insert (OPS_Name name, OPT_Object *obj); export void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); -export int16 OPT_IntSize (int64 n); -export OPT_Struct OPT_IntType (int32 size); +export INT16 OPT_IntSize (INT64 n); +export OPT_Struct OPT_IntType (INT32 size); export OPT_Const OPT_NewConst (void); export OPT_ConstExt OPT_NewExt (void); -export OPT_Node OPT_NewNode (int8 class); +export OPT_Node OPT_NewNode (INT8 class); export OPT_Object OPT_NewObj (void); -export OPT_Struct OPT_NewStr (int8 form, int8 comp); -export void OPT_OpenScope (int8 level, OPT_Object owner); +export OPT_Struct OPT_NewStr (INT8 form, INT8 comp); +export void OPT_OpenScope (INT8 level, OPT_Object owner); static void OPT_OutConstant (OPT_Object obj); -static void OPT_OutFlds (OPT_Object fld, int32 adr, BOOLEAN visible); -static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, int32 adr); -static void OPT_OutMod (int16 mno); +static void OPT_OutFlds (OPT_Object fld, INT32 adr, BOOLEAN visible); +static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, INT32 adr); +static void OPT_OutMod (INT16 mno); static void OPT_OutName (CHAR *name, LONGINT name__len); static void OPT_OutObj (OPT_Object obj); static void OPT_OutSign (OPT_Struct result, OPT_Object par); static void OPT_OutStr (OPT_Struct typ); static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj); -export OPT_Struct OPT_SetType (int32 size); -export OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir); -export int32 OPT_SizeAlignment (int32 size); +export OPT_Struct OPT_SetType (INT32 size); +export OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INT16 dir); +export INT32 OPT_SizeAlignment (INT32 size); export void OPT_TypSize (OPT_Struct typ); -static void OPT_err (int16 n); +static void OPT_err (INT16 n); void OPT_InitRecno (void) @@ -172,14 +172,14 @@ void OPT_InitRecno (void) OPT_recno = 0; } -static void OPT_err (int16 n) +static void OPT_err (INT16 n) { OPM_err(n); } -int16 OPT_IntSize (int64 n) +INT16 OPT_IntSize (INT64 n) { - int16 bytes; + INT16 bytes; if (n < 0) { n = -(n + 1); } @@ -190,7 +190,7 @@ int16 OPT_IntSize (int64 n) return bytes; } -OPT_Struct OPT_IntType (int32 size) +OPT_Struct OPT_IntType (INT32 size) { if (size <= OPT_int8typ->size) { return OPT_int8typ; @@ -204,7 +204,7 @@ OPT_Struct OPT_IntType (int32 size) return OPT_int64typ; } -OPT_Struct OPT_SetType (int32 size) +OPT_Struct OPT_SetType (INT32 size) { if (size == OPT_set32typ->size) { return OPT_set32typ; @@ -212,9 +212,9 @@ OPT_Struct OPT_SetType (int32 size) return OPT_set64typ; } -OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir) +OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INT16 dir) { - int16 i; + INT16 i; __ASSERT(x->form == 4, 0); __ASSERT(x->BaseTyp == OPT_undftyp, 0); __ASSERT(dir == 1 || dir == -1, 0); @@ -244,7 +244,7 @@ OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir) __RETCHK; } -void OPT_Align (int32 *adr, int32 base) +void OPT_Align (INT32 *adr, INT32 base) { switch (base) { case 2: @@ -264,9 +264,9 @@ void OPT_Align (int32 *adr, int32 base) } } -int32 OPT_SizeAlignment (int32 size) +INT32 OPT_SizeAlignment (INT32 size) { - int32 alignment; + INT32 alignment; if (size < OPM_Alignment) { alignment = 1; while (alignment < size) { @@ -278,9 +278,9 @@ int32 OPT_SizeAlignment (int32 size) return alignment; } -int32 OPT_BaseAlignment (OPT_Struct typ) +INT32 OPT_BaseAlignment (OPT_Struct typ) { - int32 alignment; + INT32 alignment; if (typ->form == 13) { if (typ->comp == 4) { alignment = __MASK(typ->align, -65536); @@ -295,8 +295,8 @@ int32 OPT_BaseAlignment (OPT_Struct typ) void OPT_TypSize (OPT_Struct typ) { - int16 f, c; - int32 offset, size, base, fbase, off0; + INT16 f, c; + INT32 offset, size, base, fbase, off0; OPT_Object fld = NIL; OPT_Struct btyp = NIL; if (typ == OPT_undftyp) { @@ -339,7 +339,7 @@ void OPT_TypSize (OPT_Struct typ) } typ->size = offset; typ->align = base; - typ->sysflag = __MASK(typ->sysflag, -256) + (int16)__ASHL(offset - off0, 8); + typ->sysflag = __MASK(typ->sysflag, -256) + (INT16)__ASHL(offset - off0, 8); } else if (c == 2) { OPT_TypSize(typ->BaseTyp); typ->size = typ->n * typ->BaseTyp->size; @@ -378,7 +378,7 @@ OPT_Object OPT_NewObj (void) return obj; } -OPT_Struct OPT_NewStr (int8 form, int8 comp) +OPT_Struct OPT_NewStr (INT8 form, INT8 comp) { OPT_Struct typ = NIL; __NEW(typ, OPT_StrDesc); @@ -393,7 +393,7 @@ OPT_Struct OPT_NewStr (int8 form, int8 comp) return typ; } -OPT_Node OPT_NewNode (int8 class) +OPT_Node OPT_NewNode (INT8 class) { OPT_Node node = NIL; __NEW(node, OPT_NodeDesc); @@ -404,11 +404,11 @@ OPT_Node OPT_NewNode (int8 class) OPT_ConstExt OPT_NewExt (void) { OPT_ConstExt ext = NIL; - ext = __NEWARR(NIL, 1, 1, 1, 0, ((int64)(256))); + ext = __NEWARR(NIL, 1, 1, 1, 0, ((INT64)(256))); return ext; } -void OPT_OpenScope (int8 level, OPT_Object owner) +void OPT_OpenScope (INT8 level, OPT_Object owner) { OPT_Object head = NIL; head = OPT_NewObj(); @@ -429,7 +429,7 @@ void OPT_CloseScope (void) OPT_topScope = OPT_topScope->left; } -void OPT_Init (OPS_Name name, uint32 opt) +void OPT_Init (OPS_Name name, UINT32 opt) { OPT_topScope = OPT_universe; OPT_OpenScope(0, NIL); @@ -446,7 +446,7 @@ void OPT_Init (OPS_Name name, uint32 opt) void OPT_Close (void) { - int16 i; + INT16 i; OPT_CloseScope(); i = 0; while (i < 64) { @@ -538,7 +538,7 @@ void OPT_Insert (OPS_Name name, OPT_Object *obj) { OPT_Object ob0 = NIL, ob1 = NIL; BOOLEAN left; - int8 mnolev; + INT8 mnolev; ob0 = OPT_topScope; ob1 = ob0->right; left = 0; @@ -576,14 +576,14 @@ void OPT_Insert (OPS_Name name, OPT_Object *obj) *obj = ob1; } -static void OPT_FPrintName (int32 *fp, CHAR *name, LONGINT name__len) +static void OPT_FPrintName (INT32 *fp, CHAR *name, LONGINT name__len) { - int16 i; + INT16 i; CHAR ch; i = 0; do { ch = name[__X(i, name__len)]; - OPM_FPrint(&*fp, (int16)ch); + OPM_FPrint(&*fp, (INT16)ch); i += 1; } while (!(ch == 0x00)); } @@ -621,7 +621,7 @@ static void OPT_DebugStruct (OPT_Struct btyp) OPM_LogWLn(); } -static void OPT_FPrintSign (int32 *fp, OPT_Struct result, OPT_Object par) +static void OPT_FPrintSign (INT32 *fp, OPT_Struct result, OPT_Object par) { OPT_IdFPrint(result); OPM_FPrint(&*fp, result->idfp); @@ -637,8 +637,8 @@ void OPT_IdFPrint (OPT_Struct typ) { OPT_Struct btyp = NIL; OPT_Object strobj = NIL; - int32 idfp; - int16 f, c; + INT32 idfp; + INT16 f, c; if (!typ->idfpdone) { typ->idfpdone = 1; idfp = 0; @@ -667,17 +667,17 @@ void OPT_IdFPrint (OPT_Struct typ) } static struct FPrintStr__15 { - int32 *pbfp, *pvfp; + INT32 *pbfp, *pvfp; struct FPrintStr__15 *lnk; } *FPrintStr__15_s; -static void FPrintFlds__16 (OPT_Object fld, int32 adr, BOOLEAN visible); -static void FPrintHdFld__18 (OPT_Struct typ, OPT_Object fld, int32 adr); +static void FPrintFlds__16 (OPT_Object fld, INT32 adr, BOOLEAN visible); +static void FPrintHdFld__18 (OPT_Struct typ, OPT_Object fld, INT32 adr); static void FPrintTProcs__20 (OPT_Object obj); -static void FPrintHdFld__18 (OPT_Struct typ, OPT_Object fld, int32 adr) +static void FPrintHdFld__18 (OPT_Struct typ, OPT_Object fld, INT32 adr) { - int32 i, j, n; + INT32 i, j, n; OPT_Struct btyp = NIL; if (typ->comp == 4) { FPrintFlds__16(typ->link, adr, 0); @@ -707,7 +707,7 @@ static void FPrintHdFld__18 (OPT_Struct typ, OPT_Object fld, int32 adr) } } -static void FPrintFlds__16 (OPT_Object fld, int32 adr, BOOLEAN visible) +static void FPrintFlds__16 (OPT_Object fld, INT32 adr, BOOLEAN visible) { while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { @@ -742,10 +742,10 @@ static void FPrintTProcs__20 (OPT_Object obj) void OPT_FPrintStr (OPT_Struct typ) { - int16 f, c; + INT16 f, c; OPT_Struct btyp = NIL; OPT_Object strobj = NIL, bstrobj = NIL; - int32 pbfp, pvfp; + INT32 pbfp, pvfp; struct FPrintStr__15 _s; _s.pbfp = &pbfp; _s.pvfp = &pvfp; @@ -806,8 +806,8 @@ void OPT_FPrintStr (OPT_Struct typ) void OPT_FPrintObj (OPT_Object obj) { - int32 fprint; - int16 f, m; + INT32 fprint; + INT16 f, m; REAL rval; OPT_ConstExt ext = NIL; if (!obj->fpdone) { @@ -849,11 +849,11 @@ void OPT_FPrintObj (OPT_Object obj) } else if (obj->mode == 9) { OPT_FPrintSign(&fprint, obj->typ, obj->link); ext = obj->conval->ext; - m = (int16)(*ext)[0]; + m = (INT16)(*ext)[0]; f = 1; OPM_FPrint(&fprint, m); while (f <= m) { - OPM_FPrint(&fprint, (int16)(*ext)[__X(f, 256)]); + OPM_FPrint(&fprint, (INT16)(*ext)[__X(f, 256)]); f += 1; } } else if (obj->mode == 5) { @@ -864,9 +864,9 @@ void OPT_FPrintObj (OPT_Object obj) } } -void OPT_FPrintErr (OPT_Object obj, int16 errcode) +void OPT_FPrintErr (OPT_Object obj, INT16 errcode) { - int16 i, j; + INT16 i, j; CHAR ch; if (obj->mnolev != 0) { __COPY(OPT_GlbMod[__X(-obj->mnolev, 64)]->name, OPM_objname, 64); @@ -956,7 +956,7 @@ void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old) static void OPT_InName (CHAR *name, LONGINT name__len) { - int16 i; + INT16 i; CHAR ch; i = 0; do { @@ -966,12 +966,12 @@ static void OPT_InName (CHAR *name, LONGINT name__len) } while (!(ch == 0x00)); } -static void OPT_InMod (int8 *mno) +static void OPT_InMod (INT8 *mno) { OPT_Object head = NIL; OPS_Name name; - int32 mn; - int8 i; + INT32 mn; + INT8 i; mn = OPM_SymRInt(); if (mn == 0) { *mno = OPT_impCtxt.glbmno[0]; @@ -1008,16 +1008,16 @@ static void OPT_InMod (int8 *mno) } } -static void OPT_InConstant (int32 f, OPT_Const conval) +static void OPT_InConstant (INT32 f, OPT_Const conval) { CHAR ch; - int16 i; + INT16 i; OPT_ConstExt ext = NIL; REAL rval; switch (f) { case 1: case 3: case 2: OPM_SymRCh(&ch); - conval->intval = (int16)ch; + conval->intval = (INT16)ch; break; case 4: conval->intval = OPM_SymRInt(); @@ -1057,10 +1057,10 @@ static void OPT_InConstant (int32 f, OPT_Const conval) } } -static void OPT_InSign (int8 mno, OPT_Struct *res, OPT_Object *par) +static void OPT_InSign (INT8 mno, OPT_Struct *res, OPT_Object *par) { OPT_Object last = NIL, new = NIL; - int32 tag; + INT32 tag; OPT_InStruct(&*res); tag = OPM_SymRInt(); last = NIL; @@ -1087,7 +1087,7 @@ static void OPT_InSign (int8 mno, OPT_Struct *res, OPT_Object *par) static OPT_Object OPT_InFld (void) { - int32 tag; + INT32 tag; OPT_Object obj = NIL; tag = OPT_impCtxt.nextTag; obj = OPT_NewObj(); @@ -1115,9 +1115,9 @@ static OPT_Object OPT_InFld (void) return obj; } -static OPT_Object OPT_InTProc (int8 mno) +static OPT_Object OPT_InTProc (INT8 mno) { - int32 tag; + INT32 tag; OPT_Object obj = NIL; tag = OPT_impCtxt.nextTag; obj = OPT_NewObj(); @@ -1141,7 +1141,7 @@ static OPT_Object OPT_InTProc (int8 mno) return obj; } -static OPT_Struct OPT_InTyp (int32 tag) +static OPT_Struct OPT_InTyp (INT32 tag) { if (tag == 4) { return OPT_IntType(OPM_SymRInt()); @@ -1155,9 +1155,9 @@ static OPT_Struct OPT_InTyp (int32 tag) static void OPT_InStruct (OPT_Struct *typ) { - int8 mno; - int16 ref; - int32 tag; + INT8 mno; + INT16 ref; + INT32 tag; OPS_Name name; OPT_Struct t = NIL; OPT_Object obj = NIL, last = NIL, fld = NIL, old = NIL, dummy = NIL; @@ -1213,7 +1213,7 @@ static void OPT_InStruct (OPT_Struct *typ) obj->vis = 0; tag = OPM_SymRInt(); if (tag == 35) { - (*typ)->sysflag = (int16)OPM_SymRInt(); + (*typ)->sysflag = (INT16)OPM_SymRInt(); tag = OPM_SymRInt(); } switch (tag) { @@ -1335,13 +1335,13 @@ static void OPT_InStruct (OPT_Struct *typ) } } -static OPT_Object OPT_InObj (int8 mno) +static OPT_Object OPT_InObj (INT8 mno) { - int16 i, s; + INT16 i, s; CHAR ch; OPT_Object obj = NIL, old = NIL; OPT_Struct typ = NIL; - int32 tag; + INT32 tag; OPT_ConstExt ext = NIL; tag = OPT_impCtxt.nextTag; if (tag == 19) { @@ -1374,7 +1374,7 @@ static OPT_Object OPT_InObj (int8 mno) obj->mode = 9; ext = OPT_NewExt(); obj->conval->ext = ext; - s = (int16)OPM_SymRInt(); + s = (INT16)OPM_SymRInt(); (*ext)[0] = (CHAR)s; i = 1; while (i <= s) { @@ -1439,7 +1439,7 @@ static OPT_Object OPT_InObj (int8 mno) void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) { OPT_Object obj = NIL; - int8 mno; + INT8 mno; OPS_Name aliasName__copy; __DUPARR(aliasName, OPS_Name); if (__STRCMP(name, "SYSTEM") == 0) { @@ -1482,7 +1482,7 @@ void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) static void OPT_OutName (CHAR *name, LONGINT name__len) { - int16 i; + INT16 i; CHAR ch; i = 0; do { @@ -1492,7 +1492,7 @@ static void OPT_OutName (CHAR *name, LONGINT name__len) } while (!(ch == 0x00)); } -static void OPT_OutMod (int16 mno) +static void OPT_OutMod (INT16 mno) { if (OPT_expCtxt.locmno[__X(mno, 64)] < 0) { OPM_SymWInt(16); @@ -1504,9 +1504,9 @@ static void OPT_OutMod (int16 mno) } } -static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, int32 adr) +static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, INT32 adr) { - int32 i, j, n; + INT32 i, j, n; OPT_Struct btyp = NIL; if (typ->comp == 4) { OPT_OutFlds(typ->link, adr, 0); @@ -1536,7 +1536,7 @@ static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, int32 adr) } } -static void OPT_OutFlds (OPT_Object fld, int32 adr, BOOLEAN visible) +static void OPT_OutFlds (OPT_Object fld, INT32 adr, BOOLEAN visible) { while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { @@ -1691,7 +1691,7 @@ static void OPT_OutStr (OPT_Struct typ) static void OPT_OutConstant (OPT_Object obj) { - int16 f; + INT16 f; REAL rval; f = obj->typ->form; OPM_SymWInt(f); @@ -1727,7 +1727,7 @@ static void OPT_OutConstant (OPT_Object obj) static void OPT_OutObj (OPT_Object obj) { - int16 i, j; + INT16 i, j; OPT_ConstExt ext = NIL; if (obj != NIL) { OPT_OutObj(obj->left); @@ -1794,7 +1794,7 @@ static void OPT_OutObj (OPT_Object obj) OPM_SymWInt(33); OPT_OutSign(obj->typ, obj->link); ext = obj->conval->ext; - j = (int16)(*ext)[0]; + j = (INT16)(*ext)[0]; i = 1; OPM_SymWInt(j); while (i <= j) { @@ -1817,8 +1817,8 @@ static void OPT_OutObj (OPT_Object obj) void OPT_Export (BOOLEAN *ext, BOOLEAN *new) { - int16 i; - int8 nofmod; + INT16 i; + INT8 nofmod; BOOLEAN done; OPT_symExtended = 0; OPT_symNew = 0; @@ -1857,7 +1857,7 @@ void OPT_Export (BOOLEAN *ext, BOOLEAN *new) } } -static void OPT_InitStruct (OPT_Struct *typ, int8 form) +static void OPT_InitStruct (OPT_Struct *typ, INT8 form) { *typ = OPT_NewStr(form, 1); (*typ)->ref = form; @@ -1871,7 +1871,7 @@ static void OPT_InitStruct (OPT_Struct *typ, int8 form) (*typ)->idfpdone = 1; } -static void OPT_EnterBoolConst (OPS_Name name, int32 value) +static void OPT_EnterBoolConst (OPS_Name name, INT32 value) { OPT_Object obj = NIL; OPS_Name name__copy; @@ -1883,7 +1883,7 @@ static void OPT_EnterBoolConst (OPS_Name name, int32 value) obj->conval->intval = value; } -static void OPT_EnterTyp (OPS_Name name, int8 form, int16 size, OPT_Struct *res) +static void OPT_EnterTyp (OPS_Name name, INT8 form, INT16 size, OPT_Struct *res) { OPT_Object obj = NIL; OPT_Struct typ = NIL; @@ -1918,7 +1918,7 @@ static void OPT_EnterTypeAlias (OPS_Name name, OPT_Object *res) *res = obj; } -static void OPT_EnterProc (OPS_Name name, int16 num) +static void OPT_EnterProc (OPS_Name name, INT16 num) { OPT_Object obj = NIL; OPS_Name name__copy; diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 38cd17c7..66f25d3d 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h @@ -15,9 +15,9 @@ typedef typedef struct OPT_ConstDesc { OPT_ConstExt ext; - int64 intval; - int32 intval2; - uint64 setval; + INT64 intval; + INT32 intval2; + UINT64 setval; LONGREAL realval; } OPT_ConstDesc; @@ -33,7 +33,7 @@ typedef typedef struct OPT_NodeDesc { OPT_Node left, right, link; - int8 class, subcl; + INT8 class, subcl; BOOLEAN readonly; OPT_Struct typ; OPT_Object obj; @@ -45,20 +45,20 @@ typedef OPT_Object left, right, link, scope; OPS_Name name; BOOLEAN leaf; - int8 mode, mnolev, vis, history; + INT8 mode, mnolev, vis, history; BOOLEAN used, fpdone; - int32 fprint; + INT32 fprint; OPT_Struct typ; OPT_Const conval; - int32 adr, linkadr; - int16 x; + INT32 adr, linkadr; + INT16 x; } OPT_ObjDesc; typedef struct OPT_StrDesc { - int8 form, comp, mno, extlev; - int16 ref, sysflag; - int32 n, size, align, txtpos; + INT8 form, comp, mno, extlev; + INT16 ref, sysflag; + INT32 n, size, align, txtpos; BOOLEAN allocated, pbused, pvused; char _prvt0[16]; OPT_Struct BaseTyp; @@ -69,22 +69,22 @@ typedef import OPT_Object OPT_topScope; import OPT_Struct OPT_undftyp, OPT_niltyp, OPT_notyp, OPT_bytetyp, OPT_cpbytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_settyp, OPT_set32typ, OPT_set64typ, OPT_realtyp, OPT_lrltyp, OPT_stringtyp, OPT_adrtyp, OPT_sysptrtyp; import OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj, OPT_setobj; -import int8 OPT_nofGmod; +import INT8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; import BOOLEAN OPT_SYSimported; -import address *OPT_ConstDesc__typ; -import address *OPT_ObjDesc__typ; -import address *OPT_StrDesc__typ; -import address *OPT_NodeDesc__typ; +import ADDRESS *OPT_ConstDesc__typ; +import ADDRESS *OPT_ObjDesc__typ; +import ADDRESS *OPT_StrDesc__typ; +import ADDRESS *OPT_NodeDesc__typ; -import void OPT_Align (int32 *adr, int32 base); -import int32 OPT_BaseAlignment (OPT_Struct typ); +import void OPT_Align (INT32 *adr, INT32 base); +import INT32 OPT_BaseAlignment (OPT_Struct typ); import void OPT_Close (void); import void OPT_CloseScope (void); import void OPT_Export (BOOLEAN *ext, BOOLEAN *new); -import void OPT_FPrintErr (OPT_Object obj, int16 errcode); +import void OPT_FPrintErr (OPT_Object obj, INT16 errcode); import void OPT_FPrintObj (OPT_Object obj); import void OPT_FPrintStr (OPT_Struct typ); import void OPT_Find (OPT_Object *res); @@ -92,21 +92,21 @@ import void OPT_FindField (OPS_Name name, OPT_Struct typ, OPT_Object *res); import void OPT_FindImport (OPT_Object mod, OPT_Object *res); import void OPT_IdFPrint (OPT_Struct typ); import void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); -import void OPT_Init (OPS_Name name, uint32 opt); +import void OPT_Init (OPS_Name name, UINT32 opt); import void OPT_InitRecno (void); import void OPT_Insert (OPS_Name name, OPT_Object *obj); import void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); -import int16 OPT_IntSize (int64 n); -import OPT_Struct OPT_IntType (int32 size); +import INT16 OPT_IntSize (INT64 n); +import OPT_Struct OPT_IntType (INT32 size); import OPT_Const OPT_NewConst (void); import OPT_ConstExt OPT_NewExt (void); -import OPT_Node OPT_NewNode (int8 class); +import OPT_Node OPT_NewNode (INT8 class); import OPT_Object OPT_NewObj (void); -import OPT_Struct OPT_NewStr (int8 form, int8 comp); -import void OPT_OpenScope (int8 level, OPT_Object owner); -import OPT_Struct OPT_SetType (int32 size); -import OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir); -import int32 OPT_SizeAlignment (int32 size); +import OPT_Struct OPT_NewStr (INT8 form, INT8 comp); +import void OPT_OpenScope (INT8 level, OPT_Object owner); +import OPT_Struct OPT_SetType (INT32 size); +import OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INT16 dir); +import INT32 OPT_SizeAlignment (INT32 size); import void OPT_TypSize (OPT_Struct typ); import void *OPT__init(void); diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 452a1182..ee84e643 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "OPC.h" @@ -13,42 +13,42 @@ typedef struct OPV_ExitInfo { - int16 level, label; + INT16 level, label; } OPV_ExitInfo; -static int16 OPV_stamp; +static INT16 OPV_stamp; static OPV_ExitInfo OPV_exit; -static int16 OPV_nofExitLabels; +static INT16 OPV_nofExitLabels; -export address *OPV_ExitInfo__typ; +export ADDRESS *OPV_ExitInfo__typ; static void OPV_ActualPar (OPT_Node n, OPT_Object fp); export void OPV_AdrAndSize (OPT_Object topScope); static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc); -static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int16 prec); +static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INT16 prec); static void OPV_DefineTDescs (OPT_Node n); -static void OPV_Entier (OPT_Node n, int16 prec); +static void OPV_Entier (OPT_Node n, INT16 prec); static void OPV_GetTProcNum (OPT_Object obj); static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc); static BOOLEAN OPV_ImplicitReturn (OPT_Node n); -static void OPV_Index (OPT_Node n, OPT_Node d, int16 prec, int16 dim); +static void OPV_Index (OPT_Node n, OPT_Node d, INT16 prec, INT16 dim); export void OPV_Init (void); static void OPV_InitTDescs (OPT_Node n); -static void OPV_Len (OPT_Node n, int64 dim); +static void OPV_Len (OPT_Node n, INT64 dim); export void OPV_Module (OPT_Node prog); static void OPV_NewArr (OPT_Node d, OPT_Node x); -static void OPV_ParIntLiteral (int64 n, int32 size); -static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp); +static void OPV_ParIntLiteral (INT64 n, INT32 size); +static INT16 OPV_Precedence (INT16 class, INT16 subclass, INT16 form, INT16 comp); static BOOLEAN OPV_SideEffects (OPT_Node n); -static void OPV_SizeCast (OPT_Node n, int32 to); +static void OPV_SizeCast (OPT_Node n, INT32 to); static void OPV_Stamp (OPS_Name s); static OPT_Object OPV_SuperProc (OPT_Node n); static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported); static void OPV_TraverseRecord (OPT_Struct typ); static void OPV_TypeOf (OPT_Node n); -static void OPV_design (OPT_Node n, int16 prec); -static void OPV_expr (OPT_Node n, int16 prec); +static void OPV_design (OPT_Node n, INT16 prec); +static void OPV_expr (OPT_Node n, INT16 prec); static void OPV_stat (OPT_Node n, OPT_Object outerProc); @@ -60,7 +60,7 @@ void OPV_Init (void) static void OPV_GetTProcNum (OPT_Object obj) { - int32 oldPos; + INT32 oldPos; OPT_Struct typ = NIL; OPT_Object redef = NIL; oldPos = OPM_errpos; @@ -96,7 +96,7 @@ static void OPV_TraverseRecord (OPT_Struct typ) static void OPV_Stamp (OPS_Name s) { - int16 i, j, k; + INT16 i, j, k; CHAR n[10]; OPV_stamp += 1; i = 0; @@ -126,7 +126,7 @@ static void OPV_Stamp (OPS_Name s) static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported) { - int16 mode; + INT16 mode; OPT_Object scope = NIL; OPT_Struct typ = NIL; if (obj != NIL) { @@ -205,7 +205,7 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_sysptrtyp->strobj->linkadr = 2; } -static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp) +static INT16 OPV_Precedence (INT16 class, INT16 subclass, INT16 form, INT16 comp) { switch (class) { case 7: case 0: case 2: case 4: case 9: @@ -315,7 +315,7 @@ static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp __RETCHK; } -static void OPV_Len (OPT_Node n, int64 dim) +static void OPV_Len (OPT_Node n, INT64 dim) { while ((n->class == 4 && n->typ->comp == 3)) { dim += 1; @@ -341,7 +341,7 @@ static BOOLEAN OPV_SideEffects (OPT_Node n) __RETCHK; } -static void OPV_Entier (OPT_Node n, int16 prec) +static void OPV_Entier (OPT_Node n, INT16 prec) { if (__IN(n->typ->form, 0x60, 32)) { OPM_WriteString((CHAR*)"__ENTIER(", 10); @@ -352,7 +352,7 @@ static void OPV_Entier (OPT_Node n, int16 prec) } } -static void OPV_SizeCast (OPT_Node n, int32 to) +static void OPV_SizeCast (OPT_Node n, INT32 to) { if ((to < n->typ->size && __IN(2, OPM_Options, 32))) { OPM_WriteString((CHAR*)"__SHORT", 8); @@ -366,16 +366,16 @@ static void OPV_SizeCast (OPT_Node n, int32 to) OPM_Write(')'); } else { if ((n->typ->size != to && (n->typ->size > 4 || to != 4))) { - OPM_WriteString((CHAR*)"(int", 5); + OPM_WriteString((CHAR*)"(INT", 5); OPM_WriteInt(__ASHL(to, 3)); OPM_WriteString((CHAR*)")", 2); } } } -static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int16 prec) +static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INT16 prec) { - int16 from, to; + INT16 from, to; from = n->typ->form; to = newtype->form; if (to == 7) { @@ -432,7 +432,7 @@ static void OPV_TypeOf (OPT_Node n) } } -static void OPV_Index (OPT_Node n, OPT_Node d, int16 prec, int16 dim) +static void OPV_Index (OPT_Node n, OPT_Node d, INT16 prec, INT16 dim) { if (!__IN(0, OPM_Options, 32) || (n->right->class == 7 && (n->right->conval->intval == 0 || n->left->typ->comp != 3))) { OPV_expr(n->right, prec); @@ -449,18 +449,18 @@ static void OPV_Index (OPT_Node n, OPT_Node d, int16 prec, int16 dim) } } -static void OPV_design (OPT_Node n, int16 prec) +static void OPV_design (OPT_Node n, INT16 prec) { OPT_Object obj = NIL; OPT_Struct typ = NIL; - int16 class, designPrec, comp; + INT16 class, designPrec, comp; OPT_Node d = NIL, x = NIL; - int16 dims, i, _for__26; + INT16 dims, i, _for__26; comp = n->typ->comp; obj = n->obj; class = n->class; designPrec = OPV_Precedence(class, n->subcl, n->typ->form, comp); - if ((((((class == 0 && obj->mnolev > 0)) && (int16)obj->mnolev != OPM_level)) && prec == 10)) { + if ((((((class == 0 && obj->mnolev > 0)) && (INT16)obj->mnolev != OPM_level)) && prec == 10)) { designPrec = 9; } if (prec > designPrec) { @@ -559,7 +559,7 @@ static void OPV_design (OPT_Node n, int16 prec) if (__IN(3, OPM_Options, 32)) { if (typ->comp == 4) { OPM_WriteString((CHAR*)"__GUARDR(", 10); - if ((int16)obj->mnolev != OPM_level) { + if ((INT16)obj->mnolev != OPM_level) { OPM_WriteStringVar((void*)obj->scope->name, 256); OPM_WriteString((CHAR*)"__curr->", 9); OPC_Ident(obj); @@ -628,7 +628,7 @@ static void OPV_design (OPT_Node n, int16 prec) } } -static void OPV_ParIntLiteral (int64 n, int32 size) +static void OPV_ParIntLiteral (INT64 n, INT32 size) { OPM_WriteInt(n); } @@ -636,7 +636,7 @@ static void OPV_ParIntLiteral (int64 n, int32 size) static void OPV_ActualPar (OPT_Node n, OPT_Object fp) { OPT_Struct typ = NIL, aptyp = NIL; - int16 comp, form, mode, prec, dim; + INT16 comp, form, mode, prec, dim; OPM_Write('('); while (n != NIL) { typ = fp->typ; @@ -726,9 +726,9 @@ static OPT_Object OPV_SuperProc (OPT_Node n) return obj; } -static void OPV_expr (OPT_Node n, int16 prec) +static void OPV_expr (OPT_Node n, INT16 prec) { - int16 class, subclass, form, exprPrec; + INT16 class, subclass, form, exprPrec; OPT_Struct typ = NIL; OPT_Node l = NIL, r = NIL; OPT_Object proc = NIL; @@ -1050,7 +1050,7 @@ static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) OPT_Node if_ = NIL; OPT_Object obj = NIL; OPT_Struct typ = NIL; - int32 adr; + INT32 adr; if_ = n->left; while (if_ != NIL) { OPM_WriteString((CHAR*)"if ", 4); @@ -1100,8 +1100,8 @@ static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc) { OPT_Node switchCase = NIL, label = NIL; - int64 low, high; - int16 form, i; + INT64 low, high; + INT16 form, i; OPM_WriteString((CHAR*)"switch ", 8); OPV_expr(n->left, 12); OPM_Write(' '); @@ -1166,7 +1166,7 @@ static BOOLEAN OPV_ImplicitReturn (OPT_Node n) static void OPV_NewArr (OPT_Node d, OPT_Node x) { OPT_Struct typ = NIL, base = NIL; - int16 nofdim, nofdyn; + INT16 nofdim, nofdyn; typ = d->typ->BaseTyp; base = typ; nofdim = 0; diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index 2fa9186d..513d8dfa 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Out.c b/bootstrap/unix-88/Out.c index 0f0b9f79..04b1e484 100644 --- a/bootstrap/unix-88/Out.c +++ b/bootstrap/unix-88/Out.c @@ -1,37 +1,37 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "Platform.h" static CHAR Out_buf[128]; -static int16 Out_in; +static INT16 Out_in; export void Out_Char (CHAR ch); export void Out_Flush (void); -export void Out_Int (int64 x, int64 n); -static int32 Out_Length (CHAR *s, LONGINT s__len); +export void Out_Int (INT64 x, INT64 n); +static INT32 Out_Length (CHAR *s, LONGINT s__len); export void Out_Ln (void); -export void Out_LongReal (LONGREAL x, int16 n); +export void Out_LongReal (LONGREAL x, INT16 n); export void Out_Open (void); -export void Out_Real (REAL x, int16 n); -static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_); +export void Out_Real (REAL x, INT16 n); +static void Out_RealP (LONGREAL x, INT16 n, BOOLEAN long_); export void Out_String (CHAR *str, LONGINT str__len); -export LONGREAL Out_Ten (int16 e); -static void Out_digit (int64 n, CHAR *s, LONGINT s__len, int16 *i); -static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16 *i); +export LONGREAL Out_Ten (INT16 e); +static void Out_digit (INT64 n, CHAR *s, LONGINT s__len, INT16 *i); +static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, INT16 *i); #define Out_Entier64(x) (int64)(x) void Out_Flush (void) { - int16 error; + INT16 error; if (Out_in > 0) { error = Platform_Write(1, (address)Out_buf, Out_in); } @@ -54,9 +54,9 @@ void Out_Char (CHAR ch) } } -static int32 Out_Length (CHAR *s, LONGINT s__len) +static INT32 Out_Length (CHAR *s, LONGINT s__len) { - int32 l; + INT32 l; l = 0; while ((l < s__len && s[__X(l, s__len)] != 0x00)) { l += 1; @@ -66,8 +66,8 @@ static int32 Out_Length (CHAR *s, LONGINT s__len) void Out_String (CHAR *str, LONGINT str__len) { - int32 l; - int16 error; + INT32 l; + INT16 error; __DUP(str, str__len, CHAR); l = Out_Length((void*)str, str__len); if (Out_in + l > 128) { @@ -77,15 +77,15 @@ void Out_String (CHAR *str, LONGINT str__len) error = Platform_Write(1, (address)str, l); } else { __MOVE((address)str, (address)&Out_buf[__X(Out_in, 128)], l); - Out_in += (int16)l; + Out_in += (INT16)l; } __DEL(str); } -void Out_Int (int64 x, int64 n) +void Out_Int (INT64 x, INT64 n) { CHAR s[22]; - int16 i; + INT16 i; BOOLEAN negative; negative = x < 0; if (x == (-9223372036854775807-1)) { @@ -108,7 +108,7 @@ void Out_Int (int64 x, int64 n) s[__X(i, 22)] = '-'; i += 1; } - while (n > (int64)i) { + while (n > (INT64)i) { Out_Char(' '); n -= 1; } @@ -124,22 +124,22 @@ void Out_Ln (void) Out_Flush(); } -static void Out_digit (int64 n, CHAR *s, LONGINT s__len, int16 *i) +static void Out_digit (INT64 n, CHAR *s, LONGINT s__len, INT16 *i) { *i -= 1; s[__X(*i, s__len)] = (CHAR)(__MOD(n, 10) + 48); } -static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16 *i) +static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, INT16 *i) { - int16 j; - int32 l; + INT16 j; + INT32 l; __DUP(t, t__len, CHAR); l = Out_Length((void*)t, t__len); if (l > *i) { l = *i; } - *i -= (int16)l; + *i -= (INT16)l; j = 0; while (j < l) { s[__X(*i + j, s__len)] = t[__X(j, t__len)]; @@ -148,7 +148,7 @@ static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16 __DEL(t); } -LONGREAL Out_Ten (int16 e) +LONGREAL Out_Ten (INT16 e) { LONGREAL r, power; r = (LONGREAL)1; @@ -163,19 +163,19 @@ LONGREAL Out_Ten (int16 e) return r; } -static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_) +static void Out_RealP (LONGREAL x, INT16 n, BOOLEAN long_) { - int16 e; - int64 f; + INT16 e; + INT64 f; CHAR s[30]; - int16 i, el; + INT16 i, el; LONGREAL x0; BOOLEAN nn, en; - int64 m; - int16 d, dr; - e = (int16)__MASK(__ASHR((__VAL(int64, x)), 52), -2048); - f = __MASK((__VAL(int64, x)), -4503599627370496); - nn = (__VAL(int64, x) < 0 && !((e == 2047 && f != 0))); + INT64 m; + INT16 d, dr; + e = (INT16)__MASK(__ASHR((__VAL(INT64, x)), 52), -2048); + f = __MASK((__VAL(INT64, x)), -4503599627370496); + nn = (__VAL(INT64, x) < 0 && !((e == 2047 && f != 0))); if (nn) { n -= 1; } @@ -221,7 +221,7 @@ static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_) if (nn) { x = -x; } - e = (int16)__ASHR((e - 1023) * 77, 8); + e = (INT16)__ASHR((e - 1023) * 77, 8); if (e >= 0) { x = x / (LONGREAL)Out_Ten(e); } else { @@ -291,12 +291,12 @@ static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_) } } -void Out_Real (REAL x, int16 n) +void Out_Real (REAL x, INT16 n) { Out_RealP(x, n, 0); } -void Out_LongReal (LONGREAL x, int16 n) +void Out_LongReal (LONGREAL x, INT16 n) { Out_RealP(x, n, 1); } diff --git a/bootstrap/unix-88/Out.h b/bootstrap/unix-88/Out.h index fbaed75f..a685b291 100644 --- a/bootstrap/unix-88/Out.h +++ b/bootstrap/unix-88/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h @@ -10,13 +10,13 @@ import void Out_Char (CHAR ch); import void Out_Flush (void); -import void Out_Int (int64 x, int64 n); +import void Out_Int (INT64 x, INT64 n); import void Out_Ln (void); -import void Out_LongReal (LONGREAL x, int16 n); +import void Out_LongReal (LONGREAL x, INT16 n); import void Out_Open (void); -import void Out_Real (REAL x, int16 n); +import void Out_Real (REAL x, INT16 n); import void Out_String (CHAR *str, LONGINT str__len); -import LONGREAL Out_Ten (int16 e); +import LONGREAL Out_Ten (INT16 e); import void *Out__init(void); diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 22ecf90b..3e3c2992 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" @@ -14,92 +14,92 @@ typedef Platform_ArgPtr (*Platform_ArgVec)[1024]; typedef - int64 (*Platform_ArgVecPtr)[1]; + INT64 (*Platform_ArgVecPtr)[1]; typedef CHAR (*Platform_EnvPtr)[1024]; typedef struct Platform_FileIdentity { - int32 volume, index, mtime; + INT32 volume, index, mtime; } Platform_FileIdentity; typedef - void (*Platform_HaltProcedure)(int32); + void (*Platform_HaltProcedure)(INT32); typedef - void (*Platform_SignalHandler)(int32); + void (*Platform_SignalHandler)(INT32); export BOOLEAN Platform_LittleEndian; -export int64 Platform_MainStackFrame; -export int32 Platform_HaltCode; -export int16 Platform_PID; +export INT64 Platform_MainStackFrame; +export INT32 Platform_HaltCode; +export INT16 Platform_PID; export CHAR Platform_CWD[256]; -export int16 Platform_ArgCount; -export int64 Platform_ArgVector; +export INT16 Platform_ArgCount; +export INT64 Platform_ArgVector; static Platform_HaltProcedure Platform_HaltHandler; -static int32 Platform_TimeStart; -export int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; +static INT32 Platform_TimeStart; +export INT16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; export CHAR Platform_NL[3]; -export address *Platform_FileIdentity__typ; +export ADDRESS *Platform_FileIdentity__typ; -export BOOLEAN Platform_Absent (int16 e); -export int16 Platform_ArgPos (CHAR *s, LONGINT s__len); -export void Platform_AssertFail (int32 code); -export int16 Platform_Chdir (CHAR *n, LONGINT n__len); -export int16 Platform_Close (int32 h); -export BOOLEAN Platform_ConnectionFailed (int16 e); -export void Platform_Delay (int32 ms); -export BOOLEAN Platform_DifferentFilesystems (int16 e); -static void Platform_DisplayHaltCode (int32 code); -export int16 Platform_Error (void); -export void Platform_Exit (int16 code); -export void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len); -export void Platform_GetClock (int32 *t, int32 *d); +export BOOLEAN Platform_Absent (INT16 e); +export INT16 Platform_ArgPos (CHAR *s, LONGINT s__len); +export void Platform_AssertFail (INT32 code); +export INT16 Platform_Chdir (CHAR *n, LONGINT n__len); +export INT16 Platform_Close (INT32 h); +export BOOLEAN Platform_ConnectionFailed (INT16 e); +export void Platform_Delay (INT32 ms); +export BOOLEAN Platform_DifferentFilesystems (INT16 e); +static void Platform_DisplayHaltCode (INT32 code); +export INT16 Platform_Error (void); +export void Platform_Exit (INT16 code); +export void Platform_GetArg (INT16 n, CHAR *val, LONGINT val__len); +export void Platform_GetClock (INT32 *t, INT32 *d); export void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); -export void Platform_GetIntArg (int16 n, int32 *val); -export void Platform_GetTimeOfDay (int32 *sec, int32 *usec); -export void Platform_Halt (int32 code); -export int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ); -export int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); -export BOOLEAN Platform_Inaccessible (int16 e); -export void Platform_Init (int32 argc, int64 argvadr); -export BOOLEAN Platform_Interrupted (int16 e); -export void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); -export int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); -export BOOLEAN Platform_NoSuchDirectory (int16 e); -export int64 Platform_OSAllocate (int64 size); -export void Platform_OSFree (int64 address); -export int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); -export int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); -export int16 Platform_Read (int32 h, int64 p, int32 l, int32 *n); -export int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n); -export int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); +export void Platform_GetIntArg (INT16 n, INT32 *val); +export void Platform_GetTimeOfDay (INT32 *sec, INT32 *usec); +export void Platform_Halt (INT32 code); +export INT16 Platform_Identify (INT32 h, Platform_FileIdentity *identity, ADDRESS *identity__typ); +export INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ); +export BOOLEAN Platform_Inaccessible (INT16 e); +export void Platform_Init (INT32 argc, INT64 argvadr); +export BOOLEAN Platform_Interrupted (INT16 e); +export void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d); +export INT16 Platform_New (CHAR *n, LONGINT n__len, INT32 *h); +export BOOLEAN Platform_NoSuchDirectory (INT16 e); +export INT64 Platform_OSAllocate (INT64 size); +export void Platform_OSFree (INT64 address); +export INT16 Platform_OldRO (CHAR *n, LONGINT n__len, INT32 *h); +export INT16 Platform_OldRW (CHAR *n, LONGINT n__len, INT32 *h); +export INT16 Platform_Read (INT32 h, INT64 p, INT32 l, INT32 *n); +export INT16 Platform_ReadBuf (INT32 h, SYSTEM_BYTE *b, LONGINT b__len, INT32 *n); +export INT16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); export BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); export BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); -export int16 Platform_Seek (int32 h, int32 offset, int16 whence); +export INT16 Platform_Seek (INT32 h, INT32 offset, INT16 whence); export void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); export void Platform_SetHalt (Platform_HaltProcedure p); export void Platform_SetInterruptHandler (Platform_SignalHandler handler); -export void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Platform_FileIdentity source); +export void Platform_SetMTime (Platform_FileIdentity *target, ADDRESS *target__typ, Platform_FileIdentity source); export void Platform_SetQuitHandler (Platform_SignalHandler handler); -export int16 Platform_Size (int32 h, int32 *l); -export int16 Platform_Sync (int32 h); -export int16 Platform_System (CHAR *cmd, LONGINT cmd__len); +export INT16 Platform_Size (INT32 h, INT32 *l); +export INT16 Platform_Sync (INT32 h); +export INT16 Platform_System (CHAR *cmd, LONGINT cmd__len); static void Platform_TestLittleEndian (void); -export int32 Platform_Time (void); -export BOOLEAN Platform_TimedOut (int16 e); -export BOOLEAN Platform_TooManyFiles (int16 e); -export int16 Platform_Truncate (int32 h, int32 l); -export int16 Platform_Unlink (CHAR *n, LONGINT n__len); -export int16 Platform_Write (int32 h, int64 p, int32 l); -static void Platform_YMDHMStoClock (int32 ye, int32 mo, int32 da, int32 ho, int32 mi, int32 se, int32 *t, int32 *d); +export INT32 Platform_Time (void); +export BOOLEAN Platform_TimedOut (INT16 e); +export BOOLEAN Platform_TooManyFiles (INT16 e); +export INT16 Platform_Truncate (INT32 h, INT32 l); +export INT16 Platform_Unlink (CHAR *n, LONGINT n__len); +export INT16 Platform_Write (INT32 h, INT64 p, INT32 l); +static void Platform_YMDHMStoClock (INT32 ye, INT32 mo, INT32 da, INT32 ho, INT32 mi, INT32 se, INT32 *t, INT32 *d); static void Platform_errch (CHAR c); -static void Platform_errint (int32 l); +static void Platform_errint (INT32 l); static void Platform_errln (void); -static void Platform_errposint (int32 l); +static void Platform_errposint (INT32 l); export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); #include @@ -127,7 +127,7 @@ export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT #define Platform_EXDEV() EXDEV extern void Heap_InitHeap(); #define Platform_HeapInitHeap() Heap_InitHeap() -#define Platform_allocate(size) (address)((void*)malloc((size_t)size)) +#define Platform_allocate(size) (ADDRESS)((void*)malloc((size_t)size)) #define Platform_chdir(n, n__len) chdir((char*)n) #define Platform_closefile(fd) close(fd) #define Platform_err() errno @@ -147,13 +147,13 @@ extern void Heap_InitHeap(); #define Platform_opennew(n, n__len) open((char*)n, O_CREAT | O_TRUNC | O_RDWR, 0664) #define Platform_openro(n, n__len) open((char*)n, O_RDONLY) #define Platform_openrw(n, n__len) open((char*)n, O_RDWR) -#define Platform_readfile(fd, p, l) (LONGINT)read(fd, (void*)(address)(p), l) +#define Platform_readfile(fd, p, l) (LONGINT)read(fd, (void*)(ADDRESS)(p), l) #define Platform_rename(o, o__len, n, n__len) rename((char*)o, (char*)n) #define Platform_sectotm(s) struct tm *time = localtime((time_t*)&s) #define Platform_seekcur() SEEK_CUR #define Platform_seekend() SEEK_END #define Platform_seekset() SEEK_SET -#define Platform_sethandler(s, h) SystemSetHandler(s, (address)h) +#define Platform_sethandler(s, h) SystemSetHandler(s, (ADDRESS)h) #define Platform_stat(n, n__len) stat((char*)n, &s) #define Platform_statdev() (LONGINT)s.st_dev #define Platform_statino() (LONGINT)s.st_ino @@ -170,63 +170,63 @@ extern void Heap_InitHeap(); #define Platform_tvsec() tv.tv_sec #define Platform_tvusec() tv.tv_usec #define Platform_unlink(n, n__len) unlink((char*)n) -#define Platform_writefile(fd, p, l) write(fd, (void*)(address)(p), l) +#define Platform_writefile(fd, p, l) write(fd, (void*)(ADDRESS)(p), l) -BOOLEAN Platform_TooManyFiles (int16 e) +BOOLEAN Platform_TooManyFiles (INT16 e) { return e == Platform_EMFILE() || e == Platform_ENFILE(); } -BOOLEAN Platform_NoSuchDirectory (int16 e) +BOOLEAN Platform_NoSuchDirectory (INT16 e) { return e == Platform_ENOENT(); } -BOOLEAN Platform_DifferentFilesystems (int16 e) +BOOLEAN Platform_DifferentFilesystems (INT16 e) { return e == Platform_EXDEV(); } -BOOLEAN Platform_Inaccessible (int16 e) +BOOLEAN Platform_Inaccessible (INT16 e) { return (e == Platform_EACCES() || e == Platform_EROFS()) || e == Platform_EAGAIN(); } -BOOLEAN Platform_Absent (int16 e) +BOOLEAN Platform_Absent (INT16 e) { return e == Platform_ENOENT(); } -BOOLEAN Platform_TimedOut (int16 e) +BOOLEAN Platform_TimedOut (INT16 e) { return e == Platform_ETIMEDOUT(); } -BOOLEAN Platform_ConnectionFailed (int16 e) +BOOLEAN Platform_ConnectionFailed (INT16 e) { return ((e == Platform_ECONNREFUSED() || e == Platform_ECONNABORTED()) || e == Platform_ENETUNREACH()) || e == Platform_EHOSTUNREACH(); } -BOOLEAN Platform_Interrupted (int16 e) +BOOLEAN Platform_Interrupted (INT16 e) { return e == Platform_EINTR(); } -int64 Platform_OSAllocate (int64 size) +INT64 Platform_OSAllocate (INT64 size) { return Platform_allocate(size); } -void Platform_OSFree (int64 address) +void Platform_OSFree (INT64 address) { Platform_free(address); } -void Platform_Init (int32 argc, int64 argvadr) +void Platform_Init (INT32 argc, INT64 argvadr) { Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; - Platform_ArgCount = __VAL(int16, argc); + Platform_ArgCount = __VAL(INT16, argc); av = (Platform_ArgVecPtr)(address)argvadr; Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; @@ -254,7 +254,7 @@ void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len) __DEL(var); } -void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len) +void Platform_GetArg (INT16 n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { @@ -263,10 +263,10 @@ void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len) } } -void Platform_GetIntArg (int16 n, int32 *val) +void Platform_GetIntArg (INT16 n, INT32 *val) { CHAR s[64]; - int32 k, d, i; + INT32 k, d, i; s[0] = 0x00; Platform_GetArg(n, (void*)s, 64); i = 0; @@ -274,11 +274,11 @@ void Platform_GetIntArg (int16 n, int32 *val) i = 1; } k = 0; - d = (int16)s[__X(i, 64)] - 48; + d = (INT16)s[__X(i, 64)] - 48; while ((d >= 0 && d <= 9)) { k = k * 10 + d; i += 1; - d = (int16)s[__X(i, 64)] - 48; + d = (INT16)s[__X(i, 64)] - 48; } if (s[0] == '-') { k = -k; @@ -289,9 +289,9 @@ void Platform_GetIntArg (int16 n, int32 *val) } } -int16 Platform_ArgPos (CHAR *s, LONGINT s__len) +INT16 Platform_ArgPos (CHAR *s, LONGINT s__len) { - int16 i; + INT16 i; CHAR arg[256]; __DUP(s, s__len, CHAR); i = 0; @@ -319,57 +319,57 @@ void Platform_SetBadInstructionHandler (Platform_SignalHandler handler) Platform_sethandler(4, handler); } -static void Platform_YMDHMStoClock (int32 ye, int32 mo, int32 da, int32 ho, int32 mi, int32 se, int32 *t, int32 *d) +static void Platform_YMDHMStoClock (INT32 ye, INT32 mo, INT32 da, INT32 ho, INT32 mi, INT32 se, INT32 *t, INT32 *d) { *d = (__ASHL((int)__MOD(ye, 100), 9) + __ASHL(mo + 1, 5)) + da; *t = (__ASHL(ho, 12) + __ASHL(mi, 6)) + se; } -void Platform_GetClock (int32 *t, int32 *d) +void Platform_GetClock (INT32 *t, INT32 *d) { Platform_gettimeval(); Platform_sectotm(Platform_tvsec()); Platform_YMDHMStoClock(Platform_tmyear(), Platform_tmmon(), Platform_tmmday(), Platform_tmhour(), Platform_tmmin(), Platform_tmsec(), &*t, &*d); } -void Platform_GetTimeOfDay (int32 *sec, int32 *usec) +void Platform_GetTimeOfDay (INT32 *sec, INT32 *usec) { Platform_gettimeval(); *sec = Platform_tvsec(); *usec = Platform_tvusec(); } -int32 Platform_Time (void) +INT32 Platform_Time (void) { - int32 ms; + INT32 ms; Platform_gettimeval(); ms = (int)__DIVF(Platform_tvusec(), 1000) + Platform_tvsec() * 1000; return (int)__MOD(ms - Platform_TimeStart, 2147483647); } -void Platform_Delay (int32 ms) +void Platform_Delay (INT32 ms) { - int32 s, ns; + INT32 s, ns; s = __DIV(ms, 1000); ns = (int)__MOD(ms, 1000) * 1000000; Platform_nanosleep(s, ns); } -int16 Platform_System (CHAR *cmd, LONGINT cmd__len) +INT16 Platform_System (CHAR *cmd, LONGINT cmd__len) { __DUP(cmd, cmd__len, CHAR); __DEL(cmd); return Platform_system(cmd, cmd__len); } -int16 Platform_Error (void) +INT16 Platform_Error (void) { return Platform_err(); } -int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h) +INT16 Platform_OldRO (CHAR *n, LONGINT n__len, INT32 *h) { - int16 fd; + INT16 fd; fd = Platform_openro(n, n__len); if (fd < 0) { return Platform_err(); @@ -380,9 +380,9 @@ int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h) __RETCHK; } -int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h) +INT16 Platform_OldRW (CHAR *n, LONGINT n__len, INT32 *h) { - int16 fd; + INT16 fd; fd = Platform_openrw(n, n__len); if (fd < 0) { return Platform_err(); @@ -393,9 +393,9 @@ int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h) __RETCHK; } -int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h) +INT16 Platform_New (CHAR *n, LONGINT n__len, INT32 *h) { - int16 fd; + INT16 fd; fd = Platform_opennew(n, n__len); if (fd < 0) { return Platform_err(); @@ -406,7 +406,7 @@ int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h) __RETCHK; } -int16 Platform_Close (int32 h) +INT16 Platform_Close (INT32 h) { if (Platform_closefile(h) < 0) { return Platform_err(); @@ -416,7 +416,7 @@ int16 Platform_Close (int32 h) __RETCHK; } -int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ) +INT16 Platform_Identify (INT32 h, Platform_FileIdentity *identity, ADDRESS *identity__typ) { Platform_structstats(); if (Platform_fstat(h) < 0) { @@ -428,7 +428,7 @@ int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *iden return 0; } -int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ) +INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ) { __DUP(n, n__len, CHAR); Platform_structstats(); @@ -453,18 +453,18 @@ BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i return i1.mtime == i2.mtime; } -void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Platform_FileIdentity source) +void Platform_SetMTime (Platform_FileIdentity *target, ADDRESS *target__typ, Platform_FileIdentity source) { (*target).mtime = source.mtime; } -void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d) +void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d) { Platform_sectotm(i.mtime); Platform_YMDHMStoClock(Platform_tmyear(), Platform_tmmon(), Platform_tmmday(), Platform_tmhour(), Platform_tmmin(), Platform_tmsec(), &*t, &*d); } -int16 Platform_Size (int32 h, int32 *l) +INT16 Platform_Size (INT32 h, INT32 *l) { Platform_structstats(); if (Platform_fstat(h) < 0) { @@ -474,7 +474,7 @@ int16 Platform_Size (int32 h, int32 *l) return 0; } -int16 Platform_Read (int32 h, int64 p, int32 l, int32 *n) +INT16 Platform_Read (INT32 h, INT64 p, INT32 l, INT32 *n) { *n = Platform_readfile(h, p, l); if (*n < 0) { @@ -486,7 +486,7 @@ int16 Platform_Read (int32 h, int64 p, int32 l, int32 *n) __RETCHK; } -int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n) +INT16 Platform_ReadBuf (INT32 h, SYSTEM_BYTE *b, LONGINT b__len, INT32 *n) { *n = Platform_readfile(h, (address)b, b__len); if (*n < 0) { @@ -498,9 +498,9 @@ int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n) __RETCHK; } -int16 Platform_Write (int32 h, int64 p, int32 l) +INT16 Platform_Write (INT32 h, INT64 p, INT32 l) { - int64 written; + INT64 written; written = Platform_writefile(h, p, l); if (written < 0) { return Platform_err(); @@ -510,7 +510,7 @@ int16 Platform_Write (int32 h, int64 p, int32 l) __RETCHK; } -int16 Platform_Sync (int32 h) +INT16 Platform_Sync (INT32 h) { if (Platform_fsync(h) < 0) { return Platform_err(); @@ -520,7 +520,7 @@ int16 Platform_Sync (int32 h) __RETCHK; } -int16 Platform_Seek (int32 h, int32 offset, int16 whence) +INT16 Platform_Seek (INT32 h, INT32 offset, INT16 whence) { if (Platform_lseek(h, offset, whence) < 0) { return Platform_err(); @@ -530,7 +530,7 @@ int16 Platform_Seek (int32 h, int32 offset, int16 whence) __RETCHK; } -int16 Platform_Truncate (int32 h, int32 l) +INT16 Platform_Truncate (INT32 h, INT32 l) { if (Platform_ftruncate(h, l) < 0) { return Platform_err(); @@ -540,7 +540,7 @@ int16 Platform_Truncate (int32 h, int32 l) __RETCHK; } -int16 Platform_Unlink (CHAR *n, LONGINT n__len) +INT16 Platform_Unlink (CHAR *n, LONGINT n__len) { if (Platform_unlink(n, n__len) < 0) { return Platform_err(); @@ -550,9 +550,9 @@ int16 Platform_Unlink (CHAR *n, LONGINT n__len) __RETCHK; } -int16 Platform_Chdir (CHAR *n, LONGINT n__len) +INT16 Platform_Chdir (CHAR *n, LONGINT n__len) { - int16 r; + INT16 r; if ((Platform_chdir(n, n__len) >= 0 && Platform_getcwd((void*)Platform_CWD, 256) != NIL)) { return 0; } else { @@ -561,7 +561,7 @@ int16 Platform_Chdir (CHAR *n, LONGINT n__len) __RETCHK; } -int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) +INT16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) { if (Platform_rename(o, o__len, n, n__len) < 0) { return Platform_err(); @@ -571,7 +571,7 @@ int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) __RETCHK; } -void Platform_Exit (int16 code) +void Platform_Exit (INT16 code) { Platform_exit(code); } @@ -586,7 +586,7 @@ static void Platform_errln (void) Platform_errch(0x0a); } -static void Platform_errposint (int32 l) +static void Platform_errposint (INT32 l) { if (l > 10) { Platform_errposint(__DIV(l, 10)); @@ -594,7 +594,7 @@ static void Platform_errposint (int32 l) Platform_errch((CHAR)(48 + (int)__MOD(l, 10))); } -static void Platform_errint (int32 l) +static void Platform_errint (INT32 l) { if (l < 0) { Platform_errch('-'); @@ -603,7 +603,7 @@ static void Platform_errint (int32 l) Platform_errposint(l); } -static void Platform_DisplayHaltCode (int32 code) +static void Platform_DisplayHaltCode (INT32 code) { switch (code) { case -1: @@ -659,7 +659,7 @@ static void Platform_DisplayHaltCode (int32 code) } } -void Platform_Halt (int32 code) +void Platform_Halt (INT32 code) { Platform_HaltCode = code; if (Platform_HaltHandler != NIL) { @@ -672,10 +672,10 @@ void Platform_Halt (int32 code) Platform_DisplayHaltCode(code); } Platform_errln(); - Platform_exit(__VAL(int16, code)); + Platform_exit(__VAL(INT16, code)); } -void Platform_AssertFail (int32 code) +void Platform_AssertFail (INT32 code) { Platform_errstring((CHAR*)"Assertion failure.", 19); if (code != 0) { @@ -684,7 +684,7 @@ void Platform_AssertFail (int32 code) Platform_errstring((CHAR*)".", 2); } Platform_errln(); - Platform_exit(__VAL(int16, code)); + Platform_exit(__VAL(INT16, code)); } void Platform_SetHalt (Platform_HaltProcedure p) @@ -694,7 +694,7 @@ void Platform_SetHalt (Platform_HaltProcedure p) static void Platform_TestLittleEndian (void) { - int16 i; + INT16 i; i = 1; __GET((address)&i, Platform_LittleEndian, BOOLEAN); } diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index 4ed02d04..2da07523 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h @@ -7,77 +7,77 @@ typedef struct Platform_FileIdentity { - int32 _prvt0; + INT32 _prvt0; char _prvt1[8]; } Platform_FileIdentity; typedef - void (*Platform_HaltProcedure)(int32); + void (*Platform_HaltProcedure)(INT32); typedef - void (*Platform_SignalHandler)(int32); + void (*Platform_SignalHandler)(INT32); import BOOLEAN Platform_LittleEndian; -import int64 Platform_MainStackFrame; -import int32 Platform_HaltCode; -import int16 Platform_PID; +import INT64 Platform_MainStackFrame; +import INT32 Platform_HaltCode; +import INT16 Platform_PID; import CHAR Platform_CWD[256]; -import int16 Platform_ArgCount; -import int64 Platform_ArgVector; -import int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; +import INT16 Platform_ArgCount; +import INT64 Platform_ArgVector; +import INT16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; import CHAR Platform_NL[3]; -import address *Platform_FileIdentity__typ; +import ADDRESS *Platform_FileIdentity__typ; -import BOOLEAN Platform_Absent (int16 e); -import int16 Platform_ArgPos (CHAR *s, LONGINT s__len); -import void Platform_AssertFail (int32 code); -import int16 Platform_Chdir (CHAR *n, LONGINT n__len); -import int16 Platform_Close (int32 h); -import BOOLEAN Platform_ConnectionFailed (int16 e); -import void Platform_Delay (int32 ms); -import BOOLEAN Platform_DifferentFilesystems (int16 e); -import int16 Platform_Error (void); -import void Platform_Exit (int16 code); -import void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len); -import void Platform_GetClock (int32 *t, int32 *d); +import BOOLEAN Platform_Absent (INT16 e); +import INT16 Platform_ArgPos (CHAR *s, LONGINT s__len); +import void Platform_AssertFail (INT32 code); +import INT16 Platform_Chdir (CHAR *n, LONGINT n__len); +import INT16 Platform_Close (INT32 h); +import BOOLEAN Platform_ConnectionFailed (INT16 e); +import void Platform_Delay (INT32 ms); +import BOOLEAN Platform_DifferentFilesystems (INT16 e); +import INT16 Platform_Error (void); +import void Platform_Exit (INT16 code); +import void Platform_GetArg (INT16 n, CHAR *val, LONGINT val__len); +import void Platform_GetClock (INT32 *t, INT32 *d); import void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); -import void Platform_GetIntArg (int16 n, int32 *val); -import void Platform_GetTimeOfDay (int32 *sec, int32 *usec); -import void Platform_Halt (int32 code); -import int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ); -import int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); -import BOOLEAN Platform_Inaccessible (int16 e); -import void Platform_Init (int32 argc, int64 argvadr); -import BOOLEAN Platform_Interrupted (int16 e); -import void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); -import int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); -import BOOLEAN Platform_NoSuchDirectory (int16 e); -import int64 Platform_OSAllocate (int64 size); -import void Platform_OSFree (int64 address); -import int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); -import int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); -import int16 Platform_Read (int32 h, int64 p, int32 l, int32 *n); -import int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n); -import int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); +import void Platform_GetIntArg (INT16 n, INT32 *val); +import void Platform_GetTimeOfDay (INT32 *sec, INT32 *usec); +import void Platform_Halt (INT32 code); +import INT16 Platform_Identify (INT32 h, Platform_FileIdentity *identity, ADDRESS *identity__typ); +import INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ); +import BOOLEAN Platform_Inaccessible (INT16 e); +import void Platform_Init (INT32 argc, INT64 argvadr); +import BOOLEAN Platform_Interrupted (INT16 e); +import void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d); +import INT16 Platform_New (CHAR *n, LONGINT n__len, INT32 *h); +import BOOLEAN Platform_NoSuchDirectory (INT16 e); +import INT64 Platform_OSAllocate (INT64 size); +import void Platform_OSFree (INT64 address); +import INT16 Platform_OldRO (CHAR *n, LONGINT n__len, INT32 *h); +import INT16 Platform_OldRW (CHAR *n, LONGINT n__len, INT32 *h); +import INT16 Platform_Read (INT32 h, INT64 p, INT32 l, INT32 *n); +import INT16 Platform_ReadBuf (INT32 h, SYSTEM_BYTE *b, LONGINT b__len, INT32 *n); +import INT16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); import BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); import BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); -import int16 Platform_Seek (int32 h, int32 offset, int16 whence); +import INT16 Platform_Seek (INT32 h, INT32 offset, INT16 whence); import void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); import void Platform_SetHalt (Platform_HaltProcedure p); import void Platform_SetInterruptHandler (Platform_SignalHandler handler); -import void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Platform_FileIdentity source); +import void Platform_SetMTime (Platform_FileIdentity *target, ADDRESS *target__typ, Platform_FileIdentity source); import void Platform_SetQuitHandler (Platform_SignalHandler handler); -import int16 Platform_Size (int32 h, int32 *l); -import int16 Platform_Sync (int32 h); -import int16 Platform_System (CHAR *cmd, LONGINT cmd__len); -import int32 Platform_Time (void); -import BOOLEAN Platform_TimedOut (int16 e); -import BOOLEAN Platform_TooManyFiles (int16 e); -import int16 Platform_Truncate (int32 h, int32 l); -import int16 Platform_Unlink (CHAR *n, LONGINT n__len); -import int16 Platform_Write (int32 h, int64 p, int32 l); +import INT16 Platform_Size (INT32 h, INT32 *l); +import INT16 Platform_Sync (INT32 h); +import INT16 Platform_System (CHAR *cmd, LONGINT cmd__len); +import INT32 Platform_Time (void); +import BOOLEAN Platform_TimedOut (INT16 e); +import BOOLEAN Platform_TooManyFiles (INT16 e); +import INT16 Platform_Truncate (INT32 h, INT32 l); +import INT16 Platform_Unlink (CHAR *n, LONGINT n__len); +import INT16 Platform_Write (INT32 h, INT64 p, INT32 l); import BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); import void *Platform__init(void); diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 0aca5733..d6788751 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" @@ -11,19 +11,19 @@ static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LONGINT d__len); -export void Reals_Convert (REAL x, int16 n, CHAR *d, LONGINT d__len); +export void Reals_Convert (REAL x, INT16 n, CHAR *d, LONGINT d__len); export void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len); export void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len); -export void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len); -export int16 Reals_Expo (REAL x); -export int16 Reals_ExpoL (LONGREAL x); -export void Reals_SetExpo (REAL *x, int16 ex); -export REAL Reals_Ten (int16 e); -export LONGREAL Reals_TenL (int16 e); -static CHAR Reals_ToHex (int16 i); +export void Reals_ConvertL (LONGREAL x, INT16 n, CHAR *d, LONGINT d__len); +export INT16 Reals_Expo (REAL x); +export INT16 Reals_ExpoL (LONGREAL x); +export void Reals_SetExpo (REAL *x, INT16 ex); +export REAL Reals_Ten (INT16 e); +export LONGREAL Reals_TenL (INT16 e); +static CHAR Reals_ToHex (INT16 i); -REAL Reals_Ten (int16 e) +REAL Reals_Ten (INT16 e) { LONGREAL r, power; r = (LONGREAL)1; @@ -38,7 +38,7 @@ REAL Reals_Ten (int16 e) return r; } -LONGREAL Reals_TenL (int16 e) +LONGREAL Reals_TenL (INT16 e) { LONGREAL r, power; r = (LONGREAL)1; @@ -56,39 +56,39 @@ LONGREAL Reals_TenL (int16 e) __RETCHK; } -int16 Reals_Expo (REAL x) +INT16 Reals_Expo (REAL x) { - int16 i; - __GET((address)&x + 2, i, int16); + INT16 i; + __GET((address)&x + 2, i, INT16); return __MASK(__ASHR(i, 7), -256); } -void Reals_SetExpo (REAL *x, int16 ex) +void Reals_SetExpo (REAL *x, INT16 ex) { CHAR c; __GET((address)x + 3, c, CHAR); - __PUT((address)x + 3, (CHAR)(__ASHL(__ASHR((int16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __PUT((address)x + 3, (CHAR)(__ASHL(__ASHR((INT16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); __GET((address)x + 2, c, CHAR); - __PUT((address)x + 2, (CHAR)(__MASK((int16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); + __PUT((address)x + 2, (CHAR)(__MASK((INT16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } -int16 Reals_ExpoL (LONGREAL x) +INT16 Reals_ExpoL (LONGREAL x) { - int16 i; - __GET((address)&x + 6, i, int16); + INT16 i; + __GET((address)&x + 6, i, INT16); return __MASK(__ASHR(i, 4), -2048); } -void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len) +void Reals_ConvertL (LONGREAL x, INT16 n, CHAR *d, LONGINT d__len) { - int32 i, j, k; + INT32 i, j, k; if (x < (LONGREAL)0) { x = -x; } k = 0; if (n > 9) { - i = (int32)__ENTIER(x / (LONGREAL)(LONGREAL)1000000000); - j = (int32)__ENTIER(x - i * (LONGREAL)1000000000); + i = (INT32)__ENTIER(x / (LONGREAL)(LONGREAL)1000000000); + j = (INT32)__ENTIER(x - i * (LONGREAL)1000000000); if (j < 0) { j = 0; } @@ -98,7 +98,7 @@ void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len) k += 1; } } else { - i = (int32)__ENTIER(x); + i = (INT32)__ENTIER(x); } while (k < n) { d[__X(k, d__len)] = (CHAR)((int)__MOD(i, 10) + 48); @@ -107,12 +107,12 @@ void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len) } } -void Reals_Convert (REAL x, int16 n, CHAR *d, LONGINT d__len) +void Reals_Convert (REAL x, INT16 n, CHAR *d, LONGINT d__len) { Reals_ConvertL(x, n, (void*)d, d__len); } -static CHAR Reals_ToHex (int16 i) +static CHAR Reals_ToHex (INT16 i) { if (i < 10) { return (CHAR)(i + 48); @@ -124,15 +124,15 @@ static CHAR Reals_ToHex (int16 i) static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LONGINT d__len) { - int16 i; - int32 l; + INT16 i; + INT32 l; CHAR by; i = 0; l = b__len; while (i < l) { by = __VAL(CHAR, b[__X(i, b__len)]); - d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((int16)by, 4)); - d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((int16)by, -16)); + d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((INT16)by, 4)); + d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((INT16)by, -16)); i += 1; } } diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index 664fe2ec..07688e3c 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h @@ -8,15 +8,15 @@ -import void Reals_Convert (REAL x, int16 n, CHAR *d, LONGINT d__len); +import void Reals_Convert (REAL x, INT16 n, CHAR *d, LONGINT d__len); import void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len); import void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len); -import void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len); -import int16 Reals_Expo (REAL x); -import int16 Reals_ExpoL (LONGREAL x); -import void Reals_SetExpo (REAL *x, int16 ex); -import REAL Reals_Ten (int16 e); -import LONGREAL Reals_TenL (int16 e); +import void Reals_ConvertL (LONGREAL x, INT16 n, CHAR *d, LONGINT d__len); +import INT16 Reals_Expo (REAL x); +import INT16 Reals_ExpoL (LONGREAL x); +import void Reals_SetExpo (REAL *x, INT16 ex); +import REAL Reals_Ten (INT16 e); +import LONGREAL Reals_TenL (INT16 e); import void *Reals__init(void); diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index 104a0fb7..141a9976 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" @@ -12,18 +12,18 @@ export void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len); export void Strings_Cap (CHAR *s, LONGINT s__len); -export void Strings_Delete (CHAR *s, LONGINT s__len, int16 pos, int16 n); -export void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHAR *dest, LONGINT dest__len); -export void Strings_Insert (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len); -export int16 Strings_Length (CHAR *s, LONGINT s__len); +export void Strings_Delete (CHAR *s, LONGINT s__len, INT16 pos, INT16 n); +export void Strings_Extract (CHAR *source, LONGINT source__len, INT16 pos, INT16 n, CHAR *dest, LONGINT dest__len); +export void Strings_Insert (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len); +export INT16 Strings_Length (CHAR *s, LONGINT s__len); export BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len); -export int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int16 pos); -export void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len); +export INT16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, INT16 pos); +export void Strings_Replace (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len); -int16 Strings_Length (CHAR *s, LONGINT s__len) +INT16 Strings_Length (CHAR *s, LONGINT s__len) { - int32 i; + INT32 i; __DUP(s, s__len, CHAR); i = 0; while ((i < s__len && s[__X(i, s__len)] != 0x00)) { @@ -31,7 +31,7 @@ int16 Strings_Length (CHAR *s, LONGINT s__len) } if (i <= 32767) { __DEL(s); - return (int16)i; + return (INT16)i; } else { __DEL(s); return 32767; @@ -41,7 +41,7 @@ int16 Strings_Length (CHAR *s, LONGINT s__len) void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len) { - int16 n1, n2, i; + INT16 n1, n2, i; __DUP(extra, extra__len, CHAR); n1 = Strings_Length(dest, dest__len); n2 = Strings_Length(extra, extra__len); @@ -56,9 +56,9 @@ void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__ __DEL(extra); } -void Strings_Insert (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len) +void Strings_Insert (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len) { - int16 n1, n2, i; + INT16 n1, n2, i; __DUP(source, source__len, CHAR); n1 = Strings_Length(dest, dest__len); n2 = Strings_Length(source, source__len); @@ -87,9 +87,9 @@ void Strings_Insert (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, L __DEL(source); } -void Strings_Delete (CHAR *s, LONGINT s__len, int16 pos, int16 n) +void Strings_Delete (CHAR *s, LONGINT s__len, INT16 pos, INT16 n) { - int16 len, i; + INT16 len, i; len = Strings_Length(s, s__len); if (pos < 0) { pos = 0; @@ -110,7 +110,7 @@ void Strings_Delete (CHAR *s, LONGINT s__len, int16 pos, int16 n) } } -void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len) +void Strings_Replace (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len) { __DUP(source, source__len, CHAR); Strings_Delete((void*)dest, dest__len, pos, pos + Strings_Length(source, source__len)); @@ -118,12 +118,12 @@ void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, __DEL(source); } -void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHAR *dest, LONGINT dest__len) +void Strings_Extract (CHAR *source, LONGINT source__len, INT16 pos, INT16 n, CHAR *dest, LONGINT dest__len) { - int16 len, destLen, i; + INT16 len, destLen, i; __DUP(source, source__len, CHAR); len = Strings_Length(source, source__len); - destLen = (int16)dest__len - 1; + destLen = (INT16)dest__len - 1; if (pos < 0) { pos = 0; } @@ -143,9 +143,9 @@ void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHA __DEL(source); } -int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int16 pos) +INT16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, INT16 pos) { - int16 n1, n2, i, j; + INT16 n1, n2, i, j; __DUP(pattern, pattern__len, CHAR); __DUP(s, s__len, CHAR); n1 = Strings_Length(s, s__len); @@ -177,7 +177,7 @@ int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, void Strings_Cap (CHAR *s, LONGINT s__len) { - int16 i; + INT16 i; i = 0; while (s[__X(i, s__len)] != 0x00) { if (('a' <= s[__X(i, s__len)] && s[__X(i, s__len)] <= 'z')) { @@ -191,9 +191,9 @@ static struct Match__7 { struct Match__7 *lnk; } *Match__7_s; -static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, int16 n, int16 m); +static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, INT16 n, INT16 m); -static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, int16 n, int16 m) +static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, INT16 n, INT16 m) { while ((((n >= 0 && m >= 0)) && mask[__X(m, mask__len)] != '*')) { if (name[__X(n, name__len)] != mask[__X(m, mask__len)]) { diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index 24f35c02..4319e8c8 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h @@ -10,13 +10,13 @@ import void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len); import void Strings_Cap (CHAR *s, LONGINT s__len); -import void Strings_Delete (CHAR *s, LONGINT s__len, int16 pos, int16 n); -import void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHAR *dest, LONGINT dest__len); -import void Strings_Insert (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len); -import int16 Strings_Length (CHAR *s, LONGINT s__len); +import void Strings_Delete (CHAR *s, LONGINT s__len, INT16 pos, INT16 n); +import void Strings_Extract (CHAR *source, LONGINT source__len, INT16 pos, INT16 n, CHAR *dest, LONGINT dest__len); +import void Strings_Insert (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len); +import INT16 Strings_Length (CHAR *s, LONGINT s__len); import BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len); -import int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int16 pos); -import void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len); +import INT16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, INT16 pos); +import void Strings_Replace (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len); import void *Strings__init(void); diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index e84157d1..3b932ce7 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "Files.h" @@ -19,9 +19,9 @@ typedef typedef struct Texts_RunDesc { Texts_Run prev, next; - int32 len; + INT32 len; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; BOOLEAN ascii; } Texts_RunDesc; @@ -34,7 +34,7 @@ typedef } Texts_ElemMsg; typedef - void (*Texts_Handler)(Texts_Elem, Texts_ElemMsg*, address *); + void (*Texts_Handler)(Texts_Elem, Texts_ElemMsg*, ADDRESS *); typedef struct Texts_TextDesc *Texts_Text; @@ -42,26 +42,26 @@ typedef typedef struct Texts_ElemDesc { Texts_Run prev, next; - int32 len; + INT32 len; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; BOOLEAN ascii; - int32 W, H; + INT32 W, H; Texts_Handler handle; Texts_Text base; } Texts_ElemDesc; struct Texts__1 { /* Texts_ElemDesc */ Texts_Run prev, next; - int32 len; + INT32 len; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; BOOLEAN ascii; - int32 W, H; + INT32 W, H; Texts_Handler handle; Texts_Text base; Files_File file; - int32 org, span; + INT32 org, span; CHAR mod[32], proc[32]; }; @@ -70,7 +70,7 @@ typedef typedef struct Texts_BufDesc { - int32 len; + INT32 len; Texts_Run head; } Texts_BufDesc; @@ -84,8 +84,8 @@ typedef typedef struct Texts_FileMsg { /* Texts_ElemMsg */ - int16 id; - int32 pos; + INT16 id; + INT32 pos; Files_Rider r; } Texts_FileMsg; @@ -100,7 +100,7 @@ typedef } Texts_IdentifyMsg; typedef - void (*Texts_Notifier)(Texts_Text, int16, int32, int32); + void (*Texts_Notifier)(Texts_Text, INT16, INT32, INT32); typedef struct Texts_PieceDesc *Texts_Piece; @@ -108,57 +108,57 @@ typedef typedef struct Texts_PieceDesc { Texts_Run prev, next; - int32 len; + INT32 len; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; BOOLEAN ascii; Files_File file; - int32 org; + INT32 org; } Texts_PieceDesc; typedef struct Texts_Reader { BOOLEAN eot; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; Texts_Elem elem; Files_Rider rider; Texts_Run run; - int32 org, off; + INT32 org, off; } Texts_Reader; typedef struct Texts_Scanner { /* Texts_Reader */ BOOLEAN eot; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; Texts_Elem elem; Files_Rider rider; Texts_Run run; - int32 org, off; + INT32 org, off; CHAR nextCh; - int16 line, class; - int32 i; + INT16 line, class; + INT32 i; REAL x; LONGREAL y; CHAR c; - int8 len; + INT8 len; CHAR s[64]; } Texts_Scanner; typedef struct Texts_TextDesc { - int32 len; + INT32 len; Texts_Notifier notify; Texts_Run head, cache; - int32 corg; + INT32 corg; } Texts_TextDesc; typedef struct Texts_Writer { Texts_Buffer buf; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; Files_Rider rider; Files_File file; } Texts_Writer; @@ -168,68 +168,68 @@ export Texts_Elem Texts_new; static Texts_Buffer Texts_del; static Texts_FontsFont Texts_FontsDefault; -export address *Texts_FontDesc__typ; -export address *Texts_RunDesc__typ; -export address *Texts_PieceDesc__typ; -export address *Texts_ElemMsg__typ; -export address *Texts_ElemDesc__typ; -export address *Texts_FileMsg__typ; -export address *Texts_CopyMsg__typ; -export address *Texts_IdentifyMsg__typ; -export address *Texts_BufDesc__typ; -export address *Texts_TextDesc__typ; -export address *Texts_Reader__typ; -export address *Texts_Scanner__typ; -export address *Texts_Writer__typ; -export address *Texts__1__typ; +export ADDRESS *Texts_FontDesc__typ; +export ADDRESS *Texts_RunDesc__typ; +export ADDRESS *Texts_PieceDesc__typ; +export ADDRESS *Texts_ElemMsg__typ; +export ADDRESS *Texts_ElemDesc__typ; +export ADDRESS *Texts_FileMsg__typ; +export ADDRESS *Texts_CopyMsg__typ; +export ADDRESS *Texts_IdentifyMsg__typ; +export ADDRESS *Texts_BufDesc__typ; +export ADDRESS *Texts_TextDesc__typ; +export ADDRESS *Texts_Reader__typ; +export ADDRESS *Texts_Scanner__typ; +export ADDRESS *Texts_Writer__typ; +export ADDRESS *Texts__1__typ; export void Texts_Append (Texts_Text T, Texts_Buffer B); -export void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, uint32 sel, Texts_FontsFont fnt, int8 col, int8 voff); +export void Texts_ChangeLooks (Texts_Text T, INT32 beg, INT32 end, UINT32 sel, Texts_FontsFont fnt, INT8 col, INT8 voff); static Texts_Elem Texts_CloneElem (Texts_Elem e); static Texts_Piece Texts_ClonePiece (Texts_Piece p); export void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len); export void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); export void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); -export void Texts_Delete (Texts_Text T, int32 beg, int32 end); +export void Texts_Delete (Texts_Text T, INT32 beg, INT32 end); export Texts_Text Texts_ElemBase (Texts_Elem E); -export int32 Texts_ElemPos (Texts_Elem E); -static void Texts_Find (Texts_Text T, int32 *pos, Texts_Run *u, int32 *org, int32 *off); +export INT32 Texts_ElemPos (Texts_Elem E); +static void Texts_Find (Texts_Text T, INT32 *pos, Texts_Run *u, INT32 *org, INT32 *off); static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len); -static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, address *msg__typ); -export void Texts_Insert (Texts_Text T, int32 pos, Texts_Buffer B); -export void Texts_Load (Files_Rider *r, address *r__typ, Texts_Text T); -static void Texts_Load0 (Files_Rider *r, address *r__typ, Texts_Text T); +static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, ADDRESS *msg__typ); +export void Texts_Insert (Texts_Text T, INT32 pos, Texts_Buffer B); +export void Texts_Load (Files_Rider *r, ADDRESS *r__typ, Texts_Text T); +static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T); static void Texts_Merge (Texts_Text T, Texts_Run u, Texts_Run *v); export void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len); export void Texts_OpenBuf (Texts_Buffer B); -export void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int32 pos); -export void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int32 pos); -export void Texts_OpenWriter (Texts_Writer *W, address *W__typ); -export int32 Texts_Pos (Texts_Reader *R, address *R__typ); -export void Texts_Read (Texts_Reader *R, address *R__typ, CHAR *ch); -export void Texts_ReadElem (Texts_Reader *R, address *R__typ); -export void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ); +export void Texts_OpenReader (Texts_Reader *R, ADDRESS *R__typ, Texts_Text T, INT32 pos); +export void Texts_OpenScanner (Texts_Scanner *S, ADDRESS *S__typ, Texts_Text T, INT32 pos); +export void Texts_OpenWriter (Texts_Writer *W, ADDRESS *W__typ); +export INT32 Texts_Pos (Texts_Reader *R, ADDRESS *R__typ); +export void Texts_Read (Texts_Reader *R, ADDRESS *R__typ, CHAR *ch); +export void Texts_ReadElem (Texts_Reader *R, ADDRESS *R__typ); +export void Texts_ReadPrevElem (Texts_Reader *R, ADDRESS *R__typ); export void Texts_Recall (Texts_Buffer *B); -export void Texts_Save (Texts_Text T, int32 beg, int32 end, Texts_Buffer B); -export void Texts_Scan (Texts_Scanner *S, address *S__typ); -export void Texts_SetColor (Texts_Writer *W, address *W__typ, int8 col); -export void Texts_SetFont (Texts_Writer *W, address *W__typ, Texts_FontsFont fnt); -export void Texts_SetOffset (Texts_Writer *W, address *W__typ, int8 voff); +export void Texts_Save (Texts_Text T, INT32 beg, INT32 end, Texts_Buffer B); +export void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ); +export void Texts_SetColor (Texts_Writer *W, ADDRESS *W__typ, INT8 col); +export void Texts_SetFont (Texts_Writer *W, ADDRESS *W__typ, Texts_FontsFont fnt); +export void Texts_SetOffset (Texts_Writer *W, ADDRESS *W__typ, INT8 voff); static void Texts_Splice (Texts_Run un, Texts_Run v, Texts_Run w, Texts_Text base); -static void Texts_Split (int32 off, Texts_Run *u, Texts_Run *un); -export void Texts_Store (Files_Rider *r, address *r__typ, Texts_Text T); -export void Texts_Write (Texts_Writer *W, address *W__typ, CHAR ch); -export void Texts_WriteDate (Texts_Writer *W, address *W__typ, int32 t, int32 d); -export void Texts_WriteElem (Texts_Writer *W, address *W__typ, Texts_Elem e); -export void Texts_WriteHex (Texts_Writer *W, address *W__typ, int32 x); -export void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n); -export void Texts_WriteLn (Texts_Writer *W, address *W__typ); -export void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int16 n); -export void Texts_WriteLongRealHex (Texts_Writer *W, address *W__typ, LONGREAL x); -export void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int16 n); -export void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int16 n, int16 k); -export void Texts_WriteRealHex (Texts_Writer *W, address *W__typ, REAL x); -export void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGINT s__len); +static void Texts_Split (INT32 off, Texts_Run *u, Texts_Run *un); +export void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T); +export void Texts_Write (Texts_Writer *W, ADDRESS *W__typ, CHAR ch); +export void Texts_WriteDate (Texts_Writer *W, ADDRESS *W__typ, INT32 t, INT32 d); +export void Texts_WriteElem (Texts_Writer *W, ADDRESS *W__typ, Texts_Elem e); +export void Texts_WriteHex (Texts_Writer *W, ADDRESS *W__typ, INT32 x); +export void Texts_WriteInt (Texts_Writer *W, ADDRESS *W__typ, INT64 x, INT64 n); +export void Texts_WriteLn (Texts_Writer *W, ADDRESS *W__typ); +export void Texts_WriteLongReal (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x, INT16 n); +export void Texts_WriteLongRealHex (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x); +export void Texts_WriteReal (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n); +export void Texts_WriteRealFix (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n, INT16 k); +export void Texts_WriteRealHex (Texts_Writer *W, ADDRESS *W__typ, REAL x); +export void Texts_WriteString (Texts_Writer *W, ADDRESS *W__typ, CHAR *s, LONGINT s__len); static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len) @@ -240,10 +240,10 @@ static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len) return F; } -static void Texts_Find (Texts_Text T, int32 *pos, Texts_Run *u, int32 *org, int32 *off) +static void Texts_Find (Texts_Text T, INT32 *pos, Texts_Run *u, INT32 *org, INT32 *off) { Texts_Run v = NIL; - int32 m; + INT32 m; if (*pos >= T->len) { *pos = T->len; *u = T->head; @@ -273,7 +273,7 @@ static void Texts_Find (Texts_Text T, int32 *pos, Texts_Run *u, int32 *org, int3 } } -static void Texts_Split (int32 off, Texts_Run *u, Texts_Run *un) +static void Texts_Split (INT32 off, Texts_Run *u, Texts_Run *un) { Texts_Piece p = NIL, U = NIL; if (off == 0) { @@ -366,10 +366,10 @@ Texts_Text Texts_ElemBase (Texts_Elem E) return E->base; } -int32 Texts_ElemPos (Texts_Elem E) +INT32 Texts_ElemPos (Texts_Elem E) { Texts_Run u = NIL; - int32 pos; + INT32 pos; u = E->base->head->next; pos = 0; while (u != (void *) E) { @@ -379,11 +379,11 @@ int32 Texts_ElemPos (Texts_Elem E) return pos; } -static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, address *msg__typ) +static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, ADDRESS *msg__typ) { Texts_Alien e = NIL; Files_Rider r; - int32 i; + INT32 i; CHAR ch; if (__ISP(E, Texts__1, 2)) { if (__IS(msg__typ, Texts_CopyMsg, 1)) { @@ -459,10 +459,10 @@ void Texts_Recall (Texts_Buffer *B) Texts_del = NIL; } -void Texts_Save (Texts_Text T, int32 beg, int32 end, Texts_Buffer B) +void Texts_Save (Texts_Text T, INT32 beg, INT32 end, Texts_Buffer B) { Texts_Run u = NIL, v = NIL, w = NIL, wn = NIL; - int32 uo, ud, vo, vd; + INT32 uo, ud, vo, vd; Texts_Find(T, &beg, &u, &uo, &ud); Texts_Find(T, &end, &v, &vo, &vd); w = B->head->prev; @@ -493,11 +493,11 @@ void Texts_Save (Texts_Text T, int32 beg, int32 end, Texts_Buffer B) B->len += end - beg; } -void Texts_Insert (Texts_Text T, int32 pos, Texts_Buffer B) +void Texts_Insert (Texts_Text T, INT32 pos, Texts_Buffer B) { Texts_Run u = NIL, un = NIL, v = NIL; Texts_Piece p = NIL, q = NIL; - int32 uo, ud, len; + INT32 uo, ud, len; Texts_Find(T, &pos, &u, &uo, &ud); Texts_Split(ud, &u, &un); len = B->len; @@ -516,7 +516,7 @@ void Texts_Insert (Texts_Text T, int32 pos, Texts_Buffer B) void Texts_Append (Texts_Text T, Texts_Buffer B) { Texts_Run v = NIL; - int32 pos, len; + INT32 pos, len; pos = T->len; len = B->len; v = B->head->next; @@ -531,10 +531,10 @@ void Texts_Append (Texts_Text T, Texts_Buffer B) } } -void Texts_Delete (Texts_Text T, int32 beg, int32 end) +void Texts_Delete (Texts_Text T, INT32 beg, INT32 end) { Texts_Run c = NIL, u = NIL, un = NIL, v = NIL, vn = NIL; - int32 co, uo, ud, vo, vd; + INT32 co, uo, ud, vo, vd; Texts_Find(T, &beg, &u, &uo, &ud); Texts_Split(ud, &u, &un); c = T->cache; @@ -556,10 +556,10 @@ void Texts_Delete (Texts_Text T, int32 beg, int32 end) } } -void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, uint32 sel, Texts_FontsFont fnt, int8 col, int8 voff) +void Texts_ChangeLooks (Texts_Text T, INT32 beg, INT32 end, UINT32 sel, Texts_FontsFont fnt, INT8 col, INT8 voff) { Texts_Run c = NIL, u = NIL, un = NIL, v = NIL, vn = NIL; - int32 co, uo, ud, vo, vd; + INT32 co, uo, ud, vo, vd; Texts_Find(T, &beg, &u, &uo, &ud); Texts_Split(ud, &u, &un); c = T->cache; @@ -595,7 +595,7 @@ void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, uint32 sel, Texts_Fo } } -void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int32 pos) +void Texts_OpenReader (Texts_Reader *R, ADDRESS *R__typ, Texts_Text T, INT32 pos) { Texts_Run u = NIL; if (pos >= T->len) { @@ -609,10 +609,10 @@ void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int32 pos } } -void Texts_Read (Texts_Reader *R, address *R__typ, CHAR *ch) +void Texts_Read (Texts_Reader *R, ADDRESS *R__typ, CHAR *ch) { Texts_Run u = NIL; - int32 pos; + INT32 pos; CHAR nextch; u = (*R).run; (*R).fnt = u->fnt; @@ -654,7 +654,7 @@ void Texts_Read (Texts_Reader *R, address *R__typ, CHAR *ch) } } -void Texts_ReadElem (Texts_Reader *R, address *R__typ) +void Texts_ReadElem (Texts_Reader *R, ADDRESS *R__typ) { Texts_Run u = NIL, un = NIL; u = (*R).run; @@ -682,7 +682,7 @@ void Texts_ReadElem (Texts_Reader *R, address *R__typ) } } -void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ) +void Texts_ReadPrevElem (Texts_Reader *R, ADDRESS *R__typ) { Texts_Run u = NIL; u = (*R).run->prev; @@ -704,12 +704,12 @@ void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ) } } -int32 Texts_Pos (Texts_Reader *R, address *R__typ) +INT32 Texts_Pos (Texts_Reader *R, ADDRESS *R__typ) { return (*R).org + (*R).off; } -void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int32 pos) +void Texts_OpenScanner (Texts_Scanner *S, ADDRESS *S__typ, Texts_Text T, INT32 pos) { Texts_OpenReader((void*)&*S, S__typ, T, pos); (*S).line = 0; @@ -718,10 +718,10 @@ void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int32 p static struct Scan__31 { Texts_Scanner *S; - address *S__typ; + ADDRESS *S__typ; CHAR *ch; BOOLEAN *negE; - int16 *e; + INT16 *e; struct Scan__31 *lnk; } *Scan__31_s; @@ -740,18 +740,18 @@ static void ReadScaleFactor__32 (void) } } while (('0' <= *Scan__31_s->ch && *Scan__31_s->ch <= '9')) { - *Scan__31_s->e = (*Scan__31_s->e * 10 + (int16)*Scan__31_s->ch) - 48; + *Scan__31_s->e = (*Scan__31_s->e * 10 + (INT16)*Scan__31_s->ch) - 48; Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); } } -void Texts_Scan (Texts_Scanner *S, address *S__typ) +void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) { CHAR ch, term; BOOLEAN neg, negE, hex; - int8 i, j, h; - int16 e; - int32 k; + INT8 i, j, h; + INT16 e; + INT32 k; REAL x, f; LONGREAL y, g; CHAR d[32]; @@ -812,10 +812,10 @@ void Texts_Scan (Texts_Scanner *S, address *S__typ) if ('9' < ch) { if (('A' <= ch && ch <= 'F')) { hex = 1; - ch = (CHAR)((int16)ch - 7); + ch = (CHAR)((INT16)ch - 7); } else if (('a' <= ch && ch <= 'f')) { hex = 1; - ch = (CHAR)((int16)ch - 39); + ch = (CHAR)((INT16)ch - 39); } else { break; } @@ -827,13 +827,13 @@ void Texts_Scan (Texts_Scanner *S, address *S__typ) if (i - j > 8) { j = i - 8; } - k = (int16)d[__X(j, 32)] - 48; + k = (INT16)d[__X(j, 32)] - 48; j += 1; if ((i - j == 7 && k >= 8)) { k -= 16; } while (j < i) { - k = __ASHL(k, 4) + ((int16)d[__X(j, 32)] - 48); + k = __ASHL(k, 4) + ((INT16)d[__X(j, 32)] - 48); j += 1; } if (neg) { @@ -854,12 +854,12 @@ void Texts_Scan (Texts_Scanner *S, address *S__typ) y = (LONGREAL)0; g = (LONGREAL)1; do { - y = y * (LONGREAL)10 + ((int16)d[__X(j, 32)] - 48); + y = y * (LONGREAL)10 + ((INT16)d[__X(j, 32)] - 48); j += 1; } while (!(j == h)); while (j < i) { g = g / (LONGREAL)(LONGREAL)10; - y = ((int16)d[__X(j, 32)] - 48) * g + y; + y = ((INT16)d[__X(j, 32)] - 48) * g + y; j += 1; } ReadScaleFactor__32(); @@ -886,12 +886,12 @@ void Texts_Scan (Texts_Scanner *S, address *S__typ) x = (REAL)0; f = (REAL)1; do { - x = x * (REAL)10 + ((int16)d[__X(j, 32)] - 48); + x = x * (REAL)10 + ((INT16)d[__X(j, 32)] - 48); j += 1; } while (!(j == h)); while (j < i) { f = f / (REAL)(REAL)10; - x = ((int16)d[__X(j, 32)] - 48) * f + x; + x = ((INT16)d[__X(j, 32)] - 48) * f + x; j += 1; } if (ch == 'E') { @@ -923,7 +923,7 @@ void Texts_Scan (Texts_Scanner *S, address *S__typ) (*S).class = 3; k = 0; do { - k = k * 10 + ((int16)d[__X(j, 32)] - 48); + k = k * 10 + ((INT16)d[__X(j, 32)] - 48); j += 1; } while (!(j == i)); if (neg) { @@ -951,7 +951,7 @@ void Texts_Scan (Texts_Scanner *S, address *S__typ) Scan__31_s = _s.lnk; } -void Texts_OpenWriter (Texts_Writer *W, address *W__typ) +void Texts_OpenWriter (Texts_Writer *W, ADDRESS *W__typ) { __NEW((*W).buf, Texts_BufDesc); Texts_OpenBuf((*W).buf); @@ -962,22 +962,22 @@ void Texts_OpenWriter (Texts_Writer *W, address *W__typ) Files_Set(&(*W).rider, Files_Rider__typ, (*W).file, 0); } -void Texts_SetFont (Texts_Writer *W, address *W__typ, Texts_FontsFont fnt) +void Texts_SetFont (Texts_Writer *W, ADDRESS *W__typ, Texts_FontsFont fnt) { (*W).fnt = fnt; } -void Texts_SetColor (Texts_Writer *W, address *W__typ, int8 col) +void Texts_SetColor (Texts_Writer *W, ADDRESS *W__typ, INT8 col) { (*W).col = col; } -void Texts_SetOffset (Texts_Writer *W, address *W__typ, int8 voff) +void Texts_SetOffset (Texts_Writer *W, ADDRESS *W__typ, INT8 voff) { (*W).voff = voff; } -void Texts_Write (Texts_Writer *W, address *W__typ, CHAR ch) +void Texts_Write (Texts_Writer *W, ADDRESS *W__typ, CHAR ch) { Texts_Run u = NIL, un = NIL; Texts_Piece p = NIL; @@ -1003,7 +1003,7 @@ void Texts_Write (Texts_Writer *W, address *W__typ, CHAR ch) } } -void Texts_WriteElem (Texts_Writer *W, address *W__typ, Texts_Elem e) +void Texts_WriteElem (Texts_Writer *W, ADDRESS *W__typ, Texts_Elem e) { Texts_Run u = NIL, un = NIL; if (e->base != NIL) { @@ -1022,14 +1022,14 @@ void Texts_WriteElem (Texts_Writer *W, address *W__typ, Texts_Elem e) un->prev = (Texts_Run)e; } -void Texts_WriteLn (Texts_Writer *W, address *W__typ) +void Texts_WriteLn (Texts_Writer *W, ADDRESS *W__typ) { Texts_Write(&*W, W__typ, 0x0d); } -void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGINT s__len) +void Texts_WriteString (Texts_Writer *W, ADDRESS *W__typ, CHAR *s, LONGINT s__len) { - int16 i; + INT16 i; __DUP(s, s__len, CHAR); i = 0; while (s[__X(i, s__len)] >= ' ') { @@ -1039,10 +1039,10 @@ void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGINT s__le __DEL(s); } -void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n) +void Texts_WriteInt (Texts_Writer *W, ADDRESS *W__typ, INT64 x, INT64 n) { - int16 i; - int64 x0; + INT16 i; + INT64 x0; CHAR a[24]; i = 0; if (x < 0) { @@ -1061,7 +1061,7 @@ void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n) x0 = __DIV(x0, 10); i += 1; } while (!(x0 == 0)); - while (n > (int64)i) { + while (n > (INT64)i) { Texts_Write(&*W, W__typ, ' '); n -= 1; } @@ -1074,10 +1074,10 @@ void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n) } while (!(i == 0)); } -void Texts_WriteHex (Texts_Writer *W, address *W__typ, int32 x) +void Texts_WriteHex (Texts_Writer *W, ADDRESS *W__typ, INT32 x) { - int16 i; - int32 y; + INT16 i; + INT32 y; CHAR a[20]; i = 0; Texts_Write(&*W, W__typ, ' '); @@ -1097,9 +1097,9 @@ void Texts_WriteHex (Texts_Writer *W, address *W__typ, int32 x) } while (!(i == 0)); } -void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int16 n) +void Texts_WriteReal (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n) { - int16 e; + INT16 e; REAL x0; CHAR d[9]; e = Reals_Expo(x); @@ -1169,16 +1169,16 @@ void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int16 n) static struct WriteRealFix__53 { Texts_Writer *W; - address *W__typ; - int16 *i; + ADDRESS *W__typ; + INT16 *i; CHAR (*d)[9]; struct WriteRealFix__53 *lnk; } *WriteRealFix__53_s; -static void dig__54 (int16 n); -static void seq__56 (CHAR ch, int16 n); +static void dig__54 (INT16 n); +static void seq__56 (CHAR ch, INT16 n); -static void seq__56 (CHAR ch, int16 n) +static void seq__56 (CHAR ch, INT16 n) { while (n > 0) { Texts_Write(&*WriteRealFix__53_s->W, WriteRealFix__53_s->W__typ, ch); @@ -1186,7 +1186,7 @@ static void seq__56 (CHAR ch, int16 n) } } -static void dig__54 (int16 n) +static void dig__54 (INT16 n) { while (n > 0) { *WriteRealFix__53_s->i -= 1; @@ -1195,9 +1195,9 @@ static void dig__54 (int16 n) } } -void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int16 n, int16 k) +void Texts_WriteRealFix (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n, INT16 k) { - int16 e, i; + INT16 e, i; CHAR sign; REAL x0; CHAR d[9]; @@ -1267,9 +1267,9 @@ void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int16 n, int1 WriteRealFix__53_s = _s.lnk; } -void Texts_WriteRealHex (Texts_Writer *W, address *W__typ, REAL x) +void Texts_WriteRealHex (Texts_Writer *W, ADDRESS *W__typ, REAL x) { - int16 i; + INT16 i; CHAR d[8]; Reals_ConvertH(x, (void*)d, 8); i = 0; @@ -1279,9 +1279,9 @@ void Texts_WriteRealHex (Texts_Writer *W, address *W__typ, REAL x) } while (!(i == 8)); } -void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int16 n) +void Texts_WriteLongReal (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x, INT16 n) { - int16 e; + INT16 e; LONGREAL x0; CHAR d[16]; e = Reals_ExpoL(x); @@ -1313,7 +1313,7 @@ void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int16 n) } else { Texts_Write(&*W, W__typ, ' '); } - e = (int16)__ASHR((e - 1023) * 77, 8); + e = (INT16)__ASHR((e - 1023) * 77, 8); if (e >= 0) { x = x / (LONGREAL)Reals_TenL(e); } else { @@ -1351,9 +1351,9 @@ void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int16 n) } } -void Texts_WriteLongRealHex (Texts_Writer *W, address *W__typ, LONGREAL x) +void Texts_WriteLongRealHex (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x) { - int16 i; + INT16 i; CHAR d[16]; Reals_ConvertHL(x, (void*)d, 16); i = 0; @@ -1365,20 +1365,20 @@ void Texts_WriteLongRealHex (Texts_Writer *W, address *W__typ, LONGREAL x) static struct WriteDate__43 { Texts_Writer *W; - address *W__typ; + ADDRESS *W__typ; struct WriteDate__43 *lnk; } *WriteDate__43_s; -static void WritePair__44 (CHAR ch, int32 x); +static void WritePair__44 (CHAR ch, INT32 x); -static void WritePair__44 (CHAR ch, int32 x) +static void WritePair__44 (CHAR ch, INT32 x) { Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, ch); Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)(__DIV(x, 10) + 48)); Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)((int)__MOD(x, 10) + 48)); } -void Texts_WriteDate (Texts_Writer *W, address *W__typ, int32 t, int32 d) +void Texts_WriteDate (Texts_Writer *W, ADDRESS *W__typ, INT32 t, INT32 d) { struct WriteDate__43 _s; _s.W = W; _s.W__typ = W__typ; @@ -1395,22 +1395,22 @@ void Texts_WriteDate (Texts_Writer *W, address *W__typ, int32 t, int32 d) static struct Load0__16 { Texts_Text *T; - int8 *ecnt; + INT8 *ecnt; Files_File *f; Texts_FileMsg *msg; CHAR (*mods)[64][32], (*procs)[64][32]; struct Load0__16 *lnk; } *Load0__16_s; -static void LoadElem__17 (Files_Rider *r, address *r__typ, int32 pos, int32 span, Texts_Elem *e); +static void LoadElem__17 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e); -static void LoadElem__17 (Files_Rider *r, address *r__typ, int32 pos, int32 span, Texts_Elem *e) +static void LoadElem__17 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e) { Modules_Module M = NIL; Modules_Command Cmd; Texts_Alien a = NIL; - int32 org, ew, eh; - int8 eno; + INT32 org, ew, eh; + INT8 eno; Texts_new = NIL; Files_ReadLInt(&*r, r__typ, &ew); Files_ReadLInt(&*r, r__typ, &eh); @@ -1455,13 +1455,13 @@ static void LoadElem__17 (Files_Rider *r, address *r__typ, int32 pos, int32 span } } -static void Texts_Load0 (Files_Rider *r, address *r__typ, Texts_Text T) +static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) { Texts_Run u = NIL, un = NIL; Texts_Piece p = NIL; Texts_Elem e = NIL; - int32 org, pos, hlen, plen; - int8 ecnt, fcnt, fno, col, voff; + INT32 org, pos, hlen, plen; + INT8 ecnt, fcnt, fno, col, voff; Files_File f = NIL; Texts_FileMsg msg; CHAR mods[64][32], procs[64][32]; @@ -1529,9 +1529,9 @@ static void Texts_Load0 (Files_Rider *r, address *r__typ, Texts_Text T) Load0__16_s = _s.lnk; } -void Texts_Load (Files_Rider *r, address *r__typ, Texts_Text T) +void Texts_Load (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) { - int16 tag; + INT16 tag; Files_ReadInt(&*r, r__typ, &tag); if (tag != -4095) { Files_Set(&*r, r__typ, Files_Base(&*r, r__typ), Files_Pos(&*r, r__typ) - 2); @@ -1546,7 +1546,7 @@ void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len) Texts_Run u = NIL; Texts_Piece p = NIL; CHAR tag, version; - int32 hlen; + INT32 hlen; __DUP(name, name__len, CHAR); f = Files_Old(name, name__len); if (f == NIL) { @@ -1596,20 +1596,20 @@ void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len) } static struct Store__39 { - int8 *ecnt; + INT8 *ecnt; Texts_FileMsg *msg; Texts_IdentifyMsg *iden; CHAR (*mods)[64][32], (*procs)[64][32]; struct Store__39 *lnk; } *Store__39_s; -static void StoreElem__40 (Files_Rider *r, address *r__typ, int32 pos, Texts_Elem e); +static void StoreElem__40 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e); -static void StoreElem__40 (Files_Rider *r, address *r__typ, int32 pos, Texts_Elem e) +static void StoreElem__40 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e) { Files_Rider r1; - int32 org, span; - int8 eno; + INT32 org, span; + INT8 eno; __COPY((*Store__39_s->iden).mod, (*Store__39_s->mods)[__X(*Store__39_s->ecnt, 64)], 32); __COPY((*Store__39_s->iden).proc, (*Store__39_s->procs)[__X(*Store__39_s->ecnt, 64)], 32); eno = 1; @@ -1635,15 +1635,15 @@ static void StoreElem__40 (Files_Rider *r, address *r__typ, int32 pos, Texts_Ele Files_WriteLInt(&r1, Files_Rider__typ, e->H); } -void Texts_Store (Files_Rider *r, address *r__typ, Texts_Text T) +void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) { Files_Rider r1; Texts_Run u = NIL, un = NIL; Texts_Elem e = NIL; - int32 org, pos, delta, hlen, rlen; - int8 ecnt, fcnt; + INT32 org, pos, delta, hlen, rlen; + INT8 ecnt, fcnt; CHAR ch; - int8 fno; + INT8 fno; Texts_FileMsg msg; Texts_IdentifyMsg iden; CHAR mods[64][32], procs[64][32]; @@ -1759,7 +1759,7 @@ void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len) { Files_File f = NIL; Files_Rider r; - int16 i, res; + INT16 i, res; CHAR bak[64]; __DUP(name, name__len, CHAR); f = Files_New(name, name__len); diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index 1d663861..bff9cc72 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h @@ -8,8 +8,8 @@ typedef struct Texts_BufDesc { - int32 len; - int64 _prvt0; + INT32 len; + INT64 _prvt0; } Texts_BufDesc; typedef @@ -30,26 +30,26 @@ typedef typedef struct Texts_RunDesc { - int64 _prvt0; + INT64 _prvt0; char _prvt1[27]; } Texts_RunDesc; typedef - void (*Texts_Handler)(Texts_Elem, Texts_ElemMsg*, address *); + void (*Texts_Handler)(Texts_Elem, Texts_ElemMsg*, ADDRESS *); typedef struct Texts_ElemDesc { - int64 _prvt0; + INT64 _prvt0; char _prvt1[28]; - int32 W, H; + INT32 W, H; Texts_Handler handle; char _prvt2[8]; } Texts_ElemDesc; typedef struct Texts_FileMsg { /* Texts_ElemMsg */ - int16 id; - int32 pos; + INT16 id; + INT32 pos; Files_Rider r; } Texts_FileMsg; @@ -70,13 +70,13 @@ typedef struct Texts_TextDesc *Texts_Text; typedef - void (*Texts_Notifier)(Texts_Text, int16, int32, int32); + void (*Texts_Notifier)(Texts_Text, INT16, INT32, INT32); typedef struct Texts_Reader { BOOLEAN eot; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; Texts_Elem elem; char _prvt0[40]; } Texts_Reader; @@ -85,22 +85,22 @@ typedef struct Texts_Scanner { /* Texts_Reader */ BOOLEAN eot; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; Texts_Elem elem; char _prvt0[40]; CHAR nextCh; - int16 line, class; - int32 i; + INT16 line, class; + INT32 i; REAL x; LONGREAL y; CHAR c; - int8 len; + INT8 len; CHAR s[64]; } Texts_Scanner; typedef struct Texts_TextDesc { - int32 len; + INT32 len; Texts_Notifier notify; char _prvt0[20]; } Texts_TextDesc; @@ -109,64 +109,64 @@ typedef struct Texts_Writer { Texts_Buffer buf; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; char _prvt0[38]; } Texts_Writer; import Texts_Elem Texts_new; -import address *Texts_FontDesc__typ; -import address *Texts_RunDesc__typ; -import address *Texts_ElemMsg__typ; -import address *Texts_ElemDesc__typ; -import address *Texts_FileMsg__typ; -import address *Texts_CopyMsg__typ; -import address *Texts_IdentifyMsg__typ; -import address *Texts_BufDesc__typ; -import address *Texts_TextDesc__typ; -import address *Texts_Reader__typ; -import address *Texts_Scanner__typ; -import address *Texts_Writer__typ; +import ADDRESS *Texts_FontDesc__typ; +import ADDRESS *Texts_RunDesc__typ; +import ADDRESS *Texts_ElemMsg__typ; +import ADDRESS *Texts_ElemDesc__typ; +import ADDRESS *Texts_FileMsg__typ; +import ADDRESS *Texts_CopyMsg__typ; +import ADDRESS *Texts_IdentifyMsg__typ; +import ADDRESS *Texts_BufDesc__typ; +import ADDRESS *Texts_TextDesc__typ; +import ADDRESS *Texts_Reader__typ; +import ADDRESS *Texts_Scanner__typ; +import ADDRESS *Texts_Writer__typ; import void Texts_Append (Texts_Text T, Texts_Buffer B); -import void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, uint32 sel, Texts_FontsFont fnt, int8 col, int8 voff); +import void Texts_ChangeLooks (Texts_Text T, INT32 beg, INT32 end, UINT32 sel, Texts_FontsFont fnt, INT8 col, INT8 voff); import void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len); import void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); import void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); -import void Texts_Delete (Texts_Text T, int32 beg, int32 end); +import void Texts_Delete (Texts_Text T, INT32 beg, INT32 end); import Texts_Text Texts_ElemBase (Texts_Elem E); -import int32 Texts_ElemPos (Texts_Elem E); -import void Texts_Insert (Texts_Text T, int32 pos, Texts_Buffer B); -import void Texts_Load (Files_Rider *r, address *r__typ, Texts_Text T); +import INT32 Texts_ElemPos (Texts_Elem E); +import void Texts_Insert (Texts_Text T, INT32 pos, Texts_Buffer B); +import void Texts_Load (Files_Rider *r, ADDRESS *r__typ, Texts_Text T); import void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len); import void Texts_OpenBuf (Texts_Buffer B); -import void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int32 pos); -import void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int32 pos); -import void Texts_OpenWriter (Texts_Writer *W, address *W__typ); -import int32 Texts_Pos (Texts_Reader *R, address *R__typ); -import void Texts_Read (Texts_Reader *R, address *R__typ, CHAR *ch); -import void Texts_ReadElem (Texts_Reader *R, address *R__typ); -import void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ); +import void Texts_OpenReader (Texts_Reader *R, ADDRESS *R__typ, Texts_Text T, INT32 pos); +import void Texts_OpenScanner (Texts_Scanner *S, ADDRESS *S__typ, Texts_Text T, INT32 pos); +import void Texts_OpenWriter (Texts_Writer *W, ADDRESS *W__typ); +import INT32 Texts_Pos (Texts_Reader *R, ADDRESS *R__typ); +import void Texts_Read (Texts_Reader *R, ADDRESS *R__typ, CHAR *ch); +import void Texts_ReadElem (Texts_Reader *R, ADDRESS *R__typ); +import void Texts_ReadPrevElem (Texts_Reader *R, ADDRESS *R__typ); import void Texts_Recall (Texts_Buffer *B); -import void Texts_Save (Texts_Text T, int32 beg, int32 end, Texts_Buffer B); -import void Texts_Scan (Texts_Scanner *S, address *S__typ); -import void Texts_SetColor (Texts_Writer *W, address *W__typ, int8 col); -import void Texts_SetFont (Texts_Writer *W, address *W__typ, Texts_FontsFont fnt); -import void Texts_SetOffset (Texts_Writer *W, address *W__typ, int8 voff); -import void Texts_Store (Files_Rider *r, address *r__typ, Texts_Text T); -import void Texts_Write (Texts_Writer *W, address *W__typ, CHAR ch); -import void Texts_WriteDate (Texts_Writer *W, address *W__typ, int32 t, int32 d); -import void Texts_WriteElem (Texts_Writer *W, address *W__typ, Texts_Elem e); -import void Texts_WriteHex (Texts_Writer *W, address *W__typ, int32 x); -import void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n); -import void Texts_WriteLn (Texts_Writer *W, address *W__typ); -import void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int16 n); -import void Texts_WriteLongRealHex (Texts_Writer *W, address *W__typ, LONGREAL x); -import void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int16 n); -import void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int16 n, int16 k); -import void Texts_WriteRealHex (Texts_Writer *W, address *W__typ, REAL x); -import void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGINT s__len); +import void Texts_Save (Texts_Text T, INT32 beg, INT32 end, Texts_Buffer B); +import void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ); +import void Texts_SetColor (Texts_Writer *W, ADDRESS *W__typ, INT8 col); +import void Texts_SetFont (Texts_Writer *W, ADDRESS *W__typ, Texts_FontsFont fnt); +import void Texts_SetOffset (Texts_Writer *W, ADDRESS *W__typ, INT8 voff); +import void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T); +import void Texts_Write (Texts_Writer *W, ADDRESS *W__typ, CHAR ch); +import void Texts_WriteDate (Texts_Writer *W, ADDRESS *W__typ, INT32 t, INT32 d); +import void Texts_WriteElem (Texts_Writer *W, ADDRESS *W__typ, Texts_Elem e); +import void Texts_WriteHex (Texts_Writer *W, ADDRESS *W__typ, INT32 x); +import void Texts_WriteInt (Texts_Writer *W, ADDRESS *W__typ, INT64 x, INT64 n); +import void Texts_WriteLn (Texts_Writer *W, ADDRESS *W__typ); +import void Texts_WriteLongReal (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x, INT16 n); +import void Texts_WriteLongRealHex (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x); +import void Texts_WriteReal (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n); +import void Texts_WriteRealFix (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n, INT16 k); +import void Texts_WriteRealHex (Texts_Writer *W, ADDRESS *W__typ, REAL x); +import void Texts_WriteString (Texts_Writer *W, ADDRESS *W__typ, CHAR *s, LONGINT s__len); import void *Texts__init(void); diff --git a/bootstrap/unix-88/VT100.c b/bootstrap/unix-88/VT100.c index c3a9491f..b5067d33 100644 --- a/bootstrap/unix-88/VT100.c +++ b/bootstrap/unix-88/VT100.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "Out.h" @@ -14,36 +14,36 @@ export CHAR VT100_CSI[5]; static CHAR VT100_tmpstr[32]; -export void VT100_CHA (int16 n); -export void VT100_CNL (int16 n); -export void VT100_CPL (int16 n); -export void VT100_CUB (int16 n); -export void VT100_CUD (int16 n); -export void VT100_CUF (int16 n); -export void VT100_CUP (int16 n, int16 m); -export void VT100_CUU (int16 n); +export void VT100_CHA (INT16 n); +export void VT100_CNL (INT16 n); +export void VT100_CPL (INT16 n); +export void VT100_CUB (INT16 n); +export void VT100_CUD (INT16 n); +export void VT100_CUF (INT16 n); +export void VT100_CUP (INT16 n, INT16 m); +export void VT100_CUU (INT16 n); export void VT100_DECTCEMh (void); export void VT100_DECTCEMl (void); -export void VT100_DSR (int16 n); -export void VT100_ED (int16 n); -export void VT100_EL (int16 n); -static void VT100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len); +export void VT100_DSR (INT16 n); +export void VT100_ED (INT16 n); +export void VT100_EL (INT16 n); +static void VT100_EscSeq (INT16 n, CHAR *letter, LONGINT letter__len); static void VT100_EscSeq0 (CHAR *letter, LONGINT letter__len); -static void VT100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len); -static void VT100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len); -export void VT100_HVP (int16 n, int16 m); -export void VT100_IntToStr (int32 int_, CHAR *str, LONGINT str__len); +static void VT100_EscSeq2 (INT16 n, INT16 m, CHAR *letter, LONGINT letter__len); +static void VT100_EscSeqSwapped (INT16 n, CHAR *letter, LONGINT letter__len); +export void VT100_HVP (INT16 n, INT16 m); +export void VT100_IntToStr (INT32 int_, CHAR *str, LONGINT str__len); export void VT100_RCP (void); -static void VT100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end); +static void VT100_Reverse0 (CHAR *str, LONGINT str__len, INT16 start, INT16 end); export void VT100_SCP (void); -export void VT100_SD (int16 n); -export void VT100_SGR (int16 n); -export void VT100_SGR2 (int16 n, int16 m); -export void VT100_SU (int16 n); +export void VT100_SD (INT16 n); +export void VT100_SGR (INT16 n); +export void VT100_SGR2 (INT16 n, INT16 m); +export void VT100_SU (INT16 n); export void VT100_SetAttr (CHAR *attr, LONGINT attr__len); -static void VT100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end) +static void VT100_Reverse0 (CHAR *str, LONGINT str__len, INT16 start, INT16 end) { CHAR h; while (start < end) { @@ -55,11 +55,11 @@ static void VT100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end) } } -void VT100_IntToStr (int32 int_, CHAR *str, LONGINT str__len) +void VT100_IntToStr (INT32 int_, CHAR *str, LONGINT str__len) { CHAR b[21]; - int16 s, e; - int8 maxLength; + INT16 s, e; + INT8 maxLength; maxLength = 11; if (int_ == (-2147483647-1)) { __MOVE("-2147483648", b, 12); @@ -94,7 +94,7 @@ static void VT100_EscSeq0 (CHAR *letter, LONGINT letter__len) __DEL(letter); } -static void VT100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len) +static void VT100_EscSeq (INT16 n, CHAR *letter, LONGINT letter__len) { CHAR nstr[2]; CHAR cmd[7]; @@ -107,7 +107,7 @@ static void VT100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len) __DEL(letter); } -static void VT100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len) +static void VT100_EscSeqSwapped (INT16 n, CHAR *letter, LONGINT letter__len) { CHAR nstr[2]; CHAR cmd[7]; @@ -120,7 +120,7 @@ static void VT100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len) __DEL(letter); } -static void VT100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len) +static void VT100_EscSeq2 (INT16 n, INT16 m, CHAR *letter, LONGINT letter__len) { CHAR nstr[5], mstr[5]; CHAR cmd[12]; @@ -136,82 +136,82 @@ static void VT100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len) __DEL(letter); } -void VT100_CUU (int16 n) +void VT100_CUU (INT16 n) { VT100_EscSeq(n, (CHAR*)"A", 2); } -void VT100_CUD (int16 n) +void VT100_CUD (INT16 n) { VT100_EscSeq(n, (CHAR*)"B", 2); } -void VT100_CUF (int16 n) +void VT100_CUF (INT16 n) { VT100_EscSeq(n, (CHAR*)"C", 2); } -void VT100_CUB (int16 n) +void VT100_CUB (INT16 n) { VT100_EscSeq(n, (CHAR*)"D", 2); } -void VT100_CNL (int16 n) +void VT100_CNL (INT16 n) { VT100_EscSeq(n, (CHAR*)"E", 2); } -void VT100_CPL (int16 n) +void VT100_CPL (INT16 n) { VT100_EscSeq(n, (CHAR*)"F", 2); } -void VT100_CHA (int16 n) +void VT100_CHA (INT16 n) { VT100_EscSeq(n, (CHAR*)"G", 2); } -void VT100_CUP (int16 n, int16 m) +void VT100_CUP (INT16 n, INT16 m) { VT100_EscSeq2(n, m, (CHAR*)"H", 2); } -void VT100_ED (int16 n) +void VT100_ED (INT16 n) { VT100_EscSeq(n, (CHAR*)"J", 2); } -void VT100_EL (int16 n) +void VT100_EL (INT16 n) { VT100_EscSeq(n, (CHAR*)"K", 2); } -void VT100_SU (int16 n) +void VT100_SU (INT16 n) { VT100_EscSeq(n, (CHAR*)"S", 2); } -void VT100_SD (int16 n) +void VT100_SD (INT16 n) { VT100_EscSeq(n, (CHAR*)"T", 2); } -void VT100_HVP (int16 n, int16 m) +void VT100_HVP (INT16 n, INT16 m) { VT100_EscSeq2(n, m, (CHAR*)"f", 2); } -void VT100_SGR (int16 n) +void VT100_SGR (INT16 n) { VT100_EscSeq(n, (CHAR*)"m", 2); } -void VT100_SGR2 (int16 n, int16 m) +void VT100_SGR2 (INT16 n, INT16 m) { VT100_EscSeq2(n, m, (CHAR*)"m", 2); } -void VT100_DSR (int16 n) +void VT100_DSR (INT16 n) { VT100_EscSeq(6, (CHAR*)"n", 2); } diff --git a/bootstrap/unix-88/VT100.h b/bootstrap/unix-88/VT100.h index ee0408bb..d9aa6ab7 100644 --- a/bootstrap/unix-88/VT100.h +++ b/bootstrap/unix-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef VT100__h #define VT100__h @@ -9,27 +9,27 @@ import CHAR VT100_CSI[5]; -import void VT100_CHA (int16 n); -import void VT100_CNL (int16 n); -import void VT100_CPL (int16 n); -import void VT100_CUB (int16 n); -import void VT100_CUD (int16 n); -import void VT100_CUF (int16 n); -import void VT100_CUP (int16 n, int16 m); -import void VT100_CUU (int16 n); +import void VT100_CHA (INT16 n); +import void VT100_CNL (INT16 n); +import void VT100_CPL (INT16 n); +import void VT100_CUB (INT16 n); +import void VT100_CUD (INT16 n); +import void VT100_CUF (INT16 n); +import void VT100_CUP (INT16 n, INT16 m); +import void VT100_CUU (INT16 n); import void VT100_DECTCEMh (void); import void VT100_DECTCEMl (void); -import void VT100_DSR (int16 n); -import void VT100_ED (int16 n); -import void VT100_EL (int16 n); -import void VT100_HVP (int16 n, int16 m); -import void VT100_IntToStr (int32 int_, CHAR *str, LONGINT str__len); +import void VT100_DSR (INT16 n); +import void VT100_ED (INT16 n); +import void VT100_EL (INT16 n); +import void VT100_HVP (INT16 n, INT16 m); +import void VT100_IntToStr (INT32 int_, CHAR *str, LONGINT str__len); import void VT100_RCP (void); import void VT100_SCP (void); -import void VT100_SD (int16 n); -import void VT100_SGR (int16 n); -import void VT100_SGR2 (int16 n, int16 m); -import void VT100_SU (int16 n); +import void VT100_SD (INT16 n); +import void VT100_SGR (INT16 n); +import void VT100_SGR2 (INT16 n, INT16 m); +import void VT100_SU (INT16 n); import void VT100_SetAttr (CHAR *attr, LONGINT attr__len); import void *VT100__init(void); diff --git a/bootstrap/unix-88/errors.c b/bootstrap/unix-88/errors.c index cce1644f..2a1a7a02 100644 --- a/bootstrap/unix-88/errors.c +++ b/bootstrap/unix-88/errors.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" diff --git a/bootstrap/unix-88/errors.h b/bootstrap/unix-88/errors.h index 9d34f721..5555899e 100644 --- a/bootstrap/unix-88/errors.h +++ b/bootstrap/unix-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index d2dcce53..8ed00f14 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "Configuration.h" @@ -24,7 +24,7 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGINT cmd__len) { - int16 r, status, exitcode; + INT16 r, status, exitcode; __DUP(title, title__len, CHAR); __DUP(cmd, cmd__len, CHAR); if (__IN(18, OPM_Options, 32)) { diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index 2e262037..ad76f7b6 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/Compiler.c b/bootstrap/windows-48/Compiler.c index 759e721b..86c4c1fd 100644 --- a/bootstrap/windows-48/Compiler.c +++ b/bootstrap/windows-48/Compiler.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "Configuration.h" @@ -26,7 +26,7 @@ static CHAR Compiler_mname[256]; export void Compiler_Module (BOOLEAN *done); static void Compiler_PropagateElementaryTypeSizes (void); export void Compiler_Translate (void); -static void Compiler_Trap (int32 sig); +static void Compiler_Trap (INT32 sig); void Compiler_Module (BOOLEAN *done) @@ -147,7 +147,7 @@ void Compiler_Translate (void) } } -static void Compiler_Trap (int32 sig) +static void Compiler_Trap (INT32 sig) { Heap_FINALL(); if (sig == 3) { diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index 95ddb569..3f8c68d8 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index f6a548e4..6abf2414 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index acf98586..6a00f93e 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "Heap.h" @@ -18,7 +18,7 @@ typedef struct Files_BufDesc { Files_File f; BOOLEAN chg; - int32 org, size; + INT32 org, size; SYSTEM_BYTE data[4096]; } Files_BufDesc; @@ -33,85 +33,85 @@ typedef Files_FileName workName, registerName; BOOLEAN tempFile; Platform_FileIdentity identity; - int32 fd, len, pos; + INT32 fd, len, pos; Files_Buffer bufs[4]; - int16 swapper, state; + INT16 swapper, state; Files_File next; } Files_FileDesc; typedef struct Files_Rider { - int32 res; + INT32 res; BOOLEAN eof; Files_Buffer buf; - int32 org, offset; + INT32 org, offset; } Files_Rider; static Files_File Files_files; -static int16 Files_tempno; +static INT16 Files_tempno; static CHAR Files_HOME[1024]; static struct { LONGINT len[1]; CHAR data[1]; } *Files_SearchPath; -export address *Files_FileDesc__typ; -export address *Files_BufDesc__typ; -export address *Files_Rider__typ; +export ADDRESS *Files_FileDesc__typ; +export ADDRESS *Files_BufDesc__typ; +export ADDRESS *Files_Rider__typ; -export Files_File Files_Base (Files_Rider *r, address *r__typ); +export Files_File Files_Base (Files_Rider *r, ADDRESS *r__typ); static Files_File Files_CacheEntry (Platform_FileIdentity identity); -export void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int16 *res); +export void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INT16 *res); export void Files_Close (Files_File f); static void Files_CloseOSFile (Files_File f); static void Files_Create (Files_File f); -export void Files_Delete (CHAR *name, LONGINT name__len, int16 *res); -static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int16 errcode); +export void Files_Delete (CHAR *name, LONGINT name__len, INT16 *res); +static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INT16 errcode); static void Files_Finalize (SYSTEM_PTR o); static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *dest, LONGINT dest__len); static void Files_Flush (Files_Buffer buf); -export void Files_GetDate (Files_File f, int32 *t, int32 *d); +export void Files_GetDate (Files_File f, INT32 *t, INT32 *d); export void Files_GetName (Files_File f, CHAR *name, LONGINT name__len); static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *name, LONGINT name__len); static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len); -export int32 Files_Length (Files_File f); +export INT32 Files_Length (Files_File f); static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT name__len, CHAR *dest, LONGINT dest__len); export Files_File Files_New (CHAR *name, LONGINT name__len); export Files_File Files_Old (CHAR *name, LONGINT name__len); -export int32 Files_Pos (Files_Rider *r, address *r__typ); +export INT32 Files_Pos (Files_Rider *r, ADDRESS *r__typ); export void Files_Purge (Files_File f); -export void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x); -export void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x); -export void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); -export void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x); -export void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); -export void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); -export void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); -export void Files_ReadNum (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len); -export void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); -export void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x); -export void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); +export void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x); +export void Files_ReadBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN *x); +export void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n); +export void Files_ReadInt (Files_Rider *R, ADDRESS *R__typ, INT16 *x); +export void Files_ReadLInt (Files_Rider *R, ADDRESS *R__typ, INT32 *x); +export void Files_ReadLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL *x); +export void Files_ReadLine (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); +export void Files_ReadNum (Files_Rider *R, ADDRESS *R__typ, SYSTEM_BYTE *x, LONGINT x__len); +export void Files_ReadReal (Files_Rider *R, ADDRESS *R__typ, REAL *x); +export void Files_ReadSet (Files_Rider *R, ADDRESS *R__typ, UINT32 *x); +export void Files_ReadString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); export void Files_Register (Files_File f); -export void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res); -static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len); -export void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos); +export void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT16 *res); +static void Files_ScanPath (INT16 *pos, CHAR *dir, LONGINT dir__len); +export void Files_Set (Files_Rider *r, ADDRESS *r__typ, Files_File f, INT32 pos); export void Files_SetSearchPath (CHAR *path, LONGINT path__len); -export void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x); -export void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x); -export void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); -export void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x); -export void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x); -export void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x); -export void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x); -export void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x); -export void Files_WriteSet (Files_Rider *R, address *R__typ, uint32 x); -export void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); +export void Files_Write (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE x); +export void Files_WriteBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN x); +export void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n); +export void Files_WriteInt (Files_Rider *R, ADDRESS *R__typ, INT16 x); +export void Files_WriteLInt (Files_Rider *R, ADDRESS *R__typ, INT32 x); +export void Files_WriteLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL x); +export void Files_WriteNum (Files_Rider *R, ADDRESS *R__typ, INT64 x); +export void Files_WriteReal (Files_Rider *R, ADDRESS *R__typ, REAL x); +export void Files_WriteSet (Files_Rider *R, ADDRESS *R__typ, UINT32 x); +export void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); #define Files_IdxTrap() __HALT(-1) #define Files_ToAdr(x) (address)x -static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int16 errcode) +static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INT16 errcode) { __DUP(s, s__len, CHAR); Out_Ln(); @@ -140,7 +140,7 @@ static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int16 errcode) static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT name__len, CHAR *dest, LONGINT dest__len) { - int16 i, j; + INT16 i, j; __DUP(dir, dir__len, CHAR); __DUP(name, name__len, CHAR); i = 0; @@ -165,7 +165,7 @@ static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *name, LONGINT name__len) { - int32 n, i, j; + INT32 n, i, j; __DUP(finalName, finalName__len, CHAR); Files_tempno += 1; n = Files_tempno; @@ -217,7 +217,7 @@ static void Files_Create (Files_File f) { Platform_FileIdentity identity; BOOLEAN done; - int16 error; + INT16 error; CHAR err[32]; if (f->fd == -1) { if (f->state == 1) { @@ -254,7 +254,7 @@ static void Files_Create (Files_File f) static void Files_Flush (Files_Buffer buf) { - int16 error; + INT16 error; Files_File f = NIL; if (buf->chg) { f = buf->f; @@ -278,7 +278,7 @@ static void Files_Flush (Files_Buffer buf) static void Files_CloseOSFile (Files_File f) { Files_File prev = NIL; - int16 error; + INT16 error; if (Files_files == f) { Files_files = f->next; } else { @@ -298,8 +298,8 @@ static void Files_CloseOSFile (Files_File f) void Files_Close (Files_File f) { - int32 i; - int16 error; + INT32 i; + INT16 error; if (f->state != 1 || f->registerName[0] != 0x00) { Files_Create(f); i = 0; @@ -315,7 +315,7 @@ void Files_Close (Files_File f) } } -int32 Files_Length (Files_File f) +INT32 Files_Length (Files_File f) { return f->len; } @@ -336,9 +336,9 @@ Files_File Files_New (CHAR *name, LONGINT name__len) return f; } -static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len) +static void Files_ScanPath (INT16 *pos, CHAR *dir, LONGINT dir__len) { - int16 i; + INT16 i; CHAR ch; i = 0; if (Files_SearchPath == NIL) { @@ -381,7 +381,7 @@ static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len) static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len) { - int16 i; + INT16 i; CHAR ch; i = 0; ch = name[0]; @@ -395,7 +395,7 @@ static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len) static Files_File Files_CacheEntry (Platform_FileIdentity identity) { Files_File f = NIL; - int16 i, error; + INT16 i, error; f = Files_files; while (f != NIL) { if (Platform_SameFile(identity, f->identity)) { @@ -422,11 +422,11 @@ static Files_File Files_CacheEntry (Platform_FileIdentity identity) Files_File Files_Old (CHAR *name, LONGINT name__len) { Files_File f = NIL; - int32 fd; - int16 pos; + INT32 fd; + INT16 pos; BOOLEAN done; CHAR dir[256], path[256]; - int16 error; + INT16 error; Platform_FileIdentity identity; __DUP(name, name__len, CHAR); if (name[0] != 0x00) { @@ -497,9 +497,9 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) void Files_Purge (Files_File f) { - int16 i; + INT16 i; Platform_FileIdentity identity; - int16 error; + INT16 error; i = 0; while (i < 4) { if (f->bufs[i] != NIL) { @@ -519,25 +519,25 @@ void Files_Purge (Files_File f) Platform_SetMTime(&f->identity, Platform_FileIdentity__typ, identity); } -void Files_GetDate (Files_File f, int32 *t, int32 *d) +void Files_GetDate (Files_File f, INT32 *t, INT32 *d) { Platform_FileIdentity identity; - int16 error; + INT16 error; Files_Create(f); error = Platform_Identify(f->fd, &identity, Platform_FileIdentity__typ); Platform_MTimeAsClock(identity, &*t, &*d); } -int32 Files_Pos (Files_Rider *r, address *r__typ) +INT32 Files_Pos (Files_Rider *r, ADDRESS *r__typ) { return (*r).org + (*r).offset; } -void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos) +void Files_Set (Files_Rider *r, ADDRESS *r__typ, Files_File f, INT32 pos) { - int32 org, offset, i, n; + INT32 org, offset, i, n; Files_Buffer buf = NIL; - int16 error; + INT16 error; if (f != NIL) { if (pos > f->len) { pos = f->len; @@ -595,9 +595,9 @@ void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos) (*r).res = 0; } -void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x) +void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x) { - int32 offset; + INT32 offset; Files_Buffer buf = NIL; buf = (*r).buf; offset = (*r).offset; @@ -619,9 +619,9 @@ void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x) } } -void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n) +void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n) { - int32 xpos, min, restInBuf, offset; + INT32 xpos, min, restInBuf, offset; Files_Buffer buf = NIL; if (n > x__len) { Files_IdxTrap(); @@ -655,15 +655,15 @@ void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x (*r).eof = 0; } -Files_File Files_Base (Files_Rider *r, address *r__typ) +Files_File Files_Base (Files_Rider *r, ADDRESS *r__typ) { return (*r).buf->f; } -void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x) +void Files_Write (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE x) { Files_Buffer buf = NIL; - int32 offset; + INT32 offset; buf = (*r).buf; offset = (*r).offset; if ((*r).org != buf->org || offset >= 4096) { @@ -681,9 +681,9 @@ void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x) (*r).res = 0; } -void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n) +void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n) { - int32 xpos, min, restInBuf, offset; + INT32 xpos, min, restInBuf, offset; Files_Buffer buf = NIL; if (n > x__len) { Files_IdxTrap(); @@ -717,17 +717,17 @@ void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT (*r).res = 0; } -void Files_Delete (CHAR *name, LONGINT name__len, int16 *res) +void Files_Delete (CHAR *name, LONGINT name__len, INT16 *res) { __DUP(name, name__len, CHAR); *res = Platform_Unlink((void*)name, name__len); __DEL(name); } -void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res) +void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT16 *res) { - int32 fdold, fdnew, n; - int16 error, ignore; + INT32 fdold, fdnew, n; + INT16 error, ignore; Platform_FileIdentity oldidentity, newidentity; CHAR buf[4096]; __DUP(old, old__len, CHAR); @@ -788,7 +788,7 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int void Files_Register (Files_File f) { - int16 idx, errcode; + INT16 idx, errcode; Files_File f1 = NIL; CHAR file[104]; if ((f->state == 1 && f->registerName[0] != 0x00)) { @@ -807,7 +807,7 @@ void Files_Register (Files_File f) } } -void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int16 *res) +void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INT16 *res) { __DUP(path, path__len, CHAR); *res = Platform_Chdir((void*)path, path__len); @@ -816,7 +816,7 @@ void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int16 *res) static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *dest, LONGINT dest__len) { - int32 i, j; + INT32 i, j; if (!Platform_LittleEndian) { i = src__len; j = 0; @@ -830,51 +830,51 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *de } } -void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x) +void Files_ReadBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN *x) { Files_Read(&*R, R__typ, (CHAR*)(void*)&*x); } -void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x) +void Files_ReadInt (Files_Rider *R, ADDRESS *R__typ, INT16 *x) { CHAR b[2]; Files_ReadBytes(&*R, R__typ, (void*)b, 2, 2); - *x = (int16)b[0] + __ASHL((int16)b[1], 8); + *x = (INT16)b[0] + __ASHL((INT16)b[1], 8); } -void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x) +void Files_ReadLInt (Files_Rider *R, ADDRESS *R__typ, INT32 *x) { CHAR b[4]; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); - *x = (((int16)b[0] + __ASHL((int16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); + *x = (((INT16)b[0] + __ASHL((INT16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); } -void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x) +void Files_ReadSet (Files_Rider *R, ADDRESS *R__typ, UINT32 *x) { CHAR b[4]; - int32 l; + INT32 l; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); - l = (((int16)b[0] + __ASHL((int16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); - *x = (uint32)l; + l = (((INT16)b[0] + __ASHL((INT16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); + *x = (UINT32)l; } -void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x) +void Files_ReadReal (Files_Rider *R, ADDRESS *R__typ, REAL *x) { CHAR b[4]; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); Files_FlipBytes((void*)b, 4, (void*)&*x, 4); } -void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x) +void Files_ReadLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL *x) { CHAR b[8]; Files_ReadBytes(&*R, R__typ, (void*)b, 8, 8); Files_FlipBytes((void*)b, 8, (void*)&*x, 8); } -void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) +void Files_ReadString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len) { - int16 i; + INT16 i; CHAR ch; i = 0; do { @@ -884,9 +884,9 @@ void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) } while (!(ch == 0x00)); } -void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) +void Files_ReadLine (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len) { - int16 i; + INT16 i; CHAR ch; BOOLEAN b; i = 0; @@ -902,29 +902,29 @@ void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) } while (!b); } -void Files_ReadNum (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len) +void Files_ReadNum (Files_Rider *R, ADDRESS *R__typ, SYSTEM_BYTE *x, LONGINT x__len) { - int8 s, b; - int64 q; + INT8 s, b; + INT64 q; s = 0; q = 0; Files_Read(&*R, R__typ, (void*)&b); while (b < 0) { - q += (int64)__ASH(((int16)b + 128), s); + q += (INT64)__ASH(((INT16)b + 128), s); s += 7; Files_Read(&*R, R__typ, (void*)&b); } - q += (int64)__ASH((__MASK(b, -64) - __ASHL(__ASHR(b, 6), 6)), s); + q += (INT64)__ASH((__MASK(b, -64) - __ASHL(__ASHR(b, 6), 6)), s); __ASSERT(x__len <= 8, 0); __MOVE((address)&q, (address)x, x__len); } -void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x) +void Files_WriteBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN x) { Files_Write(&*R, R__typ, __VAL(CHAR, x)); } -void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x) +void Files_WriteInt (Files_Rider *R, ADDRESS *R__typ, INT16 x) { CHAR b[2]; b[0] = (CHAR)x; @@ -932,7 +932,7 @@ void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x) Files_WriteBytes(&*R, R__typ, (void*)b, 2, 2); } -void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x) +void Files_WriteLInt (Files_Rider *R, ADDRESS *R__typ, INT32 x) { CHAR b[4]; b[0] = (CHAR)x; @@ -942,11 +942,11 @@ void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x) Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } -void Files_WriteSet (Files_Rider *R, address *R__typ, uint32 x) +void Files_WriteSet (Files_Rider *R, ADDRESS *R__typ, UINT32 x) { CHAR b[4]; - int32 i; - i = (int32)x; + INT32 i; + i = (INT32)x; b[0] = (CHAR)i; b[1] = (CHAR)__ASHR(i, 8); b[2] = (CHAR)__ASHR(i, 16); @@ -954,23 +954,23 @@ void Files_WriteSet (Files_Rider *R, address *R__typ, uint32 x) Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } -void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x) +void Files_WriteReal (Files_Rider *R, ADDRESS *R__typ, REAL x) { CHAR b[4]; Files_FlipBytes((void*)&x, 4, (void*)b, 4); Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } -void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x) +void Files_WriteLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL x) { CHAR b[8]; Files_FlipBytes((void*)&x, 8, (void*)b, 8); Files_WriteBytes(&*R, R__typ, (void*)b, 8, 8); } -void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) +void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len) { - int16 i; + INT16 i; i = 0; while (x[i] != 0x00) { i += 1; @@ -978,7 +978,7 @@ void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len Files_WriteBytes(&*R, R__typ, (void*)x, x__len * 1, i + 1); } -void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x) +void Files_WriteNum (Files_Rider *R, ADDRESS *R__typ, INT64 x) { while (x < -64 || x > 63) { Files_Write(&*R, R__typ, (CHAR)(__MASK(x, -128) + 128)); @@ -995,7 +995,7 @@ void Files_GetName (Files_File f, CHAR *name, LONGINT name__len) static void Files_Finalize (SYSTEM_PTR o) { Files_File f = NIL; - int32 res; + INT32 res; f = (Files_File)(address)o; if (f->fd >= 0) { Files_CloseOSFile(f); diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index 10b85a66..a0965363 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h @@ -11,58 +11,58 @@ typedef typedef struct Files_FileDesc { char _prvt0[224]; - int32 fd; + INT32 fd; char _prvt1[32]; } Files_FileDesc; typedef struct Files_Rider { - int32 res; + INT32 res; BOOLEAN eof; char _prvt0[15]; } Files_Rider; -import address *Files_FileDesc__typ; -import address *Files_Rider__typ; +import ADDRESS *Files_FileDesc__typ; +import ADDRESS *Files_Rider__typ; -import Files_File Files_Base (Files_Rider *r, address *r__typ); -import void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int16 *res); +import Files_File Files_Base (Files_Rider *r, ADDRESS *r__typ); +import void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INT16 *res); import void Files_Close (Files_File f); -import void Files_Delete (CHAR *name, LONGINT name__len, int16 *res); -import void Files_GetDate (Files_File f, int32 *t, int32 *d); +import void Files_Delete (CHAR *name, LONGINT name__len, INT16 *res); +import void Files_GetDate (Files_File f, INT32 *t, INT32 *d); import void Files_GetName (Files_File f, CHAR *name, LONGINT name__len); -import int32 Files_Length (Files_File f); +import INT32 Files_Length (Files_File f); import Files_File Files_New (CHAR *name, LONGINT name__len); import Files_File Files_Old (CHAR *name, LONGINT name__len); -import int32 Files_Pos (Files_Rider *r, address *r__typ); +import INT32 Files_Pos (Files_Rider *r, ADDRESS *r__typ); import void Files_Purge (Files_File f); -import void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x); -import void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x); -import void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); -import void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x); -import void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); -import void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); -import void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); -import void Files_ReadNum (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len); -import void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); -import void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x); -import void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); +import void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x); +import void Files_ReadBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN *x); +import void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n); +import void Files_ReadInt (Files_Rider *R, ADDRESS *R__typ, INT16 *x); +import void Files_ReadLInt (Files_Rider *R, ADDRESS *R__typ, INT32 *x); +import void Files_ReadLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL *x); +import void Files_ReadLine (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); +import void Files_ReadNum (Files_Rider *R, ADDRESS *R__typ, SYSTEM_BYTE *x, LONGINT x__len); +import void Files_ReadReal (Files_Rider *R, ADDRESS *R__typ, REAL *x); +import void Files_ReadSet (Files_Rider *R, ADDRESS *R__typ, UINT32 *x); +import void Files_ReadString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); import void Files_Register (Files_File f); -import void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res); -import void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos); +import void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT16 *res); +import void Files_Set (Files_Rider *r, ADDRESS *r__typ, Files_File f, INT32 pos); import void Files_SetSearchPath (CHAR *path, LONGINT path__len); -import void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x); -import void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x); -import void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); -import void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x); -import void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x); -import void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x); -import void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x); -import void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x); -import void Files_WriteSet (Files_Rider *R, address *R__typ, uint32 x); -import void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); +import void Files_Write (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE x); +import void Files_WriteBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN x); +import void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n); +import void Files_WriteInt (Files_Rider *R, ADDRESS *R__typ, INT16 x); +import void Files_WriteLInt (Files_Rider *R, ADDRESS *R__typ, INT32 x); +import void Files_WriteLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL x); +import void Files_WriteNum (Files_Rider *R, ADDRESS *R__typ, INT64 x); +import void Files_WriteReal (Files_Rider *R, ADDRESS *R__typ, REAL x); +import void Files_WriteSet (Files_Rider *R, ADDRESS *R__typ, UINT32 x); +import void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); import void *Files__init(void); diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index 4bc74170..ca99053e 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" @@ -40,7 +40,7 @@ typedef typedef struct Heap_FinDesc { Heap_FinNode next; - int32 obj; + INT32 obj; BOOLEAN marked; Heap_Finalizer finalize; } Heap_FinDesc; @@ -55,53 +55,53 @@ typedef struct Heap_ModuleDesc { Heap_Module next; Heap_ModuleName name; - int32 refcnt; + INT32 refcnt; Heap_Cmd cmds; - int32 types; + INT32 types; Heap_EnumProc enumPtrs; - int32 reserved1, reserved2; + INT32 reserved1, reserved2; } Heap_ModuleDesc; export SYSTEM_PTR Heap_modules; -static int32 Heap_freeList[10]; -static int32 Heap_bigBlocks; -export int32 Heap_allocated; +static INT32 Heap_freeList[10]; +static INT32 Heap_bigBlocks; +export INT32 Heap_allocated; static BOOLEAN Heap_firstTry; -static int32 Heap_heap, Heap_heapend; -export int32 Heap_heapsize; +static INT32 Heap_heap, Heap_heapend; +export INT32 Heap_heapsize; static Heap_FinNode Heap_fin; -static int16 Heap_lockdepth; +static INT16 Heap_lockdepth; static BOOLEAN Heap_interrupted; -export int16 Heap_FileCount; +export INT16 Heap_FileCount; -export address *Heap_ModuleDesc__typ; -export address *Heap_CmdDesc__typ; -export address *Heap_FinDesc__typ; -export address *Heap__1__typ; +export ADDRESS *Heap_ModuleDesc__typ; +export ADDRESS *Heap_CmdDesc__typ; +export ADDRESS *Heap_FinDesc__typ; +export ADDRESS *Heap__1__typ; static void Heap_CheckFin (void); -static void Heap_ExtendHeap (int32 blksz); +static void Heap_ExtendHeap (INT32 blksz); export void Heap_FINALL (void); static void Heap_Finalize (void); export void Heap_GC (BOOLEAN markStack); -static void Heap_HeapSort (int32 n, int32 *a, LONGINT a__len); +static void Heap_HeapSort (INT32 n, INT32 *a, LONGINT a__len); export void Heap_INCREF (Heap_Module m); export void Heap_InitHeap (void); export void Heap_Lock (void); -static void Heap_Mark (int32 q); -static void Heap_MarkCandidates (int32 n, int32 *cand, LONGINT cand__len); +static void Heap_Mark (INT32 q); +static void Heap_MarkCandidates (INT32 n, INT32 *cand, LONGINT cand__len); static void Heap_MarkP (SYSTEM_PTR p); -static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len); -export SYSTEM_PTR Heap_NEWBLK (int32 size); -export SYSTEM_PTR Heap_NEWREC (int32 tag); -static int32 Heap_NewChunk (int32 blksz); +static void Heap_MarkStack (INT32 n, INT32 *cand, LONGINT cand__len); +export SYSTEM_PTR Heap_NEWBLK (INT32 size); +export SYSTEM_PTR Heap_NEWREC (INT32 tag); +static INT32 Heap_NewChunk (INT32 blksz); export void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); export SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -export void Heap_REGTYP (Heap_Module m, int32 typ); +export void Heap_REGTYP (Heap_Module m, INT32 typ); export void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); static void Heap_Scan (void); -static void Heap_Sift (int32 l, int32 r, int32 *a, LONGINT a__len); +static void Heap_Sift (INT32 l, INT32 r, INT32 *a, LONGINT a__len); export void Heap_Unlock (void); extern void *Heap__init(); @@ -157,9 +157,9 @@ void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) m->cmds = c; } -void Heap_REGTYP (Heap_Module m, int32 typ) +void Heap_REGTYP (Heap_Module m, INT32 typ) { - __PUT(typ, m->types, int32); + __PUT(typ, m->types, INT32); m->types = typ; } @@ -168,25 +168,25 @@ void Heap_INCREF (Heap_Module m) m->refcnt += 1; } -static int32 Heap_NewChunk (int32 blksz) +static INT32 Heap_NewChunk (INT32 blksz) { - int32 chnk; + INT32 chnk; chnk = Heap_OSAllocate(blksz + 12); if (chnk != 0) { - __PUT(chnk + 4, chnk + (12 + blksz), int32); - __PUT(chnk + 12, chnk + 16, int32); - __PUT(chnk + 16, blksz, int32); - __PUT(chnk + 20, -4, int32); - __PUT(chnk + 24, Heap_bigBlocks, int32); + __PUT(chnk + 4, chnk + (12 + blksz), INT32); + __PUT(chnk + 12, chnk + 16, INT32); + __PUT(chnk + 16, blksz, INT32); + __PUT(chnk + 20, -4, INT32); + __PUT(chnk + 24, Heap_bigBlocks, INT32); Heap_bigBlocks = chnk + 12; Heap_heapsize += blksz; } return chnk; } -static void Heap_ExtendHeap (int32 blksz) +static void Heap_ExtendHeap (INT32 blksz) { - int32 size, chnk, j, next; + INT32 size, chnk, j, next; if (blksz > 160000) { size = blksz; } else { @@ -195,30 +195,30 @@ static void Heap_ExtendHeap (int32 blksz) chnk = Heap_NewChunk(size); if (chnk != 0) { if (chnk < Heap_heap) { - __PUT(chnk, Heap_heap, int32); + __PUT(chnk, Heap_heap, INT32); Heap_heap = chnk; } else { j = Heap_heap; - __GET(j, next, int32); + __GET(j, next, INT32); while ((next != 0 && chnk > next)) { j = next; - __GET(j, next, int32); + __GET(j, next, INT32); } - __PUT(chnk, next, int32); - __PUT(j, chnk, int32); + __PUT(chnk, next, INT32); + __PUT(j, chnk, INT32); } if (next == 0) { - __GET(chnk + 4, Heap_heapend, int32); + __GET(chnk + 4, Heap_heapend, INT32); } } } -SYSTEM_PTR Heap_NEWREC (int32 tag) +SYSTEM_PTR Heap_NEWREC (INT32 tag) { - int32 i, i0, di, blksz, restsize, t, adr, end, next, prev; + INT32 i, i0, di, blksz, restsize, t, adr, end, next, prev; SYSTEM_PTR new; Heap_Lock(); - __GET(tag, blksz, int32); + __GET(tag, blksz, INT32); i0 = __ASHR(blksz, 4); i = i0; if (i < 9) { @@ -229,17 +229,17 @@ SYSTEM_PTR Heap_NEWREC (int32 tag) } } if (i < 9) { - __GET(adr + 12, next, int32); + __GET(adr + 12, next, INT32); Heap_freeList[i] = next; if (i != i0) { di = i - i0; restsize = __ASHL(di, 4); end = adr + restsize; - __PUT(end + 4, blksz, int32); - __PUT(end + 8, -4, int32); - __PUT(end, end + 4, int32); - __PUT(adr + 4, restsize, int32); - __PUT(adr + 12, Heap_freeList[di], int32); + __PUT(end + 4, blksz, INT32); + __PUT(end + 8, -4, INT32); + __PUT(end, end + 4, INT32); + __PUT(adr + 4, restsize, INT32); + __PUT(adr + 12, Heap_freeList[di], INT32); Heap_freeList[di] = adr; adr += restsize; } @@ -268,31 +268,31 @@ SYSTEM_PTR Heap_NEWREC (int32 tag) return NIL; } } - __GET(adr + 4, t, int32); + __GET(adr + 4, t, INT32); if (t >= blksz) { break; } prev = adr; - __GET(adr + 12, adr, int32); + __GET(adr + 12, adr, INT32); } restsize = t - blksz; end = adr + restsize; - __PUT(end + 4, blksz, int32); - __PUT(end + 8, -4, int32); - __PUT(end, end + 4, int32); + __PUT(end + 4, blksz, INT32); + __PUT(end + 8, -4, INT32); + __PUT(end, end + 4, INT32); if (restsize > 144) { - __PUT(adr + 4, restsize, int32); + __PUT(adr + 4, restsize, INT32); } else { - __GET(adr + 12, next, int32); + __GET(adr + 12, next, INT32); if (prev == 0) { Heap_bigBlocks = next; } else { - __PUT(prev + 12, next, int32); + __PUT(prev + 12, next, INT32); } if (restsize > 0) { di = __ASHR(restsize, 4); - __PUT(adr + 4, restsize, int32); - __PUT(adr + 12, Heap_freeList[di], int32); + __PUT(adr + 4, restsize, INT32); + __PUT(adr + 12, Heap_freeList[di], INT32); Heap_freeList[di] = adr; } } @@ -301,69 +301,69 @@ SYSTEM_PTR Heap_NEWREC (int32 tag) i = adr + 16; end = adr + blksz; while (i < end) { - __PUT(i, 0, int32); - __PUT(i + 4, 0, int32); - __PUT(i + 8, 0, int32); - __PUT(i + 12, 0, int32); + __PUT(i, 0, INT32); + __PUT(i + 4, 0, INT32); + __PUT(i + 8, 0, INT32); + __PUT(i + 12, 0, INT32); i += 16; } - __PUT(adr + 12, 0, int32); - __PUT(adr, tag, int32); - __PUT(adr + 4, 0, int32); - __PUT(adr + 8, 0, int32); + __PUT(adr + 12, 0, INT32); + __PUT(adr, tag, INT32); + __PUT(adr + 4, 0, INT32); + __PUT(adr + 8, 0, INT32); Heap_allocated += blksz; Heap_Unlock(); return (SYSTEM_PTR)(address)(adr + 4); } -SYSTEM_PTR Heap_NEWBLK (int32 size) +SYSTEM_PTR Heap_NEWBLK (INT32 size) { - int32 blksz, tag; + INT32 blksz, tag; SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 31, 4), 4); new = Heap_NEWREC((address)&blksz); - tag = ((int32)(address)new + blksz) - 12; - __PUT(tag - 4, 0, int32); - __PUT(tag, blksz, int32); - __PUT(tag + 4, -4, int32); - __PUT((int32)(address)new - 4, tag, int32); + tag = ((INT32)(address)new + blksz) - 12; + __PUT(tag - 4, 0, INT32); + __PUT(tag, blksz, INT32); + __PUT(tag + 4, -4, INT32); + __PUT((INT32)(address)new - 4, tag, INT32); Heap_Unlock(); return new; } -static void Heap_Mark (int32 q) +static void Heap_Mark (INT32 q) { - int32 p, tag, offset, fld, n, tagbits; + INT32 p, tag, offset, fld, n, tagbits; if (q != 0) { - __GET(q - 4, tagbits, int32); + __GET(q - 4, tagbits, INT32); if (!__ODD(tagbits)) { - __PUT(q - 4, tagbits + 1, int32); + __PUT(q - 4, tagbits + 1, INT32); p = 0; tag = tagbits + 4; for (;;) { - __GET(tag, offset, int32); + __GET(tag, offset, INT32); if (offset < 0) { - __PUT(q - 4, (tag + offset) + 1, int32); + __PUT(q - 4, (tag + offset) + 1, INT32); if (p == 0) { break; } n = q; q = p; - __GET(q - 4, tag, int32); + __GET(q - 4, tag, INT32); tag -= 1; - __GET(tag, offset, int32); + __GET(tag, offset, INT32); fld = q + offset; - __GET(fld, p, int32); + __GET(fld, p, INT32); __PUT(fld, (SYSTEM_PTR)(address)n, SYSTEM_PTR); } else { fld = q + offset; - __GET(fld, n, int32); + __GET(fld, n, INT32); if (n != 0) { - __GET(n - 4, tagbits, int32); + __GET(n - 4, tagbits, INT32); if (!__ODD(tagbits)) { - __PUT(n - 4, tagbits + 1, int32); - __PUT(q - 4, tag + 1, int32); + __PUT(n - 4, tagbits + 1, INT32); + __PUT(q - 4, tag + 1, INT32); __PUT(fld, (SYSTEM_PTR)(address)p, SYSTEM_PTR); p = q; q = n; @@ -379,12 +379,12 @@ static void Heap_Mark (int32 q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((int32)(address)p); + Heap_Mark((INT32)(address)p); } static void Heap_Scan (void) { - int32 chnk, adr, end, start, tag, i, size, freesize; + INT32 chnk, adr, end, start, tag, i, size, freesize; Heap_bigBlocks = 0; i = 1; while (i < 9) { @@ -396,58 +396,58 @@ static void Heap_Scan (void) chnk = Heap_heap; while (chnk != 0) { adr = chnk + 12; - __GET(chnk + 4, end, int32); + __GET(chnk + 4, end, INT32); while (adr < end) { - __GET(adr, tag, int32); + __GET(adr, tag, INT32); if (__ODD(tag)) { if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 4, int32); - __PUT(start + 4, freesize, int32); - __PUT(start + 8, -4, int32); + __PUT(start, start + 4, INT32); + __PUT(start + 4, freesize, INT32); + __PUT(start + 8, -4, INT32); i = __ASHR(freesize, 4); freesize = 0; if (i < 9) { - __PUT(start + 12, Heap_freeList[i], int32); + __PUT(start + 12, Heap_freeList[i], INT32); Heap_freeList[i] = start; } else { - __PUT(start + 12, Heap_bigBlocks, int32); + __PUT(start + 12, Heap_bigBlocks, INT32); Heap_bigBlocks = start; } } tag -= 1; - __PUT(adr, tag, int32); - __GET(tag, size, int32); + __PUT(adr, tag, INT32); + __GET(tag, size, INT32); Heap_allocated += size; adr += size; } else { - __GET(tag, size, int32); + __GET(tag, size, INT32); freesize += size; adr += size; } } if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 4, int32); - __PUT(start + 4, freesize, int32); - __PUT(start + 8, -4, int32); + __PUT(start, start + 4, INT32); + __PUT(start + 4, freesize, INT32); + __PUT(start + 8, -4, INT32); i = __ASHR(freesize, 4); freesize = 0; if (i < 9) { - __PUT(start + 12, Heap_freeList[i], int32); + __PUT(start + 12, Heap_freeList[i], INT32); Heap_freeList[i] = start; } else { - __PUT(start + 12, Heap_bigBlocks, int32); + __PUT(start + 12, Heap_bigBlocks, INT32); Heap_bigBlocks = start; } } - __GET(chnk, chnk, int32); + __GET(chnk, chnk, INT32); } } -static void Heap_Sift (int32 l, int32 r, int32 *a, LONGINT a__len) +static void Heap_Sift (INT32 l, INT32 r, INT32 *a, LONGINT a__len) { - int32 i, j, x; + INT32 i, j, x; j = l; x = a[j]; for (;;) { @@ -464,9 +464,9 @@ static void Heap_Sift (int32 l, int32 r, int32 *a, LONGINT a__len) a[i] = x; } -static void Heap_HeapSort (int32 n, int32 *a, LONGINT a__len) +static void Heap_HeapSort (INT32 n, INT32 *a, LONGINT a__len) { - int32 l, r, x; + INT32 l, r, x; l = __ASHR(n, 1); r = n - 1; while (l > 0) { @@ -482,25 +482,25 @@ static void Heap_HeapSort (int32 n, int32 *a, LONGINT a__len) } } -static void Heap_MarkCandidates (int32 n, int32 *cand, LONGINT cand__len) +static void Heap_MarkCandidates (INT32 n, INT32 *cand, LONGINT cand__len) { - int32 chnk, adr, tag, next, lim, lim1, i, ptr, size; + INT32 chnk, adr, tag, next, lim, lim1, i, ptr, size; chnk = Heap_heap; i = 0; lim = cand[n - 1]; while ((chnk != 0 && chnk < lim)) { adr = chnk + 12; - __GET(chnk + 4, lim1, int32); + __GET(chnk + 4, lim1, INT32); if (lim < lim1) { lim1 = lim; } while (adr < lim1) { - __GET(adr, tag, int32); + __GET(adr, tag, INT32); if (__ODD(tag)) { - __GET(tag - 1, size, int32); + __GET(tag - 1, size, INT32); adr += size; } else { - __GET(tag, size, int32); + __GET(tag, size, INT32); ptr = adr + 4; while (cand[i] < ptr) { i += 1; @@ -515,17 +515,17 @@ static void Heap_MarkCandidates (int32 n, int32 *cand, LONGINT cand__len) adr = next; } } - __GET(chnk, chnk, int32); + __GET(chnk, chnk, INT32); } } static void Heap_CheckFin (void) { Heap_FinNode n; - int32 tag; + INT32 tag; n = Heap_fin; while (n != NIL) { - __GET(n->obj - 4, tag, int32); + __GET(n->obj - 4, tag, INT32); if (!__ODD(tag)) { n->marked = 0; Heap_Mark(n->obj); @@ -571,10 +571,10 @@ void Heap_FINALL (void) } } -static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len) +static void Heap_MarkStack (INT32 n, INT32 *cand, LONGINT cand__len) { SYSTEM_PTR frame; - int32 inc, nofcand, sp, p, stack0; + INT32 inc, nofcand, sp, p, stack0; struct Heap__1 align; if (n > 0) { Heap_MarkStack(n - 1, cand, cand__len); @@ -591,7 +591,7 @@ static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len) inc = -inc; } while (sp != stack0) { - __GET(sp, p, int32); + __GET(sp, p, INT32); if ((p > Heap_heap && p < Heap_heapend)) { if (nofcand == cand__len) { Heap_HeapSort(nofcand, (void*)cand, cand__len); @@ -613,8 +613,8 @@ static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len) void Heap_GC (BOOLEAN markStack) { Heap_Module m; - int32 i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; - int32 cand[10000]; + INT32 i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; + INT32 cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); m = (Heap_Module)(address)Heap_modules; @@ -694,7 +694,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (int32)(address)obj; + f->obj = (INT32)(address)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; @@ -704,8 +704,8 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) void Heap_InitHeap (void) { Heap_heap = Heap_NewChunk(128000); - __GET(Heap_heap + 4, Heap_heapend, int32); - __PUT(Heap_heap, 0, int32); + __GET(Heap_heap + 4, Heap_heapend, INT32); + __PUT(Heap_heap, 0, INT32); Heap_allocated = 0; Heap_firstTry = 1; Heap_freeList[9] = 1; diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index 1a319646..dbc3fcd7 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h @@ -22,7 +22,7 @@ typedef typedef struct Heap_ModuleDesc { - int32 _prvt0; + INT32 _prvt0; char _prvt1[44]; } Heap_ModuleDesc; @@ -31,21 +31,21 @@ typedef import SYSTEM_PTR Heap_modules; -import int32 Heap_allocated, Heap_heapsize; -import int16 Heap_FileCount; +import INT32 Heap_allocated, Heap_heapsize; +import INT16 Heap_FileCount; -import address *Heap_ModuleDesc__typ; +import ADDRESS *Heap_ModuleDesc__typ; import void Heap_FINALL (void); import void Heap_GC (BOOLEAN markStack); import void Heap_INCREF (Heap_Module m); import void Heap_InitHeap (void); import void Heap_Lock (void); -import SYSTEM_PTR Heap_NEWBLK (int32 size); -import SYSTEM_PTR Heap_NEWREC (int32 tag); +import SYSTEM_PTR Heap_NEWBLK (INT32 size); +import SYSTEM_PTR Heap_NEWREC (INT32 tag); import void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); import SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -import void Heap_REGTYP (Heap_Module m, int32 typ); +import void Heap_REGTYP (Heap_Module m, INT32 typ); import void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); import void Heap_Unlock (void); import void *Heap__init(void); diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index bb6774da..d8293ed7 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "Heap.h" @@ -31,20 +31,20 @@ typedef struct Modules_ModuleDesc { Modules_Module next; Modules_ModuleName name; - int32 refcnt; + INT32 refcnt; Modules_Cmd cmds; - int32 types; - void (*enumPtrs)(void(*)(int32)); - int32 reserved1, reserved2; + INT32 types; + void (*enumPtrs)(void(*)(INT32)); + INT32 reserved1, reserved2; } Modules_ModuleDesc; -export int16 Modules_res; +export INT16 Modules_res; export CHAR Modules_resMsg[256]; export Modules_ModuleName Modules_imported, Modules_importing; -export address *Modules_ModuleDesc__typ; -export address *Modules_CmdDesc__typ; +export ADDRESS *Modules_ModuleDesc__typ; +export ADDRESS *Modules_CmdDesc__typ; static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len); export void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all); @@ -56,7 +56,7 @@ export Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len); static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len) { - int16 i, j; + INT16 i, j; __DUP(b, b__len, CHAR); i = 0; while (a[__X(i, a__len)] != 0x00) { diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index a7b62fe3..c2afbd3c 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h @@ -28,20 +28,20 @@ typedef struct Modules_ModuleDesc { Modules_Module next; Modules_ModuleName name; - int32 refcnt; + INT32 refcnt; Modules_Cmd cmds; - int32 types; - void (*enumPtrs)(void(*)(int32)); + INT32 types; + void (*enumPtrs)(void(*)(INT32)); char _prvt0[8]; } Modules_ModuleDesc; -import int16 Modules_res; +import INT16 Modules_res; import CHAR Modules_resMsg[256]; import Modules_ModuleName Modules_imported, Modules_importing; -import address *Modules_ModuleDesc__typ; -import address *Modules_CmdDesc__typ; +import ADDRESS *Modules_ModuleDesc__typ; +import ADDRESS *Modules_CmdDesc__typ; import void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all); import Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len); diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index dff6adc6..60993ebe 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "OPM.h" @@ -11,13 +11,13 @@ #include "OPT.h" -static int16 OPB_exp; -static int64 OPB_maxExp; +static INT16 OPB_exp; +static INT64 OPB_maxExp; export void OPB_Assign (OPT_Node *x, OPT_Node y); -static void OPB_BindNodes (int8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y); -static int16 OPB_BoolToInt (BOOLEAN b); +static void OPB_BindNodes (INT8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y); +static INT16 OPB_BoolToInt (BOOLEAN b); export void OPB_Call (OPT_Node *x, OPT_Node apar, OPT_Object fp); static void OPB_CharToString (OPT_Node n); static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode); @@ -25,10 +25,10 @@ static void OPB_CheckLeaf (OPT_Node x, BOOLEAN dynArrToo); export void OPB_CheckParameters (OPT_Object fp, OPT_Object ap, BOOLEAN checkNames); static void OPB_CheckProc (OPT_Struct x, OPT_Object y); static void OPB_CheckPtr (OPT_Node x, OPT_Node y); -static void OPB_CheckRealType (int16 f, int16 nr, OPT_Const x); +static void OPB_CheckRealType (INT16 f, INT16 nr, OPT_Const x); static void OPB_CheckReceiver (OPT_Node *x, OPT_Object fp); -static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y); -export void OPB_Construct (int8 class, OPT_Node *x, OPT_Node y); +static void OPB_ConstOp (INT16 op, OPT_Node x, OPT_Node y); +export void OPB_Construct (INT8 class, OPT_Node *x, OPT_Node y); static void OPB_Convert (OPT_Node *x, OPT_Struct typ); export void OPB_DeRef (OPT_Node *x); static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpar); @@ -38,17 +38,17 @@ export void OPB_Field (OPT_Node *x, OPT_Object y); export void OPB_In (OPT_Node *x, OPT_Node y); export void OPB_Index (OPT_Node *x, OPT_Node y); export void OPB_Inittd (OPT_Node *inittd, OPT_Node *last, OPT_Struct typ); -static BOOLEAN OPB_IntToBool (int64 i); +static BOOLEAN OPB_IntToBool (INT64 i); export void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y); -export void OPB_MOp (int8 op, OPT_Node *x); +export void OPB_MOp (INT8 op, OPT_Node *x); export OPT_Node OPB_NewBoolConst (BOOLEAN boolval); -export OPT_Node OPB_NewIntConst (int64 intval); +export OPT_Node OPB_NewIntConst (INT64 intval); export OPT_Node OPB_NewLeaf (OPT_Object obj); export OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ); -export OPT_Node OPB_NewString (OPS_String str, int64 len); +export OPT_Node OPB_NewString (OPS_String str, INT64 len); export OPT_Node OPB_Nil (void); static BOOLEAN OPB_NotVar (OPT_Node x); -export void OPB_Op (int8 op, OPT_Node *x, OPT_Node y); +export void OPB_Op (INT8 op, OPT_Node *x, OPT_Node y); export void OPB_OptIf (OPT_Node *x); export void OPB_Param (OPT_Node ap, OPT_Object fp); export void OPB_PrepCall (OPT_Node *x, OPT_Object *fpar); @@ -57,17 +57,17 @@ export void OPB_SetElem (OPT_Node *x); static void OPB_SetIntType (OPT_Node node); export void OPB_SetRange (OPT_Node *x, OPT_Node y); static void OPB_SetSetType (OPT_Node node); -export void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno); -export void OPB_StPar0 (OPT_Node *par0, int16 fctno); -export void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno); -export void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n); -export void OPB_StaticLink (int8 dlev); +export void OPB_StFct (OPT_Node *par0, INT8 fctno, INT16 parno); +export void OPB_StPar0 (OPT_Node *par0, INT16 fctno); +export void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno); +export void OPB_StParN (OPT_Node *par0, OPT_Node x, INT16 fctno, INT16 n); +export void OPB_StaticLink (INT8 dlev); export void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard); -static void OPB_err (int16 n); -static int64 OPB_log (int64 x); +static void OPB_err (INT16 n); +static INT64 OPB_log (INT64 x); -static void OPB_err (int16 n) +static void OPB_err (INT16 n) { OPM_err(n); } @@ -104,7 +104,7 @@ OPT_Node OPB_NewLeaf (OPT_Object obj) return node; } -void OPB_Construct (int8 class, OPT_Node *x, OPT_Node y) +void OPB_Construct (INT8 class, OPT_Node *x, OPT_Node y) { OPT_Node node = NIL; node = OPT_NewNode(class); @@ -127,7 +127,7 @@ void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y) *last = y; } -static int16 OPB_BoolToInt (BOOLEAN b) +static INT16 OPB_BoolToInt (BOOLEAN b) { if (b) { return 1; @@ -137,7 +137,7 @@ static int16 OPB_BoolToInt (BOOLEAN b) __RETCHK; } -static BOOLEAN OPB_IntToBool (int64 i) +static BOOLEAN OPB_IntToBool (INT64 i) { return i != 0; } @@ -214,8 +214,8 @@ static void OPB_SetIntType (OPT_Node node) static void OPB_SetSetType (OPT_Node node) { - int32 i32; - __GET((address)&node->conval->setval + 4, i32, int32); + INT32 i32; + __GET((address)&node->conval->setval + 4, i32, INT32); if (i32 == 0) { node->typ = OPT_set32typ; } else { @@ -223,7 +223,7 @@ static void OPB_SetSetType (OPT_Node node) } } -OPT_Node OPB_NewIntConst (int64 intval) +OPT_Node OPB_NewIntConst (INT64 intval) { OPT_Node x = NIL; x = OPT_NewNode(7); @@ -244,7 +244,7 @@ OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ) return x; } -OPT_Node OPB_NewString (OPS_String str, int64 len) +OPT_Node OPB_NewString (OPS_String str, INT64 len) { OPT_Node x = NIL; x = OPT_NewNode(7); @@ -274,7 +274,7 @@ static void OPB_CharToString (OPT_Node n) n->obj = NIL; } -static void OPB_BindNodes (int8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y) +static void OPB_BindNodes (INT8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y) { OPT_Node node = NIL; node = OPT_NewNode(class); @@ -314,7 +314,7 @@ void OPB_DeRef (OPT_Node *x) void OPB_Index (OPT_Node *x, OPT_Node y) { - int16 f; + INT16 f; OPT_Struct typ = NIL; f = y->typ->form; if ((*x)->class >= 7) { @@ -325,7 +325,7 @@ void OPB_Index (OPT_Node *x, OPT_Node y) } if ((*x)->typ->comp == 2) { typ = (*x)->typ->BaseTyp; - if ((y->class == 7 && (y->conval->intval < 0 || y->conval->intval >= (int64)(*x)->typ->n))) { + if ((y->class == 7 && (y->conval->intval < 0 || y->conval->intval >= (INT64)(*x)->typ->n))) { OPB_err(81); } } else if ((*x)->typ->comp == 3) { @@ -439,15 +439,15 @@ void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) void OPB_In (OPT_Node *x, OPT_Node y) { - int16 f; - int64 k; + INT16 f; + INT64 k; f = (*x)->typ->form; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); } else if ((f == 4 && y->typ->form == 7)) { if ((*x)->class == 7) { k = (*x)->conval->intval; - if (k < 0 || k >= (int64)__ASHL(y->typ->size, 3)) { + if (k < 0 || k >= (INT64)__ASHL(y->typ->size, 3)) { OPB_err(202); } else if (y->class == 7) { (*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval, 64)); @@ -466,7 +466,7 @@ void OPB_In (OPT_Node *x, OPT_Node y) (*x)->typ = OPT_booltyp; } -static int64 OPB_log (int64 x) +static INT64 OPB_log (INT64 x) { OPB_exp = 0; if (x > 0) { @@ -478,7 +478,7 @@ static int64 OPB_log (int64 x) return x; } -static void OPB_CheckRealType (int16 f, int16 nr, OPT_Const x) +static void OPB_CheckRealType (INT16 f, INT16 nr, OPT_Const x) { LONGREAL min, max, r; if (f == 5) { @@ -502,9 +502,9 @@ static struct MOp__28 { struct MOp__28 *lnk; } *MOp__28_s; -static OPT_Node NewOp__29 (int8 op, OPT_Struct typ, OPT_Node z); +static OPT_Node NewOp__29 (INT8 op, OPT_Struct typ, OPT_Node z); -static OPT_Node NewOp__29 (int8 op, OPT_Struct typ, OPT_Node z) +static OPT_Node NewOp__29 (INT8 op, OPT_Struct typ, OPT_Node z) { OPT_Node node = NIL; node = OPT_NewNode(11); @@ -514,9 +514,9 @@ static OPT_Node NewOp__29 (int8 op, OPT_Struct typ, OPT_Node z) return node; } -void OPB_MOp (int8 op, OPT_Node *x) +void OPB_MOp (INT8 op, OPT_Node *x) { - int16 f; + INT16 f; OPT_Struct typ = NIL; OPT_Node z = NIL; struct MOp__28 _s; @@ -597,7 +597,7 @@ void OPB_MOp (int8 op, OPT_Node *x) case 22: if (f == 3) { if (z->class == 7) { - z->conval->intval = (int16)__CAP((CHAR)z->conval->intval); + z->conval->intval = (INT16)__CAP((CHAR)z->conval->intval); z->obj = NIL; } else { z = NewOp__29(op, typ, z); @@ -657,7 +657,7 @@ void OPB_MOp (int8 op, OPT_Node *x) static void OPB_CheckPtr (OPT_Node x, OPT_Node y) { - int16 g; + INT16 g; OPT_Struct p = NIL, q = NIL, t = NIL; g = y->typ->form; if (g == 11) { @@ -741,16 +741,16 @@ static void OPB_CheckProc (OPT_Struct x, OPT_Object y) static struct ConstOp__13 { OPT_Node *x; - int16 *f; + INT16 *f; OPT_Const *xval, *yval; struct ConstOp__13 *lnk; } *ConstOp__13_s; -static int16 ConstCmp__14 (void); +static INT16 ConstCmp__14 (void); -static int16 ConstCmp__14 (void) +static INT16 ConstCmp__14 (void) { - int16 res; + INT16 res; switch (*ConstOp__13_s->f) { case 0: res = 9; @@ -813,11 +813,11 @@ static int16 ConstCmp__14 (void) return res; } -static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) +static void OPB_ConstOp (INT16 op, OPT_Node x, OPT_Node y) { - int16 f, g; + INT16 f, g; OPT_Const xval = NIL, yval = NIL; - int64 xv, yv; + INT64 xv, yv; BOOLEAN temp; struct ConstOp__13 _s; _s.x = &x; @@ -1097,8 +1097,8 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) static void OPB_Convert (OPT_Node *x, OPT_Struct typ) { OPT_Node node = NIL; - int16 f, g; - int64 k; + INT16 f, g; + INT64 k; LONGREAL r; f = (*x)->typ->form; g = typ->form; @@ -1136,12 +1136,12 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) OPB_err(203); r = (LONGREAL)1; } - (*x)->conval->intval = (int32)__ENTIER(r); + (*x)->conval->intval = (INT32)__ENTIER(r); OPB_SetIntType(*x); } } (*x)->obj = NIL; - } else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((int16)(*x)->left->typ->form < f || f > g))) { + } else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((INT16)(*x)->left->typ->form < f || f > g))) { if ((*x)->left->typ == typ) { *x = (*x)->left; } @@ -1155,14 +1155,14 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) } static struct Op__38 { - int16 *f, *g; + INT16 *f, *g; struct Op__38 *lnk; } *Op__38_s; -static void NewOp__39 (int8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y); +static void NewOp__39 (INT8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y); static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y); -static void NewOp__39 (int8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y) +static void NewOp__39 (INT8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y) { OPT_Node node = NIL; node = OPT_NewNode(12); @@ -1203,13 +1203,13 @@ static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) return ok; } -void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) +void OPB_Op (INT8 op, OPT_Node *x, OPT_Node y) { - int16 f, g; + INT16 f, g; OPT_Node t = NIL, z = NIL; OPT_Struct typ = NIL; BOOLEAN do_; - int64 val; + INT64 val; struct Op__38 _s; _s.f = &f; _s.g = &g; @@ -1489,7 +1489,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) void OPB_SetRange (OPT_Node *x, OPT_Node y) { - int64 k, l; + INT64 k, l; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); } else if (((*x)->typ->form == 4 && y->typ->form == 4)) { @@ -1525,7 +1525,7 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y) void OPB_SetElem (OPT_Node *x) { - int64 k; + INT64 k; if ((*x)->class == 8 || (*x)->class == 9) { OPB_err(126); } else if ((*x)->typ->form != 4) { @@ -1549,7 +1549,7 @@ void OPB_SetElem (OPT_Node *x) static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) { OPT_Struct y = NIL; - int16 f, g; + INT16 f, g; OPT_Struct p = NIL, q = NIL; y = ynode->typ; f = x->form; @@ -1673,9 +1673,9 @@ static void OPB_CheckLeaf (OPT_Node x, BOOLEAN dynArrToo) { } -void OPB_StPar0 (OPT_Node *par0, int16 fctno) +void OPB_StPar0 (OPT_Node *par0, INT16 fctno) { - int16 f; + INT16 f; OPT_Struct typ = NIL; OPT_Node x = NIL; x = *par0; @@ -1983,9 +1983,9 @@ static struct StPar1__53 { struct StPar1__53 *lnk; } *StPar1__53_s; -static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right); +static OPT_Node NewOp__54 (INT8 class, INT8 subcl, OPT_Node left, OPT_Node right); -static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right) +static OPT_Node NewOp__54 (INT8 class, INT8 subcl, OPT_Node left, OPT_Node right) { OPT_Node node = NIL; node = OPT_NewNode(class); @@ -1995,9 +1995,9 @@ static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right return node; } -void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) +void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno) { - int16 f, L; + INT16 f, L; OPT_Struct typ = NIL; OPT_Node p = NIL, t = NIL; struct StPar1__53 _s; @@ -2026,7 +2026,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (f == 4) { - if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval >= (int64)__ASHL(p->typ->size, 3)))) { + if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval >= (INT64)__ASHL(p->typ->size, 3)))) { OPB_err(202); } p = NewOp__54(19, fctno, p, x); @@ -2091,8 +2091,8 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) OPB_err(208); p->conval->intval = 1; } else if (x->conval->intval >= 0) { - if (__ABS(p->conval->intval) <= __DIV(9223372036854775807, (int64)__ASH(1, x->conval->intval))) { - p->conval->intval = p->conval->intval * (int64)__ASH(1, x->conval->intval); + if (__ABS(p->conval->intval) <= __DIV(9223372036854775807, (INT64)__ASH(1, x->conval->intval))) { + p->conval->intval = p->conval->intval * (INT64)__ASH(1, x->conval->intval); } else { OPB_err(208); p->conval->intval = 1; @@ -2239,10 +2239,10 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) StPar1__53_s = _s.lnk; } -void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n) +void OPB_StParN (OPT_Node *par0, OPT_Node x, INT16 fctno, INT16 n) { OPT_Node node = NIL; - int16 f; + INT16 f; OPT_Node p = NIL; p = *par0; f = x->typ->form; @@ -2284,9 +2284,9 @@ void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n) *par0 = p; } -void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno) +void OPB_StFct (OPT_Node *par0, INT8 fctno, INT16 parno) { - int16 dim; + INT16 dim; OPT_Node x = NIL, p = NIL; p = *par0; if (fctno <= 19) { @@ -2350,7 +2350,7 @@ void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno) static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpar) { - int16 f; + INT16 f; f = atyp->comp; ftyp = ftyp->BaseTyp; atyp = atyp->BaseTyp; @@ -2459,7 +2459,7 @@ void OPB_Param (OPT_Node ap, OPT_Object fp) } } -void OPB_StaticLink (int8 dlev) +void OPB_StaticLink (INT8 dlev) { OPT_Object scope = NIL; scope = OPT_topScope; @@ -2474,7 +2474,7 @@ void OPB_Call (OPT_Node *x, OPT_Node apar, OPT_Object fp) { OPT_Struct typ = NIL; OPT_Node p = NIL; - int8 lev; + INT8 lev; if ((*x)->class == 9) { typ = (*x)->typ; lev = (*x)->obj->mnolev; @@ -2534,7 +2534,7 @@ void OPB_Return (OPT_Node *x, OPT_Object proc) void OPB_Assign (OPT_Node *x, OPT_Node y) { OPT_Node z = NIL; - int8 subcl; + INT8 subcl; if ((*x)->class >= 7) { OPB_err(56); } diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index 22742961..bc644f4c 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h @@ -13,7 +13,7 @@ import void OPB_Assign (OPT_Node *x, OPT_Node y); import void OPB_Call (OPT_Node *x, OPT_Node apar, OPT_Object fp); import void OPB_CheckParameters (OPT_Object fp, OPT_Object ap, BOOLEAN checkNames); -import void OPB_Construct (int8 class, OPT_Node *x, OPT_Node y); +import void OPB_Construct (INT8 class, OPT_Node *x, OPT_Node y); import void OPB_DeRef (OPT_Node *x); import OPT_Node OPB_EmptySet (void); import void OPB_Enter (OPT_Node *procdec, OPT_Node stat, OPT_Object proc); @@ -22,25 +22,25 @@ import void OPB_In (OPT_Node *x, OPT_Node y); import void OPB_Index (OPT_Node *x, OPT_Node y); import void OPB_Inittd (OPT_Node *inittd, OPT_Node *last, OPT_Struct typ); import void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y); -import void OPB_MOp (int8 op, OPT_Node *x); +import void OPB_MOp (INT8 op, OPT_Node *x); import OPT_Node OPB_NewBoolConst (BOOLEAN boolval); -import OPT_Node OPB_NewIntConst (int64 intval); +import OPT_Node OPB_NewIntConst (INT64 intval); import OPT_Node OPB_NewLeaf (OPT_Object obj); import OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ); -import OPT_Node OPB_NewString (OPS_String str, int64 len); +import OPT_Node OPB_NewString (OPS_String str, INT64 len); import OPT_Node OPB_Nil (void); -import void OPB_Op (int8 op, OPT_Node *x, OPT_Node y); +import void OPB_Op (INT8 op, OPT_Node *x, OPT_Node y); import void OPB_OptIf (OPT_Node *x); import void OPB_Param (OPT_Node ap, OPT_Object fp); import void OPB_PrepCall (OPT_Node *x, OPT_Object *fpar); import void OPB_Return (OPT_Node *x, OPT_Object proc); import void OPB_SetElem (OPT_Node *x); import void OPB_SetRange (OPT_Node *x, OPT_Node y); -import void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno); -import void OPB_StPar0 (OPT_Node *par0, int16 fctno); -import void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno); -import void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n); -import void OPB_StaticLink (int8 dlev); +import void OPB_StFct (OPT_Node *par0, INT8 fctno, INT16 parno); +import void OPB_StPar0 (OPT_Node *par0, INT16 fctno); +import void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno); +import void OPB_StParN (OPT_Node *par0, OPT_Node x, INT16 fctno, INT16 n); +import void OPB_StaticLink (INT8 dlev); import void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard); import void *OPB__init(void); diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 27ab3d15..0ed7bf75 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "Configuration.h" @@ -11,9 +11,9 @@ #include "OPT.h" -static int16 OPC_indentLevel; -static int8 OPC_hashtab[105]; -static CHAR OPC_keytab[50][9]; +static INT16 OPC_indentLevel; +static INT8 OPC_hashtab[105]; +static CHAR OPC_keytab[60][9]; static BOOLEAN OPC_GlbPtrs; static CHAR OPC_BodyNameExt[13]; @@ -23,12 +23,12 @@ static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames); export OPT_Object OPC_BaseTProc (OPT_Object obj); export void OPC_BegBlk (void); export void OPC_BegStat (void); -static void OPC_CProcDefs (OPT_Object obj, int16 vis); -export void OPC_Case (int64 caseVal, int16 form); -static void OPC_CharacterLiteral (int64 c); -export void OPC_Cmp (int16 rel); +static void OPC_CProcDefs (OPT_Object obj, INT16 vis); +export void OPC_Case (INT64 caseVal, INT16 form); +static void OPC_CharacterLiteral (INT64 c); +export void OPC_Cmp (INT16 rel); export void OPC_CompleteIdent (OPT_Object obj); -export void OPC_Constant (OPT_Const con, int16 form); +export void OPC_Constant (OPT_Const con, INT16 form); static void OPC_DeclareBase (OPT_Object dcl); static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef); static void OPC_DeclareParams (OPT_Object par, BOOLEAN macro); @@ -45,45 +45,45 @@ export void OPC_EnterBody (void); export void OPC_EnterProc (OPT_Object proc); export void OPC_ExitBody (void); export void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet); -static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, int32 *off, int32 *n, int32 *curAlign); -static void OPC_FillGap (int32 gap, int32 off, int32 align, int32 *n, int32 *curAlign); +static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, INT32 *off, INT32 *n, INT32 *curAlign); +static void OPC_FillGap (INT32 gap, INT32 off, INT32 align, INT32 *n, INT32 *curAlign); export void OPC_GenBdy (OPT_Node n); -static void OPC_GenDynTypes (OPT_Node n, int16 vis); +static void OPC_GenDynTypes (OPT_Node n, INT16 vis); export void OPC_GenEnumPtrs (OPT_Object var); export void OPC_GenHdr (OPT_Node n); export void OPC_GenHdrIncludes (void); static void OPC_GenHeaderMsg (void); -export void OPC_Halt (int32 n); +export void OPC_Halt (INT32 n); export void OPC_Ident (OPT_Object obj); -static void OPC_IdentList (OPT_Object obj, int16 vis); +static void OPC_IdentList (OPT_Object obj, INT16 vis); static void OPC_Include (CHAR *name, LONGINT name__len); -static void OPC_IncludeImports (OPT_Object obj, int16 vis); +static void OPC_IncludeImports (OPT_Object obj, INT16 vis); export void OPC_Increment (BOOLEAN decrement); -export void OPC_Indent (int16 count); +export void OPC_Indent (INT16 count); export void OPC_Init (void); static void OPC_InitImports (OPT_Object obj); static void OPC_InitKeywords (void); export void OPC_InitTDesc (OPT_Struct typ); static void OPC_InitTProcs (OPT_Object typ, OPT_Object obj); -export void OPC_IntLiteral (int64 n, int32 size); -export void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim); +export void OPC_IntLiteral (INT64 n, INT32 size); +export void OPC_Len (OPT_Object obj, OPT_Struct array, INT64 dim); static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName); -static int16 OPC_Length (CHAR *s, LONGINT s__len); +static INT16 OPC_Length (CHAR *s, LONGINT s__len); export BOOLEAN OPC_NeedsRetval (OPT_Object proc); -export int32 OPC_NofPtrs (OPT_Struct typ); -static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len); +export INT32 OPC_NofPtrs (OPT_Struct typ); +static INT16 OPC_PerfectHash (CHAR *s, LONGINT s__len); static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len); static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define); -static void OPC_ProcPredefs (OPT_Object obj, int8 vis); +static void OPC_ProcPredefs (OPT_Object obj, INT8 vis); static void OPC_PutBase (OPT_Struct typ); -static void OPC_PutPtrOffsets (OPT_Struct typ, int32 adr, int32 *cnt); +static void OPC_PutPtrOffsets (OPT_Struct typ, INT32 adr, INT32 *cnt); static void OPC_RegCmds (OPT_Object obj); export void OPC_SetInclude (BOOLEAN exclude); static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause); -static void OPC_Str1 (CHAR *s, LONGINT s__len, int32 x); -static void OPC_StringLiteral (CHAR *s, LONGINT s__len, int32 l); +static void OPC_Str1 (CHAR *s, LONGINT s__len, INT32 x); +static void OPC_StringLiteral (CHAR *s, LONGINT s__len, INT32 l); export void OPC_TDescDecl (OPT_Struct typ); -export void OPC_TypeDefs (OPT_Object obj, int16 vis); +export void OPC_TypeDefs (OPT_Object obj, INT16 vis); export void OPC_TypeOf (OPT_Object ap); static BOOLEAN OPC_Undefined (OPT_Object obj); @@ -94,14 +94,14 @@ void OPC_Init (void) __MOVE("__init(void)", OPC_BodyNameExt, 13); } -void OPC_Indent (int16 count) +void OPC_Indent (INT16 count) { OPC_indentLevel += count; } void OPC_BegStat (void) { - int16 i; + INT16 i; i = OPC_indentLevel; while (i > 0) { OPM_Write(0x09); @@ -137,10 +137,10 @@ void OPC_EndBlk0 (void) OPM_Write('}'); } -static void OPC_Str1 (CHAR *s, LONGINT s__len, int32 x) +static void OPC_Str1 (CHAR *s, LONGINT s__len, INT32 x) { CHAR ch; - int16 i; + INT16 i; __DUP(s, s__len, CHAR); ch = s[0]; i = 0; @@ -156,9 +156,9 @@ static void OPC_Str1 (CHAR *s, LONGINT s__len, int32 x) __DEL(s); } -static int16 OPC_Length (CHAR *s, LONGINT s__len) +static INT16 OPC_Length (CHAR *s, LONGINT s__len) { - int16 i; + INT16 i; i = 0; while (s[__X(i, s__len)] != 0x00) { i += 1; @@ -166,13 +166,13 @@ static int16 OPC_Length (CHAR *s, LONGINT s__len) return i; } -static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len) +static INT16 OPC_PerfectHash (CHAR *s, LONGINT s__len) { - int16 i, h; + INT16 i, h; i = 0; h = 0; while ((s[__X(i, s__len)] != 0x00 && i < 5)) { - h = 3 * h + (int16)s[__X(i, s__len)]; + h = 3 * h + (INT16)s[__X(i, s__len)]; i += 1; } return (int)__MOD(h, 105); @@ -180,25 +180,25 @@ static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len) void OPC_Ident (OPT_Object obj) { - int16 mode, level, h; + INT16 mode, level, h; mode = obj->mode; level = obj->mnolev; if ((__IN(mode, 0x62, 32) && level > 0) || __IN(mode, 0x14, 32)) { OPM_WriteStringVar((void*)obj->name, 256); h = OPC_PerfectHash((void*)obj->name, 256); if (OPC_hashtab[__X(h, 105)] >= 0) { - if (__STRCMP(OPC_keytab[__X(OPC_hashtab[__X(h, 105)], 50)], obj->name) == 0) { + if (__STRCMP(OPC_keytab[__X(OPC_hashtab[__X(h, 105)], 60)], obj->name) == 0) { OPM_Write('_'); } } } else if ((mode == 5 && __IN(obj->typ->form, 0x90, 32))) { if (obj->typ == OPT_adrtyp) { - OPM_WriteString((CHAR*)"address", 8); + OPM_WriteString((CHAR*)"ADDRESS", 8); } else { if (obj->typ->form == 4) { - OPM_WriteString((CHAR*)"int", 4); + OPM_WriteString((CHAR*)"INT", 4); } else { - OPM_WriteString((CHAR*)"uint", 5); + OPM_WriteString((CHAR*)"UINT", 5); } OPM_WriteInt(__ASHL(obj->typ->size, 3)); } @@ -224,7 +224,7 @@ void OPC_Ident (OPT_Object obj) static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause) { - int16 pointers; + INT16 pointers; *openClause = 0; if (((typ->strobj == NIL || typ->strobj->name[0] == 0x00) && typ->comp != 4)) { if (__IN(typ->comp, 0x0c, 32)) { @@ -260,7 +260,7 @@ static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef) { OPT_Struct typ = NIL; BOOLEAN varPar, openClause; - int16 form, comp; + INT16 form, comp; typ = dcl->typ; varPar = ((dcl->mode == 2 && typ->comp != 2) || typ->comp == 3) || scopeDef; OPC_Stars(typ, &openClause); @@ -324,8 +324,8 @@ static void OPC_DeclareBase (OPT_Object dcl) { OPT_Struct typ = NIL, prev = NIL; OPT_Object obj = NIL; - int16 nofdims; - int32 off, n, dummy; + INT16 nofdims; + INT32 off, n, dummy; typ = dcl->typ; prev = typ; while ((((((((typ->strobj == NIL || typ->comp == 3) || OPC_Undefined(typ->strobj)) && typ->comp != 4)) && typ->form != 10)) && !((typ->form == 11 && typ->BaseTyp->comp == 3)))) { @@ -384,11 +384,11 @@ static void OPC_DeclareBase (OPT_Object dcl) } } -int32 OPC_NofPtrs (OPT_Struct typ) +INT32 OPC_NofPtrs (OPT_Struct typ) { OPT_Object fld = NIL; OPT_Struct btyp = NIL; - int32 n; + INT32 n; if ((typ->form == 11 && typ->sysflag == 0)) { return 1; } else if ((typ->comp == 4 && __MASK(typ->sysflag, -256) == 0)) { @@ -422,11 +422,11 @@ int32 OPC_NofPtrs (OPT_Struct typ) __RETCHK; } -static void OPC_PutPtrOffsets (OPT_Struct typ, int32 adr, int32 *cnt) +static void OPC_PutPtrOffsets (OPT_Struct typ, INT32 adr, INT32 *cnt) { OPT_Object fld = NIL; OPT_Struct btyp = NIL; - int32 n, i; + INT32 n, i; if ((typ->form == 11 && typ->sysflag == 0)) { OPM_WriteInt(adr); OPM_WriteString((CHAR*)", ", 3); @@ -502,7 +502,7 @@ static void OPC_PutBase (OPT_Struct typ) static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName) { OPT_Struct typ = NIL; - int16 dim; + INT16 dim; if (showParamName) { OPC_Ident(par); OPM_WriteString((CHAR*)"__len", 6); @@ -599,7 +599,7 @@ static void OPC_DeclareTProcs (OPT_Object obj, BOOLEAN *empty) OPT_Object OPC_BaseTProc (OPT_Object obj) { OPT_Struct typ = NIL, base = NIL; - int32 mno; + INT32 mno; typ = obj->link->typ; if (typ->form == 11) { typ = typ->BaseTyp; @@ -722,7 +722,7 @@ static void OPC_DefineType (OPT_Struct str) static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len) { - int16 i; + INT16 i; __DUP(y, y__len, CHAR); i = 0; while ((*x)[__X(i + 1, 256)] == y[__X(i, y__len)]) { @@ -732,14 +732,14 @@ static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len) return y[__X(i, y__len)] == 0x00; } -static void OPC_CProcDefs (OPT_Object obj, int16 vis) +static void OPC_CProcDefs (OPT_Object obj, INT16 vis) { - int16 i; + INT16 i; OPT_ConstExt ext = NIL; - int16 _for__7; + INT16 _for__7; if (obj != NIL) { OPC_CProcDefs(obj->left, vis); - if ((((obj->mode == 9 && (int16)obj->vis >= vis)) && obj->adr == 1)) { + if ((((obj->mode == 9 && (INT16)obj->vis >= vis)) && obj->adr == 1)) { ext = obj->conval->ext; i = 1; if (((*ext)[1] != '#' && !(OPC_Prefixed(ext, (CHAR*)"extern ", 8) || OPC_Prefixed(ext, (CHAR*)"import ", 8)))) { @@ -748,7 +748,7 @@ static void OPC_CProcDefs (OPT_Object obj, int16 vis) OPC_DeclareParams(obj->link, 1); OPM_Write(0x09); } - _for__7 = (int16)(*obj->conval->ext)[0]; + _for__7 = (INT16)(*obj->conval->ext)[0]; i = i; while (i <= _for__7) { OPM_Write((*obj->conval->ext)[__X(i, 256)]); @@ -760,7 +760,7 @@ static void OPC_CProcDefs (OPT_Object obj, int16 vis) } } -void OPC_TypeDefs (OPT_Object obj, int16 vis) +void OPC_TypeDefs (OPT_Object obj, INT16 vis) { if (obj != NIL) { OPC_TypeDefs(obj->left, vis); @@ -792,7 +792,7 @@ static void OPC_DefAnonRecs (OPT_Node n) void OPC_TDescDecl (OPT_Struct typ) { - int32 nofptrs; + INT32 nofptrs; OPT_Object o = NIL; OPC_BegStat(); OPM_WriteString((CHAR*)"__TDESC(", 9); @@ -829,9 +829,9 @@ void OPC_InitTDesc (OPT_Struct typ) } } -static void OPC_FillGap (int32 gap, int32 off, int32 align, int32 *n, int32 *curAlign) +static void OPC_FillGap (INT32 gap, INT32 off, INT32 align, INT32 *n, INT32 *curAlign) { - int32 adr; + INT32 adr; adr = off; OPT_Align(&adr, align); if ((*curAlign < align && gap - (adr - off) >= align)) { @@ -839,13 +839,13 @@ static void OPC_FillGap (int32 gap, int32 off, int32 align, int32 *n, int32 *cur OPC_BegStat(); switch (align) { case 2: - OPM_WriteString((CHAR*)"int16", 6); + OPM_WriteString((CHAR*)"INT16", 6); break; case 4: - OPM_WriteString((CHAR*)"int32", 6); + OPM_WriteString((CHAR*)"INT32", 6); break; case 8: - OPM_WriteString((CHAR*)"int64", 6); + OPM_WriteString((CHAR*)"INT64", 6); break; default: OPM_LogWLn(); @@ -866,11 +866,11 @@ static void OPC_FillGap (int32 gap, int32 off, int32 align, int32 *n, int32 *cur } } -static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, int32 *off, int32 *n, int32 *curAlign) +static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, INT32 *off, INT32 *n, INT32 *curAlign) { OPT_Object fld = NIL; OPT_Struct base = NIL; - int32 gap, adr, align, fldAlign; + INT32 gap, adr, align, fldAlign; fld = typ->link; align = __MASK(typ->align, -65536); if (typ->BaseTyp != NIL) { @@ -926,16 +926,16 @@ static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, int32 *off, int32 *n, i } } -static void OPC_IdentList (OPT_Object obj, int16 vis) +static void OPC_IdentList (OPT_Object obj, INT16 vis) { OPT_Struct base = NIL; BOOLEAN first; - int16 lastvis; + INT16 lastvis; base = NIL; first = 1; while ((obj != NIL && obj->mode != 13)) { if ((__IN(vis, 0x05, 32) || (vis == 1 && obj->vis != 0)) || (vis == 3 && !obj->leaf)) { - if (obj->typ != base || (int16)obj->vis != lastvis) { + if (obj->typ != base || (INT16)obj->vis != lastvis) { if (!first) { OPC_EndStat(); } @@ -974,7 +974,7 @@ static void OPC_IdentList (OPT_Object obj, int16 vis) } else if ((obj->mode == 2 && obj->typ->comp == 4)) { OPC_EndStat(); OPC_BegStat(); - OPM_WriteString((CHAR*)"address *", 10); + OPM_WriteString((CHAR*)"ADDRESS *", 10); OPC_Ident(obj); OPM_WriteString((CHAR*)"__typ", 6); base = NIL; @@ -1011,7 +1011,7 @@ static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames) OPM_WriteString((CHAR*)", LONGINT ", 11); OPC_LenList(obj, 1, showParamNames); } else if ((obj->mode == 2 && obj->typ->comp == 4)) { - OPM_WriteString((CHAR*)", address *", 12); + OPM_WriteString((CHAR*)", ADDRESS *", 12); if (showParamNames) { OPC_Ident(obj); OPM_WriteString((CHAR*)"__typ", 6); @@ -1044,7 +1044,7 @@ static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define) OPM_WriteLn(); } -static void OPC_ProcPredefs (OPT_Object obj, int8 vis) +static void OPC_ProcPredefs (OPT_Object obj, INT8 vis) { if (obj != NIL) { OPC_ProcPredefs(obj->left, vis); @@ -1074,18 +1074,18 @@ static void OPC_Include (CHAR *name, LONGINT name__len) __DEL(name); } -static void OPC_IncludeImports (OPT_Object obj, int16 vis) +static void OPC_IncludeImports (OPT_Object obj, INT16 vis) { if (obj != NIL) { OPC_IncludeImports(obj->left, vis); - if ((((obj->mode == 11 && obj->mnolev != 0)) && (int16)OPT_GlbMod[__X(-obj->mnolev, 64)]->vis >= vis)) { + if ((((obj->mode == 11 && obj->mnolev != 0)) && (INT16)OPT_GlbMod[__X(-obj->mnolev, 64)]->vis >= vis)) { OPC_Include(OPT_GlbMod[__X(-obj->mnolev, 64)]->name, 256); } OPC_IncludeImports(obj->right, vis); } } -static void OPC_GenDynTypes (OPT_Node n, int16 vis) +static void OPC_GenDynTypes (OPT_Node n, INT16 vis) { OPT_Struct typ = NIL; while ((n != NIL && n->class == 14)) { @@ -1099,7 +1099,7 @@ static void OPC_GenDynTypes (OPT_Node n, int16 vis) } else { OPM_WriteString((CHAR*)"export ", 8); } - OPM_WriteString((CHAR*)"address *", 10); + OPM_WriteString((CHAR*)"ADDRESS *", 10); OPC_Andent(typ); OPM_WriteString((CHAR*)"__typ", 6); OPC_EndStat(); @@ -1134,7 +1134,7 @@ void OPC_GenHdr (OPT_Node n) static void OPC_GenHeaderMsg (void) { - int16 i; + INT16 i; OPM_WriteString((CHAR*)"/* ", 4); OPM_WriteString((CHAR*)"voc", 4); OPM_Write(' '); @@ -1222,16 +1222,16 @@ void OPC_GenBdy (OPT_Node n) OPM_currFile = 1; OPC_GenHeaderMsg(); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#define SHORTINT int", 21); + OPM_WriteString((CHAR*)"#define SHORTINT INT", 21); OPM_WriteInt(__ASHL(OPT_sinttyp->size, 3)); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#define INTEGER int", 21); + OPM_WriteString((CHAR*)"#define INTEGER INT", 21); OPM_WriteInt(__ASHL(OPT_inttyp->size, 3)); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#define LONGINT int", 21); + OPM_WriteString((CHAR*)"#define LONGINT INT", 21); OPM_WriteInt(__ASHL(OPT_linttyp->size, 3)); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#define SET uint", 22); + OPM_WriteString((CHAR*)"#define SET UINT", 22); OPM_WriteInt(__ASHL(OPT_settyp->size, 3)); OPM_WriteLn(); OPM_WriteLn(); @@ -1288,7 +1288,7 @@ static void OPC_InitImports (OPT_Object obj) void OPC_GenEnumPtrs (OPT_Object var) { OPT_Struct typ = NIL; - int32 n; + INT32 n; OPC_GlbPtrs = 0; while (var != NIL) { typ = var->typ; @@ -1438,7 +1438,7 @@ void OPC_EnterProc (OPT_Object proc) { OPT_Object var = NIL, scope = NIL; OPT_Struct typ = NIL; - int16 dim; + INT16 dim; if (proc->vis != 1) { OPM_WriteString((CHAR*)"static ", 8); } @@ -1652,7 +1652,7 @@ void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet) void OPC_CompleteIdent (OPT_Object obj) { - int16 comp, level; + INT16 comp, level; level = obj->mnolev; if (obj->adr == 1) { if (obj->typ->comp == 4) { @@ -1681,10 +1681,10 @@ void OPC_CompleteIdent (OPT_Object obj) void OPC_TypeOf (OPT_Object ap) { - int16 i; + INT16 i; __ASSERT(ap->typ->comp == 4, 0); if (ap->mode == 2) { - if ((int16)ap->mnolev != OPM_level) { + if ((INT16)ap->mnolev != OPM_level) { OPM_WriteStringVar((void*)ap->scope->name, 256); OPM_WriteString((CHAR*)"_s->", 5); OPC_Ident(ap); @@ -1700,7 +1700,7 @@ void OPC_TypeOf (OPT_Object ap) } } -void OPC_Cmp (int16 rel) +void OPC_Cmp (INT16 rel) { switch (rel) { case 9: @@ -1729,7 +1729,7 @@ void OPC_Cmp (int16 rel) } } -static void OPC_CharacterLiteral (int64 c) +static void OPC_CharacterLiteral (INT64 c) { if (c < 32 || c > 126) { OPM_WriteString((CHAR*)"0x", 3); @@ -1744,15 +1744,15 @@ static void OPC_CharacterLiteral (int64 c) } } -static void OPC_StringLiteral (CHAR *s, LONGINT s__len, int32 l) +static void OPC_StringLiteral (CHAR *s, LONGINT s__len, INT32 l) { - int32 i; - int16 c; + INT32 i; + INT16 c; __DUP(s, s__len, CHAR); OPM_Write('"'); i = 0; while (i < l) { - c = (int16)s[__X(i, s__len)]; + c = (INT16)s[__X(i, s__len)]; if (c < 32 || c > 126) { OPM_Write('\\'); OPM_Write((CHAR)(48 + __ASHR(c, 6))); @@ -1772,7 +1772,7 @@ static void OPC_StringLiteral (CHAR *s, LONGINT s__len, int32 l) __DEL(s); } -void OPC_Case (int64 caseVal, int16 form) +void OPC_Case (INT64 caseVal, INT16 form) { CHAR ch; OPM_WriteString((CHAR*)"case ", 6); @@ -1810,15 +1810,15 @@ void OPC_Increment (BOOLEAN decrement) } } -void OPC_Halt (int32 n) +void OPC_Halt (INT32 n) { OPC_Str1((CHAR*)"__HALT(#)", 10, n); } -void OPC_IntLiteral (int64 n, int32 size) +void OPC_IntLiteral (INT64 n, INT32 size) { if ((((size > 4 && n <= 2147483647)) && n > (-2147483647-1))) { - OPM_WriteString((CHAR*)"((int", 6); + OPM_WriteString((CHAR*)"((INT", 6); OPM_WriteInt(__ASHL(size, 3)); OPM_WriteString((CHAR*)")(", 3); OPM_WriteInt(n); @@ -1828,7 +1828,7 @@ void OPC_IntLiteral (int64 n, int32 size) } } -void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim) +void OPC_Len (OPT_Object obj, OPT_Struct array, INT64 dim) { if (array->comp == 3) { OPC_CompleteIdent(obj); @@ -1845,11 +1845,11 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim) } } -void OPC_Constant (OPT_Const con, int16 form) +void OPC_Constant (OPT_Const con, INT16 form) { - int16 i; - uint64 s; - int64 hex; + INT16 i; + UINT64 s; + INT64 hex; BOOLEAN skipLeading; switch (form) { case 1: @@ -1908,7 +1908,7 @@ void OPC_Constant (OPT_Const con, int16 form) } static struct InitKeywords__46 { - int8 *n; + INT8 *n; struct InitKeywords__46 *lnk; } *InitKeywords__46_s; @@ -1916,18 +1916,18 @@ static void Enter__47 (CHAR *s, LONGINT s__len); static void Enter__47 (CHAR *s, LONGINT s__len) { - int16 h; + INT16 h; __DUP(s, s__len, CHAR); h = OPC_PerfectHash((void*)s, s__len); OPC_hashtab[__X(h, 105)] = *InitKeywords__46_s->n; - __COPY(s, OPC_keytab[__X(*InitKeywords__46_s->n, 50)], 9); + __COPY(s, OPC_keytab[__X(*InitKeywords__46_s->n, 60)], 9); *InitKeywords__46_s->n += 1; __DEL(s); } static void OPC_InitKeywords (void) { - int8 n, i; + INT8 n, i; struct InitKeywords__46 _s; _s.n = &n; _s.lnk = InitKeywords__46_s; @@ -1938,7 +1938,24 @@ static void OPC_InitKeywords (void) OPC_hashtab[__X(i, 105)] = -1; i += 1; } + Enter__47((CHAR*)"ADDRESS", 8); + Enter__47((CHAR*)"INT16", 6); + Enter__47((CHAR*)"INT32", 6); + Enter__47((CHAR*)"INT64", 6); + Enter__47((CHAR*)"INT8", 5); + Enter__47((CHAR*)"UINT16", 7); + Enter__47((CHAR*)"UINT32", 7); + Enter__47((CHAR*)"UINT64", 7); + Enter__47((CHAR*)"UINT8", 6); Enter__47((CHAR*)"address", 8); + Enter__47((CHAR*)"int16", 6); + Enter__47((CHAR*)"int32", 6); + Enter__47((CHAR*)"int64", 6); + Enter__47((CHAR*)"int8", 5); + Enter__47((CHAR*)"uint16", 7); + Enter__47((CHAR*)"uint32", 7); + Enter__47((CHAR*)"uint64", 7); + Enter__47((CHAR*)"uint8", 6); Enter__47((CHAR*)"asm", 4); Enter__47((CHAR*)"auto", 5); Enter__47((CHAR*)"break", 6); @@ -1960,10 +1977,6 @@ static void OPC_InitKeywords (void) Enter__47((CHAR*)"if", 3); Enter__47((CHAR*)"import", 7); Enter__47((CHAR*)"int", 4); - Enter__47((CHAR*)"int16", 6); - Enter__47((CHAR*)"int32", 6); - Enter__47((CHAR*)"int64", 6); - Enter__47((CHAR*)"int8", 5); Enter__47((CHAR*)"long", 5); Enter__47((CHAR*)"register", 9); Enter__47((CHAR*)"return", 7); @@ -1975,10 +1988,6 @@ static void OPC_InitKeywords (void) Enter__47((CHAR*)"struct", 7); Enter__47((CHAR*)"switch", 7); Enter__47((CHAR*)"typedef", 8); - Enter__47((CHAR*)"uint16", 7); - Enter__47((CHAR*)"uint32", 7); - Enter__47((CHAR*)"uint64", 7); - Enter__47((CHAR*)"uint8", 6); Enter__47((CHAR*)"union", 6); Enter__47((CHAR*)"unsigned", 9); Enter__47((CHAR*)"void", 5); diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index bbfd1911..f7fc51f9 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h @@ -13,10 +13,10 @@ import void OPC_Andent (OPT_Struct typ); import OPT_Object OPC_BaseTProc (OPT_Object obj); import void OPC_BegBlk (void); import void OPC_BegStat (void); -import void OPC_Case (int64 caseVal, int16 form); -import void OPC_Cmp (int16 rel); +import void OPC_Case (INT64 caseVal, INT16 form); +import void OPC_Cmp (INT16 rel); import void OPC_CompleteIdent (OPT_Object obj); -import void OPC_Constant (OPT_Const con, int16 form); +import void OPC_Constant (OPT_Const con, INT16 form); import void OPC_DefineInter (OPT_Object proc); import void OPC_EndBlk (void); import void OPC_EndBlk0 (void); @@ -29,19 +29,19 @@ import void OPC_GenBdy (OPT_Node n); import void OPC_GenEnumPtrs (OPT_Object var); import void OPC_GenHdr (OPT_Node n); import void OPC_GenHdrIncludes (void); -import void OPC_Halt (int32 n); +import void OPC_Halt (INT32 n); import void OPC_Ident (OPT_Object obj); import void OPC_Increment (BOOLEAN decrement); -import void OPC_Indent (int16 count); +import void OPC_Indent (INT16 count); import void OPC_Init (void); import void OPC_InitTDesc (OPT_Struct typ); -import void OPC_IntLiteral (int64 n, int32 size); -import void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim); +import void OPC_IntLiteral (INT64 n, INT32 size); +import void OPC_Len (OPT_Object obj, OPT_Struct array, INT64 dim); import BOOLEAN OPC_NeedsRetval (OPT_Object proc); -import int32 OPC_NofPtrs (OPT_Struct typ); +import INT32 OPC_NofPtrs (OPT_Struct typ); import void OPC_SetInclude (BOOLEAN exclude); import void OPC_TDescDecl (OPT_Struct typ); -import void OPC_TypeDefs (OPT_Object obj, int16 vis); +import void OPC_TypeDefs (OPT_Object obj, INT16 vis); import void OPC_TypeOf (OPT_Object ap); import void *OPC__init(void); diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 458de3f2..be4ec200 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "Configuration.h" @@ -22,81 +22,81 @@ typedef static CHAR OPM_SourceFileName[256]; static CHAR OPM_GlobalModel[10]; export CHAR OPM_Model[10]; -static int16 OPM_GlobalAddressSize; -export int16 OPM_AddressSize; -static int16 OPM_GlobalAlignment; -export int16 OPM_Alignment; -export uint32 OPM_GlobalOptions, OPM_Options; -export int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; -export int64 OPM_MaxIndex; +static INT16 OPM_GlobalAddressSize; +export INT16 OPM_AddressSize; +static INT16 OPM_GlobalAlignment; +export INT16 OPM_Alignment; +export UINT32 OPM_GlobalOptions, OPM_Options; +export INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; +export INT64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; -export int32 OPM_curpos, OPM_errpos, OPM_breakpc; -export int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; +export INT32 OPM_curpos, OPM_errpos, OPM_breakpc; +export INT16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; export CHAR OPM_modName[32]; export CHAR OPM_objname[64]; -static int32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; +static INT32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; static Texts_Reader OPM_inR; static Texts_Text OPM_Log; static Texts_Writer OPM_W; static Files_Rider OPM_oldSF, OPM_newSF; static Files_Rider OPM_R[3]; static Files_File OPM_oldSFile, OPM_newSFile, OPM_HFile, OPM_BFile, OPM_HIFile; -static int16 OPM_S; +static INT16 OPM_S; export CHAR OPM_ResourceDir[1024]; -static void OPM_Append (Files_Rider *R, address *R__typ, Files_File F); +static void OPM_Append (Files_Rider *R, ADDRESS *R__typ, Files_File F); export void OPM_CloseFiles (void); export void OPM_CloseOldSym (void); export void OPM_DeleteNewSym (void); -export void OPM_FPrint (int32 *fp, int64 val); -export void OPM_FPrintLReal (int32 *fp, LONGREAL lr); -export void OPM_FPrintReal (int32 *fp, REAL real); -export void OPM_FPrintSet (int32 *fp, uint64 set); -static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 pos); +export void OPM_FPrint (INT32 *fp, INT64 val); +export void OPM_FPrintLReal (INT32 *fp, LONGREAL lr); +export void OPM_FPrintReal (INT32 *fp, REAL real); +export void OPM_FPrintSet (INT32 *fp, UINT64 set); +static void OPM_FindLine (Files_File f, Files_Rider *r, ADDRESS *r__typ, INT64 pos); export void OPM_Get (CHAR *ch); export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); export void OPM_InitOptions (void); -export int16 OPM_Integer (int64 n); -static void OPM_LogErrMsg (int16 n); +export INT16 OPM_Integer (INT64 n); +static void OPM_LogErrMsg (INT16 n); export void OPM_LogW (CHAR ch); export void OPM_LogWLn (void); -export void OPM_LogWNum (int64 i, int64 len); +export void OPM_LogWNum (INT64 i, INT64 len); export void OPM_LogWStr (CHAR *s, LONGINT s__len); -export int32 OPM_Longint (int64 n); +export INT32 OPM_Longint (INT64 n); static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len); -export void OPM_Mark (int16 n, int32 pos); +export void OPM_Mark (INT16 n, INT32 pos); export void OPM_NewSym (CHAR *modName, LONGINT modName__len); export void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); export void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); export BOOLEAN OPM_OpenPar (void); export void OPM_RegisterNewSym (void); static void OPM_ScanOptions (CHAR *s, LONGINT s__len); -static void OPM_ShowLine (int64 pos); -export int64 OPM_SignedMaximum (int32 bytecount); -export int64 OPM_SignedMinimum (int32 bytecount); +static void OPM_ShowLine (INT64 pos); +export INT64 OPM_SignedMaximum (INT32 bytecount); +export INT64 OPM_SignedMinimum (INT32 bytecount); export void OPM_SymRCh (CHAR *ch); -export int32 OPM_SymRInt (void); -export int64 OPM_SymRInt64 (void); +export INT32 OPM_SymRInt (void); +export INT64 OPM_SymRInt64 (void); export void OPM_SymRLReal (LONGREAL *lr); export void OPM_SymRReal (REAL *r); -export void OPM_SymRSet (uint64 *s); +export void OPM_SymRSet (UINT64 *s); export void OPM_SymWCh (CHAR ch); -export void OPM_SymWInt (int64 i); +export void OPM_SymWInt (INT64 i); export void OPM_SymWLReal (LONGREAL lr); export void OPM_SymWReal (REAL r); -export void OPM_SymWSet (uint64 s); +export void OPM_SymWSet (UINT64 s); static void OPM_VerboseListSizes (void); export void OPM_Write (CHAR ch); -export void OPM_WriteHex (int64 i); -export void OPM_WriteInt (int64 i); +export void OPM_WriteHex (INT64 i); +export void OPM_WriteInt (INT64 i); export void OPM_WriteLn (void); export void OPM_WriteReal (LONGREAL r, CHAR suffx); export void OPM_WriteString (CHAR *s, LONGINT s__len); export void OPM_WriteStringVar (CHAR *s, LONGINT s__len); export BOOLEAN OPM_eofSF (void); -export void OPM_err (int16 n); +export void OPM_err (INT16 n); #define OPM_GetAlignment(a) struct {char c; long long l;} _s; *a = (char*)&_s.l - (char*)&_s @@ -112,7 +112,7 @@ void OPM_LogWStr (CHAR *s, LONGINT s__len) __DEL(s); } -void OPM_LogWNum (int64 i, int64 len) +void OPM_LogWNum (INT64 i, INT64 len) { Out_Int(i, len); } @@ -122,32 +122,32 @@ void OPM_LogWLn (void) Out_Ln(); } -int64 OPM_SignedMaximum (int32 bytecount) +INT64 OPM_SignedMaximum (INT32 bytecount) { - int64 result; + INT64 result; result = 1; result = __LSH(result, __ASHL(bytecount, 3) - 1, 64); return result - 1; } -int64 OPM_SignedMinimum (int32 bytecount) +INT64 OPM_SignedMinimum (INT32 bytecount) { return -OPM_SignedMaximum(bytecount) - 1; } -int32 OPM_Longint (int64 n) +INT32 OPM_Longint (INT64 n) { - return __VAL(int32, n); + return __VAL(INT32, n); } -int16 OPM_Integer (int64 n) +INT16 OPM_Integer (INT64 n) { - return __VAL(int16, n); + return __VAL(INT16, n); } static void OPM_ScanOptions (CHAR *s, LONGINT s__len) { - int16 i; + INT16 i; __DUP(s, s__len, CHAR); i = 1; while (s[__X(i, s__len)] != 0x00) { @@ -213,23 +213,23 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len) OPM_LogWStr((CHAR*)"-M option requires two following digits.", 41); OPM_LogWLn(); } else { - OPM_AddressSize = (int16)s[__X(i + 1, s__len)] - 48; - OPM_Alignment = (int16)s[__X(i + 2, s__len)] - 48; + OPM_AddressSize = (INT16)s[__X(i + 1, s__len)] - 48; + OPM_Alignment = (INT16)s[__X(i + 2, s__len)] - 48; i += 2; } break; case 'B': if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_IntegerSize = (int16)s[__X(i, s__len)] - 48; + OPM_IntegerSize = (INT16)s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_AddressSize = (int16)s[__X(i, s__len)] - 48; + OPM_AddressSize = (INT16)s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_Alignment = (int16)s[__X(i, s__len)] - 48; + OPM_Alignment = (INT16)s[__X(i, s__len)] - 48; } __ASSERT(OPM_IntegerSize == 2 || OPM_IntegerSize == 4, 0); __ASSERT(OPM_AddressSize == 4 || OPM_AddressSize == 8, 0); @@ -465,7 +465,7 @@ void OPM_InitOptions (void) void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len) { Texts_Text T = NIL; - int32 beg, end, time; + INT32 beg, end, time; CHAR s[256]; *done = 0; OPM_curpos = 0; @@ -513,7 +513,7 @@ void OPM_Get (CHAR *ch) static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len) { - int16 i, j; + INT16 i, j; CHAR ch; __DUP(ext, ext__len, CHAR); i = 0; @@ -535,12 +535,12 @@ static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGIN __DEL(ext); } -static void OPM_LogErrMsg (int16 n) +static void OPM_LogErrMsg (INT16 n) { Texts_Scanner S; Texts_Text T = NIL; CHAR ch; - int16 i; + INT16 i; CHAR buf[1024]; if (n >= 0) { if (!__IN(16, OPM_Options, 32)) { @@ -565,21 +565,21 @@ static void OPM_LogErrMsg (int16 n) OPM_LogWStr(errors_errors[__X(n, 350)], 128); } -static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 pos) +static void OPM_FindLine (Files_File f, Files_Rider *r, ADDRESS *r__typ, INT64 pos) { CHAR ch, cheol; - if (pos < (int64)OPM_ErrorLineStartPos) { + if (pos < (INT64)OPM_ErrorLineStartPos) { OPM_ErrorLineStartPos = 0; OPM_ErrorLineLimitPos = 0; OPM_ErrorLineNumber = 0; } - if (pos < (int64)OPM_ErrorLineLimitPos) { + if (pos < (INT64)OPM_ErrorLineLimitPos) { Files_Set(&*r, r__typ, f, OPM_ErrorLineStartPos); return; } Files_Set(&*r, r__typ, f, OPM_ErrorLineLimitPos); Files_Read(&*r, r__typ, (void*)&ch); - while (((int64)OPM_ErrorLineLimitPos < pos && !(*r).eof)) { + while (((INT64)OPM_ErrorLineLimitPos < pos && !(*r).eof)) { OPM_ErrorLineStartPos = OPM_ErrorLineLimitPos; OPM_ErrorLineNumber += 1; while ((((ch != 0x00 && ch != 0x0d)) && ch != 0x0a)) { @@ -597,12 +597,12 @@ static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 p Files_Set(&*r, r__typ, f, OPM_ErrorLineStartPos); } -static void OPM_ShowLine (int64 pos) +static void OPM_ShowLine (INT64 pos) { Files_File f = NIL; Files_Rider r; CHAR line[1023]; - int16 i; + INT16 i; CHAR ch; f = Files_Old(OPM_SourceFileName, 256); OPM_FindLine(f, &r, Files_Rider__typ, pos); @@ -621,10 +621,10 @@ static void OPM_ShowLine (int64 pos) OPM_LogWStr(line, 1023); OPM_LogWLn(); OPM_LogWStr((CHAR*)" ", 7); - if (pos >= (int64)OPM_ErrorLineLimitPos) { + if (pos >= (INT64)OPM_ErrorLineLimitPos) { pos = OPM_ErrorLineLimitPos - 1; } - i = (int16)OPM_Longint(pos - (int64)OPM_ErrorLineStartPos); + i = (INT16)OPM_Longint(pos - (INT64)OPM_ErrorLineStartPos); while (i > 0) { OPM_LogW(' '); i -= 1; @@ -639,7 +639,7 @@ static void OPM_ShowLine (int64 pos) Files_Close(f); } -void OPM_Mark (int16 n, int32 pos) +void OPM_Mark (INT16 n, INT32 pos) { if (pos == -1) { pos = 0; @@ -691,34 +691,34 @@ void OPM_Mark (int16 n, int32 pos) } } -void OPM_err (int16 n) +void OPM_err (INT16 n) { OPM_Mark(n, OPM_errpos); } -void OPM_FPrint (int32 *fp, int64 val) +void OPM_FPrint (INT32 *fp, INT64 val) { - *fp = __ROTL((int32)((uint32)*fp ^ __VAL(uint32, val)), 1, 32); + *fp = __ROTL((INT32)((UINT32)*fp ^ __VAL(UINT32, val)), 1, 32); } -void OPM_FPrintSet (int32 *fp, uint64 set) +void OPM_FPrintSet (INT32 *fp, UINT64 set) { - OPM_FPrint(&*fp, __VAL(int32, set)); + OPM_FPrint(&*fp, __VAL(INT32, set)); } -void OPM_FPrintReal (int32 *fp, REAL real) +void OPM_FPrintReal (INT32 *fp, REAL real) { - int16 i; - int32 l; - __GET((address)&real, l, int32); + INT16 i; + INT32 l; + __GET((address)&real, l, INT32); OPM_FPrint(&*fp, l); } -void OPM_FPrintLReal (int32 *fp, LONGREAL lr) +void OPM_FPrintLReal (INT32 *fp, LONGREAL lr) { - int32 l, h; - __GET((address)&lr, l, int32); - __GET((address)&lr + 4, h, int32); + INT32 l, h; + __GET((address)&lr, l, INT32); + __GET((address)&lr + 4, h, INT32); OPM_FPrint(&*fp, l); OPM_FPrint(&*fp, h); } @@ -728,21 +728,21 @@ void OPM_SymRCh (CHAR *ch) Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&*ch); } -int32 OPM_SymRInt (void) +INT32 OPM_SymRInt (void) { - int32 k; + INT32 k; Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&k, 4); return k; } -int64 OPM_SymRInt64 (void) +INT64 OPM_SymRInt64 (void) { - int64 k; + INT64 k; Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&k, 8); return k; } -void OPM_SymRSet (uint64 *s) +void OPM_SymRSet (UINT64 *s) { Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&*s, 8); } @@ -790,14 +790,14 @@ void OPM_SymWCh (CHAR ch) Files_Write(&OPM_newSF, Files_Rider__typ, ch); } -void OPM_SymWInt (int64 i) +void OPM_SymWInt (INT64 i) { Files_WriteNum(&OPM_newSF, Files_Rider__typ, i); } -void OPM_SymWSet (uint64 s) +void OPM_SymWSet (UINT64 s) { - Files_WriteNum(&OPM_newSF, Files_Rider__typ, (int64)s); + Files_WriteNum(&OPM_newSF, Files_Rider__typ, (INT64)s); } void OPM_SymWReal (REAL r) @@ -841,7 +841,7 @@ void OPM_Write (CHAR ch) void OPM_WriteString (CHAR *s, LONGINT s__len) { - int16 i; + INT16 i; i = 0; while (s[__X(i, s__len)] != 0x00) { i += 1; @@ -851,7 +851,7 @@ void OPM_WriteString (CHAR *s, LONGINT s__len) void OPM_WriteStringVar (CHAR *s, LONGINT s__len) { - int16 i; + INT16 i; i = 0; while (s[__X(i, s__len)] != 0x00) { i += 1; @@ -859,17 +859,17 @@ void OPM_WriteStringVar (CHAR *s, LONGINT s__len) Files_WriteBytes(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, (void*)s, s__len * 1, i); } -void OPM_WriteHex (int64 i) +void OPM_WriteHex (INT64 i) { CHAR s[3]; - int32 digit; - digit = __ASHR((int32)i, 4); + INT32 digit; + digit = __ASHR((INT32)i, 4); if (digit < 10) { s[0] = (CHAR)(48 + digit); } else { s[0] = (CHAR)(87 + digit); } - digit = __MASK((int32)i, -16); + digit = __MASK((INT32)i, -16); if (digit < 10) { s[1] = (CHAR)(48 + digit); } else { @@ -879,10 +879,10 @@ void OPM_WriteHex (int64 i) OPM_WriteString(s, 3); } -void OPM_WriteInt (int64 i) +void OPM_WriteInt (INT64 i) { CHAR s[24]; - int64 i1, k; + INT64 i1, k; if ((i == OPM_SignedMinimum(2) || i == OPM_SignedMinimum(4)) || i == OPM_SignedMinimum(8)) { OPM_Write('('); OPM_WriteInt(i + 1); @@ -915,14 +915,14 @@ void OPM_WriteReal (LONGREAL r, CHAR suffx) Texts_Reader R; CHAR s[32]; CHAR ch; - int16 i; - if ((((r < OPM_SignedMaximum(OPM_LongintSize) && r > OPM_SignedMinimum(OPM_LongintSize))) && r == ((int32)__ENTIER(r)))) { + INT16 i; + if ((((r < OPM_SignedMaximum(OPM_LongintSize) && r > OPM_SignedMinimum(OPM_LongintSize))) && r == ((INT32)__ENTIER(r)))) { if (suffx == 'f') { OPM_WriteString((CHAR*)"(REAL)", 7); } else { OPM_WriteString((CHAR*)"(LONGREAL)", 11); } - OPM_WriteInt((int32)__ENTIER(r)); + OPM_WriteInt((INT32)__ENTIER(r)); } else { Texts_OpenWriter(&W, Texts_Writer__typ); if (suffx == 'f') { @@ -960,7 +960,7 @@ void OPM_WriteLn (void) Files_Write(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, 0x0a); } -static void OPM_Append (Files_Rider *R, address *R__typ, Files_File F) +static void OPM_Append (Files_Rider *R, ADDRESS *R__typ, Files_File F) { Files_Rider R1; CHAR buffer[4096]; @@ -1003,7 +1003,7 @@ void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len) void OPM_CloseFiles (void) { CHAR FName[32]; - int16 res; + INT16 res; if (OPM_noerr) { OPM_LogWStr((CHAR*)" ", 3); OPM_LogWNum(Files_Pos(&OPM_R[1], Files_Rider__typ), 0); diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index be9e98bd..42866571 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h @@ -7,14 +7,14 @@ import CHAR OPM_Model[10]; -import int16 OPM_AddressSize, OPM_Alignment; -import uint32 OPM_GlobalOptions, OPM_Options; -import int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; -import int64 OPM_MaxIndex; +import INT16 OPM_AddressSize, OPM_Alignment; +import UINT32 OPM_GlobalOptions, OPM_Options; +import INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; +import INT64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; -import int32 OPM_curpos, OPM_errpos, OPM_breakpc; -import int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; +import INT32 OPM_curpos, OPM_errpos, OPM_breakpc; +import INT16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; import CHAR OPM_modName[32]; import CHAR OPM_objname[64]; import CHAR OPM_ResourceDir[1024]; @@ -23,47 +23,47 @@ import CHAR OPM_ResourceDir[1024]; import void OPM_CloseFiles (void); import void OPM_CloseOldSym (void); import void OPM_DeleteNewSym (void); -import void OPM_FPrint (int32 *fp, int64 val); -import void OPM_FPrintLReal (int32 *fp, LONGREAL lr); -import void OPM_FPrintReal (int32 *fp, REAL real); -import void OPM_FPrintSet (int32 *fp, uint64 set); +import void OPM_FPrint (INT32 *fp, INT64 val); +import void OPM_FPrintLReal (INT32 *fp, LONGREAL lr); +import void OPM_FPrintReal (INT32 *fp, REAL real); +import void OPM_FPrintSet (INT32 *fp, UINT64 set); import void OPM_Get (CHAR *ch); import void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); import void OPM_InitOptions (void); -import int16 OPM_Integer (int64 n); +import INT16 OPM_Integer (INT64 n); import void OPM_LogW (CHAR ch); import void OPM_LogWLn (void); -import void OPM_LogWNum (int64 i, int64 len); +import void OPM_LogWNum (INT64 i, INT64 len); import void OPM_LogWStr (CHAR *s, LONGINT s__len); -import int32 OPM_Longint (int64 n); -import void OPM_Mark (int16 n, int32 pos); +import INT32 OPM_Longint (INT64 n); +import void OPM_Mark (INT16 n, INT32 pos); import void OPM_NewSym (CHAR *modName, LONGINT modName__len); import void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); import void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); import BOOLEAN OPM_OpenPar (void); import void OPM_RegisterNewSym (void); -import int64 OPM_SignedMaximum (int32 bytecount); -import int64 OPM_SignedMinimum (int32 bytecount); +import INT64 OPM_SignedMaximum (INT32 bytecount); +import INT64 OPM_SignedMinimum (INT32 bytecount); import void OPM_SymRCh (CHAR *ch); -import int32 OPM_SymRInt (void); -import int64 OPM_SymRInt64 (void); +import INT32 OPM_SymRInt (void); +import INT64 OPM_SymRInt64 (void); import void OPM_SymRLReal (LONGREAL *lr); import void OPM_SymRReal (REAL *r); -import void OPM_SymRSet (uint64 *s); +import void OPM_SymRSet (UINT64 *s); import void OPM_SymWCh (CHAR ch); -import void OPM_SymWInt (int64 i); +import void OPM_SymWInt (INT64 i); import void OPM_SymWLReal (LONGREAL lr); import void OPM_SymWReal (REAL r); -import void OPM_SymWSet (uint64 s); +import void OPM_SymWSet (UINT64 s); import void OPM_Write (CHAR ch); -import void OPM_WriteHex (int64 i); -import void OPM_WriteInt (int64 i); +import void OPM_WriteHex (INT64 i); +import void OPM_WriteInt (INT64 i); import void OPM_WriteLn (void); import void OPM_WriteReal (LONGREAL r, CHAR suffx); import void OPM_WriteString (CHAR *s, LONGINT s__len); import void OPM_WriteStringVar (CHAR *s, LONGINT s__len); import BOOLEAN OPM_eofSF (void); -import void OPM_err (int16 n); +import void OPM_err (INT16 n); import void *OPM__init(void); diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index 5e181cb9..45f4db77 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "OPB.h" @@ -12,38 +12,38 @@ #include "OPT.h" struct OPP__1 { - int32 low, high; + INT32 low, high; }; typedef struct OPP__1 OPP_CaseTable[128]; -static int8 OPP_sym, OPP_level; -static int16 OPP_LoopLevel; +static INT8 OPP_sym, OPP_level; +static INT16 OPP_LoopLevel; static OPT_Node OPP_TDinit, OPP_lastTDinit; -static int16 OPP_nofFwdPtr; +static INT16 OPP_nofFwdPtr; static OPT_Struct OPP_FwdPtr[64]; -export address *OPP__1__typ; +export ADDRESS *OPP__1__typ; static void OPP_ActualParameters (OPT_Node *aparlist, OPT_Object fpar); static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned); static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq); -static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int16 *n, OPP_CaseTable tab); -static void OPP_CheckMark (int8 *vis); -static void OPP_CheckSym (int16 s); -static void OPP_CheckSysFlag (int16 *sysflag, int16 default_); +static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INT16 *n, OPP_CaseTable tab); +static void OPP_CheckMark (INT8 *vis); +static void OPP_CheckSym (INT16 s); +static void OPP_CheckSysFlag (INT16 *sysflag, INT16 default_); static void OPP_ConstExpression (OPT_Node *x); static void OPP_Element (OPT_Node *x); static void OPP_Expression (OPT_Node *x); static BOOLEAN OPP_Extends (OPT_Struct x, OPT_Struct b); static void OPP_Factor (OPT_Node *x); static void OPP_FormalParameters (OPT_Object *firstPar, OPT_Struct *resTyp); -export void OPP_Module (OPT_Node *prog, uint32 opt); +export void OPP_Module (OPT_Node *prog, UINT32 opt); static void OPP_PointerType (OPT_Struct *typ); static void OPP_ProcedureDeclaration (OPT_Node *x); -static void OPP_Receiver (int8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec); +static void OPP_Receiver (INT8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec); static void OPP_RecordType (OPT_Struct *typ, OPT_Struct *banned); static void OPP_Sets (OPT_Node *x); static void OPP_SimpleExpression (OPT_Node *x); @@ -52,19 +52,19 @@ static void OPP_StatSeq (OPT_Node *stat); static void OPP_Term (OPT_Node *x); static void OPP_Type (OPT_Struct *typ, OPT_Struct *banned); static void OPP_TypeDecl (OPT_Struct *typ, OPT_Struct *banned); -static void OPP_err (int16 n); +static void OPP_err (INT16 n); static void OPP_qualident (OPT_Object *id); static void OPP_selector (OPT_Node *x); -static void OPP_err (int16 n) +static void OPP_err (INT16 n) { OPM_err(n); } -static void OPP_CheckSym (int16 s) +static void OPP_CheckSym (INT16 s) { - if ((int16)OPP_sym == s) { + if ((INT16)OPP_sym == s) { OPS_Get(&OPP_sym); } else { OPM_err(s); @@ -74,7 +74,7 @@ static void OPP_CheckSym (int16 s) static void OPP_qualident (OPT_Object *id) { OPT_Object obj = NIL; - int8 lev; + INT8 lev; OPT_Find(&obj); OPS_Get(&OPP_sym); if ((((OPP_sym == 18 && obj != NIL)) && obj->mode == 11)) { @@ -114,7 +114,7 @@ static void OPP_ConstExpression (OPT_Node *x) } } -static void OPP_CheckMark (int8 *vis) +static void OPP_CheckMark (INT8 *vis) { OPS_Get(&OPP_sym); if (OPP_sym == 1 || OPP_sym == 7) { @@ -132,10 +132,10 @@ static void OPP_CheckMark (int8 *vis) } } -static void OPP_CheckSysFlag (int16 *sysflag, int16 default_) +static void OPP_CheckSysFlag (INT16 *sysflag, INT16 default_) { OPT_Node x = NIL; - int64 sf; + INT64 sf; if (OPP_sym == 31) { OPS_Get(&OPP_sym); if (!OPT_SYSimported) { @@ -163,7 +163,7 @@ static void OPP_RecordType (OPT_Struct *typ, OPT_Struct *banned) { OPT_Object fld = NIL, first = NIL, last = NIL, base = NIL; OPT_Struct ftyp = NIL; - int16 sysflag; + INT16 sysflag; *typ = OPT_NewStr(13, 4); (*typ)->BaseTyp = NIL; OPP_CheckSysFlag(&sysflag, -1); @@ -255,8 +255,8 @@ static void OPP_RecordType (OPT_Struct *typ, OPT_Struct *banned) static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) { OPT_Node x = NIL; - int64 n; - int16 sysflag; + INT64 n; + INT16 sysflag; OPP_CheckSysFlag(&sysflag, 0); if (OPP_sym == 25) { *typ = OPT_NewStr(13, 3); @@ -348,7 +348,7 @@ static void OPP_PointerType (OPT_Struct *typ) static void OPP_FormalParameters (OPT_Object *firstPar, OPT_Struct *resTyp) { - int8 mode; + INT8 mode; OPT_Object par = NIL, first = NIL, last = NIL, res = NIL; OPT_Struct typ = NIL; first = NIL; @@ -629,9 +629,9 @@ static void OPP_ActualParameters (OPT_Node *aparlist, OPT_Object fpar) static void OPP_StandProcCall (OPT_Node *x) { OPT_Node y = NIL; - int8 m; - int16 n; - m = (int8)((int16)(*x)->obj->adr); + INT8 m; + INT16 n; + m = (INT8)((INT16)(*x)->obj->adr); n = 0; if (OPP_sym == 30) { OPS_Get(&OPP_sym); @@ -790,7 +790,7 @@ static void OPP_Factor (OPT_Node *x) static void OPP_Term (OPT_Node *x) { OPT_Node y = NIL; - int8 mulop; + INT8 mulop; OPP_Factor(&*x); while ((1 <= OPP_sym && OPP_sym <= 5)) { mulop = OPP_sym; @@ -803,7 +803,7 @@ static void OPP_Term (OPT_Node *x) static void OPP_SimpleExpression (OPT_Node *x) { OPT_Node y = NIL; - int8 addop; + INT8 addop; if (OPP_sym == 7) { OPS_Get(&OPP_sym); OPP_Term(&*x); @@ -827,7 +827,7 @@ static void OPP_Expression (OPT_Node *x) { OPT_Node y = NIL; OPT_Object obj = NIL; - int8 relation; + INT8 relation; OPP_SimpleExpression(&*x); if ((9 <= OPP_sym && OPP_sym <= 14)) { relation = OPP_sym; @@ -853,7 +853,7 @@ static void OPP_Expression (OPT_Node *x) } } -static void OPP_Receiver (int8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec) +static void OPP_Receiver (INT8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec) { OPT_Object obj = NIL; *typ = OPT_undftyp; @@ -917,7 +917,7 @@ static struct ProcedureDeclaration__16 { OPT_Node *x; OPT_Object *proc, *fwd; OPS_Name *name; - int8 *mode, *vis; + INT8 *mode, *vis; BOOLEAN *forward; struct ProcedureDeclaration__16 *lnk; } *ProcedureDeclaration__16_s; @@ -930,8 +930,8 @@ static void TProcDecl__23 (void); static void GetCode__19 (void) { OPT_ConstExt ext = NIL; - int16 n; - int64 c; + INT16 n; + INT64 c; ext = OPT_NewExt(); (*ProcedureDeclaration__16_s->proc)->conval->ext = ext; n = 0; @@ -995,7 +995,7 @@ static void GetParams__21 (void) static void Body__17 (void) { OPT_Node procdec = NIL, statseq = NIL; - int32 c; + INT32 c; c = OPM_errpos; (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1,64); OPP_CheckSym(39); @@ -1018,7 +1018,7 @@ static void TProcDecl__23 (void) { OPT_Object baseProc = NIL; OPT_Struct objTyp = NIL, recTyp = NIL; - int8 objMode; + INT8 objMode; OPS_Name objName; OPS_Get(&OPP_sym); *ProcedureDeclaration__16_s->mode = 13; @@ -1090,7 +1090,7 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) { OPT_Object proc = NIL, fwd = NIL; OPS_Name name; - int8 mode, vis; + INT8 mode, vis; BOOLEAN forward; struct ProcedureDeclaration__16 _s; _s.x = x; @@ -1167,11 +1167,11 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) ProcedureDeclaration__16_s = _s.lnk; } -static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int16 *n, OPP_CaseTable tab) +static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INT16 *n, OPP_CaseTable tab) { OPT_Node x = NIL, y = NIL, lastlab = NIL; - int16 i, f; - int32 xval, yval; + INT16 i, f; + INT32 xval, yval; *lab = NIL; lastlab = NIL; for (;;) { @@ -1187,14 +1187,14 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int16 *n, OPP if (!(LabelTyp->form == 4) || LabelTyp->size < x->typ->size) { OPP_err(60); } - } else if ((int16)LabelTyp->form != f) { + } else if ((INT16)LabelTyp->form != f) { OPP_err(60); } if (OPP_sym == 21) { OPS_Get(&OPP_sym); OPP_ConstExpression(&y); yval = OPM_Longint(y->conval->intval); - if (((int16)y->typ->form != f && !((f == 4 && y->typ->form == 4)))) { + if (((INT16)y->typ->form != f && !((f == 4 && y->typ->form == 4)))) { OPP_err(60); } if (yval < xval) { @@ -1238,7 +1238,7 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int16 *n, OPP } static struct StatSeq__30 { - int32 *pos; + INT32 *pos; struct StatSeq__30 *lnk; } *StatSeq__30_s; @@ -1248,8 +1248,8 @@ static void SetPos__35 (OPT_Node x); static void CasePart__31 (OPT_Node *x) { - int16 n; - int32 low, high; + INT16 n; + INT32 low, high; BOOLEAN e; OPP_CaseTable tab; OPT_Node cases = NIL, lab = NIL, y = NIL, lastcase = NIL; @@ -1332,7 +1332,7 @@ static void OPP_StatSeq (OPT_Node *stat) OPT_Struct idtyp = NIL; BOOLEAN e; OPT_Node s = NIL, x = NIL, y = NIL, z = NIL, apar = NIL, last = NIL, lastif = NIL; - int32 pos; + INT32 pos; OPS_Name name; struct StatSeq__30 _s; _s.pos = &pos; @@ -1625,7 +1625,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) OPT_Struct typ = NIL; OPT_Object obj = NIL, first = NIL, last = NIL; OPT_Node x = NIL, lastdec = NIL; - int16 i; + INT16 i; first = NIL; last = NIL; OPP_nofFwdPtr = 0; @@ -1774,11 +1774,11 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) OPP_CheckSym(41); } -void OPP_Module (OPT_Node *prog, uint32 opt) +void OPP_Module (OPT_Node *prog, UINT32 opt) { OPS_Name impName, aliasName; OPT_Node procdec = NIL, statseq = NIL; - int32 c; + INT32 c; BOOLEAN done; OPS_Init(); OPP_LoopLevel = 0; diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index de0e599a..cb3aabc8 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h @@ -9,7 +9,7 @@ -import void OPP_Module (OPT_Node *prog, uint32 opt); +import void OPP_Module (OPT_Node *prog, UINT32 opt); import void *OPP__init(void); diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index 5a34663d..5d7b776f 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "OPM.h" @@ -17,29 +17,29 @@ typedef export OPS_Name OPS_name; export OPS_String OPS_str; -export int16 OPS_numtyp; -export int64 OPS_intval; +export INT16 OPS_numtyp; +export INT64 OPS_intval; export REAL OPS_realval; export LONGREAL OPS_lrlval; static CHAR OPS_ch; -export void OPS_Get (int8 *sym); -static void OPS_Identifier (int8 *sym); +export void OPS_Get (INT8 *sym); +static void OPS_Identifier (INT8 *sym); export void OPS_Init (void); static void OPS_Number (void); -static void OPS_Str (int8 *sym); -static void OPS_err (int16 n); +static void OPS_Str (INT8 *sym); +static void OPS_err (INT16 n); -static void OPS_err (int16 n) +static void OPS_err (INT16 n) { OPM_err(n); } -static void OPS_Str (int8 *sym) +static void OPS_Str (INT8 *sym) { - int16 i; + INT16 i; CHAR och; i = 0; och = OPS_ch; @@ -65,15 +65,15 @@ static void OPS_Str (int8 *sym) if (OPS_intval == 2) { *sym = 35; OPS_numtyp = 1; - OPS_intval = (int16)OPS_str[0]; + OPS_intval = (INT16)OPS_str[0]; } else { *sym = 37; } } -static void OPS_Identifier (int8 *sym) +static void OPS_Identifier (INT8 *sym) { - int16 i; + INT16 i; i = 0; do { OPS_name[i] = OPS_ch; @@ -92,10 +92,10 @@ static struct Number__6 { struct Number__6 *lnk; } *Number__6_s; -static int16 Ord__7 (CHAR ch, BOOLEAN hex); -static LONGREAL Ten__9 (int16 e); +static INT16 Ord__7 (CHAR ch, BOOLEAN hex); +static LONGREAL Ten__9 (INT16 e); -static LONGREAL Ten__9 (int16 e) +static LONGREAL Ten__9 (INT16 e) { LONGREAL x, p; x = (LONGREAL)1; @@ -112,12 +112,12 @@ static LONGREAL Ten__9 (int16 e) return x; } -static int16 Ord__7 (CHAR ch, BOOLEAN hex) +static INT16 Ord__7 (CHAR ch, BOOLEAN hex) { if (ch <= '9') { - return (int16)ch - 48; + return (INT16)ch - 48; } else if (hex) { - return ((int16)ch - 65) + 10; + return ((INT16)ch - 65) + 10; } else { OPS_err(2); return 0; @@ -127,7 +127,7 @@ static int16 Ord__7 (CHAR ch, BOOLEAN hex) static void OPS_Number (void) { - int16 i, m, n, d, e; + INT16 i, m, n, d, e; CHAR dig[24]; LONGREAL f; CHAR expCh; @@ -173,7 +173,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) + (INT64)Ord__7(dig[i], 1); i += 1; } } else { @@ -187,7 +187,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) + (INT64)Ord__7(dig[i], 1); i += 1; } } else { @@ -198,8 +198,8 @@ static void OPS_Number (void) while (i < n) { d = Ord__7(dig[i], 0); i += 1; - if (OPS_intval <= __DIV(9223372036854775807 - (int64)d, 10)) { - OPS_intval = OPS_intval * 10 + (int64)d; + if (OPS_intval <= __DIV(9223372036854775807 - (INT64)d, 10)) { + OPS_intval = OPS_intval * 10 + (INT64)d; } else { OPS_err(203); } @@ -308,9 +308,9 @@ static void Comment__2 (void) } } -void OPS_Get (int8 *sym) +void OPS_Get (INT8 *sym) { - int8 s; + INT8 s; struct Get__1 _s; _s.lnk = Get__1_s; Get__1_s = &_s; diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index a452da84..01ffbd17 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h @@ -14,13 +14,13 @@ typedef import OPS_Name OPS_name; import OPS_String OPS_str; -import int16 OPS_numtyp; -import int64 OPS_intval; +import INT16 OPS_numtyp; +import INT64 OPS_intval; import REAL OPS_realval; import LONGREAL OPS_lrlval; -import void OPS_Get (int8 *sym); +import void OPS_Get (INT8 *sym); import void OPS_Init (void); import void *OPS__init(void); diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index f55e7e01..3340bb93 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "OPM.h" @@ -18,18 +18,18 @@ typedef typedef struct OPT_ConstDesc { OPT_ConstExt ext; - int64 intval; - int32 intval2; - uint64 setval; + INT64 intval; + INT32 intval2; + UINT64 setval; LONGREAL realval; } OPT_ConstDesc; typedef struct OPT_ExpCtxt { - int32 reffp; - int16 ref; - int8 nofm; - int8 locmno[64]; + INT32 reffp; + INT16 ref; + INT8 nofm; + INT8 locmno[64]; } OPT_ExpCtxt; typedef @@ -40,13 +40,13 @@ typedef typedef struct OPT_ImpCtxt { - int32 nextTag, reffp; - int16 nofr, minr, nofm; + INT32 nextTag, reffp; + INT16 nofr, minr, nofm; BOOLEAN self; OPT_Struct ref[255]; OPT_Object old[255]; - int32 pvfp[255]; - int8 glbmno[64]; + INT32 pvfp[255]; + INT8 glbmno[64]; } OPT_ImpCtxt; typedef @@ -55,7 +55,7 @@ typedef typedef struct OPT_NodeDesc { OPT_Node left, right, link; - int8 class, subcl; + INT8 class, subcl; BOOLEAN readonly; OPT_Struct typ; OPT_Object obj; @@ -67,22 +67,22 @@ typedef OPT_Object left, right, link, scope; OPS_Name name; BOOLEAN leaf; - int8 mode, mnolev, vis, history; + INT8 mode, mnolev, vis, history; BOOLEAN used, fpdone; - int32 fprint; + INT32 fprint; OPT_Struct typ; OPT_Const conval; - int32 adr, linkadr; - int16 x; + INT32 adr, linkadr; + INT16 x; } OPT_ObjDesc; typedef struct OPT_StrDesc { - int8 form, comp, mno, extlev; - int16 ref, sysflag; - int32 n, size, align, txtpos; + INT8 form, comp, mno, extlev; + INT16 ref, sysflag; + INT32 n, size, align, txtpos; BOOLEAN allocated, pbused, pvused, fpdone, idfpdone; - int32 idfp, pbfp, pvfp; + INT32 idfp, pbfp, pvfp; OPT_Struct BaseTyp; OPT_Object link, strobj; } OPT_StrDesc; @@ -91,80 +91,80 @@ typedef export OPT_Object OPT_topScope; export OPT_Struct OPT_undftyp, OPT_niltyp, OPT_notyp, OPT_bytetyp, OPT_cpbytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_settyp, OPT_set32typ, OPT_set64typ, OPT_realtyp, OPT_lrltyp, OPT_stringtyp, OPT_adrtyp, OPT_sysptrtyp; export OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj, OPT_setobj; -export int8 OPT_nofGmod; +export INT8 OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; export BOOLEAN OPT_SYSimported; static OPT_Object OPT_universe, OPT_syslink; static OPT_ImpCtxt OPT_impCtxt; static OPT_ExpCtxt OPT_expCtxt; -static int32 OPT_nofhdfld; +static INT32 OPT_nofhdfld; static BOOLEAN OPT_newsf, OPT_findpc, OPT_extsf, OPT_sfpresent, OPT_symExtended, OPT_symNew; -static int32 OPT_recno; +static INT32 OPT_recno; -export address *OPT_ConstDesc__typ; -export address *OPT_ObjDesc__typ; -export address *OPT_StrDesc__typ; -export address *OPT_NodeDesc__typ; -export address *OPT_ImpCtxt__typ; -export address *OPT_ExpCtxt__typ; +export ADDRESS *OPT_ConstDesc__typ; +export ADDRESS *OPT_ObjDesc__typ; +export ADDRESS *OPT_StrDesc__typ; +export ADDRESS *OPT_NodeDesc__typ; +export ADDRESS *OPT_ImpCtxt__typ; +export ADDRESS *OPT_ExpCtxt__typ; -export void OPT_Align (int32 *adr, int32 base); -export int32 OPT_BaseAlignment (OPT_Struct typ); +export void OPT_Align (INT32 *adr, INT32 base); +export INT32 OPT_BaseAlignment (OPT_Struct typ); export void OPT_Close (void); export void OPT_CloseScope (void); static void OPT_DebugStruct (OPT_Struct btyp); -static void OPT_EnterBoolConst (OPS_Name name, int32 value); -static void OPT_EnterProc (OPS_Name name, int16 num); -static void OPT_EnterTyp (OPS_Name name, int8 form, int16 size, OPT_Struct *res); +static void OPT_EnterBoolConst (OPS_Name name, INT32 value); +static void OPT_EnterProc (OPS_Name name, INT16 num); +static void OPT_EnterTyp (OPS_Name name, INT8 form, INT16 size, OPT_Struct *res); static void OPT_EnterTypeAlias (OPS_Name name, OPT_Object *res); export void OPT_Export (BOOLEAN *ext, BOOLEAN *new); -export void OPT_FPrintErr (OPT_Object obj, int16 errcode); -static void OPT_FPrintName (int32 *fp, CHAR *name, LONGINT name__len); +export void OPT_FPrintErr (OPT_Object obj, INT16 errcode); +static void OPT_FPrintName (INT32 *fp, CHAR *name, LONGINT name__len); export void OPT_FPrintObj (OPT_Object obj); -static void OPT_FPrintSign (int32 *fp, OPT_Struct result, OPT_Object par); +static void OPT_FPrintSign (INT32 *fp, OPT_Struct result, OPT_Object par); export void OPT_FPrintStr (OPT_Struct typ); export void OPT_Find (OPT_Object *res); export void OPT_FindField (OPS_Name name, OPT_Struct typ, OPT_Object *res); export void OPT_FindImport (OPT_Object mod, OPT_Object *res); export void OPT_IdFPrint (OPT_Struct typ); export void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); -static void OPT_InConstant (int32 f, OPT_Const conval); +static void OPT_InConstant (INT32 f, OPT_Const conval); static OPT_Object OPT_InFld (void); -static void OPT_InMod (int8 *mno); +static void OPT_InMod (INT8 *mno); static void OPT_InName (CHAR *name, LONGINT name__len); -static OPT_Object OPT_InObj (int8 mno); -static void OPT_InSign (int8 mno, OPT_Struct *res, OPT_Object *par); +static OPT_Object OPT_InObj (INT8 mno); +static void OPT_InSign (INT8 mno, OPT_Struct *res, OPT_Object *par); static void OPT_InStruct (OPT_Struct *typ); -static OPT_Object OPT_InTProc (int8 mno); -static OPT_Struct OPT_InTyp (int32 tag); -export void OPT_Init (OPS_Name name, uint32 opt); +static OPT_Object OPT_InTProc (INT8 mno); +static OPT_Struct OPT_InTyp (INT32 tag); +export void OPT_Init (OPS_Name name, UINT32 opt); export void OPT_InitRecno (void); -static void OPT_InitStruct (OPT_Struct *typ, int8 form); +static void OPT_InitStruct (OPT_Struct *typ, INT8 form); export void OPT_Insert (OPS_Name name, OPT_Object *obj); export void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); -export int16 OPT_IntSize (int64 n); -export OPT_Struct OPT_IntType (int32 size); +export INT16 OPT_IntSize (INT64 n); +export OPT_Struct OPT_IntType (INT32 size); export OPT_Const OPT_NewConst (void); export OPT_ConstExt OPT_NewExt (void); -export OPT_Node OPT_NewNode (int8 class); +export OPT_Node OPT_NewNode (INT8 class); export OPT_Object OPT_NewObj (void); -export OPT_Struct OPT_NewStr (int8 form, int8 comp); -export void OPT_OpenScope (int8 level, OPT_Object owner); +export OPT_Struct OPT_NewStr (INT8 form, INT8 comp); +export void OPT_OpenScope (INT8 level, OPT_Object owner); static void OPT_OutConstant (OPT_Object obj); -static void OPT_OutFlds (OPT_Object fld, int32 adr, BOOLEAN visible); -static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, int32 adr); -static void OPT_OutMod (int16 mno); +static void OPT_OutFlds (OPT_Object fld, INT32 adr, BOOLEAN visible); +static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, INT32 adr); +static void OPT_OutMod (INT16 mno); static void OPT_OutName (CHAR *name, LONGINT name__len); static void OPT_OutObj (OPT_Object obj); static void OPT_OutSign (OPT_Struct result, OPT_Object par); static void OPT_OutStr (OPT_Struct typ); static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj); -export OPT_Struct OPT_SetType (int32 size); -export OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir); -export int32 OPT_SizeAlignment (int32 size); +export OPT_Struct OPT_SetType (INT32 size); +export OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INT16 dir); +export INT32 OPT_SizeAlignment (INT32 size); export void OPT_TypSize (OPT_Struct typ); -static void OPT_err (int16 n); +static void OPT_err (INT16 n); void OPT_InitRecno (void) @@ -172,14 +172,14 @@ void OPT_InitRecno (void) OPT_recno = 0; } -static void OPT_err (int16 n) +static void OPT_err (INT16 n) { OPM_err(n); } -int16 OPT_IntSize (int64 n) +INT16 OPT_IntSize (INT64 n) { - int16 bytes; + INT16 bytes; if (n < 0) { n = -(n + 1); } @@ -190,7 +190,7 @@ int16 OPT_IntSize (int64 n) return bytes; } -OPT_Struct OPT_IntType (int32 size) +OPT_Struct OPT_IntType (INT32 size) { if (size <= OPT_int8typ->size) { return OPT_int8typ; @@ -204,7 +204,7 @@ OPT_Struct OPT_IntType (int32 size) return OPT_int64typ; } -OPT_Struct OPT_SetType (int32 size) +OPT_Struct OPT_SetType (INT32 size) { if (size == OPT_set32typ->size) { return OPT_set32typ; @@ -212,9 +212,9 @@ OPT_Struct OPT_SetType (int32 size) return OPT_set64typ; } -OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir) +OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INT16 dir) { - int16 i; + INT16 i; __ASSERT(x->form == 4, 0); __ASSERT(x->BaseTyp == OPT_undftyp, 0); __ASSERT(dir == 1 || dir == -1, 0); @@ -244,7 +244,7 @@ OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir) __RETCHK; } -void OPT_Align (int32 *adr, int32 base) +void OPT_Align (INT32 *adr, INT32 base) { switch (base) { case 2: @@ -264,9 +264,9 @@ void OPT_Align (int32 *adr, int32 base) } } -int32 OPT_SizeAlignment (int32 size) +INT32 OPT_SizeAlignment (INT32 size) { - int32 alignment; + INT32 alignment; if (size < OPM_Alignment) { alignment = 1; while (alignment < size) { @@ -278,9 +278,9 @@ int32 OPT_SizeAlignment (int32 size) return alignment; } -int32 OPT_BaseAlignment (OPT_Struct typ) +INT32 OPT_BaseAlignment (OPT_Struct typ) { - int32 alignment; + INT32 alignment; if (typ->form == 13) { if (typ->comp == 4) { alignment = __MASK(typ->align, -65536); @@ -295,8 +295,8 @@ int32 OPT_BaseAlignment (OPT_Struct typ) void OPT_TypSize (OPT_Struct typ) { - int16 f, c; - int32 offset, size, base, fbase, off0; + INT16 f, c; + INT32 offset, size, base, fbase, off0; OPT_Object fld = NIL; OPT_Struct btyp = NIL; if (typ == OPT_undftyp) { @@ -339,7 +339,7 @@ void OPT_TypSize (OPT_Struct typ) } typ->size = offset; typ->align = base; - typ->sysflag = __MASK(typ->sysflag, -256) + (int16)__ASHL(offset - off0, 8); + typ->sysflag = __MASK(typ->sysflag, -256) + (INT16)__ASHL(offset - off0, 8); } else if (c == 2) { OPT_TypSize(typ->BaseTyp); typ->size = typ->n * typ->BaseTyp->size; @@ -378,7 +378,7 @@ OPT_Object OPT_NewObj (void) return obj; } -OPT_Struct OPT_NewStr (int8 form, int8 comp) +OPT_Struct OPT_NewStr (INT8 form, INT8 comp) { OPT_Struct typ = NIL; __NEW(typ, OPT_StrDesc); @@ -393,7 +393,7 @@ OPT_Struct OPT_NewStr (int8 form, int8 comp) return typ; } -OPT_Node OPT_NewNode (int8 class) +OPT_Node OPT_NewNode (INT8 class) { OPT_Node node = NIL; __NEW(node, OPT_NodeDesc); @@ -408,7 +408,7 @@ OPT_ConstExt OPT_NewExt (void) return ext; } -void OPT_OpenScope (int8 level, OPT_Object owner) +void OPT_OpenScope (INT8 level, OPT_Object owner) { OPT_Object head = NIL; head = OPT_NewObj(); @@ -429,7 +429,7 @@ void OPT_CloseScope (void) OPT_topScope = OPT_topScope->left; } -void OPT_Init (OPS_Name name, uint32 opt) +void OPT_Init (OPS_Name name, UINT32 opt) { OPT_topScope = OPT_universe; OPT_OpenScope(0, NIL); @@ -446,7 +446,7 @@ void OPT_Init (OPS_Name name, uint32 opt) void OPT_Close (void) { - int16 i; + INT16 i; OPT_CloseScope(); i = 0; while (i < 64) { @@ -538,7 +538,7 @@ void OPT_Insert (OPS_Name name, OPT_Object *obj) { OPT_Object ob0 = NIL, ob1 = NIL; BOOLEAN left; - int8 mnolev; + INT8 mnolev; ob0 = OPT_topScope; ob1 = ob0->right; left = 0; @@ -576,14 +576,14 @@ void OPT_Insert (OPS_Name name, OPT_Object *obj) *obj = ob1; } -static void OPT_FPrintName (int32 *fp, CHAR *name, LONGINT name__len) +static void OPT_FPrintName (INT32 *fp, CHAR *name, LONGINT name__len) { - int16 i; + INT16 i; CHAR ch; i = 0; do { ch = name[__X(i, name__len)]; - OPM_FPrint(&*fp, (int16)ch); + OPM_FPrint(&*fp, (INT16)ch); i += 1; } while (!(ch == 0x00)); } @@ -621,7 +621,7 @@ static void OPT_DebugStruct (OPT_Struct btyp) OPM_LogWLn(); } -static void OPT_FPrintSign (int32 *fp, OPT_Struct result, OPT_Object par) +static void OPT_FPrintSign (INT32 *fp, OPT_Struct result, OPT_Object par) { OPT_IdFPrint(result); OPM_FPrint(&*fp, result->idfp); @@ -637,8 +637,8 @@ void OPT_IdFPrint (OPT_Struct typ) { OPT_Struct btyp = NIL; OPT_Object strobj = NIL; - int32 idfp; - int16 f, c; + INT32 idfp; + INT16 f, c; if (!typ->idfpdone) { typ->idfpdone = 1; idfp = 0; @@ -667,17 +667,17 @@ void OPT_IdFPrint (OPT_Struct typ) } static struct FPrintStr__15 { - int32 *pbfp, *pvfp; + INT32 *pbfp, *pvfp; struct FPrintStr__15 *lnk; } *FPrintStr__15_s; -static void FPrintFlds__16 (OPT_Object fld, int32 adr, BOOLEAN visible); -static void FPrintHdFld__18 (OPT_Struct typ, OPT_Object fld, int32 adr); +static void FPrintFlds__16 (OPT_Object fld, INT32 adr, BOOLEAN visible); +static void FPrintHdFld__18 (OPT_Struct typ, OPT_Object fld, INT32 adr); static void FPrintTProcs__20 (OPT_Object obj); -static void FPrintHdFld__18 (OPT_Struct typ, OPT_Object fld, int32 adr) +static void FPrintHdFld__18 (OPT_Struct typ, OPT_Object fld, INT32 adr) { - int32 i, j, n; + INT32 i, j, n; OPT_Struct btyp = NIL; if (typ->comp == 4) { FPrintFlds__16(typ->link, adr, 0); @@ -707,7 +707,7 @@ static void FPrintHdFld__18 (OPT_Struct typ, OPT_Object fld, int32 adr) } } -static void FPrintFlds__16 (OPT_Object fld, int32 adr, BOOLEAN visible) +static void FPrintFlds__16 (OPT_Object fld, INT32 adr, BOOLEAN visible) { while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { @@ -742,10 +742,10 @@ static void FPrintTProcs__20 (OPT_Object obj) void OPT_FPrintStr (OPT_Struct typ) { - int16 f, c; + INT16 f, c; OPT_Struct btyp = NIL; OPT_Object strobj = NIL, bstrobj = NIL; - int32 pbfp, pvfp; + INT32 pbfp, pvfp; struct FPrintStr__15 _s; _s.pbfp = &pbfp; _s.pvfp = &pvfp; @@ -806,8 +806,8 @@ void OPT_FPrintStr (OPT_Struct typ) void OPT_FPrintObj (OPT_Object obj) { - int32 fprint; - int16 f, m; + INT32 fprint; + INT16 f, m; REAL rval; OPT_ConstExt ext = NIL; if (!obj->fpdone) { @@ -849,11 +849,11 @@ void OPT_FPrintObj (OPT_Object obj) } else if (obj->mode == 9) { OPT_FPrintSign(&fprint, obj->typ, obj->link); ext = obj->conval->ext; - m = (int16)(*ext)[0]; + m = (INT16)(*ext)[0]; f = 1; OPM_FPrint(&fprint, m); while (f <= m) { - OPM_FPrint(&fprint, (int16)(*ext)[__X(f, 256)]); + OPM_FPrint(&fprint, (INT16)(*ext)[__X(f, 256)]); f += 1; } } else if (obj->mode == 5) { @@ -864,9 +864,9 @@ void OPT_FPrintObj (OPT_Object obj) } } -void OPT_FPrintErr (OPT_Object obj, int16 errcode) +void OPT_FPrintErr (OPT_Object obj, INT16 errcode) { - int16 i, j; + INT16 i, j; CHAR ch; if (obj->mnolev != 0) { __COPY(OPT_GlbMod[__X(-obj->mnolev, 64)]->name, OPM_objname, 64); @@ -956,7 +956,7 @@ void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old) static void OPT_InName (CHAR *name, LONGINT name__len) { - int16 i; + INT16 i; CHAR ch; i = 0; do { @@ -966,12 +966,12 @@ static void OPT_InName (CHAR *name, LONGINT name__len) } while (!(ch == 0x00)); } -static void OPT_InMod (int8 *mno) +static void OPT_InMod (INT8 *mno) { OPT_Object head = NIL; OPS_Name name; - int32 mn; - int8 i; + INT32 mn; + INT8 i; mn = OPM_SymRInt(); if (mn == 0) { *mno = OPT_impCtxt.glbmno[0]; @@ -1008,16 +1008,16 @@ static void OPT_InMod (int8 *mno) } } -static void OPT_InConstant (int32 f, OPT_Const conval) +static void OPT_InConstant (INT32 f, OPT_Const conval) { CHAR ch; - int16 i; + INT16 i; OPT_ConstExt ext = NIL; REAL rval; switch (f) { case 1: case 3: case 2: OPM_SymRCh(&ch); - conval->intval = (int16)ch; + conval->intval = (INT16)ch; break; case 4: conval->intval = OPM_SymRInt(); @@ -1057,10 +1057,10 @@ static void OPT_InConstant (int32 f, OPT_Const conval) } } -static void OPT_InSign (int8 mno, OPT_Struct *res, OPT_Object *par) +static void OPT_InSign (INT8 mno, OPT_Struct *res, OPT_Object *par) { OPT_Object last = NIL, new = NIL; - int32 tag; + INT32 tag; OPT_InStruct(&*res); tag = OPM_SymRInt(); last = NIL; @@ -1087,7 +1087,7 @@ static void OPT_InSign (int8 mno, OPT_Struct *res, OPT_Object *par) static OPT_Object OPT_InFld (void) { - int32 tag; + INT32 tag; OPT_Object obj = NIL; tag = OPT_impCtxt.nextTag; obj = OPT_NewObj(); @@ -1115,9 +1115,9 @@ static OPT_Object OPT_InFld (void) return obj; } -static OPT_Object OPT_InTProc (int8 mno) +static OPT_Object OPT_InTProc (INT8 mno) { - int32 tag; + INT32 tag; OPT_Object obj = NIL; tag = OPT_impCtxt.nextTag; obj = OPT_NewObj(); @@ -1141,7 +1141,7 @@ static OPT_Object OPT_InTProc (int8 mno) return obj; } -static OPT_Struct OPT_InTyp (int32 tag) +static OPT_Struct OPT_InTyp (INT32 tag) { if (tag == 4) { return OPT_IntType(OPM_SymRInt()); @@ -1155,9 +1155,9 @@ static OPT_Struct OPT_InTyp (int32 tag) static void OPT_InStruct (OPT_Struct *typ) { - int8 mno; - int16 ref; - int32 tag; + INT8 mno; + INT16 ref; + INT32 tag; OPS_Name name; OPT_Struct t = NIL; OPT_Object obj = NIL, last = NIL, fld = NIL, old = NIL, dummy = NIL; @@ -1213,7 +1213,7 @@ static void OPT_InStruct (OPT_Struct *typ) obj->vis = 0; tag = OPM_SymRInt(); if (tag == 35) { - (*typ)->sysflag = (int16)OPM_SymRInt(); + (*typ)->sysflag = (INT16)OPM_SymRInt(); tag = OPM_SymRInt(); } switch (tag) { @@ -1335,13 +1335,13 @@ static void OPT_InStruct (OPT_Struct *typ) } } -static OPT_Object OPT_InObj (int8 mno) +static OPT_Object OPT_InObj (INT8 mno) { - int16 i, s; + INT16 i, s; CHAR ch; OPT_Object obj = NIL, old = NIL; OPT_Struct typ = NIL; - int32 tag; + INT32 tag; OPT_ConstExt ext = NIL; tag = OPT_impCtxt.nextTag; if (tag == 19) { @@ -1374,7 +1374,7 @@ static OPT_Object OPT_InObj (int8 mno) obj->mode = 9; ext = OPT_NewExt(); obj->conval->ext = ext; - s = (int16)OPM_SymRInt(); + s = (INT16)OPM_SymRInt(); (*ext)[0] = (CHAR)s; i = 1; while (i <= s) { @@ -1439,7 +1439,7 @@ static OPT_Object OPT_InObj (int8 mno) void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) { OPT_Object obj = NIL; - int8 mno; + INT8 mno; OPS_Name aliasName__copy; __DUPARR(aliasName, OPS_Name); if (__STRCMP(name, "SYSTEM") == 0) { @@ -1482,7 +1482,7 @@ void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) static void OPT_OutName (CHAR *name, LONGINT name__len) { - int16 i; + INT16 i; CHAR ch; i = 0; do { @@ -1492,7 +1492,7 @@ static void OPT_OutName (CHAR *name, LONGINT name__len) } while (!(ch == 0x00)); } -static void OPT_OutMod (int16 mno) +static void OPT_OutMod (INT16 mno) { if (OPT_expCtxt.locmno[__X(mno, 64)] < 0) { OPM_SymWInt(16); @@ -1504,9 +1504,9 @@ static void OPT_OutMod (int16 mno) } } -static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, int32 adr) +static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, INT32 adr) { - int32 i, j, n; + INT32 i, j, n; OPT_Struct btyp = NIL; if (typ->comp == 4) { OPT_OutFlds(typ->link, adr, 0); @@ -1536,7 +1536,7 @@ static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, int32 adr) } } -static void OPT_OutFlds (OPT_Object fld, int32 adr, BOOLEAN visible) +static void OPT_OutFlds (OPT_Object fld, INT32 adr, BOOLEAN visible) { while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { @@ -1691,7 +1691,7 @@ static void OPT_OutStr (OPT_Struct typ) static void OPT_OutConstant (OPT_Object obj) { - int16 f; + INT16 f; REAL rval; f = obj->typ->form; OPM_SymWInt(f); @@ -1727,7 +1727,7 @@ static void OPT_OutConstant (OPT_Object obj) static void OPT_OutObj (OPT_Object obj) { - int16 i, j; + INT16 i, j; OPT_ConstExt ext = NIL; if (obj != NIL) { OPT_OutObj(obj->left); @@ -1794,7 +1794,7 @@ static void OPT_OutObj (OPT_Object obj) OPM_SymWInt(33); OPT_OutSign(obj->typ, obj->link); ext = obj->conval->ext; - j = (int16)(*ext)[0]; + j = (INT16)(*ext)[0]; i = 1; OPM_SymWInt(j); while (i <= j) { @@ -1817,8 +1817,8 @@ static void OPT_OutObj (OPT_Object obj) void OPT_Export (BOOLEAN *ext, BOOLEAN *new) { - int16 i; - int8 nofmod; + INT16 i; + INT8 nofmod; BOOLEAN done; OPT_symExtended = 0; OPT_symNew = 0; @@ -1857,7 +1857,7 @@ void OPT_Export (BOOLEAN *ext, BOOLEAN *new) } } -static void OPT_InitStruct (OPT_Struct *typ, int8 form) +static void OPT_InitStruct (OPT_Struct *typ, INT8 form) { *typ = OPT_NewStr(form, 1); (*typ)->ref = form; @@ -1871,7 +1871,7 @@ static void OPT_InitStruct (OPT_Struct *typ, int8 form) (*typ)->idfpdone = 1; } -static void OPT_EnterBoolConst (OPS_Name name, int32 value) +static void OPT_EnterBoolConst (OPS_Name name, INT32 value) { OPT_Object obj = NIL; OPS_Name name__copy; @@ -1883,7 +1883,7 @@ static void OPT_EnterBoolConst (OPS_Name name, int32 value) obj->conval->intval = value; } -static void OPT_EnterTyp (OPS_Name name, int8 form, int16 size, OPT_Struct *res) +static void OPT_EnterTyp (OPS_Name name, INT8 form, INT16 size, OPT_Struct *res) { OPT_Object obj = NIL; OPT_Struct typ = NIL; @@ -1918,7 +1918,7 @@ static void OPT_EnterTypeAlias (OPS_Name name, OPT_Object *res) *res = obj; } -static void OPT_EnterProc (OPS_Name name, int16 num) +static void OPT_EnterProc (OPS_Name name, INT16 num) { OPT_Object obj = NIL; OPS_Name name__copy; diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index 38cd17c7..66f25d3d 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h @@ -15,9 +15,9 @@ typedef typedef struct OPT_ConstDesc { OPT_ConstExt ext; - int64 intval; - int32 intval2; - uint64 setval; + INT64 intval; + INT32 intval2; + UINT64 setval; LONGREAL realval; } OPT_ConstDesc; @@ -33,7 +33,7 @@ typedef typedef struct OPT_NodeDesc { OPT_Node left, right, link; - int8 class, subcl; + INT8 class, subcl; BOOLEAN readonly; OPT_Struct typ; OPT_Object obj; @@ -45,20 +45,20 @@ typedef OPT_Object left, right, link, scope; OPS_Name name; BOOLEAN leaf; - int8 mode, mnolev, vis, history; + INT8 mode, mnolev, vis, history; BOOLEAN used, fpdone; - int32 fprint; + INT32 fprint; OPT_Struct typ; OPT_Const conval; - int32 adr, linkadr; - int16 x; + INT32 adr, linkadr; + INT16 x; } OPT_ObjDesc; typedef struct OPT_StrDesc { - int8 form, comp, mno, extlev; - int16 ref, sysflag; - int32 n, size, align, txtpos; + INT8 form, comp, mno, extlev; + INT16 ref, sysflag; + INT32 n, size, align, txtpos; BOOLEAN allocated, pbused, pvused; char _prvt0[16]; OPT_Struct BaseTyp; @@ -69,22 +69,22 @@ typedef import OPT_Object OPT_topScope; import OPT_Struct OPT_undftyp, OPT_niltyp, OPT_notyp, OPT_bytetyp, OPT_cpbytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_settyp, OPT_set32typ, OPT_set64typ, OPT_realtyp, OPT_lrltyp, OPT_stringtyp, OPT_adrtyp, OPT_sysptrtyp; import OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj, OPT_setobj; -import int8 OPT_nofGmod; +import INT8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; import BOOLEAN OPT_SYSimported; -import address *OPT_ConstDesc__typ; -import address *OPT_ObjDesc__typ; -import address *OPT_StrDesc__typ; -import address *OPT_NodeDesc__typ; +import ADDRESS *OPT_ConstDesc__typ; +import ADDRESS *OPT_ObjDesc__typ; +import ADDRESS *OPT_StrDesc__typ; +import ADDRESS *OPT_NodeDesc__typ; -import void OPT_Align (int32 *adr, int32 base); -import int32 OPT_BaseAlignment (OPT_Struct typ); +import void OPT_Align (INT32 *adr, INT32 base); +import INT32 OPT_BaseAlignment (OPT_Struct typ); import void OPT_Close (void); import void OPT_CloseScope (void); import void OPT_Export (BOOLEAN *ext, BOOLEAN *new); -import void OPT_FPrintErr (OPT_Object obj, int16 errcode); +import void OPT_FPrintErr (OPT_Object obj, INT16 errcode); import void OPT_FPrintObj (OPT_Object obj); import void OPT_FPrintStr (OPT_Struct typ); import void OPT_Find (OPT_Object *res); @@ -92,21 +92,21 @@ import void OPT_FindField (OPS_Name name, OPT_Struct typ, OPT_Object *res); import void OPT_FindImport (OPT_Object mod, OPT_Object *res); import void OPT_IdFPrint (OPT_Struct typ); import void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); -import void OPT_Init (OPS_Name name, uint32 opt); +import void OPT_Init (OPS_Name name, UINT32 opt); import void OPT_InitRecno (void); import void OPT_Insert (OPS_Name name, OPT_Object *obj); import void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); -import int16 OPT_IntSize (int64 n); -import OPT_Struct OPT_IntType (int32 size); +import INT16 OPT_IntSize (INT64 n); +import OPT_Struct OPT_IntType (INT32 size); import OPT_Const OPT_NewConst (void); import OPT_ConstExt OPT_NewExt (void); -import OPT_Node OPT_NewNode (int8 class); +import OPT_Node OPT_NewNode (INT8 class); import OPT_Object OPT_NewObj (void); -import OPT_Struct OPT_NewStr (int8 form, int8 comp); -import void OPT_OpenScope (int8 level, OPT_Object owner); -import OPT_Struct OPT_SetType (int32 size); -import OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir); -import int32 OPT_SizeAlignment (int32 size); +import OPT_Struct OPT_NewStr (INT8 form, INT8 comp); +import void OPT_OpenScope (INT8 level, OPT_Object owner); +import OPT_Struct OPT_SetType (INT32 size); +import OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INT16 dir); +import INT32 OPT_SizeAlignment (INT32 size); import void OPT_TypSize (OPT_Struct typ); import void *OPT__init(void); diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index f44318ed..8854dd67 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "OPC.h" @@ -13,42 +13,42 @@ typedef struct OPV_ExitInfo { - int16 level, label; + INT16 level, label; } OPV_ExitInfo; -static int16 OPV_stamp; +static INT16 OPV_stamp; static OPV_ExitInfo OPV_exit; -static int16 OPV_nofExitLabels; +static INT16 OPV_nofExitLabels; -export address *OPV_ExitInfo__typ; +export ADDRESS *OPV_ExitInfo__typ; static void OPV_ActualPar (OPT_Node n, OPT_Object fp); export void OPV_AdrAndSize (OPT_Object topScope); static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc); -static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int16 prec); +static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INT16 prec); static void OPV_DefineTDescs (OPT_Node n); -static void OPV_Entier (OPT_Node n, int16 prec); +static void OPV_Entier (OPT_Node n, INT16 prec); static void OPV_GetTProcNum (OPT_Object obj); static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc); static BOOLEAN OPV_ImplicitReturn (OPT_Node n); -static void OPV_Index (OPT_Node n, OPT_Node d, int16 prec, int16 dim); +static void OPV_Index (OPT_Node n, OPT_Node d, INT16 prec, INT16 dim); export void OPV_Init (void); static void OPV_InitTDescs (OPT_Node n); -static void OPV_Len (OPT_Node n, int64 dim); +static void OPV_Len (OPT_Node n, INT64 dim); export void OPV_Module (OPT_Node prog); static void OPV_NewArr (OPT_Node d, OPT_Node x); -static void OPV_ParIntLiteral (int64 n, int32 size); -static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp); +static void OPV_ParIntLiteral (INT64 n, INT32 size); +static INT16 OPV_Precedence (INT16 class, INT16 subclass, INT16 form, INT16 comp); static BOOLEAN OPV_SideEffects (OPT_Node n); -static void OPV_SizeCast (OPT_Node n, int32 to); +static void OPV_SizeCast (OPT_Node n, INT32 to); static void OPV_Stamp (OPS_Name s); static OPT_Object OPV_SuperProc (OPT_Node n); static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported); static void OPV_TraverseRecord (OPT_Struct typ); static void OPV_TypeOf (OPT_Node n); -static void OPV_design (OPT_Node n, int16 prec); -static void OPV_expr (OPT_Node n, int16 prec); +static void OPV_design (OPT_Node n, INT16 prec); +static void OPV_expr (OPT_Node n, INT16 prec); static void OPV_stat (OPT_Node n, OPT_Object outerProc); @@ -60,7 +60,7 @@ void OPV_Init (void) static void OPV_GetTProcNum (OPT_Object obj) { - int32 oldPos; + INT32 oldPos; OPT_Struct typ = NIL; OPT_Object redef = NIL; oldPos = OPM_errpos; @@ -96,7 +96,7 @@ static void OPV_TraverseRecord (OPT_Struct typ) static void OPV_Stamp (OPS_Name s) { - int16 i, j, k; + INT16 i, j, k; CHAR n[10]; OPV_stamp += 1; i = 0; @@ -126,7 +126,7 @@ static void OPV_Stamp (OPS_Name s) static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported) { - int16 mode; + INT16 mode; OPT_Object scope = NIL; OPT_Struct typ = NIL; if (obj != NIL) { @@ -205,7 +205,7 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_sysptrtyp->strobj->linkadr = 2; } -static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp) +static INT16 OPV_Precedence (INT16 class, INT16 subclass, INT16 form, INT16 comp) { switch (class) { case 7: case 0: case 2: case 4: case 9: @@ -315,7 +315,7 @@ static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp __RETCHK; } -static void OPV_Len (OPT_Node n, int64 dim) +static void OPV_Len (OPT_Node n, INT64 dim) { while ((n->class == 4 && n->typ->comp == 3)) { dim += 1; @@ -341,7 +341,7 @@ static BOOLEAN OPV_SideEffects (OPT_Node n) __RETCHK; } -static void OPV_Entier (OPT_Node n, int16 prec) +static void OPV_Entier (OPT_Node n, INT16 prec) { if (__IN(n->typ->form, 0x60, 32)) { OPM_WriteString((CHAR*)"__ENTIER(", 10); @@ -352,7 +352,7 @@ static void OPV_Entier (OPT_Node n, int16 prec) } } -static void OPV_SizeCast (OPT_Node n, int32 to) +static void OPV_SizeCast (OPT_Node n, INT32 to) { if ((to < n->typ->size && __IN(2, OPM_Options, 32))) { OPM_WriteString((CHAR*)"__SHORT", 8); @@ -366,16 +366,16 @@ static void OPV_SizeCast (OPT_Node n, int32 to) OPM_Write(')'); } else { if ((n->typ->size != to && (n->typ->size > 4 || to != 4))) { - OPM_WriteString((CHAR*)"(int", 5); + OPM_WriteString((CHAR*)"(INT", 5); OPM_WriteInt(__ASHL(to, 3)); OPM_WriteString((CHAR*)")", 2); } } } -static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int16 prec) +static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INT16 prec) { - int16 from, to; + INT16 from, to; from = n->typ->form; to = newtype->form; if (to == 7) { @@ -432,7 +432,7 @@ static void OPV_TypeOf (OPT_Node n) } } -static void OPV_Index (OPT_Node n, OPT_Node d, int16 prec, int16 dim) +static void OPV_Index (OPT_Node n, OPT_Node d, INT16 prec, INT16 dim) { if (!__IN(0, OPM_Options, 32) || (n->right->class == 7 && (n->right->conval->intval == 0 || n->left->typ->comp != 3))) { OPV_expr(n->right, prec); @@ -449,18 +449,18 @@ static void OPV_Index (OPT_Node n, OPT_Node d, int16 prec, int16 dim) } } -static void OPV_design (OPT_Node n, int16 prec) +static void OPV_design (OPT_Node n, INT16 prec) { OPT_Object obj = NIL; OPT_Struct typ = NIL; - int16 class, designPrec, comp; + INT16 class, designPrec, comp; OPT_Node d = NIL, x = NIL; - int16 dims, i, _for__26; + INT16 dims, i, _for__26; comp = n->typ->comp; obj = n->obj; class = n->class; designPrec = OPV_Precedence(class, n->subcl, n->typ->form, comp); - if ((((((class == 0 && obj->mnolev > 0)) && (int16)obj->mnolev != OPM_level)) && prec == 10)) { + if ((((((class == 0 && obj->mnolev > 0)) && (INT16)obj->mnolev != OPM_level)) && prec == 10)) { designPrec = 9; } if (prec > designPrec) { @@ -559,7 +559,7 @@ static void OPV_design (OPT_Node n, int16 prec) if (__IN(3, OPM_Options, 32)) { if (typ->comp == 4) { OPM_WriteString((CHAR*)"__GUARDR(", 10); - if ((int16)obj->mnolev != OPM_level) { + if ((INT16)obj->mnolev != OPM_level) { OPM_WriteStringVar((void*)obj->scope->name, 256); OPM_WriteString((CHAR*)"__curr->", 9); OPC_Ident(obj); @@ -628,7 +628,7 @@ static void OPV_design (OPT_Node n, int16 prec) } } -static void OPV_ParIntLiteral (int64 n, int32 size) +static void OPV_ParIntLiteral (INT64 n, INT32 size) { OPM_WriteInt(n); } @@ -636,7 +636,7 @@ static void OPV_ParIntLiteral (int64 n, int32 size) static void OPV_ActualPar (OPT_Node n, OPT_Object fp) { OPT_Struct typ = NIL, aptyp = NIL; - int16 comp, form, mode, prec, dim; + INT16 comp, form, mode, prec, dim; OPM_Write('('); while (n != NIL) { typ = fp->typ; @@ -726,9 +726,9 @@ static OPT_Object OPV_SuperProc (OPT_Node n) return obj; } -static void OPV_expr (OPT_Node n, int16 prec) +static void OPV_expr (OPT_Node n, INT16 prec) { - int16 class, subclass, form, exprPrec; + INT16 class, subclass, form, exprPrec; OPT_Struct typ = NIL; OPT_Node l = NIL, r = NIL; OPT_Object proc = NIL; @@ -1050,7 +1050,7 @@ static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) OPT_Node if_ = NIL; OPT_Object obj = NIL; OPT_Struct typ = NIL; - int32 adr; + INT32 adr; if_ = n->left; while (if_ != NIL) { OPM_WriteString((CHAR*)"if ", 4); @@ -1100,8 +1100,8 @@ static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc) { OPT_Node switchCase = NIL, label = NIL; - int64 low, high; - int16 form, i; + INT64 low, high; + INT16 form, i; OPM_WriteString((CHAR*)"switch ", 8); OPV_expr(n->left, 12); OPM_Write(' '); @@ -1166,7 +1166,7 @@ static BOOLEAN OPV_ImplicitReturn (OPT_Node n) static void OPV_NewArr (OPT_Node d, OPT_Node x) { OPT_Struct typ = NIL, base = NIL; - int16 nofdim, nofdyn; + INT16 nofdim, nofdyn; typ = d->typ->BaseTyp; base = typ; nofdim = 0; diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index 2fa9186d..513d8dfa 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Out.c b/bootstrap/windows-48/Out.c index 6098e568..03213c6a 100644 --- a/bootstrap/windows-48/Out.c +++ b/bootstrap/windows-48/Out.c @@ -1,37 +1,37 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "Platform.h" static CHAR Out_buf[128]; -static int16 Out_in; +static INT16 Out_in; export void Out_Char (CHAR ch); export void Out_Flush (void); -export void Out_Int (int64 x, int64 n); -static int32 Out_Length (CHAR *s, LONGINT s__len); +export void Out_Int (INT64 x, INT64 n); +static INT32 Out_Length (CHAR *s, LONGINT s__len); export void Out_Ln (void); -export void Out_LongReal (LONGREAL x, int16 n); +export void Out_LongReal (LONGREAL x, INT16 n); export void Out_Open (void); -export void Out_Real (REAL x, int16 n); -static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_); +export void Out_Real (REAL x, INT16 n); +static void Out_RealP (LONGREAL x, INT16 n, BOOLEAN long_); export void Out_String (CHAR *str, LONGINT str__len); -export LONGREAL Out_Ten (int16 e); -static void Out_digit (int64 n, CHAR *s, LONGINT s__len, int16 *i); -static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16 *i); +export LONGREAL Out_Ten (INT16 e); +static void Out_digit (INT64 n, CHAR *s, LONGINT s__len, INT16 *i); +static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, INT16 *i); #define Out_Entier64(x) (int64)(x) void Out_Flush (void) { - int16 error; + INT16 error; if (Out_in > 0) { error = Platform_Write(Platform_StdOut, (address)Out_buf, Out_in); } @@ -54,9 +54,9 @@ void Out_Char (CHAR ch) } } -static int32 Out_Length (CHAR *s, LONGINT s__len) +static INT32 Out_Length (CHAR *s, LONGINT s__len) { - int32 l; + INT32 l; l = 0; while ((l < s__len && s[__X(l, s__len)] != 0x00)) { l += 1; @@ -66,8 +66,8 @@ static int32 Out_Length (CHAR *s, LONGINT s__len) void Out_String (CHAR *str, LONGINT str__len) { - int32 l; - int16 error; + INT32 l; + INT16 error; __DUP(str, str__len, CHAR); l = Out_Length((void*)str, str__len); if (Out_in + l > 128) { @@ -77,15 +77,15 @@ void Out_String (CHAR *str, LONGINT str__len) error = Platform_Write(Platform_StdOut, (address)str, l); } else { __MOVE((address)str, (address)&Out_buf[__X(Out_in, 128)], l); - Out_in += (int16)l; + Out_in += (INT16)l; } __DEL(str); } -void Out_Int (int64 x, int64 n) +void Out_Int (INT64 x, INT64 n) { CHAR s[22]; - int16 i; + INT16 i; BOOLEAN negative; negative = x < 0; if (x == (-9223372036854775807-1)) { @@ -108,7 +108,7 @@ void Out_Int (int64 x, int64 n) s[__X(i, 22)] = '-'; i += 1; } - while (n > (int64)i) { + while (n > (INT64)i) { Out_Char(' '); n -= 1; } @@ -124,22 +124,22 @@ void Out_Ln (void) Out_Flush(); } -static void Out_digit (int64 n, CHAR *s, LONGINT s__len, int16 *i) +static void Out_digit (INT64 n, CHAR *s, LONGINT s__len, INT16 *i) { *i -= 1; s[__X(*i, s__len)] = (CHAR)(__MOD(n, 10) + 48); } -static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16 *i) +static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, INT16 *i) { - int16 j; - int32 l; + INT16 j; + INT32 l; __DUP(t, t__len, CHAR); l = Out_Length((void*)t, t__len); if (l > *i) { l = *i; } - *i -= (int16)l; + *i -= (INT16)l; j = 0; while (j < l) { s[__X(*i + j, s__len)] = t[__X(j, t__len)]; @@ -148,7 +148,7 @@ static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16 __DEL(t); } -LONGREAL Out_Ten (int16 e) +LONGREAL Out_Ten (INT16 e) { LONGREAL r, power; r = (LONGREAL)1; @@ -163,19 +163,19 @@ LONGREAL Out_Ten (int16 e) return r; } -static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_) +static void Out_RealP (LONGREAL x, INT16 n, BOOLEAN long_) { - int16 e; - int64 f; + INT16 e; + INT64 f; CHAR s[30]; - int16 i, el; + INT16 i, el; LONGREAL x0; BOOLEAN nn, en; - int64 m; - int16 d, dr; - e = (int16)__MASK(__ASHR((__VAL(int64, x)), 52), -2048); - f = __MASK((__VAL(int64, x)), -4503599627370496); - nn = (__VAL(int64, x) < 0 && !((e == 2047 && f != 0))); + INT64 m; + INT16 d, dr; + e = (INT16)__MASK(__ASHR((__VAL(INT64, x)), 52), -2048); + f = __MASK((__VAL(INT64, x)), -4503599627370496); + nn = (__VAL(INT64, x) < 0 && !((e == 2047 && f != 0))); if (nn) { n -= 1; } @@ -221,7 +221,7 @@ static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_) if (nn) { x = -x; } - e = (int16)__ASHR((e - 1023) * 77, 8); + e = (INT16)__ASHR((e - 1023) * 77, 8); if (e >= 0) { x = x / (LONGREAL)Out_Ten(e); } else { @@ -291,12 +291,12 @@ static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_) } } -void Out_Real (REAL x, int16 n) +void Out_Real (REAL x, INT16 n) { Out_RealP(x, n, 0); } -void Out_LongReal (LONGREAL x, int16 n) +void Out_LongReal (LONGREAL x, INT16 n) { Out_RealP(x, n, 1); } diff --git a/bootstrap/windows-48/Out.h b/bootstrap/windows-48/Out.h index fbaed75f..a685b291 100644 --- a/bootstrap/windows-48/Out.h +++ b/bootstrap/windows-48/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h @@ -10,13 +10,13 @@ import void Out_Char (CHAR ch); import void Out_Flush (void); -import void Out_Int (int64 x, int64 n); +import void Out_Int (INT64 x, INT64 n); import void Out_Ln (void); -import void Out_LongReal (LONGREAL x, int16 n); +import void Out_LongReal (LONGREAL x, INT16 n); import void Out_Open (void); -import void Out_Real (REAL x, int16 n); +import void Out_Real (REAL x, INT16 n); import void Out_String (CHAR *str, LONGINT str__len); -import LONGREAL Out_Ten (int16 e); +import LONGREAL Out_Ten (INT16 e); import void *Out__init(void); diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 39e59543..4a084fb4 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" @@ -14,92 +14,92 @@ typedef Platform_ArgPtr (*Platform_ArgVec)[1024]; typedef - int32 (*Platform_ArgVecPtr)[1]; + INT32 (*Platform_ArgVecPtr)[1]; typedef CHAR (*Platform_EnvPtr)[1024]; typedef struct Platform_FileIdentity { - int32 volume, indexhigh, indexlow, mtimehigh, mtimelow; + INT32 volume, indexhigh, indexlow, mtimehigh, mtimelow; } Platform_FileIdentity; typedef - void (*Platform_HaltProcedure)(int32); + void (*Platform_HaltProcedure)(INT32); typedef - void (*Platform_SignalHandler)(int32); + void (*Platform_SignalHandler)(INT32); export BOOLEAN Platform_LittleEndian; -export int32 Platform_MainStackFrame; -export int32 Platform_HaltCode; -export int16 Platform_PID; +export INT32 Platform_MainStackFrame; +export INT32 Platform_HaltCode; +export INT16 Platform_PID; export CHAR Platform_CWD[4096]; -export int16 Platform_ArgCount; -export int32 Platform_ArgVector; +export INT16 Platform_ArgCount; +export INT32 Platform_ArgVector; static Platform_HaltProcedure Platform_HaltHandler; -static int32 Platform_TimeStart; -export int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; -export int32 Platform_StdIn, Platform_StdOut, Platform_StdErr; +static INT32 Platform_TimeStart; +export INT16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; +export INT32 Platform_StdIn, Platform_StdOut, Platform_StdErr; static Platform_SignalHandler Platform_InterruptHandler; export CHAR Platform_NL[3]; -export address *Platform_FileIdentity__typ; +export ADDRESS *Platform_FileIdentity__typ; -export BOOLEAN Platform_Absent (int16 e); -export int16 Platform_ArgPos (CHAR *s, LONGINT s__len); -export void Platform_AssertFail (int32 code); -export int16 Platform_Chdir (CHAR *n, LONGINT n__len); -export int16 Platform_Close (int32 h); -export BOOLEAN Platform_ConnectionFailed (int16 e); -export void Platform_Delay (int32 ms); -export BOOLEAN Platform_DifferentFilesystems (int16 e); -static void Platform_DisplayHaltCode (int32 code); -export int16 Platform_Error (void); -export void Platform_Exit (int16 code); -export void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len); -export void Platform_GetClock (int32 *t, int32 *d); +export BOOLEAN Platform_Absent (INT16 e); +export INT16 Platform_ArgPos (CHAR *s, LONGINT s__len); +export void Platform_AssertFail (INT32 code); +export INT16 Platform_Chdir (CHAR *n, LONGINT n__len); +export INT16 Platform_Close (INT32 h); +export BOOLEAN Platform_ConnectionFailed (INT16 e); +export void Platform_Delay (INT32 ms); +export BOOLEAN Platform_DifferentFilesystems (INT16 e); +static void Platform_DisplayHaltCode (INT32 code); +export INT16 Platform_Error (void); +export void Platform_Exit (INT16 code); +export void Platform_GetArg (INT16 n, CHAR *val, LONGINT val__len); +export void Platform_GetClock (INT32 *t, INT32 *d); export void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); -export void Platform_GetIntArg (int16 n, int32 *val); -export void Platform_GetTimeOfDay (int32 *sec, int32 *usec); -export void Platform_Halt (int32 code); -export int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ); -export int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); -export BOOLEAN Platform_Inaccessible (int16 e); -export void Platform_Init (int32 argc, int32 argvadr); -export BOOLEAN Platform_Interrupted (int16 e); -export void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); -export int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); -export BOOLEAN Platform_NoSuchDirectory (int16 e); -export int32 Platform_OSAllocate (int32 size); -export void Platform_OSFree (int32 address); -export int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); -export int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); -export int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n); -export int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n); -export int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); +export void Platform_GetIntArg (INT16 n, INT32 *val); +export void Platform_GetTimeOfDay (INT32 *sec, INT32 *usec); +export void Platform_Halt (INT32 code); +export INT16 Platform_Identify (INT32 h, Platform_FileIdentity *identity, ADDRESS *identity__typ); +export INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ); +export BOOLEAN Platform_Inaccessible (INT16 e); +export void Platform_Init (INT32 argc, INT32 argvadr); +export BOOLEAN Platform_Interrupted (INT16 e); +export void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d); +export INT16 Platform_New (CHAR *n, LONGINT n__len, INT32 *h); +export BOOLEAN Platform_NoSuchDirectory (INT16 e); +export INT32 Platform_OSAllocate (INT32 size); +export void Platform_OSFree (INT32 address); +export INT16 Platform_OldRO (CHAR *n, LONGINT n__len, INT32 *h); +export INT16 Platform_OldRW (CHAR *n, LONGINT n__len, INT32 *h); +export INT16 Platform_Read (INT32 h, INT32 p, INT32 l, INT32 *n); +export INT16 Platform_ReadBuf (INT32 h, SYSTEM_BYTE *b, LONGINT b__len, INT32 *n); +export INT16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); export BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); export BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); -export int16 Platform_Seek (int32 h, int32 o, int16 r); +export INT16 Platform_Seek (INT32 h, INT32 o, INT16 r); export void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); export void Platform_SetHalt (Platform_HaltProcedure p); -export void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Platform_FileIdentity source); -export int16 Platform_Size (int32 h, int32 *l); -export int16 Platform_Sync (int32 h); -export int16 Platform_System (CHAR *cmd, LONGINT cmd__len); +export void Platform_SetMTime (Platform_FileIdentity *target, ADDRESS *target__typ, Platform_FileIdentity source); +export INT16 Platform_Size (INT32 h, INT32 *l); +export INT16 Platform_Sync (INT32 h); +export INT16 Platform_System (CHAR *cmd, LONGINT cmd__len); static void Platform_TestLittleEndian (void); -export int32 Platform_Time (void); -export BOOLEAN Platform_TimedOut (int16 e); -export BOOLEAN Platform_TooManyFiles (int16 e); -export int16 Platform_Truncate (int32 h, int32 limit); -export int16 Platform_Unlink (CHAR *n, LONGINT n__len); -export int16 Platform_Write (int32 h, int32 p, int32 l); -static void Platform_YMDHMStoClock (int16 ye, int16 mo, int16 da, int16 ho, int16 mi, int16 se, int32 *t, int32 *d); +export INT32 Platform_Time (void); +export BOOLEAN Platform_TimedOut (INT16 e); +export BOOLEAN Platform_TooManyFiles (INT16 e); +export INT16 Platform_Truncate (INT32 h, INT32 limit); +export INT16 Platform_Unlink (CHAR *n, LONGINT n__len); +export INT16 Platform_Write (INT32 h, INT32 p, INT32 l); +static void Platform_YMDHMStoClock (INT16 ye, INT16 mo, INT16 da, INT16 ho, INT16 mi, INT16 se, INT32 *t, INT32 *d); static void Platform_errch (CHAR c); -static void Platform_errint (int32 l); +static void Platform_errint (INT32 l); static void Platform_errln (void); -static void Platform_errposint (int32 l); +static void Platform_errposint (INT32 l); export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); #include "WindowsWrapper.h" @@ -118,11 +118,11 @@ export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT #define Platform_ERRORWRITEPROTECT() ERROR_WRITE_PROTECT #define Platform_ETIMEDOUT() WSAETIMEDOUT extern void Heap_InitHeap(); -#define Platform_GetTickCount() (LONGINT)(uint32)GetTickCount() +#define Platform_GetTickCount() (LONGINT)(UINT32)GetTickCount() #define Platform_HeapInitHeap() Heap_InitHeap() -#define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((address)h) -#define Platform_SetQuitHandler(h) SystemSetQuitHandler((address)h) -#define Platform_allocate(size) (address)((void*)HeapAlloc(GetProcessHeap(), 0, (size_t)size)) +#define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((ADDRESS)h) +#define Platform_SetQuitHandler(h) SystemSetQuitHandler((ADDRESS)h) +#define Platform_allocate(size) (ADDRESS)((void*)HeapAlloc(GetProcessHeap(), 0, (size_t)size)) #define Platform_bhfiIndexHigh() (LONGINT)bhfi.nFileIndexHigh #define Platform_bhfiIndexLow() (LONGINT)bhfi.nFileIndexLow #define Platform_bhfiMtimeHigh() (LONGINT)bhfi.ftLastWriteTime.dwHighDateTime @@ -130,44 +130,44 @@ extern void Heap_InitHeap(); #define Platform_bhfiVsn() (LONGINT)bhfi.dwVolumeSerialNumber #define Platform_byHandleFileInformation() BY_HANDLE_FILE_INFORMATION bhfi #define Platform_cleanupProcess() CloseHandle(pi.hProcess); CloseHandle(pi.hThread); -#define Platform_closeHandle(h) (INTEGER)CloseHandle((HANDLE)(address)h) +#define Platform_closeHandle(h) (INTEGER)CloseHandle((HANDLE)(ADDRESS)h) #define Platform_createProcess(str, str__len) (INTEGER)CreateProcess(0, (char*)str, 0,0,0,0,0,0,&si,&pi) #define Platform_deleteFile(n, n__len) (INTEGER)DeleteFile((char*)n) #define Platform_err() (INTEGER)GetLastError() -#define Platform_errc(c) WriteFile((HANDLE)(address)Platform_StdOut, &c, 1, 0,0) -#define Platform_errstring(s, s__len) WriteFile((HANDLE)(address)Platform_StdOut, s, s__len-1, 0,0) +#define Platform_errc(c) WriteFile((HANDLE)(ADDRESS)Platform_StdOut, &c, 1, 0,0) +#define Platform_errstring(s, s__len) WriteFile((HANDLE)(ADDRESS)Platform_StdOut, s, s__len-1, 0,0) #define Platform_exit(code) ExitProcess((UINT)code) #define Platform_fileTimeToSysTime() SYSTEMTIME st; FileTimeToSystemTime(&ft, &st) -#define Platform_flushFileBuffers(h) (INTEGER)FlushFileBuffers((HANDLE)(address)h) +#define Platform_flushFileBuffers(h) (INTEGER)FlushFileBuffers((HANDLE)(ADDRESS)h) #define Platform_free(address) HeapFree(GetProcessHeap(), 0, (void*)address) #define Platform_ftToUli() ULARGE_INTEGER ul; ul.LowPart=ft.dwLowDateTime; ul.HighPart=ft.dwHighDateTime #define Platform_getCurrentDirectory(n, n__len) GetCurrentDirectory(n__len, (char*)n) #define Platform_getExitCodeProcess(exitcode) GetExitCodeProcess(pi.hProcess, (DWORD*)exitcode); -#define Platform_getFileInformationByHandle(h) (INTEGER)GetFileInformationByHandle((HANDLE)(address)h, &bhfi) -#define Platform_getFilePos(h, r, rc) LARGE_INTEGER liz = {0}; *rc = (INTEGER)SetFilePointerEx((HANDLE)(address)h, liz, &li, FILE_CURRENT); *r = (LONGINT)li.QuadPart -#define Platform_getFileSize(h) (INTEGER)GetFileSizeEx((HANDLE)(address)h, &li) +#define Platform_getFileInformationByHandle(h) (INTEGER)GetFileInformationByHandle((HANDLE)(ADDRESS)h, &bhfi) +#define Platform_getFilePos(h, r, rc) LARGE_INTEGER liz = {0}; *rc = (INTEGER)SetFilePointerEx((HANDLE)(ADDRESS)h, liz, &li, FILE_CURRENT); *r = (LONGINT)li.QuadPart +#define Platform_getFileSize(h) (INTEGER)GetFileSizeEx((HANDLE)(ADDRESS)h, &li) #define Platform_getLocalTime() SYSTEMTIME st; GetLocalTime(&st) #define Platform_getenv(name, name__len, buf, buf__len) (INTEGER)GetEnvironmentVariable((char*)name, (char*)buf, buf__len) #define Platform_getpid() (INTEGER)GetCurrentProcessId() -#define Platform_getstderrhandle() (LONGINT)(address)GetStdHandle(STD_ERROR_HANDLE) -#define Platform_getstdinhandle() (LONGINT)(address)GetStdHandle(STD_INPUT_HANDLE) -#define Platform_getstdouthandle() (LONGINT)(address)GetStdHandle(STD_OUTPUT_HANDLE) +#define Platform_getstderrhandle() (LONGINT)(ADDRESS)GetStdHandle(STD_ERROR_HANDLE) +#define Platform_getstdinhandle() (LONGINT)(ADDRESS)GetStdHandle(STD_INPUT_HANDLE) +#define Platform_getstdouthandle() (LONGINT)(ADDRESS)GetStdHandle(STD_OUTPUT_HANDLE) #define Platform_identityToFileTime(i) FILETIME ft; ft.dwHighDateTime = i.mtimehigh; ft.dwLowDateTime = i.mtimelow -#define Platform_invalidHandleValue() ((LONGINT)(address)INVALID_HANDLE_VALUE) +#define Platform_invalidHandleValue() ((LONGINT)(ADDRESS)INVALID_HANDLE_VALUE) #define Platform_largeInteger() LARGE_INTEGER li #define Platform_liLongint() (LONGINT)li.QuadPart #define Platform_moveFile(o, o__len, n, n__len) (INTEGER)MoveFileEx((char*)o, (char*)n, MOVEFILE_REPLACE_EXISTING) -#define Platform_opennew(n, n__len) (LONGINT)(address)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0) -#define Platform_openro(n, n__len) (LONGINT)(address)CreateFile((char*)n, GENERIC_READ , FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) -#define Platform_openrw(n, n__len) (LONGINT)(address)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) +#define Platform_opennew(n, n__len) (LONGINT)(ADDRESS)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0) +#define Platform_openro(n, n__len) (LONGINT)(ADDRESS)CreateFile((char*)n, GENERIC_READ , FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) +#define Platform_openrw(n, n__len) (LONGINT)(ADDRESS)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) #define Platform_processInfo() PROCESS_INFORMATION pi = {0}; -#define Platform_readfile(fd, p, l, n) (INTEGER)ReadFile((HANDLE)(address)fd, (void*)p, (DWORD)l, (DWORD*)n, 0) +#define Platform_readfile(fd, p, l, n) (INTEGER)ReadFile((HANDLE)(ADDRESS)fd, (void*)p, (DWORD)l, (DWORD*)n, 0) #define Platform_seekcur() FILE_CURRENT #define Platform_seekend() FILE_END #define Platform_seekset() FILE_BEGIN #define Platform_setCurrentDirectory(n, n__len) (INTEGER)SetCurrentDirectory((char*)n) -#define Platform_setEndOfFile(h) (INTEGER)SetEndOfFile((HANDLE)(address)h) -#define Platform_setFilePointerEx(h, o, r, rc) li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((HANDLE)(address)h, li, 0, (DWORD)r) +#define Platform_setEndOfFile(h) (INTEGER)SetEndOfFile((HANDLE)(ADDRESS)h) +#define Platform_setFilePointerEx(h, o, r, rc) li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((HANDLE)(ADDRESS)h, li, 0, (DWORD)r) #define Platform_sleep(ms) Sleep((DWORD)ms) #define Platform_stToFt() FILETIME ft; SystemTimeToFileTime(&st, &ft) #define Platform_startupInfo() STARTUPINFO si = {0}; si.cb = sizeof(si); @@ -182,63 +182,63 @@ extern void Heap_InitHeap(); #define Platform_ulSec() (LONGINT)(ul.QuadPart / 1000000LL) #define Platform_uluSec() (LONGINT)(ul.QuadPart % 1000000LL) #define Platform_waitForProcess() (INTEGER)WaitForSingleObject(pi.hProcess, INFINITE) -#define Platform_writefile(fd, p, l) (INTEGER)WriteFile((HANDLE)(address)fd, (void*)(p), (DWORD)l, 0,0) +#define Platform_writefile(fd, p, l) (INTEGER)WriteFile((HANDLE)(ADDRESS)fd, (void*)(p), (DWORD)l, 0,0) -BOOLEAN Platform_TooManyFiles (int16 e) +BOOLEAN Platform_TooManyFiles (INT16 e) { return e == Platform_ERRORTOOMANYOPENFILES(); } -BOOLEAN Platform_NoSuchDirectory (int16 e) +BOOLEAN Platform_NoSuchDirectory (INT16 e) { return e == Platform_ERRORPATHNOTFOUND(); } -BOOLEAN Platform_DifferentFilesystems (int16 e) +BOOLEAN Platform_DifferentFilesystems (INT16 e) { return e == Platform_ERRORNOTSAMEDEVICE(); } -BOOLEAN Platform_Inaccessible (int16 e) +BOOLEAN Platform_Inaccessible (INT16 e) { return ((e == Platform_ERRORACCESSDENIED() || e == Platform_ERRORWRITEPROTECT()) || e == Platform_ERRORNOTREADY()) || e == Platform_ERRORSHARINGVIOLATION(); } -BOOLEAN Platform_Absent (int16 e) +BOOLEAN Platform_Absent (INT16 e) { return e == Platform_ERRORFILENOTFOUND() || e == Platform_ERRORPATHNOTFOUND(); } -BOOLEAN Platform_TimedOut (int16 e) +BOOLEAN Platform_TimedOut (INT16 e) { return e == Platform_ETIMEDOUT(); } -BOOLEAN Platform_ConnectionFailed (int16 e) +BOOLEAN Platform_ConnectionFailed (INT16 e) { return ((e == Platform_ECONNREFUSED() || e == Platform_ECONNABORTED()) || e == Platform_ENETUNREACH()) || e == Platform_EHOSTUNREACH(); } -BOOLEAN Platform_Interrupted (int16 e) +BOOLEAN Platform_Interrupted (INT16 e) { return e == Platform_EINTR(); } -int32 Platform_OSAllocate (int32 size) +INT32 Platform_OSAllocate (INT32 size) { return Platform_allocate(size); } -void Platform_OSFree (int32 address) +void Platform_OSFree (INT32 address) { Platform_free(address); } -void Platform_Init (int32 argc, int32 argvadr) +void Platform_Init (INT32 argc, INT32 argvadr) { Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; - Platform_ArgCount = __VAL(int16, argc); + Platform_ArgCount = __VAL(INT16, argc); av = (Platform_ArgVecPtr)(address)argvadr; Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; @@ -248,7 +248,7 @@ void Platform_Init (int32 argc, int32 argvadr) BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len) { CHAR buf[4096]; - int16 res; + INT16 res; __DUP(var, var__len, CHAR); res = Platform_getenv(var, var__len, (void*)buf, 4096); if ((res > 0 && res < 4096)) { @@ -271,7 +271,7 @@ void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len) __DEL(var); } -void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len) +void Platform_GetArg (INT16 n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { @@ -280,10 +280,10 @@ void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len) } } -void Platform_GetIntArg (int16 n, int32 *val) +void Platform_GetIntArg (INT16 n, INT32 *val) { CHAR s[64]; - int32 k, d, i; + INT32 k, d, i; s[0] = 0x00; Platform_GetArg(n, (void*)s, 64); i = 0; @@ -291,11 +291,11 @@ void Platform_GetIntArg (int16 n, int32 *val) i = 1; } k = 0; - d = (int16)s[__X(i, 64)] - 48; + d = (INT16)s[__X(i, 64)] - 48; while ((d >= 0 && d <= 9)) { k = k * 10 + d; i += 1; - d = (int16)s[__X(i, 64)] - 48; + d = (INT16)s[__X(i, 64)] - 48; } if (s[0] == '-') { k = -k; @@ -306,9 +306,9 @@ void Platform_GetIntArg (int16 n, int32 *val) } } -int16 Platform_ArgPos (CHAR *s, LONGINT s__len) +INT16 Platform_ArgPos (CHAR *s, LONGINT s__len) { - int16 i; + INT16 i; CHAR arg[256]; __DUP(s, s__len, CHAR); i = 0; @@ -325,26 +325,26 @@ void Platform_SetBadInstructionHandler (Platform_SignalHandler handler) { } -static void Platform_YMDHMStoClock (int16 ye, int16 mo, int16 da, int16 ho, int16 mi, int16 se, int32 *t, int32 *d) +static void Platform_YMDHMStoClock (INT16 ye, INT16 mo, INT16 da, INT16 ho, INT16 mi, INT16 se, INT32 *t, INT32 *d) { *d = (__ASHL((int)__MOD(ye, 100), 9) + __ASHL((mo + 1), 5)) + da; *t = (__ASHL(ho, 12) + __ASHL(mi, 6)) + se; } -void Platform_GetClock (int32 *t, int32 *d) +void Platform_GetClock (INT32 *t, INT32 *d) { Platform_getLocalTime(); Platform_YMDHMStoClock(Platform_styear(), Platform_stmon(), Platform_stmday(), Platform_sthour(), Platform_stmin(), Platform_stsec(), &*t, &*d); } -int32 Platform_Time (void) +INT32 Platform_Time (void) { - int32 ms; + INT32 ms; ms = Platform_GetTickCount(); return (int)__MOD(ms - Platform_TimeStart, 2147483647); } -void Platform_Delay (int32 ms) +void Platform_Delay (INT32 ms) { while (ms > 30000) { Platform_sleep(30000); @@ -355,7 +355,7 @@ void Platform_Delay (int32 ms) } } -void Platform_GetTimeOfDay (int32 *sec, int32 *usec) +void Platform_GetTimeOfDay (INT32 *sec, INT32 *usec) { Platform_getLocalTime(); Platform_stToFt(); @@ -365,9 +365,9 @@ void Platform_GetTimeOfDay (int32 *sec, int32 *usec) *usec = Platform_uluSec(); } -int16 Platform_System (CHAR *cmd, LONGINT cmd__len) +INT16 Platform_System (CHAR *cmd, LONGINT cmd__len) { - int16 result; + INT16 result; __DUP(cmd, cmd__len, CHAR); result = 127; Platform_startupInfo(); @@ -382,14 +382,14 @@ int16 Platform_System (CHAR *cmd, LONGINT cmd__len) return __ASHL(result, 8); } -int16 Platform_Error (void) +INT16 Platform_Error (void) { return Platform_err(); } -int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h) +INT16 Platform_OldRO (CHAR *n, LONGINT n__len, INT32 *h) { - int32 fd; + INT32 fd; fd = Platform_openro(n, n__len); if (fd == Platform_invalidHandleValue()) { return Platform_err(); @@ -400,9 +400,9 @@ int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h) __RETCHK; } -int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h) +INT16 Platform_OldRW (CHAR *n, LONGINT n__len, INT32 *h) { - int32 fd; + INT32 fd; fd = Platform_openrw(n, n__len); if (fd == Platform_invalidHandleValue()) { return Platform_err(); @@ -413,9 +413,9 @@ int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h) __RETCHK; } -int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h) +INT16 Platform_New (CHAR *n, LONGINT n__len, INT32 *h) { - int32 fd; + INT32 fd; fd = Platform_opennew(n, n__len); if (fd == Platform_invalidHandleValue()) { return Platform_err(); @@ -426,7 +426,7 @@ int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h) __RETCHK; } -int16 Platform_Close (int32 h) +INT16 Platform_Close (INT32 h) { if (Platform_closeHandle(h) == 0) { return Platform_err(); @@ -436,7 +436,7 @@ int16 Platform_Close (int32 h) __RETCHK; } -int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ) +INT16 Platform_Identify (INT32 h, Platform_FileIdentity *identity, ADDRESS *identity__typ) { Platform_byHandleFileInformation(); if (Platform_getFileInformationByHandle(h) == 0) { @@ -450,10 +450,10 @@ int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *iden return 0; } -int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ) +INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ) { - int32 h; - int16 e, i; + INT32 h; + INT16 e, i; __DUP(n, n__len, CHAR); e = Platform_OldRO((void*)n, n__len, &h); if (e != 0) { @@ -476,20 +476,20 @@ BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i return (i1.mtimehigh == i2.mtimehigh && i1.mtimelow == i2.mtimelow); } -void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Platform_FileIdentity source) +void Platform_SetMTime (Platform_FileIdentity *target, ADDRESS *target__typ, Platform_FileIdentity source) { (*target).mtimehigh = source.mtimehigh; (*target).mtimelow = source.mtimelow; } -void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d) +void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d) { Platform_identityToFileTime(i); Platform_fileTimeToSysTime(); Platform_YMDHMStoClock(Platform_styear(), Platform_stmon(), Platform_stmday(), Platform_sthour(), Platform_stmin(), Platform_stsec(), &*t, &*d); } -int16 Platform_Size (int32 h, int32 *l) +INT16 Platform_Size (INT32 h, INT32 *l) { Platform_largeInteger(); if (Platform_getFileSize(h) == 0) { @@ -499,10 +499,10 @@ int16 Platform_Size (int32 h, int32 *l) return 0; } -int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n) +INT16 Platform_Read (INT32 h, INT32 p, INT32 l, INT32 *n) { - int16 result; - int32 lengthread; + INT16 result; + INT32 lengthread; result = Platform_readfile(h, p, l, &lengthread); if (result == 0) { *n = 0; @@ -514,10 +514,10 @@ int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n) __RETCHK; } -int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n) +INT16 Platform_ReadBuf (INT32 h, SYSTEM_BYTE *b, LONGINT b__len, INT32 *n) { - int16 result; - int32 lengthread; + INT16 result; + INT32 lengthread; result = Platform_readfile(h, (address)b, b__len, &lengthread); if (result == 0) { *n = 0; @@ -529,7 +529,7 @@ int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n) __RETCHK; } -int16 Platform_Write (int32 h, int32 p, int32 l) +INT16 Platform_Write (INT32 h, INT32 p, INT32 l) { if (Platform_writefile(h, p, l) == 0) { return Platform_err(); @@ -539,7 +539,7 @@ int16 Platform_Write (int32 h, int32 p, int32 l) __RETCHK; } -int16 Platform_Sync (int32 h) +INT16 Platform_Sync (INT32 h) { if (Platform_flushFileBuffers(h) == 0) { return Platform_err(); @@ -549,9 +549,9 @@ int16 Platform_Sync (int32 h) __RETCHK; } -int16 Platform_Seek (int32 h, int32 o, int16 r) +INT16 Platform_Seek (INT32 h, INT32 o, INT16 r) { - int16 rc; + INT16 rc; Platform_largeInteger(); Platform_setFilePointerEx(h, o, r, &rc); if (rc == 0) { @@ -562,10 +562,10 @@ int16 Platform_Seek (int32 h, int32 o, int16 r) __RETCHK; } -int16 Platform_Truncate (int32 h, int32 limit) +INT16 Platform_Truncate (INT32 h, INT32 limit) { - int16 rc; - int32 oldpos; + INT16 rc; + INT32 oldpos; Platform_largeInteger(); Platform_getFilePos(h, &oldpos, &rc); if (rc == 0) { @@ -585,7 +585,7 @@ int16 Platform_Truncate (int32 h, int32 limit) return 0; } -int16 Platform_Unlink (CHAR *n, LONGINT n__len) +INT16 Platform_Unlink (CHAR *n, LONGINT n__len) { if (Platform_deleteFile(n, n__len) == 0) { return Platform_err(); @@ -595,9 +595,9 @@ int16 Platform_Unlink (CHAR *n, LONGINT n__len) __RETCHK; } -int16 Platform_Chdir (CHAR *n, LONGINT n__len) +INT16 Platform_Chdir (CHAR *n, LONGINT n__len) { - int16 r; + INT16 r; r = Platform_setCurrentDirectory(n, n__len); if (r == 0) { return Platform_err(); @@ -606,7 +606,7 @@ int16 Platform_Chdir (CHAR *n, LONGINT n__len) return 0; } -int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) +INT16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) { if (Platform_moveFile(o, o__len, n, n__len) == 0) { return Platform_err(); @@ -616,7 +616,7 @@ int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) __RETCHK; } -void Platform_Exit (int16 code) +void Platform_Exit (INT16 code) { Platform_exit(code); } @@ -632,7 +632,7 @@ static void Platform_errln (void) Platform_errch(0x0a); } -static void Platform_errposint (int32 l) +static void Platform_errposint (INT32 l) { if (l > 10) { Platform_errposint(__DIV(l, 10)); @@ -640,7 +640,7 @@ static void Platform_errposint (int32 l) Platform_errch((CHAR)(48 + (int)__MOD(l, 10))); } -static void Platform_errint (int32 l) +static void Platform_errint (INT32 l) { if (l < 0) { Platform_errch('-'); @@ -649,11 +649,11 @@ static void Platform_errint (int32 l) Platform_errposint(l); } -static void Platform_DisplayHaltCode (int32 code) +static void Platform_DisplayHaltCode (INT32 code) { switch (code) { case -1: - Platform_errstring((CHAR*)"Rider ReadBuf/WriteBuf transfer size longer than buffer.", 57); + Platform_errstring((CHAR*)"Assertion failure.", 19); break; case -2: Platform_errstring((CHAR*)"Index out of range.", 20); @@ -705,7 +705,7 @@ static void Platform_DisplayHaltCode (int32 code) } } -void Platform_Halt (int32 code) +void Platform_Halt (INT32 code) { Platform_HaltCode = code; if (Platform_HaltHandler != NIL) { @@ -718,10 +718,10 @@ void Platform_Halt (int32 code) Platform_DisplayHaltCode(code); } Platform_errln(); - Platform_exit(__VAL(int16, code)); + Platform_exit(__VAL(INT16, code)); } -void Platform_AssertFail (int32 code) +void Platform_AssertFail (INT32 code) { Platform_errstring((CHAR*)"Assertion failure.", 19); if (code != 0) { @@ -730,7 +730,7 @@ void Platform_AssertFail (int32 code) Platform_errstring((CHAR*)".", 2); } Platform_errln(); - Platform_exit(__VAL(int16, code)); + Platform_exit(__VAL(INT16, code)); } void Platform_SetHalt (Platform_HaltProcedure p) @@ -740,7 +740,7 @@ void Platform_SetHalt (Platform_HaltProcedure p) static void Platform_TestLittleEndian (void) { - int16 i; + INT16 i; i = 1; __GET((address)&i, Platform_LittleEndian, BOOLEAN); } diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index bf14c58e..27a42a84 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h @@ -7,80 +7,80 @@ typedef struct Platform_FileIdentity { - int32 _prvt0; + INT32 _prvt0; char _prvt1[16]; } Platform_FileIdentity; typedef - void (*Platform_HaltProcedure)(int32); + void (*Platform_HaltProcedure)(INT32); typedef - void (*Platform_SignalHandler)(int32); + void (*Platform_SignalHandler)(INT32); import BOOLEAN Platform_LittleEndian; -import int32 Platform_MainStackFrame; -import int32 Platform_HaltCode; -import int16 Platform_PID; +import INT32 Platform_MainStackFrame; +import INT32 Platform_HaltCode; +import INT16 Platform_PID; import CHAR Platform_CWD[4096]; -import int16 Platform_ArgCount; -import int32 Platform_ArgVector; -import int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; -import int32 Platform_StdIn, Platform_StdOut, Platform_StdErr; +import INT16 Platform_ArgCount; +import INT32 Platform_ArgVector; +import INT16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; +import INT32 Platform_StdIn, Platform_StdOut, Platform_StdErr; import CHAR Platform_NL[3]; -import address *Platform_FileIdentity__typ; +import ADDRESS *Platform_FileIdentity__typ; -import BOOLEAN Platform_Absent (int16 e); -import int16 Platform_ArgPos (CHAR *s, LONGINT s__len); -import void Platform_AssertFail (int32 code); -import int16 Platform_Chdir (CHAR *n, LONGINT n__len); -import int16 Platform_Close (int32 h); -import BOOLEAN Platform_ConnectionFailed (int16 e); -import void Platform_Delay (int32 ms); -import BOOLEAN Platform_DifferentFilesystems (int16 e); -import int16 Platform_Error (void); -import void Platform_Exit (int16 code); -import void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len); -import void Platform_GetClock (int32 *t, int32 *d); +import BOOLEAN Platform_Absent (INT16 e); +import INT16 Platform_ArgPos (CHAR *s, LONGINT s__len); +import void Platform_AssertFail (INT32 code); +import INT16 Platform_Chdir (CHAR *n, LONGINT n__len); +import INT16 Platform_Close (INT32 h); +import BOOLEAN Platform_ConnectionFailed (INT16 e); +import void Platform_Delay (INT32 ms); +import BOOLEAN Platform_DifferentFilesystems (INT16 e); +import INT16 Platform_Error (void); +import void Platform_Exit (INT16 code); +import void Platform_GetArg (INT16 n, CHAR *val, LONGINT val__len); +import void Platform_GetClock (INT32 *t, INT32 *d); import void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); -import void Platform_GetIntArg (int16 n, int32 *val); -import void Platform_GetTimeOfDay (int32 *sec, int32 *usec); -import void Platform_Halt (int32 code); -import int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ); -import int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); -import BOOLEAN Platform_Inaccessible (int16 e); -import void Platform_Init (int32 argc, int32 argvadr); -import BOOLEAN Platform_Interrupted (int16 e); -import void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); -import int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); -import BOOLEAN Platform_NoSuchDirectory (int16 e); -import int32 Platform_OSAllocate (int32 size); -import void Platform_OSFree (int32 address); -import int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); -import int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); -import int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n); -import int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n); -import int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); +import void Platform_GetIntArg (INT16 n, INT32 *val); +import void Platform_GetTimeOfDay (INT32 *sec, INT32 *usec); +import void Platform_Halt (INT32 code); +import INT16 Platform_Identify (INT32 h, Platform_FileIdentity *identity, ADDRESS *identity__typ); +import INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ); +import BOOLEAN Platform_Inaccessible (INT16 e); +import void Platform_Init (INT32 argc, INT32 argvadr); +import BOOLEAN Platform_Interrupted (INT16 e); +import void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d); +import INT16 Platform_New (CHAR *n, LONGINT n__len, INT32 *h); +import BOOLEAN Platform_NoSuchDirectory (INT16 e); +import INT32 Platform_OSAllocate (INT32 size); +import void Platform_OSFree (INT32 address); +import INT16 Platform_OldRO (CHAR *n, LONGINT n__len, INT32 *h); +import INT16 Platform_OldRW (CHAR *n, LONGINT n__len, INT32 *h); +import INT16 Platform_Read (INT32 h, INT32 p, INT32 l, INT32 *n); +import INT16 Platform_ReadBuf (INT32 h, SYSTEM_BYTE *b, LONGINT b__len, INT32 *n); +import INT16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); import BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); import BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); -import int16 Platform_Seek (int32 h, int32 o, int16 r); +import INT16 Platform_Seek (INT32 h, INT32 o, INT16 r); import void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); import void Platform_SetHalt (Platform_HaltProcedure p); -import void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Platform_FileIdentity source); -import int16 Platform_Size (int32 h, int32 *l); -import int16 Platform_Sync (int32 h); -import int16 Platform_System (CHAR *cmd, LONGINT cmd__len); -import int32 Platform_Time (void); -import BOOLEAN Platform_TimedOut (int16 e); -import BOOLEAN Platform_TooManyFiles (int16 e); -import int16 Platform_Truncate (int32 h, int32 limit); -import int16 Platform_Unlink (CHAR *n, LONGINT n__len); -import int16 Platform_Write (int32 h, int32 p, int32 l); +import void Platform_SetMTime (Platform_FileIdentity *target, ADDRESS *target__typ, Platform_FileIdentity source); +import INT16 Platform_Size (INT32 h, INT32 *l); +import INT16 Platform_Sync (INT32 h); +import INT16 Platform_System (CHAR *cmd, LONGINT cmd__len); +import INT32 Platform_Time (void); +import BOOLEAN Platform_TimedOut (INT16 e); +import BOOLEAN Platform_TooManyFiles (INT16 e); +import INT16 Platform_Truncate (INT32 h, INT32 limit); +import INT16 Platform_Unlink (CHAR *n, LONGINT n__len); +import INT16 Platform_Write (INT32 h, INT32 p, INT32 l); import BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); import void *Platform__init(void); -#define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((address)h) -#define Platform_SetQuitHandler(h) SystemSetQuitHandler((address)h) +#define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((ADDRESS)h) +#define Platform_SetQuitHandler(h) SystemSetQuitHandler((ADDRESS)h) #endif // Platform diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 0aca5733..d6788751 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" @@ -11,19 +11,19 @@ static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LONGINT d__len); -export void Reals_Convert (REAL x, int16 n, CHAR *d, LONGINT d__len); +export void Reals_Convert (REAL x, INT16 n, CHAR *d, LONGINT d__len); export void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len); export void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len); -export void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len); -export int16 Reals_Expo (REAL x); -export int16 Reals_ExpoL (LONGREAL x); -export void Reals_SetExpo (REAL *x, int16 ex); -export REAL Reals_Ten (int16 e); -export LONGREAL Reals_TenL (int16 e); -static CHAR Reals_ToHex (int16 i); +export void Reals_ConvertL (LONGREAL x, INT16 n, CHAR *d, LONGINT d__len); +export INT16 Reals_Expo (REAL x); +export INT16 Reals_ExpoL (LONGREAL x); +export void Reals_SetExpo (REAL *x, INT16 ex); +export REAL Reals_Ten (INT16 e); +export LONGREAL Reals_TenL (INT16 e); +static CHAR Reals_ToHex (INT16 i); -REAL Reals_Ten (int16 e) +REAL Reals_Ten (INT16 e) { LONGREAL r, power; r = (LONGREAL)1; @@ -38,7 +38,7 @@ REAL Reals_Ten (int16 e) return r; } -LONGREAL Reals_TenL (int16 e) +LONGREAL Reals_TenL (INT16 e) { LONGREAL r, power; r = (LONGREAL)1; @@ -56,39 +56,39 @@ LONGREAL Reals_TenL (int16 e) __RETCHK; } -int16 Reals_Expo (REAL x) +INT16 Reals_Expo (REAL x) { - int16 i; - __GET((address)&x + 2, i, int16); + INT16 i; + __GET((address)&x + 2, i, INT16); return __MASK(__ASHR(i, 7), -256); } -void Reals_SetExpo (REAL *x, int16 ex) +void Reals_SetExpo (REAL *x, INT16 ex) { CHAR c; __GET((address)x + 3, c, CHAR); - __PUT((address)x + 3, (CHAR)(__ASHL(__ASHR((int16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __PUT((address)x + 3, (CHAR)(__ASHL(__ASHR((INT16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); __GET((address)x + 2, c, CHAR); - __PUT((address)x + 2, (CHAR)(__MASK((int16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); + __PUT((address)x + 2, (CHAR)(__MASK((INT16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } -int16 Reals_ExpoL (LONGREAL x) +INT16 Reals_ExpoL (LONGREAL x) { - int16 i; - __GET((address)&x + 6, i, int16); + INT16 i; + __GET((address)&x + 6, i, INT16); return __MASK(__ASHR(i, 4), -2048); } -void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len) +void Reals_ConvertL (LONGREAL x, INT16 n, CHAR *d, LONGINT d__len) { - int32 i, j, k; + INT32 i, j, k; if (x < (LONGREAL)0) { x = -x; } k = 0; if (n > 9) { - i = (int32)__ENTIER(x / (LONGREAL)(LONGREAL)1000000000); - j = (int32)__ENTIER(x - i * (LONGREAL)1000000000); + i = (INT32)__ENTIER(x / (LONGREAL)(LONGREAL)1000000000); + j = (INT32)__ENTIER(x - i * (LONGREAL)1000000000); if (j < 0) { j = 0; } @@ -98,7 +98,7 @@ void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len) k += 1; } } else { - i = (int32)__ENTIER(x); + i = (INT32)__ENTIER(x); } while (k < n) { d[__X(k, d__len)] = (CHAR)((int)__MOD(i, 10) + 48); @@ -107,12 +107,12 @@ void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len) } } -void Reals_Convert (REAL x, int16 n, CHAR *d, LONGINT d__len) +void Reals_Convert (REAL x, INT16 n, CHAR *d, LONGINT d__len) { Reals_ConvertL(x, n, (void*)d, d__len); } -static CHAR Reals_ToHex (int16 i) +static CHAR Reals_ToHex (INT16 i) { if (i < 10) { return (CHAR)(i + 48); @@ -124,15 +124,15 @@ static CHAR Reals_ToHex (int16 i) static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LONGINT d__len) { - int16 i; - int32 l; + INT16 i; + INT32 l; CHAR by; i = 0; l = b__len; while (i < l) { by = __VAL(CHAR, b[__X(i, b__len)]); - d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((int16)by, 4)); - d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((int16)by, -16)); + d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((INT16)by, 4)); + d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((INT16)by, -16)); i += 1; } } diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index 664fe2ec..07688e3c 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h @@ -8,15 +8,15 @@ -import void Reals_Convert (REAL x, int16 n, CHAR *d, LONGINT d__len); +import void Reals_Convert (REAL x, INT16 n, CHAR *d, LONGINT d__len); import void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len); import void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len); -import void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len); -import int16 Reals_Expo (REAL x); -import int16 Reals_ExpoL (LONGREAL x); -import void Reals_SetExpo (REAL *x, int16 ex); -import REAL Reals_Ten (int16 e); -import LONGREAL Reals_TenL (int16 e); +import void Reals_ConvertL (LONGREAL x, INT16 n, CHAR *d, LONGINT d__len); +import INT16 Reals_Expo (REAL x); +import INT16 Reals_ExpoL (LONGREAL x); +import void Reals_SetExpo (REAL *x, INT16 ex); +import REAL Reals_Ten (INT16 e); +import LONGREAL Reals_TenL (INT16 e); import void *Reals__init(void); diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index 104a0fb7..141a9976 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" @@ -12,18 +12,18 @@ export void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len); export void Strings_Cap (CHAR *s, LONGINT s__len); -export void Strings_Delete (CHAR *s, LONGINT s__len, int16 pos, int16 n); -export void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHAR *dest, LONGINT dest__len); -export void Strings_Insert (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len); -export int16 Strings_Length (CHAR *s, LONGINT s__len); +export void Strings_Delete (CHAR *s, LONGINT s__len, INT16 pos, INT16 n); +export void Strings_Extract (CHAR *source, LONGINT source__len, INT16 pos, INT16 n, CHAR *dest, LONGINT dest__len); +export void Strings_Insert (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len); +export INT16 Strings_Length (CHAR *s, LONGINT s__len); export BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len); -export int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int16 pos); -export void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len); +export INT16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, INT16 pos); +export void Strings_Replace (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len); -int16 Strings_Length (CHAR *s, LONGINT s__len) +INT16 Strings_Length (CHAR *s, LONGINT s__len) { - int32 i; + INT32 i; __DUP(s, s__len, CHAR); i = 0; while ((i < s__len && s[__X(i, s__len)] != 0x00)) { @@ -31,7 +31,7 @@ int16 Strings_Length (CHAR *s, LONGINT s__len) } if (i <= 32767) { __DEL(s); - return (int16)i; + return (INT16)i; } else { __DEL(s); return 32767; @@ -41,7 +41,7 @@ int16 Strings_Length (CHAR *s, LONGINT s__len) void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len) { - int16 n1, n2, i; + INT16 n1, n2, i; __DUP(extra, extra__len, CHAR); n1 = Strings_Length(dest, dest__len); n2 = Strings_Length(extra, extra__len); @@ -56,9 +56,9 @@ void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__ __DEL(extra); } -void Strings_Insert (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len) +void Strings_Insert (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len) { - int16 n1, n2, i; + INT16 n1, n2, i; __DUP(source, source__len, CHAR); n1 = Strings_Length(dest, dest__len); n2 = Strings_Length(source, source__len); @@ -87,9 +87,9 @@ void Strings_Insert (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, L __DEL(source); } -void Strings_Delete (CHAR *s, LONGINT s__len, int16 pos, int16 n) +void Strings_Delete (CHAR *s, LONGINT s__len, INT16 pos, INT16 n) { - int16 len, i; + INT16 len, i; len = Strings_Length(s, s__len); if (pos < 0) { pos = 0; @@ -110,7 +110,7 @@ void Strings_Delete (CHAR *s, LONGINT s__len, int16 pos, int16 n) } } -void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len) +void Strings_Replace (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len) { __DUP(source, source__len, CHAR); Strings_Delete((void*)dest, dest__len, pos, pos + Strings_Length(source, source__len)); @@ -118,12 +118,12 @@ void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, __DEL(source); } -void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHAR *dest, LONGINT dest__len) +void Strings_Extract (CHAR *source, LONGINT source__len, INT16 pos, INT16 n, CHAR *dest, LONGINT dest__len) { - int16 len, destLen, i; + INT16 len, destLen, i; __DUP(source, source__len, CHAR); len = Strings_Length(source, source__len); - destLen = (int16)dest__len - 1; + destLen = (INT16)dest__len - 1; if (pos < 0) { pos = 0; } @@ -143,9 +143,9 @@ void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHA __DEL(source); } -int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int16 pos) +INT16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, INT16 pos) { - int16 n1, n2, i, j; + INT16 n1, n2, i, j; __DUP(pattern, pattern__len, CHAR); __DUP(s, s__len, CHAR); n1 = Strings_Length(s, s__len); @@ -177,7 +177,7 @@ int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, void Strings_Cap (CHAR *s, LONGINT s__len) { - int16 i; + INT16 i; i = 0; while (s[__X(i, s__len)] != 0x00) { if (('a' <= s[__X(i, s__len)] && s[__X(i, s__len)] <= 'z')) { @@ -191,9 +191,9 @@ static struct Match__7 { struct Match__7 *lnk; } *Match__7_s; -static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, int16 n, int16 m); +static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, INT16 n, INT16 m); -static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, int16 n, int16 m) +static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, INT16 n, INT16 m) { while ((((n >= 0 && m >= 0)) && mask[__X(m, mask__len)] != '*')) { if (name[__X(n, name__len)] != mask[__X(m, mask__len)]) { diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index 24f35c02..4319e8c8 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h @@ -10,13 +10,13 @@ import void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len); import void Strings_Cap (CHAR *s, LONGINT s__len); -import void Strings_Delete (CHAR *s, LONGINT s__len, int16 pos, int16 n); -import void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHAR *dest, LONGINT dest__len); -import void Strings_Insert (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len); -import int16 Strings_Length (CHAR *s, LONGINT s__len); +import void Strings_Delete (CHAR *s, LONGINT s__len, INT16 pos, INT16 n); +import void Strings_Extract (CHAR *source, LONGINT source__len, INT16 pos, INT16 n, CHAR *dest, LONGINT dest__len); +import void Strings_Insert (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len); +import INT16 Strings_Length (CHAR *s, LONGINT s__len); import BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len); -import int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int16 pos); -import void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len); +import INT16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, INT16 pos); +import void Strings_Replace (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len); import void *Strings__init(void); diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index 961ebbe7..ac0a3850 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "Files.h" @@ -19,9 +19,9 @@ typedef typedef struct Texts_RunDesc { Texts_Run prev, next; - int32 len; + INT32 len; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; BOOLEAN ascii; } Texts_RunDesc; @@ -34,7 +34,7 @@ typedef } Texts_ElemMsg; typedef - void (*Texts_Handler)(Texts_Elem, Texts_ElemMsg*, address *); + void (*Texts_Handler)(Texts_Elem, Texts_ElemMsg*, ADDRESS *); typedef struct Texts_TextDesc *Texts_Text; @@ -42,26 +42,26 @@ typedef typedef struct Texts_ElemDesc { Texts_Run prev, next; - int32 len; + INT32 len; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; BOOLEAN ascii; - int32 W, H; + INT32 W, H; Texts_Handler handle; Texts_Text base; } Texts_ElemDesc; struct Texts__1 { /* Texts_ElemDesc */ Texts_Run prev, next; - int32 len; + INT32 len; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; BOOLEAN ascii; - int32 W, H; + INT32 W, H; Texts_Handler handle; Texts_Text base; Files_File file; - int32 org, span; + INT32 org, span; CHAR mod[32], proc[32]; }; @@ -70,7 +70,7 @@ typedef typedef struct Texts_BufDesc { - int32 len; + INT32 len; Texts_Run head; } Texts_BufDesc; @@ -84,8 +84,8 @@ typedef typedef struct Texts_FileMsg { /* Texts_ElemMsg */ - int16 id; - int32 pos; + INT16 id; + INT32 pos; Files_Rider r; } Texts_FileMsg; @@ -100,7 +100,7 @@ typedef } Texts_IdentifyMsg; typedef - void (*Texts_Notifier)(Texts_Text, int16, int32, int32); + void (*Texts_Notifier)(Texts_Text, INT16, INT32, INT32); typedef struct Texts_PieceDesc *Texts_Piece; @@ -108,57 +108,57 @@ typedef typedef struct Texts_PieceDesc { Texts_Run prev, next; - int32 len; + INT32 len; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; BOOLEAN ascii; Files_File file; - int32 org; + INT32 org; } Texts_PieceDesc; typedef struct Texts_Reader { BOOLEAN eot; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; Texts_Elem elem; Files_Rider rider; Texts_Run run; - int32 org, off; + INT32 org, off; } Texts_Reader; typedef struct Texts_Scanner { /* Texts_Reader */ BOOLEAN eot; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; Texts_Elem elem; Files_Rider rider; Texts_Run run; - int32 org, off; + INT32 org, off; CHAR nextCh; - int16 line, class; - int32 i; + INT16 line, class; + INT32 i; REAL x; LONGREAL y; CHAR c; - int8 len; + INT8 len; CHAR s[64]; } Texts_Scanner; typedef struct Texts_TextDesc { - int32 len; + INT32 len; Texts_Notifier notify; Texts_Run head, cache; - int32 corg; + INT32 corg; } Texts_TextDesc; typedef struct Texts_Writer { Texts_Buffer buf; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; Files_Rider rider; Files_File file; } Texts_Writer; @@ -168,68 +168,68 @@ export Texts_Elem Texts_new; static Texts_Buffer Texts_del; static Texts_FontsFont Texts_FontsDefault; -export address *Texts_FontDesc__typ; -export address *Texts_RunDesc__typ; -export address *Texts_PieceDesc__typ; -export address *Texts_ElemMsg__typ; -export address *Texts_ElemDesc__typ; -export address *Texts_FileMsg__typ; -export address *Texts_CopyMsg__typ; -export address *Texts_IdentifyMsg__typ; -export address *Texts_BufDesc__typ; -export address *Texts_TextDesc__typ; -export address *Texts_Reader__typ; -export address *Texts_Scanner__typ; -export address *Texts_Writer__typ; -export address *Texts__1__typ; +export ADDRESS *Texts_FontDesc__typ; +export ADDRESS *Texts_RunDesc__typ; +export ADDRESS *Texts_PieceDesc__typ; +export ADDRESS *Texts_ElemMsg__typ; +export ADDRESS *Texts_ElemDesc__typ; +export ADDRESS *Texts_FileMsg__typ; +export ADDRESS *Texts_CopyMsg__typ; +export ADDRESS *Texts_IdentifyMsg__typ; +export ADDRESS *Texts_BufDesc__typ; +export ADDRESS *Texts_TextDesc__typ; +export ADDRESS *Texts_Reader__typ; +export ADDRESS *Texts_Scanner__typ; +export ADDRESS *Texts_Writer__typ; +export ADDRESS *Texts__1__typ; export void Texts_Append (Texts_Text T, Texts_Buffer B); -export void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, uint32 sel, Texts_FontsFont fnt, int8 col, int8 voff); +export void Texts_ChangeLooks (Texts_Text T, INT32 beg, INT32 end, UINT32 sel, Texts_FontsFont fnt, INT8 col, INT8 voff); static Texts_Elem Texts_CloneElem (Texts_Elem e); static Texts_Piece Texts_ClonePiece (Texts_Piece p); export void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len); export void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); export void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); -export void Texts_Delete (Texts_Text T, int32 beg, int32 end); +export void Texts_Delete (Texts_Text T, INT32 beg, INT32 end); export Texts_Text Texts_ElemBase (Texts_Elem E); -export int32 Texts_ElemPos (Texts_Elem E); -static void Texts_Find (Texts_Text T, int32 *pos, Texts_Run *u, int32 *org, int32 *off); +export INT32 Texts_ElemPos (Texts_Elem E); +static void Texts_Find (Texts_Text T, INT32 *pos, Texts_Run *u, INT32 *org, INT32 *off); static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len); -static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, address *msg__typ); -export void Texts_Insert (Texts_Text T, int32 pos, Texts_Buffer B); -export void Texts_Load (Files_Rider *r, address *r__typ, Texts_Text T); -static void Texts_Load0 (Files_Rider *r, address *r__typ, Texts_Text T); +static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, ADDRESS *msg__typ); +export void Texts_Insert (Texts_Text T, INT32 pos, Texts_Buffer B); +export void Texts_Load (Files_Rider *r, ADDRESS *r__typ, Texts_Text T); +static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T); static void Texts_Merge (Texts_Text T, Texts_Run u, Texts_Run *v); export void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len); export void Texts_OpenBuf (Texts_Buffer B); -export void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int32 pos); -export void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int32 pos); -export void Texts_OpenWriter (Texts_Writer *W, address *W__typ); -export int32 Texts_Pos (Texts_Reader *R, address *R__typ); -export void Texts_Read (Texts_Reader *R, address *R__typ, CHAR *ch); -export void Texts_ReadElem (Texts_Reader *R, address *R__typ); -export void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ); +export void Texts_OpenReader (Texts_Reader *R, ADDRESS *R__typ, Texts_Text T, INT32 pos); +export void Texts_OpenScanner (Texts_Scanner *S, ADDRESS *S__typ, Texts_Text T, INT32 pos); +export void Texts_OpenWriter (Texts_Writer *W, ADDRESS *W__typ); +export INT32 Texts_Pos (Texts_Reader *R, ADDRESS *R__typ); +export void Texts_Read (Texts_Reader *R, ADDRESS *R__typ, CHAR *ch); +export void Texts_ReadElem (Texts_Reader *R, ADDRESS *R__typ); +export void Texts_ReadPrevElem (Texts_Reader *R, ADDRESS *R__typ); export void Texts_Recall (Texts_Buffer *B); -export void Texts_Save (Texts_Text T, int32 beg, int32 end, Texts_Buffer B); -export void Texts_Scan (Texts_Scanner *S, address *S__typ); -export void Texts_SetColor (Texts_Writer *W, address *W__typ, int8 col); -export void Texts_SetFont (Texts_Writer *W, address *W__typ, Texts_FontsFont fnt); -export void Texts_SetOffset (Texts_Writer *W, address *W__typ, int8 voff); +export void Texts_Save (Texts_Text T, INT32 beg, INT32 end, Texts_Buffer B); +export void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ); +export void Texts_SetColor (Texts_Writer *W, ADDRESS *W__typ, INT8 col); +export void Texts_SetFont (Texts_Writer *W, ADDRESS *W__typ, Texts_FontsFont fnt); +export void Texts_SetOffset (Texts_Writer *W, ADDRESS *W__typ, INT8 voff); static void Texts_Splice (Texts_Run un, Texts_Run v, Texts_Run w, Texts_Text base); -static void Texts_Split (int32 off, Texts_Run *u, Texts_Run *un); -export void Texts_Store (Files_Rider *r, address *r__typ, Texts_Text T); -export void Texts_Write (Texts_Writer *W, address *W__typ, CHAR ch); -export void Texts_WriteDate (Texts_Writer *W, address *W__typ, int32 t, int32 d); -export void Texts_WriteElem (Texts_Writer *W, address *W__typ, Texts_Elem e); -export void Texts_WriteHex (Texts_Writer *W, address *W__typ, int32 x); -export void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n); -export void Texts_WriteLn (Texts_Writer *W, address *W__typ); -export void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int16 n); -export void Texts_WriteLongRealHex (Texts_Writer *W, address *W__typ, LONGREAL x); -export void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int16 n); -export void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int16 n, int16 k); -export void Texts_WriteRealHex (Texts_Writer *W, address *W__typ, REAL x); -export void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGINT s__len); +static void Texts_Split (INT32 off, Texts_Run *u, Texts_Run *un); +export void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T); +export void Texts_Write (Texts_Writer *W, ADDRESS *W__typ, CHAR ch); +export void Texts_WriteDate (Texts_Writer *W, ADDRESS *W__typ, INT32 t, INT32 d); +export void Texts_WriteElem (Texts_Writer *W, ADDRESS *W__typ, Texts_Elem e); +export void Texts_WriteHex (Texts_Writer *W, ADDRESS *W__typ, INT32 x); +export void Texts_WriteInt (Texts_Writer *W, ADDRESS *W__typ, INT64 x, INT64 n); +export void Texts_WriteLn (Texts_Writer *W, ADDRESS *W__typ); +export void Texts_WriteLongReal (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x, INT16 n); +export void Texts_WriteLongRealHex (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x); +export void Texts_WriteReal (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n); +export void Texts_WriteRealFix (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n, INT16 k); +export void Texts_WriteRealHex (Texts_Writer *W, ADDRESS *W__typ, REAL x); +export void Texts_WriteString (Texts_Writer *W, ADDRESS *W__typ, CHAR *s, LONGINT s__len); static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len) @@ -240,10 +240,10 @@ static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len) return F; } -static void Texts_Find (Texts_Text T, int32 *pos, Texts_Run *u, int32 *org, int32 *off) +static void Texts_Find (Texts_Text T, INT32 *pos, Texts_Run *u, INT32 *org, INT32 *off) { Texts_Run v = NIL; - int32 m; + INT32 m; if (*pos >= T->len) { *pos = T->len; *u = T->head; @@ -273,7 +273,7 @@ static void Texts_Find (Texts_Text T, int32 *pos, Texts_Run *u, int32 *org, int3 } } -static void Texts_Split (int32 off, Texts_Run *u, Texts_Run *un) +static void Texts_Split (INT32 off, Texts_Run *u, Texts_Run *un) { Texts_Piece p = NIL, U = NIL; if (off == 0) { @@ -366,10 +366,10 @@ Texts_Text Texts_ElemBase (Texts_Elem E) return E->base; } -int32 Texts_ElemPos (Texts_Elem E) +INT32 Texts_ElemPos (Texts_Elem E) { Texts_Run u = NIL; - int32 pos; + INT32 pos; u = E->base->head->next; pos = 0; while (u != (void *) E) { @@ -379,11 +379,11 @@ int32 Texts_ElemPos (Texts_Elem E) return pos; } -static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, address *msg__typ) +static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, ADDRESS *msg__typ) { Texts_Alien e = NIL; Files_Rider r; - int32 i; + INT32 i; CHAR ch; if (__ISP(E, Texts__1, 2)) { if (__IS(msg__typ, Texts_CopyMsg, 1)) { @@ -459,10 +459,10 @@ void Texts_Recall (Texts_Buffer *B) Texts_del = NIL; } -void Texts_Save (Texts_Text T, int32 beg, int32 end, Texts_Buffer B) +void Texts_Save (Texts_Text T, INT32 beg, INT32 end, Texts_Buffer B) { Texts_Run u = NIL, v = NIL, w = NIL, wn = NIL; - int32 uo, ud, vo, vd; + INT32 uo, ud, vo, vd; Texts_Find(T, &beg, &u, &uo, &ud); Texts_Find(T, &end, &v, &vo, &vd); w = B->head->prev; @@ -493,11 +493,11 @@ void Texts_Save (Texts_Text T, int32 beg, int32 end, Texts_Buffer B) B->len += end - beg; } -void Texts_Insert (Texts_Text T, int32 pos, Texts_Buffer B) +void Texts_Insert (Texts_Text T, INT32 pos, Texts_Buffer B) { Texts_Run u = NIL, un = NIL, v = NIL; Texts_Piece p = NIL, q = NIL; - int32 uo, ud, len; + INT32 uo, ud, len; Texts_Find(T, &pos, &u, &uo, &ud); Texts_Split(ud, &u, &un); len = B->len; @@ -516,7 +516,7 @@ void Texts_Insert (Texts_Text T, int32 pos, Texts_Buffer B) void Texts_Append (Texts_Text T, Texts_Buffer B) { Texts_Run v = NIL; - int32 pos, len; + INT32 pos, len; pos = T->len; len = B->len; v = B->head->next; @@ -531,10 +531,10 @@ void Texts_Append (Texts_Text T, Texts_Buffer B) } } -void Texts_Delete (Texts_Text T, int32 beg, int32 end) +void Texts_Delete (Texts_Text T, INT32 beg, INT32 end) { Texts_Run c = NIL, u = NIL, un = NIL, v = NIL, vn = NIL; - int32 co, uo, ud, vo, vd; + INT32 co, uo, ud, vo, vd; Texts_Find(T, &beg, &u, &uo, &ud); Texts_Split(ud, &u, &un); c = T->cache; @@ -556,10 +556,10 @@ void Texts_Delete (Texts_Text T, int32 beg, int32 end) } } -void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, uint32 sel, Texts_FontsFont fnt, int8 col, int8 voff) +void Texts_ChangeLooks (Texts_Text T, INT32 beg, INT32 end, UINT32 sel, Texts_FontsFont fnt, INT8 col, INT8 voff) { Texts_Run c = NIL, u = NIL, un = NIL, v = NIL, vn = NIL; - int32 co, uo, ud, vo, vd; + INT32 co, uo, ud, vo, vd; Texts_Find(T, &beg, &u, &uo, &ud); Texts_Split(ud, &u, &un); c = T->cache; @@ -595,7 +595,7 @@ void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, uint32 sel, Texts_Fo } } -void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int32 pos) +void Texts_OpenReader (Texts_Reader *R, ADDRESS *R__typ, Texts_Text T, INT32 pos) { Texts_Run u = NIL; if (pos >= T->len) { @@ -609,10 +609,10 @@ void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int32 pos } } -void Texts_Read (Texts_Reader *R, address *R__typ, CHAR *ch) +void Texts_Read (Texts_Reader *R, ADDRESS *R__typ, CHAR *ch) { Texts_Run u = NIL; - int32 pos; + INT32 pos; CHAR nextch; u = (*R).run; (*R).fnt = u->fnt; @@ -654,7 +654,7 @@ void Texts_Read (Texts_Reader *R, address *R__typ, CHAR *ch) } } -void Texts_ReadElem (Texts_Reader *R, address *R__typ) +void Texts_ReadElem (Texts_Reader *R, ADDRESS *R__typ) { Texts_Run u = NIL, un = NIL; u = (*R).run; @@ -682,7 +682,7 @@ void Texts_ReadElem (Texts_Reader *R, address *R__typ) } } -void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ) +void Texts_ReadPrevElem (Texts_Reader *R, ADDRESS *R__typ) { Texts_Run u = NIL; u = (*R).run->prev; @@ -704,12 +704,12 @@ void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ) } } -int32 Texts_Pos (Texts_Reader *R, address *R__typ) +INT32 Texts_Pos (Texts_Reader *R, ADDRESS *R__typ) { return (*R).org + (*R).off; } -void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int32 pos) +void Texts_OpenScanner (Texts_Scanner *S, ADDRESS *S__typ, Texts_Text T, INT32 pos) { Texts_OpenReader((void*)&*S, S__typ, T, pos); (*S).line = 0; @@ -718,10 +718,10 @@ void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int32 p static struct Scan__31 { Texts_Scanner *S; - address *S__typ; + ADDRESS *S__typ; CHAR *ch; BOOLEAN *negE; - int16 *e; + INT16 *e; struct Scan__31 *lnk; } *Scan__31_s; @@ -740,18 +740,18 @@ static void ReadScaleFactor__32 (void) } } while (('0' <= *Scan__31_s->ch && *Scan__31_s->ch <= '9')) { - *Scan__31_s->e = (*Scan__31_s->e * 10 + (int16)*Scan__31_s->ch) - 48; + *Scan__31_s->e = (*Scan__31_s->e * 10 + (INT16)*Scan__31_s->ch) - 48; Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); } } -void Texts_Scan (Texts_Scanner *S, address *S__typ) +void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) { CHAR ch, term; BOOLEAN neg, negE, hex; - int8 i, j, h; - int16 e; - int32 k; + INT8 i, j, h; + INT16 e; + INT32 k; REAL x, f; LONGREAL y, g; CHAR d[32]; @@ -812,10 +812,10 @@ void Texts_Scan (Texts_Scanner *S, address *S__typ) if ('9' < ch) { if (('A' <= ch && ch <= 'F')) { hex = 1; - ch = (CHAR)((int16)ch - 7); + ch = (CHAR)((INT16)ch - 7); } else if (('a' <= ch && ch <= 'f')) { hex = 1; - ch = (CHAR)((int16)ch - 39); + ch = (CHAR)((INT16)ch - 39); } else { break; } @@ -827,13 +827,13 @@ void Texts_Scan (Texts_Scanner *S, address *S__typ) if (i - j > 8) { j = i - 8; } - k = (int16)d[__X(j, 32)] - 48; + k = (INT16)d[__X(j, 32)] - 48; j += 1; if ((i - j == 7 && k >= 8)) { k -= 16; } while (j < i) { - k = __ASHL(k, 4) + ((int16)d[__X(j, 32)] - 48); + k = __ASHL(k, 4) + ((INT16)d[__X(j, 32)] - 48); j += 1; } if (neg) { @@ -854,12 +854,12 @@ void Texts_Scan (Texts_Scanner *S, address *S__typ) y = (LONGREAL)0; g = (LONGREAL)1; do { - y = y * (LONGREAL)10 + ((int16)d[__X(j, 32)] - 48); + y = y * (LONGREAL)10 + ((INT16)d[__X(j, 32)] - 48); j += 1; } while (!(j == h)); while (j < i) { g = g / (LONGREAL)(LONGREAL)10; - y = ((int16)d[__X(j, 32)] - 48) * g + y; + y = ((INT16)d[__X(j, 32)] - 48) * g + y; j += 1; } ReadScaleFactor__32(); @@ -886,12 +886,12 @@ void Texts_Scan (Texts_Scanner *S, address *S__typ) x = (REAL)0; f = (REAL)1; do { - x = x * (REAL)10 + ((int16)d[__X(j, 32)] - 48); + x = x * (REAL)10 + ((INT16)d[__X(j, 32)] - 48); j += 1; } while (!(j == h)); while (j < i) { f = f / (REAL)(REAL)10; - x = ((int16)d[__X(j, 32)] - 48) * f + x; + x = ((INT16)d[__X(j, 32)] - 48) * f + x; j += 1; } if (ch == 'E') { @@ -923,7 +923,7 @@ void Texts_Scan (Texts_Scanner *S, address *S__typ) (*S).class = 3; k = 0; do { - k = k * 10 + ((int16)d[__X(j, 32)] - 48); + k = k * 10 + ((INT16)d[__X(j, 32)] - 48); j += 1; } while (!(j == i)); if (neg) { @@ -951,7 +951,7 @@ void Texts_Scan (Texts_Scanner *S, address *S__typ) Scan__31_s = _s.lnk; } -void Texts_OpenWriter (Texts_Writer *W, address *W__typ) +void Texts_OpenWriter (Texts_Writer *W, ADDRESS *W__typ) { __NEW((*W).buf, Texts_BufDesc); Texts_OpenBuf((*W).buf); @@ -962,22 +962,22 @@ void Texts_OpenWriter (Texts_Writer *W, address *W__typ) Files_Set(&(*W).rider, Files_Rider__typ, (*W).file, 0); } -void Texts_SetFont (Texts_Writer *W, address *W__typ, Texts_FontsFont fnt) +void Texts_SetFont (Texts_Writer *W, ADDRESS *W__typ, Texts_FontsFont fnt) { (*W).fnt = fnt; } -void Texts_SetColor (Texts_Writer *W, address *W__typ, int8 col) +void Texts_SetColor (Texts_Writer *W, ADDRESS *W__typ, INT8 col) { (*W).col = col; } -void Texts_SetOffset (Texts_Writer *W, address *W__typ, int8 voff) +void Texts_SetOffset (Texts_Writer *W, ADDRESS *W__typ, INT8 voff) { (*W).voff = voff; } -void Texts_Write (Texts_Writer *W, address *W__typ, CHAR ch) +void Texts_Write (Texts_Writer *W, ADDRESS *W__typ, CHAR ch) { Texts_Run u = NIL, un = NIL; Texts_Piece p = NIL; @@ -1003,7 +1003,7 @@ void Texts_Write (Texts_Writer *W, address *W__typ, CHAR ch) } } -void Texts_WriteElem (Texts_Writer *W, address *W__typ, Texts_Elem e) +void Texts_WriteElem (Texts_Writer *W, ADDRESS *W__typ, Texts_Elem e) { Texts_Run u = NIL, un = NIL; if (e->base != NIL) { @@ -1022,14 +1022,14 @@ void Texts_WriteElem (Texts_Writer *W, address *W__typ, Texts_Elem e) un->prev = (Texts_Run)e; } -void Texts_WriteLn (Texts_Writer *W, address *W__typ) +void Texts_WriteLn (Texts_Writer *W, ADDRESS *W__typ) { Texts_Write(&*W, W__typ, 0x0d); } -void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGINT s__len) +void Texts_WriteString (Texts_Writer *W, ADDRESS *W__typ, CHAR *s, LONGINT s__len) { - int16 i; + INT16 i; __DUP(s, s__len, CHAR); i = 0; while (s[__X(i, s__len)] >= ' ') { @@ -1039,10 +1039,10 @@ void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGINT s__le __DEL(s); } -void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n) +void Texts_WriteInt (Texts_Writer *W, ADDRESS *W__typ, INT64 x, INT64 n) { - int16 i; - int64 x0; + INT16 i; + INT64 x0; CHAR a[24]; i = 0; if (x < 0) { @@ -1061,7 +1061,7 @@ void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n) x0 = __DIV(x0, 10); i += 1; } while (!(x0 == 0)); - while (n > (int64)i) { + while (n > (INT64)i) { Texts_Write(&*W, W__typ, ' '); n -= 1; } @@ -1074,10 +1074,10 @@ void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n) } while (!(i == 0)); } -void Texts_WriteHex (Texts_Writer *W, address *W__typ, int32 x) +void Texts_WriteHex (Texts_Writer *W, ADDRESS *W__typ, INT32 x) { - int16 i; - int32 y; + INT16 i; + INT32 y; CHAR a[20]; i = 0; Texts_Write(&*W, W__typ, ' '); @@ -1097,9 +1097,9 @@ void Texts_WriteHex (Texts_Writer *W, address *W__typ, int32 x) } while (!(i == 0)); } -void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int16 n) +void Texts_WriteReal (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n) { - int16 e; + INT16 e; REAL x0; CHAR d[9]; e = Reals_Expo(x); @@ -1169,16 +1169,16 @@ void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int16 n) static struct WriteRealFix__53 { Texts_Writer *W; - address *W__typ; - int16 *i; + ADDRESS *W__typ; + INT16 *i; CHAR (*d)[9]; struct WriteRealFix__53 *lnk; } *WriteRealFix__53_s; -static void dig__54 (int16 n); -static void seq__56 (CHAR ch, int16 n); +static void dig__54 (INT16 n); +static void seq__56 (CHAR ch, INT16 n); -static void seq__56 (CHAR ch, int16 n) +static void seq__56 (CHAR ch, INT16 n) { while (n > 0) { Texts_Write(&*WriteRealFix__53_s->W, WriteRealFix__53_s->W__typ, ch); @@ -1186,7 +1186,7 @@ static void seq__56 (CHAR ch, int16 n) } } -static void dig__54 (int16 n) +static void dig__54 (INT16 n) { while (n > 0) { *WriteRealFix__53_s->i -= 1; @@ -1195,9 +1195,9 @@ static void dig__54 (int16 n) } } -void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int16 n, int16 k) +void Texts_WriteRealFix (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n, INT16 k) { - int16 e, i; + INT16 e, i; CHAR sign; REAL x0; CHAR d[9]; @@ -1267,9 +1267,9 @@ void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int16 n, int1 WriteRealFix__53_s = _s.lnk; } -void Texts_WriteRealHex (Texts_Writer *W, address *W__typ, REAL x) +void Texts_WriteRealHex (Texts_Writer *W, ADDRESS *W__typ, REAL x) { - int16 i; + INT16 i; CHAR d[8]; Reals_ConvertH(x, (void*)d, 8); i = 0; @@ -1279,9 +1279,9 @@ void Texts_WriteRealHex (Texts_Writer *W, address *W__typ, REAL x) } while (!(i == 8)); } -void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int16 n) +void Texts_WriteLongReal (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x, INT16 n) { - int16 e; + INT16 e; LONGREAL x0; CHAR d[16]; e = Reals_ExpoL(x); @@ -1313,7 +1313,7 @@ void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int16 n) } else { Texts_Write(&*W, W__typ, ' '); } - e = (int16)__ASHR((e - 1023) * 77, 8); + e = (INT16)__ASHR((e - 1023) * 77, 8); if (e >= 0) { x = x / (LONGREAL)Reals_TenL(e); } else { @@ -1351,9 +1351,9 @@ void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int16 n) } } -void Texts_WriteLongRealHex (Texts_Writer *W, address *W__typ, LONGREAL x) +void Texts_WriteLongRealHex (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x) { - int16 i; + INT16 i; CHAR d[16]; Reals_ConvertHL(x, (void*)d, 16); i = 0; @@ -1365,20 +1365,20 @@ void Texts_WriteLongRealHex (Texts_Writer *W, address *W__typ, LONGREAL x) static struct WriteDate__43 { Texts_Writer *W; - address *W__typ; + ADDRESS *W__typ; struct WriteDate__43 *lnk; } *WriteDate__43_s; -static void WritePair__44 (CHAR ch, int32 x); +static void WritePair__44 (CHAR ch, INT32 x); -static void WritePair__44 (CHAR ch, int32 x) +static void WritePair__44 (CHAR ch, INT32 x) { Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, ch); Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)(__DIV(x, 10) + 48)); Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)((int)__MOD(x, 10) + 48)); } -void Texts_WriteDate (Texts_Writer *W, address *W__typ, int32 t, int32 d) +void Texts_WriteDate (Texts_Writer *W, ADDRESS *W__typ, INT32 t, INT32 d) { struct WriteDate__43 _s; _s.W = W; _s.W__typ = W__typ; @@ -1395,22 +1395,22 @@ void Texts_WriteDate (Texts_Writer *W, address *W__typ, int32 t, int32 d) static struct Load0__16 { Texts_Text *T; - int8 *ecnt; + INT8 *ecnt; Files_File *f; Texts_FileMsg *msg; CHAR (*mods)[64][32], (*procs)[64][32]; struct Load0__16 *lnk; } *Load0__16_s; -static void LoadElem__17 (Files_Rider *r, address *r__typ, int32 pos, int32 span, Texts_Elem *e); +static void LoadElem__17 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e); -static void LoadElem__17 (Files_Rider *r, address *r__typ, int32 pos, int32 span, Texts_Elem *e) +static void LoadElem__17 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e) { Modules_Module M = NIL; Modules_Command Cmd; Texts_Alien a = NIL; - int32 org, ew, eh; - int8 eno; + INT32 org, ew, eh; + INT8 eno; Texts_new = NIL; Files_ReadLInt(&*r, r__typ, &ew); Files_ReadLInt(&*r, r__typ, &eh); @@ -1455,13 +1455,13 @@ static void LoadElem__17 (Files_Rider *r, address *r__typ, int32 pos, int32 span } } -static void Texts_Load0 (Files_Rider *r, address *r__typ, Texts_Text T) +static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) { Texts_Run u = NIL, un = NIL; Texts_Piece p = NIL; Texts_Elem e = NIL; - int32 org, pos, hlen, plen; - int8 ecnt, fcnt, fno, col, voff; + INT32 org, pos, hlen, plen; + INT8 ecnt, fcnt, fno, col, voff; Files_File f = NIL; Texts_FileMsg msg; CHAR mods[64][32], procs[64][32]; @@ -1529,9 +1529,9 @@ static void Texts_Load0 (Files_Rider *r, address *r__typ, Texts_Text T) Load0__16_s = _s.lnk; } -void Texts_Load (Files_Rider *r, address *r__typ, Texts_Text T) +void Texts_Load (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) { - int16 tag; + INT16 tag; Files_ReadInt(&*r, r__typ, &tag); if (tag != -4095) { Files_Set(&*r, r__typ, Files_Base(&*r, r__typ), Files_Pos(&*r, r__typ) - 2); @@ -1546,7 +1546,7 @@ void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len) Texts_Run u = NIL; Texts_Piece p = NIL; CHAR tag, version; - int32 hlen; + INT32 hlen; __DUP(name, name__len, CHAR); f = Files_Old(name, name__len); if (f == NIL) { @@ -1596,20 +1596,20 @@ void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len) } static struct Store__39 { - int8 *ecnt; + INT8 *ecnt; Texts_FileMsg *msg; Texts_IdentifyMsg *iden; CHAR (*mods)[64][32], (*procs)[64][32]; struct Store__39 *lnk; } *Store__39_s; -static void StoreElem__40 (Files_Rider *r, address *r__typ, int32 pos, Texts_Elem e); +static void StoreElem__40 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e); -static void StoreElem__40 (Files_Rider *r, address *r__typ, int32 pos, Texts_Elem e) +static void StoreElem__40 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e) { Files_Rider r1; - int32 org, span; - int8 eno; + INT32 org, span; + INT8 eno; __COPY((*Store__39_s->iden).mod, (*Store__39_s->mods)[__X(*Store__39_s->ecnt, 64)], 32); __COPY((*Store__39_s->iden).proc, (*Store__39_s->procs)[__X(*Store__39_s->ecnt, 64)], 32); eno = 1; @@ -1635,15 +1635,15 @@ static void StoreElem__40 (Files_Rider *r, address *r__typ, int32 pos, Texts_Ele Files_WriteLInt(&r1, Files_Rider__typ, e->H); } -void Texts_Store (Files_Rider *r, address *r__typ, Texts_Text T) +void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) { Files_Rider r1; Texts_Run u = NIL, un = NIL; Texts_Elem e = NIL; - int32 org, pos, delta, hlen, rlen; - int8 ecnt, fcnt; + INT32 org, pos, delta, hlen, rlen; + INT8 ecnt, fcnt; CHAR ch; - int8 fno; + INT8 fno; Texts_FileMsg msg; Texts_IdentifyMsg iden; CHAR mods[64][32], procs[64][32]; @@ -1759,7 +1759,7 @@ void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len) { Files_File f = NIL; Files_Rider r; - int16 i, res; + INT16 i, res; CHAR bak[64]; __DUP(name, name__len, CHAR); f = Files_New(name, name__len); diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index 891c877a..f2c8d90e 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h @@ -8,7 +8,7 @@ typedef struct Texts_BufDesc { - int32 len; + INT32 len; char _prvt0[4]; } Texts_BufDesc; @@ -30,25 +30,25 @@ typedef typedef struct Texts_RunDesc { - int32 _prvt0; + INT32 _prvt0; char _prvt1[15]; } Texts_RunDesc; typedef - void (*Texts_Handler)(Texts_Elem, Texts_ElemMsg*, address *); + void (*Texts_Handler)(Texts_Elem, Texts_ElemMsg*, ADDRESS *); typedef struct Texts_ElemDesc { char _prvt0[20]; - int32 W, H; + INT32 W, H; Texts_Handler handle; char _prvt1[4]; } Texts_ElemDesc; typedef struct Texts_FileMsg { /* Texts_ElemMsg */ - int16 id; - int32 pos; + INT16 id; + INT32 pos; Files_Rider r; } Texts_FileMsg; @@ -69,13 +69,13 @@ typedef struct Texts_TextDesc *Texts_Text; typedef - void (*Texts_Notifier)(Texts_Text, int16, int32, int32); + void (*Texts_Notifier)(Texts_Text, INT16, INT32, INT32); typedef struct Texts_Reader { BOOLEAN eot; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; Texts_Elem elem; char _prvt0[32]; } Texts_Reader; @@ -84,23 +84,23 @@ typedef struct Texts_Scanner { /* Texts_Reader */ BOOLEAN eot; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; Texts_Elem elem; - int64 _prvt0; + INT64 _prvt0; char _prvt1[24]; CHAR nextCh; - int16 line, class; - int32 i; + INT16 line, class; + INT32 i; REAL x; LONGREAL y; CHAR c; - int8 len; + INT8 len; CHAR s[64]; } Texts_Scanner; typedef struct Texts_TextDesc { - int32 len; + INT32 len; Texts_Notifier notify; char _prvt0[12]; } Texts_TextDesc; @@ -109,64 +109,64 @@ typedef struct Texts_Writer { Texts_Buffer buf; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; char _prvt0[26]; } Texts_Writer; import Texts_Elem Texts_new; -import address *Texts_FontDesc__typ; -import address *Texts_RunDesc__typ; -import address *Texts_ElemMsg__typ; -import address *Texts_ElemDesc__typ; -import address *Texts_FileMsg__typ; -import address *Texts_CopyMsg__typ; -import address *Texts_IdentifyMsg__typ; -import address *Texts_BufDesc__typ; -import address *Texts_TextDesc__typ; -import address *Texts_Reader__typ; -import address *Texts_Scanner__typ; -import address *Texts_Writer__typ; +import ADDRESS *Texts_FontDesc__typ; +import ADDRESS *Texts_RunDesc__typ; +import ADDRESS *Texts_ElemMsg__typ; +import ADDRESS *Texts_ElemDesc__typ; +import ADDRESS *Texts_FileMsg__typ; +import ADDRESS *Texts_CopyMsg__typ; +import ADDRESS *Texts_IdentifyMsg__typ; +import ADDRESS *Texts_BufDesc__typ; +import ADDRESS *Texts_TextDesc__typ; +import ADDRESS *Texts_Reader__typ; +import ADDRESS *Texts_Scanner__typ; +import ADDRESS *Texts_Writer__typ; import void Texts_Append (Texts_Text T, Texts_Buffer B); -import void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, uint32 sel, Texts_FontsFont fnt, int8 col, int8 voff); +import void Texts_ChangeLooks (Texts_Text T, INT32 beg, INT32 end, UINT32 sel, Texts_FontsFont fnt, INT8 col, INT8 voff); import void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len); import void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); import void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); -import void Texts_Delete (Texts_Text T, int32 beg, int32 end); +import void Texts_Delete (Texts_Text T, INT32 beg, INT32 end); import Texts_Text Texts_ElemBase (Texts_Elem E); -import int32 Texts_ElemPos (Texts_Elem E); -import void Texts_Insert (Texts_Text T, int32 pos, Texts_Buffer B); -import void Texts_Load (Files_Rider *r, address *r__typ, Texts_Text T); +import INT32 Texts_ElemPos (Texts_Elem E); +import void Texts_Insert (Texts_Text T, INT32 pos, Texts_Buffer B); +import void Texts_Load (Files_Rider *r, ADDRESS *r__typ, Texts_Text T); import void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len); import void Texts_OpenBuf (Texts_Buffer B); -import void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int32 pos); -import void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int32 pos); -import void Texts_OpenWriter (Texts_Writer *W, address *W__typ); -import int32 Texts_Pos (Texts_Reader *R, address *R__typ); -import void Texts_Read (Texts_Reader *R, address *R__typ, CHAR *ch); -import void Texts_ReadElem (Texts_Reader *R, address *R__typ); -import void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ); +import void Texts_OpenReader (Texts_Reader *R, ADDRESS *R__typ, Texts_Text T, INT32 pos); +import void Texts_OpenScanner (Texts_Scanner *S, ADDRESS *S__typ, Texts_Text T, INT32 pos); +import void Texts_OpenWriter (Texts_Writer *W, ADDRESS *W__typ); +import INT32 Texts_Pos (Texts_Reader *R, ADDRESS *R__typ); +import void Texts_Read (Texts_Reader *R, ADDRESS *R__typ, CHAR *ch); +import void Texts_ReadElem (Texts_Reader *R, ADDRESS *R__typ); +import void Texts_ReadPrevElem (Texts_Reader *R, ADDRESS *R__typ); import void Texts_Recall (Texts_Buffer *B); -import void Texts_Save (Texts_Text T, int32 beg, int32 end, Texts_Buffer B); -import void Texts_Scan (Texts_Scanner *S, address *S__typ); -import void Texts_SetColor (Texts_Writer *W, address *W__typ, int8 col); -import void Texts_SetFont (Texts_Writer *W, address *W__typ, Texts_FontsFont fnt); -import void Texts_SetOffset (Texts_Writer *W, address *W__typ, int8 voff); -import void Texts_Store (Files_Rider *r, address *r__typ, Texts_Text T); -import void Texts_Write (Texts_Writer *W, address *W__typ, CHAR ch); -import void Texts_WriteDate (Texts_Writer *W, address *W__typ, int32 t, int32 d); -import void Texts_WriteElem (Texts_Writer *W, address *W__typ, Texts_Elem e); -import void Texts_WriteHex (Texts_Writer *W, address *W__typ, int32 x); -import void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n); -import void Texts_WriteLn (Texts_Writer *W, address *W__typ); -import void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int16 n); -import void Texts_WriteLongRealHex (Texts_Writer *W, address *W__typ, LONGREAL x); -import void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int16 n); -import void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int16 n, int16 k); -import void Texts_WriteRealHex (Texts_Writer *W, address *W__typ, REAL x); -import void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGINT s__len); +import void Texts_Save (Texts_Text T, INT32 beg, INT32 end, Texts_Buffer B); +import void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ); +import void Texts_SetColor (Texts_Writer *W, ADDRESS *W__typ, INT8 col); +import void Texts_SetFont (Texts_Writer *W, ADDRESS *W__typ, Texts_FontsFont fnt); +import void Texts_SetOffset (Texts_Writer *W, ADDRESS *W__typ, INT8 voff); +import void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T); +import void Texts_Write (Texts_Writer *W, ADDRESS *W__typ, CHAR ch); +import void Texts_WriteDate (Texts_Writer *W, ADDRESS *W__typ, INT32 t, INT32 d); +import void Texts_WriteElem (Texts_Writer *W, ADDRESS *W__typ, Texts_Elem e); +import void Texts_WriteHex (Texts_Writer *W, ADDRESS *W__typ, INT32 x); +import void Texts_WriteInt (Texts_Writer *W, ADDRESS *W__typ, INT64 x, INT64 n); +import void Texts_WriteLn (Texts_Writer *W, ADDRESS *W__typ); +import void Texts_WriteLongReal (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x, INT16 n); +import void Texts_WriteLongRealHex (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x); +import void Texts_WriteReal (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n); +import void Texts_WriteRealFix (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n, INT16 k); +import void Texts_WriteRealHex (Texts_Writer *W, ADDRESS *W__typ, REAL x); +import void Texts_WriteString (Texts_Writer *W, ADDRESS *W__typ, CHAR *s, LONGINT s__len); import void *Texts__init(void); diff --git a/bootstrap/windows-48/VT100.c b/bootstrap/windows-48/VT100.c index c3a9491f..b5067d33 100644 --- a/bootstrap/windows-48/VT100.c +++ b/bootstrap/windows-48/VT100.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "Out.h" @@ -14,36 +14,36 @@ export CHAR VT100_CSI[5]; static CHAR VT100_tmpstr[32]; -export void VT100_CHA (int16 n); -export void VT100_CNL (int16 n); -export void VT100_CPL (int16 n); -export void VT100_CUB (int16 n); -export void VT100_CUD (int16 n); -export void VT100_CUF (int16 n); -export void VT100_CUP (int16 n, int16 m); -export void VT100_CUU (int16 n); +export void VT100_CHA (INT16 n); +export void VT100_CNL (INT16 n); +export void VT100_CPL (INT16 n); +export void VT100_CUB (INT16 n); +export void VT100_CUD (INT16 n); +export void VT100_CUF (INT16 n); +export void VT100_CUP (INT16 n, INT16 m); +export void VT100_CUU (INT16 n); export void VT100_DECTCEMh (void); export void VT100_DECTCEMl (void); -export void VT100_DSR (int16 n); -export void VT100_ED (int16 n); -export void VT100_EL (int16 n); -static void VT100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len); +export void VT100_DSR (INT16 n); +export void VT100_ED (INT16 n); +export void VT100_EL (INT16 n); +static void VT100_EscSeq (INT16 n, CHAR *letter, LONGINT letter__len); static void VT100_EscSeq0 (CHAR *letter, LONGINT letter__len); -static void VT100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len); -static void VT100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len); -export void VT100_HVP (int16 n, int16 m); -export void VT100_IntToStr (int32 int_, CHAR *str, LONGINT str__len); +static void VT100_EscSeq2 (INT16 n, INT16 m, CHAR *letter, LONGINT letter__len); +static void VT100_EscSeqSwapped (INT16 n, CHAR *letter, LONGINT letter__len); +export void VT100_HVP (INT16 n, INT16 m); +export void VT100_IntToStr (INT32 int_, CHAR *str, LONGINT str__len); export void VT100_RCP (void); -static void VT100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end); +static void VT100_Reverse0 (CHAR *str, LONGINT str__len, INT16 start, INT16 end); export void VT100_SCP (void); -export void VT100_SD (int16 n); -export void VT100_SGR (int16 n); -export void VT100_SGR2 (int16 n, int16 m); -export void VT100_SU (int16 n); +export void VT100_SD (INT16 n); +export void VT100_SGR (INT16 n); +export void VT100_SGR2 (INT16 n, INT16 m); +export void VT100_SU (INT16 n); export void VT100_SetAttr (CHAR *attr, LONGINT attr__len); -static void VT100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end) +static void VT100_Reverse0 (CHAR *str, LONGINT str__len, INT16 start, INT16 end) { CHAR h; while (start < end) { @@ -55,11 +55,11 @@ static void VT100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end) } } -void VT100_IntToStr (int32 int_, CHAR *str, LONGINT str__len) +void VT100_IntToStr (INT32 int_, CHAR *str, LONGINT str__len) { CHAR b[21]; - int16 s, e; - int8 maxLength; + INT16 s, e; + INT8 maxLength; maxLength = 11; if (int_ == (-2147483647-1)) { __MOVE("-2147483648", b, 12); @@ -94,7 +94,7 @@ static void VT100_EscSeq0 (CHAR *letter, LONGINT letter__len) __DEL(letter); } -static void VT100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len) +static void VT100_EscSeq (INT16 n, CHAR *letter, LONGINT letter__len) { CHAR nstr[2]; CHAR cmd[7]; @@ -107,7 +107,7 @@ static void VT100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len) __DEL(letter); } -static void VT100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len) +static void VT100_EscSeqSwapped (INT16 n, CHAR *letter, LONGINT letter__len) { CHAR nstr[2]; CHAR cmd[7]; @@ -120,7 +120,7 @@ static void VT100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len) __DEL(letter); } -static void VT100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len) +static void VT100_EscSeq2 (INT16 n, INT16 m, CHAR *letter, LONGINT letter__len) { CHAR nstr[5], mstr[5]; CHAR cmd[12]; @@ -136,82 +136,82 @@ static void VT100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len) __DEL(letter); } -void VT100_CUU (int16 n) +void VT100_CUU (INT16 n) { VT100_EscSeq(n, (CHAR*)"A", 2); } -void VT100_CUD (int16 n) +void VT100_CUD (INT16 n) { VT100_EscSeq(n, (CHAR*)"B", 2); } -void VT100_CUF (int16 n) +void VT100_CUF (INT16 n) { VT100_EscSeq(n, (CHAR*)"C", 2); } -void VT100_CUB (int16 n) +void VT100_CUB (INT16 n) { VT100_EscSeq(n, (CHAR*)"D", 2); } -void VT100_CNL (int16 n) +void VT100_CNL (INT16 n) { VT100_EscSeq(n, (CHAR*)"E", 2); } -void VT100_CPL (int16 n) +void VT100_CPL (INT16 n) { VT100_EscSeq(n, (CHAR*)"F", 2); } -void VT100_CHA (int16 n) +void VT100_CHA (INT16 n) { VT100_EscSeq(n, (CHAR*)"G", 2); } -void VT100_CUP (int16 n, int16 m) +void VT100_CUP (INT16 n, INT16 m) { VT100_EscSeq2(n, m, (CHAR*)"H", 2); } -void VT100_ED (int16 n) +void VT100_ED (INT16 n) { VT100_EscSeq(n, (CHAR*)"J", 2); } -void VT100_EL (int16 n) +void VT100_EL (INT16 n) { VT100_EscSeq(n, (CHAR*)"K", 2); } -void VT100_SU (int16 n) +void VT100_SU (INT16 n) { VT100_EscSeq(n, (CHAR*)"S", 2); } -void VT100_SD (int16 n) +void VT100_SD (INT16 n) { VT100_EscSeq(n, (CHAR*)"T", 2); } -void VT100_HVP (int16 n, int16 m) +void VT100_HVP (INT16 n, INT16 m) { VT100_EscSeq2(n, m, (CHAR*)"f", 2); } -void VT100_SGR (int16 n) +void VT100_SGR (INT16 n) { VT100_EscSeq(n, (CHAR*)"m", 2); } -void VT100_SGR2 (int16 n, int16 m) +void VT100_SGR2 (INT16 n, INT16 m) { VT100_EscSeq2(n, m, (CHAR*)"m", 2); } -void VT100_DSR (int16 n) +void VT100_DSR (INT16 n) { VT100_EscSeq(6, (CHAR*)"n", 2); } diff --git a/bootstrap/windows-48/VT100.h b/bootstrap/windows-48/VT100.h index ee0408bb..d9aa6ab7 100644 --- a/bootstrap/windows-48/VT100.h +++ b/bootstrap/windows-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef VT100__h #define VT100__h @@ -9,27 +9,27 @@ import CHAR VT100_CSI[5]; -import void VT100_CHA (int16 n); -import void VT100_CNL (int16 n); -import void VT100_CPL (int16 n); -import void VT100_CUB (int16 n); -import void VT100_CUD (int16 n); -import void VT100_CUF (int16 n); -import void VT100_CUP (int16 n, int16 m); -import void VT100_CUU (int16 n); +import void VT100_CHA (INT16 n); +import void VT100_CNL (INT16 n); +import void VT100_CPL (INT16 n); +import void VT100_CUB (INT16 n); +import void VT100_CUD (INT16 n); +import void VT100_CUF (INT16 n); +import void VT100_CUP (INT16 n, INT16 m); +import void VT100_CUU (INT16 n); import void VT100_DECTCEMh (void); import void VT100_DECTCEMl (void); -import void VT100_DSR (int16 n); -import void VT100_ED (int16 n); -import void VT100_EL (int16 n); -import void VT100_HVP (int16 n, int16 m); -import void VT100_IntToStr (int32 int_, CHAR *str, LONGINT str__len); +import void VT100_DSR (INT16 n); +import void VT100_ED (INT16 n); +import void VT100_EL (INT16 n); +import void VT100_HVP (INT16 n, INT16 m); +import void VT100_IntToStr (INT32 int_, CHAR *str, LONGINT str__len); import void VT100_RCP (void); import void VT100_SCP (void); -import void VT100_SD (int16 n); -import void VT100_SGR (int16 n); -import void VT100_SGR2 (int16 n, int16 m); -import void VT100_SU (int16 n); +import void VT100_SD (INT16 n); +import void VT100_SGR (INT16 n); +import void VT100_SGR2 (INT16 n, INT16 m); +import void VT100_SU (INT16 n); import void VT100_SetAttr (CHAR *attr, LONGINT attr__len); import void *VT100__init(void); diff --git a/bootstrap/windows-48/errors.c b/bootstrap/windows-48/errors.c index cce1644f..2a1a7a02 100644 --- a/bootstrap/windows-48/errors.c +++ b/bootstrap/windows-48/errors.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" diff --git a/bootstrap/windows-48/errors.h b/bootstrap/windows-48/errors.h index 9d34f721..5555899e 100644 --- a/bootstrap/windows-48/errors.h +++ b/bootstrap/windows-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index d2dcce53..8ed00f14 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "Configuration.h" @@ -24,7 +24,7 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGINT cmd__len) { - int16 r, status, exitcode; + INT16 r, status, exitcode; __DUP(title, title__len, CHAR); __DUP(cmd, cmd__len, CHAR); if (__IN(18, OPM_Options, 32)) { diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index 2e262037..ad76f7b6 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/Compiler.c b/bootstrap/windows-88/Compiler.c index 759e721b..86c4c1fd 100644 --- a/bootstrap/windows-88/Compiler.c +++ b/bootstrap/windows-88/Compiler.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "Configuration.h" @@ -26,7 +26,7 @@ static CHAR Compiler_mname[256]; export void Compiler_Module (BOOLEAN *done); static void Compiler_PropagateElementaryTypeSizes (void); export void Compiler_Translate (void); -static void Compiler_Trap (int32 sig); +static void Compiler_Trap (INT32 sig); void Compiler_Module (BOOLEAN *done) @@ -147,7 +147,7 @@ void Compiler_Translate (void) } } -static void Compiler_Trap (int32 sig) +static void Compiler_Trap (INT32 sig) { Heap_FINALL(); if (sig == 3) { diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index 95ddb569..3f8c68d8 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index f6a548e4..6abf2414 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 9b1abaed..e7239705 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "Heap.h" @@ -18,7 +18,7 @@ typedef struct Files_BufDesc { Files_File f; BOOLEAN chg; - int32 org, size; + INT32 org, size; SYSTEM_BYTE data[4096]; } Files_BufDesc; @@ -33,85 +33,85 @@ typedef Files_FileName workName, registerName; BOOLEAN tempFile; Platform_FileIdentity identity; - int32 fd, len, pos; + INT32 fd, len, pos; Files_Buffer bufs[4]; - int16 swapper, state; + INT16 swapper, state; Files_File next; } Files_FileDesc; typedef struct Files_Rider { - int32 res; + INT32 res; BOOLEAN eof; Files_Buffer buf; - int32 org, offset; + INT32 org, offset; } Files_Rider; static Files_File Files_files; -static int16 Files_tempno; +static INT16 Files_tempno; static CHAR Files_HOME[1024]; static struct { LONGINT len[1]; CHAR data[1]; } *Files_SearchPath; -export address *Files_FileDesc__typ; -export address *Files_BufDesc__typ; -export address *Files_Rider__typ; +export ADDRESS *Files_FileDesc__typ; +export ADDRESS *Files_BufDesc__typ; +export ADDRESS *Files_Rider__typ; -export Files_File Files_Base (Files_Rider *r, address *r__typ); +export Files_File Files_Base (Files_Rider *r, ADDRESS *r__typ); static Files_File Files_CacheEntry (Platform_FileIdentity identity); -export void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int16 *res); +export void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INT16 *res); export void Files_Close (Files_File f); static void Files_CloseOSFile (Files_File f); static void Files_Create (Files_File f); -export void Files_Delete (CHAR *name, LONGINT name__len, int16 *res); -static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int16 errcode); +export void Files_Delete (CHAR *name, LONGINT name__len, INT16 *res); +static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INT16 errcode); static void Files_Finalize (SYSTEM_PTR o); static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *dest, LONGINT dest__len); static void Files_Flush (Files_Buffer buf); -export void Files_GetDate (Files_File f, int32 *t, int32 *d); +export void Files_GetDate (Files_File f, INT32 *t, INT32 *d); export void Files_GetName (Files_File f, CHAR *name, LONGINT name__len); static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *name, LONGINT name__len); static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len); -export int32 Files_Length (Files_File f); +export INT32 Files_Length (Files_File f); static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT name__len, CHAR *dest, LONGINT dest__len); export Files_File Files_New (CHAR *name, LONGINT name__len); export Files_File Files_Old (CHAR *name, LONGINT name__len); -export int32 Files_Pos (Files_Rider *r, address *r__typ); +export INT32 Files_Pos (Files_Rider *r, ADDRESS *r__typ); export void Files_Purge (Files_File f); -export void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x); -export void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x); -export void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); -export void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x); -export void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); -export void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); -export void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); -export void Files_ReadNum (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len); -export void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); -export void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x); -export void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); +export void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x); +export void Files_ReadBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN *x); +export void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n); +export void Files_ReadInt (Files_Rider *R, ADDRESS *R__typ, INT16 *x); +export void Files_ReadLInt (Files_Rider *R, ADDRESS *R__typ, INT32 *x); +export void Files_ReadLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL *x); +export void Files_ReadLine (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); +export void Files_ReadNum (Files_Rider *R, ADDRESS *R__typ, SYSTEM_BYTE *x, LONGINT x__len); +export void Files_ReadReal (Files_Rider *R, ADDRESS *R__typ, REAL *x); +export void Files_ReadSet (Files_Rider *R, ADDRESS *R__typ, UINT32 *x); +export void Files_ReadString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); export void Files_Register (Files_File f); -export void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res); -static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len); -export void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos); +export void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT16 *res); +static void Files_ScanPath (INT16 *pos, CHAR *dir, LONGINT dir__len); +export void Files_Set (Files_Rider *r, ADDRESS *r__typ, Files_File f, INT32 pos); export void Files_SetSearchPath (CHAR *path, LONGINT path__len); -export void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x); -export void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x); -export void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); -export void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x); -export void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x); -export void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x); -export void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x); -export void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x); -export void Files_WriteSet (Files_Rider *R, address *R__typ, uint32 x); -export void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); +export void Files_Write (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE x); +export void Files_WriteBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN x); +export void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n); +export void Files_WriteInt (Files_Rider *R, ADDRESS *R__typ, INT16 x); +export void Files_WriteLInt (Files_Rider *R, ADDRESS *R__typ, INT32 x); +export void Files_WriteLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL x); +export void Files_WriteNum (Files_Rider *R, ADDRESS *R__typ, INT64 x); +export void Files_WriteReal (Files_Rider *R, ADDRESS *R__typ, REAL x); +export void Files_WriteSet (Files_Rider *R, ADDRESS *R__typ, UINT32 x); +export void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); #define Files_IdxTrap() __HALT(-1) #define Files_ToAdr(x) (address)x -static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int16 errcode) +static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INT16 errcode) { __DUP(s, s__len, CHAR); Out_Ln(); @@ -140,7 +140,7 @@ static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int16 errcode) static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT name__len, CHAR *dest, LONGINT dest__len) { - int16 i, j; + INT16 i, j; __DUP(dir, dir__len, CHAR); __DUP(name, name__len, CHAR); i = 0; @@ -165,7 +165,7 @@ static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *name, LONGINT name__len) { - int32 n, i, j; + INT32 n, i, j; __DUP(finalName, finalName__len, CHAR); Files_tempno += 1; n = Files_tempno; @@ -217,7 +217,7 @@ static void Files_Create (Files_File f) { Platform_FileIdentity identity; BOOLEAN done; - int16 error; + INT16 error; CHAR err[32]; if (f->fd == -1) { if (f->state == 1) { @@ -254,7 +254,7 @@ static void Files_Create (Files_File f) static void Files_Flush (Files_Buffer buf) { - int16 error; + INT16 error; Files_File f = NIL; if (buf->chg) { f = buf->f; @@ -278,7 +278,7 @@ static void Files_Flush (Files_Buffer buf) static void Files_CloseOSFile (Files_File f) { Files_File prev = NIL; - int16 error; + INT16 error; if (Files_files == f) { Files_files = f->next; } else { @@ -298,8 +298,8 @@ static void Files_CloseOSFile (Files_File f) void Files_Close (Files_File f) { - int32 i; - int16 error; + INT32 i; + INT16 error; if (f->state != 1 || f->registerName[0] != 0x00) { Files_Create(f); i = 0; @@ -315,7 +315,7 @@ void Files_Close (Files_File f) } } -int32 Files_Length (Files_File f) +INT32 Files_Length (Files_File f) { return f->len; } @@ -336,9 +336,9 @@ Files_File Files_New (CHAR *name, LONGINT name__len) return f; } -static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len) +static void Files_ScanPath (INT16 *pos, CHAR *dir, LONGINT dir__len) { - int16 i; + INT16 i; CHAR ch; i = 0; if (Files_SearchPath == NIL) { @@ -381,7 +381,7 @@ static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len) static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len) { - int16 i; + INT16 i; CHAR ch; i = 0; ch = name[0]; @@ -395,7 +395,7 @@ static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len) static Files_File Files_CacheEntry (Platform_FileIdentity identity) { Files_File f = NIL; - int16 i, error; + INT16 i, error; f = Files_files; while (f != NIL) { if (Platform_SameFile(identity, f->identity)) { @@ -422,11 +422,11 @@ static Files_File Files_CacheEntry (Platform_FileIdentity identity) Files_File Files_Old (CHAR *name, LONGINT name__len) { Files_File f = NIL; - int32 fd; - int16 pos; + INT32 fd; + INT16 pos; BOOLEAN done; CHAR dir[256], path[256]; - int16 error; + INT16 error; Platform_FileIdentity identity; __DUP(name, name__len, CHAR); if (name[0] != 0x00) { @@ -497,9 +497,9 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) void Files_Purge (Files_File f) { - int16 i; + INT16 i; Platform_FileIdentity identity; - int16 error; + INT16 error; i = 0; while (i < 4) { if (f->bufs[i] != NIL) { @@ -519,25 +519,25 @@ void Files_Purge (Files_File f) Platform_SetMTime(&f->identity, Platform_FileIdentity__typ, identity); } -void Files_GetDate (Files_File f, int32 *t, int32 *d) +void Files_GetDate (Files_File f, INT32 *t, INT32 *d) { Platform_FileIdentity identity; - int16 error; + INT16 error; Files_Create(f); error = Platform_Identify(f->fd, &identity, Platform_FileIdentity__typ); Platform_MTimeAsClock(identity, &*t, &*d); } -int32 Files_Pos (Files_Rider *r, address *r__typ) +INT32 Files_Pos (Files_Rider *r, ADDRESS *r__typ) { return (*r).org + (*r).offset; } -void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos) +void Files_Set (Files_Rider *r, ADDRESS *r__typ, Files_File f, INT32 pos) { - int32 org, offset, i, n; + INT32 org, offset, i, n; Files_Buffer buf = NIL; - int16 error; + INT16 error; if (f != NIL) { if (pos > f->len) { pos = f->len; @@ -595,9 +595,9 @@ void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos) (*r).res = 0; } -void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x) +void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x) { - int32 offset; + INT32 offset; Files_Buffer buf = NIL; buf = (*r).buf; offset = (*r).offset; @@ -619,9 +619,9 @@ void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x) } } -void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n) +void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n) { - int32 xpos, min, restInBuf, offset; + INT32 xpos, min, restInBuf, offset; Files_Buffer buf = NIL; if (n > x__len) { Files_IdxTrap(); @@ -655,15 +655,15 @@ void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x (*r).eof = 0; } -Files_File Files_Base (Files_Rider *r, address *r__typ) +Files_File Files_Base (Files_Rider *r, ADDRESS *r__typ) { return (*r).buf->f; } -void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x) +void Files_Write (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE x) { Files_Buffer buf = NIL; - int32 offset; + INT32 offset; buf = (*r).buf; offset = (*r).offset; if ((*r).org != buf->org || offset >= 4096) { @@ -681,9 +681,9 @@ void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x) (*r).res = 0; } -void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n) +void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n) { - int32 xpos, min, restInBuf, offset; + INT32 xpos, min, restInBuf, offset; Files_Buffer buf = NIL; if (n > x__len) { Files_IdxTrap(); @@ -717,17 +717,17 @@ void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT (*r).res = 0; } -void Files_Delete (CHAR *name, LONGINT name__len, int16 *res) +void Files_Delete (CHAR *name, LONGINT name__len, INT16 *res) { __DUP(name, name__len, CHAR); *res = Platform_Unlink((void*)name, name__len); __DEL(name); } -void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res) +void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT16 *res) { - int32 fdold, fdnew, n; - int16 error, ignore; + INT32 fdold, fdnew, n; + INT16 error, ignore; Platform_FileIdentity oldidentity, newidentity; CHAR buf[4096]; __DUP(old, old__len, CHAR); @@ -788,7 +788,7 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int void Files_Register (Files_File f) { - int16 idx, errcode; + INT16 idx, errcode; Files_File f1 = NIL; CHAR file[104]; if ((f->state == 1 && f->registerName[0] != 0x00)) { @@ -807,7 +807,7 @@ void Files_Register (Files_File f) } } -void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int16 *res) +void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INT16 *res) { __DUP(path, path__len, CHAR); *res = Platform_Chdir((void*)path, path__len); @@ -816,7 +816,7 @@ void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int16 *res) static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *dest, LONGINT dest__len) { - int32 i, j; + INT32 i, j; if (!Platform_LittleEndian) { i = src__len; j = 0; @@ -830,51 +830,51 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *de } } -void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x) +void Files_ReadBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN *x) { Files_Read(&*R, R__typ, (CHAR*)(void*)&*x); } -void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x) +void Files_ReadInt (Files_Rider *R, ADDRESS *R__typ, INT16 *x) { CHAR b[2]; Files_ReadBytes(&*R, R__typ, (void*)b, 2, 2); - *x = (int16)b[0] + __ASHL((int16)b[1], 8); + *x = (INT16)b[0] + __ASHL((INT16)b[1], 8); } -void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x) +void Files_ReadLInt (Files_Rider *R, ADDRESS *R__typ, INT32 *x) { CHAR b[4]; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); - *x = (((int16)b[0] + __ASHL((int16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); + *x = (((INT16)b[0] + __ASHL((INT16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); } -void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x) +void Files_ReadSet (Files_Rider *R, ADDRESS *R__typ, UINT32 *x) { CHAR b[4]; - int32 l; + INT32 l; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); - l = (((int16)b[0] + __ASHL((int16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); - *x = (uint32)l; + l = (((INT16)b[0] + __ASHL((INT16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); + *x = (UINT32)l; } -void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x) +void Files_ReadReal (Files_Rider *R, ADDRESS *R__typ, REAL *x) { CHAR b[4]; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); Files_FlipBytes((void*)b, 4, (void*)&*x, 4); } -void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x) +void Files_ReadLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL *x) { CHAR b[8]; Files_ReadBytes(&*R, R__typ, (void*)b, 8, 8); Files_FlipBytes((void*)b, 8, (void*)&*x, 8); } -void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) +void Files_ReadString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len) { - int16 i; + INT16 i; CHAR ch; i = 0; do { @@ -884,9 +884,9 @@ void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) } while (!(ch == 0x00)); } -void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) +void Files_ReadLine (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len) { - int16 i; + INT16 i; CHAR ch; BOOLEAN b; i = 0; @@ -902,29 +902,29 @@ void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) } while (!b); } -void Files_ReadNum (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len) +void Files_ReadNum (Files_Rider *R, ADDRESS *R__typ, SYSTEM_BYTE *x, LONGINT x__len) { - int8 s, b; - int64 q; + INT8 s, b; + INT64 q; s = 0; q = 0; Files_Read(&*R, R__typ, (void*)&b); while (b < 0) { - q += (int64)__ASH(((int16)b + 128), s); + q += (INT64)__ASH(((INT16)b + 128), s); s += 7; Files_Read(&*R, R__typ, (void*)&b); } - q += (int64)__ASH((__MASK(b, -64) - __ASHL(__ASHR(b, 6), 6)), s); + q += (INT64)__ASH((__MASK(b, -64) - __ASHL(__ASHR(b, 6), 6)), s); __ASSERT(x__len <= 8, 0); __MOVE((address)&q, (address)x, x__len); } -void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x) +void Files_WriteBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN x) { Files_Write(&*R, R__typ, __VAL(CHAR, x)); } -void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x) +void Files_WriteInt (Files_Rider *R, ADDRESS *R__typ, INT16 x) { CHAR b[2]; b[0] = (CHAR)x; @@ -932,7 +932,7 @@ void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x) Files_WriteBytes(&*R, R__typ, (void*)b, 2, 2); } -void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x) +void Files_WriteLInt (Files_Rider *R, ADDRESS *R__typ, INT32 x) { CHAR b[4]; b[0] = (CHAR)x; @@ -942,11 +942,11 @@ void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x) Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } -void Files_WriteSet (Files_Rider *R, address *R__typ, uint32 x) +void Files_WriteSet (Files_Rider *R, ADDRESS *R__typ, UINT32 x) { CHAR b[4]; - int32 i; - i = (int32)x; + INT32 i; + i = (INT32)x; b[0] = (CHAR)i; b[1] = (CHAR)__ASHR(i, 8); b[2] = (CHAR)__ASHR(i, 16); @@ -954,23 +954,23 @@ void Files_WriteSet (Files_Rider *R, address *R__typ, uint32 x) Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } -void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x) +void Files_WriteReal (Files_Rider *R, ADDRESS *R__typ, REAL x) { CHAR b[4]; Files_FlipBytes((void*)&x, 4, (void*)b, 4); Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } -void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x) +void Files_WriteLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL x) { CHAR b[8]; Files_FlipBytes((void*)&x, 8, (void*)b, 8); Files_WriteBytes(&*R, R__typ, (void*)b, 8, 8); } -void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) +void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len) { - int16 i; + INT16 i; i = 0; while (x[i] != 0x00) { i += 1; @@ -978,7 +978,7 @@ void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len Files_WriteBytes(&*R, R__typ, (void*)x, x__len * 1, i + 1); } -void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x) +void Files_WriteNum (Files_Rider *R, ADDRESS *R__typ, INT64 x) { while (x < -64 || x > 63) { Files_Write(&*R, R__typ, (CHAR)(__MASK(x, -128) + 128)); @@ -995,7 +995,7 @@ void Files_GetName (Files_File f, CHAR *name, LONGINT name__len) static void Files_Finalize (SYSTEM_PTR o) { Files_File f = NIL; - int32 res; + INT32 res; f = (Files_File)(address)o; if (f->fd >= 0) { Files_CloseOSFile(f); diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 2e014659..4d65d916 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h @@ -10,61 +10,61 @@ typedef typedef struct Files_FileDesc { - int64 _prvt0; + INT64 _prvt0; char _prvt1[216]; - int32 fd; + INT32 fd; char _prvt2[60]; } Files_FileDesc; typedef struct Files_Rider { - int32 res; + INT32 res; BOOLEAN eof; - int64 _prvt0; + INT64 _prvt0; char _prvt1[8]; } Files_Rider; -import address *Files_FileDesc__typ; -import address *Files_Rider__typ; +import ADDRESS *Files_FileDesc__typ; +import ADDRESS *Files_Rider__typ; -import Files_File Files_Base (Files_Rider *r, address *r__typ); -import void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int16 *res); +import Files_File Files_Base (Files_Rider *r, ADDRESS *r__typ); +import void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INT16 *res); import void Files_Close (Files_File f); -import void Files_Delete (CHAR *name, LONGINT name__len, int16 *res); -import void Files_GetDate (Files_File f, int32 *t, int32 *d); +import void Files_Delete (CHAR *name, LONGINT name__len, INT16 *res); +import void Files_GetDate (Files_File f, INT32 *t, INT32 *d); import void Files_GetName (Files_File f, CHAR *name, LONGINT name__len); -import int32 Files_Length (Files_File f); +import INT32 Files_Length (Files_File f); import Files_File Files_New (CHAR *name, LONGINT name__len); import Files_File Files_Old (CHAR *name, LONGINT name__len); -import int32 Files_Pos (Files_Rider *r, address *r__typ); +import INT32 Files_Pos (Files_Rider *r, ADDRESS *r__typ); import void Files_Purge (Files_File f); -import void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x); -import void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x); -import void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); -import void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x); -import void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); -import void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); -import void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); -import void Files_ReadNum (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len); -import void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); -import void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x); -import void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); +import void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x); +import void Files_ReadBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN *x); +import void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n); +import void Files_ReadInt (Files_Rider *R, ADDRESS *R__typ, INT16 *x); +import void Files_ReadLInt (Files_Rider *R, ADDRESS *R__typ, INT32 *x); +import void Files_ReadLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL *x); +import void Files_ReadLine (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); +import void Files_ReadNum (Files_Rider *R, ADDRESS *R__typ, SYSTEM_BYTE *x, LONGINT x__len); +import void Files_ReadReal (Files_Rider *R, ADDRESS *R__typ, REAL *x); +import void Files_ReadSet (Files_Rider *R, ADDRESS *R__typ, UINT32 *x); +import void Files_ReadString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); import void Files_Register (Files_File f); -import void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res); -import void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos); +import void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT16 *res); +import void Files_Set (Files_Rider *r, ADDRESS *r__typ, Files_File f, INT32 pos); import void Files_SetSearchPath (CHAR *path, LONGINT path__len); -import void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x); -import void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x); -import void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); -import void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x); -import void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x); -import void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x); -import void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x); -import void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x); -import void Files_WriteSet (Files_Rider *R, address *R__typ, uint32 x); -import void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); +import void Files_Write (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE x); +import void Files_WriteBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN x); +import void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n); +import void Files_WriteInt (Files_Rider *R, ADDRESS *R__typ, INT16 x); +import void Files_WriteLInt (Files_Rider *R, ADDRESS *R__typ, INT32 x); +import void Files_WriteLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL x); +import void Files_WriteNum (Files_Rider *R, ADDRESS *R__typ, INT64 x); +import void Files_WriteReal (Files_Rider *R, ADDRESS *R__typ, REAL x); +import void Files_WriteSet (Files_Rider *R, ADDRESS *R__typ, UINT32 x); +import void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); import void *Files__init(void); diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index 5117800b..a162ea04 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" @@ -40,7 +40,7 @@ typedef typedef struct Heap_FinDesc { Heap_FinNode next; - int64 obj; + INT64 obj; BOOLEAN marked; Heap_Finalizer finalize; } Heap_FinDesc; @@ -55,53 +55,53 @@ typedef struct Heap_ModuleDesc { Heap_Module next; Heap_ModuleName name; - int32 refcnt; + INT32 refcnt; Heap_Cmd cmds; - int64 types; + INT64 types; Heap_EnumProc enumPtrs; - int32 reserved1, reserved2; + INT32 reserved1, reserved2; } Heap_ModuleDesc; export SYSTEM_PTR Heap_modules; -static int64 Heap_freeList[10]; -static int64 Heap_bigBlocks; -export int64 Heap_allocated; +static INT64 Heap_freeList[10]; +static INT64 Heap_bigBlocks; +export INT64 Heap_allocated; static BOOLEAN Heap_firstTry; -static int64 Heap_heap, Heap_heapend; -export int64 Heap_heapsize; +static INT64 Heap_heap, Heap_heapend; +export INT64 Heap_heapsize; static Heap_FinNode Heap_fin; -static int16 Heap_lockdepth; +static INT16 Heap_lockdepth; static BOOLEAN Heap_interrupted; -export int16 Heap_FileCount; +export INT16 Heap_FileCount; -export address *Heap_ModuleDesc__typ; -export address *Heap_CmdDesc__typ; -export address *Heap_FinDesc__typ; -export address *Heap__1__typ; +export ADDRESS *Heap_ModuleDesc__typ; +export ADDRESS *Heap_CmdDesc__typ; +export ADDRESS *Heap_FinDesc__typ; +export ADDRESS *Heap__1__typ; static void Heap_CheckFin (void); -static void Heap_ExtendHeap (int64 blksz); +static void Heap_ExtendHeap (INT64 blksz); export void Heap_FINALL (void); static void Heap_Finalize (void); export void Heap_GC (BOOLEAN markStack); -static void Heap_HeapSort (int64 n, int64 *a, LONGINT a__len); +static void Heap_HeapSort (INT64 n, INT64 *a, LONGINT a__len); export void Heap_INCREF (Heap_Module m); export void Heap_InitHeap (void); export void Heap_Lock (void); -static void Heap_Mark (int64 q); -static void Heap_MarkCandidates (int64 n, int64 *cand, LONGINT cand__len); +static void Heap_Mark (INT64 q); +static void Heap_MarkCandidates (INT64 n, INT64 *cand, LONGINT cand__len); static void Heap_MarkP (SYSTEM_PTR p); -static void Heap_MarkStack (int64 n, int64 *cand, LONGINT cand__len); -export SYSTEM_PTR Heap_NEWBLK (int64 size); -export SYSTEM_PTR Heap_NEWREC (int64 tag); -static int64 Heap_NewChunk (int64 blksz); +static void Heap_MarkStack (INT64 n, INT64 *cand, LONGINT cand__len); +export SYSTEM_PTR Heap_NEWBLK (INT64 size); +export SYSTEM_PTR Heap_NEWREC (INT64 tag); +static INT64 Heap_NewChunk (INT64 blksz); export void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); export SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -export void Heap_REGTYP (Heap_Module m, int64 typ); +export void Heap_REGTYP (Heap_Module m, INT64 typ); export void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); static void Heap_Scan (void); -static void Heap_Sift (int64 l, int64 r, int64 *a, LONGINT a__len); +static void Heap_Sift (INT64 l, INT64 r, INT64 *a, LONGINT a__len); export void Heap_Unlock (void); extern void *Heap__init(); @@ -157,9 +157,9 @@ void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) m->cmds = c; } -void Heap_REGTYP (Heap_Module m, int64 typ) +void Heap_REGTYP (Heap_Module m, INT64 typ) { - __PUT(typ, m->types, int64); + __PUT(typ, m->types, INT64); m->types = typ; } @@ -168,25 +168,25 @@ void Heap_INCREF (Heap_Module m) m->refcnt += 1; } -static int64 Heap_NewChunk (int64 blksz) +static INT64 Heap_NewChunk (INT64 blksz) { - int64 chnk; + INT64 chnk; chnk = Heap_OSAllocate(blksz + 24); if (chnk != 0) { - __PUT(chnk + 8, chnk + (24 + blksz), int64); - __PUT(chnk + 24, chnk + 32, int64); - __PUT(chnk + 32, blksz, int64); - __PUT(chnk + 40, -8, int64); - __PUT(chnk + 48, Heap_bigBlocks, int64); + __PUT(chnk + 8, chnk + (24 + blksz), INT64); + __PUT(chnk + 24, chnk + 32, INT64); + __PUT(chnk + 32, blksz, INT64); + __PUT(chnk + 40, -8, INT64); + __PUT(chnk + 48, Heap_bigBlocks, INT64); Heap_bigBlocks = chnk + 24; Heap_heapsize += blksz; } return chnk; } -static void Heap_ExtendHeap (int64 blksz) +static void Heap_ExtendHeap (INT64 blksz) { - int64 size, chnk, j, next; + INT64 size, chnk, j, next; if (blksz > 320000) { size = blksz; } else { @@ -195,30 +195,30 @@ static void Heap_ExtendHeap (int64 blksz) chnk = Heap_NewChunk(size); if (chnk != 0) { if (chnk < Heap_heap) { - __PUT(chnk, Heap_heap, int64); + __PUT(chnk, Heap_heap, INT64); Heap_heap = chnk; } else { j = Heap_heap; - __GET(j, next, int64); + __GET(j, next, INT64); while ((next != 0 && chnk > next)) { j = next; - __GET(j, next, int64); + __GET(j, next, INT64); } - __PUT(chnk, next, int64); - __PUT(j, chnk, int64); + __PUT(chnk, next, INT64); + __PUT(j, chnk, INT64); } if (next == 0) { - __GET(chnk + 8, Heap_heapend, int64); + __GET(chnk + 8, Heap_heapend, INT64); } } } -SYSTEM_PTR Heap_NEWREC (int64 tag) +SYSTEM_PTR Heap_NEWREC (INT64 tag) { - int64 i, i0, di, blksz, restsize, t, adr, end, next, prev; + INT64 i, i0, di, blksz, restsize, t, adr, end, next, prev; SYSTEM_PTR new; Heap_Lock(); - __GET(tag, blksz, int64); + __GET(tag, blksz, INT64); i0 = __ASHR(blksz, 5); i = i0; if (i < 9) { @@ -229,17 +229,17 @@ SYSTEM_PTR Heap_NEWREC (int64 tag) } } if (i < 9) { - __GET(adr + 24, next, int64); + __GET(adr + 24, next, INT64); Heap_freeList[i] = next; if (i != i0) { di = i - i0; restsize = __ASHL(di, 5); end = adr + restsize; - __PUT(end + 8, blksz, int64); - __PUT(end + 16, -8, int64); - __PUT(end, end + 8, int64); - __PUT(adr + 8, restsize, int64); - __PUT(adr + 24, Heap_freeList[di], int64); + __PUT(end + 8, blksz, INT64); + __PUT(end + 16, -8, INT64); + __PUT(end, end + 8, INT64); + __PUT(adr + 8, restsize, INT64); + __PUT(adr + 24, Heap_freeList[di], INT64); Heap_freeList[di] = adr; adr += restsize; } @@ -268,31 +268,31 @@ SYSTEM_PTR Heap_NEWREC (int64 tag) return NIL; } } - __GET(adr + 8, t, int64); + __GET(adr + 8, t, INT64); if (t >= blksz) { break; } prev = adr; - __GET(adr + 24, adr, int64); + __GET(adr + 24, adr, INT64); } restsize = t - blksz; end = adr + restsize; - __PUT(end + 8, blksz, int64); - __PUT(end + 16, -8, int64); - __PUT(end, end + 8, int64); + __PUT(end + 8, blksz, INT64); + __PUT(end + 16, -8, INT64); + __PUT(end, end + 8, INT64); if (restsize > 288) { - __PUT(adr + 8, restsize, int64); + __PUT(adr + 8, restsize, INT64); } else { - __GET(adr + 24, next, int64); + __GET(adr + 24, next, INT64); if (prev == 0) { Heap_bigBlocks = next; } else { - __PUT(prev + 24, next, int64); + __PUT(prev + 24, next, INT64); } if (restsize > 0) { di = __ASHR(restsize, 5); - __PUT(adr + 8, restsize, int64); - __PUT(adr + 24, Heap_freeList[di], int64); + __PUT(adr + 8, restsize, INT64); + __PUT(adr + 24, Heap_freeList[di], INT64); Heap_freeList[di] = adr; } } @@ -301,69 +301,69 @@ SYSTEM_PTR Heap_NEWREC (int64 tag) i = adr + 32; end = adr + blksz; while (i < end) { - __PUT(i, 0, int64); - __PUT(i + 8, 0, int64); - __PUT(i + 16, 0, int64); - __PUT(i + 24, 0, int64); + __PUT(i, 0, INT64); + __PUT(i + 8, 0, INT64); + __PUT(i + 16, 0, INT64); + __PUT(i + 24, 0, INT64); i += 32; } - __PUT(adr + 24, 0, int64); - __PUT(adr, tag, int64); - __PUT(adr + 8, 0, int64); - __PUT(adr + 16, 0, int64); + __PUT(adr + 24, 0, INT64); + __PUT(adr, tag, INT64); + __PUT(adr + 8, 0, INT64); + __PUT(adr + 16, 0, INT64); Heap_allocated += blksz; Heap_Unlock(); return (SYSTEM_PTR)(address)(adr + 8); } -SYSTEM_PTR Heap_NEWBLK (int64 size) +SYSTEM_PTR Heap_NEWBLK (INT64 size) { - int64 blksz, tag; + INT64 blksz, tag; SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 63, 5), 5); new = Heap_NEWREC((address)&blksz); - tag = ((int64)(address)new + blksz) - 24; - __PUT(tag - 8, 0, int64); - __PUT(tag, blksz, int64); - __PUT(tag + 8, -8, int64); - __PUT((int64)(address)new - 8, tag, int64); + tag = ((INT64)(address)new + blksz) - 24; + __PUT(tag - 8, 0, INT64); + __PUT(tag, blksz, INT64); + __PUT(tag + 8, -8, INT64); + __PUT((INT64)(address)new - 8, tag, INT64); Heap_Unlock(); return new; } -static void Heap_Mark (int64 q) +static void Heap_Mark (INT64 q) { - int64 p, tag, offset, fld, n, tagbits; + INT64 p, tag, offset, fld, n, tagbits; if (q != 0) { - __GET(q - 8, tagbits, int64); + __GET(q - 8, tagbits, INT64); if (!__ODD(tagbits)) { - __PUT(q - 8, tagbits + 1, int64); + __PUT(q - 8, tagbits + 1, INT64); p = 0; tag = tagbits + 8; for (;;) { - __GET(tag, offset, int64); + __GET(tag, offset, INT64); if (offset < 0) { - __PUT(q - 8, (tag + offset) + 1, int64); + __PUT(q - 8, (tag + offset) + 1, INT64); if (p == 0) { break; } n = q; q = p; - __GET(q - 8, tag, int64); + __GET(q - 8, tag, INT64); tag -= 1; - __GET(tag, offset, int64); + __GET(tag, offset, INT64); fld = q + offset; - __GET(fld, p, int64); + __GET(fld, p, INT64); __PUT(fld, (SYSTEM_PTR)(address)n, SYSTEM_PTR); } else { fld = q + offset; - __GET(fld, n, int64); + __GET(fld, n, INT64); if (n != 0) { - __GET(n - 8, tagbits, int64); + __GET(n - 8, tagbits, INT64); if (!__ODD(tagbits)) { - __PUT(n - 8, tagbits + 1, int64); - __PUT(q - 8, tag + 1, int64); + __PUT(n - 8, tagbits + 1, INT64); + __PUT(q - 8, tag + 1, INT64); __PUT(fld, (SYSTEM_PTR)(address)p, SYSTEM_PTR); p = q; q = n; @@ -379,12 +379,12 @@ static void Heap_Mark (int64 q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((int64)(address)p); + Heap_Mark((INT64)(address)p); } static void Heap_Scan (void) { - int64 chnk, adr, end, start, tag, i, size, freesize; + INT64 chnk, adr, end, start, tag, i, size, freesize; Heap_bigBlocks = 0; i = 1; while (i < 9) { @@ -396,58 +396,58 @@ static void Heap_Scan (void) chnk = Heap_heap; while (chnk != 0) { adr = chnk + 24; - __GET(chnk + 8, end, int64); + __GET(chnk + 8, end, INT64); while (adr < end) { - __GET(adr, tag, int64); + __GET(adr, tag, INT64); if (__ODD(tag)) { if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 8, int64); - __PUT(start + 8, freesize, int64); - __PUT(start + 16, -8, int64); + __PUT(start, start + 8, INT64); + __PUT(start + 8, freesize, INT64); + __PUT(start + 16, -8, INT64); i = __ASHR(freesize, 5); freesize = 0; if (i < 9) { - __PUT(start + 24, Heap_freeList[i], int64); + __PUT(start + 24, Heap_freeList[i], INT64); Heap_freeList[i] = start; } else { - __PUT(start + 24, Heap_bigBlocks, int64); + __PUT(start + 24, Heap_bigBlocks, INT64); Heap_bigBlocks = start; } } tag -= 1; - __PUT(adr, tag, int64); - __GET(tag, size, int64); + __PUT(adr, tag, INT64); + __GET(tag, size, INT64); Heap_allocated += size; adr += size; } else { - __GET(tag, size, int64); + __GET(tag, size, INT64); freesize += size; adr += size; } } if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 8, int64); - __PUT(start + 8, freesize, int64); - __PUT(start + 16, -8, int64); + __PUT(start, start + 8, INT64); + __PUT(start + 8, freesize, INT64); + __PUT(start + 16, -8, INT64); i = __ASHR(freesize, 5); freesize = 0; if (i < 9) { - __PUT(start + 24, Heap_freeList[i], int64); + __PUT(start + 24, Heap_freeList[i], INT64); Heap_freeList[i] = start; } else { - __PUT(start + 24, Heap_bigBlocks, int64); + __PUT(start + 24, Heap_bigBlocks, INT64); Heap_bigBlocks = start; } } - __GET(chnk, chnk, int64); + __GET(chnk, chnk, INT64); } } -static void Heap_Sift (int64 l, int64 r, int64 *a, LONGINT a__len) +static void Heap_Sift (INT64 l, INT64 r, INT64 *a, LONGINT a__len) { - int64 i, j, x; + INT64 i, j, x; j = l; x = a[j]; for (;;) { @@ -464,9 +464,9 @@ static void Heap_Sift (int64 l, int64 r, int64 *a, LONGINT a__len) a[i] = x; } -static void Heap_HeapSort (int64 n, int64 *a, LONGINT a__len) +static void Heap_HeapSort (INT64 n, INT64 *a, LONGINT a__len) { - int64 l, r, x; + INT64 l, r, x; l = __ASHR(n, 1); r = n - 1; while (l > 0) { @@ -482,25 +482,25 @@ static void Heap_HeapSort (int64 n, int64 *a, LONGINT a__len) } } -static void Heap_MarkCandidates (int64 n, int64 *cand, LONGINT cand__len) +static void Heap_MarkCandidates (INT64 n, INT64 *cand, LONGINT cand__len) { - int64 chnk, adr, tag, next, lim, lim1, i, ptr, size; + INT64 chnk, adr, tag, next, lim, lim1, i, ptr, size; chnk = Heap_heap; i = 0; lim = cand[n - 1]; while ((chnk != 0 && chnk < lim)) { adr = chnk + 24; - __GET(chnk + 8, lim1, int64); + __GET(chnk + 8, lim1, INT64); if (lim < lim1) { lim1 = lim; } while (adr < lim1) { - __GET(adr, tag, int64); + __GET(adr, tag, INT64); if (__ODD(tag)) { - __GET(tag - 1, size, int64); + __GET(tag - 1, size, INT64); adr += size; } else { - __GET(tag, size, int64); + __GET(tag, size, INT64); ptr = adr + 8; while (cand[i] < ptr) { i += 1; @@ -515,17 +515,17 @@ static void Heap_MarkCandidates (int64 n, int64 *cand, LONGINT cand__len) adr = next; } } - __GET(chnk, chnk, int64); + __GET(chnk, chnk, INT64); } } static void Heap_CheckFin (void) { Heap_FinNode n; - int64 tag; + INT64 tag; n = Heap_fin; while (n != NIL) { - __GET(n->obj - 8, tag, int64); + __GET(n->obj - 8, tag, INT64); if (!__ODD(tag)) { n->marked = 0; Heap_Mark(n->obj); @@ -571,10 +571,10 @@ void Heap_FINALL (void) } } -static void Heap_MarkStack (int64 n, int64 *cand, LONGINT cand__len) +static void Heap_MarkStack (INT64 n, INT64 *cand, LONGINT cand__len) { SYSTEM_PTR frame; - int64 inc, nofcand, sp, p, stack0; + INT64 inc, nofcand, sp, p, stack0; struct Heap__1 align; if (n > 0) { Heap_MarkStack(n - 1, cand, cand__len); @@ -591,9 +591,9 @@ static void Heap_MarkStack (int64 n, int64 *cand, LONGINT cand__len) inc = -inc; } while (sp != stack0) { - __GET(sp, p, int64); + __GET(sp, p, INT64); if ((p > Heap_heap && p < Heap_heapend)) { - if (nofcand == (int64)cand__len) { + if (nofcand == (INT64)cand__len) { Heap_HeapSort(nofcand, (void*)cand, cand__len); Heap_MarkCandidates(nofcand, (void*)cand, cand__len); nofcand = 0; @@ -613,8 +613,8 @@ static void Heap_MarkStack (int64 n, int64 *cand, LONGINT cand__len) void Heap_GC (BOOLEAN markStack) { Heap_Module m; - int64 i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; - int64 cand[10000]; + INT64 i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; + INT64 cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); m = (Heap_Module)(address)Heap_modules; @@ -694,7 +694,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (int64)(address)obj; + f->obj = (INT64)(address)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; @@ -704,8 +704,8 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) void Heap_InitHeap (void) { Heap_heap = Heap_NewChunk(256000); - __GET(Heap_heap + 8, Heap_heapend, int64); - __PUT(Heap_heap, 0, int64); + __GET(Heap_heap + 8, Heap_heapend, INT64); + __PUT(Heap_heap, 0, INT64); Heap_allocated = 0; Heap_firstTry = 1; Heap_freeList[9] = 1; diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index b0c90472..0b6a9d03 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h @@ -22,7 +22,7 @@ typedef typedef struct Heap_ModuleDesc { - int64 _prvt0; + INT64 _prvt0; char _prvt1[56]; } Heap_ModuleDesc; @@ -31,21 +31,21 @@ typedef import SYSTEM_PTR Heap_modules; -import int64 Heap_allocated, Heap_heapsize; -import int16 Heap_FileCount; +import INT64 Heap_allocated, Heap_heapsize; +import INT16 Heap_FileCount; -import address *Heap_ModuleDesc__typ; +import ADDRESS *Heap_ModuleDesc__typ; import void Heap_FINALL (void); import void Heap_GC (BOOLEAN markStack); import void Heap_INCREF (Heap_Module m); import void Heap_InitHeap (void); import void Heap_Lock (void); -import SYSTEM_PTR Heap_NEWBLK (int64 size); -import SYSTEM_PTR Heap_NEWREC (int64 tag); +import SYSTEM_PTR Heap_NEWBLK (INT64 size); +import SYSTEM_PTR Heap_NEWREC (INT64 tag); import void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); import SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -import void Heap_REGTYP (Heap_Module m, int64 typ); +import void Heap_REGTYP (Heap_Module m, INT64 typ); import void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); import void Heap_Unlock (void); import void *Heap__init(void); diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 97e17ad2..39e2d6ca 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "Heap.h" @@ -31,20 +31,20 @@ typedef struct Modules_ModuleDesc { Modules_Module next; Modules_ModuleName name; - int32 refcnt; + INT32 refcnt; Modules_Cmd cmds; - int32 types; - void (*enumPtrs)(void(*)(int32)); - int32 reserved1, reserved2; + INT32 types; + void (*enumPtrs)(void(*)(INT32)); + INT32 reserved1, reserved2; } Modules_ModuleDesc; -export int16 Modules_res; +export INT16 Modules_res; export CHAR Modules_resMsg[256]; export Modules_ModuleName Modules_imported, Modules_importing; -export address *Modules_ModuleDesc__typ; -export address *Modules_CmdDesc__typ; +export ADDRESS *Modules_ModuleDesc__typ; +export ADDRESS *Modules_CmdDesc__typ; static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len); export void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all); @@ -56,7 +56,7 @@ export Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len); static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len) { - int16 i, j; + INT16 i, j; __DUP(b, b__len, CHAR); i = 0; while (a[__X(i, a__len)] != 0x00) { diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index a7b62fe3..c2afbd3c 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h @@ -28,20 +28,20 @@ typedef struct Modules_ModuleDesc { Modules_Module next; Modules_ModuleName name; - int32 refcnt; + INT32 refcnt; Modules_Cmd cmds; - int32 types; - void (*enumPtrs)(void(*)(int32)); + INT32 types; + void (*enumPtrs)(void(*)(INT32)); char _prvt0[8]; } Modules_ModuleDesc; -import int16 Modules_res; +import INT16 Modules_res; import CHAR Modules_resMsg[256]; import Modules_ModuleName Modules_imported, Modules_importing; -import address *Modules_ModuleDesc__typ; -import address *Modules_CmdDesc__typ; +import ADDRESS *Modules_ModuleDesc__typ; +import ADDRESS *Modules_CmdDesc__typ; import void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all); import Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len); diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index dff6adc6..60993ebe 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "OPM.h" @@ -11,13 +11,13 @@ #include "OPT.h" -static int16 OPB_exp; -static int64 OPB_maxExp; +static INT16 OPB_exp; +static INT64 OPB_maxExp; export void OPB_Assign (OPT_Node *x, OPT_Node y); -static void OPB_BindNodes (int8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y); -static int16 OPB_BoolToInt (BOOLEAN b); +static void OPB_BindNodes (INT8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y); +static INT16 OPB_BoolToInt (BOOLEAN b); export void OPB_Call (OPT_Node *x, OPT_Node apar, OPT_Object fp); static void OPB_CharToString (OPT_Node n); static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode); @@ -25,10 +25,10 @@ static void OPB_CheckLeaf (OPT_Node x, BOOLEAN dynArrToo); export void OPB_CheckParameters (OPT_Object fp, OPT_Object ap, BOOLEAN checkNames); static void OPB_CheckProc (OPT_Struct x, OPT_Object y); static void OPB_CheckPtr (OPT_Node x, OPT_Node y); -static void OPB_CheckRealType (int16 f, int16 nr, OPT_Const x); +static void OPB_CheckRealType (INT16 f, INT16 nr, OPT_Const x); static void OPB_CheckReceiver (OPT_Node *x, OPT_Object fp); -static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y); -export void OPB_Construct (int8 class, OPT_Node *x, OPT_Node y); +static void OPB_ConstOp (INT16 op, OPT_Node x, OPT_Node y); +export void OPB_Construct (INT8 class, OPT_Node *x, OPT_Node y); static void OPB_Convert (OPT_Node *x, OPT_Struct typ); export void OPB_DeRef (OPT_Node *x); static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpar); @@ -38,17 +38,17 @@ export void OPB_Field (OPT_Node *x, OPT_Object y); export void OPB_In (OPT_Node *x, OPT_Node y); export void OPB_Index (OPT_Node *x, OPT_Node y); export void OPB_Inittd (OPT_Node *inittd, OPT_Node *last, OPT_Struct typ); -static BOOLEAN OPB_IntToBool (int64 i); +static BOOLEAN OPB_IntToBool (INT64 i); export void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y); -export void OPB_MOp (int8 op, OPT_Node *x); +export void OPB_MOp (INT8 op, OPT_Node *x); export OPT_Node OPB_NewBoolConst (BOOLEAN boolval); -export OPT_Node OPB_NewIntConst (int64 intval); +export OPT_Node OPB_NewIntConst (INT64 intval); export OPT_Node OPB_NewLeaf (OPT_Object obj); export OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ); -export OPT_Node OPB_NewString (OPS_String str, int64 len); +export OPT_Node OPB_NewString (OPS_String str, INT64 len); export OPT_Node OPB_Nil (void); static BOOLEAN OPB_NotVar (OPT_Node x); -export void OPB_Op (int8 op, OPT_Node *x, OPT_Node y); +export void OPB_Op (INT8 op, OPT_Node *x, OPT_Node y); export void OPB_OptIf (OPT_Node *x); export void OPB_Param (OPT_Node ap, OPT_Object fp); export void OPB_PrepCall (OPT_Node *x, OPT_Object *fpar); @@ -57,17 +57,17 @@ export void OPB_SetElem (OPT_Node *x); static void OPB_SetIntType (OPT_Node node); export void OPB_SetRange (OPT_Node *x, OPT_Node y); static void OPB_SetSetType (OPT_Node node); -export void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno); -export void OPB_StPar0 (OPT_Node *par0, int16 fctno); -export void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno); -export void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n); -export void OPB_StaticLink (int8 dlev); +export void OPB_StFct (OPT_Node *par0, INT8 fctno, INT16 parno); +export void OPB_StPar0 (OPT_Node *par0, INT16 fctno); +export void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno); +export void OPB_StParN (OPT_Node *par0, OPT_Node x, INT16 fctno, INT16 n); +export void OPB_StaticLink (INT8 dlev); export void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard); -static void OPB_err (int16 n); -static int64 OPB_log (int64 x); +static void OPB_err (INT16 n); +static INT64 OPB_log (INT64 x); -static void OPB_err (int16 n) +static void OPB_err (INT16 n) { OPM_err(n); } @@ -104,7 +104,7 @@ OPT_Node OPB_NewLeaf (OPT_Object obj) return node; } -void OPB_Construct (int8 class, OPT_Node *x, OPT_Node y) +void OPB_Construct (INT8 class, OPT_Node *x, OPT_Node y) { OPT_Node node = NIL; node = OPT_NewNode(class); @@ -127,7 +127,7 @@ void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y) *last = y; } -static int16 OPB_BoolToInt (BOOLEAN b) +static INT16 OPB_BoolToInt (BOOLEAN b) { if (b) { return 1; @@ -137,7 +137,7 @@ static int16 OPB_BoolToInt (BOOLEAN b) __RETCHK; } -static BOOLEAN OPB_IntToBool (int64 i) +static BOOLEAN OPB_IntToBool (INT64 i) { return i != 0; } @@ -214,8 +214,8 @@ static void OPB_SetIntType (OPT_Node node) static void OPB_SetSetType (OPT_Node node) { - int32 i32; - __GET((address)&node->conval->setval + 4, i32, int32); + INT32 i32; + __GET((address)&node->conval->setval + 4, i32, INT32); if (i32 == 0) { node->typ = OPT_set32typ; } else { @@ -223,7 +223,7 @@ static void OPB_SetSetType (OPT_Node node) } } -OPT_Node OPB_NewIntConst (int64 intval) +OPT_Node OPB_NewIntConst (INT64 intval) { OPT_Node x = NIL; x = OPT_NewNode(7); @@ -244,7 +244,7 @@ OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ) return x; } -OPT_Node OPB_NewString (OPS_String str, int64 len) +OPT_Node OPB_NewString (OPS_String str, INT64 len) { OPT_Node x = NIL; x = OPT_NewNode(7); @@ -274,7 +274,7 @@ static void OPB_CharToString (OPT_Node n) n->obj = NIL; } -static void OPB_BindNodes (int8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y) +static void OPB_BindNodes (INT8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y) { OPT_Node node = NIL; node = OPT_NewNode(class); @@ -314,7 +314,7 @@ void OPB_DeRef (OPT_Node *x) void OPB_Index (OPT_Node *x, OPT_Node y) { - int16 f; + INT16 f; OPT_Struct typ = NIL; f = y->typ->form; if ((*x)->class >= 7) { @@ -325,7 +325,7 @@ void OPB_Index (OPT_Node *x, OPT_Node y) } if ((*x)->typ->comp == 2) { typ = (*x)->typ->BaseTyp; - if ((y->class == 7 && (y->conval->intval < 0 || y->conval->intval >= (int64)(*x)->typ->n))) { + if ((y->class == 7 && (y->conval->intval < 0 || y->conval->intval >= (INT64)(*x)->typ->n))) { OPB_err(81); } } else if ((*x)->typ->comp == 3) { @@ -439,15 +439,15 @@ void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) void OPB_In (OPT_Node *x, OPT_Node y) { - int16 f; - int64 k; + INT16 f; + INT64 k; f = (*x)->typ->form; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); } else if ((f == 4 && y->typ->form == 7)) { if ((*x)->class == 7) { k = (*x)->conval->intval; - if (k < 0 || k >= (int64)__ASHL(y->typ->size, 3)) { + if (k < 0 || k >= (INT64)__ASHL(y->typ->size, 3)) { OPB_err(202); } else if (y->class == 7) { (*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval, 64)); @@ -466,7 +466,7 @@ void OPB_In (OPT_Node *x, OPT_Node y) (*x)->typ = OPT_booltyp; } -static int64 OPB_log (int64 x) +static INT64 OPB_log (INT64 x) { OPB_exp = 0; if (x > 0) { @@ -478,7 +478,7 @@ static int64 OPB_log (int64 x) return x; } -static void OPB_CheckRealType (int16 f, int16 nr, OPT_Const x) +static void OPB_CheckRealType (INT16 f, INT16 nr, OPT_Const x) { LONGREAL min, max, r; if (f == 5) { @@ -502,9 +502,9 @@ static struct MOp__28 { struct MOp__28 *lnk; } *MOp__28_s; -static OPT_Node NewOp__29 (int8 op, OPT_Struct typ, OPT_Node z); +static OPT_Node NewOp__29 (INT8 op, OPT_Struct typ, OPT_Node z); -static OPT_Node NewOp__29 (int8 op, OPT_Struct typ, OPT_Node z) +static OPT_Node NewOp__29 (INT8 op, OPT_Struct typ, OPT_Node z) { OPT_Node node = NIL; node = OPT_NewNode(11); @@ -514,9 +514,9 @@ static OPT_Node NewOp__29 (int8 op, OPT_Struct typ, OPT_Node z) return node; } -void OPB_MOp (int8 op, OPT_Node *x) +void OPB_MOp (INT8 op, OPT_Node *x) { - int16 f; + INT16 f; OPT_Struct typ = NIL; OPT_Node z = NIL; struct MOp__28 _s; @@ -597,7 +597,7 @@ void OPB_MOp (int8 op, OPT_Node *x) case 22: if (f == 3) { if (z->class == 7) { - z->conval->intval = (int16)__CAP((CHAR)z->conval->intval); + z->conval->intval = (INT16)__CAP((CHAR)z->conval->intval); z->obj = NIL; } else { z = NewOp__29(op, typ, z); @@ -657,7 +657,7 @@ void OPB_MOp (int8 op, OPT_Node *x) static void OPB_CheckPtr (OPT_Node x, OPT_Node y) { - int16 g; + INT16 g; OPT_Struct p = NIL, q = NIL, t = NIL; g = y->typ->form; if (g == 11) { @@ -741,16 +741,16 @@ static void OPB_CheckProc (OPT_Struct x, OPT_Object y) static struct ConstOp__13 { OPT_Node *x; - int16 *f; + INT16 *f; OPT_Const *xval, *yval; struct ConstOp__13 *lnk; } *ConstOp__13_s; -static int16 ConstCmp__14 (void); +static INT16 ConstCmp__14 (void); -static int16 ConstCmp__14 (void) +static INT16 ConstCmp__14 (void) { - int16 res; + INT16 res; switch (*ConstOp__13_s->f) { case 0: res = 9; @@ -813,11 +813,11 @@ static int16 ConstCmp__14 (void) return res; } -static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) +static void OPB_ConstOp (INT16 op, OPT_Node x, OPT_Node y) { - int16 f, g; + INT16 f, g; OPT_Const xval = NIL, yval = NIL; - int64 xv, yv; + INT64 xv, yv; BOOLEAN temp; struct ConstOp__13 _s; _s.x = &x; @@ -1097,8 +1097,8 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) static void OPB_Convert (OPT_Node *x, OPT_Struct typ) { OPT_Node node = NIL; - int16 f, g; - int64 k; + INT16 f, g; + INT64 k; LONGREAL r; f = (*x)->typ->form; g = typ->form; @@ -1136,12 +1136,12 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) OPB_err(203); r = (LONGREAL)1; } - (*x)->conval->intval = (int32)__ENTIER(r); + (*x)->conval->intval = (INT32)__ENTIER(r); OPB_SetIntType(*x); } } (*x)->obj = NIL; - } else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((int16)(*x)->left->typ->form < f || f > g))) { + } else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((INT16)(*x)->left->typ->form < f || f > g))) { if ((*x)->left->typ == typ) { *x = (*x)->left; } @@ -1155,14 +1155,14 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) } static struct Op__38 { - int16 *f, *g; + INT16 *f, *g; struct Op__38 *lnk; } *Op__38_s; -static void NewOp__39 (int8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y); +static void NewOp__39 (INT8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y); static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y); -static void NewOp__39 (int8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y) +static void NewOp__39 (INT8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y) { OPT_Node node = NIL; node = OPT_NewNode(12); @@ -1203,13 +1203,13 @@ static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) return ok; } -void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) +void OPB_Op (INT8 op, OPT_Node *x, OPT_Node y) { - int16 f, g; + INT16 f, g; OPT_Node t = NIL, z = NIL; OPT_Struct typ = NIL; BOOLEAN do_; - int64 val; + INT64 val; struct Op__38 _s; _s.f = &f; _s.g = &g; @@ -1489,7 +1489,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) void OPB_SetRange (OPT_Node *x, OPT_Node y) { - int64 k, l; + INT64 k, l; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); } else if (((*x)->typ->form == 4 && y->typ->form == 4)) { @@ -1525,7 +1525,7 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y) void OPB_SetElem (OPT_Node *x) { - int64 k; + INT64 k; if ((*x)->class == 8 || (*x)->class == 9) { OPB_err(126); } else if ((*x)->typ->form != 4) { @@ -1549,7 +1549,7 @@ void OPB_SetElem (OPT_Node *x) static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) { OPT_Struct y = NIL; - int16 f, g; + INT16 f, g; OPT_Struct p = NIL, q = NIL; y = ynode->typ; f = x->form; @@ -1673,9 +1673,9 @@ static void OPB_CheckLeaf (OPT_Node x, BOOLEAN dynArrToo) { } -void OPB_StPar0 (OPT_Node *par0, int16 fctno) +void OPB_StPar0 (OPT_Node *par0, INT16 fctno) { - int16 f; + INT16 f; OPT_Struct typ = NIL; OPT_Node x = NIL; x = *par0; @@ -1983,9 +1983,9 @@ static struct StPar1__53 { struct StPar1__53 *lnk; } *StPar1__53_s; -static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right); +static OPT_Node NewOp__54 (INT8 class, INT8 subcl, OPT_Node left, OPT_Node right); -static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right) +static OPT_Node NewOp__54 (INT8 class, INT8 subcl, OPT_Node left, OPT_Node right) { OPT_Node node = NIL; node = OPT_NewNode(class); @@ -1995,9 +1995,9 @@ static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right return node; } -void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) +void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno) { - int16 f, L; + INT16 f, L; OPT_Struct typ = NIL; OPT_Node p = NIL, t = NIL; struct StPar1__53 _s; @@ -2026,7 +2026,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (f == 4) { - if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval >= (int64)__ASHL(p->typ->size, 3)))) { + if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval >= (INT64)__ASHL(p->typ->size, 3)))) { OPB_err(202); } p = NewOp__54(19, fctno, p, x); @@ -2091,8 +2091,8 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) OPB_err(208); p->conval->intval = 1; } else if (x->conval->intval >= 0) { - if (__ABS(p->conval->intval) <= __DIV(9223372036854775807, (int64)__ASH(1, x->conval->intval))) { - p->conval->intval = p->conval->intval * (int64)__ASH(1, x->conval->intval); + if (__ABS(p->conval->intval) <= __DIV(9223372036854775807, (INT64)__ASH(1, x->conval->intval))) { + p->conval->intval = p->conval->intval * (INT64)__ASH(1, x->conval->intval); } else { OPB_err(208); p->conval->intval = 1; @@ -2239,10 +2239,10 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) StPar1__53_s = _s.lnk; } -void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n) +void OPB_StParN (OPT_Node *par0, OPT_Node x, INT16 fctno, INT16 n) { OPT_Node node = NIL; - int16 f; + INT16 f; OPT_Node p = NIL; p = *par0; f = x->typ->form; @@ -2284,9 +2284,9 @@ void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n) *par0 = p; } -void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno) +void OPB_StFct (OPT_Node *par0, INT8 fctno, INT16 parno) { - int16 dim; + INT16 dim; OPT_Node x = NIL, p = NIL; p = *par0; if (fctno <= 19) { @@ -2350,7 +2350,7 @@ void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno) static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpar) { - int16 f; + INT16 f; f = atyp->comp; ftyp = ftyp->BaseTyp; atyp = atyp->BaseTyp; @@ -2459,7 +2459,7 @@ void OPB_Param (OPT_Node ap, OPT_Object fp) } } -void OPB_StaticLink (int8 dlev) +void OPB_StaticLink (INT8 dlev) { OPT_Object scope = NIL; scope = OPT_topScope; @@ -2474,7 +2474,7 @@ void OPB_Call (OPT_Node *x, OPT_Node apar, OPT_Object fp) { OPT_Struct typ = NIL; OPT_Node p = NIL; - int8 lev; + INT8 lev; if ((*x)->class == 9) { typ = (*x)->typ; lev = (*x)->obj->mnolev; @@ -2534,7 +2534,7 @@ void OPB_Return (OPT_Node *x, OPT_Object proc) void OPB_Assign (OPT_Node *x, OPT_Node y) { OPT_Node z = NIL; - int8 subcl; + INT8 subcl; if ((*x)->class >= 7) { OPB_err(56); } diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index 22742961..bc644f4c 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h @@ -13,7 +13,7 @@ import void OPB_Assign (OPT_Node *x, OPT_Node y); import void OPB_Call (OPT_Node *x, OPT_Node apar, OPT_Object fp); import void OPB_CheckParameters (OPT_Object fp, OPT_Object ap, BOOLEAN checkNames); -import void OPB_Construct (int8 class, OPT_Node *x, OPT_Node y); +import void OPB_Construct (INT8 class, OPT_Node *x, OPT_Node y); import void OPB_DeRef (OPT_Node *x); import OPT_Node OPB_EmptySet (void); import void OPB_Enter (OPT_Node *procdec, OPT_Node stat, OPT_Object proc); @@ -22,25 +22,25 @@ import void OPB_In (OPT_Node *x, OPT_Node y); import void OPB_Index (OPT_Node *x, OPT_Node y); import void OPB_Inittd (OPT_Node *inittd, OPT_Node *last, OPT_Struct typ); import void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y); -import void OPB_MOp (int8 op, OPT_Node *x); +import void OPB_MOp (INT8 op, OPT_Node *x); import OPT_Node OPB_NewBoolConst (BOOLEAN boolval); -import OPT_Node OPB_NewIntConst (int64 intval); +import OPT_Node OPB_NewIntConst (INT64 intval); import OPT_Node OPB_NewLeaf (OPT_Object obj); import OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ); -import OPT_Node OPB_NewString (OPS_String str, int64 len); +import OPT_Node OPB_NewString (OPS_String str, INT64 len); import OPT_Node OPB_Nil (void); -import void OPB_Op (int8 op, OPT_Node *x, OPT_Node y); +import void OPB_Op (INT8 op, OPT_Node *x, OPT_Node y); import void OPB_OptIf (OPT_Node *x); import void OPB_Param (OPT_Node ap, OPT_Object fp); import void OPB_PrepCall (OPT_Node *x, OPT_Object *fpar); import void OPB_Return (OPT_Node *x, OPT_Object proc); import void OPB_SetElem (OPT_Node *x); import void OPB_SetRange (OPT_Node *x, OPT_Node y); -import void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno); -import void OPB_StPar0 (OPT_Node *par0, int16 fctno); -import void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno); -import void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n); -import void OPB_StaticLink (int8 dlev); +import void OPB_StFct (OPT_Node *par0, INT8 fctno, INT16 parno); +import void OPB_StPar0 (OPT_Node *par0, INT16 fctno); +import void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno); +import void OPB_StParN (OPT_Node *par0, OPT_Node x, INT16 fctno, INT16 n); +import void OPB_StaticLink (INT8 dlev); import void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard); import void *OPB__init(void); diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index 27ab3d15..0ed7bf75 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "Configuration.h" @@ -11,9 +11,9 @@ #include "OPT.h" -static int16 OPC_indentLevel; -static int8 OPC_hashtab[105]; -static CHAR OPC_keytab[50][9]; +static INT16 OPC_indentLevel; +static INT8 OPC_hashtab[105]; +static CHAR OPC_keytab[60][9]; static BOOLEAN OPC_GlbPtrs; static CHAR OPC_BodyNameExt[13]; @@ -23,12 +23,12 @@ static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames); export OPT_Object OPC_BaseTProc (OPT_Object obj); export void OPC_BegBlk (void); export void OPC_BegStat (void); -static void OPC_CProcDefs (OPT_Object obj, int16 vis); -export void OPC_Case (int64 caseVal, int16 form); -static void OPC_CharacterLiteral (int64 c); -export void OPC_Cmp (int16 rel); +static void OPC_CProcDefs (OPT_Object obj, INT16 vis); +export void OPC_Case (INT64 caseVal, INT16 form); +static void OPC_CharacterLiteral (INT64 c); +export void OPC_Cmp (INT16 rel); export void OPC_CompleteIdent (OPT_Object obj); -export void OPC_Constant (OPT_Const con, int16 form); +export void OPC_Constant (OPT_Const con, INT16 form); static void OPC_DeclareBase (OPT_Object dcl); static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef); static void OPC_DeclareParams (OPT_Object par, BOOLEAN macro); @@ -45,45 +45,45 @@ export void OPC_EnterBody (void); export void OPC_EnterProc (OPT_Object proc); export void OPC_ExitBody (void); export void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet); -static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, int32 *off, int32 *n, int32 *curAlign); -static void OPC_FillGap (int32 gap, int32 off, int32 align, int32 *n, int32 *curAlign); +static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, INT32 *off, INT32 *n, INT32 *curAlign); +static void OPC_FillGap (INT32 gap, INT32 off, INT32 align, INT32 *n, INT32 *curAlign); export void OPC_GenBdy (OPT_Node n); -static void OPC_GenDynTypes (OPT_Node n, int16 vis); +static void OPC_GenDynTypes (OPT_Node n, INT16 vis); export void OPC_GenEnumPtrs (OPT_Object var); export void OPC_GenHdr (OPT_Node n); export void OPC_GenHdrIncludes (void); static void OPC_GenHeaderMsg (void); -export void OPC_Halt (int32 n); +export void OPC_Halt (INT32 n); export void OPC_Ident (OPT_Object obj); -static void OPC_IdentList (OPT_Object obj, int16 vis); +static void OPC_IdentList (OPT_Object obj, INT16 vis); static void OPC_Include (CHAR *name, LONGINT name__len); -static void OPC_IncludeImports (OPT_Object obj, int16 vis); +static void OPC_IncludeImports (OPT_Object obj, INT16 vis); export void OPC_Increment (BOOLEAN decrement); -export void OPC_Indent (int16 count); +export void OPC_Indent (INT16 count); export void OPC_Init (void); static void OPC_InitImports (OPT_Object obj); static void OPC_InitKeywords (void); export void OPC_InitTDesc (OPT_Struct typ); static void OPC_InitTProcs (OPT_Object typ, OPT_Object obj); -export void OPC_IntLiteral (int64 n, int32 size); -export void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim); +export void OPC_IntLiteral (INT64 n, INT32 size); +export void OPC_Len (OPT_Object obj, OPT_Struct array, INT64 dim); static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName); -static int16 OPC_Length (CHAR *s, LONGINT s__len); +static INT16 OPC_Length (CHAR *s, LONGINT s__len); export BOOLEAN OPC_NeedsRetval (OPT_Object proc); -export int32 OPC_NofPtrs (OPT_Struct typ); -static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len); +export INT32 OPC_NofPtrs (OPT_Struct typ); +static INT16 OPC_PerfectHash (CHAR *s, LONGINT s__len); static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len); static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define); -static void OPC_ProcPredefs (OPT_Object obj, int8 vis); +static void OPC_ProcPredefs (OPT_Object obj, INT8 vis); static void OPC_PutBase (OPT_Struct typ); -static void OPC_PutPtrOffsets (OPT_Struct typ, int32 adr, int32 *cnt); +static void OPC_PutPtrOffsets (OPT_Struct typ, INT32 adr, INT32 *cnt); static void OPC_RegCmds (OPT_Object obj); export void OPC_SetInclude (BOOLEAN exclude); static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause); -static void OPC_Str1 (CHAR *s, LONGINT s__len, int32 x); -static void OPC_StringLiteral (CHAR *s, LONGINT s__len, int32 l); +static void OPC_Str1 (CHAR *s, LONGINT s__len, INT32 x); +static void OPC_StringLiteral (CHAR *s, LONGINT s__len, INT32 l); export void OPC_TDescDecl (OPT_Struct typ); -export void OPC_TypeDefs (OPT_Object obj, int16 vis); +export void OPC_TypeDefs (OPT_Object obj, INT16 vis); export void OPC_TypeOf (OPT_Object ap); static BOOLEAN OPC_Undefined (OPT_Object obj); @@ -94,14 +94,14 @@ void OPC_Init (void) __MOVE("__init(void)", OPC_BodyNameExt, 13); } -void OPC_Indent (int16 count) +void OPC_Indent (INT16 count) { OPC_indentLevel += count; } void OPC_BegStat (void) { - int16 i; + INT16 i; i = OPC_indentLevel; while (i > 0) { OPM_Write(0x09); @@ -137,10 +137,10 @@ void OPC_EndBlk0 (void) OPM_Write('}'); } -static void OPC_Str1 (CHAR *s, LONGINT s__len, int32 x) +static void OPC_Str1 (CHAR *s, LONGINT s__len, INT32 x) { CHAR ch; - int16 i; + INT16 i; __DUP(s, s__len, CHAR); ch = s[0]; i = 0; @@ -156,9 +156,9 @@ static void OPC_Str1 (CHAR *s, LONGINT s__len, int32 x) __DEL(s); } -static int16 OPC_Length (CHAR *s, LONGINT s__len) +static INT16 OPC_Length (CHAR *s, LONGINT s__len) { - int16 i; + INT16 i; i = 0; while (s[__X(i, s__len)] != 0x00) { i += 1; @@ -166,13 +166,13 @@ static int16 OPC_Length (CHAR *s, LONGINT s__len) return i; } -static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len) +static INT16 OPC_PerfectHash (CHAR *s, LONGINT s__len) { - int16 i, h; + INT16 i, h; i = 0; h = 0; while ((s[__X(i, s__len)] != 0x00 && i < 5)) { - h = 3 * h + (int16)s[__X(i, s__len)]; + h = 3 * h + (INT16)s[__X(i, s__len)]; i += 1; } return (int)__MOD(h, 105); @@ -180,25 +180,25 @@ static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len) void OPC_Ident (OPT_Object obj) { - int16 mode, level, h; + INT16 mode, level, h; mode = obj->mode; level = obj->mnolev; if ((__IN(mode, 0x62, 32) && level > 0) || __IN(mode, 0x14, 32)) { OPM_WriteStringVar((void*)obj->name, 256); h = OPC_PerfectHash((void*)obj->name, 256); if (OPC_hashtab[__X(h, 105)] >= 0) { - if (__STRCMP(OPC_keytab[__X(OPC_hashtab[__X(h, 105)], 50)], obj->name) == 0) { + if (__STRCMP(OPC_keytab[__X(OPC_hashtab[__X(h, 105)], 60)], obj->name) == 0) { OPM_Write('_'); } } } else if ((mode == 5 && __IN(obj->typ->form, 0x90, 32))) { if (obj->typ == OPT_adrtyp) { - OPM_WriteString((CHAR*)"address", 8); + OPM_WriteString((CHAR*)"ADDRESS", 8); } else { if (obj->typ->form == 4) { - OPM_WriteString((CHAR*)"int", 4); + OPM_WriteString((CHAR*)"INT", 4); } else { - OPM_WriteString((CHAR*)"uint", 5); + OPM_WriteString((CHAR*)"UINT", 5); } OPM_WriteInt(__ASHL(obj->typ->size, 3)); } @@ -224,7 +224,7 @@ void OPC_Ident (OPT_Object obj) static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause) { - int16 pointers; + INT16 pointers; *openClause = 0; if (((typ->strobj == NIL || typ->strobj->name[0] == 0x00) && typ->comp != 4)) { if (__IN(typ->comp, 0x0c, 32)) { @@ -260,7 +260,7 @@ static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef) { OPT_Struct typ = NIL; BOOLEAN varPar, openClause; - int16 form, comp; + INT16 form, comp; typ = dcl->typ; varPar = ((dcl->mode == 2 && typ->comp != 2) || typ->comp == 3) || scopeDef; OPC_Stars(typ, &openClause); @@ -324,8 +324,8 @@ static void OPC_DeclareBase (OPT_Object dcl) { OPT_Struct typ = NIL, prev = NIL; OPT_Object obj = NIL; - int16 nofdims; - int32 off, n, dummy; + INT16 nofdims; + INT32 off, n, dummy; typ = dcl->typ; prev = typ; while ((((((((typ->strobj == NIL || typ->comp == 3) || OPC_Undefined(typ->strobj)) && typ->comp != 4)) && typ->form != 10)) && !((typ->form == 11 && typ->BaseTyp->comp == 3)))) { @@ -384,11 +384,11 @@ static void OPC_DeclareBase (OPT_Object dcl) } } -int32 OPC_NofPtrs (OPT_Struct typ) +INT32 OPC_NofPtrs (OPT_Struct typ) { OPT_Object fld = NIL; OPT_Struct btyp = NIL; - int32 n; + INT32 n; if ((typ->form == 11 && typ->sysflag == 0)) { return 1; } else if ((typ->comp == 4 && __MASK(typ->sysflag, -256) == 0)) { @@ -422,11 +422,11 @@ int32 OPC_NofPtrs (OPT_Struct typ) __RETCHK; } -static void OPC_PutPtrOffsets (OPT_Struct typ, int32 adr, int32 *cnt) +static void OPC_PutPtrOffsets (OPT_Struct typ, INT32 adr, INT32 *cnt) { OPT_Object fld = NIL; OPT_Struct btyp = NIL; - int32 n, i; + INT32 n, i; if ((typ->form == 11 && typ->sysflag == 0)) { OPM_WriteInt(adr); OPM_WriteString((CHAR*)", ", 3); @@ -502,7 +502,7 @@ static void OPC_PutBase (OPT_Struct typ) static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName) { OPT_Struct typ = NIL; - int16 dim; + INT16 dim; if (showParamName) { OPC_Ident(par); OPM_WriteString((CHAR*)"__len", 6); @@ -599,7 +599,7 @@ static void OPC_DeclareTProcs (OPT_Object obj, BOOLEAN *empty) OPT_Object OPC_BaseTProc (OPT_Object obj) { OPT_Struct typ = NIL, base = NIL; - int32 mno; + INT32 mno; typ = obj->link->typ; if (typ->form == 11) { typ = typ->BaseTyp; @@ -722,7 +722,7 @@ static void OPC_DefineType (OPT_Struct str) static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len) { - int16 i; + INT16 i; __DUP(y, y__len, CHAR); i = 0; while ((*x)[__X(i + 1, 256)] == y[__X(i, y__len)]) { @@ -732,14 +732,14 @@ static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len) return y[__X(i, y__len)] == 0x00; } -static void OPC_CProcDefs (OPT_Object obj, int16 vis) +static void OPC_CProcDefs (OPT_Object obj, INT16 vis) { - int16 i; + INT16 i; OPT_ConstExt ext = NIL; - int16 _for__7; + INT16 _for__7; if (obj != NIL) { OPC_CProcDefs(obj->left, vis); - if ((((obj->mode == 9 && (int16)obj->vis >= vis)) && obj->adr == 1)) { + if ((((obj->mode == 9 && (INT16)obj->vis >= vis)) && obj->adr == 1)) { ext = obj->conval->ext; i = 1; if (((*ext)[1] != '#' && !(OPC_Prefixed(ext, (CHAR*)"extern ", 8) || OPC_Prefixed(ext, (CHAR*)"import ", 8)))) { @@ -748,7 +748,7 @@ static void OPC_CProcDefs (OPT_Object obj, int16 vis) OPC_DeclareParams(obj->link, 1); OPM_Write(0x09); } - _for__7 = (int16)(*obj->conval->ext)[0]; + _for__7 = (INT16)(*obj->conval->ext)[0]; i = i; while (i <= _for__7) { OPM_Write((*obj->conval->ext)[__X(i, 256)]); @@ -760,7 +760,7 @@ static void OPC_CProcDefs (OPT_Object obj, int16 vis) } } -void OPC_TypeDefs (OPT_Object obj, int16 vis) +void OPC_TypeDefs (OPT_Object obj, INT16 vis) { if (obj != NIL) { OPC_TypeDefs(obj->left, vis); @@ -792,7 +792,7 @@ static void OPC_DefAnonRecs (OPT_Node n) void OPC_TDescDecl (OPT_Struct typ) { - int32 nofptrs; + INT32 nofptrs; OPT_Object o = NIL; OPC_BegStat(); OPM_WriteString((CHAR*)"__TDESC(", 9); @@ -829,9 +829,9 @@ void OPC_InitTDesc (OPT_Struct typ) } } -static void OPC_FillGap (int32 gap, int32 off, int32 align, int32 *n, int32 *curAlign) +static void OPC_FillGap (INT32 gap, INT32 off, INT32 align, INT32 *n, INT32 *curAlign) { - int32 adr; + INT32 adr; adr = off; OPT_Align(&adr, align); if ((*curAlign < align && gap - (adr - off) >= align)) { @@ -839,13 +839,13 @@ static void OPC_FillGap (int32 gap, int32 off, int32 align, int32 *n, int32 *cur OPC_BegStat(); switch (align) { case 2: - OPM_WriteString((CHAR*)"int16", 6); + OPM_WriteString((CHAR*)"INT16", 6); break; case 4: - OPM_WriteString((CHAR*)"int32", 6); + OPM_WriteString((CHAR*)"INT32", 6); break; case 8: - OPM_WriteString((CHAR*)"int64", 6); + OPM_WriteString((CHAR*)"INT64", 6); break; default: OPM_LogWLn(); @@ -866,11 +866,11 @@ static void OPC_FillGap (int32 gap, int32 off, int32 align, int32 *n, int32 *cur } } -static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, int32 *off, int32 *n, int32 *curAlign) +static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, INT32 *off, INT32 *n, INT32 *curAlign) { OPT_Object fld = NIL; OPT_Struct base = NIL; - int32 gap, adr, align, fldAlign; + INT32 gap, adr, align, fldAlign; fld = typ->link; align = __MASK(typ->align, -65536); if (typ->BaseTyp != NIL) { @@ -926,16 +926,16 @@ static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, int32 *off, int32 *n, i } } -static void OPC_IdentList (OPT_Object obj, int16 vis) +static void OPC_IdentList (OPT_Object obj, INT16 vis) { OPT_Struct base = NIL; BOOLEAN first; - int16 lastvis; + INT16 lastvis; base = NIL; first = 1; while ((obj != NIL && obj->mode != 13)) { if ((__IN(vis, 0x05, 32) || (vis == 1 && obj->vis != 0)) || (vis == 3 && !obj->leaf)) { - if (obj->typ != base || (int16)obj->vis != lastvis) { + if (obj->typ != base || (INT16)obj->vis != lastvis) { if (!first) { OPC_EndStat(); } @@ -974,7 +974,7 @@ static void OPC_IdentList (OPT_Object obj, int16 vis) } else if ((obj->mode == 2 && obj->typ->comp == 4)) { OPC_EndStat(); OPC_BegStat(); - OPM_WriteString((CHAR*)"address *", 10); + OPM_WriteString((CHAR*)"ADDRESS *", 10); OPC_Ident(obj); OPM_WriteString((CHAR*)"__typ", 6); base = NIL; @@ -1011,7 +1011,7 @@ static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames) OPM_WriteString((CHAR*)", LONGINT ", 11); OPC_LenList(obj, 1, showParamNames); } else if ((obj->mode == 2 && obj->typ->comp == 4)) { - OPM_WriteString((CHAR*)", address *", 12); + OPM_WriteString((CHAR*)", ADDRESS *", 12); if (showParamNames) { OPC_Ident(obj); OPM_WriteString((CHAR*)"__typ", 6); @@ -1044,7 +1044,7 @@ static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define) OPM_WriteLn(); } -static void OPC_ProcPredefs (OPT_Object obj, int8 vis) +static void OPC_ProcPredefs (OPT_Object obj, INT8 vis) { if (obj != NIL) { OPC_ProcPredefs(obj->left, vis); @@ -1074,18 +1074,18 @@ static void OPC_Include (CHAR *name, LONGINT name__len) __DEL(name); } -static void OPC_IncludeImports (OPT_Object obj, int16 vis) +static void OPC_IncludeImports (OPT_Object obj, INT16 vis) { if (obj != NIL) { OPC_IncludeImports(obj->left, vis); - if ((((obj->mode == 11 && obj->mnolev != 0)) && (int16)OPT_GlbMod[__X(-obj->mnolev, 64)]->vis >= vis)) { + if ((((obj->mode == 11 && obj->mnolev != 0)) && (INT16)OPT_GlbMod[__X(-obj->mnolev, 64)]->vis >= vis)) { OPC_Include(OPT_GlbMod[__X(-obj->mnolev, 64)]->name, 256); } OPC_IncludeImports(obj->right, vis); } } -static void OPC_GenDynTypes (OPT_Node n, int16 vis) +static void OPC_GenDynTypes (OPT_Node n, INT16 vis) { OPT_Struct typ = NIL; while ((n != NIL && n->class == 14)) { @@ -1099,7 +1099,7 @@ static void OPC_GenDynTypes (OPT_Node n, int16 vis) } else { OPM_WriteString((CHAR*)"export ", 8); } - OPM_WriteString((CHAR*)"address *", 10); + OPM_WriteString((CHAR*)"ADDRESS *", 10); OPC_Andent(typ); OPM_WriteString((CHAR*)"__typ", 6); OPC_EndStat(); @@ -1134,7 +1134,7 @@ void OPC_GenHdr (OPT_Node n) static void OPC_GenHeaderMsg (void) { - int16 i; + INT16 i; OPM_WriteString((CHAR*)"/* ", 4); OPM_WriteString((CHAR*)"voc", 4); OPM_Write(' '); @@ -1222,16 +1222,16 @@ void OPC_GenBdy (OPT_Node n) OPM_currFile = 1; OPC_GenHeaderMsg(); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#define SHORTINT int", 21); + OPM_WriteString((CHAR*)"#define SHORTINT INT", 21); OPM_WriteInt(__ASHL(OPT_sinttyp->size, 3)); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#define INTEGER int", 21); + OPM_WriteString((CHAR*)"#define INTEGER INT", 21); OPM_WriteInt(__ASHL(OPT_inttyp->size, 3)); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#define LONGINT int", 21); + OPM_WriteString((CHAR*)"#define LONGINT INT", 21); OPM_WriteInt(__ASHL(OPT_linttyp->size, 3)); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#define SET uint", 22); + OPM_WriteString((CHAR*)"#define SET UINT", 22); OPM_WriteInt(__ASHL(OPT_settyp->size, 3)); OPM_WriteLn(); OPM_WriteLn(); @@ -1288,7 +1288,7 @@ static void OPC_InitImports (OPT_Object obj) void OPC_GenEnumPtrs (OPT_Object var) { OPT_Struct typ = NIL; - int32 n; + INT32 n; OPC_GlbPtrs = 0; while (var != NIL) { typ = var->typ; @@ -1438,7 +1438,7 @@ void OPC_EnterProc (OPT_Object proc) { OPT_Object var = NIL, scope = NIL; OPT_Struct typ = NIL; - int16 dim; + INT16 dim; if (proc->vis != 1) { OPM_WriteString((CHAR*)"static ", 8); } @@ -1652,7 +1652,7 @@ void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet) void OPC_CompleteIdent (OPT_Object obj) { - int16 comp, level; + INT16 comp, level; level = obj->mnolev; if (obj->adr == 1) { if (obj->typ->comp == 4) { @@ -1681,10 +1681,10 @@ void OPC_CompleteIdent (OPT_Object obj) void OPC_TypeOf (OPT_Object ap) { - int16 i; + INT16 i; __ASSERT(ap->typ->comp == 4, 0); if (ap->mode == 2) { - if ((int16)ap->mnolev != OPM_level) { + if ((INT16)ap->mnolev != OPM_level) { OPM_WriteStringVar((void*)ap->scope->name, 256); OPM_WriteString((CHAR*)"_s->", 5); OPC_Ident(ap); @@ -1700,7 +1700,7 @@ void OPC_TypeOf (OPT_Object ap) } } -void OPC_Cmp (int16 rel) +void OPC_Cmp (INT16 rel) { switch (rel) { case 9: @@ -1729,7 +1729,7 @@ void OPC_Cmp (int16 rel) } } -static void OPC_CharacterLiteral (int64 c) +static void OPC_CharacterLiteral (INT64 c) { if (c < 32 || c > 126) { OPM_WriteString((CHAR*)"0x", 3); @@ -1744,15 +1744,15 @@ static void OPC_CharacterLiteral (int64 c) } } -static void OPC_StringLiteral (CHAR *s, LONGINT s__len, int32 l) +static void OPC_StringLiteral (CHAR *s, LONGINT s__len, INT32 l) { - int32 i; - int16 c; + INT32 i; + INT16 c; __DUP(s, s__len, CHAR); OPM_Write('"'); i = 0; while (i < l) { - c = (int16)s[__X(i, s__len)]; + c = (INT16)s[__X(i, s__len)]; if (c < 32 || c > 126) { OPM_Write('\\'); OPM_Write((CHAR)(48 + __ASHR(c, 6))); @@ -1772,7 +1772,7 @@ static void OPC_StringLiteral (CHAR *s, LONGINT s__len, int32 l) __DEL(s); } -void OPC_Case (int64 caseVal, int16 form) +void OPC_Case (INT64 caseVal, INT16 form) { CHAR ch; OPM_WriteString((CHAR*)"case ", 6); @@ -1810,15 +1810,15 @@ void OPC_Increment (BOOLEAN decrement) } } -void OPC_Halt (int32 n) +void OPC_Halt (INT32 n) { OPC_Str1((CHAR*)"__HALT(#)", 10, n); } -void OPC_IntLiteral (int64 n, int32 size) +void OPC_IntLiteral (INT64 n, INT32 size) { if ((((size > 4 && n <= 2147483647)) && n > (-2147483647-1))) { - OPM_WriteString((CHAR*)"((int", 6); + OPM_WriteString((CHAR*)"((INT", 6); OPM_WriteInt(__ASHL(size, 3)); OPM_WriteString((CHAR*)")(", 3); OPM_WriteInt(n); @@ -1828,7 +1828,7 @@ void OPC_IntLiteral (int64 n, int32 size) } } -void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim) +void OPC_Len (OPT_Object obj, OPT_Struct array, INT64 dim) { if (array->comp == 3) { OPC_CompleteIdent(obj); @@ -1845,11 +1845,11 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim) } } -void OPC_Constant (OPT_Const con, int16 form) +void OPC_Constant (OPT_Const con, INT16 form) { - int16 i; - uint64 s; - int64 hex; + INT16 i; + UINT64 s; + INT64 hex; BOOLEAN skipLeading; switch (form) { case 1: @@ -1908,7 +1908,7 @@ void OPC_Constant (OPT_Const con, int16 form) } static struct InitKeywords__46 { - int8 *n; + INT8 *n; struct InitKeywords__46 *lnk; } *InitKeywords__46_s; @@ -1916,18 +1916,18 @@ static void Enter__47 (CHAR *s, LONGINT s__len); static void Enter__47 (CHAR *s, LONGINT s__len) { - int16 h; + INT16 h; __DUP(s, s__len, CHAR); h = OPC_PerfectHash((void*)s, s__len); OPC_hashtab[__X(h, 105)] = *InitKeywords__46_s->n; - __COPY(s, OPC_keytab[__X(*InitKeywords__46_s->n, 50)], 9); + __COPY(s, OPC_keytab[__X(*InitKeywords__46_s->n, 60)], 9); *InitKeywords__46_s->n += 1; __DEL(s); } static void OPC_InitKeywords (void) { - int8 n, i; + INT8 n, i; struct InitKeywords__46 _s; _s.n = &n; _s.lnk = InitKeywords__46_s; @@ -1938,7 +1938,24 @@ static void OPC_InitKeywords (void) OPC_hashtab[__X(i, 105)] = -1; i += 1; } + Enter__47((CHAR*)"ADDRESS", 8); + Enter__47((CHAR*)"INT16", 6); + Enter__47((CHAR*)"INT32", 6); + Enter__47((CHAR*)"INT64", 6); + Enter__47((CHAR*)"INT8", 5); + Enter__47((CHAR*)"UINT16", 7); + Enter__47((CHAR*)"UINT32", 7); + Enter__47((CHAR*)"UINT64", 7); + Enter__47((CHAR*)"UINT8", 6); Enter__47((CHAR*)"address", 8); + Enter__47((CHAR*)"int16", 6); + Enter__47((CHAR*)"int32", 6); + Enter__47((CHAR*)"int64", 6); + Enter__47((CHAR*)"int8", 5); + Enter__47((CHAR*)"uint16", 7); + Enter__47((CHAR*)"uint32", 7); + Enter__47((CHAR*)"uint64", 7); + Enter__47((CHAR*)"uint8", 6); Enter__47((CHAR*)"asm", 4); Enter__47((CHAR*)"auto", 5); Enter__47((CHAR*)"break", 6); @@ -1960,10 +1977,6 @@ static void OPC_InitKeywords (void) Enter__47((CHAR*)"if", 3); Enter__47((CHAR*)"import", 7); Enter__47((CHAR*)"int", 4); - Enter__47((CHAR*)"int16", 6); - Enter__47((CHAR*)"int32", 6); - Enter__47((CHAR*)"int64", 6); - Enter__47((CHAR*)"int8", 5); Enter__47((CHAR*)"long", 5); Enter__47((CHAR*)"register", 9); Enter__47((CHAR*)"return", 7); @@ -1975,10 +1988,6 @@ static void OPC_InitKeywords (void) Enter__47((CHAR*)"struct", 7); Enter__47((CHAR*)"switch", 7); Enter__47((CHAR*)"typedef", 8); - Enter__47((CHAR*)"uint16", 7); - Enter__47((CHAR*)"uint32", 7); - Enter__47((CHAR*)"uint64", 7); - Enter__47((CHAR*)"uint8", 6); Enter__47((CHAR*)"union", 6); Enter__47((CHAR*)"unsigned", 9); Enter__47((CHAR*)"void", 5); diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index bbfd1911..f7fc51f9 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h @@ -13,10 +13,10 @@ import void OPC_Andent (OPT_Struct typ); import OPT_Object OPC_BaseTProc (OPT_Object obj); import void OPC_BegBlk (void); import void OPC_BegStat (void); -import void OPC_Case (int64 caseVal, int16 form); -import void OPC_Cmp (int16 rel); +import void OPC_Case (INT64 caseVal, INT16 form); +import void OPC_Cmp (INT16 rel); import void OPC_CompleteIdent (OPT_Object obj); -import void OPC_Constant (OPT_Const con, int16 form); +import void OPC_Constant (OPT_Const con, INT16 form); import void OPC_DefineInter (OPT_Object proc); import void OPC_EndBlk (void); import void OPC_EndBlk0 (void); @@ -29,19 +29,19 @@ import void OPC_GenBdy (OPT_Node n); import void OPC_GenEnumPtrs (OPT_Object var); import void OPC_GenHdr (OPT_Node n); import void OPC_GenHdrIncludes (void); -import void OPC_Halt (int32 n); +import void OPC_Halt (INT32 n); import void OPC_Ident (OPT_Object obj); import void OPC_Increment (BOOLEAN decrement); -import void OPC_Indent (int16 count); +import void OPC_Indent (INT16 count); import void OPC_Init (void); import void OPC_InitTDesc (OPT_Struct typ); -import void OPC_IntLiteral (int64 n, int32 size); -import void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim); +import void OPC_IntLiteral (INT64 n, INT32 size); +import void OPC_Len (OPT_Object obj, OPT_Struct array, INT64 dim); import BOOLEAN OPC_NeedsRetval (OPT_Object proc); -import int32 OPC_NofPtrs (OPT_Struct typ); +import INT32 OPC_NofPtrs (OPT_Struct typ); import void OPC_SetInclude (BOOLEAN exclude); import void OPC_TDescDecl (OPT_Struct typ); -import void OPC_TypeDefs (OPT_Object obj, int16 vis); +import void OPC_TypeDefs (OPT_Object obj, INT16 vis); import void OPC_TypeOf (OPT_Object ap); import void *OPC__init(void); diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 5b67d672..46b6c33e 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "Configuration.h" @@ -22,81 +22,81 @@ typedef static CHAR OPM_SourceFileName[256]; static CHAR OPM_GlobalModel[10]; export CHAR OPM_Model[10]; -static int16 OPM_GlobalAddressSize; -export int16 OPM_AddressSize; -static int16 OPM_GlobalAlignment; -export int16 OPM_Alignment; -export uint32 OPM_GlobalOptions, OPM_Options; -export int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; -export int64 OPM_MaxIndex; +static INT16 OPM_GlobalAddressSize; +export INT16 OPM_AddressSize; +static INT16 OPM_GlobalAlignment; +export INT16 OPM_Alignment; +export UINT32 OPM_GlobalOptions, OPM_Options; +export INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; +export INT64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; -export int32 OPM_curpos, OPM_errpos, OPM_breakpc; -export int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; +export INT32 OPM_curpos, OPM_errpos, OPM_breakpc; +export INT16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; export CHAR OPM_modName[32]; export CHAR OPM_objname[64]; -static int32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; +static INT32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; static Texts_Reader OPM_inR; static Texts_Text OPM_Log; static Texts_Writer OPM_W; static Files_Rider OPM_oldSF, OPM_newSF; static Files_Rider OPM_R[3]; static Files_File OPM_oldSFile, OPM_newSFile, OPM_HFile, OPM_BFile, OPM_HIFile; -static int16 OPM_S; +static INT16 OPM_S; export CHAR OPM_ResourceDir[1024]; -static void OPM_Append (Files_Rider *R, address *R__typ, Files_File F); +static void OPM_Append (Files_Rider *R, ADDRESS *R__typ, Files_File F); export void OPM_CloseFiles (void); export void OPM_CloseOldSym (void); export void OPM_DeleteNewSym (void); -export void OPM_FPrint (int32 *fp, int64 val); -export void OPM_FPrintLReal (int32 *fp, LONGREAL lr); -export void OPM_FPrintReal (int32 *fp, REAL real); -export void OPM_FPrintSet (int32 *fp, uint64 set); -static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 pos); +export void OPM_FPrint (INT32 *fp, INT64 val); +export void OPM_FPrintLReal (INT32 *fp, LONGREAL lr); +export void OPM_FPrintReal (INT32 *fp, REAL real); +export void OPM_FPrintSet (INT32 *fp, UINT64 set); +static void OPM_FindLine (Files_File f, Files_Rider *r, ADDRESS *r__typ, INT64 pos); export void OPM_Get (CHAR *ch); export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); export void OPM_InitOptions (void); -export int16 OPM_Integer (int64 n); -static void OPM_LogErrMsg (int16 n); +export INT16 OPM_Integer (INT64 n); +static void OPM_LogErrMsg (INT16 n); export void OPM_LogW (CHAR ch); export void OPM_LogWLn (void); -export void OPM_LogWNum (int64 i, int64 len); +export void OPM_LogWNum (INT64 i, INT64 len); export void OPM_LogWStr (CHAR *s, LONGINT s__len); -export int32 OPM_Longint (int64 n); +export INT32 OPM_Longint (INT64 n); static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len); -export void OPM_Mark (int16 n, int32 pos); +export void OPM_Mark (INT16 n, INT32 pos); export void OPM_NewSym (CHAR *modName, LONGINT modName__len); export void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); export void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); export BOOLEAN OPM_OpenPar (void); export void OPM_RegisterNewSym (void); static void OPM_ScanOptions (CHAR *s, LONGINT s__len); -static void OPM_ShowLine (int64 pos); -export int64 OPM_SignedMaximum (int32 bytecount); -export int64 OPM_SignedMinimum (int32 bytecount); +static void OPM_ShowLine (INT64 pos); +export INT64 OPM_SignedMaximum (INT32 bytecount); +export INT64 OPM_SignedMinimum (INT32 bytecount); export void OPM_SymRCh (CHAR *ch); -export int32 OPM_SymRInt (void); -export int64 OPM_SymRInt64 (void); +export INT32 OPM_SymRInt (void); +export INT64 OPM_SymRInt64 (void); export void OPM_SymRLReal (LONGREAL *lr); export void OPM_SymRReal (REAL *r); -export void OPM_SymRSet (uint64 *s); +export void OPM_SymRSet (UINT64 *s); export void OPM_SymWCh (CHAR ch); -export void OPM_SymWInt (int64 i); +export void OPM_SymWInt (INT64 i); export void OPM_SymWLReal (LONGREAL lr); export void OPM_SymWReal (REAL r); -export void OPM_SymWSet (uint64 s); +export void OPM_SymWSet (UINT64 s); static void OPM_VerboseListSizes (void); export void OPM_Write (CHAR ch); -export void OPM_WriteHex (int64 i); -export void OPM_WriteInt (int64 i); +export void OPM_WriteHex (INT64 i); +export void OPM_WriteInt (INT64 i); export void OPM_WriteLn (void); export void OPM_WriteReal (LONGREAL r, CHAR suffx); export void OPM_WriteString (CHAR *s, LONGINT s__len); export void OPM_WriteStringVar (CHAR *s, LONGINT s__len); export BOOLEAN OPM_eofSF (void); -export void OPM_err (int16 n); +export void OPM_err (INT16 n); #define OPM_GetAlignment(a) struct {char c; long long l;} _s; *a = (char*)&_s.l - (char*)&_s @@ -112,7 +112,7 @@ void OPM_LogWStr (CHAR *s, LONGINT s__len) __DEL(s); } -void OPM_LogWNum (int64 i, int64 len) +void OPM_LogWNum (INT64 i, INT64 len) { Out_Int(i, len); } @@ -122,32 +122,32 @@ void OPM_LogWLn (void) Out_Ln(); } -int64 OPM_SignedMaximum (int32 bytecount) +INT64 OPM_SignedMaximum (INT32 bytecount) { - int64 result; + INT64 result; result = 1; result = __LSH(result, __ASHL(bytecount, 3) - 1, 64); return result - 1; } -int64 OPM_SignedMinimum (int32 bytecount) +INT64 OPM_SignedMinimum (INT32 bytecount) { return -OPM_SignedMaximum(bytecount) - 1; } -int32 OPM_Longint (int64 n) +INT32 OPM_Longint (INT64 n) { - return __VAL(int32, n); + return __VAL(INT32, n); } -int16 OPM_Integer (int64 n) +INT16 OPM_Integer (INT64 n) { - return __VAL(int16, n); + return __VAL(INT16, n); } static void OPM_ScanOptions (CHAR *s, LONGINT s__len) { - int16 i; + INT16 i; __DUP(s, s__len, CHAR); i = 1; while (s[__X(i, s__len)] != 0x00) { @@ -213,23 +213,23 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len) OPM_LogWStr((CHAR*)"-M option requires two following digits.", 41); OPM_LogWLn(); } else { - OPM_AddressSize = (int16)s[__X(i + 1, s__len)] - 48; - OPM_Alignment = (int16)s[__X(i + 2, s__len)] - 48; + OPM_AddressSize = (INT16)s[__X(i + 1, s__len)] - 48; + OPM_Alignment = (INT16)s[__X(i + 2, s__len)] - 48; i += 2; } break; case 'B': if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_IntegerSize = (int16)s[__X(i, s__len)] - 48; + OPM_IntegerSize = (INT16)s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_AddressSize = (int16)s[__X(i, s__len)] - 48; + OPM_AddressSize = (INT16)s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_Alignment = (int16)s[__X(i, s__len)] - 48; + OPM_Alignment = (INT16)s[__X(i, s__len)] - 48; } __ASSERT(OPM_IntegerSize == 2 || OPM_IntegerSize == 4, 0); __ASSERT(OPM_AddressSize == 4 || OPM_AddressSize == 8, 0); @@ -465,7 +465,7 @@ void OPM_InitOptions (void) void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len) { Texts_Text T = NIL; - int32 beg, end, time; + INT32 beg, end, time; CHAR s[256]; *done = 0; OPM_curpos = 0; @@ -513,7 +513,7 @@ void OPM_Get (CHAR *ch) static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len) { - int16 i, j; + INT16 i, j; CHAR ch; __DUP(ext, ext__len, CHAR); i = 0; @@ -535,12 +535,12 @@ static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGIN __DEL(ext); } -static void OPM_LogErrMsg (int16 n) +static void OPM_LogErrMsg (INT16 n) { Texts_Scanner S; Texts_Text T = NIL; CHAR ch; - int16 i; + INT16 i; CHAR buf[1024]; if (n >= 0) { if (!__IN(16, OPM_Options, 32)) { @@ -565,21 +565,21 @@ static void OPM_LogErrMsg (int16 n) OPM_LogWStr(errors_errors[__X(n, 350)], 128); } -static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 pos) +static void OPM_FindLine (Files_File f, Files_Rider *r, ADDRESS *r__typ, INT64 pos) { CHAR ch, cheol; - if (pos < (int64)OPM_ErrorLineStartPos) { + if (pos < (INT64)OPM_ErrorLineStartPos) { OPM_ErrorLineStartPos = 0; OPM_ErrorLineLimitPos = 0; OPM_ErrorLineNumber = 0; } - if (pos < (int64)OPM_ErrorLineLimitPos) { + if (pos < (INT64)OPM_ErrorLineLimitPos) { Files_Set(&*r, r__typ, f, OPM_ErrorLineStartPos); return; } Files_Set(&*r, r__typ, f, OPM_ErrorLineLimitPos); Files_Read(&*r, r__typ, (void*)&ch); - while (((int64)OPM_ErrorLineLimitPos < pos && !(*r).eof)) { + while (((INT64)OPM_ErrorLineLimitPos < pos && !(*r).eof)) { OPM_ErrorLineStartPos = OPM_ErrorLineLimitPos; OPM_ErrorLineNumber += 1; while ((((ch != 0x00 && ch != 0x0d)) && ch != 0x0a)) { @@ -597,12 +597,12 @@ static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 p Files_Set(&*r, r__typ, f, OPM_ErrorLineStartPos); } -static void OPM_ShowLine (int64 pos) +static void OPM_ShowLine (INT64 pos) { Files_File f = NIL; Files_Rider r; CHAR line[1023]; - int16 i; + INT16 i; CHAR ch; f = Files_Old(OPM_SourceFileName, 256); OPM_FindLine(f, &r, Files_Rider__typ, pos); @@ -621,10 +621,10 @@ static void OPM_ShowLine (int64 pos) OPM_LogWStr(line, 1023); OPM_LogWLn(); OPM_LogWStr((CHAR*)" ", 7); - if (pos >= (int64)OPM_ErrorLineLimitPos) { + if (pos >= (INT64)OPM_ErrorLineLimitPos) { pos = OPM_ErrorLineLimitPos - 1; } - i = (int16)OPM_Longint(pos - (int64)OPM_ErrorLineStartPos); + i = (INT16)OPM_Longint(pos - (INT64)OPM_ErrorLineStartPos); while (i > 0) { OPM_LogW(' '); i -= 1; @@ -639,7 +639,7 @@ static void OPM_ShowLine (int64 pos) Files_Close(f); } -void OPM_Mark (int16 n, int32 pos) +void OPM_Mark (INT16 n, INT32 pos) { if (pos == -1) { pos = 0; @@ -691,34 +691,34 @@ void OPM_Mark (int16 n, int32 pos) } } -void OPM_err (int16 n) +void OPM_err (INT16 n) { OPM_Mark(n, OPM_errpos); } -void OPM_FPrint (int32 *fp, int64 val) +void OPM_FPrint (INT32 *fp, INT64 val) { - *fp = __ROTL((int32)((uint32)*fp ^ __VAL(uint32, val)), 1, 32); + *fp = __ROTL((INT32)((UINT32)*fp ^ __VAL(UINT32, val)), 1, 32); } -void OPM_FPrintSet (int32 *fp, uint64 set) +void OPM_FPrintSet (INT32 *fp, UINT64 set) { - OPM_FPrint(&*fp, __VAL(int32, set)); + OPM_FPrint(&*fp, __VAL(INT32, set)); } -void OPM_FPrintReal (int32 *fp, REAL real) +void OPM_FPrintReal (INT32 *fp, REAL real) { - int16 i; - int32 l; - __GET((address)&real, l, int32); + INT16 i; + INT32 l; + __GET((address)&real, l, INT32); OPM_FPrint(&*fp, l); } -void OPM_FPrintLReal (int32 *fp, LONGREAL lr) +void OPM_FPrintLReal (INT32 *fp, LONGREAL lr) { - int32 l, h; - __GET((address)&lr, l, int32); - __GET((address)&lr + 4, h, int32); + INT32 l, h; + __GET((address)&lr, l, INT32); + __GET((address)&lr + 4, h, INT32); OPM_FPrint(&*fp, l); OPM_FPrint(&*fp, h); } @@ -728,21 +728,21 @@ void OPM_SymRCh (CHAR *ch) Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&*ch); } -int32 OPM_SymRInt (void) +INT32 OPM_SymRInt (void) { - int32 k; + INT32 k; Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&k, 4); return k; } -int64 OPM_SymRInt64 (void) +INT64 OPM_SymRInt64 (void) { - int64 k; + INT64 k; Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&k, 8); return k; } -void OPM_SymRSet (uint64 *s) +void OPM_SymRSet (UINT64 *s) { Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&*s, 8); } @@ -790,14 +790,14 @@ void OPM_SymWCh (CHAR ch) Files_Write(&OPM_newSF, Files_Rider__typ, ch); } -void OPM_SymWInt (int64 i) +void OPM_SymWInt (INT64 i) { Files_WriteNum(&OPM_newSF, Files_Rider__typ, i); } -void OPM_SymWSet (uint64 s) +void OPM_SymWSet (UINT64 s) { - Files_WriteNum(&OPM_newSF, Files_Rider__typ, (int64)s); + Files_WriteNum(&OPM_newSF, Files_Rider__typ, (INT64)s); } void OPM_SymWReal (REAL r) @@ -841,7 +841,7 @@ void OPM_Write (CHAR ch) void OPM_WriteString (CHAR *s, LONGINT s__len) { - int16 i; + INT16 i; i = 0; while (s[__X(i, s__len)] != 0x00) { i += 1; @@ -851,7 +851,7 @@ void OPM_WriteString (CHAR *s, LONGINT s__len) void OPM_WriteStringVar (CHAR *s, LONGINT s__len) { - int16 i; + INT16 i; i = 0; while (s[__X(i, s__len)] != 0x00) { i += 1; @@ -859,17 +859,17 @@ void OPM_WriteStringVar (CHAR *s, LONGINT s__len) Files_WriteBytes(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, (void*)s, s__len * 1, i); } -void OPM_WriteHex (int64 i) +void OPM_WriteHex (INT64 i) { CHAR s[3]; - int32 digit; - digit = __ASHR((int32)i, 4); + INT32 digit; + digit = __ASHR((INT32)i, 4); if (digit < 10) { s[0] = (CHAR)(48 + digit); } else { s[0] = (CHAR)(87 + digit); } - digit = __MASK((int32)i, -16); + digit = __MASK((INT32)i, -16); if (digit < 10) { s[1] = (CHAR)(48 + digit); } else { @@ -879,10 +879,10 @@ void OPM_WriteHex (int64 i) OPM_WriteString(s, 3); } -void OPM_WriteInt (int64 i) +void OPM_WriteInt (INT64 i) { CHAR s[24]; - int64 i1, k; + INT64 i1, k; if ((i == OPM_SignedMinimum(2) || i == OPM_SignedMinimum(4)) || i == OPM_SignedMinimum(8)) { OPM_Write('('); OPM_WriteInt(i + 1); @@ -915,14 +915,14 @@ void OPM_WriteReal (LONGREAL r, CHAR suffx) Texts_Reader R; CHAR s[32]; CHAR ch; - int16 i; - if ((((r < OPM_SignedMaximum(OPM_LongintSize) && r > OPM_SignedMinimum(OPM_LongintSize))) && r == ((int32)__ENTIER(r)))) { + INT16 i; + if ((((r < OPM_SignedMaximum(OPM_LongintSize) && r > OPM_SignedMinimum(OPM_LongintSize))) && r == ((INT32)__ENTIER(r)))) { if (suffx == 'f') { OPM_WriteString((CHAR*)"(REAL)", 7); } else { OPM_WriteString((CHAR*)"(LONGREAL)", 11); } - OPM_WriteInt((int32)__ENTIER(r)); + OPM_WriteInt((INT32)__ENTIER(r)); } else { Texts_OpenWriter(&W, Texts_Writer__typ); if (suffx == 'f') { @@ -960,7 +960,7 @@ void OPM_WriteLn (void) Files_Write(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, 0x0a); } -static void OPM_Append (Files_Rider *R, address *R__typ, Files_File F) +static void OPM_Append (Files_Rider *R, ADDRESS *R__typ, Files_File F) { Files_Rider R1; CHAR buffer[4096]; @@ -1003,7 +1003,7 @@ void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len) void OPM_CloseFiles (void) { CHAR FName[32]; - int16 res; + INT16 res; if (OPM_noerr) { OPM_LogWStr((CHAR*)" ", 3); OPM_LogWNum(Files_Pos(&OPM_R[1], Files_Rider__typ), 0); diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index be9e98bd..42866571 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h @@ -7,14 +7,14 @@ import CHAR OPM_Model[10]; -import int16 OPM_AddressSize, OPM_Alignment; -import uint32 OPM_GlobalOptions, OPM_Options; -import int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; -import int64 OPM_MaxIndex; +import INT16 OPM_AddressSize, OPM_Alignment; +import UINT32 OPM_GlobalOptions, OPM_Options; +import INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; +import INT64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; -import int32 OPM_curpos, OPM_errpos, OPM_breakpc; -import int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; +import INT32 OPM_curpos, OPM_errpos, OPM_breakpc; +import INT16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; import CHAR OPM_modName[32]; import CHAR OPM_objname[64]; import CHAR OPM_ResourceDir[1024]; @@ -23,47 +23,47 @@ import CHAR OPM_ResourceDir[1024]; import void OPM_CloseFiles (void); import void OPM_CloseOldSym (void); import void OPM_DeleteNewSym (void); -import void OPM_FPrint (int32 *fp, int64 val); -import void OPM_FPrintLReal (int32 *fp, LONGREAL lr); -import void OPM_FPrintReal (int32 *fp, REAL real); -import void OPM_FPrintSet (int32 *fp, uint64 set); +import void OPM_FPrint (INT32 *fp, INT64 val); +import void OPM_FPrintLReal (INT32 *fp, LONGREAL lr); +import void OPM_FPrintReal (INT32 *fp, REAL real); +import void OPM_FPrintSet (INT32 *fp, UINT64 set); import void OPM_Get (CHAR *ch); import void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); import void OPM_InitOptions (void); -import int16 OPM_Integer (int64 n); +import INT16 OPM_Integer (INT64 n); import void OPM_LogW (CHAR ch); import void OPM_LogWLn (void); -import void OPM_LogWNum (int64 i, int64 len); +import void OPM_LogWNum (INT64 i, INT64 len); import void OPM_LogWStr (CHAR *s, LONGINT s__len); -import int32 OPM_Longint (int64 n); -import void OPM_Mark (int16 n, int32 pos); +import INT32 OPM_Longint (INT64 n); +import void OPM_Mark (INT16 n, INT32 pos); import void OPM_NewSym (CHAR *modName, LONGINT modName__len); import void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); import void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); import BOOLEAN OPM_OpenPar (void); import void OPM_RegisterNewSym (void); -import int64 OPM_SignedMaximum (int32 bytecount); -import int64 OPM_SignedMinimum (int32 bytecount); +import INT64 OPM_SignedMaximum (INT32 bytecount); +import INT64 OPM_SignedMinimum (INT32 bytecount); import void OPM_SymRCh (CHAR *ch); -import int32 OPM_SymRInt (void); -import int64 OPM_SymRInt64 (void); +import INT32 OPM_SymRInt (void); +import INT64 OPM_SymRInt64 (void); import void OPM_SymRLReal (LONGREAL *lr); import void OPM_SymRReal (REAL *r); -import void OPM_SymRSet (uint64 *s); +import void OPM_SymRSet (UINT64 *s); import void OPM_SymWCh (CHAR ch); -import void OPM_SymWInt (int64 i); +import void OPM_SymWInt (INT64 i); import void OPM_SymWLReal (LONGREAL lr); import void OPM_SymWReal (REAL r); -import void OPM_SymWSet (uint64 s); +import void OPM_SymWSet (UINT64 s); import void OPM_Write (CHAR ch); -import void OPM_WriteHex (int64 i); -import void OPM_WriteInt (int64 i); +import void OPM_WriteHex (INT64 i); +import void OPM_WriteInt (INT64 i); import void OPM_WriteLn (void); import void OPM_WriteReal (LONGREAL r, CHAR suffx); import void OPM_WriteString (CHAR *s, LONGINT s__len); import void OPM_WriteStringVar (CHAR *s, LONGINT s__len); import BOOLEAN OPM_eofSF (void); -import void OPM_err (int16 n); +import void OPM_err (INT16 n); import void *OPM__init(void); diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index 615109df..3eabde0b 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "OPB.h" @@ -12,38 +12,38 @@ #include "OPT.h" struct OPP__1 { - int32 low, high; + INT32 low, high; }; typedef struct OPP__1 OPP_CaseTable[128]; -static int8 OPP_sym, OPP_level; -static int16 OPP_LoopLevel; +static INT8 OPP_sym, OPP_level; +static INT16 OPP_LoopLevel; static OPT_Node OPP_TDinit, OPP_lastTDinit; -static int16 OPP_nofFwdPtr; +static INT16 OPP_nofFwdPtr; static OPT_Struct OPP_FwdPtr[64]; -export address *OPP__1__typ; +export ADDRESS *OPP__1__typ; static void OPP_ActualParameters (OPT_Node *aparlist, OPT_Object fpar); static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned); static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq); -static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int16 *n, OPP_CaseTable tab); -static void OPP_CheckMark (int8 *vis); -static void OPP_CheckSym (int16 s); -static void OPP_CheckSysFlag (int16 *sysflag, int16 default_); +static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INT16 *n, OPP_CaseTable tab); +static void OPP_CheckMark (INT8 *vis); +static void OPP_CheckSym (INT16 s); +static void OPP_CheckSysFlag (INT16 *sysflag, INT16 default_); static void OPP_ConstExpression (OPT_Node *x); static void OPP_Element (OPT_Node *x); static void OPP_Expression (OPT_Node *x); static BOOLEAN OPP_Extends (OPT_Struct x, OPT_Struct b); static void OPP_Factor (OPT_Node *x); static void OPP_FormalParameters (OPT_Object *firstPar, OPT_Struct *resTyp); -export void OPP_Module (OPT_Node *prog, uint32 opt); +export void OPP_Module (OPT_Node *prog, UINT32 opt); static void OPP_PointerType (OPT_Struct *typ); static void OPP_ProcedureDeclaration (OPT_Node *x); -static void OPP_Receiver (int8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec); +static void OPP_Receiver (INT8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec); static void OPP_RecordType (OPT_Struct *typ, OPT_Struct *banned); static void OPP_Sets (OPT_Node *x); static void OPP_SimpleExpression (OPT_Node *x); @@ -52,19 +52,19 @@ static void OPP_StatSeq (OPT_Node *stat); static void OPP_Term (OPT_Node *x); static void OPP_Type (OPT_Struct *typ, OPT_Struct *banned); static void OPP_TypeDecl (OPT_Struct *typ, OPT_Struct *banned); -static void OPP_err (int16 n); +static void OPP_err (INT16 n); static void OPP_qualident (OPT_Object *id); static void OPP_selector (OPT_Node *x); -static void OPP_err (int16 n) +static void OPP_err (INT16 n) { OPM_err(n); } -static void OPP_CheckSym (int16 s) +static void OPP_CheckSym (INT16 s) { - if ((int16)OPP_sym == s) { + if ((INT16)OPP_sym == s) { OPS_Get(&OPP_sym); } else { OPM_err(s); @@ -74,7 +74,7 @@ static void OPP_CheckSym (int16 s) static void OPP_qualident (OPT_Object *id) { OPT_Object obj = NIL; - int8 lev; + INT8 lev; OPT_Find(&obj); OPS_Get(&OPP_sym); if ((((OPP_sym == 18 && obj != NIL)) && obj->mode == 11)) { @@ -114,7 +114,7 @@ static void OPP_ConstExpression (OPT_Node *x) } } -static void OPP_CheckMark (int8 *vis) +static void OPP_CheckMark (INT8 *vis) { OPS_Get(&OPP_sym); if (OPP_sym == 1 || OPP_sym == 7) { @@ -132,10 +132,10 @@ static void OPP_CheckMark (int8 *vis) } } -static void OPP_CheckSysFlag (int16 *sysflag, int16 default_) +static void OPP_CheckSysFlag (INT16 *sysflag, INT16 default_) { OPT_Node x = NIL; - int64 sf; + INT64 sf; if (OPP_sym == 31) { OPS_Get(&OPP_sym); if (!OPT_SYSimported) { @@ -163,7 +163,7 @@ static void OPP_RecordType (OPT_Struct *typ, OPT_Struct *banned) { OPT_Object fld = NIL, first = NIL, last = NIL, base = NIL; OPT_Struct ftyp = NIL; - int16 sysflag; + INT16 sysflag; *typ = OPT_NewStr(13, 4); (*typ)->BaseTyp = NIL; OPP_CheckSysFlag(&sysflag, -1); @@ -255,8 +255,8 @@ static void OPP_RecordType (OPT_Struct *typ, OPT_Struct *banned) static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) { OPT_Node x = NIL; - int64 n; - int16 sysflag; + INT64 n; + INT16 sysflag; OPP_CheckSysFlag(&sysflag, 0); if (OPP_sym == 25) { *typ = OPT_NewStr(13, 3); @@ -348,7 +348,7 @@ static void OPP_PointerType (OPT_Struct *typ) static void OPP_FormalParameters (OPT_Object *firstPar, OPT_Struct *resTyp) { - int8 mode; + INT8 mode; OPT_Object par = NIL, first = NIL, last = NIL, res = NIL; OPT_Struct typ = NIL; first = NIL; @@ -629,9 +629,9 @@ static void OPP_ActualParameters (OPT_Node *aparlist, OPT_Object fpar) static void OPP_StandProcCall (OPT_Node *x) { OPT_Node y = NIL; - int8 m; - int16 n; - m = (int8)((int16)(*x)->obj->adr); + INT8 m; + INT16 n; + m = (INT8)((INT16)(*x)->obj->adr); n = 0; if (OPP_sym == 30) { OPS_Get(&OPP_sym); @@ -790,7 +790,7 @@ static void OPP_Factor (OPT_Node *x) static void OPP_Term (OPT_Node *x) { OPT_Node y = NIL; - int8 mulop; + INT8 mulop; OPP_Factor(&*x); while ((1 <= OPP_sym && OPP_sym <= 5)) { mulop = OPP_sym; @@ -803,7 +803,7 @@ static void OPP_Term (OPT_Node *x) static void OPP_SimpleExpression (OPT_Node *x) { OPT_Node y = NIL; - int8 addop; + INT8 addop; if (OPP_sym == 7) { OPS_Get(&OPP_sym); OPP_Term(&*x); @@ -827,7 +827,7 @@ static void OPP_Expression (OPT_Node *x) { OPT_Node y = NIL; OPT_Object obj = NIL; - int8 relation; + INT8 relation; OPP_SimpleExpression(&*x); if ((9 <= OPP_sym && OPP_sym <= 14)) { relation = OPP_sym; @@ -853,7 +853,7 @@ static void OPP_Expression (OPT_Node *x) } } -static void OPP_Receiver (int8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec) +static void OPP_Receiver (INT8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec) { OPT_Object obj = NIL; *typ = OPT_undftyp; @@ -917,7 +917,7 @@ static struct ProcedureDeclaration__16 { OPT_Node *x; OPT_Object *proc, *fwd; OPS_Name *name; - int8 *mode, *vis; + INT8 *mode, *vis; BOOLEAN *forward; struct ProcedureDeclaration__16 *lnk; } *ProcedureDeclaration__16_s; @@ -930,8 +930,8 @@ static void TProcDecl__23 (void); static void GetCode__19 (void) { OPT_ConstExt ext = NIL; - int16 n; - int64 c; + INT16 n; + INT64 c; ext = OPT_NewExt(); (*ProcedureDeclaration__16_s->proc)->conval->ext = ext; n = 0; @@ -995,7 +995,7 @@ static void GetParams__21 (void) static void Body__17 (void) { OPT_Node procdec = NIL, statseq = NIL; - int32 c; + INT32 c; c = OPM_errpos; (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1,64); OPP_CheckSym(39); @@ -1018,7 +1018,7 @@ static void TProcDecl__23 (void) { OPT_Object baseProc = NIL; OPT_Struct objTyp = NIL, recTyp = NIL; - int8 objMode; + INT8 objMode; OPS_Name objName; OPS_Get(&OPP_sym); *ProcedureDeclaration__16_s->mode = 13; @@ -1090,7 +1090,7 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) { OPT_Object proc = NIL, fwd = NIL; OPS_Name name; - int8 mode, vis; + INT8 mode, vis; BOOLEAN forward; struct ProcedureDeclaration__16 _s; _s.x = x; @@ -1167,11 +1167,11 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) ProcedureDeclaration__16_s = _s.lnk; } -static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int16 *n, OPP_CaseTable tab) +static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INT16 *n, OPP_CaseTable tab) { OPT_Node x = NIL, y = NIL, lastlab = NIL; - int16 i, f; - int32 xval, yval; + INT16 i, f; + INT32 xval, yval; *lab = NIL; lastlab = NIL; for (;;) { @@ -1187,14 +1187,14 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int16 *n, OPP if (!(LabelTyp->form == 4) || LabelTyp->size < x->typ->size) { OPP_err(60); } - } else if ((int16)LabelTyp->form != f) { + } else if ((INT16)LabelTyp->form != f) { OPP_err(60); } if (OPP_sym == 21) { OPS_Get(&OPP_sym); OPP_ConstExpression(&y); yval = OPM_Longint(y->conval->intval); - if (((int16)y->typ->form != f && !((f == 4 && y->typ->form == 4)))) { + if (((INT16)y->typ->form != f && !((f == 4 && y->typ->form == 4)))) { OPP_err(60); } if (yval < xval) { @@ -1238,7 +1238,7 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int16 *n, OPP } static struct StatSeq__30 { - int32 *pos; + INT32 *pos; struct StatSeq__30 *lnk; } *StatSeq__30_s; @@ -1248,8 +1248,8 @@ static void SetPos__35 (OPT_Node x); static void CasePart__31 (OPT_Node *x) { - int16 n; - int32 low, high; + INT16 n; + INT32 low, high; BOOLEAN e; OPP_CaseTable tab; OPT_Node cases = NIL, lab = NIL, y = NIL, lastcase = NIL; @@ -1332,7 +1332,7 @@ static void OPP_StatSeq (OPT_Node *stat) OPT_Struct idtyp = NIL; BOOLEAN e; OPT_Node s = NIL, x = NIL, y = NIL, z = NIL, apar = NIL, last = NIL, lastif = NIL; - int32 pos; + INT32 pos; OPS_Name name; struct StatSeq__30 _s; _s.pos = &pos; @@ -1625,7 +1625,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) OPT_Struct typ = NIL; OPT_Object obj = NIL, first = NIL, last = NIL; OPT_Node x = NIL, lastdec = NIL; - int16 i; + INT16 i; first = NIL; last = NIL; OPP_nofFwdPtr = 0; @@ -1774,11 +1774,11 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) OPP_CheckSym(41); } -void OPP_Module (OPT_Node *prog, uint32 opt) +void OPP_Module (OPT_Node *prog, UINT32 opt) { OPS_Name impName, aliasName; OPT_Node procdec = NIL, statseq = NIL; - int32 c; + INT32 c; BOOLEAN done; OPS_Init(); OPP_LoopLevel = 0; diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index de0e599a..cb3aabc8 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h @@ -9,7 +9,7 @@ -import void OPP_Module (OPT_Node *prog, uint32 opt); +import void OPP_Module (OPT_Node *prog, UINT32 opt); import void *OPP__init(void); diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index 5a34663d..5d7b776f 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "OPM.h" @@ -17,29 +17,29 @@ typedef export OPS_Name OPS_name; export OPS_String OPS_str; -export int16 OPS_numtyp; -export int64 OPS_intval; +export INT16 OPS_numtyp; +export INT64 OPS_intval; export REAL OPS_realval; export LONGREAL OPS_lrlval; static CHAR OPS_ch; -export void OPS_Get (int8 *sym); -static void OPS_Identifier (int8 *sym); +export void OPS_Get (INT8 *sym); +static void OPS_Identifier (INT8 *sym); export void OPS_Init (void); static void OPS_Number (void); -static void OPS_Str (int8 *sym); -static void OPS_err (int16 n); +static void OPS_Str (INT8 *sym); +static void OPS_err (INT16 n); -static void OPS_err (int16 n) +static void OPS_err (INT16 n) { OPM_err(n); } -static void OPS_Str (int8 *sym) +static void OPS_Str (INT8 *sym) { - int16 i; + INT16 i; CHAR och; i = 0; och = OPS_ch; @@ -65,15 +65,15 @@ static void OPS_Str (int8 *sym) if (OPS_intval == 2) { *sym = 35; OPS_numtyp = 1; - OPS_intval = (int16)OPS_str[0]; + OPS_intval = (INT16)OPS_str[0]; } else { *sym = 37; } } -static void OPS_Identifier (int8 *sym) +static void OPS_Identifier (INT8 *sym) { - int16 i; + INT16 i; i = 0; do { OPS_name[i] = OPS_ch; @@ -92,10 +92,10 @@ static struct Number__6 { struct Number__6 *lnk; } *Number__6_s; -static int16 Ord__7 (CHAR ch, BOOLEAN hex); -static LONGREAL Ten__9 (int16 e); +static INT16 Ord__7 (CHAR ch, BOOLEAN hex); +static LONGREAL Ten__9 (INT16 e); -static LONGREAL Ten__9 (int16 e) +static LONGREAL Ten__9 (INT16 e) { LONGREAL x, p; x = (LONGREAL)1; @@ -112,12 +112,12 @@ static LONGREAL Ten__9 (int16 e) return x; } -static int16 Ord__7 (CHAR ch, BOOLEAN hex) +static INT16 Ord__7 (CHAR ch, BOOLEAN hex) { if (ch <= '9') { - return (int16)ch - 48; + return (INT16)ch - 48; } else if (hex) { - return ((int16)ch - 65) + 10; + return ((INT16)ch - 65) + 10; } else { OPS_err(2); return 0; @@ -127,7 +127,7 @@ static int16 Ord__7 (CHAR ch, BOOLEAN hex) static void OPS_Number (void) { - int16 i, m, n, d, e; + INT16 i, m, n, d, e; CHAR dig[24]; LONGREAL f; CHAR expCh; @@ -173,7 +173,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) + (INT64)Ord__7(dig[i], 1); i += 1; } } else { @@ -187,7 +187,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) + (INT64)Ord__7(dig[i], 1); i += 1; } } else { @@ -198,8 +198,8 @@ static void OPS_Number (void) while (i < n) { d = Ord__7(dig[i], 0); i += 1; - if (OPS_intval <= __DIV(9223372036854775807 - (int64)d, 10)) { - OPS_intval = OPS_intval * 10 + (int64)d; + if (OPS_intval <= __DIV(9223372036854775807 - (INT64)d, 10)) { + OPS_intval = OPS_intval * 10 + (INT64)d; } else { OPS_err(203); } @@ -308,9 +308,9 @@ static void Comment__2 (void) } } -void OPS_Get (int8 *sym) +void OPS_Get (INT8 *sym) { - int8 s; + INT8 s; struct Get__1 _s; _s.lnk = Get__1_s; Get__1_s = &_s; diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index a452da84..01ffbd17 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h @@ -14,13 +14,13 @@ typedef import OPS_Name OPS_name; import OPS_String OPS_str; -import int16 OPS_numtyp; -import int64 OPS_intval; +import INT16 OPS_numtyp; +import INT64 OPS_intval; import REAL OPS_realval; import LONGREAL OPS_lrlval; -import void OPS_Get (int8 *sym); +import void OPS_Get (INT8 *sym); import void OPS_Init (void); import void *OPS__init(void); diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index 48352c94..e1405ce9 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "OPM.h" @@ -18,18 +18,18 @@ typedef typedef struct OPT_ConstDesc { OPT_ConstExt ext; - int64 intval; - int32 intval2; - uint64 setval; + INT64 intval; + INT32 intval2; + UINT64 setval; LONGREAL realval; } OPT_ConstDesc; typedef struct OPT_ExpCtxt { - int32 reffp; - int16 ref; - int8 nofm; - int8 locmno[64]; + INT32 reffp; + INT16 ref; + INT8 nofm; + INT8 locmno[64]; } OPT_ExpCtxt; typedef @@ -40,13 +40,13 @@ typedef typedef struct OPT_ImpCtxt { - int32 nextTag, reffp; - int16 nofr, minr, nofm; + INT32 nextTag, reffp; + INT16 nofr, minr, nofm; BOOLEAN self; OPT_Struct ref[255]; OPT_Object old[255]; - int32 pvfp[255]; - int8 glbmno[64]; + INT32 pvfp[255]; + INT8 glbmno[64]; } OPT_ImpCtxt; typedef @@ -55,7 +55,7 @@ typedef typedef struct OPT_NodeDesc { OPT_Node left, right, link; - int8 class, subcl; + INT8 class, subcl; BOOLEAN readonly; OPT_Struct typ; OPT_Object obj; @@ -67,22 +67,22 @@ typedef OPT_Object left, right, link, scope; OPS_Name name; BOOLEAN leaf; - int8 mode, mnolev, vis, history; + INT8 mode, mnolev, vis, history; BOOLEAN used, fpdone; - int32 fprint; + INT32 fprint; OPT_Struct typ; OPT_Const conval; - int32 adr, linkadr; - int16 x; + INT32 adr, linkadr; + INT16 x; } OPT_ObjDesc; typedef struct OPT_StrDesc { - int8 form, comp, mno, extlev; - int16 ref, sysflag; - int32 n, size, align, txtpos; + INT8 form, comp, mno, extlev; + INT16 ref, sysflag; + INT32 n, size, align, txtpos; BOOLEAN allocated, pbused, pvused, fpdone, idfpdone; - int32 idfp, pbfp, pvfp; + INT32 idfp, pbfp, pvfp; OPT_Struct BaseTyp; OPT_Object link, strobj; } OPT_StrDesc; @@ -91,80 +91,80 @@ typedef export OPT_Object OPT_topScope; export OPT_Struct OPT_undftyp, OPT_niltyp, OPT_notyp, OPT_bytetyp, OPT_cpbytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_settyp, OPT_set32typ, OPT_set64typ, OPT_realtyp, OPT_lrltyp, OPT_stringtyp, OPT_adrtyp, OPT_sysptrtyp; export OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj, OPT_setobj; -export int8 OPT_nofGmod; +export INT8 OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; export BOOLEAN OPT_SYSimported; static OPT_Object OPT_universe, OPT_syslink; static OPT_ImpCtxt OPT_impCtxt; static OPT_ExpCtxt OPT_expCtxt; -static int32 OPT_nofhdfld; +static INT32 OPT_nofhdfld; static BOOLEAN OPT_newsf, OPT_findpc, OPT_extsf, OPT_sfpresent, OPT_symExtended, OPT_symNew; -static int32 OPT_recno; +static INT32 OPT_recno; -export address *OPT_ConstDesc__typ; -export address *OPT_ObjDesc__typ; -export address *OPT_StrDesc__typ; -export address *OPT_NodeDesc__typ; -export address *OPT_ImpCtxt__typ; -export address *OPT_ExpCtxt__typ; +export ADDRESS *OPT_ConstDesc__typ; +export ADDRESS *OPT_ObjDesc__typ; +export ADDRESS *OPT_StrDesc__typ; +export ADDRESS *OPT_NodeDesc__typ; +export ADDRESS *OPT_ImpCtxt__typ; +export ADDRESS *OPT_ExpCtxt__typ; -export void OPT_Align (int32 *adr, int32 base); -export int32 OPT_BaseAlignment (OPT_Struct typ); +export void OPT_Align (INT32 *adr, INT32 base); +export INT32 OPT_BaseAlignment (OPT_Struct typ); export void OPT_Close (void); export void OPT_CloseScope (void); static void OPT_DebugStruct (OPT_Struct btyp); -static void OPT_EnterBoolConst (OPS_Name name, int32 value); -static void OPT_EnterProc (OPS_Name name, int16 num); -static void OPT_EnterTyp (OPS_Name name, int8 form, int16 size, OPT_Struct *res); +static void OPT_EnterBoolConst (OPS_Name name, INT32 value); +static void OPT_EnterProc (OPS_Name name, INT16 num); +static void OPT_EnterTyp (OPS_Name name, INT8 form, INT16 size, OPT_Struct *res); static void OPT_EnterTypeAlias (OPS_Name name, OPT_Object *res); export void OPT_Export (BOOLEAN *ext, BOOLEAN *new); -export void OPT_FPrintErr (OPT_Object obj, int16 errcode); -static void OPT_FPrintName (int32 *fp, CHAR *name, LONGINT name__len); +export void OPT_FPrintErr (OPT_Object obj, INT16 errcode); +static void OPT_FPrintName (INT32 *fp, CHAR *name, LONGINT name__len); export void OPT_FPrintObj (OPT_Object obj); -static void OPT_FPrintSign (int32 *fp, OPT_Struct result, OPT_Object par); +static void OPT_FPrintSign (INT32 *fp, OPT_Struct result, OPT_Object par); export void OPT_FPrintStr (OPT_Struct typ); export void OPT_Find (OPT_Object *res); export void OPT_FindField (OPS_Name name, OPT_Struct typ, OPT_Object *res); export void OPT_FindImport (OPT_Object mod, OPT_Object *res); export void OPT_IdFPrint (OPT_Struct typ); export void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); -static void OPT_InConstant (int32 f, OPT_Const conval); +static void OPT_InConstant (INT32 f, OPT_Const conval); static OPT_Object OPT_InFld (void); -static void OPT_InMod (int8 *mno); +static void OPT_InMod (INT8 *mno); static void OPT_InName (CHAR *name, LONGINT name__len); -static OPT_Object OPT_InObj (int8 mno); -static void OPT_InSign (int8 mno, OPT_Struct *res, OPT_Object *par); +static OPT_Object OPT_InObj (INT8 mno); +static void OPT_InSign (INT8 mno, OPT_Struct *res, OPT_Object *par); static void OPT_InStruct (OPT_Struct *typ); -static OPT_Object OPT_InTProc (int8 mno); -static OPT_Struct OPT_InTyp (int32 tag); -export void OPT_Init (OPS_Name name, uint32 opt); +static OPT_Object OPT_InTProc (INT8 mno); +static OPT_Struct OPT_InTyp (INT32 tag); +export void OPT_Init (OPS_Name name, UINT32 opt); export void OPT_InitRecno (void); -static void OPT_InitStruct (OPT_Struct *typ, int8 form); +static void OPT_InitStruct (OPT_Struct *typ, INT8 form); export void OPT_Insert (OPS_Name name, OPT_Object *obj); export void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); -export int16 OPT_IntSize (int64 n); -export OPT_Struct OPT_IntType (int32 size); +export INT16 OPT_IntSize (INT64 n); +export OPT_Struct OPT_IntType (INT32 size); export OPT_Const OPT_NewConst (void); export OPT_ConstExt OPT_NewExt (void); -export OPT_Node OPT_NewNode (int8 class); +export OPT_Node OPT_NewNode (INT8 class); export OPT_Object OPT_NewObj (void); -export OPT_Struct OPT_NewStr (int8 form, int8 comp); -export void OPT_OpenScope (int8 level, OPT_Object owner); +export OPT_Struct OPT_NewStr (INT8 form, INT8 comp); +export void OPT_OpenScope (INT8 level, OPT_Object owner); static void OPT_OutConstant (OPT_Object obj); -static void OPT_OutFlds (OPT_Object fld, int32 adr, BOOLEAN visible); -static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, int32 adr); -static void OPT_OutMod (int16 mno); +static void OPT_OutFlds (OPT_Object fld, INT32 adr, BOOLEAN visible); +static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, INT32 adr); +static void OPT_OutMod (INT16 mno); static void OPT_OutName (CHAR *name, LONGINT name__len); static void OPT_OutObj (OPT_Object obj); static void OPT_OutSign (OPT_Struct result, OPT_Object par); static void OPT_OutStr (OPT_Struct typ); static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj); -export OPT_Struct OPT_SetType (int32 size); -export OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir); -export int32 OPT_SizeAlignment (int32 size); +export OPT_Struct OPT_SetType (INT32 size); +export OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INT16 dir); +export INT32 OPT_SizeAlignment (INT32 size); export void OPT_TypSize (OPT_Struct typ); -static void OPT_err (int16 n); +static void OPT_err (INT16 n); void OPT_InitRecno (void) @@ -172,14 +172,14 @@ void OPT_InitRecno (void) OPT_recno = 0; } -static void OPT_err (int16 n) +static void OPT_err (INT16 n) { OPM_err(n); } -int16 OPT_IntSize (int64 n) +INT16 OPT_IntSize (INT64 n) { - int16 bytes; + INT16 bytes; if (n < 0) { n = -(n + 1); } @@ -190,7 +190,7 @@ int16 OPT_IntSize (int64 n) return bytes; } -OPT_Struct OPT_IntType (int32 size) +OPT_Struct OPT_IntType (INT32 size) { if (size <= OPT_int8typ->size) { return OPT_int8typ; @@ -204,7 +204,7 @@ OPT_Struct OPT_IntType (int32 size) return OPT_int64typ; } -OPT_Struct OPT_SetType (int32 size) +OPT_Struct OPT_SetType (INT32 size) { if (size == OPT_set32typ->size) { return OPT_set32typ; @@ -212,9 +212,9 @@ OPT_Struct OPT_SetType (int32 size) return OPT_set64typ; } -OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir) +OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INT16 dir) { - int16 i; + INT16 i; __ASSERT(x->form == 4, 0); __ASSERT(x->BaseTyp == OPT_undftyp, 0); __ASSERT(dir == 1 || dir == -1, 0); @@ -244,7 +244,7 @@ OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir) __RETCHK; } -void OPT_Align (int32 *adr, int32 base) +void OPT_Align (INT32 *adr, INT32 base) { switch (base) { case 2: @@ -264,9 +264,9 @@ void OPT_Align (int32 *adr, int32 base) } } -int32 OPT_SizeAlignment (int32 size) +INT32 OPT_SizeAlignment (INT32 size) { - int32 alignment; + INT32 alignment; if (size < OPM_Alignment) { alignment = 1; while (alignment < size) { @@ -278,9 +278,9 @@ int32 OPT_SizeAlignment (int32 size) return alignment; } -int32 OPT_BaseAlignment (OPT_Struct typ) +INT32 OPT_BaseAlignment (OPT_Struct typ) { - int32 alignment; + INT32 alignment; if (typ->form == 13) { if (typ->comp == 4) { alignment = __MASK(typ->align, -65536); @@ -295,8 +295,8 @@ int32 OPT_BaseAlignment (OPT_Struct typ) void OPT_TypSize (OPT_Struct typ) { - int16 f, c; - int32 offset, size, base, fbase, off0; + INT16 f, c; + INT32 offset, size, base, fbase, off0; OPT_Object fld = NIL; OPT_Struct btyp = NIL; if (typ == OPT_undftyp) { @@ -339,7 +339,7 @@ void OPT_TypSize (OPT_Struct typ) } typ->size = offset; typ->align = base; - typ->sysflag = __MASK(typ->sysflag, -256) + (int16)__ASHL(offset - off0, 8); + typ->sysflag = __MASK(typ->sysflag, -256) + (INT16)__ASHL(offset - off0, 8); } else if (c == 2) { OPT_TypSize(typ->BaseTyp); typ->size = typ->n * typ->BaseTyp->size; @@ -378,7 +378,7 @@ OPT_Object OPT_NewObj (void) return obj; } -OPT_Struct OPT_NewStr (int8 form, int8 comp) +OPT_Struct OPT_NewStr (INT8 form, INT8 comp) { OPT_Struct typ = NIL; __NEW(typ, OPT_StrDesc); @@ -393,7 +393,7 @@ OPT_Struct OPT_NewStr (int8 form, int8 comp) return typ; } -OPT_Node OPT_NewNode (int8 class) +OPT_Node OPT_NewNode (INT8 class) { OPT_Node node = NIL; __NEW(node, OPT_NodeDesc); @@ -404,11 +404,11 @@ OPT_Node OPT_NewNode (int8 class) OPT_ConstExt OPT_NewExt (void) { OPT_ConstExt ext = NIL; - ext = __NEWARR(NIL, 1, 1, 1, 0, ((int64)(256))); + ext = __NEWARR(NIL, 1, 1, 1, 0, ((INT64)(256))); return ext; } -void OPT_OpenScope (int8 level, OPT_Object owner) +void OPT_OpenScope (INT8 level, OPT_Object owner) { OPT_Object head = NIL; head = OPT_NewObj(); @@ -429,7 +429,7 @@ void OPT_CloseScope (void) OPT_topScope = OPT_topScope->left; } -void OPT_Init (OPS_Name name, uint32 opt) +void OPT_Init (OPS_Name name, UINT32 opt) { OPT_topScope = OPT_universe; OPT_OpenScope(0, NIL); @@ -446,7 +446,7 @@ void OPT_Init (OPS_Name name, uint32 opt) void OPT_Close (void) { - int16 i; + INT16 i; OPT_CloseScope(); i = 0; while (i < 64) { @@ -538,7 +538,7 @@ void OPT_Insert (OPS_Name name, OPT_Object *obj) { OPT_Object ob0 = NIL, ob1 = NIL; BOOLEAN left; - int8 mnolev; + INT8 mnolev; ob0 = OPT_topScope; ob1 = ob0->right; left = 0; @@ -576,14 +576,14 @@ void OPT_Insert (OPS_Name name, OPT_Object *obj) *obj = ob1; } -static void OPT_FPrintName (int32 *fp, CHAR *name, LONGINT name__len) +static void OPT_FPrintName (INT32 *fp, CHAR *name, LONGINT name__len) { - int16 i; + INT16 i; CHAR ch; i = 0; do { ch = name[__X(i, name__len)]; - OPM_FPrint(&*fp, (int16)ch); + OPM_FPrint(&*fp, (INT16)ch); i += 1; } while (!(ch == 0x00)); } @@ -621,7 +621,7 @@ static void OPT_DebugStruct (OPT_Struct btyp) OPM_LogWLn(); } -static void OPT_FPrintSign (int32 *fp, OPT_Struct result, OPT_Object par) +static void OPT_FPrintSign (INT32 *fp, OPT_Struct result, OPT_Object par) { OPT_IdFPrint(result); OPM_FPrint(&*fp, result->idfp); @@ -637,8 +637,8 @@ void OPT_IdFPrint (OPT_Struct typ) { OPT_Struct btyp = NIL; OPT_Object strobj = NIL; - int32 idfp; - int16 f, c; + INT32 idfp; + INT16 f, c; if (!typ->idfpdone) { typ->idfpdone = 1; idfp = 0; @@ -667,17 +667,17 @@ void OPT_IdFPrint (OPT_Struct typ) } static struct FPrintStr__15 { - int32 *pbfp, *pvfp; + INT32 *pbfp, *pvfp; struct FPrintStr__15 *lnk; } *FPrintStr__15_s; -static void FPrintFlds__16 (OPT_Object fld, int32 adr, BOOLEAN visible); -static void FPrintHdFld__18 (OPT_Struct typ, OPT_Object fld, int32 adr); +static void FPrintFlds__16 (OPT_Object fld, INT32 adr, BOOLEAN visible); +static void FPrintHdFld__18 (OPT_Struct typ, OPT_Object fld, INT32 adr); static void FPrintTProcs__20 (OPT_Object obj); -static void FPrintHdFld__18 (OPT_Struct typ, OPT_Object fld, int32 adr) +static void FPrintHdFld__18 (OPT_Struct typ, OPT_Object fld, INT32 adr) { - int32 i, j, n; + INT32 i, j, n; OPT_Struct btyp = NIL; if (typ->comp == 4) { FPrintFlds__16(typ->link, adr, 0); @@ -707,7 +707,7 @@ static void FPrintHdFld__18 (OPT_Struct typ, OPT_Object fld, int32 adr) } } -static void FPrintFlds__16 (OPT_Object fld, int32 adr, BOOLEAN visible) +static void FPrintFlds__16 (OPT_Object fld, INT32 adr, BOOLEAN visible) { while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { @@ -742,10 +742,10 @@ static void FPrintTProcs__20 (OPT_Object obj) void OPT_FPrintStr (OPT_Struct typ) { - int16 f, c; + INT16 f, c; OPT_Struct btyp = NIL; OPT_Object strobj = NIL, bstrobj = NIL; - int32 pbfp, pvfp; + INT32 pbfp, pvfp; struct FPrintStr__15 _s; _s.pbfp = &pbfp; _s.pvfp = &pvfp; @@ -806,8 +806,8 @@ void OPT_FPrintStr (OPT_Struct typ) void OPT_FPrintObj (OPT_Object obj) { - int32 fprint; - int16 f, m; + INT32 fprint; + INT16 f, m; REAL rval; OPT_ConstExt ext = NIL; if (!obj->fpdone) { @@ -849,11 +849,11 @@ void OPT_FPrintObj (OPT_Object obj) } else if (obj->mode == 9) { OPT_FPrintSign(&fprint, obj->typ, obj->link); ext = obj->conval->ext; - m = (int16)(*ext)[0]; + m = (INT16)(*ext)[0]; f = 1; OPM_FPrint(&fprint, m); while (f <= m) { - OPM_FPrint(&fprint, (int16)(*ext)[__X(f, 256)]); + OPM_FPrint(&fprint, (INT16)(*ext)[__X(f, 256)]); f += 1; } } else if (obj->mode == 5) { @@ -864,9 +864,9 @@ void OPT_FPrintObj (OPT_Object obj) } } -void OPT_FPrintErr (OPT_Object obj, int16 errcode) +void OPT_FPrintErr (OPT_Object obj, INT16 errcode) { - int16 i, j; + INT16 i, j; CHAR ch; if (obj->mnolev != 0) { __COPY(OPT_GlbMod[__X(-obj->mnolev, 64)]->name, OPM_objname, 64); @@ -956,7 +956,7 @@ void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old) static void OPT_InName (CHAR *name, LONGINT name__len) { - int16 i; + INT16 i; CHAR ch; i = 0; do { @@ -966,12 +966,12 @@ static void OPT_InName (CHAR *name, LONGINT name__len) } while (!(ch == 0x00)); } -static void OPT_InMod (int8 *mno) +static void OPT_InMod (INT8 *mno) { OPT_Object head = NIL; OPS_Name name; - int32 mn; - int8 i; + INT32 mn; + INT8 i; mn = OPM_SymRInt(); if (mn == 0) { *mno = OPT_impCtxt.glbmno[0]; @@ -1008,16 +1008,16 @@ static void OPT_InMod (int8 *mno) } } -static void OPT_InConstant (int32 f, OPT_Const conval) +static void OPT_InConstant (INT32 f, OPT_Const conval) { CHAR ch; - int16 i; + INT16 i; OPT_ConstExt ext = NIL; REAL rval; switch (f) { case 1: case 3: case 2: OPM_SymRCh(&ch); - conval->intval = (int16)ch; + conval->intval = (INT16)ch; break; case 4: conval->intval = OPM_SymRInt(); @@ -1057,10 +1057,10 @@ static void OPT_InConstant (int32 f, OPT_Const conval) } } -static void OPT_InSign (int8 mno, OPT_Struct *res, OPT_Object *par) +static void OPT_InSign (INT8 mno, OPT_Struct *res, OPT_Object *par) { OPT_Object last = NIL, new = NIL; - int32 tag; + INT32 tag; OPT_InStruct(&*res); tag = OPM_SymRInt(); last = NIL; @@ -1087,7 +1087,7 @@ static void OPT_InSign (int8 mno, OPT_Struct *res, OPT_Object *par) static OPT_Object OPT_InFld (void) { - int32 tag; + INT32 tag; OPT_Object obj = NIL; tag = OPT_impCtxt.nextTag; obj = OPT_NewObj(); @@ -1115,9 +1115,9 @@ static OPT_Object OPT_InFld (void) return obj; } -static OPT_Object OPT_InTProc (int8 mno) +static OPT_Object OPT_InTProc (INT8 mno) { - int32 tag; + INT32 tag; OPT_Object obj = NIL; tag = OPT_impCtxt.nextTag; obj = OPT_NewObj(); @@ -1141,7 +1141,7 @@ static OPT_Object OPT_InTProc (int8 mno) return obj; } -static OPT_Struct OPT_InTyp (int32 tag) +static OPT_Struct OPT_InTyp (INT32 tag) { if (tag == 4) { return OPT_IntType(OPM_SymRInt()); @@ -1155,9 +1155,9 @@ static OPT_Struct OPT_InTyp (int32 tag) static void OPT_InStruct (OPT_Struct *typ) { - int8 mno; - int16 ref; - int32 tag; + INT8 mno; + INT16 ref; + INT32 tag; OPS_Name name; OPT_Struct t = NIL; OPT_Object obj = NIL, last = NIL, fld = NIL, old = NIL, dummy = NIL; @@ -1213,7 +1213,7 @@ static void OPT_InStruct (OPT_Struct *typ) obj->vis = 0; tag = OPM_SymRInt(); if (tag == 35) { - (*typ)->sysflag = (int16)OPM_SymRInt(); + (*typ)->sysflag = (INT16)OPM_SymRInt(); tag = OPM_SymRInt(); } switch (tag) { @@ -1335,13 +1335,13 @@ static void OPT_InStruct (OPT_Struct *typ) } } -static OPT_Object OPT_InObj (int8 mno) +static OPT_Object OPT_InObj (INT8 mno) { - int16 i, s; + INT16 i, s; CHAR ch; OPT_Object obj = NIL, old = NIL; OPT_Struct typ = NIL; - int32 tag; + INT32 tag; OPT_ConstExt ext = NIL; tag = OPT_impCtxt.nextTag; if (tag == 19) { @@ -1374,7 +1374,7 @@ static OPT_Object OPT_InObj (int8 mno) obj->mode = 9; ext = OPT_NewExt(); obj->conval->ext = ext; - s = (int16)OPM_SymRInt(); + s = (INT16)OPM_SymRInt(); (*ext)[0] = (CHAR)s; i = 1; while (i <= s) { @@ -1439,7 +1439,7 @@ static OPT_Object OPT_InObj (int8 mno) void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) { OPT_Object obj = NIL; - int8 mno; + INT8 mno; OPS_Name aliasName__copy; __DUPARR(aliasName, OPS_Name); if (__STRCMP(name, "SYSTEM") == 0) { @@ -1482,7 +1482,7 @@ void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) static void OPT_OutName (CHAR *name, LONGINT name__len) { - int16 i; + INT16 i; CHAR ch; i = 0; do { @@ -1492,7 +1492,7 @@ static void OPT_OutName (CHAR *name, LONGINT name__len) } while (!(ch == 0x00)); } -static void OPT_OutMod (int16 mno) +static void OPT_OutMod (INT16 mno) { if (OPT_expCtxt.locmno[__X(mno, 64)] < 0) { OPM_SymWInt(16); @@ -1504,9 +1504,9 @@ static void OPT_OutMod (int16 mno) } } -static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, int32 adr) +static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, INT32 adr) { - int32 i, j, n; + INT32 i, j, n; OPT_Struct btyp = NIL; if (typ->comp == 4) { OPT_OutFlds(typ->link, adr, 0); @@ -1536,7 +1536,7 @@ static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, int32 adr) } } -static void OPT_OutFlds (OPT_Object fld, int32 adr, BOOLEAN visible) +static void OPT_OutFlds (OPT_Object fld, INT32 adr, BOOLEAN visible) { while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { @@ -1691,7 +1691,7 @@ static void OPT_OutStr (OPT_Struct typ) static void OPT_OutConstant (OPT_Object obj) { - int16 f; + INT16 f; REAL rval; f = obj->typ->form; OPM_SymWInt(f); @@ -1727,7 +1727,7 @@ static void OPT_OutConstant (OPT_Object obj) static void OPT_OutObj (OPT_Object obj) { - int16 i, j; + INT16 i, j; OPT_ConstExt ext = NIL; if (obj != NIL) { OPT_OutObj(obj->left); @@ -1794,7 +1794,7 @@ static void OPT_OutObj (OPT_Object obj) OPM_SymWInt(33); OPT_OutSign(obj->typ, obj->link); ext = obj->conval->ext; - j = (int16)(*ext)[0]; + j = (INT16)(*ext)[0]; i = 1; OPM_SymWInt(j); while (i <= j) { @@ -1817,8 +1817,8 @@ static void OPT_OutObj (OPT_Object obj) void OPT_Export (BOOLEAN *ext, BOOLEAN *new) { - int16 i; - int8 nofmod; + INT16 i; + INT8 nofmod; BOOLEAN done; OPT_symExtended = 0; OPT_symNew = 0; @@ -1857,7 +1857,7 @@ void OPT_Export (BOOLEAN *ext, BOOLEAN *new) } } -static void OPT_InitStruct (OPT_Struct *typ, int8 form) +static void OPT_InitStruct (OPT_Struct *typ, INT8 form) { *typ = OPT_NewStr(form, 1); (*typ)->ref = form; @@ -1871,7 +1871,7 @@ static void OPT_InitStruct (OPT_Struct *typ, int8 form) (*typ)->idfpdone = 1; } -static void OPT_EnterBoolConst (OPS_Name name, int32 value) +static void OPT_EnterBoolConst (OPS_Name name, INT32 value) { OPT_Object obj = NIL; OPS_Name name__copy; @@ -1883,7 +1883,7 @@ static void OPT_EnterBoolConst (OPS_Name name, int32 value) obj->conval->intval = value; } -static void OPT_EnterTyp (OPS_Name name, int8 form, int16 size, OPT_Struct *res) +static void OPT_EnterTyp (OPS_Name name, INT8 form, INT16 size, OPT_Struct *res) { OPT_Object obj = NIL; OPT_Struct typ = NIL; @@ -1918,7 +1918,7 @@ static void OPT_EnterTypeAlias (OPS_Name name, OPT_Object *res) *res = obj; } -static void OPT_EnterProc (OPS_Name name, int16 num) +static void OPT_EnterProc (OPS_Name name, INT16 num) { OPT_Object obj = NIL; OPS_Name name__copy; diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 38cd17c7..66f25d3d 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h @@ -15,9 +15,9 @@ typedef typedef struct OPT_ConstDesc { OPT_ConstExt ext; - int64 intval; - int32 intval2; - uint64 setval; + INT64 intval; + INT32 intval2; + UINT64 setval; LONGREAL realval; } OPT_ConstDesc; @@ -33,7 +33,7 @@ typedef typedef struct OPT_NodeDesc { OPT_Node left, right, link; - int8 class, subcl; + INT8 class, subcl; BOOLEAN readonly; OPT_Struct typ; OPT_Object obj; @@ -45,20 +45,20 @@ typedef OPT_Object left, right, link, scope; OPS_Name name; BOOLEAN leaf; - int8 mode, mnolev, vis, history; + INT8 mode, mnolev, vis, history; BOOLEAN used, fpdone; - int32 fprint; + INT32 fprint; OPT_Struct typ; OPT_Const conval; - int32 adr, linkadr; - int16 x; + INT32 adr, linkadr; + INT16 x; } OPT_ObjDesc; typedef struct OPT_StrDesc { - int8 form, comp, mno, extlev; - int16 ref, sysflag; - int32 n, size, align, txtpos; + INT8 form, comp, mno, extlev; + INT16 ref, sysflag; + INT32 n, size, align, txtpos; BOOLEAN allocated, pbused, pvused; char _prvt0[16]; OPT_Struct BaseTyp; @@ -69,22 +69,22 @@ typedef import OPT_Object OPT_topScope; import OPT_Struct OPT_undftyp, OPT_niltyp, OPT_notyp, OPT_bytetyp, OPT_cpbytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_settyp, OPT_set32typ, OPT_set64typ, OPT_realtyp, OPT_lrltyp, OPT_stringtyp, OPT_adrtyp, OPT_sysptrtyp; import OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj, OPT_setobj; -import int8 OPT_nofGmod; +import INT8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; import BOOLEAN OPT_SYSimported; -import address *OPT_ConstDesc__typ; -import address *OPT_ObjDesc__typ; -import address *OPT_StrDesc__typ; -import address *OPT_NodeDesc__typ; +import ADDRESS *OPT_ConstDesc__typ; +import ADDRESS *OPT_ObjDesc__typ; +import ADDRESS *OPT_StrDesc__typ; +import ADDRESS *OPT_NodeDesc__typ; -import void OPT_Align (int32 *adr, int32 base); -import int32 OPT_BaseAlignment (OPT_Struct typ); +import void OPT_Align (INT32 *adr, INT32 base); +import INT32 OPT_BaseAlignment (OPT_Struct typ); import void OPT_Close (void); import void OPT_CloseScope (void); import void OPT_Export (BOOLEAN *ext, BOOLEAN *new); -import void OPT_FPrintErr (OPT_Object obj, int16 errcode); +import void OPT_FPrintErr (OPT_Object obj, INT16 errcode); import void OPT_FPrintObj (OPT_Object obj); import void OPT_FPrintStr (OPT_Struct typ); import void OPT_Find (OPT_Object *res); @@ -92,21 +92,21 @@ import void OPT_FindField (OPS_Name name, OPT_Struct typ, OPT_Object *res); import void OPT_FindImport (OPT_Object mod, OPT_Object *res); import void OPT_IdFPrint (OPT_Struct typ); import void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); -import void OPT_Init (OPS_Name name, uint32 opt); +import void OPT_Init (OPS_Name name, UINT32 opt); import void OPT_InitRecno (void); import void OPT_Insert (OPS_Name name, OPT_Object *obj); import void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); -import int16 OPT_IntSize (int64 n); -import OPT_Struct OPT_IntType (int32 size); +import INT16 OPT_IntSize (INT64 n); +import OPT_Struct OPT_IntType (INT32 size); import OPT_Const OPT_NewConst (void); import OPT_ConstExt OPT_NewExt (void); -import OPT_Node OPT_NewNode (int8 class); +import OPT_Node OPT_NewNode (INT8 class); import OPT_Object OPT_NewObj (void); -import OPT_Struct OPT_NewStr (int8 form, int8 comp); -import void OPT_OpenScope (int8 level, OPT_Object owner); -import OPT_Struct OPT_SetType (int32 size); -import OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir); -import int32 OPT_SizeAlignment (int32 size); +import OPT_Struct OPT_NewStr (INT8 form, INT8 comp); +import void OPT_OpenScope (INT8 level, OPT_Object owner); +import OPT_Struct OPT_SetType (INT32 size); +import OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INT16 dir); +import INT32 OPT_SizeAlignment (INT32 size); import void OPT_TypSize (OPT_Struct typ); import void *OPT__init(void); diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 452a1182..ee84e643 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "OPC.h" @@ -13,42 +13,42 @@ typedef struct OPV_ExitInfo { - int16 level, label; + INT16 level, label; } OPV_ExitInfo; -static int16 OPV_stamp; +static INT16 OPV_stamp; static OPV_ExitInfo OPV_exit; -static int16 OPV_nofExitLabels; +static INT16 OPV_nofExitLabels; -export address *OPV_ExitInfo__typ; +export ADDRESS *OPV_ExitInfo__typ; static void OPV_ActualPar (OPT_Node n, OPT_Object fp); export void OPV_AdrAndSize (OPT_Object topScope); static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc); -static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int16 prec); +static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INT16 prec); static void OPV_DefineTDescs (OPT_Node n); -static void OPV_Entier (OPT_Node n, int16 prec); +static void OPV_Entier (OPT_Node n, INT16 prec); static void OPV_GetTProcNum (OPT_Object obj); static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc); static BOOLEAN OPV_ImplicitReturn (OPT_Node n); -static void OPV_Index (OPT_Node n, OPT_Node d, int16 prec, int16 dim); +static void OPV_Index (OPT_Node n, OPT_Node d, INT16 prec, INT16 dim); export void OPV_Init (void); static void OPV_InitTDescs (OPT_Node n); -static void OPV_Len (OPT_Node n, int64 dim); +static void OPV_Len (OPT_Node n, INT64 dim); export void OPV_Module (OPT_Node prog); static void OPV_NewArr (OPT_Node d, OPT_Node x); -static void OPV_ParIntLiteral (int64 n, int32 size); -static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp); +static void OPV_ParIntLiteral (INT64 n, INT32 size); +static INT16 OPV_Precedence (INT16 class, INT16 subclass, INT16 form, INT16 comp); static BOOLEAN OPV_SideEffects (OPT_Node n); -static void OPV_SizeCast (OPT_Node n, int32 to); +static void OPV_SizeCast (OPT_Node n, INT32 to); static void OPV_Stamp (OPS_Name s); static OPT_Object OPV_SuperProc (OPT_Node n); static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported); static void OPV_TraverseRecord (OPT_Struct typ); static void OPV_TypeOf (OPT_Node n); -static void OPV_design (OPT_Node n, int16 prec); -static void OPV_expr (OPT_Node n, int16 prec); +static void OPV_design (OPT_Node n, INT16 prec); +static void OPV_expr (OPT_Node n, INT16 prec); static void OPV_stat (OPT_Node n, OPT_Object outerProc); @@ -60,7 +60,7 @@ void OPV_Init (void) static void OPV_GetTProcNum (OPT_Object obj) { - int32 oldPos; + INT32 oldPos; OPT_Struct typ = NIL; OPT_Object redef = NIL; oldPos = OPM_errpos; @@ -96,7 +96,7 @@ static void OPV_TraverseRecord (OPT_Struct typ) static void OPV_Stamp (OPS_Name s) { - int16 i, j, k; + INT16 i, j, k; CHAR n[10]; OPV_stamp += 1; i = 0; @@ -126,7 +126,7 @@ static void OPV_Stamp (OPS_Name s) static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported) { - int16 mode; + INT16 mode; OPT_Object scope = NIL; OPT_Struct typ = NIL; if (obj != NIL) { @@ -205,7 +205,7 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_sysptrtyp->strobj->linkadr = 2; } -static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp) +static INT16 OPV_Precedence (INT16 class, INT16 subclass, INT16 form, INT16 comp) { switch (class) { case 7: case 0: case 2: case 4: case 9: @@ -315,7 +315,7 @@ static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp __RETCHK; } -static void OPV_Len (OPT_Node n, int64 dim) +static void OPV_Len (OPT_Node n, INT64 dim) { while ((n->class == 4 && n->typ->comp == 3)) { dim += 1; @@ -341,7 +341,7 @@ static BOOLEAN OPV_SideEffects (OPT_Node n) __RETCHK; } -static void OPV_Entier (OPT_Node n, int16 prec) +static void OPV_Entier (OPT_Node n, INT16 prec) { if (__IN(n->typ->form, 0x60, 32)) { OPM_WriteString((CHAR*)"__ENTIER(", 10); @@ -352,7 +352,7 @@ static void OPV_Entier (OPT_Node n, int16 prec) } } -static void OPV_SizeCast (OPT_Node n, int32 to) +static void OPV_SizeCast (OPT_Node n, INT32 to) { if ((to < n->typ->size && __IN(2, OPM_Options, 32))) { OPM_WriteString((CHAR*)"__SHORT", 8); @@ -366,16 +366,16 @@ static void OPV_SizeCast (OPT_Node n, int32 to) OPM_Write(')'); } else { if ((n->typ->size != to && (n->typ->size > 4 || to != 4))) { - OPM_WriteString((CHAR*)"(int", 5); + OPM_WriteString((CHAR*)"(INT", 5); OPM_WriteInt(__ASHL(to, 3)); OPM_WriteString((CHAR*)")", 2); } } } -static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int16 prec) +static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INT16 prec) { - int16 from, to; + INT16 from, to; from = n->typ->form; to = newtype->form; if (to == 7) { @@ -432,7 +432,7 @@ static void OPV_TypeOf (OPT_Node n) } } -static void OPV_Index (OPT_Node n, OPT_Node d, int16 prec, int16 dim) +static void OPV_Index (OPT_Node n, OPT_Node d, INT16 prec, INT16 dim) { if (!__IN(0, OPM_Options, 32) || (n->right->class == 7 && (n->right->conval->intval == 0 || n->left->typ->comp != 3))) { OPV_expr(n->right, prec); @@ -449,18 +449,18 @@ static void OPV_Index (OPT_Node n, OPT_Node d, int16 prec, int16 dim) } } -static void OPV_design (OPT_Node n, int16 prec) +static void OPV_design (OPT_Node n, INT16 prec) { OPT_Object obj = NIL; OPT_Struct typ = NIL; - int16 class, designPrec, comp; + INT16 class, designPrec, comp; OPT_Node d = NIL, x = NIL; - int16 dims, i, _for__26; + INT16 dims, i, _for__26; comp = n->typ->comp; obj = n->obj; class = n->class; designPrec = OPV_Precedence(class, n->subcl, n->typ->form, comp); - if ((((((class == 0 && obj->mnolev > 0)) && (int16)obj->mnolev != OPM_level)) && prec == 10)) { + if ((((((class == 0 && obj->mnolev > 0)) && (INT16)obj->mnolev != OPM_level)) && prec == 10)) { designPrec = 9; } if (prec > designPrec) { @@ -559,7 +559,7 @@ static void OPV_design (OPT_Node n, int16 prec) if (__IN(3, OPM_Options, 32)) { if (typ->comp == 4) { OPM_WriteString((CHAR*)"__GUARDR(", 10); - if ((int16)obj->mnolev != OPM_level) { + if ((INT16)obj->mnolev != OPM_level) { OPM_WriteStringVar((void*)obj->scope->name, 256); OPM_WriteString((CHAR*)"__curr->", 9); OPC_Ident(obj); @@ -628,7 +628,7 @@ static void OPV_design (OPT_Node n, int16 prec) } } -static void OPV_ParIntLiteral (int64 n, int32 size) +static void OPV_ParIntLiteral (INT64 n, INT32 size) { OPM_WriteInt(n); } @@ -636,7 +636,7 @@ static void OPV_ParIntLiteral (int64 n, int32 size) static void OPV_ActualPar (OPT_Node n, OPT_Object fp) { OPT_Struct typ = NIL, aptyp = NIL; - int16 comp, form, mode, prec, dim; + INT16 comp, form, mode, prec, dim; OPM_Write('('); while (n != NIL) { typ = fp->typ; @@ -726,9 +726,9 @@ static OPT_Object OPV_SuperProc (OPT_Node n) return obj; } -static void OPV_expr (OPT_Node n, int16 prec) +static void OPV_expr (OPT_Node n, INT16 prec) { - int16 class, subclass, form, exprPrec; + INT16 class, subclass, form, exprPrec; OPT_Struct typ = NIL; OPT_Node l = NIL, r = NIL; OPT_Object proc = NIL; @@ -1050,7 +1050,7 @@ static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) OPT_Node if_ = NIL; OPT_Object obj = NIL; OPT_Struct typ = NIL; - int32 adr; + INT32 adr; if_ = n->left; while (if_ != NIL) { OPM_WriteString((CHAR*)"if ", 4); @@ -1100,8 +1100,8 @@ static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc) { OPT_Node switchCase = NIL, label = NIL; - int64 low, high; - int16 form, i; + INT64 low, high; + INT16 form, i; OPM_WriteString((CHAR*)"switch ", 8); OPV_expr(n->left, 12); OPM_Write(' '); @@ -1166,7 +1166,7 @@ static BOOLEAN OPV_ImplicitReturn (OPT_Node n) static void OPV_NewArr (OPT_Node d, OPT_Node x) { OPT_Struct typ = NIL, base = NIL; - int16 nofdim, nofdyn; + INT16 nofdim, nofdyn; typ = d->typ->BaseTyp; base = typ; nofdim = 0; diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index 2fa9186d..513d8dfa 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Out.c b/bootstrap/windows-88/Out.c index 6098e568..03213c6a 100644 --- a/bootstrap/windows-88/Out.c +++ b/bootstrap/windows-88/Out.c @@ -1,37 +1,37 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "Platform.h" static CHAR Out_buf[128]; -static int16 Out_in; +static INT16 Out_in; export void Out_Char (CHAR ch); export void Out_Flush (void); -export void Out_Int (int64 x, int64 n); -static int32 Out_Length (CHAR *s, LONGINT s__len); +export void Out_Int (INT64 x, INT64 n); +static INT32 Out_Length (CHAR *s, LONGINT s__len); export void Out_Ln (void); -export void Out_LongReal (LONGREAL x, int16 n); +export void Out_LongReal (LONGREAL x, INT16 n); export void Out_Open (void); -export void Out_Real (REAL x, int16 n); -static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_); +export void Out_Real (REAL x, INT16 n); +static void Out_RealP (LONGREAL x, INT16 n, BOOLEAN long_); export void Out_String (CHAR *str, LONGINT str__len); -export LONGREAL Out_Ten (int16 e); -static void Out_digit (int64 n, CHAR *s, LONGINT s__len, int16 *i); -static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16 *i); +export LONGREAL Out_Ten (INT16 e); +static void Out_digit (INT64 n, CHAR *s, LONGINT s__len, INT16 *i); +static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, INT16 *i); #define Out_Entier64(x) (int64)(x) void Out_Flush (void) { - int16 error; + INT16 error; if (Out_in > 0) { error = Platform_Write(Platform_StdOut, (address)Out_buf, Out_in); } @@ -54,9 +54,9 @@ void Out_Char (CHAR ch) } } -static int32 Out_Length (CHAR *s, LONGINT s__len) +static INT32 Out_Length (CHAR *s, LONGINT s__len) { - int32 l; + INT32 l; l = 0; while ((l < s__len && s[__X(l, s__len)] != 0x00)) { l += 1; @@ -66,8 +66,8 @@ static int32 Out_Length (CHAR *s, LONGINT s__len) void Out_String (CHAR *str, LONGINT str__len) { - int32 l; - int16 error; + INT32 l; + INT16 error; __DUP(str, str__len, CHAR); l = Out_Length((void*)str, str__len); if (Out_in + l > 128) { @@ -77,15 +77,15 @@ void Out_String (CHAR *str, LONGINT str__len) error = Platform_Write(Platform_StdOut, (address)str, l); } else { __MOVE((address)str, (address)&Out_buf[__X(Out_in, 128)], l); - Out_in += (int16)l; + Out_in += (INT16)l; } __DEL(str); } -void Out_Int (int64 x, int64 n) +void Out_Int (INT64 x, INT64 n) { CHAR s[22]; - int16 i; + INT16 i; BOOLEAN negative; negative = x < 0; if (x == (-9223372036854775807-1)) { @@ -108,7 +108,7 @@ void Out_Int (int64 x, int64 n) s[__X(i, 22)] = '-'; i += 1; } - while (n > (int64)i) { + while (n > (INT64)i) { Out_Char(' '); n -= 1; } @@ -124,22 +124,22 @@ void Out_Ln (void) Out_Flush(); } -static void Out_digit (int64 n, CHAR *s, LONGINT s__len, int16 *i) +static void Out_digit (INT64 n, CHAR *s, LONGINT s__len, INT16 *i) { *i -= 1; s[__X(*i, s__len)] = (CHAR)(__MOD(n, 10) + 48); } -static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16 *i) +static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, INT16 *i) { - int16 j; - int32 l; + INT16 j; + INT32 l; __DUP(t, t__len, CHAR); l = Out_Length((void*)t, t__len); if (l > *i) { l = *i; } - *i -= (int16)l; + *i -= (INT16)l; j = 0; while (j < l) { s[__X(*i + j, s__len)] = t[__X(j, t__len)]; @@ -148,7 +148,7 @@ static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16 __DEL(t); } -LONGREAL Out_Ten (int16 e) +LONGREAL Out_Ten (INT16 e) { LONGREAL r, power; r = (LONGREAL)1; @@ -163,19 +163,19 @@ LONGREAL Out_Ten (int16 e) return r; } -static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_) +static void Out_RealP (LONGREAL x, INT16 n, BOOLEAN long_) { - int16 e; - int64 f; + INT16 e; + INT64 f; CHAR s[30]; - int16 i, el; + INT16 i, el; LONGREAL x0; BOOLEAN nn, en; - int64 m; - int16 d, dr; - e = (int16)__MASK(__ASHR((__VAL(int64, x)), 52), -2048); - f = __MASK((__VAL(int64, x)), -4503599627370496); - nn = (__VAL(int64, x) < 0 && !((e == 2047 && f != 0))); + INT64 m; + INT16 d, dr; + e = (INT16)__MASK(__ASHR((__VAL(INT64, x)), 52), -2048); + f = __MASK((__VAL(INT64, x)), -4503599627370496); + nn = (__VAL(INT64, x) < 0 && !((e == 2047 && f != 0))); if (nn) { n -= 1; } @@ -221,7 +221,7 @@ static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_) if (nn) { x = -x; } - e = (int16)__ASHR((e - 1023) * 77, 8); + e = (INT16)__ASHR((e - 1023) * 77, 8); if (e >= 0) { x = x / (LONGREAL)Out_Ten(e); } else { @@ -291,12 +291,12 @@ static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_) } } -void Out_Real (REAL x, int16 n) +void Out_Real (REAL x, INT16 n) { Out_RealP(x, n, 0); } -void Out_LongReal (LONGREAL x, int16 n) +void Out_LongReal (LONGREAL x, INT16 n) { Out_RealP(x, n, 1); } diff --git a/bootstrap/windows-88/Out.h b/bootstrap/windows-88/Out.h index fbaed75f..a685b291 100644 --- a/bootstrap/windows-88/Out.h +++ b/bootstrap/windows-88/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h @@ -10,13 +10,13 @@ import void Out_Char (CHAR ch); import void Out_Flush (void); -import void Out_Int (int64 x, int64 n); +import void Out_Int (INT64 x, INT64 n); import void Out_Ln (void); -import void Out_LongReal (LONGREAL x, int16 n); +import void Out_LongReal (LONGREAL x, INT16 n); import void Out_Open (void); -import void Out_Real (REAL x, int16 n); +import void Out_Real (REAL x, INT16 n); import void Out_String (CHAR *str, LONGINT str__len); -import LONGREAL Out_Ten (int16 e); +import LONGREAL Out_Ten (INT16 e); import void *Out__init(void); diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 9eee96c2..c154f33b 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" @@ -14,92 +14,92 @@ typedef Platform_ArgPtr (*Platform_ArgVec)[1024]; typedef - int64 (*Platform_ArgVecPtr)[1]; + INT64 (*Platform_ArgVecPtr)[1]; typedef CHAR (*Platform_EnvPtr)[1024]; typedef struct Platform_FileIdentity { - int32 volume, indexhigh, indexlow, mtimehigh, mtimelow; + INT32 volume, indexhigh, indexlow, mtimehigh, mtimelow; } Platform_FileIdentity; typedef - void (*Platform_HaltProcedure)(int32); + void (*Platform_HaltProcedure)(INT32); typedef - void (*Platform_SignalHandler)(int32); + void (*Platform_SignalHandler)(INT32); export BOOLEAN Platform_LittleEndian; -export int64 Platform_MainStackFrame; -export int32 Platform_HaltCode; -export int16 Platform_PID; +export INT64 Platform_MainStackFrame; +export INT32 Platform_HaltCode; +export INT16 Platform_PID; export CHAR Platform_CWD[4096]; -export int16 Platform_ArgCount; -export int64 Platform_ArgVector; +export INT16 Platform_ArgCount; +export INT64 Platform_ArgVector; static Platform_HaltProcedure Platform_HaltHandler; -static int32 Platform_TimeStart; -export int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; -export int32 Platform_StdIn, Platform_StdOut, Platform_StdErr; +static INT32 Platform_TimeStart; +export INT16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; +export INT32 Platform_StdIn, Platform_StdOut, Platform_StdErr; static Platform_SignalHandler Platform_InterruptHandler; export CHAR Platform_NL[3]; -export address *Platform_FileIdentity__typ; +export ADDRESS *Platform_FileIdentity__typ; -export BOOLEAN Platform_Absent (int16 e); -export int16 Platform_ArgPos (CHAR *s, LONGINT s__len); -export void Platform_AssertFail (int32 code); -export int16 Platform_Chdir (CHAR *n, LONGINT n__len); -export int16 Platform_Close (int32 h); -export BOOLEAN Platform_ConnectionFailed (int16 e); -export void Platform_Delay (int32 ms); -export BOOLEAN Platform_DifferentFilesystems (int16 e); -static void Platform_DisplayHaltCode (int32 code); -export int16 Platform_Error (void); -export void Platform_Exit (int16 code); -export void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len); -export void Platform_GetClock (int32 *t, int32 *d); +export BOOLEAN Platform_Absent (INT16 e); +export INT16 Platform_ArgPos (CHAR *s, LONGINT s__len); +export void Platform_AssertFail (INT32 code); +export INT16 Platform_Chdir (CHAR *n, LONGINT n__len); +export INT16 Platform_Close (INT32 h); +export BOOLEAN Platform_ConnectionFailed (INT16 e); +export void Platform_Delay (INT32 ms); +export BOOLEAN Platform_DifferentFilesystems (INT16 e); +static void Platform_DisplayHaltCode (INT32 code); +export INT16 Platform_Error (void); +export void Platform_Exit (INT16 code); +export void Platform_GetArg (INT16 n, CHAR *val, LONGINT val__len); +export void Platform_GetClock (INT32 *t, INT32 *d); export void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); -export void Platform_GetIntArg (int16 n, int32 *val); -export void Platform_GetTimeOfDay (int32 *sec, int32 *usec); -export void Platform_Halt (int32 code); -export int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ); -export int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); -export BOOLEAN Platform_Inaccessible (int16 e); -export void Platform_Init (int32 argc, int64 argvadr); -export BOOLEAN Platform_Interrupted (int16 e); -export void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); -export int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); -export BOOLEAN Platform_NoSuchDirectory (int16 e); -export int64 Platform_OSAllocate (int64 size); -export void Platform_OSFree (int64 address); -export int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); -export int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); -export int16 Platform_Read (int32 h, int64 p, int32 l, int32 *n); -export int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n); -export int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); +export void Platform_GetIntArg (INT16 n, INT32 *val); +export void Platform_GetTimeOfDay (INT32 *sec, INT32 *usec); +export void Platform_Halt (INT32 code); +export INT16 Platform_Identify (INT32 h, Platform_FileIdentity *identity, ADDRESS *identity__typ); +export INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ); +export BOOLEAN Platform_Inaccessible (INT16 e); +export void Platform_Init (INT32 argc, INT64 argvadr); +export BOOLEAN Platform_Interrupted (INT16 e); +export void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d); +export INT16 Platform_New (CHAR *n, LONGINT n__len, INT32 *h); +export BOOLEAN Platform_NoSuchDirectory (INT16 e); +export INT64 Platform_OSAllocate (INT64 size); +export void Platform_OSFree (INT64 address); +export INT16 Platform_OldRO (CHAR *n, LONGINT n__len, INT32 *h); +export INT16 Platform_OldRW (CHAR *n, LONGINT n__len, INT32 *h); +export INT16 Platform_Read (INT32 h, INT64 p, INT32 l, INT32 *n); +export INT16 Platform_ReadBuf (INT32 h, SYSTEM_BYTE *b, LONGINT b__len, INT32 *n); +export INT16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); export BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); export BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); -export int16 Platform_Seek (int32 h, int32 o, int16 r); +export INT16 Platform_Seek (INT32 h, INT32 o, INT16 r); export void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); export void Platform_SetHalt (Platform_HaltProcedure p); -export void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Platform_FileIdentity source); -export int16 Platform_Size (int32 h, int32 *l); -export int16 Platform_Sync (int32 h); -export int16 Platform_System (CHAR *cmd, LONGINT cmd__len); +export void Platform_SetMTime (Platform_FileIdentity *target, ADDRESS *target__typ, Platform_FileIdentity source); +export INT16 Platform_Size (INT32 h, INT32 *l); +export INT16 Platform_Sync (INT32 h); +export INT16 Platform_System (CHAR *cmd, LONGINT cmd__len); static void Platform_TestLittleEndian (void); -export int32 Platform_Time (void); -export BOOLEAN Platform_TimedOut (int16 e); -export BOOLEAN Platform_TooManyFiles (int16 e); -export int16 Platform_Truncate (int32 h, int32 limit); -export int16 Platform_Unlink (CHAR *n, LONGINT n__len); -export int16 Platform_Write (int32 h, int64 p, int32 l); -static void Platform_YMDHMStoClock (int16 ye, int16 mo, int16 da, int16 ho, int16 mi, int16 se, int32 *t, int32 *d); +export INT32 Platform_Time (void); +export BOOLEAN Platform_TimedOut (INT16 e); +export BOOLEAN Platform_TooManyFiles (INT16 e); +export INT16 Platform_Truncate (INT32 h, INT32 limit); +export INT16 Platform_Unlink (CHAR *n, LONGINT n__len); +export INT16 Platform_Write (INT32 h, INT64 p, INT32 l); +static void Platform_YMDHMStoClock (INT16 ye, INT16 mo, INT16 da, INT16 ho, INT16 mi, INT16 se, INT32 *t, INT32 *d); static void Platform_errch (CHAR c); -static void Platform_errint (int32 l); +static void Platform_errint (INT32 l); static void Platform_errln (void); -static void Platform_errposint (int32 l); +static void Platform_errposint (INT32 l); export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); #include "WindowsWrapper.h" @@ -118,11 +118,11 @@ export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT #define Platform_ERRORWRITEPROTECT() ERROR_WRITE_PROTECT #define Platform_ETIMEDOUT() WSAETIMEDOUT extern void Heap_InitHeap(); -#define Platform_GetTickCount() (LONGINT)(uint32)GetTickCount() +#define Platform_GetTickCount() (LONGINT)(UINT32)GetTickCount() #define Platform_HeapInitHeap() Heap_InitHeap() -#define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((address)h) -#define Platform_SetQuitHandler(h) SystemSetQuitHandler((address)h) -#define Platform_allocate(size) (address)((void*)HeapAlloc(GetProcessHeap(), 0, (size_t)size)) +#define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((ADDRESS)h) +#define Platform_SetQuitHandler(h) SystemSetQuitHandler((ADDRESS)h) +#define Platform_allocate(size) (ADDRESS)((void*)HeapAlloc(GetProcessHeap(), 0, (size_t)size)) #define Platform_bhfiIndexHigh() (LONGINT)bhfi.nFileIndexHigh #define Platform_bhfiIndexLow() (LONGINT)bhfi.nFileIndexLow #define Platform_bhfiMtimeHigh() (LONGINT)bhfi.ftLastWriteTime.dwHighDateTime @@ -130,44 +130,44 @@ extern void Heap_InitHeap(); #define Platform_bhfiVsn() (LONGINT)bhfi.dwVolumeSerialNumber #define Platform_byHandleFileInformation() BY_HANDLE_FILE_INFORMATION bhfi #define Platform_cleanupProcess() CloseHandle(pi.hProcess); CloseHandle(pi.hThread); -#define Platform_closeHandle(h) (INTEGER)CloseHandle((HANDLE)(address)h) +#define Platform_closeHandle(h) (INTEGER)CloseHandle((HANDLE)(ADDRESS)h) #define Platform_createProcess(str, str__len) (INTEGER)CreateProcess(0, (char*)str, 0,0,0,0,0,0,&si,&pi) #define Platform_deleteFile(n, n__len) (INTEGER)DeleteFile((char*)n) #define Platform_err() (INTEGER)GetLastError() -#define Platform_errc(c) WriteFile((HANDLE)(address)Platform_StdOut, &c, 1, 0,0) -#define Platform_errstring(s, s__len) WriteFile((HANDLE)(address)Platform_StdOut, s, s__len-1, 0,0) +#define Platform_errc(c) WriteFile((HANDLE)(ADDRESS)Platform_StdOut, &c, 1, 0,0) +#define Platform_errstring(s, s__len) WriteFile((HANDLE)(ADDRESS)Platform_StdOut, s, s__len-1, 0,0) #define Platform_exit(code) ExitProcess((UINT)code) #define Platform_fileTimeToSysTime() SYSTEMTIME st; FileTimeToSystemTime(&ft, &st) -#define Platform_flushFileBuffers(h) (INTEGER)FlushFileBuffers((HANDLE)(address)h) +#define Platform_flushFileBuffers(h) (INTEGER)FlushFileBuffers((HANDLE)(ADDRESS)h) #define Platform_free(address) HeapFree(GetProcessHeap(), 0, (void*)address) #define Platform_ftToUli() ULARGE_INTEGER ul; ul.LowPart=ft.dwLowDateTime; ul.HighPart=ft.dwHighDateTime #define Platform_getCurrentDirectory(n, n__len) GetCurrentDirectory(n__len, (char*)n) #define Platform_getExitCodeProcess(exitcode) GetExitCodeProcess(pi.hProcess, (DWORD*)exitcode); -#define Platform_getFileInformationByHandle(h) (INTEGER)GetFileInformationByHandle((HANDLE)(address)h, &bhfi) -#define Platform_getFilePos(h, r, rc) LARGE_INTEGER liz = {0}; *rc = (INTEGER)SetFilePointerEx((HANDLE)(address)h, liz, &li, FILE_CURRENT); *r = (LONGINT)li.QuadPart -#define Platform_getFileSize(h) (INTEGER)GetFileSizeEx((HANDLE)(address)h, &li) +#define Platform_getFileInformationByHandle(h) (INTEGER)GetFileInformationByHandle((HANDLE)(ADDRESS)h, &bhfi) +#define Platform_getFilePos(h, r, rc) LARGE_INTEGER liz = {0}; *rc = (INTEGER)SetFilePointerEx((HANDLE)(ADDRESS)h, liz, &li, FILE_CURRENT); *r = (LONGINT)li.QuadPart +#define Platform_getFileSize(h) (INTEGER)GetFileSizeEx((HANDLE)(ADDRESS)h, &li) #define Platform_getLocalTime() SYSTEMTIME st; GetLocalTime(&st) #define Platform_getenv(name, name__len, buf, buf__len) (INTEGER)GetEnvironmentVariable((char*)name, (char*)buf, buf__len) #define Platform_getpid() (INTEGER)GetCurrentProcessId() -#define Platform_getstderrhandle() (LONGINT)(address)GetStdHandle(STD_ERROR_HANDLE) -#define Platform_getstdinhandle() (LONGINT)(address)GetStdHandle(STD_INPUT_HANDLE) -#define Platform_getstdouthandle() (LONGINT)(address)GetStdHandle(STD_OUTPUT_HANDLE) +#define Platform_getstderrhandle() (LONGINT)(ADDRESS)GetStdHandle(STD_ERROR_HANDLE) +#define Platform_getstdinhandle() (LONGINT)(ADDRESS)GetStdHandle(STD_INPUT_HANDLE) +#define Platform_getstdouthandle() (LONGINT)(ADDRESS)GetStdHandle(STD_OUTPUT_HANDLE) #define Platform_identityToFileTime(i) FILETIME ft; ft.dwHighDateTime = i.mtimehigh; ft.dwLowDateTime = i.mtimelow -#define Platform_invalidHandleValue() ((LONGINT)(address)INVALID_HANDLE_VALUE) +#define Platform_invalidHandleValue() ((LONGINT)(ADDRESS)INVALID_HANDLE_VALUE) #define Platform_largeInteger() LARGE_INTEGER li #define Platform_liLongint() (LONGINT)li.QuadPart #define Platform_moveFile(o, o__len, n, n__len) (INTEGER)MoveFileEx((char*)o, (char*)n, MOVEFILE_REPLACE_EXISTING) -#define Platform_opennew(n, n__len) (LONGINT)(address)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0) -#define Platform_openro(n, n__len) (LONGINT)(address)CreateFile((char*)n, GENERIC_READ , FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) -#define Platform_openrw(n, n__len) (LONGINT)(address)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) +#define Platform_opennew(n, n__len) (LONGINT)(ADDRESS)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0) +#define Platform_openro(n, n__len) (LONGINT)(ADDRESS)CreateFile((char*)n, GENERIC_READ , FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) +#define Platform_openrw(n, n__len) (LONGINT)(ADDRESS)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) #define Platform_processInfo() PROCESS_INFORMATION pi = {0}; -#define Platform_readfile(fd, p, l, n) (INTEGER)ReadFile((HANDLE)(address)fd, (void*)p, (DWORD)l, (DWORD*)n, 0) +#define Platform_readfile(fd, p, l, n) (INTEGER)ReadFile((HANDLE)(ADDRESS)fd, (void*)p, (DWORD)l, (DWORD*)n, 0) #define Platform_seekcur() FILE_CURRENT #define Platform_seekend() FILE_END #define Platform_seekset() FILE_BEGIN #define Platform_setCurrentDirectory(n, n__len) (INTEGER)SetCurrentDirectory((char*)n) -#define Platform_setEndOfFile(h) (INTEGER)SetEndOfFile((HANDLE)(address)h) -#define Platform_setFilePointerEx(h, o, r, rc) li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((HANDLE)(address)h, li, 0, (DWORD)r) +#define Platform_setEndOfFile(h) (INTEGER)SetEndOfFile((HANDLE)(ADDRESS)h) +#define Platform_setFilePointerEx(h, o, r, rc) li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((HANDLE)(ADDRESS)h, li, 0, (DWORD)r) #define Platform_sleep(ms) Sleep((DWORD)ms) #define Platform_stToFt() FILETIME ft; SystemTimeToFileTime(&st, &ft) #define Platform_startupInfo() STARTUPINFO si = {0}; si.cb = sizeof(si); @@ -182,63 +182,63 @@ extern void Heap_InitHeap(); #define Platform_ulSec() (LONGINT)(ul.QuadPart / 1000000LL) #define Platform_uluSec() (LONGINT)(ul.QuadPart % 1000000LL) #define Platform_waitForProcess() (INTEGER)WaitForSingleObject(pi.hProcess, INFINITE) -#define Platform_writefile(fd, p, l) (INTEGER)WriteFile((HANDLE)(address)fd, (void*)(p), (DWORD)l, 0,0) +#define Platform_writefile(fd, p, l) (INTEGER)WriteFile((HANDLE)(ADDRESS)fd, (void*)(p), (DWORD)l, 0,0) -BOOLEAN Platform_TooManyFiles (int16 e) +BOOLEAN Platform_TooManyFiles (INT16 e) { return e == Platform_ERRORTOOMANYOPENFILES(); } -BOOLEAN Platform_NoSuchDirectory (int16 e) +BOOLEAN Platform_NoSuchDirectory (INT16 e) { return e == Platform_ERRORPATHNOTFOUND(); } -BOOLEAN Platform_DifferentFilesystems (int16 e) +BOOLEAN Platform_DifferentFilesystems (INT16 e) { return e == Platform_ERRORNOTSAMEDEVICE(); } -BOOLEAN Platform_Inaccessible (int16 e) +BOOLEAN Platform_Inaccessible (INT16 e) { return ((e == Platform_ERRORACCESSDENIED() || e == Platform_ERRORWRITEPROTECT()) || e == Platform_ERRORNOTREADY()) || e == Platform_ERRORSHARINGVIOLATION(); } -BOOLEAN Platform_Absent (int16 e) +BOOLEAN Platform_Absent (INT16 e) { return e == Platform_ERRORFILENOTFOUND() || e == Platform_ERRORPATHNOTFOUND(); } -BOOLEAN Platform_TimedOut (int16 e) +BOOLEAN Platform_TimedOut (INT16 e) { return e == Platform_ETIMEDOUT(); } -BOOLEAN Platform_ConnectionFailed (int16 e) +BOOLEAN Platform_ConnectionFailed (INT16 e) { return ((e == Platform_ECONNREFUSED() || e == Platform_ECONNABORTED()) || e == Platform_ENETUNREACH()) || e == Platform_EHOSTUNREACH(); } -BOOLEAN Platform_Interrupted (int16 e) +BOOLEAN Platform_Interrupted (INT16 e) { return e == Platform_EINTR(); } -int64 Platform_OSAllocate (int64 size) +INT64 Platform_OSAllocate (INT64 size) { return Platform_allocate(size); } -void Platform_OSFree (int64 address) +void Platform_OSFree (INT64 address) { Platform_free(address); } -void Platform_Init (int32 argc, int64 argvadr) +void Platform_Init (INT32 argc, INT64 argvadr) { Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; - Platform_ArgCount = __VAL(int16, argc); + Platform_ArgCount = __VAL(INT16, argc); av = (Platform_ArgVecPtr)(address)argvadr; Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; @@ -248,7 +248,7 @@ void Platform_Init (int32 argc, int64 argvadr) BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len) { CHAR buf[4096]; - int16 res; + INT16 res; __DUP(var, var__len, CHAR); res = Platform_getenv(var, var__len, (void*)buf, 4096); if ((res > 0 && res < 4096)) { @@ -271,7 +271,7 @@ void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len) __DEL(var); } -void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len) +void Platform_GetArg (INT16 n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { @@ -280,10 +280,10 @@ void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len) } } -void Platform_GetIntArg (int16 n, int32 *val) +void Platform_GetIntArg (INT16 n, INT32 *val) { CHAR s[64]; - int32 k, d, i; + INT32 k, d, i; s[0] = 0x00; Platform_GetArg(n, (void*)s, 64); i = 0; @@ -291,11 +291,11 @@ void Platform_GetIntArg (int16 n, int32 *val) i = 1; } k = 0; - d = (int16)s[__X(i, 64)] - 48; + d = (INT16)s[__X(i, 64)] - 48; while ((d >= 0 && d <= 9)) { k = k * 10 + d; i += 1; - d = (int16)s[__X(i, 64)] - 48; + d = (INT16)s[__X(i, 64)] - 48; } if (s[0] == '-') { k = -k; @@ -306,9 +306,9 @@ void Platform_GetIntArg (int16 n, int32 *val) } } -int16 Platform_ArgPos (CHAR *s, LONGINT s__len) +INT16 Platform_ArgPos (CHAR *s, LONGINT s__len) { - int16 i; + INT16 i; CHAR arg[256]; __DUP(s, s__len, CHAR); i = 0; @@ -325,26 +325,26 @@ void Platform_SetBadInstructionHandler (Platform_SignalHandler handler) { } -static void Platform_YMDHMStoClock (int16 ye, int16 mo, int16 da, int16 ho, int16 mi, int16 se, int32 *t, int32 *d) +static void Platform_YMDHMStoClock (INT16 ye, INT16 mo, INT16 da, INT16 ho, INT16 mi, INT16 se, INT32 *t, INT32 *d) { *d = (__ASHL((int)__MOD(ye, 100), 9) + __ASHL((mo + 1), 5)) + da; *t = (__ASHL(ho, 12) + __ASHL(mi, 6)) + se; } -void Platform_GetClock (int32 *t, int32 *d) +void Platform_GetClock (INT32 *t, INT32 *d) { Platform_getLocalTime(); Platform_YMDHMStoClock(Platform_styear(), Platform_stmon(), Platform_stmday(), Platform_sthour(), Platform_stmin(), Platform_stsec(), &*t, &*d); } -int32 Platform_Time (void) +INT32 Platform_Time (void) { - int32 ms; + INT32 ms; ms = Platform_GetTickCount(); return (int)__MOD(ms - Platform_TimeStart, 2147483647); } -void Platform_Delay (int32 ms) +void Platform_Delay (INT32 ms) { while (ms > 30000) { Platform_sleep(30000); @@ -355,7 +355,7 @@ void Platform_Delay (int32 ms) } } -void Platform_GetTimeOfDay (int32 *sec, int32 *usec) +void Platform_GetTimeOfDay (INT32 *sec, INT32 *usec) { Platform_getLocalTime(); Platform_stToFt(); @@ -365,9 +365,9 @@ void Platform_GetTimeOfDay (int32 *sec, int32 *usec) *usec = Platform_uluSec(); } -int16 Platform_System (CHAR *cmd, LONGINT cmd__len) +INT16 Platform_System (CHAR *cmd, LONGINT cmd__len) { - int16 result; + INT16 result; __DUP(cmd, cmd__len, CHAR); result = 127; Platform_startupInfo(); @@ -382,14 +382,14 @@ int16 Platform_System (CHAR *cmd, LONGINT cmd__len) return __ASHL(result, 8); } -int16 Platform_Error (void) +INT16 Platform_Error (void) { return Platform_err(); } -int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h) +INT16 Platform_OldRO (CHAR *n, LONGINT n__len, INT32 *h) { - int32 fd; + INT32 fd; fd = Platform_openro(n, n__len); if (fd == Platform_invalidHandleValue()) { return Platform_err(); @@ -400,9 +400,9 @@ int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h) __RETCHK; } -int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h) +INT16 Platform_OldRW (CHAR *n, LONGINT n__len, INT32 *h) { - int32 fd; + INT32 fd; fd = Platform_openrw(n, n__len); if (fd == Platform_invalidHandleValue()) { return Platform_err(); @@ -413,9 +413,9 @@ int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h) __RETCHK; } -int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h) +INT16 Platform_New (CHAR *n, LONGINT n__len, INT32 *h) { - int32 fd; + INT32 fd; fd = Platform_opennew(n, n__len); if (fd == Platform_invalidHandleValue()) { return Platform_err(); @@ -426,7 +426,7 @@ int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h) __RETCHK; } -int16 Platform_Close (int32 h) +INT16 Platform_Close (INT32 h) { if (Platform_closeHandle(h) == 0) { return Platform_err(); @@ -436,7 +436,7 @@ int16 Platform_Close (int32 h) __RETCHK; } -int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ) +INT16 Platform_Identify (INT32 h, Platform_FileIdentity *identity, ADDRESS *identity__typ) { Platform_byHandleFileInformation(); if (Platform_getFileInformationByHandle(h) == 0) { @@ -450,10 +450,10 @@ int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *iden return 0; } -int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ) +INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ) { - int32 h; - int16 e, i; + INT32 h; + INT16 e, i; __DUP(n, n__len, CHAR); e = Platform_OldRO((void*)n, n__len, &h); if (e != 0) { @@ -476,20 +476,20 @@ BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i return (i1.mtimehigh == i2.mtimehigh && i1.mtimelow == i2.mtimelow); } -void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Platform_FileIdentity source) +void Platform_SetMTime (Platform_FileIdentity *target, ADDRESS *target__typ, Platform_FileIdentity source) { (*target).mtimehigh = source.mtimehigh; (*target).mtimelow = source.mtimelow; } -void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d) +void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d) { Platform_identityToFileTime(i); Platform_fileTimeToSysTime(); Platform_YMDHMStoClock(Platform_styear(), Platform_stmon(), Platform_stmday(), Platform_sthour(), Platform_stmin(), Platform_stsec(), &*t, &*d); } -int16 Platform_Size (int32 h, int32 *l) +INT16 Platform_Size (INT32 h, INT32 *l) { Platform_largeInteger(); if (Platform_getFileSize(h) == 0) { @@ -499,10 +499,10 @@ int16 Platform_Size (int32 h, int32 *l) return 0; } -int16 Platform_Read (int32 h, int64 p, int32 l, int32 *n) +INT16 Platform_Read (INT32 h, INT64 p, INT32 l, INT32 *n) { - int16 result; - int32 lengthread; + INT16 result; + INT32 lengthread; result = Platform_readfile(h, p, l, &lengthread); if (result == 0) { *n = 0; @@ -514,10 +514,10 @@ int16 Platform_Read (int32 h, int64 p, int32 l, int32 *n) __RETCHK; } -int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n) +INT16 Platform_ReadBuf (INT32 h, SYSTEM_BYTE *b, LONGINT b__len, INT32 *n) { - int16 result; - int32 lengthread; + INT16 result; + INT32 lengthread; result = Platform_readfile(h, (address)b, b__len, &lengthread); if (result == 0) { *n = 0; @@ -529,7 +529,7 @@ int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n) __RETCHK; } -int16 Platform_Write (int32 h, int64 p, int32 l) +INT16 Platform_Write (INT32 h, INT64 p, INT32 l) { if (Platform_writefile(h, p, l) == 0) { return Platform_err(); @@ -539,7 +539,7 @@ int16 Platform_Write (int32 h, int64 p, int32 l) __RETCHK; } -int16 Platform_Sync (int32 h) +INT16 Platform_Sync (INT32 h) { if (Platform_flushFileBuffers(h) == 0) { return Platform_err(); @@ -549,9 +549,9 @@ int16 Platform_Sync (int32 h) __RETCHK; } -int16 Platform_Seek (int32 h, int32 o, int16 r) +INT16 Platform_Seek (INT32 h, INT32 o, INT16 r) { - int16 rc; + INT16 rc; Platform_largeInteger(); Platform_setFilePointerEx(h, o, r, &rc); if (rc == 0) { @@ -562,10 +562,10 @@ int16 Platform_Seek (int32 h, int32 o, int16 r) __RETCHK; } -int16 Platform_Truncate (int32 h, int32 limit) +INT16 Platform_Truncate (INT32 h, INT32 limit) { - int16 rc; - int32 oldpos; + INT16 rc; + INT32 oldpos; Platform_largeInteger(); Platform_getFilePos(h, &oldpos, &rc); if (rc == 0) { @@ -585,7 +585,7 @@ int16 Platform_Truncate (int32 h, int32 limit) return 0; } -int16 Platform_Unlink (CHAR *n, LONGINT n__len) +INT16 Platform_Unlink (CHAR *n, LONGINT n__len) { if (Platform_deleteFile(n, n__len) == 0) { return Platform_err(); @@ -595,9 +595,9 @@ int16 Platform_Unlink (CHAR *n, LONGINT n__len) __RETCHK; } -int16 Platform_Chdir (CHAR *n, LONGINT n__len) +INT16 Platform_Chdir (CHAR *n, LONGINT n__len) { - int16 r; + INT16 r; r = Platform_setCurrentDirectory(n, n__len); if (r == 0) { return Platform_err(); @@ -606,7 +606,7 @@ int16 Platform_Chdir (CHAR *n, LONGINT n__len) return 0; } -int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) +INT16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) { if (Platform_moveFile(o, o__len, n, n__len) == 0) { return Platform_err(); @@ -616,7 +616,7 @@ int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) __RETCHK; } -void Platform_Exit (int16 code) +void Platform_Exit (INT16 code) { Platform_exit(code); } @@ -632,7 +632,7 @@ static void Platform_errln (void) Platform_errch(0x0a); } -static void Platform_errposint (int32 l) +static void Platform_errposint (INT32 l) { if (l > 10) { Platform_errposint(__DIV(l, 10)); @@ -640,7 +640,7 @@ static void Platform_errposint (int32 l) Platform_errch((CHAR)(48 + (int)__MOD(l, 10))); } -static void Platform_errint (int32 l) +static void Platform_errint (INT32 l) { if (l < 0) { Platform_errch('-'); @@ -649,11 +649,11 @@ static void Platform_errint (int32 l) Platform_errposint(l); } -static void Platform_DisplayHaltCode (int32 code) +static void Platform_DisplayHaltCode (INT32 code) { switch (code) { case -1: - Platform_errstring((CHAR*)"Rider ReadBuf/WriteBuf transfer size longer than buffer.", 57); + Platform_errstring((CHAR*)"Assertion failure.", 19); break; case -2: Platform_errstring((CHAR*)"Index out of range.", 20); @@ -705,7 +705,7 @@ static void Platform_DisplayHaltCode (int32 code) } } -void Platform_Halt (int32 code) +void Platform_Halt (INT32 code) { Platform_HaltCode = code; if (Platform_HaltHandler != NIL) { @@ -718,10 +718,10 @@ void Platform_Halt (int32 code) Platform_DisplayHaltCode(code); } Platform_errln(); - Platform_exit(__VAL(int16, code)); + Platform_exit(__VAL(INT16, code)); } -void Platform_AssertFail (int32 code) +void Platform_AssertFail (INT32 code) { Platform_errstring((CHAR*)"Assertion failure.", 19); if (code != 0) { @@ -730,7 +730,7 @@ void Platform_AssertFail (int32 code) Platform_errstring((CHAR*)".", 2); } Platform_errln(); - Platform_exit(__VAL(int16, code)); + Platform_exit(__VAL(INT16, code)); } void Platform_SetHalt (Platform_HaltProcedure p) @@ -740,7 +740,7 @@ void Platform_SetHalt (Platform_HaltProcedure p) static void Platform_TestLittleEndian (void) { - int16 i; + INT16 i; i = 1; __GET((address)&i, Platform_LittleEndian, BOOLEAN); } diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index 809c60fc..e67b2ca0 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h @@ -7,80 +7,80 @@ typedef struct Platform_FileIdentity { - int32 _prvt0; + INT32 _prvt0; char _prvt1[16]; } Platform_FileIdentity; typedef - void (*Platform_HaltProcedure)(int32); + void (*Platform_HaltProcedure)(INT32); typedef - void (*Platform_SignalHandler)(int32); + void (*Platform_SignalHandler)(INT32); import BOOLEAN Platform_LittleEndian; -import int64 Platform_MainStackFrame; -import int32 Platform_HaltCode; -import int16 Platform_PID; +import INT64 Platform_MainStackFrame; +import INT32 Platform_HaltCode; +import INT16 Platform_PID; import CHAR Platform_CWD[4096]; -import int16 Platform_ArgCount; -import int64 Platform_ArgVector; -import int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; -import int32 Platform_StdIn, Platform_StdOut, Platform_StdErr; +import INT16 Platform_ArgCount; +import INT64 Platform_ArgVector; +import INT16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; +import INT32 Platform_StdIn, Platform_StdOut, Platform_StdErr; import CHAR Platform_NL[3]; -import address *Platform_FileIdentity__typ; +import ADDRESS *Platform_FileIdentity__typ; -import BOOLEAN Platform_Absent (int16 e); -import int16 Platform_ArgPos (CHAR *s, LONGINT s__len); -import void Platform_AssertFail (int32 code); -import int16 Platform_Chdir (CHAR *n, LONGINT n__len); -import int16 Platform_Close (int32 h); -import BOOLEAN Platform_ConnectionFailed (int16 e); -import void Platform_Delay (int32 ms); -import BOOLEAN Platform_DifferentFilesystems (int16 e); -import int16 Platform_Error (void); -import void Platform_Exit (int16 code); -import void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len); -import void Platform_GetClock (int32 *t, int32 *d); +import BOOLEAN Platform_Absent (INT16 e); +import INT16 Platform_ArgPos (CHAR *s, LONGINT s__len); +import void Platform_AssertFail (INT32 code); +import INT16 Platform_Chdir (CHAR *n, LONGINT n__len); +import INT16 Platform_Close (INT32 h); +import BOOLEAN Platform_ConnectionFailed (INT16 e); +import void Platform_Delay (INT32 ms); +import BOOLEAN Platform_DifferentFilesystems (INT16 e); +import INT16 Platform_Error (void); +import void Platform_Exit (INT16 code); +import void Platform_GetArg (INT16 n, CHAR *val, LONGINT val__len); +import void Platform_GetClock (INT32 *t, INT32 *d); import void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); -import void Platform_GetIntArg (int16 n, int32 *val); -import void Platform_GetTimeOfDay (int32 *sec, int32 *usec); -import void Platform_Halt (int32 code); -import int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ); -import int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); -import BOOLEAN Platform_Inaccessible (int16 e); -import void Platform_Init (int32 argc, int64 argvadr); -import BOOLEAN Platform_Interrupted (int16 e); -import void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); -import int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); -import BOOLEAN Platform_NoSuchDirectory (int16 e); -import int64 Platform_OSAllocate (int64 size); -import void Platform_OSFree (int64 address); -import int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); -import int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); -import int16 Platform_Read (int32 h, int64 p, int32 l, int32 *n); -import int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n); -import int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); +import void Platform_GetIntArg (INT16 n, INT32 *val); +import void Platform_GetTimeOfDay (INT32 *sec, INT32 *usec); +import void Platform_Halt (INT32 code); +import INT16 Platform_Identify (INT32 h, Platform_FileIdentity *identity, ADDRESS *identity__typ); +import INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ); +import BOOLEAN Platform_Inaccessible (INT16 e); +import void Platform_Init (INT32 argc, INT64 argvadr); +import BOOLEAN Platform_Interrupted (INT16 e); +import void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d); +import INT16 Platform_New (CHAR *n, LONGINT n__len, INT32 *h); +import BOOLEAN Platform_NoSuchDirectory (INT16 e); +import INT64 Platform_OSAllocate (INT64 size); +import void Platform_OSFree (INT64 address); +import INT16 Platform_OldRO (CHAR *n, LONGINT n__len, INT32 *h); +import INT16 Platform_OldRW (CHAR *n, LONGINT n__len, INT32 *h); +import INT16 Platform_Read (INT32 h, INT64 p, INT32 l, INT32 *n); +import INT16 Platform_ReadBuf (INT32 h, SYSTEM_BYTE *b, LONGINT b__len, INT32 *n); +import INT16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); import BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); import BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); -import int16 Platform_Seek (int32 h, int32 o, int16 r); +import INT16 Platform_Seek (INT32 h, INT32 o, INT16 r); import void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); import void Platform_SetHalt (Platform_HaltProcedure p); -import void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Platform_FileIdentity source); -import int16 Platform_Size (int32 h, int32 *l); -import int16 Platform_Sync (int32 h); -import int16 Platform_System (CHAR *cmd, LONGINT cmd__len); -import int32 Platform_Time (void); -import BOOLEAN Platform_TimedOut (int16 e); -import BOOLEAN Platform_TooManyFiles (int16 e); -import int16 Platform_Truncate (int32 h, int32 limit); -import int16 Platform_Unlink (CHAR *n, LONGINT n__len); -import int16 Platform_Write (int32 h, int64 p, int32 l); +import void Platform_SetMTime (Platform_FileIdentity *target, ADDRESS *target__typ, Platform_FileIdentity source); +import INT16 Platform_Size (INT32 h, INT32 *l); +import INT16 Platform_Sync (INT32 h); +import INT16 Platform_System (CHAR *cmd, LONGINT cmd__len); +import INT32 Platform_Time (void); +import BOOLEAN Platform_TimedOut (INT16 e); +import BOOLEAN Platform_TooManyFiles (INT16 e); +import INT16 Platform_Truncate (INT32 h, INT32 limit); +import INT16 Platform_Unlink (CHAR *n, LONGINT n__len); +import INT16 Platform_Write (INT32 h, INT64 p, INT32 l); import BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); import void *Platform__init(void); -#define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((address)h) -#define Platform_SetQuitHandler(h) SystemSetQuitHandler((address)h) +#define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((ADDRESS)h) +#define Platform_SetQuitHandler(h) SystemSetQuitHandler((ADDRESS)h) #endif // Platform diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 0aca5733..d6788751 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" @@ -11,19 +11,19 @@ static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LONGINT d__len); -export void Reals_Convert (REAL x, int16 n, CHAR *d, LONGINT d__len); +export void Reals_Convert (REAL x, INT16 n, CHAR *d, LONGINT d__len); export void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len); export void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len); -export void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len); -export int16 Reals_Expo (REAL x); -export int16 Reals_ExpoL (LONGREAL x); -export void Reals_SetExpo (REAL *x, int16 ex); -export REAL Reals_Ten (int16 e); -export LONGREAL Reals_TenL (int16 e); -static CHAR Reals_ToHex (int16 i); +export void Reals_ConvertL (LONGREAL x, INT16 n, CHAR *d, LONGINT d__len); +export INT16 Reals_Expo (REAL x); +export INT16 Reals_ExpoL (LONGREAL x); +export void Reals_SetExpo (REAL *x, INT16 ex); +export REAL Reals_Ten (INT16 e); +export LONGREAL Reals_TenL (INT16 e); +static CHAR Reals_ToHex (INT16 i); -REAL Reals_Ten (int16 e) +REAL Reals_Ten (INT16 e) { LONGREAL r, power; r = (LONGREAL)1; @@ -38,7 +38,7 @@ REAL Reals_Ten (int16 e) return r; } -LONGREAL Reals_TenL (int16 e) +LONGREAL Reals_TenL (INT16 e) { LONGREAL r, power; r = (LONGREAL)1; @@ -56,39 +56,39 @@ LONGREAL Reals_TenL (int16 e) __RETCHK; } -int16 Reals_Expo (REAL x) +INT16 Reals_Expo (REAL x) { - int16 i; - __GET((address)&x + 2, i, int16); + INT16 i; + __GET((address)&x + 2, i, INT16); return __MASK(__ASHR(i, 7), -256); } -void Reals_SetExpo (REAL *x, int16 ex) +void Reals_SetExpo (REAL *x, INT16 ex) { CHAR c; __GET((address)x + 3, c, CHAR); - __PUT((address)x + 3, (CHAR)(__ASHL(__ASHR((int16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __PUT((address)x + 3, (CHAR)(__ASHL(__ASHR((INT16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); __GET((address)x + 2, c, CHAR); - __PUT((address)x + 2, (CHAR)(__MASK((int16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); + __PUT((address)x + 2, (CHAR)(__MASK((INT16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } -int16 Reals_ExpoL (LONGREAL x) +INT16 Reals_ExpoL (LONGREAL x) { - int16 i; - __GET((address)&x + 6, i, int16); + INT16 i; + __GET((address)&x + 6, i, INT16); return __MASK(__ASHR(i, 4), -2048); } -void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len) +void Reals_ConvertL (LONGREAL x, INT16 n, CHAR *d, LONGINT d__len) { - int32 i, j, k; + INT32 i, j, k; if (x < (LONGREAL)0) { x = -x; } k = 0; if (n > 9) { - i = (int32)__ENTIER(x / (LONGREAL)(LONGREAL)1000000000); - j = (int32)__ENTIER(x - i * (LONGREAL)1000000000); + i = (INT32)__ENTIER(x / (LONGREAL)(LONGREAL)1000000000); + j = (INT32)__ENTIER(x - i * (LONGREAL)1000000000); if (j < 0) { j = 0; } @@ -98,7 +98,7 @@ void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len) k += 1; } } else { - i = (int32)__ENTIER(x); + i = (INT32)__ENTIER(x); } while (k < n) { d[__X(k, d__len)] = (CHAR)((int)__MOD(i, 10) + 48); @@ -107,12 +107,12 @@ void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len) } } -void Reals_Convert (REAL x, int16 n, CHAR *d, LONGINT d__len) +void Reals_Convert (REAL x, INT16 n, CHAR *d, LONGINT d__len) { Reals_ConvertL(x, n, (void*)d, d__len); } -static CHAR Reals_ToHex (int16 i) +static CHAR Reals_ToHex (INT16 i) { if (i < 10) { return (CHAR)(i + 48); @@ -124,15 +124,15 @@ static CHAR Reals_ToHex (int16 i) static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LONGINT d__len) { - int16 i; - int32 l; + INT16 i; + INT32 l; CHAR by; i = 0; l = b__len; while (i < l) { by = __VAL(CHAR, b[__X(i, b__len)]); - d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((int16)by, 4)); - d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((int16)by, -16)); + d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((INT16)by, 4)); + d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((INT16)by, -16)); i += 1; } } diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index 664fe2ec..07688e3c 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h @@ -8,15 +8,15 @@ -import void Reals_Convert (REAL x, int16 n, CHAR *d, LONGINT d__len); +import void Reals_Convert (REAL x, INT16 n, CHAR *d, LONGINT d__len); import void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len); import void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len); -import void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len); -import int16 Reals_Expo (REAL x); -import int16 Reals_ExpoL (LONGREAL x); -import void Reals_SetExpo (REAL *x, int16 ex); -import REAL Reals_Ten (int16 e); -import LONGREAL Reals_TenL (int16 e); +import void Reals_ConvertL (LONGREAL x, INT16 n, CHAR *d, LONGINT d__len); +import INT16 Reals_Expo (REAL x); +import INT16 Reals_ExpoL (LONGREAL x); +import void Reals_SetExpo (REAL *x, INT16 ex); +import REAL Reals_Ten (INT16 e); +import LONGREAL Reals_TenL (INT16 e); import void *Reals__init(void); diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index 104a0fb7..141a9976 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" @@ -12,18 +12,18 @@ export void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len); export void Strings_Cap (CHAR *s, LONGINT s__len); -export void Strings_Delete (CHAR *s, LONGINT s__len, int16 pos, int16 n); -export void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHAR *dest, LONGINT dest__len); -export void Strings_Insert (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len); -export int16 Strings_Length (CHAR *s, LONGINT s__len); +export void Strings_Delete (CHAR *s, LONGINT s__len, INT16 pos, INT16 n); +export void Strings_Extract (CHAR *source, LONGINT source__len, INT16 pos, INT16 n, CHAR *dest, LONGINT dest__len); +export void Strings_Insert (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len); +export INT16 Strings_Length (CHAR *s, LONGINT s__len); export BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len); -export int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int16 pos); -export void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len); +export INT16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, INT16 pos); +export void Strings_Replace (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len); -int16 Strings_Length (CHAR *s, LONGINT s__len) +INT16 Strings_Length (CHAR *s, LONGINT s__len) { - int32 i; + INT32 i; __DUP(s, s__len, CHAR); i = 0; while ((i < s__len && s[__X(i, s__len)] != 0x00)) { @@ -31,7 +31,7 @@ int16 Strings_Length (CHAR *s, LONGINT s__len) } if (i <= 32767) { __DEL(s); - return (int16)i; + return (INT16)i; } else { __DEL(s); return 32767; @@ -41,7 +41,7 @@ int16 Strings_Length (CHAR *s, LONGINT s__len) void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len) { - int16 n1, n2, i; + INT16 n1, n2, i; __DUP(extra, extra__len, CHAR); n1 = Strings_Length(dest, dest__len); n2 = Strings_Length(extra, extra__len); @@ -56,9 +56,9 @@ void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__ __DEL(extra); } -void Strings_Insert (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len) +void Strings_Insert (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len) { - int16 n1, n2, i; + INT16 n1, n2, i; __DUP(source, source__len, CHAR); n1 = Strings_Length(dest, dest__len); n2 = Strings_Length(source, source__len); @@ -87,9 +87,9 @@ void Strings_Insert (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, L __DEL(source); } -void Strings_Delete (CHAR *s, LONGINT s__len, int16 pos, int16 n) +void Strings_Delete (CHAR *s, LONGINT s__len, INT16 pos, INT16 n) { - int16 len, i; + INT16 len, i; len = Strings_Length(s, s__len); if (pos < 0) { pos = 0; @@ -110,7 +110,7 @@ void Strings_Delete (CHAR *s, LONGINT s__len, int16 pos, int16 n) } } -void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len) +void Strings_Replace (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len) { __DUP(source, source__len, CHAR); Strings_Delete((void*)dest, dest__len, pos, pos + Strings_Length(source, source__len)); @@ -118,12 +118,12 @@ void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, __DEL(source); } -void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHAR *dest, LONGINT dest__len) +void Strings_Extract (CHAR *source, LONGINT source__len, INT16 pos, INT16 n, CHAR *dest, LONGINT dest__len) { - int16 len, destLen, i; + INT16 len, destLen, i; __DUP(source, source__len, CHAR); len = Strings_Length(source, source__len); - destLen = (int16)dest__len - 1; + destLen = (INT16)dest__len - 1; if (pos < 0) { pos = 0; } @@ -143,9 +143,9 @@ void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHA __DEL(source); } -int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int16 pos) +INT16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, INT16 pos) { - int16 n1, n2, i, j; + INT16 n1, n2, i, j; __DUP(pattern, pattern__len, CHAR); __DUP(s, s__len, CHAR); n1 = Strings_Length(s, s__len); @@ -177,7 +177,7 @@ int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, void Strings_Cap (CHAR *s, LONGINT s__len) { - int16 i; + INT16 i; i = 0; while (s[__X(i, s__len)] != 0x00) { if (('a' <= s[__X(i, s__len)] && s[__X(i, s__len)] <= 'z')) { @@ -191,9 +191,9 @@ static struct Match__7 { struct Match__7 *lnk; } *Match__7_s; -static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, int16 n, int16 m); +static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, INT16 n, INT16 m); -static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, int16 n, int16 m) +static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, INT16 n, INT16 m) { while ((((n >= 0 && m >= 0)) && mask[__X(m, mask__len)] != '*')) { if (name[__X(n, name__len)] != mask[__X(m, mask__len)]) { diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index 24f35c02..4319e8c8 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h @@ -10,13 +10,13 @@ import void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len); import void Strings_Cap (CHAR *s, LONGINT s__len); -import void Strings_Delete (CHAR *s, LONGINT s__len, int16 pos, int16 n); -import void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHAR *dest, LONGINT dest__len); -import void Strings_Insert (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len); -import int16 Strings_Length (CHAR *s, LONGINT s__len); +import void Strings_Delete (CHAR *s, LONGINT s__len, INT16 pos, INT16 n); +import void Strings_Extract (CHAR *source, LONGINT source__len, INT16 pos, INT16 n, CHAR *dest, LONGINT dest__len); +import void Strings_Insert (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len); +import INT16 Strings_Length (CHAR *s, LONGINT s__len); import BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len); -import int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int16 pos); -import void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len); +import INT16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, INT16 pos); +import void Strings_Replace (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len); import void *Strings__init(void); diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index e84157d1..3b932ce7 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "Files.h" @@ -19,9 +19,9 @@ typedef typedef struct Texts_RunDesc { Texts_Run prev, next; - int32 len; + INT32 len; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; BOOLEAN ascii; } Texts_RunDesc; @@ -34,7 +34,7 @@ typedef } Texts_ElemMsg; typedef - void (*Texts_Handler)(Texts_Elem, Texts_ElemMsg*, address *); + void (*Texts_Handler)(Texts_Elem, Texts_ElemMsg*, ADDRESS *); typedef struct Texts_TextDesc *Texts_Text; @@ -42,26 +42,26 @@ typedef typedef struct Texts_ElemDesc { Texts_Run prev, next; - int32 len; + INT32 len; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; BOOLEAN ascii; - int32 W, H; + INT32 W, H; Texts_Handler handle; Texts_Text base; } Texts_ElemDesc; struct Texts__1 { /* Texts_ElemDesc */ Texts_Run prev, next; - int32 len; + INT32 len; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; BOOLEAN ascii; - int32 W, H; + INT32 W, H; Texts_Handler handle; Texts_Text base; Files_File file; - int32 org, span; + INT32 org, span; CHAR mod[32], proc[32]; }; @@ -70,7 +70,7 @@ typedef typedef struct Texts_BufDesc { - int32 len; + INT32 len; Texts_Run head; } Texts_BufDesc; @@ -84,8 +84,8 @@ typedef typedef struct Texts_FileMsg { /* Texts_ElemMsg */ - int16 id; - int32 pos; + INT16 id; + INT32 pos; Files_Rider r; } Texts_FileMsg; @@ -100,7 +100,7 @@ typedef } Texts_IdentifyMsg; typedef - void (*Texts_Notifier)(Texts_Text, int16, int32, int32); + void (*Texts_Notifier)(Texts_Text, INT16, INT32, INT32); typedef struct Texts_PieceDesc *Texts_Piece; @@ -108,57 +108,57 @@ typedef typedef struct Texts_PieceDesc { Texts_Run prev, next; - int32 len; + INT32 len; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; BOOLEAN ascii; Files_File file; - int32 org; + INT32 org; } Texts_PieceDesc; typedef struct Texts_Reader { BOOLEAN eot; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; Texts_Elem elem; Files_Rider rider; Texts_Run run; - int32 org, off; + INT32 org, off; } Texts_Reader; typedef struct Texts_Scanner { /* Texts_Reader */ BOOLEAN eot; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; Texts_Elem elem; Files_Rider rider; Texts_Run run; - int32 org, off; + INT32 org, off; CHAR nextCh; - int16 line, class; - int32 i; + INT16 line, class; + INT32 i; REAL x; LONGREAL y; CHAR c; - int8 len; + INT8 len; CHAR s[64]; } Texts_Scanner; typedef struct Texts_TextDesc { - int32 len; + INT32 len; Texts_Notifier notify; Texts_Run head, cache; - int32 corg; + INT32 corg; } Texts_TextDesc; typedef struct Texts_Writer { Texts_Buffer buf; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; Files_Rider rider; Files_File file; } Texts_Writer; @@ -168,68 +168,68 @@ export Texts_Elem Texts_new; static Texts_Buffer Texts_del; static Texts_FontsFont Texts_FontsDefault; -export address *Texts_FontDesc__typ; -export address *Texts_RunDesc__typ; -export address *Texts_PieceDesc__typ; -export address *Texts_ElemMsg__typ; -export address *Texts_ElemDesc__typ; -export address *Texts_FileMsg__typ; -export address *Texts_CopyMsg__typ; -export address *Texts_IdentifyMsg__typ; -export address *Texts_BufDesc__typ; -export address *Texts_TextDesc__typ; -export address *Texts_Reader__typ; -export address *Texts_Scanner__typ; -export address *Texts_Writer__typ; -export address *Texts__1__typ; +export ADDRESS *Texts_FontDesc__typ; +export ADDRESS *Texts_RunDesc__typ; +export ADDRESS *Texts_PieceDesc__typ; +export ADDRESS *Texts_ElemMsg__typ; +export ADDRESS *Texts_ElemDesc__typ; +export ADDRESS *Texts_FileMsg__typ; +export ADDRESS *Texts_CopyMsg__typ; +export ADDRESS *Texts_IdentifyMsg__typ; +export ADDRESS *Texts_BufDesc__typ; +export ADDRESS *Texts_TextDesc__typ; +export ADDRESS *Texts_Reader__typ; +export ADDRESS *Texts_Scanner__typ; +export ADDRESS *Texts_Writer__typ; +export ADDRESS *Texts__1__typ; export void Texts_Append (Texts_Text T, Texts_Buffer B); -export void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, uint32 sel, Texts_FontsFont fnt, int8 col, int8 voff); +export void Texts_ChangeLooks (Texts_Text T, INT32 beg, INT32 end, UINT32 sel, Texts_FontsFont fnt, INT8 col, INT8 voff); static Texts_Elem Texts_CloneElem (Texts_Elem e); static Texts_Piece Texts_ClonePiece (Texts_Piece p); export void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len); export void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); export void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); -export void Texts_Delete (Texts_Text T, int32 beg, int32 end); +export void Texts_Delete (Texts_Text T, INT32 beg, INT32 end); export Texts_Text Texts_ElemBase (Texts_Elem E); -export int32 Texts_ElemPos (Texts_Elem E); -static void Texts_Find (Texts_Text T, int32 *pos, Texts_Run *u, int32 *org, int32 *off); +export INT32 Texts_ElemPos (Texts_Elem E); +static void Texts_Find (Texts_Text T, INT32 *pos, Texts_Run *u, INT32 *org, INT32 *off); static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len); -static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, address *msg__typ); -export void Texts_Insert (Texts_Text T, int32 pos, Texts_Buffer B); -export void Texts_Load (Files_Rider *r, address *r__typ, Texts_Text T); -static void Texts_Load0 (Files_Rider *r, address *r__typ, Texts_Text T); +static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, ADDRESS *msg__typ); +export void Texts_Insert (Texts_Text T, INT32 pos, Texts_Buffer B); +export void Texts_Load (Files_Rider *r, ADDRESS *r__typ, Texts_Text T); +static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T); static void Texts_Merge (Texts_Text T, Texts_Run u, Texts_Run *v); export void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len); export void Texts_OpenBuf (Texts_Buffer B); -export void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int32 pos); -export void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int32 pos); -export void Texts_OpenWriter (Texts_Writer *W, address *W__typ); -export int32 Texts_Pos (Texts_Reader *R, address *R__typ); -export void Texts_Read (Texts_Reader *R, address *R__typ, CHAR *ch); -export void Texts_ReadElem (Texts_Reader *R, address *R__typ); -export void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ); +export void Texts_OpenReader (Texts_Reader *R, ADDRESS *R__typ, Texts_Text T, INT32 pos); +export void Texts_OpenScanner (Texts_Scanner *S, ADDRESS *S__typ, Texts_Text T, INT32 pos); +export void Texts_OpenWriter (Texts_Writer *W, ADDRESS *W__typ); +export INT32 Texts_Pos (Texts_Reader *R, ADDRESS *R__typ); +export void Texts_Read (Texts_Reader *R, ADDRESS *R__typ, CHAR *ch); +export void Texts_ReadElem (Texts_Reader *R, ADDRESS *R__typ); +export void Texts_ReadPrevElem (Texts_Reader *R, ADDRESS *R__typ); export void Texts_Recall (Texts_Buffer *B); -export void Texts_Save (Texts_Text T, int32 beg, int32 end, Texts_Buffer B); -export void Texts_Scan (Texts_Scanner *S, address *S__typ); -export void Texts_SetColor (Texts_Writer *W, address *W__typ, int8 col); -export void Texts_SetFont (Texts_Writer *W, address *W__typ, Texts_FontsFont fnt); -export void Texts_SetOffset (Texts_Writer *W, address *W__typ, int8 voff); +export void Texts_Save (Texts_Text T, INT32 beg, INT32 end, Texts_Buffer B); +export void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ); +export void Texts_SetColor (Texts_Writer *W, ADDRESS *W__typ, INT8 col); +export void Texts_SetFont (Texts_Writer *W, ADDRESS *W__typ, Texts_FontsFont fnt); +export void Texts_SetOffset (Texts_Writer *W, ADDRESS *W__typ, INT8 voff); static void Texts_Splice (Texts_Run un, Texts_Run v, Texts_Run w, Texts_Text base); -static void Texts_Split (int32 off, Texts_Run *u, Texts_Run *un); -export void Texts_Store (Files_Rider *r, address *r__typ, Texts_Text T); -export void Texts_Write (Texts_Writer *W, address *W__typ, CHAR ch); -export void Texts_WriteDate (Texts_Writer *W, address *W__typ, int32 t, int32 d); -export void Texts_WriteElem (Texts_Writer *W, address *W__typ, Texts_Elem e); -export void Texts_WriteHex (Texts_Writer *W, address *W__typ, int32 x); -export void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n); -export void Texts_WriteLn (Texts_Writer *W, address *W__typ); -export void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int16 n); -export void Texts_WriteLongRealHex (Texts_Writer *W, address *W__typ, LONGREAL x); -export void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int16 n); -export void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int16 n, int16 k); -export void Texts_WriteRealHex (Texts_Writer *W, address *W__typ, REAL x); -export void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGINT s__len); +static void Texts_Split (INT32 off, Texts_Run *u, Texts_Run *un); +export void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T); +export void Texts_Write (Texts_Writer *W, ADDRESS *W__typ, CHAR ch); +export void Texts_WriteDate (Texts_Writer *W, ADDRESS *W__typ, INT32 t, INT32 d); +export void Texts_WriteElem (Texts_Writer *W, ADDRESS *W__typ, Texts_Elem e); +export void Texts_WriteHex (Texts_Writer *W, ADDRESS *W__typ, INT32 x); +export void Texts_WriteInt (Texts_Writer *W, ADDRESS *W__typ, INT64 x, INT64 n); +export void Texts_WriteLn (Texts_Writer *W, ADDRESS *W__typ); +export void Texts_WriteLongReal (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x, INT16 n); +export void Texts_WriteLongRealHex (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x); +export void Texts_WriteReal (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n); +export void Texts_WriteRealFix (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n, INT16 k); +export void Texts_WriteRealHex (Texts_Writer *W, ADDRESS *W__typ, REAL x); +export void Texts_WriteString (Texts_Writer *W, ADDRESS *W__typ, CHAR *s, LONGINT s__len); static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len) @@ -240,10 +240,10 @@ static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len) return F; } -static void Texts_Find (Texts_Text T, int32 *pos, Texts_Run *u, int32 *org, int32 *off) +static void Texts_Find (Texts_Text T, INT32 *pos, Texts_Run *u, INT32 *org, INT32 *off) { Texts_Run v = NIL; - int32 m; + INT32 m; if (*pos >= T->len) { *pos = T->len; *u = T->head; @@ -273,7 +273,7 @@ static void Texts_Find (Texts_Text T, int32 *pos, Texts_Run *u, int32 *org, int3 } } -static void Texts_Split (int32 off, Texts_Run *u, Texts_Run *un) +static void Texts_Split (INT32 off, Texts_Run *u, Texts_Run *un) { Texts_Piece p = NIL, U = NIL; if (off == 0) { @@ -366,10 +366,10 @@ Texts_Text Texts_ElemBase (Texts_Elem E) return E->base; } -int32 Texts_ElemPos (Texts_Elem E) +INT32 Texts_ElemPos (Texts_Elem E) { Texts_Run u = NIL; - int32 pos; + INT32 pos; u = E->base->head->next; pos = 0; while (u != (void *) E) { @@ -379,11 +379,11 @@ int32 Texts_ElemPos (Texts_Elem E) return pos; } -static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, address *msg__typ) +static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, ADDRESS *msg__typ) { Texts_Alien e = NIL; Files_Rider r; - int32 i; + INT32 i; CHAR ch; if (__ISP(E, Texts__1, 2)) { if (__IS(msg__typ, Texts_CopyMsg, 1)) { @@ -459,10 +459,10 @@ void Texts_Recall (Texts_Buffer *B) Texts_del = NIL; } -void Texts_Save (Texts_Text T, int32 beg, int32 end, Texts_Buffer B) +void Texts_Save (Texts_Text T, INT32 beg, INT32 end, Texts_Buffer B) { Texts_Run u = NIL, v = NIL, w = NIL, wn = NIL; - int32 uo, ud, vo, vd; + INT32 uo, ud, vo, vd; Texts_Find(T, &beg, &u, &uo, &ud); Texts_Find(T, &end, &v, &vo, &vd); w = B->head->prev; @@ -493,11 +493,11 @@ void Texts_Save (Texts_Text T, int32 beg, int32 end, Texts_Buffer B) B->len += end - beg; } -void Texts_Insert (Texts_Text T, int32 pos, Texts_Buffer B) +void Texts_Insert (Texts_Text T, INT32 pos, Texts_Buffer B) { Texts_Run u = NIL, un = NIL, v = NIL; Texts_Piece p = NIL, q = NIL; - int32 uo, ud, len; + INT32 uo, ud, len; Texts_Find(T, &pos, &u, &uo, &ud); Texts_Split(ud, &u, &un); len = B->len; @@ -516,7 +516,7 @@ void Texts_Insert (Texts_Text T, int32 pos, Texts_Buffer B) void Texts_Append (Texts_Text T, Texts_Buffer B) { Texts_Run v = NIL; - int32 pos, len; + INT32 pos, len; pos = T->len; len = B->len; v = B->head->next; @@ -531,10 +531,10 @@ void Texts_Append (Texts_Text T, Texts_Buffer B) } } -void Texts_Delete (Texts_Text T, int32 beg, int32 end) +void Texts_Delete (Texts_Text T, INT32 beg, INT32 end) { Texts_Run c = NIL, u = NIL, un = NIL, v = NIL, vn = NIL; - int32 co, uo, ud, vo, vd; + INT32 co, uo, ud, vo, vd; Texts_Find(T, &beg, &u, &uo, &ud); Texts_Split(ud, &u, &un); c = T->cache; @@ -556,10 +556,10 @@ void Texts_Delete (Texts_Text T, int32 beg, int32 end) } } -void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, uint32 sel, Texts_FontsFont fnt, int8 col, int8 voff) +void Texts_ChangeLooks (Texts_Text T, INT32 beg, INT32 end, UINT32 sel, Texts_FontsFont fnt, INT8 col, INT8 voff) { Texts_Run c = NIL, u = NIL, un = NIL, v = NIL, vn = NIL; - int32 co, uo, ud, vo, vd; + INT32 co, uo, ud, vo, vd; Texts_Find(T, &beg, &u, &uo, &ud); Texts_Split(ud, &u, &un); c = T->cache; @@ -595,7 +595,7 @@ void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, uint32 sel, Texts_Fo } } -void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int32 pos) +void Texts_OpenReader (Texts_Reader *R, ADDRESS *R__typ, Texts_Text T, INT32 pos) { Texts_Run u = NIL; if (pos >= T->len) { @@ -609,10 +609,10 @@ void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int32 pos } } -void Texts_Read (Texts_Reader *R, address *R__typ, CHAR *ch) +void Texts_Read (Texts_Reader *R, ADDRESS *R__typ, CHAR *ch) { Texts_Run u = NIL; - int32 pos; + INT32 pos; CHAR nextch; u = (*R).run; (*R).fnt = u->fnt; @@ -654,7 +654,7 @@ void Texts_Read (Texts_Reader *R, address *R__typ, CHAR *ch) } } -void Texts_ReadElem (Texts_Reader *R, address *R__typ) +void Texts_ReadElem (Texts_Reader *R, ADDRESS *R__typ) { Texts_Run u = NIL, un = NIL; u = (*R).run; @@ -682,7 +682,7 @@ void Texts_ReadElem (Texts_Reader *R, address *R__typ) } } -void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ) +void Texts_ReadPrevElem (Texts_Reader *R, ADDRESS *R__typ) { Texts_Run u = NIL; u = (*R).run->prev; @@ -704,12 +704,12 @@ void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ) } } -int32 Texts_Pos (Texts_Reader *R, address *R__typ) +INT32 Texts_Pos (Texts_Reader *R, ADDRESS *R__typ) { return (*R).org + (*R).off; } -void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int32 pos) +void Texts_OpenScanner (Texts_Scanner *S, ADDRESS *S__typ, Texts_Text T, INT32 pos) { Texts_OpenReader((void*)&*S, S__typ, T, pos); (*S).line = 0; @@ -718,10 +718,10 @@ void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int32 p static struct Scan__31 { Texts_Scanner *S; - address *S__typ; + ADDRESS *S__typ; CHAR *ch; BOOLEAN *negE; - int16 *e; + INT16 *e; struct Scan__31 *lnk; } *Scan__31_s; @@ -740,18 +740,18 @@ static void ReadScaleFactor__32 (void) } } while (('0' <= *Scan__31_s->ch && *Scan__31_s->ch <= '9')) { - *Scan__31_s->e = (*Scan__31_s->e * 10 + (int16)*Scan__31_s->ch) - 48; + *Scan__31_s->e = (*Scan__31_s->e * 10 + (INT16)*Scan__31_s->ch) - 48; Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); } } -void Texts_Scan (Texts_Scanner *S, address *S__typ) +void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) { CHAR ch, term; BOOLEAN neg, negE, hex; - int8 i, j, h; - int16 e; - int32 k; + INT8 i, j, h; + INT16 e; + INT32 k; REAL x, f; LONGREAL y, g; CHAR d[32]; @@ -812,10 +812,10 @@ void Texts_Scan (Texts_Scanner *S, address *S__typ) if ('9' < ch) { if (('A' <= ch && ch <= 'F')) { hex = 1; - ch = (CHAR)((int16)ch - 7); + ch = (CHAR)((INT16)ch - 7); } else if (('a' <= ch && ch <= 'f')) { hex = 1; - ch = (CHAR)((int16)ch - 39); + ch = (CHAR)((INT16)ch - 39); } else { break; } @@ -827,13 +827,13 @@ void Texts_Scan (Texts_Scanner *S, address *S__typ) if (i - j > 8) { j = i - 8; } - k = (int16)d[__X(j, 32)] - 48; + k = (INT16)d[__X(j, 32)] - 48; j += 1; if ((i - j == 7 && k >= 8)) { k -= 16; } while (j < i) { - k = __ASHL(k, 4) + ((int16)d[__X(j, 32)] - 48); + k = __ASHL(k, 4) + ((INT16)d[__X(j, 32)] - 48); j += 1; } if (neg) { @@ -854,12 +854,12 @@ void Texts_Scan (Texts_Scanner *S, address *S__typ) y = (LONGREAL)0; g = (LONGREAL)1; do { - y = y * (LONGREAL)10 + ((int16)d[__X(j, 32)] - 48); + y = y * (LONGREAL)10 + ((INT16)d[__X(j, 32)] - 48); j += 1; } while (!(j == h)); while (j < i) { g = g / (LONGREAL)(LONGREAL)10; - y = ((int16)d[__X(j, 32)] - 48) * g + y; + y = ((INT16)d[__X(j, 32)] - 48) * g + y; j += 1; } ReadScaleFactor__32(); @@ -886,12 +886,12 @@ void Texts_Scan (Texts_Scanner *S, address *S__typ) x = (REAL)0; f = (REAL)1; do { - x = x * (REAL)10 + ((int16)d[__X(j, 32)] - 48); + x = x * (REAL)10 + ((INT16)d[__X(j, 32)] - 48); j += 1; } while (!(j == h)); while (j < i) { f = f / (REAL)(REAL)10; - x = ((int16)d[__X(j, 32)] - 48) * f + x; + x = ((INT16)d[__X(j, 32)] - 48) * f + x; j += 1; } if (ch == 'E') { @@ -923,7 +923,7 @@ void Texts_Scan (Texts_Scanner *S, address *S__typ) (*S).class = 3; k = 0; do { - k = k * 10 + ((int16)d[__X(j, 32)] - 48); + k = k * 10 + ((INT16)d[__X(j, 32)] - 48); j += 1; } while (!(j == i)); if (neg) { @@ -951,7 +951,7 @@ void Texts_Scan (Texts_Scanner *S, address *S__typ) Scan__31_s = _s.lnk; } -void Texts_OpenWriter (Texts_Writer *W, address *W__typ) +void Texts_OpenWriter (Texts_Writer *W, ADDRESS *W__typ) { __NEW((*W).buf, Texts_BufDesc); Texts_OpenBuf((*W).buf); @@ -962,22 +962,22 @@ void Texts_OpenWriter (Texts_Writer *W, address *W__typ) Files_Set(&(*W).rider, Files_Rider__typ, (*W).file, 0); } -void Texts_SetFont (Texts_Writer *W, address *W__typ, Texts_FontsFont fnt) +void Texts_SetFont (Texts_Writer *W, ADDRESS *W__typ, Texts_FontsFont fnt) { (*W).fnt = fnt; } -void Texts_SetColor (Texts_Writer *W, address *W__typ, int8 col) +void Texts_SetColor (Texts_Writer *W, ADDRESS *W__typ, INT8 col) { (*W).col = col; } -void Texts_SetOffset (Texts_Writer *W, address *W__typ, int8 voff) +void Texts_SetOffset (Texts_Writer *W, ADDRESS *W__typ, INT8 voff) { (*W).voff = voff; } -void Texts_Write (Texts_Writer *W, address *W__typ, CHAR ch) +void Texts_Write (Texts_Writer *W, ADDRESS *W__typ, CHAR ch) { Texts_Run u = NIL, un = NIL; Texts_Piece p = NIL; @@ -1003,7 +1003,7 @@ void Texts_Write (Texts_Writer *W, address *W__typ, CHAR ch) } } -void Texts_WriteElem (Texts_Writer *W, address *W__typ, Texts_Elem e) +void Texts_WriteElem (Texts_Writer *W, ADDRESS *W__typ, Texts_Elem e) { Texts_Run u = NIL, un = NIL; if (e->base != NIL) { @@ -1022,14 +1022,14 @@ void Texts_WriteElem (Texts_Writer *W, address *W__typ, Texts_Elem e) un->prev = (Texts_Run)e; } -void Texts_WriteLn (Texts_Writer *W, address *W__typ) +void Texts_WriteLn (Texts_Writer *W, ADDRESS *W__typ) { Texts_Write(&*W, W__typ, 0x0d); } -void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGINT s__len) +void Texts_WriteString (Texts_Writer *W, ADDRESS *W__typ, CHAR *s, LONGINT s__len) { - int16 i; + INT16 i; __DUP(s, s__len, CHAR); i = 0; while (s[__X(i, s__len)] >= ' ') { @@ -1039,10 +1039,10 @@ void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGINT s__le __DEL(s); } -void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n) +void Texts_WriteInt (Texts_Writer *W, ADDRESS *W__typ, INT64 x, INT64 n) { - int16 i; - int64 x0; + INT16 i; + INT64 x0; CHAR a[24]; i = 0; if (x < 0) { @@ -1061,7 +1061,7 @@ void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n) x0 = __DIV(x0, 10); i += 1; } while (!(x0 == 0)); - while (n > (int64)i) { + while (n > (INT64)i) { Texts_Write(&*W, W__typ, ' '); n -= 1; } @@ -1074,10 +1074,10 @@ void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n) } while (!(i == 0)); } -void Texts_WriteHex (Texts_Writer *W, address *W__typ, int32 x) +void Texts_WriteHex (Texts_Writer *W, ADDRESS *W__typ, INT32 x) { - int16 i; - int32 y; + INT16 i; + INT32 y; CHAR a[20]; i = 0; Texts_Write(&*W, W__typ, ' '); @@ -1097,9 +1097,9 @@ void Texts_WriteHex (Texts_Writer *W, address *W__typ, int32 x) } while (!(i == 0)); } -void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int16 n) +void Texts_WriteReal (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n) { - int16 e; + INT16 e; REAL x0; CHAR d[9]; e = Reals_Expo(x); @@ -1169,16 +1169,16 @@ void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int16 n) static struct WriteRealFix__53 { Texts_Writer *W; - address *W__typ; - int16 *i; + ADDRESS *W__typ; + INT16 *i; CHAR (*d)[9]; struct WriteRealFix__53 *lnk; } *WriteRealFix__53_s; -static void dig__54 (int16 n); -static void seq__56 (CHAR ch, int16 n); +static void dig__54 (INT16 n); +static void seq__56 (CHAR ch, INT16 n); -static void seq__56 (CHAR ch, int16 n) +static void seq__56 (CHAR ch, INT16 n) { while (n > 0) { Texts_Write(&*WriteRealFix__53_s->W, WriteRealFix__53_s->W__typ, ch); @@ -1186,7 +1186,7 @@ static void seq__56 (CHAR ch, int16 n) } } -static void dig__54 (int16 n) +static void dig__54 (INT16 n) { while (n > 0) { *WriteRealFix__53_s->i -= 1; @@ -1195,9 +1195,9 @@ static void dig__54 (int16 n) } } -void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int16 n, int16 k) +void Texts_WriteRealFix (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n, INT16 k) { - int16 e, i; + INT16 e, i; CHAR sign; REAL x0; CHAR d[9]; @@ -1267,9 +1267,9 @@ void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int16 n, int1 WriteRealFix__53_s = _s.lnk; } -void Texts_WriteRealHex (Texts_Writer *W, address *W__typ, REAL x) +void Texts_WriteRealHex (Texts_Writer *W, ADDRESS *W__typ, REAL x) { - int16 i; + INT16 i; CHAR d[8]; Reals_ConvertH(x, (void*)d, 8); i = 0; @@ -1279,9 +1279,9 @@ void Texts_WriteRealHex (Texts_Writer *W, address *W__typ, REAL x) } while (!(i == 8)); } -void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int16 n) +void Texts_WriteLongReal (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x, INT16 n) { - int16 e; + INT16 e; LONGREAL x0; CHAR d[16]; e = Reals_ExpoL(x); @@ -1313,7 +1313,7 @@ void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int16 n) } else { Texts_Write(&*W, W__typ, ' '); } - e = (int16)__ASHR((e - 1023) * 77, 8); + e = (INT16)__ASHR((e - 1023) * 77, 8); if (e >= 0) { x = x / (LONGREAL)Reals_TenL(e); } else { @@ -1351,9 +1351,9 @@ void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int16 n) } } -void Texts_WriteLongRealHex (Texts_Writer *W, address *W__typ, LONGREAL x) +void Texts_WriteLongRealHex (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x) { - int16 i; + INT16 i; CHAR d[16]; Reals_ConvertHL(x, (void*)d, 16); i = 0; @@ -1365,20 +1365,20 @@ void Texts_WriteLongRealHex (Texts_Writer *W, address *W__typ, LONGREAL x) static struct WriteDate__43 { Texts_Writer *W; - address *W__typ; + ADDRESS *W__typ; struct WriteDate__43 *lnk; } *WriteDate__43_s; -static void WritePair__44 (CHAR ch, int32 x); +static void WritePair__44 (CHAR ch, INT32 x); -static void WritePair__44 (CHAR ch, int32 x) +static void WritePair__44 (CHAR ch, INT32 x) { Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, ch); Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)(__DIV(x, 10) + 48)); Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)((int)__MOD(x, 10) + 48)); } -void Texts_WriteDate (Texts_Writer *W, address *W__typ, int32 t, int32 d) +void Texts_WriteDate (Texts_Writer *W, ADDRESS *W__typ, INT32 t, INT32 d) { struct WriteDate__43 _s; _s.W = W; _s.W__typ = W__typ; @@ -1395,22 +1395,22 @@ void Texts_WriteDate (Texts_Writer *W, address *W__typ, int32 t, int32 d) static struct Load0__16 { Texts_Text *T; - int8 *ecnt; + INT8 *ecnt; Files_File *f; Texts_FileMsg *msg; CHAR (*mods)[64][32], (*procs)[64][32]; struct Load0__16 *lnk; } *Load0__16_s; -static void LoadElem__17 (Files_Rider *r, address *r__typ, int32 pos, int32 span, Texts_Elem *e); +static void LoadElem__17 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e); -static void LoadElem__17 (Files_Rider *r, address *r__typ, int32 pos, int32 span, Texts_Elem *e) +static void LoadElem__17 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e) { Modules_Module M = NIL; Modules_Command Cmd; Texts_Alien a = NIL; - int32 org, ew, eh; - int8 eno; + INT32 org, ew, eh; + INT8 eno; Texts_new = NIL; Files_ReadLInt(&*r, r__typ, &ew); Files_ReadLInt(&*r, r__typ, &eh); @@ -1455,13 +1455,13 @@ static void LoadElem__17 (Files_Rider *r, address *r__typ, int32 pos, int32 span } } -static void Texts_Load0 (Files_Rider *r, address *r__typ, Texts_Text T) +static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) { Texts_Run u = NIL, un = NIL; Texts_Piece p = NIL; Texts_Elem e = NIL; - int32 org, pos, hlen, plen; - int8 ecnt, fcnt, fno, col, voff; + INT32 org, pos, hlen, plen; + INT8 ecnt, fcnt, fno, col, voff; Files_File f = NIL; Texts_FileMsg msg; CHAR mods[64][32], procs[64][32]; @@ -1529,9 +1529,9 @@ static void Texts_Load0 (Files_Rider *r, address *r__typ, Texts_Text T) Load0__16_s = _s.lnk; } -void Texts_Load (Files_Rider *r, address *r__typ, Texts_Text T) +void Texts_Load (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) { - int16 tag; + INT16 tag; Files_ReadInt(&*r, r__typ, &tag); if (tag != -4095) { Files_Set(&*r, r__typ, Files_Base(&*r, r__typ), Files_Pos(&*r, r__typ) - 2); @@ -1546,7 +1546,7 @@ void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len) Texts_Run u = NIL; Texts_Piece p = NIL; CHAR tag, version; - int32 hlen; + INT32 hlen; __DUP(name, name__len, CHAR); f = Files_Old(name, name__len); if (f == NIL) { @@ -1596,20 +1596,20 @@ void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len) } static struct Store__39 { - int8 *ecnt; + INT8 *ecnt; Texts_FileMsg *msg; Texts_IdentifyMsg *iden; CHAR (*mods)[64][32], (*procs)[64][32]; struct Store__39 *lnk; } *Store__39_s; -static void StoreElem__40 (Files_Rider *r, address *r__typ, int32 pos, Texts_Elem e); +static void StoreElem__40 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e); -static void StoreElem__40 (Files_Rider *r, address *r__typ, int32 pos, Texts_Elem e) +static void StoreElem__40 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e) { Files_Rider r1; - int32 org, span; - int8 eno; + INT32 org, span; + INT8 eno; __COPY((*Store__39_s->iden).mod, (*Store__39_s->mods)[__X(*Store__39_s->ecnt, 64)], 32); __COPY((*Store__39_s->iden).proc, (*Store__39_s->procs)[__X(*Store__39_s->ecnt, 64)], 32); eno = 1; @@ -1635,15 +1635,15 @@ static void StoreElem__40 (Files_Rider *r, address *r__typ, int32 pos, Texts_Ele Files_WriteLInt(&r1, Files_Rider__typ, e->H); } -void Texts_Store (Files_Rider *r, address *r__typ, Texts_Text T) +void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) { Files_Rider r1; Texts_Run u = NIL, un = NIL; Texts_Elem e = NIL; - int32 org, pos, delta, hlen, rlen; - int8 ecnt, fcnt; + INT32 org, pos, delta, hlen, rlen; + INT8 ecnt, fcnt; CHAR ch; - int8 fno; + INT8 fno; Texts_FileMsg msg; Texts_IdentifyMsg iden; CHAR mods[64][32], procs[64][32]; @@ -1759,7 +1759,7 @@ void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len) { Files_File f = NIL; Files_Rider r; - int16 i, res; + INT16 i, res; CHAR bak[64]; __DUP(name, name__len, CHAR); f = Files_New(name, name__len); diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index 1d663861..bff9cc72 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h @@ -8,8 +8,8 @@ typedef struct Texts_BufDesc { - int32 len; - int64 _prvt0; + INT32 len; + INT64 _prvt0; } Texts_BufDesc; typedef @@ -30,26 +30,26 @@ typedef typedef struct Texts_RunDesc { - int64 _prvt0; + INT64 _prvt0; char _prvt1[27]; } Texts_RunDesc; typedef - void (*Texts_Handler)(Texts_Elem, Texts_ElemMsg*, address *); + void (*Texts_Handler)(Texts_Elem, Texts_ElemMsg*, ADDRESS *); typedef struct Texts_ElemDesc { - int64 _prvt0; + INT64 _prvt0; char _prvt1[28]; - int32 W, H; + INT32 W, H; Texts_Handler handle; char _prvt2[8]; } Texts_ElemDesc; typedef struct Texts_FileMsg { /* Texts_ElemMsg */ - int16 id; - int32 pos; + INT16 id; + INT32 pos; Files_Rider r; } Texts_FileMsg; @@ -70,13 +70,13 @@ typedef struct Texts_TextDesc *Texts_Text; typedef - void (*Texts_Notifier)(Texts_Text, int16, int32, int32); + void (*Texts_Notifier)(Texts_Text, INT16, INT32, INT32); typedef struct Texts_Reader { BOOLEAN eot; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; Texts_Elem elem; char _prvt0[40]; } Texts_Reader; @@ -85,22 +85,22 @@ typedef struct Texts_Scanner { /* Texts_Reader */ BOOLEAN eot; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; Texts_Elem elem; char _prvt0[40]; CHAR nextCh; - int16 line, class; - int32 i; + INT16 line, class; + INT32 i; REAL x; LONGREAL y; CHAR c; - int8 len; + INT8 len; CHAR s[64]; } Texts_Scanner; typedef struct Texts_TextDesc { - int32 len; + INT32 len; Texts_Notifier notify; char _prvt0[20]; } Texts_TextDesc; @@ -109,64 +109,64 @@ typedef struct Texts_Writer { Texts_Buffer buf; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; char _prvt0[38]; } Texts_Writer; import Texts_Elem Texts_new; -import address *Texts_FontDesc__typ; -import address *Texts_RunDesc__typ; -import address *Texts_ElemMsg__typ; -import address *Texts_ElemDesc__typ; -import address *Texts_FileMsg__typ; -import address *Texts_CopyMsg__typ; -import address *Texts_IdentifyMsg__typ; -import address *Texts_BufDesc__typ; -import address *Texts_TextDesc__typ; -import address *Texts_Reader__typ; -import address *Texts_Scanner__typ; -import address *Texts_Writer__typ; +import ADDRESS *Texts_FontDesc__typ; +import ADDRESS *Texts_RunDesc__typ; +import ADDRESS *Texts_ElemMsg__typ; +import ADDRESS *Texts_ElemDesc__typ; +import ADDRESS *Texts_FileMsg__typ; +import ADDRESS *Texts_CopyMsg__typ; +import ADDRESS *Texts_IdentifyMsg__typ; +import ADDRESS *Texts_BufDesc__typ; +import ADDRESS *Texts_TextDesc__typ; +import ADDRESS *Texts_Reader__typ; +import ADDRESS *Texts_Scanner__typ; +import ADDRESS *Texts_Writer__typ; import void Texts_Append (Texts_Text T, Texts_Buffer B); -import void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, uint32 sel, Texts_FontsFont fnt, int8 col, int8 voff); +import void Texts_ChangeLooks (Texts_Text T, INT32 beg, INT32 end, UINT32 sel, Texts_FontsFont fnt, INT8 col, INT8 voff); import void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len); import void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); import void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); -import void Texts_Delete (Texts_Text T, int32 beg, int32 end); +import void Texts_Delete (Texts_Text T, INT32 beg, INT32 end); import Texts_Text Texts_ElemBase (Texts_Elem E); -import int32 Texts_ElemPos (Texts_Elem E); -import void Texts_Insert (Texts_Text T, int32 pos, Texts_Buffer B); -import void Texts_Load (Files_Rider *r, address *r__typ, Texts_Text T); +import INT32 Texts_ElemPos (Texts_Elem E); +import void Texts_Insert (Texts_Text T, INT32 pos, Texts_Buffer B); +import void Texts_Load (Files_Rider *r, ADDRESS *r__typ, Texts_Text T); import void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len); import void Texts_OpenBuf (Texts_Buffer B); -import void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int32 pos); -import void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int32 pos); -import void Texts_OpenWriter (Texts_Writer *W, address *W__typ); -import int32 Texts_Pos (Texts_Reader *R, address *R__typ); -import void Texts_Read (Texts_Reader *R, address *R__typ, CHAR *ch); -import void Texts_ReadElem (Texts_Reader *R, address *R__typ); -import void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ); +import void Texts_OpenReader (Texts_Reader *R, ADDRESS *R__typ, Texts_Text T, INT32 pos); +import void Texts_OpenScanner (Texts_Scanner *S, ADDRESS *S__typ, Texts_Text T, INT32 pos); +import void Texts_OpenWriter (Texts_Writer *W, ADDRESS *W__typ); +import INT32 Texts_Pos (Texts_Reader *R, ADDRESS *R__typ); +import void Texts_Read (Texts_Reader *R, ADDRESS *R__typ, CHAR *ch); +import void Texts_ReadElem (Texts_Reader *R, ADDRESS *R__typ); +import void Texts_ReadPrevElem (Texts_Reader *R, ADDRESS *R__typ); import void Texts_Recall (Texts_Buffer *B); -import void Texts_Save (Texts_Text T, int32 beg, int32 end, Texts_Buffer B); -import void Texts_Scan (Texts_Scanner *S, address *S__typ); -import void Texts_SetColor (Texts_Writer *W, address *W__typ, int8 col); -import void Texts_SetFont (Texts_Writer *W, address *W__typ, Texts_FontsFont fnt); -import void Texts_SetOffset (Texts_Writer *W, address *W__typ, int8 voff); -import void Texts_Store (Files_Rider *r, address *r__typ, Texts_Text T); -import void Texts_Write (Texts_Writer *W, address *W__typ, CHAR ch); -import void Texts_WriteDate (Texts_Writer *W, address *W__typ, int32 t, int32 d); -import void Texts_WriteElem (Texts_Writer *W, address *W__typ, Texts_Elem e); -import void Texts_WriteHex (Texts_Writer *W, address *W__typ, int32 x); -import void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n); -import void Texts_WriteLn (Texts_Writer *W, address *W__typ); -import void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int16 n); -import void Texts_WriteLongRealHex (Texts_Writer *W, address *W__typ, LONGREAL x); -import void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int16 n); -import void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int16 n, int16 k); -import void Texts_WriteRealHex (Texts_Writer *W, address *W__typ, REAL x); -import void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGINT s__len); +import void Texts_Save (Texts_Text T, INT32 beg, INT32 end, Texts_Buffer B); +import void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ); +import void Texts_SetColor (Texts_Writer *W, ADDRESS *W__typ, INT8 col); +import void Texts_SetFont (Texts_Writer *W, ADDRESS *W__typ, Texts_FontsFont fnt); +import void Texts_SetOffset (Texts_Writer *W, ADDRESS *W__typ, INT8 voff); +import void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T); +import void Texts_Write (Texts_Writer *W, ADDRESS *W__typ, CHAR ch); +import void Texts_WriteDate (Texts_Writer *W, ADDRESS *W__typ, INT32 t, INT32 d); +import void Texts_WriteElem (Texts_Writer *W, ADDRESS *W__typ, Texts_Elem e); +import void Texts_WriteHex (Texts_Writer *W, ADDRESS *W__typ, INT32 x); +import void Texts_WriteInt (Texts_Writer *W, ADDRESS *W__typ, INT64 x, INT64 n); +import void Texts_WriteLn (Texts_Writer *W, ADDRESS *W__typ); +import void Texts_WriteLongReal (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x, INT16 n); +import void Texts_WriteLongRealHex (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x); +import void Texts_WriteReal (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n); +import void Texts_WriteRealFix (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n, INT16 k); +import void Texts_WriteRealHex (Texts_Writer *W, ADDRESS *W__typ, REAL x); +import void Texts_WriteString (Texts_Writer *W, ADDRESS *W__typ, CHAR *s, LONGINT s__len); import void *Texts__init(void); diff --git a/bootstrap/windows-88/VT100.c b/bootstrap/windows-88/VT100.c index c3a9491f..b5067d33 100644 --- a/bootstrap/windows-88/VT100.c +++ b/bootstrap/windows-88/VT100.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "Out.h" @@ -14,36 +14,36 @@ export CHAR VT100_CSI[5]; static CHAR VT100_tmpstr[32]; -export void VT100_CHA (int16 n); -export void VT100_CNL (int16 n); -export void VT100_CPL (int16 n); -export void VT100_CUB (int16 n); -export void VT100_CUD (int16 n); -export void VT100_CUF (int16 n); -export void VT100_CUP (int16 n, int16 m); -export void VT100_CUU (int16 n); +export void VT100_CHA (INT16 n); +export void VT100_CNL (INT16 n); +export void VT100_CPL (INT16 n); +export void VT100_CUB (INT16 n); +export void VT100_CUD (INT16 n); +export void VT100_CUF (INT16 n); +export void VT100_CUP (INT16 n, INT16 m); +export void VT100_CUU (INT16 n); export void VT100_DECTCEMh (void); export void VT100_DECTCEMl (void); -export void VT100_DSR (int16 n); -export void VT100_ED (int16 n); -export void VT100_EL (int16 n); -static void VT100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len); +export void VT100_DSR (INT16 n); +export void VT100_ED (INT16 n); +export void VT100_EL (INT16 n); +static void VT100_EscSeq (INT16 n, CHAR *letter, LONGINT letter__len); static void VT100_EscSeq0 (CHAR *letter, LONGINT letter__len); -static void VT100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len); -static void VT100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len); -export void VT100_HVP (int16 n, int16 m); -export void VT100_IntToStr (int32 int_, CHAR *str, LONGINT str__len); +static void VT100_EscSeq2 (INT16 n, INT16 m, CHAR *letter, LONGINT letter__len); +static void VT100_EscSeqSwapped (INT16 n, CHAR *letter, LONGINT letter__len); +export void VT100_HVP (INT16 n, INT16 m); +export void VT100_IntToStr (INT32 int_, CHAR *str, LONGINT str__len); export void VT100_RCP (void); -static void VT100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end); +static void VT100_Reverse0 (CHAR *str, LONGINT str__len, INT16 start, INT16 end); export void VT100_SCP (void); -export void VT100_SD (int16 n); -export void VT100_SGR (int16 n); -export void VT100_SGR2 (int16 n, int16 m); -export void VT100_SU (int16 n); +export void VT100_SD (INT16 n); +export void VT100_SGR (INT16 n); +export void VT100_SGR2 (INT16 n, INT16 m); +export void VT100_SU (INT16 n); export void VT100_SetAttr (CHAR *attr, LONGINT attr__len); -static void VT100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end) +static void VT100_Reverse0 (CHAR *str, LONGINT str__len, INT16 start, INT16 end) { CHAR h; while (start < end) { @@ -55,11 +55,11 @@ static void VT100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end) } } -void VT100_IntToStr (int32 int_, CHAR *str, LONGINT str__len) +void VT100_IntToStr (INT32 int_, CHAR *str, LONGINT str__len) { CHAR b[21]; - int16 s, e; - int8 maxLength; + INT16 s, e; + INT8 maxLength; maxLength = 11; if (int_ == (-2147483647-1)) { __MOVE("-2147483648", b, 12); @@ -94,7 +94,7 @@ static void VT100_EscSeq0 (CHAR *letter, LONGINT letter__len) __DEL(letter); } -static void VT100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len) +static void VT100_EscSeq (INT16 n, CHAR *letter, LONGINT letter__len) { CHAR nstr[2]; CHAR cmd[7]; @@ -107,7 +107,7 @@ static void VT100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len) __DEL(letter); } -static void VT100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len) +static void VT100_EscSeqSwapped (INT16 n, CHAR *letter, LONGINT letter__len) { CHAR nstr[2]; CHAR cmd[7]; @@ -120,7 +120,7 @@ static void VT100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len) __DEL(letter); } -static void VT100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len) +static void VT100_EscSeq2 (INT16 n, INT16 m, CHAR *letter, LONGINT letter__len) { CHAR nstr[5], mstr[5]; CHAR cmd[12]; @@ -136,82 +136,82 @@ static void VT100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len) __DEL(letter); } -void VT100_CUU (int16 n) +void VT100_CUU (INT16 n) { VT100_EscSeq(n, (CHAR*)"A", 2); } -void VT100_CUD (int16 n) +void VT100_CUD (INT16 n) { VT100_EscSeq(n, (CHAR*)"B", 2); } -void VT100_CUF (int16 n) +void VT100_CUF (INT16 n) { VT100_EscSeq(n, (CHAR*)"C", 2); } -void VT100_CUB (int16 n) +void VT100_CUB (INT16 n) { VT100_EscSeq(n, (CHAR*)"D", 2); } -void VT100_CNL (int16 n) +void VT100_CNL (INT16 n) { VT100_EscSeq(n, (CHAR*)"E", 2); } -void VT100_CPL (int16 n) +void VT100_CPL (INT16 n) { VT100_EscSeq(n, (CHAR*)"F", 2); } -void VT100_CHA (int16 n) +void VT100_CHA (INT16 n) { VT100_EscSeq(n, (CHAR*)"G", 2); } -void VT100_CUP (int16 n, int16 m) +void VT100_CUP (INT16 n, INT16 m) { VT100_EscSeq2(n, m, (CHAR*)"H", 2); } -void VT100_ED (int16 n) +void VT100_ED (INT16 n) { VT100_EscSeq(n, (CHAR*)"J", 2); } -void VT100_EL (int16 n) +void VT100_EL (INT16 n) { VT100_EscSeq(n, (CHAR*)"K", 2); } -void VT100_SU (int16 n) +void VT100_SU (INT16 n) { VT100_EscSeq(n, (CHAR*)"S", 2); } -void VT100_SD (int16 n) +void VT100_SD (INT16 n) { VT100_EscSeq(n, (CHAR*)"T", 2); } -void VT100_HVP (int16 n, int16 m) +void VT100_HVP (INT16 n, INT16 m) { VT100_EscSeq2(n, m, (CHAR*)"f", 2); } -void VT100_SGR (int16 n) +void VT100_SGR (INT16 n) { VT100_EscSeq(n, (CHAR*)"m", 2); } -void VT100_SGR2 (int16 n, int16 m) +void VT100_SGR2 (INT16 n, INT16 m) { VT100_EscSeq2(n, m, (CHAR*)"m", 2); } -void VT100_DSR (int16 n) +void VT100_DSR (INT16 n) { VT100_EscSeq(6, (CHAR*)"n", 2); } diff --git a/bootstrap/windows-88/VT100.h b/bootstrap/windows-88/VT100.h index ee0408bb..d9aa6ab7 100644 --- a/bootstrap/windows-88/VT100.h +++ b/bootstrap/windows-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef VT100__h #define VT100__h @@ -9,27 +9,27 @@ import CHAR VT100_CSI[5]; -import void VT100_CHA (int16 n); -import void VT100_CNL (int16 n); -import void VT100_CPL (int16 n); -import void VT100_CUB (int16 n); -import void VT100_CUD (int16 n); -import void VT100_CUF (int16 n); -import void VT100_CUP (int16 n, int16 m); -import void VT100_CUU (int16 n); +import void VT100_CHA (INT16 n); +import void VT100_CNL (INT16 n); +import void VT100_CPL (INT16 n); +import void VT100_CUB (INT16 n); +import void VT100_CUD (INT16 n); +import void VT100_CUF (INT16 n); +import void VT100_CUP (INT16 n, INT16 m); +import void VT100_CUU (INT16 n); import void VT100_DECTCEMh (void); import void VT100_DECTCEMl (void); -import void VT100_DSR (int16 n); -import void VT100_ED (int16 n); -import void VT100_EL (int16 n); -import void VT100_HVP (int16 n, int16 m); -import void VT100_IntToStr (int32 int_, CHAR *str, LONGINT str__len); +import void VT100_DSR (INT16 n); +import void VT100_ED (INT16 n); +import void VT100_EL (INT16 n); +import void VT100_HVP (INT16 n, INT16 m); +import void VT100_IntToStr (INT32 int_, CHAR *str, LONGINT str__len); import void VT100_RCP (void); import void VT100_SCP (void); -import void VT100_SD (int16 n); -import void VT100_SGR (int16 n); -import void VT100_SGR2 (int16 n, int16 m); -import void VT100_SU (int16 n); +import void VT100_SD (INT16 n); +import void VT100_SGR (INT16 n); +import void VT100_SGR2 (INT16 n, INT16 m); +import void VT100_SU (INT16 n); import void VT100_SetAttr (CHAR *attr, LONGINT attr__len); import void *VT100__init(void); diff --git a/bootstrap/windows-88/errors.c b/bootstrap/windows-88/errors.c index cce1644f..2a1a7a02 100644 --- a/bootstrap/windows-88/errors.c +++ b/bootstrap/windows-88/errors.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" diff --git a/bootstrap/windows-88/errors.h b/bootstrap/windows-88/errors.h index 9d34f721..5555899e 100644 --- a/bootstrap/windows-88/errors.h +++ b/bootstrap/windows-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index d2dcce53..8ed00f14 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "Configuration.h" @@ -24,7 +24,7 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGINT cmd__len) { - int16 r, status, exitcode; + INT16 r, status, exitcode; __DUP(title, title__len, CHAR); __DUP(cmd, cmd__len, CHAR); if (__IN(18, OPM_Options, 32)) { diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index 2e262037..ad76f7b6 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/doc/Features.md b/doc/Features.md index 6ed5d420..21ab306e 100644 --- a/doc/Features.md +++ b/doc/Features.md @@ -16,15 +16,15 @@ integer and set types, it is not. Some examples: it tries to store the flag value to a file using standard library functions. The Oakwood guidelines specify that INTEGER be stored in 16 bits on file regardless of it's size in memory*. - + - Code that assumes that INTEGER values wrap around at known values will fail. For example - i: SHORTINT; ... i := 127; INC(i); will produce -128 on original systems, but +128 on - systems with a larger SHORTINT representation. - + i: SHORTINT; ... i := 127; INC(i); will produce -128 on original systems, but +128 on + systems with a larger SHORTINT representation. + - Bit manipulation code that uses SYSTEM.VAL to access parts of values will access the wrong number of bits. For example, the implementation of REAL and LONGREAL library functions use SYSTEM.VAL(SET, realvalue) to access and change the sign, mantissa and exponent of REALs. - + Therefore we provide compilation options to select the representation of SHORTINT, INTEGER, LONGINT and SET. \* It makes sense for Oakwood to insist on fixed sizes for the standard types as this is a pre-requisite @@ -33,7 +33,7 @@ for stable file exchange between different builds of applications, and between d #### Compiler options for integer and set sizes. -The -O2 and -OC compiler options select nbetween the two most commonly used integer and set +The -O2 and -OC compiler options select between the two most commonly used integer and set type implementations. | Type | -O2 option (default) | -OC option | @@ -46,18 +46,22 @@ type implementations. The following Oberon types are independent of compiler size: -| Types | Size | -| ----- | -------| -| REAL | 32 bit | -| LONGREAL | 64 bit | -| HUGEINT* | 64 bit | -| CHAR** | 8 bit | +| Types | Size | +| ----- | ------- | +| REAL | 32 bit floating point | +| LONGREAL | 64 bit floating point | +| HUGEINT* | 64 bit signed integer | +| BYTE** | 8 bit signed integer (-OC model only) | +| CHAR*** | 8 bit character | \* The additional type HUGEINT is predefined as a 64 bit integer, providing 64 bit support even in -O2 compilations. -\** No built-in support is provided for the UTF-16 or UCS-2 Unicode encodings. UTF-8 is the recommended Unicode encoding for text. - - 16 bits has been insufficient for the Unicode character repetoire for at least 15 years. +\** The additional type BYTE is defined for -OC (Component Pascal) model only and is a *signed* +8 bit integer. + +\*** No built-in support is provided for the UTF-16 or UCS-2 Unicode encodings. UTF-8 is the recommended Unicode encoding for text. + - 16 bits has been insufficient for the Unicode character repetoire for at least 15 years. - Writing systems often require more than one unicode codepoint to represent a single character (and what constitutes a character can vary according to context). - UTF-8 is now widely used. @@ -89,11 +93,22 @@ In -O2, where LONGINT is 32 bits, LONG() now accepts a LONGINT value returning a In -OC, where SHORTINT is 16 bits, SHORT() now accepts a SHORTINT value returning a SYSTEM.INT8 value. +#### ASH() + +The Arithmetic shift function is defined by Oberon-2 as follows: + +| Name | Argument types | Result Type | Function | +| ---- | --- | --- | --- | +| ASH(*x*, *n*) | *x*, *n*: integer type | LONGINT | arithmetic shift (*x* * 2^*n*) | + +For compatability this definition is retained for all integer types up to LONGINT in size. +Additionally, when *x* is the new HUGEINT type, the result is HUGEINT. + #### Pointers and Addresses Most Oberon systems have implicitly or explicitly assumed that LONGINT is large enough to hold -machine addresses. With the requirement to support 32 bit LONGINT on 64 bit systems, this is no +machine addresses. With the requirement to support 32 bit LONGINT on 64 bit systems, this is no longer possible. The type SYSTEM.ADDRESS is added, a signed integer type equivalent to either SYSTEM.INT32 or SYSTEM.INT64 according to the system address size. diff --git a/src/compiler/OPC.Mod b/src/compiler/OPC.Mod index ba59ef22..5670546e 100644 --- a/src/compiler/OPC.Mod +++ b/src/compiler/OPC.Mod @@ -39,7 +39,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) VAR indentLevel: INTEGER; hashtab: ARRAY 105 OF SHORTINT; - keytab: ARRAY 50, 9 OF CHAR; + keytab: ARRAY 60 (*50*), 9 OF CHAR; GlbPtrs: BOOLEAN; BodyNameExt: ARRAY 13 OF CHAR; @@ -112,9 +112,9 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) IF keytab[hashtab[h]] = obj^.name THEN OPM.Write('_') END END ELSIF (mode = OPT.Typ) & (obj.typ.form IN {OPT.Int, OPT.Set}) THEN - IF obj.typ = OPT.adrtyp THEN OPM.WriteString("address") + IF obj.typ = OPT.adrtyp THEN OPM.WriteString("ADDRESS") ELSE - IF obj.typ.form = OPT.Int THEN OPM.WriteString("int") ELSE OPM.WriteString("uint") END; + IF obj.typ.form = OPT.Int THEN OPM.WriteString("INT") ELSE OPM.WriteString("UINT") END; OPM.WriteInt(obj.typ.size*8) END ELSE @@ -568,9 +568,9 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) DEC(gap, (adr - off) + align); BegStat; CASE align OF - |2: OPM.WriteString("int16") - |4: OPM.WriteString("int32") - |8: OPM.WriteString("int64") + |2: OPM.WriteString("INT16") + |4: OPM.WriteString("INT32") + |8: OPM.WriteString("INT64") ELSE OPM.LogWLn; OPM.LogWStr("Unexpected enclosing alignment in FillGap.") END; Str1(" _prvt#", n); INC(n); EndStat; @@ -659,7 +659,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) OPM.WriteString("LONGINT "); LenList(obj, FALSE, TRUE) ELSIF (obj^.mode = OPT.VarPar) & (obj^.typ^.comp = OPT.Record) THEN EndStat; BegStat; - OPM.WriteString("address *"); Ident(obj); OPM.WriteString(TagExt); + OPM.WriteString("ADDRESS *"); Ident(obj); OPM.WriteString(TagExt); base := NIL ELSIF (OPM.ptrinit IN OPM.Options) & (vis = 0) & (obj^.mnolev > 0) & (obj^.typ^.form = OPT.Pointer) THEN OPM.WriteString(" = NIL") @@ -687,7 +687,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) OPM.WriteString(", LONGINT "); LenList(obj, TRUE, showParamNames) ELSIF (obj^.mode = OPT.VarPar) & (obj^.typ^.comp = OPT.Record) THEN - OPM.WriteString(", address *"); + OPM.WriteString(", ADDRESS *"); IF showParamNames THEN Ident(obj); OPM.WriteString(TagExt) END END ; IF (obj^.link = NIL) OR (obj^.link.mode = OPT.TProc) THEN EXIT END ; @@ -751,7 +751,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) ELSIF (typ^.strobj # NIL) & (typ^.strobj^.mnolev > 0) THEN OPM.WriteString('static ') ELSE OPM.WriteString(Export) END ; - OPM.WriteString("address *"); Andent(typ); OPM.WriteString(DynTypExt); + OPM.WriteString("ADDRESS *"); Andent(typ); OPM.WriteString(DynTypExt); EndStat END ; n := n^.link @@ -823,10 +823,10 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) OPM.WriteLn; (* Define model dependent type sizes *) - OPM.WriteString("#define SHORTINT int"); OPM.WriteInt(OPT.sinttyp.size*8); OPM.WriteLn; - OPM.WriteString("#define INTEGER int"); OPM.WriteInt(OPT.inttyp.size*8); OPM.WriteLn; - OPM.WriteString("#define LONGINT int"); OPM.WriteInt(OPT.linttyp.size*8); OPM.WriteLn; - OPM.WriteString("#define SET uint"); OPM.WriteInt(OPT.settyp.size*8); OPM.WriteLn; + OPM.WriteString("#define SHORTINT INT"); OPM.WriteInt(OPT.sinttyp.size*8); OPM.WriteLn; + OPM.WriteString("#define INTEGER INT"); OPM.WriteInt(OPT.inttyp.size*8); OPM.WriteLn; + OPM.WriteString("#define LONGINT INT"); OPM.WriteInt(OPT.linttyp.size*8); OPM.WriteLn; + OPM.WriteString("#define SET UINT"); OPM.WriteInt(OPT.settyp.size*8); OPM.WriteLn; OPM.WriteLn; Include(BasicIncludeFile); @@ -1204,7 +1204,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) PROCEDURE IntLiteral*(n: SYSTEM.INT64; size: LONGINT); BEGIN IF (size > OPM.CIntSize) & (n <= OPM.CIntMax) & (n > OPM.CIntMin) THEN - OPM.WriteString("((int"); OPM.WriteInt(size*8); OPM.WriteString(")("); + OPM.WriteString("((INT"); OPM.WriteInt(size*8); OPM.WriteString(")("); OPM.WriteInt(n); OPM.WriteString("))") ELSE OPM.WriteInt(n) @@ -1264,8 +1264,27 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) END Enter; BEGIN n := 0; - FOR i := 0 TO 104 DO hashtab[i] := -1 END ; + FOR i := 0 TO LEN(hashtab)-1 DO hashtab[i] := -1 END ; + Enter("ADDRESS"); (* pseudo keyword used by voc *) + Enter("INT16"); (* pseudo keyword used by voc *) + Enter("INT32"); (* pseudo keyword used by voc *) + Enter("INT64"); (* pseudo keyword used by voc *) + Enter("INT8"); (* pseudo keyword used by voc *) + Enter("UINT16"); (* pseudo keyword used by voc *) + Enter("UINT32"); (* pseudo keyword used by voc *) + Enter("UINT64"); (* pseudo keyword used by voc *) + Enter("UINT8"); (* pseudo keyword used by voc *) + Enter("address"); (* pseudo keyword used by voc *) + Enter("int16"); (* pseudo keyword used by voc *) + Enter("int32"); (* pseudo keyword used by voc *) + Enter("int64"); (* pseudo keyword used by voc *) + Enter("int8"); (* pseudo keyword used by voc *) + Enter("uint16"); (* pseudo keyword used by voc *) + Enter("uint32"); (* pseudo keyword used by voc *) + Enter("uint64"); (* pseudo keyword used by voc *) + Enter("uint8"); (* pseudo keyword used by voc *) + Enter("asm"); Enter("auto"); Enter("break"); @@ -1287,10 +1306,6 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) Enter("if"); Enter("import"); (* pseudo keyword used by voc *) Enter("int"); - Enter("int16"); (* pseudo keyword used by voc *) - Enter("int32"); (* pseudo keyword used by voc *) - Enter("int64"); (* pseudo keyword used by voc *) - Enter("int8"); (* pseudo keyword used by voc *) Enter("long"); Enter("register"); Enter("return"); @@ -1302,10 +1317,6 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) Enter("struct"); Enter("switch"); Enter("typedef"); - Enter("uint16"); (* pseudo keyword used by voc *) - Enter("uint32"); (* pseudo keyword used by voc *) - Enter("uint64"); (* pseudo keyword used by voc *) - Enter("uint8"); (* pseudo keyword used by voc *) Enter("union"); Enter("unsigned"); Enter("void"); diff --git a/src/compiler/OPV.Mod b/src/compiler/OPV.Mod index cc3c93ef..318a0847 100644 --- a/src/compiler/OPV.Mod +++ b/src/compiler/OPV.Mod @@ -240,7 +240,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 OPM.WriteInt(OPM.SignedMaximum(to) + 1); OPM.Write(CloseParen) ELSE IF (n.typ.size # to) & ((n.typ.size > OPM.CIntSize) OR (to # OPM.CIntSize)) THEN - OPM.WriteString("(int"); OPM.WriteInt(to*8); OPM.WriteString(")") + OPM.WriteString("(INT"); OPM.WriteInt(to*8); OPM.WriteString(")") END END END SizeCast; diff --git a/src/runtime/Platformunix.Mod b/src/runtime/Platformunix.Mod index 5359a664..3ca44012 100644 --- a/src/runtime/Platformunix.Mod +++ b/src/runtime/Platformunix.Mod @@ -110,7 +110,7 @@ BEGIN RETURN e = EINTR() END Interrupted; (* OS memory allocaton *) -PROCEDURE -allocate (size: SYSTEM.ADDRESS): SYSTEM.ADDRESS "(address)((void*)malloc((size_t)size))"; +PROCEDURE -allocate (size: SYSTEM.ADDRESS): SYSTEM.ADDRESS "(ADDRESS)((void*)malloc((size_t)size))"; PROCEDURE OSAllocate*(size: SYSTEM.ADDRESS): SYSTEM.ADDRESS; BEGIN RETURN allocate(size) END OSAllocate; PROCEDURE -free(address: SYSTEM.ADDRESS) "free((void*)address)"; @@ -193,7 +193,7 @@ END ArgPos; (* Signals and traps *) -PROCEDURE -sethandler(s: INTEGER; h: SignalHandler) "SystemSetHandler(s, (address)h)"; +PROCEDURE -sethandler(s: INTEGER; h: SignalHandler) "SystemSetHandler(s, (ADDRESS)h)"; PROCEDURE SetInterruptHandler*(handler: SignalHandler); BEGIN sethandler(2, handler); END SetInterruptHandler; @@ -373,7 +373,7 @@ END Size; PROCEDURE -readfile (fd: LONGINT; p: SYSTEM.ADDRESS; l: LONGINT): LONGINT -"(LONGINT)read(fd, (void*)(address)(p), l)"; +"(LONGINT)read(fd, (void*)(ADDRESS)(p), l)"; PROCEDURE Read*(h: FileHandle; p: SYSTEM.ADDRESS; l: LONGINT; VAR n: LONGINT): ErrorCode; BEGIN @@ -390,7 +390,7 @@ END ReadBuf; PROCEDURE -writefile(fd: LONGINT; p: SYSTEM.ADDRESS; l: LONGINT): SYSTEM.ADDRESS -"write(fd, (void*)(address)(p), l)"; +"write(fd, (void*)(ADDRESS)(p), l)"; PROCEDURE Write*(h: FileHandle; p: SYSTEM.ADDRESS; l: LONGINT): ErrorCode; VAR written: SYSTEM.ADDRESS; diff --git a/src/runtime/Platformwindows.Mod b/src/runtime/Platformwindows.Mod index bc9e4fd3..1ef34d49 100644 --- a/src/runtime/Platformwindows.Mod +++ b/src/runtime/Platformwindows.Mod @@ -108,7 +108,7 @@ BEGIN RETURN e = EINTR() END Interrupted; (* OS memory allocaton *) -PROCEDURE -allocate(size: SYSTEM.ADDRESS): SYSTEM.ADDRESS "(address)((void*)HeapAlloc(GetProcessHeap(), 0, (size_t)size))"; +PROCEDURE -allocate(size: SYSTEM.ADDRESS): SYSTEM.ADDRESS "(ADDRESS)((void*)HeapAlloc(GetProcessHeap(), 0, (size_t)size))"; PROCEDURE OSAllocate*(size: SYSTEM.ADDRESS): SYSTEM.ADDRESS; BEGIN RETURN allocate(size) END OSAllocate; PROCEDURE -free(address: SYSTEM.ADDRESS) "HeapFree(GetProcessHeap(), 0, (void*)address)"; @@ -204,8 +204,8 @@ END ArgPos; (* Ctrl/c handling *) -PROCEDURE -SetInterruptHandler*(h: SignalHandler) "SystemSetInterruptHandler((address)h)"; -PROCEDURE -SetQuitHandler* (h: SignalHandler) "SystemSetQuitHandler((address)h)"; +PROCEDURE -SetInterruptHandler*(h: SignalHandler) "SystemSetInterruptHandler((ADDRESS)h)"; +PROCEDURE -SetQuitHandler* (h: SignalHandler) "SystemSetQuitHandler((ADDRESS)h)"; PROCEDURE SetBadInstructionHandler*(handler: SignalHandler); BEGIN (* TODO *) END SetBadInstructionHandler; @@ -236,7 +236,7 @@ BEGIN YMDHMStoClock(styear(), stmon(), stmday(), sthour(), stmin(), stsec(), t, d); END GetClock; -PROCEDURE -GetTickCount(): LONGINT "(LONGINT)(uint32)GetTickCount()"; +PROCEDURE -GetTickCount(): LONGINT "(LONGINT)(UINT32)GetTickCount()"; PROCEDURE Time*(): LONGINT; VAR ms: LONGINT; @@ -297,16 +297,16 @@ PROCEDURE Error*(): ErrorCode; BEGIN RETURN err() END Error; (* File system *) -PROCEDURE -invalidHandleValue(): LONGINT "((LONGINT)(address)INVALID_HANDLE_VALUE)"; +PROCEDURE -invalidHandleValue(): LONGINT "((LONGINT)(ADDRESS)INVALID_HANDLE_VALUE)"; PROCEDURE -openrw (n: ARRAY OF CHAR): LONGINT -"(LONGINT)(address)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0)"; +"(LONGINT)(ADDRESS)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0)"; PROCEDURE -openro (n: ARRAY OF CHAR): LONGINT -"(LONGINT)(address)CreateFile((char*)n, GENERIC_READ , FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0)"; +"(LONGINT)(ADDRESS)CreateFile((char*)n, GENERIC_READ , FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0)"; PROCEDURE -opennew(n: ARRAY OF CHAR): LONGINT -"(LONGINT)(address)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0)"; +"(LONGINT)(ADDRESS)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0)"; @@ -336,7 +336,7 @@ END New; -PROCEDURE -closeHandle(h: FileHandle): INTEGER "(INTEGER)CloseHandle((HANDLE)(address)h)"; +PROCEDURE -closeHandle(h: FileHandle): INTEGER "(INTEGER)CloseHandle((HANDLE)(ADDRESS)h)"; PROCEDURE Close*(h: FileHandle): ErrorCode; BEGIN @@ -346,7 +346,7 @@ END Close; PROCEDURE -byHandleFileInformation "BY_HANDLE_FILE_INFORMATION bhfi"; -PROCEDURE -getFileInformationByHandle(h: FileHandle): INTEGER "(INTEGER)GetFileInformationByHandle((HANDLE)(address)h, &bhfi)"; +PROCEDURE -getFileInformationByHandle(h: FileHandle): INTEGER "(INTEGER)GetFileInformationByHandle((HANDLE)(ADDRESS)h, &bhfi)"; PROCEDURE -bhfiMtimeHigh(): LONGINT "(LONGINT)bhfi.ftLastWriteTime.dwHighDateTime"; PROCEDURE -bhfiMtimeLow(): LONGINT "(LONGINT)bhfi.ftLastWriteTime.dwLowDateTime"; PROCEDURE -bhfiVsn(): LONGINT "(LONGINT)bhfi.dwVolumeSerialNumber"; @@ -405,7 +405,7 @@ END MTimeAsClock; PROCEDURE -largeInteger "LARGE_INTEGER li"; PROCEDURE -liLongint(): LONGINT "(LONGINT)li.QuadPart"; -PROCEDURE -getFileSize(h: FileHandle): INTEGER "(INTEGER)GetFileSizeEx((HANDLE)(address)h, &li)"; +PROCEDURE -getFileSize(h: FileHandle): INTEGER "(INTEGER)GetFileSizeEx((HANDLE)(ADDRESS)h, &li)"; PROCEDURE Size*(h: FileHandle; VAR l: LONGINT): ErrorCode; BEGIN @@ -417,7 +417,7 @@ END Size; PROCEDURE -readfile (fd: LONGINT; p: SYSTEM.ADDRESS; l: LONGINT; VAR n: SYSTEM.INT32): INTEGER -"(INTEGER)ReadFile((HANDLE)(address)fd, (void*)p, (DWORD)l, (DWORD*)n, 0)"; +"(INTEGER)ReadFile((HANDLE)(ADDRESS)fd, (void*)p, (DWORD)l, (DWORD*)n, 0)"; PROCEDURE Read*(h: FileHandle; p: SYSTEM.ADDRESS; l: LONGINT; VAR n: LONGINT): ErrorCode; VAR result: INTEGER; lengthread: SYSTEM.INT32; @@ -436,7 +436,7 @@ END ReadBuf; PROCEDURE -writefile(fd: LONGINT; p: SYSTEM.ADDRESS; l: LONGINT): INTEGER -"(INTEGER)WriteFile((HANDLE)(address)fd, (void*)(p), (DWORD)l, 0,0)"; +"(INTEGER)WriteFile((HANDLE)(ADDRESS)fd, (void*)(p), (DWORD)l, 0,0)"; PROCEDURE Write*(h: FileHandle; p: SYSTEM.ADDRESS; l: LONGINT): ErrorCode; BEGIN @@ -445,7 +445,7 @@ END Write; -PROCEDURE -flushFileBuffers(h: FileHandle): INTEGER "(INTEGER)FlushFileBuffers((HANDLE)(address)h)"; +PROCEDURE -flushFileBuffers(h: FileHandle): INTEGER "(INTEGER)FlushFileBuffers((HANDLE)(ADDRESS)h)"; PROCEDURE Sync*(h: FileHandle): ErrorCode; BEGIN @@ -455,7 +455,7 @@ END Sync; PROCEDURE -setFilePointerEx(h: FileHandle; o: LONGINT; r: INTEGER; VAR rc: INTEGER) -"li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((HANDLE)(address)h, li, 0, (DWORD)r)"; +"li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((HANDLE)(ADDRESS)h, li, 0, (DWORD)r)"; PROCEDURE -seekset(): INTEGER "FILE_BEGIN"; PROCEDURE -seekcur(): INTEGER "FILE_CURRENT"; @@ -471,9 +471,9 @@ END Seek; -PROCEDURE -setEndOfFile(h: FileHandle): INTEGER "(INTEGER)SetEndOfFile((HANDLE)(address)h)"; +PROCEDURE -setEndOfFile(h: FileHandle): INTEGER "(INTEGER)SetEndOfFile((HANDLE)(ADDRESS)h)"; PROCEDURE -getFilePos(h: FileHandle; VAR r: LONGINT; VAR rc: INTEGER) -"LARGE_INTEGER liz = {0}; *rc = (INTEGER)SetFilePointerEx((HANDLE)(address)h, liz, &li, FILE_CURRENT); *r = (LONGINT)li.QuadPart"; +"LARGE_INTEGER liz = {0}; *rc = (INTEGER)SetFilePointerEx((HANDLE)(ADDRESS)h, liz, &li, FILE_CURRENT); *r = (LONGINT)li.QuadPart"; PROCEDURE Truncate*(h: FileHandle; limit: LONGINT): ErrorCode; VAR rc: INTEGER; oldpos: LONGINT; @@ -531,8 +531,8 @@ PROCEDURE Exit*(code: INTEGER); BEGIN exit(code) END Exit; -PROCEDURE -errstring(s: ARRAY OF CHAR) 'WriteFile((HANDLE)(address)Platform_StdOut, s, s__len-1, 0,0)'; -PROCEDURE -errc (c: CHAR) 'WriteFile((HANDLE)(address)Platform_StdOut, &c, 1, 0,0)'; +PROCEDURE -errstring(s: ARRAY OF CHAR) 'WriteFile((HANDLE)(ADDRESS)Platform_StdOut, s, s__len-1, 0,0)'; +PROCEDURE -errc (c: CHAR) 'WriteFile((HANDLE)(ADDRESS)Platform_StdOut, &c, 1, 0,0)'; PROCEDURE errch(c: CHAR); BEGIN errc(c) END errch; PROCEDURE errln; BEGIN errch(0DX); errch(0AX) END errln; @@ -594,9 +594,9 @@ PROCEDURE TestLittleEndian; BEGIN i := 1; SYSTEM.GET(SYSTEM.ADR(i), LittleEndian); END TestLittleEndian; -PROCEDURE -getstdinhandle(): FileHandle "(LONGINT)(address)GetStdHandle(STD_INPUT_HANDLE)"; -PROCEDURE -getstdouthandle(): FileHandle "(LONGINT)(address)GetStdHandle(STD_OUTPUT_HANDLE)"; -PROCEDURE -getstderrhandle(): FileHandle "(LONGINT)(address)GetStdHandle(STD_ERROR_HANDLE)"; +PROCEDURE -getstdinhandle(): FileHandle "(LONGINT)(ADDRESS)GetStdHandle(STD_INPUT_HANDLE)"; +PROCEDURE -getstdouthandle(): FileHandle "(LONGINT)(ADDRESS)GetStdHandle(STD_OUTPUT_HANDLE)"; +PROCEDURE -getstderrhandle(): FileHandle "(LONGINT)(ADDRESS)GetStdHandle(STD_ERROR_HANDLE)"; PROCEDURE -getpid(): INTEGER "(INTEGER)GetCurrentProcessId()"; BEGIN diff --git a/src/runtime/SYSTEM.c b/src/runtime/SYSTEM.c index b97144e7..a1b2cb14 100644 --- a/src/runtime/SYSTEM.c +++ b/src/runtime/SYSTEM.c @@ -24,7 +24,7 @@ -int64 SYSTEM_DIV(int64 x, int64 y) +INT64 SYSTEM_DIV(INT64 x, INT64 y) { if (x == 0) return 0; if (x >= 0) @@ -35,7 +35,7 @@ int64 SYSTEM_DIV(int64 x, int64 y) else {return (-x)/(-y);} } -int64 SYSTEM_MOD(int64 x, int64 y) +INT64 SYSTEM_MOD(INT64 x, INT64 y) { if (x == 0) return 0; if (x >= 0) @@ -46,31 +46,20 @@ int64 SYSTEM_MOD(int64 x, int64 y) else {return -((-x) % (-y));} } -// LONGINT SYSTEM_ENTIER(double x) -// { -// LONGINT y; -// if (x >= 0) -// return (LONGINT)x; -// else { -// y = (LONGINT)x; -// if (y <= x) return y; else return y - 1; -// } -// } - -int64 SYSTEM_ENTIER(double x) +INT64 SYSTEM_ENTIER(double x) { - int64 y; + INT64 y; if (x >= 0) - return (int64)x; + return (INT64)x; else { - y = (int64)x; + y = (INT64)x; if (y <= x) return y; else return y - 1; } } -void SYSTEM_INHERIT(address *t, address *t0) +void SYSTEM_INHERIT(ADDRESS *t, ADDRESS *t0) { t -= __TPROC0OFF; t0 -= __TPROC0OFF; @@ -78,23 +67,23 @@ void SYSTEM_INHERIT(address *t, address *t0) } -void SYSTEM_ENUMP(void *adr, address n, void (*P)()) +void SYSTEM_ENUMP(void *adr, ADDRESS n, void (*P)()) { while (n > 0) { - P((address)(*((void**)(adr)))); + P((ADDRESS)(*((void**)(adr)))); adr = ((void**)adr) + 1; n--; } } -void SYSTEM_ENUMR(void *adr, address *typ, address size, address n, void (*P)()) +void SYSTEM_ENUMR(void *adr, ADDRESS *typ, ADDRESS size, ADDRESS n, void (*P)()) { - address *t, off; + ADDRESS *t, off; typ++; while (n > 0) { t = typ; off = *t; - while (off >= 0) {P(*(address*)((char*)adr+off)); t++; off = *t;} + while (off >= 0) {P(*(ADDRESS*)((char*)adr+off)); t++; off = *t;} adr = ((char*)adr) + size; n--; } @@ -103,19 +92,19 @@ void SYSTEM_ENUMR(void *adr, address *typ, address size, address n, void (*P)()) extern void Heap_Lock(); extern void Heap_Unlock(); -SYSTEM_PTR SYSTEM_NEWARR(address *typ, address elemsz, int elemalgn, int nofdim, int nofdyn, ...) +SYSTEM_PTR SYSTEM_NEWARR(ADDRESS *typ, ADDRESS elemsz, int elemalgn, int nofdim, int nofdyn, ...) { - address nofelems, size, dataoff, n, nptr, *x, *p, nofptrs, i, *ptab, off; + ADDRESS nofelems, size, dataoff, n, nptr, *x, *p, nofptrs, i, *ptab, off; va_list ap; va_start(ap, nofdyn); nofelems = 1; while (nofdim > 0) { - nofelems = nofelems * va_arg(ap, address); nofdim--; + nofelems = nofelems * va_arg(ap, ADDRESS); nofdim--; if (nofelems <= 0) __HALT(-20); } va_end(ap); - dataoff = nofdyn * sizeof(address); - if (elemalgn > sizeof(address)) { + dataoff = nofdyn * sizeof(ADDRESS); + if (elemalgn > sizeof(ADDRESS)) { n = dataoff % elemalgn; if (n != 0) dataoff += elemalgn - n; } @@ -125,37 +114,37 @@ SYSTEM_PTR SYSTEM_NEWARR(address *typ, address elemsz, int elemalgn, int nofdim, /* element typ does not contain pointers */ x = Heap_NEWBLK(size); } - else if (typ == (address*)POINTER__typ) { + else if (typ == (ADDRESS*)POINTER__typ) { /* element type is a pointer */ - x = Heap_NEWBLK(size + nofelems * sizeof(address)); - p = (address*)(address)x[-1]; + x = Heap_NEWBLK(size + nofelems * sizeof(ADDRESS)); + p = (ADDRESS*)(ADDRESS)x[-1]; p[-nofelems] = *p; /* build new type desc in situ: 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nofelems - 1; n = 1; /* n =1 for skipping the size field */ - while (n <= nofelems) {*p = n*sizeof(address); p++; n++;} - *p = - (nofelems + 1) * sizeof(address); /* sentinel */ - x[-1] -= nofelems * sizeof(address); + while (n <= nofelems) {*p = n*sizeof(ADDRESS); p++; n++;} + *p = - (nofelems + 1) * sizeof(ADDRESS); /* sentinel */ + x[-1] -= nofelems * sizeof(ADDRESS); } else { /* element type is a record that contains pointers */ ptab = typ + 1; nofptrs = 0; while (ptab[nofptrs] >= 0) {nofptrs++;} /* number of pointers per element */ nptr = nofelems * nofptrs; /* total number of pointers */ - x = Heap_NEWBLK(size + nptr * sizeof(address)); - p = (address*)(address)x[- 1]; + x = Heap_NEWBLK(size + nptr * sizeof(ADDRESS)); + p = (ADDRESS*)(ADDRESS)x[- 1]; p[-nptr] = *p; /* build new type desc in situ; 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nptr - 1; n = 0; off = dataoff; while (n < nofelems) {i = 0; while (i < nofptrs) {*p = off + ptab[i]; p++; i++;} off += elemsz; n++; } - *p = - (nptr + 1) * sizeof(address); /* sentinel */ - x[-1] -= nptr * sizeof(address); + *p = - (nptr + 1) * sizeof(ADDRESS); /* sentinel */ + x[-1] -= nptr * sizeof(ADDRESS); } if (nofdyn != 0) { /* setup len vector for index checks */ va_start(ap, nofdyn); p = x; - while (nofdyn > 0) {*p = va_arg(ap, address); p++, nofdyn--;} + while (nofdyn > 0) {*p = va_arg(ap, ADDRESS); p++, nofdyn--;} va_end(ap); } Heap_Unlock(); @@ -165,7 +154,7 @@ SYSTEM_PTR SYSTEM_NEWARR(address *typ, address elemsz, int elemalgn, int nofdim, -typedef void (*SystemSignalHandler)(int32); // = Platform_SignalHandler +typedef void (*SystemSignalHandler)(INT32); // = Platform_SignalHandler #ifndef _WIN32 @@ -177,7 +166,7 @@ typedef void (*SystemSignalHandler)(int32); // = Platform_SignalHandler // (Ignore other signals) } - void SystemSetHandler(int s, address h) { + void SystemSetHandler(int s, ADDRESS h) { if (s >= 2 && s <= 4) { int needtosetsystemhandler = handler[s-2] == 0; handler[s-2] = (SystemSignalHandler)h; @@ -216,12 +205,12 @@ typedef void (*SystemSignalHandler)(int32); // = Platform_SignalHandler } } - void SystemSetInterruptHandler(address h) { + void SystemSetInterruptHandler(ADDRESS h) { EnsureConsoleCtrlHandler(); SystemInterruptHandler = (SystemSignalHandler)h; } - void SystemSetQuitHandler(address h) { + void SystemSetQuitHandler(ADDRESS h) { EnsureConsoleCtrlHandler(); SystemQuitHandler = (SystemSignalHandler)h; } diff --git a/src/runtime/SYSTEM.h b/src/runtime/SYSTEM.h index 4600fe8b..481cded9 100644 --- a/src/runtime/SYSTEM.h +++ b/src/runtime/SYSTEM.h @@ -33,22 +33,22 @@ void *alloca(size_t size); #if defined (o__64) && !defined(_WIN64) // LP64 - typedef long int64; - typedef unsigned long uint64; + typedef long INT64; + typedef unsigned long UINT64; #else // ILP32 or LLP64 - typedef long long int64; - typedef unsigned long long uint64; + typedef long long INT64; + typedef unsigned long long UINT64; #endif -typedef int int32; -typedef unsigned int uint32; +typedef int INT32; +typedef unsigned int UINT32; -typedef short int int16; -typedef unsigned short int uint16; +typedef short int INT16; +typedef unsigned short int UINT16; -typedef signed char int8; -typedef unsigned char uint8; +typedef signed char INT8; +typedef unsigned char UINT8; // The compiler uses 'import' and 'export' which translate to 'extern' and @@ -63,29 +63,41 @@ typedef unsigned char uint8; #define NIL ((void*)0) #define __MAXEXT 16 -#define POINTER__typ ((address*)(1)) // not NIL and not a valid type +#define POINTER__typ ((ADDRESS*)(1)) // not NIL and not a valid type // Oberon types -typedef int8 BOOLEAN; -typedef int8 SYSTEM_BYTE; -typedef uint8 CHAR; +typedef INT8 BOOLEAN; +typedef INT8 SYSTEM_BYTE; +typedef UINT8 CHAR; typedef float REAL; typedef double LONGREAL; typedef void* SYSTEM_PTR; -// 'address' is a synonym for an int of pointer size +// 'ADDRESS' is a synonym for an integer of pointer size #if defined (o__64) - #define address int64 + #define ADDRESS INT64 #else - #define address int32 + #define ADDRESS INT32 #endif +// Temporary build support - which changing lowercase int* and address to uppercase + +#define int8 INT8 +#define int16 INT16 +#define int32 INT32 +#define int64 INT64 +#define uint8 UINT8 +#define uint16 UINT16 +#define uint32 UINT32 +#define uint64 UINT64 +#define address ADDRESS + @@ -96,30 +108,30 @@ typedef void* SYSTEM_PTR; // OS Memory allocation interfaces are in PlatformXXX.Mod -extern address Platform_OSAllocate (address size); -extern void Platform_OSFree (address addr); +extern ADDRESS Platform_OSAllocate (ADDRESS size); +extern void Platform_OSFree (ADDRESS addr); // Assertions and Halts -extern void Platform_Halt(int32 x); -extern void Platform_AssertFail(int32 x); +extern void Platform_Halt(INT32 x); +extern void Platform_AssertFail(INT32 x); #define __HALT(x) Platform_Halt(x) -#define __ASSERT(cond, x) if (!(cond)) Platform_AssertFail((int32)(x)) +#define __ASSERT(cond, x) if (!(cond)) Platform_AssertFail((INT32)(x)) // Index checking -static inline int64 __XF(uint64 i, uint64 ub) {if (i >= ub) {__HALT(-2);} return i;} +static inline INT64 __XF(UINT64 i, UINT64 ub) {if (i >= ub) {__HALT(-2);} return i;} #define __X(i, ub) (((i)<(ub))?i:(__HALT(-2),0)) // Range checking, and checked SHORT and CHR functions -static inline int64 __RF(uint64 i, uint64 ub) {if (i >= ub) {__HALT(-8);} return i;} +static inline INT64 __RF(UINT64 i, UINT64 ub) {if (i >= ub) {__HALT(-8);} return i;} #define __R(i, ub) (((i)<(ub))?i:(__HALT(-8),0)) -#define __SHORT(x, ub) ((int)((uint64)(x)+(ub)<(ub)+(ub)?(x):(__HALT(-8),0))) +#define __SHORT(x, ub) ((int)((UINT64)(x)+(ub)<(ub)+(ub)?(x):(__HALT(-8),0))) #define __SHORTF(x, ub) ((int)(__RF((x)+(ub),(ub)+(ub))-(ub))) #define __CHR(x) ((CHAR)__R(x, 256)) #define __CHRF(x) ((CHAR)__RF(x, 256)) @@ -129,10 +141,10 @@ static inline int64 __RF(uint64 i, uint64 ub) {if (i >= ub) {__HALT(-8);} return // Signal handling in SYSTEM.c #ifndef _WIN32 - extern void SystemSetHandler(int s, address h); + extern void SystemSetHandler(int s, ADDRESS h); #else - extern void SystemSetInterruptHandler(address h); - extern void SystemSetQuitHandler (address h); + extern void SystemSetInterruptHandler(ADDRESS h); + extern void SystemSetQuitHandler (ADDRESS h); #endif @@ -140,7 +152,7 @@ static inline int64 __RF(uint64 i, uint64 ub) {if (i >= ub) {__HALT(-8);} return // String comparison static inline int __str_cmp(CHAR *x, CHAR *y){ - int64 i = 0; + INT64 i = 0; CHAR ch1, ch2; do {ch1 = x[i]; ch2 = y[i]; i++; if (!ch1) return -(int)ch2; @@ -164,8 +176,8 @@ static inline int __str_cmp(CHAR *x, CHAR *y){ #define __VAL(t, x) (*(t*)&(x)) -#define __GET(a, x, t) x=*(t*)(address)(a) -#define __PUT(a, x, t) *(t*)(address)(a)=x +#define __GET(a, x, t) x=*(t*)(ADDRESS)(a) +#define __PUT(a, x, t) *(t*)(ADDRESS)(a)=x #define __LSHL(x, n, s) ((int##s)((uint##s)(x)<<(n))) #define __LSHR(x, n, s) ((int##s)((uint##s)(x)>>(n))) @@ -175,33 +187,33 @@ static inline int __str_cmp(CHAR *x, CHAR *y){ #define __ROTR(x, n, s) ((int##s)((uint##s)(x)>>(n)|(uint##s)(x)<<(s-(n)))) #define __ROT(x, n, s) ((n)>=0? __ROTL(x, n, s): __ROTR(x, -(n), s)) -#define __ASHL(x, n) ((int64)(x)<<(n)) -#define __ASHR(x, n) ((int64)(x)>>(n)) +#define __ASHL(x, n) ((INT64)(x)<<(n)) +#define __ASHR(x, n) ((INT64)(x)>>(n)) #define __ASH(x, n) ((n)>=0?__ASHL(x,n):__ASHR(x,-(n))) -static inline int64 SYSTEM_ASH(int64 x, int64 n) {return __ASH(x,n);} -#define __ASHF(x, n) SYSTEM_ASH((int64)(x), (int64)(n)) +static inline INT64 SYSTEM_ASH(INT64 x, INT64 n) {return __ASH(x,n);} +#define __ASHF(x, n) SYSTEM_ASH((INT64)(x), (INT64)(n)) -#define __MOVE(s, d, n) memcpy((char*)(address)(d),(char*)(address)(s),n) +#define __MOVE(s, d, n) memcpy((char*)(ADDRESS)(d),(char*)(ADDRESS)(s),n) -extern int64 SYSTEM_DIV(int64 x, int64 y); +extern INT64 SYSTEM_DIV(INT64 x, INT64 y); #define __DIVF(x, y) SYSTEM_DIV(x, y) #define __DIV(x, y) (((x)>0 && (y)>0) ? (x)/(y) : __DIVF(x, y)) -extern int64 SYSTEM_MOD(int64 x, int64 y); +extern INT64 SYSTEM_MOD(INT64 x, INT64 y); #define __MODF(x, y) SYSTEM_MOD(x, y) #define __MOD(x, y) (((x)>0 && (y)>0) ? (x)%(y) : __MODF(x, y)) -extern int64 SYSTEM_ENTIER (double x); +extern INT64 SYSTEM_ENTIER (double x); #define __ENTIER(x) SYSTEM_ENTIER(x) #define __ABS(x) (((x)<0)?-(x):(x)) -static inline int32 SYSTEM_ABS64(int64 i) {return i >= 0 ? i : -i;} -static inline int64 SYSTEM_ABS32(int32 i) {return i >= 0 ? i : -i;} +static inline INT32 SYSTEM_ABS64(INT64 i) {return i >= 0 ? i : -i;} +static inline INT64 SYSTEM_ABS32(INT32 i) {return i >= 0 ? i : -i;} #define __ABSF(x) ((sizeof(x) <= 4) ? SYSTEM_ABS32(x) : SYSTEM_ABS64(x)) static inline double SYSTEM_ABSD(double i) {return i >= 0.0 ? i : -i;} @@ -216,7 +228,7 @@ static inline double SYSTEM_ABSD(double i) {return i >= 0.0 ? i : -i;} #define __SETRNG(l, h, size) ((~(uint##size)0<<(l))&~(uint##size)0>>(size-1-(h))) #define __MASK(x, m) ((x)&~(m)) -#define __BIT(x, n) (*(uint64*)(x)>>(n)&1) +#define __BIT(x, n) (*(UINT64*)(x)>>(n)&1) @@ -227,8 +239,8 @@ static inline double SYSTEM_ABSD(double i) {return i >= 0.0 ? i : -i;} #define __WITHCHK __HALT(-7) -#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(address)typ##__typ) -#define __TYPEOF(p) (*(((address**)(p))-1)) +#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(ADDRESS)typ##__typ) +#define __TYPEOF(p) (*(((ADDRESS**)(p))-1)) #define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) @@ -257,67 +269,67 @@ extern void Heap_INCREF(); // Main module initialisation, registration and finalisation -extern void Platform_Init(int32 argc, address argv); +extern void Platform_Init(INT32 argc, ADDRESS argv); extern void Heap_FINALL(); -#define __INIT(argc, argv) static void *m; Platform_Init(argc, (address)&argv); +#define __INIT(argc, argv) static void *m; Platform_Init(argc, (ADDRESS)&argv); #define __REGMAIN(name, enum) m = Heap_REGMOD((CHAR*)name,enum) #define __FINI Heap_FINALL(); return 0 // Memory allocation -extern SYSTEM_PTR Heap_NEWBLK (address size); -extern SYSTEM_PTR Heap_NEWREC (address tag); -extern SYSTEM_PTR SYSTEM_NEWARR(address*, address, int, int, int, ...); +extern SYSTEM_PTR Heap_NEWBLK (ADDRESS size); +extern SYSTEM_PTR Heap_NEWREC (ADDRESS tag); +extern SYSTEM_PTR SYSTEM_NEWARR(ADDRESS*, ADDRESS, int, int, int, ...); -#define __SYSNEW(p, len) p = Heap_NEWBLK((address)(len)) -#define __NEW(p, t) p = Heap_NEWREC((address)t##__typ) +#define __SYSNEW(p, len) p = Heap_NEWBLK((ADDRESS)(len)) +#define __NEW(p, t) p = Heap_NEWREC((ADDRESS)t##__typ) #define __NEWARR SYSTEM_NEWARR /* Type handling */ -extern void SYSTEM_INHERIT(address *t, address *t0); -extern void SYSTEM_ENUMP (void *adr, address n, void (*P)()); -extern void SYSTEM_ENUMR (void *adr, address *typ, address size, address n, void (*P)()); +extern void SYSTEM_INHERIT(ADDRESS *t, ADDRESS *t0); +extern void SYSTEM_ENUMP (void *adr, ADDRESS n, void (*P)()); +extern void SYSTEM_ENUMR (void *adr, ADDRESS *typ, ADDRESS size, ADDRESS n, void (*P)()); #define __TDESC(t, m, n) \ static struct t##__desc { \ - address tproc[m]; /* Proc for each ptr field */ \ - address tag; \ - address next; /* Module table type list points here */ \ - address level; \ - address module; \ + ADDRESS tproc[m]; /* Proc for each ptr field */ \ + ADDRESS tag; \ + ADDRESS next; /* Module table type list points here */ \ + ADDRESS level; \ + ADDRESS module; \ char name[24]; \ - address basep[__MAXEXT]; /* List of bases this extends */ \ - address reserved; \ - address blksz; /* xxx_typ points here */ \ - address ptr[n+1]; /* Offsets of ptrs up to -ve sentinel */ \ + ADDRESS basep[__MAXEXT]; /* List of bases this extends */ \ + ADDRESS reserved; \ + ADDRESS blksz; /* xxx_typ points here */ \ + ADDRESS ptr[n+1]; /* Offsets of ptrs up to -ve sentinel */ \ } t##__desc #define __BASEOFF (__MAXEXT+1) // blksz as index to base. -#define __TPROC0OFF (__BASEOFF+24/sizeof(address)+5) // blksz as index to tproc IFF m=1. +#define __TPROC0OFF (__BASEOFF+24/sizeof(ADDRESS)+5) // blksz as index to tproc IFF m=1. #define __EOM 1 #define __TDFLDS(name, size) {__EOM}, 1, 0, 0, 0, name, {0}, 0, size -#define __ENUMP(adr, n, P) SYSTEM_ENUMP(adr, (address)(n), P) -#define __ENUMR(adr, typ, size, n, P) SYSTEM_ENUMR(adr, typ, (address)(size), (address)(n), P) +#define __ENUMP(adr, n, P) SYSTEM_ENUMP(adr, (ADDRESS)(n), P) +#define __ENUMR(adr, typ, size, n, P) SYSTEM_ENUMR(adr, typ, (ADDRESS)(size), (ADDRESS)(n), P) #define __INITYP(t, t0, level) \ - t##__typ = (address*)&t##__desc.blksz; \ - memcpy(t##__desc.basep, t0##__typ - __BASEOFF, level*sizeof(address)); \ - t##__desc.basep[level] = (address)t##__typ; \ - t##__desc.module = (address)m; \ + t##__typ = (ADDRESS*)&t##__desc.blksz; \ + memcpy(t##__desc.basep, t0##__typ - __BASEOFF, level*sizeof(ADDRESS)); \ + t##__desc.basep[level] = (ADDRESS)t##__typ; \ + t##__desc.module = (ADDRESS)m; \ if(t##__desc.blksz!=sizeof(struct t)) __HALT(-15); \ - t##__desc.blksz = (t##__desc.blksz+5*sizeof(address)-1)/(4*sizeof(address))*(4*sizeof(address)); \ - Heap_REGTYP(m, (address)&t##__desc.next); \ + t##__desc.blksz = (t##__desc.blksz+5*sizeof(ADDRESS)-1)/(4*sizeof(ADDRESS))*(4*sizeof(ADDRESS)); \ + Heap_REGTYP(m, (ADDRESS)&t##__desc.next); \ SYSTEM_INHERIT(t##__typ, t0##__typ) // Oberon-2 type bound procedures support -#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(address)proc -#define __SEND(typ, num, funtyp, parlist) ((funtyp)((address)*(typ-(__TPROC0OFF+num))))parlist +#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(ADDRESS)proc +#define __SEND(typ, num, funtyp, parlist) ((funtyp)((ADDRESS)*(typ-(__TPROC0OFF+num))))parlist From a17c087a414391afef44197218b3fd18fab55f03 Mon Sep 17 00:00:00 2001 From: David Brown Date: Tue, 8 Nov 2016 12:13:58 +0000 Subject: [PATCH 306/580] Uppercase internal SYSTEM.H types address, int*, uint*. Completed. --- bootstrap/SYSTEM.h | 28 +++++++--------------------- bootstrap/unix-44/Files.c | 22 +++++++++++----------- bootstrap/unix-44/Heap.c | 32 ++++++++++++++++---------------- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPC.c | 15 +++------------ bootstrap/unix-44/OPM.c | 6 +++--- bootstrap/unix-44/OPV.c | 6 +++--- bootstrap/unix-44/Out.c | 8 ++++---- bootstrap/unix-44/Platform.c | 10 +++++----- bootstrap/unix-44/Reals.c | 12 ++++++------ bootstrap/unix-48/Files.c | 22 +++++++++++----------- bootstrap/unix-48/Heap.c | 32 ++++++++++++++++---------------- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPC.c | 15 +++------------ bootstrap/unix-48/OPM.c | 6 +++--- bootstrap/unix-48/OPV.c | 6 +++--- bootstrap/unix-48/Out.c | 8 ++++---- bootstrap/unix-48/Platform.c | 10 +++++----- bootstrap/unix-48/Reals.c | 12 ++++++------ bootstrap/unix-88/Files.c | 22 +++++++++++----------- bootstrap/unix-88/Heap.c | 32 ++++++++++++++++---------------- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPC.c | 15 +++------------ bootstrap/unix-88/OPM.c | 6 +++--- bootstrap/unix-88/OPV.c | 6 +++--- bootstrap/unix-88/Out.c | 8 ++++---- bootstrap/unix-88/Platform.c | 10 +++++----- bootstrap/unix-88/Reals.c | 12 ++++++------ bootstrap/windows-48/Files.c | 22 +++++++++++----------- bootstrap/windows-48/Heap.c | 32 ++++++++++++++++---------------- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPC.c | 15 +++------------ bootstrap/windows-48/OPM.c | 6 +++--- bootstrap/windows-48/OPV.c | 6 +++--- bootstrap/windows-48/Out.c | 8 ++++---- bootstrap/windows-48/Platform.c | 8 ++++---- bootstrap/windows-48/Reals.c | 12 ++++++------ bootstrap/windows-88/Files.c | 22 +++++++++++----------- bootstrap/windows-88/Heap.c | 32 ++++++++++++++++---------------- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPC.c | 15 +++------------ bootstrap/windows-88/OPM.c | 6 +++--- bootstrap/windows-88/OPV.c | 6 +++--- bootstrap/windows-88/Out.c | 8 ++++---- bootstrap/windows-88/Platform.c | 8 ++++---- bootstrap/windows-88/Reals.c | 12 ++++++------ doc/Features.md | 5 ++++- src/compiler/OPC.Mod | 12 +----------- src/compiler/OPV.Mod | 6 +++--- src/runtime/Files.Mod | 2 +- src/runtime/Heap.Mod | 22 +++++++++++----------- src/runtime/Out.Mod | 2 +- src/runtime/Platformunix.Mod | 2 +- src/runtime/SYSTEM.h | 28 +++++++--------------------- src/tools/make/configure.c | 8 ++++---- src/tools/make/ignore | 2 +- 56 files changed, 299 insertions(+), 379 deletions(-) diff --git a/bootstrap/SYSTEM.h b/bootstrap/SYSTEM.h index 481cded9..fb88276c 100644 --- a/bootstrap/SYSTEM.h +++ b/bootstrap/SYSTEM.h @@ -86,20 +86,6 @@ typedef void* SYSTEM_PTR; #endif -// Temporary build support - which changing lowercase int* and address to uppercase - -#define int8 INT8 -#define int16 INT16 -#define int32 INT32 -#define int64 INT64 -#define uint8 UINT8 -#define uint16 UINT16 -#define uint32 UINT32 -#define uint64 UINT64 -#define address ADDRESS - - - // ---------------------------------------------------------------------- // ---------------------------------------------------------------------- @@ -179,12 +165,12 @@ static inline int __str_cmp(CHAR *x, CHAR *y){ #define __GET(a, x, t) x=*(t*)(ADDRESS)(a) #define __PUT(a, x, t) *(t*)(ADDRESS)(a)=x -#define __LSHL(x, n, s) ((int##s)((uint##s)(x)<<(n))) -#define __LSHR(x, n, s) ((int##s)((uint##s)(x)>>(n))) +#define __LSHL(x, n, s) ((INT##s)((UINT##s)(x)<<(n))) +#define __LSHR(x, n, s) ((INT##s)((UINT##s)(x)>>(n))) #define __LSH(x, n, s) ((n)>=0? __LSHL(x, n, s): __LSHR(x, -(n), s)) -#define __ROTL(x, n, s) ((int##s)((uint##s)(x)<<(n)|(uint##s)(x)>>(s-(n)))) -#define __ROTR(x, n, s) ((int##s)((uint##s)(x)>>(n)|(uint##s)(x)<<(s-(n)))) +#define __ROTL(x, n, s) ((INT##s)((UINT##s)(x)<<(n)|(UINT##s)(x)>>(s-(n)))) +#define __ROTR(x, n, s) ((INT##s)((UINT##s)(x)>>(n)|(UINT##s)(x)<<(s-(n)))) #define __ROT(x, n, s) ((n)>=0? __ROTL(x, n, s): __ROTR(x, -(n), s)) #define __ASHL(x, n) ((INT64)(x)<<(n)) @@ -222,10 +208,10 @@ static inline double SYSTEM_ABSD(double i) {return i >= 0.0 ? i : -i;} #define __CAP(ch) ((CHAR)((ch)&0x5f)) #define __ODD(x) ((x)&1) -#define __IN(x, s, size) (((unsigned int)(x))>(x))&1)) +#define __IN(x, s, size) (((unsigned int)(x))>(x))&1)) // todo tested versions of SETOF and SETRNG: check that x, l and h fit size -#define __SETOF(x, size) ((uint##size)1<<(x)) -#define __SETRNG(l, h, size) ((~(uint##size)0<<(l))&~(uint##size)0>>(size-1-(h))) +#define __SETOF(x, size) ((UINT##size)1<<(x)) +#define __SETRNG(l, h, size) ((~(UINT##size)0<<(l))&~(UINT##size)0>>(size-1-(h))) #define __MASK(x, m) ((x)&~(m)) #define __BIT(x, n) (*(UINT64*)(x)>>(n)&1) diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 998a53d3..fc49744a 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -109,7 +109,7 @@ export void Files_WriteSet (Files_Rider *R, ADDRESS *R__typ, UINT32 x); export void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); #define Files_IdxTrap() __HALT(-1) -#define Files_ToAdr(x) (address)x +#define Files_ToAdr(x) (ADDRESS)x static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INT16 errcode) { @@ -262,7 +262,7 @@ static void Files_Flush (Files_Buffer buf) if (buf->org != f->pos) { error = Platform_Seek(f->fd, buf->org, Platform_SeekSet); } - error = Platform_Write(f->fd, (address)buf->data, buf->size); + error = Platform_Write(f->fd, (ADDRESS)buf->data, buf->size); if (error != 0) { Files_Err((CHAR*)"error writing file", 19, f, error); } @@ -645,7 +645,7 @@ void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x } else { min = n; } - __MOVE((address)buf->data + Files_ToAdr(offset), (address)x + Files_ToAdr(xpos), min); + __MOVE((ADDRESS)buf->data + Files_ToAdr(offset), (ADDRESS)x + Files_ToAdr(xpos), min); offset += min; (*r).offset = offset; xpos += min; @@ -703,7 +703,7 @@ void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT } else { min = n; } - __MOVE((address)x + Files_ToAdr(xpos), (address)buf->data + Files_ToAdr(offset), min); + __MOVE((ADDRESS)x + Files_ToAdr(xpos), (ADDRESS)buf->data + Files_ToAdr(offset), min); offset += min; (*r).offset = offset; if (offset > buf->size) { @@ -760,15 +760,15 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT __DEL(new); return; } - error = Platform_Read(fdold, (address)buf, 4096, &n); + error = Platform_Read(fdold, (ADDRESS)buf, 4096, &n); while (n > 0) { - error = Platform_Write(fdnew, (address)buf, n); + error = Platform_Write(fdnew, (ADDRESS)buf, n); if (error != 0) { ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); Files_Err((CHAR*)"cannot move file", 17, NIL, error); } - error = Platform_Read(fdold, (address)buf, 4096, &n); + error = Platform_Read(fdold, (ADDRESS)buf, 4096, &n); } ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); @@ -826,7 +826,7 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *de j += 1; } } else { - __MOVE((address)src, (address)dest, src__len); + __MOVE((ADDRESS)src, (ADDRESS)dest, src__len); } } @@ -916,7 +916,7 @@ void Files_ReadNum (Files_Rider *R, ADDRESS *R__typ, SYSTEM_BYTE *x, LONGINT x__ } q += (INT64)__ASH((__MASK(b, -64) - __ASHL(__ASHR(b, 6), 6)), s); __ASSERT(x__len <= 8, 0); - __MOVE((address)&q, (address)x, x__len); + __MOVE((ADDRESS)&q, (ADDRESS)x, x__len); } void Files_WriteBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN x) @@ -996,7 +996,7 @@ static void Files_Finalize (SYSTEM_PTR o) { Files_File f = NIL; INT32 res; - f = (Files_File)(address)o; + f = (Files_File)(ADDRESS)o; if (f->fd >= 0) { Files_CloseOSFile(f); if (f->tempFile) { @@ -1009,7 +1009,7 @@ void Files_SetSearchPath (CHAR *path, LONGINT path__len) { __DUP(path, path__len, CHAR); if (Strings_Length(path, path__len) != 0) { - Files_SearchPath = __NEWARR(NIL, 1, 1, 1, 1, ((address)((Strings_Length(path, path__len) + 1)))); + Files_SearchPath = __NEWARR(NIL, 1, 1, 1, 1, ((ADDRESS)((Strings_Length(path, path__len) + 1)))); __COPY(path, Files_SearchPath->data, Files_SearchPath->len[0]); } else { Files_SearchPath = NIL; diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index ca99053e..e8c720bb 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -105,8 +105,8 @@ static void Heap_Sift (INT32 l, INT32 r, INT32 *a, LONGINT a__len); export void Heap_Unlock (void); extern void *Heap__init(); -extern address Platform_MainStackFrame; -extern address Platform_OSAllocate(address size); +extern ADDRESS Platform_MainStackFrame; +extern ADDRESS Platform_OSAllocate(ADDRESS size); #define Heap_HeapModuleInit() Heap__init() #define Heap_OSAllocate(size) Platform_OSAllocate(size) #define Heap_PlatformHalt(code) Platform_Halt(code) @@ -138,7 +138,7 @@ SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) __COPY(name, m->name, 20); m->refcnt = 0; m->enumPtrs = enumPtrs; - m->next = (Heap_Module)(address)Heap_modules; + m->next = (Heap_Module)(ADDRESS)Heap_modules; Heap_modules = (SYSTEM_PTR)m; return (void*)m; } @@ -313,7 +313,7 @@ SYSTEM_PTR Heap_NEWREC (INT32 tag) __PUT(adr + 8, 0, INT32); Heap_allocated += blksz; Heap_Unlock(); - return (SYSTEM_PTR)(address)(adr + 4); + return (SYSTEM_PTR)(ADDRESS)(adr + 4); } SYSTEM_PTR Heap_NEWBLK (INT32 size) @@ -322,12 +322,12 @@ SYSTEM_PTR Heap_NEWBLK (INT32 size) SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 31, 4), 4); - new = Heap_NEWREC((address)&blksz); - tag = ((INT32)(address)new + blksz) - 12; + new = Heap_NEWREC((ADDRESS)&blksz); + tag = ((INT32)(ADDRESS)new + blksz) - 12; __PUT(tag - 4, 0, INT32); __PUT(tag, blksz, INT32); __PUT(tag + 4, -4, INT32); - __PUT((INT32)(address)new - 4, tag, INT32); + __PUT((INT32)(ADDRESS)new - 4, tag, INT32); Heap_Unlock(); return new; } @@ -355,7 +355,7 @@ static void Heap_Mark (INT32 q) __GET(tag, offset, INT32); fld = q + offset; __GET(fld, p, INT32); - __PUT(fld, (SYSTEM_PTR)(address)n, SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(ADDRESS)n, SYSTEM_PTR); } else { fld = q + offset; __GET(fld, n, INT32); @@ -364,7 +364,7 @@ static void Heap_Mark (INT32 q) if (!__ODD(tagbits)) { __PUT(n - 4, tagbits + 1, INT32); __PUT(q - 4, tag + 1, INT32); - __PUT(fld, (SYSTEM_PTR)(address)p, SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(ADDRESS)p, SYSTEM_PTR); p = q; q = n; tag = tagbits; @@ -379,7 +379,7 @@ static void Heap_Mark (INT32 q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((INT32)(address)p); + Heap_Mark((INT32)(ADDRESS)p); } static void Heap_Scan (void) @@ -548,7 +548,7 @@ static void Heap_Finalize (void) } else { prev->next = n->next; } - (*n->finalize)((SYSTEM_PTR)(address)n->obj); + (*n->finalize)((SYSTEM_PTR)(ADDRESS)n->obj); if (prev == NIL) { n = Heap_fin; } else { @@ -567,7 +567,7 @@ void Heap_FINALL (void) while (Heap_fin != NIL) { n = Heap_fin; Heap_fin = Heap_fin->next; - (*n->finalize)((SYSTEM_PTR)(address)n->obj); + (*n->finalize)((SYSTEM_PTR)(ADDRESS)n->obj); } } @@ -584,9 +584,9 @@ static void Heap_MarkStack (INT32 n, INT32 *cand, LONGINT cand__len) } if (n == 0) { nofcand = 0; - sp = (address)&frame; + sp = (ADDRESS)&frame; stack0 = Heap_PlatformMainStackFrame(); - inc = (address)&align.p - (address)&align; + inc = (ADDRESS)&align.p - (ADDRESS)&align; if (sp > stack0) { inc = -inc; } @@ -617,7 +617,7 @@ void Heap_GC (BOOLEAN markStack) INT32 cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); - m = (Heap_Module)(address)Heap_modules; + m = (Heap_Module)(ADDRESS)Heap_modules; while (m != NIL) { if (m->enumPtrs != NIL) { (*m->enumPtrs)(Heap_MarkP); @@ -694,7 +694,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (INT32)(address)obj; + f->obj = (INT32)(ADDRESS)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index 60993ebe..4b7fe51c 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -215,7 +215,7 @@ static void OPB_SetIntType (OPT_Node node) static void OPB_SetSetType (OPT_Node node) { INT32 i32; - __GET((address)&node->conval->setval + 4, i32, INT32); + __GET((ADDRESS)&node->conval->setval + 4, i32, INT32); if (i32 == 0) { node->typ = OPT_set32typ; } else { diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 0ed7bf75..19167eeb 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -13,7 +13,7 @@ static INT16 OPC_indentLevel; static INT8 OPC_hashtab[105]; -static CHAR OPC_keytab[60][9]; +static CHAR OPC_keytab[50][9]; static BOOLEAN OPC_GlbPtrs; static CHAR OPC_BodyNameExt[13]; @@ -187,7 +187,7 @@ void OPC_Ident (OPT_Object obj) OPM_WriteStringVar((void*)obj->name, 256); h = OPC_PerfectHash((void*)obj->name, 256); if (OPC_hashtab[__X(h, 105)] >= 0) { - if (__STRCMP(OPC_keytab[__X(OPC_hashtab[__X(h, 105)], 60)], obj->name) == 0) { + if (__STRCMP(OPC_keytab[__X(OPC_hashtab[__X(h, 105)], 50)], obj->name) == 0) { OPM_Write('_'); } } @@ -1920,7 +1920,7 @@ static void Enter__47 (CHAR *s, LONGINT s__len) __DUP(s, s__len, CHAR); h = OPC_PerfectHash((void*)s, s__len); OPC_hashtab[__X(h, 105)] = *InitKeywords__46_s->n; - __COPY(s, OPC_keytab[__X(*InitKeywords__46_s->n, 60)], 9); + __COPY(s, OPC_keytab[__X(*InitKeywords__46_s->n, 50)], 9); *InitKeywords__46_s->n += 1; __DEL(s); } @@ -1947,15 +1947,6 @@ static void OPC_InitKeywords (void) Enter__47((CHAR*)"UINT32", 7); Enter__47((CHAR*)"UINT64", 7); Enter__47((CHAR*)"UINT8", 6); - Enter__47((CHAR*)"address", 8); - Enter__47((CHAR*)"int16", 6); - Enter__47((CHAR*)"int32", 6); - Enter__47((CHAR*)"int64", 6); - Enter__47((CHAR*)"int8", 5); - Enter__47((CHAR*)"uint16", 7); - Enter__47((CHAR*)"uint32", 7); - Enter__47((CHAR*)"uint64", 7); - Enter__47((CHAR*)"uint8", 6); Enter__47((CHAR*)"asm", 4); Enter__47((CHAR*)"auto", 5); Enter__47((CHAR*)"break", 6); diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index be4ec200..9b4663f5 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -710,15 +710,15 @@ void OPM_FPrintReal (INT32 *fp, REAL real) { INT16 i; INT32 l; - __GET((address)&real, l, INT32); + __GET((ADDRESS)&real, l, INT32); OPM_FPrint(&*fp, l); } void OPM_FPrintLReal (INT32 *fp, LONGREAL lr) { INT32 l, h; - __GET((address)&lr, l, INT32); - __GET((address)&lr + 4, h, INT32); + __GET((ADDRESS)&lr, l, INT32); + __GET((ADDRESS)&lr + 4, h, INT32); OPM_FPrint(&*fp, l); OPM_FPrint(&*fp, h); } diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index 8854dd67..f40a6104 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -814,7 +814,7 @@ static void OPV_expr (OPT_Node n, INT16 prec) OPM_Write(')'); break; case 24: - OPM_WriteString((CHAR*)"(address)", 10); + OPM_WriteString((CHAR*)"(ADDRESS)", 10); if (l->class == 1) { OPC_CompleteIdent(l->obj); } else { @@ -830,7 +830,7 @@ static void OPV_expr (OPT_Node n, INT16 prec) OPC_Ident(n->typ->strobj); OPM_Write(')'); if (__IN(n->typ->form, 0x1800, 32) || __IN(l->typ->form, 0x1800, 32)) { - OPM_WriteString((CHAR*)"(address)", 10); + OPM_WriteString((CHAR*)"(ADDRESS)", 10); } OPV_expr(l, exprPrec); } else { @@ -1204,7 +1204,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) if (x->class == 7) { OPC_IntLiteral(x->conval->intval, OPM_AddressSize); } else { - OPM_WriteString((CHAR*)"((address)(", 12); + OPM_WriteString((CHAR*)"((ADDRESS)(", 12); OPV_expr(x, 10); OPM_WriteString((CHAR*)"))", 3); } diff --git a/bootstrap/unix-44/Out.c b/bootstrap/unix-44/Out.c index 04b1e484..c435c944 100644 --- a/bootstrap/unix-44/Out.c +++ b/bootstrap/unix-44/Out.c @@ -27,13 +27,13 @@ export LONGREAL Out_Ten (INT16 e); static void Out_digit (INT64 n, CHAR *s, LONGINT s__len, INT16 *i); static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, INT16 *i); -#define Out_Entier64(x) (int64)(x) +#define Out_Entier64(x) (INT64)(x) void Out_Flush (void) { INT16 error; if (Out_in > 0) { - error = Platform_Write(1, (address)Out_buf, Out_in); + error = Platform_Write(1, (ADDRESS)Out_buf, Out_in); } Out_in = 0; } @@ -74,9 +74,9 @@ void Out_String (CHAR *str, LONGINT str__len) Out_Flush(); } if (l > 128) { - error = Platform_Write(1, (address)str, l); + error = Platform_Write(1, (ADDRESS)str, l); } else { - __MOVE((address)str, (address)&Out_buf[__X(Out_in, 128)], l); + __MOVE((ADDRESS)str, (ADDRESS)&Out_buf[__X(Out_in, 128)], l); Out_in += (INT16)l; } __DEL(str); diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index f130d638..343fb141 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -158,7 +158,7 @@ extern void Heap_InitHeap(); #define Platform_statdev() (LONGINT)s.st_dev #define Platform_statino() (LONGINT)s.st_ino #define Platform_statmtime() (LONGINT)s.st_mtime -#define Platform_statsize() (address)s.st_size +#define Platform_statsize() (ADDRESS)s.st_size #define Platform_structstats() struct stat s #define Platform_system(str, str__len) system((char*)str) #define Platform_tmhour() (LONGINT)time->tm_hour @@ -227,7 +227,7 @@ void Platform_Init (INT32 argc, INT32 argvadr) Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; Platform_ArgCount = __VAL(INT16, argc); - av = (Platform_ArgVecPtr)(address)argvadr; + av = (Platform_ArgVecPtr)(ADDRESS)argvadr; Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; Platform_HeapInitHeap(); @@ -258,7 +258,7 @@ void Platform_GetArg (INT16 n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { - av = (Platform_ArgVec)(address)Platform_ArgVector; + av = (Platform_ArgVec)(ADDRESS)Platform_ArgVector; __COPY(*(*av)[__X(n, 1024)], val, val__len); } } @@ -488,7 +488,7 @@ INT16 Platform_Read (INT32 h, INT32 p, INT32 l, INT32 *n) INT16 Platform_ReadBuf (INT32 h, SYSTEM_BYTE *b, LONGINT b__len, INT32 *n) { - *n = Platform_readfile(h, (address)b, b__len); + *n = Platform_readfile(h, (ADDRESS)b, b__len); if (*n < 0) { *n = 0; return Platform_err(); @@ -696,7 +696,7 @@ static void Platform_TestLittleEndian (void) { INT16 i; i = 1; - __GET((address)&i, Platform_LittleEndian, BOOLEAN); + __GET((ADDRESS)&i, Platform_LittleEndian, BOOLEAN); } __TDESC(Platform_FileIdentity, 1, 0) = {__TDFLDS("FileIdentity", 12), {-4}}; diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index d6788751..432ce603 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -59,23 +59,23 @@ LONGREAL Reals_TenL (INT16 e) INT16 Reals_Expo (REAL x) { INT16 i; - __GET((address)&x + 2, i, INT16); + __GET((ADDRESS)&x + 2, i, INT16); return __MASK(__ASHR(i, 7), -256); } void Reals_SetExpo (REAL *x, INT16 ex) { CHAR c; - __GET((address)x + 3, c, CHAR); - __PUT((address)x + 3, (CHAR)(__ASHL(__ASHR((INT16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); - __GET((address)x + 2, c, CHAR); - __PUT((address)x + 2, (CHAR)(__MASK((INT16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); + __GET((ADDRESS)x + 3, c, CHAR); + __PUT((ADDRESS)x + 3, (CHAR)(__ASHL(__ASHR((INT16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __GET((ADDRESS)x + 2, c, CHAR); + __PUT((ADDRESS)x + 2, (CHAR)(__MASK((INT16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } INT16 Reals_ExpoL (LONGREAL x) { INT16 i; - __GET((address)&x + 6, i, INT16); + __GET((ADDRESS)&x + 6, i, INT16); return __MASK(__ASHR(i, 4), -2048); } diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 998a53d3..fc49744a 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -109,7 +109,7 @@ export void Files_WriteSet (Files_Rider *R, ADDRESS *R__typ, UINT32 x); export void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); #define Files_IdxTrap() __HALT(-1) -#define Files_ToAdr(x) (address)x +#define Files_ToAdr(x) (ADDRESS)x static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INT16 errcode) { @@ -262,7 +262,7 @@ static void Files_Flush (Files_Buffer buf) if (buf->org != f->pos) { error = Platform_Seek(f->fd, buf->org, Platform_SeekSet); } - error = Platform_Write(f->fd, (address)buf->data, buf->size); + error = Platform_Write(f->fd, (ADDRESS)buf->data, buf->size); if (error != 0) { Files_Err((CHAR*)"error writing file", 19, f, error); } @@ -645,7 +645,7 @@ void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x } else { min = n; } - __MOVE((address)buf->data + Files_ToAdr(offset), (address)x + Files_ToAdr(xpos), min); + __MOVE((ADDRESS)buf->data + Files_ToAdr(offset), (ADDRESS)x + Files_ToAdr(xpos), min); offset += min; (*r).offset = offset; xpos += min; @@ -703,7 +703,7 @@ void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT } else { min = n; } - __MOVE((address)x + Files_ToAdr(xpos), (address)buf->data + Files_ToAdr(offset), min); + __MOVE((ADDRESS)x + Files_ToAdr(xpos), (ADDRESS)buf->data + Files_ToAdr(offset), min); offset += min; (*r).offset = offset; if (offset > buf->size) { @@ -760,15 +760,15 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT __DEL(new); return; } - error = Platform_Read(fdold, (address)buf, 4096, &n); + error = Platform_Read(fdold, (ADDRESS)buf, 4096, &n); while (n > 0) { - error = Platform_Write(fdnew, (address)buf, n); + error = Platform_Write(fdnew, (ADDRESS)buf, n); if (error != 0) { ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); Files_Err((CHAR*)"cannot move file", 17, NIL, error); } - error = Platform_Read(fdold, (address)buf, 4096, &n); + error = Platform_Read(fdold, (ADDRESS)buf, 4096, &n); } ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); @@ -826,7 +826,7 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *de j += 1; } } else { - __MOVE((address)src, (address)dest, src__len); + __MOVE((ADDRESS)src, (ADDRESS)dest, src__len); } } @@ -916,7 +916,7 @@ void Files_ReadNum (Files_Rider *R, ADDRESS *R__typ, SYSTEM_BYTE *x, LONGINT x__ } q += (INT64)__ASH((__MASK(b, -64) - __ASHL(__ASHR(b, 6), 6)), s); __ASSERT(x__len <= 8, 0); - __MOVE((address)&q, (address)x, x__len); + __MOVE((ADDRESS)&q, (ADDRESS)x, x__len); } void Files_WriteBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN x) @@ -996,7 +996,7 @@ static void Files_Finalize (SYSTEM_PTR o) { Files_File f = NIL; INT32 res; - f = (Files_File)(address)o; + f = (Files_File)(ADDRESS)o; if (f->fd >= 0) { Files_CloseOSFile(f); if (f->tempFile) { @@ -1009,7 +1009,7 @@ void Files_SetSearchPath (CHAR *path, LONGINT path__len) { __DUP(path, path__len, CHAR); if (Strings_Length(path, path__len) != 0) { - Files_SearchPath = __NEWARR(NIL, 1, 1, 1, 1, ((address)((Strings_Length(path, path__len) + 1)))); + Files_SearchPath = __NEWARR(NIL, 1, 1, 1, 1, ((ADDRESS)((Strings_Length(path, path__len) + 1)))); __COPY(path, Files_SearchPath->data, Files_SearchPath->len[0]); } else { Files_SearchPath = NIL; diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index ca99053e..e8c720bb 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -105,8 +105,8 @@ static void Heap_Sift (INT32 l, INT32 r, INT32 *a, LONGINT a__len); export void Heap_Unlock (void); extern void *Heap__init(); -extern address Platform_MainStackFrame; -extern address Platform_OSAllocate(address size); +extern ADDRESS Platform_MainStackFrame; +extern ADDRESS Platform_OSAllocate(ADDRESS size); #define Heap_HeapModuleInit() Heap__init() #define Heap_OSAllocate(size) Platform_OSAllocate(size) #define Heap_PlatformHalt(code) Platform_Halt(code) @@ -138,7 +138,7 @@ SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) __COPY(name, m->name, 20); m->refcnt = 0; m->enumPtrs = enumPtrs; - m->next = (Heap_Module)(address)Heap_modules; + m->next = (Heap_Module)(ADDRESS)Heap_modules; Heap_modules = (SYSTEM_PTR)m; return (void*)m; } @@ -313,7 +313,7 @@ SYSTEM_PTR Heap_NEWREC (INT32 tag) __PUT(adr + 8, 0, INT32); Heap_allocated += blksz; Heap_Unlock(); - return (SYSTEM_PTR)(address)(adr + 4); + return (SYSTEM_PTR)(ADDRESS)(adr + 4); } SYSTEM_PTR Heap_NEWBLK (INT32 size) @@ -322,12 +322,12 @@ SYSTEM_PTR Heap_NEWBLK (INT32 size) SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 31, 4), 4); - new = Heap_NEWREC((address)&blksz); - tag = ((INT32)(address)new + blksz) - 12; + new = Heap_NEWREC((ADDRESS)&blksz); + tag = ((INT32)(ADDRESS)new + blksz) - 12; __PUT(tag - 4, 0, INT32); __PUT(tag, blksz, INT32); __PUT(tag + 4, -4, INT32); - __PUT((INT32)(address)new - 4, tag, INT32); + __PUT((INT32)(ADDRESS)new - 4, tag, INT32); Heap_Unlock(); return new; } @@ -355,7 +355,7 @@ static void Heap_Mark (INT32 q) __GET(tag, offset, INT32); fld = q + offset; __GET(fld, p, INT32); - __PUT(fld, (SYSTEM_PTR)(address)n, SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(ADDRESS)n, SYSTEM_PTR); } else { fld = q + offset; __GET(fld, n, INT32); @@ -364,7 +364,7 @@ static void Heap_Mark (INT32 q) if (!__ODD(tagbits)) { __PUT(n - 4, tagbits + 1, INT32); __PUT(q - 4, tag + 1, INT32); - __PUT(fld, (SYSTEM_PTR)(address)p, SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(ADDRESS)p, SYSTEM_PTR); p = q; q = n; tag = tagbits; @@ -379,7 +379,7 @@ static void Heap_Mark (INT32 q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((INT32)(address)p); + Heap_Mark((INT32)(ADDRESS)p); } static void Heap_Scan (void) @@ -548,7 +548,7 @@ static void Heap_Finalize (void) } else { prev->next = n->next; } - (*n->finalize)((SYSTEM_PTR)(address)n->obj); + (*n->finalize)((SYSTEM_PTR)(ADDRESS)n->obj); if (prev == NIL) { n = Heap_fin; } else { @@ -567,7 +567,7 @@ void Heap_FINALL (void) while (Heap_fin != NIL) { n = Heap_fin; Heap_fin = Heap_fin->next; - (*n->finalize)((SYSTEM_PTR)(address)n->obj); + (*n->finalize)((SYSTEM_PTR)(ADDRESS)n->obj); } } @@ -584,9 +584,9 @@ static void Heap_MarkStack (INT32 n, INT32 *cand, LONGINT cand__len) } if (n == 0) { nofcand = 0; - sp = (address)&frame; + sp = (ADDRESS)&frame; stack0 = Heap_PlatformMainStackFrame(); - inc = (address)&align.p - (address)&align; + inc = (ADDRESS)&align.p - (ADDRESS)&align; if (sp > stack0) { inc = -inc; } @@ -617,7 +617,7 @@ void Heap_GC (BOOLEAN markStack) INT32 cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); - m = (Heap_Module)(address)Heap_modules; + m = (Heap_Module)(ADDRESS)Heap_modules; while (m != NIL) { if (m->enumPtrs != NIL) { (*m->enumPtrs)(Heap_MarkP); @@ -694,7 +694,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (INT32)(address)obj; + f->obj = (INT32)(ADDRESS)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index 60993ebe..4b7fe51c 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -215,7 +215,7 @@ static void OPB_SetIntType (OPT_Node node) static void OPB_SetSetType (OPT_Node node) { INT32 i32; - __GET((address)&node->conval->setval + 4, i32, INT32); + __GET((ADDRESS)&node->conval->setval + 4, i32, INT32); if (i32 == 0) { node->typ = OPT_set32typ; } else { diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 0ed7bf75..19167eeb 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -13,7 +13,7 @@ static INT16 OPC_indentLevel; static INT8 OPC_hashtab[105]; -static CHAR OPC_keytab[60][9]; +static CHAR OPC_keytab[50][9]; static BOOLEAN OPC_GlbPtrs; static CHAR OPC_BodyNameExt[13]; @@ -187,7 +187,7 @@ void OPC_Ident (OPT_Object obj) OPM_WriteStringVar((void*)obj->name, 256); h = OPC_PerfectHash((void*)obj->name, 256); if (OPC_hashtab[__X(h, 105)] >= 0) { - if (__STRCMP(OPC_keytab[__X(OPC_hashtab[__X(h, 105)], 60)], obj->name) == 0) { + if (__STRCMP(OPC_keytab[__X(OPC_hashtab[__X(h, 105)], 50)], obj->name) == 0) { OPM_Write('_'); } } @@ -1920,7 +1920,7 @@ static void Enter__47 (CHAR *s, LONGINT s__len) __DUP(s, s__len, CHAR); h = OPC_PerfectHash((void*)s, s__len); OPC_hashtab[__X(h, 105)] = *InitKeywords__46_s->n; - __COPY(s, OPC_keytab[__X(*InitKeywords__46_s->n, 60)], 9); + __COPY(s, OPC_keytab[__X(*InitKeywords__46_s->n, 50)], 9); *InitKeywords__46_s->n += 1; __DEL(s); } @@ -1947,15 +1947,6 @@ static void OPC_InitKeywords (void) Enter__47((CHAR*)"UINT32", 7); Enter__47((CHAR*)"UINT64", 7); Enter__47((CHAR*)"UINT8", 6); - Enter__47((CHAR*)"address", 8); - Enter__47((CHAR*)"int16", 6); - Enter__47((CHAR*)"int32", 6); - Enter__47((CHAR*)"int64", 6); - Enter__47((CHAR*)"int8", 5); - Enter__47((CHAR*)"uint16", 7); - Enter__47((CHAR*)"uint32", 7); - Enter__47((CHAR*)"uint64", 7); - Enter__47((CHAR*)"uint8", 6); Enter__47((CHAR*)"asm", 4); Enter__47((CHAR*)"auto", 5); Enter__47((CHAR*)"break", 6); diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index be4ec200..9b4663f5 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -710,15 +710,15 @@ void OPM_FPrintReal (INT32 *fp, REAL real) { INT16 i; INT32 l; - __GET((address)&real, l, INT32); + __GET((ADDRESS)&real, l, INT32); OPM_FPrint(&*fp, l); } void OPM_FPrintLReal (INT32 *fp, LONGREAL lr) { INT32 l, h; - __GET((address)&lr, l, INT32); - __GET((address)&lr + 4, h, INT32); + __GET((ADDRESS)&lr, l, INT32); + __GET((ADDRESS)&lr + 4, h, INT32); OPM_FPrint(&*fp, l); OPM_FPrint(&*fp, h); } diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index 8854dd67..f40a6104 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -814,7 +814,7 @@ static void OPV_expr (OPT_Node n, INT16 prec) OPM_Write(')'); break; case 24: - OPM_WriteString((CHAR*)"(address)", 10); + OPM_WriteString((CHAR*)"(ADDRESS)", 10); if (l->class == 1) { OPC_CompleteIdent(l->obj); } else { @@ -830,7 +830,7 @@ static void OPV_expr (OPT_Node n, INT16 prec) OPC_Ident(n->typ->strobj); OPM_Write(')'); if (__IN(n->typ->form, 0x1800, 32) || __IN(l->typ->form, 0x1800, 32)) { - OPM_WriteString((CHAR*)"(address)", 10); + OPM_WriteString((CHAR*)"(ADDRESS)", 10); } OPV_expr(l, exprPrec); } else { @@ -1204,7 +1204,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) if (x->class == 7) { OPC_IntLiteral(x->conval->intval, OPM_AddressSize); } else { - OPM_WriteString((CHAR*)"((address)(", 12); + OPM_WriteString((CHAR*)"((ADDRESS)(", 12); OPV_expr(x, 10); OPM_WriteString((CHAR*)"))", 3); } diff --git a/bootstrap/unix-48/Out.c b/bootstrap/unix-48/Out.c index 04b1e484..c435c944 100644 --- a/bootstrap/unix-48/Out.c +++ b/bootstrap/unix-48/Out.c @@ -27,13 +27,13 @@ export LONGREAL Out_Ten (INT16 e); static void Out_digit (INT64 n, CHAR *s, LONGINT s__len, INT16 *i); static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, INT16 *i); -#define Out_Entier64(x) (int64)(x) +#define Out_Entier64(x) (INT64)(x) void Out_Flush (void) { INT16 error; if (Out_in > 0) { - error = Platform_Write(1, (address)Out_buf, Out_in); + error = Platform_Write(1, (ADDRESS)Out_buf, Out_in); } Out_in = 0; } @@ -74,9 +74,9 @@ void Out_String (CHAR *str, LONGINT str__len) Out_Flush(); } if (l > 128) { - error = Platform_Write(1, (address)str, l); + error = Platform_Write(1, (ADDRESS)str, l); } else { - __MOVE((address)str, (address)&Out_buf[__X(Out_in, 128)], l); + __MOVE((ADDRESS)str, (ADDRESS)&Out_buf[__X(Out_in, 128)], l); Out_in += (INT16)l; } __DEL(str); diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index f130d638..343fb141 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -158,7 +158,7 @@ extern void Heap_InitHeap(); #define Platform_statdev() (LONGINT)s.st_dev #define Platform_statino() (LONGINT)s.st_ino #define Platform_statmtime() (LONGINT)s.st_mtime -#define Platform_statsize() (address)s.st_size +#define Platform_statsize() (ADDRESS)s.st_size #define Platform_structstats() struct stat s #define Platform_system(str, str__len) system((char*)str) #define Platform_tmhour() (LONGINT)time->tm_hour @@ -227,7 +227,7 @@ void Platform_Init (INT32 argc, INT32 argvadr) Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; Platform_ArgCount = __VAL(INT16, argc); - av = (Platform_ArgVecPtr)(address)argvadr; + av = (Platform_ArgVecPtr)(ADDRESS)argvadr; Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; Platform_HeapInitHeap(); @@ -258,7 +258,7 @@ void Platform_GetArg (INT16 n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { - av = (Platform_ArgVec)(address)Platform_ArgVector; + av = (Platform_ArgVec)(ADDRESS)Platform_ArgVector; __COPY(*(*av)[__X(n, 1024)], val, val__len); } } @@ -488,7 +488,7 @@ INT16 Platform_Read (INT32 h, INT32 p, INT32 l, INT32 *n) INT16 Platform_ReadBuf (INT32 h, SYSTEM_BYTE *b, LONGINT b__len, INT32 *n) { - *n = Platform_readfile(h, (address)b, b__len); + *n = Platform_readfile(h, (ADDRESS)b, b__len); if (*n < 0) { *n = 0; return Platform_err(); @@ -696,7 +696,7 @@ static void Platform_TestLittleEndian (void) { INT16 i; i = 1; - __GET((address)&i, Platform_LittleEndian, BOOLEAN); + __GET((ADDRESS)&i, Platform_LittleEndian, BOOLEAN); } __TDESC(Platform_FileIdentity, 1, 0) = {__TDFLDS("FileIdentity", 12), {-4}}; diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index d6788751..432ce603 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -59,23 +59,23 @@ LONGREAL Reals_TenL (INT16 e) INT16 Reals_Expo (REAL x) { INT16 i; - __GET((address)&x + 2, i, INT16); + __GET((ADDRESS)&x + 2, i, INT16); return __MASK(__ASHR(i, 7), -256); } void Reals_SetExpo (REAL *x, INT16 ex) { CHAR c; - __GET((address)x + 3, c, CHAR); - __PUT((address)x + 3, (CHAR)(__ASHL(__ASHR((INT16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); - __GET((address)x + 2, c, CHAR); - __PUT((address)x + 2, (CHAR)(__MASK((INT16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); + __GET((ADDRESS)x + 3, c, CHAR); + __PUT((ADDRESS)x + 3, (CHAR)(__ASHL(__ASHR((INT16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __GET((ADDRESS)x + 2, c, CHAR); + __PUT((ADDRESS)x + 2, (CHAR)(__MASK((INT16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } INT16 Reals_ExpoL (LONGREAL x) { INT16 i; - __GET((address)&x + 6, i, INT16); + __GET((ADDRESS)&x + 6, i, INT16); return __MASK(__ASHR(i, 4), -2048); } diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index d5fefc27..2572b5cd 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -109,7 +109,7 @@ export void Files_WriteSet (Files_Rider *R, ADDRESS *R__typ, UINT32 x); export void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); #define Files_IdxTrap() __HALT(-1) -#define Files_ToAdr(x) (address)x +#define Files_ToAdr(x) (ADDRESS)x static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INT16 errcode) { @@ -262,7 +262,7 @@ static void Files_Flush (Files_Buffer buf) if (buf->org != f->pos) { error = Platform_Seek(f->fd, buf->org, Platform_SeekSet); } - error = Platform_Write(f->fd, (address)buf->data, buf->size); + error = Platform_Write(f->fd, (ADDRESS)buf->data, buf->size); if (error != 0) { Files_Err((CHAR*)"error writing file", 19, f, error); } @@ -645,7 +645,7 @@ void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x } else { min = n; } - __MOVE((address)buf->data + Files_ToAdr(offset), (address)x + Files_ToAdr(xpos), min); + __MOVE((ADDRESS)buf->data + Files_ToAdr(offset), (ADDRESS)x + Files_ToAdr(xpos), min); offset += min; (*r).offset = offset; xpos += min; @@ -703,7 +703,7 @@ void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT } else { min = n; } - __MOVE((address)x + Files_ToAdr(xpos), (address)buf->data + Files_ToAdr(offset), min); + __MOVE((ADDRESS)x + Files_ToAdr(xpos), (ADDRESS)buf->data + Files_ToAdr(offset), min); offset += min; (*r).offset = offset; if (offset > buf->size) { @@ -760,15 +760,15 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT __DEL(new); return; } - error = Platform_Read(fdold, (address)buf, 4096, &n); + error = Platform_Read(fdold, (ADDRESS)buf, 4096, &n); while (n > 0) { - error = Platform_Write(fdnew, (address)buf, n); + error = Platform_Write(fdnew, (ADDRESS)buf, n); if (error != 0) { ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); Files_Err((CHAR*)"cannot move file", 17, NIL, error); } - error = Platform_Read(fdold, (address)buf, 4096, &n); + error = Platform_Read(fdold, (ADDRESS)buf, 4096, &n); } ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); @@ -826,7 +826,7 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *de j += 1; } } else { - __MOVE((address)src, (address)dest, src__len); + __MOVE((ADDRESS)src, (ADDRESS)dest, src__len); } } @@ -916,7 +916,7 @@ void Files_ReadNum (Files_Rider *R, ADDRESS *R__typ, SYSTEM_BYTE *x, LONGINT x__ } q += (INT64)__ASH((__MASK(b, -64) - __ASHL(__ASHR(b, 6), 6)), s); __ASSERT(x__len <= 8, 0); - __MOVE((address)&q, (address)x, x__len); + __MOVE((ADDRESS)&q, (ADDRESS)x, x__len); } void Files_WriteBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN x) @@ -996,7 +996,7 @@ static void Files_Finalize (SYSTEM_PTR o) { Files_File f = NIL; INT32 res; - f = (Files_File)(address)o; + f = (Files_File)(ADDRESS)o; if (f->fd >= 0) { Files_CloseOSFile(f); if (f->tempFile) { @@ -1009,7 +1009,7 @@ void Files_SetSearchPath (CHAR *path, LONGINT path__len) { __DUP(path, path__len, CHAR); if (Strings_Length(path, path__len) != 0) { - Files_SearchPath = __NEWARR(NIL, 1, 1, 1, 1, ((address)((Strings_Length(path, path__len) + 1)))); + Files_SearchPath = __NEWARR(NIL, 1, 1, 1, 1, ((ADDRESS)((Strings_Length(path, path__len) + 1)))); __COPY(path, Files_SearchPath->data, Files_SearchPath->len[0]); } else { Files_SearchPath = NIL; diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index a162ea04..efbba685 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -105,8 +105,8 @@ static void Heap_Sift (INT64 l, INT64 r, INT64 *a, LONGINT a__len); export void Heap_Unlock (void); extern void *Heap__init(); -extern address Platform_MainStackFrame; -extern address Platform_OSAllocate(address size); +extern ADDRESS Platform_MainStackFrame; +extern ADDRESS Platform_OSAllocate(ADDRESS size); #define Heap_HeapModuleInit() Heap__init() #define Heap_OSAllocate(size) Platform_OSAllocate(size) #define Heap_PlatformHalt(code) Platform_Halt(code) @@ -138,7 +138,7 @@ SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) __COPY(name, m->name, 20); m->refcnt = 0; m->enumPtrs = enumPtrs; - m->next = (Heap_Module)(address)Heap_modules; + m->next = (Heap_Module)(ADDRESS)Heap_modules; Heap_modules = (SYSTEM_PTR)m; return (void*)m; } @@ -313,7 +313,7 @@ SYSTEM_PTR Heap_NEWREC (INT64 tag) __PUT(adr + 16, 0, INT64); Heap_allocated += blksz; Heap_Unlock(); - return (SYSTEM_PTR)(address)(adr + 8); + return (SYSTEM_PTR)(ADDRESS)(adr + 8); } SYSTEM_PTR Heap_NEWBLK (INT64 size) @@ -322,12 +322,12 @@ SYSTEM_PTR Heap_NEWBLK (INT64 size) SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 63, 5), 5); - new = Heap_NEWREC((address)&blksz); - tag = ((INT64)(address)new + blksz) - 24; + new = Heap_NEWREC((ADDRESS)&blksz); + tag = ((INT64)(ADDRESS)new + blksz) - 24; __PUT(tag - 8, 0, INT64); __PUT(tag, blksz, INT64); __PUT(tag + 8, -8, INT64); - __PUT((INT64)(address)new - 8, tag, INT64); + __PUT((INT64)(ADDRESS)new - 8, tag, INT64); Heap_Unlock(); return new; } @@ -355,7 +355,7 @@ static void Heap_Mark (INT64 q) __GET(tag, offset, INT64); fld = q + offset; __GET(fld, p, INT64); - __PUT(fld, (SYSTEM_PTR)(address)n, SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(ADDRESS)n, SYSTEM_PTR); } else { fld = q + offset; __GET(fld, n, INT64); @@ -364,7 +364,7 @@ static void Heap_Mark (INT64 q) if (!__ODD(tagbits)) { __PUT(n - 8, tagbits + 1, INT64); __PUT(q - 8, tag + 1, INT64); - __PUT(fld, (SYSTEM_PTR)(address)p, SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(ADDRESS)p, SYSTEM_PTR); p = q; q = n; tag = tagbits; @@ -379,7 +379,7 @@ static void Heap_Mark (INT64 q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((INT64)(address)p); + Heap_Mark((INT64)(ADDRESS)p); } static void Heap_Scan (void) @@ -548,7 +548,7 @@ static void Heap_Finalize (void) } else { prev->next = n->next; } - (*n->finalize)((SYSTEM_PTR)(address)n->obj); + (*n->finalize)((SYSTEM_PTR)(ADDRESS)n->obj); if (prev == NIL) { n = Heap_fin; } else { @@ -567,7 +567,7 @@ void Heap_FINALL (void) while (Heap_fin != NIL) { n = Heap_fin; Heap_fin = Heap_fin->next; - (*n->finalize)((SYSTEM_PTR)(address)n->obj); + (*n->finalize)((SYSTEM_PTR)(ADDRESS)n->obj); } } @@ -584,9 +584,9 @@ static void Heap_MarkStack (INT64 n, INT64 *cand, LONGINT cand__len) } if (n == 0) { nofcand = 0; - sp = (address)&frame; + sp = (ADDRESS)&frame; stack0 = Heap_PlatformMainStackFrame(); - inc = (address)&align.p - (address)&align; + inc = (ADDRESS)&align.p - (ADDRESS)&align; if (sp > stack0) { inc = -inc; } @@ -617,7 +617,7 @@ void Heap_GC (BOOLEAN markStack) INT64 cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); - m = (Heap_Module)(address)Heap_modules; + m = (Heap_Module)(ADDRESS)Heap_modules; while (m != NIL) { if (m->enumPtrs != NIL) { (*m->enumPtrs)(Heap_MarkP); @@ -694,7 +694,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (INT64)(address)obj; + f->obj = (INT64)(ADDRESS)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index 60993ebe..4b7fe51c 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -215,7 +215,7 @@ static void OPB_SetIntType (OPT_Node node) static void OPB_SetSetType (OPT_Node node) { INT32 i32; - __GET((address)&node->conval->setval + 4, i32, INT32); + __GET((ADDRESS)&node->conval->setval + 4, i32, INT32); if (i32 == 0) { node->typ = OPT_set32typ; } else { diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index 0ed7bf75..19167eeb 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -13,7 +13,7 @@ static INT16 OPC_indentLevel; static INT8 OPC_hashtab[105]; -static CHAR OPC_keytab[60][9]; +static CHAR OPC_keytab[50][9]; static BOOLEAN OPC_GlbPtrs; static CHAR OPC_BodyNameExt[13]; @@ -187,7 +187,7 @@ void OPC_Ident (OPT_Object obj) OPM_WriteStringVar((void*)obj->name, 256); h = OPC_PerfectHash((void*)obj->name, 256); if (OPC_hashtab[__X(h, 105)] >= 0) { - if (__STRCMP(OPC_keytab[__X(OPC_hashtab[__X(h, 105)], 60)], obj->name) == 0) { + if (__STRCMP(OPC_keytab[__X(OPC_hashtab[__X(h, 105)], 50)], obj->name) == 0) { OPM_Write('_'); } } @@ -1920,7 +1920,7 @@ static void Enter__47 (CHAR *s, LONGINT s__len) __DUP(s, s__len, CHAR); h = OPC_PerfectHash((void*)s, s__len); OPC_hashtab[__X(h, 105)] = *InitKeywords__46_s->n; - __COPY(s, OPC_keytab[__X(*InitKeywords__46_s->n, 60)], 9); + __COPY(s, OPC_keytab[__X(*InitKeywords__46_s->n, 50)], 9); *InitKeywords__46_s->n += 1; __DEL(s); } @@ -1947,15 +1947,6 @@ static void OPC_InitKeywords (void) Enter__47((CHAR*)"UINT32", 7); Enter__47((CHAR*)"UINT64", 7); Enter__47((CHAR*)"UINT8", 6); - Enter__47((CHAR*)"address", 8); - Enter__47((CHAR*)"int16", 6); - Enter__47((CHAR*)"int32", 6); - Enter__47((CHAR*)"int64", 6); - Enter__47((CHAR*)"int8", 5); - Enter__47((CHAR*)"uint16", 7); - Enter__47((CHAR*)"uint32", 7); - Enter__47((CHAR*)"uint64", 7); - Enter__47((CHAR*)"uint8", 6); Enter__47((CHAR*)"asm", 4); Enter__47((CHAR*)"auto", 5); Enter__47((CHAR*)"break", 6); diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 46b6c33e..d343241b 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -710,15 +710,15 @@ void OPM_FPrintReal (INT32 *fp, REAL real) { INT16 i; INT32 l; - __GET((address)&real, l, INT32); + __GET((ADDRESS)&real, l, INT32); OPM_FPrint(&*fp, l); } void OPM_FPrintLReal (INT32 *fp, LONGREAL lr) { INT32 l, h; - __GET((address)&lr, l, INT32); - __GET((address)&lr + 4, h, INT32); + __GET((ADDRESS)&lr, l, INT32); + __GET((ADDRESS)&lr + 4, h, INT32); OPM_FPrint(&*fp, l); OPM_FPrint(&*fp, h); } diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index ee84e643..ac2e6fba 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -814,7 +814,7 @@ static void OPV_expr (OPT_Node n, INT16 prec) OPM_Write(')'); break; case 24: - OPM_WriteString((CHAR*)"(address)", 10); + OPM_WriteString((CHAR*)"(ADDRESS)", 10); if (l->class == 1) { OPC_CompleteIdent(l->obj); } else { @@ -830,7 +830,7 @@ static void OPV_expr (OPT_Node n, INT16 prec) OPC_Ident(n->typ->strobj); OPM_Write(')'); if (__IN(n->typ->form, 0x1800, 32) || __IN(l->typ->form, 0x1800, 32)) { - OPM_WriteString((CHAR*)"(address)", 10); + OPM_WriteString((CHAR*)"(ADDRESS)", 10); } OPV_expr(l, exprPrec); } else { @@ -1204,7 +1204,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) if (x->class == 7) { OPC_IntLiteral(x->conval->intval, OPM_AddressSize); } else { - OPM_WriteString((CHAR*)"((address)(", 12); + OPM_WriteString((CHAR*)"((ADDRESS)(", 12); OPV_expr(x, 10); OPM_WriteString((CHAR*)"))", 3); } diff --git a/bootstrap/unix-88/Out.c b/bootstrap/unix-88/Out.c index 04b1e484..c435c944 100644 --- a/bootstrap/unix-88/Out.c +++ b/bootstrap/unix-88/Out.c @@ -27,13 +27,13 @@ export LONGREAL Out_Ten (INT16 e); static void Out_digit (INT64 n, CHAR *s, LONGINT s__len, INT16 *i); static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, INT16 *i); -#define Out_Entier64(x) (int64)(x) +#define Out_Entier64(x) (INT64)(x) void Out_Flush (void) { INT16 error; if (Out_in > 0) { - error = Platform_Write(1, (address)Out_buf, Out_in); + error = Platform_Write(1, (ADDRESS)Out_buf, Out_in); } Out_in = 0; } @@ -74,9 +74,9 @@ void Out_String (CHAR *str, LONGINT str__len) Out_Flush(); } if (l > 128) { - error = Platform_Write(1, (address)str, l); + error = Platform_Write(1, (ADDRESS)str, l); } else { - __MOVE((address)str, (address)&Out_buf[__X(Out_in, 128)], l); + __MOVE((ADDRESS)str, (ADDRESS)&Out_buf[__X(Out_in, 128)], l); Out_in += (INT16)l; } __DEL(str); diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 3e3c2992..c75a6d63 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -158,7 +158,7 @@ extern void Heap_InitHeap(); #define Platform_statdev() (LONGINT)s.st_dev #define Platform_statino() (LONGINT)s.st_ino #define Platform_statmtime() (LONGINT)s.st_mtime -#define Platform_statsize() (address)s.st_size +#define Platform_statsize() (ADDRESS)s.st_size #define Platform_structstats() struct stat s #define Platform_system(str, str__len) system((char*)str) #define Platform_tmhour() (LONGINT)time->tm_hour @@ -227,7 +227,7 @@ void Platform_Init (INT32 argc, INT64 argvadr) Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; Platform_ArgCount = __VAL(INT16, argc); - av = (Platform_ArgVecPtr)(address)argvadr; + av = (Platform_ArgVecPtr)(ADDRESS)argvadr; Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; Platform_HeapInitHeap(); @@ -258,7 +258,7 @@ void Platform_GetArg (INT16 n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { - av = (Platform_ArgVec)(address)Platform_ArgVector; + av = (Platform_ArgVec)(ADDRESS)Platform_ArgVector; __COPY(*(*av)[__X(n, 1024)], val, val__len); } } @@ -488,7 +488,7 @@ INT16 Platform_Read (INT32 h, INT64 p, INT32 l, INT32 *n) INT16 Platform_ReadBuf (INT32 h, SYSTEM_BYTE *b, LONGINT b__len, INT32 *n) { - *n = Platform_readfile(h, (address)b, b__len); + *n = Platform_readfile(h, (ADDRESS)b, b__len); if (*n < 0) { *n = 0; return Platform_err(); @@ -696,7 +696,7 @@ static void Platform_TestLittleEndian (void) { INT16 i; i = 1; - __GET((address)&i, Platform_LittleEndian, BOOLEAN); + __GET((ADDRESS)&i, Platform_LittleEndian, BOOLEAN); } __TDESC(Platform_FileIdentity, 1, 0) = {__TDFLDS("FileIdentity", 12), {-8}}; diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index d6788751..432ce603 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -59,23 +59,23 @@ LONGREAL Reals_TenL (INT16 e) INT16 Reals_Expo (REAL x) { INT16 i; - __GET((address)&x + 2, i, INT16); + __GET((ADDRESS)&x + 2, i, INT16); return __MASK(__ASHR(i, 7), -256); } void Reals_SetExpo (REAL *x, INT16 ex) { CHAR c; - __GET((address)x + 3, c, CHAR); - __PUT((address)x + 3, (CHAR)(__ASHL(__ASHR((INT16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); - __GET((address)x + 2, c, CHAR); - __PUT((address)x + 2, (CHAR)(__MASK((INT16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); + __GET((ADDRESS)x + 3, c, CHAR); + __PUT((ADDRESS)x + 3, (CHAR)(__ASHL(__ASHR((INT16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __GET((ADDRESS)x + 2, c, CHAR); + __PUT((ADDRESS)x + 2, (CHAR)(__MASK((INT16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } INT16 Reals_ExpoL (LONGREAL x) { INT16 i; - __GET((address)&x + 6, i, INT16); + __GET((ADDRESS)&x + 6, i, INT16); return __MASK(__ASHR(i, 4), -2048); } diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 6a00f93e..5f08fc35 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -109,7 +109,7 @@ export void Files_WriteSet (Files_Rider *R, ADDRESS *R__typ, UINT32 x); export void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); #define Files_IdxTrap() __HALT(-1) -#define Files_ToAdr(x) (address)x +#define Files_ToAdr(x) (ADDRESS)x static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INT16 errcode) { @@ -262,7 +262,7 @@ static void Files_Flush (Files_Buffer buf) if (buf->org != f->pos) { error = Platform_Seek(f->fd, buf->org, Platform_SeekSet); } - error = Platform_Write(f->fd, (address)buf->data, buf->size); + error = Platform_Write(f->fd, (ADDRESS)buf->data, buf->size); if (error != 0) { Files_Err((CHAR*)"error writing file", 19, f, error); } @@ -645,7 +645,7 @@ void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x } else { min = n; } - __MOVE((address)buf->data + Files_ToAdr(offset), (address)x + Files_ToAdr(xpos), min); + __MOVE((ADDRESS)buf->data + Files_ToAdr(offset), (ADDRESS)x + Files_ToAdr(xpos), min); offset += min; (*r).offset = offset; xpos += min; @@ -703,7 +703,7 @@ void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT } else { min = n; } - __MOVE((address)x + Files_ToAdr(xpos), (address)buf->data + Files_ToAdr(offset), min); + __MOVE((ADDRESS)x + Files_ToAdr(xpos), (ADDRESS)buf->data + Files_ToAdr(offset), min); offset += min; (*r).offset = offset; if (offset > buf->size) { @@ -760,15 +760,15 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT __DEL(new); return; } - error = Platform_Read(fdold, (address)buf, 4096, &n); + error = Platform_Read(fdold, (ADDRESS)buf, 4096, &n); while (n > 0) { - error = Platform_Write(fdnew, (address)buf, n); + error = Platform_Write(fdnew, (ADDRESS)buf, n); if (error != 0) { ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); Files_Err((CHAR*)"cannot move file", 17, NIL, error); } - error = Platform_Read(fdold, (address)buf, 4096, &n); + error = Platform_Read(fdold, (ADDRESS)buf, 4096, &n); } ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); @@ -826,7 +826,7 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *de j += 1; } } else { - __MOVE((address)src, (address)dest, src__len); + __MOVE((ADDRESS)src, (ADDRESS)dest, src__len); } } @@ -916,7 +916,7 @@ void Files_ReadNum (Files_Rider *R, ADDRESS *R__typ, SYSTEM_BYTE *x, LONGINT x__ } q += (INT64)__ASH((__MASK(b, -64) - __ASHL(__ASHR(b, 6), 6)), s); __ASSERT(x__len <= 8, 0); - __MOVE((address)&q, (address)x, x__len); + __MOVE((ADDRESS)&q, (ADDRESS)x, x__len); } void Files_WriteBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN x) @@ -996,7 +996,7 @@ static void Files_Finalize (SYSTEM_PTR o) { Files_File f = NIL; INT32 res; - f = (Files_File)(address)o; + f = (Files_File)(ADDRESS)o; if (f->fd >= 0) { Files_CloseOSFile(f); if (f->tempFile) { @@ -1009,7 +1009,7 @@ void Files_SetSearchPath (CHAR *path, LONGINT path__len) { __DUP(path, path__len, CHAR); if (Strings_Length(path, path__len) != 0) { - Files_SearchPath = __NEWARR(NIL, 1, 1, 1, 1, ((address)((Strings_Length(path, path__len) + 1)))); + Files_SearchPath = __NEWARR(NIL, 1, 1, 1, 1, ((ADDRESS)((Strings_Length(path, path__len) + 1)))); __COPY(path, Files_SearchPath->data, Files_SearchPath->len[0]); } else { Files_SearchPath = NIL; diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index ca99053e..e8c720bb 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -105,8 +105,8 @@ static void Heap_Sift (INT32 l, INT32 r, INT32 *a, LONGINT a__len); export void Heap_Unlock (void); extern void *Heap__init(); -extern address Platform_MainStackFrame; -extern address Platform_OSAllocate(address size); +extern ADDRESS Platform_MainStackFrame; +extern ADDRESS Platform_OSAllocate(ADDRESS size); #define Heap_HeapModuleInit() Heap__init() #define Heap_OSAllocate(size) Platform_OSAllocate(size) #define Heap_PlatformHalt(code) Platform_Halt(code) @@ -138,7 +138,7 @@ SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) __COPY(name, m->name, 20); m->refcnt = 0; m->enumPtrs = enumPtrs; - m->next = (Heap_Module)(address)Heap_modules; + m->next = (Heap_Module)(ADDRESS)Heap_modules; Heap_modules = (SYSTEM_PTR)m; return (void*)m; } @@ -313,7 +313,7 @@ SYSTEM_PTR Heap_NEWREC (INT32 tag) __PUT(adr + 8, 0, INT32); Heap_allocated += blksz; Heap_Unlock(); - return (SYSTEM_PTR)(address)(adr + 4); + return (SYSTEM_PTR)(ADDRESS)(adr + 4); } SYSTEM_PTR Heap_NEWBLK (INT32 size) @@ -322,12 +322,12 @@ SYSTEM_PTR Heap_NEWBLK (INT32 size) SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 31, 4), 4); - new = Heap_NEWREC((address)&blksz); - tag = ((INT32)(address)new + blksz) - 12; + new = Heap_NEWREC((ADDRESS)&blksz); + tag = ((INT32)(ADDRESS)new + blksz) - 12; __PUT(tag - 4, 0, INT32); __PUT(tag, blksz, INT32); __PUT(tag + 4, -4, INT32); - __PUT((INT32)(address)new - 4, tag, INT32); + __PUT((INT32)(ADDRESS)new - 4, tag, INT32); Heap_Unlock(); return new; } @@ -355,7 +355,7 @@ static void Heap_Mark (INT32 q) __GET(tag, offset, INT32); fld = q + offset; __GET(fld, p, INT32); - __PUT(fld, (SYSTEM_PTR)(address)n, SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(ADDRESS)n, SYSTEM_PTR); } else { fld = q + offset; __GET(fld, n, INT32); @@ -364,7 +364,7 @@ static void Heap_Mark (INT32 q) if (!__ODD(tagbits)) { __PUT(n - 4, tagbits + 1, INT32); __PUT(q - 4, tag + 1, INT32); - __PUT(fld, (SYSTEM_PTR)(address)p, SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(ADDRESS)p, SYSTEM_PTR); p = q; q = n; tag = tagbits; @@ -379,7 +379,7 @@ static void Heap_Mark (INT32 q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((INT32)(address)p); + Heap_Mark((INT32)(ADDRESS)p); } static void Heap_Scan (void) @@ -548,7 +548,7 @@ static void Heap_Finalize (void) } else { prev->next = n->next; } - (*n->finalize)((SYSTEM_PTR)(address)n->obj); + (*n->finalize)((SYSTEM_PTR)(ADDRESS)n->obj); if (prev == NIL) { n = Heap_fin; } else { @@ -567,7 +567,7 @@ void Heap_FINALL (void) while (Heap_fin != NIL) { n = Heap_fin; Heap_fin = Heap_fin->next; - (*n->finalize)((SYSTEM_PTR)(address)n->obj); + (*n->finalize)((SYSTEM_PTR)(ADDRESS)n->obj); } } @@ -584,9 +584,9 @@ static void Heap_MarkStack (INT32 n, INT32 *cand, LONGINT cand__len) } if (n == 0) { nofcand = 0; - sp = (address)&frame; + sp = (ADDRESS)&frame; stack0 = Heap_PlatformMainStackFrame(); - inc = (address)&align.p - (address)&align; + inc = (ADDRESS)&align.p - (ADDRESS)&align; if (sp > stack0) { inc = -inc; } @@ -617,7 +617,7 @@ void Heap_GC (BOOLEAN markStack) INT32 cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); - m = (Heap_Module)(address)Heap_modules; + m = (Heap_Module)(ADDRESS)Heap_modules; while (m != NIL) { if (m->enumPtrs != NIL) { (*m->enumPtrs)(Heap_MarkP); @@ -694,7 +694,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (INT32)(address)obj; + f->obj = (INT32)(ADDRESS)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index 60993ebe..4b7fe51c 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -215,7 +215,7 @@ static void OPB_SetIntType (OPT_Node node) static void OPB_SetSetType (OPT_Node node) { INT32 i32; - __GET((address)&node->conval->setval + 4, i32, INT32); + __GET((ADDRESS)&node->conval->setval + 4, i32, INT32); if (i32 == 0) { node->typ = OPT_set32typ; } else { diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 0ed7bf75..19167eeb 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -13,7 +13,7 @@ static INT16 OPC_indentLevel; static INT8 OPC_hashtab[105]; -static CHAR OPC_keytab[60][9]; +static CHAR OPC_keytab[50][9]; static BOOLEAN OPC_GlbPtrs; static CHAR OPC_BodyNameExt[13]; @@ -187,7 +187,7 @@ void OPC_Ident (OPT_Object obj) OPM_WriteStringVar((void*)obj->name, 256); h = OPC_PerfectHash((void*)obj->name, 256); if (OPC_hashtab[__X(h, 105)] >= 0) { - if (__STRCMP(OPC_keytab[__X(OPC_hashtab[__X(h, 105)], 60)], obj->name) == 0) { + if (__STRCMP(OPC_keytab[__X(OPC_hashtab[__X(h, 105)], 50)], obj->name) == 0) { OPM_Write('_'); } } @@ -1920,7 +1920,7 @@ static void Enter__47 (CHAR *s, LONGINT s__len) __DUP(s, s__len, CHAR); h = OPC_PerfectHash((void*)s, s__len); OPC_hashtab[__X(h, 105)] = *InitKeywords__46_s->n; - __COPY(s, OPC_keytab[__X(*InitKeywords__46_s->n, 60)], 9); + __COPY(s, OPC_keytab[__X(*InitKeywords__46_s->n, 50)], 9); *InitKeywords__46_s->n += 1; __DEL(s); } @@ -1947,15 +1947,6 @@ static void OPC_InitKeywords (void) Enter__47((CHAR*)"UINT32", 7); Enter__47((CHAR*)"UINT64", 7); Enter__47((CHAR*)"UINT8", 6); - Enter__47((CHAR*)"address", 8); - Enter__47((CHAR*)"int16", 6); - Enter__47((CHAR*)"int32", 6); - Enter__47((CHAR*)"int64", 6); - Enter__47((CHAR*)"int8", 5); - Enter__47((CHAR*)"uint16", 7); - Enter__47((CHAR*)"uint32", 7); - Enter__47((CHAR*)"uint64", 7); - Enter__47((CHAR*)"uint8", 6); Enter__47((CHAR*)"asm", 4); Enter__47((CHAR*)"auto", 5); Enter__47((CHAR*)"break", 6); diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index be4ec200..9b4663f5 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -710,15 +710,15 @@ void OPM_FPrintReal (INT32 *fp, REAL real) { INT16 i; INT32 l; - __GET((address)&real, l, INT32); + __GET((ADDRESS)&real, l, INT32); OPM_FPrint(&*fp, l); } void OPM_FPrintLReal (INT32 *fp, LONGREAL lr) { INT32 l, h; - __GET((address)&lr, l, INT32); - __GET((address)&lr + 4, h, INT32); + __GET((ADDRESS)&lr, l, INT32); + __GET((ADDRESS)&lr + 4, h, INT32); OPM_FPrint(&*fp, l); OPM_FPrint(&*fp, h); } diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index 8854dd67..f40a6104 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -814,7 +814,7 @@ static void OPV_expr (OPT_Node n, INT16 prec) OPM_Write(')'); break; case 24: - OPM_WriteString((CHAR*)"(address)", 10); + OPM_WriteString((CHAR*)"(ADDRESS)", 10); if (l->class == 1) { OPC_CompleteIdent(l->obj); } else { @@ -830,7 +830,7 @@ static void OPV_expr (OPT_Node n, INT16 prec) OPC_Ident(n->typ->strobj); OPM_Write(')'); if (__IN(n->typ->form, 0x1800, 32) || __IN(l->typ->form, 0x1800, 32)) { - OPM_WriteString((CHAR*)"(address)", 10); + OPM_WriteString((CHAR*)"(ADDRESS)", 10); } OPV_expr(l, exprPrec); } else { @@ -1204,7 +1204,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) if (x->class == 7) { OPC_IntLiteral(x->conval->intval, OPM_AddressSize); } else { - OPM_WriteString((CHAR*)"((address)(", 12); + OPM_WriteString((CHAR*)"((ADDRESS)(", 12); OPV_expr(x, 10); OPM_WriteString((CHAR*)"))", 3); } diff --git a/bootstrap/windows-48/Out.c b/bootstrap/windows-48/Out.c index 03213c6a..ea8636f2 100644 --- a/bootstrap/windows-48/Out.c +++ b/bootstrap/windows-48/Out.c @@ -27,13 +27,13 @@ export LONGREAL Out_Ten (INT16 e); static void Out_digit (INT64 n, CHAR *s, LONGINT s__len, INT16 *i); static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, INT16 *i); -#define Out_Entier64(x) (int64)(x) +#define Out_Entier64(x) (INT64)(x) void Out_Flush (void) { INT16 error; if (Out_in > 0) { - error = Platform_Write(Platform_StdOut, (address)Out_buf, Out_in); + error = Platform_Write(Platform_StdOut, (ADDRESS)Out_buf, Out_in); } Out_in = 0; } @@ -74,9 +74,9 @@ void Out_String (CHAR *str, LONGINT str__len) Out_Flush(); } if (l > 128) { - error = Platform_Write(Platform_StdOut, (address)str, l); + error = Platform_Write(Platform_StdOut, (ADDRESS)str, l); } else { - __MOVE((address)str, (address)&Out_buf[__X(Out_in, 128)], l); + __MOVE((ADDRESS)str, (ADDRESS)&Out_buf[__X(Out_in, 128)], l); Out_in += (INT16)l; } __DEL(str); diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 4a084fb4..baa90502 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -239,7 +239,7 @@ void Platform_Init (INT32 argc, INT32 argvadr) Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; Platform_ArgCount = __VAL(INT16, argc); - av = (Platform_ArgVecPtr)(address)argvadr; + av = (Platform_ArgVecPtr)(ADDRESS)argvadr; Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; Platform_HeapInitHeap(); @@ -275,7 +275,7 @@ void Platform_GetArg (INT16 n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { - av = (Platform_ArgVec)(address)Platform_ArgVector; + av = (Platform_ArgVec)(ADDRESS)Platform_ArgVector; __COPY(*(*av)[__X(n, 1024)], val, val__len); } } @@ -518,7 +518,7 @@ INT16 Platform_ReadBuf (INT32 h, SYSTEM_BYTE *b, LONGINT b__len, INT32 *n) { INT16 result; INT32 lengthread; - result = Platform_readfile(h, (address)b, b__len, &lengthread); + result = Platform_readfile(h, (ADDRESS)b, b__len, &lengthread); if (result == 0) { *n = 0; return Platform_err(); @@ -742,7 +742,7 @@ static void Platform_TestLittleEndian (void) { INT16 i; i = 1; - __GET((address)&i, Platform_LittleEndian, BOOLEAN); + __GET((ADDRESS)&i, Platform_LittleEndian, BOOLEAN); } __TDESC(Platform_FileIdentity, 1, 0) = {__TDFLDS("FileIdentity", 20), {-4}}; diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index d6788751..432ce603 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -59,23 +59,23 @@ LONGREAL Reals_TenL (INT16 e) INT16 Reals_Expo (REAL x) { INT16 i; - __GET((address)&x + 2, i, INT16); + __GET((ADDRESS)&x + 2, i, INT16); return __MASK(__ASHR(i, 7), -256); } void Reals_SetExpo (REAL *x, INT16 ex) { CHAR c; - __GET((address)x + 3, c, CHAR); - __PUT((address)x + 3, (CHAR)(__ASHL(__ASHR((INT16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); - __GET((address)x + 2, c, CHAR); - __PUT((address)x + 2, (CHAR)(__MASK((INT16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); + __GET((ADDRESS)x + 3, c, CHAR); + __PUT((ADDRESS)x + 3, (CHAR)(__ASHL(__ASHR((INT16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __GET((ADDRESS)x + 2, c, CHAR); + __PUT((ADDRESS)x + 2, (CHAR)(__MASK((INT16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } INT16 Reals_ExpoL (LONGREAL x) { INT16 i; - __GET((address)&x + 6, i, INT16); + __GET((ADDRESS)&x + 6, i, INT16); return __MASK(__ASHR(i, 4), -2048); } diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index e7239705..28c9e997 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -109,7 +109,7 @@ export void Files_WriteSet (Files_Rider *R, ADDRESS *R__typ, UINT32 x); export void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); #define Files_IdxTrap() __HALT(-1) -#define Files_ToAdr(x) (address)x +#define Files_ToAdr(x) (ADDRESS)x static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INT16 errcode) { @@ -262,7 +262,7 @@ static void Files_Flush (Files_Buffer buf) if (buf->org != f->pos) { error = Platform_Seek(f->fd, buf->org, Platform_SeekSet); } - error = Platform_Write(f->fd, (address)buf->data, buf->size); + error = Platform_Write(f->fd, (ADDRESS)buf->data, buf->size); if (error != 0) { Files_Err((CHAR*)"error writing file", 19, f, error); } @@ -645,7 +645,7 @@ void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x } else { min = n; } - __MOVE((address)buf->data + Files_ToAdr(offset), (address)x + Files_ToAdr(xpos), min); + __MOVE((ADDRESS)buf->data + Files_ToAdr(offset), (ADDRESS)x + Files_ToAdr(xpos), min); offset += min; (*r).offset = offset; xpos += min; @@ -703,7 +703,7 @@ void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT } else { min = n; } - __MOVE((address)x + Files_ToAdr(xpos), (address)buf->data + Files_ToAdr(offset), min); + __MOVE((ADDRESS)x + Files_ToAdr(xpos), (ADDRESS)buf->data + Files_ToAdr(offset), min); offset += min; (*r).offset = offset; if (offset > buf->size) { @@ -760,15 +760,15 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT __DEL(new); return; } - error = Platform_Read(fdold, (address)buf, 4096, &n); + error = Platform_Read(fdold, (ADDRESS)buf, 4096, &n); while (n > 0) { - error = Platform_Write(fdnew, (address)buf, n); + error = Platform_Write(fdnew, (ADDRESS)buf, n); if (error != 0) { ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); Files_Err((CHAR*)"cannot move file", 17, NIL, error); } - error = Platform_Read(fdold, (address)buf, 4096, &n); + error = Platform_Read(fdold, (ADDRESS)buf, 4096, &n); } ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); @@ -826,7 +826,7 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *de j += 1; } } else { - __MOVE((address)src, (address)dest, src__len); + __MOVE((ADDRESS)src, (ADDRESS)dest, src__len); } } @@ -916,7 +916,7 @@ void Files_ReadNum (Files_Rider *R, ADDRESS *R__typ, SYSTEM_BYTE *x, LONGINT x__ } q += (INT64)__ASH((__MASK(b, -64) - __ASHL(__ASHR(b, 6), 6)), s); __ASSERT(x__len <= 8, 0); - __MOVE((address)&q, (address)x, x__len); + __MOVE((ADDRESS)&q, (ADDRESS)x, x__len); } void Files_WriteBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN x) @@ -996,7 +996,7 @@ static void Files_Finalize (SYSTEM_PTR o) { Files_File f = NIL; INT32 res; - f = (Files_File)(address)o; + f = (Files_File)(ADDRESS)o; if (f->fd >= 0) { Files_CloseOSFile(f); if (f->tempFile) { @@ -1009,7 +1009,7 @@ void Files_SetSearchPath (CHAR *path, LONGINT path__len) { __DUP(path, path__len, CHAR); if (Strings_Length(path, path__len) != 0) { - Files_SearchPath = __NEWARR(NIL, 1, 1, 1, 1, ((address)((Strings_Length(path, path__len) + 1)))); + Files_SearchPath = __NEWARR(NIL, 1, 1, 1, 1, ((ADDRESS)((Strings_Length(path, path__len) + 1)))); __COPY(path, Files_SearchPath->data, Files_SearchPath->len[0]); } else { Files_SearchPath = NIL; diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index a162ea04..efbba685 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -105,8 +105,8 @@ static void Heap_Sift (INT64 l, INT64 r, INT64 *a, LONGINT a__len); export void Heap_Unlock (void); extern void *Heap__init(); -extern address Platform_MainStackFrame; -extern address Platform_OSAllocate(address size); +extern ADDRESS Platform_MainStackFrame; +extern ADDRESS Platform_OSAllocate(ADDRESS size); #define Heap_HeapModuleInit() Heap__init() #define Heap_OSAllocate(size) Platform_OSAllocate(size) #define Heap_PlatformHalt(code) Platform_Halt(code) @@ -138,7 +138,7 @@ SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) __COPY(name, m->name, 20); m->refcnt = 0; m->enumPtrs = enumPtrs; - m->next = (Heap_Module)(address)Heap_modules; + m->next = (Heap_Module)(ADDRESS)Heap_modules; Heap_modules = (SYSTEM_PTR)m; return (void*)m; } @@ -313,7 +313,7 @@ SYSTEM_PTR Heap_NEWREC (INT64 tag) __PUT(adr + 16, 0, INT64); Heap_allocated += blksz; Heap_Unlock(); - return (SYSTEM_PTR)(address)(adr + 8); + return (SYSTEM_PTR)(ADDRESS)(adr + 8); } SYSTEM_PTR Heap_NEWBLK (INT64 size) @@ -322,12 +322,12 @@ SYSTEM_PTR Heap_NEWBLK (INT64 size) SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 63, 5), 5); - new = Heap_NEWREC((address)&blksz); - tag = ((INT64)(address)new + blksz) - 24; + new = Heap_NEWREC((ADDRESS)&blksz); + tag = ((INT64)(ADDRESS)new + blksz) - 24; __PUT(tag - 8, 0, INT64); __PUT(tag, blksz, INT64); __PUT(tag + 8, -8, INT64); - __PUT((INT64)(address)new - 8, tag, INT64); + __PUT((INT64)(ADDRESS)new - 8, tag, INT64); Heap_Unlock(); return new; } @@ -355,7 +355,7 @@ static void Heap_Mark (INT64 q) __GET(tag, offset, INT64); fld = q + offset; __GET(fld, p, INT64); - __PUT(fld, (SYSTEM_PTR)(address)n, SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(ADDRESS)n, SYSTEM_PTR); } else { fld = q + offset; __GET(fld, n, INT64); @@ -364,7 +364,7 @@ static void Heap_Mark (INT64 q) if (!__ODD(tagbits)) { __PUT(n - 8, tagbits + 1, INT64); __PUT(q - 8, tag + 1, INT64); - __PUT(fld, (SYSTEM_PTR)(address)p, SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(ADDRESS)p, SYSTEM_PTR); p = q; q = n; tag = tagbits; @@ -379,7 +379,7 @@ static void Heap_Mark (INT64 q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((INT64)(address)p); + Heap_Mark((INT64)(ADDRESS)p); } static void Heap_Scan (void) @@ -548,7 +548,7 @@ static void Heap_Finalize (void) } else { prev->next = n->next; } - (*n->finalize)((SYSTEM_PTR)(address)n->obj); + (*n->finalize)((SYSTEM_PTR)(ADDRESS)n->obj); if (prev == NIL) { n = Heap_fin; } else { @@ -567,7 +567,7 @@ void Heap_FINALL (void) while (Heap_fin != NIL) { n = Heap_fin; Heap_fin = Heap_fin->next; - (*n->finalize)((SYSTEM_PTR)(address)n->obj); + (*n->finalize)((SYSTEM_PTR)(ADDRESS)n->obj); } } @@ -584,9 +584,9 @@ static void Heap_MarkStack (INT64 n, INT64 *cand, LONGINT cand__len) } if (n == 0) { nofcand = 0; - sp = (address)&frame; + sp = (ADDRESS)&frame; stack0 = Heap_PlatformMainStackFrame(); - inc = (address)&align.p - (address)&align; + inc = (ADDRESS)&align.p - (ADDRESS)&align; if (sp > stack0) { inc = -inc; } @@ -617,7 +617,7 @@ void Heap_GC (BOOLEAN markStack) INT64 cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); - m = (Heap_Module)(address)Heap_modules; + m = (Heap_Module)(ADDRESS)Heap_modules; while (m != NIL) { if (m->enumPtrs != NIL) { (*m->enumPtrs)(Heap_MarkP); @@ -694,7 +694,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (INT64)(address)obj; + f->obj = (INT64)(ADDRESS)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index 60993ebe..4b7fe51c 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -215,7 +215,7 @@ static void OPB_SetIntType (OPT_Node node) static void OPB_SetSetType (OPT_Node node) { INT32 i32; - __GET((address)&node->conval->setval + 4, i32, INT32); + __GET((ADDRESS)&node->conval->setval + 4, i32, INT32); if (i32 == 0) { node->typ = OPT_set32typ; } else { diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index 0ed7bf75..19167eeb 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -13,7 +13,7 @@ static INT16 OPC_indentLevel; static INT8 OPC_hashtab[105]; -static CHAR OPC_keytab[60][9]; +static CHAR OPC_keytab[50][9]; static BOOLEAN OPC_GlbPtrs; static CHAR OPC_BodyNameExt[13]; @@ -187,7 +187,7 @@ void OPC_Ident (OPT_Object obj) OPM_WriteStringVar((void*)obj->name, 256); h = OPC_PerfectHash((void*)obj->name, 256); if (OPC_hashtab[__X(h, 105)] >= 0) { - if (__STRCMP(OPC_keytab[__X(OPC_hashtab[__X(h, 105)], 60)], obj->name) == 0) { + if (__STRCMP(OPC_keytab[__X(OPC_hashtab[__X(h, 105)], 50)], obj->name) == 0) { OPM_Write('_'); } } @@ -1920,7 +1920,7 @@ static void Enter__47 (CHAR *s, LONGINT s__len) __DUP(s, s__len, CHAR); h = OPC_PerfectHash((void*)s, s__len); OPC_hashtab[__X(h, 105)] = *InitKeywords__46_s->n; - __COPY(s, OPC_keytab[__X(*InitKeywords__46_s->n, 60)], 9); + __COPY(s, OPC_keytab[__X(*InitKeywords__46_s->n, 50)], 9); *InitKeywords__46_s->n += 1; __DEL(s); } @@ -1947,15 +1947,6 @@ static void OPC_InitKeywords (void) Enter__47((CHAR*)"UINT32", 7); Enter__47((CHAR*)"UINT64", 7); Enter__47((CHAR*)"UINT8", 6); - Enter__47((CHAR*)"address", 8); - Enter__47((CHAR*)"int16", 6); - Enter__47((CHAR*)"int32", 6); - Enter__47((CHAR*)"int64", 6); - Enter__47((CHAR*)"int8", 5); - Enter__47((CHAR*)"uint16", 7); - Enter__47((CHAR*)"uint32", 7); - Enter__47((CHAR*)"uint64", 7); - Enter__47((CHAR*)"uint8", 6); Enter__47((CHAR*)"asm", 4); Enter__47((CHAR*)"auto", 5); Enter__47((CHAR*)"break", 6); diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 46b6c33e..d343241b 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -710,15 +710,15 @@ void OPM_FPrintReal (INT32 *fp, REAL real) { INT16 i; INT32 l; - __GET((address)&real, l, INT32); + __GET((ADDRESS)&real, l, INT32); OPM_FPrint(&*fp, l); } void OPM_FPrintLReal (INT32 *fp, LONGREAL lr) { INT32 l, h; - __GET((address)&lr, l, INT32); - __GET((address)&lr + 4, h, INT32); + __GET((ADDRESS)&lr, l, INT32); + __GET((ADDRESS)&lr + 4, h, INT32); OPM_FPrint(&*fp, l); OPM_FPrint(&*fp, h); } diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index ee84e643..ac2e6fba 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -814,7 +814,7 @@ static void OPV_expr (OPT_Node n, INT16 prec) OPM_Write(')'); break; case 24: - OPM_WriteString((CHAR*)"(address)", 10); + OPM_WriteString((CHAR*)"(ADDRESS)", 10); if (l->class == 1) { OPC_CompleteIdent(l->obj); } else { @@ -830,7 +830,7 @@ static void OPV_expr (OPT_Node n, INT16 prec) OPC_Ident(n->typ->strobj); OPM_Write(')'); if (__IN(n->typ->form, 0x1800, 32) || __IN(l->typ->form, 0x1800, 32)) { - OPM_WriteString((CHAR*)"(address)", 10); + OPM_WriteString((CHAR*)"(ADDRESS)", 10); } OPV_expr(l, exprPrec); } else { @@ -1204,7 +1204,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) if (x->class == 7) { OPC_IntLiteral(x->conval->intval, OPM_AddressSize); } else { - OPM_WriteString((CHAR*)"((address)(", 12); + OPM_WriteString((CHAR*)"((ADDRESS)(", 12); OPV_expr(x, 10); OPM_WriteString((CHAR*)"))", 3); } diff --git a/bootstrap/windows-88/Out.c b/bootstrap/windows-88/Out.c index 03213c6a..ea8636f2 100644 --- a/bootstrap/windows-88/Out.c +++ b/bootstrap/windows-88/Out.c @@ -27,13 +27,13 @@ export LONGREAL Out_Ten (INT16 e); static void Out_digit (INT64 n, CHAR *s, LONGINT s__len, INT16 *i); static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, INT16 *i); -#define Out_Entier64(x) (int64)(x) +#define Out_Entier64(x) (INT64)(x) void Out_Flush (void) { INT16 error; if (Out_in > 0) { - error = Platform_Write(Platform_StdOut, (address)Out_buf, Out_in); + error = Platform_Write(Platform_StdOut, (ADDRESS)Out_buf, Out_in); } Out_in = 0; } @@ -74,9 +74,9 @@ void Out_String (CHAR *str, LONGINT str__len) Out_Flush(); } if (l > 128) { - error = Platform_Write(Platform_StdOut, (address)str, l); + error = Platform_Write(Platform_StdOut, (ADDRESS)str, l); } else { - __MOVE((address)str, (address)&Out_buf[__X(Out_in, 128)], l); + __MOVE((ADDRESS)str, (ADDRESS)&Out_buf[__X(Out_in, 128)], l); Out_in += (INT16)l; } __DEL(str); diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index c154f33b..2b9fd2c2 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -239,7 +239,7 @@ void Platform_Init (INT32 argc, INT64 argvadr) Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; Platform_ArgCount = __VAL(INT16, argc); - av = (Platform_ArgVecPtr)(address)argvadr; + av = (Platform_ArgVecPtr)(ADDRESS)argvadr; Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; Platform_HeapInitHeap(); @@ -275,7 +275,7 @@ void Platform_GetArg (INT16 n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { - av = (Platform_ArgVec)(address)Platform_ArgVector; + av = (Platform_ArgVec)(ADDRESS)Platform_ArgVector; __COPY(*(*av)[__X(n, 1024)], val, val__len); } } @@ -518,7 +518,7 @@ INT16 Platform_ReadBuf (INT32 h, SYSTEM_BYTE *b, LONGINT b__len, INT32 *n) { INT16 result; INT32 lengthread; - result = Platform_readfile(h, (address)b, b__len, &lengthread); + result = Platform_readfile(h, (ADDRESS)b, b__len, &lengthread); if (result == 0) { *n = 0; return Platform_err(); @@ -742,7 +742,7 @@ static void Platform_TestLittleEndian (void) { INT16 i; i = 1; - __GET((address)&i, Platform_LittleEndian, BOOLEAN); + __GET((ADDRESS)&i, Platform_LittleEndian, BOOLEAN); } __TDESC(Platform_FileIdentity, 1, 0) = {__TDFLDS("FileIdentity", 20), {-8}}; diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index d6788751..432ce603 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -59,23 +59,23 @@ LONGREAL Reals_TenL (INT16 e) INT16 Reals_Expo (REAL x) { INT16 i; - __GET((address)&x + 2, i, INT16); + __GET((ADDRESS)&x + 2, i, INT16); return __MASK(__ASHR(i, 7), -256); } void Reals_SetExpo (REAL *x, INT16 ex) { CHAR c; - __GET((address)x + 3, c, CHAR); - __PUT((address)x + 3, (CHAR)(__ASHL(__ASHR((INT16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); - __GET((address)x + 2, c, CHAR); - __PUT((address)x + 2, (CHAR)(__MASK((INT16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); + __GET((ADDRESS)x + 3, c, CHAR); + __PUT((ADDRESS)x + 3, (CHAR)(__ASHL(__ASHR((INT16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __GET((ADDRESS)x + 2, c, CHAR); + __PUT((ADDRESS)x + 2, (CHAR)(__MASK((INT16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } INT16 Reals_ExpoL (LONGREAL x) { INT16 i; - __GET((address)&x + 6, i, INT16); + __GET((ADDRESS)&x + 6, i, INT16); return __MASK(__ASHR(i, 4), -2048); } diff --git a/doc/Features.md b/doc/Features.md index 21ab306e..e597732c 100644 --- a/doc/Features.md +++ b/doc/Features.md @@ -111,7 +111,10 @@ Most Oberon systems have implicitly or explicitly assumed that LONGINT is large machine addresses. With the requirement to support 32 bit LONGINT on 64 bit systems, this is no longer possible. -The type SYSTEM.ADDRESS is added, a signed integer type equivalent to either SYSTEM.INT32 or SYSTEM.INT64 according to the system address size. +The type SYSTEM.ADDRESS is added, a signed integer type equivalent to either SYSTEM.INT32 or SYSTEM.INT64 +according to the system address size. As a general purpose integer type it can be used not just to +store machine addresses, but also for any arithmetic purpose related to machine addresses, such as +lengths of memory objects or offsets into memory objects. The following SYSTEM module predefined functions and procedures now use SYSTEM.ADDRESS instead of LONGINT. diff --git a/src/compiler/OPC.Mod b/src/compiler/OPC.Mod index 5670546e..a8681e32 100644 --- a/src/compiler/OPC.Mod +++ b/src/compiler/OPC.Mod @@ -39,7 +39,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) VAR indentLevel: INTEGER; hashtab: ARRAY 105 OF SHORTINT; - keytab: ARRAY 60 (*50*), 9 OF CHAR; + keytab: ARRAY 50, 9 OF CHAR; GlbPtrs: BOOLEAN; BodyNameExt: ARRAY 13 OF CHAR; @@ -1275,16 +1275,6 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) Enter("UINT64"); (* pseudo keyword used by voc *) Enter("UINT8"); (* pseudo keyword used by voc *) - Enter("address"); (* pseudo keyword used by voc *) - Enter("int16"); (* pseudo keyword used by voc *) - Enter("int32"); (* pseudo keyword used by voc *) - Enter("int64"); (* pseudo keyword used by voc *) - Enter("int8"); (* pseudo keyword used by voc *) - Enter("uint16"); (* pseudo keyword used by voc *) - Enter("uint32"); (* pseudo keyword used by voc *) - Enter("uint64"); (* pseudo keyword used by voc *) - Enter("uint8"); (* pseudo keyword used by voc *) - Enter("asm"); Enter("auto"); Enter("break"); diff --git a/src/compiler/OPV.Mod b/src/compiler/OPV.Mod index 318a0847..cd3c649c 100644 --- a/src/compiler/OPV.Mod +++ b/src/compiler/OPV.Mod @@ -502,7 +502,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 expr(l, MinPrec); OPM.Write(CloseParen) | OPT.cap: OPM.WriteString("__CAP("); expr(l, MinPrec); OPM.Write(CloseParen) | OPT.odd: OPM.WriteString("__ODD("); expr(l, MinPrec); OPM.Write(CloseParen) - | OPT.adr: OPM.WriteString("(address)"); (*SYSTEM*) + | OPT.adr: OPM.WriteString("(ADDRESS)"); (*SYSTEM*) IF l^.class = OPT.Nvarpar THEN OPC.CompleteIdent(l^.obj) ELSE IF (l^.typ^.form # OPT.String) & ~(l^.typ^.comp IN {OPT.Array, OPT.DynArr}) THEN OPM.Write("&") END ; @@ -515,7 +515,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 THEN OPM.Write(OpenParen); OPC.Ident(n^.typ^.strobj); OPM.Write(CloseParen); IF (n^.typ^.form IN {OPT.Pointer, OPT.ProcTyp}) OR (l^.typ^.form IN {OPT.Pointer, OPT.ProcTyp}) THEN - OPM.WriteString("(address)") + OPM.WriteString("(ADDRESS)") END; expr(l, exprPrec) ELSE @@ -736,7 +736,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 IF typ^.comp = OPT.DynArr THEN IF x^.class = OPT.Nconst THEN OPC.IntLiteral(x.conval.intval, OPM.AddressSize) - ELSE OPM.WriteString("((address)("); expr(x, 10); OPM.WriteString("))") + ELSE OPM.WriteString("((ADDRESS)("); expr(x, 10); OPM.WriteString("))") END ; x := x^.link ELSE diff --git a/src/runtime/Files.Mod b/src/runtime/Files.Mod index a8246ace..1daefc0b 100644 --- a/src/runtime/Files.Mod +++ b/src/runtime/Files.Mod @@ -73,7 +73,7 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files PROCEDURE -IdxTrap "__HALT(-1)"; - PROCEDURE -ToAdr(x: SYSTEM.INT64): SYSTEM.ADDRESS "(address)x"; + PROCEDURE -ToAdr(x: SYSTEM.INT64): SYSTEM.ADDRESS "(ADDRESS)x"; PROCEDURE^ Finalize(o: SYSTEM.PTR); diff --git a/src/runtime/Heap.Mod b/src/runtime/Heap.Mod index b05b218b..a74b4684 100644 --- a/src/runtime/Heap.Mod +++ b/src/runtime/Heap.Mod @@ -162,7 +162,7 @@ MODULE Heap; END INCREF; - PROCEDURE -ExternPlatformOSAllocate "extern address Platform_OSAllocate(address size);"; + PROCEDURE -ExternPlatformOSAllocate "extern ADDRESS Platform_OSAllocate(ADDRESS size);"; PROCEDURE -OSAllocate(size: S.ADDRESS): S.ADDRESS "Platform_OSAllocate(size)"; PROCEDURE NewChunk(blksz: S.ADDRESS): S.ADDRESS; @@ -317,25 +317,25 @@ MODULE Heap; VAR p, tag, offset, fld, n, tagbits: S.ADDRESS; BEGIN IF q # 0 THEN - S.GET(q - SZA, tagbits); (* Load the tag for the record at q *) - IF ~ODD(tagbits) THEN (* If it has not already been marked *) + S.GET(q - SZA, tagbits); (* Load the tag for the record at q *) + IF ~ODD(tagbits) THEN (* If it has not already been marked *) S.PUT(q - SZA, tagbits + 1); (* Mark it *) p := 0; - tag := tagbits + SZA; (* Tag addresses first offset *) + tag := tagbits + SZA; (* Tag addresses first offset *) LOOP S.GET(tag, offset); (* Get next ptr field offset *) - IF offset < 0 THEN (* Sentinel reached: Value is -8*(#fields+1) *) + IF offset < 0 THEN (* Sentinel reached: Value is -8*(#fields+1) *) S.PUT(q - SZA, tag + offset + 1); (* Rotate base ptr into tag *) IF p = 0 THEN EXIT END ; n := q; q := p; S.GET(q - SZA, tag); DEC(tag, 1); S.GET(tag, offset); fld := q + offset; S.GET(fld, p); S.PUT(fld, S.VAL(S.PTR, n)) - ELSE (* offset references a ptr field *) - fld := q + offset; (* S.ADDRESS the pointer *) - S.GET(fld, n); (* Load the pointer *) - IF n # 0 THEN (* If pointer is not NIL *) - S.GET(n - SZA, tagbits); (* Consider record pointed to by this field *) + ELSE (* offset references a ptr field *) + fld := q + offset; (* S.ADDRESS the pointer *) + S.GET(fld, n); (* Load the pointer *) + IF n # 0 THEN (* If pointer is not NIL *) + S.GET(n - SZA, tagbits); (* Consider record pointed to by this field *) IF ~ODD(tagbits) THEN S.PUT(n - SZA, tagbits + 1); S.PUT(q - SZA, tag + 1); @@ -483,7 +483,7 @@ MODULE Heap; END END FINALL; - PROCEDURE -ExternMainStackFrame "extern address Platform_MainStackFrame;"; + PROCEDURE -ExternMainStackFrame "extern ADDRESS Platform_MainStackFrame;"; PROCEDURE -PlatformMainStackFrame(): S.ADDRESS "Platform_MainStackFrame"; PROCEDURE MarkStack(n: S.ADDRESS; VAR cand: ARRAY OF S.ADDRESS); diff --git a/src/runtime/Out.Mod b/src/runtime/Out.Mod index c6429527..0dc4ed27 100644 --- a/src/runtime/Out.Mod +++ b/src/runtime/Out.Mod @@ -93,7 +93,7 @@ BEGIN r := 1.0D0; power := 1.0D1; RETURN r END Ten; -PROCEDURE -Entier64(x: LONGREAL): SYSTEM.INT64 "(int64)(x)"; +PROCEDURE -Entier64(x: LONGREAL): SYSTEM.INT64 "(INT64)(x)"; PROCEDURE RealP(x: LONGREAL; n: INTEGER; long: BOOLEAN); diff --git a/src/runtime/Platformunix.Mod b/src/runtime/Platformunix.Mod index 3ca44012..6f7dc4a0 100644 --- a/src/runtime/Platformunix.Mod +++ b/src/runtime/Platformunix.Mod @@ -320,7 +320,7 @@ PROCEDURE -structstats "struct stat s"; PROCEDURE -statdev(): LONGINT "(LONGINT)s.st_dev"; PROCEDURE -statino(): LONGINT "(LONGINT)s.st_ino"; PROCEDURE -statmtime(): LONGINT "(LONGINT)s.st_mtime"; -PROCEDURE -statsize(): LONGINT "(address)s.st_size"; +PROCEDURE -statsize(): LONGINT "(ADDRESS)s.st_size"; PROCEDURE Identify*(h: FileHandle; VAR identity: FileIdentity): ErrorCode; BEGIN diff --git a/src/runtime/SYSTEM.h b/src/runtime/SYSTEM.h index 481cded9..fb88276c 100644 --- a/src/runtime/SYSTEM.h +++ b/src/runtime/SYSTEM.h @@ -86,20 +86,6 @@ typedef void* SYSTEM_PTR; #endif -// Temporary build support - which changing lowercase int* and address to uppercase - -#define int8 INT8 -#define int16 INT16 -#define int32 INT32 -#define int64 INT64 -#define uint8 UINT8 -#define uint16 UINT16 -#define uint32 UINT32 -#define uint64 UINT64 -#define address ADDRESS - - - // ---------------------------------------------------------------------- // ---------------------------------------------------------------------- @@ -179,12 +165,12 @@ static inline int __str_cmp(CHAR *x, CHAR *y){ #define __GET(a, x, t) x=*(t*)(ADDRESS)(a) #define __PUT(a, x, t) *(t*)(ADDRESS)(a)=x -#define __LSHL(x, n, s) ((int##s)((uint##s)(x)<<(n))) -#define __LSHR(x, n, s) ((int##s)((uint##s)(x)>>(n))) +#define __LSHL(x, n, s) ((INT##s)((UINT##s)(x)<<(n))) +#define __LSHR(x, n, s) ((INT##s)((UINT##s)(x)>>(n))) #define __LSH(x, n, s) ((n)>=0? __LSHL(x, n, s): __LSHR(x, -(n), s)) -#define __ROTL(x, n, s) ((int##s)((uint##s)(x)<<(n)|(uint##s)(x)>>(s-(n)))) -#define __ROTR(x, n, s) ((int##s)((uint##s)(x)>>(n)|(uint##s)(x)<<(s-(n)))) +#define __ROTL(x, n, s) ((INT##s)((UINT##s)(x)<<(n)|(UINT##s)(x)>>(s-(n)))) +#define __ROTR(x, n, s) ((INT##s)((UINT##s)(x)>>(n)|(UINT##s)(x)<<(s-(n)))) #define __ROT(x, n, s) ((n)>=0? __ROTL(x, n, s): __ROTR(x, -(n), s)) #define __ASHL(x, n) ((INT64)(x)<<(n)) @@ -222,10 +208,10 @@ static inline double SYSTEM_ABSD(double i) {return i >= 0.0 ? i : -i;} #define __CAP(ch) ((CHAR)((ch)&0x5f)) #define __ODD(x) ((x)&1) -#define __IN(x, s, size) (((unsigned int)(x))>(x))&1)) +#define __IN(x, s, size) (((unsigned int)(x))>(x))&1)) // todo tested versions of SETOF and SETRNG: check that x, l and h fit size -#define __SETOF(x, size) ((uint##size)1<<(x)) -#define __SETRNG(l, h, size) ((~(uint##size)0<<(l))&~(uint##size)0>>(size-1-(h))) +#define __SETOF(x, size) ((UINT##size)1<<(x)) +#define __SETRNG(l, h, size) ((~(UINT##size)0<<(l))&~(UINT##size)0>>(size-1-(h))) #define __MASK(x, m) ((x)&~(m)) #define __BIT(x, n) (*(UINT64*)(x)>>(n)&1) diff --git a/src/tools/make/configure.c b/src/tools/make/configure.c index 695fa0e2..183d1966 100644 --- a/src/tools/make/configure.c +++ b/src/tools/make/configure.c @@ -430,10 +430,10 @@ void writeConfigurationMod() { int main(int argc, char *argv[]) { // Make sure SYSTEM.h has set up our core data types correctly. - assert(sizeof(int8) == 1, "sizeof(int8) is not 1."); - assert(sizeof(int16) == 2, "sizeof(int16) is not 2."); - assert(sizeof(int32) == 4, "sizeof(int32) is not 4."); - assert(sizeof(int64) == 8, "sizeof(int64) is not 8."); + assert(sizeof(INT8) == 1, "sizeof(INT8) is not 1."); + assert(sizeof(INT16) == 2, "sizeof(INT16) is not 2."); + assert(sizeof(INT32) == 4, "sizeof(INT32) is not 4."); + assert(sizeof(INT64) == 8, "sizeof(INT64) is not 8."); oname = getenv("ONAME"); if (!oname) oname = macrotostring(O_NAME); diff --git a/src/tools/make/ignore b/src/tools/make/ignore index 1f2cafbe..42554f00 100644 --- a/src/tools/make/ignore +++ b/src/tools/make/ignore @@ -4,4 +4,4 @@ OPM_ResourceDir __MOVE.* cmd, OPM_(IntSize|PointerSize|Alignment) = Strings_Append.+void\*\)(cmd|OPM_OBERON|extTools_comp) -__COPY\("(gcc|clang|msc|i686-w64-mingw) +__COPY\("(gcc|clang|msc|i686-w64-mingw|x86_64-w64-mingw) From eeb168c0266ccfb4bee4be8de570c2f1e731efaf Mon Sep 17 00:00:00 2001 From: David Brown Date: Tue, 8 Nov 2016 18:37:15 +0000 Subject: [PATCH 307/580] Support Microsoft C make again following dual library (O2 and OC) support. --- ReadMe.md | 16 +- bootstrap/SYSTEM.h | 3 + bootstrap/unix-44/extTools.c | 1 + bootstrap/unix-48/extTools.c | 1 + bootstrap/unix-88/extTools.c | 1 + bootstrap/windows-48/extTools.c | 1 + bootstrap/windows-88/extTools.c | 1 + make.cmd | 463 ++++++++++++++++++-------------- src/compiler/extTools.Mod | 1 + src/runtime/SYSTEM.h | 3 + src/tools/make/configure.c | 5 +- src/tools/make/oberon.mk | 1 + 12 files changed, 285 insertions(+), 212 deletions(-) diff --git a/ReadMe.md b/ReadMe.md index 30d63d60..1330efb6 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -11,7 +11,7 @@ Oberon programs under Unix, Mac or Windows. Vishap Oberon includes libraries from the Ulm, oo2c and Ofront Oberon compilers, as well as default libraries complying with the Oakwood Guidelines for Oberon-2 compilers. -#### Contents +### Contents     [**Installation**](#installation)
    [**A 'Hello' application**](#a-hello-application)
@@ -30,7 +30,7 @@ default libraries complying with the Oakwood Guidelines for Oberon-2 compilers. While pre-built packages are not provided, it is easy to install the Oberon compiler and libraries with the following simple steps. -###### 1. Install prerequisites +#### 1. Install prerequisites | Platform | Packages | | --------- | ------------ | @@ -42,7 +42,7 @@ with the following simple steps. More details, including for MingW and MS C, in [**Installation**](/doc/Installation.md). -###### 2. Build and install the compiler and libraries +#### 2. Build and install the compiler and libraries 1. `git clone https://github.com/vishaps/voc` 2. `cd voc` @@ -50,7 +50,7 @@ More details, including for MingW and MS C, in [**Installation**](/doc/Installat Since 'make full' will install the compiler and libraries, it needs root (unix) or administrator (windows) privileges. -###### 3. Stet your PATH environment variable +#### 3. Stet your PATH environment variable Set your path to the installed compiler binary location as reported by make full, e.g. @@ -143,7 +143,7 @@ For details, including how to add support for unrecognised systems, see Vishap Oberon supports the Oberon 2 programming language, including type-bound procedures. SYSTEM.Mod includes additional functionality and some changes for 64 bit support. -##### Integer and set type sizes: +#### Integer and set type sizes: | Type | -O2 option (default) | -OC option | | --- | --- | --- | @@ -152,7 +152,7 @@ Vishap Oberon supports the Oberon 2 programming language, including type-bound p | LONGINT | 32 bit | 64 bit | | SET | 32 bit | 64 bit | -##### Libraries +#### Libraries Included libraries ease porting of code from the major Oberon systems: @@ -186,7 +186,7 @@ David Brown has worked on adding support for more platforms incuding windows usi ## Origin of the name "Ñ´ishap Oberon" -###### Oberon +#### Oberon Oberon is a programming language, an operating system and a graphical user interface. Originally designed and implemented by by Niklaus Wirth and @@ -205,7 +205,7 @@ of Einstein and Antoine de Saint-Exupéry: > when there is no longer anything to take away. (Antoine de Saint-Exupéry, > translated by Lewis Galantière.) -###### Ñ´ishap +#### Ñ´ishap Vishaps are dragons inhabiting the Armenian Highlands. We decided to name the project “Vishap†because ties between compilers and dragons have ancient traditions. diff --git a/bootstrap/SYSTEM.h b/bootstrap/SYSTEM.h index fb88276c..3f3b6133 100644 --- a/bootstrap/SYSTEM.h +++ b/bootstrap/SYSTEM.h @@ -26,6 +26,9 @@ #define _SIZE_T_DEFINED_ // For OpenBSD void *memcpy(void *dest, const void *source, size_t size); +#if defined _WIN32 +#define alloca _alloca +#endif void *alloca(size_t size); diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index 8ed00f14..aa59dd88 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -104,6 +104,7 @@ void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN stati Strings_Append((CHAR*)" -l voc", 8, (void*)cmd, 1023); Strings_Append((CHAR*)"-O", 3, (void*)cmd, 1023); Strings_Append(OPM_Model, 10, (void*)cmd, 1023); + Strings_Append((CHAR*)"", 1, (void*)cmd, 1023); extTools_execute((CHAR*)"Assemble and link: ", 20, cmd, 1023); __DEL(additionalopts); } diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index 8ed00f14..aa59dd88 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -104,6 +104,7 @@ void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN stati Strings_Append((CHAR*)" -l voc", 8, (void*)cmd, 1023); Strings_Append((CHAR*)"-O", 3, (void*)cmd, 1023); Strings_Append(OPM_Model, 10, (void*)cmd, 1023); + Strings_Append((CHAR*)"", 1, (void*)cmd, 1023); extTools_execute((CHAR*)"Assemble and link: ", 20, cmd, 1023); __DEL(additionalopts); } diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index 8ed00f14..aa59dd88 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -104,6 +104,7 @@ void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN stati Strings_Append((CHAR*)" -l voc", 8, (void*)cmd, 1023); Strings_Append((CHAR*)"-O", 3, (void*)cmd, 1023); Strings_Append(OPM_Model, 10, (void*)cmd, 1023); + Strings_Append((CHAR*)"", 1, (void*)cmd, 1023); extTools_execute((CHAR*)"Assemble and link: ", 20, cmd, 1023); __DEL(additionalopts); } diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index 8ed00f14..aa59dd88 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -104,6 +104,7 @@ void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN stati Strings_Append((CHAR*)" -l voc", 8, (void*)cmd, 1023); Strings_Append((CHAR*)"-O", 3, (void*)cmd, 1023); Strings_Append(OPM_Model, 10, (void*)cmd, 1023); + Strings_Append((CHAR*)"", 1, (void*)cmd, 1023); extTools_execute((CHAR*)"Assemble and link: ", 20, cmd, 1023); __DEL(additionalopts); } diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index 8ed00f14..aa59dd88 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -104,6 +104,7 @@ void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN stati Strings_Append((CHAR*)" -l voc", 8, (void*)cmd, 1023); Strings_Append((CHAR*)"-O", 3, (void*)cmd, 1023); Strings_Append(OPM_Model, 10, (void*)cmd, 1023); + Strings_Append((CHAR*)"", 1, (void*)cmd, 1023); extTools_execute((CHAR*)"Assemble and link: ", 20, cmd, 1023); __DEL(additionalopts); } diff --git a/make.cmd b/make.cmd index 5ff269df..80ab98d4 100644 --- a/make.cmd +++ b/make.cmd @@ -16,7 +16,7 @@ :: Create configuration and parameter files. -cl -nologo -Isrc\system src\tools\make\configure.c >nul +cl -nologo -Isrc\runtime src\tools\make\configure.c >nul setlocal configure.exe >nul del configure.obj configure.exe 2>nul @@ -27,7 +27,8 @@ for /F "delims='=' tokens=1,2" %%a in (Configuration.make) do set %%a=%%b set FLAVOUR=%OS%.%DATAMODEL%.%COMPILER% set BUILDDIR=build\%FLAVOUR% -set VISHAP=%ONAME%%BINEXT% +set OBECOMP=%ONAME%%BINEXT% +set MODEL=2 for /F %%d in ('cd');do set ROOTDIR=%%d @@ -62,11 +63,17 @@ goto :eof :full +whoami /groups | find "12288" >nul +if errorlevel 1 ( +echo make full - administrator rights required. Please run under an administrator command prompt. +goto :eof +) call :clean || exit /b call :compiler || exit /b call :browsercmd || exit /b call :library || exit /b call :install || exit /b +call :showpath || exit /b goto :eof @@ -80,23 +87,9 @@ goto :eof -:library -call :v4 || exit /b -call :ooc2 || exit /b -call :ooc || exit /b -call :ulm || exit /b -call :pow32 || exit /b -call :misc || exit /b -call :s3 || exit /b -call :librarybinary || exit /b -goto :eof - - - - :clean rd /s /q %BUILDDIR% 2>nul -del /q %VISHAP% 2>nul +del /q %OBECOMP% 2>nul goto :eof @@ -111,7 +104,7 @@ echo. PLATFORM: %PLATFORM% echo. OS: %OS% echo. BUILDDIR: %BUILDDIR% echo. Oberon characteristics: -echo. INTSIZE: %INTSIZE% +echo. MODEL: %MODEL% echo. ADRSIZE: %ADRSIZE% echo. ALIGNMENT: %ALIGNMENT% echo. C compiler: @@ -122,19 +115,21 @@ echo. DATAMODEL: %DATAMODEL% cd %BUILDDIR% cl -nologo /Zi -c SYSTEM.c Configuration.c Platform.c Heap.c || exit /b -cl -nologo /Zi -c Console.c Strings.c Modules.c Files.c || exit /b +cl -nologo /Zi -c Out.c Strings.c Modules.c Files.c || exit /b cl -nologo /Zi -c Reals.c Texts.c vt100.c errors.c || exit /b cl -nologo /Zi -c OPM.c extTools.c OPS.c OPT.c || exit /b cl -nologo /Zi -c OPC.c OPV.c OPB.c OPP.c || exit /b -cl -nologo /Zi Vishap.c /Fe%ROOTDIR%\%VISHAP% ^ +cl -nologo /Zi Compiler.c /Fe%ROOTDIR%\%OBECOMP% /link /INCREMENTAL:NO ^ SYSTEM.obj Configuration.obj Platform.obj Heap.obj ^ -Console.obj Strings.obj Modules.obj Files.obj ^ -Reals.obj Texts.obj vt100.obj errors.obj ^ +Out.obj Strings.obj Modules.obj Files.obj ^ +Reals.obj Texts.obj VT100.obj errors.obj ^ OPM.obj extTools.obj OPS.obj OPT.obj ^ OPC.obj OPV.obj OPB.obj OPP.obj || exit /b -echo.%VISHAP% created. +copy src\runtime\*.c %BUILDDIR% >nul +copy src\runtime\*.h %BUILDDIR% >nul +echo.%OBECOMP% created. cd %ROOTDIR% goto :eof @@ -145,7 +140,11 @@ goto :eof echo.Populating clean build directory from bootstrap C sources. mkdir %BUILDDIR% >nul 2>nul copy bootstrap\%PLATFORM%-%ADRSIZE%%ALIGNMENT%\*.* %BUILDDIR% >nul +copy bootstrap\*.c %BUILDDIR% >nul +copy bootstrap\*.h %BUILDDIR% >nul call :assemble || exit /b +copy bootstrap\*.c %BUILDDIR% >nul +copy bootstrap\*.h %BUILDDIR% >nul goto :eof @@ -154,40 +153,39 @@ goto :eof :translate :: Make sure we have an oberon compiler binary: if we built one earlier we'll use it, :: otherwise use one of the saved sets of C sources in the bootstrap directory. -if not exist %VISHAP% call :compilefromsavedsource +if not exist %OBECOMP% call :compilefromsavedsource echo. echo.make translate - translating compiler source: echo. PLATFORM: %PLATFORM% -echo. INTSIZE: %INTSIZE% +echo. MODEL: %MODEL% echo. ADRSIZE: %ADRSIZE% echo. ALIGNMENT: %ALIGNMENT% md %BUILDDIR% 2>nul cd %BUILDDIR% -%ROOTDIR%\%VISHAP% -SFs -B%INTSIZE%%ADRSIZE%%ALIGNMENT% ../../Configuration.Mod || exit /b -%ROOTDIR%\%VISHAP% -SFs -B%INTSIZE%%ADRSIZE%%ALIGNMENT% ../../src/system/Platform%PLATFORM%.Mod || exit /b -%ROOTDIR%\%VISHAP% -SFsapx -B%INTSIZE%%ADRSIZE%%ALIGNMENT% ../../src/system/Heap.Mod || exit /b -%ROOTDIR%\%VISHAP% -SFs -B%INTSIZE%%ADRSIZE%%ALIGNMENT% ../../src/system/Console.Mod || exit /b -%ROOTDIR%\%VISHAP% -SFs -B%INTSIZE%%ADRSIZE%%ALIGNMENT% ../../src/library/v4/Strings.Mod || exit /b -%ROOTDIR%\%VISHAP% -SFs -B%INTSIZE%%ADRSIZE%%ALIGNMENT% ../../src/library/v4/Modules.Mod || exit /b -%ROOTDIR%\%VISHAP% -SFsx -B%INTSIZE%%ADRSIZE%%ALIGNMENT% ../../src/system/Files.Mod || exit /b -%ROOTDIR%\%VISHAP% -SFs -B%INTSIZE%%ADRSIZE%%ALIGNMENT% ../../src/library/v4/Reals.Mod || exit /b -%ROOTDIR%\%VISHAP% -SFs -B%INTSIZE%%ADRSIZE%%ALIGNMENT% ../../src/library/v4/Texts.Mod || exit /b -%ROOTDIR%\%VISHAP% -SFs -B%INTSIZE%%ADRSIZE%%ALIGNMENT% ../../src/library/misc/vt100.Mod || exit /b -%ROOTDIR%\%VISHAP% -SFs -B%INTSIZE%%ADRSIZE%%ALIGNMENT% ../../src/compiler/errors.Mod || exit /b -%ROOTDIR%\%VISHAP% -SFs -B%INTSIZE%%ADRSIZE%%ALIGNMENT% ../../src/compiler/OPM.cmdln.Mod || exit /b -%ROOTDIR%\%VISHAP% -SFs -B%INTSIZE%%ADRSIZE%%ALIGNMENT% ../../src/compiler/extTools.Mod || exit /b -%ROOTDIR%\%VISHAP% -SFsx -B%INTSIZE%%ADRSIZE%%ALIGNMENT% ../../src/compiler/OPS.Mod || exit /b -%ROOTDIR%\%VISHAP% -SFs -B%INTSIZE%%ADRSIZE%%ALIGNMENT% ../../src/compiler/OPT.Mod || exit /b -%ROOTDIR%\%VISHAP% -SFs -B%INTSIZE%%ADRSIZE%%ALIGNMENT% ../../src/compiler/OPC.Mod || exit /b -%ROOTDIR%\%VISHAP% -SFs -B%INTSIZE%%ADRSIZE%%ALIGNMENT% ../../src/compiler/OPV.Mod || exit /b -%ROOTDIR%\%VISHAP% -SFs -B%INTSIZE%%ADRSIZE%%ALIGNMENT% ../../src/compiler/OPB.Mod || exit /b -%ROOTDIR%\%VISHAP% -SFs -B%INTSIZE%%ADRSIZE%%ALIGNMENT% ../../src/compiler/OPP.Mod || exit /b -%ROOTDIR%\%VISHAP% -Ssm -B%INTSIZE%%ADRSIZE%%ALIGNMENT% ../../src/compiler/Vishap.Mod || exit /b +del *.sym >nul 2>nul +%ROOTDIR%\%OBECOMP% -SsfF -A%ADRSIZE%%ALIGNMENT% -O%MODEL% ../../Configuration.Mod || exit /b +%ROOTDIR%\%OBECOMP% -SsfF -A%ADRSIZE%%ALIGNMENT% -O%MODEL% ../../src/runtime/Platform%PLATFORM%.Mod || exit /b +%ROOTDIR%\%OBECOMP% -SsfFapx -A%ADRSIZE%%ALIGNMENT% -O%MODEL% ../../src/runtime/Heap.Mod || exit /b +%ROOTDIR%\%OBECOMP% -SsfF -A%ADRSIZE%%ALIGNMENT% -O%MODEL% ../../src/runtime/Strings.Mod || exit /b +%ROOTDIR%\%OBECOMP% -SsfF -A%ADRSIZE%%ALIGNMENT% -O%MODEL% ../../src/runtime/Out.Mod || exit /b +%ROOTDIR%\%OBECOMP% -SsfF -A%ADRSIZE%%ALIGNMENT% -O%MODEL% ../../src/runtime/Modules.Mod || exit /b +%ROOTDIR%\%OBECOMP% -SsfFx -A%ADRSIZE%%ALIGNMENT% -O%MODEL% ../../src/runtime/Files.Mod || exit /b +%ROOTDIR%\%OBECOMP% -SsfF -A%ADRSIZE%%ALIGNMENT% -O%MODEL% ../../src/runtime/Reals.Mod || exit /b +%ROOTDIR%\%OBECOMP% -SsfF -A%ADRSIZE%%ALIGNMENT% -O%MODEL% ../../src/runtime/Texts.Mod || exit /b +%ROOTDIR%\%OBECOMP% -SsfF -A%ADRSIZE%%ALIGNMENT% -O%MODEL% ../../src/runtime/VT100.Mod || exit /b +%ROOTDIR%\%OBECOMP% -SsfF -A%ADRSIZE%%ALIGNMENT% -O%MODEL% ../../src/compiler/errors.Mod || exit /b +%ROOTDIR%\%OBECOMP% -SsfF -A%ADRSIZE%%ALIGNMENT% -O%MODEL% ../../src/compiler/OPM.Mod || exit /b +%ROOTDIR%\%OBECOMP% -SsfF -A%ADRSIZE%%ALIGNMENT% -O%MODEL% ../../src/compiler/extTools.Mod || exit /b +%ROOTDIR%\%OBECOMP% -SsfFx -A%ADRSIZE%%ALIGNMENT% -O%MODEL% ../../src/compiler/OPS.Mod || exit /b +%ROOTDIR%\%OBECOMP% -SsfF -A%ADRSIZE%%ALIGNMENT% -O%MODEL% ../../src/compiler/OPT.Mod || exit /b +%ROOTDIR%\%OBECOMP% -SsfF -A%ADRSIZE%%ALIGNMENT% -O%MODEL% ../../src/compiler/OPC.Mod || exit /b +%ROOTDIR%\%OBECOMP% -SsfF -A%ADRSIZE%%ALIGNMENT% -O%MODEL% ../../src/compiler/OPV.Mod || exit /b +%ROOTDIR%\%OBECOMP% -SsfF -A%ADRSIZE%%ALIGNMENT% -O%MODEL% ../../src/compiler/OPB.Mod || exit /b +%ROOTDIR%\%OBECOMP% -SsfF -A%ADRSIZE%%ALIGNMENT% -O%MODEL% ../../src/compiler/OPP.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ssfm -A%ADRSIZE%%ALIGNMENT% -O%MODEL% ../../src/compiler/Compiler.Mod || exit /b cd %ROOTDIR% -copy src\system\*.c %BUILDDIR% >nul -copy src\system\*.h %BUILDDIR% >nul echo.%BUILDDIR% filled with compiler C source. goto :eof @@ -198,10 +196,10 @@ goto :eof echo. echo.Making symbol browser cd %BUILDDIR% -%ROOTDIR%/%VISHAP% -Sm ../../src/tools/browser/BrowserCmd.Mod +%ROOTDIR%/%OBECOMP% -fSm ../../src/tools/browser/BrowserCmd.Mod cl -nologo BrowserCmd.c /Feshowdef.exe ^ - Platform.obj Texts.obj OPT.obj Heap.obj Console.obj SYSTEM.obj OPM.obj OPS.obj OPV.obj ^ - Files.obj Reals.obj Modules.obj vt100.obj errors.obj Configuration.obj Strings.obj ^ + Platform.obj Texts.obj OPT.obj Heap.obj Out.obj SYSTEM.obj OPM.obj OPS.obj OPV.obj ^ + Files.obj Reals.obj Modules.obj VT100.obj errors.obj Configuration.obj Strings.obj ^ OPC.obj cd %ROOTDIR% goto :eof @@ -215,19 +213,28 @@ if errorlevel 1 ( echo make install - administrator rights required. Please run under an administrator command prompt. goto :eof ) -rmdir /s /q "%INSTALLDIR%" >nul 2>&1 -mkdir "%INSTALLDIR%" >nul 2>&1 -mkdir "%INSTALLDIR%\bin" >nul 2>&1 -mkdir "%INSTALLDIR%\include" >nul 2>&1 -mkdir "%INSTALLDIR%\sym" >nul 2>&1 -mkdir "%INSTALLDIR%\lib" >nul 2>&1 -copy %BUILDDIR%\*.h "%INSTALLDIR%\include" >nul -copy %BUILDDIR%\*.sym "%INSTALLDIR%\sym" >nul -copy %VISHAP% "%INSTALLDIR%\bin" >nul -copy %BUILDDIR%\showdef.exe "%INSTALLDIR%\bin" >nul -copy %BUILDDIR%\lib%ONAME%.lib "%INSTALLDIR%\lib" >nul -echo. -echo.Now add "%INSTALLDIR%\bin" to your path. +rmdir /s /q "%INSTALLDIR%" >nul 2>&1 +mkdir "%INSTALLDIR%" >nul 2>&1 + +mkdir "%INSTALLDIR%\bin" >nul 2>&1 +copy %OBECOMP% "%INSTALLDIR%\bin" >nul +copy %BUILDDIR%\showdef.exe "%INSTALLDIR%\bin" >nul + +mkdir "%INSTALLDIR%\2" >nul 2>&1 +mkdir "%INSTALLDIR%\2\include" >nul 2>&1 +mkdir "%INSTALLDIR%\2\sym" >nul 2>&1 +copy %BUILDDIR%\2\*.h "%INSTALLDIR%\2\include" >nul +copy %BUILDDIR%\2\*.sym "%INSTALLDIR%\2\sym" >nul + +mkdir "%INSTALLDIR%\C" >nul 2>&1 +mkdir "%INSTALLDIR%\C\include" >nul 2>&1 +mkdir "%INSTALLDIR%\C\sym" >nul 2>&1 +copy %BUILDDIR%\C\*.h "%INSTALLDIR%\C\include" >nul +copy %BUILDDIR%\C\*.sym "%INSTALLDIR%\C\sym" >nul + +mkdir "%INSTALLDIR%\lib" >nul 2>&1 +copy %BUILDDIR%\2\lib%ONAME%* "%INSTALLDIR%\lib" >nul +copy %BUILDDIR%\C\lib%ONAME%* "%INSTALLDIR%\lib" >nul goto :eof @@ -241,65 +248,93 @@ rmdir /s /q "%INSTALLDIR%" >nul 2>&1 goto :eof +:showpath +echo. +echo Now add %INSTALLDIR%\bin to your path, for example with the command: +echo PATH %INSTALLDIR%\bin;%%PATH%% +echo. +goto :eof + + +:runtime +echo. +echo.Making runtime library for -O%MODEL% +cd %BUILDDIR%\%MODEL% +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/runtime/Platform%PLATFORM%.Mod +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/runtime/Heap.Mod +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/runtime/Modules.Mod +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/runtime/Strings.Mod +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/runtime/Out.Mod +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/runtime/In.Mod +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/runtime/VT100.Mod +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/runtime/Files.Mod +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/runtime/Math.Mod +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/runtime/MathL.Mod +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/runtime/Reals.Mod +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/runtime/Texts.Mod +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/runtime/Oberon.Mod +cd %ROOTDIR% +goto :eof :v4 echo. -echo.Making V4 library -cd %BUILDDIR% -%ROOTDIR%\%VISHAP% -Fs ../../src/library/v4/Args.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/v4/Printer.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/v4/Sets.Mod || exit /b +echo.Making V4 library for -O%MODEL% +cd %BUILDDIR%\%MODEL% +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/v4/Args.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/v4/Console.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/v4/Printer.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/v4/Sets.Mod || exit /b cd %ROOTDIR% goto :eof :ooc2 -echo.Making ooc2 library -cd %BUILDDIR% -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc2/ooc2Strings.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc2/ooc2Ascii.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc2/ooc2CharClass.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc2/ooc2ConvTypes.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc2/ooc2IntConv.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc2/ooc2IntStr.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc2/ooc2Real0.Mod || exit /b +echo.Making ooc2 library for -O%MODEL% +cd %BUILDDIR%\%MODEL% +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ooc2/ooc2Strings.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ooc2/ooc2Ascii.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ooc2/ooc2CharClass.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ooc2/ooc2ConvTypes.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ooc2/ooc2IntConv.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ooc2/ooc2IntStr.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ooc2/ooc2Real0.Mod || exit /b cd %ROOTDIR% goto :eof :ooc -echo.Making ooc library -cd %BUILDDIR% -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc/oocLowReal.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc/oocLowLReal.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc/oocRealMath.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc/oocOakMath.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc/oocLRealMath.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc/oocLongInts.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc/oocComplexMath.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc/oocLComplexMath.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc/oocAscii.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc/oocCharClass.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc/oocStrings.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc/oocConvTypes.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc/oocLRealConv.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc/oocLRealStr.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc/oocRealConv.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc/oocRealStr.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc/oocIntConv.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc/oocIntStr.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc/oocMsg.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc/oocSysClock.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc/oocTime.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc/oocChannel.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc/oocStrings2.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc/oocRts.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc/oocFilenames.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc/oocTextRider.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc/oocBinaryRider.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc/oocJulianDay.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc/oocFilenames.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc/oocwrapperlibc.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc/oocC%DATAMODEL%.Mod || exit /b +echo.Making ooc library for -O%MODEL% +cd %BUILDDIR%\%MODEL% +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ooc/oocLowReal.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ooc/oocLowLReal.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ooc/oocRealMath.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ooc/oocOakMath.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ooc/oocLRealMath.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ooc/oocLongInts.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ooc/oocComplexMath.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ooc/oocLComplexMath.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ooc/oocAscii.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ooc/oocCharClass.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ooc/oocStrings.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ooc/oocConvTypes.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ooc/oocLRealConv.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ooc/oocLRealStr.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ooc/oocRealConv.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ooc/oocRealStr.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ooc/oocIntConv.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ooc/oocIntStr.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ooc/oocMsg.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ooc/oocSysClock.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ooc/oocTime.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ooc/oocChannel.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ooc/oocStrings2.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ooc/oocRts.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ooc/oocFilenames.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ooc/oocTextRider.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ooc/oocBinaryRider.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ooc/oocJulianDay.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ooc/oocFilenames.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ooc/oocwrapperlibc.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ooc/oocC%DATAMODEL%.Mod || exit /b cd %ROOTDIR% goto :eof @@ -308,117 +343,138 @@ echo No X11 support on plain Windows - use cygwin and build with cygwin make. goto :eof :ulm -echo.Making ulm library -cd %BUILDDIR% -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmObjects.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmPriorities.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmDisciplines.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmServices.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmSys.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmSYSTEM.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmEvents.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmProcess.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmResources.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmForwarders.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmRelatedEvents.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmTypes.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmStreams.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmStrings.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmSysTypes.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmTexts.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmSysConversions.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmErrors.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmSysErrors.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmSysStat.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmASCII.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmSets.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmIO.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmAssertions.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmIndirectDisciplines.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmStreamDisciplines.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmIEEE.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmMC68881.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmReals.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmPrint.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmWrite.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmConstStrings.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmPlotters.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmSysIO.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmLoader.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmNetIO.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmPersistentObjects.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmPersistentDisciplines.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmOperations.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmScales.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmTimes.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmClocks.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmTimers.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmConditions.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmStreamConditions.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmTimeConditions.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmCiphers.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmCipherOps.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmBlockCiphers.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmAsymmetricCiphers.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmConclusions.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmRandomGenerators.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmTCrypt.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmIntOperations.Mod || exit /b +echo.Making ulm library for -O%MODEL% +cd %BUILDDIR%\%MODEL% +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmObjects.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmPriorities.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmDisciplines.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmServices.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmSys.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmSYSTEM.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmEvents.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmProcess.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmResources.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmForwarders.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmRelatedEvents.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmTypes.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmStreams.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmStrings.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmSysTypes.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmTexts.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmSysConversions.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmErrors.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmSysErrors.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmSysStat.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmASCII.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmSets.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmIO.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmAssertions.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmIndirectDisciplines.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmStreamDisciplines.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmIEEE.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmMC68881.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmReals.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmPrint.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmWrite.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmConstStrings.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmPlotters.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmSysIO.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmLoader.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmNetIO.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmPersistentObjects.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmPersistentDisciplines.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmOperations.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmScales.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmTimes.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmClocks.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmTimers.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmConditions.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmStreamConditions.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmTimeConditions.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmCiphers.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmCipherOps.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmBlockCiphers.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmAsymmetricCiphers.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmConclusions.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmRandomGenerators.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmTCrypt.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmIntOperations.Mod || exit /b cd %ROOTDIR% goto :eof :pow32 -echo.Making pow32 library -cd %BUILDDIR% -%ROOTDIR%\%VISHAP% -Fs ../../src/library/pow/powStrings.Mod || exit /b +echo.Making pow32 library for -O%MODEL% +cd %BUILDDIR%\%MODEL% +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/pow/powStrings.Mod || exit /b cd %ROOTDIR% goto :eof :misc -echo.Making misc library -cd %BUILDDIR% -%ROOTDIR%\%VISHAP% -Fs ../../src/system/Oberon.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/misc/crt.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/misc/Listen.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/misc/MersenneTwister.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/misc/MultiArrays.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/misc/MultiArrayRiders.Mod || exit /b +echo.Making misc library for -O%MODEL% +cd %BUILDDIR%\%MODEL% +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/misc/crt.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/misc/Listen.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/misc/MersenneTwister.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/misc/MultiArrays.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/misc/MultiArrayRiders.Mod || exit /b cd %ROOTDIR% goto :eof :s3 -echo.Making s3 library -cd %BUILDDIR% -%ROOTDIR%\%VISHAP% -Fs ../../src/library/s3/ethBTrees.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/s3/ethMD5.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/s3/ethSets.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/s3/ethZlib.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/s3/ethZlibBuffers.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/s3/ethZlibInflate.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/s3/ethZlibDeflate.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/s3/ethZlibReaders.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/s3/ethZlibWriters.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/s3/ethZip.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/s3/ethRandomNumbers.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/s3/ethGZReaders.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/s3/ethGZWriters.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/s3/ethUnicode.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/s3/ethDates.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/s3/ethReals.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/s3/ethStrings.Mod || exit /b +echo.Making s3 library for -O%MODEL% +cd %BUILDDIR%\%MODEL% +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/s3/ethBTrees.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/s3/ethMD5.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/s3/ethSets.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/s3/ethZlib.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/s3/ethZlibBuffers.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/s3/ethZlibInflate.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/s3/ethZlibDeflate.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/s3/ethZlibReaders.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/s3/ethZlibWriters.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/s3/ethZip.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/s3/ethRandomNumbers.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/s3/ethGZReaders.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/s3/ethGZWriters.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/s3/ethUnicode.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/s3/ethDates.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/s3/ethReals.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/s3/ethStrings.Mod || exit /b cd %ROOTDIR% goto :eof -:librarybinary -echo. -echo.Making lib%ONAME% -:: Remove objects that should not be part of the library -del /q %BUILDDIR%\Vishap.obj -:: Make static library -lib -nologo %BUILDDIR%\*.obj -out:%BUILDDIR%\lib%ONAME%.lib || exit /b +:initlibrary +del /s /q %BUILDDIR%\%MODEL% >nul 2>nul +mkdir %BUILDDIR% >nul 2>nul +mkdir %BUILDDIR%\%MODEL% >nul 2>nul +copy src\runtime\*.c %BUILDDIR%\%MODEL% >nul +copy src\runtime\*.h %BUILDDIR%\%MODEL% >nul +cd %BUILDDIR%\%MODEL% +cl -nologo -c SYSTEM.c +cd %ROOTDIR% +goto :eof + + +:library +SET MODEL=2 +call :initlibrary || exit /b +call :runtime || exit /b +call :v4 || exit /b +call :ooc2 || exit /b +call :ooc || exit /b +call :ulm || exit /b +call :pow32 || exit /b +call :misc || exit /b +call :s3 || exit /b +lib -nologo %BUILDDIR%\%MODEL%\*.obj -out:%BUILDDIR%\%MODEL%\lib%ONAME%-O%MODEL%.lib || exit /b + +SET MODEL=C +call :initlibrary || exit /b +call :runtime || exit /b +lib -nologo %BUILDDIR%\%MODEL%\*.obj -out:%BUILDDIR%\%MODEL%\lib%ONAME%-O%MODEL%.lib || exit /b goto :eof @@ -427,3 +483,4 @@ goto :eof + diff --git a/src/compiler/extTools.Mod b/src/compiler/extTools.Mod index 062e8014..8c84ecae 100644 --- a/src/compiler/extTools.Mod +++ b/src/compiler/extTools.Mod @@ -72,6 +72,7 @@ PROCEDURE LinkMain*(VAR moduleName: ARRAY OF CHAR; statically: BOOLEAN; addition Strings.Append(Configuration.libspec, cmd); Strings.Append('-O', cmd); Strings.Append(OPM.Model, cmd); + Strings.Append(Configuration.libext, cmd); execute("Assemble and link: ", cmd); END LinkMain; diff --git a/src/runtime/SYSTEM.h b/src/runtime/SYSTEM.h index fb88276c..3f3b6133 100644 --- a/src/runtime/SYSTEM.h +++ b/src/runtime/SYSTEM.h @@ -26,6 +26,9 @@ #define _SIZE_T_DEFINED_ // For OpenBSD void *memcpy(void *dest, const void *source, size_t size); +#if defined _WIN32 +#define alloca _alloca +#endif void *alloca(size_t size); diff --git a/src/tools/make/configure.c b/src/tools/make/configure.c index 183d1966..13ea087a 100644 --- a/src/tools/make/configure.c +++ b/src/tools/make/configure.c @@ -54,6 +54,7 @@ char *version = macrotostring(O_VER); char *objext = ".o"; char *objflag = " -o "; char *linkflags = " -L\""; +char *libext = ""; char *oname = NULL; // From O_NAME env var if present, or O_NAME macro otherwise. @@ -154,7 +155,8 @@ void determineCCompiler() { objext = ".obj"; objflag = " -Fe"; linkflags = " -link -libpath:\""; - snprintf(libspec, sizeof(libspec), " lib%s.lib", oname); + snprintf(libspec, sizeof(libspec), " lib%s", oname); + libext = ".lib"; #else fail("Unrecognised C compiler."); #endif @@ -412,6 +414,7 @@ void writeConfigurationMod() { fprintf(fd, " objflag* = '%s';\n", objflag); fprintf(fd, " linkflags* = '%s';\n", linkflags); fprintf(fd, " libspec* = '%s';\n", libspec); + fprintf(fd, " libext* = '%s';\n", libext); fprintf(fd, " compile* = '%s';\n", cc); fprintf(fd, " installdir* = '%s';\n", installdir); fprintf(fd, " staticLink* = '%s';\n", staticlink); diff --git a/src/tools/make/oberon.mk b/src/tools/make/oberon.mk index c67dfe10..e5fde295 100644 --- a/src/tools/make/oberon.mk +++ b/src/tools/make/oberon.mk @@ -254,6 +254,7 @@ ooc: cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocTextRider.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocBinaryRider.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocJulianDay.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocFilenames.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocwrapperlibc.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocC$(DATAMODEL).Mod From 1d6c7889b10a1c3681e718f4c2eb0eba013a7a19 Mon Sep 17 00:00:00 2001 From: David Brown Date: Tue, 8 Nov 2016 20:18:14 +0000 Subject: [PATCH 308/580] Use _alloca /only/ on MSC, not on mingw. Elsewhere it is alloca. --- src/runtime/SYSTEM.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runtime/SYSTEM.h b/src/runtime/SYSTEM.h index 3f3b6133..d9778393 100644 --- a/src/runtime/SYSTEM.h +++ b/src/runtime/SYSTEM.h @@ -26,7 +26,7 @@ #define _SIZE_T_DEFINED_ // For OpenBSD void *memcpy(void *dest, const void *source, size_t size); -#if defined _WIN32 +#if defined _MSC_VER #define alloca _alloca #endif void *alloca(size_t size); From c2e97de49586c993498ebd5883d37a98917a9097 Mon Sep 17 00:00:00 2001 From: David Brown Date: Tue, 8 Nov 2016 20:42:36 +0000 Subject: [PATCH 309/580] Update bootstrap. --- bootstrap/SYSTEM.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bootstrap/SYSTEM.h b/bootstrap/SYSTEM.h index 3f3b6133..d9778393 100644 --- a/bootstrap/SYSTEM.h +++ b/bootstrap/SYSTEM.h @@ -26,7 +26,7 @@ #define _SIZE_T_DEFINED_ // For OpenBSD void *memcpy(void *dest, const void *source, size_t size); -#if defined _WIN32 +#if defined _MSC_VER #define alloca _alloca #endif void *alloca(size_t size); From c93705920e0452e7024bde6e774ef112c13bca9f Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 10 Nov 2016 11:22:23 +0000 Subject: [PATCH 310/580] Remove redundant sync that causes error on windows. Update console for Windows cr/lf. --- src/library/v4/Console.Mod | 9 +++++++-- src/runtime/Files.Mod | 5 ++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/library/v4/Console.Mod b/src/library/v4/Console.Mod index 6b35a090..070ba46b 100644 --- a/src/library/v4/Console.Mod +++ b/src/library/v4/Console.Mod @@ -46,7 +46,7 @@ MODULE Console; (* J. Templ, 29-June-96 *) END Int; PROCEDURE Ln*; - BEGIN Char(0AX); (* Unix end-of-line *) + BEGIN String(Platform.NL); END Ln; PROCEDURE Bool*(b: BOOLEAN); @@ -75,7 +75,12 @@ MODULE Console; (* J. Templ, 29-June-96 *) VAR i: LONGINT; ch: CHAR; BEGIN Flush(); i := 0; Read(ch); - WHILE (i < LEN(line) - 1) & (ch # 0AX) & (ch # 0X) DO line[i] := ch; INC(i); Read(ch) END ; + WHILE (i < LEN(line) - 1) + & (ch # 0AX) + & (ch # 0X) DO + line[i] := ch; INC(i); Read(ch) + END; + IF (i > 0) & (line[i-1] = 0DX) THEN DEC(i) END; (* Swallow CR before LF *) line[i] := 0X END ReadLine; diff --git a/src/runtime/Files.Mod b/src/runtime/Files.Mod index 1daefc0b..40307644 100644 --- a/src/runtime/Files.Mod +++ b/src/runtime/Files.Mod @@ -215,8 +215,11 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files IF (f.state # create) OR (f.registerName # "") THEN Create(f); i := 0; WHILE (i < nofbufs) & (f.bufs[i] # NIL) DO Flush(f.bufs[i]); INC(i) END; + (* There's no reason to sync this file - we're about to close it. The OS + will sync if necessary. Further, sync will fail for a R/O file on Windows. error := Platform.Sync(f.fd); - IF error # 0 THEN Err("error writing file", f, error) END; + IF error # 0 THEN Err("error syncing file", f, error) END; + *) CloseOSFile(f); END END Close; From 45d3daa11edcf69da9c01558f5e6e38cfa58677c Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 10 Nov 2016 11:56:35 +0000 Subject: [PATCH 311/580] Windows: enable VT100 support and use SYSTEM.ADDRESS for FileHandle. --- src/runtime/Platformwindows.Mod | 64 +++++++++++++++++++-------------- 1 file changed, 37 insertions(+), 27 deletions(-) diff --git a/src/runtime/Platformwindows.Mod b/src/runtime/Platformwindows.Mod index 1ef34d49..9bf36594 100644 --- a/src/runtime/Platformwindows.Mod +++ b/src/runtime/Platformwindows.Mod @@ -12,7 +12,7 @@ TYPE SignalHandler = PROCEDURE(signal: SYSTEM.INT32); ErrorCode* = INTEGER; - FileHandle* = LONGINT; + FileHandle* = SYSTEM.ADDRESS; FileIdentity* = RECORD volume: LONGINT; (* dev on Unix filesystems, volume serial number on NTFS *) @@ -297,16 +297,16 @@ PROCEDURE Error*(): ErrorCode; BEGIN RETURN err() END Error; (* File system *) -PROCEDURE -invalidHandleValue(): LONGINT "((LONGINT)(ADDRESS)INVALID_HANDLE_VALUE)"; +PROCEDURE -invalidHandleValue(): SYSTEM.ADDRESS "((ADDRESS)INVALID_HANDLE_VALUE)"; -PROCEDURE -openrw (n: ARRAY OF CHAR): LONGINT -"(LONGINT)(ADDRESS)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0)"; +PROCEDURE -openrw (n: ARRAY OF CHAR): FileHandle +"(ADDRESS)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0)"; -PROCEDURE -openro (n: ARRAY OF CHAR): LONGINT -"(LONGINT)(ADDRESS)CreateFile((char*)n, GENERIC_READ , FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0)"; +PROCEDURE -openro (n: ARRAY OF CHAR): FileHandle +"(ADDRESS)CreateFile((char*)n, GENERIC_READ , FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0)"; -PROCEDURE -opennew(n: ARRAY OF CHAR): LONGINT -"(LONGINT)(ADDRESS)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0)"; +PROCEDURE -opennew(n: ARRAY OF CHAR): FileHandle +"(ADDRESS)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0)"; @@ -314,21 +314,21 @@ PROCEDURE -opennew(n: ARRAY OF CHAR): LONGINT (* File APIs *) PROCEDURE OldRO*(VAR n: ARRAY OF CHAR; VAR h: FileHandle): ErrorCode; -VAR fd: LONGINT; +VAR fd: FileHandle; BEGIN fd := openro(n); IF (fd = invalidHandleValue()) THEN RETURN err() ELSE h := fd; RETURN 0 END; END OldRO; PROCEDURE OldRW*(VAR n: ARRAY OF CHAR; VAR h: FileHandle): ErrorCode; -VAR fd: LONGINT; +VAR fd: FileHandle; BEGIN fd := openrw(n); IF (fd = invalidHandleValue()) THEN RETURN err() ELSE h := fd; RETURN 0 END; END OldRW; PROCEDURE New*(VAR n: ARRAY OF CHAR; VAR h: FileHandle): ErrorCode; -VAR fd: LONGINT; +VAR fd: FileHandle; BEGIN fd := opennew(n); IF (fd = invalidHandleValue()) THEN RETURN err() ELSE h := fd; RETURN 0 END; @@ -336,7 +336,7 @@ END New; -PROCEDURE -closeHandle(h: FileHandle): INTEGER "(INTEGER)CloseHandle((HANDLE)(ADDRESS)h)"; +PROCEDURE -closeHandle(h: FileHandle): INTEGER "(INTEGER)CloseHandle((HANDLE)h)"; PROCEDURE Close*(h: FileHandle): ErrorCode; BEGIN @@ -346,7 +346,7 @@ END Close; PROCEDURE -byHandleFileInformation "BY_HANDLE_FILE_INFORMATION bhfi"; -PROCEDURE -getFileInformationByHandle(h: FileHandle): INTEGER "(INTEGER)GetFileInformationByHandle((HANDLE)(ADDRESS)h, &bhfi)"; +PROCEDURE -getFileInformationByHandle(h: FileHandle): INTEGER "(INTEGER)GetFileInformationByHandle((HANDLE)h, &bhfi)"; PROCEDURE -bhfiMtimeHigh(): LONGINT "(LONGINT)bhfi.ftLastWriteTime.dwHighDateTime"; PROCEDURE -bhfiMtimeLow(): LONGINT "(LONGINT)bhfi.ftLastWriteTime.dwLowDateTime"; PROCEDURE -bhfiVsn(): LONGINT "(LONGINT)bhfi.dwVolumeSerialNumber"; @@ -405,7 +405,7 @@ END MTimeAsClock; PROCEDURE -largeInteger "LARGE_INTEGER li"; PROCEDURE -liLongint(): LONGINT "(LONGINT)li.QuadPart"; -PROCEDURE -getFileSize(h: FileHandle): INTEGER "(INTEGER)GetFileSizeEx((HANDLE)(ADDRESS)h, &li)"; +PROCEDURE -getFileSize(h: FileHandle): INTEGER "(INTEGER)GetFileSizeEx((HANDLE)h, &li)"; PROCEDURE Size*(h: FileHandle; VAR l: LONGINT): ErrorCode; BEGIN @@ -416,8 +416,8 @@ BEGIN END Size; -PROCEDURE -readfile (fd: LONGINT; p: SYSTEM.ADDRESS; l: LONGINT; VAR n: SYSTEM.INT32): INTEGER -"(INTEGER)ReadFile((HANDLE)(ADDRESS)fd, (void*)p, (DWORD)l, (DWORD*)n, 0)"; +PROCEDURE -readfile (fd: FileHandle; p: SYSTEM.ADDRESS; l: LONGINT; VAR n: SYSTEM.INT32): INTEGER +"(INTEGER)ReadFile((HANDLE)fd, (void*)p, (DWORD)l, (DWORD*)n, 0)"; PROCEDURE Read*(h: FileHandle; p: SYSTEM.ADDRESS; l: LONGINT; VAR n: LONGINT): ErrorCode; VAR result: INTEGER; lengthread: SYSTEM.INT32; @@ -435,8 +435,8 @@ END ReadBuf; -PROCEDURE -writefile(fd: LONGINT; p: SYSTEM.ADDRESS; l: LONGINT): INTEGER -"(INTEGER)WriteFile((HANDLE)(ADDRESS)fd, (void*)(p), (DWORD)l, 0,0)"; +PROCEDURE -writefile(fd: FileHandle; p: SYSTEM.ADDRESS; l: LONGINT): INTEGER +"(INTEGER)WriteFile((HANDLE)fd, (void*)(p), (DWORD)l, 0,0)"; PROCEDURE Write*(h: FileHandle; p: SYSTEM.ADDRESS; l: LONGINT): ErrorCode; BEGIN @@ -445,7 +445,7 @@ END Write; -PROCEDURE -flushFileBuffers(h: FileHandle): INTEGER "(INTEGER)FlushFileBuffers((HANDLE)(ADDRESS)h)"; +PROCEDURE -flushFileBuffers(h: FileHandle): INTEGER "(INTEGER)FlushFileBuffers((HANDLE)h)"; PROCEDURE Sync*(h: FileHandle): ErrorCode; BEGIN @@ -455,7 +455,7 @@ END Sync; PROCEDURE -setFilePointerEx(h: FileHandle; o: LONGINT; r: INTEGER; VAR rc: INTEGER) -"li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((HANDLE)(ADDRESS)h, li, 0, (DWORD)r)"; +"li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((HANDLE)h, li, 0, (DWORD)r)"; PROCEDURE -seekset(): INTEGER "FILE_BEGIN"; PROCEDURE -seekcur(): INTEGER "FILE_CURRENT"; @@ -471,9 +471,9 @@ END Seek; -PROCEDURE -setEndOfFile(h: FileHandle): INTEGER "(INTEGER)SetEndOfFile((HANDLE)(ADDRESS)h)"; +PROCEDURE -setEndOfFile(h: FileHandle): INTEGER "(INTEGER)SetEndOfFile((HANDLE)h)"; PROCEDURE -getFilePos(h: FileHandle; VAR r: LONGINT; VAR rc: INTEGER) -"LARGE_INTEGER liz = {0}; *rc = (INTEGER)SetFilePointerEx((HANDLE)(ADDRESS)h, liz, &li, FILE_CURRENT); *r = (LONGINT)li.QuadPart"; +"LARGE_INTEGER liz = {0}; *rc = (INTEGER)SetFilePointerEx((HANDLE)h, liz, &li, FILE_CURRENT); *r = (LONGINT)li.QuadPart"; PROCEDURE Truncate*(h: FileHandle; limit: LONGINT): ErrorCode; VAR rc: INTEGER; oldpos: LONGINT; @@ -531,8 +531,8 @@ PROCEDURE Exit*(code: INTEGER); BEGIN exit(code) END Exit; -PROCEDURE -errstring(s: ARRAY OF CHAR) 'WriteFile((HANDLE)(ADDRESS)Platform_StdOut, s, s__len-1, 0,0)'; -PROCEDURE -errc (c: CHAR) 'WriteFile((HANDLE)(ADDRESS)Platform_StdOut, &c, 1, 0,0)'; +PROCEDURE -errstring(s: ARRAY OF CHAR) 'WriteFile((HANDLE)Platform_StdOut, s, s__len-1, 0,0)'; +PROCEDURE -errc (c: CHAR) 'WriteFile((HANDLE)Platform_StdOut, &c, 1, 0,0)'; PROCEDURE errch(c: CHAR); BEGIN errc(c) END errch; PROCEDURE errln; BEGIN errch(0DX); errch(0AX) END errln; @@ -587,6 +587,14 @@ PROCEDURE SetHalt*(p: HaltProcedure); BEGIN HaltHandler := p; END SetHalt; +PROCEDURE -GetConsoleMode(h: FileHandle; VAR m: SYSTEM.INT32): BOOLEAN "GetConsoleMode((HANDLE)h, m)"; +PROCEDURE -SetConsoleMode(h: FileHandle; m: SYSTEM.INT32) "SetConsoleMode((HANDLE)h, m)"; +PROCEDURE -VTprocessing(): SYSTEM.INT32 "ENABLE_VIRTUAL_TERMINAL_PROCESSING"; + +PROCEDURE EnableVT100; +VAR mode: SYSTEM.INT32; +BEGIN IF GetConsoleMode(StdOut, mode) THEN SetConsoleMode(StdOut, mode+VTprocessing()) END +END EnableVT100; PROCEDURE TestLittleEndian; @@ -594,9 +602,9 @@ PROCEDURE TestLittleEndian; BEGIN i := 1; SYSTEM.GET(SYSTEM.ADR(i), LittleEndian); END TestLittleEndian; -PROCEDURE -getstdinhandle(): FileHandle "(LONGINT)(ADDRESS)GetStdHandle(STD_INPUT_HANDLE)"; -PROCEDURE -getstdouthandle(): FileHandle "(LONGINT)(ADDRESS)GetStdHandle(STD_OUTPUT_HANDLE)"; -PROCEDURE -getstderrhandle(): FileHandle "(LONGINT)(ADDRESS)GetStdHandle(STD_ERROR_HANDLE)"; +PROCEDURE -getstdinhandle(): FileHandle "(ADDRESS)GetStdHandle(STD_INPUT_HANDLE)"; +PROCEDURE -getstdouthandle(): FileHandle "(ADDRESS)GetStdHandle(STD_OUTPUT_HANDLE)"; +PROCEDURE -getstderrhandle(): FileHandle "(ADDRESS)GetStdHandle(STD_ERROR_HANDLE)"; PROCEDURE -getpid(): INTEGER "(INTEGER)GetCurrentProcessId()"; BEGIN @@ -616,6 +624,8 @@ BEGIN StdOut := getstdouthandle(); StdErr := getstderrhandle(); + EnableVT100; + NL[0] := 0DX; (* CR *) NL[1] := 0AX; (* LF *) NL[2] := 0X; From 2cd28725ea8eb987a306bef21b0917debf96bb3a Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 10 Nov 2016 11:57:59 +0000 Subject: [PATCH 312/580] Update bootstrap --- bootstrap/unix-44/Compiler.c | 2 +- bootstrap/unix-44/Configuration.c | 4 +- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Files.c | 6 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 2 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 2 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 2 +- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 2 +- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 2 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Out.c | 2 +- bootstrap/unix-44/Out.h | 2 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/VT100.c | 2 +- bootstrap/unix-44/VT100.h | 2 +- bootstrap/unix-44/errors.c | 2 +- bootstrap/unix-44/errors.h | 2 +- bootstrap/unix-44/extTools.c | 2 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-48/Compiler.c | 2 +- bootstrap/unix-48/Configuration.c | 4 +- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Files.c | 6 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 2 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 2 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 2 +- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 2 +- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 2 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Out.c | 2 +- bootstrap/unix-48/Out.h | 2 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/VT100.c | 2 +- bootstrap/unix-48/VT100.h | 2 +- bootstrap/unix-48/errors.c | 2 +- bootstrap/unix-48/errors.h | 2 +- bootstrap/unix-48/extTools.c | 2 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-88/Compiler.c | 2 +- bootstrap/unix-88/Configuration.c | 4 +- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Files.c | 6 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 2 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 2 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 2 +- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 2 +- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 2 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Out.c | 2 +- bootstrap/unix-88/Out.h | 2 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/VT100.c | 2 +- bootstrap/unix-88/VT100.h | 2 +- bootstrap/unix-88/errors.c | 2 +- bootstrap/unix-88/errors.h | 2 +- bootstrap/unix-88/extTools.c | 2 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/windows-48/Compiler.c | 2 +- bootstrap/windows-48/Configuration.c | 4 +- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Files.c | 6 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 2 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 2 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 2 +- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 2 +- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 2 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Out.c | 2 +- bootstrap/windows-48/Out.h | 2 +- bootstrap/windows-48/Platform.c | 51 ++++++++----- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/VT100.c | 2 +- bootstrap/windows-48/VT100.h | 2 +- bootstrap/windows-48/errors.c | 2 +- bootstrap/windows-48/errors.h | 2 +- bootstrap/windows-48/extTools.c | 2 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-88/Compiler.c | 2 +- bootstrap/windows-88/Configuration.c | 4 +- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Files.c | 14 ++-- bootstrap/windows-88/Files.h | 9 +-- bootstrap/windows-88/Heap.c | 2 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 2 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 2 +- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 2 +- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 2 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Out.c | 2 +- bootstrap/windows-88/Out.h | 2 +- bootstrap/windows-88/Platform.c | 109 +++++++++++++++------------ bootstrap/windows-88/Platform.h | 28 +++---- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/VT100.c | 2 +- bootstrap/windows-88/VT100.h | 2 +- bootstrap/windows-88/errors.c | 2 +- bootstrap/windows-88/errors.h | 2 +- bootstrap/windows-88/extTools.c | 2 +- bootstrap/windows-88/extTools.h | 2 +- 195 files changed, 312 insertions(+), 305 deletions(-) diff --git a/bootstrap/unix-44/Compiler.c b/bootstrap/unix-44/Compiler.c index 86c4c1fd..5635eb49 100644 --- a/bootstrap/unix-44/Compiler.c +++ b/bootstrap/unix-44/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index 3f8c68d8..88e7a4c9 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index 6abf2414..20f55dce 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index fc49744a..b6483b0d 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -307,10 +307,6 @@ void Files_Close (Files_File f) Files_Flush(f->bufs[i]); i += 1; } - error = Platform_Sync(f->fd); - if (error != 0) { - Files_Err((CHAR*)"error writing file", 19, f, error); - } Files_CloseOSFile(f); } } diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index 93b5757c..1b94c84f 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index e8c720bb..8ab8db36 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index dbc3fcd7..a7926fd5 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index d8293ed7..20b68450 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index c2afbd3c..de306cf5 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index 4b7fe51c..d272b474 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index bc644f4c..880670eb 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 19167eeb..1dba2168 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index f7fc51f9..a6816fe2 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 9b4663f5..2f163525 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index 42866571..d828881d 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index 45f4db77..a8a90bfc 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index cb3aabc8..806302cb 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index 5d7b776f..6cb1973e 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index 01ffbd17..04a8a785 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index 37631f98..49df34bf 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index 66f25d3d..b01bfedc 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index f40a6104..c90bb72a 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index 513d8dfa..ae75cd60 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Out.c b/bootstrap/unix-44/Out.c index c435c944..27e1fa94 100644 --- a/bootstrap/unix-44/Out.c +++ b/bootstrap/unix-44/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Out.h b/bootstrap/unix-44/Out.h index a685b291..79895677 100644 --- a/bootstrap/unix-44/Out.h +++ b/bootstrap/unix-44/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 343fb141..c90c4c43 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index ff45e732..bff09b6b 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 432ce603..37ba21bb 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index 07688e3c..94d22e76 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index 141a9976..17fe28a6 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index 4319e8c8..6d2e8625 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index 92b17de0..7891a3ab 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index 19f2a2f5..b8f6a762 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/VT100.c b/bootstrap/unix-44/VT100.c index b5067d33..6a492f2a 100644 --- a/bootstrap/unix-44/VT100.c +++ b/bootstrap/unix-44/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/VT100.h b/bootstrap/unix-44/VT100.h index d9aa6ab7..54e1e753 100644 --- a/bootstrap/unix-44/VT100.h +++ b/bootstrap/unix-44/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-44/errors.c b/bootstrap/unix-44/errors.c index 2a1a7a02..651501a0 100644 --- a/bootstrap/unix-44/errors.c +++ b/bootstrap/unix-44/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/errors.h b/bootstrap/unix-44/errors.h index 5555899e..bd6765aa 100644 --- a/bootstrap/unix-44/errors.h +++ b/bootstrap/unix-44/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index aa59dd88..23b737c3 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index ad76f7b6..124b2154 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/Compiler.c b/bootstrap/unix-48/Compiler.c index 86c4c1fd..5635eb49 100644 --- a/bootstrap/unix-48/Compiler.c +++ b/bootstrap/unix-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index 3f8c68d8..88e7a4c9 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index 6abf2414..20f55dce 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index fc49744a..b6483b0d 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -307,10 +307,6 @@ void Files_Close (Files_File f) Files_Flush(f->bufs[i]); i += 1; } - error = Platform_Sync(f->fd); - if (error != 0) { - Files_Err((CHAR*)"error writing file", 19, f, error); - } Files_CloseOSFile(f); } } diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index 93b5757c..1b94c84f 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index e8c720bb..8ab8db36 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index dbc3fcd7..a7926fd5 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index d8293ed7..20b68450 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index c2afbd3c..de306cf5 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index 4b7fe51c..d272b474 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index bc644f4c..880670eb 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 19167eeb..1dba2168 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index f7fc51f9..a6816fe2 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 9b4663f5..2f163525 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index 42866571..d828881d 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index 45f4db77..a8a90bfc 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index cb3aabc8..806302cb 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index 5d7b776f..6cb1973e 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index 01ffbd17..04a8a785 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 3340bb93..8d2305be 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index 66f25d3d..b01bfedc 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index f40a6104..c90bb72a 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index 513d8dfa..ae75cd60 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Out.c b/bootstrap/unix-48/Out.c index c435c944..27e1fa94 100644 --- a/bootstrap/unix-48/Out.c +++ b/bootstrap/unix-48/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Out.h b/bootstrap/unix-48/Out.h index a685b291..79895677 100644 --- a/bootstrap/unix-48/Out.h +++ b/bootstrap/unix-48/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 343fb141..c90c4c43 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index ff45e732..bff09b6b 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 432ce603..37ba21bb 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index 07688e3c..94d22e76 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index 141a9976..17fe28a6 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index 4319e8c8..6d2e8625 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index ac0a3850..abf1736a 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index f2c8d90e..dd1e65e5 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/VT100.c b/bootstrap/unix-48/VT100.c index b5067d33..6a492f2a 100644 --- a/bootstrap/unix-48/VT100.c +++ b/bootstrap/unix-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/VT100.h b/bootstrap/unix-48/VT100.h index d9aa6ab7..54e1e753 100644 --- a/bootstrap/unix-48/VT100.h +++ b/bootstrap/unix-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-48/errors.c b/bootstrap/unix-48/errors.c index 2a1a7a02..651501a0 100644 --- a/bootstrap/unix-48/errors.c +++ b/bootstrap/unix-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/errors.h b/bootstrap/unix-48/errors.h index 5555899e..bd6765aa 100644 --- a/bootstrap/unix-48/errors.h +++ b/bootstrap/unix-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index aa59dd88..23b737c3 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index ad76f7b6..124b2154 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/Compiler.c b/bootstrap/unix-88/Compiler.c index 86c4c1fd..5635eb49 100644 --- a/bootstrap/unix-88/Compiler.c +++ b/bootstrap/unix-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index 3f8c68d8..88e7a4c9 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index 6abf2414..20f55dce 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 2572b5cd..53e757cf 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -307,10 +307,6 @@ void Files_Close (Files_File f) Files_Flush(f->bufs[i]); i += 1; } - error = Platform_Sync(f->fd); - if (error != 0) { - Files_Err((CHAR*)"error writing file", 19, f, error); - } Files_CloseOSFile(f); } } diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 47c54d97..7c86bc8b 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index efbba685..65151d07 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index 0b6a9d03..d37b81db 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 39e2d6ca..56f6f73e 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index c2afbd3c..de306cf5 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index 4b7fe51c..d272b474 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index bc644f4c..880670eb 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index 19167eeb..1dba2168 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index f7fc51f9..a6816fe2 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index d343241b..6cd0dab4 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index 42866571..d828881d 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index 3eabde0b..4a47eb31 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index cb3aabc8..806302cb 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index 5d7b776f..6cb1973e 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index 01ffbd17..04a8a785 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index e1405ce9..51464c2f 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 66f25d3d..b01bfedc 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index ac2e6fba..4eaacd0b 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index 513d8dfa..ae75cd60 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Out.c b/bootstrap/unix-88/Out.c index c435c944..27e1fa94 100644 --- a/bootstrap/unix-88/Out.c +++ b/bootstrap/unix-88/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Out.h b/bootstrap/unix-88/Out.h index a685b291..79895677 100644 --- a/bootstrap/unix-88/Out.h +++ b/bootstrap/unix-88/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index c75a6d63..9682a16f 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index 2da07523..84628711 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 432ce603..37ba21bb 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index 07688e3c..94d22e76 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index 141a9976..17fe28a6 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index 4319e8c8..6d2e8625 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index 3b932ce7..38bcde69 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index bff9cc72..6ef483f3 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/VT100.c b/bootstrap/unix-88/VT100.c index b5067d33..6a492f2a 100644 --- a/bootstrap/unix-88/VT100.c +++ b/bootstrap/unix-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/VT100.h b/bootstrap/unix-88/VT100.h index d9aa6ab7..54e1e753 100644 --- a/bootstrap/unix-88/VT100.h +++ b/bootstrap/unix-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-88/errors.c b/bootstrap/unix-88/errors.c index 2a1a7a02..651501a0 100644 --- a/bootstrap/unix-88/errors.c +++ b/bootstrap/unix-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/errors.h b/bootstrap/unix-88/errors.h index 5555899e..bd6765aa 100644 --- a/bootstrap/unix-88/errors.h +++ b/bootstrap/unix-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index aa59dd88..23b737c3 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index ad76f7b6..124b2154 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/Compiler.c b/bootstrap/windows-48/Compiler.c index 86c4c1fd..5635eb49 100644 --- a/bootstrap/windows-48/Compiler.c +++ b/bootstrap/windows-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index 3f8c68d8..88e7a4c9 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index 6abf2414..20f55dce 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 5f08fc35..8f9d4784 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -307,10 +307,6 @@ void Files_Close (Files_File f) Files_Flush(f->bufs[i]); i += 1; } - error = Platform_Sync(f->fd); - if (error != 0) { - Files_Err((CHAR*)"error writing file", 19, f, error); - } Files_CloseOSFile(f); } } diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index a0965363..c939154b 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index e8c720bb..8ab8db36 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index dbc3fcd7..a7926fd5 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index d8293ed7..20b68450 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index c2afbd3c..de306cf5 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index 4b7fe51c..d272b474 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index bc644f4c..880670eb 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 19167eeb..1dba2168 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index f7fc51f9..a6816fe2 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 9b4663f5..2f163525 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index 42866571..d828881d 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index 45f4db77..a8a90bfc 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index cb3aabc8..806302cb 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index 5d7b776f..6cb1973e 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index 01ffbd17..04a8a785 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 3340bb93..8d2305be 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index 66f25d3d..b01bfedc 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index f40a6104..c90bb72a 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index 513d8dfa..ae75cd60 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Out.c b/bootstrap/windows-48/Out.c index ea8636f2..bad87929 100644 --- a/bootstrap/windows-48/Out.c +++ b/bootstrap/windows-48/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Out.h b/bootstrap/windows-48/Out.h index a685b291..79895677 100644 --- a/bootstrap/windows-48/Out.h +++ b/bootstrap/windows-48/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index baa90502..7b5d8c73 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -56,6 +56,7 @@ export BOOLEAN Platform_ConnectionFailed (INT16 e); export void Platform_Delay (INT32 ms); export BOOLEAN Platform_DifferentFilesystems (INT16 e); static void Platform_DisplayHaltCode (INT32 code); +static void Platform_EnableVT100 (void); export INT16 Platform_Error (void); export void Platform_Exit (INT16 code); export void Platform_GetArg (INT16 n, CHAR *val, LONGINT val__len); @@ -118,10 +119,13 @@ export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT #define Platform_ERRORWRITEPROTECT() ERROR_WRITE_PROTECT #define Platform_ETIMEDOUT() WSAETIMEDOUT extern void Heap_InitHeap(); +#define Platform_GetConsoleMode(h, m) GetConsoleMode((HANDLE)h, m) #define Platform_GetTickCount() (LONGINT)(UINT32)GetTickCount() #define Platform_HeapInitHeap() Heap_InitHeap() +#define Platform_SetConsoleMode(h, m) SetConsoleMode((HANDLE)h, m) #define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((ADDRESS)h) #define Platform_SetQuitHandler(h) SystemSetQuitHandler((ADDRESS)h) +#define Platform_VTprocessing() ENABLE_VIRTUAL_TERMINAL_PROCESSING #define Platform_allocate(size) (ADDRESS)((void*)HeapAlloc(GetProcessHeap(), 0, (size_t)size)) #define Platform_bhfiIndexHigh() (LONGINT)bhfi.nFileIndexHigh #define Platform_bhfiIndexLow() (LONGINT)bhfi.nFileIndexLow @@ -130,44 +134,44 @@ extern void Heap_InitHeap(); #define Platform_bhfiVsn() (LONGINT)bhfi.dwVolumeSerialNumber #define Platform_byHandleFileInformation() BY_HANDLE_FILE_INFORMATION bhfi #define Platform_cleanupProcess() CloseHandle(pi.hProcess); CloseHandle(pi.hThread); -#define Platform_closeHandle(h) (INTEGER)CloseHandle((HANDLE)(ADDRESS)h) +#define Platform_closeHandle(h) (INTEGER)CloseHandle((HANDLE)h) #define Platform_createProcess(str, str__len) (INTEGER)CreateProcess(0, (char*)str, 0,0,0,0,0,0,&si,&pi) #define Platform_deleteFile(n, n__len) (INTEGER)DeleteFile((char*)n) #define Platform_err() (INTEGER)GetLastError() -#define Platform_errc(c) WriteFile((HANDLE)(ADDRESS)Platform_StdOut, &c, 1, 0,0) -#define Platform_errstring(s, s__len) WriteFile((HANDLE)(ADDRESS)Platform_StdOut, s, s__len-1, 0,0) +#define Platform_errc(c) WriteFile((HANDLE)Platform_StdOut, &c, 1, 0,0) +#define Platform_errstring(s, s__len) WriteFile((HANDLE)Platform_StdOut, s, s__len-1, 0,0) #define Platform_exit(code) ExitProcess((UINT)code) #define Platform_fileTimeToSysTime() SYSTEMTIME st; FileTimeToSystemTime(&ft, &st) -#define Platform_flushFileBuffers(h) (INTEGER)FlushFileBuffers((HANDLE)(ADDRESS)h) +#define Platform_flushFileBuffers(h) (INTEGER)FlushFileBuffers((HANDLE)h) #define Platform_free(address) HeapFree(GetProcessHeap(), 0, (void*)address) #define Platform_ftToUli() ULARGE_INTEGER ul; ul.LowPart=ft.dwLowDateTime; ul.HighPart=ft.dwHighDateTime #define Platform_getCurrentDirectory(n, n__len) GetCurrentDirectory(n__len, (char*)n) #define Platform_getExitCodeProcess(exitcode) GetExitCodeProcess(pi.hProcess, (DWORD*)exitcode); -#define Platform_getFileInformationByHandle(h) (INTEGER)GetFileInformationByHandle((HANDLE)(ADDRESS)h, &bhfi) -#define Platform_getFilePos(h, r, rc) LARGE_INTEGER liz = {0}; *rc = (INTEGER)SetFilePointerEx((HANDLE)(ADDRESS)h, liz, &li, FILE_CURRENT); *r = (LONGINT)li.QuadPart -#define Platform_getFileSize(h) (INTEGER)GetFileSizeEx((HANDLE)(ADDRESS)h, &li) +#define Platform_getFileInformationByHandle(h) (INTEGER)GetFileInformationByHandle((HANDLE)h, &bhfi) +#define Platform_getFilePos(h, r, rc) LARGE_INTEGER liz = {0}; *rc = (INTEGER)SetFilePointerEx((HANDLE)h, liz, &li, FILE_CURRENT); *r = (LONGINT)li.QuadPart +#define Platform_getFileSize(h) (INTEGER)GetFileSizeEx((HANDLE)h, &li) #define Platform_getLocalTime() SYSTEMTIME st; GetLocalTime(&st) #define Platform_getenv(name, name__len, buf, buf__len) (INTEGER)GetEnvironmentVariable((char*)name, (char*)buf, buf__len) #define Platform_getpid() (INTEGER)GetCurrentProcessId() -#define Platform_getstderrhandle() (LONGINT)(ADDRESS)GetStdHandle(STD_ERROR_HANDLE) -#define Platform_getstdinhandle() (LONGINT)(ADDRESS)GetStdHandle(STD_INPUT_HANDLE) -#define Platform_getstdouthandle() (LONGINT)(ADDRESS)GetStdHandle(STD_OUTPUT_HANDLE) +#define Platform_getstderrhandle() (ADDRESS)GetStdHandle(STD_ERROR_HANDLE) +#define Platform_getstdinhandle() (ADDRESS)GetStdHandle(STD_INPUT_HANDLE) +#define Platform_getstdouthandle() (ADDRESS)GetStdHandle(STD_OUTPUT_HANDLE) #define Platform_identityToFileTime(i) FILETIME ft; ft.dwHighDateTime = i.mtimehigh; ft.dwLowDateTime = i.mtimelow -#define Platform_invalidHandleValue() ((LONGINT)(ADDRESS)INVALID_HANDLE_VALUE) +#define Platform_invalidHandleValue() ((ADDRESS)INVALID_HANDLE_VALUE) #define Platform_largeInteger() LARGE_INTEGER li #define Platform_liLongint() (LONGINT)li.QuadPart #define Platform_moveFile(o, o__len, n, n__len) (INTEGER)MoveFileEx((char*)o, (char*)n, MOVEFILE_REPLACE_EXISTING) -#define Platform_opennew(n, n__len) (LONGINT)(ADDRESS)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0) -#define Platform_openro(n, n__len) (LONGINT)(ADDRESS)CreateFile((char*)n, GENERIC_READ , FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) -#define Platform_openrw(n, n__len) (LONGINT)(ADDRESS)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) +#define Platform_opennew(n, n__len) (ADDRESS)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0) +#define Platform_openro(n, n__len) (ADDRESS)CreateFile((char*)n, GENERIC_READ , FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) +#define Platform_openrw(n, n__len) (ADDRESS)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) #define Platform_processInfo() PROCESS_INFORMATION pi = {0}; -#define Platform_readfile(fd, p, l, n) (INTEGER)ReadFile((HANDLE)(ADDRESS)fd, (void*)p, (DWORD)l, (DWORD*)n, 0) +#define Platform_readfile(fd, p, l, n) (INTEGER)ReadFile((HANDLE)fd, (void*)p, (DWORD)l, (DWORD*)n, 0) #define Platform_seekcur() FILE_CURRENT #define Platform_seekend() FILE_END #define Platform_seekset() FILE_BEGIN #define Platform_setCurrentDirectory(n, n__len) (INTEGER)SetCurrentDirectory((char*)n) -#define Platform_setEndOfFile(h) (INTEGER)SetEndOfFile((HANDLE)(ADDRESS)h) -#define Platform_setFilePointerEx(h, o, r, rc) li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((HANDLE)(ADDRESS)h, li, 0, (DWORD)r) +#define Platform_setEndOfFile(h) (INTEGER)SetEndOfFile((HANDLE)h) +#define Platform_setFilePointerEx(h, o, r, rc) li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((HANDLE)h, li, 0, (DWORD)r) #define Platform_sleep(ms) Sleep((DWORD)ms) #define Platform_stToFt() FILETIME ft; SystemTimeToFileTime(&st, &ft) #define Platform_startupInfo() STARTUPINFO si = {0}; si.cb = sizeof(si); @@ -182,7 +186,7 @@ extern void Heap_InitHeap(); #define Platform_ulSec() (LONGINT)(ul.QuadPart / 1000000LL) #define Platform_uluSec() (LONGINT)(ul.QuadPart % 1000000LL) #define Platform_waitForProcess() (INTEGER)WaitForSingleObject(pi.hProcess, INFINITE) -#define Platform_writefile(fd, p, l) (INTEGER)WriteFile((HANDLE)(ADDRESS)fd, (void*)(p), (DWORD)l, 0,0) +#define Platform_writefile(fd, p, l) (INTEGER)WriteFile((HANDLE)fd, (void*)(p), (DWORD)l, 0,0) BOOLEAN Platform_TooManyFiles (INT16 e) { @@ -738,6 +742,14 @@ void Platform_SetHalt (Platform_HaltProcedure p) Platform_HaltHandler = p; } +static void Platform_EnableVT100 (void) +{ + INT32 mode; + if (Platform_GetConsoleMode(Platform_StdOut, &mode)) { + Platform_SetConsoleMode(Platform_StdOut, mode + Platform_VTprocessing()); + } +} + static void Platform_TestLittleEndian (void) { INT16 i; @@ -767,6 +779,7 @@ export void *Platform__init(void) Platform_StdIn = Platform_getstdinhandle(); Platform_StdOut = Platform_getstdouthandle(); Platform_StdErr = Platform_getstderrhandle(); + Platform_EnableVT100(); Platform_NL[0] = 0x0d; Platform_NL[1] = 0x0a; Platform_NL[2] = 0x00; diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index 27a42a84..d6c32fa3 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 432ce603..37ba21bb 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index 07688e3c..94d22e76 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index 141a9976..17fe28a6 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index 4319e8c8..6d2e8625 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index ac0a3850..abf1736a 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index f2c8d90e..dd1e65e5 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/VT100.c b/bootstrap/windows-48/VT100.c index b5067d33..6a492f2a 100644 --- a/bootstrap/windows-48/VT100.c +++ b/bootstrap/windows-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/VT100.h b/bootstrap/windows-48/VT100.h index d9aa6ab7..54e1e753 100644 --- a/bootstrap/windows-48/VT100.h +++ b/bootstrap/windows-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-48/errors.c b/bootstrap/windows-48/errors.c index 2a1a7a02..651501a0 100644 --- a/bootstrap/windows-48/errors.c +++ b/bootstrap/windows-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/errors.h b/bootstrap/windows-48/errors.h index 5555899e..bd6765aa 100644 --- a/bootstrap/windows-48/errors.h +++ b/bootstrap/windows-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index aa59dd88..23b737c3 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index ad76f7b6..124b2154 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/Compiler.c b/bootstrap/windows-88/Compiler.c index 86c4c1fd..5635eb49 100644 --- a/bootstrap/windows-88/Compiler.c +++ b/bootstrap/windows-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index 3f8c68d8..88e7a4c9 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index 6abf2414..20f55dce 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 28c9e997..683c021e 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -33,7 +33,8 @@ typedef Files_FileName workName, registerName; BOOLEAN tempFile; Platform_FileIdentity identity; - INT32 fd, len, pos; + INT64 fd; + INT32 len, pos; Files_Buffer bufs[4]; INT16 swapper, state; Files_File next; @@ -307,10 +308,6 @@ void Files_Close (Files_File f) Files_Flush(f->bufs[i]); i += 1; } - error = Platform_Sync(f->fd); - if (error != 0) { - Files_Err((CHAR*)"error writing file", 19, f, error); - } Files_CloseOSFile(f); } } @@ -422,7 +419,7 @@ static Files_File Files_CacheEntry (Platform_FileIdentity identity) Files_File Files_Old (CHAR *name, LONGINT name__len) { Files_File f = NIL; - INT32 fd; + INT64 fd; INT16 pos; BOOLEAN done; CHAR dir[256], path[256]; @@ -726,7 +723,8 @@ void Files_Delete (CHAR *name, LONGINT name__len, INT16 *res) void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT16 *res) { - INT32 fdold, fdnew, n; + INT64 fdold, fdnew; + INT32 n; INT16 error, ignore; Platform_FileIdentity oldidentity, newidentity; CHAR buf[4096]; diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 4d65d916..2bc98b79 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h @@ -10,10 +10,9 @@ typedef typedef struct Files_FileDesc { - INT64 _prvt0; - char _prvt1[216]; - INT32 fd; - char _prvt2[60]; + char _prvt0[224]; + INT64 fd; + char _prvt1[56]; } Files_FileDesc; typedef diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index efbba685..65151d07 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index 0b6a9d03..d37b81db 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 39e2d6ca..56f6f73e 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index c2afbd3c..de306cf5 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index 4b7fe51c..d272b474 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index bc644f4c..880670eb 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index 19167eeb..1dba2168 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index f7fc51f9..a6816fe2 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index d343241b..6cd0dab4 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index 42866571..d828881d 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index 3eabde0b..4a47eb31 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index cb3aabc8..806302cb 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index 5d7b776f..6cb1973e 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index 01ffbd17..04a8a785 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index e1405ce9..51464c2f 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 66f25d3d..b01bfedc 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index ac2e6fba..4eaacd0b 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index 513d8dfa..ae75cd60 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Out.c b/bootstrap/windows-88/Out.c index ea8636f2..bad87929 100644 --- a/bootstrap/windows-88/Out.c +++ b/bootstrap/windows-88/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Out.h b/bootstrap/windows-88/Out.h index a685b291..79895677 100644 --- a/bootstrap/windows-88/Out.h +++ b/bootstrap/windows-88/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 2b9fd2c2..05db7a71 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -41,7 +41,7 @@ export INT64 Platform_ArgVector; static Platform_HaltProcedure Platform_HaltHandler; static INT32 Platform_TimeStart; export INT16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; -export INT32 Platform_StdIn, Platform_StdOut, Platform_StdErr; +export INT64 Platform_StdIn, Platform_StdOut, Platform_StdErr; static Platform_SignalHandler Platform_InterruptHandler; export CHAR Platform_NL[3]; @@ -51,11 +51,12 @@ export BOOLEAN Platform_Absent (INT16 e); export INT16 Platform_ArgPos (CHAR *s, LONGINT s__len); export void Platform_AssertFail (INT32 code); export INT16 Platform_Chdir (CHAR *n, LONGINT n__len); -export INT16 Platform_Close (INT32 h); +export INT16 Platform_Close (INT64 h); export BOOLEAN Platform_ConnectionFailed (INT16 e); export void Platform_Delay (INT32 ms); export BOOLEAN Platform_DifferentFilesystems (INT16 e); static void Platform_DisplayHaltCode (INT32 code); +static void Platform_EnableVT100 (void); export INT16 Platform_Error (void); export void Platform_Exit (INT16 code); export void Platform_GetArg (INT16 n, CHAR *val, LONGINT val__len); @@ -64,37 +65,37 @@ export void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val export void Platform_GetIntArg (INT16 n, INT32 *val); export void Platform_GetTimeOfDay (INT32 *sec, INT32 *usec); export void Platform_Halt (INT32 code); -export INT16 Platform_Identify (INT32 h, Platform_FileIdentity *identity, ADDRESS *identity__typ); +export INT16 Platform_Identify (INT64 h, Platform_FileIdentity *identity, ADDRESS *identity__typ); export INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ); export BOOLEAN Platform_Inaccessible (INT16 e); export void Platform_Init (INT32 argc, INT64 argvadr); export BOOLEAN Platform_Interrupted (INT16 e); export void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d); -export INT16 Platform_New (CHAR *n, LONGINT n__len, INT32 *h); +export INT16 Platform_New (CHAR *n, LONGINT n__len, INT64 *h); export BOOLEAN Platform_NoSuchDirectory (INT16 e); export INT64 Platform_OSAllocate (INT64 size); export void Platform_OSFree (INT64 address); -export INT16 Platform_OldRO (CHAR *n, LONGINT n__len, INT32 *h); -export INT16 Platform_OldRW (CHAR *n, LONGINT n__len, INT32 *h); -export INT16 Platform_Read (INT32 h, INT64 p, INT32 l, INT32 *n); -export INT16 Platform_ReadBuf (INT32 h, SYSTEM_BYTE *b, LONGINT b__len, INT32 *n); +export INT16 Platform_OldRO (CHAR *n, LONGINT n__len, INT64 *h); +export INT16 Platform_OldRW (CHAR *n, LONGINT n__len, INT64 *h); +export INT16 Platform_Read (INT64 h, INT64 p, INT32 l, INT32 *n); +export INT16 Platform_ReadBuf (INT64 h, SYSTEM_BYTE *b, LONGINT b__len, INT32 *n); export INT16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); export BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); export BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); -export INT16 Platform_Seek (INT32 h, INT32 o, INT16 r); +export INT16 Platform_Seek (INT64 h, INT32 o, INT16 r); export void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); export void Platform_SetHalt (Platform_HaltProcedure p); export void Platform_SetMTime (Platform_FileIdentity *target, ADDRESS *target__typ, Platform_FileIdentity source); -export INT16 Platform_Size (INT32 h, INT32 *l); -export INT16 Platform_Sync (INT32 h); +export INT16 Platform_Size (INT64 h, INT32 *l); +export INT16 Platform_Sync (INT64 h); export INT16 Platform_System (CHAR *cmd, LONGINT cmd__len); static void Platform_TestLittleEndian (void); export INT32 Platform_Time (void); export BOOLEAN Platform_TimedOut (INT16 e); export BOOLEAN Platform_TooManyFiles (INT16 e); -export INT16 Platform_Truncate (INT32 h, INT32 limit); +export INT16 Platform_Truncate (INT64 h, INT32 limit); export INT16 Platform_Unlink (CHAR *n, LONGINT n__len); -export INT16 Platform_Write (INT32 h, INT64 p, INT32 l); +export INT16 Platform_Write (INT64 h, INT64 p, INT32 l); static void Platform_YMDHMStoClock (INT16 ye, INT16 mo, INT16 da, INT16 ho, INT16 mi, INT16 se, INT32 *t, INT32 *d); static void Platform_errch (CHAR c); static void Platform_errint (INT32 l); @@ -118,10 +119,13 @@ export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT #define Platform_ERRORWRITEPROTECT() ERROR_WRITE_PROTECT #define Platform_ETIMEDOUT() WSAETIMEDOUT extern void Heap_InitHeap(); +#define Platform_GetConsoleMode(h, m) GetConsoleMode((HANDLE)h, m) #define Platform_GetTickCount() (LONGINT)(UINT32)GetTickCount() #define Platform_HeapInitHeap() Heap_InitHeap() +#define Platform_SetConsoleMode(h, m) SetConsoleMode((HANDLE)h, m) #define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((ADDRESS)h) #define Platform_SetQuitHandler(h) SystemSetQuitHandler((ADDRESS)h) +#define Platform_VTprocessing() ENABLE_VIRTUAL_TERMINAL_PROCESSING #define Platform_allocate(size) (ADDRESS)((void*)HeapAlloc(GetProcessHeap(), 0, (size_t)size)) #define Platform_bhfiIndexHigh() (LONGINT)bhfi.nFileIndexHigh #define Platform_bhfiIndexLow() (LONGINT)bhfi.nFileIndexLow @@ -130,44 +134,44 @@ extern void Heap_InitHeap(); #define Platform_bhfiVsn() (LONGINT)bhfi.dwVolumeSerialNumber #define Platform_byHandleFileInformation() BY_HANDLE_FILE_INFORMATION bhfi #define Platform_cleanupProcess() CloseHandle(pi.hProcess); CloseHandle(pi.hThread); -#define Platform_closeHandle(h) (INTEGER)CloseHandle((HANDLE)(ADDRESS)h) +#define Platform_closeHandle(h) (INTEGER)CloseHandle((HANDLE)h) #define Platform_createProcess(str, str__len) (INTEGER)CreateProcess(0, (char*)str, 0,0,0,0,0,0,&si,&pi) #define Platform_deleteFile(n, n__len) (INTEGER)DeleteFile((char*)n) #define Platform_err() (INTEGER)GetLastError() -#define Platform_errc(c) WriteFile((HANDLE)(ADDRESS)Platform_StdOut, &c, 1, 0,0) -#define Platform_errstring(s, s__len) WriteFile((HANDLE)(ADDRESS)Platform_StdOut, s, s__len-1, 0,0) +#define Platform_errc(c) WriteFile((HANDLE)Platform_StdOut, &c, 1, 0,0) +#define Platform_errstring(s, s__len) WriteFile((HANDLE)Platform_StdOut, s, s__len-1, 0,0) #define Platform_exit(code) ExitProcess((UINT)code) #define Platform_fileTimeToSysTime() SYSTEMTIME st; FileTimeToSystemTime(&ft, &st) -#define Platform_flushFileBuffers(h) (INTEGER)FlushFileBuffers((HANDLE)(ADDRESS)h) +#define Platform_flushFileBuffers(h) (INTEGER)FlushFileBuffers((HANDLE)h) #define Platform_free(address) HeapFree(GetProcessHeap(), 0, (void*)address) #define Platform_ftToUli() ULARGE_INTEGER ul; ul.LowPart=ft.dwLowDateTime; ul.HighPart=ft.dwHighDateTime #define Platform_getCurrentDirectory(n, n__len) GetCurrentDirectory(n__len, (char*)n) #define Platform_getExitCodeProcess(exitcode) GetExitCodeProcess(pi.hProcess, (DWORD*)exitcode); -#define Platform_getFileInformationByHandle(h) (INTEGER)GetFileInformationByHandle((HANDLE)(ADDRESS)h, &bhfi) -#define Platform_getFilePos(h, r, rc) LARGE_INTEGER liz = {0}; *rc = (INTEGER)SetFilePointerEx((HANDLE)(ADDRESS)h, liz, &li, FILE_CURRENT); *r = (LONGINT)li.QuadPart -#define Platform_getFileSize(h) (INTEGER)GetFileSizeEx((HANDLE)(ADDRESS)h, &li) +#define Platform_getFileInformationByHandle(h) (INTEGER)GetFileInformationByHandle((HANDLE)h, &bhfi) +#define Platform_getFilePos(h, r, rc) LARGE_INTEGER liz = {0}; *rc = (INTEGER)SetFilePointerEx((HANDLE)h, liz, &li, FILE_CURRENT); *r = (LONGINT)li.QuadPart +#define Platform_getFileSize(h) (INTEGER)GetFileSizeEx((HANDLE)h, &li) #define Platform_getLocalTime() SYSTEMTIME st; GetLocalTime(&st) #define Platform_getenv(name, name__len, buf, buf__len) (INTEGER)GetEnvironmentVariable((char*)name, (char*)buf, buf__len) #define Platform_getpid() (INTEGER)GetCurrentProcessId() -#define Platform_getstderrhandle() (LONGINT)(ADDRESS)GetStdHandle(STD_ERROR_HANDLE) -#define Platform_getstdinhandle() (LONGINT)(ADDRESS)GetStdHandle(STD_INPUT_HANDLE) -#define Platform_getstdouthandle() (LONGINT)(ADDRESS)GetStdHandle(STD_OUTPUT_HANDLE) +#define Platform_getstderrhandle() (ADDRESS)GetStdHandle(STD_ERROR_HANDLE) +#define Platform_getstdinhandle() (ADDRESS)GetStdHandle(STD_INPUT_HANDLE) +#define Platform_getstdouthandle() (ADDRESS)GetStdHandle(STD_OUTPUT_HANDLE) #define Platform_identityToFileTime(i) FILETIME ft; ft.dwHighDateTime = i.mtimehigh; ft.dwLowDateTime = i.mtimelow -#define Platform_invalidHandleValue() ((LONGINT)(ADDRESS)INVALID_HANDLE_VALUE) +#define Platform_invalidHandleValue() ((ADDRESS)INVALID_HANDLE_VALUE) #define Platform_largeInteger() LARGE_INTEGER li #define Platform_liLongint() (LONGINT)li.QuadPart #define Platform_moveFile(o, o__len, n, n__len) (INTEGER)MoveFileEx((char*)o, (char*)n, MOVEFILE_REPLACE_EXISTING) -#define Platform_opennew(n, n__len) (LONGINT)(ADDRESS)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0) -#define Platform_openro(n, n__len) (LONGINT)(ADDRESS)CreateFile((char*)n, GENERIC_READ , FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) -#define Platform_openrw(n, n__len) (LONGINT)(ADDRESS)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) +#define Platform_opennew(n, n__len) (ADDRESS)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0) +#define Platform_openro(n, n__len) (ADDRESS)CreateFile((char*)n, GENERIC_READ , FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) +#define Platform_openrw(n, n__len) (ADDRESS)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) #define Platform_processInfo() PROCESS_INFORMATION pi = {0}; -#define Platform_readfile(fd, p, l, n) (INTEGER)ReadFile((HANDLE)(ADDRESS)fd, (void*)p, (DWORD)l, (DWORD*)n, 0) +#define Platform_readfile(fd, p, l, n) (INTEGER)ReadFile((HANDLE)fd, (void*)p, (DWORD)l, (DWORD*)n, 0) #define Platform_seekcur() FILE_CURRENT #define Platform_seekend() FILE_END #define Platform_seekset() FILE_BEGIN #define Platform_setCurrentDirectory(n, n__len) (INTEGER)SetCurrentDirectory((char*)n) -#define Platform_setEndOfFile(h) (INTEGER)SetEndOfFile((HANDLE)(ADDRESS)h) -#define Platform_setFilePointerEx(h, o, r, rc) li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((HANDLE)(ADDRESS)h, li, 0, (DWORD)r) +#define Platform_setEndOfFile(h) (INTEGER)SetEndOfFile((HANDLE)h) +#define Platform_setFilePointerEx(h, o, r, rc) li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((HANDLE)h, li, 0, (DWORD)r) #define Platform_sleep(ms) Sleep((DWORD)ms) #define Platform_stToFt() FILETIME ft; SystemTimeToFileTime(&st, &ft) #define Platform_startupInfo() STARTUPINFO si = {0}; si.cb = sizeof(si); @@ -182,7 +186,7 @@ extern void Heap_InitHeap(); #define Platform_ulSec() (LONGINT)(ul.QuadPart / 1000000LL) #define Platform_uluSec() (LONGINT)(ul.QuadPart % 1000000LL) #define Platform_waitForProcess() (INTEGER)WaitForSingleObject(pi.hProcess, INFINITE) -#define Platform_writefile(fd, p, l) (INTEGER)WriteFile((HANDLE)(ADDRESS)fd, (void*)(p), (DWORD)l, 0,0) +#define Platform_writefile(fd, p, l) (INTEGER)WriteFile((HANDLE)fd, (void*)(p), (DWORD)l, 0,0) BOOLEAN Platform_TooManyFiles (INT16 e) { @@ -387,9 +391,9 @@ INT16 Platform_Error (void) return Platform_err(); } -INT16 Platform_OldRO (CHAR *n, LONGINT n__len, INT32 *h) +INT16 Platform_OldRO (CHAR *n, LONGINT n__len, INT64 *h) { - INT32 fd; + INT64 fd; fd = Platform_openro(n, n__len); if (fd == Platform_invalidHandleValue()) { return Platform_err(); @@ -400,9 +404,9 @@ INT16 Platform_OldRO (CHAR *n, LONGINT n__len, INT32 *h) __RETCHK; } -INT16 Platform_OldRW (CHAR *n, LONGINT n__len, INT32 *h) +INT16 Platform_OldRW (CHAR *n, LONGINT n__len, INT64 *h) { - INT32 fd; + INT64 fd; fd = Platform_openrw(n, n__len); if (fd == Platform_invalidHandleValue()) { return Platform_err(); @@ -413,9 +417,9 @@ INT16 Platform_OldRW (CHAR *n, LONGINT n__len, INT32 *h) __RETCHK; } -INT16 Platform_New (CHAR *n, LONGINT n__len, INT32 *h) +INT16 Platform_New (CHAR *n, LONGINT n__len, INT64 *h) { - INT32 fd; + INT64 fd; fd = Platform_opennew(n, n__len); if (fd == Platform_invalidHandleValue()) { return Platform_err(); @@ -426,7 +430,7 @@ INT16 Platform_New (CHAR *n, LONGINT n__len, INT32 *h) __RETCHK; } -INT16 Platform_Close (INT32 h) +INT16 Platform_Close (INT64 h) { if (Platform_closeHandle(h) == 0) { return Platform_err(); @@ -436,7 +440,7 @@ INT16 Platform_Close (INT32 h) __RETCHK; } -INT16 Platform_Identify (INT32 h, Platform_FileIdentity *identity, ADDRESS *identity__typ) +INT16 Platform_Identify (INT64 h, Platform_FileIdentity *identity, ADDRESS *identity__typ) { Platform_byHandleFileInformation(); if (Platform_getFileInformationByHandle(h) == 0) { @@ -452,7 +456,7 @@ INT16 Platform_Identify (INT32 h, Platform_FileIdentity *identity, ADDRESS *iden INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ) { - INT32 h; + INT64 h; INT16 e, i; __DUP(n, n__len, CHAR); e = Platform_OldRO((void*)n, n__len, &h); @@ -489,7 +493,7 @@ void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d) Platform_YMDHMStoClock(Platform_styear(), Platform_stmon(), Platform_stmday(), Platform_sthour(), Platform_stmin(), Platform_stsec(), &*t, &*d); } -INT16 Platform_Size (INT32 h, INT32 *l) +INT16 Platform_Size (INT64 h, INT32 *l) { Platform_largeInteger(); if (Platform_getFileSize(h) == 0) { @@ -499,7 +503,7 @@ INT16 Platform_Size (INT32 h, INT32 *l) return 0; } -INT16 Platform_Read (INT32 h, INT64 p, INT32 l, INT32 *n) +INT16 Platform_Read (INT64 h, INT64 p, INT32 l, INT32 *n) { INT16 result; INT32 lengthread; @@ -514,7 +518,7 @@ INT16 Platform_Read (INT32 h, INT64 p, INT32 l, INT32 *n) __RETCHK; } -INT16 Platform_ReadBuf (INT32 h, SYSTEM_BYTE *b, LONGINT b__len, INT32 *n) +INT16 Platform_ReadBuf (INT64 h, SYSTEM_BYTE *b, LONGINT b__len, INT32 *n) { INT16 result; INT32 lengthread; @@ -529,7 +533,7 @@ INT16 Platform_ReadBuf (INT32 h, SYSTEM_BYTE *b, LONGINT b__len, INT32 *n) __RETCHK; } -INT16 Platform_Write (INT32 h, INT64 p, INT32 l) +INT16 Platform_Write (INT64 h, INT64 p, INT32 l) { if (Platform_writefile(h, p, l) == 0) { return Platform_err(); @@ -539,7 +543,7 @@ INT16 Platform_Write (INT32 h, INT64 p, INT32 l) __RETCHK; } -INT16 Platform_Sync (INT32 h) +INT16 Platform_Sync (INT64 h) { if (Platform_flushFileBuffers(h) == 0) { return Platform_err(); @@ -549,7 +553,7 @@ INT16 Platform_Sync (INT32 h) __RETCHK; } -INT16 Platform_Seek (INT32 h, INT32 o, INT16 r) +INT16 Platform_Seek (INT64 h, INT32 o, INT16 r) { INT16 rc; Platform_largeInteger(); @@ -562,7 +566,7 @@ INT16 Platform_Seek (INT32 h, INT32 o, INT16 r) __RETCHK; } -INT16 Platform_Truncate (INT32 h, INT32 limit) +INT16 Platform_Truncate (INT64 h, INT32 limit) { INT16 rc; INT32 oldpos; @@ -738,6 +742,14 @@ void Platform_SetHalt (Platform_HaltProcedure p) Platform_HaltHandler = p; } +static void Platform_EnableVT100 (void) +{ + INT32 mode; + if (Platform_GetConsoleMode(Platform_StdOut, &mode)) { + Platform_SetConsoleMode(Platform_StdOut, mode + Platform_VTprocessing()); + } +} + static void Platform_TestLittleEndian (void) { INT16 i; @@ -767,6 +779,7 @@ export void *Platform__init(void) Platform_StdIn = Platform_getstdinhandle(); Platform_StdOut = Platform_getstdouthandle(); Platform_StdErr = Platform_getstderrhandle(); + Platform_EnableVT100(); Platform_NL[0] = 0x0d; Platform_NL[1] = 0x0a; Platform_NL[2] = 0x00; diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index e67b2ca0..e2e65585 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h @@ -26,7 +26,7 @@ import CHAR Platform_CWD[4096]; import INT16 Platform_ArgCount; import INT64 Platform_ArgVector; import INT16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; -import INT32 Platform_StdIn, Platform_StdOut, Platform_StdErr; +import INT64 Platform_StdIn, Platform_StdOut, Platform_StdErr; import CHAR Platform_NL[3]; import ADDRESS *Platform_FileIdentity__typ; @@ -35,7 +35,7 @@ import BOOLEAN Platform_Absent (INT16 e); import INT16 Platform_ArgPos (CHAR *s, LONGINT s__len); import void Platform_AssertFail (INT32 code); import INT16 Platform_Chdir (CHAR *n, LONGINT n__len); -import INT16 Platform_Close (INT32 h); +import INT16 Platform_Close (INT64 h); import BOOLEAN Platform_ConnectionFailed (INT16 e); import void Platform_Delay (INT32 ms); import BOOLEAN Platform_DifferentFilesystems (INT16 e); @@ -47,36 +47,36 @@ import void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val import void Platform_GetIntArg (INT16 n, INT32 *val); import void Platform_GetTimeOfDay (INT32 *sec, INT32 *usec); import void Platform_Halt (INT32 code); -import INT16 Platform_Identify (INT32 h, Platform_FileIdentity *identity, ADDRESS *identity__typ); +import INT16 Platform_Identify (INT64 h, Platform_FileIdentity *identity, ADDRESS *identity__typ); import INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ); import BOOLEAN Platform_Inaccessible (INT16 e); import void Platform_Init (INT32 argc, INT64 argvadr); import BOOLEAN Platform_Interrupted (INT16 e); import void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d); -import INT16 Platform_New (CHAR *n, LONGINT n__len, INT32 *h); +import INT16 Platform_New (CHAR *n, LONGINT n__len, INT64 *h); import BOOLEAN Platform_NoSuchDirectory (INT16 e); import INT64 Platform_OSAllocate (INT64 size); import void Platform_OSFree (INT64 address); -import INT16 Platform_OldRO (CHAR *n, LONGINT n__len, INT32 *h); -import INT16 Platform_OldRW (CHAR *n, LONGINT n__len, INT32 *h); -import INT16 Platform_Read (INT32 h, INT64 p, INT32 l, INT32 *n); -import INT16 Platform_ReadBuf (INT32 h, SYSTEM_BYTE *b, LONGINT b__len, INT32 *n); +import INT16 Platform_OldRO (CHAR *n, LONGINT n__len, INT64 *h); +import INT16 Platform_OldRW (CHAR *n, LONGINT n__len, INT64 *h); +import INT16 Platform_Read (INT64 h, INT64 p, INT32 l, INT32 *n); +import INT16 Platform_ReadBuf (INT64 h, SYSTEM_BYTE *b, LONGINT b__len, INT32 *n); import INT16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); import BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); import BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); -import INT16 Platform_Seek (INT32 h, INT32 o, INT16 r); +import INT16 Platform_Seek (INT64 h, INT32 o, INT16 r); import void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); import void Platform_SetHalt (Platform_HaltProcedure p); import void Platform_SetMTime (Platform_FileIdentity *target, ADDRESS *target__typ, Platform_FileIdentity source); -import INT16 Platform_Size (INT32 h, INT32 *l); -import INT16 Platform_Sync (INT32 h); +import INT16 Platform_Size (INT64 h, INT32 *l); +import INT16 Platform_Sync (INT64 h); import INT16 Platform_System (CHAR *cmd, LONGINT cmd__len); import INT32 Platform_Time (void); import BOOLEAN Platform_TimedOut (INT16 e); import BOOLEAN Platform_TooManyFiles (INT16 e); -import INT16 Platform_Truncate (INT32 h, INT32 limit); +import INT16 Platform_Truncate (INT64 h, INT32 limit); import INT16 Platform_Unlink (CHAR *n, LONGINT n__len); -import INT16 Platform_Write (INT32 h, INT64 p, INT32 l); +import INT16 Platform_Write (INT64 h, INT64 p, INT32 l); import BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); import void *Platform__init(void); diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 432ce603..37ba21bb 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index 07688e3c..94d22e76 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index 141a9976..17fe28a6 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index 4319e8c8..6d2e8625 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index 3b932ce7..38bcde69 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index bff9cc72..6ef483f3 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/VT100.c b/bootstrap/windows-88/VT100.c index b5067d33..6a492f2a 100644 --- a/bootstrap/windows-88/VT100.c +++ b/bootstrap/windows-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/VT100.h b/bootstrap/windows-88/VT100.h index d9aa6ab7..54e1e753 100644 --- a/bootstrap/windows-88/VT100.h +++ b/bootstrap/windows-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-88/errors.c b/bootstrap/windows-88/errors.c index 2a1a7a02..651501a0 100644 --- a/bootstrap/windows-88/errors.c +++ b/bootstrap/windows-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/errors.h b/bootstrap/windows-88/errors.h index 5555899e..bd6765aa 100644 --- a/bootstrap/windows-88/errors.h +++ b/bootstrap/windows-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index aa59dd88..23b737c3 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index ad76f7b6..124b2154 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h From 9f5d4c6b0d551ad8b13a84821e2bd9e8c78bbb41 Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 10 Nov 2016 12:52:23 +0000 Subject: [PATCH 313/580] Fix mingw where ENABLE_VIRTUAL_TERMINAL_PROCESSING is undefined. --- bootstrap/windows-48/Platform.c | 7 +++---- bootstrap/windows-88/Platform.c | 7 +++---- src/runtime/Platformwindows.Mod | 8 ++++---- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 7b5d8c73..4a8c3cc0 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -119,13 +119,12 @@ export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT #define Platform_ERRORWRITEPROTECT() ERROR_WRITE_PROTECT #define Platform_ETIMEDOUT() WSAETIMEDOUT extern void Heap_InitHeap(); -#define Platform_GetConsoleMode(h, m) GetConsoleMode((HANDLE)h, m) +#define Platform_GetConsoleMode(h, m) GetConsoleMode((HANDLE)h, (DWORD*)m) #define Platform_GetTickCount() (LONGINT)(UINT32)GetTickCount() #define Platform_HeapInitHeap() Heap_InitHeap() -#define Platform_SetConsoleMode(h, m) SetConsoleMode((HANDLE)h, m) +#define Platform_SetConsoleMode(h, m) SetConsoleMode((HANDLE)h, (DWORD)m) #define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((ADDRESS)h) #define Platform_SetQuitHandler(h) SystemSetQuitHandler((ADDRESS)h) -#define Platform_VTprocessing() ENABLE_VIRTUAL_TERMINAL_PROCESSING #define Platform_allocate(size) (ADDRESS)((void*)HeapAlloc(GetProcessHeap(), 0, (size_t)size)) #define Platform_bhfiIndexHigh() (LONGINT)bhfi.nFileIndexHigh #define Platform_bhfiIndexLow() (LONGINT)bhfi.nFileIndexLow @@ -746,7 +745,7 @@ static void Platform_EnableVT100 (void) { INT32 mode; if (Platform_GetConsoleMode(Platform_StdOut, &mode)) { - Platform_SetConsoleMode(Platform_StdOut, mode + Platform_VTprocessing()); + Platform_SetConsoleMode(Platform_StdOut, mode + 4); } } diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 05db7a71..c0d60542 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -119,13 +119,12 @@ export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT #define Platform_ERRORWRITEPROTECT() ERROR_WRITE_PROTECT #define Platform_ETIMEDOUT() WSAETIMEDOUT extern void Heap_InitHeap(); -#define Platform_GetConsoleMode(h, m) GetConsoleMode((HANDLE)h, m) +#define Platform_GetConsoleMode(h, m) GetConsoleMode((HANDLE)h, (DWORD*)m) #define Platform_GetTickCount() (LONGINT)(UINT32)GetTickCount() #define Platform_HeapInitHeap() Heap_InitHeap() -#define Platform_SetConsoleMode(h, m) SetConsoleMode((HANDLE)h, m) +#define Platform_SetConsoleMode(h, m) SetConsoleMode((HANDLE)h, (DWORD)m) #define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((ADDRESS)h) #define Platform_SetQuitHandler(h) SystemSetQuitHandler((ADDRESS)h) -#define Platform_VTprocessing() ENABLE_VIRTUAL_TERMINAL_PROCESSING #define Platform_allocate(size) (ADDRESS)((void*)HeapAlloc(GetProcessHeap(), 0, (size_t)size)) #define Platform_bhfiIndexHigh() (LONGINT)bhfi.nFileIndexHigh #define Platform_bhfiIndexLow() (LONGINT)bhfi.nFileIndexLow @@ -746,7 +745,7 @@ static void Platform_EnableVT100 (void) { INT32 mode; if (Platform_GetConsoleMode(Platform_StdOut, &mode)) { - Platform_SetConsoleMode(Platform_StdOut, mode + Platform_VTprocessing()); + Platform_SetConsoleMode(Platform_StdOut, mode + 4); } } diff --git a/src/runtime/Platformwindows.Mod b/src/runtime/Platformwindows.Mod index 9bf36594..a52ae92c 100644 --- a/src/runtime/Platformwindows.Mod +++ b/src/runtime/Platformwindows.Mod @@ -587,13 +587,13 @@ PROCEDURE SetHalt*(p: HaltProcedure); BEGIN HaltHandler := p; END SetHalt; -PROCEDURE -GetConsoleMode(h: FileHandle; VAR m: SYSTEM.INT32): BOOLEAN "GetConsoleMode((HANDLE)h, m)"; -PROCEDURE -SetConsoleMode(h: FileHandle; m: SYSTEM.INT32) "SetConsoleMode((HANDLE)h, m)"; -PROCEDURE -VTprocessing(): SYSTEM.INT32 "ENABLE_VIRTUAL_TERMINAL_PROCESSING"; +PROCEDURE -GetConsoleMode(h: FileHandle; VAR m: SYSTEM.INT32): BOOLEAN "GetConsoleMode((HANDLE)h, (DWORD*)m)"; +PROCEDURE -SetConsoleMode(h: FileHandle; m: SYSTEM.INT32) "SetConsoleMode((HANDLE)h, (DWORD)m)"; PROCEDURE EnableVT100; +CONST VTprocessing = 4; (* ENABLE_VIRTUAL_TERMINAL_PROCESSING: value specified by MSDN *) VAR mode: SYSTEM.INT32; -BEGIN IF GetConsoleMode(StdOut, mode) THEN SetConsoleMode(StdOut, mode+VTprocessing()) END +BEGIN IF GetConsoleMode(StdOut, mode) THEN SetConsoleMode(StdOut, mode+VTprocessing) END END EnableVT100; From ef815aa1315db544bd5e7e0cd958870600197943 Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 10 Nov 2016 18:54:40 +0000 Subject: [PATCH 314/580] Add version to symbol files to avoid confusing symptoms from format changes. --- bootstrap/unix-44/OPM.c | 8 +++++--- bootstrap/unix-48/OPM.c | 8 +++++--- bootstrap/unix-88/OPM.c | 8 +++++--- bootstrap/windows-48/OPM.c | 8 +++++--- bootstrap/windows-88/OPM.c | 8 +++++--- make.cmd | 3 ++- src/compiler/OPM.Mod | 10 ++++++---- 7 files changed, 33 insertions(+), 20 deletions(-) diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 2f163525..4924854d 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -764,15 +764,16 @@ void OPM_CloseOldSym (void) void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done) { - CHAR ch; + CHAR tag, ver; OPM_FileName fileName; OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, 32, (CHAR*)".sym", 5); OPM_oldSFile = Files_Old(fileName, 32); *done = OPM_oldSFile != NIL; if (*done) { Files_Set(&OPM_oldSF, Files_Rider__typ, OPM_oldSFile, 0); - Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&ch); - if (ch != 0xf7) { + Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&tag); + Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&ver); + if (tag != 0xf7 || ver != 0x82) { OPM_err(-306); OPM_CloseOldSym(); *done = 0; @@ -829,6 +830,7 @@ void OPM_NewSym (CHAR *modName, LONGINT modName__len) if (OPM_newSFile != NIL) { Files_Set(&OPM_newSF, Files_Rider__typ, OPM_newSFile, 0); Files_Write(&OPM_newSF, Files_Rider__typ, 0xf7); + Files_Write(&OPM_newSF, Files_Rider__typ, 0x82); } else { OPM_err(153); } diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 2f163525..4924854d 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -764,15 +764,16 @@ void OPM_CloseOldSym (void) void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done) { - CHAR ch; + CHAR tag, ver; OPM_FileName fileName; OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, 32, (CHAR*)".sym", 5); OPM_oldSFile = Files_Old(fileName, 32); *done = OPM_oldSFile != NIL; if (*done) { Files_Set(&OPM_oldSF, Files_Rider__typ, OPM_oldSFile, 0); - Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&ch); - if (ch != 0xf7) { + Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&tag); + Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&ver); + if (tag != 0xf7 || ver != 0x82) { OPM_err(-306); OPM_CloseOldSym(); *done = 0; @@ -829,6 +830,7 @@ void OPM_NewSym (CHAR *modName, LONGINT modName__len) if (OPM_newSFile != NIL) { Files_Set(&OPM_newSF, Files_Rider__typ, OPM_newSFile, 0); Files_Write(&OPM_newSF, Files_Rider__typ, 0xf7); + Files_Write(&OPM_newSF, Files_Rider__typ, 0x82); } else { OPM_err(153); } diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 6cd0dab4..e077a852 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -764,15 +764,16 @@ void OPM_CloseOldSym (void) void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done) { - CHAR ch; + CHAR tag, ver; OPM_FileName fileName; OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, 32, (CHAR*)".sym", 5); OPM_oldSFile = Files_Old(fileName, 32); *done = OPM_oldSFile != NIL; if (*done) { Files_Set(&OPM_oldSF, Files_Rider__typ, OPM_oldSFile, 0); - Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&ch); - if (ch != 0xf7) { + Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&tag); + Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&ver); + if (tag != 0xf7 || ver != 0x82) { OPM_err(-306); OPM_CloseOldSym(); *done = 0; @@ -829,6 +830,7 @@ void OPM_NewSym (CHAR *modName, LONGINT modName__len) if (OPM_newSFile != NIL) { Files_Set(&OPM_newSF, Files_Rider__typ, OPM_newSFile, 0); Files_Write(&OPM_newSF, Files_Rider__typ, 0xf7); + Files_Write(&OPM_newSF, Files_Rider__typ, 0x82); } else { OPM_err(153); } diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 2f163525..4924854d 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -764,15 +764,16 @@ void OPM_CloseOldSym (void) void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done) { - CHAR ch; + CHAR tag, ver; OPM_FileName fileName; OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, 32, (CHAR*)".sym", 5); OPM_oldSFile = Files_Old(fileName, 32); *done = OPM_oldSFile != NIL; if (*done) { Files_Set(&OPM_oldSF, Files_Rider__typ, OPM_oldSFile, 0); - Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&ch); - if (ch != 0xf7) { + Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&tag); + Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&ver); + if (tag != 0xf7 || ver != 0x82) { OPM_err(-306); OPM_CloseOldSym(); *done = 0; @@ -829,6 +830,7 @@ void OPM_NewSym (CHAR *modName, LONGINT modName__len) if (OPM_newSFile != NIL) { Files_Set(&OPM_newSF, Files_Rider__typ, OPM_newSFile, 0); Files_Write(&OPM_newSF, Files_Rider__typ, 0xf7); + Files_Write(&OPM_newSF, Files_Rider__typ, 0x82); } else { OPM_err(153); } diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 6cd0dab4..e077a852 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -764,15 +764,16 @@ void OPM_CloseOldSym (void) void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done) { - CHAR ch; + CHAR tag, ver; OPM_FileName fileName; OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, 32, (CHAR*)".sym", 5); OPM_oldSFile = Files_Old(fileName, 32); *done = OPM_oldSFile != NIL; if (*done) { Files_Set(&OPM_oldSF, Files_Rider__typ, OPM_oldSFile, 0); - Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&ch); - if (ch != 0xf7) { + Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&tag); + Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&ver); + if (tag != 0xf7 || ver != 0x82) { OPM_err(-306); OPM_CloseOldSym(); *done = 0; @@ -829,6 +830,7 @@ void OPM_NewSym (CHAR *modName, LONGINT modName__len) if (OPM_newSFile != NIL) { Files_Set(&OPM_newSF, Files_Rider__typ, OPM_newSFile, 0); Files_Write(&OPM_newSF, Files_Rider__typ, 0xf7); + Files_Write(&OPM_newSF, Files_Rider__typ, 0x82); } else { OPM_err(153); } diff --git a/make.cmd b/make.cmd index 80ab98d4..6eb498e5 100644 --- a/make.cmd +++ b/make.cmd @@ -68,6 +68,7 @@ if errorlevel 1 ( echo make full - administrator rights required. Please run under an administrator command prompt. goto :eof ) +call :uninstall || exit /b call :clean || exit /b call :compiler || exit /b call :browsercmd || exit /b @@ -447,7 +448,7 @@ goto :eof :initlibrary -del /s /q %BUILDDIR%\%MODEL% >nul 2>nul +rd /s /q %BUILDDIR%\%MODEL% >nul 2>nul mkdir %BUILDDIR% >nul 2>nul mkdir %BUILDDIR%\%MODEL% >nul 2>nul copy src\runtime\*.c %BUILDDIR%\%MODEL% >nul diff --git a/src/compiler/OPM.Mod b/src/compiler/OPM.Mod index c0abf4e3..48337bfc 100644 --- a/src/compiler/OPM.Mod +++ b/src/compiler/OPM.Mod @@ -76,6 +76,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) BFext = ".c"; (* body file extension *) HFext = ".h"; (* header file extension *) SFtag = 0F7X; (* symbol file tag *) + SFver = 082X; (* symbol file version. Increment if symbol file format is changed. *) @@ -618,13 +619,13 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) END CloseOldSym; PROCEDURE OldSym*(VAR modName: ARRAY OF CHAR; VAR done: BOOLEAN); - VAR ch: CHAR; fileName: FileName; + VAR tag, ver: CHAR; fileName: FileName; BEGIN MakeFileName(modName, fileName, SFext); oldSFile := Files.Old(fileName); done := oldSFile # NIL; IF done THEN - Files.Set(oldSF, oldSFile, 0); Files.Read(oldSF, ch); - IF ch # SFtag THEN err(-306); (*possibly a symbol file from another Oberon implementation, e.g. HP-Oberon*) + Files.Set(oldSF, oldSFile, 0); Files.Read(oldSF, tag); Files.Read(oldSF, ver); + IF (tag # SFtag) OR (ver # SFver) THEN err(-306); (*possibly a symbol file from another Oberon implementation, e.g. HP-Oberon*) CloseOldSym; done := FALSE END END @@ -671,7 +672,8 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) VAR fileName: FileName; BEGIN MakeFileName(modName, fileName, SFext); newSFile := Files.New(fileName); - IF newSFile # NIL THEN Files.Set(newSF, newSFile, 0); Files.Write(newSF, SFtag) + IF newSFile # NIL THEN Files.Set(newSF, newSFile, 0); + Files.Write(newSF, SFtag); Files.Write(newSF, SFver) ELSE err(153) END END NewSym; From aa5252dc6b2f651497fa56192596d76fbf79008f Mon Sep 17 00:00:00 2001 From: Ivan Sukin Date: Fri, 11 Nov 2016 19:20:27 +0400 Subject: [PATCH 315/580] Fixed typo in Features.md (#47) --- doc/Features.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/Features.md b/doc/Features.md index e7e8a39d..8ccb6509 100644 --- a/doc/Features.md +++ b/doc/Features.md @@ -13,7 +13,7 @@ The following type sizes follow the built compiler size: | Types | 32 bit builds | 64 bit builds | | ----- | ------------- | ------------- | | INTEGER | 16 bit | 32 bit | -| LONGINT, SET | 32 bit | 16 bit | +| LONGINT, SET | 32 bit | 64 bit | HALT/exit code has been simplified. Exit now just calls the system exit API rather than calling the kill API and passing our own process ID. For runtime errors it now displayes the appropriate error message (e.g. Index out of range). From ed7043324d744d9fb5aa3de0b882d4c4c06cc542 Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 11 Nov 2016 18:23:31 +0000 Subject: [PATCH 316/580] Remove redundant writer in OPM. Fix Files.Readline for CR/LF and guarantee 0 termination. --- bootstrap/unix-44/Compiler.c | 2 +- bootstrap/unix-44/Configuration.c | 4 +- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Files.c | 23 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 2 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 2 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 5 +- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 2 +- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 2 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Out.c | 2 +- bootstrap/unix-44/Out.h | 2 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/VT100.c | 2 +- bootstrap/unix-44/VT100.h | 2 +- bootstrap/unix-44/errors.c | 2 +- bootstrap/unix-44/errors.h | 2 +- bootstrap/unix-44/extTools.c | 2 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-48/Compiler.c | 2 +- bootstrap/unix-48/Configuration.c | 4 +- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Files.c | 23 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 2 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 2 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 5 +- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 2 +- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 2 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Out.c | 2 +- bootstrap/unix-48/Out.h | 2 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/VT100.c | 2 +- bootstrap/unix-48/VT100.h | 2 +- bootstrap/unix-48/errors.c | 2 +- bootstrap/unix-48/errors.h | 2 +- bootstrap/unix-48/extTools.c | 2 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-88/Compiler.c | 2 +- bootstrap/unix-88/Configuration.c | 4 +- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Files.c | 23 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 2 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 2 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 5 +- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 2 +- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 2 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Out.c | 2 +- bootstrap/unix-88/Out.h | 2 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/VT100.c | 2 +- bootstrap/unix-88/VT100.h | 2 +- bootstrap/unix-88/errors.c | 2 +- bootstrap/unix-88/errors.h | 2 +- bootstrap/unix-88/extTools.c | 2 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/windows-48/Compiler.c | 2 +- bootstrap/windows-48/Configuration.c | 4 +- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Files.c | 23 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 2 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 2 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 5 +- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 2 +- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 2 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Out.c | 2 +- bootstrap/windows-48/Out.h | 2 +- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/VT100.c | 2 +- bootstrap/windows-48/VT100.h | 2 +- bootstrap/windows-48/errors.c | 2 +- bootstrap/windows-48/errors.h | 2 +- bootstrap/windows-48/extTools.c | 2 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-88/Compiler.c | 2 +- bootstrap/windows-88/Configuration.c | 4 +- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Files.c | 23 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 2 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 2 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 5 +- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 2 +- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 2 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Out.c | 2 +- bootstrap/windows-88/Out.h | 2 +- bootstrap/windows-88/Platform.c | 2 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/VT100.c | 2 +- bootstrap/windows-88/VT100.h | 2 +- bootstrap/windows-88/errors.c | 2 +- bootstrap/windows-88/errors.h | 2 +- bootstrap/windows-88/extTools.c | 2 +- bootstrap/windows-88/extTools.h | 2 +- src/compiler/OPM.Mod | 3 - src/library/v4/Modules.Mod | 96 --- src/library/v4/Reals.Mod | 136 ----- src/library/v4/Strings.Mod | 156 ----- src/library/v4/Texts.Mod | 879 --------------------------- src/runtime/Files.Mod | 17 +- 201 files changed, 255 insertions(+), 1552 deletions(-) delete mode 100644 src/library/v4/Modules.Mod delete mode 100644 src/library/v4/Reals.Mod delete mode 100644 src/library/v4/Strings.Mod delete mode 100644 src/library/v4/Texts.Mod diff --git a/bootstrap/unix-44/Compiler.c b/bootstrap/unix-44/Compiler.c index 5635eb49..87b0392c 100644 --- a/bootstrap/unix-44/Compiler.c +++ b/bootstrap/unix-44/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index 88e7a4c9..c15b87f9 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index 20f55dce..f169a3b6 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index b6483b0d..5aedd8ec 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -883,19 +883,18 @@ void Files_ReadString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len) void Files_ReadLine (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len) { INT16 i; - CHAR ch; - BOOLEAN b; i = 0; - b = 0; do { - Files_Read(&*R, R__typ, (void*)&ch); - if ((ch == 0x00 || ch == 0x0a) || ch == 0x0d) { - b = 1; - } else { - x[i] = ch; - i += 1; - } - } while (!b); + Files_Read(&*R, R__typ, (void*)&x[i]); + i += 1; + } while (!(x[i - 1] == 0x00 || x[i - 1] == 0x0a)); + if (x[i - 1] == 0x0a) { + i -= 1; + } + if ((i > 0 && x[i - 1] == 0x0d)) { + i -= 1; + } + x[i] = 0x00; } void Files_ReadNum (Files_Rider *R, ADDRESS *R__typ, SYSTEM_BYTE *x, LONGINT x__len) diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index 1b94c84f..88034b00 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index 8ab8db36..45b45394 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index a7926fd5..8626628d 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index 20b68450..5eddf9be 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index de306cf5..2da3fa50 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index d272b474..dcac4eb9 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index 880670eb..cb6399f9 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 1dba2168..9b3d80c3 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index a6816fe2..6cc996c8 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 4924854d..0ac4141a 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -38,7 +38,6 @@ export CHAR OPM_objname[64]; static INT32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; static Texts_Reader OPM_inR; static Texts_Text OPM_Log; -static Texts_Writer OPM_W; static Files_Rider OPM_oldSF, OPM_newSF; static Files_Rider OPM_R[3]; static Files_File OPM_oldSFile, OPM_newSFile, OPM_HFile, OPM_BFile, OPM_HIFile; @@ -1044,7 +1043,6 @@ static void EnumPtrs(void (*P)(void*)) { __ENUMR(&OPM_inR, Texts_Reader__typ, 48, 1, P); P(OPM_Log); - __ENUMR(&OPM_W, Texts_Writer__typ, 36, 1, P); __ENUMR(&OPM_oldSF, Files_Rider__typ, 20, 1, P); __ENUMR(&OPM_newSF, Files_Rider__typ, 20, 1, P); __ENUMR(OPM_R, Files_Rider__typ, 20, 3, P); @@ -1080,6 +1078,5 @@ export void *OPM__init(void) OPM_MaxLReal = 1.79769296342094e+308; OPM_MinReal = -OPM_MaxReal; OPM_MinLReal = -OPM_MaxLReal; - Texts_OpenWriter(&OPM_W, Texts_Writer__typ); __ENDMOD; } diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index d828881d..91212642 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index a8a90bfc..6a24e3cd 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index 806302cb..3cadf5a4 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index 6cb1973e..898b14b6 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index 04a8a785..34906046 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index 49df34bf..fc148d64 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index b01bfedc..3a248e3c 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index c90bb72a..77b842f8 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index ae75cd60..34e34ae6 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Out.c b/bootstrap/unix-44/Out.c index 27e1fa94..09fecc76 100644 --- a/bootstrap/unix-44/Out.c +++ b/bootstrap/unix-44/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Out.h b/bootstrap/unix-44/Out.h index 79895677..63fefd3c 100644 --- a/bootstrap/unix-44/Out.h +++ b/bootstrap/unix-44/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index c90c4c43..bc020535 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index bff09b6b..2bbafb50 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 37ba21bb..f7860591 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index 94d22e76..5ed2ec95 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index 17fe28a6..5ae2e44e 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index 6d2e8625..a9d577f6 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index 7891a3ab..db16a845 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index b8f6a762..f7454dae 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/VT100.c b/bootstrap/unix-44/VT100.c index 6a492f2a..01b8a481 100644 --- a/bootstrap/unix-44/VT100.c +++ b/bootstrap/unix-44/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/VT100.h b/bootstrap/unix-44/VT100.h index 54e1e753..5ee411dd 100644 --- a/bootstrap/unix-44/VT100.h +++ b/bootstrap/unix-44/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-44/errors.c b/bootstrap/unix-44/errors.c index 651501a0..b7d411bb 100644 --- a/bootstrap/unix-44/errors.c +++ b/bootstrap/unix-44/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/errors.h b/bootstrap/unix-44/errors.h index bd6765aa..fa08de1c 100644 --- a/bootstrap/unix-44/errors.h +++ b/bootstrap/unix-44/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index 23b737c3..74271e5d 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index 124b2154..9b7b3c17 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/Compiler.c b/bootstrap/unix-48/Compiler.c index 5635eb49..87b0392c 100644 --- a/bootstrap/unix-48/Compiler.c +++ b/bootstrap/unix-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index 88e7a4c9..c15b87f9 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index 20f55dce..f169a3b6 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index b6483b0d..5aedd8ec 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -883,19 +883,18 @@ void Files_ReadString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len) void Files_ReadLine (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len) { INT16 i; - CHAR ch; - BOOLEAN b; i = 0; - b = 0; do { - Files_Read(&*R, R__typ, (void*)&ch); - if ((ch == 0x00 || ch == 0x0a) || ch == 0x0d) { - b = 1; - } else { - x[i] = ch; - i += 1; - } - } while (!b); + Files_Read(&*R, R__typ, (void*)&x[i]); + i += 1; + } while (!(x[i - 1] == 0x00 || x[i - 1] == 0x0a)); + if (x[i - 1] == 0x0a) { + i -= 1; + } + if ((i > 0 && x[i - 1] == 0x0d)) { + i -= 1; + } + x[i] = 0x00; } void Files_ReadNum (Files_Rider *R, ADDRESS *R__typ, SYSTEM_BYTE *x, LONGINT x__len) diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index 1b94c84f..88034b00 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index 8ab8db36..45b45394 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index a7926fd5..8626628d 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index 20b68450..5eddf9be 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index de306cf5..2da3fa50 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index d272b474..dcac4eb9 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index 880670eb..cb6399f9 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 1dba2168..9b3d80c3 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index a6816fe2..6cc996c8 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 4924854d..0ac4141a 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -38,7 +38,6 @@ export CHAR OPM_objname[64]; static INT32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; static Texts_Reader OPM_inR; static Texts_Text OPM_Log; -static Texts_Writer OPM_W; static Files_Rider OPM_oldSF, OPM_newSF; static Files_Rider OPM_R[3]; static Files_File OPM_oldSFile, OPM_newSFile, OPM_HFile, OPM_BFile, OPM_HIFile; @@ -1044,7 +1043,6 @@ static void EnumPtrs(void (*P)(void*)) { __ENUMR(&OPM_inR, Texts_Reader__typ, 48, 1, P); P(OPM_Log); - __ENUMR(&OPM_W, Texts_Writer__typ, 36, 1, P); __ENUMR(&OPM_oldSF, Files_Rider__typ, 20, 1, P); __ENUMR(&OPM_newSF, Files_Rider__typ, 20, 1, P); __ENUMR(OPM_R, Files_Rider__typ, 20, 3, P); @@ -1080,6 +1078,5 @@ export void *OPM__init(void) OPM_MaxLReal = 1.79769296342094e+308; OPM_MinReal = -OPM_MaxReal; OPM_MinLReal = -OPM_MaxLReal; - Texts_OpenWriter(&OPM_W, Texts_Writer__typ); __ENDMOD; } diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index d828881d..91212642 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index a8a90bfc..6a24e3cd 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index 806302cb..3cadf5a4 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index 6cb1973e..898b14b6 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index 04a8a785..34906046 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 8d2305be..a8951123 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index b01bfedc..3a248e3c 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index c90bb72a..77b842f8 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index ae75cd60..34e34ae6 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Out.c b/bootstrap/unix-48/Out.c index 27e1fa94..09fecc76 100644 --- a/bootstrap/unix-48/Out.c +++ b/bootstrap/unix-48/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Out.h b/bootstrap/unix-48/Out.h index 79895677..63fefd3c 100644 --- a/bootstrap/unix-48/Out.h +++ b/bootstrap/unix-48/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index c90c4c43..bc020535 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index bff09b6b..2bbafb50 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 37ba21bb..f7860591 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index 94d22e76..5ed2ec95 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index 17fe28a6..5ae2e44e 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index 6d2e8625..a9d577f6 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index abf1736a..987b9952 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index dd1e65e5..e902469a 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/VT100.c b/bootstrap/unix-48/VT100.c index 6a492f2a..01b8a481 100644 --- a/bootstrap/unix-48/VT100.c +++ b/bootstrap/unix-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/VT100.h b/bootstrap/unix-48/VT100.h index 54e1e753..5ee411dd 100644 --- a/bootstrap/unix-48/VT100.h +++ b/bootstrap/unix-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-48/errors.c b/bootstrap/unix-48/errors.c index 651501a0..b7d411bb 100644 --- a/bootstrap/unix-48/errors.c +++ b/bootstrap/unix-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/errors.h b/bootstrap/unix-48/errors.h index bd6765aa..fa08de1c 100644 --- a/bootstrap/unix-48/errors.h +++ b/bootstrap/unix-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index 23b737c3..74271e5d 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index 124b2154..9b7b3c17 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/Compiler.c b/bootstrap/unix-88/Compiler.c index 5635eb49..87b0392c 100644 --- a/bootstrap/unix-88/Compiler.c +++ b/bootstrap/unix-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index 88e7a4c9..c15b87f9 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index 20f55dce..f169a3b6 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 53e757cf..53ac0902 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -883,19 +883,18 @@ void Files_ReadString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len) void Files_ReadLine (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len) { INT16 i; - CHAR ch; - BOOLEAN b; i = 0; - b = 0; do { - Files_Read(&*R, R__typ, (void*)&ch); - if ((ch == 0x00 || ch == 0x0a) || ch == 0x0d) { - b = 1; - } else { - x[i] = ch; - i += 1; - } - } while (!b); + Files_Read(&*R, R__typ, (void*)&x[i]); + i += 1; + } while (!(x[i - 1] == 0x00 || x[i - 1] == 0x0a)); + if (x[i - 1] == 0x0a) { + i -= 1; + } + if ((i > 0 && x[i - 1] == 0x0d)) { + i -= 1; + } + x[i] = 0x00; } void Files_ReadNum (Files_Rider *R, ADDRESS *R__typ, SYSTEM_BYTE *x, LONGINT x__len) diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 7c86bc8b..3bfefe80 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index 65151d07..806a01db 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index d37b81db..2603a3eb 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 56f6f73e..f463ec4e 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index de306cf5..2da3fa50 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index d272b474..dcac4eb9 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index 880670eb..cb6399f9 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index 1dba2168..9b3d80c3 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index a6816fe2..6cc996c8 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index e077a852..97726a71 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -38,7 +38,6 @@ export CHAR OPM_objname[64]; static INT32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; static Texts_Reader OPM_inR; static Texts_Text OPM_Log; -static Texts_Writer OPM_W; static Files_Rider OPM_oldSF, OPM_newSF; static Files_Rider OPM_R[3]; static Files_File OPM_oldSFile, OPM_newSFile, OPM_HFile, OPM_BFile, OPM_HIFile; @@ -1044,7 +1043,6 @@ static void EnumPtrs(void (*P)(void*)) { __ENUMR(&OPM_inR, Texts_Reader__typ, 72, 1, P); P(OPM_Log); - __ENUMR(&OPM_W, Texts_Writer__typ, 56, 1, P); __ENUMR(&OPM_oldSF, Files_Rider__typ, 24, 1, P); __ENUMR(&OPM_newSF, Files_Rider__typ, 24, 1, P); __ENUMR(OPM_R, Files_Rider__typ, 24, 3, P); @@ -1080,6 +1078,5 @@ export void *OPM__init(void) OPM_MaxLReal = 1.79769296342094e+308; OPM_MinReal = -OPM_MaxReal; OPM_MinLReal = -OPM_MaxLReal; - Texts_OpenWriter(&OPM_W, Texts_Writer__typ); __ENDMOD; } diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index d828881d..91212642 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index 4a47eb31..e3840599 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index 806302cb..3cadf5a4 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index 6cb1973e..898b14b6 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index 04a8a785..34906046 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index 51464c2f..0a7b463e 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index b01bfedc..3a248e3c 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 4eaacd0b..7c411904 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index ae75cd60..34e34ae6 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Out.c b/bootstrap/unix-88/Out.c index 27e1fa94..09fecc76 100644 --- a/bootstrap/unix-88/Out.c +++ b/bootstrap/unix-88/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Out.h b/bootstrap/unix-88/Out.h index 79895677..63fefd3c 100644 --- a/bootstrap/unix-88/Out.h +++ b/bootstrap/unix-88/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 9682a16f..46853757 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index 84628711..ca01598a 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 37ba21bb..f7860591 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index 94d22e76..5ed2ec95 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index 17fe28a6..5ae2e44e 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index 6d2e8625..a9d577f6 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index 38bcde69..3a949175 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index 6ef483f3..216e64dc 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/VT100.c b/bootstrap/unix-88/VT100.c index 6a492f2a..01b8a481 100644 --- a/bootstrap/unix-88/VT100.c +++ b/bootstrap/unix-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/VT100.h b/bootstrap/unix-88/VT100.h index 54e1e753..5ee411dd 100644 --- a/bootstrap/unix-88/VT100.h +++ b/bootstrap/unix-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-88/errors.c b/bootstrap/unix-88/errors.c index 651501a0..b7d411bb 100644 --- a/bootstrap/unix-88/errors.c +++ b/bootstrap/unix-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/errors.h b/bootstrap/unix-88/errors.h index bd6765aa..fa08de1c 100644 --- a/bootstrap/unix-88/errors.h +++ b/bootstrap/unix-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index 23b737c3..74271e5d 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index 124b2154..9b7b3c17 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/Compiler.c b/bootstrap/windows-48/Compiler.c index 5635eb49..87b0392c 100644 --- a/bootstrap/windows-48/Compiler.c +++ b/bootstrap/windows-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index 88e7a4c9..c15b87f9 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index 20f55dce..f169a3b6 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 8f9d4784..1d23fdc4 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -883,19 +883,18 @@ void Files_ReadString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len) void Files_ReadLine (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len) { INT16 i; - CHAR ch; - BOOLEAN b; i = 0; - b = 0; do { - Files_Read(&*R, R__typ, (void*)&ch); - if ((ch == 0x00 || ch == 0x0a) || ch == 0x0d) { - b = 1; - } else { - x[i] = ch; - i += 1; - } - } while (!b); + Files_Read(&*R, R__typ, (void*)&x[i]); + i += 1; + } while (!(x[i - 1] == 0x00 || x[i - 1] == 0x0a)); + if (x[i - 1] == 0x0a) { + i -= 1; + } + if ((i > 0 && x[i - 1] == 0x0d)) { + i -= 1; + } + x[i] = 0x00; } void Files_ReadNum (Files_Rider *R, ADDRESS *R__typ, SYSTEM_BYTE *x, LONGINT x__len) diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index c939154b..38b52f44 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index 8ab8db36..45b45394 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index a7926fd5..8626628d 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index 20b68450..5eddf9be 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index de306cf5..2da3fa50 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index d272b474..dcac4eb9 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index 880670eb..cb6399f9 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 1dba2168..9b3d80c3 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index a6816fe2..6cc996c8 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 4924854d..0ac4141a 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -38,7 +38,6 @@ export CHAR OPM_objname[64]; static INT32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; static Texts_Reader OPM_inR; static Texts_Text OPM_Log; -static Texts_Writer OPM_W; static Files_Rider OPM_oldSF, OPM_newSF; static Files_Rider OPM_R[3]; static Files_File OPM_oldSFile, OPM_newSFile, OPM_HFile, OPM_BFile, OPM_HIFile; @@ -1044,7 +1043,6 @@ static void EnumPtrs(void (*P)(void*)) { __ENUMR(&OPM_inR, Texts_Reader__typ, 48, 1, P); P(OPM_Log); - __ENUMR(&OPM_W, Texts_Writer__typ, 36, 1, P); __ENUMR(&OPM_oldSF, Files_Rider__typ, 20, 1, P); __ENUMR(&OPM_newSF, Files_Rider__typ, 20, 1, P); __ENUMR(OPM_R, Files_Rider__typ, 20, 3, P); @@ -1080,6 +1078,5 @@ export void *OPM__init(void) OPM_MaxLReal = 1.79769296342094e+308; OPM_MinReal = -OPM_MaxReal; OPM_MinLReal = -OPM_MaxLReal; - Texts_OpenWriter(&OPM_W, Texts_Writer__typ); __ENDMOD; } diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index d828881d..91212642 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index a8a90bfc..6a24e3cd 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index 806302cb..3cadf5a4 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index 6cb1973e..898b14b6 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index 04a8a785..34906046 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 8d2305be..a8951123 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index b01bfedc..3a248e3c 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index c90bb72a..77b842f8 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index ae75cd60..34e34ae6 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Out.c b/bootstrap/windows-48/Out.c index bad87929..de6a9e16 100644 --- a/bootstrap/windows-48/Out.c +++ b/bootstrap/windows-48/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Out.h b/bootstrap/windows-48/Out.h index 79895677..63fefd3c 100644 --- a/bootstrap/windows-48/Out.h +++ b/bootstrap/windows-48/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 4a8c3cc0..29801da0 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index d6c32fa3..e96a1eec 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 37ba21bb..f7860591 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index 94d22e76..5ed2ec95 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index 17fe28a6..5ae2e44e 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index 6d2e8625..a9d577f6 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index abf1736a..987b9952 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index dd1e65e5..e902469a 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/VT100.c b/bootstrap/windows-48/VT100.c index 6a492f2a..01b8a481 100644 --- a/bootstrap/windows-48/VT100.c +++ b/bootstrap/windows-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/VT100.h b/bootstrap/windows-48/VT100.h index 54e1e753..5ee411dd 100644 --- a/bootstrap/windows-48/VT100.h +++ b/bootstrap/windows-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-48/errors.c b/bootstrap/windows-48/errors.c index 651501a0..b7d411bb 100644 --- a/bootstrap/windows-48/errors.c +++ b/bootstrap/windows-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/errors.h b/bootstrap/windows-48/errors.h index bd6765aa..fa08de1c 100644 --- a/bootstrap/windows-48/errors.h +++ b/bootstrap/windows-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index 23b737c3..74271e5d 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index 124b2154..9b7b3c17 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/Compiler.c b/bootstrap/windows-88/Compiler.c index 5635eb49..87b0392c 100644 --- a/bootstrap/windows-88/Compiler.c +++ b/bootstrap/windows-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index 88e7a4c9..c15b87f9 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index 20f55dce..f169a3b6 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 683c021e..c519f8d5 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -885,19 +885,18 @@ void Files_ReadString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len) void Files_ReadLine (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len) { INT16 i; - CHAR ch; - BOOLEAN b; i = 0; - b = 0; do { - Files_Read(&*R, R__typ, (void*)&ch); - if ((ch == 0x00 || ch == 0x0a) || ch == 0x0d) { - b = 1; - } else { - x[i] = ch; - i += 1; - } - } while (!b); + Files_Read(&*R, R__typ, (void*)&x[i]); + i += 1; + } while (!(x[i - 1] == 0x00 || x[i - 1] == 0x0a)); + if (x[i - 1] == 0x0a) { + i -= 1; + } + if ((i > 0 && x[i - 1] == 0x0d)) { + i -= 1; + } + x[i] = 0x00; } void Files_ReadNum (Files_Rider *R, ADDRESS *R__typ, SYSTEM_BYTE *x, LONGINT x__len) diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 2bc98b79..376ef83e 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index 65151d07..806a01db 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index d37b81db..2603a3eb 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 56f6f73e..f463ec4e 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index de306cf5..2da3fa50 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index d272b474..dcac4eb9 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index 880670eb..cb6399f9 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index 1dba2168..9b3d80c3 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index a6816fe2..6cc996c8 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index e077a852..97726a71 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -38,7 +38,6 @@ export CHAR OPM_objname[64]; static INT32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; static Texts_Reader OPM_inR; static Texts_Text OPM_Log; -static Texts_Writer OPM_W; static Files_Rider OPM_oldSF, OPM_newSF; static Files_Rider OPM_R[3]; static Files_File OPM_oldSFile, OPM_newSFile, OPM_HFile, OPM_BFile, OPM_HIFile; @@ -1044,7 +1043,6 @@ static void EnumPtrs(void (*P)(void*)) { __ENUMR(&OPM_inR, Texts_Reader__typ, 72, 1, P); P(OPM_Log); - __ENUMR(&OPM_W, Texts_Writer__typ, 56, 1, P); __ENUMR(&OPM_oldSF, Files_Rider__typ, 24, 1, P); __ENUMR(&OPM_newSF, Files_Rider__typ, 24, 1, P); __ENUMR(OPM_R, Files_Rider__typ, 24, 3, P); @@ -1080,6 +1078,5 @@ export void *OPM__init(void) OPM_MaxLReal = 1.79769296342094e+308; OPM_MinReal = -OPM_MaxReal; OPM_MinLReal = -OPM_MaxLReal; - Texts_OpenWriter(&OPM_W, Texts_Writer__typ); __ENDMOD; } diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index d828881d..91212642 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index 4a47eb31..e3840599 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index 806302cb..3cadf5a4 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index 6cb1973e..898b14b6 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index 04a8a785..34906046 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index 51464c2f..0a7b463e 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index b01bfedc..3a248e3c 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 4eaacd0b..7c411904 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index ae75cd60..34e34ae6 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Out.c b/bootstrap/windows-88/Out.c index bad87929..de6a9e16 100644 --- a/bootstrap/windows-88/Out.c +++ b/bootstrap/windows-88/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Out.h b/bootstrap/windows-88/Out.h index 79895677..63fefd3c 100644 --- a/bootstrap/windows-88/Out.h +++ b/bootstrap/windows-88/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index c0d60542..151ed04c 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index e2e65585..e3841844 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 37ba21bb..f7860591 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index 94d22e76..5ed2ec95 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index 17fe28a6..5ae2e44e 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index 6d2e8625..a9d577f6 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index 38bcde69..3a949175 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index 6ef483f3..216e64dc 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/VT100.c b/bootstrap/windows-88/VT100.c index 6a492f2a..01b8a481 100644 --- a/bootstrap/windows-88/VT100.c +++ b/bootstrap/windows-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/VT100.h b/bootstrap/windows-88/VT100.h index 54e1e753..5ee411dd 100644 --- a/bootstrap/windows-88/VT100.h +++ b/bootstrap/windows-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-88/errors.c b/bootstrap/windows-88/errors.c index 651501a0..b7d411bb 100644 --- a/bootstrap/windows-88/errors.c +++ b/bootstrap/windows-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/errors.h b/bootstrap/windows-88/errors.h index bd6765aa..fa08de1c 100644 --- a/bootstrap/windows-88/errors.h +++ b/bootstrap/windows-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index 23b737c3..74271e5d 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index 124b2154..9b7b3c17 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/src/compiler/OPM.Mod b/src/compiler/OPM.Mod index 48337bfc..f765cd2e 100644 --- a/src/compiler/OPM.Mod +++ b/src/compiler/OPM.Mod @@ -112,7 +112,6 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) lasterrpos: LONGINT; inR: Texts.Reader; Log: Texts.Text; - W: Texts.Writer; oldSF, newSF: Files.Rider; R: ARRAY 3 OF Files.Rider; @@ -811,6 +810,4 @@ BEGIN MaxLReal := 1.7976931348623157D307 * 9.999999; (* LONGREAL is 8 bytes, should be 1.7976931348623157D308 *) MinReal := -MaxReal; MinLReal := -MaxLReal; - - Texts.OpenWriter(W); END OPM. diff --git a/src/library/v4/Modules.Mod b/src/library/v4/Modules.Mod deleted file mode 100644 index 46c933f5..00000000 --- a/src/library/v4/Modules.Mod +++ /dev/null @@ -1,96 +0,0 @@ -MODULE Modules; (* jt 6.1.96 *) - - (* access to list of modules and commands, based on ETH Oberon *) - - - IMPORT SYSTEM, Console, Heap; - - CONST - ModNameLen* = 20; - - TYPE - ModuleName* = ARRAY ModNameLen OF CHAR; - Module* = POINTER TO ModuleDesc; - Cmd* = POINTER TO CmdDesc; - ModuleDesc* = RECORD (* cf. SYSTEM.Mod *) - next-: Module; - name-: ModuleName; - refcnt-: LONGINT; - cmds-: Cmd; - types-: LONGINT; - enumPtrs-: PROCEDURE (P: PROCEDURE(p: LONGINT)); - reserved1, reserved2: LONGINT; - END ; - - Command* = PROCEDURE; - - CmdDesc* = RECORD - next-: Cmd; - name-: ARRAY 24 OF CHAR; - cmd-: Command - END ; - - VAR - res*: INTEGER; - resMsg*: ARRAY 256 OF CHAR; - imported*, importing*: ModuleName; - - - PROCEDURE -modules*(): Module - "(Modules_Module)Heap_modules"; - - PROCEDURE -setmodules*(m: Module) - "Heap_modules = m"; - - - PROCEDURE Append(VAR a: ARRAY OF CHAR; b: ARRAY OF CHAR); - VAR i, j: INTEGER; - BEGIN - i := 0; WHILE a[i] # 0X DO INC(i) END; - j := 0; WHILE b[j] # 0X DO a[i] := b[j]; INC(i); INC(j) END; - a[i] := 0X - END Append; - - PROCEDURE ThisMod* (name: ARRAY OF CHAR): Module; - VAR m: Module; bodyname: ARRAY 64 OF CHAR; body: Command; - BEGIN m := modules(); - WHILE (m # NIL) & (m.name # name) DO m := m.next END ; - IF m # NIL THEN res := 0; resMsg := "" - ELSE res := 1; COPY(name, importing); - resMsg := ' module "'; Append(resMsg, name); Append(resMsg, '" not found'); - END ; - RETURN m - END ThisMod; - - PROCEDURE ThisCommand* (mod: Module; name: ARRAY OF CHAR): Command; - VAR c: Cmd; - BEGIN c := mod.cmds; - WHILE (c # NIL) & (c.name # name) DO c := c.next END ; - IF c # NIL THEN res := 0; resMsg := ""; RETURN c.cmd - ELSE res := 2; resMsg := ' command "'; COPY(name, importing); - Append(resMsg, mod.name); Append(resMsg, "."); Append(resMsg, name); Append(resMsg, '" not found'); - RETURN NIL - END - END ThisCommand; - - PROCEDURE Free*(name: ARRAY OF CHAR; all: BOOLEAN); - VAR m, p: Module; - BEGIN m := modules(); - IF all THEN - res := 1; resMsg := 'unloading "all" not yet supported' - ELSE - WHILE (m # NIL) & (m.name # name) DO p := m; m := m.next END ; - IF (m # NIL) & (m.refcnt = 0) THEN - IF m = modules() THEN setmodules(m.next) - ELSE p.next := m.next - END ; - res := 0 - ELSE res := 1; - IF m = NIL THEN resMsg := "module not found" - ELSE resMsg := "clients of this module exist" - END - END - END - END Free; - -END Modules. diff --git a/src/library/v4/Reals.Mod b/src/library/v4/Reals.Mod deleted file mode 100644 index f9e6617b..00000000 --- a/src/library/v4/Reals.Mod +++ /dev/null @@ -1,136 +0,0 @@ -MODULE Reals; - (* JT, 5.2.90 / RC 9.12.91 conversion between reals and strings for HP-700, MB 9.12.91, JT for Ofront, 16.3. 95*) - (* DCWB 20160817 Made independent of INTEGER size *) - - IMPORT SYSTEM; - - PROCEDURE Ten*(e: INTEGER): REAL; - VAR r, power: LONGREAL; - BEGIN r := 1.0; - power := 10.0; - WHILE e > 0 DO - IF ODD(e) THEN r := r * power END ; - power := power * power; e := e DIV 2 - END ; - RETURN SHORT(r) - END Ten; - - - PROCEDURE TenL*(e: INTEGER): LONGREAL; - VAR r, power: LONGREAL; - BEGIN r := 1.0; - power := 10.0; - LOOP - IF ODD(e) THEN r := r * power END ; - e := e DIV 2; - IF e <= 0 THEN RETURN r END ; - power := power * power - END - END TenL; - - - (* Real number format (IEEE 754) - - TYPE REAL - Single precision / binary32: - 1/sign, 8/exponent, 23/significand - - TYPE LONGREAL - Double precision / binary64: - 1/sign, 11/exponent, 52/significand - - exponent: - stored as exponent value + 127. - - significand (fraction): - excludes leading (most significant) bit which is assumed to be 1. - *) - - - PROCEDURE Expo*(x: REAL): INTEGER; - VAR i: INTEGER; - BEGIN - SYSTEM.GET(SYSTEM.ADR(x)+2, i); - RETURN (i DIV 128) MOD 256 - END Expo; - - PROCEDURE SetExpo*(VAR x: REAL; ex: INTEGER); - VAR c: CHAR; - BEGIN - (* Replace exponent bits within top byte of REAL *) - SYSTEM.GET(SYSTEM.ADR(x)+3, c); - SYSTEM.PUT(SYSTEM.ADR(x)+3, CHR(((ORD(c) DIV 128) * 128) + ((ex DIV 2) MOD 128))); - (* Replace exponent bits within 2nd byte of REAL *) - SYSTEM.GET(SYSTEM.ADR(x)+2, c); - SYSTEM.PUT(SYSTEM.ADR(x)+2, CHR((ORD(c) MOD 128) + ((ex MOD 2) * 128))) - END SetExpo; - - PROCEDURE ExpoL*(x: LONGREAL): INTEGER; - VAR i: INTEGER; - BEGIN - SYSTEM.GET(SYSTEM.ADR(x)+6, i); - RETURN (i DIV 16) MOD 2048 - END ExpoL; - - (* Convert LONGREAL: Write positive integer value of x into array d. - The value is stored backwards, i.e. least significant digit - first. n digits are written, with trailing zeros fill. - On entry x has been scaled to the number of digits required. *) - PROCEDURE ConvertL*(x: LONGREAL; n: INTEGER; VAR d: ARRAY OF CHAR); - VAR i, j, k: LONGINT; - BEGIN - IF x < 0 THEN x := -x END; - k := 0; - - IF (SIZE(LONGINT) < 8) & (n > 9) THEN - (* There are more decimal digits than can be held in a single LONGINT *) - i := ENTIER(x / 1000000000.0D0); (* The 10th and higher digits *) - j := ENTIER(x - (i * 1000000000.0D0)); (* The low 9 digits *) - (* First generate the low 9 digits. *) - IF j < 0 THEN j := 0 END; - WHILE k < 9 DO - d[k] := CHR(j MOD 10 + 48); j := j DIV 10; INC(k) - END; - (* Fall through to generate the upper digits *) - ELSE - (* We can generate all the digits in one go. *) - i := ENTIER(x); - END; - - WHILE k < n DO - d[k] := CHR(i MOD 10 + 48); i := i DIV 10; INC(k) - END - END ConvertL; - - - PROCEDURE Convert*(x: REAL; n: INTEGER; VAR d: ARRAY OF CHAR); - BEGIN ConvertL(x, n, d) - END Convert; - - PROCEDURE ToHex(i: INTEGER): CHAR; - BEGIN - IF i < 10 THEN RETURN CHR(i+48) - ELSE RETURN CHR(i+55) END - END ToHex; - - PROCEDURE BytesToHex(VAR b, d: ARRAY OF SYSTEM.BYTE); - VAR i: INTEGER; l: LONGINT; by: CHAR; - BEGIN - i := 0; l := LEN(b); - WHILE i < l DO - by := SYSTEM.VAL(CHAR, b[i]); - d[i*2] := ToHex(ORD(by) DIV 16); - d[i*2+1] := ToHex(ORD(by) MOD 16); - INC(i) - END - END BytesToHex; - - (* Convert Hex *) - PROCEDURE ConvertH*(y: REAL; VAR d: ARRAY OF CHAR); - BEGIN BytesToHex(y, d) - END ConvertH; - - (* Convert Hex Long *) - PROCEDURE ConvertHL*(x: LONGREAL; VAR d: ARRAY OF CHAR); - BEGIN BytesToHex(x, d) - END ConvertHL; - -END Reals. diff --git a/src/library/v4/Strings.Mod b/src/library/v4/Strings.Mod deleted file mode 100644 index e6fe12ac..00000000 --- a/src/library/v4/Strings.Mod +++ /dev/null @@ -1,156 +0,0 @@ -(*------------------------------------------------------------- -Strings provides a set of operations on strings (i.e., on string constants and character -arrays, both of which contain the character 0X as a terminator). All positions in -strings start at 0. -Strings.Length(s) - returns the number of characters in s up to and excluding the first 0X. -Strings.Insert(src, pos, dst) - inserts the string src into the string dst at position pos (0 <= pos <= Length(dst)). - If pos = Length(dst), src is appended to dst. If the size of dst is not large enough - to hold the result of the operation, the result is truncated so that dst is always - terminated with a 0X. -Strings.Append(s, dst) - has the same effect as Insert(s, Length(s), dst). -Strings.Delete(s, pos, n) - deletes n characters from s starting at position pos (0 <= pos < Length(s)). - If n > Length(s) - pos, the new length of s is pos. -Strings.Replace(src, pos, dst) - has the same effect as Delete(dst, pos, Length(src)) followed by an Insert(src, pos, dst). -Strings.Extract(src, pos, n, dst) - extracts a substring dst with n characters from position pos (0 <= pos < Length(src)) in src. - If n > Length(src) - pos, dst is only the part of src from pos to Length(src) - 1. If the size of - dst is not large enough to hold the result of the operation, the result is truncated so that - dst is always terminated with a 0X. -Strings.Pos(pat, s, pos) - returns the position of the first occurrence of pat in s after position pos (inclusive). - If pat is not found, -1 is returned. -Strings.Cap(s) - replaces each lower case letter in s by its upper case equivalent. --------------------------------------------------------------*) -(* added from trianus v4 *) -MODULE Strings; (*HM 94-06-22 / *) - - -PROCEDURE Length* (s: ARRAY OF CHAR): INTEGER; - VAR i: INTEGER; -BEGIN - i := 0; WHILE (i < LEN(s)) & (s[i] # 0X) DO INC(i) END ; - RETURN i -END Length; - - -PROCEDURE Append* (extra: ARRAY OF CHAR; VAR dest: ARRAY OF CHAR); - VAR n1, n2, i: INTEGER; -BEGIN - n1 := Length(dest); n2 := Length(extra); i := 0; - WHILE (i < n2) & (i + n1 < LEN(dest)) DO dest[i + n1] := extra[i]; INC(i) END ; - IF i + n1 < LEN(dest) THEN dest[i + n1] := 0X END -END Append; - - -PROCEDURE Insert* (source: ARRAY OF CHAR; pos: INTEGER; VAR dest: ARRAY OF CHAR); - VAR n1, n2, i: INTEGER; -BEGIN - n1 := Length(dest); n2 := Length(source); - IF pos < 0 THEN pos := 0 END ; - IF pos > n1 THEN Append(dest, source); RETURN END ; - IF pos + n2 < LEN(dest) THEN (*make room for source*) - i := n1; (*move also 0X if it is there*) - WHILE i >= pos DO - IF i + n2 < LEN(dest) THEN dest[i + n2] := dest[i] END ; - DEC(i) - END - END ; - i := 0; WHILE i < n2 DO dest[pos + i] := source[i]; INC(i) END -END Insert; - - -PROCEDURE Delete* (VAR s: ARRAY OF CHAR; pos, n: INTEGER); - VAR len, i: INTEGER; -BEGIN - len:=Length(s); - IF pos < 0 THEN pos:=0 ELSIF pos >= len THEN RETURN END ; - IF pos + n < len THEN - i:=pos + n; WHILE i < len DO s[i - n]:=s[i]; INC(i) END ; - IF i - n < LEN(s) THEN s[i - n]:=0X END - ELSE s[pos]:=0X - END -END Delete; - - -PROCEDURE Replace* (source: ARRAY OF CHAR; pos: INTEGER; VAR dest: ARRAY OF CHAR); -BEGIN - Delete(dest, pos, pos + Length(source)); - Insert(source, pos, dest) -END Replace; - - -PROCEDURE Extract* (source: ARRAY OF CHAR; pos, n: INTEGER; VAR dest: ARRAY OF CHAR); - VAR len, destLen, i: INTEGER; -BEGIN - len := Length(source); destLen := SHORT(LEN(dest)) - 1; - IF pos < 0 THEN pos := 0 END ; - IF pos >= len THEN dest[0] := 0X; RETURN END ; - i := 0; - WHILE (pos + i <= LEN(source)) & (source[pos + i] # 0X) & (i < n) DO - IF i < destLen THEN dest[i] := source[pos + i] END ; - INC(i) - END ; - dest[i] := 0X -END Extract; - - -PROCEDURE Pos* (pattern, s: ARRAY OF CHAR; pos: INTEGER): INTEGER; - VAR n1, n2, i, j: INTEGER; -BEGIN - n1 := Length(s); n2 := Length(pattern); - IF n2 = 0 THEN RETURN 0 END ; - i := pos; - WHILE i <= n1 - n2 DO - IF s[i] = pattern[0] THEN - j := 1; WHILE (j < n2) & (s[i + j] = pattern[j]) DO INC(j) END ; - IF j = n2 THEN RETURN i END - END ; - INC(i) - END ; - RETURN -1 -END Pos; - - -PROCEDURE Cap* (VAR s: ARRAY OF CHAR); - VAR i: INTEGER; -BEGIN - i := 0; - WHILE s[i] # 0X DO - IF ("a" <= s[i]) & (s[i] <= "z") THEN s[i] := CAP(s[i]) END ; - INC(i) - END -END Cap; - - -PROCEDURE Match* (string, pattern: ARRAY OF CHAR): BOOLEAN; - - PROCEDURE M (VAR name, mask: ARRAY OF CHAR; n, m: INTEGER): BOOLEAN; - BEGIN - WHILE (n >= 0) & (m >= 0) & (mask[m] # "*") DO - IF name[n] # mask[m] THEN RETURN FALSE END ; - DEC(n); DEC(m) - END ; - (* ----- name empty | mask empty | mask ends with "*" *) - IF m < 0 THEN RETURN n < 0 END ; - (* ----- name empty | mask ends with "*" *) - WHILE (m >= 0) & (mask[m] = "*") DO DEC(m) END ; - IF m < 0 THEN RETURN TRUE END ; - (* ----- name empty | mask still to be matched *) - WHILE n >= 0 DO - IF M(name, mask, n, m) THEN RETURN TRUE END ; - DEC(n) - END ; - RETURN FALSE - END M; - -BEGIN - RETURN M(string, pattern, Length(string)-1, Length(pattern)-1) -END Match; - -END Strings. diff --git a/src/library/v4/Texts.Mod b/src/library/v4/Texts.Mod deleted file mode 100644 index ecca315d..00000000 --- a/src/library/v4/Texts.Mod +++ /dev/null @@ -1,879 +0,0 @@ -MODULE Texts; (** CAS/HM 23.9.93 -- interface based on Texts by JG/NW 6.12.91**) (* << RC, MB, JT *) - IMPORT - Files, Modules, Reals, SYSTEM; - - (*--- insert field e: Elem into Texts.Scanner and change Texts.Scan to set it in case of class=6 *) - - - CONST - Displaywhite = 15; - ElemChar* = 1CX; - TAB = 9X; CR = 0DX; maxD = 9; - (**FileMsg.id**) - load* = 0; store* = 1; - (**Notifier op**) - replace* = 0; insert* = 1; delete* = 2; unmark* = 3; - (**Scanner.class**) - Inval* = 0; Name* = 1; String* = 2; Int* = 3; Real* = 4; LongReal* = 5; Char* = 6; - - textTag = 0F0X; DocBlockId = 0F7X; version = 01X; - - TYPE - FontsFont = POINTER TO FontDesc; - FontDesc = RECORD - name: ARRAY 32 OF CHAR; - END ; - - Run = POINTER TO RunDesc; - RunDesc = RECORD - prev, next: Run; - len: LONGINT; - fnt: FontsFont; - col, voff: SHORTINT; - ascii: BOOLEAN (* << *) - END; - - Piece = POINTER TO PieceDesc; - PieceDesc = RECORD (RunDesc) - file: Files.File; - org: LONGINT - END; - - Elem* = POINTER TO ElemDesc; - Buffer* = POINTER TO BufDesc; - Text* = POINTER TO TextDesc; - - ElemMsg* = RECORD END; - Handler* = PROCEDURE (e: Elem; VAR msg: ElemMsg); - - ElemDesc* = RECORD (RunDesc) - W*, H*: LONGINT; - handle*: Handler; - base: Text - END; - - FileMsg* = RECORD (ElemMsg) - id*: INTEGER; - pos*: LONGINT; - r*: Files.Rider - END; - - CopyMsg* = RECORD (ElemMsg) - e*: Elem - END; - - IdentifyMsg* = RECORD (ElemMsg) - mod*, proc*: ARRAY 32 OF CHAR - END; - - - BufDesc* = RECORD - len*: LONGINT; - head: Run - END; - - Notifier* = PROCEDURE (T: Text; op: INTEGER; beg, end: LONGINT); - TextDesc* = RECORD - len*: LONGINT; - notify*: Notifier; - head, cache: Run; - corg: LONGINT - END; - - Reader* = RECORD - eot*: BOOLEAN; - fnt*: FontsFont; - col*, voff*: SHORTINT; - elem*: Elem; - rider: Files.Rider; - run: Run; - org, off: LONGINT - END; - - Scanner* = RECORD (Reader) - nextCh*: CHAR; - line*, class*: INTEGER; - i*: LONGINT; - x*: REAL; - y*: LONGREAL; - c*: CHAR; - len*: SHORTINT; - s*: ARRAY 64 OF CHAR (* << *) - END; - - Writer* = RECORD - buf*: Buffer; - fnt*: FontsFont; - col*, voff*: SHORTINT; - rider: Files.Rider; - file: Files.File - END; - - Alien = POINTER TO RECORD (ElemDesc) - file: Files.File; - org, span: LONGINT; - mod, proc: ARRAY 32 OF CHAR - END; - - VAR - new*: Elem; - del: Buffer; - FontsDefault: FontsFont; - - - PROCEDURE FontsThis(VAR name: ARRAY OF CHAR): FontsFont; - VAR F: FontsFont; - BEGIN - NEW(F); COPY(name, F.name); RETURN F - END FontsThis; - - (* run primitives *) - - PROCEDURE Find (T: Text; VAR pos: LONGINT; VAR u: Run; VAR org, off: LONGINT); - VAR v: Run; m: LONGINT; - BEGIN - IF pos >= T.len THEN pos := T.len; u := T.head; org := T.len; off := 0; T.cache := T.head; T.corg := 0 - ELSE v := T.cache.next; m := pos - T.corg; - IF pos >= T.corg THEN - WHILE m >= v.len DO DEC(m, v.len); v := v.next END - ELSE - WHILE m < 0 DO v := v.prev; INC(m, v.len) END; - END; - u := v; org := pos - m; off := m; T.cache := v.prev; T.corg := org - END - END Find; - - PROCEDURE Split (off: LONGINT; VAR u, un: Run); - VAR p, U: Piece; - BEGIN - IF off = 0 THEN un := u; u := un.prev - ELSIF off >= u.len THEN un := u.next - ELSE NEW(p); un := p; U := u(Piece); - p^ := U^; INC(p.org, off); DEC(p.len, off); DEC(U.len, p.len); - p.ascii := u.ascii; p.prev := U; p.next := U.next; p.next.prev := p; U.next := p (* << *) - END - END Split; - - PROCEDURE Merge (T: Text; u: Run; VAR v: Run); - VAR p, q: Piece; - BEGIN - IF (u IS Piece) & (v IS Piece) & (u.fnt.name = v.fnt.name) & (u.col = v.col) & (u.voff = v.voff) - & (u(Piece).ascii = v(Piece).ascii) THEN (* << *) - p := u(Piece); q := v(Piece); - IF (p.file = q.file) & (p.org + p.len = q.org) THEN - IF T.cache = u THEN INC(T.corg, q.len) - ELSIF T.cache = v THEN T.cache := T.head; T.corg := 0 - END; - INC(p.len, q.len); v := v.next - END - END - END Merge; - - PROCEDURE Splice (un, v, w: Run; base: Text); (* (u, un) -> (u, v, w, un) *) - VAR u: Run; - BEGIN - IF v # w.next THEN u := un.prev; - u.next := v; v.prev := u; un.prev := w; w.next := un; - REPEAT - IF v IS Elem THEN v(Elem).base := base END; - v := v.next - UNTIL v = un - END - END Splice; - - PROCEDURE ClonePiece (p: Piece): Piece; - VAR q: Piece; - BEGIN NEW(q); q^ := p^; RETURN q - END ClonePiece; - - PROCEDURE CloneElem (e: Elem): Elem; - VAR msg: CopyMsg; - BEGIN msg.e := NIL; e.handle(e, msg); RETURN msg.e - END CloneElem; - - - (** Elements **) - - PROCEDURE CopyElem* (SE, DE: Elem); - BEGIN DE.len := SE.len; DE.fnt := SE.fnt; DE.col := SE.col; DE.voff := SE.voff; - DE.W := SE.W; DE.H := SE.H; DE.handle := SE.handle - END CopyElem; - - PROCEDURE ElemBase* (E: Elem): Text; - BEGIN RETURN E.base - END ElemBase; - - PROCEDURE ElemPos* (E: Elem): LONGINT; - VAR u: Run; pos: LONGINT; - BEGIN u := E.base.head.next; pos := 0; - WHILE u # E DO pos := pos + u.len; u := u.next END; - RETURN pos - END ElemPos; - - - PROCEDURE HandleAlien (E: Elem; VAR msg: ElemMsg); - VAR e: Alien; r: Files.Rider; i: LONGINT; ch: CHAR; - BEGIN - WITH E: Alien DO - IF msg IS CopyMsg THEN - WITH msg: CopyMsg DO NEW(e); CopyElem(E, e); - e.file := E.file; e.org := E.org; e.span := E.span; e.mod := E.mod; e.proc := E.proc; - msg.e := e - END - ELSIF msg IS IdentifyMsg THEN - WITH msg: IdentifyMsg DO - COPY(E.mod, msg.mod); COPY(E.proc, msg.proc); msg.mod[31] := 1X (*alien*) - END - ELSIF msg IS FileMsg THEN - WITH msg: FileMsg DO - IF msg.id = store THEN Files.Set(r, E.file, E.org); i := E.span; - WHILE i > 0 DO Files.Read(r, ch); Files.Write(msg.r, ch); DEC(i) END - END - END - END - END - END HandleAlien; - - - (** Buffers **) - - PROCEDURE OpenBuf* (B: Buffer); - VAR u: Run; - BEGIN NEW(u); u.next := u; u.prev := u; B.head := u; B.len := 0 - END OpenBuf; - - PROCEDURE Copy* (SB, DB: Buffer); - VAR u, v, vn: Run; - BEGIN u := SB.head.next; v := DB.head.prev; - WHILE u # SB.head DO - IF u IS Piece THEN vn := ClonePiece(u(Piece)) ELSE vn := CloneElem(u(Elem)) END; - v.next := vn; vn.prev := v; v := vn; u := u.next - END; - v.next := DB.head; DB.head.prev := v; - INC(DB.len, SB.len) - END Copy; - - PROCEDURE Recall* (VAR B: Buffer); - BEGIN B := del; del := NIL - END Recall; - - - (** Texts **) - - PROCEDURE Save* (T: Text; beg, end: LONGINT; B: Buffer); - VAR u, v, w, wn: Run; uo, ud, vo, vd: LONGINT; - BEGIN Find(T, beg, u, uo, ud); Find(T, end, v, vo, vd); - w := B.head.prev; - WHILE u # v DO - IF u IS Piece THEN wn := ClonePiece(u(Piece)); DEC(wn.len, ud); INC(wn(Piece).org, ud) - ELSE wn := CloneElem(u(Elem)) - END; - w.next := wn; wn.prev := w; w := wn; u := u.next; ud := 0 - END; - IF vd > 0 THEN (*v IS Piece*) wn := ClonePiece(v(Piece)); wn.len := vd - ud; INC(wn(Piece).org, ud); - w.next := wn; wn.prev := w; w := wn - END; - w.next := B.head; B.head.prev := w; - INC(B.len, end - beg) - END Save; - - PROCEDURE Insert* (T: Text; pos: LONGINT; B: Buffer); - VAR u, un, v: Run; p, q: Piece; uo, ud, len: LONGINT; - BEGIN Find(T, pos, u, uo, ud); Split(ud, u, un); - len := B.len; v := B.head.next; - Merge(T, u, v); Splice(un, v, B.head.prev, T); - INC(T.len, len); B.head.next := B.head; B.head.prev := B.head; B.len := 0; - IF T.notify # NIL THEN T.notify(T, insert, pos, pos+len) END - END Insert; - - PROCEDURE Append* (T: Text; B: Buffer); - VAR v: Run; pos, len: LONGINT; - BEGIN pos := T.len; len := B.len; v := B.head.next; - Merge(T, T.head.prev, v); Splice(T.head, v, B.head.prev, T); - INC(T.len, len); B.head.next := B.head; B.head.prev := B.head; B.len := 0; - IF T.notify # NIL THEN T.notify(T, insert, pos, pos+len) END - END Append; - - PROCEDURE Delete* (T: Text; beg, end: LONGINT); - VAR c, u, un, v, vn: Run; co, uo, ud, vo, vd: LONGINT; - BEGIN - Find(T, beg, u, uo, ud); Split(ud, u, un); c := T.cache; co := T.corg; - Find(T, end, v, vo, vd); Split(vd, v, vn); T.cache := c; T.corg := co; - NEW(del); OpenBuf(del); del.len := end - beg; - Splice(del.head, un, v, NIL); - Merge(T, u, vn); u.next := vn; vn.prev := u; - DEC(T.len, end - beg); - IF T.notify # NIL THEN T.notify(T, delete, beg, end) END - END Delete; - - PROCEDURE ChangeLooks* (T: Text; beg, end: LONGINT; sel: SET; fnt: FontsFont; col, voff: SHORTINT); - VAR c, u, un, v, vn: Run; co, uo, ud, vo, vd: LONGINT; - BEGIN Find(T, beg, u, uo, ud); Split(ud, u, un); c := T.cache; co := T.corg; - Find(T, end, v, vo, vd); Split(vd, v, vn); T.cache := c; T.corg := co; - WHILE un # vn DO - IF (0 IN sel) & (fnt # NIL) THEN un.fnt := fnt END; - IF 1 IN sel THEN un.col := col END; - IF 2 IN sel THEN un.voff := voff END; - Merge(T, u, un); - IF u.next = un THEN u := un; un := un.next ELSE u.next := un; un.prev := u END - END; - Merge(T, u, un); u.next := un; un.prev := u; - IF T.notify # NIL THEN T.notify(T, replace, beg, end) END - END ChangeLooks; - - - (** Readers **) - - PROCEDURE OpenReader* (VAR R: Reader; T: Text; pos: LONGINT); - VAR u: Run; - BEGIN - IF pos >= T.len THEN pos := T.len END; - Find(T, pos, u, R.org, R.off); R.run := u; R.eot := FALSE; - IF u IS Piece THEN - Files.Set(R.rider, u(Piece).file, u(Piece).org + R.off) - END - END OpenReader; - - PROCEDURE Read* (VAR R: Reader; VAR ch: CHAR); - VAR u: Run; pos: LONGINT; nextch: CHAR; - BEGIN u := R.run; R.fnt := u.fnt; R.col := u.col; R.voff := u.voff; INC(R.off); - IF u IS Piece THEN Files.Read(R.rider, ch); R.elem := NIL; - IF (ch = 0AX) & u(Piece).ascii THEN ch := CR (* << LF to CR *) - ELSIF (ch = CR) & u(Piece).ascii THEN (* << CR LF to CR *) - pos := Files.Pos(R.rider); Files.Read(R.rider, nextch); - IF nextch = 0AX THEN INC(R.off) ELSE Files.Set(R.rider, u(Piece).file, pos) END - END - ELSIF u IS Elem THEN ch := ElemChar; R.elem := u(Elem) - ELSE ch := 0X; R.elem := NIL; R.eot := TRUE - END; - IF R.off = u.len THEN INC(R.org, u.len); u := u.next; - IF u IS Piece THEN - WITH u: Piece DO Files.Set(R.rider, u.file, u.org) END - END; - R.run := u; R.off := 0 - END - END Read; - - PROCEDURE ReadElem* (VAR R: Reader); - VAR u, un: Run; - BEGIN u := R.run; - WHILE u IS Piece DO INC(R.org, u.len); u := u.next END; - IF u IS Elem THEN un := u.next; R.run := un; INC(R.org); R.off := 0; - R.fnt := u.fnt; R.col := u.col; R.voff := u.voff; R.elem := u(Elem); - IF un IS Piece THEN - WITH un: Piece DO Files.Set(R.rider, un.file, un.org) END - END - ELSE R.eot := TRUE; R.elem := NIL - END - END ReadElem; - - PROCEDURE ReadPrevElem* (VAR R: Reader); - VAR u: Run; - BEGIN u := R.run.prev; - WHILE u IS Piece DO DEC(R.org, u.len); u := u.prev END; - IF u IS Elem THEN R.run := u; DEC(R.org); R.off := 0; - R.fnt := u.fnt; R.col := u.col; R.voff := u.voff; R.elem := u(Elem) - ELSE R.eot := TRUE; R.elem := NIL - END - END ReadPrevElem; - - PROCEDURE Pos* (VAR R: Reader): LONGINT; - BEGIN RETURN R.org + R.off - END Pos; - - - (** Scanners --------------- NW --------------- **) - - PROCEDURE OpenScanner* (VAR S: Scanner; T: Text; pos: LONGINT); - BEGIN OpenReader(S, T, pos); S.line := 0; S.nextCh := " " - END OpenScanner; - - (*IEEE floating point formats: - x = 2^(e-127) * 1.m bit 0: sign, bits 1- 8: e, bits 9-31: m - x = 2^(e-1023) * 1.m bit 0: sign, bits 1-11: e, bits 12-63: m *) - - PROCEDURE Scan* (VAR S: Scanner); - CONST maxD = 32; - VAR ch, term: CHAR; - neg, negE, hex: BOOLEAN; - i, j, h: SHORTINT; - e: INTEGER; k: LONGINT; - x, f: REAL; y, g: LONGREAL; - d: ARRAY maxD OF CHAR; - - PROCEDURE ReadScaleFactor; - BEGIN Read(S, ch); - IF ch = "-" THEN negE := TRUE; Read(S, ch) - ELSE negE := FALSE; - IF ch = "+" THEN Read(S, ch) END - END; - WHILE ("0" <= ch) & (ch <= "9") DO - e := e*10 + ORD(ch) - 30H; Read(S, ch) - END - END ReadScaleFactor; - - BEGIN ch := S.nextCh; i := 0; - LOOP - IF ch = CR THEN INC(S.line) - ELSIF (ch # " ") & (ch # TAB) THEN EXIT - END ; - Read(S, ch) - END; - IF ("A" <= CAP(ch)) & (CAP(ch) <= "Z") OR (ch = "/") OR (ch = ".") THEN (*name*) (* << *) - REPEAT S.s[i] := ch; INC(i); Read(S, ch) - UNTIL (CAP(ch) > "Z") & (ch # "_") (* << *) - OR ("A" > CAP(ch)) & (ch > "9") - OR ("0" > ch) & (ch # ".") & (ch # "/") (* << *) - OR (i = 63); (* << *) - S.s[i] := 0X; S.len := i; S.class := 1 - ELSIF ch = 22X THEN (*literal string*) - Read(S, ch); - WHILE (ch # 22X) & (ch >= " ") & (i # 63) DO (* << *) - S.s[i] := ch; INC(i); Read(S, ch) - END; - S.s[i] := 0X; S.len := i+1; Read(S, ch); S.class := 2 - ELSE - IF ch = "-" THEN neg := TRUE; Read(S, ch) ELSE neg := FALSE END ; - IF ("0" <= ch) & (ch <= "9") THEN (*number*) - hex := FALSE; j := 0; - LOOP d[i] := ch; INC(i); Read(S, ch); - IF ch < "0" THEN EXIT END; - IF "9" < ch THEN - IF ("A" <= ch) & (ch <= "F") THEN hex := TRUE; ch := CHR(ORD(ch)-7) - ELSIF ("a" <= ch) & (ch <= "f") THEN hex := TRUE; ch := CHR(ORD(ch)-27H) - ELSE EXIT - END - END - END; - IF ch = "H" THEN (*hex number*) - Read(S, ch); S.class := 3; - IF i-j > 8 THEN j := i-8 END ; - k := ORD(d[j]) - 30H; INC(j); - IF (i-j = 7) & (k >= 8) THEN DEC(k, 16) END ; - WHILE j < i DO k := k*10H + (ORD(d[j]) - 30H); INC(j) END ; - IF neg THEN S.i := -k ELSE S.i := k END - ELSIF ch = "." THEN (*read real*) - Read(S, ch); h := i; - WHILE ("0" <= ch) & (ch <= "9") DO d[i] := ch; INC(i); Read(S, ch) END ; - IF ch = "D" THEN - e := 0; y := 0; g := 1; - REPEAT y := y*10 + (ORD(d[j]) - 30H); INC(j) UNTIL j = h; - WHILE j < i DO g := g/10; y := (ORD(d[j]) - 30H)*g + y; INC(j) END ; - ReadScaleFactor; - IF negE THEN - IF e <= 308 THEN y := y / Reals.TenL(e) ELSE y := 0 END - ELSIF e > 0 THEN - IF e <= 308 THEN y := Reals.TenL(e) * y ELSE HALT(40) END - END ; - IF neg THEN y := -y END ; - S.class := 5; S.y := y - ELSE e := 0; x := 0; f := 1; - REPEAT x := x*10 + (ORD(d[j]) - 30H); INC(j) UNTIL j = h; - WHILE j < i DO f := f/10; x := (ORD(d[j])-30H)*f + x; INC(j) END; - IF ch = "E" THEN ReadScaleFactor END ; - IF negE THEN - IF e <= 38 THEN x := x / Reals.Ten(e) ELSE x := 0 END - ELSIF e > 0 THEN - IF e <= 38 THEN x := Reals.Ten(e) * x ELSE HALT(40) END - END ; - IF neg THEN x := -x END ; - S.class := 4; S.x := x - END ; - IF hex THEN S.class := 0 END - ELSE (*decimal integer*) - S.class := 3; k := 0; - REPEAT k := k*10 + (ORD(d[j]) - 30H); INC(j) UNTIL j = i; - IF neg THEN S.i := -k ELSE S.i := k END; - IF hex THEN S.class := 0 ELSE S.class := 3 END - END - ELSE S.class := 6; - IF neg THEN S.c := "-" ELSE S.c := ch; Read(S, ch) END - END - END; - S.nextCh := ch - END Scan; - - - (** Writers **) - - PROCEDURE OpenWriter* (VAR W: Writer); - BEGIN NEW(W.buf); OpenBuf(W.buf); - W.fnt := FontsDefault; W.col := Displaywhite; W.voff := 0; - W.file := Files.New(""); Files.Set(W.rider, W.file, 0) - END OpenWriter; - - PROCEDURE SetFont* (VAR W: Writer; fnt: FontsFont); - BEGIN W.fnt := fnt - END SetFont; - - PROCEDURE SetColor* (VAR W: Writer; col: SHORTINT); - BEGIN W.col := col - END SetColor; - - PROCEDURE SetOffset* (VAR W: Writer; voff: SHORTINT); - BEGIN W.voff := voff - END SetOffset; - - - PROCEDURE Write* (VAR W: Writer; ch: CHAR); - VAR u, un: Run; p: Piece; - BEGIN Files.Write(W.rider, ch); INC(W.buf.len); un := W.buf.head; u := un.prev; - IF (u IS Piece) & (u(Piece).file = W.file) & (u.fnt.name = W.fnt.name) & (u.col = W.col) & (u.voff = W.voff) - & ~u(Piece).ascii THEN (* << *) - INC(u.len) - ELSE NEW(p); u.next := p; p.prev := u; p.next := un; un.prev := p; - p.len := 1; p.fnt := W.fnt; p.col := W.col; p.voff := W.voff; - p.file := W.file; p.org := Files.Length(W.file) - 1; p.ascii := FALSE (* << *) - END - END Write; - - PROCEDURE WriteElem* (VAR W: Writer; e: Elem); - VAR u, un: Run; - BEGIN - IF e.base # NIL THEN HALT(99) END; - INC(W.buf.len); e.len := 1; e.fnt := W.fnt; e.col := W.col; e.voff := W.voff; - un := W.buf.head; u := un.prev; u.next := e; e.prev := u; e.next := un; un.prev := e - END WriteElem; - - PROCEDURE WriteLn* (VAR W: Writer); - BEGIN Write(W, CR) - END WriteLn; - - PROCEDURE WriteString* (VAR W: Writer; s: ARRAY OF CHAR); - VAR i: INTEGER; - BEGIN i := 0; - WHILE s[i] >= " " DO Write(W, s[i]); INC(i) END - END WriteString; - - PROCEDURE WriteInt* (VAR W: Writer; x, n: SYSTEM.INT64); - VAR - i: INTEGER; x0: SYSTEM.INT64; - a: ARRAY 24 OF CHAR; - BEGIN i := 0; - IF x < 0 THEN - IF x = MIN(SYSTEM.INT64) THEN WriteString(W, " -9223372036854775808"); RETURN - ELSE DEC(n); x0 := -x - END - ELSE x0 := x - END; - REPEAT - a[i] := CHR(x0 MOD 10 + 30H); x0 := x0 DIV 10; INC(i) - UNTIL x0 = 0; - WHILE n > i DO Write(W, " "); DEC(n) END; - IF x < 0 THEN Write(W, "-") END; - REPEAT DEC(i); Write(W, a[i]) UNTIL i = 0 - END WriteInt; - - PROCEDURE WriteHex* (VAR W: Writer; x: LONGINT); - VAR i: INTEGER; y: LONGINT; - a: ARRAY 20 OF CHAR; - BEGIN i := 0; Write(W, " "); - REPEAT y := x MOD 10H; - IF y < 10 THEN a[i] := CHR(y + 30H) ELSE a[i] := CHR(y + 37H) END; - x := x DIV 10H; INC(i) - UNTIL i = 8; - REPEAT DEC(i); Write(W, a[i]) UNTIL i = 0 - END WriteHex; - - PROCEDURE WriteReal* (VAR W: Writer; x: REAL; n: INTEGER); - VAR e: INTEGER; x0: REAL; - d: ARRAY maxD OF CHAR; - BEGIN e := Reals.Expo(x); - IF e = 0 THEN - WriteString(W, " 0"); - REPEAT Write(W, " "); DEC(n) UNTIL n <= 3 - ELSIF e = 255 THEN - WriteString(W, " NaN"); - WHILE n > 4 DO Write(W, " "); DEC(n) END - ELSE - IF n <= 9 THEN n := 3 ELSE DEC(n, 6) END; - REPEAT Write(W, " "); DEC(n) UNTIL n <= 8; - (*there are 2 < n <= 8 digits to be written*) - IF x < 0.0 THEN Write(W, "-"); x := -x ELSE Write(W, " ") END; - e := (e - 127) * 77 DIV 256; - IF e >= 0 THEN x := x / Reals.Ten(e) ELSE x := Reals.Ten(-e) * x END; - IF x >= 10.0 THEN x := 0.1*x; INC(e) END; - x0 := Reals.Ten(n-1); x := x0*x + 0.5; - IF x >= 10.0*x0 THEN x := x*0.1; INC(e) END; - Reals.Convert(x, n, d); - DEC(n); Write(W, d[n]); Write(W, "."); - REPEAT DEC(n); Write(W, d[n]) UNTIL n = 0; - Write(W, "E"); - IF e < 0 THEN Write(W, "-"); e := -e ELSE Write(W, "+") END; - Write(W, CHR(e DIV 10 + 30H)); Write(W, CHR(e MOD 10 + 30H)) - END - END WriteReal; - - PROCEDURE WriteRealFix* (VAR W: Writer; x: REAL; n, k: INTEGER); - VAR e, i: INTEGER; sign: CHAR; x0: REAL; - d: ARRAY maxD OF CHAR; - - PROCEDURE seq(ch: CHAR; n: INTEGER); - BEGIN WHILE n > 0 DO Write(W, ch); DEC(n) END - END seq; - - PROCEDURE dig(n: INTEGER); - BEGIN - WHILE n > 0 DO - DEC(i); Write(W, d[i]); DEC(n) - END - END dig; - - BEGIN e := Reals.Expo(x); - IF k < 0 THEN k := 0 END; - IF e = 0 THEN seq(" ", n-k-2); Write(W, "0"); seq(" ", k+1) - ELSIF e = 255 THEN WriteString(W, " NaN"); seq(" ", n-4) - ELSE e := (e - 127) * 77 DIV 256; - IF x < 0 THEN sign := "-"; x := -x ELSE sign := " " END; - IF e >= 0 THEN (*x >= 1.0, 77/256 = log 2*) x := x/Reals.Ten(e) - ELSE (*x < 1.0*) x := Reals.Ten(-e) * x - END; - IF x >= 10.0 THEN x := 0.1*x; INC(e) END; - (* 1 <= x < 10 *) - IF k+e >= maxD-1 THEN k := maxD-1-e - ELSIF k+e < 0 THEN k := -e; x := 0.0 - END; - x0 := Reals.Ten(k+e); x := x0*x + 0.5; - IF x >= 10.0*x0 THEN INC(e) END; - (*e = no. of digits before decimal point*) - INC(e); i := k+e; Reals.Convert(x, i, d); - IF e > 0 THEN - seq(" ", n-e-k-2); Write(W, sign); dig(e); - Write(W, "."); dig(k) - ELSE seq(" ", n-k-3); - Write(W, sign); Write(W, "0"); Write(W, "."); - seq("0", -e); dig(k+e) - END - END - END WriteRealFix; - - PROCEDURE WriteRealHex* (VAR W: Writer; x: REAL); - VAR i: INTEGER; - d: ARRAY 8 OF CHAR; - BEGIN Reals.ConvertH(x, d); i := 0; - REPEAT Write(W, d[i]); INC(i) UNTIL i = 8 - END WriteRealHex; - - PROCEDURE WriteLongReal* (VAR W: Writer; x: LONGREAL; n: INTEGER); - CONST maxD = 16; - VAR e: INTEGER; x0: LONGREAL; - d: ARRAY maxD OF CHAR; - BEGIN e := Reals.ExpoL(x); - IF e = 0 THEN - WriteString(W, " 0"); - REPEAT Write(W, " "); DEC(n) UNTIL n <= 3 - ELSIF e = 2047 THEN - WriteString(W, " NaN"); - WHILE n > 4 DO Write(W, " "); DEC(n) END - ELSE - IF n <= 10 THEN n := 3 ELSE DEC(n, 7) END; - REPEAT Write(W, " "); DEC(n) UNTIL n <= maxD; - (*there are 2 <= n <= maxD digits to be written*) - IF x < 0 THEN Write(W, "-"); x := -x ELSE Write(W, " ") END; - - (* Scale e to be an exponent of 10 rather than 2 *) - e := SHORT(LONG(e - 1023) * 77 DIV 256); - IF e >= 0 THEN x := x / Reals.TenL(e) ELSE x := Reals.TenL(-e) * x END ; - IF x >= 10.0D0 THEN x := 0.1D0 * x; INC(e) END; - - (* Scale x to the number of digits requested *) - x0 := Reals.TenL(n-1); x := x0*x + 0.5D0; - IF x >= 10.0D0*x0 THEN x := 0.1D0 * x; INC(e) END ; - - (* Generate the mantissa digits of x *) - Reals.ConvertL(x, n, d); - - DEC(n); Write(W, d[n]); Write(W, "."); - REPEAT DEC(n); Write(W, d[n]) UNTIL n = 0; - - Write(W, "D"); - IF e < 0 THEN Write(W, "-"); e := -e ELSE Write(W, "+") END; - Write(W, CHR(e DIV 100 + 30H)); e := e MOD 100; - Write(W, CHR(e DIV 10 + 30H)); - Write(W, CHR(e MOD 10 + 30H)) - END - END WriteLongReal; - - PROCEDURE WriteLongRealHex* (VAR W: Writer; x: LONGREAL); - VAR i: INTEGER; - d: ARRAY 16 OF CHAR; - BEGIN Reals.ConvertHL(x, d); i := 0; - REPEAT Write(W, d[i]); INC(i) UNTIL i = 16 - END WriteLongRealHex; - - PROCEDURE WriteDate* (VAR W: Writer; t, d: LONGINT); - - PROCEDURE WritePair(ch: CHAR; x: LONGINT); - BEGIN Write(W, ch); - Write(W, CHR(x DIV 10 + 30H)); Write(W, CHR(x MOD 10 + 30H)) - END WritePair; - - BEGIN - WritePair(" ", d MOD 32); WritePair(".", d DIV 32 MOD 16); WritePair(".", d DIV 512 MOD 128); - WritePair(" ", t DIV 4096 MOD 32); WritePair(":", t DIV 64 MOD 64); WritePair(":", t MOD 64) - END WriteDate; - - - (** Text Filing **) - - PROCEDURE Load0 (VAR r: Files.Rider; T: Text); - VAR u, un: Run; p: Piece; e: Elem; - org, pos, hlen, plen: LONGINT; ecnt, fno, fcnt, col, voff: SHORTINT; - f: Files.File; - msg: FileMsg; - mods, procs: ARRAY 64, 32 OF CHAR; - name: ARRAY 32 OF CHAR; - fnts: ARRAY 32 OF FontsFont; - - PROCEDURE LoadElem (VAR r: Files.Rider; pos, span: LONGINT; VAR e: Elem); - VAR M: Modules.Module; Cmd: Modules.Command; a: Alien; - org, ew, eh: LONGINT; eno: SHORTINT; - BEGIN new := NIL; - Files.ReadLInt(r, ew); Files.ReadLInt(r, eh); Files.Read(r, eno); - IF eno > ecnt THEN ecnt := eno; Files.ReadString(r, mods[eno]); Files.ReadString(r, procs[eno]) END; - org := Files.Pos(r); M := Modules.ThisMod(mods[eno]); - IF M # NIL THEN Cmd := Modules.ThisCommand(M, procs[eno]); - IF Cmd # NIL THEN Cmd END - END; - e := new; - IF e # NIL THEN e.W := ew; e.H := eh; e.base := T; - msg.pos := pos; e.handle(e, msg); - IF Files.Pos(r) # org + span THEN e := NIL END - END; - IF e = NIL THEN Files.Set(r, f, org + span); - NEW(a); a.W := ew; a.H := eh; a.handle := HandleAlien; a.base := T; - a.file := f; a.org := org; a.span := span; - COPY(mods[eno], a.mod); COPY(procs[eno], a.proc); - e := a - END - END LoadElem; - - BEGIN pos := Files.Pos(r); f := Files.Base(r); - NEW(u); u.len := MAX(LONGINT); (*u.fnt := FontsDefault;*)u.fnt := NIL; u.col := Displaywhite; - T.head := u; ecnt := 0; fcnt := 0; - msg.id := load; msg.r := r; - Files.ReadLInt(msg.r, hlen); (*!!!org := pos + hlen;*) org := pos -2 + hlen; pos := org; Files.Read(msg.r, fno); - WHILE fno # 0 DO - IF fno > fcnt THEN fcnt := fno; Files.ReadString(msg.r, name); fnts[fno] := FontsThis(name) END; - Files.Read(msg.r, col); Files.Read(msg.r, voff); Files.ReadLInt(msg.r, plen); - IF plen > 0 THEN NEW(p); p.file := f; p.org := pos; p.ascii := FALSE; un := p; un.len := plen - ELSE LoadElem(msg.r, pos - org, -plen, e); un := e; un.len := 1 - END; - (*un.fnt := fnts[fno];*) un.col := col; un.voff := voff; - INC(pos, un.len); u.next := un; un.prev := u; u := un; Files.Read(msg.r, fno) - END; - u.next := T.head; T.head.prev := u; T.cache := T.head; T.corg := 0; - Files.ReadLInt(msg.r, T.len); Files.Set(r, f, Files.Pos(msg.r) + T.len) - END Load0; - - PROCEDURE Load* (VAR r: Files.Rider; T: Text); - CONST oldTag = -4095; - VAR tag: INTEGER; - BEGIN - (* for compatibility inner text tags are checked and skipped; remove this in a later version *) - Files.ReadInt(r, tag); IF tag # oldTag THEN Files.Set(r, Files.Base(r), Files.Pos(r)-2) END; - Load0(r, T) - END Load; - - PROCEDURE Open* (T: Text; name: ARRAY OF CHAR); - VAR f: Files.File; r: Files.Rider; u: Run; p: Piece; tag, version: CHAR; hlen: LONGINT; - BEGIN f := Files.Old(name); - IF f = NIL THEN f := Files.New("") END; - Files.Set(r, f, 0); Files.Read(r, tag); Files.Read(r, version); - IF (tag = textTag) OR (tag = 01X) & (version = textTag) THEN Load0(r, T) - ELSE (*ascii*) - NEW(u); u.len := MAX(LONGINT); u.fnt := NIL; u.col := Displaywhite; - NEW(p); - IF (tag = DocBlockId) & (version = 07X) THEN (* extract ascii text from System 3 text document *) - Files.Set(r, f, 28); Files.ReadLInt(r, hlen); - Files.Set(r, f, 22 + hlen); Files.ReadLInt(r, T.len); p.org := 26 + hlen - ELSE - T.len := Files.Length(f); p.org := 0 - END ; - IF T.len > 0 THEN p.len := T.len; p.fnt := FontsDefault; - p.col := Displaywhite; p.voff := 0; p.file := f; p.ascii := TRUE; - u.next := p; u.prev := p; p.next := u; p.prev := u - ELSE u.next := u; u.prev := u - END; - T.head := u; T.cache := T.head; T.corg := 0 - END - END Open; - - PROCEDURE Store* (VAR r: Files.Rider; T: Text); - VAR r1: Files.Rider; u, un: Run; e: Elem; org, pos, delta, hlen, rlen: LONGINT; ecnt, fno, fcnt: SHORTINT; ch: CHAR; (* << *) - msg: FileMsg; iden: IdentifyMsg; - mods, procs: ARRAY 64, 32 OF CHAR; - fnts: ARRAY 32 OF FontsFont; - block: ARRAY 1024 OF CHAR; - - PROCEDURE StoreElem (VAR r: Files.Rider; pos: LONGINT; e: Elem); - VAR r1: Files.Rider; org, span: LONGINT; eno: SHORTINT; - BEGIN COPY(iden.mod, mods[ecnt]); COPY(iden.proc, procs[ecnt]); eno := 1; - WHILE (mods[eno] # iden.mod) OR (procs[eno] # iden.proc) DO INC(eno) END; - Files.Set(r1, Files.Base(r), Files.Pos(r)); - Files.WriteLInt(r, 0); Files.WriteLInt(r, 0); Files.WriteLInt(r, 0); (*fixup slot*) - Files.Write(r, eno); - IF eno = ecnt THEN INC(ecnt); Files.WriteString(r, iden.mod); Files.WriteString(r, iden.proc) END; - msg.pos := pos; org := Files.Pos(r); e.handle(e, msg); span := Files.Pos(r) - org; - Files.WriteLInt(r1, -span); Files.WriteLInt(r1, e.W); Files.WriteLInt(r1, e.H) (*fixup*) - END StoreElem; - - BEGIN - org := Files.Pos(r); msg.id := store; msg.r := r; Files.WriteLInt(msg.r, 0); (*fixup slot*) - u := T.head.next; pos := 0; delta := 0; fcnt := 1; ecnt := 1; - WHILE u # T.head DO - IF u IS Elem THEN iden.mod[0] := 0X; u(Elem).handle(u(Elem), iden) ELSE iden.mod[0] := 1X END; - IF iden.mod[0] # 0X THEN - fnts[fcnt] := u.fnt; fno := 1; - WHILE fnts[fno].name # u.fnt.name DO INC(fno) END; - Files.Write(msg.r, fno); - IF fno = fcnt THEN INC(fcnt); Files.WriteString(msg.r, u.fnt.name) END; - Files.Write(msg.r, u.col); Files.Write(msg.r, u.voff) - END; - IF u IS Piece THEN rlen := u.len; un := u.next; - WHILE (un IS Piece) & (un.fnt = u.fnt) & (un.col = u.col) & (un.voff = u.voff) DO - INC(rlen, un.len); un := un.next - END; - Files.WriteLInt(msg.r, rlen); INC(pos, rlen); u := un - ELSIF iden.mod[0] # 0X THEN StoreElem(msg.r, pos, u(Elem)); INC(pos); u := u.next - ELSE INC(delta); u := u.next - END - END; - Files.Write(msg.r, 0); Files.WriteLInt(msg.r, T.len - delta); - (*!!!hlen := Files.Pos(msg.r) - org;*) hlen := Files.Pos(msg.r) - org + 2; - Files.Set(r1, Files.Base(msg.r), org); Files.WriteLInt(r1, hlen); (*fixup*) - u := T.head.next; - WHILE u # T.head DO - IF u IS Piece THEN - WITH u: Piece DO - IF u.ascii THEN Files.Set(r1, u.file, u.org); delta := u.len; (* << LF to CR *) - WHILE delta > 0 DO Files.Read(r1, ch); DEC(delta); - IF ch = 0AX THEN Files.Write(msg.r, CR) ELSE Files.Write(msg.r, ch) END - END - ELSE Files.Set(r1, u.file, u.org); delta := u.len; - WHILE delta > LEN(block) DO Files.ReadBytes(r1, block, LEN(block)); - Files.WriteBytes(msg.r, block, LEN(block)); DEC(delta, LEN(block)) - END; - Files.ReadBytes(r1, block, delta); Files.WriteBytes(msg.r, block, delta) - END - END - ELSE iden.mod[0] := 0X; u(Elem).handle(u(Elem), iden); - IF iden.mod[0] # 0X THEN Files.Write(msg.r, ElemChar) END - END; - u := u.next - END; - r := msg.r; - IF T.notify # NIL THEN T.notify(T, unmark, 0, 0) END - END Store; - - PROCEDURE Close* (T: Text; name: ARRAY OF CHAR); - VAR f: Files.File; r: Files.Rider; i, res: INTEGER; bak: ARRAY 64 OF CHAR; - BEGIN - f := Files.New(name); Files.Set(r, f, 0); Files.Write(r, textTag); Files.Write(r, version); Store(r, T); - i := 0; WHILE name[i] # 0X DO INC(i) END; - COPY(name, bak); bak[i] := "."; bak[i+1] := "B"; bak[i+2] := "a"; bak[i+3] := "k"; bak[i+4] := 0X; - Files.Rename(name, bak, res); Files.Register(f) - END Close; - -BEGIN del := NIL; NEW(FontsDefault); FontsDefault.name := "Syntax10.Scn.Fnt" -END Texts. diff --git a/src/runtime/Files.Mod b/src/runtime/Files.Mod index 40307644..841c5c41 100644 --- a/src/runtime/Files.Mod +++ b/src/runtime/Files.Mod @@ -642,19 +642,12 @@ Especially Length would become fairly complex. END ReadString; PROCEDURE ReadLine* (VAR R: Rider; VAR x: ARRAY OF CHAR); - VAR i: INTEGER; ch: CHAR; b : BOOLEAN; + VAR i: INTEGER; BEGIN - i := 0; - b := FALSE; - REPEAT - Read(R, ch); - IF ((ch = 0X) OR (ch = 0AX) OR (ch = 0DX)) THEN - b := TRUE - ELSE - x[i] := ch; - INC(i); - END; - UNTIL b + i := 0; REPEAT Read(R, x[i]); INC(i) UNTIL (x[i-1] = 0X) OR (x[i-1] = 0AX); + IF x[i-1] = 0AX THEN DEC(i) END; (* Omit trailing LF *) + IF (i > 0) & (x[i-1] = 0DX) THEN DEC(i) END; (* Also omit preceeding trailing CR if present. *) + x[i] := 0X; (* Guarantee zero termination. *) END ReadLine; PROCEDURE ReadNum*(VAR R: Rider; VAR x: ARRAY OF SYSTEM.BYTE); From 716240bdd627f81f728431d188857ba1e54a7ba3 Mon Sep 17 00:00:00 2001 From: David Brown Date: Sat, 12 Nov 2016 10:20:50 +0000 Subject: [PATCH 317/580] Simplify runtime error reporting and move to platform common source. --- bootstrap/SYSTEM.h | 8 +- bootstrap/unix-44/Compiler.c | 4 +- bootstrap/unix-44/Configuration.c | 4 +- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Files.c | 2 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 6 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 126 +++++++++++++++++++++++- bootstrap/unix-44/Modules.h | 6 +- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 2 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 2 +- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 2 +- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 2 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Out.c | 2 +- bootstrap/unix-44/Out.h | 2 +- bootstrap/unix-44/Platform.c | 137 +-------------------------- bootstrap/unix-44/Platform.h | 11 +-- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/VT100.c | 2 +- bootstrap/unix-44/VT100.h | 2 +- bootstrap/unix-44/errors.c | 2 +- bootstrap/unix-44/errors.h | 2 +- bootstrap/unix-44/extTools.c | 8 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-48/Compiler.c | 4 +- bootstrap/unix-48/Configuration.c | 4 +- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Files.c | 2 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 6 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 126 +++++++++++++++++++++++- bootstrap/unix-48/Modules.h | 6 +- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 2 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 2 +- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 2 +- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 2 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Out.c | 2 +- bootstrap/unix-48/Out.h | 2 +- bootstrap/unix-48/Platform.c | 137 +-------------------------- bootstrap/unix-48/Platform.h | 11 +-- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/VT100.c | 2 +- bootstrap/unix-48/VT100.h | 2 +- bootstrap/unix-48/errors.c | 2 +- bootstrap/unix-48/errors.h | 2 +- bootstrap/unix-48/extTools.c | 8 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-88/Compiler.c | 4 +- bootstrap/unix-88/Configuration.c | 4 +- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Files.c | 2 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 6 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 126 +++++++++++++++++++++++- bootstrap/unix-88/Modules.h | 6 +- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 2 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 2 +- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 2 +- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 2 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Out.c | 2 +- bootstrap/unix-88/Out.h | 2 +- bootstrap/unix-88/Platform.c | 137 +-------------------------- bootstrap/unix-88/Platform.h | 11 +-- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/VT100.c | 2 +- bootstrap/unix-88/VT100.h | 2 +- bootstrap/unix-88/errors.c | 2 +- bootstrap/unix-88/errors.h | 2 +- bootstrap/unix-88/extTools.c | 8 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/windows-48/Compiler.c | 4 +- bootstrap/windows-48/Configuration.c | 4 +- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Files.c | 2 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 6 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 126 +++++++++++++++++++++++- bootstrap/windows-48/Modules.h | 6 +- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 2 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 2 +- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 2 +- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 2 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Out.c | 2 +- bootstrap/windows-48/Out.h | 2 +- bootstrap/windows-48/Platform.c | 133 +------------------------- bootstrap/windows-48/Platform.h | 10 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/VT100.c | 2 +- bootstrap/windows-48/VT100.h | 2 +- bootstrap/windows-48/errors.c | 2 +- bootstrap/windows-48/errors.h | 2 +- bootstrap/windows-48/extTools.c | 8 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-88/Compiler.c | 4 +- bootstrap/windows-88/Configuration.c | 4 +- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Files.c | 2 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 6 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 126 +++++++++++++++++++++++- bootstrap/windows-88/Modules.h | 6 +- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 2 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 2 +- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 2 +- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 2 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Out.c | 2 +- bootstrap/windows-88/Out.h | 2 +- bootstrap/windows-88/Platform.c | 133 +------------------------- bootstrap/windows-88/Platform.h | 10 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/VT100.c | 2 +- bootstrap/windows-88/VT100.h | 2 +- bootstrap/windows-88/errors.c | 2 +- bootstrap/windows-88/errors.h | 2 +- bootstrap/windows-88/extTools.c | 8 +- bootstrap/windows-88/extTools.h | 2 +- src/compiler/Compiler.Mod | 5 +- src/compiler/extTools.Mod | 4 +- src/library/s3/ethReals.Mod | 16 ++-- src/runtime/Heap.Mod | 4 +- src/runtime/Modules.Mod | 67 ++++++++++++- src/runtime/Platformunix.Mod | 65 +------------ src/runtime/Platformwindows.Mod | 61 +----------- src/runtime/SYSTEM.h | 8 +- src/tools/make/oberon.mk | 1 + 205 files changed, 986 insertions(+), 1063 deletions(-) diff --git a/bootstrap/SYSTEM.h b/bootstrap/SYSTEM.h index d9778393..43baa836 100644 --- a/bootstrap/SYSTEM.h +++ b/bootstrap/SYSTEM.h @@ -103,11 +103,11 @@ extern void Platform_OSFree (ADDRESS addr); // Assertions and Halts -extern void Platform_Halt(INT32 x); -extern void Platform_AssertFail(INT32 x); +extern void Modules_Halt(INT32 x); +extern void Modules_AssertFail(INT32 x); -#define __HALT(x) Platform_Halt(x) -#define __ASSERT(cond, x) if (!(cond)) Platform_AssertFail((INT32)(x)) +#define __HALT(x) Modules_Halt((INT32)(x)) +#define __ASSERT(cond, x) if (!(cond)) Modules_AssertFail((INT32)(x)) // Index checking diff --git a/bootstrap/unix-44/Compiler.c b/bootstrap/unix-44/Compiler.c index 87b0392c..a6d5a403 100644 --- a/bootstrap/unix-44/Compiler.c +++ b/bootstrap/unix-44/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT INT8 #define INTEGER INT16 @@ -153,7 +153,7 @@ static void Compiler_Trap (INT32 sig) if (sig == 3) { Platform_Exit(0); } else { - if ((sig == 4 && Platform_HaltCode == -15)) { + if (sig == 4) { OPM_LogWStr((CHAR*)" --- Oberon compiler internal error", 36); OPM_LogWLn(); } diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index c15b87f9..d84a7f24 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index f169a3b6..09543f0b 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 5aedd8ec..3ce83372 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index 88034b00..c04d545c 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index 45b45394..2a5c9464 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -108,8 +108,8 @@ extern void *Heap__init(); extern ADDRESS Platform_MainStackFrame; extern ADDRESS Platform_OSAllocate(ADDRESS size); #define Heap_HeapModuleInit() Heap__init() +#define Heap_ModulesHalt(code) Modules_Halt(code) #define Heap_OSAllocate(size) Platform_OSAllocate(size) -#define Heap_PlatformHalt(code) Platform_Halt(code) #define Heap_PlatformMainStackFrame() Platform_MainStackFrame void Heap_Lock (void) @@ -121,7 +121,7 @@ void Heap_Unlock (void) { Heap_lockdepth -= 1; if ((Heap_interrupted && Heap_lockdepth == 0)) { - Heap_PlatformHalt(-9); + Heap_ModulesHalt(-9); } } diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index 8626628d..5f888271 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index 5eddf9be..23c71a96 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -7,6 +7,7 @@ #include "SYSTEM.h" #include "Heap.h" +#include "Platform.h" typedef struct Modules_CmdDesc *Modules_Cmd; @@ -47,9 +48,16 @@ export ADDRESS *Modules_ModuleDesc__typ; export ADDRESS *Modules_CmdDesc__typ; static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len); +export void Modules_AssertFail (INT32 code); +static void Modules_DisplayHaltCode (INT32 code); export void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all); +export void Modules_Halt (INT32 code); export Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len); export Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len); +static void Modules_errch (CHAR c); +export void Modules_errint (INT32 l); +static void Modules_errposint (INT32 l); +export void Modules_errstring (CHAR *s, LONGINT s__len); #define Modules_modules() (Modules_Module)Heap_modules #define Modules_setmodules(m) Heap_modules = m @@ -155,6 +163,121 @@ void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all) __DEL(name); } +static void Modules_errch (CHAR c) +{ + INT16 e; + e = Platform_Write(1, (ADDRESS)&c, 1); +} + +void Modules_errstring (CHAR *s, LONGINT s__len) +{ + INT32 i; + __DUP(s, s__len, CHAR); + i = 0; + while ((i < s__len && s[__X(i, s__len)] != 0x00)) { + Modules_errch(s[__X(i, s__len)]); + i += 1; + } + __DEL(s); +} + +static void Modules_errposint (INT32 l) +{ + if (l > 10) { + Modules_errposint(__DIV(l, 10)); + } + Modules_errch((CHAR)(48 + (int)__MOD(l, 10))); +} + +void Modules_errint (INT32 l) +{ + if (l < 0) { + Modules_errch('-'); + l = -l; + } + Modules_errposint(l); +} + +static void Modules_DisplayHaltCode (INT32 code) +{ + switch (code) { + case -1: + Modules_errstring((CHAR*)"Assertion failure.", 19); + break; + case -2: + Modules_errstring((CHAR*)"Index out of range.", 20); + break; + case -3: + Modules_errstring((CHAR*)"Reached end of function without reaching RETURN.", 49); + break; + case -4: + Modules_errstring((CHAR*)"CASE statement: no matching label and no ELSE.", 47); + break; + case -5: + Modules_errstring((CHAR*)"Type guard failed.", 19); + break; + case -6: + Modules_errstring((CHAR*)"Implicit type guard in record assignment failed.", 49); + break; + case -7: + Modules_errstring((CHAR*)"Invalid case in WITH statement.", 32); + break; + case -8: + Modules_errstring((CHAR*)"Value out of range.", 20); + break; + case -9: + Modules_errstring((CHAR*)"Heap interrupted while locked, but lockdepth = 0 at unlock.", 60); + break; + case -10: + Modules_errstring((CHAR*)"NIL access.", 12); + break; + case -11: + Modules_errstring((CHAR*)"Alignment error.", 17); + break; + case -12: + Modules_errstring((CHAR*)"Divide by zero.", 16); + break; + case -13: + Modules_errstring((CHAR*)"Arithmetic overflow/underflow.", 31); + break; + case -14: + Modules_errstring((CHAR*)"Invalid function argument.", 27); + break; + case -15: + Modules_errstring((CHAR*)"Internal error, e.g. Type descriptor size mismatch.", 52); + break; + case -20: + Modules_errstring((CHAR*)"Too many, or negative number of, elements in dynamic array.", 60); + break; + default: + break; + } +} + +void Modules_Halt (INT32 code) +{ + Modules_errstring((CHAR*)"Terminated by Halt(", 20); + Modules_errint(code); + Modules_errstring((CHAR*)"). ", 4); + if (code < 0) { + Modules_DisplayHaltCode(code); + } + Modules_errstring(Platform_NL, 3); + Platform_Exit(code); +} + +void Modules_AssertFail (INT32 code) +{ + Modules_errstring((CHAR*)"Assertion failure.", 19); + if (code != 0) { + Modules_errstring((CHAR*)" ASSERT code ", 14); + Modules_errint(code); + Modules_errstring((CHAR*)".", 2); + } + Modules_errstring(Platform_NL, 3); + Platform_Exit(code); +} + __TDESC(Modules_ModuleDesc, 1, 2) = {__TDFLDS("ModuleDesc", 48), {0, 28, -12}}; __TDESC(Modules_CmdDesc, 1, 1) = {__TDFLDS("CmdDesc", 32), {0, -8}}; @@ -162,6 +285,7 @@ export void *Modules__init(void) { __DEFMOD; __MODULE_IMPORT(Heap); + __MODULE_IMPORT(Platform); __REGMOD("Modules", 0); __INITYP(Modules_ModuleDesc, Modules_ModuleDesc, 0); __INITYP(Modules_CmdDesc, Modules_CmdDesc, 0); diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index 2da3fa50..6809ec05 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h @@ -43,9 +43,13 @@ import Modules_ModuleName Modules_imported, Modules_importing; import ADDRESS *Modules_ModuleDesc__typ; import ADDRESS *Modules_CmdDesc__typ; +import void Modules_AssertFail (INT32 code); import void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all); +import void Modules_Halt (INT32 code); import Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len); import Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len); +import void Modules_errint (INT32 l); +import void Modules_errstring (CHAR *s, LONGINT s__len); import void *Modules__init(void); #define Modules_modules() (Modules_Module)Heap_modules diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index dcac4eb9..8a1b80fe 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index cb6399f9..0caeb234 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 9b3d80c3..c4b9a965 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index 6cc996c8..a1917812 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 0ac4141a..9610f289 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index 91212642..fce0614a 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index 6a24e3cd..124bccb1 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index 3cadf5a4..978ccdff 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index 898b14b6..845787eb 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index 34906046..d8134366 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index fc148d64..43d368dd 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index 3a248e3c..e3170fc0 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index 77b842f8..bc68a5c6 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index 34e34ae6..9d02e218 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Out.c b/bootstrap/unix-44/Out.c index 09fecc76..ad7ed82c 100644 --- a/bootstrap/unix-44/Out.c +++ b/bootstrap/unix-44/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Out.h b/bootstrap/unix-44/Out.h index 63fefd3c..247b98de 100644 --- a/bootstrap/unix-44/Out.h +++ b/bootstrap/unix-44/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index bc020535..0a70d4aa 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -33,7 +33,6 @@ typedef export BOOLEAN Platform_LittleEndian; export INT32 Platform_MainStackFrame; -export INT32 Platform_HaltCode; export INT16 Platform_PID; export CHAR Platform_CWD[256]; export INT16 Platform_ArgCount; @@ -47,21 +46,18 @@ export ADDRESS *Platform_FileIdentity__typ; export BOOLEAN Platform_Absent (INT16 e); export INT16 Platform_ArgPos (CHAR *s, LONGINT s__len); -export void Platform_AssertFail (INT32 code); export INT16 Platform_Chdir (CHAR *n, LONGINT n__len); export INT16 Platform_Close (INT32 h); export BOOLEAN Platform_ConnectionFailed (INT16 e); export void Platform_Delay (INT32 ms); export BOOLEAN Platform_DifferentFilesystems (INT16 e); -static void Platform_DisplayHaltCode (INT32 code); export INT16 Platform_Error (void); -export void Platform_Exit (INT16 code); +export void Platform_Exit (INT32 code); export void Platform_GetArg (INT16 n, CHAR *val, LONGINT val__len); export void Platform_GetClock (INT32 *t, INT32 *d); export void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); export void Platform_GetIntArg (INT16 n, INT32 *val); export void Platform_GetTimeOfDay (INT32 *sec, INT32 *usec); -export void Platform_Halt (INT32 code); export INT16 Platform_Identify (INT32 h, Platform_FileIdentity *identity, ADDRESS *identity__typ); export INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ); export BOOLEAN Platform_Inaccessible (INT16 e); @@ -81,7 +77,6 @@ export BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentit export BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); export INT16 Platform_Seek (INT32 h, INT32 offset, INT16 whence); export void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); -export void Platform_SetHalt (Platform_HaltProcedure p); export void Platform_SetInterruptHandler (Platform_SignalHandler handler); export void Platform_SetMTime (Platform_FileIdentity *target, ADDRESS *target__typ, Platform_FileIdentity source); export void Platform_SetQuitHandler (Platform_SignalHandler handler); @@ -96,10 +91,6 @@ export INT16 Platform_Truncate (INT32 h, INT32 l); export INT16 Platform_Unlink (CHAR *n, LONGINT n__len); export INT16 Platform_Write (INT32 h, INT32 p, INT32 l); static void Platform_YMDHMStoClock (INT32 ye, INT32 mo, INT32 da, INT32 ho, INT32 mi, INT32 se, INT32 *t, INT32 *d); -static void Platform_errch (CHAR c); -static void Platform_errint (INT32 l); -static void Platform_errln (void); -static void Platform_errposint (INT32 l); export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); #include @@ -131,9 +122,7 @@ extern void Heap_InitHeap(); #define Platform_chdir(n, n__len) chdir((char*)n) #define Platform_closefile(fd) close(fd) #define Platform_err() errno -#define Platform_errc(c) write(1, &c, 1) -#define Platform_errstring(s, s__len) write(1, s, s__len-1) -#define Platform_exit(code) exit(code) +#define Platform_exit(code) exit((int)code) #define Platform_free(address) free((void*)address) #define Platform_fstat(fd) fstat(fd, &s) #define Platform_fsync(fd) fsync(fd) @@ -229,7 +218,6 @@ void Platform_Init (INT32 argc, INT32 argvadr) Platform_ArgCount = __VAL(INT16, argc); av = (Platform_ArgVecPtr)(ADDRESS)argvadr; Platform_ArgVector = (*av)[0]; - Platform_HaltCode = -128; Platform_HeapInitHeap(); } @@ -571,127 +559,11 @@ INT16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) __RETCHK; } -void Platform_Exit (INT16 code) +void Platform_Exit (INT32 code) { Platform_exit(code); } -static void Platform_errch (CHAR c) -{ - Platform_errc(c); -} - -static void Platform_errln (void) -{ - Platform_errch(0x0a); -} - -static void Platform_errposint (INT32 l) -{ - if (l > 10) { - Platform_errposint(__DIV(l, 10)); - } - Platform_errch((CHAR)(48 + (int)__MOD(l, 10))); -} - -static void Platform_errint (INT32 l) -{ - if (l < 0) { - Platform_errch('-'); - l = -l; - } - Platform_errposint(l); -} - -static void Platform_DisplayHaltCode (INT32 code) -{ - switch (code) { - case -1: - Platform_errstring((CHAR*)"Assertion failure.", 19); - break; - case -2: - Platform_errstring((CHAR*)"Index out of range.", 20); - break; - case -3: - Platform_errstring((CHAR*)"Reached end of function without reaching RETURN.", 49); - break; - case -4: - Platform_errstring((CHAR*)"CASE statement: no matching label and no ELSE.", 47); - break; - case -5: - Platform_errstring((CHAR*)"Type guard failed.", 19); - break; - case -6: - Platform_errstring((CHAR*)"Implicit type guard in record assignment failed.", 49); - break; - case -7: - Platform_errstring((CHAR*)"Invalid case in WITH statement.", 32); - break; - case -8: - Platform_errstring((CHAR*)"Value out of range.", 20); - break; - case -9: - Platform_errstring((CHAR*)"Heap interrupted while locked, but lockdepth = 0 at unlock.", 60); - break; - case -10: - Platform_errstring((CHAR*)"NIL access.", 12); - break; - case -11: - Platform_errstring((CHAR*)"Alignment error.", 17); - break; - case -12: - Platform_errstring((CHAR*)"Divide by zero.", 16); - break; - case -13: - Platform_errstring((CHAR*)"Arithmetic overflow/underflow.", 31); - break; - case -14: - Platform_errstring((CHAR*)"Invalid function argument.", 27); - break; - case -15: - Platform_errstring((CHAR*)"Internal error, e.g. Type descriptor size mismatch.", 52); - break; - case -20: - Platform_errstring((CHAR*)"Too many, or negative number of, elements in dynamic array.", 60); - break; - default: - break; - } -} - -void Platform_Halt (INT32 code) -{ - Platform_HaltCode = code; - if (Platform_HaltHandler != NIL) { - (*Platform_HaltHandler)(code); - } - Platform_errstring((CHAR*)"Terminated by Halt(", 20); - Platform_errint(code); - Platform_errstring((CHAR*)"). ", 4); - if (code < 0) { - Platform_DisplayHaltCode(code); - } - Platform_errln(); - Platform_exit(__VAL(INT16, code)); -} - -void Platform_AssertFail (INT32 code) -{ - Platform_errstring((CHAR*)"Assertion failure.", 19); - if (code != 0) { - Platform_errstring((CHAR*)" ASSERT code ", 14); - Platform_errint(code); - Platform_errstring((CHAR*)".", 2); - } - Platform_errln(); - Platform_exit(__VAL(INT16, code)); -} - -void Platform_SetHalt (Platform_HaltProcedure p) -{ - Platform_HaltHandler = p; -} - static void Platform_TestLittleEndian (void) { INT16 i; @@ -708,7 +580,6 @@ export void *Platform__init(void) __INITYP(Platform_FileIdentity, Platform_FileIdentity, 0); /* BEGIN */ Platform_TestLittleEndian(); - Platform_HaltCode = -128; Platform_HaltHandler = NIL; Platform_TimeStart = 0; Platform_TimeStart = Platform_Time(); diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index 2bbafb50..7f48cd11 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h @@ -11,16 +11,12 @@ typedef char _prvt1[8]; } Platform_FileIdentity; -typedef - void (*Platform_HaltProcedure)(INT32); - typedef void (*Platform_SignalHandler)(INT32); import BOOLEAN Platform_LittleEndian; import INT32 Platform_MainStackFrame; -import INT32 Platform_HaltCode; import INT16 Platform_PID; import CHAR Platform_CWD[256]; import INT16 Platform_ArgCount; @@ -32,20 +28,18 @@ import ADDRESS *Platform_FileIdentity__typ; import BOOLEAN Platform_Absent (INT16 e); import INT16 Platform_ArgPos (CHAR *s, LONGINT s__len); -import void Platform_AssertFail (INT32 code); import INT16 Platform_Chdir (CHAR *n, LONGINT n__len); import INT16 Platform_Close (INT32 h); import BOOLEAN Platform_ConnectionFailed (INT16 e); import void Platform_Delay (INT32 ms); import BOOLEAN Platform_DifferentFilesystems (INT16 e); import INT16 Platform_Error (void); -import void Platform_Exit (INT16 code); +import void Platform_Exit (INT32 code); import void Platform_GetArg (INT16 n, CHAR *val, LONGINT val__len); import void Platform_GetClock (INT32 *t, INT32 *d); import void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); import void Platform_GetIntArg (INT16 n, INT32 *val); import void Platform_GetTimeOfDay (INT32 *sec, INT32 *usec); -import void Platform_Halt (INT32 code); import INT16 Platform_Identify (INT32 h, Platform_FileIdentity *identity, ADDRESS *identity__typ); import INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ); import BOOLEAN Platform_Inaccessible (INT16 e); @@ -65,7 +59,6 @@ import BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentit import BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); import INT16 Platform_Seek (INT32 h, INT32 offset, INT16 whence); import void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); -import void Platform_SetHalt (Platform_HaltProcedure p); import void Platform_SetInterruptHandler (Platform_SignalHandler handler); import void Platform_SetMTime (Platform_FileIdentity *target, ADDRESS *target__typ, Platform_FileIdentity source); import void Platform_SetQuitHandler (Platform_SignalHandler handler); diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index f7860591..955cd8dc 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index 5ed2ec95..fbae270c 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index 5ae2e44e..07e3b700 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index a9d577f6..e3525cd0 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index db16a845..90bf9113 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index f7454dae..8e1a2514 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/VT100.c b/bootstrap/unix-44/VT100.c index 01b8a481..97a7d318 100644 --- a/bootstrap/unix-44/VT100.c +++ b/bootstrap/unix-44/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/VT100.h b/bootstrap/unix-44/VT100.h index 5ee411dd..577a2d44 100644 --- a/bootstrap/unix-44/VT100.h +++ b/bootstrap/unix-44/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-44/errors.c b/bootstrap/unix-44/errors.c index b7d411bb..aac72a79 100644 --- a/bootstrap/unix-44/errors.c +++ b/bootstrap/unix-44/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/errors.h b/bootstrap/unix-44/errors.h index fa08de1c..4f03779e 100644 --- a/bootstrap/unix-44/errors.h +++ b/bootstrap/unix-44/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index 74271e5d..3493ea47 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -7,6 +7,7 @@ #include "SYSTEM.h" #include "Configuration.h" +#include "Modules.h" #include "OPM.h" #include "Out.h" #include "Platform.h" @@ -53,9 +54,9 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN Out_Ln(); } if (status != 0) { - Platform_Halt(status); + Modules_Halt(status); } else { - Platform_Halt(exitcode); + Modules_Halt(exitcode); } } __DEL(title); @@ -114,6 +115,7 @@ export void *extTools__init(void) { __DEFMOD; __MODULE_IMPORT(Configuration); + __MODULE_IMPORT(Modules); __MODULE_IMPORT(OPM); __MODULE_IMPORT(Out); __MODULE_IMPORT(Platform); diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index 9b7b3c17..691b2968 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/Compiler.c b/bootstrap/unix-48/Compiler.c index 87b0392c..a6d5a403 100644 --- a/bootstrap/unix-48/Compiler.c +++ b/bootstrap/unix-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT INT8 #define INTEGER INT16 @@ -153,7 +153,7 @@ static void Compiler_Trap (INT32 sig) if (sig == 3) { Platform_Exit(0); } else { - if ((sig == 4 && Platform_HaltCode == -15)) { + if (sig == 4) { OPM_LogWStr((CHAR*)" --- Oberon compiler internal error", 36); OPM_LogWLn(); } diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index c15b87f9..d84a7f24 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index f169a3b6..09543f0b 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 5aedd8ec..3ce83372 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index 88034b00..c04d545c 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index 45b45394..2a5c9464 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -108,8 +108,8 @@ extern void *Heap__init(); extern ADDRESS Platform_MainStackFrame; extern ADDRESS Platform_OSAllocate(ADDRESS size); #define Heap_HeapModuleInit() Heap__init() +#define Heap_ModulesHalt(code) Modules_Halt(code) #define Heap_OSAllocate(size) Platform_OSAllocate(size) -#define Heap_PlatformHalt(code) Platform_Halt(code) #define Heap_PlatformMainStackFrame() Platform_MainStackFrame void Heap_Lock (void) @@ -121,7 +121,7 @@ void Heap_Unlock (void) { Heap_lockdepth -= 1; if ((Heap_interrupted && Heap_lockdepth == 0)) { - Heap_PlatformHalt(-9); + Heap_ModulesHalt(-9); } } diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index 8626628d..5f888271 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index 5eddf9be..23c71a96 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -7,6 +7,7 @@ #include "SYSTEM.h" #include "Heap.h" +#include "Platform.h" typedef struct Modules_CmdDesc *Modules_Cmd; @@ -47,9 +48,16 @@ export ADDRESS *Modules_ModuleDesc__typ; export ADDRESS *Modules_CmdDesc__typ; static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len); +export void Modules_AssertFail (INT32 code); +static void Modules_DisplayHaltCode (INT32 code); export void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all); +export void Modules_Halt (INT32 code); export Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len); export Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len); +static void Modules_errch (CHAR c); +export void Modules_errint (INT32 l); +static void Modules_errposint (INT32 l); +export void Modules_errstring (CHAR *s, LONGINT s__len); #define Modules_modules() (Modules_Module)Heap_modules #define Modules_setmodules(m) Heap_modules = m @@ -155,6 +163,121 @@ void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all) __DEL(name); } +static void Modules_errch (CHAR c) +{ + INT16 e; + e = Platform_Write(1, (ADDRESS)&c, 1); +} + +void Modules_errstring (CHAR *s, LONGINT s__len) +{ + INT32 i; + __DUP(s, s__len, CHAR); + i = 0; + while ((i < s__len && s[__X(i, s__len)] != 0x00)) { + Modules_errch(s[__X(i, s__len)]); + i += 1; + } + __DEL(s); +} + +static void Modules_errposint (INT32 l) +{ + if (l > 10) { + Modules_errposint(__DIV(l, 10)); + } + Modules_errch((CHAR)(48 + (int)__MOD(l, 10))); +} + +void Modules_errint (INT32 l) +{ + if (l < 0) { + Modules_errch('-'); + l = -l; + } + Modules_errposint(l); +} + +static void Modules_DisplayHaltCode (INT32 code) +{ + switch (code) { + case -1: + Modules_errstring((CHAR*)"Assertion failure.", 19); + break; + case -2: + Modules_errstring((CHAR*)"Index out of range.", 20); + break; + case -3: + Modules_errstring((CHAR*)"Reached end of function without reaching RETURN.", 49); + break; + case -4: + Modules_errstring((CHAR*)"CASE statement: no matching label and no ELSE.", 47); + break; + case -5: + Modules_errstring((CHAR*)"Type guard failed.", 19); + break; + case -6: + Modules_errstring((CHAR*)"Implicit type guard in record assignment failed.", 49); + break; + case -7: + Modules_errstring((CHAR*)"Invalid case in WITH statement.", 32); + break; + case -8: + Modules_errstring((CHAR*)"Value out of range.", 20); + break; + case -9: + Modules_errstring((CHAR*)"Heap interrupted while locked, but lockdepth = 0 at unlock.", 60); + break; + case -10: + Modules_errstring((CHAR*)"NIL access.", 12); + break; + case -11: + Modules_errstring((CHAR*)"Alignment error.", 17); + break; + case -12: + Modules_errstring((CHAR*)"Divide by zero.", 16); + break; + case -13: + Modules_errstring((CHAR*)"Arithmetic overflow/underflow.", 31); + break; + case -14: + Modules_errstring((CHAR*)"Invalid function argument.", 27); + break; + case -15: + Modules_errstring((CHAR*)"Internal error, e.g. Type descriptor size mismatch.", 52); + break; + case -20: + Modules_errstring((CHAR*)"Too many, or negative number of, elements in dynamic array.", 60); + break; + default: + break; + } +} + +void Modules_Halt (INT32 code) +{ + Modules_errstring((CHAR*)"Terminated by Halt(", 20); + Modules_errint(code); + Modules_errstring((CHAR*)"). ", 4); + if (code < 0) { + Modules_DisplayHaltCode(code); + } + Modules_errstring(Platform_NL, 3); + Platform_Exit(code); +} + +void Modules_AssertFail (INT32 code) +{ + Modules_errstring((CHAR*)"Assertion failure.", 19); + if (code != 0) { + Modules_errstring((CHAR*)" ASSERT code ", 14); + Modules_errint(code); + Modules_errstring((CHAR*)".", 2); + } + Modules_errstring(Platform_NL, 3); + Platform_Exit(code); +} + __TDESC(Modules_ModuleDesc, 1, 2) = {__TDFLDS("ModuleDesc", 48), {0, 28, -12}}; __TDESC(Modules_CmdDesc, 1, 1) = {__TDFLDS("CmdDesc", 32), {0, -8}}; @@ -162,6 +285,7 @@ export void *Modules__init(void) { __DEFMOD; __MODULE_IMPORT(Heap); + __MODULE_IMPORT(Platform); __REGMOD("Modules", 0); __INITYP(Modules_ModuleDesc, Modules_ModuleDesc, 0); __INITYP(Modules_CmdDesc, Modules_CmdDesc, 0); diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index 2da3fa50..6809ec05 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h @@ -43,9 +43,13 @@ import Modules_ModuleName Modules_imported, Modules_importing; import ADDRESS *Modules_ModuleDesc__typ; import ADDRESS *Modules_CmdDesc__typ; +import void Modules_AssertFail (INT32 code); import void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all); +import void Modules_Halt (INT32 code); import Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len); import Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len); +import void Modules_errint (INT32 l); +import void Modules_errstring (CHAR *s, LONGINT s__len); import void *Modules__init(void); #define Modules_modules() (Modules_Module)Heap_modules diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index dcac4eb9..8a1b80fe 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index cb6399f9..0caeb234 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 9b3d80c3..c4b9a965 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index 6cc996c8..a1917812 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 0ac4141a..9610f289 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index 91212642..fce0614a 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index 6a24e3cd..124bccb1 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index 3cadf5a4..978ccdff 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index 898b14b6..845787eb 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index 34906046..d8134366 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index a8951123..46e05141 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index 3a248e3c..e3170fc0 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index 77b842f8..bc68a5c6 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index 34e34ae6..9d02e218 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Out.c b/bootstrap/unix-48/Out.c index 09fecc76..ad7ed82c 100644 --- a/bootstrap/unix-48/Out.c +++ b/bootstrap/unix-48/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Out.h b/bootstrap/unix-48/Out.h index 63fefd3c..247b98de 100644 --- a/bootstrap/unix-48/Out.h +++ b/bootstrap/unix-48/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index bc020535..0a70d4aa 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -33,7 +33,6 @@ typedef export BOOLEAN Platform_LittleEndian; export INT32 Platform_MainStackFrame; -export INT32 Platform_HaltCode; export INT16 Platform_PID; export CHAR Platform_CWD[256]; export INT16 Platform_ArgCount; @@ -47,21 +46,18 @@ export ADDRESS *Platform_FileIdentity__typ; export BOOLEAN Platform_Absent (INT16 e); export INT16 Platform_ArgPos (CHAR *s, LONGINT s__len); -export void Platform_AssertFail (INT32 code); export INT16 Platform_Chdir (CHAR *n, LONGINT n__len); export INT16 Platform_Close (INT32 h); export BOOLEAN Platform_ConnectionFailed (INT16 e); export void Platform_Delay (INT32 ms); export BOOLEAN Platform_DifferentFilesystems (INT16 e); -static void Platform_DisplayHaltCode (INT32 code); export INT16 Platform_Error (void); -export void Platform_Exit (INT16 code); +export void Platform_Exit (INT32 code); export void Platform_GetArg (INT16 n, CHAR *val, LONGINT val__len); export void Platform_GetClock (INT32 *t, INT32 *d); export void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); export void Platform_GetIntArg (INT16 n, INT32 *val); export void Platform_GetTimeOfDay (INT32 *sec, INT32 *usec); -export void Platform_Halt (INT32 code); export INT16 Platform_Identify (INT32 h, Platform_FileIdentity *identity, ADDRESS *identity__typ); export INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ); export BOOLEAN Platform_Inaccessible (INT16 e); @@ -81,7 +77,6 @@ export BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentit export BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); export INT16 Platform_Seek (INT32 h, INT32 offset, INT16 whence); export void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); -export void Platform_SetHalt (Platform_HaltProcedure p); export void Platform_SetInterruptHandler (Platform_SignalHandler handler); export void Platform_SetMTime (Platform_FileIdentity *target, ADDRESS *target__typ, Platform_FileIdentity source); export void Platform_SetQuitHandler (Platform_SignalHandler handler); @@ -96,10 +91,6 @@ export INT16 Platform_Truncate (INT32 h, INT32 l); export INT16 Platform_Unlink (CHAR *n, LONGINT n__len); export INT16 Platform_Write (INT32 h, INT32 p, INT32 l); static void Platform_YMDHMStoClock (INT32 ye, INT32 mo, INT32 da, INT32 ho, INT32 mi, INT32 se, INT32 *t, INT32 *d); -static void Platform_errch (CHAR c); -static void Platform_errint (INT32 l); -static void Platform_errln (void); -static void Platform_errposint (INT32 l); export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); #include @@ -131,9 +122,7 @@ extern void Heap_InitHeap(); #define Platform_chdir(n, n__len) chdir((char*)n) #define Platform_closefile(fd) close(fd) #define Platform_err() errno -#define Platform_errc(c) write(1, &c, 1) -#define Platform_errstring(s, s__len) write(1, s, s__len-1) -#define Platform_exit(code) exit(code) +#define Platform_exit(code) exit((int)code) #define Platform_free(address) free((void*)address) #define Platform_fstat(fd) fstat(fd, &s) #define Platform_fsync(fd) fsync(fd) @@ -229,7 +218,6 @@ void Platform_Init (INT32 argc, INT32 argvadr) Platform_ArgCount = __VAL(INT16, argc); av = (Platform_ArgVecPtr)(ADDRESS)argvadr; Platform_ArgVector = (*av)[0]; - Platform_HaltCode = -128; Platform_HeapInitHeap(); } @@ -571,127 +559,11 @@ INT16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) __RETCHK; } -void Platform_Exit (INT16 code) +void Platform_Exit (INT32 code) { Platform_exit(code); } -static void Platform_errch (CHAR c) -{ - Platform_errc(c); -} - -static void Platform_errln (void) -{ - Platform_errch(0x0a); -} - -static void Platform_errposint (INT32 l) -{ - if (l > 10) { - Platform_errposint(__DIV(l, 10)); - } - Platform_errch((CHAR)(48 + (int)__MOD(l, 10))); -} - -static void Platform_errint (INT32 l) -{ - if (l < 0) { - Platform_errch('-'); - l = -l; - } - Platform_errposint(l); -} - -static void Platform_DisplayHaltCode (INT32 code) -{ - switch (code) { - case -1: - Platform_errstring((CHAR*)"Assertion failure.", 19); - break; - case -2: - Platform_errstring((CHAR*)"Index out of range.", 20); - break; - case -3: - Platform_errstring((CHAR*)"Reached end of function without reaching RETURN.", 49); - break; - case -4: - Platform_errstring((CHAR*)"CASE statement: no matching label and no ELSE.", 47); - break; - case -5: - Platform_errstring((CHAR*)"Type guard failed.", 19); - break; - case -6: - Platform_errstring((CHAR*)"Implicit type guard in record assignment failed.", 49); - break; - case -7: - Platform_errstring((CHAR*)"Invalid case in WITH statement.", 32); - break; - case -8: - Platform_errstring((CHAR*)"Value out of range.", 20); - break; - case -9: - Platform_errstring((CHAR*)"Heap interrupted while locked, but lockdepth = 0 at unlock.", 60); - break; - case -10: - Platform_errstring((CHAR*)"NIL access.", 12); - break; - case -11: - Platform_errstring((CHAR*)"Alignment error.", 17); - break; - case -12: - Platform_errstring((CHAR*)"Divide by zero.", 16); - break; - case -13: - Platform_errstring((CHAR*)"Arithmetic overflow/underflow.", 31); - break; - case -14: - Platform_errstring((CHAR*)"Invalid function argument.", 27); - break; - case -15: - Platform_errstring((CHAR*)"Internal error, e.g. Type descriptor size mismatch.", 52); - break; - case -20: - Platform_errstring((CHAR*)"Too many, or negative number of, elements in dynamic array.", 60); - break; - default: - break; - } -} - -void Platform_Halt (INT32 code) -{ - Platform_HaltCode = code; - if (Platform_HaltHandler != NIL) { - (*Platform_HaltHandler)(code); - } - Platform_errstring((CHAR*)"Terminated by Halt(", 20); - Platform_errint(code); - Platform_errstring((CHAR*)"). ", 4); - if (code < 0) { - Platform_DisplayHaltCode(code); - } - Platform_errln(); - Platform_exit(__VAL(INT16, code)); -} - -void Platform_AssertFail (INT32 code) -{ - Platform_errstring((CHAR*)"Assertion failure.", 19); - if (code != 0) { - Platform_errstring((CHAR*)" ASSERT code ", 14); - Platform_errint(code); - Platform_errstring((CHAR*)".", 2); - } - Platform_errln(); - Platform_exit(__VAL(INT16, code)); -} - -void Platform_SetHalt (Platform_HaltProcedure p) -{ - Platform_HaltHandler = p; -} - static void Platform_TestLittleEndian (void) { INT16 i; @@ -708,7 +580,6 @@ export void *Platform__init(void) __INITYP(Platform_FileIdentity, Platform_FileIdentity, 0); /* BEGIN */ Platform_TestLittleEndian(); - Platform_HaltCode = -128; Platform_HaltHandler = NIL; Platform_TimeStart = 0; Platform_TimeStart = Platform_Time(); diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index 2bbafb50..7f48cd11 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h @@ -11,16 +11,12 @@ typedef char _prvt1[8]; } Platform_FileIdentity; -typedef - void (*Platform_HaltProcedure)(INT32); - typedef void (*Platform_SignalHandler)(INT32); import BOOLEAN Platform_LittleEndian; import INT32 Platform_MainStackFrame; -import INT32 Platform_HaltCode; import INT16 Platform_PID; import CHAR Platform_CWD[256]; import INT16 Platform_ArgCount; @@ -32,20 +28,18 @@ import ADDRESS *Platform_FileIdentity__typ; import BOOLEAN Platform_Absent (INT16 e); import INT16 Platform_ArgPos (CHAR *s, LONGINT s__len); -import void Platform_AssertFail (INT32 code); import INT16 Platform_Chdir (CHAR *n, LONGINT n__len); import INT16 Platform_Close (INT32 h); import BOOLEAN Platform_ConnectionFailed (INT16 e); import void Platform_Delay (INT32 ms); import BOOLEAN Platform_DifferentFilesystems (INT16 e); import INT16 Platform_Error (void); -import void Platform_Exit (INT16 code); +import void Platform_Exit (INT32 code); import void Platform_GetArg (INT16 n, CHAR *val, LONGINT val__len); import void Platform_GetClock (INT32 *t, INT32 *d); import void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); import void Platform_GetIntArg (INT16 n, INT32 *val); import void Platform_GetTimeOfDay (INT32 *sec, INT32 *usec); -import void Platform_Halt (INT32 code); import INT16 Platform_Identify (INT32 h, Platform_FileIdentity *identity, ADDRESS *identity__typ); import INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ); import BOOLEAN Platform_Inaccessible (INT16 e); @@ -65,7 +59,6 @@ import BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentit import BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); import INT16 Platform_Seek (INT32 h, INT32 offset, INT16 whence); import void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); -import void Platform_SetHalt (Platform_HaltProcedure p); import void Platform_SetInterruptHandler (Platform_SignalHandler handler); import void Platform_SetMTime (Platform_FileIdentity *target, ADDRESS *target__typ, Platform_FileIdentity source); import void Platform_SetQuitHandler (Platform_SignalHandler handler); diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index f7860591..955cd8dc 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index 5ed2ec95..fbae270c 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index 5ae2e44e..07e3b700 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index a9d577f6..e3525cd0 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index 987b9952..36cd76fb 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index e902469a..4bae7210 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/VT100.c b/bootstrap/unix-48/VT100.c index 01b8a481..97a7d318 100644 --- a/bootstrap/unix-48/VT100.c +++ b/bootstrap/unix-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/VT100.h b/bootstrap/unix-48/VT100.h index 5ee411dd..577a2d44 100644 --- a/bootstrap/unix-48/VT100.h +++ b/bootstrap/unix-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-48/errors.c b/bootstrap/unix-48/errors.c index b7d411bb..aac72a79 100644 --- a/bootstrap/unix-48/errors.c +++ b/bootstrap/unix-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/errors.h b/bootstrap/unix-48/errors.h index fa08de1c..4f03779e 100644 --- a/bootstrap/unix-48/errors.h +++ b/bootstrap/unix-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index 74271e5d..3493ea47 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -7,6 +7,7 @@ #include "SYSTEM.h" #include "Configuration.h" +#include "Modules.h" #include "OPM.h" #include "Out.h" #include "Platform.h" @@ -53,9 +54,9 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN Out_Ln(); } if (status != 0) { - Platform_Halt(status); + Modules_Halt(status); } else { - Platform_Halt(exitcode); + Modules_Halt(exitcode); } } __DEL(title); @@ -114,6 +115,7 @@ export void *extTools__init(void) { __DEFMOD; __MODULE_IMPORT(Configuration); + __MODULE_IMPORT(Modules); __MODULE_IMPORT(OPM); __MODULE_IMPORT(Out); __MODULE_IMPORT(Platform); diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index 9b7b3c17..691b2968 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/Compiler.c b/bootstrap/unix-88/Compiler.c index 87b0392c..a6d5a403 100644 --- a/bootstrap/unix-88/Compiler.c +++ b/bootstrap/unix-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT INT8 #define INTEGER INT16 @@ -153,7 +153,7 @@ static void Compiler_Trap (INT32 sig) if (sig == 3) { Platform_Exit(0); } else { - if ((sig == 4 && Platform_HaltCode == -15)) { + if (sig == 4) { OPM_LogWStr((CHAR*)" --- Oberon compiler internal error", 36); OPM_LogWLn(); } diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index c15b87f9..d84a7f24 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index f169a3b6..09543f0b 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 53ac0902..ba54d44e 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 3bfefe80..ef304bed 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index 806a01db..46f70cc1 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -108,8 +108,8 @@ extern void *Heap__init(); extern ADDRESS Platform_MainStackFrame; extern ADDRESS Platform_OSAllocate(ADDRESS size); #define Heap_HeapModuleInit() Heap__init() +#define Heap_ModulesHalt(code) Modules_Halt(code) #define Heap_OSAllocate(size) Platform_OSAllocate(size) -#define Heap_PlatformHalt(code) Platform_Halt(code) #define Heap_PlatformMainStackFrame() Platform_MainStackFrame void Heap_Lock (void) @@ -121,7 +121,7 @@ void Heap_Unlock (void) { Heap_lockdepth -= 1; if ((Heap_interrupted && Heap_lockdepth == 0)) { - Heap_PlatformHalt(-9); + Heap_ModulesHalt(-9); } } diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index 2603a3eb..06cbd0ec 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index f463ec4e..494f9fdc 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -7,6 +7,7 @@ #include "SYSTEM.h" #include "Heap.h" +#include "Platform.h" typedef struct Modules_CmdDesc *Modules_Cmd; @@ -47,9 +48,16 @@ export ADDRESS *Modules_ModuleDesc__typ; export ADDRESS *Modules_CmdDesc__typ; static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len); +export void Modules_AssertFail (INT32 code); +static void Modules_DisplayHaltCode (INT32 code); export void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all); +export void Modules_Halt (INT32 code); export Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len); export Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len); +static void Modules_errch (CHAR c); +export void Modules_errint (INT32 l); +static void Modules_errposint (INT32 l); +export void Modules_errstring (CHAR *s, LONGINT s__len); #define Modules_modules() (Modules_Module)Heap_modules #define Modules_setmodules(m) Heap_modules = m @@ -155,6 +163,121 @@ void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all) __DEL(name); } +static void Modules_errch (CHAR c) +{ + INT16 e; + e = Platform_Write(1, (ADDRESS)&c, 1); +} + +void Modules_errstring (CHAR *s, LONGINT s__len) +{ + INT32 i; + __DUP(s, s__len, CHAR); + i = 0; + while ((i < s__len && s[__X(i, s__len)] != 0x00)) { + Modules_errch(s[__X(i, s__len)]); + i += 1; + } + __DEL(s); +} + +static void Modules_errposint (INT32 l) +{ + if (l > 10) { + Modules_errposint(__DIV(l, 10)); + } + Modules_errch((CHAR)(48 + (int)__MOD(l, 10))); +} + +void Modules_errint (INT32 l) +{ + if (l < 0) { + Modules_errch('-'); + l = -l; + } + Modules_errposint(l); +} + +static void Modules_DisplayHaltCode (INT32 code) +{ + switch (code) { + case -1: + Modules_errstring((CHAR*)"Assertion failure.", 19); + break; + case -2: + Modules_errstring((CHAR*)"Index out of range.", 20); + break; + case -3: + Modules_errstring((CHAR*)"Reached end of function without reaching RETURN.", 49); + break; + case -4: + Modules_errstring((CHAR*)"CASE statement: no matching label and no ELSE.", 47); + break; + case -5: + Modules_errstring((CHAR*)"Type guard failed.", 19); + break; + case -6: + Modules_errstring((CHAR*)"Implicit type guard in record assignment failed.", 49); + break; + case -7: + Modules_errstring((CHAR*)"Invalid case in WITH statement.", 32); + break; + case -8: + Modules_errstring((CHAR*)"Value out of range.", 20); + break; + case -9: + Modules_errstring((CHAR*)"Heap interrupted while locked, but lockdepth = 0 at unlock.", 60); + break; + case -10: + Modules_errstring((CHAR*)"NIL access.", 12); + break; + case -11: + Modules_errstring((CHAR*)"Alignment error.", 17); + break; + case -12: + Modules_errstring((CHAR*)"Divide by zero.", 16); + break; + case -13: + Modules_errstring((CHAR*)"Arithmetic overflow/underflow.", 31); + break; + case -14: + Modules_errstring((CHAR*)"Invalid function argument.", 27); + break; + case -15: + Modules_errstring((CHAR*)"Internal error, e.g. Type descriptor size mismatch.", 52); + break; + case -20: + Modules_errstring((CHAR*)"Too many, or negative number of, elements in dynamic array.", 60); + break; + default: + break; + } +} + +void Modules_Halt (INT32 code) +{ + Modules_errstring((CHAR*)"Terminated by Halt(", 20); + Modules_errint(code); + Modules_errstring((CHAR*)"). ", 4); + if (code < 0) { + Modules_DisplayHaltCode(code); + } + Modules_errstring(Platform_NL, 3); + Platform_Exit(code); +} + +void Modules_AssertFail (INT32 code) +{ + Modules_errstring((CHAR*)"Assertion failure.", 19); + if (code != 0) { + Modules_errstring((CHAR*)" ASSERT code ", 14); + Modules_errint(code); + Modules_errstring((CHAR*)".", 2); + } + Modules_errstring(Platform_NL, 3); + Platform_Exit(code); +} + __TDESC(Modules_ModuleDesc, 1, 2) = {__TDFLDS("ModuleDesc", 64), {0, 32, -24}}; __TDESC(Modules_CmdDesc, 1, 1) = {__TDFLDS("CmdDesc", 40), {0, -16}}; @@ -162,6 +285,7 @@ export void *Modules__init(void) { __DEFMOD; __MODULE_IMPORT(Heap); + __MODULE_IMPORT(Platform); __REGMOD("Modules", 0); __INITYP(Modules_ModuleDesc, Modules_ModuleDesc, 0); __INITYP(Modules_CmdDesc, Modules_CmdDesc, 0); diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index 2da3fa50..6809ec05 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h @@ -43,9 +43,13 @@ import Modules_ModuleName Modules_imported, Modules_importing; import ADDRESS *Modules_ModuleDesc__typ; import ADDRESS *Modules_CmdDesc__typ; +import void Modules_AssertFail (INT32 code); import void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all); +import void Modules_Halt (INT32 code); import Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len); import Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len); +import void Modules_errint (INT32 l); +import void Modules_errstring (CHAR *s, LONGINT s__len); import void *Modules__init(void); #define Modules_modules() (Modules_Module)Heap_modules diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index dcac4eb9..8a1b80fe 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index cb6399f9..0caeb234 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index 9b3d80c3..c4b9a965 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index 6cc996c8..a1917812 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 97726a71..c2258e5b 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index 91212642..fce0614a 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index e3840599..bcedf318 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index 3cadf5a4..978ccdff 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index 898b14b6..845787eb 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index 34906046..d8134366 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index 0a7b463e..896d5ead 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 3a248e3c..e3170fc0 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 7c411904..3602bbf6 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index 34e34ae6..9d02e218 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Out.c b/bootstrap/unix-88/Out.c index 09fecc76..ad7ed82c 100644 --- a/bootstrap/unix-88/Out.c +++ b/bootstrap/unix-88/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Out.h b/bootstrap/unix-88/Out.h index 63fefd3c..247b98de 100644 --- a/bootstrap/unix-88/Out.h +++ b/bootstrap/unix-88/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 46853757..76346d8f 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -33,7 +33,6 @@ typedef export BOOLEAN Platform_LittleEndian; export INT64 Platform_MainStackFrame; -export INT32 Platform_HaltCode; export INT16 Platform_PID; export CHAR Platform_CWD[256]; export INT16 Platform_ArgCount; @@ -47,21 +46,18 @@ export ADDRESS *Platform_FileIdentity__typ; export BOOLEAN Platform_Absent (INT16 e); export INT16 Platform_ArgPos (CHAR *s, LONGINT s__len); -export void Platform_AssertFail (INT32 code); export INT16 Platform_Chdir (CHAR *n, LONGINT n__len); export INT16 Platform_Close (INT32 h); export BOOLEAN Platform_ConnectionFailed (INT16 e); export void Platform_Delay (INT32 ms); export BOOLEAN Platform_DifferentFilesystems (INT16 e); -static void Platform_DisplayHaltCode (INT32 code); export INT16 Platform_Error (void); -export void Platform_Exit (INT16 code); +export void Platform_Exit (INT32 code); export void Platform_GetArg (INT16 n, CHAR *val, LONGINT val__len); export void Platform_GetClock (INT32 *t, INT32 *d); export void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); export void Platform_GetIntArg (INT16 n, INT32 *val); export void Platform_GetTimeOfDay (INT32 *sec, INT32 *usec); -export void Platform_Halt (INT32 code); export INT16 Platform_Identify (INT32 h, Platform_FileIdentity *identity, ADDRESS *identity__typ); export INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ); export BOOLEAN Platform_Inaccessible (INT16 e); @@ -81,7 +77,6 @@ export BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentit export BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); export INT16 Platform_Seek (INT32 h, INT32 offset, INT16 whence); export void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); -export void Platform_SetHalt (Platform_HaltProcedure p); export void Platform_SetInterruptHandler (Platform_SignalHandler handler); export void Platform_SetMTime (Platform_FileIdentity *target, ADDRESS *target__typ, Platform_FileIdentity source); export void Platform_SetQuitHandler (Platform_SignalHandler handler); @@ -96,10 +91,6 @@ export INT16 Platform_Truncate (INT32 h, INT32 l); export INT16 Platform_Unlink (CHAR *n, LONGINT n__len); export INT16 Platform_Write (INT32 h, INT64 p, INT32 l); static void Platform_YMDHMStoClock (INT32 ye, INT32 mo, INT32 da, INT32 ho, INT32 mi, INT32 se, INT32 *t, INT32 *d); -static void Platform_errch (CHAR c); -static void Platform_errint (INT32 l); -static void Platform_errln (void); -static void Platform_errposint (INT32 l); export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); #include @@ -131,9 +122,7 @@ extern void Heap_InitHeap(); #define Platform_chdir(n, n__len) chdir((char*)n) #define Platform_closefile(fd) close(fd) #define Platform_err() errno -#define Platform_errc(c) write(1, &c, 1) -#define Platform_errstring(s, s__len) write(1, s, s__len-1) -#define Platform_exit(code) exit(code) +#define Platform_exit(code) exit((int)code) #define Platform_free(address) free((void*)address) #define Platform_fstat(fd) fstat(fd, &s) #define Platform_fsync(fd) fsync(fd) @@ -229,7 +218,6 @@ void Platform_Init (INT32 argc, INT64 argvadr) Platform_ArgCount = __VAL(INT16, argc); av = (Platform_ArgVecPtr)(ADDRESS)argvadr; Platform_ArgVector = (*av)[0]; - Platform_HaltCode = -128; Platform_HeapInitHeap(); } @@ -571,127 +559,11 @@ INT16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) __RETCHK; } -void Platform_Exit (INT16 code) +void Platform_Exit (INT32 code) { Platform_exit(code); } -static void Platform_errch (CHAR c) -{ - Platform_errc(c); -} - -static void Platform_errln (void) -{ - Platform_errch(0x0a); -} - -static void Platform_errposint (INT32 l) -{ - if (l > 10) { - Platform_errposint(__DIV(l, 10)); - } - Platform_errch((CHAR)(48 + (int)__MOD(l, 10))); -} - -static void Platform_errint (INT32 l) -{ - if (l < 0) { - Platform_errch('-'); - l = -l; - } - Platform_errposint(l); -} - -static void Platform_DisplayHaltCode (INT32 code) -{ - switch (code) { - case -1: - Platform_errstring((CHAR*)"Assertion failure.", 19); - break; - case -2: - Platform_errstring((CHAR*)"Index out of range.", 20); - break; - case -3: - Platform_errstring((CHAR*)"Reached end of function without reaching RETURN.", 49); - break; - case -4: - Platform_errstring((CHAR*)"CASE statement: no matching label and no ELSE.", 47); - break; - case -5: - Platform_errstring((CHAR*)"Type guard failed.", 19); - break; - case -6: - Platform_errstring((CHAR*)"Implicit type guard in record assignment failed.", 49); - break; - case -7: - Platform_errstring((CHAR*)"Invalid case in WITH statement.", 32); - break; - case -8: - Platform_errstring((CHAR*)"Value out of range.", 20); - break; - case -9: - Platform_errstring((CHAR*)"Heap interrupted while locked, but lockdepth = 0 at unlock.", 60); - break; - case -10: - Platform_errstring((CHAR*)"NIL access.", 12); - break; - case -11: - Platform_errstring((CHAR*)"Alignment error.", 17); - break; - case -12: - Platform_errstring((CHAR*)"Divide by zero.", 16); - break; - case -13: - Platform_errstring((CHAR*)"Arithmetic overflow/underflow.", 31); - break; - case -14: - Platform_errstring((CHAR*)"Invalid function argument.", 27); - break; - case -15: - Platform_errstring((CHAR*)"Internal error, e.g. Type descriptor size mismatch.", 52); - break; - case -20: - Platform_errstring((CHAR*)"Too many, or negative number of, elements in dynamic array.", 60); - break; - default: - break; - } -} - -void Platform_Halt (INT32 code) -{ - Platform_HaltCode = code; - if (Platform_HaltHandler != NIL) { - (*Platform_HaltHandler)(code); - } - Platform_errstring((CHAR*)"Terminated by Halt(", 20); - Platform_errint(code); - Platform_errstring((CHAR*)"). ", 4); - if (code < 0) { - Platform_DisplayHaltCode(code); - } - Platform_errln(); - Platform_exit(__VAL(INT16, code)); -} - -void Platform_AssertFail (INT32 code) -{ - Platform_errstring((CHAR*)"Assertion failure.", 19); - if (code != 0) { - Platform_errstring((CHAR*)" ASSERT code ", 14); - Platform_errint(code); - Platform_errstring((CHAR*)".", 2); - } - Platform_errln(); - Platform_exit(__VAL(INT16, code)); -} - -void Platform_SetHalt (Platform_HaltProcedure p) -{ - Platform_HaltHandler = p; -} - static void Platform_TestLittleEndian (void) { INT16 i; @@ -708,7 +580,6 @@ export void *Platform__init(void) __INITYP(Platform_FileIdentity, Platform_FileIdentity, 0); /* BEGIN */ Platform_TestLittleEndian(); - Platform_HaltCode = -128; Platform_HaltHandler = NIL; Platform_TimeStart = 0; Platform_TimeStart = Platform_Time(); diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index ca01598a..c890c863 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h @@ -11,16 +11,12 @@ typedef char _prvt1[8]; } Platform_FileIdentity; -typedef - void (*Platform_HaltProcedure)(INT32); - typedef void (*Platform_SignalHandler)(INT32); import BOOLEAN Platform_LittleEndian; import INT64 Platform_MainStackFrame; -import INT32 Platform_HaltCode; import INT16 Platform_PID; import CHAR Platform_CWD[256]; import INT16 Platform_ArgCount; @@ -32,20 +28,18 @@ import ADDRESS *Platform_FileIdentity__typ; import BOOLEAN Platform_Absent (INT16 e); import INT16 Platform_ArgPos (CHAR *s, LONGINT s__len); -import void Platform_AssertFail (INT32 code); import INT16 Platform_Chdir (CHAR *n, LONGINT n__len); import INT16 Platform_Close (INT32 h); import BOOLEAN Platform_ConnectionFailed (INT16 e); import void Platform_Delay (INT32 ms); import BOOLEAN Platform_DifferentFilesystems (INT16 e); import INT16 Platform_Error (void); -import void Platform_Exit (INT16 code); +import void Platform_Exit (INT32 code); import void Platform_GetArg (INT16 n, CHAR *val, LONGINT val__len); import void Platform_GetClock (INT32 *t, INT32 *d); import void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); import void Platform_GetIntArg (INT16 n, INT32 *val); import void Platform_GetTimeOfDay (INT32 *sec, INT32 *usec); -import void Platform_Halt (INT32 code); import INT16 Platform_Identify (INT32 h, Platform_FileIdentity *identity, ADDRESS *identity__typ); import INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ); import BOOLEAN Platform_Inaccessible (INT16 e); @@ -65,7 +59,6 @@ import BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentit import BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); import INT16 Platform_Seek (INT32 h, INT32 offset, INT16 whence); import void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); -import void Platform_SetHalt (Platform_HaltProcedure p); import void Platform_SetInterruptHandler (Platform_SignalHandler handler); import void Platform_SetMTime (Platform_FileIdentity *target, ADDRESS *target__typ, Platform_FileIdentity source); import void Platform_SetQuitHandler (Platform_SignalHandler handler); diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index f7860591..955cd8dc 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index 5ed2ec95..fbae270c 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index 5ae2e44e..07e3b700 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index a9d577f6..e3525cd0 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index 3a949175..deefc817 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index 216e64dc..6fe829e0 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/VT100.c b/bootstrap/unix-88/VT100.c index 01b8a481..97a7d318 100644 --- a/bootstrap/unix-88/VT100.c +++ b/bootstrap/unix-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/VT100.h b/bootstrap/unix-88/VT100.h index 5ee411dd..577a2d44 100644 --- a/bootstrap/unix-88/VT100.h +++ b/bootstrap/unix-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-88/errors.c b/bootstrap/unix-88/errors.c index b7d411bb..aac72a79 100644 --- a/bootstrap/unix-88/errors.c +++ b/bootstrap/unix-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/errors.h b/bootstrap/unix-88/errors.h index fa08de1c..4f03779e 100644 --- a/bootstrap/unix-88/errors.h +++ b/bootstrap/unix-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index 74271e5d..3493ea47 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -7,6 +7,7 @@ #include "SYSTEM.h" #include "Configuration.h" +#include "Modules.h" #include "OPM.h" #include "Out.h" #include "Platform.h" @@ -53,9 +54,9 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN Out_Ln(); } if (status != 0) { - Platform_Halt(status); + Modules_Halt(status); } else { - Platform_Halt(exitcode); + Modules_Halt(exitcode); } } __DEL(title); @@ -114,6 +115,7 @@ export void *extTools__init(void) { __DEFMOD; __MODULE_IMPORT(Configuration); + __MODULE_IMPORT(Modules); __MODULE_IMPORT(OPM); __MODULE_IMPORT(Out); __MODULE_IMPORT(Platform); diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index 9b7b3c17..691b2968 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/Compiler.c b/bootstrap/windows-48/Compiler.c index 87b0392c..a6d5a403 100644 --- a/bootstrap/windows-48/Compiler.c +++ b/bootstrap/windows-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT INT8 #define INTEGER INT16 @@ -153,7 +153,7 @@ static void Compiler_Trap (INT32 sig) if (sig == 3) { Platform_Exit(0); } else { - if ((sig == 4 && Platform_HaltCode == -15)) { + if (sig == 4) { OPM_LogWStr((CHAR*)" --- Oberon compiler internal error", 36); OPM_LogWLn(); } diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index c15b87f9..d84a7f24 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index f169a3b6..09543f0b 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 1d23fdc4..1b2bcbfc 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index 38b52f44..89ff4f9d 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index 45b45394..2a5c9464 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -108,8 +108,8 @@ extern void *Heap__init(); extern ADDRESS Platform_MainStackFrame; extern ADDRESS Platform_OSAllocate(ADDRESS size); #define Heap_HeapModuleInit() Heap__init() +#define Heap_ModulesHalt(code) Modules_Halt(code) #define Heap_OSAllocate(size) Platform_OSAllocate(size) -#define Heap_PlatformHalt(code) Platform_Halt(code) #define Heap_PlatformMainStackFrame() Platform_MainStackFrame void Heap_Lock (void) @@ -121,7 +121,7 @@ void Heap_Unlock (void) { Heap_lockdepth -= 1; if ((Heap_interrupted && Heap_lockdepth == 0)) { - Heap_PlatformHalt(-9); + Heap_ModulesHalt(-9); } } diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index 8626628d..5f888271 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index 5eddf9be..23c71a96 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -7,6 +7,7 @@ #include "SYSTEM.h" #include "Heap.h" +#include "Platform.h" typedef struct Modules_CmdDesc *Modules_Cmd; @@ -47,9 +48,16 @@ export ADDRESS *Modules_ModuleDesc__typ; export ADDRESS *Modules_CmdDesc__typ; static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len); +export void Modules_AssertFail (INT32 code); +static void Modules_DisplayHaltCode (INT32 code); export void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all); +export void Modules_Halt (INT32 code); export Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len); export Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len); +static void Modules_errch (CHAR c); +export void Modules_errint (INT32 l); +static void Modules_errposint (INT32 l); +export void Modules_errstring (CHAR *s, LONGINT s__len); #define Modules_modules() (Modules_Module)Heap_modules #define Modules_setmodules(m) Heap_modules = m @@ -155,6 +163,121 @@ void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all) __DEL(name); } +static void Modules_errch (CHAR c) +{ + INT16 e; + e = Platform_Write(1, (ADDRESS)&c, 1); +} + +void Modules_errstring (CHAR *s, LONGINT s__len) +{ + INT32 i; + __DUP(s, s__len, CHAR); + i = 0; + while ((i < s__len && s[__X(i, s__len)] != 0x00)) { + Modules_errch(s[__X(i, s__len)]); + i += 1; + } + __DEL(s); +} + +static void Modules_errposint (INT32 l) +{ + if (l > 10) { + Modules_errposint(__DIV(l, 10)); + } + Modules_errch((CHAR)(48 + (int)__MOD(l, 10))); +} + +void Modules_errint (INT32 l) +{ + if (l < 0) { + Modules_errch('-'); + l = -l; + } + Modules_errposint(l); +} + +static void Modules_DisplayHaltCode (INT32 code) +{ + switch (code) { + case -1: + Modules_errstring((CHAR*)"Assertion failure.", 19); + break; + case -2: + Modules_errstring((CHAR*)"Index out of range.", 20); + break; + case -3: + Modules_errstring((CHAR*)"Reached end of function without reaching RETURN.", 49); + break; + case -4: + Modules_errstring((CHAR*)"CASE statement: no matching label and no ELSE.", 47); + break; + case -5: + Modules_errstring((CHAR*)"Type guard failed.", 19); + break; + case -6: + Modules_errstring((CHAR*)"Implicit type guard in record assignment failed.", 49); + break; + case -7: + Modules_errstring((CHAR*)"Invalid case in WITH statement.", 32); + break; + case -8: + Modules_errstring((CHAR*)"Value out of range.", 20); + break; + case -9: + Modules_errstring((CHAR*)"Heap interrupted while locked, but lockdepth = 0 at unlock.", 60); + break; + case -10: + Modules_errstring((CHAR*)"NIL access.", 12); + break; + case -11: + Modules_errstring((CHAR*)"Alignment error.", 17); + break; + case -12: + Modules_errstring((CHAR*)"Divide by zero.", 16); + break; + case -13: + Modules_errstring((CHAR*)"Arithmetic overflow/underflow.", 31); + break; + case -14: + Modules_errstring((CHAR*)"Invalid function argument.", 27); + break; + case -15: + Modules_errstring((CHAR*)"Internal error, e.g. Type descriptor size mismatch.", 52); + break; + case -20: + Modules_errstring((CHAR*)"Too many, or negative number of, elements in dynamic array.", 60); + break; + default: + break; + } +} + +void Modules_Halt (INT32 code) +{ + Modules_errstring((CHAR*)"Terminated by Halt(", 20); + Modules_errint(code); + Modules_errstring((CHAR*)"). ", 4); + if (code < 0) { + Modules_DisplayHaltCode(code); + } + Modules_errstring(Platform_NL, 3); + Platform_Exit(code); +} + +void Modules_AssertFail (INT32 code) +{ + Modules_errstring((CHAR*)"Assertion failure.", 19); + if (code != 0) { + Modules_errstring((CHAR*)" ASSERT code ", 14); + Modules_errint(code); + Modules_errstring((CHAR*)".", 2); + } + Modules_errstring(Platform_NL, 3); + Platform_Exit(code); +} + __TDESC(Modules_ModuleDesc, 1, 2) = {__TDFLDS("ModuleDesc", 48), {0, 28, -12}}; __TDESC(Modules_CmdDesc, 1, 1) = {__TDFLDS("CmdDesc", 32), {0, -8}}; @@ -162,6 +285,7 @@ export void *Modules__init(void) { __DEFMOD; __MODULE_IMPORT(Heap); + __MODULE_IMPORT(Platform); __REGMOD("Modules", 0); __INITYP(Modules_ModuleDesc, Modules_ModuleDesc, 0); __INITYP(Modules_CmdDesc, Modules_CmdDesc, 0); diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index 2da3fa50..6809ec05 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h @@ -43,9 +43,13 @@ import Modules_ModuleName Modules_imported, Modules_importing; import ADDRESS *Modules_ModuleDesc__typ; import ADDRESS *Modules_CmdDesc__typ; +import void Modules_AssertFail (INT32 code); import void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all); +import void Modules_Halt (INT32 code); import Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len); import Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len); +import void Modules_errint (INT32 l); +import void Modules_errstring (CHAR *s, LONGINT s__len); import void *Modules__init(void); #define Modules_modules() (Modules_Module)Heap_modules diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index dcac4eb9..8a1b80fe 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index cb6399f9..0caeb234 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 9b3d80c3..c4b9a965 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index 6cc996c8..a1917812 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 0ac4141a..9610f289 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index 91212642..fce0614a 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index 6a24e3cd..124bccb1 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index 3cadf5a4..978ccdff 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index 898b14b6..845787eb 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index 34906046..d8134366 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index a8951123..46e05141 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index 3a248e3c..e3170fc0 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index 77b842f8..bc68a5c6 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index 34e34ae6..9d02e218 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Out.c b/bootstrap/windows-48/Out.c index de6a9e16..dc4c9541 100644 --- a/bootstrap/windows-48/Out.c +++ b/bootstrap/windows-48/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Out.h b/bootstrap/windows-48/Out.h index 63fefd3c..247b98de 100644 --- a/bootstrap/windows-48/Out.h +++ b/bootstrap/windows-48/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 29801da0..dcf47b13 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -49,22 +49,19 @@ export ADDRESS *Platform_FileIdentity__typ; export BOOLEAN Platform_Absent (INT16 e); export INT16 Platform_ArgPos (CHAR *s, LONGINT s__len); -export void Platform_AssertFail (INT32 code); export INT16 Platform_Chdir (CHAR *n, LONGINT n__len); export INT16 Platform_Close (INT32 h); export BOOLEAN Platform_ConnectionFailed (INT16 e); export void Platform_Delay (INT32 ms); export BOOLEAN Platform_DifferentFilesystems (INT16 e); -static void Platform_DisplayHaltCode (INT32 code); static void Platform_EnableVT100 (void); export INT16 Platform_Error (void); -export void Platform_Exit (INT16 code); +export void Platform_Exit (INT32 code); export void Platform_GetArg (INT16 n, CHAR *val, LONGINT val__len); export void Platform_GetClock (INT32 *t, INT32 *d); export void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); export void Platform_GetIntArg (INT16 n, INT32 *val); export void Platform_GetTimeOfDay (INT32 *sec, INT32 *usec); -export void Platform_Halt (INT32 code); export INT16 Platform_Identify (INT32 h, Platform_FileIdentity *identity, ADDRESS *identity__typ); export INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ); export BOOLEAN Platform_Inaccessible (INT16 e); @@ -84,7 +81,6 @@ export BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentit export BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); export INT16 Platform_Seek (INT32 h, INT32 o, INT16 r); export void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); -export void Platform_SetHalt (Platform_HaltProcedure p); export void Platform_SetMTime (Platform_FileIdentity *target, ADDRESS *target__typ, Platform_FileIdentity source); export INT16 Platform_Size (INT32 h, INT32 *l); export INT16 Platform_Sync (INT32 h); @@ -97,10 +93,6 @@ export INT16 Platform_Truncate (INT32 h, INT32 limit); export INT16 Platform_Unlink (CHAR *n, LONGINT n__len); export INT16 Platform_Write (INT32 h, INT32 p, INT32 l); static void Platform_YMDHMStoClock (INT16 ye, INT16 mo, INT16 da, INT16 ho, INT16 mi, INT16 se, INT32 *t, INT32 *d); -static void Platform_errch (CHAR c); -static void Platform_errint (INT32 l); -static void Platform_errln (void); -static void Platform_errposint (INT32 l); export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); #include "WindowsWrapper.h" @@ -137,8 +129,6 @@ extern void Heap_InitHeap(); #define Platform_createProcess(str, str__len) (INTEGER)CreateProcess(0, (char*)str, 0,0,0,0,0,0,&si,&pi) #define Platform_deleteFile(n, n__len) (INTEGER)DeleteFile((char*)n) #define Platform_err() (INTEGER)GetLastError() -#define Platform_errc(c) WriteFile((HANDLE)Platform_StdOut, &c, 1, 0,0) -#define Platform_errstring(s, s__len) WriteFile((HANDLE)Platform_StdOut, s, s__len-1, 0,0) #define Platform_exit(code) ExitProcess((UINT)code) #define Platform_fileTimeToSysTime() SYSTEMTIME st; FileTimeToSystemTime(&ft, &st) #define Platform_flushFileBuffers(h) (INTEGER)FlushFileBuffers((HANDLE)h) @@ -619,128 +609,11 @@ INT16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) __RETCHK; } -void Platform_Exit (INT16 code) +void Platform_Exit (INT32 code) { Platform_exit(code); } -static void Platform_errch (CHAR c) -{ - Platform_errc(c); -} - -static void Platform_errln (void) -{ - Platform_errch(0x0d); - Platform_errch(0x0a); -} - -static void Platform_errposint (INT32 l) -{ - if (l > 10) { - Platform_errposint(__DIV(l, 10)); - } - Platform_errch((CHAR)(48 + (int)__MOD(l, 10))); -} - -static void Platform_errint (INT32 l) -{ - if (l < 0) { - Platform_errch('-'); - l = -l; - } - Platform_errposint(l); -} - -static void Platform_DisplayHaltCode (INT32 code) -{ - switch (code) { - case -1: - Platform_errstring((CHAR*)"Assertion failure.", 19); - break; - case -2: - Platform_errstring((CHAR*)"Index out of range.", 20); - break; - case -3: - Platform_errstring((CHAR*)"Reached end of function without reaching RETURN.", 49); - break; - case -4: - Platform_errstring((CHAR*)"CASE statement: no matching label and no ELSE.", 47); - break; - case -5: - Platform_errstring((CHAR*)"Type guard failed.", 19); - break; - case -6: - Platform_errstring((CHAR*)"Type equality failed.", 22); - break; - case -7: - Platform_errstring((CHAR*)"WITH statement type guard failed.", 34); - break; - case -8: - Platform_errstring((CHAR*)"SHORT: Value too large for shorter type.", 41); - break; - case -9: - Platform_errstring((CHAR*)"Heap interrupted while locked, but lockdepth = 0 at unlock.", 60); - break; - case -10: - Platform_errstring((CHAR*)"NIL access.", 12); - break; - case -11: - Platform_errstring((CHAR*)"Alignment error.", 17); - break; - case -12: - Platform_errstring((CHAR*)"Divide by zero.", 16); - break; - case -13: - Platform_errstring((CHAR*)"Arithmetic overflow/underflow.", 31); - break; - case -14: - Platform_errstring((CHAR*)"Invalid function argument.", 27); - break; - case -15: - Platform_errstring((CHAR*)"Internal error, e.g. Type descriptor size mismatch.", 52); - break; - case -20: - Platform_errstring((CHAR*)"Too many, or negative number of, elements in dynamic array.", 60); - break; - default: - break; - } -} - -void Platform_Halt (INT32 code) -{ - Platform_HaltCode = code; - if (Platform_HaltHandler != NIL) { - (*Platform_HaltHandler)(code); - } - Platform_errstring((CHAR*)"Terminated by Halt(", 20); - Platform_errint(code); - Platform_errstring((CHAR*)"). ", 4); - if (code < 0) { - Platform_DisplayHaltCode(code); - } - Platform_errln(); - Platform_exit(__VAL(INT16, code)); -} - -void Platform_AssertFail (INT32 code) -{ - Platform_errstring((CHAR*)"Assertion failure.", 19); - if (code != 0) { - Platform_errstring((CHAR*)" ASSERT code ", 14); - Platform_errint(code); - Platform_errstring((CHAR*)".", 2); - } - Platform_errln(); - Platform_exit(__VAL(INT16, code)); -} - -void Platform_SetHalt (Platform_HaltProcedure p) -{ - Platform_HaltHandler = p; -} - static void Platform_EnableVT100 (void) { INT32 mode; diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index e96a1eec..714c8e3c 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h @@ -11,9 +11,6 @@ typedef char _prvt1[16]; } Platform_FileIdentity; -typedef - void (*Platform_HaltProcedure)(INT32); - typedef void (*Platform_SignalHandler)(INT32); @@ -33,20 +30,18 @@ import ADDRESS *Platform_FileIdentity__typ; import BOOLEAN Platform_Absent (INT16 e); import INT16 Platform_ArgPos (CHAR *s, LONGINT s__len); -import void Platform_AssertFail (INT32 code); import INT16 Platform_Chdir (CHAR *n, LONGINT n__len); import INT16 Platform_Close (INT32 h); import BOOLEAN Platform_ConnectionFailed (INT16 e); import void Platform_Delay (INT32 ms); import BOOLEAN Platform_DifferentFilesystems (INT16 e); import INT16 Platform_Error (void); -import void Platform_Exit (INT16 code); +import void Platform_Exit (INT32 code); import void Platform_GetArg (INT16 n, CHAR *val, LONGINT val__len); import void Platform_GetClock (INT32 *t, INT32 *d); import void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); import void Platform_GetIntArg (INT16 n, INT32 *val); import void Platform_GetTimeOfDay (INT32 *sec, INT32 *usec); -import void Platform_Halt (INT32 code); import INT16 Platform_Identify (INT32 h, Platform_FileIdentity *identity, ADDRESS *identity__typ); import INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ); import BOOLEAN Platform_Inaccessible (INT16 e); @@ -66,7 +61,6 @@ import BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentit import BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); import INT16 Platform_Seek (INT32 h, INT32 o, INT16 r); import void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); -import void Platform_SetHalt (Platform_HaltProcedure p); import void Platform_SetMTime (Platform_FileIdentity *target, ADDRESS *target__typ, Platform_FileIdentity source); import INT16 Platform_Size (INT32 h, INT32 *l); import INT16 Platform_Sync (INT32 h); diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index f7860591..955cd8dc 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index 5ed2ec95..fbae270c 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index 5ae2e44e..07e3b700 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index a9d577f6..e3525cd0 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index 987b9952..36cd76fb 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index e902469a..4bae7210 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/VT100.c b/bootstrap/windows-48/VT100.c index 01b8a481..97a7d318 100644 --- a/bootstrap/windows-48/VT100.c +++ b/bootstrap/windows-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/VT100.h b/bootstrap/windows-48/VT100.h index 5ee411dd..577a2d44 100644 --- a/bootstrap/windows-48/VT100.h +++ b/bootstrap/windows-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-48/errors.c b/bootstrap/windows-48/errors.c index b7d411bb..aac72a79 100644 --- a/bootstrap/windows-48/errors.c +++ b/bootstrap/windows-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/errors.h b/bootstrap/windows-48/errors.h index fa08de1c..4f03779e 100644 --- a/bootstrap/windows-48/errors.h +++ b/bootstrap/windows-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index 74271e5d..3493ea47 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -7,6 +7,7 @@ #include "SYSTEM.h" #include "Configuration.h" +#include "Modules.h" #include "OPM.h" #include "Out.h" #include "Platform.h" @@ -53,9 +54,9 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN Out_Ln(); } if (status != 0) { - Platform_Halt(status); + Modules_Halt(status); } else { - Platform_Halt(exitcode); + Modules_Halt(exitcode); } } __DEL(title); @@ -114,6 +115,7 @@ export void *extTools__init(void) { __DEFMOD; __MODULE_IMPORT(Configuration); + __MODULE_IMPORT(Modules); __MODULE_IMPORT(OPM); __MODULE_IMPORT(Out); __MODULE_IMPORT(Platform); diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index 9b7b3c17..691b2968 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/Compiler.c b/bootstrap/windows-88/Compiler.c index 87b0392c..a6d5a403 100644 --- a/bootstrap/windows-88/Compiler.c +++ b/bootstrap/windows-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT INT8 #define INTEGER INT16 @@ -153,7 +153,7 @@ static void Compiler_Trap (INT32 sig) if (sig == 3) { Platform_Exit(0); } else { - if ((sig == 4 && Platform_HaltCode == -15)) { + if (sig == 4) { OPM_LogWStr((CHAR*)" --- Oberon compiler internal error", 36); OPM_LogWLn(); } diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index c15b87f9..d84a7f24 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index f169a3b6..09543f0b 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index c519f8d5..fe9b24c9 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 376ef83e..5b66b18a 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index 806a01db..46f70cc1 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -108,8 +108,8 @@ extern void *Heap__init(); extern ADDRESS Platform_MainStackFrame; extern ADDRESS Platform_OSAllocate(ADDRESS size); #define Heap_HeapModuleInit() Heap__init() +#define Heap_ModulesHalt(code) Modules_Halt(code) #define Heap_OSAllocate(size) Platform_OSAllocate(size) -#define Heap_PlatformHalt(code) Platform_Halt(code) #define Heap_PlatformMainStackFrame() Platform_MainStackFrame void Heap_Lock (void) @@ -121,7 +121,7 @@ void Heap_Unlock (void) { Heap_lockdepth -= 1; if ((Heap_interrupted && Heap_lockdepth == 0)) { - Heap_PlatformHalt(-9); + Heap_ModulesHalt(-9); } } diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index 2603a3eb..06cbd0ec 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index f463ec4e..494f9fdc 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -7,6 +7,7 @@ #include "SYSTEM.h" #include "Heap.h" +#include "Platform.h" typedef struct Modules_CmdDesc *Modules_Cmd; @@ -47,9 +48,16 @@ export ADDRESS *Modules_ModuleDesc__typ; export ADDRESS *Modules_CmdDesc__typ; static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len); +export void Modules_AssertFail (INT32 code); +static void Modules_DisplayHaltCode (INT32 code); export void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all); +export void Modules_Halt (INT32 code); export Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len); export Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len); +static void Modules_errch (CHAR c); +export void Modules_errint (INT32 l); +static void Modules_errposint (INT32 l); +export void Modules_errstring (CHAR *s, LONGINT s__len); #define Modules_modules() (Modules_Module)Heap_modules #define Modules_setmodules(m) Heap_modules = m @@ -155,6 +163,121 @@ void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all) __DEL(name); } +static void Modules_errch (CHAR c) +{ + INT16 e; + e = Platform_Write(1, (ADDRESS)&c, 1); +} + +void Modules_errstring (CHAR *s, LONGINT s__len) +{ + INT32 i; + __DUP(s, s__len, CHAR); + i = 0; + while ((i < s__len && s[__X(i, s__len)] != 0x00)) { + Modules_errch(s[__X(i, s__len)]); + i += 1; + } + __DEL(s); +} + +static void Modules_errposint (INT32 l) +{ + if (l > 10) { + Modules_errposint(__DIV(l, 10)); + } + Modules_errch((CHAR)(48 + (int)__MOD(l, 10))); +} + +void Modules_errint (INT32 l) +{ + if (l < 0) { + Modules_errch('-'); + l = -l; + } + Modules_errposint(l); +} + +static void Modules_DisplayHaltCode (INT32 code) +{ + switch (code) { + case -1: + Modules_errstring((CHAR*)"Assertion failure.", 19); + break; + case -2: + Modules_errstring((CHAR*)"Index out of range.", 20); + break; + case -3: + Modules_errstring((CHAR*)"Reached end of function without reaching RETURN.", 49); + break; + case -4: + Modules_errstring((CHAR*)"CASE statement: no matching label and no ELSE.", 47); + break; + case -5: + Modules_errstring((CHAR*)"Type guard failed.", 19); + break; + case -6: + Modules_errstring((CHAR*)"Implicit type guard in record assignment failed.", 49); + break; + case -7: + Modules_errstring((CHAR*)"Invalid case in WITH statement.", 32); + break; + case -8: + Modules_errstring((CHAR*)"Value out of range.", 20); + break; + case -9: + Modules_errstring((CHAR*)"Heap interrupted while locked, but lockdepth = 0 at unlock.", 60); + break; + case -10: + Modules_errstring((CHAR*)"NIL access.", 12); + break; + case -11: + Modules_errstring((CHAR*)"Alignment error.", 17); + break; + case -12: + Modules_errstring((CHAR*)"Divide by zero.", 16); + break; + case -13: + Modules_errstring((CHAR*)"Arithmetic overflow/underflow.", 31); + break; + case -14: + Modules_errstring((CHAR*)"Invalid function argument.", 27); + break; + case -15: + Modules_errstring((CHAR*)"Internal error, e.g. Type descriptor size mismatch.", 52); + break; + case -20: + Modules_errstring((CHAR*)"Too many, or negative number of, elements in dynamic array.", 60); + break; + default: + break; + } +} + +void Modules_Halt (INT32 code) +{ + Modules_errstring((CHAR*)"Terminated by Halt(", 20); + Modules_errint(code); + Modules_errstring((CHAR*)"). ", 4); + if (code < 0) { + Modules_DisplayHaltCode(code); + } + Modules_errstring(Platform_NL, 3); + Platform_Exit(code); +} + +void Modules_AssertFail (INT32 code) +{ + Modules_errstring((CHAR*)"Assertion failure.", 19); + if (code != 0) { + Modules_errstring((CHAR*)" ASSERT code ", 14); + Modules_errint(code); + Modules_errstring((CHAR*)".", 2); + } + Modules_errstring(Platform_NL, 3); + Platform_Exit(code); +} + __TDESC(Modules_ModuleDesc, 1, 2) = {__TDFLDS("ModuleDesc", 64), {0, 32, -24}}; __TDESC(Modules_CmdDesc, 1, 1) = {__TDFLDS("CmdDesc", 40), {0, -16}}; @@ -162,6 +285,7 @@ export void *Modules__init(void) { __DEFMOD; __MODULE_IMPORT(Heap); + __MODULE_IMPORT(Platform); __REGMOD("Modules", 0); __INITYP(Modules_ModuleDesc, Modules_ModuleDesc, 0); __INITYP(Modules_CmdDesc, Modules_CmdDesc, 0); diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index 2da3fa50..6809ec05 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h @@ -43,9 +43,13 @@ import Modules_ModuleName Modules_imported, Modules_importing; import ADDRESS *Modules_ModuleDesc__typ; import ADDRESS *Modules_CmdDesc__typ; +import void Modules_AssertFail (INT32 code); import void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all); +import void Modules_Halt (INT32 code); import Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len); import Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len); +import void Modules_errint (INT32 l); +import void Modules_errstring (CHAR *s, LONGINT s__len); import void *Modules__init(void); #define Modules_modules() (Modules_Module)Heap_modules diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index dcac4eb9..8a1b80fe 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index cb6399f9..0caeb234 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index 9b3d80c3..c4b9a965 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index 6cc996c8..a1917812 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 97726a71..c2258e5b 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index 91212642..fce0614a 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index e3840599..bcedf318 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index 3cadf5a4..978ccdff 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index 898b14b6..845787eb 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index 34906046..d8134366 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index 0a7b463e..896d5ead 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 3a248e3c..e3170fc0 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 7c411904..3602bbf6 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index 34e34ae6..9d02e218 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Out.c b/bootstrap/windows-88/Out.c index de6a9e16..dc4c9541 100644 --- a/bootstrap/windows-88/Out.c +++ b/bootstrap/windows-88/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Out.h b/bootstrap/windows-88/Out.h index 63fefd3c..247b98de 100644 --- a/bootstrap/windows-88/Out.h +++ b/bootstrap/windows-88/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 151ed04c..91508fdf 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -49,22 +49,19 @@ export ADDRESS *Platform_FileIdentity__typ; export BOOLEAN Platform_Absent (INT16 e); export INT16 Platform_ArgPos (CHAR *s, LONGINT s__len); -export void Platform_AssertFail (INT32 code); export INT16 Platform_Chdir (CHAR *n, LONGINT n__len); export INT16 Platform_Close (INT64 h); export BOOLEAN Platform_ConnectionFailed (INT16 e); export void Platform_Delay (INT32 ms); export BOOLEAN Platform_DifferentFilesystems (INT16 e); -static void Platform_DisplayHaltCode (INT32 code); static void Platform_EnableVT100 (void); export INT16 Platform_Error (void); -export void Platform_Exit (INT16 code); +export void Platform_Exit (INT32 code); export void Platform_GetArg (INT16 n, CHAR *val, LONGINT val__len); export void Platform_GetClock (INT32 *t, INT32 *d); export void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); export void Platform_GetIntArg (INT16 n, INT32 *val); export void Platform_GetTimeOfDay (INT32 *sec, INT32 *usec); -export void Platform_Halt (INT32 code); export INT16 Platform_Identify (INT64 h, Platform_FileIdentity *identity, ADDRESS *identity__typ); export INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ); export BOOLEAN Platform_Inaccessible (INT16 e); @@ -84,7 +81,6 @@ export BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentit export BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); export INT16 Platform_Seek (INT64 h, INT32 o, INT16 r); export void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); -export void Platform_SetHalt (Platform_HaltProcedure p); export void Platform_SetMTime (Platform_FileIdentity *target, ADDRESS *target__typ, Platform_FileIdentity source); export INT16 Platform_Size (INT64 h, INT32 *l); export INT16 Platform_Sync (INT64 h); @@ -97,10 +93,6 @@ export INT16 Platform_Truncate (INT64 h, INT32 limit); export INT16 Platform_Unlink (CHAR *n, LONGINT n__len); export INT16 Platform_Write (INT64 h, INT64 p, INT32 l); static void Platform_YMDHMStoClock (INT16 ye, INT16 mo, INT16 da, INT16 ho, INT16 mi, INT16 se, INT32 *t, INT32 *d); -static void Platform_errch (CHAR c); -static void Platform_errint (INT32 l); -static void Platform_errln (void); -static void Platform_errposint (INT32 l); export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); #include "WindowsWrapper.h" @@ -137,8 +129,6 @@ extern void Heap_InitHeap(); #define Platform_createProcess(str, str__len) (INTEGER)CreateProcess(0, (char*)str, 0,0,0,0,0,0,&si,&pi) #define Platform_deleteFile(n, n__len) (INTEGER)DeleteFile((char*)n) #define Platform_err() (INTEGER)GetLastError() -#define Platform_errc(c) WriteFile((HANDLE)Platform_StdOut, &c, 1, 0,0) -#define Platform_errstring(s, s__len) WriteFile((HANDLE)Platform_StdOut, s, s__len-1, 0,0) #define Platform_exit(code) ExitProcess((UINT)code) #define Platform_fileTimeToSysTime() SYSTEMTIME st; FileTimeToSystemTime(&ft, &st) #define Platform_flushFileBuffers(h) (INTEGER)FlushFileBuffers((HANDLE)h) @@ -619,128 +609,11 @@ INT16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) __RETCHK; } -void Platform_Exit (INT16 code) +void Platform_Exit (INT32 code) { Platform_exit(code); } -static void Platform_errch (CHAR c) -{ - Platform_errc(c); -} - -static void Platform_errln (void) -{ - Platform_errch(0x0d); - Platform_errch(0x0a); -} - -static void Platform_errposint (INT32 l) -{ - if (l > 10) { - Platform_errposint(__DIV(l, 10)); - } - Platform_errch((CHAR)(48 + (int)__MOD(l, 10))); -} - -static void Platform_errint (INT32 l) -{ - if (l < 0) { - Platform_errch('-'); - l = -l; - } - Platform_errposint(l); -} - -static void Platform_DisplayHaltCode (INT32 code) -{ - switch (code) { - case -1: - Platform_errstring((CHAR*)"Assertion failure.", 19); - break; - case -2: - Platform_errstring((CHAR*)"Index out of range.", 20); - break; - case -3: - Platform_errstring((CHAR*)"Reached end of function without reaching RETURN.", 49); - break; - case -4: - Platform_errstring((CHAR*)"CASE statement: no matching label and no ELSE.", 47); - break; - case -5: - Platform_errstring((CHAR*)"Type guard failed.", 19); - break; - case -6: - Platform_errstring((CHAR*)"Type equality failed.", 22); - break; - case -7: - Platform_errstring((CHAR*)"WITH statement type guard failed.", 34); - break; - case -8: - Platform_errstring((CHAR*)"SHORT: Value too large for shorter type.", 41); - break; - case -9: - Platform_errstring((CHAR*)"Heap interrupted while locked, but lockdepth = 0 at unlock.", 60); - break; - case -10: - Platform_errstring((CHAR*)"NIL access.", 12); - break; - case -11: - Platform_errstring((CHAR*)"Alignment error.", 17); - break; - case -12: - Platform_errstring((CHAR*)"Divide by zero.", 16); - break; - case -13: - Platform_errstring((CHAR*)"Arithmetic overflow/underflow.", 31); - break; - case -14: - Platform_errstring((CHAR*)"Invalid function argument.", 27); - break; - case -15: - Platform_errstring((CHAR*)"Internal error, e.g. Type descriptor size mismatch.", 52); - break; - case -20: - Platform_errstring((CHAR*)"Too many, or negative number of, elements in dynamic array.", 60); - break; - default: - break; - } -} - -void Platform_Halt (INT32 code) -{ - Platform_HaltCode = code; - if (Platform_HaltHandler != NIL) { - (*Platform_HaltHandler)(code); - } - Platform_errstring((CHAR*)"Terminated by Halt(", 20); - Platform_errint(code); - Platform_errstring((CHAR*)"). ", 4); - if (code < 0) { - Platform_DisplayHaltCode(code); - } - Platform_errln(); - Platform_exit(__VAL(INT16, code)); -} - -void Platform_AssertFail (INT32 code) -{ - Platform_errstring((CHAR*)"Assertion failure.", 19); - if (code != 0) { - Platform_errstring((CHAR*)" ASSERT code ", 14); - Platform_errint(code); - Platform_errstring((CHAR*)".", 2); - } - Platform_errln(); - Platform_exit(__VAL(INT16, code)); -} - -void Platform_SetHalt (Platform_HaltProcedure p) -{ - Platform_HaltHandler = p; -} - static void Platform_EnableVT100 (void) { INT32 mode; diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index e3841844..c6c57d6a 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h @@ -11,9 +11,6 @@ typedef char _prvt1[16]; } Platform_FileIdentity; -typedef - void (*Platform_HaltProcedure)(INT32); - typedef void (*Platform_SignalHandler)(INT32); @@ -33,20 +30,18 @@ import ADDRESS *Platform_FileIdentity__typ; import BOOLEAN Platform_Absent (INT16 e); import INT16 Platform_ArgPos (CHAR *s, LONGINT s__len); -import void Platform_AssertFail (INT32 code); import INT16 Platform_Chdir (CHAR *n, LONGINT n__len); import INT16 Platform_Close (INT64 h); import BOOLEAN Platform_ConnectionFailed (INT16 e); import void Platform_Delay (INT32 ms); import BOOLEAN Platform_DifferentFilesystems (INT16 e); import INT16 Platform_Error (void); -import void Platform_Exit (INT16 code); +import void Platform_Exit (INT32 code); import void Platform_GetArg (INT16 n, CHAR *val, LONGINT val__len); import void Platform_GetClock (INT32 *t, INT32 *d); import void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); import void Platform_GetIntArg (INT16 n, INT32 *val); import void Platform_GetTimeOfDay (INT32 *sec, INT32 *usec); -import void Platform_Halt (INT32 code); import INT16 Platform_Identify (INT64 h, Platform_FileIdentity *identity, ADDRESS *identity__typ); import INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ); import BOOLEAN Platform_Inaccessible (INT16 e); @@ -66,7 +61,6 @@ import BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentit import BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); import INT16 Platform_Seek (INT64 h, INT32 o, INT16 r); import void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); -import void Platform_SetHalt (Platform_HaltProcedure p); import void Platform_SetMTime (Platform_FileIdentity *target, ADDRESS *target__typ, Platform_FileIdentity source); import INT16 Platform_Size (INT64 h, INT32 *l); import INT16 Platform_Sync (INT64 h); diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index f7860591..955cd8dc 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index 5ed2ec95..fbae270c 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index 5ae2e44e..07e3b700 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index a9d577f6..e3525cd0 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index 3a949175..deefc817 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index 216e64dc..6fe829e0 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/VT100.c b/bootstrap/windows-88/VT100.c index 01b8a481..97a7d318 100644 --- a/bootstrap/windows-88/VT100.c +++ b/bootstrap/windows-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/VT100.h b/bootstrap/windows-88/VT100.h index 5ee411dd..577a2d44 100644 --- a/bootstrap/windows-88/VT100.h +++ b/bootstrap/windows-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-88/errors.c b/bootstrap/windows-88/errors.c index b7d411bb..aac72a79 100644 --- a/bootstrap/windows-88/errors.c +++ b/bootstrap/windows-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/errors.h b/bootstrap/windows-88/errors.h index fa08de1c..4f03779e 100644 --- a/bootstrap/windows-88/errors.h +++ b/bootstrap/windows-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index 74271e5d..3493ea47 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -7,6 +7,7 @@ #include "SYSTEM.h" #include "Configuration.h" +#include "Modules.h" #include "OPM.h" #include "Out.h" #include "Platform.h" @@ -53,9 +54,9 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN Out_Ln(); } if (status != 0) { - Platform_Halt(status); + Modules_Halt(status); } else { - Platform_Halt(exitcode); + Modules_Halt(exitcode); } } __DEL(title); @@ -114,6 +115,7 @@ export void *extTools__init(void) { __DEFMOD; __MODULE_IMPORT(Configuration); + __MODULE_IMPORT(Modules); __MODULE_IMPORT(OPM); __MODULE_IMPORT(Out); __MODULE_IMPORT(Platform); diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index 9b7b3c17..691b2968 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/src/compiler/Compiler.Mod b/src/compiler/Compiler.Mod index c8e3c40f..6c6381e6 100644 --- a/src/compiler/Compiler.Mod +++ b/src/compiler/Compiler.Mod @@ -135,9 +135,8 @@ MODULE Compiler; (* J. Templ 3.2.95 *) IF sig = 3 THEN Platform.Exit(0) ELSE - IF (sig = 4) & (Platform.HaltCode = -15) THEN - OPM.LogWStr(" --- Oberon compiler internal error"); - OPM.LogWLn + IF sig = 4 THEN + OPM.LogWStr(" --- Oberon compiler internal error"); OPM.LogWLn END ; Platform.Exit(2) END diff --git a/src/compiler/extTools.Mod b/src/compiler/extTools.Mod index 8c84ecae..2847768e 100644 --- a/src/compiler/extTools.Mod +++ b/src/compiler/extTools.Mod @@ -1,6 +1,6 @@ MODULE extTools; -IMPORT Strings, Out, Configuration, Platform, OPM; +IMPORT Strings, Out, Configuration, Platform, Modules, OPM; VAR CFLAGS: ARRAY 1023 OF CHAR; @@ -24,7 +24,7 @@ BEGIN IF (status = 0) & (exitcode = 127) THEN Out.String("Is the C compiler in the current command path?"); Out.Ln END; - IF status # 0 THEN Platform.Halt(status) ELSE Platform.Halt(exitcode) END + IF status # 0 THEN Modules.Halt(status) ELSE Modules.Halt(exitcode) END END; END execute; diff --git a/src/library/s3/ethReals.Mod b/src/library/s3/ethReals.Mod index ea2d9d9f..484b186c 100644 --- a/src/library/s3/ethReals.Mod +++ b/src/library/s3/ethReals.Mod @@ -10,7 +10,7 @@ Implemented by Bernd Moesli, Seminar for Applied Mathematics, Swiss Federal Institute of Technology Z…rich. *) -IMPORT SYSTEM, Platform; +IMPORT SYSTEM, Modules; (* Bernd Moesli Seminar for Applied Mathematics @@ -50,7 +50,7 @@ BEGIN RETURN SHORT(ASH(SYSTEM.VAL(INTEGER, x), -23)) MOD 256 ELSIF SIZE(LONGINT) = 4 THEN RETURN SHORT(ASH(SYSTEM.VAL(LONGINT, x), -23)) MOD 256 - ELSE Platform.Halt(-15); + ELSE Modules.Halt(-15); END END Expo; @@ -77,7 +77,7 @@ BEGIN SYSTEM.GET(SYSTEM.ADR(x), i); i := SHORT(ASH(ASH(ASH(i, -31), 8) + e MOD 256, 23) + i MOD ASH(1, 23)); SYSTEM.PUT(SYSTEM.ADR(x), i) - ELSE Platform.Halt(-15) + ELSE Modules.Halt(-15) END END SetExpo; @@ -93,7 +93,7 @@ BEGIN SYSTEM.GET(SYSTEM.ADR(x) + H, i); i := SHORT(ASH(ASH(ASH(i, -31), 11) + e MOD 2048, 20) + i MOD ASH(1, 20)); SYSTEM.PUT(SYSTEM.ADR(x) + H, i) - ELSE Platform.Halt(-15) + ELSE Modules.Halt(-15) END END SetExpoL; @@ -105,7 +105,7 @@ BEGIN SYSTEM.PUT(SYSTEM.ADR(x), h) ELSIF SIZE(INTEGER) = 4 THEN SYSTEM.PUT(SYSTEM.ADR(x), SYSTEM.VAL(INTEGER, h)) - ELSE Platform.Halt(-15) + ELSE Modules.Halt(-15) END; RETURN x END Real; @@ -120,7 +120,7 @@ BEGIN ELSIF SIZE(INTEGER) = 4 THEN SYSTEM.PUT(SYSTEM.ADR(x) + H, SYSTEM.VAL(INTEGER, h)); SYSTEM.PUT(SYSTEM.ADR(x) + L, SYSTEM.VAL(INTEGER, l)) - ELSE Platform.Halt(-15) + ELSE Modules.Halt(-15) END; RETURN x END RealL; @@ -133,7 +133,7 @@ BEGIN SYSTEM.PUT(SYSTEM.ADR(l), x); RETURN l ELSIF SIZE(INTEGER) = 4 THEN SYSTEM.PUT(SYSTEM.ADR(i), x); RETURN i - ELSE Platform.Halt(-15) + ELSE Modules.Halt(-15) END END Int; @@ -147,7 +147,7 @@ BEGIN ELSIF SIZE(INTEGER) = 4 THEN SYSTEM.GET(SYSTEM.ADR(x) + H, i); h := i; SYSTEM.GET(SYSTEM.ADR(x) + L, i); l := i - ELSE Platform.Halt(-15) + ELSE Modules.Halt(-15) END END IntL; diff --git a/src/runtime/Heap.Mod b/src/runtime/Heap.Mod index a74b4684..550867f7 100644 --- a/src/runtime/Heap.Mod +++ b/src/runtime/Heap.Mod @@ -99,13 +99,13 @@ MODULE Heap; INC(lockdepth); END Lock; - PROCEDURE -PlatformHalt(code: LONGINT) "Platform_Halt(code)"; + PROCEDURE -ModulesHalt(code: LONGINT) "Modules_Halt(code)"; PROCEDURE Unlock*; BEGIN DEC(lockdepth); IF interrupted & (lockdepth = 0) THEN - PlatformHalt(-9); + ModulesHalt(-9); END END Unlock; diff --git a/src/runtime/Modules.Mod b/src/runtime/Modules.Mod index 26268749..33d210d6 100644 --- a/src/runtime/Modules.Mod +++ b/src/runtime/Modules.Mod @@ -3,7 +3,7 @@ MODULE Modules; (* jt 6.1.96 *) (* access to list of modules and commands, based on ETH Oberon *) - IMPORT SYSTEM, Heap; + IMPORT SYSTEM, Heap, Platform; CONST ModNameLen* = 20; @@ -93,4 +93,69 @@ MODULE Modules; (* jt 6.1.96 *) END END Free; + + (* Run time error reporting. *) + + PROCEDURE errch(c: CHAR); (* Here we favour simplicity over efficiency, so no buffering. *) + VAR e: Platform.ErrorCode; + BEGIN e := Platform.Write(1, SYSTEM.ADR(c), 1) + END errch; + + PROCEDURE errstring*(s: ARRAY OF CHAR); + VAR i: LONGINT; + BEGIN i := 0; + WHILE (i10 THEN errposint(l DIV 10) END; errch(CHR(ORD('0') + (l MOD 10))) END errposint; + + PROCEDURE errint*(l: SYSTEM.INT32); + BEGIN IF l<0 THEN errch('-'); l := -l END; errposint(l) END errint; + + PROCEDURE DisplayHaltCode(code: SYSTEM.INT32); + BEGIN + CASE code OF + | -1: errstring("Assertion failure.") + | -2: errstring("Index out of range.") + | -3: errstring("Reached end of function without reaching RETURN.") + | -4: errstring("CASE statement: no matching label and no ELSE.") + | -5: errstring("Type guard failed.") + | -6: errstring("Implicit type guard in record assignment failed.") + | -7: errstring("Invalid case in WITH statement.") + | -8: errstring("Value out of range.") + | -9: errstring("Heap interrupted while locked, but lockdepth = 0 at unlock.") + |-10: errstring("NIL access."); + |-11: errstring("Alignment error."); + |-12: errstring("Divide by zero."); + |-13: errstring("Arithmetic overflow/underflow."); + |-14: errstring("Invalid function argument."); + |-15: errstring("Internal error, e.g. Type descriptor size mismatch.") + |-20: errstring("Too many, or negative number of, elements in dynamic array.") + ELSE + END + END DisplayHaltCode; + + PROCEDURE Halt*(code: SYSTEM.INT32); + BEGIN + (*IF HaltHandler # NIL THEN HaltHandler(code) END;*) + errstring("Terminated by Halt("); errint(code); errstring("). "); + IF code < 0 THEN DisplayHaltCode(code) END; + errstring(Platform.NL); + Platform.Exit(code); + END Halt; + + PROCEDURE AssertFail*(code: SYSTEM.INT32); + BEGIN + errstring("Assertion failure."); + IF code # 0 THEN errstring(" ASSERT code "); errint(code); errstring("."); END; + errstring(Platform.NL); + Platform.Exit(code); + END AssertFail; + + (* + PROCEDURE SetHalt*(p: HaltProcedure); + BEGIN HaltHandler := p; END SetHalt; + *) + END Modules. diff --git a/src/runtime/Platformunix.Mod b/src/runtime/Platformunix.Mod index 6f7dc4a0..27ce9539 100644 --- a/src/runtime/Platformunix.Mod +++ b/src/runtime/Platformunix.Mod @@ -28,7 +28,6 @@ TYPE VAR LittleEndian-: BOOLEAN; MainStackFrame-: SYSTEM.ADDRESS; - HaltCode-: LONGINT; PID-: INTEGER; (* Note: Must be updated by Fork implementation *) CWD-: ARRAY 256 OF CHAR; ArgCount-: INTEGER; @@ -131,7 +130,6 @@ BEGIN ArgCount := SYSTEM.VAL(INTEGER, argc); av := SYSTEM.VAL(ArgVecPtr, argvadr); ArgVector := av[0]; - HaltCode := -128; (* This function (Platform.Init) is called at program startup BEFORE any modules have been initalised. In turn we must initialise the heap @@ -464,66 +462,8 @@ END Rename; (* Process termination *) -PROCEDURE -exit(code: INTEGER) "exit(code)"; -PROCEDURE Exit*(code: INTEGER); -BEGIN exit(code) END Exit; - -PROCEDURE -errstring(s: ARRAY OF CHAR) 'write(1, s, s__len-1)'; -PROCEDURE -errc (c: CHAR) 'write(1, &c, 1)'; -PROCEDURE errch(c: CHAR); BEGIN errc(c) END errch; -PROCEDURE errln; BEGIN errch(0AX) END errln; - -PROCEDURE errposint(l: LONGINT); -BEGIN IF l>10 THEN errposint(l DIV 10) END; errch(CHR(ORD('0') + (l MOD 10))) END errposint; - -PROCEDURE errint(l: LONGINT); -BEGIN IF l<0 THEN errch('-'); l := -l END; errposint(l) END errint; - -PROCEDURE DisplayHaltCode(code: LONGINT); -BEGIN - CASE code OF - | -1: errstring("Assertion failure.") - | -2: errstring("Index out of range.") - | -3: errstring("Reached end of function without reaching RETURN.") - | -4: errstring("CASE statement: no matching label and no ELSE.") - | -5: errstring("Type guard failed.") - | -6: errstring("Implicit type guard in record assignment failed.") - | -7: errstring("Invalid case in WITH statement.") - | -8: errstring("Value out of range.") - | -9: errstring("Heap interrupted while locked, but lockdepth = 0 at unlock.") - |-10: errstring("NIL access."); - |-11: errstring("Alignment error."); - |-12: errstring("Divide by zero."); - |-13: errstring("Arithmetic overflow/underflow."); - |-14: errstring("Invalid function argument."); - |-15: errstring("Internal error, e.g. Type descriptor size mismatch.") - |-20: errstring("Too many, or negative number of, elements in dynamic array.") - ELSE - END -END DisplayHaltCode; - -PROCEDURE Halt*(code: SYSTEM.INT32); -BEGIN - HaltCode := code; - IF HaltHandler # NIL THEN HaltHandler(code) END; - errstring("Terminated by Halt("); errint(code); errstring("). "); - IF code < 0 THEN DisplayHaltCode(code) END; - errln; - exit(SYSTEM.VAL(INTEGER,code)); -END Halt; - -PROCEDURE AssertFail*(code: SYSTEM.INT32); -BEGIN - errstring("Assertion failure."); - IF code # 0 THEN errstring(" ASSERT code "); errint(code); errstring("."); END; - errln; - exit(SYSTEM.VAL(INTEGER,code)); -END AssertFail; - -PROCEDURE SetHalt*(p: HaltProcedure); -BEGIN HaltHandler := p; END SetHalt; - - +PROCEDURE -exit(code: LONGINT) "exit((int)code)"; +PROCEDURE Exit*(code: LONGINT); BEGIN exit(code) END Exit; @@ -537,7 +477,6 @@ PROCEDURE -getpid(): INTEGER "(INTEGER)getpid()"; BEGIN TestLittleEndian; - HaltCode := -128; HaltHandler := NIL; TimeStart := 0; TimeStart := Time(); PID := getpid(); diff --git a/src/runtime/Platformwindows.Mod b/src/runtime/Platformwindows.Mod index a52ae92c..937c1da0 100644 --- a/src/runtime/Platformwindows.Mod +++ b/src/runtime/Platformwindows.Mod @@ -526,65 +526,8 @@ END Rename; (* Process termination *) -PROCEDURE -exit(code: INTEGER) "ExitProcess((UINT)code)"; -PROCEDURE Exit*(code: INTEGER); -BEGIN exit(code) END Exit; - - -PROCEDURE -errstring(s: ARRAY OF CHAR) 'WriteFile((HANDLE)Platform_StdOut, s, s__len-1, 0,0)'; -PROCEDURE -errc (c: CHAR) 'WriteFile((HANDLE)Platform_StdOut, &c, 1, 0,0)'; -PROCEDURE errch(c: CHAR); BEGIN errc(c) END errch; -PROCEDURE errln; BEGIN errch(0DX); errch(0AX) END errln; - -PROCEDURE errposint(l: LONGINT); -BEGIN IF l>10 THEN errposint(l DIV 10) END; errch(CHR(ORD('0') + (l MOD 10))) END errposint; - -PROCEDURE errint(l: LONGINT); -BEGIN IF l<0 THEN errch('-'); l := -l END; errposint(l) END errint; - -PROCEDURE DisplayHaltCode(code: LONGINT); -BEGIN - CASE code OF - | -1: errstring("Assertion failure.") - | -2: errstring("Index out of range.") - | -3: errstring("Reached end of function without reaching RETURN.") - | -4: errstring("CASE statement: no matching label and no ELSE.") - | -5: errstring("Type guard failed.") - | -6: errstring("Type equality failed.") - | -7: errstring("WITH statement type guard failed.") - | -8: errstring("SHORT: Value too large for shorter type.") - | -9: errstring("Heap interrupted while locked, but lockdepth = 0 at unlock.") - |-10: errstring("NIL access."); - |-11: errstring("Alignment error."); - |-12: errstring("Divide by zero."); - |-13: errstring("Arithmetic overflow/underflow."); - |-14: errstring("Invalid function argument."); - |-15: errstring("Internal error, e.g. Type descriptor size mismatch.") - |-20: errstring("Too many, or negative number of, elements in dynamic array.") - ELSE - END -END DisplayHaltCode; - -PROCEDURE Halt*(code: SYSTEM.INT32); -BEGIN - HaltCode := code; - IF HaltHandler # NIL THEN HaltHandler(code) END; - errstring("Terminated by Halt("); errint(code); errstring("). "); - IF code < 0 THEN DisplayHaltCode(code) END; - errln; - exit(SYSTEM.VAL(INTEGER,code)); -END Halt; - -PROCEDURE AssertFail*(code: SYSTEM.INT32); -BEGIN - errstring("Assertion failure."); - IF code # 0 THEN errstring(" ASSERT code "); errint(code); errstring("."); END; - errln; - exit(SYSTEM.VAL(INTEGER,code)); -END AssertFail; - -PROCEDURE SetHalt*(p: HaltProcedure); -BEGIN HaltHandler := p; END SetHalt; +PROCEDURE -exit(code: LONGINT) "ExitProcess((UINT)code)"; +PROCEDURE Exit*(code: LONGINT); BEGIN exit(code) END Exit; PROCEDURE -GetConsoleMode(h: FileHandle; VAR m: SYSTEM.INT32): BOOLEAN "GetConsoleMode((HANDLE)h, (DWORD*)m)"; diff --git a/src/runtime/SYSTEM.h b/src/runtime/SYSTEM.h index d9778393..43baa836 100644 --- a/src/runtime/SYSTEM.h +++ b/src/runtime/SYSTEM.h @@ -103,11 +103,11 @@ extern void Platform_OSFree (ADDRESS addr); // Assertions and Halts -extern void Platform_Halt(INT32 x); -extern void Platform_AssertFail(INT32 x); +extern void Modules_Halt(INT32 x); +extern void Modules_AssertFail(INT32 x); -#define __HALT(x) Platform_Halt(x) -#define __ASSERT(cond, x) if (!(cond)) Platform_AssertFail((INT32)(x)) +#define __HALT(x) Modules_Halt((INT32)(x)) +#define __ASSERT(cond, x) if (!(cond)) Modules_AssertFail((INT32)(x)) // Index checking diff --git a/src/tools/make/oberon.mk b/src/tools/make/oberon.mk index e5fde295..bb8b0f60 100644 --- a/src/tools/make/oberon.mk +++ b/src/tools/make/oberon.mk @@ -122,6 +122,7 @@ translate: cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/OPP.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ssfm -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/Compiler.Mod + cp src/runtime/*.[ch] $(BUILDDIR) @printf "$(BUILDDIR) filled with compiler C source.\n" From bb143a6162543af228d4a23fed8d31d608daf748 Mon Sep 17 00:00:00 2001 From: David Brown Date: Sun, 13 Nov 2016 20:35:53 +0000 Subject: [PATCH 318/580] Include Int and Set type size in symbol fingerprint. --- bootstrap/unix-44/Compiler.c | 6 ++++- bootstrap/unix-44/Configuration.c | 4 +-- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Files.c | 2 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 2 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 2 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 2 +- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 10 ++++++-- bootstrap/unix-44/OPT.h | 6 +++-- bootstrap/unix-44/OPV.c | 2 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Out.c | 2 +- bootstrap/unix-44/Out.h | 2 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/VT100.c | 2 +- bootstrap/unix-44/VT100.h | 2 +- bootstrap/unix-44/errors.c | 2 +- bootstrap/unix-44/errors.h | 2 +- bootstrap/unix-44/extTools.c | 2 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-48/Compiler.c | 6 ++++- bootstrap/unix-48/Configuration.c | 4 +-- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Files.c | 2 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 2 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 2 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 2 +- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 10 ++++++-- bootstrap/unix-48/OPT.h | 6 +++-- bootstrap/unix-48/OPV.c | 2 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Out.c | 2 +- bootstrap/unix-48/Out.h | 2 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/VT100.c | 2 +- bootstrap/unix-48/VT100.h | 2 +- bootstrap/unix-48/errors.c | 2 +- bootstrap/unix-48/errors.h | 2 +- bootstrap/unix-48/extTools.c | 2 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-88/Compiler.c | 6 ++++- bootstrap/unix-88/Configuration.c | 4 +-- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Files.c | 2 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 2 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 2 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 2 +- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 10 ++++++-- bootstrap/unix-88/OPT.h | 6 +++-- bootstrap/unix-88/OPV.c | 2 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Out.c | 2 +- bootstrap/unix-88/Out.h | 2 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/VT100.c | 2 +- bootstrap/unix-88/VT100.h | 2 +- bootstrap/unix-88/errors.c | 2 +- bootstrap/unix-88/errors.h | 2 +- bootstrap/unix-88/extTools.c | 2 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/windows-48/Compiler.c | 6 ++++- bootstrap/windows-48/Configuration.c | 4 +-- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Files.c | 2 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 2 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 2 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 2 +- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 10 ++++++-- bootstrap/windows-48/OPT.h | 6 +++-- bootstrap/windows-48/OPV.c | 2 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Out.c | 2 +- bootstrap/windows-48/Out.h | 2 +- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/VT100.c | 2 +- bootstrap/windows-48/VT100.h | 2 +- bootstrap/windows-48/errors.c | 2 +- bootstrap/windows-48/errors.h | 2 +- bootstrap/windows-48/extTools.c | 2 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-88/Compiler.c | 6 ++++- bootstrap/windows-88/Configuration.c | 4 +-- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Files.c | 2 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 2 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 2 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 2 +- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 10 ++++++-- bootstrap/windows-88/OPT.h | 6 +++-- bootstrap/windows-88/OPV.c | 2 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Out.c | 2 +- bootstrap/windows-88/Out.h | 2 +- bootstrap/windows-88/Platform.c | 2 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/VT100.c | 2 +- bootstrap/windows-88/VT100.h | 2 +- bootstrap/windows-88/errors.c | 2 +- bootstrap/windows-88/errors.h | 2 +- bootstrap/windows-88/extTools.c | 2 +- bootstrap/windows-88/extTools.h | 2 +- src/compiler/Compiler.Mod | 7 ++++- src/compiler/OPT.Mod | 38 +++++++++++++++------------- 197 files changed, 297 insertions(+), 228 deletions(-) diff --git a/bootstrap/unix-44/Compiler.c b/bootstrap/unix-44/Compiler.c index a6d5a403..9d52cfc4 100644 --- a/bootstrap/unix-44/Compiler.c +++ b/bootstrap/unix-44/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT INT8 #define INTEGER INT16 @@ -83,7 +83,11 @@ static void Compiler_PropagateElementaryTypeSizes (void) { OPT_Struct adrinttyp = NIL; OPT_sysptrtyp->size = OPM_AddressSize; + OPT_sysptrtyp->idfp = OPT_sysptrtyp->form; + OPM_FPrint(&OPT_sysptrtyp->idfp, OPT_sysptrtyp->size); OPT_adrtyp->size = OPM_AddressSize; + OPT_adrtyp->idfp = OPT_adrtyp->form; + OPM_FPrint(&OPT_adrtyp->idfp, OPT_adrtyp->size); adrinttyp = OPT_IntType(OPM_AddressSize); OPT_adrtyp->strobj = adrinttyp->strobj; OPT_sinttyp = OPT_IntType(OPM_ShortintSize); diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index d84a7f24..4e78eeda 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index 09543f0b..45384aa2 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 3ce83372..ea177995 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index c04d545c..1499df05 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index 2a5c9464..85a52286 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index 5f888271..a40ef769 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index 23c71a96..34a1723e 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index 6809ec05..7c2a221a 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index 8a1b80fe..f2e99ab3 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index 0caeb234..88ed3d3f 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index c4b9a965..90df9e97 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index a1917812..cfb3a8bf 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 9610f289..f52f655a 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index fce0614a..4c5e13a8 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index 124bccb1..3408b3cc 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index 978ccdff..3ddbca21 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index 845787eb..91e3a136 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index d8134366..bd0a0e9a 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index 43d368dd..2394c022 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -643,8 +643,11 @@ void OPT_IdFPrint (OPT_Struct typ) typ->idfpdone = 1; idfp = 0; f = typ->form; - c = typ->comp; OPM_FPrint(&idfp, f); + if (__IN(f, 0x90, 32)) { + OPM_FPrint(&idfp, typ->size); + } + c = typ->comp; OPM_FPrint(&idfp, c); btyp = typ->BaseTyp; strobj = typ->strobj; @@ -1903,6 +1906,9 @@ static void OPT_EnterTyp (OPS_Name name, INT8 form, INT16 size, OPT_Struct *res) typ->fpdone = 1; typ->idfp = form; typ->idfpdone = 1; + if (__IN(form, 0x90, 32)) { + OPM_FPrint(&typ->idfp, typ->size); + } *res = typ; } diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index e3170fc0..9850a22e 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h @@ -60,7 +60,9 @@ typedef INT16 ref, sysflag; INT32 n, size, align, txtpos; BOOLEAN allocated, pbused, pvused; - char _prvt0[16]; + char _prvt0[4]; + INT32 idfp; + char _prvt1[8]; OPT_Struct BaseTyp; OPT_Object link, strobj; } OPT_StrDesc; diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index bc68a5c6..2f149a8a 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index 9d02e218..ebb01de2 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Out.c b/bootstrap/unix-44/Out.c index ad7ed82c..8cd71126 100644 --- a/bootstrap/unix-44/Out.c +++ b/bootstrap/unix-44/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Out.h b/bootstrap/unix-44/Out.h index 247b98de..144d7888 100644 --- a/bootstrap/unix-44/Out.h +++ b/bootstrap/unix-44/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 0a70d4aa..d2da38f5 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index 7f48cd11..df398744 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 955cd8dc..0eecd854 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index fbae270c..1eaca8ec 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index 07e3b700..48e0dd7f 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index e3525cd0..17369939 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index 90bf9113..8e1abee4 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index 8e1a2514..d72c211b 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/VT100.c b/bootstrap/unix-44/VT100.c index 97a7d318..909f4e92 100644 --- a/bootstrap/unix-44/VT100.c +++ b/bootstrap/unix-44/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/VT100.h b/bootstrap/unix-44/VT100.h index 577a2d44..15dc50c5 100644 --- a/bootstrap/unix-44/VT100.h +++ b/bootstrap/unix-44/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-44/errors.c b/bootstrap/unix-44/errors.c index aac72a79..64af94f5 100644 --- a/bootstrap/unix-44/errors.c +++ b/bootstrap/unix-44/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/errors.h b/bootstrap/unix-44/errors.h index 4f03779e..1a983a0c 100644 --- a/bootstrap/unix-44/errors.h +++ b/bootstrap/unix-44/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index 3493ea47..e70c387c 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index 691b2968..a6813769 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/Compiler.c b/bootstrap/unix-48/Compiler.c index a6d5a403..9d52cfc4 100644 --- a/bootstrap/unix-48/Compiler.c +++ b/bootstrap/unix-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT INT8 #define INTEGER INT16 @@ -83,7 +83,11 @@ static void Compiler_PropagateElementaryTypeSizes (void) { OPT_Struct adrinttyp = NIL; OPT_sysptrtyp->size = OPM_AddressSize; + OPT_sysptrtyp->idfp = OPT_sysptrtyp->form; + OPM_FPrint(&OPT_sysptrtyp->idfp, OPT_sysptrtyp->size); OPT_adrtyp->size = OPM_AddressSize; + OPT_adrtyp->idfp = OPT_adrtyp->form; + OPM_FPrint(&OPT_adrtyp->idfp, OPT_adrtyp->size); adrinttyp = OPT_IntType(OPM_AddressSize); OPT_adrtyp->strobj = adrinttyp->strobj; OPT_sinttyp = OPT_IntType(OPM_ShortintSize); diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index d84a7f24..4e78eeda 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index 09543f0b..45384aa2 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 3ce83372..ea177995 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index c04d545c..1499df05 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index 2a5c9464..85a52286 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index 5f888271..a40ef769 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index 23c71a96..34a1723e 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index 6809ec05..7c2a221a 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index 8a1b80fe..f2e99ab3 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index 0caeb234..88ed3d3f 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index c4b9a965..90df9e97 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index a1917812..cfb3a8bf 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 9610f289..f52f655a 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index fce0614a..4c5e13a8 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index 124bccb1..3408b3cc 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index 978ccdff..3ddbca21 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index 845787eb..91e3a136 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index d8134366..bd0a0e9a 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 46e05141..71a6bbe3 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -643,8 +643,11 @@ void OPT_IdFPrint (OPT_Struct typ) typ->idfpdone = 1; idfp = 0; f = typ->form; - c = typ->comp; OPM_FPrint(&idfp, f); + if (__IN(f, 0x90, 32)) { + OPM_FPrint(&idfp, typ->size); + } + c = typ->comp; OPM_FPrint(&idfp, c); btyp = typ->BaseTyp; strobj = typ->strobj; @@ -1903,6 +1906,9 @@ static void OPT_EnterTyp (OPS_Name name, INT8 form, INT16 size, OPT_Struct *res) typ->fpdone = 1; typ->idfp = form; typ->idfpdone = 1; + if (__IN(form, 0x90, 32)) { + OPM_FPrint(&typ->idfp, typ->size); + } *res = typ; } diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index e3170fc0..9850a22e 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h @@ -60,7 +60,9 @@ typedef INT16 ref, sysflag; INT32 n, size, align, txtpos; BOOLEAN allocated, pbused, pvused; - char _prvt0[16]; + char _prvt0[4]; + INT32 idfp; + char _prvt1[8]; OPT_Struct BaseTyp; OPT_Object link, strobj; } OPT_StrDesc; diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index bc68a5c6..2f149a8a 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index 9d02e218..ebb01de2 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Out.c b/bootstrap/unix-48/Out.c index ad7ed82c..8cd71126 100644 --- a/bootstrap/unix-48/Out.c +++ b/bootstrap/unix-48/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Out.h b/bootstrap/unix-48/Out.h index 247b98de..144d7888 100644 --- a/bootstrap/unix-48/Out.h +++ b/bootstrap/unix-48/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 0a70d4aa..d2da38f5 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index 7f48cd11..df398744 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 955cd8dc..0eecd854 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index fbae270c..1eaca8ec 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index 07e3b700..48e0dd7f 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index e3525cd0..17369939 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index 36cd76fb..b92f9c58 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index 4bae7210..0b42a742 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/VT100.c b/bootstrap/unix-48/VT100.c index 97a7d318..909f4e92 100644 --- a/bootstrap/unix-48/VT100.c +++ b/bootstrap/unix-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/VT100.h b/bootstrap/unix-48/VT100.h index 577a2d44..15dc50c5 100644 --- a/bootstrap/unix-48/VT100.h +++ b/bootstrap/unix-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-48/errors.c b/bootstrap/unix-48/errors.c index aac72a79..64af94f5 100644 --- a/bootstrap/unix-48/errors.c +++ b/bootstrap/unix-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/errors.h b/bootstrap/unix-48/errors.h index 4f03779e..1a983a0c 100644 --- a/bootstrap/unix-48/errors.h +++ b/bootstrap/unix-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index 3493ea47..e70c387c 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index 691b2968..a6813769 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/Compiler.c b/bootstrap/unix-88/Compiler.c index a6d5a403..9d52cfc4 100644 --- a/bootstrap/unix-88/Compiler.c +++ b/bootstrap/unix-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT INT8 #define INTEGER INT16 @@ -83,7 +83,11 @@ static void Compiler_PropagateElementaryTypeSizes (void) { OPT_Struct adrinttyp = NIL; OPT_sysptrtyp->size = OPM_AddressSize; + OPT_sysptrtyp->idfp = OPT_sysptrtyp->form; + OPM_FPrint(&OPT_sysptrtyp->idfp, OPT_sysptrtyp->size); OPT_adrtyp->size = OPM_AddressSize; + OPT_adrtyp->idfp = OPT_adrtyp->form; + OPM_FPrint(&OPT_adrtyp->idfp, OPT_adrtyp->size); adrinttyp = OPT_IntType(OPM_AddressSize); OPT_adrtyp->strobj = adrinttyp->strobj; OPT_sinttyp = OPT_IntType(OPM_ShortintSize); diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index d84a7f24..4e78eeda 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index 09543f0b..45384aa2 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index ba54d44e..0a6a9df0 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index ef304bed..ce408573 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index 46f70cc1..00665676 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index 06cbd0ec..3ab728a5 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 494f9fdc..e7be8295 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index 6809ec05..7c2a221a 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index 8a1b80fe..f2e99ab3 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index 0caeb234..88ed3d3f 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index c4b9a965..90df9e97 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index a1917812..cfb3a8bf 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index c2258e5b..aace2669 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index fce0614a..4c5e13a8 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index bcedf318..9ffb7fc8 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index 978ccdff..3ddbca21 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index 845787eb..91e3a136 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index d8134366..bd0a0e9a 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index 896d5ead..05d6a917 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -643,8 +643,11 @@ void OPT_IdFPrint (OPT_Struct typ) typ->idfpdone = 1; idfp = 0; f = typ->form; - c = typ->comp; OPM_FPrint(&idfp, f); + if (__IN(f, 0x90, 32)) { + OPM_FPrint(&idfp, typ->size); + } + c = typ->comp; OPM_FPrint(&idfp, c); btyp = typ->BaseTyp; strobj = typ->strobj; @@ -1903,6 +1906,9 @@ static void OPT_EnterTyp (OPS_Name name, INT8 form, INT16 size, OPT_Struct *res) typ->fpdone = 1; typ->idfp = form; typ->idfpdone = 1; + if (__IN(form, 0x90, 32)) { + OPM_FPrint(&typ->idfp, typ->size); + } *res = typ; } diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index e3170fc0..9850a22e 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h @@ -60,7 +60,9 @@ typedef INT16 ref, sysflag; INT32 n, size, align, txtpos; BOOLEAN allocated, pbused, pvused; - char _prvt0[16]; + char _prvt0[4]; + INT32 idfp; + char _prvt1[8]; OPT_Struct BaseTyp; OPT_Object link, strobj; } OPT_StrDesc; diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 3602bbf6..9cda46a8 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index 9d02e218..ebb01de2 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Out.c b/bootstrap/unix-88/Out.c index ad7ed82c..8cd71126 100644 --- a/bootstrap/unix-88/Out.c +++ b/bootstrap/unix-88/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Out.h b/bootstrap/unix-88/Out.h index 247b98de..144d7888 100644 --- a/bootstrap/unix-88/Out.h +++ b/bootstrap/unix-88/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 76346d8f..d61c6c2d 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index c890c863..447f60be 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 955cd8dc..0eecd854 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index fbae270c..1eaca8ec 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index 07e3b700..48e0dd7f 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index e3525cd0..17369939 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index deefc817..cfce97a1 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index 6fe829e0..9455890c 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/VT100.c b/bootstrap/unix-88/VT100.c index 97a7d318..909f4e92 100644 --- a/bootstrap/unix-88/VT100.c +++ b/bootstrap/unix-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/VT100.h b/bootstrap/unix-88/VT100.h index 577a2d44..15dc50c5 100644 --- a/bootstrap/unix-88/VT100.h +++ b/bootstrap/unix-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-88/errors.c b/bootstrap/unix-88/errors.c index aac72a79..64af94f5 100644 --- a/bootstrap/unix-88/errors.c +++ b/bootstrap/unix-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/errors.h b/bootstrap/unix-88/errors.h index 4f03779e..1a983a0c 100644 --- a/bootstrap/unix-88/errors.h +++ b/bootstrap/unix-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index 3493ea47..e70c387c 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index 691b2968..a6813769 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/Compiler.c b/bootstrap/windows-48/Compiler.c index a6d5a403..9d52cfc4 100644 --- a/bootstrap/windows-48/Compiler.c +++ b/bootstrap/windows-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT INT8 #define INTEGER INT16 @@ -83,7 +83,11 @@ static void Compiler_PropagateElementaryTypeSizes (void) { OPT_Struct adrinttyp = NIL; OPT_sysptrtyp->size = OPM_AddressSize; + OPT_sysptrtyp->idfp = OPT_sysptrtyp->form; + OPM_FPrint(&OPT_sysptrtyp->idfp, OPT_sysptrtyp->size); OPT_adrtyp->size = OPM_AddressSize; + OPT_adrtyp->idfp = OPT_adrtyp->form; + OPM_FPrint(&OPT_adrtyp->idfp, OPT_adrtyp->size); adrinttyp = OPT_IntType(OPM_AddressSize); OPT_adrtyp->strobj = adrinttyp->strobj; OPT_sinttyp = OPT_IntType(OPM_ShortintSize); diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index d84a7f24..4e78eeda 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index 09543f0b..45384aa2 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 1b2bcbfc..25a6171e 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index 89ff4f9d..689c8108 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index 2a5c9464..85a52286 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index 5f888271..a40ef769 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index 23c71a96..34a1723e 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index 6809ec05..7c2a221a 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index 8a1b80fe..f2e99ab3 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index 0caeb234..88ed3d3f 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index c4b9a965..90df9e97 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index a1917812..cfb3a8bf 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 9610f289..f52f655a 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index fce0614a..4c5e13a8 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index 124bccb1..3408b3cc 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index 978ccdff..3ddbca21 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index 845787eb..91e3a136 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index d8134366..bd0a0e9a 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 46e05141..71a6bbe3 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -643,8 +643,11 @@ void OPT_IdFPrint (OPT_Struct typ) typ->idfpdone = 1; idfp = 0; f = typ->form; - c = typ->comp; OPM_FPrint(&idfp, f); + if (__IN(f, 0x90, 32)) { + OPM_FPrint(&idfp, typ->size); + } + c = typ->comp; OPM_FPrint(&idfp, c); btyp = typ->BaseTyp; strobj = typ->strobj; @@ -1903,6 +1906,9 @@ static void OPT_EnterTyp (OPS_Name name, INT8 form, INT16 size, OPT_Struct *res) typ->fpdone = 1; typ->idfp = form; typ->idfpdone = 1; + if (__IN(form, 0x90, 32)) { + OPM_FPrint(&typ->idfp, typ->size); + } *res = typ; } diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index e3170fc0..9850a22e 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h @@ -60,7 +60,9 @@ typedef INT16 ref, sysflag; INT32 n, size, align, txtpos; BOOLEAN allocated, pbused, pvused; - char _prvt0[16]; + char _prvt0[4]; + INT32 idfp; + char _prvt1[8]; OPT_Struct BaseTyp; OPT_Object link, strobj; } OPT_StrDesc; diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index bc68a5c6..2f149a8a 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index 9d02e218..ebb01de2 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Out.c b/bootstrap/windows-48/Out.c index dc4c9541..e5c33574 100644 --- a/bootstrap/windows-48/Out.c +++ b/bootstrap/windows-48/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Out.h b/bootstrap/windows-48/Out.h index 247b98de..144d7888 100644 --- a/bootstrap/windows-48/Out.h +++ b/bootstrap/windows-48/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index dcf47b13..1c582348 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index 714c8e3c..530f5a80 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 955cd8dc..0eecd854 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index fbae270c..1eaca8ec 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index 07e3b700..48e0dd7f 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index e3525cd0..17369939 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index 36cd76fb..b92f9c58 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index 4bae7210..0b42a742 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/VT100.c b/bootstrap/windows-48/VT100.c index 97a7d318..909f4e92 100644 --- a/bootstrap/windows-48/VT100.c +++ b/bootstrap/windows-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/VT100.h b/bootstrap/windows-48/VT100.h index 577a2d44..15dc50c5 100644 --- a/bootstrap/windows-48/VT100.h +++ b/bootstrap/windows-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-48/errors.c b/bootstrap/windows-48/errors.c index aac72a79..64af94f5 100644 --- a/bootstrap/windows-48/errors.c +++ b/bootstrap/windows-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/errors.h b/bootstrap/windows-48/errors.h index 4f03779e..1a983a0c 100644 --- a/bootstrap/windows-48/errors.h +++ b/bootstrap/windows-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index 3493ea47..e70c387c 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index 691b2968..a6813769 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/Compiler.c b/bootstrap/windows-88/Compiler.c index a6d5a403..9d52cfc4 100644 --- a/bootstrap/windows-88/Compiler.c +++ b/bootstrap/windows-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT INT8 #define INTEGER INT16 @@ -83,7 +83,11 @@ static void Compiler_PropagateElementaryTypeSizes (void) { OPT_Struct adrinttyp = NIL; OPT_sysptrtyp->size = OPM_AddressSize; + OPT_sysptrtyp->idfp = OPT_sysptrtyp->form; + OPM_FPrint(&OPT_sysptrtyp->idfp, OPT_sysptrtyp->size); OPT_adrtyp->size = OPM_AddressSize; + OPT_adrtyp->idfp = OPT_adrtyp->form; + OPM_FPrint(&OPT_adrtyp->idfp, OPT_adrtyp->size); adrinttyp = OPT_IntType(OPM_AddressSize); OPT_adrtyp->strobj = adrinttyp->strobj; OPT_sinttyp = OPT_IntType(OPM_ShortintSize); diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index d84a7f24..4e78eeda 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index 09543f0b..45384aa2 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index fe9b24c9..8a1b02c3 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 5b66b18a..a798ac33 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index 46f70cc1..00665676 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index 06cbd0ec..3ab728a5 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 494f9fdc..e7be8295 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index 6809ec05..7c2a221a 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index 8a1b80fe..f2e99ab3 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index 0caeb234..88ed3d3f 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index c4b9a965..90df9e97 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index a1917812..cfb3a8bf 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index c2258e5b..aace2669 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index fce0614a..4c5e13a8 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index bcedf318..9ffb7fc8 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index 978ccdff..3ddbca21 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index 845787eb..91e3a136 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index d8134366..bd0a0e9a 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index 896d5ead..05d6a917 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -643,8 +643,11 @@ void OPT_IdFPrint (OPT_Struct typ) typ->idfpdone = 1; idfp = 0; f = typ->form; - c = typ->comp; OPM_FPrint(&idfp, f); + if (__IN(f, 0x90, 32)) { + OPM_FPrint(&idfp, typ->size); + } + c = typ->comp; OPM_FPrint(&idfp, c); btyp = typ->BaseTyp; strobj = typ->strobj; @@ -1903,6 +1906,9 @@ static void OPT_EnterTyp (OPS_Name name, INT8 form, INT16 size, OPT_Struct *res) typ->fpdone = 1; typ->idfp = form; typ->idfpdone = 1; + if (__IN(form, 0x90, 32)) { + OPM_FPrint(&typ->idfp, typ->size); + } *res = typ; } diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index e3170fc0..9850a22e 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h @@ -60,7 +60,9 @@ typedef INT16 ref, sysflag; INT32 n, size, align, txtpos; BOOLEAN allocated, pbused, pvused; - char _prvt0[16]; + char _prvt0[4]; + INT32 idfp; + char _prvt1[8]; OPT_Struct BaseTyp; OPT_Object link, strobj; } OPT_StrDesc; diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 3602bbf6..9cda46a8 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index 9d02e218..ebb01de2 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Out.c b/bootstrap/windows-88/Out.c index dc4c9541..e5c33574 100644 --- a/bootstrap/windows-88/Out.c +++ b/bootstrap/windows-88/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Out.h b/bootstrap/windows-88/Out.h index 247b98de..144d7888 100644 --- a/bootstrap/windows-88/Out.h +++ b/bootstrap/windows-88/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 91508fdf..0b4778fa 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index c6c57d6a..98f9604c 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 955cd8dc..0eecd854 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index fbae270c..1eaca8ec 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index 07e3b700..48e0dd7f 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index e3525cd0..17369939 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index deefc817..cfce97a1 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index 6fe829e0..9455890c 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/VT100.c b/bootstrap/windows-88/VT100.c index 97a7d318..909f4e92 100644 --- a/bootstrap/windows-88/VT100.c +++ b/bootstrap/windows-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/VT100.h b/bootstrap/windows-88/VT100.h index 577a2d44..15dc50c5 100644 --- a/bootstrap/windows-88/VT100.h +++ b/bootstrap/windows-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-88/errors.c b/bootstrap/windows-88/errors.c index aac72a79..64af94f5 100644 --- a/bootstrap/windows-88/errors.c +++ b/bootstrap/windows-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/errors.h b/bootstrap/windows-88/errors.h index 4f03779e..1a983a0c 100644 --- a/bootstrap/windows-88/errors.h +++ b/bootstrap/windows-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index 3493ea47..e70c387c 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index 691b2968..a6813769 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/src/compiler/Compiler.Mod b/src/compiler/Compiler.Mod index 6c6381e6..b6683241 100644 --- a/src/compiler/Compiler.Mod +++ b/src/compiler/Compiler.Mod @@ -54,7 +54,12 @@ MODULE Compiler; (* J. Templ 3.2.95 *) VAR adrinttyp: OPT.Struct; BEGIN OPT.sysptrtyp.size := OPM.AddressSize; - OPT.adrtyp.size := OPM.AddressSize; + OPT.sysptrtyp.idfp := OPT.sysptrtyp.form; + OPM.FPrint(OPT.sysptrtyp.idfp, OPT.sysptrtyp.size); + + OPT.adrtyp.size := OPM.AddressSize; + OPT.adrtyp.idfp := OPT.adrtyp.form; + OPM.FPrint(OPT.adrtyp.idfp, OPT.adrtyp.size); adrinttyp := OPT.IntType(OPM.AddressSize); OPT.adrtyp.strobj := adrinttyp.strobj; diff --git a/src/compiler/OPT.Mod b/src/compiler/OPT.Mod index c2e7412f..75ad6c72 100644 --- a/src/compiler/OPT.Mod +++ b/src/compiler/OPT.Mod @@ -83,7 +83,7 @@ TYPE allocated*: BOOLEAN; pbused*, pvused*: BOOLEAN; fpdone, idfpdone: BOOLEAN; - idfp, pbfp, pvfp: LONGINT; + idfp*, pbfp, pvfp: LONGINT; BaseTyp*: Struct; link*, strobj*: Object END; @@ -515,21 +515,23 @@ END FPrintSign; PROCEDURE IdFPrint*(typ: Struct); (* idfp codifies assignment compatibility *) VAR btyp: Struct; strobj: Object; idfp: LONGINT; f, c: INTEGER; BEGIN - IF ~typ^.idfpdone THEN - typ^.idfpdone := TRUE; (* may be recursive, temporary idfp is 0 in that case *) - idfp := 0; f := typ^.form; c := typ^.comp; OPM.FPrint(idfp, f); OPM.FPrint(idfp, c); - btyp := typ^.BaseTyp; strobj := typ^.strobj; - IF (strobj # NIL) & (strobj^.name # "") THEN - FPrintName(idfp, GlbMod[typ^.mno]^.name); FPrintName(idfp, strobj^.name) - END; - IF (f = Pointer) OR (c = Record) & (btyp # NIL) OR (c = DynArr) THEN - IdFPrint(btyp); OPM.FPrint(idfp, btyp^.idfp) - ELSIF c = Array THEN - IdFPrint(btyp); OPM.FPrint(idfp, btyp^.idfp); OPM.FPrint(idfp, typ^.n) - ELSIF f = ProcTyp THEN FPrintSign(idfp, btyp, typ^.link) - END; - typ^.idfp := idfp - END + IF ~typ^.idfpdone THEN + typ^.idfpdone := TRUE; (* may be recursive, temporary idfp is 0 in that case *) + idfp := 0; + f := typ^.form; OPM.FPrint(idfp, f); IF f IN {Int, Set} THEN OPM.FPrint(idfp, typ.size) END; + c := typ^.comp; OPM.FPrint(idfp, c); + btyp := typ^.BaseTyp; strobj := typ^.strobj; + IF (strobj # NIL) & (strobj^.name # "") THEN + FPrintName(idfp, GlbMod[typ^.mno]^.name); FPrintName(idfp, strobj^.name) + END; + IF (f = Pointer) OR (c = Record) & (btyp # NIL) OR (c = DynArr) THEN + IdFPrint(btyp); OPM.FPrint(idfp, btyp^.idfp) + ELSIF c = Array THEN + IdFPrint(btyp); OPM.FPrint(idfp, btyp^.idfp); OPM.FPrint(idfp, typ^.n) + ELSIF f = ProcTyp THEN FPrintSign(idfp, btyp, typ^.link) + END; + typ^.idfp := idfp + END END IdFPrint; PROCEDURE FPrintStr*(typ: Struct); @@ -1275,7 +1277,9 @@ END Import; typ := NewStr(form, Basic); obj^.mode := Typ; obj^.typ := typ; obj^.vis := external; typ^.strobj := obj; typ^.size := size; typ^.ref := form; typ^.allocated := TRUE; typ^.pbfp := form; typ^.pvfp := form; typ^.fpdone := TRUE; - typ^.idfp := form; typ^.idfpdone := TRUE; res := typ + typ^.idfp := form; typ^.idfpdone := TRUE; + IF form IN {Int, Set} THEN OPM.FPrint(typ.idfp, typ.size) END; + res := typ END EnterTyp; PROCEDURE EnterTypeAlias(name: OPS.Name; VAR res: Object); From f7feea0ad1ce5d57a464bd137dbdaa5b95a74832 Mon Sep 17 00:00:00 2001 From: David Brown Date: Mon, 14 Nov 2016 18:19:56 +0000 Subject: [PATCH 319/580] Tidy browsercmd aka showdef. --- makefile | 2 +- src/runtime/Modules.Mod | 28 +++-- src/tools/browser/BrowserCmd.Mod | 186 +++++++++++++++++-------------- src/tools/make/oberon.mk | 5 +- 4 files changed, 118 insertions(+), 103 deletions(-) diff --git a/makefile b/makefile index 499b5bf0..7f98eb4b 100644 --- a/makefile +++ b/makefile @@ -184,7 +184,7 @@ sourcechanges: # browsercmd: build the 'showdef' command browsercmd: configuration - @make -f src/tools/make/oberon.mk -s browsercmd + @make -f src/tools/make/oberon.mk -s browsercmd MODEL=2 diff --git a/src/runtime/Modules.Mod b/src/runtime/Modules.Mod index 33d210d6..d6b8eeeb 100644 --- a/src/runtime/Modules.Mod +++ b/src/runtime/Modules.Mod @@ -36,13 +36,6 @@ MODULE Modules; (* jt 6.1.96 *) imported*, importing*: ModuleName; - PROCEDURE -modules*(): Module - "(Modules_Module)Heap_modules"; - - PROCEDURE -setmodules*(m: Module) - "Heap_modules = m"; - - PROCEDURE Append(VAR a: ARRAY OF CHAR; b: ARRAY OF CHAR); VAR i, j: INTEGER; BEGIN @@ -51,6 +44,10 @@ MODULE Modules; (* jt 6.1.96 *) a[i] := 0X END Append; + + PROCEDURE -modules(): Module "(Modules_Module)Heap_modules"; + PROCEDURE -setmodules(m: Module) "Heap_modules = m"; + PROCEDURE ThisMod* (name: ARRAY OF CHAR): Module; VAR m: Module; bodyname: ARRAY 64 OF CHAR; body: Command; BEGIN m := modules(); @@ -101,17 +98,18 @@ MODULE Modules; (* jt 6.1.96 *) BEGIN e := Platform.Write(1, SYSTEM.ADR(c), 1) END errch; - PROCEDURE errstring*(s: ARRAY OF CHAR); + PROCEDURE errstring(s: ARRAY OF CHAR); VAR i: LONGINT; - BEGIN i := 0; - WHILE (i10 THEN errposint(l DIV 10) END; errch(CHR(ORD('0') + (l MOD 10))) END errposint; - - PROCEDURE errint*(l: SYSTEM.INT32); - BEGIN IF l<0 THEN errch('-'); l := -l END; errposint(l) END errint; + PROCEDURE errint(l: SYSTEM.INT32); + BEGIN + IF l < 0 THEN errch('-'); l := -l END; + IF l >= 10 THEN errint(l DIV 10) END; + errch(CHR(l MOD 10 + 30H)) + END errint; PROCEDURE DisplayHaltCode(code: SYSTEM.INT32); BEGIN diff --git a/src/tools/browser/BrowserCmd.Mod b/src/tools/browser/BrowserCmd.Mod index 3ae3dd5b..dd15c680 100644 --- a/src/tools/browser/BrowserCmd.Mod +++ b/src/tools/browser/BrowserCmd.Mod @@ -1,7 +1,7 @@ MODULE BrowserCmd; (* RC 29.10.93 *) (* object model 4.12.93, command line version jt 4.4.95 *) IMPORT - OPM, OPS, OPT, OPV, Texts, Out, Platform, SYSTEM; + OPM, OPS, OPT, OPV, Texts, Out, Oberon, Platform, SYSTEM; CONST @@ -12,12 +12,20 @@ MODULE BrowserCmd; (* RC 29.10.93 *) (* object model 4.12.93, command line ver option: CHAR; PROCEDURE Ws(s: ARRAY OF CHAR); BEGIN Texts.WriteString(W, s) END Ws; - PROCEDURE Wch(ch: CHAR); BEGIN Texts.Write(W, ch) END Wch; + PROCEDURE Wc(ch: CHAR); BEGIN Texts.Write(W, ch) END Wc; PROCEDURE Wi(i: SYSTEM.INT64); BEGIN Texts.WriteInt(W, i, 0) END Wi; PROCEDURE Wln; BEGIN Texts.WriteLn(W) END Wln; + PROCEDURE Wh(i: SYSTEM.INT64); + BEGIN + IF i >= 16 THEN Wh(i DIV 10H) + ELSIF i >= 10 THEN Wc("0") END; + i := i MOD 16; + IF i < 10 THEN Wc(CHR(i+30H)) ELSE Wc(CHR(i+37H)) END + END Wh; + PROCEDURE Indent(i: INTEGER); - BEGIN WHILE i > 0 DO Wch(" "); Wch(" "); DEC(i) END + BEGIN WHILE i > 0 DO Wc(" "); Wc(" "); DEC(i) END END Indent; PROCEDURE ^Wtype(typ: OPT.Struct); @@ -28,18 +36,26 @@ MODULE BrowserCmd; (* RC 29.10.93 *) (* object model 4.12.93, command line ver BEGIN first := TRUE; res := (result # NIL) (* hidden mthd *) & (result # OPT.notyp); paren := res OR (par # NIL); - IF paren THEN Wch("(") END ; + IF paren THEN Wc("(") END; WHILE par # NIL DO - IF ~first THEN Ws("; ") ELSE first := FALSE END ; - IF option = "x" THEN Wi(par^.adr); Wch(" ") END ; - IF par^.mode = OPT.VarPar THEN Ws("VAR ") END ; + IF ~first THEN Ws("; ") ELSE first := FALSE END; + IF option = "x" THEN Wi(par^.adr); Wc(" ") END; + IF par^.mode = OPT.VarPar THEN Ws("VAR ") END; Ws(par^.name); Ws(": "); Wtype(par^.typ); par := par^.link - END ; - IF paren THEN Wch(")") END ; + END; + IF paren THEN Wc(")") END; IF res THEN Ws(": "); Wtype(result) END END Wsign; + PROCEDURE HasForm(obj: OPT.Object; mode: SET): BOOLEAN; + BEGIN + RETURN (obj # NIL) + & ( ((obj.mode IN mode) & (obj.name # "")) + OR HasForm(obj.left, mode) + OR HasForm(obj.right, mode)); + END HasForm; + PROCEDURE Objects(obj: OPT.Object; mode: SET); VAR i: SYSTEM.INT64; m: INTEGER; s: SYSTEM.SET64; ext: OPT.ConstExt; BEGIN @@ -51,58 +67,58 @@ MODULE BrowserCmd; (* RC 29.10.93 *) (* object model 4.12.93, command line ver CASE obj^.typ^.form OF |OPT.Bool: IF obj^.conval^.intval = 1 THEN Ws("TRUE") ELSE Ws("FALSE") END |OPT.Char: IF (obj^.conval^.intval >= 32) & (obj^.conval^.intval <= 126) THEN - Wch(22X); Wch(CHR(obj^.conval^.intval)); Wch(22X) + Wc(22X); Wc(CHR(obj^.conval^.intval)); Wc(22X) ELSE i := obj^.conval^.intval DIV 16; - IF i > 9 THEN Wch(CHR(55 + i)) ELSE Wch(CHR(48 + i)) END ; + IF i > 9 THEN Wc(CHR(55 + i)) ELSE Wc(CHR(48 + i)) END; i := obj^.conval^.intval MOD 16; - IF i > 9 THEN Wch(CHR(55 + i)) ELSE Wch(CHR(48 + i)) END ; - Wch("X") + IF i > 9 THEN Wc(CHR(55 + i)) ELSE Wc(CHR(48 + i)) END; + Wc("X") END |OPT.Int: Wi(obj^.conval^.intval) - |OPT.Set: Wch("{"); i := 0; s := obj^.conval^.setval; + |OPT.Set: Wc("{"); i := 0; s := obj^.conval^.setval; WHILE i <= MAX(SYSTEM.SET64) DO IF i IN s THEN Wi(i); EXCL(s, i); IF s # {} THEN Ws(", ") END - END ; + END; INC(i) - END ; - Wch("}") + END; + Wc("}") |OPT.Real: Texts.WriteReal(W, SHORT(obj^.conval^.realval), 16) |OPT.LReal: Texts.WriteLongReal(W, obj^.conval^.realval, 23) - |OPT.String: Ws(obj^.conval^.ext^) + |OPT.String: Wc('"'); Ws(obj^.conval^.ext^); Wc('"') |OPT.NilTyp: Ws("NIL") ELSE (* Ignore other forms *) - END ; - Wch(";"); Wln + END; + Wc(";"); Wln |OPT.Typ: IF obj^.name # "" THEN Indent(2); IF obj^.typ^.strobj = obj THEN (* canonical name *) Wtype(obj^.typ); Ws(" = "); Wstruct(obj^.typ) ELSE (* alias *) Ws(obj^.name); Ws(" = "); Wtype(obj^.typ) - END ; - Wch(";"); Wln + END; + Wc(";"); Wln END |OPT.Var: Indent(2); Ws(obj^.name); - IF obj^.vis = OPT.externalR THEN Ws("-: ") ELSE Ws(": ") END ; - Wtype(obj^.typ); Wch(";"); Wln + IF obj^.vis = OPT.externalR THEN Ws("-: ") ELSE Ws(": ") END; + Wtype(obj^.typ); Wc(";"); Wln |OPT.XProc, OPT.CProc, OPT.IProc: Indent(1); Ws("PROCEDURE "); - IF obj^.mode = OPT.IProc THEN Wch("+") - ELSIF obj^.mode = OPT.CProc THEN Wch("-") - END ; + IF obj^.mode = OPT.IProc THEN Wc("+") + ELSIF obj^.mode = OPT.CProc THEN Wc("-") + END; Ws(obj^.name); Wsign(obj^.typ, obj^.link); IF obj^.mode = OPT.CProc THEN ext := obj^.conval^.ext; m := ORD(ext^[0]); i := 1; Ws(' "'); - WHILE i <= m DO Wch(ext^[i]); INC(i) END ; - Wch('"'); - END ; - Wch(";"); Wln + WHILE i <= m DO Wc(ext^[i]); INC(i) END; + Wc('"'); + END; + Wc(";"); Wln ELSE (* Ignore other modes *) END - END ; + END; Objects(obj^.right, mode) END END Objects; @@ -115,17 +131,17 @@ MODULE BrowserCmd; (* RC 29.10.93 *) (* object model 4.12.93, command line ver IF (obj^.mode = OPT.TProc) & ((obj^.name # OPM.HdTProcName) OR (option = "x")) THEN Indent(3); Ws("PROCEDURE ("); IF obj^.name # OPM.HdTProcName THEN - IF obj^.link^.mode = OPT.VarPar THEN Ws("VAR ") END ; + IF obj^.link^.mode = OPT.VarPar THEN Ws("VAR ") END; Ws(obj^.link^.name); Ws(": "); Wtype(obj^.link^.typ) - END ; + END; Ws(") "); Ws(obj^.name); Wsign(obj^.typ, obj^.link^.link); - Wch(";"); + Wc(";"); IF option = "x" THEN Indent(1); Ws("(* methno: "); Wi(obj^.adr DIV 10000H); Ws(" *)") - END ; + END; Wln; - END ; + END; Wmthd(obj^.right) END END Wmthd; @@ -134,10 +150,7 @@ MODULE BrowserCmd; (* RC 29.10.93 *) (* object model 4.12.93, command line ver VAR fld: OPT.Object; PROCEDURE SysFlag; - BEGIN - IF typ^.sysflag # 0 THEN - Wch("["); Wi(typ^.sysflag); Ws("] ") - END + BEGIN IF typ^.sysflag # 0 THEN Wc("["); Wh(typ^.sysflag); Ws("H] ") END END SysFlag; BEGIN @@ -149,20 +162,20 @@ MODULE BrowserCmd; (* RC 29.10.93 *) (* object model 4.12.93, command line ver |OPT.Array: Ws("ARRAY "); SysFlag; Wi(typ^.n); Ws(" OF "); Wtype(typ^.BaseTyp) |OPT.DynArr: Ws("ARRAY "); SysFlag; Ws("OF "); Wtype(typ^.BaseTyp) |OPT.Record: Ws("RECORD ");SysFlag; - IF typ^.BaseTyp # NIL THEN Wch("("); Wtype(typ^.BaseTyp); Wch(")") END ; + IF typ^.BaseTyp # NIL THEN Wc("("); Wtype(typ^.BaseTyp); Wc(")") END; Wln; fld := typ^.link; WHILE (fld # NIL) & (fld^.mode = OPT.Fld) DO IF (option = "x") OR (fld^.name[0] # "@") THEN Indent(3); - IF option = "x" THEN Wi(fld^.adr); Wch(" ") END ; + IF option = "x" THEN Wi(fld^.adr); Wc(" ") END; Ws(fld^.name); - IF fld^.vis = OPT.externalR THEN Wch("-") END ; - Ws(": "); Wtype(fld^.typ); Wch(";"); + IF fld^.vis = OPT.externalR THEN Wc("-") END; + Ws(": "); Wtype(fld^.typ); Wc(";"); Wln - END ; + END; fld := fld^.link - END ; + END; Wmthd(typ^.link); - Indent(2); Ws("END "); + Indent(2); Ws("END"); IF option = "x" THEN Indent(1); Ws("(* size: "); Wi(typ^.size); Ws(" align: "); Wi(typ^.align); Ws(" nofm: "); Wi(typ^.n); Ws(" *)") @@ -178,20 +191,23 @@ MODULE BrowserCmd; (* RC 29.10.93 *) (* object model 4.12.93, command line ver BEGIN obj := typ^.strobj; IF obj^.name # "" THEN - IF typ^.mno # 0 THEN Ws(OPT.GlbMod[typ^.mno].name); Wch(".") + IF typ^.mno # 0 THEN Ws(OPT.GlbMod[typ^.mno].name); Wc(".") ELSIF (typ = OPT.bytetyp) OR (typ = OPT.sysptrtyp) THEN Ws("SYSTEM.") - ELSIF obj^.vis = OPT.internal THEN Wch("#") - END ; + ELSIF obj^.vis = OPT.internal THEN Wc("#") + END; Ws(obj^.name) ELSE - IF (option = "x") & (typ^.ref > OPM.MaxStruct) THEN Wch("#"); Wi(typ^.ref - OPM.MaxStruct); Wch(" ") END ; + IF (option = "x") & (typ^.ref > OPM.MaxStruct) THEN Wc("#"); Wi(typ^.ref - OPM.MaxStruct); Wc(" ") END; Wstruct(typ) END END Wtype; PROCEDURE WModule(name: OPS.Name; T: Texts.Text); - VAR i: INTEGER; - beg, end: LONGINT; first, done: BOOLEAN; + VAR + i: INTEGER; + beg, end: LONGINT; + first, done: BOOLEAN; + obj: OPT.Object; PROCEDURE Header(s: ARRAY OF CHAR); BEGIN @@ -210,21 +226,24 @@ MODULE BrowserCmd; (* RC 29.10.93 *) (* object model 4.12.93, command line ver BEGIN OPT.Import("@notself", name, done); IF done THEN - Ws("DEFINITION "); Ws(name); Wch(";"); Wln; Wln; - Header("IMPORT"); i := 1; first := TRUE; - WHILE i < OPT.nofGmod DO - IF first THEN first := FALSE; Indent(2) ELSE Ws(", ") END ; - Ws(OPT.GlbMod[i].name); - INC(i) - END ; - IF ~first THEN Wch(";"); Wln END ; + Ws("DEFINITION "); Ws(name); Wc(";"); Wln; + + IF OPT.nofGmod > 1 THEN + Header("IMPORT"); i := 1; first := TRUE; + WHILE i < OPT.nofGmod DO + IF first THEN first := FALSE; Indent(2) ELSE Ws(", ") END; + Ws(OPT.GlbMod[i].name); + INC(i) + END; + IF ~first THEN Wc(";"); Wln END + END; CheckHeader; - Header("CONST"); Objects(OPT.GlbMod[0].right, {OPT.Con}); CheckHeader; - Header("TYPE"); Objects(OPT.GlbMod[0].right, {OPT.Typ}); CheckHeader; - Header("VAR"); Objects(OPT.GlbMod[0].right, {OPT.Var}); CheckHeader; - Objects(OPT.GlbMod[0].right, {OPT.XProc, OPT.IProc, OPT.CProc}); - Wln; - Ws("END "); Ws(name); Wch("."); Wln; Texts.Append(T, W.buf) + obj := OPT.GlbMod[0].right; + IF HasForm(obj, {OPT.Con}) THEN Header("CONST"); Objects(obj, {OPT.Con}); CheckHeader END; + IF HasForm(obj, {OPT.Typ}) THEN Header("TYPE"); Objects(obj, {OPT.Typ}); CheckHeader END; + IF HasForm(obj, {OPT.Var}) THEN Header("VAR"); Objects(obj, {OPT.Var}); CheckHeader END; + Objects(obj, {OPT.XProc, OPT.IProc, OPT.CProc}); Wln; + Ws("END "); Ws(name); Wc("."); Wln; Texts.Append(T, W.buf) ELSE Texts.WriteString(W, name); Texts.WriteString(W, " -- symbol file not found"); Texts.WriteLn(W); Texts.Append(T, W.buf) @@ -232,37 +251,34 @@ MODULE BrowserCmd; (* RC 29.10.93 *) (* object model 4.12.93, command line ver END WModule; PROCEDURE Ident(VAR name, first: ARRAY OF CHAR); - VAR i, j: INTEGER; ch: CHAR; + VAR i, j: INTEGER; ch: CHAR; BEGIN i := 0; - WHILE name[i] # 0X DO INC(i) END ; - WHILE (i >= 0) & (name[i] # "/") DO DEC(i) END ; + WHILE name[i] # 0X DO INC(i) END; + WHILE (i >= 0) & (name[i] # "/") DO DEC(i) END; INC(i); j := 0; ch := name[i]; - WHILE (ch # ".") & (ch # 0X) DO first[j] := ch; INC(i); INC(j); ch := name[i] END ; + WHILE (ch # ".") & (ch # 0X) DO first[j] := ch; INC(i); INC(j); ch := name[i] END; first[j] := 0X END Ident; PROCEDURE ShowDef*; - VAR T, dummyT: Texts.Text; S, vname, name: OPS.Name; R: Texts.Reader; ch: CHAR; - s: ARRAY 1024 OF CHAR; i: INTEGER; + VAR S, vname, name: OPS.Name; BEGIN option := 0X; Platform.GetArg(1, S); IF Platform.ArgCount > 2 THEN IF S[0] = OptionChar THEN option := S[1]; Platform.GetArg(2, S) ELSE Platform.GetArg(2, vname); option := vname[1] END - END ; + END; IF Platform.ArgCount >= 2 THEN Ident(S, name); - NEW(T); Texts.Open(T, ""); - OPT.Init(name, {}); OPT.SelfName := "AvoidErr154"; WModule(name, T); OPT.Close; - Texts.OpenReader(R, T, 0); Texts.Read(R, ch); i := 0; - WHILE ~R.eot DO - IF ch = 0DX THEN s[i] := 0X; i := 0; Out.String(s); Out.Ln - ELSE s[i] := ch; INC(i) - END ; - Texts.Read(R, ch) - END ; - s[i] := 0X; Out.String(s) + OPT.Init(name, {}); OPT.SelfName := "AvoidErr154"; + WModule(name, Oberon.Log); + OPT.Close; + ELSE + Texts.WriteString(W, "showdef - Display module's public interface."); Texts.WriteLn(W); + Texts.WriteString(W, "Usage: showdef module"); Texts.WriteLn(W); + Texts.WriteString(W, "Note: module.sym must be in the current directory."); Texts.WriteLn(W); + Texts.Append(Oberon.Log, W.buf) END END ShowDef; diff --git a/src/tools/make/oberon.mk b/src/tools/make/oberon.mk index bb8b0f60..f9ae45a4 100644 --- a/src/tools/make/oberon.mk +++ b/src/tools/make/oberon.mk @@ -130,8 +130,9 @@ translate: browsercmd: @printf "\nMaking symbol browser\n" - @cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -fSm -O$(MODEL) ../../src/tools/browser/BrowserCmd.Mod - @cd $(BUILDDIR); $(COMPILE) BrowserCmd.c -o showdef \ + @cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ssf -O$(MODEL) ../../src/runtime/Oberon.Mod + @cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Smf -O$(MODEL) ../../src/tools/browser/BrowserCmd.Mod + @cd $(BUILDDIR); $(COMPILE) BrowserCmd.c Oberon.c -o showdef \ Platform.o Texts.o OPT.o Heap.o Out.o SYSTEM.o OPM.o OPS.o OPV.o \ Files.o Reals.o Modules.o VT100.o errors.o Configuration.o Strings.o \ OPC.o From 377bc73774f0667530d8205d74d928a0c516ded8 Mon Sep 17 00:00:00 2001 From: David Brown Date: Mon, 14 Nov 2016 21:00:34 +0000 Subject: [PATCH 320/580] Restore text file based error support as prototyped in the ErrorExperiment branch. --- .gitignore | 4 + bootstrap/unix-44/Configuration.c | 2 +- bootstrap/unix-44/Modules.c | 22 +-- bootstrap/unix-44/Modules.h | 4 - bootstrap/unix-44/OPM.c | 28 +++- bootstrap/unix-44/errors.c | 205 ------------------------- bootstrap/unix-44/errors.h | 18 --- bootstrap/unix-48/Configuration.c | 2 +- bootstrap/unix-48/Modules.c | 22 +-- bootstrap/unix-48/Modules.h | 4 - bootstrap/unix-48/OPM.c | 28 +++- bootstrap/unix-48/errors.c | 205 ------------------------- bootstrap/unix-48/errors.h | 18 --- bootstrap/unix-88/Configuration.c | 2 +- bootstrap/unix-88/Modules.c | 22 +-- bootstrap/unix-88/Modules.h | 4 - bootstrap/unix-88/OPM.c | 28 +++- bootstrap/unix-88/errors.c | 205 ------------------------- bootstrap/unix-88/errors.h | 18 --- bootstrap/windows-48/Configuration.c | 2 +- bootstrap/windows-48/Modules.c | 22 +-- bootstrap/windows-48/Modules.h | 4 - bootstrap/windows-48/OPM.c | 28 +++- bootstrap/windows-48/errors.c | 205 ------------------------- bootstrap/windows-48/errors.h | 18 --- bootstrap/windows-88/Configuration.c | 2 +- bootstrap/windows-88/Modules.c | 22 +-- bootstrap/windows-88/Modules.h | 4 - bootstrap/windows-88/OPM.c | 28 +++- bootstrap/windows-88/errors.c | 205 ------------------------- bootstrap/windows-88/errors.h | 18 --- makefile | 5 + src/compiler/OPM.Mod | 37 ++++- src/compiler/errors.Mod | 215 --------------------------- src/runtime/Errors.Txt | 194 ++++++++++++++++++++++++ src/tools/make/oberon.mk | 22 ++- 36 files changed, 393 insertions(+), 1479 deletions(-) delete mode 100644 bootstrap/unix-44/errors.c delete mode 100644 bootstrap/unix-44/errors.h delete mode 100644 bootstrap/unix-48/errors.c delete mode 100644 bootstrap/unix-48/errors.h delete mode 100644 bootstrap/unix-88/errors.c delete mode 100644 bootstrap/unix-88/errors.h delete mode 100644 bootstrap/windows-48/errors.c delete mode 100644 bootstrap/windows-48/errors.h delete mode 100644 bootstrap/windows-88/errors.c delete mode 100644 bootstrap/windows-88/errors.h delete mode 100644 src/compiler/errors.Mod create mode 100644 src/runtime/Errors.Txt diff --git a/.gitignore b/.gitignore index a8e5ff00..1c2d92dd 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ /*.sym /*.asm /*.mod +/Errors.txt /olang /src/test/**/*.exe /src/test/**/*.c @@ -24,6 +25,9 @@ /src/test/confidence/**/*.asm /src/test/confidence/**/*.s /src/test/confidence/**/*.map +/bootstrap/*/SYSTEM.[ch] +/bootstrap/*/Errors.Txt +/bootstrap/*/WindowsWrapper.h /.DS_store **/.DS_store **/*.dSYM diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index 4e78eeda..40f3ddee 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/14]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index 34a1723e..5fb74ad0 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -55,9 +55,8 @@ export void Modules_Halt (INT32 code); export Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len); export Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len); static void Modules_errch (CHAR c); -export void Modules_errint (INT32 l); -static void Modules_errposint (INT32 l); -export void Modules_errstring (CHAR *s, LONGINT s__len); +static void Modules_errint (INT32 l); +static void Modules_errstring (CHAR *s, LONGINT s__len); #define Modules_modules() (Modules_Module)Heap_modules #define Modules_setmodules(m) Heap_modules = m @@ -169,7 +168,7 @@ static void Modules_errch (CHAR c) e = Platform_Write(1, (ADDRESS)&c, 1); } -void Modules_errstring (CHAR *s, LONGINT s__len) +static void Modules_errstring (CHAR *s, LONGINT s__len) { INT32 i; __DUP(s, s__len, CHAR); @@ -181,21 +180,16 @@ void Modules_errstring (CHAR *s, LONGINT s__len) __DEL(s); } -static void Modules_errposint (INT32 l) -{ - if (l > 10) { - Modules_errposint(__DIV(l, 10)); - } - Modules_errch((CHAR)(48 + (int)__MOD(l, 10))); -} - -void Modules_errint (INT32 l) +static void Modules_errint (INT32 l) { if (l < 0) { Modules_errch('-'); l = -l; } - Modules_errposint(l); + if (l >= 10) { + Modules_errint(__DIV(l, 10)); + } + Modules_errch((CHAR)((int)__MOD(l, 10) + 48)); } static void Modules_DisplayHaltCode (INT32 code) diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index 7c2a221a..66c0c947 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -48,11 +48,7 @@ import void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all); import void Modules_Halt (INT32 code); import Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len); import Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len); -import void Modules_errint (INT32 l); -import void Modules_errstring (CHAR *s, LONGINT s__len); import void *Modules__init(void); -#define Modules_modules() (Modules_Module)Heap_modules -#define Modules_setmodules(m) Heap_modules = m #endif // Modules diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index f52f655a..a5afb71e 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -13,7 +13,6 @@ #include "Strings.h" #include "Texts.h" #include "VT100.h" -#include "errors.h" typedef CHAR OPM_FileName[32]; @@ -37,7 +36,7 @@ export CHAR OPM_modName[32]; export CHAR OPM_objname[64]; static INT32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; static Texts_Reader OPM_inR; -static Texts_Text OPM_Log; +static Texts_Text OPM_Log, OPM_Errors; static Files_Rider OPM_oldSF, OPM_newSF; static Files_Rider OPM_R[3]; static Files_File OPM_oldSFile, OPM_newSFile, OPM_HFile, OPM_BFile, OPM_HIFile; @@ -536,11 +535,9 @@ static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGIN static void OPM_LogErrMsg (INT16 n) { + INT16 l; Texts_Scanner S; - Texts_Text T = NIL; - CHAR ch; - INT16 i; - CHAR buf[1024]; + CHAR c; if (n >= 0) { if (!__IN(16, OPM_Options, 32)) { VT100_SetAttr((CHAR*)"31m", 4); @@ -561,7 +558,22 @@ static void OPM_LogErrMsg (INT16 n) } OPM_LogWNum(n, 1); OPM_LogWStr((CHAR*)" ", 3); - OPM_LogWStr(errors_errors[__X(n, 350)], 128); + if (OPM_Errors == NIL) { + __NEW(OPM_Errors, Texts_TextDesc); + Texts_Open(OPM_Errors, (CHAR*)"Errors.Txt", 11); + } + Texts_OpenScanner(&S, Texts_Scanner__typ, OPM_Errors, 0); + do { + l = S.line; + Texts_Scan(&S, Texts_Scanner__typ); + } while (!((((l != S.line && S.class == 3)) && S.i == n) || S.eot)); + if (!S.eot) { + Texts_Read((void*)&S, Texts_Scanner__typ, &c); + while ((!S.eot && c >= ' ')) { + Out_Char(c); + Texts_Read((void*)&S, Texts_Scanner__typ, &c); + } + } } static void OPM_FindLine (Files_File f, Files_Rider *r, ADDRESS *r__typ, INT64 pos) @@ -1043,6 +1055,7 @@ static void EnumPtrs(void (*P)(void*)) { __ENUMR(&OPM_inR, Texts_Reader__typ, 48, 1, P); P(OPM_Log); + P(OPM_Errors); __ENUMR(&OPM_oldSF, Files_Rider__typ, 20, 1, P); __ENUMR(&OPM_newSF, Files_Rider__typ, 20, 1, P); __ENUMR(OPM_R, Files_Rider__typ, 20, 3, P); @@ -1064,7 +1077,6 @@ export void *OPM__init(void) __MODULE_IMPORT(Strings); __MODULE_IMPORT(Texts); __MODULE_IMPORT(VT100); - __MODULE_IMPORT(errors); __REGMOD("OPM", EnumPtrs); __REGCMD("CloseFiles", OPM_CloseFiles); __REGCMD("CloseOldSym", OPM_CloseOldSym); diff --git a/bootstrap/unix-44/errors.c b/bootstrap/unix-44/errors.c deleted file mode 100644 index 64af94f5..00000000 --- a/bootstrap/unix-44/errors.c +++ /dev/null @@ -1,205 +0,0 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ - -#define SHORTINT INT8 -#define INTEGER INT16 -#define LONGINT INT32 -#define SET UINT32 - -#include "SYSTEM.h" - -typedef - CHAR errors_string[128]; - - -export errors_string errors_errors[350]; - - - - - -export void *errors__init(void) -{ - __DEFMOD; - __REGMOD("errors", 0); -/* BEGIN */ - __MOVE("undeclared identifier", errors_errors[0], 22); - __MOVE("multiply defined identifier", errors_errors[1], 28); - __MOVE("illegal character in number", errors_errors[2], 28); - __MOVE("illegal character in string", errors_errors[3], 28); - __MOVE("identifier does not match procedure name", errors_errors[4], 41); - __MOVE("comment not closed", errors_errors[5], 19); - errors_errors[6][0] = 0x00; - errors_errors[7][0] = 0x00; - errors_errors[8][0] = 0x00; - __MOVE("'=' expected", errors_errors[9], 13); - errors_errors[10][0] = 0x00; - errors_errors[11][0] = 0x00; - __MOVE("type definition starts with incorrect symbol", errors_errors[12], 45); - __MOVE("factor starts with incorrect symbol", errors_errors[13], 36); - __MOVE("statement starts with incorrect symbol", errors_errors[14], 39); - __MOVE("declaration followed by incorrect symbol", errors_errors[15], 41); - __MOVE("MODULE expected", errors_errors[16], 16); - errors_errors[17][0] = 0x00; - __MOVE("'.' missing", errors_errors[18], 12); - __MOVE("',' missing", errors_errors[19], 12); - __MOVE("':' missing", errors_errors[20], 12); - errors_errors[21][0] = 0x00; - __MOVE("')' missing", errors_errors[22], 12); - __MOVE("']' missing", errors_errors[23], 12); - __MOVE("'}' missing", errors_errors[24], 12); - __MOVE("OF missing", errors_errors[25], 11); - __MOVE("THEN missing", errors_errors[26], 13); - __MOVE("DO missing", errors_errors[27], 11); - __MOVE("TO missing", errors_errors[28], 11); - errors_errors[29][0] = 0x00; - __MOVE("'(' missing", errors_errors[30], 12); - errors_errors[31][0] = 0x00; - errors_errors[32][0] = 0x00; - errors_errors[33][0] = 0x00; - __MOVE("':=' missing", errors_errors[34], 13); - __MOVE("',' or OF expected", errors_errors[35], 19); - errors_errors[36][0] = 0x00; - errors_errors[37][0] = 0x00; - __MOVE("identifier expected", errors_errors[38], 20); - __MOVE("';' missing", errors_errors[39], 12); - errors_errors[40][0] = 0x00; - __MOVE("END missing", errors_errors[41], 12); - errors_errors[42][0] = 0x00; - errors_errors[43][0] = 0x00; - __MOVE("UNTIL missing", errors_errors[44], 14); - errors_errors[45][0] = 0x00; - __MOVE("EXIT not within loop statement", errors_errors[46], 31); - __MOVE("illegally marked identifier", errors_errors[47], 28); - errors_errors[48][0] = 0x00; - errors_errors[49][0] = 0x00; - __MOVE("expression should be constant", errors_errors[50], 30); - __MOVE("constant not an integer", errors_errors[51], 24); - __MOVE("identifier does not denote a type", errors_errors[52], 34); - __MOVE("identifier does not denote a record type", errors_errors[53], 41); - __MOVE("result type of procedure is not a basic type", errors_errors[54], 45); - __MOVE("procedure call of a function", errors_errors[55], 29); - __MOVE("assignment to non-variable", errors_errors[56], 27); - __MOVE("pointer not bound to record or array type", errors_errors[57], 42); - __MOVE("recursive type definition", errors_errors[58], 26); - __MOVE("illegal open array parameter", errors_errors[59], 29); - __MOVE("wrong type of case label", errors_errors[60], 25); - __MOVE("inadmissible type of case label", errors_errors[61], 32); - __MOVE("case label defined more than once", errors_errors[62], 34); - __MOVE("illegal value of constant", errors_errors[63], 26); - __MOVE("more actual than formal parameters", errors_errors[64], 35); - __MOVE("fewer actual than formal parameters", errors_errors[65], 36); - __MOVE("element types of actual array and formal open array differ", errors_errors[66], 59); - __MOVE("actual parameter corresponding to open array is not an array", errors_errors[67], 61); - __MOVE("control variable must be integer", errors_errors[68], 33); - __MOVE("parameter must be an integer constant", errors_errors[69], 38); - __MOVE("pointer or VAR record required as formal receiver", errors_errors[70], 50); - __MOVE("pointer expected as actual receiver", errors_errors[71], 36); - __MOVE("procedure must be bound to a record of the same scope", errors_errors[72], 54); - __MOVE("procedure must have level 0", errors_errors[73], 28); - __MOVE("procedure unknown in base type", errors_errors[74], 31); - __MOVE("invalid call of base procedure", errors_errors[75], 31); - __MOVE("this variable (field) is read only", errors_errors[76], 35); - __MOVE("object is not a record", errors_errors[77], 23); - __MOVE("dereferenced object is not a variable", errors_errors[78], 38); - __MOVE("indexed object is not a variable", errors_errors[79], 33); - __MOVE("index expression is not an integer", errors_errors[80], 35); - __MOVE("index out of specified bounds", errors_errors[81], 30); - __MOVE("indexed variable is not an array", errors_errors[82], 33); - __MOVE("undefined record field", errors_errors[83], 23); - __MOVE("dereferenced variable is not a pointer", errors_errors[84], 39); - __MOVE("guard or test type is not an extension of variable type", errors_errors[85], 56); - __MOVE("guard or testtype is not a pointer", errors_errors[86], 35); - __MOVE("guarded or tested variable is neither a pointer nor a VAR-parameter record", errors_errors[87], 75); - __MOVE("open array not allowed as variable, record field or array element", errors_errors[88], 66); - errors_errors[89][0] = 0x00; - errors_errors[90][0] = 0x00; - errors_errors[91][0] = 0x00; - __MOVE("operand of IN not an integer, or not a set", errors_errors[92], 43); - __MOVE("set element type is not an integer", errors_errors[93], 35); - __MOVE("operand of & is not of type BOOLEAN", errors_errors[94], 36); - __MOVE("operand of OR is not of type BOOLEAN", errors_errors[95], 37); - __MOVE("operand not applicable to (unary) +", errors_errors[96], 36); - __MOVE("operand not applicable to (unary) -", errors_errors[97], 36); - __MOVE("operand of ~ is not of type BOOLEAN", errors_errors[98], 36); - __MOVE("ASSERT fault", errors_errors[99], 13); - __MOVE("incompatible operands of dyadic operator", errors_errors[100], 41); - __MOVE("operand type inapplicable to *", errors_errors[101], 31); - __MOVE("operand type inapplicable to /", errors_errors[102], 31); - __MOVE("operand type inapplicable to DIV", errors_errors[103], 33); - __MOVE("operand type inapplicable to MOD", errors_errors[104], 33); - __MOVE("operand type inapplicable to +", errors_errors[105], 31); - __MOVE("operand type inapplicable to -", errors_errors[106], 31); - __MOVE("operand type inapplicable to = or #", errors_errors[107], 36); - __MOVE("operand type inapplicable to relation", errors_errors[108], 38); - __MOVE("overriding method must be exported", errors_errors[109], 35); - __MOVE("operand is not a type", errors_errors[110], 22); - __MOVE("operand inapplicable to (this) function", errors_errors[111], 40); - __MOVE("operand is not a variable", errors_errors[112], 26); - __MOVE("incompatible assignment", errors_errors[113], 24); - __MOVE("string too long to be assigned", errors_errors[114], 31); - __MOVE("parameter doesn't match", errors_errors[115], 24); - __MOVE("number of parameters doesn't match", errors_errors[116], 35); - __MOVE("result type doesn't match", errors_errors[117], 26); - __MOVE("export mark doesn't match with forward declaration", errors_errors[118], 51); - __MOVE("redefinition textually precedes procedure bound to base type", errors_errors[119], 61); - __MOVE("type of expression following IF, WHILE, UNTIL or ASSERT is not BOOLEAN", errors_errors[120], 71); - __MOVE("called object is not a procedure (or is an interrupt procedure)", errors_errors[121], 64); - __MOVE("actual VAR-parameter is not a variable", errors_errors[122], 39); - __MOVE("type of actual parameter is not identical with that of formal VAR-parameter", errors_errors[123], 76); - __MOVE("type of result expression differs from that of procedure", errors_errors[124], 57); - __MOVE("type of case expression is neither INTEGER nor CHAR", errors_errors[125], 52); - __MOVE("this expression cannot be a type or a procedure", errors_errors[126], 48); - __MOVE("illegal use of object", errors_errors[127], 22); - __MOVE("unsatisfied forward reference", errors_errors[128], 30); - __MOVE("unsatisfied forward procedure", errors_errors[129], 30); - __MOVE("WITH clause does not specify a variable", errors_errors[130], 40); - __MOVE("LEN not applied to array", errors_errors[131], 25); - __MOVE("dimension in LEN too large or negative", errors_errors[132], 39); - __MOVE("SYSTEM not imported", errors_errors[135], 20); - __MOVE("key inconsistency of imported module", errors_errors[150], 37); - __MOVE("incorrect symbol file", errors_errors[151], 22); - __MOVE("symbol file of imported module not found", errors_errors[152], 41); - __MOVE("object or symbol file not opened (disk full\?)", errors_errors[153], 46); - __MOVE("recursive import not allowed", errors_errors[154], 29); - __MOVE("generation of new symbol file not allowed", errors_errors[155], 42); - __MOVE("parameter file not found", errors_errors[156], 25); - __MOVE("syntax error in parameter file", errors_errors[157], 31); - __MOVE("not yet implemented", errors_errors[200], 20); - __MOVE("lower bound of set range greater than higher bound", errors_errors[201], 51); - __MOVE("set element greater than MAX(SET) or less than 0", errors_errors[202], 49); - __MOVE("number too large", errors_errors[203], 17); - __MOVE("product too large", errors_errors[204], 18); - __MOVE("division by zero", errors_errors[205], 17); - __MOVE("sum too large", errors_errors[206], 14); - __MOVE("difference too large", errors_errors[207], 21); - __MOVE("overflow in arithmetic shift", errors_errors[208], 29); - __MOVE("case range too large", errors_errors[209], 21); - __MOVE("too many cases in case statement", errors_errors[213], 33); - __MOVE("illegal value of parameter (0 <= p < 256)", errors_errors[218], 42); - __MOVE("machine registers cannot be accessed", errors_errors[219], 37); - __MOVE("illegal value of parameter", errors_errors[220], 27); - __MOVE("too many pointers in a record", errors_errors[221], 30); - __MOVE("too many global pointers", errors_errors[222], 25); - __MOVE("too many record types", errors_errors[223], 22); - __MOVE("too many pointer types", errors_errors[224], 23); - __MOVE("address of pointer variable too large (move forward in text)", errors_errors[225], 61); - __MOVE("too many exported procedures", errors_errors[226], 29); - __MOVE("too many imported modules", errors_errors[227], 26); - __MOVE("too many exported structures", errors_errors[228], 29); - __MOVE("too many nested records for import", errors_errors[229], 35); - __MOVE("too many constants (strings) in module", errors_errors[230], 39); - __MOVE("too many link table entries (external procedures)", errors_errors[231], 50); - __MOVE("too many commands in module", errors_errors[232], 28); - __MOVE("record extension hierarchy too high", errors_errors[233], 36); - __MOVE("export of recursive type not allowed", errors_errors[234], 37); - __MOVE("identifier too long", errors_errors[240], 20); - __MOVE("string too long", errors_errors[241], 16); - __MOVE("address overflow", errors_errors[242], 17); - __MOVE("cyclic type definition not allowed", errors_errors[244], 35); - __MOVE("guarded pointer variable may be manipulated by non-local operations; use auxiliary pointer variable", errors_errors[245], 100); - __MOVE("implicit type cast", errors_errors[301], 19); - __MOVE("inappropriate symbol file ignored", errors_errors[306], 34); - __MOVE("no ELSE symbol after CASE statement sequence may lead to trap", errors_errors[307], 62); - __MOVE("SYSTEM.VAL result includes memory past end of source variable", errors_errors[308], 62); - __ENDMOD; -} diff --git a/bootstrap/unix-44/errors.h b/bootstrap/unix-44/errors.h deleted file mode 100644 index 1a983a0c..00000000 --- a/bootstrap/unix-44/errors.h +++ /dev/null @@ -1,18 +0,0 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ - -#ifndef errors__h -#define errors__h - -#include "SYSTEM.h" - -typedef - CHAR errors_string[128]; - - -import errors_string errors_errors[350]; - - -import void *errors__init(void); - - -#endif // errors diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index 4e78eeda..40f3ddee 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/14]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index 34a1723e..5fb74ad0 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -55,9 +55,8 @@ export void Modules_Halt (INT32 code); export Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len); export Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len); static void Modules_errch (CHAR c); -export void Modules_errint (INT32 l); -static void Modules_errposint (INT32 l); -export void Modules_errstring (CHAR *s, LONGINT s__len); +static void Modules_errint (INT32 l); +static void Modules_errstring (CHAR *s, LONGINT s__len); #define Modules_modules() (Modules_Module)Heap_modules #define Modules_setmodules(m) Heap_modules = m @@ -169,7 +168,7 @@ static void Modules_errch (CHAR c) e = Platform_Write(1, (ADDRESS)&c, 1); } -void Modules_errstring (CHAR *s, LONGINT s__len) +static void Modules_errstring (CHAR *s, LONGINT s__len) { INT32 i; __DUP(s, s__len, CHAR); @@ -181,21 +180,16 @@ void Modules_errstring (CHAR *s, LONGINT s__len) __DEL(s); } -static void Modules_errposint (INT32 l) -{ - if (l > 10) { - Modules_errposint(__DIV(l, 10)); - } - Modules_errch((CHAR)(48 + (int)__MOD(l, 10))); -} - -void Modules_errint (INT32 l) +static void Modules_errint (INT32 l) { if (l < 0) { Modules_errch('-'); l = -l; } - Modules_errposint(l); + if (l >= 10) { + Modules_errint(__DIV(l, 10)); + } + Modules_errch((CHAR)((int)__MOD(l, 10) + 48)); } static void Modules_DisplayHaltCode (INT32 code) diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index 7c2a221a..66c0c947 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -48,11 +48,7 @@ import void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all); import void Modules_Halt (INT32 code); import Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len); import Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len); -import void Modules_errint (INT32 l); -import void Modules_errstring (CHAR *s, LONGINT s__len); import void *Modules__init(void); -#define Modules_modules() (Modules_Module)Heap_modules -#define Modules_setmodules(m) Heap_modules = m #endif // Modules diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index f52f655a..a5afb71e 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -13,7 +13,6 @@ #include "Strings.h" #include "Texts.h" #include "VT100.h" -#include "errors.h" typedef CHAR OPM_FileName[32]; @@ -37,7 +36,7 @@ export CHAR OPM_modName[32]; export CHAR OPM_objname[64]; static INT32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; static Texts_Reader OPM_inR; -static Texts_Text OPM_Log; +static Texts_Text OPM_Log, OPM_Errors; static Files_Rider OPM_oldSF, OPM_newSF; static Files_Rider OPM_R[3]; static Files_File OPM_oldSFile, OPM_newSFile, OPM_HFile, OPM_BFile, OPM_HIFile; @@ -536,11 +535,9 @@ static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGIN static void OPM_LogErrMsg (INT16 n) { + INT16 l; Texts_Scanner S; - Texts_Text T = NIL; - CHAR ch; - INT16 i; - CHAR buf[1024]; + CHAR c; if (n >= 0) { if (!__IN(16, OPM_Options, 32)) { VT100_SetAttr((CHAR*)"31m", 4); @@ -561,7 +558,22 @@ static void OPM_LogErrMsg (INT16 n) } OPM_LogWNum(n, 1); OPM_LogWStr((CHAR*)" ", 3); - OPM_LogWStr(errors_errors[__X(n, 350)], 128); + if (OPM_Errors == NIL) { + __NEW(OPM_Errors, Texts_TextDesc); + Texts_Open(OPM_Errors, (CHAR*)"Errors.Txt", 11); + } + Texts_OpenScanner(&S, Texts_Scanner__typ, OPM_Errors, 0); + do { + l = S.line; + Texts_Scan(&S, Texts_Scanner__typ); + } while (!((((l != S.line && S.class == 3)) && S.i == n) || S.eot)); + if (!S.eot) { + Texts_Read((void*)&S, Texts_Scanner__typ, &c); + while ((!S.eot && c >= ' ')) { + Out_Char(c); + Texts_Read((void*)&S, Texts_Scanner__typ, &c); + } + } } static void OPM_FindLine (Files_File f, Files_Rider *r, ADDRESS *r__typ, INT64 pos) @@ -1043,6 +1055,7 @@ static void EnumPtrs(void (*P)(void*)) { __ENUMR(&OPM_inR, Texts_Reader__typ, 48, 1, P); P(OPM_Log); + P(OPM_Errors); __ENUMR(&OPM_oldSF, Files_Rider__typ, 20, 1, P); __ENUMR(&OPM_newSF, Files_Rider__typ, 20, 1, P); __ENUMR(OPM_R, Files_Rider__typ, 20, 3, P); @@ -1064,7 +1077,6 @@ export void *OPM__init(void) __MODULE_IMPORT(Strings); __MODULE_IMPORT(Texts); __MODULE_IMPORT(VT100); - __MODULE_IMPORT(errors); __REGMOD("OPM", EnumPtrs); __REGCMD("CloseFiles", OPM_CloseFiles); __REGCMD("CloseOldSym", OPM_CloseOldSym); diff --git a/bootstrap/unix-48/errors.c b/bootstrap/unix-48/errors.c deleted file mode 100644 index 64af94f5..00000000 --- a/bootstrap/unix-48/errors.c +++ /dev/null @@ -1,205 +0,0 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ - -#define SHORTINT INT8 -#define INTEGER INT16 -#define LONGINT INT32 -#define SET UINT32 - -#include "SYSTEM.h" - -typedef - CHAR errors_string[128]; - - -export errors_string errors_errors[350]; - - - - - -export void *errors__init(void) -{ - __DEFMOD; - __REGMOD("errors", 0); -/* BEGIN */ - __MOVE("undeclared identifier", errors_errors[0], 22); - __MOVE("multiply defined identifier", errors_errors[1], 28); - __MOVE("illegal character in number", errors_errors[2], 28); - __MOVE("illegal character in string", errors_errors[3], 28); - __MOVE("identifier does not match procedure name", errors_errors[4], 41); - __MOVE("comment not closed", errors_errors[5], 19); - errors_errors[6][0] = 0x00; - errors_errors[7][0] = 0x00; - errors_errors[8][0] = 0x00; - __MOVE("'=' expected", errors_errors[9], 13); - errors_errors[10][0] = 0x00; - errors_errors[11][0] = 0x00; - __MOVE("type definition starts with incorrect symbol", errors_errors[12], 45); - __MOVE("factor starts with incorrect symbol", errors_errors[13], 36); - __MOVE("statement starts with incorrect symbol", errors_errors[14], 39); - __MOVE("declaration followed by incorrect symbol", errors_errors[15], 41); - __MOVE("MODULE expected", errors_errors[16], 16); - errors_errors[17][0] = 0x00; - __MOVE("'.' missing", errors_errors[18], 12); - __MOVE("',' missing", errors_errors[19], 12); - __MOVE("':' missing", errors_errors[20], 12); - errors_errors[21][0] = 0x00; - __MOVE("')' missing", errors_errors[22], 12); - __MOVE("']' missing", errors_errors[23], 12); - __MOVE("'}' missing", errors_errors[24], 12); - __MOVE("OF missing", errors_errors[25], 11); - __MOVE("THEN missing", errors_errors[26], 13); - __MOVE("DO missing", errors_errors[27], 11); - __MOVE("TO missing", errors_errors[28], 11); - errors_errors[29][0] = 0x00; - __MOVE("'(' missing", errors_errors[30], 12); - errors_errors[31][0] = 0x00; - errors_errors[32][0] = 0x00; - errors_errors[33][0] = 0x00; - __MOVE("':=' missing", errors_errors[34], 13); - __MOVE("',' or OF expected", errors_errors[35], 19); - errors_errors[36][0] = 0x00; - errors_errors[37][0] = 0x00; - __MOVE("identifier expected", errors_errors[38], 20); - __MOVE("';' missing", errors_errors[39], 12); - errors_errors[40][0] = 0x00; - __MOVE("END missing", errors_errors[41], 12); - errors_errors[42][0] = 0x00; - errors_errors[43][0] = 0x00; - __MOVE("UNTIL missing", errors_errors[44], 14); - errors_errors[45][0] = 0x00; - __MOVE("EXIT not within loop statement", errors_errors[46], 31); - __MOVE("illegally marked identifier", errors_errors[47], 28); - errors_errors[48][0] = 0x00; - errors_errors[49][0] = 0x00; - __MOVE("expression should be constant", errors_errors[50], 30); - __MOVE("constant not an integer", errors_errors[51], 24); - __MOVE("identifier does not denote a type", errors_errors[52], 34); - __MOVE("identifier does not denote a record type", errors_errors[53], 41); - __MOVE("result type of procedure is not a basic type", errors_errors[54], 45); - __MOVE("procedure call of a function", errors_errors[55], 29); - __MOVE("assignment to non-variable", errors_errors[56], 27); - __MOVE("pointer not bound to record or array type", errors_errors[57], 42); - __MOVE("recursive type definition", errors_errors[58], 26); - __MOVE("illegal open array parameter", errors_errors[59], 29); - __MOVE("wrong type of case label", errors_errors[60], 25); - __MOVE("inadmissible type of case label", errors_errors[61], 32); - __MOVE("case label defined more than once", errors_errors[62], 34); - __MOVE("illegal value of constant", errors_errors[63], 26); - __MOVE("more actual than formal parameters", errors_errors[64], 35); - __MOVE("fewer actual than formal parameters", errors_errors[65], 36); - __MOVE("element types of actual array and formal open array differ", errors_errors[66], 59); - __MOVE("actual parameter corresponding to open array is not an array", errors_errors[67], 61); - __MOVE("control variable must be integer", errors_errors[68], 33); - __MOVE("parameter must be an integer constant", errors_errors[69], 38); - __MOVE("pointer or VAR record required as formal receiver", errors_errors[70], 50); - __MOVE("pointer expected as actual receiver", errors_errors[71], 36); - __MOVE("procedure must be bound to a record of the same scope", errors_errors[72], 54); - __MOVE("procedure must have level 0", errors_errors[73], 28); - __MOVE("procedure unknown in base type", errors_errors[74], 31); - __MOVE("invalid call of base procedure", errors_errors[75], 31); - __MOVE("this variable (field) is read only", errors_errors[76], 35); - __MOVE("object is not a record", errors_errors[77], 23); - __MOVE("dereferenced object is not a variable", errors_errors[78], 38); - __MOVE("indexed object is not a variable", errors_errors[79], 33); - __MOVE("index expression is not an integer", errors_errors[80], 35); - __MOVE("index out of specified bounds", errors_errors[81], 30); - __MOVE("indexed variable is not an array", errors_errors[82], 33); - __MOVE("undefined record field", errors_errors[83], 23); - __MOVE("dereferenced variable is not a pointer", errors_errors[84], 39); - __MOVE("guard or test type is not an extension of variable type", errors_errors[85], 56); - __MOVE("guard or testtype is not a pointer", errors_errors[86], 35); - __MOVE("guarded or tested variable is neither a pointer nor a VAR-parameter record", errors_errors[87], 75); - __MOVE("open array not allowed as variable, record field or array element", errors_errors[88], 66); - errors_errors[89][0] = 0x00; - errors_errors[90][0] = 0x00; - errors_errors[91][0] = 0x00; - __MOVE("operand of IN not an integer, or not a set", errors_errors[92], 43); - __MOVE("set element type is not an integer", errors_errors[93], 35); - __MOVE("operand of & is not of type BOOLEAN", errors_errors[94], 36); - __MOVE("operand of OR is not of type BOOLEAN", errors_errors[95], 37); - __MOVE("operand not applicable to (unary) +", errors_errors[96], 36); - __MOVE("operand not applicable to (unary) -", errors_errors[97], 36); - __MOVE("operand of ~ is not of type BOOLEAN", errors_errors[98], 36); - __MOVE("ASSERT fault", errors_errors[99], 13); - __MOVE("incompatible operands of dyadic operator", errors_errors[100], 41); - __MOVE("operand type inapplicable to *", errors_errors[101], 31); - __MOVE("operand type inapplicable to /", errors_errors[102], 31); - __MOVE("operand type inapplicable to DIV", errors_errors[103], 33); - __MOVE("operand type inapplicable to MOD", errors_errors[104], 33); - __MOVE("operand type inapplicable to +", errors_errors[105], 31); - __MOVE("operand type inapplicable to -", errors_errors[106], 31); - __MOVE("operand type inapplicable to = or #", errors_errors[107], 36); - __MOVE("operand type inapplicable to relation", errors_errors[108], 38); - __MOVE("overriding method must be exported", errors_errors[109], 35); - __MOVE("operand is not a type", errors_errors[110], 22); - __MOVE("operand inapplicable to (this) function", errors_errors[111], 40); - __MOVE("operand is not a variable", errors_errors[112], 26); - __MOVE("incompatible assignment", errors_errors[113], 24); - __MOVE("string too long to be assigned", errors_errors[114], 31); - __MOVE("parameter doesn't match", errors_errors[115], 24); - __MOVE("number of parameters doesn't match", errors_errors[116], 35); - __MOVE("result type doesn't match", errors_errors[117], 26); - __MOVE("export mark doesn't match with forward declaration", errors_errors[118], 51); - __MOVE("redefinition textually precedes procedure bound to base type", errors_errors[119], 61); - __MOVE("type of expression following IF, WHILE, UNTIL or ASSERT is not BOOLEAN", errors_errors[120], 71); - __MOVE("called object is not a procedure (or is an interrupt procedure)", errors_errors[121], 64); - __MOVE("actual VAR-parameter is not a variable", errors_errors[122], 39); - __MOVE("type of actual parameter is not identical with that of formal VAR-parameter", errors_errors[123], 76); - __MOVE("type of result expression differs from that of procedure", errors_errors[124], 57); - __MOVE("type of case expression is neither INTEGER nor CHAR", errors_errors[125], 52); - __MOVE("this expression cannot be a type or a procedure", errors_errors[126], 48); - __MOVE("illegal use of object", errors_errors[127], 22); - __MOVE("unsatisfied forward reference", errors_errors[128], 30); - __MOVE("unsatisfied forward procedure", errors_errors[129], 30); - __MOVE("WITH clause does not specify a variable", errors_errors[130], 40); - __MOVE("LEN not applied to array", errors_errors[131], 25); - __MOVE("dimension in LEN too large or negative", errors_errors[132], 39); - __MOVE("SYSTEM not imported", errors_errors[135], 20); - __MOVE("key inconsistency of imported module", errors_errors[150], 37); - __MOVE("incorrect symbol file", errors_errors[151], 22); - __MOVE("symbol file of imported module not found", errors_errors[152], 41); - __MOVE("object or symbol file not opened (disk full\?)", errors_errors[153], 46); - __MOVE("recursive import not allowed", errors_errors[154], 29); - __MOVE("generation of new symbol file not allowed", errors_errors[155], 42); - __MOVE("parameter file not found", errors_errors[156], 25); - __MOVE("syntax error in parameter file", errors_errors[157], 31); - __MOVE("not yet implemented", errors_errors[200], 20); - __MOVE("lower bound of set range greater than higher bound", errors_errors[201], 51); - __MOVE("set element greater than MAX(SET) or less than 0", errors_errors[202], 49); - __MOVE("number too large", errors_errors[203], 17); - __MOVE("product too large", errors_errors[204], 18); - __MOVE("division by zero", errors_errors[205], 17); - __MOVE("sum too large", errors_errors[206], 14); - __MOVE("difference too large", errors_errors[207], 21); - __MOVE("overflow in arithmetic shift", errors_errors[208], 29); - __MOVE("case range too large", errors_errors[209], 21); - __MOVE("too many cases in case statement", errors_errors[213], 33); - __MOVE("illegal value of parameter (0 <= p < 256)", errors_errors[218], 42); - __MOVE("machine registers cannot be accessed", errors_errors[219], 37); - __MOVE("illegal value of parameter", errors_errors[220], 27); - __MOVE("too many pointers in a record", errors_errors[221], 30); - __MOVE("too many global pointers", errors_errors[222], 25); - __MOVE("too many record types", errors_errors[223], 22); - __MOVE("too many pointer types", errors_errors[224], 23); - __MOVE("address of pointer variable too large (move forward in text)", errors_errors[225], 61); - __MOVE("too many exported procedures", errors_errors[226], 29); - __MOVE("too many imported modules", errors_errors[227], 26); - __MOVE("too many exported structures", errors_errors[228], 29); - __MOVE("too many nested records for import", errors_errors[229], 35); - __MOVE("too many constants (strings) in module", errors_errors[230], 39); - __MOVE("too many link table entries (external procedures)", errors_errors[231], 50); - __MOVE("too many commands in module", errors_errors[232], 28); - __MOVE("record extension hierarchy too high", errors_errors[233], 36); - __MOVE("export of recursive type not allowed", errors_errors[234], 37); - __MOVE("identifier too long", errors_errors[240], 20); - __MOVE("string too long", errors_errors[241], 16); - __MOVE("address overflow", errors_errors[242], 17); - __MOVE("cyclic type definition not allowed", errors_errors[244], 35); - __MOVE("guarded pointer variable may be manipulated by non-local operations; use auxiliary pointer variable", errors_errors[245], 100); - __MOVE("implicit type cast", errors_errors[301], 19); - __MOVE("inappropriate symbol file ignored", errors_errors[306], 34); - __MOVE("no ELSE symbol after CASE statement sequence may lead to trap", errors_errors[307], 62); - __MOVE("SYSTEM.VAL result includes memory past end of source variable", errors_errors[308], 62); - __ENDMOD; -} diff --git a/bootstrap/unix-48/errors.h b/bootstrap/unix-48/errors.h deleted file mode 100644 index 1a983a0c..00000000 --- a/bootstrap/unix-48/errors.h +++ /dev/null @@ -1,18 +0,0 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ - -#ifndef errors__h -#define errors__h - -#include "SYSTEM.h" - -typedef - CHAR errors_string[128]; - - -import errors_string errors_errors[350]; - - -import void *errors__init(void); - - -#endif // errors diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index 4e78eeda..40f3ddee 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/14]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index e7be8295..8432576a 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -55,9 +55,8 @@ export void Modules_Halt (INT32 code); export Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len); export Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len); static void Modules_errch (CHAR c); -export void Modules_errint (INT32 l); -static void Modules_errposint (INT32 l); -export void Modules_errstring (CHAR *s, LONGINT s__len); +static void Modules_errint (INT32 l); +static void Modules_errstring (CHAR *s, LONGINT s__len); #define Modules_modules() (Modules_Module)Heap_modules #define Modules_setmodules(m) Heap_modules = m @@ -169,7 +168,7 @@ static void Modules_errch (CHAR c) e = Platform_Write(1, (ADDRESS)&c, 1); } -void Modules_errstring (CHAR *s, LONGINT s__len) +static void Modules_errstring (CHAR *s, LONGINT s__len) { INT32 i; __DUP(s, s__len, CHAR); @@ -181,21 +180,16 @@ void Modules_errstring (CHAR *s, LONGINT s__len) __DEL(s); } -static void Modules_errposint (INT32 l) -{ - if (l > 10) { - Modules_errposint(__DIV(l, 10)); - } - Modules_errch((CHAR)(48 + (int)__MOD(l, 10))); -} - -void Modules_errint (INT32 l) +static void Modules_errint (INT32 l) { if (l < 0) { Modules_errch('-'); l = -l; } - Modules_errposint(l); + if (l >= 10) { + Modules_errint(__DIV(l, 10)); + } + Modules_errch((CHAR)((int)__MOD(l, 10) + 48)); } static void Modules_DisplayHaltCode (INT32 code) diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index 7c2a221a..66c0c947 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -48,11 +48,7 @@ import void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all); import void Modules_Halt (INT32 code); import Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len); import Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len); -import void Modules_errint (INT32 l); -import void Modules_errstring (CHAR *s, LONGINT s__len); import void *Modules__init(void); -#define Modules_modules() (Modules_Module)Heap_modules -#define Modules_setmodules(m) Heap_modules = m #endif // Modules diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index aace2669..5f5d6792 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -13,7 +13,6 @@ #include "Strings.h" #include "Texts.h" #include "VT100.h" -#include "errors.h" typedef CHAR OPM_FileName[32]; @@ -37,7 +36,7 @@ export CHAR OPM_modName[32]; export CHAR OPM_objname[64]; static INT32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; static Texts_Reader OPM_inR; -static Texts_Text OPM_Log; +static Texts_Text OPM_Log, OPM_Errors; static Files_Rider OPM_oldSF, OPM_newSF; static Files_Rider OPM_R[3]; static Files_File OPM_oldSFile, OPM_newSFile, OPM_HFile, OPM_BFile, OPM_HIFile; @@ -536,11 +535,9 @@ static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGIN static void OPM_LogErrMsg (INT16 n) { + INT16 l; Texts_Scanner S; - Texts_Text T = NIL; - CHAR ch; - INT16 i; - CHAR buf[1024]; + CHAR c; if (n >= 0) { if (!__IN(16, OPM_Options, 32)) { VT100_SetAttr((CHAR*)"31m", 4); @@ -561,7 +558,22 @@ static void OPM_LogErrMsg (INT16 n) } OPM_LogWNum(n, 1); OPM_LogWStr((CHAR*)" ", 3); - OPM_LogWStr(errors_errors[__X(n, 350)], 128); + if (OPM_Errors == NIL) { + __NEW(OPM_Errors, Texts_TextDesc); + Texts_Open(OPM_Errors, (CHAR*)"Errors.Txt", 11); + } + Texts_OpenScanner(&S, Texts_Scanner__typ, OPM_Errors, 0); + do { + l = S.line; + Texts_Scan(&S, Texts_Scanner__typ); + } while (!((((l != S.line && S.class == 3)) && S.i == n) || S.eot)); + if (!S.eot) { + Texts_Read((void*)&S, Texts_Scanner__typ, &c); + while ((!S.eot && c >= ' ')) { + Out_Char(c); + Texts_Read((void*)&S, Texts_Scanner__typ, &c); + } + } } static void OPM_FindLine (Files_File f, Files_Rider *r, ADDRESS *r__typ, INT64 pos) @@ -1043,6 +1055,7 @@ static void EnumPtrs(void (*P)(void*)) { __ENUMR(&OPM_inR, Texts_Reader__typ, 72, 1, P); P(OPM_Log); + P(OPM_Errors); __ENUMR(&OPM_oldSF, Files_Rider__typ, 24, 1, P); __ENUMR(&OPM_newSF, Files_Rider__typ, 24, 1, P); __ENUMR(OPM_R, Files_Rider__typ, 24, 3, P); @@ -1064,7 +1077,6 @@ export void *OPM__init(void) __MODULE_IMPORT(Strings); __MODULE_IMPORT(Texts); __MODULE_IMPORT(VT100); - __MODULE_IMPORT(errors); __REGMOD("OPM", EnumPtrs); __REGCMD("CloseFiles", OPM_CloseFiles); __REGCMD("CloseOldSym", OPM_CloseOldSym); diff --git a/bootstrap/unix-88/errors.c b/bootstrap/unix-88/errors.c deleted file mode 100644 index 64af94f5..00000000 --- a/bootstrap/unix-88/errors.c +++ /dev/null @@ -1,205 +0,0 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ - -#define SHORTINT INT8 -#define INTEGER INT16 -#define LONGINT INT32 -#define SET UINT32 - -#include "SYSTEM.h" - -typedef - CHAR errors_string[128]; - - -export errors_string errors_errors[350]; - - - - - -export void *errors__init(void) -{ - __DEFMOD; - __REGMOD("errors", 0); -/* BEGIN */ - __MOVE("undeclared identifier", errors_errors[0], 22); - __MOVE("multiply defined identifier", errors_errors[1], 28); - __MOVE("illegal character in number", errors_errors[2], 28); - __MOVE("illegal character in string", errors_errors[3], 28); - __MOVE("identifier does not match procedure name", errors_errors[4], 41); - __MOVE("comment not closed", errors_errors[5], 19); - errors_errors[6][0] = 0x00; - errors_errors[7][0] = 0x00; - errors_errors[8][0] = 0x00; - __MOVE("'=' expected", errors_errors[9], 13); - errors_errors[10][0] = 0x00; - errors_errors[11][0] = 0x00; - __MOVE("type definition starts with incorrect symbol", errors_errors[12], 45); - __MOVE("factor starts with incorrect symbol", errors_errors[13], 36); - __MOVE("statement starts with incorrect symbol", errors_errors[14], 39); - __MOVE("declaration followed by incorrect symbol", errors_errors[15], 41); - __MOVE("MODULE expected", errors_errors[16], 16); - errors_errors[17][0] = 0x00; - __MOVE("'.' missing", errors_errors[18], 12); - __MOVE("',' missing", errors_errors[19], 12); - __MOVE("':' missing", errors_errors[20], 12); - errors_errors[21][0] = 0x00; - __MOVE("')' missing", errors_errors[22], 12); - __MOVE("']' missing", errors_errors[23], 12); - __MOVE("'}' missing", errors_errors[24], 12); - __MOVE("OF missing", errors_errors[25], 11); - __MOVE("THEN missing", errors_errors[26], 13); - __MOVE("DO missing", errors_errors[27], 11); - __MOVE("TO missing", errors_errors[28], 11); - errors_errors[29][0] = 0x00; - __MOVE("'(' missing", errors_errors[30], 12); - errors_errors[31][0] = 0x00; - errors_errors[32][0] = 0x00; - errors_errors[33][0] = 0x00; - __MOVE("':=' missing", errors_errors[34], 13); - __MOVE("',' or OF expected", errors_errors[35], 19); - errors_errors[36][0] = 0x00; - errors_errors[37][0] = 0x00; - __MOVE("identifier expected", errors_errors[38], 20); - __MOVE("';' missing", errors_errors[39], 12); - errors_errors[40][0] = 0x00; - __MOVE("END missing", errors_errors[41], 12); - errors_errors[42][0] = 0x00; - errors_errors[43][0] = 0x00; - __MOVE("UNTIL missing", errors_errors[44], 14); - errors_errors[45][0] = 0x00; - __MOVE("EXIT not within loop statement", errors_errors[46], 31); - __MOVE("illegally marked identifier", errors_errors[47], 28); - errors_errors[48][0] = 0x00; - errors_errors[49][0] = 0x00; - __MOVE("expression should be constant", errors_errors[50], 30); - __MOVE("constant not an integer", errors_errors[51], 24); - __MOVE("identifier does not denote a type", errors_errors[52], 34); - __MOVE("identifier does not denote a record type", errors_errors[53], 41); - __MOVE("result type of procedure is not a basic type", errors_errors[54], 45); - __MOVE("procedure call of a function", errors_errors[55], 29); - __MOVE("assignment to non-variable", errors_errors[56], 27); - __MOVE("pointer not bound to record or array type", errors_errors[57], 42); - __MOVE("recursive type definition", errors_errors[58], 26); - __MOVE("illegal open array parameter", errors_errors[59], 29); - __MOVE("wrong type of case label", errors_errors[60], 25); - __MOVE("inadmissible type of case label", errors_errors[61], 32); - __MOVE("case label defined more than once", errors_errors[62], 34); - __MOVE("illegal value of constant", errors_errors[63], 26); - __MOVE("more actual than formal parameters", errors_errors[64], 35); - __MOVE("fewer actual than formal parameters", errors_errors[65], 36); - __MOVE("element types of actual array and formal open array differ", errors_errors[66], 59); - __MOVE("actual parameter corresponding to open array is not an array", errors_errors[67], 61); - __MOVE("control variable must be integer", errors_errors[68], 33); - __MOVE("parameter must be an integer constant", errors_errors[69], 38); - __MOVE("pointer or VAR record required as formal receiver", errors_errors[70], 50); - __MOVE("pointer expected as actual receiver", errors_errors[71], 36); - __MOVE("procedure must be bound to a record of the same scope", errors_errors[72], 54); - __MOVE("procedure must have level 0", errors_errors[73], 28); - __MOVE("procedure unknown in base type", errors_errors[74], 31); - __MOVE("invalid call of base procedure", errors_errors[75], 31); - __MOVE("this variable (field) is read only", errors_errors[76], 35); - __MOVE("object is not a record", errors_errors[77], 23); - __MOVE("dereferenced object is not a variable", errors_errors[78], 38); - __MOVE("indexed object is not a variable", errors_errors[79], 33); - __MOVE("index expression is not an integer", errors_errors[80], 35); - __MOVE("index out of specified bounds", errors_errors[81], 30); - __MOVE("indexed variable is not an array", errors_errors[82], 33); - __MOVE("undefined record field", errors_errors[83], 23); - __MOVE("dereferenced variable is not a pointer", errors_errors[84], 39); - __MOVE("guard or test type is not an extension of variable type", errors_errors[85], 56); - __MOVE("guard or testtype is not a pointer", errors_errors[86], 35); - __MOVE("guarded or tested variable is neither a pointer nor a VAR-parameter record", errors_errors[87], 75); - __MOVE("open array not allowed as variable, record field or array element", errors_errors[88], 66); - errors_errors[89][0] = 0x00; - errors_errors[90][0] = 0x00; - errors_errors[91][0] = 0x00; - __MOVE("operand of IN not an integer, or not a set", errors_errors[92], 43); - __MOVE("set element type is not an integer", errors_errors[93], 35); - __MOVE("operand of & is not of type BOOLEAN", errors_errors[94], 36); - __MOVE("operand of OR is not of type BOOLEAN", errors_errors[95], 37); - __MOVE("operand not applicable to (unary) +", errors_errors[96], 36); - __MOVE("operand not applicable to (unary) -", errors_errors[97], 36); - __MOVE("operand of ~ is not of type BOOLEAN", errors_errors[98], 36); - __MOVE("ASSERT fault", errors_errors[99], 13); - __MOVE("incompatible operands of dyadic operator", errors_errors[100], 41); - __MOVE("operand type inapplicable to *", errors_errors[101], 31); - __MOVE("operand type inapplicable to /", errors_errors[102], 31); - __MOVE("operand type inapplicable to DIV", errors_errors[103], 33); - __MOVE("operand type inapplicable to MOD", errors_errors[104], 33); - __MOVE("operand type inapplicable to +", errors_errors[105], 31); - __MOVE("operand type inapplicable to -", errors_errors[106], 31); - __MOVE("operand type inapplicable to = or #", errors_errors[107], 36); - __MOVE("operand type inapplicable to relation", errors_errors[108], 38); - __MOVE("overriding method must be exported", errors_errors[109], 35); - __MOVE("operand is not a type", errors_errors[110], 22); - __MOVE("operand inapplicable to (this) function", errors_errors[111], 40); - __MOVE("operand is not a variable", errors_errors[112], 26); - __MOVE("incompatible assignment", errors_errors[113], 24); - __MOVE("string too long to be assigned", errors_errors[114], 31); - __MOVE("parameter doesn't match", errors_errors[115], 24); - __MOVE("number of parameters doesn't match", errors_errors[116], 35); - __MOVE("result type doesn't match", errors_errors[117], 26); - __MOVE("export mark doesn't match with forward declaration", errors_errors[118], 51); - __MOVE("redefinition textually precedes procedure bound to base type", errors_errors[119], 61); - __MOVE("type of expression following IF, WHILE, UNTIL or ASSERT is not BOOLEAN", errors_errors[120], 71); - __MOVE("called object is not a procedure (or is an interrupt procedure)", errors_errors[121], 64); - __MOVE("actual VAR-parameter is not a variable", errors_errors[122], 39); - __MOVE("type of actual parameter is not identical with that of formal VAR-parameter", errors_errors[123], 76); - __MOVE("type of result expression differs from that of procedure", errors_errors[124], 57); - __MOVE("type of case expression is neither INTEGER nor CHAR", errors_errors[125], 52); - __MOVE("this expression cannot be a type or a procedure", errors_errors[126], 48); - __MOVE("illegal use of object", errors_errors[127], 22); - __MOVE("unsatisfied forward reference", errors_errors[128], 30); - __MOVE("unsatisfied forward procedure", errors_errors[129], 30); - __MOVE("WITH clause does not specify a variable", errors_errors[130], 40); - __MOVE("LEN not applied to array", errors_errors[131], 25); - __MOVE("dimension in LEN too large or negative", errors_errors[132], 39); - __MOVE("SYSTEM not imported", errors_errors[135], 20); - __MOVE("key inconsistency of imported module", errors_errors[150], 37); - __MOVE("incorrect symbol file", errors_errors[151], 22); - __MOVE("symbol file of imported module not found", errors_errors[152], 41); - __MOVE("object or symbol file not opened (disk full\?)", errors_errors[153], 46); - __MOVE("recursive import not allowed", errors_errors[154], 29); - __MOVE("generation of new symbol file not allowed", errors_errors[155], 42); - __MOVE("parameter file not found", errors_errors[156], 25); - __MOVE("syntax error in parameter file", errors_errors[157], 31); - __MOVE("not yet implemented", errors_errors[200], 20); - __MOVE("lower bound of set range greater than higher bound", errors_errors[201], 51); - __MOVE("set element greater than MAX(SET) or less than 0", errors_errors[202], 49); - __MOVE("number too large", errors_errors[203], 17); - __MOVE("product too large", errors_errors[204], 18); - __MOVE("division by zero", errors_errors[205], 17); - __MOVE("sum too large", errors_errors[206], 14); - __MOVE("difference too large", errors_errors[207], 21); - __MOVE("overflow in arithmetic shift", errors_errors[208], 29); - __MOVE("case range too large", errors_errors[209], 21); - __MOVE("too many cases in case statement", errors_errors[213], 33); - __MOVE("illegal value of parameter (0 <= p < 256)", errors_errors[218], 42); - __MOVE("machine registers cannot be accessed", errors_errors[219], 37); - __MOVE("illegal value of parameter", errors_errors[220], 27); - __MOVE("too many pointers in a record", errors_errors[221], 30); - __MOVE("too many global pointers", errors_errors[222], 25); - __MOVE("too many record types", errors_errors[223], 22); - __MOVE("too many pointer types", errors_errors[224], 23); - __MOVE("address of pointer variable too large (move forward in text)", errors_errors[225], 61); - __MOVE("too many exported procedures", errors_errors[226], 29); - __MOVE("too many imported modules", errors_errors[227], 26); - __MOVE("too many exported structures", errors_errors[228], 29); - __MOVE("too many nested records for import", errors_errors[229], 35); - __MOVE("too many constants (strings) in module", errors_errors[230], 39); - __MOVE("too many link table entries (external procedures)", errors_errors[231], 50); - __MOVE("too many commands in module", errors_errors[232], 28); - __MOVE("record extension hierarchy too high", errors_errors[233], 36); - __MOVE("export of recursive type not allowed", errors_errors[234], 37); - __MOVE("identifier too long", errors_errors[240], 20); - __MOVE("string too long", errors_errors[241], 16); - __MOVE("address overflow", errors_errors[242], 17); - __MOVE("cyclic type definition not allowed", errors_errors[244], 35); - __MOVE("guarded pointer variable may be manipulated by non-local operations; use auxiliary pointer variable", errors_errors[245], 100); - __MOVE("implicit type cast", errors_errors[301], 19); - __MOVE("inappropriate symbol file ignored", errors_errors[306], 34); - __MOVE("no ELSE symbol after CASE statement sequence may lead to trap", errors_errors[307], 62); - __MOVE("SYSTEM.VAL result includes memory past end of source variable", errors_errors[308], 62); - __ENDMOD; -} diff --git a/bootstrap/unix-88/errors.h b/bootstrap/unix-88/errors.h deleted file mode 100644 index 1a983a0c..00000000 --- a/bootstrap/unix-88/errors.h +++ /dev/null @@ -1,18 +0,0 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ - -#ifndef errors__h -#define errors__h - -#include "SYSTEM.h" - -typedef - CHAR errors_string[128]; - - -import errors_string errors_errors[350]; - - -import void *errors__init(void); - - -#endif // errors diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index 4e78eeda..40f3ddee 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/14]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index 34a1723e..5fb74ad0 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -55,9 +55,8 @@ export void Modules_Halt (INT32 code); export Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len); export Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len); static void Modules_errch (CHAR c); -export void Modules_errint (INT32 l); -static void Modules_errposint (INT32 l); -export void Modules_errstring (CHAR *s, LONGINT s__len); +static void Modules_errint (INT32 l); +static void Modules_errstring (CHAR *s, LONGINT s__len); #define Modules_modules() (Modules_Module)Heap_modules #define Modules_setmodules(m) Heap_modules = m @@ -169,7 +168,7 @@ static void Modules_errch (CHAR c) e = Platform_Write(1, (ADDRESS)&c, 1); } -void Modules_errstring (CHAR *s, LONGINT s__len) +static void Modules_errstring (CHAR *s, LONGINT s__len) { INT32 i; __DUP(s, s__len, CHAR); @@ -181,21 +180,16 @@ void Modules_errstring (CHAR *s, LONGINT s__len) __DEL(s); } -static void Modules_errposint (INT32 l) -{ - if (l > 10) { - Modules_errposint(__DIV(l, 10)); - } - Modules_errch((CHAR)(48 + (int)__MOD(l, 10))); -} - -void Modules_errint (INT32 l) +static void Modules_errint (INT32 l) { if (l < 0) { Modules_errch('-'); l = -l; } - Modules_errposint(l); + if (l >= 10) { + Modules_errint(__DIV(l, 10)); + } + Modules_errch((CHAR)((int)__MOD(l, 10) + 48)); } static void Modules_DisplayHaltCode (INT32 code) diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index 7c2a221a..66c0c947 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -48,11 +48,7 @@ import void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all); import void Modules_Halt (INT32 code); import Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len); import Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len); -import void Modules_errint (INT32 l); -import void Modules_errstring (CHAR *s, LONGINT s__len); import void *Modules__init(void); -#define Modules_modules() (Modules_Module)Heap_modules -#define Modules_setmodules(m) Heap_modules = m #endif // Modules diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index f52f655a..a5afb71e 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -13,7 +13,6 @@ #include "Strings.h" #include "Texts.h" #include "VT100.h" -#include "errors.h" typedef CHAR OPM_FileName[32]; @@ -37,7 +36,7 @@ export CHAR OPM_modName[32]; export CHAR OPM_objname[64]; static INT32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; static Texts_Reader OPM_inR; -static Texts_Text OPM_Log; +static Texts_Text OPM_Log, OPM_Errors; static Files_Rider OPM_oldSF, OPM_newSF; static Files_Rider OPM_R[3]; static Files_File OPM_oldSFile, OPM_newSFile, OPM_HFile, OPM_BFile, OPM_HIFile; @@ -536,11 +535,9 @@ static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGIN static void OPM_LogErrMsg (INT16 n) { + INT16 l; Texts_Scanner S; - Texts_Text T = NIL; - CHAR ch; - INT16 i; - CHAR buf[1024]; + CHAR c; if (n >= 0) { if (!__IN(16, OPM_Options, 32)) { VT100_SetAttr((CHAR*)"31m", 4); @@ -561,7 +558,22 @@ static void OPM_LogErrMsg (INT16 n) } OPM_LogWNum(n, 1); OPM_LogWStr((CHAR*)" ", 3); - OPM_LogWStr(errors_errors[__X(n, 350)], 128); + if (OPM_Errors == NIL) { + __NEW(OPM_Errors, Texts_TextDesc); + Texts_Open(OPM_Errors, (CHAR*)"Errors.Txt", 11); + } + Texts_OpenScanner(&S, Texts_Scanner__typ, OPM_Errors, 0); + do { + l = S.line; + Texts_Scan(&S, Texts_Scanner__typ); + } while (!((((l != S.line && S.class == 3)) && S.i == n) || S.eot)); + if (!S.eot) { + Texts_Read((void*)&S, Texts_Scanner__typ, &c); + while ((!S.eot && c >= ' ')) { + Out_Char(c); + Texts_Read((void*)&S, Texts_Scanner__typ, &c); + } + } } static void OPM_FindLine (Files_File f, Files_Rider *r, ADDRESS *r__typ, INT64 pos) @@ -1043,6 +1055,7 @@ static void EnumPtrs(void (*P)(void*)) { __ENUMR(&OPM_inR, Texts_Reader__typ, 48, 1, P); P(OPM_Log); + P(OPM_Errors); __ENUMR(&OPM_oldSF, Files_Rider__typ, 20, 1, P); __ENUMR(&OPM_newSF, Files_Rider__typ, 20, 1, P); __ENUMR(OPM_R, Files_Rider__typ, 20, 3, P); @@ -1064,7 +1077,6 @@ export void *OPM__init(void) __MODULE_IMPORT(Strings); __MODULE_IMPORT(Texts); __MODULE_IMPORT(VT100); - __MODULE_IMPORT(errors); __REGMOD("OPM", EnumPtrs); __REGCMD("CloseFiles", OPM_CloseFiles); __REGCMD("CloseOldSym", OPM_CloseOldSym); diff --git a/bootstrap/windows-48/errors.c b/bootstrap/windows-48/errors.c deleted file mode 100644 index 64af94f5..00000000 --- a/bootstrap/windows-48/errors.c +++ /dev/null @@ -1,205 +0,0 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ - -#define SHORTINT INT8 -#define INTEGER INT16 -#define LONGINT INT32 -#define SET UINT32 - -#include "SYSTEM.h" - -typedef - CHAR errors_string[128]; - - -export errors_string errors_errors[350]; - - - - - -export void *errors__init(void) -{ - __DEFMOD; - __REGMOD("errors", 0); -/* BEGIN */ - __MOVE("undeclared identifier", errors_errors[0], 22); - __MOVE("multiply defined identifier", errors_errors[1], 28); - __MOVE("illegal character in number", errors_errors[2], 28); - __MOVE("illegal character in string", errors_errors[3], 28); - __MOVE("identifier does not match procedure name", errors_errors[4], 41); - __MOVE("comment not closed", errors_errors[5], 19); - errors_errors[6][0] = 0x00; - errors_errors[7][0] = 0x00; - errors_errors[8][0] = 0x00; - __MOVE("'=' expected", errors_errors[9], 13); - errors_errors[10][0] = 0x00; - errors_errors[11][0] = 0x00; - __MOVE("type definition starts with incorrect symbol", errors_errors[12], 45); - __MOVE("factor starts with incorrect symbol", errors_errors[13], 36); - __MOVE("statement starts with incorrect symbol", errors_errors[14], 39); - __MOVE("declaration followed by incorrect symbol", errors_errors[15], 41); - __MOVE("MODULE expected", errors_errors[16], 16); - errors_errors[17][0] = 0x00; - __MOVE("'.' missing", errors_errors[18], 12); - __MOVE("',' missing", errors_errors[19], 12); - __MOVE("':' missing", errors_errors[20], 12); - errors_errors[21][0] = 0x00; - __MOVE("')' missing", errors_errors[22], 12); - __MOVE("']' missing", errors_errors[23], 12); - __MOVE("'}' missing", errors_errors[24], 12); - __MOVE("OF missing", errors_errors[25], 11); - __MOVE("THEN missing", errors_errors[26], 13); - __MOVE("DO missing", errors_errors[27], 11); - __MOVE("TO missing", errors_errors[28], 11); - errors_errors[29][0] = 0x00; - __MOVE("'(' missing", errors_errors[30], 12); - errors_errors[31][0] = 0x00; - errors_errors[32][0] = 0x00; - errors_errors[33][0] = 0x00; - __MOVE("':=' missing", errors_errors[34], 13); - __MOVE("',' or OF expected", errors_errors[35], 19); - errors_errors[36][0] = 0x00; - errors_errors[37][0] = 0x00; - __MOVE("identifier expected", errors_errors[38], 20); - __MOVE("';' missing", errors_errors[39], 12); - errors_errors[40][0] = 0x00; - __MOVE("END missing", errors_errors[41], 12); - errors_errors[42][0] = 0x00; - errors_errors[43][0] = 0x00; - __MOVE("UNTIL missing", errors_errors[44], 14); - errors_errors[45][0] = 0x00; - __MOVE("EXIT not within loop statement", errors_errors[46], 31); - __MOVE("illegally marked identifier", errors_errors[47], 28); - errors_errors[48][0] = 0x00; - errors_errors[49][0] = 0x00; - __MOVE("expression should be constant", errors_errors[50], 30); - __MOVE("constant not an integer", errors_errors[51], 24); - __MOVE("identifier does not denote a type", errors_errors[52], 34); - __MOVE("identifier does not denote a record type", errors_errors[53], 41); - __MOVE("result type of procedure is not a basic type", errors_errors[54], 45); - __MOVE("procedure call of a function", errors_errors[55], 29); - __MOVE("assignment to non-variable", errors_errors[56], 27); - __MOVE("pointer not bound to record or array type", errors_errors[57], 42); - __MOVE("recursive type definition", errors_errors[58], 26); - __MOVE("illegal open array parameter", errors_errors[59], 29); - __MOVE("wrong type of case label", errors_errors[60], 25); - __MOVE("inadmissible type of case label", errors_errors[61], 32); - __MOVE("case label defined more than once", errors_errors[62], 34); - __MOVE("illegal value of constant", errors_errors[63], 26); - __MOVE("more actual than formal parameters", errors_errors[64], 35); - __MOVE("fewer actual than formal parameters", errors_errors[65], 36); - __MOVE("element types of actual array and formal open array differ", errors_errors[66], 59); - __MOVE("actual parameter corresponding to open array is not an array", errors_errors[67], 61); - __MOVE("control variable must be integer", errors_errors[68], 33); - __MOVE("parameter must be an integer constant", errors_errors[69], 38); - __MOVE("pointer or VAR record required as formal receiver", errors_errors[70], 50); - __MOVE("pointer expected as actual receiver", errors_errors[71], 36); - __MOVE("procedure must be bound to a record of the same scope", errors_errors[72], 54); - __MOVE("procedure must have level 0", errors_errors[73], 28); - __MOVE("procedure unknown in base type", errors_errors[74], 31); - __MOVE("invalid call of base procedure", errors_errors[75], 31); - __MOVE("this variable (field) is read only", errors_errors[76], 35); - __MOVE("object is not a record", errors_errors[77], 23); - __MOVE("dereferenced object is not a variable", errors_errors[78], 38); - __MOVE("indexed object is not a variable", errors_errors[79], 33); - __MOVE("index expression is not an integer", errors_errors[80], 35); - __MOVE("index out of specified bounds", errors_errors[81], 30); - __MOVE("indexed variable is not an array", errors_errors[82], 33); - __MOVE("undefined record field", errors_errors[83], 23); - __MOVE("dereferenced variable is not a pointer", errors_errors[84], 39); - __MOVE("guard or test type is not an extension of variable type", errors_errors[85], 56); - __MOVE("guard or testtype is not a pointer", errors_errors[86], 35); - __MOVE("guarded or tested variable is neither a pointer nor a VAR-parameter record", errors_errors[87], 75); - __MOVE("open array not allowed as variable, record field or array element", errors_errors[88], 66); - errors_errors[89][0] = 0x00; - errors_errors[90][0] = 0x00; - errors_errors[91][0] = 0x00; - __MOVE("operand of IN not an integer, or not a set", errors_errors[92], 43); - __MOVE("set element type is not an integer", errors_errors[93], 35); - __MOVE("operand of & is not of type BOOLEAN", errors_errors[94], 36); - __MOVE("operand of OR is not of type BOOLEAN", errors_errors[95], 37); - __MOVE("operand not applicable to (unary) +", errors_errors[96], 36); - __MOVE("operand not applicable to (unary) -", errors_errors[97], 36); - __MOVE("operand of ~ is not of type BOOLEAN", errors_errors[98], 36); - __MOVE("ASSERT fault", errors_errors[99], 13); - __MOVE("incompatible operands of dyadic operator", errors_errors[100], 41); - __MOVE("operand type inapplicable to *", errors_errors[101], 31); - __MOVE("operand type inapplicable to /", errors_errors[102], 31); - __MOVE("operand type inapplicable to DIV", errors_errors[103], 33); - __MOVE("operand type inapplicable to MOD", errors_errors[104], 33); - __MOVE("operand type inapplicable to +", errors_errors[105], 31); - __MOVE("operand type inapplicable to -", errors_errors[106], 31); - __MOVE("operand type inapplicable to = or #", errors_errors[107], 36); - __MOVE("operand type inapplicable to relation", errors_errors[108], 38); - __MOVE("overriding method must be exported", errors_errors[109], 35); - __MOVE("operand is not a type", errors_errors[110], 22); - __MOVE("operand inapplicable to (this) function", errors_errors[111], 40); - __MOVE("operand is not a variable", errors_errors[112], 26); - __MOVE("incompatible assignment", errors_errors[113], 24); - __MOVE("string too long to be assigned", errors_errors[114], 31); - __MOVE("parameter doesn't match", errors_errors[115], 24); - __MOVE("number of parameters doesn't match", errors_errors[116], 35); - __MOVE("result type doesn't match", errors_errors[117], 26); - __MOVE("export mark doesn't match with forward declaration", errors_errors[118], 51); - __MOVE("redefinition textually precedes procedure bound to base type", errors_errors[119], 61); - __MOVE("type of expression following IF, WHILE, UNTIL or ASSERT is not BOOLEAN", errors_errors[120], 71); - __MOVE("called object is not a procedure (or is an interrupt procedure)", errors_errors[121], 64); - __MOVE("actual VAR-parameter is not a variable", errors_errors[122], 39); - __MOVE("type of actual parameter is not identical with that of formal VAR-parameter", errors_errors[123], 76); - __MOVE("type of result expression differs from that of procedure", errors_errors[124], 57); - __MOVE("type of case expression is neither INTEGER nor CHAR", errors_errors[125], 52); - __MOVE("this expression cannot be a type or a procedure", errors_errors[126], 48); - __MOVE("illegal use of object", errors_errors[127], 22); - __MOVE("unsatisfied forward reference", errors_errors[128], 30); - __MOVE("unsatisfied forward procedure", errors_errors[129], 30); - __MOVE("WITH clause does not specify a variable", errors_errors[130], 40); - __MOVE("LEN not applied to array", errors_errors[131], 25); - __MOVE("dimension in LEN too large or negative", errors_errors[132], 39); - __MOVE("SYSTEM not imported", errors_errors[135], 20); - __MOVE("key inconsistency of imported module", errors_errors[150], 37); - __MOVE("incorrect symbol file", errors_errors[151], 22); - __MOVE("symbol file of imported module not found", errors_errors[152], 41); - __MOVE("object or symbol file not opened (disk full\?)", errors_errors[153], 46); - __MOVE("recursive import not allowed", errors_errors[154], 29); - __MOVE("generation of new symbol file not allowed", errors_errors[155], 42); - __MOVE("parameter file not found", errors_errors[156], 25); - __MOVE("syntax error in parameter file", errors_errors[157], 31); - __MOVE("not yet implemented", errors_errors[200], 20); - __MOVE("lower bound of set range greater than higher bound", errors_errors[201], 51); - __MOVE("set element greater than MAX(SET) or less than 0", errors_errors[202], 49); - __MOVE("number too large", errors_errors[203], 17); - __MOVE("product too large", errors_errors[204], 18); - __MOVE("division by zero", errors_errors[205], 17); - __MOVE("sum too large", errors_errors[206], 14); - __MOVE("difference too large", errors_errors[207], 21); - __MOVE("overflow in arithmetic shift", errors_errors[208], 29); - __MOVE("case range too large", errors_errors[209], 21); - __MOVE("too many cases in case statement", errors_errors[213], 33); - __MOVE("illegal value of parameter (0 <= p < 256)", errors_errors[218], 42); - __MOVE("machine registers cannot be accessed", errors_errors[219], 37); - __MOVE("illegal value of parameter", errors_errors[220], 27); - __MOVE("too many pointers in a record", errors_errors[221], 30); - __MOVE("too many global pointers", errors_errors[222], 25); - __MOVE("too many record types", errors_errors[223], 22); - __MOVE("too many pointer types", errors_errors[224], 23); - __MOVE("address of pointer variable too large (move forward in text)", errors_errors[225], 61); - __MOVE("too many exported procedures", errors_errors[226], 29); - __MOVE("too many imported modules", errors_errors[227], 26); - __MOVE("too many exported structures", errors_errors[228], 29); - __MOVE("too many nested records for import", errors_errors[229], 35); - __MOVE("too many constants (strings) in module", errors_errors[230], 39); - __MOVE("too many link table entries (external procedures)", errors_errors[231], 50); - __MOVE("too many commands in module", errors_errors[232], 28); - __MOVE("record extension hierarchy too high", errors_errors[233], 36); - __MOVE("export of recursive type not allowed", errors_errors[234], 37); - __MOVE("identifier too long", errors_errors[240], 20); - __MOVE("string too long", errors_errors[241], 16); - __MOVE("address overflow", errors_errors[242], 17); - __MOVE("cyclic type definition not allowed", errors_errors[244], 35); - __MOVE("guarded pointer variable may be manipulated by non-local operations; use auxiliary pointer variable", errors_errors[245], 100); - __MOVE("implicit type cast", errors_errors[301], 19); - __MOVE("inappropriate symbol file ignored", errors_errors[306], 34); - __MOVE("no ELSE symbol after CASE statement sequence may lead to trap", errors_errors[307], 62); - __MOVE("SYSTEM.VAL result includes memory past end of source variable", errors_errors[308], 62); - __ENDMOD; -} diff --git a/bootstrap/windows-48/errors.h b/bootstrap/windows-48/errors.h deleted file mode 100644 index 1a983a0c..00000000 --- a/bootstrap/windows-48/errors.h +++ /dev/null @@ -1,18 +0,0 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ - -#ifndef errors__h -#define errors__h - -#include "SYSTEM.h" - -typedef - CHAR errors_string[128]; - - -import errors_string errors_errors[350]; - - -import void *errors__init(void); - - -#endif // errors diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index 4e78eeda..40f3ddee 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/14]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index e7be8295..8432576a 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -55,9 +55,8 @@ export void Modules_Halt (INT32 code); export Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len); export Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len); static void Modules_errch (CHAR c); -export void Modules_errint (INT32 l); -static void Modules_errposint (INT32 l); -export void Modules_errstring (CHAR *s, LONGINT s__len); +static void Modules_errint (INT32 l); +static void Modules_errstring (CHAR *s, LONGINT s__len); #define Modules_modules() (Modules_Module)Heap_modules #define Modules_setmodules(m) Heap_modules = m @@ -169,7 +168,7 @@ static void Modules_errch (CHAR c) e = Platform_Write(1, (ADDRESS)&c, 1); } -void Modules_errstring (CHAR *s, LONGINT s__len) +static void Modules_errstring (CHAR *s, LONGINT s__len) { INT32 i; __DUP(s, s__len, CHAR); @@ -181,21 +180,16 @@ void Modules_errstring (CHAR *s, LONGINT s__len) __DEL(s); } -static void Modules_errposint (INT32 l) -{ - if (l > 10) { - Modules_errposint(__DIV(l, 10)); - } - Modules_errch((CHAR)(48 + (int)__MOD(l, 10))); -} - -void Modules_errint (INT32 l) +static void Modules_errint (INT32 l) { if (l < 0) { Modules_errch('-'); l = -l; } - Modules_errposint(l); + if (l >= 10) { + Modules_errint(__DIV(l, 10)); + } + Modules_errch((CHAR)((int)__MOD(l, 10) + 48)); } static void Modules_DisplayHaltCode (INT32 code) diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index 7c2a221a..66c0c947 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -48,11 +48,7 @@ import void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all); import void Modules_Halt (INT32 code); import Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len); import Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len); -import void Modules_errint (INT32 l); -import void Modules_errstring (CHAR *s, LONGINT s__len); import void *Modules__init(void); -#define Modules_modules() (Modules_Module)Heap_modules -#define Modules_setmodules(m) Heap_modules = m #endif // Modules diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index aace2669..5f5d6792 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -13,7 +13,6 @@ #include "Strings.h" #include "Texts.h" #include "VT100.h" -#include "errors.h" typedef CHAR OPM_FileName[32]; @@ -37,7 +36,7 @@ export CHAR OPM_modName[32]; export CHAR OPM_objname[64]; static INT32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; static Texts_Reader OPM_inR; -static Texts_Text OPM_Log; +static Texts_Text OPM_Log, OPM_Errors; static Files_Rider OPM_oldSF, OPM_newSF; static Files_Rider OPM_R[3]; static Files_File OPM_oldSFile, OPM_newSFile, OPM_HFile, OPM_BFile, OPM_HIFile; @@ -536,11 +535,9 @@ static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGIN static void OPM_LogErrMsg (INT16 n) { + INT16 l; Texts_Scanner S; - Texts_Text T = NIL; - CHAR ch; - INT16 i; - CHAR buf[1024]; + CHAR c; if (n >= 0) { if (!__IN(16, OPM_Options, 32)) { VT100_SetAttr((CHAR*)"31m", 4); @@ -561,7 +558,22 @@ static void OPM_LogErrMsg (INT16 n) } OPM_LogWNum(n, 1); OPM_LogWStr((CHAR*)" ", 3); - OPM_LogWStr(errors_errors[__X(n, 350)], 128); + if (OPM_Errors == NIL) { + __NEW(OPM_Errors, Texts_TextDesc); + Texts_Open(OPM_Errors, (CHAR*)"Errors.Txt", 11); + } + Texts_OpenScanner(&S, Texts_Scanner__typ, OPM_Errors, 0); + do { + l = S.line; + Texts_Scan(&S, Texts_Scanner__typ); + } while (!((((l != S.line && S.class == 3)) && S.i == n) || S.eot)); + if (!S.eot) { + Texts_Read((void*)&S, Texts_Scanner__typ, &c); + while ((!S.eot && c >= ' ')) { + Out_Char(c); + Texts_Read((void*)&S, Texts_Scanner__typ, &c); + } + } } static void OPM_FindLine (Files_File f, Files_Rider *r, ADDRESS *r__typ, INT64 pos) @@ -1043,6 +1055,7 @@ static void EnumPtrs(void (*P)(void*)) { __ENUMR(&OPM_inR, Texts_Reader__typ, 72, 1, P); P(OPM_Log); + P(OPM_Errors); __ENUMR(&OPM_oldSF, Files_Rider__typ, 24, 1, P); __ENUMR(&OPM_newSF, Files_Rider__typ, 24, 1, P); __ENUMR(OPM_R, Files_Rider__typ, 24, 3, P); @@ -1064,7 +1077,6 @@ export void *OPM__init(void) __MODULE_IMPORT(Strings); __MODULE_IMPORT(Texts); __MODULE_IMPORT(VT100); - __MODULE_IMPORT(errors); __REGMOD("OPM", EnumPtrs); __REGCMD("CloseFiles", OPM_CloseFiles); __REGCMD("CloseOldSym", OPM_CloseOldSym); diff --git a/bootstrap/windows-88/errors.c b/bootstrap/windows-88/errors.c deleted file mode 100644 index 64af94f5..00000000 --- a/bootstrap/windows-88/errors.c +++ /dev/null @@ -1,205 +0,0 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ - -#define SHORTINT INT8 -#define INTEGER INT16 -#define LONGINT INT32 -#define SET UINT32 - -#include "SYSTEM.h" - -typedef - CHAR errors_string[128]; - - -export errors_string errors_errors[350]; - - - - - -export void *errors__init(void) -{ - __DEFMOD; - __REGMOD("errors", 0); -/* BEGIN */ - __MOVE("undeclared identifier", errors_errors[0], 22); - __MOVE("multiply defined identifier", errors_errors[1], 28); - __MOVE("illegal character in number", errors_errors[2], 28); - __MOVE("illegal character in string", errors_errors[3], 28); - __MOVE("identifier does not match procedure name", errors_errors[4], 41); - __MOVE("comment not closed", errors_errors[5], 19); - errors_errors[6][0] = 0x00; - errors_errors[7][0] = 0x00; - errors_errors[8][0] = 0x00; - __MOVE("'=' expected", errors_errors[9], 13); - errors_errors[10][0] = 0x00; - errors_errors[11][0] = 0x00; - __MOVE("type definition starts with incorrect symbol", errors_errors[12], 45); - __MOVE("factor starts with incorrect symbol", errors_errors[13], 36); - __MOVE("statement starts with incorrect symbol", errors_errors[14], 39); - __MOVE("declaration followed by incorrect symbol", errors_errors[15], 41); - __MOVE("MODULE expected", errors_errors[16], 16); - errors_errors[17][0] = 0x00; - __MOVE("'.' missing", errors_errors[18], 12); - __MOVE("',' missing", errors_errors[19], 12); - __MOVE("':' missing", errors_errors[20], 12); - errors_errors[21][0] = 0x00; - __MOVE("')' missing", errors_errors[22], 12); - __MOVE("']' missing", errors_errors[23], 12); - __MOVE("'}' missing", errors_errors[24], 12); - __MOVE("OF missing", errors_errors[25], 11); - __MOVE("THEN missing", errors_errors[26], 13); - __MOVE("DO missing", errors_errors[27], 11); - __MOVE("TO missing", errors_errors[28], 11); - errors_errors[29][0] = 0x00; - __MOVE("'(' missing", errors_errors[30], 12); - errors_errors[31][0] = 0x00; - errors_errors[32][0] = 0x00; - errors_errors[33][0] = 0x00; - __MOVE("':=' missing", errors_errors[34], 13); - __MOVE("',' or OF expected", errors_errors[35], 19); - errors_errors[36][0] = 0x00; - errors_errors[37][0] = 0x00; - __MOVE("identifier expected", errors_errors[38], 20); - __MOVE("';' missing", errors_errors[39], 12); - errors_errors[40][0] = 0x00; - __MOVE("END missing", errors_errors[41], 12); - errors_errors[42][0] = 0x00; - errors_errors[43][0] = 0x00; - __MOVE("UNTIL missing", errors_errors[44], 14); - errors_errors[45][0] = 0x00; - __MOVE("EXIT not within loop statement", errors_errors[46], 31); - __MOVE("illegally marked identifier", errors_errors[47], 28); - errors_errors[48][0] = 0x00; - errors_errors[49][0] = 0x00; - __MOVE("expression should be constant", errors_errors[50], 30); - __MOVE("constant not an integer", errors_errors[51], 24); - __MOVE("identifier does not denote a type", errors_errors[52], 34); - __MOVE("identifier does not denote a record type", errors_errors[53], 41); - __MOVE("result type of procedure is not a basic type", errors_errors[54], 45); - __MOVE("procedure call of a function", errors_errors[55], 29); - __MOVE("assignment to non-variable", errors_errors[56], 27); - __MOVE("pointer not bound to record or array type", errors_errors[57], 42); - __MOVE("recursive type definition", errors_errors[58], 26); - __MOVE("illegal open array parameter", errors_errors[59], 29); - __MOVE("wrong type of case label", errors_errors[60], 25); - __MOVE("inadmissible type of case label", errors_errors[61], 32); - __MOVE("case label defined more than once", errors_errors[62], 34); - __MOVE("illegal value of constant", errors_errors[63], 26); - __MOVE("more actual than formal parameters", errors_errors[64], 35); - __MOVE("fewer actual than formal parameters", errors_errors[65], 36); - __MOVE("element types of actual array and formal open array differ", errors_errors[66], 59); - __MOVE("actual parameter corresponding to open array is not an array", errors_errors[67], 61); - __MOVE("control variable must be integer", errors_errors[68], 33); - __MOVE("parameter must be an integer constant", errors_errors[69], 38); - __MOVE("pointer or VAR record required as formal receiver", errors_errors[70], 50); - __MOVE("pointer expected as actual receiver", errors_errors[71], 36); - __MOVE("procedure must be bound to a record of the same scope", errors_errors[72], 54); - __MOVE("procedure must have level 0", errors_errors[73], 28); - __MOVE("procedure unknown in base type", errors_errors[74], 31); - __MOVE("invalid call of base procedure", errors_errors[75], 31); - __MOVE("this variable (field) is read only", errors_errors[76], 35); - __MOVE("object is not a record", errors_errors[77], 23); - __MOVE("dereferenced object is not a variable", errors_errors[78], 38); - __MOVE("indexed object is not a variable", errors_errors[79], 33); - __MOVE("index expression is not an integer", errors_errors[80], 35); - __MOVE("index out of specified bounds", errors_errors[81], 30); - __MOVE("indexed variable is not an array", errors_errors[82], 33); - __MOVE("undefined record field", errors_errors[83], 23); - __MOVE("dereferenced variable is not a pointer", errors_errors[84], 39); - __MOVE("guard or test type is not an extension of variable type", errors_errors[85], 56); - __MOVE("guard or testtype is not a pointer", errors_errors[86], 35); - __MOVE("guarded or tested variable is neither a pointer nor a VAR-parameter record", errors_errors[87], 75); - __MOVE("open array not allowed as variable, record field or array element", errors_errors[88], 66); - errors_errors[89][0] = 0x00; - errors_errors[90][0] = 0x00; - errors_errors[91][0] = 0x00; - __MOVE("operand of IN not an integer, or not a set", errors_errors[92], 43); - __MOVE("set element type is not an integer", errors_errors[93], 35); - __MOVE("operand of & is not of type BOOLEAN", errors_errors[94], 36); - __MOVE("operand of OR is not of type BOOLEAN", errors_errors[95], 37); - __MOVE("operand not applicable to (unary) +", errors_errors[96], 36); - __MOVE("operand not applicable to (unary) -", errors_errors[97], 36); - __MOVE("operand of ~ is not of type BOOLEAN", errors_errors[98], 36); - __MOVE("ASSERT fault", errors_errors[99], 13); - __MOVE("incompatible operands of dyadic operator", errors_errors[100], 41); - __MOVE("operand type inapplicable to *", errors_errors[101], 31); - __MOVE("operand type inapplicable to /", errors_errors[102], 31); - __MOVE("operand type inapplicable to DIV", errors_errors[103], 33); - __MOVE("operand type inapplicable to MOD", errors_errors[104], 33); - __MOVE("operand type inapplicable to +", errors_errors[105], 31); - __MOVE("operand type inapplicable to -", errors_errors[106], 31); - __MOVE("operand type inapplicable to = or #", errors_errors[107], 36); - __MOVE("operand type inapplicable to relation", errors_errors[108], 38); - __MOVE("overriding method must be exported", errors_errors[109], 35); - __MOVE("operand is not a type", errors_errors[110], 22); - __MOVE("operand inapplicable to (this) function", errors_errors[111], 40); - __MOVE("operand is not a variable", errors_errors[112], 26); - __MOVE("incompatible assignment", errors_errors[113], 24); - __MOVE("string too long to be assigned", errors_errors[114], 31); - __MOVE("parameter doesn't match", errors_errors[115], 24); - __MOVE("number of parameters doesn't match", errors_errors[116], 35); - __MOVE("result type doesn't match", errors_errors[117], 26); - __MOVE("export mark doesn't match with forward declaration", errors_errors[118], 51); - __MOVE("redefinition textually precedes procedure bound to base type", errors_errors[119], 61); - __MOVE("type of expression following IF, WHILE, UNTIL or ASSERT is not BOOLEAN", errors_errors[120], 71); - __MOVE("called object is not a procedure (or is an interrupt procedure)", errors_errors[121], 64); - __MOVE("actual VAR-parameter is not a variable", errors_errors[122], 39); - __MOVE("type of actual parameter is not identical with that of formal VAR-parameter", errors_errors[123], 76); - __MOVE("type of result expression differs from that of procedure", errors_errors[124], 57); - __MOVE("type of case expression is neither INTEGER nor CHAR", errors_errors[125], 52); - __MOVE("this expression cannot be a type or a procedure", errors_errors[126], 48); - __MOVE("illegal use of object", errors_errors[127], 22); - __MOVE("unsatisfied forward reference", errors_errors[128], 30); - __MOVE("unsatisfied forward procedure", errors_errors[129], 30); - __MOVE("WITH clause does not specify a variable", errors_errors[130], 40); - __MOVE("LEN not applied to array", errors_errors[131], 25); - __MOVE("dimension in LEN too large or negative", errors_errors[132], 39); - __MOVE("SYSTEM not imported", errors_errors[135], 20); - __MOVE("key inconsistency of imported module", errors_errors[150], 37); - __MOVE("incorrect symbol file", errors_errors[151], 22); - __MOVE("symbol file of imported module not found", errors_errors[152], 41); - __MOVE("object or symbol file not opened (disk full\?)", errors_errors[153], 46); - __MOVE("recursive import not allowed", errors_errors[154], 29); - __MOVE("generation of new symbol file not allowed", errors_errors[155], 42); - __MOVE("parameter file not found", errors_errors[156], 25); - __MOVE("syntax error in parameter file", errors_errors[157], 31); - __MOVE("not yet implemented", errors_errors[200], 20); - __MOVE("lower bound of set range greater than higher bound", errors_errors[201], 51); - __MOVE("set element greater than MAX(SET) or less than 0", errors_errors[202], 49); - __MOVE("number too large", errors_errors[203], 17); - __MOVE("product too large", errors_errors[204], 18); - __MOVE("division by zero", errors_errors[205], 17); - __MOVE("sum too large", errors_errors[206], 14); - __MOVE("difference too large", errors_errors[207], 21); - __MOVE("overflow in arithmetic shift", errors_errors[208], 29); - __MOVE("case range too large", errors_errors[209], 21); - __MOVE("too many cases in case statement", errors_errors[213], 33); - __MOVE("illegal value of parameter (0 <= p < 256)", errors_errors[218], 42); - __MOVE("machine registers cannot be accessed", errors_errors[219], 37); - __MOVE("illegal value of parameter", errors_errors[220], 27); - __MOVE("too many pointers in a record", errors_errors[221], 30); - __MOVE("too many global pointers", errors_errors[222], 25); - __MOVE("too many record types", errors_errors[223], 22); - __MOVE("too many pointer types", errors_errors[224], 23); - __MOVE("address of pointer variable too large (move forward in text)", errors_errors[225], 61); - __MOVE("too many exported procedures", errors_errors[226], 29); - __MOVE("too many imported modules", errors_errors[227], 26); - __MOVE("too many exported structures", errors_errors[228], 29); - __MOVE("too many nested records for import", errors_errors[229], 35); - __MOVE("too many constants (strings) in module", errors_errors[230], 39); - __MOVE("too many link table entries (external procedures)", errors_errors[231], 50); - __MOVE("too many commands in module", errors_errors[232], 28); - __MOVE("record extension hierarchy too high", errors_errors[233], 36); - __MOVE("export of recursive type not allowed", errors_errors[234], 37); - __MOVE("identifier too long", errors_errors[240], 20); - __MOVE("string too long", errors_errors[241], 16); - __MOVE("address overflow", errors_errors[242], 17); - __MOVE("cyclic type definition not allowed", errors_errors[244], 35); - __MOVE("guarded pointer variable may be manipulated by non-local operations; use auxiliary pointer variable", errors_errors[245], 100); - __MOVE("implicit type cast", errors_errors[301], 19); - __MOVE("inappropriate symbol file ignored", errors_errors[306], 34); - __MOVE("no ELSE symbol after CASE statement sequence may lead to trap", errors_errors[307], 62); - __MOVE("SYSTEM.VAL result includes memory past end of source variable", errors_errors[308], 62); - __ENDMOD; -} diff --git a/bootstrap/windows-88/errors.h b/bootstrap/windows-88/errors.h deleted file mode 100644 index 1a983a0c..00000000 --- a/bootstrap/windows-88/errors.h +++ /dev/null @@ -1,18 +0,0 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ - -#ifndef errors__h -#define errors__h - -#include "SYSTEM.h" - -typedef - CHAR errors_string[128]; - - -import errors_string errors_errors[350]; - - -import void *errors__init(void); - - -#endif // errors diff --git a/makefile b/makefile index 7f98eb4b..39da025f 100644 --- a/makefile +++ b/makefile @@ -170,6 +170,11 @@ assemble: @make -f src/tools/make/oberon.mk -s assemble MODEL=2 +compilerfromsavedsource: + @make -f src/tools/make/oberon.mk -s compilerfromsavedsource + + + # compile: compiler only, without cleaning compiler: configuration @make -f src/tools/make/oberon.mk -s translate MODEL=2 diff --git a/src/compiler/OPM.Mod b/src/compiler/OPM.Mod index f765cd2e..02439e66 100644 --- a/src/compiler/OPM.Mod +++ b/src/compiler/OPM.Mod @@ -4,7 +4,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) 31.1.2007 jt synchronized with BlackBox version, in particular PromoteIntConstToLInt added *) - IMPORT SYSTEM, Texts, Files, Platform, Out, errors, Configuration, VT100, Strings; + IMPORT SYSTEM, Texts, Files, Platform, Out, Configuration, VT100, Strings; CONST OptionChar* = "-"; @@ -111,7 +111,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) lasterrpos: LONGINT; inR: Texts.Reader; - Log: Texts.Text; + Log, Errors: Texts.Text; oldSF, newSF: Files.Rider; R: ARRAY 3 OF Files.Rider; @@ -420,10 +420,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) PROCEDURE LogErrMsg(n: INTEGER); - VAR - S: Texts.Scanner; T: Texts.Text; - ch: CHAR; i: INTEGER; - buf: ARRAY 1024 OF CHAR; + VAR l: INTEGER; S: Texts.Scanner; c: CHAR; BEGIN IF n >= 0 THEN IF ~(notcoloroutput IN Options) THEN VT100.SetAttr(VT100.Red) END; @@ -436,6 +433,32 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) END ; LogWNum(n, 1); LogWStr(" "); + + IF Errors = NIL THEN NEW(Errors); Texts.Open(Errors, "Errors.Txt") END; + Texts.OpenScanner(S, Errors, 0); + REPEAT l := S.line; Texts.Scan(S) + UNTIL (l # S.line) & (S.class = Texts.Int) & (S.i = n) OR S.eot; + IF ~S.eot THEN + Texts.Read(S, c); + WHILE ~S.eot & (c >= ' ') DO Out.Char(c); Texts.Read(S, c) END + END + + +(* --- +VAR T: Texts.Text; S: Texts.Scanner; + +PROCEDURE Write*(n: INTEGER); + VAR l: INTEGER; c: CHAR; +BEGIN + IF T = NIL THEN NEW(T); Texts.Open(T, "VishapOberonErrors.txt") END; + Texts.OpenScanner(S, T, 0); + REPEAT l := S.line; Texts.Scan(S) + UNTIL (l # S.line) & (S.class = Texts.Int) & (S.i = n) OR S.eot; + IF ~S.eot THEN Texts.Read(S, c); + WHILE ~S.eot & (c >= ' ') DO Console.Char(c); Texts.Read(S, c) END + END +END Write; + (*NEW(T); Texts.Open(T, "vocErrors.Text"); Texts.OpenScanner(S, T, 0); REPEAT S.line := 0; REPEAT Texts.Scan(S) UNTIL S.eot OR (S.line # 0) @@ -445,6 +468,8 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) buf[i] := 0X; LogWStr(buf); END*) LogWStr(errors.errors[n]); + +--- *) END LogErrMsg; diff --git a/src/compiler/errors.Mod b/src/compiler/errors.Mod deleted file mode 100644 index 1546aa8c..00000000 --- a/src/compiler/errors.Mod +++ /dev/null @@ -1,215 +0,0 @@ -MODULE errors; - -TYPE string* = ARRAY 128 OF CHAR; - -VAR errors- : ARRAY 350 OF string; - - -BEGIN -(* Incorrect use of the language Oberon *) -errors[0] := "undeclared identifier"; -errors[1] := "multiply defined identifier"; -errors[2] := "illegal character in number"; -errors[3] := "illegal character in string"; -errors[4] := "identifier does not match procedure name"; -errors[5] := "comment not closed"; -errors[6] := ""; -errors[7] := ""; -errors[8] := ""; -errors[9] := "'=' expected"; -errors[10] :=""; -errors[11] :=""; -errors[12] := "type definition starts with incorrect symbol"; -errors[13] := "factor starts with incorrect symbol"; -errors[14] := "statement starts with incorrect symbol"; -errors[15] := "declaration followed by incorrect symbol"; -errors[16] := "MODULE expected"; -errors[17] := ""; -errors[18] := "'.' missing"; -errors[19] := "',' missing"; -errors[20] := "':' missing"; -errors[21] := ""; -errors[22] := "')' missing"; -errors[23] := "']' missing"; -errors[24] := "'}' missing"; -errors[25] := "OF missing"; -errors[26] := "THEN missing"; -errors[27] := "DO missing"; -errors[28] := "TO missing"; -errors[29] := ""; -errors[30] := "'(' missing"; -errors[31] := ""; -errors[32] := ""; -errors[33] := ""; -errors[34] := "':=' missing"; -errors[35] := "',' or OF expected"; -errors[36] := ""; -errors[37] := ""; -errors[38] := "identifier expected"; -errors[39] := "';' missing"; -errors[40] := ""; -errors[41] := "END missing"; -errors[42] := ""; -errors[43] := ""; -errors[44] := "UNTIL missing"; -errors[45] := ""; -errors[46] := "EXIT not within loop statement"; -errors[47] := "illegally marked identifier"; -errors[48] := ""; -errors[49] := ""; -errors[50] := "expression should be constant"; -errors[51] := "constant not an integer"; -errors[52] := "identifier does not denote a type"; -errors[53] := "identifier does not denote a record type"; -errors[54] := "result type of procedure is not a basic type"; -errors[55] := "procedure call of a function"; -errors[56] := "assignment to non-variable"; -errors[57] := "pointer not bound to record or array type"; -errors[58] := "recursive type definition"; -errors[59] := "illegal open array parameter"; -errors[60] := "wrong type of case label"; -errors[61] := "inadmissible type of case label"; -errors[62] := "case label defined more than once"; -errors[63] := "illegal value of constant"; -errors[64] := "more actual than formal parameters"; -errors[65] := "fewer actual than formal parameters"; -errors[66] := "element types of actual array and formal open array differ"; -errors[67] := "actual parameter corresponding to open array is not an array"; -errors[68] := "control variable must be integer"; -errors[69] := "parameter must be an integer constant"; -errors[70] := "pointer or VAR record required as formal receiver"; -errors[71] := "pointer expected as actual receiver"; -errors[72] := "procedure must be bound to a record of the same scope"; -errors[73] := "procedure must have level 0"; -errors[74] := "procedure unknown in base type"; -errors[75] := "invalid call of base procedure"; -errors[76] := "this variable (field) is read only"; -errors[77] := "object is not a record"; -errors[78] := "dereferenced object is not a variable"; -errors[79] := "indexed object is not a variable"; -errors[80] := "index expression is not an integer"; -errors[81] := "index out of specified bounds"; -errors[82] := "indexed variable is not an array"; -errors[83] := "undefined record field"; -errors[84] := "dereferenced variable is not a pointer"; -errors[85] := "guard or test type is not an extension of variable type"; -errors[86] := "guard or testtype is not a pointer"; -errors[87] := "guarded or tested variable is neither a pointer nor a VAR-parameter record"; -errors[88] := "open array not allowed as variable, record field or array element"; -errors[89] := ""; -errors[90] := ""; -errors[91] := ""; -errors[92] := "operand of IN not an integer, or not a set"; -errors[93] := "set element type is not an integer"; -errors[94] := "operand of & is not of type BOOLEAN"; -errors[95] := "operand of OR is not of type BOOLEAN"; -errors[96] := "operand not applicable to (unary) +"; -errors[97] := "operand not applicable to (unary) -"; -errors[98] := "operand of ~ is not of type BOOLEAN"; -errors[99] := "ASSERT fault"; -errors[100] := "incompatible operands of dyadic operator"; -errors[101] := "operand type inapplicable to *"; -errors[102] := "operand type inapplicable to /"; -errors[103] := "operand type inapplicable to DIV"; -errors[104] := "operand type inapplicable to MOD"; -errors[105] := "operand type inapplicable to +"; -errors[106] := "operand type inapplicable to -"; -errors[107] := "operand type inapplicable to = or #"; -errors[108] := "operand type inapplicable to relation"; -errors[109] := "overriding method must be exported"; -errors[110] := "operand is not a type"; -errors[111] := "operand inapplicable to (this) function"; -errors[112] := "operand is not a variable"; -errors[113] := "incompatible assignment"; -errors[114] := "string too long to be assigned"; -errors[115] := "parameter doesn't match"; -errors[116] := "number of parameters doesn't match"; -errors[117] := "result type doesn't match"; -errors[118] := "export mark doesn't match with forward declaration"; -errors[119] := "redefinition textually precedes procedure bound to base type"; -errors[120] := "type of expression following IF, WHILE, UNTIL or ASSERT is not BOOLEAN"; -errors[121] := "called object is not a procedure (or is an interrupt procedure)"; -errors[122] := "actual VAR-parameter is not a variable"; -errors[123] := "type of actual parameter is not identical with that of formal VAR-parameter"; -errors[124] := "type of result expression differs from that of procedure"; -errors[125] := "type of case expression is neither INTEGER nor CHAR"; -errors[126] := "this expression cannot be a type or a procedure"; -errors[127] := "illegal use of object"; -errors[128] := "unsatisfied forward reference"; -errors[129] := "unsatisfied forward procedure"; -errors[130] := "WITH clause does not specify a variable"; -errors[131] := "LEN not applied to array"; -errors[132] := "dimension in LEN too large or negative"; -errors[135] := "SYSTEM not imported"; -errors[150] := "key inconsistency of imported module"; -errors[151] := "incorrect symbol file"; -errors[152] := "symbol file of imported module not found"; -errors[153] := "object or symbol file not opened (disk full?)"; -errors[154] := "recursive import not allowed"; -errors[155] := "generation of new symbol file not allowed"; -errors[156] := "parameter file not found"; -errors[157] := "syntax error in parameter file"; -(* Limitations of implementation*) -errors[200] := "not yet implemented"; -errors[201] := "lower bound of set range greater than higher bound"; -errors[202] := "set element greater than MAX(SET) or less than 0"; -errors[203] := "number too large"; -errors[204] := "product too large"; -errors[205] := "division by zero"; -errors[206] := "sum too large"; -errors[207] := "difference too large"; -errors[208] := "overflow in arithmetic shift"; -errors[209] := "case range too large"; -errors[213] := "too many cases in case statement"; -errors[218] := "illegal value of parameter (0 <= p < 256)"; -errors[219] := "machine registers cannot be accessed"; -errors[220] := "illegal value of parameter"; -errors[221] := "too many pointers in a record"; -errors[222] := "too many global pointers"; -errors[223] := "too many record types"; -errors[224] := "too many pointer types"; -errors[225] := "address of pointer variable too large (move forward in text)"; -errors[226] := "too many exported procedures"; -errors[227] := "too many imported modules"; -errors[228] := "too many exported structures"; -errors[229] := "too many nested records for import"; -errors[230] := "too many constants (strings) in module"; -errors[231] := "too many link table entries (external procedures)"; -errors[232] := "too many commands in module"; -errors[233] := "record extension hierarchy too high"; -errors[234] := "export of recursive type not allowed"; -errors[240] := "identifier too long"; -errors[241] := "string too long"; -errors[242] := "address overflow"; -errors[244] := "cyclic type definition not allowed"; -errors[245] := "guarded pointer variable may be manipulated by non-local operations; use auxiliary pointer variable"; -(* Compiler Warnings *) - -errors[301] := "implicit type cast"; -errors[306] := "inappropriate symbol file ignored"; -errors[307] := "no ELSE symbol after CASE statement sequence may lead to trap"; (* new warning, -- noch *) -errors[308] := "SYSTEM.VAL result includes memory past end of source variable"; (* DCWB *) - -END errors. -(* -Run-time Error Messages - SYSTEM_halt - 0 silent HALT(0) - 1..255 HALT(n), cf. SYSTEM_halt - -1 assertion failed, cf. SYSTEM_assert - -2 invalid array index - -3 function procedure without RETURN statement - -4 invalid case in CASE statement - -5 type guard failed - -6 implicit type guard in record assignment failed - -7 invalid case in WITH statement - -8 value out of range - -9 (delayed) interrupt - -10 NIL access - -11 alignment error - -12 zero divide - -13 arithmetic overflow/underflow - -14 invalid function argument - -15 internal error -*) - diff --git a/src/runtime/Errors.Txt b/src/runtime/Errors.Txt new file mode 100644 index 00000000..bafaba66 --- /dev/null +++ b/src/runtime/Errors.Txt @@ -0,0 +1,194 @@ +The first line of this file is ignored. +Any line not starting /^ *[0-9]/ is ignored. +There should be only one space between the number and the message text. + +Compiler error messages + 0 undeclared identifier + 1 multiply defined identifier + 2 illegal character in number + 3 illegal character in string + 4 identifier does not match procedure name + 5 comment not closed + + 9 '=' expected + + 12 type definition starts with incorrect symbol + 13 factor starts with incorrect symbol + 14 statement starts with incorrect symbol + 15 declaration followed by incorrect symbol + 16 MODULE expected + + 18 '.' missing + 19 ',' missing + 20 ':' missing + + 22 ')' missing + 23 ']' missing + 24 '}' missing + 25 OF missing + 26 THEN missing + 27 DO missing + 28 TO missing + + 30 '(' missing + + 34 ':=' missing + 35 ',' or OF expected + + 38 identifier expected + 39 ';' missing + + 41 END missing + + 44 UNTIL missing + + 46 EXIT not within loop statement + 47 illegally marked identifier + + 50 expression should be constant + 51 constant not an integer + 52 identifier does not denote a type + 53 identifier does not denote a record type + 54 result type of procedure is not a basic type + 55 procedure call of a function + 56 assignment to non-variable + 57 pointer not bound to record or array type + 58 recursive type definition + 59 illegal open array parameter + 60 wrong type of case label + 61 inadmissible type of case label + 62 case label defined more than once + 63 illegal value of constant + 64 more actual than formal parameters + 65 fewer actual than formal parameters + 66 element types of actual array and formal open array differ + 67 actual parameter corresponding to open array is not an array + 68 control variable must be integer + 69 parameter must be an integer constant + 70 pointer or VAR record required as formal receiver + 71 pointer expected as actual receiver + 72 procedure must be bound to a record of the same scope + 73 procedure must have level 0 + 74 procedure unknown in base type + 75 invalid call of base procedure + 76 this variable (field) is read only + 77 object is not a record + 78 dereferenced object is not a variable + 79 indexed object is not a variable + 80 index expression is not an integer + 81 index out of specified bounds + 82 indexed variable is not an array + 83 undefined record field + 84 dereferenced variable is not a pointer + 85 guard or test type is not an extension of variable type + 86 guard or testtype is not a pointer + 87 guarded or tested variable is neither a pointer nor a VAR-parameter record + 88 open array not allowed as variable, record field or array element + + 92 operand of IN not an integer, or not a set + 93 set element type is not an integer + 94 operand of & is not of type BOOLEAN + 95 operand of OR is not of type BOOLEAN + 96 operand not applicable to (unary) + + 97 operand not applicable to (unary) - + 98 operand of ~ is not of type BOOLEAN + 99 ASSERT fault +100 incompatible operands of dyadic operator +101 operand type inapplicable to * +102 operand type inapplicable to / +103 operand type inapplicable to DIV +104 operand type inapplicable to MOD +105 operand type inapplicable to + +106 operand type inapplicable to - +107 operand type inapplicable to = or # +108 operand type inapplicable to relation +109 overriding method must be exported +110 operand is not a type +111 operand inapplicable to (this) function +112 operand is not a variable +113 incompatible assignment +114 string too long to be assigned +115 parameter doesn't match +116 number of parameters doesn't match +117 result type doesn't match +118 export mark doesn't match with forward declaration +119 redefinition textually precedes procedure bound to base type +120 type of expression following IF, WHILE, UNTIL or ASSERT is not BOOLEAN +121 called object is not a procedure (or is an interrupt procedure) +122 actual VAR-parameter is not a variable +123 type of actual parameter is not identical with that of formal VAR-parameter +124 type of result expression differs from that of procedure +125 type of case expression is neither INTEGER nor CHAR +126 this expression cannot be a type or a procedure +127 illegal use of object +128 unsatisfied forward reference +129 unsatisfied forward procedure +130 WITH clause does not specify a variable +131 LEN not applied to array +132 dimension in LEN too large or negative +135 SYSTEM not imported +150 key inconsistency of imported module +151 incorrect symbol file +152 symbol file of imported module not found +153 object or symbol file not opened (disk full?) +154 recursive import not allowed +155 generation of new symbol file not allowed +156 parameter file not found +157 syntax error in parameter file + +Limitations of implementation +200 not yet implemented +201 lower bound of set range greater than higher bound +202 set element greater than MAX(SET) or less than 0 +203 number too large +204 product too large +205 division by zero +206 sum too large +207 difference too large +208 overflow in arithmetic shift +209 case range too large +213 too many cases in case statement +218 illegal value of parameter (0 <= p < 256) +219 machine registers cannot be accessed +220 illegal value of parameter +221 too many pointers in a record +222 too many global pointers +223 too many record types +224 too many pointer types +225 address of pointer variable too large (move forward in text) +226 too many exported procedures +227 too many imported modules +228 too many exported structures +229 too many nested records for import +230 too many constants (strings) in module +231 too many link table entries (external procedures) +232 too many commands in module +233 record extension hierarchy too high +234 export of recursive type not allowed +240 identifier too long +241 string too long +242 address overflow +244 cyclic type definition not allowed +245 guarded pointer variable may be manipulated by non-local operations; use auxiliary pointer variable + +Compiler Warnings +301 implicit type cast +306 inappropriate symbol file ignored +307 no ELSE symbol after CASE statement sequence may lead to trap + +Run-time Error Messages + -1 assertion failed, cf. SYSTEM_assert + -2 invalid array index + -3 function procedure without RETURN statement + -4 invalid case in CASE statement + -5 type guard failed + -6 implicit type guard in record assignment failed + -7 invalid case in WITH statement + -8 value out of range + -9 (delayed) interrupt +-10 NIL access +-11 alignment error +-12 zero divide +-13 arithmetic overflow/underflow +-14 invalid function argument +-15 internal error diff --git a/src/tools/make/oberon.mk b/src/tools/make/oberon.mk index f9ae45a4..96e8fde0 100644 --- a/src/tools/make/oberon.mk +++ b/src/tools/make/oberon.mk @@ -61,16 +61,18 @@ assemble: cd $(BUILDDIR) && $(COMPILE) -c SYSTEM.c Configuration.c Platform.c Heap.c cd $(BUILDDIR) && $(COMPILE) -c Out.c Strings.c Modules.c Files.c - cd $(BUILDDIR) && $(COMPILE) -c Reals.c Texts.c VT100.c errors.c + cd $(BUILDDIR) && $(COMPILE) -c Reals.c Texts.c VT100.c cd $(BUILDDIR) && $(COMPILE) -c OPM.c extTools.c OPS.c OPT.c cd $(BUILDDIR) && $(COMPILE) -c OPC.c OPV.c OPB.c OPP.c cd $(BUILDDIR) && $(COMPILE) $(STATICLINK) Compiler.c -o $(ROOTDIR)/$(OBECOMP) \ - SYSTEM.o Configuration.o Platform.o Heap.o Out.o Strings.o Modules.o Files.o \ - Reals.o Texts.o VT100.o errors.o OPM.o extTools.o OPS.o OPT.o \ - OPC.o OPV.o OPB.o OPP.o + SYSTEM.o Configuration.o Platform.o Heap.o Out.o Strings.o \ + Modules.o Files.o Reals.o Texts.o VT100.o extTools.o \ + OPM.o OPS.o OPT.o OPC.o OPV.o OPB.o OPP.o cp src/runtime/*.[ch] $(BUILDDIR) + cp src/runtime/*.Txt $(BUILDDIR) + cp src/runtime/*.Txt $(ROOTDIR) @printf "$(OBECOMP) created.\n" @@ -111,7 +113,6 @@ translate: cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Reals.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Texts.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/VT100.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/errors.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/OPM.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/extTools.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfFx -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/OPS.Mod @@ -123,6 +124,7 @@ translate: cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ssfm -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/Compiler.Mod cp src/runtime/*.[ch] $(BUILDDIR) + cp src/runtime/*.Txt $(BUILDDIR) @printf "$(BUILDDIR) filled with compiler C source.\n" @@ -134,7 +136,7 @@ browsercmd: @cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Smf -O$(MODEL) ../../src/tools/browser/BrowserCmd.Mod @cd $(BUILDDIR); $(COMPILE) BrowserCmd.c Oberon.c -o showdef \ Platform.o Texts.o OPT.o Heap.o Out.o SYSTEM.o OPM.o OPS.o OPV.o \ - Files.o Reals.o Modules.o VT100.o errors.o Configuration.o Strings.o \ + Files.o Reals.o Modules.o VT100.o Configuration.o Strings.o \ OPC.o @@ -168,6 +170,9 @@ install: @mkdir -p "$(INSTALLDIR)/C/include" && cp $(BUILDDIR)/C/*.h "$(INSTALLDIR)/C/include/" @mkdir -p "$(INSTALLDIR)/C/sym" && cp $(BUILDDIR)/C/*.sym "$(INSTALLDIR)/C/sym/" + @cp $(BUILDDIR)/*.Txt "$(INSTALLDIR)/2/sym/" + @cp $(BUILDDIR)/*.Txt "$(INSTALLDIR)/C/sym/" + @mkdir -p "$(INSTALLDIR)/lib" @cp $(BUILDDIR)/2/lib$(ONAME)* "$(INSTALLDIR)/lib/" @cp $(BUILDDIR)/C/lib$(ONAME)* "$(INSTALLDIR)/lib/" @@ -366,8 +371,9 @@ library: @printf "\nCompiling lib$(ONAME)-O$(MODEL) sources\n" rm -rf $(BUILDDIR)/$(MODEL) mkdir -p $(BUILDDIR)/$(MODEL) - cp src/runtime/*.[ch] $(BUILDDIR)/$(MODEL) - cd $(BUILDDIR)/$(MODEL) && $(COMPILE) -c SYSTEM.c + #cp src/runtime/*.[ch] $(BUILDDIR)/$(MODEL) + #cd $(BUILDDIR)/$(MODEL) && $(COMPILE) -c SYSTEM.c + cp $(BUILDDIR)/SYSTEM.[ho] $(BUILDDIR)/$(MODEL) @make -f src/tools/make/oberon.mk -s O$(MODEL)library MODEL=$(MODEL) @printf "\nMaking lib$(ONAME)-O$(MODEL) .a and .so\n" ar rcs "$(BUILDDIR)/$(MODEL)/lib$(ONAME)-O$(MODEL).a" $(BUILDDIR)/$(MODEL)/*.o From f9c72a37b007331161f5c73122b43bcd38a8865a Mon Sep 17 00:00:00 2001 From: David Brown Date: Mon, 14 Nov 2016 21:25:04 +0000 Subject: [PATCH 321/580] Fix mingw build. --- src/compiler/OPM.Mod | 29 +---------------------------- src/tools/make/oberon.mk | 3 +-- 2 files changed, 2 insertions(+), 30 deletions(-) diff --git a/src/compiler/OPM.Mod b/src/compiler/OPM.Mod index 02439e66..f0d5087b 100644 --- a/src/compiler/OPM.Mod +++ b/src/compiler/OPM.Mod @@ -435,6 +435,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) LogWStr(" "); IF Errors = NIL THEN NEW(Errors); Texts.Open(Errors, "Errors.Txt") END; + Texts.OpenScanner(S, Errors, 0); REPEAT l := S.line; Texts.Scan(S) UNTIL (l # S.line) & (S.class = Texts.Int) & (S.i = n) OR S.eot; @@ -442,34 +443,6 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) Texts.Read(S, c); WHILE ~S.eot & (c >= ' ') DO Out.Char(c); Texts.Read(S, c) END END - - -(* --- -VAR T: Texts.Text; S: Texts.Scanner; - -PROCEDURE Write*(n: INTEGER); - VAR l: INTEGER; c: CHAR; -BEGIN - IF T = NIL THEN NEW(T); Texts.Open(T, "VishapOberonErrors.txt") END; - Texts.OpenScanner(S, T, 0); - REPEAT l := S.line; Texts.Scan(S) - UNTIL (l # S.line) & (S.class = Texts.Int) & (S.i = n) OR S.eot; - IF ~S.eot THEN Texts.Read(S, c); - WHILE ~S.eot & (c >= ' ') DO Console.Char(c); Texts.Read(S, c) END - END -END Write; - - (*NEW(T); Texts.Open(T, "vocErrors.Text"); Texts.OpenScanner(S, T, 0); - REPEAT S.line := 0; - REPEAT Texts.Scan(S) UNTIL S.eot OR (S.line # 0) - UNTIL S.eot OR (S.class = Texts.Int) & (S.i = n); - IF ~S.eot THEN Texts.Read(S, ch); i := 0; - WHILE ~S.eot & (ch # 0DX) DO buf[i] := ch; INC(i); Texts.Read(S, ch) END ; - buf[i] := 0X; LogWStr(buf); - END*) - LogWStr(errors.errors[n]); - ---- *) END LogErrMsg; diff --git a/src/tools/make/oberon.mk b/src/tools/make/oberon.mk index 96e8fde0..ebbbe417 100644 --- a/src/tools/make/oberon.mk +++ b/src/tools/make/oberon.mk @@ -371,9 +371,8 @@ library: @printf "\nCompiling lib$(ONAME)-O$(MODEL) sources\n" rm -rf $(BUILDDIR)/$(MODEL) mkdir -p $(BUILDDIR)/$(MODEL) - #cp src/runtime/*.[ch] $(BUILDDIR)/$(MODEL) - #cd $(BUILDDIR)/$(MODEL) && $(COMPILE) -c SYSTEM.c cp $(BUILDDIR)/SYSTEM.[ho] $(BUILDDIR)/$(MODEL) + cp $(BUILDDIR)/WindowsWrapper.h $(BUILDDIR)/$(MODEL) @make -f src/tools/make/oberon.mk -s O$(MODEL)library MODEL=$(MODEL) @printf "\nMaking lib$(ONAME)-O$(MODEL) .a and .so\n" ar rcs "$(BUILDDIR)/$(MODEL)/lib$(ONAME)-O$(MODEL).a" $(BUILDDIR)/$(MODEL)/*.o From f08e49d856e1e7368c6b7b9f769fa73b4368b051 Mon Sep 17 00:00:00 2001 From: David Brown Date: Tue, 15 Nov 2016 11:51:29 +0000 Subject: [PATCH 322/580] Fix and simplify fingerprinting for 64 bit values --- bootstrap/unix-44/Compiler.c | 2 +- bootstrap/unix-44/Configuration.c | 4 +-- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Files.c | 2 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 2 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 2 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 53 ++++++++++++++++------------ bootstrap/unix-44/OPM.h | 8 ++--- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 2 +- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 2 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Out.c | 2 +- bootstrap/unix-44/Out.h | 2 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/VT100.c | 2 +- bootstrap/unix-44/VT100.h | 2 +- bootstrap/unix-44/extTools.c | 2 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-48/Compiler.c | 2 +- bootstrap/unix-48/Configuration.c | 4 +-- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Files.c | 2 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 2 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 2 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 53 ++++++++++++++++------------ bootstrap/unix-48/OPM.h | 8 ++--- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 2 +- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 2 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Out.c | 2 +- bootstrap/unix-48/Out.h | 2 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/VT100.c | 2 +- bootstrap/unix-48/VT100.h | 2 +- bootstrap/unix-48/extTools.c | 2 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-88/Compiler.c | 2 +- bootstrap/unix-88/Configuration.c | 4 +-- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Files.c | 2 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 2 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 2 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 53 ++++++++++++++++------------ bootstrap/unix-88/OPM.h | 8 ++--- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 2 +- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 2 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Out.c | 2 +- bootstrap/unix-88/Out.h | 2 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/VT100.c | 2 +- bootstrap/unix-88/VT100.h | 2 +- bootstrap/unix-88/extTools.c | 2 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/windows-48/Compiler.c | 2 +- bootstrap/windows-48/Configuration.c | 4 +-- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Files.c | 2 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 2 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 2 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 53 ++++++++++++++++------------ bootstrap/windows-48/OPM.h | 8 ++--- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 2 +- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 2 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Out.c | 2 +- bootstrap/windows-48/Out.h | 2 +- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/VT100.c | 2 +- bootstrap/windows-48/VT100.h | 2 +- bootstrap/windows-48/extTools.c | 2 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-88/Compiler.c | 2 +- bootstrap/windows-88/Configuration.c | 4 +-- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Files.c | 2 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 2 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 2 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 53 ++++++++++++++++------------ bootstrap/windows-88/OPM.h | 8 ++--- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 2 +- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 2 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Out.c | 2 +- bootstrap/windows-88/Out.h | 2 +- bootstrap/windows-88/Platform.c | 2 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/VT100.c | 2 +- bootstrap/windows-88/VT100.h | 2 +- bootstrap/windows-88/extTools.c | 2 +- bootstrap/windows-88/extTools.h | 2 +- src/compiler/OPM.Mod | 49 ++++++++----------------- src/runtime/Errors.Txt | 1 + 187 files changed, 366 insertions(+), 349 deletions(-) diff --git a/bootstrap/unix-44/Compiler.c b/bootstrap/unix-44/Compiler.c index 9d52cfc4..abb29dbf 100644 --- a/bootstrap/unix-44/Compiler.c +++ b/bootstrap/unix-44/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index 40f3ddee..0fe23200 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/11/14]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index 45384aa2..8821eec7 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index ea177995..c220d8a5 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index 1499df05..a97a0220 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index 85a52286..dc79f2c6 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index a40ef769..3d31f97c 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index 5fb74ad0..2632922b 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index 66c0c947..ef8a8c3b 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index f2e99ab3..bb87539a 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index 88ed3d3f..20ecca68 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 90df9e97..96d49e67 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index cfb3a8bf..a27ea6fd 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index a5afb71e..4e1b04a2 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -49,10 +49,11 @@ export void OPM_CloseFiles (void); export void OPM_CloseOldSym (void); export void OPM_DeleteNewSym (void); export void OPM_FPrint (INT32 *fp, INT64 val); -export void OPM_FPrintLReal (INT32 *fp, LONGREAL lr); -export void OPM_FPrintReal (INT32 *fp, REAL real); -export void OPM_FPrintSet (INT32 *fp, UINT64 set); +export void OPM_FPrintLReal (INT32 *fp, LONGREAL val); +export void OPM_FPrintReal (INT32 *fp, REAL val); +export void OPM_FPrintSet (INT32 *fp, UINT64 val); static void OPM_FindLine (Files_File f, Files_Rider *r, ADDRESS *r__typ, INT64 pos); +static void OPM_FingerprintBytes (INT32 *fp, SYSTEM_BYTE *bytes, LONGINT bytes__len); export void OPM_Get (CHAR *ch); export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); export void OPM_InitOptions (void); @@ -707,31 +708,37 @@ void OPM_err (INT16 n) OPM_Mark(n, OPM_errpos); } -void OPM_FPrint (INT32 *fp, INT64 val) -{ - *fp = __ROTL((INT32)((UINT32)*fp ^ __VAL(UINT32, val)), 1, 32); -} - -void OPM_FPrintSet (INT32 *fp, UINT64 set) -{ - OPM_FPrint(&*fp, __VAL(INT32, set)); -} - -void OPM_FPrintReal (INT32 *fp, REAL real) +static void OPM_FingerprintBytes (INT32 *fp, SYSTEM_BYTE *bytes, LONGINT bytes__len) { INT16 i; INT32 l; - __GET((ADDRESS)&real, l, INT32); - OPM_FPrint(&*fp, l); + __ASSERT(__MASK(bytes__len, -4) == 0, 0); + i = 0; + while (i < bytes__len) { + __GET((ADDRESS)&bytes[__X(i, bytes__len)], l, INT32); + *fp = __ROTL((INT32)((UINT32)*fp ^ (UINT32)l), 1, 32); + i += 4; + } } -void OPM_FPrintLReal (INT32 *fp, LONGREAL lr) +void OPM_FPrint (INT32 *fp, INT64 val) { - INT32 l, h; - __GET((ADDRESS)&lr, l, INT32); - __GET((ADDRESS)&lr + 4, h, INT32); - OPM_FPrint(&*fp, l); - OPM_FPrint(&*fp, h); + OPM_FingerprintBytes(&*fp, (void*)&val, 8); +} + +void OPM_FPrintSet (INT32 *fp, UINT64 val) +{ + OPM_FingerprintBytes(&*fp, (void*)&val, 8); +} + +void OPM_FPrintReal (INT32 *fp, REAL val) +{ + OPM_FingerprintBytes(&*fp, (void*)&val, 4); +} + +void OPM_FPrintLReal (INT32 *fp, LONGREAL val) +{ + OPM_FingerprintBytes(&*fp, (void*)&val, 8); } void OPM_SymRCh (CHAR *ch) diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index 4c5e13a8..17ae2fda 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h @@ -24,9 +24,9 @@ import void OPM_CloseFiles (void); import void OPM_CloseOldSym (void); import void OPM_DeleteNewSym (void); import void OPM_FPrint (INT32 *fp, INT64 val); -import void OPM_FPrintLReal (INT32 *fp, LONGREAL lr); -import void OPM_FPrintReal (INT32 *fp, REAL real); -import void OPM_FPrintSet (INT32 *fp, UINT64 set); +import void OPM_FPrintLReal (INT32 *fp, LONGREAL val); +import void OPM_FPrintReal (INT32 *fp, REAL val); +import void OPM_FPrintSet (INT32 *fp, UINT64 val); import void OPM_Get (CHAR *ch); import void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); import void OPM_InitOptions (void); diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index 3408b3cc..e1f6e651 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index 3ddbca21..272a545a 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index 91e3a136..0b2a09d7 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index bd0a0e9a..2cb37758 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index 2394c022..93bf36ce 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index 9850a22e..6c82f6b5 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index 2f149a8a..78becdbf 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index ebb01de2..dff88ffa 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Out.c b/bootstrap/unix-44/Out.c index 8cd71126..a4c3b892 100644 --- a/bootstrap/unix-44/Out.c +++ b/bootstrap/unix-44/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Out.h b/bootstrap/unix-44/Out.h index 144d7888..fd11d7ba 100644 --- a/bootstrap/unix-44/Out.h +++ b/bootstrap/unix-44/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index d2da38f5..6cb7767f 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index df398744..6ae68d6f 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 0eecd854..3445ecec 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index 1eaca8ec..035a9727 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index 48e0dd7f..2e536dda 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index 17369939..668261aa 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index 8e1abee4..8688df84 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index d72c211b..08d97e8d 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/VT100.c b/bootstrap/unix-44/VT100.c index 909f4e92..2d8d0a2a 100644 --- a/bootstrap/unix-44/VT100.c +++ b/bootstrap/unix-44/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/VT100.h b/bootstrap/unix-44/VT100.h index 15dc50c5..ae8ad073 100644 --- a/bootstrap/unix-44/VT100.h +++ b/bootstrap/unix-44/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index e70c387c..76e386df 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index a6813769..2a8c5c12 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/Compiler.c b/bootstrap/unix-48/Compiler.c index 9d52cfc4..abb29dbf 100644 --- a/bootstrap/unix-48/Compiler.c +++ b/bootstrap/unix-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index 40f3ddee..0fe23200 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/11/14]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index 45384aa2..8821eec7 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index ea177995..c220d8a5 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index 1499df05..a97a0220 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index 85a52286..dc79f2c6 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index a40ef769..3d31f97c 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index 5fb74ad0..2632922b 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index 66c0c947..ef8a8c3b 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index f2e99ab3..bb87539a 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index 88ed3d3f..20ecca68 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 90df9e97..96d49e67 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index cfb3a8bf..a27ea6fd 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index a5afb71e..4e1b04a2 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -49,10 +49,11 @@ export void OPM_CloseFiles (void); export void OPM_CloseOldSym (void); export void OPM_DeleteNewSym (void); export void OPM_FPrint (INT32 *fp, INT64 val); -export void OPM_FPrintLReal (INT32 *fp, LONGREAL lr); -export void OPM_FPrintReal (INT32 *fp, REAL real); -export void OPM_FPrintSet (INT32 *fp, UINT64 set); +export void OPM_FPrintLReal (INT32 *fp, LONGREAL val); +export void OPM_FPrintReal (INT32 *fp, REAL val); +export void OPM_FPrintSet (INT32 *fp, UINT64 val); static void OPM_FindLine (Files_File f, Files_Rider *r, ADDRESS *r__typ, INT64 pos); +static void OPM_FingerprintBytes (INT32 *fp, SYSTEM_BYTE *bytes, LONGINT bytes__len); export void OPM_Get (CHAR *ch); export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); export void OPM_InitOptions (void); @@ -707,31 +708,37 @@ void OPM_err (INT16 n) OPM_Mark(n, OPM_errpos); } -void OPM_FPrint (INT32 *fp, INT64 val) -{ - *fp = __ROTL((INT32)((UINT32)*fp ^ __VAL(UINT32, val)), 1, 32); -} - -void OPM_FPrintSet (INT32 *fp, UINT64 set) -{ - OPM_FPrint(&*fp, __VAL(INT32, set)); -} - -void OPM_FPrintReal (INT32 *fp, REAL real) +static void OPM_FingerprintBytes (INT32 *fp, SYSTEM_BYTE *bytes, LONGINT bytes__len) { INT16 i; INT32 l; - __GET((ADDRESS)&real, l, INT32); - OPM_FPrint(&*fp, l); + __ASSERT(__MASK(bytes__len, -4) == 0, 0); + i = 0; + while (i < bytes__len) { + __GET((ADDRESS)&bytes[__X(i, bytes__len)], l, INT32); + *fp = __ROTL((INT32)((UINT32)*fp ^ (UINT32)l), 1, 32); + i += 4; + } } -void OPM_FPrintLReal (INT32 *fp, LONGREAL lr) +void OPM_FPrint (INT32 *fp, INT64 val) { - INT32 l, h; - __GET((ADDRESS)&lr, l, INT32); - __GET((ADDRESS)&lr + 4, h, INT32); - OPM_FPrint(&*fp, l); - OPM_FPrint(&*fp, h); + OPM_FingerprintBytes(&*fp, (void*)&val, 8); +} + +void OPM_FPrintSet (INT32 *fp, UINT64 val) +{ + OPM_FingerprintBytes(&*fp, (void*)&val, 8); +} + +void OPM_FPrintReal (INT32 *fp, REAL val) +{ + OPM_FingerprintBytes(&*fp, (void*)&val, 4); +} + +void OPM_FPrintLReal (INT32 *fp, LONGREAL val) +{ + OPM_FingerprintBytes(&*fp, (void*)&val, 8); } void OPM_SymRCh (CHAR *ch) diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index 4c5e13a8..17ae2fda 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h @@ -24,9 +24,9 @@ import void OPM_CloseFiles (void); import void OPM_CloseOldSym (void); import void OPM_DeleteNewSym (void); import void OPM_FPrint (INT32 *fp, INT64 val); -import void OPM_FPrintLReal (INT32 *fp, LONGREAL lr); -import void OPM_FPrintReal (INT32 *fp, REAL real); -import void OPM_FPrintSet (INT32 *fp, UINT64 set); +import void OPM_FPrintLReal (INT32 *fp, LONGREAL val); +import void OPM_FPrintReal (INT32 *fp, REAL val); +import void OPM_FPrintSet (INT32 *fp, UINT64 val); import void OPM_Get (CHAR *ch); import void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); import void OPM_InitOptions (void); diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index 3408b3cc..e1f6e651 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index 3ddbca21..272a545a 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index 91e3a136..0b2a09d7 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index bd0a0e9a..2cb37758 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 71a6bbe3..deae7082 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index 9850a22e..6c82f6b5 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index 2f149a8a..78becdbf 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index ebb01de2..dff88ffa 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Out.c b/bootstrap/unix-48/Out.c index 8cd71126..a4c3b892 100644 --- a/bootstrap/unix-48/Out.c +++ b/bootstrap/unix-48/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Out.h b/bootstrap/unix-48/Out.h index 144d7888..fd11d7ba 100644 --- a/bootstrap/unix-48/Out.h +++ b/bootstrap/unix-48/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index d2da38f5..6cb7767f 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index df398744..6ae68d6f 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 0eecd854..3445ecec 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index 1eaca8ec..035a9727 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index 48e0dd7f..2e536dda 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index 17369939..668261aa 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index b92f9c58..b3ef5a6d 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index 0b42a742..92886678 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/VT100.c b/bootstrap/unix-48/VT100.c index 909f4e92..2d8d0a2a 100644 --- a/bootstrap/unix-48/VT100.c +++ b/bootstrap/unix-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/VT100.h b/bootstrap/unix-48/VT100.h index 15dc50c5..ae8ad073 100644 --- a/bootstrap/unix-48/VT100.h +++ b/bootstrap/unix-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index e70c387c..76e386df 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index a6813769..2a8c5c12 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/Compiler.c b/bootstrap/unix-88/Compiler.c index 9d52cfc4..abb29dbf 100644 --- a/bootstrap/unix-88/Compiler.c +++ b/bootstrap/unix-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index 40f3ddee..0fe23200 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/11/14]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index 45384aa2..8821eec7 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 0a6a9df0..bf261994 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index ce408573..aec2d9e7 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index 00665676..9caec7dd 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index 3ab728a5..c62af8b2 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 8432576a..bdc60565 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index 66c0c947..ef8a8c3b 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index f2e99ab3..bb87539a 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index 88ed3d3f..20ecca68 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index 90df9e97..96d49e67 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index cfb3a8bf..a27ea6fd 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 5f5d6792..69d07404 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -49,10 +49,11 @@ export void OPM_CloseFiles (void); export void OPM_CloseOldSym (void); export void OPM_DeleteNewSym (void); export void OPM_FPrint (INT32 *fp, INT64 val); -export void OPM_FPrintLReal (INT32 *fp, LONGREAL lr); -export void OPM_FPrintReal (INT32 *fp, REAL real); -export void OPM_FPrintSet (INT32 *fp, UINT64 set); +export void OPM_FPrintLReal (INT32 *fp, LONGREAL val); +export void OPM_FPrintReal (INT32 *fp, REAL val); +export void OPM_FPrintSet (INT32 *fp, UINT64 val); static void OPM_FindLine (Files_File f, Files_Rider *r, ADDRESS *r__typ, INT64 pos); +static void OPM_FingerprintBytes (INT32 *fp, SYSTEM_BYTE *bytes, LONGINT bytes__len); export void OPM_Get (CHAR *ch); export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); export void OPM_InitOptions (void); @@ -707,31 +708,37 @@ void OPM_err (INT16 n) OPM_Mark(n, OPM_errpos); } -void OPM_FPrint (INT32 *fp, INT64 val) -{ - *fp = __ROTL((INT32)((UINT32)*fp ^ __VAL(UINT32, val)), 1, 32); -} - -void OPM_FPrintSet (INT32 *fp, UINT64 set) -{ - OPM_FPrint(&*fp, __VAL(INT32, set)); -} - -void OPM_FPrintReal (INT32 *fp, REAL real) +static void OPM_FingerprintBytes (INT32 *fp, SYSTEM_BYTE *bytes, LONGINT bytes__len) { INT16 i; INT32 l; - __GET((ADDRESS)&real, l, INT32); - OPM_FPrint(&*fp, l); + __ASSERT(__MASK(bytes__len, -4) == 0, 0); + i = 0; + while (i < bytes__len) { + __GET((ADDRESS)&bytes[__X(i, bytes__len)], l, INT32); + *fp = __ROTL((INT32)((UINT32)*fp ^ (UINT32)l), 1, 32); + i += 4; + } } -void OPM_FPrintLReal (INT32 *fp, LONGREAL lr) +void OPM_FPrint (INT32 *fp, INT64 val) { - INT32 l, h; - __GET((ADDRESS)&lr, l, INT32); - __GET((ADDRESS)&lr + 4, h, INT32); - OPM_FPrint(&*fp, l); - OPM_FPrint(&*fp, h); + OPM_FingerprintBytes(&*fp, (void*)&val, 8); +} + +void OPM_FPrintSet (INT32 *fp, UINT64 val) +{ + OPM_FingerprintBytes(&*fp, (void*)&val, 8); +} + +void OPM_FPrintReal (INT32 *fp, REAL val) +{ + OPM_FingerprintBytes(&*fp, (void*)&val, 4); +} + +void OPM_FPrintLReal (INT32 *fp, LONGREAL val) +{ + OPM_FingerprintBytes(&*fp, (void*)&val, 8); } void OPM_SymRCh (CHAR *ch) diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index 4c5e13a8..17ae2fda 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h @@ -24,9 +24,9 @@ import void OPM_CloseFiles (void); import void OPM_CloseOldSym (void); import void OPM_DeleteNewSym (void); import void OPM_FPrint (INT32 *fp, INT64 val); -import void OPM_FPrintLReal (INT32 *fp, LONGREAL lr); -import void OPM_FPrintReal (INT32 *fp, REAL real); -import void OPM_FPrintSet (INT32 *fp, UINT64 set); +import void OPM_FPrintLReal (INT32 *fp, LONGREAL val); +import void OPM_FPrintReal (INT32 *fp, REAL val); +import void OPM_FPrintSet (INT32 *fp, UINT64 val); import void OPM_Get (CHAR *ch); import void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); import void OPM_InitOptions (void); diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index 9ffb7fc8..05e74ff1 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index 3ddbca21..272a545a 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index 91e3a136..0b2a09d7 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index bd0a0e9a..2cb37758 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index 05d6a917..052b4ba3 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 9850a22e..6c82f6b5 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 9cda46a8..9857f122 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index ebb01de2..dff88ffa 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Out.c b/bootstrap/unix-88/Out.c index 8cd71126..a4c3b892 100644 --- a/bootstrap/unix-88/Out.c +++ b/bootstrap/unix-88/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Out.h b/bootstrap/unix-88/Out.h index 144d7888..fd11d7ba 100644 --- a/bootstrap/unix-88/Out.h +++ b/bootstrap/unix-88/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index d61c6c2d..a46330e3 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index 447f60be..21b3ac40 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 0eecd854..3445ecec 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index 1eaca8ec..035a9727 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index 48e0dd7f..2e536dda 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index 17369939..668261aa 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index cfce97a1..537d4d09 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index 9455890c..f408e854 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/VT100.c b/bootstrap/unix-88/VT100.c index 909f4e92..2d8d0a2a 100644 --- a/bootstrap/unix-88/VT100.c +++ b/bootstrap/unix-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/VT100.h b/bootstrap/unix-88/VT100.h index 15dc50c5..ae8ad073 100644 --- a/bootstrap/unix-88/VT100.h +++ b/bootstrap/unix-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index e70c387c..76e386df 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index a6813769..2a8c5c12 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/Compiler.c b/bootstrap/windows-48/Compiler.c index 9d52cfc4..abb29dbf 100644 --- a/bootstrap/windows-48/Compiler.c +++ b/bootstrap/windows-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index 40f3ddee..0fe23200 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/11/14]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index 45384aa2..8821eec7 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 25a6171e..cc2adfda 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index 689c8108..ac675d4d 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index 85a52286..dc79f2c6 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index a40ef769..3d31f97c 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index 5fb74ad0..2632922b 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index 66c0c947..ef8a8c3b 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index f2e99ab3..bb87539a 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index 88ed3d3f..20ecca68 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 90df9e97..96d49e67 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index cfb3a8bf..a27ea6fd 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index a5afb71e..4e1b04a2 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -49,10 +49,11 @@ export void OPM_CloseFiles (void); export void OPM_CloseOldSym (void); export void OPM_DeleteNewSym (void); export void OPM_FPrint (INT32 *fp, INT64 val); -export void OPM_FPrintLReal (INT32 *fp, LONGREAL lr); -export void OPM_FPrintReal (INT32 *fp, REAL real); -export void OPM_FPrintSet (INT32 *fp, UINT64 set); +export void OPM_FPrintLReal (INT32 *fp, LONGREAL val); +export void OPM_FPrintReal (INT32 *fp, REAL val); +export void OPM_FPrintSet (INT32 *fp, UINT64 val); static void OPM_FindLine (Files_File f, Files_Rider *r, ADDRESS *r__typ, INT64 pos); +static void OPM_FingerprintBytes (INT32 *fp, SYSTEM_BYTE *bytes, LONGINT bytes__len); export void OPM_Get (CHAR *ch); export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); export void OPM_InitOptions (void); @@ -707,31 +708,37 @@ void OPM_err (INT16 n) OPM_Mark(n, OPM_errpos); } -void OPM_FPrint (INT32 *fp, INT64 val) -{ - *fp = __ROTL((INT32)((UINT32)*fp ^ __VAL(UINT32, val)), 1, 32); -} - -void OPM_FPrintSet (INT32 *fp, UINT64 set) -{ - OPM_FPrint(&*fp, __VAL(INT32, set)); -} - -void OPM_FPrintReal (INT32 *fp, REAL real) +static void OPM_FingerprintBytes (INT32 *fp, SYSTEM_BYTE *bytes, LONGINT bytes__len) { INT16 i; INT32 l; - __GET((ADDRESS)&real, l, INT32); - OPM_FPrint(&*fp, l); + __ASSERT(__MASK(bytes__len, -4) == 0, 0); + i = 0; + while (i < bytes__len) { + __GET((ADDRESS)&bytes[__X(i, bytes__len)], l, INT32); + *fp = __ROTL((INT32)((UINT32)*fp ^ (UINT32)l), 1, 32); + i += 4; + } } -void OPM_FPrintLReal (INT32 *fp, LONGREAL lr) +void OPM_FPrint (INT32 *fp, INT64 val) { - INT32 l, h; - __GET((ADDRESS)&lr, l, INT32); - __GET((ADDRESS)&lr + 4, h, INT32); - OPM_FPrint(&*fp, l); - OPM_FPrint(&*fp, h); + OPM_FingerprintBytes(&*fp, (void*)&val, 8); +} + +void OPM_FPrintSet (INT32 *fp, UINT64 val) +{ + OPM_FingerprintBytes(&*fp, (void*)&val, 8); +} + +void OPM_FPrintReal (INT32 *fp, REAL val) +{ + OPM_FingerprintBytes(&*fp, (void*)&val, 4); +} + +void OPM_FPrintLReal (INT32 *fp, LONGREAL val) +{ + OPM_FingerprintBytes(&*fp, (void*)&val, 8); } void OPM_SymRCh (CHAR *ch) diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index 4c5e13a8..17ae2fda 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h @@ -24,9 +24,9 @@ import void OPM_CloseFiles (void); import void OPM_CloseOldSym (void); import void OPM_DeleteNewSym (void); import void OPM_FPrint (INT32 *fp, INT64 val); -import void OPM_FPrintLReal (INT32 *fp, LONGREAL lr); -import void OPM_FPrintReal (INT32 *fp, REAL real); -import void OPM_FPrintSet (INT32 *fp, UINT64 set); +import void OPM_FPrintLReal (INT32 *fp, LONGREAL val); +import void OPM_FPrintReal (INT32 *fp, REAL val); +import void OPM_FPrintSet (INT32 *fp, UINT64 val); import void OPM_Get (CHAR *ch); import void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); import void OPM_InitOptions (void); diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index 3408b3cc..e1f6e651 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index 3ddbca21..272a545a 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index 91e3a136..0b2a09d7 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index bd0a0e9a..2cb37758 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 71a6bbe3..deae7082 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index 9850a22e..6c82f6b5 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index 2f149a8a..78becdbf 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index ebb01de2..dff88ffa 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Out.c b/bootstrap/windows-48/Out.c index e5c33574..d5709f1e 100644 --- a/bootstrap/windows-48/Out.c +++ b/bootstrap/windows-48/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Out.h b/bootstrap/windows-48/Out.h index 144d7888..fd11d7ba 100644 --- a/bootstrap/windows-48/Out.h +++ b/bootstrap/windows-48/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 1c582348..2ea96476 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index 530f5a80..10ba64d7 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 0eecd854..3445ecec 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index 1eaca8ec..035a9727 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index 48e0dd7f..2e536dda 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index 17369939..668261aa 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index b92f9c58..b3ef5a6d 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index 0b42a742..92886678 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/VT100.c b/bootstrap/windows-48/VT100.c index 909f4e92..2d8d0a2a 100644 --- a/bootstrap/windows-48/VT100.c +++ b/bootstrap/windows-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/VT100.h b/bootstrap/windows-48/VT100.h index 15dc50c5..ae8ad073 100644 --- a/bootstrap/windows-48/VT100.h +++ b/bootstrap/windows-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index e70c387c..76e386df 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index a6813769..2a8c5c12 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/Compiler.c b/bootstrap/windows-88/Compiler.c index 9d52cfc4..abb29dbf 100644 --- a/bootstrap/windows-88/Compiler.c +++ b/bootstrap/windows-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index 40f3ddee..0fe23200 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/11/14]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index 45384aa2..8821eec7 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 8a1b02c3..7d967950 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index a798ac33..11437d58 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index 00665676..9caec7dd 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index 3ab728a5..c62af8b2 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 8432576a..bdc60565 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index 66c0c947..ef8a8c3b 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index f2e99ab3..bb87539a 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index 88ed3d3f..20ecca68 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index 90df9e97..96d49e67 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index cfb3a8bf..a27ea6fd 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 5f5d6792..69d07404 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -49,10 +49,11 @@ export void OPM_CloseFiles (void); export void OPM_CloseOldSym (void); export void OPM_DeleteNewSym (void); export void OPM_FPrint (INT32 *fp, INT64 val); -export void OPM_FPrintLReal (INT32 *fp, LONGREAL lr); -export void OPM_FPrintReal (INT32 *fp, REAL real); -export void OPM_FPrintSet (INT32 *fp, UINT64 set); +export void OPM_FPrintLReal (INT32 *fp, LONGREAL val); +export void OPM_FPrintReal (INT32 *fp, REAL val); +export void OPM_FPrintSet (INT32 *fp, UINT64 val); static void OPM_FindLine (Files_File f, Files_Rider *r, ADDRESS *r__typ, INT64 pos); +static void OPM_FingerprintBytes (INT32 *fp, SYSTEM_BYTE *bytes, LONGINT bytes__len); export void OPM_Get (CHAR *ch); export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); export void OPM_InitOptions (void); @@ -707,31 +708,37 @@ void OPM_err (INT16 n) OPM_Mark(n, OPM_errpos); } -void OPM_FPrint (INT32 *fp, INT64 val) -{ - *fp = __ROTL((INT32)((UINT32)*fp ^ __VAL(UINT32, val)), 1, 32); -} - -void OPM_FPrintSet (INT32 *fp, UINT64 set) -{ - OPM_FPrint(&*fp, __VAL(INT32, set)); -} - -void OPM_FPrintReal (INT32 *fp, REAL real) +static void OPM_FingerprintBytes (INT32 *fp, SYSTEM_BYTE *bytes, LONGINT bytes__len) { INT16 i; INT32 l; - __GET((ADDRESS)&real, l, INT32); - OPM_FPrint(&*fp, l); + __ASSERT(__MASK(bytes__len, -4) == 0, 0); + i = 0; + while (i < bytes__len) { + __GET((ADDRESS)&bytes[__X(i, bytes__len)], l, INT32); + *fp = __ROTL((INT32)((UINT32)*fp ^ (UINT32)l), 1, 32); + i += 4; + } } -void OPM_FPrintLReal (INT32 *fp, LONGREAL lr) +void OPM_FPrint (INT32 *fp, INT64 val) { - INT32 l, h; - __GET((ADDRESS)&lr, l, INT32); - __GET((ADDRESS)&lr + 4, h, INT32); - OPM_FPrint(&*fp, l); - OPM_FPrint(&*fp, h); + OPM_FingerprintBytes(&*fp, (void*)&val, 8); +} + +void OPM_FPrintSet (INT32 *fp, UINT64 val) +{ + OPM_FingerprintBytes(&*fp, (void*)&val, 8); +} + +void OPM_FPrintReal (INT32 *fp, REAL val) +{ + OPM_FingerprintBytes(&*fp, (void*)&val, 4); +} + +void OPM_FPrintLReal (INT32 *fp, LONGREAL val) +{ + OPM_FingerprintBytes(&*fp, (void*)&val, 8); } void OPM_SymRCh (CHAR *ch) diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index 4c5e13a8..17ae2fda 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h @@ -24,9 +24,9 @@ import void OPM_CloseFiles (void); import void OPM_CloseOldSym (void); import void OPM_DeleteNewSym (void); import void OPM_FPrint (INT32 *fp, INT64 val); -import void OPM_FPrintLReal (INT32 *fp, LONGREAL lr); -import void OPM_FPrintReal (INT32 *fp, REAL real); -import void OPM_FPrintSet (INT32 *fp, UINT64 set); +import void OPM_FPrintLReal (INT32 *fp, LONGREAL val); +import void OPM_FPrintReal (INT32 *fp, REAL val); +import void OPM_FPrintSet (INT32 *fp, UINT64 val); import void OPM_Get (CHAR *ch); import void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); import void OPM_InitOptions (void); diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index 9ffb7fc8..05e74ff1 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index 3ddbca21..272a545a 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index 91e3a136..0b2a09d7 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index bd0a0e9a..2cb37758 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index 05d6a917..052b4ba3 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 9850a22e..6c82f6b5 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 9cda46a8..9857f122 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index ebb01de2..dff88ffa 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Out.c b/bootstrap/windows-88/Out.c index e5c33574..d5709f1e 100644 --- a/bootstrap/windows-88/Out.c +++ b/bootstrap/windows-88/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Out.h b/bootstrap/windows-88/Out.h index 144d7888..fd11d7ba 100644 --- a/bootstrap/windows-88/Out.h +++ b/bootstrap/windows-88/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 0b4778fa..e120708e 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index 98f9604c..59418a88 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 0eecd854..3445ecec 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index 1eaca8ec..035a9727 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index 48e0dd7f..2e536dda 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index 17369939..668261aa 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index cfce97a1..537d4d09 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index 9455890c..f408e854 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/VT100.c b/bootstrap/windows-88/VT100.c index 909f4e92..2d8d0a2a 100644 --- a/bootstrap/windows-88/VT100.c +++ b/bootstrap/windows-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/VT100.h b/bootstrap/windows-88/VT100.h index 15dc50c5..ae8ad073 100644 --- a/bootstrap/windows-88/VT100.h +++ b/bootstrap/windows-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index e70c387c..76e386df 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index a6813769..2a8c5c12 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/src/compiler/OPM.Mod b/src/compiler/OPM.Mod index f0d5087b..0693359d 100644 --- a/src/compiler/OPM.Mod +++ b/src/compiler/OPM.Mod @@ -542,48 +542,29 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) END err; - PROCEDURE FPrint*(VAR fp: LONGINT; val: SYSTEM.INT64); + (* ------------------------ Fingerprint hashing ----------------------- *) + + PROCEDURE FingerprintBytes(VAR fp: LONGINT; VAR bytes: ARRAY OF SYSTEM.BYTE); + VAR i: INTEGER; l: LONGINT; BEGIN - fp := SYSTEM.ROT(SYSTEM.VAL(LONGINT, SYSTEM.VAL(SET, fp) / SYSTEM.VAL(SET, val)), 1) - END FPrint; - - - PROCEDURE FPrintSet*(VAR fp: LONGINT; set: SYSTEM.SET64); - BEGIN FPrint(fp, SYSTEM.VAL(LONGINT, set)) - END FPrintSet; - - - PROCEDURE FPrintReal*(VAR fp: LONGINT; real: REAL); - VAR i: INTEGER; l: LONGINT; - BEGIN - IF SIZE(REAL) = SIZE(INTEGER) THEN - SYSTEM.GET(SYSTEM.ADR(real), i); l := i; - ELSE - SYSTEM.GET(SYSTEM.ADR(real), l); - END; - FPrint(fp, l) - END FPrintReal; - - - PROCEDURE FPrintLReal*(VAR fp: LONGINT; lr: LONGREAL); - VAR l, h: LONGINT; - BEGIN - IF SIZE(LONGREAL) = SIZE(LONGINT) THEN - (* 64 bit LONGINT *) - FPrint(fp, SYSTEM.VAL(LONGINT, lr)) - ELSE - (* 32 bit LONGINT *) - SYSTEM.GET(SYSTEM.ADR(lr), l); SYSTEM.GET(SYSTEM.ADR(lr)+4, h); - FPrint(fp, l); FPrint(fp, h) + ASSERT(LEN(bytes) MOD SIZE(LONGINT) = 0); + i := 0; WHILE i < LEN(bytes) DO + SYSTEM.GET(SYSTEM.ADR(bytes[i]), l); + fp := SYSTEM.ROT(SYSTEM.VAL(LONGINT, SYSTEM.VAL(SET, fp) / SYSTEM.VAL(SET, l)), 1); + INC(i, SIZE(LONGINT)) END - END FPrintLReal; + END FingerprintBytes; + + PROCEDURE FPrint* (VAR fp: LONGINT; val: HUGEINT); BEGIN FingerprintBytes(fp, val) END FPrint; + PROCEDURE FPrintSet* (VAR fp: LONGINT; val: SYSTEM.SET64); BEGIN FingerprintBytes(fp, val) END FPrintSet; + PROCEDURE FPrintReal* (VAR fp: LONGINT; val: REAL); BEGIN FingerprintBytes(fp, val) END FPrintReal; + PROCEDURE FPrintLReal*(VAR fp: LONGINT; val: LONGREAL); BEGIN FingerprintBytes(fp, val) END FPrintLReal; (* ------------------------- Read Symbol File ------------------------- *) - PROCEDURE SymRCh*(VAR ch: CHAR); BEGIN Files.Read(oldSF, ch) END SymRCh; diff --git a/src/runtime/Errors.Txt b/src/runtime/Errors.Txt index bafaba66..a5cea1f1 100644 --- a/src/runtime/Errors.Txt +++ b/src/runtime/Errors.Txt @@ -175,6 +175,7 @@ Compiler Warnings 301 implicit type cast 306 inappropriate symbol file ignored 307 no ELSE symbol after CASE statement sequence may lead to trap +308 SYSTEM.VAL result includes memory past end of source variable; use SYSTEM.GET Run-time Error Messages -1 assertion failed, cf. SYSTEM_assert From 6da0d5d685314cce281fd8a2bf32b8bfa765137b Mon Sep 17 00:00:00 2001 From: David Brown Date: Tue, 15 Nov 2016 17:33:05 +0000 Subject: [PATCH 323/580] Build with colour output when on a tty/console. --- src/compiler/OPM.Mod | 20 +- src/runtime/Out.Mod | 12 +- src/runtime/Platformunix.Mod | 8 +- src/runtime/Platformwindows.Mod | 5 + src/test/confidence/intsyntax/expected | 12 +- src/test/confidence/intsyntax/test.sh | 2 +- src/tools/make/oberon.mk | 312 ++++++++++++------------- 7 files changed, 195 insertions(+), 176 deletions(-) diff --git a/src/compiler/OPM.Mod b/src/compiler/OPM.Mod index 0693359d..7c0892fa 100644 --- a/src/compiler/OPM.Mod +++ b/src/compiler/OPM.Mod @@ -129,6 +129,12 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) PROCEDURE LogWNum*(i, len: SYSTEM.INT64); BEGIN Out.Int(i, len) END LogWNum; PROCEDURE LogWLn*; BEGIN Out.Ln END LogWLn; + PROCEDURE LogVT100(vt100code: ARRAY OF CHAR); + BEGIN + IF Out.IsConsole & ~(notcoloroutput IN Options) THEN + VT100.SetAttr(vt100code) + END + END LogVT100; @@ -423,14 +429,10 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) VAR l: INTEGER; S: Texts.Scanner; c: CHAR; BEGIN IF n >= 0 THEN - IF ~(notcoloroutput IN Options) THEN VT100.SetAttr(VT100.Red) END; - LogWStr(" err "); - IF ~(notcoloroutput IN Options) THEN VT100.SetAttr(VT100.ResetAll) END; + LogVT100(VT100.Red); LogWStr(" err "); LogVT100(VT100.ResetAll) ELSE - IF ~(notcoloroutput IN Options) THEN VT100.SetAttr(VT100.Magenta) END; - LogWStr(" warning "); n := -n; - IF ~(notcoloroutput IN Options) THEN VT100.SetAttr(VT100.ResetAll) END; - END ; + LogVT100(VT100.Magenta); LogWStr(" warning "); n := -n; LogVT100(VT100.ResetAll) + END; LogWNum(n, 1); LogWStr(" "); @@ -503,9 +505,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) i := SHORT(Longint(pos - ErrorLineStartPos)); WHILE i > 0 DO LogW(" "); DEC(i) END; - IF ~(notcoloroutput IN Options) THEN VT100.SetAttr(VT100.Green) END; - LogW("^"); - IF ~(notcoloroutput IN Options) THEN VT100.SetAttr(VT100.ResetAll) END; + LogVT100(VT100.Green); LogW("^"); LogVT100(VT100.ResetAll); Files.Close(f); END ShowLine; diff --git a/src/runtime/Out.Mod b/src/runtime/Out.Mod index 0dc4ed27..9564f275 100644 --- a/src/runtime/Out.Mod +++ b/src/runtime/Out.Mod @@ -2,7 +2,13 @@ MODULE Out; (* DCW Brown. 2016-09-27 *) IMPORT SYSTEM, Platform; -VAR buf: ARRAY 128 OF CHAR; in: INTEGER; +VAR + IsConsole-: BOOLEAN; + + buf: ARRAY 128 OF CHAR; + in: INTEGER; + + PROCEDURE Flush*; VAR error: Platform.ErrorCode; @@ -199,5 +205,7 @@ PROCEDURE LongReal*(x: LONGREAL; n: INTEGER); BEGIN RealP(x, n, TRUE); END LongReal; -BEGIN in := 0 +BEGIN + IsConsole := Platform.IsConsole(Platform.StdOut); + in := 0 END Out. diff --git a/src/runtime/Platformunix.Mod b/src/runtime/Platformunix.Mod index 27ce9539..fa22d7ee 100644 --- a/src/runtime/Platformunix.Mod +++ b/src/runtime/Platformunix.Mod @@ -303,7 +303,7 @@ END New; -PROCEDURE -closefile (fd: LONGINT): INTEGER "close(fd)"; +PROCEDURE -closefile(fd: LONGINT): INTEGER "close(fd)"; PROCEDURE Close*(h: FileHandle): ErrorCode; BEGIN @@ -311,6 +311,12 @@ BEGIN END Close; +PROCEDURE -isatty(fd: LONGINT): INTEGER "isatty(fd)"; + +PROCEDURE IsConsole*(h: FileHandle): BOOLEAN; +BEGIN RETURN isatty(h) # 0 END IsConsole; + + PROCEDURE -fstat(fd: LONGINT): INTEGER "fstat(fd, &s)"; PROCEDURE -stat(n: ARRAY OF CHAR): INTEGER "stat((char*)n, &s)"; diff --git a/src/runtime/Platformwindows.Mod b/src/runtime/Platformwindows.Mod index 937c1da0..6a80bff4 100644 --- a/src/runtime/Platformwindows.Mod +++ b/src/runtime/Platformwindows.Mod @@ -539,6 +539,11 @@ VAR mode: SYSTEM.INT32; BEGIN IF GetConsoleMode(StdOut, mode) THEN SetConsoleMode(StdOut, mode+VTprocessing) END END EnableVT100; +PROCEDURE IsConsole*(h: FileHandle): BOOLEAN; +VAR mode: SYSTEM.INT32; +BEGIN RETURN GetConsoleMode(StdOut, mode) +END IsConsole; + PROCEDURE TestLittleEndian; VAR i: INTEGER; diff --git a/src/test/confidence/intsyntax/expected b/src/test/confidence/intsyntax/expected index 82813b89..1abe43f9 100644 --- a/src/test/confidence/intsyntax/expected +++ b/src/test/confidence/intsyntax/expected @@ -1,15 +1,15 @@ IntSyntax.mod compiling IntSyntax. 14: i := l; (* Bad, INTEGER shorter than LONGINT *) - ^ - pos 341 err 113 incompatible assignment + ^ + pos 341 err 113 incompatible assignment 15: s := l; (* Bad, SHORTINT shorter than LONGINT *) - ^ - pos 393 err 113 incompatible assignment + ^ + pos 393 err 113 incompatible assignment 16: i := l; (* Bad, SHORTINT shorter than INTEGER *) - ^ - pos 446 err 113 incompatible assignment + ^ + pos 446 err 113 incompatible assignment Module compilation failed. diff --git a/src/test/confidence/intsyntax/test.sh b/src/test/confidence/intsyntax/test.sh index 7699daea..3929cc8c 100644 --- a/src/test/confidence/intsyntax/test.sh +++ b/src/test/confidence/intsyntax/test.sh @@ -1,5 +1,5 @@ #!/bin/sh . ../testenv.sh # Generate mixed source and assembly code listing -$OBECOMP IntSyntax.mod -m >result +$OBECOMP IntSyntax.mod -fm >result . ../testresult.sh diff --git a/src/tools/make/oberon.mk b/src/tools/make/oberon.mk index ebbbe417..796cb8d5 100644 --- a/src/tools/make/oberon.mk +++ b/src/tools/make/oberon.mk @@ -103,25 +103,25 @@ translate: @mkdir -p $(BUILDDIR) @rm -f $(BUILDDIR)/*.sym - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../Configuration.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Platform$(PLATFORM).Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfFapx -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Heap.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Strings.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Out.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Modules.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfFx -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Files.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Reals.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Texts.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/VT100.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/OPM.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/extTools.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfFx -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/OPS.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/OPT.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/OPC.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/OPV.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/OPB.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/OPP.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ssfm -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/Compiler.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../Configuration.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Platform$(PLATFORM).Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsFapx -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Heap.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Strings.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Out.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Modules.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsFx -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Files.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Reals.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Texts.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/VT100.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/OPM.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/extTools.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsFx -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/OPS.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/OPT.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/OPC.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/OPV.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/OPB.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/OPP.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ssm -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/Compiler.Mod cp src/runtime/*.[ch] $(BUILDDIR) cp src/runtime/*.Txt $(BUILDDIR) @@ -132,8 +132,8 @@ translate: browsercmd: @printf "\nMaking symbol browser\n" - @cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ssf -O$(MODEL) ../../src/runtime/Oberon.Mod - @cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Smf -O$(MODEL) ../../src/tools/browser/BrowserCmd.Mod + @cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ss -O$(MODEL) ../../src/runtime/Oberon.Mod + @cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Sm -O$(MODEL) ../../src/tools/browser/BrowserCmd.Mod @cd $(BUILDDIR); $(COMPILE) BrowserCmd.c Oberon.c -o showdef \ Platform.o Texts.o OPT.o Heap.o Out.o SYSTEM.o OPM.o OPS.o OPV.o \ Files.o Reals.o Modules.o VT100.o Configuration.o Strings.o \ @@ -199,166 +199,166 @@ uninstall: runtime: @printf "\nMaking run time library for -O$(MODEL)\n" - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Platform$(PLATFORM).Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Heap.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Modules.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Strings.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Out.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/In.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/VT100.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Files.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Math.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/MathL.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Reals.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Texts.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Oberon.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/runtime/Platform$(PLATFORM).Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/runtime/Heap.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/runtime/Modules.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/runtime/Strings.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/runtime/Out.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/runtime/In.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/runtime/VT100.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/runtime/Files.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/runtime/Math.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/runtime/MathL.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/runtime/Reals.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/runtime/Texts.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/runtime/Oberon.Mod v4: @printf "\nMaking v4 library for -O$(MODEL)\n" - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/v4/Args.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/v4/Console.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/v4/Printer.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/v4/Sets.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/v4/Args.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/v4/Console.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/v4/Printer.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/v4/Sets.Mod ooc2: @printf "\nMaking ooc2 library for -O$(MODEL)\n" - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc2/ooc2Strings.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc2/ooc2Ascii.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc2/ooc2CharClass.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc2/ooc2ConvTypes.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc2/ooc2IntConv.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc2/ooc2IntStr.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc2/ooc2Real0.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc2/ooc2Strings.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc2/ooc2Ascii.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc2/ooc2CharClass.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc2/ooc2ConvTypes.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc2/ooc2IntConv.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc2/ooc2IntStr.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc2/ooc2Real0.Mod ooc: @printf "\nMaking ooc library for -O$(MODEL)\n" - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocLowReal.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocLowLReal.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocRealMath.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocOakMath.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocLRealMath.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocLongInts.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocComplexMath.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocLComplexMath.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocAscii.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocCharClass.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocStrings.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocConvTypes.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocLRealConv.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocLRealStr.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocRealConv.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocRealStr.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocIntConv.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocIntStr.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocMsg.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocSysClock.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocTime.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocChannel.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocStrings2.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocRts.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocFilenames.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocTextRider.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocBinaryRider.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocJulianDay.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocFilenames.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocwrapperlibc.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocC$(DATAMODEL).Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc/oocLowReal.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc/oocLowLReal.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc/oocRealMath.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc/oocOakMath.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc/oocLRealMath.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc/oocLongInts.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc/oocComplexMath.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc/oocLComplexMath.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc/oocAscii.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc/oocCharClass.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc/oocStrings.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc/oocConvTypes.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc/oocLRealConv.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc/oocLRealStr.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc/oocRealConv.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc/oocRealStr.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc/oocIntConv.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc/oocIntStr.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc/oocMsg.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc/oocSysClock.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc/oocTime.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc/oocChannel.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc/oocStrings2.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc/oocRts.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc/oocFilenames.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc/oocTextRider.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc/oocBinaryRider.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc/oocJulianDay.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc/oocFilenames.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc/oocwrapperlibc.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc/oocC$(DATAMODEL).Mod oocX11: @printf "\nMaking oocX11 library for -O$(MODEL)\n" - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/oocX11/oocX11.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/oocX11/oocXutil.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/oocX11/oocXYplane.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/oocX11/oocX11.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/oocX11/oocXutil.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/oocX11/oocXYplane.Mod ulm: @printf "\nMaking ulm library for -O$(MODEL)\n" - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmObjects.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmPriorities.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmDisciplines.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmServices.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmSys.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmSYSTEM.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmEvents.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmProcess.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmResources.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmForwarders.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmRelatedEvents.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmTypes.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmStreams.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmStrings.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmSysTypes.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmTexts.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmSysConversions.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmErrors.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmSysErrors.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmSysStat.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmASCII.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmSets.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmIO.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmAssertions.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmIndirectDisciplines.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmStreamDisciplines.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmIEEE.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmMC68881.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmReals.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmPrint.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmWrite.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmConstStrings.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmPlotters.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmSysIO.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmLoader.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmNetIO.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmPersistentObjects.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmPersistentDisciplines.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmOperations.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmScales.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmTimes.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmClocks.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmTimers.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmConditions.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmStreamConditions.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmTimeConditions.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmCiphers.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmCipherOps.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmBlockCiphers.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmAsymmetricCiphers.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmConclusions.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmRandomGenerators.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmTCrypt.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmIntOperations.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmObjects.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmPriorities.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmDisciplines.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmServices.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmSys.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmSYSTEM.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmEvents.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmProcess.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmResources.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmForwarders.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmRelatedEvents.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmTypes.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmStreams.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmStrings.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmSysTypes.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmTexts.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmSysConversions.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmErrors.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmSysErrors.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmSysStat.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmASCII.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmSets.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmIO.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmAssertions.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmIndirectDisciplines.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmStreamDisciplines.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmIEEE.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmMC68881.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmReals.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmPrint.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmWrite.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmConstStrings.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmPlotters.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmSysIO.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmLoader.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmNetIO.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmPersistentObjects.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmPersistentDisciplines.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmOperations.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmScales.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmTimes.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmClocks.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmTimers.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmConditions.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmStreamConditions.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmTimeConditions.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmCiphers.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmCipherOps.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmBlockCiphers.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmAsymmetricCiphers.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmConclusions.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmRandomGenerators.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmTCrypt.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmIntOperations.Mod pow32: @printf "\nMaking pow library for -O$(MODEL)\n" - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/pow/powStrings.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/pow/powStrings.Mod misc: @printf "\nMaking misc library for -O$(MODEL)\n" - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/misc/crt.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/misc/Listen.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/misc/MersenneTwister.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/misc/MultiArrays.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/misc/MultiArrayRiders.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/misc/crt.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/misc/Listen.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/misc/MersenneTwister.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/misc/MultiArrays.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/misc/MultiArrayRiders.Mod s3: @printf "\nMaking s3 library for -O$(MODEL)\n" - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/s3/ethBTrees.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/s3/ethMD5.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/s3/ethSets.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/s3/ethZlib.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/s3/ethZlibBuffers.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/s3/ethZlibInflate.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/s3/ethZlibDeflate.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/s3/ethZlibReaders.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/s3/ethZlibWriters.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/s3/ethZip.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/s3/ethRandomNumbers.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/s3/ethGZReaders.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/s3/ethGZWriters.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/s3/ethUnicode.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/s3/ethDates.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/s3/ethReals.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/s3/ethStrings.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/s3/ethBTrees.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/s3/ethMD5.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/s3/ethSets.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/s3/ethZlib.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/s3/ethZlibBuffers.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/s3/ethZlibInflate.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/s3/ethZlibDeflate.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/s3/ethZlibReaders.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/s3/ethZlibWriters.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/s3/ethZip.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/s3/ethRandomNumbers.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/s3/ethGZReaders.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/s3/ethGZWriters.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/s3/ethUnicode.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/s3/ethDates.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/s3/ethReals.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/s3/ethStrings.Mod From c12aae020dd344234cd293351b20a54aa54cff2f Mon Sep 17 00:00:00 2001 From: David Brown Date: Tue, 15 Nov 2016 18:03:57 +0000 Subject: [PATCH 324/580] Add IsConsole tests to compiler.mod, update bootstrap. --- bootstrap/unix-44/Compiler.c | 18 ++++---------- bootstrap/unix-44/Configuration.c | 2 +- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Files.c | 2 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 2 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 2 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 36 +++++++++++++--------------- bootstrap/unix-44/OPM.h | 3 ++- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 2 +- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 2 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Out.c | 4 +++- bootstrap/unix-44/Out.h | 3 ++- bootstrap/unix-44/Platform.c | 9 ++++++- bootstrap/unix-44/Platform.h | 3 ++- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/VT100.c | 2 +- bootstrap/unix-44/VT100.h | 2 +- bootstrap/unix-44/extTools.c | 2 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-48/Compiler.c | 18 ++++---------- bootstrap/unix-48/Configuration.c | 2 +- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Files.c | 2 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 2 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 2 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 36 +++++++++++++--------------- bootstrap/unix-48/OPM.h | 3 ++- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 2 +- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 2 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Out.c | 4 +++- bootstrap/unix-48/Out.h | 3 ++- bootstrap/unix-48/Platform.c | 9 ++++++- bootstrap/unix-48/Platform.h | 3 ++- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/VT100.c | 2 +- bootstrap/unix-48/VT100.h | 2 +- bootstrap/unix-48/extTools.c | 2 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-88/Compiler.c | 18 ++++---------- bootstrap/unix-88/Configuration.c | 2 +- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Files.c | 2 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 2 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 2 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 36 +++++++++++++--------------- bootstrap/unix-88/OPM.h | 3 ++- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 2 +- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 2 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Out.c | 4 +++- bootstrap/unix-88/Out.h | 3 ++- bootstrap/unix-88/Platform.c | 9 ++++++- bootstrap/unix-88/Platform.h | 3 ++- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/VT100.c | 2 +- bootstrap/unix-88/VT100.h | 2 +- bootstrap/unix-88/extTools.c | 2 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/windows-48/Compiler.c | 18 ++++---------- bootstrap/windows-48/Configuration.c | 2 +- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Files.c | 2 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 2 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 2 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 36 +++++++++++++--------------- bootstrap/windows-48/OPM.h | 3 ++- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 2 +- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 2 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Out.c | 4 +++- bootstrap/windows-48/Out.h | 3 ++- bootstrap/windows-48/Platform.c | 9 ++++++- bootstrap/windows-48/Platform.h | 3 ++- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/VT100.c | 2 +- bootstrap/windows-48/VT100.h | 2 +- bootstrap/windows-48/extTools.c | 2 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-88/Compiler.c | 18 ++++---------- bootstrap/windows-88/Configuration.c | 2 +- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Files.c | 2 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 2 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 2 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 36 +++++++++++++--------------- bootstrap/windows-88/OPM.h | 3 ++- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 2 +- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 2 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Out.c | 4 +++- bootstrap/windows-88/Out.h | 3 ++- bootstrap/windows-88/Platform.c | 9 ++++++- bootstrap/windows-88/Platform.h | 3 ++- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/VT100.c | 2 +- bootstrap/windows-88/VT100.h | 2 +- bootstrap/windows-88/extTools.c | 2 +- bootstrap/windows-88/extTools.h | 2 +- src/compiler/Compiler.Mod | 8 ++----- src/compiler/OPM.Mod | 2 +- 187 files changed, 348 insertions(+), 342 deletions(-) diff --git a/bootstrap/unix-44/Compiler.c b/bootstrap/unix-44/Compiler.c index abb29dbf..ef5126fc 100644 --- a/bootstrap/unix-44/Compiler.c +++ b/bootstrap/unix-44/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 @@ -46,22 +46,14 @@ void Compiler_Module (BOOLEAN *done) if (OPM_noerr) { if ((__IN(10, OPM_Options, 32) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { OPM_DeleteNewSym(); - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"32m", 4); - } + OPM_LogVT100((CHAR*)"32m", 4); OPM_LogWStr((CHAR*)" Main program.", 16); - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"0m", 3); - } + OPM_LogVT100((CHAR*)"0m", 3); } else { if (new) { - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"32m", 4); - } + OPM_LogVT100((CHAR*)"32m", 4); OPM_LogWStr((CHAR*)" New symbol file.", 19); - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"0m", 3); - } + OPM_LogVT100((CHAR*)"0m", 3); OPM_RegisterNewSym(); } else if (ext) { OPM_LogWStr((CHAR*)" Extended symbol file.", 24); diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index 0fe23200..8dee54dd 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index 8821eec7..68bf9ed7 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index c220d8a5..428cf3db 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index a97a0220..4c861f05 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index dc79f2c6..be352cc8 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index 3d31f97c..620c600d 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index 2632922b..e2a62e9c 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index ef8a8c3b..2ec0e428 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index bb87539a..adda3018 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index 20ecca68..d59b8602 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 96d49e67..e92faf91 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index a27ea6fd..eede7b95 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 4e1b04a2..63faf68d 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -59,6 +59,7 @@ export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); export void OPM_InitOptions (void); export INT16 OPM_Integer (INT64 n); static void OPM_LogErrMsg (INT16 n); +export void OPM_LogVT100 (CHAR *vt100code, LONGINT vt100code__len); export void OPM_LogW (CHAR ch); export void OPM_LogWLn (void); export void OPM_LogWNum (INT64 i, INT64 len); @@ -121,6 +122,15 @@ void OPM_LogWLn (void) Out_Ln(); } +void OPM_LogVT100 (CHAR *vt100code, LONGINT vt100code__len) +{ + __DUP(vt100code, vt100code__len, CHAR); + if ((Out_IsConsole && !__IN(16, OPM_Options, 32))) { + VT100_SetAttr(vt100code, vt100code__len); + } + __DEL(vt100code); +} + INT64 OPM_SignedMaximum (INT32 bytecount) { INT64 result; @@ -540,22 +550,14 @@ static void OPM_LogErrMsg (INT16 n) Texts_Scanner S; CHAR c; if (n >= 0) { - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"31m", 4); - } + OPM_LogVT100((CHAR*)"31m", 4); OPM_LogWStr((CHAR*)" err ", 7); - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"0m", 3); - } + OPM_LogVT100((CHAR*)"0m", 3); } else { - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"35m", 4); - } + OPM_LogVT100((CHAR*)"35m", 4); OPM_LogWStr((CHAR*)" warning ", 11); n = -n; - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"0m", 3); - } + OPM_LogVT100((CHAR*)"0m", 3); } OPM_LogWNum(n, 1); OPM_LogWStr((CHAR*)" ", 3); @@ -641,13 +643,9 @@ static void OPM_ShowLine (INT64 pos) OPM_LogW(' '); i -= 1; } - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"32m", 4); - } + OPM_LogVT100((CHAR*)"32m", 4); OPM_LogW('^'); - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"0m", 3); - } + OPM_LogVT100((CHAR*)"0m", 3); Files_Close(f); } diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index 17ae2fda..2e875d8f 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h @@ -31,6 +31,7 @@ import void OPM_Get (CHAR *ch); import void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); import void OPM_InitOptions (void); import INT16 OPM_Integer (INT64 n); +import void OPM_LogVT100 (CHAR *vt100code, LONGINT vt100code__len); import void OPM_LogW (CHAR ch); import void OPM_LogWLn (void); import void OPM_LogWNum (INT64 i, INT64 len); diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index e1f6e651..ffc41784 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index 272a545a..960ea29e 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index 0b2a09d7..72d77adb 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index 2cb37758..92740884 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index 93bf36ce..d5d3297d 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index 6c82f6b5..b6ecef0e 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index 78becdbf..7eb931aa 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index dff88ffa..ad0a4e1c 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Out.c b/bootstrap/unix-44/Out.c index a4c3b892..bc314d4d 100644 --- a/bootstrap/unix-44/Out.c +++ b/bootstrap/unix-44/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -9,6 +9,7 @@ #include "Platform.h" +export BOOLEAN Out_IsConsole; static CHAR Out_buf[128]; static INT16 Out_in; @@ -311,6 +312,7 @@ export void *Out__init(void) __REGCMD("Ln", Out_Ln); __REGCMD("Open", Out_Open); /* BEGIN */ + Out_IsConsole = Platform_IsConsole(1); Out_in = 0; __ENDMOD; } diff --git a/bootstrap/unix-44/Out.h b/bootstrap/unix-44/Out.h index fd11d7ba..e3b542f1 100644 --- a/bootstrap/unix-44/Out.h +++ b/bootstrap/unix-44/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h @@ -6,6 +6,7 @@ #include "SYSTEM.h" +import BOOLEAN Out_IsConsole; import void Out_Char (CHAR ch); diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 6cb7767f..f58bb07a 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -63,6 +63,7 @@ export INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIden export BOOLEAN Platform_Inaccessible (INT16 e); export void Platform_Init (INT32 argc, INT32 argvadr); export BOOLEAN Platform_Interrupted (INT16 e); +export BOOLEAN Platform_IsConsole (INT32 h); export void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d); export INT16 Platform_New (CHAR *n, LONGINT n__len, INT32 *h); export BOOLEAN Platform_NoSuchDirectory (INT16 e); @@ -131,6 +132,7 @@ extern void Heap_InitHeap(); #define Platform_getenv(var, var__len) (Platform_EnvPtr)getenv((char*)var) #define Platform_getpid() (INTEGER)getpid() #define Platform_gettimeval() struct timeval tv; gettimeofday(&tv,0) +#define Platform_isatty(fd) isatty(fd) #define Platform_lseek(fd, o, w) lseek(fd, o, w) #define Platform_nanosleep(s, ns) struct timespec req, rem; req.tv_sec = s; req.tv_nsec = ns; nanosleep(&req, &rem) #define Platform_opennew(n, n__len) open((char*)n, O_CREAT | O_TRUNC | O_RDWR, 0664) @@ -404,6 +406,11 @@ INT16 Platform_Close (INT32 h) __RETCHK; } +BOOLEAN Platform_IsConsole (INT32 h) +{ + return Platform_isatty(h) != 0; +} + INT16 Platform_Identify (INT32 h, Platform_FileIdentity *identity, ADDRESS *identity__typ) { Platform_structstats(); diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index 6ae68d6f..0a85488d 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h @@ -45,6 +45,7 @@ import INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIden import BOOLEAN Platform_Inaccessible (INT16 e); import void Platform_Init (INT32 argc, INT32 argvadr); import BOOLEAN Platform_Interrupted (INT16 e); +import BOOLEAN Platform_IsConsole (INT32 h); import void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d); import INT16 Platform_New (CHAR *n, LONGINT n__len, INT32 *h); import BOOLEAN Platform_NoSuchDirectory (INT16 e); diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 3445ecec..e532c10a 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index 035a9727..9e6d921e 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index 2e536dda..5921a597 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index 668261aa..c8760025 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index 8688df84..f661a75f 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index 08d97e8d..883fba9f 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/VT100.c b/bootstrap/unix-44/VT100.c index 2d8d0a2a..8b786199 100644 --- a/bootstrap/unix-44/VT100.c +++ b/bootstrap/unix-44/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/VT100.h b/bootstrap/unix-44/VT100.h index ae8ad073..ca8fd2fa 100644 --- a/bootstrap/unix-44/VT100.h +++ b/bootstrap/unix-44/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index 76e386df..e1cc07ba 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index 2a8c5c12..c31ea618 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/Compiler.c b/bootstrap/unix-48/Compiler.c index abb29dbf..ef5126fc 100644 --- a/bootstrap/unix-48/Compiler.c +++ b/bootstrap/unix-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 @@ -46,22 +46,14 @@ void Compiler_Module (BOOLEAN *done) if (OPM_noerr) { if ((__IN(10, OPM_Options, 32) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { OPM_DeleteNewSym(); - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"32m", 4); - } + OPM_LogVT100((CHAR*)"32m", 4); OPM_LogWStr((CHAR*)" Main program.", 16); - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"0m", 3); - } + OPM_LogVT100((CHAR*)"0m", 3); } else { if (new) { - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"32m", 4); - } + OPM_LogVT100((CHAR*)"32m", 4); OPM_LogWStr((CHAR*)" New symbol file.", 19); - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"0m", 3); - } + OPM_LogVT100((CHAR*)"0m", 3); OPM_RegisterNewSym(); } else if (ext) { OPM_LogWStr((CHAR*)" Extended symbol file.", 24); diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index 0fe23200..8dee54dd 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index 8821eec7..68bf9ed7 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index c220d8a5..428cf3db 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index a97a0220..4c861f05 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index dc79f2c6..be352cc8 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index 3d31f97c..620c600d 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index 2632922b..e2a62e9c 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index ef8a8c3b..2ec0e428 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index bb87539a..adda3018 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index 20ecca68..d59b8602 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 96d49e67..e92faf91 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index a27ea6fd..eede7b95 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 4e1b04a2..63faf68d 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -59,6 +59,7 @@ export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); export void OPM_InitOptions (void); export INT16 OPM_Integer (INT64 n); static void OPM_LogErrMsg (INT16 n); +export void OPM_LogVT100 (CHAR *vt100code, LONGINT vt100code__len); export void OPM_LogW (CHAR ch); export void OPM_LogWLn (void); export void OPM_LogWNum (INT64 i, INT64 len); @@ -121,6 +122,15 @@ void OPM_LogWLn (void) Out_Ln(); } +void OPM_LogVT100 (CHAR *vt100code, LONGINT vt100code__len) +{ + __DUP(vt100code, vt100code__len, CHAR); + if ((Out_IsConsole && !__IN(16, OPM_Options, 32))) { + VT100_SetAttr(vt100code, vt100code__len); + } + __DEL(vt100code); +} + INT64 OPM_SignedMaximum (INT32 bytecount) { INT64 result; @@ -540,22 +550,14 @@ static void OPM_LogErrMsg (INT16 n) Texts_Scanner S; CHAR c; if (n >= 0) { - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"31m", 4); - } + OPM_LogVT100((CHAR*)"31m", 4); OPM_LogWStr((CHAR*)" err ", 7); - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"0m", 3); - } + OPM_LogVT100((CHAR*)"0m", 3); } else { - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"35m", 4); - } + OPM_LogVT100((CHAR*)"35m", 4); OPM_LogWStr((CHAR*)" warning ", 11); n = -n; - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"0m", 3); - } + OPM_LogVT100((CHAR*)"0m", 3); } OPM_LogWNum(n, 1); OPM_LogWStr((CHAR*)" ", 3); @@ -641,13 +643,9 @@ static void OPM_ShowLine (INT64 pos) OPM_LogW(' '); i -= 1; } - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"32m", 4); - } + OPM_LogVT100((CHAR*)"32m", 4); OPM_LogW('^'); - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"0m", 3); - } + OPM_LogVT100((CHAR*)"0m", 3); Files_Close(f); } diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index 17ae2fda..2e875d8f 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h @@ -31,6 +31,7 @@ import void OPM_Get (CHAR *ch); import void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); import void OPM_InitOptions (void); import INT16 OPM_Integer (INT64 n); +import void OPM_LogVT100 (CHAR *vt100code, LONGINT vt100code__len); import void OPM_LogW (CHAR ch); import void OPM_LogWLn (void); import void OPM_LogWNum (INT64 i, INT64 len); diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index e1f6e651..ffc41784 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index 272a545a..960ea29e 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index 0b2a09d7..72d77adb 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index 2cb37758..92740884 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index deae7082..a80a5307 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index 6c82f6b5..b6ecef0e 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index 78becdbf..7eb931aa 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index dff88ffa..ad0a4e1c 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Out.c b/bootstrap/unix-48/Out.c index a4c3b892..bc314d4d 100644 --- a/bootstrap/unix-48/Out.c +++ b/bootstrap/unix-48/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -9,6 +9,7 @@ #include "Platform.h" +export BOOLEAN Out_IsConsole; static CHAR Out_buf[128]; static INT16 Out_in; @@ -311,6 +312,7 @@ export void *Out__init(void) __REGCMD("Ln", Out_Ln); __REGCMD("Open", Out_Open); /* BEGIN */ + Out_IsConsole = Platform_IsConsole(1); Out_in = 0; __ENDMOD; } diff --git a/bootstrap/unix-48/Out.h b/bootstrap/unix-48/Out.h index fd11d7ba..e3b542f1 100644 --- a/bootstrap/unix-48/Out.h +++ b/bootstrap/unix-48/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h @@ -6,6 +6,7 @@ #include "SYSTEM.h" +import BOOLEAN Out_IsConsole; import void Out_Char (CHAR ch); diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 6cb7767f..f58bb07a 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -63,6 +63,7 @@ export INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIden export BOOLEAN Platform_Inaccessible (INT16 e); export void Platform_Init (INT32 argc, INT32 argvadr); export BOOLEAN Platform_Interrupted (INT16 e); +export BOOLEAN Platform_IsConsole (INT32 h); export void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d); export INT16 Platform_New (CHAR *n, LONGINT n__len, INT32 *h); export BOOLEAN Platform_NoSuchDirectory (INT16 e); @@ -131,6 +132,7 @@ extern void Heap_InitHeap(); #define Platform_getenv(var, var__len) (Platform_EnvPtr)getenv((char*)var) #define Platform_getpid() (INTEGER)getpid() #define Platform_gettimeval() struct timeval tv; gettimeofday(&tv,0) +#define Platform_isatty(fd) isatty(fd) #define Platform_lseek(fd, o, w) lseek(fd, o, w) #define Platform_nanosleep(s, ns) struct timespec req, rem; req.tv_sec = s; req.tv_nsec = ns; nanosleep(&req, &rem) #define Platform_opennew(n, n__len) open((char*)n, O_CREAT | O_TRUNC | O_RDWR, 0664) @@ -404,6 +406,11 @@ INT16 Platform_Close (INT32 h) __RETCHK; } +BOOLEAN Platform_IsConsole (INT32 h) +{ + return Platform_isatty(h) != 0; +} + INT16 Platform_Identify (INT32 h, Platform_FileIdentity *identity, ADDRESS *identity__typ) { Platform_structstats(); diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index 6ae68d6f..0a85488d 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h @@ -45,6 +45,7 @@ import INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIden import BOOLEAN Platform_Inaccessible (INT16 e); import void Platform_Init (INT32 argc, INT32 argvadr); import BOOLEAN Platform_Interrupted (INT16 e); +import BOOLEAN Platform_IsConsole (INT32 h); import void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d); import INT16 Platform_New (CHAR *n, LONGINT n__len, INT32 *h); import BOOLEAN Platform_NoSuchDirectory (INT16 e); diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 3445ecec..e532c10a 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index 035a9727..9e6d921e 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index 2e536dda..5921a597 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index 668261aa..c8760025 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index b3ef5a6d..9827cf2e 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index 92886678..51e39825 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/VT100.c b/bootstrap/unix-48/VT100.c index 2d8d0a2a..8b786199 100644 --- a/bootstrap/unix-48/VT100.c +++ b/bootstrap/unix-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/VT100.h b/bootstrap/unix-48/VT100.h index ae8ad073..ca8fd2fa 100644 --- a/bootstrap/unix-48/VT100.h +++ b/bootstrap/unix-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index 76e386df..e1cc07ba 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index 2a8c5c12..c31ea618 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/Compiler.c b/bootstrap/unix-88/Compiler.c index abb29dbf..ef5126fc 100644 --- a/bootstrap/unix-88/Compiler.c +++ b/bootstrap/unix-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 @@ -46,22 +46,14 @@ void Compiler_Module (BOOLEAN *done) if (OPM_noerr) { if ((__IN(10, OPM_Options, 32) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { OPM_DeleteNewSym(); - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"32m", 4); - } + OPM_LogVT100((CHAR*)"32m", 4); OPM_LogWStr((CHAR*)" Main program.", 16); - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"0m", 3); - } + OPM_LogVT100((CHAR*)"0m", 3); } else { if (new) { - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"32m", 4); - } + OPM_LogVT100((CHAR*)"32m", 4); OPM_LogWStr((CHAR*)" New symbol file.", 19); - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"0m", 3); - } + OPM_LogVT100((CHAR*)"0m", 3); OPM_RegisterNewSym(); } else if (ext) { OPM_LogWStr((CHAR*)" Extended symbol file.", 24); diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index 0fe23200..8dee54dd 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index 8821eec7..68bf9ed7 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index bf261994..e90d45de 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index aec2d9e7..e9575a26 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index 9caec7dd..37d3265c 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index c62af8b2..5aa43338 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index bdc60565..6c9fd2b7 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index ef8a8c3b..2ec0e428 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index bb87539a..adda3018 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index 20ecca68..d59b8602 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index 96d49e67..e92faf91 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index a27ea6fd..eede7b95 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 69d07404..36a43b89 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -59,6 +59,7 @@ export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); export void OPM_InitOptions (void); export INT16 OPM_Integer (INT64 n); static void OPM_LogErrMsg (INT16 n); +export void OPM_LogVT100 (CHAR *vt100code, LONGINT vt100code__len); export void OPM_LogW (CHAR ch); export void OPM_LogWLn (void); export void OPM_LogWNum (INT64 i, INT64 len); @@ -121,6 +122,15 @@ void OPM_LogWLn (void) Out_Ln(); } +void OPM_LogVT100 (CHAR *vt100code, LONGINT vt100code__len) +{ + __DUP(vt100code, vt100code__len, CHAR); + if ((Out_IsConsole && !__IN(16, OPM_Options, 32))) { + VT100_SetAttr(vt100code, vt100code__len); + } + __DEL(vt100code); +} + INT64 OPM_SignedMaximum (INT32 bytecount) { INT64 result; @@ -540,22 +550,14 @@ static void OPM_LogErrMsg (INT16 n) Texts_Scanner S; CHAR c; if (n >= 0) { - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"31m", 4); - } + OPM_LogVT100((CHAR*)"31m", 4); OPM_LogWStr((CHAR*)" err ", 7); - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"0m", 3); - } + OPM_LogVT100((CHAR*)"0m", 3); } else { - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"35m", 4); - } + OPM_LogVT100((CHAR*)"35m", 4); OPM_LogWStr((CHAR*)" warning ", 11); n = -n; - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"0m", 3); - } + OPM_LogVT100((CHAR*)"0m", 3); } OPM_LogWNum(n, 1); OPM_LogWStr((CHAR*)" ", 3); @@ -641,13 +643,9 @@ static void OPM_ShowLine (INT64 pos) OPM_LogW(' '); i -= 1; } - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"32m", 4); - } + OPM_LogVT100((CHAR*)"32m", 4); OPM_LogW('^'); - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"0m", 3); - } + OPM_LogVT100((CHAR*)"0m", 3); Files_Close(f); } diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index 17ae2fda..2e875d8f 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h @@ -31,6 +31,7 @@ import void OPM_Get (CHAR *ch); import void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); import void OPM_InitOptions (void); import INT16 OPM_Integer (INT64 n); +import void OPM_LogVT100 (CHAR *vt100code, LONGINT vt100code__len); import void OPM_LogW (CHAR ch); import void OPM_LogWLn (void); import void OPM_LogWNum (INT64 i, INT64 len); diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index 05e74ff1..59d1e709 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index 272a545a..960ea29e 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index 0b2a09d7..72d77adb 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index 2cb37758..92740884 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index 052b4ba3..df081a58 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 6c82f6b5..b6ecef0e 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 9857f122..5d180b17 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index dff88ffa..ad0a4e1c 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Out.c b/bootstrap/unix-88/Out.c index a4c3b892..bc314d4d 100644 --- a/bootstrap/unix-88/Out.c +++ b/bootstrap/unix-88/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -9,6 +9,7 @@ #include "Platform.h" +export BOOLEAN Out_IsConsole; static CHAR Out_buf[128]; static INT16 Out_in; @@ -311,6 +312,7 @@ export void *Out__init(void) __REGCMD("Ln", Out_Ln); __REGCMD("Open", Out_Open); /* BEGIN */ + Out_IsConsole = Platform_IsConsole(1); Out_in = 0; __ENDMOD; } diff --git a/bootstrap/unix-88/Out.h b/bootstrap/unix-88/Out.h index fd11d7ba..e3b542f1 100644 --- a/bootstrap/unix-88/Out.h +++ b/bootstrap/unix-88/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h @@ -6,6 +6,7 @@ #include "SYSTEM.h" +import BOOLEAN Out_IsConsole; import void Out_Char (CHAR ch); diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index a46330e3..4d64af83 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -63,6 +63,7 @@ export INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIden export BOOLEAN Platform_Inaccessible (INT16 e); export void Platform_Init (INT32 argc, INT64 argvadr); export BOOLEAN Platform_Interrupted (INT16 e); +export BOOLEAN Platform_IsConsole (INT32 h); export void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d); export INT16 Platform_New (CHAR *n, LONGINT n__len, INT32 *h); export BOOLEAN Platform_NoSuchDirectory (INT16 e); @@ -131,6 +132,7 @@ extern void Heap_InitHeap(); #define Platform_getenv(var, var__len) (Platform_EnvPtr)getenv((char*)var) #define Platform_getpid() (INTEGER)getpid() #define Platform_gettimeval() struct timeval tv; gettimeofday(&tv,0) +#define Platform_isatty(fd) isatty(fd) #define Platform_lseek(fd, o, w) lseek(fd, o, w) #define Platform_nanosleep(s, ns) struct timespec req, rem; req.tv_sec = s; req.tv_nsec = ns; nanosleep(&req, &rem) #define Platform_opennew(n, n__len) open((char*)n, O_CREAT | O_TRUNC | O_RDWR, 0664) @@ -404,6 +406,11 @@ INT16 Platform_Close (INT32 h) __RETCHK; } +BOOLEAN Platform_IsConsole (INT32 h) +{ + return Platform_isatty(h) != 0; +} + INT16 Platform_Identify (INT32 h, Platform_FileIdentity *identity, ADDRESS *identity__typ) { Platform_structstats(); diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index 21b3ac40..ed5faf55 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h @@ -45,6 +45,7 @@ import INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIden import BOOLEAN Platform_Inaccessible (INT16 e); import void Platform_Init (INT32 argc, INT64 argvadr); import BOOLEAN Platform_Interrupted (INT16 e); +import BOOLEAN Platform_IsConsole (INT32 h); import void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d); import INT16 Platform_New (CHAR *n, LONGINT n__len, INT32 *h); import BOOLEAN Platform_NoSuchDirectory (INT16 e); diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 3445ecec..e532c10a 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index 035a9727..9e6d921e 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index 2e536dda..5921a597 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index 668261aa..c8760025 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index 537d4d09..fedd5ba1 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index f408e854..fe5ba341 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/VT100.c b/bootstrap/unix-88/VT100.c index 2d8d0a2a..8b786199 100644 --- a/bootstrap/unix-88/VT100.c +++ b/bootstrap/unix-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/VT100.h b/bootstrap/unix-88/VT100.h index ae8ad073..ca8fd2fa 100644 --- a/bootstrap/unix-88/VT100.h +++ b/bootstrap/unix-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index 76e386df..e1cc07ba 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index 2a8c5c12..c31ea618 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/Compiler.c b/bootstrap/windows-48/Compiler.c index abb29dbf..ef5126fc 100644 --- a/bootstrap/windows-48/Compiler.c +++ b/bootstrap/windows-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 @@ -46,22 +46,14 @@ void Compiler_Module (BOOLEAN *done) if (OPM_noerr) { if ((__IN(10, OPM_Options, 32) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { OPM_DeleteNewSym(); - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"32m", 4); - } + OPM_LogVT100((CHAR*)"32m", 4); OPM_LogWStr((CHAR*)" Main program.", 16); - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"0m", 3); - } + OPM_LogVT100((CHAR*)"0m", 3); } else { if (new) { - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"32m", 4); - } + OPM_LogVT100((CHAR*)"32m", 4); OPM_LogWStr((CHAR*)" New symbol file.", 19); - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"0m", 3); - } + OPM_LogVT100((CHAR*)"0m", 3); OPM_RegisterNewSym(); } else if (ext) { OPM_LogWStr((CHAR*)" Extended symbol file.", 24); diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index 0fe23200..8dee54dd 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index 8821eec7..68bf9ed7 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index cc2adfda..6fab39f4 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index ac675d4d..305419c8 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index dc79f2c6..be352cc8 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index 3d31f97c..620c600d 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index 2632922b..e2a62e9c 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index ef8a8c3b..2ec0e428 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index bb87539a..adda3018 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index 20ecca68..d59b8602 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 96d49e67..e92faf91 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index a27ea6fd..eede7b95 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 4e1b04a2..63faf68d 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -59,6 +59,7 @@ export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); export void OPM_InitOptions (void); export INT16 OPM_Integer (INT64 n); static void OPM_LogErrMsg (INT16 n); +export void OPM_LogVT100 (CHAR *vt100code, LONGINT vt100code__len); export void OPM_LogW (CHAR ch); export void OPM_LogWLn (void); export void OPM_LogWNum (INT64 i, INT64 len); @@ -121,6 +122,15 @@ void OPM_LogWLn (void) Out_Ln(); } +void OPM_LogVT100 (CHAR *vt100code, LONGINT vt100code__len) +{ + __DUP(vt100code, vt100code__len, CHAR); + if ((Out_IsConsole && !__IN(16, OPM_Options, 32))) { + VT100_SetAttr(vt100code, vt100code__len); + } + __DEL(vt100code); +} + INT64 OPM_SignedMaximum (INT32 bytecount) { INT64 result; @@ -540,22 +550,14 @@ static void OPM_LogErrMsg (INT16 n) Texts_Scanner S; CHAR c; if (n >= 0) { - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"31m", 4); - } + OPM_LogVT100((CHAR*)"31m", 4); OPM_LogWStr((CHAR*)" err ", 7); - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"0m", 3); - } + OPM_LogVT100((CHAR*)"0m", 3); } else { - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"35m", 4); - } + OPM_LogVT100((CHAR*)"35m", 4); OPM_LogWStr((CHAR*)" warning ", 11); n = -n; - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"0m", 3); - } + OPM_LogVT100((CHAR*)"0m", 3); } OPM_LogWNum(n, 1); OPM_LogWStr((CHAR*)" ", 3); @@ -641,13 +643,9 @@ static void OPM_ShowLine (INT64 pos) OPM_LogW(' '); i -= 1; } - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"32m", 4); - } + OPM_LogVT100((CHAR*)"32m", 4); OPM_LogW('^'); - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"0m", 3); - } + OPM_LogVT100((CHAR*)"0m", 3); Files_Close(f); } diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index 17ae2fda..2e875d8f 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h @@ -31,6 +31,7 @@ import void OPM_Get (CHAR *ch); import void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); import void OPM_InitOptions (void); import INT16 OPM_Integer (INT64 n); +import void OPM_LogVT100 (CHAR *vt100code, LONGINT vt100code__len); import void OPM_LogW (CHAR ch); import void OPM_LogWLn (void); import void OPM_LogWNum (INT64 i, INT64 len); diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index e1f6e651..ffc41784 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index 272a545a..960ea29e 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index 0b2a09d7..72d77adb 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index 2cb37758..92740884 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index deae7082..a80a5307 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index 6c82f6b5..b6ecef0e 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index 78becdbf..7eb931aa 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index dff88ffa..ad0a4e1c 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Out.c b/bootstrap/windows-48/Out.c index d5709f1e..6f988eae 100644 --- a/bootstrap/windows-48/Out.c +++ b/bootstrap/windows-48/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -9,6 +9,7 @@ #include "Platform.h" +export BOOLEAN Out_IsConsole; static CHAR Out_buf[128]; static INT16 Out_in; @@ -311,6 +312,7 @@ export void *Out__init(void) __REGCMD("Ln", Out_Ln); __REGCMD("Open", Out_Open); /* BEGIN */ + Out_IsConsole = Platform_IsConsole(Platform_StdOut); Out_in = 0; __ENDMOD; } diff --git a/bootstrap/windows-48/Out.h b/bootstrap/windows-48/Out.h index fd11d7ba..e3b542f1 100644 --- a/bootstrap/windows-48/Out.h +++ b/bootstrap/windows-48/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h @@ -6,6 +6,7 @@ #include "SYSTEM.h" +import BOOLEAN Out_IsConsole; import void Out_Char (CHAR ch); diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 2ea96476..893f8576 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -67,6 +67,7 @@ export INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIden export BOOLEAN Platform_Inaccessible (INT16 e); export void Platform_Init (INT32 argc, INT32 argvadr); export BOOLEAN Platform_Interrupted (INT16 e); +export BOOLEAN Platform_IsConsole (INT32 h); export void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d); export INT16 Platform_New (CHAR *n, LONGINT n__len, INT32 *h); export BOOLEAN Platform_NoSuchDirectory (INT16 e); @@ -622,6 +623,12 @@ static void Platform_EnableVT100 (void) } } +BOOLEAN Platform_IsConsole (INT32 h) +{ + INT32 mode; + return Platform_GetConsoleMode(Platform_StdOut, &mode); +} + static void Platform_TestLittleEndian (void) { INT16 i; diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index 10ba64d7..8d2441f4 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h @@ -47,6 +47,7 @@ import INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIden import BOOLEAN Platform_Inaccessible (INT16 e); import void Platform_Init (INT32 argc, INT32 argvadr); import BOOLEAN Platform_Interrupted (INT16 e); +import BOOLEAN Platform_IsConsole (INT32 h); import void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d); import INT16 Platform_New (CHAR *n, LONGINT n__len, INT32 *h); import BOOLEAN Platform_NoSuchDirectory (INT16 e); diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 3445ecec..e532c10a 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index 035a9727..9e6d921e 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index 2e536dda..5921a597 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index 668261aa..c8760025 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index b3ef5a6d..9827cf2e 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index 92886678..51e39825 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/VT100.c b/bootstrap/windows-48/VT100.c index 2d8d0a2a..8b786199 100644 --- a/bootstrap/windows-48/VT100.c +++ b/bootstrap/windows-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/VT100.h b/bootstrap/windows-48/VT100.h index ae8ad073..ca8fd2fa 100644 --- a/bootstrap/windows-48/VT100.h +++ b/bootstrap/windows-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index 76e386df..e1cc07ba 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index 2a8c5c12..c31ea618 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/Compiler.c b/bootstrap/windows-88/Compiler.c index abb29dbf..ef5126fc 100644 --- a/bootstrap/windows-88/Compiler.c +++ b/bootstrap/windows-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 @@ -46,22 +46,14 @@ void Compiler_Module (BOOLEAN *done) if (OPM_noerr) { if ((__IN(10, OPM_Options, 32) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { OPM_DeleteNewSym(); - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"32m", 4); - } + OPM_LogVT100((CHAR*)"32m", 4); OPM_LogWStr((CHAR*)" Main program.", 16); - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"0m", 3); - } + OPM_LogVT100((CHAR*)"0m", 3); } else { if (new) { - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"32m", 4); - } + OPM_LogVT100((CHAR*)"32m", 4); OPM_LogWStr((CHAR*)" New symbol file.", 19); - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"0m", 3); - } + OPM_LogVT100((CHAR*)"0m", 3); OPM_RegisterNewSym(); } else if (ext) { OPM_LogWStr((CHAR*)" Extended symbol file.", 24); diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index 0fe23200..8dee54dd 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index 8821eec7..68bf9ed7 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 7d967950..b3d5385e 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 11437d58..47a3d116 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index 9caec7dd..37d3265c 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index c62af8b2..5aa43338 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index bdc60565..6c9fd2b7 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index ef8a8c3b..2ec0e428 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index bb87539a..adda3018 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index 20ecca68..d59b8602 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index 96d49e67..e92faf91 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index a27ea6fd..eede7b95 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 69d07404..36a43b89 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -59,6 +59,7 @@ export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); export void OPM_InitOptions (void); export INT16 OPM_Integer (INT64 n); static void OPM_LogErrMsg (INT16 n); +export void OPM_LogVT100 (CHAR *vt100code, LONGINT vt100code__len); export void OPM_LogW (CHAR ch); export void OPM_LogWLn (void); export void OPM_LogWNum (INT64 i, INT64 len); @@ -121,6 +122,15 @@ void OPM_LogWLn (void) Out_Ln(); } +void OPM_LogVT100 (CHAR *vt100code, LONGINT vt100code__len) +{ + __DUP(vt100code, vt100code__len, CHAR); + if ((Out_IsConsole && !__IN(16, OPM_Options, 32))) { + VT100_SetAttr(vt100code, vt100code__len); + } + __DEL(vt100code); +} + INT64 OPM_SignedMaximum (INT32 bytecount) { INT64 result; @@ -540,22 +550,14 @@ static void OPM_LogErrMsg (INT16 n) Texts_Scanner S; CHAR c; if (n >= 0) { - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"31m", 4); - } + OPM_LogVT100((CHAR*)"31m", 4); OPM_LogWStr((CHAR*)" err ", 7); - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"0m", 3); - } + OPM_LogVT100((CHAR*)"0m", 3); } else { - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"35m", 4); - } + OPM_LogVT100((CHAR*)"35m", 4); OPM_LogWStr((CHAR*)" warning ", 11); n = -n; - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"0m", 3); - } + OPM_LogVT100((CHAR*)"0m", 3); } OPM_LogWNum(n, 1); OPM_LogWStr((CHAR*)" ", 3); @@ -641,13 +643,9 @@ static void OPM_ShowLine (INT64 pos) OPM_LogW(' '); i -= 1; } - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"32m", 4); - } + OPM_LogVT100((CHAR*)"32m", 4); OPM_LogW('^'); - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"0m", 3); - } + OPM_LogVT100((CHAR*)"0m", 3); Files_Close(f); } diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index 17ae2fda..2e875d8f 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h @@ -31,6 +31,7 @@ import void OPM_Get (CHAR *ch); import void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); import void OPM_InitOptions (void); import INT16 OPM_Integer (INT64 n); +import void OPM_LogVT100 (CHAR *vt100code, LONGINT vt100code__len); import void OPM_LogW (CHAR ch); import void OPM_LogWLn (void); import void OPM_LogWNum (INT64 i, INT64 len); diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index 05e74ff1..59d1e709 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index 272a545a..960ea29e 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index 0b2a09d7..72d77adb 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index 2cb37758..92740884 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index 052b4ba3..df081a58 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 6c82f6b5..b6ecef0e 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 9857f122..5d180b17 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index dff88ffa..ad0a4e1c 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Out.c b/bootstrap/windows-88/Out.c index d5709f1e..6f988eae 100644 --- a/bootstrap/windows-88/Out.c +++ b/bootstrap/windows-88/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -9,6 +9,7 @@ #include "Platform.h" +export BOOLEAN Out_IsConsole; static CHAR Out_buf[128]; static INT16 Out_in; @@ -311,6 +312,7 @@ export void *Out__init(void) __REGCMD("Ln", Out_Ln); __REGCMD("Open", Out_Open); /* BEGIN */ + Out_IsConsole = Platform_IsConsole(Platform_StdOut); Out_in = 0; __ENDMOD; } diff --git a/bootstrap/windows-88/Out.h b/bootstrap/windows-88/Out.h index fd11d7ba..e3b542f1 100644 --- a/bootstrap/windows-88/Out.h +++ b/bootstrap/windows-88/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h @@ -6,6 +6,7 @@ #include "SYSTEM.h" +import BOOLEAN Out_IsConsole; import void Out_Char (CHAR ch); diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index e120708e..8017966b 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -67,6 +67,7 @@ export INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIden export BOOLEAN Platform_Inaccessible (INT16 e); export void Platform_Init (INT32 argc, INT64 argvadr); export BOOLEAN Platform_Interrupted (INT16 e); +export BOOLEAN Platform_IsConsole (INT64 h); export void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d); export INT16 Platform_New (CHAR *n, LONGINT n__len, INT64 *h); export BOOLEAN Platform_NoSuchDirectory (INT16 e); @@ -622,6 +623,12 @@ static void Platform_EnableVT100 (void) } } +BOOLEAN Platform_IsConsole (INT64 h) +{ + INT32 mode; + return Platform_GetConsoleMode(Platform_StdOut, &mode); +} + static void Platform_TestLittleEndian (void) { INT16 i; diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index 59418a88..5c38cd8d 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h @@ -47,6 +47,7 @@ import INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIden import BOOLEAN Platform_Inaccessible (INT16 e); import void Platform_Init (INT32 argc, INT64 argvadr); import BOOLEAN Platform_Interrupted (INT16 e); +import BOOLEAN Platform_IsConsole (INT64 h); import void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d); import INT16 Platform_New (CHAR *n, LONGINT n__len, INT64 *h); import BOOLEAN Platform_NoSuchDirectory (INT16 e); diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 3445ecec..e532c10a 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index 035a9727..9e6d921e 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index 2e536dda..5921a597 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index 668261aa..c8760025 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index 537d4d09..fedd5ba1 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index f408e854..fe5ba341 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/VT100.c b/bootstrap/windows-88/VT100.c index 2d8d0a2a..8b786199 100644 --- a/bootstrap/windows-88/VT100.c +++ b/bootstrap/windows-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/VT100.h b/bootstrap/windows-88/VT100.h index ae8ad073..ca8fd2fa 100644 --- a/bootstrap/windows-88/VT100.h +++ b/bootstrap/windows-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index 76e386df..e1cc07ba 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index 2a8c5c12..c31ea618 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/src/compiler/Compiler.Mod b/src/compiler/Compiler.Mod index b6683241..4ec44f03 100644 --- a/src/compiler/Compiler.Mod +++ b/src/compiler/Compiler.Mod @@ -25,14 +25,10 @@ MODULE Compiler; (* J. Templ 3.2.95 *) IF OPM.noerr THEN IF (OPM.mainprog IN OPM.Options) & (OPM.modName # "SYSTEM") THEN OPM.DeleteNewSym; - IF ~(OPM.notcoloroutput IN OPM.Options) THEN VT100.SetAttr(VT100.Green) END; - OPM.LogWStr(" Main program."); - IF ~(OPM.notcoloroutput IN OPM.Options) THEN VT100.SetAttr(VT100.ResetAll) END; + OPM.LogVT100(VT100.Green); OPM.LogWStr(" Main program."); OPM.LogVT100(VT100.ResetAll); ELSE IF new THEN - IF ~(OPM.notcoloroutput IN OPM.Options) THEN VT100.SetAttr(VT100.Green) END; - OPM.LogWStr(" New symbol file."); - IF ~(OPM.notcoloroutput IN OPM.Options) THEN VT100.SetAttr(VT100.ResetAll) END; + OPM.LogVT100(VT100.Green); OPM.LogWStr(" New symbol file."); OPM.LogVT100(VT100.ResetAll); OPM.RegisterNewSym ELSIF ext THEN OPM.LogWStr(" Extended symbol file."); diff --git a/src/compiler/OPM.Mod b/src/compiler/OPM.Mod index 7c0892fa..c72912a7 100644 --- a/src/compiler/OPM.Mod +++ b/src/compiler/OPM.Mod @@ -129,7 +129,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) PROCEDURE LogWNum*(i, len: SYSTEM.INT64); BEGIN Out.Int(i, len) END LogWNum; PROCEDURE LogWLn*; BEGIN Out.Ln END LogWLn; - PROCEDURE LogVT100(vt100code: ARRAY OF CHAR); + PROCEDURE LogVT100*(vt100code: ARRAY OF CHAR); BEGIN IF Out.IsConsole & ~(notcoloroutput IN Options) THEN VT100.SetAttr(vt100code) From 65db905f0b65da3ba73b513c59986d483d3c6268 Mon Sep 17 00:00:00 2001 From: David Brown Date: Tue, 15 Nov 2016 22:59:43 +0000 Subject: [PATCH 325/580] Fix misfiring of error 308 by calculating type sizes when not already calculated. --- bootstrap/unix-44/OPB.c | 2 ++ bootstrap/unix-48/OPB.c | 2 ++ bootstrap/unix-88/OPB.c | 2 ++ bootstrap/windows-48/OPB.c | 2 ++ bootstrap/windows-88/OPB.c | 2 ++ src/compiler/OPB.Mod | 1 + 6 files changed, 11 insertions(+) diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index adda3018..8533be52 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -2172,6 +2172,8 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno) if (((x->class == 8 || x->class == 9) || __IN(f, 0x0501, 32)) || x->typ->comp == 3) { OPB_err(126); } + OPT_TypSize(x->typ); + OPT_TypSize(p->typ); if ((x->class != 7 && x->typ->size < p->typ->size)) { OPB_err(-308); } diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index adda3018..8533be52 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -2172,6 +2172,8 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno) if (((x->class == 8 || x->class == 9) || __IN(f, 0x0501, 32)) || x->typ->comp == 3) { OPB_err(126); } + OPT_TypSize(x->typ); + OPT_TypSize(p->typ); if ((x->class != 7 && x->typ->size < p->typ->size)) { OPB_err(-308); } diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index adda3018..8533be52 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -2172,6 +2172,8 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno) if (((x->class == 8 || x->class == 9) || __IN(f, 0x0501, 32)) || x->typ->comp == 3) { OPB_err(126); } + OPT_TypSize(x->typ); + OPT_TypSize(p->typ); if ((x->class != 7 && x->typ->size < p->typ->size)) { OPB_err(-308); } diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index adda3018..8533be52 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -2172,6 +2172,8 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno) if (((x->class == 8 || x->class == 9) || __IN(f, 0x0501, 32)) || x->typ->comp == 3) { OPB_err(126); } + OPT_TypSize(x->typ); + OPT_TypSize(p->typ); if ((x->class != 7 && x->typ->size < p->typ->size)) { OPB_err(-308); } diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index adda3018..8533be52 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -2172,6 +2172,8 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno) if (((x->class == 8 || x->class == 9) || __IN(f, 0x0501, 32)) || x->typ->comp == 3) { OPB_err(126); } + OPT_TypSize(x->typ); + OPT_TypSize(p->typ); if ((x->class != 7 && x->typ->size < p->typ->size)) { OPB_err(-308); } diff --git a/src/compiler/OPB.Mod b/src/compiler/OPB.Mod index 5cdad662..91576fd3 100644 --- a/src/compiler/OPB.Mod +++ b/src/compiler/OPB.Mod @@ -1226,6 +1226,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) err(126) END; (* Warn if the result type includes memory past the end of the source variable *) + OPT.TypSize(x.typ); OPT.TypSize(p.typ); IF (x.class # OPT.Nconst) & (x.typ.size < p.typ.size) THEN err(-308) END; IF (x.class = OPT.Nconst) & (x.typ.form = OPT.Int) & (p.typ.form = OPT.Int) THEN From 240885d8416f79d71cf5ad8c4ae10d0d95dffa69 Mon Sep 17 00:00:00 2001 From: David Brown Date: Tue, 15 Nov 2016 23:40:26 +0000 Subject: [PATCH 326/580] Restore showdef lookup of installed library modules. --- src/tools/browser/BrowserCmd.Mod | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/src/tools/browser/BrowserCmd.Mod b/src/tools/browser/BrowserCmd.Mod index dd15c680..86b7d4e0 100644 --- a/src/tools/browser/BrowserCmd.Mod +++ b/src/tools/browser/BrowserCmd.Mod @@ -1,8 +1,9 @@ MODULE BrowserCmd; (* RC 29.10.93 *) (* object model 4.12.93, command line version jt 4.4.95 *) IMPORT - OPM, OPS, OPT, OPV, Texts, Out, Oberon, Platform, SYSTEM; - + OPM, OPS, OPT, OPV, + Texts, Strings, Files, Out, + Oberon, Platform, SYSTEM, Configuration; CONST OptionChar = "-"; @@ -275,13 +276,29 @@ MODULE BrowserCmd; (* RC 29.10.93 *) (* object model 4.12.93, command line ver WModule(name, Oberon.Log); OPT.Close; ELSE - Texts.WriteString(W, "showdef - Display module's public interface."); Texts.WriteLn(W); - Texts.WriteString(W, "Usage: showdef module"); Texts.WriteLn(W); - Texts.WriteString(W, "Note: module.sym must be in the current directory."); Texts.WriteLn(W); + Ws("showdef - Display module's public interface."); Wln; + Wln; + Ws("Usage: showdef module"); Wln; + Wln; + Ws("Any path and/or filename extension are stripped from the module name,"); Wln; + Ws("and the module is found the same way as it is found by the compiler."); Wln; + Wln; + Ws("Thus the module .sym file must be in the current directory, or module"); Wln; + Ws("must be the name of one of the library modules installed with the compiler."); Wln; Texts.Append(Oberon.Log, W.buf) END END ShowDef; +PROCEDURE SetPath; +VAR path: ARRAY 256 OF CHAR; BEGIN - Texts.OpenWriter(W); ShowDef + COPY(Configuration.installdir, path); + Strings.Append("/2/sym", path); + Files.SetSearchPath(path) +END SetPath; + +BEGIN + Texts.OpenWriter(W); + SetPath; + ShowDef END BrowserCmd. From 13da50007efe00729d70b1d73d99731b77d422c9 Mon Sep 17 00:00:00 2001 From: David Brown Date: Wed, 16 Nov 2016 11:56:40 +0000 Subject: [PATCH 327/580] Honour file path in showdef module argument. --- src/tools/browser/BrowserCmd.Mod | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/tools/browser/BrowserCmd.Mod b/src/tools/browser/BrowserCmd.Mod index 86b7d4e0..d463c22d 100644 --- a/src/tools/browser/BrowserCmd.Mod +++ b/src/tools/browser/BrowserCmd.Mod @@ -256,6 +256,7 @@ MODULE BrowserCmd; (* RC 29.10.93 *) (* object model 4.12.93, command line ver BEGIN i := 0; WHILE name[i] # 0X DO INC(i) END; WHILE (i >= 0) & (name[i] # "/") DO DEC(i) END; + IF i > 0 THEN name[i] := 0X; Files.SetSearchPath(name) END; INC(i); j := 0; ch := name[i]; WHILE (ch # ".") & (ch # 0X) DO first[j] := ch; INC(i); INC(j); ch := name[i] END; first[j] := 0X @@ -280,25 +281,24 @@ MODULE BrowserCmd; (* RC 29.10.93 *) (* object model 4.12.93, command line ver Wln; Ws("Usage: showdef module"); Wln; Wln; - Ws("Any path and/or filename extension are stripped from the module name,"); Wln; - Ws("and the module is found the same way as it is found by the compiler."); Wln; - Wln; - Ws("Thus the module .sym file must be in the current directory, or module"); Wln; - Ws("must be the name of one of the library modules installed with the compiler."); Wln; + Ws("Where is a symbol file name. The .sym may be omitted."); Wln; + Ws("If no path is provided, and the module does not exist in the current directory,"); Wln; + Ws("then showdef will also look for the module in the installed libraries."); Wln; Texts.Append(Oberon.Log, W.buf) END END ShowDef; -PROCEDURE SetPath; +PROCEDURE SetDefaultPath; VAR path: ARRAY 256 OF CHAR; BEGIN - COPY(Configuration.installdir, path); + path := ".;"; + Strings.Append(Configuration.installdir, path); Strings.Append("/2/sym", path); Files.SetSearchPath(path) -END SetPath; +END SetDefaultPath; BEGIN Texts.OpenWriter(W); - SetPath; + SetDefaultPath; ShowDef END BrowserCmd. From 654b6ecb24eb21cf8a4a83f69fb74f4f0a511c89 Mon Sep 17 00:00:00 2001 From: David Brown Date: Wed, 16 Nov 2016 12:33:53 +0000 Subject: [PATCH 328/580] Add offset assertions to Files.Mod. --- src/runtime/Files.Mod | 63 ++++++++++++++++++++++++------------------- 1 file changed, 36 insertions(+), 27 deletions(-) diff --git a/src/runtime/Files.Mod b/src/runtime/Files.Mod index 841c5c41..9e51f73b 100644 --- a/src/runtime/Files.Mod +++ b/src/runtime/Files.Mod @@ -14,10 +14,9 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files CONST - nofbufs = 4; - bufsize = 4096; - noDesc = -1; - notDone = -1; + NumBufs = 4; + BufSize = 4096; + NoDesc = -1; (* file states *) open = 0; (* OS File has been opened *) @@ -40,7 +39,7 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files identity: Platform.FileIdentity; fd-: Platform.FileHandle; len, pos: LONGINT; - bufs: ARRAY nofbufs OF Buffer; + bufs: ARRAY NumBufs OF Buffer; swapper: INTEGER; state: INTEGER; next: File; @@ -51,7 +50,7 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files chg: BOOLEAN; org: LONGINT; size: LONGINT; - data: ARRAY bufsize OF SYSTEM.BYTE + data: ARRAY BufSize OF SYSTEM.BYTE END; Rider* = RECORD @@ -131,7 +130,7 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files Out.String(", state = "); Out.Int(f.state,1); Out.Ln; *) - IF f.fd = noDesc THEN + IF f.fd = NoDesc THEN IF f.state = create THEN GetTempName(f.registerName, f.workName); f.tempFile := TRUE ELSIF f.state = close THEN @@ -203,7 +202,7 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files IF prev.next # NIL THEN prev.next := f.next END END; error := Platform.Close(f.fd); - f.fd := noDesc; f.state := create; DEC(Heap.FileCount); + f.fd := NoDesc; f.state := create; DEC(Heap.FileCount); END CloseOSFile; @@ -214,7 +213,7 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files BEGIN IF (f.state # create) OR (f.registerName # "") THEN Create(f); i := 0; - WHILE (i < nofbufs) & (f.bufs[i] # NIL) DO Flush(f.bufs[i]); INC(i) END; + WHILE (i < NumBufs) & (f.bufs[i] # NIL) DO Flush(f.bufs[i]); INC(i) END; (* There's no reason to sync this file - we're about to close it. The OS will sync if necessary. Further, sync will fail for a R/O file on Windows. error := Platform.Sync(f.fd); @@ -231,7 +230,7 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files VAR f: File; BEGIN NEW(f); f.workName := ""; COPY(name, f.registerName); - f.fd := noDesc; f.state := create; f.len := 0; f.pos := 0; f.swapper := -1; (*all f.buf[i] = NIL*) + f.fd := NoDesc; f.state := create; f.len := 0; f.pos := 0; f.swapper := -1; (*all f.buf[i] = NIL*) RETURN f END New; @@ -275,7 +274,7 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files WHILE f # NIL DO IF Platform.SameFile(identity, f.identity) THEN IF ~Platform.SameFileTime(identity, f.identity) THEN i := 0; - WHILE i < nofbufs DO + WHILE i < NumBufs DO IF f.bufs[i] # NIL THEN f.bufs[i].org := -1; f.bufs[i] := NIL END; INC(i) END; @@ -340,11 +339,11 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files PROCEDURE Purge* (f: File); VAR i: INTEGER; identity: Platform.FileIdentity; error: Platform.ErrorCode; BEGIN i := 0; - WHILE i < nofbufs DO + WHILE i < NumBufs DO IF f.bufs[i] # NIL THEN f.bufs[i].org := -1; f.bufs[i] := NIL END; INC(i) END; - IF f.fd # noDesc THEN + IF f.fd # NoDesc THEN error := Platform.Truncate(f.fd, 0); error := Platform.Seek(f.fd, 0, Platform.SeekSet) END; @@ -361,7 +360,9 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files END GetDate; PROCEDURE Pos* (VAR r: Rider): LONGINT; - BEGIN RETURN r.org + r.offset + BEGIN + ASSERT(r.offset <= BufSize); + RETURN r.org + r.offset END Pos; PROCEDURE Set* (VAR r: Rider; f: File; pos: LONGINT); @@ -376,14 +377,14 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files Out.Ln; *) IF pos > f.len THEN pos := f.len ELSIF pos < 0 THEN pos := 0 END; - offset := pos MOD bufsize; org := pos - offset; i := 0; - WHILE (i < nofbufs) & (f.bufs[i] # NIL) & (org # f.bufs[i].org) DO INC(i) END; - IF i < nofbufs THEN + offset := pos MOD BufSize; org := pos - offset; i := 0; + WHILE (i < NumBufs) & (f.bufs[i] # NIL) & (org # f.bufs[i].org) DO INC(i) END; + IF i < NumBufs THEN IF f.bufs[i] = NIL THEN NEW(buf); buf.chg := FALSE; buf.org := -1; buf.f := f; f.bufs[i] := buf ELSE buf := f.bufs[i] END ELSE - f.swapper := (f.swapper + 1) MOD nofbufs; + f.swapper := (f.swapper + 1) MOD NumBufs; buf := f.bufs[f.swapper]; Flush(buf) END; @@ -400,6 +401,7 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files END ELSE buf := NIL; org := 0; offset := 0 END; + ASSERT(offset <= BufSize); r.buf := buf; r.org := org; r.offset := offset; r.eof := FALSE; r.res := 0 END Set; @@ -408,6 +410,7 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files BEGIN buf := r.buf; offset := r.offset; IF r.org # buf.org THEN Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset END; + ASSERT(offset <= buf.size); IF (offset < buf.size) THEN x := buf.data[offset]; r.offset := offset + 1 ELSIF r.org + offset < buf.f.len THEN @@ -424,7 +427,7 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files IF n > LEN(x) THEN IdxTrap END; xpos := 0; buf := r.buf; offset := r.offset; WHILE n > 0 DO - IF (r.org # buf.org) OR (offset >= bufsize) THEN + IF (r.org # buf.org) OR (offset >= BufSize) THEN Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset END; @@ -432,7 +435,8 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files IF restInBuf = 0 THEN r.res := n; r.eof := TRUE; RETURN ELSIF n > restInBuf THEN min := restInBuf ELSE min := n END; SYSTEM.MOVE(SYSTEM.ADR(buf.data) + ToAdr(offset), SYSTEM.ADR(x) + ToAdr(xpos), min); - INC(offset, min); r.offset := offset; INC(xpos, min); DEC(n, min) + INC(offset, min); r.offset := offset; INC(xpos, min); DEC(n, min); + ASSERT(offset <= BufSize) END; r.res := 0; r.eof := FALSE END ReadBytes; @@ -445,10 +449,12 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files VAR buf: Buffer; offset: LONGINT; BEGIN buf := r.buf; offset := r.offset; - IF (r.org # buf.org) OR (offset >= bufsize) THEN + ASSERT(offset <= BufSize); + IF (r.org # buf.org) OR (offset >= BufSize) THEN Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset END; + ASSERT(offset < BufSize); buf.data[offset] := x; buf.chg := TRUE; IF offset = buf.size THEN @@ -463,14 +469,17 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files IF n > LEN(x) THEN IdxTrap END; xpos := 0; buf := r.buf; offset := r.offset; WHILE n > 0 DO - IF (r.org # buf.org) OR (offset >= bufsize) THEN + ASSERT(offset <= BufSize); + IF (r.org # buf.org) OR (offset >= BufSize) THEN Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset END; - restInBuf := bufsize - offset; + ASSERT(offset <= BufSize); + restInBuf := BufSize - offset; IF n > restInBuf THEN min := restInBuf ELSE min := n END; SYSTEM.MOVE(SYSTEM.ADR(x) + ToAdr(xpos), SYSTEM.ADR(buf.data) + ToAdr(offset), min); INC(offset, min); r.offset := offset; + ASSERT(offset <= BufSize); IF offset > buf.size THEN INC(buf.f.len, offset - buf.size); buf.size := offset END; INC(xpos, min); DEC(n, min); buf.chg := TRUE END; @@ -479,14 +488,14 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files (* another solution would be one that is similar to ReadBytes, WriteBytes. No code duplication, more symmetric, only two ifs for -Read and Write in buffer, buf.size replaced by bufsize in Write ops, buf.size and len +Read and Write in buffer, buf.size replaced by BufSize in Write ops, buf.size and len must be made consistent with offset (if offset > buf.size) in a lazy way. PROCEDURE Write* (VAR r: Rider; x: SYSTEM.BYTE); VAR buf: Buffer; offset: LONGINT; BEGIN buf := r.buf; offset := r.offset; - IF (offset >= bufsize) OR (r.org # buf.org) THEN + IF (offset >= BufSize) OR (r.org # buf.org) THEN Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset; END; buf.data[offset] := x; r.offset := offset + 1; buf.chg := TRUE @@ -541,7 +550,7 @@ Especially Length would become fairly complex. IF error # 0 THEN res := 2; RETURN END; error := Platform.New(new, fdnew); IF error # 0 THEN error := Platform.Close(fdold); res := 3; RETURN END; - error := Platform.Read(fdold, SYSTEM.ADR(buf), bufsize, n); + error := Platform.Read(fdold, SYSTEM.ADR(buf), BufSize, n); WHILE n > 0 DO error := Platform.Write(fdnew, SYSTEM.ADR(buf), n); IF error # 0 THEN @@ -549,7 +558,7 @@ Especially Length would become fairly complex. ignore := Platform.Close(fdnew); Err("cannot move file", NIL, error) END; - error := Platform.Read(fdold, SYSTEM.ADR(buf), bufsize, n); + error := Platform.Read(fdold, SYSTEM.ADR(buf), BufSize, n); END; ignore := Platform.Close(fdold); ignore := Platform.Close(fdnew); From 7abdaf2312f6978575e49d2d38ead10e85d02056 Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 18 Nov 2016 12:50:07 +0000 Subject: [PATCH 329/580] Add new test virtual machines --- src/tools/make/buildall.pl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/tools/make/buildall.pl b/src/tools/make/buildall.pl index 20d99cbd..bba5eeca 100755 --- a/src/tools/make/buildall.pl +++ b/src/tools/make/buildall.pl @@ -20,7 +20,11 @@ my %machines = ( . "export CC=gcc && make full;" . "export CC=x86_64-w64-mingw32-gcc && make full\\\""], "android" => ['-p8022 root@and', "", "vishap/voc", "export CC=gcc && make full"], - "lub32" => ['dave@lub32', "sudo", "vishap/voc", "make full"], + "oldlub32"=> ['dave@lub32', "sudo", "vishap/voc", "make full"], + "lub64" => ['dave@vim', "sudo", "oberon/voc", "make full"], + "lub32" => ['dave@vim-lub32', "sudo", "oberon/voc", "make full"], + "fed64" => ['dave@vim-fed64', "sudo", "oberon/voc", "make full"], + "osu64" => ['dave@vim-osu64', "sudo", "oberon/voc", "make full"], "ob32" => ['root@nas-ob32', "", "vishap/voc", "make full"], "ce64" => ['-p5922 obe@www', "sudo", "vishap/voc", "make full"], "ub64" => ['dave@nas-ub64', "sudo", "vishap/voc", "make full"], From fd744350edabf4c83b9aba3469624ffe07102225 Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 18 Nov 2016 13:07:34 +0000 Subject: [PATCH 330/580] Update bootstrap. --- bootstrap/unix-44/Compiler.c | 2 +- bootstrap/unix-44/Configuration.c | 4 ++-- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Files.c | 11 ++++++++++- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 2 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 2 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 2 +- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 2 +- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 2 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Out.c | 2 +- bootstrap/unix-44/Out.h | 2 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/VT100.c | 2 +- bootstrap/unix-44/VT100.h | 2 +- bootstrap/unix-44/extTools.c | 2 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-48/Compiler.c | 2 +- bootstrap/unix-48/Configuration.c | 4 ++-- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Files.c | 11 ++++++++++- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 2 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 2 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 2 +- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 2 +- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 2 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Out.c | 2 +- bootstrap/unix-48/Out.h | 2 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/VT100.c | 2 +- bootstrap/unix-48/VT100.h | 2 +- bootstrap/unix-48/extTools.c | 2 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-88/Compiler.c | 2 +- bootstrap/unix-88/Configuration.c | 4 ++-- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Files.c | 11 ++++++++++- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 2 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 2 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 2 +- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 2 +- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 2 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Out.c | 2 +- bootstrap/unix-88/Out.h | 2 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/VT100.c | 2 +- bootstrap/unix-88/VT100.h | 2 +- bootstrap/unix-88/extTools.c | 2 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/windows-48/Compiler.c | 2 +- bootstrap/windows-48/Configuration.c | 4 ++-- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Files.c | 11 ++++++++++- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 2 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 2 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 2 +- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 2 +- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 2 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Out.c | 2 +- bootstrap/windows-48/Out.h | 2 +- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/VT100.c | 2 +- bootstrap/windows-48/VT100.h | 2 +- bootstrap/windows-48/extTools.c | 2 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-88/Compiler.c | 2 +- bootstrap/windows-88/Configuration.c | 4 ++-- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Files.c | 11 ++++++++++- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 2 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 2 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 2 +- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 2 +- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 2 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Out.c | 2 +- bootstrap/windows-88/Out.h | 2 +- bootstrap/windows-88/Platform.c | 2 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/VT100.c | 2 +- bootstrap/windows-88/VT100.h | 2 +- bootstrap/windows-88/extTools.c | 2 +- bootstrap/windows-88/extTools.h | 2 +- 185 files changed, 235 insertions(+), 190 deletions(-) diff --git a/bootstrap/unix-44/Compiler.c b/bootstrap/unix-44/Compiler.c index ef5126fc..f25df83b 100644 --- a/bootstrap/unix-44/Compiler.c +++ b/bootstrap/unix-44/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index 8dee54dd..91d42e8e 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index 68bf9ed7..1415f836 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 428cf3db..fca47b71 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -526,6 +526,7 @@ void Files_GetDate (Files_File f, INT32 *t, INT32 *d) INT32 Files_Pos (Files_Rider *r, ADDRESS *r__typ) { + __ASSERT((*r).offset <= 4096, 0); return (*r).org + (*r).offset; } @@ -584,6 +585,7 @@ void Files_Set (Files_Rider *r, ADDRESS *r__typ, Files_File f, INT32 pos) org = 0; offset = 0; } + __ASSERT(offset <= 4096, 0); (*r).buf = buf; (*r).org = org; (*r).offset = offset; @@ -602,6 +604,7 @@ void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x) buf = (*r).buf; offset = (*r).offset; } + __ASSERT(offset <= buf->size, 0); if (offset < buf->size) { *x = buf->data[offset]; (*r).offset = offset + 1; @@ -646,6 +649,7 @@ void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x (*r).offset = offset; xpos += min; n -= min; + __ASSERT(offset <= 4096, 0); } (*r).res = 0; (*r).eof = 0; @@ -662,11 +666,13 @@ void Files_Write (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE x) INT32 offset; buf = (*r).buf; offset = (*r).offset; + __ASSERT(offset <= 4096, 0); if ((*r).org != buf->org || offset >= 4096) { Files_Set(&*r, r__typ, buf->f, (*r).org + offset); buf = (*r).buf; offset = (*r).offset; } + __ASSERT(offset < 4096, 0); buf->data[offset] = x; buf->chg = 1; if (offset == buf->size) { @@ -688,11 +694,13 @@ void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT buf = (*r).buf; offset = (*r).offset; while (n > 0) { + __ASSERT(offset <= 4096, 0); if ((*r).org != buf->org || offset >= 4096) { Files_Set(&*r, r__typ, buf->f, (*r).org + offset); buf = (*r).buf; offset = (*r).offset; } + __ASSERT(offset <= 4096, 0); restInBuf = 4096 - offset; if (n > restInBuf) { min = restInBuf; @@ -702,6 +710,7 @@ void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT __MOVE((ADDRESS)x + Files_ToAdr(xpos), (ADDRESS)buf->data + Files_ToAdr(offset), min); offset += min; (*r).offset = offset; + __ASSERT(offset <= 4096, 0); if (offset > buf->size) { buf->f->len += offset - buf->size; buf->size = offset; diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index 4c861f05..139c7610 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index be352cc8..9c565b65 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index 620c600d..293dde6d 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index e2a62e9c..be6e0643 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index 2ec0e428..7def082a 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index 8533be52..217eeb29 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index d59b8602..fb6b73a6 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index e92faf91..0531b31c 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index eede7b95..d60c768f 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 63faf68d..9727f400 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index 2e875d8f..53606446 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index ffc41784..334a40ef 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index 960ea29e..1d5d5fe5 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index 72d77adb..aef09240 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index 92740884..5c6a4918 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index d5d3297d..f711e45a 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index b6ecef0e..e4034455 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index 7eb931aa..7647ce34 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index ad0a4e1c..84dfb3e7 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Out.c b/bootstrap/unix-44/Out.c index bc314d4d..335dfb8b 100644 --- a/bootstrap/unix-44/Out.c +++ b/bootstrap/unix-44/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Out.h b/bootstrap/unix-44/Out.h index e3b542f1..08a49b70 100644 --- a/bootstrap/unix-44/Out.h +++ b/bootstrap/unix-44/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index f58bb07a..d8f1091f 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index 0a85488d..2c06f00f 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index e532c10a..4338272f 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index 9e6d921e..da39ccfe 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index 5921a597..884336a1 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index c8760025..2131b02a 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index f661a75f..d9dc4a1e 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index 883fba9f..10794f98 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/VT100.c b/bootstrap/unix-44/VT100.c index 8b786199..7b0a9006 100644 --- a/bootstrap/unix-44/VT100.c +++ b/bootstrap/unix-44/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/VT100.h b/bootstrap/unix-44/VT100.h index ca8fd2fa..34999961 100644 --- a/bootstrap/unix-44/VT100.h +++ b/bootstrap/unix-44/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index e1cc07ba..b5104358 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index c31ea618..54bf5084 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/Compiler.c b/bootstrap/unix-48/Compiler.c index ef5126fc..f25df83b 100644 --- a/bootstrap/unix-48/Compiler.c +++ b/bootstrap/unix-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index 8dee54dd..91d42e8e 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index 68bf9ed7..1415f836 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 428cf3db..fca47b71 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -526,6 +526,7 @@ void Files_GetDate (Files_File f, INT32 *t, INT32 *d) INT32 Files_Pos (Files_Rider *r, ADDRESS *r__typ) { + __ASSERT((*r).offset <= 4096, 0); return (*r).org + (*r).offset; } @@ -584,6 +585,7 @@ void Files_Set (Files_Rider *r, ADDRESS *r__typ, Files_File f, INT32 pos) org = 0; offset = 0; } + __ASSERT(offset <= 4096, 0); (*r).buf = buf; (*r).org = org; (*r).offset = offset; @@ -602,6 +604,7 @@ void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x) buf = (*r).buf; offset = (*r).offset; } + __ASSERT(offset <= buf->size, 0); if (offset < buf->size) { *x = buf->data[offset]; (*r).offset = offset + 1; @@ -646,6 +649,7 @@ void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x (*r).offset = offset; xpos += min; n -= min; + __ASSERT(offset <= 4096, 0); } (*r).res = 0; (*r).eof = 0; @@ -662,11 +666,13 @@ void Files_Write (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE x) INT32 offset; buf = (*r).buf; offset = (*r).offset; + __ASSERT(offset <= 4096, 0); if ((*r).org != buf->org || offset >= 4096) { Files_Set(&*r, r__typ, buf->f, (*r).org + offset); buf = (*r).buf; offset = (*r).offset; } + __ASSERT(offset < 4096, 0); buf->data[offset] = x; buf->chg = 1; if (offset == buf->size) { @@ -688,11 +694,13 @@ void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT buf = (*r).buf; offset = (*r).offset; while (n > 0) { + __ASSERT(offset <= 4096, 0); if ((*r).org != buf->org || offset >= 4096) { Files_Set(&*r, r__typ, buf->f, (*r).org + offset); buf = (*r).buf; offset = (*r).offset; } + __ASSERT(offset <= 4096, 0); restInBuf = 4096 - offset; if (n > restInBuf) { min = restInBuf; @@ -702,6 +710,7 @@ void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT __MOVE((ADDRESS)x + Files_ToAdr(xpos), (ADDRESS)buf->data + Files_ToAdr(offset), min); offset += min; (*r).offset = offset; + __ASSERT(offset <= 4096, 0); if (offset > buf->size) { buf->f->len += offset - buf->size; buf->size = offset; diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index 4c861f05..139c7610 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index be352cc8..9c565b65 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index 620c600d..293dde6d 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index e2a62e9c..be6e0643 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index 2ec0e428..7def082a 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index 8533be52..217eeb29 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index d59b8602..fb6b73a6 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index e92faf91..0531b31c 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index eede7b95..d60c768f 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 63faf68d..9727f400 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index 2e875d8f..53606446 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index ffc41784..334a40ef 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index 960ea29e..1d5d5fe5 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index 72d77adb..aef09240 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index 92740884..5c6a4918 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index a80a5307..cbbea5ee 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index b6ecef0e..e4034455 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index 7eb931aa..7647ce34 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index ad0a4e1c..84dfb3e7 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Out.c b/bootstrap/unix-48/Out.c index bc314d4d..335dfb8b 100644 --- a/bootstrap/unix-48/Out.c +++ b/bootstrap/unix-48/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Out.h b/bootstrap/unix-48/Out.h index e3b542f1..08a49b70 100644 --- a/bootstrap/unix-48/Out.h +++ b/bootstrap/unix-48/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index f58bb07a..d8f1091f 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index 0a85488d..2c06f00f 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index e532c10a..4338272f 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index 9e6d921e..da39ccfe 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index 5921a597..884336a1 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index c8760025..2131b02a 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index 9827cf2e..79978dd0 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index 51e39825..85d96a5c 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/VT100.c b/bootstrap/unix-48/VT100.c index 8b786199..7b0a9006 100644 --- a/bootstrap/unix-48/VT100.c +++ b/bootstrap/unix-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/VT100.h b/bootstrap/unix-48/VT100.h index ca8fd2fa..34999961 100644 --- a/bootstrap/unix-48/VT100.h +++ b/bootstrap/unix-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index e1cc07ba..b5104358 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index c31ea618..54bf5084 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/Compiler.c b/bootstrap/unix-88/Compiler.c index ef5126fc..f25df83b 100644 --- a/bootstrap/unix-88/Compiler.c +++ b/bootstrap/unix-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index 8dee54dd..91d42e8e 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index 68bf9ed7..1415f836 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index e90d45de..a69b1ca4 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -526,6 +526,7 @@ void Files_GetDate (Files_File f, INT32 *t, INT32 *d) INT32 Files_Pos (Files_Rider *r, ADDRESS *r__typ) { + __ASSERT((*r).offset <= 4096, 0); return (*r).org + (*r).offset; } @@ -584,6 +585,7 @@ void Files_Set (Files_Rider *r, ADDRESS *r__typ, Files_File f, INT32 pos) org = 0; offset = 0; } + __ASSERT(offset <= 4096, 0); (*r).buf = buf; (*r).org = org; (*r).offset = offset; @@ -602,6 +604,7 @@ void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x) buf = (*r).buf; offset = (*r).offset; } + __ASSERT(offset <= buf->size, 0); if (offset < buf->size) { *x = buf->data[offset]; (*r).offset = offset + 1; @@ -646,6 +649,7 @@ void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x (*r).offset = offset; xpos += min; n -= min; + __ASSERT(offset <= 4096, 0); } (*r).res = 0; (*r).eof = 0; @@ -662,11 +666,13 @@ void Files_Write (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE x) INT32 offset; buf = (*r).buf; offset = (*r).offset; + __ASSERT(offset <= 4096, 0); if ((*r).org != buf->org || offset >= 4096) { Files_Set(&*r, r__typ, buf->f, (*r).org + offset); buf = (*r).buf; offset = (*r).offset; } + __ASSERT(offset < 4096, 0); buf->data[offset] = x; buf->chg = 1; if (offset == buf->size) { @@ -688,11 +694,13 @@ void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT buf = (*r).buf; offset = (*r).offset; while (n > 0) { + __ASSERT(offset <= 4096, 0); if ((*r).org != buf->org || offset >= 4096) { Files_Set(&*r, r__typ, buf->f, (*r).org + offset); buf = (*r).buf; offset = (*r).offset; } + __ASSERT(offset <= 4096, 0); restInBuf = 4096 - offset; if (n > restInBuf) { min = restInBuf; @@ -702,6 +710,7 @@ void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT __MOVE((ADDRESS)x + Files_ToAdr(xpos), (ADDRESS)buf->data + Files_ToAdr(offset), min); offset += min; (*r).offset = offset; + __ASSERT(offset <= 4096, 0); if (offset > buf->size) { buf->f->len += offset - buf->size; buf->size = offset; diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index e9575a26..75bbd79d 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index 37d3265c..6fccacad 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index 5aa43338..38e22dc5 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 6c9fd2b7..5cd3a8f2 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index 2ec0e428..7def082a 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index 8533be52..217eeb29 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index d59b8602..fb6b73a6 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index e92faf91..0531b31c 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index eede7b95..d60c768f 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 36a43b89..8d12d8b8 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index 2e875d8f..53606446 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index 59d1e709..ba967ced 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index 960ea29e..1d5d5fe5 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index 72d77adb..aef09240 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index 92740884..5c6a4918 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index df081a58..45020434 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index b6ecef0e..e4034455 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 5d180b17..230bfeab 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index ad0a4e1c..84dfb3e7 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Out.c b/bootstrap/unix-88/Out.c index bc314d4d..335dfb8b 100644 --- a/bootstrap/unix-88/Out.c +++ b/bootstrap/unix-88/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Out.h b/bootstrap/unix-88/Out.h index e3b542f1..08a49b70 100644 --- a/bootstrap/unix-88/Out.h +++ b/bootstrap/unix-88/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 4d64af83..1a860275 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index ed5faf55..d45341cb 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index e532c10a..4338272f 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index 9e6d921e..da39ccfe 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index 5921a597..884336a1 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index c8760025..2131b02a 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index fedd5ba1..72d11d0a 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index fe5ba341..c2de6638 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/VT100.c b/bootstrap/unix-88/VT100.c index 8b786199..7b0a9006 100644 --- a/bootstrap/unix-88/VT100.c +++ b/bootstrap/unix-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/VT100.h b/bootstrap/unix-88/VT100.h index ca8fd2fa..34999961 100644 --- a/bootstrap/unix-88/VT100.h +++ b/bootstrap/unix-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index e1cc07ba..b5104358 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index c31ea618..54bf5084 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/Compiler.c b/bootstrap/windows-48/Compiler.c index ef5126fc..f25df83b 100644 --- a/bootstrap/windows-48/Compiler.c +++ b/bootstrap/windows-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index 8dee54dd..91d42e8e 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index 68bf9ed7..1415f836 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 6fab39f4..7c7e002a 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -526,6 +526,7 @@ void Files_GetDate (Files_File f, INT32 *t, INT32 *d) INT32 Files_Pos (Files_Rider *r, ADDRESS *r__typ) { + __ASSERT((*r).offset <= 4096, 0); return (*r).org + (*r).offset; } @@ -584,6 +585,7 @@ void Files_Set (Files_Rider *r, ADDRESS *r__typ, Files_File f, INT32 pos) org = 0; offset = 0; } + __ASSERT(offset <= 4096, 0); (*r).buf = buf; (*r).org = org; (*r).offset = offset; @@ -602,6 +604,7 @@ void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x) buf = (*r).buf; offset = (*r).offset; } + __ASSERT(offset <= buf->size, 0); if (offset < buf->size) { *x = buf->data[offset]; (*r).offset = offset + 1; @@ -646,6 +649,7 @@ void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x (*r).offset = offset; xpos += min; n -= min; + __ASSERT(offset <= 4096, 0); } (*r).res = 0; (*r).eof = 0; @@ -662,11 +666,13 @@ void Files_Write (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE x) INT32 offset; buf = (*r).buf; offset = (*r).offset; + __ASSERT(offset <= 4096, 0); if ((*r).org != buf->org || offset >= 4096) { Files_Set(&*r, r__typ, buf->f, (*r).org + offset); buf = (*r).buf; offset = (*r).offset; } + __ASSERT(offset < 4096, 0); buf->data[offset] = x; buf->chg = 1; if (offset == buf->size) { @@ -688,11 +694,13 @@ void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT buf = (*r).buf; offset = (*r).offset; while (n > 0) { + __ASSERT(offset <= 4096, 0); if ((*r).org != buf->org || offset >= 4096) { Files_Set(&*r, r__typ, buf->f, (*r).org + offset); buf = (*r).buf; offset = (*r).offset; } + __ASSERT(offset <= 4096, 0); restInBuf = 4096 - offset; if (n > restInBuf) { min = restInBuf; @@ -702,6 +710,7 @@ void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT __MOVE((ADDRESS)x + Files_ToAdr(xpos), (ADDRESS)buf->data + Files_ToAdr(offset), min); offset += min; (*r).offset = offset; + __ASSERT(offset <= 4096, 0); if (offset > buf->size) { buf->f->len += offset - buf->size; buf->size = offset; diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index 305419c8..268537df 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index be352cc8..9c565b65 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index 620c600d..293dde6d 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index e2a62e9c..be6e0643 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index 2ec0e428..7def082a 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index 8533be52..217eeb29 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index d59b8602..fb6b73a6 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index e92faf91..0531b31c 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index eede7b95..d60c768f 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 63faf68d..9727f400 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index 2e875d8f..53606446 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index ffc41784..334a40ef 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index 960ea29e..1d5d5fe5 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index 72d77adb..aef09240 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index 92740884..5c6a4918 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index a80a5307..cbbea5ee 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index b6ecef0e..e4034455 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index 7eb931aa..7647ce34 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index ad0a4e1c..84dfb3e7 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Out.c b/bootstrap/windows-48/Out.c index 6f988eae..7664fba6 100644 --- a/bootstrap/windows-48/Out.c +++ b/bootstrap/windows-48/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Out.h b/bootstrap/windows-48/Out.h index e3b542f1..08a49b70 100644 --- a/bootstrap/windows-48/Out.h +++ b/bootstrap/windows-48/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 893f8576..168bd702 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index 8d2441f4..6d71e6ec 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index e532c10a..4338272f 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index 9e6d921e..da39ccfe 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index 5921a597..884336a1 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index c8760025..2131b02a 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index 9827cf2e..79978dd0 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index 51e39825..85d96a5c 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/VT100.c b/bootstrap/windows-48/VT100.c index 8b786199..7b0a9006 100644 --- a/bootstrap/windows-48/VT100.c +++ b/bootstrap/windows-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/VT100.h b/bootstrap/windows-48/VT100.h index ca8fd2fa..34999961 100644 --- a/bootstrap/windows-48/VT100.h +++ b/bootstrap/windows-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index e1cc07ba..b5104358 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index c31ea618..54bf5084 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/Compiler.c b/bootstrap/windows-88/Compiler.c index ef5126fc..f25df83b 100644 --- a/bootstrap/windows-88/Compiler.c +++ b/bootstrap/windows-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index 8dee54dd..91d42e8e 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index 68bf9ed7..1415f836 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index b3d5385e..86ac4e72 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -527,6 +527,7 @@ void Files_GetDate (Files_File f, INT32 *t, INT32 *d) INT32 Files_Pos (Files_Rider *r, ADDRESS *r__typ) { + __ASSERT((*r).offset <= 4096, 0); return (*r).org + (*r).offset; } @@ -585,6 +586,7 @@ void Files_Set (Files_Rider *r, ADDRESS *r__typ, Files_File f, INT32 pos) org = 0; offset = 0; } + __ASSERT(offset <= 4096, 0); (*r).buf = buf; (*r).org = org; (*r).offset = offset; @@ -603,6 +605,7 @@ void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x) buf = (*r).buf; offset = (*r).offset; } + __ASSERT(offset <= buf->size, 0); if (offset < buf->size) { *x = buf->data[offset]; (*r).offset = offset + 1; @@ -647,6 +650,7 @@ void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x (*r).offset = offset; xpos += min; n -= min; + __ASSERT(offset <= 4096, 0); } (*r).res = 0; (*r).eof = 0; @@ -663,11 +667,13 @@ void Files_Write (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE x) INT32 offset; buf = (*r).buf; offset = (*r).offset; + __ASSERT(offset <= 4096, 0); if ((*r).org != buf->org || offset >= 4096) { Files_Set(&*r, r__typ, buf->f, (*r).org + offset); buf = (*r).buf; offset = (*r).offset; } + __ASSERT(offset < 4096, 0); buf->data[offset] = x; buf->chg = 1; if (offset == buf->size) { @@ -689,11 +695,13 @@ void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT buf = (*r).buf; offset = (*r).offset; while (n > 0) { + __ASSERT(offset <= 4096, 0); if ((*r).org != buf->org || offset >= 4096) { Files_Set(&*r, r__typ, buf->f, (*r).org + offset); buf = (*r).buf; offset = (*r).offset; } + __ASSERT(offset <= 4096, 0); restInBuf = 4096 - offset; if (n > restInBuf) { min = restInBuf; @@ -703,6 +711,7 @@ void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT __MOVE((ADDRESS)x + Files_ToAdr(xpos), (ADDRESS)buf->data + Files_ToAdr(offset), min); offset += min; (*r).offset = offset; + __ASSERT(offset <= 4096, 0); if (offset > buf->size) { buf->f->len += offset - buf->size; buf->size = offset; diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 47a3d116..031c9316 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index 37d3265c..6fccacad 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index 5aa43338..38e22dc5 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 6c9fd2b7..5cd3a8f2 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index 2ec0e428..7def082a 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index 8533be52..217eeb29 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index d59b8602..fb6b73a6 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index e92faf91..0531b31c 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index eede7b95..d60c768f 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 36a43b89..8d12d8b8 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index 2e875d8f..53606446 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index 59d1e709..ba967ced 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index 960ea29e..1d5d5fe5 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index 72d77adb..aef09240 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index 92740884..5c6a4918 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index df081a58..45020434 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index b6ecef0e..e4034455 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 5d180b17..230bfeab 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index ad0a4e1c..84dfb3e7 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Out.c b/bootstrap/windows-88/Out.c index 6f988eae..7664fba6 100644 --- a/bootstrap/windows-88/Out.c +++ b/bootstrap/windows-88/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Out.h b/bootstrap/windows-88/Out.h index e3b542f1..08a49b70 100644 --- a/bootstrap/windows-88/Out.h +++ b/bootstrap/windows-88/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 8017966b..f556570a 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index 5c38cd8d..c7ff9362 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index e532c10a..4338272f 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index 9e6d921e..da39ccfe 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index 5921a597..884336a1 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index c8760025..2131b02a 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index fedd5ba1..72d11d0a 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index fe5ba341..c2de6638 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/VT100.c b/bootstrap/windows-88/VT100.c index 8b786199..7b0a9006 100644 --- a/bootstrap/windows-88/VT100.c +++ b/bootstrap/windows-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/VT100.h b/bootstrap/windows-88/VT100.h index ca8fd2fa..34999961 100644 --- a/bootstrap/windows-88/VT100.h +++ b/bootstrap/windows-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index e1cc07ba..b5104358 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index c31ea618..54bf5084 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h From 66105ee5ae784d83d8f1d80987d916df657e6d73 Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 18 Nov 2016 14:17:08 +0000 Subject: [PATCH 331/580] Add output of id command to poostpush log. --- src/tools/make/postpush.pl | 1 + 1 file changed, 1 insertion(+) diff --git a/src/tools/make/postpush.pl b/src/tools/make/postpush.pl index 47956785..5cfe3008 100755 --- a/src/tools/make/postpush.pl +++ b/src/tools/make/postpush.pl @@ -17,6 +17,7 @@ sub writelog { flock(LOG, 2) or die "Could not lock postpush.log"; print LOG sprintf("%s %s\n", strftime("%Y/%m/%d %H.%M.%S", localtime), $msg); close(LOG); + system "id >> /tmp/postpush.log"; } my $postdata = from_json(param('POSTDATA')); From 8e1897fe17e6feac4d511e70a629d68045f5fe66 Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 18 Nov 2016 14:49:11 +0000 Subject: [PATCH 332/580] Ha! Still getting the wrong security for new machines to build. Lets try again. --- src/tools/make/postpush.pl | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/tools/make/postpush.pl b/src/tools/make/postpush.pl index 5cfe3008..5bfe0ffb 100755 --- a/src/tools/make/postpush.pl +++ b/src/tools/make/postpush.pl @@ -1,11 +1,9 @@ #!/usr/bin/perl -w - use strict; use warnings; use POSIX "strftime"; - use CGI qw(:standard escapeHTML); use JSON; From bf65c3744b964716d1ce9350d8638180f4f053aa Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 18 Nov 2016 17:10:29 +0000 Subject: [PATCH 333/580] Split windows build into parallel cygwin and mingw builds, remove old nas builds. --- src/tools/make/buildall.pl | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/src/tools/make/buildall.pl b/src/tools/make/buildall.pl index bba5eeca..2207b205 100755 --- a/src/tools/make/buildall.pl +++ b/src/tools/make/buildall.pl @@ -12,22 +12,34 @@ if (defined($ARGV[0]) && ($ARGV[0] ne "")) {$branch = $ARGV[0]} my %machines = ( "pi" => ['pi@pie', "sudo", "projects/oberon/vishap/voc", "make full"], "darwin" => ['dave@dcb', "sudo", "projects/oberon/vishap/voc", "make full"], - "wind" => ['-p5932 dave@wax', "", "vishaps/voc", "export CC=gcc && make full;" - . "export CC=i686-w64-mingw32-gcc && make full;" + +# "wind" => ['-p5932 dave@wax', "", "vishaps/voc", "export CC=gcc && make full;" +# . "export CC=i686-w64-mingw32-gcc && make full;" +# . "cd ~;" +# . "sh start64.sh \\\"cd vishaps/voc && git reset --hard && git clean -dfx &&" +# . "git pull && git checkout $branch && git pull;" +# . "export CC=gcc && make full;" +# . "export CC=x86_64-w64-mingw32-gcc && make full\\\""], + + "cygwin" => ['-p5932 dave@wax', "", "oberon/cygwin/voc", "export CC=gcc && make full;" . "cd ~;" - . "sh start64.sh \\\"cd vishaps/voc && git reset --hard && git clean -dfx &&" + . "sh start64.sh \\\"cd oberon/cygwin/voc && git reset --hard && git clean -dfx &&" . "git pull && git checkout $branch && git pull;" - . "export CC=gcc && make full;" - . "export CC=x86_64-w64-mingw32-gcc && make full\\\""], + . "export CC=gcc && make full;\\\""], + + "mingw" => ['-p5932 dave@wax', "", "oberon/mingw/voc", "export CC=i686-w64-mingw32-gcc && make full;" + . "cd ~;" + . "sh start64.sh \\\"cd oberon/mingw/voc && git reset --hard && git clean -dfx &&" + . "git pull && git checkout $branch && git pull;" + . "export CC=x86_64-w64-mingw32-gcc && make full;\\\""], + "android" => ['-p8022 root@and', "", "vishap/voc", "export CC=gcc && make full"], - "oldlub32"=> ['dave@lub32', "sudo", "vishap/voc", "make full"], "lub64" => ['dave@vim', "sudo", "oberon/voc", "make full"], "lub32" => ['dave@vim-lub32', "sudo", "oberon/voc", "make full"], "fed64" => ['dave@vim-fed64', "sudo", "oberon/voc", "make full"], "osu64" => ['dave@vim-osu64', "sudo", "oberon/voc", "make full"], "ob32" => ['root@nas-ob32', "", "vishap/voc", "make full"], "ce64" => ['-p5922 obe@www', "sudo", "vishap/voc", "make full"], - "ub64" => ['dave@nas-ub64', "sudo", "vishap/voc", "make full"], "fb64" => ['root@oberon', "", "vishap/voc", "make full"] ); From 2321695270324c7342e2443dd03fa1dff1eff273 Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 18 Nov 2016 17:26:10 +0000 Subject: [PATCH 334/580] Hopefully fix 64 bit cygwin and mingw builds. --- src/tools/make/buildall.pl | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/src/tools/make/buildall.pl b/src/tools/make/buildall.pl index 2207b205..0dbb0260 100755 --- a/src/tools/make/buildall.pl +++ b/src/tools/make/buildall.pl @@ -12,27 +12,16 @@ if (defined($ARGV[0]) && ($ARGV[0] ne "")) {$branch = $ARGV[0]} my %machines = ( "pi" => ['pi@pie', "sudo", "projects/oberon/vishap/voc", "make full"], "darwin" => ['dave@dcb', "sudo", "projects/oberon/vishap/voc", "make full"], - -# "wind" => ['-p5932 dave@wax', "", "vishaps/voc", "export CC=gcc && make full;" -# . "export CC=i686-w64-mingw32-gcc && make full;" -# . "cd ~;" -# . "sh start64.sh \\\"cd vishaps/voc && git reset --hard && git clean -dfx &&" -# . "git pull && git checkout $branch && git pull;" -# . "export CC=gcc && make full;" -# . "export CC=x86_64-w64-mingw32-gcc && make full\\\""], - "cygwin" => ['-p5932 dave@wax', "", "oberon/cygwin/voc", "export CC=gcc && make full;" . "cd ~;" . "sh start64.sh \\\"cd oberon/cygwin/voc && git reset --hard && git clean -dfx &&" . "git pull && git checkout $branch && git pull;" . "export CC=gcc && make full;\\\""], - "mingw" => ['-p5932 dave@wax', "", "oberon/mingw/voc", "export CC=i686-w64-mingw32-gcc && make full;" . "cd ~;" . "sh start64.sh \\\"cd oberon/mingw/voc && git reset --hard && git clean -dfx &&" . "git pull && git checkout $branch && git pull;" . "export CC=x86_64-w64-mingw32-gcc && make full;\\\""], - "android" => ['-p8022 root@and', "", "vishap/voc", "export CC=gcc && make full"], "lub64" => ['dave@vim', "sudo", "oberon/voc", "make full"], "lub32" => ['dave@vim-lub32', "sudo", "oberon/voc", "make full"], From 3798b9c5373fa73c8bde65259d859097b9623c47 Mon Sep 17 00:00:00 2001 From: David Brown Date: Sat, 19 Nov 2016 00:42:35 +0000 Subject: [PATCH 335/580] Fix mingw/msc support on pre Windows 10 systems. --- src/runtime/Platformwindows.Mod | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/runtime/Platformwindows.Mod b/src/runtime/Platformwindows.Mod index 6a80bff4..bde70184 100644 --- a/src/runtime/Platformwindows.Mod +++ b/src/runtime/Platformwindows.Mod @@ -435,12 +435,13 @@ END ReadBuf; -PROCEDURE -writefile(fd: FileHandle; p: SYSTEM.ADDRESS; l: LONGINT): INTEGER -"(INTEGER)WriteFile((HANDLE)fd, (void*)(p), (DWORD)l, 0,0)"; +PROCEDURE -writefile(fd: FileHandle; p: SYSTEM.ADDRESS; l: LONGINT; VAR n: SYSTEM.INT32): INTEGER +"(INTEGER)WriteFile((HANDLE)fd, (void*)(p), (DWORD)l, (DWORD*)n, 0)"; PROCEDURE Write*(h: FileHandle; p: SYSTEM.ADDRESS; l: LONGINT): ErrorCode; +VAR n: SYSTEM.INT32; BEGIN - IF writefile(h, p, l) = 0 THEN RETURN err() ELSE RETURN 0 END + IF writefile(h, p, l, n) = 0 THEN RETURN err() ELSE RETURN 0 END END Write; From 036b8eef4197c2eb688ef6956e9cb71d5c458d60 Mon Sep 17 00:00:00 2001 From: David Brown Date: Sat, 19 Nov 2016 15:17:51 +0000 Subject: [PATCH 336/580] Update bootstrap. --- bootstrap/unix-44/Compiler.c | 2 +- bootstrap/unix-44/Configuration.c | 4 ++-- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Files.c | 2 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 2 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 2 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 2 +- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 2 +- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 2 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Out.c | 2 +- bootstrap/unix-44/Out.h | 2 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/VT100.c | 2 +- bootstrap/unix-44/VT100.h | 2 +- bootstrap/unix-44/extTools.c | 2 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-48/Compiler.c | 2 +- bootstrap/unix-48/Configuration.c | 4 ++-- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Files.c | 2 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 2 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 2 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 2 +- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 2 +- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 2 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Out.c | 2 +- bootstrap/unix-48/Out.h | 2 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/VT100.c | 2 +- bootstrap/unix-48/VT100.h | 2 +- bootstrap/unix-48/extTools.c | 2 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-88/Compiler.c | 2 +- bootstrap/unix-88/Configuration.c | 4 ++-- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Files.c | 2 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 2 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 2 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 2 +- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 2 +- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 2 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Out.c | 2 +- bootstrap/unix-88/Out.h | 2 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/VT100.c | 2 +- bootstrap/unix-88/VT100.h | 2 +- bootstrap/unix-88/extTools.c | 2 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/windows-48/Compiler.c | 2 +- bootstrap/windows-48/Configuration.c | 4 ++-- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Files.c | 2 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 2 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 2 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 2 +- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 2 +- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 2 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Out.c | 2 +- bootstrap/windows-48/Out.h | 2 +- bootstrap/windows-48/Platform.c | 7 ++++--- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/VT100.c | 2 +- bootstrap/windows-48/VT100.h | 2 +- bootstrap/windows-48/extTools.c | 2 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-88/Compiler.c | 2 +- bootstrap/windows-88/Configuration.c | 4 ++-- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Files.c | 2 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 2 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 2 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 2 +- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 2 +- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 2 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Out.c | 2 +- bootstrap/windows-88/Out.h | 2 +- bootstrap/windows-88/Platform.c | 7 ++++--- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/VT100.c | 2 +- bootstrap/windows-88/VT100.h | 2 +- bootstrap/windows-88/extTools.c | 2 +- bootstrap/windows-88/extTools.h | 2 +- 185 files changed, 196 insertions(+), 194 deletions(-) diff --git a/bootstrap/unix-44/Compiler.c b/bootstrap/unix-44/Compiler.c index f25df83b..f91f65b0 100644 --- a/bootstrap/unix-44/Compiler.c +++ b/bootstrap/unix-44/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index 91d42e8e..37061819 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index 1415f836..b182309a 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index fca47b71..fc08bb66 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index 139c7610..51464477 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index 9c565b65..28b5931a 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index 293dde6d..a8f43cd4 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index be6e0643..2d6a6601 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index 7def082a..a13681ca 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index 217eeb29..8dde1d6f 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index fb6b73a6..019adbb7 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 0531b31c..4c1eaf60 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index d60c768f..1008f2b2 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 9727f400..bfcd9a7d 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index 53606446..a4631607 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index 334a40ef..2aba6340 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index 1d5d5fe5..ecb8b3dd 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index aef09240..86adcd6a 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index 5c6a4918..13869701 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index f711e45a..48ee337d 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index e4034455..f18e86c7 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index 7647ce34..b219bec1 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index 84dfb3e7..b29088ac 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Out.c b/bootstrap/unix-44/Out.c index 335dfb8b..8cef91b8 100644 --- a/bootstrap/unix-44/Out.c +++ b/bootstrap/unix-44/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Out.h b/bootstrap/unix-44/Out.h index 08a49b70..6c12b541 100644 --- a/bootstrap/unix-44/Out.h +++ b/bootstrap/unix-44/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index d8f1091f..71e9381c 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index 2c06f00f..3e9d5b43 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 4338272f..45163d35 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index da39ccfe..1d66f986 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index 884336a1..1c626264 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index 2131b02a..a9865bc1 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index d9dc4a1e..05d3df80 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index 10794f98..6738320c 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/VT100.c b/bootstrap/unix-44/VT100.c index 7b0a9006..072be052 100644 --- a/bootstrap/unix-44/VT100.c +++ b/bootstrap/unix-44/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/VT100.h b/bootstrap/unix-44/VT100.h index 34999961..68fd3b81 100644 --- a/bootstrap/unix-44/VT100.h +++ b/bootstrap/unix-44/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index b5104358..54bf0d04 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index 54bf5084..fb77b9a7 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/Compiler.c b/bootstrap/unix-48/Compiler.c index f25df83b..f91f65b0 100644 --- a/bootstrap/unix-48/Compiler.c +++ b/bootstrap/unix-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index 91d42e8e..37061819 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index 1415f836..b182309a 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index fca47b71..fc08bb66 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index 139c7610..51464477 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index 9c565b65..28b5931a 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index 293dde6d..a8f43cd4 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index be6e0643..2d6a6601 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index 7def082a..a13681ca 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index 217eeb29..8dde1d6f 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index fb6b73a6..019adbb7 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 0531b31c..4c1eaf60 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index d60c768f..1008f2b2 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 9727f400..bfcd9a7d 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index 53606446..a4631607 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index 334a40ef..2aba6340 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index 1d5d5fe5..ecb8b3dd 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index aef09240..86adcd6a 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index 5c6a4918..13869701 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index cbbea5ee..076b5e16 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index e4034455..f18e86c7 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index 7647ce34..b219bec1 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index 84dfb3e7..b29088ac 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Out.c b/bootstrap/unix-48/Out.c index 335dfb8b..8cef91b8 100644 --- a/bootstrap/unix-48/Out.c +++ b/bootstrap/unix-48/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Out.h b/bootstrap/unix-48/Out.h index 08a49b70..6c12b541 100644 --- a/bootstrap/unix-48/Out.h +++ b/bootstrap/unix-48/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index d8f1091f..71e9381c 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index 2c06f00f..3e9d5b43 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 4338272f..45163d35 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index da39ccfe..1d66f986 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index 884336a1..1c626264 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index 2131b02a..a9865bc1 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index 79978dd0..595fa511 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index 85d96a5c..17506204 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/VT100.c b/bootstrap/unix-48/VT100.c index 7b0a9006..072be052 100644 --- a/bootstrap/unix-48/VT100.c +++ b/bootstrap/unix-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/VT100.h b/bootstrap/unix-48/VT100.h index 34999961..68fd3b81 100644 --- a/bootstrap/unix-48/VT100.h +++ b/bootstrap/unix-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index b5104358..54bf0d04 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index 54bf5084..fb77b9a7 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/Compiler.c b/bootstrap/unix-88/Compiler.c index f25df83b..f91f65b0 100644 --- a/bootstrap/unix-88/Compiler.c +++ b/bootstrap/unix-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index 91d42e8e..37061819 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index 1415f836..b182309a 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index a69b1ca4..a812a3de 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 75bbd79d..3cbd88cf 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index 6fccacad..830efb5f 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index 38e22dc5..c69d655b 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 5cd3a8f2..42f2051a 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index 7def082a..a13681ca 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index 217eeb29..8dde1d6f 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index fb6b73a6..019adbb7 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index 0531b31c..4c1eaf60 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index d60c768f..1008f2b2 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 8d12d8b8..55f7f41b 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index 53606446..a4631607 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index ba967ced..02abdf28 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index 1d5d5fe5..ecb8b3dd 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index aef09240..86adcd6a 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index 5c6a4918..13869701 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index 45020434..2682db8a 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index e4034455..f18e86c7 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 230bfeab..38f21585 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index 84dfb3e7..b29088ac 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Out.c b/bootstrap/unix-88/Out.c index 335dfb8b..8cef91b8 100644 --- a/bootstrap/unix-88/Out.c +++ b/bootstrap/unix-88/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Out.h b/bootstrap/unix-88/Out.h index 08a49b70..6c12b541 100644 --- a/bootstrap/unix-88/Out.h +++ b/bootstrap/unix-88/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 1a860275..a41c8622 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index d45341cb..1fa15be1 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 4338272f..45163d35 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index da39ccfe..1d66f986 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index 884336a1..1c626264 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index 2131b02a..a9865bc1 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index 72d11d0a..a567719a 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index c2de6638..4825ba4c 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/VT100.c b/bootstrap/unix-88/VT100.c index 7b0a9006..072be052 100644 --- a/bootstrap/unix-88/VT100.c +++ b/bootstrap/unix-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/VT100.h b/bootstrap/unix-88/VT100.h index 34999961..68fd3b81 100644 --- a/bootstrap/unix-88/VT100.h +++ b/bootstrap/unix-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index b5104358..54bf0d04 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index 54bf5084..fb77b9a7 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/Compiler.c b/bootstrap/windows-48/Compiler.c index f25df83b..f91f65b0 100644 --- a/bootstrap/windows-48/Compiler.c +++ b/bootstrap/windows-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index 91d42e8e..37061819 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index 1415f836..b182309a 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 7c7e002a..13f94028 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index 268537df..c632b029 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index 9c565b65..28b5931a 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index 293dde6d..a8f43cd4 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index be6e0643..2d6a6601 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index 7def082a..a13681ca 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index 217eeb29..8dde1d6f 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index fb6b73a6..019adbb7 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 0531b31c..4c1eaf60 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index d60c768f..1008f2b2 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 9727f400..bfcd9a7d 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index 53606446..a4631607 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index 334a40ef..2aba6340 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index 1d5d5fe5..ecb8b3dd 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index aef09240..86adcd6a 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index 5c6a4918..13869701 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index cbbea5ee..076b5e16 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index e4034455..f18e86c7 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index 7647ce34..b219bec1 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index 84dfb3e7..b29088ac 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Out.c b/bootstrap/windows-48/Out.c index 7664fba6..082aa1be 100644 --- a/bootstrap/windows-48/Out.c +++ b/bootstrap/windows-48/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Out.h b/bootstrap/windows-48/Out.h index 08a49b70..6c12b541 100644 --- a/bootstrap/windows-48/Out.h +++ b/bootstrap/windows-48/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 168bd702..19195bf6 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -176,7 +176,7 @@ extern void Heap_InitHeap(); #define Platform_ulSec() (LONGINT)(ul.QuadPart / 1000000LL) #define Platform_uluSec() (LONGINT)(ul.QuadPart % 1000000LL) #define Platform_waitForProcess() (INTEGER)WaitForSingleObject(pi.hProcess, INFINITE) -#define Platform_writefile(fd, p, l) (INTEGER)WriteFile((HANDLE)fd, (void*)(p), (DWORD)l, 0,0) +#define Platform_writefile(fd, p, l, n) (INTEGER)WriteFile((HANDLE)fd, (void*)(p), (DWORD)l, (DWORD*)n, 0) BOOLEAN Platform_TooManyFiles (INT16 e) { @@ -525,7 +525,8 @@ INT16 Platform_ReadBuf (INT32 h, SYSTEM_BYTE *b, LONGINT b__len, INT32 *n) INT16 Platform_Write (INT32 h, INT32 p, INT32 l) { - if (Platform_writefile(h, p, l) == 0) { + INT32 n; + if (Platform_writefile(h, p, l, &n) == 0) { return Platform_err(); } else { return 0; diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index 6d71e6ec..162dda27 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 4338272f..45163d35 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index da39ccfe..1d66f986 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index 884336a1..1c626264 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index 2131b02a..a9865bc1 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index 79978dd0..595fa511 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index 85d96a5c..17506204 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/VT100.c b/bootstrap/windows-48/VT100.c index 7b0a9006..072be052 100644 --- a/bootstrap/windows-48/VT100.c +++ b/bootstrap/windows-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/VT100.h b/bootstrap/windows-48/VT100.h index 34999961..68fd3b81 100644 --- a/bootstrap/windows-48/VT100.h +++ b/bootstrap/windows-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index b5104358..54bf0d04 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index 54bf5084..fb77b9a7 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/Compiler.c b/bootstrap/windows-88/Compiler.c index f25df83b..f91f65b0 100644 --- a/bootstrap/windows-88/Compiler.c +++ b/bootstrap/windows-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index 91d42e8e..37061819 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index 1415f836..b182309a 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 86ac4e72..c765bb85 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 031c9316..3af067f2 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index 6fccacad..830efb5f 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index 38e22dc5..c69d655b 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 5cd3a8f2..42f2051a 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index 7def082a..a13681ca 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index 217eeb29..8dde1d6f 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index fb6b73a6..019adbb7 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index 0531b31c..4c1eaf60 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index d60c768f..1008f2b2 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 8d12d8b8..55f7f41b 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index 53606446..a4631607 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index ba967ced..02abdf28 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index 1d5d5fe5..ecb8b3dd 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index aef09240..86adcd6a 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index 5c6a4918..13869701 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index 45020434..2682db8a 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index e4034455..f18e86c7 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 230bfeab..38f21585 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index 84dfb3e7..b29088ac 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Out.c b/bootstrap/windows-88/Out.c index 7664fba6..082aa1be 100644 --- a/bootstrap/windows-88/Out.c +++ b/bootstrap/windows-88/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Out.h b/bootstrap/windows-88/Out.h index 08a49b70..6c12b541 100644 --- a/bootstrap/windows-88/Out.h +++ b/bootstrap/windows-88/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index f556570a..6bc7548d 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -176,7 +176,7 @@ extern void Heap_InitHeap(); #define Platform_ulSec() (LONGINT)(ul.QuadPart / 1000000LL) #define Platform_uluSec() (LONGINT)(ul.QuadPart % 1000000LL) #define Platform_waitForProcess() (INTEGER)WaitForSingleObject(pi.hProcess, INFINITE) -#define Platform_writefile(fd, p, l) (INTEGER)WriteFile((HANDLE)fd, (void*)(p), (DWORD)l, 0,0) +#define Platform_writefile(fd, p, l, n) (INTEGER)WriteFile((HANDLE)fd, (void*)(p), (DWORD)l, (DWORD*)n, 0) BOOLEAN Platform_TooManyFiles (INT16 e) { @@ -525,7 +525,8 @@ INT16 Platform_ReadBuf (INT64 h, SYSTEM_BYTE *b, LONGINT b__len, INT32 *n) INT16 Platform_Write (INT64 h, INT64 p, INT32 l) { - if (Platform_writefile(h, p, l) == 0) { + INT32 n; + if (Platform_writefile(h, p, l, &n) == 0) { return Platform_err(); } else { return 0; diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index c7ff9362..c235aa2b 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 4338272f..45163d35 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index da39ccfe..1d66f986 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index 884336a1..1c626264 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index 2131b02a..a9865bc1 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index 72d11d0a..a567719a 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index c2de6638..4825ba4c 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/VT100.c b/bootstrap/windows-88/VT100.c index 7b0a9006..072be052 100644 --- a/bootstrap/windows-88/VT100.c +++ b/bootstrap/windows-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/VT100.h b/bootstrap/windows-88/VT100.h index 34999961..68fd3b81 100644 --- a/bootstrap/windows-88/VT100.h +++ b/bootstrap/windows-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index b5104358..54bf0d04 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index 54bf5084..fb77b9a7 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h From 1c137d2d7a5e72c980386a1111cac46275c75ba6 Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 24 Nov 2016 12:49:59 +0000 Subject: [PATCH 337/580] Doc updates. Add warning for anonymous ARAY or RECORD parameter types. --- ReadMe.md | 17 +-- doc/Installation.md | 242 +++++++++++++++++------------------ doc/Winstallation.md | 253 +++++++++++++++++++++++++++++++++++++ makefile | 9 +- src/compiler/Compiler.Mod | 1 - src/compiler/OPM.Mod | 28 ++-- src/compiler/OPP.Mod | 6 + src/compiler/OPT.Mod | 3 +- src/runtime/Errors.Txt | 1 + src/tools/make/configure.c | 2 - 10 files changed, 405 insertions(+), 157 deletions(-) create mode 100644 doc/Winstallation.md diff --git a/ReadMe.md b/ReadMe.md index 1330efb6..b5dbdb74 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -32,13 +32,14 @@ with the following simple steps. #### 1. Install prerequisites -| Platform | Packages | -| --------- | ------------ | -| Debian/Ubuntu/Mint ... | `apt-get install git` | -| Fedora/RHEL/CentOS ... | `yum install git gcc glibc-static` | -| FreeBSD/OpenBSD/NetBSD | `pkg install git` | -| Cygwin | use setup-x86[_x64] to add packages git, make and gcc-core | -| Darwin | type 'git' at the command line and accept the prompt to install it. | +| Platform | Packages | +| --------- | ------------ | +| Debian/Ubuntu/Mint ... | `apt-get install git` | +| Fedora/RHEL/CentOS ... | `yum install git gcc glibc-static` (`dnf` instead of `yum` on recent Fedoras) | +| FreeBSD/OpenBSD/NetBSD | `pkg install git` | +| OpenSUSE | `zypper install gcc git-core make glibc-devel-static` | +| Cygwin | use setup-x86[_x64] to add packages git, make, diffutils and gcc-core | +| Darwin | type 'git' at the command line and accept the prompt to install it. | More details, including for MingW and MS C, in [**Installation**](/doc/Installation.md). @@ -50,7 +51,7 @@ More details, including for MingW and MS C, in [**Installation**](/doc/Installat Since 'make full' will install the compiler and libraries, it needs root (unix) or administrator (windows) privileges. -#### 3. Stet your PATH environment variable +#### 3. Set your PATH environment variable Set your path to the installed compiler binary location as reported by make full, e.g. diff --git a/doc/Installation.md b/doc/Installation.md index 64c50555..cbd893ca 100644 --- a/doc/Installation.md +++ b/doc/Installation.md @@ -1,152 +1,154 @@ -#### (Work in progress) +## Building and installation summary + +The Oberon compiler and libraries may be built and installed on Linux based, BSD based or Windows based systems. + +Building on Linux and BSD based systems is reasonably straightforward. First make sure you have he right pre-requites like C compiler and static libraries installed, then clone the repository and run `make full`. + +Full instructions for a Linux/BSD based build follow in the next section. -## TODO - - Organise into summary and per-platfrom sections - - with subsections for linux and BSD variants - - Add pre-requisites. E.g. static library support. +Bulding on Windows is not so simple largely because there is more than one way to do it: -#### Building and installation summary - -1. git clone https://github.com/vishaps/voc -2. cd voc -3. [sudo] make full - -Since 'make full' will install the compiler and libraries, it needs root (unix) or administrator (windows) privileges. - -| System | Install dir | Access required | -| ----------------------- | -------------------------------------- | ------------------------------ | -| Linux | /opt/voc | Needs root except under cygwin | -| BSD | /usr/local/share/voc | Needs root | -| Windows (mingw or Visual C) | %ProgramFiles[(X86)]% | Needs administrator | -| Termux (android) | /data/data/com.termux/files/opt/voc | | + - Install the cygwin project and use Windows from the cygwin bash shell rather like Linux. + With the pre-requisites installed using the cygwin setup.exe gui tool, clone and run make + as on Linux. + This builds a compiler that is dependent on the cygwin environment, and which compiles + Oberon programs to binaries that are themselves dependent on the cygwin environment. + + - Install the cygwin project and the mingw compiler. The Oberon compiler this builds is + still dependent on the cygwin environment, but programs built with this compiler are + Windows binaries dependent only on standard Microsoft APIs and libraries. + + - Use the Windows 10 Bash on Ubuntu on Windows (aka WSL - Windows Subsystem for Linux). + The Oberon compiler can be built in the WSL using exactly the same procedure + as on a normal Ubuntu environment, and the resulting compiler and user programs will run + within the Windows subsystem for Linux. + + - Build with the Microsoft C compiler generating native windows binaries. A make.cmd script + is provided which has been developed for and tested with the free 'Visual C++ build tools' + available at http://landinghub.visualstudio.com/visual-cpp-build-tools. + +For building with Cygwin or native Microsoft C environments see [**Cygwin and MSC Installation**](/doc/Winstallation.md) + +The following sections provide more details for Linux based builds. -#### 32 and 64 bit +### Building the Oberon compiler and libraries on a Linux or BSD based system -The size of compiler built is determined by the C compiler that runs, which is in turn determined by -the shell or command prompt configuration you are running under. +This approach is for + - All Linux based systems + - includes Android (specifically termux on Android) + - includes Windows subsystem for Linux (aka Bash on Ubuntu on Windows) + - All BSD based systems + - includes macOS (Darwin) + +#### 1. Install pre-requisites -The following type sizes follow the built compiler size: +The build process has the following pre-requisites: -| Types | 32 bit builds | 64 bit builds | -| ----- | ------------- | ------------- | -| INTEGER | 16 bit | 32 bit | -| LONGINT, SET | 32 bit | 64 bit | + - gcc (or clang) compiler + - static libraries for the chosen compiler + - git + - make + - diff -Note that many library modules have been written with the assumption that INTEGER -is 16 bit and LONGINT 32 bit, therefore they will only work in 32 bit builds. +Example pre-requisite installation commands: -#### Which compiler? (gcc vs clang) +| Platform | Pre-requisite installation | +| --------- | ------------ | +| Debian/Ubuntu/Mint ... | `apt-get install git` | +| Fedora/RHEL/CentOS ... | `yum install git gcc glibc-static` (`dnf` instead of `yum` on recent Fedoras) | +| FreeBSD/OpenBSD/NetBSD | `pkg install git` | +| OpenSUSE | `zypper install gcc git-core make glibc-devel-static` | -By default make uses the compiler defined in variable CC. This can be overriden by running 'export CC=gcc' or 'export CC=clang' from the command line before running make. +On Mac OS (Darwin) just type the git command. OS/X will tell you that it is not installed and ask if you want to install it (say yes). Note that Darwin builds always use clang, the OS will redirect attempts to use gcc to clang. -*Note*: be sure to run 'make clean' any time you change the value of CC. Otherwise directories will be mixed up. +#### 2. Clone the Oberon compiler repository -*Note*: Darwin (MAC OS/X) redirects gcc to clang, so specifying CC=gcc still builds clang binaries under Darwin. +Create and change to a directory in which to make the compiler and clone with this command: + +`git clone https://github.com/vishaps/voc` + +This will create a subdirectory 'voc' which includes the following files and directories: + +| Name | Content | +| --- | --- | +| src/ | Compiler and library source, build tools and tests. | +| bootstrap/ | Pre-generated C source for the compiler targetting the 5 distinct build models needed. | +| doc/ | Documents (including this one). | +| makefile | Makefile for all BSD- and Linux- like environments. Includes tests. | +| make.cmd | Makefile specifically for native Microsoft C builds. No tests. | + +#### 3. Build and install the Oberon compiler and library -#### Building on Windows +``` +cd voc +[sudo] make full +``` -There are three ways to build on Windows: +The makefile will: -| Type | How to build | Compiled binary uses: | -| ----------- | ------- | --------------------- | -| cygwin | Use 'make' from cygwin bash shell. | cygwin.dll | -| mingw under cygwin | Set CC for mingw then use 'make' from cygwin bash shell. | Win32 API | -| Visual C | Use 'make.cmd' from Visual C command prompt. | Win32 API | + - Compile and run a C program that determines your C compiler and OS's configuration and creates + the files Configuration.Make and Configuration.Mod. + - C Compile the bootstrap C sources to generate an interim Oberon compiler for your configuration. + - Use the interim compiler to compile the src/compiler and src/runtime directories and statically + link the final Oberon compiler. This compiler is then used for the remaining steps. + - Build the .sym file browser command `showdef`. + - Build all the libraries in -O2 mode, and a subset in -OC mode. + - Install the compiler and libraries by copying them to an appropriate location for your OS. + - Run a set of confidence tests. -##### mingw on cygwin +Since installation directories are not generally write accessible to normal users, is is necessary to run +the `make full` command from a root shell, or by using `sudo`. -To use mingw, install the correct sized package and export CC= the compiler name: +The makefile will use either gcc or clang, whichever is installed. If you have both installed you can specify which to use by running either `export CC=gcc` or `export CC=clang` before the `make full` command. - - For 32 bit cygwin - - use setup-x86.exe to add the package mingw64-i686-gcc-core. - - run 'export CC=i686-w64-mingw32-gcc' then 'make full' +#### Installation directories: + +If the makefile succeeds it will end with instructions on how to set your path variable so that the +compiler (voc) is found. + +The installation will be found at: + +| System | Install dir | +| ----------------------- | -------------------------------------- | +| All types of Linux | /opt/voc | +| BSD (including Darwin) | /usr/local/share/voc | +| Termux (android) | /data/data/com.termux/files/opt/voc | | - - For 64 bit cygwin +The installation directory contains: - - use setup-x86\_64.exe to add the package mingw64-x86\_64-gcc-core. - - run 'export CC=x86_64-w64-mingw32-gcc' then 'make full' +| Directory | Content | +| --- | --- | +| bin/ | Compiler and symbol file browser command binaries. | +| lib/ | Static and dynamic link libraries for all (-O2 and -OC) type models. | +| 2/include/ | C compiler header files for -O2 modules | +| 2/sym/ | .sym files for -O2 modules | +| C/include/ | C compiler header files for -OC modules | +| C/sym/ | .sym files for -OC modules | -(*Note*: Don't be put off by the name 'mingw64' in the 32 bit package.) -##### Microsoft Visual C compiler -Use the free command line Visual C++ compiler. At the time of writing it can be -downloaded here: +### 32 and 64 bit - http://landinghub.visualstudio.com/visual-cpp-build-tools +The compiler may be built on both 32 bit and 64 bit systems. -For example (Windows 10): +Oberon programs may be compiled using the -O2 (default) or -OC elementary type models. The elementary +types are as follows: -Start an adminstrator command prompt from the start button as follows: +| Model | 8 bit | 16 bit | 32 bit | 64 bit | +| --- | ---- | --- | --- | --- | +| -O2 (default) | `SHORTINT` | `INTEGER` | `LONGINT` and `SET` | `HUGEINT` | +| -OC | `BYTE` | `SHORTINT` | `INTEGER` | `LONGINT` and `SET` | - Start / All apps / Visual C++ Build Tools +A convention of many Oberon compilers has been that LONGINT is a suitable integer type for +manipulating addresses. However since the size of pointer types is fixed by the OS and we +support both 32 and 64 bit operating systems, LONGINT is not always sufficient for us. -Right click on +Accordingly, the SYSTEM module has been updated to ease the development of platform independent +code, with new types such as `SYSTEM.INT8`, `SYSTEM.INT16`, `SYSTEM.INT32`, `SYSTEM.INT64` +and `SYSTEM.ADDRESS`. - Visual C++ 2015 x86 Native Build Tools Command Prompt - -or - - Visual C++ 2015 x64 Native Build Tools Command Prompt - -And select - - More / Administrative Command Prompt - -#### How make adapts to each platform - -On all platforms other than Visual C on Windows, make runs from a bash shell, -using makefile in the enlistment root, and vishap.make in the src/tools/make -directory. - -For Visual C only, there is a slightly cut down implementation of the same -functionality in the file 'make.cmd' in the enlistment root. - -In all cases src/tools/make/configure.c is executed to determine all -platform dependent parameters: it generates two files: - - - Configuration.Make: a set of environment variables included by the makefile - - Configuration.Mod: An Oberon MODULE containing just configuraton constants. - -The following examples correspond to a 32 bit Ubuntu build using GCC: - -Configuration.Make: - - OLANGDIR=/home/dave/projects/oberon/olang - COMPILER=gcc - OS=ubuntu - VERSION=1.2 - ONAME=voc - DATAMODEL=ILP32 - INTSIZE=2 - ADRSIZE=4 - ALIGNMENT=4 - INSTALLDIR=/opt/voc - PLATFORM=unix - BINEXT= - COMPILE=gcc -fPIC -g - STATICLINK=-static - LDCONFIG=if echo "/opt/voc/lib" >/etc/ld.so.conf.d/libvoc.conf; then ldconfig; fi - -Configuration.Mod: - - MODULE Configuration; - CONST - name* = 'voc'; - versionLong* = '1.2 [2016/06/11] for gcc ILP32 on ubuntu'; - intsize* = 2; - addressSize* = 4; - alignment* = 4; - objext* = '.o'; - objflag* = ' -o '; - linkflags* = ' -L"'; - libspec* = ' -l voc'; - compile* = 'gcc -fPIC -g'; - dataModel* = 'ILP32'; - installdir* = '/opt/voc'; - staticLink* = '-static'; - END Configuration. +For details, see [**Features**](doc/Features.md). diff --git a/doc/Winstallation.md b/doc/Winstallation.md new file mode 100644 index 00000000..b7a1f1b0 --- /dev/null +++ b/doc/Winstallation.md @@ -0,0 +1,253 @@ +### Building the Oberon compiler and libraries on a Windows system + +This approach is for Windows systems using + - Cygwin (with or without mingw) + - Microsoft Visual C + +Building on Bash on Ubuntu on Windows (aka Windows Subsystem for Linux) is the same as building on Ubuntu, +for which see [**Installation**](/doc/Installation.md). + +### Building and installing with Cygwin + +Cygwin comes in 32 bit and 64 bit flavours, and both may be installed on a 64 bit system. On such a dual system, Oberon may be built and installed in both Cygwins. + + +#### 1. Install pre-requisites + +The build process has the following pre-requisites: + + - gcc (or clang) compiler + - static libraries for the chosen compiler + - git + - make + - diff + +To install these, run the Cygwin setup program (setup-x86.exe or setup-x86_64.exe as appropriate), work +your way through the initaial questions until you reach the 'Select packages' page, and make sure the +following packages are selected: + +| Section | Package | +| --- | --- | +| devel | binutils | +| devel | git | +| devel | gcc-core | +| devel | make | +| utils | diffutils | + +Click next and continue to the end of setup. + +#### 2. Clone the Oberon compiler repository + +Create and change to a directory in which to make the compiler and clone with this command: + +`git clone https://github.com/vishaps/voc` + +This will create a subdirectory 'voc' including the following files and directories: + +| Name | Content | +| --- | --- | +| src/ | Compiler and library source, build tools and tests. | +| bootstrap/ | Pre-generated C source for the compiler targetting the 5 distinct build models needed. | +| doc/ | Documents (including this one). | +| makefile | Makefile for all BSD- and Linux- like environments. Includes tests. | +| make.cmd | Makefile specifically for native Microsoft C builds. No tests. | + +#### 3. Build and install the Oberon compiler and library + + +``` +cd voc +[sudo] make full +``` + +The makefile will: + + - Compile and run a C program that determines your C compiler and OS's configuration and creates + the files Configuration.Make and Configuration.Mod. + - C Compile the bootstrap C sources to generate an interim Oberon compiler for your configuration. + - Use the interim compiler to compile the src/compiler and src/runtime directories and statically + link the final Oberon compiler. This compiler is then used for the remaining steps. + - Build the .sym file browser command `showdef`. + - Build all the libraries in -O2 mode, and a subset in -OC mode. + - Install the compiler and libraries by copying them to an appropriate location for your OS. + - Run a set of confidence tests. + + + Since installation directories are not generally write accessible to normal users, is is necessary to run + the `make full` command from a root shell, or by using `sudo`. + + #### Installation directories: + + If it succeeds the makefile will end with instructions on how to set your path variable so that the + compiler (voc) is found. + + The installation will be found at: + +| System | Install dir | +| ----------------------- | -------------------------------------- | +| All types of Linux | /opt/voc | +| BSD (including Darwin) | /usr/local/share/voc | +| Termux (android) | /data/data/com.termux/files/opt/voc | | + +The installation directory contains: + +| Directory | Content | +| --- | --- | +| bin/ | Compiler and symbol file browser command binaries. | +| lib/ | Static and dynamic link libraries for all (-O2 and -OC) type models. | +| 2/include/ | C compiler header files for -O2 modules | +| 2/sym/ | .sym files for -O2 modules | +| C/include/ | C compiler header files for -OC modules | +| C/sym/ | .sym files for -OC modules | + + + +### 32 and 64 bit + +The compiler may be built on both 32 bit and 64 bit systems. + +User Oberon programs may be compiled using the -O2 (default) or -OC elementary type models. The elementary +types are as follows: + +| Model | 8 bit types | 16 bit types | 32 bit types | 64 bit types | +| --- | ---- | --- | --- | --- | +| -O2 (default) | `SHORTINT` | `INTEGER` | `LONGINT` and `SET` | `HUGEINT` | +| -OC | `BYTE` | `SHORTINT` | `INTEGER` | `LONGINT` and `SET` | + +Of course the size of pointer types is fixed by the OS. + +The SYSTEM module has been updated to ease the development of platform independent code, with new +types such as `SYSTEM.INT8`, `SYSTEM.INT16`, `SYSTEM.INT32`, `SYSTEM.INT64` and `SYSTEM.ADDRESS`. + +For more details, see [**Features**](doc/Features.md). + +---- + +---- + +The size of compiler built is determined by the C compiler that runs, which is in turn determined by +the shell or command prompt configuration you are running under. + +The following type sizes follow the built compiler size: + +| Types | 32 bit builds | 64 bit builds | +| ----- | ------------- | ------------- | +| INTEGER | 16 bit | 32 bit | +| LONGINT, SET | 32 bit | 64 bit | + +Note that many library modules have been written with the assumption that INTEGER +is 16 bit and LONGINT 32 bit, therefore they will only work in 32 bit builds. + +#### Which compiler? (gcc vs clang) + +By default make uses the compiler defined in variable CC. This can be overriden by running 'export CC=gcc' or 'export CC=clang' from the command line before running make. + +*Note*: be sure to run 'make clean' any time you change the value of CC. Otherwise directories will be mixed up. + +*Note*: Darwin (MAC OS/X) redirects gcc to clang, so specifying CC=gcc still builds clang binaries under Darwin. + + +#### Building on Windows + +There are three ways to build on Windows: + +| Type | How to build | Compiled binary uses: | +| ----------- | ------- | --------------------- | +| cygwin | Use 'make' from cygwin bash shell. | cygwin.dll | +| mingw under cygwin | Set CC for mingw then use 'make' from cygwin bash shell. | Win32 API | +| Visual C | Use 'make.cmd' from Visual C command prompt. | Win32 API | + +##### mingw on cygwin + +To use mingw, install the correct sized package and export CC= the compiler name: + + - For 32 bit cygwin + + - use setup-x86.exe to add the package mingw64-i686-gcc-core. + - run 'export CC=i686-w64-mingw32-gcc' then 'make full' + + - For 64 bit cygwin + + - use setup-x86\_64.exe to add the package mingw64-x86\_64-gcc-core. + - run 'export CC=x86_64-w64-mingw32-gcc' then 'make full' + +(*Note*: Don't be put off by the name 'mingw64' in the 32 bit package.) + +##### Microsoft Visual C compiler + +Use the free command line Visual C++ compiler. At the time of writing it can be +downloaded here: + + http://landinghub.visualstudio.com/visual-cpp-build-tools + +For example (Windows 10): + +Start an adminstrator command prompt from the start button as follows: + + Start / All apps / Visual C++ Build Tools + +Right click on + + Visual C++ 2015 x86 Native Build Tools Command Prompt + +or + + Visual C++ 2015 x64 Native Build Tools Command Prompt + +And select + + More / Administrative Command Prompt + +#### How make adapts to each platform + +On all platforms other than Visual C on Windows, make runs from a bash shell, +using makefile in the enlistment root, and vishap.make in the src/tools/make +directory. + +For Visual C only, there is a slightly cut down implementation of the same +functionality in the file 'make.cmd' in the enlistment root. + +In all cases src/tools/make/configure.c is executed to determine all +platform dependent parameters: it generates two files: + + - Configuration.Make: a set of environment variables included by the makefile + - Configuration.Mod: An Oberon MODULE containing just configuraton constants. + +The following examples correspond to a 32 bit Ubuntu build using GCC: + +Configuration.Make: + + OLANGDIR=/home/dave/projects/oberon/olang + COMPILER=gcc + OS=ubuntu + VERSION=1.2 + ONAME=voc + DATAMODEL=ILP32 + INTSIZE=2 + ADRSIZE=4 + ALIGNMENT=4 + INSTALLDIR=/opt/voc + PLATFORM=unix + BINEXT= + COMPILE=gcc -fPIC -g + STATICLINK=-static + LDCONFIG=if echo "/opt/voc/lib" >/etc/ld.so.conf.d/libvoc.conf; then ldconfig; fi + +Configuration.Mod: + + MODULE Configuration; + CONST + name* = 'voc'; + versionLong* = '1.2 [2016/06/11] for gcc ILP32 on ubuntu'; + intsize* = 2; + addressSize* = 4; + alignment* = 4; + objext* = '.o'; + objflag* = ' -o '; + linkflags* = ' -L"'; + libspec* = ' -l voc'; + compile* = 'gcc -fPIC -g'; + dataModel* = 'ILP32'; + installdir* = '/opt/voc'; + staticLink* = '-static'; + END Configuration. diff --git a/makefile b/makefile index 39da025f..12924600 100644 --- a/makefile +++ b/makefile @@ -85,15 +85,8 @@ usage: @echo " (Needs root access)" @echo "" @echo "Targets for (re)creating and reverting bootstrap C sources:" - @echo " make bootstrap - Uddate bootstrap C source directories. Always run on 64 bit." + @echo " make bootstrap - Update bootstrap C source directories." @echo " make revertbootstrap - Use git checkout to restore bootstrap C source directories" - @echo "" - @echo "" - @echo "Multi-platform coordinated network build:" - @echo " make coordinator - Start central task to trigger builds and collect logs" - @echo " make auto - Start machine specific build server" - @echo " make autobuild - Trigger all machines running 'make auto' to start a build" - @echo " make autobuild - Terminate 'make auto' on all machines" diff --git a/src/compiler/Compiler.Mod b/src/compiler/Compiler.Mod index 4ec44f03..0a373e7a 100644 --- a/src/compiler/Compiler.Mod +++ b/src/compiler/Compiler.Mod @@ -68,7 +68,6 @@ MODULE Compiler; (* J. Templ 3.2.95 *) OPT.intobj.typ := OPT.inttyp; OPT.lintobj.typ := OPT.linttyp; - (*OPT.settyp.size := OPM.SetSize;*) CASE OPM.LongintSize OF |4: OPT.settyp := OPT.set32typ ELSE OPT.settyp := OPT.set64typ diff --git a/src/compiler/OPM.Mod b/src/compiler/OPM.Mod index c72912a7..fe43393b 100644 --- a/src/compiler/OPM.Mod +++ b/src/compiler/OPM.Mod @@ -92,7 +92,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) GlobalAlignment, Alignment*: INTEGER; GlobalOptions*, Options*: SET; - ShortintSize*, IntegerSize*, LongintSize*, SetSize*: INTEGER; + ShortintSize*, IntegerSize*, LongintSize*: INTEGER; MaxIndex*: SYSTEM.INT64; @@ -214,13 +214,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) ASSERT((IntegerSize = 2) OR (IntegerSize = 4)); ASSERT((AddressSize = 4) OR (AddressSize = 8)); ASSERT((Alignment = 4) OR (Alignment = 8)); - IF IntegerSize = 2 THEN - LongintSize := 4; - SetSize := 4; - ELSE - LongintSize := 8; - SetSize := 8; - END; + IF IntegerSize = 2 THEN LongintSize := 4 ELSE LongintSize := 8 END; Files.SetSearchPath("") ELSE LogWStr(" warning: option "); @@ -317,11 +311,11 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) BEGIN LogWLn; LogWStr("Type Size"); LogWLn; - LogWStr("SHORTINT "); LogWNum(ShortintSize, 4); (* LogWNum(SIntAlign, 5); *) LogWLn; - LogWStr("INTEGER "); LogWNum(IntegerSize, 4); (* LogWNum(IntAlign, 5); *) LogWLn; - LogWStr("LONGINT "); LogWNum(LongintSize, 4); (* LogWNum(LIntAlign, 5); *) LogWLn; - LogWStr("SET "); LogWNum(SetSize, 4); (* LogWNum(SetAlign, 5); *) LogWLn; - LogWStr("ADDRESS "); LogWNum(AddressSize, 4); (* LogWNum(PointerAlign, 5); *) LogWLn; + LogWStr("SHORTINT "); LogWNum(ShortintSize, 4); LogWLn; + LogWStr("INTEGER "); LogWNum(IntegerSize, 4); LogWLn; + LogWStr("LONGINT "); LogWNum(LongintSize, 4); LogWLn; + LogWStr("SET "); LogWNum(LongintSize, 4); LogWLn; + LogWStr("ADDRESS "); LogWNum(AddressSize, 4); LogWLn; LogWLn; LogWStr("Alignment: "); LogWNum(Alignment, 4); LogWLn; END VerboseListSizes; @@ -344,10 +338,10 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) MaxIndex := SignedMaximum(AddressSize); CASE Model[0] OF - |'2': ShortintSize := 1; IntegerSize := 2; LongintSize := 4; SetSize := 4 - |'C': ShortintSize := 2; IntegerSize := 4; LongintSize := 8; SetSize := 8 - |'V': ShortintSize := 1; IntegerSize := 4; LongintSize := 8; SetSize := 8 - ELSE ShortintSize := 1; IntegerSize := 2; LongintSize := 4; SetSize := 4 + |'2': ShortintSize := 1; IntegerSize := 2; LongintSize := 4 + |'C': ShortintSize := 2; IntegerSize := 4; LongintSize := 8 + |'V': ShortintSize := 1; IntegerSize := 4; LongintSize := 8 + ELSE ShortintSize := 1; IntegerSize := 2; LongintSize := 4 END; IF verbose IN Options THEN VerboseListSizes END; diff --git a/src/compiler/OPP.Mod b/src/compiler/OPP.Mod index 72b6701d..329d52b4 100644 --- a/src/compiler/OPP.Mod +++ b/src/compiler/OPP.Mod @@ -218,6 +218,12 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) END END ; CheckSym(OPS.colon); Type(typ, OPT.notyp); + + IF ((typ.comp = OPT.Array) OR (typ.comp = OPT.Record)) + & (typ.strobj = NIL) THEN + err(-309) + END; + IF mode = OPT.Var THEN typ^.pvused := TRUE END ; (* typ^.pbused is set when parameter type name is parsed *) WHILE first # NIL DO first^.typ := typ; first := first^.link END ; diff --git a/src/compiler/OPT.Mod b/src/compiler/OPT.Mod index 75ad6c72..54975745 100644 --- a/src/compiler/OPT.Mod +++ b/src/compiler/OPT.Mod @@ -1327,10 +1327,10 @@ BEGIN topScope := NIL; OpenScope(0, NIL); OPM.errpos := 0; EnterProc("NEW", sysnewfn); EnterProc("MOVE", movefn); + syslink := topScope^.right; universe := topScope; topScope^.right := NIL; - EnterTyp("BOOLEAN", Bool, 1, booltyp); EnterTyp("CHAR", Char, 1, chartyp); EnterTyp("REAL", Real, 4, realtyp); @@ -1338,6 +1338,7 @@ BEGIN topScope := NIL; OpenScope(0, NIL); OPM.errpos := 0; EnterTyp("HUGEINT", Int, 8, hinttyp); EnterTyp("BYTE@", Int, 1, cpbytetyp); (* Component Pascal byte type, enabled in Compiler.PropagateElementaryTypeSize *) + (* Type aliases for standard integer and set types are linked to real types in Compiler.PropagateElementaryTypeSize *) EnterTypeAlias("SHORTINT", sintobj); EnterTypeAlias("INTEGER", intobj); EnterTypeAlias("LONGINT", lintobj); diff --git a/src/runtime/Errors.Txt b/src/runtime/Errors.Txt index a5cea1f1..5e608945 100644 --- a/src/runtime/Errors.Txt +++ b/src/runtime/Errors.Txt @@ -176,6 +176,7 @@ Compiler Warnings 306 inappropriate symbol file ignored 307 no ELSE symbol after CASE statement sequence may lead to trap 308 SYSTEM.VAL result includes memory past end of source variable; use SYSTEM.GET +309 you should name this parameter type, or else no actual parameter will match Run-time Error Messages -1 assertion failed, cf. SYSTEM_assert diff --git a/src/tools/make/configure.c b/src/tools/make/configure.c index 13ea087a..24b7b903 100644 --- a/src/tools/make/configure.c +++ b/src/tools/make/configure.c @@ -11,8 +11,6 @@ #define O_VER 1.95 // Version number to be reported by compiler. #define O_NAME voc // Compiler name used for binary, install dir and references in text. -// #define LARGE // Define this to get 32 bit INTEGER and 64 bit longints even on 32 bit platforms. - #include "SYSTEM.h" From 610cc38efac38b6524a20133971529b5f5efb4c1 Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 24 Nov 2016 13:06:00 +0000 Subject: [PATCH 338/580] Update C bootstrap source. --- bootstrap/unix-44/Compiler.c | 2 +- bootstrap/unix-44/Configuration.c | 4 +-- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Files.c | 2 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 2 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 2 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 12 ++------ bootstrap/unix-44/OPM.h | 4 +-- bootstrap/unix-44/OPP.c | 5 ++- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 2 +- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 2 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Out.c | 2 +- bootstrap/unix-44/Out.h | 2 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/VT100.c | 2 +- bootstrap/unix-44/VT100.h | 2 +- bootstrap/unix-44/extTools.c | 2 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-48/Compiler.c | 2 +- bootstrap/unix-48/Configuration.c | 4 +-- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Files.c | 2 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 2 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 2 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 12 ++------ bootstrap/unix-48/OPM.h | 4 +-- bootstrap/unix-48/OPP.c | 5 ++- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 2 +- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 2 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Out.c | 2 +- bootstrap/unix-48/Out.h | 2 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/VT100.c | 2 +- bootstrap/unix-48/VT100.h | 2 +- bootstrap/unix-48/extTools.c | 2 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-88/Compiler.c | 2 +- bootstrap/unix-88/Configuration.c | 4 +-- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Files.c | 2 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 2 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 2 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 12 ++------ bootstrap/unix-88/OPM.h | 4 +-- bootstrap/unix-88/OPP.c | 5 ++- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 2 +- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 2 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Out.c | 2 +- bootstrap/unix-88/Out.h | 2 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/VT100.c | 2 +- bootstrap/unix-88/VT100.h | 2 +- bootstrap/unix-88/extTools.c | 2 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/windows-48/Compiler.c | 2 +- bootstrap/windows-48/Configuration.c | 4 +-- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Files.c | 2 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 2 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 2 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 12 ++------ bootstrap/windows-48/OPM.h | 4 +-- bootstrap/windows-48/OPP.c | 5 ++- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 2 +- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 2 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Out.c | 2 +- bootstrap/windows-48/Out.h | 2 +- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/VT100.c | 2 +- bootstrap/windows-48/VT100.h | 2 +- bootstrap/windows-48/extTools.c | 2 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-88/Compiler.c | 2 +- bootstrap/windows-88/Configuration.c | 4 +-- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Files.c | 2 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 2 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 2 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 12 ++------ bootstrap/windows-88/OPM.h | 4 +-- bootstrap/windows-88/OPP.c | 5 ++- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 2 +- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 2 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Out.c | 2 +- bootstrap/windows-88/Out.h | 2 +- bootstrap/windows-88/Platform.c | 2 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/VT100.c | 2 +- bootstrap/windows-88/VT100.h | 2 +- bootstrap/windows-88/extTools.c | 2 +- bootstrap/windows-88/extTools.h | 2 +- doc/Installation.md | 46 ++++++++++++++-------------- doc/Winstallation.md | 39 ++++++++++++----------- 187 files changed, 264 insertions(+), 276 deletions(-) diff --git a/bootstrap/unix-44/Compiler.c b/bootstrap/unix-44/Compiler.c index f91f65b0..dc4bb660 100644 --- a/bootstrap/unix-44/Compiler.c +++ b/bootstrap/unix-44/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index 37061819..2d0061df 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index b182309a..b28e0caa 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index fc08bb66..548774b0 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index 51464477..79164af5 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index 28b5931a..72677604 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index a8f43cd4..0aa0a18b 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index 2d6a6601..a5e72ba3 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index a13681ca..8bb89fe5 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index 8dde1d6f..3ef8e2f9 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index 019adbb7..0be714e8 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 4c1eaf60..ef4b429f 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index 1008f2b2..842e7dec 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index bfcd9a7d..e76d763e 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -26,7 +26,7 @@ export INT16 OPM_AddressSize; static INT16 OPM_GlobalAlignment; export INT16 OPM_Alignment; export UINT32 OPM_GlobalOptions, OPM_Options; -export INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; +export INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize; export INT64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; @@ -245,10 +245,8 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len) __ASSERT(OPM_Alignment == 4 || OPM_Alignment == 8, 0); if (OPM_IntegerSize == 2) { OPM_LongintSize = 4; - OPM_SetSize = 4; } else { OPM_LongintSize = 8; - OPM_SetSize = 8; } Files_SetSearchPath((CHAR*)"", 1); break; @@ -395,7 +393,7 @@ static void OPM_VerboseListSizes (void) OPM_LogWNum(OPM_LongintSize, 4); OPM_LogWLn(); OPM_LogWStr((CHAR*)"SET ", 12); - OPM_LogWNum(OPM_SetSize, 4); + OPM_LogWNum(OPM_LongintSize, 4); OPM_LogWLn(); OPM_LogWStr((CHAR*)"ADDRESS ", 12); OPM_LogWNum(OPM_AddressSize, 4); @@ -432,25 +430,21 @@ void OPM_InitOptions (void) OPM_ShortintSize = 1; OPM_IntegerSize = 2; OPM_LongintSize = 4; - OPM_SetSize = 4; break; case 'C': OPM_ShortintSize = 2; OPM_IntegerSize = 4; OPM_LongintSize = 8; - OPM_SetSize = 8; break; case 'V': OPM_ShortintSize = 1; OPM_IntegerSize = 4; OPM_LongintSize = 8; - OPM_SetSize = 8; break; default: OPM_ShortintSize = 1; OPM_IntegerSize = 2; OPM_LongintSize = 4; - OPM_SetSize = 4; break; } if (__IN(18, OPM_Options, 32)) { diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index a4631607..2d272feb 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h @@ -9,7 +9,7 @@ import CHAR OPM_Model[10]; import INT16 OPM_AddressSize, OPM_Alignment; import UINT32 OPM_GlobalOptions, OPM_Options; -import INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; +import INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize; import INT64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index 2aba6340..3f360d00 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -392,6 +392,9 @@ static void OPP_FormalParameters (OPT_Object *firstPar, OPT_Struct *resTyp) } OPP_CheckSym(20); OPP_Type(&typ, &OPT_notyp); + if (((typ->comp == 2 || typ->comp == 4) && typ->strobj == NIL)) { + OPP_err(-309); + } if (mode == 1) { typ->pvused = 1; } diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index ecb8b3dd..5a71eb39 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index 86adcd6a..6ee700e5 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index 13869701..1f7a3e58 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index 48ee337d..fb007184 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index f18e86c7..90fcacf5 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index b219bec1..5c21cb97 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index b29088ac..c4a61586 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Out.c b/bootstrap/unix-44/Out.c index 8cef91b8..39f383cf 100644 --- a/bootstrap/unix-44/Out.c +++ b/bootstrap/unix-44/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Out.h b/bootstrap/unix-44/Out.h index 6c12b541..0e66420d 100644 --- a/bootstrap/unix-44/Out.h +++ b/bootstrap/unix-44/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 71e9381c..72c15bf8 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index 3e9d5b43..b04f552d 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 45163d35..cd4c3c61 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index 1d66f986..f0c84ab1 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index 1c626264..b5707327 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index a9865bc1..c987af8d 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index 05d3df80..0ac5c5f2 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index 6738320c..0d5201cb 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/VT100.c b/bootstrap/unix-44/VT100.c index 072be052..f69fd90e 100644 --- a/bootstrap/unix-44/VT100.c +++ b/bootstrap/unix-44/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/VT100.h b/bootstrap/unix-44/VT100.h index 68fd3b81..d99406ec 100644 --- a/bootstrap/unix-44/VT100.h +++ b/bootstrap/unix-44/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index 54bf0d04..37630d23 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index fb77b9a7..63e5df15 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/Compiler.c b/bootstrap/unix-48/Compiler.c index f91f65b0..dc4bb660 100644 --- a/bootstrap/unix-48/Compiler.c +++ b/bootstrap/unix-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index 37061819..2d0061df 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index b182309a..b28e0caa 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index fc08bb66..548774b0 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index 51464477..79164af5 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index 28b5931a..72677604 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index a8f43cd4..0aa0a18b 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index 2d6a6601..a5e72ba3 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index a13681ca..8bb89fe5 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index 8dde1d6f..3ef8e2f9 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index 019adbb7..0be714e8 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 4c1eaf60..ef4b429f 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index 1008f2b2..842e7dec 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index bfcd9a7d..e76d763e 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -26,7 +26,7 @@ export INT16 OPM_AddressSize; static INT16 OPM_GlobalAlignment; export INT16 OPM_Alignment; export UINT32 OPM_GlobalOptions, OPM_Options; -export INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; +export INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize; export INT64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; @@ -245,10 +245,8 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len) __ASSERT(OPM_Alignment == 4 || OPM_Alignment == 8, 0); if (OPM_IntegerSize == 2) { OPM_LongintSize = 4; - OPM_SetSize = 4; } else { OPM_LongintSize = 8; - OPM_SetSize = 8; } Files_SetSearchPath((CHAR*)"", 1); break; @@ -395,7 +393,7 @@ static void OPM_VerboseListSizes (void) OPM_LogWNum(OPM_LongintSize, 4); OPM_LogWLn(); OPM_LogWStr((CHAR*)"SET ", 12); - OPM_LogWNum(OPM_SetSize, 4); + OPM_LogWNum(OPM_LongintSize, 4); OPM_LogWLn(); OPM_LogWStr((CHAR*)"ADDRESS ", 12); OPM_LogWNum(OPM_AddressSize, 4); @@ -432,25 +430,21 @@ void OPM_InitOptions (void) OPM_ShortintSize = 1; OPM_IntegerSize = 2; OPM_LongintSize = 4; - OPM_SetSize = 4; break; case 'C': OPM_ShortintSize = 2; OPM_IntegerSize = 4; OPM_LongintSize = 8; - OPM_SetSize = 8; break; case 'V': OPM_ShortintSize = 1; OPM_IntegerSize = 4; OPM_LongintSize = 8; - OPM_SetSize = 8; break; default: OPM_ShortintSize = 1; OPM_IntegerSize = 2; OPM_LongintSize = 4; - OPM_SetSize = 4; break; } if (__IN(18, OPM_Options, 32)) { diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index a4631607..2d272feb 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h @@ -9,7 +9,7 @@ import CHAR OPM_Model[10]; import INT16 OPM_AddressSize, OPM_Alignment; import UINT32 OPM_GlobalOptions, OPM_Options; -import INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; +import INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize; import INT64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index 2aba6340..3f360d00 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -392,6 +392,9 @@ static void OPP_FormalParameters (OPT_Object *firstPar, OPT_Struct *resTyp) } OPP_CheckSym(20); OPP_Type(&typ, &OPT_notyp); + if (((typ->comp == 2 || typ->comp == 4) && typ->strobj == NIL)) { + OPP_err(-309); + } if (mode == 1) { typ->pvused = 1; } diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index ecb8b3dd..5a71eb39 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index 86adcd6a..6ee700e5 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index 13869701..1f7a3e58 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 076b5e16..75820a95 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index f18e86c7..90fcacf5 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index b219bec1..5c21cb97 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index b29088ac..c4a61586 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Out.c b/bootstrap/unix-48/Out.c index 8cef91b8..39f383cf 100644 --- a/bootstrap/unix-48/Out.c +++ b/bootstrap/unix-48/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Out.h b/bootstrap/unix-48/Out.h index 6c12b541..0e66420d 100644 --- a/bootstrap/unix-48/Out.h +++ b/bootstrap/unix-48/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 71e9381c..72c15bf8 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index 3e9d5b43..b04f552d 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 45163d35..cd4c3c61 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index 1d66f986..f0c84ab1 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index 1c626264..b5707327 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index a9865bc1..c987af8d 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index 595fa511..ad26b1cb 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index 17506204..e2c03958 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/VT100.c b/bootstrap/unix-48/VT100.c index 072be052..f69fd90e 100644 --- a/bootstrap/unix-48/VT100.c +++ b/bootstrap/unix-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/VT100.h b/bootstrap/unix-48/VT100.h index 68fd3b81..d99406ec 100644 --- a/bootstrap/unix-48/VT100.h +++ b/bootstrap/unix-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index 54bf0d04..37630d23 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index fb77b9a7..63e5df15 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/Compiler.c b/bootstrap/unix-88/Compiler.c index f91f65b0..dc4bb660 100644 --- a/bootstrap/unix-88/Compiler.c +++ b/bootstrap/unix-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index 37061819..2d0061df 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index b182309a..b28e0caa 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index a812a3de..826c3d63 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 3cbd88cf..855c5f7c 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index 830efb5f..a2bb8f2f 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index c69d655b..163cad8c 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 42f2051a..4e4d62e7 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index a13681ca..8bb89fe5 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index 8dde1d6f..3ef8e2f9 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index 019adbb7..0be714e8 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index 4c1eaf60..ef4b429f 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index 1008f2b2..842e7dec 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 55f7f41b..60ab38c7 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -26,7 +26,7 @@ export INT16 OPM_AddressSize; static INT16 OPM_GlobalAlignment; export INT16 OPM_Alignment; export UINT32 OPM_GlobalOptions, OPM_Options; -export INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; +export INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize; export INT64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; @@ -245,10 +245,8 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len) __ASSERT(OPM_Alignment == 4 || OPM_Alignment == 8, 0); if (OPM_IntegerSize == 2) { OPM_LongintSize = 4; - OPM_SetSize = 4; } else { OPM_LongintSize = 8; - OPM_SetSize = 8; } Files_SetSearchPath((CHAR*)"", 1); break; @@ -395,7 +393,7 @@ static void OPM_VerboseListSizes (void) OPM_LogWNum(OPM_LongintSize, 4); OPM_LogWLn(); OPM_LogWStr((CHAR*)"SET ", 12); - OPM_LogWNum(OPM_SetSize, 4); + OPM_LogWNum(OPM_LongintSize, 4); OPM_LogWLn(); OPM_LogWStr((CHAR*)"ADDRESS ", 12); OPM_LogWNum(OPM_AddressSize, 4); @@ -432,25 +430,21 @@ void OPM_InitOptions (void) OPM_ShortintSize = 1; OPM_IntegerSize = 2; OPM_LongintSize = 4; - OPM_SetSize = 4; break; case 'C': OPM_ShortintSize = 2; OPM_IntegerSize = 4; OPM_LongintSize = 8; - OPM_SetSize = 8; break; case 'V': OPM_ShortintSize = 1; OPM_IntegerSize = 4; OPM_LongintSize = 8; - OPM_SetSize = 8; break; default: OPM_ShortintSize = 1; OPM_IntegerSize = 2; OPM_LongintSize = 4; - OPM_SetSize = 4; break; } if (__IN(18, OPM_Options, 32)) { diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index a4631607..2d272feb 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h @@ -9,7 +9,7 @@ import CHAR OPM_Model[10]; import INT16 OPM_AddressSize, OPM_Alignment; import UINT32 OPM_GlobalOptions, OPM_Options; -import INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; +import INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize; import INT64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index 02abdf28..df908a43 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -392,6 +392,9 @@ static void OPP_FormalParameters (OPT_Object *firstPar, OPT_Struct *resTyp) } OPP_CheckSym(20); OPP_Type(&typ, &OPT_notyp); + if (((typ->comp == 2 || typ->comp == 4) && typ->strobj == NIL)) { + OPP_err(-309); + } if (mode == 1) { typ->pvused = 1; } diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index ecb8b3dd..5a71eb39 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index 86adcd6a..6ee700e5 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index 13869701..1f7a3e58 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index 2682db8a..a8d42b40 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index f18e86c7..90fcacf5 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 38f21585..4bd6b3fb 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index b29088ac..c4a61586 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Out.c b/bootstrap/unix-88/Out.c index 8cef91b8..39f383cf 100644 --- a/bootstrap/unix-88/Out.c +++ b/bootstrap/unix-88/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Out.h b/bootstrap/unix-88/Out.h index 6c12b541..0e66420d 100644 --- a/bootstrap/unix-88/Out.h +++ b/bootstrap/unix-88/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index a41c8622..46e18441 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index 1fa15be1..80307386 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 45163d35..cd4c3c61 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index 1d66f986..f0c84ab1 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index 1c626264..b5707327 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index a9865bc1..c987af8d 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index a567719a..ae12961b 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index 4825ba4c..61a97dda 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/VT100.c b/bootstrap/unix-88/VT100.c index 072be052..f69fd90e 100644 --- a/bootstrap/unix-88/VT100.c +++ b/bootstrap/unix-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/VT100.h b/bootstrap/unix-88/VT100.h index 68fd3b81..d99406ec 100644 --- a/bootstrap/unix-88/VT100.h +++ b/bootstrap/unix-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index 54bf0d04..37630d23 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index fb77b9a7..63e5df15 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/Compiler.c b/bootstrap/windows-48/Compiler.c index f91f65b0..dc4bb660 100644 --- a/bootstrap/windows-48/Compiler.c +++ b/bootstrap/windows-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index 37061819..2d0061df 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index b182309a..b28e0caa 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 13f94028..5326fe10 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index c632b029..62df86fc 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index 28b5931a..72677604 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index a8f43cd4..0aa0a18b 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index 2d6a6601..a5e72ba3 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index a13681ca..8bb89fe5 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index 8dde1d6f..3ef8e2f9 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index 019adbb7..0be714e8 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 4c1eaf60..ef4b429f 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index 1008f2b2..842e7dec 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index bfcd9a7d..e76d763e 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -26,7 +26,7 @@ export INT16 OPM_AddressSize; static INT16 OPM_GlobalAlignment; export INT16 OPM_Alignment; export UINT32 OPM_GlobalOptions, OPM_Options; -export INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; +export INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize; export INT64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; @@ -245,10 +245,8 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len) __ASSERT(OPM_Alignment == 4 || OPM_Alignment == 8, 0); if (OPM_IntegerSize == 2) { OPM_LongintSize = 4; - OPM_SetSize = 4; } else { OPM_LongintSize = 8; - OPM_SetSize = 8; } Files_SetSearchPath((CHAR*)"", 1); break; @@ -395,7 +393,7 @@ static void OPM_VerboseListSizes (void) OPM_LogWNum(OPM_LongintSize, 4); OPM_LogWLn(); OPM_LogWStr((CHAR*)"SET ", 12); - OPM_LogWNum(OPM_SetSize, 4); + OPM_LogWNum(OPM_LongintSize, 4); OPM_LogWLn(); OPM_LogWStr((CHAR*)"ADDRESS ", 12); OPM_LogWNum(OPM_AddressSize, 4); @@ -432,25 +430,21 @@ void OPM_InitOptions (void) OPM_ShortintSize = 1; OPM_IntegerSize = 2; OPM_LongintSize = 4; - OPM_SetSize = 4; break; case 'C': OPM_ShortintSize = 2; OPM_IntegerSize = 4; OPM_LongintSize = 8; - OPM_SetSize = 8; break; case 'V': OPM_ShortintSize = 1; OPM_IntegerSize = 4; OPM_LongintSize = 8; - OPM_SetSize = 8; break; default: OPM_ShortintSize = 1; OPM_IntegerSize = 2; OPM_LongintSize = 4; - OPM_SetSize = 4; break; } if (__IN(18, OPM_Options, 32)) { diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index a4631607..2d272feb 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h @@ -9,7 +9,7 @@ import CHAR OPM_Model[10]; import INT16 OPM_AddressSize, OPM_Alignment; import UINT32 OPM_GlobalOptions, OPM_Options; -import INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; +import INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize; import INT64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index 2aba6340..3f360d00 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -392,6 +392,9 @@ static void OPP_FormalParameters (OPT_Object *firstPar, OPT_Struct *resTyp) } OPP_CheckSym(20); OPP_Type(&typ, &OPT_notyp); + if (((typ->comp == 2 || typ->comp == 4) && typ->strobj == NIL)) { + OPP_err(-309); + } if (mode == 1) { typ->pvused = 1; } diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index ecb8b3dd..5a71eb39 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index 86adcd6a..6ee700e5 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index 13869701..1f7a3e58 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 076b5e16..75820a95 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index f18e86c7..90fcacf5 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index b219bec1..5c21cb97 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index b29088ac..c4a61586 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Out.c b/bootstrap/windows-48/Out.c index 082aa1be..720267fd 100644 --- a/bootstrap/windows-48/Out.c +++ b/bootstrap/windows-48/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Out.h b/bootstrap/windows-48/Out.h index 6c12b541..0e66420d 100644 --- a/bootstrap/windows-48/Out.h +++ b/bootstrap/windows-48/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 19195bf6..5a57f076 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index 162dda27..f62a8ab8 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 45163d35..cd4c3c61 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index 1d66f986..f0c84ab1 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index 1c626264..b5707327 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index a9865bc1..c987af8d 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index 595fa511..ad26b1cb 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index 17506204..e2c03958 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/VT100.c b/bootstrap/windows-48/VT100.c index 072be052..f69fd90e 100644 --- a/bootstrap/windows-48/VT100.c +++ b/bootstrap/windows-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/VT100.h b/bootstrap/windows-48/VT100.h index 68fd3b81..d99406ec 100644 --- a/bootstrap/windows-48/VT100.h +++ b/bootstrap/windows-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index 54bf0d04..37630d23 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index fb77b9a7..63e5df15 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/Compiler.c b/bootstrap/windows-88/Compiler.c index f91f65b0..dc4bb660 100644 --- a/bootstrap/windows-88/Compiler.c +++ b/bootstrap/windows-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index 37061819..2d0061df 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index b182309a..b28e0caa 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index c765bb85..c3ea44cf 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 3af067f2..5c402312 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index 830efb5f..a2bb8f2f 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index c69d655b..163cad8c 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 42f2051a..4e4d62e7 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index a13681ca..8bb89fe5 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index 8dde1d6f..3ef8e2f9 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index 019adbb7..0be714e8 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index 4c1eaf60..ef4b429f 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index 1008f2b2..842e7dec 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 55f7f41b..60ab38c7 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -26,7 +26,7 @@ export INT16 OPM_AddressSize; static INT16 OPM_GlobalAlignment; export INT16 OPM_Alignment; export UINT32 OPM_GlobalOptions, OPM_Options; -export INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; +export INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize; export INT64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; @@ -245,10 +245,8 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len) __ASSERT(OPM_Alignment == 4 || OPM_Alignment == 8, 0); if (OPM_IntegerSize == 2) { OPM_LongintSize = 4; - OPM_SetSize = 4; } else { OPM_LongintSize = 8; - OPM_SetSize = 8; } Files_SetSearchPath((CHAR*)"", 1); break; @@ -395,7 +393,7 @@ static void OPM_VerboseListSizes (void) OPM_LogWNum(OPM_LongintSize, 4); OPM_LogWLn(); OPM_LogWStr((CHAR*)"SET ", 12); - OPM_LogWNum(OPM_SetSize, 4); + OPM_LogWNum(OPM_LongintSize, 4); OPM_LogWLn(); OPM_LogWStr((CHAR*)"ADDRESS ", 12); OPM_LogWNum(OPM_AddressSize, 4); @@ -432,25 +430,21 @@ void OPM_InitOptions (void) OPM_ShortintSize = 1; OPM_IntegerSize = 2; OPM_LongintSize = 4; - OPM_SetSize = 4; break; case 'C': OPM_ShortintSize = 2; OPM_IntegerSize = 4; OPM_LongintSize = 8; - OPM_SetSize = 8; break; case 'V': OPM_ShortintSize = 1; OPM_IntegerSize = 4; OPM_LongintSize = 8; - OPM_SetSize = 8; break; default: OPM_ShortintSize = 1; OPM_IntegerSize = 2; OPM_LongintSize = 4; - OPM_SetSize = 4; break; } if (__IN(18, OPM_Options, 32)) { diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index a4631607..2d272feb 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h @@ -9,7 +9,7 @@ import CHAR OPM_Model[10]; import INT16 OPM_AddressSize, OPM_Alignment; import UINT32 OPM_GlobalOptions, OPM_Options; -import INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; +import INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize; import INT64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index 02abdf28..df908a43 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -392,6 +392,9 @@ static void OPP_FormalParameters (OPT_Object *firstPar, OPT_Struct *resTyp) } OPP_CheckSym(20); OPP_Type(&typ, &OPT_notyp); + if (((typ->comp == 2 || typ->comp == 4) && typ->strobj == NIL)) { + OPP_err(-309); + } if (mode == 1) { typ->pvused = 1; } diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index ecb8b3dd..5a71eb39 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index 86adcd6a..6ee700e5 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index 13869701..1f7a3e58 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index 2682db8a..a8d42b40 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index f18e86c7..90fcacf5 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 38f21585..4bd6b3fb 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index b29088ac..c4a61586 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Out.c b/bootstrap/windows-88/Out.c index 082aa1be..720267fd 100644 --- a/bootstrap/windows-88/Out.c +++ b/bootstrap/windows-88/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Out.h b/bootstrap/windows-88/Out.h index 6c12b541..0e66420d 100644 --- a/bootstrap/windows-88/Out.h +++ b/bootstrap/windows-88/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 6bc7548d..1e93deb2 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index c235aa2b..f6a5d008 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 45163d35..cd4c3c61 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index 1d66f986..f0c84ab1 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index 1c626264..b5707327 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index a9865bc1..c987af8d 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index a567719a..ae12961b 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index 4825ba4c..61a97dda 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/VT100.c b/bootstrap/windows-88/VT100.c index 072be052..f69fd90e 100644 --- a/bootstrap/windows-88/VT100.c +++ b/bootstrap/windows-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/VT100.h b/bootstrap/windows-88/VT100.h index 68fd3b81..d99406ec 100644 --- a/bootstrap/windows-88/VT100.h +++ b/bootstrap/windows-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index 54bf0d04..37630d23 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index fb77b9a7..63e5df15 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/doc/Installation.md b/doc/Installation.md index cbd893ca..7c131005 100644 --- a/doc/Installation.md +++ b/doc/Installation.md @@ -2,34 +2,34 @@ The Oberon compiler and libraries may be built and installed on Linux based, BSD based or Windows based systems. -Building on Linux and BSD based systems is reasonably straightforward. First make sure you have he right pre-requites like C compiler and static libraries installed, then clone the repository and run `make full`. +Building on Linux and BSD based systems is reasonably straightforward. First make sure you have the right pre-requites like a C compiler and static libraries installed, then clone the repository and run `make full`. Full instructions for a Linux/BSD based build follow in the next section. Bulding on Windows is not so simple largely because there is more than one way to do it: - - Install the cygwin project and use Windows from the cygwin bash shell rather like Linux. - With the pre-requisites installed using the cygwin setup.exe gui tool, clone and run make - as on Linux. + - Install the cygwin project and use Windows from the cygwin bash shell rather like Linux. + With the pre-requisites installed using the cygwin setup.exe gui tool, clone and run make + as on Linux. This builds a compiler that is dependent on the cygwin environment, and which compiles Oberon programs to binaries that are themselves dependent on the cygwin environment. - + - Install the cygwin project and the mingw compiler. The Oberon compiler this builds is still dependent on the cygwin environment, but programs built with this compiler are Windows binaries dependent only on standard Microsoft APIs and libraries. - - - Use the Windows 10 Bash on Ubuntu on Windows (aka WSL - Windows Subsystem for Linux). - The Oberon compiler can be built in the WSL using exactly the same procedure - as on a normal Ubuntu environment, and the resulting compiler and user programs will run + + - Use the Windows 10 Bash on Ubuntu on Windows (aka WSL - Windows Subsystem for Linux). + The Oberon compiler can be built in the WSL using exactly the same procedure + as on a normal Ubuntu environment, and the resulting compiler and user programs will run within the Windows subsystem for Linux. - + - Build with the Microsoft C compiler generating native windows binaries. A make.cmd script - is provided which has been developed for and tested with the free 'Visual C++ build tools' + is provided which has been developed for and tested with the free 'Visual C++ build tools' available at http://landinghub.visualstudio.com/visual-cpp-build-tools. - -For building with Cygwin or native Microsoft C environments see [**Cygwin and MSC Installation**](/doc/Winstallation.md) - + +For full details about building with Cygwin or native Microsoft C environments see [**Cygwin and MSC Installation**](/doc/Winstallation.md) + The following sections provide more details for Linux based builds. @@ -39,9 +39,9 @@ This approach is for - All Linux based systems - includes Android (specifically termux on Android) - includes Windows subsystem for Linux (aka Bash on Ubuntu on Windows) - - All BSD based systems + - All BSD based systems - includes macOS (Darwin) - + #### 1. Install pre-requisites The build process has the following pre-requisites: @@ -106,12 +106,12 @@ The makefile will use either gcc or clang, whichever is installed. If you have b #### Installation directories: - + If the makefile succeeds it will end with instructions on how to set your path variable so that the compiler (voc) is found. - + The installation will be found at: - + | System | Install dir | | ----------------------- | -------------------------------------- | | All types of Linux | /opt/voc | @@ -143,12 +143,12 @@ types are as follows: | -O2 (default) | `SHORTINT` | `INTEGER` | `LONGINT` and `SET` | `HUGEINT` | | -OC | `BYTE` | `SHORTINT` | `INTEGER` | `LONGINT` and `SET` | -A convention of many Oberon compilers has been that LONGINT is a suitable integer type for +A convention of many Oberon compilers has been that LONGINT is a suitable integer type for manipulating addresses. However since the size of pointer types is fixed by the OS and we support both 32 and 64 bit operating systems, LONGINT is not always sufficient for us. -Accordingly, the SYSTEM module has been updated to ease the development of platform independent -code, with new types such as `SYSTEM.INT8`, `SYSTEM.INT16`, `SYSTEM.INT32`, `SYSTEM.INT64` +Accordingly, the SYSTEM module has been updated to ease the development of platform independent +code, with new types such as `SYSTEM.INT8`, `SYSTEM.INT16`, `SYSTEM.INT32`, `SYSTEM.INT64` and `SYSTEM.ADDRESS`. -For details, see [**Features**](doc/Features.md). +For details, see [**Features**](/doc/Features.md). diff --git a/doc/Winstallation.md b/doc/Winstallation.md index b7a1f1b0..74eb3c97 100644 --- a/doc/Winstallation.md +++ b/doc/Winstallation.md @@ -1,6 +1,6 @@ ### Building the Oberon compiler and libraries on a Windows system -This approach is for Windows systems using +This approach is for Windows systems using - Cygwin (with or without mingw) - Microsoft Visual C @@ -21,9 +21,9 @@ The build process has the following pre-requisites: - git - make - diff - + To install these, run the Cygwin setup program (setup-x86.exe or setup-x86_64.exe as appropriate), work -your way through the initaial questions until you reach the 'Select packages' page, and make sure the +your way through the initaial questions until you reach the 'Select packages' page, and make sure the following packages are selected: | Section | Package | @@ -73,21 +73,24 @@ The makefile will: - Run a set of confidence tests. - Since installation directories are not generally write accessible to normal users, is is necessary to run - the `make full` command from a root shell, or by using `sudo`. - - #### Installation directories: - - If it succeeds the makefile will end with instructions on how to set your path variable so that the - compiler (voc) is found. - - The installation will be found at: - -| System | Install dir | -| ----------------------- | -------------------------------------- | -| All types of Linux | /opt/voc | -| BSD (including Darwin) | /usr/local/share/voc | -| Termux (android) | /data/data/com.termux/files/opt/voc | | +### Build using mingw under cygwin + +### Build using Microsft C + + + +#### Installation directories: + +If it succeeds the makefile will end with instructions on how to set your path variable so that the +compiler (voc) is found. + +The installation will be found at: + +| Built with | Install dir | +| --------------- | -------------------------------------- | +| cygwin | /opt/voc | +| cygwin + mingw | %PROGRAMFILES%/voc | +| MSC | %PROGRAMFILES%/voc | The installation directory contains: From 000c541afaa49ce7017267bc5779f078686c2415 Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 24 Nov 2016 17:55:26 +0000 Subject: [PATCH 339/580] Update version from 1.95 to 2.00. --- src/tools/make/configure.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/make/configure.c b/src/tools/make/configure.c index 24b7b903..5865e3e0 100644 --- a/src/tools/make/configure.c +++ b/src/tools/make/configure.c @@ -8,7 +8,7 @@ // Derived from vocparam.c originally by J. Templ 23.6.95 -#define O_VER 1.95 // Version number to be reported by compiler. +#define O_VER 2.00 // Version number to be reported by compiler. #define O_NAME voc // Compiler name used for binary, install dir and references in text. From 056a317e542ffb36e1fb4028d382c9e56251c9ba Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 24 Nov 2016 18:10:51 +0000 Subject: [PATCH 340/580] Remove SetHalt documentation - code was already disabled. --- doc/Features.md | 2 -- src/runtime/Modules.Mod | 5 ----- 2 files changed, 7 deletions(-) diff --git a/doc/Features.md b/doc/Features.md index e597732c..ae0bcc43 100644 --- a/doc/Features.md +++ b/doc/Features.md @@ -144,5 +144,3 @@ HALT displays the message 'Terminated by Halt(n)'. For negative values that corr Bear in mind that both Linux and Windows generally treat the return code as a signed 8 bit value, ignoring higher order bits. Therefore it is best to restrict HALT and ASSERT codes to the range -128 .. 127. -A client application may register a halt handler by calling Platform.SetHalt(p) where p: PROCEDURE(n: SYSTEM.INT32). This procedure will be called before Halt displays it's message. The procedure may suppress the Halt message by calling Platform.Exit(code: INTEGER) directly. - diff --git a/src/runtime/Modules.Mod b/src/runtime/Modules.Mod index d6b8eeeb..12fbcd7a 100644 --- a/src/runtime/Modules.Mod +++ b/src/runtime/Modules.Mod @@ -151,9 +151,4 @@ MODULE Modules; (* jt 6.1.96 *) Platform.Exit(code); END AssertFail; - (* - PROCEDURE SetHalt*(p: HaltProcedure); - BEGIN HaltHandler := p; END SetHalt; - *) - END Modules. From 5ae282dc9f73f314c51c870a205d402dcf71ed7d Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 24 Nov 2016 19:00:46 +0000 Subject: [PATCH 341/580] Trigger build (after dragging each build machine past the v2.00 tag.) --- src/compiler/OPP.Mod | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/compiler/OPP.Mod b/src/compiler/OPP.Mod index 329d52b4..826a60e6 100644 --- a/src/compiler/OPP.Mod +++ b/src/compiler/OPP.Mod @@ -218,12 +218,10 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) END END ; CheckSym(OPS.colon); Type(typ, OPT.notyp); - IF ((typ.comp = OPT.Array) OR (typ.comp = OPT.Record)) & (typ.strobj = NIL) THEN err(-309) END; - IF mode = OPT.Var THEN typ^.pvused := TRUE END ; (* typ^.pbused is set when parameter type name is parsed *) WHILE first # NIL DO first^.typ := typ; first := first^.link END ; From cbf78cb6f12cf83a929d66664ea9639ba46f774c Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 25 Nov 2016 12:45:33 +0000 Subject: [PATCH 342/580] Fix allocation size for dynarry dope vector - ADDRESS rather than LONGINT. --- src/compiler/OPC.Mod | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/compiler/OPC.Mod b/src/compiler/OPC.Mod index a8681e32..1e5ab5a7 100644 --- a/src/compiler/OPC.Mod +++ b/src/compiler/OPC.Mod @@ -248,7 +248,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) typ := typ^.BaseTyp^.BaseTyp; nofdims := 1; WHILE typ^.comp = OPT.DynArr DO INC(nofdims); typ := typ^.BaseTyp END ; OPM.WriteString('struct '); BegBlk; - BegStat; Str1("LONGINT len[#]", nofdims); EndStat; + BegStat; Str1("ADDRESS len[#]", nofdims); EndStat; BegStat; NEW(obj); NEW(obj.typ); (* aux. object for easy declaration *) obj.typ.form := OPT.Comp; obj.typ.comp := OPT.Array; obj.typ.n := 1; obj.typ.BaseTyp := typ; obj.mode := OPT.Fld; obj.name := "data"; obj.linkadr := UndefinedType; DeclareBase(obj); OPM.Write(' '); DeclareObj(obj, FALSE); @@ -335,7 +335,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) IF showParamName THEN Ident(par); OPM.WriteString(LenExt) END ; dim := 1; typ := par^.typ^.BaseTyp; WHILE typ^.comp = OPT.DynArr DO - IF ansiDefine THEN OPM.WriteString(", LONGINT ") ELSE OPM.WriteString(', ') END ; + IF ansiDefine THEN OPM.WriteString(", ADDRESS ") ELSE OPM.WriteString(', ') END ; IF showParamName THEN Ident(par); OPM.WriteString(LenExt); OPM.WriteInt(dim) END ; typ := typ^.BaseTyp; INC(dim) END @@ -656,7 +656,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) IF obj^.typ^.comp = OPT.DynArr THEN (* declare len parameter(s) *) EndStat; BegStat; base := OPT.linttyp; - OPM.WriteString("LONGINT "); LenList(obj, FALSE, TRUE) + OPM.WriteString("ADDRESS "); LenList(obj, FALSE, TRUE) ELSIF (obj^.mode = OPT.VarPar) & (obj^.typ^.comp = OPT.Record) THEN EndStat; BegStat; OPM.WriteString("ADDRESS *"); Ident(obj); OPM.WriteString(TagExt); @@ -684,7 +684,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) COPY(obj^.name, name); obj^.name := ""; DeclareObj(obj, FALSE); COPY(name, obj^.name) END ; IF obj^.typ^.comp = OPT.DynArr THEN - OPM.WriteString(", LONGINT "); + OPM.WriteString(", ADDRESS "); LenList(obj, TRUE, showParamNames) ELSIF (obj^.mode = OPT.VarPar) & (obj^.typ^.comp = OPT.Record) THEN OPM.WriteString(", ADDRESS *"); From 7279aa91be82ce5231529345299aa7e89e370520 Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 25 Nov 2016 13:03:26 +0000 Subject: [PATCH 343/580] Update bootstrap C source. --- bootstrap/unix-44/Compiler.c | 2 +- bootstrap/unix-44/Configuration.c | 4 +- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Files.c | 80 ++++++++++++++-------------- bootstrap/unix-44/Files.h | 28 +++++----- bootstrap/unix-44/Heap.c | 18 +++---- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 22 ++++---- bootstrap/unix-44/Modules.h | 8 +-- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 38 ++++++------- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 46 ++++++++-------- bootstrap/unix-44/OPM.h | 18 +++---- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 14 ++--- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 2 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Out.c | 18 +++---- bootstrap/unix-44/Out.h | 4 +- bootstrap/unix-44/Platform.c | 54 +++++++++---------- bootstrap/unix-44/Platform.h | 28 +++++----- bootstrap/unix-44/Reals.c | 22 ++++---- bootstrap/unix-44/Reals.h | 10 ++-- bootstrap/unix-44/Strings.c | 42 +++++++-------- bootstrap/unix-44/Strings.h | 20 +++---- bootstrap/unix-44/Texts.c | 18 +++---- bootstrap/unix-44/Texts.h | 8 +-- bootstrap/unix-44/VT100.c | 30 +++++------ bootstrap/unix-44/VT100.h | 6 +-- bootstrap/unix-44/extTools.c | 18 +++---- bootstrap/unix-44/extTools.h | 6 +-- bootstrap/unix-48/Compiler.c | 2 +- bootstrap/unix-48/Configuration.c | 4 +- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Files.c | 80 ++++++++++++++-------------- bootstrap/unix-48/Files.h | 28 +++++----- bootstrap/unix-48/Heap.c | 18 +++---- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 22 ++++---- bootstrap/unix-48/Modules.h | 8 +-- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 38 ++++++------- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 46 ++++++++-------- bootstrap/unix-48/OPM.h | 18 +++---- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 14 ++--- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 2 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Out.c | 18 +++---- bootstrap/unix-48/Out.h | 4 +- bootstrap/unix-48/Platform.c | 54 +++++++++---------- bootstrap/unix-48/Platform.h | 28 +++++----- bootstrap/unix-48/Reals.c | 22 ++++---- bootstrap/unix-48/Reals.h | 10 ++-- bootstrap/unix-48/Strings.c | 42 +++++++-------- bootstrap/unix-48/Strings.h | 20 +++---- bootstrap/unix-48/Texts.c | 18 +++---- bootstrap/unix-48/Texts.h | 8 +-- bootstrap/unix-48/VT100.c | 30 +++++------ bootstrap/unix-48/VT100.h | 6 +-- bootstrap/unix-48/extTools.c | 18 +++---- bootstrap/unix-48/extTools.h | 6 +-- bootstrap/unix-88/Compiler.c | 2 +- bootstrap/unix-88/Configuration.c | 4 +- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Files.c | 80 ++++++++++++++-------------- bootstrap/unix-88/Files.h | 28 +++++----- bootstrap/unix-88/Heap.c | 18 +++---- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 22 ++++---- bootstrap/unix-88/Modules.h | 8 +-- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 38 ++++++------- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 46 ++++++++-------- bootstrap/unix-88/OPM.h | 18 +++---- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 14 ++--- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 2 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Out.c | 18 +++---- bootstrap/unix-88/Out.h | 4 +- bootstrap/unix-88/Platform.c | 54 +++++++++---------- bootstrap/unix-88/Platform.h | 28 +++++----- bootstrap/unix-88/Reals.c | 22 ++++---- bootstrap/unix-88/Reals.h | 10 ++-- bootstrap/unix-88/Strings.c | 42 +++++++-------- bootstrap/unix-88/Strings.h | 20 +++---- bootstrap/unix-88/Texts.c | 18 +++---- bootstrap/unix-88/Texts.h | 8 +-- bootstrap/unix-88/VT100.c | 30 +++++------ bootstrap/unix-88/VT100.h | 6 +-- bootstrap/unix-88/extTools.c | 18 +++---- bootstrap/unix-88/extTools.h | 6 +-- bootstrap/windows-48/Compiler.c | 2 +- bootstrap/windows-48/Configuration.c | 4 +- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Files.c | 80 ++++++++++++++-------------- bootstrap/windows-48/Files.h | 28 +++++----- bootstrap/windows-48/Heap.c | 18 +++---- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 22 ++++---- bootstrap/windows-48/Modules.h | 8 +-- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 38 ++++++------- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 46 ++++++++-------- bootstrap/windows-48/OPM.h | 18 +++---- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 14 ++--- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 2 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Out.c | 18 +++---- bootstrap/windows-48/Out.h | 4 +- bootstrap/windows-48/Platform.c | 54 +++++++++---------- bootstrap/windows-48/Platform.h | 28 +++++----- bootstrap/windows-48/Reals.c | 22 ++++---- bootstrap/windows-48/Reals.h | 10 ++-- bootstrap/windows-48/Strings.c | 42 +++++++-------- bootstrap/windows-48/Strings.h | 20 +++---- bootstrap/windows-48/Texts.c | 18 +++---- bootstrap/windows-48/Texts.h | 8 +-- bootstrap/windows-48/VT100.c | 30 +++++------ bootstrap/windows-48/VT100.h | 6 +-- bootstrap/windows-48/extTools.c | 18 +++---- bootstrap/windows-48/extTools.h | 6 +-- bootstrap/windows-88/Compiler.c | 2 +- bootstrap/windows-88/Configuration.c | 4 +- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Files.c | 80 ++++++++++++++-------------- bootstrap/windows-88/Files.h | 28 +++++----- bootstrap/windows-88/Heap.c | 18 +++---- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 22 ++++---- bootstrap/windows-88/Modules.h | 8 +-- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 38 ++++++------- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 46 ++++++++-------- bootstrap/windows-88/OPM.h | 18 +++---- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 14 ++--- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 2 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Out.c | 18 +++---- bootstrap/windows-88/Out.h | 4 +- bootstrap/windows-88/Platform.c | 54 +++++++++---------- bootstrap/windows-88/Platform.h | 28 +++++----- bootstrap/windows-88/Reals.c | 22 ++++---- bootstrap/windows-88/Reals.h | 10 ++-- bootstrap/windows-88/Strings.c | 42 +++++++-------- bootstrap/windows-88/Strings.h | 20 +++---- bootstrap/windows-88/Texts.c | 18 +++---- bootstrap/windows-88/Texts.h | 8 +-- bootstrap/windows-88/VT100.c | 30 +++++------ bootstrap/windows-88/VT100.h | 6 +-- bootstrap/windows-88/extTools.c | 18 +++---- bootstrap/windows-88/extTools.h | 6 +-- 185 files changed, 1465 insertions(+), 1465 deletions(-) diff --git a/bootstrap/unix-44/Compiler.c b/bootstrap/unix-44/Compiler.c index dc4bb660..e900905f 100644 --- a/bootstrap/unix-44/Compiler.c +++ b/bootstrap/unix-44/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index 2d0061df..071d7b8e 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index b28e0caa..b1942442 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 548774b0..0a3293ab 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -52,7 +52,7 @@ static Files_File Files_files; static INT16 Files_tempno; static CHAR Files_HOME[1024]; static struct { - LONGINT len[1]; + ADDRESS len[1]; CHAR data[1]; } *Files_SearchPath; @@ -62,56 +62,56 @@ export ADDRESS *Files_Rider__typ; export Files_File Files_Base (Files_Rider *r, ADDRESS *r__typ); static Files_File Files_CacheEntry (Platform_FileIdentity identity); -export void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INT16 *res); +export void Files_ChangeDirectory (CHAR *path, ADDRESS path__len, INT16 *res); export void Files_Close (Files_File f); static void Files_CloseOSFile (Files_File f); static void Files_Create (Files_File f); -export void Files_Delete (CHAR *name, LONGINT name__len, INT16 *res); -static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INT16 errcode); +export void Files_Delete (CHAR *name, ADDRESS name__len, INT16 *res); +static void Files_Err (CHAR *s, ADDRESS s__len, Files_File f, INT16 errcode); static void Files_Finalize (SYSTEM_PTR o); -static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *dest, LONGINT dest__len); +static void Files_FlipBytes (SYSTEM_BYTE *src, ADDRESS src__len, SYSTEM_BYTE *dest, ADDRESS dest__len); static void Files_Flush (Files_Buffer buf); export void Files_GetDate (Files_File f, INT32 *t, INT32 *d); -export void Files_GetName (Files_File f, CHAR *name, LONGINT name__len); -static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *name, LONGINT name__len); -static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len); +export void Files_GetName (Files_File f, CHAR *name, ADDRESS name__len); +static void Files_GetTempName (CHAR *finalName, ADDRESS finalName__len, CHAR *name, ADDRESS name__len); +static BOOLEAN Files_HasDir (CHAR *name, ADDRESS name__len); export INT32 Files_Length (Files_File f); -static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT name__len, CHAR *dest, LONGINT dest__len); -export Files_File Files_New (CHAR *name, LONGINT name__len); -export Files_File Files_Old (CHAR *name, LONGINT name__len); +static void Files_MakeFileName (CHAR *dir, ADDRESS dir__len, CHAR *name, ADDRESS name__len, CHAR *dest, ADDRESS dest__len); +export Files_File Files_New (CHAR *name, ADDRESS name__len); +export Files_File Files_Old (CHAR *name, ADDRESS name__len); export INT32 Files_Pos (Files_Rider *r, ADDRESS *r__typ); export void Files_Purge (Files_File f); export void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x); export void Files_ReadBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN *x); -export void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n); +export void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS x__len, INT32 n); export void Files_ReadInt (Files_Rider *R, ADDRESS *R__typ, INT16 *x); export void Files_ReadLInt (Files_Rider *R, ADDRESS *R__typ, INT32 *x); export void Files_ReadLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL *x); -export void Files_ReadLine (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); -export void Files_ReadNum (Files_Rider *R, ADDRESS *R__typ, SYSTEM_BYTE *x, LONGINT x__len); +export void Files_ReadLine (Files_Rider *R, ADDRESS *R__typ, CHAR *x, ADDRESS x__len); +export void Files_ReadNum (Files_Rider *R, ADDRESS *R__typ, SYSTEM_BYTE *x, ADDRESS x__len); export void Files_ReadReal (Files_Rider *R, ADDRESS *R__typ, REAL *x); export void Files_ReadSet (Files_Rider *R, ADDRESS *R__typ, UINT32 *x); -export void Files_ReadString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); +export void Files_ReadString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, ADDRESS x__len); export void Files_Register (Files_File f); -export void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT16 *res); -static void Files_ScanPath (INT16 *pos, CHAR *dir, LONGINT dir__len); +export void Files_Rename (CHAR *old, ADDRESS old__len, CHAR *new, ADDRESS new__len, INT16 *res); +static void Files_ScanPath (INT16 *pos, CHAR *dir, ADDRESS dir__len); export void Files_Set (Files_Rider *r, ADDRESS *r__typ, Files_File f, INT32 pos); -export void Files_SetSearchPath (CHAR *path, LONGINT path__len); +export void Files_SetSearchPath (CHAR *path, ADDRESS path__len); export void Files_Write (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE x); export void Files_WriteBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN x); -export void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n); +export void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS x__len, INT32 n); export void Files_WriteInt (Files_Rider *R, ADDRESS *R__typ, INT16 x); export void Files_WriteLInt (Files_Rider *R, ADDRESS *R__typ, INT32 x); export void Files_WriteLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL x); export void Files_WriteNum (Files_Rider *R, ADDRESS *R__typ, INT64 x); export void Files_WriteReal (Files_Rider *R, ADDRESS *R__typ, REAL x); export void Files_WriteSet (Files_Rider *R, ADDRESS *R__typ, UINT32 x); -export void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); +export void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, ADDRESS x__len); #define Files_IdxTrap() __HALT(-1) #define Files_ToAdr(x) (ADDRESS)x -static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INT16 errcode) +static void Files_Err (CHAR *s, ADDRESS s__len, Files_File f, INT16 errcode) { __DUP(s, s__len, CHAR); Out_Ln(); @@ -138,7 +138,7 @@ static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INT16 errcode) __DEL(s); } -static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT name__len, CHAR *dest, LONGINT dest__len) +static void Files_MakeFileName (CHAR *dir, ADDRESS dir__len, CHAR *name, ADDRESS name__len, CHAR *dest, ADDRESS dest__len) { INT16 i, j; __DUP(dir, dir__len, CHAR); @@ -163,7 +163,7 @@ static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT __DEL(name); } -static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *name, LONGINT name__len) +static void Files_GetTempName (CHAR *finalName, ADDRESS finalName__len, CHAR *name, ADDRESS name__len) { INT32 n, i, j; __DUP(finalName, finalName__len, CHAR); @@ -316,7 +316,7 @@ INT32 Files_Length (Files_File f) return f->len; } -Files_File Files_New (CHAR *name, LONGINT name__len) +Files_File Files_New (CHAR *name, ADDRESS name__len) { Files_File f = NIL; __DUP(name, name__len, CHAR); @@ -332,7 +332,7 @@ Files_File Files_New (CHAR *name, LONGINT name__len) return f; } -static void Files_ScanPath (INT16 *pos, CHAR *dir, LONGINT dir__len) +static void Files_ScanPath (INT16 *pos, CHAR *dir, ADDRESS dir__len) { INT16 i; CHAR ch; @@ -375,7 +375,7 @@ static void Files_ScanPath (INT16 *pos, CHAR *dir, LONGINT dir__len) dir[i] = 0x00; } -static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len) +static BOOLEAN Files_HasDir (CHAR *name, ADDRESS name__len) { INT16 i; CHAR ch; @@ -415,7 +415,7 @@ static Files_File Files_CacheEntry (Platform_FileIdentity identity) return NIL; } -Files_File Files_Old (CHAR *name, LONGINT name__len) +Files_File Files_Old (CHAR *name, ADDRESS name__len) { Files_File f = NIL; INT32 fd; @@ -618,7 +618,7 @@ void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x) } } -void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n) +void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS x__len, INT32 n) { INT32 xpos, min, restInBuf, offset; Files_Buffer buf = NIL; @@ -683,7 +683,7 @@ void Files_Write (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE x) (*r).res = 0; } -void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n) +void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS x__len, INT32 n) { INT32 xpos, min, restInBuf, offset; Files_Buffer buf = NIL; @@ -722,14 +722,14 @@ void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT (*r).res = 0; } -void Files_Delete (CHAR *name, LONGINT name__len, INT16 *res) +void Files_Delete (CHAR *name, ADDRESS name__len, INT16 *res) { __DUP(name, name__len, CHAR); *res = Platform_Unlink((void*)name, name__len); __DEL(name); } -void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT16 *res) +void Files_Rename (CHAR *old, ADDRESS old__len, CHAR *new, ADDRESS new__len, INT16 *res) { INT32 fdold, fdnew, n; INT16 error, ignore; @@ -812,14 +812,14 @@ void Files_Register (Files_File f) } } -void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INT16 *res) +void Files_ChangeDirectory (CHAR *path, ADDRESS path__len, INT16 *res) { __DUP(path, path__len, CHAR); *res = Platform_Chdir((void*)path, path__len); __DEL(path); } -static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *dest, LONGINT dest__len) +static void Files_FlipBytes (SYSTEM_BYTE *src, ADDRESS src__len, SYSTEM_BYTE *dest, ADDRESS dest__len) { INT32 i, j; if (!Platform_LittleEndian) { @@ -877,7 +877,7 @@ void Files_ReadLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL *x) Files_FlipBytes((void*)b, 8, (void*)&*x, 8); } -void Files_ReadString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len) +void Files_ReadString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, ADDRESS x__len) { INT16 i; CHAR ch; @@ -889,7 +889,7 @@ void Files_ReadString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len) } while (!(ch == 0x00)); } -void Files_ReadLine (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len) +void Files_ReadLine (Files_Rider *R, ADDRESS *R__typ, CHAR *x, ADDRESS x__len) { INT16 i; i = 0; @@ -906,7 +906,7 @@ void Files_ReadLine (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len) x[i] = 0x00; } -void Files_ReadNum (Files_Rider *R, ADDRESS *R__typ, SYSTEM_BYTE *x, LONGINT x__len) +void Files_ReadNum (Files_Rider *R, ADDRESS *R__typ, SYSTEM_BYTE *x, ADDRESS x__len) { INT8 s, b; INT64 q; @@ -972,7 +972,7 @@ void Files_WriteLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL x) Files_WriteBytes(&*R, R__typ, (void*)b, 8, 8); } -void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len) +void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, ADDRESS x__len) { INT16 i; i = 0; @@ -991,7 +991,7 @@ void Files_WriteNum (Files_Rider *R, ADDRESS *R__typ, INT64 x) Files_Write(&*R, R__typ, (CHAR)__MASK(x, -128)); } -void Files_GetName (Files_File f, CHAR *name, LONGINT name__len) +void Files_GetName (Files_File f, CHAR *name, ADDRESS name__len) { __COPY(f->workName, name, name__len); } @@ -1009,7 +1009,7 @@ static void Files_Finalize (SYSTEM_PTR o) } } -void Files_SetSearchPath (CHAR *path, LONGINT path__len) +void Files_SetSearchPath (CHAR *path, ADDRESS path__len) { __DUP(path, path__len, CHAR); if (Strings_Length(path, path__len) != 0) { diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index 79164af5..1012ec46 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h @@ -28,41 +28,41 @@ import ADDRESS *Files_FileDesc__typ; import ADDRESS *Files_Rider__typ; import Files_File Files_Base (Files_Rider *r, ADDRESS *r__typ); -import void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INT16 *res); +import void Files_ChangeDirectory (CHAR *path, ADDRESS path__len, INT16 *res); import void Files_Close (Files_File f); -import void Files_Delete (CHAR *name, LONGINT name__len, INT16 *res); +import void Files_Delete (CHAR *name, ADDRESS name__len, INT16 *res); import void Files_GetDate (Files_File f, INT32 *t, INT32 *d); -import void Files_GetName (Files_File f, CHAR *name, LONGINT name__len); +import void Files_GetName (Files_File f, CHAR *name, ADDRESS name__len); import INT32 Files_Length (Files_File f); -import Files_File Files_New (CHAR *name, LONGINT name__len); -import Files_File Files_Old (CHAR *name, LONGINT name__len); +import Files_File Files_New (CHAR *name, ADDRESS name__len); +import Files_File Files_Old (CHAR *name, ADDRESS name__len); import INT32 Files_Pos (Files_Rider *r, ADDRESS *r__typ); import void Files_Purge (Files_File f); import void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x); import void Files_ReadBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN *x); -import void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n); +import void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS x__len, INT32 n); import void Files_ReadInt (Files_Rider *R, ADDRESS *R__typ, INT16 *x); import void Files_ReadLInt (Files_Rider *R, ADDRESS *R__typ, INT32 *x); import void Files_ReadLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL *x); -import void Files_ReadLine (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); -import void Files_ReadNum (Files_Rider *R, ADDRESS *R__typ, SYSTEM_BYTE *x, LONGINT x__len); +import void Files_ReadLine (Files_Rider *R, ADDRESS *R__typ, CHAR *x, ADDRESS x__len); +import void Files_ReadNum (Files_Rider *R, ADDRESS *R__typ, SYSTEM_BYTE *x, ADDRESS x__len); import void Files_ReadReal (Files_Rider *R, ADDRESS *R__typ, REAL *x); import void Files_ReadSet (Files_Rider *R, ADDRESS *R__typ, UINT32 *x); -import void Files_ReadString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); +import void Files_ReadString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, ADDRESS x__len); import void Files_Register (Files_File f); -import void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT16 *res); +import void Files_Rename (CHAR *old, ADDRESS old__len, CHAR *new, ADDRESS new__len, INT16 *res); import void Files_Set (Files_Rider *r, ADDRESS *r__typ, Files_File f, INT32 pos); -import void Files_SetSearchPath (CHAR *path, LONGINT path__len); +import void Files_SetSearchPath (CHAR *path, ADDRESS path__len); import void Files_Write (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE x); import void Files_WriteBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN x); -import void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n); +import void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS x__len, INT32 n); import void Files_WriteInt (Files_Rider *R, ADDRESS *R__typ, INT16 x); import void Files_WriteLInt (Files_Rider *R, ADDRESS *R__typ, INT32 x); import void Files_WriteLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL x); import void Files_WriteNum (Files_Rider *R, ADDRESS *R__typ, INT64 x); import void Files_WriteReal (Files_Rider *R, ADDRESS *R__typ, REAL x); import void Files_WriteSet (Files_Rider *R, ADDRESS *R__typ, UINT32 x); -import void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); +import void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, ADDRESS x__len); import void *Files__init(void); diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index 72677604..ba769b74 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -85,14 +85,14 @@ static void Heap_ExtendHeap (INT32 blksz); export void Heap_FINALL (void); static void Heap_Finalize (void); export void Heap_GC (BOOLEAN markStack); -static void Heap_HeapSort (INT32 n, INT32 *a, LONGINT a__len); +static void Heap_HeapSort (INT32 n, INT32 *a, ADDRESS a__len); export void Heap_INCREF (Heap_Module m); export void Heap_InitHeap (void); export void Heap_Lock (void); static void Heap_Mark (INT32 q); -static void Heap_MarkCandidates (INT32 n, INT32 *cand, LONGINT cand__len); +static void Heap_MarkCandidates (INT32 n, INT32 *cand, ADDRESS cand__len); static void Heap_MarkP (SYSTEM_PTR p); -static void Heap_MarkStack (INT32 n, INT32 *cand, LONGINT cand__len); +static void Heap_MarkStack (INT32 n, INT32 *cand, ADDRESS cand__len); export SYSTEM_PTR Heap_NEWBLK (INT32 size); export SYSTEM_PTR Heap_NEWREC (INT32 tag); static INT32 Heap_NewChunk (INT32 blksz); @@ -101,7 +101,7 @@ export SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); export void Heap_REGTYP (Heap_Module m, INT32 typ); export void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); static void Heap_Scan (void); -static void Heap_Sift (INT32 l, INT32 r, INT32 *a, LONGINT a__len); +static void Heap_Sift (INT32 l, INT32 r, INT32 *a, ADDRESS a__len); export void Heap_Unlock (void); extern void *Heap__init(); @@ -445,7 +445,7 @@ static void Heap_Scan (void) } } -static void Heap_Sift (INT32 l, INT32 r, INT32 *a, LONGINT a__len) +static void Heap_Sift (INT32 l, INT32 r, INT32 *a, ADDRESS a__len) { INT32 i, j, x; j = l; @@ -464,7 +464,7 @@ static void Heap_Sift (INT32 l, INT32 r, INT32 *a, LONGINT a__len) a[i] = x; } -static void Heap_HeapSort (INT32 n, INT32 *a, LONGINT a__len) +static void Heap_HeapSort (INT32 n, INT32 *a, ADDRESS a__len) { INT32 l, r, x; l = __ASHR(n, 1); @@ -482,7 +482,7 @@ static void Heap_HeapSort (INT32 n, INT32 *a, LONGINT a__len) } } -static void Heap_MarkCandidates (INT32 n, INT32 *cand, LONGINT cand__len) +static void Heap_MarkCandidates (INT32 n, INT32 *cand, ADDRESS cand__len) { INT32 chnk, adr, tag, next, lim, lim1, i, ptr, size; chnk = Heap_heap; @@ -571,7 +571,7 @@ void Heap_FINALL (void) } } -static void Heap_MarkStack (INT32 n, INT32 *cand, LONGINT cand__len) +static void Heap_MarkStack (INT32 n, INT32 *cand, ADDRESS cand__len) { SYSTEM_PTR frame; INT32 inc, nofcand, sp, p, stack0; diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index 0aa0a18b..d200254d 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index a5e72ba3..27e4473c 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -47,21 +47,21 @@ export Modules_ModuleName Modules_imported, Modules_importing; export ADDRESS *Modules_ModuleDesc__typ; export ADDRESS *Modules_CmdDesc__typ; -static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len); +static void Modules_Append (CHAR *a, ADDRESS a__len, CHAR *b, ADDRESS b__len); export void Modules_AssertFail (INT32 code); static void Modules_DisplayHaltCode (INT32 code); -export void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all); +export void Modules_Free (CHAR *name, ADDRESS name__len, BOOLEAN all); export void Modules_Halt (INT32 code); -export Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len); -export Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len); +export Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, ADDRESS name__len); +export Modules_Module Modules_ThisMod (CHAR *name, ADDRESS name__len); static void Modules_errch (CHAR c); static void Modules_errint (INT32 l); -static void Modules_errstring (CHAR *s, LONGINT s__len); +static void Modules_errstring (CHAR *s, ADDRESS s__len); #define Modules_modules() (Modules_Module)Heap_modules #define Modules_setmodules(m) Heap_modules = m -static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len) +static void Modules_Append (CHAR *a, ADDRESS a__len, CHAR *b, ADDRESS b__len) { INT16 i, j; __DUP(b, b__len, CHAR); @@ -79,7 +79,7 @@ static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len) __DEL(b); } -Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len) +Modules_Module Modules_ThisMod (CHAR *name, ADDRESS name__len) { Modules_Module m = NIL; CHAR bodyname[64]; @@ -103,7 +103,7 @@ Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len) return m; } -Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len) +Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, ADDRESS name__len) { Modules_Cmd c = NIL; __DUP(name, name__len, CHAR); @@ -130,7 +130,7 @@ Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT nam __RETCHK; } -void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all) +void Modules_Free (CHAR *name, ADDRESS name__len, BOOLEAN all) { Modules_Module m = NIL, p = NIL; __DUP(name, name__len, CHAR); @@ -168,7 +168,7 @@ static void Modules_errch (CHAR c) e = Platform_Write(1, (ADDRESS)&c, 1); } -static void Modules_errstring (CHAR *s, LONGINT s__len) +static void Modules_errstring (CHAR *s, ADDRESS s__len) { INT32 i; __DUP(s, s__len, CHAR); diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index 8bb89fe5..b1f2385e 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h @@ -44,10 +44,10 @@ import ADDRESS *Modules_ModuleDesc__typ; import ADDRESS *Modules_CmdDesc__typ; import void Modules_AssertFail (INT32 code); -import void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all); +import void Modules_Free (CHAR *name, ADDRESS name__len, BOOLEAN all); import void Modules_Halt (INT32 code); -import Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len); -import Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len); +import Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, ADDRESS name__len); +import Modules_Module Modules_ThisMod (CHAR *name, ADDRESS name__len); import void *Modules__init(void); diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index 3ef8e2f9..bc44b83a 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index 0be714e8..eb93787e 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index ef4b429f..72e0feef 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -56,7 +56,7 @@ static void OPC_GenHeaderMsg (void); export void OPC_Halt (INT32 n); export void OPC_Ident (OPT_Object obj); static void OPC_IdentList (OPT_Object obj, INT16 vis); -static void OPC_Include (CHAR *name, LONGINT name__len); +static void OPC_Include (CHAR *name, ADDRESS name__len); static void OPC_IncludeImports (OPT_Object obj, INT16 vis); export void OPC_Increment (BOOLEAN decrement); export void OPC_Indent (INT16 count); @@ -68,11 +68,11 @@ static void OPC_InitTProcs (OPT_Object typ, OPT_Object obj); export void OPC_IntLiteral (INT64 n, INT32 size); export void OPC_Len (OPT_Object obj, OPT_Struct array, INT64 dim); static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName); -static INT16 OPC_Length (CHAR *s, LONGINT s__len); +static INT16 OPC_Length (CHAR *s, ADDRESS s__len); export BOOLEAN OPC_NeedsRetval (OPT_Object proc); export INT32 OPC_NofPtrs (OPT_Struct typ); -static INT16 OPC_PerfectHash (CHAR *s, LONGINT s__len); -static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len); +static INT16 OPC_PerfectHash (CHAR *s, ADDRESS s__len); +static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, ADDRESS y__len); static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define); static void OPC_ProcPredefs (OPT_Object obj, INT8 vis); static void OPC_PutBase (OPT_Struct typ); @@ -80,8 +80,8 @@ static void OPC_PutPtrOffsets (OPT_Struct typ, INT32 adr, INT32 *cnt); static void OPC_RegCmds (OPT_Object obj); export void OPC_SetInclude (BOOLEAN exclude); static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause); -static void OPC_Str1 (CHAR *s, LONGINT s__len, INT32 x); -static void OPC_StringLiteral (CHAR *s, LONGINT s__len, INT32 l); +static void OPC_Str1 (CHAR *s, ADDRESS s__len, INT32 x); +static void OPC_StringLiteral (CHAR *s, ADDRESS s__len, INT32 l); export void OPC_TDescDecl (OPT_Struct typ); export void OPC_TypeDefs (OPT_Object obj, INT16 vis); export void OPC_TypeOf (OPT_Object ap); @@ -137,7 +137,7 @@ void OPC_EndBlk0 (void) OPM_Write('}'); } -static void OPC_Str1 (CHAR *s, LONGINT s__len, INT32 x) +static void OPC_Str1 (CHAR *s, ADDRESS s__len, INT32 x) { CHAR ch; INT16 i; @@ -156,7 +156,7 @@ static void OPC_Str1 (CHAR *s, LONGINT s__len, INT32 x) __DEL(s); } -static INT16 OPC_Length (CHAR *s, LONGINT s__len) +static INT16 OPC_Length (CHAR *s, ADDRESS s__len) { INT16 i; i = 0; @@ -166,7 +166,7 @@ static INT16 OPC_Length (CHAR *s, LONGINT s__len) return i; } -static INT16 OPC_PerfectHash (CHAR *s, LONGINT s__len) +static INT16 OPC_PerfectHash (CHAR *s, ADDRESS s__len) { INT16 i, h; i = 0; @@ -364,7 +364,7 @@ static void OPC_DeclareBase (OPT_Object dcl) OPM_WriteString((CHAR*)"struct ", 8); OPC_BegBlk(); OPC_BegStat(); - OPC_Str1((CHAR*)"LONGINT len[#]", 15, nofdims); + OPC_Str1((CHAR*)"ADDRESS len[#]", 15, nofdims); OPC_EndStat(); OPC_BegStat(); __NEW(obj, OPT_ObjDesc); @@ -511,7 +511,7 @@ static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamNa typ = par->typ->BaseTyp; while (typ->comp == 3) { if (ansiDefine) { - OPM_WriteString((CHAR*)", LONGINT ", 11); + OPM_WriteString((CHAR*)", ADDRESS ", 11); } else { OPM_WriteString((CHAR*)", ", 3); } @@ -720,7 +720,7 @@ static void OPC_DefineType (OPT_Struct str) } } -static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len) +static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, ADDRESS y__len) { INT16 i; __DUP(y, y__len, CHAR); @@ -969,7 +969,7 @@ static void OPC_IdentList (OPT_Object obj, INT16 vis) OPC_EndStat(); OPC_BegStat(); base = OPT_linttyp; - OPM_WriteString((CHAR*)"LONGINT ", 9); + OPM_WriteString((CHAR*)"ADDRESS ", 9); OPC_LenList(obj, 0, 1); } else if ((obj->mode == 2 && obj->typ->comp == 4)) { OPC_EndStat(); @@ -1008,7 +1008,7 @@ static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames) __COPY(name, obj->name, 256); } if (obj->typ->comp == 3) { - OPM_WriteString((CHAR*)", LONGINT ", 11); + OPM_WriteString((CHAR*)", ADDRESS ", 11); OPC_LenList(obj, 1, showParamNames); } else if ((obj->mode == 2 && obj->typ->comp == 4)) { OPM_WriteString((CHAR*)", ADDRESS *", 12); @@ -1062,7 +1062,7 @@ static void OPC_ProcPredefs (OPT_Object obj, INT8 vis) } } -static void OPC_Include (CHAR *name, LONGINT name__len) +static void OPC_Include (CHAR *name, ADDRESS name__len) { __DUP(name, name__len, CHAR); OPM_WriteString((CHAR*)"#include ", 10); @@ -1744,7 +1744,7 @@ static void OPC_CharacterLiteral (INT64 c) } } -static void OPC_StringLiteral (CHAR *s, LONGINT s__len, INT32 l) +static void OPC_StringLiteral (CHAR *s, ADDRESS s__len, INT32 l) { INT32 i; INT16 c; @@ -1912,9 +1912,9 @@ static struct InitKeywords__46 { struct InitKeywords__46 *lnk; } *InitKeywords__46_s; -static void Enter__47 (CHAR *s, LONGINT s__len); +static void Enter__47 (CHAR *s, ADDRESS s__len); -static void Enter__47 (CHAR *s, LONGINT s__len) +static void Enter__47 (CHAR *s, ADDRESS s__len) { INT16 h; __DUP(s, s__len, CHAR); diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index 842e7dec..5624314d 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index e76d763e..632b78e5 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -53,26 +53,26 @@ export void OPM_FPrintLReal (INT32 *fp, LONGREAL val); export void OPM_FPrintReal (INT32 *fp, REAL val); export void OPM_FPrintSet (INT32 *fp, UINT64 val); static void OPM_FindLine (Files_File f, Files_Rider *r, ADDRESS *r__typ, INT64 pos); -static void OPM_FingerprintBytes (INT32 *fp, SYSTEM_BYTE *bytes, LONGINT bytes__len); +static void OPM_FingerprintBytes (INT32 *fp, SYSTEM_BYTE *bytes, ADDRESS bytes__len); export void OPM_Get (CHAR *ch); -export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); +export void OPM_Init (BOOLEAN *done, CHAR *mname, ADDRESS mname__len); export void OPM_InitOptions (void); export INT16 OPM_Integer (INT64 n); static void OPM_LogErrMsg (INT16 n); -export void OPM_LogVT100 (CHAR *vt100code, LONGINT vt100code__len); +export void OPM_LogVT100 (CHAR *vt100code, ADDRESS vt100code__len); export void OPM_LogW (CHAR ch); export void OPM_LogWLn (void); export void OPM_LogWNum (INT64 i, INT64 len); -export void OPM_LogWStr (CHAR *s, LONGINT s__len); +export void OPM_LogWStr (CHAR *s, ADDRESS s__len); export INT32 OPM_Longint (INT64 n); -static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len); +static void OPM_MakeFileName (CHAR *name, ADDRESS name__len, CHAR *FName, ADDRESS FName__len, CHAR *ext, ADDRESS ext__len); export void OPM_Mark (INT16 n, INT32 pos); -export void OPM_NewSym (CHAR *modName, LONGINT modName__len); -export void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); -export void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); +export void OPM_NewSym (CHAR *modName, ADDRESS modName__len); +export void OPM_OldSym (CHAR *modName, ADDRESS modName__len, BOOLEAN *done); +export void OPM_OpenFiles (CHAR *moduleName, ADDRESS moduleName__len); export BOOLEAN OPM_OpenPar (void); export void OPM_RegisterNewSym (void); -static void OPM_ScanOptions (CHAR *s, LONGINT s__len); +static void OPM_ScanOptions (CHAR *s, ADDRESS s__len); static void OPM_ShowLine (INT64 pos); export INT64 OPM_SignedMaximum (INT32 bytecount); export INT64 OPM_SignedMinimum (INT32 bytecount); @@ -93,8 +93,8 @@ export void OPM_WriteHex (INT64 i); export void OPM_WriteInt (INT64 i); export void OPM_WriteLn (void); export void OPM_WriteReal (LONGREAL r, CHAR suffx); -export void OPM_WriteString (CHAR *s, LONGINT s__len); -export void OPM_WriteStringVar (CHAR *s, LONGINT s__len); +export void OPM_WriteString (CHAR *s, ADDRESS s__len); +export void OPM_WriteStringVar (CHAR *s, ADDRESS s__len); export BOOLEAN OPM_eofSF (void); export void OPM_err (INT16 n); @@ -105,7 +105,7 @@ void OPM_LogW (CHAR ch) Out_Char(ch); } -void OPM_LogWStr (CHAR *s, LONGINT s__len) +void OPM_LogWStr (CHAR *s, ADDRESS s__len) { __DUP(s, s__len, CHAR); Out_String(s, s__len); @@ -122,7 +122,7 @@ void OPM_LogWLn (void) Out_Ln(); } -void OPM_LogVT100 (CHAR *vt100code, LONGINT vt100code__len) +void OPM_LogVT100 (CHAR *vt100code, ADDRESS vt100code__len) { __DUP(vt100code, vt100code__len, CHAR); if ((Out_IsConsole && !__IN(16, OPM_Options, 32))) { @@ -154,7 +154,7 @@ INT16 OPM_Integer (INT64 n) return __VAL(INT16, n); } -static void OPM_ScanOptions (CHAR *s, LONGINT s__len) +static void OPM_ScanOptions (CHAR *s, ADDRESS s__len) { INT16 i; __DUP(s, s__len, CHAR); @@ -465,7 +465,7 @@ void OPM_InitOptions (void) Files_SetSearchPath(searchpath, 1024); } -void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len) +void OPM_Init (BOOLEAN *done, CHAR *mname, ADDRESS mname__len) { Texts_Text T = NIL; INT32 beg, end, time; @@ -514,7 +514,7 @@ void OPM_Get (CHAR *ch) } } -static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len) +static void OPM_MakeFileName (CHAR *name, ADDRESS name__len, CHAR *FName, ADDRESS FName__len, CHAR *ext, ADDRESS ext__len) { INT16 i, j; CHAR ch; @@ -700,7 +700,7 @@ void OPM_err (INT16 n) OPM_Mark(n, OPM_errpos); } -static void OPM_FingerprintBytes (INT32 *fp, SYSTEM_BYTE *bytes, LONGINT bytes__len) +static void OPM_FingerprintBytes (INT32 *fp, SYSTEM_BYTE *bytes, ADDRESS bytes__len) { INT16 i; INT32 l; @@ -772,7 +772,7 @@ void OPM_CloseOldSym (void) Files_Close(Files_Base(&OPM_oldSF, Files_Rider__typ)); } -void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done) +void OPM_OldSym (CHAR *modName, ADDRESS modName__len, BOOLEAN *done) { CHAR tag, ver; OPM_FileName fileName; @@ -832,7 +832,7 @@ void OPM_DeleteNewSym (void) { } -void OPM_NewSym (CHAR *modName, LONGINT modName__len) +void OPM_NewSym (CHAR *modName, ADDRESS modName__len) { OPM_FileName fileName; OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, 32, (CHAR*)".sym", 5); @@ -851,7 +851,7 @@ void OPM_Write (CHAR ch) Files_Write(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, ch); } -void OPM_WriteString (CHAR *s, LONGINT s__len) +void OPM_WriteString (CHAR *s, ADDRESS s__len) { INT16 i; i = 0; @@ -861,7 +861,7 @@ void OPM_WriteString (CHAR *s, LONGINT s__len) Files_WriteBytes(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, (void*)s, s__len * 1, i); } -void OPM_WriteStringVar (CHAR *s, LONGINT s__len) +void OPM_WriteStringVar (CHAR *s, ADDRESS s__len) { INT16 i; i = 0; @@ -986,7 +986,7 @@ static void OPM_Append (Files_Rider *R, ADDRESS *R__typ, Files_File F) } } -void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len) +void OPM_OpenFiles (CHAR *moduleName, ADDRESS moduleName__len) { CHAR FName[32]; __COPY(moduleName, OPM_modName, 32); diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index 2d272feb..c310c421 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h @@ -28,19 +28,19 @@ import void OPM_FPrintLReal (INT32 *fp, LONGREAL val); import void OPM_FPrintReal (INT32 *fp, REAL val); import void OPM_FPrintSet (INT32 *fp, UINT64 val); import void OPM_Get (CHAR *ch); -import void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); +import void OPM_Init (BOOLEAN *done, CHAR *mname, ADDRESS mname__len); import void OPM_InitOptions (void); import INT16 OPM_Integer (INT64 n); -import void OPM_LogVT100 (CHAR *vt100code, LONGINT vt100code__len); +import void OPM_LogVT100 (CHAR *vt100code, ADDRESS vt100code__len); import void OPM_LogW (CHAR ch); import void OPM_LogWLn (void); import void OPM_LogWNum (INT64 i, INT64 len); -import void OPM_LogWStr (CHAR *s, LONGINT s__len); +import void OPM_LogWStr (CHAR *s, ADDRESS s__len); import INT32 OPM_Longint (INT64 n); import void OPM_Mark (INT16 n, INT32 pos); -import void OPM_NewSym (CHAR *modName, LONGINT modName__len); -import void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); -import void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); +import void OPM_NewSym (CHAR *modName, ADDRESS modName__len); +import void OPM_OldSym (CHAR *modName, ADDRESS modName__len, BOOLEAN *done); +import void OPM_OpenFiles (CHAR *moduleName, ADDRESS moduleName__len); import BOOLEAN OPM_OpenPar (void); import void OPM_RegisterNewSym (void); import INT64 OPM_SignedMaximum (INT32 bytecount); @@ -61,8 +61,8 @@ import void OPM_WriteHex (INT64 i); import void OPM_WriteInt (INT64 i); import void OPM_WriteLn (void); import void OPM_WriteReal (LONGREAL r, CHAR suffx); -import void OPM_WriteString (CHAR *s, LONGINT s__len); -import void OPM_WriteStringVar (CHAR *s, LONGINT s__len); +import void OPM_WriteString (CHAR *s, ADDRESS s__len); +import void OPM_WriteStringVar (CHAR *s, ADDRESS s__len); import BOOLEAN OPM_eofSF (void); import void OPM_err (INT16 n); import void *OPM__init(void); diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index 3f360d00..02fd6337 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index 5a71eb39..acb2df91 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index 6ee700e5..7aedbbd6 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index 1f7a3e58..e49c222b 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index fb007184..58f06737 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -120,7 +120,7 @@ static void OPT_EnterTyp (OPS_Name name, INT8 form, INT16 size, OPT_Struct *res) static void OPT_EnterTypeAlias (OPS_Name name, OPT_Object *res); export void OPT_Export (BOOLEAN *ext, BOOLEAN *new); export void OPT_FPrintErr (OPT_Object obj, INT16 errcode); -static void OPT_FPrintName (INT32 *fp, CHAR *name, LONGINT name__len); +static void OPT_FPrintName (INT32 *fp, CHAR *name, ADDRESS name__len); export void OPT_FPrintObj (OPT_Object obj); static void OPT_FPrintSign (INT32 *fp, OPT_Struct result, OPT_Object par); export void OPT_FPrintStr (OPT_Struct typ); @@ -132,7 +132,7 @@ export void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); static void OPT_InConstant (INT32 f, OPT_Const conval); static OPT_Object OPT_InFld (void); static void OPT_InMod (INT8 *mno); -static void OPT_InName (CHAR *name, LONGINT name__len); +static void OPT_InName (CHAR *name, ADDRESS name__len); static OPT_Object OPT_InObj (INT8 mno); static void OPT_InSign (INT8 mno, OPT_Struct *res, OPT_Object *par); static void OPT_InStruct (OPT_Struct *typ); @@ -155,7 +155,7 @@ static void OPT_OutConstant (OPT_Object obj); static void OPT_OutFlds (OPT_Object fld, INT32 adr, BOOLEAN visible); static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, INT32 adr); static void OPT_OutMod (INT16 mno); -static void OPT_OutName (CHAR *name, LONGINT name__len); +static void OPT_OutName (CHAR *name, ADDRESS name__len); static void OPT_OutObj (OPT_Object obj); static void OPT_OutSign (OPT_Struct result, OPT_Object par); static void OPT_OutStr (OPT_Struct typ); @@ -576,7 +576,7 @@ void OPT_Insert (OPS_Name name, OPT_Object *obj) *obj = ob1; } -static void OPT_FPrintName (INT32 *fp, CHAR *name, LONGINT name__len) +static void OPT_FPrintName (INT32 *fp, CHAR *name, ADDRESS name__len) { INT16 i; CHAR ch; @@ -957,7 +957,7 @@ void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old) } } -static void OPT_InName (CHAR *name, LONGINT name__len) +static void OPT_InName (CHAR *name, ADDRESS name__len) { INT16 i; CHAR ch; @@ -1483,7 +1483,7 @@ void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) } } -static void OPT_OutName (CHAR *name, LONGINT name__len) +static void OPT_OutName (CHAR *name, ADDRESS name__len) { INT16 i; CHAR ch; diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index 90fcacf5..9d34cea9 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index 5c21cb97..f6d42592 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index c4a61586..0f1980ac 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Out.c b/bootstrap/unix-44/Out.c index 39f383cf..82ad945b 100644 --- a/bootstrap/unix-44/Out.c +++ b/bootstrap/unix-44/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -17,16 +17,16 @@ static INT16 Out_in; export void Out_Char (CHAR ch); export void Out_Flush (void); export void Out_Int (INT64 x, INT64 n); -static INT32 Out_Length (CHAR *s, LONGINT s__len); +static INT32 Out_Length (CHAR *s, ADDRESS s__len); export void Out_Ln (void); export void Out_LongReal (LONGREAL x, INT16 n); export void Out_Open (void); export void Out_Real (REAL x, INT16 n); static void Out_RealP (LONGREAL x, INT16 n, BOOLEAN long_); -export void Out_String (CHAR *str, LONGINT str__len); +export void Out_String (CHAR *str, ADDRESS str__len); export LONGREAL Out_Ten (INT16 e); -static void Out_digit (INT64 n, CHAR *s, LONGINT s__len, INT16 *i); -static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, INT16 *i); +static void Out_digit (INT64 n, CHAR *s, ADDRESS s__len, INT16 *i); +static void Out_prepend (CHAR *t, ADDRESS t__len, CHAR *s, ADDRESS s__len, INT16 *i); #define Out_Entier64(x) (INT64)(x) @@ -55,7 +55,7 @@ void Out_Char (CHAR ch) } } -static INT32 Out_Length (CHAR *s, LONGINT s__len) +static INT32 Out_Length (CHAR *s, ADDRESS s__len) { INT32 l; l = 0; @@ -65,7 +65,7 @@ static INT32 Out_Length (CHAR *s, LONGINT s__len) return l; } -void Out_String (CHAR *str, LONGINT str__len) +void Out_String (CHAR *str, ADDRESS str__len) { INT32 l; INT16 error; @@ -125,13 +125,13 @@ void Out_Ln (void) Out_Flush(); } -static void Out_digit (INT64 n, CHAR *s, LONGINT s__len, INT16 *i) +static void Out_digit (INT64 n, CHAR *s, ADDRESS s__len, INT16 *i) { *i -= 1; s[__X(*i, s__len)] = (CHAR)(__MOD(n, 10) + 48); } -static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, INT16 *i) +static void Out_prepend (CHAR *t, ADDRESS t__len, CHAR *s, ADDRESS s__len, INT16 *i) { INT16 j; INT32 l; diff --git a/bootstrap/unix-44/Out.h b/bootstrap/unix-44/Out.h index 0e66420d..d58a17d5 100644 --- a/bootstrap/unix-44/Out.h +++ b/bootstrap/unix-44/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h @@ -16,7 +16,7 @@ import void Out_Ln (void); import void Out_LongReal (LONGREAL x, INT16 n); import void Out_Open (void); import void Out_Real (REAL x, INT16 n); -import void Out_String (CHAR *str, LONGINT str__len); +import void Out_String (CHAR *str, ADDRESS str__len); import LONGREAL Out_Ten (INT16 e); import void *Out__init(void); diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 72c15bf8..459d5079 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -45,35 +45,35 @@ export CHAR Platform_NL[3]; export ADDRESS *Platform_FileIdentity__typ; export BOOLEAN Platform_Absent (INT16 e); -export INT16 Platform_ArgPos (CHAR *s, LONGINT s__len); -export INT16 Platform_Chdir (CHAR *n, LONGINT n__len); +export INT16 Platform_ArgPos (CHAR *s, ADDRESS s__len); +export INT16 Platform_Chdir (CHAR *n, ADDRESS n__len); export INT16 Platform_Close (INT32 h); export BOOLEAN Platform_ConnectionFailed (INT16 e); export void Platform_Delay (INT32 ms); export BOOLEAN Platform_DifferentFilesystems (INT16 e); export INT16 Platform_Error (void); export void Platform_Exit (INT32 code); -export void Platform_GetArg (INT16 n, CHAR *val, LONGINT val__len); +export void Platform_GetArg (INT16 n, CHAR *val, ADDRESS val__len); export void Platform_GetClock (INT32 *t, INT32 *d); -export void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); +export void Platform_GetEnv (CHAR *var, ADDRESS var__len, CHAR *val, ADDRESS val__len); export void Platform_GetIntArg (INT16 n, INT32 *val); export void Platform_GetTimeOfDay (INT32 *sec, INT32 *usec); export INT16 Platform_Identify (INT32 h, Platform_FileIdentity *identity, ADDRESS *identity__typ); -export INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ); +export INT16 Platform_IdentifyByName (CHAR *n, ADDRESS n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ); export BOOLEAN Platform_Inaccessible (INT16 e); export void Platform_Init (INT32 argc, INT32 argvadr); export BOOLEAN Platform_Interrupted (INT16 e); export BOOLEAN Platform_IsConsole (INT32 h); export void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d); -export INT16 Platform_New (CHAR *n, LONGINT n__len, INT32 *h); +export INT16 Platform_New (CHAR *n, ADDRESS n__len, INT32 *h); export BOOLEAN Platform_NoSuchDirectory (INT16 e); export INT32 Platform_OSAllocate (INT32 size); export void Platform_OSFree (INT32 address); -export INT16 Platform_OldRO (CHAR *n, LONGINT n__len, INT32 *h); -export INT16 Platform_OldRW (CHAR *n, LONGINT n__len, INT32 *h); +export INT16 Platform_OldRO (CHAR *n, ADDRESS n__len, INT32 *h); +export INT16 Platform_OldRW (CHAR *n, ADDRESS n__len, INT32 *h); export INT16 Platform_Read (INT32 h, INT32 p, INT32 l, INT32 *n); -export INT16 Platform_ReadBuf (INT32 h, SYSTEM_BYTE *b, LONGINT b__len, INT32 *n); -export INT16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); +export INT16 Platform_ReadBuf (INT32 h, SYSTEM_BYTE *b, ADDRESS b__len, INT32 *n); +export INT16 Platform_Rename (CHAR *o, ADDRESS o__len, CHAR *n, ADDRESS n__len); export BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); export BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); export INT16 Platform_Seek (INT32 h, INT32 offset, INT16 whence); @@ -83,16 +83,16 @@ export void Platform_SetMTime (Platform_FileIdentity *target, ADDRESS *target__t export void Platform_SetQuitHandler (Platform_SignalHandler handler); export INT16 Platform_Size (INT32 h, INT32 *l); export INT16 Platform_Sync (INT32 h); -export INT16 Platform_System (CHAR *cmd, LONGINT cmd__len); +export INT16 Platform_System (CHAR *cmd, ADDRESS cmd__len); static void Platform_TestLittleEndian (void); export INT32 Platform_Time (void); export BOOLEAN Platform_TimedOut (INT16 e); export BOOLEAN Platform_TooManyFiles (INT16 e); export INT16 Platform_Truncate (INT32 h, INT32 l); -export INT16 Platform_Unlink (CHAR *n, LONGINT n__len); +export INT16 Platform_Unlink (CHAR *n, ADDRESS n__len); export INT16 Platform_Write (INT32 h, INT32 p, INT32 l); static void Platform_YMDHMStoClock (INT32 ye, INT32 mo, INT32 da, INT32 ho, INT32 mi, INT32 se, INT32 *t, INT32 *d); -export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); +export BOOLEAN Platform_getEnv (CHAR *var, ADDRESS var__len, CHAR *val, ADDRESS val__len); #include #include @@ -223,7 +223,7 @@ void Platform_Init (INT32 argc, INT32 argvadr) Platform_HeapInitHeap(); } -BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len) +BOOLEAN Platform_getEnv (CHAR *var, ADDRESS var__len, CHAR *val, ADDRESS val__len) { Platform_EnvPtr p = NIL; __DUP(var, var__len, CHAR); @@ -235,7 +235,7 @@ BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__le return p != NIL; } -void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len) +void Platform_GetEnv (CHAR *var, ADDRESS var__len, CHAR *val, ADDRESS val__len) { __DUP(var, var__len, CHAR); if (!Platform_getEnv(var, var__len, (void*)val, val__len)) { @@ -244,7 +244,7 @@ void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len) __DEL(var); } -void Platform_GetArg (INT16 n, CHAR *val, LONGINT val__len) +void Platform_GetArg (INT16 n, CHAR *val, ADDRESS val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { @@ -279,7 +279,7 @@ void Platform_GetIntArg (INT16 n, INT32 *val) } } -INT16 Platform_ArgPos (CHAR *s, LONGINT s__len) +INT16 Platform_ArgPos (CHAR *s, ADDRESS s__len) { INT16 i; CHAR arg[256]; @@ -345,7 +345,7 @@ void Platform_Delay (INT32 ms) Platform_nanosleep(s, ns); } -INT16 Platform_System (CHAR *cmd, LONGINT cmd__len) +INT16 Platform_System (CHAR *cmd, ADDRESS cmd__len) { __DUP(cmd, cmd__len, CHAR); __DEL(cmd); @@ -357,7 +357,7 @@ INT16 Platform_Error (void) return Platform_err(); } -INT16 Platform_OldRO (CHAR *n, LONGINT n__len, INT32 *h) +INT16 Platform_OldRO (CHAR *n, ADDRESS n__len, INT32 *h) { INT16 fd; fd = Platform_openro(n, n__len); @@ -370,7 +370,7 @@ INT16 Platform_OldRO (CHAR *n, LONGINT n__len, INT32 *h) __RETCHK; } -INT16 Platform_OldRW (CHAR *n, LONGINT n__len, INT32 *h) +INT16 Platform_OldRW (CHAR *n, ADDRESS n__len, INT32 *h) { INT16 fd; fd = Platform_openrw(n, n__len); @@ -383,7 +383,7 @@ INT16 Platform_OldRW (CHAR *n, LONGINT n__len, INT32 *h) __RETCHK; } -INT16 Platform_New (CHAR *n, LONGINT n__len, INT32 *h) +INT16 Platform_New (CHAR *n, ADDRESS n__len, INT32 *h) { INT16 fd; fd = Platform_opennew(n, n__len); @@ -423,7 +423,7 @@ INT16 Platform_Identify (INT32 h, Platform_FileIdentity *identity, ADDRESS *iden return 0; } -INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ) +INT16 Platform_IdentifyByName (CHAR *n, ADDRESS n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ) { __DUP(n, n__len, CHAR); Platform_structstats(); @@ -481,7 +481,7 @@ INT16 Platform_Read (INT32 h, INT32 p, INT32 l, INT32 *n) __RETCHK; } -INT16 Platform_ReadBuf (INT32 h, SYSTEM_BYTE *b, LONGINT b__len, INT32 *n) +INT16 Platform_ReadBuf (INT32 h, SYSTEM_BYTE *b, ADDRESS b__len, INT32 *n) { *n = Platform_readfile(h, (ADDRESS)b, b__len); if (*n < 0) { @@ -535,7 +535,7 @@ INT16 Platform_Truncate (INT32 h, INT32 l) __RETCHK; } -INT16 Platform_Unlink (CHAR *n, LONGINT n__len) +INT16 Platform_Unlink (CHAR *n, ADDRESS n__len) { if (Platform_unlink(n, n__len) < 0) { return Platform_err(); @@ -545,7 +545,7 @@ INT16 Platform_Unlink (CHAR *n, LONGINT n__len) __RETCHK; } -INT16 Platform_Chdir (CHAR *n, LONGINT n__len) +INT16 Platform_Chdir (CHAR *n, ADDRESS n__len) { INT16 r; if ((Platform_chdir(n, n__len) >= 0 && Platform_getcwd((void*)Platform_CWD, 256) != NIL)) { @@ -556,7 +556,7 @@ INT16 Platform_Chdir (CHAR *n, LONGINT n__len) __RETCHK; } -INT16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) +INT16 Platform_Rename (CHAR *o, ADDRESS o__len, CHAR *n, ADDRESS n__len) { if (Platform_rename(o, o__len, n, n__len) < 0) { return Platform_err(); diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index b04f552d..34547692 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h @@ -27,35 +27,35 @@ import CHAR Platform_NL[3]; import ADDRESS *Platform_FileIdentity__typ; import BOOLEAN Platform_Absent (INT16 e); -import INT16 Platform_ArgPos (CHAR *s, LONGINT s__len); -import INT16 Platform_Chdir (CHAR *n, LONGINT n__len); +import INT16 Platform_ArgPos (CHAR *s, ADDRESS s__len); +import INT16 Platform_Chdir (CHAR *n, ADDRESS n__len); import INT16 Platform_Close (INT32 h); import BOOLEAN Platform_ConnectionFailed (INT16 e); import void Platform_Delay (INT32 ms); import BOOLEAN Platform_DifferentFilesystems (INT16 e); import INT16 Platform_Error (void); import void Platform_Exit (INT32 code); -import void Platform_GetArg (INT16 n, CHAR *val, LONGINT val__len); +import void Platform_GetArg (INT16 n, CHAR *val, ADDRESS val__len); import void Platform_GetClock (INT32 *t, INT32 *d); -import void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); +import void Platform_GetEnv (CHAR *var, ADDRESS var__len, CHAR *val, ADDRESS val__len); import void Platform_GetIntArg (INT16 n, INT32 *val); import void Platform_GetTimeOfDay (INT32 *sec, INT32 *usec); import INT16 Platform_Identify (INT32 h, Platform_FileIdentity *identity, ADDRESS *identity__typ); -import INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ); +import INT16 Platform_IdentifyByName (CHAR *n, ADDRESS n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ); import BOOLEAN Platform_Inaccessible (INT16 e); import void Platform_Init (INT32 argc, INT32 argvadr); import BOOLEAN Platform_Interrupted (INT16 e); import BOOLEAN Platform_IsConsole (INT32 h); import void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d); -import INT16 Platform_New (CHAR *n, LONGINT n__len, INT32 *h); +import INT16 Platform_New (CHAR *n, ADDRESS n__len, INT32 *h); import BOOLEAN Platform_NoSuchDirectory (INT16 e); import INT32 Platform_OSAllocate (INT32 size); import void Platform_OSFree (INT32 address); -import INT16 Platform_OldRO (CHAR *n, LONGINT n__len, INT32 *h); -import INT16 Platform_OldRW (CHAR *n, LONGINT n__len, INT32 *h); +import INT16 Platform_OldRO (CHAR *n, ADDRESS n__len, INT32 *h); +import INT16 Platform_OldRW (CHAR *n, ADDRESS n__len, INT32 *h); import INT16 Platform_Read (INT32 h, INT32 p, INT32 l, INT32 *n); -import INT16 Platform_ReadBuf (INT32 h, SYSTEM_BYTE *b, LONGINT b__len, INT32 *n); -import INT16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); +import INT16 Platform_ReadBuf (INT32 h, SYSTEM_BYTE *b, ADDRESS b__len, INT32 *n); +import INT16 Platform_Rename (CHAR *o, ADDRESS o__len, CHAR *n, ADDRESS n__len); import BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); import BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); import INT16 Platform_Seek (INT32 h, INT32 offset, INT16 whence); @@ -65,14 +65,14 @@ import void Platform_SetMTime (Platform_FileIdentity *target, ADDRESS *target__t import void Platform_SetQuitHandler (Platform_SignalHandler handler); import INT16 Platform_Size (INT32 h, INT32 *l); import INT16 Platform_Sync (INT32 h); -import INT16 Platform_System (CHAR *cmd, LONGINT cmd__len); +import INT16 Platform_System (CHAR *cmd, ADDRESS cmd__len); import INT32 Platform_Time (void); import BOOLEAN Platform_TimedOut (INT16 e); import BOOLEAN Platform_TooManyFiles (INT16 e); import INT16 Platform_Truncate (INT32 h, INT32 l); -import INT16 Platform_Unlink (CHAR *n, LONGINT n__len); +import INT16 Platform_Unlink (CHAR *n, ADDRESS n__len); import INT16 Platform_Write (INT32 h, INT32 p, INT32 l); -import BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); +import BOOLEAN Platform_getEnv (CHAR *var, ADDRESS var__len, CHAR *val, ADDRESS val__len); import void *Platform__init(void); diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index cd4c3c61..be3ad909 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -10,11 +10,11 @@ -static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LONGINT d__len); -export void Reals_Convert (REAL x, INT16 n, CHAR *d, LONGINT d__len); -export void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len); -export void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len); -export void Reals_ConvertL (LONGREAL x, INT16 n, CHAR *d, LONGINT d__len); +static void Reals_BytesToHex (SYSTEM_BYTE *b, ADDRESS b__len, SYSTEM_BYTE *d, ADDRESS d__len); +export void Reals_Convert (REAL x, INT16 n, CHAR *d, ADDRESS d__len); +export void Reals_ConvertH (REAL y, CHAR *d, ADDRESS d__len); +export void Reals_ConvertHL (LONGREAL x, CHAR *d, ADDRESS d__len); +export void Reals_ConvertL (LONGREAL x, INT16 n, CHAR *d, ADDRESS d__len); export INT16 Reals_Expo (REAL x); export INT16 Reals_ExpoL (LONGREAL x); export void Reals_SetExpo (REAL *x, INT16 ex); @@ -79,7 +79,7 @@ INT16 Reals_ExpoL (LONGREAL x) return __MASK(__ASHR(i, 4), -2048); } -void Reals_ConvertL (LONGREAL x, INT16 n, CHAR *d, LONGINT d__len) +void Reals_ConvertL (LONGREAL x, INT16 n, CHAR *d, ADDRESS d__len) { INT32 i, j, k; if (x < (LONGREAL)0) { @@ -107,7 +107,7 @@ void Reals_ConvertL (LONGREAL x, INT16 n, CHAR *d, LONGINT d__len) } } -void Reals_Convert (REAL x, INT16 n, CHAR *d, LONGINT d__len) +void Reals_Convert (REAL x, INT16 n, CHAR *d, ADDRESS d__len) { Reals_ConvertL(x, n, (void*)d, d__len); } @@ -122,7 +122,7 @@ static CHAR Reals_ToHex (INT16 i) __RETCHK; } -static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LONGINT d__len) +static void Reals_BytesToHex (SYSTEM_BYTE *b, ADDRESS b__len, SYSTEM_BYTE *d, ADDRESS d__len) { INT16 i; INT32 l; @@ -137,12 +137,12 @@ static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LO } } -void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len) +void Reals_ConvertH (REAL y, CHAR *d, ADDRESS d__len) { Reals_BytesToHex((void*)&y, 4, (void*)d, d__len * 1); } -void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len) +void Reals_ConvertHL (LONGREAL x, CHAR *d, ADDRESS d__len) { Reals_BytesToHex((void*)&x, 8, (void*)d, d__len * 1); } diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index f0c84ab1..e8d15a2f 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h @@ -8,10 +8,10 @@ -import void Reals_Convert (REAL x, INT16 n, CHAR *d, LONGINT d__len); -import void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len); -import void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len); -import void Reals_ConvertL (LONGREAL x, INT16 n, CHAR *d, LONGINT d__len); +import void Reals_Convert (REAL x, INT16 n, CHAR *d, ADDRESS d__len); +import void Reals_ConvertH (REAL y, CHAR *d, ADDRESS d__len); +import void Reals_ConvertHL (LONGREAL x, CHAR *d, ADDRESS d__len); +import void Reals_ConvertL (LONGREAL x, INT16 n, CHAR *d, ADDRESS d__len); import INT16 Reals_Expo (REAL x); import INT16 Reals_ExpoL (LONGREAL x); import void Reals_SetExpo (REAL *x, INT16 ex); diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index b5707327..fd550df3 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -10,18 +10,18 @@ -export void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len); -export void Strings_Cap (CHAR *s, LONGINT s__len); -export void Strings_Delete (CHAR *s, LONGINT s__len, INT16 pos, INT16 n); -export void Strings_Extract (CHAR *source, LONGINT source__len, INT16 pos, INT16 n, CHAR *dest, LONGINT dest__len); -export void Strings_Insert (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len); -export INT16 Strings_Length (CHAR *s, LONGINT s__len); -export BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len); -export INT16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, INT16 pos); -export void Strings_Replace (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len); +export void Strings_Append (CHAR *extra, ADDRESS extra__len, CHAR *dest, ADDRESS dest__len); +export void Strings_Cap (CHAR *s, ADDRESS s__len); +export void Strings_Delete (CHAR *s, ADDRESS s__len, INT16 pos, INT16 n); +export void Strings_Extract (CHAR *source, ADDRESS source__len, INT16 pos, INT16 n, CHAR *dest, ADDRESS dest__len); +export void Strings_Insert (CHAR *source, ADDRESS source__len, INT16 pos, CHAR *dest, ADDRESS dest__len); +export INT16 Strings_Length (CHAR *s, ADDRESS s__len); +export BOOLEAN Strings_Match (CHAR *string, ADDRESS string__len, CHAR *pattern, ADDRESS pattern__len); +export INT16 Strings_Pos (CHAR *pattern, ADDRESS pattern__len, CHAR *s, ADDRESS s__len, INT16 pos); +export void Strings_Replace (CHAR *source, ADDRESS source__len, INT16 pos, CHAR *dest, ADDRESS dest__len); -INT16 Strings_Length (CHAR *s, LONGINT s__len) +INT16 Strings_Length (CHAR *s, ADDRESS s__len) { INT32 i; __DUP(s, s__len, CHAR); @@ -39,7 +39,7 @@ INT16 Strings_Length (CHAR *s, LONGINT s__len) __RETCHK; } -void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len) +void Strings_Append (CHAR *extra, ADDRESS extra__len, CHAR *dest, ADDRESS dest__len) { INT16 n1, n2, i; __DUP(extra, extra__len, CHAR); @@ -56,7 +56,7 @@ void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__ __DEL(extra); } -void Strings_Insert (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len) +void Strings_Insert (CHAR *source, ADDRESS source__len, INT16 pos, CHAR *dest, ADDRESS dest__len) { INT16 n1, n2, i; __DUP(source, source__len, CHAR); @@ -87,7 +87,7 @@ void Strings_Insert (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, L __DEL(source); } -void Strings_Delete (CHAR *s, LONGINT s__len, INT16 pos, INT16 n) +void Strings_Delete (CHAR *s, ADDRESS s__len, INT16 pos, INT16 n) { INT16 len, i; len = Strings_Length(s, s__len); @@ -110,7 +110,7 @@ void Strings_Delete (CHAR *s, LONGINT s__len, INT16 pos, INT16 n) } } -void Strings_Replace (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len) +void Strings_Replace (CHAR *source, ADDRESS source__len, INT16 pos, CHAR *dest, ADDRESS dest__len) { __DUP(source, source__len, CHAR); Strings_Delete((void*)dest, dest__len, pos, pos + Strings_Length(source, source__len)); @@ -118,7 +118,7 @@ void Strings_Replace (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, __DEL(source); } -void Strings_Extract (CHAR *source, LONGINT source__len, INT16 pos, INT16 n, CHAR *dest, LONGINT dest__len) +void Strings_Extract (CHAR *source, ADDRESS source__len, INT16 pos, INT16 n, CHAR *dest, ADDRESS dest__len) { INT16 len, destLen, i; __DUP(source, source__len, CHAR); @@ -143,7 +143,7 @@ void Strings_Extract (CHAR *source, LONGINT source__len, INT16 pos, INT16 n, CHA __DEL(source); } -INT16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, INT16 pos) +INT16 Strings_Pos (CHAR *pattern, ADDRESS pattern__len, CHAR *s, ADDRESS s__len, INT16 pos) { INT16 n1, n2, i, j; __DUP(pattern, pattern__len, CHAR); @@ -175,7 +175,7 @@ INT16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, return -1; } -void Strings_Cap (CHAR *s, LONGINT s__len) +void Strings_Cap (CHAR *s, ADDRESS s__len) { INT16 i; i = 0; @@ -191,9 +191,9 @@ static struct Match__7 { struct Match__7 *lnk; } *Match__7_s; -static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, INT16 n, INT16 m); +static BOOLEAN M__8 (CHAR *name, ADDRESS name__len, CHAR *mask, ADDRESS mask__len, INT16 n, INT16 m); -static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, INT16 n, INT16 m) +static BOOLEAN M__8 (CHAR *name, ADDRESS name__len, CHAR *mask, ADDRESS mask__len, INT16 n, INT16 m) { while ((((n >= 0 && m >= 0)) && mask[__X(m, mask__len)] != '*')) { if (name[__X(n, name__len)] != mask[__X(m, mask__len)]) { @@ -220,7 +220,7 @@ static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__le return 0; } -BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len) +BOOLEAN Strings_Match (CHAR *string, ADDRESS string__len, CHAR *pattern, ADDRESS pattern__len) { struct Match__7 _s; BOOLEAN __retval; diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index c987af8d..76cb022d 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h @@ -8,15 +8,15 @@ -import void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len); -import void Strings_Cap (CHAR *s, LONGINT s__len); -import void Strings_Delete (CHAR *s, LONGINT s__len, INT16 pos, INT16 n); -import void Strings_Extract (CHAR *source, LONGINT source__len, INT16 pos, INT16 n, CHAR *dest, LONGINT dest__len); -import void Strings_Insert (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len); -import INT16 Strings_Length (CHAR *s, LONGINT s__len); -import BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len); -import INT16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, INT16 pos); -import void Strings_Replace (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len); +import void Strings_Append (CHAR *extra, ADDRESS extra__len, CHAR *dest, ADDRESS dest__len); +import void Strings_Cap (CHAR *s, ADDRESS s__len); +import void Strings_Delete (CHAR *s, ADDRESS s__len, INT16 pos, INT16 n); +import void Strings_Extract (CHAR *source, ADDRESS source__len, INT16 pos, INT16 n, CHAR *dest, ADDRESS dest__len); +import void Strings_Insert (CHAR *source, ADDRESS source__len, INT16 pos, CHAR *dest, ADDRESS dest__len); +import INT16 Strings_Length (CHAR *s, ADDRESS s__len); +import BOOLEAN Strings_Match (CHAR *string, ADDRESS string__len, CHAR *pattern, ADDRESS pattern__len); +import INT16 Strings_Pos (CHAR *pattern, ADDRESS pattern__len, CHAR *s, ADDRESS s__len, INT16 pos); +import void Strings_Replace (CHAR *source, ADDRESS source__len, INT16 pos, CHAR *dest, ADDRESS dest__len); import void *Strings__init(void); diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index 0ac5c5f2..f304b8bf 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -187,20 +187,20 @@ export void Texts_Append (Texts_Text T, Texts_Buffer B); export void Texts_ChangeLooks (Texts_Text T, INT32 beg, INT32 end, UINT32 sel, Texts_FontsFont fnt, INT8 col, INT8 voff); static Texts_Elem Texts_CloneElem (Texts_Elem e); static Texts_Piece Texts_ClonePiece (Texts_Piece p); -export void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len); +export void Texts_Close (Texts_Text T, CHAR *name, ADDRESS name__len); export void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); export void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); export void Texts_Delete (Texts_Text T, INT32 beg, INT32 end); export Texts_Text Texts_ElemBase (Texts_Elem E); export INT32 Texts_ElemPos (Texts_Elem E); static void Texts_Find (Texts_Text T, INT32 *pos, Texts_Run *u, INT32 *org, INT32 *off); -static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len); +static Texts_FontsFont Texts_FontsThis (CHAR *name, ADDRESS name__len); static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, ADDRESS *msg__typ); export void Texts_Insert (Texts_Text T, INT32 pos, Texts_Buffer B); export void Texts_Load (Files_Rider *r, ADDRESS *r__typ, Texts_Text T); static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T); static void Texts_Merge (Texts_Text T, Texts_Run u, Texts_Run *v); -export void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len); +export void Texts_Open (Texts_Text T, CHAR *name, ADDRESS name__len); export void Texts_OpenBuf (Texts_Buffer B); export void Texts_OpenReader (Texts_Reader *R, ADDRESS *R__typ, Texts_Text T, INT32 pos); export void Texts_OpenScanner (Texts_Scanner *S, ADDRESS *S__typ, Texts_Text T, INT32 pos); @@ -229,10 +229,10 @@ export void Texts_WriteLongRealHex (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x export void Texts_WriteReal (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n); export void Texts_WriteRealFix (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n, INT16 k); export void Texts_WriteRealHex (Texts_Writer *W, ADDRESS *W__typ, REAL x); -export void Texts_WriteString (Texts_Writer *W, ADDRESS *W__typ, CHAR *s, LONGINT s__len); +export void Texts_WriteString (Texts_Writer *W, ADDRESS *W__typ, CHAR *s, ADDRESS s__len); -static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len) +static Texts_FontsFont Texts_FontsThis (CHAR *name, ADDRESS name__len) { Texts_FontsFont F = NIL; __NEW(F, Texts_FontDesc); @@ -1027,7 +1027,7 @@ void Texts_WriteLn (Texts_Writer *W, ADDRESS *W__typ) Texts_Write(&*W, W__typ, 0x0d); } -void Texts_WriteString (Texts_Writer *W, ADDRESS *W__typ, CHAR *s, LONGINT s__len) +void Texts_WriteString (Texts_Writer *W, ADDRESS *W__typ, CHAR *s, ADDRESS s__len) { INT16 i; __DUP(s, s__len, CHAR); @@ -1539,7 +1539,7 @@ void Texts_Load (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) Texts_Load0(&*r, r__typ, T); } -void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len) +void Texts_Open (Texts_Text T, CHAR *name, ADDRESS name__len) { Files_File f = NIL; Files_Rider r; @@ -1755,7 +1755,7 @@ void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) Store__39_s = _s.lnk; } -void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len) +void Texts_Close (Texts_Text T, CHAR *name, ADDRESS name__len) { Files_File f = NIL; Files_Rider r; diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index 0d5201cb..ecdf9223 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h @@ -130,7 +130,7 @@ import ADDRESS *Texts_Writer__typ; import void Texts_Append (Texts_Text T, Texts_Buffer B); import void Texts_ChangeLooks (Texts_Text T, INT32 beg, INT32 end, UINT32 sel, Texts_FontsFont fnt, INT8 col, INT8 voff); -import void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len); +import void Texts_Close (Texts_Text T, CHAR *name, ADDRESS name__len); import void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); import void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); import void Texts_Delete (Texts_Text T, INT32 beg, INT32 end); @@ -138,7 +138,7 @@ import Texts_Text Texts_ElemBase (Texts_Elem E); import INT32 Texts_ElemPos (Texts_Elem E); import void Texts_Insert (Texts_Text T, INT32 pos, Texts_Buffer B); import void Texts_Load (Files_Rider *r, ADDRESS *r__typ, Texts_Text T); -import void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len); +import void Texts_Open (Texts_Text T, CHAR *name, ADDRESS name__len); import void Texts_OpenBuf (Texts_Buffer B); import void Texts_OpenReader (Texts_Reader *R, ADDRESS *R__typ, Texts_Text T, INT32 pos); import void Texts_OpenScanner (Texts_Scanner *S, ADDRESS *S__typ, Texts_Text T, INT32 pos); @@ -165,7 +165,7 @@ import void Texts_WriteLongRealHex (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x import void Texts_WriteReal (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n); import void Texts_WriteRealFix (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n, INT16 k); import void Texts_WriteRealHex (Texts_Writer *W, ADDRESS *W__typ, REAL x); -import void Texts_WriteString (Texts_Writer *W, ADDRESS *W__typ, CHAR *s, LONGINT s__len); +import void Texts_WriteString (Texts_Writer *W, ADDRESS *W__typ, CHAR *s, ADDRESS s__len); import void *Texts__init(void); diff --git a/bootstrap/unix-44/VT100.c b/bootstrap/unix-44/VT100.c index f69fd90e..38c0743f 100644 --- a/bootstrap/unix-44/VT100.c +++ b/bootstrap/unix-44/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -27,23 +27,23 @@ export void VT100_DECTCEMl (void); export void VT100_DSR (INT16 n); export void VT100_ED (INT16 n); export void VT100_EL (INT16 n); -static void VT100_EscSeq (INT16 n, CHAR *letter, LONGINT letter__len); -static void VT100_EscSeq0 (CHAR *letter, LONGINT letter__len); -static void VT100_EscSeq2 (INT16 n, INT16 m, CHAR *letter, LONGINT letter__len); -static void VT100_EscSeqSwapped (INT16 n, CHAR *letter, LONGINT letter__len); +static void VT100_EscSeq (INT16 n, CHAR *letter, ADDRESS letter__len); +static void VT100_EscSeq0 (CHAR *letter, ADDRESS letter__len); +static void VT100_EscSeq2 (INT16 n, INT16 m, CHAR *letter, ADDRESS letter__len); +static void VT100_EscSeqSwapped (INT16 n, CHAR *letter, ADDRESS letter__len); export void VT100_HVP (INT16 n, INT16 m); -export void VT100_IntToStr (INT32 int_, CHAR *str, LONGINT str__len); +export void VT100_IntToStr (INT32 int_, CHAR *str, ADDRESS str__len); export void VT100_RCP (void); -static void VT100_Reverse0 (CHAR *str, LONGINT str__len, INT16 start, INT16 end); +static void VT100_Reverse0 (CHAR *str, ADDRESS str__len, INT16 start, INT16 end); export void VT100_SCP (void); export void VT100_SD (INT16 n); export void VT100_SGR (INT16 n); export void VT100_SGR2 (INT16 n, INT16 m); export void VT100_SU (INT16 n); -export void VT100_SetAttr (CHAR *attr, LONGINT attr__len); +export void VT100_SetAttr (CHAR *attr, ADDRESS attr__len); -static void VT100_Reverse0 (CHAR *str, LONGINT str__len, INT16 start, INT16 end) +static void VT100_Reverse0 (CHAR *str, ADDRESS str__len, INT16 start, INT16 end) { CHAR h; while (start < end) { @@ -55,7 +55,7 @@ static void VT100_Reverse0 (CHAR *str, LONGINT str__len, INT16 start, INT16 end) } } -void VT100_IntToStr (INT32 int_, CHAR *str, LONGINT str__len) +void VT100_IntToStr (INT32 int_, CHAR *str, ADDRESS str__len) { CHAR b[21]; INT16 s, e; @@ -84,7 +84,7 @@ void VT100_IntToStr (INT32 int_, CHAR *str, LONGINT str__len) __COPY(b, str, str__len); } -static void VT100_EscSeq0 (CHAR *letter, LONGINT letter__len) +static void VT100_EscSeq0 (CHAR *letter, ADDRESS letter__len) { CHAR cmd[9]; __DUP(letter, letter__len, CHAR); @@ -94,7 +94,7 @@ static void VT100_EscSeq0 (CHAR *letter, LONGINT letter__len) __DEL(letter); } -static void VT100_EscSeq (INT16 n, CHAR *letter, LONGINT letter__len) +static void VT100_EscSeq (INT16 n, CHAR *letter, ADDRESS letter__len) { CHAR nstr[2]; CHAR cmd[7]; @@ -107,7 +107,7 @@ static void VT100_EscSeq (INT16 n, CHAR *letter, LONGINT letter__len) __DEL(letter); } -static void VT100_EscSeqSwapped (INT16 n, CHAR *letter, LONGINT letter__len) +static void VT100_EscSeqSwapped (INT16 n, CHAR *letter, ADDRESS letter__len) { CHAR nstr[2]; CHAR cmd[7]; @@ -120,7 +120,7 @@ static void VT100_EscSeqSwapped (INT16 n, CHAR *letter, LONGINT letter__len) __DEL(letter); } -static void VT100_EscSeq2 (INT16 n, INT16 m, CHAR *letter, LONGINT letter__len) +static void VT100_EscSeq2 (INT16 n, INT16 m, CHAR *letter, ADDRESS letter__len) { CHAR nstr[5], mstr[5]; CHAR cmd[12]; @@ -236,7 +236,7 @@ void VT100_DECTCEMh (void) VT100_EscSeq0((CHAR*)"\?25h", 5); } -void VT100_SetAttr (CHAR *attr, LONGINT attr__len) +void VT100_SetAttr (CHAR *attr, ADDRESS attr__len) { CHAR tmpstr[16]; __DUP(attr, attr__len, CHAR); diff --git a/bootstrap/unix-44/VT100.h b/bootstrap/unix-44/VT100.h index d99406ec..4bbb3110 100644 --- a/bootstrap/unix-44/VT100.h +++ b/bootstrap/unix-44/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h @@ -23,14 +23,14 @@ import void VT100_DSR (INT16 n); import void VT100_ED (INT16 n); import void VT100_EL (INT16 n); import void VT100_HVP (INT16 n, INT16 m); -import void VT100_IntToStr (INT32 int_, CHAR *str, LONGINT str__len); +import void VT100_IntToStr (INT32 int_, CHAR *str, ADDRESS str__len); import void VT100_RCP (void); import void VT100_SCP (void); import void VT100_SD (INT16 n); import void VT100_SGR (INT16 n); import void VT100_SGR2 (INT16 n, INT16 m); import void VT100_SU (INT16 n); -import void VT100_SetAttr (CHAR *attr, LONGINT attr__len); +import void VT100_SetAttr (CHAR *attr, ADDRESS attr__len); import void *VT100__init(void); diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index 37630d23..66f80319 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -17,13 +17,13 @@ static CHAR extTools_CFLAGS[1023]; -export void extTools_Assemble (CHAR *moduleName, LONGINT moduleName__len); -static void extTools_InitialiseCompilerCommand (CHAR *s, LONGINT s__len); -export void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN statically, CHAR *additionalopts, LONGINT additionalopts__len); -static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGINT cmd__len); +export void extTools_Assemble (CHAR *moduleName, ADDRESS moduleName__len); +static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len); +export void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN statically, CHAR *additionalopts, ADDRESS additionalopts__len); +static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRESS cmd__len); -static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGINT cmd__len) +static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRESS cmd__len) { INT16 r, status, exitcode; __DUP(title, title__len, CHAR); @@ -63,7 +63,7 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN __DEL(cmd); } -static void extTools_InitialiseCompilerCommand (CHAR *s, LONGINT s__len) +static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) { __COPY("gcc -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); @@ -74,7 +74,7 @@ static void extTools_InitialiseCompilerCommand (CHAR *s, LONGINT s__len) Strings_Append((CHAR*)" ", 2, (void*)s, s__len); } -void extTools_Assemble (CHAR *moduleName, LONGINT moduleName__len) +void extTools_Assemble (CHAR *moduleName, ADDRESS moduleName__len) { CHAR cmd[1023]; __DUP(moduleName, moduleName__len, CHAR); @@ -86,7 +86,7 @@ void extTools_Assemble (CHAR *moduleName, LONGINT moduleName__len) __DEL(moduleName); } -void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN statically, CHAR *additionalopts, LONGINT additionalopts__len) +void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN statically, CHAR *additionalopts, ADDRESS additionalopts__len) { CHAR cmd[1023]; __DUP(additionalopts, additionalopts__len, CHAR); diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index 63e5df15..472c60f3 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h @@ -8,8 +8,8 @@ -import void extTools_Assemble (CHAR *moduleName, LONGINT moduleName__len); -import void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN statically, CHAR *additionalopts, LONGINT additionalopts__len); +import void extTools_Assemble (CHAR *moduleName, ADDRESS moduleName__len); +import void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN statically, CHAR *additionalopts, ADDRESS additionalopts__len); import void *extTools__init(void); diff --git a/bootstrap/unix-48/Compiler.c b/bootstrap/unix-48/Compiler.c index dc4bb660..e900905f 100644 --- a/bootstrap/unix-48/Compiler.c +++ b/bootstrap/unix-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index 2d0061df..071d7b8e 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index b28e0caa..b1942442 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 548774b0..0a3293ab 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -52,7 +52,7 @@ static Files_File Files_files; static INT16 Files_tempno; static CHAR Files_HOME[1024]; static struct { - LONGINT len[1]; + ADDRESS len[1]; CHAR data[1]; } *Files_SearchPath; @@ -62,56 +62,56 @@ export ADDRESS *Files_Rider__typ; export Files_File Files_Base (Files_Rider *r, ADDRESS *r__typ); static Files_File Files_CacheEntry (Platform_FileIdentity identity); -export void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INT16 *res); +export void Files_ChangeDirectory (CHAR *path, ADDRESS path__len, INT16 *res); export void Files_Close (Files_File f); static void Files_CloseOSFile (Files_File f); static void Files_Create (Files_File f); -export void Files_Delete (CHAR *name, LONGINT name__len, INT16 *res); -static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INT16 errcode); +export void Files_Delete (CHAR *name, ADDRESS name__len, INT16 *res); +static void Files_Err (CHAR *s, ADDRESS s__len, Files_File f, INT16 errcode); static void Files_Finalize (SYSTEM_PTR o); -static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *dest, LONGINT dest__len); +static void Files_FlipBytes (SYSTEM_BYTE *src, ADDRESS src__len, SYSTEM_BYTE *dest, ADDRESS dest__len); static void Files_Flush (Files_Buffer buf); export void Files_GetDate (Files_File f, INT32 *t, INT32 *d); -export void Files_GetName (Files_File f, CHAR *name, LONGINT name__len); -static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *name, LONGINT name__len); -static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len); +export void Files_GetName (Files_File f, CHAR *name, ADDRESS name__len); +static void Files_GetTempName (CHAR *finalName, ADDRESS finalName__len, CHAR *name, ADDRESS name__len); +static BOOLEAN Files_HasDir (CHAR *name, ADDRESS name__len); export INT32 Files_Length (Files_File f); -static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT name__len, CHAR *dest, LONGINT dest__len); -export Files_File Files_New (CHAR *name, LONGINT name__len); -export Files_File Files_Old (CHAR *name, LONGINT name__len); +static void Files_MakeFileName (CHAR *dir, ADDRESS dir__len, CHAR *name, ADDRESS name__len, CHAR *dest, ADDRESS dest__len); +export Files_File Files_New (CHAR *name, ADDRESS name__len); +export Files_File Files_Old (CHAR *name, ADDRESS name__len); export INT32 Files_Pos (Files_Rider *r, ADDRESS *r__typ); export void Files_Purge (Files_File f); export void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x); export void Files_ReadBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN *x); -export void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n); +export void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS x__len, INT32 n); export void Files_ReadInt (Files_Rider *R, ADDRESS *R__typ, INT16 *x); export void Files_ReadLInt (Files_Rider *R, ADDRESS *R__typ, INT32 *x); export void Files_ReadLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL *x); -export void Files_ReadLine (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); -export void Files_ReadNum (Files_Rider *R, ADDRESS *R__typ, SYSTEM_BYTE *x, LONGINT x__len); +export void Files_ReadLine (Files_Rider *R, ADDRESS *R__typ, CHAR *x, ADDRESS x__len); +export void Files_ReadNum (Files_Rider *R, ADDRESS *R__typ, SYSTEM_BYTE *x, ADDRESS x__len); export void Files_ReadReal (Files_Rider *R, ADDRESS *R__typ, REAL *x); export void Files_ReadSet (Files_Rider *R, ADDRESS *R__typ, UINT32 *x); -export void Files_ReadString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); +export void Files_ReadString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, ADDRESS x__len); export void Files_Register (Files_File f); -export void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT16 *res); -static void Files_ScanPath (INT16 *pos, CHAR *dir, LONGINT dir__len); +export void Files_Rename (CHAR *old, ADDRESS old__len, CHAR *new, ADDRESS new__len, INT16 *res); +static void Files_ScanPath (INT16 *pos, CHAR *dir, ADDRESS dir__len); export void Files_Set (Files_Rider *r, ADDRESS *r__typ, Files_File f, INT32 pos); -export void Files_SetSearchPath (CHAR *path, LONGINT path__len); +export void Files_SetSearchPath (CHAR *path, ADDRESS path__len); export void Files_Write (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE x); export void Files_WriteBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN x); -export void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n); +export void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS x__len, INT32 n); export void Files_WriteInt (Files_Rider *R, ADDRESS *R__typ, INT16 x); export void Files_WriteLInt (Files_Rider *R, ADDRESS *R__typ, INT32 x); export void Files_WriteLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL x); export void Files_WriteNum (Files_Rider *R, ADDRESS *R__typ, INT64 x); export void Files_WriteReal (Files_Rider *R, ADDRESS *R__typ, REAL x); export void Files_WriteSet (Files_Rider *R, ADDRESS *R__typ, UINT32 x); -export void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); +export void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, ADDRESS x__len); #define Files_IdxTrap() __HALT(-1) #define Files_ToAdr(x) (ADDRESS)x -static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INT16 errcode) +static void Files_Err (CHAR *s, ADDRESS s__len, Files_File f, INT16 errcode) { __DUP(s, s__len, CHAR); Out_Ln(); @@ -138,7 +138,7 @@ static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INT16 errcode) __DEL(s); } -static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT name__len, CHAR *dest, LONGINT dest__len) +static void Files_MakeFileName (CHAR *dir, ADDRESS dir__len, CHAR *name, ADDRESS name__len, CHAR *dest, ADDRESS dest__len) { INT16 i, j; __DUP(dir, dir__len, CHAR); @@ -163,7 +163,7 @@ static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT __DEL(name); } -static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *name, LONGINT name__len) +static void Files_GetTempName (CHAR *finalName, ADDRESS finalName__len, CHAR *name, ADDRESS name__len) { INT32 n, i, j; __DUP(finalName, finalName__len, CHAR); @@ -316,7 +316,7 @@ INT32 Files_Length (Files_File f) return f->len; } -Files_File Files_New (CHAR *name, LONGINT name__len) +Files_File Files_New (CHAR *name, ADDRESS name__len) { Files_File f = NIL; __DUP(name, name__len, CHAR); @@ -332,7 +332,7 @@ Files_File Files_New (CHAR *name, LONGINT name__len) return f; } -static void Files_ScanPath (INT16 *pos, CHAR *dir, LONGINT dir__len) +static void Files_ScanPath (INT16 *pos, CHAR *dir, ADDRESS dir__len) { INT16 i; CHAR ch; @@ -375,7 +375,7 @@ static void Files_ScanPath (INT16 *pos, CHAR *dir, LONGINT dir__len) dir[i] = 0x00; } -static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len) +static BOOLEAN Files_HasDir (CHAR *name, ADDRESS name__len) { INT16 i; CHAR ch; @@ -415,7 +415,7 @@ static Files_File Files_CacheEntry (Platform_FileIdentity identity) return NIL; } -Files_File Files_Old (CHAR *name, LONGINT name__len) +Files_File Files_Old (CHAR *name, ADDRESS name__len) { Files_File f = NIL; INT32 fd; @@ -618,7 +618,7 @@ void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x) } } -void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n) +void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS x__len, INT32 n) { INT32 xpos, min, restInBuf, offset; Files_Buffer buf = NIL; @@ -683,7 +683,7 @@ void Files_Write (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE x) (*r).res = 0; } -void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n) +void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS x__len, INT32 n) { INT32 xpos, min, restInBuf, offset; Files_Buffer buf = NIL; @@ -722,14 +722,14 @@ void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT (*r).res = 0; } -void Files_Delete (CHAR *name, LONGINT name__len, INT16 *res) +void Files_Delete (CHAR *name, ADDRESS name__len, INT16 *res) { __DUP(name, name__len, CHAR); *res = Platform_Unlink((void*)name, name__len); __DEL(name); } -void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT16 *res) +void Files_Rename (CHAR *old, ADDRESS old__len, CHAR *new, ADDRESS new__len, INT16 *res) { INT32 fdold, fdnew, n; INT16 error, ignore; @@ -812,14 +812,14 @@ void Files_Register (Files_File f) } } -void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INT16 *res) +void Files_ChangeDirectory (CHAR *path, ADDRESS path__len, INT16 *res) { __DUP(path, path__len, CHAR); *res = Platform_Chdir((void*)path, path__len); __DEL(path); } -static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *dest, LONGINT dest__len) +static void Files_FlipBytes (SYSTEM_BYTE *src, ADDRESS src__len, SYSTEM_BYTE *dest, ADDRESS dest__len) { INT32 i, j; if (!Platform_LittleEndian) { @@ -877,7 +877,7 @@ void Files_ReadLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL *x) Files_FlipBytes((void*)b, 8, (void*)&*x, 8); } -void Files_ReadString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len) +void Files_ReadString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, ADDRESS x__len) { INT16 i; CHAR ch; @@ -889,7 +889,7 @@ void Files_ReadString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len) } while (!(ch == 0x00)); } -void Files_ReadLine (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len) +void Files_ReadLine (Files_Rider *R, ADDRESS *R__typ, CHAR *x, ADDRESS x__len) { INT16 i; i = 0; @@ -906,7 +906,7 @@ void Files_ReadLine (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len) x[i] = 0x00; } -void Files_ReadNum (Files_Rider *R, ADDRESS *R__typ, SYSTEM_BYTE *x, LONGINT x__len) +void Files_ReadNum (Files_Rider *R, ADDRESS *R__typ, SYSTEM_BYTE *x, ADDRESS x__len) { INT8 s, b; INT64 q; @@ -972,7 +972,7 @@ void Files_WriteLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL x) Files_WriteBytes(&*R, R__typ, (void*)b, 8, 8); } -void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len) +void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, ADDRESS x__len) { INT16 i; i = 0; @@ -991,7 +991,7 @@ void Files_WriteNum (Files_Rider *R, ADDRESS *R__typ, INT64 x) Files_Write(&*R, R__typ, (CHAR)__MASK(x, -128)); } -void Files_GetName (Files_File f, CHAR *name, LONGINT name__len) +void Files_GetName (Files_File f, CHAR *name, ADDRESS name__len) { __COPY(f->workName, name, name__len); } @@ -1009,7 +1009,7 @@ static void Files_Finalize (SYSTEM_PTR o) } } -void Files_SetSearchPath (CHAR *path, LONGINT path__len) +void Files_SetSearchPath (CHAR *path, ADDRESS path__len) { __DUP(path, path__len, CHAR); if (Strings_Length(path, path__len) != 0) { diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index 79164af5..1012ec46 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h @@ -28,41 +28,41 @@ import ADDRESS *Files_FileDesc__typ; import ADDRESS *Files_Rider__typ; import Files_File Files_Base (Files_Rider *r, ADDRESS *r__typ); -import void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INT16 *res); +import void Files_ChangeDirectory (CHAR *path, ADDRESS path__len, INT16 *res); import void Files_Close (Files_File f); -import void Files_Delete (CHAR *name, LONGINT name__len, INT16 *res); +import void Files_Delete (CHAR *name, ADDRESS name__len, INT16 *res); import void Files_GetDate (Files_File f, INT32 *t, INT32 *d); -import void Files_GetName (Files_File f, CHAR *name, LONGINT name__len); +import void Files_GetName (Files_File f, CHAR *name, ADDRESS name__len); import INT32 Files_Length (Files_File f); -import Files_File Files_New (CHAR *name, LONGINT name__len); -import Files_File Files_Old (CHAR *name, LONGINT name__len); +import Files_File Files_New (CHAR *name, ADDRESS name__len); +import Files_File Files_Old (CHAR *name, ADDRESS name__len); import INT32 Files_Pos (Files_Rider *r, ADDRESS *r__typ); import void Files_Purge (Files_File f); import void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x); import void Files_ReadBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN *x); -import void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n); +import void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS x__len, INT32 n); import void Files_ReadInt (Files_Rider *R, ADDRESS *R__typ, INT16 *x); import void Files_ReadLInt (Files_Rider *R, ADDRESS *R__typ, INT32 *x); import void Files_ReadLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL *x); -import void Files_ReadLine (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); -import void Files_ReadNum (Files_Rider *R, ADDRESS *R__typ, SYSTEM_BYTE *x, LONGINT x__len); +import void Files_ReadLine (Files_Rider *R, ADDRESS *R__typ, CHAR *x, ADDRESS x__len); +import void Files_ReadNum (Files_Rider *R, ADDRESS *R__typ, SYSTEM_BYTE *x, ADDRESS x__len); import void Files_ReadReal (Files_Rider *R, ADDRESS *R__typ, REAL *x); import void Files_ReadSet (Files_Rider *R, ADDRESS *R__typ, UINT32 *x); -import void Files_ReadString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); +import void Files_ReadString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, ADDRESS x__len); import void Files_Register (Files_File f); -import void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT16 *res); +import void Files_Rename (CHAR *old, ADDRESS old__len, CHAR *new, ADDRESS new__len, INT16 *res); import void Files_Set (Files_Rider *r, ADDRESS *r__typ, Files_File f, INT32 pos); -import void Files_SetSearchPath (CHAR *path, LONGINT path__len); +import void Files_SetSearchPath (CHAR *path, ADDRESS path__len); import void Files_Write (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE x); import void Files_WriteBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN x); -import void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n); +import void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS x__len, INT32 n); import void Files_WriteInt (Files_Rider *R, ADDRESS *R__typ, INT16 x); import void Files_WriteLInt (Files_Rider *R, ADDRESS *R__typ, INT32 x); import void Files_WriteLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL x); import void Files_WriteNum (Files_Rider *R, ADDRESS *R__typ, INT64 x); import void Files_WriteReal (Files_Rider *R, ADDRESS *R__typ, REAL x); import void Files_WriteSet (Files_Rider *R, ADDRESS *R__typ, UINT32 x); -import void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); +import void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, ADDRESS x__len); import void *Files__init(void); diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index 72677604..ba769b74 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -85,14 +85,14 @@ static void Heap_ExtendHeap (INT32 blksz); export void Heap_FINALL (void); static void Heap_Finalize (void); export void Heap_GC (BOOLEAN markStack); -static void Heap_HeapSort (INT32 n, INT32 *a, LONGINT a__len); +static void Heap_HeapSort (INT32 n, INT32 *a, ADDRESS a__len); export void Heap_INCREF (Heap_Module m); export void Heap_InitHeap (void); export void Heap_Lock (void); static void Heap_Mark (INT32 q); -static void Heap_MarkCandidates (INT32 n, INT32 *cand, LONGINT cand__len); +static void Heap_MarkCandidates (INT32 n, INT32 *cand, ADDRESS cand__len); static void Heap_MarkP (SYSTEM_PTR p); -static void Heap_MarkStack (INT32 n, INT32 *cand, LONGINT cand__len); +static void Heap_MarkStack (INT32 n, INT32 *cand, ADDRESS cand__len); export SYSTEM_PTR Heap_NEWBLK (INT32 size); export SYSTEM_PTR Heap_NEWREC (INT32 tag); static INT32 Heap_NewChunk (INT32 blksz); @@ -101,7 +101,7 @@ export SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); export void Heap_REGTYP (Heap_Module m, INT32 typ); export void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); static void Heap_Scan (void); -static void Heap_Sift (INT32 l, INT32 r, INT32 *a, LONGINT a__len); +static void Heap_Sift (INT32 l, INT32 r, INT32 *a, ADDRESS a__len); export void Heap_Unlock (void); extern void *Heap__init(); @@ -445,7 +445,7 @@ static void Heap_Scan (void) } } -static void Heap_Sift (INT32 l, INT32 r, INT32 *a, LONGINT a__len) +static void Heap_Sift (INT32 l, INT32 r, INT32 *a, ADDRESS a__len) { INT32 i, j, x; j = l; @@ -464,7 +464,7 @@ static void Heap_Sift (INT32 l, INT32 r, INT32 *a, LONGINT a__len) a[i] = x; } -static void Heap_HeapSort (INT32 n, INT32 *a, LONGINT a__len) +static void Heap_HeapSort (INT32 n, INT32 *a, ADDRESS a__len) { INT32 l, r, x; l = __ASHR(n, 1); @@ -482,7 +482,7 @@ static void Heap_HeapSort (INT32 n, INT32 *a, LONGINT a__len) } } -static void Heap_MarkCandidates (INT32 n, INT32 *cand, LONGINT cand__len) +static void Heap_MarkCandidates (INT32 n, INT32 *cand, ADDRESS cand__len) { INT32 chnk, adr, tag, next, lim, lim1, i, ptr, size; chnk = Heap_heap; @@ -571,7 +571,7 @@ void Heap_FINALL (void) } } -static void Heap_MarkStack (INT32 n, INT32 *cand, LONGINT cand__len) +static void Heap_MarkStack (INT32 n, INT32 *cand, ADDRESS cand__len) { SYSTEM_PTR frame; INT32 inc, nofcand, sp, p, stack0; diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index 0aa0a18b..d200254d 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index a5e72ba3..27e4473c 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -47,21 +47,21 @@ export Modules_ModuleName Modules_imported, Modules_importing; export ADDRESS *Modules_ModuleDesc__typ; export ADDRESS *Modules_CmdDesc__typ; -static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len); +static void Modules_Append (CHAR *a, ADDRESS a__len, CHAR *b, ADDRESS b__len); export void Modules_AssertFail (INT32 code); static void Modules_DisplayHaltCode (INT32 code); -export void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all); +export void Modules_Free (CHAR *name, ADDRESS name__len, BOOLEAN all); export void Modules_Halt (INT32 code); -export Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len); -export Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len); +export Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, ADDRESS name__len); +export Modules_Module Modules_ThisMod (CHAR *name, ADDRESS name__len); static void Modules_errch (CHAR c); static void Modules_errint (INT32 l); -static void Modules_errstring (CHAR *s, LONGINT s__len); +static void Modules_errstring (CHAR *s, ADDRESS s__len); #define Modules_modules() (Modules_Module)Heap_modules #define Modules_setmodules(m) Heap_modules = m -static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len) +static void Modules_Append (CHAR *a, ADDRESS a__len, CHAR *b, ADDRESS b__len) { INT16 i, j; __DUP(b, b__len, CHAR); @@ -79,7 +79,7 @@ static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len) __DEL(b); } -Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len) +Modules_Module Modules_ThisMod (CHAR *name, ADDRESS name__len) { Modules_Module m = NIL; CHAR bodyname[64]; @@ -103,7 +103,7 @@ Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len) return m; } -Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len) +Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, ADDRESS name__len) { Modules_Cmd c = NIL; __DUP(name, name__len, CHAR); @@ -130,7 +130,7 @@ Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT nam __RETCHK; } -void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all) +void Modules_Free (CHAR *name, ADDRESS name__len, BOOLEAN all) { Modules_Module m = NIL, p = NIL; __DUP(name, name__len, CHAR); @@ -168,7 +168,7 @@ static void Modules_errch (CHAR c) e = Platform_Write(1, (ADDRESS)&c, 1); } -static void Modules_errstring (CHAR *s, LONGINT s__len) +static void Modules_errstring (CHAR *s, ADDRESS s__len) { INT32 i; __DUP(s, s__len, CHAR); diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index 8bb89fe5..b1f2385e 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h @@ -44,10 +44,10 @@ import ADDRESS *Modules_ModuleDesc__typ; import ADDRESS *Modules_CmdDesc__typ; import void Modules_AssertFail (INT32 code); -import void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all); +import void Modules_Free (CHAR *name, ADDRESS name__len, BOOLEAN all); import void Modules_Halt (INT32 code); -import Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len); -import Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len); +import Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, ADDRESS name__len); +import Modules_Module Modules_ThisMod (CHAR *name, ADDRESS name__len); import void *Modules__init(void); diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index 3ef8e2f9..bc44b83a 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index 0be714e8..eb93787e 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index ef4b429f..72e0feef 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -56,7 +56,7 @@ static void OPC_GenHeaderMsg (void); export void OPC_Halt (INT32 n); export void OPC_Ident (OPT_Object obj); static void OPC_IdentList (OPT_Object obj, INT16 vis); -static void OPC_Include (CHAR *name, LONGINT name__len); +static void OPC_Include (CHAR *name, ADDRESS name__len); static void OPC_IncludeImports (OPT_Object obj, INT16 vis); export void OPC_Increment (BOOLEAN decrement); export void OPC_Indent (INT16 count); @@ -68,11 +68,11 @@ static void OPC_InitTProcs (OPT_Object typ, OPT_Object obj); export void OPC_IntLiteral (INT64 n, INT32 size); export void OPC_Len (OPT_Object obj, OPT_Struct array, INT64 dim); static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName); -static INT16 OPC_Length (CHAR *s, LONGINT s__len); +static INT16 OPC_Length (CHAR *s, ADDRESS s__len); export BOOLEAN OPC_NeedsRetval (OPT_Object proc); export INT32 OPC_NofPtrs (OPT_Struct typ); -static INT16 OPC_PerfectHash (CHAR *s, LONGINT s__len); -static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len); +static INT16 OPC_PerfectHash (CHAR *s, ADDRESS s__len); +static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, ADDRESS y__len); static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define); static void OPC_ProcPredefs (OPT_Object obj, INT8 vis); static void OPC_PutBase (OPT_Struct typ); @@ -80,8 +80,8 @@ static void OPC_PutPtrOffsets (OPT_Struct typ, INT32 adr, INT32 *cnt); static void OPC_RegCmds (OPT_Object obj); export void OPC_SetInclude (BOOLEAN exclude); static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause); -static void OPC_Str1 (CHAR *s, LONGINT s__len, INT32 x); -static void OPC_StringLiteral (CHAR *s, LONGINT s__len, INT32 l); +static void OPC_Str1 (CHAR *s, ADDRESS s__len, INT32 x); +static void OPC_StringLiteral (CHAR *s, ADDRESS s__len, INT32 l); export void OPC_TDescDecl (OPT_Struct typ); export void OPC_TypeDefs (OPT_Object obj, INT16 vis); export void OPC_TypeOf (OPT_Object ap); @@ -137,7 +137,7 @@ void OPC_EndBlk0 (void) OPM_Write('}'); } -static void OPC_Str1 (CHAR *s, LONGINT s__len, INT32 x) +static void OPC_Str1 (CHAR *s, ADDRESS s__len, INT32 x) { CHAR ch; INT16 i; @@ -156,7 +156,7 @@ static void OPC_Str1 (CHAR *s, LONGINT s__len, INT32 x) __DEL(s); } -static INT16 OPC_Length (CHAR *s, LONGINT s__len) +static INT16 OPC_Length (CHAR *s, ADDRESS s__len) { INT16 i; i = 0; @@ -166,7 +166,7 @@ static INT16 OPC_Length (CHAR *s, LONGINT s__len) return i; } -static INT16 OPC_PerfectHash (CHAR *s, LONGINT s__len) +static INT16 OPC_PerfectHash (CHAR *s, ADDRESS s__len) { INT16 i, h; i = 0; @@ -364,7 +364,7 @@ static void OPC_DeclareBase (OPT_Object dcl) OPM_WriteString((CHAR*)"struct ", 8); OPC_BegBlk(); OPC_BegStat(); - OPC_Str1((CHAR*)"LONGINT len[#]", 15, nofdims); + OPC_Str1((CHAR*)"ADDRESS len[#]", 15, nofdims); OPC_EndStat(); OPC_BegStat(); __NEW(obj, OPT_ObjDesc); @@ -511,7 +511,7 @@ static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamNa typ = par->typ->BaseTyp; while (typ->comp == 3) { if (ansiDefine) { - OPM_WriteString((CHAR*)", LONGINT ", 11); + OPM_WriteString((CHAR*)", ADDRESS ", 11); } else { OPM_WriteString((CHAR*)", ", 3); } @@ -720,7 +720,7 @@ static void OPC_DefineType (OPT_Struct str) } } -static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len) +static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, ADDRESS y__len) { INT16 i; __DUP(y, y__len, CHAR); @@ -969,7 +969,7 @@ static void OPC_IdentList (OPT_Object obj, INT16 vis) OPC_EndStat(); OPC_BegStat(); base = OPT_linttyp; - OPM_WriteString((CHAR*)"LONGINT ", 9); + OPM_WriteString((CHAR*)"ADDRESS ", 9); OPC_LenList(obj, 0, 1); } else if ((obj->mode == 2 && obj->typ->comp == 4)) { OPC_EndStat(); @@ -1008,7 +1008,7 @@ static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames) __COPY(name, obj->name, 256); } if (obj->typ->comp == 3) { - OPM_WriteString((CHAR*)", LONGINT ", 11); + OPM_WriteString((CHAR*)", ADDRESS ", 11); OPC_LenList(obj, 1, showParamNames); } else if ((obj->mode == 2 && obj->typ->comp == 4)) { OPM_WriteString((CHAR*)", ADDRESS *", 12); @@ -1062,7 +1062,7 @@ static void OPC_ProcPredefs (OPT_Object obj, INT8 vis) } } -static void OPC_Include (CHAR *name, LONGINT name__len) +static void OPC_Include (CHAR *name, ADDRESS name__len) { __DUP(name, name__len, CHAR); OPM_WriteString((CHAR*)"#include ", 10); @@ -1744,7 +1744,7 @@ static void OPC_CharacterLiteral (INT64 c) } } -static void OPC_StringLiteral (CHAR *s, LONGINT s__len, INT32 l) +static void OPC_StringLiteral (CHAR *s, ADDRESS s__len, INT32 l) { INT32 i; INT16 c; @@ -1912,9 +1912,9 @@ static struct InitKeywords__46 { struct InitKeywords__46 *lnk; } *InitKeywords__46_s; -static void Enter__47 (CHAR *s, LONGINT s__len); +static void Enter__47 (CHAR *s, ADDRESS s__len); -static void Enter__47 (CHAR *s, LONGINT s__len) +static void Enter__47 (CHAR *s, ADDRESS s__len) { INT16 h; __DUP(s, s__len, CHAR); diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index 842e7dec..5624314d 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index e76d763e..632b78e5 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -53,26 +53,26 @@ export void OPM_FPrintLReal (INT32 *fp, LONGREAL val); export void OPM_FPrintReal (INT32 *fp, REAL val); export void OPM_FPrintSet (INT32 *fp, UINT64 val); static void OPM_FindLine (Files_File f, Files_Rider *r, ADDRESS *r__typ, INT64 pos); -static void OPM_FingerprintBytes (INT32 *fp, SYSTEM_BYTE *bytes, LONGINT bytes__len); +static void OPM_FingerprintBytes (INT32 *fp, SYSTEM_BYTE *bytes, ADDRESS bytes__len); export void OPM_Get (CHAR *ch); -export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); +export void OPM_Init (BOOLEAN *done, CHAR *mname, ADDRESS mname__len); export void OPM_InitOptions (void); export INT16 OPM_Integer (INT64 n); static void OPM_LogErrMsg (INT16 n); -export void OPM_LogVT100 (CHAR *vt100code, LONGINT vt100code__len); +export void OPM_LogVT100 (CHAR *vt100code, ADDRESS vt100code__len); export void OPM_LogW (CHAR ch); export void OPM_LogWLn (void); export void OPM_LogWNum (INT64 i, INT64 len); -export void OPM_LogWStr (CHAR *s, LONGINT s__len); +export void OPM_LogWStr (CHAR *s, ADDRESS s__len); export INT32 OPM_Longint (INT64 n); -static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len); +static void OPM_MakeFileName (CHAR *name, ADDRESS name__len, CHAR *FName, ADDRESS FName__len, CHAR *ext, ADDRESS ext__len); export void OPM_Mark (INT16 n, INT32 pos); -export void OPM_NewSym (CHAR *modName, LONGINT modName__len); -export void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); -export void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); +export void OPM_NewSym (CHAR *modName, ADDRESS modName__len); +export void OPM_OldSym (CHAR *modName, ADDRESS modName__len, BOOLEAN *done); +export void OPM_OpenFiles (CHAR *moduleName, ADDRESS moduleName__len); export BOOLEAN OPM_OpenPar (void); export void OPM_RegisterNewSym (void); -static void OPM_ScanOptions (CHAR *s, LONGINT s__len); +static void OPM_ScanOptions (CHAR *s, ADDRESS s__len); static void OPM_ShowLine (INT64 pos); export INT64 OPM_SignedMaximum (INT32 bytecount); export INT64 OPM_SignedMinimum (INT32 bytecount); @@ -93,8 +93,8 @@ export void OPM_WriteHex (INT64 i); export void OPM_WriteInt (INT64 i); export void OPM_WriteLn (void); export void OPM_WriteReal (LONGREAL r, CHAR suffx); -export void OPM_WriteString (CHAR *s, LONGINT s__len); -export void OPM_WriteStringVar (CHAR *s, LONGINT s__len); +export void OPM_WriteString (CHAR *s, ADDRESS s__len); +export void OPM_WriteStringVar (CHAR *s, ADDRESS s__len); export BOOLEAN OPM_eofSF (void); export void OPM_err (INT16 n); @@ -105,7 +105,7 @@ void OPM_LogW (CHAR ch) Out_Char(ch); } -void OPM_LogWStr (CHAR *s, LONGINT s__len) +void OPM_LogWStr (CHAR *s, ADDRESS s__len) { __DUP(s, s__len, CHAR); Out_String(s, s__len); @@ -122,7 +122,7 @@ void OPM_LogWLn (void) Out_Ln(); } -void OPM_LogVT100 (CHAR *vt100code, LONGINT vt100code__len) +void OPM_LogVT100 (CHAR *vt100code, ADDRESS vt100code__len) { __DUP(vt100code, vt100code__len, CHAR); if ((Out_IsConsole && !__IN(16, OPM_Options, 32))) { @@ -154,7 +154,7 @@ INT16 OPM_Integer (INT64 n) return __VAL(INT16, n); } -static void OPM_ScanOptions (CHAR *s, LONGINT s__len) +static void OPM_ScanOptions (CHAR *s, ADDRESS s__len) { INT16 i; __DUP(s, s__len, CHAR); @@ -465,7 +465,7 @@ void OPM_InitOptions (void) Files_SetSearchPath(searchpath, 1024); } -void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len) +void OPM_Init (BOOLEAN *done, CHAR *mname, ADDRESS mname__len) { Texts_Text T = NIL; INT32 beg, end, time; @@ -514,7 +514,7 @@ void OPM_Get (CHAR *ch) } } -static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len) +static void OPM_MakeFileName (CHAR *name, ADDRESS name__len, CHAR *FName, ADDRESS FName__len, CHAR *ext, ADDRESS ext__len) { INT16 i, j; CHAR ch; @@ -700,7 +700,7 @@ void OPM_err (INT16 n) OPM_Mark(n, OPM_errpos); } -static void OPM_FingerprintBytes (INT32 *fp, SYSTEM_BYTE *bytes, LONGINT bytes__len) +static void OPM_FingerprintBytes (INT32 *fp, SYSTEM_BYTE *bytes, ADDRESS bytes__len) { INT16 i; INT32 l; @@ -772,7 +772,7 @@ void OPM_CloseOldSym (void) Files_Close(Files_Base(&OPM_oldSF, Files_Rider__typ)); } -void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done) +void OPM_OldSym (CHAR *modName, ADDRESS modName__len, BOOLEAN *done) { CHAR tag, ver; OPM_FileName fileName; @@ -832,7 +832,7 @@ void OPM_DeleteNewSym (void) { } -void OPM_NewSym (CHAR *modName, LONGINT modName__len) +void OPM_NewSym (CHAR *modName, ADDRESS modName__len) { OPM_FileName fileName; OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, 32, (CHAR*)".sym", 5); @@ -851,7 +851,7 @@ void OPM_Write (CHAR ch) Files_Write(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, ch); } -void OPM_WriteString (CHAR *s, LONGINT s__len) +void OPM_WriteString (CHAR *s, ADDRESS s__len) { INT16 i; i = 0; @@ -861,7 +861,7 @@ void OPM_WriteString (CHAR *s, LONGINT s__len) Files_WriteBytes(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, (void*)s, s__len * 1, i); } -void OPM_WriteStringVar (CHAR *s, LONGINT s__len) +void OPM_WriteStringVar (CHAR *s, ADDRESS s__len) { INT16 i; i = 0; @@ -986,7 +986,7 @@ static void OPM_Append (Files_Rider *R, ADDRESS *R__typ, Files_File F) } } -void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len) +void OPM_OpenFiles (CHAR *moduleName, ADDRESS moduleName__len) { CHAR FName[32]; __COPY(moduleName, OPM_modName, 32); diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index 2d272feb..c310c421 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h @@ -28,19 +28,19 @@ import void OPM_FPrintLReal (INT32 *fp, LONGREAL val); import void OPM_FPrintReal (INT32 *fp, REAL val); import void OPM_FPrintSet (INT32 *fp, UINT64 val); import void OPM_Get (CHAR *ch); -import void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); +import void OPM_Init (BOOLEAN *done, CHAR *mname, ADDRESS mname__len); import void OPM_InitOptions (void); import INT16 OPM_Integer (INT64 n); -import void OPM_LogVT100 (CHAR *vt100code, LONGINT vt100code__len); +import void OPM_LogVT100 (CHAR *vt100code, ADDRESS vt100code__len); import void OPM_LogW (CHAR ch); import void OPM_LogWLn (void); import void OPM_LogWNum (INT64 i, INT64 len); -import void OPM_LogWStr (CHAR *s, LONGINT s__len); +import void OPM_LogWStr (CHAR *s, ADDRESS s__len); import INT32 OPM_Longint (INT64 n); import void OPM_Mark (INT16 n, INT32 pos); -import void OPM_NewSym (CHAR *modName, LONGINT modName__len); -import void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); -import void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); +import void OPM_NewSym (CHAR *modName, ADDRESS modName__len); +import void OPM_OldSym (CHAR *modName, ADDRESS modName__len, BOOLEAN *done); +import void OPM_OpenFiles (CHAR *moduleName, ADDRESS moduleName__len); import BOOLEAN OPM_OpenPar (void); import void OPM_RegisterNewSym (void); import INT64 OPM_SignedMaximum (INT32 bytecount); @@ -61,8 +61,8 @@ import void OPM_WriteHex (INT64 i); import void OPM_WriteInt (INT64 i); import void OPM_WriteLn (void); import void OPM_WriteReal (LONGREAL r, CHAR suffx); -import void OPM_WriteString (CHAR *s, LONGINT s__len); -import void OPM_WriteStringVar (CHAR *s, LONGINT s__len); +import void OPM_WriteString (CHAR *s, ADDRESS s__len); +import void OPM_WriteStringVar (CHAR *s, ADDRESS s__len); import BOOLEAN OPM_eofSF (void); import void OPM_err (INT16 n); import void *OPM__init(void); diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index 3f360d00..02fd6337 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index 5a71eb39..acb2df91 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index 6ee700e5..7aedbbd6 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index 1f7a3e58..e49c222b 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 75820a95..1eb85a06 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -120,7 +120,7 @@ static void OPT_EnterTyp (OPS_Name name, INT8 form, INT16 size, OPT_Struct *res) static void OPT_EnterTypeAlias (OPS_Name name, OPT_Object *res); export void OPT_Export (BOOLEAN *ext, BOOLEAN *new); export void OPT_FPrintErr (OPT_Object obj, INT16 errcode); -static void OPT_FPrintName (INT32 *fp, CHAR *name, LONGINT name__len); +static void OPT_FPrintName (INT32 *fp, CHAR *name, ADDRESS name__len); export void OPT_FPrintObj (OPT_Object obj); static void OPT_FPrintSign (INT32 *fp, OPT_Struct result, OPT_Object par); export void OPT_FPrintStr (OPT_Struct typ); @@ -132,7 +132,7 @@ export void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); static void OPT_InConstant (INT32 f, OPT_Const conval); static OPT_Object OPT_InFld (void); static void OPT_InMod (INT8 *mno); -static void OPT_InName (CHAR *name, LONGINT name__len); +static void OPT_InName (CHAR *name, ADDRESS name__len); static OPT_Object OPT_InObj (INT8 mno); static void OPT_InSign (INT8 mno, OPT_Struct *res, OPT_Object *par); static void OPT_InStruct (OPT_Struct *typ); @@ -155,7 +155,7 @@ static void OPT_OutConstant (OPT_Object obj); static void OPT_OutFlds (OPT_Object fld, INT32 adr, BOOLEAN visible); static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, INT32 adr); static void OPT_OutMod (INT16 mno); -static void OPT_OutName (CHAR *name, LONGINT name__len); +static void OPT_OutName (CHAR *name, ADDRESS name__len); static void OPT_OutObj (OPT_Object obj); static void OPT_OutSign (OPT_Struct result, OPT_Object par); static void OPT_OutStr (OPT_Struct typ); @@ -576,7 +576,7 @@ void OPT_Insert (OPS_Name name, OPT_Object *obj) *obj = ob1; } -static void OPT_FPrintName (INT32 *fp, CHAR *name, LONGINT name__len) +static void OPT_FPrintName (INT32 *fp, CHAR *name, ADDRESS name__len) { INT16 i; CHAR ch; @@ -957,7 +957,7 @@ void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old) } } -static void OPT_InName (CHAR *name, LONGINT name__len) +static void OPT_InName (CHAR *name, ADDRESS name__len) { INT16 i; CHAR ch; @@ -1483,7 +1483,7 @@ void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) } } -static void OPT_OutName (CHAR *name, LONGINT name__len) +static void OPT_OutName (CHAR *name, ADDRESS name__len) { INT16 i; CHAR ch; diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index 90fcacf5..9d34cea9 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index 5c21cb97..f6d42592 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index c4a61586..0f1980ac 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Out.c b/bootstrap/unix-48/Out.c index 39f383cf..82ad945b 100644 --- a/bootstrap/unix-48/Out.c +++ b/bootstrap/unix-48/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -17,16 +17,16 @@ static INT16 Out_in; export void Out_Char (CHAR ch); export void Out_Flush (void); export void Out_Int (INT64 x, INT64 n); -static INT32 Out_Length (CHAR *s, LONGINT s__len); +static INT32 Out_Length (CHAR *s, ADDRESS s__len); export void Out_Ln (void); export void Out_LongReal (LONGREAL x, INT16 n); export void Out_Open (void); export void Out_Real (REAL x, INT16 n); static void Out_RealP (LONGREAL x, INT16 n, BOOLEAN long_); -export void Out_String (CHAR *str, LONGINT str__len); +export void Out_String (CHAR *str, ADDRESS str__len); export LONGREAL Out_Ten (INT16 e); -static void Out_digit (INT64 n, CHAR *s, LONGINT s__len, INT16 *i); -static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, INT16 *i); +static void Out_digit (INT64 n, CHAR *s, ADDRESS s__len, INT16 *i); +static void Out_prepend (CHAR *t, ADDRESS t__len, CHAR *s, ADDRESS s__len, INT16 *i); #define Out_Entier64(x) (INT64)(x) @@ -55,7 +55,7 @@ void Out_Char (CHAR ch) } } -static INT32 Out_Length (CHAR *s, LONGINT s__len) +static INT32 Out_Length (CHAR *s, ADDRESS s__len) { INT32 l; l = 0; @@ -65,7 +65,7 @@ static INT32 Out_Length (CHAR *s, LONGINT s__len) return l; } -void Out_String (CHAR *str, LONGINT str__len) +void Out_String (CHAR *str, ADDRESS str__len) { INT32 l; INT16 error; @@ -125,13 +125,13 @@ void Out_Ln (void) Out_Flush(); } -static void Out_digit (INT64 n, CHAR *s, LONGINT s__len, INT16 *i) +static void Out_digit (INT64 n, CHAR *s, ADDRESS s__len, INT16 *i) { *i -= 1; s[__X(*i, s__len)] = (CHAR)(__MOD(n, 10) + 48); } -static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, INT16 *i) +static void Out_prepend (CHAR *t, ADDRESS t__len, CHAR *s, ADDRESS s__len, INT16 *i) { INT16 j; INT32 l; diff --git a/bootstrap/unix-48/Out.h b/bootstrap/unix-48/Out.h index 0e66420d..d58a17d5 100644 --- a/bootstrap/unix-48/Out.h +++ b/bootstrap/unix-48/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h @@ -16,7 +16,7 @@ import void Out_Ln (void); import void Out_LongReal (LONGREAL x, INT16 n); import void Out_Open (void); import void Out_Real (REAL x, INT16 n); -import void Out_String (CHAR *str, LONGINT str__len); +import void Out_String (CHAR *str, ADDRESS str__len); import LONGREAL Out_Ten (INT16 e); import void *Out__init(void); diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 72c15bf8..459d5079 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -45,35 +45,35 @@ export CHAR Platform_NL[3]; export ADDRESS *Platform_FileIdentity__typ; export BOOLEAN Platform_Absent (INT16 e); -export INT16 Platform_ArgPos (CHAR *s, LONGINT s__len); -export INT16 Platform_Chdir (CHAR *n, LONGINT n__len); +export INT16 Platform_ArgPos (CHAR *s, ADDRESS s__len); +export INT16 Platform_Chdir (CHAR *n, ADDRESS n__len); export INT16 Platform_Close (INT32 h); export BOOLEAN Platform_ConnectionFailed (INT16 e); export void Platform_Delay (INT32 ms); export BOOLEAN Platform_DifferentFilesystems (INT16 e); export INT16 Platform_Error (void); export void Platform_Exit (INT32 code); -export void Platform_GetArg (INT16 n, CHAR *val, LONGINT val__len); +export void Platform_GetArg (INT16 n, CHAR *val, ADDRESS val__len); export void Platform_GetClock (INT32 *t, INT32 *d); -export void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); +export void Platform_GetEnv (CHAR *var, ADDRESS var__len, CHAR *val, ADDRESS val__len); export void Platform_GetIntArg (INT16 n, INT32 *val); export void Platform_GetTimeOfDay (INT32 *sec, INT32 *usec); export INT16 Platform_Identify (INT32 h, Platform_FileIdentity *identity, ADDRESS *identity__typ); -export INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ); +export INT16 Platform_IdentifyByName (CHAR *n, ADDRESS n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ); export BOOLEAN Platform_Inaccessible (INT16 e); export void Platform_Init (INT32 argc, INT32 argvadr); export BOOLEAN Platform_Interrupted (INT16 e); export BOOLEAN Platform_IsConsole (INT32 h); export void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d); -export INT16 Platform_New (CHAR *n, LONGINT n__len, INT32 *h); +export INT16 Platform_New (CHAR *n, ADDRESS n__len, INT32 *h); export BOOLEAN Platform_NoSuchDirectory (INT16 e); export INT32 Platform_OSAllocate (INT32 size); export void Platform_OSFree (INT32 address); -export INT16 Platform_OldRO (CHAR *n, LONGINT n__len, INT32 *h); -export INT16 Platform_OldRW (CHAR *n, LONGINT n__len, INT32 *h); +export INT16 Platform_OldRO (CHAR *n, ADDRESS n__len, INT32 *h); +export INT16 Platform_OldRW (CHAR *n, ADDRESS n__len, INT32 *h); export INT16 Platform_Read (INT32 h, INT32 p, INT32 l, INT32 *n); -export INT16 Platform_ReadBuf (INT32 h, SYSTEM_BYTE *b, LONGINT b__len, INT32 *n); -export INT16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); +export INT16 Platform_ReadBuf (INT32 h, SYSTEM_BYTE *b, ADDRESS b__len, INT32 *n); +export INT16 Platform_Rename (CHAR *o, ADDRESS o__len, CHAR *n, ADDRESS n__len); export BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); export BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); export INT16 Platform_Seek (INT32 h, INT32 offset, INT16 whence); @@ -83,16 +83,16 @@ export void Platform_SetMTime (Platform_FileIdentity *target, ADDRESS *target__t export void Platform_SetQuitHandler (Platform_SignalHandler handler); export INT16 Platform_Size (INT32 h, INT32 *l); export INT16 Platform_Sync (INT32 h); -export INT16 Platform_System (CHAR *cmd, LONGINT cmd__len); +export INT16 Platform_System (CHAR *cmd, ADDRESS cmd__len); static void Platform_TestLittleEndian (void); export INT32 Platform_Time (void); export BOOLEAN Platform_TimedOut (INT16 e); export BOOLEAN Platform_TooManyFiles (INT16 e); export INT16 Platform_Truncate (INT32 h, INT32 l); -export INT16 Platform_Unlink (CHAR *n, LONGINT n__len); +export INT16 Platform_Unlink (CHAR *n, ADDRESS n__len); export INT16 Platform_Write (INT32 h, INT32 p, INT32 l); static void Platform_YMDHMStoClock (INT32 ye, INT32 mo, INT32 da, INT32 ho, INT32 mi, INT32 se, INT32 *t, INT32 *d); -export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); +export BOOLEAN Platform_getEnv (CHAR *var, ADDRESS var__len, CHAR *val, ADDRESS val__len); #include #include @@ -223,7 +223,7 @@ void Platform_Init (INT32 argc, INT32 argvadr) Platform_HeapInitHeap(); } -BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len) +BOOLEAN Platform_getEnv (CHAR *var, ADDRESS var__len, CHAR *val, ADDRESS val__len) { Platform_EnvPtr p = NIL; __DUP(var, var__len, CHAR); @@ -235,7 +235,7 @@ BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__le return p != NIL; } -void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len) +void Platform_GetEnv (CHAR *var, ADDRESS var__len, CHAR *val, ADDRESS val__len) { __DUP(var, var__len, CHAR); if (!Platform_getEnv(var, var__len, (void*)val, val__len)) { @@ -244,7 +244,7 @@ void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len) __DEL(var); } -void Platform_GetArg (INT16 n, CHAR *val, LONGINT val__len) +void Platform_GetArg (INT16 n, CHAR *val, ADDRESS val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { @@ -279,7 +279,7 @@ void Platform_GetIntArg (INT16 n, INT32 *val) } } -INT16 Platform_ArgPos (CHAR *s, LONGINT s__len) +INT16 Platform_ArgPos (CHAR *s, ADDRESS s__len) { INT16 i; CHAR arg[256]; @@ -345,7 +345,7 @@ void Platform_Delay (INT32 ms) Platform_nanosleep(s, ns); } -INT16 Platform_System (CHAR *cmd, LONGINT cmd__len) +INT16 Platform_System (CHAR *cmd, ADDRESS cmd__len) { __DUP(cmd, cmd__len, CHAR); __DEL(cmd); @@ -357,7 +357,7 @@ INT16 Platform_Error (void) return Platform_err(); } -INT16 Platform_OldRO (CHAR *n, LONGINT n__len, INT32 *h) +INT16 Platform_OldRO (CHAR *n, ADDRESS n__len, INT32 *h) { INT16 fd; fd = Platform_openro(n, n__len); @@ -370,7 +370,7 @@ INT16 Platform_OldRO (CHAR *n, LONGINT n__len, INT32 *h) __RETCHK; } -INT16 Platform_OldRW (CHAR *n, LONGINT n__len, INT32 *h) +INT16 Platform_OldRW (CHAR *n, ADDRESS n__len, INT32 *h) { INT16 fd; fd = Platform_openrw(n, n__len); @@ -383,7 +383,7 @@ INT16 Platform_OldRW (CHAR *n, LONGINT n__len, INT32 *h) __RETCHK; } -INT16 Platform_New (CHAR *n, LONGINT n__len, INT32 *h) +INT16 Platform_New (CHAR *n, ADDRESS n__len, INT32 *h) { INT16 fd; fd = Platform_opennew(n, n__len); @@ -423,7 +423,7 @@ INT16 Platform_Identify (INT32 h, Platform_FileIdentity *identity, ADDRESS *iden return 0; } -INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ) +INT16 Platform_IdentifyByName (CHAR *n, ADDRESS n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ) { __DUP(n, n__len, CHAR); Platform_structstats(); @@ -481,7 +481,7 @@ INT16 Platform_Read (INT32 h, INT32 p, INT32 l, INT32 *n) __RETCHK; } -INT16 Platform_ReadBuf (INT32 h, SYSTEM_BYTE *b, LONGINT b__len, INT32 *n) +INT16 Platform_ReadBuf (INT32 h, SYSTEM_BYTE *b, ADDRESS b__len, INT32 *n) { *n = Platform_readfile(h, (ADDRESS)b, b__len); if (*n < 0) { @@ -535,7 +535,7 @@ INT16 Platform_Truncate (INT32 h, INT32 l) __RETCHK; } -INT16 Platform_Unlink (CHAR *n, LONGINT n__len) +INT16 Platform_Unlink (CHAR *n, ADDRESS n__len) { if (Platform_unlink(n, n__len) < 0) { return Platform_err(); @@ -545,7 +545,7 @@ INT16 Platform_Unlink (CHAR *n, LONGINT n__len) __RETCHK; } -INT16 Platform_Chdir (CHAR *n, LONGINT n__len) +INT16 Platform_Chdir (CHAR *n, ADDRESS n__len) { INT16 r; if ((Platform_chdir(n, n__len) >= 0 && Platform_getcwd((void*)Platform_CWD, 256) != NIL)) { @@ -556,7 +556,7 @@ INT16 Platform_Chdir (CHAR *n, LONGINT n__len) __RETCHK; } -INT16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) +INT16 Platform_Rename (CHAR *o, ADDRESS o__len, CHAR *n, ADDRESS n__len) { if (Platform_rename(o, o__len, n, n__len) < 0) { return Platform_err(); diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index b04f552d..34547692 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h @@ -27,35 +27,35 @@ import CHAR Platform_NL[3]; import ADDRESS *Platform_FileIdentity__typ; import BOOLEAN Platform_Absent (INT16 e); -import INT16 Platform_ArgPos (CHAR *s, LONGINT s__len); -import INT16 Platform_Chdir (CHAR *n, LONGINT n__len); +import INT16 Platform_ArgPos (CHAR *s, ADDRESS s__len); +import INT16 Platform_Chdir (CHAR *n, ADDRESS n__len); import INT16 Platform_Close (INT32 h); import BOOLEAN Platform_ConnectionFailed (INT16 e); import void Platform_Delay (INT32 ms); import BOOLEAN Platform_DifferentFilesystems (INT16 e); import INT16 Platform_Error (void); import void Platform_Exit (INT32 code); -import void Platform_GetArg (INT16 n, CHAR *val, LONGINT val__len); +import void Platform_GetArg (INT16 n, CHAR *val, ADDRESS val__len); import void Platform_GetClock (INT32 *t, INT32 *d); -import void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); +import void Platform_GetEnv (CHAR *var, ADDRESS var__len, CHAR *val, ADDRESS val__len); import void Platform_GetIntArg (INT16 n, INT32 *val); import void Platform_GetTimeOfDay (INT32 *sec, INT32 *usec); import INT16 Platform_Identify (INT32 h, Platform_FileIdentity *identity, ADDRESS *identity__typ); -import INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ); +import INT16 Platform_IdentifyByName (CHAR *n, ADDRESS n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ); import BOOLEAN Platform_Inaccessible (INT16 e); import void Platform_Init (INT32 argc, INT32 argvadr); import BOOLEAN Platform_Interrupted (INT16 e); import BOOLEAN Platform_IsConsole (INT32 h); import void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d); -import INT16 Platform_New (CHAR *n, LONGINT n__len, INT32 *h); +import INT16 Platform_New (CHAR *n, ADDRESS n__len, INT32 *h); import BOOLEAN Platform_NoSuchDirectory (INT16 e); import INT32 Platform_OSAllocate (INT32 size); import void Platform_OSFree (INT32 address); -import INT16 Platform_OldRO (CHAR *n, LONGINT n__len, INT32 *h); -import INT16 Platform_OldRW (CHAR *n, LONGINT n__len, INT32 *h); +import INT16 Platform_OldRO (CHAR *n, ADDRESS n__len, INT32 *h); +import INT16 Platform_OldRW (CHAR *n, ADDRESS n__len, INT32 *h); import INT16 Platform_Read (INT32 h, INT32 p, INT32 l, INT32 *n); -import INT16 Platform_ReadBuf (INT32 h, SYSTEM_BYTE *b, LONGINT b__len, INT32 *n); -import INT16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); +import INT16 Platform_ReadBuf (INT32 h, SYSTEM_BYTE *b, ADDRESS b__len, INT32 *n); +import INT16 Platform_Rename (CHAR *o, ADDRESS o__len, CHAR *n, ADDRESS n__len); import BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); import BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); import INT16 Platform_Seek (INT32 h, INT32 offset, INT16 whence); @@ -65,14 +65,14 @@ import void Platform_SetMTime (Platform_FileIdentity *target, ADDRESS *target__t import void Platform_SetQuitHandler (Platform_SignalHandler handler); import INT16 Platform_Size (INT32 h, INT32 *l); import INT16 Platform_Sync (INT32 h); -import INT16 Platform_System (CHAR *cmd, LONGINT cmd__len); +import INT16 Platform_System (CHAR *cmd, ADDRESS cmd__len); import INT32 Platform_Time (void); import BOOLEAN Platform_TimedOut (INT16 e); import BOOLEAN Platform_TooManyFiles (INT16 e); import INT16 Platform_Truncate (INT32 h, INT32 l); -import INT16 Platform_Unlink (CHAR *n, LONGINT n__len); +import INT16 Platform_Unlink (CHAR *n, ADDRESS n__len); import INT16 Platform_Write (INT32 h, INT32 p, INT32 l); -import BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); +import BOOLEAN Platform_getEnv (CHAR *var, ADDRESS var__len, CHAR *val, ADDRESS val__len); import void *Platform__init(void); diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index cd4c3c61..be3ad909 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -10,11 +10,11 @@ -static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LONGINT d__len); -export void Reals_Convert (REAL x, INT16 n, CHAR *d, LONGINT d__len); -export void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len); -export void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len); -export void Reals_ConvertL (LONGREAL x, INT16 n, CHAR *d, LONGINT d__len); +static void Reals_BytesToHex (SYSTEM_BYTE *b, ADDRESS b__len, SYSTEM_BYTE *d, ADDRESS d__len); +export void Reals_Convert (REAL x, INT16 n, CHAR *d, ADDRESS d__len); +export void Reals_ConvertH (REAL y, CHAR *d, ADDRESS d__len); +export void Reals_ConvertHL (LONGREAL x, CHAR *d, ADDRESS d__len); +export void Reals_ConvertL (LONGREAL x, INT16 n, CHAR *d, ADDRESS d__len); export INT16 Reals_Expo (REAL x); export INT16 Reals_ExpoL (LONGREAL x); export void Reals_SetExpo (REAL *x, INT16 ex); @@ -79,7 +79,7 @@ INT16 Reals_ExpoL (LONGREAL x) return __MASK(__ASHR(i, 4), -2048); } -void Reals_ConvertL (LONGREAL x, INT16 n, CHAR *d, LONGINT d__len) +void Reals_ConvertL (LONGREAL x, INT16 n, CHAR *d, ADDRESS d__len) { INT32 i, j, k; if (x < (LONGREAL)0) { @@ -107,7 +107,7 @@ void Reals_ConvertL (LONGREAL x, INT16 n, CHAR *d, LONGINT d__len) } } -void Reals_Convert (REAL x, INT16 n, CHAR *d, LONGINT d__len) +void Reals_Convert (REAL x, INT16 n, CHAR *d, ADDRESS d__len) { Reals_ConvertL(x, n, (void*)d, d__len); } @@ -122,7 +122,7 @@ static CHAR Reals_ToHex (INT16 i) __RETCHK; } -static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LONGINT d__len) +static void Reals_BytesToHex (SYSTEM_BYTE *b, ADDRESS b__len, SYSTEM_BYTE *d, ADDRESS d__len) { INT16 i; INT32 l; @@ -137,12 +137,12 @@ static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LO } } -void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len) +void Reals_ConvertH (REAL y, CHAR *d, ADDRESS d__len) { Reals_BytesToHex((void*)&y, 4, (void*)d, d__len * 1); } -void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len) +void Reals_ConvertHL (LONGREAL x, CHAR *d, ADDRESS d__len) { Reals_BytesToHex((void*)&x, 8, (void*)d, d__len * 1); } diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index f0c84ab1..e8d15a2f 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h @@ -8,10 +8,10 @@ -import void Reals_Convert (REAL x, INT16 n, CHAR *d, LONGINT d__len); -import void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len); -import void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len); -import void Reals_ConvertL (LONGREAL x, INT16 n, CHAR *d, LONGINT d__len); +import void Reals_Convert (REAL x, INT16 n, CHAR *d, ADDRESS d__len); +import void Reals_ConvertH (REAL y, CHAR *d, ADDRESS d__len); +import void Reals_ConvertHL (LONGREAL x, CHAR *d, ADDRESS d__len); +import void Reals_ConvertL (LONGREAL x, INT16 n, CHAR *d, ADDRESS d__len); import INT16 Reals_Expo (REAL x); import INT16 Reals_ExpoL (LONGREAL x); import void Reals_SetExpo (REAL *x, INT16 ex); diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index b5707327..fd550df3 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -10,18 +10,18 @@ -export void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len); -export void Strings_Cap (CHAR *s, LONGINT s__len); -export void Strings_Delete (CHAR *s, LONGINT s__len, INT16 pos, INT16 n); -export void Strings_Extract (CHAR *source, LONGINT source__len, INT16 pos, INT16 n, CHAR *dest, LONGINT dest__len); -export void Strings_Insert (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len); -export INT16 Strings_Length (CHAR *s, LONGINT s__len); -export BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len); -export INT16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, INT16 pos); -export void Strings_Replace (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len); +export void Strings_Append (CHAR *extra, ADDRESS extra__len, CHAR *dest, ADDRESS dest__len); +export void Strings_Cap (CHAR *s, ADDRESS s__len); +export void Strings_Delete (CHAR *s, ADDRESS s__len, INT16 pos, INT16 n); +export void Strings_Extract (CHAR *source, ADDRESS source__len, INT16 pos, INT16 n, CHAR *dest, ADDRESS dest__len); +export void Strings_Insert (CHAR *source, ADDRESS source__len, INT16 pos, CHAR *dest, ADDRESS dest__len); +export INT16 Strings_Length (CHAR *s, ADDRESS s__len); +export BOOLEAN Strings_Match (CHAR *string, ADDRESS string__len, CHAR *pattern, ADDRESS pattern__len); +export INT16 Strings_Pos (CHAR *pattern, ADDRESS pattern__len, CHAR *s, ADDRESS s__len, INT16 pos); +export void Strings_Replace (CHAR *source, ADDRESS source__len, INT16 pos, CHAR *dest, ADDRESS dest__len); -INT16 Strings_Length (CHAR *s, LONGINT s__len) +INT16 Strings_Length (CHAR *s, ADDRESS s__len) { INT32 i; __DUP(s, s__len, CHAR); @@ -39,7 +39,7 @@ INT16 Strings_Length (CHAR *s, LONGINT s__len) __RETCHK; } -void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len) +void Strings_Append (CHAR *extra, ADDRESS extra__len, CHAR *dest, ADDRESS dest__len) { INT16 n1, n2, i; __DUP(extra, extra__len, CHAR); @@ -56,7 +56,7 @@ void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__ __DEL(extra); } -void Strings_Insert (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len) +void Strings_Insert (CHAR *source, ADDRESS source__len, INT16 pos, CHAR *dest, ADDRESS dest__len) { INT16 n1, n2, i; __DUP(source, source__len, CHAR); @@ -87,7 +87,7 @@ void Strings_Insert (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, L __DEL(source); } -void Strings_Delete (CHAR *s, LONGINT s__len, INT16 pos, INT16 n) +void Strings_Delete (CHAR *s, ADDRESS s__len, INT16 pos, INT16 n) { INT16 len, i; len = Strings_Length(s, s__len); @@ -110,7 +110,7 @@ void Strings_Delete (CHAR *s, LONGINT s__len, INT16 pos, INT16 n) } } -void Strings_Replace (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len) +void Strings_Replace (CHAR *source, ADDRESS source__len, INT16 pos, CHAR *dest, ADDRESS dest__len) { __DUP(source, source__len, CHAR); Strings_Delete((void*)dest, dest__len, pos, pos + Strings_Length(source, source__len)); @@ -118,7 +118,7 @@ void Strings_Replace (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, __DEL(source); } -void Strings_Extract (CHAR *source, LONGINT source__len, INT16 pos, INT16 n, CHAR *dest, LONGINT dest__len) +void Strings_Extract (CHAR *source, ADDRESS source__len, INT16 pos, INT16 n, CHAR *dest, ADDRESS dest__len) { INT16 len, destLen, i; __DUP(source, source__len, CHAR); @@ -143,7 +143,7 @@ void Strings_Extract (CHAR *source, LONGINT source__len, INT16 pos, INT16 n, CHA __DEL(source); } -INT16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, INT16 pos) +INT16 Strings_Pos (CHAR *pattern, ADDRESS pattern__len, CHAR *s, ADDRESS s__len, INT16 pos) { INT16 n1, n2, i, j; __DUP(pattern, pattern__len, CHAR); @@ -175,7 +175,7 @@ INT16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, return -1; } -void Strings_Cap (CHAR *s, LONGINT s__len) +void Strings_Cap (CHAR *s, ADDRESS s__len) { INT16 i; i = 0; @@ -191,9 +191,9 @@ static struct Match__7 { struct Match__7 *lnk; } *Match__7_s; -static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, INT16 n, INT16 m); +static BOOLEAN M__8 (CHAR *name, ADDRESS name__len, CHAR *mask, ADDRESS mask__len, INT16 n, INT16 m); -static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, INT16 n, INT16 m) +static BOOLEAN M__8 (CHAR *name, ADDRESS name__len, CHAR *mask, ADDRESS mask__len, INT16 n, INT16 m) { while ((((n >= 0 && m >= 0)) && mask[__X(m, mask__len)] != '*')) { if (name[__X(n, name__len)] != mask[__X(m, mask__len)]) { @@ -220,7 +220,7 @@ static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__le return 0; } -BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len) +BOOLEAN Strings_Match (CHAR *string, ADDRESS string__len, CHAR *pattern, ADDRESS pattern__len) { struct Match__7 _s; BOOLEAN __retval; diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index c987af8d..76cb022d 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h @@ -8,15 +8,15 @@ -import void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len); -import void Strings_Cap (CHAR *s, LONGINT s__len); -import void Strings_Delete (CHAR *s, LONGINT s__len, INT16 pos, INT16 n); -import void Strings_Extract (CHAR *source, LONGINT source__len, INT16 pos, INT16 n, CHAR *dest, LONGINT dest__len); -import void Strings_Insert (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len); -import INT16 Strings_Length (CHAR *s, LONGINT s__len); -import BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len); -import INT16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, INT16 pos); -import void Strings_Replace (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len); +import void Strings_Append (CHAR *extra, ADDRESS extra__len, CHAR *dest, ADDRESS dest__len); +import void Strings_Cap (CHAR *s, ADDRESS s__len); +import void Strings_Delete (CHAR *s, ADDRESS s__len, INT16 pos, INT16 n); +import void Strings_Extract (CHAR *source, ADDRESS source__len, INT16 pos, INT16 n, CHAR *dest, ADDRESS dest__len); +import void Strings_Insert (CHAR *source, ADDRESS source__len, INT16 pos, CHAR *dest, ADDRESS dest__len); +import INT16 Strings_Length (CHAR *s, ADDRESS s__len); +import BOOLEAN Strings_Match (CHAR *string, ADDRESS string__len, CHAR *pattern, ADDRESS pattern__len); +import INT16 Strings_Pos (CHAR *pattern, ADDRESS pattern__len, CHAR *s, ADDRESS s__len, INT16 pos); +import void Strings_Replace (CHAR *source, ADDRESS source__len, INT16 pos, CHAR *dest, ADDRESS dest__len); import void *Strings__init(void); diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index ad26b1cb..1428c051 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -187,20 +187,20 @@ export void Texts_Append (Texts_Text T, Texts_Buffer B); export void Texts_ChangeLooks (Texts_Text T, INT32 beg, INT32 end, UINT32 sel, Texts_FontsFont fnt, INT8 col, INT8 voff); static Texts_Elem Texts_CloneElem (Texts_Elem e); static Texts_Piece Texts_ClonePiece (Texts_Piece p); -export void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len); +export void Texts_Close (Texts_Text T, CHAR *name, ADDRESS name__len); export void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); export void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); export void Texts_Delete (Texts_Text T, INT32 beg, INT32 end); export Texts_Text Texts_ElemBase (Texts_Elem E); export INT32 Texts_ElemPos (Texts_Elem E); static void Texts_Find (Texts_Text T, INT32 *pos, Texts_Run *u, INT32 *org, INT32 *off); -static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len); +static Texts_FontsFont Texts_FontsThis (CHAR *name, ADDRESS name__len); static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, ADDRESS *msg__typ); export void Texts_Insert (Texts_Text T, INT32 pos, Texts_Buffer B); export void Texts_Load (Files_Rider *r, ADDRESS *r__typ, Texts_Text T); static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T); static void Texts_Merge (Texts_Text T, Texts_Run u, Texts_Run *v); -export void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len); +export void Texts_Open (Texts_Text T, CHAR *name, ADDRESS name__len); export void Texts_OpenBuf (Texts_Buffer B); export void Texts_OpenReader (Texts_Reader *R, ADDRESS *R__typ, Texts_Text T, INT32 pos); export void Texts_OpenScanner (Texts_Scanner *S, ADDRESS *S__typ, Texts_Text T, INT32 pos); @@ -229,10 +229,10 @@ export void Texts_WriteLongRealHex (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x export void Texts_WriteReal (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n); export void Texts_WriteRealFix (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n, INT16 k); export void Texts_WriteRealHex (Texts_Writer *W, ADDRESS *W__typ, REAL x); -export void Texts_WriteString (Texts_Writer *W, ADDRESS *W__typ, CHAR *s, LONGINT s__len); +export void Texts_WriteString (Texts_Writer *W, ADDRESS *W__typ, CHAR *s, ADDRESS s__len); -static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len) +static Texts_FontsFont Texts_FontsThis (CHAR *name, ADDRESS name__len) { Texts_FontsFont F = NIL; __NEW(F, Texts_FontDesc); @@ -1027,7 +1027,7 @@ void Texts_WriteLn (Texts_Writer *W, ADDRESS *W__typ) Texts_Write(&*W, W__typ, 0x0d); } -void Texts_WriteString (Texts_Writer *W, ADDRESS *W__typ, CHAR *s, LONGINT s__len) +void Texts_WriteString (Texts_Writer *W, ADDRESS *W__typ, CHAR *s, ADDRESS s__len) { INT16 i; __DUP(s, s__len, CHAR); @@ -1539,7 +1539,7 @@ void Texts_Load (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) Texts_Load0(&*r, r__typ, T); } -void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len) +void Texts_Open (Texts_Text T, CHAR *name, ADDRESS name__len) { Files_File f = NIL; Files_Rider r; @@ -1755,7 +1755,7 @@ void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) Store__39_s = _s.lnk; } -void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len) +void Texts_Close (Texts_Text T, CHAR *name, ADDRESS name__len) { Files_File f = NIL; Files_Rider r; diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index e2c03958..fa28aa92 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h @@ -131,7 +131,7 @@ import ADDRESS *Texts_Writer__typ; import void Texts_Append (Texts_Text T, Texts_Buffer B); import void Texts_ChangeLooks (Texts_Text T, INT32 beg, INT32 end, UINT32 sel, Texts_FontsFont fnt, INT8 col, INT8 voff); -import void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len); +import void Texts_Close (Texts_Text T, CHAR *name, ADDRESS name__len); import void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); import void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); import void Texts_Delete (Texts_Text T, INT32 beg, INT32 end); @@ -139,7 +139,7 @@ import Texts_Text Texts_ElemBase (Texts_Elem E); import INT32 Texts_ElemPos (Texts_Elem E); import void Texts_Insert (Texts_Text T, INT32 pos, Texts_Buffer B); import void Texts_Load (Files_Rider *r, ADDRESS *r__typ, Texts_Text T); -import void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len); +import void Texts_Open (Texts_Text T, CHAR *name, ADDRESS name__len); import void Texts_OpenBuf (Texts_Buffer B); import void Texts_OpenReader (Texts_Reader *R, ADDRESS *R__typ, Texts_Text T, INT32 pos); import void Texts_OpenScanner (Texts_Scanner *S, ADDRESS *S__typ, Texts_Text T, INT32 pos); @@ -166,7 +166,7 @@ import void Texts_WriteLongRealHex (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x import void Texts_WriteReal (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n); import void Texts_WriteRealFix (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n, INT16 k); import void Texts_WriteRealHex (Texts_Writer *W, ADDRESS *W__typ, REAL x); -import void Texts_WriteString (Texts_Writer *W, ADDRESS *W__typ, CHAR *s, LONGINT s__len); +import void Texts_WriteString (Texts_Writer *W, ADDRESS *W__typ, CHAR *s, ADDRESS s__len); import void *Texts__init(void); diff --git a/bootstrap/unix-48/VT100.c b/bootstrap/unix-48/VT100.c index f69fd90e..38c0743f 100644 --- a/bootstrap/unix-48/VT100.c +++ b/bootstrap/unix-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -27,23 +27,23 @@ export void VT100_DECTCEMl (void); export void VT100_DSR (INT16 n); export void VT100_ED (INT16 n); export void VT100_EL (INT16 n); -static void VT100_EscSeq (INT16 n, CHAR *letter, LONGINT letter__len); -static void VT100_EscSeq0 (CHAR *letter, LONGINT letter__len); -static void VT100_EscSeq2 (INT16 n, INT16 m, CHAR *letter, LONGINT letter__len); -static void VT100_EscSeqSwapped (INT16 n, CHAR *letter, LONGINT letter__len); +static void VT100_EscSeq (INT16 n, CHAR *letter, ADDRESS letter__len); +static void VT100_EscSeq0 (CHAR *letter, ADDRESS letter__len); +static void VT100_EscSeq2 (INT16 n, INT16 m, CHAR *letter, ADDRESS letter__len); +static void VT100_EscSeqSwapped (INT16 n, CHAR *letter, ADDRESS letter__len); export void VT100_HVP (INT16 n, INT16 m); -export void VT100_IntToStr (INT32 int_, CHAR *str, LONGINT str__len); +export void VT100_IntToStr (INT32 int_, CHAR *str, ADDRESS str__len); export void VT100_RCP (void); -static void VT100_Reverse0 (CHAR *str, LONGINT str__len, INT16 start, INT16 end); +static void VT100_Reverse0 (CHAR *str, ADDRESS str__len, INT16 start, INT16 end); export void VT100_SCP (void); export void VT100_SD (INT16 n); export void VT100_SGR (INT16 n); export void VT100_SGR2 (INT16 n, INT16 m); export void VT100_SU (INT16 n); -export void VT100_SetAttr (CHAR *attr, LONGINT attr__len); +export void VT100_SetAttr (CHAR *attr, ADDRESS attr__len); -static void VT100_Reverse0 (CHAR *str, LONGINT str__len, INT16 start, INT16 end) +static void VT100_Reverse0 (CHAR *str, ADDRESS str__len, INT16 start, INT16 end) { CHAR h; while (start < end) { @@ -55,7 +55,7 @@ static void VT100_Reverse0 (CHAR *str, LONGINT str__len, INT16 start, INT16 end) } } -void VT100_IntToStr (INT32 int_, CHAR *str, LONGINT str__len) +void VT100_IntToStr (INT32 int_, CHAR *str, ADDRESS str__len) { CHAR b[21]; INT16 s, e; @@ -84,7 +84,7 @@ void VT100_IntToStr (INT32 int_, CHAR *str, LONGINT str__len) __COPY(b, str, str__len); } -static void VT100_EscSeq0 (CHAR *letter, LONGINT letter__len) +static void VT100_EscSeq0 (CHAR *letter, ADDRESS letter__len) { CHAR cmd[9]; __DUP(letter, letter__len, CHAR); @@ -94,7 +94,7 @@ static void VT100_EscSeq0 (CHAR *letter, LONGINT letter__len) __DEL(letter); } -static void VT100_EscSeq (INT16 n, CHAR *letter, LONGINT letter__len) +static void VT100_EscSeq (INT16 n, CHAR *letter, ADDRESS letter__len) { CHAR nstr[2]; CHAR cmd[7]; @@ -107,7 +107,7 @@ static void VT100_EscSeq (INT16 n, CHAR *letter, LONGINT letter__len) __DEL(letter); } -static void VT100_EscSeqSwapped (INT16 n, CHAR *letter, LONGINT letter__len) +static void VT100_EscSeqSwapped (INT16 n, CHAR *letter, ADDRESS letter__len) { CHAR nstr[2]; CHAR cmd[7]; @@ -120,7 +120,7 @@ static void VT100_EscSeqSwapped (INT16 n, CHAR *letter, LONGINT letter__len) __DEL(letter); } -static void VT100_EscSeq2 (INT16 n, INT16 m, CHAR *letter, LONGINT letter__len) +static void VT100_EscSeq2 (INT16 n, INT16 m, CHAR *letter, ADDRESS letter__len) { CHAR nstr[5], mstr[5]; CHAR cmd[12]; @@ -236,7 +236,7 @@ void VT100_DECTCEMh (void) VT100_EscSeq0((CHAR*)"\?25h", 5); } -void VT100_SetAttr (CHAR *attr, LONGINT attr__len) +void VT100_SetAttr (CHAR *attr, ADDRESS attr__len) { CHAR tmpstr[16]; __DUP(attr, attr__len, CHAR); diff --git a/bootstrap/unix-48/VT100.h b/bootstrap/unix-48/VT100.h index d99406ec..4bbb3110 100644 --- a/bootstrap/unix-48/VT100.h +++ b/bootstrap/unix-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h @@ -23,14 +23,14 @@ import void VT100_DSR (INT16 n); import void VT100_ED (INT16 n); import void VT100_EL (INT16 n); import void VT100_HVP (INT16 n, INT16 m); -import void VT100_IntToStr (INT32 int_, CHAR *str, LONGINT str__len); +import void VT100_IntToStr (INT32 int_, CHAR *str, ADDRESS str__len); import void VT100_RCP (void); import void VT100_SCP (void); import void VT100_SD (INT16 n); import void VT100_SGR (INT16 n); import void VT100_SGR2 (INT16 n, INT16 m); import void VT100_SU (INT16 n); -import void VT100_SetAttr (CHAR *attr, LONGINT attr__len); +import void VT100_SetAttr (CHAR *attr, ADDRESS attr__len); import void *VT100__init(void); diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index 37630d23..66f80319 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -17,13 +17,13 @@ static CHAR extTools_CFLAGS[1023]; -export void extTools_Assemble (CHAR *moduleName, LONGINT moduleName__len); -static void extTools_InitialiseCompilerCommand (CHAR *s, LONGINT s__len); -export void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN statically, CHAR *additionalopts, LONGINT additionalopts__len); -static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGINT cmd__len); +export void extTools_Assemble (CHAR *moduleName, ADDRESS moduleName__len); +static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len); +export void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN statically, CHAR *additionalopts, ADDRESS additionalopts__len); +static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRESS cmd__len); -static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGINT cmd__len) +static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRESS cmd__len) { INT16 r, status, exitcode; __DUP(title, title__len, CHAR); @@ -63,7 +63,7 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN __DEL(cmd); } -static void extTools_InitialiseCompilerCommand (CHAR *s, LONGINT s__len) +static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) { __COPY("gcc -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); @@ -74,7 +74,7 @@ static void extTools_InitialiseCompilerCommand (CHAR *s, LONGINT s__len) Strings_Append((CHAR*)" ", 2, (void*)s, s__len); } -void extTools_Assemble (CHAR *moduleName, LONGINT moduleName__len) +void extTools_Assemble (CHAR *moduleName, ADDRESS moduleName__len) { CHAR cmd[1023]; __DUP(moduleName, moduleName__len, CHAR); @@ -86,7 +86,7 @@ void extTools_Assemble (CHAR *moduleName, LONGINT moduleName__len) __DEL(moduleName); } -void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN statically, CHAR *additionalopts, LONGINT additionalopts__len) +void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN statically, CHAR *additionalopts, ADDRESS additionalopts__len) { CHAR cmd[1023]; __DUP(additionalopts, additionalopts__len, CHAR); diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index 63e5df15..472c60f3 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h @@ -8,8 +8,8 @@ -import void extTools_Assemble (CHAR *moduleName, LONGINT moduleName__len); -import void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN statically, CHAR *additionalopts, LONGINT additionalopts__len); +import void extTools_Assemble (CHAR *moduleName, ADDRESS moduleName__len); +import void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN statically, CHAR *additionalopts, ADDRESS additionalopts__len); import void *extTools__init(void); diff --git a/bootstrap/unix-88/Compiler.c b/bootstrap/unix-88/Compiler.c index dc4bb660..e900905f 100644 --- a/bootstrap/unix-88/Compiler.c +++ b/bootstrap/unix-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index 2d0061df..071d7b8e 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index b28e0caa..b1942442 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 826c3d63..6a53103d 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -52,7 +52,7 @@ static Files_File Files_files; static INT16 Files_tempno; static CHAR Files_HOME[1024]; static struct { - LONGINT len[1]; + ADDRESS len[1]; CHAR data[1]; } *Files_SearchPath; @@ -62,56 +62,56 @@ export ADDRESS *Files_Rider__typ; export Files_File Files_Base (Files_Rider *r, ADDRESS *r__typ); static Files_File Files_CacheEntry (Platform_FileIdentity identity); -export void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INT16 *res); +export void Files_ChangeDirectory (CHAR *path, ADDRESS path__len, INT16 *res); export void Files_Close (Files_File f); static void Files_CloseOSFile (Files_File f); static void Files_Create (Files_File f); -export void Files_Delete (CHAR *name, LONGINT name__len, INT16 *res); -static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INT16 errcode); +export void Files_Delete (CHAR *name, ADDRESS name__len, INT16 *res); +static void Files_Err (CHAR *s, ADDRESS s__len, Files_File f, INT16 errcode); static void Files_Finalize (SYSTEM_PTR o); -static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *dest, LONGINT dest__len); +static void Files_FlipBytes (SYSTEM_BYTE *src, ADDRESS src__len, SYSTEM_BYTE *dest, ADDRESS dest__len); static void Files_Flush (Files_Buffer buf); export void Files_GetDate (Files_File f, INT32 *t, INT32 *d); -export void Files_GetName (Files_File f, CHAR *name, LONGINT name__len); -static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *name, LONGINT name__len); -static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len); +export void Files_GetName (Files_File f, CHAR *name, ADDRESS name__len); +static void Files_GetTempName (CHAR *finalName, ADDRESS finalName__len, CHAR *name, ADDRESS name__len); +static BOOLEAN Files_HasDir (CHAR *name, ADDRESS name__len); export INT32 Files_Length (Files_File f); -static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT name__len, CHAR *dest, LONGINT dest__len); -export Files_File Files_New (CHAR *name, LONGINT name__len); -export Files_File Files_Old (CHAR *name, LONGINT name__len); +static void Files_MakeFileName (CHAR *dir, ADDRESS dir__len, CHAR *name, ADDRESS name__len, CHAR *dest, ADDRESS dest__len); +export Files_File Files_New (CHAR *name, ADDRESS name__len); +export Files_File Files_Old (CHAR *name, ADDRESS name__len); export INT32 Files_Pos (Files_Rider *r, ADDRESS *r__typ); export void Files_Purge (Files_File f); export void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x); export void Files_ReadBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN *x); -export void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n); +export void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS x__len, INT32 n); export void Files_ReadInt (Files_Rider *R, ADDRESS *R__typ, INT16 *x); export void Files_ReadLInt (Files_Rider *R, ADDRESS *R__typ, INT32 *x); export void Files_ReadLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL *x); -export void Files_ReadLine (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); -export void Files_ReadNum (Files_Rider *R, ADDRESS *R__typ, SYSTEM_BYTE *x, LONGINT x__len); +export void Files_ReadLine (Files_Rider *R, ADDRESS *R__typ, CHAR *x, ADDRESS x__len); +export void Files_ReadNum (Files_Rider *R, ADDRESS *R__typ, SYSTEM_BYTE *x, ADDRESS x__len); export void Files_ReadReal (Files_Rider *R, ADDRESS *R__typ, REAL *x); export void Files_ReadSet (Files_Rider *R, ADDRESS *R__typ, UINT32 *x); -export void Files_ReadString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); +export void Files_ReadString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, ADDRESS x__len); export void Files_Register (Files_File f); -export void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT16 *res); -static void Files_ScanPath (INT16 *pos, CHAR *dir, LONGINT dir__len); +export void Files_Rename (CHAR *old, ADDRESS old__len, CHAR *new, ADDRESS new__len, INT16 *res); +static void Files_ScanPath (INT16 *pos, CHAR *dir, ADDRESS dir__len); export void Files_Set (Files_Rider *r, ADDRESS *r__typ, Files_File f, INT32 pos); -export void Files_SetSearchPath (CHAR *path, LONGINT path__len); +export void Files_SetSearchPath (CHAR *path, ADDRESS path__len); export void Files_Write (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE x); export void Files_WriteBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN x); -export void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n); +export void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS x__len, INT32 n); export void Files_WriteInt (Files_Rider *R, ADDRESS *R__typ, INT16 x); export void Files_WriteLInt (Files_Rider *R, ADDRESS *R__typ, INT32 x); export void Files_WriteLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL x); export void Files_WriteNum (Files_Rider *R, ADDRESS *R__typ, INT64 x); export void Files_WriteReal (Files_Rider *R, ADDRESS *R__typ, REAL x); export void Files_WriteSet (Files_Rider *R, ADDRESS *R__typ, UINT32 x); -export void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); +export void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, ADDRESS x__len); #define Files_IdxTrap() __HALT(-1) #define Files_ToAdr(x) (ADDRESS)x -static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INT16 errcode) +static void Files_Err (CHAR *s, ADDRESS s__len, Files_File f, INT16 errcode) { __DUP(s, s__len, CHAR); Out_Ln(); @@ -138,7 +138,7 @@ static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INT16 errcode) __DEL(s); } -static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT name__len, CHAR *dest, LONGINT dest__len) +static void Files_MakeFileName (CHAR *dir, ADDRESS dir__len, CHAR *name, ADDRESS name__len, CHAR *dest, ADDRESS dest__len) { INT16 i, j; __DUP(dir, dir__len, CHAR); @@ -163,7 +163,7 @@ static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT __DEL(name); } -static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *name, LONGINT name__len) +static void Files_GetTempName (CHAR *finalName, ADDRESS finalName__len, CHAR *name, ADDRESS name__len) { INT32 n, i, j; __DUP(finalName, finalName__len, CHAR); @@ -316,7 +316,7 @@ INT32 Files_Length (Files_File f) return f->len; } -Files_File Files_New (CHAR *name, LONGINT name__len) +Files_File Files_New (CHAR *name, ADDRESS name__len) { Files_File f = NIL; __DUP(name, name__len, CHAR); @@ -332,7 +332,7 @@ Files_File Files_New (CHAR *name, LONGINT name__len) return f; } -static void Files_ScanPath (INT16 *pos, CHAR *dir, LONGINT dir__len) +static void Files_ScanPath (INT16 *pos, CHAR *dir, ADDRESS dir__len) { INT16 i; CHAR ch; @@ -375,7 +375,7 @@ static void Files_ScanPath (INT16 *pos, CHAR *dir, LONGINT dir__len) dir[i] = 0x00; } -static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len) +static BOOLEAN Files_HasDir (CHAR *name, ADDRESS name__len) { INT16 i; CHAR ch; @@ -415,7 +415,7 @@ static Files_File Files_CacheEntry (Platform_FileIdentity identity) return NIL; } -Files_File Files_Old (CHAR *name, LONGINT name__len) +Files_File Files_Old (CHAR *name, ADDRESS name__len) { Files_File f = NIL; INT32 fd; @@ -618,7 +618,7 @@ void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x) } } -void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n) +void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS x__len, INT32 n) { INT32 xpos, min, restInBuf, offset; Files_Buffer buf = NIL; @@ -683,7 +683,7 @@ void Files_Write (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE x) (*r).res = 0; } -void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n) +void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS x__len, INT32 n) { INT32 xpos, min, restInBuf, offset; Files_Buffer buf = NIL; @@ -722,14 +722,14 @@ void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT (*r).res = 0; } -void Files_Delete (CHAR *name, LONGINT name__len, INT16 *res) +void Files_Delete (CHAR *name, ADDRESS name__len, INT16 *res) { __DUP(name, name__len, CHAR); *res = Platform_Unlink((void*)name, name__len); __DEL(name); } -void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT16 *res) +void Files_Rename (CHAR *old, ADDRESS old__len, CHAR *new, ADDRESS new__len, INT16 *res) { INT32 fdold, fdnew, n; INT16 error, ignore; @@ -812,14 +812,14 @@ void Files_Register (Files_File f) } } -void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INT16 *res) +void Files_ChangeDirectory (CHAR *path, ADDRESS path__len, INT16 *res) { __DUP(path, path__len, CHAR); *res = Platform_Chdir((void*)path, path__len); __DEL(path); } -static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *dest, LONGINT dest__len) +static void Files_FlipBytes (SYSTEM_BYTE *src, ADDRESS src__len, SYSTEM_BYTE *dest, ADDRESS dest__len) { INT32 i, j; if (!Platform_LittleEndian) { @@ -877,7 +877,7 @@ void Files_ReadLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL *x) Files_FlipBytes((void*)b, 8, (void*)&*x, 8); } -void Files_ReadString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len) +void Files_ReadString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, ADDRESS x__len) { INT16 i; CHAR ch; @@ -889,7 +889,7 @@ void Files_ReadString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len) } while (!(ch == 0x00)); } -void Files_ReadLine (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len) +void Files_ReadLine (Files_Rider *R, ADDRESS *R__typ, CHAR *x, ADDRESS x__len) { INT16 i; i = 0; @@ -906,7 +906,7 @@ void Files_ReadLine (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len) x[i] = 0x00; } -void Files_ReadNum (Files_Rider *R, ADDRESS *R__typ, SYSTEM_BYTE *x, LONGINT x__len) +void Files_ReadNum (Files_Rider *R, ADDRESS *R__typ, SYSTEM_BYTE *x, ADDRESS x__len) { INT8 s, b; INT64 q; @@ -972,7 +972,7 @@ void Files_WriteLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL x) Files_WriteBytes(&*R, R__typ, (void*)b, 8, 8); } -void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len) +void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, ADDRESS x__len) { INT16 i; i = 0; @@ -991,7 +991,7 @@ void Files_WriteNum (Files_Rider *R, ADDRESS *R__typ, INT64 x) Files_Write(&*R, R__typ, (CHAR)__MASK(x, -128)); } -void Files_GetName (Files_File f, CHAR *name, LONGINT name__len) +void Files_GetName (Files_File f, CHAR *name, ADDRESS name__len) { __COPY(f->workName, name, name__len); } @@ -1009,7 +1009,7 @@ static void Files_Finalize (SYSTEM_PTR o) } } -void Files_SetSearchPath (CHAR *path, LONGINT path__len) +void Files_SetSearchPath (CHAR *path, ADDRESS path__len) { __DUP(path, path__len, CHAR); if (Strings_Length(path, path__len) != 0) { diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 855c5f7c..5a99da54 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h @@ -30,41 +30,41 @@ import ADDRESS *Files_FileDesc__typ; import ADDRESS *Files_Rider__typ; import Files_File Files_Base (Files_Rider *r, ADDRESS *r__typ); -import void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INT16 *res); +import void Files_ChangeDirectory (CHAR *path, ADDRESS path__len, INT16 *res); import void Files_Close (Files_File f); -import void Files_Delete (CHAR *name, LONGINT name__len, INT16 *res); +import void Files_Delete (CHAR *name, ADDRESS name__len, INT16 *res); import void Files_GetDate (Files_File f, INT32 *t, INT32 *d); -import void Files_GetName (Files_File f, CHAR *name, LONGINT name__len); +import void Files_GetName (Files_File f, CHAR *name, ADDRESS name__len); import INT32 Files_Length (Files_File f); -import Files_File Files_New (CHAR *name, LONGINT name__len); -import Files_File Files_Old (CHAR *name, LONGINT name__len); +import Files_File Files_New (CHAR *name, ADDRESS name__len); +import Files_File Files_Old (CHAR *name, ADDRESS name__len); import INT32 Files_Pos (Files_Rider *r, ADDRESS *r__typ); import void Files_Purge (Files_File f); import void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x); import void Files_ReadBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN *x); -import void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n); +import void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS x__len, INT32 n); import void Files_ReadInt (Files_Rider *R, ADDRESS *R__typ, INT16 *x); import void Files_ReadLInt (Files_Rider *R, ADDRESS *R__typ, INT32 *x); import void Files_ReadLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL *x); -import void Files_ReadLine (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); -import void Files_ReadNum (Files_Rider *R, ADDRESS *R__typ, SYSTEM_BYTE *x, LONGINT x__len); +import void Files_ReadLine (Files_Rider *R, ADDRESS *R__typ, CHAR *x, ADDRESS x__len); +import void Files_ReadNum (Files_Rider *R, ADDRESS *R__typ, SYSTEM_BYTE *x, ADDRESS x__len); import void Files_ReadReal (Files_Rider *R, ADDRESS *R__typ, REAL *x); import void Files_ReadSet (Files_Rider *R, ADDRESS *R__typ, UINT32 *x); -import void Files_ReadString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); +import void Files_ReadString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, ADDRESS x__len); import void Files_Register (Files_File f); -import void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT16 *res); +import void Files_Rename (CHAR *old, ADDRESS old__len, CHAR *new, ADDRESS new__len, INT16 *res); import void Files_Set (Files_Rider *r, ADDRESS *r__typ, Files_File f, INT32 pos); -import void Files_SetSearchPath (CHAR *path, LONGINT path__len); +import void Files_SetSearchPath (CHAR *path, ADDRESS path__len); import void Files_Write (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE x); import void Files_WriteBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN x); -import void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n); +import void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS x__len, INT32 n); import void Files_WriteInt (Files_Rider *R, ADDRESS *R__typ, INT16 x); import void Files_WriteLInt (Files_Rider *R, ADDRESS *R__typ, INT32 x); import void Files_WriteLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL x); import void Files_WriteNum (Files_Rider *R, ADDRESS *R__typ, INT64 x); import void Files_WriteReal (Files_Rider *R, ADDRESS *R__typ, REAL x); import void Files_WriteSet (Files_Rider *R, ADDRESS *R__typ, UINT32 x); -import void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); +import void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, ADDRESS x__len); import void *Files__init(void); diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index a2bb8f2f..032e9544 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -85,14 +85,14 @@ static void Heap_ExtendHeap (INT64 blksz); export void Heap_FINALL (void); static void Heap_Finalize (void); export void Heap_GC (BOOLEAN markStack); -static void Heap_HeapSort (INT64 n, INT64 *a, LONGINT a__len); +static void Heap_HeapSort (INT64 n, INT64 *a, ADDRESS a__len); export void Heap_INCREF (Heap_Module m); export void Heap_InitHeap (void); export void Heap_Lock (void); static void Heap_Mark (INT64 q); -static void Heap_MarkCandidates (INT64 n, INT64 *cand, LONGINT cand__len); +static void Heap_MarkCandidates (INT64 n, INT64 *cand, ADDRESS cand__len); static void Heap_MarkP (SYSTEM_PTR p); -static void Heap_MarkStack (INT64 n, INT64 *cand, LONGINT cand__len); +static void Heap_MarkStack (INT64 n, INT64 *cand, ADDRESS cand__len); export SYSTEM_PTR Heap_NEWBLK (INT64 size); export SYSTEM_PTR Heap_NEWREC (INT64 tag); static INT64 Heap_NewChunk (INT64 blksz); @@ -101,7 +101,7 @@ export SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); export void Heap_REGTYP (Heap_Module m, INT64 typ); export void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); static void Heap_Scan (void); -static void Heap_Sift (INT64 l, INT64 r, INT64 *a, LONGINT a__len); +static void Heap_Sift (INT64 l, INT64 r, INT64 *a, ADDRESS a__len); export void Heap_Unlock (void); extern void *Heap__init(); @@ -445,7 +445,7 @@ static void Heap_Scan (void) } } -static void Heap_Sift (INT64 l, INT64 r, INT64 *a, LONGINT a__len) +static void Heap_Sift (INT64 l, INT64 r, INT64 *a, ADDRESS a__len) { INT64 i, j, x; j = l; @@ -464,7 +464,7 @@ static void Heap_Sift (INT64 l, INT64 r, INT64 *a, LONGINT a__len) a[i] = x; } -static void Heap_HeapSort (INT64 n, INT64 *a, LONGINT a__len) +static void Heap_HeapSort (INT64 n, INT64 *a, ADDRESS a__len) { INT64 l, r, x; l = __ASHR(n, 1); @@ -482,7 +482,7 @@ static void Heap_HeapSort (INT64 n, INT64 *a, LONGINT a__len) } } -static void Heap_MarkCandidates (INT64 n, INT64 *cand, LONGINT cand__len) +static void Heap_MarkCandidates (INT64 n, INT64 *cand, ADDRESS cand__len) { INT64 chnk, adr, tag, next, lim, lim1, i, ptr, size; chnk = Heap_heap; @@ -571,7 +571,7 @@ void Heap_FINALL (void) } } -static void Heap_MarkStack (INT64 n, INT64 *cand, LONGINT cand__len) +static void Heap_MarkStack (INT64 n, INT64 *cand, ADDRESS cand__len) { SYSTEM_PTR frame; INT64 inc, nofcand, sp, p, stack0; diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index 163cad8c..bf12c17b 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 4e4d62e7..12ee85c4 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -47,21 +47,21 @@ export Modules_ModuleName Modules_imported, Modules_importing; export ADDRESS *Modules_ModuleDesc__typ; export ADDRESS *Modules_CmdDesc__typ; -static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len); +static void Modules_Append (CHAR *a, ADDRESS a__len, CHAR *b, ADDRESS b__len); export void Modules_AssertFail (INT32 code); static void Modules_DisplayHaltCode (INT32 code); -export void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all); +export void Modules_Free (CHAR *name, ADDRESS name__len, BOOLEAN all); export void Modules_Halt (INT32 code); -export Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len); -export Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len); +export Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, ADDRESS name__len); +export Modules_Module Modules_ThisMod (CHAR *name, ADDRESS name__len); static void Modules_errch (CHAR c); static void Modules_errint (INT32 l); -static void Modules_errstring (CHAR *s, LONGINT s__len); +static void Modules_errstring (CHAR *s, ADDRESS s__len); #define Modules_modules() (Modules_Module)Heap_modules #define Modules_setmodules(m) Heap_modules = m -static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len) +static void Modules_Append (CHAR *a, ADDRESS a__len, CHAR *b, ADDRESS b__len) { INT16 i, j; __DUP(b, b__len, CHAR); @@ -79,7 +79,7 @@ static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len) __DEL(b); } -Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len) +Modules_Module Modules_ThisMod (CHAR *name, ADDRESS name__len) { Modules_Module m = NIL; CHAR bodyname[64]; @@ -103,7 +103,7 @@ Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len) return m; } -Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len) +Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, ADDRESS name__len) { Modules_Cmd c = NIL; __DUP(name, name__len, CHAR); @@ -130,7 +130,7 @@ Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT nam __RETCHK; } -void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all) +void Modules_Free (CHAR *name, ADDRESS name__len, BOOLEAN all) { Modules_Module m = NIL, p = NIL; __DUP(name, name__len, CHAR); @@ -168,7 +168,7 @@ static void Modules_errch (CHAR c) e = Platform_Write(1, (ADDRESS)&c, 1); } -static void Modules_errstring (CHAR *s, LONGINT s__len) +static void Modules_errstring (CHAR *s, ADDRESS s__len) { INT32 i; __DUP(s, s__len, CHAR); diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index 8bb89fe5..b1f2385e 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h @@ -44,10 +44,10 @@ import ADDRESS *Modules_ModuleDesc__typ; import ADDRESS *Modules_CmdDesc__typ; import void Modules_AssertFail (INT32 code); -import void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all); +import void Modules_Free (CHAR *name, ADDRESS name__len, BOOLEAN all); import void Modules_Halt (INT32 code); -import Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len); -import Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len); +import Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, ADDRESS name__len); +import Modules_Module Modules_ThisMod (CHAR *name, ADDRESS name__len); import void *Modules__init(void); diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index 3ef8e2f9..bc44b83a 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index 0be714e8..eb93787e 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index ef4b429f..72e0feef 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -56,7 +56,7 @@ static void OPC_GenHeaderMsg (void); export void OPC_Halt (INT32 n); export void OPC_Ident (OPT_Object obj); static void OPC_IdentList (OPT_Object obj, INT16 vis); -static void OPC_Include (CHAR *name, LONGINT name__len); +static void OPC_Include (CHAR *name, ADDRESS name__len); static void OPC_IncludeImports (OPT_Object obj, INT16 vis); export void OPC_Increment (BOOLEAN decrement); export void OPC_Indent (INT16 count); @@ -68,11 +68,11 @@ static void OPC_InitTProcs (OPT_Object typ, OPT_Object obj); export void OPC_IntLiteral (INT64 n, INT32 size); export void OPC_Len (OPT_Object obj, OPT_Struct array, INT64 dim); static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName); -static INT16 OPC_Length (CHAR *s, LONGINT s__len); +static INT16 OPC_Length (CHAR *s, ADDRESS s__len); export BOOLEAN OPC_NeedsRetval (OPT_Object proc); export INT32 OPC_NofPtrs (OPT_Struct typ); -static INT16 OPC_PerfectHash (CHAR *s, LONGINT s__len); -static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len); +static INT16 OPC_PerfectHash (CHAR *s, ADDRESS s__len); +static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, ADDRESS y__len); static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define); static void OPC_ProcPredefs (OPT_Object obj, INT8 vis); static void OPC_PutBase (OPT_Struct typ); @@ -80,8 +80,8 @@ static void OPC_PutPtrOffsets (OPT_Struct typ, INT32 adr, INT32 *cnt); static void OPC_RegCmds (OPT_Object obj); export void OPC_SetInclude (BOOLEAN exclude); static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause); -static void OPC_Str1 (CHAR *s, LONGINT s__len, INT32 x); -static void OPC_StringLiteral (CHAR *s, LONGINT s__len, INT32 l); +static void OPC_Str1 (CHAR *s, ADDRESS s__len, INT32 x); +static void OPC_StringLiteral (CHAR *s, ADDRESS s__len, INT32 l); export void OPC_TDescDecl (OPT_Struct typ); export void OPC_TypeDefs (OPT_Object obj, INT16 vis); export void OPC_TypeOf (OPT_Object ap); @@ -137,7 +137,7 @@ void OPC_EndBlk0 (void) OPM_Write('}'); } -static void OPC_Str1 (CHAR *s, LONGINT s__len, INT32 x) +static void OPC_Str1 (CHAR *s, ADDRESS s__len, INT32 x) { CHAR ch; INT16 i; @@ -156,7 +156,7 @@ static void OPC_Str1 (CHAR *s, LONGINT s__len, INT32 x) __DEL(s); } -static INT16 OPC_Length (CHAR *s, LONGINT s__len) +static INT16 OPC_Length (CHAR *s, ADDRESS s__len) { INT16 i; i = 0; @@ -166,7 +166,7 @@ static INT16 OPC_Length (CHAR *s, LONGINT s__len) return i; } -static INT16 OPC_PerfectHash (CHAR *s, LONGINT s__len) +static INT16 OPC_PerfectHash (CHAR *s, ADDRESS s__len) { INT16 i, h; i = 0; @@ -364,7 +364,7 @@ static void OPC_DeclareBase (OPT_Object dcl) OPM_WriteString((CHAR*)"struct ", 8); OPC_BegBlk(); OPC_BegStat(); - OPC_Str1((CHAR*)"LONGINT len[#]", 15, nofdims); + OPC_Str1((CHAR*)"ADDRESS len[#]", 15, nofdims); OPC_EndStat(); OPC_BegStat(); __NEW(obj, OPT_ObjDesc); @@ -511,7 +511,7 @@ static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamNa typ = par->typ->BaseTyp; while (typ->comp == 3) { if (ansiDefine) { - OPM_WriteString((CHAR*)", LONGINT ", 11); + OPM_WriteString((CHAR*)", ADDRESS ", 11); } else { OPM_WriteString((CHAR*)", ", 3); } @@ -720,7 +720,7 @@ static void OPC_DefineType (OPT_Struct str) } } -static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len) +static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, ADDRESS y__len) { INT16 i; __DUP(y, y__len, CHAR); @@ -969,7 +969,7 @@ static void OPC_IdentList (OPT_Object obj, INT16 vis) OPC_EndStat(); OPC_BegStat(); base = OPT_linttyp; - OPM_WriteString((CHAR*)"LONGINT ", 9); + OPM_WriteString((CHAR*)"ADDRESS ", 9); OPC_LenList(obj, 0, 1); } else if ((obj->mode == 2 && obj->typ->comp == 4)) { OPC_EndStat(); @@ -1008,7 +1008,7 @@ static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames) __COPY(name, obj->name, 256); } if (obj->typ->comp == 3) { - OPM_WriteString((CHAR*)", LONGINT ", 11); + OPM_WriteString((CHAR*)", ADDRESS ", 11); OPC_LenList(obj, 1, showParamNames); } else if ((obj->mode == 2 && obj->typ->comp == 4)) { OPM_WriteString((CHAR*)", ADDRESS *", 12); @@ -1062,7 +1062,7 @@ static void OPC_ProcPredefs (OPT_Object obj, INT8 vis) } } -static void OPC_Include (CHAR *name, LONGINT name__len) +static void OPC_Include (CHAR *name, ADDRESS name__len) { __DUP(name, name__len, CHAR); OPM_WriteString((CHAR*)"#include ", 10); @@ -1744,7 +1744,7 @@ static void OPC_CharacterLiteral (INT64 c) } } -static void OPC_StringLiteral (CHAR *s, LONGINT s__len, INT32 l) +static void OPC_StringLiteral (CHAR *s, ADDRESS s__len, INT32 l) { INT32 i; INT16 c; @@ -1912,9 +1912,9 @@ static struct InitKeywords__46 { struct InitKeywords__46 *lnk; } *InitKeywords__46_s; -static void Enter__47 (CHAR *s, LONGINT s__len); +static void Enter__47 (CHAR *s, ADDRESS s__len); -static void Enter__47 (CHAR *s, LONGINT s__len) +static void Enter__47 (CHAR *s, ADDRESS s__len) { INT16 h; __DUP(s, s__len, CHAR); diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index 842e7dec..5624314d 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 60ab38c7..b2fd5536 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -53,26 +53,26 @@ export void OPM_FPrintLReal (INT32 *fp, LONGREAL val); export void OPM_FPrintReal (INT32 *fp, REAL val); export void OPM_FPrintSet (INT32 *fp, UINT64 val); static void OPM_FindLine (Files_File f, Files_Rider *r, ADDRESS *r__typ, INT64 pos); -static void OPM_FingerprintBytes (INT32 *fp, SYSTEM_BYTE *bytes, LONGINT bytes__len); +static void OPM_FingerprintBytes (INT32 *fp, SYSTEM_BYTE *bytes, ADDRESS bytes__len); export void OPM_Get (CHAR *ch); -export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); +export void OPM_Init (BOOLEAN *done, CHAR *mname, ADDRESS mname__len); export void OPM_InitOptions (void); export INT16 OPM_Integer (INT64 n); static void OPM_LogErrMsg (INT16 n); -export void OPM_LogVT100 (CHAR *vt100code, LONGINT vt100code__len); +export void OPM_LogVT100 (CHAR *vt100code, ADDRESS vt100code__len); export void OPM_LogW (CHAR ch); export void OPM_LogWLn (void); export void OPM_LogWNum (INT64 i, INT64 len); -export void OPM_LogWStr (CHAR *s, LONGINT s__len); +export void OPM_LogWStr (CHAR *s, ADDRESS s__len); export INT32 OPM_Longint (INT64 n); -static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len); +static void OPM_MakeFileName (CHAR *name, ADDRESS name__len, CHAR *FName, ADDRESS FName__len, CHAR *ext, ADDRESS ext__len); export void OPM_Mark (INT16 n, INT32 pos); -export void OPM_NewSym (CHAR *modName, LONGINT modName__len); -export void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); -export void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); +export void OPM_NewSym (CHAR *modName, ADDRESS modName__len); +export void OPM_OldSym (CHAR *modName, ADDRESS modName__len, BOOLEAN *done); +export void OPM_OpenFiles (CHAR *moduleName, ADDRESS moduleName__len); export BOOLEAN OPM_OpenPar (void); export void OPM_RegisterNewSym (void); -static void OPM_ScanOptions (CHAR *s, LONGINT s__len); +static void OPM_ScanOptions (CHAR *s, ADDRESS s__len); static void OPM_ShowLine (INT64 pos); export INT64 OPM_SignedMaximum (INT32 bytecount); export INT64 OPM_SignedMinimum (INT32 bytecount); @@ -93,8 +93,8 @@ export void OPM_WriteHex (INT64 i); export void OPM_WriteInt (INT64 i); export void OPM_WriteLn (void); export void OPM_WriteReal (LONGREAL r, CHAR suffx); -export void OPM_WriteString (CHAR *s, LONGINT s__len); -export void OPM_WriteStringVar (CHAR *s, LONGINT s__len); +export void OPM_WriteString (CHAR *s, ADDRESS s__len); +export void OPM_WriteStringVar (CHAR *s, ADDRESS s__len); export BOOLEAN OPM_eofSF (void); export void OPM_err (INT16 n); @@ -105,7 +105,7 @@ void OPM_LogW (CHAR ch) Out_Char(ch); } -void OPM_LogWStr (CHAR *s, LONGINT s__len) +void OPM_LogWStr (CHAR *s, ADDRESS s__len) { __DUP(s, s__len, CHAR); Out_String(s, s__len); @@ -122,7 +122,7 @@ void OPM_LogWLn (void) Out_Ln(); } -void OPM_LogVT100 (CHAR *vt100code, LONGINT vt100code__len) +void OPM_LogVT100 (CHAR *vt100code, ADDRESS vt100code__len) { __DUP(vt100code, vt100code__len, CHAR); if ((Out_IsConsole && !__IN(16, OPM_Options, 32))) { @@ -154,7 +154,7 @@ INT16 OPM_Integer (INT64 n) return __VAL(INT16, n); } -static void OPM_ScanOptions (CHAR *s, LONGINT s__len) +static void OPM_ScanOptions (CHAR *s, ADDRESS s__len) { INT16 i; __DUP(s, s__len, CHAR); @@ -465,7 +465,7 @@ void OPM_InitOptions (void) Files_SetSearchPath(searchpath, 1024); } -void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len) +void OPM_Init (BOOLEAN *done, CHAR *mname, ADDRESS mname__len) { Texts_Text T = NIL; INT32 beg, end, time; @@ -514,7 +514,7 @@ void OPM_Get (CHAR *ch) } } -static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len) +static void OPM_MakeFileName (CHAR *name, ADDRESS name__len, CHAR *FName, ADDRESS FName__len, CHAR *ext, ADDRESS ext__len) { INT16 i, j; CHAR ch; @@ -700,7 +700,7 @@ void OPM_err (INT16 n) OPM_Mark(n, OPM_errpos); } -static void OPM_FingerprintBytes (INT32 *fp, SYSTEM_BYTE *bytes, LONGINT bytes__len) +static void OPM_FingerprintBytes (INT32 *fp, SYSTEM_BYTE *bytes, ADDRESS bytes__len) { INT16 i; INT32 l; @@ -772,7 +772,7 @@ void OPM_CloseOldSym (void) Files_Close(Files_Base(&OPM_oldSF, Files_Rider__typ)); } -void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done) +void OPM_OldSym (CHAR *modName, ADDRESS modName__len, BOOLEAN *done) { CHAR tag, ver; OPM_FileName fileName; @@ -832,7 +832,7 @@ void OPM_DeleteNewSym (void) { } -void OPM_NewSym (CHAR *modName, LONGINT modName__len) +void OPM_NewSym (CHAR *modName, ADDRESS modName__len) { OPM_FileName fileName; OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, 32, (CHAR*)".sym", 5); @@ -851,7 +851,7 @@ void OPM_Write (CHAR ch) Files_Write(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, ch); } -void OPM_WriteString (CHAR *s, LONGINT s__len) +void OPM_WriteString (CHAR *s, ADDRESS s__len) { INT16 i; i = 0; @@ -861,7 +861,7 @@ void OPM_WriteString (CHAR *s, LONGINT s__len) Files_WriteBytes(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, (void*)s, s__len * 1, i); } -void OPM_WriteStringVar (CHAR *s, LONGINT s__len) +void OPM_WriteStringVar (CHAR *s, ADDRESS s__len) { INT16 i; i = 0; @@ -986,7 +986,7 @@ static void OPM_Append (Files_Rider *R, ADDRESS *R__typ, Files_File F) } } -void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len) +void OPM_OpenFiles (CHAR *moduleName, ADDRESS moduleName__len) { CHAR FName[32]; __COPY(moduleName, OPM_modName, 32); diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index 2d272feb..c310c421 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h @@ -28,19 +28,19 @@ import void OPM_FPrintLReal (INT32 *fp, LONGREAL val); import void OPM_FPrintReal (INT32 *fp, REAL val); import void OPM_FPrintSet (INT32 *fp, UINT64 val); import void OPM_Get (CHAR *ch); -import void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); +import void OPM_Init (BOOLEAN *done, CHAR *mname, ADDRESS mname__len); import void OPM_InitOptions (void); import INT16 OPM_Integer (INT64 n); -import void OPM_LogVT100 (CHAR *vt100code, LONGINT vt100code__len); +import void OPM_LogVT100 (CHAR *vt100code, ADDRESS vt100code__len); import void OPM_LogW (CHAR ch); import void OPM_LogWLn (void); import void OPM_LogWNum (INT64 i, INT64 len); -import void OPM_LogWStr (CHAR *s, LONGINT s__len); +import void OPM_LogWStr (CHAR *s, ADDRESS s__len); import INT32 OPM_Longint (INT64 n); import void OPM_Mark (INT16 n, INT32 pos); -import void OPM_NewSym (CHAR *modName, LONGINT modName__len); -import void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); -import void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); +import void OPM_NewSym (CHAR *modName, ADDRESS modName__len); +import void OPM_OldSym (CHAR *modName, ADDRESS modName__len, BOOLEAN *done); +import void OPM_OpenFiles (CHAR *moduleName, ADDRESS moduleName__len); import BOOLEAN OPM_OpenPar (void); import void OPM_RegisterNewSym (void); import INT64 OPM_SignedMaximum (INT32 bytecount); @@ -61,8 +61,8 @@ import void OPM_WriteHex (INT64 i); import void OPM_WriteInt (INT64 i); import void OPM_WriteLn (void); import void OPM_WriteReal (LONGREAL r, CHAR suffx); -import void OPM_WriteString (CHAR *s, LONGINT s__len); -import void OPM_WriteStringVar (CHAR *s, LONGINT s__len); +import void OPM_WriteString (CHAR *s, ADDRESS s__len); +import void OPM_WriteStringVar (CHAR *s, ADDRESS s__len); import BOOLEAN OPM_eofSF (void); import void OPM_err (INT16 n); import void *OPM__init(void); diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index df908a43..e6b89be2 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index 5a71eb39..acb2df91 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index 6ee700e5..7aedbbd6 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index 1f7a3e58..e49c222b 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index a8d42b40..4a900e78 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -120,7 +120,7 @@ static void OPT_EnterTyp (OPS_Name name, INT8 form, INT16 size, OPT_Struct *res) static void OPT_EnterTypeAlias (OPS_Name name, OPT_Object *res); export void OPT_Export (BOOLEAN *ext, BOOLEAN *new); export void OPT_FPrintErr (OPT_Object obj, INT16 errcode); -static void OPT_FPrintName (INT32 *fp, CHAR *name, LONGINT name__len); +static void OPT_FPrintName (INT32 *fp, CHAR *name, ADDRESS name__len); export void OPT_FPrintObj (OPT_Object obj); static void OPT_FPrintSign (INT32 *fp, OPT_Struct result, OPT_Object par); export void OPT_FPrintStr (OPT_Struct typ); @@ -132,7 +132,7 @@ export void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); static void OPT_InConstant (INT32 f, OPT_Const conval); static OPT_Object OPT_InFld (void); static void OPT_InMod (INT8 *mno); -static void OPT_InName (CHAR *name, LONGINT name__len); +static void OPT_InName (CHAR *name, ADDRESS name__len); static OPT_Object OPT_InObj (INT8 mno); static void OPT_InSign (INT8 mno, OPT_Struct *res, OPT_Object *par); static void OPT_InStruct (OPT_Struct *typ); @@ -155,7 +155,7 @@ static void OPT_OutConstant (OPT_Object obj); static void OPT_OutFlds (OPT_Object fld, INT32 adr, BOOLEAN visible); static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, INT32 adr); static void OPT_OutMod (INT16 mno); -static void OPT_OutName (CHAR *name, LONGINT name__len); +static void OPT_OutName (CHAR *name, ADDRESS name__len); static void OPT_OutObj (OPT_Object obj); static void OPT_OutSign (OPT_Struct result, OPT_Object par); static void OPT_OutStr (OPT_Struct typ); @@ -576,7 +576,7 @@ void OPT_Insert (OPS_Name name, OPT_Object *obj) *obj = ob1; } -static void OPT_FPrintName (INT32 *fp, CHAR *name, LONGINT name__len) +static void OPT_FPrintName (INT32 *fp, CHAR *name, ADDRESS name__len) { INT16 i; CHAR ch; @@ -957,7 +957,7 @@ void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old) } } -static void OPT_InName (CHAR *name, LONGINT name__len) +static void OPT_InName (CHAR *name, ADDRESS name__len) { INT16 i; CHAR ch; @@ -1483,7 +1483,7 @@ void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) } } -static void OPT_OutName (CHAR *name, LONGINT name__len) +static void OPT_OutName (CHAR *name, ADDRESS name__len) { INT16 i; CHAR ch; diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 90fcacf5..9d34cea9 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 4bd6b3fb..1b610f35 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index c4a61586..0f1980ac 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Out.c b/bootstrap/unix-88/Out.c index 39f383cf..82ad945b 100644 --- a/bootstrap/unix-88/Out.c +++ b/bootstrap/unix-88/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -17,16 +17,16 @@ static INT16 Out_in; export void Out_Char (CHAR ch); export void Out_Flush (void); export void Out_Int (INT64 x, INT64 n); -static INT32 Out_Length (CHAR *s, LONGINT s__len); +static INT32 Out_Length (CHAR *s, ADDRESS s__len); export void Out_Ln (void); export void Out_LongReal (LONGREAL x, INT16 n); export void Out_Open (void); export void Out_Real (REAL x, INT16 n); static void Out_RealP (LONGREAL x, INT16 n, BOOLEAN long_); -export void Out_String (CHAR *str, LONGINT str__len); +export void Out_String (CHAR *str, ADDRESS str__len); export LONGREAL Out_Ten (INT16 e); -static void Out_digit (INT64 n, CHAR *s, LONGINT s__len, INT16 *i); -static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, INT16 *i); +static void Out_digit (INT64 n, CHAR *s, ADDRESS s__len, INT16 *i); +static void Out_prepend (CHAR *t, ADDRESS t__len, CHAR *s, ADDRESS s__len, INT16 *i); #define Out_Entier64(x) (INT64)(x) @@ -55,7 +55,7 @@ void Out_Char (CHAR ch) } } -static INT32 Out_Length (CHAR *s, LONGINT s__len) +static INT32 Out_Length (CHAR *s, ADDRESS s__len) { INT32 l; l = 0; @@ -65,7 +65,7 @@ static INT32 Out_Length (CHAR *s, LONGINT s__len) return l; } -void Out_String (CHAR *str, LONGINT str__len) +void Out_String (CHAR *str, ADDRESS str__len) { INT32 l; INT16 error; @@ -125,13 +125,13 @@ void Out_Ln (void) Out_Flush(); } -static void Out_digit (INT64 n, CHAR *s, LONGINT s__len, INT16 *i) +static void Out_digit (INT64 n, CHAR *s, ADDRESS s__len, INT16 *i) { *i -= 1; s[__X(*i, s__len)] = (CHAR)(__MOD(n, 10) + 48); } -static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, INT16 *i) +static void Out_prepend (CHAR *t, ADDRESS t__len, CHAR *s, ADDRESS s__len, INT16 *i) { INT16 j; INT32 l; diff --git a/bootstrap/unix-88/Out.h b/bootstrap/unix-88/Out.h index 0e66420d..d58a17d5 100644 --- a/bootstrap/unix-88/Out.h +++ b/bootstrap/unix-88/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h @@ -16,7 +16,7 @@ import void Out_Ln (void); import void Out_LongReal (LONGREAL x, INT16 n); import void Out_Open (void); import void Out_Real (REAL x, INT16 n); -import void Out_String (CHAR *str, LONGINT str__len); +import void Out_String (CHAR *str, ADDRESS str__len); import LONGREAL Out_Ten (INT16 e); import void *Out__init(void); diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 46e18441..543ed88a 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -45,35 +45,35 @@ export CHAR Platform_NL[3]; export ADDRESS *Platform_FileIdentity__typ; export BOOLEAN Platform_Absent (INT16 e); -export INT16 Platform_ArgPos (CHAR *s, LONGINT s__len); -export INT16 Platform_Chdir (CHAR *n, LONGINT n__len); +export INT16 Platform_ArgPos (CHAR *s, ADDRESS s__len); +export INT16 Platform_Chdir (CHAR *n, ADDRESS n__len); export INT16 Platform_Close (INT32 h); export BOOLEAN Platform_ConnectionFailed (INT16 e); export void Platform_Delay (INT32 ms); export BOOLEAN Platform_DifferentFilesystems (INT16 e); export INT16 Platform_Error (void); export void Platform_Exit (INT32 code); -export void Platform_GetArg (INT16 n, CHAR *val, LONGINT val__len); +export void Platform_GetArg (INT16 n, CHAR *val, ADDRESS val__len); export void Platform_GetClock (INT32 *t, INT32 *d); -export void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); +export void Platform_GetEnv (CHAR *var, ADDRESS var__len, CHAR *val, ADDRESS val__len); export void Platform_GetIntArg (INT16 n, INT32 *val); export void Platform_GetTimeOfDay (INT32 *sec, INT32 *usec); export INT16 Platform_Identify (INT32 h, Platform_FileIdentity *identity, ADDRESS *identity__typ); -export INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ); +export INT16 Platform_IdentifyByName (CHAR *n, ADDRESS n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ); export BOOLEAN Platform_Inaccessible (INT16 e); export void Platform_Init (INT32 argc, INT64 argvadr); export BOOLEAN Platform_Interrupted (INT16 e); export BOOLEAN Platform_IsConsole (INT32 h); export void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d); -export INT16 Platform_New (CHAR *n, LONGINT n__len, INT32 *h); +export INT16 Platform_New (CHAR *n, ADDRESS n__len, INT32 *h); export BOOLEAN Platform_NoSuchDirectory (INT16 e); export INT64 Platform_OSAllocate (INT64 size); export void Platform_OSFree (INT64 address); -export INT16 Platform_OldRO (CHAR *n, LONGINT n__len, INT32 *h); -export INT16 Platform_OldRW (CHAR *n, LONGINT n__len, INT32 *h); +export INT16 Platform_OldRO (CHAR *n, ADDRESS n__len, INT32 *h); +export INT16 Platform_OldRW (CHAR *n, ADDRESS n__len, INT32 *h); export INT16 Platform_Read (INT32 h, INT64 p, INT32 l, INT32 *n); -export INT16 Platform_ReadBuf (INT32 h, SYSTEM_BYTE *b, LONGINT b__len, INT32 *n); -export INT16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); +export INT16 Platform_ReadBuf (INT32 h, SYSTEM_BYTE *b, ADDRESS b__len, INT32 *n); +export INT16 Platform_Rename (CHAR *o, ADDRESS o__len, CHAR *n, ADDRESS n__len); export BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); export BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); export INT16 Platform_Seek (INT32 h, INT32 offset, INT16 whence); @@ -83,16 +83,16 @@ export void Platform_SetMTime (Platform_FileIdentity *target, ADDRESS *target__t export void Platform_SetQuitHandler (Platform_SignalHandler handler); export INT16 Platform_Size (INT32 h, INT32 *l); export INT16 Platform_Sync (INT32 h); -export INT16 Platform_System (CHAR *cmd, LONGINT cmd__len); +export INT16 Platform_System (CHAR *cmd, ADDRESS cmd__len); static void Platform_TestLittleEndian (void); export INT32 Platform_Time (void); export BOOLEAN Platform_TimedOut (INT16 e); export BOOLEAN Platform_TooManyFiles (INT16 e); export INT16 Platform_Truncate (INT32 h, INT32 l); -export INT16 Platform_Unlink (CHAR *n, LONGINT n__len); +export INT16 Platform_Unlink (CHAR *n, ADDRESS n__len); export INT16 Platform_Write (INT32 h, INT64 p, INT32 l); static void Platform_YMDHMStoClock (INT32 ye, INT32 mo, INT32 da, INT32 ho, INT32 mi, INT32 se, INT32 *t, INT32 *d); -export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); +export BOOLEAN Platform_getEnv (CHAR *var, ADDRESS var__len, CHAR *val, ADDRESS val__len); #include #include @@ -223,7 +223,7 @@ void Platform_Init (INT32 argc, INT64 argvadr) Platform_HeapInitHeap(); } -BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len) +BOOLEAN Platform_getEnv (CHAR *var, ADDRESS var__len, CHAR *val, ADDRESS val__len) { Platform_EnvPtr p = NIL; __DUP(var, var__len, CHAR); @@ -235,7 +235,7 @@ BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__le return p != NIL; } -void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len) +void Platform_GetEnv (CHAR *var, ADDRESS var__len, CHAR *val, ADDRESS val__len) { __DUP(var, var__len, CHAR); if (!Platform_getEnv(var, var__len, (void*)val, val__len)) { @@ -244,7 +244,7 @@ void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len) __DEL(var); } -void Platform_GetArg (INT16 n, CHAR *val, LONGINT val__len) +void Platform_GetArg (INT16 n, CHAR *val, ADDRESS val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { @@ -279,7 +279,7 @@ void Platform_GetIntArg (INT16 n, INT32 *val) } } -INT16 Platform_ArgPos (CHAR *s, LONGINT s__len) +INT16 Platform_ArgPos (CHAR *s, ADDRESS s__len) { INT16 i; CHAR arg[256]; @@ -345,7 +345,7 @@ void Platform_Delay (INT32 ms) Platform_nanosleep(s, ns); } -INT16 Platform_System (CHAR *cmd, LONGINT cmd__len) +INT16 Platform_System (CHAR *cmd, ADDRESS cmd__len) { __DUP(cmd, cmd__len, CHAR); __DEL(cmd); @@ -357,7 +357,7 @@ INT16 Platform_Error (void) return Platform_err(); } -INT16 Platform_OldRO (CHAR *n, LONGINT n__len, INT32 *h) +INT16 Platform_OldRO (CHAR *n, ADDRESS n__len, INT32 *h) { INT16 fd; fd = Platform_openro(n, n__len); @@ -370,7 +370,7 @@ INT16 Platform_OldRO (CHAR *n, LONGINT n__len, INT32 *h) __RETCHK; } -INT16 Platform_OldRW (CHAR *n, LONGINT n__len, INT32 *h) +INT16 Platform_OldRW (CHAR *n, ADDRESS n__len, INT32 *h) { INT16 fd; fd = Platform_openrw(n, n__len); @@ -383,7 +383,7 @@ INT16 Platform_OldRW (CHAR *n, LONGINT n__len, INT32 *h) __RETCHK; } -INT16 Platform_New (CHAR *n, LONGINT n__len, INT32 *h) +INT16 Platform_New (CHAR *n, ADDRESS n__len, INT32 *h) { INT16 fd; fd = Platform_opennew(n, n__len); @@ -423,7 +423,7 @@ INT16 Platform_Identify (INT32 h, Platform_FileIdentity *identity, ADDRESS *iden return 0; } -INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ) +INT16 Platform_IdentifyByName (CHAR *n, ADDRESS n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ) { __DUP(n, n__len, CHAR); Platform_structstats(); @@ -481,7 +481,7 @@ INT16 Platform_Read (INT32 h, INT64 p, INT32 l, INT32 *n) __RETCHK; } -INT16 Platform_ReadBuf (INT32 h, SYSTEM_BYTE *b, LONGINT b__len, INT32 *n) +INT16 Platform_ReadBuf (INT32 h, SYSTEM_BYTE *b, ADDRESS b__len, INT32 *n) { *n = Platform_readfile(h, (ADDRESS)b, b__len); if (*n < 0) { @@ -535,7 +535,7 @@ INT16 Platform_Truncate (INT32 h, INT32 l) __RETCHK; } -INT16 Platform_Unlink (CHAR *n, LONGINT n__len) +INT16 Platform_Unlink (CHAR *n, ADDRESS n__len) { if (Platform_unlink(n, n__len) < 0) { return Platform_err(); @@ -545,7 +545,7 @@ INT16 Platform_Unlink (CHAR *n, LONGINT n__len) __RETCHK; } -INT16 Platform_Chdir (CHAR *n, LONGINT n__len) +INT16 Platform_Chdir (CHAR *n, ADDRESS n__len) { INT16 r; if ((Platform_chdir(n, n__len) >= 0 && Platform_getcwd((void*)Platform_CWD, 256) != NIL)) { @@ -556,7 +556,7 @@ INT16 Platform_Chdir (CHAR *n, LONGINT n__len) __RETCHK; } -INT16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) +INT16 Platform_Rename (CHAR *o, ADDRESS o__len, CHAR *n, ADDRESS n__len) { if (Platform_rename(o, o__len, n, n__len) < 0) { return Platform_err(); diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index 80307386..bfe37a2c 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h @@ -27,35 +27,35 @@ import CHAR Platform_NL[3]; import ADDRESS *Platform_FileIdentity__typ; import BOOLEAN Platform_Absent (INT16 e); -import INT16 Platform_ArgPos (CHAR *s, LONGINT s__len); -import INT16 Platform_Chdir (CHAR *n, LONGINT n__len); +import INT16 Platform_ArgPos (CHAR *s, ADDRESS s__len); +import INT16 Platform_Chdir (CHAR *n, ADDRESS n__len); import INT16 Platform_Close (INT32 h); import BOOLEAN Platform_ConnectionFailed (INT16 e); import void Platform_Delay (INT32 ms); import BOOLEAN Platform_DifferentFilesystems (INT16 e); import INT16 Platform_Error (void); import void Platform_Exit (INT32 code); -import void Platform_GetArg (INT16 n, CHAR *val, LONGINT val__len); +import void Platform_GetArg (INT16 n, CHAR *val, ADDRESS val__len); import void Platform_GetClock (INT32 *t, INT32 *d); -import void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); +import void Platform_GetEnv (CHAR *var, ADDRESS var__len, CHAR *val, ADDRESS val__len); import void Platform_GetIntArg (INT16 n, INT32 *val); import void Platform_GetTimeOfDay (INT32 *sec, INT32 *usec); import INT16 Platform_Identify (INT32 h, Platform_FileIdentity *identity, ADDRESS *identity__typ); -import INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ); +import INT16 Platform_IdentifyByName (CHAR *n, ADDRESS n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ); import BOOLEAN Platform_Inaccessible (INT16 e); import void Platform_Init (INT32 argc, INT64 argvadr); import BOOLEAN Platform_Interrupted (INT16 e); import BOOLEAN Platform_IsConsole (INT32 h); import void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d); -import INT16 Platform_New (CHAR *n, LONGINT n__len, INT32 *h); +import INT16 Platform_New (CHAR *n, ADDRESS n__len, INT32 *h); import BOOLEAN Platform_NoSuchDirectory (INT16 e); import INT64 Platform_OSAllocate (INT64 size); import void Platform_OSFree (INT64 address); -import INT16 Platform_OldRO (CHAR *n, LONGINT n__len, INT32 *h); -import INT16 Platform_OldRW (CHAR *n, LONGINT n__len, INT32 *h); +import INT16 Platform_OldRO (CHAR *n, ADDRESS n__len, INT32 *h); +import INT16 Platform_OldRW (CHAR *n, ADDRESS n__len, INT32 *h); import INT16 Platform_Read (INT32 h, INT64 p, INT32 l, INT32 *n); -import INT16 Platform_ReadBuf (INT32 h, SYSTEM_BYTE *b, LONGINT b__len, INT32 *n); -import INT16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); +import INT16 Platform_ReadBuf (INT32 h, SYSTEM_BYTE *b, ADDRESS b__len, INT32 *n); +import INT16 Platform_Rename (CHAR *o, ADDRESS o__len, CHAR *n, ADDRESS n__len); import BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); import BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); import INT16 Platform_Seek (INT32 h, INT32 offset, INT16 whence); @@ -65,14 +65,14 @@ import void Platform_SetMTime (Platform_FileIdentity *target, ADDRESS *target__t import void Platform_SetQuitHandler (Platform_SignalHandler handler); import INT16 Platform_Size (INT32 h, INT32 *l); import INT16 Platform_Sync (INT32 h); -import INT16 Platform_System (CHAR *cmd, LONGINT cmd__len); +import INT16 Platform_System (CHAR *cmd, ADDRESS cmd__len); import INT32 Platform_Time (void); import BOOLEAN Platform_TimedOut (INT16 e); import BOOLEAN Platform_TooManyFiles (INT16 e); import INT16 Platform_Truncate (INT32 h, INT32 l); -import INT16 Platform_Unlink (CHAR *n, LONGINT n__len); +import INT16 Platform_Unlink (CHAR *n, ADDRESS n__len); import INT16 Platform_Write (INT32 h, INT64 p, INT32 l); -import BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); +import BOOLEAN Platform_getEnv (CHAR *var, ADDRESS var__len, CHAR *val, ADDRESS val__len); import void *Platform__init(void); diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index cd4c3c61..be3ad909 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -10,11 +10,11 @@ -static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LONGINT d__len); -export void Reals_Convert (REAL x, INT16 n, CHAR *d, LONGINT d__len); -export void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len); -export void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len); -export void Reals_ConvertL (LONGREAL x, INT16 n, CHAR *d, LONGINT d__len); +static void Reals_BytesToHex (SYSTEM_BYTE *b, ADDRESS b__len, SYSTEM_BYTE *d, ADDRESS d__len); +export void Reals_Convert (REAL x, INT16 n, CHAR *d, ADDRESS d__len); +export void Reals_ConvertH (REAL y, CHAR *d, ADDRESS d__len); +export void Reals_ConvertHL (LONGREAL x, CHAR *d, ADDRESS d__len); +export void Reals_ConvertL (LONGREAL x, INT16 n, CHAR *d, ADDRESS d__len); export INT16 Reals_Expo (REAL x); export INT16 Reals_ExpoL (LONGREAL x); export void Reals_SetExpo (REAL *x, INT16 ex); @@ -79,7 +79,7 @@ INT16 Reals_ExpoL (LONGREAL x) return __MASK(__ASHR(i, 4), -2048); } -void Reals_ConvertL (LONGREAL x, INT16 n, CHAR *d, LONGINT d__len) +void Reals_ConvertL (LONGREAL x, INT16 n, CHAR *d, ADDRESS d__len) { INT32 i, j, k; if (x < (LONGREAL)0) { @@ -107,7 +107,7 @@ void Reals_ConvertL (LONGREAL x, INT16 n, CHAR *d, LONGINT d__len) } } -void Reals_Convert (REAL x, INT16 n, CHAR *d, LONGINT d__len) +void Reals_Convert (REAL x, INT16 n, CHAR *d, ADDRESS d__len) { Reals_ConvertL(x, n, (void*)d, d__len); } @@ -122,7 +122,7 @@ static CHAR Reals_ToHex (INT16 i) __RETCHK; } -static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LONGINT d__len) +static void Reals_BytesToHex (SYSTEM_BYTE *b, ADDRESS b__len, SYSTEM_BYTE *d, ADDRESS d__len) { INT16 i; INT32 l; @@ -137,12 +137,12 @@ static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LO } } -void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len) +void Reals_ConvertH (REAL y, CHAR *d, ADDRESS d__len) { Reals_BytesToHex((void*)&y, 4, (void*)d, d__len * 1); } -void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len) +void Reals_ConvertHL (LONGREAL x, CHAR *d, ADDRESS d__len) { Reals_BytesToHex((void*)&x, 8, (void*)d, d__len * 1); } diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index f0c84ab1..e8d15a2f 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h @@ -8,10 +8,10 @@ -import void Reals_Convert (REAL x, INT16 n, CHAR *d, LONGINT d__len); -import void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len); -import void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len); -import void Reals_ConvertL (LONGREAL x, INT16 n, CHAR *d, LONGINT d__len); +import void Reals_Convert (REAL x, INT16 n, CHAR *d, ADDRESS d__len); +import void Reals_ConvertH (REAL y, CHAR *d, ADDRESS d__len); +import void Reals_ConvertHL (LONGREAL x, CHAR *d, ADDRESS d__len); +import void Reals_ConvertL (LONGREAL x, INT16 n, CHAR *d, ADDRESS d__len); import INT16 Reals_Expo (REAL x); import INT16 Reals_ExpoL (LONGREAL x); import void Reals_SetExpo (REAL *x, INT16 ex); diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index b5707327..fd550df3 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -10,18 +10,18 @@ -export void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len); -export void Strings_Cap (CHAR *s, LONGINT s__len); -export void Strings_Delete (CHAR *s, LONGINT s__len, INT16 pos, INT16 n); -export void Strings_Extract (CHAR *source, LONGINT source__len, INT16 pos, INT16 n, CHAR *dest, LONGINT dest__len); -export void Strings_Insert (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len); -export INT16 Strings_Length (CHAR *s, LONGINT s__len); -export BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len); -export INT16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, INT16 pos); -export void Strings_Replace (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len); +export void Strings_Append (CHAR *extra, ADDRESS extra__len, CHAR *dest, ADDRESS dest__len); +export void Strings_Cap (CHAR *s, ADDRESS s__len); +export void Strings_Delete (CHAR *s, ADDRESS s__len, INT16 pos, INT16 n); +export void Strings_Extract (CHAR *source, ADDRESS source__len, INT16 pos, INT16 n, CHAR *dest, ADDRESS dest__len); +export void Strings_Insert (CHAR *source, ADDRESS source__len, INT16 pos, CHAR *dest, ADDRESS dest__len); +export INT16 Strings_Length (CHAR *s, ADDRESS s__len); +export BOOLEAN Strings_Match (CHAR *string, ADDRESS string__len, CHAR *pattern, ADDRESS pattern__len); +export INT16 Strings_Pos (CHAR *pattern, ADDRESS pattern__len, CHAR *s, ADDRESS s__len, INT16 pos); +export void Strings_Replace (CHAR *source, ADDRESS source__len, INT16 pos, CHAR *dest, ADDRESS dest__len); -INT16 Strings_Length (CHAR *s, LONGINT s__len) +INT16 Strings_Length (CHAR *s, ADDRESS s__len) { INT32 i; __DUP(s, s__len, CHAR); @@ -39,7 +39,7 @@ INT16 Strings_Length (CHAR *s, LONGINT s__len) __RETCHK; } -void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len) +void Strings_Append (CHAR *extra, ADDRESS extra__len, CHAR *dest, ADDRESS dest__len) { INT16 n1, n2, i; __DUP(extra, extra__len, CHAR); @@ -56,7 +56,7 @@ void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__ __DEL(extra); } -void Strings_Insert (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len) +void Strings_Insert (CHAR *source, ADDRESS source__len, INT16 pos, CHAR *dest, ADDRESS dest__len) { INT16 n1, n2, i; __DUP(source, source__len, CHAR); @@ -87,7 +87,7 @@ void Strings_Insert (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, L __DEL(source); } -void Strings_Delete (CHAR *s, LONGINT s__len, INT16 pos, INT16 n) +void Strings_Delete (CHAR *s, ADDRESS s__len, INT16 pos, INT16 n) { INT16 len, i; len = Strings_Length(s, s__len); @@ -110,7 +110,7 @@ void Strings_Delete (CHAR *s, LONGINT s__len, INT16 pos, INT16 n) } } -void Strings_Replace (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len) +void Strings_Replace (CHAR *source, ADDRESS source__len, INT16 pos, CHAR *dest, ADDRESS dest__len) { __DUP(source, source__len, CHAR); Strings_Delete((void*)dest, dest__len, pos, pos + Strings_Length(source, source__len)); @@ -118,7 +118,7 @@ void Strings_Replace (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, __DEL(source); } -void Strings_Extract (CHAR *source, LONGINT source__len, INT16 pos, INT16 n, CHAR *dest, LONGINT dest__len) +void Strings_Extract (CHAR *source, ADDRESS source__len, INT16 pos, INT16 n, CHAR *dest, ADDRESS dest__len) { INT16 len, destLen, i; __DUP(source, source__len, CHAR); @@ -143,7 +143,7 @@ void Strings_Extract (CHAR *source, LONGINT source__len, INT16 pos, INT16 n, CHA __DEL(source); } -INT16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, INT16 pos) +INT16 Strings_Pos (CHAR *pattern, ADDRESS pattern__len, CHAR *s, ADDRESS s__len, INT16 pos) { INT16 n1, n2, i, j; __DUP(pattern, pattern__len, CHAR); @@ -175,7 +175,7 @@ INT16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, return -1; } -void Strings_Cap (CHAR *s, LONGINT s__len) +void Strings_Cap (CHAR *s, ADDRESS s__len) { INT16 i; i = 0; @@ -191,9 +191,9 @@ static struct Match__7 { struct Match__7 *lnk; } *Match__7_s; -static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, INT16 n, INT16 m); +static BOOLEAN M__8 (CHAR *name, ADDRESS name__len, CHAR *mask, ADDRESS mask__len, INT16 n, INT16 m); -static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, INT16 n, INT16 m) +static BOOLEAN M__8 (CHAR *name, ADDRESS name__len, CHAR *mask, ADDRESS mask__len, INT16 n, INT16 m) { while ((((n >= 0 && m >= 0)) && mask[__X(m, mask__len)] != '*')) { if (name[__X(n, name__len)] != mask[__X(m, mask__len)]) { @@ -220,7 +220,7 @@ static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__le return 0; } -BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len) +BOOLEAN Strings_Match (CHAR *string, ADDRESS string__len, CHAR *pattern, ADDRESS pattern__len) { struct Match__7 _s; BOOLEAN __retval; diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index c987af8d..76cb022d 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h @@ -8,15 +8,15 @@ -import void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len); -import void Strings_Cap (CHAR *s, LONGINT s__len); -import void Strings_Delete (CHAR *s, LONGINT s__len, INT16 pos, INT16 n); -import void Strings_Extract (CHAR *source, LONGINT source__len, INT16 pos, INT16 n, CHAR *dest, LONGINT dest__len); -import void Strings_Insert (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len); -import INT16 Strings_Length (CHAR *s, LONGINT s__len); -import BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len); -import INT16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, INT16 pos); -import void Strings_Replace (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len); +import void Strings_Append (CHAR *extra, ADDRESS extra__len, CHAR *dest, ADDRESS dest__len); +import void Strings_Cap (CHAR *s, ADDRESS s__len); +import void Strings_Delete (CHAR *s, ADDRESS s__len, INT16 pos, INT16 n); +import void Strings_Extract (CHAR *source, ADDRESS source__len, INT16 pos, INT16 n, CHAR *dest, ADDRESS dest__len); +import void Strings_Insert (CHAR *source, ADDRESS source__len, INT16 pos, CHAR *dest, ADDRESS dest__len); +import INT16 Strings_Length (CHAR *s, ADDRESS s__len); +import BOOLEAN Strings_Match (CHAR *string, ADDRESS string__len, CHAR *pattern, ADDRESS pattern__len); +import INT16 Strings_Pos (CHAR *pattern, ADDRESS pattern__len, CHAR *s, ADDRESS s__len, INT16 pos); +import void Strings_Replace (CHAR *source, ADDRESS source__len, INT16 pos, CHAR *dest, ADDRESS dest__len); import void *Strings__init(void); diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index ae12961b..7182a772 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -187,20 +187,20 @@ export void Texts_Append (Texts_Text T, Texts_Buffer B); export void Texts_ChangeLooks (Texts_Text T, INT32 beg, INT32 end, UINT32 sel, Texts_FontsFont fnt, INT8 col, INT8 voff); static Texts_Elem Texts_CloneElem (Texts_Elem e); static Texts_Piece Texts_ClonePiece (Texts_Piece p); -export void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len); +export void Texts_Close (Texts_Text T, CHAR *name, ADDRESS name__len); export void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); export void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); export void Texts_Delete (Texts_Text T, INT32 beg, INT32 end); export Texts_Text Texts_ElemBase (Texts_Elem E); export INT32 Texts_ElemPos (Texts_Elem E); static void Texts_Find (Texts_Text T, INT32 *pos, Texts_Run *u, INT32 *org, INT32 *off); -static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len); +static Texts_FontsFont Texts_FontsThis (CHAR *name, ADDRESS name__len); static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, ADDRESS *msg__typ); export void Texts_Insert (Texts_Text T, INT32 pos, Texts_Buffer B); export void Texts_Load (Files_Rider *r, ADDRESS *r__typ, Texts_Text T); static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T); static void Texts_Merge (Texts_Text T, Texts_Run u, Texts_Run *v); -export void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len); +export void Texts_Open (Texts_Text T, CHAR *name, ADDRESS name__len); export void Texts_OpenBuf (Texts_Buffer B); export void Texts_OpenReader (Texts_Reader *R, ADDRESS *R__typ, Texts_Text T, INT32 pos); export void Texts_OpenScanner (Texts_Scanner *S, ADDRESS *S__typ, Texts_Text T, INT32 pos); @@ -229,10 +229,10 @@ export void Texts_WriteLongRealHex (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x export void Texts_WriteReal (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n); export void Texts_WriteRealFix (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n, INT16 k); export void Texts_WriteRealHex (Texts_Writer *W, ADDRESS *W__typ, REAL x); -export void Texts_WriteString (Texts_Writer *W, ADDRESS *W__typ, CHAR *s, LONGINT s__len); +export void Texts_WriteString (Texts_Writer *W, ADDRESS *W__typ, CHAR *s, ADDRESS s__len); -static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len) +static Texts_FontsFont Texts_FontsThis (CHAR *name, ADDRESS name__len) { Texts_FontsFont F = NIL; __NEW(F, Texts_FontDesc); @@ -1027,7 +1027,7 @@ void Texts_WriteLn (Texts_Writer *W, ADDRESS *W__typ) Texts_Write(&*W, W__typ, 0x0d); } -void Texts_WriteString (Texts_Writer *W, ADDRESS *W__typ, CHAR *s, LONGINT s__len) +void Texts_WriteString (Texts_Writer *W, ADDRESS *W__typ, CHAR *s, ADDRESS s__len) { INT16 i; __DUP(s, s__len, CHAR); @@ -1539,7 +1539,7 @@ void Texts_Load (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) Texts_Load0(&*r, r__typ, T); } -void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len) +void Texts_Open (Texts_Text T, CHAR *name, ADDRESS name__len) { Files_File f = NIL; Files_Rider r; @@ -1755,7 +1755,7 @@ void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) Store__39_s = _s.lnk; } -void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len) +void Texts_Close (Texts_Text T, CHAR *name, ADDRESS name__len) { Files_File f = NIL; Files_Rider r; diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index 61a97dda..e8735b00 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h @@ -131,7 +131,7 @@ import ADDRESS *Texts_Writer__typ; import void Texts_Append (Texts_Text T, Texts_Buffer B); import void Texts_ChangeLooks (Texts_Text T, INT32 beg, INT32 end, UINT32 sel, Texts_FontsFont fnt, INT8 col, INT8 voff); -import void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len); +import void Texts_Close (Texts_Text T, CHAR *name, ADDRESS name__len); import void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); import void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); import void Texts_Delete (Texts_Text T, INT32 beg, INT32 end); @@ -139,7 +139,7 @@ import Texts_Text Texts_ElemBase (Texts_Elem E); import INT32 Texts_ElemPos (Texts_Elem E); import void Texts_Insert (Texts_Text T, INT32 pos, Texts_Buffer B); import void Texts_Load (Files_Rider *r, ADDRESS *r__typ, Texts_Text T); -import void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len); +import void Texts_Open (Texts_Text T, CHAR *name, ADDRESS name__len); import void Texts_OpenBuf (Texts_Buffer B); import void Texts_OpenReader (Texts_Reader *R, ADDRESS *R__typ, Texts_Text T, INT32 pos); import void Texts_OpenScanner (Texts_Scanner *S, ADDRESS *S__typ, Texts_Text T, INT32 pos); @@ -166,7 +166,7 @@ import void Texts_WriteLongRealHex (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x import void Texts_WriteReal (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n); import void Texts_WriteRealFix (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n, INT16 k); import void Texts_WriteRealHex (Texts_Writer *W, ADDRESS *W__typ, REAL x); -import void Texts_WriteString (Texts_Writer *W, ADDRESS *W__typ, CHAR *s, LONGINT s__len); +import void Texts_WriteString (Texts_Writer *W, ADDRESS *W__typ, CHAR *s, ADDRESS s__len); import void *Texts__init(void); diff --git a/bootstrap/unix-88/VT100.c b/bootstrap/unix-88/VT100.c index f69fd90e..38c0743f 100644 --- a/bootstrap/unix-88/VT100.c +++ b/bootstrap/unix-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -27,23 +27,23 @@ export void VT100_DECTCEMl (void); export void VT100_DSR (INT16 n); export void VT100_ED (INT16 n); export void VT100_EL (INT16 n); -static void VT100_EscSeq (INT16 n, CHAR *letter, LONGINT letter__len); -static void VT100_EscSeq0 (CHAR *letter, LONGINT letter__len); -static void VT100_EscSeq2 (INT16 n, INT16 m, CHAR *letter, LONGINT letter__len); -static void VT100_EscSeqSwapped (INT16 n, CHAR *letter, LONGINT letter__len); +static void VT100_EscSeq (INT16 n, CHAR *letter, ADDRESS letter__len); +static void VT100_EscSeq0 (CHAR *letter, ADDRESS letter__len); +static void VT100_EscSeq2 (INT16 n, INT16 m, CHAR *letter, ADDRESS letter__len); +static void VT100_EscSeqSwapped (INT16 n, CHAR *letter, ADDRESS letter__len); export void VT100_HVP (INT16 n, INT16 m); -export void VT100_IntToStr (INT32 int_, CHAR *str, LONGINT str__len); +export void VT100_IntToStr (INT32 int_, CHAR *str, ADDRESS str__len); export void VT100_RCP (void); -static void VT100_Reverse0 (CHAR *str, LONGINT str__len, INT16 start, INT16 end); +static void VT100_Reverse0 (CHAR *str, ADDRESS str__len, INT16 start, INT16 end); export void VT100_SCP (void); export void VT100_SD (INT16 n); export void VT100_SGR (INT16 n); export void VT100_SGR2 (INT16 n, INT16 m); export void VT100_SU (INT16 n); -export void VT100_SetAttr (CHAR *attr, LONGINT attr__len); +export void VT100_SetAttr (CHAR *attr, ADDRESS attr__len); -static void VT100_Reverse0 (CHAR *str, LONGINT str__len, INT16 start, INT16 end) +static void VT100_Reverse0 (CHAR *str, ADDRESS str__len, INT16 start, INT16 end) { CHAR h; while (start < end) { @@ -55,7 +55,7 @@ static void VT100_Reverse0 (CHAR *str, LONGINT str__len, INT16 start, INT16 end) } } -void VT100_IntToStr (INT32 int_, CHAR *str, LONGINT str__len) +void VT100_IntToStr (INT32 int_, CHAR *str, ADDRESS str__len) { CHAR b[21]; INT16 s, e; @@ -84,7 +84,7 @@ void VT100_IntToStr (INT32 int_, CHAR *str, LONGINT str__len) __COPY(b, str, str__len); } -static void VT100_EscSeq0 (CHAR *letter, LONGINT letter__len) +static void VT100_EscSeq0 (CHAR *letter, ADDRESS letter__len) { CHAR cmd[9]; __DUP(letter, letter__len, CHAR); @@ -94,7 +94,7 @@ static void VT100_EscSeq0 (CHAR *letter, LONGINT letter__len) __DEL(letter); } -static void VT100_EscSeq (INT16 n, CHAR *letter, LONGINT letter__len) +static void VT100_EscSeq (INT16 n, CHAR *letter, ADDRESS letter__len) { CHAR nstr[2]; CHAR cmd[7]; @@ -107,7 +107,7 @@ static void VT100_EscSeq (INT16 n, CHAR *letter, LONGINT letter__len) __DEL(letter); } -static void VT100_EscSeqSwapped (INT16 n, CHAR *letter, LONGINT letter__len) +static void VT100_EscSeqSwapped (INT16 n, CHAR *letter, ADDRESS letter__len) { CHAR nstr[2]; CHAR cmd[7]; @@ -120,7 +120,7 @@ static void VT100_EscSeqSwapped (INT16 n, CHAR *letter, LONGINT letter__len) __DEL(letter); } -static void VT100_EscSeq2 (INT16 n, INT16 m, CHAR *letter, LONGINT letter__len) +static void VT100_EscSeq2 (INT16 n, INT16 m, CHAR *letter, ADDRESS letter__len) { CHAR nstr[5], mstr[5]; CHAR cmd[12]; @@ -236,7 +236,7 @@ void VT100_DECTCEMh (void) VT100_EscSeq0((CHAR*)"\?25h", 5); } -void VT100_SetAttr (CHAR *attr, LONGINT attr__len) +void VT100_SetAttr (CHAR *attr, ADDRESS attr__len) { CHAR tmpstr[16]; __DUP(attr, attr__len, CHAR); diff --git a/bootstrap/unix-88/VT100.h b/bootstrap/unix-88/VT100.h index d99406ec..4bbb3110 100644 --- a/bootstrap/unix-88/VT100.h +++ b/bootstrap/unix-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h @@ -23,14 +23,14 @@ import void VT100_DSR (INT16 n); import void VT100_ED (INT16 n); import void VT100_EL (INT16 n); import void VT100_HVP (INT16 n, INT16 m); -import void VT100_IntToStr (INT32 int_, CHAR *str, LONGINT str__len); +import void VT100_IntToStr (INT32 int_, CHAR *str, ADDRESS str__len); import void VT100_RCP (void); import void VT100_SCP (void); import void VT100_SD (INT16 n); import void VT100_SGR (INT16 n); import void VT100_SGR2 (INT16 n, INT16 m); import void VT100_SU (INT16 n); -import void VT100_SetAttr (CHAR *attr, LONGINT attr__len); +import void VT100_SetAttr (CHAR *attr, ADDRESS attr__len); import void *VT100__init(void); diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index 37630d23..66f80319 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -17,13 +17,13 @@ static CHAR extTools_CFLAGS[1023]; -export void extTools_Assemble (CHAR *moduleName, LONGINT moduleName__len); -static void extTools_InitialiseCompilerCommand (CHAR *s, LONGINT s__len); -export void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN statically, CHAR *additionalopts, LONGINT additionalopts__len); -static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGINT cmd__len); +export void extTools_Assemble (CHAR *moduleName, ADDRESS moduleName__len); +static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len); +export void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN statically, CHAR *additionalopts, ADDRESS additionalopts__len); +static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRESS cmd__len); -static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGINT cmd__len) +static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRESS cmd__len) { INT16 r, status, exitcode; __DUP(title, title__len, CHAR); @@ -63,7 +63,7 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN __DEL(cmd); } -static void extTools_InitialiseCompilerCommand (CHAR *s, LONGINT s__len) +static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) { __COPY("gcc -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); @@ -74,7 +74,7 @@ static void extTools_InitialiseCompilerCommand (CHAR *s, LONGINT s__len) Strings_Append((CHAR*)" ", 2, (void*)s, s__len); } -void extTools_Assemble (CHAR *moduleName, LONGINT moduleName__len) +void extTools_Assemble (CHAR *moduleName, ADDRESS moduleName__len) { CHAR cmd[1023]; __DUP(moduleName, moduleName__len, CHAR); @@ -86,7 +86,7 @@ void extTools_Assemble (CHAR *moduleName, LONGINT moduleName__len) __DEL(moduleName); } -void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN statically, CHAR *additionalopts, LONGINT additionalopts__len) +void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN statically, CHAR *additionalopts, ADDRESS additionalopts__len) { CHAR cmd[1023]; __DUP(additionalopts, additionalopts__len, CHAR); diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index 63e5df15..472c60f3 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h @@ -8,8 +8,8 @@ -import void extTools_Assemble (CHAR *moduleName, LONGINT moduleName__len); -import void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN statically, CHAR *additionalopts, LONGINT additionalopts__len); +import void extTools_Assemble (CHAR *moduleName, ADDRESS moduleName__len); +import void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN statically, CHAR *additionalopts, ADDRESS additionalopts__len); import void *extTools__init(void); diff --git a/bootstrap/windows-48/Compiler.c b/bootstrap/windows-48/Compiler.c index dc4bb660..e900905f 100644 --- a/bootstrap/windows-48/Compiler.c +++ b/bootstrap/windows-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index 2d0061df..071d7b8e 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index b28e0caa..b1942442 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 5326fe10..bdbabe97 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -52,7 +52,7 @@ static Files_File Files_files; static INT16 Files_tempno; static CHAR Files_HOME[1024]; static struct { - LONGINT len[1]; + ADDRESS len[1]; CHAR data[1]; } *Files_SearchPath; @@ -62,56 +62,56 @@ export ADDRESS *Files_Rider__typ; export Files_File Files_Base (Files_Rider *r, ADDRESS *r__typ); static Files_File Files_CacheEntry (Platform_FileIdentity identity); -export void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INT16 *res); +export void Files_ChangeDirectory (CHAR *path, ADDRESS path__len, INT16 *res); export void Files_Close (Files_File f); static void Files_CloseOSFile (Files_File f); static void Files_Create (Files_File f); -export void Files_Delete (CHAR *name, LONGINT name__len, INT16 *res); -static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INT16 errcode); +export void Files_Delete (CHAR *name, ADDRESS name__len, INT16 *res); +static void Files_Err (CHAR *s, ADDRESS s__len, Files_File f, INT16 errcode); static void Files_Finalize (SYSTEM_PTR o); -static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *dest, LONGINT dest__len); +static void Files_FlipBytes (SYSTEM_BYTE *src, ADDRESS src__len, SYSTEM_BYTE *dest, ADDRESS dest__len); static void Files_Flush (Files_Buffer buf); export void Files_GetDate (Files_File f, INT32 *t, INT32 *d); -export void Files_GetName (Files_File f, CHAR *name, LONGINT name__len); -static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *name, LONGINT name__len); -static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len); +export void Files_GetName (Files_File f, CHAR *name, ADDRESS name__len); +static void Files_GetTempName (CHAR *finalName, ADDRESS finalName__len, CHAR *name, ADDRESS name__len); +static BOOLEAN Files_HasDir (CHAR *name, ADDRESS name__len); export INT32 Files_Length (Files_File f); -static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT name__len, CHAR *dest, LONGINT dest__len); -export Files_File Files_New (CHAR *name, LONGINT name__len); -export Files_File Files_Old (CHAR *name, LONGINT name__len); +static void Files_MakeFileName (CHAR *dir, ADDRESS dir__len, CHAR *name, ADDRESS name__len, CHAR *dest, ADDRESS dest__len); +export Files_File Files_New (CHAR *name, ADDRESS name__len); +export Files_File Files_Old (CHAR *name, ADDRESS name__len); export INT32 Files_Pos (Files_Rider *r, ADDRESS *r__typ); export void Files_Purge (Files_File f); export void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x); export void Files_ReadBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN *x); -export void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n); +export void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS x__len, INT32 n); export void Files_ReadInt (Files_Rider *R, ADDRESS *R__typ, INT16 *x); export void Files_ReadLInt (Files_Rider *R, ADDRESS *R__typ, INT32 *x); export void Files_ReadLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL *x); -export void Files_ReadLine (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); -export void Files_ReadNum (Files_Rider *R, ADDRESS *R__typ, SYSTEM_BYTE *x, LONGINT x__len); +export void Files_ReadLine (Files_Rider *R, ADDRESS *R__typ, CHAR *x, ADDRESS x__len); +export void Files_ReadNum (Files_Rider *R, ADDRESS *R__typ, SYSTEM_BYTE *x, ADDRESS x__len); export void Files_ReadReal (Files_Rider *R, ADDRESS *R__typ, REAL *x); export void Files_ReadSet (Files_Rider *R, ADDRESS *R__typ, UINT32 *x); -export void Files_ReadString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); +export void Files_ReadString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, ADDRESS x__len); export void Files_Register (Files_File f); -export void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT16 *res); -static void Files_ScanPath (INT16 *pos, CHAR *dir, LONGINT dir__len); +export void Files_Rename (CHAR *old, ADDRESS old__len, CHAR *new, ADDRESS new__len, INT16 *res); +static void Files_ScanPath (INT16 *pos, CHAR *dir, ADDRESS dir__len); export void Files_Set (Files_Rider *r, ADDRESS *r__typ, Files_File f, INT32 pos); -export void Files_SetSearchPath (CHAR *path, LONGINT path__len); +export void Files_SetSearchPath (CHAR *path, ADDRESS path__len); export void Files_Write (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE x); export void Files_WriteBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN x); -export void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n); +export void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS x__len, INT32 n); export void Files_WriteInt (Files_Rider *R, ADDRESS *R__typ, INT16 x); export void Files_WriteLInt (Files_Rider *R, ADDRESS *R__typ, INT32 x); export void Files_WriteLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL x); export void Files_WriteNum (Files_Rider *R, ADDRESS *R__typ, INT64 x); export void Files_WriteReal (Files_Rider *R, ADDRESS *R__typ, REAL x); export void Files_WriteSet (Files_Rider *R, ADDRESS *R__typ, UINT32 x); -export void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); +export void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, ADDRESS x__len); #define Files_IdxTrap() __HALT(-1) #define Files_ToAdr(x) (ADDRESS)x -static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INT16 errcode) +static void Files_Err (CHAR *s, ADDRESS s__len, Files_File f, INT16 errcode) { __DUP(s, s__len, CHAR); Out_Ln(); @@ -138,7 +138,7 @@ static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INT16 errcode) __DEL(s); } -static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT name__len, CHAR *dest, LONGINT dest__len) +static void Files_MakeFileName (CHAR *dir, ADDRESS dir__len, CHAR *name, ADDRESS name__len, CHAR *dest, ADDRESS dest__len) { INT16 i, j; __DUP(dir, dir__len, CHAR); @@ -163,7 +163,7 @@ static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT __DEL(name); } -static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *name, LONGINT name__len) +static void Files_GetTempName (CHAR *finalName, ADDRESS finalName__len, CHAR *name, ADDRESS name__len) { INT32 n, i, j; __DUP(finalName, finalName__len, CHAR); @@ -316,7 +316,7 @@ INT32 Files_Length (Files_File f) return f->len; } -Files_File Files_New (CHAR *name, LONGINT name__len) +Files_File Files_New (CHAR *name, ADDRESS name__len) { Files_File f = NIL; __DUP(name, name__len, CHAR); @@ -332,7 +332,7 @@ Files_File Files_New (CHAR *name, LONGINT name__len) return f; } -static void Files_ScanPath (INT16 *pos, CHAR *dir, LONGINT dir__len) +static void Files_ScanPath (INT16 *pos, CHAR *dir, ADDRESS dir__len) { INT16 i; CHAR ch; @@ -375,7 +375,7 @@ static void Files_ScanPath (INT16 *pos, CHAR *dir, LONGINT dir__len) dir[i] = 0x00; } -static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len) +static BOOLEAN Files_HasDir (CHAR *name, ADDRESS name__len) { INT16 i; CHAR ch; @@ -415,7 +415,7 @@ static Files_File Files_CacheEntry (Platform_FileIdentity identity) return NIL; } -Files_File Files_Old (CHAR *name, LONGINT name__len) +Files_File Files_Old (CHAR *name, ADDRESS name__len) { Files_File f = NIL; INT32 fd; @@ -618,7 +618,7 @@ void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x) } } -void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n) +void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS x__len, INT32 n) { INT32 xpos, min, restInBuf, offset; Files_Buffer buf = NIL; @@ -683,7 +683,7 @@ void Files_Write (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE x) (*r).res = 0; } -void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n) +void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS x__len, INT32 n) { INT32 xpos, min, restInBuf, offset; Files_Buffer buf = NIL; @@ -722,14 +722,14 @@ void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT (*r).res = 0; } -void Files_Delete (CHAR *name, LONGINT name__len, INT16 *res) +void Files_Delete (CHAR *name, ADDRESS name__len, INT16 *res) { __DUP(name, name__len, CHAR); *res = Platform_Unlink((void*)name, name__len); __DEL(name); } -void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT16 *res) +void Files_Rename (CHAR *old, ADDRESS old__len, CHAR *new, ADDRESS new__len, INT16 *res) { INT32 fdold, fdnew, n; INT16 error, ignore; @@ -812,14 +812,14 @@ void Files_Register (Files_File f) } } -void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INT16 *res) +void Files_ChangeDirectory (CHAR *path, ADDRESS path__len, INT16 *res) { __DUP(path, path__len, CHAR); *res = Platform_Chdir((void*)path, path__len); __DEL(path); } -static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *dest, LONGINT dest__len) +static void Files_FlipBytes (SYSTEM_BYTE *src, ADDRESS src__len, SYSTEM_BYTE *dest, ADDRESS dest__len) { INT32 i, j; if (!Platform_LittleEndian) { @@ -877,7 +877,7 @@ void Files_ReadLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL *x) Files_FlipBytes((void*)b, 8, (void*)&*x, 8); } -void Files_ReadString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len) +void Files_ReadString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, ADDRESS x__len) { INT16 i; CHAR ch; @@ -889,7 +889,7 @@ void Files_ReadString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len) } while (!(ch == 0x00)); } -void Files_ReadLine (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len) +void Files_ReadLine (Files_Rider *R, ADDRESS *R__typ, CHAR *x, ADDRESS x__len) { INT16 i; i = 0; @@ -906,7 +906,7 @@ void Files_ReadLine (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len) x[i] = 0x00; } -void Files_ReadNum (Files_Rider *R, ADDRESS *R__typ, SYSTEM_BYTE *x, LONGINT x__len) +void Files_ReadNum (Files_Rider *R, ADDRESS *R__typ, SYSTEM_BYTE *x, ADDRESS x__len) { INT8 s, b; INT64 q; @@ -972,7 +972,7 @@ void Files_WriteLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL x) Files_WriteBytes(&*R, R__typ, (void*)b, 8, 8); } -void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len) +void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, ADDRESS x__len) { INT16 i; i = 0; @@ -991,7 +991,7 @@ void Files_WriteNum (Files_Rider *R, ADDRESS *R__typ, INT64 x) Files_Write(&*R, R__typ, (CHAR)__MASK(x, -128)); } -void Files_GetName (Files_File f, CHAR *name, LONGINT name__len) +void Files_GetName (Files_File f, CHAR *name, ADDRESS name__len) { __COPY(f->workName, name, name__len); } @@ -1009,7 +1009,7 @@ static void Files_Finalize (SYSTEM_PTR o) } } -void Files_SetSearchPath (CHAR *path, LONGINT path__len) +void Files_SetSearchPath (CHAR *path, ADDRESS path__len) { __DUP(path, path__len, CHAR); if (Strings_Length(path, path__len) != 0) { diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index 62df86fc..2750cbdd 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h @@ -28,41 +28,41 @@ import ADDRESS *Files_FileDesc__typ; import ADDRESS *Files_Rider__typ; import Files_File Files_Base (Files_Rider *r, ADDRESS *r__typ); -import void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INT16 *res); +import void Files_ChangeDirectory (CHAR *path, ADDRESS path__len, INT16 *res); import void Files_Close (Files_File f); -import void Files_Delete (CHAR *name, LONGINT name__len, INT16 *res); +import void Files_Delete (CHAR *name, ADDRESS name__len, INT16 *res); import void Files_GetDate (Files_File f, INT32 *t, INT32 *d); -import void Files_GetName (Files_File f, CHAR *name, LONGINT name__len); +import void Files_GetName (Files_File f, CHAR *name, ADDRESS name__len); import INT32 Files_Length (Files_File f); -import Files_File Files_New (CHAR *name, LONGINT name__len); -import Files_File Files_Old (CHAR *name, LONGINT name__len); +import Files_File Files_New (CHAR *name, ADDRESS name__len); +import Files_File Files_Old (CHAR *name, ADDRESS name__len); import INT32 Files_Pos (Files_Rider *r, ADDRESS *r__typ); import void Files_Purge (Files_File f); import void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x); import void Files_ReadBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN *x); -import void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n); +import void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS x__len, INT32 n); import void Files_ReadInt (Files_Rider *R, ADDRESS *R__typ, INT16 *x); import void Files_ReadLInt (Files_Rider *R, ADDRESS *R__typ, INT32 *x); import void Files_ReadLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL *x); -import void Files_ReadLine (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); -import void Files_ReadNum (Files_Rider *R, ADDRESS *R__typ, SYSTEM_BYTE *x, LONGINT x__len); +import void Files_ReadLine (Files_Rider *R, ADDRESS *R__typ, CHAR *x, ADDRESS x__len); +import void Files_ReadNum (Files_Rider *R, ADDRESS *R__typ, SYSTEM_BYTE *x, ADDRESS x__len); import void Files_ReadReal (Files_Rider *R, ADDRESS *R__typ, REAL *x); import void Files_ReadSet (Files_Rider *R, ADDRESS *R__typ, UINT32 *x); -import void Files_ReadString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); +import void Files_ReadString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, ADDRESS x__len); import void Files_Register (Files_File f); -import void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT16 *res); +import void Files_Rename (CHAR *old, ADDRESS old__len, CHAR *new, ADDRESS new__len, INT16 *res); import void Files_Set (Files_Rider *r, ADDRESS *r__typ, Files_File f, INT32 pos); -import void Files_SetSearchPath (CHAR *path, LONGINT path__len); +import void Files_SetSearchPath (CHAR *path, ADDRESS path__len); import void Files_Write (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE x); import void Files_WriteBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN x); -import void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n); +import void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS x__len, INT32 n); import void Files_WriteInt (Files_Rider *R, ADDRESS *R__typ, INT16 x); import void Files_WriteLInt (Files_Rider *R, ADDRESS *R__typ, INT32 x); import void Files_WriteLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL x); import void Files_WriteNum (Files_Rider *R, ADDRESS *R__typ, INT64 x); import void Files_WriteReal (Files_Rider *R, ADDRESS *R__typ, REAL x); import void Files_WriteSet (Files_Rider *R, ADDRESS *R__typ, UINT32 x); -import void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); +import void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, ADDRESS x__len); import void *Files__init(void); diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index 72677604..ba769b74 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -85,14 +85,14 @@ static void Heap_ExtendHeap (INT32 blksz); export void Heap_FINALL (void); static void Heap_Finalize (void); export void Heap_GC (BOOLEAN markStack); -static void Heap_HeapSort (INT32 n, INT32 *a, LONGINT a__len); +static void Heap_HeapSort (INT32 n, INT32 *a, ADDRESS a__len); export void Heap_INCREF (Heap_Module m); export void Heap_InitHeap (void); export void Heap_Lock (void); static void Heap_Mark (INT32 q); -static void Heap_MarkCandidates (INT32 n, INT32 *cand, LONGINT cand__len); +static void Heap_MarkCandidates (INT32 n, INT32 *cand, ADDRESS cand__len); static void Heap_MarkP (SYSTEM_PTR p); -static void Heap_MarkStack (INT32 n, INT32 *cand, LONGINT cand__len); +static void Heap_MarkStack (INT32 n, INT32 *cand, ADDRESS cand__len); export SYSTEM_PTR Heap_NEWBLK (INT32 size); export SYSTEM_PTR Heap_NEWREC (INT32 tag); static INT32 Heap_NewChunk (INT32 blksz); @@ -101,7 +101,7 @@ export SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); export void Heap_REGTYP (Heap_Module m, INT32 typ); export void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); static void Heap_Scan (void); -static void Heap_Sift (INT32 l, INT32 r, INT32 *a, LONGINT a__len); +static void Heap_Sift (INT32 l, INT32 r, INT32 *a, ADDRESS a__len); export void Heap_Unlock (void); extern void *Heap__init(); @@ -445,7 +445,7 @@ static void Heap_Scan (void) } } -static void Heap_Sift (INT32 l, INT32 r, INT32 *a, LONGINT a__len) +static void Heap_Sift (INT32 l, INT32 r, INT32 *a, ADDRESS a__len) { INT32 i, j, x; j = l; @@ -464,7 +464,7 @@ static void Heap_Sift (INT32 l, INT32 r, INT32 *a, LONGINT a__len) a[i] = x; } -static void Heap_HeapSort (INT32 n, INT32 *a, LONGINT a__len) +static void Heap_HeapSort (INT32 n, INT32 *a, ADDRESS a__len) { INT32 l, r, x; l = __ASHR(n, 1); @@ -482,7 +482,7 @@ static void Heap_HeapSort (INT32 n, INT32 *a, LONGINT a__len) } } -static void Heap_MarkCandidates (INT32 n, INT32 *cand, LONGINT cand__len) +static void Heap_MarkCandidates (INT32 n, INT32 *cand, ADDRESS cand__len) { INT32 chnk, adr, tag, next, lim, lim1, i, ptr, size; chnk = Heap_heap; @@ -571,7 +571,7 @@ void Heap_FINALL (void) } } -static void Heap_MarkStack (INT32 n, INT32 *cand, LONGINT cand__len) +static void Heap_MarkStack (INT32 n, INT32 *cand, ADDRESS cand__len) { SYSTEM_PTR frame; INT32 inc, nofcand, sp, p, stack0; diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index 0aa0a18b..d200254d 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index a5e72ba3..27e4473c 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -47,21 +47,21 @@ export Modules_ModuleName Modules_imported, Modules_importing; export ADDRESS *Modules_ModuleDesc__typ; export ADDRESS *Modules_CmdDesc__typ; -static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len); +static void Modules_Append (CHAR *a, ADDRESS a__len, CHAR *b, ADDRESS b__len); export void Modules_AssertFail (INT32 code); static void Modules_DisplayHaltCode (INT32 code); -export void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all); +export void Modules_Free (CHAR *name, ADDRESS name__len, BOOLEAN all); export void Modules_Halt (INT32 code); -export Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len); -export Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len); +export Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, ADDRESS name__len); +export Modules_Module Modules_ThisMod (CHAR *name, ADDRESS name__len); static void Modules_errch (CHAR c); static void Modules_errint (INT32 l); -static void Modules_errstring (CHAR *s, LONGINT s__len); +static void Modules_errstring (CHAR *s, ADDRESS s__len); #define Modules_modules() (Modules_Module)Heap_modules #define Modules_setmodules(m) Heap_modules = m -static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len) +static void Modules_Append (CHAR *a, ADDRESS a__len, CHAR *b, ADDRESS b__len) { INT16 i, j; __DUP(b, b__len, CHAR); @@ -79,7 +79,7 @@ static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len) __DEL(b); } -Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len) +Modules_Module Modules_ThisMod (CHAR *name, ADDRESS name__len) { Modules_Module m = NIL; CHAR bodyname[64]; @@ -103,7 +103,7 @@ Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len) return m; } -Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len) +Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, ADDRESS name__len) { Modules_Cmd c = NIL; __DUP(name, name__len, CHAR); @@ -130,7 +130,7 @@ Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT nam __RETCHK; } -void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all) +void Modules_Free (CHAR *name, ADDRESS name__len, BOOLEAN all) { Modules_Module m = NIL, p = NIL; __DUP(name, name__len, CHAR); @@ -168,7 +168,7 @@ static void Modules_errch (CHAR c) e = Platform_Write(1, (ADDRESS)&c, 1); } -static void Modules_errstring (CHAR *s, LONGINT s__len) +static void Modules_errstring (CHAR *s, ADDRESS s__len) { INT32 i; __DUP(s, s__len, CHAR); diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index 8bb89fe5..b1f2385e 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h @@ -44,10 +44,10 @@ import ADDRESS *Modules_ModuleDesc__typ; import ADDRESS *Modules_CmdDesc__typ; import void Modules_AssertFail (INT32 code); -import void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all); +import void Modules_Free (CHAR *name, ADDRESS name__len, BOOLEAN all); import void Modules_Halt (INT32 code); -import Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len); -import Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len); +import Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, ADDRESS name__len); +import Modules_Module Modules_ThisMod (CHAR *name, ADDRESS name__len); import void *Modules__init(void); diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index 3ef8e2f9..bc44b83a 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index 0be714e8..eb93787e 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index ef4b429f..72e0feef 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -56,7 +56,7 @@ static void OPC_GenHeaderMsg (void); export void OPC_Halt (INT32 n); export void OPC_Ident (OPT_Object obj); static void OPC_IdentList (OPT_Object obj, INT16 vis); -static void OPC_Include (CHAR *name, LONGINT name__len); +static void OPC_Include (CHAR *name, ADDRESS name__len); static void OPC_IncludeImports (OPT_Object obj, INT16 vis); export void OPC_Increment (BOOLEAN decrement); export void OPC_Indent (INT16 count); @@ -68,11 +68,11 @@ static void OPC_InitTProcs (OPT_Object typ, OPT_Object obj); export void OPC_IntLiteral (INT64 n, INT32 size); export void OPC_Len (OPT_Object obj, OPT_Struct array, INT64 dim); static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName); -static INT16 OPC_Length (CHAR *s, LONGINT s__len); +static INT16 OPC_Length (CHAR *s, ADDRESS s__len); export BOOLEAN OPC_NeedsRetval (OPT_Object proc); export INT32 OPC_NofPtrs (OPT_Struct typ); -static INT16 OPC_PerfectHash (CHAR *s, LONGINT s__len); -static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len); +static INT16 OPC_PerfectHash (CHAR *s, ADDRESS s__len); +static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, ADDRESS y__len); static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define); static void OPC_ProcPredefs (OPT_Object obj, INT8 vis); static void OPC_PutBase (OPT_Struct typ); @@ -80,8 +80,8 @@ static void OPC_PutPtrOffsets (OPT_Struct typ, INT32 adr, INT32 *cnt); static void OPC_RegCmds (OPT_Object obj); export void OPC_SetInclude (BOOLEAN exclude); static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause); -static void OPC_Str1 (CHAR *s, LONGINT s__len, INT32 x); -static void OPC_StringLiteral (CHAR *s, LONGINT s__len, INT32 l); +static void OPC_Str1 (CHAR *s, ADDRESS s__len, INT32 x); +static void OPC_StringLiteral (CHAR *s, ADDRESS s__len, INT32 l); export void OPC_TDescDecl (OPT_Struct typ); export void OPC_TypeDefs (OPT_Object obj, INT16 vis); export void OPC_TypeOf (OPT_Object ap); @@ -137,7 +137,7 @@ void OPC_EndBlk0 (void) OPM_Write('}'); } -static void OPC_Str1 (CHAR *s, LONGINT s__len, INT32 x) +static void OPC_Str1 (CHAR *s, ADDRESS s__len, INT32 x) { CHAR ch; INT16 i; @@ -156,7 +156,7 @@ static void OPC_Str1 (CHAR *s, LONGINT s__len, INT32 x) __DEL(s); } -static INT16 OPC_Length (CHAR *s, LONGINT s__len) +static INT16 OPC_Length (CHAR *s, ADDRESS s__len) { INT16 i; i = 0; @@ -166,7 +166,7 @@ static INT16 OPC_Length (CHAR *s, LONGINT s__len) return i; } -static INT16 OPC_PerfectHash (CHAR *s, LONGINT s__len) +static INT16 OPC_PerfectHash (CHAR *s, ADDRESS s__len) { INT16 i, h; i = 0; @@ -364,7 +364,7 @@ static void OPC_DeclareBase (OPT_Object dcl) OPM_WriteString((CHAR*)"struct ", 8); OPC_BegBlk(); OPC_BegStat(); - OPC_Str1((CHAR*)"LONGINT len[#]", 15, nofdims); + OPC_Str1((CHAR*)"ADDRESS len[#]", 15, nofdims); OPC_EndStat(); OPC_BegStat(); __NEW(obj, OPT_ObjDesc); @@ -511,7 +511,7 @@ static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamNa typ = par->typ->BaseTyp; while (typ->comp == 3) { if (ansiDefine) { - OPM_WriteString((CHAR*)", LONGINT ", 11); + OPM_WriteString((CHAR*)", ADDRESS ", 11); } else { OPM_WriteString((CHAR*)", ", 3); } @@ -720,7 +720,7 @@ static void OPC_DefineType (OPT_Struct str) } } -static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len) +static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, ADDRESS y__len) { INT16 i; __DUP(y, y__len, CHAR); @@ -969,7 +969,7 @@ static void OPC_IdentList (OPT_Object obj, INT16 vis) OPC_EndStat(); OPC_BegStat(); base = OPT_linttyp; - OPM_WriteString((CHAR*)"LONGINT ", 9); + OPM_WriteString((CHAR*)"ADDRESS ", 9); OPC_LenList(obj, 0, 1); } else if ((obj->mode == 2 && obj->typ->comp == 4)) { OPC_EndStat(); @@ -1008,7 +1008,7 @@ static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames) __COPY(name, obj->name, 256); } if (obj->typ->comp == 3) { - OPM_WriteString((CHAR*)", LONGINT ", 11); + OPM_WriteString((CHAR*)", ADDRESS ", 11); OPC_LenList(obj, 1, showParamNames); } else if ((obj->mode == 2 && obj->typ->comp == 4)) { OPM_WriteString((CHAR*)", ADDRESS *", 12); @@ -1062,7 +1062,7 @@ static void OPC_ProcPredefs (OPT_Object obj, INT8 vis) } } -static void OPC_Include (CHAR *name, LONGINT name__len) +static void OPC_Include (CHAR *name, ADDRESS name__len) { __DUP(name, name__len, CHAR); OPM_WriteString((CHAR*)"#include ", 10); @@ -1744,7 +1744,7 @@ static void OPC_CharacterLiteral (INT64 c) } } -static void OPC_StringLiteral (CHAR *s, LONGINT s__len, INT32 l) +static void OPC_StringLiteral (CHAR *s, ADDRESS s__len, INT32 l) { INT32 i; INT16 c; @@ -1912,9 +1912,9 @@ static struct InitKeywords__46 { struct InitKeywords__46 *lnk; } *InitKeywords__46_s; -static void Enter__47 (CHAR *s, LONGINT s__len); +static void Enter__47 (CHAR *s, ADDRESS s__len); -static void Enter__47 (CHAR *s, LONGINT s__len) +static void Enter__47 (CHAR *s, ADDRESS s__len) { INT16 h; __DUP(s, s__len, CHAR); diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index 842e7dec..5624314d 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index e76d763e..632b78e5 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -53,26 +53,26 @@ export void OPM_FPrintLReal (INT32 *fp, LONGREAL val); export void OPM_FPrintReal (INT32 *fp, REAL val); export void OPM_FPrintSet (INT32 *fp, UINT64 val); static void OPM_FindLine (Files_File f, Files_Rider *r, ADDRESS *r__typ, INT64 pos); -static void OPM_FingerprintBytes (INT32 *fp, SYSTEM_BYTE *bytes, LONGINT bytes__len); +static void OPM_FingerprintBytes (INT32 *fp, SYSTEM_BYTE *bytes, ADDRESS bytes__len); export void OPM_Get (CHAR *ch); -export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); +export void OPM_Init (BOOLEAN *done, CHAR *mname, ADDRESS mname__len); export void OPM_InitOptions (void); export INT16 OPM_Integer (INT64 n); static void OPM_LogErrMsg (INT16 n); -export void OPM_LogVT100 (CHAR *vt100code, LONGINT vt100code__len); +export void OPM_LogVT100 (CHAR *vt100code, ADDRESS vt100code__len); export void OPM_LogW (CHAR ch); export void OPM_LogWLn (void); export void OPM_LogWNum (INT64 i, INT64 len); -export void OPM_LogWStr (CHAR *s, LONGINT s__len); +export void OPM_LogWStr (CHAR *s, ADDRESS s__len); export INT32 OPM_Longint (INT64 n); -static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len); +static void OPM_MakeFileName (CHAR *name, ADDRESS name__len, CHAR *FName, ADDRESS FName__len, CHAR *ext, ADDRESS ext__len); export void OPM_Mark (INT16 n, INT32 pos); -export void OPM_NewSym (CHAR *modName, LONGINT modName__len); -export void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); -export void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); +export void OPM_NewSym (CHAR *modName, ADDRESS modName__len); +export void OPM_OldSym (CHAR *modName, ADDRESS modName__len, BOOLEAN *done); +export void OPM_OpenFiles (CHAR *moduleName, ADDRESS moduleName__len); export BOOLEAN OPM_OpenPar (void); export void OPM_RegisterNewSym (void); -static void OPM_ScanOptions (CHAR *s, LONGINT s__len); +static void OPM_ScanOptions (CHAR *s, ADDRESS s__len); static void OPM_ShowLine (INT64 pos); export INT64 OPM_SignedMaximum (INT32 bytecount); export INT64 OPM_SignedMinimum (INT32 bytecount); @@ -93,8 +93,8 @@ export void OPM_WriteHex (INT64 i); export void OPM_WriteInt (INT64 i); export void OPM_WriteLn (void); export void OPM_WriteReal (LONGREAL r, CHAR suffx); -export void OPM_WriteString (CHAR *s, LONGINT s__len); -export void OPM_WriteStringVar (CHAR *s, LONGINT s__len); +export void OPM_WriteString (CHAR *s, ADDRESS s__len); +export void OPM_WriteStringVar (CHAR *s, ADDRESS s__len); export BOOLEAN OPM_eofSF (void); export void OPM_err (INT16 n); @@ -105,7 +105,7 @@ void OPM_LogW (CHAR ch) Out_Char(ch); } -void OPM_LogWStr (CHAR *s, LONGINT s__len) +void OPM_LogWStr (CHAR *s, ADDRESS s__len) { __DUP(s, s__len, CHAR); Out_String(s, s__len); @@ -122,7 +122,7 @@ void OPM_LogWLn (void) Out_Ln(); } -void OPM_LogVT100 (CHAR *vt100code, LONGINT vt100code__len) +void OPM_LogVT100 (CHAR *vt100code, ADDRESS vt100code__len) { __DUP(vt100code, vt100code__len, CHAR); if ((Out_IsConsole && !__IN(16, OPM_Options, 32))) { @@ -154,7 +154,7 @@ INT16 OPM_Integer (INT64 n) return __VAL(INT16, n); } -static void OPM_ScanOptions (CHAR *s, LONGINT s__len) +static void OPM_ScanOptions (CHAR *s, ADDRESS s__len) { INT16 i; __DUP(s, s__len, CHAR); @@ -465,7 +465,7 @@ void OPM_InitOptions (void) Files_SetSearchPath(searchpath, 1024); } -void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len) +void OPM_Init (BOOLEAN *done, CHAR *mname, ADDRESS mname__len) { Texts_Text T = NIL; INT32 beg, end, time; @@ -514,7 +514,7 @@ void OPM_Get (CHAR *ch) } } -static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len) +static void OPM_MakeFileName (CHAR *name, ADDRESS name__len, CHAR *FName, ADDRESS FName__len, CHAR *ext, ADDRESS ext__len) { INT16 i, j; CHAR ch; @@ -700,7 +700,7 @@ void OPM_err (INT16 n) OPM_Mark(n, OPM_errpos); } -static void OPM_FingerprintBytes (INT32 *fp, SYSTEM_BYTE *bytes, LONGINT bytes__len) +static void OPM_FingerprintBytes (INT32 *fp, SYSTEM_BYTE *bytes, ADDRESS bytes__len) { INT16 i; INT32 l; @@ -772,7 +772,7 @@ void OPM_CloseOldSym (void) Files_Close(Files_Base(&OPM_oldSF, Files_Rider__typ)); } -void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done) +void OPM_OldSym (CHAR *modName, ADDRESS modName__len, BOOLEAN *done) { CHAR tag, ver; OPM_FileName fileName; @@ -832,7 +832,7 @@ void OPM_DeleteNewSym (void) { } -void OPM_NewSym (CHAR *modName, LONGINT modName__len) +void OPM_NewSym (CHAR *modName, ADDRESS modName__len) { OPM_FileName fileName; OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, 32, (CHAR*)".sym", 5); @@ -851,7 +851,7 @@ void OPM_Write (CHAR ch) Files_Write(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, ch); } -void OPM_WriteString (CHAR *s, LONGINT s__len) +void OPM_WriteString (CHAR *s, ADDRESS s__len) { INT16 i; i = 0; @@ -861,7 +861,7 @@ void OPM_WriteString (CHAR *s, LONGINT s__len) Files_WriteBytes(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, (void*)s, s__len * 1, i); } -void OPM_WriteStringVar (CHAR *s, LONGINT s__len) +void OPM_WriteStringVar (CHAR *s, ADDRESS s__len) { INT16 i; i = 0; @@ -986,7 +986,7 @@ static void OPM_Append (Files_Rider *R, ADDRESS *R__typ, Files_File F) } } -void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len) +void OPM_OpenFiles (CHAR *moduleName, ADDRESS moduleName__len) { CHAR FName[32]; __COPY(moduleName, OPM_modName, 32); diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index 2d272feb..c310c421 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h @@ -28,19 +28,19 @@ import void OPM_FPrintLReal (INT32 *fp, LONGREAL val); import void OPM_FPrintReal (INT32 *fp, REAL val); import void OPM_FPrintSet (INT32 *fp, UINT64 val); import void OPM_Get (CHAR *ch); -import void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); +import void OPM_Init (BOOLEAN *done, CHAR *mname, ADDRESS mname__len); import void OPM_InitOptions (void); import INT16 OPM_Integer (INT64 n); -import void OPM_LogVT100 (CHAR *vt100code, LONGINT vt100code__len); +import void OPM_LogVT100 (CHAR *vt100code, ADDRESS vt100code__len); import void OPM_LogW (CHAR ch); import void OPM_LogWLn (void); import void OPM_LogWNum (INT64 i, INT64 len); -import void OPM_LogWStr (CHAR *s, LONGINT s__len); +import void OPM_LogWStr (CHAR *s, ADDRESS s__len); import INT32 OPM_Longint (INT64 n); import void OPM_Mark (INT16 n, INT32 pos); -import void OPM_NewSym (CHAR *modName, LONGINT modName__len); -import void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); -import void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); +import void OPM_NewSym (CHAR *modName, ADDRESS modName__len); +import void OPM_OldSym (CHAR *modName, ADDRESS modName__len, BOOLEAN *done); +import void OPM_OpenFiles (CHAR *moduleName, ADDRESS moduleName__len); import BOOLEAN OPM_OpenPar (void); import void OPM_RegisterNewSym (void); import INT64 OPM_SignedMaximum (INT32 bytecount); @@ -61,8 +61,8 @@ import void OPM_WriteHex (INT64 i); import void OPM_WriteInt (INT64 i); import void OPM_WriteLn (void); import void OPM_WriteReal (LONGREAL r, CHAR suffx); -import void OPM_WriteString (CHAR *s, LONGINT s__len); -import void OPM_WriteStringVar (CHAR *s, LONGINT s__len); +import void OPM_WriteString (CHAR *s, ADDRESS s__len); +import void OPM_WriteStringVar (CHAR *s, ADDRESS s__len); import BOOLEAN OPM_eofSF (void); import void OPM_err (INT16 n); import void *OPM__init(void); diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index 3f360d00..02fd6337 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index 5a71eb39..acb2df91 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index 6ee700e5..7aedbbd6 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index 1f7a3e58..e49c222b 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 75820a95..1eb85a06 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -120,7 +120,7 @@ static void OPT_EnterTyp (OPS_Name name, INT8 form, INT16 size, OPT_Struct *res) static void OPT_EnterTypeAlias (OPS_Name name, OPT_Object *res); export void OPT_Export (BOOLEAN *ext, BOOLEAN *new); export void OPT_FPrintErr (OPT_Object obj, INT16 errcode); -static void OPT_FPrintName (INT32 *fp, CHAR *name, LONGINT name__len); +static void OPT_FPrintName (INT32 *fp, CHAR *name, ADDRESS name__len); export void OPT_FPrintObj (OPT_Object obj); static void OPT_FPrintSign (INT32 *fp, OPT_Struct result, OPT_Object par); export void OPT_FPrintStr (OPT_Struct typ); @@ -132,7 +132,7 @@ export void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); static void OPT_InConstant (INT32 f, OPT_Const conval); static OPT_Object OPT_InFld (void); static void OPT_InMod (INT8 *mno); -static void OPT_InName (CHAR *name, LONGINT name__len); +static void OPT_InName (CHAR *name, ADDRESS name__len); static OPT_Object OPT_InObj (INT8 mno); static void OPT_InSign (INT8 mno, OPT_Struct *res, OPT_Object *par); static void OPT_InStruct (OPT_Struct *typ); @@ -155,7 +155,7 @@ static void OPT_OutConstant (OPT_Object obj); static void OPT_OutFlds (OPT_Object fld, INT32 adr, BOOLEAN visible); static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, INT32 adr); static void OPT_OutMod (INT16 mno); -static void OPT_OutName (CHAR *name, LONGINT name__len); +static void OPT_OutName (CHAR *name, ADDRESS name__len); static void OPT_OutObj (OPT_Object obj); static void OPT_OutSign (OPT_Struct result, OPT_Object par); static void OPT_OutStr (OPT_Struct typ); @@ -576,7 +576,7 @@ void OPT_Insert (OPS_Name name, OPT_Object *obj) *obj = ob1; } -static void OPT_FPrintName (INT32 *fp, CHAR *name, LONGINT name__len) +static void OPT_FPrintName (INT32 *fp, CHAR *name, ADDRESS name__len) { INT16 i; CHAR ch; @@ -957,7 +957,7 @@ void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old) } } -static void OPT_InName (CHAR *name, LONGINT name__len) +static void OPT_InName (CHAR *name, ADDRESS name__len) { INT16 i; CHAR ch; @@ -1483,7 +1483,7 @@ void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) } } -static void OPT_OutName (CHAR *name, LONGINT name__len) +static void OPT_OutName (CHAR *name, ADDRESS name__len) { INT16 i; CHAR ch; diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index 90fcacf5..9d34cea9 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index 5c21cb97..f6d42592 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index c4a61586..0f1980ac 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Out.c b/bootstrap/windows-48/Out.c index 720267fd..de9a7701 100644 --- a/bootstrap/windows-48/Out.c +++ b/bootstrap/windows-48/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -17,16 +17,16 @@ static INT16 Out_in; export void Out_Char (CHAR ch); export void Out_Flush (void); export void Out_Int (INT64 x, INT64 n); -static INT32 Out_Length (CHAR *s, LONGINT s__len); +static INT32 Out_Length (CHAR *s, ADDRESS s__len); export void Out_Ln (void); export void Out_LongReal (LONGREAL x, INT16 n); export void Out_Open (void); export void Out_Real (REAL x, INT16 n); static void Out_RealP (LONGREAL x, INT16 n, BOOLEAN long_); -export void Out_String (CHAR *str, LONGINT str__len); +export void Out_String (CHAR *str, ADDRESS str__len); export LONGREAL Out_Ten (INT16 e); -static void Out_digit (INT64 n, CHAR *s, LONGINT s__len, INT16 *i); -static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, INT16 *i); +static void Out_digit (INT64 n, CHAR *s, ADDRESS s__len, INT16 *i); +static void Out_prepend (CHAR *t, ADDRESS t__len, CHAR *s, ADDRESS s__len, INT16 *i); #define Out_Entier64(x) (INT64)(x) @@ -55,7 +55,7 @@ void Out_Char (CHAR ch) } } -static INT32 Out_Length (CHAR *s, LONGINT s__len) +static INT32 Out_Length (CHAR *s, ADDRESS s__len) { INT32 l; l = 0; @@ -65,7 +65,7 @@ static INT32 Out_Length (CHAR *s, LONGINT s__len) return l; } -void Out_String (CHAR *str, LONGINT str__len) +void Out_String (CHAR *str, ADDRESS str__len) { INT32 l; INT16 error; @@ -125,13 +125,13 @@ void Out_Ln (void) Out_Flush(); } -static void Out_digit (INT64 n, CHAR *s, LONGINT s__len, INT16 *i) +static void Out_digit (INT64 n, CHAR *s, ADDRESS s__len, INT16 *i) { *i -= 1; s[__X(*i, s__len)] = (CHAR)(__MOD(n, 10) + 48); } -static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, INT16 *i) +static void Out_prepend (CHAR *t, ADDRESS t__len, CHAR *s, ADDRESS s__len, INT16 *i) { INT16 j; INT32 l; diff --git a/bootstrap/windows-48/Out.h b/bootstrap/windows-48/Out.h index 0e66420d..d58a17d5 100644 --- a/bootstrap/windows-48/Out.h +++ b/bootstrap/windows-48/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h @@ -16,7 +16,7 @@ import void Out_Ln (void); import void Out_LongReal (LONGREAL x, INT16 n); import void Out_Open (void); import void Out_Real (REAL x, INT16 n); -import void Out_String (CHAR *str, LONGINT str__len); +import void Out_String (CHAR *str, ADDRESS str__len); import LONGREAL Out_Ten (INT16 e); import void *Out__init(void); diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 5a57f076..2d035abe 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -48,8 +48,8 @@ export CHAR Platform_NL[3]; export ADDRESS *Platform_FileIdentity__typ; export BOOLEAN Platform_Absent (INT16 e); -export INT16 Platform_ArgPos (CHAR *s, LONGINT s__len); -export INT16 Platform_Chdir (CHAR *n, LONGINT n__len); +export INT16 Platform_ArgPos (CHAR *s, ADDRESS s__len); +export INT16 Platform_Chdir (CHAR *n, ADDRESS n__len); export INT16 Platform_Close (INT32 h); export BOOLEAN Platform_ConnectionFailed (INT16 e); export void Platform_Delay (INT32 ms); @@ -57,27 +57,27 @@ export BOOLEAN Platform_DifferentFilesystems (INT16 e); static void Platform_EnableVT100 (void); export INT16 Platform_Error (void); export void Platform_Exit (INT32 code); -export void Platform_GetArg (INT16 n, CHAR *val, LONGINT val__len); +export void Platform_GetArg (INT16 n, CHAR *val, ADDRESS val__len); export void Platform_GetClock (INT32 *t, INT32 *d); -export void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); +export void Platform_GetEnv (CHAR *var, ADDRESS var__len, CHAR *val, ADDRESS val__len); export void Platform_GetIntArg (INT16 n, INT32 *val); export void Platform_GetTimeOfDay (INT32 *sec, INT32 *usec); export INT16 Platform_Identify (INT32 h, Platform_FileIdentity *identity, ADDRESS *identity__typ); -export INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ); +export INT16 Platform_IdentifyByName (CHAR *n, ADDRESS n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ); export BOOLEAN Platform_Inaccessible (INT16 e); export void Platform_Init (INT32 argc, INT32 argvadr); export BOOLEAN Platform_Interrupted (INT16 e); export BOOLEAN Platform_IsConsole (INT32 h); export void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d); -export INT16 Platform_New (CHAR *n, LONGINT n__len, INT32 *h); +export INT16 Platform_New (CHAR *n, ADDRESS n__len, INT32 *h); export BOOLEAN Platform_NoSuchDirectory (INT16 e); export INT32 Platform_OSAllocate (INT32 size); export void Platform_OSFree (INT32 address); -export INT16 Platform_OldRO (CHAR *n, LONGINT n__len, INT32 *h); -export INT16 Platform_OldRW (CHAR *n, LONGINT n__len, INT32 *h); +export INT16 Platform_OldRO (CHAR *n, ADDRESS n__len, INT32 *h); +export INT16 Platform_OldRW (CHAR *n, ADDRESS n__len, INT32 *h); export INT16 Platform_Read (INT32 h, INT32 p, INT32 l, INT32 *n); -export INT16 Platform_ReadBuf (INT32 h, SYSTEM_BYTE *b, LONGINT b__len, INT32 *n); -export INT16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); +export INT16 Platform_ReadBuf (INT32 h, SYSTEM_BYTE *b, ADDRESS b__len, INT32 *n); +export INT16 Platform_Rename (CHAR *o, ADDRESS o__len, CHAR *n, ADDRESS n__len); export BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); export BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); export INT16 Platform_Seek (INT32 h, INT32 o, INT16 r); @@ -85,16 +85,16 @@ export void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); export void Platform_SetMTime (Platform_FileIdentity *target, ADDRESS *target__typ, Platform_FileIdentity source); export INT16 Platform_Size (INT32 h, INT32 *l); export INT16 Platform_Sync (INT32 h); -export INT16 Platform_System (CHAR *cmd, LONGINT cmd__len); +export INT16 Platform_System (CHAR *cmd, ADDRESS cmd__len); static void Platform_TestLittleEndian (void); export INT32 Platform_Time (void); export BOOLEAN Platform_TimedOut (INT16 e); export BOOLEAN Platform_TooManyFiles (INT16 e); export INT16 Platform_Truncate (INT32 h, INT32 limit); -export INT16 Platform_Unlink (CHAR *n, LONGINT n__len); +export INT16 Platform_Unlink (CHAR *n, ADDRESS n__len); export INT16 Platform_Write (INT32 h, INT32 p, INT32 l); static void Platform_YMDHMStoClock (INT16 ye, INT16 mo, INT16 da, INT16 ho, INT16 mi, INT16 se, INT32 *t, INT32 *d); -export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); +export BOOLEAN Platform_getEnv (CHAR *var, ADDRESS var__len, CHAR *val, ADDRESS val__len); #include "WindowsWrapper.h" #define Platform_ECONNABORTED() WSAECONNABORTED @@ -239,7 +239,7 @@ void Platform_Init (INT32 argc, INT32 argvadr) Platform_HeapInitHeap(); } -BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len) +BOOLEAN Platform_getEnv (CHAR *var, ADDRESS var__len, CHAR *val, ADDRESS val__len) { CHAR buf[4096]; INT16 res; @@ -256,7 +256,7 @@ BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__le __RETCHK; } -void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len) +void Platform_GetEnv (CHAR *var, ADDRESS var__len, CHAR *val, ADDRESS val__len) { __DUP(var, var__len, CHAR); if (!Platform_getEnv(var, var__len, (void*)val, val__len)) { @@ -265,7 +265,7 @@ void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len) __DEL(var); } -void Platform_GetArg (INT16 n, CHAR *val, LONGINT val__len) +void Platform_GetArg (INT16 n, CHAR *val, ADDRESS val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { @@ -300,7 +300,7 @@ void Platform_GetIntArg (INT16 n, INT32 *val) } } -INT16 Platform_ArgPos (CHAR *s, LONGINT s__len) +INT16 Platform_ArgPos (CHAR *s, ADDRESS s__len) { INT16 i; CHAR arg[256]; @@ -359,7 +359,7 @@ void Platform_GetTimeOfDay (INT32 *sec, INT32 *usec) *usec = Platform_uluSec(); } -INT16 Platform_System (CHAR *cmd, LONGINT cmd__len) +INT16 Platform_System (CHAR *cmd, ADDRESS cmd__len) { INT16 result; __DUP(cmd, cmd__len, CHAR); @@ -381,7 +381,7 @@ INT16 Platform_Error (void) return Platform_err(); } -INT16 Platform_OldRO (CHAR *n, LONGINT n__len, INT32 *h) +INT16 Platform_OldRO (CHAR *n, ADDRESS n__len, INT32 *h) { INT32 fd; fd = Platform_openro(n, n__len); @@ -394,7 +394,7 @@ INT16 Platform_OldRO (CHAR *n, LONGINT n__len, INT32 *h) __RETCHK; } -INT16 Platform_OldRW (CHAR *n, LONGINT n__len, INT32 *h) +INT16 Platform_OldRW (CHAR *n, ADDRESS n__len, INT32 *h) { INT32 fd; fd = Platform_openrw(n, n__len); @@ -407,7 +407,7 @@ INT16 Platform_OldRW (CHAR *n, LONGINT n__len, INT32 *h) __RETCHK; } -INT16 Platform_New (CHAR *n, LONGINT n__len, INT32 *h) +INT16 Platform_New (CHAR *n, ADDRESS n__len, INT32 *h) { INT32 fd; fd = Platform_opennew(n, n__len); @@ -444,7 +444,7 @@ INT16 Platform_Identify (INT32 h, Platform_FileIdentity *identity, ADDRESS *iden return 0; } -INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ) +INT16 Platform_IdentifyByName (CHAR *n, ADDRESS n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ) { INT32 h; INT16 e, i; @@ -508,7 +508,7 @@ INT16 Platform_Read (INT32 h, INT32 p, INT32 l, INT32 *n) __RETCHK; } -INT16 Platform_ReadBuf (INT32 h, SYSTEM_BYTE *b, LONGINT b__len, INT32 *n) +INT16 Platform_ReadBuf (INT32 h, SYSTEM_BYTE *b, ADDRESS b__len, INT32 *n) { INT16 result; INT32 lengthread; @@ -580,7 +580,7 @@ INT16 Platform_Truncate (INT32 h, INT32 limit) return 0; } -INT16 Platform_Unlink (CHAR *n, LONGINT n__len) +INT16 Platform_Unlink (CHAR *n, ADDRESS n__len) { if (Platform_deleteFile(n, n__len) == 0) { return Platform_err(); @@ -590,7 +590,7 @@ INT16 Platform_Unlink (CHAR *n, LONGINT n__len) __RETCHK; } -INT16 Platform_Chdir (CHAR *n, LONGINT n__len) +INT16 Platform_Chdir (CHAR *n, ADDRESS n__len) { INT16 r; r = Platform_setCurrentDirectory(n, n__len); @@ -601,7 +601,7 @@ INT16 Platform_Chdir (CHAR *n, LONGINT n__len) return 0; } -INT16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) +INT16 Platform_Rename (CHAR *o, ADDRESS o__len, CHAR *n, ADDRESS n__len) { if (Platform_moveFile(o, o__len, n, n__len) == 0) { return Platform_err(); diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index f62a8ab8..3f6520f3 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h @@ -29,35 +29,35 @@ import CHAR Platform_NL[3]; import ADDRESS *Platform_FileIdentity__typ; import BOOLEAN Platform_Absent (INT16 e); -import INT16 Platform_ArgPos (CHAR *s, LONGINT s__len); -import INT16 Platform_Chdir (CHAR *n, LONGINT n__len); +import INT16 Platform_ArgPos (CHAR *s, ADDRESS s__len); +import INT16 Platform_Chdir (CHAR *n, ADDRESS n__len); import INT16 Platform_Close (INT32 h); import BOOLEAN Platform_ConnectionFailed (INT16 e); import void Platform_Delay (INT32 ms); import BOOLEAN Platform_DifferentFilesystems (INT16 e); import INT16 Platform_Error (void); import void Platform_Exit (INT32 code); -import void Platform_GetArg (INT16 n, CHAR *val, LONGINT val__len); +import void Platform_GetArg (INT16 n, CHAR *val, ADDRESS val__len); import void Platform_GetClock (INT32 *t, INT32 *d); -import void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); +import void Platform_GetEnv (CHAR *var, ADDRESS var__len, CHAR *val, ADDRESS val__len); import void Platform_GetIntArg (INT16 n, INT32 *val); import void Platform_GetTimeOfDay (INT32 *sec, INT32 *usec); import INT16 Platform_Identify (INT32 h, Platform_FileIdentity *identity, ADDRESS *identity__typ); -import INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ); +import INT16 Platform_IdentifyByName (CHAR *n, ADDRESS n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ); import BOOLEAN Platform_Inaccessible (INT16 e); import void Platform_Init (INT32 argc, INT32 argvadr); import BOOLEAN Platform_Interrupted (INT16 e); import BOOLEAN Platform_IsConsole (INT32 h); import void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d); -import INT16 Platform_New (CHAR *n, LONGINT n__len, INT32 *h); +import INT16 Platform_New (CHAR *n, ADDRESS n__len, INT32 *h); import BOOLEAN Platform_NoSuchDirectory (INT16 e); import INT32 Platform_OSAllocate (INT32 size); import void Platform_OSFree (INT32 address); -import INT16 Platform_OldRO (CHAR *n, LONGINT n__len, INT32 *h); -import INT16 Platform_OldRW (CHAR *n, LONGINT n__len, INT32 *h); +import INT16 Platform_OldRO (CHAR *n, ADDRESS n__len, INT32 *h); +import INT16 Platform_OldRW (CHAR *n, ADDRESS n__len, INT32 *h); import INT16 Platform_Read (INT32 h, INT32 p, INT32 l, INT32 *n); -import INT16 Platform_ReadBuf (INT32 h, SYSTEM_BYTE *b, LONGINT b__len, INT32 *n); -import INT16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); +import INT16 Platform_ReadBuf (INT32 h, SYSTEM_BYTE *b, ADDRESS b__len, INT32 *n); +import INT16 Platform_Rename (CHAR *o, ADDRESS o__len, CHAR *n, ADDRESS n__len); import BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); import BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); import INT16 Platform_Seek (INT32 h, INT32 o, INT16 r); @@ -65,14 +65,14 @@ import void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); import void Platform_SetMTime (Platform_FileIdentity *target, ADDRESS *target__typ, Platform_FileIdentity source); import INT16 Platform_Size (INT32 h, INT32 *l); import INT16 Platform_Sync (INT32 h); -import INT16 Platform_System (CHAR *cmd, LONGINT cmd__len); +import INT16 Platform_System (CHAR *cmd, ADDRESS cmd__len); import INT32 Platform_Time (void); import BOOLEAN Platform_TimedOut (INT16 e); import BOOLEAN Platform_TooManyFiles (INT16 e); import INT16 Platform_Truncate (INT32 h, INT32 limit); -import INT16 Platform_Unlink (CHAR *n, LONGINT n__len); +import INT16 Platform_Unlink (CHAR *n, ADDRESS n__len); import INT16 Platform_Write (INT32 h, INT32 p, INT32 l); -import BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); +import BOOLEAN Platform_getEnv (CHAR *var, ADDRESS var__len, CHAR *val, ADDRESS val__len); import void *Platform__init(void); #define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((ADDRESS)h) diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index cd4c3c61..be3ad909 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -10,11 +10,11 @@ -static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LONGINT d__len); -export void Reals_Convert (REAL x, INT16 n, CHAR *d, LONGINT d__len); -export void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len); -export void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len); -export void Reals_ConvertL (LONGREAL x, INT16 n, CHAR *d, LONGINT d__len); +static void Reals_BytesToHex (SYSTEM_BYTE *b, ADDRESS b__len, SYSTEM_BYTE *d, ADDRESS d__len); +export void Reals_Convert (REAL x, INT16 n, CHAR *d, ADDRESS d__len); +export void Reals_ConvertH (REAL y, CHAR *d, ADDRESS d__len); +export void Reals_ConvertHL (LONGREAL x, CHAR *d, ADDRESS d__len); +export void Reals_ConvertL (LONGREAL x, INT16 n, CHAR *d, ADDRESS d__len); export INT16 Reals_Expo (REAL x); export INT16 Reals_ExpoL (LONGREAL x); export void Reals_SetExpo (REAL *x, INT16 ex); @@ -79,7 +79,7 @@ INT16 Reals_ExpoL (LONGREAL x) return __MASK(__ASHR(i, 4), -2048); } -void Reals_ConvertL (LONGREAL x, INT16 n, CHAR *d, LONGINT d__len) +void Reals_ConvertL (LONGREAL x, INT16 n, CHAR *d, ADDRESS d__len) { INT32 i, j, k; if (x < (LONGREAL)0) { @@ -107,7 +107,7 @@ void Reals_ConvertL (LONGREAL x, INT16 n, CHAR *d, LONGINT d__len) } } -void Reals_Convert (REAL x, INT16 n, CHAR *d, LONGINT d__len) +void Reals_Convert (REAL x, INT16 n, CHAR *d, ADDRESS d__len) { Reals_ConvertL(x, n, (void*)d, d__len); } @@ -122,7 +122,7 @@ static CHAR Reals_ToHex (INT16 i) __RETCHK; } -static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LONGINT d__len) +static void Reals_BytesToHex (SYSTEM_BYTE *b, ADDRESS b__len, SYSTEM_BYTE *d, ADDRESS d__len) { INT16 i; INT32 l; @@ -137,12 +137,12 @@ static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LO } } -void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len) +void Reals_ConvertH (REAL y, CHAR *d, ADDRESS d__len) { Reals_BytesToHex((void*)&y, 4, (void*)d, d__len * 1); } -void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len) +void Reals_ConvertHL (LONGREAL x, CHAR *d, ADDRESS d__len) { Reals_BytesToHex((void*)&x, 8, (void*)d, d__len * 1); } diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index f0c84ab1..e8d15a2f 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h @@ -8,10 +8,10 @@ -import void Reals_Convert (REAL x, INT16 n, CHAR *d, LONGINT d__len); -import void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len); -import void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len); -import void Reals_ConvertL (LONGREAL x, INT16 n, CHAR *d, LONGINT d__len); +import void Reals_Convert (REAL x, INT16 n, CHAR *d, ADDRESS d__len); +import void Reals_ConvertH (REAL y, CHAR *d, ADDRESS d__len); +import void Reals_ConvertHL (LONGREAL x, CHAR *d, ADDRESS d__len); +import void Reals_ConvertL (LONGREAL x, INT16 n, CHAR *d, ADDRESS d__len); import INT16 Reals_Expo (REAL x); import INT16 Reals_ExpoL (LONGREAL x); import void Reals_SetExpo (REAL *x, INT16 ex); diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index b5707327..fd550df3 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -10,18 +10,18 @@ -export void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len); -export void Strings_Cap (CHAR *s, LONGINT s__len); -export void Strings_Delete (CHAR *s, LONGINT s__len, INT16 pos, INT16 n); -export void Strings_Extract (CHAR *source, LONGINT source__len, INT16 pos, INT16 n, CHAR *dest, LONGINT dest__len); -export void Strings_Insert (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len); -export INT16 Strings_Length (CHAR *s, LONGINT s__len); -export BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len); -export INT16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, INT16 pos); -export void Strings_Replace (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len); +export void Strings_Append (CHAR *extra, ADDRESS extra__len, CHAR *dest, ADDRESS dest__len); +export void Strings_Cap (CHAR *s, ADDRESS s__len); +export void Strings_Delete (CHAR *s, ADDRESS s__len, INT16 pos, INT16 n); +export void Strings_Extract (CHAR *source, ADDRESS source__len, INT16 pos, INT16 n, CHAR *dest, ADDRESS dest__len); +export void Strings_Insert (CHAR *source, ADDRESS source__len, INT16 pos, CHAR *dest, ADDRESS dest__len); +export INT16 Strings_Length (CHAR *s, ADDRESS s__len); +export BOOLEAN Strings_Match (CHAR *string, ADDRESS string__len, CHAR *pattern, ADDRESS pattern__len); +export INT16 Strings_Pos (CHAR *pattern, ADDRESS pattern__len, CHAR *s, ADDRESS s__len, INT16 pos); +export void Strings_Replace (CHAR *source, ADDRESS source__len, INT16 pos, CHAR *dest, ADDRESS dest__len); -INT16 Strings_Length (CHAR *s, LONGINT s__len) +INT16 Strings_Length (CHAR *s, ADDRESS s__len) { INT32 i; __DUP(s, s__len, CHAR); @@ -39,7 +39,7 @@ INT16 Strings_Length (CHAR *s, LONGINT s__len) __RETCHK; } -void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len) +void Strings_Append (CHAR *extra, ADDRESS extra__len, CHAR *dest, ADDRESS dest__len) { INT16 n1, n2, i; __DUP(extra, extra__len, CHAR); @@ -56,7 +56,7 @@ void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__ __DEL(extra); } -void Strings_Insert (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len) +void Strings_Insert (CHAR *source, ADDRESS source__len, INT16 pos, CHAR *dest, ADDRESS dest__len) { INT16 n1, n2, i; __DUP(source, source__len, CHAR); @@ -87,7 +87,7 @@ void Strings_Insert (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, L __DEL(source); } -void Strings_Delete (CHAR *s, LONGINT s__len, INT16 pos, INT16 n) +void Strings_Delete (CHAR *s, ADDRESS s__len, INT16 pos, INT16 n) { INT16 len, i; len = Strings_Length(s, s__len); @@ -110,7 +110,7 @@ void Strings_Delete (CHAR *s, LONGINT s__len, INT16 pos, INT16 n) } } -void Strings_Replace (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len) +void Strings_Replace (CHAR *source, ADDRESS source__len, INT16 pos, CHAR *dest, ADDRESS dest__len) { __DUP(source, source__len, CHAR); Strings_Delete((void*)dest, dest__len, pos, pos + Strings_Length(source, source__len)); @@ -118,7 +118,7 @@ void Strings_Replace (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, __DEL(source); } -void Strings_Extract (CHAR *source, LONGINT source__len, INT16 pos, INT16 n, CHAR *dest, LONGINT dest__len) +void Strings_Extract (CHAR *source, ADDRESS source__len, INT16 pos, INT16 n, CHAR *dest, ADDRESS dest__len) { INT16 len, destLen, i; __DUP(source, source__len, CHAR); @@ -143,7 +143,7 @@ void Strings_Extract (CHAR *source, LONGINT source__len, INT16 pos, INT16 n, CHA __DEL(source); } -INT16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, INT16 pos) +INT16 Strings_Pos (CHAR *pattern, ADDRESS pattern__len, CHAR *s, ADDRESS s__len, INT16 pos) { INT16 n1, n2, i, j; __DUP(pattern, pattern__len, CHAR); @@ -175,7 +175,7 @@ INT16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, return -1; } -void Strings_Cap (CHAR *s, LONGINT s__len) +void Strings_Cap (CHAR *s, ADDRESS s__len) { INT16 i; i = 0; @@ -191,9 +191,9 @@ static struct Match__7 { struct Match__7 *lnk; } *Match__7_s; -static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, INT16 n, INT16 m); +static BOOLEAN M__8 (CHAR *name, ADDRESS name__len, CHAR *mask, ADDRESS mask__len, INT16 n, INT16 m); -static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, INT16 n, INT16 m) +static BOOLEAN M__8 (CHAR *name, ADDRESS name__len, CHAR *mask, ADDRESS mask__len, INT16 n, INT16 m) { while ((((n >= 0 && m >= 0)) && mask[__X(m, mask__len)] != '*')) { if (name[__X(n, name__len)] != mask[__X(m, mask__len)]) { @@ -220,7 +220,7 @@ static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__le return 0; } -BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len) +BOOLEAN Strings_Match (CHAR *string, ADDRESS string__len, CHAR *pattern, ADDRESS pattern__len) { struct Match__7 _s; BOOLEAN __retval; diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index c987af8d..76cb022d 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h @@ -8,15 +8,15 @@ -import void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len); -import void Strings_Cap (CHAR *s, LONGINT s__len); -import void Strings_Delete (CHAR *s, LONGINT s__len, INT16 pos, INT16 n); -import void Strings_Extract (CHAR *source, LONGINT source__len, INT16 pos, INT16 n, CHAR *dest, LONGINT dest__len); -import void Strings_Insert (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len); -import INT16 Strings_Length (CHAR *s, LONGINT s__len); -import BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len); -import INT16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, INT16 pos); -import void Strings_Replace (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len); +import void Strings_Append (CHAR *extra, ADDRESS extra__len, CHAR *dest, ADDRESS dest__len); +import void Strings_Cap (CHAR *s, ADDRESS s__len); +import void Strings_Delete (CHAR *s, ADDRESS s__len, INT16 pos, INT16 n); +import void Strings_Extract (CHAR *source, ADDRESS source__len, INT16 pos, INT16 n, CHAR *dest, ADDRESS dest__len); +import void Strings_Insert (CHAR *source, ADDRESS source__len, INT16 pos, CHAR *dest, ADDRESS dest__len); +import INT16 Strings_Length (CHAR *s, ADDRESS s__len); +import BOOLEAN Strings_Match (CHAR *string, ADDRESS string__len, CHAR *pattern, ADDRESS pattern__len); +import INT16 Strings_Pos (CHAR *pattern, ADDRESS pattern__len, CHAR *s, ADDRESS s__len, INT16 pos); +import void Strings_Replace (CHAR *source, ADDRESS source__len, INT16 pos, CHAR *dest, ADDRESS dest__len); import void *Strings__init(void); diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index ad26b1cb..1428c051 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -187,20 +187,20 @@ export void Texts_Append (Texts_Text T, Texts_Buffer B); export void Texts_ChangeLooks (Texts_Text T, INT32 beg, INT32 end, UINT32 sel, Texts_FontsFont fnt, INT8 col, INT8 voff); static Texts_Elem Texts_CloneElem (Texts_Elem e); static Texts_Piece Texts_ClonePiece (Texts_Piece p); -export void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len); +export void Texts_Close (Texts_Text T, CHAR *name, ADDRESS name__len); export void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); export void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); export void Texts_Delete (Texts_Text T, INT32 beg, INT32 end); export Texts_Text Texts_ElemBase (Texts_Elem E); export INT32 Texts_ElemPos (Texts_Elem E); static void Texts_Find (Texts_Text T, INT32 *pos, Texts_Run *u, INT32 *org, INT32 *off); -static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len); +static Texts_FontsFont Texts_FontsThis (CHAR *name, ADDRESS name__len); static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, ADDRESS *msg__typ); export void Texts_Insert (Texts_Text T, INT32 pos, Texts_Buffer B); export void Texts_Load (Files_Rider *r, ADDRESS *r__typ, Texts_Text T); static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T); static void Texts_Merge (Texts_Text T, Texts_Run u, Texts_Run *v); -export void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len); +export void Texts_Open (Texts_Text T, CHAR *name, ADDRESS name__len); export void Texts_OpenBuf (Texts_Buffer B); export void Texts_OpenReader (Texts_Reader *R, ADDRESS *R__typ, Texts_Text T, INT32 pos); export void Texts_OpenScanner (Texts_Scanner *S, ADDRESS *S__typ, Texts_Text T, INT32 pos); @@ -229,10 +229,10 @@ export void Texts_WriteLongRealHex (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x export void Texts_WriteReal (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n); export void Texts_WriteRealFix (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n, INT16 k); export void Texts_WriteRealHex (Texts_Writer *W, ADDRESS *W__typ, REAL x); -export void Texts_WriteString (Texts_Writer *W, ADDRESS *W__typ, CHAR *s, LONGINT s__len); +export void Texts_WriteString (Texts_Writer *W, ADDRESS *W__typ, CHAR *s, ADDRESS s__len); -static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len) +static Texts_FontsFont Texts_FontsThis (CHAR *name, ADDRESS name__len) { Texts_FontsFont F = NIL; __NEW(F, Texts_FontDesc); @@ -1027,7 +1027,7 @@ void Texts_WriteLn (Texts_Writer *W, ADDRESS *W__typ) Texts_Write(&*W, W__typ, 0x0d); } -void Texts_WriteString (Texts_Writer *W, ADDRESS *W__typ, CHAR *s, LONGINT s__len) +void Texts_WriteString (Texts_Writer *W, ADDRESS *W__typ, CHAR *s, ADDRESS s__len) { INT16 i; __DUP(s, s__len, CHAR); @@ -1539,7 +1539,7 @@ void Texts_Load (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) Texts_Load0(&*r, r__typ, T); } -void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len) +void Texts_Open (Texts_Text T, CHAR *name, ADDRESS name__len) { Files_File f = NIL; Files_Rider r; @@ -1755,7 +1755,7 @@ void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) Store__39_s = _s.lnk; } -void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len) +void Texts_Close (Texts_Text T, CHAR *name, ADDRESS name__len) { Files_File f = NIL; Files_Rider r; diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index e2c03958..fa28aa92 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h @@ -131,7 +131,7 @@ import ADDRESS *Texts_Writer__typ; import void Texts_Append (Texts_Text T, Texts_Buffer B); import void Texts_ChangeLooks (Texts_Text T, INT32 beg, INT32 end, UINT32 sel, Texts_FontsFont fnt, INT8 col, INT8 voff); -import void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len); +import void Texts_Close (Texts_Text T, CHAR *name, ADDRESS name__len); import void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); import void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); import void Texts_Delete (Texts_Text T, INT32 beg, INT32 end); @@ -139,7 +139,7 @@ import Texts_Text Texts_ElemBase (Texts_Elem E); import INT32 Texts_ElemPos (Texts_Elem E); import void Texts_Insert (Texts_Text T, INT32 pos, Texts_Buffer B); import void Texts_Load (Files_Rider *r, ADDRESS *r__typ, Texts_Text T); -import void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len); +import void Texts_Open (Texts_Text T, CHAR *name, ADDRESS name__len); import void Texts_OpenBuf (Texts_Buffer B); import void Texts_OpenReader (Texts_Reader *R, ADDRESS *R__typ, Texts_Text T, INT32 pos); import void Texts_OpenScanner (Texts_Scanner *S, ADDRESS *S__typ, Texts_Text T, INT32 pos); @@ -166,7 +166,7 @@ import void Texts_WriteLongRealHex (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x import void Texts_WriteReal (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n); import void Texts_WriteRealFix (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n, INT16 k); import void Texts_WriteRealHex (Texts_Writer *W, ADDRESS *W__typ, REAL x); -import void Texts_WriteString (Texts_Writer *W, ADDRESS *W__typ, CHAR *s, LONGINT s__len); +import void Texts_WriteString (Texts_Writer *W, ADDRESS *W__typ, CHAR *s, ADDRESS s__len); import void *Texts__init(void); diff --git a/bootstrap/windows-48/VT100.c b/bootstrap/windows-48/VT100.c index f69fd90e..38c0743f 100644 --- a/bootstrap/windows-48/VT100.c +++ b/bootstrap/windows-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -27,23 +27,23 @@ export void VT100_DECTCEMl (void); export void VT100_DSR (INT16 n); export void VT100_ED (INT16 n); export void VT100_EL (INT16 n); -static void VT100_EscSeq (INT16 n, CHAR *letter, LONGINT letter__len); -static void VT100_EscSeq0 (CHAR *letter, LONGINT letter__len); -static void VT100_EscSeq2 (INT16 n, INT16 m, CHAR *letter, LONGINT letter__len); -static void VT100_EscSeqSwapped (INT16 n, CHAR *letter, LONGINT letter__len); +static void VT100_EscSeq (INT16 n, CHAR *letter, ADDRESS letter__len); +static void VT100_EscSeq0 (CHAR *letter, ADDRESS letter__len); +static void VT100_EscSeq2 (INT16 n, INT16 m, CHAR *letter, ADDRESS letter__len); +static void VT100_EscSeqSwapped (INT16 n, CHAR *letter, ADDRESS letter__len); export void VT100_HVP (INT16 n, INT16 m); -export void VT100_IntToStr (INT32 int_, CHAR *str, LONGINT str__len); +export void VT100_IntToStr (INT32 int_, CHAR *str, ADDRESS str__len); export void VT100_RCP (void); -static void VT100_Reverse0 (CHAR *str, LONGINT str__len, INT16 start, INT16 end); +static void VT100_Reverse0 (CHAR *str, ADDRESS str__len, INT16 start, INT16 end); export void VT100_SCP (void); export void VT100_SD (INT16 n); export void VT100_SGR (INT16 n); export void VT100_SGR2 (INT16 n, INT16 m); export void VT100_SU (INT16 n); -export void VT100_SetAttr (CHAR *attr, LONGINT attr__len); +export void VT100_SetAttr (CHAR *attr, ADDRESS attr__len); -static void VT100_Reverse0 (CHAR *str, LONGINT str__len, INT16 start, INT16 end) +static void VT100_Reverse0 (CHAR *str, ADDRESS str__len, INT16 start, INT16 end) { CHAR h; while (start < end) { @@ -55,7 +55,7 @@ static void VT100_Reverse0 (CHAR *str, LONGINT str__len, INT16 start, INT16 end) } } -void VT100_IntToStr (INT32 int_, CHAR *str, LONGINT str__len) +void VT100_IntToStr (INT32 int_, CHAR *str, ADDRESS str__len) { CHAR b[21]; INT16 s, e; @@ -84,7 +84,7 @@ void VT100_IntToStr (INT32 int_, CHAR *str, LONGINT str__len) __COPY(b, str, str__len); } -static void VT100_EscSeq0 (CHAR *letter, LONGINT letter__len) +static void VT100_EscSeq0 (CHAR *letter, ADDRESS letter__len) { CHAR cmd[9]; __DUP(letter, letter__len, CHAR); @@ -94,7 +94,7 @@ static void VT100_EscSeq0 (CHAR *letter, LONGINT letter__len) __DEL(letter); } -static void VT100_EscSeq (INT16 n, CHAR *letter, LONGINT letter__len) +static void VT100_EscSeq (INT16 n, CHAR *letter, ADDRESS letter__len) { CHAR nstr[2]; CHAR cmd[7]; @@ -107,7 +107,7 @@ static void VT100_EscSeq (INT16 n, CHAR *letter, LONGINT letter__len) __DEL(letter); } -static void VT100_EscSeqSwapped (INT16 n, CHAR *letter, LONGINT letter__len) +static void VT100_EscSeqSwapped (INT16 n, CHAR *letter, ADDRESS letter__len) { CHAR nstr[2]; CHAR cmd[7]; @@ -120,7 +120,7 @@ static void VT100_EscSeqSwapped (INT16 n, CHAR *letter, LONGINT letter__len) __DEL(letter); } -static void VT100_EscSeq2 (INT16 n, INT16 m, CHAR *letter, LONGINT letter__len) +static void VT100_EscSeq2 (INT16 n, INT16 m, CHAR *letter, ADDRESS letter__len) { CHAR nstr[5], mstr[5]; CHAR cmd[12]; @@ -236,7 +236,7 @@ void VT100_DECTCEMh (void) VT100_EscSeq0((CHAR*)"\?25h", 5); } -void VT100_SetAttr (CHAR *attr, LONGINT attr__len) +void VT100_SetAttr (CHAR *attr, ADDRESS attr__len) { CHAR tmpstr[16]; __DUP(attr, attr__len, CHAR); diff --git a/bootstrap/windows-48/VT100.h b/bootstrap/windows-48/VT100.h index d99406ec..4bbb3110 100644 --- a/bootstrap/windows-48/VT100.h +++ b/bootstrap/windows-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h @@ -23,14 +23,14 @@ import void VT100_DSR (INT16 n); import void VT100_ED (INT16 n); import void VT100_EL (INT16 n); import void VT100_HVP (INT16 n, INT16 m); -import void VT100_IntToStr (INT32 int_, CHAR *str, LONGINT str__len); +import void VT100_IntToStr (INT32 int_, CHAR *str, ADDRESS str__len); import void VT100_RCP (void); import void VT100_SCP (void); import void VT100_SD (INT16 n); import void VT100_SGR (INT16 n); import void VT100_SGR2 (INT16 n, INT16 m); import void VT100_SU (INT16 n); -import void VT100_SetAttr (CHAR *attr, LONGINT attr__len); +import void VT100_SetAttr (CHAR *attr, ADDRESS attr__len); import void *VT100__init(void); diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index 37630d23..66f80319 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -17,13 +17,13 @@ static CHAR extTools_CFLAGS[1023]; -export void extTools_Assemble (CHAR *moduleName, LONGINT moduleName__len); -static void extTools_InitialiseCompilerCommand (CHAR *s, LONGINT s__len); -export void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN statically, CHAR *additionalopts, LONGINT additionalopts__len); -static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGINT cmd__len); +export void extTools_Assemble (CHAR *moduleName, ADDRESS moduleName__len); +static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len); +export void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN statically, CHAR *additionalopts, ADDRESS additionalopts__len); +static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRESS cmd__len); -static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGINT cmd__len) +static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRESS cmd__len) { INT16 r, status, exitcode; __DUP(title, title__len, CHAR); @@ -63,7 +63,7 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN __DEL(cmd); } -static void extTools_InitialiseCompilerCommand (CHAR *s, LONGINT s__len) +static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) { __COPY("gcc -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); @@ -74,7 +74,7 @@ static void extTools_InitialiseCompilerCommand (CHAR *s, LONGINT s__len) Strings_Append((CHAR*)" ", 2, (void*)s, s__len); } -void extTools_Assemble (CHAR *moduleName, LONGINT moduleName__len) +void extTools_Assemble (CHAR *moduleName, ADDRESS moduleName__len) { CHAR cmd[1023]; __DUP(moduleName, moduleName__len, CHAR); @@ -86,7 +86,7 @@ void extTools_Assemble (CHAR *moduleName, LONGINT moduleName__len) __DEL(moduleName); } -void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN statically, CHAR *additionalopts, LONGINT additionalopts__len) +void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN statically, CHAR *additionalopts, ADDRESS additionalopts__len) { CHAR cmd[1023]; __DUP(additionalopts, additionalopts__len, CHAR); diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index 63e5df15..472c60f3 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h @@ -8,8 +8,8 @@ -import void extTools_Assemble (CHAR *moduleName, LONGINT moduleName__len); -import void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN statically, CHAR *additionalopts, LONGINT additionalopts__len); +import void extTools_Assemble (CHAR *moduleName, ADDRESS moduleName__len); +import void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN statically, CHAR *additionalopts, ADDRESS additionalopts__len); import void *extTools__init(void); diff --git a/bootstrap/windows-88/Compiler.c b/bootstrap/windows-88/Compiler.c index dc4bb660..e900905f 100644 --- a/bootstrap/windows-88/Compiler.c +++ b/bootstrap/windows-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index 2d0061df..071d7b8e 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index b28e0caa..b1942442 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index c3ea44cf..fce3936a 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -53,7 +53,7 @@ static Files_File Files_files; static INT16 Files_tempno; static CHAR Files_HOME[1024]; static struct { - LONGINT len[1]; + ADDRESS len[1]; CHAR data[1]; } *Files_SearchPath; @@ -63,56 +63,56 @@ export ADDRESS *Files_Rider__typ; export Files_File Files_Base (Files_Rider *r, ADDRESS *r__typ); static Files_File Files_CacheEntry (Platform_FileIdentity identity); -export void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INT16 *res); +export void Files_ChangeDirectory (CHAR *path, ADDRESS path__len, INT16 *res); export void Files_Close (Files_File f); static void Files_CloseOSFile (Files_File f); static void Files_Create (Files_File f); -export void Files_Delete (CHAR *name, LONGINT name__len, INT16 *res); -static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INT16 errcode); +export void Files_Delete (CHAR *name, ADDRESS name__len, INT16 *res); +static void Files_Err (CHAR *s, ADDRESS s__len, Files_File f, INT16 errcode); static void Files_Finalize (SYSTEM_PTR o); -static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *dest, LONGINT dest__len); +static void Files_FlipBytes (SYSTEM_BYTE *src, ADDRESS src__len, SYSTEM_BYTE *dest, ADDRESS dest__len); static void Files_Flush (Files_Buffer buf); export void Files_GetDate (Files_File f, INT32 *t, INT32 *d); -export void Files_GetName (Files_File f, CHAR *name, LONGINT name__len); -static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *name, LONGINT name__len); -static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len); +export void Files_GetName (Files_File f, CHAR *name, ADDRESS name__len); +static void Files_GetTempName (CHAR *finalName, ADDRESS finalName__len, CHAR *name, ADDRESS name__len); +static BOOLEAN Files_HasDir (CHAR *name, ADDRESS name__len); export INT32 Files_Length (Files_File f); -static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT name__len, CHAR *dest, LONGINT dest__len); -export Files_File Files_New (CHAR *name, LONGINT name__len); -export Files_File Files_Old (CHAR *name, LONGINT name__len); +static void Files_MakeFileName (CHAR *dir, ADDRESS dir__len, CHAR *name, ADDRESS name__len, CHAR *dest, ADDRESS dest__len); +export Files_File Files_New (CHAR *name, ADDRESS name__len); +export Files_File Files_Old (CHAR *name, ADDRESS name__len); export INT32 Files_Pos (Files_Rider *r, ADDRESS *r__typ); export void Files_Purge (Files_File f); export void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x); export void Files_ReadBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN *x); -export void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n); +export void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS x__len, INT32 n); export void Files_ReadInt (Files_Rider *R, ADDRESS *R__typ, INT16 *x); export void Files_ReadLInt (Files_Rider *R, ADDRESS *R__typ, INT32 *x); export void Files_ReadLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL *x); -export void Files_ReadLine (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); -export void Files_ReadNum (Files_Rider *R, ADDRESS *R__typ, SYSTEM_BYTE *x, LONGINT x__len); +export void Files_ReadLine (Files_Rider *R, ADDRESS *R__typ, CHAR *x, ADDRESS x__len); +export void Files_ReadNum (Files_Rider *R, ADDRESS *R__typ, SYSTEM_BYTE *x, ADDRESS x__len); export void Files_ReadReal (Files_Rider *R, ADDRESS *R__typ, REAL *x); export void Files_ReadSet (Files_Rider *R, ADDRESS *R__typ, UINT32 *x); -export void Files_ReadString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); +export void Files_ReadString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, ADDRESS x__len); export void Files_Register (Files_File f); -export void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT16 *res); -static void Files_ScanPath (INT16 *pos, CHAR *dir, LONGINT dir__len); +export void Files_Rename (CHAR *old, ADDRESS old__len, CHAR *new, ADDRESS new__len, INT16 *res); +static void Files_ScanPath (INT16 *pos, CHAR *dir, ADDRESS dir__len); export void Files_Set (Files_Rider *r, ADDRESS *r__typ, Files_File f, INT32 pos); -export void Files_SetSearchPath (CHAR *path, LONGINT path__len); +export void Files_SetSearchPath (CHAR *path, ADDRESS path__len); export void Files_Write (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE x); export void Files_WriteBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN x); -export void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n); +export void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS x__len, INT32 n); export void Files_WriteInt (Files_Rider *R, ADDRESS *R__typ, INT16 x); export void Files_WriteLInt (Files_Rider *R, ADDRESS *R__typ, INT32 x); export void Files_WriteLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL x); export void Files_WriteNum (Files_Rider *R, ADDRESS *R__typ, INT64 x); export void Files_WriteReal (Files_Rider *R, ADDRESS *R__typ, REAL x); export void Files_WriteSet (Files_Rider *R, ADDRESS *R__typ, UINT32 x); -export void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); +export void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, ADDRESS x__len); #define Files_IdxTrap() __HALT(-1) #define Files_ToAdr(x) (ADDRESS)x -static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INT16 errcode) +static void Files_Err (CHAR *s, ADDRESS s__len, Files_File f, INT16 errcode) { __DUP(s, s__len, CHAR); Out_Ln(); @@ -139,7 +139,7 @@ static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INT16 errcode) __DEL(s); } -static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT name__len, CHAR *dest, LONGINT dest__len) +static void Files_MakeFileName (CHAR *dir, ADDRESS dir__len, CHAR *name, ADDRESS name__len, CHAR *dest, ADDRESS dest__len) { INT16 i, j; __DUP(dir, dir__len, CHAR); @@ -164,7 +164,7 @@ static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT __DEL(name); } -static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *name, LONGINT name__len) +static void Files_GetTempName (CHAR *finalName, ADDRESS finalName__len, CHAR *name, ADDRESS name__len) { INT32 n, i, j; __DUP(finalName, finalName__len, CHAR); @@ -317,7 +317,7 @@ INT32 Files_Length (Files_File f) return f->len; } -Files_File Files_New (CHAR *name, LONGINT name__len) +Files_File Files_New (CHAR *name, ADDRESS name__len) { Files_File f = NIL; __DUP(name, name__len, CHAR); @@ -333,7 +333,7 @@ Files_File Files_New (CHAR *name, LONGINT name__len) return f; } -static void Files_ScanPath (INT16 *pos, CHAR *dir, LONGINT dir__len) +static void Files_ScanPath (INT16 *pos, CHAR *dir, ADDRESS dir__len) { INT16 i; CHAR ch; @@ -376,7 +376,7 @@ static void Files_ScanPath (INT16 *pos, CHAR *dir, LONGINT dir__len) dir[i] = 0x00; } -static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len) +static BOOLEAN Files_HasDir (CHAR *name, ADDRESS name__len) { INT16 i; CHAR ch; @@ -416,7 +416,7 @@ static Files_File Files_CacheEntry (Platform_FileIdentity identity) return NIL; } -Files_File Files_Old (CHAR *name, LONGINT name__len) +Files_File Files_Old (CHAR *name, ADDRESS name__len) { Files_File f = NIL; INT64 fd; @@ -619,7 +619,7 @@ void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x) } } -void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n) +void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS x__len, INT32 n) { INT32 xpos, min, restInBuf, offset; Files_Buffer buf = NIL; @@ -684,7 +684,7 @@ void Files_Write (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE x) (*r).res = 0; } -void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n) +void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS x__len, INT32 n) { INT32 xpos, min, restInBuf, offset; Files_Buffer buf = NIL; @@ -723,14 +723,14 @@ void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT (*r).res = 0; } -void Files_Delete (CHAR *name, LONGINT name__len, INT16 *res) +void Files_Delete (CHAR *name, ADDRESS name__len, INT16 *res) { __DUP(name, name__len, CHAR); *res = Platform_Unlink((void*)name, name__len); __DEL(name); } -void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT16 *res) +void Files_Rename (CHAR *old, ADDRESS old__len, CHAR *new, ADDRESS new__len, INT16 *res) { INT64 fdold, fdnew; INT32 n; @@ -814,14 +814,14 @@ void Files_Register (Files_File f) } } -void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INT16 *res) +void Files_ChangeDirectory (CHAR *path, ADDRESS path__len, INT16 *res) { __DUP(path, path__len, CHAR); *res = Platform_Chdir((void*)path, path__len); __DEL(path); } -static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *dest, LONGINT dest__len) +static void Files_FlipBytes (SYSTEM_BYTE *src, ADDRESS src__len, SYSTEM_BYTE *dest, ADDRESS dest__len) { INT32 i, j; if (!Platform_LittleEndian) { @@ -879,7 +879,7 @@ void Files_ReadLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL *x) Files_FlipBytes((void*)b, 8, (void*)&*x, 8); } -void Files_ReadString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len) +void Files_ReadString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, ADDRESS x__len) { INT16 i; CHAR ch; @@ -891,7 +891,7 @@ void Files_ReadString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len) } while (!(ch == 0x00)); } -void Files_ReadLine (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len) +void Files_ReadLine (Files_Rider *R, ADDRESS *R__typ, CHAR *x, ADDRESS x__len) { INT16 i; i = 0; @@ -908,7 +908,7 @@ void Files_ReadLine (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len) x[i] = 0x00; } -void Files_ReadNum (Files_Rider *R, ADDRESS *R__typ, SYSTEM_BYTE *x, LONGINT x__len) +void Files_ReadNum (Files_Rider *R, ADDRESS *R__typ, SYSTEM_BYTE *x, ADDRESS x__len) { INT8 s, b; INT64 q; @@ -974,7 +974,7 @@ void Files_WriteLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL x) Files_WriteBytes(&*R, R__typ, (void*)b, 8, 8); } -void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len) +void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, ADDRESS x__len) { INT16 i; i = 0; @@ -993,7 +993,7 @@ void Files_WriteNum (Files_Rider *R, ADDRESS *R__typ, INT64 x) Files_Write(&*R, R__typ, (CHAR)__MASK(x, -128)); } -void Files_GetName (Files_File f, CHAR *name, LONGINT name__len) +void Files_GetName (Files_File f, CHAR *name, ADDRESS name__len) { __COPY(f->workName, name, name__len); } @@ -1011,7 +1011,7 @@ static void Files_Finalize (SYSTEM_PTR o) } } -void Files_SetSearchPath (CHAR *path, LONGINT path__len) +void Files_SetSearchPath (CHAR *path, ADDRESS path__len) { __DUP(path, path__len, CHAR); if (Strings_Length(path, path__len) != 0) { diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 5c402312..7459e85e 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h @@ -29,41 +29,41 @@ import ADDRESS *Files_FileDesc__typ; import ADDRESS *Files_Rider__typ; import Files_File Files_Base (Files_Rider *r, ADDRESS *r__typ); -import void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INT16 *res); +import void Files_ChangeDirectory (CHAR *path, ADDRESS path__len, INT16 *res); import void Files_Close (Files_File f); -import void Files_Delete (CHAR *name, LONGINT name__len, INT16 *res); +import void Files_Delete (CHAR *name, ADDRESS name__len, INT16 *res); import void Files_GetDate (Files_File f, INT32 *t, INT32 *d); -import void Files_GetName (Files_File f, CHAR *name, LONGINT name__len); +import void Files_GetName (Files_File f, CHAR *name, ADDRESS name__len); import INT32 Files_Length (Files_File f); -import Files_File Files_New (CHAR *name, LONGINT name__len); -import Files_File Files_Old (CHAR *name, LONGINT name__len); +import Files_File Files_New (CHAR *name, ADDRESS name__len); +import Files_File Files_Old (CHAR *name, ADDRESS name__len); import INT32 Files_Pos (Files_Rider *r, ADDRESS *r__typ); import void Files_Purge (Files_File f); import void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x); import void Files_ReadBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN *x); -import void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n); +import void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS x__len, INT32 n); import void Files_ReadInt (Files_Rider *R, ADDRESS *R__typ, INT16 *x); import void Files_ReadLInt (Files_Rider *R, ADDRESS *R__typ, INT32 *x); import void Files_ReadLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL *x); -import void Files_ReadLine (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); -import void Files_ReadNum (Files_Rider *R, ADDRESS *R__typ, SYSTEM_BYTE *x, LONGINT x__len); +import void Files_ReadLine (Files_Rider *R, ADDRESS *R__typ, CHAR *x, ADDRESS x__len); +import void Files_ReadNum (Files_Rider *R, ADDRESS *R__typ, SYSTEM_BYTE *x, ADDRESS x__len); import void Files_ReadReal (Files_Rider *R, ADDRESS *R__typ, REAL *x); import void Files_ReadSet (Files_Rider *R, ADDRESS *R__typ, UINT32 *x); -import void Files_ReadString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); +import void Files_ReadString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, ADDRESS x__len); import void Files_Register (Files_File f); -import void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT16 *res); +import void Files_Rename (CHAR *old, ADDRESS old__len, CHAR *new, ADDRESS new__len, INT16 *res); import void Files_Set (Files_Rider *r, ADDRESS *r__typ, Files_File f, INT32 pos); -import void Files_SetSearchPath (CHAR *path, LONGINT path__len); +import void Files_SetSearchPath (CHAR *path, ADDRESS path__len); import void Files_Write (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE x); import void Files_WriteBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN x); -import void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n); +import void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS x__len, INT32 n); import void Files_WriteInt (Files_Rider *R, ADDRESS *R__typ, INT16 x); import void Files_WriteLInt (Files_Rider *R, ADDRESS *R__typ, INT32 x); import void Files_WriteLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL x); import void Files_WriteNum (Files_Rider *R, ADDRESS *R__typ, INT64 x); import void Files_WriteReal (Files_Rider *R, ADDRESS *R__typ, REAL x); import void Files_WriteSet (Files_Rider *R, ADDRESS *R__typ, UINT32 x); -import void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); +import void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, ADDRESS x__len); import void *Files__init(void); diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index a2bb8f2f..032e9544 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -85,14 +85,14 @@ static void Heap_ExtendHeap (INT64 blksz); export void Heap_FINALL (void); static void Heap_Finalize (void); export void Heap_GC (BOOLEAN markStack); -static void Heap_HeapSort (INT64 n, INT64 *a, LONGINT a__len); +static void Heap_HeapSort (INT64 n, INT64 *a, ADDRESS a__len); export void Heap_INCREF (Heap_Module m); export void Heap_InitHeap (void); export void Heap_Lock (void); static void Heap_Mark (INT64 q); -static void Heap_MarkCandidates (INT64 n, INT64 *cand, LONGINT cand__len); +static void Heap_MarkCandidates (INT64 n, INT64 *cand, ADDRESS cand__len); static void Heap_MarkP (SYSTEM_PTR p); -static void Heap_MarkStack (INT64 n, INT64 *cand, LONGINT cand__len); +static void Heap_MarkStack (INT64 n, INT64 *cand, ADDRESS cand__len); export SYSTEM_PTR Heap_NEWBLK (INT64 size); export SYSTEM_PTR Heap_NEWREC (INT64 tag); static INT64 Heap_NewChunk (INT64 blksz); @@ -101,7 +101,7 @@ export SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); export void Heap_REGTYP (Heap_Module m, INT64 typ); export void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); static void Heap_Scan (void); -static void Heap_Sift (INT64 l, INT64 r, INT64 *a, LONGINT a__len); +static void Heap_Sift (INT64 l, INT64 r, INT64 *a, ADDRESS a__len); export void Heap_Unlock (void); extern void *Heap__init(); @@ -445,7 +445,7 @@ static void Heap_Scan (void) } } -static void Heap_Sift (INT64 l, INT64 r, INT64 *a, LONGINT a__len) +static void Heap_Sift (INT64 l, INT64 r, INT64 *a, ADDRESS a__len) { INT64 i, j, x; j = l; @@ -464,7 +464,7 @@ static void Heap_Sift (INT64 l, INT64 r, INT64 *a, LONGINT a__len) a[i] = x; } -static void Heap_HeapSort (INT64 n, INT64 *a, LONGINT a__len) +static void Heap_HeapSort (INT64 n, INT64 *a, ADDRESS a__len) { INT64 l, r, x; l = __ASHR(n, 1); @@ -482,7 +482,7 @@ static void Heap_HeapSort (INT64 n, INT64 *a, LONGINT a__len) } } -static void Heap_MarkCandidates (INT64 n, INT64 *cand, LONGINT cand__len) +static void Heap_MarkCandidates (INT64 n, INT64 *cand, ADDRESS cand__len) { INT64 chnk, adr, tag, next, lim, lim1, i, ptr, size; chnk = Heap_heap; @@ -571,7 +571,7 @@ void Heap_FINALL (void) } } -static void Heap_MarkStack (INT64 n, INT64 *cand, LONGINT cand__len) +static void Heap_MarkStack (INT64 n, INT64 *cand, ADDRESS cand__len) { SYSTEM_PTR frame; INT64 inc, nofcand, sp, p, stack0; diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index 163cad8c..bf12c17b 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 4e4d62e7..12ee85c4 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -47,21 +47,21 @@ export Modules_ModuleName Modules_imported, Modules_importing; export ADDRESS *Modules_ModuleDesc__typ; export ADDRESS *Modules_CmdDesc__typ; -static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len); +static void Modules_Append (CHAR *a, ADDRESS a__len, CHAR *b, ADDRESS b__len); export void Modules_AssertFail (INT32 code); static void Modules_DisplayHaltCode (INT32 code); -export void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all); +export void Modules_Free (CHAR *name, ADDRESS name__len, BOOLEAN all); export void Modules_Halt (INT32 code); -export Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len); -export Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len); +export Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, ADDRESS name__len); +export Modules_Module Modules_ThisMod (CHAR *name, ADDRESS name__len); static void Modules_errch (CHAR c); static void Modules_errint (INT32 l); -static void Modules_errstring (CHAR *s, LONGINT s__len); +static void Modules_errstring (CHAR *s, ADDRESS s__len); #define Modules_modules() (Modules_Module)Heap_modules #define Modules_setmodules(m) Heap_modules = m -static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len) +static void Modules_Append (CHAR *a, ADDRESS a__len, CHAR *b, ADDRESS b__len) { INT16 i, j; __DUP(b, b__len, CHAR); @@ -79,7 +79,7 @@ static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len) __DEL(b); } -Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len) +Modules_Module Modules_ThisMod (CHAR *name, ADDRESS name__len) { Modules_Module m = NIL; CHAR bodyname[64]; @@ -103,7 +103,7 @@ Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len) return m; } -Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len) +Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, ADDRESS name__len) { Modules_Cmd c = NIL; __DUP(name, name__len, CHAR); @@ -130,7 +130,7 @@ Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT nam __RETCHK; } -void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all) +void Modules_Free (CHAR *name, ADDRESS name__len, BOOLEAN all) { Modules_Module m = NIL, p = NIL; __DUP(name, name__len, CHAR); @@ -168,7 +168,7 @@ static void Modules_errch (CHAR c) e = Platform_Write(1, (ADDRESS)&c, 1); } -static void Modules_errstring (CHAR *s, LONGINT s__len) +static void Modules_errstring (CHAR *s, ADDRESS s__len) { INT32 i; __DUP(s, s__len, CHAR); diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index 8bb89fe5..b1f2385e 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h @@ -44,10 +44,10 @@ import ADDRESS *Modules_ModuleDesc__typ; import ADDRESS *Modules_CmdDesc__typ; import void Modules_AssertFail (INT32 code); -import void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all); +import void Modules_Free (CHAR *name, ADDRESS name__len, BOOLEAN all); import void Modules_Halt (INT32 code); -import Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len); -import Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len); +import Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, ADDRESS name__len); +import Modules_Module Modules_ThisMod (CHAR *name, ADDRESS name__len); import void *Modules__init(void); diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index 3ef8e2f9..bc44b83a 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index 0be714e8..eb93787e 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index ef4b429f..72e0feef 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -56,7 +56,7 @@ static void OPC_GenHeaderMsg (void); export void OPC_Halt (INT32 n); export void OPC_Ident (OPT_Object obj); static void OPC_IdentList (OPT_Object obj, INT16 vis); -static void OPC_Include (CHAR *name, LONGINT name__len); +static void OPC_Include (CHAR *name, ADDRESS name__len); static void OPC_IncludeImports (OPT_Object obj, INT16 vis); export void OPC_Increment (BOOLEAN decrement); export void OPC_Indent (INT16 count); @@ -68,11 +68,11 @@ static void OPC_InitTProcs (OPT_Object typ, OPT_Object obj); export void OPC_IntLiteral (INT64 n, INT32 size); export void OPC_Len (OPT_Object obj, OPT_Struct array, INT64 dim); static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName); -static INT16 OPC_Length (CHAR *s, LONGINT s__len); +static INT16 OPC_Length (CHAR *s, ADDRESS s__len); export BOOLEAN OPC_NeedsRetval (OPT_Object proc); export INT32 OPC_NofPtrs (OPT_Struct typ); -static INT16 OPC_PerfectHash (CHAR *s, LONGINT s__len); -static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len); +static INT16 OPC_PerfectHash (CHAR *s, ADDRESS s__len); +static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, ADDRESS y__len); static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define); static void OPC_ProcPredefs (OPT_Object obj, INT8 vis); static void OPC_PutBase (OPT_Struct typ); @@ -80,8 +80,8 @@ static void OPC_PutPtrOffsets (OPT_Struct typ, INT32 adr, INT32 *cnt); static void OPC_RegCmds (OPT_Object obj); export void OPC_SetInclude (BOOLEAN exclude); static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause); -static void OPC_Str1 (CHAR *s, LONGINT s__len, INT32 x); -static void OPC_StringLiteral (CHAR *s, LONGINT s__len, INT32 l); +static void OPC_Str1 (CHAR *s, ADDRESS s__len, INT32 x); +static void OPC_StringLiteral (CHAR *s, ADDRESS s__len, INT32 l); export void OPC_TDescDecl (OPT_Struct typ); export void OPC_TypeDefs (OPT_Object obj, INT16 vis); export void OPC_TypeOf (OPT_Object ap); @@ -137,7 +137,7 @@ void OPC_EndBlk0 (void) OPM_Write('}'); } -static void OPC_Str1 (CHAR *s, LONGINT s__len, INT32 x) +static void OPC_Str1 (CHAR *s, ADDRESS s__len, INT32 x) { CHAR ch; INT16 i; @@ -156,7 +156,7 @@ static void OPC_Str1 (CHAR *s, LONGINT s__len, INT32 x) __DEL(s); } -static INT16 OPC_Length (CHAR *s, LONGINT s__len) +static INT16 OPC_Length (CHAR *s, ADDRESS s__len) { INT16 i; i = 0; @@ -166,7 +166,7 @@ static INT16 OPC_Length (CHAR *s, LONGINT s__len) return i; } -static INT16 OPC_PerfectHash (CHAR *s, LONGINT s__len) +static INT16 OPC_PerfectHash (CHAR *s, ADDRESS s__len) { INT16 i, h; i = 0; @@ -364,7 +364,7 @@ static void OPC_DeclareBase (OPT_Object dcl) OPM_WriteString((CHAR*)"struct ", 8); OPC_BegBlk(); OPC_BegStat(); - OPC_Str1((CHAR*)"LONGINT len[#]", 15, nofdims); + OPC_Str1((CHAR*)"ADDRESS len[#]", 15, nofdims); OPC_EndStat(); OPC_BegStat(); __NEW(obj, OPT_ObjDesc); @@ -511,7 +511,7 @@ static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamNa typ = par->typ->BaseTyp; while (typ->comp == 3) { if (ansiDefine) { - OPM_WriteString((CHAR*)", LONGINT ", 11); + OPM_WriteString((CHAR*)", ADDRESS ", 11); } else { OPM_WriteString((CHAR*)", ", 3); } @@ -720,7 +720,7 @@ static void OPC_DefineType (OPT_Struct str) } } -static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len) +static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, ADDRESS y__len) { INT16 i; __DUP(y, y__len, CHAR); @@ -969,7 +969,7 @@ static void OPC_IdentList (OPT_Object obj, INT16 vis) OPC_EndStat(); OPC_BegStat(); base = OPT_linttyp; - OPM_WriteString((CHAR*)"LONGINT ", 9); + OPM_WriteString((CHAR*)"ADDRESS ", 9); OPC_LenList(obj, 0, 1); } else if ((obj->mode == 2 && obj->typ->comp == 4)) { OPC_EndStat(); @@ -1008,7 +1008,7 @@ static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames) __COPY(name, obj->name, 256); } if (obj->typ->comp == 3) { - OPM_WriteString((CHAR*)", LONGINT ", 11); + OPM_WriteString((CHAR*)", ADDRESS ", 11); OPC_LenList(obj, 1, showParamNames); } else if ((obj->mode == 2 && obj->typ->comp == 4)) { OPM_WriteString((CHAR*)", ADDRESS *", 12); @@ -1062,7 +1062,7 @@ static void OPC_ProcPredefs (OPT_Object obj, INT8 vis) } } -static void OPC_Include (CHAR *name, LONGINT name__len) +static void OPC_Include (CHAR *name, ADDRESS name__len) { __DUP(name, name__len, CHAR); OPM_WriteString((CHAR*)"#include ", 10); @@ -1744,7 +1744,7 @@ static void OPC_CharacterLiteral (INT64 c) } } -static void OPC_StringLiteral (CHAR *s, LONGINT s__len, INT32 l) +static void OPC_StringLiteral (CHAR *s, ADDRESS s__len, INT32 l) { INT32 i; INT16 c; @@ -1912,9 +1912,9 @@ static struct InitKeywords__46 { struct InitKeywords__46 *lnk; } *InitKeywords__46_s; -static void Enter__47 (CHAR *s, LONGINT s__len); +static void Enter__47 (CHAR *s, ADDRESS s__len); -static void Enter__47 (CHAR *s, LONGINT s__len) +static void Enter__47 (CHAR *s, ADDRESS s__len) { INT16 h; __DUP(s, s__len, CHAR); diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index 842e7dec..5624314d 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 60ab38c7..b2fd5536 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -53,26 +53,26 @@ export void OPM_FPrintLReal (INT32 *fp, LONGREAL val); export void OPM_FPrintReal (INT32 *fp, REAL val); export void OPM_FPrintSet (INT32 *fp, UINT64 val); static void OPM_FindLine (Files_File f, Files_Rider *r, ADDRESS *r__typ, INT64 pos); -static void OPM_FingerprintBytes (INT32 *fp, SYSTEM_BYTE *bytes, LONGINT bytes__len); +static void OPM_FingerprintBytes (INT32 *fp, SYSTEM_BYTE *bytes, ADDRESS bytes__len); export void OPM_Get (CHAR *ch); -export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); +export void OPM_Init (BOOLEAN *done, CHAR *mname, ADDRESS mname__len); export void OPM_InitOptions (void); export INT16 OPM_Integer (INT64 n); static void OPM_LogErrMsg (INT16 n); -export void OPM_LogVT100 (CHAR *vt100code, LONGINT vt100code__len); +export void OPM_LogVT100 (CHAR *vt100code, ADDRESS vt100code__len); export void OPM_LogW (CHAR ch); export void OPM_LogWLn (void); export void OPM_LogWNum (INT64 i, INT64 len); -export void OPM_LogWStr (CHAR *s, LONGINT s__len); +export void OPM_LogWStr (CHAR *s, ADDRESS s__len); export INT32 OPM_Longint (INT64 n); -static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len); +static void OPM_MakeFileName (CHAR *name, ADDRESS name__len, CHAR *FName, ADDRESS FName__len, CHAR *ext, ADDRESS ext__len); export void OPM_Mark (INT16 n, INT32 pos); -export void OPM_NewSym (CHAR *modName, LONGINT modName__len); -export void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); -export void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); +export void OPM_NewSym (CHAR *modName, ADDRESS modName__len); +export void OPM_OldSym (CHAR *modName, ADDRESS modName__len, BOOLEAN *done); +export void OPM_OpenFiles (CHAR *moduleName, ADDRESS moduleName__len); export BOOLEAN OPM_OpenPar (void); export void OPM_RegisterNewSym (void); -static void OPM_ScanOptions (CHAR *s, LONGINT s__len); +static void OPM_ScanOptions (CHAR *s, ADDRESS s__len); static void OPM_ShowLine (INT64 pos); export INT64 OPM_SignedMaximum (INT32 bytecount); export INT64 OPM_SignedMinimum (INT32 bytecount); @@ -93,8 +93,8 @@ export void OPM_WriteHex (INT64 i); export void OPM_WriteInt (INT64 i); export void OPM_WriteLn (void); export void OPM_WriteReal (LONGREAL r, CHAR suffx); -export void OPM_WriteString (CHAR *s, LONGINT s__len); -export void OPM_WriteStringVar (CHAR *s, LONGINT s__len); +export void OPM_WriteString (CHAR *s, ADDRESS s__len); +export void OPM_WriteStringVar (CHAR *s, ADDRESS s__len); export BOOLEAN OPM_eofSF (void); export void OPM_err (INT16 n); @@ -105,7 +105,7 @@ void OPM_LogW (CHAR ch) Out_Char(ch); } -void OPM_LogWStr (CHAR *s, LONGINT s__len) +void OPM_LogWStr (CHAR *s, ADDRESS s__len) { __DUP(s, s__len, CHAR); Out_String(s, s__len); @@ -122,7 +122,7 @@ void OPM_LogWLn (void) Out_Ln(); } -void OPM_LogVT100 (CHAR *vt100code, LONGINT vt100code__len) +void OPM_LogVT100 (CHAR *vt100code, ADDRESS vt100code__len) { __DUP(vt100code, vt100code__len, CHAR); if ((Out_IsConsole && !__IN(16, OPM_Options, 32))) { @@ -154,7 +154,7 @@ INT16 OPM_Integer (INT64 n) return __VAL(INT16, n); } -static void OPM_ScanOptions (CHAR *s, LONGINT s__len) +static void OPM_ScanOptions (CHAR *s, ADDRESS s__len) { INT16 i; __DUP(s, s__len, CHAR); @@ -465,7 +465,7 @@ void OPM_InitOptions (void) Files_SetSearchPath(searchpath, 1024); } -void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len) +void OPM_Init (BOOLEAN *done, CHAR *mname, ADDRESS mname__len) { Texts_Text T = NIL; INT32 beg, end, time; @@ -514,7 +514,7 @@ void OPM_Get (CHAR *ch) } } -static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len) +static void OPM_MakeFileName (CHAR *name, ADDRESS name__len, CHAR *FName, ADDRESS FName__len, CHAR *ext, ADDRESS ext__len) { INT16 i, j; CHAR ch; @@ -700,7 +700,7 @@ void OPM_err (INT16 n) OPM_Mark(n, OPM_errpos); } -static void OPM_FingerprintBytes (INT32 *fp, SYSTEM_BYTE *bytes, LONGINT bytes__len) +static void OPM_FingerprintBytes (INT32 *fp, SYSTEM_BYTE *bytes, ADDRESS bytes__len) { INT16 i; INT32 l; @@ -772,7 +772,7 @@ void OPM_CloseOldSym (void) Files_Close(Files_Base(&OPM_oldSF, Files_Rider__typ)); } -void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done) +void OPM_OldSym (CHAR *modName, ADDRESS modName__len, BOOLEAN *done) { CHAR tag, ver; OPM_FileName fileName; @@ -832,7 +832,7 @@ void OPM_DeleteNewSym (void) { } -void OPM_NewSym (CHAR *modName, LONGINT modName__len) +void OPM_NewSym (CHAR *modName, ADDRESS modName__len) { OPM_FileName fileName; OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, 32, (CHAR*)".sym", 5); @@ -851,7 +851,7 @@ void OPM_Write (CHAR ch) Files_Write(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, ch); } -void OPM_WriteString (CHAR *s, LONGINT s__len) +void OPM_WriteString (CHAR *s, ADDRESS s__len) { INT16 i; i = 0; @@ -861,7 +861,7 @@ void OPM_WriteString (CHAR *s, LONGINT s__len) Files_WriteBytes(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, (void*)s, s__len * 1, i); } -void OPM_WriteStringVar (CHAR *s, LONGINT s__len) +void OPM_WriteStringVar (CHAR *s, ADDRESS s__len) { INT16 i; i = 0; @@ -986,7 +986,7 @@ static void OPM_Append (Files_Rider *R, ADDRESS *R__typ, Files_File F) } } -void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len) +void OPM_OpenFiles (CHAR *moduleName, ADDRESS moduleName__len) { CHAR FName[32]; __COPY(moduleName, OPM_modName, 32); diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index 2d272feb..c310c421 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h @@ -28,19 +28,19 @@ import void OPM_FPrintLReal (INT32 *fp, LONGREAL val); import void OPM_FPrintReal (INT32 *fp, REAL val); import void OPM_FPrintSet (INT32 *fp, UINT64 val); import void OPM_Get (CHAR *ch); -import void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); +import void OPM_Init (BOOLEAN *done, CHAR *mname, ADDRESS mname__len); import void OPM_InitOptions (void); import INT16 OPM_Integer (INT64 n); -import void OPM_LogVT100 (CHAR *vt100code, LONGINT vt100code__len); +import void OPM_LogVT100 (CHAR *vt100code, ADDRESS vt100code__len); import void OPM_LogW (CHAR ch); import void OPM_LogWLn (void); import void OPM_LogWNum (INT64 i, INT64 len); -import void OPM_LogWStr (CHAR *s, LONGINT s__len); +import void OPM_LogWStr (CHAR *s, ADDRESS s__len); import INT32 OPM_Longint (INT64 n); import void OPM_Mark (INT16 n, INT32 pos); -import void OPM_NewSym (CHAR *modName, LONGINT modName__len); -import void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); -import void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); +import void OPM_NewSym (CHAR *modName, ADDRESS modName__len); +import void OPM_OldSym (CHAR *modName, ADDRESS modName__len, BOOLEAN *done); +import void OPM_OpenFiles (CHAR *moduleName, ADDRESS moduleName__len); import BOOLEAN OPM_OpenPar (void); import void OPM_RegisterNewSym (void); import INT64 OPM_SignedMaximum (INT32 bytecount); @@ -61,8 +61,8 @@ import void OPM_WriteHex (INT64 i); import void OPM_WriteInt (INT64 i); import void OPM_WriteLn (void); import void OPM_WriteReal (LONGREAL r, CHAR suffx); -import void OPM_WriteString (CHAR *s, LONGINT s__len); -import void OPM_WriteStringVar (CHAR *s, LONGINT s__len); +import void OPM_WriteString (CHAR *s, ADDRESS s__len); +import void OPM_WriteStringVar (CHAR *s, ADDRESS s__len); import BOOLEAN OPM_eofSF (void); import void OPM_err (INT16 n); import void *OPM__init(void); diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index df908a43..e6b89be2 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index 5a71eb39..acb2df91 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index 6ee700e5..7aedbbd6 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index 1f7a3e58..e49c222b 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index a8d42b40..4a900e78 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -120,7 +120,7 @@ static void OPT_EnterTyp (OPS_Name name, INT8 form, INT16 size, OPT_Struct *res) static void OPT_EnterTypeAlias (OPS_Name name, OPT_Object *res); export void OPT_Export (BOOLEAN *ext, BOOLEAN *new); export void OPT_FPrintErr (OPT_Object obj, INT16 errcode); -static void OPT_FPrintName (INT32 *fp, CHAR *name, LONGINT name__len); +static void OPT_FPrintName (INT32 *fp, CHAR *name, ADDRESS name__len); export void OPT_FPrintObj (OPT_Object obj); static void OPT_FPrintSign (INT32 *fp, OPT_Struct result, OPT_Object par); export void OPT_FPrintStr (OPT_Struct typ); @@ -132,7 +132,7 @@ export void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); static void OPT_InConstant (INT32 f, OPT_Const conval); static OPT_Object OPT_InFld (void); static void OPT_InMod (INT8 *mno); -static void OPT_InName (CHAR *name, LONGINT name__len); +static void OPT_InName (CHAR *name, ADDRESS name__len); static OPT_Object OPT_InObj (INT8 mno); static void OPT_InSign (INT8 mno, OPT_Struct *res, OPT_Object *par); static void OPT_InStruct (OPT_Struct *typ); @@ -155,7 +155,7 @@ static void OPT_OutConstant (OPT_Object obj); static void OPT_OutFlds (OPT_Object fld, INT32 adr, BOOLEAN visible); static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, INT32 adr); static void OPT_OutMod (INT16 mno); -static void OPT_OutName (CHAR *name, LONGINT name__len); +static void OPT_OutName (CHAR *name, ADDRESS name__len); static void OPT_OutObj (OPT_Object obj); static void OPT_OutSign (OPT_Struct result, OPT_Object par); static void OPT_OutStr (OPT_Struct typ); @@ -576,7 +576,7 @@ void OPT_Insert (OPS_Name name, OPT_Object *obj) *obj = ob1; } -static void OPT_FPrintName (INT32 *fp, CHAR *name, LONGINT name__len) +static void OPT_FPrintName (INT32 *fp, CHAR *name, ADDRESS name__len) { INT16 i; CHAR ch; @@ -957,7 +957,7 @@ void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old) } } -static void OPT_InName (CHAR *name, LONGINT name__len) +static void OPT_InName (CHAR *name, ADDRESS name__len) { INT16 i; CHAR ch; @@ -1483,7 +1483,7 @@ void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) } } -static void OPT_OutName (CHAR *name, LONGINT name__len) +static void OPT_OutName (CHAR *name, ADDRESS name__len) { INT16 i; CHAR ch; diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 90fcacf5..9d34cea9 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 4bd6b3fb..1b610f35 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index c4a61586..0f1980ac 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Out.c b/bootstrap/windows-88/Out.c index 720267fd..de9a7701 100644 --- a/bootstrap/windows-88/Out.c +++ b/bootstrap/windows-88/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -17,16 +17,16 @@ static INT16 Out_in; export void Out_Char (CHAR ch); export void Out_Flush (void); export void Out_Int (INT64 x, INT64 n); -static INT32 Out_Length (CHAR *s, LONGINT s__len); +static INT32 Out_Length (CHAR *s, ADDRESS s__len); export void Out_Ln (void); export void Out_LongReal (LONGREAL x, INT16 n); export void Out_Open (void); export void Out_Real (REAL x, INT16 n); static void Out_RealP (LONGREAL x, INT16 n, BOOLEAN long_); -export void Out_String (CHAR *str, LONGINT str__len); +export void Out_String (CHAR *str, ADDRESS str__len); export LONGREAL Out_Ten (INT16 e); -static void Out_digit (INT64 n, CHAR *s, LONGINT s__len, INT16 *i); -static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, INT16 *i); +static void Out_digit (INT64 n, CHAR *s, ADDRESS s__len, INT16 *i); +static void Out_prepend (CHAR *t, ADDRESS t__len, CHAR *s, ADDRESS s__len, INT16 *i); #define Out_Entier64(x) (INT64)(x) @@ -55,7 +55,7 @@ void Out_Char (CHAR ch) } } -static INT32 Out_Length (CHAR *s, LONGINT s__len) +static INT32 Out_Length (CHAR *s, ADDRESS s__len) { INT32 l; l = 0; @@ -65,7 +65,7 @@ static INT32 Out_Length (CHAR *s, LONGINT s__len) return l; } -void Out_String (CHAR *str, LONGINT str__len) +void Out_String (CHAR *str, ADDRESS str__len) { INT32 l; INT16 error; @@ -125,13 +125,13 @@ void Out_Ln (void) Out_Flush(); } -static void Out_digit (INT64 n, CHAR *s, LONGINT s__len, INT16 *i) +static void Out_digit (INT64 n, CHAR *s, ADDRESS s__len, INT16 *i) { *i -= 1; s[__X(*i, s__len)] = (CHAR)(__MOD(n, 10) + 48); } -static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, INT16 *i) +static void Out_prepend (CHAR *t, ADDRESS t__len, CHAR *s, ADDRESS s__len, INT16 *i) { INT16 j; INT32 l; diff --git a/bootstrap/windows-88/Out.h b/bootstrap/windows-88/Out.h index 0e66420d..d58a17d5 100644 --- a/bootstrap/windows-88/Out.h +++ b/bootstrap/windows-88/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h @@ -16,7 +16,7 @@ import void Out_Ln (void); import void Out_LongReal (LONGREAL x, INT16 n); import void Out_Open (void); import void Out_Real (REAL x, INT16 n); -import void Out_String (CHAR *str, LONGINT str__len); +import void Out_String (CHAR *str, ADDRESS str__len); import LONGREAL Out_Ten (INT16 e); import void *Out__init(void); diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 1e93deb2..9aa7ae12 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -48,8 +48,8 @@ export CHAR Platform_NL[3]; export ADDRESS *Platform_FileIdentity__typ; export BOOLEAN Platform_Absent (INT16 e); -export INT16 Platform_ArgPos (CHAR *s, LONGINT s__len); -export INT16 Platform_Chdir (CHAR *n, LONGINT n__len); +export INT16 Platform_ArgPos (CHAR *s, ADDRESS s__len); +export INT16 Platform_Chdir (CHAR *n, ADDRESS n__len); export INT16 Platform_Close (INT64 h); export BOOLEAN Platform_ConnectionFailed (INT16 e); export void Platform_Delay (INT32 ms); @@ -57,27 +57,27 @@ export BOOLEAN Platform_DifferentFilesystems (INT16 e); static void Platform_EnableVT100 (void); export INT16 Platform_Error (void); export void Platform_Exit (INT32 code); -export void Platform_GetArg (INT16 n, CHAR *val, LONGINT val__len); +export void Platform_GetArg (INT16 n, CHAR *val, ADDRESS val__len); export void Platform_GetClock (INT32 *t, INT32 *d); -export void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); +export void Platform_GetEnv (CHAR *var, ADDRESS var__len, CHAR *val, ADDRESS val__len); export void Platform_GetIntArg (INT16 n, INT32 *val); export void Platform_GetTimeOfDay (INT32 *sec, INT32 *usec); export INT16 Platform_Identify (INT64 h, Platform_FileIdentity *identity, ADDRESS *identity__typ); -export INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ); +export INT16 Platform_IdentifyByName (CHAR *n, ADDRESS n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ); export BOOLEAN Platform_Inaccessible (INT16 e); export void Platform_Init (INT32 argc, INT64 argvadr); export BOOLEAN Platform_Interrupted (INT16 e); export BOOLEAN Platform_IsConsole (INT64 h); export void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d); -export INT16 Platform_New (CHAR *n, LONGINT n__len, INT64 *h); +export INT16 Platform_New (CHAR *n, ADDRESS n__len, INT64 *h); export BOOLEAN Platform_NoSuchDirectory (INT16 e); export INT64 Platform_OSAllocate (INT64 size); export void Platform_OSFree (INT64 address); -export INT16 Platform_OldRO (CHAR *n, LONGINT n__len, INT64 *h); -export INT16 Platform_OldRW (CHAR *n, LONGINT n__len, INT64 *h); +export INT16 Platform_OldRO (CHAR *n, ADDRESS n__len, INT64 *h); +export INT16 Platform_OldRW (CHAR *n, ADDRESS n__len, INT64 *h); export INT16 Platform_Read (INT64 h, INT64 p, INT32 l, INT32 *n); -export INT16 Platform_ReadBuf (INT64 h, SYSTEM_BYTE *b, LONGINT b__len, INT32 *n); -export INT16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); +export INT16 Platform_ReadBuf (INT64 h, SYSTEM_BYTE *b, ADDRESS b__len, INT32 *n); +export INT16 Platform_Rename (CHAR *o, ADDRESS o__len, CHAR *n, ADDRESS n__len); export BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); export BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); export INT16 Platform_Seek (INT64 h, INT32 o, INT16 r); @@ -85,16 +85,16 @@ export void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); export void Platform_SetMTime (Platform_FileIdentity *target, ADDRESS *target__typ, Platform_FileIdentity source); export INT16 Platform_Size (INT64 h, INT32 *l); export INT16 Platform_Sync (INT64 h); -export INT16 Platform_System (CHAR *cmd, LONGINT cmd__len); +export INT16 Platform_System (CHAR *cmd, ADDRESS cmd__len); static void Platform_TestLittleEndian (void); export INT32 Platform_Time (void); export BOOLEAN Platform_TimedOut (INT16 e); export BOOLEAN Platform_TooManyFiles (INT16 e); export INT16 Platform_Truncate (INT64 h, INT32 limit); -export INT16 Platform_Unlink (CHAR *n, LONGINT n__len); +export INT16 Platform_Unlink (CHAR *n, ADDRESS n__len); export INT16 Platform_Write (INT64 h, INT64 p, INT32 l); static void Platform_YMDHMStoClock (INT16 ye, INT16 mo, INT16 da, INT16 ho, INT16 mi, INT16 se, INT32 *t, INT32 *d); -export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); +export BOOLEAN Platform_getEnv (CHAR *var, ADDRESS var__len, CHAR *val, ADDRESS val__len); #include "WindowsWrapper.h" #define Platform_ECONNABORTED() WSAECONNABORTED @@ -239,7 +239,7 @@ void Platform_Init (INT32 argc, INT64 argvadr) Platform_HeapInitHeap(); } -BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len) +BOOLEAN Platform_getEnv (CHAR *var, ADDRESS var__len, CHAR *val, ADDRESS val__len) { CHAR buf[4096]; INT16 res; @@ -256,7 +256,7 @@ BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__le __RETCHK; } -void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len) +void Platform_GetEnv (CHAR *var, ADDRESS var__len, CHAR *val, ADDRESS val__len) { __DUP(var, var__len, CHAR); if (!Platform_getEnv(var, var__len, (void*)val, val__len)) { @@ -265,7 +265,7 @@ void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len) __DEL(var); } -void Platform_GetArg (INT16 n, CHAR *val, LONGINT val__len) +void Platform_GetArg (INT16 n, CHAR *val, ADDRESS val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { @@ -300,7 +300,7 @@ void Platform_GetIntArg (INT16 n, INT32 *val) } } -INT16 Platform_ArgPos (CHAR *s, LONGINT s__len) +INT16 Platform_ArgPos (CHAR *s, ADDRESS s__len) { INT16 i; CHAR arg[256]; @@ -359,7 +359,7 @@ void Platform_GetTimeOfDay (INT32 *sec, INT32 *usec) *usec = Platform_uluSec(); } -INT16 Platform_System (CHAR *cmd, LONGINT cmd__len) +INT16 Platform_System (CHAR *cmd, ADDRESS cmd__len) { INT16 result; __DUP(cmd, cmd__len, CHAR); @@ -381,7 +381,7 @@ INT16 Platform_Error (void) return Platform_err(); } -INT16 Platform_OldRO (CHAR *n, LONGINT n__len, INT64 *h) +INT16 Platform_OldRO (CHAR *n, ADDRESS n__len, INT64 *h) { INT64 fd; fd = Platform_openro(n, n__len); @@ -394,7 +394,7 @@ INT16 Platform_OldRO (CHAR *n, LONGINT n__len, INT64 *h) __RETCHK; } -INT16 Platform_OldRW (CHAR *n, LONGINT n__len, INT64 *h) +INT16 Platform_OldRW (CHAR *n, ADDRESS n__len, INT64 *h) { INT64 fd; fd = Platform_openrw(n, n__len); @@ -407,7 +407,7 @@ INT16 Platform_OldRW (CHAR *n, LONGINT n__len, INT64 *h) __RETCHK; } -INT16 Platform_New (CHAR *n, LONGINT n__len, INT64 *h) +INT16 Platform_New (CHAR *n, ADDRESS n__len, INT64 *h) { INT64 fd; fd = Platform_opennew(n, n__len); @@ -444,7 +444,7 @@ INT16 Platform_Identify (INT64 h, Platform_FileIdentity *identity, ADDRESS *iden return 0; } -INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ) +INT16 Platform_IdentifyByName (CHAR *n, ADDRESS n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ) { INT64 h; INT16 e, i; @@ -508,7 +508,7 @@ INT16 Platform_Read (INT64 h, INT64 p, INT32 l, INT32 *n) __RETCHK; } -INT16 Platform_ReadBuf (INT64 h, SYSTEM_BYTE *b, LONGINT b__len, INT32 *n) +INT16 Platform_ReadBuf (INT64 h, SYSTEM_BYTE *b, ADDRESS b__len, INT32 *n) { INT16 result; INT32 lengthread; @@ -580,7 +580,7 @@ INT16 Platform_Truncate (INT64 h, INT32 limit) return 0; } -INT16 Platform_Unlink (CHAR *n, LONGINT n__len) +INT16 Platform_Unlink (CHAR *n, ADDRESS n__len) { if (Platform_deleteFile(n, n__len) == 0) { return Platform_err(); @@ -590,7 +590,7 @@ INT16 Platform_Unlink (CHAR *n, LONGINT n__len) __RETCHK; } -INT16 Platform_Chdir (CHAR *n, LONGINT n__len) +INT16 Platform_Chdir (CHAR *n, ADDRESS n__len) { INT16 r; r = Platform_setCurrentDirectory(n, n__len); @@ -601,7 +601,7 @@ INT16 Platform_Chdir (CHAR *n, LONGINT n__len) return 0; } -INT16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) +INT16 Platform_Rename (CHAR *o, ADDRESS o__len, CHAR *n, ADDRESS n__len) { if (Platform_moveFile(o, o__len, n, n__len) == 0) { return Platform_err(); diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index f6a5d008..2d7faafb 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h @@ -29,35 +29,35 @@ import CHAR Platform_NL[3]; import ADDRESS *Platform_FileIdentity__typ; import BOOLEAN Platform_Absent (INT16 e); -import INT16 Platform_ArgPos (CHAR *s, LONGINT s__len); -import INT16 Platform_Chdir (CHAR *n, LONGINT n__len); +import INT16 Platform_ArgPos (CHAR *s, ADDRESS s__len); +import INT16 Platform_Chdir (CHAR *n, ADDRESS n__len); import INT16 Platform_Close (INT64 h); import BOOLEAN Platform_ConnectionFailed (INT16 e); import void Platform_Delay (INT32 ms); import BOOLEAN Platform_DifferentFilesystems (INT16 e); import INT16 Platform_Error (void); import void Platform_Exit (INT32 code); -import void Platform_GetArg (INT16 n, CHAR *val, LONGINT val__len); +import void Platform_GetArg (INT16 n, CHAR *val, ADDRESS val__len); import void Platform_GetClock (INT32 *t, INT32 *d); -import void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); +import void Platform_GetEnv (CHAR *var, ADDRESS var__len, CHAR *val, ADDRESS val__len); import void Platform_GetIntArg (INT16 n, INT32 *val); import void Platform_GetTimeOfDay (INT32 *sec, INT32 *usec); import INT16 Platform_Identify (INT64 h, Platform_FileIdentity *identity, ADDRESS *identity__typ); -import INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ); +import INT16 Platform_IdentifyByName (CHAR *n, ADDRESS n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ); import BOOLEAN Platform_Inaccessible (INT16 e); import void Platform_Init (INT32 argc, INT64 argvadr); import BOOLEAN Platform_Interrupted (INT16 e); import BOOLEAN Platform_IsConsole (INT64 h); import void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d); -import INT16 Platform_New (CHAR *n, LONGINT n__len, INT64 *h); +import INT16 Platform_New (CHAR *n, ADDRESS n__len, INT64 *h); import BOOLEAN Platform_NoSuchDirectory (INT16 e); import INT64 Platform_OSAllocate (INT64 size); import void Platform_OSFree (INT64 address); -import INT16 Platform_OldRO (CHAR *n, LONGINT n__len, INT64 *h); -import INT16 Platform_OldRW (CHAR *n, LONGINT n__len, INT64 *h); +import INT16 Platform_OldRO (CHAR *n, ADDRESS n__len, INT64 *h); +import INT16 Platform_OldRW (CHAR *n, ADDRESS n__len, INT64 *h); import INT16 Platform_Read (INT64 h, INT64 p, INT32 l, INT32 *n); -import INT16 Platform_ReadBuf (INT64 h, SYSTEM_BYTE *b, LONGINT b__len, INT32 *n); -import INT16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); +import INT16 Platform_ReadBuf (INT64 h, SYSTEM_BYTE *b, ADDRESS b__len, INT32 *n); +import INT16 Platform_Rename (CHAR *o, ADDRESS o__len, CHAR *n, ADDRESS n__len); import BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); import BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); import INT16 Platform_Seek (INT64 h, INT32 o, INT16 r); @@ -65,14 +65,14 @@ import void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); import void Platform_SetMTime (Platform_FileIdentity *target, ADDRESS *target__typ, Platform_FileIdentity source); import INT16 Platform_Size (INT64 h, INT32 *l); import INT16 Platform_Sync (INT64 h); -import INT16 Platform_System (CHAR *cmd, LONGINT cmd__len); +import INT16 Platform_System (CHAR *cmd, ADDRESS cmd__len); import INT32 Platform_Time (void); import BOOLEAN Platform_TimedOut (INT16 e); import BOOLEAN Platform_TooManyFiles (INT16 e); import INT16 Platform_Truncate (INT64 h, INT32 limit); -import INT16 Platform_Unlink (CHAR *n, LONGINT n__len); +import INT16 Platform_Unlink (CHAR *n, ADDRESS n__len); import INT16 Platform_Write (INT64 h, INT64 p, INT32 l); -import BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); +import BOOLEAN Platform_getEnv (CHAR *var, ADDRESS var__len, CHAR *val, ADDRESS val__len); import void *Platform__init(void); #define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((ADDRESS)h) diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index cd4c3c61..be3ad909 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -10,11 +10,11 @@ -static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LONGINT d__len); -export void Reals_Convert (REAL x, INT16 n, CHAR *d, LONGINT d__len); -export void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len); -export void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len); -export void Reals_ConvertL (LONGREAL x, INT16 n, CHAR *d, LONGINT d__len); +static void Reals_BytesToHex (SYSTEM_BYTE *b, ADDRESS b__len, SYSTEM_BYTE *d, ADDRESS d__len); +export void Reals_Convert (REAL x, INT16 n, CHAR *d, ADDRESS d__len); +export void Reals_ConvertH (REAL y, CHAR *d, ADDRESS d__len); +export void Reals_ConvertHL (LONGREAL x, CHAR *d, ADDRESS d__len); +export void Reals_ConvertL (LONGREAL x, INT16 n, CHAR *d, ADDRESS d__len); export INT16 Reals_Expo (REAL x); export INT16 Reals_ExpoL (LONGREAL x); export void Reals_SetExpo (REAL *x, INT16 ex); @@ -79,7 +79,7 @@ INT16 Reals_ExpoL (LONGREAL x) return __MASK(__ASHR(i, 4), -2048); } -void Reals_ConvertL (LONGREAL x, INT16 n, CHAR *d, LONGINT d__len) +void Reals_ConvertL (LONGREAL x, INT16 n, CHAR *d, ADDRESS d__len) { INT32 i, j, k; if (x < (LONGREAL)0) { @@ -107,7 +107,7 @@ void Reals_ConvertL (LONGREAL x, INT16 n, CHAR *d, LONGINT d__len) } } -void Reals_Convert (REAL x, INT16 n, CHAR *d, LONGINT d__len) +void Reals_Convert (REAL x, INT16 n, CHAR *d, ADDRESS d__len) { Reals_ConvertL(x, n, (void*)d, d__len); } @@ -122,7 +122,7 @@ static CHAR Reals_ToHex (INT16 i) __RETCHK; } -static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LONGINT d__len) +static void Reals_BytesToHex (SYSTEM_BYTE *b, ADDRESS b__len, SYSTEM_BYTE *d, ADDRESS d__len) { INT16 i; INT32 l; @@ -137,12 +137,12 @@ static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LO } } -void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len) +void Reals_ConvertH (REAL y, CHAR *d, ADDRESS d__len) { Reals_BytesToHex((void*)&y, 4, (void*)d, d__len * 1); } -void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len) +void Reals_ConvertHL (LONGREAL x, CHAR *d, ADDRESS d__len) { Reals_BytesToHex((void*)&x, 8, (void*)d, d__len * 1); } diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index f0c84ab1..e8d15a2f 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h @@ -8,10 +8,10 @@ -import void Reals_Convert (REAL x, INT16 n, CHAR *d, LONGINT d__len); -import void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len); -import void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len); -import void Reals_ConvertL (LONGREAL x, INT16 n, CHAR *d, LONGINT d__len); +import void Reals_Convert (REAL x, INT16 n, CHAR *d, ADDRESS d__len); +import void Reals_ConvertH (REAL y, CHAR *d, ADDRESS d__len); +import void Reals_ConvertHL (LONGREAL x, CHAR *d, ADDRESS d__len); +import void Reals_ConvertL (LONGREAL x, INT16 n, CHAR *d, ADDRESS d__len); import INT16 Reals_Expo (REAL x); import INT16 Reals_ExpoL (LONGREAL x); import void Reals_SetExpo (REAL *x, INT16 ex); diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index b5707327..fd550df3 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -10,18 +10,18 @@ -export void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len); -export void Strings_Cap (CHAR *s, LONGINT s__len); -export void Strings_Delete (CHAR *s, LONGINT s__len, INT16 pos, INT16 n); -export void Strings_Extract (CHAR *source, LONGINT source__len, INT16 pos, INT16 n, CHAR *dest, LONGINT dest__len); -export void Strings_Insert (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len); -export INT16 Strings_Length (CHAR *s, LONGINT s__len); -export BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len); -export INT16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, INT16 pos); -export void Strings_Replace (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len); +export void Strings_Append (CHAR *extra, ADDRESS extra__len, CHAR *dest, ADDRESS dest__len); +export void Strings_Cap (CHAR *s, ADDRESS s__len); +export void Strings_Delete (CHAR *s, ADDRESS s__len, INT16 pos, INT16 n); +export void Strings_Extract (CHAR *source, ADDRESS source__len, INT16 pos, INT16 n, CHAR *dest, ADDRESS dest__len); +export void Strings_Insert (CHAR *source, ADDRESS source__len, INT16 pos, CHAR *dest, ADDRESS dest__len); +export INT16 Strings_Length (CHAR *s, ADDRESS s__len); +export BOOLEAN Strings_Match (CHAR *string, ADDRESS string__len, CHAR *pattern, ADDRESS pattern__len); +export INT16 Strings_Pos (CHAR *pattern, ADDRESS pattern__len, CHAR *s, ADDRESS s__len, INT16 pos); +export void Strings_Replace (CHAR *source, ADDRESS source__len, INT16 pos, CHAR *dest, ADDRESS dest__len); -INT16 Strings_Length (CHAR *s, LONGINT s__len) +INT16 Strings_Length (CHAR *s, ADDRESS s__len) { INT32 i; __DUP(s, s__len, CHAR); @@ -39,7 +39,7 @@ INT16 Strings_Length (CHAR *s, LONGINT s__len) __RETCHK; } -void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len) +void Strings_Append (CHAR *extra, ADDRESS extra__len, CHAR *dest, ADDRESS dest__len) { INT16 n1, n2, i; __DUP(extra, extra__len, CHAR); @@ -56,7 +56,7 @@ void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__ __DEL(extra); } -void Strings_Insert (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len) +void Strings_Insert (CHAR *source, ADDRESS source__len, INT16 pos, CHAR *dest, ADDRESS dest__len) { INT16 n1, n2, i; __DUP(source, source__len, CHAR); @@ -87,7 +87,7 @@ void Strings_Insert (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, L __DEL(source); } -void Strings_Delete (CHAR *s, LONGINT s__len, INT16 pos, INT16 n) +void Strings_Delete (CHAR *s, ADDRESS s__len, INT16 pos, INT16 n) { INT16 len, i; len = Strings_Length(s, s__len); @@ -110,7 +110,7 @@ void Strings_Delete (CHAR *s, LONGINT s__len, INT16 pos, INT16 n) } } -void Strings_Replace (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len) +void Strings_Replace (CHAR *source, ADDRESS source__len, INT16 pos, CHAR *dest, ADDRESS dest__len) { __DUP(source, source__len, CHAR); Strings_Delete((void*)dest, dest__len, pos, pos + Strings_Length(source, source__len)); @@ -118,7 +118,7 @@ void Strings_Replace (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, __DEL(source); } -void Strings_Extract (CHAR *source, LONGINT source__len, INT16 pos, INT16 n, CHAR *dest, LONGINT dest__len) +void Strings_Extract (CHAR *source, ADDRESS source__len, INT16 pos, INT16 n, CHAR *dest, ADDRESS dest__len) { INT16 len, destLen, i; __DUP(source, source__len, CHAR); @@ -143,7 +143,7 @@ void Strings_Extract (CHAR *source, LONGINT source__len, INT16 pos, INT16 n, CHA __DEL(source); } -INT16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, INT16 pos) +INT16 Strings_Pos (CHAR *pattern, ADDRESS pattern__len, CHAR *s, ADDRESS s__len, INT16 pos) { INT16 n1, n2, i, j; __DUP(pattern, pattern__len, CHAR); @@ -175,7 +175,7 @@ INT16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, return -1; } -void Strings_Cap (CHAR *s, LONGINT s__len) +void Strings_Cap (CHAR *s, ADDRESS s__len) { INT16 i; i = 0; @@ -191,9 +191,9 @@ static struct Match__7 { struct Match__7 *lnk; } *Match__7_s; -static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, INT16 n, INT16 m); +static BOOLEAN M__8 (CHAR *name, ADDRESS name__len, CHAR *mask, ADDRESS mask__len, INT16 n, INT16 m); -static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, INT16 n, INT16 m) +static BOOLEAN M__8 (CHAR *name, ADDRESS name__len, CHAR *mask, ADDRESS mask__len, INT16 n, INT16 m) { while ((((n >= 0 && m >= 0)) && mask[__X(m, mask__len)] != '*')) { if (name[__X(n, name__len)] != mask[__X(m, mask__len)]) { @@ -220,7 +220,7 @@ static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__le return 0; } -BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len) +BOOLEAN Strings_Match (CHAR *string, ADDRESS string__len, CHAR *pattern, ADDRESS pattern__len) { struct Match__7 _s; BOOLEAN __retval; diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index c987af8d..76cb022d 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h @@ -8,15 +8,15 @@ -import void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len); -import void Strings_Cap (CHAR *s, LONGINT s__len); -import void Strings_Delete (CHAR *s, LONGINT s__len, INT16 pos, INT16 n); -import void Strings_Extract (CHAR *source, LONGINT source__len, INT16 pos, INT16 n, CHAR *dest, LONGINT dest__len); -import void Strings_Insert (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len); -import INT16 Strings_Length (CHAR *s, LONGINT s__len); -import BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len); -import INT16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, INT16 pos); -import void Strings_Replace (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len); +import void Strings_Append (CHAR *extra, ADDRESS extra__len, CHAR *dest, ADDRESS dest__len); +import void Strings_Cap (CHAR *s, ADDRESS s__len); +import void Strings_Delete (CHAR *s, ADDRESS s__len, INT16 pos, INT16 n); +import void Strings_Extract (CHAR *source, ADDRESS source__len, INT16 pos, INT16 n, CHAR *dest, ADDRESS dest__len); +import void Strings_Insert (CHAR *source, ADDRESS source__len, INT16 pos, CHAR *dest, ADDRESS dest__len); +import INT16 Strings_Length (CHAR *s, ADDRESS s__len); +import BOOLEAN Strings_Match (CHAR *string, ADDRESS string__len, CHAR *pattern, ADDRESS pattern__len); +import INT16 Strings_Pos (CHAR *pattern, ADDRESS pattern__len, CHAR *s, ADDRESS s__len, INT16 pos); +import void Strings_Replace (CHAR *source, ADDRESS source__len, INT16 pos, CHAR *dest, ADDRESS dest__len); import void *Strings__init(void); diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index ae12961b..7182a772 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -187,20 +187,20 @@ export void Texts_Append (Texts_Text T, Texts_Buffer B); export void Texts_ChangeLooks (Texts_Text T, INT32 beg, INT32 end, UINT32 sel, Texts_FontsFont fnt, INT8 col, INT8 voff); static Texts_Elem Texts_CloneElem (Texts_Elem e); static Texts_Piece Texts_ClonePiece (Texts_Piece p); -export void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len); +export void Texts_Close (Texts_Text T, CHAR *name, ADDRESS name__len); export void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); export void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); export void Texts_Delete (Texts_Text T, INT32 beg, INT32 end); export Texts_Text Texts_ElemBase (Texts_Elem E); export INT32 Texts_ElemPos (Texts_Elem E); static void Texts_Find (Texts_Text T, INT32 *pos, Texts_Run *u, INT32 *org, INT32 *off); -static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len); +static Texts_FontsFont Texts_FontsThis (CHAR *name, ADDRESS name__len); static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, ADDRESS *msg__typ); export void Texts_Insert (Texts_Text T, INT32 pos, Texts_Buffer B); export void Texts_Load (Files_Rider *r, ADDRESS *r__typ, Texts_Text T); static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T); static void Texts_Merge (Texts_Text T, Texts_Run u, Texts_Run *v); -export void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len); +export void Texts_Open (Texts_Text T, CHAR *name, ADDRESS name__len); export void Texts_OpenBuf (Texts_Buffer B); export void Texts_OpenReader (Texts_Reader *R, ADDRESS *R__typ, Texts_Text T, INT32 pos); export void Texts_OpenScanner (Texts_Scanner *S, ADDRESS *S__typ, Texts_Text T, INT32 pos); @@ -229,10 +229,10 @@ export void Texts_WriteLongRealHex (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x export void Texts_WriteReal (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n); export void Texts_WriteRealFix (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n, INT16 k); export void Texts_WriteRealHex (Texts_Writer *W, ADDRESS *W__typ, REAL x); -export void Texts_WriteString (Texts_Writer *W, ADDRESS *W__typ, CHAR *s, LONGINT s__len); +export void Texts_WriteString (Texts_Writer *W, ADDRESS *W__typ, CHAR *s, ADDRESS s__len); -static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len) +static Texts_FontsFont Texts_FontsThis (CHAR *name, ADDRESS name__len) { Texts_FontsFont F = NIL; __NEW(F, Texts_FontDesc); @@ -1027,7 +1027,7 @@ void Texts_WriteLn (Texts_Writer *W, ADDRESS *W__typ) Texts_Write(&*W, W__typ, 0x0d); } -void Texts_WriteString (Texts_Writer *W, ADDRESS *W__typ, CHAR *s, LONGINT s__len) +void Texts_WriteString (Texts_Writer *W, ADDRESS *W__typ, CHAR *s, ADDRESS s__len) { INT16 i; __DUP(s, s__len, CHAR); @@ -1539,7 +1539,7 @@ void Texts_Load (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) Texts_Load0(&*r, r__typ, T); } -void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len) +void Texts_Open (Texts_Text T, CHAR *name, ADDRESS name__len) { Files_File f = NIL; Files_Rider r; @@ -1755,7 +1755,7 @@ void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) Store__39_s = _s.lnk; } -void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len) +void Texts_Close (Texts_Text T, CHAR *name, ADDRESS name__len) { Files_File f = NIL; Files_Rider r; diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index 61a97dda..e8735b00 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h @@ -131,7 +131,7 @@ import ADDRESS *Texts_Writer__typ; import void Texts_Append (Texts_Text T, Texts_Buffer B); import void Texts_ChangeLooks (Texts_Text T, INT32 beg, INT32 end, UINT32 sel, Texts_FontsFont fnt, INT8 col, INT8 voff); -import void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len); +import void Texts_Close (Texts_Text T, CHAR *name, ADDRESS name__len); import void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); import void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); import void Texts_Delete (Texts_Text T, INT32 beg, INT32 end); @@ -139,7 +139,7 @@ import Texts_Text Texts_ElemBase (Texts_Elem E); import INT32 Texts_ElemPos (Texts_Elem E); import void Texts_Insert (Texts_Text T, INT32 pos, Texts_Buffer B); import void Texts_Load (Files_Rider *r, ADDRESS *r__typ, Texts_Text T); -import void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len); +import void Texts_Open (Texts_Text T, CHAR *name, ADDRESS name__len); import void Texts_OpenBuf (Texts_Buffer B); import void Texts_OpenReader (Texts_Reader *R, ADDRESS *R__typ, Texts_Text T, INT32 pos); import void Texts_OpenScanner (Texts_Scanner *S, ADDRESS *S__typ, Texts_Text T, INT32 pos); @@ -166,7 +166,7 @@ import void Texts_WriteLongRealHex (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x import void Texts_WriteReal (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n); import void Texts_WriteRealFix (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n, INT16 k); import void Texts_WriteRealHex (Texts_Writer *W, ADDRESS *W__typ, REAL x); -import void Texts_WriteString (Texts_Writer *W, ADDRESS *W__typ, CHAR *s, LONGINT s__len); +import void Texts_WriteString (Texts_Writer *W, ADDRESS *W__typ, CHAR *s, ADDRESS s__len); import void *Texts__init(void); diff --git a/bootstrap/windows-88/VT100.c b/bootstrap/windows-88/VT100.c index f69fd90e..38c0743f 100644 --- a/bootstrap/windows-88/VT100.c +++ b/bootstrap/windows-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -27,23 +27,23 @@ export void VT100_DECTCEMl (void); export void VT100_DSR (INT16 n); export void VT100_ED (INT16 n); export void VT100_EL (INT16 n); -static void VT100_EscSeq (INT16 n, CHAR *letter, LONGINT letter__len); -static void VT100_EscSeq0 (CHAR *letter, LONGINT letter__len); -static void VT100_EscSeq2 (INT16 n, INT16 m, CHAR *letter, LONGINT letter__len); -static void VT100_EscSeqSwapped (INT16 n, CHAR *letter, LONGINT letter__len); +static void VT100_EscSeq (INT16 n, CHAR *letter, ADDRESS letter__len); +static void VT100_EscSeq0 (CHAR *letter, ADDRESS letter__len); +static void VT100_EscSeq2 (INT16 n, INT16 m, CHAR *letter, ADDRESS letter__len); +static void VT100_EscSeqSwapped (INT16 n, CHAR *letter, ADDRESS letter__len); export void VT100_HVP (INT16 n, INT16 m); -export void VT100_IntToStr (INT32 int_, CHAR *str, LONGINT str__len); +export void VT100_IntToStr (INT32 int_, CHAR *str, ADDRESS str__len); export void VT100_RCP (void); -static void VT100_Reverse0 (CHAR *str, LONGINT str__len, INT16 start, INT16 end); +static void VT100_Reverse0 (CHAR *str, ADDRESS str__len, INT16 start, INT16 end); export void VT100_SCP (void); export void VT100_SD (INT16 n); export void VT100_SGR (INT16 n); export void VT100_SGR2 (INT16 n, INT16 m); export void VT100_SU (INT16 n); -export void VT100_SetAttr (CHAR *attr, LONGINT attr__len); +export void VT100_SetAttr (CHAR *attr, ADDRESS attr__len); -static void VT100_Reverse0 (CHAR *str, LONGINT str__len, INT16 start, INT16 end) +static void VT100_Reverse0 (CHAR *str, ADDRESS str__len, INT16 start, INT16 end) { CHAR h; while (start < end) { @@ -55,7 +55,7 @@ static void VT100_Reverse0 (CHAR *str, LONGINT str__len, INT16 start, INT16 end) } } -void VT100_IntToStr (INT32 int_, CHAR *str, LONGINT str__len) +void VT100_IntToStr (INT32 int_, CHAR *str, ADDRESS str__len) { CHAR b[21]; INT16 s, e; @@ -84,7 +84,7 @@ void VT100_IntToStr (INT32 int_, CHAR *str, LONGINT str__len) __COPY(b, str, str__len); } -static void VT100_EscSeq0 (CHAR *letter, LONGINT letter__len) +static void VT100_EscSeq0 (CHAR *letter, ADDRESS letter__len) { CHAR cmd[9]; __DUP(letter, letter__len, CHAR); @@ -94,7 +94,7 @@ static void VT100_EscSeq0 (CHAR *letter, LONGINT letter__len) __DEL(letter); } -static void VT100_EscSeq (INT16 n, CHAR *letter, LONGINT letter__len) +static void VT100_EscSeq (INT16 n, CHAR *letter, ADDRESS letter__len) { CHAR nstr[2]; CHAR cmd[7]; @@ -107,7 +107,7 @@ static void VT100_EscSeq (INT16 n, CHAR *letter, LONGINT letter__len) __DEL(letter); } -static void VT100_EscSeqSwapped (INT16 n, CHAR *letter, LONGINT letter__len) +static void VT100_EscSeqSwapped (INT16 n, CHAR *letter, ADDRESS letter__len) { CHAR nstr[2]; CHAR cmd[7]; @@ -120,7 +120,7 @@ static void VT100_EscSeqSwapped (INT16 n, CHAR *letter, LONGINT letter__len) __DEL(letter); } -static void VT100_EscSeq2 (INT16 n, INT16 m, CHAR *letter, LONGINT letter__len) +static void VT100_EscSeq2 (INT16 n, INT16 m, CHAR *letter, ADDRESS letter__len) { CHAR nstr[5], mstr[5]; CHAR cmd[12]; @@ -236,7 +236,7 @@ void VT100_DECTCEMh (void) VT100_EscSeq0((CHAR*)"\?25h", 5); } -void VT100_SetAttr (CHAR *attr, LONGINT attr__len) +void VT100_SetAttr (CHAR *attr, ADDRESS attr__len) { CHAR tmpstr[16]; __DUP(attr, attr__len, CHAR); diff --git a/bootstrap/windows-88/VT100.h b/bootstrap/windows-88/VT100.h index d99406ec..4bbb3110 100644 --- a/bootstrap/windows-88/VT100.h +++ b/bootstrap/windows-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h @@ -23,14 +23,14 @@ import void VT100_DSR (INT16 n); import void VT100_ED (INT16 n); import void VT100_EL (INT16 n); import void VT100_HVP (INT16 n, INT16 m); -import void VT100_IntToStr (INT32 int_, CHAR *str, LONGINT str__len); +import void VT100_IntToStr (INT32 int_, CHAR *str, ADDRESS str__len); import void VT100_RCP (void); import void VT100_SCP (void); import void VT100_SD (INT16 n); import void VT100_SGR (INT16 n); import void VT100_SGR2 (INT16 n, INT16 m); import void VT100_SU (INT16 n); -import void VT100_SetAttr (CHAR *attr, LONGINT attr__len); +import void VT100_SetAttr (CHAR *attr, ADDRESS attr__len); import void *VT100__init(void); diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index 37630d23..66f80319 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -17,13 +17,13 @@ static CHAR extTools_CFLAGS[1023]; -export void extTools_Assemble (CHAR *moduleName, LONGINT moduleName__len); -static void extTools_InitialiseCompilerCommand (CHAR *s, LONGINT s__len); -export void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN statically, CHAR *additionalopts, LONGINT additionalopts__len); -static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGINT cmd__len); +export void extTools_Assemble (CHAR *moduleName, ADDRESS moduleName__len); +static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len); +export void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN statically, CHAR *additionalopts, ADDRESS additionalopts__len); +static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRESS cmd__len); -static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGINT cmd__len) +static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRESS cmd__len) { INT16 r, status, exitcode; __DUP(title, title__len, CHAR); @@ -63,7 +63,7 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN __DEL(cmd); } -static void extTools_InitialiseCompilerCommand (CHAR *s, LONGINT s__len) +static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) { __COPY("gcc -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); @@ -74,7 +74,7 @@ static void extTools_InitialiseCompilerCommand (CHAR *s, LONGINT s__len) Strings_Append((CHAR*)" ", 2, (void*)s, s__len); } -void extTools_Assemble (CHAR *moduleName, LONGINT moduleName__len) +void extTools_Assemble (CHAR *moduleName, ADDRESS moduleName__len) { CHAR cmd[1023]; __DUP(moduleName, moduleName__len, CHAR); @@ -86,7 +86,7 @@ void extTools_Assemble (CHAR *moduleName, LONGINT moduleName__len) __DEL(moduleName); } -void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN statically, CHAR *additionalopts, LONGINT additionalopts__len) +void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN statically, CHAR *additionalopts, ADDRESS additionalopts__len) { CHAR cmd[1023]; __DUP(additionalopts, additionalopts__len, CHAR); diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index 63e5df15..472c60f3 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h @@ -8,8 +8,8 @@ -import void extTools_Assemble (CHAR *moduleName, LONGINT moduleName__len); -import void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN statically, CHAR *additionalopts, LONGINT additionalopts__len); +import void extTools_Assemble (CHAR *moduleName, ADDRESS moduleName__len); +import void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN statically, CHAR *additionalopts, ADDRESS additionalopts__len); import void *extTools__init(void); From 6a7cba23a73950dddbacd8affec4ce934054d09d Mon Sep 17 00:00:00 2001 From: David Brown Date: Sun, 27 Nov 2016 16:48:03 +0000 Subject: [PATCH 344/580] Force output flush and nonzero return code on assertion failure in Files.Mod --- src/runtime/Files.Mod | 25 +++++++++++++++---------- src/runtime/Modules.Mod | 2 +- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/src/runtime/Files.Mod b/src/runtime/Files.Mod index 9e51f73b..543a5c9c 100644 --- a/src/runtime/Files.Mod +++ b/src/runtime/Files.Mod @@ -76,6 +76,11 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files PROCEDURE^ Finalize(o: SYSTEM.PTR); + PROCEDURE Assert(truth: BOOLEAN); + BEGIN + IF ~truth THEN Out.Ln; ASSERT(truth) END + END Assert; + PROCEDURE Err(s: ARRAY OF CHAR; f: File; errcode: Platform.ErrorCode); BEGIN Out.Ln; Out.String("-- "); Out.String(s); Out.String(": "); @@ -361,7 +366,7 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files PROCEDURE Pos* (VAR r: Rider): LONGINT; BEGIN - ASSERT(r.offset <= BufSize); + Assert(r.offset <= BufSize); RETURN r.org + r.offset END Pos; @@ -401,7 +406,7 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files END ELSE buf := NIL; org := 0; offset := 0 END; - ASSERT(offset <= BufSize); + Assert(offset <= BufSize); r.buf := buf; r.org := org; r.offset := offset; r.eof := FALSE; r.res := 0 END Set; @@ -410,7 +415,7 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files BEGIN buf := r.buf; offset := r.offset; IF r.org # buf.org THEN Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset END; - ASSERT(offset <= buf.size); + Assert(offset <= buf.size); IF (offset < buf.size) THEN x := buf.data[offset]; r.offset := offset + 1 ELSIF r.org + offset < buf.f.len THEN @@ -436,7 +441,7 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files ELSIF n > restInBuf THEN min := restInBuf ELSE min := n END; SYSTEM.MOVE(SYSTEM.ADR(buf.data) + ToAdr(offset), SYSTEM.ADR(x) + ToAdr(xpos), min); INC(offset, min); r.offset := offset; INC(xpos, min); DEC(n, min); - ASSERT(offset <= BufSize) + Assert(offset <= BufSize) END; r.res := 0; r.eof := FALSE END ReadBytes; @@ -449,12 +454,12 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files VAR buf: Buffer; offset: LONGINT; BEGIN buf := r.buf; offset := r.offset; - ASSERT(offset <= BufSize); + Assert(offset <= BufSize); IF (r.org # buf.org) OR (offset >= BufSize) THEN Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset END; - ASSERT(offset < BufSize); + Assert(offset < BufSize); buf.data[offset] := x; buf.chg := TRUE; IF offset = buf.size THEN @@ -469,17 +474,17 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files IF n > LEN(x) THEN IdxTrap END; xpos := 0; buf := r.buf; offset := r.offset; WHILE n > 0 DO - ASSERT(offset <= BufSize); + Assert(offset <= BufSize); IF (r.org # buf.org) OR (offset >= BufSize) THEN Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset END; - ASSERT(offset <= BufSize); + Assert(offset <= BufSize); restInBuf := BufSize - offset; IF n > restInBuf THEN min := restInBuf ELSE min := n END; SYSTEM.MOVE(SYSTEM.ADR(x) + ToAdr(xpos), SYSTEM.ADR(buf.data) + ToAdr(offset), min); INC(offset, min); r.offset := offset; - ASSERT(offset <= BufSize); + Assert(offset <= BufSize); IF offset > buf.size THEN INC(buf.f.len, offset - buf.size); buf.size := offset END; INC(xpos, min); DEC(n, min); buf.chg := TRUE END; @@ -664,7 +669,7 @@ Especially Length would become fairly complex. BEGIN s := 0; q := 0; Read(R, b); WHILE b < 0 DO INC(q, ASH(b+128, s)); INC(s, 7); Read(R, b) END; INC(q, ASH(b MOD 64 - b DIV 64 * 64, s)); - ASSERT(LEN(x) <= 8); + Assert(LEN(x) <= 8); SYSTEM.MOVE(SYSTEM.ADR(q), SYSTEM.ADR(x), LEN(x)) (* Assumes little endian representation of q and x. *) END ReadNum; diff --git a/src/runtime/Modules.Mod b/src/runtime/Modules.Mod index 12fbcd7a..28050126 100644 --- a/src/runtime/Modules.Mod +++ b/src/runtime/Modules.Mod @@ -148,7 +148,7 @@ MODULE Modules; (* jt 6.1.96 *) errstring("Assertion failure."); IF code # 0 THEN errstring(" ASSERT code "); errint(code); errstring("."); END; errstring(Platform.NL); - Platform.Exit(code); + IF code > 0 THEN Platform.Exit(code) ELSE Platform.Exit(-1) END; END AssertFail; END Modules. From c630f8639965527df111ced51a5141491bfa93bd Mon Sep 17 00:00:00 2001 From: David Brown Date: Sun, 27 Nov 2016 16:49:12 +0000 Subject: [PATCH 345/580] Update C bootstrap sources --- bootstrap/unix-44/Compiler.c | 2 +- bootstrap/unix-44/Configuration.c | 4 ++-- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Files.c | 31 ++++++++++++++++++---------- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 2 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 8 +++++-- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 2 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 2 +- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 2 +- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 2 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Out.c | 2 +- bootstrap/unix-44/Out.h | 2 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/VT100.c | 2 +- bootstrap/unix-44/VT100.h | 2 +- bootstrap/unix-44/extTools.c | 2 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-48/Compiler.c | 2 +- bootstrap/unix-48/Configuration.c | 4 ++-- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Files.c | 31 ++++++++++++++++++---------- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 2 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 8 +++++-- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 2 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 2 +- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 2 +- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 2 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Out.c | 2 +- bootstrap/unix-48/Out.h | 2 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/VT100.c | 2 +- bootstrap/unix-48/VT100.h | 2 +- bootstrap/unix-48/extTools.c | 2 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-88/Compiler.c | 2 +- bootstrap/unix-88/Configuration.c | 4 ++-- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Files.c | 31 ++++++++++++++++++---------- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 2 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 8 +++++-- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 2 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 2 +- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 2 +- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 2 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Out.c | 2 +- bootstrap/unix-88/Out.h | 2 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/VT100.c | 2 +- bootstrap/unix-88/VT100.h | 2 +- bootstrap/unix-88/extTools.c | 2 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/windows-48/Compiler.c | 2 +- bootstrap/windows-48/Configuration.c | 4 ++-- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Files.c | 31 ++++++++++++++++++---------- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 2 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 8 +++++-- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 2 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 2 +- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 2 +- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 2 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Out.c | 2 +- bootstrap/windows-48/Out.h | 2 +- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/VT100.c | 2 +- bootstrap/windows-48/VT100.h | 2 +- bootstrap/windows-48/extTools.c | 2 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-88/Compiler.c | 2 +- bootstrap/windows-88/Configuration.c | 4 ++-- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Files.c | 31 ++++++++++++++++++---------- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 2 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 8 +++++-- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 2 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 2 +- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 2 +- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 2 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Out.c | 2 +- bootstrap/windows-88/Out.h | 2 +- bootstrap/windows-88/Platform.c | 2 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/VT100.c | 2 +- bootstrap/windows-88/VT100.h | 2 +- bootstrap/windows-88/extTools.c | 2 +- bootstrap/windows-88/extTools.h | 2 +- 185 files changed, 310 insertions(+), 245 deletions(-) diff --git a/bootstrap/unix-44/Compiler.c b/bootstrap/unix-44/Compiler.c index e900905f..cf8a66c5 100644 --- a/bootstrap/unix-44/Compiler.c +++ b/bootstrap/unix-44/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index 071d7b8e..cbbddc2b 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index b1942442..cacb981f 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 0a3293ab..947b36b8 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -60,6 +60,7 @@ export ADDRESS *Files_FileDesc__typ; export ADDRESS *Files_BufDesc__typ; export ADDRESS *Files_Rider__typ; +static void Files_Assert (BOOLEAN truth); export Files_File Files_Base (Files_Rider *r, ADDRESS *r__typ); static Files_File Files_CacheEntry (Platform_FileIdentity identity); export void Files_ChangeDirectory (CHAR *path, ADDRESS path__len, INT16 *res); @@ -111,6 +112,14 @@ export void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, ADDRESS #define Files_IdxTrap() __HALT(-1) #define Files_ToAdr(x) (ADDRESS)x +static void Files_Assert (BOOLEAN truth) +{ + if (!truth) { + Out_Ln(); + __ASSERT(truth, 0); + } +} + static void Files_Err (CHAR *s, ADDRESS s__len, Files_File f, INT16 errcode) { __DUP(s, s__len, CHAR); @@ -526,7 +535,7 @@ void Files_GetDate (Files_File f, INT32 *t, INT32 *d) INT32 Files_Pos (Files_Rider *r, ADDRESS *r__typ) { - __ASSERT((*r).offset <= 4096, 0); + Files_Assert((*r).offset <= 4096); return (*r).org + (*r).offset; } @@ -585,7 +594,7 @@ void Files_Set (Files_Rider *r, ADDRESS *r__typ, Files_File f, INT32 pos) org = 0; offset = 0; } - __ASSERT(offset <= 4096, 0); + Files_Assert(offset <= 4096); (*r).buf = buf; (*r).org = org; (*r).offset = offset; @@ -604,7 +613,7 @@ void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x) buf = (*r).buf; offset = (*r).offset; } - __ASSERT(offset <= buf->size, 0); + Files_Assert(offset <= buf->size); if (offset < buf->size) { *x = buf->data[offset]; (*r).offset = offset + 1; @@ -649,7 +658,7 @@ void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS x (*r).offset = offset; xpos += min; n -= min; - __ASSERT(offset <= 4096, 0); + Files_Assert(offset <= 4096); } (*r).res = 0; (*r).eof = 0; @@ -666,13 +675,13 @@ void Files_Write (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE x) INT32 offset; buf = (*r).buf; offset = (*r).offset; - __ASSERT(offset <= 4096, 0); + Files_Assert(offset <= 4096); if ((*r).org != buf->org || offset >= 4096) { Files_Set(&*r, r__typ, buf->f, (*r).org + offset); buf = (*r).buf; offset = (*r).offset; } - __ASSERT(offset < 4096, 0); + Files_Assert(offset < 4096); buf->data[offset] = x; buf->chg = 1; if (offset == buf->size) { @@ -694,13 +703,13 @@ void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS buf = (*r).buf; offset = (*r).offset; while (n > 0) { - __ASSERT(offset <= 4096, 0); + Files_Assert(offset <= 4096); if ((*r).org != buf->org || offset >= 4096) { Files_Set(&*r, r__typ, buf->f, (*r).org + offset); buf = (*r).buf; offset = (*r).offset; } - __ASSERT(offset <= 4096, 0); + Files_Assert(offset <= 4096); restInBuf = 4096 - offset; if (n > restInBuf) { min = restInBuf; @@ -710,7 +719,7 @@ void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS __MOVE((ADDRESS)x + Files_ToAdr(xpos), (ADDRESS)buf->data + Files_ToAdr(offset), min); offset += min; (*r).offset = offset; - __ASSERT(offset <= 4096, 0); + Files_Assert(offset <= 4096); if (offset > buf->size) { buf->f->len += offset - buf->size; buf->size = offset; @@ -919,7 +928,7 @@ void Files_ReadNum (Files_Rider *R, ADDRESS *R__typ, SYSTEM_BYTE *x, ADDRESS x__ Files_Read(&*R, R__typ, (void*)&b); } q += (INT64)__ASH((__MASK(b, -64) - __ASHL(__ASHR(b, 6), 6)), s); - __ASSERT(x__len <= 8, 0); + Files_Assert(x__len <= 8); __MOVE((ADDRESS)&q, (ADDRESS)x, x__len); } diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index 1012ec46..0abbbc73 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index ba769b74..e39356ea 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index d200254d..700aa7c2 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index 27e4473c..8031a41f 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -269,7 +269,11 @@ void Modules_AssertFail (INT32 code) Modules_errstring((CHAR*)".", 2); } Modules_errstring(Platform_NL, 3); - Platform_Exit(code); + if (code > 0) { + Platform_Exit(code); + } else { + Platform_Exit(-1); + } } __TDESC(Modules_ModuleDesc, 1, 2) = {__TDFLDS("ModuleDesc", 48), {0, 28, -12}}; diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index b1f2385e..e651d9ec 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index bc44b83a..5ea38d2b 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index eb93787e..de00e17c 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 72e0feef..b28012be 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index 5624314d..f2ef814d 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 632b78e5..5bdee03c 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index c310c421..7f78e399 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index 02fd6337..e3c859a0 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index acb2df91..0d729ff7 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index 7aedbbd6..30737296 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index e49c222b..4f1e8faa 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index 58f06737..e2711b4d 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index 9d34cea9..d3950d01 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index f6d42592..9ad04131 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index 0f1980ac..54c8695a 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Out.c b/bootstrap/unix-44/Out.c index 82ad945b..9f596918 100644 --- a/bootstrap/unix-44/Out.c +++ b/bootstrap/unix-44/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Out.h b/bootstrap/unix-44/Out.h index d58a17d5..c4807be1 100644 --- a/bootstrap/unix-44/Out.h +++ b/bootstrap/unix-44/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 459d5079..2e744566 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index 34547692..d7337ec6 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index be3ad909..1a0aae45 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index e8d15a2f..a39cdedc 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index fd550df3..f29bce42 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index 76cb022d..d67ec004 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index f304b8bf..f0340e83 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index ecdf9223..1b34b2d4 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/VT100.c b/bootstrap/unix-44/VT100.c index 38c0743f..14140265 100644 --- a/bootstrap/unix-44/VT100.c +++ b/bootstrap/unix-44/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/VT100.h b/bootstrap/unix-44/VT100.h index 4bbb3110..b8dc8094 100644 --- a/bootstrap/unix-44/VT100.h +++ b/bootstrap/unix-44/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index 66f80319..7193bad6 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index 472c60f3..b6367689 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/Compiler.c b/bootstrap/unix-48/Compiler.c index e900905f..cf8a66c5 100644 --- a/bootstrap/unix-48/Compiler.c +++ b/bootstrap/unix-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index 071d7b8e..cbbddc2b 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index b1942442..cacb981f 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 0a3293ab..947b36b8 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -60,6 +60,7 @@ export ADDRESS *Files_FileDesc__typ; export ADDRESS *Files_BufDesc__typ; export ADDRESS *Files_Rider__typ; +static void Files_Assert (BOOLEAN truth); export Files_File Files_Base (Files_Rider *r, ADDRESS *r__typ); static Files_File Files_CacheEntry (Platform_FileIdentity identity); export void Files_ChangeDirectory (CHAR *path, ADDRESS path__len, INT16 *res); @@ -111,6 +112,14 @@ export void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, ADDRESS #define Files_IdxTrap() __HALT(-1) #define Files_ToAdr(x) (ADDRESS)x +static void Files_Assert (BOOLEAN truth) +{ + if (!truth) { + Out_Ln(); + __ASSERT(truth, 0); + } +} + static void Files_Err (CHAR *s, ADDRESS s__len, Files_File f, INT16 errcode) { __DUP(s, s__len, CHAR); @@ -526,7 +535,7 @@ void Files_GetDate (Files_File f, INT32 *t, INT32 *d) INT32 Files_Pos (Files_Rider *r, ADDRESS *r__typ) { - __ASSERT((*r).offset <= 4096, 0); + Files_Assert((*r).offset <= 4096); return (*r).org + (*r).offset; } @@ -585,7 +594,7 @@ void Files_Set (Files_Rider *r, ADDRESS *r__typ, Files_File f, INT32 pos) org = 0; offset = 0; } - __ASSERT(offset <= 4096, 0); + Files_Assert(offset <= 4096); (*r).buf = buf; (*r).org = org; (*r).offset = offset; @@ -604,7 +613,7 @@ void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x) buf = (*r).buf; offset = (*r).offset; } - __ASSERT(offset <= buf->size, 0); + Files_Assert(offset <= buf->size); if (offset < buf->size) { *x = buf->data[offset]; (*r).offset = offset + 1; @@ -649,7 +658,7 @@ void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS x (*r).offset = offset; xpos += min; n -= min; - __ASSERT(offset <= 4096, 0); + Files_Assert(offset <= 4096); } (*r).res = 0; (*r).eof = 0; @@ -666,13 +675,13 @@ void Files_Write (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE x) INT32 offset; buf = (*r).buf; offset = (*r).offset; - __ASSERT(offset <= 4096, 0); + Files_Assert(offset <= 4096); if ((*r).org != buf->org || offset >= 4096) { Files_Set(&*r, r__typ, buf->f, (*r).org + offset); buf = (*r).buf; offset = (*r).offset; } - __ASSERT(offset < 4096, 0); + Files_Assert(offset < 4096); buf->data[offset] = x; buf->chg = 1; if (offset == buf->size) { @@ -694,13 +703,13 @@ void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS buf = (*r).buf; offset = (*r).offset; while (n > 0) { - __ASSERT(offset <= 4096, 0); + Files_Assert(offset <= 4096); if ((*r).org != buf->org || offset >= 4096) { Files_Set(&*r, r__typ, buf->f, (*r).org + offset); buf = (*r).buf; offset = (*r).offset; } - __ASSERT(offset <= 4096, 0); + Files_Assert(offset <= 4096); restInBuf = 4096 - offset; if (n > restInBuf) { min = restInBuf; @@ -710,7 +719,7 @@ void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS __MOVE((ADDRESS)x + Files_ToAdr(xpos), (ADDRESS)buf->data + Files_ToAdr(offset), min); offset += min; (*r).offset = offset; - __ASSERT(offset <= 4096, 0); + Files_Assert(offset <= 4096); if (offset > buf->size) { buf->f->len += offset - buf->size; buf->size = offset; @@ -919,7 +928,7 @@ void Files_ReadNum (Files_Rider *R, ADDRESS *R__typ, SYSTEM_BYTE *x, ADDRESS x__ Files_Read(&*R, R__typ, (void*)&b); } q += (INT64)__ASH((__MASK(b, -64) - __ASHL(__ASHR(b, 6), 6)), s); - __ASSERT(x__len <= 8, 0); + Files_Assert(x__len <= 8); __MOVE((ADDRESS)&q, (ADDRESS)x, x__len); } diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index 1012ec46..0abbbc73 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index ba769b74..e39356ea 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index d200254d..700aa7c2 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index 27e4473c..8031a41f 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -269,7 +269,11 @@ void Modules_AssertFail (INT32 code) Modules_errstring((CHAR*)".", 2); } Modules_errstring(Platform_NL, 3); - Platform_Exit(code); + if (code > 0) { + Platform_Exit(code); + } else { + Platform_Exit(-1); + } } __TDESC(Modules_ModuleDesc, 1, 2) = {__TDFLDS("ModuleDesc", 48), {0, 28, -12}}; diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index b1f2385e..e651d9ec 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index bc44b83a..5ea38d2b 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index eb93787e..de00e17c 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 72e0feef..b28012be 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index 5624314d..f2ef814d 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 632b78e5..5bdee03c 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index c310c421..7f78e399 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index 02fd6337..e3c859a0 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index acb2df91..0d729ff7 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index 7aedbbd6..30737296 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index e49c222b..4f1e8faa 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 1eb85a06..b84b0516 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index 9d34cea9..d3950d01 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index f6d42592..9ad04131 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index 0f1980ac..54c8695a 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Out.c b/bootstrap/unix-48/Out.c index 82ad945b..9f596918 100644 --- a/bootstrap/unix-48/Out.c +++ b/bootstrap/unix-48/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Out.h b/bootstrap/unix-48/Out.h index d58a17d5..c4807be1 100644 --- a/bootstrap/unix-48/Out.h +++ b/bootstrap/unix-48/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 459d5079..2e744566 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index 34547692..d7337ec6 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index be3ad909..1a0aae45 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index e8d15a2f..a39cdedc 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index fd550df3..f29bce42 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index 76cb022d..d67ec004 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index 1428c051..4036d0d5 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index fa28aa92..befb04d5 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/VT100.c b/bootstrap/unix-48/VT100.c index 38c0743f..14140265 100644 --- a/bootstrap/unix-48/VT100.c +++ b/bootstrap/unix-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/VT100.h b/bootstrap/unix-48/VT100.h index 4bbb3110..b8dc8094 100644 --- a/bootstrap/unix-48/VT100.h +++ b/bootstrap/unix-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index 66f80319..7193bad6 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index 472c60f3..b6367689 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/Compiler.c b/bootstrap/unix-88/Compiler.c index e900905f..cf8a66c5 100644 --- a/bootstrap/unix-88/Compiler.c +++ b/bootstrap/unix-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index 071d7b8e..cbbddc2b 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index b1942442..cacb981f 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 6a53103d..fcff6327 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -60,6 +60,7 @@ export ADDRESS *Files_FileDesc__typ; export ADDRESS *Files_BufDesc__typ; export ADDRESS *Files_Rider__typ; +static void Files_Assert (BOOLEAN truth); export Files_File Files_Base (Files_Rider *r, ADDRESS *r__typ); static Files_File Files_CacheEntry (Platform_FileIdentity identity); export void Files_ChangeDirectory (CHAR *path, ADDRESS path__len, INT16 *res); @@ -111,6 +112,14 @@ export void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, ADDRESS #define Files_IdxTrap() __HALT(-1) #define Files_ToAdr(x) (ADDRESS)x +static void Files_Assert (BOOLEAN truth) +{ + if (!truth) { + Out_Ln(); + __ASSERT(truth, 0); + } +} + static void Files_Err (CHAR *s, ADDRESS s__len, Files_File f, INT16 errcode) { __DUP(s, s__len, CHAR); @@ -526,7 +535,7 @@ void Files_GetDate (Files_File f, INT32 *t, INT32 *d) INT32 Files_Pos (Files_Rider *r, ADDRESS *r__typ) { - __ASSERT((*r).offset <= 4096, 0); + Files_Assert((*r).offset <= 4096); return (*r).org + (*r).offset; } @@ -585,7 +594,7 @@ void Files_Set (Files_Rider *r, ADDRESS *r__typ, Files_File f, INT32 pos) org = 0; offset = 0; } - __ASSERT(offset <= 4096, 0); + Files_Assert(offset <= 4096); (*r).buf = buf; (*r).org = org; (*r).offset = offset; @@ -604,7 +613,7 @@ void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x) buf = (*r).buf; offset = (*r).offset; } - __ASSERT(offset <= buf->size, 0); + Files_Assert(offset <= buf->size); if (offset < buf->size) { *x = buf->data[offset]; (*r).offset = offset + 1; @@ -649,7 +658,7 @@ void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS x (*r).offset = offset; xpos += min; n -= min; - __ASSERT(offset <= 4096, 0); + Files_Assert(offset <= 4096); } (*r).res = 0; (*r).eof = 0; @@ -666,13 +675,13 @@ void Files_Write (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE x) INT32 offset; buf = (*r).buf; offset = (*r).offset; - __ASSERT(offset <= 4096, 0); + Files_Assert(offset <= 4096); if ((*r).org != buf->org || offset >= 4096) { Files_Set(&*r, r__typ, buf->f, (*r).org + offset); buf = (*r).buf; offset = (*r).offset; } - __ASSERT(offset < 4096, 0); + Files_Assert(offset < 4096); buf->data[offset] = x; buf->chg = 1; if (offset == buf->size) { @@ -694,13 +703,13 @@ void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS buf = (*r).buf; offset = (*r).offset; while (n > 0) { - __ASSERT(offset <= 4096, 0); + Files_Assert(offset <= 4096); if ((*r).org != buf->org || offset >= 4096) { Files_Set(&*r, r__typ, buf->f, (*r).org + offset); buf = (*r).buf; offset = (*r).offset; } - __ASSERT(offset <= 4096, 0); + Files_Assert(offset <= 4096); restInBuf = 4096 - offset; if (n > restInBuf) { min = restInBuf; @@ -710,7 +719,7 @@ void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS __MOVE((ADDRESS)x + Files_ToAdr(xpos), (ADDRESS)buf->data + Files_ToAdr(offset), min); offset += min; (*r).offset = offset; - __ASSERT(offset <= 4096, 0); + Files_Assert(offset <= 4096); if (offset > buf->size) { buf->f->len += offset - buf->size; buf->size = offset; @@ -919,7 +928,7 @@ void Files_ReadNum (Files_Rider *R, ADDRESS *R__typ, SYSTEM_BYTE *x, ADDRESS x__ Files_Read(&*R, R__typ, (void*)&b); } q += (INT64)__ASH((__MASK(b, -64) - __ASHL(__ASHR(b, 6), 6)), s); - __ASSERT(x__len <= 8, 0); + Files_Assert(x__len <= 8); __MOVE((ADDRESS)&q, (ADDRESS)x, x__len); } diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 5a99da54..003d8c99 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index 032e9544..49d8a8f6 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index bf12c17b..6f099a6c 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 12ee85c4..a6cc971c 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -269,7 +269,11 @@ void Modules_AssertFail (INT32 code) Modules_errstring((CHAR*)".", 2); } Modules_errstring(Platform_NL, 3); - Platform_Exit(code); + if (code > 0) { + Platform_Exit(code); + } else { + Platform_Exit(-1); + } } __TDESC(Modules_ModuleDesc, 1, 2) = {__TDFLDS("ModuleDesc", 64), {0, 32, -24}}; diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index b1f2385e..e651d9ec 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index bc44b83a..5ea38d2b 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index eb93787e..de00e17c 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index 72e0feef..b28012be 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index 5624314d..f2ef814d 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index b2fd5536..ae88d2b7 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index c310c421..7f78e399 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index e6b89be2..1167b5aa 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index acb2df91..0d729ff7 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index 7aedbbd6..30737296 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index e49c222b..4f1e8faa 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index 4a900e78..958185d0 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 9d34cea9..d3950d01 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 1b610f35..f90939e0 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index 0f1980ac..54c8695a 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Out.c b/bootstrap/unix-88/Out.c index 82ad945b..9f596918 100644 --- a/bootstrap/unix-88/Out.c +++ b/bootstrap/unix-88/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Out.h b/bootstrap/unix-88/Out.h index d58a17d5..c4807be1 100644 --- a/bootstrap/unix-88/Out.h +++ b/bootstrap/unix-88/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 543ed88a..390490ed 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index bfe37a2c..de69c8e3 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index be3ad909..1a0aae45 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index e8d15a2f..a39cdedc 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index fd550df3..f29bce42 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index 76cb022d..d67ec004 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index 7182a772..59875b4f 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index e8735b00..8207d839 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/VT100.c b/bootstrap/unix-88/VT100.c index 38c0743f..14140265 100644 --- a/bootstrap/unix-88/VT100.c +++ b/bootstrap/unix-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/VT100.h b/bootstrap/unix-88/VT100.h index 4bbb3110..b8dc8094 100644 --- a/bootstrap/unix-88/VT100.h +++ b/bootstrap/unix-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index 66f80319..7193bad6 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index 472c60f3..b6367689 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/Compiler.c b/bootstrap/windows-48/Compiler.c index e900905f..cf8a66c5 100644 --- a/bootstrap/windows-48/Compiler.c +++ b/bootstrap/windows-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index 071d7b8e..cbbddc2b 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index b1942442..cacb981f 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index bdbabe97..22743378 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -60,6 +60,7 @@ export ADDRESS *Files_FileDesc__typ; export ADDRESS *Files_BufDesc__typ; export ADDRESS *Files_Rider__typ; +static void Files_Assert (BOOLEAN truth); export Files_File Files_Base (Files_Rider *r, ADDRESS *r__typ); static Files_File Files_CacheEntry (Platform_FileIdentity identity); export void Files_ChangeDirectory (CHAR *path, ADDRESS path__len, INT16 *res); @@ -111,6 +112,14 @@ export void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, ADDRESS #define Files_IdxTrap() __HALT(-1) #define Files_ToAdr(x) (ADDRESS)x +static void Files_Assert (BOOLEAN truth) +{ + if (!truth) { + Out_Ln(); + __ASSERT(truth, 0); + } +} + static void Files_Err (CHAR *s, ADDRESS s__len, Files_File f, INT16 errcode) { __DUP(s, s__len, CHAR); @@ -526,7 +535,7 @@ void Files_GetDate (Files_File f, INT32 *t, INT32 *d) INT32 Files_Pos (Files_Rider *r, ADDRESS *r__typ) { - __ASSERT((*r).offset <= 4096, 0); + Files_Assert((*r).offset <= 4096); return (*r).org + (*r).offset; } @@ -585,7 +594,7 @@ void Files_Set (Files_Rider *r, ADDRESS *r__typ, Files_File f, INT32 pos) org = 0; offset = 0; } - __ASSERT(offset <= 4096, 0); + Files_Assert(offset <= 4096); (*r).buf = buf; (*r).org = org; (*r).offset = offset; @@ -604,7 +613,7 @@ void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x) buf = (*r).buf; offset = (*r).offset; } - __ASSERT(offset <= buf->size, 0); + Files_Assert(offset <= buf->size); if (offset < buf->size) { *x = buf->data[offset]; (*r).offset = offset + 1; @@ -649,7 +658,7 @@ void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS x (*r).offset = offset; xpos += min; n -= min; - __ASSERT(offset <= 4096, 0); + Files_Assert(offset <= 4096); } (*r).res = 0; (*r).eof = 0; @@ -666,13 +675,13 @@ void Files_Write (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE x) INT32 offset; buf = (*r).buf; offset = (*r).offset; - __ASSERT(offset <= 4096, 0); + Files_Assert(offset <= 4096); if ((*r).org != buf->org || offset >= 4096) { Files_Set(&*r, r__typ, buf->f, (*r).org + offset); buf = (*r).buf; offset = (*r).offset; } - __ASSERT(offset < 4096, 0); + Files_Assert(offset < 4096); buf->data[offset] = x; buf->chg = 1; if (offset == buf->size) { @@ -694,13 +703,13 @@ void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS buf = (*r).buf; offset = (*r).offset; while (n > 0) { - __ASSERT(offset <= 4096, 0); + Files_Assert(offset <= 4096); if ((*r).org != buf->org || offset >= 4096) { Files_Set(&*r, r__typ, buf->f, (*r).org + offset); buf = (*r).buf; offset = (*r).offset; } - __ASSERT(offset <= 4096, 0); + Files_Assert(offset <= 4096); restInBuf = 4096 - offset; if (n > restInBuf) { min = restInBuf; @@ -710,7 +719,7 @@ void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS __MOVE((ADDRESS)x + Files_ToAdr(xpos), (ADDRESS)buf->data + Files_ToAdr(offset), min); offset += min; (*r).offset = offset; - __ASSERT(offset <= 4096, 0); + Files_Assert(offset <= 4096); if (offset > buf->size) { buf->f->len += offset - buf->size; buf->size = offset; @@ -919,7 +928,7 @@ void Files_ReadNum (Files_Rider *R, ADDRESS *R__typ, SYSTEM_BYTE *x, ADDRESS x__ Files_Read(&*R, R__typ, (void*)&b); } q += (INT64)__ASH((__MASK(b, -64) - __ASHL(__ASHR(b, 6), 6)), s); - __ASSERT(x__len <= 8, 0); + Files_Assert(x__len <= 8); __MOVE((ADDRESS)&q, (ADDRESS)x, x__len); } diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index 2750cbdd..c932d3d5 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index ba769b74..e39356ea 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index d200254d..700aa7c2 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index 27e4473c..8031a41f 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -269,7 +269,11 @@ void Modules_AssertFail (INT32 code) Modules_errstring((CHAR*)".", 2); } Modules_errstring(Platform_NL, 3); - Platform_Exit(code); + if (code > 0) { + Platform_Exit(code); + } else { + Platform_Exit(-1); + } } __TDESC(Modules_ModuleDesc, 1, 2) = {__TDFLDS("ModuleDesc", 48), {0, 28, -12}}; diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index b1f2385e..e651d9ec 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index bc44b83a..5ea38d2b 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index eb93787e..de00e17c 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 72e0feef..b28012be 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index 5624314d..f2ef814d 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 632b78e5..5bdee03c 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index c310c421..7f78e399 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index 02fd6337..e3c859a0 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index acb2df91..0d729ff7 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index 7aedbbd6..30737296 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index e49c222b..4f1e8faa 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 1eb85a06..b84b0516 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index 9d34cea9..d3950d01 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index f6d42592..9ad04131 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index 0f1980ac..54c8695a 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Out.c b/bootstrap/windows-48/Out.c index de9a7701..32c0b1ba 100644 --- a/bootstrap/windows-48/Out.c +++ b/bootstrap/windows-48/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Out.h b/bootstrap/windows-48/Out.h index d58a17d5..c4807be1 100644 --- a/bootstrap/windows-48/Out.h +++ b/bootstrap/windows-48/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 2d035abe..afe3e355 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index 3f6520f3..6ce3eb3b 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index be3ad909..1a0aae45 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index e8d15a2f..a39cdedc 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index fd550df3..f29bce42 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index 76cb022d..d67ec004 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index 1428c051..4036d0d5 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index fa28aa92..befb04d5 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/VT100.c b/bootstrap/windows-48/VT100.c index 38c0743f..14140265 100644 --- a/bootstrap/windows-48/VT100.c +++ b/bootstrap/windows-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/VT100.h b/bootstrap/windows-48/VT100.h index 4bbb3110..b8dc8094 100644 --- a/bootstrap/windows-48/VT100.h +++ b/bootstrap/windows-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index 66f80319..7193bad6 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index 472c60f3..b6367689 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/Compiler.c b/bootstrap/windows-88/Compiler.c index e900905f..cf8a66c5 100644 --- a/bootstrap/windows-88/Compiler.c +++ b/bootstrap/windows-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index 071d7b8e..cbbddc2b 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index b1942442..cacb981f 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index fce3936a..dd14992a 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -61,6 +61,7 @@ export ADDRESS *Files_FileDesc__typ; export ADDRESS *Files_BufDesc__typ; export ADDRESS *Files_Rider__typ; +static void Files_Assert (BOOLEAN truth); export Files_File Files_Base (Files_Rider *r, ADDRESS *r__typ); static Files_File Files_CacheEntry (Platform_FileIdentity identity); export void Files_ChangeDirectory (CHAR *path, ADDRESS path__len, INT16 *res); @@ -112,6 +113,14 @@ export void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, ADDRESS #define Files_IdxTrap() __HALT(-1) #define Files_ToAdr(x) (ADDRESS)x +static void Files_Assert (BOOLEAN truth) +{ + if (!truth) { + Out_Ln(); + __ASSERT(truth, 0); + } +} + static void Files_Err (CHAR *s, ADDRESS s__len, Files_File f, INT16 errcode) { __DUP(s, s__len, CHAR); @@ -527,7 +536,7 @@ void Files_GetDate (Files_File f, INT32 *t, INT32 *d) INT32 Files_Pos (Files_Rider *r, ADDRESS *r__typ) { - __ASSERT((*r).offset <= 4096, 0); + Files_Assert((*r).offset <= 4096); return (*r).org + (*r).offset; } @@ -586,7 +595,7 @@ void Files_Set (Files_Rider *r, ADDRESS *r__typ, Files_File f, INT32 pos) org = 0; offset = 0; } - __ASSERT(offset <= 4096, 0); + Files_Assert(offset <= 4096); (*r).buf = buf; (*r).org = org; (*r).offset = offset; @@ -605,7 +614,7 @@ void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x) buf = (*r).buf; offset = (*r).offset; } - __ASSERT(offset <= buf->size, 0); + Files_Assert(offset <= buf->size); if (offset < buf->size) { *x = buf->data[offset]; (*r).offset = offset + 1; @@ -650,7 +659,7 @@ void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS x (*r).offset = offset; xpos += min; n -= min; - __ASSERT(offset <= 4096, 0); + Files_Assert(offset <= 4096); } (*r).res = 0; (*r).eof = 0; @@ -667,13 +676,13 @@ void Files_Write (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE x) INT32 offset; buf = (*r).buf; offset = (*r).offset; - __ASSERT(offset <= 4096, 0); + Files_Assert(offset <= 4096); if ((*r).org != buf->org || offset >= 4096) { Files_Set(&*r, r__typ, buf->f, (*r).org + offset); buf = (*r).buf; offset = (*r).offset; } - __ASSERT(offset < 4096, 0); + Files_Assert(offset < 4096); buf->data[offset] = x; buf->chg = 1; if (offset == buf->size) { @@ -695,13 +704,13 @@ void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS buf = (*r).buf; offset = (*r).offset; while (n > 0) { - __ASSERT(offset <= 4096, 0); + Files_Assert(offset <= 4096); if ((*r).org != buf->org || offset >= 4096) { Files_Set(&*r, r__typ, buf->f, (*r).org + offset); buf = (*r).buf; offset = (*r).offset; } - __ASSERT(offset <= 4096, 0); + Files_Assert(offset <= 4096); restInBuf = 4096 - offset; if (n > restInBuf) { min = restInBuf; @@ -711,7 +720,7 @@ void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS __MOVE((ADDRESS)x + Files_ToAdr(xpos), (ADDRESS)buf->data + Files_ToAdr(offset), min); offset += min; (*r).offset = offset; - __ASSERT(offset <= 4096, 0); + Files_Assert(offset <= 4096); if (offset > buf->size) { buf->f->len += offset - buf->size; buf->size = offset; @@ -921,7 +930,7 @@ void Files_ReadNum (Files_Rider *R, ADDRESS *R__typ, SYSTEM_BYTE *x, ADDRESS x__ Files_Read(&*R, R__typ, (void*)&b); } q += (INT64)__ASH((__MASK(b, -64) - __ASHL(__ASHR(b, 6), 6)), s); - __ASSERT(x__len <= 8, 0); + Files_Assert(x__len <= 8); __MOVE((ADDRESS)&q, (ADDRESS)x, x__len); } diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 7459e85e..59d053bd 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index 032e9544..49d8a8f6 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index bf12c17b..6f099a6c 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 12ee85c4..a6cc971c 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -269,7 +269,11 @@ void Modules_AssertFail (INT32 code) Modules_errstring((CHAR*)".", 2); } Modules_errstring(Platform_NL, 3); - Platform_Exit(code); + if (code > 0) { + Platform_Exit(code); + } else { + Platform_Exit(-1); + } } __TDESC(Modules_ModuleDesc, 1, 2) = {__TDFLDS("ModuleDesc", 64), {0, 32, -24}}; diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index b1f2385e..e651d9ec 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index bc44b83a..5ea38d2b 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index eb93787e..de00e17c 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index 72e0feef..b28012be 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index 5624314d..f2ef814d 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index b2fd5536..ae88d2b7 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index c310c421..7f78e399 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index e6b89be2..1167b5aa 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index acb2df91..0d729ff7 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index 7aedbbd6..30737296 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index e49c222b..4f1e8faa 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index 4a900e78..958185d0 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 9d34cea9..d3950d01 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 1b610f35..f90939e0 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index 0f1980ac..54c8695a 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Out.c b/bootstrap/windows-88/Out.c index de9a7701..32c0b1ba 100644 --- a/bootstrap/windows-88/Out.c +++ b/bootstrap/windows-88/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Out.h b/bootstrap/windows-88/Out.h index d58a17d5..c4807be1 100644 --- a/bootstrap/windows-88/Out.h +++ b/bootstrap/windows-88/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 9aa7ae12..6ecc123d 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index 2d7faafb..7182d9f7 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index be3ad909..1a0aae45 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index e8d15a2f..a39cdedc 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index fd550df3..f29bce42 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index 76cb022d..d67ec004 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index 7182a772..59875b4f 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index e8735b00..8207d839 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/VT100.c b/bootstrap/windows-88/VT100.c index 38c0743f..14140265 100644 --- a/bootstrap/windows-88/VT100.c +++ b/bootstrap/windows-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/VT100.h b/bootstrap/windows-88/VT100.h index 4bbb3110..b8dc8094 100644 --- a/bootstrap/windows-88/VT100.h +++ b/bootstrap/windows-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index 66f80319..7193bad6 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index 472c60f3..b6367689 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/25]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h From b9339c9516c6e81eacbd2df639f4d7447cfdf26c Mon Sep 17 00:00:00 2001 From: David Brown Date: Mon, 28 Nov 2016 14:56:10 +0000 Subject: [PATCH 346/580] Merge heap fix for negative addresses from OFront. Fix ulmSets CharSet size. --- src/library/ulm/ulmSets.Mod | 96 ++++++++++++++++++------------------- src/runtime/Heap.Mod | 69 ++++++++++++++++++-------- 2 files changed, 96 insertions(+), 69 deletions(-) diff --git a/src/library/ulm/ulmSets.Mod b/src/library/ulm/ulmSets.Mod index d70d21e9..7c75a3ff 100644 --- a/src/library/ulm/ulmSets.Mod +++ b/src/library/ulm/ulmSets.Mod @@ -40,14 +40,14 @@ MODULE ulmSets; setsize* = MAX(SET) + 1; TYPE - CharSet* = ARRAY ORD(MAX(CHAR)) + 1 DIV setsize OF SET; + CharSet* = ARRAY (ORD(MAX(CHAR)) + 1) DIV setsize OF SET; PROCEDURE InitSet*(VAR set: ARRAY OF SET); VAR i: LONGINT; BEGIN i := 0; WHILE i < LEN(set) DO - set[i] := {}; INC(i); + set[i] := {}; INC(i); END; END InitSet; @@ -56,7 +56,7 @@ MODULE ulmSets; BEGIN i := 0; WHILE i < LEN(set) DO - set[i] := - set[i]; INC(i); + set[i] := - set[i]; INC(i); END; END Complement; @@ -92,115 +92,115 @@ MODULE ulmSets; PROCEDURE Intersection*(set1, set2: ARRAY OF SET; VAR result: ARRAY OF SET); VAR - index: INTEGER; + index: INTEGER; BEGIN ASSERT((LEN(result) = LEN(set1)) & (LEN(result) = LEN(set2))); index := 0; WHILE index < LEN(result) DO - result[index] := set1[index] * set2[index]; - INC(index); + result[index] := set1[index] * set2[index]; + INC(index); END; END Intersection; PROCEDURE SymDifference*(set1, set2: ARRAY OF SET; VAR result: ARRAY OF SET); VAR - index: INTEGER; + index: INTEGER; BEGIN ASSERT((LEN(result) = LEN(set1)) & (LEN(result) = LEN(set2))); index := 0; WHILE index < LEN(result) DO - result[index] := set1[index] / set2[index]; - INC(index); + result[index] := set1[index] / set2[index]; + INC(index); END; END SymDifference; PROCEDURE Union*(set1, set2: ARRAY OF SET; VAR result: ARRAY OF SET); VAR - index: INTEGER; + index: INTEGER; BEGIN ASSERT((LEN(result) = LEN(set1)) & (LEN(result) = LEN(set2))); index := 0; WHILE index < LEN(result) DO - result[index] := set1[index] + set2[index]; - INC(index); + result[index] := set1[index] + set2[index]; + INC(index); END; END Union; PROCEDURE Difference*(set1, set2: ARRAY OF SET; VAR result: ARRAY OF SET); VAR - index: INTEGER; + index: INTEGER; BEGIN ASSERT((LEN(result) = LEN(set1)) & (LEN(result) = LEN(set2))); index := 0; WHILE index < LEN(result) DO - result[index] := set1[index] - set2[index]; - INC(index); + result[index] := set1[index] - set2[index]; + INC(index); END; END Difference; PROCEDURE Equal*(set1, set2: ARRAY OF SET) : BOOLEAN; VAR - index: INTEGER; + index: INTEGER; BEGIN index := 0; WHILE (index < LEN(set1)) & (index < LEN(set2)) DO - IF set1[index] # set2[index] THEN - RETURN FALSE - END; - INC(index); + IF set1[index] # set2[index] THEN + RETURN FALSE + END; + INC(index); END; WHILE index < LEN(set1) DO - IF set1[index] # {} THEN - RETURN FALSE - END; - INC(index); + IF set1[index] # {} THEN + RETURN FALSE + END; + INC(index); END; WHILE index < LEN(set2) DO - IF set2[index] # {} THEN - RETURN FALSE - END; - INC(index); + IF set2[index] # {} THEN + RETURN FALSE + END; + INC(index); END; RETURN TRUE END Equal; PROCEDURE Subset*(set1, set2: ARRAY OF SET) : BOOLEAN; VAR - index: INTEGER; + index: INTEGER; BEGIN index := 0; WHILE (index < LEN(set1)) & (index < LEN(set2)) DO - IF set1[index] - set2[index] # {} THEN - RETURN FALSE - END; - INC(index); + IF set1[index] - set2[index] # {} THEN + RETURN FALSE + END; + INC(index); END; WHILE index < LEN(set1) DO - IF set1[index] # {} THEN - RETURN FALSE - END; - INC(index); + IF set1[index] # {} THEN + RETURN FALSE + END; + INC(index); END; RETURN TRUE END Subset; PROCEDURE Card*(set: ARRAY OF SET) : INTEGER; VAR - index: INTEGER; - i: INTEGER; - card: INTEGER; + index: INTEGER; + i: INTEGER; + card: INTEGER; BEGIN card := 0; index := 0; WHILE index < LEN(set) DO - i := 0; - WHILE i <= MAX(SET) DO - IF i IN set[index] THEN - INC(card); - END; - INC(i); - END; - INC(index); + i := 0; + WHILE i <= MAX(SET) DO + IF i IN set[index] THEN + INC(card); + END; + INC(i); + END; + INC(index); END; RETURN card END Card; diff --git a/src/runtime/Heap.Mod b/src/runtime/Heap.Mod index 550867f7..71a0d161 100644 --- a/src/runtime/Heap.Mod +++ b/src/runtime/Heap.Mod @@ -22,7 +22,7 @@ MODULE Heap; (* heap chunks *) nextChnkOff = S.VAL(S.ADDRESS, 0); (* next heap chunk, sorted ascendingly! *) endOff = S.VAL(S.ADDRESS, SZA); (* end of heap chunk *) - blkOff = S.VAL(S.ADDRESS, 3*SZA); (* first block in a chunk *) + blkOff = S.VAL(S.ADDRESS, 3*SZA); (* first block in a chunk, starts with tag *) (* heap blocks *) tagOff = S.VAL(S.ADDRESS, 0); (* block starts with tag *) @@ -79,9 +79,12 @@ MODULE Heap; firstTry: BOOLEAN; (* extensible heap *) - heap: S.ADDRESS; (* the sorted list of heap chunks *) - heapend: S.ADDRESS; (* max possible pointer value (used for stack collection) *) - heapsize*: S.ADDRESS; (* the sum of all heap chunk sizes *) + heap: S.ADDRESS; (* the sorted list of heap chunks *) + heapNegMin: S.ADDRESS; (* Range of pointer values, used for stack collection *) + heapNegMax: S.ADDRESS; + heapPosMin: S.ADDRESS; + heapPosMax: S.ADDRESS; + heapsize*: S.ADDRESS; (* the sum of all heap chunk sizes *) (* finalization candidates *) fin: FinNode; @@ -166,18 +169,28 @@ MODULE Heap; PROCEDURE -OSAllocate(size: S.ADDRESS): S.ADDRESS "Platform_OSAllocate(size)"; PROCEDURE NewChunk(blksz: S.ADDRESS): S.ADDRESS; - VAR chnk: S.ADDRESS; + VAR chnk, blk, end: S.ADDRESS; BEGIN chnk := OSAllocate(blksz + blkOff); IF chnk # 0 THEN - S.PUT(chnk + endOff, chnk + (blkOff + blksz)); - S.PUT(chnk + blkOff, chnk + (blkOff + sizeOff)); - S.PUT(chnk + (blkOff + sizeOff), blksz); - S.PUT(chnk + (blkOff + sntlOff), NoPtrSntl); - S.PUT(chnk + (blkOff + nextOff), bigBlocks); - bigBlocks := chnk + blkOff; - INC(heapsize, blksz) - END ; + blk := chnk + blkOff; (* Heap chunk consists of a single block *) + end := blk + blksz; + S.PUT(chnk + endOff, end); + S.PUT(blk + tagOff, blk + sizeOff); + S.PUT(blk + sizeOff, blksz); + S.PUT(blk + sntlOff, NoPtrSntl); + S.PUT(blk + nextOff, bigBlocks); + bigBlocks := blk; (* Prepend block to list of big blocks *) + INC(heapsize, blksz); + (* Maintain heap range limits *) + IF chnk > 0 THEN + IF chnk < heapPosMin THEN heapPosMin := blk + SZA END; + IF end > heapPosMax THEN heapPosMax := end END + ELSE (* chnk < 0 *) + IF chnk < heapNegMin THEN heapNegMin := blk + SZA END; + IF end > heapNegMax THEN heapNegMax := end END + END + END; RETURN chnk END NewChunk; @@ -199,8 +212,7 @@ MODULE Heap; S.GET(j, next) END; S.PUT(chnk, next); S.PUT(j, chnk) - END ; - IF next = 0 THEN S.GET(chnk+endOff, heapend) END + END END END ExtendHeap; @@ -504,7 +516,8 @@ MODULE Heap; IF sp > stack0 THEN inc := -inc END ; WHILE sp # stack0 DO S.GET(sp, p); - IF (p > heap) & (p < heapend) THEN + IF (p > 0) & (p >= heapPosMin) & (p < heapPosMax) + OR (p < 0) & (p >= heapNegMin) & (p < heapNegMax) THEN IF nofcand = LEN(cand) THEN HeapSort(nofcand, cand); MarkCandidates(nofcand, cand); nofcand := 0 END ; cand[nofcand] := p; INC(nofcand) END ; @@ -565,11 +578,25 @@ PROCEDURE -HeapModuleInit 'Heap__init()'; (* InitHeap is called by Platform.init before any module bodies have been initialised, to enable NEW, S.NEW *) BEGIN - heap := NewChunk(heapSize0); - S.GET(heap + endOff, heapend); - S.PUT(heap, AddressZero); - allocated := 0; firstTry := TRUE; freeList[nofLists] := 1; lockdepth := 0; - FileCount := 0; modules := NIL; heapsize := 0; bigBlocks := 0; fin := NIL; + heap := 0; + heapsize := 0; + allocated := 0; + lockdepth := 0; + heapPosMin := MAX(S.ADDRESS); + heapPosMax := 0; + heapNegMin := 0; + heapNegMax := MIN(S.ADDRESS); + + heap := NewChunk(heapSize0); + S.PUT(heap + nextChnkOff, AddressZero); + + firstTry := TRUE; + freeList[nofLists] := 1; + + FileCount := 0; + modules := NIL; + bigBlocks := 0; + fin := NIL; interrupted := FALSE; HeapModuleInit; From d5c3d2aae5ae7ec38f7012e249f228f8b2a09792 Mon Sep 17 00:00:00 2001 From: David Brown Date: Mon, 28 Nov 2016 15:57:04 +0000 Subject: [PATCH 347/580] Merge __GUARDEQP changes from OFront. --- src/compiler/OPC.Mod | 2 +- src/runtime/SYSTEM.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/compiler/OPC.Mod b/src/compiler/OPC.Mod index 1e5ab5a7..f2e662c9 100644 --- a/src/compiler/OPC.Mod +++ b/src/compiler/OPC.Mod @@ -1091,7 +1091,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) IF obj^.adr = 1 THEN (* WITH-variable *) IF obj^.typ^.comp = OPT.Record THEN Ident(obj); OPM.WriteString("__") ELSE (* cast with guard pointer type *) - OPM.WriteString("(("); Ident(obj^.typ^.strobj); OPM.Write(")"); Ident(obj); OPM.Write(")") + OPM.WriteString("(*("); Ident(obj^.typ^.strobj); OPM.WriteString("*)&"); Ident(obj); OPM.Write(")") END ELSIF (level # OPM.level) & (level > 0) THEN (* intermediate var *) comp := obj^.typ^.comp; diff --git a/src/runtime/SYSTEM.h b/src/runtime/SYSTEM.h index 43baa836..ff4c724d 100644 --- a/src/runtime/SYSTEM.h +++ b/src/runtime/SYSTEM.h @@ -237,7 +237,7 @@ static inline double SYSTEM_ABSD(double i) {return i >= 0.0 ? i : -i;} #define __GUARDR(r, typ, level) (*((typ*)(__IS(r##__typ,typ,level)?r:(__HALT(-5),r)))) #define __GUARDA(p, typ, level) ((struct typ*)(__IS(__TYPEOF(p),typ,level)?p:(__HALT(-5),p))) #define __GUARDEQR(p, dyntyp, typ) if(dyntyp!=typ##__typ) __HALT(-6);*(p) -#define __GUARDEQP(p, typ) if(__TYPEOF(p)!=typ##__typ)__HALT(-6);*(p) +#define __GUARDEQP(p, typ) if(__TYPEOF(p)!=typ##__typ)__HALT(-6);*((typ*)p) From 51ae4c32419e7a94acde37d22877373255259037 Mon Sep 17 00:00:00 2001 From: David Brown Date: Mon, 28 Nov 2016 15:57:49 +0000 Subject: [PATCH 348/580] Update C bootstrap. --- bootstrap/SYSTEM.h | 2 +- bootstrap/unix-44/Compiler.c | 2 +- bootstrap/unix-44/Configuration.c | 4 +-- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Files.c | 2 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 54 ++++++++++++++++++---------- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 6 ++-- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 2 +- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 2 +- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 2 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Out.c | 2 +- bootstrap/unix-44/Out.h | 2 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 36 +++++++++---------- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/VT100.c | 2 +- bootstrap/unix-44/VT100.h | 2 +- bootstrap/unix-44/extTools.c | 2 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-48/Compiler.c | 2 +- bootstrap/unix-48/Configuration.c | 4 +-- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Files.c | 2 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 54 ++++++++++++++++++---------- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 6 ++-- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 2 +- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 2 +- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 2 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Out.c | 2 +- bootstrap/unix-48/Out.h | 2 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 36 +++++++++---------- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/VT100.c | 2 +- bootstrap/unix-48/VT100.h | 2 +- bootstrap/unix-48/extTools.c | 2 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-88/Compiler.c | 2 +- bootstrap/unix-88/Configuration.c | 4 +-- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Files.c | 2 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 54 ++++++++++++++++++---------- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 6 ++-- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 2 +- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 2 +- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 2 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Out.c | 2 +- bootstrap/unix-88/Out.h | 2 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 36 +++++++++---------- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/VT100.c | 2 +- bootstrap/unix-88/VT100.h | 2 +- bootstrap/unix-88/extTools.c | 2 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/windows-48/Compiler.c | 2 +- bootstrap/windows-48/Configuration.c | 4 +-- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Files.c | 2 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 54 ++++++++++++++++++---------- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 6 ++-- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 2 +- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 2 +- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 2 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Out.c | 2 +- bootstrap/windows-48/Out.h | 2 +- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 36 +++++++++---------- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/VT100.c | 2 +- bootstrap/windows-48/VT100.h | 2 +- bootstrap/windows-48/extTools.c | 2 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-88/Compiler.c | 2 +- bootstrap/windows-88/Configuration.c | 4 +-- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Files.c | 2 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 54 ++++++++++++++++++---------- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 6 ++-- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 2 +- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 2 +- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 2 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Out.c | 2 +- bootstrap/windows-88/Out.h | 2 +- bootstrap/windows-88/Platform.c | 2 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 36 +++++++++---------- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/VT100.c | 2 +- bootstrap/windows-88/VT100.h | 2 +- bootstrap/windows-88/extTools.c | 2 +- bootstrap/windows-88/extTools.h | 2 +- 186 files changed, 461 insertions(+), 371 deletions(-) diff --git a/bootstrap/SYSTEM.h b/bootstrap/SYSTEM.h index 43baa836..ff4c724d 100644 --- a/bootstrap/SYSTEM.h +++ b/bootstrap/SYSTEM.h @@ -237,7 +237,7 @@ static inline double SYSTEM_ABSD(double i) {return i >= 0.0 ? i : -i;} #define __GUARDR(r, typ, level) (*((typ*)(__IS(r##__typ,typ,level)?r:(__HALT(-5),r)))) #define __GUARDA(p, typ, level) ((struct typ*)(__IS(__TYPEOF(p),typ,level)?p:(__HALT(-5),p))) #define __GUARDEQR(p, dyntyp, typ) if(dyntyp!=typ##__typ) __HALT(-6);*(p) -#define __GUARDEQP(p, typ) if(__TYPEOF(p)!=typ##__typ)__HALT(-6);*(p) +#define __GUARDEQP(p, typ) if(__TYPEOF(p)!=typ##__typ)__HALT(-6);*((typ*)p) diff --git a/bootstrap/unix-44/Compiler.c b/bootstrap/unix-44/Compiler.c index cf8a66c5..6200dcea 100644 --- a/bootstrap/unix-44/Compiler.c +++ b/bootstrap/unix-44/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index cbbddc2b..13c1e7ff 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index cacb981f..6f418c8a 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 947b36b8..05af3356 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index 0abbbc73..1d0b6ef1 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index e39356ea..ae9ffcfb 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -68,7 +68,7 @@ static INT32 Heap_freeList[10]; static INT32 Heap_bigBlocks; export INT32 Heap_allocated; static BOOLEAN Heap_firstTry; -static INT32 Heap_heap, Heap_heapend; +static INT32 Heap_heap, Heap_heapNegMin, Heap_heapNegMax, Heap_heapPosMin, Heap_heapPosMax; export INT32 Heap_heapsize; static Heap_FinNode Heap_fin; static INT16 Heap_lockdepth; @@ -170,16 +170,33 @@ void Heap_INCREF (Heap_Module m) static INT32 Heap_NewChunk (INT32 blksz) { - INT32 chnk; + INT32 chnk, blk, end; chnk = Heap_OSAllocate(blksz + 12); if (chnk != 0) { - __PUT(chnk + 4, chnk + (12 + blksz), INT32); - __PUT(chnk + 12, chnk + 16, INT32); - __PUT(chnk + 16, blksz, INT32); - __PUT(chnk + 20, -4, INT32); - __PUT(chnk + 24, Heap_bigBlocks, INT32); - Heap_bigBlocks = chnk + 12; + blk = chnk + 12; + end = blk + blksz; + __PUT(chnk + 4, end, INT32); + __PUT(blk, blk + 4, INT32); + __PUT(blk + 4, blksz, INT32); + __PUT(blk + 8, -4, INT32); + __PUT(blk + 12, Heap_bigBlocks, INT32); + Heap_bigBlocks = blk; Heap_heapsize += blksz; + if (chnk > 0) { + if (chnk < Heap_heapPosMin) { + Heap_heapPosMin = blk + 4; + } + if (end > Heap_heapPosMax) { + Heap_heapPosMax = end; + } + } else { + if (chnk < Heap_heapNegMin) { + Heap_heapNegMin = blk + 4; + } + if (end > Heap_heapNegMax) { + Heap_heapNegMax = end; + } + } } return chnk; } @@ -207,9 +224,6 @@ static void Heap_ExtendHeap (INT32 blksz) __PUT(chnk, next, INT32); __PUT(j, chnk, INT32); } - if (next == 0) { - __GET(chnk + 4, Heap_heapend, INT32); - } } } @@ -592,7 +606,7 @@ static void Heap_MarkStack (INT32 n, INT32 *cand, ADDRESS cand__len) } while (sp != stack0) { __GET(sp, p, INT32); - if ((p > Heap_heap && p < Heap_heapend)) { + if ((((p > 0 && p >= Heap_heapPosMin)) && p < Heap_heapPosMax) || (((p < 0 && p >= Heap_heapNegMin)) && p < Heap_heapNegMax)) { if (nofcand == cand__len) { Heap_HeapSort(nofcand, (void*)cand, cand__len); Heap_MarkCandidates(nofcand, (void*)cand, cand__len); @@ -703,16 +717,20 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) void Heap_InitHeap (void) { - Heap_heap = Heap_NewChunk(128000); - __GET(Heap_heap + 4, Heap_heapend, INT32); - __PUT(Heap_heap, 0, INT32); + Heap_heap = 0; + Heap_heapsize = 0; Heap_allocated = 0; + Heap_lockdepth = 0; + Heap_heapPosMin = 2147483647; + Heap_heapPosMax = 0; + Heap_heapNegMin = 0; + Heap_heapNegMax = (-2147483647-1); + Heap_heap = Heap_NewChunk(128000); + __PUT(Heap_heap, 0, INT32); Heap_firstTry = 1; Heap_freeList[9] = 1; - Heap_lockdepth = 0; Heap_FileCount = 0; Heap_modules = NIL; - Heap_heapsize = 0; Heap_bigBlocks = 0; Heap_fin = NIL; Heap_interrupted = 0; diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index 700aa7c2..0cf94754 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index 8031a41f..e4fa8467 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index e651d9ec..d1227884 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index 5ea38d2b..f174acdc 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index de00e17c..1efe3cf3 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index b28012be..4759eb74 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -1659,9 +1659,9 @@ void OPC_CompleteIdent (OPT_Object obj) OPC_Ident(obj); OPM_WriteString((CHAR*)"__", 3); } else { - OPM_WriteString((CHAR*)"((", 3); + OPM_WriteString((CHAR*)"(*(", 4); OPC_Ident(obj->typ->strobj); - OPM_Write(')'); + OPM_WriteString((CHAR*)"*)&", 4); OPC_Ident(obj); OPM_Write(')'); } diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index f2ef814d..a485b3c4 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 5bdee03c..34ca07fd 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index 7f78e399..0b19f055 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index e3c859a0..aef61fc9 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index 0d729ff7..6629924c 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index 30737296..d5c0c747 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index 4f1e8faa..87418922 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index e2711b4d..0d22f650 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index d3950d01..019dee31 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index 9ad04131..ef5a6f06 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index 54c8695a..401db9dd 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Out.c b/bootstrap/unix-44/Out.c index 9f596918..eba9222e 100644 --- a/bootstrap/unix-44/Out.c +++ b/bootstrap/unix-44/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Out.h b/bootstrap/unix-44/Out.h index c4807be1..f58803a5 100644 --- a/bootstrap/unix-44/Out.h +++ b/bootstrap/unix-44/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 2e744566..5cc1bdc0 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index d7337ec6..f4cff92c 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 1a0aae45..5361bdcd 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index a39cdedc..cc2755f0 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index f29bce42..230f60a9 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index d67ec004..ad07bc6d 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index f0340e83..21b5fc34 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -390,27 +390,27 @@ static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, ADDRESS *msg__t if (__IS(msg__typ, Texts_CopyMsg, 1)) { Texts_CopyMsg *msg__ = (void*)msg; __NEW(e, Texts__1); - Texts_CopyElem((void*)((Texts_Alien)E), (void*)e); - e->file = ((Texts_Alien)E)->file; - e->org = ((Texts_Alien)E)->org; - e->span = ((Texts_Alien)E)->span; - __COPY(((Texts_Alien)E)->mod, e->mod, 32); - __COPY(((Texts_Alien)E)->proc, e->proc, 32); + Texts_CopyElem((void*)(*(Texts_Alien*)&E), (void*)e); + e->file = (*(Texts_Alien*)&E)->file; + e->org = (*(Texts_Alien*)&E)->org; + e->span = (*(Texts_Alien*)&E)->span; + __COPY((*(Texts_Alien*)&E)->mod, e->mod, 32); + __COPY((*(Texts_Alien*)&E)->proc, e->proc, 32); (*msg__).e = (Texts_Elem)e; } else __WITHCHK; } else if (__IS(msg__typ, Texts_IdentifyMsg, 1)) { if (__IS(msg__typ, Texts_IdentifyMsg, 1)) { Texts_IdentifyMsg *msg__ = (void*)msg; - __COPY(((Texts_Alien)E)->mod, (*msg__).mod, 32); - __COPY(((Texts_Alien)E)->proc, (*msg__).proc, 32); + __COPY((*(Texts_Alien*)&E)->mod, (*msg__).mod, 32); + __COPY((*(Texts_Alien*)&E)->proc, (*msg__).proc, 32); (*msg__).mod[31] = 0x01; } else __WITHCHK; } else if (__IS(msg__typ, Texts_FileMsg, 1)) { if (__IS(msg__typ, Texts_FileMsg, 1)) { Texts_FileMsg *msg__ = (void*)msg; if ((*msg__).id == 1) { - Files_Set(&r, Files_Rider__typ, ((Texts_Alien)E)->file, ((Texts_Alien)E)->org); - i = ((Texts_Alien)E)->span; + Files_Set(&r, Files_Rider__typ, (*(Texts_Alien*)&E)->file, (*(Texts_Alien*)&E)->org); + i = (*(Texts_Alien*)&E)->span; while (i > 0) { Files_Read(&r, Files_Rider__typ, (void*)&ch); Files_Write(&(*msg__).r, Files_Rider__typ, ch); @@ -646,7 +646,7 @@ void Texts_Read (Texts_Reader *R, ADDRESS *R__typ, CHAR *ch) u = u->next; if (__ISP(u, Texts_PieceDesc, 1)) { if (__ISP(u, Texts_PieceDesc, 1)) { - Files_Set(&(*R).rider, Files_Rider__typ, ((Texts_Piece)u)->file, ((Texts_Piece)u)->org); + Files_Set(&(*R).rider, Files_Rider__typ, (*(Texts_Piece*)&u)->file, (*(Texts_Piece*)&u)->org); } else __WITHCHK; } (*R).run = u; @@ -673,7 +673,7 @@ void Texts_ReadElem (Texts_Reader *R, ADDRESS *R__typ) (*R).elem = __GUARDP(u, Texts_ElemDesc, 1); if (__ISP(un, Texts_PieceDesc, 1)) { if (__ISP(un, Texts_PieceDesc, 1)) { - Files_Set(&(*R).rider, Files_Rider__typ, ((Texts_Piece)un)->file, ((Texts_Piece)un)->org); + Files_Set(&(*R).rider, Files_Rider__typ, (*(Texts_Piece*)&un)->file, (*(Texts_Piece*)&un)->org); } else __WITHCHK; } } else { @@ -1715,9 +1715,9 @@ void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) while (u != T->head) { if (__ISP(u, Texts_PieceDesc, 1)) { if (__ISP(u, Texts_PieceDesc, 1)) { - if (((Texts_Piece)u)->ascii) { - Files_Set(&r1, Files_Rider__typ, ((Texts_Piece)u)->file, ((Texts_Piece)u)->org); - delta = ((Texts_Piece)u)->len; + if ((*(Texts_Piece*)&u)->ascii) { + Files_Set(&r1, Files_Rider__typ, (*(Texts_Piece*)&u)->file, (*(Texts_Piece*)&u)->org); + delta = (*(Texts_Piece*)&u)->len; while (delta > 0) { Files_Read(&r1, Files_Rider__typ, (void*)&ch); delta -= 1; @@ -1728,8 +1728,8 @@ void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) } } } else { - Files_Set(&r1, Files_Rider__typ, ((Texts_Piece)u)->file, ((Texts_Piece)u)->org); - delta = ((Texts_Piece)u)->len; + Files_Set(&r1, Files_Rider__typ, (*(Texts_Piece*)&u)->file, (*(Texts_Piece*)&u)->org); + delta = (*(Texts_Piece*)&u)->len; while (delta > 1024) { Files_ReadBytes(&r1, Files_Rider__typ, (void*)block, 1024, 1024); Files_WriteBytes(&msg.r, Files_Rider__typ, (void*)block, 1024, 1024); diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index 1b34b2d4..8b80a18c 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/VT100.c b/bootstrap/unix-44/VT100.c index 14140265..57d8a782 100644 --- a/bootstrap/unix-44/VT100.c +++ b/bootstrap/unix-44/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/VT100.h b/bootstrap/unix-44/VT100.h index b8dc8094..5e32e01b 100644 --- a/bootstrap/unix-44/VT100.h +++ b/bootstrap/unix-44/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index 7193bad6..18e626a3 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index b6367689..622a5a55 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/Compiler.c b/bootstrap/unix-48/Compiler.c index cf8a66c5..6200dcea 100644 --- a/bootstrap/unix-48/Compiler.c +++ b/bootstrap/unix-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index cbbddc2b..13c1e7ff 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index cacb981f..6f418c8a 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 947b36b8..05af3356 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index 0abbbc73..1d0b6ef1 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index e39356ea..ae9ffcfb 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -68,7 +68,7 @@ static INT32 Heap_freeList[10]; static INT32 Heap_bigBlocks; export INT32 Heap_allocated; static BOOLEAN Heap_firstTry; -static INT32 Heap_heap, Heap_heapend; +static INT32 Heap_heap, Heap_heapNegMin, Heap_heapNegMax, Heap_heapPosMin, Heap_heapPosMax; export INT32 Heap_heapsize; static Heap_FinNode Heap_fin; static INT16 Heap_lockdepth; @@ -170,16 +170,33 @@ void Heap_INCREF (Heap_Module m) static INT32 Heap_NewChunk (INT32 blksz) { - INT32 chnk; + INT32 chnk, blk, end; chnk = Heap_OSAllocate(blksz + 12); if (chnk != 0) { - __PUT(chnk + 4, chnk + (12 + blksz), INT32); - __PUT(chnk + 12, chnk + 16, INT32); - __PUT(chnk + 16, blksz, INT32); - __PUT(chnk + 20, -4, INT32); - __PUT(chnk + 24, Heap_bigBlocks, INT32); - Heap_bigBlocks = chnk + 12; + blk = chnk + 12; + end = blk + blksz; + __PUT(chnk + 4, end, INT32); + __PUT(blk, blk + 4, INT32); + __PUT(blk + 4, blksz, INT32); + __PUT(blk + 8, -4, INT32); + __PUT(blk + 12, Heap_bigBlocks, INT32); + Heap_bigBlocks = blk; Heap_heapsize += blksz; + if (chnk > 0) { + if (chnk < Heap_heapPosMin) { + Heap_heapPosMin = blk + 4; + } + if (end > Heap_heapPosMax) { + Heap_heapPosMax = end; + } + } else { + if (chnk < Heap_heapNegMin) { + Heap_heapNegMin = blk + 4; + } + if (end > Heap_heapNegMax) { + Heap_heapNegMax = end; + } + } } return chnk; } @@ -207,9 +224,6 @@ static void Heap_ExtendHeap (INT32 blksz) __PUT(chnk, next, INT32); __PUT(j, chnk, INT32); } - if (next == 0) { - __GET(chnk + 4, Heap_heapend, INT32); - } } } @@ -592,7 +606,7 @@ static void Heap_MarkStack (INT32 n, INT32 *cand, ADDRESS cand__len) } while (sp != stack0) { __GET(sp, p, INT32); - if ((p > Heap_heap && p < Heap_heapend)) { + if ((((p > 0 && p >= Heap_heapPosMin)) && p < Heap_heapPosMax) || (((p < 0 && p >= Heap_heapNegMin)) && p < Heap_heapNegMax)) { if (nofcand == cand__len) { Heap_HeapSort(nofcand, (void*)cand, cand__len); Heap_MarkCandidates(nofcand, (void*)cand, cand__len); @@ -703,16 +717,20 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) void Heap_InitHeap (void) { - Heap_heap = Heap_NewChunk(128000); - __GET(Heap_heap + 4, Heap_heapend, INT32); - __PUT(Heap_heap, 0, INT32); + Heap_heap = 0; + Heap_heapsize = 0; Heap_allocated = 0; + Heap_lockdepth = 0; + Heap_heapPosMin = 2147483647; + Heap_heapPosMax = 0; + Heap_heapNegMin = 0; + Heap_heapNegMax = (-2147483647-1); + Heap_heap = Heap_NewChunk(128000); + __PUT(Heap_heap, 0, INT32); Heap_firstTry = 1; Heap_freeList[9] = 1; - Heap_lockdepth = 0; Heap_FileCount = 0; Heap_modules = NIL; - Heap_heapsize = 0; Heap_bigBlocks = 0; Heap_fin = NIL; Heap_interrupted = 0; diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index 700aa7c2..0cf94754 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index 8031a41f..e4fa8467 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index e651d9ec..d1227884 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index 5ea38d2b..f174acdc 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index de00e17c..1efe3cf3 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index b28012be..4759eb74 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -1659,9 +1659,9 @@ void OPC_CompleteIdent (OPT_Object obj) OPC_Ident(obj); OPM_WriteString((CHAR*)"__", 3); } else { - OPM_WriteString((CHAR*)"((", 3); + OPM_WriteString((CHAR*)"(*(", 4); OPC_Ident(obj->typ->strobj); - OPM_Write(')'); + OPM_WriteString((CHAR*)"*)&", 4); OPC_Ident(obj); OPM_Write(')'); } diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index f2ef814d..a485b3c4 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 5bdee03c..34ca07fd 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index 7f78e399..0b19f055 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index e3c859a0..aef61fc9 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index 0d729ff7..6629924c 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index 30737296..d5c0c747 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index 4f1e8faa..87418922 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index b84b0516..b4a68499 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index d3950d01..019dee31 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index 9ad04131..ef5a6f06 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index 54c8695a..401db9dd 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Out.c b/bootstrap/unix-48/Out.c index 9f596918..eba9222e 100644 --- a/bootstrap/unix-48/Out.c +++ b/bootstrap/unix-48/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Out.h b/bootstrap/unix-48/Out.h index c4807be1..f58803a5 100644 --- a/bootstrap/unix-48/Out.h +++ b/bootstrap/unix-48/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 2e744566..5cc1bdc0 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index d7337ec6..f4cff92c 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 1a0aae45..5361bdcd 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index a39cdedc..cc2755f0 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index f29bce42..230f60a9 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index d67ec004..ad07bc6d 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index 4036d0d5..ffda81d3 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -390,27 +390,27 @@ static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, ADDRESS *msg__t if (__IS(msg__typ, Texts_CopyMsg, 1)) { Texts_CopyMsg *msg__ = (void*)msg; __NEW(e, Texts__1); - Texts_CopyElem((void*)((Texts_Alien)E), (void*)e); - e->file = ((Texts_Alien)E)->file; - e->org = ((Texts_Alien)E)->org; - e->span = ((Texts_Alien)E)->span; - __COPY(((Texts_Alien)E)->mod, e->mod, 32); - __COPY(((Texts_Alien)E)->proc, e->proc, 32); + Texts_CopyElem((void*)(*(Texts_Alien*)&E), (void*)e); + e->file = (*(Texts_Alien*)&E)->file; + e->org = (*(Texts_Alien*)&E)->org; + e->span = (*(Texts_Alien*)&E)->span; + __COPY((*(Texts_Alien*)&E)->mod, e->mod, 32); + __COPY((*(Texts_Alien*)&E)->proc, e->proc, 32); (*msg__).e = (Texts_Elem)e; } else __WITHCHK; } else if (__IS(msg__typ, Texts_IdentifyMsg, 1)) { if (__IS(msg__typ, Texts_IdentifyMsg, 1)) { Texts_IdentifyMsg *msg__ = (void*)msg; - __COPY(((Texts_Alien)E)->mod, (*msg__).mod, 32); - __COPY(((Texts_Alien)E)->proc, (*msg__).proc, 32); + __COPY((*(Texts_Alien*)&E)->mod, (*msg__).mod, 32); + __COPY((*(Texts_Alien*)&E)->proc, (*msg__).proc, 32); (*msg__).mod[31] = 0x01; } else __WITHCHK; } else if (__IS(msg__typ, Texts_FileMsg, 1)) { if (__IS(msg__typ, Texts_FileMsg, 1)) { Texts_FileMsg *msg__ = (void*)msg; if ((*msg__).id == 1) { - Files_Set(&r, Files_Rider__typ, ((Texts_Alien)E)->file, ((Texts_Alien)E)->org); - i = ((Texts_Alien)E)->span; + Files_Set(&r, Files_Rider__typ, (*(Texts_Alien*)&E)->file, (*(Texts_Alien*)&E)->org); + i = (*(Texts_Alien*)&E)->span; while (i > 0) { Files_Read(&r, Files_Rider__typ, (void*)&ch); Files_Write(&(*msg__).r, Files_Rider__typ, ch); @@ -646,7 +646,7 @@ void Texts_Read (Texts_Reader *R, ADDRESS *R__typ, CHAR *ch) u = u->next; if (__ISP(u, Texts_PieceDesc, 1)) { if (__ISP(u, Texts_PieceDesc, 1)) { - Files_Set(&(*R).rider, Files_Rider__typ, ((Texts_Piece)u)->file, ((Texts_Piece)u)->org); + Files_Set(&(*R).rider, Files_Rider__typ, (*(Texts_Piece*)&u)->file, (*(Texts_Piece*)&u)->org); } else __WITHCHK; } (*R).run = u; @@ -673,7 +673,7 @@ void Texts_ReadElem (Texts_Reader *R, ADDRESS *R__typ) (*R).elem = __GUARDP(u, Texts_ElemDesc, 1); if (__ISP(un, Texts_PieceDesc, 1)) { if (__ISP(un, Texts_PieceDesc, 1)) { - Files_Set(&(*R).rider, Files_Rider__typ, ((Texts_Piece)un)->file, ((Texts_Piece)un)->org); + Files_Set(&(*R).rider, Files_Rider__typ, (*(Texts_Piece*)&un)->file, (*(Texts_Piece*)&un)->org); } else __WITHCHK; } } else { @@ -1715,9 +1715,9 @@ void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) while (u != T->head) { if (__ISP(u, Texts_PieceDesc, 1)) { if (__ISP(u, Texts_PieceDesc, 1)) { - if (((Texts_Piece)u)->ascii) { - Files_Set(&r1, Files_Rider__typ, ((Texts_Piece)u)->file, ((Texts_Piece)u)->org); - delta = ((Texts_Piece)u)->len; + if ((*(Texts_Piece*)&u)->ascii) { + Files_Set(&r1, Files_Rider__typ, (*(Texts_Piece*)&u)->file, (*(Texts_Piece*)&u)->org); + delta = (*(Texts_Piece*)&u)->len; while (delta > 0) { Files_Read(&r1, Files_Rider__typ, (void*)&ch); delta -= 1; @@ -1728,8 +1728,8 @@ void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) } } } else { - Files_Set(&r1, Files_Rider__typ, ((Texts_Piece)u)->file, ((Texts_Piece)u)->org); - delta = ((Texts_Piece)u)->len; + Files_Set(&r1, Files_Rider__typ, (*(Texts_Piece*)&u)->file, (*(Texts_Piece*)&u)->org); + delta = (*(Texts_Piece*)&u)->len; while (delta > 1024) { Files_ReadBytes(&r1, Files_Rider__typ, (void*)block, 1024, 1024); Files_WriteBytes(&msg.r, Files_Rider__typ, (void*)block, 1024, 1024); diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index befb04d5..ef53cdf5 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/VT100.c b/bootstrap/unix-48/VT100.c index 14140265..57d8a782 100644 --- a/bootstrap/unix-48/VT100.c +++ b/bootstrap/unix-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/VT100.h b/bootstrap/unix-48/VT100.h index b8dc8094..5e32e01b 100644 --- a/bootstrap/unix-48/VT100.h +++ b/bootstrap/unix-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index 7193bad6..18e626a3 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index b6367689..622a5a55 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/Compiler.c b/bootstrap/unix-88/Compiler.c index cf8a66c5..6200dcea 100644 --- a/bootstrap/unix-88/Compiler.c +++ b/bootstrap/unix-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index cbbddc2b..13c1e7ff 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index cacb981f..6f418c8a 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index fcff6327..2da0ba3b 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 003d8c99..379f329e 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index 49d8a8f6..ac52c6ae 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -68,7 +68,7 @@ static INT64 Heap_freeList[10]; static INT64 Heap_bigBlocks; export INT64 Heap_allocated; static BOOLEAN Heap_firstTry; -static INT64 Heap_heap, Heap_heapend; +static INT64 Heap_heap, Heap_heapNegMin, Heap_heapNegMax, Heap_heapPosMin, Heap_heapPosMax; export INT64 Heap_heapsize; static Heap_FinNode Heap_fin; static INT16 Heap_lockdepth; @@ -170,16 +170,33 @@ void Heap_INCREF (Heap_Module m) static INT64 Heap_NewChunk (INT64 blksz) { - INT64 chnk; + INT64 chnk, blk, end; chnk = Heap_OSAllocate(blksz + 24); if (chnk != 0) { - __PUT(chnk + 8, chnk + (24 + blksz), INT64); - __PUT(chnk + 24, chnk + 32, INT64); - __PUT(chnk + 32, blksz, INT64); - __PUT(chnk + 40, -8, INT64); - __PUT(chnk + 48, Heap_bigBlocks, INT64); - Heap_bigBlocks = chnk + 24; + blk = chnk + 24; + end = blk + blksz; + __PUT(chnk + 8, end, INT64); + __PUT(blk, blk + 8, INT64); + __PUT(blk + 8, blksz, INT64); + __PUT(blk + 16, -8, INT64); + __PUT(blk + 24, Heap_bigBlocks, INT64); + Heap_bigBlocks = blk; Heap_heapsize += blksz; + if (chnk > 0) { + if (chnk < Heap_heapPosMin) { + Heap_heapPosMin = blk + 8; + } + if (end > Heap_heapPosMax) { + Heap_heapPosMax = end; + } + } else { + if (chnk < Heap_heapNegMin) { + Heap_heapNegMin = blk + 8; + } + if (end > Heap_heapNegMax) { + Heap_heapNegMax = end; + } + } } return chnk; } @@ -207,9 +224,6 @@ static void Heap_ExtendHeap (INT64 blksz) __PUT(chnk, next, INT64); __PUT(j, chnk, INT64); } - if (next == 0) { - __GET(chnk + 8, Heap_heapend, INT64); - } } } @@ -592,7 +606,7 @@ static void Heap_MarkStack (INT64 n, INT64 *cand, ADDRESS cand__len) } while (sp != stack0) { __GET(sp, p, INT64); - if ((p > Heap_heap && p < Heap_heapend)) { + if ((((p > 0 && p >= Heap_heapPosMin)) && p < Heap_heapPosMax) || (((p < 0 && p >= Heap_heapNegMin)) && p < Heap_heapNegMax)) { if (nofcand == (INT64)cand__len) { Heap_HeapSort(nofcand, (void*)cand, cand__len); Heap_MarkCandidates(nofcand, (void*)cand, cand__len); @@ -703,16 +717,20 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) void Heap_InitHeap (void) { - Heap_heap = Heap_NewChunk(256000); - __GET(Heap_heap + 8, Heap_heapend, INT64); - __PUT(Heap_heap, 0, INT64); + Heap_heap = 0; + Heap_heapsize = 0; Heap_allocated = 0; + Heap_lockdepth = 0; + Heap_heapPosMin = 9223372036854775807; + Heap_heapPosMax = 0; + Heap_heapNegMin = 0; + Heap_heapNegMax = (-9223372036854775807-1); + Heap_heap = Heap_NewChunk(256000); + __PUT(Heap_heap, 0, INT64); Heap_firstTry = 1; Heap_freeList[9] = 1; - Heap_lockdepth = 0; Heap_FileCount = 0; Heap_modules = NIL; - Heap_heapsize = 0; Heap_bigBlocks = 0; Heap_fin = NIL; Heap_interrupted = 0; diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index 6f099a6c..9daf685d 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index a6cc971c..f1d1a614 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index e651d9ec..d1227884 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index 5ea38d2b..f174acdc 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index de00e17c..1efe3cf3 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index b28012be..4759eb74 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -1659,9 +1659,9 @@ void OPC_CompleteIdent (OPT_Object obj) OPC_Ident(obj); OPM_WriteString((CHAR*)"__", 3); } else { - OPM_WriteString((CHAR*)"((", 3); + OPM_WriteString((CHAR*)"(*(", 4); OPC_Ident(obj->typ->strobj); - OPM_Write(')'); + OPM_WriteString((CHAR*)"*)&", 4); OPC_Ident(obj); OPM_Write(')'); } diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index f2ef814d..a485b3c4 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index ae88d2b7..5820c0cc 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index 7f78e399..0b19f055 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index 1167b5aa..ccf8dbe4 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index 0d729ff7..6629924c 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index 30737296..d5c0c747 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index 4f1e8faa..87418922 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index 958185d0..8122f444 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index d3950d01..019dee31 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index f90939e0..a03a1aab 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index 54c8695a..401db9dd 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Out.c b/bootstrap/unix-88/Out.c index 9f596918..eba9222e 100644 --- a/bootstrap/unix-88/Out.c +++ b/bootstrap/unix-88/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Out.h b/bootstrap/unix-88/Out.h index c4807be1..f58803a5 100644 --- a/bootstrap/unix-88/Out.h +++ b/bootstrap/unix-88/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 390490ed..def7cd38 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index de69c8e3..f9a40b7b 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 1a0aae45..5361bdcd 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index a39cdedc..cc2755f0 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index f29bce42..230f60a9 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index d67ec004..ad07bc6d 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index 59875b4f..79492c57 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -390,27 +390,27 @@ static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, ADDRESS *msg__t if (__IS(msg__typ, Texts_CopyMsg, 1)) { Texts_CopyMsg *msg__ = (void*)msg; __NEW(e, Texts__1); - Texts_CopyElem((void*)((Texts_Alien)E), (void*)e); - e->file = ((Texts_Alien)E)->file; - e->org = ((Texts_Alien)E)->org; - e->span = ((Texts_Alien)E)->span; - __COPY(((Texts_Alien)E)->mod, e->mod, 32); - __COPY(((Texts_Alien)E)->proc, e->proc, 32); + Texts_CopyElem((void*)(*(Texts_Alien*)&E), (void*)e); + e->file = (*(Texts_Alien*)&E)->file; + e->org = (*(Texts_Alien*)&E)->org; + e->span = (*(Texts_Alien*)&E)->span; + __COPY((*(Texts_Alien*)&E)->mod, e->mod, 32); + __COPY((*(Texts_Alien*)&E)->proc, e->proc, 32); (*msg__).e = (Texts_Elem)e; } else __WITHCHK; } else if (__IS(msg__typ, Texts_IdentifyMsg, 1)) { if (__IS(msg__typ, Texts_IdentifyMsg, 1)) { Texts_IdentifyMsg *msg__ = (void*)msg; - __COPY(((Texts_Alien)E)->mod, (*msg__).mod, 32); - __COPY(((Texts_Alien)E)->proc, (*msg__).proc, 32); + __COPY((*(Texts_Alien*)&E)->mod, (*msg__).mod, 32); + __COPY((*(Texts_Alien*)&E)->proc, (*msg__).proc, 32); (*msg__).mod[31] = 0x01; } else __WITHCHK; } else if (__IS(msg__typ, Texts_FileMsg, 1)) { if (__IS(msg__typ, Texts_FileMsg, 1)) { Texts_FileMsg *msg__ = (void*)msg; if ((*msg__).id == 1) { - Files_Set(&r, Files_Rider__typ, ((Texts_Alien)E)->file, ((Texts_Alien)E)->org); - i = ((Texts_Alien)E)->span; + Files_Set(&r, Files_Rider__typ, (*(Texts_Alien*)&E)->file, (*(Texts_Alien*)&E)->org); + i = (*(Texts_Alien*)&E)->span; while (i > 0) { Files_Read(&r, Files_Rider__typ, (void*)&ch); Files_Write(&(*msg__).r, Files_Rider__typ, ch); @@ -646,7 +646,7 @@ void Texts_Read (Texts_Reader *R, ADDRESS *R__typ, CHAR *ch) u = u->next; if (__ISP(u, Texts_PieceDesc, 1)) { if (__ISP(u, Texts_PieceDesc, 1)) { - Files_Set(&(*R).rider, Files_Rider__typ, ((Texts_Piece)u)->file, ((Texts_Piece)u)->org); + Files_Set(&(*R).rider, Files_Rider__typ, (*(Texts_Piece*)&u)->file, (*(Texts_Piece*)&u)->org); } else __WITHCHK; } (*R).run = u; @@ -673,7 +673,7 @@ void Texts_ReadElem (Texts_Reader *R, ADDRESS *R__typ) (*R).elem = __GUARDP(u, Texts_ElemDesc, 1); if (__ISP(un, Texts_PieceDesc, 1)) { if (__ISP(un, Texts_PieceDesc, 1)) { - Files_Set(&(*R).rider, Files_Rider__typ, ((Texts_Piece)un)->file, ((Texts_Piece)un)->org); + Files_Set(&(*R).rider, Files_Rider__typ, (*(Texts_Piece*)&un)->file, (*(Texts_Piece*)&un)->org); } else __WITHCHK; } } else { @@ -1715,9 +1715,9 @@ void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) while (u != T->head) { if (__ISP(u, Texts_PieceDesc, 1)) { if (__ISP(u, Texts_PieceDesc, 1)) { - if (((Texts_Piece)u)->ascii) { - Files_Set(&r1, Files_Rider__typ, ((Texts_Piece)u)->file, ((Texts_Piece)u)->org); - delta = ((Texts_Piece)u)->len; + if ((*(Texts_Piece*)&u)->ascii) { + Files_Set(&r1, Files_Rider__typ, (*(Texts_Piece*)&u)->file, (*(Texts_Piece*)&u)->org); + delta = (*(Texts_Piece*)&u)->len; while (delta > 0) { Files_Read(&r1, Files_Rider__typ, (void*)&ch); delta -= 1; @@ -1728,8 +1728,8 @@ void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) } } } else { - Files_Set(&r1, Files_Rider__typ, ((Texts_Piece)u)->file, ((Texts_Piece)u)->org); - delta = ((Texts_Piece)u)->len; + Files_Set(&r1, Files_Rider__typ, (*(Texts_Piece*)&u)->file, (*(Texts_Piece*)&u)->org); + delta = (*(Texts_Piece*)&u)->len; while (delta > 1024) { Files_ReadBytes(&r1, Files_Rider__typ, (void*)block, 1024, 1024); Files_WriteBytes(&msg.r, Files_Rider__typ, (void*)block, 1024, 1024); diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index 8207d839..9042b9b8 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/VT100.c b/bootstrap/unix-88/VT100.c index 14140265..57d8a782 100644 --- a/bootstrap/unix-88/VT100.c +++ b/bootstrap/unix-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/VT100.h b/bootstrap/unix-88/VT100.h index b8dc8094..5e32e01b 100644 --- a/bootstrap/unix-88/VT100.h +++ b/bootstrap/unix-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index 7193bad6..18e626a3 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index b6367689..622a5a55 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/Compiler.c b/bootstrap/windows-48/Compiler.c index cf8a66c5..6200dcea 100644 --- a/bootstrap/windows-48/Compiler.c +++ b/bootstrap/windows-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index cbbddc2b..13c1e7ff 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index cacb981f..6f418c8a 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 22743378..ac192041 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index c932d3d5..dca42164 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index e39356ea..ae9ffcfb 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -68,7 +68,7 @@ static INT32 Heap_freeList[10]; static INT32 Heap_bigBlocks; export INT32 Heap_allocated; static BOOLEAN Heap_firstTry; -static INT32 Heap_heap, Heap_heapend; +static INT32 Heap_heap, Heap_heapNegMin, Heap_heapNegMax, Heap_heapPosMin, Heap_heapPosMax; export INT32 Heap_heapsize; static Heap_FinNode Heap_fin; static INT16 Heap_lockdepth; @@ -170,16 +170,33 @@ void Heap_INCREF (Heap_Module m) static INT32 Heap_NewChunk (INT32 blksz) { - INT32 chnk; + INT32 chnk, blk, end; chnk = Heap_OSAllocate(blksz + 12); if (chnk != 0) { - __PUT(chnk + 4, chnk + (12 + blksz), INT32); - __PUT(chnk + 12, chnk + 16, INT32); - __PUT(chnk + 16, blksz, INT32); - __PUT(chnk + 20, -4, INT32); - __PUT(chnk + 24, Heap_bigBlocks, INT32); - Heap_bigBlocks = chnk + 12; + blk = chnk + 12; + end = blk + blksz; + __PUT(chnk + 4, end, INT32); + __PUT(blk, blk + 4, INT32); + __PUT(blk + 4, blksz, INT32); + __PUT(blk + 8, -4, INT32); + __PUT(blk + 12, Heap_bigBlocks, INT32); + Heap_bigBlocks = blk; Heap_heapsize += blksz; + if (chnk > 0) { + if (chnk < Heap_heapPosMin) { + Heap_heapPosMin = blk + 4; + } + if (end > Heap_heapPosMax) { + Heap_heapPosMax = end; + } + } else { + if (chnk < Heap_heapNegMin) { + Heap_heapNegMin = blk + 4; + } + if (end > Heap_heapNegMax) { + Heap_heapNegMax = end; + } + } } return chnk; } @@ -207,9 +224,6 @@ static void Heap_ExtendHeap (INT32 blksz) __PUT(chnk, next, INT32); __PUT(j, chnk, INT32); } - if (next == 0) { - __GET(chnk + 4, Heap_heapend, INT32); - } } } @@ -592,7 +606,7 @@ static void Heap_MarkStack (INT32 n, INT32 *cand, ADDRESS cand__len) } while (sp != stack0) { __GET(sp, p, INT32); - if ((p > Heap_heap && p < Heap_heapend)) { + if ((((p > 0 && p >= Heap_heapPosMin)) && p < Heap_heapPosMax) || (((p < 0 && p >= Heap_heapNegMin)) && p < Heap_heapNegMax)) { if (nofcand == cand__len) { Heap_HeapSort(nofcand, (void*)cand, cand__len); Heap_MarkCandidates(nofcand, (void*)cand, cand__len); @@ -703,16 +717,20 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) void Heap_InitHeap (void) { - Heap_heap = Heap_NewChunk(128000); - __GET(Heap_heap + 4, Heap_heapend, INT32); - __PUT(Heap_heap, 0, INT32); + Heap_heap = 0; + Heap_heapsize = 0; Heap_allocated = 0; + Heap_lockdepth = 0; + Heap_heapPosMin = 2147483647; + Heap_heapPosMax = 0; + Heap_heapNegMin = 0; + Heap_heapNegMax = (-2147483647-1); + Heap_heap = Heap_NewChunk(128000); + __PUT(Heap_heap, 0, INT32); Heap_firstTry = 1; Heap_freeList[9] = 1; - Heap_lockdepth = 0; Heap_FileCount = 0; Heap_modules = NIL; - Heap_heapsize = 0; Heap_bigBlocks = 0; Heap_fin = NIL; Heap_interrupted = 0; diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index 700aa7c2..0cf94754 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index 8031a41f..e4fa8467 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index e651d9ec..d1227884 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index 5ea38d2b..f174acdc 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index de00e17c..1efe3cf3 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index b28012be..4759eb74 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -1659,9 +1659,9 @@ void OPC_CompleteIdent (OPT_Object obj) OPC_Ident(obj); OPM_WriteString((CHAR*)"__", 3); } else { - OPM_WriteString((CHAR*)"((", 3); + OPM_WriteString((CHAR*)"(*(", 4); OPC_Ident(obj->typ->strobj); - OPM_Write(')'); + OPM_WriteString((CHAR*)"*)&", 4); OPC_Ident(obj); OPM_Write(')'); } diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index f2ef814d..a485b3c4 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 5bdee03c..34ca07fd 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index 7f78e399..0b19f055 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index e3c859a0..aef61fc9 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index 0d729ff7..6629924c 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index 30737296..d5c0c747 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index 4f1e8faa..87418922 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index b84b0516..b4a68499 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index d3950d01..019dee31 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index 9ad04131..ef5a6f06 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index 54c8695a..401db9dd 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Out.c b/bootstrap/windows-48/Out.c index 32c0b1ba..7b3897d4 100644 --- a/bootstrap/windows-48/Out.c +++ b/bootstrap/windows-48/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Out.h b/bootstrap/windows-48/Out.h index c4807be1..f58803a5 100644 --- a/bootstrap/windows-48/Out.h +++ b/bootstrap/windows-48/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index afe3e355..1dc027fb 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index 6ce3eb3b..1154e6b1 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 1a0aae45..5361bdcd 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index a39cdedc..cc2755f0 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index f29bce42..230f60a9 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index d67ec004..ad07bc6d 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index 4036d0d5..ffda81d3 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -390,27 +390,27 @@ static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, ADDRESS *msg__t if (__IS(msg__typ, Texts_CopyMsg, 1)) { Texts_CopyMsg *msg__ = (void*)msg; __NEW(e, Texts__1); - Texts_CopyElem((void*)((Texts_Alien)E), (void*)e); - e->file = ((Texts_Alien)E)->file; - e->org = ((Texts_Alien)E)->org; - e->span = ((Texts_Alien)E)->span; - __COPY(((Texts_Alien)E)->mod, e->mod, 32); - __COPY(((Texts_Alien)E)->proc, e->proc, 32); + Texts_CopyElem((void*)(*(Texts_Alien*)&E), (void*)e); + e->file = (*(Texts_Alien*)&E)->file; + e->org = (*(Texts_Alien*)&E)->org; + e->span = (*(Texts_Alien*)&E)->span; + __COPY((*(Texts_Alien*)&E)->mod, e->mod, 32); + __COPY((*(Texts_Alien*)&E)->proc, e->proc, 32); (*msg__).e = (Texts_Elem)e; } else __WITHCHK; } else if (__IS(msg__typ, Texts_IdentifyMsg, 1)) { if (__IS(msg__typ, Texts_IdentifyMsg, 1)) { Texts_IdentifyMsg *msg__ = (void*)msg; - __COPY(((Texts_Alien)E)->mod, (*msg__).mod, 32); - __COPY(((Texts_Alien)E)->proc, (*msg__).proc, 32); + __COPY((*(Texts_Alien*)&E)->mod, (*msg__).mod, 32); + __COPY((*(Texts_Alien*)&E)->proc, (*msg__).proc, 32); (*msg__).mod[31] = 0x01; } else __WITHCHK; } else if (__IS(msg__typ, Texts_FileMsg, 1)) { if (__IS(msg__typ, Texts_FileMsg, 1)) { Texts_FileMsg *msg__ = (void*)msg; if ((*msg__).id == 1) { - Files_Set(&r, Files_Rider__typ, ((Texts_Alien)E)->file, ((Texts_Alien)E)->org); - i = ((Texts_Alien)E)->span; + Files_Set(&r, Files_Rider__typ, (*(Texts_Alien*)&E)->file, (*(Texts_Alien*)&E)->org); + i = (*(Texts_Alien*)&E)->span; while (i > 0) { Files_Read(&r, Files_Rider__typ, (void*)&ch); Files_Write(&(*msg__).r, Files_Rider__typ, ch); @@ -646,7 +646,7 @@ void Texts_Read (Texts_Reader *R, ADDRESS *R__typ, CHAR *ch) u = u->next; if (__ISP(u, Texts_PieceDesc, 1)) { if (__ISP(u, Texts_PieceDesc, 1)) { - Files_Set(&(*R).rider, Files_Rider__typ, ((Texts_Piece)u)->file, ((Texts_Piece)u)->org); + Files_Set(&(*R).rider, Files_Rider__typ, (*(Texts_Piece*)&u)->file, (*(Texts_Piece*)&u)->org); } else __WITHCHK; } (*R).run = u; @@ -673,7 +673,7 @@ void Texts_ReadElem (Texts_Reader *R, ADDRESS *R__typ) (*R).elem = __GUARDP(u, Texts_ElemDesc, 1); if (__ISP(un, Texts_PieceDesc, 1)) { if (__ISP(un, Texts_PieceDesc, 1)) { - Files_Set(&(*R).rider, Files_Rider__typ, ((Texts_Piece)un)->file, ((Texts_Piece)un)->org); + Files_Set(&(*R).rider, Files_Rider__typ, (*(Texts_Piece*)&un)->file, (*(Texts_Piece*)&un)->org); } else __WITHCHK; } } else { @@ -1715,9 +1715,9 @@ void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) while (u != T->head) { if (__ISP(u, Texts_PieceDesc, 1)) { if (__ISP(u, Texts_PieceDesc, 1)) { - if (((Texts_Piece)u)->ascii) { - Files_Set(&r1, Files_Rider__typ, ((Texts_Piece)u)->file, ((Texts_Piece)u)->org); - delta = ((Texts_Piece)u)->len; + if ((*(Texts_Piece*)&u)->ascii) { + Files_Set(&r1, Files_Rider__typ, (*(Texts_Piece*)&u)->file, (*(Texts_Piece*)&u)->org); + delta = (*(Texts_Piece*)&u)->len; while (delta > 0) { Files_Read(&r1, Files_Rider__typ, (void*)&ch); delta -= 1; @@ -1728,8 +1728,8 @@ void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) } } } else { - Files_Set(&r1, Files_Rider__typ, ((Texts_Piece)u)->file, ((Texts_Piece)u)->org); - delta = ((Texts_Piece)u)->len; + Files_Set(&r1, Files_Rider__typ, (*(Texts_Piece*)&u)->file, (*(Texts_Piece*)&u)->org); + delta = (*(Texts_Piece*)&u)->len; while (delta > 1024) { Files_ReadBytes(&r1, Files_Rider__typ, (void*)block, 1024, 1024); Files_WriteBytes(&msg.r, Files_Rider__typ, (void*)block, 1024, 1024); diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index befb04d5..ef53cdf5 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/VT100.c b/bootstrap/windows-48/VT100.c index 14140265..57d8a782 100644 --- a/bootstrap/windows-48/VT100.c +++ b/bootstrap/windows-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/VT100.h b/bootstrap/windows-48/VT100.h index b8dc8094..5e32e01b 100644 --- a/bootstrap/windows-48/VT100.h +++ b/bootstrap/windows-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index 7193bad6..18e626a3 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index b6367689..622a5a55 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/Compiler.c b/bootstrap/windows-88/Compiler.c index cf8a66c5..6200dcea 100644 --- a/bootstrap/windows-88/Compiler.c +++ b/bootstrap/windows-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index cbbddc2b..13c1e7ff 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index cacb981f..6f418c8a 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index dd14992a..517844d9 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 59d053bd..4453e976 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index 49d8a8f6..ac52c6ae 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -68,7 +68,7 @@ static INT64 Heap_freeList[10]; static INT64 Heap_bigBlocks; export INT64 Heap_allocated; static BOOLEAN Heap_firstTry; -static INT64 Heap_heap, Heap_heapend; +static INT64 Heap_heap, Heap_heapNegMin, Heap_heapNegMax, Heap_heapPosMin, Heap_heapPosMax; export INT64 Heap_heapsize; static Heap_FinNode Heap_fin; static INT16 Heap_lockdepth; @@ -170,16 +170,33 @@ void Heap_INCREF (Heap_Module m) static INT64 Heap_NewChunk (INT64 blksz) { - INT64 chnk; + INT64 chnk, blk, end; chnk = Heap_OSAllocate(blksz + 24); if (chnk != 0) { - __PUT(chnk + 8, chnk + (24 + blksz), INT64); - __PUT(chnk + 24, chnk + 32, INT64); - __PUT(chnk + 32, blksz, INT64); - __PUT(chnk + 40, -8, INT64); - __PUT(chnk + 48, Heap_bigBlocks, INT64); - Heap_bigBlocks = chnk + 24; + blk = chnk + 24; + end = blk + blksz; + __PUT(chnk + 8, end, INT64); + __PUT(blk, blk + 8, INT64); + __PUT(blk + 8, blksz, INT64); + __PUT(blk + 16, -8, INT64); + __PUT(blk + 24, Heap_bigBlocks, INT64); + Heap_bigBlocks = blk; Heap_heapsize += blksz; + if (chnk > 0) { + if (chnk < Heap_heapPosMin) { + Heap_heapPosMin = blk + 8; + } + if (end > Heap_heapPosMax) { + Heap_heapPosMax = end; + } + } else { + if (chnk < Heap_heapNegMin) { + Heap_heapNegMin = blk + 8; + } + if (end > Heap_heapNegMax) { + Heap_heapNegMax = end; + } + } } return chnk; } @@ -207,9 +224,6 @@ static void Heap_ExtendHeap (INT64 blksz) __PUT(chnk, next, INT64); __PUT(j, chnk, INT64); } - if (next == 0) { - __GET(chnk + 8, Heap_heapend, INT64); - } } } @@ -592,7 +606,7 @@ static void Heap_MarkStack (INT64 n, INT64 *cand, ADDRESS cand__len) } while (sp != stack0) { __GET(sp, p, INT64); - if ((p > Heap_heap && p < Heap_heapend)) { + if ((((p > 0 && p >= Heap_heapPosMin)) && p < Heap_heapPosMax) || (((p < 0 && p >= Heap_heapNegMin)) && p < Heap_heapNegMax)) { if (nofcand == (INT64)cand__len) { Heap_HeapSort(nofcand, (void*)cand, cand__len); Heap_MarkCandidates(nofcand, (void*)cand, cand__len); @@ -703,16 +717,20 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) void Heap_InitHeap (void) { - Heap_heap = Heap_NewChunk(256000); - __GET(Heap_heap + 8, Heap_heapend, INT64); - __PUT(Heap_heap, 0, INT64); + Heap_heap = 0; + Heap_heapsize = 0; Heap_allocated = 0; + Heap_lockdepth = 0; + Heap_heapPosMin = 9223372036854775807; + Heap_heapPosMax = 0; + Heap_heapNegMin = 0; + Heap_heapNegMax = (-9223372036854775807-1); + Heap_heap = Heap_NewChunk(256000); + __PUT(Heap_heap, 0, INT64); Heap_firstTry = 1; Heap_freeList[9] = 1; - Heap_lockdepth = 0; Heap_FileCount = 0; Heap_modules = NIL; - Heap_heapsize = 0; Heap_bigBlocks = 0; Heap_fin = NIL; Heap_interrupted = 0; diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index 6f099a6c..9daf685d 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index a6cc971c..f1d1a614 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index e651d9ec..d1227884 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index 5ea38d2b..f174acdc 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index de00e17c..1efe3cf3 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index b28012be..4759eb74 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -1659,9 +1659,9 @@ void OPC_CompleteIdent (OPT_Object obj) OPC_Ident(obj); OPM_WriteString((CHAR*)"__", 3); } else { - OPM_WriteString((CHAR*)"((", 3); + OPM_WriteString((CHAR*)"(*(", 4); OPC_Ident(obj->typ->strobj); - OPM_Write(')'); + OPM_WriteString((CHAR*)"*)&", 4); OPC_Ident(obj); OPM_Write(')'); } diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index f2ef814d..a485b3c4 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index ae88d2b7..5820c0cc 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index 7f78e399..0b19f055 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index 1167b5aa..ccf8dbe4 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index 0d729ff7..6629924c 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index 30737296..d5c0c747 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index 4f1e8faa..87418922 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index 958185d0..8122f444 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index d3950d01..019dee31 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index f90939e0..a03a1aab 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index 54c8695a..401db9dd 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Out.c b/bootstrap/windows-88/Out.c index 32c0b1ba..7b3897d4 100644 --- a/bootstrap/windows-88/Out.c +++ b/bootstrap/windows-88/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Out.h b/bootstrap/windows-88/Out.h index c4807be1..f58803a5 100644 --- a/bootstrap/windows-88/Out.h +++ b/bootstrap/windows-88/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 6ecc123d..37b61a0f 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index 7182d9f7..eff1e977 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 1a0aae45..5361bdcd 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index a39cdedc..cc2755f0 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index f29bce42..230f60a9 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index d67ec004..ad07bc6d 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index 59875b4f..79492c57 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -390,27 +390,27 @@ static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, ADDRESS *msg__t if (__IS(msg__typ, Texts_CopyMsg, 1)) { Texts_CopyMsg *msg__ = (void*)msg; __NEW(e, Texts__1); - Texts_CopyElem((void*)((Texts_Alien)E), (void*)e); - e->file = ((Texts_Alien)E)->file; - e->org = ((Texts_Alien)E)->org; - e->span = ((Texts_Alien)E)->span; - __COPY(((Texts_Alien)E)->mod, e->mod, 32); - __COPY(((Texts_Alien)E)->proc, e->proc, 32); + Texts_CopyElem((void*)(*(Texts_Alien*)&E), (void*)e); + e->file = (*(Texts_Alien*)&E)->file; + e->org = (*(Texts_Alien*)&E)->org; + e->span = (*(Texts_Alien*)&E)->span; + __COPY((*(Texts_Alien*)&E)->mod, e->mod, 32); + __COPY((*(Texts_Alien*)&E)->proc, e->proc, 32); (*msg__).e = (Texts_Elem)e; } else __WITHCHK; } else if (__IS(msg__typ, Texts_IdentifyMsg, 1)) { if (__IS(msg__typ, Texts_IdentifyMsg, 1)) { Texts_IdentifyMsg *msg__ = (void*)msg; - __COPY(((Texts_Alien)E)->mod, (*msg__).mod, 32); - __COPY(((Texts_Alien)E)->proc, (*msg__).proc, 32); + __COPY((*(Texts_Alien*)&E)->mod, (*msg__).mod, 32); + __COPY((*(Texts_Alien*)&E)->proc, (*msg__).proc, 32); (*msg__).mod[31] = 0x01; } else __WITHCHK; } else if (__IS(msg__typ, Texts_FileMsg, 1)) { if (__IS(msg__typ, Texts_FileMsg, 1)) { Texts_FileMsg *msg__ = (void*)msg; if ((*msg__).id == 1) { - Files_Set(&r, Files_Rider__typ, ((Texts_Alien)E)->file, ((Texts_Alien)E)->org); - i = ((Texts_Alien)E)->span; + Files_Set(&r, Files_Rider__typ, (*(Texts_Alien*)&E)->file, (*(Texts_Alien*)&E)->org); + i = (*(Texts_Alien*)&E)->span; while (i > 0) { Files_Read(&r, Files_Rider__typ, (void*)&ch); Files_Write(&(*msg__).r, Files_Rider__typ, ch); @@ -646,7 +646,7 @@ void Texts_Read (Texts_Reader *R, ADDRESS *R__typ, CHAR *ch) u = u->next; if (__ISP(u, Texts_PieceDesc, 1)) { if (__ISP(u, Texts_PieceDesc, 1)) { - Files_Set(&(*R).rider, Files_Rider__typ, ((Texts_Piece)u)->file, ((Texts_Piece)u)->org); + Files_Set(&(*R).rider, Files_Rider__typ, (*(Texts_Piece*)&u)->file, (*(Texts_Piece*)&u)->org); } else __WITHCHK; } (*R).run = u; @@ -673,7 +673,7 @@ void Texts_ReadElem (Texts_Reader *R, ADDRESS *R__typ) (*R).elem = __GUARDP(u, Texts_ElemDesc, 1); if (__ISP(un, Texts_PieceDesc, 1)) { if (__ISP(un, Texts_PieceDesc, 1)) { - Files_Set(&(*R).rider, Files_Rider__typ, ((Texts_Piece)un)->file, ((Texts_Piece)un)->org); + Files_Set(&(*R).rider, Files_Rider__typ, (*(Texts_Piece*)&un)->file, (*(Texts_Piece*)&un)->org); } else __WITHCHK; } } else { @@ -1715,9 +1715,9 @@ void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) while (u != T->head) { if (__ISP(u, Texts_PieceDesc, 1)) { if (__ISP(u, Texts_PieceDesc, 1)) { - if (((Texts_Piece)u)->ascii) { - Files_Set(&r1, Files_Rider__typ, ((Texts_Piece)u)->file, ((Texts_Piece)u)->org); - delta = ((Texts_Piece)u)->len; + if ((*(Texts_Piece*)&u)->ascii) { + Files_Set(&r1, Files_Rider__typ, (*(Texts_Piece*)&u)->file, (*(Texts_Piece*)&u)->org); + delta = (*(Texts_Piece*)&u)->len; while (delta > 0) { Files_Read(&r1, Files_Rider__typ, (void*)&ch); delta -= 1; @@ -1728,8 +1728,8 @@ void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) } } } else { - Files_Set(&r1, Files_Rider__typ, ((Texts_Piece)u)->file, ((Texts_Piece)u)->org); - delta = ((Texts_Piece)u)->len; + Files_Set(&r1, Files_Rider__typ, (*(Texts_Piece*)&u)->file, (*(Texts_Piece*)&u)->org); + delta = (*(Texts_Piece*)&u)->len; while (delta > 1024) { Files_ReadBytes(&r1, Files_Rider__typ, (void*)block, 1024, 1024); Files_WriteBytes(&msg.r, Files_Rider__typ, (void*)block, 1024, 1024); diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index 8207d839..9042b9b8 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/VT100.c b/bootstrap/windows-88/VT100.c index 14140265..57d8a782 100644 --- a/bootstrap/windows-88/VT100.c +++ b/bootstrap/windows-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/VT100.h b/bootstrap/windows-88/VT100.h index b8dc8094..5e32e01b 100644 --- a/bootstrap/windows-88/VT100.h +++ b/bootstrap/windows-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index 7193bad6..18e626a3 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index b6367689..622a5a55 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/27]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h From a22c894fd4d90a9a179871000274bbf6c8b4494b Mon Sep 17 00:00:00 2001 From: norayr Date: Tue, 29 Nov 2016 13:13:48 +0400 Subject: [PATCH 349/580] removed ORP PO13 compiler version from the voc source tree. -- noch --- src/voc07R/CompatTexts.Mod | 585 --------------- src/voc07R/Fonts.Mod | 146 ---- src/voc07R/ORB.Mod | 447 ------------ src/voc07R/ORG.Mod | 1134 ----------------------------- src/voc07R/ORP.Mod | 997 ------------------------- src/voc07R/ORS.Mod | 325 --------- src/voc07R/ORTool.Mod | 251 ------- src/voc07R/Oberon.Mod | 111 --- src/voc07R/Oberon10.Scn.Fnt | Bin 2284 -> 0 bytes src/voc07R/README.md | 29 - src/voc07R/makefile | 22 - src/voc07R/test/Oberon.rsc | Bin 7295 -> 0 bytes src/voc07R/test/Oberon.smb | Bin 1372 -> 0 bytes src/voc07R/test/Test.Mod | Bin 248 -> 0 bytes src/voc07R/test/Texts.rsc | Bin 12142 -> 0 bytes src/voc07R/test/Texts.smb | Bin 1212 -> 0 bytes src/voc07R/test/readme | 3 - src/voc07R/x86/CompatFiles.Mod | 677 ----------------- src/voc07R/x86_64/CompatFiles.Mod | 677 ----------------- 19 files changed, 5404 deletions(-) delete mode 100644 src/voc07R/CompatTexts.Mod delete mode 100644 src/voc07R/Fonts.Mod delete mode 100644 src/voc07R/ORB.Mod delete mode 100644 src/voc07R/ORG.Mod delete mode 100644 src/voc07R/ORP.Mod delete mode 100644 src/voc07R/ORS.Mod delete mode 100644 src/voc07R/ORTool.Mod delete mode 100644 src/voc07R/Oberon.Mod delete mode 100644 src/voc07R/Oberon10.Scn.Fnt delete mode 100644 src/voc07R/README.md delete mode 100644 src/voc07R/makefile delete mode 100644 src/voc07R/test/Oberon.rsc delete mode 100644 src/voc07R/test/Oberon.smb delete mode 100644 src/voc07R/test/Test.Mod delete mode 100644 src/voc07R/test/Texts.rsc delete mode 100644 src/voc07R/test/Texts.smb delete mode 100644 src/voc07R/test/readme delete mode 100644 src/voc07R/x86/CompatFiles.Mod delete mode 100644 src/voc07R/x86_64/CompatFiles.Mod diff --git a/src/voc07R/CompatTexts.Mod b/src/voc07R/CompatTexts.Mod deleted file mode 100644 index 8e8b45ac..00000000 --- a/src/voc07R/CompatTexts.Mod +++ /dev/null @@ -1,585 +0,0 @@ -MODULE CompatTexts; (*JG 21.11.90 / NW 11.7.90 / 24.12.95 / 22.11.10 / 26.3.2014*) - IMPORT Files := CompatFiles, Fonts; - - TYPE INTEGER = LONGINT; (* voc adaptation by noch *) - BYTE = CHAR; - - CONST (*scanner symbol classes*) - Inval* = 0; (*invalid symbol*) - Name* = 1; (*name s (length len)*) - String* = 2; (*literal string s (length len)*) - Int* = 3; (*integer i (decimal or hexadecimal)*) - Real* = 4; (*real number x*) - Char* = 6; (*special character c*) - - (* TextBlock = TextTag "1" offset run {run} "0" len {AsciiCode}. - run = fnt [name] col voff len. *) - - TAB = 9X; CR = 0DX; maxD = 9; - TextTag = 0F1X; - replace* = 0; insert* = 1; delete* = 2; unmark* = 3; (*op-codes*) - - TYPE Piece = POINTER TO PieceDesc; - PieceDesc = RECORD - f: Files.File; - off, len: LONGINT; - fnt: Fonts.Font; - col, voff: INTEGER; - prev, next: Piece - END; - - Text* = POINTER TO TextDesc; - Notifier* = PROCEDURE (T: Text; op: INTEGER; beg, end: LONGINT); - TextDesc* = RECORD - len*: LONGINT; - changed*: BOOLEAN; - notify*: Notifier; - trailer: Piece; - pce: Piece; (*cache*) - org: LONGINT; (*cache*) - END; - - Reader* = RECORD - eot*: BOOLEAN; - fnt*: Fonts.Font; - col*, voff*: INTEGER; - ref: Piece; - org: LONGINT; - off: LONGINT; - rider: Files.Rider - END; - - Scanner* = RECORD (Reader) - nextCh*: CHAR; - line*, class*: INTEGER; - i*: LONGINT; - x*: REAL; - y*: LONGREAL; - c*: CHAR; - len*: INTEGER; - s*: ARRAY 32 OF CHAR - END; - - Buffer* = POINTER TO BufDesc; - BufDesc* = RECORD - len*: LONGINT; - header, last: Piece - END; - - Writer* = RECORD - buf*: Buffer; - fnt*: Fonts.Font; - col*, voff*: INTEGER; - rider: Files.Rider - END; - - VAR TrailerFile: Files.File; - - (* voc adaptation by noch *) - PROCEDURE FLOOR(x : REAL): INTEGER; - BEGIN - RETURN ENTIER(x) - END FLOOR; - - PROCEDURE LSL (x, n : INTEGER): INTEGER; - BEGIN - RETURN ASH(x, n); - END LSL; - - PROCEDURE ASR (x, n : INTEGER): INTEGER; - BEGIN - RETURN ASH(x, n); - END ASR; - - - (* -------------------- Filing ------------------------*) - - PROCEDURE Trailer(): Piece; - VAR Q: Piece; - BEGIN NEW(Q); - Q.f := TrailerFile; Q.off := -1; Q.len := 1; Q.fnt := NIL; Q.col := 0; Q.voff := 0; RETURN Q - END Trailer; - - PROCEDURE Load* (VAR R: Files.Rider; T: Text); - VAR Q, q, p: Piece; - off: LONGINT; - N, fno: INTEGER; bt: BYTE; - f: Files.File; - FName: ARRAY 32 OF CHAR; - Dict: ARRAY 32 OF Fonts.Font; - BEGIN f := Files.Base(R); N := 1; Q := Trailer(); p := Q; - Files.ReadInt(R, off); Files.ReadByte(R, bt); - (*fno := bt;*) - fno := ORD(bt); (* voc adaptation by noch *) - WHILE fno # 0 DO - IF fno = N THEN - Files.ReadString(R, FName); - Dict[N] := Fonts.This(FName); INC(N) - END; - NEW(q); q.fnt := Dict[fno]; - Files.ReadByte(R, bt); - (*q.col := bt;*) - q.col := ORD(bt); (* voc adaptation by noch *) - Files.ReadByte(R, bt); - (*q.voff := ASR(LSL(bt, -24), 24);*) - q.voff := ASR(LSL(ORD(bt), -24), 24); (* voc adaptation by noch *) - Files.ReadInt(R, q.len); - Files.ReadByte(R, bt); - (*fno := bt;*) - fno := ORD(bt); (* voc adaptation by noch *) - q.f := f; q.off := off; off := off + q.len; - p.next := q; q.prev := p; p := q - END; - p.next := Q; Q.prev := p; - T.trailer := Q; Files.ReadInt(R, T.len); (*Files.Set(R, f, Files.Pos(R) + T.len)*) - END Load; - - PROCEDURE Open* (T: Text; name: ARRAY OF CHAR); - VAR f: Files.File; R: Files.Rider; Q, q: Piece; - tag: CHAR; len: LONGINT; - BEGIN f := Files.Old(name); - IF f # NIL THEN - Files.Set(R, f, 0); Files.Read(R, tag); - IF tag = TextTag THEN Load(R, T) - ELSE (*Ascii file*) - len := Files.Length(f); Q := Trailer(); - NEW(q); q.fnt := Fonts.Default; q.col := 1; q.voff := 0; q.f := f; q.off := 0; q.len := len; - Q.next := q; q.prev := Q; q.next := Q; Q.prev := q; T.trailer := Q; T.len := len - END - ELSE (*create new text*) - Q := Trailer(); Q.next := Q; Q.prev := Q; T.trailer := Q; T.len := 0 - END ; - T.changed := FALSE; T.org := -1; T.pce := T.trailer (*init cache*) - END Open; - - PROCEDURE Store* (VAR W: Files.Rider; T: Text); - VAR p, q: Piece; - R: Files.Rider; - off, rlen, pos: LONGINT; - N, n: INTEGER; - ch: CHAR; - Dict: ARRAY 32, 32 OF CHAR; - BEGIN pos := Files.Pos(W); Files.WriteInt(W, 0); (*place holder*) - N := 1; p := T.trailer.next; - WHILE p # T.trailer DO - rlen := p.len; q := p.next; - WHILE (q # T.trailer) & (q.fnt = p.fnt) & (q.col = p.col) & (q.voff = p.voff) DO - rlen := rlen + q.len; q := q.next - END; - (*Dict[N] := p.fnt.name;*) - IF p.fnt # NIL THEN COPY(p.fnt.name, Dict[N]) END; (* voc adaptation by noch *) - n := 1; - IF p.fnt # NIL THEN (* voc adaptation by noch *) - WHILE Dict[n] # p.fnt.name DO INC(n) END; - END; - (*Files.WriteByte(W, n);*) - Files.WriteByte(W, SHORT(SHORT(n))); (* voc adaptation by noch *) - IF p.fnt # NIL THEN (* voc adaptation by noch *) - IF n = N THEN Files.WriteString(W, p.fnt.name); INC(N) END; - END; - (*Files.WriteByte(W, p.col);*) - Files.WriteByte(W, SHORT(SHORT(p.col))); (* voc adaptation by noch *) - (*Files.WriteByte(W, p.voff);*) - Files.WriteByte(W, SHORT(SHORT(p.voff))); (* voc adaptation by noch *) - Files.WriteInt(W, rlen); - p := q - END; - Files.WriteByte(W, 0); Files.WriteInt(W, T.len); - off := Files.Pos(W); p := T.trailer.next; - WHILE p # T.trailer DO - rlen := p.len; Files.Set(R, p.f, p.off); - WHILE rlen > 0 DO Files.Read(R, ch); Files.Write(W, ch); DEC(rlen) END ; - p := p.next - END ; - Files.Set(W, Files.Base(W), pos); Files.WriteInt(W, off); (*fixup*) - T.changed := FALSE; - IF T.notify # NIL THEN T.notify(T, unmark, 0, 0) END - END Store; - - PROCEDURE Close*(T: Text; name: ARRAY OF CHAR); - VAR f: Files.File; w: Files.Rider; - BEGIN f := Files.New(name); Files.Set(w, f, 0); - Files.Write(w, TextTag); Store(w, T); Files.Register(f) - END Close; - - (* -------------------- Editing ----------------------- *) - - PROCEDURE OpenBuf* (B: Buffer); - BEGIN NEW(B.header); (*null piece*) - B.last := B.header; B.len := 0 - END OpenBuf; - - PROCEDURE FindPiece (T: Text; pos: LONGINT; VAR org: LONGINT; VAR pce: Piece); - VAR p: Piece; porg: LONGINT; - BEGIN p := T.pce; porg := T.org; - IF pos >= porg THEN - WHILE pos >= porg + p.len DO INC(porg, p.len); p := p.next END - ELSE p := p.prev; DEC(porg, p.len); - WHILE pos < porg DO p := p.prev; DEC(porg, p.len) END - END ; - T.pce := p; T.org := porg; (*update cache*) - pce := p; org := porg - END FindPiece; - - PROCEDURE SplitPiece (p: Piece; off: LONGINT; VAR pr: Piece); - VAR q: Piece; - BEGIN - IF off > 0 THEN NEW(q); - q.fnt := p.fnt; q.col := p.col; q.voff := p.voff; - q.len := p.len - off; - q.f := p.f; q.off := p.off + off; - p.len := off; - q.next := p.next; p.next := q; - q.prev := p; q.next.prev := q; - pr := q - ELSE pr := p - END - END SplitPiece; - - PROCEDURE Save* (T: Text; beg, end: LONGINT; B: Buffer); - VAR p, q, qb, qe: Piece; org: LONGINT; - BEGIN - IF end > T.len THEN end := T.len END; - FindPiece(T, beg, org, p); - NEW(qb); qb^ := p^; - qb.len := qb.len - (beg - org); - qb.off := qb.off + (beg - org); - qe := qb; - WHILE end > org + p.len DO - org := org + p.len; p := p.next; - NEW(q); q^ := p^; qe.next := q; q.prev := qe; qe := q - END; - qe.next := NIL; qe.len := qe.len - (org + p.len - end); - B.last.next := qb; qb.prev := B.last; B.last := qe; - B.len := B.len + (end - beg) - END Save; - - PROCEDURE Copy* (SB, DB: Buffer); - VAR Q, q, p: Piece; - BEGIN p := SB.header; Q := DB.last; - WHILE p # SB.last DO p := p.next; - NEW(q); q^ := p^; Q.next := q; q.prev := Q; Q := q - END; - DB.last := Q; DB.len := DB.len + SB.len - END Copy; - - PROCEDURE Insert* (T: Text; pos: LONGINT; B: Buffer); - VAR pl, pr, p, qb, qe: Piece; org, end: LONGINT; - BEGIN - FindPiece(T, pos, org, p); SplitPiece(p, pos - org, pr); - IF T.org >= org THEN T.org := org - p.prev.len; T.pce := p.prev END ; - pl := pr.prev; qb := B.header.next; - IF (qb # NIL) & (qb.f = pl.f) & (qb.off = pl.off + pl.len) - & (qb.fnt = pl.fnt) & (qb.col = pl.col) & (qb.voff = pl.voff) THEN - pl.len := pl.len + qb.len; qb := qb.next - END; - IF qb # NIL THEN qe := B.last; - qb.prev := pl; pl.next := qb; qe.next := pr; pr.prev := qe - END; - T.len := T.len + B.len; end := pos + B.len; - B.last := B.header; B.last.next := NIL; B.len := 0; - T.changed := TRUE; - (*T.notify(T, insert, pos, end)*) - IF T.notify # NIL THEN - T.notify(T, insert, pos, end) - END(* voc adaptation by noch *) - END Insert; - - PROCEDURE Append* (T: Text; B: Buffer); - BEGIN Insert(T, T.len, B) - END Append; - - PROCEDURE Delete* (T: Text; beg, end: LONGINT; B: Buffer); - VAR pb, pe, pbr, per: Piece; orgb, orge: LONGINT; - BEGIN - IF end > T.len THEN end := T.len END; - FindPiece(T, beg, orgb, pb); SplitPiece(pb, beg - orgb, pbr); - FindPiece(T, end, orge, pe); - SplitPiece(pe, end - orge, per); - IF T.org >= orgb THEN (*adjust cache*) - T.org := orgb - pb.prev.len; T.pce := pb.prev - END; - B.header.next := pbr; B.last := per.prev; - B.last.next := NIL; B.len := end - beg; - per.prev := pbr.prev; pbr.prev.next := per; - T.len := T.len - B.len; - T.changed := TRUE; - IF T.notify # NIL THEN (* noch *) - T.notify(T, delete, beg, end) - END - END Delete; - - PROCEDURE ChangeLooks* (T: Text; beg, end: LONGINT; sel: SET; fnt: Fonts.Font; col, voff: INTEGER); - VAR pb, pe, p: Piece; org: LONGINT; - BEGIN - IF end > T.len THEN end := T.len END; - FindPiece(T, beg, org, p); SplitPiece(p, beg - org, pb); - FindPiece(T, end, org, p); SplitPiece(p, end - org, pe); - p := pb; - REPEAT - IF 0 IN sel THEN p.fnt := fnt END; - IF 1 IN sel THEN p.col := col END; - IF 2 IN sel THEN p.voff := voff END; - p := p.next - UNTIL p = pe; - T.changed := TRUE; - IF T.notify # NIL THEN (* noch *) - T.notify(T, replace, beg, end) - END - END ChangeLooks; - - PROCEDURE Attributes*(T: Text; pos: LONGINT; VAR fnt: Fonts.Font; VAR col, voff: INTEGER); - VAR p: Piece; org: LONGINT; - BEGIN FindPiece(T, pos, org, p); fnt := p.fnt; col := p.col; voff := p.voff - END Attributes; - - (* ------------------ Access: Readers ------------------------- *) - - PROCEDURE OpenReader* (VAR R: Reader; T: Text; pos: LONGINT); - VAR p: Piece; org: LONGINT; - BEGIN FindPiece(T, pos, org, p); - R.ref := p; R.org := org; R.off := pos - org; - Files.Set(R.rider, p.f, p.off + R.off); R.eot := FALSE - END OpenReader; - - PROCEDURE Read* (VAR R: Reader; VAR ch: CHAR); - BEGIN Files.Read(R.rider, ch); - R.fnt := R.ref.fnt; R.col := R.ref.col; R.voff := R.ref.voff; - INC(R.off); - IF R.off = R.ref.len THEN - IF R.ref.f = TrailerFile THEN R.eot := TRUE END; - R.org := R.org + R.off; R.off := 0; - R.ref := R.ref.next; R.org := R.org + R.off; R.off := 0; - Files.Set(R.rider, R.ref.f, R.ref.off) - END - END Read; - - PROCEDURE Pos* (VAR R: Reader): LONGINT; - BEGIN RETURN R.org + R.off - END Pos; - - (* ------------------ Access: Scanners (NW) ------------------------- *) - - PROCEDURE OpenScanner* (VAR S: Scanner; T: Text; pos: LONGINT); - BEGIN OpenReader(S, T, pos); S.line := 0; S.nextCh := " " - END OpenScanner; - - (*floating point formats: - x = 1.m * 2^(e-127) bit 0: sign, bits 1- 8: e, bits 9-31: m - x = 1.m * 2^(e-1023) bit 0: sign, bits 1-11: e, bits 12-63: m *) - - PROCEDURE Ten(n: INTEGER): REAL; - VAR t, p: REAL; - BEGIN t := 1.0; p := 10.0; (*compute 10^n *) - WHILE n > 0 DO - IF ODD(n) THEN t := p * t END ; - p := p*p; n := n DIV 2 - END ; - RETURN t - END Ten; - - PROCEDURE Scan* (VAR S: Scanner); - CONST maxExp = 38; maxM = 16777216; (*2^24*) - VAR ch, term: CHAR; - neg, negE, hex: BOOLEAN; - i, j, h, d, e, n, s: INTEGER; - k: LONGINT; - x: REAL; - BEGIN ch := S.nextCh; i := 0; - WHILE (ch = " ") OR (ch = TAB) OR (ch = CR) DO - IF ch = CR THEN INC(S.line) END ; - Read(S, ch) - END ; - IF ("A" <= ch) & (ch <= "Z") OR ("a" <= ch) & (ch <= "z") THEN (*name*) - REPEAT S.s[i] := ch; INC(i); Read(S, ch) - UNTIL ((ch < "0") & (ch # ".") OR ("9" < ch) & (ch < "A") OR ("Z" < ch) & (ch < "a") OR ("z" < ch)) OR (i = 31); - S.s[i] := 0X; S.len := i; S.class := Name - ELSIF ch = 22X THEN (*string*) - Read(S, ch); - WHILE (ch # 22X) & (ch >= " ") & (i # 31) DO S.s[i] := ch; INC(i); Read(S, ch) END; - S.s[i] := 0X; S.len := i+1; Read(S, ch); S.class := String - ELSE hex := FALSE; - IF ch = "-" THEN neg := TRUE; Read(S, ch) ELSE neg := FALSE END ; - IF ("0" <= ch) & (ch <= "9") THEN (*number*) - n := ORD(ch) - 30H; h := n; Read(S, ch); - WHILE ("0" <= ch) & (ch <= "9") OR ("A" <= ch) & (ch <= "F") DO - IF ch <= "9" THEN d := ORD(ch) - 30H ELSE d := ORD(ch) - 37H; hex := TRUE END ; - n := 10*n + d; h := 10H*h + d; Read(S, ch) - END ; - IF ch = "H" THEN (*hex integer*) Read(S, ch); S.i := h; S.class := Int (*neg?*) - ELSIF ch = "." THEN (*real number*) - Read(S, ch); x := 0.0; e := 0; j := 0; - WHILE ("0" <= ch) & (ch <= "9") DO (*fraction*) - h := 10*n + (ORD(ch) - 30H); - IF h < maxM THEN n := h; INC(j) END ; - Read(S, ch) - END ; - IF ch = "E" THEN (*scale factor*) - s := 0; Read(S, ch); - IF ch = "-" THEN negE := TRUE; Read(S, ch) - ELSE negE := FALSE; - IF ch = "+" THEN Read(S, ch) END - END ; - WHILE ("0" <= ch) & (ch <= "9") DO - s := s*10 + ORD(ch) - 30H; Read(S, ch) - END ; - IF negE THEN DEC(e, s) ELSE INC(e, s) END ; - END ; - (*x := FLT(n);*) - x := n; (* voc adaptation by noch *) - DEC(e, j); - IF e < 0 THEN - IF e >= -maxExp THEN x := x / Ten(-e) ELSE x := 0.0 END - ELSIF e > 0 THEN - IF e <= maxExp THEN x := Ten(e) * x ELSE x := 0.0 END - END ; - IF neg THEN S.x := -x ELSE S.x := x END ; - IF hex THEN S.class := 0 ELSE S.class := Real END - ELSE (*decimal integer*) - IF neg THEN S.i := -n ELSE S.i := n END; - IF hex THEN S.class := Inval ELSE S.class := Int END - END - ELSE (*spectal character*) S.class := Char; - IF neg THEN S.c := "-" ELSE S.c := ch; Read(S, ch) END - END - END ; - S.nextCh := ch - END Scan; - - (* --------------- Access: Writers (NW) ------------------ *) - - PROCEDURE OpenWriter* (VAR W: Writer); - BEGIN NEW(W.buf); - OpenBuf(W.buf); W.fnt := Fonts.Default; W.col := 15; W.voff := 0; - Files.Set(W.rider, Files.New(""), 0) - END OpenWriter; - - PROCEDURE SetFont* (VAR W: Writer; fnt: Fonts.Font); - BEGIN W.fnt := fnt - END SetFont; - - PROCEDURE SetColor* (VAR W: Writer; col: INTEGER); - BEGIN W.col := col - END SetColor; - - PROCEDURE SetOffset* (VAR W: Writer; voff: INTEGER); - BEGIN W.voff := voff - END SetOffset; - - PROCEDURE Write* (VAR W: Writer; ch: CHAR); - VAR p: Piece; - BEGIN - IF (W.buf.last.fnt # W.fnt) OR (W.buf.last.col # W.col) OR (W.buf.last.voff # W.voff) THEN - NEW(p); p.f := Files.Base(W.rider); p.off := Files.Pos(W.rider); p.len := 0; - p.fnt := W.fnt; p.col := W.col; p.voff:= W.voff; - p.next := NIL; W.buf.last.next := p; - p.prev := W.buf.last; W.buf.last := p - END; - Files.Write(W.rider, ch); - INC(W.buf.last.len); INC(W.buf.len) - END Write; - - PROCEDURE WriteLn* (VAR W: Writer); - BEGIN Write(W, CR) - END WriteLn; - - PROCEDURE WriteString* (VAR W: Writer; s: ARRAY OF CHAR); - VAR i: INTEGER; - BEGIN i := 0; - WHILE s[i] >= " " DO Write(W, s[i]); INC(i) END - END WriteString; - - PROCEDURE WriteInt* (VAR W: Writer; x, n: LONGINT); - VAR i: INTEGER; x0: LONGINT; - a: ARRAY 10 OF CHAR; - BEGIN - (*IF ROR(x, 31) = 1 THEN WriteString(W, " -2147483648") - ELSE*) i := 0; (* voc adaptation by noch *) - IF x < 0 THEN DEC(n); x0 := -x ELSE x0 := x END; - REPEAT - a[i] := CHR(x0 MOD 10 + 30H); x0 := x0 DIV 10; INC(i) - UNTIL x0 = 0; - WHILE n > i DO Write(W, " "); DEC(n) END; - IF x < 0 THEN Write(W, "-") END; - REPEAT DEC(i); Write(W, a[i]) UNTIL i = 0 - (*END*) - END WriteInt; - - PROCEDURE WriteHex* (VAR W: Writer; x: LONGINT); - VAR i: INTEGER; y: LONGINT; - a: ARRAY 10 OF CHAR; - BEGIN i := 0; Write(W, " "); - REPEAT y := x MOD 10H; - IF y < 10 THEN a[i] := CHR(y + 30H) ELSE a[i] := CHR(y + 37H) END; - x := x DIV 10H; INC(i) - UNTIL i = 8; - REPEAT DEC(i); Write(W, a[i]) UNTIL i = 0 - END WriteHex; -(* commented out because it's not necessary to compile OR compiler; -- noch - PROCEDURE WriteReal* (VAR W: Writer; x: REAL; n: INTEGER); - VAR e, i, m: INTEGER; x0: REAL; neg: BOOLEAN; - d: ARRAY 16 OF CHAR; - BEGIN - IF x = 0.0 THEN - WriteString(W, " 0.0"); i := 5; - WHILE i < n DO Write(W, " "); INC(i) END - ELSE - IF x < 0.0 THEN x := -x; neg := TRUE ELSE neg := FALSE END ; - x0 := x; UNPK(x0, e); - IF e = 255 THEN WriteString(W, " NaN") - ELSE - REPEAT Write(W, " "); DEC(n) UNTIL n <= 14; - IF neg THEN Write(W, "-") ELSE Write(W, " ") END ; - e := e * 77 DIV 256 - 6; - IF e >= 0 THEN x := x / Ten(e) ELSE x := x * Ten(-e) END ; - IF x >= 10.0E6 THEN x := 0.1*x; INC(e) END ; - m := FLOOR(x + 0.5); i := 0; - IF x >= 10.0E6 THEN x := 0.1*x; INC(e) END ; - REPEAT d[i] := CHR(m MOD 10 + 30H); m := m DIV 10; INC(i) UNTIL m = 0; - DEC(i); Write(W, d[i]); Write(W, "."); - IF i < n-6 THEN n := 0 ELSE n := 13-n END ; - WHILE i > n DO DEC(i); Write(W, d[i]) END ; - Write(W, "E"); INC(e, 6); - IF e < 0 THEN Write(W, "-"); e := -e ELSE Write(W, "+") END ; - Write(W, CHR(e DIV 10 + 30H)); Write(W, CHR(e MOD 10 + 30H)) - END - END - END WriteReal; - *) - PROCEDURE WriteRealFix* (VAR W: Writer; x: REAL; n, k: INTEGER); - VAR i, m: INTEGER; neg: BOOLEAN; - d: ARRAY 12 OF CHAR; - BEGIN - IF x = 0.0 THEN WriteString(W, " 0") - ELSE - IF x < 0.0 THEN x := -x; neg := TRUE ELSE neg := FALSE END ; - IF k > 7 THEN k := 7 END ; - x := Ten(k) * x; m := FLOOR(x + 0.5); - i := 0; - REPEAT d[i] := CHR(m MOD 10 + 30H); m := m DIV 10; INC(i) UNTIL m = 0; - REPEAT Write(W, " "); DEC(n) UNTIL n <= i+3; - IF neg THEN Write(W, "-"); DEC(n) ELSE Write(W, " ") END ; - WHILE i > k DO DEC(i); Write(W, d[i]) END ; - Write(W, "."); - WHILE k > i DO DEC(k); Write(W, "0") END ; - WHILE i > 0 DO DEC(i); Write(W, d[i]) END - END - END WriteRealFix; - - PROCEDURE WritePair(VAR W: Writer; ch: CHAR; x: LONGINT); - BEGIN Write(W, ch); - Write(W, CHR(x DIV 10 + 30H)); Write(W, CHR(x MOD 10 + 30H)) - END WritePair; - - PROCEDURE WriteClock* (VAR W: Writer; d: LONGINT); - BEGIN - WritePair(W, " ", d DIV 20000H MOD 20H); (*day*) - WritePair(W, ".", d DIV 400000H MOD 10H); (*month*) - WritePair(W, ".", d DIV 4000000H MOD 40H); (*year*) - WritePair(W, " ", d DIV 1000H MOD 20H); (*hour*) - WritePair(W, ":", d DIV 40H MOD 40H); (*min*) - WritePair(W, ":", d MOD 40H) (*sec*) - END WriteClock; - -BEGIN TrailerFile := Files.New("") -END CompatTexts. diff --git a/src/voc07R/Fonts.Mod b/src/voc07R/Fonts.Mod deleted file mode 100644 index 15dabaf1..00000000 --- a/src/voc07R/Fonts.Mod +++ /dev/null @@ -1,146 +0,0 @@ -MODULE Fonts; (*JG 18.11.90; PDR 8.6.12; NW 25.3.2013*) - IMPORT SYSTEM, Files := CompatFiles; - - TYPE INTEGER = LONGINT; (* voc adaptation by noch *) - BYTE = CHAR; - - CONST FontFileId = 0DBH; - - TYPE Font* = POINTER TO FontDesc; - FontDesc* = RECORD - name*: ARRAY 32 OF CHAR; - height*, minX*, maxX*, minY*, maxY*: INTEGER; - next*: Font; - T: ARRAY 128 OF INTEGER; - raster: ARRAY 2360 OF BYTE - END ; - - LargeFontDesc = RECORD (FontDesc) ext: ARRAY 2560 OF BYTE END ; - LargeFont = POINTER TO LargeFontDesc; - - (* raster sizes: Syntax8 1367, Syntax10 1628, Syntax12 1688, Syntax14 1843, Syntax14b 1983, - Syntax16 2271, Syntax20 3034, Syntac24 4274, Syntax24b 4302 *) - -VAR Default*, root*: Font; - -PROCEDURE GetPat*(fnt: Font; ch: CHAR; VAR dx, x, y, w, h, patadr: INTEGER); - VAR pa: INTEGER; dxb, xb, yb, wb, hb: BYTE; -BEGIN pa := fnt.T[ORD(ch) MOD 80H]; patadr := pa; - SYSTEM.GET(pa-3, dxb); SYSTEM.GET(pa-2, xb); SYSTEM.GET(pa-1, yb); SYSTEM.GET(pa, wb); SYSTEM.GET(pa+1, hb); - (*dx := dxb;*) - dx := ORD(dxb); (* voc adaptation by noch *) - (*x := xb;*) - x := ORD(xb); (* voc adaptation by noch *) - (*y := yb;*) - y := ORD(yb); (* voc adaptation by noch *) - (*w := wb;*) - w := ORD(wb); (* voc adaptation by noch *) - (*h := hb;*) - h := ORD(hb); (* voc adaptation by noch *) - (*IF yb < 128 THEN y := yb ELSE y := yb - 256 END*) - IF ORD(yb) < 128 THEN y := ORD(yb) ELSE y := ORD(yb) - 256 END (* voc adaptation by noch *) -END GetPat; - -PROCEDURE This*(name: ARRAY OF CHAR): Font; - - TYPE RunRec = RECORD beg, end: BYTE END ; - BoxRec = RECORD dx, x, y, w, h: BYTE END ; - - VAR F: Font; LF: LargeFont; - f: Files.File; R: Files.Rider; - NofRuns, NofBoxes: BYTE; - NofBytes: INTEGER; - height, minX, maxX, minY, maxY: BYTE; - i, j, k, m, n: INTEGER; - a, a0: INTEGER; - b, beg, end: BYTE; - run: ARRAY 16 OF RunRec; - box: ARRAY 512 OF BoxRec; - - PROCEDURE RdInt16(VAR R: Files.Rider; VAR b0: BYTE); - VAR b1: BYTE; - BEGIN Files.ReadByte(R, b0); Files.ReadByte(R, b1) - END RdInt16; - -BEGIN F := root; - WHILE (F # NIL) & (name # F.name) DO F := F.next END; - IF F = NIL THEN - f := Files.Old(name); - IF f # NIL THEN - Files.Set(R, f, 0); Files.ReadByte(R, b); - (*IF b = FontFileId THEN*) - IF ORD(b) = FontFileId THEN (* voc adaptation by noch *) - Files.ReadByte(R, b); (*abstraction*) - Files.ReadByte(R, b); (*family*) - Files.ReadByte(R, b); (*variant*) - NEW(F); - (*F.name := name;*) - COPY(name, F.name); (* voc adaptation by noch *) - RdInt16(R, height); RdInt16(R, minX); RdInt16(R, maxX); RdInt16(R, minY); RdInt16(R, maxY); RdInt16(R, NofRuns); - (*NofBoxes := 0;*) (* voc adaptation by noch *) - NofBoxes := 0X; - k := 0; - (*WHILE k # NofRuns DO*) - WHILE k # ORD(NofRuns) DO (* voc adaptation by noch *) - RdInt16(R, beg); - run[k].beg := beg; RdInt16(R, end); - run[k].end := end; - (*NofBoxes := NofBoxes + end - beg;*) - NofBoxes := CHR(ORD(NofBoxes) + ORD(end) - ORD(beg)); (* voc adaptation by noch *) - INC(k) - END; - NofBytes := 5; j := 0; - (*WHILE j # NofBoxes DO*) - WHILE j # ORD(NofBoxes) DO (* voc adaptation by noch *) - RdInt16(R, box[j].dx); RdInt16(R, box[j].x); RdInt16(R, box[j].y); - RdInt16(R, box[j].w); RdInt16(R, box[j].h); - (*NofBytes := NofBytes + 5 + (box[j].w + 7) DIV 8 * box[j].h;*) - NofBytes := (NofBytes + 5 + (ORD(box[j].w) + 7) DIV 8 * ORD(box[j].h)); (* voc adaptation by noch *) - INC(j) - END; - IF NofBytes < 2300 THEN NEW(F) ELSE NEW(LF); F := LF END ; - (*F.name := name;*) - COPY(name, F.name); (* voc adaptation by noch *) - (*F.height := height; F.minX := minX; F.maxX := maxX; F.maxY := maxY;*) - F.height := ORD(height); F.minX := ORD(minX); F.maxX := ORD(maxX); F.maxY := ORD(maxY); (* voc adaptation by noch *) - (*IF minY >= 80H THEN F.minY := minY - 100H ELSE F.minY := minY END ;*) - IF ORD(minY) >= 80H THEN F.minY := ORD(minY) - 100H ELSE F.minY := ORD(minY) END ; (* voc adaptation by noch *) - a0 := SYSTEM.ADR(F.raster); - SYSTEM.PUT(a0, 0X); SYSTEM.PUT(a0+1, 0X); SYSTEM.PUT(a0+2, 0X); SYSTEM.PUT(a0+3, 0X); SYSTEM.PUT(a0+4, 0X); - (*null pattern for characters not in a run*) - INC(a0, 2); a := a0+3; j := 0; k := 0; m := 0; - (*WHILE k < NofRuns DO*) - WHILE k < ORD(NofRuns) DO - (*WHILE (m < run[k].beg) & (m < 128) DO F.T[m] := a0; INC(m) END;*) - WHILE (m < ORD(run[k].beg)) & (m < 128) DO F.T[m] := a0; INC(m) END; (* voc adaptation by noch *) - (*WHILE (m < run[k].end) & (m < 128) DO*) (* voc adaptation by noch *) - WHILE (m < ORD(run[k].end)) & (m < 128) DO - F.T[m] := a+3; - SYSTEM.PUT(a, box[j].dx); SYSTEM.PUT(a+1, box[j].x); SYSTEM.PUT(a+2, box[j].y); - SYSTEM.PUT(a+3, box[j].w); SYSTEM.PUT(a+4, box[j].h); INC(a, 5); - (*n := (box[j].w + 7) DIV 8 * box[j].h;*) - n := (ORD(box[j].w) + 7) DIV 8 * ORD(box[j].h); (* voc adaptation by noch *) - WHILE n # 0 DO DEC(n); Files.ReadByte(R, b); SYSTEM.PUT(a, b); INC(a) END ; - INC(j); INC(m) - END; - INC(k) - END; - WHILE m < 128 DO F.T[m] := a0; INC(m) END ; - F.next := root; root := F - ELSE (*bad file id*) F := Default - END - ELSE (*font file not available*) F := Default - END - END; - RETURN F -END This; - -PROCEDURE Free*; (*remove all but first two from font list*) - VAR f: Font; -BEGIN f := root.next; - IF f # NIL THEN f := f.next END ; - f.next := NIL -END Free; - -BEGIN root := NIL; Default := This("Oberon10.Scn.Fnt") -END Fonts. diff --git a/src/voc07R/ORB.Mod b/src/voc07R/ORB.Mod deleted file mode 100644 index 3427bb2e..00000000 --- a/src/voc07R/ORB.Mod +++ /dev/null @@ -1,447 +0,0 @@ -MODULE ORB; (*NW 25.6.2014 in Oberon-07*) - IMPORT Files := CompatFiles (* voc adaptation by noch *) - , ORS; - (*Definition of data types Object and Type, which together form the data structure - called "symbol table". Contains procedures for creation of Objects, and for search: - NewObj, this, thisimport, thisfield (and OpenScope, CloseScope). - Handling of import and export, i.e. reading and writing of "symbol files" is done by procedures - Import and Export. This module contains the list of standard identifiers, with which - the symbol table (universe), and that of the pseudo-module SYSTEM are initialized. *) - - TYPE INTEGER = LONGINT; (* voc adaptation by noch *) - BYTE = CHAR; - - CONST versionkey* = 1; maxTypTab = 64; - (* class values*) Head* = 0; - Const* = 1; Var* = 2; Par* = 3; Fld* = 4; Typ* = 5; - SProc* = 6; SFunc* = 7; Mod* = 8; - - (* form values*) - Byte* = 1; Bool* = 2; Char* = 3; Int* = 4; Real* = 5; Set* = 6; - Pointer* = 7; NilTyp* = 8; NoTyp* = 9; Proc* = 10; - String* = 11; Array* = 12; Record* = 13; - - TYPE Object* = POINTER TO ObjDesc; - Module* = POINTER TO ModDesc; - Type* = POINTER TO TypeDesc; - - ObjDesc*= RECORD - class*, lev*, exno*: INTEGER; - expo*, rdo*: BOOLEAN; (*exported / read-only*) - next*, dsc*: Object; - type*: Type; - name*: ORS.Ident; - val*: LONGINT - END ; - - ModDesc* = RECORD (ObjDesc) orgname*: ORS.Ident END ; - - TypeDesc* = RECORD - form*, ref*, mno*: INTEGER; (*ref is only used for import/export*) - nofpar*: INTEGER; (*for procedures, extension level for records*) - len*: LONGINT; (*for arrays, len < 0 => open array; for records: adr of descriptor*) - dsc*, typobj*: Object; - base*: Type; (*for arrays, records, pointers*) - size*: LONGINT; (*in bytes; always multiple of 4, except for Byte, Bool and Char*) - END ; - - (* Object classes and the meaning of "val": - class val - ---------- - Var address - Par address - Const value - Fld offset - Typ type descriptor (TD) address - SProc inline code number - SFunc inline code number - Mod key - - Type forms and the meaning of "dsc" and "base": - form dsc base - ------------------------ - Pointer - type of dereferenced object - Proc params result type - Array - type of elements - Record fields extension *) - - VAR topScope*, universe, system*: Object; - byteType*, boolType*, charType*: Type; - intType*, realType*, setType*, nilType*, noType*, strType*: Type; - nofmod, Ref: INTEGER; - typtab: ARRAY maxTypTab OF Type; - - PROCEDURE NewObj*(VAR obj: Object; id: ORS.Ident; class: INTEGER); (*insert new Object with name id*) - VAR new, x: Object; - BEGIN x := topScope; - WHILE (x.next # NIL) & (x.next.name # id) DO x := x.next END ; - IF x.next = NIL THEN - NEW(new); new.name := id; new.class := class; new.next := NIL; new.rdo := FALSE; new.dsc := NIL; - x.next := new; obj := new - ELSE obj := x.next; ORS.Mark("mult def") - END - END NewObj; - - PROCEDURE thisObj*(): Object; - VAR s, x: Object; - BEGIN s := topScope; - REPEAT x := s.next; - WHILE (x # NIL) & (x.name # ORS.id) DO x := x.next END ; - s := s.dsc - UNTIL (x # NIL) OR (s = NIL); - RETURN x - END thisObj; - - PROCEDURE thisimport*(mod: Object): Object; - VAR obj: Object; - BEGIN - IF mod.rdo THEN - IF mod.name[0] # 0X THEN - obj := mod.dsc; - WHILE (obj # NIL) & (obj.name # ORS.id) DO obj := obj.next END - ELSE obj := NIL - END - ELSE obj := NIL - END ; - RETURN obj - END thisimport; - - PROCEDURE thisfield*(rec: Type): Object; - VAR fld: Object; - BEGIN fld := rec.dsc; - WHILE (fld # NIL) & (fld.name # ORS.id) DO fld := fld.next END ; - RETURN fld - END thisfield; - - PROCEDURE OpenScope*; - VAR s: Object; - BEGIN NEW(s); s.class := Head; s.dsc := topScope; s.next := NIL; topScope := s - END OpenScope; - - PROCEDURE CloseScope*; - BEGIN topScope := topScope.dsc - END CloseScope; - - (*------------------------------- Import ---------------------------------*) - - PROCEDURE MakeFileName*(VAR FName: ORS.Ident; name, ext: ARRAY OF CHAR); - VAR i, j: INTEGER; - BEGIN i := 0; j := 0; (*assume name suffix less than 4 characters*) - WHILE (i < ORS.IdLen-5) & (name[i] > 0X) DO FName[i] := name[i]; INC(i) END ; - REPEAT FName[i]:= ext[j]; INC(i); INC(j) UNTIL ext[j] = 0X; - FName[i] := 0X - END MakeFileName; - - PROCEDURE ThisModule(name, orgname: ORS.Ident; non: BOOLEAN; key: LONGINT): Object; - VAR mod: Module; obj, obj1: Object; - BEGIN obj1 := topScope; obj := obj1.next; (*search for module*) - WHILE (obj # NIL) & (obj.name # name) DO obj1 := obj; obj := obj1.next END ; - IF obj = NIL THEN (*insert new module*) - NEW(mod); mod.class := Mod; mod.rdo := FALSE; - mod.name := name; mod.orgname := orgname; mod.val := key; - mod.lev := nofmod; INC(nofmod); mod.type := noType; mod.dsc := NIL; mod.next := NIL; - obj1.next := mod; obj := mod - ELSE (*module already present*) - IF non THEN ORS.Mark("invalid import order") END - END ; - RETURN obj - END ThisModule; - - PROCEDURE Read(VAR R: Files.Rider; VAR x: INTEGER); - VAR b: BYTE; - BEGIN Files.ReadByte(R, b); - (*IF b < 80H THEN x := b ELSE x := b - 100H END*) - IF b < 80X THEN x := ORD(b) ELSE x := ORD(b) - 100H END (* voc adaptation by noch *) - END Read; - - PROCEDURE InType(VAR R: Files.Rider; thismod: Object; VAR T: Type); - VAR key: LONGINT; - ref, class, mno, form, np, readonly: INTEGER; - new, fld, par, obj, mod, impmod: Object; - t: Type; - name, modname: ORS.Ident; - BEGIN Read(R, ref); - IF ref < 0 THEN T := typtab[-ref] (*already read*) - ELSE NEW(t); T := t; typtab[ref] := t; t.mno := thismod.lev; - Read(R, form); t.form := form; - IF form = Pointer THEN InType(R, thismod, t.base); t.size := 4 - ELSIF form = Array THEN - InType(R, thismod, t.base); Files.ReadNum(R, t.len); Files.ReadNum(R, t.size) - ELSIF form = Record THEN - InType(R, thismod, t.base); - IF t.base.form = NoTyp THEN t.base := NIL; obj := NIL ELSE obj := t.base.dsc END ; - Files.ReadNum(R, t.len); (*TD adr/exno*) - Files.ReadNum(R, t.nofpar); (*ext level*) - Files.ReadNum(R, t.size); - Read(R, class); - WHILE class # 0 DO (*fields*) - NEW(fld); fld.class := class; Files.ReadString(R, fld.name); - IF fld.name[0] # 0X THEN fld.expo := TRUE; InType(R, thismod, fld.type) ELSE fld.expo := FALSE; fld.type := nilType END ; - Files.ReadNum(R, fld.val); fld.next := obj; obj := fld; Read(R, class) - END ; - t.dsc := obj - ELSIF form = Proc THEN - InType(R, thismod, t.base); - obj := NIL; np := 0; Read(R, class); - WHILE class # 0 DO (*parameters*) - NEW(par); par.class := class; Read(R, readonly); par.rdo := readonly = 1; - InType(R, thismod, par.type); par.next := obj; obj := par; INC(np); Read(R, class) - END ; - t.dsc := obj; t.nofpar := np; t.size := 4 - END ; - Files.ReadString(R, modname); - IF modname[0] # 0X THEN (*re-import*) - Files.ReadInt(R, key); Files.ReadString(R, name); - mod := ThisModule(modname, modname, FALSE, key); - obj := mod.dsc; (*search type*) - WHILE (obj # NIL) & (obj.name # name) DO obj := obj.next END ; - IF obj # NIL THEN T := obj.type (*type object found in object list of mod*) - ELSE (*insert new type object in object list of mod*) - NEW(obj); obj.name := name; obj.class := Typ; obj.next := mod.dsc; mod.dsc := obj; obj.type := t; - t.mno := mod.lev; t.typobj := obj; T := t - END ; - typtab[ref] := T - END - END - END InType; - - PROCEDURE Import*(VAR modid, modid1: ORS.Ident); - VAR key: LONGINT; class, k: INTEGER; - obj: Object; t: Type; - thismod: Object; - modname, fname: ORS.Ident; - F: Files.File; R: Files.Rider; - BEGIN - IF modid1 = "SYSTEM" THEN - thismod := ThisModule(modid, modid1, TRUE, key); DEC(nofmod); - thismod.lev := 0; thismod.dsc := system; thismod.rdo := TRUE - ELSE MakeFileName(fname, modid1, ".smb"); F := Files.Old(fname); - IF F # NIL THEN - Files.Set(R, F, 0); Files.ReadInt(R, key); Files.ReadInt(R, key); Files.ReadString(R, modname); - thismod := ThisModule(modid, modid1, TRUE, key); thismod.rdo := TRUE; - Read(R, class); (*version key*) - IF class # versionkey THEN ORS.Mark("wrong version") END ; - Read(R, class); - WHILE class # 0 DO - NEW(obj); obj.class := class; Files.ReadString(R, obj.name); - InType(R, thismod, obj.type); obj.lev := -thismod.lev; - IF class = Typ THEN - t := obj.type; t.typobj := obj; Read(R, k); (*fixup bases of previously declared pointer types*) - WHILE k # 0 DO typtab[k].base := t; Read(R, k) END - ELSE - IF class = Const THEN - IF obj.type.form = Real THEN Files.ReadInt(R, obj.val) ELSE Files.ReadNum(R, obj.val) END - ELSIF class = Var THEN Files.ReadNum(R, obj.val); obj.rdo := TRUE - END - END ; - obj.next := thismod.dsc; thismod.dsc := obj; Read(R, class) - END ; - ELSE ORS.Mark("import not available") - END - END - END Import; - - (*-------------------------------- Export ---------------------------------*) - - PROCEDURE Write(VAR R: Files.Rider; x: INTEGER); - BEGIN - (*Files.WriteByte(R, x)*) - Files.WriteByte(R, SHORT(SHORT(x))) (* voc adaptation by noch *) - END Write; - - PROCEDURE OutType(VAR R: Files.Rider; t: Type); - VAR obj, mod, fld: Object; - - PROCEDURE OutPar(VAR R: Files.Rider; par: Object; n: INTEGER); - VAR cl: INTEGER; - BEGIN - IF n > 0 THEN - OutPar(R, par.next, n-1); cl := par.class; - Write(R, cl); - IF par.rdo THEN Write(R, 1) ELSE Write(R, 0) END ; - OutType(R, par.type) - END - END OutPar; - - PROCEDURE FindHiddenPointers(VAR R: Files.Rider; typ: Type; offset: LONGINT); - VAR fld: Object; i, n: LONGINT; - BEGIN - IF (typ.form = Pointer) OR (typ.form = NilTyp) THEN Write(R, Fld); Write(R, 0); Files.WriteNum(R, offset) - ELSIF typ.form = Record THEN fld := typ.dsc; - WHILE fld # NIL DO FindHiddenPointers(R, fld.type, fld.val + offset); fld := fld.next END - ELSIF typ.form = Array THEN i := 0; n := typ.len; - WHILE i < n DO FindHiddenPointers(R, typ.base, typ.base.size * i + offset); INC(i) END - END - END FindHiddenPointers; - - BEGIN - IF t.ref > 0 THEN (*type was already output*) Write(R, -t.ref) - ELSE obj := t.typobj; - IF obj # NIL THEN Write(R, Ref); t.ref := Ref; INC(Ref) ELSE (*anonymous*) Write(R, 0) END ; - Write(R, t.form); - IF t.form = Pointer THEN OutType(R, t.base) - ELSIF t.form = Array THEN OutType(R, t.base); Files.WriteNum(R, t.len); Files.WriteNum(R, t.size) - ELSIF t.form = Record THEN - IF t.base # NIL THEN OutType(R, t.base) ELSE OutType(R, noType) END ; - IF obj # NIL THEN Files.WriteNum(R, obj.exno) ELSE Write(R, 0) END ; - Files.WriteNum(R, t.nofpar); Files.WriteNum(R, t.size); - fld := t.dsc; - WHILE fld # NIL DO (*fields*) - IF fld.expo THEN - Write(R, Fld); Files.WriteString(R, fld.name); OutType(R, fld.type); Files.WriteNum(R, fld.val) - ELSE FindHiddenPointers(R, fld.type, fld.val) (*offset*) - END ; - fld := fld.next - END ; - Write(R, 0) - ELSIF t.form = Proc THEN OutType(R, t.base); OutPar(R, t.dsc, t.nofpar); Write(R, 0) - END ; - IF (t.mno > 0) & (obj # NIL) THEN (*re-export, output name*) - mod := topScope.next; - WHILE (mod # NIL) & (mod.lev # t.mno) DO mod := mod.next END ; - IF mod # NIL THEN Files.WriteString(R, mod.name); Files.WriteInt(R, mod.val); Files.WriteString(R, obj.name) - ELSE ORS.Mark("re-export not found"); Write(R, 0) - END - ELSE Write(R, 0) - END - END - END OutType; - - PROCEDURE Export*(VAR modid: ORS.Ident; VAR newSF: BOOLEAN; VAR key: LONGINT); - VAR x, sum, oldkey: LONGINT; - obj, obj0: Object; - filename: ORS.Ident; - F, F1: Files.File; R, R1: Files.Rider; - BEGIN Ref := Record + 1; MakeFileName(filename, modid, ".smb"); - F := Files.New(filename); Files.Set(R, F, 0); - Files.WriteInt(R, 0); (*placeholder*) - Files.WriteInt(R, 0); (*placeholder for key to be inserted at the end*) - Files.WriteString(R, modid); Write(R, versionkey); - obj := topScope.next; - WHILE obj # NIL DO - IF obj.expo THEN - Write(R, obj.class); Files.WriteString(R, obj.name); - OutType(R, obj.type); - IF obj.class = Typ THEN - IF obj.type.form = Record THEN - obj0 := topScope.next; (*check whether this is base of previously declared pointer types*) - WHILE obj0 # obj DO - IF (obj0.type.form = Pointer) & (obj0.type.base = obj.type) & (obj0.type.ref > 0) THEN Write(R, obj0.type.ref) END ; - obj0 := obj0.next - END - END ; - Write(R, 0) - ELSIF obj.class = Const THEN - IF obj.type.form = Proc THEN Files.WriteNum(R, obj.exno) - ELSIF obj.type.form = Real THEN Files.WriteInt(R, obj.val) - ELSE Files.WriteNum(R, obj.val) - END - ELSIF obj.class = Var THEN - Files.WriteNum(R, obj.exno); - IF obj.type.form = String THEN - Files.WriteNum(R, obj.val DIV 10000H); obj.val := obj.val MOD 10000H - END - END - END ; - obj := obj.next - END ; - REPEAT Write(R, 0) UNTIL Files.Length(F) MOD 4 = 0; - FOR Ref := Record+1 TO maxTypTab-1 DO typtab[Ref] := NIL END ; - Files.Set(R, F, 0); sum := 0; Files.ReadInt(R, x); (* compute key (checksum) *) - WHILE ~R.eof DO sum := sum + x; Files.ReadInt(R, x) END ; - F1 := Files.Old(filename); (*sum is new key*) - IF F1 # NIL THEN Files.Set(R1, F1, 4); Files.ReadInt(R1, oldkey) ELSE oldkey := sum+1 END ; - IF sum # oldkey THEN - IF newSF OR (F1 = NIL) THEN - key := sum; newSF := TRUE; Files.Set(R, F, 4); Files.WriteInt(R, sum); Files.Register(F) (*insert checksum*) - ELSE ORS.Mark("new symbol file inhibited") - END - ELSE newSF := FALSE; key := sum - END - END Export; - - PROCEDURE Init*; - BEGIN topScope := universe; nofmod := 1 - END Init; - - PROCEDURE type(ref, form: INTEGER; size: LONGINT): Type; - VAR tp: Type; - BEGIN NEW(tp); tp.form := form; tp.size := size; tp.ref := ref; tp.base := NIL; - typtab[ref] := tp; RETURN tp - END type; - - PROCEDURE enter(name: ARRAY OF CHAR; cl: INTEGER; type: Type; n: LONGINT); - VAR obj: Object; - BEGIN - NEW(obj); - (*obj.name := name; *) - COPY(name, obj.name); (* voc adaptation by noch *) - obj.class := cl; - obj.type := type; - obj.val := n; - obj.dsc := NIL; - IF cl = Typ THEN type.typobj := obj END ; - obj.next := system; system := obj - END enter; - -BEGIN - byteType := type(Byte, Int, 1); - boolType := type(Bool, Bool, 1); - charType := type(Char, Char,1); - intType := type(Int, Int, 4); - realType := type(Real, Real, 4); - setType := type(Set, Set,4); - nilType := type(NilTyp, NilTyp, 4); - noType := type(NoTyp, NoTyp, 4); - strType := type(String, String, 8); - - (*initialize universe with data types and in-line procedures; - LONGINT is synonym to INTEGER, LONGREAL to REAL. - LED, ADC, SBC; LDPSR, LDREG, REG, COND are not in language definition*) - system := NIL; (*n = procno*10 + nofpar*) - enter("UML", SFunc, intType, 132); (*functions*) - enter("SBC", SFunc, intType, 122); - enter("ADC", SFunc, intType, 112); - enter("ROR", SFunc, intType, 92); - enter("ASR", SFunc, intType, 82); - enter("LSL", SFunc, intType, 72); - enter("LEN", SFunc, intType, 61); - enter("CHR", SFunc, charType, 51); - enter("ORD", SFunc, intType, 41); - enter("FLT", SFunc, realType, 31); - enter("FLOOR", SFunc, intType, 21); - enter("ODD", SFunc, boolType, 11); - enter("ABS", SFunc, intType, 1); - enter("LED", SProc, noType, 81); (*procedures*) - enter("UNPK", SProc, noType, 72); - enter("PACK", SProc, noType, 62); - enter("NEW", SProc, noType, 51); - enter("ASSERT", SProc, noType, 41); - enter("EXCL", SProc, noType, 32); - enter("INCL", SProc, noType, 22); - enter("DEC", SProc, noType, 11); - enter("INC", SProc, noType, 1); - enter("SET", Typ, setType, 0); (*types*) - enter("BOOLEAN", Typ, boolType, 0); - enter("BYTE", Typ, byteType, 0); - enter("CHAR", Typ, charType, 0); - enter("LONGREAL", Typ, realType, 0); - enter("REAL", Typ, realType, 0); - enter("LONGINT", Typ, intType, 0); - enter("INTEGER", Typ, intType, 0); - topScope := NIL; OpenScope; topScope.next := system; universe := topScope; - - system := NIL; (* initialize "unsafe" pseudo-module SYSTEM*) - enter("H", SFunc, intType, 201); (*functions*) - enter("COND", SFunc, boolType, 191); - enter("SIZE", SFunc, intType, 181); - enter("ADR", SFunc, intType, 171); - enter("VAL", SFunc, intType, 162); - enter("REG", SFunc, intType, 151); - enter("BIT", SFunc, boolType, 142); - enter("LDREG", SProc, noType, 142); (*procedures*) - enter("LDPSR", SProc, noType, 131); - enter("COPY", SProc, noType, 123); - enter("PUT", SProc, noType, 112); - enter("GET", SProc, noType, 102); -END ORB. diff --git a/src/voc07R/ORG.Mod b/src/voc07R/ORG.Mod deleted file mode 100644 index fef42932..00000000 --- a/src/voc07R/ORG.Mod +++ /dev/null @@ -1,1134 +0,0 @@ -MODULE ORG; (* NW 24.6.2014 code generator in Oberon-07 for RISC*) - IMPORT SYSTEM, Files := CompatFiles, ORS, ORB; - (*Code generator for Oberon compiler for RISC processor. - Procedural interface to Parser OSAP; result in array "code". - Procedure Close writes code-files*) - - (* voc adaptation by noch *) - TYPE INTEGER = LONGINT; - BYTE = CHAR; - - CONST WordSize* = 4; - StkOrg0 = -64; VarOrg0 = 0; (*for RISC-0 only*) - MT = 12; SB = 13; SP = 14; LNK = 15; (*dedicated registers*) - maxCode = 8000; maxStrx = 2400; maxTD = 120; C24 = 1000000H; - Reg = 10; RegI = 11; Cond = 12; (*internal item modes*) - - (*frequently used opcodes*) U = 2000H; V = 1000H; - Mov = 0; Lsl = 1; Asr = 2; Ror= 3; And = 4; Ann = 5; Ior = 6; Xor = 7; - Add = 8; Sub = 9; Cmp = 9; Mul = 10; Div = 11; - Fad = 12; Fsb = 13; Fml = 14; Fdv = 15; - Ldr = 8; Str = 10; - BR = 0; BLR = 1; BC = 2; BL = 3; - MI = 0; PL = 8; EQ = 1; NE = 9; LT = 5; GE = 13; LE = 6; GT = 14; - - TYPE Item* = RECORD - mode*: INTEGER; - type*: ORB.Type; - a*, b*, r: LONGINT; - rdo*: BOOLEAN (*read only*) - END ; - - (* Item forms and meaning of fields: - mode r a b - -------------------------------- - Const - value (proc adr) (immediate value) - Var base off - (direct adr) - Par - off0 off1 (indirect adr) - Reg regno - RegI regno off - - Cond cond Fchain Tchain *) - - VAR pc*, varsize: LONGINT; (*program counter, data index*) - tdx, strx: LONGINT; - entry: LONGINT; (*main entry point*) - RH: LONGINT; (*available registers R[0] ... R[H-1]*) - curSB: LONGINT; (*current static base in SB*) - frame: LONGINT; (*frame offset changed in SaveRegs and RestoreRegs*) - fixorgP, fixorgD, fixorgT: LONGINT; (*origins of lists of locations to be fixed up by loader*) - check: BOOLEAN; (*emit run-time checks*) - version: INTEGER; (* 0 = RISC-0, 1 = RISC-5 *) - - relmap: ARRAY 6 OF INTEGER; (*condition codes for relations*) - code: ARRAY maxCode OF LONGINT; - data: ARRAY maxTD OF LONGINT; (*type descriptors*) - str: ARRAY maxStrx OF CHAR; - - (* voc adaptation by noch *) - PROCEDURE LSL (x, n : INTEGER): INTEGER; - - BEGIN - - RETURN ASH(x, n); - END LSL; - - - (*instruction assemblers according to formats*) - - PROCEDURE Put0(op, a, b, c: LONGINT); - BEGIN (*emit format-0 instruction*) - code[pc] := ((a*10H + b) * 10H + op) * 10000H + c; INC(pc) - END Put0; - - PROCEDURE Put1(op, a, b, im: LONGINT); - BEGIN (*emit format-1 instruction, -10000H <= im < 10000H*) - IF im < 0 THEN INC(op, V) END ; - code[pc] := (((a+40H) * 10H + b) * 10H + op) * 10000H + (im MOD 10000H); INC(pc) - END Put1; - - PROCEDURE Put1a(op, a, b, im: LONGINT); - BEGIN (*same as Pu1, but with range test -10000H <= im < 10000H*) - IF (im >= -10000H) & (im <= 0FFFFH) THEN Put1(op, a, b, im) - ELSE Put1(Mov+U, RH, 0, im DIV 10000H); - IF im MOD 10000H # 0 THEN Put1(Ior, RH, RH, im MOD 10000H) END ; - Put0(op, a, b, RH) - END - END Put1a; - - PROCEDURE Put2(op, a, b, off: LONGINT); - BEGIN (*emit load/store instruction*) - code[pc] := ((op * 10H + a) * 10H + b) * 100000H + (off MOD 100000H); INC(pc) - END Put2; - - PROCEDURE Put3(op, cond, off: LONGINT); - BEGIN (*emit branch instruction*) - code[pc] := ((op+12) * 10H + cond) * 1000000H + (off MOD 1000000H); INC(pc) - END Put3; - - PROCEDURE incR; - BEGIN - IF RH < MT-1 THEN INC(RH) ELSE ORS.Mark("register stack overflow") END - END incR; - - PROCEDURE CheckRegs*; - BEGIN - IF RH # 0 THEN ORS.Mark("Reg Stack"); RH := 0 END ; - IF pc >= maxCode - 40 THEN ORS.Mark("Program too long") END - END CheckRegs; - - PROCEDURE SetCC(VAR x: Item; n: LONGINT); - BEGIN x.mode := Cond; x.a := 0; x.b := 0; x.r := n - END SetCC; - - PROCEDURE Trap(cond, num: LONGINT); - BEGIN num := ORS.Pos()*100H + num*10H + MT; Put3(BLR, cond, num) - END Trap; - - (*handling of forward reference, fixups of branch addresses and constant tables*) - - PROCEDURE negated(cond: LONGINT): LONGINT; - BEGIN - IF cond < 8 THEN cond := cond+8 ELSE cond := cond-8 END ; - RETURN cond - END negated; - - PROCEDURE invalSB; - BEGIN curSB := 1 - END invalSB; - - PROCEDURE fix(at, with: LONGINT); - BEGIN code[at] := code[at] DIV C24 * C24 + (with MOD C24) - END fix; - - PROCEDURE FixLink*(L: LONGINT); - VAR L1: LONGINT; - BEGIN invalSB; - WHILE L # 0 DO L1 := code[L] MOD 40000H; fix(L, pc-L-1); L := L1 END - END FixLink; - - PROCEDURE FixLinkWith(L0, dst: LONGINT); - VAR L1: LONGINT; - BEGIN - WHILE L0 # 0 DO - L1 := code[L0] MOD C24; - code[L0] := code[L0] DIV C24 * C24 + ((dst - L0 - 1) MOD C24); L0 := L1 - END - END FixLinkWith; - - PROCEDURE merged(L0, L1: LONGINT): LONGINT; - VAR L2, L3: LONGINT; - BEGIN - IF L0 # 0 THEN L3 := L0; - REPEAT L2 := L3; L3 := code[L2] MOD 40000H UNTIL L3 = 0; - code[L2] := code[L2] + L1; L1 := L0 - END ; - RETURN L1 - END merged; - - (* loading of operands and addresses into registers *) - - PROCEDURE GetSB(base: LONGINT); - BEGIN - IF (version # 0) & ((base # curSB) OR (base # 0)) THEN - Put2(Ldr, SB, -base, pc-fixorgD); fixorgD := pc-1; curSB := base - END - END GetSB; - - PROCEDURE NilCheck; - BEGIN IF check THEN Trap(EQ, 4) END - END NilCheck; - - PROCEDURE load(VAR x: Item); - VAR op: LONGINT; - BEGIN - IF x.type.size = 1 THEN op := Ldr+1 ELSE op := Ldr END ; - IF x.mode # Reg THEN - IF x.mode = ORB.Const THEN - IF x.type.form = ORB.Proc THEN - IF x.r > 0 THEN ORS.Mark("not allowed") - ELSIF x.r = 0 THEN Put3(BL, 7, 0); Put1a(Sub, RH, LNK, pc*4 - x.a) - ELSE GetSB(x.r); Put1(Add, RH, SB, x.a + 100H) (*mark as progbase-relative*) - END - ELSIF (x.a <= 0FFFFH) & (x.a >= -10000H) THEN Put1(Mov, RH, 0, x.a) - ELSE Put1(Mov+U, RH, 0, x.a DIV 10000H MOD 10000H); - IF x.a MOD 10000H # 0 THEN Put1(Ior, RH, RH, x.a MOD 10000H) END - END ; - x.r := RH; incR - ELSIF x.mode = ORB.Var THEN - IF x.r > 0 THEN (*local*) Put2(op, RH, SP, x.a + frame) - ELSE GetSB(x.r); Put2(op, RH, SB, x.a) - END ; - x.r := RH; incR - ELSIF x.mode = ORB.Par THEN Put2(Ldr, RH, SP, x.a + frame); Put2(op, RH, RH, x.b); x.r := RH; incR - ELSIF x.mode = RegI THEN Put2(op, x.r, x.r, x.a) - ELSIF x.mode = Cond THEN - Put3(BC, negated(x.r), 2); - FixLink(x.b); Put1(Mov, RH, 0, 1); Put3(BC, 7, 1); - FixLink(x.a); Put1(Mov, RH, 0, 0); x.r := RH; incR - END ; - x.mode := Reg - END - END load; - - PROCEDURE loadAdr(VAR x: Item); - BEGIN - IF x.mode = ORB.Var THEN - IF x.r > 0 THEN (*local*) Put1a(Add, RH, SP, x.a + frame) - ELSE GetSB(x.r); Put1a(Add, RH, SB, x.a) - END ; - x.r := RH; incR - ELSIF x.mode = ORB.Par THEN Put2(Ldr, RH, SP, x.a + frame); - IF x.b # 0 THEN Put1a(Add, RH, RH, x.b) END ; - x.r := RH; incR - ELSIF x.mode = RegI THEN - IF x.a # 0 THEN Put1a(Add, x.r, x.r, x.a) END - ELSE ORS.Mark("address error") - END ; - x.mode := Reg - END loadAdr; - - PROCEDURE loadCond(VAR x: Item); - BEGIN - IF x.type.form = ORB.Bool THEN - IF x.mode = ORB.Const THEN x.r := 15 - x.a*8 - ELSE load(x); - IF code[pc-1] DIV 40000000H # -2 THEN Put1(Cmp, x.r, x.r, 0) END ; - x.r := NE; DEC(RH) - END ; - x.mode := Cond; x.a := 0; x.b := 0 - ELSE ORS.Mark("not Boolean?") - END - END loadCond; - - PROCEDURE loadTypTagAdr(T: ORB.Type); - VAR x: Item; - BEGIN x.mode := ORB.Var; x.a := T.len; x.r := -T.mno; loadAdr(x) - END loadTypTagAdr; - - PROCEDURE loadStringAdr(VAR x: Item); - BEGIN GetSB(0); Put1a(Add, RH, SB, varsize+x.a); x.mode := Reg; x.r := RH; incR - END loadStringAdr; - - (* Items: Conversion from constants or from Objects on the Heap to Items on the Stack*) - - PROCEDURE MakeConstItem*(VAR x: Item; typ: ORB.Type; val: LONGINT); - BEGIN x.mode := ORB.Const; x.type := typ; x.a := val - END MakeConstItem; - - PROCEDURE MakeRealItem*(VAR x: Item; val: REAL); - BEGIN x.mode := ORB.Const; x.type := ORB.realType; x.a := SYSTEM.VAL(LONGINT, val) - END MakeRealItem; - - PROCEDURE MakeStringItem*(VAR x: Item; len: LONGINT); (*copies string from ORS-buffer to ORG-string array*) - VAR i: LONGINT; - BEGIN x.mode := ORB.Const; x.type := ORB.strType; x.a := strx; x.b := len; i := 0; - IF strx + len + 4 < maxStrx THEN - WHILE len > 0 DO str[strx] := ORS.str[i]; INC(strx); INC(i); DEC(len) END ; - WHILE strx MOD 4 # 0 DO str[strx] := 0X; INC(strx) END - ELSE ORS.Mark("too many strings") - END - END MakeStringItem; - - PROCEDURE MakeItem*(VAR x: Item; y: ORB.Object; curlev: LONGINT); - BEGIN x.mode := y.class; x.type := y.type; x.a := y.val; x.rdo := y.rdo; - IF y.class = ORB.Par THEN x.b := 0 - ELSIF y.class = ORB.Typ THEN x.a := y.type.len; x.r := -y.lev - ELSIF (y.class = ORB.Const) & (y.type.form = ORB.String) THEN x.b := y.lev (*len*) - ELSE x.r := y.lev - END ; - IF (y.lev > 0) & (y.lev # curlev) & (y.class # ORB.Const) THEN ORS.Mark("level error, not accessible") END - END MakeItem; - - (* Code generation for Selectors, Variables, Constants *) - - PROCEDURE Field*(VAR x: Item; y: ORB.Object); (* x := x.y *) - BEGIN; - IF x.mode = ORB.Var THEN - IF x.r >= 0 THEN x.a := x.a + y.val - ELSE loadAdr(x); x.mode := RegI; x.a := y.val - END - ELSIF x.mode = RegI THEN x.a := x.a + y.val - ELSIF x.mode = ORB.Par THEN x.b := x.b + y.val - END - END Field; - - PROCEDURE Index*(VAR x, y: Item); (* x := x[y] *) - VAR s, lim: LONGINT; - BEGIN s := x.type.base.size; lim := x.type.len; - IF (y.mode = ORB.Const) & (lim >= 0) THEN - IF (y.a < 0) OR (y.a >= lim) THEN ORS.Mark("bad index") END ; - IF x.mode IN {ORB.Var, RegI} THEN x.a := y.a * s + x.a - ELSIF x.mode = ORB.Par THEN x.b := y.a * s + x.b - END - ELSE load(y); - IF check THEN (*check array bounds*) - IF lim >= 0 THEN Put1a(Cmp, RH, y.r, lim) - ELSE (*open array*) - IF x.mode IN {ORB.Var, ORB.Par} THEN Put2(Ldr, RH, SP, x.a+4+frame); Put0(Cmp, RH, y.r, RH) - ELSE ORS.Mark("error in Index") - END - END ; - Trap(10, 1) (*BCC*) - END ; - IF s = 4 THEN Put1(Lsl, y.r, y.r, 2) ELSIF s > 1 THEN Put1a(Mul, y.r, y.r, s) END ; - IF x.mode = ORB.Var THEN - IF x.r > 0 THEN Put0(Add, y.r, SP, y.r); INC(x.a, frame) - ELSE GetSB(x.r); - IF x.r = 0 THEN Put0(Add, y.r, SB, y.r) - ELSE Put1a(Add, RH, SB, x.a); Put0(Add, y.r, RH, y.r); x.a := 0 - END - END ; - x.r := y.r; x.mode := RegI - ELSIF x.mode = ORB.Par THEN - Put2(Ldr, RH, SP, x.a + frame); - Put0(Add, y.r, RH, y.r); x.mode := RegI; x.r := y.r; x.a := x.b - ELSIF x.mode = RegI THEN Put0(Add, x.r, x.r, y.r); DEC(RH) - END - END - END Index; - - PROCEDURE DeRef*(VAR x: Item); - BEGIN - IF x.mode = ORB.Var THEN - IF x.r > 0 THEN (*local*) Put2(Ldr, RH, SP, x.a + frame) ELSE GetSB(x.r); Put2(Ldr, RH, SB, x.a) END ; - NilCheck; x.r := RH; incR - ELSIF x.mode = ORB.Par THEN - Put2(Ldr, RH, SP, x.a + frame); Put2(Ldr, RH, RH, x.b); NilCheck; x.r := RH; incR - ELSIF x.mode = RegI THEN Put2(Ldr, x.r, x.r, x.a); NilCheck - ELSIF x.mode # Reg THEN ORS.Mark("bad mode in DeRef") - END ; - x.mode := RegI; x.a := 0; x.b := 0 - END DeRef; - - PROCEDURE Q(T: ORB.Type; VAR dcw: LONGINT); - BEGIN (*one entry of type descriptor extension table*) - IF T.base # NIL THEN - Q(T.base, dcw); data[dcw] := (T.mno*1000H + T.len) * 1000H + dcw - fixorgT; - fixorgT := dcw; INC(dcw) - END - END Q; - - PROCEDURE FindPtrFlds(typ: ORB.Type; off: LONGINT; VAR dcw: LONGINT); - VAR fld: ORB.Object; i, s: LONGINT; - BEGIN - IF (typ.form = ORB.Pointer) OR (typ.form = ORB.NilTyp) THEN data[dcw] := off; INC(dcw) - ELSIF typ.form = ORB.Record THEN - fld := typ.dsc; - WHILE fld # NIL DO FindPtrFlds(fld.type, fld.val + off, dcw); fld := fld.next END - ELSIF typ.form = ORB.Array THEN - s := typ.base.size; - FOR i := 0 TO typ.len-1 DO FindPtrFlds(typ.base, i*s + off, dcw) END - END - END FindPtrFlds; - - PROCEDURE BuildTD*(T: ORB.Type; VAR dc: LONGINT); - VAR dcw, k, s: LONGINT; (*dcw = word address*) - BEGIN dcw := dc DIV 4; s := T.size; (*convert size for heap allocation*) - IF s <= 24 THEN s := 32 ELSIF s <= 56 THEN s := 64 ELSIF s <= 120 THEN s := 128 - ELSE s := (s+263) DIV 256 * 256 - END ; - T.len := dc; data[dcw] := s; INC(dcw); - k := T.nofpar; (*extension level!*) - IF k > 3 THEN ORS.Mark("ext level too large") - ELSE Q(T, dcw); - WHILE k < 3 DO data[dcw] := -1; INC(dcw); INC(k) END - END ; - FindPtrFlds(T, 0, dcw); data[dcw] := -1; INC(dcw); tdx := dcw; dc := dcw*4; - IF tdx >= maxTD THEN ORS.Mark("too many record types"); tdx := 0 END - END BuildTD; - - PROCEDURE TypeTest*(VAR x: Item; T: ORB.Type; varpar, isguard: BOOLEAN); - VAR pc0: LONGINT; - BEGIN (*fetch tag into RH*) - IF varpar THEN Put2(Ldr, RH, SP, x.a+4+frame) - ELSE load(x); - pc0 := pc; Put3(BC, EQ, 0); (*NIL belongs to every pointer type*) - Put2(Ldr, RH, x.r, -8) - END ; - Put2(Ldr, RH, RH, T.nofpar*4); incR; - loadTypTagAdr(T); (*tag of T*) - Put0(Cmp, RH-1, RH-1, RH-2); DEC(RH, 2); - IF ~varpar THEN fix(pc0, pc - pc0 - 1) END ; - IF isguard THEN - IF check THEN Trap(NE, 2) END - ELSE SetCC(x, EQ); - IF ~varpar THEN DEC(RH) END - END - END TypeTest; - - (* Code generation for Boolean operators *) - - PROCEDURE Not*(VAR x: Item); (* x := ~x *) - VAR t: LONGINT; - BEGIN - IF x.mode # Cond THEN loadCond(x) END ; - x.r := negated(x.r); t := x.a; x.a := x.b; x.b := t - END Not; - - PROCEDURE And1*(VAR x: Item); (* x := x & *) - BEGIN - IF x.mode # Cond THEN loadCond(x) END ; - Put3(BC, negated(x.r), x.a); x.a := pc-1; FixLink(x.b); x.b := 0 - END And1; - - PROCEDURE And2*(VAR x, y: Item); - BEGIN - IF y.mode # Cond THEN loadCond(y) END ; - x.a := merged(y.a, x.a); x.b := y.b; x.r := y.r - END And2; - - PROCEDURE Or1*(VAR x: Item); (* x := x OR *) - BEGIN - IF x.mode # Cond THEN loadCond(x) END ; - Put3(BC, x.r, x.b); x.b := pc-1; FixLink(x.a); x.a := 0 - END Or1; - - PROCEDURE Or2*(VAR x, y: Item); - BEGIN - IF y.mode # Cond THEN loadCond(y) END ; - x.a := y.a; x.b := merged(y.b, x.b); x.r := y.r - END Or2; - - (* Code generation for arithmetic operators *) - - PROCEDURE Neg*(VAR x: Item); (* x := -x *) - BEGIN - IF x.type.form = ORB.Int THEN - IF x.mode = ORB.Const THEN x.a := -x.a - ELSE load(x); Put1(Mov, RH, 0, 0); Put0(Sub, x.r, RH, x.r) - END - ELSIF x.type.form = ORB.Real THEN - IF x.mode = ORB.Const THEN x.a := x.a + 7FFFFFFFH + 1 - ELSE load(x); Put1(Mov, RH, 0, 0); Put0(Fsb, x.r, RH, x.r) - END - ELSE (*form = Set*) - IF x.mode = ORB.Const THEN x.a := -x.a-1 - ELSE load(x); Put1(Xor, x.r, x.r, -1) - END - END - END Neg; - - PROCEDURE AddOp*(op: LONGINT; VAR x, y: Item); (* x := x +- y *) - BEGIN - IF op = ORS.plus THEN - IF (x.mode = ORB.Const) & (y.mode = ORB.Const) THEN x.a := x.a + y.a - ELSIF y.mode = ORB.Const THEN load(x); - IF y.a # 0 THEN Put1a(Add, x.r, x.r, y.a) END - ELSE load(x); load(y); Put0(Add, RH-2, x.r, y.r); DEC(RH); x.r := RH-1 - END - ELSE (*op = ORS.minus*) - IF (x.mode = ORB.Const) & (y.mode = ORB.Const) THEN x.a := x.a - y.a - ELSIF y.mode = ORB.Const THEN load(x); - IF y.a # 0 THEN Put1a(Sub, x.r, x.r, y.a) END - ELSE load(x); load(y); Put0(Sub, RH-2, x.r, y.r); DEC(RH); x.r := RH-1 - END - END - END AddOp; - - PROCEDURE log2(m: LONGINT; VAR e: LONGINT): LONGINT; - BEGIN e := 0; - WHILE ~ODD(m) DO m := m DIV 2; INC(e) END ; - RETURN m - END log2; - - PROCEDURE MulOp*(VAR x, y: Item); (* x := x * y *) - VAR e: LONGINT; - BEGIN - IF (x.mode = ORB.Const) & (y.mode = ORB.Const) THEN x.a := x.a * y.a - ELSIF (y.mode = ORB.Const) & (y.a >= 2) & (log2(y.a, e) = 1) THEN load(x); Put1(Lsl, x.r, x.r, e) - ELSIF y.mode = ORB.Const THEN load(x); Put1a(Mul, x.r, x.r, y.a) - ELSIF (x.mode = ORB.Const) & (x.a >= 2) & (log2(x.a, e) = 1) THEN load(y); Put1(Lsl, y.r, y.r, e); x.mode := Reg; x.r := y.r - ELSIF x.mode = ORB.Const THEN load(y); Put1a(Mul, y.r, y.r, x.a); x.mode := Reg; x.r := y.r - ELSE load(x); load(y); Put0(Mul, RH-2, x.r, y.r); DEC(RH); x.r := RH-1 - END - END MulOp; - - PROCEDURE DivOp*(op: LONGINT; VAR x, y: Item); (* x := x op y *) - VAR e: LONGINT; - BEGIN - IF op = ORS.div THEN - IF (x.mode = ORB.Const) & (y.mode = ORB.Const) THEN - IF y.a > 0 THEN x.a := x.a DIV y.a ELSE ORS.Mark("bad divisor") END - ELSIF (y.mode = ORB.Const) & (y.a >= 2) & (log2(y.a, e) = 1) THEN load(x); Put1(Asr, x.r, x.r, e) - ELSIF y.mode = ORB.Const THEN - IF y.a > 0 THEN load(x); Put1a(Div, x.r, x.r, y.a) ELSE ORS.Mark("bad divisor") END - ELSE load(y); - IF check THEN Trap(LE, 6) END ; - load(x); Put0(Div, RH-2, x.r, y.r); DEC(RH); x.r := RH-1 - END - ELSE (*op = ORS.mod*) - IF (x.mode = ORB.Const) & (y.mode = ORB.Const) THEN - IF y.a > 0 THEN x.a := x.a MOD y.a ELSE ORS.Mark("bad modulus") END - ELSIF (y.mode = ORB.Const) & (y.a >= 2) & (log2(y.a, e) = 1) THEN load(x); - IF e <= 16 THEN Put1(And, x.r, x.r, y.a-1) ELSE Put1(Lsl, x.r, x.r, 32-e); Put1(Ror, x.r, x.r, 32-e) END - ELSIF y.mode = ORB.Const THEN - IF y.a > 0 THEN load(x); Put1a(Div, x.r, x.r, y.a); Put0(Mov+U, x.r, 0, 0) ELSE ORS.Mark("bad modulus") END - ELSE load(y); - IF check THEN Trap(LE, 6) END ; - load(x); Put0(Div, RH-2, x.r, y.r); Put0(Mov+U, RH-2, 0, 0); DEC(RH); x.r := RH-1 - END - END - END DivOp; - - (* Code generation for REAL operators *) - - PROCEDURE RealOp*(op: INTEGER; VAR x, y: Item); (* x := x op y *) - BEGIN load(x); load(y); - IF op = ORS.plus THEN Put0(Fad, RH-2, x.r, y.r) - ELSIF op = ORS.minus THEN Put0(Fsb, RH-2, x.r, y.r) - ELSIF op = ORS.times THEN Put0(Fml, RH-2, x.r, y.r) - ELSIF op = ORS.rdiv THEN Put0(Fdv, RH-2, x.r, y.r) - END ; - DEC(RH); x.r := RH-1 - END RealOp; - - (* Code generation for set operators *) - - PROCEDURE Singleton*(VAR x: Item); (* x := {x} *) - BEGIN - IF x.mode = ORB.Const THEN - x.a := LSL(1, x.a) - ELSE load(x); Put1(Mov, RH, 0, 1); Put0(Lsl, x.r, RH, x.r) - END - END Singleton; - - PROCEDURE Set*(VAR x, y: Item); (* x := {x .. y} *) - BEGIN - IF (x.mode = ORB.Const) & ( y.mode = ORB.Const) THEN - IF x.a <= y.a THEN x.a := LSL(2, y.a) - LSL(1, x.a) ELSE x.a := 0 END - ELSE - IF (x.mode = ORB.Const) & (x.a < 16) THEN x.a := LSL(-1, x.a) - ELSE load(x); Put1(Mov, RH, 0, -1); Put0(Lsl, x.r, RH, x.r) - END ; - IF (y.mode = ORB.Const) & (y.a < 16) THEN Put1(Mov, RH, 0, LSL(-2, y.a)); y.mode := Reg; y.r := RH; incR - ELSE load(y); Put1(Mov, RH, 0, -2); Put0(Lsl, y.r, RH, y.r) - END ; - IF x.mode = ORB.Const THEN - IF x.a # 0 THEN Put1(Xor, y.r, y.r, -1); Put1a(And, RH-1, y.r, x.a) END ; - x.mode := Reg; x.r := RH-1 - ELSE DEC(RH); Put0(Ann, RH-1, x.r, y.r) - END - END - END Set; - - PROCEDURE In*(VAR x, y: Item); (* x := x IN y *) - BEGIN load(y); - IF x.mode = ORB.Const THEN Put1(Ror, y.r, y.r, (x.a + 1) MOD 20H); DEC(RH) - ELSE load(x); Put1(Add, x.r, x.r, 1); Put0(Ror, y.r, y.r, x.r); DEC(RH, 2) - END ; - SetCC(x, MI) - END In; - - PROCEDURE SetOp*(op: LONGINT; VAR x, y: Item); (* x := x op y *) - VAR xset, yset: SET; (*x.type.form = Set*) - BEGIN - IF (x.mode = ORB.Const) & (y.mode = ORB.Const) THEN - xset := SYSTEM.VAL(SET, x.a); yset := SYSTEM.VAL(SET, y.a); - IF op = ORS.plus THEN xset := xset + yset - ELSIF op = ORS.minus THEN xset := xset - yset - ELSIF op = ORS.times THEN xset := xset * yset - ELSIF op = ORS.rdiv THEN xset := xset / yset - END ; - x.a := SYSTEM.VAL(LONGINT, xset) - ELSIF y.mode = ORB.Const THEN - load(x); - IF op = ORS.plus THEN Put1a(Ior, x.r, x.r, y.a) - ELSIF op = ORS.minus THEN Put1a(Ann, x.r, x.r, y.a) - ELSIF op = ORS.times THEN Put1a(And, x.r, x.r, y.a) - ELSIF op = ORS.rdiv THEN Put1a(Xor, x.r, x.r, y.a) - END ; - ELSE load(x); load(y); - IF op = ORS.plus THEN Put0(Ior, RH-2, x.r, y.r) - ELSIF op = ORS.minus THEN Put0(Ann, RH-2, x.r, y.r) - ELSIF op = ORS.times THEN Put0(And, RH-2, x.r, y.r) - ELSIF op = ORS.rdiv THEN Put0(Xor, RH-2, x.r, y.r) - END ; - DEC(RH); x.r := RH-1 - END - END SetOp; - - (* Code generation for relations *) - - PROCEDURE IntRelation*(op: INTEGER; VAR x, y: Item); (* x := x < y *) - BEGIN - IF (y.mode = ORB.Const) & (y.type.form # ORB.Proc) THEN - load(x); - IF (y.a # 0) OR ~(op IN {ORS.eql, ORS.neq}) OR (code[pc-1] DIV 40000000H # -2) THEN Put1a(Cmp, x.r, x.r, y.a) END ; - DEC(RH) - ELSE load(x); load(y); Put0(Cmp, x.r, x.r, y.r); DEC(RH, 2) - END ; - SetCC(x, relmap[op - ORS.eql]) - END IntRelation; - - PROCEDURE SetRelation*(op: INTEGER; VAR x, y: Item); (* x := x < y *) - BEGIN load(x); - IF (op = ORS.eql) OR (op = ORS.neq) THEN - IF y.mode = ORB.Const THEN Put1a(Cmp, x.r, x.r, y.a); DEC(RH) - ELSE load(y); Put0(Cmp, x.r, x.r, y.r); DEC(RH, 2) - END ; - SetCC(x, relmap[op - ORS.eql]) - ELSE ORS.Mark("illegal relation") - END - END SetRelation; - - PROCEDURE RealRelation*(op: INTEGER; VAR x, y: Item); (* x := x < y *) - BEGIN load(x); - IF (y.mode = ORB.Const) & (y.a = 0) THEN DEC(RH) - ELSE load(y); Put0(Fsb, x.r, x.r, y.r); DEC(RH, 2) - END ; - SetCC(x, relmap[op - ORS.eql]) - END RealRelation; - - PROCEDURE StringRelation*(op: INTEGER; VAR x, y: Item); (* x := x < y *) - (*x, y are char arrays or strings*) - BEGIN - IF x.type.form = ORB.String THEN loadStringAdr(x) ELSE loadAdr(x) END ; - IF y.type.form = ORB.String THEN loadStringAdr(y) ELSE loadAdr(y) END ; - Put2(Ldr+1, RH, x.r, 0); Put1(Add, x.r, x.r, 1); - Put2(Ldr+1, RH+1, y.r, 0); Put1(Add, y.r, y.r, 1); - Put0(Cmp, RH+2, RH, RH+1); Put3(BC, NE, 2); - Put1(Cmp, RH+2, RH, 0); Put3(BC, NE, -8); - DEC(RH, 2); SetCC(x, relmap[op - ORS.eql]) - END StringRelation; - - (* Code generation of Assignments *) - - PROCEDURE StrToChar*(VAR x: Item); - BEGIN x.type := ORB.charType; DEC(strx, 4); x.a := ORD(str[x.a]) - END StrToChar; - - PROCEDURE Store*(VAR x, y: Item); (* x := y *) - VAR op: LONGINT; - BEGIN load(y); - IF x.type.size = 1 THEN op := Str+1 ELSE op := Str END ; - IF x.mode = ORB.Var THEN - IF x.r > 0 THEN (*local*) Put2(op, y.r, SP, x.a + frame) - ELSE GetSB(x.r); Put2(op, y.r, SB, x.a) - END - ELSIF x.mode = ORB.Par THEN Put2(Ldr, RH, SP, x.a + frame); Put2(op, y.r, RH, x.b); - ELSIF x.mode = RegI THEN Put2(op, y.r, x.r, x.a); DEC(RH); - ELSE ORS.Mark("bad mode in Store") - END ; - DEC(RH) - END Store; - - PROCEDURE StoreStruct*(VAR x, y: Item); (* x := y, frame = 0 *) - VAR s, pc0: LONGINT; - BEGIN loadAdr(x); loadAdr(y); - IF (x.type.form = ORB.Array) & (x.type.len > 0) THEN - IF y.type.len >= 0 THEN - IF x.type.len >= y.type.len THEN Put1a(Mov, RH, 0, (y.type.size+3) DIV 4) - ELSE ORS.Mark("source array too long") - END - ELSE (*y is open array*) - Put2(Ldr, RH, SP, y.a+4); s := y.type.base.size; (*element size*) - pc0 := pc; Put3(BC, EQ, 0); - IF s = 1 THEN Put1(Add, RH, RH, 3); Put1(Asr, RH, RH, 2) - ELSIF s # 4 THEN Put1a(Mul, RH, RH, s DIV 4) - END ; - IF check THEN - Put1a(Mov, RH+1, 0, (x.type.size+3) DIV 4); Put0(Cmp, RH+1, RH, RH+1); Trap(GT, 3) - END ; - fix(pc0, pc + 5 - pc0) - END - ELSIF x.type.form = ORB.Record THEN Put1a(Mov, RH, 0, x.type.size DIV 4) - ELSE ORS.Mark("inadmissible assignment") - END ; - Put2(Ldr, RH+1, y.r, 0); Put1(Add, y.r, y.r, 4); - Put2(Str, RH+1, x.r, 0); Put1(Add, x.r, x.r, 4); - Put1(Sub, RH, RH, 1); Put3(BC, NE, -6); DEC(RH, 2) - END StoreStruct; - - PROCEDURE CopyString*(VAR x, y: Item); (*from x to y*) - VAR len: LONGINT; - BEGIN loadAdr(y); len := y.type.len; - IF len >= 0 THEN - IF x.b > len THEN ORS.Mark("string too long") END - ELSIF check THEN Put2(Ldr, RH, y.r, 4); (*array length check*) - Put1(Cmp, RH, RH, x.b); Trap(NE, 3) - END ; - loadStringAdr(x); - Put2(Ldr, RH, x.r, 0); Put1(Add, x.r, x.r, 4); - Put2(Str, RH, y.r, 0); Put1(Add, y.r, y.r, 4); - Put1(Asr, RH, RH, 24); Put3(BC, NE, -6); DEC(RH, 2) - END CopyString; - - (* Code generation for parameters *) - - PROCEDURE VarParam*(VAR x: Item; ftype: ORB.Type); - VAR xmd: INTEGER; - BEGIN xmd := x.mode; loadAdr(x); - IF (ftype.form = ORB.Array) & (ftype.len < 0) THEN (*open array*) - IF x.type.len >= 0 THEN Put1a(Mov, RH, 0, x.type.len) ELSE Put2(Ldr, RH, SP, x.a+4+frame) END ; - incR - ELSIF ftype.form = ORB.Record THEN - IF xmd = ORB.Par THEN Put2(Ldr, RH, SP, x.a+4+frame); incR ELSE loadTypTagAdr(x.type) END - END - END VarParam; - - PROCEDURE ValueParam*(VAR x: Item); - BEGIN load(x) - END ValueParam; - - PROCEDURE OpenArrayParam*(VAR x: Item); - BEGIN loadAdr(x); - IF x.type.len >= 0 THEN Put1a(Mov, RH, 0, x.type.len) ELSE Put2(Ldr, RH, SP, x.a+4+frame) END ; - incR - END OpenArrayParam; - - PROCEDURE StringParam*(VAR x: Item); - BEGIN loadStringAdr(x); Put1(Mov, RH, 0, x.b); incR (*len*) - END StringParam; - - (*For Statements*) - - PROCEDURE For0*(VAR x, y: Item); - BEGIN load(y) - END For0; - - PROCEDURE For1*(VAR x, y, z, w: Item; VAR L: LONGINT); - BEGIN - IF z.mode = ORB.Const THEN Put1a(Cmp, RH, y.r, z.a) - ELSE load(z); Put0(Cmp, RH-1, y.r, z.r); DEC(RH) - END ; - L := pc; - IF w.a > 0 THEN Put3(BC, GT, 0) - ELSIF w.a < 0 THEN Put3(BC, LT, 0) - ELSE ORS.Mark("zero increment"); Put3(BC, MI, 0) - END ; - Store(x, y) - END For1; - - PROCEDURE For2*(VAR x, y, w: Item); - BEGIN load(x); DEC(RH); Put1a(Add, x.r, x.r, w.a) - END For2; - - (* Branches, procedure calls, procedure prolog and epilog *) - - PROCEDURE Here*(): LONGINT; - BEGIN invalSB; RETURN pc - END Here; - - PROCEDURE FJump*(VAR L: LONGINT); - BEGIN Put3(BC, 7, L); L := pc-1 - END FJump; - - PROCEDURE CFJump*(VAR x: Item); - BEGIN - IF x.mode # Cond THEN loadCond(x) END ; - Put3(BC, negated(x.r), x.a); FixLink(x.b); x.a := pc-1 - END CFJump; - - PROCEDURE BJump*(L: LONGINT); - BEGIN Put3(BC, 7, L-pc-1) - END BJump; - - PROCEDURE CBJump*(VAR x: Item; L: LONGINT); - BEGIN - IF x.mode # Cond THEN loadCond(x) END ; - Put3(BC, negated(x.r), L-pc-1); FixLink(x.b); FixLinkWith(x.a, L) - END CBJump; - - PROCEDURE Fixup*(VAR x: Item); - BEGIN FixLink(x.a) - END Fixup; - - PROCEDURE SaveRegs(r: LONGINT); (* R[0 .. r-1]*) - VAR r0: LONGINT; - BEGIN (*r > 0*) r0 := 0; - Put1(Sub, SP, SP, r*4); INC(frame, 4*r); - REPEAT Put2(Str, r0, SP, (r-r0-1)*4); INC(r0) UNTIL r0 = r - END SaveRegs; - - PROCEDURE RestoreRegs(r: LONGINT); (*R[0 .. r-1]*) - VAR r0: LONGINT; - BEGIN (*r > 0*) r0 := r; - REPEAT DEC(r0); Put2(Ldr, r0, SP, (r-r0-1)*4) UNTIL r0 = 0; - Put1(Add, SP, SP, r*4); DEC(frame, 4*r) - END RestoreRegs; - - PROCEDURE PrepCall*(VAR x: Item; VAR r: LONGINT); - BEGIN (*x.type.form = ORB.Proc*) - IF x.mode > ORB.Par THEN load(x) END ; - r := RH; - IF RH > 0 THEN SaveRegs(RH); RH := 0 END - END PrepCall; - - PROCEDURE Call*(VAR x: Item; r: LONGINT); - BEGIN (*x.type.form = ORB.Proc*) - IF x.mode = ORB.Const THEN - IF x.r >= 0 THEN Put3(BL, 7, (x.a DIV 4)-pc-1) - ELSE (*imported*) - IF pc - fixorgP < 1000H THEN - Put3(BL, 7, ((-x.r) * 100H + x.a) * 1000H + pc-fixorgP); fixorgP := pc-1 - ELSE ORS.Mark("fixup impossible") - END - END - ELSE - IF x.mode <= ORB.Par THEN load(x); DEC(RH) - ELSE Put2(Ldr, RH, SP, 0); Put1(Add, SP, SP, 4); DEC(r); DEC(frame, 4) - END ; - IF check THEN Trap(EQ, 5) END ; - Put3(BLR, 7, RH) - END ; - IF x.type.base.form = ORB.NoTyp THEN (*procedure*) RH := 0 - ELSE (*function*) - IF r > 0 THEN Put0(Mov, r, 0, 0); RestoreRegs(r) END ; - x.mode := Reg; x.r := r; RH := r+1 - END ; - invalSB - END Call; - - PROCEDURE Enter*(parblksize, locblksize: LONGINT; int: BOOLEAN); - VAR a, r: LONGINT; - BEGIN invalSB; frame := 0; - IF ~int THEN (*procedure prolog*) - a := 4; r := 0; - Put1(Sub, SP, SP, locblksize); Put2(Str, LNK, SP, 0); - WHILE a < parblksize DO Put2(Str, r, SP, a); INC(r); INC(a, 4) END - ELSE (*interrupt procedure*) - Put1(Sub, SP, SP, 12); Put2(Str, 0, SP, 0); Put2(Str, 1, SP, 4); Put2(Str, SB, SP, 8) - (*R0, R1, SB saved os stack*) - END - END Enter; - - PROCEDURE Return*(form: INTEGER; VAR x: Item; size: LONGINT; int: BOOLEAN); - BEGIN - IF form # ORB.NoTyp THEN load(x) END ; - IF ~int THEN (*procedure epilog*) - Put2(Ldr, LNK, SP, 0); Put1(Add, SP, SP, size); Put3(BR, 7, LNK) - ELSE (*interrupt return, restore SB, R1, R0*) - Put2(Ldr, SB, SP, 8); Put2(Ldr, 1, SP, 4); Put2(Ldr, 0, SP, 0); Put1(Add, SP, SP, 12); Put3(BR, 7, 10H) - END ; - RH := 0 - END Return; - - (* In-line code procedures*) - - PROCEDURE Increment*(upordown: LONGINT; VAR x, y: Item); - VAR op, zr, v: LONGINT; - BEGIN (*frame = 0*) - IF upordown = 0 THEN op := Add ELSE op := Sub END ; - IF x.type = ORB.byteType THEN v := 1 ELSE v := 0 END ; - IF y.type.form = ORB.NoTyp THEN y.mode := ORB.Const; y.a := 1 END ; - IF (x.mode = ORB.Var) & (x.r > 0) THEN - zr := RH; Put2(Ldr+v, zr, SP, x.a); incR; - IF y.mode = ORB.Const THEN Put1a(op, zr, zr, y.a) ELSE load(y); Put0(op, zr, zr, y.r); DEC(RH) END ; - Put2(Str+v, zr, SP, x.a); DEC(RH) - ELSE loadAdr(x); zr := RH; Put2(Ldr+v, RH, x.r, 0); incR; - IF y.mode = ORB.Const THEN Put1a(op, zr, zr, y.a) ELSE load(y); Put0(op, zr, zr, y.r); DEC(RH) END ; - Put2(Str+v, zr, x.r, 0); DEC(RH, 2) - END - END Increment; - - PROCEDURE Include*(inorex: LONGINT; VAR x, y: Item); - VAR op, zr: LONGINT; - BEGIN loadAdr(x); zr := RH; Put2(Ldr, RH, x.r, 0); incR; - IF inorex = 0 THEN op := Ior ELSE op := Ann END ; - IF y.mode = ORB.Const THEN Put1a(op, zr, zr, LSL(1, y.a)) - ELSE load(y); Put1(Mov, RH, 0, 1); Put0(Lsl, y.r, RH, y.r); Put0(op, zr, zr, y.r); DEC(RH) - END ; - Put2(Str, zr, x.r, 0); DEC(RH, 2) - END Include; - - PROCEDURE Assert*(VAR x: Item); - VAR cond: LONGINT; - BEGIN - IF x.mode # Cond THEN loadCond(x) END ; - IF x.a = 0 THEN cond := negated(x.r) - ELSE Put3(BC, x.r, x.b); FixLink(x.a); x.b := pc-1; cond := 7 - END ; - Trap(cond, 7); FixLink(x.b) - END Assert; - - PROCEDURE New*(VAR x: Item); - BEGIN loadAdr(x); loadTypTagAdr(x.type.base); Put3(BLR, 7, MT); RH := 0; invalSB - END New; - - PROCEDURE Pack*(VAR x, y: Item); - VAR z: Item; - BEGIN z := x; load(x); load(y); - Put1(Lsl, y.r, y.r, 23); Put0(Add, x.r, x.r, y.r); DEC(RH); Store(z, x) - END Pack; - - PROCEDURE Unpk*(VAR x, y: Item); - VAR z, e0: Item; - BEGIN z := x; load(x); e0.mode := Reg; e0.r := RH; e0.type := ORB.intType; - Put1(Asr, RH, x.r, 23); Put1(Sub, RH, RH, 127); Store(y, e0); incR; - Put1(Lsl, RH, RH, 23); Put0(Sub, x.r, x.r, RH); Store(z, x) - END Unpk; - - PROCEDURE Led*(VAR x: Item); - BEGIN load(x); Put1(Mov, RH, 0, -60); Put2(Str, x.r, RH, 0); DEC(RH) - END Led; - - PROCEDURE Get*(VAR x, y: Item); - BEGIN load(x); x.type := y.type; x.mode := RegI; x.a := 0; Store(y, x) - END Get; - - PROCEDURE Put*(VAR x, y: Item); - BEGIN load(x); x.type := y.type; x.mode := RegI; x.a := 0; Store(x, y) - END Put; - - PROCEDURE Copy*(VAR x, y, z: Item); - BEGIN load(x); load(y); - IF z.mode = ORB.Const THEN - IF z.a > 0 THEN load(z) ELSE ORS.Mark("bad count") END - ELSE load(z); - IF check THEN Trap(LT, 3) END ; - Put3(BC, EQ, 6) - END ; - Put2(Ldr, RH, x.r, 0); Put1(Add, x.r, x.r, 4); - Put2(Str, RH, y.r, 0); Put1(Add, y.r, y.r, 4); - Put1(Sub, z.r, z.r, 1); Put3(BC, NE, -6); DEC(RH, 3) - END Copy; - - PROCEDURE LDPSR*(VAR x: Item); - BEGIN (*x.mode = Const*) Put3(0, 15, x.a + 20H) - END LDPSR; - - PROCEDURE LDREG*(VAR x, y: Item); - BEGIN - IF y.mode = ORB.Const THEN Put1a(Mov, x.a, 0, y.a) - ELSE load(y); Put0(Mov, x.a, 0, y.r); DEC(RH) - END - END LDREG; - - (*In-line code functions*) - - PROCEDURE Abs*(VAR x: Item); - BEGIN - IF x.mode = ORB.Const THEN x.a := ABS(x.a) - ELSE load(x); - IF x.type.form = ORB.Real THEN Put1(Lsl, x.r, x.r, 1); Put1(Ror, x.r, x.r, 1) - ELSE Put1(Cmp, x.r, x.r, 0); Put3(BC, GE, 2); Put1(Mov, RH, 0, 0); Put0(Sub, x.r, RH, x.r) - END - END - END Abs; - - PROCEDURE Odd*(VAR x: Item); - BEGIN load(x); Put1(And, x.r, x.r, 1); SetCC(x, NE); DEC(RH) - END Odd; - - PROCEDURE Floor*(VAR x: Item); - BEGIN load(x); Put1(Mov+U, RH, 0, 4B00H); Put0(Fad+V, x.r, x.r, RH) - END Floor; - - PROCEDURE Float*(VAR x: Item); - BEGIN load(x); Put1(Mov+U, RH, 0, 4B00H); Put0(Fad+U, x.r, x.r, RH) - END Float; - - PROCEDURE Ord*(VAR x: Item); - BEGIN - IF x.mode IN {ORB.Var, ORB.Par, RegI} THEN load(x) END - END Ord; - - PROCEDURE Len*(VAR x: Item); - BEGIN - IF x.type.len >= 0 THEN x.mode := ORB.Const; x.a := x.type.len - ELSE (*open array*) Put2(Ldr, RH, SP, x.a + 4 + frame); x.mode := Reg; x.r := RH; incR - END - END Len; - - PROCEDURE Shift*(fct: LONGINT; VAR x, y: Item); - VAR op: LONGINT; - BEGIN load(x); - IF fct = 0 THEN op := Lsl ELSIF fct = 1 THEN op := Asr ELSE op := Ror END ; - IF y.mode = ORB.Const THEN Put1(op, x.r, x.r, y.a MOD 20H) - ELSE load(y); Put0(op, RH-2, x.r, y.r); DEC(RH); x.r := RH-1 - END - END Shift; - - PROCEDURE ADC*(VAR x, y: Item); - BEGIN load(x); load(y); Put0(Add+2000H, x.r, x.r, y.r); DEC(RH) - END ADC; - - PROCEDURE SBC*(VAR x, y: Item); - BEGIN load(x); load(y); Put0(Sub+2000H, x.r, x.r, y.r); DEC(RH) - END SBC; - - PROCEDURE UML*(VAR x, y: Item); - BEGIN load(x); load(y); Put0(Mul+2000H, x.r, x.r, y.r); DEC(RH) - END UML; - - PROCEDURE Bit*(VAR x, y: Item); - BEGIN load(x); Put2(Ldr, x.r, x.r, 0); - IF y.mode = ORB.Const THEN Put1(Ror, x.r, x.r, y.a+1); DEC(RH) - ELSE load(y); Put1(Add, y.r, y.r, 1); Put0(Ror, x.r, x.r, y.r); DEC(RH, 2) - END ; - SetCC(x, MI) - END Bit; - - PROCEDURE Register*(VAR x: Item); - BEGIN (*x.mode = Const*) - Put0(Mov, RH, 0, x.a MOD 10H); x.mode := Reg; x.r := RH; incR - END Register; - - PROCEDURE H*(VAR x: Item); - BEGIN (*x.mode = Const*) - Put0(Mov + U + x.a MOD 2 * V, RH, 0, 0); x.mode := Reg; x.r := RH; incR - END H; - - PROCEDURE Adr*(VAR x: Item); - BEGIN - IF x.mode IN {ORB.Var, ORB.Par, RegI} THEN loadAdr(x) - ELSIF (x.mode = ORB.Const) & (x.type.form = ORB.Proc) THEN load(x) - ELSIF (x.mode = ORB.Const) & (x.type.form = ORB.String) THEN loadStringAdr(x) - ELSE ORS.Mark("not addressable") - END - END Adr; - - PROCEDURE Condition*(VAR x: Item); - BEGIN (*x.mode = Const*) SetCC(x, x.a) - END Condition; - - PROCEDURE Open*(v: INTEGER); - BEGIN pc := 0; tdx := 0; strx := 0; RH := 0; fixorgP := 0; fixorgD := 0; fixorgT := 0; check := v # 0; version := v; - IF v = 0 THEN pc := 8 END - END Open; - - PROCEDURE SetDataSize*(dc: LONGINT); - BEGIN varsize := dc - END SetDataSize; - - PROCEDURE Header*; - BEGIN entry := pc*4; - IF version = 0 THEN code[0] := 0E7000000H-1 + pc; Put1a(Mov, SB, 0, VarOrg0); Put1a(Mov, SP, 0, StkOrg0) (*RISC-0*) - ELSE Put1(Sub, SP, SP, 4); Put2(Str, LNK, SP, 0); invalSB - END - END Header; - - PROCEDURE NofPtrs(typ: ORB.Type): LONGINT; - VAR fld: ORB.Object; n: LONGINT; - BEGIN - IF (typ.form = ORB.Pointer) OR (typ.form = ORB.NilTyp) THEN n := 1 - ELSIF typ.form = ORB.Record THEN - fld := typ.dsc; n := 0; - WHILE fld # NIL DO n := NofPtrs(fld.type) + n; fld := fld.next END - ELSIF typ.form = ORB.Array THEN n := NofPtrs(typ.base) * typ.len - ELSE n := 0 - END ; - RETURN n - END NofPtrs; - - PROCEDURE FindPtrs(VAR R: Files.Rider; typ: ORB.Type; adr: LONGINT); - VAR fld: ORB.Object; i, s: LONGINT; - BEGIN - IF (typ.form = ORB.Pointer) OR (typ.form = ORB.NilTyp) THEN Files.WriteInt(R, adr) - ELSIF typ.form = ORB.Record THEN - fld := typ.dsc; - WHILE fld # NIL DO FindPtrs(R, fld.type, fld.val + adr); fld := fld.next END - ELSIF typ.form = ORB.Array THEN - s := typ.base.size; - FOR i := 0 TO typ.len-1 DO FindPtrs(R, typ.base, i*s + adr) END - END - END FindPtrs; - - PROCEDURE Close*(VAR modid: ORS.Ident; key, nofent: LONGINT); - VAR obj: ORB.Object; - i, comsize, nofimps, nofptrs, size: LONGINT; - name: ORS.Ident; - F: Files.File; R: Files.Rider; - BEGIN (*exit code*) - IF version = 0 THEN Put1(Mov, 0, 0, 0); Put3(BR, 7, 0) (*RISC-0*) - ELSE Put2(Ldr, LNK, SP, 0); Put1(Add, SP, SP, 4); Put3(BR, 7, LNK) - END ; - obj := ORB.topScope.next; nofimps := 0; comsize := 4; nofptrs := 0; - WHILE obj # NIL DO - IF (obj.class = ORB.Mod) & (obj.dsc # ORB.system) THEN INC(nofimps) (*count imports*) - ELSIF (obj.exno # 0) & (obj.class = ORB.Const) & (obj.type.form = ORB.Proc) - & (obj.type.nofpar = 0) & (obj.type.base = ORB.noType) THEN i := 0; (*count commands*) - WHILE obj.name[i] # 0X DO INC(i) END ; - i := (i+4) DIV 4 * 4; INC(comsize, i+4) - ELSIF obj.class = ORB.Var THEN INC(nofptrs, NofPtrs(obj.type)) (*count pointers*) - END ; - obj := obj.next - END ; - size := varsize + strx + comsize + (pc + nofimps + nofent + nofptrs + 1)*4; (*varsize includes type descriptors*) - - ORB.MakeFileName(name, modid, ".rsc"); (*write code file*) - F := Files.New(name); Files.Set(R, F, 0); Files.WriteString(R, modid); Files.WriteInt(R, key); - (*Files.WriteByte(R, version);*) (* who writes like that? -- noch *) - Files.WriteByte(R, SHORT(SHORT(version))); (* voc adaptation by noch *) - Files.WriteInt(R, size); - obj := ORB.topScope.next; - WHILE (obj # NIL) & (obj.class = ORB.Mod) DO (*imports*) - IF obj.dsc # ORB.system THEN Files.WriteString(R, obj(ORB.Module).orgname); Files.WriteInt(R, obj.val) END ; - obj := obj.next - END ; - Files.Write(R, 0X); - Files.WriteInt(R, tdx*4); - i := 0; - WHILE i < tdx DO Files.WriteInt(R, data[i]); INC(i) END ; (*type descriptors*) - Files.WriteInt(R, varsize - tdx*4); (*data*) - Files.WriteInt(R, strx); - FOR i := 0 TO strx-1 DO Files.Write(R, str[i]) END ; (*strings*) - Files.WriteInt(R, pc); (*code len*) - FOR i := 0 TO pc-1 DO Files.WriteInt(R, code[i]) END ; (*program*) - obj := ORB.topScope.next; - WHILE obj # NIL DO (*commands*) - IF (obj.exno # 0) & (obj.class = ORB.Const) & (obj.type.form = ORB.Proc) & - (obj.type.nofpar = 0) & (obj.type.base = ORB.noType) THEN - Files.WriteString(R, obj.name); Files.WriteInt(R, obj.val) - END ; - obj := obj.next - END ; - Files.Write(R, 0X); - Files.WriteInt(R, nofent); Files.WriteInt(R, entry); - obj := ORB.topScope.next; - WHILE obj # NIL DO (*entries*) - IF obj.exno # 0 THEN - IF (obj.class = ORB.Const) & (obj.type.form = ORB.Proc) OR (obj.class = ORB.Var) THEN - Files.WriteInt(R, obj.val) - ELSIF obj.class = ORB.Typ THEN - IF obj.type.form = ORB.Record THEN Files.WriteInt(R, obj.type.len MOD 10000H) - ELSIF (obj.type.form = ORB.Pointer) & ((obj.type.base.typobj = NIL) OR (obj.type.base.typobj.exno = 0)) THEN - Files.WriteInt(R, obj.type.base.len MOD 10000H) - END - END - END ; - obj := obj.next - END ; - obj := ORB.topScope.next; - WHILE obj # NIL DO (*pointer variables*) - IF obj.class = ORB.Var THEN FindPtrs(R, obj.type, obj.val) END ; - obj := obj.next - END ; - Files.WriteInt(R, -1); - Files.WriteInt(R, fixorgP); Files.WriteInt(R, fixorgD); Files.WriteInt(R, fixorgT); Files.WriteInt(R, entry); - Files.Write(R, "O"); Files.Register(F) - END Close; - -BEGIN - relmap[0] := 1; relmap[1] := 9; relmap[2] := 5; relmap[3] := 6; relmap[4] := 14; relmap[5] := 13 -END ORG. diff --git a/src/voc07R/ORP.Mod b/src/voc07R/ORP.Mod deleted file mode 100644 index 99e6ee83..00000000 --- a/src/voc07R/ORP.Mod +++ /dev/null @@ -1,997 +0,0 @@ -MODULE ORP; (*N. Wirth 1.7.97 / 7.6.2014 Oberon compiler for RISC in Oberon-07*) - IMPORT Texts := CompatTexts, Oberon, ORS, ORB, ORG; - (*Author: Niklaus Wirth, 2014. - Parser of Oberon-RISC compiler. Uses Scanner ORS to obtain symbols (tokens), - ORB for definition of data structures and for handling import and export, and - ORG to produce binary code. ORP performs type checking and data allocation. - Parser is target-independent, except for part of the handling of allocations.*) - - TYPE INTEGER = LONGINT; (* voc adaptation by noch *) - - TYPE PtrBase = POINTER TO PtrBaseDesc; - PtrBaseDesc = RECORD (*list of names of pointer base types*) - name: ORS.Ident; type: ORB.Type; next: PtrBase - END ; - - VAR sym: INTEGER; (*last symbol read*) - dc: LONGINT; (*data counter*) - level, exno, version: INTEGER; - newSF: BOOLEAN; (*option flag*) - expression: PROCEDURE (VAR x: ORG.Item); (*to avoid forward reference*) - Type: PROCEDURE (VAR type: ORB.Type); - FormalType: PROCEDURE (VAR typ: ORB.Type; dim: INTEGER); - modid: ORS.Ident; - pbsList: PtrBase; (*list of names of pointer base types*) - dummy: ORB.Object; - W: Texts.Writer; - - PROCEDURE Check(s: INTEGER; msg: ARRAY OF CHAR); - BEGIN - IF sym = s THEN ORS.Get(sym) ELSE ORS.Mark(msg) END - END Check; - - PROCEDURE qualident(VAR obj: ORB.Object); - BEGIN obj := ORB.thisObj(); ORS.Get(sym); - IF obj = NIL THEN ORS.Mark("undef"); obj := dummy END ; - IF (sym = ORS.period) & (obj.class = ORB.Mod) THEN - ORS.Get(sym); - IF sym = ORS.ident THEN obj := ORB.thisimport(obj); ORS.Get(sym); - IF obj = NIL THEN ORS.Mark("undef"); obj := dummy END - ELSE ORS.Mark("identifier expected"); obj := dummy - END - END - END qualident; - - PROCEDURE CheckBool(VAR x: ORG.Item); - BEGIN - IF x.type.form # ORB.Bool THEN ORS.Mark("not Boolean"); x.type := ORB.boolType END - END CheckBool; - - PROCEDURE CheckInt(VAR x: ORG.Item); - BEGIN - IF x.type.form # ORB.Int THEN ORS.Mark("not Integer"); x.type := ORB.intType END - END CheckInt; - - PROCEDURE CheckReal(VAR x: ORG.Item); - BEGIN - IF x.type.form # ORB.Real THEN ORS.Mark("not Real"); x.type := ORB.realType END - END CheckReal; - - PROCEDURE CheckSet(VAR x: ORG.Item); - BEGIN - IF x.type.form # ORB.Set THEN ORS.Mark("not Set"); x.type := ORB.setType END - END CheckSet; - - PROCEDURE CheckSetVal(VAR x: ORG.Item); - BEGIN - IF x.type.form # ORB.Int THEN ORS.Mark("not Int"); x.type := ORB.setType - ELSIF x.mode = ORB.Const THEN - IF (x.a < 0) OR (x.a >= 32) THEN ORS.Mark("invalid set") END - END - END CheckSetVal; - - PROCEDURE CheckConst(VAR x: ORG.Item); - BEGIN - IF x.mode # ORB.Const THEN ORS.Mark("not a constant"); x.mode := ORB.Const END - END CheckConst; - - PROCEDURE CheckReadOnly(VAR x: ORG.Item); - BEGIN - IF x.rdo THEN ORS.Mark("read-only") END - END CheckReadOnly; - - PROCEDURE CheckExport(VAR expo: BOOLEAN); - BEGIN - IF sym = ORS.times THEN - expo := TRUE; ORS.Get(sym); - IF level # 0 THEN ORS.Mark("remove asterisk") END - ELSE expo := FALSE - END - END CheckExport; - - PROCEDURE IsExtension(t0, t1: ORB.Type): BOOLEAN; - BEGIN (*t1 is an extension of t0*) - RETURN (t0 = t1) OR (t1 # NIL) & IsExtension(t0, t1.base) - END IsExtension; - - (* expressions *) - - PROCEDURE TypeTest(VAR x: ORG.Item; T: ORB.Type; guard: BOOLEAN); - VAR xt: ORB.Type; - BEGIN xt := x.type; - WHILE (xt # T) & (xt # NIL) DO xt := xt.base END ; - IF xt # T THEN xt := x.type; - IF (xt.form = ORB.Pointer) & (T.form = ORB.Pointer) THEN - IF IsExtension(xt.base, T.base) THEN ORG.TypeTest(x, T.base, FALSE, guard); x.type := T - ELSE ORS.Mark("not an extension") - END - ELSIF (xt.form = ORB.Record) & (T.form = ORB.Record) & (x.mode = ORB.Par) THEN - IF IsExtension(xt, T) THEN ORG.TypeTest(x, T, TRUE, guard); x.type := T - ELSE ORS.Mark("not an extension") - END - ELSE ORS.Mark("incompatible types") - END - ELSIF ~guard THEN ORG.MakeConstItem(x, ORB.boolType, 1) - END ; - IF ~guard THEN x.type := ORB.boolType END - END TypeTest; - - PROCEDURE selector(VAR x: ORG.Item); - VAR y: ORG.Item; obj: ORB.Object; - BEGIN - WHILE (sym = ORS.lbrak) OR (sym = ORS.period) OR (sym = ORS.arrow) - OR (sym = ORS.lparen) & (x.type.form IN {ORB.Record, ORB.Pointer}) DO - IF sym = ORS.lbrak THEN - REPEAT ORS.Get(sym); expression(y); - IF x.type.form = ORB.Array THEN - CheckInt(y); ORG.Index(x, y); x.type := x.type.base - ELSE ORS.Mark("not an array") - END - UNTIL sym # ORS.comma; - Check(ORS.rbrak, "no ]") - ELSIF sym = ORS.period THEN ORS.Get(sym); - IF sym = ORS.ident THEN - IF x.type.form = ORB.Pointer THEN ORG.DeRef(x); x.type := x.type.base END ; - IF x.type.form = ORB.Record THEN - obj := ORB.thisfield(x.type); ORS.Get(sym); - IF obj # NIL THEN ORG.Field(x, obj); x.type := obj.type - ELSE ORS.Mark("undef") - END - ELSE ORS.Mark("not a record") - END - ELSE ORS.Mark("ident?") - END - ELSIF sym = ORS.arrow THEN - ORS.Get(sym); - IF x.type.form = ORB.Pointer THEN ORG.DeRef(x); x.type := x.type.base - ELSE ORS.Mark("not a pointer") - END - ELSIF (sym = ORS.lparen) & (x.type.form IN {ORB.Record, ORB.Pointer}) THEN (*type guard*) - ORS.Get(sym); - IF sym = ORS.ident THEN - qualident(obj); - IF obj.class = ORB.Typ THEN TypeTest(x, obj.type, TRUE) - ELSE ORS.Mark("guard type expected") - END - ELSE ORS.Mark("not an identifier") - END ; - Check(ORS.rparen, " ) missing") - END - END - END selector; - - PROCEDURE CompTypes(t0, t1: ORB.Type; varpar: BOOLEAN): BOOLEAN; - - PROCEDURE EqualSignatures(t0, t1: ORB.Type): BOOLEAN; - VAR p0, p1: ORB.Object; com: BOOLEAN; - BEGIN com := TRUE; - IF (t0.base = t1.base) & (t0.nofpar = t1.nofpar) THEN - p0 := t0.dsc; p1 := t1.dsc; - WHILE p0 # NIL DO - IF (p0.class = p1.class) & CompTypes(p0.type, p1.type, TRUE) & - (*(ORD(p0.rdo) = ORD(p1.rdo))*) - (p0.rdo = p1.rdo) (* voc adaptation by noch *) - THEN - IF p0.type.form >= ORB.Array THEN com := CompTypes(p0.type, p1.type, (p0.class = ORB.Par)) END ; - p0 := p0.next; p1 := p1.next - ELSE p0 := NIL; com := FALSE - END - END - ELSE com := FALSE - END ; - RETURN com - END EqualSignatures; - - BEGIN (*Compatible Types*) - RETURN (t0 = t1) - OR (t0.form = ORB.Array) & (t1.form = ORB.Array) & CompTypes(t0.base, t1.base, varpar) - OR (t0.form = ORB.Pointer) & (t1.form = ORB.Pointer) & IsExtension(t0.base, t1.base) - OR (t0.form = ORB.Record) & (t1.form = ORB.Record) & IsExtension(t0, t1) - OR (t0.form = ORB.Proc) & (t1.form = ORB.Proc) & EqualSignatures(t0, t1) - OR (t0.form IN {ORB.Pointer, ORB.Proc}) & (t1.form = ORB.NilTyp) - OR (t0.form = ORB.NilTyp) & (t1.form IN {ORB.Pointer, ORB.Proc}) - OR ~varpar & (t0.form = ORB.Int) & (t1.form = ORB.Int) - END CompTypes; - - PROCEDURE Parameter(par: ORB.Object); - VAR x: ORG.Item; varpar: BOOLEAN; - BEGIN expression(x); - IF par # NIL THEN - varpar := par.class = ORB.Par; - IF CompTypes(par.type, x.type, varpar) THEN - IF ~varpar THEN ORG.ValueParam(x) - ELSE (*par.class = Par*) - IF ~par.rdo THEN CheckReadOnly(x) END ; - ORG.VarParam(x, par.type) - END - ELSIF ~varpar & (par.type.form = ORB.Int) & (x.type.form = ORB.Int) THEN - ORG.ValueParam(x) - ELSIF (x.type.form = ORB.String) & (x.b = 2) & (par.class = ORB.Var) & (par.type.form = ORB.Char) THEN - ORG.StrToChar(x); ORG.ValueParam(x) - ELSIF (x.type.form = ORB.Array) & (par.type.form = ORB.Array) & - (x.type.base.form = par.type.base.form) & (par.type.len < 0) THEN - ORG.OpenArrayParam(x); - ELSIF (x.type.form = ORB.String) & varpar & par.rdo & (par.type.form = ORB.Array) & - (par.type.base.form = ORB.Char) & (par.type.len < 0) THEN ORG.StringParam(x) - ELSIF (par.type.form = ORB.Array) & (par.type.base.form = ORB.Int) & (par.type.size = x.type.size) THEN - ORG.VarParam(x, par.type) - ELSE ORS.Mark("incompatible parameters") - END - END - END Parameter; - - PROCEDURE ParamList(VAR x: ORG.Item); - VAR n: INTEGER; par: ORB.Object; - BEGIN par := x.type.dsc; n := 0; - IF sym # ORS.rparen THEN - Parameter(par); n := 1; - WHILE sym <= ORS.comma DO - Check(sym, "comma?"); - IF par # NIL THEN par := par.next END ; - INC(n); Parameter(par) - END ; - Check(ORS.rparen, ") missing") - ELSE ORS.Get(sym); - END ; - IF n < x.type.nofpar THEN ORS.Mark("too few params") - ELSIF n > x.type.nofpar THEN ORS.Mark("too many params") - END - END ParamList; - - PROCEDURE StandFunc(VAR x: ORG.Item; fct: LONGINT; restyp: ORB.Type); - VAR y: ORG.Item; n, npar: LONGINT; - BEGIN Check(ORS.lparen, "no ("); - npar := fct MOD 10; fct := fct DIV 10; expression(x); n := 1; - WHILE sym = ORS.comma DO ORS.Get(sym); expression(y); INC(n) END ; - Check(ORS.rparen, "no )"); - IF n = npar THEN - IF fct = 0 THEN (*ABS*) - IF x.type.form IN {ORB.Int, ORB.Real} THEN ORG.Abs(x); restyp := x.type ELSE ORS.Mark("bad type") END - ELSIF fct = 1 THEN (*ODD*) CheckInt(x); ORG.Odd(x) - ELSIF fct = 2 THEN (*FLOOR*) CheckReal(x); ORG.Floor(x) - ELSIF fct = 3 THEN (*FLT*) CheckInt(x); ORG.Float(x) - ELSIF fct = 4 THEN (*ORD*) - IF x.type.form <= ORB.Proc THEN ORG.Ord(x) - ELSIF (x.type.form = ORB.String) & (x.b = 2) THEN ORG.StrToChar(x) - ELSE ORS.Mark("bad type") - END - ELSIF fct = 5 THEN (*CHR*) CheckInt(x); ORG.Ord(x) - ELSIF fct = 6 THEN (*LEN*) - IF x.type.form = ORB.Array THEN ORG.Len(x) ELSE ORS.Mark("not an array") END - ELSIF fct IN {7, 8, 9} THEN (*LSL, ASR, ROR*) CheckInt(y); - IF x.type.form IN {ORB.Int, ORB.Set} THEN ORG.Shift(fct-7, x, y); restyp := x.type ELSE ORS.Mark("bad type") END - ELSIF fct = 11 THEN (*ADC*) ORG.ADC(x, y) - ELSIF fct = 12 THEN (*SBC*) ORG.SBC(x, y) - ELSIF fct = 13 THEN (*UML*) ORG.UML(x, y) - ELSIF fct = 14 THEN (*BIT*) CheckInt(x); CheckInt(y); ORG.Bit(x, y) - ELSIF fct = 15 THEN (*REG*) CheckConst(x); CheckInt(x); ORG.Register(x) - ELSIF fct = 16 THEN (*VAL*) - IF (x.mode= ORB.Typ) & (x.type.size <= y.type.size) THEN restyp := x.type; x := y - ELSE ORS.Mark("casting not allowed") - END - ELSIF fct = 17 THEN (*ADR*) ORG.Adr(x) - ELSIF fct = 18 THEN (*SIZE*) - IF x.mode = ORB.Typ THEN ORG.MakeConstItem(x, ORB.intType, x.type.size) - ELSE ORS.Mark("must be a type") - END - ELSIF fct = 19 THEN (*COND*) CheckConst(x); CheckInt(x); ORG.Condition(x) - ELSIF fct = 20 THEN (*H*) CheckConst(x); CheckInt(x); ORG.H(x) - END ; - x.type := restyp - ELSE ORS.Mark("wrong nof params") - END - END StandFunc; - - PROCEDURE element(VAR x: ORG.Item); - VAR y: ORG.Item; - BEGIN expression(x); CheckSetVal(x); - IF sym = ORS.upto THEN ORS.Get(sym); expression(y); CheckSetVal(y); ORG.Set(x, y) - ELSE ORG.Singleton(x) - END ; - x.type := ORB.setType - END element; - - PROCEDURE set(VAR x: ORG.Item); - VAR y: ORG.Item; - BEGIN - IF sym >= ORS.if THEN - IF sym # ORS.rbrace THEN ORS.Mark(" } missing") END ; - ORG.MakeConstItem(x, ORB.setType, 0) (*empty set*) - ELSE element(x); - WHILE (sym < ORS.rparen) OR (sym > ORS.rbrace) DO - IF sym = ORS.comma THEN ORS.Get(sym) - ELSIF sym # ORS.rbrace THEN ORS.Mark("missing comma") - END ; - element(y); ORG.SetOp(ORS.plus, x, y) - END - END - END set; - - PROCEDURE factor(VAR x: ORG.Item); - VAR obj: ORB.Object; rx: LONGINT; - BEGIN (*sync*) - IF (sym < ORS.char) OR (sym > ORS.ident) THEN ORS.Mark("expression expected"); - REPEAT ORS.Get(sym) UNTIL (sym >= ORS.char) & (sym <= ORS.ident) - END ; - IF sym = ORS.ident THEN - qualident(obj); - IF obj.class = ORB.SFunc THEN StandFunc(x, obj.val, obj.type) - ELSE ORG.MakeItem(x, obj, level); selector(x); - IF sym = ORS.lparen THEN - ORS.Get(sym); - IF (x.type.form = ORB.Proc) & (x.type.base.form # ORB.NoTyp) THEN - ORG.PrepCall(x, rx); ParamList(x); ORG.Call(x, rx); x.type := x.type.base - ELSE ORS.Mark("not a function"); ParamList(x) - END - END - END - ELSIF sym = ORS.int THEN ORG.MakeConstItem(x, ORB.intType, ORS.ival); ORS.Get(sym) - ELSIF sym = ORS.real THEN ORG.MakeRealItem(x, ORS.rval); ORS.Get(sym) - ELSIF sym = ORS.char THEN ORG.MakeConstItem(x, ORB.charType, ORS.ival); ORS.Get(sym) - ELSIF sym = ORS.nil THEN ORS.Get(sym); ORG.MakeConstItem(x, ORB.nilType, 0) - ELSIF sym = ORS.string THEN ORG.MakeStringItem(x, ORS.slen); ORS.Get(sym) - ELSIF sym = ORS.lparen THEN ORS.Get(sym); expression(x); Check(ORS.rparen, "no )") - ELSIF sym = ORS.lbrace THEN ORS.Get(sym); set(x); Check(ORS.rbrace, "no }") - ELSIF sym = ORS.not THEN ORS.Get(sym); factor(x); CheckBool(x); ORG.Not(x) - ELSIF sym = ORS.false THEN ORS.Get(sym); ORG.MakeConstItem(x, ORB.boolType, 0) - ELSIF sym = ORS.true THEN ORS.Get(sym); ORG.MakeConstItem(x, ORB.boolType, 1) - ELSE ORS.Mark("not a factor"); ORG.MakeItem(x, NIL, level) - END - END factor; - - PROCEDURE term(VAR x: ORG.Item); - VAR y: ORG.Item; op, f: INTEGER; - BEGIN factor(x); f := x.type.form; - WHILE (sym >= ORS.times) & (sym <= ORS.and) DO - op := sym; ORS.Get(sym); - IF op = ORS.times THEN - IF f = ORB.Int THEN factor(y); CheckInt(y); ORG.MulOp(x, y) - ELSIF f = ORB.Real THEN factor(y); CheckReal(y); ORG.RealOp(op, x, y) - ELSIF f = ORB.Set THEN factor(y); CheckSet(y); ORG.SetOp(op, x, y) - ELSE ORS.Mark("bad type") - END - ELSIF (op = ORS.div) OR (op = ORS.mod) THEN - CheckInt(x); factor(y); CheckInt(y); ORG.DivOp(op, x, y) - ELSIF op = ORS.rdiv THEN - IF f = ORB.Real THEN factor(y); CheckReal(y); ORG.RealOp(op, x, y) - ELSIF f = ORB.Set THEN factor(y); CheckSet(y); ORG.SetOp(op, x, y) - ELSE ORS.Mark("bad type") - END - ELSE (*op = and*) CheckBool(x); ORG.And1(x); factor(y); CheckBool(y); ORG.And2(x, y) - END - END - END term; - - PROCEDURE SimpleExpression(VAR x: ORG.Item); - VAR y: ORG.Item; op: INTEGER; - BEGIN - IF sym = ORS.minus THEN ORS.Get(sym); term(x); - IF x.type.form IN {ORB.Int, ORB.Real, ORB.Set} THEN ORG.Neg(x) ELSE CheckInt(x) END - ELSIF sym = ORS.plus THEN ORS.Get(sym); term(x); - ELSE term(x) - END ; - WHILE (sym >= ORS.plus) & (sym <= ORS.or) DO - op := sym; ORS.Get(sym); - IF op = ORS.or THEN ORG.Or1(x); CheckBool(x); term(y); CheckBool(y); ORG.Or2(x, y) - ELSIF x.type.form = ORB.Int THEN term(y); CheckInt(y); ORG.AddOp(op, x, y) - ELSIF x.type.form = ORB.Real THEN term(y); CheckReal(y); ORG.RealOp(op, x, y) - ELSE CheckSet(x); term(y); CheckSet(y); ORG.SetOp(op, x, y) - END - END - END SimpleExpression; - - PROCEDURE expression0(VAR x: ORG.Item); - VAR y: ORG.Item; obj: ORB.Object; rel, xf, yf: INTEGER; - BEGIN SimpleExpression(x); - IF (sym >= ORS.eql) & (sym <= ORS.geq) THEN - rel := sym; ORS.Get(sym); SimpleExpression(y); xf := x.type.form; yf := y.type.form; - IF CompTypes(x.type, y.type, FALSE) OR - (xf = ORB.Pointer) & (yf = ORB.Pointer) & IsExtension(y.type.base, x.type.base) THEN - IF (xf IN {ORB.Char, ORB.Int}) THEN ORG.IntRelation(rel, x, y) - ELSIF xf = ORB.Real THEN ORG.RealRelation(rel, x, y) - ELSIF xf = ORB.Set THEN ORG.SetRelation(rel, x, y) - ELSIF (xf IN {ORB.Pointer, ORB.Proc, ORB.NilTyp}) THEN - IF rel <= ORS.neq THEN ORG.IntRelation(rel, x, y) ELSE ORS.Mark("only = or #") END - ELSIF (xf = ORB.Array) & (x.type.base.form = ORB.Char) OR (xf = ORB.String) THEN - ORG.StringRelation(rel, x, y) - ELSE ORS.Mark("illegal comparison") - END - ELSIF (xf = ORB.Array) & (x.type.base.form = ORB.Char) & - ((yf = ORB.String) OR (yf = ORB.Array) & (y.type.base.form = ORB.Char)) - OR (yf = ORB.Array) & (y.type.base.form = ORB.Char) & (xf = ORB.String) THEN - ORG.StringRelation(rel, x, y) - ELSIF (xf = ORB.Char) & (yf = ORB.String) & (y.b = 2) THEN - ORG.StrToChar(y); ORG.IntRelation(rel, x, y) - ELSIF (yf = ORB.Char) & (xf = ORB.String) & (x.b = 2) THEN - ORG.StrToChar(x); ORG.IntRelation(rel, x, y) - ELSE ORS.Mark("illegal comparison") - END ; - x.type := ORB.boolType - ELSIF sym = ORS.in THEN - ORS.Get(sym); SimpleExpression(y); - IF (x.type.form = ORB.Int) & (y.type.form = ORB.Set) THEN ORG.In(x, y) - ELSE ORS.Mark("illegal operands of IN") - END ; - x.type := ORB.boolType - ELSIF sym = ORS.is THEN - ORS.Get(sym); qualident(obj); TypeTest(x, obj.type, FALSE) ; - x.type := ORB.boolType - END - END expression0; - - (* statements *) - - PROCEDURE StandProc(pno: LONGINT); - VAR nap, npar: LONGINT; (*nof actual/formal parameters*) - x, y, z: ORG.Item; - BEGIN Check(ORS.lparen, "no ("); - npar := pno MOD 10; pno := pno DIV 10; expression(x); nap := 1; - IF sym = ORS.comma THEN - ORS.Get(sym); expression(y); nap := 2; z.type := ORB.noType; - WHILE sym = ORS.comma DO ORS.Get(sym); expression(z); INC(nap) END - ELSE y.type := ORB.noType - END ; - Check(ORS.rparen, "no )"); - IF (npar = nap) OR (pno IN {0, 1}) THEN - IF pno IN {0, 1} THEN (*INC, DEC*) - CheckInt(x); CheckReadOnly(x); - IF y.type # ORB.noType THEN CheckInt(y) END ; - ORG.Increment(pno, x, y) - ELSIF pno IN {2, 3} THEN (*INCL, EXCL*) - CheckSet(x); CheckReadOnly(x); CheckInt(y); ORG.Include(pno-2, x, y) - ELSIF pno = 4 THEN CheckBool(x); ORG.Assert(x) - ELSIF pno = 5 THEN(*NEW*) CheckReadOnly(x); - IF (x.type.form = ORB.Pointer) & (x.type.base.form = ORB.Record) THEN ORG.New(x) - ELSE ORS.Mark("not a pointer to record") - END - ELSIF pno = 6 THEN CheckReal(x); CheckInt(y); CheckReadOnly(x); ORG.Pack(x, y) - ELSIF pno = 7 THEN CheckReal(x); CheckInt(y); CheckReadOnly(x); ORG.Unpk(x, y) - ELSIF pno = 8 THEN - IF x.type.form <= ORB.Set THEN ORG.Led(x) ELSE ORS.Mark("bad type") END - ELSIF pno = 10 THEN CheckInt(x); ORG.Get(x, y) - ELSIF pno = 11 THEN CheckInt(x); ORG.Put(x, y) - ELSIF pno = 12 THEN CheckInt(x); CheckInt(y); CheckInt(z); ORG.Copy(x, y, z) - ELSIF pno = 13 THEN CheckConst(x); CheckInt(x); ORG.LDPSR(x) - ELSIF pno = 14 THEN CheckInt(x); ORG.LDREG(x, y) - END - ELSE ORS.Mark("wrong nof parameters") - END - END StandProc; - - PROCEDURE StatSequence; - VAR obj: ORB.Object; - orgtype: ORB.Type; (*original type of case var*) - x, y, z, w: ORG.Item; - L0, L1, rx: LONGINT; - - PROCEDURE TypeCase(obj: ORB.Object; VAR x: ORG.Item); - VAR typobj: ORB.Object; - BEGIN - IF sym = ORS.ident THEN - qualident(typobj); ORG.MakeItem(x, obj, level); - IF typobj.class # ORB.Typ THEN ORS.Mark("not a type") END ; - TypeTest(x, typobj.type, FALSE); obj.type := typobj.type; - ORG.CFJump(x); Check(ORS.colon, ": expected"); StatSequence - ELSE ORG.CFJump(x); ORS.Mark("type id expected") - END - END TypeCase; - - PROCEDURE SkipCase; - BEGIN - WHILE sym # ORS.colon DO ORS.Get(sym) END ; - ORS.Get(sym); StatSequence - END SkipCase; - - BEGIN (* StatSequence *) - REPEAT (*sync*) obj := NIL; - IF ~((sym = ORS.ident) OR (sym >= ORS.if) & (sym <= ORS.for) OR (sym >= ORS.semicolon)) THEN - ORS.Mark("statement expected"); - REPEAT ORS.Get(sym) UNTIL (sym = ORS.ident) OR (sym >= ORS.if) - END ; - IF sym = ORS.ident THEN - qualident(obj); ORG.MakeItem(x, obj, level); - IF x.mode = ORB.SProc THEN StandProc(obj.val) - ELSE selector(x); - IF sym = ORS.becomes THEN (*assignment*) - ORS.Get(sym); CheckReadOnly(x); expression(y); - IF CompTypes(x.type, y.type, FALSE) OR (x.type.form = ORB.Int) & (y.type.form = ORB.Int) THEN - IF (x.type.form <= ORB.Pointer) OR (x.type.form = ORB.Proc) THEN ORG.Store(x, y) - ELSIF y.type.size # 0 THEN ORG.StoreStruct(x, y) - END - ELSIF (x.type.form = ORB.Char) & (y.type.form = ORB.String) & (y.b = 2) THEN - ORG.StrToChar(y); ORG.Store(x, y) - ELSIF (x.type.form = ORB.Array) & (x.type.base.form = ORB.Char) & - (y.type.form = ORB.String) THEN ORG.CopyString(y, x) - ELSE ORS.Mark("illegal assignment") - END - ELSIF sym = ORS.eql THEN ORS.Mark("should be :="); ORS.Get(sym); expression(y) - ELSIF sym = ORS.lparen THEN (*procedure call*) - ORS.Get(sym); - IF (x.type.form = ORB.Proc) & (x.type.base.form = ORB.NoTyp) THEN - ORG.PrepCall(x, rx); ParamList(x); ORG.Call(x, rx) - ELSE ORS.Mark("not a procedure"); ParamList(x) - END - ELSIF x.type.form = ORB.Proc THEN (*procedure call without parameters*) - IF x.type.nofpar > 0 THEN ORS.Mark("missing parameters") END ; - IF x.type.base.form = ORB.NoTyp THEN ORG.PrepCall(x, rx); ORG.Call(x, rx) ELSE ORS.Mark("not a procedure") END - ELSIF x.mode = ORB.Typ THEN ORS.Mark("illegal assignment") - ELSE ORS.Mark("not a procedure") - END - END - ELSIF sym = ORS.if THEN - ORS.Get(sym); expression(x); CheckBool(x); ORG.CFJump(x); - Check(ORS.then, "no THEN"); - StatSequence; L0 := 0; - WHILE sym = ORS.elsif DO - ORS.Get(sym); ORG.FJump(L0); ORG.Fixup(x); expression(x); CheckBool(x); - ORG.CFJump(x); Check(ORS.then, "no THEN"); StatSequence - END ; - IF sym = ORS.else THEN ORS.Get(sym); ORG.FJump(L0); ORG.Fixup(x); StatSequence - ELSE ORG.Fixup(x) - END ; - ORG.FixLink(L0); Check(ORS.end, "no END") - ELSIF sym = ORS.while THEN - ORS.Get(sym); L0 := ORG.Here(); expression(x); CheckBool(x); ORG.CFJump(x); - Check(ORS.do, "no DO"); StatSequence; ORG.BJump(L0); - WHILE sym = ORS.elsif DO - ORS.Get(sym); ORG.Fixup(x); expression(x); CheckBool(x); ORG.CFJump(x); - Check(ORS.do, "no DO"); StatSequence; ORG.BJump(L0) - END ; - ORG.Fixup(x); Check(ORS.end, "no END") - ELSIF sym = ORS.repeat THEN - ORS.Get(sym); L0 := ORG.Here(); StatSequence; - IF sym = ORS.until THEN - ORS.Get(sym); expression(x); CheckBool(x); ORG.CBJump(x, L0) - ELSE ORS.Mark("missing UNTIL") - END - ELSIF sym = ORS.for THEN - ORS.Get(sym); - IF sym = ORS.ident THEN - qualident(obj); ORG.MakeItem(x, obj, level); CheckInt(x); CheckReadOnly(x); - IF sym = ORS.becomes THEN - ORS.Get(sym); expression(y); CheckInt(y); ORG.For0(x, y); L0 := ORG.Here(); - Check(ORS.to, "no TO"); expression(z); CheckInt(z); obj.rdo := TRUE; - IF sym = ORS.by THEN ORS.Get(sym); expression(w); CheckConst(w); CheckInt(w) - ELSE ORG.MakeConstItem(w, ORB.intType, 1) - END ; - Check(ORS.do, "no DO"); ORG.For1(x, y, z, w, L1); - StatSequence; Check(ORS.end, "no END"); - ORG.For2(x, y, w); ORG.BJump(L0); ORG.FixLink(L1); obj.rdo := FALSE - ELSE ORS.Mark(":= expected") - END - ELSE ORS.Mark("identifier expected") - END - ELSIF sym = ORS.case THEN - ORS.Get(sym); - IF sym = ORS.ident THEN - qualident(obj); orgtype := obj.type; - IF (orgtype.form = ORB.Pointer) OR (orgtype.form = ORB.Record) & (obj.class = ORB.Par) THEN - Check(ORS.of, "OF expected"); TypeCase(obj, x); L0 := 0; - WHILE sym = ORS.bar DO - ORS.Get(sym); ORG.FJump(L0); ORG.Fixup(x); obj.type := orgtype; TypeCase(obj, x) - END ; - ORG.Fixup(x); ORG.FixLink(L0); obj.type := orgtype - ELSE ORS.Mark("numeric case not implemented"); - Check(ORS.of, "OF expected"); SkipCase; - WHILE sym = ORS.bar DO SkipCase END - END - ELSE ORS.Mark("ident expected") - END ; - Check(ORS.end, "no END") - END ; - ORG.CheckRegs; - IF sym = ORS.semicolon THEN ORS.Get(sym) - ELSIF sym < ORS.semicolon THEN ORS.Mark("missing semicolon?") - END - UNTIL sym > ORS.semicolon - END StatSequence; - - (* Types and declarations *) - - PROCEDURE IdentList(class: INTEGER; VAR first: ORB.Object); - VAR obj: ORB.Object; - BEGIN - IF sym = ORS.ident THEN - ORB.NewObj(first, ORS.id, class); ORS.Get(sym); CheckExport(first.expo); - WHILE sym = ORS.comma DO - ORS.Get(sym); - IF sym = ORS.ident THEN ORB.NewObj(obj, ORS.id, class); ORS.Get(sym); CheckExport(obj.expo) - ELSE ORS.Mark("ident?") - END - END; - IF sym = ORS.colon THEN ORS.Get(sym) ELSE ORS.Mark(":?") END - ELSE first := NIL - END - END IdentList; - - PROCEDURE ArrayType(VAR type: ORB.Type); - VAR x: ORG.Item; typ: ORB.Type; len: LONGINT; - BEGIN NEW(typ); typ.form := ORB.NoTyp; - IF sym = ORS.of THEN (*dynamic array*) len := -1 - ELSE expression(x); - IF (x.mode = ORB.Const) & (x.type.form = ORB.Int) & (x.a >= 0) THEN len := x.a - ELSE len := 0; ORS.Mark("not a valid length") - END - END ; - IF sym = ORS.of THEN ORS.Get(sym); Type(typ.base); - IF (typ.base.form = ORB.Array) & (typ.base.len < 0) THEN ORS.Mark("dyn array not allowed") END - ELSIF sym = ORS.comma THEN ORS.Get(sym); ArrayType(typ.base) - ELSE ORS.Mark("missing OF"); typ.base := ORB.intType - END ; - IF len >= 0 THEN typ.size := (len * typ.base.size + 3) DIV 4 * 4 ELSE typ.size := 2*ORG.WordSize (*array desc*) END ; - typ.form := ORB.Array; typ.len := len; type := typ - END ArrayType; - - PROCEDURE RecordType(VAR type: ORB.Type); - VAR obj, obj0, new, bot, base: ORB.Object; - typ, tp: ORB.Type; - offset, off, n: LONGINT; - BEGIN NEW(typ); typ.form := ORB.NoTyp; typ.base := NIL; typ.mno := -level; typ.nofpar := 0; offset := 0; bot := NIL; - IF sym = ORS.lparen THEN - ORS.Get(sym); (*record extension*) - IF level # 0 THEN ORS.Mark("extension of local types not implemented") END ; - IF sym = ORS.ident THEN - qualident(base); - IF base.class = ORB.Typ THEN - IF base.type.form = ORB.Record THEN typ.base := base.type - ELSE typ.base := ORB.intType; ORS.Mark("invalid extension") - END ; - typ.nofpar := typ.base.nofpar + 1; (*"nofpar" here abused for extension level*) - bot := typ.base.dsc; offset := typ.base.size - ELSE ORS.Mark("type expected") - END - ELSE ORS.Mark("ident expected") - END ; - Check(ORS.rparen, "no )") - END ; - WHILE sym = ORS.ident DO (*fields*) - n := 0; obj := bot; - WHILE sym = ORS.ident DO - obj0 := obj; - WHILE (obj0 # NIL) & (obj0.name # ORS.id) DO obj0 := obj0.next END ; - IF obj0 # NIL THEN ORS.Mark("mult def") END ; - NEW(new); ORS.CopyId(new.name); new.class := ORB.Fld; new.next := obj; obj := new; INC(n); - ORS.Get(sym); CheckExport(new.expo); - IF (sym # ORS.comma) & (sym # ORS.colon) THEN ORS.Mark("comma expected") - ELSIF sym = ORS.comma THEN ORS.Get(sym) - END - END ; - Check(ORS.colon, "colon expected"); Type(tp); - IF (tp.form = ORB.Array) & (tp.len < 0) THEN ORS.Mark("dyn array not allowed") END ; - IF tp.size > 1 THEN offset := (offset+3) DIV 4 * 4 END ; - offset := offset + n * tp.size; off := offset; obj0 := obj; - WHILE obj0 # bot DO obj0.type := tp; obj0.lev := 0; off := off - tp.size; obj0.val := off; obj0 := obj0.next END ; - bot := obj; - IF sym = ORS.semicolon THEN ORS.Get(sym) ELSIF sym # ORS.end THEN ORS.Mark(" ; or END") END - END ; - typ.form := ORB.Record; typ.dsc := bot; typ.size := (offset + 3) DIV 4 * 4; type := typ - END RecordType; - - PROCEDURE FPSection(VAR adr: LONGINT; VAR nofpar: INTEGER); - VAR obj, first: ORB.Object; tp: ORB.Type; - parsize: LONGINT; cl: INTEGER; rdo: BOOLEAN; - BEGIN - IF sym = ORS.var THEN ORS.Get(sym); cl := ORB.Par ELSE cl := ORB.Var END ; - IdentList(cl, first); FormalType(tp, 0); rdo := FALSE; - IF (cl = ORB.Var) & (tp.form >= ORB.Array) THEN cl := ORB.Par; rdo := TRUE END ; - IF (tp.form = ORB.Array) & (tp.len < 0) OR (tp.form = ORB.Record) THEN - parsize := 2*ORG.WordSize (*open array or record, needs second word for length or type tag*) - ELSE parsize := ORG.WordSize - END ; - obj := first; - WHILE obj # NIL DO - INC(nofpar); obj.class := cl; obj.type := tp; obj.rdo := rdo; obj.lev := level; obj.val := adr; - adr := adr + parsize; obj := obj.next - END ; - IF adr >= 52 THEN ORS.Mark("too many parameters") END - END FPSection; - - PROCEDURE ProcedureType(ptype: ORB.Type; VAR parblksize: LONGINT); - VAR obj: ORB.Object; size: LONGINT; nofpar: INTEGER; - BEGIN ptype.base := ORB.noType; size := parblksize; nofpar := 0; ptype.dsc := NIL; - IF sym = ORS.lparen THEN - ORS.Get(sym); - IF sym = ORS.rparen THEN ORS.Get(sym) - ELSE FPSection(size, nofpar); - WHILE sym = ORS.semicolon DO ORS.Get(sym); FPSection(size, nofpar) END ; - Check(ORS.rparen, "no )") - END ; - ptype.nofpar := nofpar; parblksize := size; - IF sym = ORS.colon THEN (*function*) - ORS.Get(sym); - IF sym = ORS.ident THEN qualident(obj); - IF (obj.class = ORB.Typ) & (obj.type.form IN {ORB.Byte .. ORB.Pointer, ORB.Proc}) THEN ptype.base := obj.type - ELSE ORS.Mark("illegal function type") - END - ELSE ORS.Mark("type identifier expected") - END - END - END - END ProcedureType; - - PROCEDURE FormalType0(VAR typ: ORB.Type; dim: INTEGER); - VAR obj: ORB.Object; dmy: LONGINT; - BEGIN - IF sym = ORS.ident THEN - qualident(obj); - IF obj.class = ORB.Typ THEN typ := obj.type ELSE ORS.Mark("not a type"); typ := ORB.intType END - ELSIF sym = ORS.array THEN - ORS.Get(sym); Check(ORS.of, "OF ?"); - IF dim >= 1 THEN ORS.Mark("multi-dimensional open arrays not implemented") END ; - NEW(typ); typ.form := ORB.Array; typ.len := -1; typ.size := 2*ORG.WordSize; - FormalType(typ.base, dim+1) - ELSIF sym = ORS.procedure THEN - ORS.Get(sym); ORB.OpenScope; - NEW(typ); typ.form := ORB.Proc; typ.size := ORG.WordSize; dmy := 0; ProcedureType(typ, dmy); - typ.dsc := ORB.topScope.next; ORB.CloseScope - ELSE ORS.Mark("identifier expected"); typ := ORB.noType - END - END FormalType0; - - PROCEDURE CheckRecLevel(lev: INTEGER); - BEGIN - IF lev # 0 THEN ORS.Mark("ptr base must be global") END - END CheckRecLevel; - - PROCEDURE Type0(VAR type: ORB.Type); - VAR dmy: LONGINT; obj: ORB.Object; ptbase: PtrBase; - BEGIN type := ORB.intType; (*sync*) - IF (sym # ORS.ident) & (sym < ORS.array) THEN ORS.Mark("not a type"); - REPEAT ORS.Get(sym) UNTIL (sym = ORS.ident) OR (sym >= ORS.array) - END ; - IF sym = ORS.ident THEN - qualident(obj); - IF obj.class = ORB.Typ THEN - IF (obj.type # NIL) & (obj.type.form # ORB.NoTyp) THEN type := obj.type END - ELSE ORS.Mark("not a type or undefined") - END - ELSIF sym = ORS.array THEN ORS.Get(sym); ArrayType(type) - ELSIF sym = ORS.record THEN - ORS.Get(sym); RecordType(type); Check(ORS.end, "no END") - ELSIF sym = ORS.pointer THEN - ORS.Get(sym); Check(ORS.to, "no TO"); - NEW(type); type.form := ORB.Pointer; type.size := ORG.WordSize; type.base := ORB.intType; - IF sym = ORS.ident THEN - obj := ORB.thisObj(); ORS.Get(sym); - IF obj # NIL THEN - IF (obj.class = ORB.Typ) & (obj.type.form IN {ORB.Record, ORB.NoTyp}) THEN - CheckRecLevel(obj.lev); type.base := obj.type - ELSE ORS.Mark("no valid base type") - END - ELSE CheckRecLevel(level); (*enter into list of forward references to be fixed in Declarations*) - NEW(ptbase); ORS.CopyId(ptbase.name); ptbase.type := type; ptbase.next := pbsList; pbsList := ptbase - END - ELSE Type(type.base); - IF type.base.form # ORB.Record THEN ORS.Mark("must point to record") END ; - CheckRecLevel(level) - END - ELSIF sym = ORS.procedure THEN - ORS.Get(sym); ORB.OpenScope; - NEW(type); type.form := ORB.Proc; type.size := ORG.WordSize; dmy := 0; - ProcedureType(type, dmy); type.dsc := ORB.topScope.next; ORB.CloseScope - ELSE ORS.Mark("illegal type") - END - END Type0; - - PROCEDURE Declarations(VAR varsize: LONGINT); - VAR obj, first: ORB.Object; - x: ORG.Item; tp: ORB.Type; ptbase: PtrBase; - expo: BOOLEAN; id: ORS.Ident; - BEGIN (*sync*) pbsList := NIL; - IF (sym < ORS.const) & (sym # ORS.end) THEN ORS.Mark("declaration?"); - REPEAT ORS.Get(sym) UNTIL (sym >= ORS.const) OR (sym = ORS.end) - END ; - IF sym = ORS.const THEN - ORS.Get(sym); - WHILE sym = ORS.ident DO - ORS.CopyId(id); ORS.Get(sym); CheckExport(expo); - IF sym = ORS.eql THEN ORS.Get(sym) ELSE ORS.Mark("= ?") END; - expression(x); - IF (x.type.form = ORB.String) & (x.b = 2) THEN ORG.StrToChar(x) END ; - ORB.NewObj(obj, id, ORB.Const); obj.expo := expo; - IF x.mode = ORB.Const THEN obj.val := x.a; obj.lev := x.b; obj.type := x.type - ELSE ORS.Mark("expression not constant"); obj.type := ORB.intType - END; - Check(ORS.semicolon, "; missing") - END - END ; - IF sym = ORS.type THEN - ORS.Get(sym); - WHILE sym = ORS.ident DO - ORS.CopyId(id); ORS.Get(sym); CheckExport(expo); - IF sym = ORS.eql THEN ORS.Get(sym) ELSE ORS.Mark("=?") END ; - Type(tp); - ORB.NewObj(obj, id, ORB.Typ); obj.type := tp; obj.expo := expo; obj.lev := level; tp.typobj := obj; - IF expo & (obj.type.form = ORB.Record) THEN obj.exno := exno; INC(exno) ELSE obj.exno := 0 END ; - IF tp.form = ORB.Record THEN - ptbase := pbsList; (*check whether this is base of a pointer type; search and fixup*) - WHILE ptbase # NIL DO - IF obj.name = ptbase.name THEN ptbase.type.base := obj.type END ; - ptbase := ptbase.next - END ; - IF level = 0 THEN ORG.BuildTD(tp, dc) END (*type descriptor; len used as its address*) - END ; - Check(ORS.semicolon, "; missing") - END - END ; - IF sym = ORS.var THEN - ORS.Get(sym); - WHILE sym = ORS.ident DO - IdentList(ORB.Var, first); Type(tp); - obj := first; - WHILE obj # NIL DO - obj.type := tp; obj.lev := level; - IF tp.size > 1 THEN varsize := (varsize + 3) DIV 4 * 4 (*align*) END ; - obj.val := varsize; varsize := varsize + obj.type.size; - IF obj.expo THEN obj.exno := exno; INC(exno) END ; - obj := obj.next - END ; - Check(ORS.semicolon, "; missing") - END - END ; - varsize := (varsize + 3) DIV 4 * 4; - ptbase := pbsList; - WHILE ptbase # NIL DO - IF ptbase.type.base.form = ORB.Int THEN ORS.Mark("undefined pointer base of") END ; - ptbase := ptbase.next - END ; - IF (sym >= ORS.const) & (sym <= ORS.var) THEN ORS.Mark("declaration in bad order") END - END Declarations; - - PROCEDURE ProcedureDecl; - VAR proc: ORB.Object; - type: ORB.Type; - procid: ORS.Ident; - x: ORG.Item; - locblksize, parblksize, L: LONGINT; - int: BOOLEAN; - BEGIN (* ProcedureDecl *) int := FALSE; ORS.Get(sym); - IF sym = ORS.times THEN ORS.Get(sym); int := TRUE END ; - IF sym = ORS.ident THEN - ORS.CopyId(procid); ORS.Get(sym); - ORB.NewObj(proc, ORS.id, ORB.Const); parblksize := 4; - NEW(type); type.form := ORB.Proc; type.size := ORG.WordSize; proc.type := type; - CheckExport(proc.expo); - IF proc.expo THEN proc.exno := exno; INC(exno) END ; - ORB.OpenScope; INC(level); proc.val := -1; type.base := ORB.noType; - ProcedureType(type, parblksize); (*formal parameter list*) - Check(ORS.semicolon, "no ;"); locblksize := parblksize; - Declarations(locblksize); - proc.val := ORG.Here() * 4; proc.type.dsc := ORB.topScope.next; - IF sym = ORS.procedure THEN - L := 0; ORG.FJump(L); - REPEAT ProcedureDecl; Check(ORS.semicolon, "no ;") UNTIL sym # ORS.procedure; - ORG.FixLink(L); proc.val := ORG.Here() * 4; proc.type.dsc := ORB.topScope.next - END ; - ORG.Enter(parblksize, locblksize, int); - IF sym = ORS.begin THEN ORS.Get(sym); StatSequence END ; - IF sym = ORS.return THEN - ORS.Get(sym); expression(x); - IF type.base = ORB.noType THEN ORS.Mark("this is not a function") - ELSIF ~CompTypes(type.base, x.type, FALSE) THEN ORS.Mark("wrong result type") - END - ELSIF type.base.form # ORB.NoTyp THEN - ORS.Mark("function without result"); type.base := ORB.noType - END ; - ORG.Return(type.base.form, x, locblksize, int); - ORB.CloseScope; DEC(level); Check(ORS.end, "no END"); - IF sym = ORS.ident THEN - IF ORS.id # procid THEN ORS.Mark("no match") END ; - ORS.Get(sym) - ELSE ORS.Mark("no proc id") - END - END ; - int := FALSE - END ProcedureDecl; - - PROCEDURE Module; - VAR key: LONGINT; - obj: ORB.Object; - impid, impid1: ORS.Ident; - BEGIN Texts.WriteString(W, " compiling "); ORS.Get(sym); - IF sym = ORS.module THEN - ORS.Get(sym); - IF sym = ORS.times THEN version := 0; Texts.Write(W, "*"); ORS.Get(sym) ELSE version := 1 END ; - ORB.Init; ORB.OpenScope; - IF sym = ORS.ident THEN - ORS.CopyId(modid); ORS.Get(sym); - Texts.WriteString(W, modid); Texts.Append(Oberon.Log, W.buf); - Oberon.DumpLog; (* voc adaptation; -- noch *) - ELSE ORS.Mark("identifier expected") - END ; - Check(ORS.semicolon, "no ;"); level := 0; dc := 0; exno := 1; key := 0; - IF sym = ORS.import THEN - ORS.Get(sym); - WHILE sym = ORS.ident DO - ORS.CopyId(impid); ORS.Get(sym); - IF sym = ORS.becomes THEN - ORS.Get(sym); - IF sym = ORS.ident THEN ORS.CopyId(impid1); ORS.Get(sym) - ELSE ORS.Mark("id expected") - END - ELSE impid1 := impid - END ; - ORB.Import(impid, impid1); - IF sym = ORS.comma THEN ORS.Get(sym) - ELSIF sym = ORS.ident THEN ORS.Mark("comma missing") - END - END ; - Check(ORS.semicolon, "no ;") - END ; - obj := ORB.topScope.next; - ORG.Open(version); Declarations(dc); ORG.SetDataSize((dc + 3) DIV 4 * 4); - WHILE sym = ORS.procedure DO ProcedureDecl; Check(ORS.semicolon, "no ;") END ; - ORG.Header; - IF sym = ORS.begin THEN ORS.Get(sym); StatSequence END ; - Check(ORS.end, "no END"); - IF sym = ORS.ident THEN - IF ORS.id # modid THEN ORS.Mark("no match") END ; - ORS.Get(sym) - ELSE ORS.Mark("identifier missing") - END ; - IF sym # ORS.period THEN ORS.Mark("period missing") END ; - IF (ORS.errcnt = 0) & (version # 0) THEN - ORB.Export(modid, newSF, key); - IF newSF THEN Texts.WriteString(W, " new symbol file") END - END ; - IF ORS.errcnt = 0 THEN - ORG.Close(modid, key, exno); - Texts.WriteInt(W, ORG.pc, 6); Texts.WriteInt(W, dc, 6); Texts.WriteHex(W, key) - ELSE Texts.WriteLn(W); Texts.WriteString(W, "compilation FAILED") - END ; - Texts.WriteLn(W); Texts.Append(Oberon.Log, W.buf); - Oberon.DumpLog; (* voc adaptation; -- noch *) - ORB.CloseScope; pbsList := NIL - ELSE ORS.Mark("must start with MODULE") - END - END Module; - - PROCEDURE Option(VAR S: Texts.Scanner); - BEGIN newSF := FALSE; - IF S.nextCh = "/" THEN - Texts.Scan(S); Texts.Scan(S); - IF (S.class = Texts.Name) & (S.s[0] = "s") THEN newSF := TRUE END - END - END Option; - - PROCEDURE Compile*; - VAR beg, end, time: LONGINT; - T: Texts.Text; - S: Texts.Scanner; - BEGIN Texts.OpenScanner(S, Oberon.Par.text, Oberon.Par.pos); Texts.Scan(S); - IF S.class = Texts.Char THEN - IF S.c = "@" THEN - Option(S); Oberon.GetSelection(T, beg, end, time); - IF time >= 0 THEN ORS.Init(T, beg); Module END - ELSIF S.c = "^" THEN - Option(S); Oberon.GetSelection(T, beg, end, time); - IF time >= 0 THEN - Texts.OpenScanner(S, T, beg); Texts.Scan(S); - IF S.class = Texts.Name THEN - Texts.WriteString(W, S.s); NEW(T); Texts.Open(T, S.s); - IF T.len > 0 THEN ORS.Init(T, 0); Module END - END - END - END - ELSE - WHILE S.class = Texts.Name DO - NEW(T); Texts.Open(T, S.s); - IF T.len > 0 THEN Option(S); ORS.Init(T, 0); Module - ELSE Texts.WriteString(W, S.s); Texts.WriteString(W, " not found"); - Texts.WriteLn(W); Texts.Append(Oberon.Log, W.buf); - Oberon.DumpLog; (* voc adaptation; -- noch *) - END ; - IF (T.len # 0) & (ORS.errcnt = 0) THEN Texts.Scan(S) ELSE S.class := 0 END - END - END ; - Oberon.Collect(0) - END Compile; - -BEGIN Texts.OpenWriter(W); Texts.WriteString(W, "OR Compiler 7.6.2014"); - Texts.WriteLn(W); Texts.Append(Oberon.Log, W.buf); - Oberon.DumpLog; (* voc adaptation; -- noch *) - NEW(dummy); dummy.class := ORB.Var; dummy.type := ORB.intType; - expression := expression0; Type := Type0; FormalType := FormalType0; - - Compile (* voc adaptation; -- noch *) -END ORP. diff --git a/src/voc07R/ORS.Mod b/src/voc07R/ORS.Mod deleted file mode 100644 index 1d005e38..00000000 --- a/src/voc07R/ORS.Mod +++ /dev/null @@ -1,325 +0,0 @@ -MODULE ORS; (* NW 19.9.93 / 1.4.2014 Scanner in Oberon-07*) - IMPORT SYSTEM, Texts := CompatTexts, Oberon; (* CompatTexts is voc adaptation by noch *) - - TYPE INTEGER = LONGINT; (* voc adaptation by noch *) - -(* Oberon Scanner does lexical analysis. Input is Oberon-Text, output is - sequence of symbols, i.e identifiers, numbers, strings, and special symbols. - Recognises all Oberon keywords and skips comments. The keywords are - recorded in a table. - Get(sym) delivers next symbol from input text with Reader R. - Mark(msg) records error and delivers error message with Writer W. - If Get delivers ident, then the identifier (a string) is in variable id, if int or char - in ival, if real in rval, and if string in str (and slen) *) - - CONST IdLen* = 32; - NKW = 34; (*nof keywords*) - maxExp = 38; stringBufSize = 256; - - (*lexical symbols*) - null = 0; times* = 1; rdiv* = 2; div* = 3; mod* = 4; - and* = 5; plus* = 6; minus* = 7; or* = 8; eql* = 9; - neq* = 10; lss* = 11; leq* = 12; gtr* = 13; geq* = 14; - in* = 15; is* = 16; arrow* = 17; period* = 18; - char* = 20; int* = 21; real* = 22; false* = 23; true* = 24; - nil* = 25; string* = 26; not* = 27; lparen* = 28; lbrak* = 29; - lbrace* = 30; ident* = 31; - if* = 32; while* = 34; repeat* = 35; case* = 36; for* = 37; - comma* = 40; colon* = 41; becomes* = 42; upto* = 43; rparen* = 44; - rbrak* = 45; rbrace* = 46; then* = 47; of* = 48; do* = 49; - to* = 50; by* = 51; semicolon* = 52; end* = 53; bar* = 54; - else* = 55; elsif* = 56; until* = 57; return* = 58; - array* = 60; record* = 61; pointer* = 62; const* = 63; type* = 64; - var* = 65; procedure* = 66; begin* = 67; import* = 68; module* = 69; - - TYPE Ident* = ARRAY IdLen OF CHAR; - - VAR ival*, slen*: LONGINT; (*results of Get*) - rval*: REAL; - id*: Ident; (*for identifiers*) - str*: ARRAY stringBufSize OF CHAR; - errcnt*: INTEGER; - - ch: CHAR; (*last character read*) - errpos: LONGINT; - R: Texts.Reader; - W: Texts.Writer; - k: INTEGER; - KWX: ARRAY 10 OF INTEGER; - keyTab: ARRAY NKW OF - RECORD sym: INTEGER; id: ARRAY 12 OF CHAR END; - - PROCEDURE CopyId*(VAR ident: Ident); - BEGIN ident := id - END CopyId; - - PROCEDURE Pos*(): LONGINT; - BEGIN RETURN Texts.Pos(R) - 1 - END Pos; - - PROCEDURE Mark*(msg: ARRAY OF CHAR); - VAR p: LONGINT; - BEGIN p := Pos(); - IF (p > errpos) & (errcnt < 25) THEN - Texts.WriteLn(W); Texts.WriteString(W, " pos "); Texts.WriteInt(W, p, 1); Texts.Write(W, " "); - Texts.WriteString(W, msg); Texts.Append(Oberon.Log, W.buf); - Oberon.DumpLog; (* voc adaptation by noch *) - END ; - INC(errcnt); errpos := p + 4 - END Mark; - - PROCEDURE Identifier(VAR sym: INTEGER); - VAR i, k: INTEGER; - BEGIN i := 0; - REPEAT - IF i < IdLen-1 THEN id[i] := ch; INC(i) END ; - Texts.Read(R, ch) - UNTIL (ch < "0") OR (ch > "9") & (ch < "A") OR (ch > "Z") & (ch < "a") OR (ch > "z"); - id[i] := 0X; - IF i < 10 THEN k := KWX[i-1]; (*search for keyword*) - WHILE (id # keyTab[k].id) & (k < KWX[i]) DO INC(k) END ; - IF k < KWX[i] THEN sym := keyTab[k].sym ELSE sym := ident END - ELSE sym := ident - END - END Identifier; - - PROCEDURE String; - VAR i: INTEGER; - BEGIN i := 0; Texts.Read(R, ch); - WHILE ~R.eot & (ch # 22X) DO - IF ch >= " " THEN - IF i < stringBufSize-1 THEN str[i] := ch; INC(i) ELSE Mark("string too long") END ; - END ; - Texts.Read(R, ch) - END ; - str[i] := 0X; INC(i); Texts.Read(R, ch); slen := i - END String; - - PROCEDURE HexString; - VAR i, m, n: INTEGER; - BEGIN i := 0; Texts.Read(R, ch); - WHILE ~R.eot & (ch # "$") DO - WHILE (ch = " ") OR (ch = 9X) OR (ch = 0DX) DO Texts.Read(R, ch) END ; (*skip*) - IF ("0" <= ch) & (ch <= "9") THEN m := ORD(ch) - 30H - ELSIF ("A" <= ch) & (ch <= "F") THEN m := ORD(ch) - 37H - ELSE m := 0; Mark("hexdig expected") - END ; - Texts.Read(R, ch); - IF ("0" <= ch) & (ch <= "9") THEN n := ORD(ch) - 30H - ELSIF ("A" <= ch) & (ch <= "F") THEN n := ORD(ch) - 37H - ELSE n := 0; Mark("hexdig expected") - END ; - IF i < stringBufSize THEN str[i] := CHR(m*10H + n); INC(i) ELSE Mark("string too long") END ; - Texts.Read(R, ch) - END ; - Texts.Read(R, ch); slen := i (*no 0X appended!*) - END HexString; - - PROCEDURE Ten(e: LONGINT): REAL; - VAR x, t: REAL; - BEGIN x := 1.0; t := 10.0; - WHILE e > 0 DO - IF ODD(e) THEN x := t * x END ; - t := t * t; e := e DIV 2 - END ; - RETURN x - END Ten; - - PROCEDURE Number(VAR sym: INTEGER); - CONST max = 2147483647 (*2^31 - 1*); - VAR i, k, e, n, s, h: LONGINT; x: REAL; - d: ARRAY 16 OF INTEGER; - negE: BOOLEAN; - BEGIN ival := 0; i := 0; n := 0; k := 0; - REPEAT - IF n < 16 THEN d[n] := ORD(ch)-30H; INC(n) ELSE Mark("too many digits"); n := 0 END ; - Texts.Read(R, ch) - UNTIL (ch < "0") OR (ch > "9") & (ch < "A") OR (ch > "F"); - IF (ch = "H") OR (ch = "R") OR (ch = "X") THEN (*hex*) - REPEAT h := d[i]; - IF h >= 10 THEN h := h-7 END ; - k := k*10H + h; INC(i) (*no overflow check*) - UNTIL i = n; - IF ch = "X" THEN sym := char; - IF k < 100H THEN ival := k ELSE Mark("illegal value"); ival := 0 END - ELSIF ch = "R" THEN sym := real; rval := SYSTEM.VAL(REAL, k) - ELSE sym := int; ival := k - END ; - Texts.Read(R, ch) - ELSIF ch = "." THEN - Texts.Read(R, ch); - IF ch = "." THEN (*double dot*) ch := 7FX; (*decimal integer*) - REPEAT - IF d[i] < 10 THEN - IF k <= (max-d[i]) DIV 10 THEN k := k *10 + d[i] ELSE Mark("too large"); k := 0 END - ELSE Mark("bad integer") - END ; - INC(i) - UNTIL i = n; - sym := int; ival := k - ELSE (*real number*) x := 0.0; e := 0; - REPEAT (*integer part*) - (*x := x * 10.0 + FLT(d[i]); *) - x := x * 10.0 + (d[i]); (* voc adaptation by noch *) - INC(i) - UNTIL i = n; - WHILE (ch >= "0") & (ch <= "9") DO (*fraction*) - (*x := x * 10.0 + FLT(ORD(ch) - 30H);*) - x := x * 10.0 + (ORD(ch) - 30H); (* voc adaptation by noch *) - DEC(e); - Texts.Read(R, ch) - END ; - IF (ch = "E") OR (ch = "D") THEN (*scale factor*) - Texts.Read(R, ch); s := 0; - IF ch = "-" THEN negE := TRUE; Texts.Read(R, ch) - ELSE negE := FALSE; - IF ch = "+" THEN Texts.Read(R, ch) END - END ; - IF (ch >= "0") & (ch <= "9") THEN - REPEAT s := s*10 + ORD(ch)-30H; Texts.Read(R, ch) - UNTIL (ch < "0") OR (ch >"9"); - IF negE THEN e := e-s ELSE e := e+s END - ELSE Mark("digit?") - END - END ; - IF e < 0 THEN - IF e >= -maxExp THEN x := x / Ten(-e) ELSE x := 0.0 END - ELSIF e > 0 THEN - IF e <= maxExp THEN x := Ten(e) * x ELSE x := 0.0; Mark("too large") END - END ; - sym := real; rval := x - END - ELSE (*decimal integer*) - REPEAT - IF d[i] < 10 THEN - IF k <= (max-d[i]) DIV 10 THEN k := k*10 + d[i] ELSE Mark("too large"); k := 0 END - ELSE Mark("bad integer") - END ; - INC(i) - UNTIL i = n; - sym := int; ival := k - END - END Number; - - PROCEDURE comment; - BEGIN Texts.Read(R, ch); - REPEAT - WHILE ~R.eot & (ch # "*") DO - IF ch = "(" THEN Texts.Read(R, ch); - IF ch = "*" THEN comment END - ELSE Texts.Read(R, ch) - END - END ; - WHILE ch = "*" DO Texts.Read(R, ch) END - UNTIL (ch = ")") OR R.eot; - IF ~R.eot THEN Texts.Read(R, ch) ELSE Mark("unterminated comment") END - END comment; - - PROCEDURE Get*(VAR sym: INTEGER); - BEGIN - REPEAT - WHILE ~R.eot & (ch <= " ") DO Texts.Read(R, ch) END; - IF ch < "A" THEN - IF ch < "0" THEN - IF ch = 22X THEN String; sym := string - ELSIF ch = "#" THEN Texts.Read(R, ch); sym := neq - ELSIF ch = "$" THEN HexString; sym := string - ELSIF ch = "&" THEN Texts.Read(R, ch); sym := and - ELSIF ch = "(" THEN Texts.Read(R, ch); - IF ch = "*" THEN sym := null; comment ELSE sym := lparen END - ELSIF ch = ")" THEN Texts.Read(R, ch); sym := rparen - ELSIF ch = "*" THEN Texts.Read(R, ch); sym := times - ELSIF ch = "+" THEN Texts.Read(R, ch); sym := plus - ELSIF ch = "," THEN Texts.Read(R, ch); sym := comma - ELSIF ch = "-" THEN Texts.Read(R, ch); sym := minus - ELSIF ch = "." THEN Texts.Read(R, ch); - IF ch = "." THEN Texts.Read(R, ch); sym := upto ELSE sym := period END - ELSIF ch = "/" THEN Texts.Read(R, ch); sym := rdiv - ELSE Texts.Read(R, ch); (* ! % ' *) sym := null - END - ELSIF ch < ":" THEN Number(sym) - ELSIF ch = ":" THEN Texts.Read(R, ch); - IF ch = "=" THEN Texts.Read(R, ch); sym := becomes ELSE sym := colon END - ELSIF ch = ";" THEN Texts.Read(R, ch); sym := semicolon - ELSIF ch = "<" THEN Texts.Read(R, ch); - IF ch = "=" THEN Texts.Read(R, ch); sym := leq ELSE sym := lss END - ELSIF ch = "=" THEN Texts.Read(R, ch); sym := eql - ELSIF ch = ">" THEN Texts.Read(R, ch); - IF ch = "=" THEN Texts.Read(R, ch); sym := geq ELSE sym := gtr END - ELSE (* ? @ *) Texts.Read(R, ch); sym := null - END - ELSIF ch < "[" THEN Identifier(sym) - ELSIF ch < "a" THEN - IF ch = "[" THEN sym := lbrak - ELSIF ch = "]" THEN sym := rbrak - ELSIF ch = "^" THEN sym := arrow - ELSE (* _ ` *) sym := null - END ; - Texts.Read(R, ch) - ELSIF ch < "{" THEN Identifier(sym) ELSE - IF ch = "{" THEN sym := lbrace - ELSIF ch = "}" THEN sym := rbrace - ELSIF ch = "|" THEN sym := bar - ELSIF ch = "~" THEN sym := not - ELSIF ch = 7FX THEN sym := upto - ELSE sym := null - END ; - Texts.Read(R, ch) - END - UNTIL sym # null - END Get; - - PROCEDURE Init*(T: Texts.Text; pos: LONGINT); - BEGIN errpos := pos; errcnt := 0; Texts.OpenReader(R, T, pos); Texts.Read(R, ch) - END Init; - - PROCEDURE EnterKW(sym: INTEGER; name: ARRAY OF CHAR); - BEGIN - (*keyTab[k].id := name; *) - COPY(name, keyTab[k].id); (* voc adaptation by noch *) - keyTab[k].sym := sym; - INC(k) - END EnterKW; - -BEGIN Texts.OpenWriter(W); k := 0; KWX[0] := 0; KWX[1] := 0; - EnterKW(if, "IF"); - EnterKW(do, "DO"); - EnterKW(of, "OF"); - EnterKW(or, "OR"); - EnterKW(to, "TO"); - EnterKW(in, "IN"); - EnterKW(is, "IS"); - EnterKW(by, "BY"); - KWX[2] := k; - EnterKW(end, "END"); - EnterKW(nil, "NIL"); - EnterKW(var, "VAR"); - EnterKW(div, "DIV"); - EnterKW(mod, "MOD"); - EnterKW(for, "FOR"); - KWX[3] := k; - EnterKW(else, "ELSE"); - EnterKW(then, "THEN"); - EnterKW(true, "TRUE"); - EnterKW(type, "TYPE"); - EnterKW(case, "CASE"); - KWX[4] := k; - EnterKW(elsif, "ELSIF"); - EnterKW(false, "FALSE"); - EnterKW(array, "ARRAY"); - EnterKW(begin, "BEGIN"); - EnterKW(const, "CONST"); - EnterKW(until, "UNTIL"); - EnterKW(while, "WHILE"); - KWX[5] := k; - EnterKW(record, "RECORD"); - EnterKW(repeat, "REPEAT"); - EnterKW(return, "RETURN"); - EnterKW(import, "IMPORT"); - EnterKW(module, "MODULE"); - KWX[6] := k; - EnterKW(pointer, "POINTER"); - KWX[7] := k; KWX[8] := k; - EnterKW(procedure, "PROCEDURE"); - KWX[9] := k -END ORS. diff --git a/src/voc07R/ORTool.Mod b/src/voc07R/ORTool.Mod deleted file mode 100644 index e0a08d42..00000000 --- a/src/voc07R/ORTool.Mod +++ /dev/null @@ -1,251 +0,0 @@ -MODULE ORTool; (*NW 18.2.2013*) - IMPORT SYSTEM, Files, Texts, Oberon, ORB; - VAR W: Texts.Writer; - Form: INTEGER; (*result of ReadType*) - mnemo0, mnemo1: ARRAY 16, 4 OF CHAR; (*mnemonics*) - - PROCEDURE Read(VAR R: Files.Rider; VAR n: INTEGER); - VAR b: BYTE; - BEGIN Files.ReadByte(R, b); - IF b < 80H THEN n := b ELSE n := b - 100H END - END Read; - - PROCEDURE ReadType(VAR R: Files.Rider); - VAR key, len, lev, size, off: INTEGER; - ref, mno, class, form, readonly: INTEGER; - name, modname: ARRAY 32 OF CHAR; - BEGIN Read(R, ref); Texts.Write(W, " "); Texts.Write(W, "["); - IF ref < 0 THEN Texts.Write(W, "^"); Texts.WriteInt(W, -ref, 1) - ELSE Texts.WriteInt(W, ref, 1); - Read(R, form); Texts.WriteString(W, " form = "); Texts.WriteInt(W, form, 1); - IF form = ORB.Pointer THEN ReadType(R) - ELSIF form = ORB.Array THEN - ReadType(R); Files.ReadNum(R, len); Files.ReadNum(R, size); - Texts.WriteString(W, " len = "); Texts.WriteInt(W, len, 1); - Texts.WriteString(W, " size = "); Texts.WriteInt(W, size, 1) - ELSIF form = ORB.Record THEN - ReadType(R); (*base type*) - Files.ReadNum(R, off); Texts.WriteString(W, " exno = "); Texts.WriteInt(W, off, 1); - Files.ReadNum(R, off); Texts.WriteString(W, " extlev = "); Texts.WriteInt(W, off, 1); - Files.ReadNum(R, size); Texts.WriteString(W, " size = "); Texts.WriteInt(W, size, 1); - Texts.Write(W, " "); Texts.Write(W, "{"); Read(R, class); - WHILE class # 0 DO (*fields*) - Files.ReadString(R, name); - IF name[0] # 0X THEN Texts.Write(W, " "); Texts.WriteString(W, name); ReadType(R) - ELSE Texts.WriteString(W, " --") - END ; - Files.ReadNum(R, off); Texts.WriteInt(W, off, 4); Read(R, class) - END ; - Texts.Write(W, "}") - ELSIF form = ORB.Proc THEN - ReadType(R); Texts.Write(W, "("); Read(R, class); - WHILE class # 0 DO - Texts.WriteString(W, " class = "); Texts.WriteInt(W, class, 1); Read(R, readonly); - IF readonly = 1 THEN Texts.Write(W, "#") END ; - ReadType(R); Read(R, class) - END ; - Texts.Write(W, ")") - END ; - Files.ReadString(R, modname); - IF modname[0] # 0X THEN - Files.ReadInt(R, key); Files.ReadString(R, name); - Texts.Write(W, " "); Texts.WriteString(W, modname); Texts.Write(W, "."); Texts.WriteString(W, name); - Texts.WriteHex(W, key) - END - END ; - Form := form; Texts.Write(W, "]") - END ReadType; - - PROCEDURE DecSym*; (*decode symbol file*) - VAR class, typno, k: INTEGER; - name: ARRAY 32 OF CHAR; - F: Files.File; R: Files.Rider; - S: Texts.Scanner; - BEGIN Texts.OpenScanner(S, Oberon.Par.text, Oberon.Par.pos); Texts.Scan(S); - IF S.class = Texts.Name THEN - Texts.WriteString(W, "OR-decode "); Texts.WriteString(W, S.s); - Texts.WriteLn(W); Texts.Append(Oberon.Log, W.buf); - F := Files.Old(S.s); - IF F # NIL THEN - Files.Set(R, F, 0); Files.ReadInt(R, k); Files.ReadInt(R, k); - Files.ReadString(R, name); Texts.WriteString(W, name); Texts.WriteHex(W, k); - Read(R, class); Texts.WriteInt(W, class, 3); (*sym file version*) - IF class = ORB.versionkey THEN - Texts.WriteLn(W); Read(R, class); - WHILE class # 0 DO - Texts.WriteInt(W, class, 4); Files.ReadString(R, name); Texts.Write(W, " "); Texts.WriteString(W, name); - ReadType(R); - IF class = ORB.Typ THEN - Texts.Write(W, "("); Read(R, class); - WHILE class # 0 DO (*pointer base fixup*) - Texts.WriteString(W, " ->"); Texts.WriteInt(W, class, 4); Read(R, class) - END ; - Texts.Write(W, ")") - ELSIF (class = ORB.Const) OR (class = ORB.Var) THEN - Files.ReadNum(R, k); Texts.WriteInt(W, k, 5); (*Reals, Strings!*) - END ; - Texts.WriteLn(W); Texts.Append(Oberon.Log, W.buf); - Read(R, class) - END - ELSE Texts.WriteString(W, " bad symfile version") - END - ELSE Texts.WriteString(W, " not found") - END ; - Texts.WriteLn(W); Texts.Append(Oberon.Log, W.buf) - END - END DecSym; - -(* ---------------------------------------------------*) - - PROCEDURE WriteReg(r: LONGINT); - BEGIN Texts.Write(W, " "); - IF r < 12 THEN Texts.WriteString(W, " R"); Texts.WriteInt(W, r MOD 10H, 1) - ELSIF r = 12 THEN Texts.WriteString(W, "MT") - ELSIF r = 13 THEN Texts.WriteString(W, "SB") - ELSIF r = 14 THEN Texts.WriteString(W, "SP") - ELSE Texts.WriteString(W, "LNK") - END - END WriteReg; - - PROCEDURE opcode(w: LONGINT); - VAR k, op, u, a, b, c: LONGINT; - BEGIN - k := w DIV 40000000H MOD 4; - a := w DIV 1000000H MOD 10H; - b := w DIV 100000H MOD 10H; - op := w DIV 10000H MOD 10H; - u := w DIV 20000000H MOD 2; - IF k = 0 THEN - Texts.WriteString(W, mnemo0[op]); - IF u = 1 THEN Texts.Write(W, "'") END ; - WriteReg(a); WriteReg(b); WriteReg(w MOD 10H) - ELSIF k = 1 THEN - Texts.WriteString(W, mnemo0[op]); - IF u = 1 THEN Texts.Write(W, "'") END ; - WriteReg(a); WriteReg(b); w := w MOD 10000H; - IF w >= 8000H THEN w := w - 10000H END ; - Texts.WriteInt(W, w, 7) - ELSIF k = 2 THEN (*LDR/STR*) - IF u = 1 THEN Texts.WriteString(W, "STR ") ELSE Texts.WriteString(W, "LDR") END ; - WriteReg(a); WriteReg(b); w := w MOD 100000H; - IF w >= 80000H THEN w := w - 100000H END ; - Texts.WriteInt(W, w, 8) - ELSIF k = 3 THEN (*Branch instr*) - Texts.Write(W, "B"); - IF ODD(w DIV 10000000H) THEN Texts.Write(W, "L") END ; - Texts.WriteString(W, mnemo1[a]); - IF u = 0 THEN WriteReg(w MOD 10H) ELSE - w := w MOD 100000H; - IF w >= 80000H THEN w := w - 100000H END ; - Texts.WriteInt(W, w, 8) - END - END - END opcode; - - PROCEDURE Sync(VAR R: Files.Rider); - VAR ch: CHAR; - BEGIN Files.Read(R, ch); Texts.WriteString(W, "Sync "); Texts.Write(W, ch); Texts.WriteLn(W) - END Sync; - - PROCEDURE Write(VAR R: Files.Rider; x: INTEGER); - BEGIN Files.WriteByte(R, x) (* -128 <= x < 128 *) - END Write; - - PROCEDURE DecObj*; (*decode object file*) - VAR class, i, n, key, size, fix, adr, data, len: INTEGER; - ch: CHAR; - name: ARRAY 32 OF CHAR; - F: Files.File; R: Files.Rider; - S: Texts.Scanner; - BEGIN Texts.OpenScanner(S, Oberon.Par.text, Oberon.Par.pos); Texts.Scan(S); - IF S.class = Texts.Name THEN - Texts.WriteString(W, "decode "); Texts.WriteString(W, S.s); F := Files.Old(S.s); - IF F # NIL THEN - Files.Set(R, F, 0); Files.ReadString(R, name); Texts.WriteLn(W); Texts.WriteString(W, name); - Files.ReadInt(R, key); Texts.WriteHex(W, key); Read(R, class); Texts.WriteInt(W, class, 4); (*version*) - Files.ReadInt(R, size); Texts.WriteInt(W, size, 6); Texts.WriteLn(W); - Texts.WriteString(W, "imports:"); Texts.WriteLn(W); Files.ReadString(R, name); - WHILE name[0] # 0X DO - Texts.Write(W, 9X); Texts.WriteString(W, name); - Files.ReadInt(R, key); Texts.WriteHex(W, key); Texts.WriteLn(W); - Files.ReadString(R, name) - END ; - (* Sync(R); *) - Texts.WriteString(W, "type descriptors"); Texts.WriteLn(W); - Files.ReadInt(R, n); n := n DIV 4; i := 0; - WHILE i < n DO Files.ReadInt(R, data); Texts.WriteHex(W, data); INC(i) END ; - Texts.WriteLn(W); - Texts.WriteString(W, "data"); Files.ReadInt(R, data); Texts.WriteInt(W, data, 6); Texts.WriteLn(W); - Texts.WriteString(W, "strings"); Texts.WriteLn(W); - Files.ReadInt(R, n); i := 0; - WHILE i < n DO Files.Read(R, ch); Texts.Write(W, ch); INC(i) END ; - Texts.WriteLn(W); - Texts.WriteString(W, "code"); Texts.WriteLn(W); - Files.ReadInt(R, n); i := 0; - WHILE i < n DO - Files.ReadInt(R, data); Texts.WriteInt(W, i, 4); Texts.Write(W, 9X); Texts.WriteHex(W, data); - Texts.Write(W, 9X); opcode(data); Texts.WriteLn(W); INC(i) - END ; - (* Sync(R); *) - Texts.WriteString(W, "commands:"); Texts.WriteLn(W); - Files.ReadString(R, name); - WHILE name[0] # 0X DO - Texts.Write(W, 9X); Texts.WriteString(W, name); - Files.ReadInt(R, adr); Texts.WriteInt(W, adr, 5); Texts.WriteLn(W); - Files.ReadString(R, name) - END ; - (* Sync(R); *) - Texts.WriteString(W, "entries"); Texts.WriteLn(W); - Files.ReadInt(R, n); i := 0; - WHILE i < n DO - Files.ReadInt(R, adr); Texts.WriteInt(W, adr, 6); INC(i) - END ; - Texts.WriteLn(W); - (* Sync(R); *) - Texts.WriteString(W, "pointer refs"); Texts.WriteLn(W); Files.ReadInt(R, adr); - WHILE adr # -1 DO Texts.WriteInt(W, adr, 6); Files.ReadInt(R, adr) END ; - Texts.WriteLn(W); - (* Sync(R); *) - Files.ReadInt(R, data); Texts.WriteString(W, "fixP = "); Texts.WriteInt(W, data, 8); Texts.WriteLn(W); - Files.ReadInt(R, data); Texts.WriteString(W, "fixD = "); Texts.WriteInt(W, data, 8); Texts.WriteLn(W); - Files.ReadInt(R, data); Texts.WriteString(W, "fixT = "); Texts.WriteInt(W, data, 8); Texts.WriteLn(W); - Files.ReadInt(R, data); Texts.WriteString(W, "entry = "); Texts.WriteInt(W, data, 8); Texts.WriteLn(W); - Files.Read(R, ch); - IF ch # "O" THEN Texts.WriteString(W, "format eror"); Texts.WriteLn(W) END - (* Sync(R); *) - ELSE Texts.WriteString(W, " not found"); Texts.WriteLn(W) - END ; - Texts.Append(Oberon.Log, W.buf) - END - END DecObj; - -BEGIN Texts.OpenWriter(W); Texts.WriteString(W, "ORTool 18.2.2013"); - Texts.WriteLn(W); Texts.Append(Oberon.Log, W.buf); - mnemo0[0] := "MOV"; - mnemo0[1] := "LSL"; - mnemo0[2] := "ASR"; - mnemo0[3] := "ROR"; - mnemo0[4] := "AND"; - mnemo0[5] := "ANN"; - mnemo0[6] := "IOR"; - mnemo0[7] := "XOR"; - mnemo0[8] := "ADD"; - mnemo0[9] := "SUB"; - mnemo0[10] := "MUL"; - mnemo0[11] := "DIV"; - mnemo0[12] := "FAD"; - mnemo0[13] := "FSB"; - mnemo0[14] := "FML"; - mnemo0[15] := "FDV"; - mnemo1[0] := "MI "; - mnemo1[8] := "PL"; - mnemo1[1] := "EQ "; - mnemo1[9] := "NE "; - mnemo1[2] := "LS "; - mnemo1[10] := "HI "; - mnemo1[5] := "LT "; - mnemo1[13] := "GE "; - mnemo1[6] := "LE "; - mnemo1[14] := "GT "; - mnemo1[15] := "NO "; -END ORTool. diff --git a/src/voc07R/Oberon.Mod b/src/voc07R/Oberon.Mod deleted file mode 100644 index b2da7dee..00000000 --- a/src/voc07R/Oberon.Mod +++ /dev/null @@ -1,111 +0,0 @@ -MODULE Oberon; - -(* this module emulates Oberon.Log and Oberon.Par in order to pass agruments to Oberon programs, as it's in Oberon environment; - it creates Oberon.Par from command line arguments; - procedure Dump dumps Oberon.Log to standard output. - - -- noch *) - -(* Files are commented out, because it's not necessary for work, but can be very useful for debug. See WriteTextToFile procedure; -- noch *) -IMPORT Args, Strings, Texts := CompatTexts, (*Files := CompatFiles,*) Out := Console; - -VAR Log*: Texts.Text; - - Par*: RECORD - text*: Texts.Text; - pos* : LONGINT; - END; - -arguments : ARRAY 2048 OF CHAR; - -PROCEDURE GetSelection* (VAR text: Texts.Text; VAR beg, end, time: LONGINT); - (*VAR M: SelectionMsg;*) - BEGIN - (*M.time := -1; Viewers.Broadcast(M); time := M.time; - IF time >= 0 THEN text := M.text; beg := M.beg; end := M.end END*) - END GetSelection; - -PROCEDURE Collect*( count : LONGINT); -BEGIN - -END Collect; - -PROCEDURE ArgsToString(VAR opts : ARRAY OF CHAR); -VAR i : INTEGER; - opt : ARRAY 256 OF CHAR; -BEGIN - - i := 1; - opt := ""; COPY ("", opts); - - WHILE i < Args.argc DO - Args.Get(i, opt); - Strings.Append(opt, opts);(* Strings.Append (" ", opts);*) - (* ORP calls Texts.Scan, which returns filename, and nextCh would be set to " " if we append here " ". However after that ORP will check nextCh, and if it finds that nextCh is not "/" it's not gonna parse options. That's why Strings.Append is commented out; -- noch *) - INC(i) - END; - -END ArgsToString; - -PROCEDURE StringToText(VAR arguments : ARRAY OF CHAR; VAR T : Texts.Text); -VAR - W : Texts.Writer; -BEGIN - Texts.OpenWriter(W); - Texts.WriteString(W, arguments); - Texts.Append (T, W.buf); -END StringToText; -(* -PROCEDURE WriteTextToFile(VAR T : Texts.Text; filename : ARRAY OF CHAR); - VAR f : Files.File; r : Files.Rider; -BEGIN - f := Files.New(filename); - Files.Set(r, f, 0); - Texts.Store(r, T); - Files.Register(f); -END WriteTextToFile; -*) -PROCEDURE TextToString(VAR T : Texts.Text; VAR string : ARRAY OF CHAR); - VAR R : Texts.Reader; - ch : CHAR; - i : LONGINT; -BEGIN - COPY("", string); - Texts.OpenReader(R, T, 0); - i := 0; - WHILE Texts.Pos(R) < T.len DO - Texts.Read(R, ch); - string[i] := ch; - INC(i); - END; - (*string[i] := 0X;*) -END TextToString; - -PROCEDURE DumpLog*; -VAR s : POINTER TO ARRAY OF CHAR; -BEGIN - NEW(s, Log.len + 1); - COPY("", s^); - TextToString(Log, s^); - Out.String(s^); Out.Ln; - - NEW(Log); - Texts.Open(Log, ""); -END DumpLog; - - -BEGIN - NEW(Log); - Texts.Open(Log, ""); - - NEW(Par.text); - Texts.Open(Par.text, ""); - Par.pos := 0; - - COPY("", arguments); - ArgsToString(arguments); - StringToText(arguments, Par.text); - (*WriteTextToFile(Par.text, "params.txt");*) - (*WriteTextToFile(Log, "log.txt");*) - (*DumpLog;*) -END Oberon. diff --git a/src/voc07R/Oberon10.Scn.Fnt b/src/voc07R/Oberon10.Scn.Fnt deleted file mode 100644 index 15f999211bf7ec25781c232d43af678d6d0b9385..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2284 zcmaJ?&5qgTsd;#1@;->u+P8+B)H6F z;mUz$*=L!_exIv7P7e~5j$JC(&sSeL>JRe6XKN8@<$jJ*ON91ZewJV4SNTnTmp|lB z`Ahy5`lvKwp?G*MH3M6Xr;$@l{b-|BX$q_^Wijygi10Y6B&1jmTMdtS_P~>Otf96l*%UobPyN{KQ(H!_ zNZH3zjaXQ>PJIwnu1o%y&jMcsjY121ReUY9hq(bSA)N-qE?LV+m#pR3l0{>QzQkr! zWS3$edt*l>Hl|a~zSM{bAF(JKjG*md4hd;SRk-pg3;ha$+%LPMaQ5Z2M3gLL`n1h6 zCwO`f$bCp1@qX#83FxiNTp1_3@v+OLEmz~TC>8u@yT|QRO=C~_yPqxYWM+-`o*WoN zWUfk$r`kRG$Tg_3OV+JVG-A;ktMlb8q43t{87(vOR56nw#xh_2W;__-P2_i!zbMXw zJXtVE3CNq#$HinaLwWj3RK<4674u~#mA{;2=~ryZpGEy*`#&w;Vt&7zLgDnk)wD}~ zk6AP`=W8k-hv+L~s?bk;sLah3Yuh#aoVCf{T4(T5U}@dtT8G8)aN@$lrs;+xU2^obn@lo? z&@>HRZa1-ACnXr$!T*zuv7<(BC&uILLbH8#f!$=hX@9-0s`cwhCalo$l~~jaqka3& z-QC^4-@LiKJ$$|2H%*T;c>6Jdw_`t$l%ekd6fd{5zd2l80s2VL6JFXWl~p0LBsc}Y zKBVWp@c9_UujwSjwxSUMPE>^O>O z`q-r&gS9o>I*a8J$Lg;oa8-^(fNG^e4|M$w^5a{LVWo(1p%PP|h8Ck|@Rh48Q`arB z_1317sC|(|vPouRtm_z4qsNwA)1yUPI4make - -Run -=== - ->./ORP test.Mod /s - -like that. - -you may need symbol (.smb) files from RISC Oberon system in order to write programs that import some modules. - -some answers -============ - -- why Oberon10.Scn.Fnt ? -- it's actually not really necessary. because Texts are patched (test for NIL) to not crash if this file does not exist. however, unless I remove dependency from Fonts.Mod I have decided to keep this file here, and thus my added test for NIL is not necessary, and generated output file is completely correct Oberon Text file. Otherwise it would not contain the font name, for instance. - diff --git a/src/voc07R/makefile b/src/voc07R/makefile deleted file mode 100644 index 5343361c..00000000 --- a/src/voc07R/makefile +++ /dev/null @@ -1,22 +0,0 @@ - -SETPATH = MODULES=".:x86_64" - -VOC0 = $(SETPATH) /opt/voc/bin/voc - -all: - #$(VOC0) -s ORS.Mod - #$(VOC0) -s ORB.Mod - #$(VOC0) -s ORG.Mod - $(VOC0) -s CompatFiles.Mod \ - Fonts.Mod CompatTexts.Mod Oberon.Mod \ - ORS.Mod ORB.Mod ORG.Mod ORP.Mod -M - -test: - ./ORP -s test.Mod - -clean: - rm *.sym - rm *.o - rm *.h - rm *.c - diff --git a/src/voc07R/test/Oberon.rsc b/src/voc07R/test/Oberon.rsc deleted file mode 100644 index d0e49fa8d0fcdda90d1814c62979d5dbe3af6c4b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7295 zcma)B3v69w9sl1)*W0xncU^(Lw%xIob){nsk2vC@=XPZo;Q&P*Vi-w>t6@pq8oG(# zjOTV;z|8Bq#HbJ=XKb295K1J72__JU3KHp6BbA`uD&1NcWQ&ly&0+oh{^$E{Pj6dB zlP~9c{NJzd|J~klZ}0uPc1qh zUieL%y|UsySrE4D!w&@_s_{hjHvAG3U3|e5>%q@Nk}q zNJXTnt^94kXGH1%Cc~GAj04uI0~~NY;$iN69I140o{C7q`IanpKqCVhgHfrEHtkdz zgAr+sh$IgIM#z_Z2v45>oSr^Gy5dzhu)_rB0Nw@}ggm%TN`&%4E^3xP*d&uTUnKI| z+7i7$?@7QN*(j2IT*g2zkfjo`$E3A0Dwko%rkJdaZCsQ1J7n4ym%22F9*IMqh^*~A zH$6Q?`N;3N>FL5U&^jukKKa%fzH!6%&eYNZ_v2kce6jQ zy~6b8vzO&VyM*PWEhr~)(b%SfHk{?Fz-GFyb}NJ3%8lL15r4E@xv||X7qA`T*2H*n z#LlZEiC7KxlRD2I{3P4Mzr)NA#vJetY#p!4aSk0k+6^=^IDgC1L{E&WE&}=|8NQY zg=#M3LCvgiSTA2iJhMJEXq^ab9Mt{<@?qw@2Kfjb6pwlNJA;SVLyZb*a2U^?BQ~@i zTK#T-jO5R}B%QGZ_$N>c$lsn@{ub|@1^8P$dv5t#o2@lAvi?h!)N|$p2I5FiUnSd$ z7=V4E@aq)yL~ePAeFwDz>lwdUUjqidcGTZh(!KvO@axw)6VRlu@0y2ZG(^+NYW+)^ zaYHi!n$@6r_bi${*{Gp;M@Y^!nA6s7e@!k4xdl8fGk$jW)*!!vz2$cAM>RR<TpZ%Yq$XV^ z4Qcu(Oe1_h(#AN14<U3D^f{S_lU1=Z(~x*Tez_F1IIT;iRGfSF)jv;9^D z;+*%U`&?a)cbWUkI^+TG)EfF1I2tQH{X<#o-89#x`6toWXa6jt!;l(1verhAHpG4C zqu!~1IcHxTvD{OiPY}!N{J=<_Wo5F_vtABsPd^Zz zG1pA^*Bf*AX52r{PZzKnbM2-pSLauZvP2{(e!anrsOnV)L zv~*<4LUk%`*4Kd^^+FBsXUXyFxpIVMraZ`van=si?}I=V>emJRxKI7&(5+lGN53## z>RP1PwyLNfX(H#nF2oS@>b!Qiqk#J1U$uZ` z4$B+<(cfllydzJtb*SBt757Ur8;7r=_@b|2Tu8+H)>DSPi0Qvk($T%Fg>o-^Dwm{~qhm-mqa6ed`OJPkKr(u84Ez+qtwW@&r zu(*!<$pT=DYs9((zLedkO&88l_9c=XGQAaZ&waa@a-}htXP!G1tWiIL^|@xgU-7m! z>xvfBpPKc`7R85N3QztvkF8y)6K&xRv{1)v0(YRhuSIJE`C#q2hgy^m*9!YYOAhu{ zx#E#A2lBxO`uo@6u#VyPq2g6vPI)}^`D%CgUTcke_2qh(0Y-g^I2^~B=WY)63HK4~ zu6tj)TxD^;%(G;sC{v%(4rC(kH-fe5fc0kr-TWDO>lK#r+Ba{hP1viI`mGd(_4kaa zk=D2K!JPjTFj5jD-6rq0Aip*uuN~B?A9gr}NRmB!g|i87BNu1!lv8j~ZyK?O{%R_M zm}`a2T1{T^O;>@uj6qiWe*5l!`CGwEoUTXylSTt*AZDkchQ>zNt{t=-d^_;v8uLso z?hW`Wh@I!x2KU$tYxVaO@J-`)8onjvGtYcHCgr z@W&M2@h_uqUS<4NDl^`Cyq7dD0FQd6Yx-c0PS!VT!aB9J2X<_4FY2@uJgrVfKBWb@ ze8|We;JJI+H77CmYwxwnz^T>Tco_3o%!S-Fa3j)~v>$I-$cM95+ zeK%?Rm1X3mBQ_qKW*l_FFEUs zn7N1f^O(PAe((C}xoPdAY<~R&Yx*jBo<55kpKac@z4xYFdj@*tB+9$HYgfPYqd)pW??CTvc?1iTS}`1q zyD<7NhA{YFv!fWtFzBj0#=97k7-ulfW3Uy7V~k-I2Y_%=op&Z+w?{|8A2bu<6~ diff --git a/src/voc07R/test/Oberon.smb b/src/voc07R/test/Oberon.smb deleted file mode 100644 index 148bd4143863ecdd9e2db981b0cf3209b2feb8a9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1372 zcmZuxU2hXd6g_u6t{2w}1_C4y+5n}{0xj)RUy&mhq=ZCG%E#kkkCRo_JJ!xPZg}bM z=x^vRp|3pg-ZrQak%C%Ts!YSZv$g}G(n>pf?$?=n&s_lcva|bQ<%!Ns2BMb9Y`?29 z0=YbHZDB;z)*aL8Tfs8jXE;rsvIkK&&eT!NC?$p z9uM$Zsb<{Pc+GZ{8~xmx9QBBUX4GSh>go|jHN`ys3zg*N@B{C9FYEQ)vfaSR=u|Wm zXfd(9G~U5q&%>o=9(T1^OSGW2O{as=ylR;gqgmC-98Ombn5C3`gx16|KYZGtk zQnV&TL$#%MEdEt0X?yl4ujy2`Tw*dwJQM9Jsw|%ov|py0lnkZhJEa*Dh40N#1)=+ZO(uL-3d3a(3ELENc4aM<|~KA$>NuTU$2hQTCij`uorP2&M6bAtDa$n)QYa` zg{mV%!AqsK2RVLcHpc@Vc$1s|>V%vcGM~DfR%Bo&gZrieZU!7mjQV5SrXwbo4yrbtj-d#s?Hr*iUv&0z$}SOr%}M1 zcV0Dx%-``mPe16c+14U(N!x7-T@PQJz;|`BvFWDx zCqC7>-^pnr;8T)DP2eKM0r@QZ?m*`H)eT$uzi18pfQwbw}eC^9qmmZ8Ehv}8HY0ZIzkJz9}XAy5;&sQ2&&)>aeUOeWuZZ+@OW zLdau{9DB7~kn*U=PHE(!hvBwlEUr@uT24B`ILQjeE2!j6Pa(LR!3Aeq8rPgc+|MI? zSaT4tayBByPRr4_Hguol7~3#mgH%p|K+K{KwWQQzr`kY-;9un3{})sBV_y$u$|-Pn bkhE_@5Tv=DO$5_CHrJTuyVsKU9|YqU*UktpwP}FnQ7A%A8C?F8@ov-=}ZH(2?YYvu}EiNT-vUa7|EU30Rj<)1oihn z_ubW#yr^jA&3pHrbI(2Je?IPcZ*|#?cieWXyYnac!OXxJ&YgeL%{SiaZo2#B@1FmM zw?Me!t>@l!&pPJ{Tr;V^9OF)|W-k4Sluzz~Ez4MRjSKT=y^Q<0#8aQpV(#6A#npXk z@#GWUutx*qu)Z*lCjBHsbp2_Ko;Tabx%_EoojI^=U~tRUfk92>^Zlnwr~IxxyOObP zZtqg(8r)IlD&MJhQ-wv&?Q`zsA#8i8-c{o08%rimV(wXYun7CO%{{SXVrIr&!hU}I z{E~@`b3^Fs$1g3JfLAj7_=q2ahabP;$L-0Oy&r0DQ@fTq_sqenE|qeFtBg0h$|Ks7 z=i;V=+3C%$Qf9A0o;ylRXSs95o!kRo&P@$3&9+U4@dn2AmF)BeR~hStk1M{`xx>06 zrTnSygu_;zXt`f$D1Rr6Q-#oW;lbQuJWcM1$Kf+`Irrw$HybO@Mb1o5pSY zZ%q?9#`3$3kNPowkCidd%J?CUrkf_97s(^fSHE?mu3tKV|BP3D zjLw?n#rJV^zNe?LV7?SxzjR_V`h)dD2b0*@Q6qM+IflQuG@q@;%EkCzzPR3H_hpE6 z_AO!KNaKFtJ4KfI`2jFL$+b-n5I3*8M&{j7(Hjyv@lv{!7(Cm#N$I|HEIU1jZKpB^ zZe`-6Kzdd4sbBUqwvbQxeRbrMY_hpEEtWs>r;Sf>%@9-!&BZLlB?Kf&*78C+NLwqj~)1@S++j947rXvw~W|!aW>5V^D@I+ zH0Qc9EIte^j$U3y?zotkDBJjmUq`%qd6}%mept88VvTi6vnDTEk+uC~i|S5~#T4|F z34Oip(!WoPAC0res9+7;<@}1Ifvb`)w4Kz zDDRpIs%O|yjJ_bfvc>4Z?8JrCE94Awf{oU@&LMDnw4S+)+c^Br%*;{YS3n+@mvvyC ztba^oJ>g}s{$bTXZsX3kk%#XOOO|*f_b7S>pD`|d=GwMt(b3&7 zlg)vS?xm=!4c+slXjR)po;+@Ts%=_!N}l{Yhxej3@XePRkvV66ZyUJgON&$UU|6ar zUW6n2ls})+3!8?Qqmt7yk^+Y7$YXkbP2izIpATq8YYWZSUn&H4%j%q!fb8?0~-(6`2MT6t^m7A%sz_8VXhJ4;3f8W z=)!v6J8WK{{^$CA{a5`yZ(iM(Zt1%Jy6ObjXzrv`t^WmePxve;$j-_`o0A$e+duhO zi^kjWM?-;rrds=Dd-OxilWWiEp0#>y^9S1v18f?X+|Uc@b+Xk7V$hu z+x#!ZuR4^}nct)~!Ef?z*iShq~q0y`IEebnz)xOI7pD=Bqrf&IZW> ziy}3}dJba4o`oO%pY@XMHSm*8%8v`lk1YPZDdi*iHtOy0K02*~c=J7&%?~8=AL#&h ze-7FFdCC069q5`ZN;jLoI+?$*gLsy&E2TQl5%Bl)+Y|cT9r!+r?#cYU$^1Uu!@AB4 z`Qb4rOP)XLZJ&Qg_@C^+Pgy(j4XbCQXR5C{7`+ zk`IRKh8nmc)5qoCb}CP04>)&8?^jKqCp#76l2_JPHuO@HkU4T5{SrQ-ADhjWoP06e zY5tGi?Nm)5=WCxw#=E!+d&sS9m+&d|Qgb+G>V$p3-S{>od;@d&gms*_h^^Z67kyjZOfB%*_MCu|#YbcINrljZT%B%{#*5aNj_R8^VQrMfWJv|=#)jbPh z&pvU~*E2Vdw)9whr}Cxz3fP-|ANMq2VB_l~pP0P4M>VAs{c%r{>%x8(1LDIlsC9k` z2gy*bz&COyXOMjE=X^~ehlYR5ykRz!!!{T9vPS(SweyJ0Uz)QRimun4K5uVMae!ac zXKu`>ZW-S#3Ev%_Pqo+Ld`x3!eURZ&&Y5qb$8&}?u~Alh@Gf-N;^e8EkCSI|miO|z z^f`;(&FC*C^#8DXDf)%vsor^Pn3H)e$cbpL=;rSNi?hb(fx=eoCO{ z6Z)o=hEM39TcKM_d?cY?uu}0}igvHG_zwEWr>6HcqPv)9vlrZapYlcVJIh7m`>K~0 z;w1Wp$+h}ydHH?m;p?;E`>!i4f5dNo`0tg9nPN00d(r2$l_$iG`JsN5#h7ZV`u+{* zW%Jop7N=2eRf4Mx9j3^JC?u?SIiKdnd&Y2Wn)&gY4~3%$d&P4QrH3r6{|`{H1rAAlLX-ubCSg zXReW6_g}qbjl~8<-eLnhPl%2Fd9eY{Bkc7kI6j6C9!I~g+aB+&sqORZ+7oA+yD&V6j$&G%z*8ENVF@Myh zX~))rX{8u^yC_ZTSZDrKjWs!2HFma##=Wdlt^2vX3$xGV>*nJ72kSh(pIT@5;@=bS z;|L03Q zk4F2}gGc`;Jok3G!oBrwaM9lH+B;}L>(Oz)bPVqU*&5iS<)dpUo4h0A$2eNsXShff zXOrn-^IQ828_jcm&dx`DhL7espKQJp-SHPT*>@DnGm~+9pXHj)V%1~y%4c#GNgty> z&}VUeMxFomE==gj?c0mw%Qo@qtk+m__}=04EG*fxkj$6GXEJ}&XK|-_VXyfQx<2@T zHDHu4MLRxZeqcPB#Rt&^A2MI;=3QEt(|1{1)H)01?oTqm-b(p+(gUV#ADkC&vSGlvG1l&ve~95S&trU#)3;^y5o3)!<7azr;hFC^ zM>Vf!euuI67_1Rf9-FD*^TFkR&}9hutou?DH^(L8N@Og-#yu$-{hHD4gvL9{apflZ z4CN}P9zx%udJ4(8j6Og#eN&U(v;LSG-pHPk-;WG*Kc?r?c|I9^x2N_Bv>|BpT}Q60 zLE8fj9go~OmuBB6Rzu@^lzs0s9q-v()e$_0f{xOAH!+bxhMsru9A(_3^jeFIGZGvF zX8%j?9BAll*vlt;>#pugY#gp)v;4H`zN}jio1YB_(khaVfuFB_wB5ID|wdxHsD(>>u=Mt_9H93 z9$#AAXuV=;C?%Vo+-T=R)%2*6%*_)3-`tav}2QNvq$8sV&1XbT6Y)ED#UqU&Zu$i5`mCznZu1bF2%sVt_q` zeQ$E-tSYB5=}6hy&U3IsG1Bk4hE$)WxAbrsw@0}N2FEm(jmWe7lH9aym!QLu#J2O$ zaVt7XkInP=E`V=-Oe~uh6X(Fgw^fS?(Zqi$GV#qEyawP)+eW@t{RpIHQ1ama~BDl=DhG0J@f=xqp@Qz^6{9S z56v|0=KMV3=k;y4%az!dwMFMvJITP;lW8Ba*7lVg`kq&{wvT6O@NqrM=UT72Uu!+N zG^TnD4PCV7N>>m6P9Im3nh#^*c?>%b%U_yPEs{RWRma52WRPk0o6IhgnZ)X(=Cxkq z_mi29=`1qQvAT!kOOMl%xrlR;ytRChT#dQM4LmDfzDFO7Z&_0*hBI|=firy*ead~Q z{~N&Gc>6mu(~JFYou<2bD6lu3)Hel8La&si25NuKynQdYmxnWa72Ol`j zpUlS(8r}?r+te4lzRfC3EljIdCr$ z&wkyqLDLg_i(upD`UXu_c#lPH9Bm);n4U8TR;hREOZFiasxLn6`K6cU zLQE1b4{zZ&p(@|E68V3p`-wfi>F|W<1@6B0S3HEiv{ql7#QyMY^S+JD|2C@l#imEu z!+NoH)6?o|CiiFC4?!=gZ{yE;OZ8gPTk_$hf46VGi*kQ$yrcRK>|Flg%h^}5LXW54 zVWl(gZr01c-*^9@hjL0awaxc{G4-W-ru-%Gc95JVw@035AJrbk4`+eSeD%Ss_4Qll z9}1~9srHwpQ+^+2o^S7+=#$pvO@G$LvW0j(7OYBcNvO}I9>jU&0g_%Q#&GgX%Z&$@*7 z*X%DG!?*6-pzQ5#u)X!%fXzQk@Cv>OIzjg~zOln>?8L_B&{6AxjeJ9~SegIs zBOBp+RC{w4?}>A#3}sx4qu;K^$QOu_3NgaDH8Ko#^bF=t`H;22cU6A~qi?dm=<>IG zFW)_z#7=r2FwuKS?2_|Zwo{Y}z4SneHRkPEJb7qbafhoLx`)0EY{xt7|FRmLXpG|- za6)EP_cPFa3f<9pWCgna4Kf36((|4Kr+}$2YemLyW@glLSbr4w6=%1?PwdT+aSLYcU8+mwF!D4g+F`73lef>KfY;%b(gdhCi)Rm!kIwl+NOIf&6r}S(wr#bBv#_Aat z-22$<-Wm4N|5XJ2&SU@I(pw4F#l$Rk!&v^KFR#Y7V&IL0FZfNo>6kbbo}=&t+0e<) zQ-}Nc-@c#Mm`Bc9(O!Y(s7Iln>#tFdu+_fF&h>eVOUL{ViTT%vd2|}N96Rp%tgXHC6{}%!gP#6Por3eN(OeJjfKL>@(Wt&Klv(Z{!elIM9TTXs1A1 z2JNRcXx-4xh4w;<7GyRjGM`S-&Q4@5PS!n9gC==DU|u$acZ{UB{?0-2=S}x=AwymM zGVe3QhyKsHEME24yemE9)`7%li6(;96}WETx{vEIt_QfDC1d`HmCq7=sv!M%@?JW= z`&hl3FIe|--At$a0w?WGehr=Cx|%NG0j^K*-#qn8(I)4%Wl&^6g`tnno^QJ(+BT>x?stIMHg&JstTlvq6VpJHyO89T~A~?Rf~l9D1Lwi z3qUMbu;3Sf(n3`fi8_TdV}}|EVR>Pnd+y`hIW_=1eOq66qW0nlLOcw19UlqABWFh; z5uzD~Ua*Ozz)*~&DAtrANYU7GLL@^XR2|=GkqhAkkqSu?qOE)t6Dx>ru;YZ=Oe~oe z7%h)gdjfM3;}R7a=-6}jF+S2OkeuDez_4s>Il-oC<4j6l1*~qa(j&w7RETe|^_EoB z!uL^>I8~eQM3sf^O3X{#F)enr>msShmgdaE(xrsS@~>qbQ0)4THz(!^QYsze%r3adCFUWv` z8(ZlAf1bm9`}{}{RV;QmRVIlru~D&W57SP{Q7xh*&F28EvNCDX`Fs)ZRacA HGG_h_Vq;QE diff --git a/src/voc07R/test/readme b/src/voc07R/test/readme deleted file mode 100644 index 9108c517..00000000 --- a/src/voc07R/test/readme +++ /dev/null @@ -1,3 +0,0 @@ -put ORP binary here and run - -> ./ORP Test.Mod diff --git a/src/voc07R/x86/CompatFiles.Mod b/src/voc07R/x86/CompatFiles.Mod deleted file mode 100644 index d7a9c06e..00000000 --- a/src/voc07R/x86/CompatFiles.Mod +++ /dev/null @@ -1,677 +0,0 @@ -MODULE CompatFiles; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files *) -(* modified version of Files, which opens only the file provided and does not scan any path in any environment variable, also ReadLine procedure added; -- noch *) - IMPORT SYSTEM, Unix, Kernel, Args, Console; - - (* standard data type I/O - - little endian, - Sint:1, Int:2, Lint:4 - ORD({0}) = 1, - false = 0, true =1 - IEEE real format, - null terminated strings, - compact numbers according to M.Odersky *) - - - CONST - nofbufs = 4; - bufsize = 4096; - fileTabSize = 64; - noDesc = -1; - notDone = -1; - - (* file states *) - open = 0; create = 1; close = 2; - - - TYPE - FileName = ARRAY 101 OF CHAR; - File* = POINTER TO Handle; - Buffer = POINTER TO BufDesc; - - Handle = RECORD - workName, registerName: FileName; - tempFile: BOOLEAN; - dev, ino, mtime: LONGINT; - fd-, len, pos: LONGINT; - bufs: ARRAY nofbufs OF Buffer; - swapper, state: INTEGER - END ; - - BufDesc = RECORD - f: File; - chg: BOOLEAN; - org, size: LONGINT; - data: ARRAY bufsize OF SYSTEM.BYTE - END ; - - Rider* = RECORD - res*: LONGINT; - eof*: BOOLEAN; - buf: Buffer; - org, offset: LONGINT - END ; - - Time = POINTER TO TimeDesc; - TimeDesc = RECORD - sec*, min*, hour*, mday*, mon*, year*, wday*, isdst*, zone*, gmtoff*: LONGINT; -(* sec*, min*, hour*, mday*, mon*, year*, wday*, isdst*, zone*, gmtoff*: INTEGER;*) - END ; - - VAR - fileTab: ARRAY fileTabSize OF LONGINT (*=File*); - tempno: INTEGER; - -(* for localtime *) - PROCEDURE -includetime() - '#include "time.h"'; - - PROCEDURE -localtime(VAR clock: LONGINT): Time - "(CompatFiles_Time) localtime(clock)"; - - PROCEDURE -getcwd(VAR cwd: Unix.Name) - "getcwd(cwd, cwd__len)"; - - PROCEDURE -IdxTrap "__HALT(-1)"; - - PROCEDURE^ Finalize(o: SYSTEM.PTR); - - PROCEDURE Err(s: ARRAY OF CHAR; f: File; errno: LONGINT); - BEGIN - Console.Ln; Console.String("-- "); Console.String(s); Console.String(": "); - IF f # NIL THEN - IF f.registerName # "" THEN Console.String(f.registerName) ELSE Console.String(f.workName) END - END ; - IF errno # 0 THEN Console.String(" errno = "); Console.Int(errno, 1) END ; - Console.Ln; - HALT(99) - END Err; - - PROCEDURE MakeFileName(dir, name: ARRAY OF CHAR; VAR dest: ARRAY OF CHAR); - VAR i, j: INTEGER; - BEGIN i := 0; j := 0; - WHILE dir[i] # 0X DO dest[i] := dir[i]; INC(i) END ; - IF dest[i-1] # "/" THEN dest[i] := "/"; INC(i) END ; - WHILE name[j] # 0X DO dest[i] := name[j]; INC(i); INC(j) END ; - dest[i] := 0X - END MakeFileName; - - PROCEDURE GetTempName(finalName: ARRAY OF CHAR; VAR name: ARRAY OF CHAR); - VAR n, i, j: LONGINT; - BEGIN - INC(tempno); n := tempno; i := 0; - IF finalName[0] # "/" THEN (* relative pathname *) - WHILE Kernel.CWD[i] # 0X DO name[i] := Kernel.CWD[i]; INC(i) END; - IF Kernel.CWD[i-1] # "/" THEN name[i] := "/"; INC(i) END - END; - j := 0; - WHILE finalName[j] # 0X DO name[i] := finalName[j]; INC(i); INC(j) END; - DEC(i); - WHILE name[i] # "/" DO DEC(i) END; - name[i+1] := "."; name[i+2] := "t"; name[i+3] := "m"; name[i+4] := "p"; name[i+5] := "."; INC(i, 6); - WHILE n > 0 DO name[i] := CHR(n MOD 10 + ORD("0")); n := n DIV 10; INC(i) END; - name[i] := "."; INC(i); n := SHORT(Unix.Getpid()); - WHILE n > 0 DO name[i] := CHR(n MOD 10 + ORD("0")); n := n DIV 10; INC(i) END; - name[i] := 0X - END GetTempName; - - PROCEDURE Create(f: File); - VAR stat: Unix.Status; done: BOOLEAN; - errno: LONGINT; err: ARRAY 32 OF CHAR; - BEGIN - IF f.fd = noDesc THEN - IF f.state = create THEN GetTempName(f.registerName, f.workName); f.tempFile := TRUE - ELSIF f.state = close THEN - f.workName := f.registerName; f.registerName := ""; f.tempFile := FALSE - END ; - errno := Unix.Unlink(f.workName); (*unlink first to avoid stale NFS handles and to avoid reuse of inodes*) - f.fd := Unix.Open(f.workName, Unix.rdwr + Unix.creat + Unix.trunc, {2, 4,5, 7,8}); - done := f.fd >= 0; errno := Unix.errno(); - IF (~done & ((errno = Unix.ENFILE) OR (errno = Unix.EMFILE))) OR (done & (f.fd >= fileTabSize)) THEN - IF done & (f.fd >= fileTabSize) THEN errno := Unix.Close(f.fd) END ; - Kernel.GC(TRUE); - f.fd := Unix.Open(f.workName, Unix.rdwr + Unix.creat + Unix.trunc, {2, 4,5, 7,8}); - done := f.fd >= 0 - END ; - IF done THEN - IF f.fd >= fileTabSize THEN errno := Unix.Close(f.fd); Err("too many files open", f, 0) - ELSE fileTab[f.fd] := SYSTEM.VAL(LONGINT, f); INC(Kernel.nofiles); Kernel.RegisterObject(f, Finalize); - f.state := open; f.pos := 0; errno := Unix.Fstat(f.fd, stat); - f.dev := stat.dev; f.ino := stat.ino; f.mtime := stat.mtime - END - ELSE errno := Unix.errno(); - IF errno = Unix.ENOENT THEN err := "no such directory" - ELSIF (errno = Unix.ENFILE) OR (errno = Unix.EMFILE) THEN err := "too many files open" - ELSE err := "file not created" - END ; - Err(err, f, errno) - END - END - END Create; - - PROCEDURE Flush(buf: Buffer); - VAR res: LONGINT; f: File; stat: Unix.Status; - BEGIN - IF buf.chg THEN f := buf.f; Create(f); - IF buf.org # f.pos THEN res := Unix.Lseek(f.fd, buf.org, 0) END ; - res := Unix.Write(f.fd, SYSTEM.ADR(buf.data), buf.size); - IF res < 0 THEN Err("error in writing file", f, Unix.errno()) END ; - f.pos := buf.org + buf.size; - buf.chg := FALSE; - res := Unix.Fstat(f.fd, stat); - f.mtime := stat.mtime - END - END Flush; - - PROCEDURE Close* (f: File); - VAR i, res: LONGINT; - BEGIN - IF (f.state # create) OR (f.registerName # "") THEN - Create(f); i := 0; - WHILE (i < nofbufs) & (f.bufs[i] # NIL) DO Flush(f.bufs[i]); INC(i) END ; - res := Unix.Fsync(f.fd); - IF res < 0 THEN Err("error in writing file", f, Unix.errno()) END - END - END Close; - - PROCEDURE Length* (f: File): LONGINT; - BEGIN RETURN f.len - END Length; - - PROCEDURE New* (name: ARRAY OF CHAR): File; - VAR f: File; - BEGIN - NEW(f); f.workName := ""; COPY(name, f.registerName); - f.fd := noDesc; f.state := create; f.len := 0; f.pos := 0; f.swapper := -1; (*all f.buf[i] = NIL*) - RETURN f - END New; -(* - PROCEDURE ScanPath(VAR pos: INTEGER; VAR dir: ARRAY OF CHAR); (* supports ~, ~user and blanks inside path *) - VAR i: INTEGER; ch: CHAR; home: ARRAY 256 OF CHAR; - BEGIN - i := 0; ch := Kernel.OBERON[pos]; - WHILE (ch = " ") OR (ch = ":") DO INC(pos); ch := Kernel.OBERON[pos] END ; - IF ch = "~" THEN - INC(pos); ch := Kernel.OBERON[pos]; - home := ""; Args.GetEnv("HOME", home); - WHILE home[i] # 0X DO dir[i] := home[i]; INC(i) END ; - IF (ch # "/") & (ch # 0X) & (ch # ":") & (ch # " ") THEN - WHILE (i > 0) & (dir[i-1] # "/") DO DEC(i) END - END - END ; - WHILE (ch # 0X) & (ch # ":") DO dir[i] := ch; INC(i); INC(pos); ch := Kernel.OBERON[pos] END ; - WHILE (i > 0) & (dir[i-1] = " ") DO DEC(i) END ; - dir[i] := 0X - END ScanPath; -*) - PROCEDURE HasDir(VAR name: ARRAY OF CHAR): BOOLEAN; - VAR i: INTEGER; ch: CHAR; - BEGIN i := 0; ch := name[0]; - WHILE (ch # 0X) & (ch # "/") DO INC(i); ch := name[i] END ; - RETURN ch = "/" - END HasDir; - - PROCEDURE CacheEntry(dev, ino: LONGINT; mtime: LONGINT): File; - VAR f: File; i: INTEGER; stat: Unix.Status; res: LONGINT; - BEGIN i := 0; - WHILE i < fileTabSize DO - f := SYSTEM.VAL(File, fileTab[i]); - IF (f # NIL) & (ino = f.ino) & (dev = f.dev) THEN - IF mtime # f.mtime THEN i := 0; - WHILE i < nofbufs DO - IF f.bufs[i] # NIL THEN f.bufs[i].org := -1; f.bufs[i] := NIL END ; - INC(i) - END ; - f.swapper := -1; f.mtime := mtime; - res := Unix.Fstat(f.fd, stat); f.len := stat.size - END ; - RETURN f - END ; - INC(i) - END ; - RETURN NIL - END CacheEntry; - - PROCEDURE Old* (name: ARRAY OF CHAR): File; - VAR f: File; fd, res, errno: LONGINT; pos: INTEGER; done: BOOLEAN; - dir, path: ARRAY 256 OF CHAR; - stat: Unix.Status; - BEGIN - IF name # "" THEN - IF HasDir(name) THEN dir := ""; COPY(name, path) - ELSE - pos := 0; - COPY(name, path); (* -- noch *) - (*ScanPath(pos, dir);*) (*MakeFileName(dir, name, path);*) (*ScanPath(pos, dir)*) - END ; - LOOP - fd := Unix.Open(path, Unix.rdwr, {}); done := fd >= 0; errno := Unix.errno(); - IF (~done & ((errno = Unix.ENFILE) OR (errno = Unix.EMFILE))) OR (done & (fd >= fileTabSize)) THEN - IF done & (fd >= fileTabSize) THEN res := Unix.Close(fd) END ; - Kernel.GC(TRUE); - fd := Unix.Open(path, Unix.rdwr, {}); - done := fd >= 0; errno := Unix.errno(); - IF ~done & ((errno = Unix.ENFILE) OR (errno = Unix.EMFILE)) THEN Err("too many files open", f, errno) END - END ; - IF ~done & ((errno = Unix.EACCES) OR (errno = Unix.EROFS) OR (errno = Unix.EAGAIN)) THEN - (* errno EAGAIN observed on Solaris 2.4 *) - fd := Unix.Open(path, Unix.rdonly, {}); done := fd >= 0; errno := Unix.errno() - END ; -IF (~done) & (errno # Unix.ENOENT) THEN - Console.String("warning Files.Old "); Console.String(name); - Console.String(" errno = "); Console.Int(errno, 0); Console.Ln; -END ; - IF done THEN - res := Unix.Fstat(fd, stat); - f := CacheEntry(stat.dev, stat.ino, stat.mtime); - IF f # NIL THEN res := Unix.Close(fd); RETURN f - ELSIF fd >= fileTabSize THEN res := Unix.Close(fd); Err("too many files open", f, 0) - ELSE NEW(f); fileTab[fd] := SYSTEM.VAL(LONGINT, f); INC(Kernel.nofiles); Kernel.RegisterObject(f, Finalize); - f.fd := fd; f.state := open; f.len := stat.size; f.pos := 0; f.swapper := -1; (*all f.buf[i] = NIL*) - COPY(name, f.workName); f.registerName := ""; f.tempFile := FALSE; - f.dev := stat.dev; f.ino := stat.ino; f.mtime := stat.mtime; - RETURN f - END - ELSIF dir = "" THEN RETURN NIL - ELSE (*MakeFileName(dir, name, path);*) (*ScanPath(pos, dir)*) - RETURN NIL - END - END - ELSE RETURN NIL - END - END Old; - - PROCEDURE Purge* (f: File); - VAR i: INTEGER; stat: Unix.Status; res: LONGINT; - BEGIN i := 0; - WHILE i < nofbufs DO - IF f.bufs[i] # NIL THEN f.bufs[i].org := -1; f.bufs[i] := NIL END ; - INC(i) - END ; - IF f.fd # noDesc THEN res := Unix.Ftruncate(f.fd, 0); res := Unix.Lseek(f.fd, 0, 0) END ; - f.pos := 0; f.len := 0; f.swapper := -1; - res := Unix.Fstat(f.fd, stat); f.mtime := stat.mtime - END Purge; - - PROCEDURE GetDate* (f: File; VAR t, d: LONGINT); - VAR stat: Unix.Status; clock, res: LONGINT; time: Time; - BEGIN - Create(f); res := Unix.Fstat(f.fd, stat); - time := localtime(stat.mtime); - t := time.sec + ASH(time.min, 6) + ASH(time.hour, 12); - d := time.mday + ASH(time.mon+1, 5) + ASH(time.year MOD 100, 9) - END GetDate; - - PROCEDURE Pos* (VAR r: Rider): LONGINT; - BEGIN RETURN r.org + r.offset - END Pos; - - PROCEDURE Set* (VAR r: Rider; f: File; pos: LONGINT); - VAR org, offset, i, n, res: LONGINT; buf: Buffer; - BEGIN - IF f # NIL THEN - IF pos > f.len THEN pos := f.len ELSIF pos < 0 THEN pos := 0 END ; - offset := pos MOD bufsize; org := pos - offset; i := 0; - WHILE (i < nofbufs) & (f.bufs[i] # NIL) & (org # f.bufs[i].org) DO INC(i) END ; - IF i < nofbufs THEN - IF f.bufs[i] = NIL THEN NEW(buf); buf.chg := FALSE; buf.org := -1; buf.f := f; f.bufs[i] := buf - ELSE buf := f.bufs[i] - END - ELSE - f.swapper := (f.swapper + 1) MOD nofbufs; - buf := f.bufs[f.swapper]; - Flush(buf) - END ; - IF buf.org # org THEN - IF org = f.len THEN buf.size := 0 - ELSE Create(f); - IF f.pos # org THEN res := Unix.Lseek(f.fd, org, 0) END ; - n := Unix.ReadBlk(f.fd, buf.data); - IF n < 0 THEN Err("read from file not done", f, Unix.errno()) END ; - f.pos := org + n; - buf.size := n - END ; - buf.org := org; buf.chg := FALSE - END - ELSE buf := NIL; org := 0; offset := 0 - END ; - r.buf := buf; r.org := org; r.offset := offset; r.eof := FALSE; r.res := 0 - END Set; - - PROCEDURE Read* (VAR r: Rider; VAR x: SYSTEM.BYTE); - VAR offset: LONGINT; buf: Buffer; - BEGIN - buf := r.buf; offset := r.offset; - IF r.org # buf.org THEN Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset END ; - IF (offset < buf.size) THEN - x := buf.data[offset]; r.offset := offset + 1 - ELSIF r.org + offset < buf.f.len THEN - Set(r, r.buf.f, r.org + offset); - x := r.buf.data[0]; r.offset := 1 - ELSE - x := 0X; r.eof := TRUE - END - END Read; - - PROCEDURE ReadBytes* (VAR r: Rider; VAR x: ARRAY OF SYSTEM.BYTE; n: LONGINT); - VAR xpos, min, restInBuf, offset: LONGINT; buf: Buffer; - BEGIN - IF n > LEN(x) THEN IdxTrap END ; - xpos := 0; buf := r.buf; offset := r.offset; - WHILE n > 0 DO - IF (r.org # buf.org) OR (offset >= bufsize) THEN - Set(r, buf.f, r.org + offset); - buf := r.buf; offset := r.offset - END ; - restInBuf := buf.size - offset; - IF restInBuf = 0 THEN r.res := n; r.eof := TRUE; RETURN - ELSIF n > restInBuf THEN min := restInBuf ELSE min := n END ; - SYSTEM.MOVE(SYSTEM.ADR(buf.data) + offset, SYSTEM.ADR(x) + xpos, min); - INC(offset, min); r.offset := offset; INC(xpos, min); DEC(n, min) - END ; - r.res := 0; r.eof := FALSE - END ReadBytes; - - PROCEDURE ReadByte* (VAR r : Rider; VAR x : ARRAY OF SYSTEM.BYTE); - BEGIN - ReadBytes(r, x, 1); - END ReadByte; - - PROCEDURE Base* (VAR r: Rider): File; - BEGIN RETURN r.buf.f - END Base; - - PROCEDURE Write* (VAR r: Rider; x: SYSTEM.BYTE); - VAR buf: Buffer; offset: LONGINT; - BEGIN - buf := r.buf; offset := r.offset; - IF (r.org # buf.org) OR (offset >= bufsize) THEN - Set(r, buf.f, r.org + offset); - buf := r.buf; offset := r.offset - END ; - buf.data[offset] := x; - buf.chg := TRUE; - IF offset = buf.size THEN - INC(buf.size); INC(buf.f.len) - END ; - r.offset := offset + 1; r.res := 0 - END Write; - - PROCEDURE WriteByte* (VAR r : Rider; x : SYSTEM.BYTE); (* added for compatibility with PO 2013, -- noch *) - BEGIN - Write(r, x); - END WriteByte; - - PROCEDURE WriteBytes* (VAR r: Rider; VAR x: ARRAY OF SYSTEM.BYTE; n: LONGINT); - VAR xpos, min, restInBuf, offset: LONGINT; buf: Buffer; - BEGIN - IF n > LEN(x) THEN IdxTrap END ; - xpos := 0; buf := r.buf; offset := r.offset; - WHILE n > 0 DO - IF (r.org # buf.org) OR (offset >= bufsize) THEN - Set(r, buf.f, r.org + offset); - buf := r.buf; offset := r.offset - END ; - restInBuf := bufsize - offset; - IF n > restInBuf THEN min := restInBuf ELSE min := n END ; - SYSTEM.MOVE(SYSTEM.ADR(x) + xpos, SYSTEM.ADR(buf.data) + offset, min); - INC(offset, min); r.offset := offset; - IF offset > buf.size THEN INC(buf.f.len, offset - buf.size); buf.size := offset END ; - INC(xpos, min); DEC(n, min); buf.chg := TRUE - END ; - r.res := 0 - END WriteBytes; - -(* another solution would be one that is similar to ReadBytes, WriteBytes. -No code duplication, more symmetric, only two ifs for -Read and Write in buffer, buf.size replaced by bufsize in Write ops, buf.size and len -must be made consistent with offset (if offset > buf.size) in a lazy way. - -PROCEDURE Write* (VAR r: Rider; x: SYSTEM.BYTE); - VAR buf: Buffer; offset: LONGINT; -BEGIN - buf := r.buf; offset := r.offset; - IF (offset >= bufsize) OR (r.org # buf.org) THEN - Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset; - END ; - buf.data[offset] := x; r.offset := offset + 1; buf.chg := TRUE -END Write; - - -PROCEDURE WriteBytes ... - -PROCEDURE Read* (VAR r: Rider; VAR x: SYSTEM.BYTE); - VAR offset: LONGINT; buf: Buffer; -BEGIN - buf := r.buf; offset := r.offset; - IF (offset >= buf.size) OR (r.org # buf.org) THEN - IF r.org + offset >= buf.f.len THEN x := 0X; r.eof := TRUE; RETURN - ELSE Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset - END - END ; - x := buf.data[offset]; r.offset := offset + 1 -END Read; - -but this would also affect Set, Length, and Flush. -Especially Length would become fairly complex. -*) - - PROCEDURE Delete* (name: ARRAY OF CHAR; VAR res: INTEGER); - BEGIN - res := SHORT(Unix.Unlink(name)); - res := SHORT(Unix.errno()) - END Delete; - - PROCEDURE Rename* (old, new: ARRAY OF CHAR; VAR res: INTEGER); - VAR fdold, fdnew, n, errno, r: LONGINT; - ostat, nstat: Unix.Status; - buf: ARRAY 4096 OF CHAR; - BEGIN - r := Unix.Stat(old, ostat); - IF r >= 0 THEN - r := Unix.Stat(new, nstat); - IF (r >= 0) & ((ostat.dev # nstat.dev) OR (ostat.ino # nstat.ino)) THEN - Delete(new, res); (* work around stale nfs handles *) - END ; - r := Unix.Rename(old, new); - IF r < 0 THEN res := SHORT(Unix.errno()); - IF res = Unix.EXDEV THEN (* cross device link, move the file *) - fdold := Unix.Open(old, Unix.rdonly, {}); - IF fdold < 0 THEN res := 2; RETURN END ; - fdnew := Unix.Open(new, Unix.rdwr + Unix.creat + Unix.trunc, {2, 4,5, 7,8}); - IF fdnew < 0 THEN r := Unix.Close(fdold); res := 3; RETURN END ; - n := Unix.Read(fdold, SYSTEM.ADR(buf), bufsize); - WHILE n > 0 DO - r := Unix.Write(fdnew, SYSTEM.ADR(buf), n); - IF r < 0 THEN errno := Unix.errno(); r := Unix.Close(fdold); r := Unix.Close(fdnew); - Err("cannot move file", NIL, errno) - END ; - n := Unix.Read(fdold, SYSTEM.ADR(buf), bufsize) - END ; - errno := Unix.errno(); - r := Unix.Close(fdold); r := Unix.Close(fdnew); - IF n = 0 THEN r := Unix.Unlink(old); res := 0 - ELSE Err("cannot move file", NIL, errno) - END ; - ELSE RETURN (* res is Unix.Rename return code *) - END - END ; - res := 0 - ELSE res := 2 (* old file not found *) - END - END Rename; - - PROCEDURE Register* (f: File); - VAR idx, errno: INTEGER; f1: File; file: ARRAY 104 OF CHAR; - BEGIN - IF (f.state = create) & (f.registerName # "") THEN f.state := close (* shortcut renaming *) END ; - Close(f); - IF f.registerName # "" THEN - Rename(f.workName, f.registerName, errno); - IF errno # 0 THEN COPY(f.registerName, file); HALT(99) END ; - f.workName := f.registerName; f.registerName := ""; f.tempFile := FALSE - END - END Register; - - PROCEDURE ChangeDirectory*(path: ARRAY OF CHAR; VAR res: INTEGER); - BEGIN - res := SHORT(Unix.Chdir(path)); - getcwd(Kernel.CWD) - END ChangeDirectory; - - PROCEDURE FlipBytes(VAR src, dest: ARRAY OF SYSTEM.BYTE); - VAR i, j: LONGINT; - BEGIN - IF ~Kernel.littleEndian THEN i := LEN(src); j := 0; - WHILE i > 0 DO DEC(i); dest[j] := src[i]; INC(j) END - ELSE SYSTEM.MOVE(SYSTEM.ADR(src), SYSTEM.ADR(dest), LEN(src)) - END - END FlipBytes; - - PROCEDURE ReadBool* (VAR R: Rider; VAR x: BOOLEAN); - BEGIN Read(R, SYSTEM.VAL(CHAR, x)) - END ReadBool; - -(* PROCEDURE ReadInt* (VAR R: Rider; VAR x: INTEGER); - VAR b: ARRAY 2 OF CHAR; - BEGIN ReadBytes(R, b, 2); - x := ORD(b[0]) + ORD(b[1])*256 - END ReadInt; - *) - - PROCEDURE ReadInt* (VAR R: Rider; VAR x: LONGINT); (* to compile OR compiler; -- noch *) - VAR b: ARRAY 4 OF CHAR; - BEGIN ReadBytes(R, b, 4); - x := ORD(b[0]) + ORD(b[1])*100H + ORD(b[2])*10000H + ORD(b[3])*1000000H - END ReadInt; - - PROCEDURE ReadLInt* (VAR R: Rider; VAR x: LONGINT); - VAR b: ARRAY 4 OF CHAR; - BEGIN ReadBytes(R, b, 4); - x := ORD(b[0]) + ORD(b[1])*100H + ORD(b[2])*10000H + ORD(b[3])*1000000H - END ReadLInt; - - PROCEDURE ReadSet* (VAR R: Rider; VAR x: SET); - VAR b: ARRAY 4 OF CHAR; - BEGIN ReadBytes(R, b, 4); - x := SYSTEM.VAL(SET, ORD(b[0]) + ORD(b[1])*100H + ORD(b[2])*10000H + ORD(b[3])*1000000H) - END ReadSet; - - PROCEDURE ReadReal* (VAR R: Rider; VAR x: REAL); - VAR b: ARRAY 4 OF CHAR; - BEGIN ReadBytes(R, b, 4); FlipBytes(b, x) - END ReadReal; - - PROCEDURE ReadLReal* (VAR R: Rider; VAR x: LONGREAL); - VAR b: ARRAY 8 OF CHAR; - BEGIN ReadBytes(R, b, 8); FlipBytes(b, x) - END ReadLReal; - - PROCEDURE ReadString* (VAR R: Rider; VAR x: ARRAY OF CHAR); - VAR i: INTEGER; ch: CHAR; - BEGIN i := 0; - REPEAT Read(R, ch); x[i] := ch; INC(i) UNTIL ch = 0X - END ReadString; - - (* need to read line; -- noch *) - PROCEDURE ReadLine* (VAR R: Rider; VAR x: ARRAY OF CHAR); - VAR i: INTEGER; ch: CHAR; b : BOOLEAN; - BEGIN i := 0; - b := FALSE; - REPEAT - Read(R, ch); - IF ((ch = 0X) OR (ch = 0AX) OR (ch = 0DX)) THEN - b := TRUE - ELSE - x[i] := ch; - INC(i); - END; - UNTIL b - END ReadLine; - - PROCEDURE ReadNum* (VAR R: Rider; VAR x: LONGINT); - VAR s: SHORTINT; ch: CHAR; n: LONGINT; - BEGIN s := 0; n := 0; Read(R, ch); - WHILE ORD(ch) >= 128 DO INC(n, ASH(ORD(ch) - 128, s) ); INC(s, 7); Read(R, ch) END; - INC(n, ASH(ORD(ch) MOD 64 - ORD(ch) DIV 64 * 64, s) ); - x := n - END ReadNum; - - PROCEDURE WriteBool* (VAR R: Rider; x: BOOLEAN); - BEGIN Write(R, SYSTEM.VAL(CHAR, x)) - END WriteBool; - -(* PROCEDURE WriteInt* (VAR R: Rider; x: INTEGER); - VAR b: ARRAY 2 OF CHAR; - BEGIN b[0] := CHR(x); b[1] := CHR(x DIV 256); - WriteBytes(R, b, 2); - END WriteInt; - *) - PROCEDURE WriteInt* (VAR R: Rider; x: LONGINT); (* to compile OR compiler; -- noch *) - VAR b: ARRAY 4 OF CHAR; - BEGIN - b[0] := CHR(x); b[1] := CHR(x DIV 100H); b[2] := CHR(x DIV 10000H); b[3] := CHR(x DIV 1000000H); - WriteBytes(R, b, 4); - END WriteInt; - - PROCEDURE WriteLInt* (VAR R: Rider; x: LONGINT); - VAR b: ARRAY 4 OF CHAR; - BEGIN - b[0] := CHR(x); b[1] := CHR(x DIV 100H); b[2] := CHR(x DIV 10000H); b[3] := CHR(x DIV 1000000H); - WriteBytes(R, b, 4); - END WriteLInt; - - PROCEDURE WriteSet* (VAR R: Rider; x: SET); - VAR b: ARRAY 4 OF CHAR; i: LONGINT; - BEGIN i := SYSTEM.VAL(LONGINT, x); - 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; - - PROCEDURE WriteReal* (VAR R: Rider; x: REAL); - VAR b: ARRAY 4 OF CHAR; - BEGIN FlipBytes(x, b); WriteBytes(R, b, 4) - END WriteReal; - - PROCEDURE WriteLReal* (VAR R: Rider; x: LONGREAL); - VAR b: ARRAY 8 OF CHAR; - BEGIN FlipBytes(x, b); WriteBytes(R, b, 8) - END WriteLReal; - - PROCEDURE WriteString* (VAR R: Rider; x: ARRAY [1] OF CHAR); - VAR i: INTEGER; - BEGIN i := 0; - WHILE x[i] # 0X DO INC(i) END ; - WriteBytes(R, x, i+1) - END WriteString; - - PROCEDURE WriteNum* (VAR R: Rider; x: LONGINT); - BEGIN - WHILE (x < - 64) OR (x > 63) DO Write(R, CHR(x MOD 128 + 128)); x := x DIV 128 END; - Write(R, CHR(x MOD 128)) - END WriteNum; - - PROCEDURE GetName*(f: File; VAR name: ARRAY OF CHAR); - BEGIN - COPY (f.workName, name); - END GetName; - - PROCEDURE Finalize(o: SYSTEM.PTR); - VAR f: File; res: LONGINT; - BEGIN - f := SYSTEM.VAL(File, o); - IF f.fd >= 0 THEN - fileTab[f.fd] := 0; res := Unix.Close(f.fd); f.fd := -1; DEC(Kernel.nofiles); - IF f.tempFile THEN res := Unix.Unlink(f.workName) END - END - END Finalize; - - PROCEDURE Init; - VAR i: LONGINT; - BEGIN - i := 0; WHILE i < fileTabSize DO fileTab[i] := 0; INC(i) END ; - tempno := -1; Kernel.nofiles := 0 - END Init; - -BEGIN Init -END CompatFiles. diff --git a/src/voc07R/x86_64/CompatFiles.Mod b/src/voc07R/x86_64/CompatFiles.Mod deleted file mode 100644 index 785a9666..00000000 --- a/src/voc07R/x86_64/CompatFiles.Mod +++ /dev/null @@ -1,677 +0,0 @@ -MODULE CompatFiles; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files *) -(* modified version of Files, which opens only the file provided and does not scan any path in any environment variable, also ReadLine procedure added; -- noch *) - IMPORT SYSTEM, Unix, Kernel, Args, Console; - - (* standard data type I/O - - little endian, - Sint:1, Int:2, Lint:4 - ORD({0}) = 1, - false = 0, true =1 - IEEE real format, - null terminated strings, - compact numbers according to M.Odersky *) - - - CONST - nofbufs = 4; - bufsize = 4096; - fileTabSize = 64; - noDesc = -1; - notDone = -1; - - (* file states *) - open = 0; create = 1; close = 2; - - - TYPE - FileName = ARRAY 101 OF CHAR; - File* = POINTER TO Handle; - Buffer = POINTER TO BufDesc; - - Handle = RECORD - workName, registerName: FileName; - tempFile: BOOLEAN; - dev, ino, mtime: LONGINT; - fd-: INTEGER; len, pos: LONGINT; - bufs: ARRAY nofbufs OF Buffer; - swapper, state: INTEGER - END ; - - BufDesc = RECORD - f: File; - chg: BOOLEAN; - org, size: LONGINT; - data: ARRAY bufsize OF SYSTEM.BYTE - END ; - - Rider* = RECORD - res*: LONGINT; - eof*: BOOLEAN; - buf: Buffer; - org, offset: LONGINT - END ; - - Time = POINTER TO TimeDesc; - TimeDesc = RECORD - sec*, min*, hour*, mday*, mon*, year*, wday*, isdst*, zone*, gmtoff*: LONGINT; -(* sec*, min*, hour*, mday*, mon*, year*, wday*, isdst*, zone*, gmtoff*: INTEGER;*) - END ; - - VAR - fileTab: ARRAY fileTabSize OF LONGINT (*=File*); - tempno: INTEGER; - -(* for localtime *) - PROCEDURE -includetime() - '#include "time.h"'; - - PROCEDURE -localtime(VAR clock: LONGINT): Time - "(CompatFiles_Time) localtime(clock)"; - - PROCEDURE -getcwd(VAR cwd: Unix.Name) - "getcwd(cwd, cwd__len)"; - - PROCEDURE -IdxTrap "__HALT(-1)"; - - PROCEDURE^ Finalize(o: SYSTEM.PTR); - - PROCEDURE Err(s: ARRAY OF CHAR; f: File; errno: LONGINT); - BEGIN - Console.Ln; Console.String("-- "); Console.String(s); Console.String(": "); - IF f # NIL THEN - IF f.registerName # "" THEN Console.String(f.registerName) ELSE Console.String(f.workName) END - END ; - IF errno # 0 THEN Console.String(" errno = "); Console.Int(errno, 1) END ; - Console.Ln; - HALT(99) - END Err; - - PROCEDURE MakeFileName(dir, name: ARRAY OF CHAR; VAR dest: ARRAY OF CHAR); - VAR i, j: INTEGER; - BEGIN i := 0; j := 0; - WHILE dir[i] # 0X DO dest[i] := dir[i]; INC(i) END ; - IF dest[i-1] # "/" THEN dest[i] := "/"; INC(i) END ; - WHILE name[j] # 0X DO dest[i] := name[j]; INC(i); INC(j) END ; - dest[i] := 0X - END MakeFileName; - - PROCEDURE GetTempName(finalName: ARRAY OF CHAR; VAR name: ARRAY OF CHAR); - VAR n, i, j: LONGINT; - BEGIN - INC(tempno); n := tempno; i := 0; - IF finalName[0] # "/" THEN (* relative pathname *) - WHILE Kernel.CWD[i] # 0X DO name[i] := Kernel.CWD[i]; INC(i) END; - IF Kernel.CWD[i-1] # "/" THEN name[i] := "/"; INC(i) END - END; - j := 0; - WHILE finalName[j] # 0X DO name[i] := finalName[j]; INC(i); INC(j) END; - DEC(i); - WHILE name[i] # "/" DO DEC(i) END; - name[i+1] := "."; name[i+2] := "t"; name[i+3] := "m"; name[i+4] := "p"; name[i+5] := "."; INC(i, 6); - WHILE n > 0 DO name[i] := CHR(n MOD 10 + ORD("0")); n := n DIV 10; INC(i) END; - name[i] := "."; INC(i); n := SHORT(Unix.Getpid()); - WHILE n > 0 DO name[i] := CHR(n MOD 10 + ORD("0")); n := n DIV 10; INC(i) END; - name[i] := 0X - END GetTempName; - - PROCEDURE Create(f: File); - VAR stat: Unix.Status; done: BOOLEAN; - errno: LONGINT; err: ARRAY 32 OF CHAR; - BEGIN - IF f.fd = noDesc THEN - IF f.state = create THEN GetTempName(f.registerName, f.workName); f.tempFile := TRUE - ELSIF f.state = close THEN - f.workName := f.registerName; f.registerName := ""; f.tempFile := FALSE - END ; - errno := Unix.Unlink(f.workName); (*unlink first to avoid stale NFS handles and to avoid reuse of inodes*) - f.fd := Unix.Open(f.workName, SYSTEM.VAL(INTEGER, Unix.rdwr + Unix.creat + Unix.trunc), SYSTEM.VAL(LONGINT, {2, 4,5, 7,8})); - done := f.fd >= 0; errno := Unix.errno(); - IF (~done & ((errno = Unix.ENFILE) OR (errno = Unix.EMFILE))) OR (done & (f.fd >= fileTabSize)) THEN - IF done & (f.fd >= fileTabSize) THEN errno := Unix.Close(f.fd) END ; - Kernel.GC(TRUE); - f.fd := Unix.Open(f.workName, SYSTEM.VAL(INTEGER, Unix.rdwr + Unix.creat + Unix.trunc), SYSTEM.VAL(LONGINT, {2, 4,5, 7,8})); - done := f.fd >= 0 - END ; - IF done THEN - IF f.fd >= fileTabSize THEN errno := Unix.Close(f.fd); Err("too many files open", f, 0) - ELSE fileTab[f.fd] := SYSTEM.VAL(LONGINT, f); INC(Kernel.nofiles); Kernel.RegisterObject(f, Finalize); - f.state := open; f.pos := 0; errno := Unix.Fstat(f.fd, stat); - f.dev := stat.dev; f.ino := stat.ino; f.mtime := stat.mtime - END - ELSE errno := Unix.errno(); - IF errno = Unix.ENOENT THEN err := "no such directory" - ELSIF (errno = Unix.ENFILE) OR (errno = Unix.EMFILE) THEN err := "too many files open" - ELSE err := "file not created" - END ; - Err(err, f, errno) - END - END - END Create; - - PROCEDURE Flush(buf: Buffer); - VAR res: LONGINT; f: File; stat: Unix.Status; - BEGIN - IF buf.chg THEN f := buf.f; Create(f); - IF buf.org # f.pos THEN res := Unix.Lseek(f.fd, buf.org, 0) END ; - res := Unix.Write(f.fd, SYSTEM.ADR(buf.data), buf.size); - IF res < 0 THEN Err("error in writing file", f, Unix.errno()) END ; - f.pos := buf.org + buf.size; - buf.chg := FALSE; - res := Unix.Fstat(f.fd, stat); - f.mtime := stat.mtime - END - END Flush; - - PROCEDURE Close* (f: File); - VAR i, res: LONGINT; - BEGIN - IF (f.state # create) OR (f.registerName # "") THEN - Create(f); i := 0; - WHILE (i < nofbufs) & (f.bufs[i] # NIL) DO Flush(f.bufs[i]); INC(i) END ; - res := Unix.Fsync(f.fd); - IF res < 0 THEN Err("error in writing file", f, Unix.errno()) END - END - END Close; - - PROCEDURE Length* (f: File): LONGINT; - BEGIN RETURN f.len - END Length; - - PROCEDURE New* (name: ARRAY OF CHAR): File; - VAR f: File; - BEGIN - NEW(f); f.workName := ""; COPY(name, f.registerName); - f.fd := noDesc; f.state := create; f.len := 0; f.pos := 0; f.swapper := -1; (*all f.buf[i] = NIL*) - RETURN f - END New; -(* - PROCEDURE ScanPath(VAR pos: INTEGER; VAR dir: ARRAY OF CHAR); (* supports ~, ~user and blanks inside path *) - VAR i: INTEGER; ch: CHAR; home: ARRAY 256 OF CHAR; - BEGIN - i := 0; ch := Kernel.OBERON[pos]; - WHILE (ch = " ") OR (ch = ":") DO INC(pos); ch := Kernel.OBERON[pos] END ; - IF ch = "~" THEN - INC(pos); ch := Kernel.OBERON[pos]; - home := ""; Args.GetEnv("HOME", home); - WHILE home[i] # 0X DO dir[i] := home[i]; INC(i) END ; - IF (ch # "/") & (ch # 0X) & (ch # ":") & (ch # " ") THEN - WHILE (i > 0) & (dir[i-1] # "/") DO DEC(i) END - END - END ; - WHILE (ch # 0X) & (ch # ":") DO dir[i] := ch; INC(i); INC(pos); ch := Kernel.OBERON[pos] END ; - WHILE (i > 0) & (dir[i-1] = " ") DO DEC(i) END ; - dir[i] := 0X - END ScanPath; -*) - PROCEDURE HasDir(VAR name: ARRAY OF CHAR): BOOLEAN; - VAR i: INTEGER; ch: CHAR; - BEGIN i := 0; ch := name[0]; - WHILE (ch # 0X) & (ch # "/") DO INC(i); ch := name[i] END ; - RETURN ch = "/" - END HasDir; - - PROCEDURE CacheEntry(dev, ino: LONGINT; mtime: LONGINT): File; - VAR f: File; i: INTEGER; stat: Unix.Status; res: LONGINT; - BEGIN i := 0; - WHILE i < fileTabSize DO - f := SYSTEM.VAL(File, fileTab[i]); - IF (f # NIL) & (ino = f.ino) & (dev = f.dev) THEN - IF mtime # f.mtime THEN i := 0; - WHILE i < nofbufs DO - IF f.bufs[i] # NIL THEN f.bufs[i].org := -1; f.bufs[i] := NIL END ; - INC(i) - END ; - f.swapper := -1; f.mtime := mtime; - res := Unix.Fstat(f.fd, stat); f.len := stat.size - END ; - RETURN f - END ; - INC(i) - END ; - RETURN NIL - END CacheEntry; - - PROCEDURE Old* (name: ARRAY OF CHAR): File; - VAR f: File; fd, res: INTEGER; errno: LONGINT; pos: INTEGER; done: BOOLEAN; - dir, path: ARRAY 256 OF CHAR; - stat: Unix.Status; - BEGIN - IF name # "" THEN - IF HasDir(name) THEN dir := ""; COPY(name, path) - ELSE - pos := 0; - COPY(name, path); (* -- noch *) - (*ScanPath(pos, dir);*) (*MakeFileName(dir, name, path);*) (*ScanPath(pos, dir)*) - END ; - LOOP - fd := Unix.Open(path, SYSTEM.VAL(INTEGER, Unix.rdwr), (*{}*) 0); done := fd >= 0; errno := Unix.errno(); - IF (~done & ((errno = Unix.ENFILE) OR (errno = Unix.EMFILE))) OR (done & (fd >= fileTabSize)) THEN - IF done & (fd >= fileTabSize) THEN res := Unix.Close(fd) END ; - Kernel.GC(TRUE); - fd := Unix.Open(path, SYSTEM.VAL(INTEGER, Unix.rdwr), (*{}*)0); - done := fd >= 0; errno := Unix.errno(); - IF ~done & ((errno = Unix.ENFILE) OR (errno = Unix.EMFILE)) THEN Err("too many files open", f, errno) END - END ; - IF ~done & ((errno = Unix.EACCES) OR (errno = Unix.EROFS) OR (errno = Unix.EAGAIN)) THEN - (* errno EAGAIN observed on Solaris 2.4 *) - fd := Unix.Open(path, SYSTEM.VAL(INTEGER, Unix.rdonly), (*{}*)0); done := fd >= 0; errno := Unix.errno() - END ; -IF (~done) & (errno # Unix.ENOENT) THEN - Console.String("warning Files.Old "); Console.String(name); - Console.String(" errno = "); Console.Int(errno, 0); Console.Ln; -END ; - IF done THEN - res := Unix.Fstat(fd, stat); - f := CacheEntry(stat.dev, stat.ino, stat.mtime); - IF f # NIL THEN res := Unix.Close(fd); RETURN f - ELSIF fd >= fileTabSize THEN res := Unix.Close(fd); Err("too many files open", f, 0) - ELSE NEW(f); fileTab[fd] := SYSTEM.VAL(LONGINT, f); INC(Kernel.nofiles); Kernel.RegisterObject(f, Finalize); - f.fd := fd; f.state := open; f.len := stat.size; f.pos := 0; f.swapper := -1; (*all f.buf[i] = NIL*) - COPY(name, f.workName); f.registerName := ""; f.tempFile := FALSE; - f.dev := stat.dev; f.ino := stat.ino; f.mtime := stat.mtime; - RETURN f - END - ELSIF dir = "" THEN RETURN NIL - ELSE (*MakeFileName(dir, name, path);*) (*ScanPath(pos, dir)*) - RETURN NIL - END - END - ELSE RETURN NIL - END - END Old; - - PROCEDURE Purge* (f: File); - VAR i: INTEGER; stat: Unix.Status; res: LONGINT; - BEGIN i := 0; - WHILE i < nofbufs DO - IF f.bufs[i] # NIL THEN f.bufs[i].org := -1; f.bufs[i] := NIL END ; - INC(i) - END ; - IF f.fd # noDesc THEN res := Unix.Ftruncate(f.fd, 0); res := Unix.Lseek(f.fd, 0, 0) END ; - f.pos := 0; f.len := 0; f.swapper := -1; - res := Unix.Fstat(f.fd, stat); f.mtime := stat.mtime - END Purge; - - PROCEDURE GetDate* (f: File; VAR t, d: LONGINT); - VAR stat: Unix.Status; clock, res: LONGINT; time: Time; - BEGIN - Create(f); res := Unix.Fstat(f.fd, stat); - time := localtime(stat.mtime); - t := time.sec + ASH(time.min, 6) + ASH(time.hour, 12); - d := time.mday + ASH(time.mon+1, 5) + ASH(time.year MOD 100, 9) - END GetDate; - - PROCEDURE Pos* (VAR r: Rider): LONGINT; - BEGIN RETURN r.org + r.offset - END Pos; - - PROCEDURE Set* (VAR r: Rider; f: File; pos: LONGINT); - VAR org, offset, i, n, res: LONGINT; buf: Buffer; - BEGIN - IF f # NIL THEN - IF pos > f.len THEN pos := f.len ELSIF pos < 0 THEN pos := 0 END ; - offset := pos MOD bufsize; org := pos - offset; i := 0; - WHILE (i < nofbufs) & (f.bufs[i] # NIL) & (org # f.bufs[i].org) DO INC(i) END ; - IF i < nofbufs THEN - IF f.bufs[i] = NIL THEN NEW(buf); buf.chg := FALSE; buf.org := -1; buf.f := f; f.bufs[i] := buf - ELSE buf := f.bufs[i] - END - ELSE - f.swapper := (f.swapper + 1) MOD nofbufs; - buf := f.bufs[f.swapper]; - Flush(buf) - END ; - IF buf.org # org THEN - IF org = f.len THEN buf.size := 0 - ELSE Create(f); - IF f.pos # org THEN res := Unix.Lseek(f.fd, org, 0) END ; - n := Unix.ReadBlk(f.fd, buf.data); - IF n < 0 THEN Err("read from file not done", f, Unix.errno()) END ; - f.pos := org + n; - buf.size := n - END ; - buf.org := org; buf.chg := FALSE - END - ELSE buf := NIL; org := 0; offset := 0 - END ; - r.buf := buf; r.org := org; r.offset := offset; r.eof := FALSE; r.res := 0 - END Set; - - PROCEDURE Read* (VAR r: Rider; VAR x: SYSTEM.BYTE); - VAR offset: LONGINT; buf: Buffer; - BEGIN - buf := r.buf; offset := r.offset; - IF r.org # buf.org THEN Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset END ; - IF (offset < buf.size) THEN - x := buf.data[offset]; r.offset := offset + 1 - ELSIF r.org + offset < buf.f.len THEN - Set(r, r.buf.f, r.org + offset); - x := r.buf.data[0]; r.offset := 1 - ELSE - x := 0X; r.eof := TRUE - END - END Read; - - PROCEDURE ReadBytes* (VAR r: Rider; VAR x: ARRAY OF SYSTEM.BYTE; n: LONGINT); - VAR xpos, min, restInBuf, offset: LONGINT; buf: Buffer; - BEGIN - IF n > LEN(x) THEN IdxTrap END ; - xpos := 0; buf := r.buf; offset := r.offset; - WHILE n > 0 DO - IF (r.org # buf.org) OR (offset >= bufsize) THEN - Set(r, buf.f, r.org + offset); - buf := r.buf; offset := r.offset - END ; - restInBuf := buf.size - offset; - IF restInBuf = 0 THEN r.res := n; r.eof := TRUE; RETURN - ELSIF n > restInBuf THEN min := restInBuf ELSE min := n END ; - SYSTEM.MOVE(SYSTEM.ADR(buf.data) + offset, SYSTEM.ADR(x) + xpos, min); - INC(offset, min); r.offset := offset; INC(xpos, min); DEC(n, min) - END ; - r.res := 0; r.eof := FALSE - END ReadBytes; - - PROCEDURE ReadByte* (VAR r : Rider; VAR x : ARRAY OF SYSTEM.BYTE); - BEGIN - ReadBytes(r, x, 1); - END ReadByte; - - PROCEDURE Base* (VAR r: Rider): File; - BEGIN RETURN r.buf.f - END Base; - - PROCEDURE Write* (VAR r: Rider; x: SYSTEM.BYTE); - VAR buf: Buffer; offset: LONGINT; - BEGIN - buf := r.buf; offset := r.offset; - IF (r.org # buf.org) OR (offset >= bufsize) THEN - Set(r, buf.f, r.org + offset); - buf := r.buf; offset := r.offset - END ; - buf.data[offset] := x; - buf.chg := TRUE; - IF offset = buf.size THEN - INC(buf.size); INC(buf.f.len) - END ; - r.offset := offset + 1; r.res := 0 - END Write; - - PROCEDURE WriteByte* (VAR r : Rider; x : SYSTEM.BYTE); (* added for compatibility with PO 2013, -- noch *) - BEGIN - Write(r, x); - END WriteByte; - - PROCEDURE WriteBytes* (VAR r: Rider; VAR x: ARRAY OF SYSTEM.BYTE; n: LONGINT); - VAR xpos, min, restInBuf, offset: LONGINT; buf: Buffer; - BEGIN - IF n > LEN(x) THEN IdxTrap END ; - xpos := 0; buf := r.buf; offset := r.offset; - WHILE n > 0 DO - IF (r.org # buf.org) OR (offset >= bufsize) THEN - Set(r, buf.f, r.org + offset); - buf := r.buf; offset := r.offset - END ; - restInBuf := bufsize - offset; - IF n > restInBuf THEN min := restInBuf ELSE min := n END ; - SYSTEM.MOVE(SYSTEM.ADR(x) + xpos, SYSTEM.ADR(buf.data) + offset, min); - INC(offset, min); r.offset := offset; - IF offset > buf.size THEN INC(buf.f.len, offset - buf.size); buf.size := offset END ; - INC(xpos, min); DEC(n, min); buf.chg := TRUE - END ; - r.res := 0 - END WriteBytes; - -(* another solution would be one that is similar to ReadBytes, WriteBytes. -No code duplication, more symmetric, only two ifs for -Read and Write in buffer, buf.size replaced by bufsize in Write ops, buf.size and len -must be made consistent with offset (if offset > buf.size) in a lazy way. - -PROCEDURE Write* (VAR r: Rider; x: SYSTEM.BYTE); - VAR buf: Buffer; offset: LONGINT; -BEGIN - buf := r.buf; offset := r.offset; - IF (offset >= bufsize) OR (r.org # buf.org) THEN - Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset; - END ; - buf.data[offset] := x; r.offset := offset + 1; buf.chg := TRUE -END Write; - - -PROCEDURE WriteBytes ... - -PROCEDURE Read* (VAR r: Rider; VAR x: SYSTEM.BYTE); - VAR offset: LONGINT; buf: Buffer; -BEGIN - buf := r.buf; offset := r.offset; - IF (offset >= buf.size) OR (r.org # buf.org) THEN - IF r.org + offset >= buf.f.len THEN x := 0X; r.eof := TRUE; RETURN - ELSE Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset - END - END ; - x := buf.data[offset]; r.offset := offset + 1 -END Read; - -but this would also affect Set, Length, and Flush. -Especially Length would become fairly complex. -*) - - PROCEDURE Delete* (name: ARRAY OF CHAR; VAR res: INTEGER); - BEGIN - res := SHORT(Unix.Unlink(name)); - res := SHORT(Unix.errno()) - END Delete; - - PROCEDURE Rename* (old, new: ARRAY OF CHAR; VAR res: INTEGER); - VAR fdold, fdnew: INTEGER; n, errno, r: LONGINT; - ostat, nstat: Unix.Status; - buf: ARRAY 4096 OF CHAR; - BEGIN - r := Unix.Stat(old, ostat); - IF r >= 0 THEN - r := Unix.Stat(new, nstat); - IF (r >= 0) & ((ostat.dev # nstat.dev) OR (ostat.ino # nstat.ino)) THEN - Delete(new, res); (* work around stale nfs handles *) - END ; - r := Unix.Rename(old, new); - IF r < 0 THEN res := SHORT(Unix.errno()); - IF res = Unix.EXDEV THEN (* cross device link, move the file *) - fdold := Unix.Open(old, SYSTEM.VAL(INTEGER, Unix.rdonly), (*{}*)0); - IF fdold < 0 THEN res := 2; RETURN END ; - fdnew := Unix.Open(new, SYSTEM.VAL(INTEGER, Unix.rdwr + Unix.creat + Unix.trunc), SYSTEM.VAL(LONGINT, {2, 4,5, 7,8})); - IF fdnew < 0 THEN r := Unix.Close(fdold); res := 3; RETURN END ; - n := Unix.Read(fdold, SYSTEM.ADR(buf), bufsize); - WHILE n > 0 DO - r := Unix.Write(fdnew, SYSTEM.ADR(buf), n); - IF r < 0 THEN errno := Unix.errno(); r := Unix.Close(fdold); r := Unix.Close(fdnew); - Err("cannot move file", NIL, errno) - END ; - n := Unix.Read(fdold, SYSTEM.ADR(buf), bufsize) - END ; - errno := Unix.errno(); - r := Unix.Close(fdold); r := Unix.Close(fdnew); - IF n = 0 THEN r := Unix.Unlink(old); res := 0 - ELSE Err("cannot move file", NIL, errno) - END ; - ELSE RETURN (* res is Unix.Rename return code *) - END - END ; - res := 0 - ELSE res := 2 (* old file not found *) - END - END Rename; - - PROCEDURE Register* (f: File); - VAR idx, errno: INTEGER; f1: File; file: ARRAY 104 OF CHAR; - BEGIN - IF (f.state = create) & (f.registerName # "") THEN f.state := close (* shortcut renaming *) END ; - Close(f); - IF f.registerName # "" THEN - Rename(f.workName, f.registerName, errno); - IF errno # 0 THEN COPY(f.registerName, file); HALT(99) END ; - f.workName := f.registerName; f.registerName := ""; f.tempFile := FALSE - END - END Register; - - PROCEDURE ChangeDirectory*(path: ARRAY OF CHAR; VAR res: INTEGER); - BEGIN - res := SHORT(Unix.Chdir(path)); - getcwd(Kernel.CWD) - END ChangeDirectory; - - PROCEDURE FlipBytes(VAR src, dest: ARRAY OF SYSTEM.BYTE); - VAR i, j: LONGINT; - BEGIN - IF ~Kernel.littleEndian THEN i := LEN(src); j := 0; - WHILE i > 0 DO DEC(i); dest[j] := src[i]; INC(j) END - ELSE SYSTEM.MOVE(SYSTEM.ADR(src), SYSTEM.ADR(dest), LEN(src)) - END - END FlipBytes; - - PROCEDURE ReadBool* (VAR R: Rider; VAR x: BOOLEAN); - BEGIN Read(R, SYSTEM.VAL(CHAR, x)) - END ReadBool; - -(* PROCEDURE ReadInt* (VAR R: Rider; VAR x: INTEGER); - VAR b: ARRAY 2 OF CHAR; - BEGIN ReadBytes(R, b, 2); - x := ORD(b[0]) + ORD(b[1])*256 - END ReadInt; - *) - - PROCEDURE ReadInt* (VAR R: Rider; VAR x: LONGINT); (* to compile OR compiler; -- noch *) - VAR b: ARRAY 4 OF CHAR; - BEGIN ReadBytes(R, b, 4); - x := ORD(b[0]) + ORD(b[1])*100H + ORD(b[2])*10000H + ORD(b[3])*1000000H - END ReadInt; - - PROCEDURE ReadLInt* (VAR R: Rider; VAR x: LONGINT); - VAR b: ARRAY 4 OF CHAR; - BEGIN ReadBytes(R, b, 4); - x := ORD(b[0]) + ORD(b[1])*100H + ORD(b[2])*10000H + ORD(b[3])*1000000H - END ReadLInt; - - PROCEDURE ReadSet* (VAR R: Rider; VAR x: SET); - VAR b: ARRAY 4 OF CHAR; - BEGIN ReadBytes(R, b, 4); - x := SYSTEM.VAL(SET, ORD(b[0]) + ORD(b[1])*100H + ORD(b[2])*10000H + ORD(b[3])*1000000H) - END ReadSet; - - PROCEDURE ReadReal* (VAR R: Rider; VAR x: REAL); - VAR b: ARRAY 4 OF CHAR; - BEGIN ReadBytes(R, b, 4); FlipBytes(b, x) - END ReadReal; - - PROCEDURE ReadLReal* (VAR R: Rider; VAR x: LONGREAL); - VAR b: ARRAY 8 OF CHAR; - BEGIN ReadBytes(R, b, 8); FlipBytes(b, x) - END ReadLReal; - - PROCEDURE ReadString* (VAR R: Rider; VAR x: ARRAY OF CHAR); - VAR i: INTEGER; ch: CHAR; - BEGIN i := 0; - REPEAT Read(R, ch); x[i] := ch; INC(i) UNTIL ch = 0X - END ReadString; - - (* need to read line; -- noch *) - PROCEDURE ReadLine* (VAR R: Rider; VAR x: ARRAY OF CHAR); - VAR i: INTEGER; ch: CHAR; b : BOOLEAN; - BEGIN i := 0; - b := FALSE; - REPEAT - Read(R, ch); - IF ((ch = 0X) OR (ch = 0AX) OR (ch = 0DX)) THEN - b := TRUE - ELSE - x[i] := ch; - INC(i); - END; - UNTIL b - END ReadLine; - - PROCEDURE ReadNum* (VAR R: Rider; VAR x: LONGINT); - VAR s: SHORTINT; ch: CHAR; n: LONGINT; - BEGIN s := 0; n := 0; Read(R, ch); - WHILE ORD(ch) >= 128 DO INC(n, ASH(ORD(ch) - 128, s) ); INC(s, 7); Read(R, ch) END; - INC(n, ASH(ORD(ch) MOD 64 - ORD(ch) DIV 64 * 64, s) ); - x := n - END ReadNum; - - PROCEDURE WriteBool* (VAR R: Rider; x: BOOLEAN); - BEGIN Write(R, SYSTEM.VAL(CHAR, x)) - END WriteBool; - -(* PROCEDURE WriteInt* (VAR R: Rider; x: INTEGER); - VAR b: ARRAY 2 OF CHAR; - BEGIN b[0] := CHR(x); b[1] := CHR(x DIV 256); - WriteBytes(R, b, 2); - END WriteInt; - *) - PROCEDURE WriteInt* (VAR R: Rider; x: LONGINT); (* to compile OR compiler; -- noch *) - VAR b: ARRAY 4 OF CHAR; - BEGIN - b[0] := CHR(x); b[1] := CHR(x DIV 100H); b[2] := CHR(x DIV 10000H); b[3] := CHR(x DIV 1000000H); - WriteBytes(R, b, 4); - END WriteInt; - - PROCEDURE WriteLInt* (VAR R: Rider; x: LONGINT); - VAR b: ARRAY 4 OF CHAR; - BEGIN - b[0] := CHR(x); b[1] := CHR(x DIV 100H); b[2] := CHR(x DIV 10000H); b[3] := CHR(x DIV 1000000H); - WriteBytes(R, b, 4); - END WriteLInt; - - PROCEDURE WriteSet* (VAR R: Rider; x: SET); - VAR b: ARRAY 4 OF CHAR; i: LONGINT; - BEGIN i := SYSTEM.VAL(LONGINT, x); - 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; - - PROCEDURE WriteReal* (VAR R: Rider; x: REAL); - VAR b: ARRAY 4 OF CHAR; - BEGIN FlipBytes(x, b); WriteBytes(R, b, 4) - END WriteReal; - - PROCEDURE WriteLReal* (VAR R: Rider; x: LONGREAL); - VAR b: ARRAY 8 OF CHAR; - BEGIN FlipBytes(x, b); WriteBytes(R, b, 8) - END WriteLReal; - - PROCEDURE WriteString* (VAR R: Rider; x: ARRAY [1] OF CHAR); - VAR i: INTEGER; - BEGIN i := 0; - WHILE x[i] # 0X DO INC(i) END ; - WriteBytes(R, x, i+1) - END WriteString; - - PROCEDURE WriteNum* (VAR R: Rider; x: LONGINT); - BEGIN - WHILE (x < - 64) OR (x > 63) DO Write(R, CHR(x MOD 128 + 128)); x := x DIV 128 END; - Write(R, CHR(x MOD 128)) - END WriteNum; - - PROCEDURE GetName*(f: File; VAR name: ARRAY OF CHAR); - BEGIN - COPY (f.workName, name); - END GetName; - - PROCEDURE Finalize(o: SYSTEM.PTR); - VAR f: File; res: LONGINT; - BEGIN - f := SYSTEM.VAL(File, o); - IF f.fd >= 0 THEN - fileTab[f.fd] := 0; res := Unix.Close(f.fd); f.fd := -1; DEC(Kernel.nofiles); - IF f.tempFile THEN res := Unix.Unlink(f.workName) END - END - END Finalize; - - PROCEDURE Init; - VAR i: LONGINT; - BEGIN - i := 0; WHILE i < fileTabSize DO fileTab[i] := 0; INC(i) END ; - tempno := -1; Kernel.nofiles := 0 - END Init; - -BEGIN Init -END CompatFiles. From 047d8b94e70cbf2d1ec86c53e06b10208c84a5a0 Mon Sep 17 00:00:00 2001 From: norayr Date: Tue, 29 Nov 2016 15:00:18 +0400 Subject: [PATCH 350/580] plongrealarray had to be pointer to longrealarray. -- noch --- src/library/ulm/ulmSYSTEM.Mod | 22 ++++++++++++---------- src/library/ulm/ulmTypes.Mod | 8 ++++---- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/src/library/ulm/ulmSYSTEM.Mod b/src/library/ulm/ulmSYSTEM.Mod index ece334a7..3d00abab 100644 --- a/src/library/ulm/ulmSYSTEM.Mod +++ b/src/library/ulm/ulmSYSTEM.Mod @@ -8,7 +8,7 @@ TYPE pchar = POINTER TO ARRAY 1 OF CHAR; TYPE bytearray* = ARRAY SIZE(LONGINT) OF SYSTEM.BYTE; (* need this because voc does not convert implicitly LONGINT to ARRAY OF BYTE; -- noch *) pbytearray* = POINTER TO bytearray; TYPE longrealarray* = ARRAY SIZE(LONGREAL) OF SYSTEM.BYTE; (* need this because voc does not convert implicitly LONGINT to ARRAY OF BYTE; -- noch *) - plongrealarray* = POINTER TO bytearray; + plongrealarray* = POINTER TO longrealarray; PROCEDURE LongToByteArr* ( l : LONGINT; VAR bar : bytearray); (* noch *) VAR b : SYSTEM.BYTE; @@ -23,24 +23,26 @@ TYPE pchar = POINTER TO ARRAY 1 OF CHAR; PROCEDURE LRealToByteArr* ( l : LONGREAL; VAR lar : longrealarray); (* noch *) VAR b : SYSTEM.BYTE; + (*adr: SYSTEM.ADDRESS;*) p : plongrealarray; i : LONGINT; BEGIN p := SYSTEM.VAL(plongrealarray, SYSTEM.ADR(l)); FOR i := 0 TO SIZE(LONGREAL) -1 DO - b := p^[i]; lar[i] := b; + b := p^[i]; + lar[i] := b; END + (* + adr := SYSTEM.ADR(l); + i := 0; + REPEAT + SYSTEM.GET(adr + i, b); + lar[i] := b; + INC(i) + UNTIL i = SIZE(LONGREAL);*) END LRealToByteArr; -(* - PROCEDURE -Write(adr, n: LONGINT): LONGINT - "write(1/*stdout*/, adr, n)"; - - PROCEDURE -read(VAR ch: CHAR): LONGINT - "read(0/*stdin*/, ch, 1)"; -*) - PROCEDURE TAS*(VAR flag:BOOLEAN): BOOLEAN; (* added for compatibility with ulmSYSTEM module; noch *) VAR oldflag : BOOLEAN; BEGIN diff --git a/src/library/ulm/ulmTypes.Mod b/src/library/ulm/ulmTypes.Mod index 93bab9fc..0d09a4f5 100644 --- a/src/library/ulm/ulmTypes.Mod +++ b/src/library/ulm/ulmTypes.Mod @@ -55,13 +55,13 @@ MODULE ulmTypes; UntracedAddress* = POINTER[1] TO UntracedAddressDesc; (*SYS.UNTRACEDADDRESS;*) UntracedAddressDesc* = RECORD[1] END; - Count* = LONGINT; + Count* = SYS.INT32; Size* = Count; Byte* = SYS.BYTE; IntAddress* = LONGINT; - Int8* = SHORTINT; - Int16* = INTEGER; (* No real 16 bit integer type *) - Int32* = INTEGER; + Int8* = SYS.INT8; + Int16* = SYS.INT16; + Int32* = SYS.INT32; Real32* = REAL; Real64* = LONGREAL; From 247852e0b7c413cb93e7af370fe3275050f4f3a4 Mon Sep 17 00:00:00 2001 From: norayr Date: Tue, 29 Nov 2016 16:14:15 +0400 Subject: [PATCH 351/580] fixed overflow in LRealToByteArr; -- noch --- src/library/ulm/ulmSYSTEM.Mod | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/src/library/ulm/ulmSYSTEM.Mod b/src/library/ulm/ulmSYSTEM.Mod index 3d00abab..796a0d1b 100644 --- a/src/library/ulm/ulmSYSTEM.Mod +++ b/src/library/ulm/ulmSYSTEM.Mod @@ -12,34 +12,30 @@ TYPE pchar = POINTER TO ARRAY 1 OF CHAR; PROCEDURE LongToByteArr* ( l : LONGINT; VAR bar : bytearray); (* noch *) VAR b : SYSTEM.BYTE; - p : pbytearray; + adr : SYSTEM.ADDRESS; i : LONGINT; BEGIN - p := SYSTEM.VAL(pbytearray, SYSTEM.ADR(l)); - FOR i := 0 TO SIZE(LONGINT) -1 DO - b := p^[i]; bar[i] := b; - END + adr := SYSTEM.ADR(l); + i := 0; + REPEAT + SYSTEM.GET(adr + i, b); + lar[i] := b; + INC(i) + UNTIL i = SIZE(LONGINT) END LongToByteArr; PROCEDURE LRealToByteArr* ( l : LONGREAL; VAR lar : longrealarray); (* noch *) VAR b : SYSTEM.BYTE; - (*adr: SYSTEM.ADDRESS;*) - p : plongrealarray; + adr: SYSTEM.ADDRESS; i : LONGINT; BEGIN - p := SYSTEM.VAL(plongrealarray, SYSTEM.ADR(l)); - FOR i := 0 TO SIZE(LONGREAL) -1 DO - b := p^[i]; - lar[i] := b; - END - (* adr := SYSTEM.ADR(l); i := 0; REPEAT SYSTEM.GET(adr + i, b); lar[i] := b; INC(i) - UNTIL i = SIZE(LONGREAL);*) + UNTIL i = SIZE(LONGREAL); END LRealToByteArr; From c549f5847be7a73665e765f34dd2b250f19fafd9 Mon Sep 17 00:00:00 2001 From: norayr Date: Tue, 29 Nov 2016 16:45:18 +0400 Subject: [PATCH 352/580] fixed Longint to Byte Arr function; -- noch --- src/library/ulm/ulmPrint.Mod | 1294 ++++++++++++++++----------------- src/library/ulm/ulmSYSTEM.Mod | 3 +- src/library/ulm/ulmTypes.Mod | 74 +- 3 files changed, 682 insertions(+), 689 deletions(-) diff --git a/src/library/ulm/ulmPrint.Mod b/src/library/ulm/ulmPrint.Mod index 756a3813..42f5a7fe 100644 --- a/src/library/ulm/ulmPrint.Mod +++ b/src/library/ulm/ulmPrint.Mod @@ -35,7 +35,7 @@ ---------------------------------------------------------------------------- *) -MODULE ulmPrint; +MODULE Print; (* formatted printing; Print.F[0-9] prints to Streams.stdout @@ -57,13 +57,13 @@ MODULE ulmPrint; ErrorCode* = SHORTINT; ErrorEvent* = POINTER TO ErrorEventRec; ErrorEventRec* = - RECORD - (Events.EventRec) - errorcode*: ErrorCode; - format*: FormatString; - errpos*: LONGINT; - nargs*: INTEGER; - END; + RECORD + (Events.EventRec) + errorcode*: ErrorCode; + format*: FormatString; + errpos*: LONGINT; + nargs*: INTEGER; + END; VAR error*: Events.EventType; errormsg*: ARRAY errors OF Events.Message; @@ -77,887 +77,883 @@ MODULE ulmPrint; errormsg[tooFewArgs] := "too few arguments given"; errormsg[badFormat] := "syntax error in format string"; errormsg[badArgumentSize] := - "size of argument doesn't conform to the corresponding format element"; + "size of argument doesn't conform to the corresponding format element"; END InitErrorHandling; PROCEDURE Out(out: Streams.Stream; VAR fmt: ARRAY OF CHAR; nargs: INTEGER; - VAR p1,p2,p3,p4,p5,p6,p7,p8,p9: ARRAY OF SYS.BYTE; - errors: RelatedEvents.Object); + VAR p1,p2,p3,p4,p5,p6,p7,p8,p9: ARRAY OF BYTE; + errors: RelatedEvents.Object); CONST - maxargs = 9; (* maximal number of arguments *) - maxargsize = SIZE(LONGREAL); (* maximal arg size (except strings) *) - fmtcmd = "%"; - escape = "\"; + maxargs = 9; (* maximal number of arguments *) + maxargsize = SIZE(LONGREAL); (* maximal arg size (except strings) *) + fmtcmd = "%"; + escape = "\"; VAR - arglen: ARRAY maxargs OF LONGINT; - nextarg: INTEGER; - fmtindex: LONGINT; - fmtchar: CHAR; - hexcharval: LONGINT; + arglen: ARRAY maxargs OF LONGINT; + nextarg: INTEGER; + fmtindex: LONGINT; + fmtchar: CHAR; + hexcharval: LONGINT; PROCEDURE Error(errorcode: ErrorCode); - VAR - event: ErrorEvent; + VAR + event: ErrorEvent; BEGIN - NEW(event); - event.type := error; - event.message := errormsg[errorcode]; - event.errorcode := errorcode; - COPY(fmt, event.format); - event.errpos := fmtindex; - event.nargs := nargs; - RelatedEvents.Raise(errors, event); + NEW(event); + event.type := error; + event.message := errormsg[errorcode]; + event.errorcode := errorcode; + COPY(fmt, event.format); + event.errpos := fmtindex; + event.nargs := nargs; + RelatedEvents.Raise(errors, event); END Error; PROCEDURE Next() : BOOLEAN; BEGIN - IF fmtindex < LEN(fmt) THEN - fmtchar := fmt[fmtindex]; INC(fmtindex); - IF fmtchar = 0X THEN - fmtindex := LEN(fmt); - RETURN FALSE - ELSE - RETURN TRUE - END; - ELSE - RETURN FALSE - END; + IF fmtindex < LEN(fmt) THEN + fmtchar := fmt[fmtindex]; INC(fmtindex); + IF fmtchar = 0X THEN + fmtindex := LEN(fmt); + RETURN FALSE + ELSE + RETURN TRUE + END; + ELSE + RETURN FALSE + END; END Next; PROCEDURE Unget; BEGIN - IF (fmtindex > 0) & (fmtindex < LEN(fmt)) THEN - DEC(fmtindex); fmtchar := fmt[fmtindex]; - ELSE - fmtchar := 0X; - END; + IF (fmtindex > 0) & (fmtindex < LEN(fmt)) THEN + DEC(fmtindex); fmtchar := fmt[fmtindex]; + ELSE + fmtchar := 0X; + END; END Unget; - PROCEDURE Write(byte: SYS.BYTE); + PROCEDURE Write(byte: BYTE); BEGIN - IF Streams.WriteByte(out, byte) THEN - INC(out.count); - END; + IF Streams.WriteByte(out, byte) THEN + INC(out.count); + END; END Write; PROCEDURE WriteLn; - VAR - lineterm: StreamDisciplines.LineTerminator; - i: INTEGER; + VAR + lineterm: StreamDisciplines.LineTerminator; + i: INTEGER; BEGIN - StreamDisciplines.GetLineTerm(out, lineterm); - Write(lineterm[0]); - i := 1; - WHILE (i < LEN(lineterm)) & (lineterm[i] # 0X) DO - Write(lineterm[i]); INC(i); - END; + StreamDisciplines.GetLineTerm(out, lineterm); + Write(lineterm[0]); + i := 1; + WHILE (i < LEN(lineterm)) & (lineterm[i] # 0X) DO + Write(lineterm[i]); INC(i); + END; END WriteLn; PROCEDURE Int(VAR int: LONGINT; base: INTEGER) : BOOLEAN; - PROCEDURE ValidDigit(ch: CHAR) : BOOLEAN; - BEGIN - RETURN (ch >= "0") & (ch <= "9") OR - (base = 16) & (CAP(ch) >= "A") & (CAP(ch) <= "F") - END ValidDigit; + PROCEDURE ValidDigit(ch: CHAR) : BOOLEAN; + BEGIN + RETURN (ch >= "0") & (ch <= "9") OR + (base = 16) & (CAP(ch) >= "A") & (CAP(ch) <= "F") + END ValidDigit; BEGIN - int := 0; - REPEAT - int := int * base; - IF (fmtchar >= "0") & (fmtchar <= "9") THEN - INC(int, LONG(ORD(fmtchar) - ORD("0"))); - ELSIF (base = 16) & - (CAP(fmtchar) >= "A") & (CAP(fmtchar) <= "F") THEN - INC(int, LONG(10 + ORD(CAP(fmtchar)) - ORD("A"))); - ELSE - RETURN FALSE - END; - UNTIL ~Next() OR ~ValidDigit(fmtchar); - RETURN TRUE + int := 0; + REPEAT + int := int * base; + IF (fmtchar >= "0") & (fmtchar <= "9") THEN + INC(int, ORD(fmtchar) - ORD("0")); + ELSIF (base = 16) & + (CAP(fmtchar) >= "A") & (CAP(fmtchar) <= "F") THEN + INC(int, 10 + ORD(CAP(fmtchar)) - ORD("A")); + ELSE + RETURN FALSE + END; + UNTIL ~Next() OR ~ValidDigit(fmtchar); + RETURN TRUE END Int; PROCEDURE SetSize; - VAR - index: INTEGER; + VAR + index: INTEGER; BEGIN - index := 0; - WHILE index < nargs DO - CASE index OF - | 0: arglen[index] := LEN(p1); - | 1: arglen[index] := LEN(p2); - | 2: arglen[index] := LEN(p3); - | 3: arglen[index] := LEN(p4); - | 4: arglen[index] := LEN(p5); - | 5: arglen[index] := LEN(p6); - | 6: arglen[index] := LEN(p7); - | 7: arglen[index] := LEN(p8); - | 8: arglen[index] := LEN(p9); - ELSE - END; - INC(index); - END; + index := 0; + WHILE index < nargs DO + CASE index OF + | 0: arglen[index] := LEN(p1); + | 1: arglen[index] := LEN(p2); + | 2: arglen[index] := LEN(p3); + | 3: arglen[index] := LEN(p4); + | 4: arglen[index] := LEN(p5); + | 5: arglen[index] := LEN(p6); + | 6: arglen[index] := LEN(p7); + | 7: arglen[index] := LEN(p8); + | 8: arglen[index] := LEN(p9); + END; + INC(index); + END; END SetSize; - PROCEDURE Access(par: INTEGER; at: LONGINT) : SYS.BYTE; + PROCEDURE Access(par: INTEGER; at: LONGINT) : BYTE; BEGIN - CASE par OF - | 0: RETURN p1[at] - | 1: RETURN p2[at] - | 2: RETURN p3[at] - | 3: RETURN p4[at] - | 4: RETURN p5[at] - | 5: RETURN p6[at] - | 6: RETURN p7[at] - | 7: RETURN p8[at] - | 8: RETURN p9[at] - ELSE - END; + CASE par OF + | 0: RETURN p1[at] + | 1: RETURN p2[at] + | 2: RETURN p3[at] + | 3: RETURN p4[at] + | 4: RETURN p5[at] + | 5: RETURN p6[at] + | 6: RETURN p7[at] + | 7: RETURN p8[at] + | 8: RETURN p9[at] + END; END Access; - PROCEDURE Convert(from: INTEGER; VAR to: ARRAY OF SYS.BYTE); - VAR i: INTEGER; + PROCEDURE Convert(from: INTEGER; VAR to: ARRAY OF BYTE); + VAR i: INTEGER; BEGIN - i := 0; - WHILE i < arglen[from] DO - to[i] := Access(from, i); INC(i); - END; + i := 0; + WHILE i < arglen[from] DO + to[i] := Access(from, i); INC(i); + END; END Convert; PROCEDURE GetInt(index: INTEGER; VAR long: LONGINT) : BOOLEAN; - (* access index-th parameter (counted from 0); - fails if arglen[index] > SIZE(LONGINT) - *) - VAR - short: SHORTINT; - (*int16: SYS.INT16;*) - int: INTEGER; - + (* access index-th parameter (counted from 0); + fails if arglen[index] > SYS.SIZE(LONGINT) + *) + VAR + short: SHORTINT; + int16: SYS.INT16; + int: INTEGER; + BEGIN - IF arglen[index] = SIZE(SHORTINT) THEN - Convert(index, short); long := short; - (*ELSIF arglen[index] = SIZE(SYS.INT16) THEN - Convert(index, int16); long := int16;*) - ELSIF arglen[index] = SIZE(INTEGER) THEN - Convert(index, int); long := int; - ELSIF arglen[index] = SIZE(LONGINT) THEN - Convert(index, long); - ELSE - Error(badArgumentSize); - RETURN FALSE - END; - RETURN TRUE + IF arglen[index] = SIZE(SHORTINT) THEN + Convert(index, short); long := short; + ELSIF arglen[index] = SIZE(SYS.INT16) THEN + Convert(index, int16); long := int16; + ELSIF arglen[index] = SIZE(INTEGER) THEN + Convert(index, int); long := int; + ELSIF arglen[index] = SIZE(LONGINT) THEN + Convert(index, long); + ELSE + Error(badArgumentSize); + RETURN FALSE + END; + RETURN TRUE END GetInt; PROCEDURE Format() : BOOLEAN; - VAR - fillch: CHAR; (* filling character *) - insert: BOOLEAN; (* insert between sign and 1st digit *) - sign: BOOLEAN; (* sign even positive values *) - leftaligned: BOOLEAN; (* output left aligned *) - width, scale: LONGINT; + VAR + fillch: CHAR; (* filling character *) + insert: BOOLEAN; (* insert between sign and 1st digit *) + sign: BOOLEAN; (* sign even positive values *) + leftaligned: BOOLEAN; (* output left aligned *) + width, scale: LONGINT; - PROCEDURE NextArg(VAR index: INTEGER) : BOOLEAN; - BEGIN - IF nextarg < nargs THEN - index := nextarg; INC(nextarg); RETURN TRUE - ELSE - RETURN FALSE - END; - END NextArg; + PROCEDURE NextArg(VAR index: INTEGER) : BOOLEAN; + BEGIN + IF nextarg < nargs THEN + index := nextarg; INC(nextarg); RETURN TRUE + ELSE + RETURN FALSE + END; + END NextArg; - PROCEDURE Flags() : BOOLEAN; - BEGIN - fillch := " "; insert := FALSE; sign := FALSE; - leftaligned := FALSE; - REPEAT - CASE fmtchar OF - | "+": sign := TRUE; - | "0": fillch := "0"; insert := TRUE; - | "-": leftaligned := TRUE; - | "^": insert := TRUE; - | "\": IF ~Next() THEN RETURN FALSE END; fillch := fmtchar; - ELSE - RETURN TRUE - END; - UNTIL ~Next(); - Error(badFormat); - RETURN FALSE (* unexpected end *) - END Flags; + PROCEDURE Flags() : BOOLEAN; + BEGIN + fillch := " "; insert := FALSE; sign := FALSE; + leftaligned := FALSE; + REPEAT + CASE fmtchar OF + | "+": sign := TRUE; + | "0": fillch := "0"; insert := TRUE; + | "-": leftaligned := TRUE; + | "^": insert := TRUE; + | "\": IF ~Next() THEN RETURN FALSE END; fillch := fmtchar; + ELSE + RETURN TRUE + END; + UNTIL ~Next(); + Error(badFormat); + RETURN FALSE (* unexpected end *) + END Flags; - PROCEDURE FetchInt(VAR int: LONGINT) : BOOLEAN; - VAR - index: INTEGER; - BEGIN - RETURN (fmtchar = "*") & Next() & - NextArg(index) & GetInt(index, int) OR - Int(int, 10) & (int >= 0) - END FetchInt; + PROCEDURE FetchInt(VAR int: LONGINT) : BOOLEAN; + VAR + index: INTEGER; + BEGIN + RETURN (fmtchar = "*") & Next() & + NextArg(index) & GetInt(index, int) OR + Int(int, 10) & (int >= 0) + END FetchInt; - PROCEDURE Width() : BOOLEAN; - BEGIN - IF (fmtchar >= "0") & (fmtchar <= "9") OR (fmtchar = "*") THEN - IF FetchInt(width) THEN - RETURN TRUE - END; - Error(badFormat); RETURN FALSE - ELSE - width := 0; - RETURN TRUE - END; - END Width; + PROCEDURE Width() : BOOLEAN; + BEGIN + IF (fmtchar >= "0") & (fmtchar <= "9") OR (fmtchar = "*") THEN + IF FetchInt(width) THEN + RETURN TRUE + END; + Error(badFormat); RETURN FALSE + ELSE + width := 0; + RETURN TRUE + END; + END Width; - PROCEDURE Scale() : BOOLEAN; - BEGIN - IF fmtchar = "." THEN - IF Next() & FetchInt(scale) THEN - RETURN TRUE - ELSE - Error(badFormat); RETURN FALSE - END; - ELSE - scale := -1; RETURN TRUE - END; - END Scale; + PROCEDURE Scale() : BOOLEAN; + BEGIN + IF fmtchar = "." THEN + IF Next() & FetchInt(scale) THEN + RETURN TRUE + ELSE + Error(badFormat); RETURN FALSE + END; + ELSE + scale := -1; RETURN TRUE + END; + END Scale; - PROCEDURE Conversion() : BOOLEAN; + PROCEDURE Conversion() : BOOLEAN; - PROCEDURE Fill(cnt: LONGINT); - (* cnt: space used by normal output *) - VAR i: LONGINT; - BEGIN - IF cnt < width THEN - i := width - cnt; - WHILE i > 0 DO - Write(fillch); - DEC(i); - END; - END; - END Fill; + PROCEDURE Fill(cnt: LONGINT); + (* cnt: space used by normal output *) + VAR i: LONGINT; + BEGIN + IF cnt < width THEN + i := width - cnt; + WHILE i > 0 DO + Write(fillch); + DEC(i); + END; + END; + END Fill; - PROCEDURE FillLeft(cnt: LONGINT); - BEGIN - IF ~leftaligned THEN - Fill(cnt); - END; - END FillLeft; + PROCEDURE FillLeft(cnt: LONGINT); + BEGIN + IF ~leftaligned THEN + Fill(cnt); + END; + END FillLeft; - PROCEDURE FillRight(cnt: LONGINT); - BEGIN - IF leftaligned THEN - Fill(cnt); - END; - END FillRight; + PROCEDURE FillRight(cnt: LONGINT); + BEGIN + IF leftaligned THEN + Fill(cnt); + END; + END FillRight; - PROCEDURE WriteBool(true, false: ARRAY OF CHAR) : BOOLEAN; - VAR index: INTEGER; val: LONGINT; + PROCEDURE WriteBool(true, false: ARRAY OF CHAR) : BOOLEAN; + VAR index: INTEGER; val: LONGINT; - PROCEDURE WriteString(VAR s: ARRAY OF CHAR); - VAR i, len: INTEGER; - BEGIN - len := 0; - WHILE (len < LEN(s)) & (s[len] # 0X) DO - INC(len); - END; - FillLeft(len); - i := 0; - WHILE i < len DO - Write(s[i]); INC(i); - END; - FillRight(len); - END WriteString; + PROCEDURE WriteString(VAR s: ARRAY OF CHAR); + VAR i, len: INTEGER; + BEGIN + len := 0; + WHILE (len < LEN(s)) & (s[len] # 0X) DO + INC(len); + END; + FillLeft(len); + i := 0; + WHILE i < len DO + Write(s[i]); INC(i); + END; + FillRight(len); + END WriteString; - BEGIN - IF NextArg(index) & GetInt(index, val) THEN - IF val = 0 THEN - WriteString(false); RETURN TRUE - ELSIF val = 1 THEN - WriteString(true); RETURN TRUE - END; - END; - RETURN FALSE - END WriteBool; + BEGIN + IF NextArg(index) & GetInt(index, val) THEN + IF val = 0 THEN + WriteString(false); RETURN TRUE + ELSIF val = 1 THEN + WriteString(true); RETURN TRUE + END; + END; + RETURN FALSE + END WriteBool; - PROCEDURE WriteChar() : BOOLEAN; - VAR - val: LONGINT; - index: INTEGER; - BEGIN - IF NextArg(index) & GetInt(index, val) & - (val >= 0) & (val <= ORD(MAX(CHAR))) THEN - FillLeft(1); - Write(CHR(val)); - FillRight(1); - RETURN TRUE - END; - RETURN FALSE - END WriteChar; + PROCEDURE WriteChar() : BOOLEAN; + VAR + val: LONGINT; + index: INTEGER; + BEGIN + IF NextArg(index) & GetInt(index, val) & + (val >= 0) & (val <= ORD(MAX(CHAR))) THEN + FillLeft(1); + Write(CHR(val)); + FillRight(1); + RETURN TRUE + END; + RETURN FALSE + END WriteChar; - PROCEDURE WriteInt(base: INTEGER) : BOOLEAN; - VAR - index: INTEGER; - val: LONGINT; - neg: BOOLEAN; (* set by Convert *) - buf: ARRAY 12 OF CHAR; (* filled by Convert *) - i: INTEGER; - len: INTEGER; (* space needed for val *) - signcnt: INTEGER; (* =1 if sign printed; else 0 *) - signch: CHAR; + PROCEDURE WriteInt(base: INTEGER) : BOOLEAN; + VAR + index: INTEGER; + val: LONGINT; + neg: BOOLEAN; (* set by Convert *) + buf: ARRAY 12 OF CHAR; (* filled by Convert *) + i: INTEGER; + len: INTEGER; (* space needed for val *) + signcnt: INTEGER; (* =1 if sign printed; else 0 *) + signch: CHAR; - PROCEDURE Convert; - VAR - index: INTEGER; - digit: LONGINT; - BEGIN - neg := val < 0; - index := 0; - REPEAT - digit := val MOD base; - val := val DIV base; - IF neg & (digit > 0) THEN - digit := base - digit; - INC(val); - END; - IF digit < 10 THEN - buf[index] := CHR(ORD("0") + digit); - ELSE - buf[index] := CHR(ORD("A") + digit - 10); - END; - INC(index); - UNTIL val = 0; - len := index; - END Convert; + PROCEDURE Convert; + VAR + index: INTEGER; + digit: LONGINT; + BEGIN + neg := val < 0; + index := 0; + REPEAT + digit := val MOD base; + val := val DIV base; + IF neg & (digit > 0) THEN + digit := base - digit; + INC(val); + END; + IF digit < 10 THEN + buf[index] := CHR(ORD("0") + digit); + ELSE + buf[index] := CHR(ORD("A") + digit - 10); + END; + INC(index); + UNTIL val = 0; + len := index; + END Convert; - BEGIN (* WriteInt *) - IF NextArg(index) & GetInt(index, val) THEN - Convert; - IF sign OR neg THEN - signcnt := 1; - IF neg THEN - signch := "-"; - ELSE - signch := "+"; - END; - ELSE - signcnt := 0; - END; - IF insert & (signcnt = 1) THEN - Write(signch); - END; - FillLeft(len+signcnt); - IF ~insert & (signcnt = 1) THEN - Write(signch); - END; - i := len; - WHILE i > 0 DO - DEC(i); Write(buf[i]); - END; - FillRight(len+signcnt); - RETURN TRUE - END; - RETURN FALSE - END WriteInt; + BEGIN (* WriteInt *) + IF NextArg(index) & GetInt(index, val) THEN + Convert; + IF sign OR neg THEN + signcnt := 1; + IF neg THEN + signch := "-"; + ELSE + signch := "+"; + END; + ELSE + signcnt := 0; + END; + IF insert & (signcnt = 1) THEN + Write(signch); + END; + FillLeft(len+signcnt); + IF ~insert & (signcnt = 1) THEN + Write(signch); + END; + i := len; + WHILE i > 0 DO + DEC(i); Write(buf[i]); + END; + FillRight(len+signcnt); + RETURN TRUE + END; + RETURN FALSE + END WriteInt; - PROCEDURE WriteReal(format: CHAR) : BOOLEAN; - (* format either "f", "e", or "g" *) - CONST - defaultscale = 6; - VAR - index: INTEGER; - lr: LONGREAL; - r: REAL; - shortint: SHORTINT; int: INTEGER; longint: LONGINT; - (*int16: SYS.INT16;*) - long: BOOLEAN; - exponent: INTEGER; - mantissa: LONGREAL; - digits: ARRAY Reals.maxlongdignum OF CHAR; - neg: BOOLEAN; - ndigits: INTEGER; - decpt: INTEGER; + PROCEDURE WriteReal(format: CHAR) : BOOLEAN; + (* format either "f", "e", or "g" *) + CONST + defaultscale = 6; + VAR + index: INTEGER; + lr: LONGREAL; + r: REAL; + shortint: SHORTINT; int: INTEGER; longint: LONGINT; + int16: SYS.INT16; + long: BOOLEAN; + exponent: INTEGER; + mantissa: LONGREAL; + digits: ARRAY Reals.maxlongdignum OF CHAR; + neg: BOOLEAN; + ndigits: INTEGER; + decpt: INTEGER; - PROCEDURE Print(decpt: INTEGER; withexp: BOOLEAN; exp: INTEGER); - (* decpt: position of decimal point - = 0: just before the digits - > 0: after decpt digits - < 0: ABS(decpt) zeroes before digits needed - *) - VAR - needed: INTEGER; (* space needed *) - index: INTEGER; - count: LONGINT; + PROCEDURE Print(decpt: INTEGER; withexp: BOOLEAN; exp: INTEGER); + (* decpt: position of decimal point + = 0: just before the digits + > 0: after decpt digits + < 0: ABS(decpt) zeroes before digits needed + *) + VAR + needed: INTEGER; (* space needed *) + index: INTEGER; + count: LONGINT; - PROCEDURE WriteExp(exp: INTEGER); - CONST - base = 10; - VAR - power: INTEGER; - digit: INTEGER; - BEGIN - IF long THEN - Write("D"); - ELSE - Write("E"); - END; - IF exp < 0 THEN - Write("-"); exp := - exp; - ELSE - Write("+"); - END; - IF long THEN - power := 1000; - ELSE - power := 100; - END; - WHILE power > 0 DO - digit := (exp DIV power) MOD base; - Write(CHR(digit+ORD("0"))); - power := power DIV base; - END; - END WriteExp; + PROCEDURE WriteExp(exp: INTEGER); + CONST + base = 10; + VAR + power: INTEGER; + digit: INTEGER; + BEGIN + IF long THEN + Write("D"); + ELSE + Write("E"); + END; + IF exp < 0 THEN + Write("-"); exp := - exp; + ELSE + Write("+"); + END; + IF long THEN + power := 1000; + ELSE + power := 100; + END; + WHILE power > 0 DO + digit := (exp DIV power) MOD base; + Write(CHR(digit+ORD("0"))); + power := power DIV base; + END; + END WriteExp; - BEGIN (* Print *) - (* leading digits *) - IF decpt > 0 THEN - needed := decpt; - ELSE - needed := 1; - END; - IF neg OR sign THEN - INC(needed); - END; - IF withexp OR (scale # 0) THEN - INC(needed); (* decimal point *) - END; - IF withexp THEN - INC(needed, 2); (* E[+-] *) - IF long THEN - INC(needed, 4); - ELSE - INC(needed, 3); - END; - END; - INC(needed, SHORT(scale)); + BEGIN (* Print *) + (* leading digits *) + IF decpt > 0 THEN + needed := decpt; + ELSE + needed := 1; + END; + IF neg OR sign THEN + INC(needed); + END; + IF withexp OR (scale # 0) THEN + INC(needed); (* decimal point *) + END; + IF withexp THEN + INC(needed, 2); (* E[+-] *) + IF long THEN + INC(needed, 4); + ELSE + INC(needed, 3); + END; + END; + INC(needed, scale); - FillLeft(needed); - IF neg THEN - Write("-"); - ELSIF sign THEN - Write("+"); - END; - IF decpt <= 0 THEN - Write("0"); - ELSE - index := 0; - WHILE index < decpt DO - IF index < ndigits THEN - Write(digits[index]); - ELSE - Write("0"); - END; - INC(index); - END; - END; - IF withexp OR (scale > 0) THEN - Write("."); - END; - IF scale > 0 THEN - count := scale; - index := decpt; - WHILE (index < 0) & (count > 0) DO - Write("0"); INC(index); DEC(count); - END; - WHILE (index < ndigits) & (count > 0) DO - Write(digits[index]); INC(index); DEC(count); - END; - WHILE count > 0 DO - Write("0"); DEC(count); - END; - END; - IF withexp THEN - WriteExp(exp); - END; - FillRight(needed); - END Print; + FillLeft(needed); + IF neg THEN + Write("-"); + ELSIF sign THEN + Write("+"); + END; + IF decpt <= 0 THEN + Write("0"); + ELSE + index := 0; + WHILE index < decpt DO + IF index < ndigits THEN + Write(digits[index]); + ELSE + Write("0"); + END; + INC(index); + END; + END; + IF withexp OR (scale > 0) THEN + Write("."); + END; + IF scale > 0 THEN + count := scale; + index := decpt; + WHILE (index < 0) & (count > 0) DO + Write("0"); INC(index); DEC(count); + END; + WHILE (index < ndigits) & (count > 0) DO + Write(digits[index]); INC(index); DEC(count); + END; + WHILE count > 0 DO + Write("0"); DEC(count); + END; + END; + IF withexp THEN + WriteExp(exp); + END; + FillRight(needed); + END Print; - BEGIN (* WriteReal *) - IF NextArg(index) THEN - IF arglen[index] = SIZE(LONGREAL) THEN - long := TRUE; - Convert(index, lr); - ELSIF arglen[index] = SIZE(REAL) THEN - long := FALSE; - Convert(index, r); - lr := r; - ELSIF arglen[index] = SIZE(LONGINT) THEN - long := FALSE; - Convert(index, longint); - lr := longint; - ELSIF arglen[index] = SIZE(INTEGER) THEN - long := FALSE; - Convert(index, int); - lr := int; - (*ELSIF arglen[index] = SIZE(SYS.INT16) THEN - long := FALSE; - Convert(index, int16); - lr := int16;*) - ELSIF arglen[index] = SIZE(SHORTINT) THEN - long := FALSE; - Convert(index, shortint); - lr := shortint; - ELSE - Error(badArgumentSize); RETURN FALSE - END; - IF scale = -1 THEN - scale := defaultscale; - END; - (* check for NaNs and other invalid numbers *) - IF ~IEEE.Valid(lr) THEN - IF IEEE.NotANumber(lr) THEN - Write("N"); Write("a"); Write("N"); - RETURN TRUE - ELSE - IF lr < 0 THEN - Write("-"); - ELSE - Write("+"); - END; - Write("i"); Write("n"); Write("f"); - END; - RETURN TRUE - END; - (* real value in `lr' *) - Reals.ExpAndMan(lr, long, 10, exponent, mantissa); - CASE format OF - | "e": ndigits := SHORT(scale)+1; - | "f": ndigits := SHORT(scale)+exponent+1; - IF ndigits <= 0 THEN - ndigits := 1; - END; - | "g": ndigits := SHORT(scale); - ELSE - END; - Reals.Digits(mantissa, 10, digits, neg, - (* force = *) format # "g", ndigits); - decpt := 1; - CASE format OF - | "e": Print(decpt, (* withexp = *) TRUE, exponent); - | "f": INC(decpt, exponent); - Print(decpt, (* withexp = *) FALSE, 0); - | "g": IF (exponent < -4) OR (exponent > scale) THEN - scale := ndigits-1; - Print(decpt, (* withexp = *) TRUE, exponent); - ELSE - INC(decpt, exponent); - scale := ndigits-1; - DEC(scale, LONG(exponent)); - IF scale < 0 THEN - scale := 0; - END; - Print(decpt, (* withexp = *) FALSE, 0); - END; - ELSE - END; - RETURN TRUE - ELSE - RETURN FALSE - END; - END WriteReal; + BEGIN (* WriteReal *) + IF NextArg(index) THEN + IF arglen[index] = SIZE(LONGREAL) THEN + long := TRUE; + Convert(index, lr); + ELSIF arglen[index] = SIZE(REAL) THEN + long := FALSE; + Convert(index, r); + lr := r; + ELSIF arglen[index] = SIZE(LONGINT) THEN + long := FALSE; + Convert(index, longint); + lr := longint; + ELSIF arglen[index] = SIZE(INTEGER) THEN + long := FALSE; + Convert(index, int); + lr := int; + ELSIF arglen[index] = SIZE(SYS.INT16) THEN + long := FALSE; + Convert(index, int16); + lr := int16; + ELSIF arglen[index] = SIZE(SHORTINT) THEN + long := FALSE; + Convert(index, shortint); + lr := shortint; + ELSE + Error(badArgumentSize); RETURN FALSE + END; + IF scale = -1 THEN + scale := defaultscale; + END; + (* check for NaNs and other invalid numbers *) + IF ~IEEE.Valid(lr) THEN + IF IEEE.NotANumber(lr) THEN + Write("N"); Write("a"); Write("N"); + RETURN TRUE + ELSE + IF lr < 0 THEN + Write("-"); + ELSE + Write("+"); + END; + Write("i"); Write("n"); Write("f"); + END; + RETURN TRUE + END; + (* real value in `lr' *) + Reals.ExpAndMan(lr, long, 10, exponent, mantissa); + CASE format OF + | "e": ndigits := SHORT(scale)+1; + | "f": ndigits := SHORT(scale)+exponent+1; + IF ndigits <= 0 THEN + ndigits := 1; + END; + | "g": ndigits := SHORT(scale); + END; + Reals.Digits(mantissa, 10, digits, neg, + (* force = *) format # "g", ndigits); + decpt := 1; + CASE format OF + | "e": Print(decpt, (* withexp = *) TRUE, exponent); + | "f": INC(decpt, exponent); + Print(decpt, (* withexp = *) FALSE, 0); + | "g": IF (exponent < -4) OR (exponent > scale) THEN + scale := ndigits-1; + Print(decpt, (* withexp = *) TRUE, exponent); + ELSE + INC(decpt, exponent); + scale := ndigits-1; + DEC(scale, exponent); + IF scale < 0 THEN + scale := 0; + END; + Print(decpt, (* withexp = *) FALSE, 0); + END; + END; + RETURN TRUE + ELSE + RETURN FALSE + END; + END WriteReal; - PROCEDURE WriteString() : BOOLEAN; - VAR - index: INTEGER; - i: LONGINT; - byte: SYS.BYTE; - len: LONGINT; - BEGIN - IF NextArg(index) THEN - len := 0; - WHILE (len < arglen[index]) & - ((scale = -1) OR (len < scale)) & - ((*CHR*)SYS.VAL(CHAR, (Access(index, len))) # 0X) DO - INC(len); - END; - FillLeft(len); - i := 0; - WHILE i < len DO - byte := Access(index, i); - Write(byte); - INC(i); - END; - FillRight(len); - RETURN TRUE - END; - RETURN FALSE - END WriteString; + PROCEDURE WriteString() : BOOLEAN; + VAR + index: INTEGER; + i: LONGINT; + byte: BYTE; + len: LONGINT; + BEGIN + IF NextArg(index) THEN + len := 0; + WHILE (len < arglen[index]) & + ((scale = -1) OR (len < scale)) & + (CHR(Access(index, len)) # 0X) DO + INC(len); + END; + FillLeft(len); + i := 0; + WHILE i < len DO + byte := Access(index, i); + Write(byte); + INC(i); + END; + FillRight(len); + RETURN TRUE + END; + RETURN FALSE + END WriteString; - BEGIN (* Conversion *) - CASE fmtchar OF - | "b": RETURN WriteBool("TRUE", "FALSE") - | "c": RETURN WriteChar() - | "d": RETURN WriteInt(10) - | "e", - "f", - "g": RETURN WriteReal(fmtchar) - | "j": RETURN WriteBool("ja", "nein") - | "o": RETURN WriteInt(8) - | "s": RETURN WriteString() - | "x": RETURN WriteInt(16) - | "y": RETURN WriteBool("yes", "no") - ELSE - Error(badFormat); RETURN FALSE - END; - END Conversion; + BEGIN (* Conversion *) + CASE fmtchar OF + | "b": RETURN WriteBool("TRUE", "FALSE") + | "c": RETURN WriteChar() + | "d": RETURN WriteInt(10) + | "e", + "f", + "g": RETURN WriteReal(fmtchar) + | "j": RETURN WriteBool("ja", "nein") + | "o": RETURN WriteInt(8) + | "s": RETURN WriteString() + | "x": RETURN WriteInt(16) + | "y": RETURN WriteBool("yes", "no") + ELSE + Error(badFormat); RETURN FALSE + END; + END Conversion; BEGIN - IF ~Next() THEN RETURN FALSE END; - IF fmtchar = fmtcmd THEN Write(fmtcmd); RETURN TRUE END; - RETURN Flags() & Width() & Scale() & Conversion() + IF ~Next() THEN RETURN FALSE END; + IF fmtchar = fmtcmd THEN Write(fmtcmd); RETURN TRUE END; + RETURN Flags() & Width() & Scale() & Conversion() END Format; - + BEGIN out.count := 0; out.error := FALSE; SetSize; nextarg := 0; fmtindex := 0; WHILE Next() DO - IF fmtchar = fmtcmd THEN - IF ~Format() THEN - RETURN - END; - ELSIF (fmtchar = "\") & Next() THEN - CASE fmtchar OF - | "0".."9", "A".."F": - IF ~Int(hexcharval, 16) THEN - (* Error(s, BadFormat); *) RETURN - END; - Unget; - Write(CHR(hexcharval)); - | "b": Write(08X); (* back space *) - | "e": Write(1BX); (* escape *) - | "f": Write(0CX); (* form feed *) - | "n": WriteLn; - | "q": Write("'"); - | "Q": Write(22X); (* double quote: " *) - | "r": Write(0DX); (* carriage return *) - | "t": Write(09X); (* horizontal tab *) - | "&": Write(07X); (* bell *) - ELSE - Write(fmtchar); - END; - ELSE - Write(fmtchar); - END; + IF fmtchar = fmtcmd THEN + IF ~Format() THEN + RETURN + END; + ELSIF (fmtchar = "\") & Next() THEN + CASE fmtchar OF + | "0".."9", "A".."F": + IF ~Int(hexcharval, 16) THEN + (* Error(s, BadFormat); *) RETURN + END; + Unget; + Write(CHR(hexcharval)); + | "b": Write(08X); (* back space *) + | "e": Write(1BX); (* escape *) + | "f": Write(0CX); (* form feed *) + | "n": WriteLn; + | "q": Write("'"); + | "Q": Write(22X); (* double quote: " *) + | "r": Write(0DX); (* carriage return *) + | "t": Write(09X); (* horizontal tab *) + | "&": Write(07X); (* bell *) + ELSE + Write(fmtchar); + END; + ELSE + Write(fmtchar); + END; END; IF nextarg < nargs THEN - Error(tooManyArgs); + Error(tooManyArgs); ELSIF nextarg > nargs THEN - Error(tooFewArgs); + Error(tooFewArgs); END; END Out; (* === public part ============================================== *) - PROCEDURE F*(fmt: ARRAY OF CHAR); + PROCEDURE F(fmt: ARRAY OF CHAR); VAR x: INTEGER; BEGIN Out(Streams.stdout, fmt, 0, x,x,x,x,x,x,x,x,x, NIL); END F; - PROCEDURE F1*(fmt: ARRAY OF CHAR; p1: ARRAY OF SYS.BYTE); + PROCEDURE F1(fmt: ARRAY OF CHAR; p1: ARRAY OF BYTE); VAR x: INTEGER; BEGIN Out(Streams.stdout, fmt, 1, p1, x,x,x,x,x,x,x,x, NIL); END F1; - PROCEDURE F2*(fmt: ARRAY OF CHAR; p1, p2: ARRAY OF SYS.BYTE); + PROCEDURE F2(fmt: ARRAY OF CHAR; p1, p2: ARRAY OF BYTE); VAR x: INTEGER; BEGIN Out(Streams.stdout, fmt, 2, p1,p2, x,x,x,x,x,x,x, NIL); END F2; - PROCEDURE F3*(fmt: ARRAY OF CHAR; p1, p2, p3: ARRAY OF SYS.BYTE); + PROCEDURE F3(fmt: ARRAY OF CHAR; p1, p2, p3: ARRAY OF BYTE); VAR x: INTEGER; BEGIN Out(Streams.stdout, fmt, 3, p1,p2,p3, x,x,x,x,x,x, NIL); END F3; - PROCEDURE F4*(fmt: ARRAY OF CHAR; p1, p2, p3, p4: ARRAY OF SYS.BYTE); + PROCEDURE F4(fmt: ARRAY OF CHAR; p1, p2, p3, p4: ARRAY OF BYTE); VAR x: INTEGER; BEGIN Out(Streams.stdout, fmt, 4, p1,p2,p3,p4, x,x,x,x,x, NIL); END F4; - PROCEDURE F5*(fmt: ARRAY OF CHAR; p1, p2, p3, p4, p5: ARRAY OF SYS.BYTE); + PROCEDURE F5(fmt: ARRAY OF CHAR; p1, p2, p3, p4, p5: ARRAY OF BYTE); VAR x: INTEGER; BEGIN Out(Streams.stdout, fmt, 5, p1,p2,p3,p4,p5, x,x,x,x, NIL); END F5; - PROCEDURE F6*(fmt: ARRAY OF CHAR; p1, p2, p3, p4, p5, p6: ARRAY OF SYS.BYTE); + PROCEDURE F6(fmt: ARRAY OF CHAR; p1, p2, p3, p4, p5, p6: ARRAY OF BYTE); VAR x: INTEGER; BEGIN Out(Streams.stdout, fmt, 6, p1,p2,p3,p4,p5,p6, x,x,x, NIL); END F6; - PROCEDURE F7*(fmt: ARRAY OF CHAR; p1, p2, p3, p4, p5, p6, p7: ARRAY OF SYS.BYTE); + PROCEDURE F7(fmt: ARRAY OF CHAR; p1, p2, p3, p4, p5, p6, p7: ARRAY OF BYTE); VAR x: INTEGER; BEGIN Out(Streams.stdout, fmt, 7, p1,p2,p3,p4,p5,p6,p7, x,x, NIL); END F7; - PROCEDURE F8*(fmt: ARRAY OF CHAR; - p1, p2, p3, p4, p5, p6, p7, p8: ARRAY OF SYS.BYTE); + PROCEDURE F8(fmt: ARRAY OF CHAR; + p1, p2, p3, p4, p5, p6, p7, p8: ARRAY OF BYTE); VAR x: INTEGER; BEGIN Out(Streams.stdout, fmt, 8, p1,p2,p3,p4,p5,p6,p7,p8, x, NIL); END F8; - PROCEDURE F9*(fmt: ARRAY OF CHAR; - p1, p2, p3, p4, p5, p6, p7, p8, p9: ARRAY OF SYS.BYTE); + PROCEDURE F9(fmt: ARRAY OF CHAR; + p1, p2, p3, p4, p5, p6, p7, p8, p9: ARRAY OF BYTE); BEGIN Out(Streams.stdout, fmt, 9, p1,p2,p3,p4,p5,p6,p7,p8,p9, NIL); END F9; - PROCEDURE S*(out: Streams.Stream; fmt: ARRAY OF CHAR); + PROCEDURE S(out: Streams.Stream; fmt: ARRAY OF CHAR); VAR x: INTEGER; BEGIN Out(out, fmt, 0, x,x,x,x,x,x,x,x,x, NIL); END S; - PROCEDURE S1*(out: Streams.Stream; fmt: ARRAY OF CHAR; p1: ARRAY OF SYS.BYTE); + PROCEDURE S1(out: Streams.Stream; fmt: ARRAY OF CHAR; p1: ARRAY OF BYTE); VAR x: INTEGER; BEGIN Out(out, fmt, 1, p1, x,x,x,x,x,x,x,x, NIL); END S1; - PROCEDURE S2*(out: Streams.Stream; fmt: ARRAY OF CHAR; p1, p2: ARRAY OF SYS.BYTE); + PROCEDURE S2(out: Streams.Stream; fmt: ARRAY OF CHAR; p1, p2: ARRAY OF BYTE); VAR x: INTEGER; BEGIN Out(out, fmt, 2, p1,p2, x,x,x,x,x,x,x, NIL); END S2; - PROCEDURE S3*(out: Streams.Stream; fmt: ARRAY OF CHAR; p1, p2, p3: ARRAY OF SYS.BYTE); + PROCEDURE S3(out: Streams.Stream; fmt: ARRAY OF CHAR; p1, p2, p3: ARRAY OF BYTE); VAR x: INTEGER; BEGIN Out(out, fmt, 3, p1,p2,p3, x,x,x,x,x,x, NIL); END S3; - PROCEDURE S4*(out: Streams.Stream; fmt: ARRAY OF CHAR; - p1, p2, p3, p4: ARRAY OF SYS.BYTE); + PROCEDURE S4(out: Streams.Stream; fmt: ARRAY OF CHAR; + p1, p2, p3, p4: ARRAY OF BYTE); VAR x: INTEGER; BEGIN Out(out, fmt, 4, p1,p2,p3,p4, x,x,x,x,x, NIL); END S4; - PROCEDURE S5*(out: Streams.Stream; fmt: ARRAY OF CHAR; - p1, p2, p3, p4, p5: ARRAY OF SYS.BYTE); + PROCEDURE S5(out: Streams.Stream; fmt: ARRAY OF CHAR; + p1, p2, p3, p4, p5: ARRAY OF BYTE); VAR x: INTEGER; BEGIN Out(out, fmt, 5, p1,p2,p3,p4,p5, x,x,x,x, NIL); END S5; - PROCEDURE S6*(out: Streams.Stream; fmt: ARRAY OF CHAR; - p1, p2, p3, p4, p5, p6: ARRAY OF SYS.BYTE); + PROCEDURE S6(out: Streams.Stream; fmt: ARRAY OF CHAR; + p1, p2, p3, p4, p5, p6: ARRAY OF BYTE); VAR x: INTEGER; BEGIN Out(out, fmt, 6, p1,p2,p3,p4,p5,p6, x,x,x, NIL); END S6; - PROCEDURE S7*(out: Streams.Stream; fmt: ARRAY OF CHAR; - p1, p2, p3, p4, p5, p6, p7: ARRAY OF SYS.BYTE); + PROCEDURE S7(out: Streams.Stream; fmt: ARRAY OF CHAR; + p1, p2, p3, p4, p5, p6, p7: ARRAY OF BYTE); VAR x: INTEGER; BEGIN Out(out, fmt, 7, p1,p2,p3,p4,p5,p6,p7, x,x, NIL); END S7; - PROCEDURE S8*(out: Streams.Stream; fmt: ARRAY OF CHAR; - p1, p2, p3, p4, p5, p6, p7, p8: ARRAY OF SYS.BYTE); + PROCEDURE S8(out: Streams.Stream; fmt: ARRAY OF CHAR; + p1, p2, p3, p4, p5, p6, p7, p8: ARRAY OF BYTE); VAR x: INTEGER; BEGIN Out(out, fmt, 8, p1,p2,p3,p4,p5,p6,p7,p8, x, NIL); END S8; - PROCEDURE S9*(out: Streams.Stream; fmt: ARRAY OF CHAR; - p1, p2, p3, p4, p5, p6, p7, p8, p9: ARRAY OF SYS.BYTE); + PROCEDURE S9(out: Streams.Stream; fmt: ARRAY OF CHAR; + p1, p2, p3, p4, p5, p6, p7, p8, p9: ARRAY OF BYTE); BEGIN Out(out, fmt, 9, p1,p2,p3,p4,p5,p6,p7,p8,p9, NIL); END S9; - PROCEDURE SE*(out: Streams.Stream; fmt: ARRAY OF CHAR; - errors: RelatedEvents.Object); + PROCEDURE SE(out: Streams.Stream; fmt: ARRAY OF CHAR; + errors: RelatedEvents.Object); VAR x: INTEGER; BEGIN Out(out, fmt, 0, x,x,x,x,x,x,x,x,x, NIL); END SE; - PROCEDURE SE1*(out: Streams.Stream; fmt: ARRAY OF CHAR; p1: ARRAY OF SYS.BYTE; + PROCEDURE SE1(out: Streams.Stream; fmt: ARRAY OF CHAR; p1: ARRAY OF BYTE; errors: RelatedEvents.Object); VAR x: INTEGER; BEGIN Out(out, fmt, 1, p1, x,x,x,x,x,x,x,x, errors); END SE1; - PROCEDURE SE2*(out: Streams.Stream; fmt: ARRAY OF CHAR; p1, p2: ARRAY OF SYS.BYTE; + PROCEDURE SE2(out: Streams.Stream; fmt: ARRAY OF CHAR; p1, p2: ARRAY OF BYTE; errors: RelatedEvents.Object); VAR x: INTEGER; BEGIN Out(out, fmt, 2, p1,p2, x,x,x,x,x,x,x, errors); END SE2; - PROCEDURE SE3*(out: Streams.Stream; fmt: ARRAY OF CHAR; - p1, p2, p3: ARRAY OF SYS.BYTE; + PROCEDURE SE3(out: Streams.Stream; fmt: ARRAY OF CHAR; + p1, p2, p3: ARRAY OF BYTE; errors: RelatedEvents.Object); VAR x: INTEGER; BEGIN Out(out, fmt, 3, p1,p2,p3, x,x,x,x,x,x, errors); END SE3; - PROCEDURE SE4*(out: Streams.Stream; fmt: ARRAY OF CHAR; - p1, p2, p3, p4: ARRAY OF SYS.BYTE; + PROCEDURE SE4(out: Streams.Stream; fmt: ARRAY OF CHAR; + p1, p2, p3, p4: ARRAY OF BYTE; errors: RelatedEvents.Object); VAR x: INTEGER; BEGIN Out(out, fmt, 4, p1,p2,p3,p4, x,x,x,x,x, errors); END SE4; - PROCEDURE SE5*(out: Streams.Stream; fmt: ARRAY OF CHAR; - p1, p2, p3, p4, p5: ARRAY OF SYS.BYTE; + PROCEDURE SE5(out: Streams.Stream; fmt: ARRAY OF CHAR; + p1, p2, p3, p4, p5: ARRAY OF BYTE; errors: RelatedEvents.Object); VAR x: INTEGER; BEGIN Out(out, fmt, 5, p1,p2,p3,p4,p5, x,x,x,x, errors); END SE5; - PROCEDURE SE6*(out: Streams.Stream; fmt: ARRAY OF CHAR; - p1, p2, p3, p4, p5, p6: ARRAY OF SYS.BYTE; + PROCEDURE SE6(out: Streams.Stream; fmt: ARRAY OF CHAR; + p1, p2, p3, p4, p5, p6: ARRAY OF BYTE; errors: RelatedEvents.Object); VAR x: INTEGER; BEGIN Out(out, fmt, 6, p1,p2,p3,p4,p5,p6, x,x,x, errors); END SE6; - PROCEDURE SE7*(out: Streams.Stream; fmt: ARRAY OF CHAR; - p1, p2, p3, p4, p5, p6, p7: ARRAY OF SYS.BYTE; + PROCEDURE SE7(out: Streams.Stream; fmt: ARRAY OF CHAR; + p1, p2, p3, p4, p5, p6, p7: ARRAY OF BYTE; errors: RelatedEvents.Object); VAR x: INTEGER; BEGIN Out(out, fmt, 7, p1,p2,p3,p4,p5,p6,p7, x,x, errors); END SE7; - PROCEDURE SE8*(out: Streams.Stream; fmt: ARRAY OF CHAR; - p1, p2, p3, p4, p5, p6, p7, p8: ARRAY OF SYS.BYTE; + PROCEDURE SE8(out: Streams.Stream; fmt: ARRAY OF CHAR; + p1, p2, p3, p4, p5, p6, p7, p8: ARRAY OF BYTE; errors: RelatedEvents.Object); VAR x: INTEGER; BEGIN Out(out, fmt, 8, p1,p2,p3,p4,p5,p6,p7,p8, x, errors); END SE8; - PROCEDURE SE9*(out: Streams.Stream; fmt: ARRAY OF CHAR; - p1, p2, p3, p4, p5, p6, p7, p8, p9: ARRAY OF SYS.BYTE; + PROCEDURE SE9(out: Streams.Stream; fmt: ARRAY OF CHAR; + p1, p2, p3, p4, p5, p6, p7, p8, p9: ARRAY OF BYTE; errors: RelatedEvents.Object); BEGIN Out(out, fmt, 9, p1,p2,p3,p4,p5,p6,p7,p8,p9, errors); @@ -965,4 +961,4 @@ MODULE ulmPrint; BEGIN InitErrorHandling; -END ulmPrint. +END Print. diff --git a/src/library/ulm/ulmSYSTEM.Mod b/src/library/ulm/ulmSYSTEM.Mod index 796a0d1b..f4efb7d5 100644 --- a/src/library/ulm/ulmSYSTEM.Mod +++ b/src/library/ulm/ulmSYSTEM.Mod @@ -19,7 +19,7 @@ TYPE pchar = POINTER TO ARRAY 1 OF CHAR; i := 0; REPEAT SYSTEM.GET(adr + i, b); - lar[i] := b; + bar[i] := b; INC(i) UNTIL i = SIZE(LONGINT) END LongToByteArr; @@ -138,4 +138,5 @@ TYPE pchar = POINTER TO ARRAY 1 OF CHAR; BEGIN SYSTEM.MOVE(from, to, n); END WMOVE; + END ulmSYSTEM. diff --git a/src/library/ulm/ulmTypes.Mod b/src/library/ulm/ulmTypes.Mod index 0d09a4f5..755f7cee 100644 --- a/src/library/ulm/ulmTypes.Mod +++ b/src/library/ulm/ulmTypes.Mod @@ -40,7 +40,7 @@ ---------------------------------------------------------------------------- *) -MODULE ulmTypes; +MODULE Types; (* compiler-dependent type definitions; this version works for Ulm's Oberon Compilers on @@ -51,24 +51,23 @@ MODULE ulmTypes; TYPE Address* = SYS.ADDRESS; + UntracedAddress* = POINTER[1] TO UntracedAddressDesc; + UntracedAddressDesc* = RECORD[1] END; - UntracedAddress* = POINTER[1] TO UntracedAddressDesc; (*SYS.UNTRACEDADDRESS;*) - UntracedAddressDesc* = RECORD[1] END; - - Count* = SYS.INT32; - Size* = Count; - Byte* = SYS.BYTE; - IntAddress* = LONGINT; - Int8* = SYS.INT8; - Int16* = SYS.INT16; - Int32* = SYS.INT32; - Real32* = REAL; - Real64* = LONGREAL; + Count* = SYS.INT32; + Size* = Count; + Byte* = SYS.BYTE; + IntAddress* = SYS.INT32; + Int8* = SYS.INT8; + Int16* = SYS.INT16; + Int32* = SYS.INT32; + Real32* = LONGREAL; + Real64* = LONGREAL; CONST - bigEndian* = 0; (* SPARC, M68K etc *) + bigEndian* = 0; (* SPARC, M68K etc *) littleEndian* = 1; (* Intel 80x86, VAX etc *) - byteorder* = littleEndian; (* machine-dependent constant *) + byteorder* = littleEndian; (* machine-dependent constant *) TYPE ByteOrder* = SHORTINT; (* bigEndian or littleEndian *) @@ -77,14 +76,27 @@ MODULE ulmTypes; to allow for bit operations on INTEGER values *) TYPE - SetInt* = LONGINT; (* INTEGER type that corresponds to SET *) - VAR msb* : SET; - msbIsMax*, msbIs0*: SHORTINT; - msbindex*, lsbindex*, nofbits*: LONGINT; + SetInt* = INTEGER; (* INTEGER type that corresponds to SET *) + CONST + msb* = SYS.VAL(SET, MIN(SetInt)); + (* most significant bit, converted to a SET *) + (* we expect msbIsMax XOR msbIs0 to be 1; + this is checked for by an assertion + *) + msbIsMax* = SYS.VAL(SHORTINT, (msb = {MAX(SET)})); + (* is 1, if msb equals {MAX(SET)} *) + msbIs0* = SYS.VAL(SHORTINT, (msb = {0})); + (* is 0, if msb equals {0} *) + msbindex* = msbIsMax * MAX(SET); + (* set element that corresponds to the most-significant-bit *) + lsbindex* = MAX(SET) - msbindex; + (* set element that corresponds to the lowest-significant-bit *) + nofbits* = MAX(SET) + 1; + (* number of elements in SETs *) PROCEDURE ToInt8*(int: LONGINT) : Int8; BEGIN - RETURN SYS.VAL(SHORTINT, int) + RETURN SHORT(SHORT(int)) END ToInt8; PROCEDURE ToInt16*(int: LONGINT) : Int16; @@ -94,7 +106,7 @@ MODULE ulmTypes; PROCEDURE ToInt32*(int: LONGINT) : Int32; BEGIN - RETURN SYS.VAL(INTEGER, int) + RETURN int END ToInt32; PROCEDURE ToReal32*(real: LONGREAL) : Real32; @@ -104,25 +116,9 @@ MODULE ulmTypes; PROCEDURE ToReal64*(real: LONGREAL) : Real64; BEGIN - RETURN real + RETURN SHORT(real) END ToReal64; BEGIN - msb := SYS.VAL(SET, MIN(SetInt)); - (* most significant bit, converted to a SET *) - (* we expect msbIsMax XOR msbIs0 to be 1; - this is checked for by an assertion - *) - msbIsMax := SYS.VAL(SHORTINT, (msb = {MAX(SET)})); - (* is 1, if msb equals {MAX(SET)} *) - msbIs0 := SYS.VAL(SHORTINT, (msb = {0})); - (* is 0, if msb equals {0} *) - msbindex := msbIsMax * MAX(SET); - (* set element that corresponds to the most-significant-bit *) - lsbindex := MAX(SET) - msbindex; - (* set element that corresponds to the lowest-significant-bit *) - nofbits := MAX(SET) + 1; - (* number of elements in SETs *) - ASSERT((msbIs0 = 1) & (msbIsMax = 0) OR (msbIs0 = 0) & (msbIsMax = 1)); -END ulmTypes. +END Types. From 9f0cbccf5504830039d477fb7ed818b84f6dc577 Mon Sep 17 00:00:00 2001 From: David Brown Date: Tue, 29 Nov 2016 15:27:30 +0000 Subject: [PATCH 353/580] Various fixes to OS vs Oberon file lifetime management in Files.Mod. --- src/compiler/OPM.Mod | 5 ++- src/runtime/Files.Mod | 78 ++++++++++++++++++++--------------------- src/runtime/Heap.Mod | 3 +- src/runtime/Modules.Mod | 3 +- 4 files changed, 44 insertions(+), 45 deletions(-) diff --git a/src/compiler/OPM.Mod b/src/compiler/OPM.Mod index fe43393b..7c88f8fc 100644 --- a/src/compiler/OPM.Mod +++ b/src/compiler/OPM.Mod @@ -500,8 +500,6 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) WHILE i > 0 DO LogW(" "); DEC(i) END; LogVT100(VT100.Green); LogW("^"); LogVT100(VT100.ResetAll); - - Files.Close(f); END ShowLine; @@ -597,7 +595,8 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) oldSFile := Files.Old(fileName); done := oldSFile # NIL; IF done THEN Files.Set(oldSF, oldSFile, 0); Files.Read(oldSF, tag); Files.Read(oldSF, ver); - IF (tag # SFtag) OR (ver # SFver) THEN err(-306); (*possibly a symbol file from another Oberon implementation, e.g. HP-Oberon*) + IF (tag # SFtag) OR (ver # SFver) THEN + err(-306); (*possibly a symbol file from another Oberon implementation, e.g. HP-Oberon*) CloseOldSym; done := FALSE END END diff --git a/src/runtime/Files.Mod b/src/runtime/Files.Mod index 543a5c9c..983b4f64 100644 --- a/src/runtime/Files.Mod +++ b/src/runtime/Files.Mod @@ -18,14 +18,15 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files BufSize = 4096; NoDesc = -1; - (* file states *) + (* No file states, used when FileDesc.fd = NoDesc *) open = 0; (* OS File has been opened *) create = 1; (* OS file needs to be created *) - close = 2; (* Register telling Create to use registerName directly: - i.e. since we're closing and all data is still in - buffers bypass writing to temp file and then renaming - and just write directly to fianl register name *) - + close = 2; (* Flag used by Files.Register to tell Create to create the + file using it's registerName directly, rather than to + create a temporary file: i.e. since we're closing and all + data is still in buffers bypass writing to temp file and + then renaming and just write directly to final register + name *) TYPE FileName = ARRAY 101 OF CHAR; @@ -37,7 +38,7 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files registerName: FileName; tempFile: BOOLEAN; identity: Platform.FileIdentity; - fd-: Platform.FileHandle; + fd: Platform.FileHandle; len, pos: LONGINT; bufs: ARRAY NumBufs OF Buffer; swapper: INTEGER; @@ -63,7 +64,7 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files VAR - files: File; (* List of files that have an OS file handle/descriptor assigned *) + files: File; (* List of files backed by an OS file, whether open, registered or temporary. *) tempno: INTEGER; HOME: ARRAY 1024 OF CHAR; SearchPath: POINTER TO ARRAY OF CHAR; @@ -122,6 +123,10 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files END GetTempName; PROCEDURE Create(f: File); + (* Makes sure there is an OS file backing this Oberon file. + Used when more data has been written to an unregistered new file than + buffers can hold, or when registering a new file whose data is all in + buffers. *) VAR identity: Platform.FileIdentity; done: BOOLEAN; @@ -137,16 +142,20 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files *) IF f.fd = NoDesc THEN IF f.state = create THEN + (* New file with enough data written to exceed buffers, so we need to + create a temporary file to back it. *) GetTempName(f.registerName, f.workName); f.tempFile := TRUE - ELSIF f.state = close THEN + ELSE + ASSERT(f.state = close); + (* New file with all data in buffers being registered. No need for a + temp file, will just write the buffers to the registerName. *) f.workName := f.registerName; f.registerName := ""; f.tempFile := FALSE END; error := Platform.Unlink(f.workName); (*unlink first to avoid stale NFS handles and to avoid reuse of inodes*) - error := Platform.New(f.workName, f.fd); done := error = 0; IF done THEN - f.next := files; files := f; + f.next := files; files := f; (* Link this file into the list of OS bakced files. *) INC(Heap.FileCount); Heap.RegisterFinalizer(f, Finalize); f.state := open; @@ -186,31 +195,12 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files IF error # 0 THEN Err("error writing file", f, error) END; f.pos := buf.org + buf.size; buf.chg := FALSE; - error := Platform.Identify(f.fd, f.identity); + error := Platform.Identify(f.fd, f.identity); (* Update identity with new modification time. *) IF error # 0 THEN Err("error identifying file", f, error) END; - (* - error := Platform.Identify(f.fd, identity); - f.identity.mtime := identity.mtime; - *) END END Flush; - PROCEDURE CloseOSFile(f: File); - (* Close the OS file handle and remove f from 'files' *) - VAR prev: File; error: Platform.ErrorCode; - BEGIN - IF files = f THEN files := f.next - ELSE - prev := files; - WHILE (prev # NIL) & (prev.next # f) DO prev := prev.next END; - IF prev.next # NIL THEN prev.next := f.next END - END; - error := Platform.Close(f.fd); - f.fd := NoDesc; f.state := create; DEC(Heap.FileCount); - END CloseOSFile; - - PROCEDURE Close* (f: File); VAR i: LONGINT; @@ -219,12 +209,6 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files IF (f.state # create) OR (f.registerName # "") THEN Create(f); i := 0; WHILE (i < NumBufs) & (f.bufs[i] # NIL) DO Flush(f.bufs[i]); INC(i) END; - (* There's no reason to sync this file - we're about to close it. The OS - will sync if necessary. Further, sync will fail for a R/O file on Windows. - error := Platform.Sync(f.fd); - IF error # 0 THEN Err("error syncing file", f, error) END; - *) - CloseOSFile(f); END END Close; @@ -323,7 +307,7 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files error := Platform.Identify(fd, identity); f := CacheEntry(identity); IF f # NIL THEN - (* error := Platform.Close(fd); DCWB: Either this should be removed or should call CloseOSFile. *) + error := Platform.Close(fd); (* fd not needed - we'll be using f.fd. *) RETURN f ELSE NEW(f); Heap.RegisterFinalizer(f, Finalize); f.fd := fd; f.state := open; f.pos := 0; f.swapper := -1; (*all f.buf[i] = NIL*) @@ -579,7 +563,7 @@ Especially Length would become fairly complex. END Rename; PROCEDURE Register* (f: File); - VAR idx, errcode: INTEGER; f1: File; file: ARRAY 104 OF CHAR; + VAR idx, errcode: INTEGER; f1: File; BEGIN (* Out.String("Files.Register f.registerName = "); Out.String(f.registerName); @@ -595,7 +579,7 @@ Especially Length would become fairly complex. Out.String(" to registerName "); Out.String(f.registerName); Out.String(" errorcode = "); Out.Int(errcode,1); Out.Ln; *) - IF errcode # 0 THEN COPY(f.registerName, file); HALT(99) END; + IF errcode # 0 THEN Err("Couldn't rename temp name as register name", f, errcode) END; f.workName := f.registerName; f.registerName := ""; f.tempFile := FALSE END END Register; @@ -725,6 +709,20 @@ Especially Length would become fairly complex. COPY (f.workName, name); END GetName; + PROCEDURE CloseOSFile(f: File); + (* Close the OS file handle and remove f from 'files' *) + VAR prev: File; error: Platform.ErrorCode; + BEGIN + IF files = f THEN files := f.next + ELSE + prev := files; + WHILE (prev # NIL) & (prev.next # f) DO prev := prev.next END; + IF prev.next # NIL THEN prev.next := f.next END + END; + error := Platform.Close(f.fd); + f.fd := NoDesc; f.state := create; DEC(Heap.FileCount); + END CloseOSFile; + PROCEDURE Finalize(o: SYSTEM.PTR); VAR f: File; res: LONGINT; BEGIN diff --git a/src/runtime/Heap.Mod b/src/runtime/Heap.Mod index 71a0d161..e368ae88 100644 --- a/src/runtime/Heap.Mod +++ b/src/runtime/Heap.Mod @@ -530,7 +530,8 @@ MODULE Heap; PROCEDURE GC*(markStack: BOOLEAN); VAR m: Module; - i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23: S.ADDRESS; + i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, + i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23: S.ADDRESS; cand: ARRAY 10000 OF S.ADDRESS; BEGIN IF (lockdepth = 0) OR (lockdepth = 1) & ~markStack THEN diff --git a/src/runtime/Modules.Mod b/src/runtime/Modules.Mod index 28050126..970bc547 100644 --- a/src/runtime/Modules.Mod +++ b/src/runtime/Modules.Mod @@ -136,7 +136,7 @@ MODULE Modules; (* jt 6.1.96 *) PROCEDURE Halt*(code: SYSTEM.INT32); BEGIN - (*IF HaltHandler # NIL THEN HaltHandler(code) END;*) + Heap.FINALL; errstring("Terminated by Halt("); errint(code); errstring("). "); IF code < 0 THEN DisplayHaltCode(code) END; errstring(Platform.NL); @@ -145,6 +145,7 @@ MODULE Modules; (* jt 6.1.96 *) PROCEDURE AssertFail*(code: SYSTEM.INT32); BEGIN + Heap.FINALL; errstring("Assertion failure."); IF code # 0 THEN errstring(" ASSERT code "); errint(code); errstring("."); END; errstring(Platform.NL); From 19af6d76d370378e00338b0f535505bd1d88811f Mon Sep 17 00:00:00 2001 From: David Brown Date: Tue, 29 Nov 2016 15:43:11 +0000 Subject: [PATCH 354/580] Update bootstrap C source. --- bootstrap/unix-44/Compiler.c | 2 +- bootstrap/unix-44/Configuration.c | 4 +-- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Files.c | 53 ++++++++++++++-------------- bootstrap/unix-44/Files.h | 7 ++-- bootstrap/unix-44/Heap.c | 2 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 4 ++- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 2 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 3 +- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 2 +- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 2 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Out.c | 2 +- bootstrap/unix-44/Out.h | 2 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/VT100.c | 2 +- bootstrap/unix-44/VT100.h | 2 +- bootstrap/unix-44/extTools.c | 2 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-48/Compiler.c | 2 +- bootstrap/unix-48/Configuration.c | 4 +-- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Files.c | 53 ++++++++++++++-------------- bootstrap/unix-48/Files.h | 7 ++-- bootstrap/unix-48/Heap.c | 2 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 4 ++- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 2 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 3 +- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 2 +- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 2 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Out.c | 2 +- bootstrap/unix-48/Out.h | 2 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/VT100.c | 2 +- bootstrap/unix-48/VT100.h | 2 +- bootstrap/unix-48/extTools.c | 2 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-88/Compiler.c | 2 +- bootstrap/unix-88/Configuration.c | 4 +-- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Files.c | 53 ++++++++++++++-------------- bootstrap/unix-88/Files.h | 6 ++-- bootstrap/unix-88/Heap.c | 2 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 4 ++- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 2 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 3 +- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 2 +- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 2 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Out.c | 2 +- bootstrap/unix-88/Out.h | 2 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/VT100.c | 2 +- bootstrap/unix-88/VT100.h | 2 +- bootstrap/unix-88/extTools.c | 2 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/windows-48/Compiler.c | 2 +- bootstrap/windows-48/Configuration.c | 4 +-- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Files.c | 53 ++++++++++++++-------------- bootstrap/windows-48/Files.h | 7 ++-- bootstrap/windows-48/Heap.c | 2 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 4 ++- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 2 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 3 +- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 2 +- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 2 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Out.c | 2 +- bootstrap/windows-48/Out.h | 2 +- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/VT100.c | 2 +- bootstrap/windows-48/VT100.h | 2 +- bootstrap/windows-48/extTools.c | 2 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-88/Compiler.c | 2 +- bootstrap/windows-88/Configuration.c | 4 +-- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Files.c | 53 ++++++++++++++-------------- bootstrap/windows-88/Files.h | 7 ++-- bootstrap/windows-88/Heap.c | 2 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 4 ++- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 2 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 3 +- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 2 +- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 2 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Out.c | 2 +- bootstrap/windows-88/Out.h | 2 +- bootstrap/windows-88/Platform.c | 2 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/VT100.c | 2 +- bootstrap/windows-88/VT100.h | 2 +- bootstrap/windows-88/extTools.c | 2 +- bootstrap/windows-88/extTools.h | 2 +- 185 files changed, 334 insertions(+), 340 deletions(-) diff --git a/bootstrap/unix-44/Compiler.c b/bootstrap/unix-44/Compiler.c index 6200dcea..19053dd2 100644 --- a/bootstrap/unix-44/Compiler.c +++ b/bootstrap/unix-44/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index 13c1e7ff..d0de3d5d 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index 6f418c8a..2cc1873a 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 05af3356..3a6ec440 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -232,7 +232,8 @@ static void Files_Create (Files_File f) if (f->state == 1) { Files_GetTempName(f->registerName, 101, (void*)f->workName, 101); f->tempFile = 1; - } else if (f->state == 2) { + } else { + __ASSERT(f->state == 2, 0); __COPY(f->registerName, f->workName, 101); f->registerName[0] = 0x00; f->tempFile = 0; @@ -284,27 +285,6 @@ static void Files_Flush (Files_Buffer buf) } } -static void Files_CloseOSFile (Files_File f) -{ - Files_File prev = NIL; - INT16 error; - if (Files_files == f) { - Files_files = f->next; - } else { - prev = Files_files; - while ((prev != NIL && prev->next != f)) { - prev = prev->next; - } - if (prev->next != NIL) { - prev->next = f->next; - } - } - error = Platform_Close(f->fd); - f->fd = -1; - f->state = 1; - Heap_FileCount -= 1; -} - void Files_Close (Files_File f) { INT32 i; @@ -316,7 +296,6 @@ void Files_Close (Files_File f) Files_Flush(f->bufs[i]); i += 1; } - Files_CloseOSFile(f); } } @@ -465,6 +444,7 @@ Files_File Files_Old (CHAR *name, ADDRESS name__len) error = Platform_Identify(fd, &identity, Platform_FileIdentity__typ); f = Files_CacheEntry(identity); if (f != NIL) { + error = Platform_Close(fd); __DEL(name); return f; } else { @@ -804,7 +784,6 @@ void Files_Register (Files_File f) { INT16 idx, errcode; Files_File f1 = NIL; - CHAR file[104]; if ((f->state == 1 && f->registerName[0] != 0x00)) { f->state = 2; } @@ -812,8 +791,7 @@ void Files_Register (Files_File f) if (f->registerName[0] != 0x00) { Files_Rename(f->workName, 101, f->registerName, 101, &errcode); if (errcode != 0) { - __COPY(f->registerName, file, 104); - __HALT(99); + Files_Err((CHAR*)"Couldn't rename temp name as register name", 43, f, errcode); } __COPY(f->registerName, f->workName, 101); f->registerName[0] = 0x00; @@ -1005,6 +983,27 @@ void Files_GetName (Files_File f, CHAR *name, ADDRESS name__len) __COPY(f->workName, name, name__len); } +static void Files_CloseOSFile (Files_File f) +{ + Files_File prev = NIL; + INT16 error; + if (Files_files == f) { + Files_files = f->next; + } else { + prev = Files_files; + while ((prev != NIL && prev->next != f)) { + prev = prev->next; + } + if (prev->next != NIL) { + prev->next = f->next; + } + } + error = Platform_Close(f->fd); + f->fd = -1; + f->state = 1; + Heap_FileCount -= 1; +} + static void Files_Finalize (SYSTEM_PTR o) { Files_File f = NIL; diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index 1d0b6ef1..a2ddea5e 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h @@ -10,9 +10,8 @@ typedef typedef struct Files_FileDesc { - char _prvt0[216]; - INT32 fd; - char _prvt1[32]; + INT32 _prvt0; + char _prvt1[248]; } Files_FileDesc; typedef diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index ae9ffcfb..88e5fa50 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index 0cf94754..313d111e 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index e4fa8467..8ce1e8f3 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -250,6 +250,7 @@ static void Modules_DisplayHaltCode (INT32 code) void Modules_Halt (INT32 code) { + Heap_FINALL(); Modules_errstring((CHAR*)"Terminated by Halt(", 20); Modules_errint(code); Modules_errstring((CHAR*)"). ", 4); @@ -262,6 +263,7 @@ void Modules_Halt (INT32 code) void Modules_AssertFail (INT32 code) { + Heap_FINALL(); Modules_errstring((CHAR*)"Assertion failure.", 19); if (code != 0) { Modules_errstring((CHAR*)" ASSERT code ", 14); diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index d1227884..2bd2b5da 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index f174acdc..d34d0f9b 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index 1efe3cf3..084b0534 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 4759eb74..6b592341 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index a485b3c4..5219140a 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 34ca07fd..f54fae67 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -640,7 +640,6 @@ static void OPM_ShowLine (INT64 pos) OPM_LogVT100((CHAR*)"32m", 4); OPM_LogW('^'); OPM_LogVT100((CHAR*)"0m", 3); - Files_Close(f); } void OPM_Mark (INT16 n, INT32 pos) diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index 0b19f055..cd390d68 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index aef61fc9..b4ed079b 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index 6629924c..ab972651 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index d5c0c747..6028caf7 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index 87418922..ad1dc868 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index 0d22f650..ae240604 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index 019dee31..7c1139c0 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index ef5a6f06..9250891d 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index 401db9dd..296c8975 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Out.c b/bootstrap/unix-44/Out.c index eba9222e..ff896aa0 100644 --- a/bootstrap/unix-44/Out.c +++ b/bootstrap/unix-44/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Out.h b/bootstrap/unix-44/Out.h index f58803a5..44a26650 100644 --- a/bootstrap/unix-44/Out.h +++ b/bootstrap/unix-44/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 5cc1bdc0..410edde3 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index f4cff92c..d5cc19f6 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 5361bdcd..fe5db80a 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index cc2755f0..e791f967 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index 230f60a9..7c07366c 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index ad07bc6d..96231bce 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index 21b5fc34..05d98559 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index 8b80a18c..8f626f64 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/VT100.c b/bootstrap/unix-44/VT100.c index 57d8a782..6646a439 100644 --- a/bootstrap/unix-44/VT100.c +++ b/bootstrap/unix-44/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/VT100.h b/bootstrap/unix-44/VT100.h index 5e32e01b..ee7770b0 100644 --- a/bootstrap/unix-44/VT100.h +++ b/bootstrap/unix-44/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index 18e626a3..e450651e 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index 622a5a55..aea1841e 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/Compiler.c b/bootstrap/unix-48/Compiler.c index 6200dcea..19053dd2 100644 --- a/bootstrap/unix-48/Compiler.c +++ b/bootstrap/unix-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index 13c1e7ff..d0de3d5d 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index 6f418c8a..2cc1873a 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 05af3356..3a6ec440 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -232,7 +232,8 @@ static void Files_Create (Files_File f) if (f->state == 1) { Files_GetTempName(f->registerName, 101, (void*)f->workName, 101); f->tempFile = 1; - } else if (f->state == 2) { + } else { + __ASSERT(f->state == 2, 0); __COPY(f->registerName, f->workName, 101); f->registerName[0] = 0x00; f->tempFile = 0; @@ -284,27 +285,6 @@ static void Files_Flush (Files_Buffer buf) } } -static void Files_CloseOSFile (Files_File f) -{ - Files_File prev = NIL; - INT16 error; - if (Files_files == f) { - Files_files = f->next; - } else { - prev = Files_files; - while ((prev != NIL && prev->next != f)) { - prev = prev->next; - } - if (prev->next != NIL) { - prev->next = f->next; - } - } - error = Platform_Close(f->fd); - f->fd = -1; - f->state = 1; - Heap_FileCount -= 1; -} - void Files_Close (Files_File f) { INT32 i; @@ -316,7 +296,6 @@ void Files_Close (Files_File f) Files_Flush(f->bufs[i]); i += 1; } - Files_CloseOSFile(f); } } @@ -465,6 +444,7 @@ Files_File Files_Old (CHAR *name, ADDRESS name__len) error = Platform_Identify(fd, &identity, Platform_FileIdentity__typ); f = Files_CacheEntry(identity); if (f != NIL) { + error = Platform_Close(fd); __DEL(name); return f; } else { @@ -804,7 +784,6 @@ void Files_Register (Files_File f) { INT16 idx, errcode; Files_File f1 = NIL; - CHAR file[104]; if ((f->state == 1 && f->registerName[0] != 0x00)) { f->state = 2; } @@ -812,8 +791,7 @@ void Files_Register (Files_File f) if (f->registerName[0] != 0x00) { Files_Rename(f->workName, 101, f->registerName, 101, &errcode); if (errcode != 0) { - __COPY(f->registerName, file, 104); - __HALT(99); + Files_Err((CHAR*)"Couldn't rename temp name as register name", 43, f, errcode); } __COPY(f->registerName, f->workName, 101); f->registerName[0] = 0x00; @@ -1005,6 +983,27 @@ void Files_GetName (Files_File f, CHAR *name, ADDRESS name__len) __COPY(f->workName, name, name__len); } +static void Files_CloseOSFile (Files_File f) +{ + Files_File prev = NIL; + INT16 error; + if (Files_files == f) { + Files_files = f->next; + } else { + prev = Files_files; + while ((prev != NIL && prev->next != f)) { + prev = prev->next; + } + if (prev->next != NIL) { + prev->next = f->next; + } + } + error = Platform_Close(f->fd); + f->fd = -1; + f->state = 1; + Heap_FileCount -= 1; +} + static void Files_Finalize (SYSTEM_PTR o) { Files_File f = NIL; diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index 1d0b6ef1..a2ddea5e 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h @@ -10,9 +10,8 @@ typedef typedef struct Files_FileDesc { - char _prvt0[216]; - INT32 fd; - char _prvt1[32]; + INT32 _prvt0; + char _prvt1[248]; } Files_FileDesc; typedef diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index ae9ffcfb..88e5fa50 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index 0cf94754..313d111e 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index e4fa8467..8ce1e8f3 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -250,6 +250,7 @@ static void Modules_DisplayHaltCode (INT32 code) void Modules_Halt (INT32 code) { + Heap_FINALL(); Modules_errstring((CHAR*)"Terminated by Halt(", 20); Modules_errint(code); Modules_errstring((CHAR*)"). ", 4); @@ -262,6 +263,7 @@ void Modules_Halt (INT32 code) void Modules_AssertFail (INT32 code) { + Heap_FINALL(); Modules_errstring((CHAR*)"Assertion failure.", 19); if (code != 0) { Modules_errstring((CHAR*)" ASSERT code ", 14); diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index d1227884..2bd2b5da 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index f174acdc..d34d0f9b 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index 1efe3cf3..084b0534 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 4759eb74..6b592341 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index a485b3c4..5219140a 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 34ca07fd..f54fae67 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -640,7 +640,6 @@ static void OPM_ShowLine (INT64 pos) OPM_LogVT100((CHAR*)"32m", 4); OPM_LogW('^'); OPM_LogVT100((CHAR*)"0m", 3); - Files_Close(f); } void OPM_Mark (INT16 n, INT32 pos) diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index 0b19f055..cd390d68 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index aef61fc9..b4ed079b 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index 6629924c..ab972651 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index d5c0c747..6028caf7 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index 87418922..ad1dc868 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index b4a68499..7ed72408 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index 019dee31..7c1139c0 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index ef5a6f06..9250891d 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index 401db9dd..296c8975 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Out.c b/bootstrap/unix-48/Out.c index eba9222e..ff896aa0 100644 --- a/bootstrap/unix-48/Out.c +++ b/bootstrap/unix-48/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Out.h b/bootstrap/unix-48/Out.h index f58803a5..44a26650 100644 --- a/bootstrap/unix-48/Out.h +++ b/bootstrap/unix-48/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 5cc1bdc0..410edde3 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index f4cff92c..d5cc19f6 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 5361bdcd..fe5db80a 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index cc2755f0..e791f967 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index 230f60a9..7c07366c 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index ad07bc6d..96231bce 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index ffda81d3..68aa0310 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index ef53cdf5..2635c7ad 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/VT100.c b/bootstrap/unix-48/VT100.c index 57d8a782..6646a439 100644 --- a/bootstrap/unix-48/VT100.c +++ b/bootstrap/unix-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/VT100.h b/bootstrap/unix-48/VT100.h index 5e32e01b..ee7770b0 100644 --- a/bootstrap/unix-48/VT100.h +++ b/bootstrap/unix-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index 18e626a3..e450651e 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index 622a5a55..aea1841e 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/Compiler.c b/bootstrap/unix-88/Compiler.c index 6200dcea..19053dd2 100644 --- a/bootstrap/unix-88/Compiler.c +++ b/bootstrap/unix-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index 13c1e7ff..d0de3d5d 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index 6f418c8a..2cc1873a 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 2da0ba3b..1b967820 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -232,7 +232,8 @@ static void Files_Create (Files_File f) if (f->state == 1) { Files_GetTempName(f->registerName, 101, (void*)f->workName, 101); f->tempFile = 1; - } else if (f->state == 2) { + } else { + __ASSERT(f->state == 2, 0); __COPY(f->registerName, f->workName, 101); f->registerName[0] = 0x00; f->tempFile = 0; @@ -284,27 +285,6 @@ static void Files_Flush (Files_Buffer buf) } } -static void Files_CloseOSFile (Files_File f) -{ - Files_File prev = NIL; - INT16 error; - if (Files_files == f) { - Files_files = f->next; - } else { - prev = Files_files; - while ((prev != NIL && prev->next != f)) { - prev = prev->next; - } - if (prev->next != NIL) { - prev->next = f->next; - } - } - error = Platform_Close(f->fd); - f->fd = -1; - f->state = 1; - Heap_FileCount -= 1; -} - void Files_Close (Files_File f) { INT32 i; @@ -316,7 +296,6 @@ void Files_Close (Files_File f) Files_Flush(f->bufs[i]); i += 1; } - Files_CloseOSFile(f); } } @@ -465,6 +444,7 @@ Files_File Files_Old (CHAR *name, ADDRESS name__len) error = Platform_Identify(fd, &identity, Platform_FileIdentity__typ); f = Files_CacheEntry(identity); if (f != NIL) { + error = Platform_Close(fd); __DEL(name); return f; } else { @@ -804,7 +784,6 @@ void Files_Register (Files_File f) { INT16 idx, errcode; Files_File f1 = NIL; - CHAR file[104]; if ((f->state == 1 && f->registerName[0] != 0x00)) { f->state = 2; } @@ -812,8 +791,7 @@ void Files_Register (Files_File f) if (f->registerName[0] != 0x00) { Files_Rename(f->workName, 101, f->registerName, 101, &errcode); if (errcode != 0) { - __COPY(f->registerName, file, 104); - __HALT(99); + Files_Err((CHAR*)"Couldn't rename temp name as register name", 43, f, errcode); } __COPY(f->registerName, f->workName, 101); f->registerName[0] = 0x00; @@ -1005,6 +983,27 @@ void Files_GetName (Files_File f, CHAR *name, ADDRESS name__len) __COPY(f->workName, name, name__len); } +static void Files_CloseOSFile (Files_File f) +{ + Files_File prev = NIL; + INT16 error; + if (Files_files == f) { + Files_files = f->next; + } else { + prev = Files_files; + while ((prev != NIL && prev->next != f)) { + prev = prev->next; + } + if (prev->next != NIL) { + prev->next = f->next; + } + } + error = Platform_Close(f->fd); + f->fd = -1; + f->state = 1; + Heap_FileCount -= 1; +} + static void Files_Finalize (SYSTEM_PTR o) { Files_File f = NIL; diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 379f329e..6d4e7f78 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h @@ -11,9 +11,7 @@ typedef typedef struct Files_FileDesc { INT64 _prvt0; - char _prvt1[208]; - INT32 fd; - char _prvt2[60]; + char _prvt1[272]; } Files_FileDesc; typedef diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index ac52c6ae..afc96221 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index 9daf685d..e8a34cc3 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index f1d1a614..e161f52a 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -250,6 +250,7 @@ static void Modules_DisplayHaltCode (INT32 code) void Modules_Halt (INT32 code) { + Heap_FINALL(); Modules_errstring((CHAR*)"Terminated by Halt(", 20); Modules_errint(code); Modules_errstring((CHAR*)"). ", 4); @@ -262,6 +263,7 @@ void Modules_Halt (INT32 code) void Modules_AssertFail (INT32 code) { + Heap_FINALL(); Modules_errstring((CHAR*)"Assertion failure.", 19); if (code != 0) { Modules_errstring((CHAR*)" ASSERT code ", 14); diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index d1227884..2bd2b5da 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index f174acdc..d34d0f9b 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index 1efe3cf3..084b0534 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index 4759eb74..6b592341 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index a485b3c4..5219140a 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 5820c0cc..944cb3df 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -640,7 +640,6 @@ static void OPM_ShowLine (INT64 pos) OPM_LogVT100((CHAR*)"32m", 4); OPM_LogW('^'); OPM_LogVT100((CHAR*)"0m", 3); - Files_Close(f); } void OPM_Mark (INT16 n, INT32 pos) diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index 0b19f055..cd390d68 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index ccf8dbe4..5b8ca3cb 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index 6629924c..ab972651 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index d5c0c747..6028caf7 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index 87418922..ad1dc868 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index 8122f444..50fa7c31 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 019dee31..7c1139c0 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index a03a1aab..70113cd4 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index 401db9dd..296c8975 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Out.c b/bootstrap/unix-88/Out.c index eba9222e..ff896aa0 100644 --- a/bootstrap/unix-88/Out.c +++ b/bootstrap/unix-88/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Out.h b/bootstrap/unix-88/Out.h index f58803a5..44a26650 100644 --- a/bootstrap/unix-88/Out.h +++ b/bootstrap/unix-88/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index def7cd38..fde6b221 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index f9a40b7b..31c0037a 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 5361bdcd..fe5db80a 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index cc2755f0..e791f967 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index 230f60a9..7c07366c 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index ad07bc6d..96231bce 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index 79492c57..590a2041 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index 9042b9b8..1d12b7c6 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/VT100.c b/bootstrap/unix-88/VT100.c index 57d8a782..6646a439 100644 --- a/bootstrap/unix-88/VT100.c +++ b/bootstrap/unix-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/VT100.h b/bootstrap/unix-88/VT100.h index 5e32e01b..ee7770b0 100644 --- a/bootstrap/unix-88/VT100.h +++ b/bootstrap/unix-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index 18e626a3..e450651e 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index 622a5a55..aea1841e 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/Compiler.c b/bootstrap/windows-48/Compiler.c index 6200dcea..19053dd2 100644 --- a/bootstrap/windows-48/Compiler.c +++ b/bootstrap/windows-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index 13c1e7ff..d0de3d5d 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index 6f418c8a..2cc1873a 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index ac192041..a737c2d8 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -232,7 +232,8 @@ static void Files_Create (Files_File f) if (f->state == 1) { Files_GetTempName(f->registerName, 101, (void*)f->workName, 101); f->tempFile = 1; - } else if (f->state == 2) { + } else { + __ASSERT(f->state == 2, 0); __COPY(f->registerName, f->workName, 101); f->registerName[0] = 0x00; f->tempFile = 0; @@ -284,27 +285,6 @@ static void Files_Flush (Files_Buffer buf) } } -static void Files_CloseOSFile (Files_File f) -{ - Files_File prev = NIL; - INT16 error; - if (Files_files == f) { - Files_files = f->next; - } else { - prev = Files_files; - while ((prev != NIL && prev->next != f)) { - prev = prev->next; - } - if (prev->next != NIL) { - prev->next = f->next; - } - } - error = Platform_Close(f->fd); - f->fd = -1; - f->state = 1; - Heap_FileCount -= 1; -} - void Files_Close (Files_File f) { INT32 i; @@ -316,7 +296,6 @@ void Files_Close (Files_File f) Files_Flush(f->bufs[i]); i += 1; } - Files_CloseOSFile(f); } } @@ -465,6 +444,7 @@ Files_File Files_Old (CHAR *name, ADDRESS name__len) error = Platform_Identify(fd, &identity, Platform_FileIdentity__typ); f = Files_CacheEntry(identity); if (f != NIL) { + error = Platform_Close(fd); __DEL(name); return f; } else { @@ -804,7 +784,6 @@ void Files_Register (Files_File f) { INT16 idx, errcode; Files_File f1 = NIL; - CHAR file[104]; if ((f->state == 1 && f->registerName[0] != 0x00)) { f->state = 2; } @@ -812,8 +791,7 @@ void Files_Register (Files_File f) if (f->registerName[0] != 0x00) { Files_Rename(f->workName, 101, f->registerName, 101, &errcode); if (errcode != 0) { - __COPY(f->registerName, file, 104); - __HALT(99); + Files_Err((CHAR*)"Couldn't rename temp name as register name", 43, f, errcode); } __COPY(f->registerName, f->workName, 101); f->registerName[0] = 0x00; @@ -1005,6 +983,27 @@ void Files_GetName (Files_File f, CHAR *name, ADDRESS name__len) __COPY(f->workName, name, name__len); } +static void Files_CloseOSFile (Files_File f) +{ + Files_File prev = NIL; + INT16 error; + if (Files_files == f) { + Files_files = f->next; + } else { + prev = Files_files; + while ((prev != NIL && prev->next != f)) { + prev = prev->next; + } + if (prev->next != NIL) { + prev->next = f->next; + } + } + error = Platform_Close(f->fd); + f->fd = -1; + f->state = 1; + Heap_FileCount -= 1; +} + static void Files_Finalize (SYSTEM_PTR o) { Files_File f = NIL; diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index dca42164..355916fa 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h @@ -10,9 +10,8 @@ typedef typedef struct Files_FileDesc { - char _prvt0[224]; - INT32 fd; - char _prvt1[32]; + INT32 _prvt0; + char _prvt1[256]; } Files_FileDesc; typedef diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index ae9ffcfb..88e5fa50 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index 0cf94754..313d111e 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index e4fa8467..8ce1e8f3 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -250,6 +250,7 @@ static void Modules_DisplayHaltCode (INT32 code) void Modules_Halt (INT32 code) { + Heap_FINALL(); Modules_errstring((CHAR*)"Terminated by Halt(", 20); Modules_errint(code); Modules_errstring((CHAR*)"). ", 4); @@ -262,6 +263,7 @@ void Modules_Halt (INT32 code) void Modules_AssertFail (INT32 code) { + Heap_FINALL(); Modules_errstring((CHAR*)"Assertion failure.", 19); if (code != 0) { Modules_errstring((CHAR*)" ASSERT code ", 14); diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index d1227884..2bd2b5da 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index f174acdc..d34d0f9b 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index 1efe3cf3..084b0534 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 4759eb74..6b592341 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index a485b3c4..5219140a 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 34ca07fd..f54fae67 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -640,7 +640,6 @@ static void OPM_ShowLine (INT64 pos) OPM_LogVT100((CHAR*)"32m", 4); OPM_LogW('^'); OPM_LogVT100((CHAR*)"0m", 3); - Files_Close(f); } void OPM_Mark (INT16 n, INT32 pos) diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index 0b19f055..cd390d68 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index aef61fc9..b4ed079b 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index 6629924c..ab972651 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index d5c0c747..6028caf7 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index 87418922..ad1dc868 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index b4a68499..7ed72408 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index 019dee31..7c1139c0 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index ef5a6f06..9250891d 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index 401db9dd..296c8975 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Out.c b/bootstrap/windows-48/Out.c index 7b3897d4..eae902f9 100644 --- a/bootstrap/windows-48/Out.c +++ b/bootstrap/windows-48/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Out.h b/bootstrap/windows-48/Out.h index f58803a5..44a26650 100644 --- a/bootstrap/windows-48/Out.h +++ b/bootstrap/windows-48/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 1dc027fb..518cb928 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index 1154e6b1..35a0878d 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 5361bdcd..fe5db80a 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index cc2755f0..e791f967 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index 230f60a9..7c07366c 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index ad07bc6d..96231bce 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index ffda81d3..68aa0310 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index ef53cdf5..2635c7ad 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/VT100.c b/bootstrap/windows-48/VT100.c index 57d8a782..6646a439 100644 --- a/bootstrap/windows-48/VT100.c +++ b/bootstrap/windows-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/VT100.h b/bootstrap/windows-48/VT100.h index 5e32e01b..ee7770b0 100644 --- a/bootstrap/windows-48/VT100.h +++ b/bootstrap/windows-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index 18e626a3..e450651e 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index 622a5a55..aea1841e 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/Compiler.c b/bootstrap/windows-88/Compiler.c index 6200dcea..19053dd2 100644 --- a/bootstrap/windows-88/Compiler.c +++ b/bootstrap/windows-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index 13c1e7ff..d0de3d5d 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index 6f418c8a..2cc1873a 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 517844d9..134741a5 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -233,7 +233,8 @@ static void Files_Create (Files_File f) if (f->state == 1) { Files_GetTempName(f->registerName, 101, (void*)f->workName, 101); f->tempFile = 1; - } else if (f->state == 2) { + } else { + __ASSERT(f->state == 2, 0); __COPY(f->registerName, f->workName, 101); f->registerName[0] = 0x00; f->tempFile = 0; @@ -285,27 +286,6 @@ static void Files_Flush (Files_Buffer buf) } } -static void Files_CloseOSFile (Files_File f) -{ - Files_File prev = NIL; - INT16 error; - if (Files_files == f) { - Files_files = f->next; - } else { - prev = Files_files; - while ((prev != NIL && prev->next != f)) { - prev = prev->next; - } - if (prev->next != NIL) { - prev->next = f->next; - } - } - error = Platform_Close(f->fd); - f->fd = -1; - f->state = 1; - Heap_FileCount -= 1; -} - void Files_Close (Files_File f) { INT32 i; @@ -317,7 +297,6 @@ void Files_Close (Files_File f) Files_Flush(f->bufs[i]); i += 1; } - Files_CloseOSFile(f); } } @@ -466,6 +445,7 @@ Files_File Files_Old (CHAR *name, ADDRESS name__len) error = Platform_Identify(fd, &identity, Platform_FileIdentity__typ); f = Files_CacheEntry(identity); if (f != NIL) { + error = Platform_Close(fd); __DEL(name); return f; } else { @@ -806,7 +786,6 @@ void Files_Register (Files_File f) { INT16 idx, errcode; Files_File f1 = NIL; - CHAR file[104]; if ((f->state == 1 && f->registerName[0] != 0x00)) { f->state = 2; } @@ -814,8 +793,7 @@ void Files_Register (Files_File f) if (f->registerName[0] != 0x00) { Files_Rename(f->workName, 101, f->registerName, 101, &errcode); if (errcode != 0) { - __COPY(f->registerName, file, 104); - __HALT(99); + Files_Err((CHAR*)"Couldn't rename temp name as register name", 43, f, errcode); } __COPY(f->registerName, f->workName, 101); f->registerName[0] = 0x00; @@ -1007,6 +985,27 @@ void Files_GetName (Files_File f, CHAR *name, ADDRESS name__len) __COPY(f->workName, name, name__len); } +static void Files_CloseOSFile (Files_File f) +{ + Files_File prev = NIL; + INT16 error; + if (Files_files == f) { + Files_files = f->next; + } else { + prev = Files_files; + while ((prev != NIL && prev->next != f)) { + prev = prev->next; + } + if (prev->next != NIL) { + prev->next = f->next; + } + } + error = Platform_Close(f->fd); + f->fd = -1; + f->state = 1; + Heap_FileCount -= 1; +} + static void Files_Finalize (SYSTEM_PTR o) { Files_File f = NIL; diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 4453e976..3cd0b80b 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h @@ -10,9 +10,8 @@ typedef typedef struct Files_FileDesc { - char _prvt0[224]; - INT64 fd; - char _prvt1[56]; + INT64 _prvt0; + char _prvt1[280]; } Files_FileDesc; typedef diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index ac52c6ae..afc96221 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index 9daf685d..e8a34cc3 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index f1d1a614..e161f52a 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -250,6 +250,7 @@ static void Modules_DisplayHaltCode (INT32 code) void Modules_Halt (INT32 code) { + Heap_FINALL(); Modules_errstring((CHAR*)"Terminated by Halt(", 20); Modules_errint(code); Modules_errstring((CHAR*)"). ", 4); @@ -262,6 +263,7 @@ void Modules_Halt (INT32 code) void Modules_AssertFail (INT32 code) { + Heap_FINALL(); Modules_errstring((CHAR*)"Assertion failure.", 19); if (code != 0) { Modules_errstring((CHAR*)" ASSERT code ", 14); diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index d1227884..2bd2b5da 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index f174acdc..d34d0f9b 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index 1efe3cf3..084b0534 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index 4759eb74..6b592341 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index a485b3c4..5219140a 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 5820c0cc..944cb3df 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -640,7 +640,6 @@ static void OPM_ShowLine (INT64 pos) OPM_LogVT100((CHAR*)"32m", 4); OPM_LogW('^'); OPM_LogVT100((CHAR*)"0m", 3); - Files_Close(f); } void OPM_Mark (INT16 n, INT32 pos) diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index 0b19f055..cd390d68 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index ccf8dbe4..5b8ca3cb 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index 6629924c..ab972651 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index d5c0c747..6028caf7 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index 87418922..ad1dc868 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index 8122f444..50fa7c31 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 019dee31..7c1139c0 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index a03a1aab..70113cd4 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index 401db9dd..296c8975 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Out.c b/bootstrap/windows-88/Out.c index 7b3897d4..eae902f9 100644 --- a/bootstrap/windows-88/Out.c +++ b/bootstrap/windows-88/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Out.h b/bootstrap/windows-88/Out.h index f58803a5..44a26650 100644 --- a/bootstrap/windows-88/Out.h +++ b/bootstrap/windows-88/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 37b61a0f..954ef044 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index eff1e977..c39b5ac2 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 5361bdcd..fe5db80a 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index cc2755f0..e791f967 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index 230f60a9..7c07366c 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index ad07bc6d..96231bce 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index 79492c57..590a2041 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index 9042b9b8..1d12b7c6 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/VT100.c b/bootstrap/windows-88/VT100.c index 57d8a782..6646a439 100644 --- a/bootstrap/windows-88/VT100.c +++ b/bootstrap/windows-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/VT100.h b/bootstrap/windows-88/VT100.h index 5e32e01b..ee7770b0 100644 --- a/bootstrap/windows-88/VT100.h +++ b/bootstrap/windows-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index 18e626a3..e450651e 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index 622a5a55..aea1841e 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h From 0e1c5fe498d8de3774e74f47f8e35472c8142c9c Mon Sep 17 00:00:00 2001 From: norayr Date: Wed, 30 Nov 2016 19:39:26 +0400 Subject: [PATCH 355/580] ulm library compiled by fixing integer, longint, shortint and set sizes. -- noch --- src/library/ulm/ulmAssertions.Mod | 2 +- src/library/ulm/ulmAsymmetricCiphers.Mod | 12 +- src/library/ulm/ulmBlockCiphers.Mod | 16 +- src/library/ulm/ulmCipherOps.Mod | 10 +- src/library/ulm/ulmCiphers.Mod | 8 +- src/library/ulm/ulmClocks.Mod | 8 +- src/library/ulm/ulmConclusions.Mod | 12 +- src/library/ulm/ulmConditions.Mod | 44 ++-- src/library/ulm/ulmConstStrings.Mod | 50 ++-- src/library/ulm/ulmEvents.Mod | 30 +-- src/library/ulm/ulmIO.Mod | 38 +-- src/library/ulm/ulmIntOperations.Mod | 18 +- src/library/ulm/ulmMC68881.Mod | 56 ++--- src/library/ulm/ulmNetIO.Mod | 58 ++--- src/library/ulm/ulmOperations.Mod | 10 +- src/library/ulm/ulmPersistentObjects.Mod | 28 +-- src/library/ulm/ulmPlotters.Mod | 44 ++-- src/library/ulm/ulmPrint.Mod | 292 ++++++++++++----------- src/library/ulm/ulmPriorities.Mod | 4 +- src/library/ulm/ulmProcess.Mod | 6 +- src/library/ulm/ulmRandomGenerators.Mod | 40 ++-- src/library/ulm/ulmReals.Mod | 52 ++-- src/library/ulm/ulmScales.Mod | 20 +- src/library/ulm/ulmServices.Mod | 34 +-- src/library/ulm/ulmSets.Mod | 53 ++-- src/library/ulm/ulmStreamDisciplines.Mod | 12 +- src/library/ulm/ulmStreams.Mod | 28 +-- src/library/ulm/ulmStrings.Mod | 26 +- src/library/ulm/ulmSysConversions.Mod | 74 +++--- src/library/ulm/ulmSysErrors.Mod | 18 +- src/library/ulm/ulmSysIO.Mod | 44 ++-- src/library/ulm/ulmSysStat.Mod | 52 ++-- src/library/ulm/ulmSysTypes.Mod | 12 +- src/library/ulm/ulmTCrypt.Mod | 123 +++++----- src/library/ulm/ulmTimers.Mod | 6 +- src/library/ulm/ulmTimes.Mod | 14 +- src/library/ulm/ulmTypes.Mod | 62 ++--- src/library/ulm/ulmWrite.Mod | 38 +-- src/tools/make/oberon.mk | 2 +- 39 files changed, 733 insertions(+), 723 deletions(-) diff --git a/src/library/ulm/ulmAssertions.Mod b/src/library/ulm/ulmAssertions.Mod index 0f6fe59e..dcceea08 100644 --- a/src/library/ulm/ulmAssertions.Mod +++ b/src/library/ulm/ulmAssertions.Mod @@ -35,7 +35,7 @@ MODULE ulmAssertions; (* general error handling of library routines *) - IMPORT Disciplines := ulmDisciplines, Events := ulmEvents, IO := ulmIO, Priorities := ulmPriorities, RelatedEvents := ulmRelatedEvents, Services := ulmServices; + IMPORT Disciplines := ulmDisciplines, Events := ulmEvents, IO := ulmIO, Priorities := ulmPriorities, RelatedEvents := ulmRelatedEvents, Services := ulmServices, Types := ulmTypes; TYPE Object = Disciplines.Object; diff --git a/src/library/ulm/ulmAsymmetricCiphers.Mod b/src/library/ulm/ulmAsymmetricCiphers.Mod index ba8dfdda..069972bd 100644 --- a/src/library/ulm/ulmAsymmetricCiphers.Mod +++ b/src/library/ulm/ulmAsymmetricCiphers.Mod @@ -30,13 +30,13 @@ MODULE ulmAsymmetricCiphers; (* Michael Szczuka *) (* abstraction for the use of public key ciphers *) - IMPORT BlockCiphers := ulmBlockCiphers, Ciphers := ulmCiphers, NetIO := ulmNetIO, PersistentObjects := ulmPersistentObjects, Services := ulmServices, Streams := ulmStreams; + IMPORT BlockCiphers := ulmBlockCiphers, Ciphers := ulmCiphers, NetIO := ulmNetIO, PersistentObjects := ulmPersistentObjects, Services := ulmServices, Streams := ulmStreams, Types := ulmTypes; CONST composed* = 0; isPrivateKey* = 1; TYPE - CapabilitySet* = SET; + CapabilitySet* = Types.Set; TYPE Cipher* = POINTER TO CipherRec; @@ -66,13 +66,13 @@ MODULE ulmAsymmetricCiphers; (* Michael Szczuka *) (* need to have this in case anyone wants to decrypt something with a public cipher ... *) PROCEDURE Identity(in: Streams.Stream; key: Ciphers.Cipher; - length: INTEGER; out: Streams.Stream) : BOOLEAN; + length: Types.Int32; out: Streams.Stream) : BOOLEAN; BEGIN RETURN Streams.Copy(in, out, length); END Identity; PROCEDURE Init* (key: Cipher; if: Interface; - cap: CapabilitySet; inLength, outLength: INTEGER); + cap: CapabilitySet; inLength, outLength: Types.Int32); BEGIN IF if.decrypt = NIL THEN (* decrypt is not defined, so we have only the public part of a cipher; @@ -122,7 +122,7 @@ MODULE ulmAsymmetricCiphers; (* Michael Szczuka *) END ComposedEncrypt; PROCEDURE ComposedEncryptPart* (in: Streams.Stream; key: Cipher; - length: INTEGER; + length: Types.Int32; out: Streams.Stream) : BOOLEAN; BEGIN RETURN key.asymIf.compencrypt(in, key, length, out); @@ -131,7 +131,7 @@ MODULE ulmAsymmetricCiphers; (* Michael Szczuka *) PROCEDURE ComposedEncryptBlock* (in: Streams.Stream; key: Cipher; out: Streams.Stream) : BOOLEAN; VAR - length : INTEGER; + length : Types.Int32; BEGIN length := BlockCiphers.GetInLength(key); RETURN key.asymIf.compencrypt(in, key, length, out); diff --git a/src/library/ulm/ulmBlockCiphers.Mod b/src/library/ulm/ulmBlockCiphers.Mod index 41e3355c..630b4c91 100644 --- a/src/library/ulm/ulmBlockCiphers.Mod +++ b/src/library/ulm/ulmBlockCiphers.Mod @@ -30,7 +30,7 @@ MODULE ulmBlockCiphers; (* Michael Szczuka *) (* abstraction for the use of block ciphers *) - IMPORT Ciphers := ulmCiphers, NetIO := ulmNetIO, PersistentObjects := ulmPersistentObjects, Services := ulmServices, Streams := ulmStreams; + IMPORT Ciphers := ulmCiphers, NetIO := ulmNetIO, PersistentObjects := ulmPersistentObjects, Services := ulmServices, Streams := ulmStreams, Types := ulmTypes; TYPE Cipher* = POINTER TO CipherRec; @@ -38,8 +38,8 @@ MODULE ulmBlockCiphers; (* Michael Szczuka *) CipherRec* = RECORD (Ciphers.CipherRec) (* private *) - inLength: INTEGER; - outLength: INTEGER; + inLength: Types.Int32; + outLength: Types.Int32; END; VAR @@ -47,7 +47,7 @@ MODULE ulmBlockCiphers; (* Michael Szczuka *) if : PersistentObjects.Interface; PROCEDURE Init* (key: Cipher; if: Ciphers.Interface; - inLength, outLength: INTEGER); + inLength, outLength: Types.Int32); (* init a block cipher with its special interface *) BEGIN Ciphers.Init(key, if); @@ -57,13 +57,13 @@ MODULE ulmBlockCiphers; (* Michael Szczuka *) key.outLength := outLength; END Init; - PROCEDURE GetInLength* (key: Cipher) : INTEGER; + PROCEDURE GetInLength* (key: Cipher) : Types.Int32; (* returns the input block length of a block cipher *) BEGIN RETURN key.inLength; END GetInLength; - PROCEDURE GetOutLength* (key: Cipher) : INTEGER; + PROCEDURE GetOutLength* (key: Cipher) : Types.Int32; (* returns the output block length of a block cipher *) BEGIN RETURN key.outLength; @@ -72,7 +72,7 @@ MODULE ulmBlockCiphers; (* Michael Szczuka *) PROCEDURE EncryptBlock* (in: Streams.Stream; key: Cipher; out: Streams.Stream) : BOOLEAN; VAR - length : INTEGER; + length : Types.Int32; BEGIN length := GetInLength(key); RETURN Ciphers.EncryptPart(in, key, length, out); @@ -81,7 +81,7 @@ MODULE ulmBlockCiphers; (* Michael Szczuka *) PROCEDURE DecryptBlock* (in: Streams.Stream; key: Cipher; out: Streams.Stream) : BOOLEAN; VAR - length : INTEGER; + length : Types.Int32; BEGIN length := GetOutLength(key); RETURN Ciphers.DecryptPart(in, key, length, out); diff --git a/src/library/ulm/ulmCipherOps.Mod b/src/library/ulm/ulmCipherOps.Mod index f2ef7602..39d951c2 100644 --- a/src/library/ulm/ulmCipherOps.Mod +++ b/src/library/ulm/ulmCipherOps.Mod @@ -30,18 +30,18 @@ MODULE ulmCipherOps; (* Michael Szczuka *) (* useful functions for stream ciphers *) - IMPORT Streams := ulmStreams, SYS := SYSTEM, Write := ulmWrite; + IMPORT Streams := ulmStreams, SYS := SYSTEM, Write := ulmWrite, Types := ulmTypes; PROCEDURE XorByte* (b1, b2: SYS.BYTE) : SYS.BYTE; (* adds two bytes bitwise modulo 2 *) BEGIN - (*RETURN SYS.VAL(SYS.BYTE, SYS.VAL(SET, LONG(b1)) / SYS.VAL(SET, LONG(b2)))*) - RETURN SYS.VAL(SYS.BYTE, SYS.VAL(SET, LONG(LONG(SYS.VAL(SHORTINT, b1)))) - / SYS.VAL(SET, LONG(LONG(SYS.VAL(SHORTINT, b2))))) + (*RETURN SYS.VAL(SYS.BYTE, SYS.VAL(Types.Set, LONG(b1)) / SYS.VAL(Types.Set, LONG(b2)))*) + RETURN SYS.VAL(SYS.BYTE, SYS.VAL(Types.Set, LONG(LONG(SYS.VAL(Types.Int8, b1)))) + / SYS.VAL(Types.Set, LONG(LONG(SYS.VAL(Types.Int8, b2))))) END XorByte; PROCEDURE XorStream* (in1, in2, out: Streams.Stream; - length: INTEGER) : BOOLEAN; + length: Types.Int32) : BOOLEAN; (* adds two streams bitwise modulo 2; restricted to length bytes *) VAR b1, b2, res : SYS.BYTE; diff --git a/src/library/ulm/ulmCiphers.Mod b/src/library/ulm/ulmCiphers.Mod index 95d66aa8..fbd97445 100644 --- a/src/library/ulm/ulmCiphers.Mod +++ b/src/library/ulm/ulmCiphers.Mod @@ -30,14 +30,14 @@ MODULE ulmCiphers; IMPORT Objects := ulmObjects, PersistentObjects := ulmPersistentObjects, PersistentDisciplines := ulmPersistentDisciplines, Services := ulmServices, - Streams := ulmStreams, Write := ulmWrite; + Streams := ulmStreams, Write := ulmWrite, Types := ulmTypes; TYPE Cipher* = POINTER TO CipherRec; TYPE CryptProc* = PROCEDURE (in: Streams.Stream; key: Cipher; - length: INTEGER; out: Streams.Stream) : BOOLEAN; + length: Types.Int32; out: Streams.Stream) : BOOLEAN; TYPE Interface* = POINTER TO InterfaceRec; @@ -77,13 +77,13 @@ BEGIN END Decrypt; PROCEDURE EncryptPart*(in: Streams.Stream; key: Cipher; - length: INTEGER; out: Streams.Stream) : BOOLEAN; + length: Types.Int32; out: Streams.Stream) : BOOLEAN; BEGIN RETURN key.if.encrypt(in, key, length, out); END EncryptPart; PROCEDURE DecryptPart*(in: Streams.Stream; key: Cipher; - length: INTEGER; out: Streams.Stream) : BOOLEAN; + length: Types.Int32; out: Streams.Stream) : BOOLEAN; BEGIN RETURN key.if.decrypt(in, key, length, out); END DecryptPart; diff --git a/src/library/ulm/ulmClocks.Mod b/src/library/ulm/ulmClocks.Mod index d0416cfb..6a72d661 100644 --- a/src/library/ulm/ulmClocks.Mod +++ b/src/library/ulm/ulmClocks.Mod @@ -37,7 +37,7 @@ MODULE ulmClocks; IMPORT Disciplines := ulmDisciplines, Events := ulmEvents, Objects := ulmObjects, Op := ulmOperations, Priorities := ulmPriorities, - RelatedEvents := ulmRelatedEvents, Services := ulmServices, Times := ulmTimes; + RelatedEvents := ulmRelatedEvents, Services := ulmServices, Times := ulmTimes, Types := ulmTypes; TYPE Clock* = POINTER TO ClockRec; @@ -45,7 +45,7 @@ MODULE ulmClocks; CONST settime* = 0; timer* = 1; passed* = 2; TYPE - CapabilitySet* = SET; (* OF [settime..passed] *) + CapabilitySet* = Types.Set; (* OF [settime..passed] *) TYPE GetTimeProc* = PROCEDURE (clock: Clock; VAR time: Times.Time); SetTimeProc* = PROCEDURE (clock: Clock; time: Times.Time); @@ -102,13 +102,13 @@ MODULE ulmClocks; ErrorEventRec* = RECORD (Events.EventRec) - errorcode*: SHORTINT; + errorcode*: Types.Int8; END; VAR errormsg*: ARRAY errorcodes OF Events.Message; error*: Events.EventType; - PROCEDURE Error(clock: Clock; code: SHORTINT); + PROCEDURE Error(clock: Clock; code: Types.Int8); VAR event: ErrorEvent; BEGIN diff --git a/src/library/ulm/ulmConclusions.Mod b/src/library/ulm/ulmConclusions.Mod index 2d0a6ade..7012b15c 100644 --- a/src/library/ulm/ulmConclusions.Mod +++ b/src/library/ulm/ulmConclusions.Mod @@ -39,22 +39,22 @@ MODULE ulmConclusions; *) IMPORT Errors := ulmErrors, Events := ulmEvents, Process := ulmProcess, RelatedEvents := ulmRelatedEvents, StreamDisciplines := ulmStreamDisciplines, - Streams := ulmStreams, Strings := ulmStrings, Write := ulmWrite; + Streams := ulmStreams, Strings := ulmStrings, Write := ulmWrite, Types := ulmTypes; VAR handlerSet*: Errors.HandlerSet; - errors*: INTEGER; (* number of errors *) - fatalcode*: INTEGER; (* exit code on fatal events *) + errors*: Types.Int32; (* number of errors *) + fatalcode*: Types.Int32; (* exit code on fatal events *) (* private variables *) cmdName: Process.Name; (* should be sufficient for a base name *) - cmdNameLen: INTEGER; (* Strings.Len(cmdName) *) + cmdNameLen: Types.Int32; (* Strings.Len(cmdName) *) (* private procedures *) PROCEDURE GeneralHandler(event: Events.Event; kind: Errors.Kind); VAR - width: INTEGER; + width: Types.Int32; BEGIN IF event # NIL THEN Write.IndentS(Streams.stderr); @@ -114,7 +114,7 @@ MODULE ulmConclusions; text: ARRAY OF CHAR); VAR queue: RelatedEvents.Queue; - width: INTEGER; + width: Types.Int32; PROCEDURE ReverseQueue(VAR queue: RelatedEvents.Queue); VAR diff --git a/src/library/ulm/ulmConditions.Mod b/src/library/ulm/ulmConditions.Mod index 2b983470..101d590c 100644 --- a/src/library/ulm/ulmConditions.Mod +++ b/src/library/ulm/ulmConditions.Mod @@ -60,12 +60,12 @@ MODULE ulmConditions; IMPORT Clocks := ulmClocks, Disciplines := ulmDisciplines, Events := ulmEvents, Objects := ulmObjects, Op := ulmOperations, - Priorities := ulmPriorities, Process := ulmProcess, RelatedEvents := ulmRelatedEvents, Scales := ulmScales, Timers := ulmTimers, Times := ulmTimes, SYSTEM; + Priorities := ulmPriorities, Process := ulmProcess, RelatedEvents := ulmRelatedEvents, Scales := ulmScales, Timers := ulmTimers, Times := ulmTimes, SYSTEM, Types := ulmTypes; CONST tags = 64; TYPE - Tag = INTEGER; (* 0..tags-1 *) + Tag = Types.Int32; (* 0..tags-1 *) (* tags are used for the hashs *) VAR nextTag: Tag; (* 0..tags-1, 0..tags-1, ... *) @@ -95,16 +95,16 @@ MODULE ulmConditions; ConditionSetRec* = RECORD (Objects.ObjectRec) - cardinality: INTEGER; + cardinality: Types.Int32; bucket: BucketTable; (* for the iterator *) - next: ConditionList; i: INTEGER; + next: ConditionList; i: Types.Int32; END; CONST select* = 0; timelimit* = 1; async* = 2; timecond* = 3; preconditions* = 4; TYPE - CapabilitySet* = SET; (* OF [select..preconditions] *) + CapabilitySet* = Types.Set; (* OF [select..preconditions] *) TYPE SelectProc* = PROCEDURE (domain: Domain; conditionSet: ConditionSet; time: Times.Time; @@ -159,7 +159,7 @@ MODULE ulmConditions; END; TYPE - GetTimeOfNextTryProc* = PROCEDURE (iteration: INTEGER; + GetTimeOfNextTryProc* = PROCEDURE (iteration: Types.Int32; VAR time: Times.Time); (* return a relative time measure *) VAR @@ -188,7 +188,7 @@ MODULE ulmConditions; getTimeOfNextTry := p; END SetGetTimeOfNextTryProc; - PROCEDURE GetTimeOfNextTry(iteration: INTEGER; VAR time: Times.Time); + PROCEDURE GetTimeOfNextTry(iteration: Types.Int32; VAR time: Times.Time); BEGIN Times.CreateAndSet(time, Times.relative, 0, 1, 0); iteration := iteration DIV 5; @@ -203,7 +203,7 @@ MODULE ulmConditions; PROCEDURE CreateSet*(VAR conditionSet: ConditionSet); VAR - i: INTEGER; + i: Types.Int32; cset: ConditionSet; BEGIN NEW(cset); @@ -226,7 +226,7 @@ MODULE ulmConditions; VAR listp: ConditionList; new: ConditionList; - i: INTEGER; + i: Types.Int32; BEGIN (* check if condition is already present in conditionSet *) i := condition.tag; @@ -245,7 +245,7 @@ MODULE ulmConditions; PROCEDURE Excl*(conditionSet: ConditionSet; condition: Condition); VAR prev, listp: ConditionList; - i: INTEGER; + i: Types.Int32; BEGIN i := condition.tag; listp := conditionSet.bucket[i]; prev := NIL; @@ -282,8 +282,8 @@ MODULE ulmConditions; VAR listp: ConditionList; newelem, newelems: ConditionList; - count: INTEGER; (* # of added elements in newelems *) - i: INTEGER; + count: Types.Int32; (* # of added elements in newelems *) + i: Types.Int32; BEGIN count := 0; i := 0; @@ -320,7 +320,7 @@ MODULE ulmConditions; CreateSet(result); Union(result, set1); Union(result, set2); END Union3; - PROCEDURE Card*(conditionSet: ConditionSet) : INTEGER; + PROCEDURE Card*(conditionSet: ConditionSet) : Types.Int32; BEGIN RETURN conditionSet.cardinality END Card; @@ -334,7 +334,7 @@ MODULE ulmConditions; PROCEDURE GetNextCondition*(conditionSet: ConditionSet; VAR condition: Condition) : BOOLEAN; VAR - i: INTEGER; + i: Types.Int32; BEGIN IF conditionSet.next = NIL THEN i := conditionSet.i; @@ -380,7 +380,7 @@ MODULE ulmConditions; VAR domain: Domain) : BOOLEAN; VAR dom: Domain; - i: INTEGER; + i: Types.Int32; listp: ConditionList; BEGIN dom := NIL; @@ -448,7 +448,7 @@ MODULE ulmConditions; VAR listp: ConditionList; - i: INTEGER; + i: Types.Int32; PROCEDURE CreateList(VAR list: List); BEGIN @@ -555,7 +555,7 @@ MODULE ulmConditions; PROCEDURE SetupAsyncEvents(list: List) : BOOLEAN; VAR elp: Element; - listp: ConditionList; i: INTEGER; + listp: ConditionList; i: Types.Int32; wakeupEvent: WakeupEvent; sendevent: SendEventProc; anythingTrue: BOOLEAN; @@ -603,7 +603,7 @@ MODULE ulmConditions; queue: RelatedEvents.Queue; (* queue of waitErrors *) busyLoop: BOOLEAN; (* TRUE if we have to resort to a busy loop *) wakeupEvent: Events.Event; (* iteration event for busy loops *) - loopCnt: INTEGER; (* number of iterations *) + loopCnt: Types.Int32; (* number of iterations *) nextTime: Times.Time; minTime: Times.Time; minTimeCond: Condition; @@ -679,7 +679,7 @@ MODULE ulmConditions; VAR setOfTrueConditions: ConditionSet; errors: RelatedEvents.Object) : BOOLEAN; VAR - listp: ConditionList; i: INTEGER; + listp: ConditionList; i: Types.Int32; condition: Condition; anythingTrue: BOOLEAN; BEGIN (* TestAndSelect *) @@ -728,7 +728,7 @@ MODULE ulmConditions; PROCEDURE TestAsyncList(list: List) : BOOLEAN; VAR element: Element; - listp: ConditionList; i: INTEGER; + listp: ConditionList; i: Types.Int32; condition: Condition; anythingFound: BOOLEAN; BEGIN @@ -872,7 +872,7 @@ MODULE ulmConditions; VAR setOfTrueConditions: ConditionSet; errors: RelatedEvents.Object); VAR - listp: ConditionList; i: INTEGER; + listp: ConditionList; i: Types.Int32; testSet: ConditionSet; preconds: ConditionSet; domain: Domain; @@ -881,7 +881,7 @@ MODULE ulmConditions; PROCEDURE PretestClosure(testSet, preconds: ConditionSet); VAR - listp: ConditionList; i: INTEGER; + listp: ConditionList; i: Types.Int32; domain: Domain; morePreconditions: ConditionSet; evenMorePreconditions: ConditionSet; diff --git a/src/library/ulm/ulmConstStrings.Mod b/src/library/ulm/ulmConstStrings.Mod index ae62e3b7..61f73a28 100644 --- a/src/library/ulm/ulmConstStrings.Mod +++ b/src/library/ulm/ulmConstStrings.Mod @@ -49,8 +49,7 @@ MODULE ulmConstStrings; (* WORM-device for strings *) - IMPORT Disciplines := ulmDisciplines, Events := ulmEvents, Objects := ulmObjects, Process := ulmProcess, Services := ulmServices, Streams := ulmStreams, Strings := ulmStrings, - Texts := ulmTexts, Types := ulmTypes; + IMPORT Disciplines := ulmDisciplines, Events := ulmEvents, Objects := ulmObjects, Process := ulmProcess, Services := ulmServices, Streams := ulmStreams, Strings := ulmStrings, Texts := ulmTexts, Types := ulmTypes; CONST tabsize = 1031; (* should be a prime number *) @@ -65,7 +64,7 @@ MODULE ulmConstStrings; BufferRec = RECORD buf: ARRAY bufsize OF CHAR; - free: INTEGER; (* buf[free..bufsize-1] is unused *) + free: Types.Int32; (* buf[free..bufsize-1] is unused *) next: Buffer; END; @@ -74,17 +73,17 @@ MODULE ulmConstStrings; RECORD (Disciplines.ObjectRec) (* read-only *) - len-: Streams.Count; (* length of string in bytes *) - hashval-: LONGINT; (* hash value *) + len*: Streams.Count; (* length of string in bytes *) + hashval*: Types.Int32; (* hash value *) (* private part *) domain: Domain; length: Streams.Count; (* private copy of length *) buf: Buffer; (* first buffer containing the string *) - offset: INTEGER; (* offset into buf *) + offset: Types.Int32; (* offset into buf *) next: String; (* list of strings with same hash value *) END; - TYPE + TYPE DomainRec* = RECORD (Disciplines.ObjectRec) @@ -108,7 +107,7 @@ MODULE ulmConstStrings; (Streams.StreamRec) string: String; buf: Buffer; (* current buffer *) - offset: INTEGER; (* index in current buffer *) + offset: Types.Int32; (* index in current buffer *) pos: Streams.Count; (* current position *) END; @@ -121,7 +120,7 @@ MODULE ulmConstStrings; (* === internal procedures =========================================== *) PROCEDURE HashVal(s: Streams.Stream; len: Streams.Count; - VAR hashval, orighashval: LONGINT); + VAR hashval, orighashval: Types.Int32); (* compute the hash value of the first `len' bytes of `s'; the hash value is returned in two variants: hashval: hash value MOD tabsize @@ -130,7 +129,7 @@ MODULE ulmConstStrings; CONST shift = 4; VAR - ordval: INTEGER; + ordval: Types.Int32; ch: CHAR; index: Streams.Count; @@ -159,7 +158,7 @@ MODULE ulmConstStrings; *) VAR ch: CHAR; - buf: Buffer; offset: INTEGER; + buf: Buffer; offset: Types.Int32; index: Streams.Count; BEGIN Streams.SetPos(s, 0); @@ -183,7 +182,7 @@ MODULE ulmConstStrings; END Equal; PROCEDURE Allocate(domain: Domain; len: Streams.Count; - VAR buf: Buffer; VAR offset: INTEGER); + VAR buf: Buffer; VAR offset: Types.Int32); (* allocate space for `len' bytes; `buf' and `offset' are returned, designating the begin of the allocated area; note that @@ -214,9 +213,9 @@ MODULE ulmConstStrings; offset := buf.free; WHILE len > 0 DO IF len <= bufsize - domain.tail.free THEN - INC(domain.tail.free, SHORT(len)); len := 0; + INC(domain.tail.free, len); len := 0; ELSE - DEC(len, bufsize - LONG(domain.tail.free)); + DEC(len, bufsize - domain.tail.free); domain.tail.free := bufsize; NewBuffer; END; @@ -224,7 +223,7 @@ MODULE ulmConstStrings; END Allocate; PROCEDURE CopyString(s: Streams.Stream; length: Streams.Count; - buf: Buffer; offset: INTEGER); + buf: Buffer; offset: Types.Int32); (* copy `length' bytes from `s' to `buf' at the given offset and its subsequent buffers *) @@ -254,7 +253,7 @@ MODULE ulmConstStrings; VAR string: String); (* common part of CloseD and CreateD *) VAR - orighashval, hashval: LONGINT; + orighashval, hashval: Types.Int32; str: String; BEGIN HashVal(s, length, hashval, orighashval); @@ -358,7 +357,7 @@ MODULE ulmConstStrings; s := rs; END Open; - PROCEDURE Compare*(string1, string2: String) : INTEGER; + PROCEDURE Compare*(string1, string2: String) : Types.Int32; (* returns < 0: if string1 < string2 = 0: if string1 = string2 (see note above) > 0: if string1 > string2 @@ -366,10 +365,10 @@ MODULE ulmConstStrings; VAR ch1, ch2: CHAR; buf1, buf2: Buffer; - offset1, offset2: INTEGER; + offset1, offset2: Types.Int32; len1, len2: Streams.Count; - PROCEDURE Next(VAR buf: Buffer; VAR offset: INTEGER; VAR ch: CHAR); + PROCEDURE Next(VAR buf: Buffer; VAR offset: Types.Int32; VAR ch: CHAR); BEGIN ch := buf.buf[offset]; INC(offset); @@ -409,7 +408,7 @@ MODULE ulmConstStrings; VAR len: Streams.Count; buf: Buffer; - offset: INTEGER; + offset: Types.Int32; count: Streams.Count; bytes: Streams.Count; BEGIN @@ -427,7 +426,7 @@ MODULE ulmConstStrings; INC(count, s.count); EXIT END; - INC(count, bytes); DEC(len, bytes); INC(offset, SHORT(bytes)); + INC(count, bytes); DEC(len, bytes); INC(offset, bytes); IF offset >= bufsize THEN buf := buf.next; offset := 0; @@ -441,7 +440,7 @@ MODULE ulmConstStrings; VAR len: Streams.Count; buf: Buffer; - offset: INTEGER; + offset: Types.Int32; index: Streams.Count; BEGIN len := string.length; @@ -480,7 +479,7 @@ MODULE ulmConstStrings; END; END ReadByte; - PROCEDURE ReadBuf(s: Streams.Stream; VAR buf: ARRAY OF Types.Byte(*BYTE*); + PROCEDURE ReadBuf(s: Streams.Stream; VAR buf: ARRAY OF Types.Byte; off, cnt: Streams.Count) : Streams.Count; VAR bytes, max: Streams.Count; @@ -520,7 +519,6 @@ MODULE ulmConstStrings; | Streams.fromStart: realpos := cnt; | Streams.fromPos: realpos := s.pos + cnt; | Streams.fromEnd: realpos := s.string.length + cnt; - ELSE END; IF (realpos < 0) OR (realpos > s.string.length) THEN RETURN FALSE @@ -531,10 +529,10 @@ MODULE ulmConstStrings; END; WHILE s.pos < realpos DO IF realpos - s.pos < bufsize - s.offset THEN - INC(s.offset, SHORT(realpos - s.pos)); + INC(s.offset, realpos - s.pos); s.pos := realpos; ELSE - INC(s.pos, LONG(bufsize - s.offset)); + INC(s.pos, bufsize - s.offset); s.offset := 0; s.buf := s.buf.next; END; diff --git a/src/library/ulm/ulmEvents.Mod b/src/library/ulm/ulmEvents.Mod index 52695762..07deb129 100644 --- a/src/library/ulm/ulmEvents.Mod +++ b/src/library/ulm/ulmEvents.Mod @@ -39,7 +39,7 @@ MODULE ulmEvents; - IMPORT Objects := ulmObjects, Priorities := ulmPriorities, Services := ulmServices, SYS := ulmSYSTEM; + IMPORT Objects := ulmObjects, Priorities := ulmPriorities, Services := ulmServices, SYS := ulmSYSTEM, Types := ulmTypes; TYPE EventType* = POINTER TO EventTypeRec; @@ -51,7 +51,7 @@ MODULE ulmEvents; funcs* = 2; (* call associated event handlers *) TYPE - Reaction* = INTEGER; (* one of default, ignore, or funcs *) + Reaction* = Types.Int32; (* one of default, ignore, or funcs *) Message* = ARRAY 80 OF CHAR; Event* = POINTER TO EventRec; EventRec* = @@ -69,7 +69,7 @@ MODULE ulmEvents; *) EventManager = PROCEDURE (type: EventType; reaction: Reaction); - Priority = INTEGER; (* must be non-negative *) + Priority = Types.Int32; (* must be non-negative *) (* every event with reaction `funcs' has a handler list; the list is in calling order which is reverse to @@ -104,7 +104,7 @@ MODULE ulmEvents; Queue = POINTER TO QueueRec; QueueRec = RECORD - priority: INTEGER; (* queue for this priority *) + priority: Types.Int32; (* queue for this priority *) head, tail: Event; next: Queue; (* queue with lower priority *) END; @@ -125,8 +125,8 @@ MODULE ulmEvents; (* private part *) currentPriority: Priority; priotab: ARRAY priotabsize OF Priority; - priotop: INTEGER; - overflow: INTEGER; (* of priority table *) + priotop: Types.Int32; + overflow: Types.Int32; (* of priority table *) END; CONST @@ -141,7 +141,7 @@ MODULE ulmEvents; ErrorEventRec* = RECORD (EventRec) - errorcode*: SHORTINT; + errorcode*: Types.Int8; END; VAR @@ -151,7 +151,7 @@ MODULE ulmEvents; VAR (* private part *) abort, log, queueHandler: EventHandler; - nestlevel: INTEGER; (* of Raise calls *) + nestlevel: Types.Int32; (* of Raise calls *) queue: Queue; lock: BOOLEAN; (* lock critical operations *) psys: PrioritySystem; (* current priority system *) @@ -173,7 +173,7 @@ MODULE ulmEvents; "negative priority given to Events.SetPriority"; END InitErrorHandling; - PROCEDURE Error(code: SHORTINT); + PROCEDURE Error(code: Types.Int8); VAR event: ErrorEvent; BEGIN NEW(event); event.type := error; @@ -301,10 +301,10 @@ MODULE ulmEvents; (* now QueueHandler will translate partly like BOOLEAN b; handler_EventHandler tmphandler; - LONGINT i, j; - i = (LONGINT)handler; + Types.Int32 i, j; + i = (Types.Int32)handler; tmphandler = handler_NilHandler; - j = (LONGINT)tmphandler; + j = (Types.Int32)tmphandler; b = i != j; *) (* changed because voc cannot compara handler and NilHandler -- noch *) @@ -316,12 +316,12 @@ MODULE ulmEvents; *) VAR b : BOOLEAN; (* noch *) tmphandler : EventHandler; - (*i,j : LONGINT;*) + (*i,j : Types.Int32;*) BEGIN - (*i := SYSTEM.VAL(LONGINT, handler);*) + (*i := SYSTEM.VAL(Types.Int32, handler);*) tmphandler := NilHandler; (*b := tmphandler = handler;*) - (*j := SYSTEM.VAL(LONGINT, tmphandler); + (*j := SYSTEM.VAL(Types.Int32, tmphandler); b := i # j;*) b := handler # tmphandler; (*ASSERT (handler # NilHandler);*) diff --git a/src/library/ulm/ulmIO.Mod b/src/library/ulm/ulmIO.Mod index 162aa127..31aedf8a 100644 --- a/src/library/ulm/ulmIO.Mod +++ b/src/library/ulm/ulmIO.Mod @@ -1,6 +1,6 @@ MODULE ulmIO; - IMPORT SYS := ulmSYSTEM, SYSTEM, Platform; + IMPORT SYS := ulmSYSTEM, SYSTEM, Platform, Types := ulmTypes; CONST nl = 0AX; @@ -11,7 +11,7 @@ MODULE ulmIO; dec = 1; hex = 2; TYPE - Basetype = SHORTINT; (* oct..hex *) + Basetype = Types.Int8; (* oct..hex *) (* basic IO *) @@ -22,7 +22,7 @@ MODULE ulmIO; (* ==================== conversions ================================= *) - PROCEDURE ConvertNumber(num, len: LONGINT; btyp: Basetype; neg: BOOLEAN; + PROCEDURE ConvertNumber(num, len: Types.Int32; btyp: Basetype; neg: BOOLEAN; VAR str: ARRAY OF CHAR); (* conversion of a number into a string of characters *) @@ -36,13 +36,13 @@ MODULE ulmIO; VAR (*digits : ARRAY NumberLen+1 OF CHAR;*) digits : POINTER TO ARRAY OF CHAR; - base : INTEGER; - cnt, ix : INTEGER; - maxlen : LONGINT; - dig : LONGINT; - NumberLen : SHORTINT; + base : Types.Int32; + cnt, ix : Types.Int32; + maxlen : Types.Int32; + dig : Types.Int32; + NumberLen : Types.Int8; BEGIN - IF SIZE(LONGINT) = 8 THEN + IF SIZE(Types.Int32) = 8 THEN NumberLen := 21 ELSE NumberLen := 11 (* default value, corresponds to 32 bit *) @@ -107,7 +107,7 @@ MODULE ulmIO; END; END ConvertNumber; - PROCEDURE ConvertInteger(num: LONGINT; len: INTEGER; VAR str: ARRAY OF + PROCEDURE ConvertInteger(num: Types.Int32; len: Types.Int32; VAR str: ARRAY OF CHAR); (* conversion of an integer decimal number to a string *) BEGIN @@ -119,8 +119,8 @@ MODULE ulmIO; (* PROCEDURE ReadChar(VAR ch: CHAR) : BOOLEAN; CONST read = 3; - (*VAR r0, r1: INTEGER;*) - VAR r0, r1: LONGINT; (* in ulm system INTEGER and LONGINT have the same 4 byte size; -- noch *) + (*VAR r0, r1: Types.Int32;*) + VAR r0, r1: Types.Int32; (* in ulm system Types.Int32 and Types.Int32 have the same 4 byte size; -- noch *) BEGIN RETURN SYS.UNIXCALL(read, r0, r1, 0, SYSTEM.ADR(ch), 1) & (r0 > 0) END ReadChar; @@ -128,7 +128,7 @@ MODULE ulmIO; PROCEDURE ReadChar(VAR ch: CHAR) : BOOLEAN; (* Read one byte, returning success flag *) - VAR error: Platform.ErrorCode; readcount: LONGINT; + VAR error: Platform.ErrorCode; readcount: Types.Int32; BEGIN error := Platform.ReadBuf(Platform.StdIn, ch, readcount); RETURN readcount > 0 @@ -137,8 +137,8 @@ MODULE ulmIO; (* PROCEDURE WriteChar(ch: CHAR) : BOOLEAN; CONST write = 4; - (*VAR r0, r1: INTEGER;*) - VAR r0, r1: LONGINT; (* same here *) + (*VAR r0, r1: Types.Int32;*) + VAR r0, r1: Types.Int32; (* same here *) BEGIN RETURN SYS.UNIXCALL(write, r0, r1, 1, SYSTEM.ADR(ch), 1) END WriteChar; @@ -186,7 +186,7 @@ MODULE ulmIO; END WriteLn; PROCEDURE WriteString*(s: ARRAY OF CHAR); - VAR i: INTEGER; + VAR i: Types.Int32; BEGIN i := 0; WHILE (i < LEN(s)) & (s[i] # 0X) DO @@ -201,14 +201,14 @@ MODULE ulmIO; Done := TRUE; END InitIO; - PROCEDURE WriteInt*(arg: LONGINT); + PROCEDURE WriteInt*(arg: Types.Int32); VAR field: ARRAY 23 OF CHAR; BEGIN (* the field size should be big enough to hold the long number. it was 12 to hold just 32 bit numbers, now it can hold 64 bit numbers; need to be more for 128bit numbers; -- noch *) ConvertInteger(arg, 1, field); WriteString(field); END WriteInt; - PROCEDURE ReadInt*(VAR arg: LONGINT); + PROCEDURE ReadInt*(VAR arg: Types.Int32); VAR ch: CHAR; minus: BOOLEAN; BEGIN @@ -236,7 +236,7 @@ MODULE ulmIO; PROCEDURE ReadLine*(VAR string: ARRAY OF CHAR); VAR - index: INTEGER; + index: Types.Int32; ch: CHAR; ok: BOOLEAN; BEGIN diff --git a/src/library/ulm/ulmIntOperations.Mod b/src/library/ulm/ulmIntOperations.Mod index 3f1799aa..739bb5a4 100644 --- a/src/library/ulm/ulmIntOperations.Mod +++ b/src/library/ulm/ulmIntOperations.Mod @@ -43,16 +43,16 @@ MODULE ulmIntOperations; (* Frank B.J. Fischer *) TYPE CapabilitySet* = Operations.CapabilitySet; - (* SET of [Operations.add..shift] *) + (* Types.Set of [Operations.add..shift] *) IsLargeEnoughForProc* = PROCEDURE (op: Operations.Operand; - n: LONGINT): BOOLEAN; + n: Types.Int32): BOOLEAN; UnsignedProc* = PROCEDURE (op: Operations.Operand): BOOLEAN; IntToOpProc* = PROCEDURE (int32: Types.Int32; VAR op: Operations.Operand); OpToIntProc* = PROCEDURE (op: Operations.Operand; VAR int32: Types.Int32); - Log2Proc* = PROCEDURE (op: Operations.Operand): LONGINT; + Log2Proc* = PROCEDURE (op: Operations.Operand): Types.Int32; OddProc* = PROCEDURE (op: Operations.Operand): BOOLEAN; ShiftProc* = PROCEDURE (op: Operations.Operand; - n: INTEGER): Operations.Operand; + n: Types.Int32): Operations.Operand; IntOperatorProc* = PROCEDURE(op: Operation; op1, op2, op3: Operations.Operand; VAR result: Operations.Operand); @@ -95,7 +95,7 @@ MODULE ulmIntOperations; (* Frank B.J. Fischer *) END Capabilities; - PROCEDURE IsLargeEnoughFor*(op: Operations.Operand; n: LONGINT): BOOLEAN; + PROCEDURE IsLargeEnoughFor*(op: Operations.Operand; n: Types.Int32): BOOLEAN; BEGIN WITH op: Operand DO RETURN op.if.isLargeEnoughFor(op, n) @@ -130,7 +130,7 @@ MODULE ulmIntOperations; (* Frank B.J. Fischer *) END OpToInt; - PROCEDURE Log2*(op: Operations.Operand): LONGINT; + PROCEDURE Log2*(op: Operations.Operand): Types.Int32; BEGIN WITH op: Operand DO RETURN op.if.log2(op) @@ -167,7 +167,7 @@ MODULE ulmIntOperations; (* Frank B.J. Fischer *) END Op; - PROCEDURE Shift*(op1: Operations.Operand; n: INTEGER): Operations.Operand; + PROCEDURE Shift*(op1: Operations.Operand; n: Types.Int32): Operations.Operand; BEGIN WITH op1: Operand DO ASSERT(shift IN op1.caps); @@ -176,14 +176,14 @@ MODULE ulmIntOperations; (* Frank B.J. Fischer *) END Shift; - PROCEDURE Shift2*(VAR op1: Operations.Operand; n: INTEGER); + PROCEDURE Shift2*(VAR op1: Operations.Operand; n: Types.Int32); BEGIN op1 := Shift(op1, n); END Shift2; PROCEDURE Shift3*(VAR result: Operations.Operand; op1: Operations.Operand; - n : INTEGER); + n : Types.Int32); VAR tmpresult: Operations.Operand; BEGIN diff --git a/src/library/ulm/ulmMC68881.Mod b/src/library/ulm/ulmMC68881.Mod index 4bcf69a0..fc3986d0 100644 --- a/src/library/ulm/ulmMC68881.Mod +++ b/src/library/ulm/ulmMC68881.Mod @@ -5,7 +5,7 @@ MODULE ulmMC68881; (* library interface to MC68881 instructions *) - IMPORT SYS := SYSTEM; + IMPORT SYS := SYSTEM, Types := ulmTypes; CONST available* = FALSE; (* TRUE if MC68881 present *) @@ -36,130 +36,130 @@ MODULE ulmMC68881; (* monadic operations *) - PROCEDURE FACOS*(x: LONGREAL) : LONGREAL; + PROCEDURE FACOS*(x: Types.Real64) : Types.Real64; BEGIN RETURN ABS(x) END FACOS; - PROCEDURE FASIN*(x: LONGREAL) : LONGREAL; + PROCEDURE FASIN*(x: Types.Real64) : Types.Real64; BEGIN RETURN ABS(x) END FASIN; - PROCEDURE FATAN*(x: LONGREAL) : LONGREAL; + PROCEDURE FATAN*(x: Types.Real64) : Types.Real64; BEGIN RETURN ABS(x) END FATAN; - PROCEDURE FATANH*(x: LONGREAL) : LONGREAL; + PROCEDURE FATANH*(x: Types.Real64) : Types.Real64; BEGIN RETURN ABS(x) END FATANH; - PROCEDURE FCOS*(x: LONGREAL) : LONGREAL; + PROCEDURE FCOS*(x: Types.Real64) : Types.Real64; BEGIN RETURN ABS(x) END FCOS; - PROCEDURE FCOSH*(x: LONGREAL) : LONGREAL; + PROCEDURE FCOSH*(x: Types.Real64) : Types.Real64; BEGIN RETURN ABS(x) END FCOSH; - PROCEDURE FETOX*(x: LONGREAL) : LONGREAL; + PROCEDURE FETOX*(x: Types.Real64) : Types.Real64; BEGIN RETURN ABS(x) END FETOX; - PROCEDURE FETOXM1*(x: LONGREAL) : LONGREAL; + PROCEDURE FETOXM1*(x: Types.Real64) : Types.Real64; BEGIN RETURN ABS(x) END FETOXM1; - PROCEDURE FGETEXP*(x: LONGREAL) : LONGREAL; + PROCEDURE FGETEXP*(x: Types.Real64) : Types.Real64; BEGIN RETURN ABS(x) END FGETEXP; - PROCEDURE FGETMAN*(x: LONGREAL) : LONGREAL; + PROCEDURE FGETMAN*(x: Types.Real64) : Types.Real64; BEGIN RETURN ABS(x) END FGETMAN; - PROCEDURE FLOG10*(x: LONGREAL) : LONGREAL; + PROCEDURE FLOG10*(x: Types.Real64) : Types.Real64; BEGIN RETURN ABS(x) END FLOG10; - PROCEDURE FLOG2*(x: LONGREAL) : LONGREAL; + PROCEDURE FLOG2*(x: Types.Real64) : Types.Real64; BEGIN RETURN ABS(x) END FLOG2; - PROCEDURE FLOGN*(x: LONGREAL) : LONGREAL; + PROCEDURE FLOGN*(x: Types.Real64) : Types.Real64; BEGIN RETURN ABS(x) END FLOGN; - PROCEDURE FLOGNP1*(x: LONGREAL) : LONGREAL; + PROCEDURE FLOGNP1*(x: Types.Real64) : Types.Real64; BEGIN RETURN ABS(x) END FLOGNP1; - PROCEDURE FSIN*(x: LONGREAL) : LONGREAL; + PROCEDURE FSIN*(x: Types.Real64) : Types.Real64; BEGIN RETURN ABS(x) END FSIN; - PROCEDURE FSINH*(x: LONGREAL) : LONGREAL; + PROCEDURE FSINH*(x: Types.Real64) : Types.Real64; BEGIN RETURN ABS(x) END FSINH; - PROCEDURE FSQRT*(x: LONGREAL) : LONGREAL; + PROCEDURE FSQRT*(x: Types.Real64) : Types.Real64; BEGIN RETURN ABS(x) END FSQRT; - PROCEDURE FTAN*(x: LONGREAL) : LONGREAL; + PROCEDURE FTAN*(x: Types.Real64) : Types.Real64; BEGIN RETURN ABS(x) END FTAN; - PROCEDURE FTANH*(x: LONGREAL) : LONGREAL; + PROCEDURE FTANH*(x: Types.Real64) : Types.Real64; BEGIN RETURN ABS(x) END FTANH; - PROCEDURE FTENTOX*(x: LONGREAL) : LONGREAL; + PROCEDURE FTENTOX*(x: Types.Real64) : Types.Real64; BEGIN RETURN ABS(x) END FTENTOX; - PROCEDURE FTWOTOX*(x: LONGREAL) : LONGREAL; + PROCEDURE FTWOTOX*(x: Types.Real64) : Types.Real64; BEGIN RETURN ABS(x) END FTWOTOX; - PROCEDURE GetExceptionEnable*(VAR exceptions: SET); + PROCEDURE GetExceptionEnable*(VAR exceptions: Types.Set); BEGIN exceptions := {}; END GetExceptionEnable; - PROCEDURE SetExceptionEnable*(exceptions: SET); + PROCEDURE SetExceptionEnable*(exceptions: Types.Set); BEGIN exceptions := {}; END SetExceptionEnable; - PROCEDURE GetRoundingMode*(VAR precision, mode: INTEGER); + PROCEDURE GetRoundingMode*(VAR precision, mode: Types.Int32); BEGIN precision := 1; mode := 2; END GetRoundingMode; - PROCEDURE SetRoundingMode*(precision, mode: INTEGER); + PROCEDURE SetRoundingMode*(precision, mode: Types.Int32); BEGIN precision := 1; mode := 2; @@ -170,12 +170,12 @@ MODULE ulmMC68881; float must consist of at least floatlen bytes *) - PROCEDURE RealToFloat*(real: LONGREAL; VAR float: ARRAY OF SYS.BYTE); + PROCEDURE RealToFloat*(real: Types.Real64; VAR float: ARRAY OF SYS.BYTE); BEGIN (*SYS.WMOVE(SYS.ADR(real), SYS.ADR(float), floatlen DIV 4);*) END RealToFloat; - PROCEDURE FloatToReal*(float: ARRAY OF SYS.BYTE; VAR real: LONGREAL); + PROCEDURE FloatToReal*(float: ARRAY OF SYS.BYTE; VAR real: Types.Real64); BEGIN (*SYS.WMOVE(SYS.ADR(float), SYS.ADR(real), floatlen DIV 4);*) END FloatToReal; diff --git a/src/library/ulm/ulmNetIO.Mod b/src/library/ulm/ulmNetIO.Mod index b9741f30..3db6887b 100644 --- a/src/library/ulm/ulmNetIO.Mod +++ b/src/library/ulm/ulmNetIO.Mod @@ -64,17 +64,17 @@ MODULE ulmNetIO; ReadBooleanProc* = PROCEDURE (s: Streams.Stream; VAR boolean: BOOLEAN) : BOOLEAN; ReadShortIntProc* = - PROCEDURE (s: Streams.Stream; VAR shortint: SHORTINT) : BOOLEAN; + PROCEDURE (s: Streams.Stream; VAR shortint: Types.Int8) : BOOLEAN; ReadIntegerProc* = - PROCEDURE (s: Streams.Stream; VAR integer: INTEGER) : BOOLEAN; + PROCEDURE (s: Streams.Stream; VAR integer: Types.Int32) : BOOLEAN; ReadLongIntProc* = - PROCEDURE (s: Streams.Stream; VAR longint: LONGINT) : BOOLEAN; + PROCEDURE (s: Streams.Stream; VAR longint: Types.Int32) : BOOLEAN; ReadRealProc* = - PROCEDURE (s: Streams.Stream; VAR real: REAL) : BOOLEAN; + PROCEDURE (s: Streams.Stream; VAR real: Types.Real32) : BOOLEAN; ReadLongRealProc* = - PROCEDURE (s: Streams.Stream; VAR longreal: LONGREAL) : BOOLEAN; + PROCEDURE (s: Streams.Stream; VAR longreal: Types.Real64) : BOOLEAN; ReadSetProc* = - PROCEDURE (s: Streams.Stream; VAR set: SET) : BOOLEAN; + PROCEDURE (s: Streams.Stream; VAR set: Types.Set) : BOOLEAN; ReadStringProc* = PROCEDURE (s: Streams.Stream; VAR string: ARRAY OF CHAR) : BOOLEAN; ReadConstStringProc* = @@ -88,17 +88,17 @@ MODULE ulmNetIO; WriteBooleanProc* = PROCEDURE (s: Streams.Stream; boolean: BOOLEAN) : BOOLEAN; WriteShortIntProc* = - PROCEDURE (s: Streams.Stream; shortint: SHORTINT) : BOOLEAN; + PROCEDURE (s: Streams.Stream; shortint: Types.Int8) : BOOLEAN; WriteIntegerProc* = - PROCEDURE (s: Streams.Stream; integer: INTEGER) : BOOLEAN; + PROCEDURE (s: Streams.Stream; integer: Types.Int32) : BOOLEAN; WriteLongIntProc* = - PROCEDURE (s: Streams.Stream; longint: LONGINT) : BOOLEAN; + PROCEDURE (s: Streams.Stream; longint: Types.Int32) : BOOLEAN; WriteRealProc* = - PROCEDURE (s: Streams.Stream; real: REAL) : BOOLEAN; + PROCEDURE (s: Streams.Stream; real: Types.Real32) : BOOLEAN; WriteLongRealProc* = - PROCEDURE (s: Streams.Stream; longreal: LONGREAL) : BOOLEAN; + PROCEDURE (s: Streams.Stream; longreal: Types.Real64) : BOOLEAN; WriteSetProc* = - PROCEDURE (s: Streams.Stream; set: SET) : BOOLEAN; + PROCEDURE (s: Streams.Stream; set: Types.Set) : BOOLEAN; WriteStringProc* = PROCEDURE (s: Streams.Stream; string: ARRAY OF CHAR) : BOOLEAN; WriteConstStringProc* = @@ -154,7 +154,7 @@ MODULE ulmNetIO; PROCEDURE Swap (VAR a : ARRAY OF SYS.BYTE); VAR - i,j : LONGINT; + i,j : Types.Int32; tmp : SYS.BYTE; BEGIN i := 0; j := LEN (a) - 1; @@ -166,8 +166,8 @@ MODULE ulmNetIO; PROCEDURE BitSwap (VAR a : ARRAY OF SYS.BYTE); VAR - i,old, bit : LONGINT; - new : LONGINT; + i,old, bit : Types.Int32; + new : Types.Int32; BEGIN i := 0; @@ -266,7 +266,7 @@ MODULE ulmNetIO; END; END ReadBoolean; - PROCEDURE ReadShortInt*(s: Streams.Stream; VAR shortint: SHORTINT) : BOOLEAN; + PROCEDURE ReadShortInt*(s: Streams.Stream; VAR shortint: Types.Int8) : BOOLEAN; VAR disc: Discipline; BEGIN @@ -277,7 +277,7 @@ MODULE ulmNetIO; END; END ReadShortInt; - PROCEDURE ReadInteger*(s: Streams.Stream; VAR integer: INTEGER) : BOOLEAN; + PROCEDURE ReadInteger*(s: Streams.Stream; VAR integer: Types.Int32) : BOOLEAN; VAR disc: Discipline; ret : BOOLEAN; @@ -293,7 +293,7 @@ MODULE ulmNetIO; END; END ReadInteger; - PROCEDURE ReadLongInt*(s: Streams.Stream; VAR longint: LONGINT) : BOOLEAN; + PROCEDURE ReadLongInt*(s: Streams.Stream; VAR longint: Types.Int32) : BOOLEAN; VAR disc: Discipline; ret : BOOLEAN; @@ -309,7 +309,7 @@ MODULE ulmNetIO; END; END ReadLongInt; - PROCEDURE ReadReal*(s: Streams.Stream; VAR real: REAL) : BOOLEAN; + PROCEDURE ReadReal*(s: Streams.Stream; VAR real: Types.Real32) : BOOLEAN; VAR disc: Discipline; BEGIN @@ -320,7 +320,7 @@ MODULE ulmNetIO; END; END ReadReal; - PROCEDURE ReadLongReal*(s: Streams.Stream; VAR longreal: LONGREAL) : BOOLEAN; + PROCEDURE ReadLongReal*(s: Streams.Stream; VAR longreal: Types.Real64) : BOOLEAN; VAR disc: Discipline; BEGIN @@ -331,7 +331,7 @@ MODULE ulmNetIO; END; END ReadLongReal; - PROCEDURE ReadSet*(s: Streams.Stream; VAR set: SET) : BOOLEAN; + PROCEDURE ReadSet*(s: Streams.Stream; VAR set: Types.Set) : BOOLEAN; VAR disc: Discipline; ret : BOOLEAN; @@ -350,7 +350,7 @@ MODULE ulmNetIO; PROCEDURE ReadString*(s: Streams.Stream; VAR string: ARRAY OF CHAR) : BOOLEAN; VAR disc: Discipline; - ch: CHAR; index: LONGINT; + ch: CHAR; index: Types.Int32; BEGIN IF Seek(s, discID, disc) THEN RETURN disc.if.readString(s, string) @@ -372,7 +372,7 @@ MODULE ulmNetIO; CONST bufsize = 512; VAR - length: LONGINT; + length: Types.Int32; buf: Streams.Stream; ch: CHAR; disc: Discipline; @@ -442,7 +442,7 @@ MODULE ulmNetIO; END; END WriteBoolean; - PROCEDURE WriteShortInt*(s: Streams.Stream; shortint: SHORTINT) : BOOLEAN; + PROCEDURE WriteShortInt*(s: Streams.Stream; shortint: Types.Int8) : BOOLEAN; VAR disc: Discipline; BEGIN @@ -453,7 +453,7 @@ MODULE ulmNetIO; END; END WriteShortInt; - PROCEDURE WriteInteger*(s: Streams.Stream; integer: INTEGER) : BOOLEAN; + PROCEDURE WriteInteger*(s: Streams.Stream; integer: Types.Int32) : BOOLEAN; VAR disc: Discipline; BEGIN @@ -467,7 +467,7 @@ MODULE ulmNetIO; END; END WriteInteger; - PROCEDURE WriteLongInt*(s: Streams.Stream; longint: LONGINT) : BOOLEAN; + PROCEDURE WriteLongInt*(s: Streams.Stream; longint: Types.Int32) : BOOLEAN; VAR disc: Discipline; BEGIN @@ -481,7 +481,7 @@ MODULE ulmNetIO; END; END WriteLongInt; - PROCEDURE WriteReal*(s: Streams.Stream; real: REAL) : BOOLEAN; + PROCEDURE WriteReal*(s: Streams.Stream; real: Types.Real32) : BOOLEAN; VAR disc: Discipline; BEGIN @@ -492,7 +492,7 @@ MODULE ulmNetIO; END; END WriteReal; - PROCEDURE WriteLongReal*(s: Streams.Stream; longreal: LONGREAL) : BOOLEAN; + PROCEDURE WriteLongReal*(s: Streams.Stream; longreal: Types.Real64) : BOOLEAN; VAR disc: Discipline; BEGIN @@ -503,7 +503,7 @@ MODULE ulmNetIO; END; END WriteLongReal; - PROCEDURE WriteSet*(s: Streams.Stream; set: SET) : BOOLEAN; + PROCEDURE WriteSet*(s: Streams.Stream; set: Types.Set) : BOOLEAN; VAR disc: Discipline; BEGIN diff --git a/src/library/ulm/ulmOperations.Mod b/src/library/ulm/ulmOperations.Mod index 617b9808..317b42d8 100644 --- a/src/library/ulm/ulmOperations.Mod +++ b/src/library/ulm/ulmOperations.Mod @@ -44,22 +44,22 @@ MODULE ulmOperations; (* generic support of arithmetic operations *) - IMPORT Events := ulmEvents, Objects := ulmObjects, PersistentDisciplines := ulmPersistentDisciplines, PersistentObjects := ulmPersistentObjects, Services := ulmServices; + IMPORT Events := ulmEvents, Objects := ulmObjects, PersistentDisciplines := ulmPersistentDisciplines, PersistentObjects := ulmPersistentObjects, Services := ulmServices, Types := ulmTypes; CONST add* = 0; sub* = 1; mul* = 2; div* = 3; cmp* = 4; TYPE - Operation* = SHORTINT; (* add..cmp *) + Operation* = Types.Int8; (* add..cmp *) Operand* = POINTER TO OperandRec; TYPE - CapabilitySet* = SET; (* SET OF [add..cmp] *) + CapabilitySet* = Types.Set; (* Types.Set OF [add..cmp] *) CreateProc* = PROCEDURE (VAR op: Operand); (* should call Operations.Init for op *) OperatorProc* = PROCEDURE (op: Operation; op1, op2: Operand; VAR result: Operand); AssignProc* = PROCEDURE (VAR target: Operand; source: Operand); - CompareProc* = PROCEDURE (op1, op2: Operand) : INTEGER; + CompareProc* = PROCEDURE (op1, op2: Operand) : Types.Int32; Interface* = POINTER TO InterfaceRec; InterfaceRec* = RECORD @@ -194,7 +194,7 @@ MODULE ulmOperations; Op(div, op1, op2, result); END Div3; - PROCEDURE Compare*(op1, op2: Operand) : INTEGER; + PROCEDURE Compare*(op1, op2: Operand) : Types.Int32; BEGIN ASSERT(op1.if = op2.if); ASSERT(cmp IN op1.caps); diff --git a/src/library/ulm/ulmPersistentObjects.Mod b/src/library/ulm/ulmPersistentObjects.Mod index c64b4fc0..b34b3645 100644 --- a/src/library/ulm/ulmPersistentObjects.Mod +++ b/src/library/ulm/ulmPersistentObjects.Mod @@ -72,7 +72,7 @@ MODULE ulmPersistentObjects; IMPORT ASCII := ulmASCII, ConstStrings := ulmConstStrings, Disciplines := ulmDisciplines, Errors := ulmErrors, Events := ulmEvents, Forwarders := ulmForwarders, IndirectDisciplines := ulmIndirectDisciplines, Loader := ulmLoader, NetIO := ulmNetIO, Objects := ulmObjects, Priorities := ulmPriorities, - RelatedEvents := ulmRelatedEvents, Services := ulmServices, StreamDisciplines := ulmStreamDisciplines, Streams := ulmStreams, Strings := ulmStrings, Texts := ulmTexts, SYS := SYSTEM; + RelatedEvents := ulmRelatedEvents, Services := ulmServices, StreamDisciplines := ulmStreamDisciplines, Streams := ulmStreams, Strings := ulmStrings, Texts := ulmTexts, SYS := SYSTEM, Types := ulmTypes; CONST maxNameLen = 128; (* max length of data type names *) @@ -123,8 +123,8 @@ MODULE ulmPersistentObjects; maxF = 13; (* maximal valid form code *) TYPE - Mode* = SHORTINT; - Form = SHORTINT; + Mode* = Types.Int8; + Form = Types.Int8; Object* = POINTER TO ObjectRec; Type = POINTER TO TypeRec; @@ -160,7 +160,7 @@ MODULE ulmPersistentObjects; TypeEntry = POINTER TO TypeEntryRec; TypeEntryRec = RECORD - code: LONGINT; + code: Types.Int32; type: Type; next: TypeEntry; END; @@ -185,7 +185,7 @@ MODULE ulmPersistentObjects; baseType: Type; (* the next non-abstract base type *) if: Interface; (* may be = NIL for abstract types *) ifs: InterfaceList; (* list of interfaces in reverse order *) - code: LONGINT; (* unique number *) + code: Types.Int32; (* unique number *) END; (* this list is used for storing the base type list of an object during @@ -201,7 +201,7 @@ MODULE ulmPersistentObjects; (* each error causes an event; the error number is stored in event.errorcode; the associated text can be taken from event.message *) - ErrorCode = SHORTINT; + ErrorCode = Types.Int8; Event = POINTER TO EventRec; EventRec* = RECORD @@ -230,7 +230,7 @@ MODULE ulmPersistentObjects; VAR id: Disciplines.Identifier; - nextTypeCode: LONGINT; (* for the generation of unique numbers *) + nextTypeCode: Types.Int32; (* for the generation of unique numbers *) potype: Services.Type; errormsg*: ARRAY errorcodes OF Events.Message; @@ -298,7 +298,7 @@ MODULE ulmPersistentObjects; PROCEDURE WriteLn(s: Streams.Stream) : BOOLEAN; VAR lineterm: StreamDisciplines.LineTerminator; - width: INTEGER; + width: Types.Int32; BEGIN StreamDisciplines.GetLineTerm(s, lineterm); IF ~WriteString(s, lineterm) THEN RETURN FALSE END; @@ -383,7 +383,7 @@ MODULE ulmPersistentObjects; (* encoding scheme: Object = Form Type Size ObjectInfo . - Form = SHORTINT; + Form = Types.Int8; Type = Code (* codeF *) | Code TypeName (* incrF *) | TypeName (* nameF *) | @@ -397,8 +397,8 @@ MODULE ulmPersistentObjects; PROCEDURE DecodeForm(form: Form; VAR nameGiven, codeGiven, hier, size: BOOLEAN); VAR - typeform: SHORTINT; - sizeform: SHORTINT; + typeform: Types.Int8; + sizeform: Types.Int8; BEGIN typeform := form MOD maskF; sizeform := form DIV maskF; nameGiven := typeform IN {incrF, nameF, hierF, incrhierF}; @@ -410,7 +410,7 @@ MODULE ulmPersistentObjects; PROCEDURE GetModule(name: ARRAY OF CHAR; VAR module: ARRAY OF CHAR); (* get the name of the module where 'name' was defined *) VAR - index: INTEGER; + index: Types.Int32; BEGIN index := 0; WHILE (name[index] # ".") & (name[index] # 0X) & @@ -471,7 +471,7 @@ MODULE ulmPersistentObjects; PROCEDURE ReadType(s: Streams.Stream; VAR type: Type; VAR sentinelFound, unknownTypeFound: BOOLEAN) : BOOLEAN; VAR - code: LONGINT; + code: Types.Int32; entry: TypeEntry; typeName: TypeName; btype: Type; @@ -755,7 +755,7 @@ MODULE ulmPersistentObjects; baseType: Services.Type; member: InterfaceList; bt: Type; - ifval: INTEGER; + ifval: Types.Int32; BEGIN (* check the parameters *) ASSERT(name[0] # 0X); diff --git a/src/library/ulm/ulmPlotters.Mod b/src/library/ulm/ulmPlotters.Mod index 59ee292d..58d1fda6 100644 --- a/src/library/ulm/ulmPlotters.Mod +++ b/src/library/ulm/ulmPlotters.Mod @@ -28,7 +28,7 @@ MODULE ulmPlotters; - IMPORT Events := ulmEvents, Objects := ulmObjects, Resources := ulmResources, Services := ulmServices, SYS := ulmSYSTEM; + IMPORT Events := ulmEvents, Objects := ulmObjects, Resources := ulmResources, Services := ulmServices, SYS := ulmSYSTEM, Types := ulmTypes; TYPE Plotter* = POINTER TO PlotterRec; @@ -41,7 +41,7 @@ MODULE ulmPlotters; longdashed* = 4; lineModes* = 5; TYPE - LineMode* = SHORTINT; (* solid ... *) + LineMode* = Types.Int8; (* solid ... *) CONST setspace* = 0; @@ -50,34 +50,34 @@ MODULE ulmPlotters; linemodes* = 3; linewidth* = 4; TYPE - CapabilitySet* = SET; (* OF setspace, erase ... *) + CapabilitySet* = Types.Set; (* OF setspace, erase ... *) TYPE Description* = POINTER TO DescriptionRec; DescriptionRec* = RECORD (Objects.ObjectRec) - xmin*, ymin, xmax, ymax: INTEGER; (* maximal supported range *) + xmin*, ymin, xmax, ymax: Types.Int32; (* maximal supported range *) END; TYPE GetSpaceProc* = PROCEDURE ( plotter: Plotter; - VAR xmin, ymin, xmax, ymax: INTEGER); + VAR xmin, ymin, xmax, ymax: Types.Int32); SetSpaceProc* = PROCEDURE ( plotter: Plotter; - xmin, ymin, xmax, ymax: INTEGER); + xmin, ymin, xmax, ymax: Types.Int32); EraseProc* = PROCEDURE (plotter: Plotter); - MoveProc* = PROCEDURE (plotter: Plotter; xto, yto: INTEGER); - LineProc* = PROCEDURE (plotter: Plotter; xfrom, yfrom, xto, yto: INTEGER); + MoveProc* = PROCEDURE (plotter: Plotter; xto, yto: Types.Int32); + LineProc* = PROCEDURE (plotter: Plotter; xfrom, yfrom, xto, yto: Types.Int32); ArcProc* = PROCEDURE ( plotter: Plotter; - xcenter, ycenter, xstart, ystart, xend, yend: INTEGER); + xcenter, ycenter, xstart, ystart, xend, yend: Types.Int32); CircleProc* = PROCEDURE ( - plotter: Plotter; xcenter, ycenter, radius: INTEGER); + plotter: Plotter; xcenter, ycenter, radius: Types.Int32); StringProc* = PROCEDURE (plotter: Plotter; str: ARRAY OF CHAR); SetLineModeProc* = PROCEDURE (plotter: Plotter; mode: LineMode); - SetLineWidthProc* = PROCEDURE (plotter: Plotter; width: INTEGER); + SetLineWidthProc* = PROCEDURE (plotter: Plotter; width: Types.Int32); CloseProc* = PROCEDURE (plotter: Plotter); TYPE Interface* = POINTER TO InterfaceRec; @@ -105,7 +105,7 @@ MODULE ulmPlotters; if: Interface; caps: CapabilitySet; desc: Description; - xmin, ymin, xmax, ymax: INTEGER; (* current range *) + xmin, ymin, xmax, ymax: Types.Int32; (* current range *) terminated: BOOLEAN; END; VAR @@ -162,7 +162,7 @@ MODULE ulmPlotters; PROCEDURE GetSpace*(plotter: Plotter; VAR xmin, ymin, - xmax, ymax: INTEGER); + xmax, ymax: Types.Int32); BEGIN xmin := plotter.xmin; xmax := plotter.xmax; @@ -172,7 +172,7 @@ MODULE ulmPlotters; PROCEDURE GetMaxSpace*(plotter: Plotter; VAR xmin, ymin, - xmax, ymax: INTEGER); + xmax, ymax: Types.Int32); BEGIN xmin := plotter.desc.xmin; xmax := plotter.desc.xmax; @@ -182,7 +182,7 @@ MODULE ulmPlotters; PROCEDURE SetSpace*(plotter: Plotter; xmin, ymin, - xmax, ymax: INTEGER); + xmax, ymax: Types.Int32); BEGIN ASSERT((xmin < xmax) & (ymin < ymax)); ASSERT((xmin >= plotter.desc.xmin) & @@ -203,33 +203,33 @@ MODULE ulmPlotters; plotter.if.erase(plotter); END Erase; - PROCEDURE Move*(plotter: Plotter; xto, yto: INTEGER); + PROCEDURE Move*(plotter: Plotter; xto, yto: Types.Int32); BEGIN plotter.if.move(plotter, xto, yto); END Move; - PROCEDURE Cont*(plotter: Plotter; xto, yto: INTEGER); + PROCEDURE Cont*(plotter: Plotter; xto, yto: Types.Int32); BEGIN plotter.if.cont(plotter, xto, yto); END Cont; - PROCEDURE Point*(plotter: Plotter; xpoint, ypoint: INTEGER); + PROCEDURE Point*(plotter: Plotter; xpoint, ypoint: Types.Int32); BEGIN plotter.if.point(plotter, xpoint, ypoint); END Point; - PROCEDURE Line*(plotter: Plotter; xfrom, yfrom, xto, yto: INTEGER); + PROCEDURE Line*(plotter: Plotter; xfrom, yfrom, xto, yto: Types.Int32); BEGIN plotter.if.line(plotter, xfrom, yfrom, xto, yto); END Line; PROCEDURE Arc*(plotter: Plotter; - xcenter, ycenter, xstart, ystart, xend, yend: INTEGER); + xcenter, ycenter, xstart, ystart, xend, yend: Types.Int32); BEGIN plotter.if.arc(plotter, xcenter, ycenter, xstart, ystart, xend, yend); END Arc; - PROCEDURE Circle*(plotter: Plotter; xcenter, ycenter, radius: INTEGER); + PROCEDURE Circle*(plotter: Plotter; xcenter, ycenter, radius: Types.Int32); BEGIN plotter.if.circle(plotter, xcenter, ycenter, radius); END Circle; @@ -246,7 +246,7 @@ MODULE ulmPlotters; plotter.if.setLineMode(plotter, mode); END SetLineMode; - PROCEDURE SetLineWidth*(plotter: Plotter; width: INTEGER); + PROCEDURE SetLineWidth*(plotter: Plotter; width: Types.Int32); BEGIN ASSERT((linewidth IN plotter.caps) & (width > 0)); plotter.if.setLineWidth(plotter, width); diff --git a/src/library/ulm/ulmPrint.Mod b/src/library/ulm/ulmPrint.Mod index 42f5a7fe..a2fb35e0 100644 --- a/src/library/ulm/ulmPrint.Mod +++ b/src/library/ulm/ulmPrint.Mod @@ -35,7 +35,7 @@ ---------------------------------------------------------------------------- *) -MODULE Print; +MODULE ulmPrint; (* formatted printing; Print.F[0-9] prints to Streams.stdout @@ -44,7 +44,7 @@ MODULE Print; *) IMPORT Events := ulmEvents, IEEE := ulmIEEE, Priorities := ulmPriorities, Reals := ulmReals, RelatedEvents := ulmRelatedEvents, StreamDisciplines := ulmStreamDisciplines, - Streams := ulmStreams, SYS := SYSTEM; + Streams := ulmStreams, SYS := SYSTEM, Types := ulmTypes; CONST tooManyArgs* = 0; (* too many arguments given *) @@ -54,15 +54,15 @@ MODULE Print; errors* = 4; TYPE FormatString* = ARRAY 128 OF CHAR; - ErrorCode* = SHORTINT; + ErrorCode* = Types.Int8; ErrorEvent* = POINTER TO ErrorEventRec; ErrorEventRec* = RECORD (Events.EventRec) errorcode*: ErrorCode; format*: FormatString; - errpos*: LONGINT; - nargs*: INTEGER; + errpos*: Types.Int32; + nargs*: Types.Int32; END; VAR error*: Events.EventType; @@ -80,20 +80,20 @@ MODULE Print; "size of argument doesn't conform to the corresponding format element"; END InitErrorHandling; - PROCEDURE Out(out: Streams.Stream; VAR fmt: ARRAY OF CHAR; nargs: INTEGER; - VAR p1,p2,p3,p4,p5,p6,p7,p8,p9: ARRAY OF BYTE; + PROCEDURE Out(out: Streams.Stream; VAR fmt: ARRAY OF CHAR; nargs: Types.Int32; + VAR p1,p2,p3,p4,p5,p6,p7,p8,p9: ARRAY OF SYS.BYTE; errors: RelatedEvents.Object); CONST maxargs = 9; (* maximal number of arguments *) - maxargsize = SIZE(LONGREAL); (* maximal arg size (except strings) *) + maxargsize = SIZE(Types.Real64); (* maximal arg size (except strings) *) fmtcmd = "%"; escape = "\"; VAR - arglen: ARRAY maxargs OF LONGINT; - nextarg: INTEGER; - fmtindex: LONGINT; + arglen: ARRAY maxargs OF Types.Int32; + nextarg: Types.Int32; + fmtindex: Types.Int32; fmtchar: CHAR; - hexcharval: LONGINT; + hexcharval: Types.Int32; PROCEDURE Error(errorcode: ErrorCode); VAR @@ -133,7 +133,7 @@ MODULE Print; END; END Unget; - PROCEDURE Write(byte: BYTE); + PROCEDURE Write(byte: SYS.BYTE); BEGIN IF Streams.WriteByte(out, byte) THEN INC(out.count); @@ -143,7 +143,7 @@ MODULE Print; PROCEDURE WriteLn; VAR lineterm: StreamDisciplines.LineTerminator; - i: INTEGER; + i: Types.Int32; BEGIN StreamDisciplines.GetLineTerm(out, lineterm); Write(lineterm[0]); @@ -153,7 +153,7 @@ MODULE Print; END; END WriteLn; - PROCEDURE Int(VAR int: LONGINT; base: INTEGER) : BOOLEAN; + PROCEDURE Int(VAR int: Types.Int32; base: Types.Int32) : BOOLEAN; PROCEDURE ValidDigit(ch: CHAR) : BOOLEAN; BEGIN @@ -179,7 +179,7 @@ MODULE Print; PROCEDURE SetSize; VAR - index: INTEGER; + index: Types.Int32; BEGIN index := 0; WHILE index < nargs DO @@ -193,12 +193,13 @@ MODULE Print; | 6: arglen[index] := LEN(p7); | 7: arglen[index] := LEN(p8); | 8: arglen[index] := LEN(p9); + ELSE END; INC(index); END; END SetSize; - PROCEDURE Access(par: INTEGER; at: LONGINT) : BYTE; + PROCEDURE Access(par: Types.Int32; at: Types.Int32) : SYS.BYTE; BEGIN CASE par OF | 0: RETURN p1[at] @@ -210,11 +211,12 @@ MODULE Print; | 6: RETURN p7[at] | 7: RETURN p8[at] | 8: RETURN p9[at] + ELSE END; END Access; - PROCEDURE Convert(from: INTEGER; VAR to: ARRAY OF BYTE); - VAR i: INTEGER; + PROCEDURE Convert(from: Types.Int32; VAR to: ARRAY OF SYS.BYTE); + VAR i: Types.Int32; BEGIN i := 0; WHILE i < arglen[from] DO @@ -222,23 +224,23 @@ MODULE Print; END; END Convert; - PROCEDURE GetInt(index: INTEGER; VAR long: LONGINT) : BOOLEAN; + PROCEDURE GetInt(index: Types.Int32; VAR long: Types.Int32) : BOOLEAN; (* access index-th parameter (counted from 0); - fails if arglen[index] > SYS.SIZE(LONGINT) + fails if arglen[index] > SYS.SIZE(Types.Int32) *) VAR - short: SHORTINT; + short: Types.Int8; int16: SYS.INT16; - int: INTEGER; + int: Types.Int32; BEGIN - IF arglen[index] = SIZE(SHORTINT) THEN + IF arglen[index] = SIZE(Types.Int8) THEN Convert(index, short); long := short; ELSIF arglen[index] = SIZE(SYS.INT16) THEN Convert(index, int16); long := int16; - ELSIF arglen[index] = SIZE(INTEGER) THEN + ELSIF arglen[index] = SIZE(Types.Int32) THEN Convert(index, int); long := int; - ELSIF arglen[index] = SIZE(LONGINT) THEN + ELSIF arglen[index] = SIZE(Types.Int32) THEN Convert(index, long); ELSE Error(badArgumentSize); @@ -254,9 +256,9 @@ MODULE Print; insert: BOOLEAN; (* insert between sign and 1st digit *) sign: BOOLEAN; (* sign even positive values *) leftaligned: BOOLEAN; (* output left aligned *) - width, scale: LONGINT; + width, scale: Types.Int32; - PROCEDURE NextArg(VAR index: INTEGER) : BOOLEAN; + PROCEDURE NextArg(VAR index: Types.Int32) : BOOLEAN; BEGIN IF nextarg < nargs THEN index := nextarg; INC(nextarg); RETURN TRUE @@ -284,9 +286,9 @@ MODULE Print; RETURN FALSE (* unexpected end *) END Flags; - PROCEDURE FetchInt(VAR int: LONGINT) : BOOLEAN; + PROCEDURE FetchInt(VAR int: Types.Int32) : BOOLEAN; VAR - index: INTEGER; + index: Types.Int32; BEGIN RETURN (fmtchar = "*") & Next() & NextArg(index) & GetInt(index, int) OR @@ -321,9 +323,9 @@ MODULE Print; PROCEDURE Conversion() : BOOLEAN; - PROCEDURE Fill(cnt: LONGINT); + PROCEDURE Fill(cnt: Types.Int32); (* cnt: space used by normal output *) - VAR i: LONGINT; + VAR i: Types.Int32; BEGIN IF cnt < width THEN i := width - cnt; @@ -334,14 +336,14 @@ MODULE Print; END; END Fill; - PROCEDURE FillLeft(cnt: LONGINT); + PROCEDURE FillLeft(cnt: Types.Int32); BEGIN IF ~leftaligned THEN Fill(cnt); END; END FillLeft; - PROCEDURE FillRight(cnt: LONGINT); + PROCEDURE FillRight(cnt: Types.Int32); BEGIN IF leftaligned THEN Fill(cnt); @@ -349,10 +351,10 @@ MODULE Print; END FillRight; PROCEDURE WriteBool(true, false: ARRAY OF CHAR) : BOOLEAN; - VAR index: INTEGER; val: LONGINT; + VAR index: Types.Int32; val: Types.Int32; PROCEDURE WriteString(VAR s: ARRAY OF CHAR); - VAR i, len: INTEGER; + VAR i, len: Types.Int32; BEGIN len := 0; WHILE (len < LEN(s)) & (s[len] # 0X) DO @@ -379,8 +381,8 @@ MODULE Print; PROCEDURE WriteChar() : BOOLEAN; VAR - val: LONGINT; - index: INTEGER; + val: Types.Int32; + index: Types.Int32; BEGIN IF NextArg(index) & GetInt(index, val) & (val >= 0) & (val <= ORD(MAX(CHAR))) THEN @@ -392,21 +394,21 @@ MODULE Print; RETURN FALSE END WriteChar; - PROCEDURE WriteInt(base: INTEGER) : BOOLEAN; + PROCEDURE WriteInt(base: Types.Int32) : BOOLEAN; VAR - index: INTEGER; - val: LONGINT; + index: Types.Int32; + val: Types.Int32; neg: BOOLEAN; (* set by Convert *) buf: ARRAY 12 OF CHAR; (* filled by Convert *) - i: INTEGER; - len: INTEGER; (* space needed for val *) - signcnt: INTEGER; (* =1 if sign printed; else 0 *) + i: Types.Int32; + len: Types.Int32; (* space needed for val *) + signcnt: Types.Int32; (* =1 if sign printed; else 0 *) signch: CHAR; PROCEDURE Convert; VAR - index: INTEGER; - digit: LONGINT; + index: Types.Int32; + digit: Types.Int32; BEGIN neg := val < 0; index := 0; @@ -462,36 +464,36 @@ MODULE Print; CONST defaultscale = 6; VAR - index: INTEGER; - lr: LONGREAL; - r: REAL; - shortint: SHORTINT; int: INTEGER; longint: LONGINT; + index: Types.Int32; + lr: Types.Real64; + r: Types.Real32; + shortint: Types.Int8; int: Types.Int32; longint: Types.Int32; int16: SYS.INT16; long: BOOLEAN; - exponent: INTEGER; - mantissa: LONGREAL; + exponent: Types.Int32; + mantissa: Types.Real64; digits: ARRAY Reals.maxlongdignum OF CHAR; neg: BOOLEAN; - ndigits: INTEGER; - decpt: INTEGER; + ndigits: Types.Int32; + decpt: Types.Int32; - PROCEDURE Print(decpt: INTEGER; withexp: BOOLEAN; exp: INTEGER); + PROCEDURE Print(decpt: Types.Int32; withexp: BOOLEAN; exp: Types.Int32); (* decpt: position of decimal point = 0: just before the digits > 0: after decpt digits < 0: ABS(decpt) zeroes before digits needed *) VAR - needed: INTEGER; (* space needed *) - index: INTEGER; - count: LONGINT; + needed: Types.Int32; (* space needed *) + index: Types.Int32; + count: Types.Int32; - PROCEDURE WriteExp(exp: INTEGER); + PROCEDURE WriteExp(exp: Types.Int32); CONST base = 10; VAR - power: INTEGER; - digit: INTEGER; + power: Types.Int32; + digit: Types.Int32; BEGIN IF long THEN Write("D"); @@ -581,18 +583,18 @@ MODULE Print; BEGIN (* WriteReal *) IF NextArg(index) THEN - IF arglen[index] = SIZE(LONGREAL) THEN + IF arglen[index] = SIZE(Types.Real64) THEN long := TRUE; Convert(index, lr); - ELSIF arglen[index] = SIZE(REAL) THEN + ELSIF arglen[index] = SIZE(Types.Real32) THEN long := FALSE; Convert(index, r); lr := r; - ELSIF arglen[index] = SIZE(LONGINT) THEN + ELSIF arglen[index] = SIZE(Types.Int32) THEN long := FALSE; Convert(index, longint); lr := longint; - ELSIF arglen[index] = SIZE(INTEGER) THEN + ELSIF arglen[index] = SIZE(Types.Int32) THEN long := FALSE; Convert(index, int); lr := int; @@ -600,7 +602,7 @@ MODULE Print; long := FALSE; Convert(index, int16); lr := int16; - ELSIF arglen[index] = SIZE(SHORTINT) THEN + ELSIF arglen[index] = SIZE(Types.Int8) THEN long := FALSE; Convert(index, shortint); lr := shortint; @@ -634,6 +636,7 @@ MODULE Print; ndigits := 1; END; | "g": ndigits := SHORT(scale); + ELSE END; Reals.Digits(mantissa, 10, digits, neg, (* force = *) format # "g", ndigits); @@ -654,6 +657,7 @@ MODULE Print; END; Print(decpt, (* withexp = *) FALSE, 0); END; + ELSE END; RETURN TRUE ELSE @@ -663,16 +667,16 @@ MODULE Print; PROCEDURE WriteString() : BOOLEAN; VAR - index: INTEGER; - i: LONGINT; - byte: BYTE; - len: LONGINT; + index: Types.Int32; + i: Types.Int32; + byte: SYS.BYTE; + len: Types.Int32; BEGIN IF NextArg(index) THEN len := 0; WHILE (len < arglen[index]) & ((scale = -1) OR (len < scale)) & - (CHR(Access(index, len)) # 0X) DO + ((*CHR*)SYS.VAL(CHAR, Access(index, len)) # 0X) DO INC(len); END; FillLeft(len); @@ -755,205 +759,205 @@ MODULE Print; (* === public part ============================================== *) - PROCEDURE F(fmt: ARRAY OF CHAR); - VAR x: INTEGER; + PROCEDURE F*(fmt: ARRAY OF CHAR); + VAR x: Types.Int32; BEGIN Out(Streams.stdout, fmt, 0, x,x,x,x,x,x,x,x,x, NIL); END F; - PROCEDURE F1(fmt: ARRAY OF CHAR; p1: ARRAY OF BYTE); - VAR x: INTEGER; + PROCEDURE F1*(fmt: ARRAY OF CHAR; p1: ARRAY OF SYS.BYTE); + VAR x: Types.Int32; BEGIN Out(Streams.stdout, fmt, 1, p1, x,x,x,x,x,x,x,x, NIL); END F1; - PROCEDURE F2(fmt: ARRAY OF CHAR; p1, p2: ARRAY OF BYTE); - VAR x: INTEGER; + PROCEDURE F2*(fmt: ARRAY OF CHAR; p1, p2: ARRAY OF SYS.BYTE); + VAR x: Types.Int32; BEGIN Out(Streams.stdout, fmt, 2, p1,p2, x,x,x,x,x,x,x, NIL); END F2; - PROCEDURE F3(fmt: ARRAY OF CHAR; p1, p2, p3: ARRAY OF BYTE); - VAR x: INTEGER; + PROCEDURE F3*(fmt: ARRAY OF CHAR; p1, p2, p3: ARRAY OF SYS.BYTE); + VAR x: Types.Int32; BEGIN Out(Streams.stdout, fmt, 3, p1,p2,p3, x,x,x,x,x,x, NIL); END F3; - PROCEDURE F4(fmt: ARRAY OF CHAR; p1, p2, p3, p4: ARRAY OF BYTE); - VAR x: INTEGER; + PROCEDURE F4*(fmt: ARRAY OF CHAR; p1, p2, p3, p4: ARRAY OF SYS.BYTE); + VAR x: Types.Int32; BEGIN Out(Streams.stdout, fmt, 4, p1,p2,p3,p4, x,x,x,x,x, NIL); END F4; - PROCEDURE F5(fmt: ARRAY OF CHAR; p1, p2, p3, p4, p5: ARRAY OF BYTE); - VAR x: INTEGER; + PROCEDURE F5*(fmt: ARRAY OF CHAR; p1, p2, p3, p4, p5: ARRAY OF SYS.BYTE); + VAR x: Types.Int32; BEGIN Out(Streams.stdout, fmt, 5, p1,p2,p3,p4,p5, x,x,x,x, NIL); END F5; - PROCEDURE F6(fmt: ARRAY OF CHAR; p1, p2, p3, p4, p5, p6: ARRAY OF BYTE); - VAR x: INTEGER; + PROCEDURE F6*(fmt: ARRAY OF CHAR; p1, p2, p3, p4, p5, p6: ARRAY OF SYS.BYTE); + VAR x: Types.Int32; BEGIN Out(Streams.stdout, fmt, 6, p1,p2,p3,p4,p5,p6, x,x,x, NIL); END F6; - PROCEDURE F7(fmt: ARRAY OF CHAR; p1, p2, p3, p4, p5, p6, p7: ARRAY OF BYTE); - VAR x: INTEGER; + PROCEDURE F7*(fmt: ARRAY OF CHAR; p1, p2, p3, p4, p5, p6, p7: ARRAY OF SYS.BYTE); + VAR x: Types.Int32; BEGIN Out(Streams.stdout, fmt, 7, p1,p2,p3,p4,p5,p6,p7, x,x, NIL); END F7; - PROCEDURE F8(fmt: ARRAY OF CHAR; - p1, p2, p3, p4, p5, p6, p7, p8: ARRAY OF BYTE); - VAR x: INTEGER; + PROCEDURE F8*(fmt: ARRAY OF CHAR; + p1, p2, p3, p4, p5, p6, p7, p8: ARRAY OF SYS.BYTE); + VAR x: Types.Int32; BEGIN Out(Streams.stdout, fmt, 8, p1,p2,p3,p4,p5,p6,p7,p8, x, NIL); END F8; - PROCEDURE F9(fmt: ARRAY OF CHAR; - p1, p2, p3, p4, p5, p6, p7, p8, p9: ARRAY OF BYTE); + PROCEDURE F9*(fmt: ARRAY OF CHAR; + p1, p2, p3, p4, p5, p6, p7, p8, p9: ARRAY OF SYS.BYTE); BEGIN Out(Streams.stdout, fmt, 9, p1,p2,p3,p4,p5,p6,p7,p8,p9, NIL); END F9; - PROCEDURE S(out: Streams.Stream; fmt: ARRAY OF CHAR); - VAR x: INTEGER; + PROCEDURE S*(out: Streams.Stream; fmt: ARRAY OF CHAR); + VAR x: Types.Int32; BEGIN Out(out, fmt, 0, x,x,x,x,x,x,x,x,x, NIL); END S; - PROCEDURE S1(out: Streams.Stream; fmt: ARRAY OF CHAR; p1: ARRAY OF BYTE); - VAR x: INTEGER; + PROCEDURE S1*(out: Streams.Stream; fmt: ARRAY OF CHAR; p1: ARRAY OF SYS.BYTE); + VAR x: Types.Int32; BEGIN Out(out, fmt, 1, p1, x,x,x,x,x,x,x,x, NIL); END S1; - PROCEDURE S2(out: Streams.Stream; fmt: ARRAY OF CHAR; p1, p2: ARRAY OF BYTE); - VAR x: INTEGER; + PROCEDURE S2*(out: Streams.Stream; fmt: ARRAY OF CHAR; p1, p2: ARRAY OF SYS.BYTE); + VAR x: Types.Int32; BEGIN Out(out, fmt, 2, p1,p2, x,x,x,x,x,x,x, NIL); END S2; - PROCEDURE S3(out: Streams.Stream; fmt: ARRAY OF CHAR; p1, p2, p3: ARRAY OF BYTE); - VAR x: INTEGER; + PROCEDURE S3*(out: Streams.Stream; fmt: ARRAY OF CHAR; p1, p2, p3: ARRAY OF SYS.BYTE); + VAR x: Types.Int32; BEGIN Out(out, fmt, 3, p1,p2,p3, x,x,x,x,x,x, NIL); END S3; - PROCEDURE S4(out: Streams.Stream; fmt: ARRAY OF CHAR; - p1, p2, p3, p4: ARRAY OF BYTE); - VAR x: INTEGER; + PROCEDURE S4*(out: Streams.Stream; fmt: ARRAY OF CHAR; + p1, p2, p3, p4: ARRAY OF SYS.BYTE); + VAR x: Types.Int32; BEGIN Out(out, fmt, 4, p1,p2,p3,p4, x,x,x,x,x, NIL); END S4; - PROCEDURE S5(out: Streams.Stream; fmt: ARRAY OF CHAR; - p1, p2, p3, p4, p5: ARRAY OF BYTE); - VAR x: INTEGER; + PROCEDURE S5*(out: Streams.Stream; fmt: ARRAY OF CHAR; + p1, p2, p3, p4, p5: ARRAY OF SYS.BYTE); + VAR x: Types.Int32; BEGIN Out(out, fmt, 5, p1,p2,p3,p4,p5, x,x,x,x, NIL); END S5; - PROCEDURE S6(out: Streams.Stream; fmt: ARRAY OF CHAR; - p1, p2, p3, p4, p5, p6: ARRAY OF BYTE); - VAR x: INTEGER; + PROCEDURE S6*(out: Streams.Stream; fmt: ARRAY OF CHAR; + p1, p2, p3, p4, p5, p6: ARRAY OF SYS.BYTE); + VAR x: Types.Int32; BEGIN Out(out, fmt, 6, p1,p2,p3,p4,p5,p6, x,x,x, NIL); END S6; - PROCEDURE S7(out: Streams.Stream; fmt: ARRAY OF CHAR; - p1, p2, p3, p4, p5, p6, p7: ARRAY OF BYTE); - VAR x: INTEGER; + PROCEDURE S7*(out: Streams.Stream; fmt: ARRAY OF CHAR; + p1, p2, p3, p4, p5, p6, p7: ARRAY OF SYS.BYTE); + VAR x: Types.Int32; BEGIN Out(out, fmt, 7, p1,p2,p3,p4,p5,p6,p7, x,x, NIL); END S7; - PROCEDURE S8(out: Streams.Stream; fmt: ARRAY OF CHAR; - p1, p2, p3, p4, p5, p6, p7, p8: ARRAY OF BYTE); - VAR x: INTEGER; + PROCEDURE S8*(out: Streams.Stream; fmt: ARRAY OF CHAR; + p1, p2, p3, p4, p5, p6, p7, p8: ARRAY OF SYS.BYTE); + VAR x: Types.Int32; BEGIN Out(out, fmt, 8, p1,p2,p3,p4,p5,p6,p7,p8, x, NIL); END S8; - PROCEDURE S9(out: Streams.Stream; fmt: ARRAY OF CHAR; - p1, p2, p3, p4, p5, p6, p7, p8, p9: ARRAY OF BYTE); + PROCEDURE S9*(out: Streams.Stream; fmt: ARRAY OF CHAR; + p1, p2, p3, p4, p5, p6, p7, p8, p9: ARRAY OF SYS.BYTE); BEGIN Out(out, fmt, 9, p1,p2,p3,p4,p5,p6,p7,p8,p9, NIL); END S9; - PROCEDURE SE(out: Streams.Stream; fmt: ARRAY OF CHAR; + PROCEDURE SE*(out: Streams.Stream; fmt: ARRAY OF CHAR; errors: RelatedEvents.Object); - VAR x: INTEGER; + VAR x: Types.Int32; BEGIN Out(out, fmt, 0, x,x,x,x,x,x,x,x,x, NIL); END SE; - PROCEDURE SE1(out: Streams.Stream; fmt: ARRAY OF CHAR; p1: ARRAY OF BYTE; + PROCEDURE SE1*(out: Streams.Stream; fmt: ARRAY OF CHAR; p1: ARRAY OF SYS.BYTE; errors: RelatedEvents.Object); - VAR x: INTEGER; + VAR x: Types.Int32; BEGIN Out(out, fmt, 1, p1, x,x,x,x,x,x,x,x, errors); END SE1; - PROCEDURE SE2(out: Streams.Stream; fmt: ARRAY OF CHAR; p1, p2: ARRAY OF BYTE; + PROCEDURE SE2*(out: Streams.Stream; fmt: ARRAY OF CHAR; p1, p2: ARRAY OF SYS.BYTE; errors: RelatedEvents.Object); - VAR x: INTEGER; + VAR x: Types.Int32; BEGIN Out(out, fmt, 2, p1,p2, x,x,x,x,x,x,x, errors); END SE2; - PROCEDURE SE3(out: Streams.Stream; fmt: ARRAY OF CHAR; - p1, p2, p3: ARRAY OF BYTE; + PROCEDURE SE3*(out: Streams.Stream; fmt: ARRAY OF CHAR; + p1, p2, p3: ARRAY OF SYS.BYTE; errors: RelatedEvents.Object); - VAR x: INTEGER; + VAR x: Types.Int32; BEGIN Out(out, fmt, 3, p1,p2,p3, x,x,x,x,x,x, errors); END SE3; - PROCEDURE SE4(out: Streams.Stream; fmt: ARRAY OF CHAR; - p1, p2, p3, p4: ARRAY OF BYTE; + PROCEDURE SE4*(out: Streams.Stream; fmt: ARRAY OF CHAR; + p1, p2, p3, p4: ARRAY OF SYS.BYTE; errors: RelatedEvents.Object); - VAR x: INTEGER; + VAR x: Types.Int32; BEGIN Out(out, fmt, 4, p1,p2,p3,p4, x,x,x,x,x, errors); END SE4; - PROCEDURE SE5(out: Streams.Stream; fmt: ARRAY OF CHAR; - p1, p2, p3, p4, p5: ARRAY OF BYTE; + PROCEDURE SE5*(out: Streams.Stream; fmt: ARRAY OF CHAR; + p1, p2, p3, p4, p5: ARRAY OF SYS.BYTE; errors: RelatedEvents.Object); - VAR x: INTEGER; + VAR x: Types.Int32; BEGIN Out(out, fmt, 5, p1,p2,p3,p4,p5, x,x,x,x, errors); END SE5; - PROCEDURE SE6(out: Streams.Stream; fmt: ARRAY OF CHAR; - p1, p2, p3, p4, p5, p6: ARRAY OF BYTE; + PROCEDURE SE6*(out: Streams.Stream; fmt: ARRAY OF CHAR; + p1, p2, p3, p4, p5, p6: ARRAY OF SYS.BYTE; errors: RelatedEvents.Object); - VAR x: INTEGER; + VAR x: Types.Int32; BEGIN Out(out, fmt, 6, p1,p2,p3,p4,p5,p6, x,x,x, errors); END SE6; - PROCEDURE SE7(out: Streams.Stream; fmt: ARRAY OF CHAR; - p1, p2, p3, p4, p5, p6, p7: ARRAY OF BYTE; + PROCEDURE SE7*(out: Streams.Stream; fmt: ARRAY OF CHAR; + p1, p2, p3, p4, p5, p6, p7: ARRAY OF SYS.BYTE; errors: RelatedEvents.Object); - VAR x: INTEGER; + VAR x: Types.Int32; BEGIN Out(out, fmt, 7, p1,p2,p3,p4,p5,p6,p7, x,x, errors); END SE7; - PROCEDURE SE8(out: Streams.Stream; fmt: ARRAY OF CHAR; - p1, p2, p3, p4, p5, p6, p7, p8: ARRAY OF BYTE; + PROCEDURE SE8*(out: Streams.Stream; fmt: ARRAY OF CHAR; + p1, p2, p3, p4, p5, p6, p7, p8: ARRAY OF SYS.BYTE; errors: RelatedEvents.Object); - VAR x: INTEGER; + VAR x: Types.Int32; BEGIN Out(out, fmt, 8, p1,p2,p3,p4,p5,p6,p7,p8, x, errors); END SE8; - PROCEDURE SE9(out: Streams.Stream; fmt: ARRAY OF CHAR; - p1, p2, p3, p4, p5, p6, p7, p8, p9: ARRAY OF BYTE; + PROCEDURE SE9*(out: Streams.Stream; fmt: ARRAY OF CHAR; + p1, p2, p3, p4, p5, p6, p7, p8, p9: ARRAY OF SYS.BYTE; errors: RelatedEvents.Object); BEGIN Out(out, fmt, 9, p1,p2,p3,p4,p5,p6,p7,p8,p9, errors); @@ -961,4 +965,4 @@ MODULE Print; BEGIN InitErrorHandling; -END Print. +END ulmPrint. diff --git a/src/library/ulm/ulmPriorities.Mod b/src/library/ulm/ulmPriorities.Mod index e171907a..a308df8f 100644 --- a/src/library/ulm/ulmPriorities.Mod +++ b/src/library/ulm/ulmPriorities.Mod @@ -49,7 +49,7 @@ MODULE ulmPriorities; - gap defines the minimum distance between two priority regions defined in this module *) - + IMPORT Types := ulmTypes; CONST region* = 10; gap* = 10; @@ -59,7 +59,7 @@ MODULE ulmPriorities; *) TYPE - Priority* = INTEGER; + Priority* = Types.Int32; VAR (* current priority at begin of execution (after init of Events); diff --git a/src/library/ulm/ulmProcess.Mod b/src/library/ulm/ulmProcess.Mod index 20bb5186..ce4ce70f 100644 --- a/src/library/ulm/ulmProcess.Mod +++ b/src/library/ulm/ulmProcess.Mod @@ -36,7 +36,7 @@ MODULE ulmProcess; - IMPORT Events := ulmEvents, Priorities := ulmPriorities; + IMPORT Events := ulmEvents, Priorities := ulmPriorities, Types := ulmTypes; (* user readable name of our process *) TYPE @@ -48,7 +48,7 @@ MODULE ulmProcess; (* exit codes *) TYPE - ExitCode* = INTEGER; + ExitCode* = Types.Int32; VAR indicateSuccess*: ExitCode; indicateFailure*: ExitCode; @@ -83,7 +83,7 @@ MODULE ulmProcess; (* private declarations *) VAR handlers: Interface; - nestlevel: INTEGER; + nestlevel: Types.Int32; PROCEDURE SetHandlers*(if: Interface); BEGIN diff --git a/src/library/ulm/ulmRandomGenerators.Mod b/src/library/ulm/ulmRandomGenerators.Mod index f1aa36de..baa0219e 100644 --- a/src/library/ulm/ulmRandomGenerators.Mod +++ b/src/library/ulm/ulmRandomGenerators.Mod @@ -74,7 +74,7 @@ MODULE ulmRandomGenerators; Sequence* = POINTER TO SequenceRec; Int32ValSProc* = PROCEDURE (sequence: Sequence): Types.Int32; - LongRealValSProc* = PROCEDURE (sequence: Sequence): LONGREAL; + LongRealValSProc* = PROCEDURE (sequence: Sequence): Types.Real64; RewindSequenceProc* = PROCEDURE (sequence: Sequence); RestartSequenceProc* = PROCEDURE (sequence, seed: Sequence); SetValSProc* = PROCEDURE (sequence: Sequence; value: Operations.Operand); @@ -83,7 +83,7 @@ MODULE ulmRandomGenerators; int32ValS* = 0; longRealValS* = 1; rewindSequence* = 2; restartSequence* = 3; TYPE - CapabilitySet* = SET; (* of [int32ValS..restartSequence] *) + CapabilitySet* = Types.Set; (* of [int32ValS..restartSequence] *) Interface* = POINTER TO InterfaceRec; InterfaceRec* = RECORD @@ -127,8 +127,8 @@ MODULE ulmRandomGenerators; DefaultSequenceRec = RECORD (SequenceRec) - seed1, seed2: LONGINT; - value1, value2: LONGINT; + seed1, seed2: Types.Int32; + value1, value2: Types.Int32; END; ServiceDiscipline = POINTER TO ServiceDisciplineRec; @@ -146,9 +146,9 @@ MODULE ulmRandomGenerators; (* ----- bug workaround ----- *) - PROCEDURE Entier(value: LONGREAL): LONGINT; + PROCEDURE Entier(value: Types.Real64): Types.Int32; VAR - result: LONGINT; + result: Types.Int32; BEGIN result := ENTIER(value); IF result > value THEN @@ -193,12 +193,12 @@ MODULE ulmRandomGenerators; sequence.if.restartSequence(sequence, seed); END RestartSequence; - PROCEDURE ^ LongRealValS*(sequence: Sequence): LONGREAL; + PROCEDURE ^ LongRealValS*(sequence: Sequence): Types.Real64; PROCEDURE Int32ValS*(sequence: Sequence): Types.Int32; (* get random 32-bit value from sequence *) VAR - real: LONGREAL; + real: Types.Real64; BEGIN IF int32ValS IN sequence.caps THEN RETURN sequence.if.int32ValS(sequence) @@ -214,7 +214,7 @@ MODULE ulmRandomGenerators; RETURN Int32ValS(std); END Int32Val; - PROCEDURE LongRealValS*(sequence: Sequence): LONGREAL; + PROCEDURE LongRealValS*(sequence: Sequence): Types.Real64; (* get a uniformly distributed longreal value in [0..1) *) BEGIN IF longRealValS IN sequence.caps THEN @@ -225,32 +225,32 @@ MODULE ulmRandomGenerators; END; END LongRealValS; - PROCEDURE LongRealVal*(): LONGREAL; + PROCEDURE LongRealVal*(): Types.Real64; (* get a uniformly distributed longreal value in [0..1) *) BEGIN RETURN LongRealValS(std) END LongRealVal; - PROCEDURE RealValS*(sequence: Sequence): REAL; + PROCEDURE RealValS*(sequence: Sequence): Types.Real32; (* get a uniformly distributed real value in [0..1) *) BEGIN RETURN SHORT(LongRealValS(sequence)) END RealValS; - PROCEDURE RealVal*(): REAL; + PROCEDURE RealVal*(): Types.Real32; (* get a uniformly distributed real value in [0..1) *) BEGIN RETURN SHORT(LongRealValS(std)) END RealVal; - PROCEDURE ValS*(sequence: Sequence; low, high: LONGINT): LONGINT; + PROCEDURE ValS*(sequence: Sequence; low, high: Types.Int32): Types.Int32; (* get a uniformly distributed integer in [low..high] *) BEGIN ASSERT(low <= high); RETURN Entier( low + LongRealValS(sequence) * (1. + high - low) ) END ValS; - PROCEDURE Val*(low, high: LONGINT): LONGINT; + PROCEDURE Val*(low, high: Types.Int32): Types.Int32; (* get a uniformly distributed integer in [low..high] *) BEGIN RETURN ValS(std, low, high) @@ -305,7 +305,7 @@ MODULE ulmRandomGenerators; (* ----- DefaultSequence ----- *) - PROCEDURE CongruentialStep(VAR value1, value2: LONGINT); + PROCEDURE CongruentialStep(VAR value1, value2: Types.Int32); BEGIN value1 := factor1 * (value1 MOD quotient1) - remainder1 * (value1 DIV quotient1); @@ -319,9 +319,9 @@ MODULE ulmRandomGenerators; END; END CongruentialStep; - PROCEDURE DefaultSequenceValue(sequence: Sequence): LONGREAL; + PROCEDURE DefaultSequenceValue(sequence: Sequence): Types.Real64; VAR - value: LONGINT; + value: Types.Int32; BEGIN WITH sequence: DefaultSequence DO CongruentialStep(sequence.value1, sequence.value2); @@ -357,12 +357,12 @@ MODULE ulmRandomGenerators; if: Interface; daytime: Times.Time; timeval: Times.TimeValueRec; - count: LONGINT; + count: Types.Int32; - PROCEDURE Hash(str: ARRAY OF CHAR): LONGINT; + PROCEDURE Hash(str: ARRAY OF CHAR): Types.Int32; VAR index, - val: LONGINT; + val: Types.Int32; BEGIN val := 27567352; index := 0; diff --git a/src/library/ulm/ulmReals.Mod b/src/library/ulm/ulmReals.Mod index f941c05a..a646512d 100644 --- a/src/library/ulm/ulmReals.Mod +++ b/src/library/ulm/ulmReals.Mod @@ -33,14 +33,14 @@ MODULE ulmReals; - IMPORT IEEE := ulmIEEE, MC68881 := ulmMC68881; + IMPORT IEEE := ulmIEEE, MC68881 := ulmMC68881, Types := ulmTypes; CONST - (* for REAL *) + (* for Types.Real32 *) maxexp* = 309; minexp* = -323; maxdignum* = 16; - (* for LONGREAL *) + (* for Types.Real64 *) (* maxlongexp = 4932; minlongexp = -4951; @@ -55,30 +55,30 @@ MODULE ulmReals; TYPE PowerRec = RECORD - p10: LONGREAL; - n: INTEGER; + p10: Types.Real64; + n: Types.Int32; END; VAR powtab: ARRAY powers OF PowerRec; - sigdigits: ARRAY maxbase+1 OF INTEGER; (* valid range: [2..maxbase] *) + sigdigits: ARRAY maxbase+1 OF Types.Int32; (* valid range: [2..maxbase] *) - PROCEDURE ExpAndMan*(r: LONGREAL; long: BOOLEAN; base: INTEGER; - VAR exponent: INTEGER; VAR mantissa: LONGREAL); + PROCEDURE ExpAndMan*(r: Types.Real64; long: BOOLEAN; base: Types.Int32; + VAR exponent: Types.Int32; VAR mantissa: Types.Real64); (* get exponent and mantissa from `r': (1.0 >= ABS(mantissa)) & (ABS(mantissa) < base) r = mantissa * base^exponent - long should be false if a REAL-value is passed to `r' + long should be false if a Types.Real32-value is passed to `r' valid values of base: 2, 8, 10, and 16 *) VAR neg: BOOLEAN; - index: INTEGER; - roundoff: LONGREAL; - i: INTEGER; - ndigits: INTEGER; + index: Types.Int32; + roundoff: Types.Real64; + i: Types.Int32; + ndigits: Types.Int32; BEGIN IF r = 0.0 THEN exponent := 0; mantissa := 0; RETURN @@ -164,10 +164,10 @@ MODULE ulmReals; END; END ExpAndMan; - PROCEDURE Power*(base: LONGREAL; exp: INTEGER) : LONGREAL; + PROCEDURE Power*(base: Types.Real64; exp: Types.Int32) : Types.Real64; (* efficient calculation of base^exp *) VAR - r, res: LONGREAL; + r, res: Types.Real64; neg: BOOLEAN; (* negative exponent? *) BEGIN IF MC68881.available & (base = 10) THEN @@ -197,10 +197,10 @@ MODULE ulmReals; END; END Power; - PROCEDURE Digits*(mantissa: LONGREAL; base: INTEGER; + PROCEDURE Digits*(mantissa: Types.Real64; base: Types.Int32; VAR buf: ARRAY OF CHAR; VAR neg: BOOLEAN; - force: BOOLEAN; VAR ndigits: INTEGER); + force: BOOLEAN; VAR ndigits: Types.Int32); (* PRE: mantissa holds the post-condition of ExpAndMan; valid values for base are 2, 8, 10, and 16 @@ -216,11 +216,11 @@ MODULE ulmReals; ndigits is unchanged *) VAR - index: INTEGER; (* of buf *) - i: INTEGER; roundoff: LONGREAL; - lastnz: INTEGER; (* last index with buf[index] # "0" *) + index: Types.Int32; (* of buf *) + i: Types.Int32; roundoff: Types.Real64; + lastnz: Types.Int32; (* last index with buf[index] # "0" *) ch: CHAR; - digit: LONGINT; + digit: Types.Int32; maxdig: CHAR; (* base-1 converted *) BEGIN @@ -269,14 +269,14 @@ MODULE ulmReals; buf[index] := 0X; ndigits := index; END Digits; - PROCEDURE Convert*(digits: ARRAY OF CHAR; base: INTEGER; neg: BOOLEAN; - VAR mantissa: LONGREAL); + PROCEDURE Convert*(digits: ARRAY OF CHAR; base: Types.Int32; neg: BOOLEAN; + VAR mantissa: Types.Real64); (* convert normalized `digits' (decimal point after 1st digit) into `mantissa' *) VAR - index: INTEGER; - factor: LONGREAL; + index: Types.Int32; + factor: Types.Real64; BEGIN IF digits = "0" THEN mantissa := 0; @@ -304,7 +304,7 @@ BEGIN powtab[4].p10 := 1.0D2; powtab[4].n := 2; powtab[5].p10 := 1.0D1; powtab[5].n := 1; - (* for LONGREAL *) + (* for Types.Real64 *) sigdigits[2] := 64; sigdigits[3] := 40; sigdigits[4] := 32; sigdigits[5] := 27; sigdigits[6] := 24; sigdigits[7] := 22; sigdigits[8] := 21; sigdigits[9] := 20; sigdigits[10] := 19; diff --git a/src/library/ulm/ulmScales.Mod b/src/library/ulm/ulmScales.Mod index 12cf5363..25af6eac 100644 --- a/src/library/ulm/ulmScales.Mod +++ b/src/library/ulm/ulmScales.Mod @@ -39,7 +39,7 @@ MODULE ulmScales; IMPORT Disciplines := ulmDisciplines, Events := ulmEvents, Objects := ulmObjects, Operations := ulmOperations, PersistentObjects := ulmPersistentObjects, - RelatedEvents := ulmRelatedEvents, Services := ulmServices, SYS := SYSTEM; + RelatedEvents := ulmRelatedEvents, Services := ulmServices, SYS := SYSTEM, Types := ulmTypes; TYPE Scale* = POINTER TO ScaleRec; @@ -88,25 +88,25 @@ MODULE ulmScales; RECORD (Operations.OperandRec) scale: Scale; - type: SHORTINT; (* absolute or relative? *) + type: Types.Int8; (* absolute or relative? *) END; VAR measureType: Services.Type; TYPE - Value* = LONGINT; + Value* = Types.Int32; CONST add* = Operations.add; sub* = Operations.sub; TYPE - Operation* = SHORTINT; (* add or sub *) + Operation* = Types.Int8; (* add or sub *) TYPE CreateProc* = PROCEDURE (scale: Scale; VAR measure: Measure; abs: BOOLEAN); GetValueProc* = PROCEDURE (measure: Measure; unit: Unit; VAR value: Value); SetValueProc* = PROCEDURE (measure: Measure; unit: Unit; value: Value); AssignProc* = PROCEDURE (target: Measure; source: Measure); OperatorProc* = PROCEDURE (op: Operation; op1, op2, result: Measure); - CompareProc* = PROCEDURE (op1, op2: Measure) : INTEGER; + CompareProc* = PROCEDURE (op1, op2: Measure) : Types.Int32; ConvertProc* = PROCEDURE (from, to: Measure); InterfaceRec* = @@ -183,7 +183,7 @@ MODULE ulmScales; scale.tail := listp; END InitUnit; - PROCEDURE CreateMeasure*(scale: Scale; VAR measure: Measure; type: SHORTINT); + PROCEDURE CreateMeasure*(scale: Scale; VAR measure: Measure; type: Types.Int8); BEGIN scale.if.create(scale, measure, type = absolute); Operations.Init(measure, opif, opcaps); @@ -295,7 +295,7 @@ MODULE ulmScales; RETURN measure.type = relative END IsRelative; - PROCEDURE MeasureType*(measure: Measure) : SHORTINT; + PROCEDURE MeasureType*(measure: Measure) : Types.Int8; BEGIN RETURN measure.type END MeasureType; @@ -372,10 +372,10 @@ MODULE ulmScales; PROCEDURE Op(op: Operations.Operation; op1, op2: Operations.Operand; VAR result: Operations.Operand); VAR - restype: SHORTINT; (* type of result -- set by CheckTypes *) + restype: Types.Int8; (* type of result -- set by CheckTypes *) m1, m2: Measure; - PROCEDURE CheckTypes(VAR restype: SHORTINT); + PROCEDURE CheckTypes(VAR restype: Types.Int8); (* check operands for correct typing; sets restype to the correct result type; *) @@ -419,7 +419,7 @@ MODULE ulmScales; END; END Op; - PROCEDURE Compare(op1, op2: Operations.Operand) : INTEGER; + PROCEDURE Compare(op1, op2: Operations.Operand) : Types.Int32; VAR m1, m2: Measure; BEGIN diff --git a/src/library/ulm/ulmServices.Mod b/src/library/ulm/ulmServices.Mod index 7ec557df..73b80aad 100644 --- a/src/library/ulm/ulmServices.Mod +++ b/src/library/ulm/ulmServices.Mod @@ -31,7 +31,7 @@ MODULE ulmServices; - IMPORT Disciplines := ulmDisciplines, Objects := ulmObjects; + IMPORT Disciplines := ulmDisciplines, Objects := ulmObjects, Types := ulmTypes; TYPE Type* = POINTER TO TypeRec; @@ -84,9 +84,9 @@ MODULE ulmServices; bufsize = 512; (* length of a name buffer in bytes *) tabsize = 1171; TYPE - BufferPosition = INTEGER; - Length = LONGINT; - HashValue = INTEGER; + BufferPosition = Types.Int32; + Length = Types.Int32; + HashValue = Types.Int32; Buffer = ARRAY bufsize OF CHAR; NameList = POINTER TO NameListRec; NameListRec = @@ -116,14 +116,14 @@ MODULE ulmServices; (* ==== name table management ======================================== *) - PROCEDURE Hash(name: ARRAY OF CHAR; length: LONGINT) : HashValue; + PROCEDURE Hash(name: ARRAY OF CHAR; length: Types.Int32) : HashValue; CONST shift = 4; VAR - index: LONGINT; - val: LONGINT; + index: Types.Int32; + val: Types.Int32; ch: CHAR; - ordval: INTEGER; + ordval: Types.Int32; BEGIN index := 0; val := length; WHILE index < length DO @@ -150,9 +150,9 @@ MODULE ulmServices; currentPos := 0; END CreateBuf; - PROCEDURE StringLength(string: ARRAY OF CHAR) : LONGINT; + PROCEDURE StringLength(string: ARRAY OF CHAR) : Types.Int32; VAR - index: LONGINT; + index: Types.Int32; BEGIN index := 0; WHILE (index < LEN(string)) & (string[index] # 0X) DO @@ -163,7 +163,7 @@ MODULE ulmServices; PROCEDURE InitName(name: Type; string: ARRAY OF CHAR); VAR - index, length: LONGINT; + index, length: Types.Int32; firstbuf, buf: NameList; startpos: BufferPosition; BEGIN @@ -195,9 +195,9 @@ MODULE ulmServices; PROCEDURE EqualName(name: Type; string: ARRAY OF CHAR) : BOOLEAN; (* precondition: both have the same length *) VAR - index: LONGINT; + index: Types.Int32; buf: NameList; - pos: INTEGER; + pos: Types.Int32; BEGIN buf := name.begin; pos := name.pos; index := 0; @@ -216,7 +216,7 @@ MODULE ulmServices; PROCEDURE SeekName(string: ARRAY OF CHAR; VAR name: Type) : BOOLEAN; VAR - length: LONGINT; + length: Types.Int32; hashval: HashValue; p: Type; BEGIN @@ -232,9 +232,9 @@ MODULE ulmServices; PROCEDURE ExtractName(name: Type; VAR string: ARRAY OF CHAR); VAR - index: LONGINT; + index: Types.Int32; buf: NameList; - pos: INTEGER; + pos: Types.Int32; BEGIN buf := name.begin; pos := name.pos; index := 0; @@ -331,7 +331,7 @@ MODULE ulmServices; PROCEDURE GetModule(name: ARRAY OF CHAR; VAR module: ARRAY OF CHAR); (* get the name of the module where 'name' was defined *) VAR - index: INTEGER; + index: Types.Int32; BEGIN index := 0; WHILE (name[index] # ".") & (name[index] # 0X) & diff --git a/src/library/ulm/ulmSets.Mod b/src/library/ulm/ulmSets.Mod index 7c75a3ff..a1dcd4df 100644 --- a/src/library/ulm/ulmSets.Mod +++ b/src/library/ulm/ulmSets.Mod @@ -35,15 +35,16 @@ *) MODULE ulmSets; +IMPORT Types := ulmTypes; CONST - setsize* = MAX(SET) + 1; + setsize* = MAX(Types.Set) + 1; TYPE - CharSet* = ARRAY (ORD(MAX(CHAR)) + 1) DIV setsize OF SET; + CharSet* = ARRAY (ORD(MAX(CHAR)) + 1) DIV setsize OF Types.Set; - PROCEDURE InitSet*(VAR set: ARRAY OF SET); - VAR i: LONGINT; + PROCEDURE InitSet*(VAR set: ARRAY OF Types.Set); + VAR i: Types.Int32; BEGIN i := 0; WHILE i < LEN(set) DO @@ -51,8 +52,8 @@ MODULE ulmSets; END; END InitSet; - PROCEDURE Complement*(VAR set: ARRAY OF SET); - VAR i: LONGINT; + PROCEDURE Complement*(VAR set: ARRAY OF Types.Set); + VAR i: Types.Int32; BEGIN i := 0; WHILE i < LEN(set) DO @@ -60,17 +61,17 @@ MODULE ulmSets; END; END Complement; - PROCEDURE In*(VAR set: ARRAY OF SET; i: LONGINT) : BOOLEAN; + PROCEDURE In*(VAR set: ARRAY OF Types.Set; i: Types.Int32) : BOOLEAN; BEGIN RETURN (i MOD setsize) IN set[i DIV setsize] END In; - PROCEDURE Incl*(VAR set: ARRAY OF SET; i: LONGINT); + PROCEDURE Incl*(VAR set: ARRAY OF Types.Set; i: Types.Int32); BEGIN INCL(set[i DIV setsize], i MOD setsize); END Incl; - PROCEDURE Excl*(VAR set: ARRAY OF SET; i: LONGINT); + PROCEDURE Excl*(VAR set: ARRAY OF Types.Set; i: Types.Int32); BEGIN EXCL(set[i DIV setsize], i MOD setsize); END Excl; @@ -90,9 +91,9 @@ MODULE ulmSets; EXCL(charset[ORD(ch) DIV setsize], ORD(ch) MOD setsize); END ExclChar; - PROCEDURE Intersection*(set1, set2: ARRAY OF SET; VAR result: ARRAY OF SET); + PROCEDURE Intersection*(set1, set2: ARRAY OF Types.Set; VAR result: ARRAY OF Types.Set); VAR - index: INTEGER; + index: Types.Int32; BEGIN ASSERT((LEN(result) = LEN(set1)) & (LEN(result) = LEN(set2))); index := 0; @@ -102,9 +103,9 @@ MODULE ulmSets; END; END Intersection; - PROCEDURE SymDifference*(set1, set2: ARRAY OF SET; VAR result: ARRAY OF SET); + PROCEDURE SymDifference*(set1, set2: ARRAY OF Types.Set; VAR result: ARRAY OF Types.Set); VAR - index: INTEGER; + index: Types.Int32; BEGIN ASSERT((LEN(result) = LEN(set1)) & (LEN(result) = LEN(set2))); index := 0; @@ -114,9 +115,9 @@ MODULE ulmSets; END; END SymDifference; - PROCEDURE Union*(set1, set2: ARRAY OF SET; VAR result: ARRAY OF SET); + PROCEDURE Union*(set1, set2: ARRAY OF Types.Set; VAR result: ARRAY OF Types.Set); VAR - index: INTEGER; + index: Types.Int32; BEGIN ASSERT((LEN(result) = LEN(set1)) & (LEN(result) = LEN(set2))); index := 0; @@ -126,9 +127,9 @@ MODULE ulmSets; END; END Union; - PROCEDURE Difference*(set1, set2: ARRAY OF SET; VAR result: ARRAY OF SET); + PROCEDURE Difference*(set1, set2: ARRAY OF Types.Set; VAR result: ARRAY OF Types.Set); VAR - index: INTEGER; + index: Types.Int32; BEGIN ASSERT((LEN(result) = LEN(set1)) & (LEN(result) = LEN(set2))); index := 0; @@ -138,9 +139,9 @@ MODULE ulmSets; END; END Difference; - PROCEDURE Equal*(set1, set2: ARRAY OF SET) : BOOLEAN; + PROCEDURE Equal*(set1, set2: ARRAY OF Types.Set) : BOOLEAN; VAR - index: INTEGER; + index: Types.Int32; BEGIN index := 0; WHILE (index < LEN(set1)) & (index < LEN(set2)) DO @@ -164,9 +165,9 @@ MODULE ulmSets; RETURN TRUE END Equal; - PROCEDURE Subset*(set1, set2: ARRAY OF SET) : BOOLEAN; + PROCEDURE Subset*(set1, set2: ARRAY OF Types.Set) : BOOLEAN; VAR - index: INTEGER; + index: Types.Int32; BEGIN index := 0; WHILE (index < LEN(set1)) & (index < LEN(set2)) DO @@ -184,17 +185,17 @@ MODULE ulmSets; RETURN TRUE END Subset; - PROCEDURE Card*(set: ARRAY OF SET) : INTEGER; + PROCEDURE Card*(set: ARRAY OF Types.Set) : Types.Int32; VAR - index: INTEGER; - i: INTEGER; - card: INTEGER; + index: Types.Int32; + i: Types.Int32; + card: Types.Int32; BEGIN card := 0; index := 0; WHILE index < LEN(set) DO i := 0; - WHILE i <= MAX(SET) DO + WHILE i <= MAX(Types.Set) DO IF i IN set[index] THEN INC(card); END; diff --git a/src/library/ulm/ulmStreamDisciplines.Mod b/src/library/ulm/ulmStreamDisciplines.Mod index 522f9cda..32f56bfe 100644 --- a/src/library/ulm/ulmStreamDisciplines.Mod +++ b/src/library/ulm/ulmStreamDisciplines.Mod @@ -35,7 +35,7 @@ MODULE ulmStreamDisciplines; (* definition of general-purpose disciplines for streams *) - IMPORT ASCII := ulmASCII, Disciplines := ulmIndirectDisciplines, Events := ulmEvents, Sets := ulmSets, Streams := ulmStreams, SYSTEM; + IMPORT ASCII := ulmASCII, Disciplines := ulmIndirectDisciplines, Events := ulmEvents, Sets := ulmSets, Streams := ulmStreams, SYSTEM, Types := ulmTypes; TYPE LineTerminator* = ARRAY 4 OF CHAR; @@ -51,7 +51,7 @@ MODULE ulmStreamDisciplines; fieldseps: Sets.CharSet; fieldsep: CHAR; (* one of them *) whitespace: Sets.CharSet; - indentwidth: INTEGER; + indentwidth: Types.Int32; END; VAR @@ -61,7 +61,7 @@ MODULE ulmStreamDisciplines; defaultFieldSep: CHAR; defaultLineTerm: LineTerminator; defaultWhiteSpace: Sets.CharSet; - defaultIndentWidth: INTEGER; + defaultIndentWidth: Types.Int32; PROCEDURE InitDiscipline(VAR disc: Disciplines.Discipline); VAR @@ -194,7 +194,7 @@ MODULE ulmStreamDisciplines; Disciplines.Add(s, disc); END SetWhiteSpace; - PROCEDURE SetIndentationWidth*(s: Streams.Stream; indentwidth: INTEGER); + PROCEDURE SetIndentationWidth*(s: Streams.Stream; indentwidth: Types.Int32); VAR disc: Disciplines.Discipline; BEGIN @@ -207,7 +207,7 @@ MODULE ulmStreamDisciplines; END; END SetIndentationWidth; - PROCEDURE GetIndentationWidth*(s: Streams.Stream; VAR indentwidth: INTEGER); + PROCEDURE GetIndentationWidth*(s: Streams.Stream; VAR indentwidth: Types.Int32); VAR disc: Disciplines.Discipline; BEGIN @@ -218,7 +218,7 @@ MODULE ulmStreamDisciplines; END; END GetIndentationWidth; - PROCEDURE IncrIndentationWidth*(s: Streams.Stream; incr: INTEGER); + PROCEDURE IncrIndentationWidth*(s: Streams.Stream; incr: Types.Int32); VAR disc: Disciplines.Discipline; BEGIN diff --git a/src/library/ulm/ulmStreams.Mod b/src/library/ulm/ulmStreams.Mod index bb55c3e6..37f25dfd 100644 --- a/src/library/ulm/ulmStreams.Mod +++ b/src/library/ulm/ulmStreams.Mod @@ -144,10 +144,10 @@ MODULE ulmStreams; Address* = Types.Address; Count* = Types.Count; Byte* = Types.Byte; - Whence* = SHORTINT; (* Whence = (fromStart, fromPos, fromEnd); *) - CapabilitySet* = SET; (* OF Capability; *) - BufMode* = SHORTINT; - ErrorCode* = SHORTINT; + Whence* = Types.Int8; (* Whence = (fromStart, fromPos, fromEnd); *) + CapabilitySet* = Types.Set; (* OF Capability; *) + BufMode* = Types.Int8; + ErrorCode* = Types.Int8; Stream* = POINTER TO StreamRec; Message* = RECORD (Objects.ObjectRec) END; @@ -185,8 +185,8 @@ MODULE ulmStreams; BufferPool = POINTER TO BufferPoolRec; BufferPoolRec = RECORD - maxbuf: INTEGER; (* maximal number of buffers to be used *) - nbuf: INTEGER; (* number of buffers in use *) + maxbuf: Types.Int32; (* maximal number of buffers to be used *) + nbuf: Types.Int32; (* number of buffers in use *) bucket: BucketTable; (* list of all buffers sorted after the last access time; tail points to the buffer most recently accessed @@ -230,7 +230,7 @@ MODULE ulmStreams; (Services.ObjectRec) (* following components are set after i/o-operations *) count*: Count; (* resulting count of last operation *) - errors*: INTEGER; (* incremented for each error; may be set to 0 *) + errors*: Types.Int32; (* incremented for each error; may be set to 0 *) error*: BOOLEAN; (* last operation successful? *) lasterror*: ErrorCode; (* error code of last error *) eof*: BOOLEAN; (* last read-operation with count=0 returned *) @@ -367,7 +367,7 @@ MODULE ulmStreams; PROCEDURE InitBufPool(s: Stream); VAR - index: INTEGER; + index: Types.Int32; BEGIN s.bufpool.maxbuf := 16; (* default size *) s.bufpool.nbuf := 0; (* currently, no buffers are allocated *) @@ -379,7 +379,7 @@ MODULE ulmStreams; END; END InitBufPool; - PROCEDURE HashValue(pos: Count) : INTEGER; + PROCEDURE HashValue(pos: Count) : Types.Int32; (* HashValue returns a hash value for pos *) BEGIN RETURN SHORT(pos DIV bufsize) MOD hashtabsize @@ -387,7 +387,7 @@ MODULE ulmStreams; PROCEDURE FindBuffer(s: Stream; pos: Count; VAR buf: Buffer) : BOOLEAN; VAR - index: INTEGER; + index: Types.Int32; bp: Buffer; BEGIN index := HashValue(pos); @@ -410,11 +410,11 @@ MODULE ulmStreams; buf: Buffer; pos: Count; (* buffer boundary for s.pos *) posindex: Count; (* buf[posindex] corresponds to s.pos *) - index: INTEGER; (* index into bucket table of the buffer pool *) + index: Types.Int32; (* index into bucket table of the buffer pool *) PROCEDURE InitBuf(buf: Buffer); VAR - index: INTEGER; (* of bucket table *) + index: Types.Int32; (* of bucket table *) BEGIN buf.ok := TRUE; buf.pos := pos; @@ -612,7 +612,7 @@ MODULE ulmStreams; in.tiedStream := out; END Tie; - PROCEDURE SetBufferPoolSize*(s: Stream; nbuf: INTEGER); + PROCEDURE SetBufferPoolSize*(s: Stream; nbuf: Types.Int32); BEGIN s.error := FALSE; IF SYS.TAS(s.lock) THEN @@ -624,7 +624,7 @@ MODULE ulmStreams; s.lock := FALSE; END SetBufferPoolSize; - PROCEDURE GetBufferPoolSize*(s: Stream; VAR nbuf: INTEGER); + PROCEDURE GetBufferPoolSize*(s: Stream; VAR nbuf: Types.Int32); BEGIN s.error := FALSE; CASE s.bufmode OF diff --git a/src/library/ulm/ulmStrings.Mod b/src/library/ulm/ulmStrings.Mod index 19b64395..56785bf9 100644 --- a/src/library/ulm/ulmStrings.Mod +++ b/src/library/ulm/ulmStrings.Mod @@ -64,7 +64,7 @@ MODULE ulmStrings; posOutside* = 3; (* trunc failure: position beyond trunc pos *) errorcodes* = 4; TYPE - ErrorCode* = SHORTINT; + ErrorCode* = Types.Int8; Event* = POINTER TO EventRec; EventRec* = RECORD @@ -91,13 +91,13 @@ MODULE ulmStrings; (* ======= string to stream operations =========================== *) PROCEDURE WritePart*(stream: Streams.Stream; string: ARRAY OF CHAR; - sourceIndex: LONGINT); + sourceIndex: Types.Int32); (* seek to position 0 of `stream' and copy string[sourceIndex..] to it; the file pointer of `stream' is left on position 0 *) VAR - index: LONGINT; + index: Types.Int32; BEGIN IF ~Streams.Seek(stream, 0, Streams.fromStart) OR ~Streams.Trunc(stream, 0) THEN @@ -122,12 +122,12 @@ MODULE ulmStrings; (* ======= stream to string operations =========================== *) - PROCEDURE ReadPart*(VAR string: ARRAY OF CHAR; destIndex: LONGINT; + PROCEDURE ReadPart*(VAR string: ARRAY OF CHAR; destIndex: Types.Int32; stream: Streams.Stream); (* like `Read' but fill string[destIndex..] *) VAR - len: LONGINT; - endIndex: LONGINT; + len: Types.Int32; + endIndex: Types.Int32; BEGIN len := LEN(string); IF Streams.Seek(stream, 0, Streams.fromStart) & (destIndex < len) THEN @@ -160,8 +160,8 @@ MODULE ulmStrings; PROCEDURE Copy*(VAR destination: ARRAY OF CHAR; source: ARRAY OF CHAR); VAR - index: LONGINT; - minlen: LONGINT; + index: Types.Int32; + minlen: Types.Int32; BEGIN minlen := LEN(destination); IF minlen > LEN(source) THEN @@ -180,8 +180,8 @@ MODULE ulmStrings; destination[index] := 0X; END Copy; - PROCEDURE PartCopy*(VAR destination: ARRAY OF CHAR; destIndex: LONGINT; - source: ARRAY OF CHAR; sourceIndex: LONGINT); + PROCEDURE PartCopy*(VAR destination: ARRAY OF CHAR; destIndex: Types.Int32; + source: ARRAY OF CHAR; sourceIndex: Types.Int32); (* copy source[sourceIndex..] to destination[destIndex..] *) BEGIN WHILE (destIndex+1 < LEN(destination)) & @@ -195,10 +195,10 @@ MODULE ulmStrings; END; END PartCopy; - PROCEDURE Len*(string: ARRAY OF CHAR) : LONGINT; + PROCEDURE Len*(string: ARRAY OF CHAR) : Types.Int32; (* returns the number of characters (without terminating 0X) *) VAR - len: LONGINT; + len: Types.Int32; BEGIN len := 0; WHILE (len < LEN(string)) & (string[len] # 0X) DO @@ -316,7 +316,7 @@ MODULE ulmStrings; PROCEDURE Flush(s: Streams.Stream) : BOOLEAN; VAR - len: LONGINT; + len: Types.Int32; ch: CHAR; BEGIN WITH s: Stream DO diff --git a/src/library/ulm/ulmSysConversions.Mod b/src/library/ulm/ulmSysConversions.Mod index 4da16095..babdab5d 100644 --- a/src/library/ulm/ulmSysConversions.Mod +++ b/src/library/ulm/ulmSysConversions.Mod @@ -38,7 +38,7 @@ MODULE ulmSysConversions; (* convert Oberon records to/from C structures *) IMPORT Events := ulmEvents, Objects := ulmObjects, Priorities := ulmPriorities, Streams := ulmStreams, Strings := ulmStrings, - SYS := SYSTEM, SysTypes := ulmSysTypes, Texts := ulmTexts; + SYS := SYSTEM, SysTypes := ulmSysTypes, Texts := ulmTexts, Types := ulmTypes; TYPE Address* = SysTypes.Address; @@ -66,10 +66,10 @@ MODULE ulmSysConversions; b: SYS.BYTE B: BOOLEAN c: CHAR - s: SHORTINT - i: INTEGER - l: LONGINT - S: SET + s: Types.Int8 + i: Types.Int32 + l: Types.Int32 + S: Types.Set C data types: @@ -90,10 +90,10 @@ MODULE ulmSysConversions; Rec = RECORD - a, b: INTEGER; + a, b: Types.Int32; c: CHAR; - s: SET; - f: ARRAY 3 OF INTEGER; + s: Types.Set; + f: ARRAY 3 OF Types.Int32; END; to @@ -118,7 +118,7 @@ MODULE ulmSysConversions; unsigned = 0; (* suppress sign extension *) boolean = 1; (* convert anything # 0 to 1 *) TYPE - Flags = SET; + Flags = Types.Set; Event* = POINTER TO EventRec; EventRec* = RECORD @@ -134,9 +134,9 @@ MODULE ulmSysConversions; (* 1: Oberon type 2: C type *) - type1, type2: CHAR; length: INTEGER; left: INTEGER; + type1, type2: CHAR; length: Types.Int32; left: Types.Int32; offset1, offset2: Address; - size1, size2: Address; elementsleft: INTEGER; flags: Flags; + size1, size2: Address; elementsleft: Types.Int32; flags: Flags; END; Format* = POINTER TO FormatRec; @@ -192,7 +192,7 @@ MODULE ulmSysConversions; RETURN (ch >= "0") & (ch <= "9") END IsDigit; - PROCEDURE ReadInt(cv: ConvStream; VAR i: INTEGER); + PROCEDURE ReadInt(cv: ConvStream; VAR i: Types.Int32); BEGIN i := 0; REPEAT @@ -219,10 +219,10 @@ MODULE ulmSysConversions; PROCEDURE ScanConv(cv: ConvStream; VAR type1, type2: CHAR; - VAR length: INTEGER) : BOOLEAN; + VAR length: Types.Int32) : BOOLEAN; VAR - i: INTEGER; - factor: INTEGER; + i: Types.Int32; + factor: Types.Int32; BEGIN IF cv.left > 0 THEN type1 := cv.type1; @@ -274,8 +274,8 @@ MODULE ulmSysConversions; PROCEDURE Align(VAR offset: Address; boundary: Address); BEGIN - IF SYS.VAL (INTEGER, offset) MOD SYS.VAL (INTEGER, boundary) # 0 THEN - offset := SYS.VAL (INTEGER, offset) + (SYS.VAL (INTEGER, boundary) - SYS.VAL (INTEGER, offset) MOD SYS.VAL (INTEGER, boundary)); + IF SYS.VAL (Types.Int32, offset) MOD SYS.VAL (Types.Int32, boundary) # 0 THEN + offset := SYS.VAL (Types.Int32, offset) + (SYS.VAL (Types.Int32, boundary) - SYS.VAL (Types.Int32, offset) MOD SYS.VAL (Types.Int32, boundary)); END; END Align; @@ -285,28 +285,28 @@ MODULE ulmSysConversions; VAR flags: Flags) : BOOLEAN; VAR type1, type2: CHAR; - length: INTEGER; + length: Types.Int32; align: BOOLEAN; - boundary: INTEGER; + boundary: Types.Int32; BEGIN IF cv.elementsleft > 0 THEN DEC(cv.elementsleft); (* Oberon type *) IF size1 > SIZE(SYS.BYTE) THEN - Align(cv.offset1, SIZE(INTEGER)); + Align(cv.offset1, SIZE(Types.Int32)); END; - offset1 := cv.offset1; cv.offset1 := SYS.VAL (INTEGER, cv.offset1) + size1; + offset1 := cv.offset1; cv.offset1 := SYS.VAL (Types.Int32, cv.offset1) + size1; size1 := cv.size1; size2 := cv.size2; flags := cv.flags; IF (size1 > 0) & (cv.elementsleft = 0) THEN - Align(cv.offset1, SIZE(INTEGER)); + Align(cv.offset1, SIZE(Types.Int32)); END; (* C type *) IF size2 > 1 THEN Align(cv.offset2, 2); END; - offset2 := cv.offset2; cv.offset2 := SYS.VAL (INTEGER, cv.offset2) + SYS.VAL (INTEGER, size2); + offset2 := cv.offset2; cv.offset2 := SYS.VAL (Types.Int32, cv.offset2) + SYS.VAL (Types.Int32, size2); RETURN TRUE END; @@ -318,21 +318,21 @@ MODULE ulmSysConversions; | "b": size1 := SIZE(SYS.BYTE); INCL(flags, unsigned); | "B": size1 := SIZE(BOOLEAN); INCL(flags, boolean); | "c": size1 := SIZE(CHAR); INCL(flags, unsigned); - | "s": size1 := SIZE(SHORTINT); - | "i": size1 := SIZE(INTEGER); - | "l": size1 := SIZE(LONGINT); - | "S": size1 := SIZE(SET); INCL(flags, unsigned); + | "s": size1 := SIZE(Types.Int8); + | "i": size1 := SIZE(Types.Int32); + | "l": size1 := SIZE(Types.Int32); + | "S": size1 := SIZE(Types.Set); INCL(flags, unsigned); | "-": size1 := 0; ELSE Error(cv, "bad Oberon type specifier"); RETURN FALSE END; IF size1 > 0 THEN IF length > 0 THEN - Align(cv.offset1, SIZE(INTEGER)); + Align(cv.offset1, SIZE(Types.Int32)); ELSIF size1 > SIZE(SYS.BYTE) THEN - Align(cv.offset1, SIZE(INTEGER)); + Align(cv.offset1, SIZE(Types.Int32)); END; END; - offset1 := cv.offset1; cv.offset1 := SYS.VAL (INTEGER, cv.offset1) + size1; + offset1 := cv.offset1; cv.offset1 := SYS.VAL (Types.Int32, cv.offset1) + size1; (* C type *) CASE type2 OF @@ -352,7 +352,7 @@ MODULE ulmSysConversions; IF size2 > 1 THEN Align(cv.offset2, size2); END; - offset2 := cv.offset2; cv.offset2 := SYS.VAL (INTEGER, cv.offset2) + SYS.VAL (INTEGER, size2); + offset2 := cv.offset2; cv.offset2 := SYS.VAL (Types.Int32, cv.offset2) + SYS.VAL (Types.Int32, size2); cv.size1 := size1; cv.size2 := size2; IF length > 0 THEN @@ -371,7 +371,7 @@ MODULE ulmSysConversions; Pointer = POINTER TO Bytes; VAR dest, source: Pointer; - dindex, sindex: INTEGER; + dindex, sindex: Types.Int32; nonzero: BOOLEAN; fill : CHAR; BEGIN @@ -383,7 +383,7 @@ MODULE ulmSysConversions; nonzero := FALSE; WHILE ssize > 0 DO nonzero := nonzero OR (source[sindex] # 0X); - INC(sindex); ssize := SYS.VAL (INTEGER, ssize) - 1; + INC(sindex); ssize := SYS.VAL (Types.Int32, ssize) - 1; END; IF dsize > 0 THEN IF nonzero THEN @@ -395,12 +395,12 @@ MODULE ulmSysConversions; END; WHILE dsize > 0 DO dest[dindex] := 0X; - dsize := SYS.VAL (INTEGER, dsize) - 1; INC(dindex); + dsize := SYS.VAL (Types.Int32, dsize) - 1; INC(dindex); END; ELSE WHILE (dsize > 0) & (ssize > 0) DO dest[dindex] := source[sindex]; - ssize := SYS.VAL (INTEGER, ssize) - 1; + ssize := SYS.VAL (Types.Int32, ssize) - 1; dsize := dsize - 1; INC(dindex); INC(sindex); END; @@ -415,7 +415,7 @@ MODULE ulmSysConversions; END; WHILE dsize > 0 DO dest[dindex] := fill; - dsize := SYS.VAL (INTEGER, dsize) - 1; INC(dindex); + dsize := SYS.VAL (Types.Int32, dsize) - 1; INC(dindex); END; END; END; @@ -475,7 +475,7 @@ MODULE ulmSysConversions; WHILE ReadConv(cv, offset1, offset2, size1, size2, flags) DO END; Close(cv); size := offset1 + size1; - Align(size, SIZE(INTEGER)); + Align(size, SIZE(Types.Int32)); RETURN size END OberonSize; diff --git a/src/library/ulm/ulmSysErrors.Mod b/src/library/ulm/ulmSysErrors.Mod index 0e81818d..ce535744 100644 --- a/src/library/ulm/ulmSysErrors.Mod +++ b/src/library/ulm/ulmSysErrors.Mod @@ -1,6 +1,6 @@ MODULE ulmSysErrors; - IMPORT Errors := ulmErrors, Events := ulmEvents, Priorities := ulmPriorities, RelatedEvents := ulmRelatedEvents, Streams := ulmStreams, Strings := ulmStrings, Sys := ulmSys; + IMPORT Errors := ulmErrors, Events := ulmEvents, Priorities := ulmPriorities, RelatedEvents := ulmRelatedEvents, Streams := ulmStreams, Strings := ulmStrings, Sys := ulmSys, Types := ulmTypes; CONST perm* = 1; @@ -138,8 +138,8 @@ MODULE ulmSysErrors; EventRec* = RECORD (Events.EventRec) - errno*: (*INTEGER*)LONGINT; - syscall*: (*INTEGER*)LONGINT; (* number of system call *) + errno*: (*Types.Int32*)Types.Int32; + syscall*: (*Types.Int32*)Types.Int32; (* number of system call *) text*: ARRAY textlen OF CHAR; END; @@ -150,7 +150,7 @@ MODULE ulmSysErrors; syserror*: ARRAY ncodes OF Events.EventType; PROCEDURE Raise*(errors: RelatedEvents.Object; - errno, syscall: (*INTEGER*)LONGINT; text: ARRAY OF CHAR); (* in ulm's system INTEGER and LONGINT have the same size *) + errno, syscall: (*Types.Int32*)Types.Int32; text: ARRAY OF CHAR); (* in ulm's system Types.Int32 and Types.Int32 have the same size *) (* raises the events syserrors and syserrors[syscall]; `text' contains additional information (e.g. filenames); further, the syserrors[syscall] event is passed to @@ -192,9 +192,9 @@ MODULE ulmSysErrors; IF ~Streams.WriteByte(s, ch) THEN END; END Write; - PROCEDURE WriteInt(intval: LONGINT); + PROCEDURE WriteInt(intval: Types.Int32); VAR - rest: LONGINT; + rest: Types.Int32; BEGIN rest := intval DIV 10; IF rest > 0 THEN @@ -231,7 +231,7 @@ MODULE ulmSysErrors; PROCEDURE InitEvents; VAR - errno: INTEGER; + errno: Types.Int32; BEGIN syserror[0] := NIL; errno := 1; @@ -447,11 +447,11 @@ BEGIN message[netdown] := "Network is down"; name[netunreach] := "ENETUNREACH"; message[netunreach] := "Network is unreachable"; - name[netreset] := "ENETRESET"; + name[netreset] := "ENETRETypes.Set"; message[netreset] := "Network dropped connection because of reset"; name[connaborted] := "ECONNABORTED"; message[connaborted] := "Software caused connection abort"; - name[connreset] := "ECONNRESET"; + name[connreset] := "ECONNRETypes.Set"; message[connreset] := "Connection reset by peer"; name[nobufs] := "ENOBUFS"; message[nobufs] := "No buffer space available"; diff --git a/src/library/ulm/ulmSysIO.Mod b/src/library/ulm/ulmSysIO.Mod index 2a22d29f..3274efda 100644 --- a/src/library/ulm/ulmSysIO.Mod +++ b/src/library/ulm/ulmSysIO.Mod @@ -33,7 +33,7 @@ MODULE ulmSysIO; IMPORT RelatedEvents := ulmRelatedEvents, Sys := ulmSys, SYS := SYSTEM, ulmSYSTEM, SysErrors := ulmSysErrors, SysTypes := ulmSysTypes, - Platform; + Platform, Types := ulmTypes; CONST (* file control options: arguments of Fcntl and Open *) @@ -79,11 +79,11 @@ MODULE ulmSysIO; File* = SysTypes.File; (* file descriptor *) Address* = SysTypes.Address; Count* = SysTypes.Count; - Protection* = LONGINT; - Whence* = LONGINT; + Protection* = Types.Int32; + Whence* = Types.Int32; PROCEDURE OpenCreat*(VAR fd: File; - filename: ARRAY OF CHAR; options: SET; + filename: ARRAY OF CHAR; options: Types.Set; protection: Protection; errors: RelatedEvents.Object; retry: BOOLEAN; VAR interrupted: BOOLEAN) : BOOLEAN; @@ -110,7 +110,7 @@ MODULE ulmSysIO; END OpenCreat; PROCEDURE Open*(VAR fd: File; - filename: ARRAY OF CHAR; options: SET; + filename: ARRAY OF CHAR; options: Types.Set; errors: RelatedEvents.Object; retry: BOOLEAN; VAR interrupted: BOOLEAN) : BOOLEAN; (* the filename must be 0X-terminated *) @@ -196,7 +196,7 @@ MODULE ulmSysIO; PROCEDURE Seek*(fd: File; offset: Count; whence: Whence; errors: RelatedEvents.Object) : BOOLEAN; VAR - error: Platform.ErrorCode; relativity: INTEGER; + error: Platform.ErrorCode; relativity: Types.Int16; BEGIN CASE whence OF |fromPos: relativity := Platform.SeekCur @@ -216,7 +216,7 @@ MODULE ulmSysIO; PROCEDURE Tell*(fd: File; VAR offset: Count; errors: RelatedEvents.Object) : BOOLEAN; VAR - d0, d1: LONGINT; + d0, d1: Types.Int32; BEGIN IF ulmSYSTEM.UNIXCALL(Sys.lseek, d0, d1, fd, 0, fromPos) THEN offset := d0; @@ -232,17 +232,17 @@ MODULE ulmSysIO; sizeofStructTermIO = 18; tcgeta = 00005405H; VAR - d0, d1: LONGINT; + d0, d1: Types.Int32; buf: ARRAY 32 OF SYS.BYTE; (* Should be more than sufficient *) BEGIN (* following system call fails for non-tty's *) RETURN ulmSYSTEM.UNIXCALL(Sys.ioctl, d0, d1, fd, tcgeta, SYS.ADR(buf)) END Isatty; - PROCEDURE Fcntl*(fd: File; request: INTEGER; VAR arg: LONGINT; + PROCEDURE Fcntl*(fd: File; request: Types.Int32; VAR arg: Types.Int32; errors: RelatedEvents.Object; retry: BOOLEAN; VAR interrupted: BOOLEAN) : BOOLEAN; VAR - d0, d1: LONGINT; + d0, d1: Types.Int32; BEGIN interrupted := FALSE; LOOP @@ -261,15 +261,15 @@ MODULE ulmSysIO; END; END Fcntl; - PROCEDURE FcntlSet*(fd: File; request: INTEGER; flags: SET; + PROCEDURE FcntlSet*(fd: File; request: Types.Int32; flags: Types.Set; errors: RelatedEvents.Object; retry: BOOLEAN; VAR interrupted: BOOLEAN) : BOOLEAN; VAR - d0, d1: LONGINT; + d0, d1: Types.Int32; BEGIN interrupted := FALSE; LOOP - IF ulmSYSTEM.UNIXCALL(Sys.fcntl, d0, d1, fd, request, SYS.VAL(LONGINT, flags)) THEN + IF ulmSYSTEM.UNIXCALL(Sys.fcntl, d0, d1, fd, request, SYS.VAL(Types.Int32, flags)) THEN RETURN TRUE ELSE IF d0 = SysErrors.intr THEN @@ -283,10 +283,10 @@ MODULE ulmSysIO; END; END FcntlSet; - PROCEDURE FcntlGet*(fd: File; request: INTEGER; VAR flags: SET; + PROCEDURE FcntlGet*(fd: File; request: Types.Int32; VAR flags: Types.Set; errors: RelatedEvents.Object) : BOOLEAN; VAR - d0, d1: LONGINT; + d0, d1: Types.Int32; BEGIN IF ulmSYSTEM.UNIXCALL(Sys.fcntl, d0, d1, fd, request, 0) THEN ulmSYSTEM.WMOVE(SYS.ADR(d0), SYS.ADR(flags), 1); @@ -300,8 +300,8 @@ MODULE ulmSysIO; PROCEDURE Dup*(fd: File; VAR newfd: File; errors: RelatedEvents.Object) : BOOLEAN; VAR - d0, d1: LONGINT; - a0, a1: LONGINT; + d0, d1: Types.Int32; + a0, a1: Types.Int32; BEGIN a0 := 0; a1 := 0; (* Initialised to disable compiler warning. *) IF ulmSYSTEM.UNIXCALL(Sys.dup, d0, d1, fd, a0, a1) THEN @@ -315,8 +315,8 @@ MODULE ulmSysIO; PROCEDURE Dup2*(fd, newfd: File; errors: RelatedEvents.Object) : BOOLEAN; VAR - d0, d1: LONGINT; - a0, a1: LONGINT; + d0, d1: Types.Int32; + a0, a1: Types.Int32; fd2: File; interrupted: BOOLEAN; BEGIN @@ -338,9 +338,9 @@ MODULE ulmSysIO; PROCEDURE Pipe*(VAR readfd, writefd: File; errors: RelatedEvents.Object) : BOOLEAN; VAR - d0, d1: LONGINT; - a0, a1: LONGINT; - fds : ARRAY 2 OF (*File*)INTEGER; (* it needs int pipefd[2], and int is 4 bytes long on x86_64 -- noch *) + d0, d1: Types.Int32; + a0, a1: Types.Int32; + fds : ARRAY 2 OF (*File*)Types.Int32; (* it needs int pipefd[2], and int is 4 bytes long on x86_64 -- noch *) BEGIN a0 := 0; a1 := 0; (* Initialised to disable compiler warning. *) IF ulmSYSTEM.UNIXCALL(Sys.pipe, d0, d1, SYS.ADR (fds), a0, a1) THEN diff --git a/src/library/ulm/ulmSysStat.Mod b/src/library/ulm/ulmSysStat.Mod index f9aaa507..addb33f2 100644 --- a/src/library/ulm/ulmSysStat.Mod +++ b/src/library/ulm/ulmSysStat.Mod @@ -40,7 +40,7 @@ MODULE ulmSysStat; (* examine inode: stat(2) and fstat(2) *) IMPORT RelatedEvents := ulmRelatedEvents, Sys := ulmSys, SYS := SYSTEM, uSYS := ulmSYSTEM, SysConversions := ulmSysConversions, SysErrors := ulmSysErrors, - SysTypes := ulmSysTypes; + SysTypes := ulmSysTypes, Types := ulmTypes; CONST (* file mode: @@ -96,17 +96,17 @@ MODULE ulmSysStat; device*: SysTypes.Device; (* ID of device containing a directory entry for this file *) inode*: SysTypes.Inode; (* inode number *) - mode*: SET; (* file mode; see mknod(2) *) - nlinks*: LONGINT; (* number of links *) - uid*: LONGINT; (* user id of the file's owner *) - gid*: LONGINT; (* group id of the file's group *) + mode*: Types.Set; (* file mode; see mknod(2) *) + nlinks*: Types.Int32; (* number of links *) + uid*: Types.Int32; (* user id of the file's owner *) + gid*: Types.Int32; (* group id of the file's group *) rdev*: SysTypes.Device; (* ID of device. this entry is defined only for character special or block special files *) size*: SysTypes.Offset; (* file size in bytes *) (* Blocks and blksize are not available on all platforms. - blksize*: LONGINT; (* preferred blocksize *) - blocks*: LONGINT; (* # of blocks allocated *) + blksize*: Types.Int32; (* preferred blocksize *) + blocks*: Types.Int32; (* # of blocks allocated *) *) atime*: SysTypes.Time; (* time of last access *) @@ -119,27 +119,27 @@ MODULE ulmSysStat; PROCEDURE -Aerrno '#include '; PROCEDURE -structstats "struct stat s"; - PROCEDURE -statdev(): LONGINT "(LONGINT)s.st_dev"; - PROCEDURE -statino(): LONGINT "(LONGINT)s.st_ino"; - PROCEDURE -statmode(): LONGINT "(LONGINT)s.st_mode"; - PROCEDURE -statnlink(): LONGINT "(LONGINT)s.st_nlink"; - PROCEDURE -statuid(): LONGINT "(LONGINT)s.st_uid"; - PROCEDURE -statgid(): LONGINT "(LONGINT)s.st_gid"; - PROCEDURE -statrdev(): LONGINT "(LONGINT)s.st_rdev"; - PROCEDURE -statsize(): LONGINT "(LONGINT)s.st_size"; - PROCEDURE -statatime(): LONGINT "(LONGINT)s.st_atime"; - PROCEDURE -statmtime(): LONGINT "(LONGINT)s.st_mtime"; - PROCEDURE -statctime(): LONGINT "(LONGINT)s.st_ctime"; + PROCEDURE -statdev(): Types.Int32 "(INT32)s.st_dev"; + PROCEDURE -statino(): Types.Int32 "(INT32)s.st_ino"; + PROCEDURE -statmode(): Types.Int32 "(INT32)s.st_mode"; + PROCEDURE -statnlink(): Types.Int32 "(INT32)s.st_nlink"; + PROCEDURE -statuid(): Types.Int32 "(INT32)s.st_uid"; + PROCEDURE -statgid(): Types.Int32 "(INT32)s.st_gid"; + PROCEDURE -statrdev(): Types.Int32 "(INT32)s.st_rdev"; + PROCEDURE -statsize(): Types.Int32 "(INT32)s.st_size"; + PROCEDURE -statatime(): Types.Int32 "(INT32)s.st_atime"; + PROCEDURE -statmtime(): Types.Int32 "(INT32)s.st_mtime"; + PROCEDURE -statctime(): Types.Int32 "(INT32)s.st_ctime"; (* Blocks and blksize are not available on all platforms. - PROCEDURE -statblksize(): LONGINT "(LONGINT)s.st_blksize"; - PROCEDURE -statblocks(): LONGINT "(LONGINT)s.st_blocks"; + PROCEDURE -statblksize(): Types.Int32 "(Types.Int32)s.st_blksize"; + PROCEDURE -statblocks(): Types.Int32 "(Types.Int32)s.st_blocks"; *) - PROCEDURE -fstat(fd: LONGINT): INTEGER "fstat(fd, &s)"; - PROCEDURE -stat (n: ARRAY OF CHAR): INTEGER "stat((char*)n, &s)"; + PROCEDURE -fstat(fd: Types.Int32): Types.Int32 "fstat(fd, &s)"; + PROCEDURE -stat (n: ARRAY OF CHAR): Types.Int32 "stat((char*)n, &s)"; - PROCEDURE -err(): INTEGER "errno"; + PROCEDURE -err(): Types.Int32 "errno"; PROCEDURE Stat*(path: ARRAY OF CHAR; VAR buf: StatRec; errors: RelatedEvents.Object): BOOLEAN; BEGIN @@ -147,7 +147,7 @@ MODULE ulmSysStat; IF stat(path) < 0 THEN SysErrors.Raise(errors, err(), Sys.newstat, path); RETURN FALSE END; buf.device := SYS.VAL(SysTypes.Device, statdev()); buf.inode := SYS.VAL(SysTypes.Inode, statino()); - buf.mode := SYS.VAL(SET, statmode()); + buf.mode := SYS.VAL(Types.Set, statmode()); buf.nlinks := statnlink(); buf.uid := statuid(); buf.gid := statgid(); @@ -166,10 +166,10 @@ MODULE ulmSysStat; PROCEDURE Fstat*(fd: SysTypes.File; VAR buf: StatRec; errors: RelatedEvents.Object): BOOLEAN; BEGIN structstats; - IF fstat(SYS.VAL(LONGINT, fd)) < 0 THEN SysErrors.Raise(errors, err(), Sys.newfstat, ""); RETURN FALSE END; + IF fstat(SYS.VAL(Types.Int32, fd)) < 0 THEN SysErrors.Raise(errors, err(), Sys.newfstat, ""); RETURN FALSE END; buf.device := SYS.VAL(SysTypes.Device, statdev()); buf.inode := SYS.VAL(SysTypes.Inode, statino()); - buf.mode := SYS.VAL(SET, statmode()); + buf.mode := SYS.VAL(Types.Set, statmode()); buf.nlinks := statnlink(); buf.uid := statuid(); buf.gid := statgid(); diff --git a/src/library/ulm/ulmSysTypes.Mod b/src/library/ulm/ulmSysTypes.Mod index 6d16ab4b..c757a5dc 100644 --- a/src/library/ulm/ulmSysTypes.Mod +++ b/src/library/ulm/ulmSysTypes.Mod @@ -40,12 +40,12 @@ MODULE ulmSysTypes; Byte* = Types.Byte; File* = Platform.FileHandle; - Offset* = LONGINT; - Device* = LONGINT; - Inode* = LONGINT; - Time* = LONGINT; + Offset* = Types.Int32; + Device* = Types.Int32; + Inode* = Types.Int32; + Time* = Types.Int32; - Word* = INTEGER; (* must have the size of C's int-type *) + Word* = Types.Int32; (* must have the size of C's int-type *) (* Note: linux supports wait4 but not waitid, i.e. these * constants aren't needed. *) @@ -64,7 +64,7 @@ MODULE ulmSysTypes; idAll = 7; (* all processes *) idLwpid = 8; (* an LWP identifier *) TYPE - IdType = INTEGER; (* idPid .. idLwpid *) + IdType = Types.Int32; (* idPid .. idLwpid *) *) END ulmSysTypes. diff --git a/src/library/ulm/ulmTCrypt.Mod b/src/library/ulm/ulmTCrypt.Mod index c35c7809..f31decda 100644 --- a/src/library/ulm/ulmTCrypt.Mod +++ b/src/library/ulm/ulmTCrypt.Mod @@ -36,7 +36,8 @@ MODULE ulmTCrypt; (* Michael Szczuka *) Events := ulmEvents, NetIO := ulmNetIO, PersistentObjects := ulmPersistentObjects, Random := ulmRandomGenerators, RelatedEvents := ulmRelatedEvents, Services := ulmServices, - Streams := ulmStreams, SYS := SYSTEM; + Streams := ulmStreams, SYS := SYSTEM, + Types := ulmTypes; CONST M = 16; (* size of an element of CC(M) [ring of Circular Convolution] *) @@ -59,8 +60,8 @@ MODULE ulmTCrypt; (* Michael Szczuka *) TYPE (* an element out of CC(M) *) - CCMElement = SET; - Exponent = ARRAY MaxVar OF SHORTINT; + CCMElement = Types.Set; + Exponent = ARRAY MaxVar OF Types.Int8; TYPE (* a polynomial with coefficients out of CC(M) *) @@ -161,7 +162,7 @@ MODULE ulmTCrypt; (* Michael Szczuka *) ErrorEvent = POINTER TO ErrorEventRec; ErrorEventRec = RECORD (Events.EventRec) - errorcode : SHORTINT; + errorcode : Types.Int8; END; VAR @@ -176,7 +177,7 @@ MODULE ulmTCrypt; (* Michael Szczuka *) PolFeld : ARRAY MaxTerms OF Polynom; (* used for sorting purposes *) PreEvalArg : ARRAY M OF TCryptInput; (* precomputed values to speed up evaluation of a polynomial *) - k : SHORTINT; (* simple counter during initialisation *) + k : Types.Int8; (* simple counter during initialisation *) error : Events.EventType; errormsg : ARRAY errorcodes OF Events.Message; @@ -191,7 +192,7 @@ MODULE ulmTCrypt; (* Michael Szczuka *) errormsg[notRegular] := "element isn't regular"; END InitErrorHandling; - PROCEDURE Error(s: Streams.Stream; errorcode: SHORTINT); + PROCEDURE Error(s: Streams.Stream; errorcode: Types.Int8); VAR event: ErrorEvent; BEGIN @@ -208,7 +209,7 @@ MODULE ulmTCrypt; (* Michael Szczuka *) (* tests x for regularity [a regular CCMElement contains an odd number of set bits]; returns TRUE when x is regular, FALSE otherwise *) VAR - res, i : SHORTINT; + res, i : Types.Int8; BEGIN i := 0; res := 0; @@ -225,7 +226,7 @@ MODULE ulmTCrypt; (* Michael Szczuka *) (* compares x and y for equality; if x and y are equal TRUE is returned, FALSE otherwise *) VAR - i : SHORTINT; + i : Types.Int8; BEGIN i := 0; WHILE i < M DO @@ -240,7 +241,7 @@ MODULE ulmTCrypt; (* Michael Szczuka *) PROCEDURE AddCCM (x, y: CCMElement; VAR z: CCMElement); (* add x and y in CC(M) *) VAR - i : SHORTINT; + i : Types.Int8; BEGIN z := NullCCM; i := 0; @@ -255,8 +256,8 @@ MODULE ulmTCrypt; (* Michael Szczuka *) PROCEDURE MulCCM (x, y: CCMElement; VAR z: CCMElement); (* multiply x and y in CC(M) *) VAR - i, j, diff : SHORTINT; - tmp : INTEGER; + i, j, diff : Types.Int8; + tmp : Types.Int32; BEGIN z := NullCCM; i := 0; @@ -283,7 +284,7 @@ MODULE ulmTCrypt; (* Michael Szczuka *) UNTIL i>=M; END MulCCM; - PROCEDURE PowerCCM (x: CCMElement; exp: INTEGER; VAR z: CCMElement); + PROCEDURE PowerCCM (x: CCMElement; exp: Types.Int32; VAR z: CCMElement); (* raises x to the power exp in CC(M) *) VAR tmp : CCMElement; @@ -320,12 +321,12 @@ MODULE ulmTCrypt; (* Michael Szczuka *) UNTIL exp < 1; END PowerCCM; - PROCEDURE CreateCCM (VAR x: CCMElement; mode: SHORTINT); + PROCEDURE CreateCCM (VAR x: CCMElement; mode: Types.Int8); (* creates a random element out of CC(M) depending on mode which can be reg, sing or random; the result is in any case different from the zero *) VAR - i, SetBits: SHORTINT; + i, SetBits: Types.Int8; BEGIN x := NullCCM; REPEAT @@ -361,10 +362,10 @@ MODULE ulmTCrypt; (* Michael Szczuka *) (* ***** arithmetic functions for polynomials over CC(M) ***** *) - PROCEDURE LengthPolynom(p: Polynom) : INTEGER; + PROCEDURE LengthPolynom(p: Polynom) : Types.Int32; (* returns the number of terms which make up the polynomial p *) VAR - i : INTEGER; + i : Types.Int32; BEGIN i := 0; WHILE p # NIL DO @@ -378,7 +379,7 @@ MODULE ulmTCrypt; (* Michael Szczuka *) (* tests the regularity of a polynomial [a polynomial is regular iff the # of regular coefficients is odd] *) VAR - regkoeffs : SHORTINT; + regkoeffs : Types.Int8; BEGIN regkoeffs := 0; WHILE p # NIL DO @@ -391,16 +392,16 @@ MODULE ulmTCrypt; (* Michael Szczuka *) RETURN (regkoeffs MOD 2) = 1; END RegulaerPolynom; - PROCEDURE CmpExp (exp1, exp2: Exponent) : SHORTINT; + PROCEDURE CmpExp (exp1, exp2: Exponent) : Types.Int8; (* compares two exponent vectors and returns 0 on equality, a positive value if exp1>exp2 and a negative value if exp1 0) & Streams.WriteByte(s, " ") DO @@ -180,12 +180,12 @@ MODULE ulmWrite; (* procedures writing to Streams.stdout *) - PROCEDURE Int*(int: LONGINT; width: LONGINT); + PROCEDURE Int*(int: Types.Int32; width: Types.Int32); BEGIN IntS(Streams.stdout, int, width); END Int; - PROCEDURE Real*(real: LONGREAL; width: LONGINT); + PROCEDURE Real*(real: Types.Real64; width: Types.Int32); (* write real in exponential format *) BEGIN RealS(Streams.stdout, real, width); diff --git a/src/tools/make/oberon.mk b/src/tools/make/oberon.mk index 796cb8d5..c852bd57 100644 --- a/src/tools/make/oberon.mk +++ b/src/tools/make/oberon.mk @@ -273,6 +273,7 @@ oocX11: ulm: @printf "\nMaking ulm library for -O$(MODEL)\n" + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmTypes.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmObjects.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmPriorities.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmDisciplines.Mod @@ -284,7 +285,6 @@ ulm: cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmResources.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmForwarders.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmRelatedEvents.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmTypes.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmStreams.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmStrings.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmSysTypes.Mod From 67e4848eb7659be1d1169528dd7727f115497663 Mon Sep 17 00:00:00 2001 From: David Brown Date: Wed, 30 Nov 2016 15:49:27 +0000 Subject: [PATCH 356/580] PlatformWindows file sharing mode parity with PlatfromUnix. Allow GC to collect unused files. --- bootstrap/unix-44/Compiler.c | 2 +- bootstrap/unix-44/Configuration.c | 4 ++-- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Files.c | 21 +++++++++--------- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 2 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 2 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 2 +- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 2 +- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 2 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Out.c | 2 +- bootstrap/unix-44/Out.h | 2 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/VT100.c | 2 +- bootstrap/unix-44/VT100.h | 2 +- bootstrap/unix-44/extTools.c | 2 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-48/Compiler.c | 2 +- bootstrap/unix-48/Configuration.c | 4 ++-- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Files.c | 21 +++++++++--------- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 2 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 2 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 2 +- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 2 +- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 2 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Out.c | 2 +- bootstrap/unix-48/Out.h | 2 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/VT100.c | 2 +- bootstrap/unix-48/VT100.h | 2 +- bootstrap/unix-48/extTools.c | 2 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-88/Compiler.c | 2 +- bootstrap/unix-88/Configuration.c | 4 ++-- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Files.c | 21 +++++++++--------- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 2 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 2 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 2 +- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 2 +- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 2 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Out.c | 2 +- bootstrap/unix-88/Out.h | 2 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/VT100.c | 2 +- bootstrap/unix-88/VT100.h | 2 +- bootstrap/unix-88/extTools.c | 2 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/windows-48/Compiler.c | 2 +- bootstrap/windows-48/Configuration.c | 4 ++-- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Files.c | 21 +++++++++--------- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 2 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 2 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 2 +- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 2 +- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 2 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Out.c | 2 +- bootstrap/windows-48/Out.h | 2 +- bootstrap/windows-48/Platform.c | 8 +++---- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/VT100.c | 2 +- bootstrap/windows-48/VT100.h | 2 +- bootstrap/windows-48/extTools.c | 2 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-88/Compiler.c | 2 +- bootstrap/windows-88/Configuration.c | 4 ++-- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Files.c | 21 +++++++++--------- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 2 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 2 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 2 +- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 2 +- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 2 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Out.c | 2 +- bootstrap/windows-88/Out.h | 2 +- bootstrap/windows-88/Platform.c | 8 +++---- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/VT100.c | 2 +- bootstrap/windows-88/VT100.h | 2 +- bootstrap/windows-88/extTools.c | 2 +- bootstrap/windows-88/extTools.h | 2 +- doc/Features.md | 33 +++++++++++++++++++++++++++- src/runtime/Files.Mod | 4 ++-- src/runtime/Platformwindows.Mod | 6 ++--- 188 files changed, 278 insertions(+), 252 deletions(-) diff --git a/bootstrap/unix-44/Compiler.c b/bootstrap/unix-44/Compiler.c index 19053dd2..29524a91 100644 --- a/bootstrap/unix-44/Compiler.c +++ b/bootstrap/unix-44/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index d0de3d5d..54214f70 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index 2cc1873a..1e6381e9 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 3a6ec440..3b5fd2eb 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -36,7 +36,7 @@ typedef INT32 fd, len, pos; Files_Buffer bufs[4]; INT16 swapper, state; - Files_File next; + struct Files_FileDesc *next; } Files_FileDesc; typedef @@ -48,7 +48,7 @@ typedef } Files_Rider; -static Files_File Files_files; +static Files_FileDesc *Files_files; static INT16 Files_tempno; static CHAR Files_HOME[1024]; static struct { @@ -380,7 +380,7 @@ static Files_File Files_CacheEntry (Platform_FileIdentity identity) { Files_File f = NIL; INT16 i, error; - f = Files_files; + f = (Files_File)Files_files; while (f != NIL) { if (Platform_SameFile(identity, f->identity)) { if (!Platform_SameFileTime(identity, f->identity)) { @@ -398,7 +398,7 @@ static Files_File Files_CacheEntry (Platform_FileIdentity identity) } return f; } - f = f->next; + f = (Files_File)f->next; } return NIL; } @@ -987,12 +987,12 @@ static void Files_CloseOSFile (Files_File f) { Files_File prev = NIL; INT16 error; - if (Files_files == f) { + if (Files_files == (void *) f) { Files_files = f->next; } else { - prev = Files_files; - while ((prev != NIL && prev->next != f)) { - prev = prev->next; + prev = (Files_File)Files_files; + while ((prev != NIL && prev->next != (void *) f)) { + prev = (Files_File)prev->next; } if (prev->next != NIL) { prev->next = f->next; @@ -1031,11 +1031,10 @@ void Files_SetSearchPath (CHAR *path, ADDRESS path__len) static void EnumPtrs(void (*P)(void*)) { - P(Files_files); P(Files_SearchPath); } -__TDESC(Files_FileDesc, 1, 5) = {__TDFLDS("FileDesc", 252), {228, 232, 236, 240, 248, -24}}; +__TDESC(Files_FileDesc, 1, 4) = {__TDFLDS("FileDesc", 252), {228, 232, 236, 240, -20}}; __TDESC(Files_BufDesc, 1, 1) = {__TDFLDS("BufDesc", 4112), {0, -8}}; __TDESC(Files_Rider, 1, 1) = {__TDFLDS("Rider", 20), {8, -8}}; diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index a2ddea5e..28a97c05 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index 88e5fa50..af8fd777 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index 313d111e..cc058553 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index 8ce1e8f3..9aedc826 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index 2bd2b5da..568db414 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index d34d0f9b..2e03b5fc 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index 084b0534..6641207d 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 6b592341..fd11366a 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index 5219140a..4eff8cf5 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index f54fae67..58701bfc 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index cd390d68..4dd3d03b 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index b4ed079b..d4922137 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index ab972651..2814e733 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index 6028caf7..7218afe1 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index ad1dc868..a860454b 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index ae240604..7b7f6fbc 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index 7c1139c0..86256024 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index 9250891d..eb5ad767 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index 296c8975..9a8653a0 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Out.c b/bootstrap/unix-44/Out.c index ff896aa0..1508a8bb 100644 --- a/bootstrap/unix-44/Out.c +++ b/bootstrap/unix-44/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Out.h b/bootstrap/unix-44/Out.h index 44a26650..b273390e 100644 --- a/bootstrap/unix-44/Out.h +++ b/bootstrap/unix-44/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 410edde3..9a2555d2 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index d5cc19f6..315a17e0 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index fe5db80a..ee1f94ca 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index e791f967..16a16b7a 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index 7c07366c..b60bb504 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index 96231bce..adf86c42 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index 05d98559..ea3662c0 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index 8f626f64..beb1d7c1 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/VT100.c b/bootstrap/unix-44/VT100.c index 6646a439..f0e444ea 100644 --- a/bootstrap/unix-44/VT100.c +++ b/bootstrap/unix-44/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/VT100.h b/bootstrap/unix-44/VT100.h index ee7770b0..0f1bc5ac 100644 --- a/bootstrap/unix-44/VT100.h +++ b/bootstrap/unix-44/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index e450651e..43e5cb69 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index aea1841e..784b684d 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/Compiler.c b/bootstrap/unix-48/Compiler.c index 19053dd2..29524a91 100644 --- a/bootstrap/unix-48/Compiler.c +++ b/bootstrap/unix-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index d0de3d5d..54214f70 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index 2cc1873a..1e6381e9 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 3a6ec440..3b5fd2eb 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -36,7 +36,7 @@ typedef INT32 fd, len, pos; Files_Buffer bufs[4]; INT16 swapper, state; - Files_File next; + struct Files_FileDesc *next; } Files_FileDesc; typedef @@ -48,7 +48,7 @@ typedef } Files_Rider; -static Files_File Files_files; +static Files_FileDesc *Files_files; static INT16 Files_tempno; static CHAR Files_HOME[1024]; static struct { @@ -380,7 +380,7 @@ static Files_File Files_CacheEntry (Platform_FileIdentity identity) { Files_File f = NIL; INT16 i, error; - f = Files_files; + f = (Files_File)Files_files; while (f != NIL) { if (Platform_SameFile(identity, f->identity)) { if (!Platform_SameFileTime(identity, f->identity)) { @@ -398,7 +398,7 @@ static Files_File Files_CacheEntry (Platform_FileIdentity identity) } return f; } - f = f->next; + f = (Files_File)f->next; } return NIL; } @@ -987,12 +987,12 @@ static void Files_CloseOSFile (Files_File f) { Files_File prev = NIL; INT16 error; - if (Files_files == f) { + if (Files_files == (void *) f) { Files_files = f->next; } else { - prev = Files_files; - while ((prev != NIL && prev->next != f)) { - prev = prev->next; + prev = (Files_File)Files_files; + while ((prev != NIL && prev->next != (void *) f)) { + prev = (Files_File)prev->next; } if (prev->next != NIL) { prev->next = f->next; @@ -1031,11 +1031,10 @@ void Files_SetSearchPath (CHAR *path, ADDRESS path__len) static void EnumPtrs(void (*P)(void*)) { - P(Files_files); P(Files_SearchPath); } -__TDESC(Files_FileDesc, 1, 5) = {__TDFLDS("FileDesc", 252), {228, 232, 236, 240, 248, -24}}; +__TDESC(Files_FileDesc, 1, 4) = {__TDFLDS("FileDesc", 252), {228, 232, 236, 240, -20}}; __TDESC(Files_BufDesc, 1, 1) = {__TDFLDS("BufDesc", 4112), {0, -8}}; __TDESC(Files_Rider, 1, 1) = {__TDFLDS("Rider", 20), {8, -8}}; diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index a2ddea5e..28a97c05 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index 88e5fa50..af8fd777 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index 313d111e..cc058553 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index 8ce1e8f3..9aedc826 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index 2bd2b5da..568db414 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index d34d0f9b..2e03b5fc 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index 084b0534..6641207d 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 6b592341..fd11366a 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index 5219140a..4eff8cf5 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index f54fae67..58701bfc 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index cd390d68..4dd3d03b 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index b4ed079b..d4922137 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index ab972651..2814e733 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index 6028caf7..7218afe1 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index ad1dc868..a860454b 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 7ed72408..aa53a484 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index 7c1139c0..86256024 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index 9250891d..eb5ad767 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index 296c8975..9a8653a0 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Out.c b/bootstrap/unix-48/Out.c index ff896aa0..1508a8bb 100644 --- a/bootstrap/unix-48/Out.c +++ b/bootstrap/unix-48/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Out.h b/bootstrap/unix-48/Out.h index 44a26650..b273390e 100644 --- a/bootstrap/unix-48/Out.h +++ b/bootstrap/unix-48/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 410edde3..9a2555d2 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index d5cc19f6..315a17e0 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index fe5db80a..ee1f94ca 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index e791f967..16a16b7a 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index 7c07366c..b60bb504 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index 96231bce..adf86c42 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index 68aa0310..c9010809 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index 2635c7ad..16b07b6f 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/VT100.c b/bootstrap/unix-48/VT100.c index 6646a439..f0e444ea 100644 --- a/bootstrap/unix-48/VT100.c +++ b/bootstrap/unix-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/VT100.h b/bootstrap/unix-48/VT100.h index ee7770b0..0f1bc5ac 100644 --- a/bootstrap/unix-48/VT100.h +++ b/bootstrap/unix-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index e450651e..43e5cb69 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index aea1841e..784b684d 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/Compiler.c b/bootstrap/unix-88/Compiler.c index 19053dd2..29524a91 100644 --- a/bootstrap/unix-88/Compiler.c +++ b/bootstrap/unix-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index d0de3d5d..54214f70 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index 2cc1873a..1e6381e9 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 1b967820..74c2d809 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -36,7 +36,7 @@ typedef INT32 fd, len, pos; Files_Buffer bufs[4]; INT16 swapper, state; - Files_File next; + struct Files_FileDesc *next; } Files_FileDesc; typedef @@ -48,7 +48,7 @@ typedef } Files_Rider; -static Files_File Files_files; +static Files_FileDesc *Files_files; static INT16 Files_tempno; static CHAR Files_HOME[1024]; static struct { @@ -380,7 +380,7 @@ static Files_File Files_CacheEntry (Platform_FileIdentity identity) { Files_File f = NIL; INT16 i, error; - f = Files_files; + f = (Files_File)Files_files; while (f != NIL) { if (Platform_SameFile(identity, f->identity)) { if (!Platform_SameFileTime(identity, f->identity)) { @@ -398,7 +398,7 @@ static Files_File Files_CacheEntry (Platform_FileIdentity identity) } return f; } - f = f->next; + f = (Files_File)f->next; } return NIL; } @@ -987,12 +987,12 @@ static void Files_CloseOSFile (Files_File f) { Files_File prev = NIL; INT16 error; - if (Files_files == f) { + if (Files_files == (void *) f) { Files_files = f->next; } else { - prev = Files_files; - while ((prev != NIL && prev->next != f)) { - prev = prev->next; + prev = (Files_File)Files_files; + while ((prev != NIL && prev->next != (void *) f)) { + prev = (Files_File)prev->next; } if (prev->next != NIL) { prev->next = f->next; @@ -1031,11 +1031,10 @@ void Files_SetSearchPath (CHAR *path, ADDRESS path__len) static void EnumPtrs(void (*P)(void*)) { - P(Files_files); P(Files_SearchPath); } -__TDESC(Files_FileDesc, 1, 5) = {__TDFLDS("FileDesc", 280), {232, 240, 248, 256, 272, -48}}; +__TDESC(Files_FileDesc, 1, 4) = {__TDFLDS("FileDesc", 280), {232, 240, 248, 256, -40}}; __TDESC(Files_BufDesc, 1, 1) = {__TDFLDS("BufDesc", 4120), {0, -16}}; __TDESC(Files_Rider, 1, 1) = {__TDFLDS("Rider", 24), {8, -16}}; diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 6d4e7f78..0da4768b 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index afc96221..95dd55ee 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index e8a34cc3..b96e0160 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index e161f52a..9b72d021 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index 2bd2b5da..568db414 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index d34d0f9b..2e03b5fc 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index 084b0534..6641207d 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index 6b592341..fd11366a 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index 5219140a..4eff8cf5 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 944cb3df..e4915a3e 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index cd390d68..4dd3d03b 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index 5b8ca3cb..a08cee09 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index ab972651..2814e733 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index 6028caf7..7218afe1 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index ad1dc868..a860454b 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index 50fa7c31..de44eed9 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 7c1139c0..86256024 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 70113cd4..7a7ce5c1 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index 296c8975..9a8653a0 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Out.c b/bootstrap/unix-88/Out.c index ff896aa0..1508a8bb 100644 --- a/bootstrap/unix-88/Out.c +++ b/bootstrap/unix-88/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Out.h b/bootstrap/unix-88/Out.h index 44a26650..b273390e 100644 --- a/bootstrap/unix-88/Out.h +++ b/bootstrap/unix-88/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index fde6b221..a211fab4 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index 31c0037a..131a8aa8 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index fe5db80a..ee1f94ca 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index e791f967..16a16b7a 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index 7c07366c..b60bb504 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index 96231bce..adf86c42 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index 590a2041..0bb7d871 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index 1d12b7c6..b1eafc02 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/VT100.c b/bootstrap/unix-88/VT100.c index 6646a439..f0e444ea 100644 --- a/bootstrap/unix-88/VT100.c +++ b/bootstrap/unix-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/VT100.h b/bootstrap/unix-88/VT100.h index ee7770b0..0f1bc5ac 100644 --- a/bootstrap/unix-88/VT100.h +++ b/bootstrap/unix-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index e450651e..43e5cb69 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index aea1841e..784b684d 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/Compiler.c b/bootstrap/windows-48/Compiler.c index 19053dd2..29524a91 100644 --- a/bootstrap/windows-48/Compiler.c +++ b/bootstrap/windows-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index d0de3d5d..54214f70 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index 2cc1873a..1e6381e9 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index a737c2d8..07f758d2 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -36,7 +36,7 @@ typedef INT32 fd, len, pos; Files_Buffer bufs[4]; INT16 swapper, state; - Files_File next; + struct Files_FileDesc *next; } Files_FileDesc; typedef @@ -48,7 +48,7 @@ typedef } Files_Rider; -static Files_File Files_files; +static Files_FileDesc *Files_files; static INT16 Files_tempno; static CHAR Files_HOME[1024]; static struct { @@ -380,7 +380,7 @@ static Files_File Files_CacheEntry (Platform_FileIdentity identity) { Files_File f = NIL; INT16 i, error; - f = Files_files; + f = (Files_File)Files_files; while (f != NIL) { if (Platform_SameFile(identity, f->identity)) { if (!Platform_SameFileTime(identity, f->identity)) { @@ -398,7 +398,7 @@ static Files_File Files_CacheEntry (Platform_FileIdentity identity) } return f; } - f = f->next; + f = (Files_File)f->next; } return NIL; } @@ -987,12 +987,12 @@ static void Files_CloseOSFile (Files_File f) { Files_File prev = NIL; INT16 error; - if (Files_files == f) { + if (Files_files == (void *) f) { Files_files = f->next; } else { - prev = Files_files; - while ((prev != NIL && prev->next != f)) { - prev = prev->next; + prev = (Files_File)Files_files; + while ((prev != NIL && prev->next != (void *) f)) { + prev = (Files_File)prev->next; } if (prev->next != NIL) { prev->next = f->next; @@ -1031,11 +1031,10 @@ void Files_SetSearchPath (CHAR *path, ADDRESS path__len) static void EnumPtrs(void (*P)(void*)) { - P(Files_files); P(Files_SearchPath); } -__TDESC(Files_FileDesc, 1, 5) = {__TDFLDS("FileDesc", 260), {236, 240, 244, 248, 256, -24}}; +__TDESC(Files_FileDesc, 1, 4) = {__TDFLDS("FileDesc", 260), {236, 240, 244, 248, -20}}; __TDESC(Files_BufDesc, 1, 1) = {__TDFLDS("BufDesc", 4112), {0, -8}}; __TDESC(Files_Rider, 1, 1) = {__TDFLDS("Rider", 20), {8, -8}}; diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index 355916fa..fa8f3e8d 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index 88e5fa50..af8fd777 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index 313d111e..cc058553 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index 8ce1e8f3..9aedc826 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index 2bd2b5da..568db414 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index d34d0f9b..2e03b5fc 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index 084b0534..6641207d 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 6b592341..fd11366a 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index 5219140a..4eff8cf5 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index f54fae67..58701bfc 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index cd390d68..4dd3d03b 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index b4ed079b..d4922137 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index ab972651..2814e733 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index 6028caf7..7218afe1 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index ad1dc868..a860454b 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 7ed72408..aa53a484 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index 7c1139c0..86256024 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index 9250891d..eb5ad767 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index 296c8975..9a8653a0 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Out.c b/bootstrap/windows-48/Out.c index eae902f9..0edcb502 100644 --- a/bootstrap/windows-48/Out.c +++ b/bootstrap/windows-48/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Out.h b/bootstrap/windows-48/Out.h index 44a26650..b273390e 100644 --- a/bootstrap/windows-48/Out.h +++ b/bootstrap/windows-48/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 518cb928..78f4409a 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -151,9 +151,9 @@ extern void Heap_InitHeap(); #define Platform_largeInteger() LARGE_INTEGER li #define Platform_liLongint() (LONGINT)li.QuadPart #define Platform_moveFile(o, o__len, n, n__len) (INTEGER)MoveFileEx((char*)o, (char*)n, MOVEFILE_REPLACE_EXISTING) -#define Platform_opennew(n, n__len) (ADDRESS)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0) -#define Platform_openro(n, n__len) (ADDRESS)CreateFile((char*)n, GENERIC_READ , FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) -#define Platform_openrw(n, n__len) (ADDRESS)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) +#define Platform_opennew(n, n__len) (ADDRESS)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0) +#define Platform_openro(n, n__len) (ADDRESS)CreateFile((char*)n, GENERIC_READ , FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) +#define Platform_openrw(n, n__len) (ADDRESS)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) #define Platform_processInfo() PROCESS_INFORMATION pi = {0}; #define Platform_readfile(fd, p, l, n) (INTEGER)ReadFile((HANDLE)fd, (void*)p, (DWORD)l, (DWORD*)n, 0) #define Platform_seekcur() FILE_CURRENT diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index 35a0878d..a4ad7737 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index fe5db80a..ee1f94ca 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index e791f967..16a16b7a 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index 7c07366c..b60bb504 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index 96231bce..adf86c42 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index 68aa0310..c9010809 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index 2635c7ad..16b07b6f 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/VT100.c b/bootstrap/windows-48/VT100.c index 6646a439..f0e444ea 100644 --- a/bootstrap/windows-48/VT100.c +++ b/bootstrap/windows-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/VT100.h b/bootstrap/windows-48/VT100.h index ee7770b0..0f1bc5ac 100644 --- a/bootstrap/windows-48/VT100.h +++ b/bootstrap/windows-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index e450651e..43e5cb69 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index aea1841e..784b684d 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/Compiler.c b/bootstrap/windows-88/Compiler.c index 19053dd2..29524a91 100644 --- a/bootstrap/windows-88/Compiler.c +++ b/bootstrap/windows-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index d0de3d5d..54214f70 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index 2cc1873a..1e6381e9 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 134741a5..1db4ed49 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -37,7 +37,7 @@ typedef INT32 len, pos; Files_Buffer bufs[4]; INT16 swapper, state; - Files_File next; + struct Files_FileDesc *next; } Files_FileDesc; typedef @@ -49,7 +49,7 @@ typedef } Files_Rider; -static Files_File Files_files; +static Files_FileDesc *Files_files; static INT16 Files_tempno; static CHAR Files_HOME[1024]; static struct { @@ -381,7 +381,7 @@ static Files_File Files_CacheEntry (Platform_FileIdentity identity) { Files_File f = NIL; INT16 i, error; - f = Files_files; + f = (Files_File)Files_files; while (f != NIL) { if (Platform_SameFile(identity, f->identity)) { if (!Platform_SameFileTime(identity, f->identity)) { @@ -399,7 +399,7 @@ static Files_File Files_CacheEntry (Platform_FileIdentity identity) } return f; } - f = f->next; + f = (Files_File)f->next; } return NIL; } @@ -989,12 +989,12 @@ static void Files_CloseOSFile (Files_File f) { Files_File prev = NIL; INT16 error; - if (Files_files == f) { + if (Files_files == (void *) f) { Files_files = f->next; } else { - prev = Files_files; - while ((prev != NIL && prev->next != f)) { - prev = prev->next; + prev = (Files_File)Files_files; + while ((prev != NIL && prev->next != (void *) f)) { + prev = (Files_File)prev->next; } if (prev->next != NIL) { prev->next = f->next; @@ -1033,11 +1033,10 @@ void Files_SetSearchPath (CHAR *path, ADDRESS path__len) static void EnumPtrs(void (*P)(void*)) { - P(Files_files); P(Files_SearchPath); } -__TDESC(Files_FileDesc, 1, 5) = {__TDFLDS("FileDesc", 288), {240, 248, 256, 264, 280, -48}}; +__TDESC(Files_FileDesc, 1, 4) = {__TDFLDS("FileDesc", 288), {240, 248, 256, 264, -40}}; __TDESC(Files_BufDesc, 1, 1) = {__TDFLDS("BufDesc", 4120), {0, -16}}; __TDESC(Files_Rider, 1, 1) = {__TDFLDS("Rider", 24), {8, -16}}; diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 3cd0b80b..1d930af8 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index afc96221..95dd55ee 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index e8a34cc3..b96e0160 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index e161f52a..9b72d021 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index 2bd2b5da..568db414 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index d34d0f9b..2e03b5fc 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index 084b0534..6641207d 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index 6b592341..fd11366a 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index 5219140a..4eff8cf5 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 944cb3df..e4915a3e 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index cd390d68..4dd3d03b 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index 5b8ca3cb..a08cee09 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index ab972651..2814e733 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index 6028caf7..7218afe1 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index ad1dc868..a860454b 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index 50fa7c31..de44eed9 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 7c1139c0..86256024 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 70113cd4..7a7ce5c1 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index 296c8975..9a8653a0 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Out.c b/bootstrap/windows-88/Out.c index eae902f9..0edcb502 100644 --- a/bootstrap/windows-88/Out.c +++ b/bootstrap/windows-88/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Out.h b/bootstrap/windows-88/Out.h index 44a26650..b273390e 100644 --- a/bootstrap/windows-88/Out.h +++ b/bootstrap/windows-88/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 954ef044..ad0adb4d 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -151,9 +151,9 @@ extern void Heap_InitHeap(); #define Platform_largeInteger() LARGE_INTEGER li #define Platform_liLongint() (LONGINT)li.QuadPart #define Platform_moveFile(o, o__len, n, n__len) (INTEGER)MoveFileEx((char*)o, (char*)n, MOVEFILE_REPLACE_EXISTING) -#define Platform_opennew(n, n__len) (ADDRESS)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0) -#define Platform_openro(n, n__len) (ADDRESS)CreateFile((char*)n, GENERIC_READ , FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) -#define Platform_openrw(n, n__len) (ADDRESS)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) +#define Platform_opennew(n, n__len) (ADDRESS)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0) +#define Platform_openro(n, n__len) (ADDRESS)CreateFile((char*)n, GENERIC_READ , FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) +#define Platform_openrw(n, n__len) (ADDRESS)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) #define Platform_processInfo() PROCESS_INFORMATION pi = {0}; #define Platform_readfile(fd, p, l, n) (INTEGER)ReadFile((HANDLE)fd, (void*)p, (DWORD)l, (DWORD*)n, 0) #define Platform_seekcur() FILE_CURRENT diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index c39b5ac2..d2d424eb 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index fe5db80a..ee1f94ca 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index e791f967..16a16b7a 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index 7c07366c..b60bb504 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index 96231bce..adf86c42 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index 590a2041..0bb7d871 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index 1d12b7c6..b1eafc02 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/VT100.c b/bootstrap/windows-88/VT100.c index 6646a439..f0e444ea 100644 --- a/bootstrap/windows-88/VT100.c +++ b/bootstrap/windows-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/VT100.h b/bootstrap/windows-88/VT100.h index ee7770b0..0f1bc5ac 100644 --- a/bootstrap/windows-88/VT100.h +++ b/bootstrap/windows-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index e450651e..43e5cb69 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index aea1841e..784b684d 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/doc/Features.md b/doc/Features.md index ae0bcc43..96c1bf78 100644 --- a/doc/Features.md +++ b/doc/Features.md @@ -136,11 +136,42 @@ The following SYSTEM module predefined functions and procedures now use SYSTEM.A Note that the standard function LEN() still returns LONGINT. +#### Files.Mod - Oberon System file semantics on Linux and Windows + +The oberon system has a simpler approach to files than most contemporary operating systems: the data part is manipulated entirely independently of the directory of file names. While Linux has inodes and directories, it does not expose them as independently as Oberon does. + +In particular a file is created in Oberon without touching the directory. Only when a program is ready to expose it in the directory does it call the OS to 'Register' the file. + +In order to mimic this behaviour on Windows and Linux, a new file goes through a number of stages: + + 1. Files.New returns a Files.File, which is an opaque pointer to a file descriptor record. No OS file is created at this stage. + 2. As the first data is written to the file, it is buffered. Still no OS file is created at this stage. + 3. As more data is written to the file more buffers are allocated. Still no OS file is created. + 4. After a limit is reached (currently 4 buffers of 4KB each), a temporary OS file is created, and a buffer reclaimed by flushing it to the temporary file. + 5. Data continues to be written to buffers, with buffers being flushed to the temporary file as necessary to maintain the limit of 4 buffers per file. + 6. Finally, when the client program calls Register, any active buffers are flushed to disk, and the temporary file is renamed to the client specified registration name. + +##### OS file handle lifetime + +Once an OS file has been opened, either by Files.Old, or by sufficient data written to a new file, or by Files.Register, it wil remain open. The client program can Files.Set a new rider on the file at any time. + +Only if the Files.File becomes inaccessible will the garbage collector (eventually) recover the space used by the file descriptor, and only at this time will the OS file handle be closed. + +As in Oberon, Files.Close is only a mechanism to flush buffers, the file remains accessible and may be passed successfully to Files.Set. + +##### Rename and Delete + +Note that on a real Oberon system, it is possible to call rename and delete on files that are currently accessible through a Files.File pointer. For example a program could register a Files.File, and then call Files.Delete passing the same filename - the Files.File remains valid, containing the same data, only the directory entry is removed. + +Such behaviour is not supported on Unix/Windows - an attempt to delete a file that is registered and in use by the program will fail. + + + #### Runtime error and exit handling When passed FALSE, ASSERT displays the message 'Assertion failure.'. If a second, nonzero value is passed to ASSERT it will also be displayed. ASSERT then exits to the OS passing the assert value or zero. HALT displays the message 'Terminated by Halt(n)'. For negative values that correspond to a standard runtime error a descriptive string is also printed. Finally Halt exits to the oprerating system passing the error code. -Bear in mind that both Linux and Windows generally treat the return code as a signed 8 bit value, ignoring higher order bits. Therefore it is best to restrict HALT and ASSERT codes to the range -128 .. 127. +Bear in mind that both Unix and Windows generally treat the return code as a signed 8 bit value, ignoring higher order bits. Therefore it is best to restrict HALT and ASSERT codes to the range -128 .. 127. diff --git a/src/runtime/Files.Mod b/src/runtime/Files.Mod index 983b4f64..4b0c9e44 100644 --- a/src/runtime/Files.Mod +++ b/src/runtime/Files.Mod @@ -43,7 +43,7 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files bufs: ARRAY NumBufs OF Buffer; swapper: INTEGER; state: INTEGER; - next: File; + next: POINTER [1] TO FileDesc; END; BufDesc = RECORD @@ -64,7 +64,7 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files VAR - files: File; (* List of files backed by an OS file, whether open, registered or temporary. *) + files: POINTER [1] TO FileDesc; (* List of files backed by an OS file, whether open, registered or temporary. *) tempno: INTEGER; HOME: ARRAY 1024 OF CHAR; SearchPath: POINTER TO ARRAY OF CHAR; diff --git a/src/runtime/Platformwindows.Mod b/src/runtime/Platformwindows.Mod index bde70184..808e2e0d 100644 --- a/src/runtime/Platformwindows.Mod +++ b/src/runtime/Platformwindows.Mod @@ -300,13 +300,13 @@ PROCEDURE Error*(): ErrorCode; BEGIN RETURN err() END Error; PROCEDURE -invalidHandleValue(): SYSTEM.ADDRESS "((ADDRESS)INVALID_HANDLE_VALUE)"; PROCEDURE -openrw (n: ARRAY OF CHAR): FileHandle -"(ADDRESS)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0)"; +"(ADDRESS)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0)"; PROCEDURE -openro (n: ARRAY OF CHAR): FileHandle -"(ADDRESS)CreateFile((char*)n, GENERIC_READ , FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0)"; +"(ADDRESS)CreateFile((char*)n, GENERIC_READ , FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0)"; PROCEDURE -opennew(n: ARRAY OF CHAR): FileHandle -"(ADDRESS)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0)"; +"(ADDRESS)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0)"; From b16e82f866f7d6b996eeebcfec4948e963d90252 Mon Sep 17 00:00:00 2001 From: David Brown Date: Wed, 30 Nov 2016 18:13:32 +0000 Subject: [PATCH 357/580] Update open FileDescs at deregistration resulting from delete, rename or register. --- bootstrap/unix-44/Files.c | 32 +++++++++++++++++++++- bootstrap/unix-48/Files.c | 32 +++++++++++++++++++++- bootstrap/unix-88/Files.c | 32 +++++++++++++++++++++- bootstrap/windows-48/Files.c | 32 +++++++++++++++++++++- bootstrap/windows-88/Files.c | 32 +++++++++++++++++++++- src/runtime/Files.Mod | 52 ++++++++++++++++++++++++++++++++---- 6 files changed, 202 insertions(+), 10 deletions(-) diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 3b5fd2eb..763569cc 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -68,6 +68,7 @@ export void Files_Close (Files_File f); static void Files_CloseOSFile (Files_File f); static void Files_Create (Files_File f); export void Files_Delete (CHAR *name, ADDRESS name__len, INT16 *res); +static void Files_Deregister (CHAR *name, ADDRESS name__len); static void Files_Err (CHAR *s, ADDRESS s__len, Files_File f, INT16 errcode); static void Files_Finalize (SYSTEM_PTR o); static void Files_FlipBytes (SYSTEM_BYTE *src, ADDRESS src__len, SYSTEM_BYTE *dest, ADDRESS dest__len); @@ -222,9 +223,35 @@ static void Files_GetTempName (CHAR *finalName, ADDRESS finalName__len, CHAR *na __DEL(finalName); } -static void Files_Create (Files_File f) +static void Files_Deregister (CHAR *name, ADDRESS name__len) { Platform_FileIdentity identity; + Files_File osfile = NIL; + INT16 error; + __DUP(name, name__len, CHAR); + if (Platform_IdentifyByName(name, name__len, &identity, Platform_FileIdentity__typ) == 0) { + osfile = (Files_File)Files_files; + while ((osfile != NIL && !Platform_SameFile(osfile->identity, identity))) { + osfile = (Files_File)osfile->next; + } + if (osfile != NIL) { + __ASSERT(!osfile->tempFile, 0); + __ASSERT(osfile->fd >= 0, 0); + __COPY(osfile->workName, osfile->registerName, 101); + Files_GetTempName(osfile->registerName, 101, (void*)osfile->workName, 101); + osfile->tempFile = 1; + osfile->state = 0; + error = Platform_Rename((void*)osfile->registerName, 101, (void*)osfile->workName, 101); + if (error != 0) { + Files_Err((CHAR*)"Couldn't rename previous version of file being registered", 58, osfile, error); + } + } + } + __DEL(name); +} + +static void Files_Create (Files_File f) +{ BOOLEAN done; INT16 error; CHAR err[32]; @@ -234,6 +261,7 @@ static void Files_Create (Files_File f) f->tempFile = 1; } else { __ASSERT(f->state == 2, 0); + Files_Deregister(f->registerName, 101); __COPY(f->registerName, f->workName, 101); f->registerName[0] = 0x00; f->tempFile = 0; @@ -714,6 +742,7 @@ void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS void Files_Delete (CHAR *name, ADDRESS name__len, INT16 *res) { __DUP(name, name__len, CHAR); + Files_Deregister(name, name__len); *res = Platform_Unlink((void*)name, name__len); __DEL(name); } @@ -789,6 +818,7 @@ void Files_Register (Files_File f) } Files_Close(f); if (f->registerName[0] != 0x00) { + Files_Deregister(f->registerName, 101); Files_Rename(f->workName, 101, f->registerName, 101, &errcode); if (errcode != 0) { Files_Err((CHAR*)"Couldn't rename temp name as register name", 43, f, errcode); diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 3b5fd2eb..763569cc 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -68,6 +68,7 @@ export void Files_Close (Files_File f); static void Files_CloseOSFile (Files_File f); static void Files_Create (Files_File f); export void Files_Delete (CHAR *name, ADDRESS name__len, INT16 *res); +static void Files_Deregister (CHAR *name, ADDRESS name__len); static void Files_Err (CHAR *s, ADDRESS s__len, Files_File f, INT16 errcode); static void Files_Finalize (SYSTEM_PTR o); static void Files_FlipBytes (SYSTEM_BYTE *src, ADDRESS src__len, SYSTEM_BYTE *dest, ADDRESS dest__len); @@ -222,9 +223,35 @@ static void Files_GetTempName (CHAR *finalName, ADDRESS finalName__len, CHAR *na __DEL(finalName); } -static void Files_Create (Files_File f) +static void Files_Deregister (CHAR *name, ADDRESS name__len) { Platform_FileIdentity identity; + Files_File osfile = NIL; + INT16 error; + __DUP(name, name__len, CHAR); + if (Platform_IdentifyByName(name, name__len, &identity, Platform_FileIdentity__typ) == 0) { + osfile = (Files_File)Files_files; + while ((osfile != NIL && !Platform_SameFile(osfile->identity, identity))) { + osfile = (Files_File)osfile->next; + } + if (osfile != NIL) { + __ASSERT(!osfile->tempFile, 0); + __ASSERT(osfile->fd >= 0, 0); + __COPY(osfile->workName, osfile->registerName, 101); + Files_GetTempName(osfile->registerName, 101, (void*)osfile->workName, 101); + osfile->tempFile = 1; + osfile->state = 0; + error = Platform_Rename((void*)osfile->registerName, 101, (void*)osfile->workName, 101); + if (error != 0) { + Files_Err((CHAR*)"Couldn't rename previous version of file being registered", 58, osfile, error); + } + } + } + __DEL(name); +} + +static void Files_Create (Files_File f) +{ BOOLEAN done; INT16 error; CHAR err[32]; @@ -234,6 +261,7 @@ static void Files_Create (Files_File f) f->tempFile = 1; } else { __ASSERT(f->state == 2, 0); + Files_Deregister(f->registerName, 101); __COPY(f->registerName, f->workName, 101); f->registerName[0] = 0x00; f->tempFile = 0; @@ -714,6 +742,7 @@ void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS void Files_Delete (CHAR *name, ADDRESS name__len, INT16 *res) { __DUP(name, name__len, CHAR); + Files_Deregister(name, name__len); *res = Platform_Unlink((void*)name, name__len); __DEL(name); } @@ -789,6 +818,7 @@ void Files_Register (Files_File f) } Files_Close(f); if (f->registerName[0] != 0x00) { + Files_Deregister(f->registerName, 101); Files_Rename(f->workName, 101, f->registerName, 101, &errcode); if (errcode != 0) { Files_Err((CHAR*)"Couldn't rename temp name as register name", 43, f, errcode); diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 74c2d809..e2cf2f3a 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -68,6 +68,7 @@ export void Files_Close (Files_File f); static void Files_CloseOSFile (Files_File f); static void Files_Create (Files_File f); export void Files_Delete (CHAR *name, ADDRESS name__len, INT16 *res); +static void Files_Deregister (CHAR *name, ADDRESS name__len); static void Files_Err (CHAR *s, ADDRESS s__len, Files_File f, INT16 errcode); static void Files_Finalize (SYSTEM_PTR o); static void Files_FlipBytes (SYSTEM_BYTE *src, ADDRESS src__len, SYSTEM_BYTE *dest, ADDRESS dest__len); @@ -222,9 +223,35 @@ static void Files_GetTempName (CHAR *finalName, ADDRESS finalName__len, CHAR *na __DEL(finalName); } -static void Files_Create (Files_File f) +static void Files_Deregister (CHAR *name, ADDRESS name__len) { Platform_FileIdentity identity; + Files_File osfile = NIL; + INT16 error; + __DUP(name, name__len, CHAR); + if (Platform_IdentifyByName(name, name__len, &identity, Platform_FileIdentity__typ) == 0) { + osfile = (Files_File)Files_files; + while ((osfile != NIL && !Platform_SameFile(osfile->identity, identity))) { + osfile = (Files_File)osfile->next; + } + if (osfile != NIL) { + __ASSERT(!osfile->tempFile, 0); + __ASSERT(osfile->fd >= 0, 0); + __COPY(osfile->workName, osfile->registerName, 101); + Files_GetTempName(osfile->registerName, 101, (void*)osfile->workName, 101); + osfile->tempFile = 1; + osfile->state = 0; + error = Platform_Rename((void*)osfile->registerName, 101, (void*)osfile->workName, 101); + if (error != 0) { + Files_Err((CHAR*)"Couldn't rename previous version of file being registered", 58, osfile, error); + } + } + } + __DEL(name); +} + +static void Files_Create (Files_File f) +{ BOOLEAN done; INT16 error; CHAR err[32]; @@ -234,6 +261,7 @@ static void Files_Create (Files_File f) f->tempFile = 1; } else { __ASSERT(f->state == 2, 0); + Files_Deregister(f->registerName, 101); __COPY(f->registerName, f->workName, 101); f->registerName[0] = 0x00; f->tempFile = 0; @@ -714,6 +742,7 @@ void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS void Files_Delete (CHAR *name, ADDRESS name__len, INT16 *res) { __DUP(name, name__len, CHAR); + Files_Deregister(name, name__len); *res = Platform_Unlink((void*)name, name__len); __DEL(name); } @@ -789,6 +818,7 @@ void Files_Register (Files_File f) } Files_Close(f); if (f->registerName[0] != 0x00) { + Files_Deregister(f->registerName, 101); Files_Rename(f->workName, 101, f->registerName, 101, &errcode); if (errcode != 0) { Files_Err((CHAR*)"Couldn't rename temp name as register name", 43, f, errcode); diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 07f758d2..aa879424 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -68,6 +68,7 @@ export void Files_Close (Files_File f); static void Files_CloseOSFile (Files_File f); static void Files_Create (Files_File f); export void Files_Delete (CHAR *name, ADDRESS name__len, INT16 *res); +static void Files_Deregister (CHAR *name, ADDRESS name__len); static void Files_Err (CHAR *s, ADDRESS s__len, Files_File f, INT16 errcode); static void Files_Finalize (SYSTEM_PTR o); static void Files_FlipBytes (SYSTEM_BYTE *src, ADDRESS src__len, SYSTEM_BYTE *dest, ADDRESS dest__len); @@ -222,9 +223,35 @@ static void Files_GetTempName (CHAR *finalName, ADDRESS finalName__len, CHAR *na __DEL(finalName); } -static void Files_Create (Files_File f) +static void Files_Deregister (CHAR *name, ADDRESS name__len) { Platform_FileIdentity identity; + Files_File osfile = NIL; + INT16 error; + __DUP(name, name__len, CHAR); + if (Platform_IdentifyByName(name, name__len, &identity, Platform_FileIdentity__typ) == 0) { + osfile = (Files_File)Files_files; + while ((osfile != NIL && !Platform_SameFile(osfile->identity, identity))) { + osfile = (Files_File)osfile->next; + } + if (osfile != NIL) { + __ASSERT(!osfile->tempFile, 0); + __ASSERT(osfile->fd >= 0, 0); + __COPY(osfile->workName, osfile->registerName, 101); + Files_GetTempName(osfile->registerName, 101, (void*)osfile->workName, 101); + osfile->tempFile = 1; + osfile->state = 0; + error = Platform_Rename((void*)osfile->registerName, 101, (void*)osfile->workName, 101); + if (error != 0) { + Files_Err((CHAR*)"Couldn't rename previous version of file being registered", 58, osfile, error); + } + } + } + __DEL(name); +} + +static void Files_Create (Files_File f) +{ BOOLEAN done; INT16 error; CHAR err[32]; @@ -234,6 +261,7 @@ static void Files_Create (Files_File f) f->tempFile = 1; } else { __ASSERT(f->state == 2, 0); + Files_Deregister(f->registerName, 101); __COPY(f->registerName, f->workName, 101); f->registerName[0] = 0x00; f->tempFile = 0; @@ -714,6 +742,7 @@ void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS void Files_Delete (CHAR *name, ADDRESS name__len, INT16 *res) { __DUP(name, name__len, CHAR); + Files_Deregister(name, name__len); *res = Platform_Unlink((void*)name, name__len); __DEL(name); } @@ -789,6 +818,7 @@ void Files_Register (Files_File f) } Files_Close(f); if (f->registerName[0] != 0x00) { + Files_Deregister(f->registerName, 101); Files_Rename(f->workName, 101, f->registerName, 101, &errcode); if (errcode != 0) { Files_Err((CHAR*)"Couldn't rename temp name as register name", 43, f, errcode); diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 1db4ed49..f83fafeb 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -69,6 +69,7 @@ export void Files_Close (Files_File f); static void Files_CloseOSFile (Files_File f); static void Files_Create (Files_File f); export void Files_Delete (CHAR *name, ADDRESS name__len, INT16 *res); +static void Files_Deregister (CHAR *name, ADDRESS name__len); static void Files_Err (CHAR *s, ADDRESS s__len, Files_File f, INT16 errcode); static void Files_Finalize (SYSTEM_PTR o); static void Files_FlipBytes (SYSTEM_BYTE *src, ADDRESS src__len, SYSTEM_BYTE *dest, ADDRESS dest__len); @@ -223,9 +224,35 @@ static void Files_GetTempName (CHAR *finalName, ADDRESS finalName__len, CHAR *na __DEL(finalName); } -static void Files_Create (Files_File f) +static void Files_Deregister (CHAR *name, ADDRESS name__len) { Platform_FileIdentity identity; + Files_File osfile = NIL; + INT16 error; + __DUP(name, name__len, CHAR); + if (Platform_IdentifyByName(name, name__len, &identity, Platform_FileIdentity__typ) == 0) { + osfile = (Files_File)Files_files; + while ((osfile != NIL && !Platform_SameFile(osfile->identity, identity))) { + osfile = (Files_File)osfile->next; + } + if (osfile != NIL) { + __ASSERT(!osfile->tempFile, 0); + __ASSERT(osfile->fd >= 0, 0); + __COPY(osfile->workName, osfile->registerName, 101); + Files_GetTempName(osfile->registerName, 101, (void*)osfile->workName, 101); + osfile->tempFile = 1; + osfile->state = 0; + error = Platform_Rename((void*)osfile->registerName, 101, (void*)osfile->workName, 101); + if (error != 0) { + Files_Err((CHAR*)"Couldn't rename previous version of file being registered", 58, osfile, error); + } + } + } + __DEL(name); +} + +static void Files_Create (Files_File f) +{ BOOLEAN done; INT16 error; CHAR err[32]; @@ -235,6 +262,7 @@ static void Files_Create (Files_File f) f->tempFile = 1; } else { __ASSERT(f->state == 2, 0); + Files_Deregister(f->registerName, 101); __COPY(f->registerName, f->workName, 101); f->registerName[0] = 0x00; f->tempFile = 0; @@ -715,6 +743,7 @@ void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS void Files_Delete (CHAR *name, ADDRESS name__len, INT16 *res) { __DUP(name, name__len, CHAR); + Files_Deregister(name, name__len); *res = Platform_Unlink((void*)name, name__len); __DEL(name); } @@ -791,6 +820,7 @@ void Files_Register (Files_File f) } Files_Close(f); if (f->registerName[0] != 0x00) { + Files_Deregister(f->registerName, 101); Files_Rename(f->workName, 101, f->registerName, 101, &errcode); if (errcode != 0) { Files_Err((CHAR*)"Couldn't rename temp name as register name", 43, f, errcode); diff --git a/src/runtime/Files.Mod b/src/runtime/Files.Mod index 4b0c9e44..7bbecbf7 100644 --- a/src/runtime/Files.Mod +++ b/src/runtime/Files.Mod @@ -122,16 +122,51 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files name[i] := 0X END GetTempName; + (* When registering a file, it may turn out that the name we want to use + is aready in use by another File. E.g. the compiler opens and reads + an existing symbol file if present before creating an updated one. + When this happens on Windows, creation of the new file will be blocked + by the presence of the old one because it is in a open state. Further, + on both Unix and Windows systems we want behaviour to match that of + a real Oberon system, where registering the new file has the effect of + unregistering the old file. To simulate this we need to change the old + Files.File back to a temp file. *) + PROCEDURE Deregister(name: ARRAY OF CHAR); + VAR + identity: Platform.FileIdentity; + osfile: File; + error: Platform.ErrorCode; + BEGIN + IF Platform.IdentifyByName(name, identity) = 0 THEN + (* The name we are registering is an already existing file. *) + osfile := files; + WHILE (osfile # NIL) & ~Platform.SameFile(osfile.identity, identity) DO osfile := osfile.next END; + IF osfile # NIL THEN + (* osfile is the FileDesc corresponding to the file name we are hoping + to register. Turn it into a temporary file. *) + ASSERT(~osfile.tempFile); ASSERT(osfile.fd >= 0); + osfile.registerName := osfile.workName; + GetTempName(osfile.registerName, osfile.workName); + osfile.tempFile := TRUE; + osfile.state := open; + error := Platform.Rename(osfile.registerName, osfile.workName); + IF error # 0 THEN + Err("Couldn't rename previous version of file being registered", osfile, error) + END + END + END + END Deregister; + + PROCEDURE Create(f: File); (* Makes sure there is an OS file backing this Oberon file. Used when more data has been written to an unregistered new file than buffers can hold, or when registering a new file whose data is all in buffers. *) VAR - identity: Platform.FileIdentity; - done: BOOLEAN; - error: Platform.ErrorCode; - err: ARRAY 32 OF CHAR; + done: BOOLEAN; + error: Platform.ErrorCode; + err: ARRAY 32 OF CHAR; BEGIN (* Out.String("Files.Create fd = "); Out.Int(f.fd,1); @@ -149,6 +184,7 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files ASSERT(f.state = close); (* New file with all data in buffers being registered. No need for a temp file, will just write the buffers to the registerName. *) + Deregister(f.registerName); f.workName := f.registerName; f.registerName := ""; f.tempFile := FALSE END; error := Platform.Unlink(f.workName); (*unlink first to avoid stale NFS handles and to avoid reuse of inodes*) @@ -509,7 +545,10 @@ Especially Length would become fairly complex. *) PROCEDURE Delete*(name: ARRAY OF CHAR; VAR res: INTEGER); - BEGIN res := Platform.Unlink(name) END Delete; + BEGIN + Deregister(name); + res := Platform.Unlink(name) + END Delete; PROCEDURE Rename* (old, new: ARRAY OF CHAR; VAR res: INTEGER); VAR @@ -531,6 +570,8 @@ Especially Length would become fairly complex. END; error := Platform.Rename(old, new); (* Out.String("Platform.Rename error code "); Out.Int(error,1); Out.Ln; *) + (* TODO, if we already have a FileDesc for old, it ought to be updated + with the new workname. *) IF ~Platform.DifferentFilesystems(error) THEN res := error; RETURN ELSE @@ -572,6 +613,7 @@ Especially Length would become fairly complex. IF (f.state = create) & (f.registerName # "") THEN f.state := close (* shortcut renaming *) END; Close(f); IF f.registerName # "" THEN + Deregister(f.registerName); Rename(f.workName, f.registerName, errcode); (* Out.String("Renamed (for register) f.fd = "); Out.Int(f.fd,1); From aed9134e9961145a40397e6b70833d307ae221a9 Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 1 Dec 2016 17:57:27 +0000 Subject: [PATCH 358/580] Allow Revised Oberon array assignment (source may be shorter than target). --- src/compiler/OPB.Mod | 18 +++++++++--------- src/compiler/OPV.Mod | 13 +++++++++++-- src/test/confidence/arrayassignment/aa.mod | 3 --- src/test/confidence/arrayassignment/expected | 3 --- 4 files changed, 20 insertions(+), 17 deletions(-) diff --git a/src/compiler/OPB.Mod b/src/compiler/OPB.Mod index 91576fd3..710cd640 100644 --- a/src/compiler/OPB.Mod +++ b/src/compiler/OPB.Mod @@ -891,20 +891,26 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) IF x^.comp = OPT.Array THEN IF (ynode^.class = OPT.Nconst) & (g = OPT.Char) THEN CharToString(ynode); y := ynode^.typ; g := OPT.String END ; IF x = y THEN (* ok *) + ELSIF (y.comp = OPT.Array) & (y.BaseTyp = x.BaseTyp) & (y.n <= x.n) THEN (* OK by Oberon-07/2013 *) + ELSIF (y.comp = OPT.DynArr) & (y.BaseTyp = x.BaseTyp) THEN (* OK by Oberon-07/2013, length tested at runtime *) ELSIF x^.BaseTyp = OPT.chartyp THEN (* Assign to (static) ARRAY OF CHAR *) IF g = OPT.String THEN (*check length of string*) IF ynode^.conval^.intval2 > x^.n THEN err(114) END + (* Todo: implement Oberon-07/2013 array assignment ELSIF (y.comp IN {OPT.DynArr, OPT.Array}) & (y.BaseTyp = OPT.chartyp) THEN (* Assignment from ARRAY OF CHAR is good.*) + *) ELSE err(113) END ELSE err(113) END + (* Todo: implement Oberon-07/2013 array assignment ELSIF (x.comp = OPT.DynArr) & (x^.BaseTyp = OPT.chartyp) THEN (* Assign to dynamic ARRAY OF CHAR*) IF (y.comp IN {OPT.DynArr, OPT.Array}) & (y.BaseTyp = OPT.chartyp) THEN (* Assignment from ARRAY OF CHAR is good.*) ELSE err(113) END + *) ELSIF x^.comp = OPT.Record THEN IF x = y THEN (* ok *) ELSIF y^.comp = OPT.Record THEN @@ -913,7 +919,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) IF q = NIL THEN err(113) END ELSE err(113) END - ELSE err(113) + ELSE (* Assign to dynamic array *) err(113) END ELSE OPM.LogWStr("unhandled case in OPB.CheckAssign, f = "); OPM.LogWNum(f, 0); OPM.LogWLn; END ; @@ -1464,7 +1470,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) END Return; PROCEDURE Assign*(VAR x: OPT.Node; y: OPT.Node); - VAR z: OPT.Node; subcl: SHORTINT; + VAR z: OPT.Node; BEGIN IF x^.class >= OPT.Nconst THEN err(56) END ; CheckAssign(x^.typ, y); @@ -1481,15 +1487,9 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) (y^.typ^.form = OPT.String) & (y^.conval^.intval2 = 1) THEN (* replace array := "" with array[0] := 0X *) y^.typ := OPT.chartyp; y^.conval^.intval := 0; Index(x, NewIntConst(0)) - END ; - IF (x.typ.comp IN {OPT.Array, OPT.DynArr}) & (x.typ.BaseTyp = OPT.chartyp) - & (y.typ.comp IN {OPT.Array, OPT.DynArr}) & (y.typ.BaseTyp = OPT.chartyp) THEN - subcl := OPT.copyfn - ELSE - subcl := OPT.assign END; BindNodes(OPT.Nassign, OPT.notyp, x, y); - x^.subcl := subcl; + x^.subcl := OPT.assign; END Assign; PROCEDURE Inittd*(VAR inittd, last: OPT.Node; typ: OPT.Struct); diff --git a/src/compiler/OPV.Mod b/src/compiler/OPV.Mod index cd3c649c..c2099cc5 100644 --- a/src/compiler/OPV.Mod +++ b/src/compiler/OPV.Mod @@ -785,8 +785,17 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 OPM.WriteString(MoveFunc); expr(r, MinPrec); OPM.WriteString(Comma); expr(l, MinPrec); OPM.WriteString(Comma); IF r^.typ = OPT.stringtyp THEN OPM.WriteInt(r^.conval^.intval2) - ELSE OPM.WriteInt(r^.typ^.size) - END ; + ELSIF r.typ.comp = OPT.DynArr THEN + (* Dynamic array to array copy *) + OPM.WriteString("__X("); + OPC.Len(r.obj, r.typ, 0); OPM.WriteString(" * "); OPM.WriteInt(r.typ.BaseTyp.size); + OPM.WriteString(", "); + OPM.WriteInt(l.typ.size); + OPM.Write(")") + ELSE (* Array to array copy. *) + ASSERT(r.typ.comp = OPT.Array); ASSERT(r.typ.size <= l.typ.size); + OPM.WriteInt(r^.typ^.size) + END; OPM.Write(CloseParen) ELSE IF (l^.typ^.form = OPT.Pointer) & (l^.obj # NIL) & (l^.obj^.adr = 1) & (l^.obj^.mode = OPT.Var) THEN diff --git a/src/test/confidence/arrayassignment/aa.mod b/src/test/confidence/arrayassignment/aa.mod index 145824e8..e5ac2db0 100644 --- a/src/test/confidence/arrayassignment/aa.mod +++ b/src/test/confidence/arrayassignment/aa.mod @@ -19,8 +19,5 @@ BEGIN COPY(a30, a10); Console.String("a10: "); Console.String(a10); Console.Ln; Console.String("a20: "); Console.String(a20); Console.Ln; Console.Ln; - a10 := a30; Console.String("a10: "); Console.String(a10); Console.Ln; - Console.String("a20: "); Console.String(a20); Console.Ln; - Console.Ln; Console.String("Array assignment test complete."); Console.Ln; END aa. diff --git a/src/test/confidence/arrayassignment/expected b/src/test/confidence/arrayassignment/expected index 7ca85cf2..753916be 100644 --- a/src/test/confidence/arrayassignment/expected +++ b/src/test/confidence/arrayassignment/expected @@ -4,7 +4,4 @@ a20: 1st 10 ch 2nd 10 ch a10: 1st 10 ch a20: 1st 10 ch 2nd 10 ch -a10: 1st 10 ch -a20: 1st 10 ch 2nd 10 ch - Array assignment test complete. From 299b0636ad82edb7bd1a865cc3cf96afbaf2bd0e Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 1 Dec 2016 18:08:08 +0000 Subject: [PATCH 359/580] Fix Platform initialisation, move common Arg handling code from Platfrom to Modules. --- src/compiler/OPM.Mod | 16 ++++---- src/library/v4/Args.Mod | 12 +++--- src/runtime/Heap.Mod | 12 +++--- src/runtime/Modules.Mod | 64 +++++++++++++++++++++++++++++- src/runtime/Oberon.Mod | 8 ++-- src/runtime/Platformunix.Mod | 67 +++----------------------------- src/runtime/Platformwindows.Mod | 66 ------------------------------- src/runtime/SYSTEM.h | 4 +- src/tools/browser/BrowserCmd.Mod | 12 +++--- 9 files changed, 99 insertions(+), 162 deletions(-) diff --git a/src/compiler/OPM.Mod b/src/compiler/OPM.Mod index 7c88f8fc..e59435eb 100644 --- a/src/compiler/OPM.Mod +++ b/src/compiler/OPM.Mod @@ -4,7 +4,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) 31.1.2007 jt synchronized with BlackBox version, in particular PromoteIntConstToLInt added *) - IMPORT SYSTEM, Texts, Files, Platform, Out, Configuration, VT100, Strings; + IMPORT SYSTEM, Texts, Files, Platform, Modules, Out, Configuration, VT100, Strings; CONST OptionChar* = "-"; @@ -233,7 +233,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) PROCEDURE OpenPar*(): BOOLEAN; (* prepare for a sequence of translations *) VAR s: ARRAY 256 OF CHAR; BEGIN - IF Platform.ArgCount = 1 THEN + IF Modules.ArgCount = 1 THEN LogWLn; LogWStr("Oberon-2 compiler v"); LogWStr(Configuration.versionLong); LogW("."); LogWLn; LogWStr("Based on Ofront by J. Templ and Software Templ OEG."); LogWLn; @@ -290,10 +290,10 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) Options := {inxchk, typchk, ptrinit, assert}; (* Default options *) (* Pick up global option changes from start of command line *) - S:=1; s:=""; Platform.GetArg(S, s); + S:=1; s:=""; Modules.GetArg(S, s); WHILE s[0] = OptionChar DO ScanOptions(s); - INC(S); s:=""; Platform.GetArg(S, s) + INC(S); s:=""; Modules.GetArg(S, s) END; (* Record global option settings for this command line *) @@ -328,10 +328,10 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) BEGIN Options := GlobalOptions; Model:=GlobalModel; Alignment := GlobalAlignment; AddressSize := GlobalAddressSize; - s:=""; Platform.GetArg(S, s); + s:=""; Modules.GetArg(S, s); WHILE s[0] = OptionChar DO ScanOptions(s); - INC(S); s:=""; Platform.GetArg(S, s) + INC(S); s:=""; Modules.GetArg(S, s) END; IF mainlinkstat IN Options THEN INCL(Options, mainprog) END; @@ -369,9 +369,9 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) BEGIN done := FALSE; curpos := 0; - IF S >= Platform.ArgCount THEN RETURN END ; + IF S >= Modules.ArgCount THEN RETURN END ; - s:=""; Platform.GetArg(S, s); + s:=""; Modules.GetArg(S, s); NEW(T); Texts.Open(T, s); LogWStr(s); LogWStr(" "); diff --git a/src/library/v4/Args.Mod b/src/library/v4/Args.Mod index a196b5c5..578ac7e5 100644 --- a/src/library/v4/Args.Mod +++ b/src/library/v4/Args.Mod @@ -3,7 +3,7 @@ MODULE Args; (* jt, 8.12.94 *) (* command line argument handling for voc (jet backend) *) - IMPORT Platform, SYSTEM; + IMPORT Platform, Modules, SYSTEM; TYPE ArgPtr = POINTER TO ARRAY 1024 OF CHAR; @@ -14,9 +14,9 @@ MODULE Args; (* jt, 8.12.94 *) argv-: SYSTEM.ADDRESS; -PROCEDURE Get* (n: INTEGER; VAR val: ARRAY OF CHAR); BEGIN Platform.GetArg(n, val) END Get; -PROCEDURE GetInt*(n: INTEGER; VAR val: LONGINT); BEGIN Platform.GetIntArg(n, val) END GetInt; -PROCEDURE Pos* (s: ARRAY OF CHAR): INTEGER; BEGIN RETURN Platform.ArgPos(s) END Pos; +PROCEDURE Get* (n: INTEGER; VAR val: ARRAY OF CHAR); BEGIN Modules.GetArg(n, val) END Get; +PROCEDURE GetInt*(n: INTEGER; VAR val: LONGINT); BEGIN Modules.GetIntArg(n, val) END GetInt; +PROCEDURE Pos* (s: ARRAY OF CHAR): INTEGER; BEGIN RETURN Modules.ArgPos(s) END Pos; PROCEDURE GetEnv*(var: ARRAY OF CHAR; VAR val: ARRAY OF CHAR); BEGIN Platform.GetEnv(var, val) END GetEnv; @@ -26,6 +26,6 @@ BEGIN RETURN Platform.getEnv(var, val) END getEnv; BEGIN - argc := Platform.ArgCount; - argv := Platform.ArgVector; + argc := Modules.ArgCount; + argv := Modules.ArgVector; END Args. diff --git a/src/runtime/Heap.Mod b/src/runtime/Heap.Mod index e368ae88..6407f27d 100644 --- a/src/runtime/Heap.Mod +++ b/src/runtime/Heap.Mod @@ -495,8 +495,8 @@ MODULE Heap; END END FINALL; - PROCEDURE -ExternMainStackFrame "extern ADDRESS Platform_MainStackFrame;"; - PROCEDURE -PlatformMainStackFrame(): S.ADDRESS "Platform_MainStackFrame"; + PROCEDURE -ExternMainStackFrame "extern ADDRESS Modules_MainStackFrame;"; + PROCEDURE -ModulesMainStackFrame(): S.ADDRESS "Modules_MainStackFrame"; PROCEDURE MarkStack(n: S.ADDRESS; VAR cand: ARRAY OF S.ADDRESS); VAR @@ -510,7 +510,7 @@ MODULE Heap; END ; IF n = 0 THEN nofcand := 0; sp := S.ADR(frame); - stack0 := PlatformMainStackFrame(); + stack0 := ModulesMainStackFrame(); (* check for minimum alignment of pointers *) inc := S.ADR(align.p) - S.ADR(align); IF sp > stack0 THEN inc := -inc END ; @@ -572,8 +572,8 @@ MODULE Heap; END RegisterFinalizer; -PROCEDURE -ExternHeapInit "extern void *Heap__init();"; -PROCEDURE -HeapModuleInit 'Heap__init()'; + PROCEDURE -ExternHeapInit "extern void *Heap__init();"; + PROCEDURE -HeapModuleInit 'Heap__init()'; PROCEDURE InitHeap*; (* InitHeap is called by Platform.init before any module bodies have been @@ -596,7 +596,7 @@ PROCEDURE -HeapModuleInit 'Heap__init()'; FileCount := 0; modules := NIL; - bigBlocks := 0; + bigBlocks := 0; fin := NIL; interrupted := FALSE; diff --git a/src/runtime/Modules.Mod b/src/runtime/Modules.Mod index 970bc547..8e9c1851 100644 --- a/src/runtime/Modules.Mod +++ b/src/runtime/Modules.Mod @@ -3,7 +3,7 @@ MODULE Modules; (* jt 6.1.96 *) (* access to list of modules and commands, based on ETH Oberon *) - IMPORT SYSTEM, Heap, Platform; + IMPORT SYSTEM, Platform, Heap; (* Note, must import Platform before Heap *) CONST ModNameLen* = 20; @@ -35,6 +35,66 @@ MODULE Modules; (* jt 6.1.96 *) resMsg*: ARRAY 256 OF CHAR; imported*, importing*: ModuleName; + MainStackFrame-: SYSTEM.ADDRESS; + ArgCount-: INTEGER; + ArgVector-: SYSTEM.ADDRESS; + + +(* Program startup *) + + PROCEDURE -ExternInitHeap "extern void Heap_InitHeap();"; + PROCEDURE -InitHeap "Heap_InitHeap()"; + PROCEDURE -ExternInitModulesInit "extern void *Modules__init(void);"; + PROCEDURE -ModulesInit() "Modules__init()"; + + PROCEDURE Init*(argc: SYSTEM.INT32; argvadr: SYSTEM.ADDRESS); + (* This start code is called by the __INIT macro generated by the compiler + as the C main program. *) + TYPE ArgVecPtr = POINTER TO ARRAY 1 OF SYSTEM.ADDRESS; + VAR av: ArgVecPtr; + BEGIN + MainStackFrame := argvadr; + ArgCount := SYSTEM.VAL(INTEGER, argc); + av := SYSTEM.VAL(ArgVecPtr, argvadr); + ArgVector := av[0]; + + InitHeap; (* Initailse heap varaibles neded for compiler generated *__inits *) + ModulesInit(); (* Our own __init code will run the Platform and Heap __init code. *) + END Init; + + + PROCEDURE GetArg*(n: INTEGER; VAR val: ARRAY OF CHAR); + TYPE + ArgPtr = POINTER TO ARRAY 1024 OF CHAR; + ArgVec = POINTER TO ARRAY 1024 OF ArgPtr; + VAR av: ArgVec; + BEGIN + IF n < ArgCount THEN + av := SYSTEM.VAL(ArgVec, ArgVector); + COPY(av[n]^, val) + END + END GetArg; + + PROCEDURE GetIntArg*(n: INTEGER; VAR val: LONGINT); + VAR s: ARRAY 64 OF CHAR; k, d, i: LONGINT; + BEGIN + s := ""; GetArg(n, s); i := 0; + IF s[0] = "-" THEN i := 1 END ; + k := 0; d := ORD(s[i]) - ORD("0"); + WHILE (d >= 0 ) & (d <= 9) DO k := k*10 + d; INC(i); d := ORD(s[i]) - ORD("0") END ; + IF s[0] = "-" THEN k := -k; DEC(i) END ; + IF i > 0 THEN val := k END + END GetIntArg; + + PROCEDURE ArgPos*(s: ARRAY OF CHAR): INTEGER; + VAR i: INTEGER; arg: ARRAY 256 OF CHAR; + BEGIN + i := 0; GetArg(i, arg); + WHILE (i < ArgCount) & (s # arg) DO INC(i); GetArg(i, arg) END ; + RETURN i + END ArgPos; + + PROCEDURE Append(VAR a: ARRAY OF CHAR; b: ARRAY OF CHAR); VAR i, j: INTEGER; @@ -95,7 +155,7 @@ MODULE Modules; (* jt 6.1.96 *) PROCEDURE errch(c: CHAR); (* Here we favour simplicity over efficiency, so no buffering. *) VAR e: Platform.ErrorCode; - BEGIN e := Platform.Write(1, SYSTEM.ADR(c), 1) + BEGIN e := Platform.Write(Platform.StdOut, SYSTEM.ADR(c), 1) END errch; PROCEDURE errstring(s: ARRAY OF CHAR); diff --git a/src/runtime/Oberon.Mod b/src/runtime/Oberon.Mod index fbc3abd4..c67dcf17 100644 --- a/src/runtime/Oberon.Mod +++ b/src/runtime/Oberon.Mod @@ -2,7 +2,7 @@ MODULE Oberon; (* this version should not have dependency on graphics -- noch *) - IMPORT Platform, Texts, Out; + IMPORT Platform, Modules, Texts, Out; TYPE ParList* = POINTER TO ParRec; @@ -38,11 +38,11 @@ PROCEDURE PopulateParams; BEGIN Texts.OpenWriter(W); i := 1; (* skip program name *) - WHILE i < Platform.ArgCount DO - Platform.GetArg(i, str); Texts.WriteString(W, str); Texts.Write(W, " "); + WHILE i < Modules.ArgCount DO + Modules.GetArg(i, str); Texts.WriteString(W, str); Texts.Write(W, " "); INC(i) END; - Texts.Append (Par^.text, W.buf); + Texts.Append(Par^.text, W.buf); END PopulateParams; PROCEDURE GetSelection*(VAR text: Texts.Text; VAR beg, end, time: LONGINT); diff --git a/src/runtime/Platformunix.Mod b/src/runtime/Platformunix.Mod index fa22d7ee..79ae5e7f 100644 --- a/src/runtime/Platformunix.Mod +++ b/src/runtime/Platformunix.Mod @@ -7,7 +7,6 @@ CONST StdErr- = 2; TYPE - HaltProcedure = PROCEDURE(n: SYSTEM.INT32); SignalHandler = PROCEDURE(signal: SYSTEM.INT32); ErrorCode* = INTEGER; @@ -19,21 +18,13 @@ TYPE mtime: LONGINT; (* File modification time, value is system dependent *) END; - EnvPtr = POINTER TO ARRAY 1024 OF CHAR; - ArgPtr = POINTER TO ARRAY 1024 OF CHAR; - ArgVec = POINTER TO ARRAY 1024 OF ArgPtr; - ArgVecPtr = POINTER TO ARRAY 1 OF SYSTEM.ADDRESS; - - VAR LittleEndian-: BOOLEAN; - MainStackFrame-: SYSTEM.ADDRESS; PID-: INTEGER; (* Note: Must be updated by Fork implementation *) CWD-: ARRAY 256 OF CHAR; ArgCount-: INTEGER; ArgVector-: SYSTEM.ADDRESS; - HaltHandler: HaltProcedure; TimeStart: LONGINT; SeekSet-: INTEGER; @@ -118,72 +109,24 @@ PROCEDURE OSFree*(address: SYSTEM.ADDRESS); BEGIN free(address) END OSFree; -(* Program startup *) - -PROCEDURE -ExternInitHeap "extern void Heap_InitHeap();"; -PROCEDURE -HeapInitHeap() "Heap_InitHeap()"; - -PROCEDURE Init*(argc: SYSTEM.INT32; argvadr: SYSTEM.ADDRESS); -VAR av: ArgVecPtr; -BEGIN - MainStackFrame := argvadr; - ArgCount := SYSTEM.VAL(INTEGER, argc); - av := SYSTEM.VAL(ArgVecPtr, argvadr); - ArgVector := av[0]; - - (* This function (Platform.Init) is called at program startup BEFORE any - modules have been initalised. In turn we must initialise the heap - before module startup (xxx__init) code is run. *) - HeapInitHeap(); -END Init; - - - - (* Program arguments and environment access *) -PROCEDURE -getenv(var: ARRAY OF CHAR): EnvPtr "(Platform_EnvPtr)getenv((char*)var)"; +PROCEDURE -getenv(var: ARRAY OF CHAR): SYSTEM.ADDRESS "getenv((char*)var)"; PROCEDURE getEnv*(var: ARRAY OF CHAR; VAR val: ARRAY OF CHAR): BOOLEAN; - VAR p: EnvPtr; +TYPE EnvPtr = POINTER TO ARRAY 1024 OF CHAR; +VAR p: EnvPtr; BEGIN - p := getenv(var); + p := SYSTEM.VAL(EnvPtr, getenv(var)); IF p # NIL THEN COPY(p^, val) END; RETURN p # NIL; END getEnv; PROCEDURE GetEnv*(var: ARRAY OF CHAR; VAR val: ARRAY OF CHAR); BEGIN - IF ~ getEnv(var, val) THEN val[0] := 0X END; + IF ~getEnv(var, val) THEN val[0] := 0X END; END GetEnv; -PROCEDURE GetArg*(n: INTEGER; VAR val: ARRAY OF CHAR); - VAR av: ArgVec; -BEGIN - IF n < ArgCount THEN - av := SYSTEM.VAL(ArgVec,ArgVector); - COPY(av[n]^, val) - END -END GetArg; - -PROCEDURE GetIntArg*(n: INTEGER; VAR val: LONGINT); - VAR s: ARRAY 64 OF CHAR; k, d, i: LONGINT; -BEGIN - s := ""; GetArg(n, s); i := 0; - IF s[0] = "-" THEN i := 1 END ; - k := 0; d := ORD(s[i]) - ORD("0"); - WHILE (d >= 0 ) & (d <= 9) DO k := k*10 + d; INC(i); d := ORD(s[i]) - ORD("0") END ; - IF s[0] = "-" THEN k := -k; DEC(i) END ; - IF i > 0 THEN val := k END -END GetIntArg; - -PROCEDURE ArgPos*(s: ARRAY OF CHAR): INTEGER; - VAR i: INTEGER; arg: ARRAY 256 OF CHAR; -BEGIN - i := 0; GetArg(i, arg); - WHILE (i < ArgCount) & (s # arg) DO INC(i); GetArg(i, arg) END ; - RETURN i -END ArgPos; diff --git a/src/runtime/Platformwindows.Mod b/src/runtime/Platformwindows.Mod index 808e2e0d..44337f22 100644 --- a/src/runtime/Platformwindows.Mod +++ b/src/runtime/Platformwindows.Mod @@ -8,7 +8,6 @@ IMPORT SYSTEM; TYPE - HaltProcedure = PROCEDURE(n: SYSTEM.INT32); SignalHandler = PROCEDURE(signal: SYSTEM.INT32); ErrorCode* = INTEGER; @@ -22,22 +21,10 @@ TYPE mtimelow: LONGINT; (* File modification time, value is system dependent *) END; - EnvPtr = POINTER TO ARRAY 1024 OF CHAR; - ArgPtr = POINTER TO ARRAY 1024 OF CHAR; - ArgVec = POINTER TO ARRAY 1024 OF ArgPtr; - ArgVecPtr = POINTER TO ARRAY 1 OF SYSTEM.ADDRESS; - - VAR LittleEndian-: BOOLEAN; - MainStackFrame-: SYSTEM.ADDRESS; - HaltCode-: LONGINT; PID-: INTEGER; (* Note: Must be updated by Fork implementation *) CWD-: ARRAY 4096 OF CHAR; - ArgCount-: INTEGER; - - ArgVector-: SYSTEM.ADDRESS; - HaltHandler: HaltProcedure; TimeStart: LONGINT; SeekSet-: INTEGER; @@ -117,29 +104,6 @@ PROCEDURE OSFree*(address: SYSTEM.ADDRESS); BEGIN free(address) END OSFree; -(* Program startup *) - -PROCEDURE -ExternInitHeap "extern void Heap_InitHeap();"; -PROCEDURE -HeapInitHeap() "Heap_InitHeap()"; - -PROCEDURE Init*(argc: SYSTEM.INT32; argvadr: SYSTEM.ADDRESS); -VAR av: ArgVecPtr; -BEGIN - MainStackFrame := argvadr; - ArgCount := SYSTEM.VAL(INTEGER, argc); - av := SYSTEM.VAL(ArgVecPtr, argvadr); - ArgVector := av[0]; - HaltCode := -128; - - (* This function (Platform.Init) is called at program startup BEFORE any - modules have been initalised. In turn we must initialise the heap - before module startup (xxx__init) code is run. *) - HeapInitHeap(); -END Init; - - - - (* Program arguments and environmet access *) PROCEDURE -getenv(name: ARRAY OF CHAR; VAR buf: ARRAY OF CHAR): INTEGER @@ -164,34 +128,6 @@ BEGIN IF ~getEnv(var, val) THEN val[0] := 0X END; END GetEnv; -PROCEDURE GetArg*(n: INTEGER; VAR val: ARRAY OF CHAR); - VAR av: ArgVec; -BEGIN - IF n < ArgCount THEN - av := SYSTEM.VAL(ArgVec,ArgVector); - COPY(av[n]^, val) - END -END GetArg; - -PROCEDURE GetIntArg*(n: INTEGER; VAR val: LONGINT); - VAR s: ARRAY 64 OF CHAR; k, d, i: LONGINT; -BEGIN - s := ""; GetArg(n, s); i := 0; - IF s[0] = "-" THEN i := 1 END ; - k := 0; d := ORD(s[i]) - ORD("0"); - WHILE (d >= 0 ) & (d <= 9) DO k := k*10 + d; INC(i); d := ORD(s[i]) - ORD("0") END ; - IF s[0] = "-" THEN k := -k; DEC(i) END ; - IF i > 0 THEN val := k END -END GetIntArg; - -PROCEDURE ArgPos*(s: ARRAY OF CHAR): INTEGER; - VAR i: INTEGER; arg: ARRAY 256 OF CHAR; -BEGIN - i := 0; GetArg(i, arg); - WHILE (i < ArgCount) & (s # arg) DO INC(i); GetArg(i, arg) END ; - RETURN i -END ArgPos; - @@ -559,8 +495,6 @@ PROCEDURE -getpid(): INTEGER "(INTEGER)GetCurrentProcessId()"; BEGIN TestLittleEndian; - HaltCode := -128; - HaltHandler := NIL; TimeStart := 0; TimeStart := Time(); CWD := ""; getCurrentDirectory(CWD); PID := getpid(); diff --git a/src/runtime/SYSTEM.h b/src/runtime/SYSTEM.h index ff4c724d..f6936068 100644 --- a/src/runtime/SYSTEM.h +++ b/src/runtime/SYSTEM.h @@ -258,10 +258,10 @@ extern void Heap_INCREF(); // Main module initialisation, registration and finalisation -extern void Platform_Init(INT32 argc, ADDRESS argv); +extern void Modules_Init(INT32 argc, ADDRESS argv); extern void Heap_FINALL(); -#define __INIT(argc, argv) static void *m; Platform_Init(argc, (ADDRESS)&argv); +#define __INIT(argc, argv) static void *m; Modules_Init(argc, (ADDRESS)&argv); #define __REGMAIN(name, enum) m = Heap_REGMOD((CHAR*)name,enum) #define __FINI Heap_FINALL(); return 0 diff --git a/src/tools/browser/BrowserCmd.Mod b/src/tools/browser/BrowserCmd.Mod index d463c22d..14df830f 100644 --- a/src/tools/browser/BrowserCmd.Mod +++ b/src/tools/browser/BrowserCmd.Mod @@ -3,7 +3,7 @@ MODULE BrowserCmd; (* RC 29.10.93 *) (* object model 4.12.93, command line ver IMPORT OPM, OPS, OPT, OPV, Texts, Strings, Files, Out, - Oberon, Platform, SYSTEM, Configuration; + Oberon, Modules, SYSTEM, Configuration; CONST OptionChar = "-"; @@ -265,13 +265,13 @@ MODULE BrowserCmd; (* RC 29.10.93 *) (* object model 4.12.93, command line ver PROCEDURE ShowDef*; VAR S, vname, name: OPS.Name; BEGIN - option := 0X; Platform.GetArg(1, S); - IF Platform.ArgCount > 2 THEN - IF S[0] = OptionChar THEN option := S[1]; Platform.GetArg(2, S) - ELSE Platform.GetArg(2, vname); option := vname[1] + option := 0X; Modules.GetArg(1, S); + IF Modules.ArgCount > 2 THEN + IF S[0] = OptionChar THEN option := S[1]; Modules.GetArg(2, S) + ELSE Modules.GetArg(2, vname); option := vname[1] END END; - IF Platform.ArgCount >= 2 THEN + IF Modules.ArgCount >= 2 THEN Ident(S, name); OPT.Init(name, {}); OPT.SelfName := "AvoidErr154"; WModule(name, Oberon.Log); From c65b89daf36f4023c6e740ed9a4f224b7467a234 Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 1 Dec 2016 18:39:02 +0000 Subject: [PATCH 360/580] Update confidence tests for arg handling move. Remove unused vars in Platform. --- src/runtime/Platformunix.Mod | 4 ---- src/runtime/Platformwindows.Mod | 2 -- src/test/confidence/lola/lola.Mod | 4 ++-- src/test/confidence/signal/signal.mod | 4 ++-- 4 files changed, 4 insertions(+), 10 deletions(-) diff --git a/src/runtime/Platformunix.Mod b/src/runtime/Platformunix.Mod index 79ae5e7f..ff03a960 100644 --- a/src/runtime/Platformunix.Mod +++ b/src/runtime/Platformunix.Mod @@ -22,9 +22,6 @@ VAR LittleEndian-: BOOLEAN; PID-: INTEGER; (* Note: Must be updated by Fork implementation *) CWD-: ARRAY 256 OF CHAR; - ArgCount-: INTEGER; - - ArgVector-: SYSTEM.ADDRESS; TimeStart: LONGINT; SeekSet-: INTEGER; @@ -426,7 +423,6 @@ PROCEDURE -getpid(): INTEGER "(INTEGER)getpid()"; BEGIN TestLittleEndian; - HaltHandler := NIL; TimeStart := 0; TimeStart := Time(); PID := getpid(); IF getcwd(CWD) = NIL THEN CWD := "" END; diff --git a/src/runtime/Platformwindows.Mod b/src/runtime/Platformwindows.Mod index 44337f22..4087c75b 100644 --- a/src/runtime/Platformwindows.Mod +++ b/src/runtime/Platformwindows.Mod @@ -35,8 +35,6 @@ VAR StdOut-: FileHandle; StdErr-: FileHandle; - InterruptHandler: SignalHandler; - NL-: ARRAY 3 OF CHAR; (* Platform specific newline representation *) diff --git a/src/test/confidence/lola/lola.Mod b/src/test/confidence/lola/lola.Mod index eccebbfd..8f7faaa3 100644 --- a/src/test/confidence/lola/lola.Mod +++ b/src/test/confidence/lola/lola.Mod @@ -1,7 +1,7 @@ MODULE Lola; (* Command line runner for Lola to verilog compilation *) - IMPORT LSB, LSC, LSV, Platform, Console; + IMPORT LSB, LSC, LSV, Modules, Console; BEGIN - IF Platform.ArgCount < 3 THEN + IF Modules.ArgCount < 3 THEN Console.String("Lola - compile lola source to verilog source."); Console.Ln; Console.Ln; Console.String("usage:"); Console.Ln; Console.Ln; Console.String(" lola lola-source-file verilog-source-file"); Console.Ln; Console.Ln; diff --git a/src/test/confidence/signal/signal.mod b/src/test/confidence/signal/signal.mod index 3a897392..294345f2 100644 --- a/src/test/confidence/signal/signal.mod +++ b/src/test/confidence/signal/signal.mod @@ -1,6 +1,6 @@ (* Test that interrupt and quit are handled correctly. *) MODULE SignalTest; -IMPORT Console, Platform, Files, SYSTEM; +IMPORT Console, Platform, Modules, Files, SYSTEM; VAR result: Files.File; rider: Files.Rider; @@ -42,7 +42,7 @@ END Take5; BEGIN result := Files.New("result"); Files.Set(rider, result, 0); - IF Platform.ArgCount > 1 THEN + IF Modules.ArgCount > 1 THEN Platform.SetInterruptHandler(handle); Platform.SetQuitHandler(handle) END; From 62c6d5c2a45ea05d4cf13f69933ffe98d4d9cf84 Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 1 Dec 2016 18:40:01 +0000 Subject: [PATCH 361/580] Update C bootstrap source. --- bootstrap/SYSTEM.h | 4 +- bootstrap/unix-44/Compiler.c | 2 +- bootstrap/unix-44/Configuration.c | 4 +- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Files.c | 8 +-- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 8 +-- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 83 +++++++++++++++++++++++- bootstrap/unix-44/Modules.h | 9 ++- bootstrap/unix-44/OPB.c | 20 ++---- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 2 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 22 ++++--- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 10 +-- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 8 +-- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 14 +++- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Out.c | 2 +- bootstrap/unix-44/Out.h | 2 +- bootstrap/unix-44/Platform.c | 95 ++-------------------------- bootstrap/unix-44/Platform.h | 9 +-- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 6 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/VT100.c | 2 +- bootstrap/unix-44/VT100.h | 2 +- bootstrap/unix-44/extTools.c | 2 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-48/Compiler.c | 2 +- bootstrap/unix-48/Configuration.c | 4 +- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Files.c | 8 +-- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 8 +-- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 83 +++++++++++++++++++++++- bootstrap/unix-48/Modules.h | 9 ++- bootstrap/unix-48/OPB.c | 20 ++---- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 2 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 22 ++++--- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 10 +-- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 8 +-- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 14 +++- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Out.c | 2 +- bootstrap/unix-48/Out.h | 2 +- bootstrap/unix-48/Platform.c | 95 ++-------------------------- bootstrap/unix-48/Platform.h | 9 +-- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 6 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/VT100.c | 2 +- bootstrap/unix-48/VT100.h | 2 +- bootstrap/unix-48/extTools.c | 2 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-88/Compiler.c | 2 +- bootstrap/unix-88/Configuration.c | 4 +- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Files.c | 8 +-- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 8 +-- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 83 +++++++++++++++++++++++- bootstrap/unix-88/Modules.h | 9 ++- bootstrap/unix-88/OPB.c | 20 ++---- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 2 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 22 ++++--- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 10 +-- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 8 +-- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 14 +++- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Out.c | 2 +- bootstrap/unix-88/Out.h | 2 +- bootstrap/unix-88/Platform.c | 95 ++-------------------------- bootstrap/unix-88/Platform.h | 9 +-- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 6 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/VT100.c | 2 +- bootstrap/unix-88/VT100.h | 2 +- bootstrap/unix-88/extTools.c | 2 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/windows-48/Compiler.c | 2 +- bootstrap/windows-48/Configuration.c | 4 +- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Files.c | 8 +-- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 8 +-- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 85 ++++++++++++++++++++++++- bootstrap/windows-48/Modules.h | 9 ++- bootstrap/windows-48/OPB.c | 20 ++---- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 2 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 22 ++++--- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 10 +-- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 8 +-- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 14 +++- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Out.c | 2 +- bootstrap/windows-48/Out.h | 2 +- bootstrap/windows-48/Platform.c | 92 +-------------------------- bootstrap/windows-48/Platform.h | 10 +-- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 6 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/VT100.c | 2 +- bootstrap/windows-48/VT100.h | 2 +- bootstrap/windows-48/extTools.c | 2 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-88/Compiler.c | 2 +- bootstrap/windows-88/Configuration.c | 4 +- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Files.c | 8 +-- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 8 +-- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 85 ++++++++++++++++++++++++- bootstrap/windows-88/Modules.h | 9 ++- bootstrap/windows-88/OPB.c | 20 ++---- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 2 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 22 ++++--- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 10 +-- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 8 +-- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 14 +++- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Out.c | 2 +- bootstrap/windows-88/Out.h | 2 +- bootstrap/windows-88/Platform.c | 92 +-------------------------- bootstrap/windows-88/Platform.h | 10 +-- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 6 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/VT100.c | 2 +- bootstrap/windows-88/VT100.h | 2 +- bootstrap/windows-88/extTools.c | 2 +- bootstrap/windows-88/extTools.h | 2 +- 186 files changed, 854 insertions(+), 870 deletions(-) diff --git a/bootstrap/SYSTEM.h b/bootstrap/SYSTEM.h index ff4c724d..f6936068 100644 --- a/bootstrap/SYSTEM.h +++ b/bootstrap/SYSTEM.h @@ -258,10 +258,10 @@ extern void Heap_INCREF(); // Main module initialisation, registration and finalisation -extern void Platform_Init(INT32 argc, ADDRESS argv); +extern void Modules_Init(INT32 argc, ADDRESS argv); extern void Heap_FINALL(); -#define __INIT(argc, argv) static void *m; Platform_Init(argc, (ADDRESS)&argv); +#define __INIT(argc, argv) static void *m; Modules_Init(argc, (ADDRESS)&argv); #define __REGMAIN(name, enum) m = Heap_REGMOD((CHAR*)name,enum) #define __FINI Heap_FINALL(); return 0 diff --git a/bootstrap/unix-44/Compiler.c b/bootstrap/unix-44/Compiler.c index 29524a91..e59d7615 100644 --- a/bootstrap/unix-44/Compiler.c +++ b/bootstrap/unix-44/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index 54214f70..01281cfc 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index 1e6381e9..98f85767 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 763569cc..f39534fc 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -237,7 +237,7 @@ static void Files_Deregister (CHAR *name, ADDRESS name__len) if (osfile != NIL) { __ASSERT(!osfile->tempFile, 0); __ASSERT(osfile->fd >= 0, 0); - __COPY(osfile->workName, osfile->registerName, 101); + __MOVE(osfile->workName, osfile->registerName, 101); Files_GetTempName(osfile->registerName, 101, (void*)osfile->workName, 101); osfile->tempFile = 1; osfile->state = 0; @@ -262,7 +262,7 @@ static void Files_Create (Files_File f) } else { __ASSERT(f->state == 2, 0); Files_Deregister(f->registerName, 101); - __COPY(f->registerName, f->workName, 101); + __MOVE(f->registerName, f->workName, 101); f->registerName[0] = 0x00; f->tempFile = 0; } @@ -823,7 +823,7 @@ void Files_Register (Files_File f) if (errcode != 0) { Files_Err((CHAR*)"Couldn't rename temp name as register name", 43, f, errcode); } - __COPY(f->registerName, f->workName, 101); + __MOVE(f->registerName, f->workName, 101); f->registerName[0] = 0x00; f->tempFile = 0; } diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index 28a97c05..e124b950 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index af8fd777..b6abc8f3 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -105,12 +105,12 @@ static void Heap_Sift (INT32 l, INT32 r, INT32 *a, ADDRESS a__len); export void Heap_Unlock (void); extern void *Heap__init(); -extern ADDRESS Platform_MainStackFrame; +extern ADDRESS Modules_MainStackFrame; extern ADDRESS Platform_OSAllocate(ADDRESS size); #define Heap_HeapModuleInit() Heap__init() #define Heap_ModulesHalt(code) Modules_Halt(code) +#define Heap_ModulesMainStackFrame() Modules_MainStackFrame #define Heap_OSAllocate(size) Platform_OSAllocate(size) -#define Heap_PlatformMainStackFrame() Platform_MainStackFrame void Heap_Lock (void) { @@ -599,7 +599,7 @@ static void Heap_MarkStack (INT32 n, INT32 *cand, ADDRESS cand__len) if (n == 0) { nofcand = 0; sp = (ADDRESS)&frame; - stack0 = Heap_PlatformMainStackFrame(); + stack0 = Heap_ModulesMainStackFrame(); inc = (ADDRESS)&align.p - (ADDRESS)&align; if (sp > stack0) { inc = -inc; diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index cc058553..82ebd04d 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index 9aedc826..0290d664 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -43,24 +43,105 @@ typedef export INT16 Modules_res; export CHAR Modules_resMsg[256]; export Modules_ModuleName Modules_imported, Modules_importing; +export INT32 Modules_MainStackFrame; +export INT16 Modules_ArgCount; +export INT32 Modules_ArgVector; export ADDRESS *Modules_ModuleDesc__typ; export ADDRESS *Modules_CmdDesc__typ; static void Modules_Append (CHAR *a, ADDRESS a__len, CHAR *b, ADDRESS b__len); +export INT16 Modules_ArgPos (CHAR *s, ADDRESS s__len); export void Modules_AssertFail (INT32 code); static void Modules_DisplayHaltCode (INT32 code); export void Modules_Free (CHAR *name, ADDRESS name__len, BOOLEAN all); +export void Modules_GetArg (INT16 n, CHAR *val, ADDRESS val__len); +export void Modules_GetIntArg (INT16 n, INT32 *val); export void Modules_Halt (INT32 code); +export void Modules_Init (INT32 argc, INT32 argvadr); export Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, ADDRESS name__len); export Modules_Module Modules_ThisMod (CHAR *name, ADDRESS name__len); static void Modules_errch (CHAR c); static void Modules_errint (INT32 l); static void Modules_errstring (CHAR *s, ADDRESS s__len); +extern void Heap_InitHeap(); +extern void *Modules__init(void); +#define Modules_InitHeap() Heap_InitHeap() +#define Modules_ModulesInit() Modules__init() #define Modules_modules() (Modules_Module)Heap_modules #define Modules_setmodules(m) Heap_modules = m +typedef + INT32 (*ArgVecPtr__14)[1]; + +void Modules_Init (INT32 argc, INT32 argvadr) +{ + ArgVecPtr__14 av = NIL; + Modules_MainStackFrame = argvadr; + Modules_ArgCount = __VAL(INT16, argc); + av = (ArgVecPtr__14)(ADDRESS)argvadr; + Modules_ArgVector = (*av)[0]; + Modules_InitHeap(); + Modules_ModulesInit(); +} + +typedef + CHAR (*ArgPtr__9)[1024]; + +typedef + ArgPtr__9 (*ArgVec__10)[1024]; + +void Modules_GetArg (INT16 n, CHAR *val, ADDRESS val__len) +{ + ArgVec__10 av = NIL; + if (n < Modules_ArgCount) { + av = (ArgVec__10)(ADDRESS)Modules_ArgVector; + __COPY(*(*av)[__X(n, 1024)], val, val__len); + } +} + +void Modules_GetIntArg (INT16 n, INT32 *val) +{ + CHAR s[64]; + INT32 k, d, i; + s[0] = 0x00; + Modules_GetArg(n, (void*)s, 64); + i = 0; + if (s[0] == '-') { + i = 1; + } + k = 0; + d = (INT16)s[__X(i, 64)] - 48; + while ((d >= 0 && d <= 9)) { + k = k * 10 + d; + i += 1; + d = (INT16)s[__X(i, 64)] - 48; + } + if (s[0] == '-') { + k = -k; + i -= 1; + } + if (i > 0) { + *val = k; + } +} + +INT16 Modules_ArgPos (CHAR *s, ADDRESS s__len) +{ + INT16 i; + CHAR arg[256]; + __DUP(s, s__len, CHAR); + i = 0; + Modules_GetArg(i, (void*)arg, 256); + while ((i < Modules_ArgCount && __STRCMP(s, arg) != 0)) { + i += 1; + Modules_GetArg(i, (void*)arg, 256); + } + __DEL(s); + return i; +} + static void Modules_Append (CHAR *a, ADDRESS a__len, CHAR *b, ADDRESS b__len) { INT16 i, j; diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index 568db414..3ab94701 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h @@ -39,13 +39,20 @@ typedef import INT16 Modules_res; import CHAR Modules_resMsg[256]; import Modules_ModuleName Modules_imported, Modules_importing; +import INT32 Modules_MainStackFrame; +import INT16 Modules_ArgCount; +import INT32 Modules_ArgVector; import ADDRESS *Modules_ModuleDesc__typ; import ADDRESS *Modules_CmdDesc__typ; +import INT16 Modules_ArgPos (CHAR *s, ADDRESS s__len); import void Modules_AssertFail (INT32 code); import void Modules_Free (CHAR *name, ADDRESS name__len, BOOLEAN all); +import void Modules_GetArg (INT16 n, CHAR *val, ADDRESS val__len); +import void Modules_GetIntArg (INT16 n, INT32 *val); import void Modules_Halt (INT32 code); +import void Modules_Init (INT32 argc, INT32 argvadr); import Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, ADDRESS name__len); import Modules_Module Modules_ThisMod (CHAR *name, ADDRESS name__len); import void *Modules__init(void); diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index 2e03b5fc..d9e826b8 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -253,7 +253,7 @@ OPT_Node OPB_NewString (OPS_String str, INT64 len) x->conval->intval = -1; x->conval->intval2 = OPM_Longint(len); x->conval->ext = OPT_NewExt(); - __COPY(str, *x->conval->ext, 256); + __MOVE(str, *x->conval->ext, 256); return x; } @@ -1624,23 +1624,19 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) g = 8; } if (x == y) { + } else if ((((y->comp == 2 && y->BaseTyp == x->BaseTyp)) && y->n <= x->n)) { + } else if ((y->comp == 3 && y->BaseTyp == x->BaseTyp)) { } else if (x->BaseTyp == OPT_chartyp) { if (g == 8) { if (ynode->conval->intval2 > x->n) { OPB_err(114); } - } else if ((__IN(y->comp, 0x0c, 32) && y->BaseTyp == OPT_chartyp)) { } else { OPB_err(113); } } else { OPB_err(113); } - } else if ((x->comp == 3 && x->BaseTyp == OPT_chartyp)) { - if ((__IN(y->comp, 0x0c, 32) && y->BaseTyp == OPT_chartyp)) { - } else { - OPB_err(113); - } } else if (x->comp == 4) { if (x == y) { } else if (y->comp == 4) { @@ -2536,7 +2532,6 @@ void OPB_Return (OPT_Node *x, OPT_Object proc) void OPB_Assign (OPT_Node *x, OPT_Node y) { OPT_Node z = NIL; - INT8 subcl; if ((*x)->class >= 7) { OPB_err(56); } @@ -2562,13 +2557,8 @@ void OPB_Assign (OPT_Node *x, OPT_Node y) y->conval->intval = 0; OPB_Index(&*x, OPB_NewIntConst(0)); } - if ((((((__IN((*x)->typ->comp, 0x0c, 32) && (*x)->typ->BaseTyp == OPT_chartyp)) && __IN(y->typ->comp, 0x0c, 32))) && y->typ->BaseTyp == OPT_chartyp)) { - subcl = 18; - } else { - subcl = 0; - } OPB_BindNodes(19, OPT_notyp, &*x, y); - (*x)->subcl = subcl; + (*x)->subcl = 0; } void OPB_Inittd (OPT_Node *inittd, OPT_Node *last, OPT_Struct typ) diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index 6641207d..2c396170 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index fd11366a..5f4dc826 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index 4eff8cf5..f9bc06a4 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 58701bfc..1732c950 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -8,6 +8,7 @@ #include "SYSTEM.h" #include "Configuration.h" #include "Files.h" +#include "Modules.h" #include "Out.h" #include "Platform.h" #include "Strings.h" @@ -266,7 +267,7 @@ static void OPM_ScanOptions (CHAR *s, ADDRESS s__len) BOOLEAN OPM_OpenPar (void) { CHAR s[256]; - if (Platform_ArgCount == 1) { + if (Modules_ArgCount == 1) { OPM_LogWLn(); OPM_LogWStr((CHAR*)"Oberon-2 compiler v", 20); OPM_LogWStr(Configuration_versionLong, 75); @@ -362,16 +363,16 @@ BOOLEAN OPM_OpenPar (void) OPM_Options = 0xa9; OPM_S = 1; s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, 256); + Modules_GetArg(OPM_S, (void*)s, 256); while (s[0] == '-') { OPM_ScanOptions(s, 256); OPM_S += 1; s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, 256); + Modules_GetArg(OPM_S, (void*)s, 256); } OPM_GlobalAddressSize = OPM_AddressSize; OPM_GlobalAlignment = OPM_Alignment; - __COPY(OPM_Model, OPM_GlobalModel, 10); + __MOVE(OPM_Model, OPM_GlobalModel, 10); OPM_GlobalOptions = OPM_Options; return 1; } @@ -410,16 +411,16 @@ void OPM_InitOptions (void) CHAR searchpath[1024], modules[1024]; CHAR MODULES[1024]; OPM_Options = OPM_GlobalOptions; - __COPY(OPM_GlobalModel, OPM_Model, 10); + __MOVE(OPM_GlobalModel, OPM_Model, 10); OPM_Alignment = OPM_GlobalAlignment; OPM_AddressSize = OPM_GlobalAddressSize; s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, 256); + Modules_GetArg(OPM_S, (void*)s, 256); while (s[0] == '-') { OPM_ScanOptions(s, 256); OPM_S += 1; s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, 256); + Modules_GetArg(OPM_S, (void*)s, 256); } if (__IN(15, OPM_Options, 32)) { OPM_Options |= __SETOF(10,32); @@ -472,11 +473,11 @@ void OPM_Init (BOOLEAN *done, CHAR *mname, ADDRESS mname__len) CHAR s[256]; *done = 0; OPM_curpos = 0; - if (OPM_S >= Platform_ArgCount) { + if (OPM_S >= Modules_ArgCount) { return; } s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, 256); + Modules_GetArg(OPM_S, (void*)s, 256); __NEW(T, Texts_TextDesc); Texts_Open(T, s, 256); OPM_LogWStr(s, 256); @@ -1070,6 +1071,7 @@ export void *OPM__init(void) __DEFMOD; __MODULE_IMPORT(Configuration); __MODULE_IMPORT(Files); + __MODULE_IMPORT(Modules); __MODULE_IMPORT(Out); __MODULE_IMPORT(Platform); __MODULE_IMPORT(Strings); diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index 4dd3d03b..979995c8 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index d4922137..69624c1f 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -527,7 +527,7 @@ static void OPP_selector (OPT_Node *x) } else if (OPP_sym == 18) { OPS_Get(&OPP_sym); if (OPP_sym == 38) { - __COPY(OPS_name, name, 256); + __MOVE(OPS_name, name, 256); OPS_Get(&OPP_sym); if ((*x)->typ != NIL) { if ((*x)->typ->form == 11) { @@ -867,7 +867,7 @@ static void OPP_Receiver (INT8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct } else { *mode = 1; } - __COPY(OPS_name, name, 256); + __MOVE(OPS_name, name, 256); OPP_CheckSym(38); OPP_CheckSym(20); if (OPP_sym == 38) { @@ -1030,7 +1030,7 @@ static void TProcDecl__23 (void) } OPP_Receiver(&objMode, objName, &objTyp, &recTyp); if (OPP_sym == 38) { - __COPY(OPS_name, *ProcedureDeclaration__16_s->name, 256); + __MOVE(OPS_name, *ProcedureDeclaration__16_s->name, 256); OPP_CheckMark(&*ProcedureDeclaration__16_s->vis); OPT_FindField(*ProcedureDeclaration__16_s->name, recTyp, &*ProcedureDeclaration__16_s->fwd); OPT_FindField(*ProcedureDeclaration__16_s->name, recTyp->BaseTyp, &baseProc); @@ -1129,7 +1129,7 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) TProcDecl__23(); } else if (OPP_sym == 38) { OPT_Find(&fwd); - __COPY(OPS_name, name, 256); + __MOVE(OPS_name, name, 256); OPP_CheckMark(&vis); if ((vis != 0 && mode == 6)) { mode = 7; diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index 2814e733..b748e221 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index 7218afe1..eee78d80 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index a860454b..7ab70899 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index 7b7f6fbc..40f61458 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -434,8 +434,8 @@ void OPT_Init (OPS_Name name, UINT32 opt) OPT_topScope = OPT_universe; OPT_OpenScope(0, NIL); OPT_SYSimported = 0; - __COPY(name, OPT_SelfName, 256); - __COPY(name, OPT_topScope->name, 256); + __MOVE(name, OPT_SelfName, 256); + __MOVE(name, OPT_topScope->name, 256); OPT_GlbMod[0] = OPT_topScope; OPT_nofGmod = 1; OPT_newsf = __IN(4, opt, 32); @@ -1186,7 +1186,7 @@ static void OPT_InStruct (OPT_Struct *typ) } *typ = OPT_NewStr(0, 1); } else { - __COPY(name, obj->name, 256); + __MOVE(name, obj->name, 256); OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, 64)]->right, &old); if (old != NIL) { OPT_FPrintObj(old); diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index 86256024..67996e8e 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index eb5ad767..fb6ac690 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -163,7 +163,7 @@ static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exporte } scope = obj->scope; scope->leaf = 1; - __COPY(obj->name, scope->name, 256); + __MOVE(obj->name, scope->name, 256); OPV_Stamp(scope->name); if (mode == 9) { obj->adr = 1; @@ -1286,7 +1286,17 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPM_WriteString((CHAR*)", ", 3); if (r->typ == OPT_stringtyp) { OPM_WriteInt(r->conval->intval2); + } else if (r->typ->comp == 3) { + OPM_WriteString((CHAR*)"__X(", 5); + OPC_Len(r->obj, r->typ, 0); + OPM_WriteString((CHAR*)" * ", 4); + OPM_WriteInt(r->typ->BaseTyp->size); + OPM_WriteString((CHAR*)", ", 3); + OPM_WriteInt(l->typ->size); + OPM_Write(')'); } else { + __ASSERT(r->typ->comp == 2, 0); + __ASSERT(r->typ->size <= l->typ->size, 0); OPM_WriteInt(r->typ->size); } OPM_Write(')'); diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index 9a8653a0..43aaf24a 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Out.c b/bootstrap/unix-44/Out.c index 1508a8bb..a03cf592 100644 --- a/bootstrap/unix-44/Out.c +++ b/bootstrap/unix-44/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Out.h b/bootstrap/unix-44/Out.h index b273390e..27f2c9bb 100644 --- a/bootstrap/unix-44/Out.h +++ b/bootstrap/unix-44/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 9a2555d2..1fc766bf 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -7,37 +7,18 @@ #include "SYSTEM.h" -typedef - CHAR (*Platform_ArgPtr)[1024]; - -typedef - Platform_ArgPtr (*Platform_ArgVec)[1024]; - -typedef - INT32 (*Platform_ArgVecPtr)[1]; - -typedef - CHAR (*Platform_EnvPtr)[1024]; - typedef struct Platform_FileIdentity { INT32 volume, index, mtime; } Platform_FileIdentity; -typedef - void (*Platform_HaltProcedure)(INT32); - typedef void (*Platform_SignalHandler)(INT32); export BOOLEAN Platform_LittleEndian; -export INT32 Platform_MainStackFrame; export INT16 Platform_PID; export CHAR Platform_CWD[256]; -export INT16 Platform_ArgCount; -export INT32 Platform_ArgVector; -static Platform_HaltProcedure Platform_HaltHandler; static INT32 Platform_TimeStart; export INT16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; export CHAR Platform_NL[3]; @@ -45,7 +26,6 @@ export CHAR Platform_NL[3]; export ADDRESS *Platform_FileIdentity__typ; export BOOLEAN Platform_Absent (INT16 e); -export INT16 Platform_ArgPos (CHAR *s, ADDRESS s__len); export INT16 Platform_Chdir (CHAR *n, ADDRESS n__len); export INT16 Platform_Close (INT32 h); export BOOLEAN Platform_ConnectionFailed (INT16 e); @@ -53,15 +33,12 @@ export void Platform_Delay (INT32 ms); export BOOLEAN Platform_DifferentFilesystems (INT16 e); export INT16 Platform_Error (void); export void Platform_Exit (INT32 code); -export void Platform_GetArg (INT16 n, CHAR *val, ADDRESS val__len); export void Platform_GetClock (INT32 *t, INT32 *d); export void Platform_GetEnv (CHAR *var, ADDRESS var__len, CHAR *val, ADDRESS val__len); -export void Platform_GetIntArg (INT16 n, INT32 *val); export void Platform_GetTimeOfDay (INT32 *sec, INT32 *usec); export INT16 Platform_Identify (INT32 h, Platform_FileIdentity *identity, ADDRESS *identity__typ); export INT16 Platform_IdentifyByName (CHAR *n, ADDRESS n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ); export BOOLEAN Platform_Inaccessible (INT16 e); -export void Platform_Init (INT32 argc, INT32 argvadr); export BOOLEAN Platform_Interrupted (INT16 e); export BOOLEAN Platform_IsConsole (INT32 h); export void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d); @@ -117,8 +94,6 @@ export BOOLEAN Platform_getEnv (CHAR *var, ADDRESS var__len, CHAR *val, ADDRESS #define Platform_EROFS() EROFS #define Platform_ETIMEDOUT() ETIMEDOUT #define Platform_EXDEV() EXDEV -extern void Heap_InitHeap(); -#define Platform_HeapInitHeap() Heap_InitHeap() #define Platform_allocate(size) (ADDRESS)((void*)malloc((size_t)size)) #define Platform_chdir(n, n__len) chdir((char*)n) #define Platform_closefile(fd) close(fd) @@ -129,7 +104,7 @@ extern void Heap_InitHeap(); #define Platform_fsync(fd) fsync(fd) #define Platform_ftruncate(fd, l) ftruncate(fd, l) #define Platform_getcwd(cwd, cwd__len) getcwd((char*)cwd, cwd__len) -#define Platform_getenv(var, var__len) (Platform_EnvPtr)getenv((char*)var) +#define Platform_getenv(var, var__len) getenv((char*)var) #define Platform_getpid() (INTEGER)getpid() #define Platform_gettimeval() struct timeval tv; gettimeofday(&tv,0) #define Platform_isatty(fd) isatty(fd) @@ -213,21 +188,14 @@ void Platform_OSFree (INT32 address) Platform_free(address); } -void Platform_Init (INT32 argc, INT32 argvadr) -{ - Platform_ArgVecPtr av = NIL; - Platform_MainStackFrame = argvadr; - Platform_ArgCount = __VAL(INT16, argc); - av = (Platform_ArgVecPtr)(ADDRESS)argvadr; - Platform_ArgVector = (*av)[0]; - Platform_HeapInitHeap(); -} +typedef + CHAR (*EnvPtr__78)[1024]; BOOLEAN Platform_getEnv (CHAR *var, ADDRESS var__len, CHAR *val, ADDRESS val__len) { - Platform_EnvPtr p = NIL; + EnvPtr__78 p = NIL; __DUP(var, var__len, CHAR); - p = Platform_getenv(var, var__len); + p = (EnvPtr__78)(ADDRESS)Platform_getenv(var, var__len); if (p != NIL) { __COPY(*p, val, val__len); } @@ -244,56 +212,6 @@ void Platform_GetEnv (CHAR *var, ADDRESS var__len, CHAR *val, ADDRESS val__len) __DEL(var); } -void Platform_GetArg (INT16 n, CHAR *val, ADDRESS val__len) -{ - Platform_ArgVec av = NIL; - if (n < Platform_ArgCount) { - av = (Platform_ArgVec)(ADDRESS)Platform_ArgVector; - __COPY(*(*av)[__X(n, 1024)], val, val__len); - } -} - -void Platform_GetIntArg (INT16 n, INT32 *val) -{ - CHAR s[64]; - INT32 k, d, i; - s[0] = 0x00; - Platform_GetArg(n, (void*)s, 64); - i = 0; - if (s[0] == '-') { - i = 1; - } - k = 0; - d = (INT16)s[__X(i, 64)] - 48; - while ((d >= 0 && d <= 9)) { - k = k * 10 + d; - i += 1; - d = (INT16)s[__X(i, 64)] - 48; - } - if (s[0] == '-') { - k = -k; - i -= 1; - } - if (i > 0) { - *val = k; - } -} - -INT16 Platform_ArgPos (CHAR *s, ADDRESS s__len) -{ - INT16 i; - CHAR arg[256]; - __DUP(s, s__len, CHAR); - i = 0; - Platform_GetArg(i, (void*)arg, 256); - while ((i < Platform_ArgCount && __STRCMP(s, arg) != 0)) { - i += 1; - Platform_GetArg(i, (void*)arg, 256); - } - __DEL(s); - return i; -} - void Platform_SetInterruptHandler (Platform_SignalHandler handler) { Platform_sethandler(2, handler); @@ -587,7 +505,6 @@ export void *Platform__init(void) __INITYP(Platform_FileIdentity, Platform_FileIdentity, 0); /* BEGIN */ Platform_TestLittleEndian(); - Platform_HaltHandler = NIL; Platform_TimeStart = 0; Platform_TimeStart = Platform_Time(); Platform_PID = Platform_getpid(); diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index 315a17e0..9be32cda 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h @@ -16,18 +16,14 @@ typedef import BOOLEAN Platform_LittleEndian; -import INT32 Platform_MainStackFrame; import INT16 Platform_PID; import CHAR Platform_CWD[256]; -import INT16 Platform_ArgCount; -import INT32 Platform_ArgVector; import INT16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; import CHAR Platform_NL[3]; import ADDRESS *Platform_FileIdentity__typ; import BOOLEAN Platform_Absent (INT16 e); -import INT16 Platform_ArgPos (CHAR *s, ADDRESS s__len); import INT16 Platform_Chdir (CHAR *n, ADDRESS n__len); import INT16 Platform_Close (INT32 h); import BOOLEAN Platform_ConnectionFailed (INT16 e); @@ -35,15 +31,12 @@ import void Platform_Delay (INT32 ms); import BOOLEAN Platform_DifferentFilesystems (INT16 e); import INT16 Platform_Error (void); import void Platform_Exit (INT32 code); -import void Platform_GetArg (INT16 n, CHAR *val, ADDRESS val__len); import void Platform_GetClock (INT32 *t, INT32 *d); import void Platform_GetEnv (CHAR *var, ADDRESS var__len, CHAR *val, ADDRESS val__len); -import void Platform_GetIntArg (INT16 n, INT32 *val); import void Platform_GetTimeOfDay (INT32 *sec, INT32 *usec); import INT16 Platform_Identify (INT32 h, Platform_FileIdentity *identity, ADDRESS *identity__typ); import INT16 Platform_IdentifyByName (CHAR *n, ADDRESS n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ); import BOOLEAN Platform_Inaccessible (INT16 e); -import void Platform_Init (INT32 argc, INT32 argvadr); import BOOLEAN Platform_Interrupted (INT16 e); import BOOLEAN Platform_IsConsole (INT32 h); import void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d); diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index ee1f94ca..e4149017 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index 16a16b7a..e3bfadb5 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index b60bb504..a3f1e808 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index adf86c42..b192b7bb 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index ea3662c0..376db061 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -394,8 +394,8 @@ static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, ADDRESS *msg__t e->file = (*(Texts_Alien*)&E)->file; e->org = (*(Texts_Alien*)&E)->org; e->span = (*(Texts_Alien*)&E)->span; - __COPY((*(Texts_Alien*)&E)->mod, e->mod, 32); - __COPY((*(Texts_Alien*)&E)->proc, e->proc, 32); + __MOVE((*(Texts_Alien*)&E)->mod, e->mod, 32); + __MOVE((*(Texts_Alien*)&E)->proc, e->proc, 32); (*msg__).e = (Texts_Elem)e; } else __WITHCHK; } else if (__IS(msg__typ, Texts_IdentifyMsg, 1)) { diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index beb1d7c1..4ea56de1 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/VT100.c b/bootstrap/unix-44/VT100.c index f0e444ea..7a2a840d 100644 --- a/bootstrap/unix-44/VT100.c +++ b/bootstrap/unix-44/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/VT100.h b/bootstrap/unix-44/VT100.h index 0f1bc5ac..5a3fe6d0 100644 --- a/bootstrap/unix-44/VT100.h +++ b/bootstrap/unix-44/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index 43e5cb69..657534b4 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index 784b684d..6ad7abb0 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/Compiler.c b/bootstrap/unix-48/Compiler.c index 29524a91..e59d7615 100644 --- a/bootstrap/unix-48/Compiler.c +++ b/bootstrap/unix-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index 54214f70..01281cfc 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index 1e6381e9..98f85767 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 763569cc..f39534fc 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -237,7 +237,7 @@ static void Files_Deregister (CHAR *name, ADDRESS name__len) if (osfile != NIL) { __ASSERT(!osfile->tempFile, 0); __ASSERT(osfile->fd >= 0, 0); - __COPY(osfile->workName, osfile->registerName, 101); + __MOVE(osfile->workName, osfile->registerName, 101); Files_GetTempName(osfile->registerName, 101, (void*)osfile->workName, 101); osfile->tempFile = 1; osfile->state = 0; @@ -262,7 +262,7 @@ static void Files_Create (Files_File f) } else { __ASSERT(f->state == 2, 0); Files_Deregister(f->registerName, 101); - __COPY(f->registerName, f->workName, 101); + __MOVE(f->registerName, f->workName, 101); f->registerName[0] = 0x00; f->tempFile = 0; } @@ -823,7 +823,7 @@ void Files_Register (Files_File f) if (errcode != 0) { Files_Err((CHAR*)"Couldn't rename temp name as register name", 43, f, errcode); } - __COPY(f->registerName, f->workName, 101); + __MOVE(f->registerName, f->workName, 101); f->registerName[0] = 0x00; f->tempFile = 0; } diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index 28a97c05..e124b950 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index af8fd777..b6abc8f3 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -105,12 +105,12 @@ static void Heap_Sift (INT32 l, INT32 r, INT32 *a, ADDRESS a__len); export void Heap_Unlock (void); extern void *Heap__init(); -extern ADDRESS Platform_MainStackFrame; +extern ADDRESS Modules_MainStackFrame; extern ADDRESS Platform_OSAllocate(ADDRESS size); #define Heap_HeapModuleInit() Heap__init() #define Heap_ModulesHalt(code) Modules_Halt(code) +#define Heap_ModulesMainStackFrame() Modules_MainStackFrame #define Heap_OSAllocate(size) Platform_OSAllocate(size) -#define Heap_PlatformMainStackFrame() Platform_MainStackFrame void Heap_Lock (void) { @@ -599,7 +599,7 @@ static void Heap_MarkStack (INT32 n, INT32 *cand, ADDRESS cand__len) if (n == 0) { nofcand = 0; sp = (ADDRESS)&frame; - stack0 = Heap_PlatformMainStackFrame(); + stack0 = Heap_ModulesMainStackFrame(); inc = (ADDRESS)&align.p - (ADDRESS)&align; if (sp > stack0) { inc = -inc; diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index cc058553..82ebd04d 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index 9aedc826..0290d664 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -43,24 +43,105 @@ typedef export INT16 Modules_res; export CHAR Modules_resMsg[256]; export Modules_ModuleName Modules_imported, Modules_importing; +export INT32 Modules_MainStackFrame; +export INT16 Modules_ArgCount; +export INT32 Modules_ArgVector; export ADDRESS *Modules_ModuleDesc__typ; export ADDRESS *Modules_CmdDesc__typ; static void Modules_Append (CHAR *a, ADDRESS a__len, CHAR *b, ADDRESS b__len); +export INT16 Modules_ArgPos (CHAR *s, ADDRESS s__len); export void Modules_AssertFail (INT32 code); static void Modules_DisplayHaltCode (INT32 code); export void Modules_Free (CHAR *name, ADDRESS name__len, BOOLEAN all); +export void Modules_GetArg (INT16 n, CHAR *val, ADDRESS val__len); +export void Modules_GetIntArg (INT16 n, INT32 *val); export void Modules_Halt (INT32 code); +export void Modules_Init (INT32 argc, INT32 argvadr); export Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, ADDRESS name__len); export Modules_Module Modules_ThisMod (CHAR *name, ADDRESS name__len); static void Modules_errch (CHAR c); static void Modules_errint (INT32 l); static void Modules_errstring (CHAR *s, ADDRESS s__len); +extern void Heap_InitHeap(); +extern void *Modules__init(void); +#define Modules_InitHeap() Heap_InitHeap() +#define Modules_ModulesInit() Modules__init() #define Modules_modules() (Modules_Module)Heap_modules #define Modules_setmodules(m) Heap_modules = m +typedef + INT32 (*ArgVecPtr__14)[1]; + +void Modules_Init (INT32 argc, INT32 argvadr) +{ + ArgVecPtr__14 av = NIL; + Modules_MainStackFrame = argvadr; + Modules_ArgCount = __VAL(INT16, argc); + av = (ArgVecPtr__14)(ADDRESS)argvadr; + Modules_ArgVector = (*av)[0]; + Modules_InitHeap(); + Modules_ModulesInit(); +} + +typedef + CHAR (*ArgPtr__9)[1024]; + +typedef + ArgPtr__9 (*ArgVec__10)[1024]; + +void Modules_GetArg (INT16 n, CHAR *val, ADDRESS val__len) +{ + ArgVec__10 av = NIL; + if (n < Modules_ArgCount) { + av = (ArgVec__10)(ADDRESS)Modules_ArgVector; + __COPY(*(*av)[__X(n, 1024)], val, val__len); + } +} + +void Modules_GetIntArg (INT16 n, INT32 *val) +{ + CHAR s[64]; + INT32 k, d, i; + s[0] = 0x00; + Modules_GetArg(n, (void*)s, 64); + i = 0; + if (s[0] == '-') { + i = 1; + } + k = 0; + d = (INT16)s[__X(i, 64)] - 48; + while ((d >= 0 && d <= 9)) { + k = k * 10 + d; + i += 1; + d = (INT16)s[__X(i, 64)] - 48; + } + if (s[0] == '-') { + k = -k; + i -= 1; + } + if (i > 0) { + *val = k; + } +} + +INT16 Modules_ArgPos (CHAR *s, ADDRESS s__len) +{ + INT16 i; + CHAR arg[256]; + __DUP(s, s__len, CHAR); + i = 0; + Modules_GetArg(i, (void*)arg, 256); + while ((i < Modules_ArgCount && __STRCMP(s, arg) != 0)) { + i += 1; + Modules_GetArg(i, (void*)arg, 256); + } + __DEL(s); + return i; +} + static void Modules_Append (CHAR *a, ADDRESS a__len, CHAR *b, ADDRESS b__len) { INT16 i, j; diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index 568db414..3ab94701 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h @@ -39,13 +39,20 @@ typedef import INT16 Modules_res; import CHAR Modules_resMsg[256]; import Modules_ModuleName Modules_imported, Modules_importing; +import INT32 Modules_MainStackFrame; +import INT16 Modules_ArgCount; +import INT32 Modules_ArgVector; import ADDRESS *Modules_ModuleDesc__typ; import ADDRESS *Modules_CmdDesc__typ; +import INT16 Modules_ArgPos (CHAR *s, ADDRESS s__len); import void Modules_AssertFail (INT32 code); import void Modules_Free (CHAR *name, ADDRESS name__len, BOOLEAN all); +import void Modules_GetArg (INT16 n, CHAR *val, ADDRESS val__len); +import void Modules_GetIntArg (INT16 n, INT32 *val); import void Modules_Halt (INT32 code); +import void Modules_Init (INT32 argc, INT32 argvadr); import Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, ADDRESS name__len); import Modules_Module Modules_ThisMod (CHAR *name, ADDRESS name__len); import void *Modules__init(void); diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index 2e03b5fc..d9e826b8 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -253,7 +253,7 @@ OPT_Node OPB_NewString (OPS_String str, INT64 len) x->conval->intval = -1; x->conval->intval2 = OPM_Longint(len); x->conval->ext = OPT_NewExt(); - __COPY(str, *x->conval->ext, 256); + __MOVE(str, *x->conval->ext, 256); return x; } @@ -1624,23 +1624,19 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) g = 8; } if (x == y) { + } else if ((((y->comp == 2 && y->BaseTyp == x->BaseTyp)) && y->n <= x->n)) { + } else if ((y->comp == 3 && y->BaseTyp == x->BaseTyp)) { } else if (x->BaseTyp == OPT_chartyp) { if (g == 8) { if (ynode->conval->intval2 > x->n) { OPB_err(114); } - } else if ((__IN(y->comp, 0x0c, 32) && y->BaseTyp == OPT_chartyp)) { } else { OPB_err(113); } } else { OPB_err(113); } - } else if ((x->comp == 3 && x->BaseTyp == OPT_chartyp)) { - if ((__IN(y->comp, 0x0c, 32) && y->BaseTyp == OPT_chartyp)) { - } else { - OPB_err(113); - } } else if (x->comp == 4) { if (x == y) { } else if (y->comp == 4) { @@ -2536,7 +2532,6 @@ void OPB_Return (OPT_Node *x, OPT_Object proc) void OPB_Assign (OPT_Node *x, OPT_Node y) { OPT_Node z = NIL; - INT8 subcl; if ((*x)->class >= 7) { OPB_err(56); } @@ -2562,13 +2557,8 @@ void OPB_Assign (OPT_Node *x, OPT_Node y) y->conval->intval = 0; OPB_Index(&*x, OPB_NewIntConst(0)); } - if ((((((__IN((*x)->typ->comp, 0x0c, 32) && (*x)->typ->BaseTyp == OPT_chartyp)) && __IN(y->typ->comp, 0x0c, 32))) && y->typ->BaseTyp == OPT_chartyp)) { - subcl = 18; - } else { - subcl = 0; - } OPB_BindNodes(19, OPT_notyp, &*x, y); - (*x)->subcl = subcl; + (*x)->subcl = 0; } void OPB_Inittd (OPT_Node *inittd, OPT_Node *last, OPT_Struct typ) diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index 6641207d..2c396170 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index fd11366a..5f4dc826 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index 4eff8cf5..f9bc06a4 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 58701bfc..1732c950 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -8,6 +8,7 @@ #include "SYSTEM.h" #include "Configuration.h" #include "Files.h" +#include "Modules.h" #include "Out.h" #include "Platform.h" #include "Strings.h" @@ -266,7 +267,7 @@ static void OPM_ScanOptions (CHAR *s, ADDRESS s__len) BOOLEAN OPM_OpenPar (void) { CHAR s[256]; - if (Platform_ArgCount == 1) { + if (Modules_ArgCount == 1) { OPM_LogWLn(); OPM_LogWStr((CHAR*)"Oberon-2 compiler v", 20); OPM_LogWStr(Configuration_versionLong, 75); @@ -362,16 +363,16 @@ BOOLEAN OPM_OpenPar (void) OPM_Options = 0xa9; OPM_S = 1; s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, 256); + Modules_GetArg(OPM_S, (void*)s, 256); while (s[0] == '-') { OPM_ScanOptions(s, 256); OPM_S += 1; s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, 256); + Modules_GetArg(OPM_S, (void*)s, 256); } OPM_GlobalAddressSize = OPM_AddressSize; OPM_GlobalAlignment = OPM_Alignment; - __COPY(OPM_Model, OPM_GlobalModel, 10); + __MOVE(OPM_Model, OPM_GlobalModel, 10); OPM_GlobalOptions = OPM_Options; return 1; } @@ -410,16 +411,16 @@ void OPM_InitOptions (void) CHAR searchpath[1024], modules[1024]; CHAR MODULES[1024]; OPM_Options = OPM_GlobalOptions; - __COPY(OPM_GlobalModel, OPM_Model, 10); + __MOVE(OPM_GlobalModel, OPM_Model, 10); OPM_Alignment = OPM_GlobalAlignment; OPM_AddressSize = OPM_GlobalAddressSize; s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, 256); + Modules_GetArg(OPM_S, (void*)s, 256); while (s[0] == '-') { OPM_ScanOptions(s, 256); OPM_S += 1; s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, 256); + Modules_GetArg(OPM_S, (void*)s, 256); } if (__IN(15, OPM_Options, 32)) { OPM_Options |= __SETOF(10,32); @@ -472,11 +473,11 @@ void OPM_Init (BOOLEAN *done, CHAR *mname, ADDRESS mname__len) CHAR s[256]; *done = 0; OPM_curpos = 0; - if (OPM_S >= Platform_ArgCount) { + if (OPM_S >= Modules_ArgCount) { return; } s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, 256); + Modules_GetArg(OPM_S, (void*)s, 256); __NEW(T, Texts_TextDesc); Texts_Open(T, s, 256); OPM_LogWStr(s, 256); @@ -1070,6 +1071,7 @@ export void *OPM__init(void) __DEFMOD; __MODULE_IMPORT(Configuration); __MODULE_IMPORT(Files); + __MODULE_IMPORT(Modules); __MODULE_IMPORT(Out); __MODULE_IMPORT(Platform); __MODULE_IMPORT(Strings); diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index 4dd3d03b..979995c8 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index d4922137..69624c1f 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -527,7 +527,7 @@ static void OPP_selector (OPT_Node *x) } else if (OPP_sym == 18) { OPS_Get(&OPP_sym); if (OPP_sym == 38) { - __COPY(OPS_name, name, 256); + __MOVE(OPS_name, name, 256); OPS_Get(&OPP_sym); if ((*x)->typ != NIL) { if ((*x)->typ->form == 11) { @@ -867,7 +867,7 @@ static void OPP_Receiver (INT8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct } else { *mode = 1; } - __COPY(OPS_name, name, 256); + __MOVE(OPS_name, name, 256); OPP_CheckSym(38); OPP_CheckSym(20); if (OPP_sym == 38) { @@ -1030,7 +1030,7 @@ static void TProcDecl__23 (void) } OPP_Receiver(&objMode, objName, &objTyp, &recTyp); if (OPP_sym == 38) { - __COPY(OPS_name, *ProcedureDeclaration__16_s->name, 256); + __MOVE(OPS_name, *ProcedureDeclaration__16_s->name, 256); OPP_CheckMark(&*ProcedureDeclaration__16_s->vis); OPT_FindField(*ProcedureDeclaration__16_s->name, recTyp, &*ProcedureDeclaration__16_s->fwd); OPT_FindField(*ProcedureDeclaration__16_s->name, recTyp->BaseTyp, &baseProc); @@ -1129,7 +1129,7 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) TProcDecl__23(); } else if (OPP_sym == 38) { OPT_Find(&fwd); - __COPY(OPS_name, name, 256); + __MOVE(OPS_name, name, 256); OPP_CheckMark(&vis); if ((vis != 0 && mode == 6)) { mode = 7; diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index 2814e733..b748e221 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index 7218afe1..eee78d80 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index a860454b..7ab70899 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index aa53a484..174aae08 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -434,8 +434,8 @@ void OPT_Init (OPS_Name name, UINT32 opt) OPT_topScope = OPT_universe; OPT_OpenScope(0, NIL); OPT_SYSimported = 0; - __COPY(name, OPT_SelfName, 256); - __COPY(name, OPT_topScope->name, 256); + __MOVE(name, OPT_SelfName, 256); + __MOVE(name, OPT_topScope->name, 256); OPT_GlbMod[0] = OPT_topScope; OPT_nofGmod = 1; OPT_newsf = __IN(4, opt, 32); @@ -1186,7 +1186,7 @@ static void OPT_InStruct (OPT_Struct *typ) } *typ = OPT_NewStr(0, 1); } else { - __COPY(name, obj->name, 256); + __MOVE(name, obj->name, 256); OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, 64)]->right, &old); if (old != NIL) { OPT_FPrintObj(old); diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index 86256024..67996e8e 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index eb5ad767..fb6ac690 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -163,7 +163,7 @@ static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exporte } scope = obj->scope; scope->leaf = 1; - __COPY(obj->name, scope->name, 256); + __MOVE(obj->name, scope->name, 256); OPV_Stamp(scope->name); if (mode == 9) { obj->adr = 1; @@ -1286,7 +1286,17 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPM_WriteString((CHAR*)", ", 3); if (r->typ == OPT_stringtyp) { OPM_WriteInt(r->conval->intval2); + } else if (r->typ->comp == 3) { + OPM_WriteString((CHAR*)"__X(", 5); + OPC_Len(r->obj, r->typ, 0); + OPM_WriteString((CHAR*)" * ", 4); + OPM_WriteInt(r->typ->BaseTyp->size); + OPM_WriteString((CHAR*)", ", 3); + OPM_WriteInt(l->typ->size); + OPM_Write(')'); } else { + __ASSERT(r->typ->comp == 2, 0); + __ASSERT(r->typ->size <= l->typ->size, 0); OPM_WriteInt(r->typ->size); } OPM_Write(')'); diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index 9a8653a0..43aaf24a 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Out.c b/bootstrap/unix-48/Out.c index 1508a8bb..a03cf592 100644 --- a/bootstrap/unix-48/Out.c +++ b/bootstrap/unix-48/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Out.h b/bootstrap/unix-48/Out.h index b273390e..27f2c9bb 100644 --- a/bootstrap/unix-48/Out.h +++ b/bootstrap/unix-48/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 9a2555d2..1fc766bf 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -7,37 +7,18 @@ #include "SYSTEM.h" -typedef - CHAR (*Platform_ArgPtr)[1024]; - -typedef - Platform_ArgPtr (*Platform_ArgVec)[1024]; - -typedef - INT32 (*Platform_ArgVecPtr)[1]; - -typedef - CHAR (*Platform_EnvPtr)[1024]; - typedef struct Platform_FileIdentity { INT32 volume, index, mtime; } Platform_FileIdentity; -typedef - void (*Platform_HaltProcedure)(INT32); - typedef void (*Platform_SignalHandler)(INT32); export BOOLEAN Platform_LittleEndian; -export INT32 Platform_MainStackFrame; export INT16 Platform_PID; export CHAR Platform_CWD[256]; -export INT16 Platform_ArgCount; -export INT32 Platform_ArgVector; -static Platform_HaltProcedure Platform_HaltHandler; static INT32 Platform_TimeStart; export INT16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; export CHAR Platform_NL[3]; @@ -45,7 +26,6 @@ export CHAR Platform_NL[3]; export ADDRESS *Platform_FileIdentity__typ; export BOOLEAN Platform_Absent (INT16 e); -export INT16 Platform_ArgPos (CHAR *s, ADDRESS s__len); export INT16 Platform_Chdir (CHAR *n, ADDRESS n__len); export INT16 Platform_Close (INT32 h); export BOOLEAN Platform_ConnectionFailed (INT16 e); @@ -53,15 +33,12 @@ export void Platform_Delay (INT32 ms); export BOOLEAN Platform_DifferentFilesystems (INT16 e); export INT16 Platform_Error (void); export void Platform_Exit (INT32 code); -export void Platform_GetArg (INT16 n, CHAR *val, ADDRESS val__len); export void Platform_GetClock (INT32 *t, INT32 *d); export void Platform_GetEnv (CHAR *var, ADDRESS var__len, CHAR *val, ADDRESS val__len); -export void Platform_GetIntArg (INT16 n, INT32 *val); export void Platform_GetTimeOfDay (INT32 *sec, INT32 *usec); export INT16 Platform_Identify (INT32 h, Platform_FileIdentity *identity, ADDRESS *identity__typ); export INT16 Platform_IdentifyByName (CHAR *n, ADDRESS n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ); export BOOLEAN Platform_Inaccessible (INT16 e); -export void Platform_Init (INT32 argc, INT32 argvadr); export BOOLEAN Platform_Interrupted (INT16 e); export BOOLEAN Platform_IsConsole (INT32 h); export void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d); @@ -117,8 +94,6 @@ export BOOLEAN Platform_getEnv (CHAR *var, ADDRESS var__len, CHAR *val, ADDRESS #define Platform_EROFS() EROFS #define Platform_ETIMEDOUT() ETIMEDOUT #define Platform_EXDEV() EXDEV -extern void Heap_InitHeap(); -#define Platform_HeapInitHeap() Heap_InitHeap() #define Platform_allocate(size) (ADDRESS)((void*)malloc((size_t)size)) #define Platform_chdir(n, n__len) chdir((char*)n) #define Platform_closefile(fd) close(fd) @@ -129,7 +104,7 @@ extern void Heap_InitHeap(); #define Platform_fsync(fd) fsync(fd) #define Platform_ftruncate(fd, l) ftruncate(fd, l) #define Platform_getcwd(cwd, cwd__len) getcwd((char*)cwd, cwd__len) -#define Platform_getenv(var, var__len) (Platform_EnvPtr)getenv((char*)var) +#define Platform_getenv(var, var__len) getenv((char*)var) #define Platform_getpid() (INTEGER)getpid() #define Platform_gettimeval() struct timeval tv; gettimeofday(&tv,0) #define Platform_isatty(fd) isatty(fd) @@ -213,21 +188,14 @@ void Platform_OSFree (INT32 address) Platform_free(address); } -void Platform_Init (INT32 argc, INT32 argvadr) -{ - Platform_ArgVecPtr av = NIL; - Platform_MainStackFrame = argvadr; - Platform_ArgCount = __VAL(INT16, argc); - av = (Platform_ArgVecPtr)(ADDRESS)argvadr; - Platform_ArgVector = (*av)[0]; - Platform_HeapInitHeap(); -} +typedef + CHAR (*EnvPtr__78)[1024]; BOOLEAN Platform_getEnv (CHAR *var, ADDRESS var__len, CHAR *val, ADDRESS val__len) { - Platform_EnvPtr p = NIL; + EnvPtr__78 p = NIL; __DUP(var, var__len, CHAR); - p = Platform_getenv(var, var__len); + p = (EnvPtr__78)(ADDRESS)Platform_getenv(var, var__len); if (p != NIL) { __COPY(*p, val, val__len); } @@ -244,56 +212,6 @@ void Platform_GetEnv (CHAR *var, ADDRESS var__len, CHAR *val, ADDRESS val__len) __DEL(var); } -void Platform_GetArg (INT16 n, CHAR *val, ADDRESS val__len) -{ - Platform_ArgVec av = NIL; - if (n < Platform_ArgCount) { - av = (Platform_ArgVec)(ADDRESS)Platform_ArgVector; - __COPY(*(*av)[__X(n, 1024)], val, val__len); - } -} - -void Platform_GetIntArg (INT16 n, INT32 *val) -{ - CHAR s[64]; - INT32 k, d, i; - s[0] = 0x00; - Platform_GetArg(n, (void*)s, 64); - i = 0; - if (s[0] == '-') { - i = 1; - } - k = 0; - d = (INT16)s[__X(i, 64)] - 48; - while ((d >= 0 && d <= 9)) { - k = k * 10 + d; - i += 1; - d = (INT16)s[__X(i, 64)] - 48; - } - if (s[0] == '-') { - k = -k; - i -= 1; - } - if (i > 0) { - *val = k; - } -} - -INT16 Platform_ArgPos (CHAR *s, ADDRESS s__len) -{ - INT16 i; - CHAR arg[256]; - __DUP(s, s__len, CHAR); - i = 0; - Platform_GetArg(i, (void*)arg, 256); - while ((i < Platform_ArgCount && __STRCMP(s, arg) != 0)) { - i += 1; - Platform_GetArg(i, (void*)arg, 256); - } - __DEL(s); - return i; -} - void Platform_SetInterruptHandler (Platform_SignalHandler handler) { Platform_sethandler(2, handler); @@ -587,7 +505,6 @@ export void *Platform__init(void) __INITYP(Platform_FileIdentity, Platform_FileIdentity, 0); /* BEGIN */ Platform_TestLittleEndian(); - Platform_HaltHandler = NIL; Platform_TimeStart = 0; Platform_TimeStart = Platform_Time(); Platform_PID = Platform_getpid(); diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index 315a17e0..9be32cda 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h @@ -16,18 +16,14 @@ typedef import BOOLEAN Platform_LittleEndian; -import INT32 Platform_MainStackFrame; import INT16 Platform_PID; import CHAR Platform_CWD[256]; -import INT16 Platform_ArgCount; -import INT32 Platform_ArgVector; import INT16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; import CHAR Platform_NL[3]; import ADDRESS *Platform_FileIdentity__typ; import BOOLEAN Platform_Absent (INT16 e); -import INT16 Platform_ArgPos (CHAR *s, ADDRESS s__len); import INT16 Platform_Chdir (CHAR *n, ADDRESS n__len); import INT16 Platform_Close (INT32 h); import BOOLEAN Platform_ConnectionFailed (INT16 e); @@ -35,15 +31,12 @@ import void Platform_Delay (INT32 ms); import BOOLEAN Platform_DifferentFilesystems (INT16 e); import INT16 Platform_Error (void); import void Platform_Exit (INT32 code); -import void Platform_GetArg (INT16 n, CHAR *val, ADDRESS val__len); import void Platform_GetClock (INT32 *t, INT32 *d); import void Platform_GetEnv (CHAR *var, ADDRESS var__len, CHAR *val, ADDRESS val__len); -import void Platform_GetIntArg (INT16 n, INT32 *val); import void Platform_GetTimeOfDay (INT32 *sec, INT32 *usec); import INT16 Platform_Identify (INT32 h, Platform_FileIdentity *identity, ADDRESS *identity__typ); import INT16 Platform_IdentifyByName (CHAR *n, ADDRESS n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ); import BOOLEAN Platform_Inaccessible (INT16 e); -import void Platform_Init (INT32 argc, INT32 argvadr); import BOOLEAN Platform_Interrupted (INT16 e); import BOOLEAN Platform_IsConsole (INT32 h); import void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d); diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index ee1f94ca..e4149017 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index 16a16b7a..e3bfadb5 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index b60bb504..a3f1e808 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index adf86c42..b192b7bb 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index c9010809..4fa93c49 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -394,8 +394,8 @@ static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, ADDRESS *msg__t e->file = (*(Texts_Alien*)&E)->file; e->org = (*(Texts_Alien*)&E)->org; e->span = (*(Texts_Alien*)&E)->span; - __COPY((*(Texts_Alien*)&E)->mod, e->mod, 32); - __COPY((*(Texts_Alien*)&E)->proc, e->proc, 32); + __MOVE((*(Texts_Alien*)&E)->mod, e->mod, 32); + __MOVE((*(Texts_Alien*)&E)->proc, e->proc, 32); (*msg__).e = (Texts_Elem)e; } else __WITHCHK; } else if (__IS(msg__typ, Texts_IdentifyMsg, 1)) { diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index 16b07b6f..235cecb4 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/VT100.c b/bootstrap/unix-48/VT100.c index f0e444ea..7a2a840d 100644 --- a/bootstrap/unix-48/VT100.c +++ b/bootstrap/unix-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/VT100.h b/bootstrap/unix-48/VT100.h index 0f1bc5ac..5a3fe6d0 100644 --- a/bootstrap/unix-48/VT100.h +++ b/bootstrap/unix-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index 43e5cb69..657534b4 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index 784b684d..6ad7abb0 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/Compiler.c b/bootstrap/unix-88/Compiler.c index 29524a91..e59d7615 100644 --- a/bootstrap/unix-88/Compiler.c +++ b/bootstrap/unix-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index 54214f70..01281cfc 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index 1e6381e9..98f85767 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index e2cf2f3a..0c219af5 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -237,7 +237,7 @@ static void Files_Deregister (CHAR *name, ADDRESS name__len) if (osfile != NIL) { __ASSERT(!osfile->tempFile, 0); __ASSERT(osfile->fd >= 0, 0); - __COPY(osfile->workName, osfile->registerName, 101); + __MOVE(osfile->workName, osfile->registerName, 101); Files_GetTempName(osfile->registerName, 101, (void*)osfile->workName, 101); osfile->tempFile = 1; osfile->state = 0; @@ -262,7 +262,7 @@ static void Files_Create (Files_File f) } else { __ASSERT(f->state == 2, 0); Files_Deregister(f->registerName, 101); - __COPY(f->registerName, f->workName, 101); + __MOVE(f->registerName, f->workName, 101); f->registerName[0] = 0x00; f->tempFile = 0; } @@ -823,7 +823,7 @@ void Files_Register (Files_File f) if (errcode != 0) { Files_Err((CHAR*)"Couldn't rename temp name as register name", 43, f, errcode); } - __COPY(f->registerName, f->workName, 101); + __MOVE(f->registerName, f->workName, 101); f->registerName[0] = 0x00; f->tempFile = 0; } diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 0da4768b..4a1cbfe9 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index 95dd55ee..222162d5 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -105,12 +105,12 @@ static void Heap_Sift (INT64 l, INT64 r, INT64 *a, ADDRESS a__len); export void Heap_Unlock (void); extern void *Heap__init(); -extern ADDRESS Platform_MainStackFrame; +extern ADDRESS Modules_MainStackFrame; extern ADDRESS Platform_OSAllocate(ADDRESS size); #define Heap_HeapModuleInit() Heap__init() #define Heap_ModulesHalt(code) Modules_Halt(code) +#define Heap_ModulesMainStackFrame() Modules_MainStackFrame #define Heap_OSAllocate(size) Platform_OSAllocate(size) -#define Heap_PlatformMainStackFrame() Platform_MainStackFrame void Heap_Lock (void) { @@ -599,7 +599,7 @@ static void Heap_MarkStack (INT64 n, INT64 *cand, ADDRESS cand__len) if (n == 0) { nofcand = 0; sp = (ADDRESS)&frame; - stack0 = Heap_PlatformMainStackFrame(); + stack0 = Heap_ModulesMainStackFrame(); inc = (ADDRESS)&align.p - (ADDRESS)&align; if (sp > stack0) { inc = -inc; diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index b96e0160..585db2f0 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 9b72d021..b0cf5fd9 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -43,24 +43,105 @@ typedef export INT16 Modules_res; export CHAR Modules_resMsg[256]; export Modules_ModuleName Modules_imported, Modules_importing; +export INT64 Modules_MainStackFrame; +export INT16 Modules_ArgCount; +export INT64 Modules_ArgVector; export ADDRESS *Modules_ModuleDesc__typ; export ADDRESS *Modules_CmdDesc__typ; static void Modules_Append (CHAR *a, ADDRESS a__len, CHAR *b, ADDRESS b__len); +export INT16 Modules_ArgPos (CHAR *s, ADDRESS s__len); export void Modules_AssertFail (INT32 code); static void Modules_DisplayHaltCode (INT32 code); export void Modules_Free (CHAR *name, ADDRESS name__len, BOOLEAN all); +export void Modules_GetArg (INT16 n, CHAR *val, ADDRESS val__len); +export void Modules_GetIntArg (INT16 n, INT32 *val); export void Modules_Halt (INT32 code); +export void Modules_Init (INT32 argc, INT64 argvadr); export Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, ADDRESS name__len); export Modules_Module Modules_ThisMod (CHAR *name, ADDRESS name__len); static void Modules_errch (CHAR c); static void Modules_errint (INT32 l); static void Modules_errstring (CHAR *s, ADDRESS s__len); +extern void Heap_InitHeap(); +extern void *Modules__init(void); +#define Modules_InitHeap() Heap_InitHeap() +#define Modules_ModulesInit() Modules__init() #define Modules_modules() (Modules_Module)Heap_modules #define Modules_setmodules(m) Heap_modules = m +typedef + INT64 (*ArgVecPtr__14)[1]; + +void Modules_Init (INT32 argc, INT64 argvadr) +{ + ArgVecPtr__14 av = NIL; + Modules_MainStackFrame = argvadr; + Modules_ArgCount = __VAL(INT16, argc); + av = (ArgVecPtr__14)(ADDRESS)argvadr; + Modules_ArgVector = (*av)[0]; + Modules_InitHeap(); + Modules_ModulesInit(); +} + +typedef + CHAR (*ArgPtr__9)[1024]; + +typedef + ArgPtr__9 (*ArgVec__10)[1024]; + +void Modules_GetArg (INT16 n, CHAR *val, ADDRESS val__len) +{ + ArgVec__10 av = NIL; + if (n < Modules_ArgCount) { + av = (ArgVec__10)(ADDRESS)Modules_ArgVector; + __COPY(*(*av)[__X(n, 1024)], val, val__len); + } +} + +void Modules_GetIntArg (INT16 n, INT32 *val) +{ + CHAR s[64]; + INT32 k, d, i; + s[0] = 0x00; + Modules_GetArg(n, (void*)s, 64); + i = 0; + if (s[0] == '-') { + i = 1; + } + k = 0; + d = (INT16)s[__X(i, 64)] - 48; + while ((d >= 0 && d <= 9)) { + k = k * 10 + d; + i += 1; + d = (INT16)s[__X(i, 64)] - 48; + } + if (s[0] == '-') { + k = -k; + i -= 1; + } + if (i > 0) { + *val = k; + } +} + +INT16 Modules_ArgPos (CHAR *s, ADDRESS s__len) +{ + INT16 i; + CHAR arg[256]; + __DUP(s, s__len, CHAR); + i = 0; + Modules_GetArg(i, (void*)arg, 256); + while ((i < Modules_ArgCount && __STRCMP(s, arg) != 0)) { + i += 1; + Modules_GetArg(i, (void*)arg, 256); + } + __DEL(s); + return i; +} + static void Modules_Append (CHAR *a, ADDRESS a__len, CHAR *b, ADDRESS b__len) { INT16 i, j; diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index 568db414..a3e555ef 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h @@ -39,13 +39,20 @@ typedef import INT16 Modules_res; import CHAR Modules_resMsg[256]; import Modules_ModuleName Modules_imported, Modules_importing; +import INT64 Modules_MainStackFrame; +import INT16 Modules_ArgCount; +import INT64 Modules_ArgVector; import ADDRESS *Modules_ModuleDesc__typ; import ADDRESS *Modules_CmdDesc__typ; +import INT16 Modules_ArgPos (CHAR *s, ADDRESS s__len); import void Modules_AssertFail (INT32 code); import void Modules_Free (CHAR *name, ADDRESS name__len, BOOLEAN all); +import void Modules_GetArg (INT16 n, CHAR *val, ADDRESS val__len); +import void Modules_GetIntArg (INT16 n, INT32 *val); import void Modules_Halt (INT32 code); +import void Modules_Init (INT32 argc, INT64 argvadr); import Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, ADDRESS name__len); import Modules_Module Modules_ThisMod (CHAR *name, ADDRESS name__len); import void *Modules__init(void); diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index 2e03b5fc..d9e826b8 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -253,7 +253,7 @@ OPT_Node OPB_NewString (OPS_String str, INT64 len) x->conval->intval = -1; x->conval->intval2 = OPM_Longint(len); x->conval->ext = OPT_NewExt(); - __COPY(str, *x->conval->ext, 256); + __MOVE(str, *x->conval->ext, 256); return x; } @@ -1624,23 +1624,19 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) g = 8; } if (x == y) { + } else if ((((y->comp == 2 && y->BaseTyp == x->BaseTyp)) && y->n <= x->n)) { + } else if ((y->comp == 3 && y->BaseTyp == x->BaseTyp)) { } else if (x->BaseTyp == OPT_chartyp) { if (g == 8) { if (ynode->conval->intval2 > x->n) { OPB_err(114); } - } else if ((__IN(y->comp, 0x0c, 32) && y->BaseTyp == OPT_chartyp)) { } else { OPB_err(113); } } else { OPB_err(113); } - } else if ((x->comp == 3 && x->BaseTyp == OPT_chartyp)) { - if ((__IN(y->comp, 0x0c, 32) && y->BaseTyp == OPT_chartyp)) { - } else { - OPB_err(113); - } } else if (x->comp == 4) { if (x == y) { } else if (y->comp == 4) { @@ -2536,7 +2532,6 @@ void OPB_Return (OPT_Node *x, OPT_Object proc) void OPB_Assign (OPT_Node *x, OPT_Node y) { OPT_Node z = NIL; - INT8 subcl; if ((*x)->class >= 7) { OPB_err(56); } @@ -2562,13 +2557,8 @@ void OPB_Assign (OPT_Node *x, OPT_Node y) y->conval->intval = 0; OPB_Index(&*x, OPB_NewIntConst(0)); } - if ((((((__IN((*x)->typ->comp, 0x0c, 32) && (*x)->typ->BaseTyp == OPT_chartyp)) && __IN(y->typ->comp, 0x0c, 32))) && y->typ->BaseTyp == OPT_chartyp)) { - subcl = 18; - } else { - subcl = 0; - } OPB_BindNodes(19, OPT_notyp, &*x, y); - (*x)->subcl = subcl; + (*x)->subcl = 0; } void OPB_Inittd (OPT_Node *inittd, OPT_Node *last, OPT_Struct typ) diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index 6641207d..2c396170 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index fd11366a..5f4dc826 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index 4eff8cf5..f9bc06a4 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index e4915a3e..f52cb5e2 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -8,6 +8,7 @@ #include "SYSTEM.h" #include "Configuration.h" #include "Files.h" +#include "Modules.h" #include "Out.h" #include "Platform.h" #include "Strings.h" @@ -266,7 +267,7 @@ static void OPM_ScanOptions (CHAR *s, ADDRESS s__len) BOOLEAN OPM_OpenPar (void) { CHAR s[256]; - if (Platform_ArgCount == 1) { + if (Modules_ArgCount == 1) { OPM_LogWLn(); OPM_LogWStr((CHAR*)"Oberon-2 compiler v", 20); OPM_LogWStr(Configuration_versionLong, 75); @@ -362,16 +363,16 @@ BOOLEAN OPM_OpenPar (void) OPM_Options = 0xa9; OPM_S = 1; s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, 256); + Modules_GetArg(OPM_S, (void*)s, 256); while (s[0] == '-') { OPM_ScanOptions(s, 256); OPM_S += 1; s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, 256); + Modules_GetArg(OPM_S, (void*)s, 256); } OPM_GlobalAddressSize = OPM_AddressSize; OPM_GlobalAlignment = OPM_Alignment; - __COPY(OPM_Model, OPM_GlobalModel, 10); + __MOVE(OPM_Model, OPM_GlobalModel, 10); OPM_GlobalOptions = OPM_Options; return 1; } @@ -410,16 +411,16 @@ void OPM_InitOptions (void) CHAR searchpath[1024], modules[1024]; CHAR MODULES[1024]; OPM_Options = OPM_GlobalOptions; - __COPY(OPM_GlobalModel, OPM_Model, 10); + __MOVE(OPM_GlobalModel, OPM_Model, 10); OPM_Alignment = OPM_GlobalAlignment; OPM_AddressSize = OPM_GlobalAddressSize; s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, 256); + Modules_GetArg(OPM_S, (void*)s, 256); while (s[0] == '-') { OPM_ScanOptions(s, 256); OPM_S += 1; s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, 256); + Modules_GetArg(OPM_S, (void*)s, 256); } if (__IN(15, OPM_Options, 32)) { OPM_Options |= __SETOF(10,32); @@ -472,11 +473,11 @@ void OPM_Init (BOOLEAN *done, CHAR *mname, ADDRESS mname__len) CHAR s[256]; *done = 0; OPM_curpos = 0; - if (OPM_S >= Platform_ArgCount) { + if (OPM_S >= Modules_ArgCount) { return; } s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, 256); + Modules_GetArg(OPM_S, (void*)s, 256); __NEW(T, Texts_TextDesc); Texts_Open(T, s, 256); OPM_LogWStr(s, 256); @@ -1070,6 +1071,7 @@ export void *OPM__init(void) __DEFMOD; __MODULE_IMPORT(Configuration); __MODULE_IMPORT(Files); + __MODULE_IMPORT(Modules); __MODULE_IMPORT(Out); __MODULE_IMPORT(Platform); __MODULE_IMPORT(Strings); diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index 4dd3d03b..979995c8 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index a08cee09..954279d4 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -527,7 +527,7 @@ static void OPP_selector (OPT_Node *x) } else if (OPP_sym == 18) { OPS_Get(&OPP_sym); if (OPP_sym == 38) { - __COPY(OPS_name, name, 256); + __MOVE(OPS_name, name, 256); OPS_Get(&OPP_sym); if ((*x)->typ != NIL) { if ((*x)->typ->form == 11) { @@ -867,7 +867,7 @@ static void OPP_Receiver (INT8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct } else { *mode = 1; } - __COPY(OPS_name, name, 256); + __MOVE(OPS_name, name, 256); OPP_CheckSym(38); OPP_CheckSym(20); if (OPP_sym == 38) { @@ -1030,7 +1030,7 @@ static void TProcDecl__23 (void) } OPP_Receiver(&objMode, objName, &objTyp, &recTyp); if (OPP_sym == 38) { - __COPY(OPS_name, *ProcedureDeclaration__16_s->name, 256); + __MOVE(OPS_name, *ProcedureDeclaration__16_s->name, 256); OPP_CheckMark(&*ProcedureDeclaration__16_s->vis); OPT_FindField(*ProcedureDeclaration__16_s->name, recTyp, &*ProcedureDeclaration__16_s->fwd); OPT_FindField(*ProcedureDeclaration__16_s->name, recTyp->BaseTyp, &baseProc); @@ -1129,7 +1129,7 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) TProcDecl__23(); } else if (OPP_sym == 38) { OPT_Find(&fwd); - __COPY(OPS_name, name, 256); + __MOVE(OPS_name, name, 256); OPP_CheckMark(&vis); if ((vis != 0 && mode == 6)) { mode = 7; diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index 2814e733..b748e221 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index 7218afe1..eee78d80 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index a860454b..7ab70899 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index de44eed9..b58d6175 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -434,8 +434,8 @@ void OPT_Init (OPS_Name name, UINT32 opt) OPT_topScope = OPT_universe; OPT_OpenScope(0, NIL); OPT_SYSimported = 0; - __COPY(name, OPT_SelfName, 256); - __COPY(name, OPT_topScope->name, 256); + __MOVE(name, OPT_SelfName, 256); + __MOVE(name, OPT_topScope->name, 256); OPT_GlbMod[0] = OPT_topScope; OPT_nofGmod = 1; OPT_newsf = __IN(4, opt, 32); @@ -1186,7 +1186,7 @@ static void OPT_InStruct (OPT_Struct *typ) } *typ = OPT_NewStr(0, 1); } else { - __COPY(name, obj->name, 256); + __MOVE(name, obj->name, 256); OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, 64)]->right, &old); if (old != NIL) { OPT_FPrintObj(old); diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 86256024..67996e8e 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 7a7ce5c1..22c12372 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -163,7 +163,7 @@ static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exporte } scope = obj->scope; scope->leaf = 1; - __COPY(obj->name, scope->name, 256); + __MOVE(obj->name, scope->name, 256); OPV_Stamp(scope->name); if (mode == 9) { obj->adr = 1; @@ -1286,7 +1286,17 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPM_WriteString((CHAR*)", ", 3); if (r->typ == OPT_stringtyp) { OPM_WriteInt(r->conval->intval2); + } else if (r->typ->comp == 3) { + OPM_WriteString((CHAR*)"__X(", 5); + OPC_Len(r->obj, r->typ, 0); + OPM_WriteString((CHAR*)" * ", 4); + OPM_WriteInt(r->typ->BaseTyp->size); + OPM_WriteString((CHAR*)", ", 3); + OPM_WriteInt(l->typ->size); + OPM_Write(')'); } else { + __ASSERT(r->typ->comp == 2, 0); + __ASSERT(r->typ->size <= l->typ->size, 0); OPM_WriteInt(r->typ->size); } OPM_Write(')'); diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index 9a8653a0..43aaf24a 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Out.c b/bootstrap/unix-88/Out.c index 1508a8bb..a03cf592 100644 --- a/bootstrap/unix-88/Out.c +++ b/bootstrap/unix-88/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Out.h b/bootstrap/unix-88/Out.h index b273390e..27f2c9bb 100644 --- a/bootstrap/unix-88/Out.h +++ b/bootstrap/unix-88/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index a211fab4..eadd3813 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -7,37 +7,18 @@ #include "SYSTEM.h" -typedef - CHAR (*Platform_ArgPtr)[1024]; - -typedef - Platform_ArgPtr (*Platform_ArgVec)[1024]; - -typedef - INT64 (*Platform_ArgVecPtr)[1]; - -typedef - CHAR (*Platform_EnvPtr)[1024]; - typedef struct Platform_FileIdentity { INT32 volume, index, mtime; } Platform_FileIdentity; -typedef - void (*Platform_HaltProcedure)(INT32); - typedef void (*Platform_SignalHandler)(INT32); export BOOLEAN Platform_LittleEndian; -export INT64 Platform_MainStackFrame; export INT16 Platform_PID; export CHAR Platform_CWD[256]; -export INT16 Platform_ArgCount; -export INT64 Platform_ArgVector; -static Platform_HaltProcedure Platform_HaltHandler; static INT32 Platform_TimeStart; export INT16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; export CHAR Platform_NL[3]; @@ -45,7 +26,6 @@ export CHAR Platform_NL[3]; export ADDRESS *Platform_FileIdentity__typ; export BOOLEAN Platform_Absent (INT16 e); -export INT16 Platform_ArgPos (CHAR *s, ADDRESS s__len); export INT16 Platform_Chdir (CHAR *n, ADDRESS n__len); export INT16 Platform_Close (INT32 h); export BOOLEAN Platform_ConnectionFailed (INT16 e); @@ -53,15 +33,12 @@ export void Platform_Delay (INT32 ms); export BOOLEAN Platform_DifferentFilesystems (INT16 e); export INT16 Platform_Error (void); export void Platform_Exit (INT32 code); -export void Platform_GetArg (INT16 n, CHAR *val, ADDRESS val__len); export void Platform_GetClock (INT32 *t, INT32 *d); export void Platform_GetEnv (CHAR *var, ADDRESS var__len, CHAR *val, ADDRESS val__len); -export void Platform_GetIntArg (INT16 n, INT32 *val); export void Platform_GetTimeOfDay (INT32 *sec, INT32 *usec); export INT16 Platform_Identify (INT32 h, Platform_FileIdentity *identity, ADDRESS *identity__typ); export INT16 Platform_IdentifyByName (CHAR *n, ADDRESS n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ); export BOOLEAN Platform_Inaccessible (INT16 e); -export void Platform_Init (INT32 argc, INT64 argvadr); export BOOLEAN Platform_Interrupted (INT16 e); export BOOLEAN Platform_IsConsole (INT32 h); export void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d); @@ -117,8 +94,6 @@ export BOOLEAN Platform_getEnv (CHAR *var, ADDRESS var__len, CHAR *val, ADDRESS #define Platform_EROFS() EROFS #define Platform_ETIMEDOUT() ETIMEDOUT #define Platform_EXDEV() EXDEV -extern void Heap_InitHeap(); -#define Platform_HeapInitHeap() Heap_InitHeap() #define Platform_allocate(size) (ADDRESS)((void*)malloc((size_t)size)) #define Platform_chdir(n, n__len) chdir((char*)n) #define Platform_closefile(fd) close(fd) @@ -129,7 +104,7 @@ extern void Heap_InitHeap(); #define Platform_fsync(fd) fsync(fd) #define Platform_ftruncate(fd, l) ftruncate(fd, l) #define Platform_getcwd(cwd, cwd__len) getcwd((char*)cwd, cwd__len) -#define Platform_getenv(var, var__len) (Platform_EnvPtr)getenv((char*)var) +#define Platform_getenv(var, var__len) getenv((char*)var) #define Platform_getpid() (INTEGER)getpid() #define Platform_gettimeval() struct timeval tv; gettimeofday(&tv,0) #define Platform_isatty(fd) isatty(fd) @@ -213,21 +188,14 @@ void Platform_OSFree (INT64 address) Platform_free(address); } -void Platform_Init (INT32 argc, INT64 argvadr) -{ - Platform_ArgVecPtr av = NIL; - Platform_MainStackFrame = argvadr; - Platform_ArgCount = __VAL(INT16, argc); - av = (Platform_ArgVecPtr)(ADDRESS)argvadr; - Platform_ArgVector = (*av)[0]; - Platform_HeapInitHeap(); -} +typedef + CHAR (*EnvPtr__78)[1024]; BOOLEAN Platform_getEnv (CHAR *var, ADDRESS var__len, CHAR *val, ADDRESS val__len) { - Platform_EnvPtr p = NIL; + EnvPtr__78 p = NIL; __DUP(var, var__len, CHAR); - p = Platform_getenv(var, var__len); + p = (EnvPtr__78)(ADDRESS)Platform_getenv(var, var__len); if (p != NIL) { __COPY(*p, val, val__len); } @@ -244,56 +212,6 @@ void Platform_GetEnv (CHAR *var, ADDRESS var__len, CHAR *val, ADDRESS val__len) __DEL(var); } -void Platform_GetArg (INT16 n, CHAR *val, ADDRESS val__len) -{ - Platform_ArgVec av = NIL; - if (n < Platform_ArgCount) { - av = (Platform_ArgVec)(ADDRESS)Platform_ArgVector; - __COPY(*(*av)[__X(n, 1024)], val, val__len); - } -} - -void Platform_GetIntArg (INT16 n, INT32 *val) -{ - CHAR s[64]; - INT32 k, d, i; - s[0] = 0x00; - Platform_GetArg(n, (void*)s, 64); - i = 0; - if (s[0] == '-') { - i = 1; - } - k = 0; - d = (INT16)s[__X(i, 64)] - 48; - while ((d >= 0 && d <= 9)) { - k = k * 10 + d; - i += 1; - d = (INT16)s[__X(i, 64)] - 48; - } - if (s[0] == '-') { - k = -k; - i -= 1; - } - if (i > 0) { - *val = k; - } -} - -INT16 Platform_ArgPos (CHAR *s, ADDRESS s__len) -{ - INT16 i; - CHAR arg[256]; - __DUP(s, s__len, CHAR); - i = 0; - Platform_GetArg(i, (void*)arg, 256); - while ((i < Platform_ArgCount && __STRCMP(s, arg) != 0)) { - i += 1; - Platform_GetArg(i, (void*)arg, 256); - } - __DEL(s); - return i; -} - void Platform_SetInterruptHandler (Platform_SignalHandler handler) { Platform_sethandler(2, handler); @@ -587,7 +505,6 @@ export void *Platform__init(void) __INITYP(Platform_FileIdentity, Platform_FileIdentity, 0); /* BEGIN */ Platform_TestLittleEndian(); - Platform_HaltHandler = NIL; Platform_TimeStart = 0; Platform_TimeStart = Platform_Time(); Platform_PID = Platform_getpid(); diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index 131a8aa8..ee748a4f 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h @@ -16,18 +16,14 @@ typedef import BOOLEAN Platform_LittleEndian; -import INT64 Platform_MainStackFrame; import INT16 Platform_PID; import CHAR Platform_CWD[256]; -import INT16 Platform_ArgCount; -import INT64 Platform_ArgVector; import INT16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; import CHAR Platform_NL[3]; import ADDRESS *Platform_FileIdentity__typ; import BOOLEAN Platform_Absent (INT16 e); -import INT16 Platform_ArgPos (CHAR *s, ADDRESS s__len); import INT16 Platform_Chdir (CHAR *n, ADDRESS n__len); import INT16 Platform_Close (INT32 h); import BOOLEAN Platform_ConnectionFailed (INT16 e); @@ -35,15 +31,12 @@ import void Platform_Delay (INT32 ms); import BOOLEAN Platform_DifferentFilesystems (INT16 e); import INT16 Platform_Error (void); import void Platform_Exit (INT32 code); -import void Platform_GetArg (INT16 n, CHAR *val, ADDRESS val__len); import void Platform_GetClock (INT32 *t, INT32 *d); import void Platform_GetEnv (CHAR *var, ADDRESS var__len, CHAR *val, ADDRESS val__len); -import void Platform_GetIntArg (INT16 n, INT32 *val); import void Platform_GetTimeOfDay (INT32 *sec, INT32 *usec); import INT16 Platform_Identify (INT32 h, Platform_FileIdentity *identity, ADDRESS *identity__typ); import INT16 Platform_IdentifyByName (CHAR *n, ADDRESS n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ); import BOOLEAN Platform_Inaccessible (INT16 e); -import void Platform_Init (INT32 argc, INT64 argvadr); import BOOLEAN Platform_Interrupted (INT16 e); import BOOLEAN Platform_IsConsole (INT32 h); import void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d); diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index ee1f94ca..e4149017 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index 16a16b7a..e3bfadb5 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index b60bb504..a3f1e808 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index adf86c42..b192b7bb 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index 0bb7d871..a7cc3ff1 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -394,8 +394,8 @@ static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, ADDRESS *msg__t e->file = (*(Texts_Alien*)&E)->file; e->org = (*(Texts_Alien*)&E)->org; e->span = (*(Texts_Alien*)&E)->span; - __COPY((*(Texts_Alien*)&E)->mod, e->mod, 32); - __COPY((*(Texts_Alien*)&E)->proc, e->proc, 32); + __MOVE((*(Texts_Alien*)&E)->mod, e->mod, 32); + __MOVE((*(Texts_Alien*)&E)->proc, e->proc, 32); (*msg__).e = (Texts_Elem)e; } else __WITHCHK; } else if (__IS(msg__typ, Texts_IdentifyMsg, 1)) { diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index b1eafc02..8c1b9016 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/VT100.c b/bootstrap/unix-88/VT100.c index f0e444ea..7a2a840d 100644 --- a/bootstrap/unix-88/VT100.c +++ b/bootstrap/unix-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/VT100.h b/bootstrap/unix-88/VT100.h index 0f1bc5ac..5a3fe6d0 100644 --- a/bootstrap/unix-88/VT100.h +++ b/bootstrap/unix-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index 43e5cb69..657534b4 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index 784b684d..6ad7abb0 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/Compiler.c b/bootstrap/windows-48/Compiler.c index 29524a91..e59d7615 100644 --- a/bootstrap/windows-48/Compiler.c +++ b/bootstrap/windows-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index 54214f70..01281cfc 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index 1e6381e9..98f85767 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index aa879424..841d80d9 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -237,7 +237,7 @@ static void Files_Deregister (CHAR *name, ADDRESS name__len) if (osfile != NIL) { __ASSERT(!osfile->tempFile, 0); __ASSERT(osfile->fd >= 0, 0); - __COPY(osfile->workName, osfile->registerName, 101); + __MOVE(osfile->workName, osfile->registerName, 101); Files_GetTempName(osfile->registerName, 101, (void*)osfile->workName, 101); osfile->tempFile = 1; osfile->state = 0; @@ -262,7 +262,7 @@ static void Files_Create (Files_File f) } else { __ASSERT(f->state == 2, 0); Files_Deregister(f->registerName, 101); - __COPY(f->registerName, f->workName, 101); + __MOVE(f->registerName, f->workName, 101); f->registerName[0] = 0x00; f->tempFile = 0; } @@ -823,7 +823,7 @@ void Files_Register (Files_File f) if (errcode != 0) { Files_Err((CHAR*)"Couldn't rename temp name as register name", 43, f, errcode); } - __COPY(f->registerName, f->workName, 101); + __MOVE(f->registerName, f->workName, 101); f->registerName[0] = 0x00; f->tempFile = 0; } diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index fa8f3e8d..dab76a88 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index af8fd777..b6abc8f3 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -105,12 +105,12 @@ static void Heap_Sift (INT32 l, INT32 r, INT32 *a, ADDRESS a__len); export void Heap_Unlock (void); extern void *Heap__init(); -extern ADDRESS Platform_MainStackFrame; +extern ADDRESS Modules_MainStackFrame; extern ADDRESS Platform_OSAllocate(ADDRESS size); #define Heap_HeapModuleInit() Heap__init() #define Heap_ModulesHalt(code) Modules_Halt(code) +#define Heap_ModulesMainStackFrame() Modules_MainStackFrame #define Heap_OSAllocate(size) Platform_OSAllocate(size) -#define Heap_PlatformMainStackFrame() Platform_MainStackFrame void Heap_Lock (void) { @@ -599,7 +599,7 @@ static void Heap_MarkStack (INT32 n, INT32 *cand, ADDRESS cand__len) if (n == 0) { nofcand = 0; sp = (ADDRESS)&frame; - stack0 = Heap_PlatformMainStackFrame(); + stack0 = Heap_ModulesMainStackFrame(); inc = (ADDRESS)&align.p - (ADDRESS)&align; if (sp > stack0) { inc = -inc; diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index cc058553..82ebd04d 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index 9aedc826..98b3a7e9 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -43,24 +43,105 @@ typedef export INT16 Modules_res; export CHAR Modules_resMsg[256]; export Modules_ModuleName Modules_imported, Modules_importing; +export INT32 Modules_MainStackFrame; +export INT16 Modules_ArgCount; +export INT32 Modules_ArgVector; export ADDRESS *Modules_ModuleDesc__typ; export ADDRESS *Modules_CmdDesc__typ; static void Modules_Append (CHAR *a, ADDRESS a__len, CHAR *b, ADDRESS b__len); +export INT16 Modules_ArgPos (CHAR *s, ADDRESS s__len); export void Modules_AssertFail (INT32 code); static void Modules_DisplayHaltCode (INT32 code); export void Modules_Free (CHAR *name, ADDRESS name__len, BOOLEAN all); +export void Modules_GetArg (INT16 n, CHAR *val, ADDRESS val__len); +export void Modules_GetIntArg (INT16 n, INT32 *val); export void Modules_Halt (INT32 code); +export void Modules_Init (INT32 argc, INT32 argvadr); export Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, ADDRESS name__len); export Modules_Module Modules_ThisMod (CHAR *name, ADDRESS name__len); static void Modules_errch (CHAR c); static void Modules_errint (INT32 l); static void Modules_errstring (CHAR *s, ADDRESS s__len); +extern void Heap_InitHeap(); +extern void *Modules__init(void); +#define Modules_InitHeap() Heap_InitHeap() +#define Modules_ModulesInit() Modules__init() #define Modules_modules() (Modules_Module)Heap_modules #define Modules_setmodules(m) Heap_modules = m +typedef + INT32 (*ArgVecPtr__14)[1]; + +void Modules_Init (INT32 argc, INT32 argvadr) +{ + ArgVecPtr__14 av = NIL; + Modules_MainStackFrame = argvadr; + Modules_ArgCount = __VAL(INT16, argc); + av = (ArgVecPtr__14)(ADDRESS)argvadr; + Modules_ArgVector = (*av)[0]; + Modules_InitHeap(); + Modules_ModulesInit(); +} + +typedef + CHAR (*ArgPtr__9)[1024]; + +typedef + ArgPtr__9 (*ArgVec__10)[1024]; + +void Modules_GetArg (INT16 n, CHAR *val, ADDRESS val__len) +{ + ArgVec__10 av = NIL; + if (n < Modules_ArgCount) { + av = (ArgVec__10)(ADDRESS)Modules_ArgVector; + __COPY(*(*av)[__X(n, 1024)], val, val__len); + } +} + +void Modules_GetIntArg (INT16 n, INT32 *val) +{ + CHAR s[64]; + INT32 k, d, i; + s[0] = 0x00; + Modules_GetArg(n, (void*)s, 64); + i = 0; + if (s[0] == '-') { + i = 1; + } + k = 0; + d = (INT16)s[__X(i, 64)] - 48; + while ((d >= 0 && d <= 9)) { + k = k * 10 + d; + i += 1; + d = (INT16)s[__X(i, 64)] - 48; + } + if (s[0] == '-') { + k = -k; + i -= 1; + } + if (i > 0) { + *val = k; + } +} + +INT16 Modules_ArgPos (CHAR *s, ADDRESS s__len) +{ + INT16 i; + CHAR arg[256]; + __DUP(s, s__len, CHAR); + i = 0; + Modules_GetArg(i, (void*)arg, 256); + while ((i < Modules_ArgCount && __STRCMP(s, arg) != 0)) { + i += 1; + Modules_GetArg(i, (void*)arg, 256); + } + __DEL(s); + return i; +} + static void Modules_Append (CHAR *a, ADDRESS a__len, CHAR *b, ADDRESS b__len) { INT16 i, j; @@ -165,7 +246,7 @@ void Modules_Free (CHAR *name, ADDRESS name__len, BOOLEAN all) static void Modules_errch (CHAR c) { INT16 e; - e = Platform_Write(1, (ADDRESS)&c, 1); + e = Platform_Write(Platform_StdOut, (ADDRESS)&c, 1); } static void Modules_errstring (CHAR *s, ADDRESS s__len) diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index 568db414..3ab94701 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h @@ -39,13 +39,20 @@ typedef import INT16 Modules_res; import CHAR Modules_resMsg[256]; import Modules_ModuleName Modules_imported, Modules_importing; +import INT32 Modules_MainStackFrame; +import INT16 Modules_ArgCount; +import INT32 Modules_ArgVector; import ADDRESS *Modules_ModuleDesc__typ; import ADDRESS *Modules_CmdDesc__typ; +import INT16 Modules_ArgPos (CHAR *s, ADDRESS s__len); import void Modules_AssertFail (INT32 code); import void Modules_Free (CHAR *name, ADDRESS name__len, BOOLEAN all); +import void Modules_GetArg (INT16 n, CHAR *val, ADDRESS val__len); +import void Modules_GetIntArg (INT16 n, INT32 *val); import void Modules_Halt (INT32 code); +import void Modules_Init (INT32 argc, INT32 argvadr); import Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, ADDRESS name__len); import Modules_Module Modules_ThisMod (CHAR *name, ADDRESS name__len); import void *Modules__init(void); diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index 2e03b5fc..d9e826b8 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -253,7 +253,7 @@ OPT_Node OPB_NewString (OPS_String str, INT64 len) x->conval->intval = -1; x->conval->intval2 = OPM_Longint(len); x->conval->ext = OPT_NewExt(); - __COPY(str, *x->conval->ext, 256); + __MOVE(str, *x->conval->ext, 256); return x; } @@ -1624,23 +1624,19 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) g = 8; } if (x == y) { + } else if ((((y->comp == 2 && y->BaseTyp == x->BaseTyp)) && y->n <= x->n)) { + } else if ((y->comp == 3 && y->BaseTyp == x->BaseTyp)) { } else if (x->BaseTyp == OPT_chartyp) { if (g == 8) { if (ynode->conval->intval2 > x->n) { OPB_err(114); } - } else if ((__IN(y->comp, 0x0c, 32) && y->BaseTyp == OPT_chartyp)) { } else { OPB_err(113); } } else { OPB_err(113); } - } else if ((x->comp == 3 && x->BaseTyp == OPT_chartyp)) { - if ((__IN(y->comp, 0x0c, 32) && y->BaseTyp == OPT_chartyp)) { - } else { - OPB_err(113); - } } else if (x->comp == 4) { if (x == y) { } else if (y->comp == 4) { @@ -2536,7 +2532,6 @@ void OPB_Return (OPT_Node *x, OPT_Object proc) void OPB_Assign (OPT_Node *x, OPT_Node y) { OPT_Node z = NIL; - INT8 subcl; if ((*x)->class >= 7) { OPB_err(56); } @@ -2562,13 +2557,8 @@ void OPB_Assign (OPT_Node *x, OPT_Node y) y->conval->intval = 0; OPB_Index(&*x, OPB_NewIntConst(0)); } - if ((((((__IN((*x)->typ->comp, 0x0c, 32) && (*x)->typ->BaseTyp == OPT_chartyp)) && __IN(y->typ->comp, 0x0c, 32))) && y->typ->BaseTyp == OPT_chartyp)) { - subcl = 18; - } else { - subcl = 0; - } OPB_BindNodes(19, OPT_notyp, &*x, y); - (*x)->subcl = subcl; + (*x)->subcl = 0; } void OPB_Inittd (OPT_Node *inittd, OPT_Node *last, OPT_Struct typ) diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index 6641207d..2c396170 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index fd11366a..5f4dc826 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index 4eff8cf5..f9bc06a4 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 58701bfc..1732c950 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -8,6 +8,7 @@ #include "SYSTEM.h" #include "Configuration.h" #include "Files.h" +#include "Modules.h" #include "Out.h" #include "Platform.h" #include "Strings.h" @@ -266,7 +267,7 @@ static void OPM_ScanOptions (CHAR *s, ADDRESS s__len) BOOLEAN OPM_OpenPar (void) { CHAR s[256]; - if (Platform_ArgCount == 1) { + if (Modules_ArgCount == 1) { OPM_LogWLn(); OPM_LogWStr((CHAR*)"Oberon-2 compiler v", 20); OPM_LogWStr(Configuration_versionLong, 75); @@ -362,16 +363,16 @@ BOOLEAN OPM_OpenPar (void) OPM_Options = 0xa9; OPM_S = 1; s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, 256); + Modules_GetArg(OPM_S, (void*)s, 256); while (s[0] == '-') { OPM_ScanOptions(s, 256); OPM_S += 1; s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, 256); + Modules_GetArg(OPM_S, (void*)s, 256); } OPM_GlobalAddressSize = OPM_AddressSize; OPM_GlobalAlignment = OPM_Alignment; - __COPY(OPM_Model, OPM_GlobalModel, 10); + __MOVE(OPM_Model, OPM_GlobalModel, 10); OPM_GlobalOptions = OPM_Options; return 1; } @@ -410,16 +411,16 @@ void OPM_InitOptions (void) CHAR searchpath[1024], modules[1024]; CHAR MODULES[1024]; OPM_Options = OPM_GlobalOptions; - __COPY(OPM_GlobalModel, OPM_Model, 10); + __MOVE(OPM_GlobalModel, OPM_Model, 10); OPM_Alignment = OPM_GlobalAlignment; OPM_AddressSize = OPM_GlobalAddressSize; s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, 256); + Modules_GetArg(OPM_S, (void*)s, 256); while (s[0] == '-') { OPM_ScanOptions(s, 256); OPM_S += 1; s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, 256); + Modules_GetArg(OPM_S, (void*)s, 256); } if (__IN(15, OPM_Options, 32)) { OPM_Options |= __SETOF(10,32); @@ -472,11 +473,11 @@ void OPM_Init (BOOLEAN *done, CHAR *mname, ADDRESS mname__len) CHAR s[256]; *done = 0; OPM_curpos = 0; - if (OPM_S >= Platform_ArgCount) { + if (OPM_S >= Modules_ArgCount) { return; } s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, 256); + Modules_GetArg(OPM_S, (void*)s, 256); __NEW(T, Texts_TextDesc); Texts_Open(T, s, 256); OPM_LogWStr(s, 256); @@ -1070,6 +1071,7 @@ export void *OPM__init(void) __DEFMOD; __MODULE_IMPORT(Configuration); __MODULE_IMPORT(Files); + __MODULE_IMPORT(Modules); __MODULE_IMPORT(Out); __MODULE_IMPORT(Platform); __MODULE_IMPORT(Strings); diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index 4dd3d03b..979995c8 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index d4922137..69624c1f 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -527,7 +527,7 @@ static void OPP_selector (OPT_Node *x) } else if (OPP_sym == 18) { OPS_Get(&OPP_sym); if (OPP_sym == 38) { - __COPY(OPS_name, name, 256); + __MOVE(OPS_name, name, 256); OPS_Get(&OPP_sym); if ((*x)->typ != NIL) { if ((*x)->typ->form == 11) { @@ -867,7 +867,7 @@ static void OPP_Receiver (INT8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct } else { *mode = 1; } - __COPY(OPS_name, name, 256); + __MOVE(OPS_name, name, 256); OPP_CheckSym(38); OPP_CheckSym(20); if (OPP_sym == 38) { @@ -1030,7 +1030,7 @@ static void TProcDecl__23 (void) } OPP_Receiver(&objMode, objName, &objTyp, &recTyp); if (OPP_sym == 38) { - __COPY(OPS_name, *ProcedureDeclaration__16_s->name, 256); + __MOVE(OPS_name, *ProcedureDeclaration__16_s->name, 256); OPP_CheckMark(&*ProcedureDeclaration__16_s->vis); OPT_FindField(*ProcedureDeclaration__16_s->name, recTyp, &*ProcedureDeclaration__16_s->fwd); OPT_FindField(*ProcedureDeclaration__16_s->name, recTyp->BaseTyp, &baseProc); @@ -1129,7 +1129,7 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) TProcDecl__23(); } else if (OPP_sym == 38) { OPT_Find(&fwd); - __COPY(OPS_name, name, 256); + __MOVE(OPS_name, name, 256); OPP_CheckMark(&vis); if ((vis != 0 && mode == 6)) { mode = 7; diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index 2814e733..b748e221 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index 7218afe1..eee78d80 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index a860454b..7ab70899 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index aa53a484..174aae08 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -434,8 +434,8 @@ void OPT_Init (OPS_Name name, UINT32 opt) OPT_topScope = OPT_universe; OPT_OpenScope(0, NIL); OPT_SYSimported = 0; - __COPY(name, OPT_SelfName, 256); - __COPY(name, OPT_topScope->name, 256); + __MOVE(name, OPT_SelfName, 256); + __MOVE(name, OPT_topScope->name, 256); OPT_GlbMod[0] = OPT_topScope; OPT_nofGmod = 1; OPT_newsf = __IN(4, opt, 32); @@ -1186,7 +1186,7 @@ static void OPT_InStruct (OPT_Struct *typ) } *typ = OPT_NewStr(0, 1); } else { - __COPY(name, obj->name, 256); + __MOVE(name, obj->name, 256); OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, 64)]->right, &old); if (old != NIL) { OPT_FPrintObj(old); diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index 86256024..67996e8e 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index eb5ad767..fb6ac690 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -163,7 +163,7 @@ static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exporte } scope = obj->scope; scope->leaf = 1; - __COPY(obj->name, scope->name, 256); + __MOVE(obj->name, scope->name, 256); OPV_Stamp(scope->name); if (mode == 9) { obj->adr = 1; @@ -1286,7 +1286,17 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPM_WriteString((CHAR*)", ", 3); if (r->typ == OPT_stringtyp) { OPM_WriteInt(r->conval->intval2); + } else if (r->typ->comp == 3) { + OPM_WriteString((CHAR*)"__X(", 5); + OPC_Len(r->obj, r->typ, 0); + OPM_WriteString((CHAR*)" * ", 4); + OPM_WriteInt(r->typ->BaseTyp->size); + OPM_WriteString((CHAR*)", ", 3); + OPM_WriteInt(l->typ->size); + OPM_Write(')'); } else { + __ASSERT(r->typ->comp == 2, 0); + __ASSERT(r->typ->size <= l->typ->size, 0); OPM_WriteInt(r->typ->size); } OPM_Write(')'); diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index 9a8653a0..43aaf24a 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Out.c b/bootstrap/windows-48/Out.c index 0edcb502..0d3f9e29 100644 --- a/bootstrap/windows-48/Out.c +++ b/bootstrap/windows-48/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Out.h b/bootstrap/windows-48/Out.h index b273390e..27f2c9bb 100644 --- a/bootstrap/windows-48/Out.h +++ b/bootstrap/windows-48/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 78f4409a..4a164fb8 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -7,48 +7,26 @@ #include "SYSTEM.h" -typedef - CHAR (*Platform_ArgPtr)[1024]; - -typedef - Platform_ArgPtr (*Platform_ArgVec)[1024]; - -typedef - INT32 (*Platform_ArgVecPtr)[1]; - -typedef - CHAR (*Platform_EnvPtr)[1024]; - typedef struct Platform_FileIdentity { INT32 volume, indexhigh, indexlow, mtimehigh, mtimelow; } Platform_FileIdentity; -typedef - void (*Platform_HaltProcedure)(INT32); - typedef void (*Platform_SignalHandler)(INT32); export BOOLEAN Platform_LittleEndian; -export INT32 Platform_MainStackFrame; -export INT32 Platform_HaltCode; export INT16 Platform_PID; export CHAR Platform_CWD[4096]; -export INT16 Platform_ArgCount; -export INT32 Platform_ArgVector; -static Platform_HaltProcedure Platform_HaltHandler; static INT32 Platform_TimeStart; export INT16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; export INT32 Platform_StdIn, Platform_StdOut, Platform_StdErr; -static Platform_SignalHandler Platform_InterruptHandler; export CHAR Platform_NL[3]; export ADDRESS *Platform_FileIdentity__typ; export BOOLEAN Platform_Absent (INT16 e); -export INT16 Platform_ArgPos (CHAR *s, ADDRESS s__len); export INT16 Platform_Chdir (CHAR *n, ADDRESS n__len); export INT16 Platform_Close (INT32 h); export BOOLEAN Platform_ConnectionFailed (INT16 e); @@ -57,15 +35,12 @@ export BOOLEAN Platform_DifferentFilesystems (INT16 e); static void Platform_EnableVT100 (void); export INT16 Platform_Error (void); export void Platform_Exit (INT32 code); -export void Platform_GetArg (INT16 n, CHAR *val, ADDRESS val__len); export void Platform_GetClock (INT32 *t, INT32 *d); export void Platform_GetEnv (CHAR *var, ADDRESS var__len, CHAR *val, ADDRESS val__len); -export void Platform_GetIntArg (INT16 n, INT32 *val); export void Platform_GetTimeOfDay (INT32 *sec, INT32 *usec); export INT16 Platform_Identify (INT32 h, Platform_FileIdentity *identity, ADDRESS *identity__typ); export INT16 Platform_IdentifyByName (CHAR *n, ADDRESS n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ); export BOOLEAN Platform_Inaccessible (INT16 e); -export void Platform_Init (INT32 argc, INT32 argvadr); export BOOLEAN Platform_Interrupted (INT16 e); export BOOLEAN Platform_IsConsole (INT32 h); export void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d); @@ -111,10 +86,8 @@ export BOOLEAN Platform_getEnv (CHAR *var, ADDRESS var__len, CHAR *val, ADDRESS #define Platform_ERRORTOOMANYOPENFILES() ERROR_TOO_MANY_OPEN_FILES #define Platform_ERRORWRITEPROTECT() ERROR_WRITE_PROTECT #define Platform_ETIMEDOUT() WSAETIMEDOUT -extern void Heap_InitHeap(); #define Platform_GetConsoleMode(h, m) GetConsoleMode((HANDLE)h, (DWORD*)m) #define Platform_GetTickCount() (LONGINT)(UINT32)GetTickCount() -#define Platform_HeapInitHeap() Heap_InitHeap() #define Platform_SetConsoleMode(h, m) SetConsoleMode((HANDLE)h, (DWORD)m) #define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((ADDRESS)h) #define Platform_SetQuitHandler(h) SystemSetQuitHandler((ADDRESS)h) @@ -228,17 +201,6 @@ void Platform_OSFree (INT32 address) Platform_free(address); } -void Platform_Init (INT32 argc, INT32 argvadr) -{ - Platform_ArgVecPtr av = NIL; - Platform_MainStackFrame = argvadr; - Platform_ArgCount = __VAL(INT16, argc); - av = (Platform_ArgVecPtr)(ADDRESS)argvadr; - Platform_ArgVector = (*av)[0]; - Platform_HaltCode = -128; - Platform_HeapInitHeap(); -} - BOOLEAN Platform_getEnv (CHAR *var, ADDRESS var__len, CHAR *val, ADDRESS val__len) { CHAR buf[4096]; @@ -265,56 +227,6 @@ void Platform_GetEnv (CHAR *var, ADDRESS var__len, CHAR *val, ADDRESS val__len) __DEL(var); } -void Platform_GetArg (INT16 n, CHAR *val, ADDRESS val__len) -{ - Platform_ArgVec av = NIL; - if (n < Platform_ArgCount) { - av = (Platform_ArgVec)(ADDRESS)Platform_ArgVector; - __COPY(*(*av)[__X(n, 1024)], val, val__len); - } -} - -void Platform_GetIntArg (INT16 n, INT32 *val) -{ - CHAR s[64]; - INT32 k, d, i; - s[0] = 0x00; - Platform_GetArg(n, (void*)s, 64); - i = 0; - if (s[0] == '-') { - i = 1; - } - k = 0; - d = (INT16)s[__X(i, 64)] - 48; - while ((d >= 0 && d <= 9)) { - k = k * 10 + d; - i += 1; - d = (INT16)s[__X(i, 64)] - 48; - } - if (s[0] == '-') { - k = -k; - i -= 1; - } - if (i > 0) { - *val = k; - } -} - -INT16 Platform_ArgPos (CHAR *s, ADDRESS s__len) -{ - INT16 i; - CHAR arg[256]; - __DUP(s, s__len, CHAR); - i = 0; - Platform_GetArg(i, (void*)arg, 256); - while ((i < Platform_ArgCount && __STRCMP(s, arg) != 0)) { - i += 1; - Platform_GetArg(i, (void*)arg, 256); - } - __DEL(s); - return i; -} - void Platform_SetBadInstructionHandler (Platform_SignalHandler handler) { } @@ -646,8 +558,6 @@ export void *Platform__init(void) __INITYP(Platform_FileIdentity, Platform_FileIdentity, 0); /* BEGIN */ Platform_TestLittleEndian(); - Platform_HaltCode = -128; - Platform_HaltHandler = NIL; Platform_TimeStart = 0; Platform_TimeStart = Platform_Time(); Platform_CWD[0] = 0x00; diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index a4ad7737..adfe4173 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h @@ -16,12 +16,8 @@ typedef import BOOLEAN Platform_LittleEndian; -import INT32 Platform_MainStackFrame; -import INT32 Platform_HaltCode; import INT16 Platform_PID; import CHAR Platform_CWD[4096]; -import INT16 Platform_ArgCount; -import INT32 Platform_ArgVector; import INT16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; import INT32 Platform_StdIn, Platform_StdOut, Platform_StdErr; import CHAR Platform_NL[3]; @@ -29,7 +25,6 @@ import CHAR Platform_NL[3]; import ADDRESS *Platform_FileIdentity__typ; import BOOLEAN Platform_Absent (INT16 e); -import INT16 Platform_ArgPos (CHAR *s, ADDRESS s__len); import INT16 Platform_Chdir (CHAR *n, ADDRESS n__len); import INT16 Platform_Close (INT32 h); import BOOLEAN Platform_ConnectionFailed (INT16 e); @@ -37,15 +32,12 @@ import void Platform_Delay (INT32 ms); import BOOLEAN Platform_DifferentFilesystems (INT16 e); import INT16 Platform_Error (void); import void Platform_Exit (INT32 code); -import void Platform_GetArg (INT16 n, CHAR *val, ADDRESS val__len); import void Platform_GetClock (INT32 *t, INT32 *d); import void Platform_GetEnv (CHAR *var, ADDRESS var__len, CHAR *val, ADDRESS val__len); -import void Platform_GetIntArg (INT16 n, INT32 *val); import void Platform_GetTimeOfDay (INT32 *sec, INT32 *usec); import INT16 Platform_Identify (INT32 h, Platform_FileIdentity *identity, ADDRESS *identity__typ); import INT16 Platform_IdentifyByName (CHAR *n, ADDRESS n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ); import BOOLEAN Platform_Inaccessible (INT16 e); -import void Platform_Init (INT32 argc, INT32 argvadr); import BOOLEAN Platform_Interrupted (INT16 e); import BOOLEAN Platform_IsConsole (INT32 h); import void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d); diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index ee1f94ca..e4149017 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index 16a16b7a..e3bfadb5 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index b60bb504..a3f1e808 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index adf86c42..b192b7bb 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index c9010809..4fa93c49 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -394,8 +394,8 @@ static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, ADDRESS *msg__t e->file = (*(Texts_Alien*)&E)->file; e->org = (*(Texts_Alien*)&E)->org; e->span = (*(Texts_Alien*)&E)->span; - __COPY((*(Texts_Alien*)&E)->mod, e->mod, 32); - __COPY((*(Texts_Alien*)&E)->proc, e->proc, 32); + __MOVE((*(Texts_Alien*)&E)->mod, e->mod, 32); + __MOVE((*(Texts_Alien*)&E)->proc, e->proc, 32); (*msg__).e = (Texts_Elem)e; } else __WITHCHK; } else if (__IS(msg__typ, Texts_IdentifyMsg, 1)) { diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index 16b07b6f..235cecb4 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/VT100.c b/bootstrap/windows-48/VT100.c index f0e444ea..7a2a840d 100644 --- a/bootstrap/windows-48/VT100.c +++ b/bootstrap/windows-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/VT100.h b/bootstrap/windows-48/VT100.h index 0f1bc5ac..5a3fe6d0 100644 --- a/bootstrap/windows-48/VT100.h +++ b/bootstrap/windows-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index 43e5cb69..657534b4 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index 784b684d..6ad7abb0 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/Compiler.c b/bootstrap/windows-88/Compiler.c index 29524a91..e59d7615 100644 --- a/bootstrap/windows-88/Compiler.c +++ b/bootstrap/windows-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index 54214f70..01281cfc 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index 1e6381e9..98f85767 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index f83fafeb..8ad0e207 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -238,7 +238,7 @@ static void Files_Deregister (CHAR *name, ADDRESS name__len) if (osfile != NIL) { __ASSERT(!osfile->tempFile, 0); __ASSERT(osfile->fd >= 0, 0); - __COPY(osfile->workName, osfile->registerName, 101); + __MOVE(osfile->workName, osfile->registerName, 101); Files_GetTempName(osfile->registerName, 101, (void*)osfile->workName, 101); osfile->tempFile = 1; osfile->state = 0; @@ -263,7 +263,7 @@ static void Files_Create (Files_File f) } else { __ASSERT(f->state == 2, 0); Files_Deregister(f->registerName, 101); - __COPY(f->registerName, f->workName, 101); + __MOVE(f->registerName, f->workName, 101); f->registerName[0] = 0x00; f->tempFile = 0; } @@ -825,7 +825,7 @@ void Files_Register (Files_File f) if (errcode != 0) { Files_Err((CHAR*)"Couldn't rename temp name as register name", 43, f, errcode); } - __COPY(f->registerName, f->workName, 101); + __MOVE(f->registerName, f->workName, 101); f->registerName[0] = 0x00; f->tempFile = 0; } diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 1d930af8..3631e4aa 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index 95dd55ee..222162d5 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -105,12 +105,12 @@ static void Heap_Sift (INT64 l, INT64 r, INT64 *a, ADDRESS a__len); export void Heap_Unlock (void); extern void *Heap__init(); -extern ADDRESS Platform_MainStackFrame; +extern ADDRESS Modules_MainStackFrame; extern ADDRESS Platform_OSAllocate(ADDRESS size); #define Heap_HeapModuleInit() Heap__init() #define Heap_ModulesHalt(code) Modules_Halt(code) +#define Heap_ModulesMainStackFrame() Modules_MainStackFrame #define Heap_OSAllocate(size) Platform_OSAllocate(size) -#define Heap_PlatformMainStackFrame() Platform_MainStackFrame void Heap_Lock (void) { @@ -599,7 +599,7 @@ static void Heap_MarkStack (INT64 n, INT64 *cand, ADDRESS cand__len) if (n == 0) { nofcand = 0; sp = (ADDRESS)&frame; - stack0 = Heap_PlatformMainStackFrame(); + stack0 = Heap_ModulesMainStackFrame(); inc = (ADDRESS)&align.p - (ADDRESS)&align; if (sp > stack0) { inc = -inc; diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index b96e0160..585db2f0 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 9b72d021..c6884be5 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -43,24 +43,105 @@ typedef export INT16 Modules_res; export CHAR Modules_resMsg[256]; export Modules_ModuleName Modules_imported, Modules_importing; +export INT64 Modules_MainStackFrame; +export INT16 Modules_ArgCount; +export INT64 Modules_ArgVector; export ADDRESS *Modules_ModuleDesc__typ; export ADDRESS *Modules_CmdDesc__typ; static void Modules_Append (CHAR *a, ADDRESS a__len, CHAR *b, ADDRESS b__len); +export INT16 Modules_ArgPos (CHAR *s, ADDRESS s__len); export void Modules_AssertFail (INT32 code); static void Modules_DisplayHaltCode (INT32 code); export void Modules_Free (CHAR *name, ADDRESS name__len, BOOLEAN all); +export void Modules_GetArg (INT16 n, CHAR *val, ADDRESS val__len); +export void Modules_GetIntArg (INT16 n, INT32 *val); export void Modules_Halt (INT32 code); +export void Modules_Init (INT32 argc, INT64 argvadr); export Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, ADDRESS name__len); export Modules_Module Modules_ThisMod (CHAR *name, ADDRESS name__len); static void Modules_errch (CHAR c); static void Modules_errint (INT32 l); static void Modules_errstring (CHAR *s, ADDRESS s__len); +extern void Heap_InitHeap(); +extern void *Modules__init(void); +#define Modules_InitHeap() Heap_InitHeap() +#define Modules_ModulesInit() Modules__init() #define Modules_modules() (Modules_Module)Heap_modules #define Modules_setmodules(m) Heap_modules = m +typedef + INT64 (*ArgVecPtr__14)[1]; + +void Modules_Init (INT32 argc, INT64 argvadr) +{ + ArgVecPtr__14 av = NIL; + Modules_MainStackFrame = argvadr; + Modules_ArgCount = __VAL(INT16, argc); + av = (ArgVecPtr__14)(ADDRESS)argvadr; + Modules_ArgVector = (*av)[0]; + Modules_InitHeap(); + Modules_ModulesInit(); +} + +typedef + CHAR (*ArgPtr__9)[1024]; + +typedef + ArgPtr__9 (*ArgVec__10)[1024]; + +void Modules_GetArg (INT16 n, CHAR *val, ADDRESS val__len) +{ + ArgVec__10 av = NIL; + if (n < Modules_ArgCount) { + av = (ArgVec__10)(ADDRESS)Modules_ArgVector; + __COPY(*(*av)[__X(n, 1024)], val, val__len); + } +} + +void Modules_GetIntArg (INT16 n, INT32 *val) +{ + CHAR s[64]; + INT32 k, d, i; + s[0] = 0x00; + Modules_GetArg(n, (void*)s, 64); + i = 0; + if (s[0] == '-') { + i = 1; + } + k = 0; + d = (INT16)s[__X(i, 64)] - 48; + while ((d >= 0 && d <= 9)) { + k = k * 10 + d; + i += 1; + d = (INT16)s[__X(i, 64)] - 48; + } + if (s[0] == '-') { + k = -k; + i -= 1; + } + if (i > 0) { + *val = k; + } +} + +INT16 Modules_ArgPos (CHAR *s, ADDRESS s__len) +{ + INT16 i; + CHAR arg[256]; + __DUP(s, s__len, CHAR); + i = 0; + Modules_GetArg(i, (void*)arg, 256); + while ((i < Modules_ArgCount && __STRCMP(s, arg) != 0)) { + i += 1; + Modules_GetArg(i, (void*)arg, 256); + } + __DEL(s); + return i; +} + static void Modules_Append (CHAR *a, ADDRESS a__len, CHAR *b, ADDRESS b__len) { INT16 i, j; @@ -165,7 +246,7 @@ void Modules_Free (CHAR *name, ADDRESS name__len, BOOLEAN all) static void Modules_errch (CHAR c) { INT16 e; - e = Platform_Write(1, (ADDRESS)&c, 1); + e = Platform_Write(Platform_StdOut, (ADDRESS)&c, 1); } static void Modules_errstring (CHAR *s, ADDRESS s__len) diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index 568db414..a3e555ef 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h @@ -39,13 +39,20 @@ typedef import INT16 Modules_res; import CHAR Modules_resMsg[256]; import Modules_ModuleName Modules_imported, Modules_importing; +import INT64 Modules_MainStackFrame; +import INT16 Modules_ArgCount; +import INT64 Modules_ArgVector; import ADDRESS *Modules_ModuleDesc__typ; import ADDRESS *Modules_CmdDesc__typ; +import INT16 Modules_ArgPos (CHAR *s, ADDRESS s__len); import void Modules_AssertFail (INT32 code); import void Modules_Free (CHAR *name, ADDRESS name__len, BOOLEAN all); +import void Modules_GetArg (INT16 n, CHAR *val, ADDRESS val__len); +import void Modules_GetIntArg (INT16 n, INT32 *val); import void Modules_Halt (INT32 code); +import void Modules_Init (INT32 argc, INT64 argvadr); import Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, ADDRESS name__len); import Modules_Module Modules_ThisMod (CHAR *name, ADDRESS name__len); import void *Modules__init(void); diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index 2e03b5fc..d9e826b8 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -253,7 +253,7 @@ OPT_Node OPB_NewString (OPS_String str, INT64 len) x->conval->intval = -1; x->conval->intval2 = OPM_Longint(len); x->conval->ext = OPT_NewExt(); - __COPY(str, *x->conval->ext, 256); + __MOVE(str, *x->conval->ext, 256); return x; } @@ -1624,23 +1624,19 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) g = 8; } if (x == y) { + } else if ((((y->comp == 2 && y->BaseTyp == x->BaseTyp)) && y->n <= x->n)) { + } else if ((y->comp == 3 && y->BaseTyp == x->BaseTyp)) { } else if (x->BaseTyp == OPT_chartyp) { if (g == 8) { if (ynode->conval->intval2 > x->n) { OPB_err(114); } - } else if ((__IN(y->comp, 0x0c, 32) && y->BaseTyp == OPT_chartyp)) { } else { OPB_err(113); } } else { OPB_err(113); } - } else if ((x->comp == 3 && x->BaseTyp == OPT_chartyp)) { - if ((__IN(y->comp, 0x0c, 32) && y->BaseTyp == OPT_chartyp)) { - } else { - OPB_err(113); - } } else if (x->comp == 4) { if (x == y) { } else if (y->comp == 4) { @@ -2536,7 +2532,6 @@ void OPB_Return (OPT_Node *x, OPT_Object proc) void OPB_Assign (OPT_Node *x, OPT_Node y) { OPT_Node z = NIL; - INT8 subcl; if ((*x)->class >= 7) { OPB_err(56); } @@ -2562,13 +2557,8 @@ void OPB_Assign (OPT_Node *x, OPT_Node y) y->conval->intval = 0; OPB_Index(&*x, OPB_NewIntConst(0)); } - if ((((((__IN((*x)->typ->comp, 0x0c, 32) && (*x)->typ->BaseTyp == OPT_chartyp)) && __IN(y->typ->comp, 0x0c, 32))) && y->typ->BaseTyp == OPT_chartyp)) { - subcl = 18; - } else { - subcl = 0; - } OPB_BindNodes(19, OPT_notyp, &*x, y); - (*x)->subcl = subcl; + (*x)->subcl = 0; } void OPB_Inittd (OPT_Node *inittd, OPT_Node *last, OPT_Struct typ) diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index 6641207d..2c396170 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index fd11366a..5f4dc826 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index 4eff8cf5..f9bc06a4 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index e4915a3e..f52cb5e2 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -8,6 +8,7 @@ #include "SYSTEM.h" #include "Configuration.h" #include "Files.h" +#include "Modules.h" #include "Out.h" #include "Platform.h" #include "Strings.h" @@ -266,7 +267,7 @@ static void OPM_ScanOptions (CHAR *s, ADDRESS s__len) BOOLEAN OPM_OpenPar (void) { CHAR s[256]; - if (Platform_ArgCount == 1) { + if (Modules_ArgCount == 1) { OPM_LogWLn(); OPM_LogWStr((CHAR*)"Oberon-2 compiler v", 20); OPM_LogWStr(Configuration_versionLong, 75); @@ -362,16 +363,16 @@ BOOLEAN OPM_OpenPar (void) OPM_Options = 0xa9; OPM_S = 1; s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, 256); + Modules_GetArg(OPM_S, (void*)s, 256); while (s[0] == '-') { OPM_ScanOptions(s, 256); OPM_S += 1; s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, 256); + Modules_GetArg(OPM_S, (void*)s, 256); } OPM_GlobalAddressSize = OPM_AddressSize; OPM_GlobalAlignment = OPM_Alignment; - __COPY(OPM_Model, OPM_GlobalModel, 10); + __MOVE(OPM_Model, OPM_GlobalModel, 10); OPM_GlobalOptions = OPM_Options; return 1; } @@ -410,16 +411,16 @@ void OPM_InitOptions (void) CHAR searchpath[1024], modules[1024]; CHAR MODULES[1024]; OPM_Options = OPM_GlobalOptions; - __COPY(OPM_GlobalModel, OPM_Model, 10); + __MOVE(OPM_GlobalModel, OPM_Model, 10); OPM_Alignment = OPM_GlobalAlignment; OPM_AddressSize = OPM_GlobalAddressSize; s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, 256); + Modules_GetArg(OPM_S, (void*)s, 256); while (s[0] == '-') { OPM_ScanOptions(s, 256); OPM_S += 1; s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, 256); + Modules_GetArg(OPM_S, (void*)s, 256); } if (__IN(15, OPM_Options, 32)) { OPM_Options |= __SETOF(10,32); @@ -472,11 +473,11 @@ void OPM_Init (BOOLEAN *done, CHAR *mname, ADDRESS mname__len) CHAR s[256]; *done = 0; OPM_curpos = 0; - if (OPM_S >= Platform_ArgCount) { + if (OPM_S >= Modules_ArgCount) { return; } s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, 256); + Modules_GetArg(OPM_S, (void*)s, 256); __NEW(T, Texts_TextDesc); Texts_Open(T, s, 256); OPM_LogWStr(s, 256); @@ -1070,6 +1071,7 @@ export void *OPM__init(void) __DEFMOD; __MODULE_IMPORT(Configuration); __MODULE_IMPORT(Files); + __MODULE_IMPORT(Modules); __MODULE_IMPORT(Out); __MODULE_IMPORT(Platform); __MODULE_IMPORT(Strings); diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index 4dd3d03b..979995c8 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index a08cee09..954279d4 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -527,7 +527,7 @@ static void OPP_selector (OPT_Node *x) } else if (OPP_sym == 18) { OPS_Get(&OPP_sym); if (OPP_sym == 38) { - __COPY(OPS_name, name, 256); + __MOVE(OPS_name, name, 256); OPS_Get(&OPP_sym); if ((*x)->typ != NIL) { if ((*x)->typ->form == 11) { @@ -867,7 +867,7 @@ static void OPP_Receiver (INT8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct } else { *mode = 1; } - __COPY(OPS_name, name, 256); + __MOVE(OPS_name, name, 256); OPP_CheckSym(38); OPP_CheckSym(20); if (OPP_sym == 38) { @@ -1030,7 +1030,7 @@ static void TProcDecl__23 (void) } OPP_Receiver(&objMode, objName, &objTyp, &recTyp); if (OPP_sym == 38) { - __COPY(OPS_name, *ProcedureDeclaration__16_s->name, 256); + __MOVE(OPS_name, *ProcedureDeclaration__16_s->name, 256); OPP_CheckMark(&*ProcedureDeclaration__16_s->vis); OPT_FindField(*ProcedureDeclaration__16_s->name, recTyp, &*ProcedureDeclaration__16_s->fwd); OPT_FindField(*ProcedureDeclaration__16_s->name, recTyp->BaseTyp, &baseProc); @@ -1129,7 +1129,7 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) TProcDecl__23(); } else if (OPP_sym == 38) { OPT_Find(&fwd); - __COPY(OPS_name, name, 256); + __MOVE(OPS_name, name, 256); OPP_CheckMark(&vis); if ((vis != 0 && mode == 6)) { mode = 7; diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index 2814e733..b748e221 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index 7218afe1..eee78d80 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index a860454b..7ab70899 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index de44eed9..b58d6175 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -434,8 +434,8 @@ void OPT_Init (OPS_Name name, UINT32 opt) OPT_topScope = OPT_universe; OPT_OpenScope(0, NIL); OPT_SYSimported = 0; - __COPY(name, OPT_SelfName, 256); - __COPY(name, OPT_topScope->name, 256); + __MOVE(name, OPT_SelfName, 256); + __MOVE(name, OPT_topScope->name, 256); OPT_GlbMod[0] = OPT_topScope; OPT_nofGmod = 1; OPT_newsf = __IN(4, opt, 32); @@ -1186,7 +1186,7 @@ static void OPT_InStruct (OPT_Struct *typ) } *typ = OPT_NewStr(0, 1); } else { - __COPY(name, obj->name, 256); + __MOVE(name, obj->name, 256); OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, 64)]->right, &old); if (old != NIL) { OPT_FPrintObj(old); diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 86256024..67996e8e 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 7a7ce5c1..22c12372 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -163,7 +163,7 @@ static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exporte } scope = obj->scope; scope->leaf = 1; - __COPY(obj->name, scope->name, 256); + __MOVE(obj->name, scope->name, 256); OPV_Stamp(scope->name); if (mode == 9) { obj->adr = 1; @@ -1286,7 +1286,17 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPM_WriteString((CHAR*)", ", 3); if (r->typ == OPT_stringtyp) { OPM_WriteInt(r->conval->intval2); + } else if (r->typ->comp == 3) { + OPM_WriteString((CHAR*)"__X(", 5); + OPC_Len(r->obj, r->typ, 0); + OPM_WriteString((CHAR*)" * ", 4); + OPM_WriteInt(r->typ->BaseTyp->size); + OPM_WriteString((CHAR*)", ", 3); + OPM_WriteInt(l->typ->size); + OPM_Write(')'); } else { + __ASSERT(r->typ->comp == 2, 0); + __ASSERT(r->typ->size <= l->typ->size, 0); OPM_WriteInt(r->typ->size); } OPM_Write(')'); diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index 9a8653a0..43aaf24a 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Out.c b/bootstrap/windows-88/Out.c index 0edcb502..0d3f9e29 100644 --- a/bootstrap/windows-88/Out.c +++ b/bootstrap/windows-88/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Out.h b/bootstrap/windows-88/Out.h index b273390e..27f2c9bb 100644 --- a/bootstrap/windows-88/Out.h +++ b/bootstrap/windows-88/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index ad0adb4d..bad7600e 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -7,48 +7,26 @@ #include "SYSTEM.h" -typedef - CHAR (*Platform_ArgPtr)[1024]; - -typedef - Platform_ArgPtr (*Platform_ArgVec)[1024]; - -typedef - INT64 (*Platform_ArgVecPtr)[1]; - -typedef - CHAR (*Platform_EnvPtr)[1024]; - typedef struct Platform_FileIdentity { INT32 volume, indexhigh, indexlow, mtimehigh, mtimelow; } Platform_FileIdentity; -typedef - void (*Platform_HaltProcedure)(INT32); - typedef void (*Platform_SignalHandler)(INT32); export BOOLEAN Platform_LittleEndian; -export INT64 Platform_MainStackFrame; -export INT32 Platform_HaltCode; export INT16 Platform_PID; export CHAR Platform_CWD[4096]; -export INT16 Platform_ArgCount; -export INT64 Platform_ArgVector; -static Platform_HaltProcedure Platform_HaltHandler; static INT32 Platform_TimeStart; export INT16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; export INT64 Platform_StdIn, Platform_StdOut, Platform_StdErr; -static Platform_SignalHandler Platform_InterruptHandler; export CHAR Platform_NL[3]; export ADDRESS *Platform_FileIdentity__typ; export BOOLEAN Platform_Absent (INT16 e); -export INT16 Platform_ArgPos (CHAR *s, ADDRESS s__len); export INT16 Platform_Chdir (CHAR *n, ADDRESS n__len); export INT16 Platform_Close (INT64 h); export BOOLEAN Platform_ConnectionFailed (INT16 e); @@ -57,15 +35,12 @@ export BOOLEAN Platform_DifferentFilesystems (INT16 e); static void Platform_EnableVT100 (void); export INT16 Platform_Error (void); export void Platform_Exit (INT32 code); -export void Platform_GetArg (INT16 n, CHAR *val, ADDRESS val__len); export void Platform_GetClock (INT32 *t, INT32 *d); export void Platform_GetEnv (CHAR *var, ADDRESS var__len, CHAR *val, ADDRESS val__len); -export void Platform_GetIntArg (INT16 n, INT32 *val); export void Platform_GetTimeOfDay (INT32 *sec, INT32 *usec); export INT16 Platform_Identify (INT64 h, Platform_FileIdentity *identity, ADDRESS *identity__typ); export INT16 Platform_IdentifyByName (CHAR *n, ADDRESS n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ); export BOOLEAN Platform_Inaccessible (INT16 e); -export void Platform_Init (INT32 argc, INT64 argvadr); export BOOLEAN Platform_Interrupted (INT16 e); export BOOLEAN Platform_IsConsole (INT64 h); export void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d); @@ -111,10 +86,8 @@ export BOOLEAN Platform_getEnv (CHAR *var, ADDRESS var__len, CHAR *val, ADDRESS #define Platform_ERRORTOOMANYOPENFILES() ERROR_TOO_MANY_OPEN_FILES #define Platform_ERRORWRITEPROTECT() ERROR_WRITE_PROTECT #define Platform_ETIMEDOUT() WSAETIMEDOUT -extern void Heap_InitHeap(); #define Platform_GetConsoleMode(h, m) GetConsoleMode((HANDLE)h, (DWORD*)m) #define Platform_GetTickCount() (LONGINT)(UINT32)GetTickCount() -#define Platform_HeapInitHeap() Heap_InitHeap() #define Platform_SetConsoleMode(h, m) SetConsoleMode((HANDLE)h, (DWORD)m) #define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((ADDRESS)h) #define Platform_SetQuitHandler(h) SystemSetQuitHandler((ADDRESS)h) @@ -228,17 +201,6 @@ void Platform_OSFree (INT64 address) Platform_free(address); } -void Platform_Init (INT32 argc, INT64 argvadr) -{ - Platform_ArgVecPtr av = NIL; - Platform_MainStackFrame = argvadr; - Platform_ArgCount = __VAL(INT16, argc); - av = (Platform_ArgVecPtr)(ADDRESS)argvadr; - Platform_ArgVector = (*av)[0]; - Platform_HaltCode = -128; - Platform_HeapInitHeap(); -} - BOOLEAN Platform_getEnv (CHAR *var, ADDRESS var__len, CHAR *val, ADDRESS val__len) { CHAR buf[4096]; @@ -265,56 +227,6 @@ void Platform_GetEnv (CHAR *var, ADDRESS var__len, CHAR *val, ADDRESS val__len) __DEL(var); } -void Platform_GetArg (INT16 n, CHAR *val, ADDRESS val__len) -{ - Platform_ArgVec av = NIL; - if (n < Platform_ArgCount) { - av = (Platform_ArgVec)(ADDRESS)Platform_ArgVector; - __COPY(*(*av)[__X(n, 1024)], val, val__len); - } -} - -void Platform_GetIntArg (INT16 n, INT32 *val) -{ - CHAR s[64]; - INT32 k, d, i; - s[0] = 0x00; - Platform_GetArg(n, (void*)s, 64); - i = 0; - if (s[0] == '-') { - i = 1; - } - k = 0; - d = (INT16)s[__X(i, 64)] - 48; - while ((d >= 0 && d <= 9)) { - k = k * 10 + d; - i += 1; - d = (INT16)s[__X(i, 64)] - 48; - } - if (s[0] == '-') { - k = -k; - i -= 1; - } - if (i > 0) { - *val = k; - } -} - -INT16 Platform_ArgPos (CHAR *s, ADDRESS s__len) -{ - INT16 i; - CHAR arg[256]; - __DUP(s, s__len, CHAR); - i = 0; - Platform_GetArg(i, (void*)arg, 256); - while ((i < Platform_ArgCount && __STRCMP(s, arg) != 0)) { - i += 1; - Platform_GetArg(i, (void*)arg, 256); - } - __DEL(s); - return i; -} - void Platform_SetBadInstructionHandler (Platform_SignalHandler handler) { } @@ -646,8 +558,6 @@ export void *Platform__init(void) __INITYP(Platform_FileIdentity, Platform_FileIdentity, 0); /* BEGIN */ Platform_TestLittleEndian(); - Platform_HaltCode = -128; - Platform_HaltHandler = NIL; Platform_TimeStart = 0; Platform_TimeStart = Platform_Time(); Platform_CWD[0] = 0x00; diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index d2d424eb..7d53aaad 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h @@ -16,12 +16,8 @@ typedef import BOOLEAN Platform_LittleEndian; -import INT64 Platform_MainStackFrame; -import INT32 Platform_HaltCode; import INT16 Platform_PID; import CHAR Platform_CWD[4096]; -import INT16 Platform_ArgCount; -import INT64 Platform_ArgVector; import INT16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; import INT64 Platform_StdIn, Platform_StdOut, Platform_StdErr; import CHAR Platform_NL[3]; @@ -29,7 +25,6 @@ import CHAR Platform_NL[3]; import ADDRESS *Platform_FileIdentity__typ; import BOOLEAN Platform_Absent (INT16 e); -import INT16 Platform_ArgPos (CHAR *s, ADDRESS s__len); import INT16 Platform_Chdir (CHAR *n, ADDRESS n__len); import INT16 Platform_Close (INT64 h); import BOOLEAN Platform_ConnectionFailed (INT16 e); @@ -37,15 +32,12 @@ import void Platform_Delay (INT32 ms); import BOOLEAN Platform_DifferentFilesystems (INT16 e); import INT16 Platform_Error (void); import void Platform_Exit (INT32 code); -import void Platform_GetArg (INT16 n, CHAR *val, ADDRESS val__len); import void Platform_GetClock (INT32 *t, INT32 *d); import void Platform_GetEnv (CHAR *var, ADDRESS var__len, CHAR *val, ADDRESS val__len); -import void Platform_GetIntArg (INT16 n, INT32 *val); import void Platform_GetTimeOfDay (INT32 *sec, INT32 *usec); import INT16 Platform_Identify (INT64 h, Platform_FileIdentity *identity, ADDRESS *identity__typ); import INT16 Platform_IdentifyByName (CHAR *n, ADDRESS n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ); import BOOLEAN Platform_Inaccessible (INT16 e); -import void Platform_Init (INT32 argc, INT64 argvadr); import BOOLEAN Platform_Interrupted (INT16 e); import BOOLEAN Platform_IsConsole (INT64 h); import void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d); diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index ee1f94ca..e4149017 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index 16a16b7a..e3bfadb5 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index b60bb504..a3f1e808 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index adf86c42..b192b7bb 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index 0bb7d871..a7cc3ff1 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -394,8 +394,8 @@ static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, ADDRESS *msg__t e->file = (*(Texts_Alien*)&E)->file; e->org = (*(Texts_Alien*)&E)->org; e->span = (*(Texts_Alien*)&E)->span; - __COPY((*(Texts_Alien*)&E)->mod, e->mod, 32); - __COPY((*(Texts_Alien*)&E)->proc, e->proc, 32); + __MOVE((*(Texts_Alien*)&E)->mod, e->mod, 32); + __MOVE((*(Texts_Alien*)&E)->proc, e->proc, 32); (*msg__).e = (Texts_Elem)e; } else __WITHCHK; } else if (__IS(msg__typ, Texts_IdentifyMsg, 1)) { diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index b1eafc02..8c1b9016 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/VT100.c b/bootstrap/windows-88/VT100.c index f0e444ea..7a2a840d 100644 --- a/bootstrap/windows-88/VT100.c +++ b/bootstrap/windows-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/VT100.h b/bootstrap/windows-88/VT100.h index 0f1bc5ac..5a3fe6d0 100644 --- a/bootstrap/windows-88/VT100.h +++ b/bootstrap/windows-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index 43e5cb69..657534b4 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index 784b684d..6ad7abb0 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/11/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h From c57a91210ba071dcd7ea05eda31ceba6b7f085b3 Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 2 Dec 2016 12:26:21 +0000 Subject: [PATCH 362/580] Append 'LL' to large integer constants to avoid OpenBSD gcc warnings. --- src/compiler/OPB.Mod | 11 ----------- src/compiler/OPM.Mod | 9 +++++---- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/src/compiler/OPB.Mod b/src/compiler/OPB.Mod index 710cd640..84085804 100644 --- a/src/compiler/OPB.Mod +++ b/src/compiler/OPB.Mod @@ -896,21 +896,10 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) ELSIF x^.BaseTyp = OPT.chartyp THEN (* Assign to (static) ARRAY OF CHAR *) IF g = OPT.String THEN (*check length of string*) IF ynode^.conval^.intval2 > x^.n THEN err(114) END - (* Todo: implement Oberon-07/2013 array assignment - ELSIF (y.comp IN {OPT.DynArr, OPT.Array}) & (y.BaseTyp = OPT.chartyp) THEN - (* Assignment from ARRAY OF CHAR is good.*) - *) ELSE err(113) END ELSE err(113) END - (* Todo: implement Oberon-07/2013 array assignment - ELSIF (x.comp = OPT.DynArr) & (x^.BaseTyp = OPT.chartyp) THEN (* Assign to dynamic ARRAY OF CHAR*) - IF (y.comp IN {OPT.DynArr, OPT.Array}) & (y.BaseTyp = OPT.chartyp) THEN - (* Assignment from ARRAY OF CHAR is good.*) - ELSE err(113) - END - *) ELSIF x^.comp = OPT.Record THEN IF x = y THEN (* ok *) ELSIF y^.comp = OPT.Record THEN diff --git a/src/compiler/OPM.Mod b/src/compiler/OPM.Mod index e59435eb..a314cdc3 100644 --- a/src/compiler/OPM.Mod +++ b/src/compiler/OPM.Mod @@ -685,7 +685,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) END WriteHex; PROCEDURE WriteInt* (i: SYSTEM.INT64); - VAR s: ARRAY 24 OF CHAR; i1, k: SYSTEM.INT64; + VAR s: ARRAY 26 OF CHAR; i1, k: SYSTEM.INT64; BEGIN IF (i = SignedMinimum(2)) OR (i = SignedMinimum(4)) OR (i = SignedMinimum(8)) THEN (* abs(minint) is one more than maxint, causing problems representing the value as a minus sign @@ -694,11 +694,12 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) only way to represent MinLInt. *) Write("("); WriteInt(i+1); WriteString("-1)") ELSE i1 := ABS(i); - s[0] := CHR(i1 MOD 10 + ORD("0")); i1 := i1 DIV 10; k := 1; + IF i1 <= MAX(SYSTEM.INT32) THEN k := 0 ELSE s := "LL"; k := 2 END; + s[k] := CHR(i1 MOD 10 + ORD("0")); i1 := i1 DIV 10; INC(k); WHILE i1 > 0 DO s[k] := CHR(i1 MOD 10 + ORD("0")); i1 := i1 DIV 10; INC(k) END ; IF i < 0 THEN s[k] := "-"; INC(k) END ; - WHILE k > 0 DO DEC(k); Write(s[k]) END - END ; + WHILE k > 0 DO DEC(k); Write(s[k]) END; + END; END WriteInt; PROCEDURE WriteReal* (r: LONGREAL; suffx: CHAR); From 6c0c666f91be0610b4416f0b24939499b1761d5e Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 2 Dec 2016 12:27:03 +0000 Subject: [PATCH 363/580] Update bootstrap C sources. --- bootstrap/unix-44/Compiler.c | 2 +- bootstrap/unix-44/Configuration.c | 4 ++-- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Files.c | 2 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 2 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 18 +++++++++--------- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 2 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 20 +++++++++++++------- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 4 ++-- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 2 +- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 2 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Out.c | 6 +++--- bootstrap/unix-44/Out.h | 2 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 4 ++-- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/VT100.c | 2 +- bootstrap/unix-44/VT100.h | 2 +- bootstrap/unix-44/extTools.c | 6 +++--- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-48/Compiler.c | 2 +- bootstrap/unix-48/Configuration.c | 4 ++-- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Files.c | 2 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 2 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 18 +++++++++--------- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 2 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 20 +++++++++++++------- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 4 ++-- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 2 +- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 2 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Out.c | 6 +++--- bootstrap/unix-48/Out.h | 2 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 4 ++-- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/VT100.c | 2 +- bootstrap/unix-48/VT100.h | 2 +- bootstrap/unix-48/extTools.c | 6 +++--- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-88/Compiler.c | 2 +- bootstrap/unix-88/Configuration.c | 4 ++-- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Files.c | 2 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 6 +++--- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 18 +++++++++--------- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 2 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 20 +++++++++++++------- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 4 ++-- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 2 +- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 2 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Out.c | 6 +++--- bootstrap/unix-88/Out.h | 2 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 4 ++-- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/VT100.c | 2 +- bootstrap/unix-88/VT100.h | 2 +- bootstrap/unix-88/extTools.c | 6 +++--- bootstrap/unix-88/extTools.h | 2 +- bootstrap/windows-48/Compiler.c | 2 +- bootstrap/windows-48/Configuration.c | 4 ++-- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Files.c | 2 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 2 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 18 +++++++++--------- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 2 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 20 +++++++++++++------- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 4 ++-- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 2 +- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 2 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Out.c | 6 +++--- bootstrap/windows-48/Out.h | 2 +- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 4 ++-- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/VT100.c | 2 +- bootstrap/windows-48/VT100.h | 2 +- bootstrap/windows-48/extTools.c | 6 +++--- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-88/Compiler.c | 2 +- bootstrap/windows-88/Configuration.c | 4 ++-- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Files.c | 2 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 6 +++--- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 18 +++++++++--------- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 2 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 20 +++++++++++++------- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 4 ++-- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 2 +- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 2 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Out.c | 6 +++--- bootstrap/windows-88/Out.h | 2 +- bootstrap/windows-88/Platform.c | 2 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 4 ++-- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/VT100.c | 2 +- bootstrap/windows-88/VT100.h | 2 +- bootstrap/windows-88/extTools.c | 6 +++--- bootstrap/windows-88/extTools.h | 2 +- 185 files changed, 324 insertions(+), 294 deletions(-) diff --git a/bootstrap/unix-44/Compiler.c b/bootstrap/unix-44/Compiler.c index e59d7615..9322477d 100644 --- a/bootstrap/unix-44/Compiler.c +++ b/bootstrap/unix-44/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index 01281cfc..f30fe61f 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index 98f85767..39dd27b9 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index f39534fc..96dd911c 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index e124b950..c97d14a6 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index b6abc8f3..95b746d7 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index 82ebd04d..86033649 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index 0290d664..73c918d9 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index 3ab94701..92ebb074 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index d9e826b8..57fde3a0 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -550,7 +550,7 @@ void OPB_MOp (INT8 op, OPT_Node *x) if (__IN(f, 0xf0, 32)) { if (z->class == 7) { if (f == 4) { - if (z->conval->intval == (-9223372036854775807-1)) { + if (z->conval->intval == (-9223372036854775807LL-1)) { OPB_err(203); } else { z->conval->intval = -z->conval->intval; @@ -577,7 +577,7 @@ void OPB_MOp (INT8 op, OPT_Node *x) if (__IN(f, 0x70, 32)) { if (z->class == 7) { if (f == 4) { - if (z->conval->intval == (-9223372036854775807-1)) { + if (z->conval->intval == (-9223372036854775807LL-1)) { OPB_err(203); } else { z->conval->intval = __ABS(z->conval->intval); @@ -920,7 +920,7 @@ static void OPB_ConstOp (INT16 op, OPT_Node x, OPT_Node y) if (f == 4) { xv = xval->intval; yv = yval->intval; - if (((((xv == 0 || yv == 0) || (((xv > 0 && yv > 0)) && yv <= __DIV(9223372036854775807, xv))) || (((xv > 0 && yv < 0)) && yv >= __DIV((-9223372036854775807-1), xv))) || (((xv < 0 && yv > 0)) && xv >= __DIV((-9223372036854775807-1), yv))) || (((((((xv < 0 && yv < 0)) && xv != (-9223372036854775807-1))) && yv != (-9223372036854775807-1))) && -xv <= __DIV(9223372036854775807, -yv))) { + if (((((xv == 0 || yv == 0) || (((xv > 0 && yv > 0)) && yv <= __DIV(9223372036854775807LL, xv))) || (((xv > 0 && yv < 0)) && yv >= __DIV((-9223372036854775807LL-1), xv))) || (((xv < 0 && yv > 0)) && xv >= __DIV((-9223372036854775807LL-1), yv))) || (((((((xv < 0 && yv < 0)) && xv != (-9223372036854775807LL-1))) && yv != (-9223372036854775807LL-1))) && -xv <= __DIV(9223372036854775807LL, -yv))) { xval->intval = xv * yv; OPB_SetIntType(x); } else { @@ -999,8 +999,8 @@ static void OPB_ConstOp (INT16 op, OPT_Node x, OPT_Node y) break; case 6: if (f == 4) { - temp = (yval->intval >= 0 && xval->intval <= 9223372036854775807 - yval->intval); - if (temp || (yval->intval < 0 && xval->intval >= (-9223372036854775807-1) - yval->intval)) { + temp = (yval->intval >= 0 && xval->intval <= 9223372036854775807LL - yval->intval); + if (temp || (yval->intval < 0 && xval->intval >= (-9223372036854775807LL-1) - yval->intval)) { xval->intval += yval->intval; OPB_SetIntType(x); } else { @@ -1023,7 +1023,7 @@ static void OPB_ConstOp (INT16 op, OPT_Node x, OPT_Node y) break; case 7: if (f == 4) { - if ((yval->intval >= 0 && xval->intval >= (-9223372036854775807-1) + yval->intval) || (yval->intval < 0 && xval->intval <= 9223372036854775807 + yval->intval)) { + if ((yval->intval >= 0 && xval->intval >= (-9223372036854775807LL-1) + yval->intval) || (yval->intval < 0 && xval->intval <= 9223372036854775807LL + yval->intval)) { xval->intval -= yval->intval; OPB_SetIntType(x); } else { @@ -2087,7 +2087,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno) OPB_err(208); p->conval->intval = 1; } else if (x->conval->intval >= 0) { - if (__ABS(p->conval->intval) <= __DIV(9223372036854775807, (INT64)__ASH(1, x->conval->intval))) { + if (__ABS(p->conval->intval) <= __DIV(9223372036854775807LL, (INT64)__ASH(1, x->conval->intval))) { p->conval->intval = p->conval->intval * (INT64)__ASH(1, x->conval->intval); } else { OPB_err(208); @@ -2585,7 +2585,7 @@ export void *OPB__init(void) __MODULE_IMPORT(OPT); __REGMOD("OPB", 0); /* BEGIN */ - OPB_maxExp = OPB_log(4611686018427387904); + OPB_maxExp = OPB_log(4611686018427387904LL); OPB_maxExp = OPB_exp; __ENDMOD; } diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index 2c396170..e841f317 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 5f4dc826..73872a51 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index f9bc06a4..06fa9996 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 1732c950..9aca428d 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -893,7 +893,7 @@ void OPM_WriteHex (INT64 i) void OPM_WriteInt (INT64 i) { - CHAR s[24]; + CHAR s[26]; INT64 i1, k; if ((i == OPM_SignedMinimum(2) || i == OPM_SignedMinimum(4)) || i == OPM_SignedMinimum(8)) { OPM_Write('('); @@ -901,21 +901,27 @@ void OPM_WriteInt (INT64 i) OPM_WriteString((CHAR*)"-1)", 4); } else { i1 = __ABS(i); - s[0] = (CHAR)(__MOD(i1, 10) + 48); + if (i1 <= 2147483647) { + k = 0; + } else { + __MOVE("LL", s, 3); + k = 2; + } + s[__X(k, 26)] = (CHAR)(__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); - k = 1; + k += 1; while (i1 > 0) { - s[__X(k, 24)] = (CHAR)(__MOD(i1, 10) + 48); + s[__X(k, 26)] = (CHAR)(__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k += 1; } if (i < 0) { - s[__X(k, 24)] = '-'; + s[__X(k, 26)] = '-'; k += 1; } while (k > 0) { k -= 1; - OPM_Write(s[__X(k, 24)]); + OPM_Write(s[__X(k, 26)]); } } } diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index 979995c8..6ea722dc 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index 69624c1f..24a04912 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index b748e221..b6d59055 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index eee78d80..311cbe15 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -198,7 +198,7 @@ static void OPS_Number (void) while (i < n) { d = Ord__7(dig[i], 0); i += 1; - if (OPS_intval <= __DIV(9223372036854775807 - (INT64)d, 10)) { + if (OPS_intval <= __DIV(9223372036854775807LL - (INT64)d, 10)) { OPS_intval = OPS_intval * 10 + (INT64)d; } else { OPS_err(203); diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index 7ab70899..28618fe1 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index 40f61458..dcaf0156 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index 67996e8e..ab443dff 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index fb6ac690..5a44f258 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index 43aaf24a..d26a1b3e 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Out.c b/bootstrap/unix-44/Out.c index a03cf592..73f0311a 100644 --- a/bootstrap/unix-44/Out.c +++ b/bootstrap/unix-44/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -89,7 +89,7 @@ void Out_Int (INT64 x, INT64 n) INT16 i; BOOLEAN negative; negative = x < 0; - if (x == (-9223372036854775807-1)) { + if (x == (-9223372036854775807LL-1)) { __MOVE("8085774586302733229", s, 20); i = 19; } else { @@ -175,7 +175,7 @@ static void Out_RealP (LONGREAL x, INT16 n, BOOLEAN long_) INT64 m; INT16 d, dr; e = (INT16)__MASK(__ASHR((__VAL(INT64, x)), 52), -2048); - f = __MASK((__VAL(INT64, x)), -4503599627370496); + f = __MASK((__VAL(INT64, x)), -4503599627370496LL); nn = (__VAL(INT64, x) < 0 && !((e == 2047 && f != 0))); if (nn) { n -= 1; diff --git a/bootstrap/unix-44/Out.h b/bootstrap/unix-44/Out.h index 27f2c9bb..a4eb7cb6 100644 --- a/bootstrap/unix-44/Out.h +++ b/bootstrap/unix-44/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 1fc766bf..95c8d97b 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index 9be32cda..1f183fc5 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index e4149017..33c286b7 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index e3bfadb5..6fc2dd5c 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index a3f1e808..42190367 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index b192b7bb..1806a7cc 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index 376db061..489acce0 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -1046,7 +1046,7 @@ void Texts_WriteInt (Texts_Writer *W, ADDRESS *W__typ, INT64 x, INT64 n) CHAR a[24]; i = 0; if (x < 0) { - if (x == (-9223372036854775807-1)) { + if (x == (-9223372036854775807LL-1)) { Texts_WriteString(&*W, W__typ, (CHAR*)" -9223372036854775808", 22); return; } else { diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index 4ea56de1..00add2ac 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/VT100.c b/bootstrap/unix-44/VT100.c index 7a2a840d..c6c421f9 100644 --- a/bootstrap/unix-44/VT100.c +++ b/bootstrap/unix-44/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/VT100.h b/bootstrap/unix-44/VT100.h index 5a3fe6d0..b1771722 100644 --- a/bootstrap/unix-44/VT100.h +++ b/bootstrap/unix-44/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index 657534b4..e89705a7 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -65,7 +65,7 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) { - __COPY("gcc -g", s, s__len); + __COPY("x86_64-w64-mingw32-gcc -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); @@ -95,7 +95,7 @@ void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN stati Strings_Append((CHAR*)".c ", 4, (void*)cmd, 1023); Strings_Append(additionalopts, additionalopts__len, (void*)cmd, 1023); if (statically) { - Strings_Append((CHAR*)"-static", 8, (void*)cmd, 1023); + Strings_Append((CHAR*)"", 1, (void*)cmd, 1023); } Strings_Append((CHAR*)" -o ", 5, (void*)cmd, 1023); Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index 6ad7abb0..e92a4c5f 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/Compiler.c b/bootstrap/unix-48/Compiler.c index e59d7615..9322477d 100644 --- a/bootstrap/unix-48/Compiler.c +++ b/bootstrap/unix-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index 01281cfc..f30fe61f 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index 98f85767..39dd27b9 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index f39534fc..96dd911c 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index e124b950..c97d14a6 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index b6abc8f3..95b746d7 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index 82ebd04d..86033649 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index 0290d664..73c918d9 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index 3ab94701..92ebb074 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index d9e826b8..57fde3a0 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -550,7 +550,7 @@ void OPB_MOp (INT8 op, OPT_Node *x) if (__IN(f, 0xf0, 32)) { if (z->class == 7) { if (f == 4) { - if (z->conval->intval == (-9223372036854775807-1)) { + if (z->conval->intval == (-9223372036854775807LL-1)) { OPB_err(203); } else { z->conval->intval = -z->conval->intval; @@ -577,7 +577,7 @@ void OPB_MOp (INT8 op, OPT_Node *x) if (__IN(f, 0x70, 32)) { if (z->class == 7) { if (f == 4) { - if (z->conval->intval == (-9223372036854775807-1)) { + if (z->conval->intval == (-9223372036854775807LL-1)) { OPB_err(203); } else { z->conval->intval = __ABS(z->conval->intval); @@ -920,7 +920,7 @@ static void OPB_ConstOp (INT16 op, OPT_Node x, OPT_Node y) if (f == 4) { xv = xval->intval; yv = yval->intval; - if (((((xv == 0 || yv == 0) || (((xv > 0 && yv > 0)) && yv <= __DIV(9223372036854775807, xv))) || (((xv > 0 && yv < 0)) && yv >= __DIV((-9223372036854775807-1), xv))) || (((xv < 0 && yv > 0)) && xv >= __DIV((-9223372036854775807-1), yv))) || (((((((xv < 0 && yv < 0)) && xv != (-9223372036854775807-1))) && yv != (-9223372036854775807-1))) && -xv <= __DIV(9223372036854775807, -yv))) { + if (((((xv == 0 || yv == 0) || (((xv > 0 && yv > 0)) && yv <= __DIV(9223372036854775807LL, xv))) || (((xv > 0 && yv < 0)) && yv >= __DIV((-9223372036854775807LL-1), xv))) || (((xv < 0 && yv > 0)) && xv >= __DIV((-9223372036854775807LL-1), yv))) || (((((((xv < 0 && yv < 0)) && xv != (-9223372036854775807LL-1))) && yv != (-9223372036854775807LL-1))) && -xv <= __DIV(9223372036854775807LL, -yv))) { xval->intval = xv * yv; OPB_SetIntType(x); } else { @@ -999,8 +999,8 @@ static void OPB_ConstOp (INT16 op, OPT_Node x, OPT_Node y) break; case 6: if (f == 4) { - temp = (yval->intval >= 0 && xval->intval <= 9223372036854775807 - yval->intval); - if (temp || (yval->intval < 0 && xval->intval >= (-9223372036854775807-1) - yval->intval)) { + temp = (yval->intval >= 0 && xval->intval <= 9223372036854775807LL - yval->intval); + if (temp || (yval->intval < 0 && xval->intval >= (-9223372036854775807LL-1) - yval->intval)) { xval->intval += yval->intval; OPB_SetIntType(x); } else { @@ -1023,7 +1023,7 @@ static void OPB_ConstOp (INT16 op, OPT_Node x, OPT_Node y) break; case 7: if (f == 4) { - if ((yval->intval >= 0 && xval->intval >= (-9223372036854775807-1) + yval->intval) || (yval->intval < 0 && xval->intval <= 9223372036854775807 + yval->intval)) { + if ((yval->intval >= 0 && xval->intval >= (-9223372036854775807LL-1) + yval->intval) || (yval->intval < 0 && xval->intval <= 9223372036854775807LL + yval->intval)) { xval->intval -= yval->intval; OPB_SetIntType(x); } else { @@ -2087,7 +2087,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno) OPB_err(208); p->conval->intval = 1; } else if (x->conval->intval >= 0) { - if (__ABS(p->conval->intval) <= __DIV(9223372036854775807, (INT64)__ASH(1, x->conval->intval))) { + if (__ABS(p->conval->intval) <= __DIV(9223372036854775807LL, (INT64)__ASH(1, x->conval->intval))) { p->conval->intval = p->conval->intval * (INT64)__ASH(1, x->conval->intval); } else { OPB_err(208); @@ -2585,7 +2585,7 @@ export void *OPB__init(void) __MODULE_IMPORT(OPT); __REGMOD("OPB", 0); /* BEGIN */ - OPB_maxExp = OPB_log(4611686018427387904); + OPB_maxExp = OPB_log(4611686018427387904LL); OPB_maxExp = OPB_exp; __ENDMOD; } diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index 2c396170..e841f317 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 5f4dc826..73872a51 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index f9bc06a4..06fa9996 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 1732c950..9aca428d 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -893,7 +893,7 @@ void OPM_WriteHex (INT64 i) void OPM_WriteInt (INT64 i) { - CHAR s[24]; + CHAR s[26]; INT64 i1, k; if ((i == OPM_SignedMinimum(2) || i == OPM_SignedMinimum(4)) || i == OPM_SignedMinimum(8)) { OPM_Write('('); @@ -901,21 +901,27 @@ void OPM_WriteInt (INT64 i) OPM_WriteString((CHAR*)"-1)", 4); } else { i1 = __ABS(i); - s[0] = (CHAR)(__MOD(i1, 10) + 48); + if (i1 <= 2147483647) { + k = 0; + } else { + __MOVE("LL", s, 3); + k = 2; + } + s[__X(k, 26)] = (CHAR)(__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); - k = 1; + k += 1; while (i1 > 0) { - s[__X(k, 24)] = (CHAR)(__MOD(i1, 10) + 48); + s[__X(k, 26)] = (CHAR)(__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k += 1; } if (i < 0) { - s[__X(k, 24)] = '-'; + s[__X(k, 26)] = '-'; k += 1; } while (k > 0) { k -= 1; - OPM_Write(s[__X(k, 24)]); + OPM_Write(s[__X(k, 26)]); } } } diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index 979995c8..6ea722dc 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index 69624c1f..24a04912 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index b748e221..b6d59055 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index eee78d80..311cbe15 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -198,7 +198,7 @@ static void OPS_Number (void) while (i < n) { d = Ord__7(dig[i], 0); i += 1; - if (OPS_intval <= __DIV(9223372036854775807 - (INT64)d, 10)) { + if (OPS_intval <= __DIV(9223372036854775807LL - (INT64)d, 10)) { OPS_intval = OPS_intval * 10 + (INT64)d; } else { OPS_err(203); diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index 7ab70899..28618fe1 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 174aae08..7284592a 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index 67996e8e..ab443dff 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index fb6ac690..5a44f258 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index 43aaf24a..d26a1b3e 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Out.c b/bootstrap/unix-48/Out.c index a03cf592..73f0311a 100644 --- a/bootstrap/unix-48/Out.c +++ b/bootstrap/unix-48/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -89,7 +89,7 @@ void Out_Int (INT64 x, INT64 n) INT16 i; BOOLEAN negative; negative = x < 0; - if (x == (-9223372036854775807-1)) { + if (x == (-9223372036854775807LL-1)) { __MOVE("8085774586302733229", s, 20); i = 19; } else { @@ -175,7 +175,7 @@ static void Out_RealP (LONGREAL x, INT16 n, BOOLEAN long_) INT64 m; INT16 d, dr; e = (INT16)__MASK(__ASHR((__VAL(INT64, x)), 52), -2048); - f = __MASK((__VAL(INT64, x)), -4503599627370496); + f = __MASK((__VAL(INT64, x)), -4503599627370496LL); nn = (__VAL(INT64, x) < 0 && !((e == 2047 && f != 0))); if (nn) { n -= 1; diff --git a/bootstrap/unix-48/Out.h b/bootstrap/unix-48/Out.h index 27f2c9bb..a4eb7cb6 100644 --- a/bootstrap/unix-48/Out.h +++ b/bootstrap/unix-48/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 1fc766bf..95c8d97b 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index 9be32cda..1f183fc5 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index e4149017..33c286b7 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index e3bfadb5..6fc2dd5c 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index a3f1e808..42190367 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index b192b7bb..1806a7cc 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index 4fa93c49..cc68acd9 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -1046,7 +1046,7 @@ void Texts_WriteInt (Texts_Writer *W, ADDRESS *W__typ, INT64 x, INT64 n) CHAR a[24]; i = 0; if (x < 0) { - if (x == (-9223372036854775807-1)) { + if (x == (-9223372036854775807LL-1)) { Texts_WriteString(&*W, W__typ, (CHAR*)" -9223372036854775808", 22); return; } else { diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index 235cecb4..9aed03da 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/VT100.c b/bootstrap/unix-48/VT100.c index 7a2a840d..c6c421f9 100644 --- a/bootstrap/unix-48/VT100.c +++ b/bootstrap/unix-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/VT100.h b/bootstrap/unix-48/VT100.h index 5a3fe6d0..b1771722 100644 --- a/bootstrap/unix-48/VT100.h +++ b/bootstrap/unix-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index 657534b4..e89705a7 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -65,7 +65,7 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) { - __COPY("gcc -g", s, s__len); + __COPY("x86_64-w64-mingw32-gcc -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); @@ -95,7 +95,7 @@ void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN stati Strings_Append((CHAR*)".c ", 4, (void*)cmd, 1023); Strings_Append(additionalopts, additionalopts__len, (void*)cmd, 1023); if (statically) { - Strings_Append((CHAR*)"-static", 8, (void*)cmd, 1023); + Strings_Append((CHAR*)"", 1, (void*)cmd, 1023); } Strings_Append((CHAR*)" -o ", 5, (void*)cmd, 1023); Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index 6ad7abb0..e92a4c5f 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/Compiler.c b/bootstrap/unix-88/Compiler.c index e59d7615..9322477d 100644 --- a/bootstrap/unix-88/Compiler.c +++ b/bootstrap/unix-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index 01281cfc..f30fe61f 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index 98f85767..39dd27b9 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 0c219af5..a2d72b8e 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 4a1cbfe9..4dab2431 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index 222162d5..5f4cd2f3 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -721,10 +721,10 @@ void Heap_InitHeap (void) Heap_heapsize = 0; Heap_allocated = 0; Heap_lockdepth = 0; - Heap_heapPosMin = 9223372036854775807; + Heap_heapPosMin = 9223372036854775807LL; Heap_heapPosMax = 0; Heap_heapNegMin = 0; - Heap_heapNegMax = (-9223372036854775807-1); + Heap_heapNegMax = (-9223372036854775807LL-1); Heap_heap = Heap_NewChunk(256000); __PUT(Heap_heap, 0, INT64); Heap_firstTry = 1; diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index 585db2f0..da41e4b8 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index b0cf5fd9..fcf1bb3a 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index a3e555ef..327f139b 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index d9e826b8..57fde3a0 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -550,7 +550,7 @@ void OPB_MOp (INT8 op, OPT_Node *x) if (__IN(f, 0xf0, 32)) { if (z->class == 7) { if (f == 4) { - if (z->conval->intval == (-9223372036854775807-1)) { + if (z->conval->intval == (-9223372036854775807LL-1)) { OPB_err(203); } else { z->conval->intval = -z->conval->intval; @@ -577,7 +577,7 @@ void OPB_MOp (INT8 op, OPT_Node *x) if (__IN(f, 0x70, 32)) { if (z->class == 7) { if (f == 4) { - if (z->conval->intval == (-9223372036854775807-1)) { + if (z->conval->intval == (-9223372036854775807LL-1)) { OPB_err(203); } else { z->conval->intval = __ABS(z->conval->intval); @@ -920,7 +920,7 @@ static void OPB_ConstOp (INT16 op, OPT_Node x, OPT_Node y) if (f == 4) { xv = xval->intval; yv = yval->intval; - if (((((xv == 0 || yv == 0) || (((xv > 0 && yv > 0)) && yv <= __DIV(9223372036854775807, xv))) || (((xv > 0 && yv < 0)) && yv >= __DIV((-9223372036854775807-1), xv))) || (((xv < 0 && yv > 0)) && xv >= __DIV((-9223372036854775807-1), yv))) || (((((((xv < 0 && yv < 0)) && xv != (-9223372036854775807-1))) && yv != (-9223372036854775807-1))) && -xv <= __DIV(9223372036854775807, -yv))) { + if (((((xv == 0 || yv == 0) || (((xv > 0 && yv > 0)) && yv <= __DIV(9223372036854775807LL, xv))) || (((xv > 0 && yv < 0)) && yv >= __DIV((-9223372036854775807LL-1), xv))) || (((xv < 0 && yv > 0)) && xv >= __DIV((-9223372036854775807LL-1), yv))) || (((((((xv < 0 && yv < 0)) && xv != (-9223372036854775807LL-1))) && yv != (-9223372036854775807LL-1))) && -xv <= __DIV(9223372036854775807LL, -yv))) { xval->intval = xv * yv; OPB_SetIntType(x); } else { @@ -999,8 +999,8 @@ static void OPB_ConstOp (INT16 op, OPT_Node x, OPT_Node y) break; case 6: if (f == 4) { - temp = (yval->intval >= 0 && xval->intval <= 9223372036854775807 - yval->intval); - if (temp || (yval->intval < 0 && xval->intval >= (-9223372036854775807-1) - yval->intval)) { + temp = (yval->intval >= 0 && xval->intval <= 9223372036854775807LL - yval->intval); + if (temp || (yval->intval < 0 && xval->intval >= (-9223372036854775807LL-1) - yval->intval)) { xval->intval += yval->intval; OPB_SetIntType(x); } else { @@ -1023,7 +1023,7 @@ static void OPB_ConstOp (INT16 op, OPT_Node x, OPT_Node y) break; case 7: if (f == 4) { - if ((yval->intval >= 0 && xval->intval >= (-9223372036854775807-1) + yval->intval) || (yval->intval < 0 && xval->intval <= 9223372036854775807 + yval->intval)) { + if ((yval->intval >= 0 && xval->intval >= (-9223372036854775807LL-1) + yval->intval) || (yval->intval < 0 && xval->intval <= 9223372036854775807LL + yval->intval)) { xval->intval -= yval->intval; OPB_SetIntType(x); } else { @@ -2087,7 +2087,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno) OPB_err(208); p->conval->intval = 1; } else if (x->conval->intval >= 0) { - if (__ABS(p->conval->intval) <= __DIV(9223372036854775807, (INT64)__ASH(1, x->conval->intval))) { + if (__ABS(p->conval->intval) <= __DIV(9223372036854775807LL, (INT64)__ASH(1, x->conval->intval))) { p->conval->intval = p->conval->intval * (INT64)__ASH(1, x->conval->intval); } else { OPB_err(208); @@ -2585,7 +2585,7 @@ export void *OPB__init(void) __MODULE_IMPORT(OPT); __REGMOD("OPB", 0); /* BEGIN */ - OPB_maxExp = OPB_log(4611686018427387904); + OPB_maxExp = OPB_log(4611686018427387904LL); OPB_maxExp = OPB_exp; __ENDMOD; } diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index 2c396170..e841f317 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index 5f4dc826..73872a51 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index f9bc06a4..06fa9996 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index f52cb5e2..0533cbfc 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -893,7 +893,7 @@ void OPM_WriteHex (INT64 i) void OPM_WriteInt (INT64 i) { - CHAR s[24]; + CHAR s[26]; INT64 i1, k; if ((i == OPM_SignedMinimum(2) || i == OPM_SignedMinimum(4)) || i == OPM_SignedMinimum(8)) { OPM_Write('('); @@ -901,21 +901,27 @@ void OPM_WriteInt (INT64 i) OPM_WriteString((CHAR*)"-1)", 4); } else { i1 = __ABS(i); - s[0] = (CHAR)(__MOD(i1, 10) + 48); + if (i1 <= 2147483647) { + k = 0; + } else { + __MOVE("LL", s, 3); + k = 2; + } + s[__X(k, 26)] = (CHAR)(__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); - k = 1; + k += 1; while (i1 > 0) { - s[__X(k, 24)] = (CHAR)(__MOD(i1, 10) + 48); + s[__X(k, 26)] = (CHAR)(__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k += 1; } if (i < 0) { - s[__X(k, 24)] = '-'; + s[__X(k, 26)] = '-'; k += 1; } while (k > 0) { k -= 1; - OPM_Write(s[__X(k, 24)]); + OPM_Write(s[__X(k, 26)]); } } } diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index 979995c8..6ea722dc 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index 954279d4..a7630159 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index b748e221..b6d59055 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index eee78d80..311cbe15 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -198,7 +198,7 @@ static void OPS_Number (void) while (i < n) { d = Ord__7(dig[i], 0); i += 1; - if (OPS_intval <= __DIV(9223372036854775807 - (INT64)d, 10)) { + if (OPS_intval <= __DIV(9223372036854775807LL - (INT64)d, 10)) { OPS_intval = OPS_intval * 10 + (INT64)d; } else { OPS_err(203); diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index 7ab70899..28618fe1 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index b58d6175..0dd110b2 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 67996e8e..ab443dff 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 22c12372..6a1d23a7 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index 43aaf24a..d26a1b3e 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Out.c b/bootstrap/unix-88/Out.c index a03cf592..73f0311a 100644 --- a/bootstrap/unix-88/Out.c +++ b/bootstrap/unix-88/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -89,7 +89,7 @@ void Out_Int (INT64 x, INT64 n) INT16 i; BOOLEAN negative; negative = x < 0; - if (x == (-9223372036854775807-1)) { + if (x == (-9223372036854775807LL-1)) { __MOVE("8085774586302733229", s, 20); i = 19; } else { @@ -175,7 +175,7 @@ static void Out_RealP (LONGREAL x, INT16 n, BOOLEAN long_) INT64 m; INT16 d, dr; e = (INT16)__MASK(__ASHR((__VAL(INT64, x)), 52), -2048); - f = __MASK((__VAL(INT64, x)), -4503599627370496); + f = __MASK((__VAL(INT64, x)), -4503599627370496LL); nn = (__VAL(INT64, x) < 0 && !((e == 2047 && f != 0))); if (nn) { n -= 1; diff --git a/bootstrap/unix-88/Out.h b/bootstrap/unix-88/Out.h index 27f2c9bb..a4eb7cb6 100644 --- a/bootstrap/unix-88/Out.h +++ b/bootstrap/unix-88/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index eadd3813..11b9bd14 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index ee748a4f..f84abacb 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index e4149017..33c286b7 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index e3bfadb5..6fc2dd5c 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index a3f1e808..42190367 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index b192b7bb..1806a7cc 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index a7cc3ff1..627eb31d 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -1046,7 +1046,7 @@ void Texts_WriteInt (Texts_Writer *W, ADDRESS *W__typ, INT64 x, INT64 n) CHAR a[24]; i = 0; if (x < 0) { - if (x == (-9223372036854775807-1)) { + if (x == (-9223372036854775807LL-1)) { Texts_WriteString(&*W, W__typ, (CHAR*)" -9223372036854775808", 22); return; } else { diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index 8c1b9016..ac4a8157 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/VT100.c b/bootstrap/unix-88/VT100.c index 7a2a840d..c6c421f9 100644 --- a/bootstrap/unix-88/VT100.c +++ b/bootstrap/unix-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/VT100.h b/bootstrap/unix-88/VT100.h index 5a3fe6d0..b1771722 100644 --- a/bootstrap/unix-88/VT100.h +++ b/bootstrap/unix-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index 657534b4..e89705a7 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -65,7 +65,7 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) { - __COPY("gcc -g", s, s__len); + __COPY("x86_64-w64-mingw32-gcc -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); @@ -95,7 +95,7 @@ void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN stati Strings_Append((CHAR*)".c ", 4, (void*)cmd, 1023); Strings_Append(additionalopts, additionalopts__len, (void*)cmd, 1023); if (statically) { - Strings_Append((CHAR*)"-static", 8, (void*)cmd, 1023); + Strings_Append((CHAR*)"", 1, (void*)cmd, 1023); } Strings_Append((CHAR*)" -o ", 5, (void*)cmd, 1023); Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index 6ad7abb0..e92a4c5f 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/Compiler.c b/bootstrap/windows-48/Compiler.c index e59d7615..9322477d 100644 --- a/bootstrap/windows-48/Compiler.c +++ b/bootstrap/windows-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index 01281cfc..f30fe61f 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index 98f85767..39dd27b9 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 841d80d9..c0bb12ed 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index dab76a88..b2973453 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index b6abc8f3..95b746d7 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index 82ebd04d..86033649 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index 98b3a7e9..85b323b2 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index 3ab94701..92ebb074 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index d9e826b8..57fde3a0 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -550,7 +550,7 @@ void OPB_MOp (INT8 op, OPT_Node *x) if (__IN(f, 0xf0, 32)) { if (z->class == 7) { if (f == 4) { - if (z->conval->intval == (-9223372036854775807-1)) { + if (z->conval->intval == (-9223372036854775807LL-1)) { OPB_err(203); } else { z->conval->intval = -z->conval->intval; @@ -577,7 +577,7 @@ void OPB_MOp (INT8 op, OPT_Node *x) if (__IN(f, 0x70, 32)) { if (z->class == 7) { if (f == 4) { - if (z->conval->intval == (-9223372036854775807-1)) { + if (z->conval->intval == (-9223372036854775807LL-1)) { OPB_err(203); } else { z->conval->intval = __ABS(z->conval->intval); @@ -920,7 +920,7 @@ static void OPB_ConstOp (INT16 op, OPT_Node x, OPT_Node y) if (f == 4) { xv = xval->intval; yv = yval->intval; - if (((((xv == 0 || yv == 0) || (((xv > 0 && yv > 0)) && yv <= __DIV(9223372036854775807, xv))) || (((xv > 0 && yv < 0)) && yv >= __DIV((-9223372036854775807-1), xv))) || (((xv < 0 && yv > 0)) && xv >= __DIV((-9223372036854775807-1), yv))) || (((((((xv < 0 && yv < 0)) && xv != (-9223372036854775807-1))) && yv != (-9223372036854775807-1))) && -xv <= __DIV(9223372036854775807, -yv))) { + if (((((xv == 0 || yv == 0) || (((xv > 0 && yv > 0)) && yv <= __DIV(9223372036854775807LL, xv))) || (((xv > 0 && yv < 0)) && yv >= __DIV((-9223372036854775807LL-1), xv))) || (((xv < 0 && yv > 0)) && xv >= __DIV((-9223372036854775807LL-1), yv))) || (((((((xv < 0 && yv < 0)) && xv != (-9223372036854775807LL-1))) && yv != (-9223372036854775807LL-1))) && -xv <= __DIV(9223372036854775807LL, -yv))) { xval->intval = xv * yv; OPB_SetIntType(x); } else { @@ -999,8 +999,8 @@ static void OPB_ConstOp (INT16 op, OPT_Node x, OPT_Node y) break; case 6: if (f == 4) { - temp = (yval->intval >= 0 && xval->intval <= 9223372036854775807 - yval->intval); - if (temp || (yval->intval < 0 && xval->intval >= (-9223372036854775807-1) - yval->intval)) { + temp = (yval->intval >= 0 && xval->intval <= 9223372036854775807LL - yval->intval); + if (temp || (yval->intval < 0 && xval->intval >= (-9223372036854775807LL-1) - yval->intval)) { xval->intval += yval->intval; OPB_SetIntType(x); } else { @@ -1023,7 +1023,7 @@ static void OPB_ConstOp (INT16 op, OPT_Node x, OPT_Node y) break; case 7: if (f == 4) { - if ((yval->intval >= 0 && xval->intval >= (-9223372036854775807-1) + yval->intval) || (yval->intval < 0 && xval->intval <= 9223372036854775807 + yval->intval)) { + if ((yval->intval >= 0 && xval->intval >= (-9223372036854775807LL-1) + yval->intval) || (yval->intval < 0 && xval->intval <= 9223372036854775807LL + yval->intval)) { xval->intval -= yval->intval; OPB_SetIntType(x); } else { @@ -2087,7 +2087,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno) OPB_err(208); p->conval->intval = 1; } else if (x->conval->intval >= 0) { - if (__ABS(p->conval->intval) <= __DIV(9223372036854775807, (INT64)__ASH(1, x->conval->intval))) { + if (__ABS(p->conval->intval) <= __DIV(9223372036854775807LL, (INT64)__ASH(1, x->conval->intval))) { p->conval->intval = p->conval->intval * (INT64)__ASH(1, x->conval->intval); } else { OPB_err(208); @@ -2585,7 +2585,7 @@ export void *OPB__init(void) __MODULE_IMPORT(OPT); __REGMOD("OPB", 0); /* BEGIN */ - OPB_maxExp = OPB_log(4611686018427387904); + OPB_maxExp = OPB_log(4611686018427387904LL); OPB_maxExp = OPB_exp; __ENDMOD; } diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index 2c396170..e841f317 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 5f4dc826..73872a51 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index f9bc06a4..06fa9996 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 1732c950..9aca428d 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -893,7 +893,7 @@ void OPM_WriteHex (INT64 i) void OPM_WriteInt (INT64 i) { - CHAR s[24]; + CHAR s[26]; INT64 i1, k; if ((i == OPM_SignedMinimum(2) || i == OPM_SignedMinimum(4)) || i == OPM_SignedMinimum(8)) { OPM_Write('('); @@ -901,21 +901,27 @@ void OPM_WriteInt (INT64 i) OPM_WriteString((CHAR*)"-1)", 4); } else { i1 = __ABS(i); - s[0] = (CHAR)(__MOD(i1, 10) + 48); + if (i1 <= 2147483647) { + k = 0; + } else { + __MOVE("LL", s, 3); + k = 2; + } + s[__X(k, 26)] = (CHAR)(__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); - k = 1; + k += 1; while (i1 > 0) { - s[__X(k, 24)] = (CHAR)(__MOD(i1, 10) + 48); + s[__X(k, 26)] = (CHAR)(__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k += 1; } if (i < 0) { - s[__X(k, 24)] = '-'; + s[__X(k, 26)] = '-'; k += 1; } while (k > 0) { k -= 1; - OPM_Write(s[__X(k, 24)]); + OPM_Write(s[__X(k, 26)]); } } } diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index 979995c8..6ea722dc 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index 69624c1f..24a04912 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index b748e221..b6d59055 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index eee78d80..311cbe15 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -198,7 +198,7 @@ static void OPS_Number (void) while (i < n) { d = Ord__7(dig[i], 0); i += 1; - if (OPS_intval <= __DIV(9223372036854775807 - (INT64)d, 10)) { + if (OPS_intval <= __DIV(9223372036854775807LL - (INT64)d, 10)) { OPS_intval = OPS_intval * 10 + (INT64)d; } else { OPS_err(203); diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index 7ab70899..28618fe1 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 174aae08..7284592a 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index 67996e8e..ab443dff 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index fb6ac690..5a44f258 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index 43aaf24a..d26a1b3e 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Out.c b/bootstrap/windows-48/Out.c index 0d3f9e29..b5ccb18b 100644 --- a/bootstrap/windows-48/Out.c +++ b/bootstrap/windows-48/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -89,7 +89,7 @@ void Out_Int (INT64 x, INT64 n) INT16 i; BOOLEAN negative; negative = x < 0; - if (x == (-9223372036854775807-1)) { + if (x == (-9223372036854775807LL-1)) { __MOVE("8085774586302733229", s, 20); i = 19; } else { @@ -175,7 +175,7 @@ static void Out_RealP (LONGREAL x, INT16 n, BOOLEAN long_) INT64 m; INT16 d, dr; e = (INT16)__MASK(__ASHR((__VAL(INT64, x)), 52), -2048); - f = __MASK((__VAL(INT64, x)), -4503599627370496); + f = __MASK((__VAL(INT64, x)), -4503599627370496LL); nn = (__VAL(INT64, x) < 0 && !((e == 2047 && f != 0))); if (nn) { n -= 1; diff --git a/bootstrap/windows-48/Out.h b/bootstrap/windows-48/Out.h index 27f2c9bb..a4eb7cb6 100644 --- a/bootstrap/windows-48/Out.h +++ b/bootstrap/windows-48/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 4a164fb8..20c5ca89 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index adfe4173..f53d70ed 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index e4149017..33c286b7 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index e3bfadb5..6fc2dd5c 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index a3f1e808..42190367 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index b192b7bb..1806a7cc 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index 4fa93c49..cc68acd9 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -1046,7 +1046,7 @@ void Texts_WriteInt (Texts_Writer *W, ADDRESS *W__typ, INT64 x, INT64 n) CHAR a[24]; i = 0; if (x < 0) { - if (x == (-9223372036854775807-1)) { + if (x == (-9223372036854775807LL-1)) { Texts_WriteString(&*W, W__typ, (CHAR*)" -9223372036854775808", 22); return; } else { diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index 235cecb4..9aed03da 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/VT100.c b/bootstrap/windows-48/VT100.c index 7a2a840d..c6c421f9 100644 --- a/bootstrap/windows-48/VT100.c +++ b/bootstrap/windows-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/VT100.h b/bootstrap/windows-48/VT100.h index 5a3fe6d0..b1771722 100644 --- a/bootstrap/windows-48/VT100.h +++ b/bootstrap/windows-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index 657534b4..e89705a7 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -65,7 +65,7 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) { - __COPY("gcc -g", s, s__len); + __COPY("x86_64-w64-mingw32-gcc -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); @@ -95,7 +95,7 @@ void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN stati Strings_Append((CHAR*)".c ", 4, (void*)cmd, 1023); Strings_Append(additionalopts, additionalopts__len, (void*)cmd, 1023); if (statically) { - Strings_Append((CHAR*)"-static", 8, (void*)cmd, 1023); + Strings_Append((CHAR*)"", 1, (void*)cmd, 1023); } Strings_Append((CHAR*)" -o ", 5, (void*)cmd, 1023); Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index 6ad7abb0..e92a4c5f 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/Compiler.c b/bootstrap/windows-88/Compiler.c index e59d7615..9322477d 100644 --- a/bootstrap/windows-88/Compiler.c +++ b/bootstrap/windows-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index 01281cfc..f30fe61f 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index 98f85767..39dd27b9 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 8ad0e207..27810f46 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 3631e4aa..8d9e7acc 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index 222162d5..5f4cd2f3 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -721,10 +721,10 @@ void Heap_InitHeap (void) Heap_heapsize = 0; Heap_allocated = 0; Heap_lockdepth = 0; - Heap_heapPosMin = 9223372036854775807; + Heap_heapPosMin = 9223372036854775807LL; Heap_heapPosMax = 0; Heap_heapNegMin = 0; - Heap_heapNegMax = (-9223372036854775807-1); + Heap_heapNegMax = (-9223372036854775807LL-1); Heap_heap = Heap_NewChunk(256000); __PUT(Heap_heap, 0, INT64); Heap_firstTry = 1; diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index 585db2f0..da41e4b8 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index c6884be5..d3b0e7ec 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index a3e555ef..327f139b 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index d9e826b8..57fde3a0 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -550,7 +550,7 @@ void OPB_MOp (INT8 op, OPT_Node *x) if (__IN(f, 0xf0, 32)) { if (z->class == 7) { if (f == 4) { - if (z->conval->intval == (-9223372036854775807-1)) { + if (z->conval->intval == (-9223372036854775807LL-1)) { OPB_err(203); } else { z->conval->intval = -z->conval->intval; @@ -577,7 +577,7 @@ void OPB_MOp (INT8 op, OPT_Node *x) if (__IN(f, 0x70, 32)) { if (z->class == 7) { if (f == 4) { - if (z->conval->intval == (-9223372036854775807-1)) { + if (z->conval->intval == (-9223372036854775807LL-1)) { OPB_err(203); } else { z->conval->intval = __ABS(z->conval->intval); @@ -920,7 +920,7 @@ static void OPB_ConstOp (INT16 op, OPT_Node x, OPT_Node y) if (f == 4) { xv = xval->intval; yv = yval->intval; - if (((((xv == 0 || yv == 0) || (((xv > 0 && yv > 0)) && yv <= __DIV(9223372036854775807, xv))) || (((xv > 0 && yv < 0)) && yv >= __DIV((-9223372036854775807-1), xv))) || (((xv < 0 && yv > 0)) && xv >= __DIV((-9223372036854775807-1), yv))) || (((((((xv < 0 && yv < 0)) && xv != (-9223372036854775807-1))) && yv != (-9223372036854775807-1))) && -xv <= __DIV(9223372036854775807, -yv))) { + if (((((xv == 0 || yv == 0) || (((xv > 0 && yv > 0)) && yv <= __DIV(9223372036854775807LL, xv))) || (((xv > 0 && yv < 0)) && yv >= __DIV((-9223372036854775807LL-1), xv))) || (((xv < 0 && yv > 0)) && xv >= __DIV((-9223372036854775807LL-1), yv))) || (((((((xv < 0 && yv < 0)) && xv != (-9223372036854775807LL-1))) && yv != (-9223372036854775807LL-1))) && -xv <= __DIV(9223372036854775807LL, -yv))) { xval->intval = xv * yv; OPB_SetIntType(x); } else { @@ -999,8 +999,8 @@ static void OPB_ConstOp (INT16 op, OPT_Node x, OPT_Node y) break; case 6: if (f == 4) { - temp = (yval->intval >= 0 && xval->intval <= 9223372036854775807 - yval->intval); - if (temp || (yval->intval < 0 && xval->intval >= (-9223372036854775807-1) - yval->intval)) { + temp = (yval->intval >= 0 && xval->intval <= 9223372036854775807LL - yval->intval); + if (temp || (yval->intval < 0 && xval->intval >= (-9223372036854775807LL-1) - yval->intval)) { xval->intval += yval->intval; OPB_SetIntType(x); } else { @@ -1023,7 +1023,7 @@ static void OPB_ConstOp (INT16 op, OPT_Node x, OPT_Node y) break; case 7: if (f == 4) { - if ((yval->intval >= 0 && xval->intval >= (-9223372036854775807-1) + yval->intval) || (yval->intval < 0 && xval->intval <= 9223372036854775807 + yval->intval)) { + if ((yval->intval >= 0 && xval->intval >= (-9223372036854775807LL-1) + yval->intval) || (yval->intval < 0 && xval->intval <= 9223372036854775807LL + yval->intval)) { xval->intval -= yval->intval; OPB_SetIntType(x); } else { @@ -2087,7 +2087,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno) OPB_err(208); p->conval->intval = 1; } else if (x->conval->intval >= 0) { - if (__ABS(p->conval->intval) <= __DIV(9223372036854775807, (INT64)__ASH(1, x->conval->intval))) { + if (__ABS(p->conval->intval) <= __DIV(9223372036854775807LL, (INT64)__ASH(1, x->conval->intval))) { p->conval->intval = p->conval->intval * (INT64)__ASH(1, x->conval->intval); } else { OPB_err(208); @@ -2585,7 +2585,7 @@ export void *OPB__init(void) __MODULE_IMPORT(OPT); __REGMOD("OPB", 0); /* BEGIN */ - OPB_maxExp = OPB_log(4611686018427387904); + OPB_maxExp = OPB_log(4611686018427387904LL); OPB_maxExp = OPB_exp; __ENDMOD; } diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index 2c396170..e841f317 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index 5f4dc826..73872a51 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index f9bc06a4..06fa9996 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index f52cb5e2..0533cbfc 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -893,7 +893,7 @@ void OPM_WriteHex (INT64 i) void OPM_WriteInt (INT64 i) { - CHAR s[24]; + CHAR s[26]; INT64 i1, k; if ((i == OPM_SignedMinimum(2) || i == OPM_SignedMinimum(4)) || i == OPM_SignedMinimum(8)) { OPM_Write('('); @@ -901,21 +901,27 @@ void OPM_WriteInt (INT64 i) OPM_WriteString((CHAR*)"-1)", 4); } else { i1 = __ABS(i); - s[0] = (CHAR)(__MOD(i1, 10) + 48); + if (i1 <= 2147483647) { + k = 0; + } else { + __MOVE("LL", s, 3); + k = 2; + } + s[__X(k, 26)] = (CHAR)(__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); - k = 1; + k += 1; while (i1 > 0) { - s[__X(k, 24)] = (CHAR)(__MOD(i1, 10) + 48); + s[__X(k, 26)] = (CHAR)(__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k += 1; } if (i < 0) { - s[__X(k, 24)] = '-'; + s[__X(k, 26)] = '-'; k += 1; } while (k > 0) { k -= 1; - OPM_Write(s[__X(k, 24)]); + OPM_Write(s[__X(k, 26)]); } } } diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index 979995c8..6ea722dc 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index 954279d4..a7630159 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index b748e221..b6d59055 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index eee78d80..311cbe15 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -198,7 +198,7 @@ static void OPS_Number (void) while (i < n) { d = Ord__7(dig[i], 0); i += 1; - if (OPS_intval <= __DIV(9223372036854775807 - (INT64)d, 10)) { + if (OPS_intval <= __DIV(9223372036854775807LL - (INT64)d, 10)) { OPS_intval = OPS_intval * 10 + (INT64)d; } else { OPS_err(203); diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index 7ab70899..28618fe1 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index b58d6175..0dd110b2 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 67996e8e..ab443dff 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 22c12372..6a1d23a7 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index 43aaf24a..d26a1b3e 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Out.c b/bootstrap/windows-88/Out.c index 0d3f9e29..b5ccb18b 100644 --- a/bootstrap/windows-88/Out.c +++ b/bootstrap/windows-88/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -89,7 +89,7 @@ void Out_Int (INT64 x, INT64 n) INT16 i; BOOLEAN negative; negative = x < 0; - if (x == (-9223372036854775807-1)) { + if (x == (-9223372036854775807LL-1)) { __MOVE("8085774586302733229", s, 20); i = 19; } else { @@ -175,7 +175,7 @@ static void Out_RealP (LONGREAL x, INT16 n, BOOLEAN long_) INT64 m; INT16 d, dr; e = (INT16)__MASK(__ASHR((__VAL(INT64, x)), 52), -2048); - f = __MASK((__VAL(INT64, x)), -4503599627370496); + f = __MASK((__VAL(INT64, x)), -4503599627370496LL); nn = (__VAL(INT64, x) < 0 && !((e == 2047 && f != 0))); if (nn) { n -= 1; diff --git a/bootstrap/windows-88/Out.h b/bootstrap/windows-88/Out.h index 27f2c9bb..a4eb7cb6 100644 --- a/bootstrap/windows-88/Out.h +++ b/bootstrap/windows-88/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index bad7600e..ca463179 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index 7d53aaad..03b75dc0 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index e4149017..33c286b7 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index e3bfadb5..6fc2dd5c 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index a3f1e808..42190367 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index b192b7bb..1806a7cc 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index a7cc3ff1..627eb31d 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -1046,7 +1046,7 @@ void Texts_WriteInt (Texts_Writer *W, ADDRESS *W__typ, INT64 x, INT64 n) CHAR a[24]; i = 0; if (x < 0) { - if (x == (-9223372036854775807-1)) { + if (x == (-9223372036854775807LL-1)) { Texts_WriteString(&*W, W__typ, (CHAR*)" -9223372036854775808", 22); return; } else { diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index 8c1b9016..ac4a8157 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/VT100.c b/bootstrap/windows-88/VT100.c index 7a2a840d..c6c421f9 100644 --- a/bootstrap/windows-88/VT100.c +++ b/bootstrap/windows-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/VT100.h b/bootstrap/windows-88/VT100.h index 5a3fe6d0..b1771722 100644 --- a/bootstrap/windows-88/VT100.h +++ b/bootstrap/windows-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index 657534b4..e89705a7 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -65,7 +65,7 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) { - __COPY("gcc -g", s, s__len); + __COPY("x86_64-w64-mingw32-gcc -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); @@ -95,7 +95,7 @@ void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN stati Strings_Append((CHAR*)".c ", 4, (void*)cmd, 1023); Strings_Append(additionalopts, additionalopts__len, (void*)cmd, 1023); if (statically) { - Strings_Append((CHAR*)"-static", 8, (void*)cmd, 1023); + Strings_Append((CHAR*)"", 1, (void*)cmd, 1023); } Strings_Append((CHAR*)" -o ", 5, (void*)cmd, 1023); Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index 6ad7abb0..e92a4c5f 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h From 5c3b42be0940dcc477fea50f3eaaaecc1f95058b Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 2 Dec 2016 13:02:35 +0000 Subject: [PATCH 364/580] Fix incorrect dynarray length type merge with subsequent longint in IdentList. --- src/compiler/OPC.Mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/OPC.Mod b/src/compiler/OPC.Mod index f2e662c9..376ba412 100644 --- a/src/compiler/OPC.Mod +++ b/src/compiler/OPC.Mod @@ -655,7 +655,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) DeclareObj(obj, vis = 3); IF obj^.typ^.comp = OPT.DynArr THEN (* declare len parameter(s) *) EndStat; BegStat; - base := OPT.linttyp; + base := OPT.adrtyp; OPM.WriteString("ADDRESS "); LenList(obj, FALSE, TRUE) ELSIF (obj^.mode = OPT.VarPar) & (obj^.typ^.comp = OPT.Record) THEN EndStat; BegStat; From 6beeaa5626b62022a40051a67aa8a7147edf5cdb Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 2 Dec 2016 13:03:18 +0000 Subject: [PATCH 365/580] Update bootstrap C sources. --- bootstrap/unix-44/OPC.c | 2 +- bootstrap/unix-48/OPC.c | 2 +- bootstrap/unix-88/OPC.c | 2 +- bootstrap/windows-48/OPC.c | 2 +- bootstrap/windows-88/OPC.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 73872a51..d3e4eaf5 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -968,7 +968,7 @@ static void OPC_IdentList (OPT_Object obj, INT16 vis) if (obj->typ->comp == 3) { OPC_EndStat(); OPC_BegStat(); - base = OPT_linttyp; + base = OPT_adrtyp; OPM_WriteString((CHAR*)"ADDRESS ", 9); OPC_LenList(obj, 0, 1); } else if ((obj->mode == 2 && obj->typ->comp == 4)) { diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 73872a51..d3e4eaf5 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -968,7 +968,7 @@ static void OPC_IdentList (OPT_Object obj, INT16 vis) if (obj->typ->comp == 3) { OPC_EndStat(); OPC_BegStat(); - base = OPT_linttyp; + base = OPT_adrtyp; OPM_WriteString((CHAR*)"ADDRESS ", 9); OPC_LenList(obj, 0, 1); } else if ((obj->mode == 2 && obj->typ->comp == 4)) { diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index 73872a51..d3e4eaf5 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -968,7 +968,7 @@ static void OPC_IdentList (OPT_Object obj, INT16 vis) if (obj->typ->comp == 3) { OPC_EndStat(); OPC_BegStat(); - base = OPT_linttyp; + base = OPT_adrtyp; OPM_WriteString((CHAR*)"ADDRESS ", 9); OPC_LenList(obj, 0, 1); } else if ((obj->mode == 2 && obj->typ->comp == 4)) { diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 73872a51..d3e4eaf5 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -968,7 +968,7 @@ static void OPC_IdentList (OPT_Object obj, INT16 vis) if (obj->typ->comp == 3) { OPC_EndStat(); OPC_BegStat(); - base = OPT_linttyp; + base = OPT_adrtyp; OPM_WriteString((CHAR*)"ADDRESS ", 9); OPC_LenList(obj, 0, 1); } else if ((obj->mode == 2 && obj->typ->comp == 4)) { diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index 73872a51..d3e4eaf5 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -968,7 +968,7 @@ static void OPC_IdentList (OPT_Object obj, INT16 vis) if (obj->typ->comp == 3) { OPC_EndStat(); OPC_BegStat(); - base = OPT_linttyp; + base = OPT_adrtyp; OPM_WriteString((CHAR*)"ADDRESS ", 9); OPC_LenList(obj, 0, 1); } else if ((obj->mode == 2 && obj->typ->comp == 4)) { From 8c9d029df38eb7a66befd4d33936e6f81ff3359d Mon Sep 17 00:00:00 2001 From: David Brown Date: Sat, 3 Dec 2016 12:07:16 +0000 Subject: [PATCH 366/580] Fix error message display during library build. --- src/tools/make/oberon.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/src/tools/make/oberon.mk b/src/tools/make/oberon.mk index c852bd57..4d4b0b40 100644 --- a/src/tools/make/oberon.mk +++ b/src/tools/make/oberon.mk @@ -372,6 +372,7 @@ library: rm -rf $(BUILDDIR)/$(MODEL) mkdir -p $(BUILDDIR)/$(MODEL) cp $(BUILDDIR)/SYSTEM.[ho] $(BUILDDIR)/$(MODEL) + cp src/runtime/*.Txt $(BUILDDIR)/$(MODEL) cp $(BUILDDIR)/WindowsWrapper.h $(BUILDDIR)/$(MODEL) @make -f src/tools/make/oberon.mk -s O$(MODEL)library MODEL=$(MODEL) @printf "\nMaking lib$(ONAME)-O$(MODEL) .a and .so\n" From 1ae3a2ff328ec92e3c4f25406c79216bc10671d6 Mon Sep 17 00:00:00 2001 From: David Brown Date: Sat, 3 Dec 2016 18:43:13 +0000 Subject: [PATCH 367/580] Simplify ARGV setup. Add trial binary directory discovery code. --- src/compiler/OPM.Mod | 1 + src/runtime/Modules.Mod | 171 ++++++++++++++++++++++---- src/test/confidence/intsyntax/test.sh | 2 +- 3 files changed, 149 insertions(+), 25 deletions(-) diff --git a/src/compiler/OPM.Mod b/src/compiler/OPM.Mod index a314cdc3..4145a1fc 100644 --- a/src/compiler/OPM.Mod +++ b/src/compiler/OPM.Mod @@ -233,6 +233,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) PROCEDURE OpenPar*(): BOOLEAN; (* prepare for a sequence of translations *) VAR s: ARRAY 256 OF CHAR; BEGIN + Out.String("Testing. Binary directory is: '"); Out.String(Modules.BinaryDir); Out.String("'."); Out.Ln; IF Modules.ArgCount = 1 THEN LogWLn; LogWStr("Oberon-2 compiler v"); LogWStr(Configuration.versionLong); LogW("."); LogWLn; diff --git a/src/runtime/Modules.Mod b/src/runtime/Modules.Mod index 8e9c1851..15896d21 100644 --- a/src/runtime/Modules.Mod +++ b/src/runtime/Modules.Mod @@ -31,13 +31,15 @@ MODULE Modules; (* jt 6.1.96 *) END ; VAR - res*: INTEGER; - resMsg*: ARRAY 256 OF CHAR; - imported*, importing*: ModuleName; + res*: INTEGER; + resMsg*: ARRAY 256 OF CHAR; + imported*: ModuleName; + importing*: ModuleName; MainStackFrame-: SYSTEM.ADDRESS; ArgCount-: INTEGER; ArgVector-: SYSTEM.ADDRESS; + BinaryDir-: ARRAY 1024 OF CHAR; (* Program startup *) @@ -50,28 +52,23 @@ MODULE Modules; (* jt 6.1.96 *) PROCEDURE Init*(argc: SYSTEM.INT32; argvadr: SYSTEM.ADDRESS); (* This start code is called by the __INIT macro generated by the compiler as the C main program. *) - TYPE ArgVecPtr = POINTER TO ARRAY 1 OF SYSTEM.ADDRESS; - VAR av: ArgVecPtr; BEGIN MainStackFrame := argvadr; - ArgCount := SYSTEM.VAL(INTEGER, argc); - av := SYSTEM.VAL(ArgVecPtr, argvadr); - ArgVector := av[0]; + ArgCount := SYSTEM.VAL(INTEGER, argc); + SYSTEM.GET(argvadr, ArgVector); - InitHeap; (* Initailse heap varaibles neded for compiler generated *__inits *) - ModulesInit(); (* Our own __init code will run the Platform and Heap __init code. *) + InitHeap; (* Initialse heap variables needed for compiler generated *__inits *) + ModulesInit(); (* Our own __init code will run Platform__init and Heap__init. *) END Init; PROCEDURE GetArg*(n: INTEGER; VAR val: ARRAY OF CHAR); - TYPE - ArgPtr = POINTER TO ARRAY 1024 OF CHAR; - ArgVec = POINTER TO ARRAY 1024 OF ArgPtr; - VAR av: ArgVec; + TYPE argptr = POINTER TO ARRAY 1024 OF CHAR; + VAR arg: argptr; BEGIN IF n < ArgCount THEN - av := SYSTEM.VAL(ArgVec, ArgVector); - COPY(av[n]^, val) + SYSTEM.GET(ArgVector + n*SIZE(SYSTEM.ADDRESS), arg); (* Address of nth argument. *) + COPY(arg^, val); END END GetArg; @@ -94,16 +91,140 @@ MODULE Modules; (* jt 6.1.96 *) RETURN i END ArgPos; +(* Determine directory from which this executable was loaded *) - - PROCEDURE Append(VAR a: ARRAY OF CHAR; b: ARRAY OF CHAR); - VAR i, j: INTEGER; + PROCEDURE CharCount(s: ARRAY OF CHAR): INTEGER; + VAR i: INTEGER; BEGIN - i := 0; WHILE a[i] # 0X DO INC(i) END; - j := 0; WHILE b[j] # 0X DO a[i] := b[j]; INC(i); INC(j) END; - a[i] := 0X + i := 0; WHILE (i < LEN(s)) & (s[i] # 0X) DO INC(i) END; + RETURN i; + END CharCount; + + PROCEDURE Append(s: ARRAY OF CHAR; VAR d: ARRAY OF CHAR); + VAR i,j: INTEGER; + BEGIN + i := 0; j := CharCount(d); + WHILE s[i] # 0X DO d[j] := s[i]; INC(i); INC(j) END; + d[j] := 0X; END Append; + PROCEDURE AppendPart(c: CHAR; s: ARRAY OF CHAR; VAR d: ARRAY OF CHAR); + VAR i,j: INTEGER; + BEGIN + i := 0; j := CharCount(d); + IF (j > 0) & (d[j-1] # c) THEN d[j] := c; INC(j) END; + WHILE s[i] # 0X DO d[j] := s[i]; INC(i); INC(j) END; + d[j] := 0X; + END AppendPart; + + PROCEDURE IsOneOf(c: CHAR; s: ARRAY OF CHAR): BOOLEAN; + VAR i: INTEGER; + BEGIN + IF c = 0X THEN RETURN FALSE END; + i := 0; WHILE (s[i] # c) & (s[i] # 0X) DO INC(i) END; + RETURN s[i] = c + END IsOneOf; + + PROCEDURE IsAbsolute(d: ARRAY OF CHAR): BOOLEAN; + BEGIN + IF d = '' THEN RETURN FALSE END; + IF IsOneOf(d[0], '/\') THEN RETURN TRUE END; + IF d[1] = ':' THEN RETURN TRUE END; + RETURN FALSE; + END IsAbsolute; + + PROCEDURE Canonify(s: ARRAY OF CHAR; VAR d: ARRAY OF CHAR); + BEGIN + IF IsAbsolute(s) THEN + COPY(s, d) + ELSE + COPY(Platform.CWD, d); AppendPart('/', s, d); + END; + END Canonify; + + PROCEDURE IsFilePresent(s: ARRAY OF CHAR): BOOLEAN; + VAR identity: Platform.FileIdentity; + BEGIN RETURN Platform.IdentifyByName(s, identity) = 0 + END IsFilePresent; + + PROCEDURE ExtractPart(s: ARRAY OF CHAR; VAR i: INTEGER; p: ARRAY OF CHAR; VAR d: ARRAY OF CHAR); + (* Extracts from s starting at i up to any character in p. + Result string in d. + Returns i skipped passed found string and any number of delimiters from p. + *) + VAR j: INTEGER; + BEGIN + j := 0; + WHILE (s[i] # 0X) & ~IsOneOf(s[i], p) DO + d[j] := s[i]; INC(i); INC(j) + END; + d[j] := 0X; + WHILE IsOneOf(s[i], p) DO INC(i) END + END ExtractPart; + + PROCEDURE Trim(s: ARRAY OF CHAR; VAR d: ARRAY OF CHAR); + (* Remove redundant '.'s and '/'s. + Note, does not remove 'x/..'. This cannot safely be removed because if + x is a link then 'x/..' means the parent of what x links to rather than + the directory containing link x. + *) + VAR i,j: INTEGER; part: ARRAY 1024 OF CHAR; + BEGIN + i := 0; j := 0; + (* Retain any leading single or pair of '/' (filesystem root or network root). *) + WHILE (i<2) & IsOneOf(s[i], "/\") DO INC(i); d[j] := '/'; INC(j) END; + d[j] := 0X; + (* Append path parts omitting empty or '.' parts. *) + WHILE s[i] # 0X DO + ExtractPart(s, i, "/\", part); + IF (part # '') & (part # '.') THEN AppendPart('/', part, d) END + END; + END Trim; + + PROCEDURE FindBinaryDir(VAR d: ARRAY OF CHAR); + TYPE pathstring = ARRAY 4096 OF CHAR; + VAR + executable: pathstring; + dir: pathstring; + testpath: pathstring; + pathlist: pathstring; + i, j, k: INTEGER; + present: BOOLEAN; + BEGIN + IF ArgCount < 1 THEN + (* Shells and GUIs always pass the command as ARGV[0]. *) + d[0] := 0X; + RETURN; + END; + + (* First try ARGV[0] without looking at the PATH environment variable. *) + GetArg(0, testpath); Trim(testpath, executable); + Canonify(executable, d); present := IsFilePresent(d); + + IF (~present) & (~IsAbsolute(testpath)) THEN + (* ARGV[0] alone didn't work, try non-absolute ARGV[0] with every entry in path. *) + Platform.GetEnv("PATH", pathlist); + i := 0; + WHILE (~present) & (pathlist[i] # 0X) DO + ExtractPart(pathlist, i, ":;", dir); Trim(dir, testpath); + AppendPart('/', executable, testpath); + Canonify(testpath, d); present := IsFilePresent(d) + END + END; + + IF present THEN + (* Remove trailing executable file name *) + k := CharCount(d); + WHILE (k > 0) & ~IsOneOf(d[k-1], '/\') DO DEC(k) END; + (* Chop off executable file name *) + IF k = 0 THEN d[k] := 0X ELSE d[k-1] := 0X END; + ELSE + d[0] := 0X (* Couldn't determine binary directory. *) + END + END FindBinaryDir; + + +(* Module and command lookup by name *) PROCEDURE -modules(): Module "(Modules_Module)Heap_modules"; PROCEDURE -setmodules(m: Module) "Heap_modules = m"; @@ -114,7 +235,7 @@ MODULE Modules; (* jt 6.1.96 *) WHILE (m # NIL) & (m.name # name) DO m := m.next END ; IF m # NIL THEN res := 0; resMsg := "" ELSE res := 1; COPY(name, importing); - resMsg := ' module "'; Append(resMsg, name); Append(resMsg, '" not found'); + resMsg := ' module "'; Append(name, resMsg); Append('" not found', resMsg); END ; RETURN m END ThisMod; @@ -125,7 +246,7 @@ MODULE Modules; (* jt 6.1.96 *) WHILE (c # NIL) & (c.name # name) DO c := c.next END ; IF c # NIL THEN res := 0; resMsg := ""; RETURN c.cmd ELSE res := 2; resMsg := ' command "'; COPY(name, importing); - Append(resMsg, mod.name); Append(resMsg, "."); Append(resMsg, name); Append(resMsg, '" not found'); + Append(mod.name, resMsg); Append(".", resMsg); Append(name, resMsg); Append('" not found', resMsg); RETURN NIL END END ThisCommand; @@ -212,4 +333,6 @@ MODULE Modules; (* jt 6.1.96 *) IF code > 0 THEN Platform.Exit(code) ELSE Platform.Exit(-1) END; END AssertFail; +BEGIN + FindBinaryDir(BinaryDir); END Modules. diff --git a/src/test/confidence/intsyntax/test.sh b/src/test/confidence/intsyntax/test.sh index 3929cc8c..932ea13d 100644 --- a/src/test/confidence/intsyntax/test.sh +++ b/src/test/confidence/intsyntax/test.sh @@ -1,5 +1,5 @@ #!/bin/sh . ../testenv.sh # Generate mixed source and assembly code listing -$OBECOMP IntSyntax.mod -fm >result +$OBECOMP IntSyntax.mod -fm | fgrep -v "Testing. Binary directory is: '" >result . ../testresult.sh From a6049e7b8266caf164d813e80e686a224ec1f400 Mon Sep 17 00:00:00 2001 From: David Brown Date: Sat, 3 Dec 2016 18:44:22 +0000 Subject: [PATCH 368/580] Update bootstrap C sources. --- bootstrap/unix-44/Compiler.c | 2 +- bootstrap/unix-44/Configuration.c | 4 +- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Files.c | 2 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 2 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 229 +++++++++++++++++++++++---- bootstrap/unix-44/Modules.h | 3 +- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 2 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 6 +- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 2 +- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 2 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Out.c | 2 +- bootstrap/unix-44/Out.h | 2 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/VT100.c | 2 +- bootstrap/unix-44/VT100.h | 2 +- bootstrap/unix-44/extTools.c | 6 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-48/Compiler.c | 2 +- bootstrap/unix-48/Configuration.c | 4 +- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Files.c | 2 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 2 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 229 +++++++++++++++++++++++---- bootstrap/unix-48/Modules.h | 3 +- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 2 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 6 +- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 2 +- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 2 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Out.c | 2 +- bootstrap/unix-48/Out.h | 2 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/VT100.c | 2 +- bootstrap/unix-48/VT100.h | 2 +- bootstrap/unix-48/extTools.c | 6 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-88/Compiler.c | 2 +- bootstrap/unix-88/Configuration.c | 4 +- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Files.c | 2 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 2 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 229 +++++++++++++++++++++++---- bootstrap/unix-88/Modules.h | 3 +- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 2 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 6 +- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 2 +- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 2 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Out.c | 2 +- bootstrap/unix-88/Out.h | 2 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/VT100.c | 2 +- bootstrap/unix-88/VT100.h | 2 +- bootstrap/unix-88/extTools.c | 6 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/windows-48/Compiler.c | 2 +- bootstrap/windows-48/Configuration.c | 4 +- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Files.c | 2 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 2 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 229 +++++++++++++++++++++++---- bootstrap/windows-48/Modules.h | 3 +- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 2 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 6 +- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 2 +- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 2 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Out.c | 2 +- bootstrap/windows-48/Out.h | 2 +- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/VT100.c | 2 +- bootstrap/windows-48/VT100.h | 2 +- bootstrap/windows-48/extTools.c | 6 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-88/Compiler.c | 2 +- bootstrap/windows-88/Configuration.c | 4 +- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Files.c | 2 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 2 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 229 +++++++++++++++++++++++---- bootstrap/windows-88/Modules.h | 3 +- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 2 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 6 +- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 2 +- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 2 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Out.c | 2 +- bootstrap/windows-88/Out.h | 2 +- bootstrap/windows-88/Platform.c | 2 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/VT100.c | 2 +- bootstrap/windows-88/VT100.h | 2 +- bootstrap/windows-88/extTools.c | 6 +- bootstrap/windows-88/extTools.h | 2 +- 185 files changed, 1215 insertions(+), 345 deletions(-) diff --git a/bootstrap/unix-44/Compiler.c b/bootstrap/unix-44/Compiler.c index 9322477d..4eac6b2e 100644 --- a/bootstrap/unix-44/Compiler.c +++ b/bootstrap/unix-44/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index f30fe61f..c7d8b4a8 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index 39dd27b9..38963a37 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 96dd911c..30a596c2 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index c97d14a6..aa5fec57 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index 95b746d7..752ece9b 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index 86033649..0126c839 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index 73c918d9..7eb1cd6e 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -46,21 +46,31 @@ export Modules_ModuleName Modules_imported, Modules_importing; export INT32 Modules_MainStackFrame; export INT16 Modules_ArgCount; export INT32 Modules_ArgVector; +export CHAR Modules_BinaryDir[1024]; export ADDRESS *Modules_ModuleDesc__typ; export ADDRESS *Modules_CmdDesc__typ; -static void Modules_Append (CHAR *a, ADDRESS a__len, CHAR *b, ADDRESS b__len); +static void Modules_Append (CHAR *s, ADDRESS s__len, CHAR *d, ADDRESS d__len); +static void Modules_AppendPart (CHAR c, CHAR *s, ADDRESS s__len, CHAR *d, ADDRESS d__len); export INT16 Modules_ArgPos (CHAR *s, ADDRESS s__len); export void Modules_AssertFail (INT32 code); +static void Modules_Canonify (CHAR *s, ADDRESS s__len, CHAR *d, ADDRESS d__len); +static INT16 Modules_CharCount (CHAR *s, ADDRESS s__len); static void Modules_DisplayHaltCode (INT32 code); +static void Modules_ExtractPart (CHAR *s, ADDRESS s__len, INT16 *i, CHAR *p, ADDRESS p__len, CHAR *d, ADDRESS d__len); +static void Modules_FindBinaryDir (CHAR *d, ADDRESS d__len); export void Modules_Free (CHAR *name, ADDRESS name__len, BOOLEAN all); export void Modules_GetArg (INT16 n, CHAR *val, ADDRESS val__len); export void Modules_GetIntArg (INT16 n, INT32 *val); export void Modules_Halt (INT32 code); export void Modules_Init (INT32 argc, INT32 argvadr); +static BOOLEAN Modules_IsAbsolute (CHAR *d, ADDRESS d__len); +static BOOLEAN Modules_IsFilePresent (CHAR *s, ADDRESS s__len); +static BOOLEAN Modules_IsOneOf (CHAR c, CHAR *s, ADDRESS s__len); export Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, ADDRESS name__len); export Modules_Module Modules_ThisMod (CHAR *name, ADDRESS name__len); +static void Modules_Trim (CHAR *s, ADDRESS s__len, CHAR *d, ADDRESS d__len); static void Modules_errch (CHAR c); static void Modules_errint (INT32 l); static void Modules_errstring (CHAR *s, ADDRESS s__len); @@ -72,32 +82,24 @@ extern void *Modules__init(void); #define Modules_modules() (Modules_Module)Heap_modules #define Modules_setmodules(m) Heap_modules = m -typedef - INT32 (*ArgVecPtr__14)[1]; - void Modules_Init (INT32 argc, INT32 argvadr) { - ArgVecPtr__14 av = NIL; Modules_MainStackFrame = argvadr; Modules_ArgCount = __VAL(INT16, argc); - av = (ArgVecPtr__14)(ADDRESS)argvadr; - Modules_ArgVector = (*av)[0]; + __GET(argvadr, Modules_ArgVector, INT32); Modules_InitHeap(); Modules_ModulesInit(); } typedef - CHAR (*ArgPtr__9)[1024]; - -typedef - ArgPtr__9 (*ArgVec__10)[1024]; + CHAR (*argptr__15)[1024]; void Modules_GetArg (INT16 n, CHAR *val, ADDRESS val__len) { - ArgVec__10 av = NIL; + argptr__15 arg = NIL; if (n < Modules_ArgCount) { - av = (ArgVec__10)(ADDRESS)Modules_ArgVector; - __COPY(*(*av)[__X(n, 1024)], val, val__len); + __GET(Modules_ArgVector + __ASHL(n, 2), arg, argptr__15); + __COPY(*arg, val, val__len); } } @@ -142,22 +144,188 @@ INT16 Modules_ArgPos (CHAR *s, ADDRESS s__len) return i; } -static void Modules_Append (CHAR *a, ADDRESS a__len, CHAR *b, ADDRESS b__len) +static INT16 Modules_CharCount (CHAR *s, ADDRESS s__len) { - INT16 i, j; - __DUP(b, b__len, CHAR); + INT16 i; + __DUP(s, s__len, CHAR); i = 0; - while (a[__X(i, a__len)] != 0x00) { + while ((i < s__len && s[__X(i, s__len)] != 0x00)) { i += 1; } - j = 0; - while (b[__X(j, b__len)] != 0x00) { - a[__X(i, a__len)] = b[__X(j, b__len)]; + __DEL(s); + return i; +} + +static void Modules_Append (CHAR *s, ADDRESS s__len, CHAR *d, ADDRESS d__len) +{ + INT16 i, j; + __DUP(s, s__len, CHAR); + i = 0; + j = Modules_CharCount(d, d__len); + while (s[__X(i, s__len)] != 0x00) { + d[__X(j, d__len)] = s[__X(i, s__len)]; i += 1; j += 1; } - a[__X(i, a__len)] = 0x00; - __DEL(b); + d[__X(j, d__len)] = 0x00; + __DEL(s); +} + +static void Modules_AppendPart (CHAR c, CHAR *s, ADDRESS s__len, CHAR *d, ADDRESS d__len) +{ + INT16 i, j; + __DUP(s, s__len, CHAR); + i = 0; + j = Modules_CharCount(d, d__len); + if ((j > 0 && d[__X(j - 1, d__len)] != c)) { + d[__X(j, d__len)] = c; + j += 1; + } + while (s[__X(i, s__len)] != 0x00) { + d[__X(j, d__len)] = s[__X(i, s__len)]; + i += 1; + j += 1; + } + d[__X(j, d__len)] = 0x00; + __DEL(s); +} + +static BOOLEAN Modules_IsOneOf (CHAR c, CHAR *s, ADDRESS s__len) +{ + INT16 i; + __DUP(s, s__len, CHAR); + if (c == 0x00) { + __DEL(s); + return 0; + } + i = 0; + while ((s[__X(i, s__len)] != c && s[__X(i, s__len)] != 0x00)) { + i += 1; + } + __DEL(s); + return s[__X(i, s__len)] == c; +} + +static BOOLEAN Modules_IsAbsolute (CHAR *d, ADDRESS d__len) +{ + __DUP(d, d__len, CHAR); + if (d[0] == 0x00) { + __DEL(d); + return 0; + } + if (Modules_IsOneOf(d[0], (CHAR*)"/\\", 3)) { + __DEL(d); + return 1; + } + if (d[__X(1, d__len)] == ':') { + __DEL(d); + return 1; + } + __DEL(d); + return 0; +} + +static void Modules_Canonify (CHAR *s, ADDRESS s__len, CHAR *d, ADDRESS d__len) +{ + __DUP(s, s__len, CHAR); + if (Modules_IsAbsolute(s, s__len)) { + __COPY(s, d, d__len); + } else { + __COPY(Platform_CWD, d, d__len); + Modules_AppendPart('/', s, s__len, (void*)d, d__len); + } + __DEL(s); +} + +static BOOLEAN Modules_IsFilePresent (CHAR *s, ADDRESS s__len) +{ + Platform_FileIdentity identity; + __DUP(s, s__len, CHAR); + __DEL(s); + return Platform_IdentifyByName(s, s__len, &identity, Platform_FileIdentity__typ) == 0; +} + +static void Modules_ExtractPart (CHAR *s, ADDRESS s__len, INT16 *i, CHAR *p, ADDRESS p__len, CHAR *d, ADDRESS d__len) +{ + INT16 j; + __DUP(s, s__len, CHAR); + __DUP(p, p__len, CHAR); + j = 0; + while ((s[__X(*i, s__len)] != 0x00 && !Modules_IsOneOf(s[__X(*i, s__len)], p, p__len))) { + d[__X(j, d__len)] = s[__X(*i, s__len)]; + *i += 1; + j += 1; + } + d[__X(j, d__len)] = 0x00; + while (Modules_IsOneOf(s[__X(*i, s__len)], p, p__len)) { + *i += 1; + } + __DEL(s); + __DEL(p); +} + +static void Modules_Trim (CHAR *s, ADDRESS s__len, CHAR *d, ADDRESS d__len) +{ + INT16 i, j; + CHAR part[1024]; + __DUP(s, s__len, CHAR); + i = 0; + j = 0; + while ((i < 2 && Modules_IsOneOf(s[__X(i, s__len)], (CHAR*)"/\\", 3))) { + i += 1; + d[__X(j, d__len)] = '/'; + j += 1; + } + d[__X(j, d__len)] = 0x00; + while (s[__X(i, s__len)] != 0x00) { + Modules_ExtractPart(s, s__len, &i, (CHAR*)"/\\", 3, (void*)part, 1024); + if ((part[0] != 0x00 && __STRCMP(part, ".") != 0)) { + Modules_AppendPart('/', part, 1024, (void*)d, d__len); + } + } + __DEL(s); +} + +typedef + CHAR pathstring__12[4096]; + +static void Modules_FindBinaryDir (CHAR *d, ADDRESS d__len) +{ + pathstring__12 executable, dir, testpath, pathlist; + INT16 i, j, k; + BOOLEAN present; + if (Modules_ArgCount < 1) { + d[0] = 0x00; + return; + } + Modules_GetArg(0, (void*)testpath, 4096); + Modules_Trim(testpath, 4096, (void*)executable, 4096); + Modules_Canonify(executable, 4096, (void*)d, d__len); + present = Modules_IsFilePresent(d, d__len); + if ((!present && !Modules_IsAbsolute(testpath, 4096))) { + Platform_GetEnv((CHAR*)"PATH", 5, (void*)pathlist, 4096); + i = 0; + while ((!present && pathlist[__X(i, 4096)] != 0x00)) { + Modules_ExtractPart(pathlist, 4096, &i, (CHAR*)":;", 3, (void*)dir, 4096); + Modules_Trim(dir, 4096, (void*)testpath, 4096); + Modules_AppendPart('/', executable, 4096, (void*)testpath, 4096); + Modules_Canonify(testpath, 4096, (void*)d, d__len); + present = Modules_IsFilePresent(d, d__len); + } + } + if (present) { + k = Modules_CharCount(d, d__len); + while ((k > 0 && !Modules_IsOneOf(d[__X(k - 1, d__len)], (CHAR*)"/\\", 3))) { + k -= 1; + } + if (k == 0) { + d[__X(k, d__len)] = 0x00; + } else { + d[__X(k - 1, d__len)] = 0x00; + } + } else { + d[0] = 0x00; + } } Modules_Module Modules_ThisMod (CHAR *name, ADDRESS name__len) @@ -177,8 +345,8 @@ Modules_Module Modules_ThisMod (CHAR *name, ADDRESS name__len) Modules_res = 1; __COPY(name, Modules_importing, 20); __MOVE(" module \"", Modules_resMsg, 10); - Modules_Append((void*)Modules_resMsg, 256, name, name__len); - Modules_Append((void*)Modules_resMsg, 256, (CHAR*)"\" not found", 12); + Modules_Append(name, name__len, (void*)Modules_resMsg, 256); + Modules_Append((CHAR*)"\" not found", 12, (void*)Modules_resMsg, 256); } __DEL(name); return m; @@ -201,10 +369,10 @@ Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, ADDRESS nam Modules_res = 2; __MOVE(" command \"", Modules_resMsg, 11); __COPY(name, Modules_importing, 20); - Modules_Append((void*)Modules_resMsg, 256, mod->name, 20); - Modules_Append((void*)Modules_resMsg, 256, (CHAR*)".", 2); - Modules_Append((void*)Modules_resMsg, 256, name, name__len); - Modules_Append((void*)Modules_resMsg, 256, (CHAR*)"\" not found", 12); + Modules_Append(mod->name, 20, (void*)Modules_resMsg, 256); + Modules_Append((CHAR*)".", 2, (void*)Modules_resMsg, 256); + Modules_Append(name, name__len, (void*)Modules_resMsg, 256); + Modules_Append((CHAR*)"\" not found", 12, (void*)Modules_resMsg, 256); __DEL(name); return NIL; } @@ -371,5 +539,6 @@ export void *Modules__init(void) __INITYP(Modules_ModuleDesc, Modules_ModuleDesc, 0); __INITYP(Modules_CmdDesc, Modules_CmdDesc, 0); /* BEGIN */ + Modules_FindBinaryDir((void*)Modules_BinaryDir, 1024); __ENDMOD; } diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index 92ebb074..e114cae2 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h @@ -42,6 +42,7 @@ import Modules_ModuleName Modules_imported, Modules_importing; import INT32 Modules_MainStackFrame; import INT16 Modules_ArgCount; import INT32 Modules_ArgVector; +import CHAR Modules_BinaryDir[1024]; import ADDRESS *Modules_ModuleDesc__typ; import ADDRESS *Modules_CmdDesc__typ; diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index 57fde3a0..0b1509bc 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index e841f317..d6b81543 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index d3e4eaf5..620dd88e 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index 06fa9996..20ac9ae8 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 9aca428d..330d8fde 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -267,6 +267,10 @@ static void OPM_ScanOptions (CHAR *s, ADDRESS s__len) BOOLEAN OPM_OpenPar (void) { CHAR s[256]; + Out_String((CHAR*)"Testing. Binary directory is: '", 32); + Out_String(Modules_BinaryDir, 1024); + Out_String((CHAR*)"'.", 3); + Out_Ln(); if (Modules_ArgCount == 1) { OPM_LogWLn(); OPM_LogWStr((CHAR*)"Oberon-2 compiler v", 20); diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index 6ea722dc..ec6947a6 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index 24a04912..e6d8b614 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index b6d59055..da746402 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index 311cbe15..2c97a4d0 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index 28618fe1..0b780918 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index dcaf0156..c12b6ffd 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index ab443dff..0a26e546 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index 5a44f258..950e0e36 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index d26a1b3e..1afcee74 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Out.c b/bootstrap/unix-44/Out.c index 73f0311a..2558adfa 100644 --- a/bootstrap/unix-44/Out.c +++ b/bootstrap/unix-44/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Out.h b/bootstrap/unix-44/Out.h index a4eb7cb6..62f9d414 100644 --- a/bootstrap/unix-44/Out.h +++ b/bootstrap/unix-44/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 95c8d97b..2de4df02 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index 1f183fc5..798f6253 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 33c286b7..8668f3be 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index 6fc2dd5c..a864fcae 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index 42190367..697accbd 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index 1806a7cc..30317939 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index 489acce0..28b11c5a 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index 00add2ac..a9c20822 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/VT100.c b/bootstrap/unix-44/VT100.c index c6c421f9..ea43623a 100644 --- a/bootstrap/unix-44/VT100.c +++ b/bootstrap/unix-44/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/VT100.h b/bootstrap/unix-44/VT100.h index b1771722..70c0dfa9 100644 --- a/bootstrap/unix-44/VT100.h +++ b/bootstrap/unix-44/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index e89705a7..f08daa40 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -65,7 +65,7 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) { - __COPY("x86_64-w64-mingw32-gcc -g", s, s__len); + __COPY("gcc -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); @@ -95,7 +95,7 @@ void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN stati Strings_Append((CHAR*)".c ", 4, (void*)cmd, 1023); Strings_Append(additionalopts, additionalopts__len, (void*)cmd, 1023); if (statically) { - Strings_Append((CHAR*)"", 1, (void*)cmd, 1023); + Strings_Append((CHAR*)"-static", 8, (void*)cmd, 1023); } Strings_Append((CHAR*)" -o ", 5, (void*)cmd, 1023); Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index e92a4c5f..e736dc46 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/Compiler.c b/bootstrap/unix-48/Compiler.c index 9322477d..4eac6b2e 100644 --- a/bootstrap/unix-48/Compiler.c +++ b/bootstrap/unix-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index f30fe61f..c7d8b4a8 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index 39dd27b9..38963a37 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 96dd911c..30a596c2 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index c97d14a6..aa5fec57 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index 95b746d7..752ece9b 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index 86033649..0126c839 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index 73c918d9..7eb1cd6e 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -46,21 +46,31 @@ export Modules_ModuleName Modules_imported, Modules_importing; export INT32 Modules_MainStackFrame; export INT16 Modules_ArgCount; export INT32 Modules_ArgVector; +export CHAR Modules_BinaryDir[1024]; export ADDRESS *Modules_ModuleDesc__typ; export ADDRESS *Modules_CmdDesc__typ; -static void Modules_Append (CHAR *a, ADDRESS a__len, CHAR *b, ADDRESS b__len); +static void Modules_Append (CHAR *s, ADDRESS s__len, CHAR *d, ADDRESS d__len); +static void Modules_AppendPart (CHAR c, CHAR *s, ADDRESS s__len, CHAR *d, ADDRESS d__len); export INT16 Modules_ArgPos (CHAR *s, ADDRESS s__len); export void Modules_AssertFail (INT32 code); +static void Modules_Canonify (CHAR *s, ADDRESS s__len, CHAR *d, ADDRESS d__len); +static INT16 Modules_CharCount (CHAR *s, ADDRESS s__len); static void Modules_DisplayHaltCode (INT32 code); +static void Modules_ExtractPart (CHAR *s, ADDRESS s__len, INT16 *i, CHAR *p, ADDRESS p__len, CHAR *d, ADDRESS d__len); +static void Modules_FindBinaryDir (CHAR *d, ADDRESS d__len); export void Modules_Free (CHAR *name, ADDRESS name__len, BOOLEAN all); export void Modules_GetArg (INT16 n, CHAR *val, ADDRESS val__len); export void Modules_GetIntArg (INT16 n, INT32 *val); export void Modules_Halt (INT32 code); export void Modules_Init (INT32 argc, INT32 argvadr); +static BOOLEAN Modules_IsAbsolute (CHAR *d, ADDRESS d__len); +static BOOLEAN Modules_IsFilePresent (CHAR *s, ADDRESS s__len); +static BOOLEAN Modules_IsOneOf (CHAR c, CHAR *s, ADDRESS s__len); export Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, ADDRESS name__len); export Modules_Module Modules_ThisMod (CHAR *name, ADDRESS name__len); +static void Modules_Trim (CHAR *s, ADDRESS s__len, CHAR *d, ADDRESS d__len); static void Modules_errch (CHAR c); static void Modules_errint (INT32 l); static void Modules_errstring (CHAR *s, ADDRESS s__len); @@ -72,32 +82,24 @@ extern void *Modules__init(void); #define Modules_modules() (Modules_Module)Heap_modules #define Modules_setmodules(m) Heap_modules = m -typedef - INT32 (*ArgVecPtr__14)[1]; - void Modules_Init (INT32 argc, INT32 argvadr) { - ArgVecPtr__14 av = NIL; Modules_MainStackFrame = argvadr; Modules_ArgCount = __VAL(INT16, argc); - av = (ArgVecPtr__14)(ADDRESS)argvadr; - Modules_ArgVector = (*av)[0]; + __GET(argvadr, Modules_ArgVector, INT32); Modules_InitHeap(); Modules_ModulesInit(); } typedef - CHAR (*ArgPtr__9)[1024]; - -typedef - ArgPtr__9 (*ArgVec__10)[1024]; + CHAR (*argptr__15)[1024]; void Modules_GetArg (INT16 n, CHAR *val, ADDRESS val__len) { - ArgVec__10 av = NIL; + argptr__15 arg = NIL; if (n < Modules_ArgCount) { - av = (ArgVec__10)(ADDRESS)Modules_ArgVector; - __COPY(*(*av)[__X(n, 1024)], val, val__len); + __GET(Modules_ArgVector + __ASHL(n, 2), arg, argptr__15); + __COPY(*arg, val, val__len); } } @@ -142,22 +144,188 @@ INT16 Modules_ArgPos (CHAR *s, ADDRESS s__len) return i; } -static void Modules_Append (CHAR *a, ADDRESS a__len, CHAR *b, ADDRESS b__len) +static INT16 Modules_CharCount (CHAR *s, ADDRESS s__len) { - INT16 i, j; - __DUP(b, b__len, CHAR); + INT16 i; + __DUP(s, s__len, CHAR); i = 0; - while (a[__X(i, a__len)] != 0x00) { + while ((i < s__len && s[__X(i, s__len)] != 0x00)) { i += 1; } - j = 0; - while (b[__X(j, b__len)] != 0x00) { - a[__X(i, a__len)] = b[__X(j, b__len)]; + __DEL(s); + return i; +} + +static void Modules_Append (CHAR *s, ADDRESS s__len, CHAR *d, ADDRESS d__len) +{ + INT16 i, j; + __DUP(s, s__len, CHAR); + i = 0; + j = Modules_CharCount(d, d__len); + while (s[__X(i, s__len)] != 0x00) { + d[__X(j, d__len)] = s[__X(i, s__len)]; i += 1; j += 1; } - a[__X(i, a__len)] = 0x00; - __DEL(b); + d[__X(j, d__len)] = 0x00; + __DEL(s); +} + +static void Modules_AppendPart (CHAR c, CHAR *s, ADDRESS s__len, CHAR *d, ADDRESS d__len) +{ + INT16 i, j; + __DUP(s, s__len, CHAR); + i = 0; + j = Modules_CharCount(d, d__len); + if ((j > 0 && d[__X(j - 1, d__len)] != c)) { + d[__X(j, d__len)] = c; + j += 1; + } + while (s[__X(i, s__len)] != 0x00) { + d[__X(j, d__len)] = s[__X(i, s__len)]; + i += 1; + j += 1; + } + d[__X(j, d__len)] = 0x00; + __DEL(s); +} + +static BOOLEAN Modules_IsOneOf (CHAR c, CHAR *s, ADDRESS s__len) +{ + INT16 i; + __DUP(s, s__len, CHAR); + if (c == 0x00) { + __DEL(s); + return 0; + } + i = 0; + while ((s[__X(i, s__len)] != c && s[__X(i, s__len)] != 0x00)) { + i += 1; + } + __DEL(s); + return s[__X(i, s__len)] == c; +} + +static BOOLEAN Modules_IsAbsolute (CHAR *d, ADDRESS d__len) +{ + __DUP(d, d__len, CHAR); + if (d[0] == 0x00) { + __DEL(d); + return 0; + } + if (Modules_IsOneOf(d[0], (CHAR*)"/\\", 3)) { + __DEL(d); + return 1; + } + if (d[__X(1, d__len)] == ':') { + __DEL(d); + return 1; + } + __DEL(d); + return 0; +} + +static void Modules_Canonify (CHAR *s, ADDRESS s__len, CHAR *d, ADDRESS d__len) +{ + __DUP(s, s__len, CHAR); + if (Modules_IsAbsolute(s, s__len)) { + __COPY(s, d, d__len); + } else { + __COPY(Platform_CWD, d, d__len); + Modules_AppendPart('/', s, s__len, (void*)d, d__len); + } + __DEL(s); +} + +static BOOLEAN Modules_IsFilePresent (CHAR *s, ADDRESS s__len) +{ + Platform_FileIdentity identity; + __DUP(s, s__len, CHAR); + __DEL(s); + return Platform_IdentifyByName(s, s__len, &identity, Platform_FileIdentity__typ) == 0; +} + +static void Modules_ExtractPart (CHAR *s, ADDRESS s__len, INT16 *i, CHAR *p, ADDRESS p__len, CHAR *d, ADDRESS d__len) +{ + INT16 j; + __DUP(s, s__len, CHAR); + __DUP(p, p__len, CHAR); + j = 0; + while ((s[__X(*i, s__len)] != 0x00 && !Modules_IsOneOf(s[__X(*i, s__len)], p, p__len))) { + d[__X(j, d__len)] = s[__X(*i, s__len)]; + *i += 1; + j += 1; + } + d[__X(j, d__len)] = 0x00; + while (Modules_IsOneOf(s[__X(*i, s__len)], p, p__len)) { + *i += 1; + } + __DEL(s); + __DEL(p); +} + +static void Modules_Trim (CHAR *s, ADDRESS s__len, CHAR *d, ADDRESS d__len) +{ + INT16 i, j; + CHAR part[1024]; + __DUP(s, s__len, CHAR); + i = 0; + j = 0; + while ((i < 2 && Modules_IsOneOf(s[__X(i, s__len)], (CHAR*)"/\\", 3))) { + i += 1; + d[__X(j, d__len)] = '/'; + j += 1; + } + d[__X(j, d__len)] = 0x00; + while (s[__X(i, s__len)] != 0x00) { + Modules_ExtractPart(s, s__len, &i, (CHAR*)"/\\", 3, (void*)part, 1024); + if ((part[0] != 0x00 && __STRCMP(part, ".") != 0)) { + Modules_AppendPart('/', part, 1024, (void*)d, d__len); + } + } + __DEL(s); +} + +typedef + CHAR pathstring__12[4096]; + +static void Modules_FindBinaryDir (CHAR *d, ADDRESS d__len) +{ + pathstring__12 executable, dir, testpath, pathlist; + INT16 i, j, k; + BOOLEAN present; + if (Modules_ArgCount < 1) { + d[0] = 0x00; + return; + } + Modules_GetArg(0, (void*)testpath, 4096); + Modules_Trim(testpath, 4096, (void*)executable, 4096); + Modules_Canonify(executable, 4096, (void*)d, d__len); + present = Modules_IsFilePresent(d, d__len); + if ((!present && !Modules_IsAbsolute(testpath, 4096))) { + Platform_GetEnv((CHAR*)"PATH", 5, (void*)pathlist, 4096); + i = 0; + while ((!present && pathlist[__X(i, 4096)] != 0x00)) { + Modules_ExtractPart(pathlist, 4096, &i, (CHAR*)":;", 3, (void*)dir, 4096); + Modules_Trim(dir, 4096, (void*)testpath, 4096); + Modules_AppendPart('/', executable, 4096, (void*)testpath, 4096); + Modules_Canonify(testpath, 4096, (void*)d, d__len); + present = Modules_IsFilePresent(d, d__len); + } + } + if (present) { + k = Modules_CharCount(d, d__len); + while ((k > 0 && !Modules_IsOneOf(d[__X(k - 1, d__len)], (CHAR*)"/\\", 3))) { + k -= 1; + } + if (k == 0) { + d[__X(k, d__len)] = 0x00; + } else { + d[__X(k - 1, d__len)] = 0x00; + } + } else { + d[0] = 0x00; + } } Modules_Module Modules_ThisMod (CHAR *name, ADDRESS name__len) @@ -177,8 +345,8 @@ Modules_Module Modules_ThisMod (CHAR *name, ADDRESS name__len) Modules_res = 1; __COPY(name, Modules_importing, 20); __MOVE(" module \"", Modules_resMsg, 10); - Modules_Append((void*)Modules_resMsg, 256, name, name__len); - Modules_Append((void*)Modules_resMsg, 256, (CHAR*)"\" not found", 12); + Modules_Append(name, name__len, (void*)Modules_resMsg, 256); + Modules_Append((CHAR*)"\" not found", 12, (void*)Modules_resMsg, 256); } __DEL(name); return m; @@ -201,10 +369,10 @@ Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, ADDRESS nam Modules_res = 2; __MOVE(" command \"", Modules_resMsg, 11); __COPY(name, Modules_importing, 20); - Modules_Append((void*)Modules_resMsg, 256, mod->name, 20); - Modules_Append((void*)Modules_resMsg, 256, (CHAR*)".", 2); - Modules_Append((void*)Modules_resMsg, 256, name, name__len); - Modules_Append((void*)Modules_resMsg, 256, (CHAR*)"\" not found", 12); + Modules_Append(mod->name, 20, (void*)Modules_resMsg, 256); + Modules_Append((CHAR*)".", 2, (void*)Modules_resMsg, 256); + Modules_Append(name, name__len, (void*)Modules_resMsg, 256); + Modules_Append((CHAR*)"\" not found", 12, (void*)Modules_resMsg, 256); __DEL(name); return NIL; } @@ -371,5 +539,6 @@ export void *Modules__init(void) __INITYP(Modules_ModuleDesc, Modules_ModuleDesc, 0); __INITYP(Modules_CmdDesc, Modules_CmdDesc, 0); /* BEGIN */ + Modules_FindBinaryDir((void*)Modules_BinaryDir, 1024); __ENDMOD; } diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index 92ebb074..e114cae2 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h @@ -42,6 +42,7 @@ import Modules_ModuleName Modules_imported, Modules_importing; import INT32 Modules_MainStackFrame; import INT16 Modules_ArgCount; import INT32 Modules_ArgVector; +import CHAR Modules_BinaryDir[1024]; import ADDRESS *Modules_ModuleDesc__typ; import ADDRESS *Modules_CmdDesc__typ; diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index 57fde3a0..0b1509bc 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index e841f317..d6b81543 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index d3e4eaf5..620dd88e 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index 06fa9996..20ac9ae8 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 9aca428d..330d8fde 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -267,6 +267,10 @@ static void OPM_ScanOptions (CHAR *s, ADDRESS s__len) BOOLEAN OPM_OpenPar (void) { CHAR s[256]; + Out_String((CHAR*)"Testing. Binary directory is: '", 32); + Out_String(Modules_BinaryDir, 1024); + Out_String((CHAR*)"'.", 3); + Out_Ln(); if (Modules_ArgCount == 1) { OPM_LogWLn(); OPM_LogWStr((CHAR*)"Oberon-2 compiler v", 20); diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index 6ea722dc..ec6947a6 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index 24a04912..e6d8b614 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index b6d59055..da746402 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index 311cbe15..2c97a4d0 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index 28618fe1..0b780918 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 7284592a..719dab04 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index ab443dff..0a26e546 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index 5a44f258..950e0e36 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index d26a1b3e..1afcee74 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Out.c b/bootstrap/unix-48/Out.c index 73f0311a..2558adfa 100644 --- a/bootstrap/unix-48/Out.c +++ b/bootstrap/unix-48/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Out.h b/bootstrap/unix-48/Out.h index a4eb7cb6..62f9d414 100644 --- a/bootstrap/unix-48/Out.h +++ b/bootstrap/unix-48/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 95c8d97b..2de4df02 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index 1f183fc5..798f6253 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 33c286b7..8668f3be 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index 6fc2dd5c..a864fcae 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index 42190367..697accbd 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index 1806a7cc..30317939 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index cc68acd9..0ccbbbd1 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index 9aed03da..ceb5355e 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/VT100.c b/bootstrap/unix-48/VT100.c index c6c421f9..ea43623a 100644 --- a/bootstrap/unix-48/VT100.c +++ b/bootstrap/unix-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/VT100.h b/bootstrap/unix-48/VT100.h index b1771722..70c0dfa9 100644 --- a/bootstrap/unix-48/VT100.h +++ b/bootstrap/unix-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index e89705a7..f08daa40 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -65,7 +65,7 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) { - __COPY("x86_64-w64-mingw32-gcc -g", s, s__len); + __COPY("gcc -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); @@ -95,7 +95,7 @@ void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN stati Strings_Append((CHAR*)".c ", 4, (void*)cmd, 1023); Strings_Append(additionalopts, additionalopts__len, (void*)cmd, 1023); if (statically) { - Strings_Append((CHAR*)"", 1, (void*)cmd, 1023); + Strings_Append((CHAR*)"-static", 8, (void*)cmd, 1023); } Strings_Append((CHAR*)" -o ", 5, (void*)cmd, 1023); Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index e92a4c5f..e736dc46 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/Compiler.c b/bootstrap/unix-88/Compiler.c index 9322477d..4eac6b2e 100644 --- a/bootstrap/unix-88/Compiler.c +++ b/bootstrap/unix-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index f30fe61f..c7d8b4a8 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index 39dd27b9..38963a37 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index a2d72b8e..161a30a4 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 4dab2431..52d281d9 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index 5f4cd2f3..34ef3786 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index da41e4b8..648265c8 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index fcf1bb3a..01e9bcbd 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -46,21 +46,31 @@ export Modules_ModuleName Modules_imported, Modules_importing; export INT64 Modules_MainStackFrame; export INT16 Modules_ArgCount; export INT64 Modules_ArgVector; +export CHAR Modules_BinaryDir[1024]; export ADDRESS *Modules_ModuleDesc__typ; export ADDRESS *Modules_CmdDesc__typ; -static void Modules_Append (CHAR *a, ADDRESS a__len, CHAR *b, ADDRESS b__len); +static void Modules_Append (CHAR *s, ADDRESS s__len, CHAR *d, ADDRESS d__len); +static void Modules_AppendPart (CHAR c, CHAR *s, ADDRESS s__len, CHAR *d, ADDRESS d__len); export INT16 Modules_ArgPos (CHAR *s, ADDRESS s__len); export void Modules_AssertFail (INT32 code); +static void Modules_Canonify (CHAR *s, ADDRESS s__len, CHAR *d, ADDRESS d__len); +static INT16 Modules_CharCount (CHAR *s, ADDRESS s__len); static void Modules_DisplayHaltCode (INT32 code); +static void Modules_ExtractPart (CHAR *s, ADDRESS s__len, INT16 *i, CHAR *p, ADDRESS p__len, CHAR *d, ADDRESS d__len); +static void Modules_FindBinaryDir (CHAR *d, ADDRESS d__len); export void Modules_Free (CHAR *name, ADDRESS name__len, BOOLEAN all); export void Modules_GetArg (INT16 n, CHAR *val, ADDRESS val__len); export void Modules_GetIntArg (INT16 n, INT32 *val); export void Modules_Halt (INT32 code); export void Modules_Init (INT32 argc, INT64 argvadr); +static BOOLEAN Modules_IsAbsolute (CHAR *d, ADDRESS d__len); +static BOOLEAN Modules_IsFilePresent (CHAR *s, ADDRESS s__len); +static BOOLEAN Modules_IsOneOf (CHAR c, CHAR *s, ADDRESS s__len); export Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, ADDRESS name__len); export Modules_Module Modules_ThisMod (CHAR *name, ADDRESS name__len); +static void Modules_Trim (CHAR *s, ADDRESS s__len, CHAR *d, ADDRESS d__len); static void Modules_errch (CHAR c); static void Modules_errint (INT32 l); static void Modules_errstring (CHAR *s, ADDRESS s__len); @@ -72,32 +82,24 @@ extern void *Modules__init(void); #define Modules_modules() (Modules_Module)Heap_modules #define Modules_setmodules(m) Heap_modules = m -typedef - INT64 (*ArgVecPtr__14)[1]; - void Modules_Init (INT32 argc, INT64 argvadr) { - ArgVecPtr__14 av = NIL; Modules_MainStackFrame = argvadr; Modules_ArgCount = __VAL(INT16, argc); - av = (ArgVecPtr__14)(ADDRESS)argvadr; - Modules_ArgVector = (*av)[0]; + __GET(argvadr, Modules_ArgVector, INT64); Modules_InitHeap(); Modules_ModulesInit(); } typedef - CHAR (*ArgPtr__9)[1024]; - -typedef - ArgPtr__9 (*ArgVec__10)[1024]; + CHAR (*argptr__15)[1024]; void Modules_GetArg (INT16 n, CHAR *val, ADDRESS val__len) { - ArgVec__10 av = NIL; + argptr__15 arg = NIL; if (n < Modules_ArgCount) { - av = (ArgVec__10)(ADDRESS)Modules_ArgVector; - __COPY(*(*av)[__X(n, 1024)], val, val__len); + __GET(Modules_ArgVector + (INT64)__ASHL(n, 3), arg, argptr__15); + __COPY(*arg, val, val__len); } } @@ -142,22 +144,188 @@ INT16 Modules_ArgPos (CHAR *s, ADDRESS s__len) return i; } -static void Modules_Append (CHAR *a, ADDRESS a__len, CHAR *b, ADDRESS b__len) +static INT16 Modules_CharCount (CHAR *s, ADDRESS s__len) { - INT16 i, j; - __DUP(b, b__len, CHAR); + INT16 i; + __DUP(s, s__len, CHAR); i = 0; - while (a[__X(i, a__len)] != 0x00) { + while ((i < s__len && s[__X(i, s__len)] != 0x00)) { i += 1; } - j = 0; - while (b[__X(j, b__len)] != 0x00) { - a[__X(i, a__len)] = b[__X(j, b__len)]; + __DEL(s); + return i; +} + +static void Modules_Append (CHAR *s, ADDRESS s__len, CHAR *d, ADDRESS d__len) +{ + INT16 i, j; + __DUP(s, s__len, CHAR); + i = 0; + j = Modules_CharCount(d, d__len); + while (s[__X(i, s__len)] != 0x00) { + d[__X(j, d__len)] = s[__X(i, s__len)]; i += 1; j += 1; } - a[__X(i, a__len)] = 0x00; - __DEL(b); + d[__X(j, d__len)] = 0x00; + __DEL(s); +} + +static void Modules_AppendPart (CHAR c, CHAR *s, ADDRESS s__len, CHAR *d, ADDRESS d__len) +{ + INT16 i, j; + __DUP(s, s__len, CHAR); + i = 0; + j = Modules_CharCount(d, d__len); + if ((j > 0 && d[__X(j - 1, d__len)] != c)) { + d[__X(j, d__len)] = c; + j += 1; + } + while (s[__X(i, s__len)] != 0x00) { + d[__X(j, d__len)] = s[__X(i, s__len)]; + i += 1; + j += 1; + } + d[__X(j, d__len)] = 0x00; + __DEL(s); +} + +static BOOLEAN Modules_IsOneOf (CHAR c, CHAR *s, ADDRESS s__len) +{ + INT16 i; + __DUP(s, s__len, CHAR); + if (c == 0x00) { + __DEL(s); + return 0; + } + i = 0; + while ((s[__X(i, s__len)] != c && s[__X(i, s__len)] != 0x00)) { + i += 1; + } + __DEL(s); + return s[__X(i, s__len)] == c; +} + +static BOOLEAN Modules_IsAbsolute (CHAR *d, ADDRESS d__len) +{ + __DUP(d, d__len, CHAR); + if (d[0] == 0x00) { + __DEL(d); + return 0; + } + if (Modules_IsOneOf(d[0], (CHAR*)"/\\", 3)) { + __DEL(d); + return 1; + } + if (d[__X(1, d__len)] == ':') { + __DEL(d); + return 1; + } + __DEL(d); + return 0; +} + +static void Modules_Canonify (CHAR *s, ADDRESS s__len, CHAR *d, ADDRESS d__len) +{ + __DUP(s, s__len, CHAR); + if (Modules_IsAbsolute(s, s__len)) { + __COPY(s, d, d__len); + } else { + __COPY(Platform_CWD, d, d__len); + Modules_AppendPart('/', s, s__len, (void*)d, d__len); + } + __DEL(s); +} + +static BOOLEAN Modules_IsFilePresent (CHAR *s, ADDRESS s__len) +{ + Platform_FileIdentity identity; + __DUP(s, s__len, CHAR); + __DEL(s); + return Platform_IdentifyByName(s, s__len, &identity, Platform_FileIdentity__typ) == 0; +} + +static void Modules_ExtractPart (CHAR *s, ADDRESS s__len, INT16 *i, CHAR *p, ADDRESS p__len, CHAR *d, ADDRESS d__len) +{ + INT16 j; + __DUP(s, s__len, CHAR); + __DUP(p, p__len, CHAR); + j = 0; + while ((s[__X(*i, s__len)] != 0x00 && !Modules_IsOneOf(s[__X(*i, s__len)], p, p__len))) { + d[__X(j, d__len)] = s[__X(*i, s__len)]; + *i += 1; + j += 1; + } + d[__X(j, d__len)] = 0x00; + while (Modules_IsOneOf(s[__X(*i, s__len)], p, p__len)) { + *i += 1; + } + __DEL(s); + __DEL(p); +} + +static void Modules_Trim (CHAR *s, ADDRESS s__len, CHAR *d, ADDRESS d__len) +{ + INT16 i, j; + CHAR part[1024]; + __DUP(s, s__len, CHAR); + i = 0; + j = 0; + while ((i < 2 && Modules_IsOneOf(s[__X(i, s__len)], (CHAR*)"/\\", 3))) { + i += 1; + d[__X(j, d__len)] = '/'; + j += 1; + } + d[__X(j, d__len)] = 0x00; + while (s[__X(i, s__len)] != 0x00) { + Modules_ExtractPart(s, s__len, &i, (CHAR*)"/\\", 3, (void*)part, 1024); + if ((part[0] != 0x00 && __STRCMP(part, ".") != 0)) { + Modules_AppendPart('/', part, 1024, (void*)d, d__len); + } + } + __DEL(s); +} + +typedef + CHAR pathstring__12[4096]; + +static void Modules_FindBinaryDir (CHAR *d, ADDRESS d__len) +{ + pathstring__12 executable, dir, testpath, pathlist; + INT16 i, j, k; + BOOLEAN present; + if (Modules_ArgCount < 1) { + d[0] = 0x00; + return; + } + Modules_GetArg(0, (void*)testpath, 4096); + Modules_Trim(testpath, 4096, (void*)executable, 4096); + Modules_Canonify(executable, 4096, (void*)d, d__len); + present = Modules_IsFilePresent(d, d__len); + if ((!present && !Modules_IsAbsolute(testpath, 4096))) { + Platform_GetEnv((CHAR*)"PATH", 5, (void*)pathlist, 4096); + i = 0; + while ((!present && pathlist[__X(i, 4096)] != 0x00)) { + Modules_ExtractPart(pathlist, 4096, &i, (CHAR*)":;", 3, (void*)dir, 4096); + Modules_Trim(dir, 4096, (void*)testpath, 4096); + Modules_AppendPart('/', executable, 4096, (void*)testpath, 4096); + Modules_Canonify(testpath, 4096, (void*)d, d__len); + present = Modules_IsFilePresent(d, d__len); + } + } + if (present) { + k = Modules_CharCount(d, d__len); + while ((k > 0 && !Modules_IsOneOf(d[__X(k - 1, d__len)], (CHAR*)"/\\", 3))) { + k -= 1; + } + if (k == 0) { + d[__X(k, d__len)] = 0x00; + } else { + d[__X(k - 1, d__len)] = 0x00; + } + } else { + d[0] = 0x00; + } } Modules_Module Modules_ThisMod (CHAR *name, ADDRESS name__len) @@ -177,8 +345,8 @@ Modules_Module Modules_ThisMod (CHAR *name, ADDRESS name__len) Modules_res = 1; __COPY(name, Modules_importing, 20); __MOVE(" module \"", Modules_resMsg, 10); - Modules_Append((void*)Modules_resMsg, 256, name, name__len); - Modules_Append((void*)Modules_resMsg, 256, (CHAR*)"\" not found", 12); + Modules_Append(name, name__len, (void*)Modules_resMsg, 256); + Modules_Append((CHAR*)"\" not found", 12, (void*)Modules_resMsg, 256); } __DEL(name); return m; @@ -201,10 +369,10 @@ Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, ADDRESS nam Modules_res = 2; __MOVE(" command \"", Modules_resMsg, 11); __COPY(name, Modules_importing, 20); - Modules_Append((void*)Modules_resMsg, 256, mod->name, 20); - Modules_Append((void*)Modules_resMsg, 256, (CHAR*)".", 2); - Modules_Append((void*)Modules_resMsg, 256, name, name__len); - Modules_Append((void*)Modules_resMsg, 256, (CHAR*)"\" not found", 12); + Modules_Append(mod->name, 20, (void*)Modules_resMsg, 256); + Modules_Append((CHAR*)".", 2, (void*)Modules_resMsg, 256); + Modules_Append(name, name__len, (void*)Modules_resMsg, 256); + Modules_Append((CHAR*)"\" not found", 12, (void*)Modules_resMsg, 256); __DEL(name); return NIL; } @@ -371,5 +539,6 @@ export void *Modules__init(void) __INITYP(Modules_ModuleDesc, Modules_ModuleDesc, 0); __INITYP(Modules_CmdDesc, Modules_CmdDesc, 0); /* BEGIN */ + Modules_FindBinaryDir((void*)Modules_BinaryDir, 1024); __ENDMOD; } diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index 327f139b..6cad66e4 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h @@ -42,6 +42,7 @@ import Modules_ModuleName Modules_imported, Modules_importing; import INT64 Modules_MainStackFrame; import INT16 Modules_ArgCount; import INT64 Modules_ArgVector; +import CHAR Modules_BinaryDir[1024]; import ADDRESS *Modules_ModuleDesc__typ; import ADDRESS *Modules_CmdDesc__typ; diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index 57fde3a0..0b1509bc 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index e841f317..d6b81543 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index d3e4eaf5..620dd88e 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index 06fa9996..20ac9ae8 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 0533cbfc..39f36504 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -267,6 +267,10 @@ static void OPM_ScanOptions (CHAR *s, ADDRESS s__len) BOOLEAN OPM_OpenPar (void) { CHAR s[256]; + Out_String((CHAR*)"Testing. Binary directory is: '", 32); + Out_String(Modules_BinaryDir, 1024); + Out_String((CHAR*)"'.", 3); + Out_Ln(); if (Modules_ArgCount == 1) { OPM_LogWLn(); OPM_LogWStr((CHAR*)"Oberon-2 compiler v", 20); diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index 6ea722dc..ec6947a6 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index a7630159..34d1f0e4 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index b6d59055..da746402 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index 311cbe15..2c97a4d0 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index 28618fe1..0b780918 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index 0dd110b2..63667f88 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index ab443dff..0a26e546 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 6a1d23a7..5520370e 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index d26a1b3e..1afcee74 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Out.c b/bootstrap/unix-88/Out.c index 73f0311a..2558adfa 100644 --- a/bootstrap/unix-88/Out.c +++ b/bootstrap/unix-88/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Out.h b/bootstrap/unix-88/Out.h index a4eb7cb6..62f9d414 100644 --- a/bootstrap/unix-88/Out.h +++ b/bootstrap/unix-88/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 11b9bd14..e1be57b0 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index f84abacb..37d890d8 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 33c286b7..8668f3be 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index 6fc2dd5c..a864fcae 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index 42190367..697accbd 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index 1806a7cc..30317939 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index 627eb31d..9a2c7cb4 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index ac4a8157..def1eeef 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/VT100.c b/bootstrap/unix-88/VT100.c index c6c421f9..ea43623a 100644 --- a/bootstrap/unix-88/VT100.c +++ b/bootstrap/unix-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/VT100.h b/bootstrap/unix-88/VT100.h index b1771722..70c0dfa9 100644 --- a/bootstrap/unix-88/VT100.h +++ b/bootstrap/unix-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index e89705a7..f08daa40 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -65,7 +65,7 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) { - __COPY("x86_64-w64-mingw32-gcc -g", s, s__len); + __COPY("gcc -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); @@ -95,7 +95,7 @@ void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN stati Strings_Append((CHAR*)".c ", 4, (void*)cmd, 1023); Strings_Append(additionalopts, additionalopts__len, (void*)cmd, 1023); if (statically) { - Strings_Append((CHAR*)"", 1, (void*)cmd, 1023); + Strings_Append((CHAR*)"-static", 8, (void*)cmd, 1023); } Strings_Append((CHAR*)" -o ", 5, (void*)cmd, 1023); Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index e92a4c5f..e736dc46 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/Compiler.c b/bootstrap/windows-48/Compiler.c index 9322477d..4eac6b2e 100644 --- a/bootstrap/windows-48/Compiler.c +++ b/bootstrap/windows-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index f30fe61f..c7d8b4a8 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index 39dd27b9..38963a37 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index c0bb12ed..8d916fc1 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index b2973453..dafb5071 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index 95b746d7..752ece9b 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index 86033649..0126c839 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index 85b323b2..e83c0383 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -46,21 +46,31 @@ export Modules_ModuleName Modules_imported, Modules_importing; export INT32 Modules_MainStackFrame; export INT16 Modules_ArgCount; export INT32 Modules_ArgVector; +export CHAR Modules_BinaryDir[1024]; export ADDRESS *Modules_ModuleDesc__typ; export ADDRESS *Modules_CmdDesc__typ; -static void Modules_Append (CHAR *a, ADDRESS a__len, CHAR *b, ADDRESS b__len); +static void Modules_Append (CHAR *s, ADDRESS s__len, CHAR *d, ADDRESS d__len); +static void Modules_AppendPart (CHAR c, CHAR *s, ADDRESS s__len, CHAR *d, ADDRESS d__len); export INT16 Modules_ArgPos (CHAR *s, ADDRESS s__len); export void Modules_AssertFail (INT32 code); +static void Modules_Canonify (CHAR *s, ADDRESS s__len, CHAR *d, ADDRESS d__len); +static INT16 Modules_CharCount (CHAR *s, ADDRESS s__len); static void Modules_DisplayHaltCode (INT32 code); +static void Modules_ExtractPart (CHAR *s, ADDRESS s__len, INT16 *i, CHAR *p, ADDRESS p__len, CHAR *d, ADDRESS d__len); +static void Modules_FindBinaryDir (CHAR *d, ADDRESS d__len); export void Modules_Free (CHAR *name, ADDRESS name__len, BOOLEAN all); export void Modules_GetArg (INT16 n, CHAR *val, ADDRESS val__len); export void Modules_GetIntArg (INT16 n, INT32 *val); export void Modules_Halt (INT32 code); export void Modules_Init (INT32 argc, INT32 argvadr); +static BOOLEAN Modules_IsAbsolute (CHAR *d, ADDRESS d__len); +static BOOLEAN Modules_IsFilePresent (CHAR *s, ADDRESS s__len); +static BOOLEAN Modules_IsOneOf (CHAR c, CHAR *s, ADDRESS s__len); export Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, ADDRESS name__len); export Modules_Module Modules_ThisMod (CHAR *name, ADDRESS name__len); +static void Modules_Trim (CHAR *s, ADDRESS s__len, CHAR *d, ADDRESS d__len); static void Modules_errch (CHAR c); static void Modules_errint (INT32 l); static void Modules_errstring (CHAR *s, ADDRESS s__len); @@ -72,32 +82,24 @@ extern void *Modules__init(void); #define Modules_modules() (Modules_Module)Heap_modules #define Modules_setmodules(m) Heap_modules = m -typedef - INT32 (*ArgVecPtr__14)[1]; - void Modules_Init (INT32 argc, INT32 argvadr) { - ArgVecPtr__14 av = NIL; Modules_MainStackFrame = argvadr; Modules_ArgCount = __VAL(INT16, argc); - av = (ArgVecPtr__14)(ADDRESS)argvadr; - Modules_ArgVector = (*av)[0]; + __GET(argvadr, Modules_ArgVector, INT32); Modules_InitHeap(); Modules_ModulesInit(); } typedef - CHAR (*ArgPtr__9)[1024]; - -typedef - ArgPtr__9 (*ArgVec__10)[1024]; + CHAR (*argptr__15)[1024]; void Modules_GetArg (INT16 n, CHAR *val, ADDRESS val__len) { - ArgVec__10 av = NIL; + argptr__15 arg = NIL; if (n < Modules_ArgCount) { - av = (ArgVec__10)(ADDRESS)Modules_ArgVector; - __COPY(*(*av)[__X(n, 1024)], val, val__len); + __GET(Modules_ArgVector + __ASHL(n, 2), arg, argptr__15); + __COPY(*arg, val, val__len); } } @@ -142,22 +144,188 @@ INT16 Modules_ArgPos (CHAR *s, ADDRESS s__len) return i; } -static void Modules_Append (CHAR *a, ADDRESS a__len, CHAR *b, ADDRESS b__len) +static INT16 Modules_CharCount (CHAR *s, ADDRESS s__len) { - INT16 i, j; - __DUP(b, b__len, CHAR); + INT16 i; + __DUP(s, s__len, CHAR); i = 0; - while (a[__X(i, a__len)] != 0x00) { + while ((i < s__len && s[__X(i, s__len)] != 0x00)) { i += 1; } - j = 0; - while (b[__X(j, b__len)] != 0x00) { - a[__X(i, a__len)] = b[__X(j, b__len)]; + __DEL(s); + return i; +} + +static void Modules_Append (CHAR *s, ADDRESS s__len, CHAR *d, ADDRESS d__len) +{ + INT16 i, j; + __DUP(s, s__len, CHAR); + i = 0; + j = Modules_CharCount(d, d__len); + while (s[__X(i, s__len)] != 0x00) { + d[__X(j, d__len)] = s[__X(i, s__len)]; i += 1; j += 1; } - a[__X(i, a__len)] = 0x00; - __DEL(b); + d[__X(j, d__len)] = 0x00; + __DEL(s); +} + +static void Modules_AppendPart (CHAR c, CHAR *s, ADDRESS s__len, CHAR *d, ADDRESS d__len) +{ + INT16 i, j; + __DUP(s, s__len, CHAR); + i = 0; + j = Modules_CharCount(d, d__len); + if ((j > 0 && d[__X(j - 1, d__len)] != c)) { + d[__X(j, d__len)] = c; + j += 1; + } + while (s[__X(i, s__len)] != 0x00) { + d[__X(j, d__len)] = s[__X(i, s__len)]; + i += 1; + j += 1; + } + d[__X(j, d__len)] = 0x00; + __DEL(s); +} + +static BOOLEAN Modules_IsOneOf (CHAR c, CHAR *s, ADDRESS s__len) +{ + INT16 i; + __DUP(s, s__len, CHAR); + if (c == 0x00) { + __DEL(s); + return 0; + } + i = 0; + while ((s[__X(i, s__len)] != c && s[__X(i, s__len)] != 0x00)) { + i += 1; + } + __DEL(s); + return s[__X(i, s__len)] == c; +} + +static BOOLEAN Modules_IsAbsolute (CHAR *d, ADDRESS d__len) +{ + __DUP(d, d__len, CHAR); + if (d[0] == 0x00) { + __DEL(d); + return 0; + } + if (Modules_IsOneOf(d[0], (CHAR*)"/\\", 3)) { + __DEL(d); + return 1; + } + if (d[__X(1, d__len)] == ':') { + __DEL(d); + return 1; + } + __DEL(d); + return 0; +} + +static void Modules_Canonify (CHAR *s, ADDRESS s__len, CHAR *d, ADDRESS d__len) +{ + __DUP(s, s__len, CHAR); + if (Modules_IsAbsolute(s, s__len)) { + __COPY(s, d, d__len); + } else { + __COPY(Platform_CWD, d, d__len); + Modules_AppendPart('/', s, s__len, (void*)d, d__len); + } + __DEL(s); +} + +static BOOLEAN Modules_IsFilePresent (CHAR *s, ADDRESS s__len) +{ + Platform_FileIdentity identity; + __DUP(s, s__len, CHAR); + __DEL(s); + return Platform_IdentifyByName(s, s__len, &identity, Platform_FileIdentity__typ) == 0; +} + +static void Modules_ExtractPart (CHAR *s, ADDRESS s__len, INT16 *i, CHAR *p, ADDRESS p__len, CHAR *d, ADDRESS d__len) +{ + INT16 j; + __DUP(s, s__len, CHAR); + __DUP(p, p__len, CHAR); + j = 0; + while ((s[__X(*i, s__len)] != 0x00 && !Modules_IsOneOf(s[__X(*i, s__len)], p, p__len))) { + d[__X(j, d__len)] = s[__X(*i, s__len)]; + *i += 1; + j += 1; + } + d[__X(j, d__len)] = 0x00; + while (Modules_IsOneOf(s[__X(*i, s__len)], p, p__len)) { + *i += 1; + } + __DEL(s); + __DEL(p); +} + +static void Modules_Trim (CHAR *s, ADDRESS s__len, CHAR *d, ADDRESS d__len) +{ + INT16 i, j; + CHAR part[1024]; + __DUP(s, s__len, CHAR); + i = 0; + j = 0; + while ((i < 2 && Modules_IsOneOf(s[__X(i, s__len)], (CHAR*)"/\\", 3))) { + i += 1; + d[__X(j, d__len)] = '/'; + j += 1; + } + d[__X(j, d__len)] = 0x00; + while (s[__X(i, s__len)] != 0x00) { + Modules_ExtractPart(s, s__len, &i, (CHAR*)"/\\", 3, (void*)part, 1024); + if ((part[0] != 0x00 && __STRCMP(part, ".") != 0)) { + Modules_AppendPart('/', part, 1024, (void*)d, d__len); + } + } + __DEL(s); +} + +typedef + CHAR pathstring__12[4096]; + +static void Modules_FindBinaryDir (CHAR *d, ADDRESS d__len) +{ + pathstring__12 executable, dir, testpath, pathlist; + INT16 i, j, k; + BOOLEAN present; + if (Modules_ArgCount < 1) { + d[0] = 0x00; + return; + } + Modules_GetArg(0, (void*)testpath, 4096); + Modules_Trim(testpath, 4096, (void*)executable, 4096); + Modules_Canonify(executable, 4096, (void*)d, d__len); + present = Modules_IsFilePresent(d, d__len); + if ((!present && !Modules_IsAbsolute(testpath, 4096))) { + Platform_GetEnv((CHAR*)"PATH", 5, (void*)pathlist, 4096); + i = 0; + while ((!present && pathlist[__X(i, 4096)] != 0x00)) { + Modules_ExtractPart(pathlist, 4096, &i, (CHAR*)":;", 3, (void*)dir, 4096); + Modules_Trim(dir, 4096, (void*)testpath, 4096); + Modules_AppendPart('/', executable, 4096, (void*)testpath, 4096); + Modules_Canonify(testpath, 4096, (void*)d, d__len); + present = Modules_IsFilePresent(d, d__len); + } + } + if (present) { + k = Modules_CharCount(d, d__len); + while ((k > 0 && !Modules_IsOneOf(d[__X(k - 1, d__len)], (CHAR*)"/\\", 3))) { + k -= 1; + } + if (k == 0) { + d[__X(k, d__len)] = 0x00; + } else { + d[__X(k - 1, d__len)] = 0x00; + } + } else { + d[0] = 0x00; + } } Modules_Module Modules_ThisMod (CHAR *name, ADDRESS name__len) @@ -177,8 +345,8 @@ Modules_Module Modules_ThisMod (CHAR *name, ADDRESS name__len) Modules_res = 1; __COPY(name, Modules_importing, 20); __MOVE(" module \"", Modules_resMsg, 10); - Modules_Append((void*)Modules_resMsg, 256, name, name__len); - Modules_Append((void*)Modules_resMsg, 256, (CHAR*)"\" not found", 12); + Modules_Append(name, name__len, (void*)Modules_resMsg, 256); + Modules_Append((CHAR*)"\" not found", 12, (void*)Modules_resMsg, 256); } __DEL(name); return m; @@ -201,10 +369,10 @@ Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, ADDRESS nam Modules_res = 2; __MOVE(" command \"", Modules_resMsg, 11); __COPY(name, Modules_importing, 20); - Modules_Append((void*)Modules_resMsg, 256, mod->name, 20); - Modules_Append((void*)Modules_resMsg, 256, (CHAR*)".", 2); - Modules_Append((void*)Modules_resMsg, 256, name, name__len); - Modules_Append((void*)Modules_resMsg, 256, (CHAR*)"\" not found", 12); + Modules_Append(mod->name, 20, (void*)Modules_resMsg, 256); + Modules_Append((CHAR*)".", 2, (void*)Modules_resMsg, 256); + Modules_Append(name, name__len, (void*)Modules_resMsg, 256); + Modules_Append((CHAR*)"\" not found", 12, (void*)Modules_resMsg, 256); __DEL(name); return NIL; } @@ -371,5 +539,6 @@ export void *Modules__init(void) __INITYP(Modules_ModuleDesc, Modules_ModuleDesc, 0); __INITYP(Modules_CmdDesc, Modules_CmdDesc, 0); /* BEGIN */ + Modules_FindBinaryDir((void*)Modules_BinaryDir, 1024); __ENDMOD; } diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index 92ebb074..e114cae2 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h @@ -42,6 +42,7 @@ import Modules_ModuleName Modules_imported, Modules_importing; import INT32 Modules_MainStackFrame; import INT16 Modules_ArgCount; import INT32 Modules_ArgVector; +import CHAR Modules_BinaryDir[1024]; import ADDRESS *Modules_ModuleDesc__typ; import ADDRESS *Modules_CmdDesc__typ; diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index 57fde3a0..0b1509bc 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index e841f317..d6b81543 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index d3e4eaf5..620dd88e 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index 06fa9996..20ac9ae8 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 9aca428d..330d8fde 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -267,6 +267,10 @@ static void OPM_ScanOptions (CHAR *s, ADDRESS s__len) BOOLEAN OPM_OpenPar (void) { CHAR s[256]; + Out_String((CHAR*)"Testing. Binary directory is: '", 32); + Out_String(Modules_BinaryDir, 1024); + Out_String((CHAR*)"'.", 3); + Out_Ln(); if (Modules_ArgCount == 1) { OPM_LogWLn(); OPM_LogWStr((CHAR*)"Oberon-2 compiler v", 20); diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index 6ea722dc..ec6947a6 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index 24a04912..e6d8b614 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index b6d59055..da746402 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index 311cbe15..2c97a4d0 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index 28618fe1..0b780918 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 7284592a..719dab04 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index ab443dff..0a26e546 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index 5a44f258..950e0e36 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index d26a1b3e..1afcee74 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Out.c b/bootstrap/windows-48/Out.c index b5ccb18b..d1ff2558 100644 --- a/bootstrap/windows-48/Out.c +++ b/bootstrap/windows-48/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Out.h b/bootstrap/windows-48/Out.h index a4eb7cb6..62f9d414 100644 --- a/bootstrap/windows-48/Out.h +++ b/bootstrap/windows-48/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 20c5ca89..4a1e30b8 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index f53d70ed..a1fad287 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 33c286b7..8668f3be 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index 6fc2dd5c..a864fcae 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index 42190367..697accbd 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index 1806a7cc..30317939 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index cc68acd9..0ccbbbd1 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index 9aed03da..ceb5355e 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/VT100.c b/bootstrap/windows-48/VT100.c index c6c421f9..ea43623a 100644 --- a/bootstrap/windows-48/VT100.c +++ b/bootstrap/windows-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/VT100.h b/bootstrap/windows-48/VT100.h index b1771722..70c0dfa9 100644 --- a/bootstrap/windows-48/VT100.h +++ b/bootstrap/windows-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index e89705a7..f08daa40 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -65,7 +65,7 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) { - __COPY("x86_64-w64-mingw32-gcc -g", s, s__len); + __COPY("gcc -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); @@ -95,7 +95,7 @@ void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN stati Strings_Append((CHAR*)".c ", 4, (void*)cmd, 1023); Strings_Append(additionalopts, additionalopts__len, (void*)cmd, 1023); if (statically) { - Strings_Append((CHAR*)"", 1, (void*)cmd, 1023); + Strings_Append((CHAR*)"-static", 8, (void*)cmd, 1023); } Strings_Append((CHAR*)" -o ", 5, (void*)cmd, 1023); Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index e92a4c5f..e736dc46 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/Compiler.c b/bootstrap/windows-88/Compiler.c index 9322477d..4eac6b2e 100644 --- a/bootstrap/windows-88/Compiler.c +++ b/bootstrap/windows-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index f30fe61f..c7d8b4a8 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index 39dd27b9..38963a37 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 27810f46..da080e3e 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 8d9e7acc..969643b0 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index 5f4cd2f3..34ef3786 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index da41e4b8..648265c8 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index d3b0e7ec..9d8d2534 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -46,21 +46,31 @@ export Modules_ModuleName Modules_imported, Modules_importing; export INT64 Modules_MainStackFrame; export INT16 Modules_ArgCount; export INT64 Modules_ArgVector; +export CHAR Modules_BinaryDir[1024]; export ADDRESS *Modules_ModuleDesc__typ; export ADDRESS *Modules_CmdDesc__typ; -static void Modules_Append (CHAR *a, ADDRESS a__len, CHAR *b, ADDRESS b__len); +static void Modules_Append (CHAR *s, ADDRESS s__len, CHAR *d, ADDRESS d__len); +static void Modules_AppendPart (CHAR c, CHAR *s, ADDRESS s__len, CHAR *d, ADDRESS d__len); export INT16 Modules_ArgPos (CHAR *s, ADDRESS s__len); export void Modules_AssertFail (INT32 code); +static void Modules_Canonify (CHAR *s, ADDRESS s__len, CHAR *d, ADDRESS d__len); +static INT16 Modules_CharCount (CHAR *s, ADDRESS s__len); static void Modules_DisplayHaltCode (INT32 code); +static void Modules_ExtractPart (CHAR *s, ADDRESS s__len, INT16 *i, CHAR *p, ADDRESS p__len, CHAR *d, ADDRESS d__len); +static void Modules_FindBinaryDir (CHAR *d, ADDRESS d__len); export void Modules_Free (CHAR *name, ADDRESS name__len, BOOLEAN all); export void Modules_GetArg (INT16 n, CHAR *val, ADDRESS val__len); export void Modules_GetIntArg (INT16 n, INT32 *val); export void Modules_Halt (INT32 code); export void Modules_Init (INT32 argc, INT64 argvadr); +static BOOLEAN Modules_IsAbsolute (CHAR *d, ADDRESS d__len); +static BOOLEAN Modules_IsFilePresent (CHAR *s, ADDRESS s__len); +static BOOLEAN Modules_IsOneOf (CHAR c, CHAR *s, ADDRESS s__len); export Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, ADDRESS name__len); export Modules_Module Modules_ThisMod (CHAR *name, ADDRESS name__len); +static void Modules_Trim (CHAR *s, ADDRESS s__len, CHAR *d, ADDRESS d__len); static void Modules_errch (CHAR c); static void Modules_errint (INT32 l); static void Modules_errstring (CHAR *s, ADDRESS s__len); @@ -72,32 +82,24 @@ extern void *Modules__init(void); #define Modules_modules() (Modules_Module)Heap_modules #define Modules_setmodules(m) Heap_modules = m -typedef - INT64 (*ArgVecPtr__14)[1]; - void Modules_Init (INT32 argc, INT64 argvadr) { - ArgVecPtr__14 av = NIL; Modules_MainStackFrame = argvadr; Modules_ArgCount = __VAL(INT16, argc); - av = (ArgVecPtr__14)(ADDRESS)argvadr; - Modules_ArgVector = (*av)[0]; + __GET(argvadr, Modules_ArgVector, INT64); Modules_InitHeap(); Modules_ModulesInit(); } typedef - CHAR (*ArgPtr__9)[1024]; - -typedef - ArgPtr__9 (*ArgVec__10)[1024]; + CHAR (*argptr__15)[1024]; void Modules_GetArg (INT16 n, CHAR *val, ADDRESS val__len) { - ArgVec__10 av = NIL; + argptr__15 arg = NIL; if (n < Modules_ArgCount) { - av = (ArgVec__10)(ADDRESS)Modules_ArgVector; - __COPY(*(*av)[__X(n, 1024)], val, val__len); + __GET(Modules_ArgVector + (INT64)__ASHL(n, 3), arg, argptr__15); + __COPY(*arg, val, val__len); } } @@ -142,22 +144,188 @@ INT16 Modules_ArgPos (CHAR *s, ADDRESS s__len) return i; } -static void Modules_Append (CHAR *a, ADDRESS a__len, CHAR *b, ADDRESS b__len) +static INT16 Modules_CharCount (CHAR *s, ADDRESS s__len) { - INT16 i, j; - __DUP(b, b__len, CHAR); + INT16 i; + __DUP(s, s__len, CHAR); i = 0; - while (a[__X(i, a__len)] != 0x00) { + while ((i < s__len && s[__X(i, s__len)] != 0x00)) { i += 1; } - j = 0; - while (b[__X(j, b__len)] != 0x00) { - a[__X(i, a__len)] = b[__X(j, b__len)]; + __DEL(s); + return i; +} + +static void Modules_Append (CHAR *s, ADDRESS s__len, CHAR *d, ADDRESS d__len) +{ + INT16 i, j; + __DUP(s, s__len, CHAR); + i = 0; + j = Modules_CharCount(d, d__len); + while (s[__X(i, s__len)] != 0x00) { + d[__X(j, d__len)] = s[__X(i, s__len)]; i += 1; j += 1; } - a[__X(i, a__len)] = 0x00; - __DEL(b); + d[__X(j, d__len)] = 0x00; + __DEL(s); +} + +static void Modules_AppendPart (CHAR c, CHAR *s, ADDRESS s__len, CHAR *d, ADDRESS d__len) +{ + INT16 i, j; + __DUP(s, s__len, CHAR); + i = 0; + j = Modules_CharCount(d, d__len); + if ((j > 0 && d[__X(j - 1, d__len)] != c)) { + d[__X(j, d__len)] = c; + j += 1; + } + while (s[__X(i, s__len)] != 0x00) { + d[__X(j, d__len)] = s[__X(i, s__len)]; + i += 1; + j += 1; + } + d[__X(j, d__len)] = 0x00; + __DEL(s); +} + +static BOOLEAN Modules_IsOneOf (CHAR c, CHAR *s, ADDRESS s__len) +{ + INT16 i; + __DUP(s, s__len, CHAR); + if (c == 0x00) { + __DEL(s); + return 0; + } + i = 0; + while ((s[__X(i, s__len)] != c && s[__X(i, s__len)] != 0x00)) { + i += 1; + } + __DEL(s); + return s[__X(i, s__len)] == c; +} + +static BOOLEAN Modules_IsAbsolute (CHAR *d, ADDRESS d__len) +{ + __DUP(d, d__len, CHAR); + if (d[0] == 0x00) { + __DEL(d); + return 0; + } + if (Modules_IsOneOf(d[0], (CHAR*)"/\\", 3)) { + __DEL(d); + return 1; + } + if (d[__X(1, d__len)] == ':') { + __DEL(d); + return 1; + } + __DEL(d); + return 0; +} + +static void Modules_Canonify (CHAR *s, ADDRESS s__len, CHAR *d, ADDRESS d__len) +{ + __DUP(s, s__len, CHAR); + if (Modules_IsAbsolute(s, s__len)) { + __COPY(s, d, d__len); + } else { + __COPY(Platform_CWD, d, d__len); + Modules_AppendPart('/', s, s__len, (void*)d, d__len); + } + __DEL(s); +} + +static BOOLEAN Modules_IsFilePresent (CHAR *s, ADDRESS s__len) +{ + Platform_FileIdentity identity; + __DUP(s, s__len, CHAR); + __DEL(s); + return Platform_IdentifyByName(s, s__len, &identity, Platform_FileIdentity__typ) == 0; +} + +static void Modules_ExtractPart (CHAR *s, ADDRESS s__len, INT16 *i, CHAR *p, ADDRESS p__len, CHAR *d, ADDRESS d__len) +{ + INT16 j; + __DUP(s, s__len, CHAR); + __DUP(p, p__len, CHAR); + j = 0; + while ((s[__X(*i, s__len)] != 0x00 && !Modules_IsOneOf(s[__X(*i, s__len)], p, p__len))) { + d[__X(j, d__len)] = s[__X(*i, s__len)]; + *i += 1; + j += 1; + } + d[__X(j, d__len)] = 0x00; + while (Modules_IsOneOf(s[__X(*i, s__len)], p, p__len)) { + *i += 1; + } + __DEL(s); + __DEL(p); +} + +static void Modules_Trim (CHAR *s, ADDRESS s__len, CHAR *d, ADDRESS d__len) +{ + INT16 i, j; + CHAR part[1024]; + __DUP(s, s__len, CHAR); + i = 0; + j = 0; + while ((i < 2 && Modules_IsOneOf(s[__X(i, s__len)], (CHAR*)"/\\", 3))) { + i += 1; + d[__X(j, d__len)] = '/'; + j += 1; + } + d[__X(j, d__len)] = 0x00; + while (s[__X(i, s__len)] != 0x00) { + Modules_ExtractPart(s, s__len, &i, (CHAR*)"/\\", 3, (void*)part, 1024); + if ((part[0] != 0x00 && __STRCMP(part, ".") != 0)) { + Modules_AppendPart('/', part, 1024, (void*)d, d__len); + } + } + __DEL(s); +} + +typedef + CHAR pathstring__12[4096]; + +static void Modules_FindBinaryDir (CHAR *d, ADDRESS d__len) +{ + pathstring__12 executable, dir, testpath, pathlist; + INT16 i, j, k; + BOOLEAN present; + if (Modules_ArgCount < 1) { + d[0] = 0x00; + return; + } + Modules_GetArg(0, (void*)testpath, 4096); + Modules_Trim(testpath, 4096, (void*)executable, 4096); + Modules_Canonify(executable, 4096, (void*)d, d__len); + present = Modules_IsFilePresent(d, d__len); + if ((!present && !Modules_IsAbsolute(testpath, 4096))) { + Platform_GetEnv((CHAR*)"PATH", 5, (void*)pathlist, 4096); + i = 0; + while ((!present && pathlist[__X(i, 4096)] != 0x00)) { + Modules_ExtractPart(pathlist, 4096, &i, (CHAR*)":;", 3, (void*)dir, 4096); + Modules_Trim(dir, 4096, (void*)testpath, 4096); + Modules_AppendPart('/', executable, 4096, (void*)testpath, 4096); + Modules_Canonify(testpath, 4096, (void*)d, d__len); + present = Modules_IsFilePresent(d, d__len); + } + } + if (present) { + k = Modules_CharCount(d, d__len); + while ((k > 0 && !Modules_IsOneOf(d[__X(k - 1, d__len)], (CHAR*)"/\\", 3))) { + k -= 1; + } + if (k == 0) { + d[__X(k, d__len)] = 0x00; + } else { + d[__X(k - 1, d__len)] = 0x00; + } + } else { + d[0] = 0x00; + } } Modules_Module Modules_ThisMod (CHAR *name, ADDRESS name__len) @@ -177,8 +345,8 @@ Modules_Module Modules_ThisMod (CHAR *name, ADDRESS name__len) Modules_res = 1; __COPY(name, Modules_importing, 20); __MOVE(" module \"", Modules_resMsg, 10); - Modules_Append((void*)Modules_resMsg, 256, name, name__len); - Modules_Append((void*)Modules_resMsg, 256, (CHAR*)"\" not found", 12); + Modules_Append(name, name__len, (void*)Modules_resMsg, 256); + Modules_Append((CHAR*)"\" not found", 12, (void*)Modules_resMsg, 256); } __DEL(name); return m; @@ -201,10 +369,10 @@ Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, ADDRESS nam Modules_res = 2; __MOVE(" command \"", Modules_resMsg, 11); __COPY(name, Modules_importing, 20); - Modules_Append((void*)Modules_resMsg, 256, mod->name, 20); - Modules_Append((void*)Modules_resMsg, 256, (CHAR*)".", 2); - Modules_Append((void*)Modules_resMsg, 256, name, name__len); - Modules_Append((void*)Modules_resMsg, 256, (CHAR*)"\" not found", 12); + Modules_Append(mod->name, 20, (void*)Modules_resMsg, 256); + Modules_Append((CHAR*)".", 2, (void*)Modules_resMsg, 256); + Modules_Append(name, name__len, (void*)Modules_resMsg, 256); + Modules_Append((CHAR*)"\" not found", 12, (void*)Modules_resMsg, 256); __DEL(name); return NIL; } @@ -371,5 +539,6 @@ export void *Modules__init(void) __INITYP(Modules_ModuleDesc, Modules_ModuleDesc, 0); __INITYP(Modules_CmdDesc, Modules_CmdDesc, 0); /* BEGIN */ + Modules_FindBinaryDir((void*)Modules_BinaryDir, 1024); __ENDMOD; } diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index 327f139b..6cad66e4 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h @@ -42,6 +42,7 @@ import Modules_ModuleName Modules_imported, Modules_importing; import INT64 Modules_MainStackFrame; import INT16 Modules_ArgCount; import INT64 Modules_ArgVector; +import CHAR Modules_BinaryDir[1024]; import ADDRESS *Modules_ModuleDesc__typ; import ADDRESS *Modules_CmdDesc__typ; diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index 57fde3a0..0b1509bc 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index e841f317..d6b81543 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index d3e4eaf5..620dd88e 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index 06fa9996..20ac9ae8 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 0533cbfc..39f36504 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -267,6 +267,10 @@ static void OPM_ScanOptions (CHAR *s, ADDRESS s__len) BOOLEAN OPM_OpenPar (void) { CHAR s[256]; + Out_String((CHAR*)"Testing. Binary directory is: '", 32); + Out_String(Modules_BinaryDir, 1024); + Out_String((CHAR*)"'.", 3); + Out_Ln(); if (Modules_ArgCount == 1) { OPM_LogWLn(); OPM_LogWStr((CHAR*)"Oberon-2 compiler v", 20); diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index 6ea722dc..ec6947a6 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index a7630159..34d1f0e4 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index b6d59055..da746402 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index 311cbe15..2c97a4d0 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index 28618fe1..0b780918 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index 0dd110b2..63667f88 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index ab443dff..0a26e546 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 6a1d23a7..5520370e 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index d26a1b3e..1afcee74 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Out.c b/bootstrap/windows-88/Out.c index b5ccb18b..d1ff2558 100644 --- a/bootstrap/windows-88/Out.c +++ b/bootstrap/windows-88/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Out.h b/bootstrap/windows-88/Out.h index a4eb7cb6..62f9d414 100644 --- a/bootstrap/windows-88/Out.h +++ b/bootstrap/windows-88/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index ca463179..be0400e8 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index 03b75dc0..6926740d 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 33c286b7..8668f3be 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index 6fc2dd5c..a864fcae 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index 42190367..697accbd 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index 1806a7cc..30317939 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index 627eb31d..9a2c7cb4 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index ac4a8157..def1eeef 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/VT100.c b/bootstrap/windows-88/VT100.c index c6c421f9..ea43623a 100644 --- a/bootstrap/windows-88/VT100.c +++ b/bootstrap/windows-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/VT100.h b/bootstrap/windows-88/VT100.h index b1771722..70c0dfa9 100644 --- a/bootstrap/windows-88/VT100.h +++ b/bootstrap/windows-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index e89705a7..f08daa40 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -65,7 +65,7 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) { - __COPY("x86_64-w64-mingw32-gcc -g", s, s__len); + __COPY("gcc -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); @@ -95,7 +95,7 @@ void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN stati Strings_Append((CHAR*)".c ", 4, (void*)cmd, 1023); Strings_Append(additionalopts, additionalopts__len, (void*)cmd, 1023); if (statically) { - Strings_Append((CHAR*)"", 1, (void*)cmd, 1023); + Strings_Append((CHAR*)"-static", 8, (void*)cmd, 1023); } Strings_Append((CHAR*)" -o ", 5, (void*)cmd, 1023); Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index e92a4c5f..e736dc46 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h From e6c858e6e78f0677d1862f99ad1d8d91b488b160 Mon Sep 17 00:00:00 2001 From: David Brown Date: Sun, 4 Dec 2016 17:56:06 +0000 Subject: [PATCH 369/580] Prototype for finding installation based on binary name. --- src/compiler/Compiler.Mod | 2 +- src/compiler/OPM.Mod | 58 +++++++++++++++++++++------ src/test/confidence/intsyntax/test.sh | 2 +- 3 files changed, 48 insertions(+), 14 deletions(-) diff --git a/src/compiler/Compiler.Mod b/src/compiler/Compiler.Mod index 0a373e7a..4e9c5c10 100644 --- a/src/compiler/Compiler.Mod +++ b/src/compiler/Compiler.Mod @@ -96,7 +96,7 @@ MODULE Compiler; (* J. Templ 3.2.95 *) OPM.Init(done, mname); (* Get next module name from command line *) IF ~done THEN RETURN END ; - OPM.InitOptions; (* Get options ofr this module *) + OPM.InitOptions; (* Get options for this module *) PropagateElementaryTypeSizes; (* Compile source to .c and .h files *) diff --git a/src/compiler/OPM.Mod b/src/compiler/OPM.Mod index 4145a1fc..6cf7dcfc 100644 --- a/src/compiler/OPM.Mod +++ b/src/compiler/OPM.Mod @@ -119,6 +119,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) S: INTEGER; + InstallDir*: ARRAY 1024 OF CHAR; ResourceDir*: ARRAY 1024 OF CHAR; @@ -206,16 +207,6 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) AddressSize := ORD(s[i+1]) - ORD('0'); Alignment := ORD(s[i+2]) - ORD('0'); INC(i, 2) END - - (* Temporary build control option - remove when makefile updated to new options. *) - | "B": IF s[i+1] # 0X THEN INC(i); IntegerSize := ORD(s[i]) - ORD('0') END; - IF s[i+1] # 0X THEN INC(i); AddressSize := ORD(s[i]) - ORD('0') END; - IF s[i+1] # 0X THEN INC(i); Alignment := ORD(s[i]) - ORD('0') END; - ASSERT((IntegerSize = 2) OR (IntegerSize = 4)); - ASSERT((AddressSize = 4) OR (AddressSize = 8)); - ASSERT((Alignment = 4) OR (Alignment = 8)); - IF IntegerSize = 2 THEN LongintSize := 4 ELSE LongintSize := 8 END; - Files.SetSearchPath("") ELSE LogWStr(" warning: option "); LogW(OptionChar); @@ -233,7 +224,6 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) PROCEDURE OpenPar*(): BOOLEAN; (* prepare for a sequence of translations *) VAR s: ARRAY 256 OF CHAR; BEGIN - Out.String("Testing. Binary directory is: '"); Out.String(Modules.BinaryDir); Out.String("'."); Out.Ln; IF Modules.ArgCount = 1 THEN LogWLn; LogWStr("Oberon-2 compiler v"); LogWStr(Configuration.versionLong); LogW("."); LogWLn; @@ -347,7 +337,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) IF verbose IN Options THEN VerboseListSizes END; - ResourceDir := Configuration.installdir; + ResourceDir := InstallDir; Strings.Append("/", ResourceDir); Strings.Append(Model, ResourceDir); @@ -777,6 +767,49 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) END CloseFiles; + PROCEDURE IsProbablyInstallDir(s: ARRAY OF CHAR): BOOLEAN; + VAR testpath: ARRAY 1024 OF CHAR; identity: Platform.FileIdentity; + BEGIN + COPY(InstallDir, testpath); + Strings.Append("/lib/lib", testpath); + Strings.Append(Configuration.name, testpath); + Strings.Append("-O2.a", testpath); + IF Platform.IdentifyByName(testpath, identity) # 0 THEN RETURN FALSE END; + + COPY(InstallDir, testpath); + Strings.Append("/2/include/Oberon.h", testpath); + IF Platform.IdentifyByName(testpath, identity) # 0 THEN RETURN FALSE END; + + COPY(InstallDir, testpath); + Strings.Append("/2/sym/Files.sym", testpath); + IF Platform.IdentifyByName(testpath, identity) # 0 THEN RETURN FALSE END; + + RETURN TRUE; + END IsProbablyInstallDir; + + PROCEDURE FindInstallDir; + VAR i: INTEGER; + BEGIN + (* First try location of binary (with -parts appended) *) + COPY(Modules.BinaryDir, InstallDir); + Strings.Append("/", InstallDir); + Strings.Append(Configuration.name, InstallDir); + Strings.Append("-parts", InstallDir); + IF IsProbablyInstallDir(InstallDir) THEN RETURN END; + + (* Now test whether binary is in bin directory under install dir. *) + COPY(Modules.BinaryDir, InstallDir); + i := Strings.Length(InstallDir); + WHILE (i > 0) & (InstallDir[i-1] # '/') DO DEC(i) END; + IF (i > 0) & (InstallDir[i-1] = '/') THEN + InstallDir[i-1] := 0X; + IF IsProbablyInstallDir(InstallDir) THEN RETURN END + END; + + (* Give up! Use install directory from configuration. *) + COPY(Configuration.installdir, InstallDir) + END FindInstallDir; + BEGIN @@ -784,4 +817,5 @@ BEGIN MaxLReal := 1.7976931348623157D307 * 9.999999; (* LONGREAL is 8 bytes, should be 1.7976931348623157D308 *) MinReal := -MaxReal; MinLReal := -MaxLReal; + FindInstallDir; END OPM. diff --git a/src/test/confidence/intsyntax/test.sh b/src/test/confidence/intsyntax/test.sh index 932ea13d..3929cc8c 100644 --- a/src/test/confidence/intsyntax/test.sh +++ b/src/test/confidence/intsyntax/test.sh @@ -1,5 +1,5 @@ #!/bin/sh . ../testenv.sh # Generate mixed source and assembly code listing -$OBECOMP IntSyntax.mod -fm | fgrep -v "Testing. Binary directory is: '" >result +$OBECOMP IntSyntax.mod -fm >result . ../testresult.sh From c7e88f4634b77eb9e9584527026fe49496a870cb Mon Sep 17 00:00:00 2001 From: David Brown Date: Mon, 5 Dec 2016 12:07:40 +0000 Subject: [PATCH 370/580] Update bootstrap C source. --- bootstrap/unix-44/Compiler.c | 2 +- bootstrap/unix-44/Configuration.c | 4 +- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Files.c | 2 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 2 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 2 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 88 +++++++++++++++++++--------- bootstrap/unix-44/OPM.h | 3 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 2 +- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 2 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Out.c | 2 +- bootstrap/unix-44/Out.h | 2 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/VT100.c | 2 +- bootstrap/unix-44/VT100.h | 2 +- bootstrap/unix-44/extTools.c | 2 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-48/Compiler.c | 2 +- bootstrap/unix-48/Configuration.c | 4 +- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Files.c | 2 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 2 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 2 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 88 +++++++++++++++++++--------- bootstrap/unix-48/OPM.h | 3 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 2 +- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 2 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Out.c | 2 +- bootstrap/unix-48/Out.h | 2 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/VT100.c | 2 +- bootstrap/unix-48/VT100.h | 2 +- bootstrap/unix-48/extTools.c | 2 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-88/Compiler.c | 2 +- bootstrap/unix-88/Configuration.c | 4 +- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Files.c | 2 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 2 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 2 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 88 +++++++++++++++++++--------- bootstrap/unix-88/OPM.h | 3 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 2 +- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 2 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Out.c | 2 +- bootstrap/unix-88/Out.h | 2 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/VT100.c | 2 +- bootstrap/unix-88/VT100.h | 2 +- bootstrap/unix-88/extTools.c | 2 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/windows-48/Compiler.c | 2 +- bootstrap/windows-48/Configuration.c | 4 +- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Files.c | 2 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 2 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 2 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 88 +++++++++++++++++++--------- bootstrap/windows-48/OPM.h | 3 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 2 +- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 2 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Out.c | 2 +- bootstrap/windows-48/Out.h | 2 +- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/VT100.c | 2 +- bootstrap/windows-48/VT100.h | 2 +- bootstrap/windows-48/extTools.c | 2 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-88/Compiler.c | 2 +- bootstrap/windows-88/Configuration.c | 4 +- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Files.c | 2 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 2 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 2 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 88 +++++++++++++++++++--------- bootstrap/windows-88/OPM.h | 3 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 2 +- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 2 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Out.c | 2 +- bootstrap/windows-88/Out.h | 2 +- bootstrap/windows-88/Platform.c | 2 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/VT100.c | 2 +- bootstrap/windows-88/VT100.h | 2 +- bootstrap/windows-88/extTools.c | 2 +- bootstrap/windows-88/extTools.h | 2 +- src/compiler/OPM.Mod | 6 +- 186 files changed, 489 insertions(+), 332 deletions(-) diff --git a/bootstrap/unix-44/Compiler.c b/bootstrap/unix-44/Compiler.c index 4eac6b2e..ed567be7 100644 --- a/bootstrap/unix-44/Compiler.c +++ b/bootstrap/unix-44/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index c7d8b4a8..8f8e5783 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index 38963a37..8a2a656b 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 30a596c2..0faeb4d3 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index aa5fec57..2c89f82e 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index 752ece9b..e6ac7523 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index 0126c839..a4b879fe 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index 7eb1cd6e..3e00c05c 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index e114cae2..445d1eae 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index 0b1509bc..792e292b 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index d6b81543..fb07f6b2 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 620dd88e..49ddd0ab 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index 20ac9ae8..b0142b20 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 330d8fde..94394339 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -42,6 +42,7 @@ static Files_Rider OPM_oldSF, OPM_newSF; static Files_Rider OPM_R[3]; static Files_File OPM_oldSFile, OPM_newSFile, OPM_HFile, OPM_BFile, OPM_HIFile; static INT16 OPM_S; +export CHAR OPM_InstallDir[1024]; export CHAR OPM_ResourceDir[1024]; @@ -53,12 +54,14 @@ export void OPM_FPrint (INT32 *fp, INT64 val); export void OPM_FPrintLReal (INT32 *fp, LONGREAL val); export void OPM_FPrintReal (INT32 *fp, REAL val); export void OPM_FPrintSet (INT32 *fp, UINT64 val); +static void OPM_FindInstallDir (void); static void OPM_FindLine (Files_File f, Files_Rider *r, ADDRESS *r__typ, INT64 pos); static void OPM_FingerprintBytes (INT32 *fp, SYSTEM_BYTE *bytes, ADDRESS bytes__len); export void OPM_Get (CHAR *ch); export void OPM_Init (BOOLEAN *done, CHAR *mname, ADDRESS mname__len); export void OPM_InitOptions (void); export INT16 OPM_Integer (INT64 n); +static BOOLEAN OPM_IsProbablyInstallDir (CHAR *s, ADDRESS s__len); static void OPM_LogErrMsg (INT16 n); export void OPM_LogVT100 (CHAR *vt100code, ADDRESS vt100code__len); export void OPM_LogW (CHAR ch); @@ -228,29 +231,6 @@ static void OPM_ScanOptions (CHAR *s, ADDRESS s__len) i += 2; } break; - case 'B': - if (s[__X(i + 1, s__len)] != 0x00) { - i += 1; - OPM_IntegerSize = (INT16)s[__X(i, s__len)] - 48; - } - if (s[__X(i + 1, s__len)] != 0x00) { - i += 1; - OPM_AddressSize = (INT16)s[__X(i, s__len)] - 48; - } - if (s[__X(i + 1, s__len)] != 0x00) { - i += 1; - OPM_Alignment = (INT16)s[__X(i, s__len)] - 48; - } - __ASSERT(OPM_IntegerSize == 2 || OPM_IntegerSize == 4, 0); - __ASSERT(OPM_AddressSize == 4 || OPM_AddressSize == 8, 0); - __ASSERT(OPM_Alignment == 4 || OPM_Alignment == 8, 0); - if (OPM_IntegerSize == 2) { - OPM_LongintSize = 4; - } else { - OPM_LongintSize = 8; - } - Files_SetSearchPath((CHAR*)"", 1); - break; default: OPM_LogWStr((CHAR*)" warning: option ", 19); OPM_LogW('-'); @@ -267,10 +247,6 @@ static void OPM_ScanOptions (CHAR *s, ADDRESS s__len) BOOLEAN OPM_OpenPar (void) { CHAR s[256]; - Out_String((CHAR*)"Testing. Binary directory is: '", 32); - Out_String(Modules_BinaryDir, 1024); - Out_String((CHAR*)"'.", 3); - Out_Ln(); if (Modules_ArgCount == 1) { OPM_LogWLn(); OPM_LogWStr((CHAR*)"Oberon-2 compiler v", 20); @@ -455,7 +431,7 @@ void OPM_InitOptions (void) if (__IN(18, OPM_Options, 32)) { OPM_VerboseListSizes(); } - OPM_ResourceDir[0] = 0x00; + __MOVE(OPM_InstallDir, OPM_ResourceDir, 1024); Strings_Append((CHAR*)"/", 2, (void*)OPM_ResourceDir, 1024); Strings_Append(OPM_Model, 10, (void*)OPM_ResourceDir, 1024); modules[0] = 0x00; @@ -1060,6 +1036,59 @@ void OPM_CloseFiles (void) Files_Set(&OPM_oldSF, Files_Rider__typ, NIL, 0); } +static BOOLEAN OPM_IsProbablyInstallDir (CHAR *s, ADDRESS s__len) +{ + CHAR testpath[1024]; + Platform_FileIdentity identity; + __DUP(s, s__len, CHAR); + __COPY(OPM_InstallDir, testpath, 1024); + Strings_Append((CHAR*)"/lib/lib", 9, (void*)testpath, 1024); + Strings_Append((CHAR*)"voc", 4, (void*)testpath, 1024); + Strings_Append((CHAR*)"-O2.a", 6, (void*)testpath, 1024); + if (Platform_IdentifyByName(testpath, 1024, &identity, Platform_FileIdentity__typ) != 0) { + __DEL(s); + return 0; + } + __COPY(OPM_InstallDir, testpath, 1024); + Strings_Append((CHAR*)"/2/include/Oberon.h", 20, (void*)testpath, 1024); + if (Platform_IdentifyByName(testpath, 1024, &identity, Platform_FileIdentity__typ) != 0) { + __DEL(s); + return 0; + } + __COPY(OPM_InstallDir, testpath, 1024); + Strings_Append((CHAR*)"/2/sym/Files.sym", 17, (void*)testpath, 1024); + if (Platform_IdentifyByName(testpath, 1024, &identity, Platform_FileIdentity__typ) != 0) { + __DEL(s); + return 0; + } + __DEL(s); + return 1; +} + +static void OPM_FindInstallDir (void) +{ + INT16 i; + __COPY(Modules_BinaryDir, OPM_InstallDir, 1024); + Strings_Append((CHAR*)"/", 2, (void*)OPM_InstallDir, 1024); + Strings_Append((CHAR*)"voc", 4, (void*)OPM_InstallDir, 1024); + Strings_Append((CHAR*)".d", 3, (void*)OPM_InstallDir, 1024); + if (OPM_IsProbablyInstallDir(OPM_InstallDir, 1024)) { + return; + } + __COPY(Modules_BinaryDir, OPM_InstallDir, 1024); + i = Strings_Length(OPM_InstallDir, 1024); + while ((i > 0 && OPM_InstallDir[__X(i - 1, 1024)] != '/')) { + i -= 1; + } + if ((i > 0 && OPM_InstallDir[__X(i - 1, 1024)] == '/')) { + OPM_InstallDir[__X(i - 1, 1024)] = 0x00; + if (OPM_IsProbablyInstallDir(OPM_InstallDir, 1024)) { + return; + } + } + __COPY("", OPM_InstallDir, 1024); +} + static void EnumPtrs(void (*P)(void*)) { __ENUMR(&OPM_inR, Texts_Reader__typ, 48, 1, P); @@ -1100,5 +1129,6 @@ export void *OPM__init(void) OPM_MaxLReal = 1.79769296342094e+308; OPM_MinReal = -OPM_MaxReal; OPM_MinLReal = -OPM_MaxLReal; + OPM_FindInstallDir(); __ENDMOD; } diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index ec6947a6..4d6101bb 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h @@ -17,6 +17,7 @@ import INT32 OPM_curpos, OPM_errpos, OPM_breakpc; import INT16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; import CHAR OPM_modName[32]; import CHAR OPM_objname[64]; +import CHAR OPM_InstallDir[1024]; import CHAR OPM_ResourceDir[1024]; diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index e6d8b614..561e1feb 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index da746402..a88a16ee 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index 2c97a4d0..0918b14d 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index 0b780918..08db3b29 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index c12b6ffd..941329b4 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index 0a26e546..e3f23baf 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index 950e0e36..7d93389c 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index 1afcee74..c1eb098f 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Out.c b/bootstrap/unix-44/Out.c index 2558adfa..ab37e758 100644 --- a/bootstrap/unix-44/Out.c +++ b/bootstrap/unix-44/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Out.h b/bootstrap/unix-44/Out.h index 62f9d414..1cac588c 100644 --- a/bootstrap/unix-44/Out.h +++ b/bootstrap/unix-44/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 2de4df02..89286d2c 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index 798f6253..69667994 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 8668f3be..fde141c5 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index a864fcae..1576c7ee 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index 697accbd..c4d2419d 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index 30317939..471c85c8 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index 28b11c5a..f4d8eef3 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index a9c20822..950703aa 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/VT100.c b/bootstrap/unix-44/VT100.c index ea43623a..b446063e 100644 --- a/bootstrap/unix-44/VT100.c +++ b/bootstrap/unix-44/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/VT100.h b/bootstrap/unix-44/VT100.h index 70c0dfa9..0fd1e5d3 100644 --- a/bootstrap/unix-44/VT100.h +++ b/bootstrap/unix-44/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index f08daa40..858c9514 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index e736dc46..724db7ae 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/Compiler.c b/bootstrap/unix-48/Compiler.c index 4eac6b2e..ed567be7 100644 --- a/bootstrap/unix-48/Compiler.c +++ b/bootstrap/unix-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index c7d8b4a8..8f8e5783 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index 38963a37..8a2a656b 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 30a596c2..0faeb4d3 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index aa5fec57..2c89f82e 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index 752ece9b..e6ac7523 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index 0126c839..a4b879fe 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index 7eb1cd6e..3e00c05c 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index e114cae2..445d1eae 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index 0b1509bc..792e292b 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index d6b81543..fb07f6b2 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 620dd88e..49ddd0ab 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index 20ac9ae8..b0142b20 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 330d8fde..94394339 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -42,6 +42,7 @@ static Files_Rider OPM_oldSF, OPM_newSF; static Files_Rider OPM_R[3]; static Files_File OPM_oldSFile, OPM_newSFile, OPM_HFile, OPM_BFile, OPM_HIFile; static INT16 OPM_S; +export CHAR OPM_InstallDir[1024]; export CHAR OPM_ResourceDir[1024]; @@ -53,12 +54,14 @@ export void OPM_FPrint (INT32 *fp, INT64 val); export void OPM_FPrintLReal (INT32 *fp, LONGREAL val); export void OPM_FPrintReal (INT32 *fp, REAL val); export void OPM_FPrintSet (INT32 *fp, UINT64 val); +static void OPM_FindInstallDir (void); static void OPM_FindLine (Files_File f, Files_Rider *r, ADDRESS *r__typ, INT64 pos); static void OPM_FingerprintBytes (INT32 *fp, SYSTEM_BYTE *bytes, ADDRESS bytes__len); export void OPM_Get (CHAR *ch); export void OPM_Init (BOOLEAN *done, CHAR *mname, ADDRESS mname__len); export void OPM_InitOptions (void); export INT16 OPM_Integer (INT64 n); +static BOOLEAN OPM_IsProbablyInstallDir (CHAR *s, ADDRESS s__len); static void OPM_LogErrMsg (INT16 n); export void OPM_LogVT100 (CHAR *vt100code, ADDRESS vt100code__len); export void OPM_LogW (CHAR ch); @@ -228,29 +231,6 @@ static void OPM_ScanOptions (CHAR *s, ADDRESS s__len) i += 2; } break; - case 'B': - if (s[__X(i + 1, s__len)] != 0x00) { - i += 1; - OPM_IntegerSize = (INT16)s[__X(i, s__len)] - 48; - } - if (s[__X(i + 1, s__len)] != 0x00) { - i += 1; - OPM_AddressSize = (INT16)s[__X(i, s__len)] - 48; - } - if (s[__X(i + 1, s__len)] != 0x00) { - i += 1; - OPM_Alignment = (INT16)s[__X(i, s__len)] - 48; - } - __ASSERT(OPM_IntegerSize == 2 || OPM_IntegerSize == 4, 0); - __ASSERT(OPM_AddressSize == 4 || OPM_AddressSize == 8, 0); - __ASSERT(OPM_Alignment == 4 || OPM_Alignment == 8, 0); - if (OPM_IntegerSize == 2) { - OPM_LongintSize = 4; - } else { - OPM_LongintSize = 8; - } - Files_SetSearchPath((CHAR*)"", 1); - break; default: OPM_LogWStr((CHAR*)" warning: option ", 19); OPM_LogW('-'); @@ -267,10 +247,6 @@ static void OPM_ScanOptions (CHAR *s, ADDRESS s__len) BOOLEAN OPM_OpenPar (void) { CHAR s[256]; - Out_String((CHAR*)"Testing. Binary directory is: '", 32); - Out_String(Modules_BinaryDir, 1024); - Out_String((CHAR*)"'.", 3); - Out_Ln(); if (Modules_ArgCount == 1) { OPM_LogWLn(); OPM_LogWStr((CHAR*)"Oberon-2 compiler v", 20); @@ -455,7 +431,7 @@ void OPM_InitOptions (void) if (__IN(18, OPM_Options, 32)) { OPM_VerboseListSizes(); } - OPM_ResourceDir[0] = 0x00; + __MOVE(OPM_InstallDir, OPM_ResourceDir, 1024); Strings_Append((CHAR*)"/", 2, (void*)OPM_ResourceDir, 1024); Strings_Append(OPM_Model, 10, (void*)OPM_ResourceDir, 1024); modules[0] = 0x00; @@ -1060,6 +1036,59 @@ void OPM_CloseFiles (void) Files_Set(&OPM_oldSF, Files_Rider__typ, NIL, 0); } +static BOOLEAN OPM_IsProbablyInstallDir (CHAR *s, ADDRESS s__len) +{ + CHAR testpath[1024]; + Platform_FileIdentity identity; + __DUP(s, s__len, CHAR); + __COPY(OPM_InstallDir, testpath, 1024); + Strings_Append((CHAR*)"/lib/lib", 9, (void*)testpath, 1024); + Strings_Append((CHAR*)"voc", 4, (void*)testpath, 1024); + Strings_Append((CHAR*)"-O2.a", 6, (void*)testpath, 1024); + if (Platform_IdentifyByName(testpath, 1024, &identity, Platform_FileIdentity__typ) != 0) { + __DEL(s); + return 0; + } + __COPY(OPM_InstallDir, testpath, 1024); + Strings_Append((CHAR*)"/2/include/Oberon.h", 20, (void*)testpath, 1024); + if (Platform_IdentifyByName(testpath, 1024, &identity, Platform_FileIdentity__typ) != 0) { + __DEL(s); + return 0; + } + __COPY(OPM_InstallDir, testpath, 1024); + Strings_Append((CHAR*)"/2/sym/Files.sym", 17, (void*)testpath, 1024); + if (Platform_IdentifyByName(testpath, 1024, &identity, Platform_FileIdentity__typ) != 0) { + __DEL(s); + return 0; + } + __DEL(s); + return 1; +} + +static void OPM_FindInstallDir (void) +{ + INT16 i; + __COPY(Modules_BinaryDir, OPM_InstallDir, 1024); + Strings_Append((CHAR*)"/", 2, (void*)OPM_InstallDir, 1024); + Strings_Append((CHAR*)"voc", 4, (void*)OPM_InstallDir, 1024); + Strings_Append((CHAR*)".d", 3, (void*)OPM_InstallDir, 1024); + if (OPM_IsProbablyInstallDir(OPM_InstallDir, 1024)) { + return; + } + __COPY(Modules_BinaryDir, OPM_InstallDir, 1024); + i = Strings_Length(OPM_InstallDir, 1024); + while ((i > 0 && OPM_InstallDir[__X(i - 1, 1024)] != '/')) { + i -= 1; + } + if ((i > 0 && OPM_InstallDir[__X(i - 1, 1024)] == '/')) { + OPM_InstallDir[__X(i - 1, 1024)] = 0x00; + if (OPM_IsProbablyInstallDir(OPM_InstallDir, 1024)) { + return; + } + } + __COPY("", OPM_InstallDir, 1024); +} + static void EnumPtrs(void (*P)(void*)) { __ENUMR(&OPM_inR, Texts_Reader__typ, 48, 1, P); @@ -1100,5 +1129,6 @@ export void *OPM__init(void) OPM_MaxLReal = 1.79769296342094e+308; OPM_MinReal = -OPM_MaxReal; OPM_MinLReal = -OPM_MaxLReal; + OPM_FindInstallDir(); __ENDMOD; } diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index ec6947a6..4d6101bb 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h @@ -17,6 +17,7 @@ import INT32 OPM_curpos, OPM_errpos, OPM_breakpc; import INT16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; import CHAR OPM_modName[32]; import CHAR OPM_objname[64]; +import CHAR OPM_InstallDir[1024]; import CHAR OPM_ResourceDir[1024]; diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index e6d8b614..561e1feb 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index da746402..a88a16ee 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index 2c97a4d0..0918b14d 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index 0b780918..08db3b29 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 719dab04..78acd9c1 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index 0a26e546..e3f23baf 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index 950e0e36..7d93389c 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index 1afcee74..c1eb098f 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Out.c b/bootstrap/unix-48/Out.c index 2558adfa..ab37e758 100644 --- a/bootstrap/unix-48/Out.c +++ b/bootstrap/unix-48/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Out.h b/bootstrap/unix-48/Out.h index 62f9d414..1cac588c 100644 --- a/bootstrap/unix-48/Out.h +++ b/bootstrap/unix-48/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 2de4df02..89286d2c 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index 798f6253..69667994 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 8668f3be..fde141c5 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index a864fcae..1576c7ee 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index 697accbd..c4d2419d 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index 30317939..471c85c8 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index 0ccbbbd1..762fce4d 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index ceb5355e..b900b772 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/VT100.c b/bootstrap/unix-48/VT100.c index ea43623a..b446063e 100644 --- a/bootstrap/unix-48/VT100.c +++ b/bootstrap/unix-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/VT100.h b/bootstrap/unix-48/VT100.h index 70c0dfa9..0fd1e5d3 100644 --- a/bootstrap/unix-48/VT100.h +++ b/bootstrap/unix-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index f08daa40..858c9514 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index e736dc46..724db7ae 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/Compiler.c b/bootstrap/unix-88/Compiler.c index 4eac6b2e..ed567be7 100644 --- a/bootstrap/unix-88/Compiler.c +++ b/bootstrap/unix-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index c7d8b4a8..8f8e5783 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index 38963a37..8a2a656b 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 161a30a4..f7d08102 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 52d281d9..8a41c280 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index 34ef3786..3566f3c0 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index 648265c8..99c63bea 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 01e9bcbd..6dfb1d86 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index 6cad66e4..bbb36879 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index 0b1509bc..792e292b 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index d6b81543..fb07f6b2 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index 620dd88e..49ddd0ab 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index 20ac9ae8..b0142b20 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 39f36504..7eb94291 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -42,6 +42,7 @@ static Files_Rider OPM_oldSF, OPM_newSF; static Files_Rider OPM_R[3]; static Files_File OPM_oldSFile, OPM_newSFile, OPM_HFile, OPM_BFile, OPM_HIFile; static INT16 OPM_S; +export CHAR OPM_InstallDir[1024]; export CHAR OPM_ResourceDir[1024]; @@ -53,12 +54,14 @@ export void OPM_FPrint (INT32 *fp, INT64 val); export void OPM_FPrintLReal (INT32 *fp, LONGREAL val); export void OPM_FPrintReal (INT32 *fp, REAL val); export void OPM_FPrintSet (INT32 *fp, UINT64 val); +static void OPM_FindInstallDir (void); static void OPM_FindLine (Files_File f, Files_Rider *r, ADDRESS *r__typ, INT64 pos); static void OPM_FingerprintBytes (INT32 *fp, SYSTEM_BYTE *bytes, ADDRESS bytes__len); export void OPM_Get (CHAR *ch); export void OPM_Init (BOOLEAN *done, CHAR *mname, ADDRESS mname__len); export void OPM_InitOptions (void); export INT16 OPM_Integer (INT64 n); +static BOOLEAN OPM_IsProbablyInstallDir (CHAR *s, ADDRESS s__len); static void OPM_LogErrMsg (INT16 n); export void OPM_LogVT100 (CHAR *vt100code, ADDRESS vt100code__len); export void OPM_LogW (CHAR ch); @@ -228,29 +231,6 @@ static void OPM_ScanOptions (CHAR *s, ADDRESS s__len) i += 2; } break; - case 'B': - if (s[__X(i + 1, s__len)] != 0x00) { - i += 1; - OPM_IntegerSize = (INT16)s[__X(i, s__len)] - 48; - } - if (s[__X(i + 1, s__len)] != 0x00) { - i += 1; - OPM_AddressSize = (INT16)s[__X(i, s__len)] - 48; - } - if (s[__X(i + 1, s__len)] != 0x00) { - i += 1; - OPM_Alignment = (INT16)s[__X(i, s__len)] - 48; - } - __ASSERT(OPM_IntegerSize == 2 || OPM_IntegerSize == 4, 0); - __ASSERT(OPM_AddressSize == 4 || OPM_AddressSize == 8, 0); - __ASSERT(OPM_Alignment == 4 || OPM_Alignment == 8, 0); - if (OPM_IntegerSize == 2) { - OPM_LongintSize = 4; - } else { - OPM_LongintSize = 8; - } - Files_SetSearchPath((CHAR*)"", 1); - break; default: OPM_LogWStr((CHAR*)" warning: option ", 19); OPM_LogW('-'); @@ -267,10 +247,6 @@ static void OPM_ScanOptions (CHAR *s, ADDRESS s__len) BOOLEAN OPM_OpenPar (void) { CHAR s[256]; - Out_String((CHAR*)"Testing. Binary directory is: '", 32); - Out_String(Modules_BinaryDir, 1024); - Out_String((CHAR*)"'.", 3); - Out_Ln(); if (Modules_ArgCount == 1) { OPM_LogWLn(); OPM_LogWStr((CHAR*)"Oberon-2 compiler v", 20); @@ -455,7 +431,7 @@ void OPM_InitOptions (void) if (__IN(18, OPM_Options, 32)) { OPM_VerboseListSizes(); } - OPM_ResourceDir[0] = 0x00; + __MOVE(OPM_InstallDir, OPM_ResourceDir, 1024); Strings_Append((CHAR*)"/", 2, (void*)OPM_ResourceDir, 1024); Strings_Append(OPM_Model, 10, (void*)OPM_ResourceDir, 1024); modules[0] = 0x00; @@ -1060,6 +1036,59 @@ void OPM_CloseFiles (void) Files_Set(&OPM_oldSF, Files_Rider__typ, NIL, 0); } +static BOOLEAN OPM_IsProbablyInstallDir (CHAR *s, ADDRESS s__len) +{ + CHAR testpath[1024]; + Platform_FileIdentity identity; + __DUP(s, s__len, CHAR); + __COPY(OPM_InstallDir, testpath, 1024); + Strings_Append((CHAR*)"/lib/lib", 9, (void*)testpath, 1024); + Strings_Append((CHAR*)"voc", 4, (void*)testpath, 1024); + Strings_Append((CHAR*)"-O2.a", 6, (void*)testpath, 1024); + if (Platform_IdentifyByName(testpath, 1024, &identity, Platform_FileIdentity__typ) != 0) { + __DEL(s); + return 0; + } + __COPY(OPM_InstallDir, testpath, 1024); + Strings_Append((CHAR*)"/2/include/Oberon.h", 20, (void*)testpath, 1024); + if (Platform_IdentifyByName(testpath, 1024, &identity, Platform_FileIdentity__typ) != 0) { + __DEL(s); + return 0; + } + __COPY(OPM_InstallDir, testpath, 1024); + Strings_Append((CHAR*)"/2/sym/Files.sym", 17, (void*)testpath, 1024); + if (Platform_IdentifyByName(testpath, 1024, &identity, Platform_FileIdentity__typ) != 0) { + __DEL(s); + return 0; + } + __DEL(s); + return 1; +} + +static void OPM_FindInstallDir (void) +{ + INT16 i; + __COPY(Modules_BinaryDir, OPM_InstallDir, 1024); + Strings_Append((CHAR*)"/", 2, (void*)OPM_InstallDir, 1024); + Strings_Append((CHAR*)"voc", 4, (void*)OPM_InstallDir, 1024); + Strings_Append((CHAR*)".d", 3, (void*)OPM_InstallDir, 1024); + if (OPM_IsProbablyInstallDir(OPM_InstallDir, 1024)) { + return; + } + __COPY(Modules_BinaryDir, OPM_InstallDir, 1024); + i = Strings_Length(OPM_InstallDir, 1024); + while ((i > 0 && OPM_InstallDir[__X(i - 1, 1024)] != '/')) { + i -= 1; + } + if ((i > 0 && OPM_InstallDir[__X(i - 1, 1024)] == '/')) { + OPM_InstallDir[__X(i - 1, 1024)] = 0x00; + if (OPM_IsProbablyInstallDir(OPM_InstallDir, 1024)) { + return; + } + } + __COPY("", OPM_InstallDir, 1024); +} + static void EnumPtrs(void (*P)(void*)) { __ENUMR(&OPM_inR, Texts_Reader__typ, 72, 1, P); @@ -1100,5 +1129,6 @@ export void *OPM__init(void) OPM_MaxLReal = 1.79769296342094e+308; OPM_MinReal = -OPM_MaxReal; OPM_MinLReal = -OPM_MaxLReal; + OPM_FindInstallDir(); __ENDMOD; } diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index ec6947a6..4d6101bb 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h @@ -17,6 +17,7 @@ import INT32 OPM_curpos, OPM_errpos, OPM_breakpc; import INT16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; import CHAR OPM_modName[32]; import CHAR OPM_objname[64]; +import CHAR OPM_InstallDir[1024]; import CHAR OPM_ResourceDir[1024]; diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index 34d1f0e4..e3ffa285 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index da746402..a88a16ee 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index 2c97a4d0..0918b14d 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index 0b780918..08db3b29 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index 63667f88..eb19830e 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 0a26e546..e3f23baf 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 5520370e..c8d92d32 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index 1afcee74..c1eb098f 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Out.c b/bootstrap/unix-88/Out.c index 2558adfa..ab37e758 100644 --- a/bootstrap/unix-88/Out.c +++ b/bootstrap/unix-88/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Out.h b/bootstrap/unix-88/Out.h index 62f9d414..1cac588c 100644 --- a/bootstrap/unix-88/Out.h +++ b/bootstrap/unix-88/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index e1be57b0..f04609c5 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index 37d890d8..a57b5dc4 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 8668f3be..fde141c5 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index a864fcae..1576c7ee 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index 697accbd..c4d2419d 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index 30317939..471c85c8 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index 9a2c7cb4..bad01c09 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index def1eeef..fbc12082 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/VT100.c b/bootstrap/unix-88/VT100.c index ea43623a..b446063e 100644 --- a/bootstrap/unix-88/VT100.c +++ b/bootstrap/unix-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/VT100.h b/bootstrap/unix-88/VT100.h index 70c0dfa9..0fd1e5d3 100644 --- a/bootstrap/unix-88/VT100.h +++ b/bootstrap/unix-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index f08daa40..858c9514 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index e736dc46..724db7ae 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/Compiler.c b/bootstrap/windows-48/Compiler.c index 4eac6b2e..ed567be7 100644 --- a/bootstrap/windows-48/Compiler.c +++ b/bootstrap/windows-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index c7d8b4a8..8f8e5783 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index 38963a37..8a2a656b 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 8d916fc1..d7434dbd 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index dafb5071..36208e21 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index 752ece9b..e6ac7523 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index 0126c839..a4b879fe 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index e83c0383..648dde85 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index e114cae2..445d1eae 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index 0b1509bc..792e292b 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index d6b81543..fb07f6b2 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 620dd88e..49ddd0ab 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index 20ac9ae8..b0142b20 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 330d8fde..94394339 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -42,6 +42,7 @@ static Files_Rider OPM_oldSF, OPM_newSF; static Files_Rider OPM_R[3]; static Files_File OPM_oldSFile, OPM_newSFile, OPM_HFile, OPM_BFile, OPM_HIFile; static INT16 OPM_S; +export CHAR OPM_InstallDir[1024]; export CHAR OPM_ResourceDir[1024]; @@ -53,12 +54,14 @@ export void OPM_FPrint (INT32 *fp, INT64 val); export void OPM_FPrintLReal (INT32 *fp, LONGREAL val); export void OPM_FPrintReal (INT32 *fp, REAL val); export void OPM_FPrintSet (INT32 *fp, UINT64 val); +static void OPM_FindInstallDir (void); static void OPM_FindLine (Files_File f, Files_Rider *r, ADDRESS *r__typ, INT64 pos); static void OPM_FingerprintBytes (INT32 *fp, SYSTEM_BYTE *bytes, ADDRESS bytes__len); export void OPM_Get (CHAR *ch); export void OPM_Init (BOOLEAN *done, CHAR *mname, ADDRESS mname__len); export void OPM_InitOptions (void); export INT16 OPM_Integer (INT64 n); +static BOOLEAN OPM_IsProbablyInstallDir (CHAR *s, ADDRESS s__len); static void OPM_LogErrMsg (INT16 n); export void OPM_LogVT100 (CHAR *vt100code, ADDRESS vt100code__len); export void OPM_LogW (CHAR ch); @@ -228,29 +231,6 @@ static void OPM_ScanOptions (CHAR *s, ADDRESS s__len) i += 2; } break; - case 'B': - if (s[__X(i + 1, s__len)] != 0x00) { - i += 1; - OPM_IntegerSize = (INT16)s[__X(i, s__len)] - 48; - } - if (s[__X(i + 1, s__len)] != 0x00) { - i += 1; - OPM_AddressSize = (INT16)s[__X(i, s__len)] - 48; - } - if (s[__X(i + 1, s__len)] != 0x00) { - i += 1; - OPM_Alignment = (INT16)s[__X(i, s__len)] - 48; - } - __ASSERT(OPM_IntegerSize == 2 || OPM_IntegerSize == 4, 0); - __ASSERT(OPM_AddressSize == 4 || OPM_AddressSize == 8, 0); - __ASSERT(OPM_Alignment == 4 || OPM_Alignment == 8, 0); - if (OPM_IntegerSize == 2) { - OPM_LongintSize = 4; - } else { - OPM_LongintSize = 8; - } - Files_SetSearchPath((CHAR*)"", 1); - break; default: OPM_LogWStr((CHAR*)" warning: option ", 19); OPM_LogW('-'); @@ -267,10 +247,6 @@ static void OPM_ScanOptions (CHAR *s, ADDRESS s__len) BOOLEAN OPM_OpenPar (void) { CHAR s[256]; - Out_String((CHAR*)"Testing. Binary directory is: '", 32); - Out_String(Modules_BinaryDir, 1024); - Out_String((CHAR*)"'.", 3); - Out_Ln(); if (Modules_ArgCount == 1) { OPM_LogWLn(); OPM_LogWStr((CHAR*)"Oberon-2 compiler v", 20); @@ -455,7 +431,7 @@ void OPM_InitOptions (void) if (__IN(18, OPM_Options, 32)) { OPM_VerboseListSizes(); } - OPM_ResourceDir[0] = 0x00; + __MOVE(OPM_InstallDir, OPM_ResourceDir, 1024); Strings_Append((CHAR*)"/", 2, (void*)OPM_ResourceDir, 1024); Strings_Append(OPM_Model, 10, (void*)OPM_ResourceDir, 1024); modules[0] = 0x00; @@ -1060,6 +1036,59 @@ void OPM_CloseFiles (void) Files_Set(&OPM_oldSF, Files_Rider__typ, NIL, 0); } +static BOOLEAN OPM_IsProbablyInstallDir (CHAR *s, ADDRESS s__len) +{ + CHAR testpath[1024]; + Platform_FileIdentity identity; + __DUP(s, s__len, CHAR); + __COPY(OPM_InstallDir, testpath, 1024); + Strings_Append((CHAR*)"/lib/lib", 9, (void*)testpath, 1024); + Strings_Append((CHAR*)"voc", 4, (void*)testpath, 1024); + Strings_Append((CHAR*)"-O2.a", 6, (void*)testpath, 1024); + if (Platform_IdentifyByName(testpath, 1024, &identity, Platform_FileIdentity__typ) != 0) { + __DEL(s); + return 0; + } + __COPY(OPM_InstallDir, testpath, 1024); + Strings_Append((CHAR*)"/2/include/Oberon.h", 20, (void*)testpath, 1024); + if (Platform_IdentifyByName(testpath, 1024, &identity, Platform_FileIdentity__typ) != 0) { + __DEL(s); + return 0; + } + __COPY(OPM_InstallDir, testpath, 1024); + Strings_Append((CHAR*)"/2/sym/Files.sym", 17, (void*)testpath, 1024); + if (Platform_IdentifyByName(testpath, 1024, &identity, Platform_FileIdentity__typ) != 0) { + __DEL(s); + return 0; + } + __DEL(s); + return 1; +} + +static void OPM_FindInstallDir (void) +{ + INT16 i; + __COPY(Modules_BinaryDir, OPM_InstallDir, 1024); + Strings_Append((CHAR*)"/", 2, (void*)OPM_InstallDir, 1024); + Strings_Append((CHAR*)"voc", 4, (void*)OPM_InstallDir, 1024); + Strings_Append((CHAR*)".d", 3, (void*)OPM_InstallDir, 1024); + if (OPM_IsProbablyInstallDir(OPM_InstallDir, 1024)) { + return; + } + __COPY(Modules_BinaryDir, OPM_InstallDir, 1024); + i = Strings_Length(OPM_InstallDir, 1024); + while ((i > 0 && OPM_InstallDir[__X(i - 1, 1024)] != '/')) { + i -= 1; + } + if ((i > 0 && OPM_InstallDir[__X(i - 1, 1024)] == '/')) { + OPM_InstallDir[__X(i - 1, 1024)] = 0x00; + if (OPM_IsProbablyInstallDir(OPM_InstallDir, 1024)) { + return; + } + } + __COPY("", OPM_InstallDir, 1024); +} + static void EnumPtrs(void (*P)(void*)) { __ENUMR(&OPM_inR, Texts_Reader__typ, 48, 1, P); @@ -1100,5 +1129,6 @@ export void *OPM__init(void) OPM_MaxLReal = 1.79769296342094e+308; OPM_MinReal = -OPM_MaxReal; OPM_MinLReal = -OPM_MaxLReal; + OPM_FindInstallDir(); __ENDMOD; } diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index ec6947a6..4d6101bb 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h @@ -17,6 +17,7 @@ import INT32 OPM_curpos, OPM_errpos, OPM_breakpc; import INT16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; import CHAR OPM_modName[32]; import CHAR OPM_objname[64]; +import CHAR OPM_InstallDir[1024]; import CHAR OPM_ResourceDir[1024]; diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index e6d8b614..561e1feb 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index da746402..a88a16ee 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index 2c97a4d0..0918b14d 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index 0b780918..08db3b29 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 719dab04..78acd9c1 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index 0a26e546..e3f23baf 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index 950e0e36..7d93389c 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index 1afcee74..c1eb098f 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Out.c b/bootstrap/windows-48/Out.c index d1ff2558..8c0292d1 100644 --- a/bootstrap/windows-48/Out.c +++ b/bootstrap/windows-48/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Out.h b/bootstrap/windows-48/Out.h index 62f9d414..1cac588c 100644 --- a/bootstrap/windows-48/Out.h +++ b/bootstrap/windows-48/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 4a1e30b8..6604baf0 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index a1fad287..1bdda6f9 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 8668f3be..fde141c5 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index a864fcae..1576c7ee 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index 697accbd..c4d2419d 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index 30317939..471c85c8 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index 0ccbbbd1..762fce4d 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index ceb5355e..b900b772 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/VT100.c b/bootstrap/windows-48/VT100.c index ea43623a..b446063e 100644 --- a/bootstrap/windows-48/VT100.c +++ b/bootstrap/windows-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/VT100.h b/bootstrap/windows-48/VT100.h index 70c0dfa9..0fd1e5d3 100644 --- a/bootstrap/windows-48/VT100.h +++ b/bootstrap/windows-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index f08daa40..858c9514 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index e736dc46..724db7ae 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/Compiler.c b/bootstrap/windows-88/Compiler.c index 4eac6b2e..ed567be7 100644 --- a/bootstrap/windows-88/Compiler.c +++ b/bootstrap/windows-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index c7d8b4a8..8f8e5783 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index 38963a37..8a2a656b 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index da080e3e..b104d085 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 969643b0..95736721 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index 34ef3786..3566f3c0 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index 648265c8..99c63bea 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 9d8d2534..ce1297f7 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index 6cad66e4..bbb36879 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index 0b1509bc..792e292b 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index d6b81543..fb07f6b2 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index 620dd88e..49ddd0ab 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index 20ac9ae8..b0142b20 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 39f36504..7eb94291 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -42,6 +42,7 @@ static Files_Rider OPM_oldSF, OPM_newSF; static Files_Rider OPM_R[3]; static Files_File OPM_oldSFile, OPM_newSFile, OPM_HFile, OPM_BFile, OPM_HIFile; static INT16 OPM_S; +export CHAR OPM_InstallDir[1024]; export CHAR OPM_ResourceDir[1024]; @@ -53,12 +54,14 @@ export void OPM_FPrint (INT32 *fp, INT64 val); export void OPM_FPrintLReal (INT32 *fp, LONGREAL val); export void OPM_FPrintReal (INT32 *fp, REAL val); export void OPM_FPrintSet (INT32 *fp, UINT64 val); +static void OPM_FindInstallDir (void); static void OPM_FindLine (Files_File f, Files_Rider *r, ADDRESS *r__typ, INT64 pos); static void OPM_FingerprintBytes (INT32 *fp, SYSTEM_BYTE *bytes, ADDRESS bytes__len); export void OPM_Get (CHAR *ch); export void OPM_Init (BOOLEAN *done, CHAR *mname, ADDRESS mname__len); export void OPM_InitOptions (void); export INT16 OPM_Integer (INT64 n); +static BOOLEAN OPM_IsProbablyInstallDir (CHAR *s, ADDRESS s__len); static void OPM_LogErrMsg (INT16 n); export void OPM_LogVT100 (CHAR *vt100code, ADDRESS vt100code__len); export void OPM_LogW (CHAR ch); @@ -228,29 +231,6 @@ static void OPM_ScanOptions (CHAR *s, ADDRESS s__len) i += 2; } break; - case 'B': - if (s[__X(i + 1, s__len)] != 0x00) { - i += 1; - OPM_IntegerSize = (INT16)s[__X(i, s__len)] - 48; - } - if (s[__X(i + 1, s__len)] != 0x00) { - i += 1; - OPM_AddressSize = (INT16)s[__X(i, s__len)] - 48; - } - if (s[__X(i + 1, s__len)] != 0x00) { - i += 1; - OPM_Alignment = (INT16)s[__X(i, s__len)] - 48; - } - __ASSERT(OPM_IntegerSize == 2 || OPM_IntegerSize == 4, 0); - __ASSERT(OPM_AddressSize == 4 || OPM_AddressSize == 8, 0); - __ASSERT(OPM_Alignment == 4 || OPM_Alignment == 8, 0); - if (OPM_IntegerSize == 2) { - OPM_LongintSize = 4; - } else { - OPM_LongintSize = 8; - } - Files_SetSearchPath((CHAR*)"", 1); - break; default: OPM_LogWStr((CHAR*)" warning: option ", 19); OPM_LogW('-'); @@ -267,10 +247,6 @@ static void OPM_ScanOptions (CHAR *s, ADDRESS s__len) BOOLEAN OPM_OpenPar (void) { CHAR s[256]; - Out_String((CHAR*)"Testing. Binary directory is: '", 32); - Out_String(Modules_BinaryDir, 1024); - Out_String((CHAR*)"'.", 3); - Out_Ln(); if (Modules_ArgCount == 1) { OPM_LogWLn(); OPM_LogWStr((CHAR*)"Oberon-2 compiler v", 20); @@ -455,7 +431,7 @@ void OPM_InitOptions (void) if (__IN(18, OPM_Options, 32)) { OPM_VerboseListSizes(); } - OPM_ResourceDir[0] = 0x00; + __MOVE(OPM_InstallDir, OPM_ResourceDir, 1024); Strings_Append((CHAR*)"/", 2, (void*)OPM_ResourceDir, 1024); Strings_Append(OPM_Model, 10, (void*)OPM_ResourceDir, 1024); modules[0] = 0x00; @@ -1060,6 +1036,59 @@ void OPM_CloseFiles (void) Files_Set(&OPM_oldSF, Files_Rider__typ, NIL, 0); } +static BOOLEAN OPM_IsProbablyInstallDir (CHAR *s, ADDRESS s__len) +{ + CHAR testpath[1024]; + Platform_FileIdentity identity; + __DUP(s, s__len, CHAR); + __COPY(OPM_InstallDir, testpath, 1024); + Strings_Append((CHAR*)"/lib/lib", 9, (void*)testpath, 1024); + Strings_Append((CHAR*)"voc", 4, (void*)testpath, 1024); + Strings_Append((CHAR*)"-O2.a", 6, (void*)testpath, 1024); + if (Platform_IdentifyByName(testpath, 1024, &identity, Platform_FileIdentity__typ) != 0) { + __DEL(s); + return 0; + } + __COPY(OPM_InstallDir, testpath, 1024); + Strings_Append((CHAR*)"/2/include/Oberon.h", 20, (void*)testpath, 1024); + if (Platform_IdentifyByName(testpath, 1024, &identity, Platform_FileIdentity__typ) != 0) { + __DEL(s); + return 0; + } + __COPY(OPM_InstallDir, testpath, 1024); + Strings_Append((CHAR*)"/2/sym/Files.sym", 17, (void*)testpath, 1024); + if (Platform_IdentifyByName(testpath, 1024, &identity, Platform_FileIdentity__typ) != 0) { + __DEL(s); + return 0; + } + __DEL(s); + return 1; +} + +static void OPM_FindInstallDir (void) +{ + INT16 i; + __COPY(Modules_BinaryDir, OPM_InstallDir, 1024); + Strings_Append((CHAR*)"/", 2, (void*)OPM_InstallDir, 1024); + Strings_Append((CHAR*)"voc", 4, (void*)OPM_InstallDir, 1024); + Strings_Append((CHAR*)".d", 3, (void*)OPM_InstallDir, 1024); + if (OPM_IsProbablyInstallDir(OPM_InstallDir, 1024)) { + return; + } + __COPY(Modules_BinaryDir, OPM_InstallDir, 1024); + i = Strings_Length(OPM_InstallDir, 1024); + while ((i > 0 && OPM_InstallDir[__X(i - 1, 1024)] != '/')) { + i -= 1; + } + if ((i > 0 && OPM_InstallDir[__X(i - 1, 1024)] == '/')) { + OPM_InstallDir[__X(i - 1, 1024)] = 0x00; + if (OPM_IsProbablyInstallDir(OPM_InstallDir, 1024)) { + return; + } + } + __COPY("", OPM_InstallDir, 1024); +} + static void EnumPtrs(void (*P)(void*)) { __ENUMR(&OPM_inR, Texts_Reader__typ, 72, 1, P); @@ -1100,5 +1129,6 @@ export void *OPM__init(void) OPM_MaxLReal = 1.79769296342094e+308; OPM_MinReal = -OPM_MaxReal; OPM_MinLReal = -OPM_MaxLReal; + OPM_FindInstallDir(); __ENDMOD; } diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index ec6947a6..4d6101bb 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h @@ -17,6 +17,7 @@ import INT32 OPM_curpos, OPM_errpos, OPM_breakpc; import INT16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; import CHAR OPM_modName[32]; import CHAR OPM_objname[64]; +import CHAR OPM_InstallDir[1024]; import CHAR OPM_ResourceDir[1024]; diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index 34d1f0e4..e3ffa285 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index da746402..a88a16ee 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index 2c97a4d0..0918b14d 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index 0b780918..08db3b29 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index 63667f88..eb19830e 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 0a26e546..e3f23baf 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 5520370e..c8d92d32 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index 1afcee74..c1eb098f 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Out.c b/bootstrap/windows-88/Out.c index d1ff2558..8c0292d1 100644 --- a/bootstrap/windows-88/Out.c +++ b/bootstrap/windows-88/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Out.h b/bootstrap/windows-88/Out.h index 62f9d414..1cac588c 100644 --- a/bootstrap/windows-88/Out.h +++ b/bootstrap/windows-88/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index be0400e8..b725c6a2 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index 6926740d..ef931d99 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 8668f3be..fde141c5 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index a864fcae..1576c7ee 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index 697accbd..c4d2419d 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index 30317939..471c85c8 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index 9a2c7cb4..bad01c09 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index def1eeef..fbc12082 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/VT100.c b/bootstrap/windows-88/VT100.c index ea43623a..b446063e 100644 --- a/bootstrap/windows-88/VT100.c +++ b/bootstrap/windows-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/VT100.h b/bootstrap/windows-88/VT100.h index 70c0dfa9..0fd1e5d3 100644 --- a/bootstrap/windows-88/VT100.h +++ b/bootstrap/windows-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index f08daa40..858c9514 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index e736dc46..724db7ae 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/src/compiler/OPM.Mod b/src/compiler/OPM.Mod index 6cf7dcfc..2abce2c9 100644 --- a/src/compiler/OPM.Mod +++ b/src/compiler/OPM.Mod @@ -767,6 +767,8 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) END CloseFiles; +(* === Installation directory discovery === *) + PROCEDURE IsProbablyInstallDir(s: ARRAY OF CHAR): BOOLEAN; VAR testpath: ARRAY 1024 OF CHAR; identity: Platform.FileIdentity; BEGIN @@ -790,11 +792,11 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) PROCEDURE FindInstallDir; VAR i: INTEGER; BEGIN - (* First try location of binary (with -parts appended) *) + (* First try location of binary (with .d appended) *) COPY(Modules.BinaryDir, InstallDir); Strings.Append("/", InstallDir); Strings.Append(Configuration.name, InstallDir); - Strings.Append("-parts", InstallDir); + Strings.Append(".d", InstallDir); IF IsProbablyInstallDir(InstallDir) THEN RETURN END; (* Now test whether binary is in bin directory under install dir. *) From cf2da3000fbca8df3603b2836e10fe9131011d30 Mon Sep 17 00:00:00 2001 From: David Brown Date: Mon, 5 Dec 2016 17:00:55 +0000 Subject: [PATCH 371/580] Record curpos on every inR.Read. Add more debug to catch OpenBSD read failure. --- bootstrap/unix-44/OPM.c | 10 ++++++---- bootstrap/unix-48/OPM.c | 10 ++++++---- bootstrap/unix-88/OPM.c | 10 ++++++---- bootstrap/windows-48/OPM.c | 10 ++++++---- bootstrap/windows-88/OPM.c | 10 ++++++---- src/compiler/OPM.Mod | 15 ++++++++++----- src/runtime/Texts.Mod | 2 +- src/test/confidence/intsyntax/expected | 12 ++++++------ 8 files changed, 47 insertions(+), 32 deletions(-) diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 94394339..04afccfa 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -484,11 +484,13 @@ void OPM_Init (BOOLEAN *done, CHAR *mname, ADDRESS mname__len) void OPM_Get (CHAR *ch) { + OPM_curpos = Texts_Pos(&OPM_inR, Texts_Reader__typ); Texts_Read(&OPM_inR, Texts_Reader__typ, &*ch); - if (*ch == 0x0d) { - OPM_curpos = Texts_Pos(&OPM_inR, Texts_Reader__typ); - } else { - OPM_curpos += 1; + if ((OPM_curpos == 0 && OPM_inR.eot)) { + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"DEBUG: OPM.Get returned inR.eot at curpos = 0, ch = ", 53); + OPM_LogWNum((INT16)*ch, 1); + OPM_LogW('.'); } if ((*ch < 0x09 && !OPM_inR.eot)) { *ch = ' '; diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 94394339..04afccfa 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -484,11 +484,13 @@ void OPM_Init (BOOLEAN *done, CHAR *mname, ADDRESS mname__len) void OPM_Get (CHAR *ch) { + OPM_curpos = Texts_Pos(&OPM_inR, Texts_Reader__typ); Texts_Read(&OPM_inR, Texts_Reader__typ, &*ch); - if (*ch == 0x0d) { - OPM_curpos = Texts_Pos(&OPM_inR, Texts_Reader__typ); - } else { - OPM_curpos += 1; + if ((OPM_curpos == 0 && OPM_inR.eot)) { + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"DEBUG: OPM.Get returned inR.eot at curpos = 0, ch = ", 53); + OPM_LogWNum((INT16)*ch, 1); + OPM_LogW('.'); } if ((*ch < 0x09 && !OPM_inR.eot)) { *ch = ' '; diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 7eb94291..a7014a53 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -484,11 +484,13 @@ void OPM_Init (BOOLEAN *done, CHAR *mname, ADDRESS mname__len) void OPM_Get (CHAR *ch) { + OPM_curpos = Texts_Pos(&OPM_inR, Texts_Reader__typ); Texts_Read(&OPM_inR, Texts_Reader__typ, &*ch); - if (*ch == 0x0d) { - OPM_curpos = Texts_Pos(&OPM_inR, Texts_Reader__typ); - } else { - OPM_curpos += 1; + if ((OPM_curpos == 0 && OPM_inR.eot)) { + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"DEBUG: OPM.Get returned inR.eot at curpos = 0, ch = ", 53); + OPM_LogWNum((INT16)*ch, 1); + OPM_LogW('.'); } if ((*ch < 0x09 && !OPM_inR.eot)) { *ch = ' '; diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 94394339..04afccfa 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -484,11 +484,13 @@ void OPM_Init (BOOLEAN *done, CHAR *mname, ADDRESS mname__len) void OPM_Get (CHAR *ch) { + OPM_curpos = Texts_Pos(&OPM_inR, Texts_Reader__typ); Texts_Read(&OPM_inR, Texts_Reader__typ, &*ch); - if (*ch == 0x0d) { - OPM_curpos = Texts_Pos(&OPM_inR, Texts_Reader__typ); - } else { - OPM_curpos += 1; + if ((OPM_curpos == 0 && OPM_inR.eot)) { + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"DEBUG: OPM.Get returned inR.eot at curpos = 0, ch = ", 53); + OPM_LogWNum((INT16)*ch, 1); + OPM_LogW('.'); } if ((*ch < 0x09 && !OPM_inR.eot)) { *ch = ' '; diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 7eb94291..a7014a53 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -484,11 +484,13 @@ void OPM_Init (BOOLEAN *done, CHAR *mname, ADDRESS mname__len) void OPM_Get (CHAR *ch) { + OPM_curpos = Texts_Pos(&OPM_inR, Texts_Reader__typ); Texts_Read(&OPM_inR, Texts_Reader__typ, &*ch); - if (*ch == 0x0d) { - OPM_curpos = Texts_Pos(&OPM_inR, Texts_Reader__typ); - } else { - OPM_curpos += 1; + if ((OPM_curpos == 0 && OPM_inR.eot)) { + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"DEBUG: OPM.Get returned inR.eot at curpos = 0, ch = ", 53); + OPM_LogWNum((INT16)*ch, 1); + OPM_LogW('.'); } if ((*ch < 0x09 && !OPM_inR.eot)) { *ch = ' '; diff --git a/src/compiler/OPM.Mod b/src/compiler/OPM.Mod index 2abce2c9..de100717 100644 --- a/src/compiler/OPM.Mod +++ b/src/compiler/OPM.Mod @@ -387,12 +387,17 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) PROCEDURE Get*(VAR ch: CHAR); (* read next character from source text, 0X if eof *) BEGIN + curpos := Texts.Pos(inR); Texts.Read(inR, ch); - IF ch = 0DX THEN - curpos := Texts.Pos(inR); (* supports CR LF mapping *) - ELSE - INC(curpos) - END ; + + (* OpenBSD intermittent file read error debugging. *) + IF (curpos = 0) & inR.eot THEN + LogWLn; LogWStr("DEBUG: OPM.Get returned inR.eot at curpos = 0, ch = "); + LogWNum(ORD(ch),1); LogW("."); + END; + (* TODO, remove curpos var, and provide fn returning Texts.Pos(inR) - 1. *) + (* Or, better still, record symbol position in OPS. *) + IF (ch < 09X) & ~inR.eot THEN ch := " " END END Get; diff --git a/src/runtime/Texts.Mod b/src/runtime/Texts.Mod index 305b225d..f20750d9 100644 --- a/src/runtime/Texts.Mod +++ b/src/runtime/Texts.Mod @@ -341,7 +341,7 @@ MODULE Texts; (** CAS/HM 23.9.93 -- interface based on Texts by JG/NW 6.12.91** IF (ch = 0AX) & u(Piece).ascii THEN ch := CR (* << LF to CR *) ELSIF (ch = CR) & u(Piece).ascii THEN (* << CR LF to CR *) pos := Files.Pos(R.rider); Files.Read(R.rider, nextch); - IF nextch = 0AX THEN INC(R.off) ELSE Files.Set(R.rider, u(Piece).file, pos) END + IF nextch = 0AX THEN INC(R.off) ELSE Files.Set(R.rider, u(Piece).file, pos) END END ELSIF u IS Elem THEN ch := ElemChar; R.elem := u(Elem) ELSE ch := 0X; R.elem := NIL; R.eot := TRUE diff --git a/src/test/confidence/intsyntax/expected b/src/test/confidence/intsyntax/expected index 1abe43f9..94e29760 100644 --- a/src/test/confidence/intsyntax/expected +++ b/src/test/confidence/intsyntax/expected @@ -1,15 +1,15 @@ IntSyntax.mod compiling IntSyntax. 14: i := l; (* Bad, INTEGER shorter than LONGINT *) - ^ - pos 341 err 113 incompatible assignment + ^ + pos 340 err 113 incompatible assignment 15: s := l; (* Bad, SHORTINT shorter than LONGINT *) - ^ - pos 393 err 113 incompatible assignment + ^ + pos 392 err 113 incompatible assignment 16: i := l; (* Bad, SHORTINT shorter than INTEGER *) - ^ - pos 446 err 113 incompatible assignment + ^ + pos 445 err 113 incompatible assignment Module compilation failed. From de049dc80c4b2365cf5045509207922c90ffdd75 Mon Sep 17 00:00:00 2001 From: David Brown Date: Mon, 5 Dec 2016 17:23:34 +0000 Subject: [PATCH 372/580] Add OPM_InstallDir to ignored differences between bootstrap and installable builds. --- src/tools/make/ignore | 1 + 1 file changed, 1 insertion(+) diff --git a/src/tools/make/ignore b/src/tools/make/ignore index 42554f00..8985991b 100644 --- a/src/tools/make/ignore +++ b/src/tools/make/ignore @@ -1,6 +1,7 @@ ^/\* voc + Configuration_ OPM_ResourceDir +OPM_InstallDir __MOVE.* cmd, OPM_(IntSize|PointerSize|Alignment) = Strings_Append.+void\*\)(cmd|OPM_OBERON|extTools_comp) From 711283cba5fece0fec3cef164b540e76307925f6 Mon Sep 17 00:00:00 2001 From: norayr Date: Mon, 5 Dec 2016 22:06:10 +0400 Subject: [PATCH 373/580] added type aliasing check and warning. -- noch --- src/compiler/OPP.Mod | 6 ++++++ src/runtime/Errors.Txt | 1 + 2 files changed, 7 insertions(+) diff --git a/src/compiler/OPP.Mod b/src/compiler/OPP.Mod index 826a60e6..06a271b8 100644 --- a/src/compiler/OPP.Mod +++ b/src/compiler/OPP.Mod @@ -922,6 +922,12 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) OPT.Insert(OPS.name, obj); obj^.mode := OPT.Typ; obj^.typ := OPT.undftyp; CheckMark(obj^.vis); IF sym = OPS.eql THEN + IF (obj^.name = "INTEGER") OR (obj^.name = "SHORTINT") OR + (obj^.name = "LONGINT") OR (obj^.name = "HUGEINT") OR + (obj^.name = "LONGREAL") OR (obj^.name = "REAL") OR + (obj^.name = "CHAR") THEN + OPM.Mark(-310, OPM.curpos); (* notice about aliasing of predefined type *) + END; OPS.Get(sym); TypeDecl(obj^.typ, obj^.typ) ELSIF (sym = OPS.becomes) OR (sym = OPS.colon) THEN err(OPS.eql); OPS.Get(sym); TypeDecl(obj^.typ, obj^.typ) diff --git a/src/runtime/Errors.Txt b/src/runtime/Errors.Txt index 5e608945..c9f98339 100644 --- a/src/runtime/Errors.Txt +++ b/src/runtime/Errors.Txt @@ -177,6 +177,7 @@ Compiler Warnings 307 no ELSE symbol after CASE statement sequence may lead to trap 308 SYSTEM.VAL result includes memory past end of source variable; use SYSTEM.GET 309 you should name this parameter type, or else no actual parameter will match +310 aliasing of predefined type Run-time Error Messages -1 assertion failed, cf. SYSTEM_assert From 836e26dd4722d57a9daa8c3c79010b3d2437c8d5 Mon Sep 17 00:00:00 2001 From: norayr Date: Mon, 5 Dec 2016 22:12:10 +0400 Subject: [PATCH 374/580] added TRUE, FALSE, SET to the check. -- noch --- src/compiler/OPP.Mod | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/compiler/OPP.Mod b/src/compiler/OPP.Mod index 06a271b8..33d70a76 100644 --- a/src/compiler/OPP.Mod +++ b/src/compiler/OPP.Mod @@ -922,10 +922,11 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) OPT.Insert(OPS.name, obj); obj^.mode := OPT.Typ; obj^.typ := OPT.undftyp; CheckMark(obj^.vis); IF sym = OPS.eql THEN - IF (obj^.name = "INTEGER") OR (obj^.name = "SHORTINT") OR - (obj^.name = "LONGINT") OR (obj^.name = "HUGEINT") OR - (obj^.name = "LONGREAL") OR (obj^.name = "REAL") OR - (obj^.name = "CHAR") THEN + IF (obj^.name = "INTEGER") OR (obj^.name = "SHORTINT") OR + (obj^.name = "LONGINT") OR (obj^.name = "HUGEINT") OR + (obj^.name = "LONGREAL") OR (obj^.name = "REAL") OR + (obj^.name = "CHAR") OR (obj^.name = "SET") OR + (obj^.name = "TRUE") OR (obj^.name = "FALSE") THEN OPM.Mark(-310, OPM.curpos); (* notice about aliasing of predefined type *) END; OPS.Get(sym); TypeDecl(obj^.typ, obj^.typ) From 22c5977fe35f41a38379cc727edfae925ec8b873 Mon Sep 17 00:00:00 2001 From: norayr Date: Mon, 5 Dec 2016 22:13:29 +0400 Subject: [PATCH 375/580] updated bootstrap sources. -- noch --- bootstrap/unix-44/OPP.c | 3 +++ bootstrap/unix-44/extTools.c | 2 +- bootstrap/unix-48/OPP.c | 3 +++ bootstrap/unix-48/extTools.c | 2 +- bootstrap/unix-88/OPP.c | 3 +++ bootstrap/unix-88/extTools.c | 2 +- bootstrap/windows-48/OPP.c | 3 +++ bootstrap/windows-48/extTools.c | 2 +- bootstrap/windows-88/OPP.c | 3 +++ bootstrap/windows-88/extTools.c | 2 +- 10 files changed, 20 insertions(+), 5 deletions(-) diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index 561e1feb..2357ee63 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1665,6 +1665,9 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) obj->typ = OPT_undftyp; OPP_CheckMark(&obj->vis); if (OPP_sym == 9) { + if (((((((((__STRCMP(obj->name, "INTEGER") == 0 || __STRCMP(obj->name, "SHORTINT") == 0) || __STRCMP(obj->name, "LONGINT") == 0) || __STRCMP(obj->name, "HUGEINT") == 0) || __STRCMP(obj->name, "LONGREAL") == 0) || __STRCMP(obj->name, "REAL") == 0) || __STRCMP(obj->name, "CHAR") == 0) || __STRCMP(obj->name, "SET") == 0) || __STRCMP(obj->name, "TRUE") == 0) || __STRCMP(obj->name, "FALSE") == 0) { + OPM_Mark(-310, OPM_curpos); + } OPS_Get(&OPP_sym); OPP_TypeDecl(&obj->typ, &obj->typ); } else if (OPP_sym == 34 || OPP_sym == 20) { diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index 858c9514..1ed38a02 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -65,7 +65,7 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) { - __COPY("gcc -g", s, s__len); + __COPY("gcc -fPIC -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index 561e1feb..2357ee63 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1665,6 +1665,9 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) obj->typ = OPT_undftyp; OPP_CheckMark(&obj->vis); if (OPP_sym == 9) { + if (((((((((__STRCMP(obj->name, "INTEGER") == 0 || __STRCMP(obj->name, "SHORTINT") == 0) || __STRCMP(obj->name, "LONGINT") == 0) || __STRCMP(obj->name, "HUGEINT") == 0) || __STRCMP(obj->name, "LONGREAL") == 0) || __STRCMP(obj->name, "REAL") == 0) || __STRCMP(obj->name, "CHAR") == 0) || __STRCMP(obj->name, "SET") == 0) || __STRCMP(obj->name, "TRUE") == 0) || __STRCMP(obj->name, "FALSE") == 0) { + OPM_Mark(-310, OPM_curpos); + } OPS_Get(&OPP_sym); OPP_TypeDecl(&obj->typ, &obj->typ); } else if (OPP_sym == 34 || OPP_sym == 20) { diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index 858c9514..1ed38a02 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -65,7 +65,7 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) { - __COPY("gcc -g", s, s__len); + __COPY("gcc -fPIC -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index e3ffa285..5145e858 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1665,6 +1665,9 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) obj->typ = OPT_undftyp; OPP_CheckMark(&obj->vis); if (OPP_sym == 9) { + if (((((((((__STRCMP(obj->name, "INTEGER") == 0 || __STRCMP(obj->name, "SHORTINT") == 0) || __STRCMP(obj->name, "LONGINT") == 0) || __STRCMP(obj->name, "HUGEINT") == 0) || __STRCMP(obj->name, "LONGREAL") == 0) || __STRCMP(obj->name, "REAL") == 0) || __STRCMP(obj->name, "CHAR") == 0) || __STRCMP(obj->name, "SET") == 0) || __STRCMP(obj->name, "TRUE") == 0) || __STRCMP(obj->name, "FALSE") == 0) { + OPM_Mark(-310, OPM_curpos); + } OPS_Get(&OPP_sym); OPP_TypeDecl(&obj->typ, &obj->typ); } else if (OPP_sym == 34 || OPP_sym == 20) { diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index 858c9514..1ed38a02 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -65,7 +65,7 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) { - __COPY("gcc -g", s, s__len); + __COPY("gcc -fPIC -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index 561e1feb..2357ee63 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1665,6 +1665,9 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) obj->typ = OPT_undftyp; OPP_CheckMark(&obj->vis); if (OPP_sym == 9) { + if (((((((((__STRCMP(obj->name, "INTEGER") == 0 || __STRCMP(obj->name, "SHORTINT") == 0) || __STRCMP(obj->name, "LONGINT") == 0) || __STRCMP(obj->name, "HUGEINT") == 0) || __STRCMP(obj->name, "LONGREAL") == 0) || __STRCMP(obj->name, "REAL") == 0) || __STRCMP(obj->name, "CHAR") == 0) || __STRCMP(obj->name, "SET") == 0) || __STRCMP(obj->name, "TRUE") == 0) || __STRCMP(obj->name, "FALSE") == 0) { + OPM_Mark(-310, OPM_curpos); + } OPS_Get(&OPP_sym); OPP_TypeDecl(&obj->typ, &obj->typ); } else if (OPP_sym == 34 || OPP_sym == 20) { diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index 858c9514..1ed38a02 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -65,7 +65,7 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) { - __COPY("gcc -g", s, s__len); + __COPY("gcc -fPIC -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index e3ffa285..5145e858 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1665,6 +1665,9 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) obj->typ = OPT_undftyp; OPP_CheckMark(&obj->vis); if (OPP_sym == 9) { + if (((((((((__STRCMP(obj->name, "INTEGER") == 0 || __STRCMP(obj->name, "SHORTINT") == 0) || __STRCMP(obj->name, "LONGINT") == 0) || __STRCMP(obj->name, "HUGEINT") == 0) || __STRCMP(obj->name, "LONGREAL") == 0) || __STRCMP(obj->name, "REAL") == 0) || __STRCMP(obj->name, "CHAR") == 0) || __STRCMP(obj->name, "SET") == 0) || __STRCMP(obj->name, "TRUE") == 0) || __STRCMP(obj->name, "FALSE") == 0) { + OPM_Mark(-310, OPM_curpos); + } OPS_Get(&OPP_sym); OPP_TypeDecl(&obj->typ, &obj->typ); } else if (OPP_sym == 34 || OPP_sym == 20) { diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index 858c9514..1ed38a02 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -65,7 +65,7 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) { - __COPY("gcc -g", s, s__len); + __COPY("gcc -fPIC -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); From 93eea47e54b18bfea16dbd0cc356e3760eb34b20 Mon Sep 17 00:00:00 2001 From: norayr Date: Tue, 6 Dec 2016 11:32:21 +0400 Subject: [PATCH 376/580] improved warning message. -- noch --- src/runtime/Errors.Txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runtime/Errors.Txt b/src/runtime/Errors.Txt index c9f98339..29ed7063 100644 --- a/src/runtime/Errors.Txt +++ b/src/runtime/Errors.Txt @@ -177,7 +177,7 @@ Compiler Warnings 307 no ELSE symbol after CASE statement sequence may lead to trap 308 SYSTEM.VAL result includes memory past end of source variable; use SYSTEM.GET 309 you should name this parameter type, or else no actual parameter will match -310 aliasing of predefined type +310 redefining standard predefined type Run-time Error Messages -1 assertion failed, cf. SYSTEM_assert From 6cd7727802bb6683953f64e1aa664172f4889fc5 Mon Sep 17 00:00:00 2001 From: norayr Date: Tue, 6 Dec 2016 13:11:44 +0400 Subject: [PATCH 377/580] removed tests. -- noch --- src/compiler/OPP.Mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/OPP.Mod b/src/compiler/OPP.Mod index 33d70a76..29c4fb2e 100644 --- a/src/compiler/OPP.Mod +++ b/src/compiler/OPP.Mod @@ -929,7 +929,7 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) (obj^.name = "TRUE") OR (obj^.name = "FALSE") THEN OPM.Mark(-310, OPM.curpos); (* notice about aliasing of predefined type *) END; - OPS.Get(sym); TypeDecl(obj^.typ, obj^.typ) + OPS.Get(sym); TypeDecl(obj^.typ, obj^.typ) ELSIF (sym = OPS.becomes) OR (sym = OPS.colon) THEN err(OPS.eql); OPS.Get(sym); TypeDecl(obj^.typ, obj^.typ) ELSE err(OPS.eql) From d009eb2e3447ca7dfd9d549304965cb5bdea5041 Mon Sep 17 00:00:00 2001 From: norayr Date: Tue, 6 Dec 2016 13:13:02 +0400 Subject: [PATCH 378/580] updated bootstrap c sources. -- noch --- bootstrap/unix-44/Compiler.c | 2 +- bootstrap/unix-44/Configuration.c | 4 ++-- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Files.c | 2 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 2 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 2 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 2 +- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 2 +- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 2 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Out.c | 2 +- bootstrap/unix-44/Out.h | 2 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/VT100.c | 2 +- bootstrap/unix-44/VT100.h | 2 +- bootstrap/unix-44/extTools.c | 2 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-48/Compiler.c | 2 +- bootstrap/unix-48/Configuration.c | 4 ++-- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Files.c | 2 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 2 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 2 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 2 +- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 2 +- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 2 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Out.c | 2 +- bootstrap/unix-48/Out.h | 2 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/VT100.c | 2 +- bootstrap/unix-48/VT100.h | 2 +- bootstrap/unix-48/extTools.c | 2 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-88/Compiler.c | 2 +- bootstrap/unix-88/Configuration.c | 4 ++-- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Files.c | 2 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 2 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 2 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 2 +- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 2 +- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 2 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Out.c | 2 +- bootstrap/unix-88/Out.h | 2 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/VT100.c | 2 +- bootstrap/unix-88/VT100.h | 2 +- bootstrap/unix-88/extTools.c | 2 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/windows-48/Compiler.c | 2 +- bootstrap/windows-48/Configuration.c | 4 ++-- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Files.c | 2 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 2 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 2 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 2 +- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 2 +- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 2 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Out.c | 2 +- bootstrap/windows-48/Out.h | 2 +- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/VT100.c | 2 +- bootstrap/windows-48/VT100.h | 2 +- bootstrap/windows-48/extTools.c | 2 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-88/Compiler.c | 2 +- bootstrap/windows-88/Configuration.c | 4 ++-- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Files.c | 2 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 2 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 2 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 2 +- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 2 +- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 2 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Out.c | 2 +- bootstrap/windows-88/Out.h | 2 +- bootstrap/windows-88/Platform.c | 2 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/VT100.c | 2 +- bootstrap/windows-88/VT100.h | 2 +- bootstrap/windows-88/extTools.c | 2 +- bootstrap/windows-88/extTools.h | 2 +- 185 files changed, 190 insertions(+), 190 deletions(-) diff --git a/bootstrap/unix-44/Compiler.c b/bootstrap/unix-44/Compiler.c index ed567be7..97e4d8e3 100644 --- a/bootstrap/unix-44/Compiler.c +++ b/bootstrap/unix-44/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index 8f8e5783..7fa2ad3f 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index 8a2a656b..b477d97a 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 0faeb4d3..a177f3e6 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index 2c89f82e..b69b0824 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index e6ac7523..0546fa61 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index a4b879fe..3d30d5d4 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index 3e00c05c..c9741737 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index 445d1eae..b9e63ee7 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index 792e292b..99fd666d 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index fb07f6b2..3f6ee165 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 49ddd0ab..5e67ae16 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index b0142b20..41739672 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 04afccfa..a1587370 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index 4d6101bb..7664cc0c 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index 2357ee63..c4ce70c5 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index a88a16ee..ef56b929 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index 0918b14d..52f0f328 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index 08db3b29..54edc605 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index 941329b4..23062347 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index e3f23baf..68edb67f 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index 7d93389c..b266cb63 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index c1eb098f..00052c0b 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Out.c b/bootstrap/unix-44/Out.c index ab37e758..a0ae3106 100644 --- a/bootstrap/unix-44/Out.c +++ b/bootstrap/unix-44/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Out.h b/bootstrap/unix-44/Out.h index 1cac588c..d2a230b3 100644 --- a/bootstrap/unix-44/Out.h +++ b/bootstrap/unix-44/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 89286d2c..e282a468 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index 69667994..a3e32518 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index fde141c5..bfe15fff 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index 1576c7ee..ff6ad391 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index c4d2419d..7f5a8fac 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index 471c85c8..2a1ebd5f 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index f4d8eef3..dd7eb163 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index 950703aa..91fa31ed 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/VT100.c b/bootstrap/unix-44/VT100.c index b446063e..0d9d3163 100644 --- a/bootstrap/unix-44/VT100.c +++ b/bootstrap/unix-44/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/VT100.h b/bootstrap/unix-44/VT100.h index 0fd1e5d3..c552d82d 100644 --- a/bootstrap/unix-44/VT100.h +++ b/bootstrap/unix-44/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index 1ed38a02..38cd03d5 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index 724db7ae..783d31fb 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/Compiler.c b/bootstrap/unix-48/Compiler.c index ed567be7..97e4d8e3 100644 --- a/bootstrap/unix-48/Compiler.c +++ b/bootstrap/unix-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index 8f8e5783..7fa2ad3f 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index 8a2a656b..b477d97a 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 0faeb4d3..a177f3e6 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index 2c89f82e..b69b0824 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index e6ac7523..0546fa61 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index a4b879fe..3d30d5d4 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index 3e00c05c..c9741737 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index 445d1eae..b9e63ee7 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index 792e292b..99fd666d 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index fb07f6b2..3f6ee165 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 49ddd0ab..5e67ae16 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index b0142b20..41739672 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 04afccfa..a1587370 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index 4d6101bb..7664cc0c 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index 2357ee63..c4ce70c5 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index a88a16ee..ef56b929 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index 0918b14d..52f0f328 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index 08db3b29..54edc605 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 78acd9c1..4f83d6ee 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index e3f23baf..68edb67f 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index 7d93389c..b266cb63 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index c1eb098f..00052c0b 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Out.c b/bootstrap/unix-48/Out.c index ab37e758..a0ae3106 100644 --- a/bootstrap/unix-48/Out.c +++ b/bootstrap/unix-48/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Out.h b/bootstrap/unix-48/Out.h index 1cac588c..d2a230b3 100644 --- a/bootstrap/unix-48/Out.h +++ b/bootstrap/unix-48/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 89286d2c..e282a468 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index 69667994..a3e32518 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index fde141c5..bfe15fff 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index 1576c7ee..ff6ad391 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index c4d2419d..7f5a8fac 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index 471c85c8..2a1ebd5f 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index 762fce4d..392a5579 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index b900b772..dff59e1e 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/VT100.c b/bootstrap/unix-48/VT100.c index b446063e..0d9d3163 100644 --- a/bootstrap/unix-48/VT100.c +++ b/bootstrap/unix-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/VT100.h b/bootstrap/unix-48/VT100.h index 0fd1e5d3..c552d82d 100644 --- a/bootstrap/unix-48/VT100.h +++ b/bootstrap/unix-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index 1ed38a02..38cd03d5 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index 724db7ae..783d31fb 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/Compiler.c b/bootstrap/unix-88/Compiler.c index ed567be7..97e4d8e3 100644 --- a/bootstrap/unix-88/Compiler.c +++ b/bootstrap/unix-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index 8f8e5783..7fa2ad3f 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index 8a2a656b..b477d97a 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index f7d08102..819c6450 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 8a41c280..9332fd1c 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index 3566f3c0..dbfe923d 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index 99c63bea..b6d1c177 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 6dfb1d86..2ef36628 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index bbb36879..fbc2c47e 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index 792e292b..99fd666d 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index fb07f6b2..3f6ee165 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index 49ddd0ab..5e67ae16 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index b0142b20..41739672 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index a7014a53..f37a4f3e 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index 4d6101bb..7664cc0c 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index 5145e858..fbbb2c4a 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index a88a16ee..ef56b929 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index 0918b14d..52f0f328 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index 08db3b29..54edc605 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index eb19830e..e93361f7 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index e3f23baf..68edb67f 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index c8d92d32..548e85cf 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index c1eb098f..00052c0b 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Out.c b/bootstrap/unix-88/Out.c index ab37e758..a0ae3106 100644 --- a/bootstrap/unix-88/Out.c +++ b/bootstrap/unix-88/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Out.h b/bootstrap/unix-88/Out.h index 1cac588c..d2a230b3 100644 --- a/bootstrap/unix-88/Out.h +++ b/bootstrap/unix-88/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index f04609c5..99d59a98 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index a57b5dc4..f1aa8a9d 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index fde141c5..bfe15fff 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index 1576c7ee..ff6ad391 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index c4d2419d..7f5a8fac 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index 471c85c8..2a1ebd5f 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index bad01c09..396b6e14 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index fbc12082..48899032 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/VT100.c b/bootstrap/unix-88/VT100.c index b446063e..0d9d3163 100644 --- a/bootstrap/unix-88/VT100.c +++ b/bootstrap/unix-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/VT100.h b/bootstrap/unix-88/VT100.h index 0fd1e5d3..c552d82d 100644 --- a/bootstrap/unix-88/VT100.h +++ b/bootstrap/unix-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index 1ed38a02..38cd03d5 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index 724db7ae..783d31fb 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/Compiler.c b/bootstrap/windows-48/Compiler.c index ed567be7..97e4d8e3 100644 --- a/bootstrap/windows-48/Compiler.c +++ b/bootstrap/windows-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index 8f8e5783..7fa2ad3f 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index 8a2a656b..b477d97a 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index d7434dbd..d7b42e0e 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index 36208e21..6d3141bd 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index e6ac7523..0546fa61 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index a4b879fe..3d30d5d4 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index 648dde85..e98bb542 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index 445d1eae..b9e63ee7 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index 792e292b..99fd666d 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index fb07f6b2..3f6ee165 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 49ddd0ab..5e67ae16 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index b0142b20..41739672 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 04afccfa..a1587370 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index 4d6101bb..7664cc0c 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index 2357ee63..c4ce70c5 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index a88a16ee..ef56b929 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index 0918b14d..52f0f328 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index 08db3b29..54edc605 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 78acd9c1..4f83d6ee 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index e3f23baf..68edb67f 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index 7d93389c..b266cb63 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index c1eb098f..00052c0b 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Out.c b/bootstrap/windows-48/Out.c index 8c0292d1..11c526ac 100644 --- a/bootstrap/windows-48/Out.c +++ b/bootstrap/windows-48/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Out.h b/bootstrap/windows-48/Out.h index 1cac588c..d2a230b3 100644 --- a/bootstrap/windows-48/Out.h +++ b/bootstrap/windows-48/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 6604baf0..5351882b 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index 1bdda6f9..2e20d294 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index fde141c5..bfe15fff 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index 1576c7ee..ff6ad391 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index c4d2419d..7f5a8fac 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index 471c85c8..2a1ebd5f 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index 762fce4d..392a5579 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index b900b772..dff59e1e 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/VT100.c b/bootstrap/windows-48/VT100.c index b446063e..0d9d3163 100644 --- a/bootstrap/windows-48/VT100.c +++ b/bootstrap/windows-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/VT100.h b/bootstrap/windows-48/VT100.h index 0fd1e5d3..c552d82d 100644 --- a/bootstrap/windows-48/VT100.h +++ b/bootstrap/windows-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index 1ed38a02..38cd03d5 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index 724db7ae..783d31fb 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/Compiler.c b/bootstrap/windows-88/Compiler.c index ed567be7..97e4d8e3 100644 --- a/bootstrap/windows-88/Compiler.c +++ b/bootstrap/windows-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index 8f8e5783..7fa2ad3f 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index 8a2a656b..b477d97a 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index b104d085..5d6d6ffd 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 95736721..05a23b23 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index 3566f3c0..dbfe923d 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index 99c63bea..b6d1c177 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index ce1297f7..b7d898fc 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index bbb36879..fbc2c47e 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index 792e292b..99fd666d 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index fb07f6b2..3f6ee165 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index 49ddd0ab..5e67ae16 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index b0142b20..41739672 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index a7014a53..f37a4f3e 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index 4d6101bb..7664cc0c 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index 5145e858..fbbb2c4a 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index a88a16ee..ef56b929 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index 0918b14d..52f0f328 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index 08db3b29..54edc605 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index eb19830e..e93361f7 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index e3f23baf..68edb67f 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index c8d92d32..548e85cf 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index c1eb098f..00052c0b 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Out.c b/bootstrap/windows-88/Out.c index 8c0292d1..11c526ac 100644 --- a/bootstrap/windows-88/Out.c +++ b/bootstrap/windows-88/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Out.h b/bootstrap/windows-88/Out.h index 1cac588c..d2a230b3 100644 --- a/bootstrap/windows-88/Out.h +++ b/bootstrap/windows-88/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index b725c6a2..b53acd53 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index ef931d99..825ee326 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index fde141c5..bfe15fff 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index 1576c7ee..ff6ad391 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index c4d2419d..7f5a8fac 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index 471c85c8..2a1ebd5f 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index bad01c09..396b6e14 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index fbc12082..48899032 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/VT100.c b/bootstrap/windows-88/VT100.c index b446063e..0d9d3163 100644 --- a/bootstrap/windows-88/VT100.c +++ b/bootstrap/windows-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/VT100.h b/bootstrap/windows-88/VT100.h index 0fd1e5d3..c552d82d 100644 --- a/bootstrap/windows-88/VT100.h +++ b/bootstrap/windows-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index 1ed38a02..38cd03d5 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index 724db7ae..783d31fb 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/05]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h From 4fda478a28b1ac98751d4ec66e613a91a44f31c1 Mon Sep 17 00:00:00 2001 From: norayr Date: Tue, 6 Dec 2016 17:47:48 +0400 Subject: [PATCH 379/580] replaced most of string constants by OPT.sometyp.strobj.name. -- noch --- src/compiler/OPP.Mod | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/compiler/OPP.Mod b/src/compiler/OPP.Mod index 29c4fb2e..3dedb545 100644 --- a/src/compiler/OPP.Mod +++ b/src/compiler/OPP.Mod @@ -72,8 +72,8 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) VAR x: OPT.Node; sf: SYSTEM.INT64; BEGIN IF sym = OPS.lbrak THEN OPS.Get(sym); - IF ~OPT.SYSimported THEN err(135) END; - ConstExpression(x); + IF ~OPT.SYSimported THEN err(135) END; + ConstExpression(x); IF x^.typ^.form = OPT.Int THEN sf := x^.conval^.intval; IF (sf < 0) OR (sf > OPM.MaxSysFlag) THEN err(220); sf := 0 END ELSE err(51); sf := 0 @@ -737,7 +737,7 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) IF e THEN OPS.Get(sym); StatSeq(y) ELSE y := NIL; - OPM.Mark(-307, OPM.curpos); (* notice about no OPS.else symbol; -- noch *) + OPM.Mark(-307, OPM.curpos); (* notice about no OPS.else symbol; -- noch *) END ; OPB.Construct(OPT.Ncaselse, cases, y); OPB.Construct(OPT.Ncase, x, cases); cases^.conval := OPT.NewConst(); @@ -922,13 +922,17 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) OPT.Insert(OPS.name, obj); obj^.mode := OPT.Typ; obj^.typ := OPT.undftyp; CheckMark(obj^.vis); IF sym = OPS.eql THEN - IF (obj^.name = "INTEGER") OR (obj^.name = "SHORTINT") OR - (obj^.name = "LONGINT") OR (obj^.name = "HUGEINT") OR - (obj^.name = "LONGREAL") OR (obj^.name = "REAL") OR - (obj^.name = "CHAR") OR (obj^.name = "SET") OR - (obj^.name = "TRUE") OR (obj^.name = "FALSE") THEN + IF (obj^.name = OPT.sinttyp.strobj.name) OR + (obj^.name = OPT.inttyp.strobj.name) OR + (obj^.name = OPT.linttyp.strobj.name) OR + (obj^.name = OPT.hinttyp.strobj.name) OR + (obj^.name = OPT.realtyp.strobj.name) OR + (obj^.name = OPT.lrltyp.strobj.name) OR + (obj^.name = OPT.settyp.strobj.name) OR + (obj^.name = OPT.chartyp.strobj.name) OR + (obj^.name = "TRUE") OR (obj^.name = "FALSE") THEN OPM.Mark(-310, OPM.curpos); (* notice about aliasing of predefined type *) - END; + END; OPS.Get(sym); TypeDecl(obj^.typ, obj^.typ) ELSIF (sym = OPS.becomes) OR (sym = OPS.colon) THEN err(OPS.eql); OPS.Get(sym); TypeDecl(obj^.typ, obj^.typ) From 8d28c1b1bbc95d2a85c35b5131b4f1e09aee0800 Mon Sep 17 00:00:00 2001 From: norayr Date: Tue, 6 Dec 2016 17:52:15 +0400 Subject: [PATCH 380/580] updated bootstrap sources. -- noch --- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-88/OPP.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index c4ce70c5..9d510a11 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1665,7 +1665,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) obj->typ = OPT_undftyp; OPP_CheckMark(&obj->vis); if (OPP_sym == 9) { - if (((((((((__STRCMP(obj->name, "INTEGER") == 0 || __STRCMP(obj->name, "SHORTINT") == 0) || __STRCMP(obj->name, "LONGINT") == 0) || __STRCMP(obj->name, "HUGEINT") == 0) || __STRCMP(obj->name, "LONGREAL") == 0) || __STRCMP(obj->name, "REAL") == 0) || __STRCMP(obj->name, "CHAR") == 0) || __STRCMP(obj->name, "SET") == 0) || __STRCMP(obj->name, "TRUE") == 0) || __STRCMP(obj->name, "FALSE") == 0) { + if (((((((((__STRCMP(obj->name, OPT_sinttyp->strobj->name) == 0 || __STRCMP(obj->name, OPT_inttyp->strobj->name) == 0) || __STRCMP(obj->name, OPT_linttyp->strobj->name) == 0) || __STRCMP(obj->name, OPT_hinttyp->strobj->name) == 0) || __STRCMP(obj->name, OPT_realtyp->strobj->name) == 0) || __STRCMP(obj->name, OPT_lrltyp->strobj->name) == 0) || __STRCMP(obj->name, OPT_settyp->strobj->name) == 0) || __STRCMP(obj->name, OPT_chartyp->strobj->name) == 0) || __STRCMP(obj->name, "TRUE") == 0) || __STRCMP(obj->name, "FALSE") == 0) { OPM_Mark(-310, OPM_curpos); } OPS_Get(&OPP_sym); diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index c4ce70c5..9d510a11 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1665,7 +1665,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) obj->typ = OPT_undftyp; OPP_CheckMark(&obj->vis); if (OPP_sym == 9) { - if (((((((((__STRCMP(obj->name, "INTEGER") == 0 || __STRCMP(obj->name, "SHORTINT") == 0) || __STRCMP(obj->name, "LONGINT") == 0) || __STRCMP(obj->name, "HUGEINT") == 0) || __STRCMP(obj->name, "LONGREAL") == 0) || __STRCMP(obj->name, "REAL") == 0) || __STRCMP(obj->name, "CHAR") == 0) || __STRCMP(obj->name, "SET") == 0) || __STRCMP(obj->name, "TRUE") == 0) || __STRCMP(obj->name, "FALSE") == 0) { + if (((((((((__STRCMP(obj->name, OPT_sinttyp->strobj->name) == 0 || __STRCMP(obj->name, OPT_inttyp->strobj->name) == 0) || __STRCMP(obj->name, OPT_linttyp->strobj->name) == 0) || __STRCMP(obj->name, OPT_hinttyp->strobj->name) == 0) || __STRCMP(obj->name, OPT_realtyp->strobj->name) == 0) || __STRCMP(obj->name, OPT_lrltyp->strobj->name) == 0) || __STRCMP(obj->name, OPT_settyp->strobj->name) == 0) || __STRCMP(obj->name, OPT_chartyp->strobj->name) == 0) || __STRCMP(obj->name, "TRUE") == 0) || __STRCMP(obj->name, "FALSE") == 0) { OPM_Mark(-310, OPM_curpos); } OPS_Get(&OPP_sym); diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index fbbb2c4a..dc5f3a8b 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1665,7 +1665,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) obj->typ = OPT_undftyp; OPP_CheckMark(&obj->vis); if (OPP_sym == 9) { - if (((((((((__STRCMP(obj->name, "INTEGER") == 0 || __STRCMP(obj->name, "SHORTINT") == 0) || __STRCMP(obj->name, "LONGINT") == 0) || __STRCMP(obj->name, "HUGEINT") == 0) || __STRCMP(obj->name, "LONGREAL") == 0) || __STRCMP(obj->name, "REAL") == 0) || __STRCMP(obj->name, "CHAR") == 0) || __STRCMP(obj->name, "SET") == 0) || __STRCMP(obj->name, "TRUE") == 0) || __STRCMP(obj->name, "FALSE") == 0) { + if (((((((((__STRCMP(obj->name, OPT_sinttyp->strobj->name) == 0 || __STRCMP(obj->name, OPT_inttyp->strobj->name) == 0) || __STRCMP(obj->name, OPT_linttyp->strobj->name) == 0) || __STRCMP(obj->name, OPT_hinttyp->strobj->name) == 0) || __STRCMP(obj->name, OPT_realtyp->strobj->name) == 0) || __STRCMP(obj->name, OPT_lrltyp->strobj->name) == 0) || __STRCMP(obj->name, OPT_settyp->strobj->name) == 0) || __STRCMP(obj->name, OPT_chartyp->strobj->name) == 0) || __STRCMP(obj->name, "TRUE") == 0) || __STRCMP(obj->name, "FALSE") == 0) { OPM_Mark(-310, OPM_curpos); } OPS_Get(&OPP_sym); diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index c4ce70c5..9d510a11 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1665,7 +1665,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) obj->typ = OPT_undftyp; OPP_CheckMark(&obj->vis); if (OPP_sym == 9) { - if (((((((((__STRCMP(obj->name, "INTEGER") == 0 || __STRCMP(obj->name, "SHORTINT") == 0) || __STRCMP(obj->name, "LONGINT") == 0) || __STRCMP(obj->name, "HUGEINT") == 0) || __STRCMP(obj->name, "LONGREAL") == 0) || __STRCMP(obj->name, "REAL") == 0) || __STRCMP(obj->name, "CHAR") == 0) || __STRCMP(obj->name, "SET") == 0) || __STRCMP(obj->name, "TRUE") == 0) || __STRCMP(obj->name, "FALSE") == 0) { + if (((((((((__STRCMP(obj->name, OPT_sinttyp->strobj->name) == 0 || __STRCMP(obj->name, OPT_inttyp->strobj->name) == 0) || __STRCMP(obj->name, OPT_linttyp->strobj->name) == 0) || __STRCMP(obj->name, OPT_hinttyp->strobj->name) == 0) || __STRCMP(obj->name, OPT_realtyp->strobj->name) == 0) || __STRCMP(obj->name, OPT_lrltyp->strobj->name) == 0) || __STRCMP(obj->name, OPT_settyp->strobj->name) == 0) || __STRCMP(obj->name, OPT_chartyp->strobj->name) == 0) || __STRCMP(obj->name, "TRUE") == 0) || __STRCMP(obj->name, "FALSE") == 0) { OPM_Mark(-310, OPM_curpos); } OPS_Get(&OPP_sym); diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index fbbb2c4a..dc5f3a8b 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1665,7 +1665,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) obj->typ = OPT_undftyp; OPP_CheckMark(&obj->vis); if (OPP_sym == 9) { - if (((((((((__STRCMP(obj->name, "INTEGER") == 0 || __STRCMP(obj->name, "SHORTINT") == 0) || __STRCMP(obj->name, "LONGINT") == 0) || __STRCMP(obj->name, "HUGEINT") == 0) || __STRCMP(obj->name, "LONGREAL") == 0) || __STRCMP(obj->name, "REAL") == 0) || __STRCMP(obj->name, "CHAR") == 0) || __STRCMP(obj->name, "SET") == 0) || __STRCMP(obj->name, "TRUE") == 0) || __STRCMP(obj->name, "FALSE") == 0) { + if (((((((((__STRCMP(obj->name, OPT_sinttyp->strobj->name) == 0 || __STRCMP(obj->name, OPT_inttyp->strobj->name) == 0) || __STRCMP(obj->name, OPT_linttyp->strobj->name) == 0) || __STRCMP(obj->name, OPT_hinttyp->strobj->name) == 0) || __STRCMP(obj->name, OPT_realtyp->strobj->name) == 0) || __STRCMP(obj->name, OPT_lrltyp->strobj->name) == 0) || __STRCMP(obj->name, OPT_settyp->strobj->name) == 0) || __STRCMP(obj->name, OPT_chartyp->strobj->name) == 0) || __STRCMP(obj->name, "TRUE") == 0) || __STRCMP(obj->name, "FALSE") == 0) { OPM_Mark(-310, OPM_curpos); } OPS_Get(&OPP_sym); From 58ea173d9446848578abc5b7757d1bf4e2750fae Mon Sep 17 00:00:00 2001 From: norayr Date: Tue, 6 Dec 2016 18:28:33 +0400 Subject: [PATCH 381/580] added "showdef" related information to the readme. -- noch --- ReadMe.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/ReadMe.md b/ReadMe.md index b5dbdb74..b7cfc40e 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -101,6 +101,27 @@ executable binary. Execute as usual on Linux ('./hello') or Windows ('hello'). +In order to know module's interface, use "showdef" program. + +``` + $ showdef Out.sym +DEFINITION Out; + + VAR + IsConsole-: BOOLEAN; + + PROCEDURE Char(ch: CHAR); + PROCEDURE Flush; + PROCEDURE Int(x: INT64; n: INT64); + PROCEDURE Ln; + PROCEDURE LongReal(x: LONGREAL; n: INT16); + PROCEDURE Open; + PROCEDURE Real(x: REAL; n: INT16); + PROCEDURE String(str: ARRAY OF CHAR); + PROCEDURE Ten(e: INT16): LONGREAL; + +END Out. +``` Also see [**Compiling**](/doc/Compiling.md). From d21037642107723c889efb8e768538db9edd229a Mon Sep 17 00:00:00 2001 From: norayr Date: Tue, 6 Dec 2016 20:35:58 +0400 Subject: [PATCH 382/580] reverted back to using string literals. -- noch --- src/compiler/OPP.Mod | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/compiler/OPP.Mod b/src/compiler/OPP.Mod index 3dedb545..0ff9b7fb 100644 --- a/src/compiler/OPP.Mod +++ b/src/compiler/OPP.Mod @@ -922,14 +922,14 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) OPT.Insert(OPS.name, obj); obj^.mode := OPT.Typ; obj^.typ := OPT.undftyp; CheckMark(obj^.vis); IF sym = OPS.eql THEN - IF (obj^.name = OPT.sinttyp.strobj.name) OR - (obj^.name = OPT.inttyp.strobj.name) OR - (obj^.name = OPT.linttyp.strobj.name) OR - (obj^.name = OPT.hinttyp.strobj.name) OR - (obj^.name = OPT.realtyp.strobj.name) OR - (obj^.name = OPT.lrltyp.strobj.name) OR - (obj^.name = OPT.settyp.strobj.name) OR - (obj^.name = OPT.chartyp.strobj.name) OR + IF (obj^.name = "SHORTINT") OR + (obj^.name = "INTEGER") OR + (obj^.name = "LONGINT") OR + (obj^.name = "HUGEINT") OR + (obj^.name = "REAL") OR + (obj^.name = "LONGREAL") OR + (obj^.name = "SET") OR + (obj^.name = "CHAR") OR (obj^.name = "TRUE") OR (obj^.name = "FALSE") THEN OPM.Mark(-310, OPM.curpos); (* notice about aliasing of predefined type *) END; From 576c57b39b06896d4db5f75384f39c7fef7710cf Mon Sep 17 00:00:00 2001 From: norayr Date: Tue, 6 Dec 2016 20:38:09 +0400 Subject: [PATCH 383/580] update of bootstrap sources. --- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-88/OPP.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index 9d510a11..ebecc1ea 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1665,7 +1665,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) obj->typ = OPT_undftyp; OPP_CheckMark(&obj->vis); if (OPP_sym == 9) { - if (((((((((__STRCMP(obj->name, OPT_sinttyp->strobj->name) == 0 || __STRCMP(obj->name, OPT_inttyp->strobj->name) == 0) || __STRCMP(obj->name, OPT_linttyp->strobj->name) == 0) || __STRCMP(obj->name, OPT_hinttyp->strobj->name) == 0) || __STRCMP(obj->name, OPT_realtyp->strobj->name) == 0) || __STRCMP(obj->name, OPT_lrltyp->strobj->name) == 0) || __STRCMP(obj->name, OPT_settyp->strobj->name) == 0) || __STRCMP(obj->name, OPT_chartyp->strobj->name) == 0) || __STRCMP(obj->name, "TRUE") == 0) || __STRCMP(obj->name, "FALSE") == 0) { + if (((((((((__STRCMP(obj->name, "SHORTINT") == 0 || __STRCMP(obj->name, "INTEGER") == 0) || __STRCMP(obj->name, "LONGINT") == 0) || __STRCMP(obj->name, "HUGEINT") == 0) || __STRCMP(obj->name, "REAL") == 0) || __STRCMP(obj->name, "LONGREAL") == 0) || __STRCMP(obj->name, "SET") == 0) || __STRCMP(obj->name, "CHAR") == 0) || __STRCMP(obj->name, "TRUE") == 0) || __STRCMP(obj->name, "FALSE") == 0) { OPM_Mark(-310, OPM_curpos); } OPS_Get(&OPP_sym); diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index 9d510a11..ebecc1ea 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1665,7 +1665,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) obj->typ = OPT_undftyp; OPP_CheckMark(&obj->vis); if (OPP_sym == 9) { - if (((((((((__STRCMP(obj->name, OPT_sinttyp->strobj->name) == 0 || __STRCMP(obj->name, OPT_inttyp->strobj->name) == 0) || __STRCMP(obj->name, OPT_linttyp->strobj->name) == 0) || __STRCMP(obj->name, OPT_hinttyp->strobj->name) == 0) || __STRCMP(obj->name, OPT_realtyp->strobj->name) == 0) || __STRCMP(obj->name, OPT_lrltyp->strobj->name) == 0) || __STRCMP(obj->name, OPT_settyp->strobj->name) == 0) || __STRCMP(obj->name, OPT_chartyp->strobj->name) == 0) || __STRCMP(obj->name, "TRUE") == 0) || __STRCMP(obj->name, "FALSE") == 0) { + if (((((((((__STRCMP(obj->name, "SHORTINT") == 0 || __STRCMP(obj->name, "INTEGER") == 0) || __STRCMP(obj->name, "LONGINT") == 0) || __STRCMP(obj->name, "HUGEINT") == 0) || __STRCMP(obj->name, "REAL") == 0) || __STRCMP(obj->name, "LONGREAL") == 0) || __STRCMP(obj->name, "SET") == 0) || __STRCMP(obj->name, "CHAR") == 0) || __STRCMP(obj->name, "TRUE") == 0) || __STRCMP(obj->name, "FALSE") == 0) { OPM_Mark(-310, OPM_curpos); } OPS_Get(&OPP_sym); diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index dc5f3a8b..4db27f7d 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1665,7 +1665,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) obj->typ = OPT_undftyp; OPP_CheckMark(&obj->vis); if (OPP_sym == 9) { - if (((((((((__STRCMP(obj->name, OPT_sinttyp->strobj->name) == 0 || __STRCMP(obj->name, OPT_inttyp->strobj->name) == 0) || __STRCMP(obj->name, OPT_linttyp->strobj->name) == 0) || __STRCMP(obj->name, OPT_hinttyp->strobj->name) == 0) || __STRCMP(obj->name, OPT_realtyp->strobj->name) == 0) || __STRCMP(obj->name, OPT_lrltyp->strobj->name) == 0) || __STRCMP(obj->name, OPT_settyp->strobj->name) == 0) || __STRCMP(obj->name, OPT_chartyp->strobj->name) == 0) || __STRCMP(obj->name, "TRUE") == 0) || __STRCMP(obj->name, "FALSE") == 0) { + if (((((((((__STRCMP(obj->name, "SHORTINT") == 0 || __STRCMP(obj->name, "INTEGER") == 0) || __STRCMP(obj->name, "LONGINT") == 0) || __STRCMP(obj->name, "HUGEINT") == 0) || __STRCMP(obj->name, "REAL") == 0) || __STRCMP(obj->name, "LONGREAL") == 0) || __STRCMP(obj->name, "SET") == 0) || __STRCMP(obj->name, "CHAR") == 0) || __STRCMP(obj->name, "TRUE") == 0) || __STRCMP(obj->name, "FALSE") == 0) { OPM_Mark(-310, OPM_curpos); } OPS_Get(&OPP_sym); diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index 9d510a11..ebecc1ea 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1665,7 +1665,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) obj->typ = OPT_undftyp; OPP_CheckMark(&obj->vis); if (OPP_sym == 9) { - if (((((((((__STRCMP(obj->name, OPT_sinttyp->strobj->name) == 0 || __STRCMP(obj->name, OPT_inttyp->strobj->name) == 0) || __STRCMP(obj->name, OPT_linttyp->strobj->name) == 0) || __STRCMP(obj->name, OPT_hinttyp->strobj->name) == 0) || __STRCMP(obj->name, OPT_realtyp->strobj->name) == 0) || __STRCMP(obj->name, OPT_lrltyp->strobj->name) == 0) || __STRCMP(obj->name, OPT_settyp->strobj->name) == 0) || __STRCMP(obj->name, OPT_chartyp->strobj->name) == 0) || __STRCMP(obj->name, "TRUE") == 0) || __STRCMP(obj->name, "FALSE") == 0) { + if (((((((((__STRCMP(obj->name, "SHORTINT") == 0 || __STRCMP(obj->name, "INTEGER") == 0) || __STRCMP(obj->name, "LONGINT") == 0) || __STRCMP(obj->name, "HUGEINT") == 0) || __STRCMP(obj->name, "REAL") == 0) || __STRCMP(obj->name, "LONGREAL") == 0) || __STRCMP(obj->name, "SET") == 0) || __STRCMP(obj->name, "CHAR") == 0) || __STRCMP(obj->name, "TRUE") == 0) || __STRCMP(obj->name, "FALSE") == 0) { OPM_Mark(-310, OPM_curpos); } OPS_Get(&OPP_sym); diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index dc5f3a8b..4db27f7d 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1665,7 +1665,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) obj->typ = OPT_undftyp; OPP_CheckMark(&obj->vis); if (OPP_sym == 9) { - if (((((((((__STRCMP(obj->name, OPT_sinttyp->strobj->name) == 0 || __STRCMP(obj->name, OPT_inttyp->strobj->name) == 0) || __STRCMP(obj->name, OPT_linttyp->strobj->name) == 0) || __STRCMP(obj->name, OPT_hinttyp->strobj->name) == 0) || __STRCMP(obj->name, OPT_realtyp->strobj->name) == 0) || __STRCMP(obj->name, OPT_lrltyp->strobj->name) == 0) || __STRCMP(obj->name, OPT_settyp->strobj->name) == 0) || __STRCMP(obj->name, OPT_chartyp->strobj->name) == 0) || __STRCMP(obj->name, "TRUE") == 0) || __STRCMP(obj->name, "FALSE") == 0) { + if (((((((((__STRCMP(obj->name, "SHORTINT") == 0 || __STRCMP(obj->name, "INTEGER") == 0) || __STRCMP(obj->name, "LONGINT") == 0) || __STRCMP(obj->name, "HUGEINT") == 0) || __STRCMP(obj->name, "REAL") == 0) || __STRCMP(obj->name, "LONGREAL") == 0) || __STRCMP(obj->name, "SET") == 0) || __STRCMP(obj->name, "CHAR") == 0) || __STRCMP(obj->name, "TRUE") == 0) || __STRCMP(obj->name, "FALSE") == 0) { OPM_Mark(-310, OPM_curpos); } OPS_Get(&OPP_sym); From 83d943297f099e8605b709d91fdc3389abb4ea4d Mon Sep 17 00:00:00 2001 From: David Brown Date: Tue, 6 Dec 2016 18:46:37 +0000 Subject: [PATCH 384/580] Use single quote string dilimieters for printf in oberon.mk. --- src/tools/make/oberon.mk | 88 ++++++++++++++++++++-------------------- 1 file changed, 44 insertions(+), 44 deletions(-) diff --git a/src/tools/make/oberon.mk b/src/tools/make/oberon.mk index 4d4b0b40..5c3af6be 100644 --- a/src/tools/make/oberon.mk +++ b/src/tools/make/oberon.mk @@ -32,7 +32,7 @@ usage: clean: - @printf "\n\n--- Cleaning branch $(BRANCH) $(OS) $(COMPILER) $(DATAMODEL) ---\n\n" + @printf '\n\n--- Cleaning branch $(BRANCH) $(OS) $(COMPILER) $(DATAMODEL) ---\n\n' rm -rf $(BUILDDIR) rm -f $(OBECOMP) @@ -42,22 +42,22 @@ clean: # Assemble: Generate the Vishap Oberon compiler binary by compiling the C sources in the build directory assemble: - @printf "\nmake assemble - compiling Oberon compiler c source:\n" - @printf " VERSION: %s\n" "$(VERSION)" - @printf " BRANCH: %s\n" "$(BRANCH)" - @printf " Target characteristics:\n" - @printf " PLATFORM: %s\n" "$(PLATFORM)" - @printf " OS: %s\n" "$(OS)" - @printf " BUILDDIR: %s\n" "$(BUILDDIR)" - @printf " INSTALLDIR: %s\n" "$(INSTALLDIR)" - @printf " Oberon characteristics:\n" - @printf " MODEL: %s\n" "$(MODEL)" - @printf " ADRSIZE: %s\n" "$(ADRSIZE)" - @printf " ALIGNMENT: %s\n" "$(ALIGNMENT)" - @printf " C compiler:\n" - @printf " COMPILER: %s\n" "$(COMPILER)" - @printf " COMPILE: %s\n" "$(COMPILE)" - @printf " DATAMODEL: %s\n" "$(DATAMODEL)" + @printf '\nmake assemble - compiling Oberon compiler c source:\n' + @printf ' VERSION: %s\n' "$(VERSION)" + @printf ' BRANCH: %s\n' "$(BRANCH)" + @printf ' Target characteristics:\n' + @printf ' PLATFORM: %s\n' "$(PLATFORM)" + @printf ' OS: %s\n' "$(OS)" + @printf ' BUILDDIR: %s\n' "$(BUILDDIR)" + @printf ' INSTALLDIR: %s\n' "$(INSTALLDIR)" + @printf ' Oberon characteristics:\n' + @printf ' MODEL: %s\n' "$(MODEL)" + @printf ' ADRSIZE: %s\n' "$(ADRSIZE)" + @printf ' ALIGNMENT: %s\n' "$(ALIGNMENT)" + @printf ' C compiler:\n' + @printf ' COMPILER: %s\n' "$(COMPILER)" + @printf ' COMPILE: %s\n' "$(COMPILE)" + @printf ' DATAMODEL: %s\n' "$(DATAMODEL)" cd $(BUILDDIR) && $(COMPILE) -c SYSTEM.c Configuration.c Platform.c Heap.c cd $(BUILDDIR) && $(COMPILE) -c Out.c Strings.c Modules.c Files.c @@ -73,7 +73,7 @@ assemble: cp src/runtime/*.[ch] $(BUILDDIR) cp src/runtime/*.Txt $(BUILDDIR) cp src/runtime/*.Txt $(ROOTDIR) - @printf "$(OBECOMP) created.\n" + @printf '$(OBECOMP) created.\n' @@ -95,11 +95,11 @@ translate: if [ ! -e $(OBECOMP) ]; then make -f src/tools/make/oberon.mk -s compilerfromsavedsource; fi - @printf "\nmake translate - translating compiler source from Oberon to C:\n" - @printf " PLATFORM: %s\n" $(PLATFORM) - @printf " MODEL: %s\n" $(MODEL) - @printf " ADRSIZE: %s\n" $(ADRSIZE) - @printf " ALIGNMENT: %s\n" $(ALIGNMENT) + @printf '\nmake translate - translating compiler source from Oberon to C:\n' + @printf ' PLATFORM: %s\n' $(PLATFORM) + @printf ' MODEL: %s\n' $(MODEL) + @printf ' ADRSIZE: %s\n' $(ADRSIZE) + @printf ' ALIGNMENT: %s\n' $(ALIGNMENT) @mkdir -p $(BUILDDIR) @rm -f $(BUILDDIR)/*.sym @@ -125,13 +125,13 @@ translate: cp src/runtime/*.[ch] $(BUILDDIR) cp src/runtime/*.Txt $(BUILDDIR) - @printf "$(BUILDDIR) filled with compiler C source.\n" + @printf '$(BUILDDIR) filled with compiler C source.\n' browsercmd: - @printf "\nMaking symbol browser\n" + @printf '\nMaking symbol browser\n' @cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ss -O$(MODEL) ../../src/runtime/Oberon.Mod @cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Sm -O$(MODEL) ../../src/tools/browser/BrowserCmd.Mod @cd $(BUILDDIR); $(COMPILE) BrowserCmd.c Oberon.c -o showdef \ @@ -148,7 +148,7 @@ FORCE: installable: @rm -rf "S(INSTALLDIR)/test-access-qqq" - @if ! mkdir -p "$(INSTALLDIR)/test-access-qqq";then echo "\\n\\n Cannot write to install directory.\\n Please use sudo or run as root/administrator.\\n\\n"; exit 1;fi + @if ! mkdir -p "$(INSTALLDIR)/test-access-qqq";then printf '\n\n Cannot write to install directory.\n Please use sudo or run as root/administrator.\n\n'; exit 1;fi @rm -rf "S(INSTALLDIR)/test-access-qqq" @@ -158,7 +158,7 @@ installable: # and libraries in /opt/$(ONAME). # May require root access. install: - @printf "\nInstalling into \"$(INSTALLDIR)\"\n" + @printf '\nInstalling into \"$(INSTALLDIR)\"\n' @rm -rf "$(INSTALLDIR)" @mkdir -p "$(INSTALLDIR)/bin" @@ -183,22 +183,22 @@ install: # showpath: Describe how to set the PATH variable showpath: - @printf "\nNow add $(INSTALLDIR)/bin to your path, for example with the command:\n" - @printf "export PATH=\"$(INSTALLDIR)/bin:\$$PATH\"\n" - @printf "\n" + @printf '\nNow add $(INSTALLDIR)/bin to your path, for example with the command:\n' + @printf 'export PATH=\"$(INSTALLDIR)/bin:\$$PATH\"\n' + @printf '\n' uninstall: - @printf "\nUninstalling from \"$(INSTALLDIR)\"\n" + @printf '\nUninstalling from \"$(INSTALLDIR)\"\n' rm -rf "$(INSTALLDIR)" rm -f /etc/ld.so.conf/lib$(ONAME) if which ldconfig >/dev/null 2>&1; then ldconfig; fi runtime: - @printf "\nMaking run time library for -O$(MODEL)\n" + @printf '\nMaking run time library for -O$(MODEL)\n' cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/runtime/Platform$(PLATFORM).Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/runtime/Heap.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/runtime/Modules.Mod @@ -215,14 +215,14 @@ runtime: v4: - @printf "\nMaking v4 library for -O$(MODEL)\n" + @printf '\nMaking v4 library for -O$(MODEL)\n' cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/v4/Args.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/v4/Console.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/v4/Printer.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/v4/Sets.Mod ooc2: - @printf "\nMaking ooc2 library for -O$(MODEL)\n" + @printf '\nMaking ooc2 library for -O$(MODEL)\n' cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc2/ooc2Strings.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc2/ooc2Ascii.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc2/ooc2CharClass.Mod @@ -232,7 +232,7 @@ ooc2: cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc2/ooc2Real0.Mod ooc: - @printf "\nMaking ooc library for -O$(MODEL)\n" + @printf '\nMaking ooc library for -O$(MODEL)\n' cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc/oocLowReal.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc/oocLowLReal.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc/oocRealMath.Mod @@ -266,13 +266,13 @@ ooc: cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc/oocC$(DATAMODEL).Mod oocX11: - @printf "\nMaking oocX11 library for -O$(MODEL)\n" + @printf '\nMaking oocX11 library for -O$(MODEL)\n' cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/oocX11/oocX11.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/oocX11/oocXutil.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/oocX11/oocXYplane.Mod ulm: - @printf "\nMaking ulm library for -O$(MODEL)\n" + @printf '\nMaking ulm library for -O$(MODEL)\n' cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmTypes.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmObjects.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmPriorities.Mod @@ -329,11 +329,11 @@ ulm: cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmIntOperations.Mod pow32: - @printf "\nMaking pow library for -O$(MODEL)\n" + @printf '\nMaking pow library for -O$(MODEL)\n' cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/pow/powStrings.Mod misc: - @printf "\nMaking misc library for -O$(MODEL)\n" + @printf '\nMaking misc library for -O$(MODEL)\n' cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/misc/crt.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/misc/Listen.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/misc/MersenneTwister.Mod @@ -341,7 +341,7 @@ misc: cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/misc/MultiArrayRiders.Mod s3: - @printf "\nMaking s3 library for -O$(MODEL)\n" + @printf '\nMaking s3 library for -O$(MODEL)\n' cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/s3/ethBTrees.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/s3/ethMD5.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/s3/ethSets.Mod @@ -368,14 +368,14 @@ O2library: runtime v4 ooc2 ooc ulm pow32 misc s3 OClibrary: runtime library: - @printf "\nCompiling lib$(ONAME)-O$(MODEL) sources\n" + @printf '\nCompiling lib$(ONAME)-O$(MODEL) sources\n' rm -rf $(BUILDDIR)/$(MODEL) mkdir -p $(BUILDDIR)/$(MODEL) cp $(BUILDDIR)/SYSTEM.[ho] $(BUILDDIR)/$(MODEL) cp src/runtime/*.Txt $(BUILDDIR)/$(MODEL) cp $(BUILDDIR)/WindowsWrapper.h $(BUILDDIR)/$(MODEL) @make -f src/tools/make/oberon.mk -s O$(MODEL)library MODEL=$(MODEL) - @printf "\nMaking lib$(ONAME)-O$(MODEL) .a and .so\n" + @printf '\nMaking lib$(ONAME)-O$(MODEL) .a and .so\n' ar rcs "$(BUILDDIR)/$(MODEL)/lib$(ONAME)-O$(MODEL).a" $(BUILDDIR)/$(MODEL)/*.o @cd $(BUILDDIR)/$(MODEL) && $(COMPILE) -shared -o lib$(ONAME)-O$(MODEL).so *.o @@ -390,7 +390,7 @@ sourcechanges: RUNTEST = COMPILER=$(COMPILER) OBECOMP="$(OBECOMP) -O$(MODEL)" FLAVOUR=$(FLAVOUR) BRANCH=$(BRANCH) sh ./test.sh "$(INSTALLDIR)" confidence: - @printf "\n\n--- Confidence tests ---\n\n" + @printf '\n\n--- Confidence tests ---\n\n' cd src/test/confidence/hello; $(RUNTEST) cd src/test/confidence/out; $(RUNTEST) cd src/test/confidence/in; $(RUNTEST) @@ -403,4 +403,4 @@ confidence: cd src/test/confidence/isptest; $(RUNTEST) cd src/test/confidence/lola; $(RUNTEST) if [ "$(PLATFORM)" != "windows" ] ; then cd src/test/confidence/signal; $(RUNTEST); fi - @printf "\n\n--- Confidence tests passed ---\n\n" + @printf '\n\n--- Confidence tests passed ---\n\n' From 4b0fb0d1fbd81dbecb27ba223d3da15c359f7494 Mon Sep 17 00:00:00 2001 From: David Brown Date: Wed, 7 Dec 2016 13:07:21 +0000 Subject: [PATCH 385/580] Slightly simplify auto build repository sync. --- src/tools/make/buildall.pl | 9 ++++----- src/tools/make/getbranch.pl | 14 ++++++++++++++ 2 files changed, 18 insertions(+), 5 deletions(-) create mode 100644 src/tools/make/getbranch.pl diff --git a/src/tools/make/buildall.pl b/src/tools/make/buildall.pl index 0dbb0260..797e7220 100755 --- a/src/tools/make/buildall.pl +++ b/src/tools/make/buildall.pl @@ -14,13 +14,13 @@ my %machines = ( "darwin" => ['dave@dcb', "sudo", "projects/oberon/vishap/voc", "make full"], "cygwin" => ['-p5932 dave@wax', "", "oberon/cygwin/voc", "export CC=gcc && make full;" . "cd ~;" - . "sh start64.sh \\\"cd oberon/cygwin/voc && git reset --hard && git clean -dfx &&" - . "git pull && git checkout $branch && git pull;" + . "sh start64.sh \\\"cd oberon/cygwin/voc &&" + . "src/tools/make/getbranch $branch &&" . "export CC=gcc && make full;\\\""], "mingw" => ['-p5932 dave@wax', "", "oberon/mingw/voc", "export CC=i686-w64-mingw32-gcc && make full;" . "cd ~;" . "sh start64.sh \\\"cd oberon/mingw/voc && git reset --hard && git clean -dfx &&" - . "git pull && git checkout $branch && git pull;" + . "git pull && git checkout -f $branch && git pull;" . "export CC=x86_64-w64-mingw32-gcc && make full;\\\""], "android" => ['-p8022 root@and', "", "vishap/voc", "export CC=gcc && make full"], "lub64" => ['dave@vim', "sudo", "oberon/voc", "make full"], @@ -62,8 +62,7 @@ unlink glob "log/*"; for my $machine (sort keys %machines) { my ($login, $sudo, $dir, $mkcmd) = @{$machines{$machine}}; - my $cmd = "ssh $login \"cd $dir && $sudo git reset --hard && $sudo git clean -dfx &&" - . "$sudo git pull && $sudo git checkout -f $branch && $sudo git pull && $sudo $mkcmd\" "; + my $cmd = "ssh $login \"cd $dir && src/tools/make/getbranch $branch && $sudo $mkcmd\" "; logged($cmd, $machine); } diff --git a/src/tools/make/getbranch.pl b/src/tools/make/getbranch.pl new file mode 100644 index 00000000..32ff1927 --- /dev/null +++ b/src/tools/make/getbranch.pl @@ -0,0 +1,14 @@ +#!perl -w +use strict; +use warnings; + +# Exit with a clean enlistrment in the named branch. + +my $branch = "master"; +if (defined($ARGV[0]) && ($ARGV[0] ne "")) {$branch = $ARGV[0]} + +set -x +git reset --hard # Clear the staging area +git clean -dfx # Remove all untracked files +git pull # Update the local repository +git checkout -f $branch # Switch to requested branch From 72ba766a2dd55b71fbac6eb6471b5fc96f928d28 Mon Sep 17 00:00:00 2001 From: David Brown Date: Wed, 7 Dec 2016 13:11:30 +0000 Subject: [PATCH 386/580] Slightly simplify auto build repository sync. --- src/tools/make/buildall.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tools/make/buildall.pl b/src/tools/make/buildall.pl index 797e7220..e8b6ac1c 100755 --- a/src/tools/make/buildall.pl +++ b/src/tools/make/buildall.pl @@ -19,8 +19,8 @@ my %machines = ( . "export CC=gcc && make full;\\\""], "mingw" => ['-p5932 dave@wax', "", "oberon/mingw/voc", "export CC=i686-w64-mingw32-gcc && make full;" . "cd ~;" - . "sh start64.sh \\\"cd oberon/mingw/voc && git reset --hard && git clean -dfx &&" - . "git pull && git checkout -f $branch && git pull;" + . "sh start64.sh \\\"cd oberon/mingw/voc &&" + . "src/tools/make/getbranch $branch &&" . "export CC=x86_64-w64-mingw32-gcc && make full;\\\""], "android" => ['-p8022 root@and', "", "vishap/voc", "export CC=gcc && make full"], "lub64" => ['dave@vim', "sudo", "oberon/voc", "make full"], From c5f0e1e345d7f4444793c720cdcfc9c9c192e32a Mon Sep 17 00:00:00 2001 From: norayr Date: Wed, 7 Dec 2016 17:43:09 +0400 Subject: [PATCH 387/580] added original Beautifier module. --- src/tools/beautifier/Beautifier.Mod | Bin 0 -> 36838 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 src/tools/beautifier/Beautifier.Mod diff --git a/src/tools/beautifier/Beautifier.Mod b/src/tools/beautifier/Beautifier.Mod new file mode 100644 index 0000000000000000000000000000000000000000..27abc010490318052e684530ba1f4311ab124f8d GIT binary patch literal 36838 zcmd6QUu;}inpdS~W@iev$Nw9{?dC#0y&Bfmg%>;tBBtk4Ol_)2?WKzwi6b zx#!%v<)pi(M-wHfI`{nh&Ue25=R3Fl*Oh~NjmDMzi{YgEeEC+k-y3Ed!%3sj_;dJo zx2BXXxzv59@-wW@yu{n8(-H!nrQNh zukJ_F{kqQccUa$O{CO?$Axdf8U(vds^5bgb?l;iHz`WW(fu(P1-5=rOYksoBFxl0{ zpVj)`L_2`Bpe0Pi(tjtQR~z5f(y!ww{{9&){XcDq7HqkprElQ_bMnLbmGJzg)=7t} z9EknCflsvjEquk_-_?GLTKAcjzV&sf`&(N2ms*F$jm97T^+u!pUVd>t8XvV=2Pgf) zjq@G~h3k#5iTz>W`orVV__RCekA|*$IGRq}XqdaF+9`9J6Ng^YB0oY)_o!Q(9AvFl zTSr{;gG^3B7uR{P{_f`XqTAiuSzCYjcyE2t<&$2vfL^^pwver3=?hpHues|FSL@~$Jy+1md4s!Qkbadg)`;!x=;Ov~`Lj|dG zzOV{39VXB|m}2o?A+(1t3+?v$hn>TP)mfi!6JnH2IHul){PP)S#FnfZE3Jiy%!O@q30R6W| zlm2l(A6GEoANz$x*c<1?WJH4R9+Oi{LIC}vvD@CH*V1j_`lCkMto z{5}!32{M{QW)iso?_h-|c^@L7l!Yb*r-kPolln`0BJZ=7%JI2EX-R|T&1HA5dI_!yl`Puy}`_a$c(mU>Fx3X;c z*3YpJ@DP+j{|QtP)?4H~PyvW&I6XZC-*F2;BCZ7iU_u!K8ZJa?6q7C_H^ph@4o>o- z>f&8)4bLE;ePk@ zY;Sb#-gdh?o7)HLd+uPz-QU~0|0CD=;qLmo@8AFE;pY46+xwe4+wP{@d-uWa=11#W z`a?D)Z8&4s ztwsYEISic=RIGn#nY4KZ_EAKd49cF3gTcKxVroAo*g7 z?S0^Kn2%ST*dcxo4q$++I&RBw#D4eOgPonN_50iUkOmF4**)V9qkZg|D>tp{*fWP6 zlrNnC3}7lt0iguuG7{Wy-Ja8f>Fv%zt=Iz^?^(;W95|k%V`;#9O?$8ZhIx;s7sLTH zwTjrT+GB*v8CM!6Cx2T z<~NsHD%74i15lX-)&&oOa6(=*KE# zEXstg+gEJ3_tZ6Xo&EO~O8(1-J($Fp76O9$qCc7zV&sjm(_`?;6LAA59^FL_j6sPM zkS3gdQ@pRuAvi946>b}QzEatyOfhP55UJ81?LSzmz%h1lh8#wnsNDRZF&km zRSU=C(Wx6}XCtvp3VwlYb&PG}Bt-aROxFm}|=rEt0Q`OBl&xE5txdBf`d}`Pne}E--AZYpCDvJmfhOfMkwh3q`AKR z(D}}*t%uXo(+dhOacjX5AQ{l3I4c04v{%g(fQ3LhIqDZ@gYE^$=={Vxjnpp|V^IH5 zC<=oiv_m6>2;1$Bi+t_$XiE&`xFk|)jy{RpUN4^n4RFN8NW++r7Q`v+B5on6ojUee zpDv47>v1);y{MGQxX+#=Fa_l8DSNTqgt|wRMjz5j7lQ?~yd`y(kNJ>hE1W^vU^=}h zFm)UmiDFTFyhMF*0%?e8VU?A3x=6nmOj!lxk#XgssmS2Wf-<@T$VdqVthRQ__ypFB zC1Q9O25<<01P)AHdDMkE<@`$?g$buwtbx{u8j9=}ZKvO4+U~L9@#~F+q<`k%+-mHh zVy&qbst_ zlptE>h_r)Q5&}yI*+5KrRx*o0O&qur2;e^@A5G6>V??CEFcHxskpRc=K0U=w6h>=_ zsrLTP!^d0e3kcT+0a!vQ5(@qgiJB;|z#B0m@vr=+(>{m>Bh#9VWo4`V`0S`V$rU~N zUCDYvcBlk=EMjcrqU{1fK~@$BU+L3gG#&TyrQQhMTbPl;xz*l~=oFL+`LPU_gs7GK z9rqLb^U)pBVc-|oXBJ7^L3Cp@Tv~DaG82r#qnxAf<){1kX}>pugMv_bX}~5Gv-=K_ zf)*pfPq>OOh7*%T_fVrP&;}5l78>E4v{d#H0ntw|t{n|gE7(5 z9nh49XfG!Zi=jd2=IzS{#Ch;Dl8s4gYIo-TbTZ-*3q|+^2x5Q(819nDB|20xwd@f{ zRAQ?a!V}ylv6j(=g1a)8ID(AL*qAs~!vf1um0T6@I)c@jS#)7P5R9#WTm$huWYJuQ z*c*2dL{4eAd_Ld6Kb%66YWTO~TxS+ax{x1VpNV(r($8ay-rf zAt}KV--G4`CNLvi4$>e^VVxZGE9}BkUxm4G+aRJ8j4zyWg^}%IXT5{^=P07 z{Q&-PYS;?15YJv#a5Ew8xiR}^IMUhiU1QoyYiik4J&IttxB`Q5CjfB?4P=BcYM71s z05;)iA{1n{P~$G0PTC@ppiwZWi_`7^=l~5Nc%Q>57%w3_L|Ys<9B@lHHzghyn@k%X z*3Rfs6)^>xjt8UZ6z-{vMEMui20Lz_p>;%t5sP6^fhMz@Lyp0D#EbQU1`y7QPr)=8 z8gK-Hn3X>QK1pRpT+hg#zMjvX_F))eV)Ga;5!Z}>KjNVZ4^q;AIAN6o0Jw`-(VPg?v3yTzB0`6e(^U7p5m@#)BfSp ztlP^FuWH{vgh<5!I(m`=x)4D@QN(r?wokCsXNb0xv&H0MkS{%%!V97=q4EoR1{#?3 zC)0@p!-@-p4o+P$I-Z=Lr$Qv@qgDFxXh80Ty z*5>mZ4l`Xzv66`s##bSFhokdF$6n*yPTYCg3S}|QrwAzYhjV5qgC;t9IXI@DosSm~m^+WUn1+6! zc_L)p0?q(}jk#+BWf~a3mo|`{PJk`Dz#8LOsw>J6)1)oDu4iBfuvwN8VoSONS`GL{ zh1Km3Aa|R~%ke5?5>OmW*kmTvB#a2k##B}!?w=8y2n=e{tkr%55+vPJrHyh?kTu@3 z$XZ}w=K0{?-{eOq{V6S33XzqprKLMr3A|sQV)Yj}g#3-hP5UD4h*?U%QPv;Cc#=WPFjn&)i)Px1VftBq?~{X;GN1ugxSek5~ntZB`2 zj&)ai%QCMv-T@{t@^`fHp4Q0*Ty6Z1nh`j%AivR&>@q7=*8WX2kyfFx>_#ZrLTsRQ zoyW-VyIQh3Cf{L7tNYVQ9TVYDH?wl<%5L!vbt6$73s1`C0;1h)&4>Mzh zR-}91s?qpMNy+xkAWcgt-0h^Fr3XsCnVB(N(%A57lRQZ3oR$o)e=Vs?ci>@ESDBKS zNjdmN)HozT8UR<5I!=Pwg?a?uWr0i7<$fVR3+Sr~GyE+SwoQDzP}wkEQfVIs-Q4W(2#L@hCx zw5$&H-DowiQIpd3q?EQaEX>G{N7^TOPP7QZ11H<=8GTrZ6j&nAs52Re0@TFVpP+)~ z_rLgOR~ldE`ATeoKmRYk#*wz?!19mr9CF)f^|wHfXgo8~Pv`XhhuYgH{dch`7|XVe z_(SP^?fS23Mu>F4O|6z)t;|1{kZfcz5*i*Cf)Z2xN(sQIsKe@Rr{d#t%WxteNEz3bHoLL4^)rGOc58T5EKM3d ztK3Gpo~+hP6zgYWTEA4-%CyLrXLsa^>nK(-ycjH2XQdQ_X4YB1RB1_vFvF|K4Btzj zPVpjxg?_bA8!Xn+FlZ&ii(!H#)L-X(RkCpj5Rp_t%XHdEe4#ESx0Ku4I??|G-~GYw zDIb3W&Sb*JrKe02z9DQaP?BM7F*d&~^t%eFl}yT8%ak-_p+OrNq}I=nUfWOL4zs5O zU|VOS7@n+@YO!<+j2vb}5cdTCQbm0`+Kd^o5eU?}eiSuMBn0YPNu90B`lZksjtw8y z&q@Znl^$SBe3d4FiVOqR&r0dO8M9cOjrnZ=gTHNs)9P$*tn~e)?k$~N1Z$XGP#wgZ zm0r_+R{D;Xgnz5{svsnY#gy99I@?nll>N%u?*+kaT0JOnuXu!w~u#$8S)L0=_W%ioOJ!a*G?Jyvc?sL`MV@0CP zY=lr-G9EFAA13_-vw>yJ^|F@V)0W@Tl{zh1T{@-0RvB z_t7}Pn_6ea@Lhm|er7q->MKY2ds;Hp{D)eyQC?3*`Q-AIn^c~+^1+;yb4^u@5L5p~ z=eD)3Y004cyINY&t^+L@%>Q0X*6%;efqC9uf2u`U(Y?&lo;PZYXLr+GVp z^+ZdyOSUfy+VbD(M*s1Ik>Z%mmy=YG+81&y1Ro^pdx^>=j0-v9t;X`=nimqCJFL3qwdS=} zYxDhGq}ocHTihoG;}ITRw6g?!PH_makGLx`$rsCv8vBk9&2Yn)_w(V@3b?4YwzIu| z&}!mj2+94o?tX*`w>J3o;YX{jCQ@+m70;SY*QJp4dUK)G++>?&X~QHtO{+{> zth33AAI4hXJej9gK7m$-dccOaD-92E!X}wEano(KT+(SV>-H#Q1S6?ZPO;=h6%#3V zl+E-Prm<<#KIbY=i)Dq$nXjyePxSDXu(w(VKiXYyH9ZV(yS??boxO+GTFoZYoBbI* z!tVZ<9yM~aq)fkUH6==q{X|+)t9kA-;q<;E@O|i?=ru(Ft+ygwR?S zBp^Y~xZO&SLD0DO|xIX(jVu zlo!miVDmg&Pv;>w`Qhy*2`-Wd4GErOtj^+_={a(jAjNk`=a-{xPj1B47rChscCETk zda;6AwQ+xIe;vrz4dL{if}4TGErC^eDPjp1t-+^drjFdAklT~~%wHB>-SNVx?`_*g zW`8V@6i|T;)EOx*wIXbT0m1zQAlPqqKq^-eI#osju`CEJU~l)4q*e-n>;eOJ45zqPr+{uBSE`ffN@J01kp_J%(KH zMWh`Z^(WarugAN6$wJB2aOp8`lO{z~N8R}~^kswN+3}?fOxatkH)4kwhE&c;j@-Gi z@qJYgt!WNNHn*qv>K)>jYV^cWe!$;Op_|+qy)`wqrL@0y~)V)gC74aT+8q*Tc zBC7~6G|VQbfFQ&-WD65OZE30kq>TK5xMto13=E{F_!I{boJ|ijv`r~8 zk7*a+4)IIqvYV#M#H24LDe?g>-C)9Ja)(9dk`0P^y7Th${N%EEm`Wn1l5H_k`S%3? zRCIv8loN?XqD|f|@(%2E)kz*%`~KtSlsH7l?u&hVKU!r0dsdBi|ga z$Y7>4u6F1xkyrp^yiWTB*^_*`4PQ8tfm7)`W?Mtf_2~ZALFew>$jSt@2ML?X-s<&> znk-ATDPM5^0?a4Uw|c*^)hx~bCT~9QiUlv(cJUq(e)sOn?Ul&q>d%TYvwZ-sq-L_~ zkcLfahfuHQ;|`ME1mPxvlt4u1qelG*F?Yt<@o)`TY5B1F<@bq!_1kS#9@Oj^)v_inu zVBYu^{Sj~e)p3C#FENlKx46_rmntKQJL4Tm5!Rb(z3!mrFR-eJRp?192#8QE{rJ|$ zG~8LbasP%$@1`s*Zc`BHH1B8IQjOW5l=foKTKO%va$CweUZtq5y|LdEw(14z2XnA{^Ybb02+d&_WFCHO3mYHe_%NhC&;pWV%zp@`K_vUQ&)mQkblpYn>`R$4Rq?ys^FogcwAB0IXYiuxD- z&Bv+edn#7se;wGnJnxD8E2TjyCdzzQ@kpwAO|I|Eii*@nKvpwiiscIyX725Kt=T)F zT3YdOGU2nWjYU^Ljg+#Z)vVEr8;C^+i!AdMH8dB36D$$Q4pOBN7#2K$LpUNCSXCmm zl$f{VB!rAn0bWKklNbj`dgpCHDplSYfhf~E{)ju6V(5<4iukPaMl*ZMQZ$yXc%}xP%2Yqzt4Lrr`mi4qd69S%?83<3o+b z7N`!$9tbJxWWWyvlK#PNZ49P(0hC<@OKl?CC}Vgof?(PXYb*(Omd<&FL|=8rJC|Z) z5hT6CZ7+E!2>`^v)b#;g@*ordWZMfPz^1m8>#`qS{^%m)RSG%11CN!kZV3_1HTAW- z60Ghsa8x4Za+)Y(8-cB>+#cQ|QDf);*>lX>8fzigyCf7Ccd-Bf|CH?P#d@$SR)Nm$ zkz7%NY#t*$U%r<;ynAbV_a5(-vkQ-4c)3dYumFZHe(*qFLP27{yyWd$*!Mb=nXQag zqzr9Q@*?(e)hx*4N?Jvj z7GW%yjHscCNAiN{IMMtPgP?UFRg?J|i=9vwd+GVGS~ZW^6Q|cN z)6wI~gZHTiiJj&2kH7~p;cKx)Tq0+T&j2>d*9xV20(Pvuf~Q7Jyzsp{UW?4yjiu5U zL1+o1lwzNEg(D>~^tZc8AJZ!aV@@3Qheo7A9I;DSL1YI{e!P&c=KdM*c>WMoz17OZCU_#q#Mg=30HKRH@L6x& z+bz5i1hE#b0aw7ez9qLJ8?uO3eE!_OeFPkr;f)sjcs4pdj@8+Gqz1yK_XE49=B(2D zMQ@whGymsad!cmXlD&lojw_{Hp1G8Bhqj@3v?fe}F3n^pA(MH-$bn$VimYZ+Buvgkk1|f0b zCr#BOX%gx=c4W!})3VbX;*1Fsc*7>iOTVzyRoe8kUrL>_Ve2k(Et*VV80UC>gO9~u zK2Xg2To=`j30F@Im+$Y4k56RAem_v^cO9U$$N3ZJ_Ho-@sDQH%*=`jRFXU|C9UEYr z{Q?B)(k{neYLQ5Qp;Q^ED$y&jH-l>-BF9HjIoE0&H1!q!yz>RRCY(3RsANew1B-&I z{#mOT9}Wb;SDv&|v_aqNKr)V(0`ZZ>NVP`*QgmiENDFpuz*yn|El0=kam0lXx0sPLBB*YPw6suVif`0Tq63sx*vFRZ1 zE-EbrmyZ$33a@bWsUAN5yz<)Rr!YDRX$QOw8kEslOkK-M?dnoX&srEDG-|*a-588O zZ2`;h#_EkyCrZd{e~qA2MUbfe)It!|BwLJA3W3Iasw14D;-wJbjS70cq)^%pSZoD=+8#(S3q=4fx)zg~ zCh`y9sm?sv+(;iu4wM(LT<$!Z&LbjKW(J(-GyN_+;TzADok3IBcG!N%LaHDN(WFo# z2AV$5w9fR|hnokF(kELxJG<$Vwfll2Pisy3PKsaAW2rTx7!GaeAjNHyAaapD8Qs$;wR`DP7_+?{wQa3Ny08NYr6{J8C1ir;ntKyR= z^v&>@B2^Am^rhu|(Rg50dAB&zdiVlFd&fWDg6Q#0D+F5=Z#jyy+wBeTavLq+8OXwq z*yJx9A(7YR*(qQAi7g3jG8n^q{U;}IH1h1jN)<@&Lq2~r`}~n1JI@ddJHq?Ml0iBA zBYBQr63DY>{i4rzlA#UFa&H{T(IjOAk0%MA;$N5H4QFf(kjSGoqq7&ShF17jw-`ZX zcG5q>QBi=H%)vuBAj4P8E?VhZm-tdEHyNF*{W2j6Or?&tS_1XCgjKm2ryP*1O=j9F zu=HniRBG0WKJf&&!V*9VKpfD*uQs_F35yrXNFAmcnNj)il}X510cmh9!*B-RP1C3nXdFquwh%p{Tsq*6G1L2>l?rIF!m zo-q3AWYI5Q6un?AUtAKs#8SSbAX2jVqH;)k*V_bM3@I4~Zz-jC1ZCn2J}>gOE8aE8 z+^D-k{hSm3D&}75&`>u~8ULy}G9JEPun*&hRd?Z+=EV4EB{4sQ{*#vk>urzP+$v~& z?~M4nm^H6V#)+CZq)5L+crXfcF{3IkeHFZ4nCawYZ=1qE@n>qHxk8$;$$!m$LK>8xPb9p_%lDaYW2rmx;$I}~ioy-KUC5Q+ zac|JbM>8ZY5?uMl6Y`J!F$AByDRsRQF-UFvt(=KHBm54k9imx0sRElNT<|1L^^bB` zx*j#L%cG7E{z&+gcR^=*Q$v|#FoSspK22+uTo#H6`N>iM?SEWIkV3Vj^WU)Gjg)S* zqiCSs?-P}nf&r2cLrL%Y>8^y+8mkofg1!cwW=I|5m6=7jO#G_jn|_&T!wY!+QXD)z zzMMKhiTz+eF_1pM_2`&m;+1q((HJZ&q1LDY7^#SeavRQnTFo#T2^_bN($ zt16IJf#Y#%Ip^a1j$*W>OHL#R2R6P)X;w(qsz4MT9)s^o$q41hydjKKxO$S%7h!_!I}iG+f_T(g>No z%q9b2>C@DEmUGSEL23({ZNx)zMFtHQ1Va%3qO9uPqwi-=MKZJNNuZy`_%;u5h>55UU|_`6zy zSt3?W8@$q#u#*Bz$$EJ=+*&XVW`QBh88dMmSn&iUTq?Q)tV|hH(L4uKtiOy#eZiH+ zkU(c#zSI@J)L3WZZbZaIbsJh9ETmjj!*M(T#fiY_=M7-b@L(|Wyir$DEPZkOreze0 zc_KGJSFcm-<m^s)9T!XWpV@NJvdKhbkN4Y3Tv_;-NDb;tWE=!$h;fQZX<=NRPZGrRRV~!K`J2Kf>d!ojiz~56BDHyLTk{1 zLc#i@@fToDgj(2**;f?kmIqnn@kUh7l5PoLu@J(2if^ro&@J*JJ`dCu7MrSYY2d_^ zOL_LCnN*)kCE~nepJz;^vjwtFyfF)J0)u6yg6Cb|J4B4VcB>`7h?}Fu*J>3AO|fU< z1EJN2&WIMUJ!EW9_fX}Xsl(D3e>ifd&mC|HZ0 zHa!@H+#-f^(3|H%i6RhWwCDR!O}Ilu41Gy3K>E&<2-)s3U&<>FG3P%GSoEA<6HvCB z0m&O$UND;~GJ$d?U~0orW3q0Ezr8ocYk=Ny%N_`m327!nNuo2k3A$~y zW`|403(S@BoN3MCS2aZC;rj)Ls8VAg3QvjvE`RuiD&sA z&iTSS#>_>S7IS{BH5{TtL5Dm1x@MTsUp`IGuj*wt^j9!ZkE9TOYNbLB!CbPOZm~~3 zKec@olm&rBX9E9x+T=xrw345EVx7i1%P^-`nr59K5fMKV#Cv&V^lW1~l%M?8xK!%D zudHaK50|SorpPS5CN5T6NdUy7WcWvTUELBcV&PDimS;NR9sD8=kMq?hgew^C49nZ* zbj5zWeVl^V1L`m-fI?^!3W%>RL}5h=d|4n02#TSGZzDtjZW{`G;~)weT6j$h%R0gx zD`~^mt%PU-y1k)Ot=y8*n_9P`{q9=HrY3fPoZHfpP@$lJ5GoXOd_skS4o|31FhB?v zOF9I>VyOg+r4lTb?iyHO6Lt~CwbujkSL1LGlPJawC)*E2`0~dYiKo-nguX?$x&9tW zUu#!-1O{wdfcpgsU;k-}m9~I)-~TFz^QWy=3Xdw>0v8I_X1ae8Z1w znRz;_uLX7tT)v+X5aD;&1F*{hTFK6<^t|nRGF5|Xc@TFE)0VE94jwNE)a_Tp+>EZ1 zpQk^{`Lnw6Ba7uSKqUsK Date: Wed, 7 Dec 2016 17:44:01 +0400 Subject: [PATCH 388/580] ocat fixed --- src/tools/ocat/OCatCmd.Mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/ocat/OCatCmd.Mod b/src/tools/ocat/OCatCmd.Mod index 030011a1..3d76a745 100644 --- a/src/tools/ocat/OCatCmd.Mod +++ b/src/tools/ocat/OCatCmd.Mod @@ -2,7 +2,7 @@ MODULE OCatCmd; (* J. Templ, 13-Jan-96 *) (* looks at the OBERON search path and writes one or more Oberon or ascii texts to standard out *) - IMPORT Args, Console, Files := Files0, Texts := Texts0; + IMPORT Args, Console, Files, Texts; PROCEDURE Cat*; VAR path: ARRAY 128 OF CHAR; i: INTEGER; T: Texts.Text; R: Texts.Reader; ch: CHAR; tab: BOOLEAN; From ada56e2770150a74484ed9da69b25e230382a4e1 Mon Sep 17 00:00:00 2001 From: norayr Date: Wed, 7 Dec 2016 17:44:45 +0400 Subject: [PATCH 389/580] Beautifier converted to plain ascii file. --- src/tools/beautifier/Beautifier.Mod | Bin 36838 -> 23291 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/src/tools/beautifier/Beautifier.Mod b/src/tools/beautifier/Beautifier.Mod index 27abc010490318052e684530ba1f4311ab124f8d..0a822d43ed96fe02f2dd5bde0f10ac5ed5eff6fd 100644 GIT binary patch literal 23291 zcmd5^`%fEJ+WtL%#SxVnlY%#pq-|hZDRE3eA%K8vT2)!em~pUTJji20(eCDN|DNZ4 z-*cN8o6z0tw~<;r=lb4n=gho0eD!v}?_L&z>-l&zE@s<~{~kQpdvkPneCl?}$$5WL zTvluNIi2Ir;aM>&r}%q4Uvnq(*?9T^t*6Bw^PSn?vasLy^S5zvQ_S$=O)xB0{(klAHabpT^S8p`T<4KHDTecLId$vqb#Z%B&d%MV zRgBx?xD7v!1NWxq#dKa9)#tEHKP-+arsn{?Huxn6KWPp=n-znPjo}9zy&gco+6Sfk zXfUp?yX&ercQ+Ts)L}DMj@%qna^uQjwc$l^E@+(Il)a0=?C=U}0qc{i;fv9{m>o_h zw`jrQY?(|BuPQulf`F&L9rb~}r^Qe1xZgWGeuXCINS!VB;`sQ*Z*JqUJKS---51BC zs&m81psKdq$u9W1cR&{O4_oVPe&NHydMr&N=fzU*=_s4h-@@3Rf|8k_+9==iYLfA#jb?>gAhecbYWtKi&t?mB?30eT(m zRY3f*|I6M1;OiY8{nmkiee4qNRf7DnD`>i{pLF5_;3%tS`(J?)z4G!B(o!if*qS0- zb&rd|c`@TI&JoJt<$Nn(=!O?tMo|v~`nlN#H-ERg2VMGHb&GQDzI7e;{p=pEx>twj zg~*2;2=(wnAokOS7vS$oX9a^>2D-f+OyGz|EADi+e*ly14YO)XL1gEw2*{y8Mk>*#^DMHU#~K1)zQl^_zs&dE`?Nm}Dm+DiiyVY+IoLjt-E4slFbW zT4wtCW-$9$oU8M8omJIJ_48f%6YS)tE${HVI($2r=}%NP4I8@Yf*m0j1^g3;aj>^9 z>hY<2UJdKd-6`yV+dC14r~7AuFT9rdGQLC9v%x?;P{u?9+p^URR|;N6h=cN=M1XYb zIyKW&UM23~toX1-U%%z{4-ep@PGN|+HsS)Eo~?N_m{mpZ@_c_hEz}q;Fnx%@WIDn# zZx{VDEuH#rzxSG(k7*DM0&451g>Ptvq;Gk?0G9o6HRtHy3cW=}TaI+<%BdKnv+In; zlcL2ItD(*p5QE+VRkYi1&DT3EV7sQAxj)w2ZDc|aJ6VFFmx#eZal>ddz`EvE`sd?$ z_heqq3U_h~-+9^X!KD=|BAnvelllA^Cd-IXa|aoO;P|l&Fu_L%R}KgB;%!yTR6#nA z*93GKB|1XTEKu$O(vD!T=0<6F-DTsh%@k+rIRHrrxF-@r_#oulWOt&7U^tmgSgUT$ zx?yB@jt`%&yk;THZuCZ|(GT1bhzN}ZU1PG@iVG57t#nu7%HFj40ee#z)p=*-3}eP| zm;ex{&J}mKL-+JzTy-)i>kEx_p$t~ALAX|1CmAEwxGoNvth~KChYMIJC5a}q`FWpm zLbH;QtvZ${OER>nO)9HCkewA*lfe)yglAHngPl&5Ai|%a^`V&iYD7IeVhY^|C|so# zosi5Su=Hh#5Kw}Vqw%bov*0kmpD4`^9x28*&~t{aVXbXPBgAF>iw<@ym#NZjScq*#h%|~ z2>|fs@RfTeg$|l+p-*QF@!R-8cH++`&%)2A@=FRrzmMNbg$4;Ma8E*ZUB@EvFjSH| zaSiOZ5MYeSwt6MeeUH_U{TFwg;In16DF8Xa^34Mv z9;Bs_R014jN-GpA|MY=Qim>MY29+Pl0>rnR$23hCgEE!kTnjn`abJ34)*RqVV+Ws` zy%v)i%}Zu=)as+=tGQF%Z%U5QG(ELM1o1&?d(Mj?77Vr|dgb8-9p0v|{;8_&@2t5B z*?%-f5V1D5yMv;NDAsoLiR4z*3Jz~@Ze0SK_ksYX$I8c;=$@t)I^lZ(F2pf zfo6YBXE58WDx-Ai<|Pf}SS%3ACzi!&OsbYo5@W4fpd3_NEA?=C-T`ANI<|NHrQ3FCFH(3C5jzt8$qK%YnT&LZxT%EsEM3LQl!i3Vv&GC z$nQvT-=m{@<<)KHrh9gc-0Cdon)X>V0f2Rn=7>B*3Ijn&Y(#(QLt;Zu*X1k}(sf%9 zt?eK9xih(jGXZ3%xG$+dVOL>UA_ZDD8;{&gp#@4v!exmKd*pF)#(-y(_mw8ikUVO3!)`QfMu@-3Uxb*c#Q+tf z`g=bS49K>d0E?6PUGzvGOMv708p9#1ARhc)#9`Y7Wm=e%NHHqMm!e{Aw)LUUs1Su?KCPMYOQJ#eLNtMtemm4b_p9n8KT(wOp__m9v z{ECCGfQ3{8Aa*dA$7E_W7I2?+`>0ZpZ)?J7bVwNCNkTxDP%g}%i8Qs2b=8Q0w^O<4 z5CboiPNb$zWNJ0h`Wk6^-bJVWGio?%=Ln1yOr zoh(7HHE{rWa5}pN`iJG7;2%xz%rm4^v9J&QMEhttqTdzd7oslj| zQD`1$5&W5U$lDtrcmy**HJeM48ZYAu0rtx%=l9F0rNEkXe}qnK9l>&T(PBqTPv$s>Y51viW3kRMRsX=DRk$d zw;Xti1_@BEO`yb$(Q(#cMe(%AfYCvc`KOt?7fCT^wod?0Mu&?iKvtkhggBePb^sr- z{szP+(v5VNA&e{~vLw=UH7m~sXSl^vT_HQGQ1+kS6sYD%!Ih!i!$%MONdadmAH@$t zS;OrRc4Zm^fMVE`2TD3GwMuCW!jwFOSu5)Xu^}8G$elE07;#1#fg?|p?5#0#fjFn4 z42pt}QUq_8<_HI!YSZlk9(73^$bg4`TmM0!XT=SjOwebJTc$4Br=~@43@G|2!b|6J z$!JtUNcOZk0^&z`0iY|h;sYX&*$RbM&LmV!637*{1teA$fi`9_zJScj=#UWEBObyh zab*eyT~_AFB+IRS~>}?|NrK5R75-${psibR=bIqi{?c2b% z^t>k6)_9IC))NLqmy(rYbda7Uy{!fx;1uHpNgUVUo(M8!_fPkC{I_F=ncX+#c|1n~ z1Qbq@pZbx22d9Cpne=eyvfKaT3Wfql$9@V5^GQ?{x#0U3Ex8wyVIA7os#i`XgR81Y zHv2~e1jpi6`=}56%jU&{0Kap>1?nfo1^?m1g~Wo8B$@efad}c)j^WG7DX!lM3%o2) zNSK@J<-2A~!}7ujjszf~X)J>iKOTemn~1KMA*~NL#bAlETVk6}?>Z;bZ75E#bdXC~ zpO3X{yJ?>mME#isx0t8R$$_OvW$8&obV6(c=lO8^Vb-HH$dewyQe}>Y%SRyI+*!P0 zYbH9a0}T>-=q06Go2`4@5dj%Q>Au(%azGQ@hIqrf!z%Kq@?0uRNNs|^1e?fZj8Rsd zf@?HZNx2Y@u)5;%vAKCa-vI4wwCwHVO>%9{n`%S9rTCy>Eiv=-&V8r>DQ;AMn;OLl z3!Po+hJ=E$i;+-Js{<{fmg9l?bKam=hV!;}d#Ag3%l_fvQQp#fAyiA`6Wm0is8pxo z^IslqDe1E*Oa^OHd?DCNM{A%KSx`GZvEUhM57S`Up3oSQ@)>;^p(XH!BvTER!0rLb zO@Qp2Nj_SDnHagupk)pbJt)9NYe(0prmbQ1mb=D~jD0=7mSJ%Z_ZGdx9quaI;J@pJ z>U_u@5;5RmoL%s}pGT^+xSQVk!(FSz9;fD;Vr>~wMnXzl4Bp230^Tq7`5c5m1+m>` z+{*ziNU~r!%}h2@B~ft6Z)#KvX1RW}xl}h(%?#QtB(1x(=+ewHFjL}Tm%UpdXBz6U&1j^+{`Q0}23UjOWyaO*VZ3qtq1)2?|z1awt%dnBE~F87iQaLS5E zUYe&Y$$U!5OA$8Sjj7k zWkd$IVr3x>Ev-Vv|A)xhH)Rw^2PV_7M3WD4JhaAlbZ`PT|RoJtHHo6?d-a|GB#z)H_Sw9=)WJLtdb6bOWi?qzu{q7(*p5#%3_ zKU^T0D!T8;;-m{Q{EqFr&Gy}tF+~?e$MZ>TWiGTU?RXEP=zbbk<1-zj*Xfnca%4?| z#A9m$sm+Rz&j-Lo(3K~wiKO0%7julSjFwQgdoeyoF*d+XQ_8bhki~a2(N6^H9)vLe z&?JSf(Qd>+Js(WP&?No}0ajkk(-=BxXjT<7U4itG%MRJ<^`uyTS)SiU$!j&dk^&j- z5oQ`zoX(=)VD>$?N+#q>ZL}`dVxiSaeNFq^YMl+{9hQt}gm8I6sT2v6*-uO3NLWRs zmJ>DWcI_q2$S^gj$-1bos}jwvn8#os?&lI}`Ndlm@8by)+kTYZ;f00Iw#$COcVNrw zxj#0wYe~WDc_{6)iW(a{TPt>SQS>i*y5%pB28Wg@G~du}EMh~0DG3pO17yAMFBhz6 zSq4MA?+HAnuwmgHgcO*ERt6K$9?K?!OE`xM{bHMB5rbB* zu8knuRrmtHxA+>sV94uWd@FF^v>Up73G29{5);d^QLB{uvZ4STTxGK4h_&>*LzsKF(A5g|~)Yo~%&^&n?a zR{n~014UPU&Yp0Don~NOWgzd8(-=u|fTE&GxA`QM%kOOUPJkK}P`qa^#zZJ$0?Y%} z2o%J5)uj!8$-4cyyYBH#*7q%*lJaQ{gC>N0t2l1Fwsf|SBXj(Tn*RueN^g|TT)b7f zeJ?oTp$h>2n^qx$!4RAjiFg_ibAL7>aU=K;c{k_1H(SOA9R1CReo{~Ihdy_)J<-fu0h_wX zlW!c>T;BJDyP>T?3tL2+6$gAYB`L$)tNg#{k`)-bp#E>HTcVdy^lSHow1X6;LM8W` zEZ#XO1~VA*`Ngcf{=mOQQjg^aV;J^?`fH|qfEP3K4{A`UDOBno7=0%Gft|K3c%B#C2P(W;$Dg0-Yw#Kdz8-li{n?(n7c@gbs}4%yworzjC5-lUhE`jtpw5 zLj<~7jX-B0>yU&`-aOgiK^Uw9`bPPyO4>T5mFjas!2 zev}gIUU#zhD&FVYNC5I2%kRxZAzyF{CTe~|sC65aLhs$%G~Fw4(9}$S&B<5)%SAsA zXqmOLh{sdIs{57h8hS$HRYJSDdHbhX_@%c}5lDnD zgec-j7yctRPCa7x;PC(Ool{CjxXss)kXU`sy8fIXejSmcx$|bjOII#){G8=3KZS|= z{{_0Nv>dC-!Bv~P!}Z$vt%SU>9JzBnmG7RK@5@UXo14CvicdCZ`Btu`;!;gA5{Oy^_ojv=p+0aPw9{?dC#0y&Bfmg%>;tBBtk4Ol_)2?WKzwi6b zx#!%v<)pi(M-wHfI`{nh&Ue25=R3Fl*Oh~NjmDMzi{YgEeEC+k-y3Ed!%3sj_;dJo zx2BXXxzv59@-wW@yu{n8(-H!nrQNh zukJ_F{kqQccUa$O{CO?$Axdf8U(vds^5bgb?l;iHz`WW(fu(P1-5=rOYksoBFxl0{ zpVj)`L_2`Bpe0Pi(tjtQR~z5f(y!ww{{9&){XcDq7HqkprElQ_bMnLbmGJzg)=7t} z9EknCflsvjEquk_-_?GLTKAcjzV&sf`&(N2ms*F$jm97T^+u!pUVd>t8XvV=2Pgf) zjq@G~h3k#5iTz>W`orVV__RCekA|*$IGRq}XqdaF+9`9J6Ng^YB0oY)_o!Q(9AvFl zTSr{;gG^3B7uR{P{_f`XqTAiuSzCYjcyE2t<&$2vfL^^pwver3=?hpHues|FSL@~$Jy+1md4s!Qkbadg)`;!x=;Ov~`Lj|dG zzOV{39VXB|m}2o?A+(1t3+?v$hn>TP)mfi!6JnH2IHul){PP)S#FnfZE3Jiy%!O@q30R6W| zlm2l(A6GEoANz$x*c<1?WJH4R9+Oi{LIC}vvD@CH*V1j_`lCkMto z{5}!32{M{QW)iso?_h-|c^@L7l!Yb*r-kPolln`0BJZ=7%JI2EX-R|T&1HA5dI_!yl`Puy}`_a$c(mU>Fx3X;c z*3YpJ@DP+j{|QtP)?4H~PyvW&I6XZC-*F2;BCZ7iU_u!K8ZJa?6q7C_H^ph@4o>o- z>f&8)4bLE;ePk@ zY;Sb#-gdh?o7)HLd+uPz-QU~0|0CD=;qLmo@8AFE;pY46+xwe4+wP{@d-uWa=11#W z`a?D)Z8&4s ztwsYEISic=RIGn#nY4KZ_EAKd49cF3gTcKxVroAo*g7 z?S0^Kn2%ST*dcxo4q$++I&RBw#D4eOgPonN_50iUkOmF4**)V9qkZg|D>tp{*fWP6 zlrNnC3}7lt0iguuG7{Wy-Ja8f>Fv%zt=Iz^?^(;W95|k%V`;#9O?$8ZhIx;s7sLTH zwTjrT+GB*v8CM!6Cx2T z<~NsHD%74i15lX-)&&oOa6(=*KE# zEXstg+gEJ3_tZ6Xo&EO~O8(1-J($Fp76O9$qCc7zV&sjm(_`?;6LAA59^FL_j6sPM zkS3gdQ@pRuAvi946>b}QzEatyOfhP55UJ81?LSzmz%h1lh8#wnsNDRZF&km zRSU=C(Wx6}XCtvp3VwlYb&PG}Bt-aROxFm}|=rEt0Q`OBl&xE5txdBf`d}`Pne}E--AZYpCDvJmfhOfMkwh3q`AKR z(D}}*t%uXo(+dhOacjX5AQ{l3I4c04v{%g(fQ3LhIqDZ@gYE^$=={Vxjnpp|V^IH5 zC<=oiv_m6>2;1$Bi+t_$XiE&`xFk|)jy{RpUN4^n4RFN8NW++r7Q`v+B5on6ojUee zpDv47>v1);y{MGQxX+#=Fa_l8DSNTqgt|wRMjz5j7lQ?~yd`y(kNJ>hE1W^vU^=}h zFm)UmiDFTFyhMF*0%?e8VU?A3x=6nmOj!lxk#XgssmS2Wf-<@T$VdqVthRQ__ypFB zC1Q9O25<<01P)AHdDMkE<@`$?g$buwtbx{u8j9=}ZKvO4+U~L9@#~F+q<`k%+-mHh zVy&qbst_ zlptE>h_r)Q5&}yI*+5KrRx*o0O&qur2;e^@A5G6>V??CEFcHxskpRc=K0U=w6h>=_ zsrLTP!^d0e3kcT+0a!vQ5(@qgiJB;|z#B0m@vr=+(>{m>Bh#9VWo4`V`0S`V$rU~N zUCDYvcBlk=EMjcrqU{1fK~@$BU+L3gG#&TyrQQhMTbPl;xz*l~=oFL+`LPU_gs7GK z9rqLb^U)pBVc-|oXBJ7^L3Cp@Tv~DaG82r#qnxAf<){1kX}>pugMv_bX}~5Gv-=K_ zf)*pfPq>OOh7*%T_fVrP&;}5l78>E4v{d#H0ntw|t{n|gE7(5 z9nh49XfG!Zi=jd2=IzS{#Ch;Dl8s4gYIo-TbTZ-*3q|+^2x5Q(819nDB|20xwd@f{ zRAQ?a!V}ylv6j(=g1a)8ID(AL*qAs~!vf1um0T6@I)c@jS#)7P5R9#WTm$huWYJuQ z*c*2dL{4eAd_Ld6Kb%66YWTO~TxS+ax{x1VpNV(r($8ay-rf zAt}KV--G4`CNLvi4$>e^VVxZGE9}BkUxm4G+aRJ8j4zyWg^}%IXT5{^=P07 z{Q&-PYS;?15YJv#a5Ew8xiR}^IMUhiU1QoyYiik4J&IttxB`Q5CjfB?4P=BcYM71s z05;)iA{1n{P~$G0PTC@ppiwZWi_`7^=l~5Nc%Q>57%w3_L|Ys<9B@lHHzghyn@k%X z*3Rfs6)^>xjt8UZ6z-{vMEMui20Lz_p>;%t5sP6^fhMz@Lyp0D#EbQU1`y7QPr)=8 z8gK-Hn3X>QK1pRpT+hg#zMjvX_F))eV)Ga;5!Z}>KjNVZ4^q;AIAN6o0Jw`-(VPg?v3yTzB0`6e(^U7p5m@#)BfSp ztlP^FuWH{vgh<5!I(m`=x)4D@QN(r?wokCsXNb0xv&H0MkS{%%!V97=q4EoR1{#?3 zC)0@p!-@-p4o+P$I-Z=Lr$Qv@qgDFxXh80Ty z*5>mZ4l`Xzv66`s##bSFhokdF$6n*yPTYCg3S}|QrwAzYhjV5qgC;t9IXI@DosSm~m^+WUn1+6! zc_L)p0?q(}jk#+BWf~a3mo|`{PJk`Dz#8LOsw>J6)1)oDu4iBfuvwN8VoSONS`GL{ zh1Km3Aa|R~%ke5?5>OmW*kmTvB#a2k##B}!?w=8y2n=e{tkr%55+vPJrHyh?kTu@3 z$XZ}w=K0{?-{eOq{V6S33XzqprKLMr3A|sQV)Yj}g#3-hP5UD4h*?U%QPv;Cc#=WPFjn&)i)Px1VftBq?~{X;GN1ugxSek5~ntZB`2 zj&)ai%QCMv-T@{t@^`fHp4Q0*Ty6Z1nh`j%AivR&>@q7=*8WX2kyfFx>_#ZrLTsRQ zoyW-VyIQh3Cf{L7tNYVQ9TVYDH?wl<%5L!vbt6$73s1`C0;1h)&4>Mzh zR-}91s?qpMNy+xkAWcgt-0h^Fr3XsCnVB(N(%A57lRQZ3oR$o)e=Vs?ci>@ESDBKS zNjdmN)HozT8UR<5I!=Pwg?a?uWr0i7<$fVR3+Sr~GyE+SwoQDzP}wkEQfVIs-Q4W(2#L@hCx zw5$&H-DowiQIpd3q?EQaEX>G{N7^TOPP7QZ11H<=8GTrZ6j&nAs52Re0@TFVpP+)~ z_rLgOR~ldE`ATeoKmRYk#*wz?!19mr9CF)f^|wHfXgo8~Pv`XhhuYgH{dch`7|XVe z_(SP^?fS23Mu>F4O|6z)t;|1{kZfcz5*i*Cf)Z2xN(sQIsKe@Rr{d#t%WxteNEz3bHoLL4^)rGOc58T5EKM3d ztK3Gpo~+hP6zgYWTEA4-%CyLrXLsa^>nK(-ycjH2XQdQ_X4YB1RB1_vFvF|K4Btzj zPVpjxg?_bA8!Xn+FlZ&ii(!H#)L-X(RkCpj5Rp_t%XHdEe4#ESx0Ku4I??|G-~GYw zDIb3W&Sb*JrKe02z9DQaP?BM7F*d&~^t%eFl}yT8%ak-_p+OrNq}I=nUfWOL4zs5O zU|VOS7@n+@YO!<+j2vb}5cdTCQbm0`+Kd^o5eU?}eiSuMBn0YPNu90B`lZksjtw8y z&q@Znl^$SBe3d4FiVOqR&r0dO8M9cOjrnZ=gTHNs)9P$*tn~e)?k$~N1Z$XGP#wgZ zm0r_+R{D;Xgnz5{svsnY#gy99I@?nll>N%u?*+kaT0JOnuXu!w~u#$8S)L0=_W%ioOJ!a*G?Jyvc?sL`MV@0CP zY=lr-G9EFAA13_-vw>yJ^|F@V)0W@Tl{zh1T{@-0RvB z_t7}Pn_6ea@Lhm|er7q->MKY2ds;Hp{D)eyQC?3*`Q-AIn^c~+^1+;yb4^u@5L5p~ z=eD)3Y004cyINY&t^+L@%>Q0X*6%;efqC9uf2u`U(Y?&lo;PZYXLr+GVp z^+ZdyOSUfy+VbD(M*s1Ik>Z%mmy=YG+81&y1Ro^pdx^>=j0-v9t;X`=nimqCJFL3qwdS=} zYxDhGq}ocHTihoG;}ITRw6g?!PH_makGLx`$rsCv8vBk9&2Yn)_w(V@3b?4YwzIu| z&}!mj2+94o?tX*`w>J3o;YX{jCQ@+m70;SY*QJp4dUK)G++>?&X~QHtO{+{> zth33AAI4hXJej9gK7m$-dccOaD-92E!X}wEano(KT+(SV>-H#Q1S6?ZPO;=h6%#3V zl+E-Prm<<#KIbY=i)Dq$nXjyePxSDXu(w(VKiXYyH9ZV(yS??boxO+GTFoZYoBbI* z!tVZ<9yM~aq)fkUH6==q{X|+)t9kA-;q<;E@O|i?=ru(Ft+ygwR?S zBp^Y~xZO&SLD0DO|xIX(jVu zlo!miVDmg&Pv;>w`Qhy*2`-Wd4GErOtj^+_={a(jAjNk`=a-{xPj1B47rChscCETk zda;6AwQ+xIe;vrz4dL{if}4TGErC^eDPjp1t-+^drjFdAklT~~%wHB>-SNVx?`_*g zW`8V@6i|T;)EOx*wIXbT0m1zQAlPqqKq^-eI#osju`CEJU~l)4q*e-n>;eOJ45zqPr+{uBSE`ffN@J01kp_J%(KH zMWh`Z^(WarugAN6$wJB2aOp8`lO{z~N8R}~^kswN+3}?fOxatkH)4kwhE&c;j@-Gi z@qJYgt!WNNHn*qv>K)>jYV^cWe!$;Op_|+qy)`wqrL@0y~)V)gC74aT+8q*Tc zBC7~6G|VQbfFQ&-WD65OZE30kq>TK5xMto13=E{F_!I{boJ|ijv`r~8 zk7*a+4)IIqvYV#M#H24LDe?g>-C)9Ja)(9dk`0P^y7Th${N%EEm`Wn1l5H_k`S%3? zRCIv8loN?XqD|f|@(%2E)kz*%`~KtSlsH7l?u&hVKU!r0dsdBi|ga z$Y7>4u6F1xkyrp^yiWTB*^_*`4PQ8tfm7)`W?Mtf_2~ZALFew>$jSt@2ML?X-s<&> znk-ATDPM5^0?a4Uw|c*^)hx~bCT~9QiUlv(cJUq(e)sOn?Ul&q>d%TYvwZ-sq-L_~ zkcLfahfuHQ;|`ME1mPxvlt4u1qelG*F?Yt<@o)`TY5B1F<@bq!_1kS#9@Oj^)v_inu zVBYu^{Sj~e)p3C#FENlKx46_rmntKQJL4Tm5!Rb(z3!mrFR-eJRp?192#8QE{rJ|$ zG~8LbasP%$@1`s*Zc`BHH1B8IQjOW5l=foKTKO%va$CweUZtq5y|LdEw(14z2XnA{^Ybb02+d&_WFCHO3mYHe_%NhC&;pWV%zp@`K_vUQ&)mQkblpYn>`R$4Rq?ys^FogcwAB0IXYiuxD- z&Bv+edn#7se;wGnJnxD8E2TjyCdzzQ@kpwAO|I|Eii*@nKvpwiiscIyX725Kt=T)F zT3YdOGU2nWjYU^Ljg+#Z)vVEr8;C^+i!AdMH8dB36D$$Q4pOBN7#2K$LpUNCSXCmm zl$f{VB!rAn0bWKklNbj`dgpCHDplSYfhf~E{)ju6V(5<4iukPaMl*ZMQZ$yXc%}xP%2Yqzt4Lrr`mi4qd69S%?83<3o+b z7N`!$9tbJxWWWyvlK#PNZ49P(0hC<@OKl?CC}Vgof?(PXYb*(Omd<&FL|=8rJC|Z) z5hT6CZ7+E!2>`^v)b#;g@*ordWZMfPz^1m8>#`qS{^%m)RSG%11CN!kZV3_1HTAW- z60Ghsa8x4Za+)Y(8-cB>+#cQ|QDf);*>lX>8fzigyCf7Ccd-Bf|CH?P#d@$SR)Nm$ zkz7%NY#t*$U%r<;ynAbV_a5(-vkQ-4c)3dYumFZHe(*qFLP27{yyWd$*!Mb=nXQag zqzr9Q@*?(e)hx*4N?Jvj z7GW%yjHscCNAiN{IMMtPgP?UFRg?J|i=9vwd+GVGS~ZW^6Q|cN z)6wI~gZHTiiJj&2kH7~p;cKx)Tq0+T&j2>d*9xV20(Pvuf~Q7Jyzsp{UW?4yjiu5U zL1+o1lwzNEg(D>~^tZc8AJZ!aV@@3Qheo7A9I;DSL1YI{e!P&c=KdM*c>WMoz17OZCU_#q#Mg=30HKRH@L6x& z+bz5i1hE#b0aw7ez9qLJ8?uO3eE!_OeFPkr;f)sjcs4pdj@8+Gqz1yK_XE49=B(2D zMQ@whGymsad!cmXlD&lojw_{Hp1G8Bhqj@3v?fe}F3n^pA(MH-$bn$VimYZ+Buvgkk1|f0b zCr#BOX%gx=c4W!})3VbX;*1Fsc*7>iOTVzyRoe8kUrL>_Ve2k(Et*VV80UC>gO9~u zK2Xg2To=`j30F@Im+$Y4k56RAem_v^cO9U$$N3ZJ_Ho-@sDQH%*=`jRFXU|C9UEYr z{Q?B)(k{neYLQ5Qp;Q^ED$y&jH-l>-BF9HjIoE0&H1!q!yz>RRCY(3RsANew1B-&I z{#mOT9}Wb;SDv&|v_aqNKr)V(0`ZZ>NVP`*QgmiENDFpuz*yn|El0=kam0lXx0sPLBB*YPw6suVif`0Tq63sx*vFRZ1 zE-EbrmyZ$33a@bWsUAN5yz<)Rr!YDRX$QOw8kEslOkK-M?dnoX&srEDG-|*a-588O zZ2`;h#_EkyCrZd{e~qA2MUbfe)It!|BwLJA3W3Iasw14D;-wJbjS70cq)^%pSZoD=+8#(S3q=4fx)zg~ zCh`y9sm?sv+(;iu4wM(LT<$!Z&LbjKW(J(-GyN_+;TzADok3IBcG!N%LaHDN(WFo# z2AV$5w9fR|hnokF(kELxJG<$Vwfll2Pisy3PKsaAW2rTx7!GaeAjNHyAaapD8Qs$;wR`DP7_+?{wQa3Ny08NYr6{J8C1ir;ntKyR= z^v&>@B2^Am^rhu|(Rg50dAB&zdiVlFd&fWDg6Q#0D+F5=Z#jyy+wBeTavLq+8OXwq z*yJx9A(7YR*(qQAi7g3jG8n^q{U;}IH1h1jN)<@&Lq2~r`}~n1JI@ddJHq?Ml0iBA zBYBQr63DY>{i4rzlA#UFa&H{T(IjOAk0%MA;$N5H4QFf(kjSGoqq7&ShF17jw-`ZX zcG5q>QBi=H%)vuBAj4P8E?VhZm-tdEHyNF*{W2j6Or?&tS_1XCgjKm2ryP*1O=j9F zu=HniRBG0WKJf&&!V*9VKpfD*uQs_F35yrXNFAmcnNj)il}X510cmh9!*B-RP1C3nXdFquwh%p{Tsq*6G1L2>l?rIF!m zo-q3AWYI5Q6un?AUtAKs#8SSbAX2jVqH;)k*V_bM3@I4~Zz-jC1ZCn2J}>gOE8aE8 z+^D-k{hSm3D&}75&`>u~8ULy}G9JEPun*&hRd?Z+=EV4EB{4sQ{*#vk>urzP+$v~& z?~M4nm^H6V#)+CZq)5L+crXfcF{3IkeHFZ4nCawYZ=1qE@n>qHxk8$;$$!m$LK>8xPb9p_%lDaYW2rmx;$I}~ioy-KUC5Q+ zac|JbM>8ZY5?uMl6Y`J!F$AByDRsRQF-UFvt(=KHBm54k9imx0sRElNT<|1L^^bB` zx*j#L%cG7E{z&+gcR^=*Q$v|#FoSspK22+uTo#H6`N>iM?SEWIkV3Vj^WU)Gjg)S* zqiCSs?-P}nf&r2cLrL%Y>8^y+8mkofg1!cwW=I|5m6=7jO#G_jn|_&T!wY!+QXD)z zzMMKhiTz+eF_1pM_2`&m;+1q((HJZ&q1LDY7^#SeavRQnTFo#T2^_bN($ zt16IJf#Y#%Ip^a1j$*W>OHL#R2R6P)X;w(qsz4MT9)s^o$q41hydjKKxO$S%7h!_!I}iG+f_T(g>No z%q9b2>C@DEmUGSEL23({ZNx)zMFtHQ1Va%3qO9uPqwi-=MKZJNNuZy`_%;u5h>55UU|_`6zy zSt3?W8@$q#u#*Bz$$EJ=+*&XVW`QBh88dMmSn&iUTq?Q)tV|hH(L4uKtiOy#eZiH+ zkU(c#zSI@J)L3WZZbZaIbsJh9ETmjj!*M(T#fiY_=M7-b@L(|Wyir$DEPZkOreze0 zc_KGJSFcm-<m^s)9T!XWpV@NJvdKhbkN4Y3Tv_;-NDb;tWE=!$h;fQZX<=NRPZGrRRV~!K`J2Kf>d!ojiz~56BDHyLTk{1 zLc#i@@fToDgj(2**;f?kmIqnn@kUh7l5PoLu@J(2if^ro&@J*JJ`dCu7MrSYY2d_^ zOL_LCnN*)kCE~nepJz;^vjwtFyfF)J0)u6yg6Cb|J4B4VcB>`7h?}Fu*J>3AO|fU< z1EJN2&WIMUJ!EW9_fX}Xsl(D3e>ifd&mC|HZ0 zHa!@H+#-f^(3|H%i6RhWwCDR!O}Ilu41Gy3K>E&<2-)s3U&<>FG3P%GSoEA<6HvCB z0m&O$UND;~GJ$d?U~0orW3q0Ezr8ocYk=Ny%N_`m327!nNuo2k3A$~y zW`|403(S@BoN3MCS2aZC;rj)Ls8VAg3QvjvE`RuiD&sA z&iTSS#>_>S7IS{BH5{TtL5Dm1x@MTsUp`IGuj*wt^j9!ZkE9TOYNbLB!CbPOZm~~3 zKec@olm&rBX9E9x+T=xrw345EVx7i1%P^-`nr59K5fMKV#Cv&V^lW1~l%M?8xK!%D zudHaK50|SorpPS5CN5T6NdUy7WcWvTUELBcV&PDimS;NR9sD8=kMq?hgew^C49nZ* zbj5zWeVl^V1L`m-fI?^!3W%>RL}5h=d|4n02#TSGZzDtjZW{`G;~)weT6j$h%R0gx zD`~^mt%PU-y1k)Ot=y8*n_9P`{q9=HrY3fPoZHfpP@$lJ5GoXOd_skS4o|31FhB?v zOF9I>VyOg+r4lTb?iyHO6Lt~CwbujkSL1LGlPJawC)*E2`0~dYiKo-nguX?$x&9tW zUu#!-1O{wdfcpgsU;k-}m9~I)-~TFz^QWy=3Xdw>0v8I_X1ae8Z1w znRz;_uLX7tT)v+X5aD;&1F*{hTFK6<^t|nRGF5|Xc@TFE)0VE94jwNE)a_Tp+>EZ1 zpQk^{`Lnw6Ba7uSKqUsK Date: Wed, 7 Dec 2016 14:03:07 +0000 Subject: [PATCH 390/580] Silly me, it's a .sh, not a .pl., temporarily have buildall pick up the new .sh. --- src/tools/make/buildall.pl | 6 +++--- src/tools/make/getbranch.pl | 14 -------------- src/tools/make/getbranch.sh | 5 +++++ 3 files changed, 8 insertions(+), 17 deletions(-) delete mode 100644 src/tools/make/getbranch.pl create mode 100644 src/tools/make/getbranch.sh diff --git a/src/tools/make/buildall.pl b/src/tools/make/buildall.pl index e8b6ac1c..b1a022a0 100755 --- a/src/tools/make/buildall.pl +++ b/src/tools/make/buildall.pl @@ -15,12 +15,12 @@ my %machines = ( "cygwin" => ['-p5932 dave@wax', "", "oberon/cygwin/voc", "export CC=gcc && make full;" . "cd ~;" . "sh start64.sh \\\"cd oberon/cygwin/voc &&" - . "src/tools/make/getbranch $branch &&" + . "src/tools/make/getbranch.sh $branch &&" . "export CC=gcc && make full;\\\""], "mingw" => ['-p5932 dave@wax', "", "oberon/mingw/voc", "export CC=i686-w64-mingw32-gcc && make full;" . "cd ~;" . "sh start64.sh \\\"cd oberon/mingw/voc &&" - . "src/tools/make/getbranch $branch &&" + . "src/tools/make/getbranch.sh $branch &&" . "export CC=x86_64-w64-mingw32-gcc && make full;\\\""], "android" => ['-p8022 root@and', "", "vishap/voc", "export CC=gcc && make full"], "lub64" => ['dave@vim', "sudo", "oberon/voc", "make full"], @@ -62,7 +62,7 @@ unlink glob "log/*"; for my $machine (sort keys %machines) { my ($login, $sudo, $dir, $mkcmd) = @{$machines{$machine}}; - my $cmd = "ssh $login \"cd $dir && src/tools/make/getbranch $branch && $sudo $mkcmd\" "; + my $cmd = "ssh $login \"cd $dir && git checkout -f && perl src/tools/make/getbranch.sh $branch && $sudo $mkcmd\" "; logged($cmd, $machine); } diff --git a/src/tools/make/getbranch.pl b/src/tools/make/getbranch.pl deleted file mode 100644 index 32ff1927..00000000 --- a/src/tools/make/getbranch.pl +++ /dev/null @@ -1,14 +0,0 @@ -#!perl -w -use strict; -use warnings; - -# Exit with a clean enlistrment in the named branch. - -my $branch = "master"; -if (defined($ARGV[0]) && ($ARGV[0] ne "")) {$branch = $ARGV[0]} - -set -x -git reset --hard # Clear the staging area -git clean -dfx # Remove all untracked files -git pull # Update the local repository -git checkout -f $branch # Switch to requested branch diff --git a/src/tools/make/getbranch.sh b/src/tools/make/getbranch.sh new file mode 100644 index 00000000..dc3b3ef4 --- /dev/null +++ b/src/tools/make/getbranch.sh @@ -0,0 +1,5 @@ +set -x +git reset --hard # Clear the staging area +git clean -dfx # Remove all untracked files +git pull # Update the local repository +git checkout -f $1 # Switch to requested branch From da1ad6e871f9450043f86fd0a54a00bc3cbeacba Mon Sep 17 00:00:00 2001 From: David Brown Date: Wed, 7 Dec 2016 14:05:04 +0000 Subject: [PATCH 391/580] I'm still making a mess of the auto build scripts. --- src/tools/make/buildall.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/make/buildall.pl b/src/tools/make/buildall.pl index b1a022a0..e16d277d 100755 --- a/src/tools/make/buildall.pl +++ b/src/tools/make/buildall.pl @@ -62,7 +62,7 @@ unlink glob "log/*"; for my $machine (sort keys %machines) { my ($login, $sudo, $dir, $mkcmd) = @{$machines{$machine}}; - my $cmd = "ssh $login \"cd $dir && git checkout -f && perl src/tools/make/getbranch.sh $branch && $sudo $mkcmd\" "; + my $cmd = "ssh $login \"cd $dir && git checkout -f && src/tools/make/getbranch.sh $branch && $sudo $mkcmd\" "; logged($cmd, $machine); } From 2e436a2d9e1f10a2f913a25984f6dad71db6db30 Mon Sep 17 00:00:00 2001 From: David Brown Date: Wed, 7 Dec 2016 14:06:39 +0000 Subject: [PATCH 392/580] More fiddling with auto build scripts. --- src/tools/make/buildall.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/make/buildall.pl b/src/tools/make/buildall.pl index e16d277d..42733f1d 100755 --- a/src/tools/make/buildall.pl +++ b/src/tools/make/buildall.pl @@ -62,7 +62,7 @@ unlink glob "log/*"; for my $machine (sort keys %machines) { my ($login, $sudo, $dir, $mkcmd) = @{$machines{$machine}}; - my $cmd = "ssh $login \"cd $dir && git checkout -f && src/tools/make/getbranch.sh $branch && $sudo $mkcmd\" "; + my $cmd = "ssh $login \"cd $dir && git pull && git checkout -f && src/tools/make/getbranch.sh $branch && $sudo $mkcmd\" "; logged($cmd, $machine); } From d18008eafa32b81b015be515646b020165ed9950 Mon Sep 17 00:00:00 2001 From: norayr Date: Wed, 7 Dec 2016 18:57:55 +0400 Subject: [PATCH 393/580] Beautifier compiled --- src/tools/beautifier/Beautifier.Mod | 86 ++++++++++++++++------------- 1 file changed, 49 insertions(+), 37 deletions(-) diff --git a/src/tools/beautifier/Beautifier.Mod b/src/tools/beautifier/Beautifier.Mod index 0a822d43..c87712d6 100644 --- a/src/tools/beautifier/Beautifier.Mod +++ b/src/tools/beautifier/Beautifier.Mod @@ -1,6 +1,6 @@ MODULE Beautifier; -IMPORT FoldElems, Fonts, Oberon, Out, Strings, TextFrames, Texts, Viewers, MenuViewers; +IMPORT Oberon, Out, Strings, Texts; CONST Tab = 09X; LF = 0DX; @@ -23,7 +23,7 @@ VAR fC, lC: ARRAY 23 OF INTEGER; hashT: ARRAY 51 OF Keyword; -PROCEDURE (VAR k: Keyword) Init (s: ARRAY 10 OF CHAR; class: SHORTINT); +PROCEDURE (VAR k: Keyword) Init (s: ARRAY (*10*) OF CHAR; class: SHORTINT); BEGIN COPY(s, k.word); k.class := class @@ -66,7 +66,7 @@ BEGIN END END END passProcHead; - +(* PROCEDURE MarkedViewer (): TextFrames.Frame; VAR v: Viewers.Viewer; BEGIN @@ -77,17 +77,17 @@ BEGIN RETURN NIL END END MarkedViewer; - +*) PROCEDURE NoNotify (t: Texts.Text; op: INTEGER; beg, end: LONGINT); END NoNotify; PROCEDURE ParseCmdLine (VAR bText: Texts.Text; VAR oldNotifier: Texts.Notifier); VAR beg, end, time: LONGINT; - f: TextFrames.Frame; + (*f: TextFrames.Frame;*) par: Oberon.ParList; s: Texts.Scanner; t: Texts.Text; - +(* PROCEDURE OpenText (fileName: ARRAY OF CHAR; VAR t: Texts.Text; VAR f: TextFrames.Frame); VAR menuF: TextFrames.Frame; v: Viewers.Viewer; x, y: INTEGER; BEGIN @@ -97,13 +97,21 @@ BEGIN Oberon.AllocateUserViewer(0, x, y); v := MenuViewers.New(menuF, f, TextFrames.menuH, x, y) END OpenText; +*) +PROCEDURE OpenText (fileName: ARRAY OF CHAR; VAR t: Texts.Text); +BEGIN + NEW(t); + Texts.Open(t, fileName); +END OpenText; BEGIN oldNotifier := NIL; par := Oberon.Par; Texts.OpenScanner(s, par.text, par.pos); Texts.Scan(s); IF s.class = Texts.Name THEN (* Called by filename *) - OpenText(s.s, bText, f) + (*OpenText(s.s, bText, f)*) + OpenText(s.s, bText) + (* ELSIF (s.class = Texts.Char) & (s.c = "*") THEN (* Called by selected viewer *) f := MarkedViewer() ELSIF (s.class = Texts.Char) & (s.c = "^") THEN (* Called by selection *) @@ -114,17 +122,18 @@ BEGIN OpenText(s.s, bText, f) END END + *) (* commented out oberon system specific parts. -- noch *) END; - IF f # NIL THEN + (*IF f # NIL THEN bText := f.text; oldNotifier := f.text.notify; bText.notify := NoNotify ELSE Out.String("Could not find TextFrames.Frame. Program aborted."); Out.Ln; HALT(99) - END + END*) END ParseCmdLine; - +(* PROCEDURE GetFontsFromText (bText: Texts.Text; VAR expNamFnt, cmtFnt: Fonts.Font); VAR r: Texts.Reader; @@ -145,7 +154,7 @@ BEGIN Strings.Insert("i", i, italicfont); cmtFnt := Fonts.This(italicfont) END GetFontsFromText; - +*) PROCEDURE UpdateText (bText: Texts.Text; oldNotifier: Texts.Notifier); BEGIN IF oldNotifier # NIL THEN @@ -273,7 +282,7 @@ BEGIN END END END IndentCheck; - +(* PROCEDURE ChangeFont (bText: Texts.Text; expNamFnt, cmtFnt: Fonts.Font); VAR s: Texts.Scanner; ch: CHAR; oPos, pos: LONGINT; exp: BOOLEAN; noExpLine: INTEGER; @@ -316,21 +325,22 @@ BEGIN END END END ChangeFont; - +*) PROCEDURE Format*; VAR - bText: Texts.Text; oldNotifier: Texts.Notifier; expNamFnt, cmtFnt: Fonts.Font; + bText: Texts.Text; oldNotifier: Texts.Notifier;(* expNamFnt, cmtFnt: Fonts.Font;*) BEGIN bText := NIL; oldNotifier := NIL; ParseCmdLine(bText, oldNotifier); IF bText = NIL THEN - Out.String("Usage: Beautifier.Format * | ^ | Filename.Mod"); Out.Ln + (*Out.String("Usage: Beautifier.Format * | ^ | Filename.Mod"); Out.Ln*) + Out.String("Usage: beautifier Filename.Mod"); Out.Ln ELSE - GetFontsFromText(bText, expNamFnt, cmtFnt); + (*GetFontsFromText(bText, expNamFnt, cmtFnt); FoldElems.ExpandAll(bText, 0, TRUE); - ChangeFont(bText, expNamFnt, cmtFnt); + ChangeFont(bText, expNamFnt, cmtFnt);*) IndentCheck(bText); - FoldElems.CollapseAll(bText, {FoldElems.tempLeft}); + (*FoldElems.CollapseAll(bText, {FoldElems.tempLeft});*) UpdateText(bText, oldNotifier) END END Format; @@ -384,16 +394,16 @@ BEGIN IF bText = NIL THEN Out.String("Usage: Beautifier.RemSemicolons * | ^ | Filename.Mod"); Out.Ln ELSE - FoldElems.ExpandAll(bText, 0, TRUE); + (*FoldElems.ExpandAll(bText, 0, TRUE);*) RemSemicolons(bText); - FoldElems.CollapseAll(bText, {FoldElems.tempLeft}); + (*FoldElems.CollapseAll(bText, {FoldElems.tempLeft});*) UpdateText(bText, oldNotifier) END END RemoveSemicolons; PROCEDURE FoldProcedures (bText: Texts.Text); - VAR s: Texts.Scanner; start, end: LONGINT; procName: ARRAY 24 OF CHAR; err: BOOLEAN; ch: CHAR; e: FoldElems.Elem; te: Texts.Elem; + VAR s: Texts.Scanner; start, end: LONGINT; procName: ARRAY 24 OF CHAR; err: BOOLEAN; ch: CHAR; (*e: FoldElems.Elem;*) te: Texts.Elem; BEGIN Texts.OpenScanner(s, bText, 0); Texts.Scan(s); @@ -404,7 +414,7 @@ BEGIN start := Texts.Pos(s); (* --- Read to end of line *) Texts.Read(s, ch); - WHILE (ch # LF) & ((s.elem = NIL) OR ~(s.elem IS FoldElems.Elem)) DO Texts.Read(s, ch) END; + WHILE (ch # LF) & ((s.elem = NIL)(* OR ~(s.elem IS FoldElems.Elem)*)) DO Texts.Read(s, ch) END; te := s.elem; (* --- find end of procedure *) @@ -420,7 +430,7 @@ BEGIN END; (* --- Check, whether Procedure has not yet been folded *) - IF (te = NIL) OR ~(te IS FoldElems.Elem) THEN + (*IF (te = NIL) OR ~(te IS FoldElems.Elem) THEN (* --- Insert FoldElems *) NEW(e); e.mode := FoldElems.expRight; e.W := FoldElems.elemW; e.H := FoldElems.elemH; e.handle := FoldElems.FoldHandler; e.visible := TRUE; Texts.WriteElem(w, e); Texts.Insert(bText, end, w.buf); @@ -428,14 +438,14 @@ BEGIN e.handle := FoldElems.FoldHandler; NEW(e.hidden); Texts.OpenBuf(e.hidden); e.visible := TRUE; Texts.WriteElem(w, e); Texts.Insert(bText, start, w.buf); Texts.OpenScanner(s, bText, end) - END + END*) END ELSIF (s.class = Texts.Name) & (s.s = "BEGIN") THEN (* Fold Module-Body *) start := Texts.Pos(s) - 1; Texts.OpenReader(s, bText, start); (* --- Read to end of line *) Texts.Read(s, ch); - WHILE (ch # LF) & ((s.elem = NIL) OR ~(s.elem IS FoldElems.Elem)) DO Texts.Read(s, ch) END; + WHILE (ch # LF) & ((s.elem = NIL)(* OR ~(s.elem IS FoldElems.Elem)*)) DO Texts.Read(s, ch) END; te := s.elem; (* --- Find end of Module *) @@ -447,7 +457,7 @@ BEGIN END END; (* --- Check, whether Procedure has not yet been folded *) - IF (te = NIL) OR ~(te IS FoldElems.Elem) THEN + (*IF (te = NIL) OR ~(te IS FoldElems.Elem) THEN (* --- Insert FoldElems *) NEW(e); e.mode := FoldElems.expRight; e.W := FoldElems.elemW; e.H := FoldElems.elemH; e.handle := FoldElems.FoldHandler; e.visible := TRUE; Texts.WriteElem(w, e); Texts.Insert(bText, end, w.buf); @@ -455,7 +465,7 @@ BEGIN e.handle := FoldElems.FoldHandler; NEW(e.hidden); Texts.OpenBuf(e.hidden); e.visible := TRUE; Texts.WriteElem(w, e); Texts.Insert(bText, start, w.buf); Texts.OpenScanner(s, bText, end) - END + END*) ELSIF (s.class = Texts.Char) & (s.c = "(") & (s.nextCh = "*") THEN passComments(s) END; @@ -470,9 +480,9 @@ BEGIN IF bText = NIL THEN Out.String("Usage: Beautifier.FoldProc * | ^ | Filename.Mod"); Out.Ln ELSE - FoldElems.ExpandAll(bText, 0, TRUE); + (*FoldElems.ExpandAll(bText, 0, TRUE);*) FoldProcedures(bText); - FoldElems.CollapseAll(bText, {FoldElems.tempLeft}); + (*FoldElems.CollapseAll(bText, {FoldElems.tempLeft});*) UpdateText(bText, oldNotifier) END END FoldProc; @@ -643,31 +653,32 @@ BEGIN IF bText = NIL THEN Out.String("Usage: Beautifier.SpaceOps * | ^ | Filename.Mod"); Out.Ln ELSE - FoldElems.ExpandAll(bText, 0, TRUE); + (*FoldElems.ExpandAll(bText, 0, TRUE);*) SpaceOperators(bText); SpaceFormParms(bText); RemSpaces(bText); - FoldElems.CollapseAll(bText, {FoldElems.tempLeft}); + (*FoldElems.CollapseAll(bText, {FoldElems.tempLeft});*) UpdateText(bText, oldNotifier) END END SpaceOps; PROCEDURE Beautify*; - VAR bText: Texts.Text; oldNotifier: Texts.Notifier; expNamFnt, cmtFnt: Fonts.Font; + VAR bText: Texts.Text; oldNotifier: Texts.Notifier; (*expNamFnt, cmtFnt: Fonts.Font;*) BEGIN ParseCmdLine(bText, oldNotifier); IF bText = NIL THEN - Out.String("Usage: Beautifier.SpaceOps * | ^ | Filename.Mod"); Out.Ln + (*Out.String("Usage: Beautifier.SpaceOps * | ^ | Filename.Mod"); Out.Ln*) + Out.String("Usage: Beautifier Filename.Mod"); Out.Ln ELSE - GetFontsFromText(bText, expNamFnt, cmtFnt); + (*GetFontsFromText(bText, expNamFnt, cmtFnt); FoldElems.ExpandAll(bText, 0, TRUE); - ChangeFont(bText, expNamFnt, cmtFnt); + ChangeFont(bText, expNamFnt, cmtFnt);*) IndentCheck(bText); RemSemicolons(bText); FoldProcedures(bText); SpaceOperators(bText); SpaceFormParms(bText); - FoldElems.CollapseAll(bText, {FoldElems.tempLeft}); + (*FoldElems.CollapseAll(bText, {FoldElems.tempLeft});*) UpdateText(bText, oldNotifier); END END Beautify; @@ -715,5 +726,6 @@ BEGIN Texts.OpenWriter(w); NEW(b); Texts.OpenBuf(b); - InitHashTable + InitHashTable; + Beautify END Beautifier. From 9f6c788219572da97e3aa0ab767a39ad5cc2e417 Mon Sep 17 00:00:00 2001 From: norayr Date: Wed, 7 Dec 2016 19:31:48 +0400 Subject: [PATCH 394/580] texts module can save plain ascii files with CloseAscii function. --- src/runtime/Texts.Mod | 80 +++++++++++++++++++++++++++++ src/tools/beautifier/Beautifier.Mod | 1 + 2 files changed, 81 insertions(+) diff --git a/src/runtime/Texts.Mod b/src/runtime/Texts.Mod index f20750d9..d6af078e 100644 --- a/src/runtime/Texts.Mod +++ b/src/runtime/Texts.Mod @@ -877,5 +877,85 @@ MODULE Texts; (** CAS/HM 23.9.93 -- interface based on Texts by JG/NW 6.12.91** Files.Rename(name, bak, res); Files.Register(f) END Close; + PROCEDURE StoreAscii* (VAR r: Files.Rider; T: Text); + VAR r1: Files.Rider; u, un: Run; e: Elem; org, pos, delta, hlen, rlen: LONGINT; ecnt, fcnt: SHORTINT; ch: CHAR; (* << *) + fno: SYSTEM.INT8; + msg: FileMsg; iden: IdentifyMsg; + mods, procs: ARRAY 64, 32 OF CHAR; + fnts: ARRAY 32 OF FontsFont; + block: ARRAY 1024 OF CHAR; + + PROCEDURE StoreElem (VAR r: Files.Rider; pos: LONGINT; e: Elem); + VAR r1: Files.Rider; org, span: LONGINT; eno: SYSTEM.INT8; + BEGIN COPY(iden.mod, mods[ecnt]); COPY(iden.proc, procs[ecnt]); eno := 1; + WHILE (mods[eno] # iden.mod) OR (procs[eno] # iden.proc) DO INC(eno) END; + Files.Set(r1, Files.Base(r), Files.Pos(r)); + Files.WriteLInt(r, 0); Files.WriteLInt(r, 0); Files.WriteLInt(r, 0); (*fixup slot*) + Files.Write(r, eno); + IF eno = ecnt THEN INC(ecnt); Files.WriteString(r, iden.mod); Files.WriteString(r, iden.proc) END; + msg.pos := pos; org := Files.Pos(r); e.handle(e, msg); span := Files.Pos(r) - org; + Files.WriteLInt(r1, -span); Files.WriteLInt(r1, e.W); Files.WriteLInt(r1, e.H) (*fixup*) + END StoreElem; + + BEGIN + org := Files.Pos(r); msg.id := store; msg.r := r; (*Files.WriteLInt(msg.r, 0)*); (*fixup slot*) + u := T.head.next; pos := 0; delta := 0; fcnt := 1; ecnt := 1; + (*WHILE u # T.head DO + IF u IS Elem THEN iden.mod[0] := 0X; u(Elem).handle(u(Elem), iden) ELSE iden.mod[0] := 1X END; + IF iden.mod[0] # 0X THEN + fnts[fcnt] := u.fnt; fno := 1; + WHILE fnts[fno].name # u.fnt.name DO INC(fno) END; + Files.Write(msg.r, fno); + IF fno = fcnt THEN INC(fcnt); Files.WriteString(msg.r, u.fnt.name) END; + Files.Write(msg.r, u.col); Files.Write(msg.r, u.voff) + END; + IF u IS Piece THEN rlen := u.len; un := u.next; + WHILE (un IS Piece) & (un.fnt = u.fnt) & (un.col = u.col) & (un.voff = u.voff) DO + INC(rlen, un.len); un := un.next + END; + Files.WriteLInt(msg.r, rlen); INC(pos, rlen); u := un + ELSIF iden.mod[0] # 0X THEN StoreElem(msg.r, pos, u(Elem)); INC(pos); u := u.next + ELSE INC(delta); u := u.next + END + END; + Files.Write(msg.r, 0); Files.WriteLInt(msg.r, T.len - delta); + (*!!!hlen := Files.Pos(msg.r) - org;*) hlen := Files.Pos(msg.r) - org + 2; + Files.Set(r1, Files.Base(msg.r), org); Files.WriteLInt(r1, hlen); (*fixup*) + *) + Files.Set(r1, Files.Base(msg.r), 0); + u := T.head.next; + WHILE u # T.head DO + IF u IS Piece THEN + WITH u: Piece DO + IF u.ascii THEN Files.Set(r1, u.file, u.org); delta := u.len; (* << LF to CR *) + WHILE delta > 0 DO Files.Read(r1, ch); DEC(delta); + (*IF ch = 0AX THEN Files.Write(msg.r, CR) ELSE*) Files.Write(msg.r, ch); (*END*) + END + ELSE Files.Set(r1, u.file, u.org); delta := u.len; + WHILE delta > LEN(block) DO Files.ReadBytes(r1, block, LEN(block)); + Files.WriteBytes(msg.r, block, LEN(block)); DEC(delta, LEN(block)) + END; + Files.ReadBytes(r1, block, delta); Files.WriteBytes(msg.r, block, delta) + END + END + ELSE iden.mod[0] := 0X; u(Elem).handle(u(Elem), iden); + IF iden.mod[0] # 0X THEN Files.Write(msg.r, ElemChar) END + END; + u := u.next + END; + r := msg.r; + IF T.notify # NIL THEN T.notify(T, unmark, 0, 0) END + END StoreAscii; + + PROCEDURE CloseAscii* (T: Text; name: ARRAY OF CHAR); + VAR f: Files.File; r: Files.Rider; i, res: INTEGER; bak: ARRAY 64 OF CHAR; + BEGIN + f := Files.New(name); Files.Set(r, f, 0); (*Files.Write(r, textTag); Files.Write(r, version);*) StoreAscii(r, T); + i := 0; WHILE name[i] # 0X DO INC(i) END; + COPY(name, bak); bak[i] := "."; bak[i+1] := "B"; bak[i+2] := "a"; bak[i+3] := "k"; bak[i+4] := 0X; + Files.Rename(name, bak, res); Files.Register(f) + END CloseAscii; + + BEGIN del := NIL; NEW(FontsDefault); FontsDefault.name := "Syntax10.Scn.Fnt" END Texts. diff --git a/src/tools/beautifier/Beautifier.Mod b/src/tools/beautifier/Beautifier.Mod index c87712d6..a8b53f2d 100644 --- a/src/tools/beautifier/Beautifier.Mod +++ b/src/tools/beautifier/Beautifier.Mod @@ -680,6 +680,7 @@ BEGIN SpaceFormParms(bText); (*FoldElems.CollapseAll(bText, {FoldElems.tempLeft});*) UpdateText(bText, oldNotifier); + Texts.CloseAscii(bText, 'test'); END END Beautify; From 886c18303e77b7bde77276a4acc5f6fcae2b6b44 Mon Sep 17 00:00:00 2001 From: norayr Date: Wed, 7 Dec 2016 19:38:07 +0400 Subject: [PATCH 395/580] added dump text functions to beautifier. --- src/tools/beautifier/Beautifier.Mod | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/src/tools/beautifier/Beautifier.Mod b/src/tools/beautifier/Beautifier.Mod index a8b53f2d..a949c5e4 100644 --- a/src/tools/beautifier/Beautifier.Mod +++ b/src/tools/beautifier/Beautifier.Mod @@ -662,6 +662,31 @@ BEGIN END END SpaceOps; +PROCEDURE TextToString(VAR T : Texts.Text; VAR string : ARRAY OF CHAR); + VAR R : Texts.Reader; + ch : CHAR; + i : LONGINT; +BEGIN + COPY("", string); + Texts.OpenReader(R, T, 0); + i := 0; + WHILE Texts.Pos(R) < T.len DO + Texts.Read(R, ch); + IF ch # 0DX THEN string[i] := ch ELSE string[i] := 0AX END; + INC(i); + END; + (*string[i] := 0X;*) +END TextToString; + +PROCEDURE DumpText(VAR t: Texts.Text); +VAR s : POINTER TO ARRAY OF CHAR; +BEGIN + NEW(s, t.len + 1); + COPY("", s^); + TextToString(t, s^); + Out.String(s^); Out.Ln; +END DumpText; + PROCEDURE Beautify*; VAR bText: Texts.Text; oldNotifier: Texts.Notifier; (*expNamFnt, cmtFnt: Fonts.Font;*) BEGIN @@ -680,7 +705,8 @@ BEGIN SpaceFormParms(bText); (*FoldElems.CollapseAll(bText, {FoldElems.tempLeft});*) UpdateText(bText, oldNotifier); - Texts.CloseAscii(bText, 'test'); + (*Texts.CloseAscii(bText, 'test');*) + DumpText(bText) END END Beautify; From e6532bfe234afa0095e1246a9b64fa0cd506ce9f Mon Sep 17 00:00:00 2001 From: norayr Date: Wed, 7 Dec 2016 19:40:08 +0400 Subject: [PATCH 396/580] reverted back Texts module changes. --- src/runtime/Texts.Mod | 82 +------------------------------------------ 1 file changed, 1 insertion(+), 81 deletions(-) diff --git a/src/runtime/Texts.Mod b/src/runtime/Texts.Mod index d6af078e..305b225d 100644 --- a/src/runtime/Texts.Mod +++ b/src/runtime/Texts.Mod @@ -341,7 +341,7 @@ MODULE Texts; (** CAS/HM 23.9.93 -- interface based on Texts by JG/NW 6.12.91** IF (ch = 0AX) & u(Piece).ascii THEN ch := CR (* << LF to CR *) ELSIF (ch = CR) & u(Piece).ascii THEN (* << CR LF to CR *) pos := Files.Pos(R.rider); Files.Read(R.rider, nextch); - IF nextch = 0AX THEN INC(R.off) ELSE Files.Set(R.rider, u(Piece).file, pos) END + IF nextch = 0AX THEN INC(R.off) ELSE Files.Set(R.rider, u(Piece).file, pos) END END ELSIF u IS Elem THEN ch := ElemChar; R.elem := u(Elem) ELSE ch := 0X; R.elem := NIL; R.eot := TRUE @@ -877,85 +877,5 @@ MODULE Texts; (** CAS/HM 23.9.93 -- interface based on Texts by JG/NW 6.12.91** Files.Rename(name, bak, res); Files.Register(f) END Close; - PROCEDURE StoreAscii* (VAR r: Files.Rider; T: Text); - VAR r1: Files.Rider; u, un: Run; e: Elem; org, pos, delta, hlen, rlen: LONGINT; ecnt, fcnt: SHORTINT; ch: CHAR; (* << *) - fno: SYSTEM.INT8; - msg: FileMsg; iden: IdentifyMsg; - mods, procs: ARRAY 64, 32 OF CHAR; - fnts: ARRAY 32 OF FontsFont; - block: ARRAY 1024 OF CHAR; - - PROCEDURE StoreElem (VAR r: Files.Rider; pos: LONGINT; e: Elem); - VAR r1: Files.Rider; org, span: LONGINT; eno: SYSTEM.INT8; - BEGIN COPY(iden.mod, mods[ecnt]); COPY(iden.proc, procs[ecnt]); eno := 1; - WHILE (mods[eno] # iden.mod) OR (procs[eno] # iden.proc) DO INC(eno) END; - Files.Set(r1, Files.Base(r), Files.Pos(r)); - Files.WriteLInt(r, 0); Files.WriteLInt(r, 0); Files.WriteLInt(r, 0); (*fixup slot*) - Files.Write(r, eno); - IF eno = ecnt THEN INC(ecnt); Files.WriteString(r, iden.mod); Files.WriteString(r, iden.proc) END; - msg.pos := pos; org := Files.Pos(r); e.handle(e, msg); span := Files.Pos(r) - org; - Files.WriteLInt(r1, -span); Files.WriteLInt(r1, e.W); Files.WriteLInt(r1, e.H) (*fixup*) - END StoreElem; - - BEGIN - org := Files.Pos(r); msg.id := store; msg.r := r; (*Files.WriteLInt(msg.r, 0)*); (*fixup slot*) - u := T.head.next; pos := 0; delta := 0; fcnt := 1; ecnt := 1; - (*WHILE u # T.head DO - IF u IS Elem THEN iden.mod[0] := 0X; u(Elem).handle(u(Elem), iden) ELSE iden.mod[0] := 1X END; - IF iden.mod[0] # 0X THEN - fnts[fcnt] := u.fnt; fno := 1; - WHILE fnts[fno].name # u.fnt.name DO INC(fno) END; - Files.Write(msg.r, fno); - IF fno = fcnt THEN INC(fcnt); Files.WriteString(msg.r, u.fnt.name) END; - Files.Write(msg.r, u.col); Files.Write(msg.r, u.voff) - END; - IF u IS Piece THEN rlen := u.len; un := u.next; - WHILE (un IS Piece) & (un.fnt = u.fnt) & (un.col = u.col) & (un.voff = u.voff) DO - INC(rlen, un.len); un := un.next - END; - Files.WriteLInt(msg.r, rlen); INC(pos, rlen); u := un - ELSIF iden.mod[0] # 0X THEN StoreElem(msg.r, pos, u(Elem)); INC(pos); u := u.next - ELSE INC(delta); u := u.next - END - END; - Files.Write(msg.r, 0); Files.WriteLInt(msg.r, T.len - delta); - (*!!!hlen := Files.Pos(msg.r) - org;*) hlen := Files.Pos(msg.r) - org + 2; - Files.Set(r1, Files.Base(msg.r), org); Files.WriteLInt(r1, hlen); (*fixup*) - *) - Files.Set(r1, Files.Base(msg.r), 0); - u := T.head.next; - WHILE u # T.head DO - IF u IS Piece THEN - WITH u: Piece DO - IF u.ascii THEN Files.Set(r1, u.file, u.org); delta := u.len; (* << LF to CR *) - WHILE delta > 0 DO Files.Read(r1, ch); DEC(delta); - (*IF ch = 0AX THEN Files.Write(msg.r, CR) ELSE*) Files.Write(msg.r, ch); (*END*) - END - ELSE Files.Set(r1, u.file, u.org); delta := u.len; - WHILE delta > LEN(block) DO Files.ReadBytes(r1, block, LEN(block)); - Files.WriteBytes(msg.r, block, LEN(block)); DEC(delta, LEN(block)) - END; - Files.ReadBytes(r1, block, delta); Files.WriteBytes(msg.r, block, delta) - END - END - ELSE iden.mod[0] := 0X; u(Elem).handle(u(Elem), iden); - IF iden.mod[0] # 0X THEN Files.Write(msg.r, ElemChar) END - END; - u := u.next - END; - r := msg.r; - IF T.notify # NIL THEN T.notify(T, unmark, 0, 0) END - END StoreAscii; - - PROCEDURE CloseAscii* (T: Text; name: ARRAY OF CHAR); - VAR f: Files.File; r: Files.Rider; i, res: INTEGER; bak: ARRAY 64 OF CHAR; - BEGIN - f := Files.New(name); Files.Set(r, f, 0); (*Files.Write(r, textTag); Files.Write(r, version);*) StoreAscii(r, T); - i := 0; WHILE name[i] # 0X DO INC(i) END; - COPY(name, bak); bak[i] := "."; bak[i+1] := "B"; bak[i+2] := "a"; bak[i+3] := "k"; bak[i+4] := 0X; - Files.Rename(name, bak, res); Files.Register(f) - END CloseAscii; - - BEGIN del := NIL; NEW(FontsDefault); FontsDefault.name := "Syntax10.Scn.Fnt" END Texts. From 1e15d47936a3cdfc2f21fe5a54cc3148b014e443 Mon Sep 17 00:00:00 2001 From: norayr Date: Wed, 7 Dec 2016 19:43:45 +0400 Subject: [PATCH 397/580] renamed to vbeautify, added makefile. -- noch --- src/tools/beautifier/makefile | 4 ++++ src/tools/beautifier/{Beautifier.Mod => vbeautify.Mod} | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 src/tools/beautifier/makefile rename src/tools/beautifier/{Beautifier.Mod => vbeautify.Mod} (99%) diff --git a/src/tools/beautifier/makefile b/src/tools/beautifier/makefile new file mode 100644 index 00000000..2108b547 --- /dev/null +++ b/src/tools/beautifier/makefile @@ -0,0 +1,4 @@ +VOC = /opt/voc/bin/voc + +all: + $(VOC) -m vbeautify.Mod diff --git a/src/tools/beautifier/Beautifier.Mod b/src/tools/beautifier/vbeautify.Mod similarity index 99% rename from src/tools/beautifier/Beautifier.Mod rename to src/tools/beautifier/vbeautify.Mod index a949c5e4..6480dbcf 100644 --- a/src/tools/beautifier/Beautifier.Mod +++ b/src/tools/beautifier/vbeautify.Mod @@ -1,4 +1,4 @@ -MODULE Beautifier; +MODULE vbeautify; IMPORT Oberon, Out, Strings, Texts; @@ -755,4 +755,4 @@ BEGIN Texts.OpenBuf(b); InitHashTable; Beautify -END Beautifier. +END vbeautify. From fd27239b2d10bec24536b5288126ee65a1184851 Mon Sep 17 00:00:00 2001 From: norayr Date: Wed, 7 Dec 2016 19:47:51 +0400 Subject: [PATCH 398/580] changed help to conform to the binary name. -- noch --- src/tools/beautifier/vbeautify.Mod | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tools/beautifier/vbeautify.Mod b/src/tools/beautifier/vbeautify.Mod index 6480dbcf..ef38edba 100644 --- a/src/tools/beautifier/vbeautify.Mod +++ b/src/tools/beautifier/vbeautify.Mod @@ -334,7 +334,7 @@ BEGIN ParseCmdLine(bText, oldNotifier); IF bText = NIL THEN (*Out.String("Usage: Beautifier.Format * | ^ | Filename.Mod"); Out.Ln*) - Out.String("Usage: beautifier Filename.Mod"); Out.Ln + Out.String("Usage: vbeautify Filename.Mod"); Out.Ln ELSE (*GetFontsFromText(bText, expNamFnt, cmtFnt); FoldElems.ExpandAll(bText, 0, TRUE); @@ -693,7 +693,7 @@ BEGIN ParseCmdLine(bText, oldNotifier); IF bText = NIL THEN (*Out.String("Usage: Beautifier.SpaceOps * | ^ | Filename.Mod"); Out.Ln*) - Out.String("Usage: Beautifier Filename.Mod"); Out.Ln + Out.String("Usage: vbeautify Filename.Mod"); Out.Ln ELSE (*GetFontsFromText(bText, expNamFnt, cmtFnt); FoldElems.ExpandAll(bText, 0, TRUE); From 442f377b7e606a7bbd661c4944d54f19c7de824b Mon Sep 17 00:00:00 2001 From: David Brown Date: Wed, 7 Dec 2016 16:29:01 +0000 Subject: [PATCH 399/580] New autobuild process --- src/tools/autobuild/build-oberon.sh | 23 +++++++++++++ src/tools/{make => autobuild}/buildall.pl | 39 ++++++++++------------- src/tools/{make => autobuild}/postpush.pl | 4 +-- src/tools/autobuild/update-webserver.sh | 9 ++++++ src/tools/make/getbranch.sh | 5 --- 5 files changed, 50 insertions(+), 30 deletions(-) create mode 100644 src/tools/autobuild/build-oberon.sh rename src/tools/{make => autobuild}/buildall.pl (74%) mode change 100755 => 100644 rename src/tools/{make => autobuild}/postpush.pl (84%) mode change 100755 => 100644 create mode 100644 src/tools/autobuild/update-webserver.sh delete mode 100644 src/tools/make/getbranch.sh diff --git a/src/tools/autobuild/build-oberon.sh b/src/tools/autobuild/build-oberon.sh new file mode 100644 index 00000000..90a37d1b --- /dev/null +++ b/src/tools/autobuild/build-oberon.sh @@ -0,0 +1,23 @@ +# Build Oberon +# +# Args +# +# $1 - whether to use sudo +# $2 - build directory +# $3 - CC + +if test "$1" = "sudo"; then sudo=sudo; else sudo=""; fi + +echo Testing: \$1="$1", \$2="$2", \$3="$3", \$sudo="$sudo" +exit + +set -x +cd $2 + +$sudo git reset --hard # Clear the staging area +$sudo git clean -dfx # Remove all untracked files +$sudo git pull # Update the local repository +$sudo git checkout -f $1 # Switch to requested branch + +export CC=$3 +$sudo make full \ No newline at end of file diff --git a/src/tools/make/buildall.pl b/src/tools/autobuild/buildall.pl old mode 100755 new mode 100644 similarity index 74% rename from src/tools/make/buildall.pl rename to src/tools/autobuild/buildall.pl index 42733f1d..f14b07ca --- a/src/tools/make/buildall.pl +++ b/src/tools/autobuild/buildall.pl @@ -10,26 +10,20 @@ my $branch = "master"; if (defined($ARGV[0]) && ($ARGV[0] ne "")) {$branch = $ARGV[0]} my %machines = ( - "pi" => ['pi@pie', "sudo", "projects/oberon/vishap/voc", "make full"], - "darwin" => ['dave@dcb', "sudo", "projects/oberon/vishap/voc", "make full"], - "cygwin" => ['-p5932 dave@wax', "", "oberon/cygwin/voc", "export CC=gcc && make full;" - . "cd ~;" - . "sh start64.sh \\\"cd oberon/cygwin/voc &&" - . "src/tools/make/getbranch.sh $branch &&" - . "export CC=gcc && make full;\\\""], - "mingw" => ['-p5932 dave@wax', "", "oberon/mingw/voc", "export CC=i686-w64-mingw32-gcc && make full;" - . "cd ~;" - . "sh start64.sh \\\"cd oberon/mingw/voc &&" - . "src/tools/make/getbranch.sh $branch &&" - . "export CC=x86_64-w64-mingw32-gcc && make full;\\\""], - "android" => ['-p8022 root@and', "", "vishap/voc", "export CC=gcc && make full"], - "lub64" => ['dave@vim', "sudo", "oberon/voc", "make full"], - "lub32" => ['dave@vim-lub32', "sudo", "oberon/voc", "make full"], - "fed64" => ['dave@vim-fed64', "sudo", "oberon/voc", "make full"], - "osu64" => ['dave@vim-osu64', "sudo", "oberon/voc", "make full"], - "ob32" => ['root@nas-ob32', "", "vishap/voc", "make full"], - "ce64" => ['-p5922 obe@www', "sudo", "vishap/voc", "make full"], - "fb64" => ['root@oberon', "", "vishap/voc", "make full"] + "pi" => ['22', 'pi@pie', 'sh build-oberon.sh sudo projects/oberon/vishap/voc gcc'], + "darwin" => ['22', 'dave@dcb', 'sh build-oberon.sh sudo projects/oberon/vishap/voc clang'], + "cygwin32" => ['5932', 'dave@wax', 'sh build-oberon.sh n oberon/cygwin/voc gcc'], + "cygwin64" => ['5932', 'dave@wax', 'sh start64.sh \'sh build-oberon.sh n oberon/cygwin/voc gcc\''], + "mingw32" => ['5932', 'dave@wax', 'sh build-oberon.sh n oberon/mingw/voc i686-w64-mingw32-gcc'], + "mingw64" => ['5932', 'dave@wax', 'sh start64.sh \'sh build-oberon.sh n oberon/mingw/voc i686-w64-mingw32-gcc\''], + "android" => ['8022', 'root@and', 'sh build-oberon.sh n vishap/voc gcc'], + "lub64" => ['22', 'dave@vim', 'sh build-oberon.sh sudo oberon/voc gcc'], + "lub32" => ['22', 'dave@vim-lub32', 'sh build-oberon.sh sudo oberon/voc gcc'], + "fed64" => ['22', 'dave@vim-fed64', 'sh build-oberon.sh sudo oberon/voc gcc'], + "osu64" => ['22', 'dave@vim-osu64', 'sh build-oberon.sh sudo oberon/voc gcc'], + "ob32" => ['22', 'root@nas-ob32', 'sh build-oberon.sh n vishap/voc gcc'], + "ce64" => ['5922', 'obe@www', 'sh build-oberon.sh sudo vishap/voc gcc'], + "fb64" => ['22', 'root@oberon', 'sh build-oberon.sh n vishap/voc gcc'] ); @@ -61,8 +55,9 @@ sub logged { unlink glob "log/*"; for my $machine (sort keys %machines) { - my ($login, $sudo, $dir, $mkcmd) = @{$machines{$machine}}; - my $cmd = "ssh $login \"cd $dir && git pull && git checkout -f && src/tools/make/getbranch.sh $branch && $sudo $mkcmd\" "; + my ($port, $login, $cmd) = @{$machines{$machine}}; + my $cmd = "scp -P $port build-oberon.sh $login:build-oberon.sh &&" + . "ssh -p $port $login \"$cmd\""; logged($cmd, $machine); } diff --git a/src/tools/make/postpush.pl b/src/tools/autobuild/postpush.pl old mode 100755 new mode 100644 similarity index 84% rename from src/tools/make/postpush.pl rename to src/tools/autobuild/postpush.pl index 5bfe0ffb..07397517 --- a/src/tools/make/postpush.pl +++ b/src/tools/autobuild/postpush.pl @@ -41,9 +41,7 @@ if ($buildneeded) { writelog "Started buildall, pid = $child."; # parent process } else { close(STDIN); close(STDOUT); close(STDERR); # child process - system 'echo Syncing voc>postpush.log'; - system '(cd voc; git reset --hard; git clean -dfx; git pull; git checkout -f ' . $branch . '; git pull; git checkout -f) >>postpush.log'; - exec 'perl voc/src/tools/make/buildall.pl ' . $branch . ' >/tmp/buildall.log'; + exec 'perl buildall.pl ' . $branch . ' >/tmp/buildall.log'; exit; } } else { diff --git a/src/tools/autobuild/update-webserver.sh b/src/tools/autobuild/update-webserver.sh new file mode 100644 index 00000000..e4fe79dc --- /dev/null +++ b/src/tools/autobuild/update-webserver.sh @@ -0,0 +1,9 @@ +# Push buildall and postpush to postpush server + +set -x +for f in postpush.pl buildall.pl; do + scp -P 5922 $f root@www:/var/lib/nethserver/ibay/githubhook/$f + ssh -p 5922 root@www "chmod +x /var/lib/nethserver/ibay/githubhook/$f" +done; +ssh -p 5922 root@www "ls -lap /var/lib/nethserver/ibay/githubhook" + diff --git a/src/tools/make/getbranch.sh b/src/tools/make/getbranch.sh deleted file mode 100644 index dc3b3ef4..00000000 --- a/src/tools/make/getbranch.sh +++ /dev/null @@ -1,5 +0,0 @@ -set -x -git reset --hard # Clear the staging area -git clean -dfx # Remove all untracked files -git pull # Update the local repository -git checkout -f $1 # Switch to requested branch From 0313c3030715ee89f0b508c869fcbd48fef72f36 Mon Sep 17 00:00:00 2001 From: David Brown Date: Wed, 7 Dec 2016 16:42:59 +0000 Subject: [PATCH 400/580] Working on build system --- src/tools/autobuild/update-webserver.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/autobuild/update-webserver.sh b/src/tools/autobuild/update-webserver.sh index e4fe79dc..b55144ca 100644 --- a/src/tools/autobuild/update-webserver.sh +++ b/src/tools/autobuild/update-webserver.sh @@ -1,7 +1,7 @@ # Push buildall and postpush to postpush server set -x -for f in postpush.pl buildall.pl; do +for f in postpush.pl buildall.pl build-oberon.sh; do scp -P 5922 $f root@www:/var/lib/nethserver/ibay/githubhook/$f ssh -p 5922 root@www "chmod +x /var/lib/nethserver/ibay/githubhook/$f" done; From 2ec543867bf0c4bb1888d04f954eec3e2e963cd9 Mon Sep 17 00:00:00 2001 From: David Brown Date: Wed, 7 Dec 2016 17:03:36 +0000 Subject: [PATCH 401/580] Working on build system --- src/tools/autobuild/build-oberon.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/tools/autobuild/build-oberon.sh b/src/tools/autobuild/build-oberon.sh index 90a37d1b..5f26c409 100644 --- a/src/tools/autobuild/build-oberon.sh +++ b/src/tools/autobuild/build-oberon.sh @@ -8,8 +8,9 @@ if test "$1" = "sudo"; then sudo=sudo; else sudo=""; fi -echo Testing: \$1="$1", \$2="$2", \$3="$3", \$sudo="$sudo" -exit +echo "" +echo === build-oberon.sh: \$1="$1", \$2="$2", \$3="$3", \$sudo="$sudo" === +echo """ set -x cd $2 From 06be24f32f45b4dd7cd492ef49a700f63071d07c Mon Sep 17 00:00:00 2001 From: David Brown Date: Wed, 7 Dec 2016 17:06:52 +0000 Subject: [PATCH 402/580] Working on build system --- src/tools/autobuild/build-oberon.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/autobuild/build-oberon.sh b/src/tools/autobuild/build-oberon.sh index 5f26c409..a2925bbc 100644 --- a/src/tools/autobuild/build-oberon.sh +++ b/src/tools/autobuild/build-oberon.sh @@ -10,7 +10,7 @@ if test "$1" = "sudo"; then sudo=sudo; else sudo=""; fi echo "" echo === build-oberon.sh: \$1="$1", \$2="$2", \$3="$3", \$sudo="$sudo" === -echo """ +echo "" set -x cd $2 From f3ff731794d9c539c222e8606b5336752c6e3cf9 Mon Sep 17 00:00:00 2001 From: David Brown Date: Wed, 7 Dec 2016 17:18:00 +0000 Subject: [PATCH 403/580] Working on autobuild. --- src/tools/autobuild/build-oberon.sh | 5 +++-- src/tools/autobuild/buildall.pl | 28 ++++++++++++++-------------- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/src/tools/autobuild/build-oberon.sh b/src/tools/autobuild/build-oberon.sh index a2925bbc..7dc5096a 100644 --- a/src/tools/autobuild/build-oberon.sh +++ b/src/tools/autobuild/build-oberon.sh @@ -5,11 +5,12 @@ # $1 - whether to use sudo # $2 - build directory # $3 - CC +# $4 - branch if test "$1" = "sudo"; then sudo=sudo; else sudo=""; fi echo "" -echo === build-oberon.sh: \$1="$1", \$2="$2", \$3="$3", \$sudo="$sudo" === +echo === build-oberon.sh: \$1="$1", \$2="$2", \$3="$3", \$4="$4", \$sudo="$sudo" === echo "" set -x @@ -18,7 +19,7 @@ cd $2 $sudo git reset --hard # Clear the staging area $sudo git clean -dfx # Remove all untracked files $sudo git pull # Update the local repository -$sudo git checkout -f $1 # Switch to requested branch +$sudo git checkout -f $4 # Switch to requested branch export CC=$3 $sudo make full \ No newline at end of file diff --git a/src/tools/autobuild/buildall.pl b/src/tools/autobuild/buildall.pl index f14b07ca..417fc07c 100644 --- a/src/tools/autobuild/buildall.pl +++ b/src/tools/autobuild/buildall.pl @@ -10,20 +10,20 @@ my $branch = "master"; if (defined($ARGV[0]) && ($ARGV[0] ne "")) {$branch = $ARGV[0]} my %machines = ( - "pi" => ['22', 'pi@pie', 'sh build-oberon.sh sudo projects/oberon/vishap/voc gcc'], - "darwin" => ['22', 'dave@dcb', 'sh build-oberon.sh sudo projects/oberon/vishap/voc clang'], - "cygwin32" => ['5932', 'dave@wax', 'sh build-oberon.sh n oberon/cygwin/voc gcc'], - "cygwin64" => ['5932', 'dave@wax', 'sh start64.sh \'sh build-oberon.sh n oberon/cygwin/voc gcc\''], - "mingw32" => ['5932', 'dave@wax', 'sh build-oberon.sh n oberon/mingw/voc i686-w64-mingw32-gcc'], - "mingw64" => ['5932', 'dave@wax', 'sh start64.sh \'sh build-oberon.sh n oberon/mingw/voc i686-w64-mingw32-gcc\''], - "android" => ['8022', 'root@and', 'sh build-oberon.sh n vishap/voc gcc'], - "lub64" => ['22', 'dave@vim', 'sh build-oberon.sh sudo oberon/voc gcc'], - "lub32" => ['22', 'dave@vim-lub32', 'sh build-oberon.sh sudo oberon/voc gcc'], - "fed64" => ['22', 'dave@vim-fed64', 'sh build-oberon.sh sudo oberon/voc gcc'], - "osu64" => ['22', 'dave@vim-osu64', 'sh build-oberon.sh sudo oberon/voc gcc'], - "ob32" => ['22', 'root@nas-ob32', 'sh build-oberon.sh n vishap/voc gcc'], - "ce64" => ['5922', 'obe@www', 'sh build-oberon.sh sudo vishap/voc gcc'], - "fb64" => ['22', 'root@oberon', 'sh build-oberon.sh n vishap/voc gcc'] + "pi" => ['22', 'pi@pie', 'sh build-oberon.sh sudo projects/oberon/vishap/voc gcc $branch'], + "darwin" => ['22', 'dave@dcb', 'sh build-oberon.sh sudo projects/oberon/vishap/voc clang $branch'], + "cygwin32" => ['5932', 'dave@wax', 'sh build-oberon.sh n oberon/cygwin/voc gcc $branch'], + "cygwin64" => ['5932', 'dave@wax', 'sh start64.sh \'sh build-oberon.sh n oberon/cygwin/voc gcc $branch\''], + "mingw32" => ['5932', 'dave@wax', 'sh build-oberon.sh n oberon/mingw/voc i686-w64-mingw32-gcc $branch'], + "mingw64" => ['5932', 'dave@wax', 'sh start64.sh \'sh build-oberon.sh n oberon/mingw/voc i686-w64-mingw32-gcc $branch\''], + "android" => ['8022', 'root@and', 'sh build-oberon.sh n vishap/voc gcc $branch'], + "lub64" => ['22', 'dave@vim', 'sh build-oberon.sh sudo oberon/voc gcc $branch'], + "lub32" => ['22', 'dave@vim-lub32', 'sh build-oberon.sh sudo oberon/voc gcc $branch'], + "fed64" => ['22', 'dave@vim-fed64', 'sh build-oberon.sh sudo oberon/voc gcc $branch'], + "osu64" => ['22', 'dave@vim-osu64', 'sh build-oberon.sh sudo oberon/voc gcc $branch'], + "ob32" => ['22', 'root@nas-ob32', 'sh build-oberon.sh n vishap/voc gcc $branch'], + "ce64" => ['5922', 'obe@www', 'sh build-oberon.sh sudo vishap/voc gcc $branch'], + "fb64" => ['22', 'root@oberon', 'sh build-oberon.sh n vishap/voc gcc $branch'] ); From dab579bdd51766658c16ce6ded2a6addf03f9240 Mon Sep 17 00:00:00 2001 From: David Brown Date: Wed, 7 Dec 2016 17:29:18 +0000 Subject: [PATCH 404/580] Working on autobuild. --- src/tools/autobuild/buildall.pl | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/src/tools/autobuild/buildall.pl b/src/tools/autobuild/buildall.pl index 417fc07c..8ec83d05 100644 --- a/src/tools/autobuild/buildall.pl +++ b/src/tools/autobuild/buildall.pl @@ -5,25 +5,23 @@ use POSIX "strftime"; use Cwd; my $branch = "master"; - - if (defined($ARGV[0]) && ($ARGV[0] ne "")) {$branch = $ARGV[0]} my %machines = ( - "pi" => ['22', 'pi@pie', 'sh build-oberon.sh sudo projects/oberon/vishap/voc gcc $branch'], - "darwin" => ['22', 'dave@dcb', 'sh build-oberon.sh sudo projects/oberon/vishap/voc clang $branch'], - "cygwin32" => ['5932', 'dave@wax', 'sh build-oberon.sh n oberon/cygwin/voc gcc $branch'], - "cygwin64" => ['5932', 'dave@wax', 'sh start64.sh \'sh build-oberon.sh n oberon/cygwin/voc gcc $branch\''], - "mingw32" => ['5932', 'dave@wax', 'sh build-oberon.sh n oberon/mingw/voc i686-w64-mingw32-gcc $branch'], - "mingw64" => ['5932', 'dave@wax', 'sh start64.sh \'sh build-oberon.sh n oberon/mingw/voc i686-w64-mingw32-gcc $branch\''], - "android" => ['8022', 'root@and', 'sh build-oberon.sh n vishap/voc gcc $branch'], - "lub64" => ['22', 'dave@vim', 'sh build-oberon.sh sudo oberon/voc gcc $branch'], - "lub32" => ['22', 'dave@vim-lub32', 'sh build-oberon.sh sudo oberon/voc gcc $branch'], - "fed64" => ['22', 'dave@vim-fed64', 'sh build-oberon.sh sudo oberon/voc gcc $branch'], - "osu64" => ['22', 'dave@vim-osu64', 'sh build-oberon.sh sudo oberon/voc gcc $branch'], - "ob32" => ['22', 'root@nas-ob32', 'sh build-oberon.sh n vishap/voc gcc $branch'], - "ce64" => ['5922', 'obe@www', 'sh build-oberon.sh sudo vishap/voc gcc $branch'], - "fb64" => ['22', 'root@oberon', 'sh build-oberon.sh n vishap/voc gcc $branch'] + "pi" => ['22', 'pi@pie', 'sh build-oberon.sh sudo projects/oberon/vishap/voc gcc ' . $branch], + "darwin" => ['22', 'dave@dcb', 'sh build-oberon.sh sudo projects/oberon/vishap/voc clang ' . $branch], + "cygwin32" => ['5932', 'dave@wax', 'sh build-oberon.sh n oberon/cygwin/voc gcc ' . $branch], + "cygwin64" => ['5932', 'dave@wax', 'sh start64.sh \'sh build-oberon.sh n oberon/cygwin/voc gcc ' . $branch . '\''], + "mingw32" => ['5932', 'dave@wax', 'sh build-oberon.sh n oberon/mingw/voc i686-w64-mingw32-gcc ' . $branch], + "mingw64" => ['5932', 'dave@wax', 'sh start64.sh \'sh build-oberon.sh n oberon/mingw/voc i686-w64-mingw32-gcc ' . $branch . '\''], + "android" => ['8022', 'root@and', 'sh build-oberon.sh n vishap/voc gcc ' . $branch], + "lub64" => ['22', 'dave@vim', 'sh build-oberon.sh sudo oberon/voc gcc ' . $branch], + "lub32" => ['22', 'dave@vim-lub32', 'sh build-oberon.sh sudo oberon/voc gcc ' . $branch], + "fed64" => ['22', 'dave@vim-fed64', 'sh build-oberon.sh sudo oberon/voc gcc ' . $branch], + "osu64" => ['22', 'dave@vim-osu64', 'sh build-oberon.sh sudo oberon/voc gcc ' . $branch], + "ob32" => ['22', 'root@nas-ob32', 'sh build-oberon.sh n vishap/voc gcc ' . $branch], + "ce64" => ['5922', 'obe@www', 'sh build-oberon.sh sudo vishap/voc gcc ' . $branch], + "fb64" => ['22', 'root@oberon', 'sh build-oberon.sh n vishap/voc gcc ' . $branch] ); From c41cb011b6cf866a5dbab86b5a4596671cd1a6f3 Mon Sep 17 00:00:00 2001 From: David Brown Date: Wed, 7 Dec 2016 17:39:17 +0000 Subject: [PATCH 405/580] Working on autobuild. --- src/tools/autobuild/buildall.pl | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/src/tools/autobuild/buildall.pl b/src/tools/autobuild/buildall.pl index 8ec83d05..323a19d3 100644 --- a/src/tools/autobuild/buildall.pl +++ b/src/tools/autobuild/buildall.pl @@ -8,23 +8,22 @@ my $branch = "master"; if (defined($ARGV[0]) && ($ARGV[0] ne "")) {$branch = $ARGV[0]} my %machines = ( - "pi" => ['22', 'pi@pie', 'sh build-oberon.sh sudo projects/oberon/vishap/voc gcc ' . $branch], - "darwin" => ['22', 'dave@dcb', 'sh build-oberon.sh sudo projects/oberon/vishap/voc clang ' . $branch], - "cygwin32" => ['5932', 'dave@wax', 'sh build-oberon.sh n oberon/cygwin/voc gcc ' . $branch], - "cygwin64" => ['5932', 'dave@wax', 'sh start64.sh \'sh build-oberon.sh n oberon/cygwin/voc gcc ' . $branch . '\''], - "mingw32" => ['5932', 'dave@wax', 'sh build-oberon.sh n oberon/mingw/voc i686-w64-mingw32-gcc ' . $branch], - "mingw64" => ['5932', 'dave@wax', 'sh start64.sh \'sh build-oberon.sh n oberon/mingw/voc i686-w64-mingw32-gcc ' . $branch . '\''], - "android" => ['8022', 'root@and', 'sh build-oberon.sh n vishap/voc gcc ' . $branch], - "lub64" => ['22', 'dave@vim', 'sh build-oberon.sh sudo oberon/voc gcc ' . $branch], - "lub32" => ['22', 'dave@vim-lub32', 'sh build-oberon.sh sudo oberon/voc gcc ' . $branch], - "fed64" => ['22', 'dave@vim-fed64', 'sh build-oberon.sh sudo oberon/voc gcc ' . $branch], - "osu64" => ['22', 'dave@vim-osu64', 'sh build-oberon.sh sudo oberon/voc gcc ' . $branch], - "ob32" => ['22', 'root@nas-ob32', 'sh build-oberon.sh n vishap/voc gcc ' . $branch], - "ce64" => ['5922', 'obe@www', 'sh build-oberon.sh sudo vishap/voc gcc ' . $branch], - "fb64" => ['22', 'root@oberon', 'sh build-oberon.sh n vishap/voc gcc ' . $branch] + "pi" => ['22', 'pi@pie', 'sh build-oberon.sh sudo projects/oberon/vishap/voc gcc ' . $branch], + "darwin" => ['22', 'dave@dcb', 'sh build-oberon.sh sudo projects/oberon/vishap/voc clang ' . $branch], + "cygwin32" => ['5932', 'dave@wax', 'sh build-oberon.sh n oberon/cygwin/voc gcc ' . $branch], + "cygwin64" => ['5932', 'dave@wax', 'sh start64.sh \'sh build-oberon.sh n oberon/cygwin/voc gcc ' . $branch . '\''], + "mingw32" => ['5932', 'dave@wax', 'sh build-oberon.sh n oberon/mingw/voc i686-w64-mingw32-gcc ' . $branch], + "mingw64" => ['5932', 'dave@wax', 'sh start64.sh \'sh build-oberon.sh n oberon/mingw/voc x86_64-w64-mingw32-gcc ' . $branch . '\''], + "android" => ['8022', 'root@and', 'sh build-oberon.sh n vishap/voc gcc ' . $branch], + "lub64" => ['22', 'dave@vim', 'sh build-oberon.sh sudo oberon/voc gcc ' . $branch], + "lub32" => ['22', 'dave@vim-lub32', 'sh build-oberon.sh sudo oberon/voc gcc ' . $branch], + "fed64" => ['22', 'dave@vim-fed64', 'sh build-oberon.sh sudo oberon/voc gcc ' . $branch], + "osu64" => ['22', 'dave@vim-osu64', 'sh build-oberon.sh sudo oberon/voc gcc ' . $branch], + "ob32" => ['22', 'root@nas-ob32', 'sh build-oberon.sh n vishap/voc gcc ' . $branch], + "ce64" => ['5922', 'obe@www', 'sh build-oberon.sh sudo vishap/voc gcc ' . $branch], + "fb64" => ['22', 'root@oberon', 'sh build-oberon.sh n vishap/voc gcc ' . $branch] ); - sub logged { my ($cmd, $id) = @_; my $child = fork; From d12393cc8cfa483ac64c7c4dedd7c96846529d34 Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 9 Dec 2016 17:47:48 +0000 Subject: [PATCH 406/580] Build to local directory and install as separate optional step. --- .gitignore | 1 + ReadMe.md | 76 +++++++--- doc/Installation.md | 35 +++-- makefile | 20 +-- src/compiler/OPM.Mod | 1 + src/compiler/extTools.Mod | 2 +- src/runtime/Modules.Mod | 58 ++++---- src/tools/autobuild/buildall.pl | 166 +--------------------- src/tools/autobuild/report.pl | 176 ++++++++++++++++++++++++ src/tools/autobuild/update-webserver.sh | 2 +- src/tools/make/addlibrary.sh | 28 ++++ src/tools/make/oberon.mk | 87 ++++++------ 12 files changed, 383 insertions(+), 269 deletions(-) create mode 100644 src/tools/autobuild/report.pl create mode 100644 src/tools/make/addlibrary.sh diff --git a/.gitignore b/.gitignore index 1c2d92dd..cce16916 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ /Configuration.Mod /Configuration.Make /build/* +/install/* /*.exe /*.obj /*.[cho] diff --git a/ReadMe.md b/ReadMe.md index b7cfc40e..a3f55f77 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -27,8 +27,16 @@ default libraries complying with the Oakwood Guidelines for Oberon-2 compilers. ## Installation -While pre-built packages are not provided, it is easy to install the Oberon compiler and libraries -with the following simple steps. +It is easy to install the Oberon compiler and libraries +with the following simple steps: + + 1. Install pre-requisites such as git, gcc, static C libraries, diff utils. + 2. Clone the repository and run 'make full'. + 3. Optionally install to a system directory such as /opt or /usr/local/share. + 4. Set your PATH variable to include the compiler binary. + +These are detailed below: + #### 1. Install prerequisites @@ -43,28 +51,57 @@ with the following simple steps. More details, including for MingW and MS C, in [**Installation**](/doc/Installation.md). -#### 2. Build and install the compiler and libraries + +#### 2. Clone and build the compiler and libraries 1. `git clone https://github.com/vishaps/voc` 2. `cd voc` -3. `[sudo] make full` +3. `make full` -Since 'make full' will install the compiler and libraries, it needs root (unix) or administrator (windows) privileges. +`make full` will create an installation directory under your local repository at voc/install. -#### 3. Set your PATH environment variable +`mmake full` runs `ldconfig` to configure the linker to find libraries in voc/install, but you +need to update your program search PATH yourself (see step 4 below). -Set your path to the installed compiler binary location as reported -by make full, e.g. -| System | Set path | -| --------- | -------------------------------------- | -| Linux | `export PATH="/opt/voc/bin:$PATH"` | -| BSD | `export PATH="/usr/local/share/voc/bin:$PATH"` | -| Windows | See [Installation](/doc/Installation.md) | -| Termux | `export PATH="/data/data/com.termux/files/opt/voc/bin:$PATH"` | + +#### 3. Optionally install to a system directory + +Run `make install` as root to copy the voc/install directory to the appropriate directory +for your OS as follows: + +| System | Where `make install` puts the installation | +| ------- | -------------------------------------- | +| Linux | `/opt/voc` | +| BSD | `/usr/local/share/voc` | +| Windows | See [**Windows installation**](/doc/WInstallation.md) | +| Termux | `/data/data/com.termux/files/opt/voc` | + +`make install` updates `ldconfg` with the new library locations. + + +#### 4. Set your PATH environment variable + +Since there are so many ways that different systems and users manage their PATHs, we leave +it to you to update your path to include the compiler binary. + +Both `make full` and `make install` display instructions on setting the path specific to your +system. + +For reference this will be: + +| Installation choice | Set path | +| --------- | -------------------------------------- | +| Just `make full` | `export PATH="your-repository-clone/install/bin:$PATH"` | +| `make install` on Linux | `export PATH="/opt/voc/bin:$PATH"` | +| `make install` on BSD | `export PATH="/usr/local/share/voc/bin:$PATH"` | +| `make install` on Windows | See [**Windows installation**](/doc/WInstallation.md) | +| `make install` on Termux | `export PATH="/data/data/com.termux/files/opt/voc/bin:$PATH"` | Also see [**Installation**](/doc/Installation.md). +The compiler finds the rest of the installation based on the location from which it is loaded. + ## A 'Hello' application @@ -99,12 +136,15 @@ Compile as follows: The -m parameter tells voc that this is a main module, and to generate an executable binary. -Execute as usual on Linux ('./hello') or Windows ('hello'). +Execute as usual on Linux (`./hello`) or Windows (`hello`). -In order to know module's interface, use "showdef" program. + +### Viewing the interfaces of included modules. + +In order to see the definition of a module's interface, use the "showdef" program. ``` - $ showdef Out.sym +$ showdef Out.sym DEFINITION Out; VAR @@ -118,12 +158,10 @@ DEFINITION Out; PROCEDURE Open; PROCEDURE Real(x: REAL; n: INT16); PROCEDURE String(str: ARRAY OF CHAR); - PROCEDURE Ten(e: INT16): LONGREAL; END Out. ``` -Also see [**Compiling**](/doc/Compiling.md). ## Licensing diff --git a/doc/Installation.md b/doc/Installation.md index 7c131005..37840f74 100644 --- a/doc/Installation.md +++ b/doc/Installation.md @@ -2,10 +2,7 @@ The Oberon compiler and libraries may be built and installed on Linux based, BSD based or Windows based systems. -Building on Linux and BSD based systems is reasonably straightforward. First make sure you have the right pre-requites like a C compiler and static libraries installed, then clone the repository and run `make full`. - -Full instructions for a Linux/BSD based build follow in the next section. - +### Windows systems Bulding on Windows is not so simple largely because there is more than one way to do it: @@ -30,8 +27,6 @@ Bulding on Windows is not so simple largely because there is more than one way t For full details about building with Cygwin or native Microsoft C environments see [**Cygwin and MSC Installation**](/doc/Winstallation.md) -The following sections provide more details for Linux based builds. - ### Building the Oberon compiler and libraries on a Linux or BSD based system @@ -42,6 +37,7 @@ This approach is for - All BSD based systems - includes macOS (Darwin) + #### 1. Install pre-requisites The build process has the following pre-requisites: @@ -63,6 +59,7 @@ Example pre-requisite installation commands: On Mac OS (Darwin) just type the git command. OS/X will tell you that it is not installed and ask if you want to install it (say yes). Note that Darwin builds always use clang, the OS will redirect attempts to use gcc to clang. + #### 2. Clone the Oberon compiler repository Create and change to a directory in which to make the compiler and clone with this command: @@ -79,8 +76,8 @@ This will create a subdirectory 'voc' which includes the following files and dir | makefile | Makefile for all BSD- and Linux- like environments. Includes tests. | | make.cmd | Makefile specifically for native Microsoft C builds. No tests. | -#### 3. Build and install the Oberon compiler and library +#### 3. Build and install the Oberon compiler and library ``` cd voc @@ -96,12 +93,9 @@ The makefile will: link the final Oberon compiler. This compiler is then used for the remaining steps. - Build the .sym file browser command `showdef`. - Build all the libraries in -O2 mode, and a subset in -OC mode. - - Install the compiler and libraries by copying them to an appropriate location for your OS. + - Create an installation directory structure local to your copy of the repository. - Run a set of confidence tests. -Since installation directories are not generally write accessible to normal users, is is necessary to run -the `make full` command from a root shell, or by using `sudo`. - The makefile will use either gcc or clang, whichever is installed. If you have both installed you can specify which to use by running either `export CC=gcc` or `export CC=clang` before the `make full` command. @@ -110,15 +104,28 @@ The makefile will use either gcc or clang, whichever is installed. If you have b If the makefile succeeds it will end with instructions on how to set your path variable so that the compiler (voc) is found. -The installation will be found at: + +#### Installing to system directories + +You may optionally install to system directories such as /opt or /usr/local/share. + +First be sure to have completed `make full` successfully. + +Then from a root prompt, or using sudo, run `make install` + +The installation will be made to: | System | Install dir | | ----------------------- | -------------------------------------- | | All types of Linux | /opt/voc | | BSD (including Darwin) | /usr/local/share/voc | -| Termux (android) | /data/data/com.termux/files/opt/voc | | +| Termux (android) | /data/data/com.termux/files/opt/voc | -The installation directory contains: +As with `make full`, `make install` will exit with instructions on how to set +your PATH. + + +#### Installation directory contentains: | Directory | Content | | --- | --- | diff --git a/makefile b/makefile index 12924600..8186e175 100644 --- a/makefile +++ b/makefile @@ -73,8 +73,8 @@ usage: @echo "" @echo " make full" @echo "" - @echo " Does a full, clean build, installs it, and runs confidence tests." - @echo " Requires root access (for the install) except on cygwin." + @echo " Does a full, clean build, and runs confidence tests." + @echo " An installation directory image is left in the local repository install directory." @echo "" @echo "Targets for building and installation:" @echo " make clean - Clean out the build directory" @@ -134,8 +134,6 @@ clean: configuration # full: Full build of compiler and libarary. full: configuration - @make -f src/tools/make/oberon.mk -s installable - @-make -f src/tools/make/oberon.mk -s uninstall @make -f src/tools/make/oberon.mk -s clean # Make bootstrap compiler from source suitable for current data model @printf "\n\n--- Compiler build started ---\n\n" @@ -153,10 +151,10 @@ full: configuration @make -f src/tools/make/oberon.mk -s library MODEL=C @printf "\n\n--- Library build successfull ---\n\n" @make -f src/tools/make/oberon.mk -s sourcechanges - @make -f src/tools/make/oberon.mk -s install + @make -f src/tools/make/oberon.mk -s makeinstalldir @printf "\n\n--- Confidence tests started ---\n\n" @make -f src/tools/make/oberon.mk -s confidence MODEL=2 - @make -f src/tools/make/oberon.mk -s showpath + @make -f src/tools/make/oberon.mk -s instructions assemble: @@ -221,14 +219,16 @@ s3: configuration +# makeinstalldir: Copy built files to local install directory +makeinstalldir: + @make -f src/tools/make/oberon.mk -s makeinstalldir + + # install: Copy built files to install directory install: configuration - @make -f src/tools/make/oberon.mk -s installable - @make -f src/tools/make/oberon.mk -s install MODEL=2 - @make -f src/tools/make/oberon.mk -s showpath MODEL=2 + @make -f src/tools/make/oberon.mk -s install uninstall: configuration - @make -f src/tools/make/oberon.mk -s installable @make -f src/tools/make/oberon.mk -s uninstall diff --git a/src/compiler/OPM.Mod b/src/compiler/OPM.Mod index de100717..e3383840 100644 --- a/src/compiler/OPM.Mod +++ b/src/compiler/OPM.Mod @@ -229,6 +229,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) LogWStr("Oberon-2 compiler v"); LogWStr(Configuration.versionLong); LogW("."); LogWLn; LogWStr("Based on Ofront by J. Templ and Software Templ OEG."); LogWLn; LogWStr("Further development by Norayr Chilingarian, David Brown and others."); LogWLn; + LogWStr("Loaded from "); LogWStr(Modules.BinaryDir); LogWLn; LogWLn; LogWStr("Usage:"); LogWLn; LogWLn; diff --git a/src/compiler/extTools.Mod b/src/compiler/extTools.Mod index 2847768e..d4bb7f84 100644 --- a/src/compiler/extTools.Mod +++ b/src/compiler/extTools.Mod @@ -67,7 +67,7 @@ PROCEDURE LinkMain*(VAR moduleName: ARRAY OF CHAR; statically: BOOLEAN; addition Strings.Append(Configuration.objflag, cmd); Strings.Append(moduleName, cmd); Strings.Append(Configuration.linkflags, cmd); - Strings.Append(Configuration.installdir, cmd); + Strings.Append(OPM.InstallDir, cmd); Strings.Append('/lib"', cmd); Strings.Append(Configuration.libspec, cmd); Strings.Append('-O', cmd); diff --git a/src/runtime/Modules.Mod b/src/runtime/Modules.Mod index 15896d21..cfa4bd77 100644 --- a/src/runtime/Modules.Mod +++ b/src/runtime/Modules.Mod @@ -112,7 +112,10 @@ MODULE Modules; (* jt 6.1.96 *) VAR i,j: INTEGER; BEGIN i := 0; j := CharCount(d); + (* Append delimiter c to d only if d is either empty or doesn not + already end in c. *) IF (j > 0) & (d[j-1] # c) THEN d[j] := c; INC(j) END; + (* Append s to d *) WHILE s[i] # 0X DO d[j] := s[i]; INC(i); INC(j) END; d[j] := 0X; END AppendPart; @@ -144,7 +147,9 @@ MODULE Modules; (* jt 6.1.96 *) PROCEDURE IsFilePresent(s: ARRAY OF CHAR): BOOLEAN; VAR identity: Platform.FileIdentity; - BEGIN RETURN Platform.IdentifyByName(s, identity) = 0 + BEGIN + (*Out.String("IsFilePresent("); Out.String(s); Out.String(")."); Out.Ln;*) + RETURN Platform.IdentifyByName(s, identity) = 0 END IsFilePresent; PROCEDURE ExtractPart(s: ARRAY OF CHAR; VAR i: INTEGER; p: ARRAY OF CHAR; VAR d: ARRAY OF CHAR); @@ -181,45 +186,50 @@ MODULE Modules; (* jt 6.1.96 *) END; END Trim; - PROCEDURE FindBinaryDir(VAR d: ARRAY OF CHAR); + PROCEDURE FindBinaryDir(VAR binarydir: ARRAY OF CHAR); TYPE pathstring = ARRAY 4096 OF CHAR; VAR - executable: pathstring; - dir: pathstring; - testpath: pathstring; - pathlist: pathstring; + arg0: pathstring; (* The command exactly as passed by the shell *) + pathlist: pathstring; (* The whole PATH environment variable *) + pathdir: pathstring; (* A single directory from the PATH *) + tempstr: pathstring; i, j, k: INTEGER; present: BOOLEAN; BEGIN IF ArgCount < 1 THEN - (* Shells and GUIs always pass the command as ARGV[0]. *) - d[0] := 0X; + (* The caller is misbehaving: Shells and GUIs always pass the command + as ARGV[0]. *) + binarydir[0] := 0X; RETURN; END; - (* First try ARGV[0] without looking at the PATH environment variable. *) - GetArg(0, testpath); Trim(testpath, executable); - Canonify(executable, d); present := IsFilePresent(d); - - IF (~present) & (~IsAbsolute(testpath)) THEN - (* ARGV[0] alone didn't work, try non-absolute ARGV[0] with every entry in path. *) + GetArg(0, arg0); (* arg0 is the command binary file name passed by the shell. *) + i := 0; WHILE (arg0[i] # 0X) & (arg0[i] # '/') DO INC(i) END; + IF arg0[i] = '/' THEN + (* The argument contains a '/', we expect it to work without reference + to the path. *) + Trim(arg0, tempstr); Canonify(tempstr, binarydir); + present := IsFilePresent(binarydir) + ELSE + (* There are no '/'s in arg0, so search through the path. *) Platform.GetEnv("PATH", pathlist); - i := 0; + i := 0; present := FALSE; WHILE (~present) & (pathlist[i] # 0X) DO - ExtractPart(pathlist, i, ":;", dir); Trim(dir, testpath); - AppendPart('/', executable, testpath); - Canonify(testpath, d); present := IsFilePresent(d) + ExtractPart(pathlist, i, ":;", pathdir); + AppendPart('/', arg0, pathdir); + Trim(pathdir, tempstr); Canonify(tempstr, binarydir); + present := IsFilePresent(binarydir) END END; IF present THEN - (* Remove trailing executable file name *) - k := CharCount(d); - WHILE (k > 0) & ~IsOneOf(d[k-1], '/\') DO DEC(k) END; - (* Chop off executable file name *) - IF k = 0 THEN d[k] := 0X ELSE d[k-1] := 0X END; + (* Remove trailing binarydir file name *) + k := CharCount(binarydir); + WHILE (k > 0) & ~IsOneOf(binarydir[k-1], '/\') DO DEC(k) END; + (* Chop off binarydir file name *) + IF k = 0 THEN binarydir[k] := 0X ELSE binarydir[k-1] := 0X END; ELSE - d[0] := 0X (* Couldn't determine binary directory. *) + binarydir[0] := 0X (* Couldn't determine binary directory. *) END END FindBinaryDir; diff --git a/src/tools/autobuild/buildall.pl b/src/tools/autobuild/buildall.pl index 323a19d3..7e74e3b7 100644 --- a/src/tools/autobuild/buildall.pl +++ b/src/tools/autobuild/buildall.pl @@ -44,6 +44,7 @@ sub logged { print $log strftime("%H.%M.%S", localtime), " ", $line; } close($pipe); + print $log strftime("%H.%M.%S", localtime), " --- Make completed ---\n"; close($log); exit; } @@ -58,165 +59,8 @@ for my $machine (sort keys %machines) { logged($cmd, $machine); } -while ((my $pid = wait) > 0) {print "Child pid $pid completed.\n";} - - -# # All builds have completed. Now scan the logs for pass/fail and build the passing report. - - -my %status = (); - -my $fn; -my $date; -my $time; -my $os; -my $compiler; -my $datamodel; -my $compilerok; -my $libraryok; -my $sourcechange; -my $asmchange; -my $tests; -my $key; -my $ver; - -sub clearvars { - $time = ""; $branch = ""; $os = ""; $compiler = ""; - $datamodel = ""; $compilerok = ""; $libraryok = ""; $sourcechange = ""; - $asmchange = ""; $tests = ""; $key = ""; $ver = ""; +system("perl report.pl $branch"); +while ((my $pid = wait) > 0) { + print "Child pid $pid completed.\n"; + system("perl report.pl $branch"); } - -sub logstatus { - my ($fn) = @_; - if ($compiler ne "") { - $status{"$os-$compiler-$datamodel"} = - [$fn, $date, $time, $os, $compiler, $datamodel, $branch, $compilerok, $libraryok, $sourcechange, $asmchange, $tests]; - } - clearvars(); -} - -sub parselog { - ($fn) = @_; - clearvars(); - open(my $log, $fn) // die "Couldn't open build log $fn."; - while (<$log>) { - if (/^([0-9\/]+) ([0-9.]+) .+\.log$/) {$date = $1} - if (/^([0-9.]+) /) {$time = $1} - # 19.39.58 Configuration: 1.95 [2016/07/14] for gcc LP64 on centos - if (/^[^ ]+ Configuration: ([0-9a-zA-Z.]+) \[[0-9\/]+\] for (.+) *$/) { - logstatus($fn); - $ver = $1; - printf "--- Config for $fn: $1 for $2.\n"; - } - if (/^[^ ]+ --- Cleaning branch ([^ ]+) ([^ ]+) ([^ ]+) ([^ ]+) ---$/) { - ($branch, $os, $compiler, $datamodel) = ($1, $2, $3, $4, $5); - } - if (/^([0-9.]+) --- Compiler build started ---$/) {$compilerok = "Failed";} - if (/^([0-9.]+) --- Compiler build successfull ---$/) {$compilerok = "Built";} - - if (/^([0-9.]+) --- Library build started ---$/) {$libraryok = "Failed";} - if (/^([0-9.]+) --- Library build successfull ---$/) {$libraryok = "Built";} - - if (/^([0-9.]+) --- Generated c source files match bootstrap ---$/) {$sourcechange = "Unchanged";} - if (/^([0-9.]+) --- Generated c source files differ from bootstrap ---$/) {$sourcechange = "Changed";} - - if (/^([0-9.]+) --- Generated code unchanged ---$/) {if ($asmchange eq "") {$asmchange = "Unchanged"}} - if (/^([0-9.]+) --- Generated code changed ---$/) {$asmchange = "Changed"} - - if (/^([0-9.]+) --- Confidence tests started ---$/) {$tests = "Failed";} - if (/^([0-9.]+) --- Confidence tests passed ---$/) {$tests = "Passed";} - } - close($log); - logstatus($fn); -} - -opendir DIR, "log" // die "Could not open log directory."; -my @logs = readdir DIR; -closedir DIR; - -for my $logname (sort @logs) { - $logname = "log/" . $logname; - #print "Consider $logname\n"; - if (-f $logname) {parselog($logname);} -} - -my $fontheight = 12; -my $lineheight = 15; - -sub svgtext { - my ($f, $x, $y, $colour, $msg) = @_; - print $f ''; - print $f $msg; - print $f "\n"; -} - -sub colourfor { - my ($str) = @_; - if ($str eq "Failed") {return "#e03030";} - if ($str eq "Changed") {return "#ff9d4d";} - return "#5adb5a"; -} - -my $rows = keys %status; - -my $width = 710; -my $height = ($rows+2.2) * $lineheight; - -open(my $svg, ">build-status.svg") // die "Could not create build-status.svg."; -print $svg '\n"; -print $svg '', "\n"; - -my $col1 = 20; -my $col2 = 97; -my $col3 = 160; -my $col4 = 220; -my $col5 = 280; -my $col6 = 330; -my $col7 = 380; -my $col8 = 440; -my $col9 = 490; -my $col10 = 570; -my $col11 = 650; - -svgtext($svg, $col1, 0, "#e0e0e0", "Date"); -svgtext($svg, $col3, 0, "#e0e0e0", "Branch"); -svgtext($svg, $col4, 0, "#e0e0e0", "Platform"); -svgtext($svg, $col7, 0, "#e0e0e0", "Compiler"); -svgtext($svg, $col8, 0, "#e0e0e0", "Library"); -svgtext($svg, $col9, 0, "#e0e0e0", "C Source"); -svgtext($svg, $col10, 0, "#e0e0e0", "Assembler"); -svgtext($svg, $col11, 0, "#e0e0e0", "Tests"); - -my $i=1; -for my $key (sort keys %status) { - my ($fn, $date, $time, $os, $compiler, $datamodel, $branch, $compilerok, $libraryok, - $sourcechange, $asmchange, $tests) = @{$status{$key}}; - print $svg ''; - svgtext($svg, $col1, $i, "#c0c0c0", $date); - svgtext($svg, $col2, $i, "#c0c0c0", $time); - svgtext($svg, $col3, $i, "#c0c0c0", $branch); - svgtext($svg, $col4, $i, "#c0c0c0", $os); - svgtext($svg, $col5, $i, "#c0c0c0", $compiler); - svgtext($svg, $col6, $i, "#c0c0c0", $datamodel); - svgtext($svg, $col7, $i, colourfor($compilerok), $compilerok); - svgtext($svg, $col8, $i, colourfor($libraryok), $libraryok); - svgtext($svg, $col9, $i, colourfor($sourcechange), $sourcechange); - svgtext($svg, $col10, $i, colourfor($asmchange), $asmchange); - svgtext($svg, $col11, $i, colourfor($tests), $tests); - print $svg ''; - $i++; -} - -print $svg "\n"; - -system 'chmod +r log/*'; -system 'scp build-status.svg dave@hub:/var/www'; -system 'scp log/* dave@hub:/var/www/log'; diff --git a/src/tools/autobuild/report.pl b/src/tools/autobuild/report.pl new file mode 100644 index 00000000..ba457a75 --- /dev/null +++ b/src/tools/autobuild/report.pl @@ -0,0 +1,176 @@ +#!perl -w +use strict; +use warnings; +use POSIX "strftime"; +use Cwd; + +my $branch = "master"; +if (defined($ARGV[0]) && ($ARGV[0] ne "")) {$branch = $ARGV[0]} + +print "--- Running build status report on branch $branch.\n"; + +my %status = (); + +my $fn; +my $date; +my $time; +my $os; +my $compiler; +my $datamodel; +my $compilerok; +my $libraryok; +my $sourcechange; +my $asmchange; +my $tests; +my $key; +my $ver; + +sub clearvars { + $time = ""; $branch = ""; $os = ""; $compiler = ""; + $datamodel = ""; $compilerok = ""; $libraryok = ""; $sourcechange = ""; + $asmchange = ""; $tests = ""; $key = ""; $ver = ""; +} + +sub logstatus { + my ($fn) = @_; + if ($compiler ne "") { + $status{"$os-$compiler-$datamodel"} = + [$fn, $date, $time, $os, $compiler, $datamodel, $branch, $compilerok, $libraryok, $sourcechange, $asmchange, $tests]; + } + clearvars(); +} + +sub parselog { + ($fn) = @_; + clearvars(); + open(my $log, $fn) // die "Couldn't open build log $fn."; + $branch = "Build on $fn started"; + while (<$log>) { + if (/^([0-9\/]+) ([0-9.]+) .+\.log$/) {$date = $1} + if (/^([0-9.]+) /) {$time = $1} + # 19.39.58 Configuration: 1.95 [2016/07/14] for gcc LP64 on centos + if (/^[^ ]+ Configuration: ([0-9a-zA-Z.]+) \[[0-9\/]+\] for (.+) *$/) { + logstatus($fn); + $ver = $1; + printf "--- Config for $fn: $1 for $2.\n"; + } + if (/^[^ ]+ --- Cleaning branch ([^ ]+) ([^ ]+) ([^ ]+) ([^ ]+) ---$/) { + ($branch, $os, $compiler, $datamodel) = ($1, $2, $3, $4, $5); + } + if (/^([0-9.]+) --- Compiler build started ---$/) {$compilerok = "Started";} + if (/^([0-9.]+) --- Compiler build successfull ---$/) {$compilerok = "Built";} + + if (/^([0-9.]+) --- Library build started ---$/) {$libraryok = "Started";} + if (/^([0-9.]+) --- Library build successfull ---$/) {$libraryok = "Built";} + + if (/^([0-9.]+) --- Generated c source files match bootstrap ---$/) {$sourcechange = "Unchanged";} + if (/^([0-9.]+) --- Generated c source files differ from bootstrap ---$/) {$sourcechange = "Changed";} + + if (/^([0-9.]+) --- Generated code unchanged ---$/) {if ($asmchange eq "") {$asmchange = "Unchanged"}} + if (/^([0-9.]+) --- Generated code changed ---$/) {$asmchange = "Changed"} + + if (/^([0-9.]+) --- Confidence tests started ---$/) {$tests = "Started";} + if (/^([0-9.]+) --- Confidence tests passed ---$/) {$tests = "Passed";} + + if (/^([0-9.]+) --- Make completed ---$/) { + # Go back and convert 'Started' status to 'Failed'. + if ($branch =~ m/^Build on/) {$branch = "Build on $fn failed to start.";} + if ($compilerok eq "Started") {$compilerok = "Failed.";} + if ($libraryok eq "Started") {$libraryok = "Failed.";} + if ($tests eq "Started") {$tests = "Failed.";} + } + } + close($log); + logstatus($fn); +} + +opendir DIR, "log" // die "Could not open log directory."; +my @logs = readdir DIR; +closedir DIR; + +for my $logname (sort @logs) { + $logname = "log/" . $logname; + #print "Consider $logname\n"; + if (-f $logname) {parselog($logname);} +} + +my $fontheight = 12; +my $lineheight = 15; + +sub svgtext { + my ($f, $x, $y, $colour, $msg) = @_; + print $f ''; + print $f $msg; + print $f "\n"; +} + +sub colourfor { + my ($str) = @_; + if ($str eq "Failed") {return "#e03030";} + if ($str eq "Changed") {return "#ff9d4d";} + return "#5adb5a"; +} + +my $rows = keys %status; + +my $width = 710; +my $height = ($rows+2.2) * $lineheight; + +open(my $svg, ">build-status.svg") // die "Could not create build-status.svg."; +print $svg '\n"; +print $svg '', "\n"; + +my $col1 = 20; +my $col2 = 97; +my $col3 = 160; +my $col4 = 220; +my $col5 = 280; +my $col6 = 330; +my $col7 = 380; +my $col8 = 440; +my $col9 = 490; +my $col10 = 570; +my $col11 = 650; + +svgtext($svg, $col1, 0, "#e0e0e0", "Date"); +svgtext($svg, $col3, 0, "#e0e0e0", "Branch"); +svgtext($svg, $col4, 0, "#e0e0e0", "Platform"); +svgtext($svg, $col7, 0, "#e0e0e0", "Compiler"); +svgtext($svg, $col8, 0, "#e0e0e0", "Library"); +svgtext($svg, $col9, 0, "#e0e0e0", "C Source"); +svgtext($svg, $col10, 0, "#e0e0e0", "Assembler"); +svgtext($svg, $col11, 0, "#e0e0e0", "Tests"); + +my $i=1; +for my $key (sort keys %status) { + my ($fn, $date, $time, $os, $compiler, $datamodel, $branch, $compilerok, $libraryok, + $sourcechange, $asmchange, $tests) = @{$status{$key}}; + print $svg ''; + svgtext($svg, $col1, $i, "#c0c0c0", $date); + svgtext($svg, $col2, $i, "#c0c0c0", $time); + svgtext($svg, $col3, $i, "#c0c0c0", $branch); + svgtext($svg, $col4, $i, "#c0c0c0", $os); + svgtext($svg, $col5, $i, "#c0c0c0", $compiler); + svgtext($svg, $col6, $i, "#c0c0c0", $datamodel); + svgtext($svg, $col7, $i, colourfor($compilerok), $compilerok); + svgtext($svg, $col8, $i, colourfor($libraryok), $libraryok); + svgtext($svg, $col9, $i, colourfor($sourcechange), $sourcechange); + svgtext($svg, $col10, $i, colourfor($asmchange), $asmchange); + svgtext($svg, $col11, $i, colourfor($tests), $tests); + print $svg ''; + $i++; +} + +print $svg "\n"; + +system 'chmod +r log/*'; +system 'scp build-status.svg dave@hub:/var/www'; +system 'scp log/* dave@hub:/var/www/log'; diff --git a/src/tools/autobuild/update-webserver.sh b/src/tools/autobuild/update-webserver.sh index b55144ca..58a5e439 100644 --- a/src/tools/autobuild/update-webserver.sh +++ b/src/tools/autobuild/update-webserver.sh @@ -1,7 +1,7 @@ # Push buildall and postpush to postpush server set -x -for f in postpush.pl buildall.pl build-oberon.sh; do +for f in *.pl build-oberon.sh; do scp -P 5922 $f root@www:/var/lib/nethserver/ibay/githubhook/$f ssh -p 5922 root@www "chmod +x /var/lib/nethserver/ibay/githubhook/$f" done; diff --git a/src/tools/make/addlibrary.sh b/src/tools/make/addlibrary.sh new file mode 100644 index 00000000..46e6e3e4 --- /dev/null +++ b/src/tools/make/addlibrary.sh @@ -0,0 +1,28 @@ +# addlibrary - shell script to install/uninstall oberon libraries +# +# $1 - "install" or "uninstall" +# $2 - location containing .so's +# $3 - oberon name + + +if ! which ldconfig >/dev/null 2>&1; then exit 0; fi + +if test -d /etc/ld.so.conf.d; then + + # Linux-like system + # Need to update the ldconfig configuration in the /etc/ld.so.conf.d dir. + if test "$1" = "install"; then + echo $2>/etc/ld.so.conf.d/lib$3.conf + else + rm -f /etc/ld.so.conf.d/lib$3.conf + fi + ldconfig + +else + + # BSD-like system + # Just run ldconfig -m to update the cache. It'll add-to/update/reove-from + # the cache appropraitely for whether they are present opt not. + ldconfig -m "$2" + +fi diff --git a/src/tools/make/oberon.mk b/src/tools/make/oberon.mk index 5c3af6be..553b02f6 100644 --- a/src/tools/make/oberon.mk +++ b/src/tools/make/oberon.mk @@ -33,7 +33,7 @@ usage: clean: @printf '\n\n--- Cleaning branch $(BRANCH) $(OS) $(COMPILER) $(DATAMODEL) ---\n\n' - rm -rf $(BUILDDIR) + rm -rf $(BUILDDIR) $(ROOTDIR)/install rm -f $(OBECOMP) @@ -142,68 +142,77 @@ browsercmd: +# makeinstalldir: Use only after a successful full build. Creates an +# installation directory image in $(BUILDDOR)/install +makeinstalldir: + @printf '\nCreating installation image at $(ROOTDIR)/install\n' + @rm -rf "$(ROOTDIR)/install" + + @mkdir -p "$(ROOTDIR)/install/bin" + @cp $(OBECOMP) "$(ROOTDIR)/install/bin/$(OBECOMP)" + @-cp $(BUILDDIR)/showdef$(BINEXT) "$(ROOTDIR)/install/bin" + + @mkdir -p "$(ROOTDIR)/install/2/include" && cp $(BUILDDIR)/2/*.h "$(ROOTDIR)/install/2/include/" + @mkdir -p "$(ROOTDIR)/install/2/sym" && cp $(BUILDDIR)/2/*.sym "$(ROOTDIR)/install/2/sym/" + @mkdir -p "$(ROOTDIR)/install/C/include" && cp $(BUILDDIR)/C/*.h "$(ROOTDIR)/install/C/include/" + @mkdir -p "$(ROOTDIR)/install/C/sym" && cp $(BUILDDIR)/C/*.sym "$(ROOTDIR)/install/C/sym/" + + @cp $(BUILDDIR)/*.Txt "$(ROOTDIR)/install/2/sym/" + @cp $(BUILDDIR)/*.Txt "$(ROOTDIR)/install/C/sym/" + + @mkdir -p "$(ROOTDIR)/install/lib" + @cp $(BUILDDIR)/2/lib$(ONAME)* "$(ROOTDIR)/install/lib/" + @cp $(BUILDDIR)/C/lib$(ONAME)* "$(ROOTDIR)/install/lib/" + + +# instructions: Advice on completion of local build +instructions: FORCE + @printf '\nOberon build and test complete, result is in $(ROOTDIR)/install\n' + @printf '\nYou can use the new compiler by running $(ROOTDIR)/install/bin/$(ONAME),\n' + @printf 'Or add it to your path as follows:\n' + @printf 'export PATH=\"$(ROOTDIR)/install/bin:$$PATH\"\n' + @printf '\n' + + + + FORCE: -# installable: Check for access to the installation directory +# installable: Check for access to the installation directory installable: @rm -rf "S(INSTALLDIR)/test-access-qqq" @if ! mkdir -p "$(INSTALLDIR)/test-access-qqq";then printf '\n\n Cannot write to install directory.\n Please use sudo or run as root/administrator.\n\n'; exit 1;fi @rm -rf "S(INSTALLDIR)/test-access-qqq" +uninstall: installable + @printf '\nUninstalling from \"$(INSTALLDIR)\"\n' + rm -rf "$(INSTALLDIR)" + @sh src/tools/make/addlibrary.sh uninstall \""$(INSTALLDIR)/lib"\" $(oname) # install: Use only after a successful full build. Installs the compiler # and libraries in /opt/$(ONAME). # May require root access. -install: +install: uninstall @printf '\nInstalling into \"$(INSTALLDIR)\"\n' @rm -rf "$(INSTALLDIR)" - - @mkdir -p "$(INSTALLDIR)/bin" - @cp $(OBECOMP) "$(INSTALLDIR)/bin/$(OBECOMP)" - @-cp $(BUILDDIR)/showdef$(BINEXT) "$(INSTALLDIR)/bin" - - @mkdir -p "$(INSTALLDIR)/2/include" && cp $(BUILDDIR)/2/*.h "$(INSTALLDIR)/2/include/" - @mkdir -p "$(INSTALLDIR)/2/sym" && cp $(BUILDDIR)/2/*.sym "$(INSTALLDIR)/2/sym/" - @mkdir -p "$(INSTALLDIR)/C/include" && cp $(BUILDDIR)/C/*.h "$(INSTALLDIR)/C/include/" - @mkdir -p "$(INSTALLDIR)/C/sym" && cp $(BUILDDIR)/C/*.sym "$(INSTALLDIR)/C/sym/" - - @cp $(BUILDDIR)/*.Txt "$(INSTALLDIR)/2/sym/" - @cp $(BUILDDIR)/*.Txt "$(INSTALLDIR)/C/sym/" - - @mkdir -p "$(INSTALLDIR)/lib" - @cp $(BUILDDIR)/2/lib$(ONAME)* "$(INSTALLDIR)/lib/" - @cp $(BUILDDIR)/C/lib$(ONAME)* "$(INSTALLDIR)/lib/" - @if which ldconfig >/dev/null 2>&1; then $(LDCONFIG); fi - - - - -# showpath: Describe how to set the PATH variable -showpath: + @cp -rf "$(ROOTDIR)/install/" "$(INSTALLDIR)" + @sh src/tools/make/addlibrary.sh install \""$(INSTALLDIR)/lib"\" $(ONAME) + @printf '\nOberon compiler installed to $(INSTALLDIR)\n' @printf '\nNow add $(INSTALLDIR)/bin to your path, for example with the command:\n' - @printf 'export PATH=\"$(INSTALLDIR)/bin:\$$PATH\"\n' + @printf 'export PATH=\"$(INSTALLDIR)/bin:$$PATH\"\n' @printf '\n' - - -uninstall: - @printf '\nUninstalling from \"$(INSTALLDIR)\"\n' - rm -rf "$(INSTALLDIR)" - rm -f /etc/ld.so.conf/lib$(ONAME) - if which ldconfig >/dev/null 2>&1; then ldconfig; fi - - -runtime: +runtime: FORCE @printf '\nMaking run time library for -O$(MODEL)\n' cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/runtime/Platform$(PLATFORM).Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/runtime/Heap.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/runtime/Out.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/runtime/Modules.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/runtime/Strings.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/runtime/Out.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/runtime/In.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/runtime/VT100.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/runtime/Files.Mod @@ -387,7 +396,7 @@ sourcechanges: -RUNTEST = COMPILER=$(COMPILER) OBECOMP="$(OBECOMP) -O$(MODEL)" FLAVOUR=$(FLAVOUR) BRANCH=$(BRANCH) sh ./test.sh "$(INSTALLDIR)" +RUNTEST = COMPILER=$(COMPILER) OBECOMP="$(OBECOMP) -O$(MODEL)" FLAVOUR=$(FLAVOUR) BRANCH=$(BRANCH) sh ./test.sh "$(ROOTDIR)/install" confidence: @printf '\n\n--- Confidence tests ---\n\n' From c3fc777f6ff4c3421032e08973e91767793897eb Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 9 Dec 2016 17:50:59 +0000 Subject: [PATCH 407/580] Update bootsrap C sources. --- bootstrap/unix-44/Compiler.c | 2 +- bootstrap/unix-44/Configuration.c | 4 +-- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Files.c | 2 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 2 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 46 ++++++++++++++++------------ bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 2 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 5 ++- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 2 +- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 2 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Out.c | 2 +- bootstrap/unix-44/Out.h | 2 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/VT100.c | 2 +- bootstrap/unix-44/VT100.h | 2 +- bootstrap/unix-44/extTools.c | 6 ++-- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-48/Compiler.c | 2 +- bootstrap/unix-48/Configuration.c | 4 +-- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Files.c | 2 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 2 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 46 ++++++++++++++++------------ bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 2 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 5 ++- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 2 +- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 2 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Out.c | 2 +- bootstrap/unix-48/Out.h | 2 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/VT100.c | 2 +- bootstrap/unix-48/VT100.h | 2 +- bootstrap/unix-48/extTools.c | 6 ++-- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-88/Compiler.c | 2 +- bootstrap/unix-88/Configuration.c | 4 +-- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Files.c | 2 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 2 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 46 ++++++++++++++++------------ bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 2 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 5 ++- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 2 +- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 2 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Out.c | 2 +- bootstrap/unix-88/Out.h | 2 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/VT100.c | 2 +- bootstrap/unix-88/VT100.h | 2 +- bootstrap/unix-88/extTools.c | 6 ++-- bootstrap/unix-88/extTools.h | 2 +- bootstrap/windows-48/Compiler.c | 2 +- bootstrap/windows-48/Configuration.c | 4 +-- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Files.c | 2 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 2 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 46 ++++++++++++++++------------ bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 2 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 5 ++- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 2 +- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 2 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Out.c | 2 +- bootstrap/windows-48/Out.h | 2 +- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/VT100.c | 2 +- bootstrap/windows-48/VT100.h | 2 +- bootstrap/windows-48/extTools.c | 6 ++-- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-88/Compiler.c | 2 +- bootstrap/windows-88/Configuration.c | 4 +-- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Files.c | 2 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 2 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 46 ++++++++++++++++------------ bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 2 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 5 ++- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 2 +- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 2 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Out.c | 2 +- bootstrap/windows-88/Out.h | 2 +- bootstrap/windows-88/Platform.c | 2 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/VT100.c | 2 +- bootstrap/windows-88/VT100.h | 2 +- bootstrap/windows-88/extTools.c | 6 ++-- bootstrap/windows-88/extTools.h | 2 +- 185 files changed, 340 insertions(+), 295 deletions(-) diff --git a/bootstrap/unix-44/Compiler.c b/bootstrap/unix-44/Compiler.c index 97e4d8e3..2c7543fe 100644 --- a/bootstrap/unix-44/Compiler.c +++ b/bootstrap/unix-44/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index 7fa2ad3f..aa8e2c43 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index b477d97a..aae60644 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index a177f3e6..e2b5f99d 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index b69b0824..db989ca0 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index 0546fa61..fd4d0fc0 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index 3d30d5d4..8e773e89 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index c9741737..6b2d80be 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -59,7 +59,7 @@ static void Modules_Canonify (CHAR *s, ADDRESS s__len, CHAR *d, ADDRESS d__len); static INT16 Modules_CharCount (CHAR *s, ADDRESS s__len); static void Modules_DisplayHaltCode (INT32 code); static void Modules_ExtractPart (CHAR *s, ADDRESS s__len, INT16 *i, CHAR *p, ADDRESS p__len, CHAR *d, ADDRESS d__len); -static void Modules_FindBinaryDir (CHAR *d, ADDRESS d__len); +static void Modules_FindBinaryDir (CHAR *binarydir, ADDRESS binarydir__len); export void Modules_Free (CHAR *name, ADDRESS name__len, BOOLEAN all); export void Modules_GetArg (INT16 n, CHAR *val, ADDRESS val__len); export void Modules_GetIntArg (INT16 n, INT32 *val); @@ -289,42 +289,48 @@ static void Modules_Trim (CHAR *s, ADDRESS s__len, CHAR *d, ADDRESS d__len) typedef CHAR pathstring__12[4096]; -static void Modules_FindBinaryDir (CHAR *d, ADDRESS d__len) +static void Modules_FindBinaryDir (CHAR *binarydir, ADDRESS binarydir__len) { - pathstring__12 executable, dir, testpath, pathlist; + pathstring__12 arg0, pathlist, pathdir, tempstr; INT16 i, j, k; BOOLEAN present; if (Modules_ArgCount < 1) { - d[0] = 0x00; + binarydir[0] = 0x00; return; } - Modules_GetArg(0, (void*)testpath, 4096); - Modules_Trim(testpath, 4096, (void*)executable, 4096); - Modules_Canonify(executable, 4096, (void*)d, d__len); - present = Modules_IsFilePresent(d, d__len); - if ((!present && !Modules_IsAbsolute(testpath, 4096))) { + Modules_GetArg(0, (void*)arg0, 4096); + i = 0; + while ((arg0[__X(i, 4096)] != 0x00 && arg0[__X(i, 4096)] != '/')) { + i += 1; + } + if (arg0[__X(i, 4096)] == '/') { + Modules_Trim(arg0, 4096, (void*)tempstr, 4096); + Modules_Canonify(tempstr, 4096, (void*)binarydir, binarydir__len); + present = Modules_IsFilePresent(binarydir, binarydir__len); + } else { Platform_GetEnv((CHAR*)"PATH", 5, (void*)pathlist, 4096); i = 0; + present = 0; while ((!present && pathlist[__X(i, 4096)] != 0x00)) { - Modules_ExtractPart(pathlist, 4096, &i, (CHAR*)":;", 3, (void*)dir, 4096); - Modules_Trim(dir, 4096, (void*)testpath, 4096); - Modules_AppendPart('/', executable, 4096, (void*)testpath, 4096); - Modules_Canonify(testpath, 4096, (void*)d, d__len); - present = Modules_IsFilePresent(d, d__len); + Modules_ExtractPart(pathlist, 4096, &i, (CHAR*)":;", 3, (void*)pathdir, 4096); + Modules_AppendPart('/', arg0, 4096, (void*)pathdir, 4096); + Modules_Trim(pathdir, 4096, (void*)tempstr, 4096); + Modules_Canonify(tempstr, 4096, (void*)binarydir, binarydir__len); + present = Modules_IsFilePresent(binarydir, binarydir__len); } } if (present) { - k = Modules_CharCount(d, d__len); - while ((k > 0 && !Modules_IsOneOf(d[__X(k - 1, d__len)], (CHAR*)"/\\", 3))) { + k = Modules_CharCount(binarydir, binarydir__len); + while ((k > 0 && !Modules_IsOneOf(binarydir[__X(k - 1, binarydir__len)], (CHAR*)"/\\", 3))) { k -= 1; } if (k == 0) { - d[__X(k, d__len)] = 0x00; + binarydir[__X(k, binarydir__len)] = 0x00; } else { - d[__X(k - 1, d__len)] = 0x00; + binarydir[__X(k - 1, binarydir__len)] = 0x00; } } else { - d[0] = 0x00; + binarydir[0] = 0x00; } } diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index b9e63ee7..e7f2b10f 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index 99fd666d..6f2b5545 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index 3f6ee165..589e67db 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 5e67ae16..bf503129 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index 41739672..59d5e057 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index a1587370..ca3cffc1 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -257,6 +257,9 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWLn(); OPM_LogWStr((CHAR*)"Further development by Norayr Chilingarian, David Brown and others.", 68); OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Loaded from ", 13); + OPM_LogWStr(Modules_BinaryDir, 1024); + OPM_LogWLn(); OPM_LogWLn(); OPM_LogWStr((CHAR*)"Usage:", 7); OPM_LogWLn(); diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index 7664cc0c..4bd19104 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index ebecc1ea..8a07b672 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index ef56b929..aeb70b16 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index 52f0f328..6820f239 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index 54edc605..815f29a7 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index 23062347..33e6189e 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index 68edb67f..f3af656f 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index b266cb63..c1062b81 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index 00052c0b..6807e936 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Out.c b/bootstrap/unix-44/Out.c index a0ae3106..87afc49d 100644 --- a/bootstrap/unix-44/Out.c +++ b/bootstrap/unix-44/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Out.h b/bootstrap/unix-44/Out.h index d2a230b3..20d983e1 100644 --- a/bootstrap/unix-44/Out.h +++ b/bootstrap/unix-44/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index e282a468..c7d45501 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index a3e32518..ed09ed5c 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index bfe15fff..35ecc020 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index ff6ad391..be278393 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index 7f5a8fac..b0c053b8 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index 2a1ebd5f..3d53c582 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index dd7eb163..e3cefcdc 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index 91fa31ed..8be25bb5 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/VT100.c b/bootstrap/unix-44/VT100.c index 0d9d3163..8d349c3e 100644 --- a/bootstrap/unix-44/VT100.c +++ b/bootstrap/unix-44/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/VT100.h b/bootstrap/unix-44/VT100.h index c552d82d..494b7318 100644 --- a/bootstrap/unix-44/VT100.h +++ b/bootstrap/unix-44/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index 38cd03d5..f9e7e802 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -65,7 +65,7 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) { - __COPY("gcc -fPIC -g", s, s__len); + __COPY("gcc -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); @@ -100,7 +100,7 @@ void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN stati Strings_Append((CHAR*)" -o ", 5, (void*)cmd, 1023); Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); Strings_Append((CHAR*)" -L\"", 5, (void*)cmd, 1023); - Strings_Append((CHAR*)"", 1, (void*)cmd, 1023); + Strings_Append(OPM_InstallDir, 1024, (void*)cmd, 1023); Strings_Append((CHAR*)"/lib\"", 6, (void*)cmd, 1023); Strings_Append((CHAR*)" -l voc", 8, (void*)cmd, 1023); Strings_Append((CHAR*)"-O", 3, (void*)cmd, 1023); diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index 783d31fb..ee0ea191 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/Compiler.c b/bootstrap/unix-48/Compiler.c index 97e4d8e3..2c7543fe 100644 --- a/bootstrap/unix-48/Compiler.c +++ b/bootstrap/unix-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index 7fa2ad3f..aa8e2c43 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index b477d97a..aae60644 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index a177f3e6..e2b5f99d 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index b69b0824..db989ca0 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index 0546fa61..fd4d0fc0 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index 3d30d5d4..8e773e89 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index c9741737..6b2d80be 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -59,7 +59,7 @@ static void Modules_Canonify (CHAR *s, ADDRESS s__len, CHAR *d, ADDRESS d__len); static INT16 Modules_CharCount (CHAR *s, ADDRESS s__len); static void Modules_DisplayHaltCode (INT32 code); static void Modules_ExtractPart (CHAR *s, ADDRESS s__len, INT16 *i, CHAR *p, ADDRESS p__len, CHAR *d, ADDRESS d__len); -static void Modules_FindBinaryDir (CHAR *d, ADDRESS d__len); +static void Modules_FindBinaryDir (CHAR *binarydir, ADDRESS binarydir__len); export void Modules_Free (CHAR *name, ADDRESS name__len, BOOLEAN all); export void Modules_GetArg (INT16 n, CHAR *val, ADDRESS val__len); export void Modules_GetIntArg (INT16 n, INT32 *val); @@ -289,42 +289,48 @@ static void Modules_Trim (CHAR *s, ADDRESS s__len, CHAR *d, ADDRESS d__len) typedef CHAR pathstring__12[4096]; -static void Modules_FindBinaryDir (CHAR *d, ADDRESS d__len) +static void Modules_FindBinaryDir (CHAR *binarydir, ADDRESS binarydir__len) { - pathstring__12 executable, dir, testpath, pathlist; + pathstring__12 arg0, pathlist, pathdir, tempstr; INT16 i, j, k; BOOLEAN present; if (Modules_ArgCount < 1) { - d[0] = 0x00; + binarydir[0] = 0x00; return; } - Modules_GetArg(0, (void*)testpath, 4096); - Modules_Trim(testpath, 4096, (void*)executable, 4096); - Modules_Canonify(executable, 4096, (void*)d, d__len); - present = Modules_IsFilePresent(d, d__len); - if ((!present && !Modules_IsAbsolute(testpath, 4096))) { + Modules_GetArg(0, (void*)arg0, 4096); + i = 0; + while ((arg0[__X(i, 4096)] != 0x00 && arg0[__X(i, 4096)] != '/')) { + i += 1; + } + if (arg0[__X(i, 4096)] == '/') { + Modules_Trim(arg0, 4096, (void*)tempstr, 4096); + Modules_Canonify(tempstr, 4096, (void*)binarydir, binarydir__len); + present = Modules_IsFilePresent(binarydir, binarydir__len); + } else { Platform_GetEnv((CHAR*)"PATH", 5, (void*)pathlist, 4096); i = 0; + present = 0; while ((!present && pathlist[__X(i, 4096)] != 0x00)) { - Modules_ExtractPart(pathlist, 4096, &i, (CHAR*)":;", 3, (void*)dir, 4096); - Modules_Trim(dir, 4096, (void*)testpath, 4096); - Modules_AppendPart('/', executable, 4096, (void*)testpath, 4096); - Modules_Canonify(testpath, 4096, (void*)d, d__len); - present = Modules_IsFilePresent(d, d__len); + Modules_ExtractPart(pathlist, 4096, &i, (CHAR*)":;", 3, (void*)pathdir, 4096); + Modules_AppendPart('/', arg0, 4096, (void*)pathdir, 4096); + Modules_Trim(pathdir, 4096, (void*)tempstr, 4096); + Modules_Canonify(tempstr, 4096, (void*)binarydir, binarydir__len); + present = Modules_IsFilePresent(binarydir, binarydir__len); } } if (present) { - k = Modules_CharCount(d, d__len); - while ((k > 0 && !Modules_IsOneOf(d[__X(k - 1, d__len)], (CHAR*)"/\\", 3))) { + k = Modules_CharCount(binarydir, binarydir__len); + while ((k > 0 && !Modules_IsOneOf(binarydir[__X(k - 1, binarydir__len)], (CHAR*)"/\\", 3))) { k -= 1; } if (k == 0) { - d[__X(k, d__len)] = 0x00; + binarydir[__X(k, binarydir__len)] = 0x00; } else { - d[__X(k - 1, d__len)] = 0x00; + binarydir[__X(k - 1, binarydir__len)] = 0x00; } } else { - d[0] = 0x00; + binarydir[0] = 0x00; } } diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index b9e63ee7..e7f2b10f 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index 99fd666d..6f2b5545 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index 3f6ee165..589e67db 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 5e67ae16..bf503129 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index 41739672..59d5e057 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index a1587370..ca3cffc1 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -257,6 +257,9 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWLn(); OPM_LogWStr((CHAR*)"Further development by Norayr Chilingarian, David Brown and others.", 68); OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Loaded from ", 13); + OPM_LogWStr(Modules_BinaryDir, 1024); + OPM_LogWLn(); OPM_LogWLn(); OPM_LogWStr((CHAR*)"Usage:", 7); OPM_LogWLn(); diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index 7664cc0c..4bd19104 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index ebecc1ea..8a07b672 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index ef56b929..aeb70b16 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index 52f0f328..6820f239 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index 54edc605..815f29a7 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 4f83d6ee..8237bf8d 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index 68edb67f..f3af656f 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index b266cb63..c1062b81 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index 00052c0b..6807e936 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Out.c b/bootstrap/unix-48/Out.c index a0ae3106..87afc49d 100644 --- a/bootstrap/unix-48/Out.c +++ b/bootstrap/unix-48/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Out.h b/bootstrap/unix-48/Out.h index d2a230b3..20d983e1 100644 --- a/bootstrap/unix-48/Out.h +++ b/bootstrap/unix-48/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index e282a468..c7d45501 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index a3e32518..ed09ed5c 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index bfe15fff..35ecc020 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index ff6ad391..be278393 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index 7f5a8fac..b0c053b8 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index 2a1ebd5f..3d53c582 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index 392a5579..1cca7d56 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index dff59e1e..e36cbaf0 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/VT100.c b/bootstrap/unix-48/VT100.c index 0d9d3163..8d349c3e 100644 --- a/bootstrap/unix-48/VT100.c +++ b/bootstrap/unix-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/VT100.h b/bootstrap/unix-48/VT100.h index c552d82d..494b7318 100644 --- a/bootstrap/unix-48/VT100.h +++ b/bootstrap/unix-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index 38cd03d5..f9e7e802 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -65,7 +65,7 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) { - __COPY("gcc -fPIC -g", s, s__len); + __COPY("gcc -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); @@ -100,7 +100,7 @@ void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN stati Strings_Append((CHAR*)" -o ", 5, (void*)cmd, 1023); Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); Strings_Append((CHAR*)" -L\"", 5, (void*)cmd, 1023); - Strings_Append((CHAR*)"", 1, (void*)cmd, 1023); + Strings_Append(OPM_InstallDir, 1024, (void*)cmd, 1023); Strings_Append((CHAR*)"/lib\"", 6, (void*)cmd, 1023); Strings_Append((CHAR*)" -l voc", 8, (void*)cmd, 1023); Strings_Append((CHAR*)"-O", 3, (void*)cmd, 1023); diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index 783d31fb..ee0ea191 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/Compiler.c b/bootstrap/unix-88/Compiler.c index 97e4d8e3..2c7543fe 100644 --- a/bootstrap/unix-88/Compiler.c +++ b/bootstrap/unix-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index 7fa2ad3f..aa8e2c43 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index b477d97a..aae60644 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 819c6450..ccb4a812 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 9332fd1c..068c1d9a 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index dbfe923d..faed3f24 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index b6d1c177..becc1414 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 2ef36628..e9637cdf 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -59,7 +59,7 @@ static void Modules_Canonify (CHAR *s, ADDRESS s__len, CHAR *d, ADDRESS d__len); static INT16 Modules_CharCount (CHAR *s, ADDRESS s__len); static void Modules_DisplayHaltCode (INT32 code); static void Modules_ExtractPart (CHAR *s, ADDRESS s__len, INT16 *i, CHAR *p, ADDRESS p__len, CHAR *d, ADDRESS d__len); -static void Modules_FindBinaryDir (CHAR *d, ADDRESS d__len); +static void Modules_FindBinaryDir (CHAR *binarydir, ADDRESS binarydir__len); export void Modules_Free (CHAR *name, ADDRESS name__len, BOOLEAN all); export void Modules_GetArg (INT16 n, CHAR *val, ADDRESS val__len); export void Modules_GetIntArg (INT16 n, INT32 *val); @@ -289,42 +289,48 @@ static void Modules_Trim (CHAR *s, ADDRESS s__len, CHAR *d, ADDRESS d__len) typedef CHAR pathstring__12[4096]; -static void Modules_FindBinaryDir (CHAR *d, ADDRESS d__len) +static void Modules_FindBinaryDir (CHAR *binarydir, ADDRESS binarydir__len) { - pathstring__12 executable, dir, testpath, pathlist; + pathstring__12 arg0, pathlist, pathdir, tempstr; INT16 i, j, k; BOOLEAN present; if (Modules_ArgCount < 1) { - d[0] = 0x00; + binarydir[0] = 0x00; return; } - Modules_GetArg(0, (void*)testpath, 4096); - Modules_Trim(testpath, 4096, (void*)executable, 4096); - Modules_Canonify(executable, 4096, (void*)d, d__len); - present = Modules_IsFilePresent(d, d__len); - if ((!present && !Modules_IsAbsolute(testpath, 4096))) { + Modules_GetArg(0, (void*)arg0, 4096); + i = 0; + while ((arg0[__X(i, 4096)] != 0x00 && arg0[__X(i, 4096)] != '/')) { + i += 1; + } + if (arg0[__X(i, 4096)] == '/') { + Modules_Trim(arg0, 4096, (void*)tempstr, 4096); + Modules_Canonify(tempstr, 4096, (void*)binarydir, binarydir__len); + present = Modules_IsFilePresent(binarydir, binarydir__len); + } else { Platform_GetEnv((CHAR*)"PATH", 5, (void*)pathlist, 4096); i = 0; + present = 0; while ((!present && pathlist[__X(i, 4096)] != 0x00)) { - Modules_ExtractPart(pathlist, 4096, &i, (CHAR*)":;", 3, (void*)dir, 4096); - Modules_Trim(dir, 4096, (void*)testpath, 4096); - Modules_AppendPart('/', executable, 4096, (void*)testpath, 4096); - Modules_Canonify(testpath, 4096, (void*)d, d__len); - present = Modules_IsFilePresent(d, d__len); + Modules_ExtractPart(pathlist, 4096, &i, (CHAR*)":;", 3, (void*)pathdir, 4096); + Modules_AppendPart('/', arg0, 4096, (void*)pathdir, 4096); + Modules_Trim(pathdir, 4096, (void*)tempstr, 4096); + Modules_Canonify(tempstr, 4096, (void*)binarydir, binarydir__len); + present = Modules_IsFilePresent(binarydir, binarydir__len); } } if (present) { - k = Modules_CharCount(d, d__len); - while ((k > 0 && !Modules_IsOneOf(d[__X(k - 1, d__len)], (CHAR*)"/\\", 3))) { + k = Modules_CharCount(binarydir, binarydir__len); + while ((k > 0 && !Modules_IsOneOf(binarydir[__X(k - 1, binarydir__len)], (CHAR*)"/\\", 3))) { k -= 1; } if (k == 0) { - d[__X(k, d__len)] = 0x00; + binarydir[__X(k, binarydir__len)] = 0x00; } else { - d[__X(k - 1, d__len)] = 0x00; + binarydir[__X(k - 1, binarydir__len)] = 0x00; } } else { - d[0] = 0x00; + binarydir[0] = 0x00; } } diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index fbc2c47e..ce643d9b 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index 99fd666d..6f2b5545 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index 3f6ee165..589e67db 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index 5e67ae16..bf503129 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index 41739672..59d5e057 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index f37a4f3e..8122e208 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -257,6 +257,9 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWLn(); OPM_LogWStr((CHAR*)"Further development by Norayr Chilingarian, David Brown and others.", 68); OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Loaded from ", 13); + OPM_LogWStr(Modules_BinaryDir, 1024); + OPM_LogWLn(); OPM_LogWLn(); OPM_LogWStr((CHAR*)"Usage:", 7); OPM_LogWLn(); diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index 7664cc0c..4bd19104 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index 4db27f7d..cddb65e4 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index ef56b929..aeb70b16 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index 52f0f328..6820f239 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index 54edc605..815f29a7 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index e93361f7..3bab2d83 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 68edb67f..f3af656f 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 548e85cf..6405cdff 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index 00052c0b..6807e936 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Out.c b/bootstrap/unix-88/Out.c index a0ae3106..87afc49d 100644 --- a/bootstrap/unix-88/Out.c +++ b/bootstrap/unix-88/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Out.h b/bootstrap/unix-88/Out.h index d2a230b3..20d983e1 100644 --- a/bootstrap/unix-88/Out.h +++ b/bootstrap/unix-88/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 99d59a98..dd0f0b96 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index f1aa8a9d..aba5632f 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index bfe15fff..35ecc020 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index ff6ad391..be278393 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index 7f5a8fac..b0c053b8 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index 2a1ebd5f..3d53c582 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index 396b6e14..95d0173a 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index 48899032..c4766a47 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/VT100.c b/bootstrap/unix-88/VT100.c index 0d9d3163..8d349c3e 100644 --- a/bootstrap/unix-88/VT100.c +++ b/bootstrap/unix-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/VT100.h b/bootstrap/unix-88/VT100.h index c552d82d..494b7318 100644 --- a/bootstrap/unix-88/VT100.h +++ b/bootstrap/unix-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index 38cd03d5..f9e7e802 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -65,7 +65,7 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) { - __COPY("gcc -fPIC -g", s, s__len); + __COPY("gcc -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); @@ -100,7 +100,7 @@ void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN stati Strings_Append((CHAR*)" -o ", 5, (void*)cmd, 1023); Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); Strings_Append((CHAR*)" -L\"", 5, (void*)cmd, 1023); - Strings_Append((CHAR*)"", 1, (void*)cmd, 1023); + Strings_Append(OPM_InstallDir, 1024, (void*)cmd, 1023); Strings_Append((CHAR*)"/lib\"", 6, (void*)cmd, 1023); Strings_Append((CHAR*)" -l voc", 8, (void*)cmd, 1023); Strings_Append((CHAR*)"-O", 3, (void*)cmd, 1023); diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index 783d31fb..ee0ea191 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/Compiler.c b/bootstrap/windows-48/Compiler.c index 97e4d8e3..2c7543fe 100644 --- a/bootstrap/windows-48/Compiler.c +++ b/bootstrap/windows-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index 7fa2ad3f..aa8e2c43 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index b477d97a..aae60644 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index d7b42e0e..30b3eaa6 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index 6d3141bd..dcbb51f3 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index 0546fa61..fd4d0fc0 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index 3d30d5d4..8e773e89 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index e98bb542..b7d174ef 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -59,7 +59,7 @@ static void Modules_Canonify (CHAR *s, ADDRESS s__len, CHAR *d, ADDRESS d__len); static INT16 Modules_CharCount (CHAR *s, ADDRESS s__len); static void Modules_DisplayHaltCode (INT32 code); static void Modules_ExtractPart (CHAR *s, ADDRESS s__len, INT16 *i, CHAR *p, ADDRESS p__len, CHAR *d, ADDRESS d__len); -static void Modules_FindBinaryDir (CHAR *d, ADDRESS d__len); +static void Modules_FindBinaryDir (CHAR *binarydir, ADDRESS binarydir__len); export void Modules_Free (CHAR *name, ADDRESS name__len, BOOLEAN all); export void Modules_GetArg (INT16 n, CHAR *val, ADDRESS val__len); export void Modules_GetIntArg (INT16 n, INT32 *val); @@ -289,42 +289,48 @@ static void Modules_Trim (CHAR *s, ADDRESS s__len, CHAR *d, ADDRESS d__len) typedef CHAR pathstring__12[4096]; -static void Modules_FindBinaryDir (CHAR *d, ADDRESS d__len) +static void Modules_FindBinaryDir (CHAR *binarydir, ADDRESS binarydir__len) { - pathstring__12 executable, dir, testpath, pathlist; + pathstring__12 arg0, pathlist, pathdir, tempstr; INT16 i, j, k; BOOLEAN present; if (Modules_ArgCount < 1) { - d[0] = 0x00; + binarydir[0] = 0x00; return; } - Modules_GetArg(0, (void*)testpath, 4096); - Modules_Trim(testpath, 4096, (void*)executable, 4096); - Modules_Canonify(executable, 4096, (void*)d, d__len); - present = Modules_IsFilePresent(d, d__len); - if ((!present && !Modules_IsAbsolute(testpath, 4096))) { + Modules_GetArg(0, (void*)arg0, 4096); + i = 0; + while ((arg0[__X(i, 4096)] != 0x00 && arg0[__X(i, 4096)] != '/')) { + i += 1; + } + if (arg0[__X(i, 4096)] == '/') { + Modules_Trim(arg0, 4096, (void*)tempstr, 4096); + Modules_Canonify(tempstr, 4096, (void*)binarydir, binarydir__len); + present = Modules_IsFilePresent(binarydir, binarydir__len); + } else { Platform_GetEnv((CHAR*)"PATH", 5, (void*)pathlist, 4096); i = 0; + present = 0; while ((!present && pathlist[__X(i, 4096)] != 0x00)) { - Modules_ExtractPart(pathlist, 4096, &i, (CHAR*)":;", 3, (void*)dir, 4096); - Modules_Trim(dir, 4096, (void*)testpath, 4096); - Modules_AppendPart('/', executable, 4096, (void*)testpath, 4096); - Modules_Canonify(testpath, 4096, (void*)d, d__len); - present = Modules_IsFilePresent(d, d__len); + Modules_ExtractPart(pathlist, 4096, &i, (CHAR*)":;", 3, (void*)pathdir, 4096); + Modules_AppendPart('/', arg0, 4096, (void*)pathdir, 4096); + Modules_Trim(pathdir, 4096, (void*)tempstr, 4096); + Modules_Canonify(tempstr, 4096, (void*)binarydir, binarydir__len); + present = Modules_IsFilePresent(binarydir, binarydir__len); } } if (present) { - k = Modules_CharCount(d, d__len); - while ((k > 0 && !Modules_IsOneOf(d[__X(k - 1, d__len)], (CHAR*)"/\\", 3))) { + k = Modules_CharCount(binarydir, binarydir__len); + while ((k > 0 && !Modules_IsOneOf(binarydir[__X(k - 1, binarydir__len)], (CHAR*)"/\\", 3))) { k -= 1; } if (k == 0) { - d[__X(k, d__len)] = 0x00; + binarydir[__X(k, binarydir__len)] = 0x00; } else { - d[__X(k - 1, d__len)] = 0x00; + binarydir[__X(k - 1, binarydir__len)] = 0x00; } } else { - d[0] = 0x00; + binarydir[0] = 0x00; } } diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index b9e63ee7..e7f2b10f 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index 99fd666d..6f2b5545 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index 3f6ee165..589e67db 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 5e67ae16..bf503129 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index 41739672..59d5e057 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index a1587370..ca3cffc1 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -257,6 +257,9 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWLn(); OPM_LogWStr((CHAR*)"Further development by Norayr Chilingarian, David Brown and others.", 68); OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Loaded from ", 13); + OPM_LogWStr(Modules_BinaryDir, 1024); + OPM_LogWLn(); OPM_LogWLn(); OPM_LogWStr((CHAR*)"Usage:", 7); OPM_LogWLn(); diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index 7664cc0c..4bd19104 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index ebecc1ea..8a07b672 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index ef56b929..aeb70b16 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index 52f0f328..6820f239 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index 54edc605..815f29a7 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 4f83d6ee..8237bf8d 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index 68edb67f..f3af656f 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index b266cb63..c1062b81 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index 00052c0b..6807e936 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Out.c b/bootstrap/windows-48/Out.c index 11c526ac..d7d446f8 100644 --- a/bootstrap/windows-48/Out.c +++ b/bootstrap/windows-48/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Out.h b/bootstrap/windows-48/Out.h index d2a230b3..20d983e1 100644 --- a/bootstrap/windows-48/Out.h +++ b/bootstrap/windows-48/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 5351882b..b71e4f1d 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index 2e20d294..79babae7 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index bfe15fff..35ecc020 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index ff6ad391..be278393 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index 7f5a8fac..b0c053b8 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index 2a1ebd5f..3d53c582 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index 392a5579..1cca7d56 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index dff59e1e..e36cbaf0 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/VT100.c b/bootstrap/windows-48/VT100.c index 0d9d3163..8d349c3e 100644 --- a/bootstrap/windows-48/VT100.c +++ b/bootstrap/windows-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/VT100.h b/bootstrap/windows-48/VT100.h index c552d82d..494b7318 100644 --- a/bootstrap/windows-48/VT100.h +++ b/bootstrap/windows-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index 38cd03d5..f9e7e802 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -65,7 +65,7 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) { - __COPY("gcc -fPIC -g", s, s__len); + __COPY("gcc -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); @@ -100,7 +100,7 @@ void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN stati Strings_Append((CHAR*)" -o ", 5, (void*)cmd, 1023); Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); Strings_Append((CHAR*)" -L\"", 5, (void*)cmd, 1023); - Strings_Append((CHAR*)"", 1, (void*)cmd, 1023); + Strings_Append(OPM_InstallDir, 1024, (void*)cmd, 1023); Strings_Append((CHAR*)"/lib\"", 6, (void*)cmd, 1023); Strings_Append((CHAR*)" -l voc", 8, (void*)cmd, 1023); Strings_Append((CHAR*)"-O", 3, (void*)cmd, 1023); diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index 783d31fb..ee0ea191 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/Compiler.c b/bootstrap/windows-88/Compiler.c index 97e4d8e3..2c7543fe 100644 --- a/bootstrap/windows-88/Compiler.c +++ b/bootstrap/windows-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index 7fa2ad3f..aa8e2c43 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index b477d97a..aae60644 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 5d6d6ffd..5a7119c8 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 05a23b23..a68e0ac1 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index dbfe923d..faed3f24 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index b6d1c177..becc1414 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index b7d898fc..14d48bb8 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -59,7 +59,7 @@ static void Modules_Canonify (CHAR *s, ADDRESS s__len, CHAR *d, ADDRESS d__len); static INT16 Modules_CharCount (CHAR *s, ADDRESS s__len); static void Modules_DisplayHaltCode (INT32 code); static void Modules_ExtractPart (CHAR *s, ADDRESS s__len, INT16 *i, CHAR *p, ADDRESS p__len, CHAR *d, ADDRESS d__len); -static void Modules_FindBinaryDir (CHAR *d, ADDRESS d__len); +static void Modules_FindBinaryDir (CHAR *binarydir, ADDRESS binarydir__len); export void Modules_Free (CHAR *name, ADDRESS name__len, BOOLEAN all); export void Modules_GetArg (INT16 n, CHAR *val, ADDRESS val__len); export void Modules_GetIntArg (INT16 n, INT32 *val); @@ -289,42 +289,48 @@ static void Modules_Trim (CHAR *s, ADDRESS s__len, CHAR *d, ADDRESS d__len) typedef CHAR pathstring__12[4096]; -static void Modules_FindBinaryDir (CHAR *d, ADDRESS d__len) +static void Modules_FindBinaryDir (CHAR *binarydir, ADDRESS binarydir__len) { - pathstring__12 executable, dir, testpath, pathlist; + pathstring__12 arg0, pathlist, pathdir, tempstr; INT16 i, j, k; BOOLEAN present; if (Modules_ArgCount < 1) { - d[0] = 0x00; + binarydir[0] = 0x00; return; } - Modules_GetArg(0, (void*)testpath, 4096); - Modules_Trim(testpath, 4096, (void*)executable, 4096); - Modules_Canonify(executable, 4096, (void*)d, d__len); - present = Modules_IsFilePresent(d, d__len); - if ((!present && !Modules_IsAbsolute(testpath, 4096))) { + Modules_GetArg(0, (void*)arg0, 4096); + i = 0; + while ((arg0[__X(i, 4096)] != 0x00 && arg0[__X(i, 4096)] != '/')) { + i += 1; + } + if (arg0[__X(i, 4096)] == '/') { + Modules_Trim(arg0, 4096, (void*)tempstr, 4096); + Modules_Canonify(tempstr, 4096, (void*)binarydir, binarydir__len); + present = Modules_IsFilePresent(binarydir, binarydir__len); + } else { Platform_GetEnv((CHAR*)"PATH", 5, (void*)pathlist, 4096); i = 0; + present = 0; while ((!present && pathlist[__X(i, 4096)] != 0x00)) { - Modules_ExtractPart(pathlist, 4096, &i, (CHAR*)":;", 3, (void*)dir, 4096); - Modules_Trim(dir, 4096, (void*)testpath, 4096); - Modules_AppendPart('/', executable, 4096, (void*)testpath, 4096); - Modules_Canonify(testpath, 4096, (void*)d, d__len); - present = Modules_IsFilePresent(d, d__len); + Modules_ExtractPart(pathlist, 4096, &i, (CHAR*)":;", 3, (void*)pathdir, 4096); + Modules_AppendPart('/', arg0, 4096, (void*)pathdir, 4096); + Modules_Trim(pathdir, 4096, (void*)tempstr, 4096); + Modules_Canonify(tempstr, 4096, (void*)binarydir, binarydir__len); + present = Modules_IsFilePresent(binarydir, binarydir__len); } } if (present) { - k = Modules_CharCount(d, d__len); - while ((k > 0 && !Modules_IsOneOf(d[__X(k - 1, d__len)], (CHAR*)"/\\", 3))) { + k = Modules_CharCount(binarydir, binarydir__len); + while ((k > 0 && !Modules_IsOneOf(binarydir[__X(k - 1, binarydir__len)], (CHAR*)"/\\", 3))) { k -= 1; } if (k == 0) { - d[__X(k, d__len)] = 0x00; + binarydir[__X(k, binarydir__len)] = 0x00; } else { - d[__X(k - 1, d__len)] = 0x00; + binarydir[__X(k - 1, binarydir__len)] = 0x00; } } else { - d[0] = 0x00; + binarydir[0] = 0x00; } } diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index fbc2c47e..ce643d9b 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index 99fd666d..6f2b5545 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index 3f6ee165..589e67db 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index 5e67ae16..bf503129 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index 41739672..59d5e057 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index f37a4f3e..8122e208 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -257,6 +257,9 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWLn(); OPM_LogWStr((CHAR*)"Further development by Norayr Chilingarian, David Brown and others.", 68); OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Loaded from ", 13); + OPM_LogWStr(Modules_BinaryDir, 1024); + OPM_LogWLn(); OPM_LogWLn(); OPM_LogWStr((CHAR*)"Usage:", 7); OPM_LogWLn(); diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index 7664cc0c..4bd19104 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index 4db27f7d..cddb65e4 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index ef56b929..aeb70b16 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index 52f0f328..6820f239 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index 54edc605..815f29a7 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index e93361f7..3bab2d83 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 68edb67f..f3af656f 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 548e85cf..6405cdff 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index 00052c0b..6807e936 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Out.c b/bootstrap/windows-88/Out.c index 11c526ac..d7d446f8 100644 --- a/bootstrap/windows-88/Out.c +++ b/bootstrap/windows-88/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Out.h b/bootstrap/windows-88/Out.h index d2a230b3..20d983e1 100644 --- a/bootstrap/windows-88/Out.h +++ b/bootstrap/windows-88/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index b53acd53..b042778e 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index 825ee326..eaa8d20e 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index bfe15fff..35ecc020 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index ff6ad391..be278393 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index 7f5a8fac..b0c053b8 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index 2a1ebd5f..3d53c582 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index 396b6e14..95d0173a 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index 48899032..c4766a47 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/VT100.c b/bootstrap/windows-88/VT100.c index 0d9d3163..8d349c3e 100644 --- a/bootstrap/windows-88/VT100.c +++ b/bootstrap/windows-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/VT100.h b/bootstrap/windows-88/VT100.h index c552d82d..494b7318 100644 --- a/bootstrap/windows-88/VT100.h +++ b/bootstrap/windows-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index 38cd03d5..f9e7e802 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -65,7 +65,7 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) { - __COPY("gcc -fPIC -g", s, s__len); + __COPY("gcc -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); @@ -100,7 +100,7 @@ void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN stati Strings_Append((CHAR*)" -o ", 5, (void*)cmd, 1023); Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); Strings_Append((CHAR*)" -L\"", 5, (void*)cmd, 1023); - Strings_Append((CHAR*)"", 1, (void*)cmd, 1023); + Strings_Append(OPM_InstallDir, 1024, (void*)cmd, 1023); Strings_Append((CHAR*)"/lib\"", 6, (void*)cmd, 1023); Strings_Append((CHAR*)" -l voc", 8, (void*)cmd, 1023); Strings_Append((CHAR*)"-O", 3, (void*)cmd, 1023); diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index 783d31fb..ee0ea191 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h From 18a365429b74abebd7399fc671c9ec25d71bdf59 Mon Sep 17 00:00:00 2001 From: David Brown Date: Sat, 10 Dec 2016 18:44:59 +0000 Subject: [PATCH 408/580] Add dubug dump to Texts.Mod to help catch OpenBSD specific read failure. --- src/compiler/OPM.Mod | 1 + src/runtime/Texts.Mod | 56 +++++++++++++++++++++++++++++++++-- src/tools/autobuild/report.pl | 6 ++-- 3 files changed, 57 insertions(+), 6 deletions(-) diff --git a/src/compiler/OPM.Mod b/src/compiler/OPM.Mod index e3383840..7ccf49c5 100644 --- a/src/compiler/OPM.Mod +++ b/src/compiler/OPM.Mod @@ -395,6 +395,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) IF (curpos = 0) & inR.eot THEN LogWLn; LogWStr("DEBUG: OPM.Get returned inR.eot at curpos = 0, ch = "); LogWNum(ORD(ch),1); LogW("."); + Texts.DumpReader(inR); END; (* TODO, remove curpos var, and provide fn returning Texts.Pos(inR) - 1. *) (* Or, better still, record symbol position in OPS. *) diff --git a/src/runtime/Texts.Mod b/src/runtime/Texts.Mod index 305b225d..f0658657 100644 --- a/src/runtime/Texts.Mod +++ b/src/runtime/Texts.Mod @@ -1,6 +1,6 @@ MODULE Texts; (** CAS/HM 23.9.93 -- interface based on Texts by JG/NW 6.12.91**) (* << RC, MB, JT *) IMPORT - Files, Modules, Reals, SYSTEM; + Files, Modules, Reals, SYSTEM, Out; (*--- insert field e: Elem into Texts.Scanner and change Texts.Scan to set it in case of class=6 *) @@ -120,6 +120,56 @@ MODULE Texts; (** CAS/HM 23.9.93 -- interface based on Texts by JG/NW 6.12.91** del: Buffer; FontsDefault: FontsFont; +(* Debugging OpenBSD failure *) + + PROCEDURE DumpText(t: Text); + BEGIN + Out.String(" len: "); Out.Int(t.len,1); Out.Ln; + Out.String(" notify: "); Out.Int(SYSTEM.VAL(SYSTEM.ADDRESS, t.notify),1); Out.Ln; + Out.String(" head: "); Out.Int(SYSTEM.VAL(SYSTEM.ADDRESS, t.head),1); Out.Ln; + Out.String(" cache: "); Out.Int(SYSTEM.VAL(SYSTEM.ADDRESS, t.cache),1); Out.Ln; + Out.String(" corg: "); Out.Int(t.corg,1); Out.Ln; + END DumpText; + + PROCEDURE DumpElem(e: Elem); + BEGIN + Out.String(" W: "); Out.Int(e.W,1); Out.Ln; + Out.String(" H: "); Out.Int(e.H,1); Out.Ln; + Out.String(" handle: "); Out.Int(SYSTEM.VAL(SYSTEM.ADDRESS, e.handle),1); Out.Ln; + Out.String(" base: "); IF e.base = NIL THEN Out.String(""); Out.Ln ELSE Out.Ln; DumpText(e.base) END; + END DumpElem; + + PROCEDURE DumpRider(ri: Files.Rider); + BEGIN + Out.String(" res: "); Out.Int(ri.res,1); Out.Ln; + Out.String(" eof: "); IF ri.eof THEN Out.String("TRUE") ELSE Out.String("FALSE") END; Out.Ln; + END DumpRider; + + PROCEDURE DumpRun(ru: Run); + BEGIN + Out.String(" prev: "); Out.Int(SYSTEM.VAL(SYSTEM.ADDRESS, ru.prev),1); Out.Ln; + Out.String(" next: "); Out.Int(SYSTEM.VAL(SYSTEM.ADDRESS, ru.next),1); Out.Ln; + Out.String(" len: "); Out.Int(ru.len,1); Out.Ln; + Out.String(" fnt: "); IF ru.fnt # NIL THEN Out.String(ru.fnt.name) ELSE Out.String("") END; Out.Ln; + Out.String(" col: "); Out.Int(ru.col,1); Out.Ln; + Out.String(" voff: "); Out.Int(ru.voff,1); Out.Ln; + Out.String(" ascii: "); IF ru.ascii THEN Out.String("TRUE") ELSE Out.String("FALSE") END; Out.Ln; + END DumpRun; + + PROCEDURE DumpReader*(re: Reader); + BEGIN + Out.String("Reader:"); Out.Ln; + Out.String(" eot: "); IF re.eot THEN Out.String("TRUE") ELSE Out.String("FALSE") END; Out.Ln; + Out.String(" fnt: "); IF re.fnt # NIL THEN Out.String(re.fnt.name) ELSE Out.String("") END; Out.Ln; + Out.String(" col: "); Out.Int(re.col,1); Out.Ln; + Out.String(" voff: "); Out.Int(re.voff,1); Out.Ln; + Out.String(" org: "); Out.Int(re.org,1); Out.Ln; + Out.String(" off: "); Out.Int(re.off,1); Out.Ln; + Out.String(" elem: "); IF re.elem = NIL THEN Out.String(""); Out.Ln ELSE Out.Ln; DumpElem(re.elem) END; + Out.String(" rider: "); Out.Ln; DumpRider(re.rider); + Out.String(" run: "); IF re.run = NIL THEN Out.String(""); Out.Ln ELSE Out.Ln; DumpRun(re.run) END; + END DumpReader; + PROCEDURE FontsThis(VAR name: ARRAY OF CHAR): FontsFont; VAR F: FontsFont; @@ -340,8 +390,8 @@ MODULE Texts; (** CAS/HM 23.9.93 -- interface based on Texts by JG/NW 6.12.91** IF u IS Piece THEN Files.Read(R.rider, ch); R.elem := NIL; IF (ch = 0AX) & u(Piece).ascii THEN ch := CR (* << LF to CR *) ELSIF (ch = CR) & u(Piece).ascii THEN (* << CR LF to CR *) - pos := Files.Pos(R.rider); Files.Read(R.rider, nextch); - IF nextch = 0AX THEN INC(R.off) ELSE Files.Set(R.rider, u(Piece).file, pos) END + pos := Files.Pos(R.rider); Files.Read(R.rider, nextch); + IF nextch = 0AX THEN INC(R.off) ELSE Files.Set(R.rider, u(Piece).file, pos) END END ELSIF u IS Elem THEN ch := ElemChar; R.elem := u(Elem) ELSE ch := 0X; R.elem := NIL; R.eot := TRUE diff --git a/src/tools/autobuild/report.pl b/src/tools/autobuild/report.pl index ba457a75..459603e4 100644 --- a/src/tools/autobuild/report.pl +++ b/src/tools/autobuild/report.pl @@ -75,9 +75,9 @@ sub parselog { if (/^([0-9.]+) --- Make completed ---$/) { # Go back and convert 'Started' status to 'Failed'. if ($branch =~ m/^Build on/) {$branch = "Build on $fn failed to start.";} - if ($compilerok eq "Started") {$compilerok = "Failed.";} - if ($libraryok eq "Started") {$libraryok = "Failed.";} - if ($tests eq "Started") {$tests = "Failed.";} + if ($compilerok eq "Started") {$compilerok = "Failed";} + if ($libraryok eq "Started") {$libraryok = "Failed";} + if ($tests eq "Started") {$tests = "Failed";} } } close($log); From 7aad84604b1464a1ba93fdea6c40eea5f8f8d0c0 Mon Sep 17 00:00:00 2001 From: David Brown Date: Sat, 10 Dec 2016 18:45:47 +0000 Subject: [PATCH 409/580] Update bootstrap C source. --- bootstrap/unix-44/Compiler.c | 2 +- bootstrap/unix-44/Configuration.c | 4 +- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Files.c | 2 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 2 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 2 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 3 +- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 2 +- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 2 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Out.c | 2 +- bootstrap/unix-44/Out.h | 2 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 357 +++++++++++++++++++-------- bootstrap/unix-44/Texts.h | 3 +- bootstrap/unix-44/VT100.c | 2 +- bootstrap/unix-44/VT100.h | 2 +- bootstrap/unix-44/extTools.c | 2 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-48/Compiler.c | 2 +- bootstrap/unix-48/Configuration.c | 4 +- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Files.c | 2 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 2 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 2 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 3 +- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 2 +- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 2 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Out.c | 2 +- bootstrap/unix-48/Out.h | 2 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 357 +++++++++++++++++++-------- bootstrap/unix-48/Texts.h | 3 +- bootstrap/unix-48/VT100.c | 2 +- bootstrap/unix-48/VT100.h | 2 +- bootstrap/unix-48/extTools.c | 2 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-88/Compiler.c | 2 +- bootstrap/unix-88/Configuration.c | 4 +- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Files.c | 2 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 2 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 2 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 3 +- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 2 +- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 2 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Out.c | 2 +- bootstrap/unix-88/Out.h | 2 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 357 +++++++++++++++++++-------- bootstrap/unix-88/Texts.h | 3 +- bootstrap/unix-88/VT100.c | 2 +- bootstrap/unix-88/VT100.h | 2 +- bootstrap/unix-88/extTools.c | 2 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/windows-48/Compiler.c | 2 +- bootstrap/windows-48/Configuration.c | 4 +- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Files.c | 2 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 2 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 2 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 3 +- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 2 +- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 2 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Out.c | 2 +- bootstrap/windows-48/Out.h | 2 +- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 357 +++++++++++++++++++-------- bootstrap/windows-48/Texts.h | 3 +- bootstrap/windows-48/VT100.c | 2 +- bootstrap/windows-48/VT100.h | 2 +- bootstrap/windows-48/extTools.c | 2 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-88/Compiler.c | 2 +- bootstrap/windows-88/Configuration.c | 4 +- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Files.c | 2 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 2 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 2 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 3 +- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 2 +- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 2 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Out.c | 2 +- bootstrap/windows-88/Out.h | 2 +- bootstrap/windows-88/Platform.c | 2 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 357 +++++++++++++++++++-------- bootstrap/windows-88/Texts.h | 3 +- bootstrap/windows-88/VT100.c | 2 +- bootstrap/windows-88/VT100.h | 2 +- bootstrap/windows-88/extTools.c | 2 +- bootstrap/windows-88/extTools.h | 2 +- 185 files changed, 1450 insertions(+), 715 deletions(-) diff --git a/bootstrap/unix-44/Compiler.c b/bootstrap/unix-44/Compiler.c index 2c7543fe..3b84a5bd 100644 --- a/bootstrap/unix-44/Compiler.c +++ b/bootstrap/unix-44/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index aa8e2c43..319659fe 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index aae60644..d438eca9 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index e2b5f99d..c300b039 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index db989ca0..258422d6 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index fd4d0fc0..a3bcc604 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index 8e773e89..b5a1e4c3 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index 6b2d80be..d2183857 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index e7f2b10f..4cecc8b9 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index 6f2b5545..a7d429eb 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index 589e67db..a49077b0 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index bf503129..89ef22dc 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index 59d5e057..b30a2315 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index ca3cffc1..0c8ab9b3 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -494,6 +494,7 @@ void OPM_Get (CHAR *ch) OPM_LogWStr((CHAR*)"DEBUG: OPM.Get returned inR.eot at curpos = 0, ch = ", 53); OPM_LogWNum((INT16)*ch, 1); OPM_LogW('.'); + Texts_DumpReader(OPM_inR); } if ((*ch < 0x09 && !OPM_inR.eot)) { *ch = ' '; diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index 4bd19104..d1c71f13 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index 8a07b672..dfca5a85 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index aeb70b16..c82b4d80 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index 6820f239..a3b32b0c 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index 815f29a7..99c62664 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index 33e6189e..59059803 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index f3af656f..1aec7cad 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index c1062b81..1e66dbde 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index 6807e936..9ad5508d 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Out.c b/bootstrap/unix-44/Out.c index 87afc49d..fd578128 100644 --- a/bootstrap/unix-44/Out.c +++ b/bootstrap/unix-44/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Out.h b/bootstrap/unix-44/Out.h index 20d983e1..a3f5db4d 100644 --- a/bootstrap/unix-44/Out.h +++ b/bootstrap/unix-44/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index c7d45501..da9669d9 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index ed09ed5c..d68c4ae0 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 35ecc020..8ba81525 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index be278393..0fe868e0 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index b0c053b8..a6a802c4 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index 3d53c582..bec035c4 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index e3cefcdc..0696f4d7 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -8,6 +8,7 @@ #include "SYSTEM.h" #include "Files.h" #include "Modules.h" +#include "Out.h" #include "Reals.h" typedef @@ -191,6 +192,11 @@ export void Texts_Close (Texts_Text T, CHAR *name, ADDRESS name__len); export void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); export void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); export void Texts_Delete (Texts_Text T, INT32 beg, INT32 end); +static void Texts_DumpElem (Texts_Elem e); +export void Texts_DumpReader (Texts_Reader re); +static void Texts_DumpRider (Files_Rider ri); +static void Texts_DumpRun (Texts_Run ru); +static void Texts_DumpText (Texts_Text t); export Texts_Text Texts_ElemBase (Texts_Elem E); export INT32 Texts_ElemPos (Texts_Elem E); static void Texts_Find (Texts_Text T, INT32 *pos, Texts_Run *u, INT32 *org, INT32 *off); @@ -232,6 +238,144 @@ export void Texts_WriteRealHex (Texts_Writer *W, ADDRESS *W__typ, REAL x); export void Texts_WriteString (Texts_Writer *W, ADDRESS *W__typ, CHAR *s, ADDRESS s__len); +static void Texts_DumpText (Texts_Text t) +{ + Out_String((CHAR*)" len: ", 15); + Out_Int(t->len, 1); + Out_Ln(); + Out_String((CHAR*)" notify: ", 15); + Out_Int((INT32)(ADDRESS)t->notify, 1); + Out_Ln(); + Out_String((CHAR*)" head: ", 15); + Out_Int((INT32)(ADDRESS)t->head, 1); + Out_Ln(); + Out_String((CHAR*)" cache: ", 15); + Out_Int((INT32)(ADDRESS)t->cache, 1); + Out_Ln(); + Out_String((CHAR*)" corg: ", 15); + Out_Int(t->corg, 1); + Out_Ln(); +} + +static void Texts_DumpElem (Texts_Elem e) +{ + Out_String((CHAR*)" W: ", 13); + Out_Int(e->W, 1); + Out_Ln(); + Out_String((CHAR*)" H: ", 13); + Out_Int(e->H, 1); + Out_Ln(); + Out_String((CHAR*)" handle: ", 13); + Out_Int((INT32)(ADDRESS)e->handle, 1); + Out_Ln(); + Out_String((CHAR*)" base: ", 13); + if (e->base == NIL) { + Out_String((CHAR*)"", 6); + Out_Ln(); + } else { + Out_Ln(); + Texts_DumpText(e->base); + } +} + +static void Texts_DumpRider (Files_Rider ri) +{ + Out_String((CHAR*)" res: ", 10); + Out_Int(ri.res, 1); + Out_Ln(); + Out_String((CHAR*)" eof: ", 10); + if (ri.eof) { + Out_String((CHAR*)"TRUE", 5); + } else { + Out_String((CHAR*)"FALSE", 6); + } + Out_Ln(); +} + +static void Texts_DumpRun (Texts_Run ru) +{ + Out_String((CHAR*)" prev: ", 12); + Out_Int((INT32)(ADDRESS)ru->prev, 1); + Out_Ln(); + Out_String((CHAR*)" next: ", 12); + Out_Int((INT32)(ADDRESS)ru->next, 1); + Out_Ln(); + Out_String((CHAR*)" len: ", 12); + Out_Int(ru->len, 1); + Out_Ln(); + Out_String((CHAR*)" fnt: ", 12); + if (ru->fnt != NIL) { + Out_String(ru->fnt->name, 32); + } else { + Out_String((CHAR*)"", 6); + } + Out_Ln(); + Out_String((CHAR*)" col: ", 12); + Out_Int(ru->col, 1); + Out_Ln(); + Out_String((CHAR*)" voff: ", 12); + Out_Int(ru->voff, 1); + Out_Ln(); + Out_String((CHAR*)" ascii: ", 12); + if (ru->ascii) { + Out_String((CHAR*)"TRUE", 5); + } else { + Out_String((CHAR*)"FALSE", 6); + } + Out_Ln(); +} + +void Texts_DumpReader (Texts_Reader re) +{ + Out_String((CHAR*)"Reader:", 8); + Out_Ln(); + Out_String((CHAR*)" eot: ", 10); + if (re.eot) { + Out_String((CHAR*)"TRUE", 5); + } else { + Out_String((CHAR*)"FALSE", 6); + } + Out_Ln(); + Out_String((CHAR*)" fnt: ", 10); + if (re.fnt != NIL) { + Out_String(re.fnt->name, 32); + } else { + Out_String((CHAR*)"", 6); + } + Out_Ln(); + Out_String((CHAR*)" col: ", 10); + Out_Int(re.col, 1); + Out_Ln(); + Out_String((CHAR*)" voff: ", 10); + Out_Int(re.voff, 1); + Out_Ln(); + Out_String((CHAR*)" org: ", 10); + Out_Int(re.org, 1); + Out_Ln(); + Out_String((CHAR*)" off: ", 10); + Out_Int(re.off, 1); + Out_Ln(); + Out_String((CHAR*)" elem: ", 10); + if (re.elem == NIL) { + Out_String((CHAR*)"", 6); + Out_Ln(); + } else { + Out_Ln(); + Texts_DumpElem(re.elem); + } + Out_String((CHAR*)" rider: ", 10); + Out_Ln(); + Texts_DumpRider(re.rider); + Out_String((CHAR*)" run: ", 10); + if (re.run == NIL) { + Out_String((CHAR*)"", 6); + Out_Ln(); + } else { + Out_Ln(); + Texts_DumpRun(re.run); + } +} + static Texts_FontsFont Texts_FontsThis (CHAR *name, ADDRESS name__len) { Texts_FontsFont F = NIL; @@ -716,32 +860,32 @@ void Texts_OpenScanner (Texts_Scanner *S, ADDRESS *S__typ, Texts_Text T, INT32 p (*S).nextCh = ' '; } -static struct Scan__31 { +static struct Scan__36 { Texts_Scanner *S; ADDRESS *S__typ; CHAR *ch; BOOLEAN *negE; INT16 *e; - struct Scan__31 *lnk; -} *Scan__31_s; + struct Scan__36 *lnk; +} *Scan__36_s; -static void ReadScaleFactor__32 (void); +static void ReadScaleFactor__37 (void); -static void ReadScaleFactor__32 (void) +static void ReadScaleFactor__37 (void) { - Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); - if (*Scan__31_s->ch == '-') { - *Scan__31_s->negE = 1; - Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); + Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); + if (*Scan__36_s->ch == '-') { + *Scan__36_s->negE = 1; + Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); } else { - *Scan__31_s->negE = 0; - if (*Scan__31_s->ch == '+') { - Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); + *Scan__36_s->negE = 0; + if (*Scan__36_s->ch == '+') { + Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); } } - while (('0' <= *Scan__31_s->ch && *Scan__31_s->ch <= '9')) { - *Scan__31_s->e = (*Scan__31_s->e * 10 + (INT16)*Scan__31_s->ch) - 48; - Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); + while (('0' <= *Scan__36_s->ch && *Scan__36_s->ch <= '9')) { + *Scan__36_s->e = (*Scan__36_s->e * 10 + (INT16)*Scan__36_s->ch) - 48; + Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); } } @@ -755,13 +899,13 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) REAL x, f; LONGREAL y, g; CHAR d[32]; - struct Scan__31 _s; + struct Scan__36 _s; _s.S = S; _s.S__typ = S__typ; _s.ch = &ch; _s.negE = &negE; _s.e = &e; - _s.lnk = Scan__31_s; - Scan__31_s = &_s; + _s.lnk = Scan__36_s; + Scan__36_s = &_s; ch = (*S).nextCh; i = 0; for (;;) { @@ -862,7 +1006,7 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) y = ((INT16)d[__X(j, 32)] - 48) * g + y; j += 1; } - ReadScaleFactor__32(); + ReadScaleFactor__37(); if (negE) { if (e <= 308) { y = y / (LONGREAL)Reals_TenL(e); @@ -895,7 +1039,7 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) j += 1; } if (ch == 'E') { - ReadScaleFactor__32(); + ReadScaleFactor__37(); } if (negE) { if (e <= 38) { @@ -948,7 +1092,7 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) } } (*S).nextCh = ch; - Scan__31_s = _s.lnk; + Scan__36_s = _s.lnk; } void Texts_OpenWriter (Texts_Writer *W, ADDRESS *W__typ) @@ -1167,30 +1311,30 @@ void Texts_WriteReal (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n) } } -static struct WriteRealFix__53 { +static struct WriteRealFix__58 { Texts_Writer *W; ADDRESS *W__typ; INT16 *i; CHAR (*d)[9]; - struct WriteRealFix__53 *lnk; -} *WriteRealFix__53_s; + struct WriteRealFix__58 *lnk; +} *WriteRealFix__58_s; -static void dig__54 (INT16 n); -static void seq__56 (CHAR ch, INT16 n); +static void dig__59 (INT16 n); +static void seq__61 (CHAR ch, INT16 n); -static void seq__56 (CHAR ch, INT16 n) +static void seq__61 (CHAR ch, INT16 n) { while (n > 0) { - Texts_Write(&*WriteRealFix__53_s->W, WriteRealFix__53_s->W__typ, ch); + Texts_Write(&*WriteRealFix__58_s->W, WriteRealFix__58_s->W__typ, ch); n -= 1; } } -static void dig__54 (INT16 n) +static void dig__59 (INT16 n) { while (n > 0) { - *WriteRealFix__53_s->i -= 1; - Texts_Write(&*WriteRealFix__53_s->W, WriteRealFix__53_s->W__typ, (*WriteRealFix__53_s->d)[__X(*WriteRealFix__53_s->i, 9)]); + *WriteRealFix__58_s->i -= 1; + Texts_Write(&*WriteRealFix__58_s->W, WriteRealFix__58_s->W__typ, (*WriteRealFix__58_s->d)[__X(*WriteRealFix__58_s->i, 9)]); n -= 1; } } @@ -1201,23 +1345,23 @@ void Texts_WriteRealFix (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n, INT1 CHAR sign; REAL x0; CHAR d[9]; - struct WriteRealFix__53 _s; + struct WriteRealFix__58 _s; _s.W = W; _s.W__typ = W__typ; _s.i = &i; _s.d = (void*)d; - _s.lnk = WriteRealFix__53_s; - WriteRealFix__53_s = &_s; + _s.lnk = WriteRealFix__58_s; + WriteRealFix__58_s = &_s; e = Reals_Expo(x); if (k < 0) { k = 0; } if (e == 0) { - seq__56(' ', (n - k) - 2); + seq__61(' ', (n - k) - 2); Texts_Write(&*W, W__typ, '0'); - seq__56(' ', k + 1); + seq__61(' ', k + 1); } else if (e == 255) { Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", 5); - seq__56(' ', n - 4); + seq__61(' ', n - 4); } else { e = __ASHR((e - 127) * 77, 8); if (x < (REAL)0) { @@ -1250,21 +1394,21 @@ void Texts_WriteRealFix (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n, INT1 i = k + e; Reals_Convert(x, i, (void*)d, 9); if (e > 0) { - seq__56(' ', ((n - e) - k) - 2); + seq__61(' ', ((n - e) - k) - 2); Texts_Write(&*W, W__typ, sign); - dig__54(e); + dig__59(e); Texts_Write(&*W, W__typ, '.'); - dig__54(k); + dig__59(k); } else { - seq__56(' ', (n - k) - 3); + seq__61(' ', (n - k) - 3); Texts_Write(&*W, W__typ, sign); Texts_Write(&*W, W__typ, '0'); Texts_Write(&*W, W__typ, '.'); - seq__56('0', -e); - dig__54(k + e); + seq__61('0', -e); + dig__59(k + e); } } - WriteRealFix__53_s = _s.lnk; + WriteRealFix__58_s = _s.lnk; } void Texts_WriteRealHex (Texts_Writer *W, ADDRESS *W__typ, REAL x) @@ -1363,48 +1507,48 @@ void Texts_WriteLongRealHex (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x) } while (!(i == 16)); } -static struct WriteDate__43 { +static struct WriteDate__48 { Texts_Writer *W; ADDRESS *W__typ; - struct WriteDate__43 *lnk; -} *WriteDate__43_s; + struct WriteDate__48 *lnk; +} *WriteDate__48_s; -static void WritePair__44 (CHAR ch, INT32 x); +static void WritePair__49 (CHAR ch, INT32 x); -static void WritePair__44 (CHAR ch, INT32 x) +static void WritePair__49 (CHAR ch, INT32 x) { - Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, ch); - Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)(__DIV(x, 10) + 48)); - Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)((int)__MOD(x, 10) + 48)); + Texts_Write(&*WriteDate__48_s->W, WriteDate__48_s->W__typ, ch); + Texts_Write(&*WriteDate__48_s->W, WriteDate__48_s->W__typ, (CHAR)(__DIV(x, 10) + 48)); + Texts_Write(&*WriteDate__48_s->W, WriteDate__48_s->W__typ, (CHAR)((int)__MOD(x, 10) + 48)); } void Texts_WriteDate (Texts_Writer *W, ADDRESS *W__typ, INT32 t, INT32 d) { - struct WriteDate__43 _s; + struct WriteDate__48 _s; _s.W = W; _s.W__typ = W__typ; - _s.lnk = WriteDate__43_s; - WriteDate__43_s = &_s; - WritePair__44(' ', __MASK(d, -32)); - WritePair__44('.', __MASK(__ASHR(d, 5), -16)); - WritePair__44('.', __MASK(__ASHR(d, 9), -128)); - WritePair__44(' ', __MASK(__ASHR(t, 12), -32)); - WritePair__44(':', __MASK(__ASHR(t, 6), -64)); - WritePair__44(':', __MASK(t, -64)); - WriteDate__43_s = _s.lnk; + _s.lnk = WriteDate__48_s; + WriteDate__48_s = &_s; + WritePair__49(' ', __MASK(d, -32)); + WritePair__49('.', __MASK(__ASHR(d, 5), -16)); + WritePair__49('.', __MASK(__ASHR(d, 9), -128)); + WritePair__49(' ', __MASK(__ASHR(t, 12), -32)); + WritePair__49(':', __MASK(__ASHR(t, 6), -64)); + WritePair__49(':', __MASK(t, -64)); + WriteDate__48_s = _s.lnk; } -static struct Load0__16 { +static struct Load0__21 { Texts_Text *T; INT8 *ecnt; Files_File *f; Texts_FileMsg *msg; CHAR (*mods)[64][32], (*procs)[64][32]; - struct Load0__16 *lnk; -} *Load0__16_s; + struct Load0__21 *lnk; +} *Load0__21_s; -static void LoadElem__17 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e); +static void LoadElem__22 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e); -static void LoadElem__17 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e) +static void LoadElem__22 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e) { Modules_Module M = NIL; Modules_Command Cmd; @@ -1415,15 +1559,15 @@ static void LoadElem__17 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span Files_ReadLInt(&*r, r__typ, &ew); Files_ReadLInt(&*r, r__typ, &eh); Files_Read(&*r, r__typ, (void*)&eno); - if (eno > *Load0__16_s->ecnt) { - *Load0__16_s->ecnt = eno; - Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->mods)[__X(eno, 64)], 32); - Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->procs)[__X(eno, 64)], 32); + if (eno > *Load0__21_s->ecnt) { + *Load0__21_s->ecnt = eno; + Files_ReadString(&*r, r__typ, (void*)(*Load0__21_s->mods)[__X(eno, 64)], 32); + Files_ReadString(&*r, r__typ, (void*)(*Load0__21_s->procs)[__X(eno, 64)], 32); } org = Files_Pos(&*r, r__typ); - M = Modules_ThisMod((*Load0__16_s->mods)[__X(eno, 64)], 32); + M = Modules_ThisMod((*Load0__21_s->mods)[__X(eno, 64)], 32); if (M != NIL) { - Cmd = Modules_ThisCommand(M, (*Load0__16_s->procs)[__X(eno, 64)], 32); + Cmd = Modules_ThisCommand(M, (*Load0__21_s->procs)[__X(eno, 64)], 32); if (Cmd != NIL) { (*Cmd)(); } @@ -1432,25 +1576,25 @@ static void LoadElem__17 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span if (*e != NIL) { (*e)->W = ew; (*e)->H = eh; - (*e)->base = *Load0__16_s->T; - (*Load0__16_s->msg).pos = pos; - (*(*e)->handle)(*e, (void*)&*Load0__16_s->msg, Texts_FileMsg__typ); + (*e)->base = *Load0__21_s->T; + (*Load0__21_s->msg).pos = pos; + (*(*e)->handle)(*e, (void*)&*Load0__21_s->msg, Texts_FileMsg__typ); if (Files_Pos(&*r, r__typ) != org + span) { *e = NIL; } } if (*e == NIL) { - Files_Set(&*r, r__typ, *Load0__16_s->f, org + span); + Files_Set(&*r, r__typ, *Load0__21_s->f, org + span); __NEW(a, Texts__1); a->W = ew; a->H = eh; a->handle = Texts_HandleAlien; - a->base = *Load0__16_s->T; - a->file = *Load0__16_s->f; + a->base = *Load0__21_s->T; + a->file = *Load0__21_s->f; a->org = org; a->span = span; - __COPY((*Load0__16_s->mods)[__X(eno, 64)], a->mod, 32); - __COPY((*Load0__16_s->procs)[__X(eno, 64)], a->proc, 32); + __COPY((*Load0__21_s->mods)[__X(eno, 64)], a->mod, 32); + __COPY((*Load0__21_s->procs)[__X(eno, 64)], a->proc, 32); *e = (Texts_Elem)a; } } @@ -1467,15 +1611,15 @@ static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) CHAR mods[64][32], procs[64][32]; CHAR name[32]; Texts_FontsFont fnts[32]; - struct Load0__16 _s; + struct Load0__21 _s; _s.T = &T; _s.ecnt = &ecnt; _s.f = &f; _s.msg = &msg; _s.mods = (void*)mods; _s.procs = (void*)procs; - _s.lnk = Load0__16_s; - Load0__16_s = &_s; + _s.lnk = Load0__21_s; + Load0__21_s = &_s; pos = Files_Pos(&*r, r__typ); f = Files_Base(&*r, r__typ); __NEW(u, Texts_RunDesc); @@ -1508,7 +1652,7 @@ static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) un = (Texts_Run)p; un->len = plen; } else { - LoadElem__17(&msg.r, Files_Rider__typ, pos - org, -plen, &e); + LoadElem__22(&msg.r, Files_Rider__typ, pos - org, -plen, &e); un = (Texts_Run)e; un->len = 1; } @@ -1526,7 +1670,7 @@ static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) T->corg = 0; Files_ReadLInt(&msg.r, Files_Rider__typ, &T->len); Files_Set(&*r, r__typ, f, Files_Pos(&msg.r, Files_Rider__typ) + T->len); - Load0__16_s = _s.lnk; + Load0__21_s = _s.lnk; } void Texts_Load (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) @@ -1595,25 +1739,25 @@ void Texts_Open (Texts_Text T, CHAR *name, ADDRESS name__len) __DEL(name); } -static struct Store__39 { +static struct Store__44 { INT8 *ecnt; Texts_FileMsg *msg; Texts_IdentifyMsg *iden; CHAR (*mods)[64][32], (*procs)[64][32]; - struct Store__39 *lnk; -} *Store__39_s; + struct Store__44 *lnk; +} *Store__44_s; -static void StoreElem__40 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e); +static void StoreElem__45 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e); -static void StoreElem__40 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e) +static void StoreElem__45 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e) { Files_Rider r1; INT32 org, span; INT8 eno; - __COPY((*Store__39_s->iden).mod, (*Store__39_s->mods)[__X(*Store__39_s->ecnt, 64)], 32); - __COPY((*Store__39_s->iden).proc, (*Store__39_s->procs)[__X(*Store__39_s->ecnt, 64)], 32); + __COPY((*Store__44_s->iden).mod, (*Store__44_s->mods)[__X(*Store__44_s->ecnt, 64)], 32); + __COPY((*Store__44_s->iden).proc, (*Store__44_s->procs)[__X(*Store__44_s->ecnt, 64)], 32); eno = 1; - while (__STRCMP((*Store__39_s->mods)[__X(eno, 64)], (*Store__39_s->iden).mod) != 0 || __STRCMP((*Store__39_s->procs)[__X(eno, 64)], (*Store__39_s->iden).proc) != 0) { + while (__STRCMP((*Store__44_s->mods)[__X(eno, 64)], (*Store__44_s->iden).mod) != 0 || __STRCMP((*Store__44_s->procs)[__X(eno, 64)], (*Store__44_s->iden).proc) != 0) { eno += 1; } Files_Set(&r1, Files_Rider__typ, Files_Base(&*r, r__typ), Files_Pos(&*r, r__typ)); @@ -1621,14 +1765,14 @@ static void StoreElem__40 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Ele Files_WriteLInt(&*r, r__typ, 0); Files_WriteLInt(&*r, r__typ, 0); Files_Write(&*r, r__typ, eno); - if (eno == *Store__39_s->ecnt) { - *Store__39_s->ecnt += 1; - Files_WriteString(&*r, r__typ, (*Store__39_s->iden).mod, 32); - Files_WriteString(&*r, r__typ, (*Store__39_s->iden).proc, 32); + if (eno == *Store__44_s->ecnt) { + *Store__44_s->ecnt += 1; + Files_WriteString(&*r, r__typ, (*Store__44_s->iden).mod, 32); + Files_WriteString(&*r, r__typ, (*Store__44_s->iden).proc, 32); } - (*Store__39_s->msg).pos = pos; + (*Store__44_s->msg).pos = pos; org = Files_Pos(&*r, r__typ); - (*e->handle)(e, (void*)&*Store__39_s->msg, Texts_FileMsg__typ); + (*e->handle)(e, (void*)&*Store__44_s->msg, Texts_FileMsg__typ); span = Files_Pos(&*r, r__typ) - org; Files_WriteLInt(&r1, Files_Rider__typ, -span); Files_WriteLInt(&r1, Files_Rider__typ, e->W); @@ -1649,14 +1793,14 @@ void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) CHAR mods[64][32], procs[64][32]; Texts_FontsFont fnts[32]; CHAR block[1024]; - struct Store__39 _s; + struct Store__44 _s; _s.ecnt = &ecnt; _s.msg = &msg; _s.iden = &iden; _s.mods = (void*)mods; _s.procs = (void*)procs; - _s.lnk = Store__39_s; - Store__39_s = &_s; + _s.lnk = Store__44_s; + Store__44_s = &_s; org = Files_Pos(&*r, r__typ); msg.id = 1; msg.r = *r; @@ -1698,7 +1842,7 @@ void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) pos += rlen; u = un; } else if (iden.mod[0] != 0x00) { - StoreElem__40(&msg.r, Files_Rider__typ, pos, __GUARDP(u, Texts_ElemDesc, 1)); + StoreElem__45(&msg.r, Files_Rider__typ, pos, __GUARDP(u, Texts_ElemDesc, 1)); pos += 1; u = u->next; } else { @@ -1752,7 +1896,7 @@ void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) if (T->notify != NIL) { (*T->notify)(T, 3, 0, 0); } - Store__39_s = _s.lnk; + Store__44_s = _s.lnk; } void Texts_Close (Texts_Text T, CHAR *name, ADDRESS name__len) @@ -1809,6 +1953,7 @@ export void *Texts__init(void) __DEFMOD; __MODULE_IMPORT(Files); __MODULE_IMPORT(Modules); + __MODULE_IMPORT(Out); __MODULE_IMPORT(Reals); __REGMOD("Texts", EnumPtrs); __INITYP(Texts_FontDesc, Texts_FontDesc, 0); diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index 8be25bb5..9c320190 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h @@ -134,6 +134,7 @@ import void Texts_Close (Texts_Text T, CHAR *name, ADDRESS name__len); import void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); import void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); import void Texts_Delete (Texts_Text T, INT32 beg, INT32 end); +import void Texts_DumpReader (Texts_Reader re); import Texts_Text Texts_ElemBase (Texts_Elem E); import INT32 Texts_ElemPos (Texts_Elem E); import void Texts_Insert (Texts_Text T, INT32 pos, Texts_Buffer B); diff --git a/bootstrap/unix-44/VT100.c b/bootstrap/unix-44/VT100.c index 8d349c3e..669a337a 100644 --- a/bootstrap/unix-44/VT100.c +++ b/bootstrap/unix-44/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/VT100.h b/bootstrap/unix-44/VT100.h index 494b7318..809a6082 100644 --- a/bootstrap/unix-44/VT100.h +++ b/bootstrap/unix-44/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index f9e7e802..b9ca8d5a 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index ee0ea191..6a31ee74 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/Compiler.c b/bootstrap/unix-48/Compiler.c index 2c7543fe..3b84a5bd 100644 --- a/bootstrap/unix-48/Compiler.c +++ b/bootstrap/unix-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index aa8e2c43..319659fe 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index aae60644..d438eca9 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index e2b5f99d..c300b039 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index db989ca0..258422d6 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index fd4d0fc0..a3bcc604 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index 8e773e89..b5a1e4c3 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index 6b2d80be..d2183857 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index e7f2b10f..4cecc8b9 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index 6f2b5545..a7d429eb 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index 589e67db..a49077b0 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index bf503129..89ef22dc 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index 59d5e057..b30a2315 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index ca3cffc1..0c8ab9b3 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -494,6 +494,7 @@ void OPM_Get (CHAR *ch) OPM_LogWStr((CHAR*)"DEBUG: OPM.Get returned inR.eot at curpos = 0, ch = ", 53); OPM_LogWNum((INT16)*ch, 1); OPM_LogW('.'); + Texts_DumpReader(OPM_inR); } if ((*ch < 0x09 && !OPM_inR.eot)) { *ch = ' '; diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index 4bd19104..d1c71f13 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index 8a07b672..dfca5a85 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index aeb70b16..c82b4d80 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index 6820f239..a3b32b0c 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index 815f29a7..99c62664 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 8237bf8d..6edc4b6a 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index f3af656f..1aec7cad 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index c1062b81..1e66dbde 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index 6807e936..9ad5508d 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Out.c b/bootstrap/unix-48/Out.c index 87afc49d..fd578128 100644 --- a/bootstrap/unix-48/Out.c +++ b/bootstrap/unix-48/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Out.h b/bootstrap/unix-48/Out.h index 20d983e1..a3f5db4d 100644 --- a/bootstrap/unix-48/Out.h +++ b/bootstrap/unix-48/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index c7d45501..da9669d9 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index ed09ed5c..d68c4ae0 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 35ecc020..8ba81525 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index be278393..0fe868e0 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index b0c053b8..a6a802c4 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index 3d53c582..bec035c4 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index 1cca7d56..d1a7f696 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -8,6 +8,7 @@ #include "SYSTEM.h" #include "Files.h" #include "Modules.h" +#include "Out.h" #include "Reals.h" typedef @@ -191,6 +192,11 @@ export void Texts_Close (Texts_Text T, CHAR *name, ADDRESS name__len); export void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); export void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); export void Texts_Delete (Texts_Text T, INT32 beg, INT32 end); +static void Texts_DumpElem (Texts_Elem e); +export void Texts_DumpReader (Texts_Reader re); +static void Texts_DumpRider (Files_Rider ri); +static void Texts_DumpRun (Texts_Run ru); +static void Texts_DumpText (Texts_Text t); export Texts_Text Texts_ElemBase (Texts_Elem E); export INT32 Texts_ElemPos (Texts_Elem E); static void Texts_Find (Texts_Text T, INT32 *pos, Texts_Run *u, INT32 *org, INT32 *off); @@ -232,6 +238,144 @@ export void Texts_WriteRealHex (Texts_Writer *W, ADDRESS *W__typ, REAL x); export void Texts_WriteString (Texts_Writer *W, ADDRESS *W__typ, CHAR *s, ADDRESS s__len); +static void Texts_DumpText (Texts_Text t) +{ + Out_String((CHAR*)" len: ", 15); + Out_Int(t->len, 1); + Out_Ln(); + Out_String((CHAR*)" notify: ", 15); + Out_Int((INT32)(ADDRESS)t->notify, 1); + Out_Ln(); + Out_String((CHAR*)" head: ", 15); + Out_Int((INT32)(ADDRESS)t->head, 1); + Out_Ln(); + Out_String((CHAR*)" cache: ", 15); + Out_Int((INT32)(ADDRESS)t->cache, 1); + Out_Ln(); + Out_String((CHAR*)" corg: ", 15); + Out_Int(t->corg, 1); + Out_Ln(); +} + +static void Texts_DumpElem (Texts_Elem e) +{ + Out_String((CHAR*)" W: ", 13); + Out_Int(e->W, 1); + Out_Ln(); + Out_String((CHAR*)" H: ", 13); + Out_Int(e->H, 1); + Out_Ln(); + Out_String((CHAR*)" handle: ", 13); + Out_Int((INT32)(ADDRESS)e->handle, 1); + Out_Ln(); + Out_String((CHAR*)" base: ", 13); + if (e->base == NIL) { + Out_String((CHAR*)"", 6); + Out_Ln(); + } else { + Out_Ln(); + Texts_DumpText(e->base); + } +} + +static void Texts_DumpRider (Files_Rider ri) +{ + Out_String((CHAR*)" res: ", 10); + Out_Int(ri.res, 1); + Out_Ln(); + Out_String((CHAR*)" eof: ", 10); + if (ri.eof) { + Out_String((CHAR*)"TRUE", 5); + } else { + Out_String((CHAR*)"FALSE", 6); + } + Out_Ln(); +} + +static void Texts_DumpRun (Texts_Run ru) +{ + Out_String((CHAR*)" prev: ", 12); + Out_Int((INT32)(ADDRESS)ru->prev, 1); + Out_Ln(); + Out_String((CHAR*)" next: ", 12); + Out_Int((INT32)(ADDRESS)ru->next, 1); + Out_Ln(); + Out_String((CHAR*)" len: ", 12); + Out_Int(ru->len, 1); + Out_Ln(); + Out_String((CHAR*)" fnt: ", 12); + if (ru->fnt != NIL) { + Out_String(ru->fnt->name, 32); + } else { + Out_String((CHAR*)"", 6); + } + Out_Ln(); + Out_String((CHAR*)" col: ", 12); + Out_Int(ru->col, 1); + Out_Ln(); + Out_String((CHAR*)" voff: ", 12); + Out_Int(ru->voff, 1); + Out_Ln(); + Out_String((CHAR*)" ascii: ", 12); + if (ru->ascii) { + Out_String((CHAR*)"TRUE", 5); + } else { + Out_String((CHAR*)"FALSE", 6); + } + Out_Ln(); +} + +void Texts_DumpReader (Texts_Reader re) +{ + Out_String((CHAR*)"Reader:", 8); + Out_Ln(); + Out_String((CHAR*)" eot: ", 10); + if (re.eot) { + Out_String((CHAR*)"TRUE", 5); + } else { + Out_String((CHAR*)"FALSE", 6); + } + Out_Ln(); + Out_String((CHAR*)" fnt: ", 10); + if (re.fnt != NIL) { + Out_String(re.fnt->name, 32); + } else { + Out_String((CHAR*)"", 6); + } + Out_Ln(); + Out_String((CHAR*)" col: ", 10); + Out_Int(re.col, 1); + Out_Ln(); + Out_String((CHAR*)" voff: ", 10); + Out_Int(re.voff, 1); + Out_Ln(); + Out_String((CHAR*)" org: ", 10); + Out_Int(re.org, 1); + Out_Ln(); + Out_String((CHAR*)" off: ", 10); + Out_Int(re.off, 1); + Out_Ln(); + Out_String((CHAR*)" elem: ", 10); + if (re.elem == NIL) { + Out_String((CHAR*)"", 6); + Out_Ln(); + } else { + Out_Ln(); + Texts_DumpElem(re.elem); + } + Out_String((CHAR*)" rider: ", 10); + Out_Ln(); + Texts_DumpRider(re.rider); + Out_String((CHAR*)" run: ", 10); + if (re.run == NIL) { + Out_String((CHAR*)"", 6); + Out_Ln(); + } else { + Out_Ln(); + Texts_DumpRun(re.run); + } +} + static Texts_FontsFont Texts_FontsThis (CHAR *name, ADDRESS name__len) { Texts_FontsFont F = NIL; @@ -716,32 +860,32 @@ void Texts_OpenScanner (Texts_Scanner *S, ADDRESS *S__typ, Texts_Text T, INT32 p (*S).nextCh = ' '; } -static struct Scan__31 { +static struct Scan__36 { Texts_Scanner *S; ADDRESS *S__typ; CHAR *ch; BOOLEAN *negE; INT16 *e; - struct Scan__31 *lnk; -} *Scan__31_s; + struct Scan__36 *lnk; +} *Scan__36_s; -static void ReadScaleFactor__32 (void); +static void ReadScaleFactor__37 (void); -static void ReadScaleFactor__32 (void) +static void ReadScaleFactor__37 (void) { - Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); - if (*Scan__31_s->ch == '-') { - *Scan__31_s->negE = 1; - Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); + Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); + if (*Scan__36_s->ch == '-') { + *Scan__36_s->negE = 1; + Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); } else { - *Scan__31_s->negE = 0; - if (*Scan__31_s->ch == '+') { - Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); + *Scan__36_s->negE = 0; + if (*Scan__36_s->ch == '+') { + Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); } } - while (('0' <= *Scan__31_s->ch && *Scan__31_s->ch <= '9')) { - *Scan__31_s->e = (*Scan__31_s->e * 10 + (INT16)*Scan__31_s->ch) - 48; - Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); + while (('0' <= *Scan__36_s->ch && *Scan__36_s->ch <= '9')) { + *Scan__36_s->e = (*Scan__36_s->e * 10 + (INT16)*Scan__36_s->ch) - 48; + Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); } } @@ -755,13 +899,13 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) REAL x, f; LONGREAL y, g; CHAR d[32]; - struct Scan__31 _s; + struct Scan__36 _s; _s.S = S; _s.S__typ = S__typ; _s.ch = &ch; _s.negE = &negE; _s.e = &e; - _s.lnk = Scan__31_s; - Scan__31_s = &_s; + _s.lnk = Scan__36_s; + Scan__36_s = &_s; ch = (*S).nextCh; i = 0; for (;;) { @@ -862,7 +1006,7 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) y = ((INT16)d[__X(j, 32)] - 48) * g + y; j += 1; } - ReadScaleFactor__32(); + ReadScaleFactor__37(); if (negE) { if (e <= 308) { y = y / (LONGREAL)Reals_TenL(e); @@ -895,7 +1039,7 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) j += 1; } if (ch == 'E') { - ReadScaleFactor__32(); + ReadScaleFactor__37(); } if (negE) { if (e <= 38) { @@ -948,7 +1092,7 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) } } (*S).nextCh = ch; - Scan__31_s = _s.lnk; + Scan__36_s = _s.lnk; } void Texts_OpenWriter (Texts_Writer *W, ADDRESS *W__typ) @@ -1167,30 +1311,30 @@ void Texts_WriteReal (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n) } } -static struct WriteRealFix__53 { +static struct WriteRealFix__58 { Texts_Writer *W; ADDRESS *W__typ; INT16 *i; CHAR (*d)[9]; - struct WriteRealFix__53 *lnk; -} *WriteRealFix__53_s; + struct WriteRealFix__58 *lnk; +} *WriteRealFix__58_s; -static void dig__54 (INT16 n); -static void seq__56 (CHAR ch, INT16 n); +static void dig__59 (INT16 n); +static void seq__61 (CHAR ch, INT16 n); -static void seq__56 (CHAR ch, INT16 n) +static void seq__61 (CHAR ch, INT16 n) { while (n > 0) { - Texts_Write(&*WriteRealFix__53_s->W, WriteRealFix__53_s->W__typ, ch); + Texts_Write(&*WriteRealFix__58_s->W, WriteRealFix__58_s->W__typ, ch); n -= 1; } } -static void dig__54 (INT16 n) +static void dig__59 (INT16 n) { while (n > 0) { - *WriteRealFix__53_s->i -= 1; - Texts_Write(&*WriteRealFix__53_s->W, WriteRealFix__53_s->W__typ, (*WriteRealFix__53_s->d)[__X(*WriteRealFix__53_s->i, 9)]); + *WriteRealFix__58_s->i -= 1; + Texts_Write(&*WriteRealFix__58_s->W, WriteRealFix__58_s->W__typ, (*WriteRealFix__58_s->d)[__X(*WriteRealFix__58_s->i, 9)]); n -= 1; } } @@ -1201,23 +1345,23 @@ void Texts_WriteRealFix (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n, INT1 CHAR sign; REAL x0; CHAR d[9]; - struct WriteRealFix__53 _s; + struct WriteRealFix__58 _s; _s.W = W; _s.W__typ = W__typ; _s.i = &i; _s.d = (void*)d; - _s.lnk = WriteRealFix__53_s; - WriteRealFix__53_s = &_s; + _s.lnk = WriteRealFix__58_s; + WriteRealFix__58_s = &_s; e = Reals_Expo(x); if (k < 0) { k = 0; } if (e == 0) { - seq__56(' ', (n - k) - 2); + seq__61(' ', (n - k) - 2); Texts_Write(&*W, W__typ, '0'); - seq__56(' ', k + 1); + seq__61(' ', k + 1); } else if (e == 255) { Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", 5); - seq__56(' ', n - 4); + seq__61(' ', n - 4); } else { e = __ASHR((e - 127) * 77, 8); if (x < (REAL)0) { @@ -1250,21 +1394,21 @@ void Texts_WriteRealFix (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n, INT1 i = k + e; Reals_Convert(x, i, (void*)d, 9); if (e > 0) { - seq__56(' ', ((n - e) - k) - 2); + seq__61(' ', ((n - e) - k) - 2); Texts_Write(&*W, W__typ, sign); - dig__54(e); + dig__59(e); Texts_Write(&*W, W__typ, '.'); - dig__54(k); + dig__59(k); } else { - seq__56(' ', (n - k) - 3); + seq__61(' ', (n - k) - 3); Texts_Write(&*W, W__typ, sign); Texts_Write(&*W, W__typ, '0'); Texts_Write(&*W, W__typ, '.'); - seq__56('0', -e); - dig__54(k + e); + seq__61('0', -e); + dig__59(k + e); } } - WriteRealFix__53_s = _s.lnk; + WriteRealFix__58_s = _s.lnk; } void Texts_WriteRealHex (Texts_Writer *W, ADDRESS *W__typ, REAL x) @@ -1363,48 +1507,48 @@ void Texts_WriteLongRealHex (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x) } while (!(i == 16)); } -static struct WriteDate__43 { +static struct WriteDate__48 { Texts_Writer *W; ADDRESS *W__typ; - struct WriteDate__43 *lnk; -} *WriteDate__43_s; + struct WriteDate__48 *lnk; +} *WriteDate__48_s; -static void WritePair__44 (CHAR ch, INT32 x); +static void WritePair__49 (CHAR ch, INT32 x); -static void WritePair__44 (CHAR ch, INT32 x) +static void WritePair__49 (CHAR ch, INT32 x) { - Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, ch); - Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)(__DIV(x, 10) + 48)); - Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)((int)__MOD(x, 10) + 48)); + Texts_Write(&*WriteDate__48_s->W, WriteDate__48_s->W__typ, ch); + Texts_Write(&*WriteDate__48_s->W, WriteDate__48_s->W__typ, (CHAR)(__DIV(x, 10) + 48)); + Texts_Write(&*WriteDate__48_s->W, WriteDate__48_s->W__typ, (CHAR)((int)__MOD(x, 10) + 48)); } void Texts_WriteDate (Texts_Writer *W, ADDRESS *W__typ, INT32 t, INT32 d) { - struct WriteDate__43 _s; + struct WriteDate__48 _s; _s.W = W; _s.W__typ = W__typ; - _s.lnk = WriteDate__43_s; - WriteDate__43_s = &_s; - WritePair__44(' ', __MASK(d, -32)); - WritePair__44('.', __MASK(__ASHR(d, 5), -16)); - WritePair__44('.', __MASK(__ASHR(d, 9), -128)); - WritePair__44(' ', __MASK(__ASHR(t, 12), -32)); - WritePair__44(':', __MASK(__ASHR(t, 6), -64)); - WritePair__44(':', __MASK(t, -64)); - WriteDate__43_s = _s.lnk; + _s.lnk = WriteDate__48_s; + WriteDate__48_s = &_s; + WritePair__49(' ', __MASK(d, -32)); + WritePair__49('.', __MASK(__ASHR(d, 5), -16)); + WritePair__49('.', __MASK(__ASHR(d, 9), -128)); + WritePair__49(' ', __MASK(__ASHR(t, 12), -32)); + WritePair__49(':', __MASK(__ASHR(t, 6), -64)); + WritePair__49(':', __MASK(t, -64)); + WriteDate__48_s = _s.lnk; } -static struct Load0__16 { +static struct Load0__21 { Texts_Text *T; INT8 *ecnt; Files_File *f; Texts_FileMsg *msg; CHAR (*mods)[64][32], (*procs)[64][32]; - struct Load0__16 *lnk; -} *Load0__16_s; + struct Load0__21 *lnk; +} *Load0__21_s; -static void LoadElem__17 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e); +static void LoadElem__22 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e); -static void LoadElem__17 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e) +static void LoadElem__22 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e) { Modules_Module M = NIL; Modules_Command Cmd; @@ -1415,15 +1559,15 @@ static void LoadElem__17 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span Files_ReadLInt(&*r, r__typ, &ew); Files_ReadLInt(&*r, r__typ, &eh); Files_Read(&*r, r__typ, (void*)&eno); - if (eno > *Load0__16_s->ecnt) { - *Load0__16_s->ecnt = eno; - Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->mods)[__X(eno, 64)], 32); - Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->procs)[__X(eno, 64)], 32); + if (eno > *Load0__21_s->ecnt) { + *Load0__21_s->ecnt = eno; + Files_ReadString(&*r, r__typ, (void*)(*Load0__21_s->mods)[__X(eno, 64)], 32); + Files_ReadString(&*r, r__typ, (void*)(*Load0__21_s->procs)[__X(eno, 64)], 32); } org = Files_Pos(&*r, r__typ); - M = Modules_ThisMod((*Load0__16_s->mods)[__X(eno, 64)], 32); + M = Modules_ThisMod((*Load0__21_s->mods)[__X(eno, 64)], 32); if (M != NIL) { - Cmd = Modules_ThisCommand(M, (*Load0__16_s->procs)[__X(eno, 64)], 32); + Cmd = Modules_ThisCommand(M, (*Load0__21_s->procs)[__X(eno, 64)], 32); if (Cmd != NIL) { (*Cmd)(); } @@ -1432,25 +1576,25 @@ static void LoadElem__17 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span if (*e != NIL) { (*e)->W = ew; (*e)->H = eh; - (*e)->base = *Load0__16_s->T; - (*Load0__16_s->msg).pos = pos; - (*(*e)->handle)(*e, (void*)&*Load0__16_s->msg, Texts_FileMsg__typ); + (*e)->base = *Load0__21_s->T; + (*Load0__21_s->msg).pos = pos; + (*(*e)->handle)(*e, (void*)&*Load0__21_s->msg, Texts_FileMsg__typ); if (Files_Pos(&*r, r__typ) != org + span) { *e = NIL; } } if (*e == NIL) { - Files_Set(&*r, r__typ, *Load0__16_s->f, org + span); + Files_Set(&*r, r__typ, *Load0__21_s->f, org + span); __NEW(a, Texts__1); a->W = ew; a->H = eh; a->handle = Texts_HandleAlien; - a->base = *Load0__16_s->T; - a->file = *Load0__16_s->f; + a->base = *Load0__21_s->T; + a->file = *Load0__21_s->f; a->org = org; a->span = span; - __COPY((*Load0__16_s->mods)[__X(eno, 64)], a->mod, 32); - __COPY((*Load0__16_s->procs)[__X(eno, 64)], a->proc, 32); + __COPY((*Load0__21_s->mods)[__X(eno, 64)], a->mod, 32); + __COPY((*Load0__21_s->procs)[__X(eno, 64)], a->proc, 32); *e = (Texts_Elem)a; } } @@ -1467,15 +1611,15 @@ static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) CHAR mods[64][32], procs[64][32]; CHAR name[32]; Texts_FontsFont fnts[32]; - struct Load0__16 _s; + struct Load0__21 _s; _s.T = &T; _s.ecnt = &ecnt; _s.f = &f; _s.msg = &msg; _s.mods = (void*)mods; _s.procs = (void*)procs; - _s.lnk = Load0__16_s; - Load0__16_s = &_s; + _s.lnk = Load0__21_s; + Load0__21_s = &_s; pos = Files_Pos(&*r, r__typ); f = Files_Base(&*r, r__typ); __NEW(u, Texts_RunDesc); @@ -1508,7 +1652,7 @@ static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) un = (Texts_Run)p; un->len = plen; } else { - LoadElem__17(&msg.r, Files_Rider__typ, pos - org, -plen, &e); + LoadElem__22(&msg.r, Files_Rider__typ, pos - org, -plen, &e); un = (Texts_Run)e; un->len = 1; } @@ -1526,7 +1670,7 @@ static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) T->corg = 0; Files_ReadLInt(&msg.r, Files_Rider__typ, &T->len); Files_Set(&*r, r__typ, f, Files_Pos(&msg.r, Files_Rider__typ) + T->len); - Load0__16_s = _s.lnk; + Load0__21_s = _s.lnk; } void Texts_Load (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) @@ -1595,25 +1739,25 @@ void Texts_Open (Texts_Text T, CHAR *name, ADDRESS name__len) __DEL(name); } -static struct Store__39 { +static struct Store__44 { INT8 *ecnt; Texts_FileMsg *msg; Texts_IdentifyMsg *iden; CHAR (*mods)[64][32], (*procs)[64][32]; - struct Store__39 *lnk; -} *Store__39_s; + struct Store__44 *lnk; +} *Store__44_s; -static void StoreElem__40 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e); +static void StoreElem__45 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e); -static void StoreElem__40 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e) +static void StoreElem__45 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e) { Files_Rider r1; INT32 org, span; INT8 eno; - __COPY((*Store__39_s->iden).mod, (*Store__39_s->mods)[__X(*Store__39_s->ecnt, 64)], 32); - __COPY((*Store__39_s->iden).proc, (*Store__39_s->procs)[__X(*Store__39_s->ecnt, 64)], 32); + __COPY((*Store__44_s->iden).mod, (*Store__44_s->mods)[__X(*Store__44_s->ecnt, 64)], 32); + __COPY((*Store__44_s->iden).proc, (*Store__44_s->procs)[__X(*Store__44_s->ecnt, 64)], 32); eno = 1; - while (__STRCMP((*Store__39_s->mods)[__X(eno, 64)], (*Store__39_s->iden).mod) != 0 || __STRCMP((*Store__39_s->procs)[__X(eno, 64)], (*Store__39_s->iden).proc) != 0) { + while (__STRCMP((*Store__44_s->mods)[__X(eno, 64)], (*Store__44_s->iden).mod) != 0 || __STRCMP((*Store__44_s->procs)[__X(eno, 64)], (*Store__44_s->iden).proc) != 0) { eno += 1; } Files_Set(&r1, Files_Rider__typ, Files_Base(&*r, r__typ), Files_Pos(&*r, r__typ)); @@ -1621,14 +1765,14 @@ static void StoreElem__40 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Ele Files_WriteLInt(&*r, r__typ, 0); Files_WriteLInt(&*r, r__typ, 0); Files_Write(&*r, r__typ, eno); - if (eno == *Store__39_s->ecnt) { - *Store__39_s->ecnt += 1; - Files_WriteString(&*r, r__typ, (*Store__39_s->iden).mod, 32); - Files_WriteString(&*r, r__typ, (*Store__39_s->iden).proc, 32); + if (eno == *Store__44_s->ecnt) { + *Store__44_s->ecnt += 1; + Files_WriteString(&*r, r__typ, (*Store__44_s->iden).mod, 32); + Files_WriteString(&*r, r__typ, (*Store__44_s->iden).proc, 32); } - (*Store__39_s->msg).pos = pos; + (*Store__44_s->msg).pos = pos; org = Files_Pos(&*r, r__typ); - (*e->handle)(e, (void*)&*Store__39_s->msg, Texts_FileMsg__typ); + (*e->handle)(e, (void*)&*Store__44_s->msg, Texts_FileMsg__typ); span = Files_Pos(&*r, r__typ) - org; Files_WriteLInt(&r1, Files_Rider__typ, -span); Files_WriteLInt(&r1, Files_Rider__typ, e->W); @@ -1649,14 +1793,14 @@ void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) CHAR mods[64][32], procs[64][32]; Texts_FontsFont fnts[32]; CHAR block[1024]; - struct Store__39 _s; + struct Store__44 _s; _s.ecnt = &ecnt; _s.msg = &msg; _s.iden = &iden; _s.mods = (void*)mods; _s.procs = (void*)procs; - _s.lnk = Store__39_s; - Store__39_s = &_s; + _s.lnk = Store__44_s; + Store__44_s = &_s; org = Files_Pos(&*r, r__typ); msg.id = 1; msg.r = *r; @@ -1698,7 +1842,7 @@ void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) pos += rlen; u = un; } else if (iden.mod[0] != 0x00) { - StoreElem__40(&msg.r, Files_Rider__typ, pos, __GUARDP(u, Texts_ElemDesc, 1)); + StoreElem__45(&msg.r, Files_Rider__typ, pos, __GUARDP(u, Texts_ElemDesc, 1)); pos += 1; u = u->next; } else { @@ -1752,7 +1896,7 @@ void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) if (T->notify != NIL) { (*T->notify)(T, 3, 0, 0); } - Store__39_s = _s.lnk; + Store__44_s = _s.lnk; } void Texts_Close (Texts_Text T, CHAR *name, ADDRESS name__len) @@ -1809,6 +1953,7 @@ export void *Texts__init(void) __DEFMOD; __MODULE_IMPORT(Files); __MODULE_IMPORT(Modules); + __MODULE_IMPORT(Out); __MODULE_IMPORT(Reals); __REGMOD("Texts", EnumPtrs); __INITYP(Texts_FontDesc, Texts_FontDesc, 0); diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index e36cbaf0..dc149133 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h @@ -135,6 +135,7 @@ import void Texts_Close (Texts_Text T, CHAR *name, ADDRESS name__len); import void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); import void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); import void Texts_Delete (Texts_Text T, INT32 beg, INT32 end); +import void Texts_DumpReader (Texts_Reader re); import Texts_Text Texts_ElemBase (Texts_Elem E); import INT32 Texts_ElemPos (Texts_Elem E); import void Texts_Insert (Texts_Text T, INT32 pos, Texts_Buffer B); diff --git a/bootstrap/unix-48/VT100.c b/bootstrap/unix-48/VT100.c index 8d349c3e..669a337a 100644 --- a/bootstrap/unix-48/VT100.c +++ b/bootstrap/unix-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/VT100.h b/bootstrap/unix-48/VT100.h index 494b7318..809a6082 100644 --- a/bootstrap/unix-48/VT100.h +++ b/bootstrap/unix-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index f9e7e802..b9ca8d5a 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index ee0ea191..6a31ee74 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/Compiler.c b/bootstrap/unix-88/Compiler.c index 2c7543fe..3b84a5bd 100644 --- a/bootstrap/unix-88/Compiler.c +++ b/bootstrap/unix-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index aa8e2c43..319659fe 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index aae60644..d438eca9 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index ccb4a812..29fc1e9a 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 068c1d9a..187a00f5 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index faed3f24..79d83cee 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index becc1414..29a878c2 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index e9637cdf..10aa7f62 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index ce643d9b..162947ee 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index 6f2b5545..a7d429eb 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index 589e67db..a49077b0 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index bf503129..89ef22dc 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index 59d5e057..b30a2315 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 8122e208..5b3cc3c5 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -494,6 +494,7 @@ void OPM_Get (CHAR *ch) OPM_LogWStr((CHAR*)"DEBUG: OPM.Get returned inR.eot at curpos = 0, ch = ", 53); OPM_LogWNum((INT16)*ch, 1); OPM_LogW('.'); + Texts_DumpReader(OPM_inR); } if ((*ch < 0x09 && !OPM_inR.eot)) { *ch = ' '; diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index 4bd19104..d1c71f13 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index cddb65e4..a529c16e 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index aeb70b16..c82b4d80 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index 6820f239..a3b32b0c 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index 815f29a7..99c62664 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index 3bab2d83..0bca4ab5 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index f3af656f..1aec7cad 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 6405cdff..097c0a7c 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index 6807e936..9ad5508d 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Out.c b/bootstrap/unix-88/Out.c index 87afc49d..fd578128 100644 --- a/bootstrap/unix-88/Out.c +++ b/bootstrap/unix-88/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Out.h b/bootstrap/unix-88/Out.h index 20d983e1..a3f5db4d 100644 --- a/bootstrap/unix-88/Out.h +++ b/bootstrap/unix-88/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index dd0f0b96..5a5984c0 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index aba5632f..9ea581aa 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 35ecc020..8ba81525 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index be278393..0fe868e0 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index b0c053b8..a6a802c4 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index 3d53c582..bec035c4 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index 95d0173a..eba58f8f 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -8,6 +8,7 @@ #include "SYSTEM.h" #include "Files.h" #include "Modules.h" +#include "Out.h" #include "Reals.h" typedef @@ -191,6 +192,11 @@ export void Texts_Close (Texts_Text T, CHAR *name, ADDRESS name__len); export void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); export void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); export void Texts_Delete (Texts_Text T, INT32 beg, INT32 end); +static void Texts_DumpElem (Texts_Elem e); +export void Texts_DumpReader (Texts_Reader re); +static void Texts_DumpRider (Files_Rider ri); +static void Texts_DumpRun (Texts_Run ru); +static void Texts_DumpText (Texts_Text t); export Texts_Text Texts_ElemBase (Texts_Elem E); export INT32 Texts_ElemPos (Texts_Elem E); static void Texts_Find (Texts_Text T, INT32 *pos, Texts_Run *u, INT32 *org, INT32 *off); @@ -232,6 +238,144 @@ export void Texts_WriteRealHex (Texts_Writer *W, ADDRESS *W__typ, REAL x); export void Texts_WriteString (Texts_Writer *W, ADDRESS *W__typ, CHAR *s, ADDRESS s__len); +static void Texts_DumpText (Texts_Text t) +{ + Out_String((CHAR*)" len: ", 15); + Out_Int(t->len, 1); + Out_Ln(); + Out_String((CHAR*)" notify: ", 15); + Out_Int((INT64)(ADDRESS)t->notify, 1); + Out_Ln(); + Out_String((CHAR*)" head: ", 15); + Out_Int((INT64)(ADDRESS)t->head, 1); + Out_Ln(); + Out_String((CHAR*)" cache: ", 15); + Out_Int((INT64)(ADDRESS)t->cache, 1); + Out_Ln(); + Out_String((CHAR*)" corg: ", 15); + Out_Int(t->corg, 1); + Out_Ln(); +} + +static void Texts_DumpElem (Texts_Elem e) +{ + Out_String((CHAR*)" W: ", 13); + Out_Int(e->W, 1); + Out_Ln(); + Out_String((CHAR*)" H: ", 13); + Out_Int(e->H, 1); + Out_Ln(); + Out_String((CHAR*)" handle: ", 13); + Out_Int((INT64)(ADDRESS)e->handle, 1); + Out_Ln(); + Out_String((CHAR*)" base: ", 13); + if (e->base == NIL) { + Out_String((CHAR*)"", 6); + Out_Ln(); + } else { + Out_Ln(); + Texts_DumpText(e->base); + } +} + +static void Texts_DumpRider (Files_Rider ri) +{ + Out_String((CHAR*)" res: ", 10); + Out_Int(ri.res, 1); + Out_Ln(); + Out_String((CHAR*)" eof: ", 10); + if (ri.eof) { + Out_String((CHAR*)"TRUE", 5); + } else { + Out_String((CHAR*)"FALSE", 6); + } + Out_Ln(); +} + +static void Texts_DumpRun (Texts_Run ru) +{ + Out_String((CHAR*)" prev: ", 12); + Out_Int((INT64)(ADDRESS)ru->prev, 1); + Out_Ln(); + Out_String((CHAR*)" next: ", 12); + Out_Int((INT64)(ADDRESS)ru->next, 1); + Out_Ln(); + Out_String((CHAR*)" len: ", 12); + Out_Int(ru->len, 1); + Out_Ln(); + Out_String((CHAR*)" fnt: ", 12); + if (ru->fnt != NIL) { + Out_String(ru->fnt->name, 32); + } else { + Out_String((CHAR*)"", 6); + } + Out_Ln(); + Out_String((CHAR*)" col: ", 12); + Out_Int(ru->col, 1); + Out_Ln(); + Out_String((CHAR*)" voff: ", 12); + Out_Int(ru->voff, 1); + Out_Ln(); + Out_String((CHAR*)" ascii: ", 12); + if (ru->ascii) { + Out_String((CHAR*)"TRUE", 5); + } else { + Out_String((CHAR*)"FALSE", 6); + } + Out_Ln(); +} + +void Texts_DumpReader (Texts_Reader re) +{ + Out_String((CHAR*)"Reader:", 8); + Out_Ln(); + Out_String((CHAR*)" eot: ", 10); + if (re.eot) { + Out_String((CHAR*)"TRUE", 5); + } else { + Out_String((CHAR*)"FALSE", 6); + } + Out_Ln(); + Out_String((CHAR*)" fnt: ", 10); + if (re.fnt != NIL) { + Out_String(re.fnt->name, 32); + } else { + Out_String((CHAR*)"", 6); + } + Out_Ln(); + Out_String((CHAR*)" col: ", 10); + Out_Int(re.col, 1); + Out_Ln(); + Out_String((CHAR*)" voff: ", 10); + Out_Int(re.voff, 1); + Out_Ln(); + Out_String((CHAR*)" org: ", 10); + Out_Int(re.org, 1); + Out_Ln(); + Out_String((CHAR*)" off: ", 10); + Out_Int(re.off, 1); + Out_Ln(); + Out_String((CHAR*)" elem: ", 10); + if (re.elem == NIL) { + Out_String((CHAR*)"", 6); + Out_Ln(); + } else { + Out_Ln(); + Texts_DumpElem(re.elem); + } + Out_String((CHAR*)" rider: ", 10); + Out_Ln(); + Texts_DumpRider(re.rider); + Out_String((CHAR*)" run: ", 10); + if (re.run == NIL) { + Out_String((CHAR*)"", 6); + Out_Ln(); + } else { + Out_Ln(); + Texts_DumpRun(re.run); + } +} + static Texts_FontsFont Texts_FontsThis (CHAR *name, ADDRESS name__len) { Texts_FontsFont F = NIL; @@ -716,32 +860,32 @@ void Texts_OpenScanner (Texts_Scanner *S, ADDRESS *S__typ, Texts_Text T, INT32 p (*S).nextCh = ' '; } -static struct Scan__31 { +static struct Scan__36 { Texts_Scanner *S; ADDRESS *S__typ; CHAR *ch; BOOLEAN *negE; INT16 *e; - struct Scan__31 *lnk; -} *Scan__31_s; + struct Scan__36 *lnk; +} *Scan__36_s; -static void ReadScaleFactor__32 (void); +static void ReadScaleFactor__37 (void); -static void ReadScaleFactor__32 (void) +static void ReadScaleFactor__37 (void) { - Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); - if (*Scan__31_s->ch == '-') { - *Scan__31_s->negE = 1; - Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); + Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); + if (*Scan__36_s->ch == '-') { + *Scan__36_s->negE = 1; + Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); } else { - *Scan__31_s->negE = 0; - if (*Scan__31_s->ch == '+') { - Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); + *Scan__36_s->negE = 0; + if (*Scan__36_s->ch == '+') { + Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); } } - while (('0' <= *Scan__31_s->ch && *Scan__31_s->ch <= '9')) { - *Scan__31_s->e = (*Scan__31_s->e * 10 + (INT16)*Scan__31_s->ch) - 48; - Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); + while (('0' <= *Scan__36_s->ch && *Scan__36_s->ch <= '9')) { + *Scan__36_s->e = (*Scan__36_s->e * 10 + (INT16)*Scan__36_s->ch) - 48; + Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); } } @@ -755,13 +899,13 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) REAL x, f; LONGREAL y, g; CHAR d[32]; - struct Scan__31 _s; + struct Scan__36 _s; _s.S = S; _s.S__typ = S__typ; _s.ch = &ch; _s.negE = &negE; _s.e = &e; - _s.lnk = Scan__31_s; - Scan__31_s = &_s; + _s.lnk = Scan__36_s; + Scan__36_s = &_s; ch = (*S).nextCh; i = 0; for (;;) { @@ -862,7 +1006,7 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) y = ((INT16)d[__X(j, 32)] - 48) * g + y; j += 1; } - ReadScaleFactor__32(); + ReadScaleFactor__37(); if (negE) { if (e <= 308) { y = y / (LONGREAL)Reals_TenL(e); @@ -895,7 +1039,7 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) j += 1; } if (ch == 'E') { - ReadScaleFactor__32(); + ReadScaleFactor__37(); } if (negE) { if (e <= 38) { @@ -948,7 +1092,7 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) } } (*S).nextCh = ch; - Scan__31_s = _s.lnk; + Scan__36_s = _s.lnk; } void Texts_OpenWriter (Texts_Writer *W, ADDRESS *W__typ) @@ -1167,30 +1311,30 @@ void Texts_WriteReal (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n) } } -static struct WriteRealFix__53 { +static struct WriteRealFix__58 { Texts_Writer *W; ADDRESS *W__typ; INT16 *i; CHAR (*d)[9]; - struct WriteRealFix__53 *lnk; -} *WriteRealFix__53_s; + struct WriteRealFix__58 *lnk; +} *WriteRealFix__58_s; -static void dig__54 (INT16 n); -static void seq__56 (CHAR ch, INT16 n); +static void dig__59 (INT16 n); +static void seq__61 (CHAR ch, INT16 n); -static void seq__56 (CHAR ch, INT16 n) +static void seq__61 (CHAR ch, INT16 n) { while (n > 0) { - Texts_Write(&*WriteRealFix__53_s->W, WriteRealFix__53_s->W__typ, ch); + Texts_Write(&*WriteRealFix__58_s->W, WriteRealFix__58_s->W__typ, ch); n -= 1; } } -static void dig__54 (INT16 n) +static void dig__59 (INT16 n) { while (n > 0) { - *WriteRealFix__53_s->i -= 1; - Texts_Write(&*WriteRealFix__53_s->W, WriteRealFix__53_s->W__typ, (*WriteRealFix__53_s->d)[__X(*WriteRealFix__53_s->i, 9)]); + *WriteRealFix__58_s->i -= 1; + Texts_Write(&*WriteRealFix__58_s->W, WriteRealFix__58_s->W__typ, (*WriteRealFix__58_s->d)[__X(*WriteRealFix__58_s->i, 9)]); n -= 1; } } @@ -1201,23 +1345,23 @@ void Texts_WriteRealFix (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n, INT1 CHAR sign; REAL x0; CHAR d[9]; - struct WriteRealFix__53 _s; + struct WriteRealFix__58 _s; _s.W = W; _s.W__typ = W__typ; _s.i = &i; _s.d = (void*)d; - _s.lnk = WriteRealFix__53_s; - WriteRealFix__53_s = &_s; + _s.lnk = WriteRealFix__58_s; + WriteRealFix__58_s = &_s; e = Reals_Expo(x); if (k < 0) { k = 0; } if (e == 0) { - seq__56(' ', (n - k) - 2); + seq__61(' ', (n - k) - 2); Texts_Write(&*W, W__typ, '0'); - seq__56(' ', k + 1); + seq__61(' ', k + 1); } else if (e == 255) { Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", 5); - seq__56(' ', n - 4); + seq__61(' ', n - 4); } else { e = __ASHR((e - 127) * 77, 8); if (x < (REAL)0) { @@ -1250,21 +1394,21 @@ void Texts_WriteRealFix (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n, INT1 i = k + e; Reals_Convert(x, i, (void*)d, 9); if (e > 0) { - seq__56(' ', ((n - e) - k) - 2); + seq__61(' ', ((n - e) - k) - 2); Texts_Write(&*W, W__typ, sign); - dig__54(e); + dig__59(e); Texts_Write(&*W, W__typ, '.'); - dig__54(k); + dig__59(k); } else { - seq__56(' ', (n - k) - 3); + seq__61(' ', (n - k) - 3); Texts_Write(&*W, W__typ, sign); Texts_Write(&*W, W__typ, '0'); Texts_Write(&*W, W__typ, '.'); - seq__56('0', -e); - dig__54(k + e); + seq__61('0', -e); + dig__59(k + e); } } - WriteRealFix__53_s = _s.lnk; + WriteRealFix__58_s = _s.lnk; } void Texts_WriteRealHex (Texts_Writer *W, ADDRESS *W__typ, REAL x) @@ -1363,48 +1507,48 @@ void Texts_WriteLongRealHex (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x) } while (!(i == 16)); } -static struct WriteDate__43 { +static struct WriteDate__48 { Texts_Writer *W; ADDRESS *W__typ; - struct WriteDate__43 *lnk; -} *WriteDate__43_s; + struct WriteDate__48 *lnk; +} *WriteDate__48_s; -static void WritePair__44 (CHAR ch, INT32 x); +static void WritePair__49 (CHAR ch, INT32 x); -static void WritePair__44 (CHAR ch, INT32 x) +static void WritePair__49 (CHAR ch, INT32 x) { - Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, ch); - Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)(__DIV(x, 10) + 48)); - Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)((int)__MOD(x, 10) + 48)); + Texts_Write(&*WriteDate__48_s->W, WriteDate__48_s->W__typ, ch); + Texts_Write(&*WriteDate__48_s->W, WriteDate__48_s->W__typ, (CHAR)(__DIV(x, 10) + 48)); + Texts_Write(&*WriteDate__48_s->W, WriteDate__48_s->W__typ, (CHAR)((int)__MOD(x, 10) + 48)); } void Texts_WriteDate (Texts_Writer *W, ADDRESS *W__typ, INT32 t, INT32 d) { - struct WriteDate__43 _s; + struct WriteDate__48 _s; _s.W = W; _s.W__typ = W__typ; - _s.lnk = WriteDate__43_s; - WriteDate__43_s = &_s; - WritePair__44(' ', __MASK(d, -32)); - WritePair__44('.', __MASK(__ASHR(d, 5), -16)); - WritePair__44('.', __MASK(__ASHR(d, 9), -128)); - WritePair__44(' ', __MASK(__ASHR(t, 12), -32)); - WritePair__44(':', __MASK(__ASHR(t, 6), -64)); - WritePair__44(':', __MASK(t, -64)); - WriteDate__43_s = _s.lnk; + _s.lnk = WriteDate__48_s; + WriteDate__48_s = &_s; + WritePair__49(' ', __MASK(d, -32)); + WritePair__49('.', __MASK(__ASHR(d, 5), -16)); + WritePair__49('.', __MASK(__ASHR(d, 9), -128)); + WritePair__49(' ', __MASK(__ASHR(t, 12), -32)); + WritePair__49(':', __MASK(__ASHR(t, 6), -64)); + WritePair__49(':', __MASK(t, -64)); + WriteDate__48_s = _s.lnk; } -static struct Load0__16 { +static struct Load0__21 { Texts_Text *T; INT8 *ecnt; Files_File *f; Texts_FileMsg *msg; CHAR (*mods)[64][32], (*procs)[64][32]; - struct Load0__16 *lnk; -} *Load0__16_s; + struct Load0__21 *lnk; +} *Load0__21_s; -static void LoadElem__17 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e); +static void LoadElem__22 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e); -static void LoadElem__17 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e) +static void LoadElem__22 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e) { Modules_Module M = NIL; Modules_Command Cmd; @@ -1415,15 +1559,15 @@ static void LoadElem__17 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span Files_ReadLInt(&*r, r__typ, &ew); Files_ReadLInt(&*r, r__typ, &eh); Files_Read(&*r, r__typ, (void*)&eno); - if (eno > *Load0__16_s->ecnt) { - *Load0__16_s->ecnt = eno; - Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->mods)[__X(eno, 64)], 32); - Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->procs)[__X(eno, 64)], 32); + if (eno > *Load0__21_s->ecnt) { + *Load0__21_s->ecnt = eno; + Files_ReadString(&*r, r__typ, (void*)(*Load0__21_s->mods)[__X(eno, 64)], 32); + Files_ReadString(&*r, r__typ, (void*)(*Load0__21_s->procs)[__X(eno, 64)], 32); } org = Files_Pos(&*r, r__typ); - M = Modules_ThisMod((*Load0__16_s->mods)[__X(eno, 64)], 32); + M = Modules_ThisMod((*Load0__21_s->mods)[__X(eno, 64)], 32); if (M != NIL) { - Cmd = Modules_ThisCommand(M, (*Load0__16_s->procs)[__X(eno, 64)], 32); + Cmd = Modules_ThisCommand(M, (*Load0__21_s->procs)[__X(eno, 64)], 32); if (Cmd != NIL) { (*Cmd)(); } @@ -1432,25 +1576,25 @@ static void LoadElem__17 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span if (*e != NIL) { (*e)->W = ew; (*e)->H = eh; - (*e)->base = *Load0__16_s->T; - (*Load0__16_s->msg).pos = pos; - (*(*e)->handle)(*e, (void*)&*Load0__16_s->msg, Texts_FileMsg__typ); + (*e)->base = *Load0__21_s->T; + (*Load0__21_s->msg).pos = pos; + (*(*e)->handle)(*e, (void*)&*Load0__21_s->msg, Texts_FileMsg__typ); if (Files_Pos(&*r, r__typ) != org + span) { *e = NIL; } } if (*e == NIL) { - Files_Set(&*r, r__typ, *Load0__16_s->f, org + span); + Files_Set(&*r, r__typ, *Load0__21_s->f, org + span); __NEW(a, Texts__1); a->W = ew; a->H = eh; a->handle = Texts_HandleAlien; - a->base = *Load0__16_s->T; - a->file = *Load0__16_s->f; + a->base = *Load0__21_s->T; + a->file = *Load0__21_s->f; a->org = org; a->span = span; - __COPY((*Load0__16_s->mods)[__X(eno, 64)], a->mod, 32); - __COPY((*Load0__16_s->procs)[__X(eno, 64)], a->proc, 32); + __COPY((*Load0__21_s->mods)[__X(eno, 64)], a->mod, 32); + __COPY((*Load0__21_s->procs)[__X(eno, 64)], a->proc, 32); *e = (Texts_Elem)a; } } @@ -1467,15 +1611,15 @@ static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) CHAR mods[64][32], procs[64][32]; CHAR name[32]; Texts_FontsFont fnts[32]; - struct Load0__16 _s; + struct Load0__21 _s; _s.T = &T; _s.ecnt = &ecnt; _s.f = &f; _s.msg = &msg; _s.mods = (void*)mods; _s.procs = (void*)procs; - _s.lnk = Load0__16_s; - Load0__16_s = &_s; + _s.lnk = Load0__21_s; + Load0__21_s = &_s; pos = Files_Pos(&*r, r__typ); f = Files_Base(&*r, r__typ); __NEW(u, Texts_RunDesc); @@ -1508,7 +1652,7 @@ static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) un = (Texts_Run)p; un->len = plen; } else { - LoadElem__17(&msg.r, Files_Rider__typ, pos - org, -plen, &e); + LoadElem__22(&msg.r, Files_Rider__typ, pos - org, -plen, &e); un = (Texts_Run)e; un->len = 1; } @@ -1526,7 +1670,7 @@ static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) T->corg = 0; Files_ReadLInt(&msg.r, Files_Rider__typ, &T->len); Files_Set(&*r, r__typ, f, Files_Pos(&msg.r, Files_Rider__typ) + T->len); - Load0__16_s = _s.lnk; + Load0__21_s = _s.lnk; } void Texts_Load (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) @@ -1595,25 +1739,25 @@ void Texts_Open (Texts_Text T, CHAR *name, ADDRESS name__len) __DEL(name); } -static struct Store__39 { +static struct Store__44 { INT8 *ecnt; Texts_FileMsg *msg; Texts_IdentifyMsg *iden; CHAR (*mods)[64][32], (*procs)[64][32]; - struct Store__39 *lnk; -} *Store__39_s; + struct Store__44 *lnk; +} *Store__44_s; -static void StoreElem__40 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e); +static void StoreElem__45 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e); -static void StoreElem__40 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e) +static void StoreElem__45 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e) { Files_Rider r1; INT32 org, span; INT8 eno; - __COPY((*Store__39_s->iden).mod, (*Store__39_s->mods)[__X(*Store__39_s->ecnt, 64)], 32); - __COPY((*Store__39_s->iden).proc, (*Store__39_s->procs)[__X(*Store__39_s->ecnt, 64)], 32); + __COPY((*Store__44_s->iden).mod, (*Store__44_s->mods)[__X(*Store__44_s->ecnt, 64)], 32); + __COPY((*Store__44_s->iden).proc, (*Store__44_s->procs)[__X(*Store__44_s->ecnt, 64)], 32); eno = 1; - while (__STRCMP((*Store__39_s->mods)[__X(eno, 64)], (*Store__39_s->iden).mod) != 0 || __STRCMP((*Store__39_s->procs)[__X(eno, 64)], (*Store__39_s->iden).proc) != 0) { + while (__STRCMP((*Store__44_s->mods)[__X(eno, 64)], (*Store__44_s->iden).mod) != 0 || __STRCMP((*Store__44_s->procs)[__X(eno, 64)], (*Store__44_s->iden).proc) != 0) { eno += 1; } Files_Set(&r1, Files_Rider__typ, Files_Base(&*r, r__typ), Files_Pos(&*r, r__typ)); @@ -1621,14 +1765,14 @@ static void StoreElem__40 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Ele Files_WriteLInt(&*r, r__typ, 0); Files_WriteLInt(&*r, r__typ, 0); Files_Write(&*r, r__typ, eno); - if (eno == *Store__39_s->ecnt) { - *Store__39_s->ecnt += 1; - Files_WriteString(&*r, r__typ, (*Store__39_s->iden).mod, 32); - Files_WriteString(&*r, r__typ, (*Store__39_s->iden).proc, 32); + if (eno == *Store__44_s->ecnt) { + *Store__44_s->ecnt += 1; + Files_WriteString(&*r, r__typ, (*Store__44_s->iden).mod, 32); + Files_WriteString(&*r, r__typ, (*Store__44_s->iden).proc, 32); } - (*Store__39_s->msg).pos = pos; + (*Store__44_s->msg).pos = pos; org = Files_Pos(&*r, r__typ); - (*e->handle)(e, (void*)&*Store__39_s->msg, Texts_FileMsg__typ); + (*e->handle)(e, (void*)&*Store__44_s->msg, Texts_FileMsg__typ); span = Files_Pos(&*r, r__typ) - org; Files_WriteLInt(&r1, Files_Rider__typ, -span); Files_WriteLInt(&r1, Files_Rider__typ, e->W); @@ -1649,14 +1793,14 @@ void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) CHAR mods[64][32], procs[64][32]; Texts_FontsFont fnts[32]; CHAR block[1024]; - struct Store__39 _s; + struct Store__44 _s; _s.ecnt = &ecnt; _s.msg = &msg; _s.iden = &iden; _s.mods = (void*)mods; _s.procs = (void*)procs; - _s.lnk = Store__39_s; - Store__39_s = &_s; + _s.lnk = Store__44_s; + Store__44_s = &_s; org = Files_Pos(&*r, r__typ); msg.id = 1; msg.r = *r; @@ -1698,7 +1842,7 @@ void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) pos += rlen; u = un; } else if (iden.mod[0] != 0x00) { - StoreElem__40(&msg.r, Files_Rider__typ, pos, __GUARDP(u, Texts_ElemDesc, 1)); + StoreElem__45(&msg.r, Files_Rider__typ, pos, __GUARDP(u, Texts_ElemDesc, 1)); pos += 1; u = u->next; } else { @@ -1752,7 +1896,7 @@ void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) if (T->notify != NIL) { (*T->notify)(T, 3, 0, 0); } - Store__39_s = _s.lnk; + Store__44_s = _s.lnk; } void Texts_Close (Texts_Text T, CHAR *name, ADDRESS name__len) @@ -1809,6 +1953,7 @@ export void *Texts__init(void) __DEFMOD; __MODULE_IMPORT(Files); __MODULE_IMPORT(Modules); + __MODULE_IMPORT(Out); __MODULE_IMPORT(Reals); __REGMOD("Texts", EnumPtrs); __INITYP(Texts_FontDesc, Texts_FontDesc, 0); diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index c4766a47..55558804 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h @@ -135,6 +135,7 @@ import void Texts_Close (Texts_Text T, CHAR *name, ADDRESS name__len); import void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); import void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); import void Texts_Delete (Texts_Text T, INT32 beg, INT32 end); +import void Texts_DumpReader (Texts_Reader re); import Texts_Text Texts_ElemBase (Texts_Elem E); import INT32 Texts_ElemPos (Texts_Elem E); import void Texts_Insert (Texts_Text T, INT32 pos, Texts_Buffer B); diff --git a/bootstrap/unix-88/VT100.c b/bootstrap/unix-88/VT100.c index 8d349c3e..669a337a 100644 --- a/bootstrap/unix-88/VT100.c +++ b/bootstrap/unix-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/VT100.h b/bootstrap/unix-88/VT100.h index 494b7318..809a6082 100644 --- a/bootstrap/unix-88/VT100.h +++ b/bootstrap/unix-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index f9e7e802..b9ca8d5a 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index ee0ea191..6a31ee74 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/Compiler.c b/bootstrap/windows-48/Compiler.c index 2c7543fe..3b84a5bd 100644 --- a/bootstrap/windows-48/Compiler.c +++ b/bootstrap/windows-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index aa8e2c43..319659fe 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index aae60644..d438eca9 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 30b3eaa6..6db7dd4d 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index dcbb51f3..aa177fb4 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index fd4d0fc0..a3bcc604 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index 8e773e89..b5a1e4c3 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index b7d174ef..4a04e15a 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index e7f2b10f..4cecc8b9 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index 6f2b5545..a7d429eb 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index 589e67db..a49077b0 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index bf503129..89ef22dc 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index 59d5e057..b30a2315 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index ca3cffc1..0c8ab9b3 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -494,6 +494,7 @@ void OPM_Get (CHAR *ch) OPM_LogWStr((CHAR*)"DEBUG: OPM.Get returned inR.eot at curpos = 0, ch = ", 53); OPM_LogWNum((INT16)*ch, 1); OPM_LogW('.'); + Texts_DumpReader(OPM_inR); } if ((*ch < 0x09 && !OPM_inR.eot)) { *ch = ' '; diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index 4bd19104..d1c71f13 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index 8a07b672..dfca5a85 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index aeb70b16..c82b4d80 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index 6820f239..a3b32b0c 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index 815f29a7..99c62664 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 8237bf8d..6edc4b6a 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index f3af656f..1aec7cad 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index c1062b81..1e66dbde 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index 6807e936..9ad5508d 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Out.c b/bootstrap/windows-48/Out.c index d7d446f8..1f466dc9 100644 --- a/bootstrap/windows-48/Out.c +++ b/bootstrap/windows-48/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Out.h b/bootstrap/windows-48/Out.h index 20d983e1..a3f5db4d 100644 --- a/bootstrap/windows-48/Out.h +++ b/bootstrap/windows-48/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index b71e4f1d..eb23ff1d 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index 79babae7..ce0d19ba 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 35ecc020..8ba81525 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index be278393..0fe868e0 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index b0c053b8..a6a802c4 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index 3d53c582..bec035c4 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index 1cca7d56..d1a7f696 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -8,6 +8,7 @@ #include "SYSTEM.h" #include "Files.h" #include "Modules.h" +#include "Out.h" #include "Reals.h" typedef @@ -191,6 +192,11 @@ export void Texts_Close (Texts_Text T, CHAR *name, ADDRESS name__len); export void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); export void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); export void Texts_Delete (Texts_Text T, INT32 beg, INT32 end); +static void Texts_DumpElem (Texts_Elem e); +export void Texts_DumpReader (Texts_Reader re); +static void Texts_DumpRider (Files_Rider ri); +static void Texts_DumpRun (Texts_Run ru); +static void Texts_DumpText (Texts_Text t); export Texts_Text Texts_ElemBase (Texts_Elem E); export INT32 Texts_ElemPos (Texts_Elem E); static void Texts_Find (Texts_Text T, INT32 *pos, Texts_Run *u, INT32 *org, INT32 *off); @@ -232,6 +238,144 @@ export void Texts_WriteRealHex (Texts_Writer *W, ADDRESS *W__typ, REAL x); export void Texts_WriteString (Texts_Writer *W, ADDRESS *W__typ, CHAR *s, ADDRESS s__len); +static void Texts_DumpText (Texts_Text t) +{ + Out_String((CHAR*)" len: ", 15); + Out_Int(t->len, 1); + Out_Ln(); + Out_String((CHAR*)" notify: ", 15); + Out_Int((INT32)(ADDRESS)t->notify, 1); + Out_Ln(); + Out_String((CHAR*)" head: ", 15); + Out_Int((INT32)(ADDRESS)t->head, 1); + Out_Ln(); + Out_String((CHAR*)" cache: ", 15); + Out_Int((INT32)(ADDRESS)t->cache, 1); + Out_Ln(); + Out_String((CHAR*)" corg: ", 15); + Out_Int(t->corg, 1); + Out_Ln(); +} + +static void Texts_DumpElem (Texts_Elem e) +{ + Out_String((CHAR*)" W: ", 13); + Out_Int(e->W, 1); + Out_Ln(); + Out_String((CHAR*)" H: ", 13); + Out_Int(e->H, 1); + Out_Ln(); + Out_String((CHAR*)" handle: ", 13); + Out_Int((INT32)(ADDRESS)e->handle, 1); + Out_Ln(); + Out_String((CHAR*)" base: ", 13); + if (e->base == NIL) { + Out_String((CHAR*)"", 6); + Out_Ln(); + } else { + Out_Ln(); + Texts_DumpText(e->base); + } +} + +static void Texts_DumpRider (Files_Rider ri) +{ + Out_String((CHAR*)" res: ", 10); + Out_Int(ri.res, 1); + Out_Ln(); + Out_String((CHAR*)" eof: ", 10); + if (ri.eof) { + Out_String((CHAR*)"TRUE", 5); + } else { + Out_String((CHAR*)"FALSE", 6); + } + Out_Ln(); +} + +static void Texts_DumpRun (Texts_Run ru) +{ + Out_String((CHAR*)" prev: ", 12); + Out_Int((INT32)(ADDRESS)ru->prev, 1); + Out_Ln(); + Out_String((CHAR*)" next: ", 12); + Out_Int((INT32)(ADDRESS)ru->next, 1); + Out_Ln(); + Out_String((CHAR*)" len: ", 12); + Out_Int(ru->len, 1); + Out_Ln(); + Out_String((CHAR*)" fnt: ", 12); + if (ru->fnt != NIL) { + Out_String(ru->fnt->name, 32); + } else { + Out_String((CHAR*)"", 6); + } + Out_Ln(); + Out_String((CHAR*)" col: ", 12); + Out_Int(ru->col, 1); + Out_Ln(); + Out_String((CHAR*)" voff: ", 12); + Out_Int(ru->voff, 1); + Out_Ln(); + Out_String((CHAR*)" ascii: ", 12); + if (ru->ascii) { + Out_String((CHAR*)"TRUE", 5); + } else { + Out_String((CHAR*)"FALSE", 6); + } + Out_Ln(); +} + +void Texts_DumpReader (Texts_Reader re) +{ + Out_String((CHAR*)"Reader:", 8); + Out_Ln(); + Out_String((CHAR*)" eot: ", 10); + if (re.eot) { + Out_String((CHAR*)"TRUE", 5); + } else { + Out_String((CHAR*)"FALSE", 6); + } + Out_Ln(); + Out_String((CHAR*)" fnt: ", 10); + if (re.fnt != NIL) { + Out_String(re.fnt->name, 32); + } else { + Out_String((CHAR*)"", 6); + } + Out_Ln(); + Out_String((CHAR*)" col: ", 10); + Out_Int(re.col, 1); + Out_Ln(); + Out_String((CHAR*)" voff: ", 10); + Out_Int(re.voff, 1); + Out_Ln(); + Out_String((CHAR*)" org: ", 10); + Out_Int(re.org, 1); + Out_Ln(); + Out_String((CHAR*)" off: ", 10); + Out_Int(re.off, 1); + Out_Ln(); + Out_String((CHAR*)" elem: ", 10); + if (re.elem == NIL) { + Out_String((CHAR*)"", 6); + Out_Ln(); + } else { + Out_Ln(); + Texts_DumpElem(re.elem); + } + Out_String((CHAR*)" rider: ", 10); + Out_Ln(); + Texts_DumpRider(re.rider); + Out_String((CHAR*)" run: ", 10); + if (re.run == NIL) { + Out_String((CHAR*)"", 6); + Out_Ln(); + } else { + Out_Ln(); + Texts_DumpRun(re.run); + } +} + static Texts_FontsFont Texts_FontsThis (CHAR *name, ADDRESS name__len) { Texts_FontsFont F = NIL; @@ -716,32 +860,32 @@ void Texts_OpenScanner (Texts_Scanner *S, ADDRESS *S__typ, Texts_Text T, INT32 p (*S).nextCh = ' '; } -static struct Scan__31 { +static struct Scan__36 { Texts_Scanner *S; ADDRESS *S__typ; CHAR *ch; BOOLEAN *negE; INT16 *e; - struct Scan__31 *lnk; -} *Scan__31_s; + struct Scan__36 *lnk; +} *Scan__36_s; -static void ReadScaleFactor__32 (void); +static void ReadScaleFactor__37 (void); -static void ReadScaleFactor__32 (void) +static void ReadScaleFactor__37 (void) { - Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); - if (*Scan__31_s->ch == '-') { - *Scan__31_s->negE = 1; - Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); + Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); + if (*Scan__36_s->ch == '-') { + *Scan__36_s->negE = 1; + Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); } else { - *Scan__31_s->negE = 0; - if (*Scan__31_s->ch == '+') { - Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); + *Scan__36_s->negE = 0; + if (*Scan__36_s->ch == '+') { + Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); } } - while (('0' <= *Scan__31_s->ch && *Scan__31_s->ch <= '9')) { - *Scan__31_s->e = (*Scan__31_s->e * 10 + (INT16)*Scan__31_s->ch) - 48; - Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); + while (('0' <= *Scan__36_s->ch && *Scan__36_s->ch <= '9')) { + *Scan__36_s->e = (*Scan__36_s->e * 10 + (INT16)*Scan__36_s->ch) - 48; + Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); } } @@ -755,13 +899,13 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) REAL x, f; LONGREAL y, g; CHAR d[32]; - struct Scan__31 _s; + struct Scan__36 _s; _s.S = S; _s.S__typ = S__typ; _s.ch = &ch; _s.negE = &negE; _s.e = &e; - _s.lnk = Scan__31_s; - Scan__31_s = &_s; + _s.lnk = Scan__36_s; + Scan__36_s = &_s; ch = (*S).nextCh; i = 0; for (;;) { @@ -862,7 +1006,7 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) y = ((INT16)d[__X(j, 32)] - 48) * g + y; j += 1; } - ReadScaleFactor__32(); + ReadScaleFactor__37(); if (negE) { if (e <= 308) { y = y / (LONGREAL)Reals_TenL(e); @@ -895,7 +1039,7 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) j += 1; } if (ch == 'E') { - ReadScaleFactor__32(); + ReadScaleFactor__37(); } if (negE) { if (e <= 38) { @@ -948,7 +1092,7 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) } } (*S).nextCh = ch; - Scan__31_s = _s.lnk; + Scan__36_s = _s.lnk; } void Texts_OpenWriter (Texts_Writer *W, ADDRESS *W__typ) @@ -1167,30 +1311,30 @@ void Texts_WriteReal (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n) } } -static struct WriteRealFix__53 { +static struct WriteRealFix__58 { Texts_Writer *W; ADDRESS *W__typ; INT16 *i; CHAR (*d)[9]; - struct WriteRealFix__53 *lnk; -} *WriteRealFix__53_s; + struct WriteRealFix__58 *lnk; +} *WriteRealFix__58_s; -static void dig__54 (INT16 n); -static void seq__56 (CHAR ch, INT16 n); +static void dig__59 (INT16 n); +static void seq__61 (CHAR ch, INT16 n); -static void seq__56 (CHAR ch, INT16 n) +static void seq__61 (CHAR ch, INT16 n) { while (n > 0) { - Texts_Write(&*WriteRealFix__53_s->W, WriteRealFix__53_s->W__typ, ch); + Texts_Write(&*WriteRealFix__58_s->W, WriteRealFix__58_s->W__typ, ch); n -= 1; } } -static void dig__54 (INT16 n) +static void dig__59 (INT16 n) { while (n > 0) { - *WriteRealFix__53_s->i -= 1; - Texts_Write(&*WriteRealFix__53_s->W, WriteRealFix__53_s->W__typ, (*WriteRealFix__53_s->d)[__X(*WriteRealFix__53_s->i, 9)]); + *WriteRealFix__58_s->i -= 1; + Texts_Write(&*WriteRealFix__58_s->W, WriteRealFix__58_s->W__typ, (*WriteRealFix__58_s->d)[__X(*WriteRealFix__58_s->i, 9)]); n -= 1; } } @@ -1201,23 +1345,23 @@ void Texts_WriteRealFix (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n, INT1 CHAR sign; REAL x0; CHAR d[9]; - struct WriteRealFix__53 _s; + struct WriteRealFix__58 _s; _s.W = W; _s.W__typ = W__typ; _s.i = &i; _s.d = (void*)d; - _s.lnk = WriteRealFix__53_s; - WriteRealFix__53_s = &_s; + _s.lnk = WriteRealFix__58_s; + WriteRealFix__58_s = &_s; e = Reals_Expo(x); if (k < 0) { k = 0; } if (e == 0) { - seq__56(' ', (n - k) - 2); + seq__61(' ', (n - k) - 2); Texts_Write(&*W, W__typ, '0'); - seq__56(' ', k + 1); + seq__61(' ', k + 1); } else if (e == 255) { Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", 5); - seq__56(' ', n - 4); + seq__61(' ', n - 4); } else { e = __ASHR((e - 127) * 77, 8); if (x < (REAL)0) { @@ -1250,21 +1394,21 @@ void Texts_WriteRealFix (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n, INT1 i = k + e; Reals_Convert(x, i, (void*)d, 9); if (e > 0) { - seq__56(' ', ((n - e) - k) - 2); + seq__61(' ', ((n - e) - k) - 2); Texts_Write(&*W, W__typ, sign); - dig__54(e); + dig__59(e); Texts_Write(&*W, W__typ, '.'); - dig__54(k); + dig__59(k); } else { - seq__56(' ', (n - k) - 3); + seq__61(' ', (n - k) - 3); Texts_Write(&*W, W__typ, sign); Texts_Write(&*W, W__typ, '0'); Texts_Write(&*W, W__typ, '.'); - seq__56('0', -e); - dig__54(k + e); + seq__61('0', -e); + dig__59(k + e); } } - WriteRealFix__53_s = _s.lnk; + WriteRealFix__58_s = _s.lnk; } void Texts_WriteRealHex (Texts_Writer *W, ADDRESS *W__typ, REAL x) @@ -1363,48 +1507,48 @@ void Texts_WriteLongRealHex (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x) } while (!(i == 16)); } -static struct WriteDate__43 { +static struct WriteDate__48 { Texts_Writer *W; ADDRESS *W__typ; - struct WriteDate__43 *lnk; -} *WriteDate__43_s; + struct WriteDate__48 *lnk; +} *WriteDate__48_s; -static void WritePair__44 (CHAR ch, INT32 x); +static void WritePair__49 (CHAR ch, INT32 x); -static void WritePair__44 (CHAR ch, INT32 x) +static void WritePair__49 (CHAR ch, INT32 x) { - Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, ch); - Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)(__DIV(x, 10) + 48)); - Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)((int)__MOD(x, 10) + 48)); + Texts_Write(&*WriteDate__48_s->W, WriteDate__48_s->W__typ, ch); + Texts_Write(&*WriteDate__48_s->W, WriteDate__48_s->W__typ, (CHAR)(__DIV(x, 10) + 48)); + Texts_Write(&*WriteDate__48_s->W, WriteDate__48_s->W__typ, (CHAR)((int)__MOD(x, 10) + 48)); } void Texts_WriteDate (Texts_Writer *W, ADDRESS *W__typ, INT32 t, INT32 d) { - struct WriteDate__43 _s; + struct WriteDate__48 _s; _s.W = W; _s.W__typ = W__typ; - _s.lnk = WriteDate__43_s; - WriteDate__43_s = &_s; - WritePair__44(' ', __MASK(d, -32)); - WritePair__44('.', __MASK(__ASHR(d, 5), -16)); - WritePair__44('.', __MASK(__ASHR(d, 9), -128)); - WritePair__44(' ', __MASK(__ASHR(t, 12), -32)); - WritePair__44(':', __MASK(__ASHR(t, 6), -64)); - WritePair__44(':', __MASK(t, -64)); - WriteDate__43_s = _s.lnk; + _s.lnk = WriteDate__48_s; + WriteDate__48_s = &_s; + WritePair__49(' ', __MASK(d, -32)); + WritePair__49('.', __MASK(__ASHR(d, 5), -16)); + WritePair__49('.', __MASK(__ASHR(d, 9), -128)); + WritePair__49(' ', __MASK(__ASHR(t, 12), -32)); + WritePair__49(':', __MASK(__ASHR(t, 6), -64)); + WritePair__49(':', __MASK(t, -64)); + WriteDate__48_s = _s.lnk; } -static struct Load0__16 { +static struct Load0__21 { Texts_Text *T; INT8 *ecnt; Files_File *f; Texts_FileMsg *msg; CHAR (*mods)[64][32], (*procs)[64][32]; - struct Load0__16 *lnk; -} *Load0__16_s; + struct Load0__21 *lnk; +} *Load0__21_s; -static void LoadElem__17 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e); +static void LoadElem__22 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e); -static void LoadElem__17 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e) +static void LoadElem__22 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e) { Modules_Module M = NIL; Modules_Command Cmd; @@ -1415,15 +1559,15 @@ static void LoadElem__17 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span Files_ReadLInt(&*r, r__typ, &ew); Files_ReadLInt(&*r, r__typ, &eh); Files_Read(&*r, r__typ, (void*)&eno); - if (eno > *Load0__16_s->ecnt) { - *Load0__16_s->ecnt = eno; - Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->mods)[__X(eno, 64)], 32); - Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->procs)[__X(eno, 64)], 32); + if (eno > *Load0__21_s->ecnt) { + *Load0__21_s->ecnt = eno; + Files_ReadString(&*r, r__typ, (void*)(*Load0__21_s->mods)[__X(eno, 64)], 32); + Files_ReadString(&*r, r__typ, (void*)(*Load0__21_s->procs)[__X(eno, 64)], 32); } org = Files_Pos(&*r, r__typ); - M = Modules_ThisMod((*Load0__16_s->mods)[__X(eno, 64)], 32); + M = Modules_ThisMod((*Load0__21_s->mods)[__X(eno, 64)], 32); if (M != NIL) { - Cmd = Modules_ThisCommand(M, (*Load0__16_s->procs)[__X(eno, 64)], 32); + Cmd = Modules_ThisCommand(M, (*Load0__21_s->procs)[__X(eno, 64)], 32); if (Cmd != NIL) { (*Cmd)(); } @@ -1432,25 +1576,25 @@ static void LoadElem__17 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span if (*e != NIL) { (*e)->W = ew; (*e)->H = eh; - (*e)->base = *Load0__16_s->T; - (*Load0__16_s->msg).pos = pos; - (*(*e)->handle)(*e, (void*)&*Load0__16_s->msg, Texts_FileMsg__typ); + (*e)->base = *Load0__21_s->T; + (*Load0__21_s->msg).pos = pos; + (*(*e)->handle)(*e, (void*)&*Load0__21_s->msg, Texts_FileMsg__typ); if (Files_Pos(&*r, r__typ) != org + span) { *e = NIL; } } if (*e == NIL) { - Files_Set(&*r, r__typ, *Load0__16_s->f, org + span); + Files_Set(&*r, r__typ, *Load0__21_s->f, org + span); __NEW(a, Texts__1); a->W = ew; a->H = eh; a->handle = Texts_HandleAlien; - a->base = *Load0__16_s->T; - a->file = *Load0__16_s->f; + a->base = *Load0__21_s->T; + a->file = *Load0__21_s->f; a->org = org; a->span = span; - __COPY((*Load0__16_s->mods)[__X(eno, 64)], a->mod, 32); - __COPY((*Load0__16_s->procs)[__X(eno, 64)], a->proc, 32); + __COPY((*Load0__21_s->mods)[__X(eno, 64)], a->mod, 32); + __COPY((*Load0__21_s->procs)[__X(eno, 64)], a->proc, 32); *e = (Texts_Elem)a; } } @@ -1467,15 +1611,15 @@ static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) CHAR mods[64][32], procs[64][32]; CHAR name[32]; Texts_FontsFont fnts[32]; - struct Load0__16 _s; + struct Load0__21 _s; _s.T = &T; _s.ecnt = &ecnt; _s.f = &f; _s.msg = &msg; _s.mods = (void*)mods; _s.procs = (void*)procs; - _s.lnk = Load0__16_s; - Load0__16_s = &_s; + _s.lnk = Load0__21_s; + Load0__21_s = &_s; pos = Files_Pos(&*r, r__typ); f = Files_Base(&*r, r__typ); __NEW(u, Texts_RunDesc); @@ -1508,7 +1652,7 @@ static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) un = (Texts_Run)p; un->len = plen; } else { - LoadElem__17(&msg.r, Files_Rider__typ, pos - org, -plen, &e); + LoadElem__22(&msg.r, Files_Rider__typ, pos - org, -plen, &e); un = (Texts_Run)e; un->len = 1; } @@ -1526,7 +1670,7 @@ static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) T->corg = 0; Files_ReadLInt(&msg.r, Files_Rider__typ, &T->len); Files_Set(&*r, r__typ, f, Files_Pos(&msg.r, Files_Rider__typ) + T->len); - Load0__16_s = _s.lnk; + Load0__21_s = _s.lnk; } void Texts_Load (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) @@ -1595,25 +1739,25 @@ void Texts_Open (Texts_Text T, CHAR *name, ADDRESS name__len) __DEL(name); } -static struct Store__39 { +static struct Store__44 { INT8 *ecnt; Texts_FileMsg *msg; Texts_IdentifyMsg *iden; CHAR (*mods)[64][32], (*procs)[64][32]; - struct Store__39 *lnk; -} *Store__39_s; + struct Store__44 *lnk; +} *Store__44_s; -static void StoreElem__40 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e); +static void StoreElem__45 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e); -static void StoreElem__40 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e) +static void StoreElem__45 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e) { Files_Rider r1; INT32 org, span; INT8 eno; - __COPY((*Store__39_s->iden).mod, (*Store__39_s->mods)[__X(*Store__39_s->ecnt, 64)], 32); - __COPY((*Store__39_s->iden).proc, (*Store__39_s->procs)[__X(*Store__39_s->ecnt, 64)], 32); + __COPY((*Store__44_s->iden).mod, (*Store__44_s->mods)[__X(*Store__44_s->ecnt, 64)], 32); + __COPY((*Store__44_s->iden).proc, (*Store__44_s->procs)[__X(*Store__44_s->ecnt, 64)], 32); eno = 1; - while (__STRCMP((*Store__39_s->mods)[__X(eno, 64)], (*Store__39_s->iden).mod) != 0 || __STRCMP((*Store__39_s->procs)[__X(eno, 64)], (*Store__39_s->iden).proc) != 0) { + while (__STRCMP((*Store__44_s->mods)[__X(eno, 64)], (*Store__44_s->iden).mod) != 0 || __STRCMP((*Store__44_s->procs)[__X(eno, 64)], (*Store__44_s->iden).proc) != 0) { eno += 1; } Files_Set(&r1, Files_Rider__typ, Files_Base(&*r, r__typ), Files_Pos(&*r, r__typ)); @@ -1621,14 +1765,14 @@ static void StoreElem__40 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Ele Files_WriteLInt(&*r, r__typ, 0); Files_WriteLInt(&*r, r__typ, 0); Files_Write(&*r, r__typ, eno); - if (eno == *Store__39_s->ecnt) { - *Store__39_s->ecnt += 1; - Files_WriteString(&*r, r__typ, (*Store__39_s->iden).mod, 32); - Files_WriteString(&*r, r__typ, (*Store__39_s->iden).proc, 32); + if (eno == *Store__44_s->ecnt) { + *Store__44_s->ecnt += 1; + Files_WriteString(&*r, r__typ, (*Store__44_s->iden).mod, 32); + Files_WriteString(&*r, r__typ, (*Store__44_s->iden).proc, 32); } - (*Store__39_s->msg).pos = pos; + (*Store__44_s->msg).pos = pos; org = Files_Pos(&*r, r__typ); - (*e->handle)(e, (void*)&*Store__39_s->msg, Texts_FileMsg__typ); + (*e->handle)(e, (void*)&*Store__44_s->msg, Texts_FileMsg__typ); span = Files_Pos(&*r, r__typ) - org; Files_WriteLInt(&r1, Files_Rider__typ, -span); Files_WriteLInt(&r1, Files_Rider__typ, e->W); @@ -1649,14 +1793,14 @@ void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) CHAR mods[64][32], procs[64][32]; Texts_FontsFont fnts[32]; CHAR block[1024]; - struct Store__39 _s; + struct Store__44 _s; _s.ecnt = &ecnt; _s.msg = &msg; _s.iden = &iden; _s.mods = (void*)mods; _s.procs = (void*)procs; - _s.lnk = Store__39_s; - Store__39_s = &_s; + _s.lnk = Store__44_s; + Store__44_s = &_s; org = Files_Pos(&*r, r__typ); msg.id = 1; msg.r = *r; @@ -1698,7 +1842,7 @@ void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) pos += rlen; u = un; } else if (iden.mod[0] != 0x00) { - StoreElem__40(&msg.r, Files_Rider__typ, pos, __GUARDP(u, Texts_ElemDesc, 1)); + StoreElem__45(&msg.r, Files_Rider__typ, pos, __GUARDP(u, Texts_ElemDesc, 1)); pos += 1; u = u->next; } else { @@ -1752,7 +1896,7 @@ void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) if (T->notify != NIL) { (*T->notify)(T, 3, 0, 0); } - Store__39_s = _s.lnk; + Store__44_s = _s.lnk; } void Texts_Close (Texts_Text T, CHAR *name, ADDRESS name__len) @@ -1809,6 +1953,7 @@ export void *Texts__init(void) __DEFMOD; __MODULE_IMPORT(Files); __MODULE_IMPORT(Modules); + __MODULE_IMPORT(Out); __MODULE_IMPORT(Reals); __REGMOD("Texts", EnumPtrs); __INITYP(Texts_FontDesc, Texts_FontDesc, 0); diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index e36cbaf0..dc149133 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h @@ -135,6 +135,7 @@ import void Texts_Close (Texts_Text T, CHAR *name, ADDRESS name__len); import void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); import void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); import void Texts_Delete (Texts_Text T, INT32 beg, INT32 end); +import void Texts_DumpReader (Texts_Reader re); import Texts_Text Texts_ElemBase (Texts_Elem E); import INT32 Texts_ElemPos (Texts_Elem E); import void Texts_Insert (Texts_Text T, INT32 pos, Texts_Buffer B); diff --git a/bootstrap/windows-48/VT100.c b/bootstrap/windows-48/VT100.c index 8d349c3e..669a337a 100644 --- a/bootstrap/windows-48/VT100.c +++ b/bootstrap/windows-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/VT100.h b/bootstrap/windows-48/VT100.h index 494b7318..809a6082 100644 --- a/bootstrap/windows-48/VT100.h +++ b/bootstrap/windows-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index f9e7e802..b9ca8d5a 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index ee0ea191..6a31ee74 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/Compiler.c b/bootstrap/windows-88/Compiler.c index 2c7543fe..3b84a5bd 100644 --- a/bootstrap/windows-88/Compiler.c +++ b/bootstrap/windows-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index aa8e2c43..319659fe 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index aae60644..d438eca9 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 5a7119c8..1f47f261 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index a68e0ac1..683cb78a 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index faed3f24..79d83cee 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index becc1414..29a878c2 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 14d48bb8..83b46a4a 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index ce643d9b..162947ee 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index 6f2b5545..a7d429eb 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index 589e67db..a49077b0 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index bf503129..89ef22dc 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index 59d5e057..b30a2315 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 8122e208..5b3cc3c5 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -494,6 +494,7 @@ void OPM_Get (CHAR *ch) OPM_LogWStr((CHAR*)"DEBUG: OPM.Get returned inR.eot at curpos = 0, ch = ", 53); OPM_LogWNum((INT16)*ch, 1); OPM_LogW('.'); + Texts_DumpReader(OPM_inR); } if ((*ch < 0x09 && !OPM_inR.eot)) { *ch = ' '; diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index 4bd19104..d1c71f13 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index cddb65e4..a529c16e 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index aeb70b16..c82b4d80 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index 6820f239..a3b32b0c 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index 815f29a7..99c62664 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index 3bab2d83..0bca4ab5 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index f3af656f..1aec7cad 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 6405cdff..097c0a7c 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index 6807e936..9ad5508d 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Out.c b/bootstrap/windows-88/Out.c index d7d446f8..1f466dc9 100644 --- a/bootstrap/windows-88/Out.c +++ b/bootstrap/windows-88/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Out.h b/bootstrap/windows-88/Out.h index 20d983e1..a3f5db4d 100644 --- a/bootstrap/windows-88/Out.h +++ b/bootstrap/windows-88/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index b042778e..7a37d42c 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index eaa8d20e..369ea02a 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 35ecc020..8ba81525 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index be278393..0fe868e0 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index b0c053b8..a6a802c4 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index 3d53c582..bec035c4 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index 95d0173a..eba58f8f 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -8,6 +8,7 @@ #include "SYSTEM.h" #include "Files.h" #include "Modules.h" +#include "Out.h" #include "Reals.h" typedef @@ -191,6 +192,11 @@ export void Texts_Close (Texts_Text T, CHAR *name, ADDRESS name__len); export void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); export void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); export void Texts_Delete (Texts_Text T, INT32 beg, INT32 end); +static void Texts_DumpElem (Texts_Elem e); +export void Texts_DumpReader (Texts_Reader re); +static void Texts_DumpRider (Files_Rider ri); +static void Texts_DumpRun (Texts_Run ru); +static void Texts_DumpText (Texts_Text t); export Texts_Text Texts_ElemBase (Texts_Elem E); export INT32 Texts_ElemPos (Texts_Elem E); static void Texts_Find (Texts_Text T, INT32 *pos, Texts_Run *u, INT32 *org, INT32 *off); @@ -232,6 +238,144 @@ export void Texts_WriteRealHex (Texts_Writer *W, ADDRESS *W__typ, REAL x); export void Texts_WriteString (Texts_Writer *W, ADDRESS *W__typ, CHAR *s, ADDRESS s__len); +static void Texts_DumpText (Texts_Text t) +{ + Out_String((CHAR*)" len: ", 15); + Out_Int(t->len, 1); + Out_Ln(); + Out_String((CHAR*)" notify: ", 15); + Out_Int((INT64)(ADDRESS)t->notify, 1); + Out_Ln(); + Out_String((CHAR*)" head: ", 15); + Out_Int((INT64)(ADDRESS)t->head, 1); + Out_Ln(); + Out_String((CHAR*)" cache: ", 15); + Out_Int((INT64)(ADDRESS)t->cache, 1); + Out_Ln(); + Out_String((CHAR*)" corg: ", 15); + Out_Int(t->corg, 1); + Out_Ln(); +} + +static void Texts_DumpElem (Texts_Elem e) +{ + Out_String((CHAR*)" W: ", 13); + Out_Int(e->W, 1); + Out_Ln(); + Out_String((CHAR*)" H: ", 13); + Out_Int(e->H, 1); + Out_Ln(); + Out_String((CHAR*)" handle: ", 13); + Out_Int((INT64)(ADDRESS)e->handle, 1); + Out_Ln(); + Out_String((CHAR*)" base: ", 13); + if (e->base == NIL) { + Out_String((CHAR*)"", 6); + Out_Ln(); + } else { + Out_Ln(); + Texts_DumpText(e->base); + } +} + +static void Texts_DumpRider (Files_Rider ri) +{ + Out_String((CHAR*)" res: ", 10); + Out_Int(ri.res, 1); + Out_Ln(); + Out_String((CHAR*)" eof: ", 10); + if (ri.eof) { + Out_String((CHAR*)"TRUE", 5); + } else { + Out_String((CHAR*)"FALSE", 6); + } + Out_Ln(); +} + +static void Texts_DumpRun (Texts_Run ru) +{ + Out_String((CHAR*)" prev: ", 12); + Out_Int((INT64)(ADDRESS)ru->prev, 1); + Out_Ln(); + Out_String((CHAR*)" next: ", 12); + Out_Int((INT64)(ADDRESS)ru->next, 1); + Out_Ln(); + Out_String((CHAR*)" len: ", 12); + Out_Int(ru->len, 1); + Out_Ln(); + Out_String((CHAR*)" fnt: ", 12); + if (ru->fnt != NIL) { + Out_String(ru->fnt->name, 32); + } else { + Out_String((CHAR*)"", 6); + } + Out_Ln(); + Out_String((CHAR*)" col: ", 12); + Out_Int(ru->col, 1); + Out_Ln(); + Out_String((CHAR*)" voff: ", 12); + Out_Int(ru->voff, 1); + Out_Ln(); + Out_String((CHAR*)" ascii: ", 12); + if (ru->ascii) { + Out_String((CHAR*)"TRUE", 5); + } else { + Out_String((CHAR*)"FALSE", 6); + } + Out_Ln(); +} + +void Texts_DumpReader (Texts_Reader re) +{ + Out_String((CHAR*)"Reader:", 8); + Out_Ln(); + Out_String((CHAR*)" eot: ", 10); + if (re.eot) { + Out_String((CHAR*)"TRUE", 5); + } else { + Out_String((CHAR*)"FALSE", 6); + } + Out_Ln(); + Out_String((CHAR*)" fnt: ", 10); + if (re.fnt != NIL) { + Out_String(re.fnt->name, 32); + } else { + Out_String((CHAR*)"", 6); + } + Out_Ln(); + Out_String((CHAR*)" col: ", 10); + Out_Int(re.col, 1); + Out_Ln(); + Out_String((CHAR*)" voff: ", 10); + Out_Int(re.voff, 1); + Out_Ln(); + Out_String((CHAR*)" org: ", 10); + Out_Int(re.org, 1); + Out_Ln(); + Out_String((CHAR*)" off: ", 10); + Out_Int(re.off, 1); + Out_Ln(); + Out_String((CHAR*)" elem: ", 10); + if (re.elem == NIL) { + Out_String((CHAR*)"", 6); + Out_Ln(); + } else { + Out_Ln(); + Texts_DumpElem(re.elem); + } + Out_String((CHAR*)" rider: ", 10); + Out_Ln(); + Texts_DumpRider(re.rider); + Out_String((CHAR*)" run: ", 10); + if (re.run == NIL) { + Out_String((CHAR*)"", 6); + Out_Ln(); + } else { + Out_Ln(); + Texts_DumpRun(re.run); + } +} + static Texts_FontsFont Texts_FontsThis (CHAR *name, ADDRESS name__len) { Texts_FontsFont F = NIL; @@ -716,32 +860,32 @@ void Texts_OpenScanner (Texts_Scanner *S, ADDRESS *S__typ, Texts_Text T, INT32 p (*S).nextCh = ' '; } -static struct Scan__31 { +static struct Scan__36 { Texts_Scanner *S; ADDRESS *S__typ; CHAR *ch; BOOLEAN *negE; INT16 *e; - struct Scan__31 *lnk; -} *Scan__31_s; + struct Scan__36 *lnk; +} *Scan__36_s; -static void ReadScaleFactor__32 (void); +static void ReadScaleFactor__37 (void); -static void ReadScaleFactor__32 (void) +static void ReadScaleFactor__37 (void) { - Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); - if (*Scan__31_s->ch == '-') { - *Scan__31_s->negE = 1; - Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); + Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); + if (*Scan__36_s->ch == '-') { + *Scan__36_s->negE = 1; + Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); } else { - *Scan__31_s->negE = 0; - if (*Scan__31_s->ch == '+') { - Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); + *Scan__36_s->negE = 0; + if (*Scan__36_s->ch == '+') { + Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); } } - while (('0' <= *Scan__31_s->ch && *Scan__31_s->ch <= '9')) { - *Scan__31_s->e = (*Scan__31_s->e * 10 + (INT16)*Scan__31_s->ch) - 48; - Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); + while (('0' <= *Scan__36_s->ch && *Scan__36_s->ch <= '9')) { + *Scan__36_s->e = (*Scan__36_s->e * 10 + (INT16)*Scan__36_s->ch) - 48; + Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); } } @@ -755,13 +899,13 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) REAL x, f; LONGREAL y, g; CHAR d[32]; - struct Scan__31 _s; + struct Scan__36 _s; _s.S = S; _s.S__typ = S__typ; _s.ch = &ch; _s.negE = &negE; _s.e = &e; - _s.lnk = Scan__31_s; - Scan__31_s = &_s; + _s.lnk = Scan__36_s; + Scan__36_s = &_s; ch = (*S).nextCh; i = 0; for (;;) { @@ -862,7 +1006,7 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) y = ((INT16)d[__X(j, 32)] - 48) * g + y; j += 1; } - ReadScaleFactor__32(); + ReadScaleFactor__37(); if (negE) { if (e <= 308) { y = y / (LONGREAL)Reals_TenL(e); @@ -895,7 +1039,7 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) j += 1; } if (ch == 'E') { - ReadScaleFactor__32(); + ReadScaleFactor__37(); } if (negE) { if (e <= 38) { @@ -948,7 +1092,7 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) } } (*S).nextCh = ch; - Scan__31_s = _s.lnk; + Scan__36_s = _s.lnk; } void Texts_OpenWriter (Texts_Writer *W, ADDRESS *W__typ) @@ -1167,30 +1311,30 @@ void Texts_WriteReal (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n) } } -static struct WriteRealFix__53 { +static struct WriteRealFix__58 { Texts_Writer *W; ADDRESS *W__typ; INT16 *i; CHAR (*d)[9]; - struct WriteRealFix__53 *lnk; -} *WriteRealFix__53_s; + struct WriteRealFix__58 *lnk; +} *WriteRealFix__58_s; -static void dig__54 (INT16 n); -static void seq__56 (CHAR ch, INT16 n); +static void dig__59 (INT16 n); +static void seq__61 (CHAR ch, INT16 n); -static void seq__56 (CHAR ch, INT16 n) +static void seq__61 (CHAR ch, INT16 n) { while (n > 0) { - Texts_Write(&*WriteRealFix__53_s->W, WriteRealFix__53_s->W__typ, ch); + Texts_Write(&*WriteRealFix__58_s->W, WriteRealFix__58_s->W__typ, ch); n -= 1; } } -static void dig__54 (INT16 n) +static void dig__59 (INT16 n) { while (n > 0) { - *WriteRealFix__53_s->i -= 1; - Texts_Write(&*WriteRealFix__53_s->W, WriteRealFix__53_s->W__typ, (*WriteRealFix__53_s->d)[__X(*WriteRealFix__53_s->i, 9)]); + *WriteRealFix__58_s->i -= 1; + Texts_Write(&*WriteRealFix__58_s->W, WriteRealFix__58_s->W__typ, (*WriteRealFix__58_s->d)[__X(*WriteRealFix__58_s->i, 9)]); n -= 1; } } @@ -1201,23 +1345,23 @@ void Texts_WriteRealFix (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n, INT1 CHAR sign; REAL x0; CHAR d[9]; - struct WriteRealFix__53 _s; + struct WriteRealFix__58 _s; _s.W = W; _s.W__typ = W__typ; _s.i = &i; _s.d = (void*)d; - _s.lnk = WriteRealFix__53_s; - WriteRealFix__53_s = &_s; + _s.lnk = WriteRealFix__58_s; + WriteRealFix__58_s = &_s; e = Reals_Expo(x); if (k < 0) { k = 0; } if (e == 0) { - seq__56(' ', (n - k) - 2); + seq__61(' ', (n - k) - 2); Texts_Write(&*W, W__typ, '0'); - seq__56(' ', k + 1); + seq__61(' ', k + 1); } else if (e == 255) { Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", 5); - seq__56(' ', n - 4); + seq__61(' ', n - 4); } else { e = __ASHR((e - 127) * 77, 8); if (x < (REAL)0) { @@ -1250,21 +1394,21 @@ void Texts_WriteRealFix (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n, INT1 i = k + e; Reals_Convert(x, i, (void*)d, 9); if (e > 0) { - seq__56(' ', ((n - e) - k) - 2); + seq__61(' ', ((n - e) - k) - 2); Texts_Write(&*W, W__typ, sign); - dig__54(e); + dig__59(e); Texts_Write(&*W, W__typ, '.'); - dig__54(k); + dig__59(k); } else { - seq__56(' ', (n - k) - 3); + seq__61(' ', (n - k) - 3); Texts_Write(&*W, W__typ, sign); Texts_Write(&*W, W__typ, '0'); Texts_Write(&*W, W__typ, '.'); - seq__56('0', -e); - dig__54(k + e); + seq__61('0', -e); + dig__59(k + e); } } - WriteRealFix__53_s = _s.lnk; + WriteRealFix__58_s = _s.lnk; } void Texts_WriteRealHex (Texts_Writer *W, ADDRESS *W__typ, REAL x) @@ -1363,48 +1507,48 @@ void Texts_WriteLongRealHex (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x) } while (!(i == 16)); } -static struct WriteDate__43 { +static struct WriteDate__48 { Texts_Writer *W; ADDRESS *W__typ; - struct WriteDate__43 *lnk; -} *WriteDate__43_s; + struct WriteDate__48 *lnk; +} *WriteDate__48_s; -static void WritePair__44 (CHAR ch, INT32 x); +static void WritePair__49 (CHAR ch, INT32 x); -static void WritePair__44 (CHAR ch, INT32 x) +static void WritePair__49 (CHAR ch, INT32 x) { - Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, ch); - Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)(__DIV(x, 10) + 48)); - Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)((int)__MOD(x, 10) + 48)); + Texts_Write(&*WriteDate__48_s->W, WriteDate__48_s->W__typ, ch); + Texts_Write(&*WriteDate__48_s->W, WriteDate__48_s->W__typ, (CHAR)(__DIV(x, 10) + 48)); + Texts_Write(&*WriteDate__48_s->W, WriteDate__48_s->W__typ, (CHAR)((int)__MOD(x, 10) + 48)); } void Texts_WriteDate (Texts_Writer *W, ADDRESS *W__typ, INT32 t, INT32 d) { - struct WriteDate__43 _s; + struct WriteDate__48 _s; _s.W = W; _s.W__typ = W__typ; - _s.lnk = WriteDate__43_s; - WriteDate__43_s = &_s; - WritePair__44(' ', __MASK(d, -32)); - WritePair__44('.', __MASK(__ASHR(d, 5), -16)); - WritePair__44('.', __MASK(__ASHR(d, 9), -128)); - WritePair__44(' ', __MASK(__ASHR(t, 12), -32)); - WritePair__44(':', __MASK(__ASHR(t, 6), -64)); - WritePair__44(':', __MASK(t, -64)); - WriteDate__43_s = _s.lnk; + _s.lnk = WriteDate__48_s; + WriteDate__48_s = &_s; + WritePair__49(' ', __MASK(d, -32)); + WritePair__49('.', __MASK(__ASHR(d, 5), -16)); + WritePair__49('.', __MASK(__ASHR(d, 9), -128)); + WritePair__49(' ', __MASK(__ASHR(t, 12), -32)); + WritePair__49(':', __MASK(__ASHR(t, 6), -64)); + WritePair__49(':', __MASK(t, -64)); + WriteDate__48_s = _s.lnk; } -static struct Load0__16 { +static struct Load0__21 { Texts_Text *T; INT8 *ecnt; Files_File *f; Texts_FileMsg *msg; CHAR (*mods)[64][32], (*procs)[64][32]; - struct Load0__16 *lnk; -} *Load0__16_s; + struct Load0__21 *lnk; +} *Load0__21_s; -static void LoadElem__17 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e); +static void LoadElem__22 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e); -static void LoadElem__17 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e) +static void LoadElem__22 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e) { Modules_Module M = NIL; Modules_Command Cmd; @@ -1415,15 +1559,15 @@ static void LoadElem__17 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span Files_ReadLInt(&*r, r__typ, &ew); Files_ReadLInt(&*r, r__typ, &eh); Files_Read(&*r, r__typ, (void*)&eno); - if (eno > *Load0__16_s->ecnt) { - *Load0__16_s->ecnt = eno; - Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->mods)[__X(eno, 64)], 32); - Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->procs)[__X(eno, 64)], 32); + if (eno > *Load0__21_s->ecnt) { + *Load0__21_s->ecnt = eno; + Files_ReadString(&*r, r__typ, (void*)(*Load0__21_s->mods)[__X(eno, 64)], 32); + Files_ReadString(&*r, r__typ, (void*)(*Load0__21_s->procs)[__X(eno, 64)], 32); } org = Files_Pos(&*r, r__typ); - M = Modules_ThisMod((*Load0__16_s->mods)[__X(eno, 64)], 32); + M = Modules_ThisMod((*Load0__21_s->mods)[__X(eno, 64)], 32); if (M != NIL) { - Cmd = Modules_ThisCommand(M, (*Load0__16_s->procs)[__X(eno, 64)], 32); + Cmd = Modules_ThisCommand(M, (*Load0__21_s->procs)[__X(eno, 64)], 32); if (Cmd != NIL) { (*Cmd)(); } @@ -1432,25 +1576,25 @@ static void LoadElem__17 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span if (*e != NIL) { (*e)->W = ew; (*e)->H = eh; - (*e)->base = *Load0__16_s->T; - (*Load0__16_s->msg).pos = pos; - (*(*e)->handle)(*e, (void*)&*Load0__16_s->msg, Texts_FileMsg__typ); + (*e)->base = *Load0__21_s->T; + (*Load0__21_s->msg).pos = pos; + (*(*e)->handle)(*e, (void*)&*Load0__21_s->msg, Texts_FileMsg__typ); if (Files_Pos(&*r, r__typ) != org + span) { *e = NIL; } } if (*e == NIL) { - Files_Set(&*r, r__typ, *Load0__16_s->f, org + span); + Files_Set(&*r, r__typ, *Load0__21_s->f, org + span); __NEW(a, Texts__1); a->W = ew; a->H = eh; a->handle = Texts_HandleAlien; - a->base = *Load0__16_s->T; - a->file = *Load0__16_s->f; + a->base = *Load0__21_s->T; + a->file = *Load0__21_s->f; a->org = org; a->span = span; - __COPY((*Load0__16_s->mods)[__X(eno, 64)], a->mod, 32); - __COPY((*Load0__16_s->procs)[__X(eno, 64)], a->proc, 32); + __COPY((*Load0__21_s->mods)[__X(eno, 64)], a->mod, 32); + __COPY((*Load0__21_s->procs)[__X(eno, 64)], a->proc, 32); *e = (Texts_Elem)a; } } @@ -1467,15 +1611,15 @@ static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) CHAR mods[64][32], procs[64][32]; CHAR name[32]; Texts_FontsFont fnts[32]; - struct Load0__16 _s; + struct Load0__21 _s; _s.T = &T; _s.ecnt = &ecnt; _s.f = &f; _s.msg = &msg; _s.mods = (void*)mods; _s.procs = (void*)procs; - _s.lnk = Load0__16_s; - Load0__16_s = &_s; + _s.lnk = Load0__21_s; + Load0__21_s = &_s; pos = Files_Pos(&*r, r__typ); f = Files_Base(&*r, r__typ); __NEW(u, Texts_RunDesc); @@ -1508,7 +1652,7 @@ static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) un = (Texts_Run)p; un->len = plen; } else { - LoadElem__17(&msg.r, Files_Rider__typ, pos - org, -plen, &e); + LoadElem__22(&msg.r, Files_Rider__typ, pos - org, -plen, &e); un = (Texts_Run)e; un->len = 1; } @@ -1526,7 +1670,7 @@ static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) T->corg = 0; Files_ReadLInt(&msg.r, Files_Rider__typ, &T->len); Files_Set(&*r, r__typ, f, Files_Pos(&msg.r, Files_Rider__typ) + T->len); - Load0__16_s = _s.lnk; + Load0__21_s = _s.lnk; } void Texts_Load (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) @@ -1595,25 +1739,25 @@ void Texts_Open (Texts_Text T, CHAR *name, ADDRESS name__len) __DEL(name); } -static struct Store__39 { +static struct Store__44 { INT8 *ecnt; Texts_FileMsg *msg; Texts_IdentifyMsg *iden; CHAR (*mods)[64][32], (*procs)[64][32]; - struct Store__39 *lnk; -} *Store__39_s; + struct Store__44 *lnk; +} *Store__44_s; -static void StoreElem__40 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e); +static void StoreElem__45 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e); -static void StoreElem__40 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e) +static void StoreElem__45 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e) { Files_Rider r1; INT32 org, span; INT8 eno; - __COPY((*Store__39_s->iden).mod, (*Store__39_s->mods)[__X(*Store__39_s->ecnt, 64)], 32); - __COPY((*Store__39_s->iden).proc, (*Store__39_s->procs)[__X(*Store__39_s->ecnt, 64)], 32); + __COPY((*Store__44_s->iden).mod, (*Store__44_s->mods)[__X(*Store__44_s->ecnt, 64)], 32); + __COPY((*Store__44_s->iden).proc, (*Store__44_s->procs)[__X(*Store__44_s->ecnt, 64)], 32); eno = 1; - while (__STRCMP((*Store__39_s->mods)[__X(eno, 64)], (*Store__39_s->iden).mod) != 0 || __STRCMP((*Store__39_s->procs)[__X(eno, 64)], (*Store__39_s->iden).proc) != 0) { + while (__STRCMP((*Store__44_s->mods)[__X(eno, 64)], (*Store__44_s->iden).mod) != 0 || __STRCMP((*Store__44_s->procs)[__X(eno, 64)], (*Store__44_s->iden).proc) != 0) { eno += 1; } Files_Set(&r1, Files_Rider__typ, Files_Base(&*r, r__typ), Files_Pos(&*r, r__typ)); @@ -1621,14 +1765,14 @@ static void StoreElem__40 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Ele Files_WriteLInt(&*r, r__typ, 0); Files_WriteLInt(&*r, r__typ, 0); Files_Write(&*r, r__typ, eno); - if (eno == *Store__39_s->ecnt) { - *Store__39_s->ecnt += 1; - Files_WriteString(&*r, r__typ, (*Store__39_s->iden).mod, 32); - Files_WriteString(&*r, r__typ, (*Store__39_s->iden).proc, 32); + if (eno == *Store__44_s->ecnt) { + *Store__44_s->ecnt += 1; + Files_WriteString(&*r, r__typ, (*Store__44_s->iden).mod, 32); + Files_WriteString(&*r, r__typ, (*Store__44_s->iden).proc, 32); } - (*Store__39_s->msg).pos = pos; + (*Store__44_s->msg).pos = pos; org = Files_Pos(&*r, r__typ); - (*e->handle)(e, (void*)&*Store__39_s->msg, Texts_FileMsg__typ); + (*e->handle)(e, (void*)&*Store__44_s->msg, Texts_FileMsg__typ); span = Files_Pos(&*r, r__typ) - org; Files_WriteLInt(&r1, Files_Rider__typ, -span); Files_WriteLInt(&r1, Files_Rider__typ, e->W); @@ -1649,14 +1793,14 @@ void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) CHAR mods[64][32], procs[64][32]; Texts_FontsFont fnts[32]; CHAR block[1024]; - struct Store__39 _s; + struct Store__44 _s; _s.ecnt = &ecnt; _s.msg = &msg; _s.iden = &iden; _s.mods = (void*)mods; _s.procs = (void*)procs; - _s.lnk = Store__39_s; - Store__39_s = &_s; + _s.lnk = Store__44_s; + Store__44_s = &_s; org = Files_Pos(&*r, r__typ); msg.id = 1; msg.r = *r; @@ -1698,7 +1842,7 @@ void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) pos += rlen; u = un; } else if (iden.mod[0] != 0x00) { - StoreElem__40(&msg.r, Files_Rider__typ, pos, __GUARDP(u, Texts_ElemDesc, 1)); + StoreElem__45(&msg.r, Files_Rider__typ, pos, __GUARDP(u, Texts_ElemDesc, 1)); pos += 1; u = u->next; } else { @@ -1752,7 +1896,7 @@ void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) if (T->notify != NIL) { (*T->notify)(T, 3, 0, 0); } - Store__39_s = _s.lnk; + Store__44_s = _s.lnk; } void Texts_Close (Texts_Text T, CHAR *name, ADDRESS name__len) @@ -1809,6 +1953,7 @@ export void *Texts__init(void) __DEFMOD; __MODULE_IMPORT(Files); __MODULE_IMPORT(Modules); + __MODULE_IMPORT(Out); __MODULE_IMPORT(Reals); __REGMOD("Texts", EnumPtrs); __INITYP(Texts_FontDesc, Texts_FontDesc, 0); diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index c4766a47..55558804 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h @@ -135,6 +135,7 @@ import void Texts_Close (Texts_Text T, CHAR *name, ADDRESS name__len); import void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); import void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); import void Texts_Delete (Texts_Text T, INT32 beg, INT32 end); +import void Texts_DumpReader (Texts_Reader re); import Texts_Text Texts_ElemBase (Texts_Elem E); import INT32 Texts_ElemPos (Texts_Elem E); import void Texts_Insert (Texts_Text T, INT32 pos, Texts_Buffer B); diff --git a/bootstrap/windows-88/VT100.c b/bootstrap/windows-88/VT100.c index 8d349c3e..669a337a 100644 --- a/bootstrap/windows-88/VT100.c +++ b/bootstrap/windows-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/VT100.h b/bootstrap/windows-88/VT100.h index 494b7318..809a6082 100644 --- a/bootstrap/windows-88/VT100.h +++ b/bootstrap/windows-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index f9e7e802..b9ca8d5a 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index ee0ea191..6a31ee74 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/09]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h From a1ac23a09fbc4b6480e8ff081863df60f171c54f Mon Sep 17 00:00:00 2001 From: David Brown Date: Sun, 11 Dec 2016 14:10:46 +0000 Subject: [PATCH 410/580] More debug to catch OpenBSD intermittent text read failure. --- src/runtime/Files.Mod | 57 ++++++++++++++++++++++++++++++++++++------- src/runtime/Texts.Mod | 10 ++------ 2 files changed, 50 insertions(+), 17 deletions(-) diff --git a/src/runtime/Files.Mod b/src/runtime/Files.Mod index 7bbecbf7..9caa22a9 100644 --- a/src/runtime/Files.Mod +++ b/src/runtime/Files.Mod @@ -55,7 +55,7 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files END; Rider* = RECORD - res*: LONGINT; + res*: LONGINT; (* Residue (byte count not read) at eof of ReadBytes *) eof*: BOOLEAN; buf: Buffer; org: LONGINT; (* File offset of block containing current position *) @@ -70,10 +70,45 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files SearchPath: POINTER TO ARRAY OF CHAR; +(* Debugging intermittent OpenBSD failure. *) + + PROCEDURE Spaces(i: INTEGER); BEGIN WHILE i>0 DO Out.String(" "); DEC(i) END END Spaces; + + PROCEDURE DumpFile*(f: File; indent: INTEGER); + BEGIN + Spaces(indent); Out.String("workName: "); Out.String(f.workName); Out.Ln; + Spaces(indent); Out.String("registerName: "); Out.String(f.registerName); Out.Ln; + Spaces(indent); Out.String("tempFile: "); IF f.tempFile THEN Out.String("TRUE") ELSE Out.String("FALSE") END; Out.Ln; + Spaces(indent); Out.String("identity: "); Out.String("..."); Out.Ln; (* TBD *) + Spaces(indent); Out.String("fd: "); Out.Int(f.fd,1); Out.Ln; + Spaces(indent); Out.String("len, "); Out.Int(f.len,1); Out.Ln; + Spaces(indent); Out.String("pos: "); Out.Int(f.pos,1); Out.Ln; + Spaces(indent); Out.String("bufs: "); Out.String("..."); Out.Ln; (* TBD *) + Spaces(indent); Out.String("swapper: "); Out.Int(f.swapper,1); Out.Ln; + Spaces(indent); Out.String("state: "); Out.Int(f.state,1); Out.Ln; + Spaces(indent); Out.String("next: "); Out.Int(SYSTEM.VAL(SYSTEM.ADDRESS,f.next),1); Out.Ln; + END DumpFile; + + PROCEDURE DumpBuffer*(b: Buffer; indent: INTEGER); + BEGIN + Spaces(indent); Out.String("chg: "); IF b.chg THEN Out.String("TRUE") ELSE Out.String("FALSE") END; Out.Ln; + Spaces(indent); Out.String("org: "); Out.Int(b.org,1); Out.Ln; + Spaces(indent); Out.String("size: "); Out.Int(b.size,1); Out.Ln; + Spaces(indent); Out.String("data: "); Out.String("..."); Out.Ln; + Spaces(indent); Out.String("f: "); IF b.f = NIL THEN Out.String(""); Out.Ln ELSE Out.Ln; DumpFile(b.f, indent+1) END; + END DumpBuffer; + + PROCEDURE DumpRider*(r: Rider; indent: INTEGER); + BEGIN + Spaces(indent); Out.String("res: "); Out.Int(r.res,1); Out.Ln; + Spaces(indent); Out.String("eof: "); IF r.eof THEN Out.String("TRUE") ELSE Out.String("FALSE") END; Out.Ln; + Spaces(indent); Out.String("org: "); Out.Int(r.org,1); Out.Ln; + Spaces(indent); Out.String("offset: "); Out.Int(r.offset,1); Out.Ln; + Spaces(indent); Out.String("buf: "); IF r.buf = NIL THEN Out.String(""); Out.Ln ELSE Out.Ln; DumpBuffer(r.buf, indent+1) END; + END DumpRider; PROCEDURE -IdxTrap "__HALT(-1)"; - PROCEDURE -ToAdr(x: SYSTEM.INT64): SYSTEM.ADDRESS "(ADDRESS)x"; PROCEDURE^ Finalize(o: SYSTEM.PTR); @@ -405,7 +440,8 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files offset := pos MOD BufSize; org := pos - offset; i := 0; WHILE (i < NumBufs) & (f.bufs[i] # NIL) & (org # f.bufs[i].org) DO INC(i) END; IF i < NumBufs THEN - IF f.bufs[i] = NIL THEN NEW(buf); buf.chg := FALSE; buf.org := -1; buf.f := f; f.bufs[i] := buf + IF f.bufs[i] = NIL THEN + NEW(buf); buf.chg := FALSE; buf.org := -1; buf.f := f; f.bufs[i] := buf ELSE buf := f.bufs[i] END ELSE @@ -434,7 +470,9 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files VAR offset: LONGINT; buf: Buffer; BEGIN buf := r.buf; offset := r.offset; - IF r.org # buf.org THEN Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset END; + IF r.org # buf.org THEN + Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset + END; Assert(offset <= buf.size); IF (offset < buf.size) THEN x := buf.data[offset]; r.offset := offset + 1 @@ -450,16 +488,17 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files VAR xpos, min, restInBuf, offset: LONGINT; buf: Buffer; BEGIN IF n > LEN(x) THEN IdxTrap END; - xpos := 0; buf := r.buf; offset := r.offset; + xpos := 0; + buf := r.buf; + offset := r.offset; (* Offset within buffer r.buf *) WHILE n > 0 DO IF (r.org # buf.org) OR (offset >= BufSize) THEN - Set(r, buf.f, r.org + offset); - buf := r.buf; offset := r.offset + Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset END; restInBuf := buf.size - offset; IF restInBuf = 0 THEN r.res := n; r.eof := TRUE; RETURN ELSIF n > restInBuf THEN min := restInBuf ELSE min := n END; - SYSTEM.MOVE(SYSTEM.ADR(buf.data) + ToAdr(offset), SYSTEM.ADR(x) + ToAdr(xpos), min); + SYSTEM.MOVE(SYSTEM.ADR(buf.data[offset]), SYSTEM.ADR(x[xpos]), min); INC(offset, min); r.offset := offset; INC(xpos, min); DEC(n, min); Assert(offset <= BufSize) END; @@ -502,7 +541,7 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files Assert(offset <= BufSize); restInBuf := BufSize - offset; IF n > restInBuf THEN min := restInBuf ELSE min := n END; - SYSTEM.MOVE(SYSTEM.ADR(x) + ToAdr(xpos), SYSTEM.ADR(buf.data) + ToAdr(offset), min); + SYSTEM.MOVE(SYSTEM.ADR(x[xpos]), SYSTEM.ADR(buf.data[offset]), min); INC(offset, min); r.offset := offset; Assert(offset <= BufSize); IF offset > buf.size THEN INC(buf.f.len, offset - buf.size); buf.size := offset END; diff --git a/src/runtime/Texts.Mod b/src/runtime/Texts.Mod index f0658657..760f805c 100644 --- a/src/runtime/Texts.Mod +++ b/src/runtime/Texts.Mod @@ -120,7 +120,7 @@ MODULE Texts; (** CAS/HM 23.9.93 -- interface based on Texts by JG/NW 6.12.91** del: Buffer; FontsDefault: FontsFont; -(* Debugging OpenBSD failure *) +(* Debugging intermittent OpenBSD failure. *) PROCEDURE DumpText(t: Text); BEGIN @@ -139,12 +139,6 @@ MODULE Texts; (** CAS/HM 23.9.93 -- interface based on Texts by JG/NW 6.12.91** Out.String(" base: "); IF e.base = NIL THEN Out.String(""); Out.Ln ELSE Out.Ln; DumpText(e.base) END; END DumpElem; - PROCEDURE DumpRider(ri: Files.Rider); - BEGIN - Out.String(" res: "); Out.Int(ri.res,1); Out.Ln; - Out.String(" eof: "); IF ri.eof THEN Out.String("TRUE") ELSE Out.String("FALSE") END; Out.Ln; - END DumpRider; - PROCEDURE DumpRun(ru: Run); BEGIN Out.String(" prev: "); Out.Int(SYSTEM.VAL(SYSTEM.ADDRESS, ru.prev),1); Out.Ln; @@ -166,7 +160,7 @@ MODULE Texts; (** CAS/HM 23.9.93 -- interface based on Texts by JG/NW 6.12.91** Out.String(" org: "); Out.Int(re.org,1); Out.Ln; Out.String(" off: "); Out.Int(re.off,1); Out.Ln; Out.String(" elem: "); IF re.elem = NIL THEN Out.String(""); Out.Ln ELSE Out.Ln; DumpElem(re.elem) END; - Out.String(" rider: "); Out.Ln; DumpRider(re.rider); + Out.String(" rider: "); Out.Ln; Files.DumpRider(re.rider,2); Out.String(" run: "); IF re.run = NIL THEN Out.String(""); Out.Ln ELSE Out.Ln; DumpRun(re.run) END; END DumpReader; From 7d0cc741aec83765ea25bbc31466868328870220 Mon Sep 17 00:00:00 2001 From: David Brown Date: Sun, 11 Dec 2016 14:11:33 +0000 Subject: [PATCH 411/580] Update bootstrap C source --- bootstrap/unix-44/Compiler.c | 2 +- bootstrap/unix-44/Configuration.c | 4 +- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Files.c | 137 +++++++++++++++- bootstrap/unix-44/Files.h | 15 +- bootstrap/unix-44/Heap.c | 2 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 2 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 2 +- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 2 +- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 2 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Out.c | 2 +- bootstrap/unix-44/Out.h | 2 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 229 +++++++++++++-------------- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/VT100.c | 2 +- bootstrap/unix-44/VT100.h | 2 +- bootstrap/unix-44/extTools.c | 2 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-48/Compiler.c | 2 +- bootstrap/unix-48/Configuration.c | 4 +- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Files.c | 137 +++++++++++++++- bootstrap/unix-48/Files.h | 15 +- bootstrap/unix-48/Heap.c | 2 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 2 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 2 +- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 2 +- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 2 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Out.c | 2 +- bootstrap/unix-48/Out.h | 2 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 229 +++++++++++++-------------- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/VT100.c | 2 +- bootstrap/unix-48/VT100.h | 2 +- bootstrap/unix-48/extTools.c | 2 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-88/Compiler.c | 2 +- bootstrap/unix-88/Configuration.c | 4 +- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Files.c | 137 +++++++++++++++- bootstrap/unix-88/Files.h | 15 +- bootstrap/unix-88/Heap.c | 2 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 2 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 2 +- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 2 +- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 2 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Out.c | 2 +- bootstrap/unix-88/Out.h | 2 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 229 +++++++++++++-------------- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/VT100.c | 2 +- bootstrap/unix-88/VT100.h | 2 +- bootstrap/unix-88/extTools.c | 2 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/windows-48/Compiler.c | 2 +- bootstrap/windows-48/Configuration.c | 4 +- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Files.c | 137 +++++++++++++++- bootstrap/windows-48/Files.h | 15 +- bootstrap/windows-48/Heap.c | 2 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 2 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 2 +- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 2 +- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 2 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Out.c | 2 +- bootstrap/windows-48/Out.h | 2 +- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 229 +++++++++++++-------------- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/VT100.c | 2 +- bootstrap/windows-48/VT100.h | 2 +- bootstrap/windows-48/extTools.c | 2 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-88/Compiler.c | 2 +- bootstrap/windows-88/Configuration.c | 4 +- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Files.c | 137 +++++++++++++++- bootstrap/windows-88/Files.h | 15 +- bootstrap/windows-88/Heap.c | 2 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 2 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 2 +- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 2 +- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 2 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Out.c | 2 +- bootstrap/windows-88/Out.h | 2 +- bootstrap/windows-88/Platform.c | 2 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 229 +++++++++++++-------------- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/VT100.c | 2 +- bootstrap/windows-88/VT100.h | 2 +- bootstrap/windows-88/extTools.c | 2 +- bootstrap/windows-88/extTools.h | 2 +- 185 files changed, 1445 insertions(+), 810 deletions(-) diff --git a/bootstrap/unix-44/Compiler.c b/bootstrap/unix-44/Compiler.c index 3b84a5bd..ffd8b03e 100644 --- a/bootstrap/unix-44/Compiler.c +++ b/bootstrap/unix-44/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index 319659fe..6db13d09 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index d438eca9..4259cfef 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index c300b039..c9994206 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -69,6 +69,9 @@ static void Files_CloseOSFile (Files_File f); static void Files_Create (Files_File f); export void Files_Delete (CHAR *name, ADDRESS name__len, INT16 *res); static void Files_Deregister (CHAR *name, ADDRESS name__len); +export void Files_DumpBuffer (Files_Buffer b, INT16 indent); +export void Files_DumpFile (Files_File f, INT16 indent); +export void Files_DumpRider (Files_Rider r, INT16 indent); static void Files_Err (CHAR *s, ADDRESS s__len, Files_File f, INT16 errcode); static void Files_Finalize (SYSTEM_PTR o); static void Files_FlipBytes (SYSTEM_BYTE *src, ADDRESS src__len, SYSTEM_BYTE *dest, ADDRESS dest__len); @@ -99,6 +102,7 @@ export void Files_Rename (CHAR *old, ADDRESS old__len, CHAR *new, ADDRESS new__l static void Files_ScanPath (INT16 *pos, CHAR *dir, ADDRESS dir__len); export void Files_Set (Files_Rider *r, ADDRESS *r__typ, Files_File f, INT32 pos); export void Files_SetSearchPath (CHAR *path, ADDRESS path__len); +static void Files_Spaces (INT16 i); export void Files_Write (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE x); export void Files_WriteBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN x); export void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS x__len, INT32 n); @@ -111,7 +115,132 @@ export void Files_WriteSet (Files_Rider *R, ADDRESS *R__typ, UINT32 x); export void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, ADDRESS x__len); #define Files_IdxTrap() __HALT(-1) -#define Files_ToAdr(x) (ADDRESS)x + +static void Files_Spaces (INT16 i) +{ + while (i > 0) { + Out_String((CHAR*)" ", 3); + i -= 1; + } +} + +void Files_DumpFile (Files_File f, INT16 indent) +{ + Files_Spaces(indent); + Out_String((CHAR*)"workName: ", 15); + Out_String(f->workName, 101); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"registerName: ", 15); + Out_String(f->registerName, 101); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"tempFile: ", 15); + if (f->tempFile) { + Out_String((CHAR*)"TRUE", 5); + } else { + Out_String((CHAR*)"FALSE", 6); + } + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"identity: ", 15); + Out_String((CHAR*)"...", 4); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"fd: ", 15); + Out_Int(f->fd, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"len, ", 15); + Out_Int(f->len, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"pos: ", 15); + Out_Int(f->pos, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"bufs: ", 15); + Out_String((CHAR*)"...", 4); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"swapper: ", 15); + Out_Int(f->swapper, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"state: ", 15); + Out_Int(f->state, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"next: ", 15); + Out_Int((INT32)(ADDRESS)f->next, 1); + Out_Ln(); +} + +void Files_DumpBuffer (Files_Buffer b, INT16 indent) +{ + Files_Spaces(indent); + Out_String((CHAR*)"chg: ", 7); + if (b->chg) { + Out_String((CHAR*)"TRUE", 5); + } else { + Out_String((CHAR*)"FALSE", 6); + } + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"org: ", 7); + Out_Int(b->org, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"size: ", 7); + Out_Int(b->size, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"data: ", 7); + Out_String((CHAR*)"...", 4); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"f: ", 7); + if (b->f == NIL) { + Out_String((CHAR*)"", 6); + Out_Ln(); + } else { + Out_Ln(); + Files_DumpFile(b->f, indent + 1); + } +} + +void Files_DumpRider (Files_Rider r, INT16 indent) +{ + Files_Spaces(indent); + Out_String((CHAR*)"res: ", 9); + Out_Int(r.res, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"eof: ", 9); + if (r.eof) { + Out_String((CHAR*)"TRUE", 5); + } else { + Out_String((CHAR*)"FALSE", 6); + } + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"org: ", 9); + Out_Int(r.org, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"offset: ", 9); + Out_Int(r.offset, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"buf: ", 9); + if (r.buf == NIL) { + Out_String((CHAR*)"", 6); + Out_Ln(); + } else { + Out_Ln(); + Files_DumpBuffer(r.buf, indent + 1); + } +} static void Files_Assert (BOOLEAN truth) { @@ -661,7 +790,7 @@ void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS x } else { min = n; } - __MOVE((ADDRESS)buf->data + Files_ToAdr(offset), (ADDRESS)x + Files_ToAdr(xpos), min); + __MOVE((ADDRESS)&buf->data[offset], (ADDRESS)&x[xpos], min); offset += min; (*r).offset = offset; xpos += min; @@ -724,7 +853,7 @@ void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS } else { min = n; } - __MOVE((ADDRESS)x + Files_ToAdr(xpos), (ADDRESS)buf->data + Files_ToAdr(offset), min); + __MOVE((ADDRESS)&x[xpos], (ADDRESS)&buf->data[offset], min); offset += min; (*r).offset = offset; Files_Assert(offset <= 4096); diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index 258422d6..c548dae1 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,10 +1,19 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h #include "SYSTEM.h" +typedef + struct Files_BufDesc { + INT32 _prvt0; + char _prvt1[4108]; + } Files_BufDesc; + +typedef + Files_BufDesc *Files_Buffer; + typedef struct Files_FileDesc *Files_File; @@ -24,12 +33,16 @@ typedef import ADDRESS *Files_FileDesc__typ; +import ADDRESS *Files_BufDesc__typ; import ADDRESS *Files_Rider__typ; import Files_File Files_Base (Files_Rider *r, ADDRESS *r__typ); import void Files_ChangeDirectory (CHAR *path, ADDRESS path__len, INT16 *res); import void Files_Close (Files_File f); import void Files_Delete (CHAR *name, ADDRESS name__len, INT16 *res); +import void Files_DumpBuffer (Files_Buffer b, INT16 indent); +import void Files_DumpFile (Files_File f, INT16 indent); +import void Files_DumpRider (Files_Rider r, INT16 indent); import void Files_GetDate (Files_File f, INT32 *t, INT32 *d); import void Files_GetName (Files_File f, CHAR *name, ADDRESS name__len); import INT32 Files_Length (Files_File f); diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index a3bcc604..125a2854 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index b5a1e4c3..e794a4a3 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index d2183857..b27930e7 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index 4cecc8b9..553f80ed 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index a7d429eb..d83386eb 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index a49077b0..feb85d73 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 89ef22dc..ab01642c 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index b30a2315..f742f265 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 0c8ab9b3..a6c7a5cd 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index d1c71f13..621dfb51 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index dfca5a85..383b6d65 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index c82b4d80..c1fe21fb 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index a3b32b0c..4569c80d 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index 99c62664..c0707c34 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index 59059803..9bc66090 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index 1aec7cad..6b2b0929 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index 1e66dbde..42081077 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index 9ad5508d..d363f022 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Out.c b/bootstrap/unix-44/Out.c index fd578128..a647f77d 100644 --- a/bootstrap/unix-44/Out.c +++ b/bootstrap/unix-44/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Out.h b/bootstrap/unix-44/Out.h index a3f5db4d..8c7a5774 100644 --- a/bootstrap/unix-44/Out.h +++ b/bootstrap/unix-44/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index da9669d9..22eb3138 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index d68c4ae0..cd9d9890 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 8ba81525..f5ee1490 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index 0fe868e0..6d0ec38b 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index a6a802c4..4ee2fc23 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index bec035c4..ae281477 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index 0696f4d7..35e17988 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -194,7 +194,6 @@ export void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); export void Texts_Delete (Texts_Text T, INT32 beg, INT32 end); static void Texts_DumpElem (Texts_Elem e); export void Texts_DumpReader (Texts_Reader re); -static void Texts_DumpRider (Files_Rider ri); static void Texts_DumpRun (Texts_Run ru); static void Texts_DumpText (Texts_Text t); export Texts_Text Texts_ElemBase (Texts_Elem E); @@ -278,20 +277,6 @@ static void Texts_DumpElem (Texts_Elem e) } } -static void Texts_DumpRider (Files_Rider ri) -{ - Out_String((CHAR*)" res: ", 10); - Out_Int(ri.res, 1); - Out_Ln(); - Out_String((CHAR*)" eof: ", 10); - if (ri.eof) { - Out_String((CHAR*)"TRUE", 5); - } else { - Out_String((CHAR*)"FALSE", 6); - } - Out_Ln(); -} - static void Texts_DumpRun (Texts_Run ru) { Out_String((CHAR*)" prev: ", 12); @@ -365,7 +350,7 @@ void Texts_DumpReader (Texts_Reader re) } Out_String((CHAR*)" rider: ", 10); Out_Ln(); - Texts_DumpRider(re.rider); + Files_DumpRider(re.rider, 2); Out_String((CHAR*)" run: ", 10); if (re.run == NIL) { Out_String((CHAR*)"", 6); @@ -860,32 +845,32 @@ void Texts_OpenScanner (Texts_Scanner *S, ADDRESS *S__typ, Texts_Text T, INT32 p (*S).nextCh = ' '; } -static struct Scan__36 { +static struct Scan__35 { Texts_Scanner *S; ADDRESS *S__typ; CHAR *ch; BOOLEAN *negE; INT16 *e; - struct Scan__36 *lnk; -} *Scan__36_s; + struct Scan__35 *lnk; +} *Scan__35_s; -static void ReadScaleFactor__37 (void); +static void ReadScaleFactor__36 (void); -static void ReadScaleFactor__37 (void) +static void ReadScaleFactor__36 (void) { - Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); - if (*Scan__36_s->ch == '-') { - *Scan__36_s->negE = 1; - Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); + Texts_Read((void*)&*Scan__35_s->S, Scan__35_s->S__typ, &*Scan__35_s->ch); + if (*Scan__35_s->ch == '-') { + *Scan__35_s->negE = 1; + Texts_Read((void*)&*Scan__35_s->S, Scan__35_s->S__typ, &*Scan__35_s->ch); } else { - *Scan__36_s->negE = 0; - if (*Scan__36_s->ch == '+') { - Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); + *Scan__35_s->negE = 0; + if (*Scan__35_s->ch == '+') { + Texts_Read((void*)&*Scan__35_s->S, Scan__35_s->S__typ, &*Scan__35_s->ch); } } - while (('0' <= *Scan__36_s->ch && *Scan__36_s->ch <= '9')) { - *Scan__36_s->e = (*Scan__36_s->e * 10 + (INT16)*Scan__36_s->ch) - 48; - Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); + while (('0' <= *Scan__35_s->ch && *Scan__35_s->ch <= '9')) { + *Scan__35_s->e = (*Scan__35_s->e * 10 + (INT16)*Scan__35_s->ch) - 48; + Texts_Read((void*)&*Scan__35_s->S, Scan__35_s->S__typ, &*Scan__35_s->ch); } } @@ -899,13 +884,13 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) REAL x, f; LONGREAL y, g; CHAR d[32]; - struct Scan__36 _s; + struct Scan__35 _s; _s.S = S; _s.S__typ = S__typ; _s.ch = &ch; _s.negE = &negE; _s.e = &e; - _s.lnk = Scan__36_s; - Scan__36_s = &_s; + _s.lnk = Scan__35_s; + Scan__35_s = &_s; ch = (*S).nextCh; i = 0; for (;;) { @@ -1006,7 +991,7 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) y = ((INT16)d[__X(j, 32)] - 48) * g + y; j += 1; } - ReadScaleFactor__37(); + ReadScaleFactor__36(); if (negE) { if (e <= 308) { y = y / (LONGREAL)Reals_TenL(e); @@ -1039,7 +1024,7 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) j += 1; } if (ch == 'E') { - ReadScaleFactor__37(); + ReadScaleFactor__36(); } if (negE) { if (e <= 38) { @@ -1092,7 +1077,7 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) } } (*S).nextCh = ch; - Scan__36_s = _s.lnk; + Scan__35_s = _s.lnk; } void Texts_OpenWriter (Texts_Writer *W, ADDRESS *W__typ) @@ -1311,30 +1296,30 @@ void Texts_WriteReal (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n) } } -static struct WriteRealFix__58 { +static struct WriteRealFix__57 { Texts_Writer *W; ADDRESS *W__typ; INT16 *i; CHAR (*d)[9]; - struct WriteRealFix__58 *lnk; -} *WriteRealFix__58_s; + struct WriteRealFix__57 *lnk; +} *WriteRealFix__57_s; -static void dig__59 (INT16 n); -static void seq__61 (CHAR ch, INT16 n); +static void dig__58 (INT16 n); +static void seq__60 (CHAR ch, INT16 n); -static void seq__61 (CHAR ch, INT16 n) +static void seq__60 (CHAR ch, INT16 n) { while (n > 0) { - Texts_Write(&*WriteRealFix__58_s->W, WriteRealFix__58_s->W__typ, ch); + Texts_Write(&*WriteRealFix__57_s->W, WriteRealFix__57_s->W__typ, ch); n -= 1; } } -static void dig__59 (INT16 n) +static void dig__58 (INT16 n) { while (n > 0) { - *WriteRealFix__58_s->i -= 1; - Texts_Write(&*WriteRealFix__58_s->W, WriteRealFix__58_s->W__typ, (*WriteRealFix__58_s->d)[__X(*WriteRealFix__58_s->i, 9)]); + *WriteRealFix__57_s->i -= 1; + Texts_Write(&*WriteRealFix__57_s->W, WriteRealFix__57_s->W__typ, (*WriteRealFix__57_s->d)[__X(*WriteRealFix__57_s->i, 9)]); n -= 1; } } @@ -1345,23 +1330,23 @@ void Texts_WriteRealFix (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n, INT1 CHAR sign; REAL x0; CHAR d[9]; - struct WriteRealFix__58 _s; + struct WriteRealFix__57 _s; _s.W = W; _s.W__typ = W__typ; _s.i = &i; _s.d = (void*)d; - _s.lnk = WriteRealFix__58_s; - WriteRealFix__58_s = &_s; + _s.lnk = WriteRealFix__57_s; + WriteRealFix__57_s = &_s; e = Reals_Expo(x); if (k < 0) { k = 0; } if (e == 0) { - seq__61(' ', (n - k) - 2); + seq__60(' ', (n - k) - 2); Texts_Write(&*W, W__typ, '0'); - seq__61(' ', k + 1); + seq__60(' ', k + 1); } else if (e == 255) { Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", 5); - seq__61(' ', n - 4); + seq__60(' ', n - 4); } else { e = __ASHR((e - 127) * 77, 8); if (x < (REAL)0) { @@ -1394,21 +1379,21 @@ void Texts_WriteRealFix (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n, INT1 i = k + e; Reals_Convert(x, i, (void*)d, 9); if (e > 0) { - seq__61(' ', ((n - e) - k) - 2); + seq__60(' ', ((n - e) - k) - 2); Texts_Write(&*W, W__typ, sign); - dig__59(e); + dig__58(e); Texts_Write(&*W, W__typ, '.'); - dig__59(k); + dig__58(k); } else { - seq__61(' ', (n - k) - 3); + seq__60(' ', (n - k) - 3); Texts_Write(&*W, W__typ, sign); Texts_Write(&*W, W__typ, '0'); Texts_Write(&*W, W__typ, '.'); - seq__61('0', -e); - dig__59(k + e); + seq__60('0', -e); + dig__58(k + e); } } - WriteRealFix__58_s = _s.lnk; + WriteRealFix__57_s = _s.lnk; } void Texts_WriteRealHex (Texts_Writer *W, ADDRESS *W__typ, REAL x) @@ -1507,48 +1492,48 @@ void Texts_WriteLongRealHex (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x) } while (!(i == 16)); } -static struct WriteDate__48 { +static struct WriteDate__47 { Texts_Writer *W; ADDRESS *W__typ; - struct WriteDate__48 *lnk; -} *WriteDate__48_s; + struct WriteDate__47 *lnk; +} *WriteDate__47_s; -static void WritePair__49 (CHAR ch, INT32 x); +static void WritePair__48 (CHAR ch, INT32 x); -static void WritePair__49 (CHAR ch, INT32 x) +static void WritePair__48 (CHAR ch, INT32 x) { - Texts_Write(&*WriteDate__48_s->W, WriteDate__48_s->W__typ, ch); - Texts_Write(&*WriteDate__48_s->W, WriteDate__48_s->W__typ, (CHAR)(__DIV(x, 10) + 48)); - Texts_Write(&*WriteDate__48_s->W, WriteDate__48_s->W__typ, (CHAR)((int)__MOD(x, 10) + 48)); + Texts_Write(&*WriteDate__47_s->W, WriteDate__47_s->W__typ, ch); + Texts_Write(&*WriteDate__47_s->W, WriteDate__47_s->W__typ, (CHAR)(__DIV(x, 10) + 48)); + Texts_Write(&*WriteDate__47_s->W, WriteDate__47_s->W__typ, (CHAR)((int)__MOD(x, 10) + 48)); } void Texts_WriteDate (Texts_Writer *W, ADDRESS *W__typ, INT32 t, INT32 d) { - struct WriteDate__48 _s; + struct WriteDate__47 _s; _s.W = W; _s.W__typ = W__typ; - _s.lnk = WriteDate__48_s; - WriteDate__48_s = &_s; - WritePair__49(' ', __MASK(d, -32)); - WritePair__49('.', __MASK(__ASHR(d, 5), -16)); - WritePair__49('.', __MASK(__ASHR(d, 9), -128)); - WritePair__49(' ', __MASK(__ASHR(t, 12), -32)); - WritePair__49(':', __MASK(__ASHR(t, 6), -64)); - WritePair__49(':', __MASK(t, -64)); - WriteDate__48_s = _s.lnk; + _s.lnk = WriteDate__47_s; + WriteDate__47_s = &_s; + WritePair__48(' ', __MASK(d, -32)); + WritePair__48('.', __MASK(__ASHR(d, 5), -16)); + WritePair__48('.', __MASK(__ASHR(d, 9), -128)); + WritePair__48(' ', __MASK(__ASHR(t, 12), -32)); + WritePair__48(':', __MASK(__ASHR(t, 6), -64)); + WritePair__48(':', __MASK(t, -64)); + WriteDate__47_s = _s.lnk; } -static struct Load0__21 { +static struct Load0__20 { Texts_Text *T; INT8 *ecnt; Files_File *f; Texts_FileMsg *msg; CHAR (*mods)[64][32], (*procs)[64][32]; - struct Load0__21 *lnk; -} *Load0__21_s; + struct Load0__20 *lnk; +} *Load0__20_s; -static void LoadElem__22 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e); +static void LoadElem__21 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e); -static void LoadElem__22 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e) +static void LoadElem__21 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e) { Modules_Module M = NIL; Modules_Command Cmd; @@ -1559,15 +1544,15 @@ static void LoadElem__22 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span Files_ReadLInt(&*r, r__typ, &ew); Files_ReadLInt(&*r, r__typ, &eh); Files_Read(&*r, r__typ, (void*)&eno); - if (eno > *Load0__21_s->ecnt) { - *Load0__21_s->ecnt = eno; - Files_ReadString(&*r, r__typ, (void*)(*Load0__21_s->mods)[__X(eno, 64)], 32); - Files_ReadString(&*r, r__typ, (void*)(*Load0__21_s->procs)[__X(eno, 64)], 32); + if (eno > *Load0__20_s->ecnt) { + *Load0__20_s->ecnt = eno; + Files_ReadString(&*r, r__typ, (void*)(*Load0__20_s->mods)[__X(eno, 64)], 32); + Files_ReadString(&*r, r__typ, (void*)(*Load0__20_s->procs)[__X(eno, 64)], 32); } org = Files_Pos(&*r, r__typ); - M = Modules_ThisMod((*Load0__21_s->mods)[__X(eno, 64)], 32); + M = Modules_ThisMod((*Load0__20_s->mods)[__X(eno, 64)], 32); if (M != NIL) { - Cmd = Modules_ThisCommand(M, (*Load0__21_s->procs)[__X(eno, 64)], 32); + Cmd = Modules_ThisCommand(M, (*Load0__20_s->procs)[__X(eno, 64)], 32); if (Cmd != NIL) { (*Cmd)(); } @@ -1576,25 +1561,25 @@ static void LoadElem__22 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span if (*e != NIL) { (*e)->W = ew; (*e)->H = eh; - (*e)->base = *Load0__21_s->T; - (*Load0__21_s->msg).pos = pos; - (*(*e)->handle)(*e, (void*)&*Load0__21_s->msg, Texts_FileMsg__typ); + (*e)->base = *Load0__20_s->T; + (*Load0__20_s->msg).pos = pos; + (*(*e)->handle)(*e, (void*)&*Load0__20_s->msg, Texts_FileMsg__typ); if (Files_Pos(&*r, r__typ) != org + span) { *e = NIL; } } if (*e == NIL) { - Files_Set(&*r, r__typ, *Load0__21_s->f, org + span); + Files_Set(&*r, r__typ, *Load0__20_s->f, org + span); __NEW(a, Texts__1); a->W = ew; a->H = eh; a->handle = Texts_HandleAlien; - a->base = *Load0__21_s->T; - a->file = *Load0__21_s->f; + a->base = *Load0__20_s->T; + a->file = *Load0__20_s->f; a->org = org; a->span = span; - __COPY((*Load0__21_s->mods)[__X(eno, 64)], a->mod, 32); - __COPY((*Load0__21_s->procs)[__X(eno, 64)], a->proc, 32); + __COPY((*Load0__20_s->mods)[__X(eno, 64)], a->mod, 32); + __COPY((*Load0__20_s->procs)[__X(eno, 64)], a->proc, 32); *e = (Texts_Elem)a; } } @@ -1611,15 +1596,15 @@ static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) CHAR mods[64][32], procs[64][32]; CHAR name[32]; Texts_FontsFont fnts[32]; - struct Load0__21 _s; + struct Load0__20 _s; _s.T = &T; _s.ecnt = &ecnt; _s.f = &f; _s.msg = &msg; _s.mods = (void*)mods; _s.procs = (void*)procs; - _s.lnk = Load0__21_s; - Load0__21_s = &_s; + _s.lnk = Load0__20_s; + Load0__20_s = &_s; pos = Files_Pos(&*r, r__typ); f = Files_Base(&*r, r__typ); __NEW(u, Texts_RunDesc); @@ -1652,7 +1637,7 @@ static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) un = (Texts_Run)p; un->len = plen; } else { - LoadElem__22(&msg.r, Files_Rider__typ, pos - org, -plen, &e); + LoadElem__21(&msg.r, Files_Rider__typ, pos - org, -plen, &e); un = (Texts_Run)e; un->len = 1; } @@ -1670,7 +1655,7 @@ static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) T->corg = 0; Files_ReadLInt(&msg.r, Files_Rider__typ, &T->len); Files_Set(&*r, r__typ, f, Files_Pos(&msg.r, Files_Rider__typ) + T->len); - Load0__21_s = _s.lnk; + Load0__20_s = _s.lnk; } void Texts_Load (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) @@ -1739,25 +1724,25 @@ void Texts_Open (Texts_Text T, CHAR *name, ADDRESS name__len) __DEL(name); } -static struct Store__44 { +static struct Store__43 { INT8 *ecnt; Texts_FileMsg *msg; Texts_IdentifyMsg *iden; CHAR (*mods)[64][32], (*procs)[64][32]; - struct Store__44 *lnk; -} *Store__44_s; + struct Store__43 *lnk; +} *Store__43_s; -static void StoreElem__45 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e); +static void StoreElem__44 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e); -static void StoreElem__45 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e) +static void StoreElem__44 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e) { Files_Rider r1; INT32 org, span; INT8 eno; - __COPY((*Store__44_s->iden).mod, (*Store__44_s->mods)[__X(*Store__44_s->ecnt, 64)], 32); - __COPY((*Store__44_s->iden).proc, (*Store__44_s->procs)[__X(*Store__44_s->ecnt, 64)], 32); + __COPY((*Store__43_s->iden).mod, (*Store__43_s->mods)[__X(*Store__43_s->ecnt, 64)], 32); + __COPY((*Store__43_s->iden).proc, (*Store__43_s->procs)[__X(*Store__43_s->ecnt, 64)], 32); eno = 1; - while (__STRCMP((*Store__44_s->mods)[__X(eno, 64)], (*Store__44_s->iden).mod) != 0 || __STRCMP((*Store__44_s->procs)[__X(eno, 64)], (*Store__44_s->iden).proc) != 0) { + while (__STRCMP((*Store__43_s->mods)[__X(eno, 64)], (*Store__43_s->iden).mod) != 0 || __STRCMP((*Store__43_s->procs)[__X(eno, 64)], (*Store__43_s->iden).proc) != 0) { eno += 1; } Files_Set(&r1, Files_Rider__typ, Files_Base(&*r, r__typ), Files_Pos(&*r, r__typ)); @@ -1765,14 +1750,14 @@ static void StoreElem__45 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Ele Files_WriteLInt(&*r, r__typ, 0); Files_WriteLInt(&*r, r__typ, 0); Files_Write(&*r, r__typ, eno); - if (eno == *Store__44_s->ecnt) { - *Store__44_s->ecnt += 1; - Files_WriteString(&*r, r__typ, (*Store__44_s->iden).mod, 32); - Files_WriteString(&*r, r__typ, (*Store__44_s->iden).proc, 32); + if (eno == *Store__43_s->ecnt) { + *Store__43_s->ecnt += 1; + Files_WriteString(&*r, r__typ, (*Store__43_s->iden).mod, 32); + Files_WriteString(&*r, r__typ, (*Store__43_s->iden).proc, 32); } - (*Store__44_s->msg).pos = pos; + (*Store__43_s->msg).pos = pos; org = Files_Pos(&*r, r__typ); - (*e->handle)(e, (void*)&*Store__44_s->msg, Texts_FileMsg__typ); + (*e->handle)(e, (void*)&*Store__43_s->msg, Texts_FileMsg__typ); span = Files_Pos(&*r, r__typ) - org; Files_WriteLInt(&r1, Files_Rider__typ, -span); Files_WriteLInt(&r1, Files_Rider__typ, e->W); @@ -1793,14 +1778,14 @@ void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) CHAR mods[64][32], procs[64][32]; Texts_FontsFont fnts[32]; CHAR block[1024]; - struct Store__44 _s; + struct Store__43 _s; _s.ecnt = &ecnt; _s.msg = &msg; _s.iden = &iden; _s.mods = (void*)mods; _s.procs = (void*)procs; - _s.lnk = Store__44_s; - Store__44_s = &_s; + _s.lnk = Store__43_s; + Store__43_s = &_s; org = Files_Pos(&*r, r__typ); msg.id = 1; msg.r = *r; @@ -1842,7 +1827,7 @@ void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) pos += rlen; u = un; } else if (iden.mod[0] != 0x00) { - StoreElem__45(&msg.r, Files_Rider__typ, pos, __GUARDP(u, Texts_ElemDesc, 1)); + StoreElem__44(&msg.r, Files_Rider__typ, pos, __GUARDP(u, Texts_ElemDesc, 1)); pos += 1; u = u->next; } else { @@ -1896,7 +1881,7 @@ void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) if (T->notify != NIL) { (*T->notify)(T, 3, 0, 0); } - Store__44_s = _s.lnk; + Store__43_s = _s.lnk; } void Texts_Close (Texts_Text T, CHAR *name, ADDRESS name__len) diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index 9c320190..dfe60b54 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/VT100.c b/bootstrap/unix-44/VT100.c index 669a337a..9ab993c9 100644 --- a/bootstrap/unix-44/VT100.c +++ b/bootstrap/unix-44/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/VT100.h b/bootstrap/unix-44/VT100.h index 809a6082..3de3605c 100644 --- a/bootstrap/unix-44/VT100.h +++ b/bootstrap/unix-44/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index b9ca8d5a..213abf27 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index 6a31ee74..4278a34c 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/Compiler.c b/bootstrap/unix-48/Compiler.c index 3b84a5bd..ffd8b03e 100644 --- a/bootstrap/unix-48/Compiler.c +++ b/bootstrap/unix-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index 319659fe..6db13d09 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index d438eca9..4259cfef 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index c300b039..c9994206 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -69,6 +69,9 @@ static void Files_CloseOSFile (Files_File f); static void Files_Create (Files_File f); export void Files_Delete (CHAR *name, ADDRESS name__len, INT16 *res); static void Files_Deregister (CHAR *name, ADDRESS name__len); +export void Files_DumpBuffer (Files_Buffer b, INT16 indent); +export void Files_DumpFile (Files_File f, INT16 indent); +export void Files_DumpRider (Files_Rider r, INT16 indent); static void Files_Err (CHAR *s, ADDRESS s__len, Files_File f, INT16 errcode); static void Files_Finalize (SYSTEM_PTR o); static void Files_FlipBytes (SYSTEM_BYTE *src, ADDRESS src__len, SYSTEM_BYTE *dest, ADDRESS dest__len); @@ -99,6 +102,7 @@ export void Files_Rename (CHAR *old, ADDRESS old__len, CHAR *new, ADDRESS new__l static void Files_ScanPath (INT16 *pos, CHAR *dir, ADDRESS dir__len); export void Files_Set (Files_Rider *r, ADDRESS *r__typ, Files_File f, INT32 pos); export void Files_SetSearchPath (CHAR *path, ADDRESS path__len); +static void Files_Spaces (INT16 i); export void Files_Write (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE x); export void Files_WriteBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN x); export void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS x__len, INT32 n); @@ -111,7 +115,132 @@ export void Files_WriteSet (Files_Rider *R, ADDRESS *R__typ, UINT32 x); export void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, ADDRESS x__len); #define Files_IdxTrap() __HALT(-1) -#define Files_ToAdr(x) (ADDRESS)x + +static void Files_Spaces (INT16 i) +{ + while (i > 0) { + Out_String((CHAR*)" ", 3); + i -= 1; + } +} + +void Files_DumpFile (Files_File f, INT16 indent) +{ + Files_Spaces(indent); + Out_String((CHAR*)"workName: ", 15); + Out_String(f->workName, 101); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"registerName: ", 15); + Out_String(f->registerName, 101); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"tempFile: ", 15); + if (f->tempFile) { + Out_String((CHAR*)"TRUE", 5); + } else { + Out_String((CHAR*)"FALSE", 6); + } + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"identity: ", 15); + Out_String((CHAR*)"...", 4); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"fd: ", 15); + Out_Int(f->fd, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"len, ", 15); + Out_Int(f->len, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"pos: ", 15); + Out_Int(f->pos, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"bufs: ", 15); + Out_String((CHAR*)"...", 4); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"swapper: ", 15); + Out_Int(f->swapper, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"state: ", 15); + Out_Int(f->state, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"next: ", 15); + Out_Int((INT32)(ADDRESS)f->next, 1); + Out_Ln(); +} + +void Files_DumpBuffer (Files_Buffer b, INT16 indent) +{ + Files_Spaces(indent); + Out_String((CHAR*)"chg: ", 7); + if (b->chg) { + Out_String((CHAR*)"TRUE", 5); + } else { + Out_String((CHAR*)"FALSE", 6); + } + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"org: ", 7); + Out_Int(b->org, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"size: ", 7); + Out_Int(b->size, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"data: ", 7); + Out_String((CHAR*)"...", 4); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"f: ", 7); + if (b->f == NIL) { + Out_String((CHAR*)"", 6); + Out_Ln(); + } else { + Out_Ln(); + Files_DumpFile(b->f, indent + 1); + } +} + +void Files_DumpRider (Files_Rider r, INT16 indent) +{ + Files_Spaces(indent); + Out_String((CHAR*)"res: ", 9); + Out_Int(r.res, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"eof: ", 9); + if (r.eof) { + Out_String((CHAR*)"TRUE", 5); + } else { + Out_String((CHAR*)"FALSE", 6); + } + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"org: ", 9); + Out_Int(r.org, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"offset: ", 9); + Out_Int(r.offset, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"buf: ", 9); + if (r.buf == NIL) { + Out_String((CHAR*)"", 6); + Out_Ln(); + } else { + Out_Ln(); + Files_DumpBuffer(r.buf, indent + 1); + } +} static void Files_Assert (BOOLEAN truth) { @@ -661,7 +790,7 @@ void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS x } else { min = n; } - __MOVE((ADDRESS)buf->data + Files_ToAdr(offset), (ADDRESS)x + Files_ToAdr(xpos), min); + __MOVE((ADDRESS)&buf->data[offset], (ADDRESS)&x[xpos], min); offset += min; (*r).offset = offset; xpos += min; @@ -724,7 +853,7 @@ void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS } else { min = n; } - __MOVE((ADDRESS)x + Files_ToAdr(xpos), (ADDRESS)buf->data + Files_ToAdr(offset), min); + __MOVE((ADDRESS)&x[xpos], (ADDRESS)&buf->data[offset], min); offset += min; (*r).offset = offset; Files_Assert(offset <= 4096); diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index 258422d6..c548dae1 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,10 +1,19 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h #include "SYSTEM.h" +typedef + struct Files_BufDesc { + INT32 _prvt0; + char _prvt1[4108]; + } Files_BufDesc; + +typedef + Files_BufDesc *Files_Buffer; + typedef struct Files_FileDesc *Files_File; @@ -24,12 +33,16 @@ typedef import ADDRESS *Files_FileDesc__typ; +import ADDRESS *Files_BufDesc__typ; import ADDRESS *Files_Rider__typ; import Files_File Files_Base (Files_Rider *r, ADDRESS *r__typ); import void Files_ChangeDirectory (CHAR *path, ADDRESS path__len, INT16 *res); import void Files_Close (Files_File f); import void Files_Delete (CHAR *name, ADDRESS name__len, INT16 *res); +import void Files_DumpBuffer (Files_Buffer b, INT16 indent); +import void Files_DumpFile (Files_File f, INT16 indent); +import void Files_DumpRider (Files_Rider r, INT16 indent); import void Files_GetDate (Files_File f, INT32 *t, INT32 *d); import void Files_GetName (Files_File f, CHAR *name, ADDRESS name__len); import INT32 Files_Length (Files_File f); diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index a3bcc604..125a2854 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index b5a1e4c3..e794a4a3 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index d2183857..b27930e7 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index 4cecc8b9..553f80ed 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index a7d429eb..d83386eb 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index a49077b0..feb85d73 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 89ef22dc..ab01642c 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index b30a2315..f742f265 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 0c8ab9b3..a6c7a5cd 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index d1c71f13..621dfb51 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index dfca5a85..383b6d65 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index c82b4d80..c1fe21fb 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index a3b32b0c..4569c80d 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index 99c62664..c0707c34 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 6edc4b6a..0d32553a 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index 1aec7cad..6b2b0929 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index 1e66dbde..42081077 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index 9ad5508d..d363f022 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Out.c b/bootstrap/unix-48/Out.c index fd578128..a647f77d 100644 --- a/bootstrap/unix-48/Out.c +++ b/bootstrap/unix-48/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Out.h b/bootstrap/unix-48/Out.h index a3f5db4d..8c7a5774 100644 --- a/bootstrap/unix-48/Out.h +++ b/bootstrap/unix-48/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index da9669d9..22eb3138 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index d68c4ae0..cd9d9890 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 8ba81525..f5ee1490 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index 0fe868e0..6d0ec38b 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index a6a802c4..4ee2fc23 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index bec035c4..ae281477 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index d1a7f696..9016dbc8 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -194,7 +194,6 @@ export void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); export void Texts_Delete (Texts_Text T, INT32 beg, INT32 end); static void Texts_DumpElem (Texts_Elem e); export void Texts_DumpReader (Texts_Reader re); -static void Texts_DumpRider (Files_Rider ri); static void Texts_DumpRun (Texts_Run ru); static void Texts_DumpText (Texts_Text t); export Texts_Text Texts_ElemBase (Texts_Elem E); @@ -278,20 +277,6 @@ static void Texts_DumpElem (Texts_Elem e) } } -static void Texts_DumpRider (Files_Rider ri) -{ - Out_String((CHAR*)" res: ", 10); - Out_Int(ri.res, 1); - Out_Ln(); - Out_String((CHAR*)" eof: ", 10); - if (ri.eof) { - Out_String((CHAR*)"TRUE", 5); - } else { - Out_String((CHAR*)"FALSE", 6); - } - Out_Ln(); -} - static void Texts_DumpRun (Texts_Run ru) { Out_String((CHAR*)" prev: ", 12); @@ -365,7 +350,7 @@ void Texts_DumpReader (Texts_Reader re) } Out_String((CHAR*)" rider: ", 10); Out_Ln(); - Texts_DumpRider(re.rider); + Files_DumpRider(re.rider, 2); Out_String((CHAR*)" run: ", 10); if (re.run == NIL) { Out_String((CHAR*)"", 6); @@ -860,32 +845,32 @@ void Texts_OpenScanner (Texts_Scanner *S, ADDRESS *S__typ, Texts_Text T, INT32 p (*S).nextCh = ' '; } -static struct Scan__36 { +static struct Scan__35 { Texts_Scanner *S; ADDRESS *S__typ; CHAR *ch; BOOLEAN *negE; INT16 *e; - struct Scan__36 *lnk; -} *Scan__36_s; + struct Scan__35 *lnk; +} *Scan__35_s; -static void ReadScaleFactor__37 (void); +static void ReadScaleFactor__36 (void); -static void ReadScaleFactor__37 (void) +static void ReadScaleFactor__36 (void) { - Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); - if (*Scan__36_s->ch == '-') { - *Scan__36_s->negE = 1; - Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); + Texts_Read((void*)&*Scan__35_s->S, Scan__35_s->S__typ, &*Scan__35_s->ch); + if (*Scan__35_s->ch == '-') { + *Scan__35_s->negE = 1; + Texts_Read((void*)&*Scan__35_s->S, Scan__35_s->S__typ, &*Scan__35_s->ch); } else { - *Scan__36_s->negE = 0; - if (*Scan__36_s->ch == '+') { - Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); + *Scan__35_s->negE = 0; + if (*Scan__35_s->ch == '+') { + Texts_Read((void*)&*Scan__35_s->S, Scan__35_s->S__typ, &*Scan__35_s->ch); } } - while (('0' <= *Scan__36_s->ch && *Scan__36_s->ch <= '9')) { - *Scan__36_s->e = (*Scan__36_s->e * 10 + (INT16)*Scan__36_s->ch) - 48; - Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); + while (('0' <= *Scan__35_s->ch && *Scan__35_s->ch <= '9')) { + *Scan__35_s->e = (*Scan__35_s->e * 10 + (INT16)*Scan__35_s->ch) - 48; + Texts_Read((void*)&*Scan__35_s->S, Scan__35_s->S__typ, &*Scan__35_s->ch); } } @@ -899,13 +884,13 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) REAL x, f; LONGREAL y, g; CHAR d[32]; - struct Scan__36 _s; + struct Scan__35 _s; _s.S = S; _s.S__typ = S__typ; _s.ch = &ch; _s.negE = &negE; _s.e = &e; - _s.lnk = Scan__36_s; - Scan__36_s = &_s; + _s.lnk = Scan__35_s; + Scan__35_s = &_s; ch = (*S).nextCh; i = 0; for (;;) { @@ -1006,7 +991,7 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) y = ((INT16)d[__X(j, 32)] - 48) * g + y; j += 1; } - ReadScaleFactor__37(); + ReadScaleFactor__36(); if (negE) { if (e <= 308) { y = y / (LONGREAL)Reals_TenL(e); @@ -1039,7 +1024,7 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) j += 1; } if (ch == 'E') { - ReadScaleFactor__37(); + ReadScaleFactor__36(); } if (negE) { if (e <= 38) { @@ -1092,7 +1077,7 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) } } (*S).nextCh = ch; - Scan__36_s = _s.lnk; + Scan__35_s = _s.lnk; } void Texts_OpenWriter (Texts_Writer *W, ADDRESS *W__typ) @@ -1311,30 +1296,30 @@ void Texts_WriteReal (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n) } } -static struct WriteRealFix__58 { +static struct WriteRealFix__57 { Texts_Writer *W; ADDRESS *W__typ; INT16 *i; CHAR (*d)[9]; - struct WriteRealFix__58 *lnk; -} *WriteRealFix__58_s; + struct WriteRealFix__57 *lnk; +} *WriteRealFix__57_s; -static void dig__59 (INT16 n); -static void seq__61 (CHAR ch, INT16 n); +static void dig__58 (INT16 n); +static void seq__60 (CHAR ch, INT16 n); -static void seq__61 (CHAR ch, INT16 n) +static void seq__60 (CHAR ch, INT16 n) { while (n > 0) { - Texts_Write(&*WriteRealFix__58_s->W, WriteRealFix__58_s->W__typ, ch); + Texts_Write(&*WriteRealFix__57_s->W, WriteRealFix__57_s->W__typ, ch); n -= 1; } } -static void dig__59 (INT16 n) +static void dig__58 (INT16 n) { while (n > 0) { - *WriteRealFix__58_s->i -= 1; - Texts_Write(&*WriteRealFix__58_s->W, WriteRealFix__58_s->W__typ, (*WriteRealFix__58_s->d)[__X(*WriteRealFix__58_s->i, 9)]); + *WriteRealFix__57_s->i -= 1; + Texts_Write(&*WriteRealFix__57_s->W, WriteRealFix__57_s->W__typ, (*WriteRealFix__57_s->d)[__X(*WriteRealFix__57_s->i, 9)]); n -= 1; } } @@ -1345,23 +1330,23 @@ void Texts_WriteRealFix (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n, INT1 CHAR sign; REAL x0; CHAR d[9]; - struct WriteRealFix__58 _s; + struct WriteRealFix__57 _s; _s.W = W; _s.W__typ = W__typ; _s.i = &i; _s.d = (void*)d; - _s.lnk = WriteRealFix__58_s; - WriteRealFix__58_s = &_s; + _s.lnk = WriteRealFix__57_s; + WriteRealFix__57_s = &_s; e = Reals_Expo(x); if (k < 0) { k = 0; } if (e == 0) { - seq__61(' ', (n - k) - 2); + seq__60(' ', (n - k) - 2); Texts_Write(&*W, W__typ, '0'); - seq__61(' ', k + 1); + seq__60(' ', k + 1); } else if (e == 255) { Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", 5); - seq__61(' ', n - 4); + seq__60(' ', n - 4); } else { e = __ASHR((e - 127) * 77, 8); if (x < (REAL)0) { @@ -1394,21 +1379,21 @@ void Texts_WriteRealFix (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n, INT1 i = k + e; Reals_Convert(x, i, (void*)d, 9); if (e > 0) { - seq__61(' ', ((n - e) - k) - 2); + seq__60(' ', ((n - e) - k) - 2); Texts_Write(&*W, W__typ, sign); - dig__59(e); + dig__58(e); Texts_Write(&*W, W__typ, '.'); - dig__59(k); + dig__58(k); } else { - seq__61(' ', (n - k) - 3); + seq__60(' ', (n - k) - 3); Texts_Write(&*W, W__typ, sign); Texts_Write(&*W, W__typ, '0'); Texts_Write(&*W, W__typ, '.'); - seq__61('0', -e); - dig__59(k + e); + seq__60('0', -e); + dig__58(k + e); } } - WriteRealFix__58_s = _s.lnk; + WriteRealFix__57_s = _s.lnk; } void Texts_WriteRealHex (Texts_Writer *W, ADDRESS *W__typ, REAL x) @@ -1507,48 +1492,48 @@ void Texts_WriteLongRealHex (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x) } while (!(i == 16)); } -static struct WriteDate__48 { +static struct WriteDate__47 { Texts_Writer *W; ADDRESS *W__typ; - struct WriteDate__48 *lnk; -} *WriteDate__48_s; + struct WriteDate__47 *lnk; +} *WriteDate__47_s; -static void WritePair__49 (CHAR ch, INT32 x); +static void WritePair__48 (CHAR ch, INT32 x); -static void WritePair__49 (CHAR ch, INT32 x) +static void WritePair__48 (CHAR ch, INT32 x) { - Texts_Write(&*WriteDate__48_s->W, WriteDate__48_s->W__typ, ch); - Texts_Write(&*WriteDate__48_s->W, WriteDate__48_s->W__typ, (CHAR)(__DIV(x, 10) + 48)); - Texts_Write(&*WriteDate__48_s->W, WriteDate__48_s->W__typ, (CHAR)((int)__MOD(x, 10) + 48)); + Texts_Write(&*WriteDate__47_s->W, WriteDate__47_s->W__typ, ch); + Texts_Write(&*WriteDate__47_s->W, WriteDate__47_s->W__typ, (CHAR)(__DIV(x, 10) + 48)); + Texts_Write(&*WriteDate__47_s->W, WriteDate__47_s->W__typ, (CHAR)((int)__MOD(x, 10) + 48)); } void Texts_WriteDate (Texts_Writer *W, ADDRESS *W__typ, INT32 t, INT32 d) { - struct WriteDate__48 _s; + struct WriteDate__47 _s; _s.W = W; _s.W__typ = W__typ; - _s.lnk = WriteDate__48_s; - WriteDate__48_s = &_s; - WritePair__49(' ', __MASK(d, -32)); - WritePair__49('.', __MASK(__ASHR(d, 5), -16)); - WritePair__49('.', __MASK(__ASHR(d, 9), -128)); - WritePair__49(' ', __MASK(__ASHR(t, 12), -32)); - WritePair__49(':', __MASK(__ASHR(t, 6), -64)); - WritePair__49(':', __MASK(t, -64)); - WriteDate__48_s = _s.lnk; + _s.lnk = WriteDate__47_s; + WriteDate__47_s = &_s; + WritePair__48(' ', __MASK(d, -32)); + WritePair__48('.', __MASK(__ASHR(d, 5), -16)); + WritePair__48('.', __MASK(__ASHR(d, 9), -128)); + WritePair__48(' ', __MASK(__ASHR(t, 12), -32)); + WritePair__48(':', __MASK(__ASHR(t, 6), -64)); + WritePair__48(':', __MASK(t, -64)); + WriteDate__47_s = _s.lnk; } -static struct Load0__21 { +static struct Load0__20 { Texts_Text *T; INT8 *ecnt; Files_File *f; Texts_FileMsg *msg; CHAR (*mods)[64][32], (*procs)[64][32]; - struct Load0__21 *lnk; -} *Load0__21_s; + struct Load0__20 *lnk; +} *Load0__20_s; -static void LoadElem__22 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e); +static void LoadElem__21 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e); -static void LoadElem__22 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e) +static void LoadElem__21 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e) { Modules_Module M = NIL; Modules_Command Cmd; @@ -1559,15 +1544,15 @@ static void LoadElem__22 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span Files_ReadLInt(&*r, r__typ, &ew); Files_ReadLInt(&*r, r__typ, &eh); Files_Read(&*r, r__typ, (void*)&eno); - if (eno > *Load0__21_s->ecnt) { - *Load0__21_s->ecnt = eno; - Files_ReadString(&*r, r__typ, (void*)(*Load0__21_s->mods)[__X(eno, 64)], 32); - Files_ReadString(&*r, r__typ, (void*)(*Load0__21_s->procs)[__X(eno, 64)], 32); + if (eno > *Load0__20_s->ecnt) { + *Load0__20_s->ecnt = eno; + Files_ReadString(&*r, r__typ, (void*)(*Load0__20_s->mods)[__X(eno, 64)], 32); + Files_ReadString(&*r, r__typ, (void*)(*Load0__20_s->procs)[__X(eno, 64)], 32); } org = Files_Pos(&*r, r__typ); - M = Modules_ThisMod((*Load0__21_s->mods)[__X(eno, 64)], 32); + M = Modules_ThisMod((*Load0__20_s->mods)[__X(eno, 64)], 32); if (M != NIL) { - Cmd = Modules_ThisCommand(M, (*Load0__21_s->procs)[__X(eno, 64)], 32); + Cmd = Modules_ThisCommand(M, (*Load0__20_s->procs)[__X(eno, 64)], 32); if (Cmd != NIL) { (*Cmd)(); } @@ -1576,25 +1561,25 @@ static void LoadElem__22 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span if (*e != NIL) { (*e)->W = ew; (*e)->H = eh; - (*e)->base = *Load0__21_s->T; - (*Load0__21_s->msg).pos = pos; - (*(*e)->handle)(*e, (void*)&*Load0__21_s->msg, Texts_FileMsg__typ); + (*e)->base = *Load0__20_s->T; + (*Load0__20_s->msg).pos = pos; + (*(*e)->handle)(*e, (void*)&*Load0__20_s->msg, Texts_FileMsg__typ); if (Files_Pos(&*r, r__typ) != org + span) { *e = NIL; } } if (*e == NIL) { - Files_Set(&*r, r__typ, *Load0__21_s->f, org + span); + Files_Set(&*r, r__typ, *Load0__20_s->f, org + span); __NEW(a, Texts__1); a->W = ew; a->H = eh; a->handle = Texts_HandleAlien; - a->base = *Load0__21_s->T; - a->file = *Load0__21_s->f; + a->base = *Load0__20_s->T; + a->file = *Load0__20_s->f; a->org = org; a->span = span; - __COPY((*Load0__21_s->mods)[__X(eno, 64)], a->mod, 32); - __COPY((*Load0__21_s->procs)[__X(eno, 64)], a->proc, 32); + __COPY((*Load0__20_s->mods)[__X(eno, 64)], a->mod, 32); + __COPY((*Load0__20_s->procs)[__X(eno, 64)], a->proc, 32); *e = (Texts_Elem)a; } } @@ -1611,15 +1596,15 @@ static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) CHAR mods[64][32], procs[64][32]; CHAR name[32]; Texts_FontsFont fnts[32]; - struct Load0__21 _s; + struct Load0__20 _s; _s.T = &T; _s.ecnt = &ecnt; _s.f = &f; _s.msg = &msg; _s.mods = (void*)mods; _s.procs = (void*)procs; - _s.lnk = Load0__21_s; - Load0__21_s = &_s; + _s.lnk = Load0__20_s; + Load0__20_s = &_s; pos = Files_Pos(&*r, r__typ); f = Files_Base(&*r, r__typ); __NEW(u, Texts_RunDesc); @@ -1652,7 +1637,7 @@ static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) un = (Texts_Run)p; un->len = plen; } else { - LoadElem__22(&msg.r, Files_Rider__typ, pos - org, -plen, &e); + LoadElem__21(&msg.r, Files_Rider__typ, pos - org, -plen, &e); un = (Texts_Run)e; un->len = 1; } @@ -1670,7 +1655,7 @@ static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) T->corg = 0; Files_ReadLInt(&msg.r, Files_Rider__typ, &T->len); Files_Set(&*r, r__typ, f, Files_Pos(&msg.r, Files_Rider__typ) + T->len); - Load0__21_s = _s.lnk; + Load0__20_s = _s.lnk; } void Texts_Load (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) @@ -1739,25 +1724,25 @@ void Texts_Open (Texts_Text T, CHAR *name, ADDRESS name__len) __DEL(name); } -static struct Store__44 { +static struct Store__43 { INT8 *ecnt; Texts_FileMsg *msg; Texts_IdentifyMsg *iden; CHAR (*mods)[64][32], (*procs)[64][32]; - struct Store__44 *lnk; -} *Store__44_s; + struct Store__43 *lnk; +} *Store__43_s; -static void StoreElem__45 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e); +static void StoreElem__44 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e); -static void StoreElem__45 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e) +static void StoreElem__44 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e) { Files_Rider r1; INT32 org, span; INT8 eno; - __COPY((*Store__44_s->iden).mod, (*Store__44_s->mods)[__X(*Store__44_s->ecnt, 64)], 32); - __COPY((*Store__44_s->iden).proc, (*Store__44_s->procs)[__X(*Store__44_s->ecnt, 64)], 32); + __COPY((*Store__43_s->iden).mod, (*Store__43_s->mods)[__X(*Store__43_s->ecnt, 64)], 32); + __COPY((*Store__43_s->iden).proc, (*Store__43_s->procs)[__X(*Store__43_s->ecnt, 64)], 32); eno = 1; - while (__STRCMP((*Store__44_s->mods)[__X(eno, 64)], (*Store__44_s->iden).mod) != 0 || __STRCMP((*Store__44_s->procs)[__X(eno, 64)], (*Store__44_s->iden).proc) != 0) { + while (__STRCMP((*Store__43_s->mods)[__X(eno, 64)], (*Store__43_s->iden).mod) != 0 || __STRCMP((*Store__43_s->procs)[__X(eno, 64)], (*Store__43_s->iden).proc) != 0) { eno += 1; } Files_Set(&r1, Files_Rider__typ, Files_Base(&*r, r__typ), Files_Pos(&*r, r__typ)); @@ -1765,14 +1750,14 @@ static void StoreElem__45 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Ele Files_WriteLInt(&*r, r__typ, 0); Files_WriteLInt(&*r, r__typ, 0); Files_Write(&*r, r__typ, eno); - if (eno == *Store__44_s->ecnt) { - *Store__44_s->ecnt += 1; - Files_WriteString(&*r, r__typ, (*Store__44_s->iden).mod, 32); - Files_WriteString(&*r, r__typ, (*Store__44_s->iden).proc, 32); + if (eno == *Store__43_s->ecnt) { + *Store__43_s->ecnt += 1; + Files_WriteString(&*r, r__typ, (*Store__43_s->iden).mod, 32); + Files_WriteString(&*r, r__typ, (*Store__43_s->iden).proc, 32); } - (*Store__44_s->msg).pos = pos; + (*Store__43_s->msg).pos = pos; org = Files_Pos(&*r, r__typ); - (*e->handle)(e, (void*)&*Store__44_s->msg, Texts_FileMsg__typ); + (*e->handle)(e, (void*)&*Store__43_s->msg, Texts_FileMsg__typ); span = Files_Pos(&*r, r__typ) - org; Files_WriteLInt(&r1, Files_Rider__typ, -span); Files_WriteLInt(&r1, Files_Rider__typ, e->W); @@ -1793,14 +1778,14 @@ void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) CHAR mods[64][32], procs[64][32]; Texts_FontsFont fnts[32]; CHAR block[1024]; - struct Store__44 _s; + struct Store__43 _s; _s.ecnt = &ecnt; _s.msg = &msg; _s.iden = &iden; _s.mods = (void*)mods; _s.procs = (void*)procs; - _s.lnk = Store__44_s; - Store__44_s = &_s; + _s.lnk = Store__43_s; + Store__43_s = &_s; org = Files_Pos(&*r, r__typ); msg.id = 1; msg.r = *r; @@ -1842,7 +1827,7 @@ void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) pos += rlen; u = un; } else if (iden.mod[0] != 0x00) { - StoreElem__45(&msg.r, Files_Rider__typ, pos, __GUARDP(u, Texts_ElemDesc, 1)); + StoreElem__44(&msg.r, Files_Rider__typ, pos, __GUARDP(u, Texts_ElemDesc, 1)); pos += 1; u = u->next; } else { @@ -1896,7 +1881,7 @@ void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) if (T->notify != NIL) { (*T->notify)(T, 3, 0, 0); } - Store__44_s = _s.lnk; + Store__43_s = _s.lnk; } void Texts_Close (Texts_Text T, CHAR *name, ADDRESS name__len) diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index dc149133..c7c8d20f 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/VT100.c b/bootstrap/unix-48/VT100.c index 669a337a..9ab993c9 100644 --- a/bootstrap/unix-48/VT100.c +++ b/bootstrap/unix-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/VT100.h b/bootstrap/unix-48/VT100.h index 809a6082..3de3605c 100644 --- a/bootstrap/unix-48/VT100.h +++ b/bootstrap/unix-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index b9ca8d5a..213abf27 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index 6a31ee74..4278a34c 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/Compiler.c b/bootstrap/unix-88/Compiler.c index 3b84a5bd..ffd8b03e 100644 --- a/bootstrap/unix-88/Compiler.c +++ b/bootstrap/unix-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index 319659fe..6db13d09 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index d438eca9..4259cfef 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 29fc1e9a..2d13a80b 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -69,6 +69,9 @@ static void Files_CloseOSFile (Files_File f); static void Files_Create (Files_File f); export void Files_Delete (CHAR *name, ADDRESS name__len, INT16 *res); static void Files_Deregister (CHAR *name, ADDRESS name__len); +export void Files_DumpBuffer (Files_Buffer b, INT16 indent); +export void Files_DumpFile (Files_File f, INT16 indent); +export void Files_DumpRider (Files_Rider r, INT16 indent); static void Files_Err (CHAR *s, ADDRESS s__len, Files_File f, INT16 errcode); static void Files_Finalize (SYSTEM_PTR o); static void Files_FlipBytes (SYSTEM_BYTE *src, ADDRESS src__len, SYSTEM_BYTE *dest, ADDRESS dest__len); @@ -99,6 +102,7 @@ export void Files_Rename (CHAR *old, ADDRESS old__len, CHAR *new, ADDRESS new__l static void Files_ScanPath (INT16 *pos, CHAR *dir, ADDRESS dir__len); export void Files_Set (Files_Rider *r, ADDRESS *r__typ, Files_File f, INT32 pos); export void Files_SetSearchPath (CHAR *path, ADDRESS path__len); +static void Files_Spaces (INT16 i); export void Files_Write (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE x); export void Files_WriteBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN x); export void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS x__len, INT32 n); @@ -111,7 +115,132 @@ export void Files_WriteSet (Files_Rider *R, ADDRESS *R__typ, UINT32 x); export void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, ADDRESS x__len); #define Files_IdxTrap() __HALT(-1) -#define Files_ToAdr(x) (ADDRESS)x + +static void Files_Spaces (INT16 i) +{ + while (i > 0) { + Out_String((CHAR*)" ", 3); + i -= 1; + } +} + +void Files_DumpFile (Files_File f, INT16 indent) +{ + Files_Spaces(indent); + Out_String((CHAR*)"workName: ", 15); + Out_String(f->workName, 101); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"registerName: ", 15); + Out_String(f->registerName, 101); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"tempFile: ", 15); + if (f->tempFile) { + Out_String((CHAR*)"TRUE", 5); + } else { + Out_String((CHAR*)"FALSE", 6); + } + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"identity: ", 15); + Out_String((CHAR*)"...", 4); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"fd: ", 15); + Out_Int(f->fd, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"len, ", 15); + Out_Int(f->len, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"pos: ", 15); + Out_Int(f->pos, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"bufs: ", 15); + Out_String((CHAR*)"...", 4); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"swapper: ", 15); + Out_Int(f->swapper, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"state: ", 15); + Out_Int(f->state, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"next: ", 15); + Out_Int((INT64)(ADDRESS)f->next, 1); + Out_Ln(); +} + +void Files_DumpBuffer (Files_Buffer b, INT16 indent) +{ + Files_Spaces(indent); + Out_String((CHAR*)"chg: ", 7); + if (b->chg) { + Out_String((CHAR*)"TRUE", 5); + } else { + Out_String((CHAR*)"FALSE", 6); + } + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"org: ", 7); + Out_Int(b->org, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"size: ", 7); + Out_Int(b->size, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"data: ", 7); + Out_String((CHAR*)"...", 4); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"f: ", 7); + if (b->f == NIL) { + Out_String((CHAR*)"", 6); + Out_Ln(); + } else { + Out_Ln(); + Files_DumpFile(b->f, indent + 1); + } +} + +void Files_DumpRider (Files_Rider r, INT16 indent) +{ + Files_Spaces(indent); + Out_String((CHAR*)"res: ", 9); + Out_Int(r.res, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"eof: ", 9); + if (r.eof) { + Out_String((CHAR*)"TRUE", 5); + } else { + Out_String((CHAR*)"FALSE", 6); + } + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"org: ", 9); + Out_Int(r.org, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"offset: ", 9); + Out_Int(r.offset, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"buf: ", 9); + if (r.buf == NIL) { + Out_String((CHAR*)"", 6); + Out_Ln(); + } else { + Out_Ln(); + Files_DumpBuffer(r.buf, indent + 1); + } +} static void Files_Assert (BOOLEAN truth) { @@ -661,7 +790,7 @@ void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS x } else { min = n; } - __MOVE((ADDRESS)buf->data + Files_ToAdr(offset), (ADDRESS)x + Files_ToAdr(xpos), min); + __MOVE((ADDRESS)&buf->data[offset], (ADDRESS)&x[xpos], min); offset += min; (*r).offset = offset; xpos += min; @@ -724,7 +853,7 @@ void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS } else { min = n; } - __MOVE((ADDRESS)x + Files_ToAdr(xpos), (ADDRESS)buf->data + Files_ToAdr(offset), min); + __MOVE((ADDRESS)&x[xpos], (ADDRESS)&buf->data[offset], min); offset += min; (*r).offset = offset; Files_Assert(offset <= 4096); diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 187a00f5..bb6e46df 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,10 +1,19 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h #include "SYSTEM.h" +typedef + struct Files_BufDesc { + INT64 _prvt0; + char _prvt1[4108]; + } Files_BufDesc; + +typedef + Files_BufDesc *Files_Buffer; + typedef struct Files_FileDesc *Files_File; @@ -25,12 +34,16 @@ typedef import ADDRESS *Files_FileDesc__typ; +import ADDRESS *Files_BufDesc__typ; import ADDRESS *Files_Rider__typ; import Files_File Files_Base (Files_Rider *r, ADDRESS *r__typ); import void Files_ChangeDirectory (CHAR *path, ADDRESS path__len, INT16 *res); import void Files_Close (Files_File f); import void Files_Delete (CHAR *name, ADDRESS name__len, INT16 *res); +import void Files_DumpBuffer (Files_Buffer b, INT16 indent); +import void Files_DumpFile (Files_File f, INT16 indent); +import void Files_DumpRider (Files_Rider r, INT16 indent); import void Files_GetDate (Files_File f, INT32 *t, INT32 *d); import void Files_GetName (Files_File f, CHAR *name, ADDRESS name__len); import INT32 Files_Length (Files_File f); diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index 79d83cee..4554feac 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index 29a878c2..0fb80f05 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 10aa7f62..eb227d08 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index 162947ee..3ee70401 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index a7d429eb..d83386eb 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index a49077b0..feb85d73 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index 89ef22dc..ab01642c 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index b30a2315..f742f265 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 5b3cc3c5..1335c494 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index d1c71f13..621dfb51 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index a529c16e..3f9dfde3 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index c82b4d80..c1fe21fb 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index a3b32b0c..4569c80d 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index 99c62664..c0707c34 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index 0bca4ab5..07f8f535 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 1aec7cad..6b2b0929 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 097c0a7c..4506267a 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index 9ad5508d..d363f022 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Out.c b/bootstrap/unix-88/Out.c index fd578128..a647f77d 100644 --- a/bootstrap/unix-88/Out.c +++ b/bootstrap/unix-88/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Out.h b/bootstrap/unix-88/Out.h index a3f5db4d..8c7a5774 100644 --- a/bootstrap/unix-88/Out.h +++ b/bootstrap/unix-88/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 5a5984c0..51a8fde7 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index 9ea581aa..56fab736 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 8ba81525..f5ee1490 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index 0fe868e0..6d0ec38b 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index a6a802c4..4ee2fc23 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index bec035c4..ae281477 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index eba58f8f..1afb5eba 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -194,7 +194,6 @@ export void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); export void Texts_Delete (Texts_Text T, INT32 beg, INT32 end); static void Texts_DumpElem (Texts_Elem e); export void Texts_DumpReader (Texts_Reader re); -static void Texts_DumpRider (Files_Rider ri); static void Texts_DumpRun (Texts_Run ru); static void Texts_DumpText (Texts_Text t); export Texts_Text Texts_ElemBase (Texts_Elem E); @@ -278,20 +277,6 @@ static void Texts_DumpElem (Texts_Elem e) } } -static void Texts_DumpRider (Files_Rider ri) -{ - Out_String((CHAR*)" res: ", 10); - Out_Int(ri.res, 1); - Out_Ln(); - Out_String((CHAR*)" eof: ", 10); - if (ri.eof) { - Out_String((CHAR*)"TRUE", 5); - } else { - Out_String((CHAR*)"FALSE", 6); - } - Out_Ln(); -} - static void Texts_DumpRun (Texts_Run ru) { Out_String((CHAR*)" prev: ", 12); @@ -365,7 +350,7 @@ void Texts_DumpReader (Texts_Reader re) } Out_String((CHAR*)" rider: ", 10); Out_Ln(); - Texts_DumpRider(re.rider); + Files_DumpRider(re.rider, 2); Out_String((CHAR*)" run: ", 10); if (re.run == NIL) { Out_String((CHAR*)"", 6); @@ -860,32 +845,32 @@ void Texts_OpenScanner (Texts_Scanner *S, ADDRESS *S__typ, Texts_Text T, INT32 p (*S).nextCh = ' '; } -static struct Scan__36 { +static struct Scan__35 { Texts_Scanner *S; ADDRESS *S__typ; CHAR *ch; BOOLEAN *negE; INT16 *e; - struct Scan__36 *lnk; -} *Scan__36_s; + struct Scan__35 *lnk; +} *Scan__35_s; -static void ReadScaleFactor__37 (void); +static void ReadScaleFactor__36 (void); -static void ReadScaleFactor__37 (void) +static void ReadScaleFactor__36 (void) { - Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); - if (*Scan__36_s->ch == '-') { - *Scan__36_s->negE = 1; - Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); + Texts_Read((void*)&*Scan__35_s->S, Scan__35_s->S__typ, &*Scan__35_s->ch); + if (*Scan__35_s->ch == '-') { + *Scan__35_s->negE = 1; + Texts_Read((void*)&*Scan__35_s->S, Scan__35_s->S__typ, &*Scan__35_s->ch); } else { - *Scan__36_s->negE = 0; - if (*Scan__36_s->ch == '+') { - Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); + *Scan__35_s->negE = 0; + if (*Scan__35_s->ch == '+') { + Texts_Read((void*)&*Scan__35_s->S, Scan__35_s->S__typ, &*Scan__35_s->ch); } } - while (('0' <= *Scan__36_s->ch && *Scan__36_s->ch <= '9')) { - *Scan__36_s->e = (*Scan__36_s->e * 10 + (INT16)*Scan__36_s->ch) - 48; - Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); + while (('0' <= *Scan__35_s->ch && *Scan__35_s->ch <= '9')) { + *Scan__35_s->e = (*Scan__35_s->e * 10 + (INT16)*Scan__35_s->ch) - 48; + Texts_Read((void*)&*Scan__35_s->S, Scan__35_s->S__typ, &*Scan__35_s->ch); } } @@ -899,13 +884,13 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) REAL x, f; LONGREAL y, g; CHAR d[32]; - struct Scan__36 _s; + struct Scan__35 _s; _s.S = S; _s.S__typ = S__typ; _s.ch = &ch; _s.negE = &negE; _s.e = &e; - _s.lnk = Scan__36_s; - Scan__36_s = &_s; + _s.lnk = Scan__35_s; + Scan__35_s = &_s; ch = (*S).nextCh; i = 0; for (;;) { @@ -1006,7 +991,7 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) y = ((INT16)d[__X(j, 32)] - 48) * g + y; j += 1; } - ReadScaleFactor__37(); + ReadScaleFactor__36(); if (negE) { if (e <= 308) { y = y / (LONGREAL)Reals_TenL(e); @@ -1039,7 +1024,7 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) j += 1; } if (ch == 'E') { - ReadScaleFactor__37(); + ReadScaleFactor__36(); } if (negE) { if (e <= 38) { @@ -1092,7 +1077,7 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) } } (*S).nextCh = ch; - Scan__36_s = _s.lnk; + Scan__35_s = _s.lnk; } void Texts_OpenWriter (Texts_Writer *W, ADDRESS *W__typ) @@ -1311,30 +1296,30 @@ void Texts_WriteReal (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n) } } -static struct WriteRealFix__58 { +static struct WriteRealFix__57 { Texts_Writer *W; ADDRESS *W__typ; INT16 *i; CHAR (*d)[9]; - struct WriteRealFix__58 *lnk; -} *WriteRealFix__58_s; + struct WriteRealFix__57 *lnk; +} *WriteRealFix__57_s; -static void dig__59 (INT16 n); -static void seq__61 (CHAR ch, INT16 n); +static void dig__58 (INT16 n); +static void seq__60 (CHAR ch, INT16 n); -static void seq__61 (CHAR ch, INT16 n) +static void seq__60 (CHAR ch, INT16 n) { while (n > 0) { - Texts_Write(&*WriteRealFix__58_s->W, WriteRealFix__58_s->W__typ, ch); + Texts_Write(&*WriteRealFix__57_s->W, WriteRealFix__57_s->W__typ, ch); n -= 1; } } -static void dig__59 (INT16 n) +static void dig__58 (INT16 n) { while (n > 0) { - *WriteRealFix__58_s->i -= 1; - Texts_Write(&*WriteRealFix__58_s->W, WriteRealFix__58_s->W__typ, (*WriteRealFix__58_s->d)[__X(*WriteRealFix__58_s->i, 9)]); + *WriteRealFix__57_s->i -= 1; + Texts_Write(&*WriteRealFix__57_s->W, WriteRealFix__57_s->W__typ, (*WriteRealFix__57_s->d)[__X(*WriteRealFix__57_s->i, 9)]); n -= 1; } } @@ -1345,23 +1330,23 @@ void Texts_WriteRealFix (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n, INT1 CHAR sign; REAL x0; CHAR d[9]; - struct WriteRealFix__58 _s; + struct WriteRealFix__57 _s; _s.W = W; _s.W__typ = W__typ; _s.i = &i; _s.d = (void*)d; - _s.lnk = WriteRealFix__58_s; - WriteRealFix__58_s = &_s; + _s.lnk = WriteRealFix__57_s; + WriteRealFix__57_s = &_s; e = Reals_Expo(x); if (k < 0) { k = 0; } if (e == 0) { - seq__61(' ', (n - k) - 2); + seq__60(' ', (n - k) - 2); Texts_Write(&*W, W__typ, '0'); - seq__61(' ', k + 1); + seq__60(' ', k + 1); } else if (e == 255) { Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", 5); - seq__61(' ', n - 4); + seq__60(' ', n - 4); } else { e = __ASHR((e - 127) * 77, 8); if (x < (REAL)0) { @@ -1394,21 +1379,21 @@ void Texts_WriteRealFix (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n, INT1 i = k + e; Reals_Convert(x, i, (void*)d, 9); if (e > 0) { - seq__61(' ', ((n - e) - k) - 2); + seq__60(' ', ((n - e) - k) - 2); Texts_Write(&*W, W__typ, sign); - dig__59(e); + dig__58(e); Texts_Write(&*W, W__typ, '.'); - dig__59(k); + dig__58(k); } else { - seq__61(' ', (n - k) - 3); + seq__60(' ', (n - k) - 3); Texts_Write(&*W, W__typ, sign); Texts_Write(&*W, W__typ, '0'); Texts_Write(&*W, W__typ, '.'); - seq__61('0', -e); - dig__59(k + e); + seq__60('0', -e); + dig__58(k + e); } } - WriteRealFix__58_s = _s.lnk; + WriteRealFix__57_s = _s.lnk; } void Texts_WriteRealHex (Texts_Writer *W, ADDRESS *W__typ, REAL x) @@ -1507,48 +1492,48 @@ void Texts_WriteLongRealHex (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x) } while (!(i == 16)); } -static struct WriteDate__48 { +static struct WriteDate__47 { Texts_Writer *W; ADDRESS *W__typ; - struct WriteDate__48 *lnk; -} *WriteDate__48_s; + struct WriteDate__47 *lnk; +} *WriteDate__47_s; -static void WritePair__49 (CHAR ch, INT32 x); +static void WritePair__48 (CHAR ch, INT32 x); -static void WritePair__49 (CHAR ch, INT32 x) +static void WritePair__48 (CHAR ch, INT32 x) { - Texts_Write(&*WriteDate__48_s->W, WriteDate__48_s->W__typ, ch); - Texts_Write(&*WriteDate__48_s->W, WriteDate__48_s->W__typ, (CHAR)(__DIV(x, 10) + 48)); - Texts_Write(&*WriteDate__48_s->W, WriteDate__48_s->W__typ, (CHAR)((int)__MOD(x, 10) + 48)); + Texts_Write(&*WriteDate__47_s->W, WriteDate__47_s->W__typ, ch); + Texts_Write(&*WriteDate__47_s->W, WriteDate__47_s->W__typ, (CHAR)(__DIV(x, 10) + 48)); + Texts_Write(&*WriteDate__47_s->W, WriteDate__47_s->W__typ, (CHAR)((int)__MOD(x, 10) + 48)); } void Texts_WriteDate (Texts_Writer *W, ADDRESS *W__typ, INT32 t, INT32 d) { - struct WriteDate__48 _s; + struct WriteDate__47 _s; _s.W = W; _s.W__typ = W__typ; - _s.lnk = WriteDate__48_s; - WriteDate__48_s = &_s; - WritePair__49(' ', __MASK(d, -32)); - WritePair__49('.', __MASK(__ASHR(d, 5), -16)); - WritePair__49('.', __MASK(__ASHR(d, 9), -128)); - WritePair__49(' ', __MASK(__ASHR(t, 12), -32)); - WritePair__49(':', __MASK(__ASHR(t, 6), -64)); - WritePair__49(':', __MASK(t, -64)); - WriteDate__48_s = _s.lnk; + _s.lnk = WriteDate__47_s; + WriteDate__47_s = &_s; + WritePair__48(' ', __MASK(d, -32)); + WritePair__48('.', __MASK(__ASHR(d, 5), -16)); + WritePair__48('.', __MASK(__ASHR(d, 9), -128)); + WritePair__48(' ', __MASK(__ASHR(t, 12), -32)); + WritePair__48(':', __MASK(__ASHR(t, 6), -64)); + WritePair__48(':', __MASK(t, -64)); + WriteDate__47_s = _s.lnk; } -static struct Load0__21 { +static struct Load0__20 { Texts_Text *T; INT8 *ecnt; Files_File *f; Texts_FileMsg *msg; CHAR (*mods)[64][32], (*procs)[64][32]; - struct Load0__21 *lnk; -} *Load0__21_s; + struct Load0__20 *lnk; +} *Load0__20_s; -static void LoadElem__22 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e); +static void LoadElem__21 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e); -static void LoadElem__22 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e) +static void LoadElem__21 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e) { Modules_Module M = NIL; Modules_Command Cmd; @@ -1559,15 +1544,15 @@ static void LoadElem__22 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span Files_ReadLInt(&*r, r__typ, &ew); Files_ReadLInt(&*r, r__typ, &eh); Files_Read(&*r, r__typ, (void*)&eno); - if (eno > *Load0__21_s->ecnt) { - *Load0__21_s->ecnt = eno; - Files_ReadString(&*r, r__typ, (void*)(*Load0__21_s->mods)[__X(eno, 64)], 32); - Files_ReadString(&*r, r__typ, (void*)(*Load0__21_s->procs)[__X(eno, 64)], 32); + if (eno > *Load0__20_s->ecnt) { + *Load0__20_s->ecnt = eno; + Files_ReadString(&*r, r__typ, (void*)(*Load0__20_s->mods)[__X(eno, 64)], 32); + Files_ReadString(&*r, r__typ, (void*)(*Load0__20_s->procs)[__X(eno, 64)], 32); } org = Files_Pos(&*r, r__typ); - M = Modules_ThisMod((*Load0__21_s->mods)[__X(eno, 64)], 32); + M = Modules_ThisMod((*Load0__20_s->mods)[__X(eno, 64)], 32); if (M != NIL) { - Cmd = Modules_ThisCommand(M, (*Load0__21_s->procs)[__X(eno, 64)], 32); + Cmd = Modules_ThisCommand(M, (*Load0__20_s->procs)[__X(eno, 64)], 32); if (Cmd != NIL) { (*Cmd)(); } @@ -1576,25 +1561,25 @@ static void LoadElem__22 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span if (*e != NIL) { (*e)->W = ew; (*e)->H = eh; - (*e)->base = *Load0__21_s->T; - (*Load0__21_s->msg).pos = pos; - (*(*e)->handle)(*e, (void*)&*Load0__21_s->msg, Texts_FileMsg__typ); + (*e)->base = *Load0__20_s->T; + (*Load0__20_s->msg).pos = pos; + (*(*e)->handle)(*e, (void*)&*Load0__20_s->msg, Texts_FileMsg__typ); if (Files_Pos(&*r, r__typ) != org + span) { *e = NIL; } } if (*e == NIL) { - Files_Set(&*r, r__typ, *Load0__21_s->f, org + span); + Files_Set(&*r, r__typ, *Load0__20_s->f, org + span); __NEW(a, Texts__1); a->W = ew; a->H = eh; a->handle = Texts_HandleAlien; - a->base = *Load0__21_s->T; - a->file = *Load0__21_s->f; + a->base = *Load0__20_s->T; + a->file = *Load0__20_s->f; a->org = org; a->span = span; - __COPY((*Load0__21_s->mods)[__X(eno, 64)], a->mod, 32); - __COPY((*Load0__21_s->procs)[__X(eno, 64)], a->proc, 32); + __COPY((*Load0__20_s->mods)[__X(eno, 64)], a->mod, 32); + __COPY((*Load0__20_s->procs)[__X(eno, 64)], a->proc, 32); *e = (Texts_Elem)a; } } @@ -1611,15 +1596,15 @@ static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) CHAR mods[64][32], procs[64][32]; CHAR name[32]; Texts_FontsFont fnts[32]; - struct Load0__21 _s; + struct Load0__20 _s; _s.T = &T; _s.ecnt = &ecnt; _s.f = &f; _s.msg = &msg; _s.mods = (void*)mods; _s.procs = (void*)procs; - _s.lnk = Load0__21_s; - Load0__21_s = &_s; + _s.lnk = Load0__20_s; + Load0__20_s = &_s; pos = Files_Pos(&*r, r__typ); f = Files_Base(&*r, r__typ); __NEW(u, Texts_RunDesc); @@ -1652,7 +1637,7 @@ static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) un = (Texts_Run)p; un->len = plen; } else { - LoadElem__22(&msg.r, Files_Rider__typ, pos - org, -plen, &e); + LoadElem__21(&msg.r, Files_Rider__typ, pos - org, -plen, &e); un = (Texts_Run)e; un->len = 1; } @@ -1670,7 +1655,7 @@ static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) T->corg = 0; Files_ReadLInt(&msg.r, Files_Rider__typ, &T->len); Files_Set(&*r, r__typ, f, Files_Pos(&msg.r, Files_Rider__typ) + T->len); - Load0__21_s = _s.lnk; + Load0__20_s = _s.lnk; } void Texts_Load (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) @@ -1739,25 +1724,25 @@ void Texts_Open (Texts_Text T, CHAR *name, ADDRESS name__len) __DEL(name); } -static struct Store__44 { +static struct Store__43 { INT8 *ecnt; Texts_FileMsg *msg; Texts_IdentifyMsg *iden; CHAR (*mods)[64][32], (*procs)[64][32]; - struct Store__44 *lnk; -} *Store__44_s; + struct Store__43 *lnk; +} *Store__43_s; -static void StoreElem__45 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e); +static void StoreElem__44 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e); -static void StoreElem__45 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e) +static void StoreElem__44 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e) { Files_Rider r1; INT32 org, span; INT8 eno; - __COPY((*Store__44_s->iden).mod, (*Store__44_s->mods)[__X(*Store__44_s->ecnt, 64)], 32); - __COPY((*Store__44_s->iden).proc, (*Store__44_s->procs)[__X(*Store__44_s->ecnt, 64)], 32); + __COPY((*Store__43_s->iden).mod, (*Store__43_s->mods)[__X(*Store__43_s->ecnt, 64)], 32); + __COPY((*Store__43_s->iden).proc, (*Store__43_s->procs)[__X(*Store__43_s->ecnt, 64)], 32); eno = 1; - while (__STRCMP((*Store__44_s->mods)[__X(eno, 64)], (*Store__44_s->iden).mod) != 0 || __STRCMP((*Store__44_s->procs)[__X(eno, 64)], (*Store__44_s->iden).proc) != 0) { + while (__STRCMP((*Store__43_s->mods)[__X(eno, 64)], (*Store__43_s->iden).mod) != 0 || __STRCMP((*Store__43_s->procs)[__X(eno, 64)], (*Store__43_s->iden).proc) != 0) { eno += 1; } Files_Set(&r1, Files_Rider__typ, Files_Base(&*r, r__typ), Files_Pos(&*r, r__typ)); @@ -1765,14 +1750,14 @@ static void StoreElem__45 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Ele Files_WriteLInt(&*r, r__typ, 0); Files_WriteLInt(&*r, r__typ, 0); Files_Write(&*r, r__typ, eno); - if (eno == *Store__44_s->ecnt) { - *Store__44_s->ecnt += 1; - Files_WriteString(&*r, r__typ, (*Store__44_s->iden).mod, 32); - Files_WriteString(&*r, r__typ, (*Store__44_s->iden).proc, 32); + if (eno == *Store__43_s->ecnt) { + *Store__43_s->ecnt += 1; + Files_WriteString(&*r, r__typ, (*Store__43_s->iden).mod, 32); + Files_WriteString(&*r, r__typ, (*Store__43_s->iden).proc, 32); } - (*Store__44_s->msg).pos = pos; + (*Store__43_s->msg).pos = pos; org = Files_Pos(&*r, r__typ); - (*e->handle)(e, (void*)&*Store__44_s->msg, Texts_FileMsg__typ); + (*e->handle)(e, (void*)&*Store__43_s->msg, Texts_FileMsg__typ); span = Files_Pos(&*r, r__typ) - org; Files_WriteLInt(&r1, Files_Rider__typ, -span); Files_WriteLInt(&r1, Files_Rider__typ, e->W); @@ -1793,14 +1778,14 @@ void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) CHAR mods[64][32], procs[64][32]; Texts_FontsFont fnts[32]; CHAR block[1024]; - struct Store__44 _s; + struct Store__43 _s; _s.ecnt = &ecnt; _s.msg = &msg; _s.iden = &iden; _s.mods = (void*)mods; _s.procs = (void*)procs; - _s.lnk = Store__44_s; - Store__44_s = &_s; + _s.lnk = Store__43_s; + Store__43_s = &_s; org = Files_Pos(&*r, r__typ); msg.id = 1; msg.r = *r; @@ -1842,7 +1827,7 @@ void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) pos += rlen; u = un; } else if (iden.mod[0] != 0x00) { - StoreElem__45(&msg.r, Files_Rider__typ, pos, __GUARDP(u, Texts_ElemDesc, 1)); + StoreElem__44(&msg.r, Files_Rider__typ, pos, __GUARDP(u, Texts_ElemDesc, 1)); pos += 1; u = u->next; } else { @@ -1896,7 +1881,7 @@ void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) if (T->notify != NIL) { (*T->notify)(T, 3, 0, 0); } - Store__44_s = _s.lnk; + Store__43_s = _s.lnk; } void Texts_Close (Texts_Text T, CHAR *name, ADDRESS name__len) diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index 55558804..e14afb26 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/VT100.c b/bootstrap/unix-88/VT100.c index 669a337a..9ab993c9 100644 --- a/bootstrap/unix-88/VT100.c +++ b/bootstrap/unix-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/VT100.h b/bootstrap/unix-88/VT100.h index 809a6082..3de3605c 100644 --- a/bootstrap/unix-88/VT100.h +++ b/bootstrap/unix-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index b9ca8d5a..213abf27 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index 6a31ee74..4278a34c 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/Compiler.c b/bootstrap/windows-48/Compiler.c index 3b84a5bd..ffd8b03e 100644 --- a/bootstrap/windows-48/Compiler.c +++ b/bootstrap/windows-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index 319659fe..6db13d09 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index d438eca9..4259cfef 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 6db7dd4d..3e1b5ecd 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -69,6 +69,9 @@ static void Files_CloseOSFile (Files_File f); static void Files_Create (Files_File f); export void Files_Delete (CHAR *name, ADDRESS name__len, INT16 *res); static void Files_Deregister (CHAR *name, ADDRESS name__len); +export void Files_DumpBuffer (Files_Buffer b, INT16 indent); +export void Files_DumpFile (Files_File f, INT16 indent); +export void Files_DumpRider (Files_Rider r, INT16 indent); static void Files_Err (CHAR *s, ADDRESS s__len, Files_File f, INT16 errcode); static void Files_Finalize (SYSTEM_PTR o); static void Files_FlipBytes (SYSTEM_BYTE *src, ADDRESS src__len, SYSTEM_BYTE *dest, ADDRESS dest__len); @@ -99,6 +102,7 @@ export void Files_Rename (CHAR *old, ADDRESS old__len, CHAR *new, ADDRESS new__l static void Files_ScanPath (INT16 *pos, CHAR *dir, ADDRESS dir__len); export void Files_Set (Files_Rider *r, ADDRESS *r__typ, Files_File f, INT32 pos); export void Files_SetSearchPath (CHAR *path, ADDRESS path__len); +static void Files_Spaces (INT16 i); export void Files_Write (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE x); export void Files_WriteBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN x); export void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS x__len, INT32 n); @@ -111,7 +115,132 @@ export void Files_WriteSet (Files_Rider *R, ADDRESS *R__typ, UINT32 x); export void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, ADDRESS x__len); #define Files_IdxTrap() __HALT(-1) -#define Files_ToAdr(x) (ADDRESS)x + +static void Files_Spaces (INT16 i) +{ + while (i > 0) { + Out_String((CHAR*)" ", 3); + i -= 1; + } +} + +void Files_DumpFile (Files_File f, INT16 indent) +{ + Files_Spaces(indent); + Out_String((CHAR*)"workName: ", 15); + Out_String(f->workName, 101); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"registerName: ", 15); + Out_String(f->registerName, 101); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"tempFile: ", 15); + if (f->tempFile) { + Out_String((CHAR*)"TRUE", 5); + } else { + Out_String((CHAR*)"FALSE", 6); + } + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"identity: ", 15); + Out_String((CHAR*)"...", 4); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"fd: ", 15); + Out_Int(f->fd, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"len, ", 15); + Out_Int(f->len, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"pos: ", 15); + Out_Int(f->pos, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"bufs: ", 15); + Out_String((CHAR*)"...", 4); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"swapper: ", 15); + Out_Int(f->swapper, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"state: ", 15); + Out_Int(f->state, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"next: ", 15); + Out_Int((INT32)(ADDRESS)f->next, 1); + Out_Ln(); +} + +void Files_DumpBuffer (Files_Buffer b, INT16 indent) +{ + Files_Spaces(indent); + Out_String((CHAR*)"chg: ", 7); + if (b->chg) { + Out_String((CHAR*)"TRUE", 5); + } else { + Out_String((CHAR*)"FALSE", 6); + } + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"org: ", 7); + Out_Int(b->org, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"size: ", 7); + Out_Int(b->size, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"data: ", 7); + Out_String((CHAR*)"...", 4); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"f: ", 7); + if (b->f == NIL) { + Out_String((CHAR*)"", 6); + Out_Ln(); + } else { + Out_Ln(); + Files_DumpFile(b->f, indent + 1); + } +} + +void Files_DumpRider (Files_Rider r, INT16 indent) +{ + Files_Spaces(indent); + Out_String((CHAR*)"res: ", 9); + Out_Int(r.res, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"eof: ", 9); + if (r.eof) { + Out_String((CHAR*)"TRUE", 5); + } else { + Out_String((CHAR*)"FALSE", 6); + } + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"org: ", 9); + Out_Int(r.org, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"offset: ", 9); + Out_Int(r.offset, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"buf: ", 9); + if (r.buf == NIL) { + Out_String((CHAR*)"", 6); + Out_Ln(); + } else { + Out_Ln(); + Files_DumpBuffer(r.buf, indent + 1); + } +} static void Files_Assert (BOOLEAN truth) { @@ -661,7 +790,7 @@ void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS x } else { min = n; } - __MOVE((ADDRESS)buf->data + Files_ToAdr(offset), (ADDRESS)x + Files_ToAdr(xpos), min); + __MOVE((ADDRESS)&buf->data[offset], (ADDRESS)&x[xpos], min); offset += min; (*r).offset = offset; xpos += min; @@ -724,7 +853,7 @@ void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS } else { min = n; } - __MOVE((ADDRESS)x + Files_ToAdr(xpos), (ADDRESS)buf->data + Files_ToAdr(offset), min); + __MOVE((ADDRESS)&x[xpos], (ADDRESS)&buf->data[offset], min); offset += min; (*r).offset = offset; Files_Assert(offset <= 4096); diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index aa177fb4..dfeeebb3 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,10 +1,19 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h #include "SYSTEM.h" +typedef + struct Files_BufDesc { + INT32 _prvt0; + char _prvt1[4108]; + } Files_BufDesc; + +typedef + Files_BufDesc *Files_Buffer; + typedef struct Files_FileDesc *Files_File; @@ -24,12 +33,16 @@ typedef import ADDRESS *Files_FileDesc__typ; +import ADDRESS *Files_BufDesc__typ; import ADDRESS *Files_Rider__typ; import Files_File Files_Base (Files_Rider *r, ADDRESS *r__typ); import void Files_ChangeDirectory (CHAR *path, ADDRESS path__len, INT16 *res); import void Files_Close (Files_File f); import void Files_Delete (CHAR *name, ADDRESS name__len, INT16 *res); +import void Files_DumpBuffer (Files_Buffer b, INT16 indent); +import void Files_DumpFile (Files_File f, INT16 indent); +import void Files_DumpRider (Files_Rider r, INT16 indent); import void Files_GetDate (Files_File f, INT32 *t, INT32 *d); import void Files_GetName (Files_File f, CHAR *name, ADDRESS name__len); import INT32 Files_Length (Files_File f); diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index a3bcc604..125a2854 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index b5a1e4c3..e794a4a3 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index 4a04e15a..ab668fec 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index 4cecc8b9..553f80ed 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index a7d429eb..d83386eb 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index a49077b0..feb85d73 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 89ef22dc..ab01642c 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index b30a2315..f742f265 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 0c8ab9b3..a6c7a5cd 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index d1c71f13..621dfb51 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index dfca5a85..383b6d65 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index c82b4d80..c1fe21fb 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index a3b32b0c..4569c80d 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index 99c62664..c0707c34 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 6edc4b6a..0d32553a 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index 1aec7cad..6b2b0929 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index 1e66dbde..42081077 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index 9ad5508d..d363f022 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Out.c b/bootstrap/windows-48/Out.c index 1f466dc9..52896b61 100644 --- a/bootstrap/windows-48/Out.c +++ b/bootstrap/windows-48/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Out.h b/bootstrap/windows-48/Out.h index a3f5db4d..8c7a5774 100644 --- a/bootstrap/windows-48/Out.h +++ b/bootstrap/windows-48/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index eb23ff1d..43a2c695 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index ce0d19ba..ddc997ca 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 8ba81525..f5ee1490 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index 0fe868e0..6d0ec38b 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index a6a802c4..4ee2fc23 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index bec035c4..ae281477 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index d1a7f696..9016dbc8 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -194,7 +194,6 @@ export void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); export void Texts_Delete (Texts_Text T, INT32 beg, INT32 end); static void Texts_DumpElem (Texts_Elem e); export void Texts_DumpReader (Texts_Reader re); -static void Texts_DumpRider (Files_Rider ri); static void Texts_DumpRun (Texts_Run ru); static void Texts_DumpText (Texts_Text t); export Texts_Text Texts_ElemBase (Texts_Elem E); @@ -278,20 +277,6 @@ static void Texts_DumpElem (Texts_Elem e) } } -static void Texts_DumpRider (Files_Rider ri) -{ - Out_String((CHAR*)" res: ", 10); - Out_Int(ri.res, 1); - Out_Ln(); - Out_String((CHAR*)" eof: ", 10); - if (ri.eof) { - Out_String((CHAR*)"TRUE", 5); - } else { - Out_String((CHAR*)"FALSE", 6); - } - Out_Ln(); -} - static void Texts_DumpRun (Texts_Run ru) { Out_String((CHAR*)" prev: ", 12); @@ -365,7 +350,7 @@ void Texts_DumpReader (Texts_Reader re) } Out_String((CHAR*)" rider: ", 10); Out_Ln(); - Texts_DumpRider(re.rider); + Files_DumpRider(re.rider, 2); Out_String((CHAR*)" run: ", 10); if (re.run == NIL) { Out_String((CHAR*)"", 6); @@ -860,32 +845,32 @@ void Texts_OpenScanner (Texts_Scanner *S, ADDRESS *S__typ, Texts_Text T, INT32 p (*S).nextCh = ' '; } -static struct Scan__36 { +static struct Scan__35 { Texts_Scanner *S; ADDRESS *S__typ; CHAR *ch; BOOLEAN *negE; INT16 *e; - struct Scan__36 *lnk; -} *Scan__36_s; + struct Scan__35 *lnk; +} *Scan__35_s; -static void ReadScaleFactor__37 (void); +static void ReadScaleFactor__36 (void); -static void ReadScaleFactor__37 (void) +static void ReadScaleFactor__36 (void) { - Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); - if (*Scan__36_s->ch == '-') { - *Scan__36_s->negE = 1; - Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); + Texts_Read((void*)&*Scan__35_s->S, Scan__35_s->S__typ, &*Scan__35_s->ch); + if (*Scan__35_s->ch == '-') { + *Scan__35_s->negE = 1; + Texts_Read((void*)&*Scan__35_s->S, Scan__35_s->S__typ, &*Scan__35_s->ch); } else { - *Scan__36_s->negE = 0; - if (*Scan__36_s->ch == '+') { - Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); + *Scan__35_s->negE = 0; + if (*Scan__35_s->ch == '+') { + Texts_Read((void*)&*Scan__35_s->S, Scan__35_s->S__typ, &*Scan__35_s->ch); } } - while (('0' <= *Scan__36_s->ch && *Scan__36_s->ch <= '9')) { - *Scan__36_s->e = (*Scan__36_s->e * 10 + (INT16)*Scan__36_s->ch) - 48; - Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); + while (('0' <= *Scan__35_s->ch && *Scan__35_s->ch <= '9')) { + *Scan__35_s->e = (*Scan__35_s->e * 10 + (INT16)*Scan__35_s->ch) - 48; + Texts_Read((void*)&*Scan__35_s->S, Scan__35_s->S__typ, &*Scan__35_s->ch); } } @@ -899,13 +884,13 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) REAL x, f; LONGREAL y, g; CHAR d[32]; - struct Scan__36 _s; + struct Scan__35 _s; _s.S = S; _s.S__typ = S__typ; _s.ch = &ch; _s.negE = &negE; _s.e = &e; - _s.lnk = Scan__36_s; - Scan__36_s = &_s; + _s.lnk = Scan__35_s; + Scan__35_s = &_s; ch = (*S).nextCh; i = 0; for (;;) { @@ -1006,7 +991,7 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) y = ((INT16)d[__X(j, 32)] - 48) * g + y; j += 1; } - ReadScaleFactor__37(); + ReadScaleFactor__36(); if (negE) { if (e <= 308) { y = y / (LONGREAL)Reals_TenL(e); @@ -1039,7 +1024,7 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) j += 1; } if (ch == 'E') { - ReadScaleFactor__37(); + ReadScaleFactor__36(); } if (negE) { if (e <= 38) { @@ -1092,7 +1077,7 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) } } (*S).nextCh = ch; - Scan__36_s = _s.lnk; + Scan__35_s = _s.lnk; } void Texts_OpenWriter (Texts_Writer *W, ADDRESS *W__typ) @@ -1311,30 +1296,30 @@ void Texts_WriteReal (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n) } } -static struct WriteRealFix__58 { +static struct WriteRealFix__57 { Texts_Writer *W; ADDRESS *W__typ; INT16 *i; CHAR (*d)[9]; - struct WriteRealFix__58 *lnk; -} *WriteRealFix__58_s; + struct WriteRealFix__57 *lnk; +} *WriteRealFix__57_s; -static void dig__59 (INT16 n); -static void seq__61 (CHAR ch, INT16 n); +static void dig__58 (INT16 n); +static void seq__60 (CHAR ch, INT16 n); -static void seq__61 (CHAR ch, INT16 n) +static void seq__60 (CHAR ch, INT16 n) { while (n > 0) { - Texts_Write(&*WriteRealFix__58_s->W, WriteRealFix__58_s->W__typ, ch); + Texts_Write(&*WriteRealFix__57_s->W, WriteRealFix__57_s->W__typ, ch); n -= 1; } } -static void dig__59 (INT16 n) +static void dig__58 (INT16 n) { while (n > 0) { - *WriteRealFix__58_s->i -= 1; - Texts_Write(&*WriteRealFix__58_s->W, WriteRealFix__58_s->W__typ, (*WriteRealFix__58_s->d)[__X(*WriteRealFix__58_s->i, 9)]); + *WriteRealFix__57_s->i -= 1; + Texts_Write(&*WriteRealFix__57_s->W, WriteRealFix__57_s->W__typ, (*WriteRealFix__57_s->d)[__X(*WriteRealFix__57_s->i, 9)]); n -= 1; } } @@ -1345,23 +1330,23 @@ void Texts_WriteRealFix (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n, INT1 CHAR sign; REAL x0; CHAR d[9]; - struct WriteRealFix__58 _s; + struct WriteRealFix__57 _s; _s.W = W; _s.W__typ = W__typ; _s.i = &i; _s.d = (void*)d; - _s.lnk = WriteRealFix__58_s; - WriteRealFix__58_s = &_s; + _s.lnk = WriteRealFix__57_s; + WriteRealFix__57_s = &_s; e = Reals_Expo(x); if (k < 0) { k = 0; } if (e == 0) { - seq__61(' ', (n - k) - 2); + seq__60(' ', (n - k) - 2); Texts_Write(&*W, W__typ, '0'); - seq__61(' ', k + 1); + seq__60(' ', k + 1); } else if (e == 255) { Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", 5); - seq__61(' ', n - 4); + seq__60(' ', n - 4); } else { e = __ASHR((e - 127) * 77, 8); if (x < (REAL)0) { @@ -1394,21 +1379,21 @@ void Texts_WriteRealFix (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n, INT1 i = k + e; Reals_Convert(x, i, (void*)d, 9); if (e > 0) { - seq__61(' ', ((n - e) - k) - 2); + seq__60(' ', ((n - e) - k) - 2); Texts_Write(&*W, W__typ, sign); - dig__59(e); + dig__58(e); Texts_Write(&*W, W__typ, '.'); - dig__59(k); + dig__58(k); } else { - seq__61(' ', (n - k) - 3); + seq__60(' ', (n - k) - 3); Texts_Write(&*W, W__typ, sign); Texts_Write(&*W, W__typ, '0'); Texts_Write(&*W, W__typ, '.'); - seq__61('0', -e); - dig__59(k + e); + seq__60('0', -e); + dig__58(k + e); } } - WriteRealFix__58_s = _s.lnk; + WriteRealFix__57_s = _s.lnk; } void Texts_WriteRealHex (Texts_Writer *W, ADDRESS *W__typ, REAL x) @@ -1507,48 +1492,48 @@ void Texts_WriteLongRealHex (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x) } while (!(i == 16)); } -static struct WriteDate__48 { +static struct WriteDate__47 { Texts_Writer *W; ADDRESS *W__typ; - struct WriteDate__48 *lnk; -} *WriteDate__48_s; + struct WriteDate__47 *lnk; +} *WriteDate__47_s; -static void WritePair__49 (CHAR ch, INT32 x); +static void WritePair__48 (CHAR ch, INT32 x); -static void WritePair__49 (CHAR ch, INT32 x) +static void WritePair__48 (CHAR ch, INT32 x) { - Texts_Write(&*WriteDate__48_s->W, WriteDate__48_s->W__typ, ch); - Texts_Write(&*WriteDate__48_s->W, WriteDate__48_s->W__typ, (CHAR)(__DIV(x, 10) + 48)); - Texts_Write(&*WriteDate__48_s->W, WriteDate__48_s->W__typ, (CHAR)((int)__MOD(x, 10) + 48)); + Texts_Write(&*WriteDate__47_s->W, WriteDate__47_s->W__typ, ch); + Texts_Write(&*WriteDate__47_s->W, WriteDate__47_s->W__typ, (CHAR)(__DIV(x, 10) + 48)); + Texts_Write(&*WriteDate__47_s->W, WriteDate__47_s->W__typ, (CHAR)((int)__MOD(x, 10) + 48)); } void Texts_WriteDate (Texts_Writer *W, ADDRESS *W__typ, INT32 t, INT32 d) { - struct WriteDate__48 _s; + struct WriteDate__47 _s; _s.W = W; _s.W__typ = W__typ; - _s.lnk = WriteDate__48_s; - WriteDate__48_s = &_s; - WritePair__49(' ', __MASK(d, -32)); - WritePair__49('.', __MASK(__ASHR(d, 5), -16)); - WritePair__49('.', __MASK(__ASHR(d, 9), -128)); - WritePair__49(' ', __MASK(__ASHR(t, 12), -32)); - WritePair__49(':', __MASK(__ASHR(t, 6), -64)); - WritePair__49(':', __MASK(t, -64)); - WriteDate__48_s = _s.lnk; + _s.lnk = WriteDate__47_s; + WriteDate__47_s = &_s; + WritePair__48(' ', __MASK(d, -32)); + WritePair__48('.', __MASK(__ASHR(d, 5), -16)); + WritePair__48('.', __MASK(__ASHR(d, 9), -128)); + WritePair__48(' ', __MASK(__ASHR(t, 12), -32)); + WritePair__48(':', __MASK(__ASHR(t, 6), -64)); + WritePair__48(':', __MASK(t, -64)); + WriteDate__47_s = _s.lnk; } -static struct Load0__21 { +static struct Load0__20 { Texts_Text *T; INT8 *ecnt; Files_File *f; Texts_FileMsg *msg; CHAR (*mods)[64][32], (*procs)[64][32]; - struct Load0__21 *lnk; -} *Load0__21_s; + struct Load0__20 *lnk; +} *Load0__20_s; -static void LoadElem__22 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e); +static void LoadElem__21 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e); -static void LoadElem__22 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e) +static void LoadElem__21 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e) { Modules_Module M = NIL; Modules_Command Cmd; @@ -1559,15 +1544,15 @@ static void LoadElem__22 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span Files_ReadLInt(&*r, r__typ, &ew); Files_ReadLInt(&*r, r__typ, &eh); Files_Read(&*r, r__typ, (void*)&eno); - if (eno > *Load0__21_s->ecnt) { - *Load0__21_s->ecnt = eno; - Files_ReadString(&*r, r__typ, (void*)(*Load0__21_s->mods)[__X(eno, 64)], 32); - Files_ReadString(&*r, r__typ, (void*)(*Load0__21_s->procs)[__X(eno, 64)], 32); + if (eno > *Load0__20_s->ecnt) { + *Load0__20_s->ecnt = eno; + Files_ReadString(&*r, r__typ, (void*)(*Load0__20_s->mods)[__X(eno, 64)], 32); + Files_ReadString(&*r, r__typ, (void*)(*Load0__20_s->procs)[__X(eno, 64)], 32); } org = Files_Pos(&*r, r__typ); - M = Modules_ThisMod((*Load0__21_s->mods)[__X(eno, 64)], 32); + M = Modules_ThisMod((*Load0__20_s->mods)[__X(eno, 64)], 32); if (M != NIL) { - Cmd = Modules_ThisCommand(M, (*Load0__21_s->procs)[__X(eno, 64)], 32); + Cmd = Modules_ThisCommand(M, (*Load0__20_s->procs)[__X(eno, 64)], 32); if (Cmd != NIL) { (*Cmd)(); } @@ -1576,25 +1561,25 @@ static void LoadElem__22 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span if (*e != NIL) { (*e)->W = ew; (*e)->H = eh; - (*e)->base = *Load0__21_s->T; - (*Load0__21_s->msg).pos = pos; - (*(*e)->handle)(*e, (void*)&*Load0__21_s->msg, Texts_FileMsg__typ); + (*e)->base = *Load0__20_s->T; + (*Load0__20_s->msg).pos = pos; + (*(*e)->handle)(*e, (void*)&*Load0__20_s->msg, Texts_FileMsg__typ); if (Files_Pos(&*r, r__typ) != org + span) { *e = NIL; } } if (*e == NIL) { - Files_Set(&*r, r__typ, *Load0__21_s->f, org + span); + Files_Set(&*r, r__typ, *Load0__20_s->f, org + span); __NEW(a, Texts__1); a->W = ew; a->H = eh; a->handle = Texts_HandleAlien; - a->base = *Load0__21_s->T; - a->file = *Load0__21_s->f; + a->base = *Load0__20_s->T; + a->file = *Load0__20_s->f; a->org = org; a->span = span; - __COPY((*Load0__21_s->mods)[__X(eno, 64)], a->mod, 32); - __COPY((*Load0__21_s->procs)[__X(eno, 64)], a->proc, 32); + __COPY((*Load0__20_s->mods)[__X(eno, 64)], a->mod, 32); + __COPY((*Load0__20_s->procs)[__X(eno, 64)], a->proc, 32); *e = (Texts_Elem)a; } } @@ -1611,15 +1596,15 @@ static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) CHAR mods[64][32], procs[64][32]; CHAR name[32]; Texts_FontsFont fnts[32]; - struct Load0__21 _s; + struct Load0__20 _s; _s.T = &T; _s.ecnt = &ecnt; _s.f = &f; _s.msg = &msg; _s.mods = (void*)mods; _s.procs = (void*)procs; - _s.lnk = Load0__21_s; - Load0__21_s = &_s; + _s.lnk = Load0__20_s; + Load0__20_s = &_s; pos = Files_Pos(&*r, r__typ); f = Files_Base(&*r, r__typ); __NEW(u, Texts_RunDesc); @@ -1652,7 +1637,7 @@ static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) un = (Texts_Run)p; un->len = plen; } else { - LoadElem__22(&msg.r, Files_Rider__typ, pos - org, -plen, &e); + LoadElem__21(&msg.r, Files_Rider__typ, pos - org, -plen, &e); un = (Texts_Run)e; un->len = 1; } @@ -1670,7 +1655,7 @@ static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) T->corg = 0; Files_ReadLInt(&msg.r, Files_Rider__typ, &T->len); Files_Set(&*r, r__typ, f, Files_Pos(&msg.r, Files_Rider__typ) + T->len); - Load0__21_s = _s.lnk; + Load0__20_s = _s.lnk; } void Texts_Load (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) @@ -1739,25 +1724,25 @@ void Texts_Open (Texts_Text T, CHAR *name, ADDRESS name__len) __DEL(name); } -static struct Store__44 { +static struct Store__43 { INT8 *ecnt; Texts_FileMsg *msg; Texts_IdentifyMsg *iden; CHAR (*mods)[64][32], (*procs)[64][32]; - struct Store__44 *lnk; -} *Store__44_s; + struct Store__43 *lnk; +} *Store__43_s; -static void StoreElem__45 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e); +static void StoreElem__44 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e); -static void StoreElem__45 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e) +static void StoreElem__44 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e) { Files_Rider r1; INT32 org, span; INT8 eno; - __COPY((*Store__44_s->iden).mod, (*Store__44_s->mods)[__X(*Store__44_s->ecnt, 64)], 32); - __COPY((*Store__44_s->iden).proc, (*Store__44_s->procs)[__X(*Store__44_s->ecnt, 64)], 32); + __COPY((*Store__43_s->iden).mod, (*Store__43_s->mods)[__X(*Store__43_s->ecnt, 64)], 32); + __COPY((*Store__43_s->iden).proc, (*Store__43_s->procs)[__X(*Store__43_s->ecnt, 64)], 32); eno = 1; - while (__STRCMP((*Store__44_s->mods)[__X(eno, 64)], (*Store__44_s->iden).mod) != 0 || __STRCMP((*Store__44_s->procs)[__X(eno, 64)], (*Store__44_s->iden).proc) != 0) { + while (__STRCMP((*Store__43_s->mods)[__X(eno, 64)], (*Store__43_s->iden).mod) != 0 || __STRCMP((*Store__43_s->procs)[__X(eno, 64)], (*Store__43_s->iden).proc) != 0) { eno += 1; } Files_Set(&r1, Files_Rider__typ, Files_Base(&*r, r__typ), Files_Pos(&*r, r__typ)); @@ -1765,14 +1750,14 @@ static void StoreElem__45 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Ele Files_WriteLInt(&*r, r__typ, 0); Files_WriteLInt(&*r, r__typ, 0); Files_Write(&*r, r__typ, eno); - if (eno == *Store__44_s->ecnt) { - *Store__44_s->ecnt += 1; - Files_WriteString(&*r, r__typ, (*Store__44_s->iden).mod, 32); - Files_WriteString(&*r, r__typ, (*Store__44_s->iden).proc, 32); + if (eno == *Store__43_s->ecnt) { + *Store__43_s->ecnt += 1; + Files_WriteString(&*r, r__typ, (*Store__43_s->iden).mod, 32); + Files_WriteString(&*r, r__typ, (*Store__43_s->iden).proc, 32); } - (*Store__44_s->msg).pos = pos; + (*Store__43_s->msg).pos = pos; org = Files_Pos(&*r, r__typ); - (*e->handle)(e, (void*)&*Store__44_s->msg, Texts_FileMsg__typ); + (*e->handle)(e, (void*)&*Store__43_s->msg, Texts_FileMsg__typ); span = Files_Pos(&*r, r__typ) - org; Files_WriteLInt(&r1, Files_Rider__typ, -span); Files_WriteLInt(&r1, Files_Rider__typ, e->W); @@ -1793,14 +1778,14 @@ void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) CHAR mods[64][32], procs[64][32]; Texts_FontsFont fnts[32]; CHAR block[1024]; - struct Store__44 _s; + struct Store__43 _s; _s.ecnt = &ecnt; _s.msg = &msg; _s.iden = &iden; _s.mods = (void*)mods; _s.procs = (void*)procs; - _s.lnk = Store__44_s; - Store__44_s = &_s; + _s.lnk = Store__43_s; + Store__43_s = &_s; org = Files_Pos(&*r, r__typ); msg.id = 1; msg.r = *r; @@ -1842,7 +1827,7 @@ void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) pos += rlen; u = un; } else if (iden.mod[0] != 0x00) { - StoreElem__45(&msg.r, Files_Rider__typ, pos, __GUARDP(u, Texts_ElemDesc, 1)); + StoreElem__44(&msg.r, Files_Rider__typ, pos, __GUARDP(u, Texts_ElemDesc, 1)); pos += 1; u = u->next; } else { @@ -1896,7 +1881,7 @@ void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) if (T->notify != NIL) { (*T->notify)(T, 3, 0, 0); } - Store__44_s = _s.lnk; + Store__43_s = _s.lnk; } void Texts_Close (Texts_Text T, CHAR *name, ADDRESS name__len) diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index dc149133..c7c8d20f 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/VT100.c b/bootstrap/windows-48/VT100.c index 669a337a..9ab993c9 100644 --- a/bootstrap/windows-48/VT100.c +++ b/bootstrap/windows-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/VT100.h b/bootstrap/windows-48/VT100.h index 809a6082..3de3605c 100644 --- a/bootstrap/windows-48/VT100.h +++ b/bootstrap/windows-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index b9ca8d5a..213abf27 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index 6a31ee74..4278a34c 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/Compiler.c b/bootstrap/windows-88/Compiler.c index 3b84a5bd..ffd8b03e 100644 --- a/bootstrap/windows-88/Compiler.c +++ b/bootstrap/windows-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index 319659fe..6db13d09 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index d438eca9..4259cfef 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 1f47f261..072b15ba 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -70,6 +70,9 @@ static void Files_CloseOSFile (Files_File f); static void Files_Create (Files_File f); export void Files_Delete (CHAR *name, ADDRESS name__len, INT16 *res); static void Files_Deregister (CHAR *name, ADDRESS name__len); +export void Files_DumpBuffer (Files_Buffer b, INT16 indent); +export void Files_DumpFile (Files_File f, INT16 indent); +export void Files_DumpRider (Files_Rider r, INT16 indent); static void Files_Err (CHAR *s, ADDRESS s__len, Files_File f, INT16 errcode); static void Files_Finalize (SYSTEM_PTR o); static void Files_FlipBytes (SYSTEM_BYTE *src, ADDRESS src__len, SYSTEM_BYTE *dest, ADDRESS dest__len); @@ -100,6 +103,7 @@ export void Files_Rename (CHAR *old, ADDRESS old__len, CHAR *new, ADDRESS new__l static void Files_ScanPath (INT16 *pos, CHAR *dir, ADDRESS dir__len); export void Files_Set (Files_Rider *r, ADDRESS *r__typ, Files_File f, INT32 pos); export void Files_SetSearchPath (CHAR *path, ADDRESS path__len); +static void Files_Spaces (INT16 i); export void Files_Write (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE x); export void Files_WriteBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN x); export void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS x__len, INT32 n); @@ -112,7 +116,132 @@ export void Files_WriteSet (Files_Rider *R, ADDRESS *R__typ, UINT32 x); export void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, ADDRESS x__len); #define Files_IdxTrap() __HALT(-1) -#define Files_ToAdr(x) (ADDRESS)x + +static void Files_Spaces (INT16 i) +{ + while (i > 0) { + Out_String((CHAR*)" ", 3); + i -= 1; + } +} + +void Files_DumpFile (Files_File f, INT16 indent) +{ + Files_Spaces(indent); + Out_String((CHAR*)"workName: ", 15); + Out_String(f->workName, 101); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"registerName: ", 15); + Out_String(f->registerName, 101); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"tempFile: ", 15); + if (f->tempFile) { + Out_String((CHAR*)"TRUE", 5); + } else { + Out_String((CHAR*)"FALSE", 6); + } + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"identity: ", 15); + Out_String((CHAR*)"...", 4); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"fd: ", 15); + Out_Int(f->fd, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"len, ", 15); + Out_Int(f->len, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"pos: ", 15); + Out_Int(f->pos, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"bufs: ", 15); + Out_String((CHAR*)"...", 4); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"swapper: ", 15); + Out_Int(f->swapper, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"state: ", 15); + Out_Int(f->state, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"next: ", 15); + Out_Int((INT64)(ADDRESS)f->next, 1); + Out_Ln(); +} + +void Files_DumpBuffer (Files_Buffer b, INT16 indent) +{ + Files_Spaces(indent); + Out_String((CHAR*)"chg: ", 7); + if (b->chg) { + Out_String((CHAR*)"TRUE", 5); + } else { + Out_String((CHAR*)"FALSE", 6); + } + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"org: ", 7); + Out_Int(b->org, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"size: ", 7); + Out_Int(b->size, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"data: ", 7); + Out_String((CHAR*)"...", 4); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"f: ", 7); + if (b->f == NIL) { + Out_String((CHAR*)"", 6); + Out_Ln(); + } else { + Out_Ln(); + Files_DumpFile(b->f, indent + 1); + } +} + +void Files_DumpRider (Files_Rider r, INT16 indent) +{ + Files_Spaces(indent); + Out_String((CHAR*)"res: ", 9); + Out_Int(r.res, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"eof: ", 9); + if (r.eof) { + Out_String((CHAR*)"TRUE", 5); + } else { + Out_String((CHAR*)"FALSE", 6); + } + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"org: ", 9); + Out_Int(r.org, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"offset: ", 9); + Out_Int(r.offset, 1); + Out_Ln(); + Files_Spaces(indent); + Out_String((CHAR*)"buf: ", 9); + if (r.buf == NIL) { + Out_String((CHAR*)"", 6); + Out_Ln(); + } else { + Out_Ln(); + Files_DumpBuffer(r.buf, indent + 1); + } +} static void Files_Assert (BOOLEAN truth) { @@ -662,7 +791,7 @@ void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS x } else { min = n; } - __MOVE((ADDRESS)buf->data + Files_ToAdr(offset), (ADDRESS)x + Files_ToAdr(xpos), min); + __MOVE((ADDRESS)&buf->data[offset], (ADDRESS)&x[xpos], min); offset += min; (*r).offset = offset; xpos += min; @@ -725,7 +854,7 @@ void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS } else { min = n; } - __MOVE((ADDRESS)x + Files_ToAdr(xpos), (ADDRESS)buf->data + Files_ToAdr(offset), min); + __MOVE((ADDRESS)&x[xpos], (ADDRESS)&buf->data[offset], min); offset += min; (*r).offset = offset; Files_Assert(offset <= 4096); diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 683cb78a..49df83be 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,10 +1,19 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h #include "SYSTEM.h" +typedef + struct Files_BufDesc { + INT64 _prvt0; + char _prvt1[4108]; + } Files_BufDesc; + +typedef + Files_BufDesc *Files_Buffer; + typedef struct Files_FileDesc *Files_File; @@ -25,12 +34,16 @@ typedef import ADDRESS *Files_FileDesc__typ; +import ADDRESS *Files_BufDesc__typ; import ADDRESS *Files_Rider__typ; import Files_File Files_Base (Files_Rider *r, ADDRESS *r__typ); import void Files_ChangeDirectory (CHAR *path, ADDRESS path__len, INT16 *res); import void Files_Close (Files_File f); import void Files_Delete (CHAR *name, ADDRESS name__len, INT16 *res); +import void Files_DumpBuffer (Files_Buffer b, INT16 indent); +import void Files_DumpFile (Files_File f, INT16 indent); +import void Files_DumpRider (Files_Rider r, INT16 indent); import void Files_GetDate (Files_File f, INT32 *t, INT32 *d); import void Files_GetName (Files_File f, CHAR *name, ADDRESS name__len); import INT32 Files_Length (Files_File f); diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index 79d83cee..4554feac 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index 29a878c2..0fb80f05 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 83b46a4a..37cfa0cd 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index 162947ee..3ee70401 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index a7d429eb..d83386eb 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index a49077b0..feb85d73 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index 89ef22dc..ab01642c 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index b30a2315..f742f265 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 5b3cc3c5..1335c494 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index d1c71f13..621dfb51 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index a529c16e..3f9dfde3 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index c82b4d80..c1fe21fb 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index a3b32b0c..4569c80d 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index 99c62664..c0707c34 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index 0bca4ab5..07f8f535 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 1aec7cad..6b2b0929 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 097c0a7c..4506267a 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index 9ad5508d..d363f022 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Out.c b/bootstrap/windows-88/Out.c index 1f466dc9..52896b61 100644 --- a/bootstrap/windows-88/Out.c +++ b/bootstrap/windows-88/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Out.h b/bootstrap/windows-88/Out.h index a3f5db4d..8c7a5774 100644 --- a/bootstrap/windows-88/Out.h +++ b/bootstrap/windows-88/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 7a37d42c..44691d4d 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index 369ea02a..751980ad 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 8ba81525..f5ee1490 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index 0fe868e0..6d0ec38b 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index a6a802c4..4ee2fc23 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index bec035c4..ae281477 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index eba58f8f..1afb5eba 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -194,7 +194,6 @@ export void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); export void Texts_Delete (Texts_Text T, INT32 beg, INT32 end); static void Texts_DumpElem (Texts_Elem e); export void Texts_DumpReader (Texts_Reader re); -static void Texts_DumpRider (Files_Rider ri); static void Texts_DumpRun (Texts_Run ru); static void Texts_DumpText (Texts_Text t); export Texts_Text Texts_ElemBase (Texts_Elem E); @@ -278,20 +277,6 @@ static void Texts_DumpElem (Texts_Elem e) } } -static void Texts_DumpRider (Files_Rider ri) -{ - Out_String((CHAR*)" res: ", 10); - Out_Int(ri.res, 1); - Out_Ln(); - Out_String((CHAR*)" eof: ", 10); - if (ri.eof) { - Out_String((CHAR*)"TRUE", 5); - } else { - Out_String((CHAR*)"FALSE", 6); - } - Out_Ln(); -} - static void Texts_DumpRun (Texts_Run ru) { Out_String((CHAR*)" prev: ", 12); @@ -365,7 +350,7 @@ void Texts_DumpReader (Texts_Reader re) } Out_String((CHAR*)" rider: ", 10); Out_Ln(); - Texts_DumpRider(re.rider); + Files_DumpRider(re.rider, 2); Out_String((CHAR*)" run: ", 10); if (re.run == NIL) { Out_String((CHAR*)"", 6); @@ -860,32 +845,32 @@ void Texts_OpenScanner (Texts_Scanner *S, ADDRESS *S__typ, Texts_Text T, INT32 p (*S).nextCh = ' '; } -static struct Scan__36 { +static struct Scan__35 { Texts_Scanner *S; ADDRESS *S__typ; CHAR *ch; BOOLEAN *negE; INT16 *e; - struct Scan__36 *lnk; -} *Scan__36_s; + struct Scan__35 *lnk; +} *Scan__35_s; -static void ReadScaleFactor__37 (void); +static void ReadScaleFactor__36 (void); -static void ReadScaleFactor__37 (void) +static void ReadScaleFactor__36 (void) { - Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); - if (*Scan__36_s->ch == '-') { - *Scan__36_s->negE = 1; - Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); + Texts_Read((void*)&*Scan__35_s->S, Scan__35_s->S__typ, &*Scan__35_s->ch); + if (*Scan__35_s->ch == '-') { + *Scan__35_s->negE = 1; + Texts_Read((void*)&*Scan__35_s->S, Scan__35_s->S__typ, &*Scan__35_s->ch); } else { - *Scan__36_s->negE = 0; - if (*Scan__36_s->ch == '+') { - Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); + *Scan__35_s->negE = 0; + if (*Scan__35_s->ch == '+') { + Texts_Read((void*)&*Scan__35_s->S, Scan__35_s->S__typ, &*Scan__35_s->ch); } } - while (('0' <= *Scan__36_s->ch && *Scan__36_s->ch <= '9')) { - *Scan__36_s->e = (*Scan__36_s->e * 10 + (INT16)*Scan__36_s->ch) - 48; - Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); + while (('0' <= *Scan__35_s->ch && *Scan__35_s->ch <= '9')) { + *Scan__35_s->e = (*Scan__35_s->e * 10 + (INT16)*Scan__35_s->ch) - 48; + Texts_Read((void*)&*Scan__35_s->S, Scan__35_s->S__typ, &*Scan__35_s->ch); } } @@ -899,13 +884,13 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) REAL x, f; LONGREAL y, g; CHAR d[32]; - struct Scan__36 _s; + struct Scan__35 _s; _s.S = S; _s.S__typ = S__typ; _s.ch = &ch; _s.negE = &negE; _s.e = &e; - _s.lnk = Scan__36_s; - Scan__36_s = &_s; + _s.lnk = Scan__35_s; + Scan__35_s = &_s; ch = (*S).nextCh; i = 0; for (;;) { @@ -1006,7 +991,7 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) y = ((INT16)d[__X(j, 32)] - 48) * g + y; j += 1; } - ReadScaleFactor__37(); + ReadScaleFactor__36(); if (negE) { if (e <= 308) { y = y / (LONGREAL)Reals_TenL(e); @@ -1039,7 +1024,7 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) j += 1; } if (ch == 'E') { - ReadScaleFactor__37(); + ReadScaleFactor__36(); } if (negE) { if (e <= 38) { @@ -1092,7 +1077,7 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) } } (*S).nextCh = ch; - Scan__36_s = _s.lnk; + Scan__35_s = _s.lnk; } void Texts_OpenWriter (Texts_Writer *W, ADDRESS *W__typ) @@ -1311,30 +1296,30 @@ void Texts_WriteReal (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n) } } -static struct WriteRealFix__58 { +static struct WriteRealFix__57 { Texts_Writer *W; ADDRESS *W__typ; INT16 *i; CHAR (*d)[9]; - struct WriteRealFix__58 *lnk; -} *WriteRealFix__58_s; + struct WriteRealFix__57 *lnk; +} *WriteRealFix__57_s; -static void dig__59 (INT16 n); -static void seq__61 (CHAR ch, INT16 n); +static void dig__58 (INT16 n); +static void seq__60 (CHAR ch, INT16 n); -static void seq__61 (CHAR ch, INT16 n) +static void seq__60 (CHAR ch, INT16 n) { while (n > 0) { - Texts_Write(&*WriteRealFix__58_s->W, WriteRealFix__58_s->W__typ, ch); + Texts_Write(&*WriteRealFix__57_s->W, WriteRealFix__57_s->W__typ, ch); n -= 1; } } -static void dig__59 (INT16 n) +static void dig__58 (INT16 n) { while (n > 0) { - *WriteRealFix__58_s->i -= 1; - Texts_Write(&*WriteRealFix__58_s->W, WriteRealFix__58_s->W__typ, (*WriteRealFix__58_s->d)[__X(*WriteRealFix__58_s->i, 9)]); + *WriteRealFix__57_s->i -= 1; + Texts_Write(&*WriteRealFix__57_s->W, WriteRealFix__57_s->W__typ, (*WriteRealFix__57_s->d)[__X(*WriteRealFix__57_s->i, 9)]); n -= 1; } } @@ -1345,23 +1330,23 @@ void Texts_WriteRealFix (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n, INT1 CHAR sign; REAL x0; CHAR d[9]; - struct WriteRealFix__58 _s; + struct WriteRealFix__57 _s; _s.W = W; _s.W__typ = W__typ; _s.i = &i; _s.d = (void*)d; - _s.lnk = WriteRealFix__58_s; - WriteRealFix__58_s = &_s; + _s.lnk = WriteRealFix__57_s; + WriteRealFix__57_s = &_s; e = Reals_Expo(x); if (k < 0) { k = 0; } if (e == 0) { - seq__61(' ', (n - k) - 2); + seq__60(' ', (n - k) - 2); Texts_Write(&*W, W__typ, '0'); - seq__61(' ', k + 1); + seq__60(' ', k + 1); } else if (e == 255) { Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", 5); - seq__61(' ', n - 4); + seq__60(' ', n - 4); } else { e = __ASHR((e - 127) * 77, 8); if (x < (REAL)0) { @@ -1394,21 +1379,21 @@ void Texts_WriteRealFix (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n, INT1 i = k + e; Reals_Convert(x, i, (void*)d, 9); if (e > 0) { - seq__61(' ', ((n - e) - k) - 2); + seq__60(' ', ((n - e) - k) - 2); Texts_Write(&*W, W__typ, sign); - dig__59(e); + dig__58(e); Texts_Write(&*W, W__typ, '.'); - dig__59(k); + dig__58(k); } else { - seq__61(' ', (n - k) - 3); + seq__60(' ', (n - k) - 3); Texts_Write(&*W, W__typ, sign); Texts_Write(&*W, W__typ, '0'); Texts_Write(&*W, W__typ, '.'); - seq__61('0', -e); - dig__59(k + e); + seq__60('0', -e); + dig__58(k + e); } } - WriteRealFix__58_s = _s.lnk; + WriteRealFix__57_s = _s.lnk; } void Texts_WriteRealHex (Texts_Writer *W, ADDRESS *W__typ, REAL x) @@ -1507,48 +1492,48 @@ void Texts_WriteLongRealHex (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x) } while (!(i == 16)); } -static struct WriteDate__48 { +static struct WriteDate__47 { Texts_Writer *W; ADDRESS *W__typ; - struct WriteDate__48 *lnk; -} *WriteDate__48_s; + struct WriteDate__47 *lnk; +} *WriteDate__47_s; -static void WritePair__49 (CHAR ch, INT32 x); +static void WritePair__48 (CHAR ch, INT32 x); -static void WritePair__49 (CHAR ch, INT32 x) +static void WritePair__48 (CHAR ch, INT32 x) { - Texts_Write(&*WriteDate__48_s->W, WriteDate__48_s->W__typ, ch); - Texts_Write(&*WriteDate__48_s->W, WriteDate__48_s->W__typ, (CHAR)(__DIV(x, 10) + 48)); - Texts_Write(&*WriteDate__48_s->W, WriteDate__48_s->W__typ, (CHAR)((int)__MOD(x, 10) + 48)); + Texts_Write(&*WriteDate__47_s->W, WriteDate__47_s->W__typ, ch); + Texts_Write(&*WriteDate__47_s->W, WriteDate__47_s->W__typ, (CHAR)(__DIV(x, 10) + 48)); + Texts_Write(&*WriteDate__47_s->W, WriteDate__47_s->W__typ, (CHAR)((int)__MOD(x, 10) + 48)); } void Texts_WriteDate (Texts_Writer *W, ADDRESS *W__typ, INT32 t, INT32 d) { - struct WriteDate__48 _s; + struct WriteDate__47 _s; _s.W = W; _s.W__typ = W__typ; - _s.lnk = WriteDate__48_s; - WriteDate__48_s = &_s; - WritePair__49(' ', __MASK(d, -32)); - WritePair__49('.', __MASK(__ASHR(d, 5), -16)); - WritePair__49('.', __MASK(__ASHR(d, 9), -128)); - WritePair__49(' ', __MASK(__ASHR(t, 12), -32)); - WritePair__49(':', __MASK(__ASHR(t, 6), -64)); - WritePair__49(':', __MASK(t, -64)); - WriteDate__48_s = _s.lnk; + _s.lnk = WriteDate__47_s; + WriteDate__47_s = &_s; + WritePair__48(' ', __MASK(d, -32)); + WritePair__48('.', __MASK(__ASHR(d, 5), -16)); + WritePair__48('.', __MASK(__ASHR(d, 9), -128)); + WritePair__48(' ', __MASK(__ASHR(t, 12), -32)); + WritePair__48(':', __MASK(__ASHR(t, 6), -64)); + WritePair__48(':', __MASK(t, -64)); + WriteDate__47_s = _s.lnk; } -static struct Load0__21 { +static struct Load0__20 { Texts_Text *T; INT8 *ecnt; Files_File *f; Texts_FileMsg *msg; CHAR (*mods)[64][32], (*procs)[64][32]; - struct Load0__21 *lnk; -} *Load0__21_s; + struct Load0__20 *lnk; +} *Load0__20_s; -static void LoadElem__22 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e); +static void LoadElem__21 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e); -static void LoadElem__22 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e) +static void LoadElem__21 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e) { Modules_Module M = NIL; Modules_Command Cmd; @@ -1559,15 +1544,15 @@ static void LoadElem__22 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span Files_ReadLInt(&*r, r__typ, &ew); Files_ReadLInt(&*r, r__typ, &eh); Files_Read(&*r, r__typ, (void*)&eno); - if (eno > *Load0__21_s->ecnt) { - *Load0__21_s->ecnt = eno; - Files_ReadString(&*r, r__typ, (void*)(*Load0__21_s->mods)[__X(eno, 64)], 32); - Files_ReadString(&*r, r__typ, (void*)(*Load0__21_s->procs)[__X(eno, 64)], 32); + if (eno > *Load0__20_s->ecnt) { + *Load0__20_s->ecnt = eno; + Files_ReadString(&*r, r__typ, (void*)(*Load0__20_s->mods)[__X(eno, 64)], 32); + Files_ReadString(&*r, r__typ, (void*)(*Load0__20_s->procs)[__X(eno, 64)], 32); } org = Files_Pos(&*r, r__typ); - M = Modules_ThisMod((*Load0__21_s->mods)[__X(eno, 64)], 32); + M = Modules_ThisMod((*Load0__20_s->mods)[__X(eno, 64)], 32); if (M != NIL) { - Cmd = Modules_ThisCommand(M, (*Load0__21_s->procs)[__X(eno, 64)], 32); + Cmd = Modules_ThisCommand(M, (*Load0__20_s->procs)[__X(eno, 64)], 32); if (Cmd != NIL) { (*Cmd)(); } @@ -1576,25 +1561,25 @@ static void LoadElem__22 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span if (*e != NIL) { (*e)->W = ew; (*e)->H = eh; - (*e)->base = *Load0__21_s->T; - (*Load0__21_s->msg).pos = pos; - (*(*e)->handle)(*e, (void*)&*Load0__21_s->msg, Texts_FileMsg__typ); + (*e)->base = *Load0__20_s->T; + (*Load0__20_s->msg).pos = pos; + (*(*e)->handle)(*e, (void*)&*Load0__20_s->msg, Texts_FileMsg__typ); if (Files_Pos(&*r, r__typ) != org + span) { *e = NIL; } } if (*e == NIL) { - Files_Set(&*r, r__typ, *Load0__21_s->f, org + span); + Files_Set(&*r, r__typ, *Load0__20_s->f, org + span); __NEW(a, Texts__1); a->W = ew; a->H = eh; a->handle = Texts_HandleAlien; - a->base = *Load0__21_s->T; - a->file = *Load0__21_s->f; + a->base = *Load0__20_s->T; + a->file = *Load0__20_s->f; a->org = org; a->span = span; - __COPY((*Load0__21_s->mods)[__X(eno, 64)], a->mod, 32); - __COPY((*Load0__21_s->procs)[__X(eno, 64)], a->proc, 32); + __COPY((*Load0__20_s->mods)[__X(eno, 64)], a->mod, 32); + __COPY((*Load0__20_s->procs)[__X(eno, 64)], a->proc, 32); *e = (Texts_Elem)a; } } @@ -1611,15 +1596,15 @@ static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) CHAR mods[64][32], procs[64][32]; CHAR name[32]; Texts_FontsFont fnts[32]; - struct Load0__21 _s; + struct Load0__20 _s; _s.T = &T; _s.ecnt = &ecnt; _s.f = &f; _s.msg = &msg; _s.mods = (void*)mods; _s.procs = (void*)procs; - _s.lnk = Load0__21_s; - Load0__21_s = &_s; + _s.lnk = Load0__20_s; + Load0__20_s = &_s; pos = Files_Pos(&*r, r__typ); f = Files_Base(&*r, r__typ); __NEW(u, Texts_RunDesc); @@ -1652,7 +1637,7 @@ static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) un = (Texts_Run)p; un->len = plen; } else { - LoadElem__22(&msg.r, Files_Rider__typ, pos - org, -plen, &e); + LoadElem__21(&msg.r, Files_Rider__typ, pos - org, -plen, &e); un = (Texts_Run)e; un->len = 1; } @@ -1670,7 +1655,7 @@ static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) T->corg = 0; Files_ReadLInt(&msg.r, Files_Rider__typ, &T->len); Files_Set(&*r, r__typ, f, Files_Pos(&msg.r, Files_Rider__typ) + T->len); - Load0__21_s = _s.lnk; + Load0__20_s = _s.lnk; } void Texts_Load (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) @@ -1739,25 +1724,25 @@ void Texts_Open (Texts_Text T, CHAR *name, ADDRESS name__len) __DEL(name); } -static struct Store__44 { +static struct Store__43 { INT8 *ecnt; Texts_FileMsg *msg; Texts_IdentifyMsg *iden; CHAR (*mods)[64][32], (*procs)[64][32]; - struct Store__44 *lnk; -} *Store__44_s; + struct Store__43 *lnk; +} *Store__43_s; -static void StoreElem__45 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e); +static void StoreElem__44 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e); -static void StoreElem__45 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e) +static void StoreElem__44 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e) { Files_Rider r1; INT32 org, span; INT8 eno; - __COPY((*Store__44_s->iden).mod, (*Store__44_s->mods)[__X(*Store__44_s->ecnt, 64)], 32); - __COPY((*Store__44_s->iden).proc, (*Store__44_s->procs)[__X(*Store__44_s->ecnt, 64)], 32); + __COPY((*Store__43_s->iden).mod, (*Store__43_s->mods)[__X(*Store__43_s->ecnt, 64)], 32); + __COPY((*Store__43_s->iden).proc, (*Store__43_s->procs)[__X(*Store__43_s->ecnt, 64)], 32); eno = 1; - while (__STRCMP((*Store__44_s->mods)[__X(eno, 64)], (*Store__44_s->iden).mod) != 0 || __STRCMP((*Store__44_s->procs)[__X(eno, 64)], (*Store__44_s->iden).proc) != 0) { + while (__STRCMP((*Store__43_s->mods)[__X(eno, 64)], (*Store__43_s->iden).mod) != 0 || __STRCMP((*Store__43_s->procs)[__X(eno, 64)], (*Store__43_s->iden).proc) != 0) { eno += 1; } Files_Set(&r1, Files_Rider__typ, Files_Base(&*r, r__typ), Files_Pos(&*r, r__typ)); @@ -1765,14 +1750,14 @@ static void StoreElem__45 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Ele Files_WriteLInt(&*r, r__typ, 0); Files_WriteLInt(&*r, r__typ, 0); Files_Write(&*r, r__typ, eno); - if (eno == *Store__44_s->ecnt) { - *Store__44_s->ecnt += 1; - Files_WriteString(&*r, r__typ, (*Store__44_s->iden).mod, 32); - Files_WriteString(&*r, r__typ, (*Store__44_s->iden).proc, 32); + if (eno == *Store__43_s->ecnt) { + *Store__43_s->ecnt += 1; + Files_WriteString(&*r, r__typ, (*Store__43_s->iden).mod, 32); + Files_WriteString(&*r, r__typ, (*Store__43_s->iden).proc, 32); } - (*Store__44_s->msg).pos = pos; + (*Store__43_s->msg).pos = pos; org = Files_Pos(&*r, r__typ); - (*e->handle)(e, (void*)&*Store__44_s->msg, Texts_FileMsg__typ); + (*e->handle)(e, (void*)&*Store__43_s->msg, Texts_FileMsg__typ); span = Files_Pos(&*r, r__typ) - org; Files_WriteLInt(&r1, Files_Rider__typ, -span); Files_WriteLInt(&r1, Files_Rider__typ, e->W); @@ -1793,14 +1778,14 @@ void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) CHAR mods[64][32], procs[64][32]; Texts_FontsFont fnts[32]; CHAR block[1024]; - struct Store__44 _s; + struct Store__43 _s; _s.ecnt = &ecnt; _s.msg = &msg; _s.iden = &iden; _s.mods = (void*)mods; _s.procs = (void*)procs; - _s.lnk = Store__44_s; - Store__44_s = &_s; + _s.lnk = Store__43_s; + Store__43_s = &_s; org = Files_Pos(&*r, r__typ); msg.id = 1; msg.r = *r; @@ -1842,7 +1827,7 @@ void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) pos += rlen; u = un; } else if (iden.mod[0] != 0x00) { - StoreElem__45(&msg.r, Files_Rider__typ, pos, __GUARDP(u, Texts_ElemDesc, 1)); + StoreElem__44(&msg.r, Files_Rider__typ, pos, __GUARDP(u, Texts_ElemDesc, 1)); pos += 1; u = u->next; } else { @@ -1896,7 +1881,7 @@ void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) if (T->notify != NIL) { (*T->notify)(T, 3, 0, 0); } - Store__44_s = _s.lnk; + Store__43_s = _s.lnk; } void Texts_Close (Texts_Text T, CHAR *name, ADDRESS name__len) diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index 55558804..e14afb26 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/VT100.c b/bootstrap/windows-88/VT100.c index 669a337a..9ab993c9 100644 --- a/bootstrap/windows-88/VT100.c +++ b/bootstrap/windows-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/VT100.h b/bootstrap/windows-88/VT100.h index 809a6082..3de3605c 100644 --- a/bootstrap/windows-88/VT100.h +++ b/bootstrap/windows-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index b9ca8d5a..213abf27 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index 6a31ee74..4278a34c 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h From a2d98748b60170281c618c576f2310f414f1369f Mon Sep 17 00:00:00 2001 From: David Brown Date: Sun, 11 Dec 2016 17:18:24 +0000 Subject: [PATCH 412/580] Add hex and hexdump to Out.Mod, more debugging for OpenBSD. --- src/runtime/Files.Mod | 4 ++-- src/runtime/Out.Mod | 41 +++++++++++++++++++++++++++++++++++++++++ src/runtime/Texts.Mod | 13 +++++++------ 3 files changed, 50 insertions(+), 8 deletions(-) diff --git a/src/runtime/Files.Mod b/src/runtime/Files.Mod index 9caa22a9..76fbdf77 100644 --- a/src/runtime/Files.Mod +++ b/src/runtime/Files.Mod @@ -86,7 +86,7 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files Spaces(indent); Out.String("bufs: "); Out.String("..."); Out.Ln; (* TBD *) Spaces(indent); Out.String("swapper: "); Out.Int(f.swapper,1); Out.Ln; Spaces(indent); Out.String("state: "); Out.Int(f.state,1); Out.Ln; - Spaces(indent); Out.String("next: "); Out.Int(SYSTEM.VAL(SYSTEM.ADDRESS,f.next),1); Out.Ln; + Spaces(indent); Out.String("next: "); Out.Hex(SYSTEM.VAL(SYSTEM.ADDRESS,f.next),1); Out.Ln; END DumpFile; PROCEDURE DumpBuffer*(b: Buffer; indent: INTEGER); @@ -94,7 +94,7 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files Spaces(indent); Out.String("chg: "); IF b.chg THEN Out.String("TRUE") ELSE Out.String("FALSE") END; Out.Ln; Spaces(indent); Out.String("org: "); Out.Int(b.org,1); Out.Ln; Spaces(indent); Out.String("size: "); Out.Int(b.size,1); Out.Ln; - Spaces(indent); Out.String("data: "); Out.String("..."); Out.Ln; + Spaces(indent); Out.String("data: "); Out.Ln; Out.HexDump(b.data); Spaces(indent); Out.String("f: "); IF b.f = NIL THEN Out.String(""); Out.Ln ELSE Out.Ln; DumpFile(b.f, indent+1) END; END DumpBuffer; diff --git a/src/runtime/Out.Mod b/src/runtime/Out.Mod index 9564f275..9aaa961c 100644 --- a/src/runtime/Out.Mod +++ b/src/runtime/Out.Mod @@ -68,10 +68,51 @@ BEGIN WHILE i > 0 DO DEC(i); Char(s[i]) END END Int; +PROCEDURE Hex*(x, n: HUGEINT); +BEGIN + IF n < 1 THEN n := 1 ELSIF n > 16 THEN n := 16 END; + WHILE (n < 16) & (SYSTEM.LSH(x, -4*n) # 0) DO INC(n) END; + x := SYSTEM.ROT(x, 4*(16-n)); + WHILE n > 0 DO + x := SYSTEM.ROT(x,4); DEC(n); + IF x MOD 16 < 10 THEN Char(CHR((x MOD 16) + ORD('0'))) + ELSE Char(CHR((x MOD 16) - 10 + ORD('A'))) END + END +END Hex; + PROCEDURE Ln*; BEGIN String(Platform.NL); Flush; END Ln; +PROCEDURE HexDumpAdr*(a, o, l: SYSTEM.ADDRESS); +VAR i, n, lim: SYSTEM.ADDRESS; c: CHAR; +BEGIN + lim := a+l; + WHILE a < lim DO + IF a+16 < lim THEN n := 16 ELSE n := lim-a END; + Hex(o,8); Char(" "); + i := 0; WHILE i < n DO + IF i MOD 4 = 0 THEN Char(" ") END; + SYSTEM.GET(a+i, c); Hex(ORD(c), 2); Char(" "); + INC(i) + END; + WHILE i < 16 DO + IF i MOD 4 = 0 THEN Char(" ") END; String(" "); + INC(i) + END; + String(" "); + i := 0; WHILE i < n DO + SYSTEM.GET(a+i, c); + IF (ORD(c) < 32) OR (ORD(c) > 126) THEN Char(".") ELSE Char(c) END; + INC(i) + END; + INC(a,n); INC(o,n); Ln + END +END HexDumpAdr; + +PROCEDURE HexDump*(VAR m: ARRAY OF SYSTEM.BYTE); +BEGIN HexDumpAdr(SYSTEM.ADR(m), 0, LEN(m)) +END HexDump; (* Real and Longreal display *) diff --git a/src/runtime/Texts.Mod b/src/runtime/Texts.Mod index 760f805c..1712411c 100644 --- a/src/runtime/Texts.Mod +++ b/src/runtime/Texts.Mod @@ -125,9 +125,9 @@ MODULE Texts; (** CAS/HM 23.9.93 -- interface based on Texts by JG/NW 6.12.91** PROCEDURE DumpText(t: Text); BEGIN Out.String(" len: "); Out.Int(t.len,1); Out.Ln; - Out.String(" notify: "); Out.Int(SYSTEM.VAL(SYSTEM.ADDRESS, t.notify),1); Out.Ln; - Out.String(" head: "); Out.Int(SYSTEM.VAL(SYSTEM.ADDRESS, t.head),1); Out.Ln; - Out.String(" cache: "); Out.Int(SYSTEM.VAL(SYSTEM.ADDRESS, t.cache),1); Out.Ln; + Out.String(" notify: "); Out.Hex(SYSTEM.VAL(SYSTEM.ADDRESS, t.notify),1); Out.Ln; + Out.String(" head: "); Out.Hex(SYSTEM.VAL(SYSTEM.ADDRESS, t.head),1); Out.Ln; + Out.String(" cache: "); Out.Hex(SYSTEM.VAL(SYSTEM.ADDRESS, t.cache),1); Out.Ln; Out.String(" corg: "); Out.Int(t.corg,1); Out.Ln; END DumpText; @@ -135,14 +135,15 @@ MODULE Texts; (** CAS/HM 23.9.93 -- interface based on Texts by JG/NW 6.12.91** BEGIN Out.String(" W: "); Out.Int(e.W,1); Out.Ln; Out.String(" H: "); Out.Int(e.H,1); Out.Ln; - Out.String(" handle: "); Out.Int(SYSTEM.VAL(SYSTEM.ADDRESS, e.handle),1); Out.Ln; + Out.String(" handle: "); Out.Hex(SYSTEM.VAL(SYSTEM.ADDRESS, e.handle),1); Out.Ln; Out.String(" base: "); IF e.base = NIL THEN Out.String(""); Out.Ln ELSE Out.Ln; DumpText(e.base) END; END DumpElem; PROCEDURE DumpRun(ru: Run); BEGIN - Out.String(" prev: "); Out.Int(SYSTEM.VAL(SYSTEM.ADDRESS, ru.prev),1); Out.Ln; - Out.String(" next: "); Out.Int(SYSTEM.VAL(SYSTEM.ADDRESS, ru.next),1); Out.Ln; + Out.String(" Run at "); Out.Hex(SYSTEM.VAL(SYSTEM.ADDRESS, ru),1); Out.Ln; + Out.String(" prev: "); Out.Hex(SYSTEM.VAL(SYSTEM.ADDRESS, ru.prev),1); Out.Ln; + Out.String(" next: "); Out.Hex(SYSTEM.VAL(SYSTEM.ADDRESS, ru.next),1); Out.Ln; Out.String(" len: "); Out.Int(ru.len,1); Out.Ln; Out.String(" fnt: "); IF ru.fnt # NIL THEN Out.String(ru.fnt.name) ELSE Out.String("") END; Out.Ln; Out.String(" col: "); Out.Int(ru.col,1); Out.Ln; From fb3017e3e231f88bcc50265b17343edb919dae5c Mon Sep 17 00:00:00 2001 From: David Brown Date: Sun, 11 Dec 2016 17:19:18 +0000 Subject: [PATCH 413/580] Update bootstrap C source. --- bootstrap/unix-44/Files.c | 4 +- bootstrap/unix-44/Out.c | 77 ++++++++++++++++++++++++++++++++++++ bootstrap/unix-44/Out.h | 3 ++ bootstrap/unix-44/Texts.c | 15 ++++--- bootstrap/unix-48/Files.c | 4 +- bootstrap/unix-48/Out.c | 77 ++++++++++++++++++++++++++++++++++++ bootstrap/unix-48/Out.h | 3 ++ bootstrap/unix-48/Texts.c | 15 ++++--- bootstrap/unix-88/Files.c | 4 +- bootstrap/unix-88/Out.c | 77 ++++++++++++++++++++++++++++++++++++ bootstrap/unix-88/Out.h | 3 ++ bootstrap/unix-88/Texts.c | 15 ++++--- bootstrap/windows-48/Files.c | 4 +- bootstrap/windows-48/Out.c | 77 ++++++++++++++++++++++++++++++++++++ bootstrap/windows-48/Out.h | 3 ++ bootstrap/windows-48/Texts.c | 15 ++++--- bootstrap/windows-88/Files.c | 4 +- bootstrap/windows-88/Out.c | 77 ++++++++++++++++++++++++++++++++++++ bootstrap/windows-88/Out.h | 3 ++ bootstrap/windows-88/Texts.c | 15 ++++--- 20 files changed, 455 insertions(+), 40 deletions(-) diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index c9994206..652cb128 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -172,7 +172,7 @@ void Files_DumpFile (Files_File f, INT16 indent) Out_Ln(); Files_Spaces(indent); Out_String((CHAR*)"next: ", 15); - Out_Int((INT32)(ADDRESS)f->next, 1); + Out_Hex((INT32)(ADDRESS)f->next, 1); Out_Ln(); } @@ -196,8 +196,8 @@ void Files_DumpBuffer (Files_Buffer b, INT16 indent) Out_Ln(); Files_Spaces(indent); Out_String((CHAR*)"data: ", 7); - Out_String((CHAR*)"...", 4); Out_Ln(); + Out_HexDump((void*)b->data, 4096); Files_Spaces(indent); Out_String((CHAR*)"f: ", 7); if (b->f == NIL) { diff --git a/bootstrap/unix-44/Out.c b/bootstrap/unix-44/Out.c index a647f77d..38e680ae 100644 --- a/bootstrap/unix-44/Out.c +++ b/bootstrap/unix-44/Out.c @@ -16,6 +16,9 @@ static INT16 Out_in; export void Out_Char (CHAR ch); export void Out_Flush (void); +export void Out_Hex (INT64 x, INT64 n); +export void Out_HexDump (SYSTEM_BYTE *m, ADDRESS m__len); +export void Out_HexDumpAdr (INT32 a, INT32 o, INT32 l); export void Out_Int (INT64 x, INT64 n); static INT32 Out_Length (CHAR *s, ADDRESS s__len); export void Out_Ln (void); @@ -119,12 +122,86 @@ void Out_Int (INT64 x, INT64 n) } } +void Out_Hex (INT64 x, INT64 n) +{ + if (n < 1) { + n = 1; + } else if (n > 16) { + n = 16; + } + while ((n < 16 && __LSH(x, -__ASHL(n, 2), 64) != 0)) { + n += 1; + } + x = __ROT(x, __ASHL(16 - n, 2), 64); + while (n > 0) { + x = __ROTL(x, 4, 64); + n -= 1; + if (__MASK(x, -16) < 10) { + Out_Char((CHAR)(__MASK(x, -16) + 48)); + } else { + Out_Char((CHAR)((__MASK(x, -16) - 10) + 65)); + } + } +} + void Out_Ln (void) { Out_String(Platform_NL, 3); Out_Flush(); } +void Out_HexDumpAdr (INT32 a, INT32 o, INT32 l) +{ + INT32 i, n, lim; + CHAR c; + lim = a + l; + while (a < lim) { + if (a + 16 < lim) { + n = 16; + } else { + n = lim - a; + } + Out_Hex(o, 8); + Out_Char(' '); + i = 0; + while (i < n) { + if (__MASK(i, -4) == 0) { + Out_Char(' '); + } + __GET(a + i, c, CHAR); + Out_Hex((INT16)c, 2); + Out_Char(' '); + i += 1; + } + while (i < 16) { + if (__MASK(i, -4) == 0) { + Out_Char(' '); + } + Out_String((CHAR*)" ", 4); + i += 1; + } + Out_String((CHAR*)" ", 2); + i = 0; + while (i < n) { + __GET(a + i, c, CHAR); + if ((INT16)c < 32 || (INT16)c > 126) { + Out_Char('.'); + } else { + Out_Char(c); + } + i += 1; + } + a += n; + o += n; + Out_Ln(); + } +} + +void Out_HexDump (SYSTEM_BYTE *m, ADDRESS m__len) +{ + Out_HexDumpAdr((ADDRESS)m, 0, m__len); +} + static void Out_digit (INT64 n, CHAR *s, ADDRESS s__len, INT16 *i) { *i -= 1; diff --git a/bootstrap/unix-44/Out.h b/bootstrap/unix-44/Out.h index 8c7a5774..bae3e220 100644 --- a/bootstrap/unix-44/Out.h +++ b/bootstrap/unix-44/Out.h @@ -11,6 +11,9 @@ import BOOLEAN Out_IsConsole; import void Out_Char (CHAR ch); import void Out_Flush (void); +import void Out_Hex (INT64 x, INT64 n); +import void Out_HexDump (SYSTEM_BYTE *m, ADDRESS m__len); +import void Out_HexDumpAdr (INT32 a, INT32 o, INT32 l); import void Out_Int (INT64 x, INT64 n); import void Out_Ln (void); import void Out_LongReal (LONGREAL x, INT16 n); diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index 35e17988..d86402c1 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -243,13 +243,13 @@ static void Texts_DumpText (Texts_Text t) Out_Int(t->len, 1); Out_Ln(); Out_String((CHAR*)" notify: ", 15); - Out_Int((INT32)(ADDRESS)t->notify, 1); + Out_Hex((INT32)(ADDRESS)t->notify, 1); Out_Ln(); Out_String((CHAR*)" head: ", 15); - Out_Int((INT32)(ADDRESS)t->head, 1); + Out_Hex((INT32)(ADDRESS)t->head, 1); Out_Ln(); Out_String((CHAR*)" cache: ", 15); - Out_Int((INT32)(ADDRESS)t->cache, 1); + Out_Hex((INT32)(ADDRESS)t->cache, 1); Out_Ln(); Out_String((CHAR*)" corg: ", 15); Out_Int(t->corg, 1); @@ -265,7 +265,7 @@ static void Texts_DumpElem (Texts_Elem e) Out_Int(e->H, 1); Out_Ln(); Out_String((CHAR*)" handle: ", 13); - Out_Int((INT32)(ADDRESS)e->handle, 1); + Out_Hex((INT32)(ADDRESS)e->handle, 1); Out_Ln(); Out_String((CHAR*)" base: ", 13); if (e->base == NIL) { @@ -279,11 +279,14 @@ static void Texts_DumpElem (Texts_Elem e) static void Texts_DumpRun (Texts_Run ru) { + Out_String((CHAR*)" Run at ", 10); + Out_Hex((INT32)(ADDRESS)ru, 1); + Out_Ln(); Out_String((CHAR*)" prev: ", 12); - Out_Int((INT32)(ADDRESS)ru->prev, 1); + Out_Hex((INT32)(ADDRESS)ru->prev, 1); Out_Ln(); Out_String((CHAR*)" next: ", 12); - Out_Int((INT32)(ADDRESS)ru->next, 1); + Out_Hex((INT32)(ADDRESS)ru->next, 1); Out_Ln(); Out_String((CHAR*)" len: ", 12); Out_Int(ru->len, 1); diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index c9994206..652cb128 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -172,7 +172,7 @@ void Files_DumpFile (Files_File f, INT16 indent) Out_Ln(); Files_Spaces(indent); Out_String((CHAR*)"next: ", 15); - Out_Int((INT32)(ADDRESS)f->next, 1); + Out_Hex((INT32)(ADDRESS)f->next, 1); Out_Ln(); } @@ -196,8 +196,8 @@ void Files_DumpBuffer (Files_Buffer b, INT16 indent) Out_Ln(); Files_Spaces(indent); Out_String((CHAR*)"data: ", 7); - Out_String((CHAR*)"...", 4); Out_Ln(); + Out_HexDump((void*)b->data, 4096); Files_Spaces(indent); Out_String((CHAR*)"f: ", 7); if (b->f == NIL) { diff --git a/bootstrap/unix-48/Out.c b/bootstrap/unix-48/Out.c index a647f77d..38e680ae 100644 --- a/bootstrap/unix-48/Out.c +++ b/bootstrap/unix-48/Out.c @@ -16,6 +16,9 @@ static INT16 Out_in; export void Out_Char (CHAR ch); export void Out_Flush (void); +export void Out_Hex (INT64 x, INT64 n); +export void Out_HexDump (SYSTEM_BYTE *m, ADDRESS m__len); +export void Out_HexDumpAdr (INT32 a, INT32 o, INT32 l); export void Out_Int (INT64 x, INT64 n); static INT32 Out_Length (CHAR *s, ADDRESS s__len); export void Out_Ln (void); @@ -119,12 +122,86 @@ void Out_Int (INT64 x, INT64 n) } } +void Out_Hex (INT64 x, INT64 n) +{ + if (n < 1) { + n = 1; + } else if (n > 16) { + n = 16; + } + while ((n < 16 && __LSH(x, -__ASHL(n, 2), 64) != 0)) { + n += 1; + } + x = __ROT(x, __ASHL(16 - n, 2), 64); + while (n > 0) { + x = __ROTL(x, 4, 64); + n -= 1; + if (__MASK(x, -16) < 10) { + Out_Char((CHAR)(__MASK(x, -16) + 48)); + } else { + Out_Char((CHAR)((__MASK(x, -16) - 10) + 65)); + } + } +} + void Out_Ln (void) { Out_String(Platform_NL, 3); Out_Flush(); } +void Out_HexDumpAdr (INT32 a, INT32 o, INT32 l) +{ + INT32 i, n, lim; + CHAR c; + lim = a + l; + while (a < lim) { + if (a + 16 < lim) { + n = 16; + } else { + n = lim - a; + } + Out_Hex(o, 8); + Out_Char(' '); + i = 0; + while (i < n) { + if (__MASK(i, -4) == 0) { + Out_Char(' '); + } + __GET(a + i, c, CHAR); + Out_Hex((INT16)c, 2); + Out_Char(' '); + i += 1; + } + while (i < 16) { + if (__MASK(i, -4) == 0) { + Out_Char(' '); + } + Out_String((CHAR*)" ", 4); + i += 1; + } + Out_String((CHAR*)" ", 2); + i = 0; + while (i < n) { + __GET(a + i, c, CHAR); + if ((INT16)c < 32 || (INT16)c > 126) { + Out_Char('.'); + } else { + Out_Char(c); + } + i += 1; + } + a += n; + o += n; + Out_Ln(); + } +} + +void Out_HexDump (SYSTEM_BYTE *m, ADDRESS m__len) +{ + Out_HexDumpAdr((ADDRESS)m, 0, m__len); +} + static void Out_digit (INT64 n, CHAR *s, ADDRESS s__len, INT16 *i) { *i -= 1; diff --git a/bootstrap/unix-48/Out.h b/bootstrap/unix-48/Out.h index 8c7a5774..bae3e220 100644 --- a/bootstrap/unix-48/Out.h +++ b/bootstrap/unix-48/Out.h @@ -11,6 +11,9 @@ import BOOLEAN Out_IsConsole; import void Out_Char (CHAR ch); import void Out_Flush (void); +import void Out_Hex (INT64 x, INT64 n); +import void Out_HexDump (SYSTEM_BYTE *m, ADDRESS m__len); +import void Out_HexDumpAdr (INT32 a, INT32 o, INT32 l); import void Out_Int (INT64 x, INT64 n); import void Out_Ln (void); import void Out_LongReal (LONGREAL x, INT16 n); diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index 9016dbc8..5450b303 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -243,13 +243,13 @@ static void Texts_DumpText (Texts_Text t) Out_Int(t->len, 1); Out_Ln(); Out_String((CHAR*)" notify: ", 15); - Out_Int((INT32)(ADDRESS)t->notify, 1); + Out_Hex((INT32)(ADDRESS)t->notify, 1); Out_Ln(); Out_String((CHAR*)" head: ", 15); - Out_Int((INT32)(ADDRESS)t->head, 1); + Out_Hex((INT32)(ADDRESS)t->head, 1); Out_Ln(); Out_String((CHAR*)" cache: ", 15); - Out_Int((INT32)(ADDRESS)t->cache, 1); + Out_Hex((INT32)(ADDRESS)t->cache, 1); Out_Ln(); Out_String((CHAR*)" corg: ", 15); Out_Int(t->corg, 1); @@ -265,7 +265,7 @@ static void Texts_DumpElem (Texts_Elem e) Out_Int(e->H, 1); Out_Ln(); Out_String((CHAR*)" handle: ", 13); - Out_Int((INT32)(ADDRESS)e->handle, 1); + Out_Hex((INT32)(ADDRESS)e->handle, 1); Out_Ln(); Out_String((CHAR*)" base: ", 13); if (e->base == NIL) { @@ -279,11 +279,14 @@ static void Texts_DumpElem (Texts_Elem e) static void Texts_DumpRun (Texts_Run ru) { + Out_String((CHAR*)" Run at ", 10); + Out_Hex((INT32)(ADDRESS)ru, 1); + Out_Ln(); Out_String((CHAR*)" prev: ", 12); - Out_Int((INT32)(ADDRESS)ru->prev, 1); + Out_Hex((INT32)(ADDRESS)ru->prev, 1); Out_Ln(); Out_String((CHAR*)" next: ", 12); - Out_Int((INT32)(ADDRESS)ru->next, 1); + Out_Hex((INT32)(ADDRESS)ru->next, 1); Out_Ln(); Out_String((CHAR*)" len: ", 12); Out_Int(ru->len, 1); diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 2d13a80b..92ada350 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -172,7 +172,7 @@ void Files_DumpFile (Files_File f, INT16 indent) Out_Ln(); Files_Spaces(indent); Out_String((CHAR*)"next: ", 15); - Out_Int((INT64)(ADDRESS)f->next, 1); + Out_Hex((INT64)(ADDRESS)f->next, 1); Out_Ln(); } @@ -196,8 +196,8 @@ void Files_DumpBuffer (Files_Buffer b, INT16 indent) Out_Ln(); Files_Spaces(indent); Out_String((CHAR*)"data: ", 7); - Out_String((CHAR*)"...", 4); Out_Ln(); + Out_HexDump((void*)b->data, 4096); Files_Spaces(indent); Out_String((CHAR*)"f: ", 7); if (b->f == NIL) { diff --git a/bootstrap/unix-88/Out.c b/bootstrap/unix-88/Out.c index a647f77d..64345041 100644 --- a/bootstrap/unix-88/Out.c +++ b/bootstrap/unix-88/Out.c @@ -16,6 +16,9 @@ static INT16 Out_in; export void Out_Char (CHAR ch); export void Out_Flush (void); +export void Out_Hex (INT64 x, INT64 n); +export void Out_HexDump (SYSTEM_BYTE *m, ADDRESS m__len); +export void Out_HexDumpAdr (INT64 a, INT64 o, INT64 l); export void Out_Int (INT64 x, INT64 n); static INT32 Out_Length (CHAR *s, ADDRESS s__len); export void Out_Ln (void); @@ -119,12 +122,86 @@ void Out_Int (INT64 x, INT64 n) } } +void Out_Hex (INT64 x, INT64 n) +{ + if (n < 1) { + n = 1; + } else if (n > 16) { + n = 16; + } + while ((n < 16 && __LSH(x, -__ASHL(n, 2), 64) != 0)) { + n += 1; + } + x = __ROT(x, __ASHL(16 - n, 2), 64); + while (n > 0) { + x = __ROTL(x, 4, 64); + n -= 1; + if (__MASK(x, -16) < 10) { + Out_Char((CHAR)(__MASK(x, -16) + 48)); + } else { + Out_Char((CHAR)((__MASK(x, -16) - 10) + 65)); + } + } +} + void Out_Ln (void) { Out_String(Platform_NL, 3); Out_Flush(); } +void Out_HexDumpAdr (INT64 a, INT64 o, INT64 l) +{ + INT64 i, n, lim; + CHAR c; + lim = a + l; + while (a < lim) { + if (a + 16 < lim) { + n = 16; + } else { + n = lim - a; + } + Out_Hex(o, 8); + Out_Char(' '); + i = 0; + while (i < n) { + if (__MASK(i, -4) == 0) { + Out_Char(' '); + } + __GET(a + i, c, CHAR); + Out_Hex((INT16)c, 2); + Out_Char(' '); + i += 1; + } + while (i < 16) { + if (__MASK(i, -4) == 0) { + Out_Char(' '); + } + Out_String((CHAR*)" ", 4); + i += 1; + } + Out_String((CHAR*)" ", 2); + i = 0; + while (i < n) { + __GET(a + i, c, CHAR); + if ((INT16)c < 32 || (INT16)c > 126) { + Out_Char('.'); + } else { + Out_Char(c); + } + i += 1; + } + a += n; + o += n; + Out_Ln(); + } +} + +void Out_HexDump (SYSTEM_BYTE *m, ADDRESS m__len) +{ + Out_HexDumpAdr((ADDRESS)m, 0, m__len); +} + static void Out_digit (INT64 n, CHAR *s, ADDRESS s__len, INT16 *i) { *i -= 1; diff --git a/bootstrap/unix-88/Out.h b/bootstrap/unix-88/Out.h index 8c7a5774..6962abdc 100644 --- a/bootstrap/unix-88/Out.h +++ b/bootstrap/unix-88/Out.h @@ -11,6 +11,9 @@ import BOOLEAN Out_IsConsole; import void Out_Char (CHAR ch); import void Out_Flush (void); +import void Out_Hex (INT64 x, INT64 n); +import void Out_HexDump (SYSTEM_BYTE *m, ADDRESS m__len); +import void Out_HexDumpAdr (INT64 a, INT64 o, INT64 l); import void Out_Int (INT64 x, INT64 n); import void Out_Ln (void); import void Out_LongReal (LONGREAL x, INT16 n); diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index 1afb5eba..c7301f23 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -243,13 +243,13 @@ static void Texts_DumpText (Texts_Text t) Out_Int(t->len, 1); Out_Ln(); Out_String((CHAR*)" notify: ", 15); - Out_Int((INT64)(ADDRESS)t->notify, 1); + Out_Hex((INT64)(ADDRESS)t->notify, 1); Out_Ln(); Out_String((CHAR*)" head: ", 15); - Out_Int((INT64)(ADDRESS)t->head, 1); + Out_Hex((INT64)(ADDRESS)t->head, 1); Out_Ln(); Out_String((CHAR*)" cache: ", 15); - Out_Int((INT64)(ADDRESS)t->cache, 1); + Out_Hex((INT64)(ADDRESS)t->cache, 1); Out_Ln(); Out_String((CHAR*)" corg: ", 15); Out_Int(t->corg, 1); @@ -265,7 +265,7 @@ static void Texts_DumpElem (Texts_Elem e) Out_Int(e->H, 1); Out_Ln(); Out_String((CHAR*)" handle: ", 13); - Out_Int((INT64)(ADDRESS)e->handle, 1); + Out_Hex((INT64)(ADDRESS)e->handle, 1); Out_Ln(); Out_String((CHAR*)" base: ", 13); if (e->base == NIL) { @@ -279,11 +279,14 @@ static void Texts_DumpElem (Texts_Elem e) static void Texts_DumpRun (Texts_Run ru) { + Out_String((CHAR*)" Run at ", 10); + Out_Hex((INT64)(ADDRESS)ru, 1); + Out_Ln(); Out_String((CHAR*)" prev: ", 12); - Out_Int((INT64)(ADDRESS)ru->prev, 1); + Out_Hex((INT64)(ADDRESS)ru->prev, 1); Out_Ln(); Out_String((CHAR*)" next: ", 12); - Out_Int((INT64)(ADDRESS)ru->next, 1); + Out_Hex((INT64)(ADDRESS)ru->next, 1); Out_Ln(); Out_String((CHAR*)" len: ", 12); Out_Int(ru->len, 1); diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 3e1b5ecd..2b8c7919 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -172,7 +172,7 @@ void Files_DumpFile (Files_File f, INT16 indent) Out_Ln(); Files_Spaces(indent); Out_String((CHAR*)"next: ", 15); - Out_Int((INT32)(ADDRESS)f->next, 1); + Out_Hex((INT32)(ADDRESS)f->next, 1); Out_Ln(); } @@ -196,8 +196,8 @@ void Files_DumpBuffer (Files_Buffer b, INT16 indent) Out_Ln(); Files_Spaces(indent); Out_String((CHAR*)"data: ", 7); - Out_String((CHAR*)"...", 4); Out_Ln(); + Out_HexDump((void*)b->data, 4096); Files_Spaces(indent); Out_String((CHAR*)"f: ", 7); if (b->f == NIL) { diff --git a/bootstrap/windows-48/Out.c b/bootstrap/windows-48/Out.c index 52896b61..f5e37537 100644 --- a/bootstrap/windows-48/Out.c +++ b/bootstrap/windows-48/Out.c @@ -16,6 +16,9 @@ static INT16 Out_in; export void Out_Char (CHAR ch); export void Out_Flush (void); +export void Out_Hex (INT64 x, INT64 n); +export void Out_HexDump (SYSTEM_BYTE *m, ADDRESS m__len); +export void Out_HexDumpAdr (INT32 a, INT32 o, INT32 l); export void Out_Int (INT64 x, INT64 n); static INT32 Out_Length (CHAR *s, ADDRESS s__len); export void Out_Ln (void); @@ -119,12 +122,86 @@ void Out_Int (INT64 x, INT64 n) } } +void Out_Hex (INT64 x, INT64 n) +{ + if (n < 1) { + n = 1; + } else if (n > 16) { + n = 16; + } + while ((n < 16 && __LSH(x, -__ASHL(n, 2), 64) != 0)) { + n += 1; + } + x = __ROT(x, __ASHL(16 - n, 2), 64); + while (n > 0) { + x = __ROTL(x, 4, 64); + n -= 1; + if (__MASK(x, -16) < 10) { + Out_Char((CHAR)(__MASK(x, -16) + 48)); + } else { + Out_Char((CHAR)((__MASK(x, -16) - 10) + 65)); + } + } +} + void Out_Ln (void) { Out_String(Platform_NL, 3); Out_Flush(); } +void Out_HexDumpAdr (INT32 a, INT32 o, INT32 l) +{ + INT32 i, n, lim; + CHAR c; + lim = a + l; + while (a < lim) { + if (a + 16 < lim) { + n = 16; + } else { + n = lim - a; + } + Out_Hex(o, 8); + Out_Char(' '); + i = 0; + while (i < n) { + if (__MASK(i, -4) == 0) { + Out_Char(' '); + } + __GET(a + i, c, CHAR); + Out_Hex((INT16)c, 2); + Out_Char(' '); + i += 1; + } + while (i < 16) { + if (__MASK(i, -4) == 0) { + Out_Char(' '); + } + Out_String((CHAR*)" ", 4); + i += 1; + } + Out_String((CHAR*)" ", 2); + i = 0; + while (i < n) { + __GET(a + i, c, CHAR); + if ((INT16)c < 32 || (INT16)c > 126) { + Out_Char('.'); + } else { + Out_Char(c); + } + i += 1; + } + a += n; + o += n; + Out_Ln(); + } +} + +void Out_HexDump (SYSTEM_BYTE *m, ADDRESS m__len) +{ + Out_HexDumpAdr((ADDRESS)m, 0, m__len); +} + static void Out_digit (INT64 n, CHAR *s, ADDRESS s__len, INT16 *i) { *i -= 1; diff --git a/bootstrap/windows-48/Out.h b/bootstrap/windows-48/Out.h index 8c7a5774..bae3e220 100644 --- a/bootstrap/windows-48/Out.h +++ b/bootstrap/windows-48/Out.h @@ -11,6 +11,9 @@ import BOOLEAN Out_IsConsole; import void Out_Char (CHAR ch); import void Out_Flush (void); +import void Out_Hex (INT64 x, INT64 n); +import void Out_HexDump (SYSTEM_BYTE *m, ADDRESS m__len); +import void Out_HexDumpAdr (INT32 a, INT32 o, INT32 l); import void Out_Int (INT64 x, INT64 n); import void Out_Ln (void); import void Out_LongReal (LONGREAL x, INT16 n); diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index 9016dbc8..5450b303 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -243,13 +243,13 @@ static void Texts_DumpText (Texts_Text t) Out_Int(t->len, 1); Out_Ln(); Out_String((CHAR*)" notify: ", 15); - Out_Int((INT32)(ADDRESS)t->notify, 1); + Out_Hex((INT32)(ADDRESS)t->notify, 1); Out_Ln(); Out_String((CHAR*)" head: ", 15); - Out_Int((INT32)(ADDRESS)t->head, 1); + Out_Hex((INT32)(ADDRESS)t->head, 1); Out_Ln(); Out_String((CHAR*)" cache: ", 15); - Out_Int((INT32)(ADDRESS)t->cache, 1); + Out_Hex((INT32)(ADDRESS)t->cache, 1); Out_Ln(); Out_String((CHAR*)" corg: ", 15); Out_Int(t->corg, 1); @@ -265,7 +265,7 @@ static void Texts_DumpElem (Texts_Elem e) Out_Int(e->H, 1); Out_Ln(); Out_String((CHAR*)" handle: ", 13); - Out_Int((INT32)(ADDRESS)e->handle, 1); + Out_Hex((INT32)(ADDRESS)e->handle, 1); Out_Ln(); Out_String((CHAR*)" base: ", 13); if (e->base == NIL) { @@ -279,11 +279,14 @@ static void Texts_DumpElem (Texts_Elem e) static void Texts_DumpRun (Texts_Run ru) { + Out_String((CHAR*)" Run at ", 10); + Out_Hex((INT32)(ADDRESS)ru, 1); + Out_Ln(); Out_String((CHAR*)" prev: ", 12); - Out_Int((INT32)(ADDRESS)ru->prev, 1); + Out_Hex((INT32)(ADDRESS)ru->prev, 1); Out_Ln(); Out_String((CHAR*)" next: ", 12); - Out_Int((INT32)(ADDRESS)ru->next, 1); + Out_Hex((INT32)(ADDRESS)ru->next, 1); Out_Ln(); Out_String((CHAR*)" len: ", 12); Out_Int(ru->len, 1); diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 072b15ba..fc649cf8 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -173,7 +173,7 @@ void Files_DumpFile (Files_File f, INT16 indent) Out_Ln(); Files_Spaces(indent); Out_String((CHAR*)"next: ", 15); - Out_Int((INT64)(ADDRESS)f->next, 1); + Out_Hex((INT64)(ADDRESS)f->next, 1); Out_Ln(); } @@ -197,8 +197,8 @@ void Files_DumpBuffer (Files_Buffer b, INT16 indent) Out_Ln(); Files_Spaces(indent); Out_String((CHAR*)"data: ", 7); - Out_String((CHAR*)"...", 4); Out_Ln(); + Out_HexDump((void*)b->data, 4096); Files_Spaces(indent); Out_String((CHAR*)"f: ", 7); if (b->f == NIL) { diff --git a/bootstrap/windows-88/Out.c b/bootstrap/windows-88/Out.c index 52896b61..b0d58957 100644 --- a/bootstrap/windows-88/Out.c +++ b/bootstrap/windows-88/Out.c @@ -16,6 +16,9 @@ static INT16 Out_in; export void Out_Char (CHAR ch); export void Out_Flush (void); +export void Out_Hex (INT64 x, INT64 n); +export void Out_HexDump (SYSTEM_BYTE *m, ADDRESS m__len); +export void Out_HexDumpAdr (INT64 a, INT64 o, INT64 l); export void Out_Int (INT64 x, INT64 n); static INT32 Out_Length (CHAR *s, ADDRESS s__len); export void Out_Ln (void); @@ -119,12 +122,86 @@ void Out_Int (INT64 x, INT64 n) } } +void Out_Hex (INT64 x, INT64 n) +{ + if (n < 1) { + n = 1; + } else if (n > 16) { + n = 16; + } + while ((n < 16 && __LSH(x, -__ASHL(n, 2), 64) != 0)) { + n += 1; + } + x = __ROT(x, __ASHL(16 - n, 2), 64); + while (n > 0) { + x = __ROTL(x, 4, 64); + n -= 1; + if (__MASK(x, -16) < 10) { + Out_Char((CHAR)(__MASK(x, -16) + 48)); + } else { + Out_Char((CHAR)((__MASK(x, -16) - 10) + 65)); + } + } +} + void Out_Ln (void) { Out_String(Platform_NL, 3); Out_Flush(); } +void Out_HexDumpAdr (INT64 a, INT64 o, INT64 l) +{ + INT64 i, n, lim; + CHAR c; + lim = a + l; + while (a < lim) { + if (a + 16 < lim) { + n = 16; + } else { + n = lim - a; + } + Out_Hex(o, 8); + Out_Char(' '); + i = 0; + while (i < n) { + if (__MASK(i, -4) == 0) { + Out_Char(' '); + } + __GET(a + i, c, CHAR); + Out_Hex((INT16)c, 2); + Out_Char(' '); + i += 1; + } + while (i < 16) { + if (__MASK(i, -4) == 0) { + Out_Char(' '); + } + Out_String((CHAR*)" ", 4); + i += 1; + } + Out_String((CHAR*)" ", 2); + i = 0; + while (i < n) { + __GET(a + i, c, CHAR); + if ((INT16)c < 32 || (INT16)c > 126) { + Out_Char('.'); + } else { + Out_Char(c); + } + i += 1; + } + a += n; + o += n; + Out_Ln(); + } +} + +void Out_HexDump (SYSTEM_BYTE *m, ADDRESS m__len) +{ + Out_HexDumpAdr((ADDRESS)m, 0, m__len); +} + static void Out_digit (INT64 n, CHAR *s, ADDRESS s__len, INT16 *i) { *i -= 1; diff --git a/bootstrap/windows-88/Out.h b/bootstrap/windows-88/Out.h index 8c7a5774..6962abdc 100644 --- a/bootstrap/windows-88/Out.h +++ b/bootstrap/windows-88/Out.h @@ -11,6 +11,9 @@ import BOOLEAN Out_IsConsole; import void Out_Char (CHAR ch); import void Out_Flush (void); +import void Out_Hex (INT64 x, INT64 n); +import void Out_HexDump (SYSTEM_BYTE *m, ADDRESS m__len); +import void Out_HexDumpAdr (INT64 a, INT64 o, INT64 l); import void Out_Int (INT64 x, INT64 n); import void Out_Ln (void); import void Out_LongReal (LONGREAL x, INT16 n); diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index 1afb5eba..c7301f23 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -243,13 +243,13 @@ static void Texts_DumpText (Texts_Text t) Out_Int(t->len, 1); Out_Ln(); Out_String((CHAR*)" notify: ", 15); - Out_Int((INT64)(ADDRESS)t->notify, 1); + Out_Hex((INT64)(ADDRESS)t->notify, 1); Out_Ln(); Out_String((CHAR*)" head: ", 15); - Out_Int((INT64)(ADDRESS)t->head, 1); + Out_Hex((INT64)(ADDRESS)t->head, 1); Out_Ln(); Out_String((CHAR*)" cache: ", 15); - Out_Int((INT64)(ADDRESS)t->cache, 1); + Out_Hex((INT64)(ADDRESS)t->cache, 1); Out_Ln(); Out_String((CHAR*)" corg: ", 15); Out_Int(t->corg, 1); @@ -265,7 +265,7 @@ static void Texts_DumpElem (Texts_Elem e) Out_Int(e->H, 1); Out_Ln(); Out_String((CHAR*)" handle: ", 13); - Out_Int((INT64)(ADDRESS)e->handle, 1); + Out_Hex((INT64)(ADDRESS)e->handle, 1); Out_Ln(); Out_String((CHAR*)" base: ", 13); if (e->base == NIL) { @@ -279,11 +279,14 @@ static void Texts_DumpElem (Texts_Elem e) static void Texts_DumpRun (Texts_Run ru) { + Out_String((CHAR*)" Run at ", 10); + Out_Hex((INT64)(ADDRESS)ru, 1); + Out_Ln(); Out_String((CHAR*)" prev: ", 12); - Out_Int((INT64)(ADDRESS)ru->prev, 1); + Out_Hex((INT64)(ADDRESS)ru->prev, 1); Out_Ln(); Out_String((CHAR*)" next: ", 12); - Out_Int((INT64)(ADDRESS)ru->next, 1); + Out_Hex((INT64)(ADDRESS)ru->next, 1); Out_Ln(); Out_String((CHAR*)" len: ", 12); Out_Int(ru->len, 1); From 3c1e64375e7488c0166d4fac4ca27e001bc08b2b Mon Sep 17 00:00:00 2001 From: David Brown Date: Sun, 11 Dec 2016 17:31:25 +0000 Subject: [PATCH 414/580] Fix hexdump on 32 bit builds. --- src/runtime/Out.Mod | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/runtime/Out.Mod b/src/runtime/Out.Mod index 9aaa961c..40b2bee7 100644 --- a/src/runtime/Out.Mod +++ b/src/runtime/Out.Mod @@ -84,16 +84,16 @@ PROCEDURE Ln*; BEGIN String(Platform.NL); Flush; END Ln; -PROCEDURE HexDumpAdr*(a, o, l: SYSTEM.ADDRESS); -VAR i, n, lim: SYSTEM.ADDRESS; c: CHAR; +PROCEDURE HexDumpAdr*(adr: SYSTEM.ADDRESS; offset: HUGEINT; length: LONGINT); +VAR i: INTEGER; n, lim: SYSTEM.ADDRESS; c: CHAR; BEGIN - lim := a+l; - WHILE a < lim DO - IF a+16 < lim THEN n := 16 ELSE n := lim-a END; - Hex(o,8); Char(" "); + lim := adr+length; + WHILE adr < lim DO + IF adr+16 < lim THEN n := 16 ELSE n := lim-adr END; + Hex(offset,8); Char(" "); i := 0; WHILE i < n DO IF i MOD 4 = 0 THEN Char(" ") END; - SYSTEM.GET(a+i, c); Hex(ORD(c), 2); Char(" "); + SYSTEM.GET(adr+i, c); Hex(ORD(c), 2); Char(" "); INC(i) END; WHILE i < 16 DO @@ -102,11 +102,11 @@ BEGIN END; String(" "); i := 0; WHILE i < n DO - SYSTEM.GET(a+i, c); + SYSTEM.GET(adr+i, c); IF (ORD(c) < 32) OR (ORD(c) > 126) THEN Char(".") ELSE Char(c) END; INC(i) END; - INC(a,n); INC(o,n); Ln + INC(adr,n); INC(offset,n); Ln END END HexDumpAdr; From c409b84e68c54d6b4920a910e99ef5e369e2564c Mon Sep 17 00:00:00 2001 From: David Brown Date: Sun, 11 Dec 2016 17:32:23 +0000 Subject: [PATCH 415/580] Update bootstrap sources. --- bootstrap/unix-44/Out.c | 25 +++++++++++++------------ bootstrap/unix-44/Out.h | 2 +- bootstrap/unix-48/Out.c | 25 +++++++++++++------------ bootstrap/unix-48/Out.h | 2 +- bootstrap/unix-88/Out.c | 29 +++++++++++++++-------------- bootstrap/unix-88/Out.h | 2 +- bootstrap/windows-48/Out.c | 25 +++++++++++++------------ bootstrap/windows-48/Out.h | 2 +- bootstrap/windows-88/Out.c | 29 +++++++++++++++-------------- bootstrap/windows-88/Out.h | 2 +- 10 files changed, 74 insertions(+), 69 deletions(-) diff --git a/bootstrap/unix-44/Out.c b/bootstrap/unix-44/Out.c index 38e680ae..4c3982b5 100644 --- a/bootstrap/unix-44/Out.c +++ b/bootstrap/unix-44/Out.c @@ -18,7 +18,7 @@ export void Out_Char (CHAR ch); export void Out_Flush (void); export void Out_Hex (INT64 x, INT64 n); export void Out_HexDump (SYSTEM_BYTE *m, ADDRESS m__len); -export void Out_HexDumpAdr (INT32 a, INT32 o, INT32 l); +export void Out_HexDumpAdr (INT32 adr, INT64 offset, INT32 length); export void Out_Int (INT64 x, INT64 n); static INT32 Out_Length (CHAR *s, ADDRESS s__len); export void Out_Ln (void); @@ -150,25 +150,26 @@ void Out_Ln (void) Out_Flush(); } -void Out_HexDumpAdr (INT32 a, INT32 o, INT32 l) +void Out_HexDumpAdr (INT32 adr, INT64 offset, INT32 length) { - INT32 i, n, lim; + INT16 i; + INT32 n, lim; CHAR c; - lim = a + l; - while (a < lim) { - if (a + 16 < lim) { + lim = adr + length; + while (adr < lim) { + if (adr + 16 < lim) { n = 16; } else { - n = lim - a; + n = lim - adr; } - Out_Hex(o, 8); + Out_Hex(offset, 8); Out_Char(' '); i = 0; while (i < n) { if (__MASK(i, -4) == 0) { Out_Char(' '); } - __GET(a + i, c, CHAR); + __GET(adr + i, c, CHAR); Out_Hex((INT16)c, 2); Out_Char(' '); i += 1; @@ -183,7 +184,7 @@ void Out_HexDumpAdr (INT32 a, INT32 o, INT32 l) Out_String((CHAR*)" ", 2); i = 0; while (i < n) { - __GET(a + i, c, CHAR); + __GET(adr + i, c, CHAR); if ((INT16)c < 32 || (INT16)c > 126) { Out_Char('.'); } else { @@ -191,8 +192,8 @@ void Out_HexDumpAdr (INT32 a, INT32 o, INT32 l) } i += 1; } - a += n; - o += n; + adr += n; + offset += (INT64)n; Out_Ln(); } } diff --git a/bootstrap/unix-44/Out.h b/bootstrap/unix-44/Out.h index bae3e220..1db1f1b3 100644 --- a/bootstrap/unix-44/Out.h +++ b/bootstrap/unix-44/Out.h @@ -13,7 +13,7 @@ import void Out_Char (CHAR ch); import void Out_Flush (void); import void Out_Hex (INT64 x, INT64 n); import void Out_HexDump (SYSTEM_BYTE *m, ADDRESS m__len); -import void Out_HexDumpAdr (INT32 a, INT32 o, INT32 l); +import void Out_HexDumpAdr (INT32 adr, INT64 offset, INT32 length); import void Out_Int (INT64 x, INT64 n); import void Out_Ln (void); import void Out_LongReal (LONGREAL x, INT16 n); diff --git a/bootstrap/unix-48/Out.c b/bootstrap/unix-48/Out.c index 38e680ae..4c3982b5 100644 --- a/bootstrap/unix-48/Out.c +++ b/bootstrap/unix-48/Out.c @@ -18,7 +18,7 @@ export void Out_Char (CHAR ch); export void Out_Flush (void); export void Out_Hex (INT64 x, INT64 n); export void Out_HexDump (SYSTEM_BYTE *m, ADDRESS m__len); -export void Out_HexDumpAdr (INT32 a, INT32 o, INT32 l); +export void Out_HexDumpAdr (INT32 adr, INT64 offset, INT32 length); export void Out_Int (INT64 x, INT64 n); static INT32 Out_Length (CHAR *s, ADDRESS s__len); export void Out_Ln (void); @@ -150,25 +150,26 @@ void Out_Ln (void) Out_Flush(); } -void Out_HexDumpAdr (INT32 a, INT32 o, INT32 l) +void Out_HexDumpAdr (INT32 adr, INT64 offset, INT32 length) { - INT32 i, n, lim; + INT16 i; + INT32 n, lim; CHAR c; - lim = a + l; - while (a < lim) { - if (a + 16 < lim) { + lim = adr + length; + while (adr < lim) { + if (adr + 16 < lim) { n = 16; } else { - n = lim - a; + n = lim - adr; } - Out_Hex(o, 8); + Out_Hex(offset, 8); Out_Char(' '); i = 0; while (i < n) { if (__MASK(i, -4) == 0) { Out_Char(' '); } - __GET(a + i, c, CHAR); + __GET(adr + i, c, CHAR); Out_Hex((INT16)c, 2); Out_Char(' '); i += 1; @@ -183,7 +184,7 @@ void Out_HexDumpAdr (INT32 a, INT32 o, INT32 l) Out_String((CHAR*)" ", 2); i = 0; while (i < n) { - __GET(a + i, c, CHAR); + __GET(adr + i, c, CHAR); if ((INT16)c < 32 || (INT16)c > 126) { Out_Char('.'); } else { @@ -191,8 +192,8 @@ void Out_HexDumpAdr (INT32 a, INT32 o, INT32 l) } i += 1; } - a += n; - o += n; + adr += n; + offset += (INT64)n; Out_Ln(); } } diff --git a/bootstrap/unix-48/Out.h b/bootstrap/unix-48/Out.h index bae3e220..1db1f1b3 100644 --- a/bootstrap/unix-48/Out.h +++ b/bootstrap/unix-48/Out.h @@ -13,7 +13,7 @@ import void Out_Char (CHAR ch); import void Out_Flush (void); import void Out_Hex (INT64 x, INT64 n); import void Out_HexDump (SYSTEM_BYTE *m, ADDRESS m__len); -import void Out_HexDumpAdr (INT32 a, INT32 o, INT32 l); +import void Out_HexDumpAdr (INT32 adr, INT64 offset, INT32 length); import void Out_Int (INT64 x, INT64 n); import void Out_Ln (void); import void Out_LongReal (LONGREAL x, INT16 n); diff --git a/bootstrap/unix-88/Out.c b/bootstrap/unix-88/Out.c index 64345041..c9c42bdb 100644 --- a/bootstrap/unix-88/Out.c +++ b/bootstrap/unix-88/Out.c @@ -18,7 +18,7 @@ export void Out_Char (CHAR ch); export void Out_Flush (void); export void Out_Hex (INT64 x, INT64 n); export void Out_HexDump (SYSTEM_BYTE *m, ADDRESS m__len); -export void Out_HexDumpAdr (INT64 a, INT64 o, INT64 l); +export void Out_HexDumpAdr (INT64 adr, INT64 offset, INT32 length); export void Out_Int (INT64 x, INT64 n); static INT32 Out_Length (CHAR *s, ADDRESS s__len); export void Out_Ln (void); @@ -150,25 +150,26 @@ void Out_Ln (void) Out_Flush(); } -void Out_HexDumpAdr (INT64 a, INT64 o, INT64 l) +void Out_HexDumpAdr (INT64 adr, INT64 offset, INT32 length) { - INT64 i, n, lim; + INT16 i; + INT64 n, lim; CHAR c; - lim = a + l; - while (a < lim) { - if (a + 16 < lim) { + lim = adr + (INT64)length; + while (adr < lim) { + if (adr + 16 < lim) { n = 16; } else { - n = lim - a; + n = lim - adr; } - Out_Hex(o, 8); + Out_Hex(offset, 8); Out_Char(' '); i = 0; - while (i < n) { + while ((INT64)i < n) { if (__MASK(i, -4) == 0) { Out_Char(' '); } - __GET(a + i, c, CHAR); + __GET(adr + (INT64)i, c, CHAR); Out_Hex((INT16)c, 2); Out_Char(' '); i += 1; @@ -182,8 +183,8 @@ void Out_HexDumpAdr (INT64 a, INT64 o, INT64 l) } Out_String((CHAR*)" ", 2); i = 0; - while (i < n) { - __GET(a + i, c, CHAR); + while ((INT64)i < n) { + __GET(adr + (INT64)i, c, CHAR); if ((INT16)c < 32 || (INT16)c > 126) { Out_Char('.'); } else { @@ -191,8 +192,8 @@ void Out_HexDumpAdr (INT64 a, INT64 o, INT64 l) } i += 1; } - a += n; - o += n; + adr += n; + offset += n; Out_Ln(); } } diff --git a/bootstrap/unix-88/Out.h b/bootstrap/unix-88/Out.h index 6962abdc..24829244 100644 --- a/bootstrap/unix-88/Out.h +++ b/bootstrap/unix-88/Out.h @@ -13,7 +13,7 @@ import void Out_Char (CHAR ch); import void Out_Flush (void); import void Out_Hex (INT64 x, INT64 n); import void Out_HexDump (SYSTEM_BYTE *m, ADDRESS m__len); -import void Out_HexDumpAdr (INT64 a, INT64 o, INT64 l); +import void Out_HexDumpAdr (INT64 adr, INT64 offset, INT32 length); import void Out_Int (INT64 x, INT64 n); import void Out_Ln (void); import void Out_LongReal (LONGREAL x, INT16 n); diff --git a/bootstrap/windows-48/Out.c b/bootstrap/windows-48/Out.c index f5e37537..767779ee 100644 --- a/bootstrap/windows-48/Out.c +++ b/bootstrap/windows-48/Out.c @@ -18,7 +18,7 @@ export void Out_Char (CHAR ch); export void Out_Flush (void); export void Out_Hex (INT64 x, INT64 n); export void Out_HexDump (SYSTEM_BYTE *m, ADDRESS m__len); -export void Out_HexDumpAdr (INT32 a, INT32 o, INT32 l); +export void Out_HexDumpAdr (INT32 adr, INT64 offset, INT32 length); export void Out_Int (INT64 x, INT64 n); static INT32 Out_Length (CHAR *s, ADDRESS s__len); export void Out_Ln (void); @@ -150,25 +150,26 @@ void Out_Ln (void) Out_Flush(); } -void Out_HexDumpAdr (INT32 a, INT32 o, INT32 l) +void Out_HexDumpAdr (INT32 adr, INT64 offset, INT32 length) { - INT32 i, n, lim; + INT16 i; + INT32 n, lim; CHAR c; - lim = a + l; - while (a < lim) { - if (a + 16 < lim) { + lim = adr + length; + while (adr < lim) { + if (adr + 16 < lim) { n = 16; } else { - n = lim - a; + n = lim - adr; } - Out_Hex(o, 8); + Out_Hex(offset, 8); Out_Char(' '); i = 0; while (i < n) { if (__MASK(i, -4) == 0) { Out_Char(' '); } - __GET(a + i, c, CHAR); + __GET(adr + i, c, CHAR); Out_Hex((INT16)c, 2); Out_Char(' '); i += 1; @@ -183,7 +184,7 @@ void Out_HexDumpAdr (INT32 a, INT32 o, INT32 l) Out_String((CHAR*)" ", 2); i = 0; while (i < n) { - __GET(a + i, c, CHAR); + __GET(adr + i, c, CHAR); if ((INT16)c < 32 || (INT16)c > 126) { Out_Char('.'); } else { @@ -191,8 +192,8 @@ void Out_HexDumpAdr (INT32 a, INT32 o, INT32 l) } i += 1; } - a += n; - o += n; + adr += n; + offset += (INT64)n; Out_Ln(); } } diff --git a/bootstrap/windows-48/Out.h b/bootstrap/windows-48/Out.h index bae3e220..1db1f1b3 100644 --- a/bootstrap/windows-48/Out.h +++ b/bootstrap/windows-48/Out.h @@ -13,7 +13,7 @@ import void Out_Char (CHAR ch); import void Out_Flush (void); import void Out_Hex (INT64 x, INT64 n); import void Out_HexDump (SYSTEM_BYTE *m, ADDRESS m__len); -import void Out_HexDumpAdr (INT32 a, INT32 o, INT32 l); +import void Out_HexDumpAdr (INT32 adr, INT64 offset, INT32 length); import void Out_Int (INT64 x, INT64 n); import void Out_Ln (void); import void Out_LongReal (LONGREAL x, INT16 n); diff --git a/bootstrap/windows-88/Out.c b/bootstrap/windows-88/Out.c index b0d58957..4e33a095 100644 --- a/bootstrap/windows-88/Out.c +++ b/bootstrap/windows-88/Out.c @@ -18,7 +18,7 @@ export void Out_Char (CHAR ch); export void Out_Flush (void); export void Out_Hex (INT64 x, INT64 n); export void Out_HexDump (SYSTEM_BYTE *m, ADDRESS m__len); -export void Out_HexDumpAdr (INT64 a, INT64 o, INT64 l); +export void Out_HexDumpAdr (INT64 adr, INT64 offset, INT32 length); export void Out_Int (INT64 x, INT64 n); static INT32 Out_Length (CHAR *s, ADDRESS s__len); export void Out_Ln (void); @@ -150,25 +150,26 @@ void Out_Ln (void) Out_Flush(); } -void Out_HexDumpAdr (INT64 a, INT64 o, INT64 l) +void Out_HexDumpAdr (INT64 adr, INT64 offset, INT32 length) { - INT64 i, n, lim; + INT16 i; + INT64 n, lim; CHAR c; - lim = a + l; - while (a < lim) { - if (a + 16 < lim) { + lim = adr + (INT64)length; + while (adr < lim) { + if (adr + 16 < lim) { n = 16; } else { - n = lim - a; + n = lim - adr; } - Out_Hex(o, 8); + Out_Hex(offset, 8); Out_Char(' '); i = 0; - while (i < n) { + while ((INT64)i < n) { if (__MASK(i, -4) == 0) { Out_Char(' '); } - __GET(a + i, c, CHAR); + __GET(adr + (INT64)i, c, CHAR); Out_Hex((INT16)c, 2); Out_Char(' '); i += 1; @@ -182,8 +183,8 @@ void Out_HexDumpAdr (INT64 a, INT64 o, INT64 l) } Out_String((CHAR*)" ", 2); i = 0; - while (i < n) { - __GET(a + i, c, CHAR); + while ((INT64)i < n) { + __GET(adr + (INT64)i, c, CHAR); if ((INT16)c < 32 || (INT16)c > 126) { Out_Char('.'); } else { @@ -191,8 +192,8 @@ void Out_HexDumpAdr (INT64 a, INT64 o, INT64 l) } i += 1; } - a += n; - o += n; + adr += n; + offset += n; Out_Ln(); } } diff --git a/bootstrap/windows-88/Out.h b/bootstrap/windows-88/Out.h index 6962abdc..24829244 100644 --- a/bootstrap/windows-88/Out.h +++ b/bootstrap/windows-88/Out.h @@ -13,7 +13,7 @@ import void Out_Char (CHAR ch); import void Out_Flush (void); import void Out_Hex (INT64 x, INT64 n); import void Out_HexDump (SYSTEM_BYTE *m, ADDRESS m__len); -import void Out_HexDumpAdr (INT64 a, INT64 o, INT64 l); +import void Out_HexDumpAdr (INT64 adr, INT64 offset, INT32 length); import void Out_Int (INT64 x, INT64 n); import void Out_Ln (void); import void Out_LongReal (LONGREAL x, INT16 n); From 6e28d3f2fdb90a154d5f987d2928deeef58af506 Mon Sep 17 00:00:00 2001 From: David Brown Date: Sun, 11 Dec 2016 17:43:05 +0000 Subject: [PATCH 416/580] Ha! Now fix hexdump for -OC build. --- src/runtime/Out.Mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runtime/Out.Mod b/src/runtime/Out.Mod index 40b2bee7..23d30be4 100644 --- a/src/runtime/Out.Mod +++ b/src/runtime/Out.Mod @@ -87,7 +87,7 @@ END Ln; PROCEDURE HexDumpAdr*(adr: SYSTEM.ADDRESS; offset: HUGEINT; length: LONGINT); VAR i: INTEGER; n, lim: SYSTEM.ADDRESS; c: CHAR; BEGIN - lim := adr+length; + lim := SYSTEM.VAL(SYSTEM.ADDRESS, adr+length); WHILE adr < lim DO IF adr+16 < lim THEN n := 16 ELSE n := lim-adr END; Hex(offset,8); Char(" "); From 27e3b576160edb91869cee253a7b862a66ac5c1f Mon Sep 17 00:00:00 2001 From: David Brown Date: Sun, 11 Dec 2016 17:43:47 +0000 Subject: [PATCH 417/580] Update bootstrap sources. --- bootstrap/unix-44/Out.c | 2 +- bootstrap/unix-48/Out.c | 2 +- bootstrap/unix-88/Out.c | 2 +- bootstrap/windows-48/Out.c | 2 +- bootstrap/windows-88/Out.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/bootstrap/unix-44/Out.c b/bootstrap/unix-44/Out.c index 4c3982b5..65e2e307 100644 --- a/bootstrap/unix-44/Out.c +++ b/bootstrap/unix-44/Out.c @@ -155,7 +155,7 @@ void Out_HexDumpAdr (INT32 adr, INT64 offset, INT32 length) INT16 i; INT32 n, lim; CHAR c; - lim = adr + length; + lim = (INT32)(adr + length); while (adr < lim) { if (adr + 16 < lim) { n = 16; diff --git a/bootstrap/unix-48/Out.c b/bootstrap/unix-48/Out.c index 4c3982b5..65e2e307 100644 --- a/bootstrap/unix-48/Out.c +++ b/bootstrap/unix-48/Out.c @@ -155,7 +155,7 @@ void Out_HexDumpAdr (INT32 adr, INT64 offset, INT32 length) INT16 i; INT32 n, lim; CHAR c; - lim = adr + length; + lim = (INT32)(adr + length); while (adr < lim) { if (adr + 16 < lim) { n = 16; diff --git a/bootstrap/unix-88/Out.c b/bootstrap/unix-88/Out.c index c9c42bdb..d4d8e5f4 100644 --- a/bootstrap/unix-88/Out.c +++ b/bootstrap/unix-88/Out.c @@ -155,7 +155,7 @@ void Out_HexDumpAdr (INT64 adr, INT64 offset, INT32 length) INT16 i; INT64 n, lim; CHAR c; - lim = adr + (INT64)length; + lim = (INT64)(adr + (INT64)length); while (adr < lim) { if (adr + 16 < lim) { n = 16; diff --git a/bootstrap/windows-48/Out.c b/bootstrap/windows-48/Out.c index 767779ee..7e1c7459 100644 --- a/bootstrap/windows-48/Out.c +++ b/bootstrap/windows-48/Out.c @@ -155,7 +155,7 @@ void Out_HexDumpAdr (INT32 adr, INT64 offset, INT32 length) INT16 i; INT32 n, lim; CHAR c; - lim = adr + length; + lim = (INT32)(adr + length); while (adr < lim) { if (adr + 16 < lim) { n = 16; diff --git a/bootstrap/windows-88/Out.c b/bootstrap/windows-88/Out.c index 4e33a095..66c81d4e 100644 --- a/bootstrap/windows-88/Out.c +++ b/bootstrap/windows-88/Out.c @@ -155,7 +155,7 @@ void Out_HexDumpAdr (INT64 adr, INT64 offset, INT32 length) INT16 i; INT64 n, lim; CHAR c; - lim = adr + (INT64)length; + lim = (INT64)(adr + (INT64)length); while (adr < lim) { if (adr + 16 < lim) { n = 16; From f75a98d3dc5a45e130c300d8168a82c2b8b0f056 Mon Sep 17 00:00:00 2001 From: David Brown Date: Sun, 11 Dec 2016 20:18:34 +0000 Subject: [PATCH 418/580] Display text run dump according to its dynamic type. --- src/runtime/Texts.Mod | 37 +++++++++++++++++++++++++++---------- 1 file changed, 27 insertions(+), 10 deletions(-) diff --git a/src/runtime/Texts.Mod b/src/runtime/Texts.Mod index 1712411c..ae7440a0 100644 --- a/src/runtime/Texts.Mod +++ b/src/runtime/Texts.Mod @@ -131,17 +131,9 @@ MODULE Texts; (** CAS/HM 23.9.93 -- interface based on Texts by JG/NW 6.12.91** Out.String(" corg: "); Out.Int(t.corg,1); Out.Ln; END DumpText; - PROCEDURE DumpElem(e: Elem); - BEGIN - Out.String(" W: "); Out.Int(e.W,1); Out.Ln; - Out.String(" H: "); Out.Int(e.H,1); Out.Ln; - Out.String(" handle: "); Out.Hex(SYSTEM.VAL(SYSTEM.ADDRESS, e.handle),1); Out.Ln; - Out.String(" base: "); IF e.base = NIL THEN Out.String(""); Out.Ln ELSE Out.Ln; DumpText(e.base) END; - END DumpElem; - PROCEDURE DumpRun(ru: Run); BEGIN - Out.String(" Run at "); Out.Hex(SYSTEM.VAL(SYSTEM.ADDRESS, ru),1); Out.Ln; + Out.String(" Run at "); Out.Hex(SYSTEM.VAL(SYSTEM.ADDRESS, ru),1); Out.Ln; Out.String(" prev: "); Out.Hex(SYSTEM.VAL(SYSTEM.ADDRESS, ru.prev),1); Out.Ln; Out.String(" next: "); Out.Hex(SYSTEM.VAL(SYSTEM.ADDRESS, ru.next),1); Out.Ln; Out.String(" len: "); Out.Int(ru.len,1); Out.Ln; @@ -151,6 +143,24 @@ MODULE Texts; (** CAS/HM 23.9.93 -- interface based on Texts by JG/NW 6.12.91** Out.String(" ascii: "); IF ru.ascii THEN Out.String("TRUE") ELSE Out.String("FALSE") END; Out.Ln; END DumpRun; + PROCEDURE DumpElem(e: Elem); + BEGIN + DumpRun(e); + Out.String(" -- Elem --"); Out.Ln; + Out.String(" W: "); Out.Int(e.W,1); Out.Ln; + Out.String(" H: "); Out.Int(e.H,1); Out.Ln; + Out.String(" handle: "); Out.Hex(SYSTEM.VAL(SYSTEM.ADDRESS, e.handle),1); Out.Ln; + Out.String(" base: "); IF e.base = NIL THEN Out.String(""); Out.Ln ELSE Out.Ln; DumpText(e.base) END; + END DumpElem; + + PROCEDURE DumpPiece(p: Piece); + BEGIN + DumpRun(p); + Out.String(" -- Piece --"); Out.Ln; + Out.String(" file: "); IF p.file = NIL THEN Out.String(""); Out.Ln ELSE Out.Ln; Files.DumpFile(p.file, 3) END; + Out.String(" org: "); Out.Int(p.org,1); Out.Ln; + END DumpPiece; + PROCEDURE DumpReader*(re: Reader); BEGIN Out.String("Reader:"); Out.Ln; @@ -162,7 +172,14 @@ MODULE Texts; (** CAS/HM 23.9.93 -- interface based on Texts by JG/NW 6.12.91** Out.String(" off: "); Out.Int(re.off,1); Out.Ln; Out.String(" elem: "); IF re.elem = NIL THEN Out.String(""); Out.Ln ELSE Out.Ln; DumpElem(re.elem) END; Out.String(" rider: "); Out.Ln; Files.DumpRider(re.rider,2); - Out.String(" run: "); IF re.run = NIL THEN Out.String(""); Out.Ln ELSE Out.Ln; DumpRun(re.run) END; + Out.String(" run: "); + IF re.run = NIL THEN Out.String(""); Out.Ln + ELSE Out.Ln; + IF re.run IS Piece THEN DumpPiece(re.run(Piece)) + ELSIF re.run IS Elem THEN DumpElem(re.run(Elem)) + ELSE DumpRun(re.run) + END + END; END DumpReader; From 80512b6eccf3c7bcd4eb6109f05ed6fc99a3b278 Mon Sep 17 00:00:00 2001 From: David Brown Date: Sun, 11 Dec 2016 20:19:08 +0000 Subject: [PATCH 419/580] Update bootstrap sources. --- bootstrap/unix-44/Texts.c | 284 +++++++++++++++++++---------------- bootstrap/unix-48/Texts.c | 284 +++++++++++++++++++---------------- bootstrap/unix-88/Texts.c | 284 +++++++++++++++++++---------------- bootstrap/windows-48/Texts.c | 284 +++++++++++++++++++---------------- bootstrap/windows-88/Texts.c | 284 +++++++++++++++++++---------------- 5 files changed, 780 insertions(+), 640 deletions(-) diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index d86402c1..8c4ccea8 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -193,6 +193,7 @@ export void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); export void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); export void Texts_Delete (Texts_Text T, INT32 beg, INT32 end); static void Texts_DumpElem (Texts_Elem e); +static void Texts_DumpPiece (Texts_Piece p); export void Texts_DumpReader (Texts_Reader re); static void Texts_DumpRun (Texts_Run ru); static void Texts_DumpText (Texts_Text t); @@ -256,30 +257,9 @@ static void Texts_DumpText (Texts_Text t) Out_Ln(); } -static void Texts_DumpElem (Texts_Elem e) -{ - Out_String((CHAR*)" W: ", 13); - Out_Int(e->W, 1); - Out_Ln(); - Out_String((CHAR*)" H: ", 13); - Out_Int(e->H, 1); - Out_Ln(); - Out_String((CHAR*)" handle: ", 13); - Out_Hex((INT32)(ADDRESS)e->handle, 1); - Out_Ln(); - Out_String((CHAR*)" base: ", 13); - if (e->base == NIL) { - Out_String((CHAR*)"", 6); - Out_Ln(); - } else { - Out_Ln(); - Texts_DumpText(e->base); - } -} - static void Texts_DumpRun (Texts_Run ru) { - Out_String((CHAR*)" Run at ", 10); + Out_String((CHAR*)" Run at ", 12); Out_Hex((INT32)(ADDRESS)ru, 1); Out_Ln(); Out_String((CHAR*)" prev: ", 12); @@ -313,6 +293,48 @@ static void Texts_DumpRun (Texts_Run ru) Out_Ln(); } +static void Texts_DumpElem (Texts_Elem e) +{ + Texts_DumpRun((void*)e); + Out_String((CHAR*)" -- Elem --", 15); + Out_Ln(); + Out_String((CHAR*)" W: ", 13); + Out_Int(e->W, 1); + Out_Ln(); + Out_String((CHAR*)" H: ", 13); + Out_Int(e->H, 1); + Out_Ln(); + Out_String((CHAR*)" handle: ", 13); + Out_Hex((INT32)(ADDRESS)e->handle, 1); + Out_Ln(); + Out_String((CHAR*)" base: ", 13); + if (e->base == NIL) { + Out_String((CHAR*)"", 6); + Out_Ln(); + } else { + Out_Ln(); + Texts_DumpText(e->base); + } +} + +static void Texts_DumpPiece (Texts_Piece p) +{ + Texts_DumpRun((void*)p); + Out_String((CHAR*)" -- Piece --", 16); + Out_Ln(); + Out_String((CHAR*)" file: ", 12); + if (p->file == NIL) { + Out_String((CHAR*)"", 6); + Out_Ln(); + } else { + Out_Ln(); + Files_DumpFile(p->file, 3); + } + Out_String((CHAR*)" org: ", 12); + Out_Int(p->org, 1); + Out_Ln(); +} + void Texts_DumpReader (Texts_Reader re) { Out_String((CHAR*)"Reader:", 8); @@ -360,7 +382,13 @@ void Texts_DumpReader (Texts_Reader re) Out_Ln(); } else { Out_Ln(); - Texts_DumpRun(re.run); + if (__ISP(re.run, Texts_PieceDesc, 1)) { + Texts_DumpPiece(__GUARDP(re.run, Texts_PieceDesc, 1)); + } else if (__ISP(re.run, Texts_ElemDesc, 1)) { + Texts_DumpElem(__GUARDP(re.run, Texts_ElemDesc, 1)); + } else { + Texts_DumpRun(re.run); + } } } @@ -848,32 +876,32 @@ void Texts_OpenScanner (Texts_Scanner *S, ADDRESS *S__typ, Texts_Text T, INT32 p (*S).nextCh = ' '; } -static struct Scan__35 { +static struct Scan__36 { Texts_Scanner *S; ADDRESS *S__typ; CHAR *ch; BOOLEAN *negE; INT16 *e; - struct Scan__35 *lnk; -} *Scan__35_s; + struct Scan__36 *lnk; +} *Scan__36_s; -static void ReadScaleFactor__36 (void); +static void ReadScaleFactor__37 (void); -static void ReadScaleFactor__36 (void) +static void ReadScaleFactor__37 (void) { - Texts_Read((void*)&*Scan__35_s->S, Scan__35_s->S__typ, &*Scan__35_s->ch); - if (*Scan__35_s->ch == '-') { - *Scan__35_s->negE = 1; - Texts_Read((void*)&*Scan__35_s->S, Scan__35_s->S__typ, &*Scan__35_s->ch); + Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); + if (*Scan__36_s->ch == '-') { + *Scan__36_s->negE = 1; + Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); } else { - *Scan__35_s->negE = 0; - if (*Scan__35_s->ch == '+') { - Texts_Read((void*)&*Scan__35_s->S, Scan__35_s->S__typ, &*Scan__35_s->ch); + *Scan__36_s->negE = 0; + if (*Scan__36_s->ch == '+') { + Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); } } - while (('0' <= *Scan__35_s->ch && *Scan__35_s->ch <= '9')) { - *Scan__35_s->e = (*Scan__35_s->e * 10 + (INT16)*Scan__35_s->ch) - 48; - Texts_Read((void*)&*Scan__35_s->S, Scan__35_s->S__typ, &*Scan__35_s->ch); + while (('0' <= *Scan__36_s->ch && *Scan__36_s->ch <= '9')) { + *Scan__36_s->e = (*Scan__36_s->e * 10 + (INT16)*Scan__36_s->ch) - 48; + Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); } } @@ -887,13 +915,13 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) REAL x, f; LONGREAL y, g; CHAR d[32]; - struct Scan__35 _s; + struct Scan__36 _s; _s.S = S; _s.S__typ = S__typ; _s.ch = &ch; _s.negE = &negE; _s.e = &e; - _s.lnk = Scan__35_s; - Scan__35_s = &_s; + _s.lnk = Scan__36_s; + Scan__36_s = &_s; ch = (*S).nextCh; i = 0; for (;;) { @@ -994,7 +1022,7 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) y = ((INT16)d[__X(j, 32)] - 48) * g + y; j += 1; } - ReadScaleFactor__36(); + ReadScaleFactor__37(); if (negE) { if (e <= 308) { y = y / (LONGREAL)Reals_TenL(e); @@ -1027,7 +1055,7 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) j += 1; } if (ch == 'E') { - ReadScaleFactor__36(); + ReadScaleFactor__37(); } if (negE) { if (e <= 38) { @@ -1080,7 +1108,7 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) } } (*S).nextCh = ch; - Scan__35_s = _s.lnk; + Scan__36_s = _s.lnk; } void Texts_OpenWriter (Texts_Writer *W, ADDRESS *W__typ) @@ -1299,30 +1327,30 @@ void Texts_WriteReal (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n) } } -static struct WriteRealFix__57 { +static struct WriteRealFix__58 { Texts_Writer *W; ADDRESS *W__typ; INT16 *i; CHAR (*d)[9]; - struct WriteRealFix__57 *lnk; -} *WriteRealFix__57_s; + struct WriteRealFix__58 *lnk; +} *WriteRealFix__58_s; -static void dig__58 (INT16 n); -static void seq__60 (CHAR ch, INT16 n); +static void dig__59 (INT16 n); +static void seq__61 (CHAR ch, INT16 n); -static void seq__60 (CHAR ch, INT16 n) +static void seq__61 (CHAR ch, INT16 n) { while (n > 0) { - Texts_Write(&*WriteRealFix__57_s->W, WriteRealFix__57_s->W__typ, ch); + Texts_Write(&*WriteRealFix__58_s->W, WriteRealFix__58_s->W__typ, ch); n -= 1; } } -static void dig__58 (INT16 n) +static void dig__59 (INT16 n) { while (n > 0) { - *WriteRealFix__57_s->i -= 1; - Texts_Write(&*WriteRealFix__57_s->W, WriteRealFix__57_s->W__typ, (*WriteRealFix__57_s->d)[__X(*WriteRealFix__57_s->i, 9)]); + *WriteRealFix__58_s->i -= 1; + Texts_Write(&*WriteRealFix__58_s->W, WriteRealFix__58_s->W__typ, (*WriteRealFix__58_s->d)[__X(*WriteRealFix__58_s->i, 9)]); n -= 1; } } @@ -1333,23 +1361,23 @@ void Texts_WriteRealFix (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n, INT1 CHAR sign; REAL x0; CHAR d[9]; - struct WriteRealFix__57 _s; + struct WriteRealFix__58 _s; _s.W = W; _s.W__typ = W__typ; _s.i = &i; _s.d = (void*)d; - _s.lnk = WriteRealFix__57_s; - WriteRealFix__57_s = &_s; + _s.lnk = WriteRealFix__58_s; + WriteRealFix__58_s = &_s; e = Reals_Expo(x); if (k < 0) { k = 0; } if (e == 0) { - seq__60(' ', (n - k) - 2); + seq__61(' ', (n - k) - 2); Texts_Write(&*W, W__typ, '0'); - seq__60(' ', k + 1); + seq__61(' ', k + 1); } else if (e == 255) { Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", 5); - seq__60(' ', n - 4); + seq__61(' ', n - 4); } else { e = __ASHR((e - 127) * 77, 8); if (x < (REAL)0) { @@ -1382,21 +1410,21 @@ void Texts_WriteRealFix (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n, INT1 i = k + e; Reals_Convert(x, i, (void*)d, 9); if (e > 0) { - seq__60(' ', ((n - e) - k) - 2); + seq__61(' ', ((n - e) - k) - 2); Texts_Write(&*W, W__typ, sign); - dig__58(e); + dig__59(e); Texts_Write(&*W, W__typ, '.'); - dig__58(k); + dig__59(k); } else { - seq__60(' ', (n - k) - 3); + seq__61(' ', (n - k) - 3); Texts_Write(&*W, W__typ, sign); Texts_Write(&*W, W__typ, '0'); Texts_Write(&*W, W__typ, '.'); - seq__60('0', -e); - dig__58(k + e); + seq__61('0', -e); + dig__59(k + e); } } - WriteRealFix__57_s = _s.lnk; + WriteRealFix__58_s = _s.lnk; } void Texts_WriteRealHex (Texts_Writer *W, ADDRESS *W__typ, REAL x) @@ -1495,48 +1523,48 @@ void Texts_WriteLongRealHex (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x) } while (!(i == 16)); } -static struct WriteDate__47 { +static struct WriteDate__48 { Texts_Writer *W; ADDRESS *W__typ; - struct WriteDate__47 *lnk; -} *WriteDate__47_s; + struct WriteDate__48 *lnk; +} *WriteDate__48_s; -static void WritePair__48 (CHAR ch, INT32 x); +static void WritePair__49 (CHAR ch, INT32 x); -static void WritePair__48 (CHAR ch, INT32 x) +static void WritePair__49 (CHAR ch, INT32 x) { - Texts_Write(&*WriteDate__47_s->W, WriteDate__47_s->W__typ, ch); - Texts_Write(&*WriteDate__47_s->W, WriteDate__47_s->W__typ, (CHAR)(__DIV(x, 10) + 48)); - Texts_Write(&*WriteDate__47_s->W, WriteDate__47_s->W__typ, (CHAR)((int)__MOD(x, 10) + 48)); + Texts_Write(&*WriteDate__48_s->W, WriteDate__48_s->W__typ, ch); + Texts_Write(&*WriteDate__48_s->W, WriteDate__48_s->W__typ, (CHAR)(__DIV(x, 10) + 48)); + Texts_Write(&*WriteDate__48_s->W, WriteDate__48_s->W__typ, (CHAR)((int)__MOD(x, 10) + 48)); } void Texts_WriteDate (Texts_Writer *W, ADDRESS *W__typ, INT32 t, INT32 d) { - struct WriteDate__47 _s; + struct WriteDate__48 _s; _s.W = W; _s.W__typ = W__typ; - _s.lnk = WriteDate__47_s; - WriteDate__47_s = &_s; - WritePair__48(' ', __MASK(d, -32)); - WritePair__48('.', __MASK(__ASHR(d, 5), -16)); - WritePair__48('.', __MASK(__ASHR(d, 9), -128)); - WritePair__48(' ', __MASK(__ASHR(t, 12), -32)); - WritePair__48(':', __MASK(__ASHR(t, 6), -64)); - WritePair__48(':', __MASK(t, -64)); - WriteDate__47_s = _s.lnk; + _s.lnk = WriteDate__48_s; + WriteDate__48_s = &_s; + WritePair__49(' ', __MASK(d, -32)); + WritePair__49('.', __MASK(__ASHR(d, 5), -16)); + WritePair__49('.', __MASK(__ASHR(d, 9), -128)); + WritePair__49(' ', __MASK(__ASHR(t, 12), -32)); + WritePair__49(':', __MASK(__ASHR(t, 6), -64)); + WritePair__49(':', __MASK(t, -64)); + WriteDate__48_s = _s.lnk; } -static struct Load0__20 { +static struct Load0__21 { Texts_Text *T; INT8 *ecnt; Files_File *f; Texts_FileMsg *msg; CHAR (*mods)[64][32], (*procs)[64][32]; - struct Load0__20 *lnk; -} *Load0__20_s; + struct Load0__21 *lnk; +} *Load0__21_s; -static void LoadElem__21 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e); +static void LoadElem__22 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e); -static void LoadElem__21 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e) +static void LoadElem__22 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e) { Modules_Module M = NIL; Modules_Command Cmd; @@ -1547,15 +1575,15 @@ static void LoadElem__21 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span Files_ReadLInt(&*r, r__typ, &ew); Files_ReadLInt(&*r, r__typ, &eh); Files_Read(&*r, r__typ, (void*)&eno); - if (eno > *Load0__20_s->ecnt) { - *Load0__20_s->ecnt = eno; - Files_ReadString(&*r, r__typ, (void*)(*Load0__20_s->mods)[__X(eno, 64)], 32); - Files_ReadString(&*r, r__typ, (void*)(*Load0__20_s->procs)[__X(eno, 64)], 32); + if (eno > *Load0__21_s->ecnt) { + *Load0__21_s->ecnt = eno; + Files_ReadString(&*r, r__typ, (void*)(*Load0__21_s->mods)[__X(eno, 64)], 32); + Files_ReadString(&*r, r__typ, (void*)(*Load0__21_s->procs)[__X(eno, 64)], 32); } org = Files_Pos(&*r, r__typ); - M = Modules_ThisMod((*Load0__20_s->mods)[__X(eno, 64)], 32); + M = Modules_ThisMod((*Load0__21_s->mods)[__X(eno, 64)], 32); if (M != NIL) { - Cmd = Modules_ThisCommand(M, (*Load0__20_s->procs)[__X(eno, 64)], 32); + Cmd = Modules_ThisCommand(M, (*Load0__21_s->procs)[__X(eno, 64)], 32); if (Cmd != NIL) { (*Cmd)(); } @@ -1564,25 +1592,25 @@ static void LoadElem__21 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span if (*e != NIL) { (*e)->W = ew; (*e)->H = eh; - (*e)->base = *Load0__20_s->T; - (*Load0__20_s->msg).pos = pos; - (*(*e)->handle)(*e, (void*)&*Load0__20_s->msg, Texts_FileMsg__typ); + (*e)->base = *Load0__21_s->T; + (*Load0__21_s->msg).pos = pos; + (*(*e)->handle)(*e, (void*)&*Load0__21_s->msg, Texts_FileMsg__typ); if (Files_Pos(&*r, r__typ) != org + span) { *e = NIL; } } if (*e == NIL) { - Files_Set(&*r, r__typ, *Load0__20_s->f, org + span); + Files_Set(&*r, r__typ, *Load0__21_s->f, org + span); __NEW(a, Texts__1); a->W = ew; a->H = eh; a->handle = Texts_HandleAlien; - a->base = *Load0__20_s->T; - a->file = *Load0__20_s->f; + a->base = *Load0__21_s->T; + a->file = *Load0__21_s->f; a->org = org; a->span = span; - __COPY((*Load0__20_s->mods)[__X(eno, 64)], a->mod, 32); - __COPY((*Load0__20_s->procs)[__X(eno, 64)], a->proc, 32); + __COPY((*Load0__21_s->mods)[__X(eno, 64)], a->mod, 32); + __COPY((*Load0__21_s->procs)[__X(eno, 64)], a->proc, 32); *e = (Texts_Elem)a; } } @@ -1599,15 +1627,15 @@ static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) CHAR mods[64][32], procs[64][32]; CHAR name[32]; Texts_FontsFont fnts[32]; - struct Load0__20 _s; + struct Load0__21 _s; _s.T = &T; _s.ecnt = &ecnt; _s.f = &f; _s.msg = &msg; _s.mods = (void*)mods; _s.procs = (void*)procs; - _s.lnk = Load0__20_s; - Load0__20_s = &_s; + _s.lnk = Load0__21_s; + Load0__21_s = &_s; pos = Files_Pos(&*r, r__typ); f = Files_Base(&*r, r__typ); __NEW(u, Texts_RunDesc); @@ -1640,7 +1668,7 @@ static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) un = (Texts_Run)p; un->len = plen; } else { - LoadElem__21(&msg.r, Files_Rider__typ, pos - org, -plen, &e); + LoadElem__22(&msg.r, Files_Rider__typ, pos - org, -plen, &e); un = (Texts_Run)e; un->len = 1; } @@ -1658,7 +1686,7 @@ static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) T->corg = 0; Files_ReadLInt(&msg.r, Files_Rider__typ, &T->len); Files_Set(&*r, r__typ, f, Files_Pos(&msg.r, Files_Rider__typ) + T->len); - Load0__20_s = _s.lnk; + Load0__21_s = _s.lnk; } void Texts_Load (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) @@ -1727,25 +1755,25 @@ void Texts_Open (Texts_Text T, CHAR *name, ADDRESS name__len) __DEL(name); } -static struct Store__43 { +static struct Store__44 { INT8 *ecnt; Texts_FileMsg *msg; Texts_IdentifyMsg *iden; CHAR (*mods)[64][32], (*procs)[64][32]; - struct Store__43 *lnk; -} *Store__43_s; + struct Store__44 *lnk; +} *Store__44_s; -static void StoreElem__44 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e); +static void StoreElem__45 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e); -static void StoreElem__44 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e) +static void StoreElem__45 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e) { Files_Rider r1; INT32 org, span; INT8 eno; - __COPY((*Store__43_s->iden).mod, (*Store__43_s->mods)[__X(*Store__43_s->ecnt, 64)], 32); - __COPY((*Store__43_s->iden).proc, (*Store__43_s->procs)[__X(*Store__43_s->ecnt, 64)], 32); + __COPY((*Store__44_s->iden).mod, (*Store__44_s->mods)[__X(*Store__44_s->ecnt, 64)], 32); + __COPY((*Store__44_s->iden).proc, (*Store__44_s->procs)[__X(*Store__44_s->ecnt, 64)], 32); eno = 1; - while (__STRCMP((*Store__43_s->mods)[__X(eno, 64)], (*Store__43_s->iden).mod) != 0 || __STRCMP((*Store__43_s->procs)[__X(eno, 64)], (*Store__43_s->iden).proc) != 0) { + while (__STRCMP((*Store__44_s->mods)[__X(eno, 64)], (*Store__44_s->iden).mod) != 0 || __STRCMP((*Store__44_s->procs)[__X(eno, 64)], (*Store__44_s->iden).proc) != 0) { eno += 1; } Files_Set(&r1, Files_Rider__typ, Files_Base(&*r, r__typ), Files_Pos(&*r, r__typ)); @@ -1753,14 +1781,14 @@ static void StoreElem__44 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Ele Files_WriteLInt(&*r, r__typ, 0); Files_WriteLInt(&*r, r__typ, 0); Files_Write(&*r, r__typ, eno); - if (eno == *Store__43_s->ecnt) { - *Store__43_s->ecnt += 1; - Files_WriteString(&*r, r__typ, (*Store__43_s->iden).mod, 32); - Files_WriteString(&*r, r__typ, (*Store__43_s->iden).proc, 32); + if (eno == *Store__44_s->ecnt) { + *Store__44_s->ecnt += 1; + Files_WriteString(&*r, r__typ, (*Store__44_s->iden).mod, 32); + Files_WriteString(&*r, r__typ, (*Store__44_s->iden).proc, 32); } - (*Store__43_s->msg).pos = pos; + (*Store__44_s->msg).pos = pos; org = Files_Pos(&*r, r__typ); - (*e->handle)(e, (void*)&*Store__43_s->msg, Texts_FileMsg__typ); + (*e->handle)(e, (void*)&*Store__44_s->msg, Texts_FileMsg__typ); span = Files_Pos(&*r, r__typ) - org; Files_WriteLInt(&r1, Files_Rider__typ, -span); Files_WriteLInt(&r1, Files_Rider__typ, e->W); @@ -1781,14 +1809,14 @@ void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) CHAR mods[64][32], procs[64][32]; Texts_FontsFont fnts[32]; CHAR block[1024]; - struct Store__43 _s; + struct Store__44 _s; _s.ecnt = &ecnt; _s.msg = &msg; _s.iden = &iden; _s.mods = (void*)mods; _s.procs = (void*)procs; - _s.lnk = Store__43_s; - Store__43_s = &_s; + _s.lnk = Store__44_s; + Store__44_s = &_s; org = Files_Pos(&*r, r__typ); msg.id = 1; msg.r = *r; @@ -1830,7 +1858,7 @@ void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) pos += rlen; u = un; } else if (iden.mod[0] != 0x00) { - StoreElem__44(&msg.r, Files_Rider__typ, pos, __GUARDP(u, Texts_ElemDesc, 1)); + StoreElem__45(&msg.r, Files_Rider__typ, pos, __GUARDP(u, Texts_ElemDesc, 1)); pos += 1; u = u->next; } else { @@ -1884,7 +1912,7 @@ void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) if (T->notify != NIL) { (*T->notify)(T, 3, 0, 0); } - Store__43_s = _s.lnk; + Store__44_s = _s.lnk; } void Texts_Close (Texts_Text T, CHAR *name, ADDRESS name__len) diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index 5450b303..4825ab70 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -193,6 +193,7 @@ export void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); export void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); export void Texts_Delete (Texts_Text T, INT32 beg, INT32 end); static void Texts_DumpElem (Texts_Elem e); +static void Texts_DumpPiece (Texts_Piece p); export void Texts_DumpReader (Texts_Reader re); static void Texts_DumpRun (Texts_Run ru); static void Texts_DumpText (Texts_Text t); @@ -256,30 +257,9 @@ static void Texts_DumpText (Texts_Text t) Out_Ln(); } -static void Texts_DumpElem (Texts_Elem e) -{ - Out_String((CHAR*)" W: ", 13); - Out_Int(e->W, 1); - Out_Ln(); - Out_String((CHAR*)" H: ", 13); - Out_Int(e->H, 1); - Out_Ln(); - Out_String((CHAR*)" handle: ", 13); - Out_Hex((INT32)(ADDRESS)e->handle, 1); - Out_Ln(); - Out_String((CHAR*)" base: ", 13); - if (e->base == NIL) { - Out_String((CHAR*)"", 6); - Out_Ln(); - } else { - Out_Ln(); - Texts_DumpText(e->base); - } -} - static void Texts_DumpRun (Texts_Run ru) { - Out_String((CHAR*)" Run at ", 10); + Out_String((CHAR*)" Run at ", 12); Out_Hex((INT32)(ADDRESS)ru, 1); Out_Ln(); Out_String((CHAR*)" prev: ", 12); @@ -313,6 +293,48 @@ static void Texts_DumpRun (Texts_Run ru) Out_Ln(); } +static void Texts_DumpElem (Texts_Elem e) +{ + Texts_DumpRun((void*)e); + Out_String((CHAR*)" -- Elem --", 15); + Out_Ln(); + Out_String((CHAR*)" W: ", 13); + Out_Int(e->W, 1); + Out_Ln(); + Out_String((CHAR*)" H: ", 13); + Out_Int(e->H, 1); + Out_Ln(); + Out_String((CHAR*)" handle: ", 13); + Out_Hex((INT32)(ADDRESS)e->handle, 1); + Out_Ln(); + Out_String((CHAR*)" base: ", 13); + if (e->base == NIL) { + Out_String((CHAR*)"", 6); + Out_Ln(); + } else { + Out_Ln(); + Texts_DumpText(e->base); + } +} + +static void Texts_DumpPiece (Texts_Piece p) +{ + Texts_DumpRun((void*)p); + Out_String((CHAR*)" -- Piece --", 16); + Out_Ln(); + Out_String((CHAR*)" file: ", 12); + if (p->file == NIL) { + Out_String((CHAR*)"", 6); + Out_Ln(); + } else { + Out_Ln(); + Files_DumpFile(p->file, 3); + } + Out_String((CHAR*)" org: ", 12); + Out_Int(p->org, 1); + Out_Ln(); +} + void Texts_DumpReader (Texts_Reader re) { Out_String((CHAR*)"Reader:", 8); @@ -360,7 +382,13 @@ void Texts_DumpReader (Texts_Reader re) Out_Ln(); } else { Out_Ln(); - Texts_DumpRun(re.run); + if (__ISP(re.run, Texts_PieceDesc, 1)) { + Texts_DumpPiece(__GUARDP(re.run, Texts_PieceDesc, 1)); + } else if (__ISP(re.run, Texts_ElemDesc, 1)) { + Texts_DumpElem(__GUARDP(re.run, Texts_ElemDesc, 1)); + } else { + Texts_DumpRun(re.run); + } } } @@ -848,32 +876,32 @@ void Texts_OpenScanner (Texts_Scanner *S, ADDRESS *S__typ, Texts_Text T, INT32 p (*S).nextCh = ' '; } -static struct Scan__35 { +static struct Scan__36 { Texts_Scanner *S; ADDRESS *S__typ; CHAR *ch; BOOLEAN *negE; INT16 *e; - struct Scan__35 *lnk; -} *Scan__35_s; + struct Scan__36 *lnk; +} *Scan__36_s; -static void ReadScaleFactor__36 (void); +static void ReadScaleFactor__37 (void); -static void ReadScaleFactor__36 (void) +static void ReadScaleFactor__37 (void) { - Texts_Read((void*)&*Scan__35_s->S, Scan__35_s->S__typ, &*Scan__35_s->ch); - if (*Scan__35_s->ch == '-') { - *Scan__35_s->negE = 1; - Texts_Read((void*)&*Scan__35_s->S, Scan__35_s->S__typ, &*Scan__35_s->ch); + Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); + if (*Scan__36_s->ch == '-') { + *Scan__36_s->negE = 1; + Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); } else { - *Scan__35_s->negE = 0; - if (*Scan__35_s->ch == '+') { - Texts_Read((void*)&*Scan__35_s->S, Scan__35_s->S__typ, &*Scan__35_s->ch); + *Scan__36_s->negE = 0; + if (*Scan__36_s->ch == '+') { + Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); } } - while (('0' <= *Scan__35_s->ch && *Scan__35_s->ch <= '9')) { - *Scan__35_s->e = (*Scan__35_s->e * 10 + (INT16)*Scan__35_s->ch) - 48; - Texts_Read((void*)&*Scan__35_s->S, Scan__35_s->S__typ, &*Scan__35_s->ch); + while (('0' <= *Scan__36_s->ch && *Scan__36_s->ch <= '9')) { + *Scan__36_s->e = (*Scan__36_s->e * 10 + (INT16)*Scan__36_s->ch) - 48; + Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); } } @@ -887,13 +915,13 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) REAL x, f; LONGREAL y, g; CHAR d[32]; - struct Scan__35 _s; + struct Scan__36 _s; _s.S = S; _s.S__typ = S__typ; _s.ch = &ch; _s.negE = &negE; _s.e = &e; - _s.lnk = Scan__35_s; - Scan__35_s = &_s; + _s.lnk = Scan__36_s; + Scan__36_s = &_s; ch = (*S).nextCh; i = 0; for (;;) { @@ -994,7 +1022,7 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) y = ((INT16)d[__X(j, 32)] - 48) * g + y; j += 1; } - ReadScaleFactor__36(); + ReadScaleFactor__37(); if (negE) { if (e <= 308) { y = y / (LONGREAL)Reals_TenL(e); @@ -1027,7 +1055,7 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) j += 1; } if (ch == 'E') { - ReadScaleFactor__36(); + ReadScaleFactor__37(); } if (negE) { if (e <= 38) { @@ -1080,7 +1108,7 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) } } (*S).nextCh = ch; - Scan__35_s = _s.lnk; + Scan__36_s = _s.lnk; } void Texts_OpenWriter (Texts_Writer *W, ADDRESS *W__typ) @@ -1299,30 +1327,30 @@ void Texts_WriteReal (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n) } } -static struct WriteRealFix__57 { +static struct WriteRealFix__58 { Texts_Writer *W; ADDRESS *W__typ; INT16 *i; CHAR (*d)[9]; - struct WriteRealFix__57 *lnk; -} *WriteRealFix__57_s; + struct WriteRealFix__58 *lnk; +} *WriteRealFix__58_s; -static void dig__58 (INT16 n); -static void seq__60 (CHAR ch, INT16 n); +static void dig__59 (INT16 n); +static void seq__61 (CHAR ch, INT16 n); -static void seq__60 (CHAR ch, INT16 n) +static void seq__61 (CHAR ch, INT16 n) { while (n > 0) { - Texts_Write(&*WriteRealFix__57_s->W, WriteRealFix__57_s->W__typ, ch); + Texts_Write(&*WriteRealFix__58_s->W, WriteRealFix__58_s->W__typ, ch); n -= 1; } } -static void dig__58 (INT16 n) +static void dig__59 (INT16 n) { while (n > 0) { - *WriteRealFix__57_s->i -= 1; - Texts_Write(&*WriteRealFix__57_s->W, WriteRealFix__57_s->W__typ, (*WriteRealFix__57_s->d)[__X(*WriteRealFix__57_s->i, 9)]); + *WriteRealFix__58_s->i -= 1; + Texts_Write(&*WriteRealFix__58_s->W, WriteRealFix__58_s->W__typ, (*WriteRealFix__58_s->d)[__X(*WriteRealFix__58_s->i, 9)]); n -= 1; } } @@ -1333,23 +1361,23 @@ void Texts_WriteRealFix (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n, INT1 CHAR sign; REAL x0; CHAR d[9]; - struct WriteRealFix__57 _s; + struct WriteRealFix__58 _s; _s.W = W; _s.W__typ = W__typ; _s.i = &i; _s.d = (void*)d; - _s.lnk = WriteRealFix__57_s; - WriteRealFix__57_s = &_s; + _s.lnk = WriteRealFix__58_s; + WriteRealFix__58_s = &_s; e = Reals_Expo(x); if (k < 0) { k = 0; } if (e == 0) { - seq__60(' ', (n - k) - 2); + seq__61(' ', (n - k) - 2); Texts_Write(&*W, W__typ, '0'); - seq__60(' ', k + 1); + seq__61(' ', k + 1); } else if (e == 255) { Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", 5); - seq__60(' ', n - 4); + seq__61(' ', n - 4); } else { e = __ASHR((e - 127) * 77, 8); if (x < (REAL)0) { @@ -1382,21 +1410,21 @@ void Texts_WriteRealFix (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n, INT1 i = k + e; Reals_Convert(x, i, (void*)d, 9); if (e > 0) { - seq__60(' ', ((n - e) - k) - 2); + seq__61(' ', ((n - e) - k) - 2); Texts_Write(&*W, W__typ, sign); - dig__58(e); + dig__59(e); Texts_Write(&*W, W__typ, '.'); - dig__58(k); + dig__59(k); } else { - seq__60(' ', (n - k) - 3); + seq__61(' ', (n - k) - 3); Texts_Write(&*W, W__typ, sign); Texts_Write(&*W, W__typ, '0'); Texts_Write(&*W, W__typ, '.'); - seq__60('0', -e); - dig__58(k + e); + seq__61('0', -e); + dig__59(k + e); } } - WriteRealFix__57_s = _s.lnk; + WriteRealFix__58_s = _s.lnk; } void Texts_WriteRealHex (Texts_Writer *W, ADDRESS *W__typ, REAL x) @@ -1495,48 +1523,48 @@ void Texts_WriteLongRealHex (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x) } while (!(i == 16)); } -static struct WriteDate__47 { +static struct WriteDate__48 { Texts_Writer *W; ADDRESS *W__typ; - struct WriteDate__47 *lnk; -} *WriteDate__47_s; + struct WriteDate__48 *lnk; +} *WriteDate__48_s; -static void WritePair__48 (CHAR ch, INT32 x); +static void WritePair__49 (CHAR ch, INT32 x); -static void WritePair__48 (CHAR ch, INT32 x) +static void WritePair__49 (CHAR ch, INT32 x) { - Texts_Write(&*WriteDate__47_s->W, WriteDate__47_s->W__typ, ch); - Texts_Write(&*WriteDate__47_s->W, WriteDate__47_s->W__typ, (CHAR)(__DIV(x, 10) + 48)); - Texts_Write(&*WriteDate__47_s->W, WriteDate__47_s->W__typ, (CHAR)((int)__MOD(x, 10) + 48)); + Texts_Write(&*WriteDate__48_s->W, WriteDate__48_s->W__typ, ch); + Texts_Write(&*WriteDate__48_s->W, WriteDate__48_s->W__typ, (CHAR)(__DIV(x, 10) + 48)); + Texts_Write(&*WriteDate__48_s->W, WriteDate__48_s->W__typ, (CHAR)((int)__MOD(x, 10) + 48)); } void Texts_WriteDate (Texts_Writer *W, ADDRESS *W__typ, INT32 t, INT32 d) { - struct WriteDate__47 _s; + struct WriteDate__48 _s; _s.W = W; _s.W__typ = W__typ; - _s.lnk = WriteDate__47_s; - WriteDate__47_s = &_s; - WritePair__48(' ', __MASK(d, -32)); - WritePair__48('.', __MASK(__ASHR(d, 5), -16)); - WritePair__48('.', __MASK(__ASHR(d, 9), -128)); - WritePair__48(' ', __MASK(__ASHR(t, 12), -32)); - WritePair__48(':', __MASK(__ASHR(t, 6), -64)); - WritePair__48(':', __MASK(t, -64)); - WriteDate__47_s = _s.lnk; + _s.lnk = WriteDate__48_s; + WriteDate__48_s = &_s; + WritePair__49(' ', __MASK(d, -32)); + WritePair__49('.', __MASK(__ASHR(d, 5), -16)); + WritePair__49('.', __MASK(__ASHR(d, 9), -128)); + WritePair__49(' ', __MASK(__ASHR(t, 12), -32)); + WritePair__49(':', __MASK(__ASHR(t, 6), -64)); + WritePair__49(':', __MASK(t, -64)); + WriteDate__48_s = _s.lnk; } -static struct Load0__20 { +static struct Load0__21 { Texts_Text *T; INT8 *ecnt; Files_File *f; Texts_FileMsg *msg; CHAR (*mods)[64][32], (*procs)[64][32]; - struct Load0__20 *lnk; -} *Load0__20_s; + struct Load0__21 *lnk; +} *Load0__21_s; -static void LoadElem__21 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e); +static void LoadElem__22 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e); -static void LoadElem__21 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e) +static void LoadElem__22 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e) { Modules_Module M = NIL; Modules_Command Cmd; @@ -1547,15 +1575,15 @@ static void LoadElem__21 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span Files_ReadLInt(&*r, r__typ, &ew); Files_ReadLInt(&*r, r__typ, &eh); Files_Read(&*r, r__typ, (void*)&eno); - if (eno > *Load0__20_s->ecnt) { - *Load0__20_s->ecnt = eno; - Files_ReadString(&*r, r__typ, (void*)(*Load0__20_s->mods)[__X(eno, 64)], 32); - Files_ReadString(&*r, r__typ, (void*)(*Load0__20_s->procs)[__X(eno, 64)], 32); + if (eno > *Load0__21_s->ecnt) { + *Load0__21_s->ecnt = eno; + Files_ReadString(&*r, r__typ, (void*)(*Load0__21_s->mods)[__X(eno, 64)], 32); + Files_ReadString(&*r, r__typ, (void*)(*Load0__21_s->procs)[__X(eno, 64)], 32); } org = Files_Pos(&*r, r__typ); - M = Modules_ThisMod((*Load0__20_s->mods)[__X(eno, 64)], 32); + M = Modules_ThisMod((*Load0__21_s->mods)[__X(eno, 64)], 32); if (M != NIL) { - Cmd = Modules_ThisCommand(M, (*Load0__20_s->procs)[__X(eno, 64)], 32); + Cmd = Modules_ThisCommand(M, (*Load0__21_s->procs)[__X(eno, 64)], 32); if (Cmd != NIL) { (*Cmd)(); } @@ -1564,25 +1592,25 @@ static void LoadElem__21 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span if (*e != NIL) { (*e)->W = ew; (*e)->H = eh; - (*e)->base = *Load0__20_s->T; - (*Load0__20_s->msg).pos = pos; - (*(*e)->handle)(*e, (void*)&*Load0__20_s->msg, Texts_FileMsg__typ); + (*e)->base = *Load0__21_s->T; + (*Load0__21_s->msg).pos = pos; + (*(*e)->handle)(*e, (void*)&*Load0__21_s->msg, Texts_FileMsg__typ); if (Files_Pos(&*r, r__typ) != org + span) { *e = NIL; } } if (*e == NIL) { - Files_Set(&*r, r__typ, *Load0__20_s->f, org + span); + Files_Set(&*r, r__typ, *Load0__21_s->f, org + span); __NEW(a, Texts__1); a->W = ew; a->H = eh; a->handle = Texts_HandleAlien; - a->base = *Load0__20_s->T; - a->file = *Load0__20_s->f; + a->base = *Load0__21_s->T; + a->file = *Load0__21_s->f; a->org = org; a->span = span; - __COPY((*Load0__20_s->mods)[__X(eno, 64)], a->mod, 32); - __COPY((*Load0__20_s->procs)[__X(eno, 64)], a->proc, 32); + __COPY((*Load0__21_s->mods)[__X(eno, 64)], a->mod, 32); + __COPY((*Load0__21_s->procs)[__X(eno, 64)], a->proc, 32); *e = (Texts_Elem)a; } } @@ -1599,15 +1627,15 @@ static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) CHAR mods[64][32], procs[64][32]; CHAR name[32]; Texts_FontsFont fnts[32]; - struct Load0__20 _s; + struct Load0__21 _s; _s.T = &T; _s.ecnt = &ecnt; _s.f = &f; _s.msg = &msg; _s.mods = (void*)mods; _s.procs = (void*)procs; - _s.lnk = Load0__20_s; - Load0__20_s = &_s; + _s.lnk = Load0__21_s; + Load0__21_s = &_s; pos = Files_Pos(&*r, r__typ); f = Files_Base(&*r, r__typ); __NEW(u, Texts_RunDesc); @@ -1640,7 +1668,7 @@ static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) un = (Texts_Run)p; un->len = plen; } else { - LoadElem__21(&msg.r, Files_Rider__typ, pos - org, -plen, &e); + LoadElem__22(&msg.r, Files_Rider__typ, pos - org, -plen, &e); un = (Texts_Run)e; un->len = 1; } @@ -1658,7 +1686,7 @@ static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) T->corg = 0; Files_ReadLInt(&msg.r, Files_Rider__typ, &T->len); Files_Set(&*r, r__typ, f, Files_Pos(&msg.r, Files_Rider__typ) + T->len); - Load0__20_s = _s.lnk; + Load0__21_s = _s.lnk; } void Texts_Load (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) @@ -1727,25 +1755,25 @@ void Texts_Open (Texts_Text T, CHAR *name, ADDRESS name__len) __DEL(name); } -static struct Store__43 { +static struct Store__44 { INT8 *ecnt; Texts_FileMsg *msg; Texts_IdentifyMsg *iden; CHAR (*mods)[64][32], (*procs)[64][32]; - struct Store__43 *lnk; -} *Store__43_s; + struct Store__44 *lnk; +} *Store__44_s; -static void StoreElem__44 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e); +static void StoreElem__45 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e); -static void StoreElem__44 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e) +static void StoreElem__45 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e) { Files_Rider r1; INT32 org, span; INT8 eno; - __COPY((*Store__43_s->iden).mod, (*Store__43_s->mods)[__X(*Store__43_s->ecnt, 64)], 32); - __COPY((*Store__43_s->iden).proc, (*Store__43_s->procs)[__X(*Store__43_s->ecnt, 64)], 32); + __COPY((*Store__44_s->iden).mod, (*Store__44_s->mods)[__X(*Store__44_s->ecnt, 64)], 32); + __COPY((*Store__44_s->iden).proc, (*Store__44_s->procs)[__X(*Store__44_s->ecnt, 64)], 32); eno = 1; - while (__STRCMP((*Store__43_s->mods)[__X(eno, 64)], (*Store__43_s->iden).mod) != 0 || __STRCMP((*Store__43_s->procs)[__X(eno, 64)], (*Store__43_s->iden).proc) != 0) { + while (__STRCMP((*Store__44_s->mods)[__X(eno, 64)], (*Store__44_s->iden).mod) != 0 || __STRCMP((*Store__44_s->procs)[__X(eno, 64)], (*Store__44_s->iden).proc) != 0) { eno += 1; } Files_Set(&r1, Files_Rider__typ, Files_Base(&*r, r__typ), Files_Pos(&*r, r__typ)); @@ -1753,14 +1781,14 @@ static void StoreElem__44 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Ele Files_WriteLInt(&*r, r__typ, 0); Files_WriteLInt(&*r, r__typ, 0); Files_Write(&*r, r__typ, eno); - if (eno == *Store__43_s->ecnt) { - *Store__43_s->ecnt += 1; - Files_WriteString(&*r, r__typ, (*Store__43_s->iden).mod, 32); - Files_WriteString(&*r, r__typ, (*Store__43_s->iden).proc, 32); + if (eno == *Store__44_s->ecnt) { + *Store__44_s->ecnt += 1; + Files_WriteString(&*r, r__typ, (*Store__44_s->iden).mod, 32); + Files_WriteString(&*r, r__typ, (*Store__44_s->iden).proc, 32); } - (*Store__43_s->msg).pos = pos; + (*Store__44_s->msg).pos = pos; org = Files_Pos(&*r, r__typ); - (*e->handle)(e, (void*)&*Store__43_s->msg, Texts_FileMsg__typ); + (*e->handle)(e, (void*)&*Store__44_s->msg, Texts_FileMsg__typ); span = Files_Pos(&*r, r__typ) - org; Files_WriteLInt(&r1, Files_Rider__typ, -span); Files_WriteLInt(&r1, Files_Rider__typ, e->W); @@ -1781,14 +1809,14 @@ void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) CHAR mods[64][32], procs[64][32]; Texts_FontsFont fnts[32]; CHAR block[1024]; - struct Store__43 _s; + struct Store__44 _s; _s.ecnt = &ecnt; _s.msg = &msg; _s.iden = &iden; _s.mods = (void*)mods; _s.procs = (void*)procs; - _s.lnk = Store__43_s; - Store__43_s = &_s; + _s.lnk = Store__44_s; + Store__44_s = &_s; org = Files_Pos(&*r, r__typ); msg.id = 1; msg.r = *r; @@ -1830,7 +1858,7 @@ void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) pos += rlen; u = un; } else if (iden.mod[0] != 0x00) { - StoreElem__44(&msg.r, Files_Rider__typ, pos, __GUARDP(u, Texts_ElemDesc, 1)); + StoreElem__45(&msg.r, Files_Rider__typ, pos, __GUARDP(u, Texts_ElemDesc, 1)); pos += 1; u = u->next; } else { @@ -1884,7 +1912,7 @@ void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) if (T->notify != NIL) { (*T->notify)(T, 3, 0, 0); } - Store__43_s = _s.lnk; + Store__44_s = _s.lnk; } void Texts_Close (Texts_Text T, CHAR *name, ADDRESS name__len) diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index c7301f23..9887162e 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -193,6 +193,7 @@ export void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); export void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); export void Texts_Delete (Texts_Text T, INT32 beg, INT32 end); static void Texts_DumpElem (Texts_Elem e); +static void Texts_DumpPiece (Texts_Piece p); export void Texts_DumpReader (Texts_Reader re); static void Texts_DumpRun (Texts_Run ru); static void Texts_DumpText (Texts_Text t); @@ -256,30 +257,9 @@ static void Texts_DumpText (Texts_Text t) Out_Ln(); } -static void Texts_DumpElem (Texts_Elem e) -{ - Out_String((CHAR*)" W: ", 13); - Out_Int(e->W, 1); - Out_Ln(); - Out_String((CHAR*)" H: ", 13); - Out_Int(e->H, 1); - Out_Ln(); - Out_String((CHAR*)" handle: ", 13); - Out_Hex((INT64)(ADDRESS)e->handle, 1); - Out_Ln(); - Out_String((CHAR*)" base: ", 13); - if (e->base == NIL) { - Out_String((CHAR*)"", 6); - Out_Ln(); - } else { - Out_Ln(); - Texts_DumpText(e->base); - } -} - static void Texts_DumpRun (Texts_Run ru) { - Out_String((CHAR*)" Run at ", 10); + Out_String((CHAR*)" Run at ", 12); Out_Hex((INT64)(ADDRESS)ru, 1); Out_Ln(); Out_String((CHAR*)" prev: ", 12); @@ -313,6 +293,48 @@ static void Texts_DumpRun (Texts_Run ru) Out_Ln(); } +static void Texts_DumpElem (Texts_Elem e) +{ + Texts_DumpRun((void*)e); + Out_String((CHAR*)" -- Elem --", 15); + Out_Ln(); + Out_String((CHAR*)" W: ", 13); + Out_Int(e->W, 1); + Out_Ln(); + Out_String((CHAR*)" H: ", 13); + Out_Int(e->H, 1); + Out_Ln(); + Out_String((CHAR*)" handle: ", 13); + Out_Hex((INT64)(ADDRESS)e->handle, 1); + Out_Ln(); + Out_String((CHAR*)" base: ", 13); + if (e->base == NIL) { + Out_String((CHAR*)"", 6); + Out_Ln(); + } else { + Out_Ln(); + Texts_DumpText(e->base); + } +} + +static void Texts_DumpPiece (Texts_Piece p) +{ + Texts_DumpRun((void*)p); + Out_String((CHAR*)" -- Piece --", 16); + Out_Ln(); + Out_String((CHAR*)" file: ", 12); + if (p->file == NIL) { + Out_String((CHAR*)"", 6); + Out_Ln(); + } else { + Out_Ln(); + Files_DumpFile(p->file, 3); + } + Out_String((CHAR*)" org: ", 12); + Out_Int(p->org, 1); + Out_Ln(); +} + void Texts_DumpReader (Texts_Reader re) { Out_String((CHAR*)"Reader:", 8); @@ -360,7 +382,13 @@ void Texts_DumpReader (Texts_Reader re) Out_Ln(); } else { Out_Ln(); - Texts_DumpRun(re.run); + if (__ISP(re.run, Texts_PieceDesc, 1)) { + Texts_DumpPiece(__GUARDP(re.run, Texts_PieceDesc, 1)); + } else if (__ISP(re.run, Texts_ElemDesc, 1)) { + Texts_DumpElem(__GUARDP(re.run, Texts_ElemDesc, 1)); + } else { + Texts_DumpRun(re.run); + } } } @@ -848,32 +876,32 @@ void Texts_OpenScanner (Texts_Scanner *S, ADDRESS *S__typ, Texts_Text T, INT32 p (*S).nextCh = ' '; } -static struct Scan__35 { +static struct Scan__36 { Texts_Scanner *S; ADDRESS *S__typ; CHAR *ch; BOOLEAN *negE; INT16 *e; - struct Scan__35 *lnk; -} *Scan__35_s; + struct Scan__36 *lnk; +} *Scan__36_s; -static void ReadScaleFactor__36 (void); +static void ReadScaleFactor__37 (void); -static void ReadScaleFactor__36 (void) +static void ReadScaleFactor__37 (void) { - Texts_Read((void*)&*Scan__35_s->S, Scan__35_s->S__typ, &*Scan__35_s->ch); - if (*Scan__35_s->ch == '-') { - *Scan__35_s->negE = 1; - Texts_Read((void*)&*Scan__35_s->S, Scan__35_s->S__typ, &*Scan__35_s->ch); + Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); + if (*Scan__36_s->ch == '-') { + *Scan__36_s->negE = 1; + Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); } else { - *Scan__35_s->negE = 0; - if (*Scan__35_s->ch == '+') { - Texts_Read((void*)&*Scan__35_s->S, Scan__35_s->S__typ, &*Scan__35_s->ch); + *Scan__36_s->negE = 0; + if (*Scan__36_s->ch == '+') { + Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); } } - while (('0' <= *Scan__35_s->ch && *Scan__35_s->ch <= '9')) { - *Scan__35_s->e = (*Scan__35_s->e * 10 + (INT16)*Scan__35_s->ch) - 48; - Texts_Read((void*)&*Scan__35_s->S, Scan__35_s->S__typ, &*Scan__35_s->ch); + while (('0' <= *Scan__36_s->ch && *Scan__36_s->ch <= '9')) { + *Scan__36_s->e = (*Scan__36_s->e * 10 + (INT16)*Scan__36_s->ch) - 48; + Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); } } @@ -887,13 +915,13 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) REAL x, f; LONGREAL y, g; CHAR d[32]; - struct Scan__35 _s; + struct Scan__36 _s; _s.S = S; _s.S__typ = S__typ; _s.ch = &ch; _s.negE = &negE; _s.e = &e; - _s.lnk = Scan__35_s; - Scan__35_s = &_s; + _s.lnk = Scan__36_s; + Scan__36_s = &_s; ch = (*S).nextCh; i = 0; for (;;) { @@ -994,7 +1022,7 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) y = ((INT16)d[__X(j, 32)] - 48) * g + y; j += 1; } - ReadScaleFactor__36(); + ReadScaleFactor__37(); if (negE) { if (e <= 308) { y = y / (LONGREAL)Reals_TenL(e); @@ -1027,7 +1055,7 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) j += 1; } if (ch == 'E') { - ReadScaleFactor__36(); + ReadScaleFactor__37(); } if (negE) { if (e <= 38) { @@ -1080,7 +1108,7 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) } } (*S).nextCh = ch; - Scan__35_s = _s.lnk; + Scan__36_s = _s.lnk; } void Texts_OpenWriter (Texts_Writer *W, ADDRESS *W__typ) @@ -1299,30 +1327,30 @@ void Texts_WriteReal (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n) } } -static struct WriteRealFix__57 { +static struct WriteRealFix__58 { Texts_Writer *W; ADDRESS *W__typ; INT16 *i; CHAR (*d)[9]; - struct WriteRealFix__57 *lnk; -} *WriteRealFix__57_s; + struct WriteRealFix__58 *lnk; +} *WriteRealFix__58_s; -static void dig__58 (INT16 n); -static void seq__60 (CHAR ch, INT16 n); +static void dig__59 (INT16 n); +static void seq__61 (CHAR ch, INT16 n); -static void seq__60 (CHAR ch, INT16 n) +static void seq__61 (CHAR ch, INT16 n) { while (n > 0) { - Texts_Write(&*WriteRealFix__57_s->W, WriteRealFix__57_s->W__typ, ch); + Texts_Write(&*WriteRealFix__58_s->W, WriteRealFix__58_s->W__typ, ch); n -= 1; } } -static void dig__58 (INT16 n) +static void dig__59 (INT16 n) { while (n > 0) { - *WriteRealFix__57_s->i -= 1; - Texts_Write(&*WriteRealFix__57_s->W, WriteRealFix__57_s->W__typ, (*WriteRealFix__57_s->d)[__X(*WriteRealFix__57_s->i, 9)]); + *WriteRealFix__58_s->i -= 1; + Texts_Write(&*WriteRealFix__58_s->W, WriteRealFix__58_s->W__typ, (*WriteRealFix__58_s->d)[__X(*WriteRealFix__58_s->i, 9)]); n -= 1; } } @@ -1333,23 +1361,23 @@ void Texts_WriteRealFix (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n, INT1 CHAR sign; REAL x0; CHAR d[9]; - struct WriteRealFix__57 _s; + struct WriteRealFix__58 _s; _s.W = W; _s.W__typ = W__typ; _s.i = &i; _s.d = (void*)d; - _s.lnk = WriteRealFix__57_s; - WriteRealFix__57_s = &_s; + _s.lnk = WriteRealFix__58_s; + WriteRealFix__58_s = &_s; e = Reals_Expo(x); if (k < 0) { k = 0; } if (e == 0) { - seq__60(' ', (n - k) - 2); + seq__61(' ', (n - k) - 2); Texts_Write(&*W, W__typ, '0'); - seq__60(' ', k + 1); + seq__61(' ', k + 1); } else if (e == 255) { Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", 5); - seq__60(' ', n - 4); + seq__61(' ', n - 4); } else { e = __ASHR((e - 127) * 77, 8); if (x < (REAL)0) { @@ -1382,21 +1410,21 @@ void Texts_WriteRealFix (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n, INT1 i = k + e; Reals_Convert(x, i, (void*)d, 9); if (e > 0) { - seq__60(' ', ((n - e) - k) - 2); + seq__61(' ', ((n - e) - k) - 2); Texts_Write(&*W, W__typ, sign); - dig__58(e); + dig__59(e); Texts_Write(&*W, W__typ, '.'); - dig__58(k); + dig__59(k); } else { - seq__60(' ', (n - k) - 3); + seq__61(' ', (n - k) - 3); Texts_Write(&*W, W__typ, sign); Texts_Write(&*W, W__typ, '0'); Texts_Write(&*W, W__typ, '.'); - seq__60('0', -e); - dig__58(k + e); + seq__61('0', -e); + dig__59(k + e); } } - WriteRealFix__57_s = _s.lnk; + WriteRealFix__58_s = _s.lnk; } void Texts_WriteRealHex (Texts_Writer *W, ADDRESS *W__typ, REAL x) @@ -1495,48 +1523,48 @@ void Texts_WriteLongRealHex (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x) } while (!(i == 16)); } -static struct WriteDate__47 { +static struct WriteDate__48 { Texts_Writer *W; ADDRESS *W__typ; - struct WriteDate__47 *lnk; -} *WriteDate__47_s; + struct WriteDate__48 *lnk; +} *WriteDate__48_s; -static void WritePair__48 (CHAR ch, INT32 x); +static void WritePair__49 (CHAR ch, INT32 x); -static void WritePair__48 (CHAR ch, INT32 x) +static void WritePair__49 (CHAR ch, INT32 x) { - Texts_Write(&*WriteDate__47_s->W, WriteDate__47_s->W__typ, ch); - Texts_Write(&*WriteDate__47_s->W, WriteDate__47_s->W__typ, (CHAR)(__DIV(x, 10) + 48)); - Texts_Write(&*WriteDate__47_s->W, WriteDate__47_s->W__typ, (CHAR)((int)__MOD(x, 10) + 48)); + Texts_Write(&*WriteDate__48_s->W, WriteDate__48_s->W__typ, ch); + Texts_Write(&*WriteDate__48_s->W, WriteDate__48_s->W__typ, (CHAR)(__DIV(x, 10) + 48)); + Texts_Write(&*WriteDate__48_s->W, WriteDate__48_s->W__typ, (CHAR)((int)__MOD(x, 10) + 48)); } void Texts_WriteDate (Texts_Writer *W, ADDRESS *W__typ, INT32 t, INT32 d) { - struct WriteDate__47 _s; + struct WriteDate__48 _s; _s.W = W; _s.W__typ = W__typ; - _s.lnk = WriteDate__47_s; - WriteDate__47_s = &_s; - WritePair__48(' ', __MASK(d, -32)); - WritePair__48('.', __MASK(__ASHR(d, 5), -16)); - WritePair__48('.', __MASK(__ASHR(d, 9), -128)); - WritePair__48(' ', __MASK(__ASHR(t, 12), -32)); - WritePair__48(':', __MASK(__ASHR(t, 6), -64)); - WritePair__48(':', __MASK(t, -64)); - WriteDate__47_s = _s.lnk; + _s.lnk = WriteDate__48_s; + WriteDate__48_s = &_s; + WritePair__49(' ', __MASK(d, -32)); + WritePair__49('.', __MASK(__ASHR(d, 5), -16)); + WritePair__49('.', __MASK(__ASHR(d, 9), -128)); + WritePair__49(' ', __MASK(__ASHR(t, 12), -32)); + WritePair__49(':', __MASK(__ASHR(t, 6), -64)); + WritePair__49(':', __MASK(t, -64)); + WriteDate__48_s = _s.lnk; } -static struct Load0__20 { +static struct Load0__21 { Texts_Text *T; INT8 *ecnt; Files_File *f; Texts_FileMsg *msg; CHAR (*mods)[64][32], (*procs)[64][32]; - struct Load0__20 *lnk; -} *Load0__20_s; + struct Load0__21 *lnk; +} *Load0__21_s; -static void LoadElem__21 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e); +static void LoadElem__22 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e); -static void LoadElem__21 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e) +static void LoadElem__22 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e) { Modules_Module M = NIL; Modules_Command Cmd; @@ -1547,15 +1575,15 @@ static void LoadElem__21 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span Files_ReadLInt(&*r, r__typ, &ew); Files_ReadLInt(&*r, r__typ, &eh); Files_Read(&*r, r__typ, (void*)&eno); - if (eno > *Load0__20_s->ecnt) { - *Load0__20_s->ecnt = eno; - Files_ReadString(&*r, r__typ, (void*)(*Load0__20_s->mods)[__X(eno, 64)], 32); - Files_ReadString(&*r, r__typ, (void*)(*Load0__20_s->procs)[__X(eno, 64)], 32); + if (eno > *Load0__21_s->ecnt) { + *Load0__21_s->ecnt = eno; + Files_ReadString(&*r, r__typ, (void*)(*Load0__21_s->mods)[__X(eno, 64)], 32); + Files_ReadString(&*r, r__typ, (void*)(*Load0__21_s->procs)[__X(eno, 64)], 32); } org = Files_Pos(&*r, r__typ); - M = Modules_ThisMod((*Load0__20_s->mods)[__X(eno, 64)], 32); + M = Modules_ThisMod((*Load0__21_s->mods)[__X(eno, 64)], 32); if (M != NIL) { - Cmd = Modules_ThisCommand(M, (*Load0__20_s->procs)[__X(eno, 64)], 32); + Cmd = Modules_ThisCommand(M, (*Load0__21_s->procs)[__X(eno, 64)], 32); if (Cmd != NIL) { (*Cmd)(); } @@ -1564,25 +1592,25 @@ static void LoadElem__21 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span if (*e != NIL) { (*e)->W = ew; (*e)->H = eh; - (*e)->base = *Load0__20_s->T; - (*Load0__20_s->msg).pos = pos; - (*(*e)->handle)(*e, (void*)&*Load0__20_s->msg, Texts_FileMsg__typ); + (*e)->base = *Load0__21_s->T; + (*Load0__21_s->msg).pos = pos; + (*(*e)->handle)(*e, (void*)&*Load0__21_s->msg, Texts_FileMsg__typ); if (Files_Pos(&*r, r__typ) != org + span) { *e = NIL; } } if (*e == NIL) { - Files_Set(&*r, r__typ, *Load0__20_s->f, org + span); + Files_Set(&*r, r__typ, *Load0__21_s->f, org + span); __NEW(a, Texts__1); a->W = ew; a->H = eh; a->handle = Texts_HandleAlien; - a->base = *Load0__20_s->T; - a->file = *Load0__20_s->f; + a->base = *Load0__21_s->T; + a->file = *Load0__21_s->f; a->org = org; a->span = span; - __COPY((*Load0__20_s->mods)[__X(eno, 64)], a->mod, 32); - __COPY((*Load0__20_s->procs)[__X(eno, 64)], a->proc, 32); + __COPY((*Load0__21_s->mods)[__X(eno, 64)], a->mod, 32); + __COPY((*Load0__21_s->procs)[__X(eno, 64)], a->proc, 32); *e = (Texts_Elem)a; } } @@ -1599,15 +1627,15 @@ static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) CHAR mods[64][32], procs[64][32]; CHAR name[32]; Texts_FontsFont fnts[32]; - struct Load0__20 _s; + struct Load0__21 _s; _s.T = &T; _s.ecnt = &ecnt; _s.f = &f; _s.msg = &msg; _s.mods = (void*)mods; _s.procs = (void*)procs; - _s.lnk = Load0__20_s; - Load0__20_s = &_s; + _s.lnk = Load0__21_s; + Load0__21_s = &_s; pos = Files_Pos(&*r, r__typ); f = Files_Base(&*r, r__typ); __NEW(u, Texts_RunDesc); @@ -1640,7 +1668,7 @@ static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) un = (Texts_Run)p; un->len = plen; } else { - LoadElem__21(&msg.r, Files_Rider__typ, pos - org, -plen, &e); + LoadElem__22(&msg.r, Files_Rider__typ, pos - org, -plen, &e); un = (Texts_Run)e; un->len = 1; } @@ -1658,7 +1686,7 @@ static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) T->corg = 0; Files_ReadLInt(&msg.r, Files_Rider__typ, &T->len); Files_Set(&*r, r__typ, f, Files_Pos(&msg.r, Files_Rider__typ) + T->len); - Load0__20_s = _s.lnk; + Load0__21_s = _s.lnk; } void Texts_Load (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) @@ -1727,25 +1755,25 @@ void Texts_Open (Texts_Text T, CHAR *name, ADDRESS name__len) __DEL(name); } -static struct Store__43 { +static struct Store__44 { INT8 *ecnt; Texts_FileMsg *msg; Texts_IdentifyMsg *iden; CHAR (*mods)[64][32], (*procs)[64][32]; - struct Store__43 *lnk; -} *Store__43_s; + struct Store__44 *lnk; +} *Store__44_s; -static void StoreElem__44 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e); +static void StoreElem__45 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e); -static void StoreElem__44 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e) +static void StoreElem__45 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e) { Files_Rider r1; INT32 org, span; INT8 eno; - __COPY((*Store__43_s->iden).mod, (*Store__43_s->mods)[__X(*Store__43_s->ecnt, 64)], 32); - __COPY((*Store__43_s->iden).proc, (*Store__43_s->procs)[__X(*Store__43_s->ecnt, 64)], 32); + __COPY((*Store__44_s->iden).mod, (*Store__44_s->mods)[__X(*Store__44_s->ecnt, 64)], 32); + __COPY((*Store__44_s->iden).proc, (*Store__44_s->procs)[__X(*Store__44_s->ecnt, 64)], 32); eno = 1; - while (__STRCMP((*Store__43_s->mods)[__X(eno, 64)], (*Store__43_s->iden).mod) != 0 || __STRCMP((*Store__43_s->procs)[__X(eno, 64)], (*Store__43_s->iden).proc) != 0) { + while (__STRCMP((*Store__44_s->mods)[__X(eno, 64)], (*Store__44_s->iden).mod) != 0 || __STRCMP((*Store__44_s->procs)[__X(eno, 64)], (*Store__44_s->iden).proc) != 0) { eno += 1; } Files_Set(&r1, Files_Rider__typ, Files_Base(&*r, r__typ), Files_Pos(&*r, r__typ)); @@ -1753,14 +1781,14 @@ static void StoreElem__44 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Ele Files_WriteLInt(&*r, r__typ, 0); Files_WriteLInt(&*r, r__typ, 0); Files_Write(&*r, r__typ, eno); - if (eno == *Store__43_s->ecnt) { - *Store__43_s->ecnt += 1; - Files_WriteString(&*r, r__typ, (*Store__43_s->iden).mod, 32); - Files_WriteString(&*r, r__typ, (*Store__43_s->iden).proc, 32); + if (eno == *Store__44_s->ecnt) { + *Store__44_s->ecnt += 1; + Files_WriteString(&*r, r__typ, (*Store__44_s->iden).mod, 32); + Files_WriteString(&*r, r__typ, (*Store__44_s->iden).proc, 32); } - (*Store__43_s->msg).pos = pos; + (*Store__44_s->msg).pos = pos; org = Files_Pos(&*r, r__typ); - (*e->handle)(e, (void*)&*Store__43_s->msg, Texts_FileMsg__typ); + (*e->handle)(e, (void*)&*Store__44_s->msg, Texts_FileMsg__typ); span = Files_Pos(&*r, r__typ) - org; Files_WriteLInt(&r1, Files_Rider__typ, -span); Files_WriteLInt(&r1, Files_Rider__typ, e->W); @@ -1781,14 +1809,14 @@ void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) CHAR mods[64][32], procs[64][32]; Texts_FontsFont fnts[32]; CHAR block[1024]; - struct Store__43 _s; + struct Store__44 _s; _s.ecnt = &ecnt; _s.msg = &msg; _s.iden = &iden; _s.mods = (void*)mods; _s.procs = (void*)procs; - _s.lnk = Store__43_s; - Store__43_s = &_s; + _s.lnk = Store__44_s; + Store__44_s = &_s; org = Files_Pos(&*r, r__typ); msg.id = 1; msg.r = *r; @@ -1830,7 +1858,7 @@ void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) pos += rlen; u = un; } else if (iden.mod[0] != 0x00) { - StoreElem__44(&msg.r, Files_Rider__typ, pos, __GUARDP(u, Texts_ElemDesc, 1)); + StoreElem__45(&msg.r, Files_Rider__typ, pos, __GUARDP(u, Texts_ElemDesc, 1)); pos += 1; u = u->next; } else { @@ -1884,7 +1912,7 @@ void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) if (T->notify != NIL) { (*T->notify)(T, 3, 0, 0); } - Store__43_s = _s.lnk; + Store__44_s = _s.lnk; } void Texts_Close (Texts_Text T, CHAR *name, ADDRESS name__len) diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index 5450b303..4825ab70 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -193,6 +193,7 @@ export void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); export void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); export void Texts_Delete (Texts_Text T, INT32 beg, INT32 end); static void Texts_DumpElem (Texts_Elem e); +static void Texts_DumpPiece (Texts_Piece p); export void Texts_DumpReader (Texts_Reader re); static void Texts_DumpRun (Texts_Run ru); static void Texts_DumpText (Texts_Text t); @@ -256,30 +257,9 @@ static void Texts_DumpText (Texts_Text t) Out_Ln(); } -static void Texts_DumpElem (Texts_Elem e) -{ - Out_String((CHAR*)" W: ", 13); - Out_Int(e->W, 1); - Out_Ln(); - Out_String((CHAR*)" H: ", 13); - Out_Int(e->H, 1); - Out_Ln(); - Out_String((CHAR*)" handle: ", 13); - Out_Hex((INT32)(ADDRESS)e->handle, 1); - Out_Ln(); - Out_String((CHAR*)" base: ", 13); - if (e->base == NIL) { - Out_String((CHAR*)"", 6); - Out_Ln(); - } else { - Out_Ln(); - Texts_DumpText(e->base); - } -} - static void Texts_DumpRun (Texts_Run ru) { - Out_String((CHAR*)" Run at ", 10); + Out_String((CHAR*)" Run at ", 12); Out_Hex((INT32)(ADDRESS)ru, 1); Out_Ln(); Out_String((CHAR*)" prev: ", 12); @@ -313,6 +293,48 @@ static void Texts_DumpRun (Texts_Run ru) Out_Ln(); } +static void Texts_DumpElem (Texts_Elem e) +{ + Texts_DumpRun((void*)e); + Out_String((CHAR*)" -- Elem --", 15); + Out_Ln(); + Out_String((CHAR*)" W: ", 13); + Out_Int(e->W, 1); + Out_Ln(); + Out_String((CHAR*)" H: ", 13); + Out_Int(e->H, 1); + Out_Ln(); + Out_String((CHAR*)" handle: ", 13); + Out_Hex((INT32)(ADDRESS)e->handle, 1); + Out_Ln(); + Out_String((CHAR*)" base: ", 13); + if (e->base == NIL) { + Out_String((CHAR*)"", 6); + Out_Ln(); + } else { + Out_Ln(); + Texts_DumpText(e->base); + } +} + +static void Texts_DumpPiece (Texts_Piece p) +{ + Texts_DumpRun((void*)p); + Out_String((CHAR*)" -- Piece --", 16); + Out_Ln(); + Out_String((CHAR*)" file: ", 12); + if (p->file == NIL) { + Out_String((CHAR*)"", 6); + Out_Ln(); + } else { + Out_Ln(); + Files_DumpFile(p->file, 3); + } + Out_String((CHAR*)" org: ", 12); + Out_Int(p->org, 1); + Out_Ln(); +} + void Texts_DumpReader (Texts_Reader re) { Out_String((CHAR*)"Reader:", 8); @@ -360,7 +382,13 @@ void Texts_DumpReader (Texts_Reader re) Out_Ln(); } else { Out_Ln(); - Texts_DumpRun(re.run); + if (__ISP(re.run, Texts_PieceDesc, 1)) { + Texts_DumpPiece(__GUARDP(re.run, Texts_PieceDesc, 1)); + } else if (__ISP(re.run, Texts_ElemDesc, 1)) { + Texts_DumpElem(__GUARDP(re.run, Texts_ElemDesc, 1)); + } else { + Texts_DumpRun(re.run); + } } } @@ -848,32 +876,32 @@ void Texts_OpenScanner (Texts_Scanner *S, ADDRESS *S__typ, Texts_Text T, INT32 p (*S).nextCh = ' '; } -static struct Scan__35 { +static struct Scan__36 { Texts_Scanner *S; ADDRESS *S__typ; CHAR *ch; BOOLEAN *negE; INT16 *e; - struct Scan__35 *lnk; -} *Scan__35_s; + struct Scan__36 *lnk; +} *Scan__36_s; -static void ReadScaleFactor__36 (void); +static void ReadScaleFactor__37 (void); -static void ReadScaleFactor__36 (void) +static void ReadScaleFactor__37 (void) { - Texts_Read((void*)&*Scan__35_s->S, Scan__35_s->S__typ, &*Scan__35_s->ch); - if (*Scan__35_s->ch == '-') { - *Scan__35_s->negE = 1; - Texts_Read((void*)&*Scan__35_s->S, Scan__35_s->S__typ, &*Scan__35_s->ch); + Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); + if (*Scan__36_s->ch == '-') { + *Scan__36_s->negE = 1; + Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); } else { - *Scan__35_s->negE = 0; - if (*Scan__35_s->ch == '+') { - Texts_Read((void*)&*Scan__35_s->S, Scan__35_s->S__typ, &*Scan__35_s->ch); + *Scan__36_s->negE = 0; + if (*Scan__36_s->ch == '+') { + Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); } } - while (('0' <= *Scan__35_s->ch && *Scan__35_s->ch <= '9')) { - *Scan__35_s->e = (*Scan__35_s->e * 10 + (INT16)*Scan__35_s->ch) - 48; - Texts_Read((void*)&*Scan__35_s->S, Scan__35_s->S__typ, &*Scan__35_s->ch); + while (('0' <= *Scan__36_s->ch && *Scan__36_s->ch <= '9')) { + *Scan__36_s->e = (*Scan__36_s->e * 10 + (INT16)*Scan__36_s->ch) - 48; + Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); } } @@ -887,13 +915,13 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) REAL x, f; LONGREAL y, g; CHAR d[32]; - struct Scan__35 _s; + struct Scan__36 _s; _s.S = S; _s.S__typ = S__typ; _s.ch = &ch; _s.negE = &negE; _s.e = &e; - _s.lnk = Scan__35_s; - Scan__35_s = &_s; + _s.lnk = Scan__36_s; + Scan__36_s = &_s; ch = (*S).nextCh; i = 0; for (;;) { @@ -994,7 +1022,7 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) y = ((INT16)d[__X(j, 32)] - 48) * g + y; j += 1; } - ReadScaleFactor__36(); + ReadScaleFactor__37(); if (negE) { if (e <= 308) { y = y / (LONGREAL)Reals_TenL(e); @@ -1027,7 +1055,7 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) j += 1; } if (ch == 'E') { - ReadScaleFactor__36(); + ReadScaleFactor__37(); } if (negE) { if (e <= 38) { @@ -1080,7 +1108,7 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) } } (*S).nextCh = ch; - Scan__35_s = _s.lnk; + Scan__36_s = _s.lnk; } void Texts_OpenWriter (Texts_Writer *W, ADDRESS *W__typ) @@ -1299,30 +1327,30 @@ void Texts_WriteReal (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n) } } -static struct WriteRealFix__57 { +static struct WriteRealFix__58 { Texts_Writer *W; ADDRESS *W__typ; INT16 *i; CHAR (*d)[9]; - struct WriteRealFix__57 *lnk; -} *WriteRealFix__57_s; + struct WriteRealFix__58 *lnk; +} *WriteRealFix__58_s; -static void dig__58 (INT16 n); -static void seq__60 (CHAR ch, INT16 n); +static void dig__59 (INT16 n); +static void seq__61 (CHAR ch, INT16 n); -static void seq__60 (CHAR ch, INT16 n) +static void seq__61 (CHAR ch, INT16 n) { while (n > 0) { - Texts_Write(&*WriteRealFix__57_s->W, WriteRealFix__57_s->W__typ, ch); + Texts_Write(&*WriteRealFix__58_s->W, WriteRealFix__58_s->W__typ, ch); n -= 1; } } -static void dig__58 (INT16 n) +static void dig__59 (INT16 n) { while (n > 0) { - *WriteRealFix__57_s->i -= 1; - Texts_Write(&*WriteRealFix__57_s->W, WriteRealFix__57_s->W__typ, (*WriteRealFix__57_s->d)[__X(*WriteRealFix__57_s->i, 9)]); + *WriteRealFix__58_s->i -= 1; + Texts_Write(&*WriteRealFix__58_s->W, WriteRealFix__58_s->W__typ, (*WriteRealFix__58_s->d)[__X(*WriteRealFix__58_s->i, 9)]); n -= 1; } } @@ -1333,23 +1361,23 @@ void Texts_WriteRealFix (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n, INT1 CHAR sign; REAL x0; CHAR d[9]; - struct WriteRealFix__57 _s; + struct WriteRealFix__58 _s; _s.W = W; _s.W__typ = W__typ; _s.i = &i; _s.d = (void*)d; - _s.lnk = WriteRealFix__57_s; - WriteRealFix__57_s = &_s; + _s.lnk = WriteRealFix__58_s; + WriteRealFix__58_s = &_s; e = Reals_Expo(x); if (k < 0) { k = 0; } if (e == 0) { - seq__60(' ', (n - k) - 2); + seq__61(' ', (n - k) - 2); Texts_Write(&*W, W__typ, '0'); - seq__60(' ', k + 1); + seq__61(' ', k + 1); } else if (e == 255) { Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", 5); - seq__60(' ', n - 4); + seq__61(' ', n - 4); } else { e = __ASHR((e - 127) * 77, 8); if (x < (REAL)0) { @@ -1382,21 +1410,21 @@ void Texts_WriteRealFix (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n, INT1 i = k + e; Reals_Convert(x, i, (void*)d, 9); if (e > 0) { - seq__60(' ', ((n - e) - k) - 2); + seq__61(' ', ((n - e) - k) - 2); Texts_Write(&*W, W__typ, sign); - dig__58(e); + dig__59(e); Texts_Write(&*W, W__typ, '.'); - dig__58(k); + dig__59(k); } else { - seq__60(' ', (n - k) - 3); + seq__61(' ', (n - k) - 3); Texts_Write(&*W, W__typ, sign); Texts_Write(&*W, W__typ, '0'); Texts_Write(&*W, W__typ, '.'); - seq__60('0', -e); - dig__58(k + e); + seq__61('0', -e); + dig__59(k + e); } } - WriteRealFix__57_s = _s.lnk; + WriteRealFix__58_s = _s.lnk; } void Texts_WriteRealHex (Texts_Writer *W, ADDRESS *W__typ, REAL x) @@ -1495,48 +1523,48 @@ void Texts_WriteLongRealHex (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x) } while (!(i == 16)); } -static struct WriteDate__47 { +static struct WriteDate__48 { Texts_Writer *W; ADDRESS *W__typ; - struct WriteDate__47 *lnk; -} *WriteDate__47_s; + struct WriteDate__48 *lnk; +} *WriteDate__48_s; -static void WritePair__48 (CHAR ch, INT32 x); +static void WritePair__49 (CHAR ch, INT32 x); -static void WritePair__48 (CHAR ch, INT32 x) +static void WritePair__49 (CHAR ch, INT32 x) { - Texts_Write(&*WriteDate__47_s->W, WriteDate__47_s->W__typ, ch); - Texts_Write(&*WriteDate__47_s->W, WriteDate__47_s->W__typ, (CHAR)(__DIV(x, 10) + 48)); - Texts_Write(&*WriteDate__47_s->W, WriteDate__47_s->W__typ, (CHAR)((int)__MOD(x, 10) + 48)); + Texts_Write(&*WriteDate__48_s->W, WriteDate__48_s->W__typ, ch); + Texts_Write(&*WriteDate__48_s->W, WriteDate__48_s->W__typ, (CHAR)(__DIV(x, 10) + 48)); + Texts_Write(&*WriteDate__48_s->W, WriteDate__48_s->W__typ, (CHAR)((int)__MOD(x, 10) + 48)); } void Texts_WriteDate (Texts_Writer *W, ADDRESS *W__typ, INT32 t, INT32 d) { - struct WriteDate__47 _s; + struct WriteDate__48 _s; _s.W = W; _s.W__typ = W__typ; - _s.lnk = WriteDate__47_s; - WriteDate__47_s = &_s; - WritePair__48(' ', __MASK(d, -32)); - WritePair__48('.', __MASK(__ASHR(d, 5), -16)); - WritePair__48('.', __MASK(__ASHR(d, 9), -128)); - WritePair__48(' ', __MASK(__ASHR(t, 12), -32)); - WritePair__48(':', __MASK(__ASHR(t, 6), -64)); - WritePair__48(':', __MASK(t, -64)); - WriteDate__47_s = _s.lnk; + _s.lnk = WriteDate__48_s; + WriteDate__48_s = &_s; + WritePair__49(' ', __MASK(d, -32)); + WritePair__49('.', __MASK(__ASHR(d, 5), -16)); + WritePair__49('.', __MASK(__ASHR(d, 9), -128)); + WritePair__49(' ', __MASK(__ASHR(t, 12), -32)); + WritePair__49(':', __MASK(__ASHR(t, 6), -64)); + WritePair__49(':', __MASK(t, -64)); + WriteDate__48_s = _s.lnk; } -static struct Load0__20 { +static struct Load0__21 { Texts_Text *T; INT8 *ecnt; Files_File *f; Texts_FileMsg *msg; CHAR (*mods)[64][32], (*procs)[64][32]; - struct Load0__20 *lnk; -} *Load0__20_s; + struct Load0__21 *lnk; +} *Load0__21_s; -static void LoadElem__21 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e); +static void LoadElem__22 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e); -static void LoadElem__21 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e) +static void LoadElem__22 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e) { Modules_Module M = NIL; Modules_Command Cmd; @@ -1547,15 +1575,15 @@ static void LoadElem__21 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span Files_ReadLInt(&*r, r__typ, &ew); Files_ReadLInt(&*r, r__typ, &eh); Files_Read(&*r, r__typ, (void*)&eno); - if (eno > *Load0__20_s->ecnt) { - *Load0__20_s->ecnt = eno; - Files_ReadString(&*r, r__typ, (void*)(*Load0__20_s->mods)[__X(eno, 64)], 32); - Files_ReadString(&*r, r__typ, (void*)(*Load0__20_s->procs)[__X(eno, 64)], 32); + if (eno > *Load0__21_s->ecnt) { + *Load0__21_s->ecnt = eno; + Files_ReadString(&*r, r__typ, (void*)(*Load0__21_s->mods)[__X(eno, 64)], 32); + Files_ReadString(&*r, r__typ, (void*)(*Load0__21_s->procs)[__X(eno, 64)], 32); } org = Files_Pos(&*r, r__typ); - M = Modules_ThisMod((*Load0__20_s->mods)[__X(eno, 64)], 32); + M = Modules_ThisMod((*Load0__21_s->mods)[__X(eno, 64)], 32); if (M != NIL) { - Cmd = Modules_ThisCommand(M, (*Load0__20_s->procs)[__X(eno, 64)], 32); + Cmd = Modules_ThisCommand(M, (*Load0__21_s->procs)[__X(eno, 64)], 32); if (Cmd != NIL) { (*Cmd)(); } @@ -1564,25 +1592,25 @@ static void LoadElem__21 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span if (*e != NIL) { (*e)->W = ew; (*e)->H = eh; - (*e)->base = *Load0__20_s->T; - (*Load0__20_s->msg).pos = pos; - (*(*e)->handle)(*e, (void*)&*Load0__20_s->msg, Texts_FileMsg__typ); + (*e)->base = *Load0__21_s->T; + (*Load0__21_s->msg).pos = pos; + (*(*e)->handle)(*e, (void*)&*Load0__21_s->msg, Texts_FileMsg__typ); if (Files_Pos(&*r, r__typ) != org + span) { *e = NIL; } } if (*e == NIL) { - Files_Set(&*r, r__typ, *Load0__20_s->f, org + span); + Files_Set(&*r, r__typ, *Load0__21_s->f, org + span); __NEW(a, Texts__1); a->W = ew; a->H = eh; a->handle = Texts_HandleAlien; - a->base = *Load0__20_s->T; - a->file = *Load0__20_s->f; + a->base = *Load0__21_s->T; + a->file = *Load0__21_s->f; a->org = org; a->span = span; - __COPY((*Load0__20_s->mods)[__X(eno, 64)], a->mod, 32); - __COPY((*Load0__20_s->procs)[__X(eno, 64)], a->proc, 32); + __COPY((*Load0__21_s->mods)[__X(eno, 64)], a->mod, 32); + __COPY((*Load0__21_s->procs)[__X(eno, 64)], a->proc, 32); *e = (Texts_Elem)a; } } @@ -1599,15 +1627,15 @@ static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) CHAR mods[64][32], procs[64][32]; CHAR name[32]; Texts_FontsFont fnts[32]; - struct Load0__20 _s; + struct Load0__21 _s; _s.T = &T; _s.ecnt = &ecnt; _s.f = &f; _s.msg = &msg; _s.mods = (void*)mods; _s.procs = (void*)procs; - _s.lnk = Load0__20_s; - Load0__20_s = &_s; + _s.lnk = Load0__21_s; + Load0__21_s = &_s; pos = Files_Pos(&*r, r__typ); f = Files_Base(&*r, r__typ); __NEW(u, Texts_RunDesc); @@ -1640,7 +1668,7 @@ static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) un = (Texts_Run)p; un->len = plen; } else { - LoadElem__21(&msg.r, Files_Rider__typ, pos - org, -plen, &e); + LoadElem__22(&msg.r, Files_Rider__typ, pos - org, -plen, &e); un = (Texts_Run)e; un->len = 1; } @@ -1658,7 +1686,7 @@ static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) T->corg = 0; Files_ReadLInt(&msg.r, Files_Rider__typ, &T->len); Files_Set(&*r, r__typ, f, Files_Pos(&msg.r, Files_Rider__typ) + T->len); - Load0__20_s = _s.lnk; + Load0__21_s = _s.lnk; } void Texts_Load (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) @@ -1727,25 +1755,25 @@ void Texts_Open (Texts_Text T, CHAR *name, ADDRESS name__len) __DEL(name); } -static struct Store__43 { +static struct Store__44 { INT8 *ecnt; Texts_FileMsg *msg; Texts_IdentifyMsg *iden; CHAR (*mods)[64][32], (*procs)[64][32]; - struct Store__43 *lnk; -} *Store__43_s; + struct Store__44 *lnk; +} *Store__44_s; -static void StoreElem__44 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e); +static void StoreElem__45 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e); -static void StoreElem__44 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e) +static void StoreElem__45 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e) { Files_Rider r1; INT32 org, span; INT8 eno; - __COPY((*Store__43_s->iden).mod, (*Store__43_s->mods)[__X(*Store__43_s->ecnt, 64)], 32); - __COPY((*Store__43_s->iden).proc, (*Store__43_s->procs)[__X(*Store__43_s->ecnt, 64)], 32); + __COPY((*Store__44_s->iden).mod, (*Store__44_s->mods)[__X(*Store__44_s->ecnt, 64)], 32); + __COPY((*Store__44_s->iden).proc, (*Store__44_s->procs)[__X(*Store__44_s->ecnt, 64)], 32); eno = 1; - while (__STRCMP((*Store__43_s->mods)[__X(eno, 64)], (*Store__43_s->iden).mod) != 0 || __STRCMP((*Store__43_s->procs)[__X(eno, 64)], (*Store__43_s->iden).proc) != 0) { + while (__STRCMP((*Store__44_s->mods)[__X(eno, 64)], (*Store__44_s->iden).mod) != 0 || __STRCMP((*Store__44_s->procs)[__X(eno, 64)], (*Store__44_s->iden).proc) != 0) { eno += 1; } Files_Set(&r1, Files_Rider__typ, Files_Base(&*r, r__typ), Files_Pos(&*r, r__typ)); @@ -1753,14 +1781,14 @@ static void StoreElem__44 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Ele Files_WriteLInt(&*r, r__typ, 0); Files_WriteLInt(&*r, r__typ, 0); Files_Write(&*r, r__typ, eno); - if (eno == *Store__43_s->ecnt) { - *Store__43_s->ecnt += 1; - Files_WriteString(&*r, r__typ, (*Store__43_s->iden).mod, 32); - Files_WriteString(&*r, r__typ, (*Store__43_s->iden).proc, 32); + if (eno == *Store__44_s->ecnt) { + *Store__44_s->ecnt += 1; + Files_WriteString(&*r, r__typ, (*Store__44_s->iden).mod, 32); + Files_WriteString(&*r, r__typ, (*Store__44_s->iden).proc, 32); } - (*Store__43_s->msg).pos = pos; + (*Store__44_s->msg).pos = pos; org = Files_Pos(&*r, r__typ); - (*e->handle)(e, (void*)&*Store__43_s->msg, Texts_FileMsg__typ); + (*e->handle)(e, (void*)&*Store__44_s->msg, Texts_FileMsg__typ); span = Files_Pos(&*r, r__typ) - org; Files_WriteLInt(&r1, Files_Rider__typ, -span); Files_WriteLInt(&r1, Files_Rider__typ, e->W); @@ -1781,14 +1809,14 @@ void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) CHAR mods[64][32], procs[64][32]; Texts_FontsFont fnts[32]; CHAR block[1024]; - struct Store__43 _s; + struct Store__44 _s; _s.ecnt = &ecnt; _s.msg = &msg; _s.iden = &iden; _s.mods = (void*)mods; _s.procs = (void*)procs; - _s.lnk = Store__43_s; - Store__43_s = &_s; + _s.lnk = Store__44_s; + Store__44_s = &_s; org = Files_Pos(&*r, r__typ); msg.id = 1; msg.r = *r; @@ -1830,7 +1858,7 @@ void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) pos += rlen; u = un; } else if (iden.mod[0] != 0x00) { - StoreElem__44(&msg.r, Files_Rider__typ, pos, __GUARDP(u, Texts_ElemDesc, 1)); + StoreElem__45(&msg.r, Files_Rider__typ, pos, __GUARDP(u, Texts_ElemDesc, 1)); pos += 1; u = u->next; } else { @@ -1884,7 +1912,7 @@ void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) if (T->notify != NIL) { (*T->notify)(T, 3, 0, 0); } - Store__43_s = _s.lnk; + Store__44_s = _s.lnk; } void Texts_Close (Texts_Text T, CHAR *name, ADDRESS name__len) diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index c7301f23..9887162e 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -193,6 +193,7 @@ export void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); export void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); export void Texts_Delete (Texts_Text T, INT32 beg, INT32 end); static void Texts_DumpElem (Texts_Elem e); +static void Texts_DumpPiece (Texts_Piece p); export void Texts_DumpReader (Texts_Reader re); static void Texts_DumpRun (Texts_Run ru); static void Texts_DumpText (Texts_Text t); @@ -256,30 +257,9 @@ static void Texts_DumpText (Texts_Text t) Out_Ln(); } -static void Texts_DumpElem (Texts_Elem e) -{ - Out_String((CHAR*)" W: ", 13); - Out_Int(e->W, 1); - Out_Ln(); - Out_String((CHAR*)" H: ", 13); - Out_Int(e->H, 1); - Out_Ln(); - Out_String((CHAR*)" handle: ", 13); - Out_Hex((INT64)(ADDRESS)e->handle, 1); - Out_Ln(); - Out_String((CHAR*)" base: ", 13); - if (e->base == NIL) { - Out_String((CHAR*)"", 6); - Out_Ln(); - } else { - Out_Ln(); - Texts_DumpText(e->base); - } -} - static void Texts_DumpRun (Texts_Run ru) { - Out_String((CHAR*)" Run at ", 10); + Out_String((CHAR*)" Run at ", 12); Out_Hex((INT64)(ADDRESS)ru, 1); Out_Ln(); Out_String((CHAR*)" prev: ", 12); @@ -313,6 +293,48 @@ static void Texts_DumpRun (Texts_Run ru) Out_Ln(); } +static void Texts_DumpElem (Texts_Elem e) +{ + Texts_DumpRun((void*)e); + Out_String((CHAR*)" -- Elem --", 15); + Out_Ln(); + Out_String((CHAR*)" W: ", 13); + Out_Int(e->W, 1); + Out_Ln(); + Out_String((CHAR*)" H: ", 13); + Out_Int(e->H, 1); + Out_Ln(); + Out_String((CHAR*)" handle: ", 13); + Out_Hex((INT64)(ADDRESS)e->handle, 1); + Out_Ln(); + Out_String((CHAR*)" base: ", 13); + if (e->base == NIL) { + Out_String((CHAR*)"", 6); + Out_Ln(); + } else { + Out_Ln(); + Texts_DumpText(e->base); + } +} + +static void Texts_DumpPiece (Texts_Piece p) +{ + Texts_DumpRun((void*)p); + Out_String((CHAR*)" -- Piece --", 16); + Out_Ln(); + Out_String((CHAR*)" file: ", 12); + if (p->file == NIL) { + Out_String((CHAR*)"", 6); + Out_Ln(); + } else { + Out_Ln(); + Files_DumpFile(p->file, 3); + } + Out_String((CHAR*)" org: ", 12); + Out_Int(p->org, 1); + Out_Ln(); +} + void Texts_DumpReader (Texts_Reader re) { Out_String((CHAR*)"Reader:", 8); @@ -360,7 +382,13 @@ void Texts_DumpReader (Texts_Reader re) Out_Ln(); } else { Out_Ln(); - Texts_DumpRun(re.run); + if (__ISP(re.run, Texts_PieceDesc, 1)) { + Texts_DumpPiece(__GUARDP(re.run, Texts_PieceDesc, 1)); + } else if (__ISP(re.run, Texts_ElemDesc, 1)) { + Texts_DumpElem(__GUARDP(re.run, Texts_ElemDesc, 1)); + } else { + Texts_DumpRun(re.run); + } } } @@ -848,32 +876,32 @@ void Texts_OpenScanner (Texts_Scanner *S, ADDRESS *S__typ, Texts_Text T, INT32 p (*S).nextCh = ' '; } -static struct Scan__35 { +static struct Scan__36 { Texts_Scanner *S; ADDRESS *S__typ; CHAR *ch; BOOLEAN *negE; INT16 *e; - struct Scan__35 *lnk; -} *Scan__35_s; + struct Scan__36 *lnk; +} *Scan__36_s; -static void ReadScaleFactor__36 (void); +static void ReadScaleFactor__37 (void); -static void ReadScaleFactor__36 (void) +static void ReadScaleFactor__37 (void) { - Texts_Read((void*)&*Scan__35_s->S, Scan__35_s->S__typ, &*Scan__35_s->ch); - if (*Scan__35_s->ch == '-') { - *Scan__35_s->negE = 1; - Texts_Read((void*)&*Scan__35_s->S, Scan__35_s->S__typ, &*Scan__35_s->ch); + Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); + if (*Scan__36_s->ch == '-') { + *Scan__36_s->negE = 1; + Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); } else { - *Scan__35_s->negE = 0; - if (*Scan__35_s->ch == '+') { - Texts_Read((void*)&*Scan__35_s->S, Scan__35_s->S__typ, &*Scan__35_s->ch); + *Scan__36_s->negE = 0; + if (*Scan__36_s->ch == '+') { + Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); } } - while (('0' <= *Scan__35_s->ch && *Scan__35_s->ch <= '9')) { - *Scan__35_s->e = (*Scan__35_s->e * 10 + (INT16)*Scan__35_s->ch) - 48; - Texts_Read((void*)&*Scan__35_s->S, Scan__35_s->S__typ, &*Scan__35_s->ch); + while (('0' <= *Scan__36_s->ch && *Scan__36_s->ch <= '9')) { + *Scan__36_s->e = (*Scan__36_s->e * 10 + (INT16)*Scan__36_s->ch) - 48; + Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); } } @@ -887,13 +915,13 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) REAL x, f; LONGREAL y, g; CHAR d[32]; - struct Scan__35 _s; + struct Scan__36 _s; _s.S = S; _s.S__typ = S__typ; _s.ch = &ch; _s.negE = &negE; _s.e = &e; - _s.lnk = Scan__35_s; - Scan__35_s = &_s; + _s.lnk = Scan__36_s; + Scan__36_s = &_s; ch = (*S).nextCh; i = 0; for (;;) { @@ -994,7 +1022,7 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) y = ((INT16)d[__X(j, 32)] - 48) * g + y; j += 1; } - ReadScaleFactor__36(); + ReadScaleFactor__37(); if (negE) { if (e <= 308) { y = y / (LONGREAL)Reals_TenL(e); @@ -1027,7 +1055,7 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) j += 1; } if (ch == 'E') { - ReadScaleFactor__36(); + ReadScaleFactor__37(); } if (negE) { if (e <= 38) { @@ -1080,7 +1108,7 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) } } (*S).nextCh = ch; - Scan__35_s = _s.lnk; + Scan__36_s = _s.lnk; } void Texts_OpenWriter (Texts_Writer *W, ADDRESS *W__typ) @@ -1299,30 +1327,30 @@ void Texts_WriteReal (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n) } } -static struct WriteRealFix__57 { +static struct WriteRealFix__58 { Texts_Writer *W; ADDRESS *W__typ; INT16 *i; CHAR (*d)[9]; - struct WriteRealFix__57 *lnk; -} *WriteRealFix__57_s; + struct WriteRealFix__58 *lnk; +} *WriteRealFix__58_s; -static void dig__58 (INT16 n); -static void seq__60 (CHAR ch, INT16 n); +static void dig__59 (INT16 n); +static void seq__61 (CHAR ch, INT16 n); -static void seq__60 (CHAR ch, INT16 n) +static void seq__61 (CHAR ch, INT16 n) { while (n > 0) { - Texts_Write(&*WriteRealFix__57_s->W, WriteRealFix__57_s->W__typ, ch); + Texts_Write(&*WriteRealFix__58_s->W, WriteRealFix__58_s->W__typ, ch); n -= 1; } } -static void dig__58 (INT16 n) +static void dig__59 (INT16 n) { while (n > 0) { - *WriteRealFix__57_s->i -= 1; - Texts_Write(&*WriteRealFix__57_s->W, WriteRealFix__57_s->W__typ, (*WriteRealFix__57_s->d)[__X(*WriteRealFix__57_s->i, 9)]); + *WriteRealFix__58_s->i -= 1; + Texts_Write(&*WriteRealFix__58_s->W, WriteRealFix__58_s->W__typ, (*WriteRealFix__58_s->d)[__X(*WriteRealFix__58_s->i, 9)]); n -= 1; } } @@ -1333,23 +1361,23 @@ void Texts_WriteRealFix (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n, INT1 CHAR sign; REAL x0; CHAR d[9]; - struct WriteRealFix__57 _s; + struct WriteRealFix__58 _s; _s.W = W; _s.W__typ = W__typ; _s.i = &i; _s.d = (void*)d; - _s.lnk = WriteRealFix__57_s; - WriteRealFix__57_s = &_s; + _s.lnk = WriteRealFix__58_s; + WriteRealFix__58_s = &_s; e = Reals_Expo(x); if (k < 0) { k = 0; } if (e == 0) { - seq__60(' ', (n - k) - 2); + seq__61(' ', (n - k) - 2); Texts_Write(&*W, W__typ, '0'); - seq__60(' ', k + 1); + seq__61(' ', k + 1); } else if (e == 255) { Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", 5); - seq__60(' ', n - 4); + seq__61(' ', n - 4); } else { e = __ASHR((e - 127) * 77, 8); if (x < (REAL)0) { @@ -1382,21 +1410,21 @@ void Texts_WriteRealFix (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n, INT1 i = k + e; Reals_Convert(x, i, (void*)d, 9); if (e > 0) { - seq__60(' ', ((n - e) - k) - 2); + seq__61(' ', ((n - e) - k) - 2); Texts_Write(&*W, W__typ, sign); - dig__58(e); + dig__59(e); Texts_Write(&*W, W__typ, '.'); - dig__58(k); + dig__59(k); } else { - seq__60(' ', (n - k) - 3); + seq__61(' ', (n - k) - 3); Texts_Write(&*W, W__typ, sign); Texts_Write(&*W, W__typ, '0'); Texts_Write(&*W, W__typ, '.'); - seq__60('0', -e); - dig__58(k + e); + seq__61('0', -e); + dig__59(k + e); } } - WriteRealFix__57_s = _s.lnk; + WriteRealFix__58_s = _s.lnk; } void Texts_WriteRealHex (Texts_Writer *W, ADDRESS *W__typ, REAL x) @@ -1495,48 +1523,48 @@ void Texts_WriteLongRealHex (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x) } while (!(i == 16)); } -static struct WriteDate__47 { +static struct WriteDate__48 { Texts_Writer *W; ADDRESS *W__typ; - struct WriteDate__47 *lnk; -} *WriteDate__47_s; + struct WriteDate__48 *lnk; +} *WriteDate__48_s; -static void WritePair__48 (CHAR ch, INT32 x); +static void WritePair__49 (CHAR ch, INT32 x); -static void WritePair__48 (CHAR ch, INT32 x) +static void WritePair__49 (CHAR ch, INT32 x) { - Texts_Write(&*WriteDate__47_s->W, WriteDate__47_s->W__typ, ch); - Texts_Write(&*WriteDate__47_s->W, WriteDate__47_s->W__typ, (CHAR)(__DIV(x, 10) + 48)); - Texts_Write(&*WriteDate__47_s->W, WriteDate__47_s->W__typ, (CHAR)((int)__MOD(x, 10) + 48)); + Texts_Write(&*WriteDate__48_s->W, WriteDate__48_s->W__typ, ch); + Texts_Write(&*WriteDate__48_s->W, WriteDate__48_s->W__typ, (CHAR)(__DIV(x, 10) + 48)); + Texts_Write(&*WriteDate__48_s->W, WriteDate__48_s->W__typ, (CHAR)((int)__MOD(x, 10) + 48)); } void Texts_WriteDate (Texts_Writer *W, ADDRESS *W__typ, INT32 t, INT32 d) { - struct WriteDate__47 _s; + struct WriteDate__48 _s; _s.W = W; _s.W__typ = W__typ; - _s.lnk = WriteDate__47_s; - WriteDate__47_s = &_s; - WritePair__48(' ', __MASK(d, -32)); - WritePair__48('.', __MASK(__ASHR(d, 5), -16)); - WritePair__48('.', __MASK(__ASHR(d, 9), -128)); - WritePair__48(' ', __MASK(__ASHR(t, 12), -32)); - WritePair__48(':', __MASK(__ASHR(t, 6), -64)); - WritePair__48(':', __MASK(t, -64)); - WriteDate__47_s = _s.lnk; + _s.lnk = WriteDate__48_s; + WriteDate__48_s = &_s; + WritePair__49(' ', __MASK(d, -32)); + WritePair__49('.', __MASK(__ASHR(d, 5), -16)); + WritePair__49('.', __MASK(__ASHR(d, 9), -128)); + WritePair__49(' ', __MASK(__ASHR(t, 12), -32)); + WritePair__49(':', __MASK(__ASHR(t, 6), -64)); + WritePair__49(':', __MASK(t, -64)); + WriteDate__48_s = _s.lnk; } -static struct Load0__20 { +static struct Load0__21 { Texts_Text *T; INT8 *ecnt; Files_File *f; Texts_FileMsg *msg; CHAR (*mods)[64][32], (*procs)[64][32]; - struct Load0__20 *lnk; -} *Load0__20_s; + struct Load0__21 *lnk; +} *Load0__21_s; -static void LoadElem__21 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e); +static void LoadElem__22 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e); -static void LoadElem__21 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e) +static void LoadElem__22 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e) { Modules_Module M = NIL; Modules_Command Cmd; @@ -1547,15 +1575,15 @@ static void LoadElem__21 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span Files_ReadLInt(&*r, r__typ, &ew); Files_ReadLInt(&*r, r__typ, &eh); Files_Read(&*r, r__typ, (void*)&eno); - if (eno > *Load0__20_s->ecnt) { - *Load0__20_s->ecnt = eno; - Files_ReadString(&*r, r__typ, (void*)(*Load0__20_s->mods)[__X(eno, 64)], 32); - Files_ReadString(&*r, r__typ, (void*)(*Load0__20_s->procs)[__X(eno, 64)], 32); + if (eno > *Load0__21_s->ecnt) { + *Load0__21_s->ecnt = eno; + Files_ReadString(&*r, r__typ, (void*)(*Load0__21_s->mods)[__X(eno, 64)], 32); + Files_ReadString(&*r, r__typ, (void*)(*Load0__21_s->procs)[__X(eno, 64)], 32); } org = Files_Pos(&*r, r__typ); - M = Modules_ThisMod((*Load0__20_s->mods)[__X(eno, 64)], 32); + M = Modules_ThisMod((*Load0__21_s->mods)[__X(eno, 64)], 32); if (M != NIL) { - Cmd = Modules_ThisCommand(M, (*Load0__20_s->procs)[__X(eno, 64)], 32); + Cmd = Modules_ThisCommand(M, (*Load0__21_s->procs)[__X(eno, 64)], 32); if (Cmd != NIL) { (*Cmd)(); } @@ -1564,25 +1592,25 @@ static void LoadElem__21 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span if (*e != NIL) { (*e)->W = ew; (*e)->H = eh; - (*e)->base = *Load0__20_s->T; - (*Load0__20_s->msg).pos = pos; - (*(*e)->handle)(*e, (void*)&*Load0__20_s->msg, Texts_FileMsg__typ); + (*e)->base = *Load0__21_s->T; + (*Load0__21_s->msg).pos = pos; + (*(*e)->handle)(*e, (void*)&*Load0__21_s->msg, Texts_FileMsg__typ); if (Files_Pos(&*r, r__typ) != org + span) { *e = NIL; } } if (*e == NIL) { - Files_Set(&*r, r__typ, *Load0__20_s->f, org + span); + Files_Set(&*r, r__typ, *Load0__21_s->f, org + span); __NEW(a, Texts__1); a->W = ew; a->H = eh; a->handle = Texts_HandleAlien; - a->base = *Load0__20_s->T; - a->file = *Load0__20_s->f; + a->base = *Load0__21_s->T; + a->file = *Load0__21_s->f; a->org = org; a->span = span; - __COPY((*Load0__20_s->mods)[__X(eno, 64)], a->mod, 32); - __COPY((*Load0__20_s->procs)[__X(eno, 64)], a->proc, 32); + __COPY((*Load0__21_s->mods)[__X(eno, 64)], a->mod, 32); + __COPY((*Load0__21_s->procs)[__X(eno, 64)], a->proc, 32); *e = (Texts_Elem)a; } } @@ -1599,15 +1627,15 @@ static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) CHAR mods[64][32], procs[64][32]; CHAR name[32]; Texts_FontsFont fnts[32]; - struct Load0__20 _s; + struct Load0__21 _s; _s.T = &T; _s.ecnt = &ecnt; _s.f = &f; _s.msg = &msg; _s.mods = (void*)mods; _s.procs = (void*)procs; - _s.lnk = Load0__20_s; - Load0__20_s = &_s; + _s.lnk = Load0__21_s; + Load0__21_s = &_s; pos = Files_Pos(&*r, r__typ); f = Files_Base(&*r, r__typ); __NEW(u, Texts_RunDesc); @@ -1640,7 +1668,7 @@ static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) un = (Texts_Run)p; un->len = plen; } else { - LoadElem__21(&msg.r, Files_Rider__typ, pos - org, -plen, &e); + LoadElem__22(&msg.r, Files_Rider__typ, pos - org, -plen, &e); un = (Texts_Run)e; un->len = 1; } @@ -1658,7 +1686,7 @@ static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) T->corg = 0; Files_ReadLInt(&msg.r, Files_Rider__typ, &T->len); Files_Set(&*r, r__typ, f, Files_Pos(&msg.r, Files_Rider__typ) + T->len); - Load0__20_s = _s.lnk; + Load0__21_s = _s.lnk; } void Texts_Load (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) @@ -1727,25 +1755,25 @@ void Texts_Open (Texts_Text T, CHAR *name, ADDRESS name__len) __DEL(name); } -static struct Store__43 { +static struct Store__44 { INT8 *ecnt; Texts_FileMsg *msg; Texts_IdentifyMsg *iden; CHAR (*mods)[64][32], (*procs)[64][32]; - struct Store__43 *lnk; -} *Store__43_s; + struct Store__44 *lnk; +} *Store__44_s; -static void StoreElem__44 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e); +static void StoreElem__45 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e); -static void StoreElem__44 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e) +static void StoreElem__45 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e) { Files_Rider r1; INT32 org, span; INT8 eno; - __COPY((*Store__43_s->iden).mod, (*Store__43_s->mods)[__X(*Store__43_s->ecnt, 64)], 32); - __COPY((*Store__43_s->iden).proc, (*Store__43_s->procs)[__X(*Store__43_s->ecnt, 64)], 32); + __COPY((*Store__44_s->iden).mod, (*Store__44_s->mods)[__X(*Store__44_s->ecnt, 64)], 32); + __COPY((*Store__44_s->iden).proc, (*Store__44_s->procs)[__X(*Store__44_s->ecnt, 64)], 32); eno = 1; - while (__STRCMP((*Store__43_s->mods)[__X(eno, 64)], (*Store__43_s->iden).mod) != 0 || __STRCMP((*Store__43_s->procs)[__X(eno, 64)], (*Store__43_s->iden).proc) != 0) { + while (__STRCMP((*Store__44_s->mods)[__X(eno, 64)], (*Store__44_s->iden).mod) != 0 || __STRCMP((*Store__44_s->procs)[__X(eno, 64)], (*Store__44_s->iden).proc) != 0) { eno += 1; } Files_Set(&r1, Files_Rider__typ, Files_Base(&*r, r__typ), Files_Pos(&*r, r__typ)); @@ -1753,14 +1781,14 @@ static void StoreElem__44 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Ele Files_WriteLInt(&*r, r__typ, 0); Files_WriteLInt(&*r, r__typ, 0); Files_Write(&*r, r__typ, eno); - if (eno == *Store__43_s->ecnt) { - *Store__43_s->ecnt += 1; - Files_WriteString(&*r, r__typ, (*Store__43_s->iden).mod, 32); - Files_WriteString(&*r, r__typ, (*Store__43_s->iden).proc, 32); + if (eno == *Store__44_s->ecnt) { + *Store__44_s->ecnt += 1; + Files_WriteString(&*r, r__typ, (*Store__44_s->iden).mod, 32); + Files_WriteString(&*r, r__typ, (*Store__44_s->iden).proc, 32); } - (*Store__43_s->msg).pos = pos; + (*Store__44_s->msg).pos = pos; org = Files_Pos(&*r, r__typ); - (*e->handle)(e, (void*)&*Store__43_s->msg, Texts_FileMsg__typ); + (*e->handle)(e, (void*)&*Store__44_s->msg, Texts_FileMsg__typ); span = Files_Pos(&*r, r__typ) - org; Files_WriteLInt(&r1, Files_Rider__typ, -span); Files_WriteLInt(&r1, Files_Rider__typ, e->W); @@ -1781,14 +1809,14 @@ void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) CHAR mods[64][32], procs[64][32]; Texts_FontsFont fnts[32]; CHAR block[1024]; - struct Store__43 _s; + struct Store__44 _s; _s.ecnt = &ecnt; _s.msg = &msg; _s.iden = &iden; _s.mods = (void*)mods; _s.procs = (void*)procs; - _s.lnk = Store__43_s; - Store__43_s = &_s; + _s.lnk = Store__44_s; + Store__44_s = &_s; org = Files_Pos(&*r, r__typ); msg.id = 1; msg.r = *r; @@ -1830,7 +1858,7 @@ void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) pos += rlen; u = un; } else if (iden.mod[0] != 0x00) { - StoreElem__44(&msg.r, Files_Rider__typ, pos, __GUARDP(u, Texts_ElemDesc, 1)); + StoreElem__45(&msg.r, Files_Rider__typ, pos, __GUARDP(u, Texts_ElemDesc, 1)); pos += 1; u = u->next; } else { @@ -1884,7 +1912,7 @@ void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) if (T->notify != NIL) { (*T->notify)(T, 3, 0, 0); } - Store__43_s = _s.lnk; + Store__44_s = _s.lnk; } void Texts_Close (Texts_Text T, CHAR *name, ADDRESS name__len) From 4444d06e4e984ca1727daf368377f4007279a984 Mon Sep 17 00:00:00 2001 From: David Brown Date: Mon, 12 Dec 2016 18:42:36 +0000 Subject: [PATCH 420/580] Remove duplocate ModuleDesc in Modules. Add type descriptor dumping. --- src/runtime/Heap.Mod | 55 +++++++++++++++++++++++++++-------------- src/runtime/Modules.Mod | 46 +++++++++++----------------------- src/runtime/Out.Mod | 55 ++++++++++++++++++++++++++++++++++++++++- src/runtime/Texts.Mod | 1 + 4 files changed, 105 insertions(+), 52 deletions(-) diff --git a/src/runtime/Heap.Mod b/src/runtime/Heap.Mod index 6407f27d..ad9d6424 100644 --- a/src/runtime/Heap.Mod +++ b/src/runtime/Heap.Mod @@ -33,30 +33,31 @@ MODULE Heap; AddressZero = S.VAL(S.ADDRESS, 0); TYPE - ModuleName = ARRAY ModNameLen OF CHAR; - CmdName = ARRAY CmdNameLen OF CHAR; + ModuleName- = ARRAY ModNameLen OF CHAR; + CmdName- = ARRAY CmdNameLen OF CHAR; - Module = POINTER TO ModuleDesc; - Cmd = POINTER TO CmdDesc; + Module- = POINTER TO ModuleDesc; + Cmd- = POINTER TO CmdDesc; - EnumProc = PROCEDURE(P: PROCEDURE(p: S.PTR)); + EnumProc- = PROCEDURE(P: PROCEDURE(p: S.PTR)); - ModuleDesc = RECORD - next: Module; - name: ModuleName; - refcnt: LONGINT; - cmds: Cmd; - types: S.ADDRESS; - enumPtrs: EnumProc; - reserved1, reserved2: LONGINT + ModuleDesc- = RECORD + next-: Module; + name-: ModuleName; + refcnt-: LONGINT; + cmds-: Cmd; + types-: S.ADDRESS; + enumPtrs-: EnumProc; + reserved1, + reserved2: LONGINT END ; - Command = PROCEDURE; + Command- = PROCEDURE; - CmdDesc = RECORD - next: Cmd; - name: CmdName; - cmd: Command + CmdDesc- = RECORD + next-: Cmd; + name-: CmdName; + cmd-: Command END ; Finalizer = PROCEDURE(obj: S.PTR); @@ -71,7 +72,7 @@ MODULE Heap; VAR (* the list of loaded (=initialization started) modules *) - modules*: S.PTR; + modules-: S.PTR; (*POINTER [1] TO ModuleDesc;*) freeList: ARRAY nofLists + 1 OF S.ADDRESS; (* dummy, 16, 32, 48, 64, 80, 96, 112, 128, sentinel *) bigBlocks: S.ADDRESS; @@ -141,6 +142,22 @@ MODULE Heap; RETURN m END REGMOD; + PROCEDURE FreeModule*(name: ARRAY OF CHAR): LONGINT; + (* Returns 0 if freed, -1 if not found, refcount if found and refcount > 0. *) + VAR m, p: Module; + BEGIN m := S.VAL(Module, modules); + WHILE (m # NIL) & (m.name # name) DO p := m; m := m.next END; + IF (m # NIL) & (m.refcnt = 0) THEN + IF m = S.VAL(Module, modules) THEN modules := m.next + ELSE p.next := m.next + END; + RETURN 0 + ELSE + IF m = NIL THEN RETURN -1 ELSE RETURN m.refcnt END + END + END FreeModule; + + PROCEDURE REGCMD*(m: Module; VAR name: CmdName; cmd: Command); VAR c: Cmd; BEGIN diff --git a/src/runtime/Modules.Mod b/src/runtime/Modules.Mod index cfa4bd77..0b9f5fd0 100644 --- a/src/runtime/Modules.Mod +++ b/src/runtime/Modules.Mod @@ -9,27 +9,10 @@ MODULE Modules; (* jt 6.1.96 *) ModNameLen* = 20; TYPE - ModuleName* = ARRAY ModNameLen OF CHAR; - Module* = POINTER TO ModuleDesc; - Cmd* = POINTER TO CmdDesc; - ModuleDesc* = RECORD (* cf. SYSTEM.Mod *) - next-: Module; - name-: ModuleName; - refcnt-: LONGINT; - cmds-: Cmd; - types-: LONGINT; - enumPtrs-: PROCEDURE (P: PROCEDURE(p: LONGINT)); - reserved1, reserved2: LONGINT; - END ; - - Command* = PROCEDURE; - - CmdDesc* = RECORD - next-: Cmd; - name-: ARRAY 24 OF CHAR; - cmd-: Command - END ; - + ModuleName* = Heap.ModuleName; + Module* = Heap.Module; + Cmd* = Heap.Cmd; + Command* = Heap.Command; VAR res*: INTEGER; resMsg*: ARRAY 256 OF CHAR; @@ -236,8 +219,8 @@ MODULE Modules; (* jt 6.1.96 *) (* Module and command lookup by name *) - PROCEDURE -modules(): Module "(Modules_Module)Heap_modules"; - PROCEDURE -setmodules(m: Module) "Heap_modules = m"; + PROCEDURE -modules(): Module "(Heap_Module)Heap_modules"; + (*PROCEDURE -setmodules(m: Module) "Heap_modules = m";*) PROCEDURE ThisMod* (name: ARRAY OF CHAR): Module; VAR m: Module; bodyname: ARRAY 64 OF CHAR; body: Command; @@ -262,26 +245,25 @@ MODULE Modules; (* jt 6.1.96 *) END ThisCommand; PROCEDURE Free*(name: ARRAY OF CHAR; all: BOOLEAN); - VAR m, p: Module; + VAR m, p: Module; refcount: LONGINT; BEGIN m := modules(); IF all THEN res := 1; resMsg := 'unloading "all" not yet supported' ELSE - WHILE (m # NIL) & (m.name # name) DO p := m; m := m.next END ; - IF (m # NIL) & (m.refcnt = 0) THEN - IF m = modules() THEN setmodules(m.next) - ELSE p.next := m.next - END ; + refcount := Heap.FreeModule(name); + IF refcount = 0 THEN res := 0 - ELSE res := 1; - IF m = NIL THEN resMsg := "module not found" + ELSE + IF refcount < 0 THEN resMsg := "module not found" ELSE resMsg := "clients of this module exist" - END + END; + res := 1 END END END Free; + (* Run time error reporting. *) PROCEDURE errch(c: CHAR); (* Here we favour simplicity over efficiency, so no buffering. *) diff --git a/src/runtime/Out.Mod b/src/runtime/Out.Mod index 23d30be4..37c928a4 100644 --- a/src/runtime/Out.Mod +++ b/src/runtime/Out.Mod @@ -1,6 +1,6 @@ MODULE Out; (* DCW Brown. 2016-09-27 *) -IMPORT SYSTEM, Platform; +IMPORT SYSTEM, Platform, Heap; VAR IsConsole-: BOOLEAN; @@ -114,6 +114,59 @@ PROCEDURE HexDump*(VAR m: ARRAY OF SYSTEM.BYTE); BEGIN HexDumpAdr(SYSTEM.ADR(m), 0, LEN(m)) END HexDump; + +PROCEDURE DumpModule(m: Heap.Module); +BEGIN + String(" next: "); Hex(SYSTEM.VAL(SYSTEM.ADDRESS, m.next),1); Ln; + String(" name: "); String(m.name); Ln; + String(" refcnt: "); Hex(m.refcnt,1); Ln; + String(" cmds: "); Hex(SYSTEM.VAL(SYSTEM.ADDRESS, m.cmds),1); Ln; + String(" types: "); Hex(m.types,1); Ln; + String(" enumPtrs: "); Hex(SYSTEM.VAL(SYSTEM.ADDRESS, m.enumPtrs),1); Ln; +END DumpModule; + +PROCEDURE DumpType*(VAR o: ARRAY OF SYSTEM.BYTE); +TYPE + typedesc = RECORD + (* Array of type bound procedure addresses preceeds this. *) + tag: SYSTEM.ADDRESS; + next: SYSTEM.ADDRESS; + level: SYSTEM.ADDRESS; + module: SYSTEM.ADDRESS; + name: ARRAY 24 OF CHAR; + bases: ARRAY 16 OF SYSTEM.ADDRESS; + reserved: SYSTEM.ADDRESS; + blksz: SYSTEM.ADDRESS; + ptr0: SYSTEM.ADDRESS; (* Offset of first pointer. Others follow this. *) + END; + tag = POINTER [1] TO typedesc; +VAR + addr: SYSTEM.ADDRESS; + desc: tag; + i: INTEGER; +BEGIN + SYSTEM.GET(SYSTEM.ADR(o) - SIZE(SYSTEM.ADDRESS), addr); + String("obj tag: "); Hex(addr,1); Ln; + desc := SYSTEM.VAL(tag, addr - (21*SIZE(SYSTEM.ADDRESS) + 24)); + String("desc at: "); Hex(SYSTEM.VAL(SYSTEM.ADDRESS, desc),1); Ln; + String("desc contains:"); Ln; + String("tag: "); Hex(desc.tag, 1); Ln; + String("next: "); Hex(desc.next, 1); Ln; + String("level: "); Hex(desc.level, 1); Ln; + String("module: "); Hex(desc.module, 1); Ln; + DumpModule(SYSTEM.VAL(Heap.Module, desc.module)); + String("name: "); String(desc.name); Ln; + String("bases: "); + i := 0; WHILE i < 16 DO + Hex(desc.bases[i], SIZE(SYSTEM.ADDRESS) * 2); + IF i MOD 4 = 3 THEN Ln; String(" ") ELSE Char(" ") END; + INC(i) + END; Ln; + String("reserved: "); Hex(desc.reserved, 1); Ln; + String("blksz: "); Hex(desc.blksz, 1); Ln; + String("ptr0: "); Hex(desc.ptr0, 1); Ln; +END DumpType; + (* Real and Longreal display *) PROCEDURE digit(n: HUGEINT; VAR s: ARRAY OF CHAR; VAR i: INTEGER); diff --git a/src/runtime/Texts.Mod b/src/runtime/Texts.Mod index ae7440a0..55ab429f 100644 --- a/src/runtime/Texts.Mod +++ b/src/runtime/Texts.Mod @@ -180,6 +180,7 @@ MODULE Texts; (** CAS/HM 23.9.93 -- interface based on Texts by JG/NW 6.12.91** ELSE DumpRun(re.run) END END; + Out.DumpType(re.run^); END DumpReader; From d9fb831fcf2270d123117c9052b022193bcf3892 Mon Sep 17 00:00:00 2001 From: David Brown Date: Mon, 12 Dec 2016 18:43:32 +0000 Subject: [PATCH 421/580] Update bootstrap C sources. --- bootstrap/unix-44/Compiler.c | 2 +- bootstrap/unix-44/Configuration.c | 4 +- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Files.c | 2 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 32 ++++++++- bootstrap/unix-44/Heap.h | 29 +++++++-- bootstrap/unix-44/Modules.c | 76 +++++----------------- bootstrap/unix-44/Modules.h | 41 ++---------- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 2 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 2 +- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 2 +- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 2 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Out.c | 97 +++++++++++++++++++++++++++- bootstrap/unix-44/Out.h | 3 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 7 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/VT100.c | 2 +- bootstrap/unix-44/VT100.h | 2 +- bootstrap/unix-44/extTools.c | 2 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-48/Compiler.c | 2 +- bootstrap/unix-48/Configuration.c | 4 +- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Files.c | 2 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 32 ++++++++- bootstrap/unix-48/Heap.h | 29 +++++++-- bootstrap/unix-48/Modules.c | 76 +++++----------------- bootstrap/unix-48/Modules.h | 41 ++---------- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 2 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 2 +- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 2 +- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 2 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Out.c | 97 +++++++++++++++++++++++++++- bootstrap/unix-48/Out.h | 3 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 7 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/VT100.c | 2 +- bootstrap/unix-48/VT100.h | 2 +- bootstrap/unix-48/extTools.c | 2 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-88/Compiler.c | 2 +- bootstrap/unix-88/Configuration.c | 4 +- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Files.c | 2 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 32 ++++++++- bootstrap/unix-88/Heap.h | 29 +++++++-- bootstrap/unix-88/Modules.c | 76 +++++----------------- bootstrap/unix-88/Modules.h | 41 ++---------- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 2 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 2 +- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 2 +- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 2 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Out.c | 97 +++++++++++++++++++++++++++- bootstrap/unix-88/Out.h | 3 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 7 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/VT100.c | 2 +- bootstrap/unix-88/VT100.h | 2 +- bootstrap/unix-88/extTools.c | 2 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/windows-48/Compiler.c | 2 +- bootstrap/windows-48/Configuration.c | 4 +- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Files.c | 2 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 32 ++++++++- bootstrap/windows-48/Heap.h | 29 +++++++-- bootstrap/windows-48/Modules.c | 76 +++++----------------- bootstrap/windows-48/Modules.h | 41 ++---------- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 2 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 2 +- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 2 +- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 2 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Out.c | 97 +++++++++++++++++++++++++++- bootstrap/windows-48/Out.h | 3 +- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 7 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/VT100.c | 2 +- bootstrap/windows-48/VT100.h | 2 +- bootstrap/windows-48/extTools.c | 2 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-88/Compiler.c | 2 +- bootstrap/windows-88/Configuration.c | 4 +- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Files.c | 2 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 32 ++++++++- bootstrap/windows-88/Heap.h | 29 +++++++-- bootstrap/windows-88/Modules.c | 76 +++++----------------- bootstrap/windows-88/Modules.h | 41 ++---------- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 2 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 2 +- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 2 +- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 2 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Out.c | 97 +++++++++++++++++++++++++++- bootstrap/windows-88/Out.h | 3 +- bootstrap/windows-88/Platform.c | 2 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 7 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/VT100.c | 2 +- bootstrap/windows-88/VT100.h | 2 +- bootstrap/windows-88/extTools.c | 2 +- bootstrap/windows-88/extTools.h | 2 +- 185 files changed, 1040 insertions(+), 695 deletions(-) diff --git a/bootstrap/unix-44/Compiler.c b/bootstrap/unix-44/Compiler.c index ffd8b03e..65da2216 100644 --- a/bootstrap/unix-44/Compiler.c +++ b/bootstrap/unix-44/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index 6db13d09..77782293 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index 4259cfef..438fec28 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 652cb128..02716878 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index c548dae1..2270fec0 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index 125a2854..c9adb169 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -84,6 +84,7 @@ static void Heap_CheckFin (void); static void Heap_ExtendHeap (INT32 blksz); export void Heap_FINALL (void); static void Heap_Finalize (void); +export INT32 Heap_FreeModule (CHAR *name, ADDRESS name__len); export void Heap_GC (BOOLEAN markStack); static void Heap_HeapSort (INT32 n, INT32 *a, ADDRESS a__len); export void Heap_INCREF (Heap_Module m); @@ -143,6 +144,35 @@ SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) return (void*)m; } +INT32 Heap_FreeModule (CHAR *name, ADDRESS name__len) +{ + Heap_Module m, p; + __DUP(name, name__len, CHAR); + m = (Heap_Module)(ADDRESS)Heap_modules; + while ((m != NIL && __STRCMP(m->name, name) != 0)) { + p = m; + m = m->next; + } + if ((m != NIL && m->refcnt == 0)) { + if (m == (Heap_Module)(ADDRESS)Heap_modules) { + Heap_modules = (SYSTEM_PTR)m->next; + } else { + p->next = m->next; + } + __DEL(name); + return 0; + } else { + if (m == NIL) { + __DEL(name); + return -1; + } else { + __DEL(name); + return m->refcnt; + } + } + __RETCHK; +} + void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) { Heap_Cmd c; diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index e794a4a3..0df71d54 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,16 +1,26 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h #include "SYSTEM.h" +typedef + struct Heap_CmdDesc *Heap_Cmd; + typedef CHAR Heap_CmdName[24]; typedef void (*Heap_Command)(void); +typedef + struct Heap_CmdDesc { + Heap_Cmd next; + Heap_CmdName name; + Heap_Command cmd; + } Heap_CmdDesc; + typedef void (*Heap_EnumProc)(void(*)(SYSTEM_PTR)); @@ -21,13 +31,18 @@ typedef struct Heap_ModuleDesc *Heap_Module; typedef - struct Heap_ModuleDesc { - INT32 _prvt0; - char _prvt1[44]; - } Heap_ModuleDesc; + CHAR Heap_ModuleName[20]; typedef - CHAR Heap_ModuleName[20]; + struct Heap_ModuleDesc { + Heap_Module next; + Heap_ModuleName name; + INT32 refcnt; + Heap_Cmd cmds; + INT32 types; + Heap_EnumProc enumPtrs; + char _prvt0[8]; + } Heap_ModuleDesc; import SYSTEM_PTR Heap_modules; @@ -35,8 +50,10 @@ import INT32 Heap_allocated, Heap_heapsize; import INT16 Heap_FileCount; import ADDRESS *Heap_ModuleDesc__typ; +import ADDRESS *Heap_CmdDesc__typ; import void Heap_FINALL (void); +import INT32 Heap_FreeModule (CHAR *name, ADDRESS name__len); import void Heap_GC (BOOLEAN markStack); import void Heap_INCREF (Heap_Module m); import void Heap_InitHeap (void); diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index b27930e7..03d205e0 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -9,47 +9,15 @@ #include "Heap.h" #include "Platform.h" -typedef - struct Modules_CmdDesc *Modules_Cmd; - -typedef - void (*Modules_Command)(void); - -typedef - struct Modules_CmdDesc { - Modules_Cmd next; - CHAR name[24]; - Modules_Command cmd; - } Modules_CmdDesc; - -typedef - struct Modules_ModuleDesc *Modules_Module; - -typedef - CHAR Modules_ModuleName[20]; - -typedef - struct Modules_ModuleDesc { - Modules_Module next; - Modules_ModuleName name; - INT32 refcnt; - Modules_Cmd cmds; - INT32 types; - void (*enumPtrs)(void(*)(INT32)); - INT32 reserved1, reserved2; - } Modules_ModuleDesc; - export INT16 Modules_res; export CHAR Modules_resMsg[256]; -export Modules_ModuleName Modules_imported, Modules_importing; +export Heap_ModuleName Modules_imported, Modules_importing; export INT32 Modules_MainStackFrame; export INT16 Modules_ArgCount; export INT32 Modules_ArgVector; export CHAR Modules_BinaryDir[1024]; -export ADDRESS *Modules_ModuleDesc__typ; -export ADDRESS *Modules_CmdDesc__typ; static void Modules_Append (CHAR *s, ADDRESS s__len, CHAR *d, ADDRESS d__len); static void Modules_AppendPart (CHAR c, CHAR *s, ADDRESS s__len, CHAR *d, ADDRESS d__len); @@ -68,8 +36,8 @@ export void Modules_Init (INT32 argc, INT32 argvadr); static BOOLEAN Modules_IsAbsolute (CHAR *d, ADDRESS d__len); static BOOLEAN Modules_IsFilePresent (CHAR *s, ADDRESS s__len); static BOOLEAN Modules_IsOneOf (CHAR c, CHAR *s, ADDRESS s__len); -export Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, ADDRESS name__len); -export Modules_Module Modules_ThisMod (CHAR *name, ADDRESS name__len); +export Heap_Command Modules_ThisCommand (Heap_Module mod, CHAR *name, ADDRESS name__len); +export Heap_Module Modules_ThisMod (CHAR *name, ADDRESS name__len); static void Modules_Trim (CHAR *s, ADDRESS s__len, CHAR *d, ADDRESS d__len); static void Modules_errch (CHAR c); static void Modules_errint (INT32 l); @@ -79,8 +47,7 @@ extern void Heap_InitHeap(); extern void *Modules__init(void); #define Modules_InitHeap() Heap_InitHeap() #define Modules_ModulesInit() Modules__init() -#define Modules_modules() (Modules_Module)Heap_modules -#define Modules_setmodules(m) Heap_modules = m +#define Modules_modules() (Heap_Module)Heap_modules void Modules_Init (INT32 argc, INT32 argvadr) { @@ -334,11 +301,11 @@ static void Modules_FindBinaryDir (CHAR *binarydir, ADDRESS binarydir__len) } } -Modules_Module Modules_ThisMod (CHAR *name, ADDRESS name__len) +Heap_Module Modules_ThisMod (CHAR *name, ADDRESS name__len) { - Modules_Module m = NIL; + Heap_Module m = NIL; CHAR bodyname[64]; - Modules_Command body; + Heap_Command body; __DUP(name, name__len, CHAR); m = Modules_modules(); while ((m != NIL && __STRCMP(m->name, name) != 0)) { @@ -358,9 +325,9 @@ Modules_Module Modules_ThisMod (CHAR *name, ADDRESS name__len) return m; } -Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, ADDRESS name__len) +Heap_Command Modules_ThisCommand (Heap_Module mod, CHAR *name, ADDRESS name__len) { - Modules_Cmd c = NIL; + Heap_Cmd c = NIL; __DUP(name, name__len, CHAR); c = mod->cmds; while ((c != NIL && __STRCMP(c->name, name) != 0)) { @@ -387,31 +354,24 @@ Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, ADDRESS nam void Modules_Free (CHAR *name, ADDRESS name__len, BOOLEAN all) { - Modules_Module m = NIL, p = NIL; + Heap_Module m = NIL, p = NIL; + INT32 refcount; __DUP(name, name__len, CHAR); m = Modules_modules(); if (all) { Modules_res = 1; __MOVE("unloading \"all\" not yet supported", Modules_resMsg, 34); } else { - while ((m != NIL && __STRCMP(m->name, name) != 0)) { - p = m; - m = m->next; - } - if ((m != NIL && m->refcnt == 0)) { - if (m == Modules_modules()) { - Modules_setmodules(m->next); - } else { - p->next = m->next; - } + refcount = Heap_FreeModule(name, name__len); + if (refcount == 0) { Modules_res = 0; } else { - Modules_res = 1; - if (m == NIL) { + if (refcount < 0) { __MOVE("module not found", Modules_resMsg, 17); } else { __MOVE("clients of this module exist", Modules_resMsg, 29); } + Modules_res = 1; } } __DEL(name); @@ -533,8 +493,6 @@ void Modules_AssertFail (INT32 code) } } -__TDESC(Modules_ModuleDesc, 1, 2) = {__TDFLDS("ModuleDesc", 48), {0, 28, -12}}; -__TDESC(Modules_CmdDesc, 1, 1) = {__TDFLDS("CmdDesc", 32), {0, -8}}; export void *Modules__init(void) { @@ -542,8 +500,6 @@ export void *Modules__init(void) __MODULE_IMPORT(Heap); __MODULE_IMPORT(Platform); __REGMOD("Modules", 0); - __INITYP(Modules_ModuleDesc, Modules_ModuleDesc, 0); - __INITYP(Modules_CmdDesc, Modules_CmdDesc, 0); /* BEGIN */ Modules_FindBinaryDir((void*)Modules_BinaryDir, 1024); __ENDMOD; diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index 553f80ed..3c1c580d 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,51 +1,20 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h #include "SYSTEM.h" - -typedef - struct Modules_CmdDesc *Modules_Cmd; - -typedef - void (*Modules_Command)(void); - -typedef - struct Modules_CmdDesc { - Modules_Cmd next; - CHAR name[24]; - Modules_Command cmd; - } Modules_CmdDesc; - -typedef - struct Modules_ModuleDesc *Modules_Module; - -typedef - CHAR Modules_ModuleName[20]; - -typedef - struct Modules_ModuleDesc { - Modules_Module next; - Modules_ModuleName name; - INT32 refcnt; - Modules_Cmd cmds; - INT32 types; - void (*enumPtrs)(void(*)(INT32)); - char _prvt0[8]; - } Modules_ModuleDesc; +#include "Heap.h" import INT16 Modules_res; import CHAR Modules_resMsg[256]; -import Modules_ModuleName Modules_imported, Modules_importing; +import Heap_ModuleName Modules_imported, Modules_importing; import INT32 Modules_MainStackFrame; import INT16 Modules_ArgCount; import INT32 Modules_ArgVector; import CHAR Modules_BinaryDir[1024]; -import ADDRESS *Modules_ModuleDesc__typ; -import ADDRESS *Modules_CmdDesc__typ; import INT16 Modules_ArgPos (CHAR *s, ADDRESS s__len); import void Modules_AssertFail (INT32 code); @@ -54,8 +23,8 @@ import void Modules_GetArg (INT16 n, CHAR *val, ADDRESS val__len); import void Modules_GetIntArg (INT16 n, INT32 *val); import void Modules_Halt (INT32 code); import void Modules_Init (INT32 argc, INT32 argvadr); -import Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, ADDRESS name__len); -import Modules_Module Modules_ThisMod (CHAR *name, ADDRESS name__len); +import Heap_Command Modules_ThisCommand (Heap_Module mod, CHAR *name, ADDRESS name__len); +import Heap_Module Modules_ThisMod (CHAR *name, ADDRESS name__len); import void *Modules__init(void); diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index d83386eb..7e558357 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index feb85d73..b6d457bd 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index ab01642c..c09d2e6a 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index f742f265..7c47ed18 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index a6c7a5cd..a3718f79 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index 621dfb51..6d2755d8 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index 383b6d65..5924f42f 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index c1fe21fb..c13a4e91 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index 4569c80d..ed3ea3a1 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index c0707c34..6dae098c 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index 9bc66090..e929a6e0 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index 6b2b0929..00094b66 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index 42081077..7e829aa2 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index d363f022..f83e65fb 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Out.c b/bootstrap/unix-44/Out.c index 65e2e307..39900621 100644 --- a/bootstrap/unix-44/Out.c +++ b/bootstrap/unix-44/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -6,6 +6,7 @@ #define SET UINT32 #include "SYSTEM.h" +#include "Heap.h" #include "Platform.h" @@ -13,8 +14,11 @@ export BOOLEAN Out_IsConsole; static CHAR Out_buf[128]; static INT16 Out_in; +static ADDRESS *typedesc__5__typ; export void Out_Char (CHAR ch); +static void Out_DumpModule (Heap_Module m); +export void Out_DumpType (SYSTEM_BYTE *o, ADDRESS o__len); export void Out_Flush (void); export void Out_Hex (INT64 x, INT64 n); export void Out_HexDump (SYSTEM_BYTE *m, ADDRESS m__len); @@ -203,6 +207,94 @@ void Out_HexDump (SYSTEM_BYTE *m, ADDRESS m__len) Out_HexDumpAdr((ADDRESS)m, 0, m__len); } +static void Out_DumpModule (Heap_Module m) +{ + Out_String((CHAR*)" next: ", 13); + Out_Hex((INT32)(ADDRESS)m->next, 1); + Out_Ln(); + Out_String((CHAR*)" name: ", 13); + Out_String(m->name, 20); + Out_Ln(); + Out_String((CHAR*)" refcnt: ", 13); + Out_Hex(m->refcnt, 1); + Out_Ln(); + Out_String((CHAR*)" cmds: ", 13); + Out_Hex((INT32)(ADDRESS)m->cmds, 1); + Out_Ln(); + Out_String((CHAR*)" types: ", 13); + Out_Hex(m->types, 1); + Out_Ln(); + Out_String((CHAR*)" enumPtrs: ", 13); + Out_Hex((INT32)(ADDRESS)m->enumPtrs, 1); + Out_Ln(); +} + +typedef + struct typedesc__5 *tag__4; + +typedef + struct typedesc__5 { + INT32 tag, next, level, module; + CHAR name[24]; + INT32 bases[16]; + INT32 reserved, blksz, ptr0; + } typedesc__5; + +void Out_DumpType (SYSTEM_BYTE *o, ADDRESS o__len) +{ + INT32 addr; + tag__4 desc = NIL; + INT16 i; + __GET((ADDRESS)o - 4, addr, INT32); + Out_String((CHAR*)"obj tag: ", 11); + Out_Hex(addr, 1); + Out_Ln(); + desc = (tag__4)(ADDRESS)(addr - 108); + Out_String((CHAR*)"desc at: ", 11); + Out_Hex((INT32)(ADDRESS)desc, 1); + Out_Ln(); + Out_String((CHAR*)"desc contains:", 15); + Out_Ln(); + Out_String((CHAR*)"tag: ", 11); + Out_Hex(desc->tag, 1); + Out_Ln(); + Out_String((CHAR*)"next: ", 11); + Out_Hex(desc->next, 1); + Out_Ln(); + Out_String((CHAR*)"level: ", 11); + Out_Hex(desc->level, 1); + Out_Ln(); + Out_String((CHAR*)"module: ", 11); + Out_Hex(desc->module, 1); + Out_Ln(); + Out_DumpModule((Heap_Module)(ADDRESS)desc->module); + Out_String((CHAR*)"name: ", 11); + Out_String(desc->name, 24); + Out_Ln(); + Out_String((CHAR*)"bases: ", 11); + i = 0; + while (i < 16) { + Out_Hex(desc->bases[__X(i, 16)], 8); + if (__MASK(i, -4) == 3) { + Out_Ln(); + Out_String((CHAR*)" ", 11); + } else { + Out_Char(' '); + } + i += 1; + } + Out_Ln(); + Out_String((CHAR*)"reserved: ", 11); + Out_Hex(desc->reserved, 1); + Out_Ln(); + Out_String((CHAR*)"blksz: ", 11); + Out_Hex(desc->blksz, 1); + Out_Ln(); + Out_String((CHAR*)"ptr0: ", 11); + Out_Hex(desc->ptr0, 1); + Out_Ln(); +} + static void Out_digit (INT64 n, CHAR *s, ADDRESS s__len, INT16 *i) { *i -= 1; @@ -380,15 +472,18 @@ void Out_LongReal (LONGREAL x, INT16 n) Out_RealP(x, n, 1); } +__TDESC(typedesc__5, 1, 0) = {__TDFLDS("typedesc__5", 116), {-4}}; export void *Out__init(void) { __DEFMOD; + __MODULE_IMPORT(Heap); __MODULE_IMPORT(Platform); __REGMOD("Out", 0); __REGCMD("Flush", Out_Flush); __REGCMD("Ln", Out_Ln); __REGCMD("Open", Out_Open); + __INITYP(typedesc__5, typedesc__5, 0); /* BEGIN */ Out_IsConsole = Platform_IsConsole(1); Out_in = 0; diff --git a/bootstrap/unix-44/Out.h b/bootstrap/unix-44/Out.h index 1db1f1b3..0b3a93df 100644 --- a/bootstrap/unix-44/Out.h +++ b/bootstrap/unix-44/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h @@ -10,6 +10,7 @@ import BOOLEAN Out_IsConsole; import void Out_Char (CHAR ch); +import void Out_DumpType (SYSTEM_BYTE *o, ADDRESS o__len); import void Out_Flush (void); import void Out_Hex (INT64 x, INT64 n); import void Out_HexDump (SYSTEM_BYTE *m, ADDRESS m__len); diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 22eb3138..a825b8ec 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index cd9d9890..5d752192 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index f5ee1490..0a2d220b 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index 6d0ec38b..0c564f0e 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index 4ee2fc23..ed806db0 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index ae281477..93b62826 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index 8c4ccea8..bbca112c 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -390,6 +390,7 @@ void Texts_DumpReader (Texts_Reader re) Texts_DumpRun(re.run); } } + Out_DumpType((void*)&*re.run, 20); } static Texts_FontsFont Texts_FontsThis (CHAR *name, ADDRESS name__len) @@ -1566,8 +1567,8 @@ static void LoadElem__22 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span static void LoadElem__22 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e) { - Modules_Module M = NIL; - Modules_Command Cmd; + Heap_Module M = NIL; + Heap_Command Cmd; Texts_Alien a = NIL; INT32 org, ew, eh; INT8 eno; diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index dfe60b54..04c8767a 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/VT100.c b/bootstrap/unix-44/VT100.c index 9ab993c9..ed38e4dc 100644 --- a/bootstrap/unix-44/VT100.c +++ b/bootstrap/unix-44/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/VT100.h b/bootstrap/unix-44/VT100.h index 3de3605c..69601701 100644 --- a/bootstrap/unix-44/VT100.h +++ b/bootstrap/unix-44/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index 213abf27..0b3a981e 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index 4278a34c..36571c99 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/Compiler.c b/bootstrap/unix-48/Compiler.c index ffd8b03e..65da2216 100644 --- a/bootstrap/unix-48/Compiler.c +++ b/bootstrap/unix-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index 6db13d09..77782293 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index 4259cfef..438fec28 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 652cb128..02716878 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index c548dae1..2270fec0 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index 125a2854..c9adb169 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -84,6 +84,7 @@ static void Heap_CheckFin (void); static void Heap_ExtendHeap (INT32 blksz); export void Heap_FINALL (void); static void Heap_Finalize (void); +export INT32 Heap_FreeModule (CHAR *name, ADDRESS name__len); export void Heap_GC (BOOLEAN markStack); static void Heap_HeapSort (INT32 n, INT32 *a, ADDRESS a__len); export void Heap_INCREF (Heap_Module m); @@ -143,6 +144,35 @@ SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) return (void*)m; } +INT32 Heap_FreeModule (CHAR *name, ADDRESS name__len) +{ + Heap_Module m, p; + __DUP(name, name__len, CHAR); + m = (Heap_Module)(ADDRESS)Heap_modules; + while ((m != NIL && __STRCMP(m->name, name) != 0)) { + p = m; + m = m->next; + } + if ((m != NIL && m->refcnt == 0)) { + if (m == (Heap_Module)(ADDRESS)Heap_modules) { + Heap_modules = (SYSTEM_PTR)m->next; + } else { + p->next = m->next; + } + __DEL(name); + return 0; + } else { + if (m == NIL) { + __DEL(name); + return -1; + } else { + __DEL(name); + return m->refcnt; + } + } + __RETCHK; +} + void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) { Heap_Cmd c; diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index e794a4a3..0df71d54 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,16 +1,26 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h #include "SYSTEM.h" +typedef + struct Heap_CmdDesc *Heap_Cmd; + typedef CHAR Heap_CmdName[24]; typedef void (*Heap_Command)(void); +typedef + struct Heap_CmdDesc { + Heap_Cmd next; + Heap_CmdName name; + Heap_Command cmd; + } Heap_CmdDesc; + typedef void (*Heap_EnumProc)(void(*)(SYSTEM_PTR)); @@ -21,13 +31,18 @@ typedef struct Heap_ModuleDesc *Heap_Module; typedef - struct Heap_ModuleDesc { - INT32 _prvt0; - char _prvt1[44]; - } Heap_ModuleDesc; + CHAR Heap_ModuleName[20]; typedef - CHAR Heap_ModuleName[20]; + struct Heap_ModuleDesc { + Heap_Module next; + Heap_ModuleName name; + INT32 refcnt; + Heap_Cmd cmds; + INT32 types; + Heap_EnumProc enumPtrs; + char _prvt0[8]; + } Heap_ModuleDesc; import SYSTEM_PTR Heap_modules; @@ -35,8 +50,10 @@ import INT32 Heap_allocated, Heap_heapsize; import INT16 Heap_FileCount; import ADDRESS *Heap_ModuleDesc__typ; +import ADDRESS *Heap_CmdDesc__typ; import void Heap_FINALL (void); +import INT32 Heap_FreeModule (CHAR *name, ADDRESS name__len); import void Heap_GC (BOOLEAN markStack); import void Heap_INCREF (Heap_Module m); import void Heap_InitHeap (void); diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index b27930e7..03d205e0 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -9,47 +9,15 @@ #include "Heap.h" #include "Platform.h" -typedef - struct Modules_CmdDesc *Modules_Cmd; - -typedef - void (*Modules_Command)(void); - -typedef - struct Modules_CmdDesc { - Modules_Cmd next; - CHAR name[24]; - Modules_Command cmd; - } Modules_CmdDesc; - -typedef - struct Modules_ModuleDesc *Modules_Module; - -typedef - CHAR Modules_ModuleName[20]; - -typedef - struct Modules_ModuleDesc { - Modules_Module next; - Modules_ModuleName name; - INT32 refcnt; - Modules_Cmd cmds; - INT32 types; - void (*enumPtrs)(void(*)(INT32)); - INT32 reserved1, reserved2; - } Modules_ModuleDesc; - export INT16 Modules_res; export CHAR Modules_resMsg[256]; -export Modules_ModuleName Modules_imported, Modules_importing; +export Heap_ModuleName Modules_imported, Modules_importing; export INT32 Modules_MainStackFrame; export INT16 Modules_ArgCount; export INT32 Modules_ArgVector; export CHAR Modules_BinaryDir[1024]; -export ADDRESS *Modules_ModuleDesc__typ; -export ADDRESS *Modules_CmdDesc__typ; static void Modules_Append (CHAR *s, ADDRESS s__len, CHAR *d, ADDRESS d__len); static void Modules_AppendPart (CHAR c, CHAR *s, ADDRESS s__len, CHAR *d, ADDRESS d__len); @@ -68,8 +36,8 @@ export void Modules_Init (INT32 argc, INT32 argvadr); static BOOLEAN Modules_IsAbsolute (CHAR *d, ADDRESS d__len); static BOOLEAN Modules_IsFilePresent (CHAR *s, ADDRESS s__len); static BOOLEAN Modules_IsOneOf (CHAR c, CHAR *s, ADDRESS s__len); -export Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, ADDRESS name__len); -export Modules_Module Modules_ThisMod (CHAR *name, ADDRESS name__len); +export Heap_Command Modules_ThisCommand (Heap_Module mod, CHAR *name, ADDRESS name__len); +export Heap_Module Modules_ThisMod (CHAR *name, ADDRESS name__len); static void Modules_Trim (CHAR *s, ADDRESS s__len, CHAR *d, ADDRESS d__len); static void Modules_errch (CHAR c); static void Modules_errint (INT32 l); @@ -79,8 +47,7 @@ extern void Heap_InitHeap(); extern void *Modules__init(void); #define Modules_InitHeap() Heap_InitHeap() #define Modules_ModulesInit() Modules__init() -#define Modules_modules() (Modules_Module)Heap_modules -#define Modules_setmodules(m) Heap_modules = m +#define Modules_modules() (Heap_Module)Heap_modules void Modules_Init (INT32 argc, INT32 argvadr) { @@ -334,11 +301,11 @@ static void Modules_FindBinaryDir (CHAR *binarydir, ADDRESS binarydir__len) } } -Modules_Module Modules_ThisMod (CHAR *name, ADDRESS name__len) +Heap_Module Modules_ThisMod (CHAR *name, ADDRESS name__len) { - Modules_Module m = NIL; + Heap_Module m = NIL; CHAR bodyname[64]; - Modules_Command body; + Heap_Command body; __DUP(name, name__len, CHAR); m = Modules_modules(); while ((m != NIL && __STRCMP(m->name, name) != 0)) { @@ -358,9 +325,9 @@ Modules_Module Modules_ThisMod (CHAR *name, ADDRESS name__len) return m; } -Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, ADDRESS name__len) +Heap_Command Modules_ThisCommand (Heap_Module mod, CHAR *name, ADDRESS name__len) { - Modules_Cmd c = NIL; + Heap_Cmd c = NIL; __DUP(name, name__len, CHAR); c = mod->cmds; while ((c != NIL && __STRCMP(c->name, name) != 0)) { @@ -387,31 +354,24 @@ Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, ADDRESS nam void Modules_Free (CHAR *name, ADDRESS name__len, BOOLEAN all) { - Modules_Module m = NIL, p = NIL; + Heap_Module m = NIL, p = NIL; + INT32 refcount; __DUP(name, name__len, CHAR); m = Modules_modules(); if (all) { Modules_res = 1; __MOVE("unloading \"all\" not yet supported", Modules_resMsg, 34); } else { - while ((m != NIL && __STRCMP(m->name, name) != 0)) { - p = m; - m = m->next; - } - if ((m != NIL && m->refcnt == 0)) { - if (m == Modules_modules()) { - Modules_setmodules(m->next); - } else { - p->next = m->next; - } + refcount = Heap_FreeModule(name, name__len); + if (refcount == 0) { Modules_res = 0; } else { - Modules_res = 1; - if (m == NIL) { + if (refcount < 0) { __MOVE("module not found", Modules_resMsg, 17); } else { __MOVE("clients of this module exist", Modules_resMsg, 29); } + Modules_res = 1; } } __DEL(name); @@ -533,8 +493,6 @@ void Modules_AssertFail (INT32 code) } } -__TDESC(Modules_ModuleDesc, 1, 2) = {__TDFLDS("ModuleDesc", 48), {0, 28, -12}}; -__TDESC(Modules_CmdDesc, 1, 1) = {__TDFLDS("CmdDesc", 32), {0, -8}}; export void *Modules__init(void) { @@ -542,8 +500,6 @@ export void *Modules__init(void) __MODULE_IMPORT(Heap); __MODULE_IMPORT(Platform); __REGMOD("Modules", 0); - __INITYP(Modules_ModuleDesc, Modules_ModuleDesc, 0); - __INITYP(Modules_CmdDesc, Modules_CmdDesc, 0); /* BEGIN */ Modules_FindBinaryDir((void*)Modules_BinaryDir, 1024); __ENDMOD; diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index 553f80ed..3c1c580d 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,51 +1,20 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h #include "SYSTEM.h" - -typedef - struct Modules_CmdDesc *Modules_Cmd; - -typedef - void (*Modules_Command)(void); - -typedef - struct Modules_CmdDesc { - Modules_Cmd next; - CHAR name[24]; - Modules_Command cmd; - } Modules_CmdDesc; - -typedef - struct Modules_ModuleDesc *Modules_Module; - -typedef - CHAR Modules_ModuleName[20]; - -typedef - struct Modules_ModuleDesc { - Modules_Module next; - Modules_ModuleName name; - INT32 refcnt; - Modules_Cmd cmds; - INT32 types; - void (*enumPtrs)(void(*)(INT32)); - char _prvt0[8]; - } Modules_ModuleDesc; +#include "Heap.h" import INT16 Modules_res; import CHAR Modules_resMsg[256]; -import Modules_ModuleName Modules_imported, Modules_importing; +import Heap_ModuleName Modules_imported, Modules_importing; import INT32 Modules_MainStackFrame; import INT16 Modules_ArgCount; import INT32 Modules_ArgVector; import CHAR Modules_BinaryDir[1024]; -import ADDRESS *Modules_ModuleDesc__typ; -import ADDRESS *Modules_CmdDesc__typ; import INT16 Modules_ArgPos (CHAR *s, ADDRESS s__len); import void Modules_AssertFail (INT32 code); @@ -54,8 +23,8 @@ import void Modules_GetArg (INT16 n, CHAR *val, ADDRESS val__len); import void Modules_GetIntArg (INT16 n, INT32 *val); import void Modules_Halt (INT32 code); import void Modules_Init (INT32 argc, INT32 argvadr); -import Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, ADDRESS name__len); -import Modules_Module Modules_ThisMod (CHAR *name, ADDRESS name__len); +import Heap_Command Modules_ThisCommand (Heap_Module mod, CHAR *name, ADDRESS name__len); +import Heap_Module Modules_ThisMod (CHAR *name, ADDRESS name__len); import void *Modules__init(void); diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index d83386eb..7e558357 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index feb85d73..b6d457bd 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index ab01642c..c09d2e6a 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index f742f265..7c47ed18 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index a6c7a5cd..a3718f79 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index 621dfb51..6d2755d8 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index 383b6d65..5924f42f 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index c1fe21fb..c13a4e91 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index 4569c80d..ed3ea3a1 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index c0707c34..6dae098c 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 0d32553a..6b6144fc 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index 6b2b0929..00094b66 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index 42081077..7e829aa2 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index d363f022..f83e65fb 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Out.c b/bootstrap/unix-48/Out.c index 65e2e307..39900621 100644 --- a/bootstrap/unix-48/Out.c +++ b/bootstrap/unix-48/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -6,6 +6,7 @@ #define SET UINT32 #include "SYSTEM.h" +#include "Heap.h" #include "Platform.h" @@ -13,8 +14,11 @@ export BOOLEAN Out_IsConsole; static CHAR Out_buf[128]; static INT16 Out_in; +static ADDRESS *typedesc__5__typ; export void Out_Char (CHAR ch); +static void Out_DumpModule (Heap_Module m); +export void Out_DumpType (SYSTEM_BYTE *o, ADDRESS o__len); export void Out_Flush (void); export void Out_Hex (INT64 x, INT64 n); export void Out_HexDump (SYSTEM_BYTE *m, ADDRESS m__len); @@ -203,6 +207,94 @@ void Out_HexDump (SYSTEM_BYTE *m, ADDRESS m__len) Out_HexDumpAdr((ADDRESS)m, 0, m__len); } +static void Out_DumpModule (Heap_Module m) +{ + Out_String((CHAR*)" next: ", 13); + Out_Hex((INT32)(ADDRESS)m->next, 1); + Out_Ln(); + Out_String((CHAR*)" name: ", 13); + Out_String(m->name, 20); + Out_Ln(); + Out_String((CHAR*)" refcnt: ", 13); + Out_Hex(m->refcnt, 1); + Out_Ln(); + Out_String((CHAR*)" cmds: ", 13); + Out_Hex((INT32)(ADDRESS)m->cmds, 1); + Out_Ln(); + Out_String((CHAR*)" types: ", 13); + Out_Hex(m->types, 1); + Out_Ln(); + Out_String((CHAR*)" enumPtrs: ", 13); + Out_Hex((INT32)(ADDRESS)m->enumPtrs, 1); + Out_Ln(); +} + +typedef + struct typedesc__5 *tag__4; + +typedef + struct typedesc__5 { + INT32 tag, next, level, module; + CHAR name[24]; + INT32 bases[16]; + INT32 reserved, blksz, ptr0; + } typedesc__5; + +void Out_DumpType (SYSTEM_BYTE *o, ADDRESS o__len) +{ + INT32 addr; + tag__4 desc = NIL; + INT16 i; + __GET((ADDRESS)o - 4, addr, INT32); + Out_String((CHAR*)"obj tag: ", 11); + Out_Hex(addr, 1); + Out_Ln(); + desc = (tag__4)(ADDRESS)(addr - 108); + Out_String((CHAR*)"desc at: ", 11); + Out_Hex((INT32)(ADDRESS)desc, 1); + Out_Ln(); + Out_String((CHAR*)"desc contains:", 15); + Out_Ln(); + Out_String((CHAR*)"tag: ", 11); + Out_Hex(desc->tag, 1); + Out_Ln(); + Out_String((CHAR*)"next: ", 11); + Out_Hex(desc->next, 1); + Out_Ln(); + Out_String((CHAR*)"level: ", 11); + Out_Hex(desc->level, 1); + Out_Ln(); + Out_String((CHAR*)"module: ", 11); + Out_Hex(desc->module, 1); + Out_Ln(); + Out_DumpModule((Heap_Module)(ADDRESS)desc->module); + Out_String((CHAR*)"name: ", 11); + Out_String(desc->name, 24); + Out_Ln(); + Out_String((CHAR*)"bases: ", 11); + i = 0; + while (i < 16) { + Out_Hex(desc->bases[__X(i, 16)], 8); + if (__MASK(i, -4) == 3) { + Out_Ln(); + Out_String((CHAR*)" ", 11); + } else { + Out_Char(' '); + } + i += 1; + } + Out_Ln(); + Out_String((CHAR*)"reserved: ", 11); + Out_Hex(desc->reserved, 1); + Out_Ln(); + Out_String((CHAR*)"blksz: ", 11); + Out_Hex(desc->blksz, 1); + Out_Ln(); + Out_String((CHAR*)"ptr0: ", 11); + Out_Hex(desc->ptr0, 1); + Out_Ln(); +} + static void Out_digit (INT64 n, CHAR *s, ADDRESS s__len, INT16 *i) { *i -= 1; @@ -380,15 +472,18 @@ void Out_LongReal (LONGREAL x, INT16 n) Out_RealP(x, n, 1); } +__TDESC(typedesc__5, 1, 0) = {__TDFLDS("typedesc__5", 116), {-4}}; export void *Out__init(void) { __DEFMOD; + __MODULE_IMPORT(Heap); __MODULE_IMPORT(Platform); __REGMOD("Out", 0); __REGCMD("Flush", Out_Flush); __REGCMD("Ln", Out_Ln); __REGCMD("Open", Out_Open); + __INITYP(typedesc__5, typedesc__5, 0); /* BEGIN */ Out_IsConsole = Platform_IsConsole(1); Out_in = 0; diff --git a/bootstrap/unix-48/Out.h b/bootstrap/unix-48/Out.h index 1db1f1b3..0b3a93df 100644 --- a/bootstrap/unix-48/Out.h +++ b/bootstrap/unix-48/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h @@ -10,6 +10,7 @@ import BOOLEAN Out_IsConsole; import void Out_Char (CHAR ch); +import void Out_DumpType (SYSTEM_BYTE *o, ADDRESS o__len); import void Out_Flush (void); import void Out_Hex (INT64 x, INT64 n); import void Out_HexDump (SYSTEM_BYTE *m, ADDRESS m__len); diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 22eb3138..a825b8ec 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index cd9d9890..5d752192 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index f5ee1490..0a2d220b 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index 6d0ec38b..0c564f0e 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index 4ee2fc23..ed806db0 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index ae281477..93b62826 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index 4825ab70..a91fe173 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -390,6 +390,7 @@ void Texts_DumpReader (Texts_Reader re) Texts_DumpRun(re.run); } } + Out_DumpType((void*)&*re.run, 20); } static Texts_FontsFont Texts_FontsThis (CHAR *name, ADDRESS name__len) @@ -1566,8 +1567,8 @@ static void LoadElem__22 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span static void LoadElem__22 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e) { - Modules_Module M = NIL; - Modules_Command Cmd; + Heap_Module M = NIL; + Heap_Command Cmd; Texts_Alien a = NIL; INT32 org, ew, eh; INT8 eno; diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index c7c8d20f..24dacf51 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/VT100.c b/bootstrap/unix-48/VT100.c index 9ab993c9..ed38e4dc 100644 --- a/bootstrap/unix-48/VT100.c +++ b/bootstrap/unix-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/VT100.h b/bootstrap/unix-48/VT100.h index 3de3605c..69601701 100644 --- a/bootstrap/unix-48/VT100.h +++ b/bootstrap/unix-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index 213abf27..0b3a981e 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index 4278a34c..36571c99 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/Compiler.c b/bootstrap/unix-88/Compiler.c index ffd8b03e..65da2216 100644 --- a/bootstrap/unix-88/Compiler.c +++ b/bootstrap/unix-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index 6db13d09..77782293 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index 4259cfef..438fec28 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 92ada350..bed555a5 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index bb6e46df..ba436b23 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index 4554feac..3e929c3a 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -84,6 +84,7 @@ static void Heap_CheckFin (void); static void Heap_ExtendHeap (INT64 blksz); export void Heap_FINALL (void); static void Heap_Finalize (void); +export INT32 Heap_FreeModule (CHAR *name, ADDRESS name__len); export void Heap_GC (BOOLEAN markStack); static void Heap_HeapSort (INT64 n, INT64 *a, ADDRESS a__len); export void Heap_INCREF (Heap_Module m); @@ -143,6 +144,35 @@ SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) return (void*)m; } +INT32 Heap_FreeModule (CHAR *name, ADDRESS name__len) +{ + Heap_Module m, p; + __DUP(name, name__len, CHAR); + m = (Heap_Module)(ADDRESS)Heap_modules; + while ((m != NIL && __STRCMP(m->name, name) != 0)) { + p = m; + m = m->next; + } + if ((m != NIL && m->refcnt == 0)) { + if (m == (Heap_Module)(ADDRESS)Heap_modules) { + Heap_modules = (SYSTEM_PTR)m->next; + } else { + p->next = m->next; + } + __DEL(name); + return 0; + } else { + if (m == NIL) { + __DEL(name); + return -1; + } else { + __DEL(name); + return m->refcnt; + } + } + __RETCHK; +} + void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) { Heap_Cmd c; diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index 0fb80f05..b2018428 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,16 +1,26 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h #include "SYSTEM.h" +typedef + struct Heap_CmdDesc *Heap_Cmd; + typedef CHAR Heap_CmdName[24]; typedef void (*Heap_Command)(void); +typedef + struct Heap_CmdDesc { + Heap_Cmd next; + Heap_CmdName name; + Heap_Command cmd; + } Heap_CmdDesc; + typedef void (*Heap_EnumProc)(void(*)(SYSTEM_PTR)); @@ -21,13 +31,18 @@ typedef struct Heap_ModuleDesc *Heap_Module; typedef - struct Heap_ModuleDesc { - INT64 _prvt0; - char _prvt1[56]; - } Heap_ModuleDesc; + CHAR Heap_ModuleName[20]; typedef - CHAR Heap_ModuleName[20]; + struct Heap_ModuleDesc { + Heap_Module next; + Heap_ModuleName name; + INT32 refcnt; + Heap_Cmd cmds; + INT64 types; + Heap_EnumProc enumPtrs; + char _prvt0[8]; + } Heap_ModuleDesc; import SYSTEM_PTR Heap_modules; @@ -35,8 +50,10 @@ import INT64 Heap_allocated, Heap_heapsize; import INT16 Heap_FileCount; import ADDRESS *Heap_ModuleDesc__typ; +import ADDRESS *Heap_CmdDesc__typ; import void Heap_FINALL (void); +import INT32 Heap_FreeModule (CHAR *name, ADDRESS name__len); import void Heap_GC (BOOLEAN markStack); import void Heap_INCREF (Heap_Module m); import void Heap_InitHeap (void); diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index eb227d08..884c7b0e 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -9,47 +9,15 @@ #include "Heap.h" #include "Platform.h" -typedef - struct Modules_CmdDesc *Modules_Cmd; - -typedef - void (*Modules_Command)(void); - -typedef - struct Modules_CmdDesc { - Modules_Cmd next; - CHAR name[24]; - Modules_Command cmd; - } Modules_CmdDesc; - -typedef - struct Modules_ModuleDesc *Modules_Module; - -typedef - CHAR Modules_ModuleName[20]; - -typedef - struct Modules_ModuleDesc { - Modules_Module next; - Modules_ModuleName name; - INT32 refcnt; - Modules_Cmd cmds; - INT32 types; - void (*enumPtrs)(void(*)(INT32)); - INT32 reserved1, reserved2; - } Modules_ModuleDesc; - export INT16 Modules_res; export CHAR Modules_resMsg[256]; -export Modules_ModuleName Modules_imported, Modules_importing; +export Heap_ModuleName Modules_imported, Modules_importing; export INT64 Modules_MainStackFrame; export INT16 Modules_ArgCount; export INT64 Modules_ArgVector; export CHAR Modules_BinaryDir[1024]; -export ADDRESS *Modules_ModuleDesc__typ; -export ADDRESS *Modules_CmdDesc__typ; static void Modules_Append (CHAR *s, ADDRESS s__len, CHAR *d, ADDRESS d__len); static void Modules_AppendPart (CHAR c, CHAR *s, ADDRESS s__len, CHAR *d, ADDRESS d__len); @@ -68,8 +36,8 @@ export void Modules_Init (INT32 argc, INT64 argvadr); static BOOLEAN Modules_IsAbsolute (CHAR *d, ADDRESS d__len); static BOOLEAN Modules_IsFilePresent (CHAR *s, ADDRESS s__len); static BOOLEAN Modules_IsOneOf (CHAR c, CHAR *s, ADDRESS s__len); -export Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, ADDRESS name__len); -export Modules_Module Modules_ThisMod (CHAR *name, ADDRESS name__len); +export Heap_Command Modules_ThisCommand (Heap_Module mod, CHAR *name, ADDRESS name__len); +export Heap_Module Modules_ThisMod (CHAR *name, ADDRESS name__len); static void Modules_Trim (CHAR *s, ADDRESS s__len, CHAR *d, ADDRESS d__len); static void Modules_errch (CHAR c); static void Modules_errint (INT32 l); @@ -79,8 +47,7 @@ extern void Heap_InitHeap(); extern void *Modules__init(void); #define Modules_InitHeap() Heap_InitHeap() #define Modules_ModulesInit() Modules__init() -#define Modules_modules() (Modules_Module)Heap_modules -#define Modules_setmodules(m) Heap_modules = m +#define Modules_modules() (Heap_Module)Heap_modules void Modules_Init (INT32 argc, INT64 argvadr) { @@ -334,11 +301,11 @@ static void Modules_FindBinaryDir (CHAR *binarydir, ADDRESS binarydir__len) } } -Modules_Module Modules_ThisMod (CHAR *name, ADDRESS name__len) +Heap_Module Modules_ThisMod (CHAR *name, ADDRESS name__len) { - Modules_Module m = NIL; + Heap_Module m = NIL; CHAR bodyname[64]; - Modules_Command body; + Heap_Command body; __DUP(name, name__len, CHAR); m = Modules_modules(); while ((m != NIL && __STRCMP(m->name, name) != 0)) { @@ -358,9 +325,9 @@ Modules_Module Modules_ThisMod (CHAR *name, ADDRESS name__len) return m; } -Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, ADDRESS name__len) +Heap_Command Modules_ThisCommand (Heap_Module mod, CHAR *name, ADDRESS name__len) { - Modules_Cmd c = NIL; + Heap_Cmd c = NIL; __DUP(name, name__len, CHAR); c = mod->cmds; while ((c != NIL && __STRCMP(c->name, name) != 0)) { @@ -387,31 +354,24 @@ Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, ADDRESS nam void Modules_Free (CHAR *name, ADDRESS name__len, BOOLEAN all) { - Modules_Module m = NIL, p = NIL; + Heap_Module m = NIL, p = NIL; + INT32 refcount; __DUP(name, name__len, CHAR); m = Modules_modules(); if (all) { Modules_res = 1; __MOVE("unloading \"all\" not yet supported", Modules_resMsg, 34); } else { - while ((m != NIL && __STRCMP(m->name, name) != 0)) { - p = m; - m = m->next; - } - if ((m != NIL && m->refcnt == 0)) { - if (m == Modules_modules()) { - Modules_setmodules(m->next); - } else { - p->next = m->next; - } + refcount = Heap_FreeModule(name, name__len); + if (refcount == 0) { Modules_res = 0; } else { - Modules_res = 1; - if (m == NIL) { + if (refcount < 0) { __MOVE("module not found", Modules_resMsg, 17); } else { __MOVE("clients of this module exist", Modules_resMsg, 29); } + Modules_res = 1; } } __DEL(name); @@ -533,8 +493,6 @@ void Modules_AssertFail (INT32 code) } } -__TDESC(Modules_ModuleDesc, 1, 2) = {__TDFLDS("ModuleDesc", 64), {0, 32, -24}}; -__TDESC(Modules_CmdDesc, 1, 1) = {__TDFLDS("CmdDesc", 40), {0, -16}}; export void *Modules__init(void) { @@ -542,8 +500,6 @@ export void *Modules__init(void) __MODULE_IMPORT(Heap); __MODULE_IMPORT(Platform); __REGMOD("Modules", 0); - __INITYP(Modules_ModuleDesc, Modules_ModuleDesc, 0); - __INITYP(Modules_CmdDesc, Modules_CmdDesc, 0); /* BEGIN */ Modules_FindBinaryDir((void*)Modules_BinaryDir, 1024); __ENDMOD; diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index 3ee70401..e5803d29 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,51 +1,20 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h #include "SYSTEM.h" - -typedef - struct Modules_CmdDesc *Modules_Cmd; - -typedef - void (*Modules_Command)(void); - -typedef - struct Modules_CmdDesc { - Modules_Cmd next; - CHAR name[24]; - Modules_Command cmd; - } Modules_CmdDesc; - -typedef - struct Modules_ModuleDesc *Modules_Module; - -typedef - CHAR Modules_ModuleName[20]; - -typedef - struct Modules_ModuleDesc { - Modules_Module next; - Modules_ModuleName name; - INT32 refcnt; - Modules_Cmd cmds; - INT32 types; - void (*enumPtrs)(void(*)(INT32)); - char _prvt0[8]; - } Modules_ModuleDesc; +#include "Heap.h" import INT16 Modules_res; import CHAR Modules_resMsg[256]; -import Modules_ModuleName Modules_imported, Modules_importing; +import Heap_ModuleName Modules_imported, Modules_importing; import INT64 Modules_MainStackFrame; import INT16 Modules_ArgCount; import INT64 Modules_ArgVector; import CHAR Modules_BinaryDir[1024]; -import ADDRESS *Modules_ModuleDesc__typ; -import ADDRESS *Modules_CmdDesc__typ; import INT16 Modules_ArgPos (CHAR *s, ADDRESS s__len); import void Modules_AssertFail (INT32 code); @@ -54,8 +23,8 @@ import void Modules_GetArg (INT16 n, CHAR *val, ADDRESS val__len); import void Modules_GetIntArg (INT16 n, INT32 *val); import void Modules_Halt (INT32 code); import void Modules_Init (INT32 argc, INT64 argvadr); -import Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, ADDRESS name__len); -import Modules_Module Modules_ThisMod (CHAR *name, ADDRESS name__len); +import Heap_Command Modules_ThisCommand (Heap_Module mod, CHAR *name, ADDRESS name__len); +import Heap_Module Modules_ThisMod (CHAR *name, ADDRESS name__len); import void *Modules__init(void); diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index d83386eb..7e558357 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index feb85d73..b6d457bd 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index ab01642c..c09d2e6a 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index f742f265..7c47ed18 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 1335c494..e3e6f1fe 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index 621dfb51..6d2755d8 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index 3f9dfde3..dc87be62 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index c1fe21fb..c13a4e91 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index 4569c80d..ed3ea3a1 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index c0707c34..6dae098c 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index 07f8f535..25e2e7c2 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 6b2b0929..00094b66 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 4506267a..c88953f2 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index d363f022..f83e65fb 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Out.c b/bootstrap/unix-88/Out.c index d4d8e5f4..3129c109 100644 --- a/bootstrap/unix-88/Out.c +++ b/bootstrap/unix-88/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -6,6 +6,7 @@ #define SET UINT32 #include "SYSTEM.h" +#include "Heap.h" #include "Platform.h" @@ -13,8 +14,11 @@ export BOOLEAN Out_IsConsole; static CHAR Out_buf[128]; static INT16 Out_in; +static ADDRESS *typedesc__5__typ; export void Out_Char (CHAR ch); +static void Out_DumpModule (Heap_Module m); +export void Out_DumpType (SYSTEM_BYTE *o, ADDRESS o__len); export void Out_Flush (void); export void Out_Hex (INT64 x, INT64 n); export void Out_HexDump (SYSTEM_BYTE *m, ADDRESS m__len); @@ -203,6 +207,94 @@ void Out_HexDump (SYSTEM_BYTE *m, ADDRESS m__len) Out_HexDumpAdr((ADDRESS)m, 0, m__len); } +static void Out_DumpModule (Heap_Module m) +{ + Out_String((CHAR*)" next: ", 13); + Out_Hex((INT64)(ADDRESS)m->next, 1); + Out_Ln(); + Out_String((CHAR*)" name: ", 13); + Out_String(m->name, 20); + Out_Ln(); + Out_String((CHAR*)" refcnt: ", 13); + Out_Hex(m->refcnt, 1); + Out_Ln(); + Out_String((CHAR*)" cmds: ", 13); + Out_Hex((INT64)(ADDRESS)m->cmds, 1); + Out_Ln(); + Out_String((CHAR*)" types: ", 13); + Out_Hex(m->types, 1); + Out_Ln(); + Out_String((CHAR*)" enumPtrs: ", 13); + Out_Hex((INT64)(ADDRESS)m->enumPtrs, 1); + Out_Ln(); +} + +typedef + struct typedesc__5 *tag__4; + +typedef + struct typedesc__5 { + INT64 tag, next, level, module; + CHAR name[24]; + INT64 bases[16]; + INT64 reserved, blksz, ptr0; + } typedesc__5; + +void Out_DumpType (SYSTEM_BYTE *o, ADDRESS o__len) +{ + INT64 addr; + tag__4 desc = NIL; + INT16 i; + __GET((ADDRESS)o - 8, addr, INT64); + Out_String((CHAR*)"obj tag: ", 11); + Out_Hex(addr, 1); + Out_Ln(); + desc = (tag__4)(ADDRESS)(addr - 192); + Out_String((CHAR*)"desc at: ", 11); + Out_Hex((INT64)(ADDRESS)desc, 1); + Out_Ln(); + Out_String((CHAR*)"desc contains:", 15); + Out_Ln(); + Out_String((CHAR*)"tag: ", 11); + Out_Hex(desc->tag, 1); + Out_Ln(); + Out_String((CHAR*)"next: ", 11); + Out_Hex(desc->next, 1); + Out_Ln(); + Out_String((CHAR*)"level: ", 11); + Out_Hex(desc->level, 1); + Out_Ln(); + Out_String((CHAR*)"module: ", 11); + Out_Hex(desc->module, 1); + Out_Ln(); + Out_DumpModule((Heap_Module)(ADDRESS)desc->module); + Out_String((CHAR*)"name: ", 11); + Out_String(desc->name, 24); + Out_Ln(); + Out_String((CHAR*)"bases: ", 11); + i = 0; + while (i < 16) { + Out_Hex(desc->bases[__X(i, 16)], 16); + if (__MASK(i, -4) == 3) { + Out_Ln(); + Out_String((CHAR*)" ", 11); + } else { + Out_Char(' '); + } + i += 1; + } + Out_Ln(); + Out_String((CHAR*)"reserved: ", 11); + Out_Hex(desc->reserved, 1); + Out_Ln(); + Out_String((CHAR*)"blksz: ", 11); + Out_Hex(desc->blksz, 1); + Out_Ln(); + Out_String((CHAR*)"ptr0: ", 11); + Out_Hex(desc->ptr0, 1); + Out_Ln(); +} + static void Out_digit (INT64 n, CHAR *s, ADDRESS s__len, INT16 *i) { *i -= 1; @@ -380,15 +472,18 @@ void Out_LongReal (LONGREAL x, INT16 n) Out_RealP(x, n, 1); } +__TDESC(typedesc__5, 1, 0) = {__TDFLDS("typedesc__5", 208), {-8}}; export void *Out__init(void) { __DEFMOD; + __MODULE_IMPORT(Heap); __MODULE_IMPORT(Platform); __REGMOD("Out", 0); __REGCMD("Flush", Out_Flush); __REGCMD("Ln", Out_Ln); __REGCMD("Open", Out_Open); + __INITYP(typedesc__5, typedesc__5, 0); /* BEGIN */ Out_IsConsole = Platform_IsConsole(1); Out_in = 0; diff --git a/bootstrap/unix-88/Out.h b/bootstrap/unix-88/Out.h index 24829244..0126ef62 100644 --- a/bootstrap/unix-88/Out.h +++ b/bootstrap/unix-88/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h @@ -10,6 +10,7 @@ import BOOLEAN Out_IsConsole; import void Out_Char (CHAR ch); +import void Out_DumpType (SYSTEM_BYTE *o, ADDRESS o__len); import void Out_Flush (void); import void Out_Hex (INT64 x, INT64 n); import void Out_HexDump (SYSTEM_BYTE *m, ADDRESS m__len); diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 51a8fde7..d695bda2 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index 56fab736..741cf3f7 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index f5ee1490..0a2d220b 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index 6d0ec38b..0c564f0e 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index 4ee2fc23..ed806db0 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index ae281477..93b62826 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index 9887162e..bd19d27b 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -390,6 +390,7 @@ void Texts_DumpReader (Texts_Reader re) Texts_DumpRun(re.run); } } + Out_DumpType((void*)&*re.run, 40); } static Texts_FontsFont Texts_FontsThis (CHAR *name, ADDRESS name__len) @@ -1566,8 +1567,8 @@ static void LoadElem__22 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span static void LoadElem__22 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e) { - Modules_Module M = NIL; - Modules_Command Cmd; + Heap_Module M = NIL; + Heap_Command Cmd; Texts_Alien a = NIL; INT32 org, ew, eh; INT8 eno; diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index e14afb26..2cf87339 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/VT100.c b/bootstrap/unix-88/VT100.c index 9ab993c9..ed38e4dc 100644 --- a/bootstrap/unix-88/VT100.c +++ b/bootstrap/unix-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/VT100.h b/bootstrap/unix-88/VT100.h index 3de3605c..69601701 100644 --- a/bootstrap/unix-88/VT100.h +++ b/bootstrap/unix-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index 213abf27..0b3a981e 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index 4278a34c..36571c99 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/Compiler.c b/bootstrap/windows-48/Compiler.c index ffd8b03e..65da2216 100644 --- a/bootstrap/windows-48/Compiler.c +++ b/bootstrap/windows-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index 6db13d09..77782293 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index 4259cfef..438fec28 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 2b8c7919..b4133ede 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index dfeeebb3..7aaa4f5a 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index 125a2854..c9adb169 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -84,6 +84,7 @@ static void Heap_CheckFin (void); static void Heap_ExtendHeap (INT32 blksz); export void Heap_FINALL (void); static void Heap_Finalize (void); +export INT32 Heap_FreeModule (CHAR *name, ADDRESS name__len); export void Heap_GC (BOOLEAN markStack); static void Heap_HeapSort (INT32 n, INT32 *a, ADDRESS a__len); export void Heap_INCREF (Heap_Module m); @@ -143,6 +144,35 @@ SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) return (void*)m; } +INT32 Heap_FreeModule (CHAR *name, ADDRESS name__len) +{ + Heap_Module m, p; + __DUP(name, name__len, CHAR); + m = (Heap_Module)(ADDRESS)Heap_modules; + while ((m != NIL && __STRCMP(m->name, name) != 0)) { + p = m; + m = m->next; + } + if ((m != NIL && m->refcnt == 0)) { + if (m == (Heap_Module)(ADDRESS)Heap_modules) { + Heap_modules = (SYSTEM_PTR)m->next; + } else { + p->next = m->next; + } + __DEL(name); + return 0; + } else { + if (m == NIL) { + __DEL(name); + return -1; + } else { + __DEL(name); + return m->refcnt; + } + } + __RETCHK; +} + void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) { Heap_Cmd c; diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index e794a4a3..0df71d54 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,16 +1,26 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h #include "SYSTEM.h" +typedef + struct Heap_CmdDesc *Heap_Cmd; + typedef CHAR Heap_CmdName[24]; typedef void (*Heap_Command)(void); +typedef + struct Heap_CmdDesc { + Heap_Cmd next; + Heap_CmdName name; + Heap_Command cmd; + } Heap_CmdDesc; + typedef void (*Heap_EnumProc)(void(*)(SYSTEM_PTR)); @@ -21,13 +31,18 @@ typedef struct Heap_ModuleDesc *Heap_Module; typedef - struct Heap_ModuleDesc { - INT32 _prvt0; - char _prvt1[44]; - } Heap_ModuleDesc; + CHAR Heap_ModuleName[20]; typedef - CHAR Heap_ModuleName[20]; + struct Heap_ModuleDesc { + Heap_Module next; + Heap_ModuleName name; + INT32 refcnt; + Heap_Cmd cmds; + INT32 types; + Heap_EnumProc enumPtrs; + char _prvt0[8]; + } Heap_ModuleDesc; import SYSTEM_PTR Heap_modules; @@ -35,8 +50,10 @@ import INT32 Heap_allocated, Heap_heapsize; import INT16 Heap_FileCount; import ADDRESS *Heap_ModuleDesc__typ; +import ADDRESS *Heap_CmdDesc__typ; import void Heap_FINALL (void); +import INT32 Heap_FreeModule (CHAR *name, ADDRESS name__len); import void Heap_GC (BOOLEAN markStack); import void Heap_INCREF (Heap_Module m); import void Heap_InitHeap (void); diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index ab668fec..6d8570ec 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -9,47 +9,15 @@ #include "Heap.h" #include "Platform.h" -typedef - struct Modules_CmdDesc *Modules_Cmd; - -typedef - void (*Modules_Command)(void); - -typedef - struct Modules_CmdDesc { - Modules_Cmd next; - CHAR name[24]; - Modules_Command cmd; - } Modules_CmdDesc; - -typedef - struct Modules_ModuleDesc *Modules_Module; - -typedef - CHAR Modules_ModuleName[20]; - -typedef - struct Modules_ModuleDesc { - Modules_Module next; - Modules_ModuleName name; - INT32 refcnt; - Modules_Cmd cmds; - INT32 types; - void (*enumPtrs)(void(*)(INT32)); - INT32 reserved1, reserved2; - } Modules_ModuleDesc; - export INT16 Modules_res; export CHAR Modules_resMsg[256]; -export Modules_ModuleName Modules_imported, Modules_importing; +export Heap_ModuleName Modules_imported, Modules_importing; export INT32 Modules_MainStackFrame; export INT16 Modules_ArgCount; export INT32 Modules_ArgVector; export CHAR Modules_BinaryDir[1024]; -export ADDRESS *Modules_ModuleDesc__typ; -export ADDRESS *Modules_CmdDesc__typ; static void Modules_Append (CHAR *s, ADDRESS s__len, CHAR *d, ADDRESS d__len); static void Modules_AppendPart (CHAR c, CHAR *s, ADDRESS s__len, CHAR *d, ADDRESS d__len); @@ -68,8 +36,8 @@ export void Modules_Init (INT32 argc, INT32 argvadr); static BOOLEAN Modules_IsAbsolute (CHAR *d, ADDRESS d__len); static BOOLEAN Modules_IsFilePresent (CHAR *s, ADDRESS s__len); static BOOLEAN Modules_IsOneOf (CHAR c, CHAR *s, ADDRESS s__len); -export Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, ADDRESS name__len); -export Modules_Module Modules_ThisMod (CHAR *name, ADDRESS name__len); +export Heap_Command Modules_ThisCommand (Heap_Module mod, CHAR *name, ADDRESS name__len); +export Heap_Module Modules_ThisMod (CHAR *name, ADDRESS name__len); static void Modules_Trim (CHAR *s, ADDRESS s__len, CHAR *d, ADDRESS d__len); static void Modules_errch (CHAR c); static void Modules_errint (INT32 l); @@ -79,8 +47,7 @@ extern void Heap_InitHeap(); extern void *Modules__init(void); #define Modules_InitHeap() Heap_InitHeap() #define Modules_ModulesInit() Modules__init() -#define Modules_modules() (Modules_Module)Heap_modules -#define Modules_setmodules(m) Heap_modules = m +#define Modules_modules() (Heap_Module)Heap_modules void Modules_Init (INT32 argc, INT32 argvadr) { @@ -334,11 +301,11 @@ static void Modules_FindBinaryDir (CHAR *binarydir, ADDRESS binarydir__len) } } -Modules_Module Modules_ThisMod (CHAR *name, ADDRESS name__len) +Heap_Module Modules_ThisMod (CHAR *name, ADDRESS name__len) { - Modules_Module m = NIL; + Heap_Module m = NIL; CHAR bodyname[64]; - Modules_Command body; + Heap_Command body; __DUP(name, name__len, CHAR); m = Modules_modules(); while ((m != NIL && __STRCMP(m->name, name) != 0)) { @@ -358,9 +325,9 @@ Modules_Module Modules_ThisMod (CHAR *name, ADDRESS name__len) return m; } -Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, ADDRESS name__len) +Heap_Command Modules_ThisCommand (Heap_Module mod, CHAR *name, ADDRESS name__len) { - Modules_Cmd c = NIL; + Heap_Cmd c = NIL; __DUP(name, name__len, CHAR); c = mod->cmds; while ((c != NIL && __STRCMP(c->name, name) != 0)) { @@ -387,31 +354,24 @@ Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, ADDRESS nam void Modules_Free (CHAR *name, ADDRESS name__len, BOOLEAN all) { - Modules_Module m = NIL, p = NIL; + Heap_Module m = NIL, p = NIL; + INT32 refcount; __DUP(name, name__len, CHAR); m = Modules_modules(); if (all) { Modules_res = 1; __MOVE("unloading \"all\" not yet supported", Modules_resMsg, 34); } else { - while ((m != NIL && __STRCMP(m->name, name) != 0)) { - p = m; - m = m->next; - } - if ((m != NIL && m->refcnt == 0)) { - if (m == Modules_modules()) { - Modules_setmodules(m->next); - } else { - p->next = m->next; - } + refcount = Heap_FreeModule(name, name__len); + if (refcount == 0) { Modules_res = 0; } else { - Modules_res = 1; - if (m == NIL) { + if (refcount < 0) { __MOVE("module not found", Modules_resMsg, 17); } else { __MOVE("clients of this module exist", Modules_resMsg, 29); } + Modules_res = 1; } } __DEL(name); @@ -533,8 +493,6 @@ void Modules_AssertFail (INT32 code) } } -__TDESC(Modules_ModuleDesc, 1, 2) = {__TDFLDS("ModuleDesc", 48), {0, 28, -12}}; -__TDESC(Modules_CmdDesc, 1, 1) = {__TDFLDS("CmdDesc", 32), {0, -8}}; export void *Modules__init(void) { @@ -542,8 +500,6 @@ export void *Modules__init(void) __MODULE_IMPORT(Heap); __MODULE_IMPORT(Platform); __REGMOD("Modules", 0); - __INITYP(Modules_ModuleDesc, Modules_ModuleDesc, 0); - __INITYP(Modules_CmdDesc, Modules_CmdDesc, 0); /* BEGIN */ Modules_FindBinaryDir((void*)Modules_BinaryDir, 1024); __ENDMOD; diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index 553f80ed..3c1c580d 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,51 +1,20 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h #include "SYSTEM.h" - -typedef - struct Modules_CmdDesc *Modules_Cmd; - -typedef - void (*Modules_Command)(void); - -typedef - struct Modules_CmdDesc { - Modules_Cmd next; - CHAR name[24]; - Modules_Command cmd; - } Modules_CmdDesc; - -typedef - struct Modules_ModuleDesc *Modules_Module; - -typedef - CHAR Modules_ModuleName[20]; - -typedef - struct Modules_ModuleDesc { - Modules_Module next; - Modules_ModuleName name; - INT32 refcnt; - Modules_Cmd cmds; - INT32 types; - void (*enumPtrs)(void(*)(INT32)); - char _prvt0[8]; - } Modules_ModuleDesc; +#include "Heap.h" import INT16 Modules_res; import CHAR Modules_resMsg[256]; -import Modules_ModuleName Modules_imported, Modules_importing; +import Heap_ModuleName Modules_imported, Modules_importing; import INT32 Modules_MainStackFrame; import INT16 Modules_ArgCount; import INT32 Modules_ArgVector; import CHAR Modules_BinaryDir[1024]; -import ADDRESS *Modules_ModuleDesc__typ; -import ADDRESS *Modules_CmdDesc__typ; import INT16 Modules_ArgPos (CHAR *s, ADDRESS s__len); import void Modules_AssertFail (INT32 code); @@ -54,8 +23,8 @@ import void Modules_GetArg (INT16 n, CHAR *val, ADDRESS val__len); import void Modules_GetIntArg (INT16 n, INT32 *val); import void Modules_Halt (INT32 code); import void Modules_Init (INT32 argc, INT32 argvadr); -import Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, ADDRESS name__len); -import Modules_Module Modules_ThisMod (CHAR *name, ADDRESS name__len); +import Heap_Command Modules_ThisCommand (Heap_Module mod, CHAR *name, ADDRESS name__len); +import Heap_Module Modules_ThisMod (CHAR *name, ADDRESS name__len); import void *Modules__init(void); diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index d83386eb..7e558357 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index feb85d73..b6d457bd 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index ab01642c..c09d2e6a 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index f742f265..7c47ed18 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index a6c7a5cd..a3718f79 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index 621dfb51..6d2755d8 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index 383b6d65..5924f42f 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index c1fe21fb..c13a4e91 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index 4569c80d..ed3ea3a1 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index c0707c34..6dae098c 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 0d32553a..6b6144fc 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index 6b2b0929..00094b66 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index 42081077..7e829aa2 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index d363f022..f83e65fb 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Out.c b/bootstrap/windows-48/Out.c index 7e1c7459..21e029bd 100644 --- a/bootstrap/windows-48/Out.c +++ b/bootstrap/windows-48/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -6,6 +6,7 @@ #define SET UINT32 #include "SYSTEM.h" +#include "Heap.h" #include "Platform.h" @@ -13,8 +14,11 @@ export BOOLEAN Out_IsConsole; static CHAR Out_buf[128]; static INT16 Out_in; +static ADDRESS *typedesc__5__typ; export void Out_Char (CHAR ch); +static void Out_DumpModule (Heap_Module m); +export void Out_DumpType (SYSTEM_BYTE *o, ADDRESS o__len); export void Out_Flush (void); export void Out_Hex (INT64 x, INT64 n); export void Out_HexDump (SYSTEM_BYTE *m, ADDRESS m__len); @@ -203,6 +207,94 @@ void Out_HexDump (SYSTEM_BYTE *m, ADDRESS m__len) Out_HexDumpAdr((ADDRESS)m, 0, m__len); } +static void Out_DumpModule (Heap_Module m) +{ + Out_String((CHAR*)" next: ", 13); + Out_Hex((INT32)(ADDRESS)m->next, 1); + Out_Ln(); + Out_String((CHAR*)" name: ", 13); + Out_String(m->name, 20); + Out_Ln(); + Out_String((CHAR*)" refcnt: ", 13); + Out_Hex(m->refcnt, 1); + Out_Ln(); + Out_String((CHAR*)" cmds: ", 13); + Out_Hex((INT32)(ADDRESS)m->cmds, 1); + Out_Ln(); + Out_String((CHAR*)" types: ", 13); + Out_Hex(m->types, 1); + Out_Ln(); + Out_String((CHAR*)" enumPtrs: ", 13); + Out_Hex((INT32)(ADDRESS)m->enumPtrs, 1); + Out_Ln(); +} + +typedef + struct typedesc__5 *tag__4; + +typedef + struct typedesc__5 { + INT32 tag, next, level, module; + CHAR name[24]; + INT32 bases[16]; + INT32 reserved, blksz, ptr0; + } typedesc__5; + +void Out_DumpType (SYSTEM_BYTE *o, ADDRESS o__len) +{ + INT32 addr; + tag__4 desc = NIL; + INT16 i; + __GET((ADDRESS)o - 4, addr, INT32); + Out_String((CHAR*)"obj tag: ", 11); + Out_Hex(addr, 1); + Out_Ln(); + desc = (tag__4)(ADDRESS)(addr - 108); + Out_String((CHAR*)"desc at: ", 11); + Out_Hex((INT32)(ADDRESS)desc, 1); + Out_Ln(); + Out_String((CHAR*)"desc contains:", 15); + Out_Ln(); + Out_String((CHAR*)"tag: ", 11); + Out_Hex(desc->tag, 1); + Out_Ln(); + Out_String((CHAR*)"next: ", 11); + Out_Hex(desc->next, 1); + Out_Ln(); + Out_String((CHAR*)"level: ", 11); + Out_Hex(desc->level, 1); + Out_Ln(); + Out_String((CHAR*)"module: ", 11); + Out_Hex(desc->module, 1); + Out_Ln(); + Out_DumpModule((Heap_Module)(ADDRESS)desc->module); + Out_String((CHAR*)"name: ", 11); + Out_String(desc->name, 24); + Out_Ln(); + Out_String((CHAR*)"bases: ", 11); + i = 0; + while (i < 16) { + Out_Hex(desc->bases[__X(i, 16)], 8); + if (__MASK(i, -4) == 3) { + Out_Ln(); + Out_String((CHAR*)" ", 11); + } else { + Out_Char(' '); + } + i += 1; + } + Out_Ln(); + Out_String((CHAR*)"reserved: ", 11); + Out_Hex(desc->reserved, 1); + Out_Ln(); + Out_String((CHAR*)"blksz: ", 11); + Out_Hex(desc->blksz, 1); + Out_Ln(); + Out_String((CHAR*)"ptr0: ", 11); + Out_Hex(desc->ptr0, 1); + Out_Ln(); +} + static void Out_digit (INT64 n, CHAR *s, ADDRESS s__len, INT16 *i) { *i -= 1; @@ -380,15 +472,18 @@ void Out_LongReal (LONGREAL x, INT16 n) Out_RealP(x, n, 1); } +__TDESC(typedesc__5, 1, 0) = {__TDFLDS("typedesc__5", 116), {-4}}; export void *Out__init(void) { __DEFMOD; + __MODULE_IMPORT(Heap); __MODULE_IMPORT(Platform); __REGMOD("Out", 0); __REGCMD("Flush", Out_Flush); __REGCMD("Ln", Out_Ln); __REGCMD("Open", Out_Open); + __INITYP(typedesc__5, typedesc__5, 0); /* BEGIN */ Out_IsConsole = Platform_IsConsole(Platform_StdOut); Out_in = 0; diff --git a/bootstrap/windows-48/Out.h b/bootstrap/windows-48/Out.h index 1db1f1b3..0b3a93df 100644 --- a/bootstrap/windows-48/Out.h +++ b/bootstrap/windows-48/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h @@ -10,6 +10,7 @@ import BOOLEAN Out_IsConsole; import void Out_Char (CHAR ch); +import void Out_DumpType (SYSTEM_BYTE *o, ADDRESS o__len); import void Out_Flush (void); import void Out_Hex (INT64 x, INT64 n); import void Out_HexDump (SYSTEM_BYTE *m, ADDRESS m__len); diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 43a2c695..661a3ff4 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index ddc997ca..68347c6c 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index f5ee1490..0a2d220b 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index 6d0ec38b..0c564f0e 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index 4ee2fc23..ed806db0 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index ae281477..93b62826 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index 4825ab70..a91fe173 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -390,6 +390,7 @@ void Texts_DumpReader (Texts_Reader re) Texts_DumpRun(re.run); } } + Out_DumpType((void*)&*re.run, 20); } static Texts_FontsFont Texts_FontsThis (CHAR *name, ADDRESS name__len) @@ -1566,8 +1567,8 @@ static void LoadElem__22 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span static void LoadElem__22 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e) { - Modules_Module M = NIL; - Modules_Command Cmd; + Heap_Module M = NIL; + Heap_Command Cmd; Texts_Alien a = NIL; INT32 org, ew, eh; INT8 eno; diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index c7c8d20f..24dacf51 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/VT100.c b/bootstrap/windows-48/VT100.c index 9ab993c9..ed38e4dc 100644 --- a/bootstrap/windows-48/VT100.c +++ b/bootstrap/windows-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/VT100.h b/bootstrap/windows-48/VT100.h index 3de3605c..69601701 100644 --- a/bootstrap/windows-48/VT100.h +++ b/bootstrap/windows-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index 213abf27..0b3a981e 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index 4278a34c..36571c99 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/Compiler.c b/bootstrap/windows-88/Compiler.c index ffd8b03e..65da2216 100644 --- a/bootstrap/windows-88/Compiler.c +++ b/bootstrap/windows-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index 6db13d09..77782293 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index 4259cfef..438fec28 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index fc649cf8..1c505c07 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 49df83be..337b30b5 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index 4554feac..3e929c3a 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -84,6 +84,7 @@ static void Heap_CheckFin (void); static void Heap_ExtendHeap (INT64 blksz); export void Heap_FINALL (void); static void Heap_Finalize (void); +export INT32 Heap_FreeModule (CHAR *name, ADDRESS name__len); export void Heap_GC (BOOLEAN markStack); static void Heap_HeapSort (INT64 n, INT64 *a, ADDRESS a__len); export void Heap_INCREF (Heap_Module m); @@ -143,6 +144,35 @@ SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) return (void*)m; } +INT32 Heap_FreeModule (CHAR *name, ADDRESS name__len) +{ + Heap_Module m, p; + __DUP(name, name__len, CHAR); + m = (Heap_Module)(ADDRESS)Heap_modules; + while ((m != NIL && __STRCMP(m->name, name) != 0)) { + p = m; + m = m->next; + } + if ((m != NIL && m->refcnt == 0)) { + if (m == (Heap_Module)(ADDRESS)Heap_modules) { + Heap_modules = (SYSTEM_PTR)m->next; + } else { + p->next = m->next; + } + __DEL(name); + return 0; + } else { + if (m == NIL) { + __DEL(name); + return -1; + } else { + __DEL(name); + return m->refcnt; + } + } + __RETCHK; +} + void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) { Heap_Cmd c; diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index 0fb80f05..b2018428 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,16 +1,26 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h #include "SYSTEM.h" +typedef + struct Heap_CmdDesc *Heap_Cmd; + typedef CHAR Heap_CmdName[24]; typedef void (*Heap_Command)(void); +typedef + struct Heap_CmdDesc { + Heap_Cmd next; + Heap_CmdName name; + Heap_Command cmd; + } Heap_CmdDesc; + typedef void (*Heap_EnumProc)(void(*)(SYSTEM_PTR)); @@ -21,13 +31,18 @@ typedef struct Heap_ModuleDesc *Heap_Module; typedef - struct Heap_ModuleDesc { - INT64 _prvt0; - char _prvt1[56]; - } Heap_ModuleDesc; + CHAR Heap_ModuleName[20]; typedef - CHAR Heap_ModuleName[20]; + struct Heap_ModuleDesc { + Heap_Module next; + Heap_ModuleName name; + INT32 refcnt; + Heap_Cmd cmds; + INT64 types; + Heap_EnumProc enumPtrs; + char _prvt0[8]; + } Heap_ModuleDesc; import SYSTEM_PTR Heap_modules; @@ -35,8 +50,10 @@ import INT64 Heap_allocated, Heap_heapsize; import INT16 Heap_FileCount; import ADDRESS *Heap_ModuleDesc__typ; +import ADDRESS *Heap_CmdDesc__typ; import void Heap_FINALL (void); +import INT32 Heap_FreeModule (CHAR *name, ADDRESS name__len); import void Heap_GC (BOOLEAN markStack); import void Heap_INCREF (Heap_Module m); import void Heap_InitHeap (void); diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 37cfa0cd..6e92bf1e 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -9,47 +9,15 @@ #include "Heap.h" #include "Platform.h" -typedef - struct Modules_CmdDesc *Modules_Cmd; - -typedef - void (*Modules_Command)(void); - -typedef - struct Modules_CmdDesc { - Modules_Cmd next; - CHAR name[24]; - Modules_Command cmd; - } Modules_CmdDesc; - -typedef - struct Modules_ModuleDesc *Modules_Module; - -typedef - CHAR Modules_ModuleName[20]; - -typedef - struct Modules_ModuleDesc { - Modules_Module next; - Modules_ModuleName name; - INT32 refcnt; - Modules_Cmd cmds; - INT32 types; - void (*enumPtrs)(void(*)(INT32)); - INT32 reserved1, reserved2; - } Modules_ModuleDesc; - export INT16 Modules_res; export CHAR Modules_resMsg[256]; -export Modules_ModuleName Modules_imported, Modules_importing; +export Heap_ModuleName Modules_imported, Modules_importing; export INT64 Modules_MainStackFrame; export INT16 Modules_ArgCount; export INT64 Modules_ArgVector; export CHAR Modules_BinaryDir[1024]; -export ADDRESS *Modules_ModuleDesc__typ; -export ADDRESS *Modules_CmdDesc__typ; static void Modules_Append (CHAR *s, ADDRESS s__len, CHAR *d, ADDRESS d__len); static void Modules_AppendPart (CHAR c, CHAR *s, ADDRESS s__len, CHAR *d, ADDRESS d__len); @@ -68,8 +36,8 @@ export void Modules_Init (INT32 argc, INT64 argvadr); static BOOLEAN Modules_IsAbsolute (CHAR *d, ADDRESS d__len); static BOOLEAN Modules_IsFilePresent (CHAR *s, ADDRESS s__len); static BOOLEAN Modules_IsOneOf (CHAR c, CHAR *s, ADDRESS s__len); -export Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, ADDRESS name__len); -export Modules_Module Modules_ThisMod (CHAR *name, ADDRESS name__len); +export Heap_Command Modules_ThisCommand (Heap_Module mod, CHAR *name, ADDRESS name__len); +export Heap_Module Modules_ThisMod (CHAR *name, ADDRESS name__len); static void Modules_Trim (CHAR *s, ADDRESS s__len, CHAR *d, ADDRESS d__len); static void Modules_errch (CHAR c); static void Modules_errint (INT32 l); @@ -79,8 +47,7 @@ extern void Heap_InitHeap(); extern void *Modules__init(void); #define Modules_InitHeap() Heap_InitHeap() #define Modules_ModulesInit() Modules__init() -#define Modules_modules() (Modules_Module)Heap_modules -#define Modules_setmodules(m) Heap_modules = m +#define Modules_modules() (Heap_Module)Heap_modules void Modules_Init (INT32 argc, INT64 argvadr) { @@ -334,11 +301,11 @@ static void Modules_FindBinaryDir (CHAR *binarydir, ADDRESS binarydir__len) } } -Modules_Module Modules_ThisMod (CHAR *name, ADDRESS name__len) +Heap_Module Modules_ThisMod (CHAR *name, ADDRESS name__len) { - Modules_Module m = NIL; + Heap_Module m = NIL; CHAR bodyname[64]; - Modules_Command body; + Heap_Command body; __DUP(name, name__len, CHAR); m = Modules_modules(); while ((m != NIL && __STRCMP(m->name, name) != 0)) { @@ -358,9 +325,9 @@ Modules_Module Modules_ThisMod (CHAR *name, ADDRESS name__len) return m; } -Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, ADDRESS name__len) +Heap_Command Modules_ThisCommand (Heap_Module mod, CHAR *name, ADDRESS name__len) { - Modules_Cmd c = NIL; + Heap_Cmd c = NIL; __DUP(name, name__len, CHAR); c = mod->cmds; while ((c != NIL && __STRCMP(c->name, name) != 0)) { @@ -387,31 +354,24 @@ Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, ADDRESS nam void Modules_Free (CHAR *name, ADDRESS name__len, BOOLEAN all) { - Modules_Module m = NIL, p = NIL; + Heap_Module m = NIL, p = NIL; + INT32 refcount; __DUP(name, name__len, CHAR); m = Modules_modules(); if (all) { Modules_res = 1; __MOVE("unloading \"all\" not yet supported", Modules_resMsg, 34); } else { - while ((m != NIL && __STRCMP(m->name, name) != 0)) { - p = m; - m = m->next; - } - if ((m != NIL && m->refcnt == 0)) { - if (m == Modules_modules()) { - Modules_setmodules(m->next); - } else { - p->next = m->next; - } + refcount = Heap_FreeModule(name, name__len); + if (refcount == 0) { Modules_res = 0; } else { - Modules_res = 1; - if (m == NIL) { + if (refcount < 0) { __MOVE("module not found", Modules_resMsg, 17); } else { __MOVE("clients of this module exist", Modules_resMsg, 29); } + Modules_res = 1; } } __DEL(name); @@ -533,8 +493,6 @@ void Modules_AssertFail (INT32 code) } } -__TDESC(Modules_ModuleDesc, 1, 2) = {__TDFLDS("ModuleDesc", 64), {0, 32, -24}}; -__TDESC(Modules_CmdDesc, 1, 1) = {__TDFLDS("CmdDesc", 40), {0, -16}}; export void *Modules__init(void) { @@ -542,8 +500,6 @@ export void *Modules__init(void) __MODULE_IMPORT(Heap); __MODULE_IMPORT(Platform); __REGMOD("Modules", 0); - __INITYP(Modules_ModuleDesc, Modules_ModuleDesc, 0); - __INITYP(Modules_CmdDesc, Modules_CmdDesc, 0); /* BEGIN */ Modules_FindBinaryDir((void*)Modules_BinaryDir, 1024); __ENDMOD; diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index 3ee70401..e5803d29 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,51 +1,20 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h #include "SYSTEM.h" - -typedef - struct Modules_CmdDesc *Modules_Cmd; - -typedef - void (*Modules_Command)(void); - -typedef - struct Modules_CmdDesc { - Modules_Cmd next; - CHAR name[24]; - Modules_Command cmd; - } Modules_CmdDesc; - -typedef - struct Modules_ModuleDesc *Modules_Module; - -typedef - CHAR Modules_ModuleName[20]; - -typedef - struct Modules_ModuleDesc { - Modules_Module next; - Modules_ModuleName name; - INT32 refcnt; - Modules_Cmd cmds; - INT32 types; - void (*enumPtrs)(void(*)(INT32)); - char _prvt0[8]; - } Modules_ModuleDesc; +#include "Heap.h" import INT16 Modules_res; import CHAR Modules_resMsg[256]; -import Modules_ModuleName Modules_imported, Modules_importing; +import Heap_ModuleName Modules_imported, Modules_importing; import INT64 Modules_MainStackFrame; import INT16 Modules_ArgCount; import INT64 Modules_ArgVector; import CHAR Modules_BinaryDir[1024]; -import ADDRESS *Modules_ModuleDesc__typ; -import ADDRESS *Modules_CmdDesc__typ; import INT16 Modules_ArgPos (CHAR *s, ADDRESS s__len); import void Modules_AssertFail (INT32 code); @@ -54,8 +23,8 @@ import void Modules_GetArg (INT16 n, CHAR *val, ADDRESS val__len); import void Modules_GetIntArg (INT16 n, INT32 *val); import void Modules_Halt (INT32 code); import void Modules_Init (INT32 argc, INT64 argvadr); -import Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, ADDRESS name__len); -import Modules_Module Modules_ThisMod (CHAR *name, ADDRESS name__len); +import Heap_Command Modules_ThisCommand (Heap_Module mod, CHAR *name, ADDRESS name__len); +import Heap_Module Modules_ThisMod (CHAR *name, ADDRESS name__len); import void *Modules__init(void); diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index d83386eb..7e558357 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index feb85d73..b6d457bd 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index ab01642c..c09d2e6a 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index f742f265..7c47ed18 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 1335c494..e3e6f1fe 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index 621dfb51..6d2755d8 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index 3f9dfde3..dc87be62 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index c1fe21fb..c13a4e91 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index 4569c80d..ed3ea3a1 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index c0707c34..6dae098c 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index 07f8f535..25e2e7c2 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 6b2b0929..00094b66 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 4506267a..c88953f2 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index d363f022..f83e65fb 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Out.c b/bootstrap/windows-88/Out.c index 66c81d4e..cbf124ca 100644 --- a/bootstrap/windows-88/Out.c +++ b/bootstrap/windows-88/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -6,6 +6,7 @@ #define SET UINT32 #include "SYSTEM.h" +#include "Heap.h" #include "Platform.h" @@ -13,8 +14,11 @@ export BOOLEAN Out_IsConsole; static CHAR Out_buf[128]; static INT16 Out_in; +static ADDRESS *typedesc__5__typ; export void Out_Char (CHAR ch); +static void Out_DumpModule (Heap_Module m); +export void Out_DumpType (SYSTEM_BYTE *o, ADDRESS o__len); export void Out_Flush (void); export void Out_Hex (INT64 x, INT64 n); export void Out_HexDump (SYSTEM_BYTE *m, ADDRESS m__len); @@ -203,6 +207,94 @@ void Out_HexDump (SYSTEM_BYTE *m, ADDRESS m__len) Out_HexDumpAdr((ADDRESS)m, 0, m__len); } +static void Out_DumpModule (Heap_Module m) +{ + Out_String((CHAR*)" next: ", 13); + Out_Hex((INT64)(ADDRESS)m->next, 1); + Out_Ln(); + Out_String((CHAR*)" name: ", 13); + Out_String(m->name, 20); + Out_Ln(); + Out_String((CHAR*)" refcnt: ", 13); + Out_Hex(m->refcnt, 1); + Out_Ln(); + Out_String((CHAR*)" cmds: ", 13); + Out_Hex((INT64)(ADDRESS)m->cmds, 1); + Out_Ln(); + Out_String((CHAR*)" types: ", 13); + Out_Hex(m->types, 1); + Out_Ln(); + Out_String((CHAR*)" enumPtrs: ", 13); + Out_Hex((INT64)(ADDRESS)m->enumPtrs, 1); + Out_Ln(); +} + +typedef + struct typedesc__5 *tag__4; + +typedef + struct typedesc__5 { + INT64 tag, next, level, module; + CHAR name[24]; + INT64 bases[16]; + INT64 reserved, blksz, ptr0; + } typedesc__5; + +void Out_DumpType (SYSTEM_BYTE *o, ADDRESS o__len) +{ + INT64 addr; + tag__4 desc = NIL; + INT16 i; + __GET((ADDRESS)o - 8, addr, INT64); + Out_String((CHAR*)"obj tag: ", 11); + Out_Hex(addr, 1); + Out_Ln(); + desc = (tag__4)(ADDRESS)(addr - 192); + Out_String((CHAR*)"desc at: ", 11); + Out_Hex((INT64)(ADDRESS)desc, 1); + Out_Ln(); + Out_String((CHAR*)"desc contains:", 15); + Out_Ln(); + Out_String((CHAR*)"tag: ", 11); + Out_Hex(desc->tag, 1); + Out_Ln(); + Out_String((CHAR*)"next: ", 11); + Out_Hex(desc->next, 1); + Out_Ln(); + Out_String((CHAR*)"level: ", 11); + Out_Hex(desc->level, 1); + Out_Ln(); + Out_String((CHAR*)"module: ", 11); + Out_Hex(desc->module, 1); + Out_Ln(); + Out_DumpModule((Heap_Module)(ADDRESS)desc->module); + Out_String((CHAR*)"name: ", 11); + Out_String(desc->name, 24); + Out_Ln(); + Out_String((CHAR*)"bases: ", 11); + i = 0; + while (i < 16) { + Out_Hex(desc->bases[__X(i, 16)], 16); + if (__MASK(i, -4) == 3) { + Out_Ln(); + Out_String((CHAR*)" ", 11); + } else { + Out_Char(' '); + } + i += 1; + } + Out_Ln(); + Out_String((CHAR*)"reserved: ", 11); + Out_Hex(desc->reserved, 1); + Out_Ln(); + Out_String((CHAR*)"blksz: ", 11); + Out_Hex(desc->blksz, 1); + Out_Ln(); + Out_String((CHAR*)"ptr0: ", 11); + Out_Hex(desc->ptr0, 1); + Out_Ln(); +} + static void Out_digit (INT64 n, CHAR *s, ADDRESS s__len, INT16 *i) { *i -= 1; @@ -380,15 +472,18 @@ void Out_LongReal (LONGREAL x, INT16 n) Out_RealP(x, n, 1); } +__TDESC(typedesc__5, 1, 0) = {__TDFLDS("typedesc__5", 208), {-8}}; export void *Out__init(void) { __DEFMOD; + __MODULE_IMPORT(Heap); __MODULE_IMPORT(Platform); __REGMOD("Out", 0); __REGCMD("Flush", Out_Flush); __REGCMD("Ln", Out_Ln); __REGCMD("Open", Out_Open); + __INITYP(typedesc__5, typedesc__5, 0); /* BEGIN */ Out_IsConsole = Platform_IsConsole(Platform_StdOut); Out_in = 0; diff --git a/bootstrap/windows-88/Out.h b/bootstrap/windows-88/Out.h index 24829244..0126ef62 100644 --- a/bootstrap/windows-88/Out.h +++ b/bootstrap/windows-88/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h @@ -10,6 +10,7 @@ import BOOLEAN Out_IsConsole; import void Out_Char (CHAR ch); +import void Out_DumpType (SYSTEM_BYTE *o, ADDRESS o__len); import void Out_Flush (void); import void Out_Hex (INT64 x, INT64 n); import void Out_HexDump (SYSTEM_BYTE *m, ADDRESS m__len); diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 44691d4d..59a4d3a4 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index 751980ad..787e2dc2 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index f5ee1490..0a2d220b 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index 6d0ec38b..0c564f0e 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index 4ee2fc23..ed806db0 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index ae281477..93b62826 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index 9887162e..bd19d27b 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -390,6 +390,7 @@ void Texts_DumpReader (Texts_Reader re) Texts_DumpRun(re.run); } } + Out_DumpType((void*)&*re.run, 40); } static Texts_FontsFont Texts_FontsThis (CHAR *name, ADDRESS name__len) @@ -1566,8 +1567,8 @@ static void LoadElem__22 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span static void LoadElem__22 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e) { - Modules_Module M = NIL; - Modules_Command Cmd; + Heap_Module M = NIL; + Heap_Command Cmd; Texts_Alien a = NIL; INT32 org, ew, eh; INT8 eno; diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index e14afb26..2cf87339 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/VT100.c b/bootstrap/windows-88/VT100.c index 9ab993c9..ed38e4dc 100644 --- a/bootstrap/windows-88/VT100.c +++ b/bootstrap/windows-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/VT100.h b/bootstrap/windows-88/VT100.h index 3de3605c..69601701 100644 --- a/bootstrap/windows-88/VT100.h +++ b/bootstrap/windows-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index 213abf27..0b3a981e 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index 4278a34c..36571c99 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h From c5561dd0e0d753df57ac3c2ba3691a498ba8db1d Mon Sep 17 00:00:00 2001 From: David Brown Date: Mon, 12 Dec 2016 20:06:00 +0000 Subject: [PATCH 422/580] Make type descriptor dump resilient to increments (mid-GC) tags. --- src/runtime/Out.Mod | 1 + 1 file changed, 1 insertion(+) diff --git a/src/runtime/Out.Mod b/src/runtime/Out.Mod index 37c928a4..9dcb6b7f 100644 --- a/src/runtime/Out.Mod +++ b/src/runtime/Out.Mod @@ -147,6 +147,7 @@ VAR BEGIN SYSTEM.GET(SYSTEM.ADR(o) - SIZE(SYSTEM.ADDRESS), addr); String("obj tag: "); Hex(addr,1); Ln; + DEC(addr, addr MOD 2); (* Work OK with incremented tags. *) desc := SYSTEM.VAL(tag, addr - (21*SIZE(SYSTEM.ADDRESS) + 24)); String("desc at: "); Hex(SYSTEM.VAL(SYSTEM.ADDRESS, desc),1); Ln; String("desc contains:"); Ln; From 13241fabba042aaa3c5b95af0e2169f1c2f35b5e Mon Sep 17 00:00:00 2001 From: David Brown Date: Mon, 12 Dec 2016 20:06:40 +0000 Subject: [PATCH 423/580] Update bootstrap C sources. --- bootstrap/unix-44/Out.c | 1 + bootstrap/unix-48/Out.c | 1 + bootstrap/unix-88/Out.c | 1 + bootstrap/windows-48/Out.c | 1 + bootstrap/windows-88/Out.c | 1 + 5 files changed, 5 insertions(+) diff --git a/bootstrap/unix-44/Out.c b/bootstrap/unix-44/Out.c index 39900621..6d72148a 100644 --- a/bootstrap/unix-44/Out.c +++ b/bootstrap/unix-44/Out.c @@ -249,6 +249,7 @@ void Out_DumpType (SYSTEM_BYTE *o, ADDRESS o__len) Out_String((CHAR*)"obj tag: ", 11); Out_Hex(addr, 1); Out_Ln(); + addr -= __MASK(addr, -2); desc = (tag__4)(ADDRESS)(addr - 108); Out_String((CHAR*)"desc at: ", 11); Out_Hex((INT32)(ADDRESS)desc, 1); diff --git a/bootstrap/unix-48/Out.c b/bootstrap/unix-48/Out.c index 39900621..6d72148a 100644 --- a/bootstrap/unix-48/Out.c +++ b/bootstrap/unix-48/Out.c @@ -249,6 +249,7 @@ void Out_DumpType (SYSTEM_BYTE *o, ADDRESS o__len) Out_String((CHAR*)"obj tag: ", 11); Out_Hex(addr, 1); Out_Ln(); + addr -= __MASK(addr, -2); desc = (tag__4)(ADDRESS)(addr - 108); Out_String((CHAR*)"desc at: ", 11); Out_Hex((INT32)(ADDRESS)desc, 1); diff --git a/bootstrap/unix-88/Out.c b/bootstrap/unix-88/Out.c index 3129c109..67eaad85 100644 --- a/bootstrap/unix-88/Out.c +++ b/bootstrap/unix-88/Out.c @@ -249,6 +249,7 @@ void Out_DumpType (SYSTEM_BYTE *o, ADDRESS o__len) Out_String((CHAR*)"obj tag: ", 11); Out_Hex(addr, 1); Out_Ln(); + addr -= __MASK(addr, -2); desc = (tag__4)(ADDRESS)(addr - 192); Out_String((CHAR*)"desc at: ", 11); Out_Hex((INT64)(ADDRESS)desc, 1); diff --git a/bootstrap/windows-48/Out.c b/bootstrap/windows-48/Out.c index 21e029bd..f792315a 100644 --- a/bootstrap/windows-48/Out.c +++ b/bootstrap/windows-48/Out.c @@ -249,6 +249,7 @@ void Out_DumpType (SYSTEM_BYTE *o, ADDRESS o__len) Out_String((CHAR*)"obj tag: ", 11); Out_Hex(addr, 1); Out_Ln(); + addr -= __MASK(addr, -2); desc = (tag__4)(ADDRESS)(addr - 108); Out_String((CHAR*)"desc at: ", 11); Out_Hex((INT32)(ADDRESS)desc, 1); diff --git a/bootstrap/windows-88/Out.c b/bootstrap/windows-88/Out.c index cbf124ca..d0afc5be 100644 --- a/bootstrap/windows-88/Out.c +++ b/bootstrap/windows-88/Out.c @@ -249,6 +249,7 @@ void Out_DumpType (SYSTEM_BYTE *o, ADDRESS o__len) Out_String((CHAR*)"obj tag: ", 11); Out_Hex(addr, 1); Out_Ln(); + addr -= __MASK(addr, -2); desc = (tag__4)(ADDRESS)(addr - 192); Out_String((CHAR*)"desc at: ", 11); Out_Hex((INT64)(ADDRESS)desc, 1); From a377c7c3bf06765a6f6ff5b2370c48975e27b8b3 Mon Sep 17 00:00:00 2001 From: David Brown Date: Tue, 13 Dec 2016 18:25:50 +0000 Subject: [PATCH 424/580] Still chasing OpenBSD issue. Add heap dump. Looks like a GC fault. --- src/compiler/OPM.Mod | 2 + src/runtime/Heap.Mod | 2 +- src/runtime/Out.Mod | 112 ++++++++++++++++++++++++++++++++++--------- 3 files changed, 92 insertions(+), 24 deletions(-) diff --git a/src/compiler/OPM.Mod b/src/compiler/OPM.Mod index 7ccf49c5..583c4318 100644 --- a/src/compiler/OPM.Mod +++ b/src/compiler/OPM.Mod @@ -396,6 +396,8 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) LogWLn; LogWStr("DEBUG: OPM.Get returned inR.eot at curpos = 0, ch = "); LogWNum(ORD(ch),1); LogW("."); Texts.DumpReader(inR); + LogWLn; LogWStr("Heap dump:"); LogWLn; + Out.DumpHeap END; (* TODO, remove curpos var, and provide fn returning Texts.Pos(inR) - 1. *) (* Or, better still, record symbol position in OPS. *) diff --git a/src/runtime/Heap.Mod b/src/runtime/Heap.Mod index ad9d6424..bdb0bc59 100644 --- a/src/runtime/Heap.Mod +++ b/src/runtime/Heap.Mod @@ -80,7 +80,7 @@ MODULE Heap; firstTry: BOOLEAN; (* extensible heap *) - heap: S.ADDRESS; (* the sorted list of heap chunks *) + heap-: S.ADDRESS; (* the sorted list of heap chunks *) heapNegMin: S.ADDRESS; (* Range of pointer values, used for stack collection *) heapNegMax: S.ADDRESS; heapPosMin: S.ADDRESS; diff --git a/src/runtime/Out.Mod b/src/runtime/Out.Mod index 9dcb6b7f..63a22ada 100644 --- a/src/runtime/Out.Mod +++ b/src/runtime/Out.Mod @@ -117,15 +117,15 @@ END HexDump; PROCEDURE DumpModule(m: Heap.Module); BEGIN - String(" next: "); Hex(SYSTEM.VAL(SYSTEM.ADDRESS, m.next),1); Ln; - String(" name: "); String(m.name); Ln; - String(" refcnt: "); Hex(m.refcnt,1); Ln; - String(" cmds: "); Hex(SYSTEM.VAL(SYSTEM.ADDRESS, m.cmds),1); Ln; - String(" types: "); Hex(m.types,1); Ln; - String(" enumPtrs: "); Hex(SYSTEM.VAL(SYSTEM.ADDRESS, m.enumPtrs),1); Ln; + String(" next: "); Hex(SYSTEM.VAL(SYSTEM.ADDRESS, m.next),1); Ln; + String(" name: "); String(m.name); Ln; + String(" refcnt: "); Hex(m.refcnt,1); Ln; + String(" cmds: "); Hex(SYSTEM.VAL(SYSTEM.ADDRESS, m.cmds),1); Ln; + String(" types: "); Hex(m.types,1); Ln; + String(" enumPtrs: "); Hex(SYSTEM.VAL(SYSTEM.ADDRESS, m.enumPtrs),1); Ln; END DumpModule; -PROCEDURE DumpType*(VAR o: ARRAY OF SYSTEM.BYTE); +PROCEDURE DumpTag*(addr: SYSTEM.ADDRESS); TYPE typedesc = RECORD (* Array of type bound procedure addresses preceeds this. *) @@ -141,33 +141,98 @@ TYPE END; tag = POINTER [1] TO typedesc; VAR - addr: SYSTEM.ADDRESS; desc: tag; i: INTEGER; BEGIN - SYSTEM.GET(SYSTEM.ADR(o) - SIZE(SYSTEM.ADDRESS), addr); - String("obj tag: "); Hex(addr,1); Ln; + String(" obj tag: "); Hex(addr,1); Ln; DEC(addr, addr MOD 2); (* Work OK with incremented tags. *) desc := SYSTEM.VAL(tag, addr - (21*SIZE(SYSTEM.ADDRESS) + 24)); - String("desc at: "); Hex(SYSTEM.VAL(SYSTEM.ADDRESS, desc),1); Ln; - String("desc contains:"); Ln; - String("tag: "); Hex(desc.tag, 1); Ln; - String("next: "); Hex(desc.next, 1); Ln; - String("level: "); Hex(desc.level, 1); Ln; - String("module: "); Hex(desc.module, 1); Ln; - DumpModule(SYSTEM.VAL(Heap.Module, desc.module)); - String("name: "); String(desc.name); Ln; - String("bases: "); + String(" desc at: "); Hex(SYSTEM.VAL(SYSTEM.ADDRESS, desc),1); Ln; + String(" desc contains:"); Ln; + String(" tag: "); Hex(desc.tag, 1); Ln; + String(" next: "); Hex(desc.next, 1); Ln; + String(" level: "); Hex(desc.level, 1); Ln; + String(" module: "); Hex(desc.module, 1); Ln; + IF desc.module # 0 THEN DumpModule(SYSTEM.VAL(Heap.Module, desc.module)) END; + String(" name: "); String(desc.name); Ln; + String(" bases: "); i := 0; WHILE i < 16 DO Hex(desc.bases[i], SIZE(SYSTEM.ADDRESS) * 2); - IF i MOD 4 = 3 THEN Ln; String(" ") ELSE Char(" ") END; + IF i MOD 4 = 3 THEN Ln; String(" ") ELSE Char(" ") END; INC(i) END; Ln; - String("reserved: "); Hex(desc.reserved, 1); Ln; - String("blksz: "); Hex(desc.blksz, 1); Ln; - String("ptr0: "); Hex(desc.ptr0, 1); Ln; + String(" reserved: "); Hex(desc.reserved, 1); Ln; + String(" blksz: "); Hex(desc.blksz, 1); Ln; + String(" ptr0: "); Hex(desc.ptr0, 1); Ln; +END DumpTag; + +PROCEDURE DumpType*(VAR o: ARRAY OF SYSTEM.BYTE); +VAR addr: SYSTEM.ADDRESS; +BEGIN + SYSTEM.GET(SYSTEM.ADR(o) - SIZE(SYSTEM.ADDRESS), addr); + DumpTag(addr); END DumpType; + +PROCEDURE -externheap "extern ADDRESS Heap_heap;"; +PROCEDURE -getheap(): SYSTEM.ADDRESS "Heap_heap"; + +PROCEDURE DumpHeap*; +TYPE + adrptr = POINTER [1] TO ARRAY 1 OF SYSTEM.ADDRESS; + + block = POINTER [1] TO blockdesc; + blockdesc = RECORD + tag: SYSTEM.ADDRESS; + size: SYSTEM.ADDRESS; + sentinel: SYSTEM.ADDRESS; + next: SYSTEM.ADDRESS; + END; + + chunk = POINTER [1] TO chunkdesc; + chunkdesc = RECORD + next: SYSTEM.ADDRESS; + end: SYSTEM.ADDRESS; + reserved: SYSTEM.ADDRESS; + firstblock: blockdesc; + END; +VAR + caddr: SYSTEM.ADDRESS; c: chunk; + baddr: SYSTEM.ADDRESS; b: block; + tag: adrptr; +BEGIN + caddr := Heap.heap; + WHILE caddr # 0 DO + String("Chunk at: "); Hex(caddr, 1); Ln; + c := SYSTEM.VAL(chunk, caddr); + String(" next: "); Hex(c.next, 1); Ln; + String(" end: "); Hex(c.end, 1); String(" => size: "); Hex(c.end - caddr,1 ); Ln; + String(" rsvd: "); Hex(c.reserved, 1); Ln; + + baddr := SYSTEM.ADR(c.firstblock); + WHILE baddr < c.end DO + String(" Block at: "); Hex(baddr, 1); Ln; + b := SYSTEM.VAL(block, baddr); + tag := SYSTEM.VAL(adrptr, b.tag); + String(" tag: "); Hex(b.tag, 1); IF b.tag MOD 2 # 0 THEN String(" <--- ODD! ---") END; Ln; + String(" tag^: "); Hex(tag^[0], 1); Ln; + String(" size: "); Hex(b.size, 1); Ln; + String(" sentinel: "); Hex(b.sentinel, 1); Ln; + String(" next: "); Hex(b.next, 1); Ln; + IF b.tag # SYSTEM.ADR(b.size) THEN + (* There is a type descriptor. *) + DumpTag(b.tag) + END; + INC(baddr, tag^[0]); + Ln; + END; + + caddr := c.next; + Ln; + END +END DumpHeap; + + (* Real and Longreal display *) PROCEDURE digit(n: HUGEINT; VAR s: ARRAY OF CHAR; VAR i: INTEGER); @@ -184,6 +249,7 @@ BEGIN END prepend; + PROCEDURE Ten*(e: INTEGER): LONGREAL; VAR r, power: LONGREAL; BEGIN r := 1.0D0; power := 1.0D1; From d7de5701777c329e0798fa9e779d50ed63ef205a Mon Sep 17 00:00:00 2001 From: David Brown Date: Tue, 13 Dec 2016 18:27:35 +0000 Subject: [PATCH 425/580] Update bootstrap C sources. --- bootstrap/unix-44/Compiler.c | 2 +- bootstrap/unix-44/Configuration.c | 4 +- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Files.c | 2 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 5 +- bootstrap/unix-44/Heap.h | 6 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 2 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 6 +- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 2 +- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 2 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Out.c | 162 +++++++++++++++++++++------ bootstrap/unix-44/Out.h | 4 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/VT100.c | 2 +- bootstrap/unix-44/VT100.h | 2 +- bootstrap/unix-44/extTools.c | 2 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-48/Compiler.c | 2 +- bootstrap/unix-48/Configuration.c | 4 +- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Files.c | 2 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 5 +- bootstrap/unix-48/Heap.h | 6 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 2 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 6 +- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 2 +- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 2 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Out.c | 162 +++++++++++++++++++++------ bootstrap/unix-48/Out.h | 4 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/VT100.c | 2 +- bootstrap/unix-48/VT100.h | 2 +- bootstrap/unix-48/extTools.c | 2 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-88/Compiler.c | 2 +- bootstrap/unix-88/Configuration.c | 4 +- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Files.c | 2 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 5 +- bootstrap/unix-88/Heap.h | 6 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 2 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 6 +- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 2 +- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 2 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Out.c | 162 +++++++++++++++++++++------ bootstrap/unix-88/Out.h | 4 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/VT100.c | 2 +- bootstrap/unix-88/VT100.h | 2 +- bootstrap/unix-88/extTools.c | 2 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/windows-48/Compiler.c | 2 +- bootstrap/windows-48/Configuration.c | 4 +- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Files.c | 2 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 5 +- bootstrap/windows-48/Heap.h | 6 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 2 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 6 +- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 2 +- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 2 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Out.c | 162 +++++++++++++++++++++------ bootstrap/windows-48/Out.h | 4 +- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/VT100.c | 2 +- bootstrap/windows-48/VT100.h | 2 +- bootstrap/windows-48/extTools.c | 2 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-88/Compiler.c | 2 +- bootstrap/windows-88/Configuration.c | 4 +- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Files.c | 2 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 5 +- bootstrap/windows-88/Heap.h | 6 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 2 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 6 +- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 2 +- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 2 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Out.c | 162 +++++++++++++++++++++------ bootstrap/windows-88/Out.h | 4 +- bootstrap/windows-88/Platform.c | 2 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/VT100.c | 2 +- bootstrap/windows-88/VT100.h | 2 +- bootstrap/windows-88/extTools.c | 2 +- bootstrap/windows-88/extTools.h | 2 +- 185 files changed, 890 insertions(+), 355 deletions(-) diff --git a/bootstrap/unix-44/Compiler.c b/bootstrap/unix-44/Compiler.c index 65da2216..39819e0a 100644 --- a/bootstrap/unix-44/Compiler.c +++ b/bootstrap/unix-44/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index 77782293..e391cd31 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index 438fec28..5d106305 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 02716878..fb2ee9ee 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index 2270fec0..5b6e66ef 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index c9adb169..0e9118e3 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -68,7 +68,8 @@ static INT32 Heap_freeList[10]; static INT32 Heap_bigBlocks; export INT32 Heap_allocated; static BOOLEAN Heap_firstTry; -static INT32 Heap_heap, Heap_heapNegMin, Heap_heapNegMax, Heap_heapPosMin, Heap_heapPosMax; +export INT32 Heap_heap; +static INT32 Heap_heapNegMin, Heap_heapNegMax, Heap_heapPosMin, Heap_heapPosMax; export INT32 Heap_heapsize; static Heap_FinNode Heap_fin; static INT16 Heap_lockdepth; diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index 0df71d54..62f61978 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h @@ -46,7 +46,9 @@ typedef import SYSTEM_PTR Heap_modules; -import INT32 Heap_allocated, Heap_heapsize; +import INT32 Heap_allocated; +import INT32 Heap_heap; +import INT32 Heap_heapsize; import INT16 Heap_FileCount; import ADDRESS *Heap_ModuleDesc__typ; diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index 03d205e0..529aeee2 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index 3c1c580d..89339f66 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index 7e558357..b5c4fd7d 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index b6d457bd..20372132 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index c09d2e6a..7848592a 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index 7c47ed18..dff5b7ca 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index a3718f79..8017c2e7 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -495,6 +495,10 @@ void OPM_Get (CHAR *ch) OPM_LogWNum((INT16)*ch, 1); OPM_LogW('.'); Texts_DumpReader(OPM_inR); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Heap dump:", 11); + OPM_LogWLn(); + Out_DumpHeap(); } if ((*ch < 0x09 && !OPM_inR.eot)) { *ch = ' '; diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index 6d2755d8..59190332 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index 5924f42f..d8d05354 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index c13a4e91..efff1781 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index ed3ea3a1..2d0304d5 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index 6dae098c..e54474bc 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index e929a6e0..4d978eb5 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index 00094b66..d2ca1fae 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index 7e829aa2..5597b3e3 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index f83e65fb..4e3573c7 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Out.c b/bootstrap/unix-44/Out.c index 6d72148a..dc9ab60c 100644 --- a/bootstrap/unix-44/Out.c +++ b/bootstrap/unix-44/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -14,10 +14,14 @@ export BOOLEAN Out_IsConsole; static CHAR Out_buf[128]; static INT16 Out_in; -static ADDRESS *typedesc__5__typ; +static ADDRESS *typedesc__11__typ; +static ADDRESS *blockdesc__5__typ; +static ADDRESS *chunkdesc__7__typ; export void Out_Char (CHAR ch); +export void Out_DumpHeap (void); static void Out_DumpModule (Heap_Module m); +export void Out_DumpTag (INT32 addr); export void Out_DumpType (SYSTEM_BYTE *o, ADDRESS o__len); export void Out_Flush (void); export void Out_Hex (INT64 x, INT64 n); @@ -36,6 +40,8 @@ static void Out_digit (INT64 n, CHAR *s, ADDRESS s__len, INT16 *i); static void Out_prepend (CHAR *t, ADDRESS t__len, CHAR *s, ADDRESS s__len, INT16 *i); #define Out_Entier64(x) (INT64)(x) +extern ADDRESS Heap_heap; +#define Out_getheap() Heap_heap void Out_Flush (void) { @@ -209,93 +215,180 @@ void Out_HexDump (SYSTEM_BYTE *m, ADDRESS m__len) static void Out_DumpModule (Heap_Module m) { - Out_String((CHAR*)" next: ", 13); + Out_String((CHAR*)" next: ", 19); Out_Hex((INT32)(ADDRESS)m->next, 1); Out_Ln(); - Out_String((CHAR*)" name: ", 13); + Out_String((CHAR*)" name: ", 19); Out_String(m->name, 20); Out_Ln(); - Out_String((CHAR*)" refcnt: ", 13); + Out_String((CHAR*)" refcnt: ", 19); Out_Hex(m->refcnt, 1); Out_Ln(); - Out_String((CHAR*)" cmds: ", 13); + Out_String((CHAR*)" cmds: ", 19); Out_Hex((INT32)(ADDRESS)m->cmds, 1); Out_Ln(); - Out_String((CHAR*)" types: ", 13); + Out_String((CHAR*)" types: ", 19); Out_Hex(m->types, 1); Out_Ln(); - Out_String((CHAR*)" enumPtrs: ", 13); + Out_String((CHAR*)" enumPtrs: ", 19); Out_Hex((INT32)(ADDRESS)m->enumPtrs, 1); Out_Ln(); } typedef - struct typedesc__5 *tag__4; + struct typedesc__11 *tag__10; typedef - struct typedesc__5 { + struct typedesc__11 { INT32 tag, next, level, module; CHAR name[24]; INT32 bases[16]; INT32 reserved, blksz, ptr0; - } typedesc__5; + } typedesc__11; -void Out_DumpType (SYSTEM_BYTE *o, ADDRESS o__len) +void Out_DumpTag (INT32 addr) { - INT32 addr; - tag__4 desc = NIL; + tag__10 desc = NIL; INT16 i; - __GET((ADDRESS)o - 4, addr, INT32); - Out_String((CHAR*)"obj tag: ", 11); + Out_String((CHAR*)" obj tag: ", 17); Out_Hex(addr, 1); Out_Ln(); addr -= __MASK(addr, -2); - desc = (tag__4)(ADDRESS)(addr - 108); - Out_String((CHAR*)"desc at: ", 11); + desc = (tag__10)(ADDRESS)(addr - 108); + Out_String((CHAR*)" desc at: ", 17); Out_Hex((INT32)(ADDRESS)desc, 1); Out_Ln(); - Out_String((CHAR*)"desc contains:", 15); + Out_String((CHAR*)" desc contains:", 21); Out_Ln(); - Out_String((CHAR*)"tag: ", 11); + Out_String((CHAR*)" tag: ", 17); Out_Hex(desc->tag, 1); Out_Ln(); - Out_String((CHAR*)"next: ", 11); + Out_String((CHAR*)" next: ", 17); Out_Hex(desc->next, 1); Out_Ln(); - Out_String((CHAR*)"level: ", 11); + Out_String((CHAR*)" level: ", 17); Out_Hex(desc->level, 1); Out_Ln(); - Out_String((CHAR*)"module: ", 11); + Out_String((CHAR*)" module: ", 17); Out_Hex(desc->module, 1); Out_Ln(); - Out_DumpModule((Heap_Module)(ADDRESS)desc->module); - Out_String((CHAR*)"name: ", 11); + if (desc->module != 0) { + Out_DumpModule((Heap_Module)(ADDRESS)desc->module); + } + Out_String((CHAR*)" name: ", 17); Out_String(desc->name, 24); Out_Ln(); - Out_String((CHAR*)"bases: ", 11); + Out_String((CHAR*)" bases: ", 17); i = 0; while (i < 16) { Out_Hex(desc->bases[__X(i, 16)], 8); if (__MASK(i, -4) == 3) { Out_Ln(); - Out_String((CHAR*)" ", 11); + Out_String((CHAR*)" ", 17); } else { Out_Char(' '); } i += 1; } Out_Ln(); - Out_String((CHAR*)"reserved: ", 11); + Out_String((CHAR*)" reserved: ", 17); Out_Hex(desc->reserved, 1); Out_Ln(); - Out_String((CHAR*)"blksz: ", 11); + Out_String((CHAR*)" blksz: ", 17); Out_Hex(desc->blksz, 1); Out_Ln(); - Out_String((CHAR*)"ptr0: ", 11); + Out_String((CHAR*)" ptr0: ", 17); Out_Hex(desc->ptr0, 1); Out_Ln(); } +void Out_DumpType (SYSTEM_BYTE *o, ADDRESS o__len) +{ + INT32 addr; + __GET((ADDRESS)o - 4, addr, INT32); + Out_DumpTag(addr); +} + +typedef + INT32 (*adrptr__3)[1]; + +typedef + struct blockdesc__5 *block__4; + +typedef + struct blockdesc__5 { + INT32 tag, size, sentinel, next; + } blockdesc__5; + +typedef + struct chunkdesc__7 *chunk__6; + +typedef + struct chunkdesc__7 { + INT32 next, end, reserved; + blockdesc__5 firstblock; + } chunkdesc__7; + +void Out_DumpHeap (void) +{ + INT32 caddr; + chunk__6 c = NIL; + INT32 baddr; + block__4 b = NIL; + adrptr__3 tag = NIL; + caddr = Heap_heap; + while (caddr != 0) { + Out_String((CHAR*)"Chunk at: ", 11); + Out_Hex(caddr, 1); + Out_Ln(); + c = (chunk__6)(ADDRESS)caddr; + Out_String((CHAR*)" next: ", 11); + Out_Hex(c->next, 1); + Out_Ln(); + Out_String((CHAR*)" end: ", 11); + Out_Hex(c->end, 1); + Out_String((CHAR*)" => size: ", 11); + Out_Hex(c->end - caddr, 1); + Out_Ln(); + Out_String((CHAR*)" rsvd: ", 11); + Out_Hex(c->reserved, 1); + Out_Ln(); + baddr = (ADDRESS)&c->firstblock; + while (baddr < c->end) { + Out_String((CHAR*)" Block at: ", 15); + Out_Hex(baddr, 1); + Out_Ln(); + b = (block__4)(ADDRESS)baddr; + tag = (adrptr__3)(ADDRESS)b->tag; + Out_String((CHAR*)" tag: ", 15); + Out_Hex(b->tag, 1); + if (__MASK(b->tag, -2) != 0) { + Out_String((CHAR*)" <--- ODD! ---", 15); + } + Out_Ln(); + Out_String((CHAR*)" tag^: ", 15); + Out_Hex((*tag)[0], 1); + Out_Ln(); + Out_String((CHAR*)" size: ", 15); + Out_Hex(b->size, 1); + Out_Ln(); + Out_String((CHAR*)" sentinel: ", 15); + Out_Hex(b->sentinel, 1); + Out_Ln(); + Out_String((CHAR*)" next: ", 15); + Out_Hex(b->next, 1); + Out_Ln(); + if (b->tag != (ADDRESS)&b->size) { + Out_DumpTag(b->tag); + } + baddr += (*tag)[0]; + Out_Ln(); + } + caddr = c->next; + Out_Ln(); + } +} + static void Out_digit (INT64 n, CHAR *s, ADDRESS s__len, INT16 *i) { *i -= 1; @@ -473,7 +566,9 @@ void Out_LongReal (LONGREAL x, INT16 n) Out_RealP(x, n, 1); } -__TDESC(typedesc__5, 1, 0) = {__TDFLDS("typedesc__5", 116), {-4}}; +__TDESC(typedesc__11, 1, 0) = {__TDFLDS("typedesc__11", 116), {-4}}; +__TDESC(blockdesc__5, 1, 0) = {__TDFLDS("blockdesc__5", 16), {-4}}; +__TDESC(chunkdesc__7, 1, 0) = {__TDFLDS("chunkdesc__7", 28), {-4}}; export void *Out__init(void) { @@ -481,10 +576,13 @@ export void *Out__init(void) __MODULE_IMPORT(Heap); __MODULE_IMPORT(Platform); __REGMOD("Out", 0); + __REGCMD("DumpHeap", Out_DumpHeap); __REGCMD("Flush", Out_Flush); __REGCMD("Ln", Out_Ln); __REGCMD("Open", Out_Open); - __INITYP(typedesc__5, typedesc__5, 0); + __INITYP(typedesc__11, typedesc__11, 0); + __INITYP(blockdesc__5, blockdesc__5, 0); + __INITYP(chunkdesc__7, chunkdesc__7, 0); /* BEGIN */ Out_IsConsole = Platform_IsConsole(1); Out_in = 0; diff --git a/bootstrap/unix-44/Out.h b/bootstrap/unix-44/Out.h index 0b3a93df..80673194 100644 --- a/bootstrap/unix-44/Out.h +++ b/bootstrap/unix-44/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h @@ -10,6 +10,8 @@ import BOOLEAN Out_IsConsole; import void Out_Char (CHAR ch); +import void Out_DumpHeap (void); +import void Out_DumpTag (INT32 addr); import void Out_DumpType (SYSTEM_BYTE *o, ADDRESS o__len); import void Out_Flush (void); import void Out_Hex (INT64 x, INT64 n); diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index a825b8ec..9b35ef5a 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index 5d752192..2b2fba4b 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 0a2d220b..55de7323 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index 0c564f0e..0af8a733 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index ed806db0..909f5e88 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index 93b62826..54ccc184 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index bbca112c..bc3411f2 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index 04c8767a..208d1fe8 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/VT100.c b/bootstrap/unix-44/VT100.c index ed38e4dc..451af631 100644 --- a/bootstrap/unix-44/VT100.c +++ b/bootstrap/unix-44/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/VT100.h b/bootstrap/unix-44/VT100.h index 69601701..d4387f75 100644 --- a/bootstrap/unix-44/VT100.h +++ b/bootstrap/unix-44/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index 0b3a981e..83030d15 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index 36571c99..0a7aceb7 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/Compiler.c b/bootstrap/unix-48/Compiler.c index 65da2216..39819e0a 100644 --- a/bootstrap/unix-48/Compiler.c +++ b/bootstrap/unix-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index 77782293..e391cd31 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index 438fec28..5d106305 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 02716878..fb2ee9ee 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index 2270fec0..5b6e66ef 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index c9adb169..0e9118e3 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -68,7 +68,8 @@ static INT32 Heap_freeList[10]; static INT32 Heap_bigBlocks; export INT32 Heap_allocated; static BOOLEAN Heap_firstTry; -static INT32 Heap_heap, Heap_heapNegMin, Heap_heapNegMax, Heap_heapPosMin, Heap_heapPosMax; +export INT32 Heap_heap; +static INT32 Heap_heapNegMin, Heap_heapNegMax, Heap_heapPosMin, Heap_heapPosMax; export INT32 Heap_heapsize; static Heap_FinNode Heap_fin; static INT16 Heap_lockdepth; diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index 0df71d54..62f61978 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h @@ -46,7 +46,9 @@ typedef import SYSTEM_PTR Heap_modules; -import INT32 Heap_allocated, Heap_heapsize; +import INT32 Heap_allocated; +import INT32 Heap_heap; +import INT32 Heap_heapsize; import INT16 Heap_FileCount; import ADDRESS *Heap_ModuleDesc__typ; diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index 03d205e0..529aeee2 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index 3c1c580d..89339f66 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index 7e558357..b5c4fd7d 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index b6d457bd..20372132 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index c09d2e6a..7848592a 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index 7c47ed18..dff5b7ca 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index a3718f79..8017c2e7 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -495,6 +495,10 @@ void OPM_Get (CHAR *ch) OPM_LogWNum((INT16)*ch, 1); OPM_LogW('.'); Texts_DumpReader(OPM_inR); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Heap dump:", 11); + OPM_LogWLn(); + Out_DumpHeap(); } if ((*ch < 0x09 && !OPM_inR.eot)) { *ch = ' '; diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index 6d2755d8..59190332 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index 5924f42f..d8d05354 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index c13a4e91..efff1781 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index ed3ea3a1..2d0304d5 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index 6dae098c..e54474bc 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 6b6144fc..c9f40056 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index 00094b66..d2ca1fae 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index 7e829aa2..5597b3e3 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index f83e65fb..4e3573c7 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Out.c b/bootstrap/unix-48/Out.c index 6d72148a..dc9ab60c 100644 --- a/bootstrap/unix-48/Out.c +++ b/bootstrap/unix-48/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -14,10 +14,14 @@ export BOOLEAN Out_IsConsole; static CHAR Out_buf[128]; static INT16 Out_in; -static ADDRESS *typedesc__5__typ; +static ADDRESS *typedesc__11__typ; +static ADDRESS *blockdesc__5__typ; +static ADDRESS *chunkdesc__7__typ; export void Out_Char (CHAR ch); +export void Out_DumpHeap (void); static void Out_DumpModule (Heap_Module m); +export void Out_DumpTag (INT32 addr); export void Out_DumpType (SYSTEM_BYTE *o, ADDRESS o__len); export void Out_Flush (void); export void Out_Hex (INT64 x, INT64 n); @@ -36,6 +40,8 @@ static void Out_digit (INT64 n, CHAR *s, ADDRESS s__len, INT16 *i); static void Out_prepend (CHAR *t, ADDRESS t__len, CHAR *s, ADDRESS s__len, INT16 *i); #define Out_Entier64(x) (INT64)(x) +extern ADDRESS Heap_heap; +#define Out_getheap() Heap_heap void Out_Flush (void) { @@ -209,93 +215,180 @@ void Out_HexDump (SYSTEM_BYTE *m, ADDRESS m__len) static void Out_DumpModule (Heap_Module m) { - Out_String((CHAR*)" next: ", 13); + Out_String((CHAR*)" next: ", 19); Out_Hex((INT32)(ADDRESS)m->next, 1); Out_Ln(); - Out_String((CHAR*)" name: ", 13); + Out_String((CHAR*)" name: ", 19); Out_String(m->name, 20); Out_Ln(); - Out_String((CHAR*)" refcnt: ", 13); + Out_String((CHAR*)" refcnt: ", 19); Out_Hex(m->refcnt, 1); Out_Ln(); - Out_String((CHAR*)" cmds: ", 13); + Out_String((CHAR*)" cmds: ", 19); Out_Hex((INT32)(ADDRESS)m->cmds, 1); Out_Ln(); - Out_String((CHAR*)" types: ", 13); + Out_String((CHAR*)" types: ", 19); Out_Hex(m->types, 1); Out_Ln(); - Out_String((CHAR*)" enumPtrs: ", 13); + Out_String((CHAR*)" enumPtrs: ", 19); Out_Hex((INT32)(ADDRESS)m->enumPtrs, 1); Out_Ln(); } typedef - struct typedesc__5 *tag__4; + struct typedesc__11 *tag__10; typedef - struct typedesc__5 { + struct typedesc__11 { INT32 tag, next, level, module; CHAR name[24]; INT32 bases[16]; INT32 reserved, blksz, ptr0; - } typedesc__5; + } typedesc__11; -void Out_DumpType (SYSTEM_BYTE *o, ADDRESS o__len) +void Out_DumpTag (INT32 addr) { - INT32 addr; - tag__4 desc = NIL; + tag__10 desc = NIL; INT16 i; - __GET((ADDRESS)o - 4, addr, INT32); - Out_String((CHAR*)"obj tag: ", 11); + Out_String((CHAR*)" obj tag: ", 17); Out_Hex(addr, 1); Out_Ln(); addr -= __MASK(addr, -2); - desc = (tag__4)(ADDRESS)(addr - 108); - Out_String((CHAR*)"desc at: ", 11); + desc = (tag__10)(ADDRESS)(addr - 108); + Out_String((CHAR*)" desc at: ", 17); Out_Hex((INT32)(ADDRESS)desc, 1); Out_Ln(); - Out_String((CHAR*)"desc contains:", 15); + Out_String((CHAR*)" desc contains:", 21); Out_Ln(); - Out_String((CHAR*)"tag: ", 11); + Out_String((CHAR*)" tag: ", 17); Out_Hex(desc->tag, 1); Out_Ln(); - Out_String((CHAR*)"next: ", 11); + Out_String((CHAR*)" next: ", 17); Out_Hex(desc->next, 1); Out_Ln(); - Out_String((CHAR*)"level: ", 11); + Out_String((CHAR*)" level: ", 17); Out_Hex(desc->level, 1); Out_Ln(); - Out_String((CHAR*)"module: ", 11); + Out_String((CHAR*)" module: ", 17); Out_Hex(desc->module, 1); Out_Ln(); - Out_DumpModule((Heap_Module)(ADDRESS)desc->module); - Out_String((CHAR*)"name: ", 11); + if (desc->module != 0) { + Out_DumpModule((Heap_Module)(ADDRESS)desc->module); + } + Out_String((CHAR*)" name: ", 17); Out_String(desc->name, 24); Out_Ln(); - Out_String((CHAR*)"bases: ", 11); + Out_String((CHAR*)" bases: ", 17); i = 0; while (i < 16) { Out_Hex(desc->bases[__X(i, 16)], 8); if (__MASK(i, -4) == 3) { Out_Ln(); - Out_String((CHAR*)" ", 11); + Out_String((CHAR*)" ", 17); } else { Out_Char(' '); } i += 1; } Out_Ln(); - Out_String((CHAR*)"reserved: ", 11); + Out_String((CHAR*)" reserved: ", 17); Out_Hex(desc->reserved, 1); Out_Ln(); - Out_String((CHAR*)"blksz: ", 11); + Out_String((CHAR*)" blksz: ", 17); Out_Hex(desc->blksz, 1); Out_Ln(); - Out_String((CHAR*)"ptr0: ", 11); + Out_String((CHAR*)" ptr0: ", 17); Out_Hex(desc->ptr0, 1); Out_Ln(); } +void Out_DumpType (SYSTEM_BYTE *o, ADDRESS o__len) +{ + INT32 addr; + __GET((ADDRESS)o - 4, addr, INT32); + Out_DumpTag(addr); +} + +typedef + INT32 (*adrptr__3)[1]; + +typedef + struct blockdesc__5 *block__4; + +typedef + struct blockdesc__5 { + INT32 tag, size, sentinel, next; + } blockdesc__5; + +typedef + struct chunkdesc__7 *chunk__6; + +typedef + struct chunkdesc__7 { + INT32 next, end, reserved; + blockdesc__5 firstblock; + } chunkdesc__7; + +void Out_DumpHeap (void) +{ + INT32 caddr; + chunk__6 c = NIL; + INT32 baddr; + block__4 b = NIL; + adrptr__3 tag = NIL; + caddr = Heap_heap; + while (caddr != 0) { + Out_String((CHAR*)"Chunk at: ", 11); + Out_Hex(caddr, 1); + Out_Ln(); + c = (chunk__6)(ADDRESS)caddr; + Out_String((CHAR*)" next: ", 11); + Out_Hex(c->next, 1); + Out_Ln(); + Out_String((CHAR*)" end: ", 11); + Out_Hex(c->end, 1); + Out_String((CHAR*)" => size: ", 11); + Out_Hex(c->end - caddr, 1); + Out_Ln(); + Out_String((CHAR*)" rsvd: ", 11); + Out_Hex(c->reserved, 1); + Out_Ln(); + baddr = (ADDRESS)&c->firstblock; + while (baddr < c->end) { + Out_String((CHAR*)" Block at: ", 15); + Out_Hex(baddr, 1); + Out_Ln(); + b = (block__4)(ADDRESS)baddr; + tag = (adrptr__3)(ADDRESS)b->tag; + Out_String((CHAR*)" tag: ", 15); + Out_Hex(b->tag, 1); + if (__MASK(b->tag, -2) != 0) { + Out_String((CHAR*)" <--- ODD! ---", 15); + } + Out_Ln(); + Out_String((CHAR*)" tag^: ", 15); + Out_Hex((*tag)[0], 1); + Out_Ln(); + Out_String((CHAR*)" size: ", 15); + Out_Hex(b->size, 1); + Out_Ln(); + Out_String((CHAR*)" sentinel: ", 15); + Out_Hex(b->sentinel, 1); + Out_Ln(); + Out_String((CHAR*)" next: ", 15); + Out_Hex(b->next, 1); + Out_Ln(); + if (b->tag != (ADDRESS)&b->size) { + Out_DumpTag(b->tag); + } + baddr += (*tag)[0]; + Out_Ln(); + } + caddr = c->next; + Out_Ln(); + } +} + static void Out_digit (INT64 n, CHAR *s, ADDRESS s__len, INT16 *i) { *i -= 1; @@ -473,7 +566,9 @@ void Out_LongReal (LONGREAL x, INT16 n) Out_RealP(x, n, 1); } -__TDESC(typedesc__5, 1, 0) = {__TDFLDS("typedesc__5", 116), {-4}}; +__TDESC(typedesc__11, 1, 0) = {__TDFLDS("typedesc__11", 116), {-4}}; +__TDESC(blockdesc__5, 1, 0) = {__TDFLDS("blockdesc__5", 16), {-4}}; +__TDESC(chunkdesc__7, 1, 0) = {__TDFLDS("chunkdesc__7", 28), {-4}}; export void *Out__init(void) { @@ -481,10 +576,13 @@ export void *Out__init(void) __MODULE_IMPORT(Heap); __MODULE_IMPORT(Platform); __REGMOD("Out", 0); + __REGCMD("DumpHeap", Out_DumpHeap); __REGCMD("Flush", Out_Flush); __REGCMD("Ln", Out_Ln); __REGCMD("Open", Out_Open); - __INITYP(typedesc__5, typedesc__5, 0); + __INITYP(typedesc__11, typedesc__11, 0); + __INITYP(blockdesc__5, blockdesc__5, 0); + __INITYP(chunkdesc__7, chunkdesc__7, 0); /* BEGIN */ Out_IsConsole = Platform_IsConsole(1); Out_in = 0; diff --git a/bootstrap/unix-48/Out.h b/bootstrap/unix-48/Out.h index 0b3a93df..80673194 100644 --- a/bootstrap/unix-48/Out.h +++ b/bootstrap/unix-48/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h @@ -10,6 +10,8 @@ import BOOLEAN Out_IsConsole; import void Out_Char (CHAR ch); +import void Out_DumpHeap (void); +import void Out_DumpTag (INT32 addr); import void Out_DumpType (SYSTEM_BYTE *o, ADDRESS o__len); import void Out_Flush (void); import void Out_Hex (INT64 x, INT64 n); diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index a825b8ec..9b35ef5a 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index 5d752192..2b2fba4b 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 0a2d220b..55de7323 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index 0c564f0e..0af8a733 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index ed806db0..909f5e88 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index 93b62826..54ccc184 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index a91fe173..5df0abaa 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index 24dacf51..d7570ee1 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/VT100.c b/bootstrap/unix-48/VT100.c index ed38e4dc..451af631 100644 --- a/bootstrap/unix-48/VT100.c +++ b/bootstrap/unix-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/VT100.h b/bootstrap/unix-48/VT100.h index 69601701..d4387f75 100644 --- a/bootstrap/unix-48/VT100.h +++ b/bootstrap/unix-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index 0b3a981e..83030d15 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index 36571c99..0a7aceb7 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/Compiler.c b/bootstrap/unix-88/Compiler.c index 65da2216..39819e0a 100644 --- a/bootstrap/unix-88/Compiler.c +++ b/bootstrap/unix-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index 77782293..e391cd31 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index 438fec28..5d106305 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index bed555a5..ead3b170 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index ba436b23..6ff0de64 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index 3e929c3a..769d2d6b 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -68,7 +68,8 @@ static INT64 Heap_freeList[10]; static INT64 Heap_bigBlocks; export INT64 Heap_allocated; static BOOLEAN Heap_firstTry; -static INT64 Heap_heap, Heap_heapNegMin, Heap_heapNegMax, Heap_heapPosMin, Heap_heapPosMax; +export INT64 Heap_heap; +static INT64 Heap_heapNegMin, Heap_heapNegMax, Heap_heapPosMin, Heap_heapPosMax; export INT64 Heap_heapsize; static Heap_FinNode Heap_fin; static INT16 Heap_lockdepth; diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index b2018428..26424f29 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h @@ -46,7 +46,9 @@ typedef import SYSTEM_PTR Heap_modules; -import INT64 Heap_allocated, Heap_heapsize; +import INT64 Heap_allocated; +import INT64 Heap_heap; +import INT64 Heap_heapsize; import INT16 Heap_FileCount; import ADDRESS *Heap_ModuleDesc__typ; diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 884c7b0e..82b56235 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index e5803d29..f82ccfd0 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index 7e558357..b5c4fd7d 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index b6d457bd..20372132 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index c09d2e6a..7848592a 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index 7c47ed18..dff5b7ca 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index e3e6f1fe..faf1ba5e 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -495,6 +495,10 @@ void OPM_Get (CHAR *ch) OPM_LogWNum((INT16)*ch, 1); OPM_LogW('.'); Texts_DumpReader(OPM_inR); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Heap dump:", 11); + OPM_LogWLn(); + Out_DumpHeap(); } if ((*ch < 0x09 && !OPM_inR.eot)) { *ch = ' '; diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index 6d2755d8..59190332 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index dc87be62..94982bd2 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index c13a4e91..efff1781 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index ed3ea3a1..2d0304d5 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index 6dae098c..e54474bc 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index 25e2e7c2..46bd1072 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 00094b66..d2ca1fae 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index c88953f2..a3223212 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index f83e65fb..4e3573c7 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Out.c b/bootstrap/unix-88/Out.c index 67eaad85..5b315327 100644 --- a/bootstrap/unix-88/Out.c +++ b/bootstrap/unix-88/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -14,10 +14,14 @@ export BOOLEAN Out_IsConsole; static CHAR Out_buf[128]; static INT16 Out_in; -static ADDRESS *typedesc__5__typ; +static ADDRESS *typedesc__11__typ; +static ADDRESS *blockdesc__5__typ; +static ADDRESS *chunkdesc__7__typ; export void Out_Char (CHAR ch); +export void Out_DumpHeap (void); static void Out_DumpModule (Heap_Module m); +export void Out_DumpTag (INT64 addr); export void Out_DumpType (SYSTEM_BYTE *o, ADDRESS o__len); export void Out_Flush (void); export void Out_Hex (INT64 x, INT64 n); @@ -36,6 +40,8 @@ static void Out_digit (INT64 n, CHAR *s, ADDRESS s__len, INT16 *i); static void Out_prepend (CHAR *t, ADDRESS t__len, CHAR *s, ADDRESS s__len, INT16 *i); #define Out_Entier64(x) (INT64)(x) +extern ADDRESS Heap_heap; +#define Out_getheap() Heap_heap void Out_Flush (void) { @@ -209,93 +215,180 @@ void Out_HexDump (SYSTEM_BYTE *m, ADDRESS m__len) static void Out_DumpModule (Heap_Module m) { - Out_String((CHAR*)" next: ", 13); + Out_String((CHAR*)" next: ", 19); Out_Hex((INT64)(ADDRESS)m->next, 1); Out_Ln(); - Out_String((CHAR*)" name: ", 13); + Out_String((CHAR*)" name: ", 19); Out_String(m->name, 20); Out_Ln(); - Out_String((CHAR*)" refcnt: ", 13); + Out_String((CHAR*)" refcnt: ", 19); Out_Hex(m->refcnt, 1); Out_Ln(); - Out_String((CHAR*)" cmds: ", 13); + Out_String((CHAR*)" cmds: ", 19); Out_Hex((INT64)(ADDRESS)m->cmds, 1); Out_Ln(); - Out_String((CHAR*)" types: ", 13); + Out_String((CHAR*)" types: ", 19); Out_Hex(m->types, 1); Out_Ln(); - Out_String((CHAR*)" enumPtrs: ", 13); + Out_String((CHAR*)" enumPtrs: ", 19); Out_Hex((INT64)(ADDRESS)m->enumPtrs, 1); Out_Ln(); } typedef - struct typedesc__5 *tag__4; + struct typedesc__11 *tag__10; typedef - struct typedesc__5 { + struct typedesc__11 { INT64 tag, next, level, module; CHAR name[24]; INT64 bases[16]; INT64 reserved, blksz, ptr0; - } typedesc__5; + } typedesc__11; -void Out_DumpType (SYSTEM_BYTE *o, ADDRESS o__len) +void Out_DumpTag (INT64 addr) { - INT64 addr; - tag__4 desc = NIL; + tag__10 desc = NIL; INT16 i; - __GET((ADDRESS)o - 8, addr, INT64); - Out_String((CHAR*)"obj tag: ", 11); + Out_String((CHAR*)" obj tag: ", 17); Out_Hex(addr, 1); Out_Ln(); addr -= __MASK(addr, -2); - desc = (tag__4)(ADDRESS)(addr - 192); - Out_String((CHAR*)"desc at: ", 11); + desc = (tag__10)(ADDRESS)(addr - 192); + Out_String((CHAR*)" desc at: ", 17); Out_Hex((INT64)(ADDRESS)desc, 1); Out_Ln(); - Out_String((CHAR*)"desc contains:", 15); + Out_String((CHAR*)" desc contains:", 21); Out_Ln(); - Out_String((CHAR*)"tag: ", 11); + Out_String((CHAR*)" tag: ", 17); Out_Hex(desc->tag, 1); Out_Ln(); - Out_String((CHAR*)"next: ", 11); + Out_String((CHAR*)" next: ", 17); Out_Hex(desc->next, 1); Out_Ln(); - Out_String((CHAR*)"level: ", 11); + Out_String((CHAR*)" level: ", 17); Out_Hex(desc->level, 1); Out_Ln(); - Out_String((CHAR*)"module: ", 11); + Out_String((CHAR*)" module: ", 17); Out_Hex(desc->module, 1); Out_Ln(); - Out_DumpModule((Heap_Module)(ADDRESS)desc->module); - Out_String((CHAR*)"name: ", 11); + if (desc->module != 0) { + Out_DumpModule((Heap_Module)(ADDRESS)desc->module); + } + Out_String((CHAR*)" name: ", 17); Out_String(desc->name, 24); Out_Ln(); - Out_String((CHAR*)"bases: ", 11); + Out_String((CHAR*)" bases: ", 17); i = 0; while (i < 16) { Out_Hex(desc->bases[__X(i, 16)], 16); if (__MASK(i, -4) == 3) { Out_Ln(); - Out_String((CHAR*)" ", 11); + Out_String((CHAR*)" ", 17); } else { Out_Char(' '); } i += 1; } Out_Ln(); - Out_String((CHAR*)"reserved: ", 11); + Out_String((CHAR*)" reserved: ", 17); Out_Hex(desc->reserved, 1); Out_Ln(); - Out_String((CHAR*)"blksz: ", 11); + Out_String((CHAR*)" blksz: ", 17); Out_Hex(desc->blksz, 1); Out_Ln(); - Out_String((CHAR*)"ptr0: ", 11); + Out_String((CHAR*)" ptr0: ", 17); Out_Hex(desc->ptr0, 1); Out_Ln(); } +void Out_DumpType (SYSTEM_BYTE *o, ADDRESS o__len) +{ + INT64 addr; + __GET((ADDRESS)o - 8, addr, INT64); + Out_DumpTag(addr); +} + +typedef + INT64 (*adrptr__3)[1]; + +typedef + struct blockdesc__5 *block__4; + +typedef + struct blockdesc__5 { + INT64 tag, size, sentinel, next; + } blockdesc__5; + +typedef + struct chunkdesc__7 *chunk__6; + +typedef + struct chunkdesc__7 { + INT64 next, end, reserved; + blockdesc__5 firstblock; + } chunkdesc__7; + +void Out_DumpHeap (void) +{ + INT64 caddr; + chunk__6 c = NIL; + INT64 baddr; + block__4 b = NIL; + adrptr__3 tag = NIL; + caddr = Heap_heap; + while (caddr != 0) { + Out_String((CHAR*)"Chunk at: ", 11); + Out_Hex(caddr, 1); + Out_Ln(); + c = (chunk__6)(ADDRESS)caddr; + Out_String((CHAR*)" next: ", 11); + Out_Hex(c->next, 1); + Out_Ln(); + Out_String((CHAR*)" end: ", 11); + Out_Hex(c->end, 1); + Out_String((CHAR*)" => size: ", 11); + Out_Hex(c->end - caddr, 1); + Out_Ln(); + Out_String((CHAR*)" rsvd: ", 11); + Out_Hex(c->reserved, 1); + Out_Ln(); + baddr = (ADDRESS)&c->firstblock; + while (baddr < c->end) { + Out_String((CHAR*)" Block at: ", 15); + Out_Hex(baddr, 1); + Out_Ln(); + b = (block__4)(ADDRESS)baddr; + tag = (adrptr__3)(ADDRESS)b->tag; + Out_String((CHAR*)" tag: ", 15); + Out_Hex(b->tag, 1); + if (__MASK(b->tag, -2) != 0) { + Out_String((CHAR*)" <--- ODD! ---", 15); + } + Out_Ln(); + Out_String((CHAR*)" tag^: ", 15); + Out_Hex((*tag)[0], 1); + Out_Ln(); + Out_String((CHAR*)" size: ", 15); + Out_Hex(b->size, 1); + Out_Ln(); + Out_String((CHAR*)" sentinel: ", 15); + Out_Hex(b->sentinel, 1); + Out_Ln(); + Out_String((CHAR*)" next: ", 15); + Out_Hex(b->next, 1); + Out_Ln(); + if (b->tag != (ADDRESS)&b->size) { + Out_DumpTag(b->tag); + } + baddr += (*tag)[0]; + Out_Ln(); + } + caddr = c->next; + Out_Ln(); + } +} + static void Out_digit (INT64 n, CHAR *s, ADDRESS s__len, INT16 *i) { *i -= 1; @@ -473,7 +566,9 @@ void Out_LongReal (LONGREAL x, INT16 n) Out_RealP(x, n, 1); } -__TDESC(typedesc__5, 1, 0) = {__TDFLDS("typedesc__5", 208), {-8}}; +__TDESC(typedesc__11, 1, 0) = {__TDFLDS("typedesc__11", 208), {-8}}; +__TDESC(blockdesc__5, 1, 0) = {__TDFLDS("blockdesc__5", 32), {-8}}; +__TDESC(chunkdesc__7, 1, 0) = {__TDFLDS("chunkdesc__7", 56), {-8}}; export void *Out__init(void) { @@ -481,10 +576,13 @@ export void *Out__init(void) __MODULE_IMPORT(Heap); __MODULE_IMPORT(Platform); __REGMOD("Out", 0); + __REGCMD("DumpHeap", Out_DumpHeap); __REGCMD("Flush", Out_Flush); __REGCMD("Ln", Out_Ln); __REGCMD("Open", Out_Open); - __INITYP(typedesc__5, typedesc__5, 0); + __INITYP(typedesc__11, typedesc__11, 0); + __INITYP(blockdesc__5, blockdesc__5, 0); + __INITYP(chunkdesc__7, chunkdesc__7, 0); /* BEGIN */ Out_IsConsole = Platform_IsConsole(1); Out_in = 0; diff --git a/bootstrap/unix-88/Out.h b/bootstrap/unix-88/Out.h index 0126ef62..42ae59ed 100644 --- a/bootstrap/unix-88/Out.h +++ b/bootstrap/unix-88/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h @@ -10,6 +10,8 @@ import BOOLEAN Out_IsConsole; import void Out_Char (CHAR ch); +import void Out_DumpHeap (void); +import void Out_DumpTag (INT64 addr); import void Out_DumpType (SYSTEM_BYTE *o, ADDRESS o__len); import void Out_Flush (void); import void Out_Hex (INT64 x, INT64 n); diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index d695bda2..ef72c3b2 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index 741cf3f7..fbc0ebdd 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 0a2d220b..55de7323 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index 0c564f0e..0af8a733 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index ed806db0..909f5e88 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index 93b62826..54ccc184 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index bd19d27b..6447e8ae 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index 2cf87339..ff036fdd 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/VT100.c b/bootstrap/unix-88/VT100.c index ed38e4dc..451af631 100644 --- a/bootstrap/unix-88/VT100.c +++ b/bootstrap/unix-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/VT100.h b/bootstrap/unix-88/VT100.h index 69601701..d4387f75 100644 --- a/bootstrap/unix-88/VT100.h +++ b/bootstrap/unix-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index 0b3a981e..83030d15 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index 36571c99..0a7aceb7 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/Compiler.c b/bootstrap/windows-48/Compiler.c index 65da2216..39819e0a 100644 --- a/bootstrap/windows-48/Compiler.c +++ b/bootstrap/windows-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index 77782293..e391cd31 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index 438fec28..5d106305 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index b4133ede..1193b13c 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index 7aaa4f5a..7571e510 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index c9adb169..0e9118e3 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -68,7 +68,8 @@ static INT32 Heap_freeList[10]; static INT32 Heap_bigBlocks; export INT32 Heap_allocated; static BOOLEAN Heap_firstTry; -static INT32 Heap_heap, Heap_heapNegMin, Heap_heapNegMax, Heap_heapPosMin, Heap_heapPosMax; +export INT32 Heap_heap; +static INT32 Heap_heapNegMin, Heap_heapNegMax, Heap_heapPosMin, Heap_heapPosMax; export INT32 Heap_heapsize; static Heap_FinNode Heap_fin; static INT16 Heap_lockdepth; diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index 0df71d54..62f61978 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h @@ -46,7 +46,9 @@ typedef import SYSTEM_PTR Heap_modules; -import INT32 Heap_allocated, Heap_heapsize; +import INT32 Heap_allocated; +import INT32 Heap_heap; +import INT32 Heap_heapsize; import INT16 Heap_FileCount; import ADDRESS *Heap_ModuleDesc__typ; diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index 6d8570ec..e5fe836e 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index 3c1c580d..89339f66 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index 7e558357..b5c4fd7d 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index b6d457bd..20372132 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index c09d2e6a..7848592a 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index 7c47ed18..dff5b7ca 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index a3718f79..8017c2e7 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -495,6 +495,10 @@ void OPM_Get (CHAR *ch) OPM_LogWNum((INT16)*ch, 1); OPM_LogW('.'); Texts_DumpReader(OPM_inR); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Heap dump:", 11); + OPM_LogWLn(); + Out_DumpHeap(); } if ((*ch < 0x09 && !OPM_inR.eot)) { *ch = ' '; diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index 6d2755d8..59190332 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index 5924f42f..d8d05354 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index c13a4e91..efff1781 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index ed3ea3a1..2d0304d5 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index 6dae098c..e54474bc 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 6b6144fc..c9f40056 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index 00094b66..d2ca1fae 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index 7e829aa2..5597b3e3 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index f83e65fb..4e3573c7 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Out.c b/bootstrap/windows-48/Out.c index f792315a..f215ffaf 100644 --- a/bootstrap/windows-48/Out.c +++ b/bootstrap/windows-48/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -14,10 +14,14 @@ export BOOLEAN Out_IsConsole; static CHAR Out_buf[128]; static INT16 Out_in; -static ADDRESS *typedesc__5__typ; +static ADDRESS *typedesc__11__typ; +static ADDRESS *blockdesc__5__typ; +static ADDRESS *chunkdesc__7__typ; export void Out_Char (CHAR ch); +export void Out_DumpHeap (void); static void Out_DumpModule (Heap_Module m); +export void Out_DumpTag (INT32 addr); export void Out_DumpType (SYSTEM_BYTE *o, ADDRESS o__len); export void Out_Flush (void); export void Out_Hex (INT64 x, INT64 n); @@ -36,6 +40,8 @@ static void Out_digit (INT64 n, CHAR *s, ADDRESS s__len, INT16 *i); static void Out_prepend (CHAR *t, ADDRESS t__len, CHAR *s, ADDRESS s__len, INT16 *i); #define Out_Entier64(x) (INT64)(x) +extern ADDRESS Heap_heap; +#define Out_getheap() Heap_heap void Out_Flush (void) { @@ -209,93 +215,180 @@ void Out_HexDump (SYSTEM_BYTE *m, ADDRESS m__len) static void Out_DumpModule (Heap_Module m) { - Out_String((CHAR*)" next: ", 13); + Out_String((CHAR*)" next: ", 19); Out_Hex((INT32)(ADDRESS)m->next, 1); Out_Ln(); - Out_String((CHAR*)" name: ", 13); + Out_String((CHAR*)" name: ", 19); Out_String(m->name, 20); Out_Ln(); - Out_String((CHAR*)" refcnt: ", 13); + Out_String((CHAR*)" refcnt: ", 19); Out_Hex(m->refcnt, 1); Out_Ln(); - Out_String((CHAR*)" cmds: ", 13); + Out_String((CHAR*)" cmds: ", 19); Out_Hex((INT32)(ADDRESS)m->cmds, 1); Out_Ln(); - Out_String((CHAR*)" types: ", 13); + Out_String((CHAR*)" types: ", 19); Out_Hex(m->types, 1); Out_Ln(); - Out_String((CHAR*)" enumPtrs: ", 13); + Out_String((CHAR*)" enumPtrs: ", 19); Out_Hex((INT32)(ADDRESS)m->enumPtrs, 1); Out_Ln(); } typedef - struct typedesc__5 *tag__4; + struct typedesc__11 *tag__10; typedef - struct typedesc__5 { + struct typedesc__11 { INT32 tag, next, level, module; CHAR name[24]; INT32 bases[16]; INT32 reserved, blksz, ptr0; - } typedesc__5; + } typedesc__11; -void Out_DumpType (SYSTEM_BYTE *o, ADDRESS o__len) +void Out_DumpTag (INT32 addr) { - INT32 addr; - tag__4 desc = NIL; + tag__10 desc = NIL; INT16 i; - __GET((ADDRESS)o - 4, addr, INT32); - Out_String((CHAR*)"obj tag: ", 11); + Out_String((CHAR*)" obj tag: ", 17); Out_Hex(addr, 1); Out_Ln(); addr -= __MASK(addr, -2); - desc = (tag__4)(ADDRESS)(addr - 108); - Out_String((CHAR*)"desc at: ", 11); + desc = (tag__10)(ADDRESS)(addr - 108); + Out_String((CHAR*)" desc at: ", 17); Out_Hex((INT32)(ADDRESS)desc, 1); Out_Ln(); - Out_String((CHAR*)"desc contains:", 15); + Out_String((CHAR*)" desc contains:", 21); Out_Ln(); - Out_String((CHAR*)"tag: ", 11); + Out_String((CHAR*)" tag: ", 17); Out_Hex(desc->tag, 1); Out_Ln(); - Out_String((CHAR*)"next: ", 11); + Out_String((CHAR*)" next: ", 17); Out_Hex(desc->next, 1); Out_Ln(); - Out_String((CHAR*)"level: ", 11); + Out_String((CHAR*)" level: ", 17); Out_Hex(desc->level, 1); Out_Ln(); - Out_String((CHAR*)"module: ", 11); + Out_String((CHAR*)" module: ", 17); Out_Hex(desc->module, 1); Out_Ln(); - Out_DumpModule((Heap_Module)(ADDRESS)desc->module); - Out_String((CHAR*)"name: ", 11); + if (desc->module != 0) { + Out_DumpModule((Heap_Module)(ADDRESS)desc->module); + } + Out_String((CHAR*)" name: ", 17); Out_String(desc->name, 24); Out_Ln(); - Out_String((CHAR*)"bases: ", 11); + Out_String((CHAR*)" bases: ", 17); i = 0; while (i < 16) { Out_Hex(desc->bases[__X(i, 16)], 8); if (__MASK(i, -4) == 3) { Out_Ln(); - Out_String((CHAR*)" ", 11); + Out_String((CHAR*)" ", 17); } else { Out_Char(' '); } i += 1; } Out_Ln(); - Out_String((CHAR*)"reserved: ", 11); + Out_String((CHAR*)" reserved: ", 17); Out_Hex(desc->reserved, 1); Out_Ln(); - Out_String((CHAR*)"blksz: ", 11); + Out_String((CHAR*)" blksz: ", 17); Out_Hex(desc->blksz, 1); Out_Ln(); - Out_String((CHAR*)"ptr0: ", 11); + Out_String((CHAR*)" ptr0: ", 17); Out_Hex(desc->ptr0, 1); Out_Ln(); } +void Out_DumpType (SYSTEM_BYTE *o, ADDRESS o__len) +{ + INT32 addr; + __GET((ADDRESS)o - 4, addr, INT32); + Out_DumpTag(addr); +} + +typedef + INT32 (*adrptr__3)[1]; + +typedef + struct blockdesc__5 *block__4; + +typedef + struct blockdesc__5 { + INT32 tag, size, sentinel, next; + } blockdesc__5; + +typedef + struct chunkdesc__7 *chunk__6; + +typedef + struct chunkdesc__7 { + INT32 next, end, reserved; + blockdesc__5 firstblock; + } chunkdesc__7; + +void Out_DumpHeap (void) +{ + INT32 caddr; + chunk__6 c = NIL; + INT32 baddr; + block__4 b = NIL; + adrptr__3 tag = NIL; + caddr = Heap_heap; + while (caddr != 0) { + Out_String((CHAR*)"Chunk at: ", 11); + Out_Hex(caddr, 1); + Out_Ln(); + c = (chunk__6)(ADDRESS)caddr; + Out_String((CHAR*)" next: ", 11); + Out_Hex(c->next, 1); + Out_Ln(); + Out_String((CHAR*)" end: ", 11); + Out_Hex(c->end, 1); + Out_String((CHAR*)" => size: ", 11); + Out_Hex(c->end - caddr, 1); + Out_Ln(); + Out_String((CHAR*)" rsvd: ", 11); + Out_Hex(c->reserved, 1); + Out_Ln(); + baddr = (ADDRESS)&c->firstblock; + while (baddr < c->end) { + Out_String((CHAR*)" Block at: ", 15); + Out_Hex(baddr, 1); + Out_Ln(); + b = (block__4)(ADDRESS)baddr; + tag = (adrptr__3)(ADDRESS)b->tag; + Out_String((CHAR*)" tag: ", 15); + Out_Hex(b->tag, 1); + if (__MASK(b->tag, -2) != 0) { + Out_String((CHAR*)" <--- ODD! ---", 15); + } + Out_Ln(); + Out_String((CHAR*)" tag^: ", 15); + Out_Hex((*tag)[0], 1); + Out_Ln(); + Out_String((CHAR*)" size: ", 15); + Out_Hex(b->size, 1); + Out_Ln(); + Out_String((CHAR*)" sentinel: ", 15); + Out_Hex(b->sentinel, 1); + Out_Ln(); + Out_String((CHAR*)" next: ", 15); + Out_Hex(b->next, 1); + Out_Ln(); + if (b->tag != (ADDRESS)&b->size) { + Out_DumpTag(b->tag); + } + baddr += (*tag)[0]; + Out_Ln(); + } + caddr = c->next; + Out_Ln(); + } +} + static void Out_digit (INT64 n, CHAR *s, ADDRESS s__len, INT16 *i) { *i -= 1; @@ -473,7 +566,9 @@ void Out_LongReal (LONGREAL x, INT16 n) Out_RealP(x, n, 1); } -__TDESC(typedesc__5, 1, 0) = {__TDFLDS("typedesc__5", 116), {-4}}; +__TDESC(typedesc__11, 1, 0) = {__TDFLDS("typedesc__11", 116), {-4}}; +__TDESC(blockdesc__5, 1, 0) = {__TDFLDS("blockdesc__5", 16), {-4}}; +__TDESC(chunkdesc__7, 1, 0) = {__TDFLDS("chunkdesc__7", 28), {-4}}; export void *Out__init(void) { @@ -481,10 +576,13 @@ export void *Out__init(void) __MODULE_IMPORT(Heap); __MODULE_IMPORT(Platform); __REGMOD("Out", 0); + __REGCMD("DumpHeap", Out_DumpHeap); __REGCMD("Flush", Out_Flush); __REGCMD("Ln", Out_Ln); __REGCMD("Open", Out_Open); - __INITYP(typedesc__5, typedesc__5, 0); + __INITYP(typedesc__11, typedesc__11, 0); + __INITYP(blockdesc__5, blockdesc__5, 0); + __INITYP(chunkdesc__7, chunkdesc__7, 0); /* BEGIN */ Out_IsConsole = Platform_IsConsole(Platform_StdOut); Out_in = 0; diff --git a/bootstrap/windows-48/Out.h b/bootstrap/windows-48/Out.h index 0b3a93df..80673194 100644 --- a/bootstrap/windows-48/Out.h +++ b/bootstrap/windows-48/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h @@ -10,6 +10,8 @@ import BOOLEAN Out_IsConsole; import void Out_Char (CHAR ch); +import void Out_DumpHeap (void); +import void Out_DumpTag (INT32 addr); import void Out_DumpType (SYSTEM_BYTE *o, ADDRESS o__len); import void Out_Flush (void); import void Out_Hex (INT64 x, INT64 n); diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 661a3ff4..1e35e805 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index 68347c6c..3362fba3 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 0a2d220b..55de7323 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index 0c564f0e..0af8a733 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index ed806db0..909f5e88 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index 93b62826..54ccc184 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index a91fe173..5df0abaa 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index 24dacf51..d7570ee1 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/VT100.c b/bootstrap/windows-48/VT100.c index ed38e4dc..451af631 100644 --- a/bootstrap/windows-48/VT100.c +++ b/bootstrap/windows-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/VT100.h b/bootstrap/windows-48/VT100.h index 69601701..d4387f75 100644 --- a/bootstrap/windows-48/VT100.h +++ b/bootstrap/windows-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index 0b3a981e..83030d15 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index 36571c99..0a7aceb7 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/Compiler.c b/bootstrap/windows-88/Compiler.c index 65da2216..39819e0a 100644 --- a/bootstrap/windows-88/Compiler.c +++ b/bootstrap/windows-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index 77782293..e391cd31 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index 438fec28..5d106305 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 1c505c07..8dce3c01 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 337b30b5..32786d38 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index 3e929c3a..769d2d6b 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -68,7 +68,8 @@ static INT64 Heap_freeList[10]; static INT64 Heap_bigBlocks; export INT64 Heap_allocated; static BOOLEAN Heap_firstTry; -static INT64 Heap_heap, Heap_heapNegMin, Heap_heapNegMax, Heap_heapPosMin, Heap_heapPosMax; +export INT64 Heap_heap; +static INT64 Heap_heapNegMin, Heap_heapNegMax, Heap_heapPosMin, Heap_heapPosMax; export INT64 Heap_heapsize; static Heap_FinNode Heap_fin; static INT16 Heap_lockdepth; diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index b2018428..26424f29 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h @@ -46,7 +46,9 @@ typedef import SYSTEM_PTR Heap_modules; -import INT64 Heap_allocated, Heap_heapsize; +import INT64 Heap_allocated; +import INT64 Heap_heap; +import INT64 Heap_heapsize; import INT16 Heap_FileCount; import ADDRESS *Heap_ModuleDesc__typ; diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 6e92bf1e..d3c5d8d1 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index e5803d29..f82ccfd0 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index 7e558357..b5c4fd7d 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index b6d457bd..20372132 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index c09d2e6a..7848592a 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index 7c47ed18..dff5b7ca 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index e3e6f1fe..faf1ba5e 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -495,6 +495,10 @@ void OPM_Get (CHAR *ch) OPM_LogWNum((INT16)*ch, 1); OPM_LogW('.'); Texts_DumpReader(OPM_inR); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Heap dump:", 11); + OPM_LogWLn(); + Out_DumpHeap(); } if ((*ch < 0x09 && !OPM_inR.eot)) { *ch = ' '; diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index 6d2755d8..59190332 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index dc87be62..94982bd2 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index c13a4e91..efff1781 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index ed3ea3a1..2d0304d5 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index 6dae098c..e54474bc 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index 25e2e7c2..46bd1072 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 00094b66..d2ca1fae 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index c88953f2..a3223212 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index f83e65fb..4e3573c7 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Out.c b/bootstrap/windows-88/Out.c index d0afc5be..e8d8713a 100644 --- a/bootstrap/windows-88/Out.c +++ b/bootstrap/windows-88/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -14,10 +14,14 @@ export BOOLEAN Out_IsConsole; static CHAR Out_buf[128]; static INT16 Out_in; -static ADDRESS *typedesc__5__typ; +static ADDRESS *typedesc__11__typ; +static ADDRESS *blockdesc__5__typ; +static ADDRESS *chunkdesc__7__typ; export void Out_Char (CHAR ch); +export void Out_DumpHeap (void); static void Out_DumpModule (Heap_Module m); +export void Out_DumpTag (INT64 addr); export void Out_DumpType (SYSTEM_BYTE *o, ADDRESS o__len); export void Out_Flush (void); export void Out_Hex (INT64 x, INT64 n); @@ -36,6 +40,8 @@ static void Out_digit (INT64 n, CHAR *s, ADDRESS s__len, INT16 *i); static void Out_prepend (CHAR *t, ADDRESS t__len, CHAR *s, ADDRESS s__len, INT16 *i); #define Out_Entier64(x) (INT64)(x) +extern ADDRESS Heap_heap; +#define Out_getheap() Heap_heap void Out_Flush (void) { @@ -209,93 +215,180 @@ void Out_HexDump (SYSTEM_BYTE *m, ADDRESS m__len) static void Out_DumpModule (Heap_Module m) { - Out_String((CHAR*)" next: ", 13); + Out_String((CHAR*)" next: ", 19); Out_Hex((INT64)(ADDRESS)m->next, 1); Out_Ln(); - Out_String((CHAR*)" name: ", 13); + Out_String((CHAR*)" name: ", 19); Out_String(m->name, 20); Out_Ln(); - Out_String((CHAR*)" refcnt: ", 13); + Out_String((CHAR*)" refcnt: ", 19); Out_Hex(m->refcnt, 1); Out_Ln(); - Out_String((CHAR*)" cmds: ", 13); + Out_String((CHAR*)" cmds: ", 19); Out_Hex((INT64)(ADDRESS)m->cmds, 1); Out_Ln(); - Out_String((CHAR*)" types: ", 13); + Out_String((CHAR*)" types: ", 19); Out_Hex(m->types, 1); Out_Ln(); - Out_String((CHAR*)" enumPtrs: ", 13); + Out_String((CHAR*)" enumPtrs: ", 19); Out_Hex((INT64)(ADDRESS)m->enumPtrs, 1); Out_Ln(); } typedef - struct typedesc__5 *tag__4; + struct typedesc__11 *tag__10; typedef - struct typedesc__5 { + struct typedesc__11 { INT64 tag, next, level, module; CHAR name[24]; INT64 bases[16]; INT64 reserved, blksz, ptr0; - } typedesc__5; + } typedesc__11; -void Out_DumpType (SYSTEM_BYTE *o, ADDRESS o__len) +void Out_DumpTag (INT64 addr) { - INT64 addr; - tag__4 desc = NIL; + tag__10 desc = NIL; INT16 i; - __GET((ADDRESS)o - 8, addr, INT64); - Out_String((CHAR*)"obj tag: ", 11); + Out_String((CHAR*)" obj tag: ", 17); Out_Hex(addr, 1); Out_Ln(); addr -= __MASK(addr, -2); - desc = (tag__4)(ADDRESS)(addr - 192); - Out_String((CHAR*)"desc at: ", 11); + desc = (tag__10)(ADDRESS)(addr - 192); + Out_String((CHAR*)" desc at: ", 17); Out_Hex((INT64)(ADDRESS)desc, 1); Out_Ln(); - Out_String((CHAR*)"desc contains:", 15); + Out_String((CHAR*)" desc contains:", 21); Out_Ln(); - Out_String((CHAR*)"tag: ", 11); + Out_String((CHAR*)" tag: ", 17); Out_Hex(desc->tag, 1); Out_Ln(); - Out_String((CHAR*)"next: ", 11); + Out_String((CHAR*)" next: ", 17); Out_Hex(desc->next, 1); Out_Ln(); - Out_String((CHAR*)"level: ", 11); + Out_String((CHAR*)" level: ", 17); Out_Hex(desc->level, 1); Out_Ln(); - Out_String((CHAR*)"module: ", 11); + Out_String((CHAR*)" module: ", 17); Out_Hex(desc->module, 1); Out_Ln(); - Out_DumpModule((Heap_Module)(ADDRESS)desc->module); - Out_String((CHAR*)"name: ", 11); + if (desc->module != 0) { + Out_DumpModule((Heap_Module)(ADDRESS)desc->module); + } + Out_String((CHAR*)" name: ", 17); Out_String(desc->name, 24); Out_Ln(); - Out_String((CHAR*)"bases: ", 11); + Out_String((CHAR*)" bases: ", 17); i = 0; while (i < 16) { Out_Hex(desc->bases[__X(i, 16)], 16); if (__MASK(i, -4) == 3) { Out_Ln(); - Out_String((CHAR*)" ", 11); + Out_String((CHAR*)" ", 17); } else { Out_Char(' '); } i += 1; } Out_Ln(); - Out_String((CHAR*)"reserved: ", 11); + Out_String((CHAR*)" reserved: ", 17); Out_Hex(desc->reserved, 1); Out_Ln(); - Out_String((CHAR*)"blksz: ", 11); + Out_String((CHAR*)" blksz: ", 17); Out_Hex(desc->blksz, 1); Out_Ln(); - Out_String((CHAR*)"ptr0: ", 11); + Out_String((CHAR*)" ptr0: ", 17); Out_Hex(desc->ptr0, 1); Out_Ln(); } +void Out_DumpType (SYSTEM_BYTE *o, ADDRESS o__len) +{ + INT64 addr; + __GET((ADDRESS)o - 8, addr, INT64); + Out_DumpTag(addr); +} + +typedef + INT64 (*adrptr__3)[1]; + +typedef + struct blockdesc__5 *block__4; + +typedef + struct blockdesc__5 { + INT64 tag, size, sentinel, next; + } blockdesc__5; + +typedef + struct chunkdesc__7 *chunk__6; + +typedef + struct chunkdesc__7 { + INT64 next, end, reserved; + blockdesc__5 firstblock; + } chunkdesc__7; + +void Out_DumpHeap (void) +{ + INT64 caddr; + chunk__6 c = NIL; + INT64 baddr; + block__4 b = NIL; + adrptr__3 tag = NIL; + caddr = Heap_heap; + while (caddr != 0) { + Out_String((CHAR*)"Chunk at: ", 11); + Out_Hex(caddr, 1); + Out_Ln(); + c = (chunk__6)(ADDRESS)caddr; + Out_String((CHAR*)" next: ", 11); + Out_Hex(c->next, 1); + Out_Ln(); + Out_String((CHAR*)" end: ", 11); + Out_Hex(c->end, 1); + Out_String((CHAR*)" => size: ", 11); + Out_Hex(c->end - caddr, 1); + Out_Ln(); + Out_String((CHAR*)" rsvd: ", 11); + Out_Hex(c->reserved, 1); + Out_Ln(); + baddr = (ADDRESS)&c->firstblock; + while (baddr < c->end) { + Out_String((CHAR*)" Block at: ", 15); + Out_Hex(baddr, 1); + Out_Ln(); + b = (block__4)(ADDRESS)baddr; + tag = (adrptr__3)(ADDRESS)b->tag; + Out_String((CHAR*)" tag: ", 15); + Out_Hex(b->tag, 1); + if (__MASK(b->tag, -2) != 0) { + Out_String((CHAR*)" <--- ODD! ---", 15); + } + Out_Ln(); + Out_String((CHAR*)" tag^: ", 15); + Out_Hex((*tag)[0], 1); + Out_Ln(); + Out_String((CHAR*)" size: ", 15); + Out_Hex(b->size, 1); + Out_Ln(); + Out_String((CHAR*)" sentinel: ", 15); + Out_Hex(b->sentinel, 1); + Out_Ln(); + Out_String((CHAR*)" next: ", 15); + Out_Hex(b->next, 1); + Out_Ln(); + if (b->tag != (ADDRESS)&b->size) { + Out_DumpTag(b->tag); + } + baddr += (*tag)[0]; + Out_Ln(); + } + caddr = c->next; + Out_Ln(); + } +} + static void Out_digit (INT64 n, CHAR *s, ADDRESS s__len, INT16 *i) { *i -= 1; @@ -473,7 +566,9 @@ void Out_LongReal (LONGREAL x, INT16 n) Out_RealP(x, n, 1); } -__TDESC(typedesc__5, 1, 0) = {__TDFLDS("typedesc__5", 208), {-8}}; +__TDESC(typedesc__11, 1, 0) = {__TDFLDS("typedesc__11", 208), {-8}}; +__TDESC(blockdesc__5, 1, 0) = {__TDFLDS("blockdesc__5", 32), {-8}}; +__TDESC(chunkdesc__7, 1, 0) = {__TDFLDS("chunkdesc__7", 56), {-8}}; export void *Out__init(void) { @@ -481,10 +576,13 @@ export void *Out__init(void) __MODULE_IMPORT(Heap); __MODULE_IMPORT(Platform); __REGMOD("Out", 0); + __REGCMD("DumpHeap", Out_DumpHeap); __REGCMD("Flush", Out_Flush); __REGCMD("Ln", Out_Ln); __REGCMD("Open", Out_Open); - __INITYP(typedesc__5, typedesc__5, 0); + __INITYP(typedesc__11, typedesc__11, 0); + __INITYP(blockdesc__5, blockdesc__5, 0); + __INITYP(chunkdesc__7, chunkdesc__7, 0); /* BEGIN */ Out_IsConsole = Platform_IsConsole(Platform_StdOut); Out_in = 0; diff --git a/bootstrap/windows-88/Out.h b/bootstrap/windows-88/Out.h index 0126ef62..42ae59ed 100644 --- a/bootstrap/windows-88/Out.h +++ b/bootstrap/windows-88/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h @@ -10,6 +10,8 @@ import BOOLEAN Out_IsConsole; import void Out_Char (CHAR ch); +import void Out_DumpHeap (void); +import void Out_DumpTag (INT64 addr); import void Out_DumpType (SYSTEM_BYTE *o, ADDRESS o__len); import void Out_Flush (void); import void Out_Hex (INT64 x, INT64 n); diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 59a4d3a4..53d2232c 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index 787e2dc2..e2b27d76 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 0a2d220b..55de7323 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index 0c564f0e..0af8a733 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index ed806db0..909f5e88 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index 93b62826..54ccc184 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index bd19d27b..6447e8ae 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index 2cf87339..ff036fdd 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/VT100.c b/bootstrap/windows-88/VT100.c index ed38e4dc..451af631 100644 --- a/bootstrap/windows-88/VT100.c +++ b/bootstrap/windows-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/VT100.h b/bootstrap/windows-88/VT100.h index 69601701..d4387f75 100644 --- a/bootstrap/windows-88/VT100.h +++ b/bootstrap/windows-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index 0b3a981e..83030d15 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index 36571c99..0a7aceb7 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h From 30bae1a62271f4c4a131d75d8f0675c2778c308c Mon Sep 17 00:00:00 2001 From: David Brown Date: Tue, 13 Dec 2016 18:42:16 +0000 Subject: [PATCH 426/580] Fix dump of chunk that crosses +ve to -ve address. Could this be the underlying issue in Heap? --- src/runtime/Out.Mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runtime/Out.Mod b/src/runtime/Out.Mod index 63a22ada..c338fb16 100644 --- a/src/runtime/Out.Mod +++ b/src/runtime/Out.Mod @@ -210,7 +210,7 @@ BEGIN String(" rsvd: "); Hex(c.reserved, 1); Ln; baddr := SYSTEM.ADR(c.firstblock); - WHILE baddr < c.end DO + WHILE c.end - baddr > 0 DO String(" Block at: "); Hex(baddr, 1); Ln; b := SYSTEM.VAL(block, baddr); tag := SYSTEM.VAL(adrptr, b.tag); From d4c5d6397892813003822f28890a77be73b4ed47 Mon Sep 17 00:00:00 2001 From: David Brown Date: Tue, 13 Dec 2016 18:43:20 +0000 Subject: [PATCH 427/580] Update bootstrap C sources. --- bootstrap/unix-44/Out.c | 2 +- bootstrap/unix-48/Out.c | 2 +- bootstrap/unix-88/Out.c | 2 +- bootstrap/windows-48/Out.c | 2 +- bootstrap/windows-88/Out.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/bootstrap/unix-44/Out.c b/bootstrap/unix-44/Out.c index dc9ab60c..090b2c81 100644 --- a/bootstrap/unix-44/Out.c +++ b/bootstrap/unix-44/Out.c @@ -354,7 +354,7 @@ void Out_DumpHeap (void) Out_Hex(c->reserved, 1); Out_Ln(); baddr = (ADDRESS)&c->firstblock; - while (baddr < c->end) { + while (c->end - baddr > 0) { Out_String((CHAR*)" Block at: ", 15); Out_Hex(baddr, 1); Out_Ln(); diff --git a/bootstrap/unix-48/Out.c b/bootstrap/unix-48/Out.c index dc9ab60c..090b2c81 100644 --- a/bootstrap/unix-48/Out.c +++ b/bootstrap/unix-48/Out.c @@ -354,7 +354,7 @@ void Out_DumpHeap (void) Out_Hex(c->reserved, 1); Out_Ln(); baddr = (ADDRESS)&c->firstblock; - while (baddr < c->end) { + while (c->end - baddr > 0) { Out_String((CHAR*)" Block at: ", 15); Out_Hex(baddr, 1); Out_Ln(); diff --git a/bootstrap/unix-88/Out.c b/bootstrap/unix-88/Out.c index 5b315327..d0223799 100644 --- a/bootstrap/unix-88/Out.c +++ b/bootstrap/unix-88/Out.c @@ -354,7 +354,7 @@ void Out_DumpHeap (void) Out_Hex(c->reserved, 1); Out_Ln(); baddr = (ADDRESS)&c->firstblock; - while (baddr < c->end) { + while (c->end - baddr > 0) { Out_String((CHAR*)" Block at: ", 15); Out_Hex(baddr, 1); Out_Ln(); diff --git a/bootstrap/windows-48/Out.c b/bootstrap/windows-48/Out.c index f215ffaf..ef5d74e5 100644 --- a/bootstrap/windows-48/Out.c +++ b/bootstrap/windows-48/Out.c @@ -354,7 +354,7 @@ void Out_DumpHeap (void) Out_Hex(c->reserved, 1); Out_Ln(); baddr = (ADDRESS)&c->firstblock; - while (baddr < c->end) { + while (c->end - baddr > 0) { Out_String((CHAR*)" Block at: ", 15); Out_Hex(baddr, 1); Out_Ln(); diff --git a/bootstrap/windows-88/Out.c b/bootstrap/windows-88/Out.c index e8d8713a..bbb5de28 100644 --- a/bootstrap/windows-88/Out.c +++ b/bootstrap/windows-88/Out.c @@ -354,7 +354,7 @@ void Out_DumpHeap (void) Out_Hex(c->reserved, 1); Out_Ln(); baddr = (ADDRESS)&c->firstblock; - while (baddr < c->end) { + while (c->end - baddr > 0) { Out_String((CHAR*)" Block at: ", 15); Out_Hex(baddr, 1); Out_Ln(); From 85eeef6ae408f8fc80e58feb57ec6ea401649f46 Mon Sep 17 00:00:00 2001 From: David Brown Date: Tue, 13 Dec 2016 18:52:42 +0000 Subject: [PATCH 428/580] Supportix dump of block with uncleared GC flag in bit 0 of tag. --- src/runtime/Out.Mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runtime/Out.Mod b/src/runtime/Out.Mod index c338fb16..26decdb1 100644 --- a/src/runtime/Out.Mod +++ b/src/runtime/Out.Mod @@ -213,7 +213,7 @@ BEGIN WHILE c.end - baddr > 0 DO String(" Block at: "); Hex(baddr, 1); Ln; b := SYSTEM.VAL(block, baddr); - tag := SYSTEM.VAL(adrptr, b.tag); + tag := SYSTEM.VAL(adrptr, b.tag - (b.tag MOD 2)); (* mask out heap management flag in bit 0. *) String(" tag: "); Hex(b.tag, 1); IF b.tag MOD 2 # 0 THEN String(" <--- ODD! ---") END; Ln; String(" tag^: "); Hex(tag^[0], 1); Ln; String(" size: "); Hex(b.size, 1); Ln; From 6507b4ede37e6e9704cc37299034c2fe48478d56 Mon Sep 17 00:00:00 2001 From: David Brown Date: Tue, 13 Dec 2016 18:53:34 +0000 Subject: [PATCH 429/580] Update bootstrap C sources. --- bootstrap/unix-44/Out.c | 2 +- bootstrap/unix-48/Out.c | 2 +- bootstrap/unix-88/Out.c | 2 +- bootstrap/windows-48/Out.c | 2 +- bootstrap/windows-88/Out.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/bootstrap/unix-44/Out.c b/bootstrap/unix-44/Out.c index 090b2c81..b877f0bd 100644 --- a/bootstrap/unix-44/Out.c +++ b/bootstrap/unix-44/Out.c @@ -359,7 +359,7 @@ void Out_DumpHeap (void) Out_Hex(baddr, 1); Out_Ln(); b = (block__4)(ADDRESS)baddr; - tag = (adrptr__3)(ADDRESS)b->tag; + tag = (adrptr__3)(ADDRESS)(b->tag - __MASK(b->tag, -2)); Out_String((CHAR*)" tag: ", 15); Out_Hex(b->tag, 1); if (__MASK(b->tag, -2) != 0) { diff --git a/bootstrap/unix-48/Out.c b/bootstrap/unix-48/Out.c index 090b2c81..b877f0bd 100644 --- a/bootstrap/unix-48/Out.c +++ b/bootstrap/unix-48/Out.c @@ -359,7 +359,7 @@ void Out_DumpHeap (void) Out_Hex(baddr, 1); Out_Ln(); b = (block__4)(ADDRESS)baddr; - tag = (adrptr__3)(ADDRESS)b->tag; + tag = (adrptr__3)(ADDRESS)(b->tag - __MASK(b->tag, -2)); Out_String((CHAR*)" tag: ", 15); Out_Hex(b->tag, 1); if (__MASK(b->tag, -2) != 0) { diff --git a/bootstrap/unix-88/Out.c b/bootstrap/unix-88/Out.c index d0223799..1087252f 100644 --- a/bootstrap/unix-88/Out.c +++ b/bootstrap/unix-88/Out.c @@ -359,7 +359,7 @@ void Out_DumpHeap (void) Out_Hex(baddr, 1); Out_Ln(); b = (block__4)(ADDRESS)baddr; - tag = (adrptr__3)(ADDRESS)b->tag; + tag = (adrptr__3)(ADDRESS)(b->tag - __MASK(b->tag, -2)); Out_String((CHAR*)" tag: ", 15); Out_Hex(b->tag, 1); if (__MASK(b->tag, -2) != 0) { diff --git a/bootstrap/windows-48/Out.c b/bootstrap/windows-48/Out.c index ef5d74e5..4c3ea533 100644 --- a/bootstrap/windows-48/Out.c +++ b/bootstrap/windows-48/Out.c @@ -359,7 +359,7 @@ void Out_DumpHeap (void) Out_Hex(baddr, 1); Out_Ln(); b = (block__4)(ADDRESS)baddr; - tag = (adrptr__3)(ADDRESS)b->tag; + tag = (adrptr__3)(ADDRESS)(b->tag - __MASK(b->tag, -2)); Out_String((CHAR*)" tag: ", 15); Out_Hex(b->tag, 1); if (__MASK(b->tag, -2) != 0) { diff --git a/bootstrap/windows-88/Out.c b/bootstrap/windows-88/Out.c index bbb5de28..39c1e9f9 100644 --- a/bootstrap/windows-88/Out.c +++ b/bootstrap/windows-88/Out.c @@ -359,7 +359,7 @@ void Out_DumpHeap (void) Out_Hex(baddr, 1); Out_Ln(); b = (block__4)(ADDRESS)baddr; - tag = (adrptr__3)(ADDRESS)b->tag; + tag = (adrptr__3)(ADDRESS)(b->tag - __MASK(b->tag, -2)); Out_String((CHAR*)" tag: ", 15); Out_Hex(b->tag, 1); if (__MASK(b->tag, -2) != 0) { From 41a239c5aabb807d888ed3b9a93fba887660735c Mon Sep 17 00:00:00 2001 From: David Brown Date: Tue, 13 Dec 2016 20:15:29 +0000 Subject: [PATCH 430/580] Fix heap address comparisons for sign crossing. --- src/runtime/Heap.Mod | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/runtime/Heap.Mod b/src/runtime/Heap.Mod index bdb0bc59..11b1b116 100644 --- a/src/runtime/Heap.Mod +++ b/src/runtime/Heap.Mod @@ -224,7 +224,7 @@ MODULE Heap; S.PUT(chnk, heap); heap := chnk ELSE j := heap; S.GET(j, next); - WHILE (next # 0) & (chnk > next) DO + WHILE (next # 0) & (chnk - next > 0) DO j := next; S.GET(j, next) END; @@ -311,7 +311,7 @@ MODULE Heap; INC(adr, restsize) END ; i := adr + 4*SZA; end := adr + blksz; - WHILE i < end DO (*deliberately unrolled*) + WHILE end - i > 0 DO (*deliberately unrolled*) S.PUT(i, AddressZero); S.PUT(i + SZA, AddressZero); S.PUT(i + 2*SZA, AddressZero); @@ -393,7 +393,7 @@ MODULE Heap; WHILE chnk # 0 DO adr := chnk + blkOff; S.GET(chnk + endOff, end); - WHILE adr < end DO + WHILE end - adr > 0 DO S.GET(adr, tag); IF ODD(tag) THEN (*marked*) IF freesize > 0 THEN @@ -453,21 +453,21 @@ MODULE Heap; VAR chnk, adr, tag, next, lim, lim1, i, ptr, size: S.ADDRESS; BEGIN chnk := heap; i := 0; lim := cand[n-1]; - WHILE (chnk # 0 ) & (chnk < lim) DO + WHILE (chnk # 0 ) & (lim - chnk > 0) DO adr := chnk + blkOff; S.GET(chnk + endOff, lim1); - IF lim < lim1 THEN lim1 := lim END ; - WHILE adr < lim1 DO + IF lim1 - lim > 0 THEN lim1 := lim END ; + WHILE lim1 - adr > 0 DO S.GET(adr, tag); IF ODD(tag) THEN (*already marked*) S.GET(tag-1, size); INC(adr, size) ELSE S.GET(tag, size); ptr := adr + SZA; - WHILE cand[i] < ptr DO INC(i) END ; + WHILE ptr - cand[i] > 0 DO INC(i) END ; IF i = n THEN RETURN END ; next := adr + size; - IF cand[i] < next THEN Mark(ptr) END ; + IF next - cand[i] > 0 THEN Mark(ptr) END ; adr := next END END ; @@ -530,7 +530,7 @@ MODULE Heap; stack0 := ModulesMainStackFrame(); (* check for minimum alignment of pointers *) inc := S.ADR(align.p) - S.ADR(align); - IF sp > stack0 THEN inc := -inc END ; + IF sp - stack0 > 0 THEN inc := -inc END ; WHILE sp # stack0 DO S.GET(sp, p); IF (p > 0) & (p >= heapPosMin) & (p < heapPosMax) From 1e9c1af8ef97c3105ceceb42e234fd4b3386e042 Mon Sep 17 00:00:00 2001 From: David Brown Date: Tue, 13 Dec 2016 20:16:38 +0000 Subject: [PATCH 431/580] Update bootstrap C sources. --- bootstrap/unix-44/Heap.c | 18 +++++++++--------- bootstrap/unix-48/Heap.c | 18 +++++++++--------- bootstrap/unix-88/Heap.c | 18 +++++++++--------- bootstrap/windows-48/Heap.c | 18 +++++++++--------- bootstrap/windows-88/Heap.c | 18 +++++++++--------- 5 files changed, 45 insertions(+), 45 deletions(-) diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index 0e9118e3..6728cb4d 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -248,7 +248,7 @@ static void Heap_ExtendHeap (INT32 blksz) } else { j = Heap_heap; __GET(j, next, INT32); - while ((next != 0 && chnk > next)) { + while ((next != 0 && chnk - next > 0)) { j = next; __GET(j, next, INT32); } @@ -345,7 +345,7 @@ SYSTEM_PTR Heap_NEWREC (INT32 tag) } i = adr + 16; end = adr + blksz; - while (i < end) { + while (end - i > 0) { __PUT(i, 0, INT32); __PUT(i + 4, 0, INT32); __PUT(i + 8, 0, INT32); @@ -442,7 +442,7 @@ static void Heap_Scan (void) while (chnk != 0) { adr = chnk + 12; __GET(chnk + 4, end, INT32); - while (adr < end) { + while (end - adr > 0) { __GET(adr, tag, INT32); if (__ODD(tag)) { if (freesize > 0) { @@ -533,13 +533,13 @@ static void Heap_MarkCandidates (INT32 n, INT32 *cand, ADDRESS cand__len) chnk = Heap_heap; i = 0; lim = cand[n - 1]; - while ((chnk != 0 && chnk < lim)) { + while ((chnk != 0 && lim - chnk > 0)) { adr = chnk + 12; __GET(chnk + 4, lim1, INT32); - if (lim < lim1) { + if (lim1 - lim > 0) { lim1 = lim; } - while (adr < lim1) { + while (lim1 - adr > 0) { __GET(adr, tag, INT32); if (__ODD(tag)) { __GET(tag - 1, size, INT32); @@ -547,14 +547,14 @@ static void Heap_MarkCandidates (INT32 n, INT32 *cand, ADDRESS cand__len) } else { __GET(tag, size, INT32); ptr = adr + 4; - while (cand[i] < ptr) { + while (ptr - cand[i] > 0) { i += 1; } if (i == n) { return; } next = adr + size; - if (cand[i] < next) { + if (next - cand[i] > 0) { Heap_Mark(ptr); } adr = next; @@ -632,7 +632,7 @@ static void Heap_MarkStack (INT32 n, INT32 *cand, ADDRESS cand__len) sp = (ADDRESS)&frame; stack0 = Heap_ModulesMainStackFrame(); inc = (ADDRESS)&align.p - (ADDRESS)&align; - if (sp > stack0) { + if (sp - stack0 > 0) { inc = -inc; } while (sp != stack0) { diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index 0e9118e3..6728cb4d 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -248,7 +248,7 @@ static void Heap_ExtendHeap (INT32 blksz) } else { j = Heap_heap; __GET(j, next, INT32); - while ((next != 0 && chnk > next)) { + while ((next != 0 && chnk - next > 0)) { j = next; __GET(j, next, INT32); } @@ -345,7 +345,7 @@ SYSTEM_PTR Heap_NEWREC (INT32 tag) } i = adr + 16; end = adr + blksz; - while (i < end) { + while (end - i > 0) { __PUT(i, 0, INT32); __PUT(i + 4, 0, INT32); __PUT(i + 8, 0, INT32); @@ -442,7 +442,7 @@ static void Heap_Scan (void) while (chnk != 0) { adr = chnk + 12; __GET(chnk + 4, end, INT32); - while (adr < end) { + while (end - adr > 0) { __GET(adr, tag, INT32); if (__ODD(tag)) { if (freesize > 0) { @@ -533,13 +533,13 @@ static void Heap_MarkCandidates (INT32 n, INT32 *cand, ADDRESS cand__len) chnk = Heap_heap; i = 0; lim = cand[n - 1]; - while ((chnk != 0 && chnk < lim)) { + while ((chnk != 0 && lim - chnk > 0)) { adr = chnk + 12; __GET(chnk + 4, lim1, INT32); - if (lim < lim1) { + if (lim1 - lim > 0) { lim1 = lim; } - while (adr < lim1) { + while (lim1 - adr > 0) { __GET(adr, tag, INT32); if (__ODD(tag)) { __GET(tag - 1, size, INT32); @@ -547,14 +547,14 @@ static void Heap_MarkCandidates (INT32 n, INT32 *cand, ADDRESS cand__len) } else { __GET(tag, size, INT32); ptr = adr + 4; - while (cand[i] < ptr) { + while (ptr - cand[i] > 0) { i += 1; } if (i == n) { return; } next = adr + size; - if (cand[i] < next) { + if (next - cand[i] > 0) { Heap_Mark(ptr); } adr = next; @@ -632,7 +632,7 @@ static void Heap_MarkStack (INT32 n, INT32 *cand, ADDRESS cand__len) sp = (ADDRESS)&frame; stack0 = Heap_ModulesMainStackFrame(); inc = (ADDRESS)&align.p - (ADDRESS)&align; - if (sp > stack0) { + if (sp - stack0 > 0) { inc = -inc; } while (sp != stack0) { diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index 769d2d6b..6246dc9c 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -248,7 +248,7 @@ static void Heap_ExtendHeap (INT64 blksz) } else { j = Heap_heap; __GET(j, next, INT64); - while ((next != 0 && chnk > next)) { + while ((next != 0 && chnk - next > 0)) { j = next; __GET(j, next, INT64); } @@ -345,7 +345,7 @@ SYSTEM_PTR Heap_NEWREC (INT64 tag) } i = adr + 32; end = adr + blksz; - while (i < end) { + while (end - i > 0) { __PUT(i, 0, INT64); __PUT(i + 8, 0, INT64); __PUT(i + 16, 0, INT64); @@ -442,7 +442,7 @@ static void Heap_Scan (void) while (chnk != 0) { adr = chnk + 24; __GET(chnk + 8, end, INT64); - while (adr < end) { + while (end - adr > 0) { __GET(adr, tag, INT64); if (__ODD(tag)) { if (freesize > 0) { @@ -533,13 +533,13 @@ static void Heap_MarkCandidates (INT64 n, INT64 *cand, ADDRESS cand__len) chnk = Heap_heap; i = 0; lim = cand[n - 1]; - while ((chnk != 0 && chnk < lim)) { + while ((chnk != 0 && lim - chnk > 0)) { adr = chnk + 24; __GET(chnk + 8, lim1, INT64); - if (lim < lim1) { + if (lim1 - lim > 0) { lim1 = lim; } - while (adr < lim1) { + while (lim1 - adr > 0) { __GET(adr, tag, INT64); if (__ODD(tag)) { __GET(tag - 1, size, INT64); @@ -547,14 +547,14 @@ static void Heap_MarkCandidates (INT64 n, INT64 *cand, ADDRESS cand__len) } else { __GET(tag, size, INT64); ptr = adr + 8; - while (cand[i] < ptr) { + while (ptr - cand[i] > 0) { i += 1; } if (i == n) { return; } next = adr + size; - if (cand[i] < next) { + if (next - cand[i] > 0) { Heap_Mark(ptr); } adr = next; @@ -632,7 +632,7 @@ static void Heap_MarkStack (INT64 n, INT64 *cand, ADDRESS cand__len) sp = (ADDRESS)&frame; stack0 = Heap_ModulesMainStackFrame(); inc = (ADDRESS)&align.p - (ADDRESS)&align; - if (sp > stack0) { + if (sp - stack0 > 0) { inc = -inc; } while (sp != stack0) { diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index 0e9118e3..6728cb4d 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -248,7 +248,7 @@ static void Heap_ExtendHeap (INT32 blksz) } else { j = Heap_heap; __GET(j, next, INT32); - while ((next != 0 && chnk > next)) { + while ((next != 0 && chnk - next > 0)) { j = next; __GET(j, next, INT32); } @@ -345,7 +345,7 @@ SYSTEM_PTR Heap_NEWREC (INT32 tag) } i = adr + 16; end = adr + blksz; - while (i < end) { + while (end - i > 0) { __PUT(i, 0, INT32); __PUT(i + 4, 0, INT32); __PUT(i + 8, 0, INT32); @@ -442,7 +442,7 @@ static void Heap_Scan (void) while (chnk != 0) { adr = chnk + 12; __GET(chnk + 4, end, INT32); - while (adr < end) { + while (end - adr > 0) { __GET(adr, tag, INT32); if (__ODD(tag)) { if (freesize > 0) { @@ -533,13 +533,13 @@ static void Heap_MarkCandidates (INT32 n, INT32 *cand, ADDRESS cand__len) chnk = Heap_heap; i = 0; lim = cand[n - 1]; - while ((chnk != 0 && chnk < lim)) { + while ((chnk != 0 && lim - chnk > 0)) { adr = chnk + 12; __GET(chnk + 4, lim1, INT32); - if (lim < lim1) { + if (lim1 - lim > 0) { lim1 = lim; } - while (adr < lim1) { + while (lim1 - adr > 0) { __GET(adr, tag, INT32); if (__ODD(tag)) { __GET(tag - 1, size, INT32); @@ -547,14 +547,14 @@ static void Heap_MarkCandidates (INT32 n, INT32 *cand, ADDRESS cand__len) } else { __GET(tag, size, INT32); ptr = adr + 4; - while (cand[i] < ptr) { + while (ptr - cand[i] > 0) { i += 1; } if (i == n) { return; } next = adr + size; - if (cand[i] < next) { + if (next - cand[i] > 0) { Heap_Mark(ptr); } adr = next; @@ -632,7 +632,7 @@ static void Heap_MarkStack (INT32 n, INT32 *cand, ADDRESS cand__len) sp = (ADDRESS)&frame; stack0 = Heap_ModulesMainStackFrame(); inc = (ADDRESS)&align.p - (ADDRESS)&align; - if (sp > stack0) { + if (sp - stack0 > 0) { inc = -inc; } while (sp != stack0) { diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index 769d2d6b..6246dc9c 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -248,7 +248,7 @@ static void Heap_ExtendHeap (INT64 blksz) } else { j = Heap_heap; __GET(j, next, INT64); - while ((next != 0 && chnk > next)) { + while ((next != 0 && chnk - next > 0)) { j = next; __GET(j, next, INT64); } @@ -345,7 +345,7 @@ SYSTEM_PTR Heap_NEWREC (INT64 tag) } i = adr + 32; end = adr + blksz; - while (i < end) { + while (end - i > 0) { __PUT(i, 0, INT64); __PUT(i + 8, 0, INT64); __PUT(i + 16, 0, INT64); @@ -442,7 +442,7 @@ static void Heap_Scan (void) while (chnk != 0) { adr = chnk + 24; __GET(chnk + 8, end, INT64); - while (adr < end) { + while (end - adr > 0) { __GET(adr, tag, INT64); if (__ODD(tag)) { if (freesize > 0) { @@ -533,13 +533,13 @@ static void Heap_MarkCandidates (INT64 n, INT64 *cand, ADDRESS cand__len) chnk = Heap_heap; i = 0; lim = cand[n - 1]; - while ((chnk != 0 && chnk < lim)) { + while ((chnk != 0 && lim - chnk > 0)) { adr = chnk + 24; __GET(chnk + 8, lim1, INT64); - if (lim < lim1) { + if (lim1 - lim > 0) { lim1 = lim; } - while (adr < lim1) { + while (lim1 - adr > 0) { __GET(adr, tag, INT64); if (__ODD(tag)) { __GET(tag - 1, size, INT64); @@ -547,14 +547,14 @@ static void Heap_MarkCandidates (INT64 n, INT64 *cand, ADDRESS cand__len) } else { __GET(tag, size, INT64); ptr = adr + 8; - while (cand[i] < ptr) { + while (ptr - cand[i] > 0) { i += 1; } if (i == n) { return; } next = adr + size; - if (cand[i] < next) { + if (next - cand[i] > 0) { Heap_Mark(ptr); } adr = next; @@ -632,7 +632,7 @@ static void Heap_MarkStack (INT64 n, INT64 *cand, ADDRESS cand__len) sp = (ADDRESS)&frame; stack0 = Heap_ModulesMainStackFrame(); inc = (ADDRESS)&align.p - (ADDRESS)&align; - if (sp > stack0) { + if (sp - stack0 > 0) { inc = -inc; } while (sp != stack0) { From e85091289e20a18fcb6de7f0d30d6ef25ffca73f Mon Sep 17 00:00:00 2001 From: David Brown Date: Wed, 14 Dec 2016 16:55:16 +0000 Subject: [PATCH 432/580] Fix array assignment size validation to accept equal sizes. --- src/compiler/OPV.Mod | 2 +- src/tools/make/configure.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/compiler/OPV.Mod b/src/compiler/OPV.Mod index c2099cc5..31e07fd9 100644 --- a/src/compiler/OPV.Mod +++ b/src/compiler/OPV.Mod @@ -790,7 +790,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 OPM.WriteString("__X("); OPC.Len(r.obj, r.typ, 0); OPM.WriteString(" * "); OPM.WriteInt(r.typ.BaseTyp.size); OPM.WriteString(", "); - OPM.WriteInt(l.typ.size); + OPM.WriteInt(l.typ.size+1); (* _X vaidates 0 .. n-1 so we need to +1. *) OPM.Write(")") ELSE (* Array to array copy. *) ASSERT(r.typ.comp = OPT.Array); ASSERT(r.typ.size <= l.typ.size); diff --git a/src/tools/make/configure.c b/src/tools/make/configure.c index 5865e3e0..4fde13a3 100644 --- a/src/tools/make/configure.c +++ b/src/tools/make/configure.c @@ -106,7 +106,7 @@ void determineOS() { #ifdef _WIN32 os = "windows"; platform = "windows"; binext = ".exe"; staticlink = ""; #else - os = "unknown"; platform = "unix"; binext = ""; staticlink = "-static"; + os = "unknown"; platform = "unix"; binext = ""; staticlink = " -static"; struct utsname sys; if (uname(&sys)<0) fail("Couldn't get sys name - uname() failed."); From 4a71f43e72389f46454ded01a3d820ce9ac0e6aa Mon Sep 17 00:00:00 2001 From: David Brown Date: Wed, 14 Dec 2016 16:56:57 +0000 Subject: [PATCH 433/580] Update bootstrap C source files. --- bootstrap/unix-44/Compiler.c | 2 +- bootstrap/unix-44/Configuration.c | 4 ++-- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Files.c | 2 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 2 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 2 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 2 +- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 2 +- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 4 ++-- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Out.c | 2 +- bootstrap/unix-44/Out.h | 2 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/VT100.c | 2 +- bootstrap/unix-44/VT100.h | 2 +- bootstrap/unix-44/extTools.c | 4 ++-- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-48/Compiler.c | 2 +- bootstrap/unix-48/Configuration.c | 4 ++-- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Files.c | 2 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 2 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 2 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 2 +- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 2 +- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 4 ++-- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Out.c | 2 +- bootstrap/unix-48/Out.h | 2 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/VT100.c | 2 +- bootstrap/unix-48/VT100.h | 2 +- bootstrap/unix-48/extTools.c | 4 ++-- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-88/Compiler.c | 2 +- bootstrap/unix-88/Configuration.c | 4 ++-- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Files.c | 2 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 2 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 2 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 2 +- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 2 +- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 4 ++-- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Out.c | 2 +- bootstrap/unix-88/Out.h | 2 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/VT100.c | 2 +- bootstrap/unix-88/VT100.h | 2 +- bootstrap/unix-88/extTools.c | 4 ++-- bootstrap/unix-88/extTools.h | 2 +- bootstrap/windows-48/Compiler.c | 2 +- bootstrap/windows-48/Configuration.c | 4 ++-- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Files.c | 2 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 2 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 2 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 2 +- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 2 +- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 4 ++-- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Out.c | 2 +- bootstrap/windows-48/Out.h | 2 +- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/VT100.c | 2 +- bootstrap/windows-48/VT100.h | 2 +- bootstrap/windows-48/extTools.c | 4 ++-- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-88/Compiler.c | 2 +- bootstrap/windows-88/Configuration.c | 4 ++-- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Files.c | 2 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 2 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 2 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 2 +- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 2 +- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 4 ++-- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Out.c | 2 +- bootstrap/windows-88/Out.h | 2 +- bootstrap/windows-88/Platform.c | 2 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/VT100.c | 2 +- bootstrap/windows-88/VT100.h | 2 +- bootstrap/windows-88/extTools.c | 4 ++-- bootstrap/windows-88/extTools.h | 2 +- 185 files changed, 200 insertions(+), 200 deletions(-) diff --git a/bootstrap/unix-44/Compiler.c b/bootstrap/unix-44/Compiler.c index 39819e0a..454ea490 100644 --- a/bootstrap/unix-44/Compiler.c +++ b/bootstrap/unix-44/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index e391cd31..abf165f3 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index 5d106305..eb712e53 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index fb2ee9ee..d29c5510 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index 5b6e66ef..e0812a5b 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index 6728cb4d..495e451c 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index 62f61978..7429d8c8 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index 529aeee2..34c15ece 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index 89339f66..42f06075 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index b5c4fd7d..c163c77e 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index 20372132..7b8e9d38 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 7848592a..fef86e9e 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index dff5b7ca..a2b14bdc 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 8017c2e7..d09d6a7a 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index 59190332..dc86bc49 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index d8d05354..24e6b221 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index efff1781..bf0f96d7 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index 2d0304d5..807c0ce5 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index e54474bc..a15d8712 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index 4d978eb5..b028aa53 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index d2ca1fae..9a187fc7 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index 5597b3e3..96252046 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -1292,7 +1292,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPM_WriteString((CHAR*)" * ", 4); OPM_WriteInt(r->typ->BaseTyp->size); OPM_WriteString((CHAR*)", ", 3); - OPM_WriteInt(l->typ->size); + OPM_WriteInt(l->typ->size + 1); OPM_Write(')'); } else { __ASSERT(r->typ->comp == 2, 0); diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index 4e3573c7..5654d36e 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Out.c b/bootstrap/unix-44/Out.c index b877f0bd..9248cfc5 100644 --- a/bootstrap/unix-44/Out.c +++ b/bootstrap/unix-44/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Out.h b/bootstrap/unix-44/Out.h index 80673194..ffbd6894 100644 --- a/bootstrap/unix-44/Out.h +++ b/bootstrap/unix-44/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 9b35ef5a..027176ed 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index 2b2fba4b..79d88e9d 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 55de7323..2ecd8371 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index 0af8a733..570e7d72 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index 909f5e88..f911a688 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index 54ccc184..7645aa6e 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index bc3411f2..f73006a8 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index 208d1fe8..d1e65c70 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/VT100.c b/bootstrap/unix-44/VT100.c index 451af631..1e0fffa9 100644 --- a/bootstrap/unix-44/VT100.c +++ b/bootstrap/unix-44/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/VT100.h b/bootstrap/unix-44/VT100.h index d4387f75..7522f9d1 100644 --- a/bootstrap/unix-44/VT100.h +++ b/bootstrap/unix-44/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index 83030d15..d2c67400 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -95,7 +95,7 @@ void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN stati Strings_Append((CHAR*)".c ", 4, (void*)cmd, 1023); Strings_Append(additionalopts, additionalopts__len, (void*)cmd, 1023); if (statically) { - Strings_Append((CHAR*)"-static", 8, (void*)cmd, 1023); + Strings_Append((CHAR*)" -static", 9, (void*)cmd, 1023); } Strings_Append((CHAR*)" -o ", 5, (void*)cmd, 1023); Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index 0a7aceb7..fb167591 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/Compiler.c b/bootstrap/unix-48/Compiler.c index 39819e0a..454ea490 100644 --- a/bootstrap/unix-48/Compiler.c +++ b/bootstrap/unix-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index e391cd31..abf165f3 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index 5d106305..eb712e53 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index fb2ee9ee..d29c5510 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index 5b6e66ef..e0812a5b 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index 6728cb4d..495e451c 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index 62f61978..7429d8c8 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index 529aeee2..34c15ece 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index 89339f66..42f06075 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index b5c4fd7d..c163c77e 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index 20372132..7b8e9d38 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 7848592a..fef86e9e 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index dff5b7ca..a2b14bdc 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 8017c2e7..d09d6a7a 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index 59190332..dc86bc49 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index d8d05354..24e6b221 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index efff1781..bf0f96d7 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index 2d0304d5..807c0ce5 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index e54474bc..a15d8712 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index c9f40056..e9db362e 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index d2ca1fae..9a187fc7 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index 5597b3e3..96252046 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -1292,7 +1292,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPM_WriteString((CHAR*)" * ", 4); OPM_WriteInt(r->typ->BaseTyp->size); OPM_WriteString((CHAR*)", ", 3); - OPM_WriteInt(l->typ->size); + OPM_WriteInt(l->typ->size + 1); OPM_Write(')'); } else { __ASSERT(r->typ->comp == 2, 0); diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index 4e3573c7..5654d36e 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Out.c b/bootstrap/unix-48/Out.c index b877f0bd..9248cfc5 100644 --- a/bootstrap/unix-48/Out.c +++ b/bootstrap/unix-48/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Out.h b/bootstrap/unix-48/Out.h index 80673194..ffbd6894 100644 --- a/bootstrap/unix-48/Out.h +++ b/bootstrap/unix-48/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 9b35ef5a..027176ed 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index 2b2fba4b..79d88e9d 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 55de7323..2ecd8371 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index 0af8a733..570e7d72 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index 909f5e88..f911a688 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index 54ccc184..7645aa6e 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index 5df0abaa..c0bfc16a 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index d7570ee1..cd0f72ee 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/VT100.c b/bootstrap/unix-48/VT100.c index 451af631..1e0fffa9 100644 --- a/bootstrap/unix-48/VT100.c +++ b/bootstrap/unix-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/VT100.h b/bootstrap/unix-48/VT100.h index d4387f75..7522f9d1 100644 --- a/bootstrap/unix-48/VT100.h +++ b/bootstrap/unix-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index 83030d15..d2c67400 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -95,7 +95,7 @@ void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN stati Strings_Append((CHAR*)".c ", 4, (void*)cmd, 1023); Strings_Append(additionalopts, additionalopts__len, (void*)cmd, 1023); if (statically) { - Strings_Append((CHAR*)"-static", 8, (void*)cmd, 1023); + Strings_Append((CHAR*)" -static", 9, (void*)cmd, 1023); } Strings_Append((CHAR*)" -o ", 5, (void*)cmd, 1023); Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index 0a7aceb7..fb167591 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/Compiler.c b/bootstrap/unix-88/Compiler.c index 39819e0a..454ea490 100644 --- a/bootstrap/unix-88/Compiler.c +++ b/bootstrap/unix-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index e391cd31..abf165f3 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index 5d106305..eb712e53 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index ead3b170..3aeb5911 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 6ff0de64..b67b65f7 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index 6246dc9c..3f4e96ee 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index 26424f29..aac7c8fe 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 82b56235..821e6801 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index f82ccfd0..c7f011df 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index b5c4fd7d..c163c77e 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index 20372132..7b8e9d38 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index 7848592a..fef86e9e 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index dff5b7ca..a2b14bdc 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index faf1ba5e..cb39afd5 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index 59190332..dc86bc49 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index 94982bd2..25c453d1 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index efff1781..bf0f96d7 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index 2d0304d5..807c0ce5 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index e54474bc..a15d8712 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index 46bd1072..8fb5d86e 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index d2ca1fae..9a187fc7 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index a3223212..ab98ed73 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -1292,7 +1292,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPM_WriteString((CHAR*)" * ", 4); OPM_WriteInt(r->typ->BaseTyp->size); OPM_WriteString((CHAR*)", ", 3); - OPM_WriteInt(l->typ->size); + OPM_WriteInt(l->typ->size + 1); OPM_Write(')'); } else { __ASSERT(r->typ->comp == 2, 0); diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index 4e3573c7..5654d36e 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Out.c b/bootstrap/unix-88/Out.c index 1087252f..a55f91eb 100644 --- a/bootstrap/unix-88/Out.c +++ b/bootstrap/unix-88/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Out.h b/bootstrap/unix-88/Out.h index 42ae59ed..b846b299 100644 --- a/bootstrap/unix-88/Out.h +++ b/bootstrap/unix-88/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index ef72c3b2..56d7144c 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index fbc0ebdd..000bcc79 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 55de7323..2ecd8371 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index 0af8a733..570e7d72 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index 909f5e88..f911a688 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index 54ccc184..7645aa6e 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index 6447e8ae..74cd62c7 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index ff036fdd..be7b64a2 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/VT100.c b/bootstrap/unix-88/VT100.c index 451af631..1e0fffa9 100644 --- a/bootstrap/unix-88/VT100.c +++ b/bootstrap/unix-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/VT100.h b/bootstrap/unix-88/VT100.h index d4387f75..7522f9d1 100644 --- a/bootstrap/unix-88/VT100.h +++ b/bootstrap/unix-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index 83030d15..d2c67400 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -95,7 +95,7 @@ void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN stati Strings_Append((CHAR*)".c ", 4, (void*)cmd, 1023); Strings_Append(additionalopts, additionalopts__len, (void*)cmd, 1023); if (statically) { - Strings_Append((CHAR*)"-static", 8, (void*)cmd, 1023); + Strings_Append((CHAR*)" -static", 9, (void*)cmd, 1023); } Strings_Append((CHAR*)" -o ", 5, (void*)cmd, 1023); Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index 0a7aceb7..fb167591 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/Compiler.c b/bootstrap/windows-48/Compiler.c index 39819e0a..454ea490 100644 --- a/bootstrap/windows-48/Compiler.c +++ b/bootstrap/windows-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index e391cd31..abf165f3 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index 5d106305..eb712e53 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 1193b13c..38d67ccf 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index 7571e510..e1da6139 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index 6728cb4d..495e451c 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index 62f61978..7429d8c8 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index e5fe836e..9cd53060 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index 89339f66..42f06075 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index b5c4fd7d..c163c77e 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index 20372132..7b8e9d38 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 7848592a..fef86e9e 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index dff5b7ca..a2b14bdc 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 8017c2e7..d09d6a7a 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index 59190332..dc86bc49 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index d8d05354..24e6b221 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index efff1781..bf0f96d7 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index 2d0304d5..807c0ce5 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index e54474bc..a15d8712 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index c9f40056..e9db362e 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index d2ca1fae..9a187fc7 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index 5597b3e3..96252046 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -1292,7 +1292,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPM_WriteString((CHAR*)" * ", 4); OPM_WriteInt(r->typ->BaseTyp->size); OPM_WriteString((CHAR*)", ", 3); - OPM_WriteInt(l->typ->size); + OPM_WriteInt(l->typ->size + 1); OPM_Write(')'); } else { __ASSERT(r->typ->comp == 2, 0); diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index 4e3573c7..5654d36e 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Out.c b/bootstrap/windows-48/Out.c index 4c3ea533..932297a3 100644 --- a/bootstrap/windows-48/Out.c +++ b/bootstrap/windows-48/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Out.h b/bootstrap/windows-48/Out.h index 80673194..ffbd6894 100644 --- a/bootstrap/windows-48/Out.h +++ b/bootstrap/windows-48/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 1e35e805..cc0bd221 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index 3362fba3..f74a75bf 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 55de7323..2ecd8371 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index 0af8a733..570e7d72 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index 909f5e88..f911a688 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index 54ccc184..7645aa6e 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index 5df0abaa..c0bfc16a 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index d7570ee1..cd0f72ee 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/VT100.c b/bootstrap/windows-48/VT100.c index 451af631..1e0fffa9 100644 --- a/bootstrap/windows-48/VT100.c +++ b/bootstrap/windows-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/VT100.h b/bootstrap/windows-48/VT100.h index d4387f75..7522f9d1 100644 --- a/bootstrap/windows-48/VT100.h +++ b/bootstrap/windows-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index 83030d15..d2c67400 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -95,7 +95,7 @@ void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN stati Strings_Append((CHAR*)".c ", 4, (void*)cmd, 1023); Strings_Append(additionalopts, additionalopts__len, (void*)cmd, 1023); if (statically) { - Strings_Append((CHAR*)"-static", 8, (void*)cmd, 1023); + Strings_Append((CHAR*)" -static", 9, (void*)cmd, 1023); } Strings_Append((CHAR*)" -o ", 5, (void*)cmd, 1023); Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index 0a7aceb7..fb167591 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/Compiler.c b/bootstrap/windows-88/Compiler.c index 39819e0a..454ea490 100644 --- a/bootstrap/windows-88/Compiler.c +++ b/bootstrap/windows-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index e391cd31..abf165f3 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index 5d106305..eb712e53 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 8dce3c01..b9056935 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 32786d38..616c3fe1 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index 6246dc9c..3f4e96ee 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index 26424f29..aac7c8fe 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index d3c5d8d1..50348111 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index f82ccfd0..c7f011df 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index b5c4fd7d..c163c77e 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index 20372132..7b8e9d38 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index 7848592a..fef86e9e 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index dff5b7ca..a2b14bdc 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index faf1ba5e..cb39afd5 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index 59190332..dc86bc49 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index 94982bd2..25c453d1 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index efff1781..bf0f96d7 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index 2d0304d5..807c0ce5 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index e54474bc..a15d8712 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index 46bd1072..8fb5d86e 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index d2ca1fae..9a187fc7 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index a3223212..ab98ed73 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -1292,7 +1292,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPM_WriteString((CHAR*)" * ", 4); OPM_WriteInt(r->typ->BaseTyp->size); OPM_WriteString((CHAR*)", ", 3); - OPM_WriteInt(l->typ->size); + OPM_WriteInt(l->typ->size + 1); OPM_Write(')'); } else { __ASSERT(r->typ->comp == 2, 0); diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index 4e3573c7..5654d36e 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Out.c b/bootstrap/windows-88/Out.c index 39c1e9f9..87f59955 100644 --- a/bootstrap/windows-88/Out.c +++ b/bootstrap/windows-88/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Out.h b/bootstrap/windows-88/Out.h index 42ae59ed..b846b299 100644 --- a/bootstrap/windows-88/Out.h +++ b/bootstrap/windows-88/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 53d2232c..b47b0d82 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index e2b27d76..76ed0ffb 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 55de7323..2ecd8371 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index 0af8a733..570e7d72 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index 909f5e88..f911a688 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index 54ccc184..7645aa6e 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index 6447e8ae..74cd62c7 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index ff036fdd..be7b64a2 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/VT100.c b/bootstrap/windows-88/VT100.c index 451af631..1e0fffa9 100644 --- a/bootstrap/windows-88/VT100.c +++ b/bootstrap/windows-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/VT100.h b/bootstrap/windows-88/VT100.h index d4387f75..7522f9d1 100644 --- a/bootstrap/windows-88/VT100.h +++ b/bootstrap/windows-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index 83030d15..d2c67400 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -95,7 +95,7 @@ void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN stati Strings_Append((CHAR*)".c ", 4, (void*)cmd, 1023); Strings_Append(additionalopts, additionalopts__len, (void*)cmd, 1023); if (statically) { - Strings_Append((CHAR*)"-static", 8, (void*)cmd, 1023); + Strings_Append((CHAR*)" -static", 9, (void*)cmd, 1023); } Strings_Append((CHAR*)" -o ", 5, (void*)cmd, 1023); Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index 0a7aceb7..fb167591 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h From 460b879829f8ddac3a7efccc6d7724d1f4f2998e Mon Sep 17 00:00:00 2001 From: David Brown Date: Sun, 18 Dec 2016 13:03:59 +0000 Subject: [PATCH 434/580] Build link list based on imports, not on modules compiled by compiler instance. --- ReadMe.md | 4 +-- src/compiler/Compiler.Mod | 53 +++++++++++++++++++++++++++++---------- src/compiler/OPM.Mod | 20 +++++++++------ src/compiler/OPP.Mod | 16 +++--------- src/compiler/OPT.Mod | 46 +++++++++++++++++++++++++++++---- src/compiler/OPV.Mod | 2 +- src/runtime/Files.Mod | 10 -------- 7 files changed, 100 insertions(+), 51 deletions(-) diff --git a/ReadMe.md b/ReadMe.md index a3f55f77..95732f0d 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -125,7 +125,7 @@ Alternatively the Oakwood module Out can be used to write directly to stdout: MODULE hello; IMPORT Out; BEGIN - Out.String("Hello."); Out.Ln; + Out.String("Hello."); Out.Ln END hello. ``` @@ -144,7 +144,7 @@ Execute as usual on Linux (`./hello`) or Windows (`hello`). In order to see the definition of a module's interface, use the "showdef" program. ``` -$ showdef Out.sym +$ showdef Out DEFINITION Out; VAR diff --git a/src/compiler/Compiler.Mod b/src/compiler/Compiler.Mod index 4e9c5c10..c9f454cf 100644 --- a/src/compiler/Compiler.Mod +++ b/src/compiler/Compiler.Mod @@ -6,9 +6,6 @@ MODULE Compiler; (* J. Templ 3.2.95 *) OPV, OPC, OPM, extTools, Strings, VT100; - VAR mname: ARRAY 256 OF CHAR; (* noch *) - - PROCEDURE Module*(VAR done: BOOLEAN); VAR ext, new: BOOLEAN; p: OPT.Node; BEGIN @@ -20,11 +17,12 @@ MODULE Compiler; (* J. Templ 3.2.95 *) OPT.Export(ext, new); IF OPM.noerr THEN OPM.OpenFiles(OPT.SelfName); + OPM.DeleteObj(OPT.SelfName); (* Make sure old object file isn't left hanging around. *) OPC.Init; OPV.Module(p); IF OPM.noerr THEN IF (OPM.mainprog IN OPM.Options) & (OPM.modName # "SYSTEM") THEN - OPM.DeleteNewSym; + OPM.DeleteNewSym(OPT.SelfName); OPM.LogVT100(VT100.Green); OPM.LogWStr(" Main program."); OPM.LogVT100(VT100.ResetAll); ELSE IF new THEN @@ -36,7 +34,7 @@ MODULE Compiler; (* J. Templ 3.2.95 *) END END; ELSE - OPM.DeleteNewSym + OPM.DeleteNewSym(OPT.SelfName) END END END; @@ -83,17 +81,48 @@ MODULE Compiler; (* J. Templ 3.2.95 *) END PropagateElementaryTypeSizes; + PROCEDURE FindLocalObjectFiles(VAR objectnames: ARRAY OF CHAR); + VAR + l: OPT.Link; + fn: ARRAY 64 OF CHAR; + id: Platform.FileIdentity; + BEGIN + objectnames[0] := 0X; + l := OPT.Links; WHILE l # NIL DO + (* Tell linker to link this module as an object file if both a symbol + and an object file exist in the current directory. *) + COPY(l.name, fn); Strings.Append('.sym', fn); + IF Platform.IdentifyByName(fn, id) = 0 THEN + COPY(l.name, fn); Strings.Append(Configuration.objext, fn); + IF Platform.IdentifyByName(fn, id) = 0 THEN + Strings.Append(' ', objectnames); + Strings.Append(fn, objectnames) + ELSE + (* Found symbol file but no object file. *) + OPM.LogVT100(VT100.Yellow); + OPM.LogWStr("Link warning: a local symbol file is present for module "); OPM.LogWStr(l.name); + OPM.LogWStr(", but local object file '"); OPM.LogWStr(fn); OPM.LogWStr("' is missing."); + OPM.LogVT100(VT100.ResetAll); OPM.LogWLn + END + ELSE + (* No symbol file present in current directory. + Assume this referenced module is in a library. *) + END; + l := l.next + END + END FindLocalObjectFiles; + + PROCEDURE Translate*; VAR - done: BOOLEAN; - modulesobj: ARRAY 2048 OF CHAR; (* here we hold all modules name given on the command line, to add corresponding .o files to the external compiler options *) + done: BOOLEAN; + linkfiles: ARRAY 2048 OF CHAR; (* Object files to be linked into main program. *) BEGIN - modulesobj := ""; IF OPM.OpenPar() THEN (* gclock(); slightly faster translation but may lead to opening "too many files" *) LOOP - OPM.Init(done, mname); (* Get next module name from command line *) + OPM.Init(done); (* Get next module name from command line *) IF ~done THEN RETURN END ; OPM.InitOptions; (* Get options for this module *) @@ -116,12 +145,10 @@ MODULE Compiler; (* J. Templ 3.2.95 *) IF ~(OPM.mainprog IN OPM.Options) THEN (* Assemble non main program and add object name to link list *) extTools.Assemble(OPM.modName); - Strings.Append(" ", modulesobj); - Strings.Append(OPM.modName, modulesobj); - Strings.Append(Configuration.objext, modulesobj) ELSE (* Assemble and link main program *) - extTools.LinkMain(OPM.modName, OPM.mainlinkstat IN OPM.Options, modulesobj) + FindLocalObjectFiles(linkfiles); + extTools.LinkMain(OPM.modName, OPM.mainlinkstat IN OPM.Options, linkfiles) END END END diff --git a/src/compiler/OPM.Mod b/src/compiler/OPM.Mod index 583c4318..a5a3df1a 100644 --- a/src/compiler/OPM.Mod +++ b/src/compiler/OPM.Mod @@ -76,7 +76,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) BFext = ".c"; (* body file extension *) HFext = ".h"; (* header file extension *) SFtag = 0F7X; (* symbol file tag *) - SFver = 082X; (* symbol file version. Increment if symbol file format is changed. *) + SFver = 083X; (* symbol file version. Increment if symbol file format is changed. *) @@ -353,7 +353,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) END InitOptions; - PROCEDURE Init*(VAR done: BOOLEAN; VAR mname : ARRAY OF CHAR); (* get the source for one translation *) + PROCEDURE Init*(VAR done: BOOLEAN); (* get the source for one translation *) VAR T: Texts.Text; beg, end, time: LONGINT; @@ -367,7 +367,6 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) NEW(T); Texts.Open(T, s); LogWStr(s); LogWStr(" "); - COPY(s, mname); COPY(s, SourceFileName); (* to keep it also in this module -- noch *) IF T.len = 0 THEN @@ -636,9 +635,16 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) IF (modName # "SYSTEM") OR (mainprog IN Options) THEN Files.Register(newSFile) END END RegisterNewSym; - PROCEDURE DeleteNewSym*; + PROCEDURE DeleteNewSym*(VAR modulename: ARRAY OF CHAR); + VAR fn: FileName; res: INTEGER; + BEGIN MakeFileName(modulename, fn, SFext); Files.Delete(fn, res) END DeleteNewSym; + PROCEDURE DeleteObj*(VAR modulename: ARRAY OF CHAR); + VAR fn: FileName; res: INTEGER; + BEGIN MakeFileName(modulename, fn, Configuration.objext); Files.Delete(fn, res) + END DeleteObj; + PROCEDURE NewSym*(VAR modName: ARRAY OF CHAR); VAR fileName: FileName; BEGIN MakeFileName(modName, fileName, SFext); @@ -742,7 +748,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) END Append; PROCEDURE OpenFiles*(VAR moduleName: ARRAY OF CHAR); - VAR FName: ARRAY 32 OF CHAR; + VAR FName: FileName; BEGIN COPY(moduleName, modName); HFile := Files.New(""); @@ -756,7 +762,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) END OpenFiles; PROCEDURE CloseFiles*; - VAR FName: ARRAY 32 OF CHAR; res: INTEGER; + VAR FName: FileName; res: INTEGER; BEGIN IF noerr THEN LogWStr(" "); LogWNum(Files.Pos(R[BodyFile]), 0); LogWStr(" chars.") END; IF noerr THEN @@ -779,7 +785,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) (* === Installation directory discovery === *) PROCEDURE IsProbablyInstallDir(s: ARRAY OF CHAR): BOOLEAN; - VAR testpath: ARRAY 1024 OF CHAR; identity: Platform.FileIdentity; + VAR testpath: ARRAY 4096 OF CHAR; identity: Platform.FileIdentity; BEGIN COPY(InstallDir, testpath); Strings.Append("/lib/lib", testpath); diff --git a/src/compiler/OPP.Mod b/src/compiler/OPP.Mod index 0ff9b7fb..8cfc5a55 100644 --- a/src/compiler/OPP.Mod +++ b/src/compiler/OPP.Mod @@ -922,7 +922,7 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) OPT.Insert(OPS.name, obj); obj^.mode := OPT.Typ; obj^.typ := OPT.undftyp; CheckMark(obj^.vis); IF sym = OPS.eql THEN - IF (obj^.name = "SHORTINT") OR + IF (obj^.name = "SHORTINT") OR (obj^.name = "INTEGER") OR (obj^.name = "LONGINT") OR (obj^.name = "HUGEINT") OR @@ -931,7 +931,7 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) (obj^.name = "SET") OR (obj^.name = "CHAR") OR (obj^.name = "TRUE") OR (obj^.name = "FALSE") THEN - OPM.Mark(-310, OPM.curpos); (* notice about aliasing of predefined type *) + OPM.Mark(-310, OPM.curpos); (* notice about aliasing of predefined type *) END; OPS.Get(sym); TypeDecl(obj^.typ, obj^.typ) ELSIF (sym = OPS.becomes) OR (sym = OPS.colon) THEN @@ -1005,17 +1005,7 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) c: LONGINT; done: BOOLEAN; BEGIN OPS.Init; LoopLevel := 0; level := 0; OPS.Get(sym); - IF sym = OPS.module THEN OPS.Get(sym) ELSE - (* Debug intermittent failure only found on OpenBSD *) - OPM.LogWLn; - OPM.LogWStr("Unexpected symbol found when MODULE expected:"); OPM.LogWLn; - OPM.LogWStr(" sym: "); OPM.LogWNum(sym,1); OPM.LogWLn; - OPM.LogWStr(" OPS.name: "); OPM.LogWStr(OPS.name); OPM.LogWLn; - OPM.LogWStr(" OPS.str: "); OPM.LogWStr(OPS.str); OPM.LogWLn; - OPM.LogWStr(" OPS.numtyp: "); OPM.LogWNum(OPS.numtyp,1); OPM.LogWLn; - OPM.LogWStr(" OPS.intval: "); OPM.LogWNum(OPS.intval,1); OPM.LogWLn; - err(16) - END; + IF sym = OPS.module THEN OPS.Get(sym) ELSE err(16) END; IF sym = OPS.ident THEN OPM.LogWStr("compiling "); OPM.LogWStr(OPS.name); OPM.LogW("."); OPT.Init(OPS.name, opt); OPS.Get(sym); CheckSym(OPS.semicolon); diff --git a/src/compiler/OPT.Mod b/src/compiler/OPT.Mod index 54975745..2c54d11f 100644 --- a/src/compiler/OPT.Mod +++ b/src/compiler/OPT.Mod @@ -176,7 +176,7 @@ CONST Srvar* = 22; Svalpar* = 23; Svarpar* = 24; Sfld* = 25; Srfld* = 26; Shdptr* = 27; Shdpro* = 28; Stpro* = 29; Shdtpro* = 30; Sxpro* = 31; Sipro* = 32; Scpro* = 33; Sstruct* = 34; Ssys* = 35; Sptr* = 36; - Sarr* = 37; Sdarr* = 38; Srec* = 39; Spro* = 40; + Sarr* = 37; Sdarr* = 38; Srec* = 39; Spro* = 40; Slink* = 37; TYPE ImpCtxt = RECORD @@ -207,6 +207,18 @@ VAR recno: LONGINT; (* number of anonymous record types *) +(* Linking control - modules whose object files will be required to link a module. *) + +TYPE + Link* = POINTER TO LinkDesc; + LinkDesc* = RECORD + name-: OPS.Name; + next-: Link + END; + +VAR + Links-: Link; + PROCEDURE InitRecno*; BEGIN recno := 0 END InitRecno; PROCEDURE err(n: INTEGER); BEGIN OPM.err(n) END err; @@ -392,7 +404,8 @@ BEGIN topScope := universe; OpenScope(0, NIL); SYSimported := FALSE; SelfName := name; topScope^.name := name; GlbMod[0] := topScope; nofGmod := 1; - newsf := nsf IN opt; findpc := fpc IN opt; extsf := newsf OR (esf IN opt); sfpresent := TRUE + newsf := nsf IN opt; findpc := fpc IN opt; extsf := newsf OR (esf IN opt); sfpresent := TRUE; + NEW(Links); Links.name := name END Init; PROCEDURE Close*; @@ -733,6 +746,20 @@ BEGIN END END InMod; +PROCEDURE InLinks; (* Load a list of all modules whose object files we will need to link with *) + VAR linkname: OPS.Name; l: Link; +BEGIN + InName(linkname); + WHILE linkname[0] # 0X DO + l := Links; WHILE (l # NIL) & (l.name # linkname) DO l := l.next END; + IF l = NIL THEN + l := Links; NEW(Links); + Links.next := l; Links.name := linkname + END; + InName(linkname) + END +END InLinks; + PROCEDURE InConstant(f: LONGINT; conval: Const); VAR ch: CHAR; i: INTEGER; ext: ConstExt; rval: REAL; BEGIN @@ -1022,7 +1049,7 @@ BEGIN impCtxt.self := aliasName = "@self"; impCtxt.reffp := 0; OPM.OldSym(name, done); IF done THEN - InMod(mno); + InMod(mno); InLinks; impCtxt.nextTag := OPM.SymRInt(); WHILE ~OPM.eofSF() DO obj := InObj(mno); impCtxt.nextTag := OPM.SymRInt() @@ -1057,6 +1084,13 @@ END Import; END END OutMod; + PROCEDURE OutLinks; + VAR l: Link; + BEGIN + l := Links; WHILE l # NIL DO OutName(l.name); l := l.next END; + OPM.SymWCh(0X) + END OutLinks; + PROCEDURE ^OutStr(typ: Struct); PROCEDURE ^OutFlds(fld: Object; adr: LONGINT; visible: BOOLEAN); @@ -1235,7 +1269,7 @@ END Import; IF OPM.noerr THEN (* ~OPM.noerr => ~done *) OPM.NewSym(SelfName); IF OPM.noerr THEN - OPM.SymWInt(Smname); OutName(SelfName); + OPM.SymWInt(Smname); OutName(SelfName); OutLinks; expCtxt.reffp := 0; expCtxt.ref := FirstRef(*Comp+1*); expCtxt.nofm := 1; expCtxt.locmno[0] := 0; i := 1; WHILE i < maxImps DO expCtxt.locmno[i] := -1; INC(i) END; @@ -1248,7 +1282,7 @@ END Import; END; newsf := FALSE; symNew := FALSE; (* because of call to FPrintErr from OPL *) IF ~OPM.noerr OR findpc THEN - OPM.DeleteNewSym + OPM.DeleteNewSym(SelfName) END (* OPM.RegisterNewSym is called in OP2 after writing the object file *) END @@ -1256,6 +1290,8 @@ END Import; END Export; (* no new symbol file if ~OPM.noerr or findpc *) +(*------------------------- Initialise types --------------------------*) + PROCEDURE InitStruct(VAR typ: Struct; form: SHORTINT); BEGIN typ := NewStr(form, Basic); typ^.ref := form; typ^.size := 1; typ^.allocated := TRUE; diff --git a/src/compiler/OPV.Mod b/src/compiler/OPV.Mod index 31e07fd9..d0cbde89 100644 --- a/src/compiler/OPV.Mod +++ b/src/compiler/OPV.Mod @@ -790,7 +790,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 OPM.WriteString("__X("); OPC.Len(r.obj, r.typ, 0); OPM.WriteString(" * "); OPM.WriteInt(r.typ.BaseTyp.size); OPM.WriteString(", "); - OPM.WriteInt(l.typ.size+1); (* _X vaidates 0 .. n-1 so we need to +1. *) + OPM.WriteInt(l.typ.size+1); (* _X validates 0 .. n-1 so we need top+1. *) OPM.Write(")") ELSE (* Array to array copy. *) ASSERT(r.typ.comp = OPT.Array); ASSERT(r.typ.size <= l.typ.size); diff --git a/src/runtime/Files.Mod b/src/runtime/Files.Mod index 76fbdf77..f60e67bb 100644 --- a/src/runtime/Files.Mod +++ b/src/runtime/Files.Mod @@ -645,21 +645,11 @@ Especially Length would become fairly complex. PROCEDURE Register* (f: File); VAR idx, errcode: INTEGER; f1: File; BEGIN - (* - Out.String("Files.Register f.registerName = "); Out.String(f.registerName); - Out.String(", fd = "); Out.Int(f.fd,1); Out.Ln; - *) IF (f.state = create) & (f.registerName # "") THEN f.state := close (* shortcut renaming *) END; Close(f); IF f.registerName # "" THEN Deregister(f.registerName); Rename(f.workName, f.registerName, errcode); - (* - Out.String("Renamed (for register) f.fd = "); Out.Int(f.fd,1); - Out.String(" from workname "); Out.String(f.workName); - Out.String(" to registerName "); Out.String(f.registerName); - Out.String(" errorcode = "); Out.Int(errcode,1); Out.Ln; - *) IF errcode # 0 THEN Err("Couldn't rename temp name as register name", f, errcode) END; f.workName := f.registerName; f.registerName := ""; f.tempFile := FALSE END From 4c7aa1720a2009a634a57564ebcc8d0a3fdb5627 Mon Sep 17 00:00:00 2001 From: David Brown Date: Sun, 18 Dec 2016 13:05:05 +0000 Subject: [PATCH 435/580] Update bootstrap C sources. --- bootstrap/unix-44/Compiler.c | 51 +++++++++++++++++++------ bootstrap/unix-44/Configuration.c | 4 +- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Files.c | 2 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 2 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 2 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 57 +++++++++++++++++----------- bootstrap/unix-44/OPM.h | 7 ++-- bootstrap/unix-44/OPP.c | 20 +--------- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 55 ++++++++++++++++++++++++++- bootstrap/unix-44/OPT.h | 13 ++++++- bootstrap/unix-44/OPV.c | 2 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Out.c | 2 +- bootstrap/unix-44/Out.h | 2 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/VT100.c | 2 +- bootstrap/unix-44/VT100.h | 2 +- bootstrap/unix-44/extTools.c | 2 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-48/Compiler.c | 51 +++++++++++++++++++------ bootstrap/unix-48/Configuration.c | 4 +- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Files.c | 2 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 2 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 2 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 57 +++++++++++++++++----------- bootstrap/unix-48/OPM.h | 7 ++-- bootstrap/unix-48/OPP.c | 20 +--------- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 55 ++++++++++++++++++++++++++- bootstrap/unix-48/OPT.h | 13 ++++++- bootstrap/unix-48/OPV.c | 2 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Out.c | 2 +- bootstrap/unix-48/Out.h | 2 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/VT100.c | 2 +- bootstrap/unix-48/VT100.h | 2 +- bootstrap/unix-48/extTools.c | 2 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-88/Compiler.c | 51 +++++++++++++++++++------ bootstrap/unix-88/Configuration.c | 4 +- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Files.c | 2 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 2 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 2 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 57 +++++++++++++++++----------- bootstrap/unix-88/OPM.h | 7 ++-- bootstrap/unix-88/OPP.c | 20 +--------- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 55 ++++++++++++++++++++++++++- bootstrap/unix-88/OPT.h | 13 ++++++- bootstrap/unix-88/OPV.c | 2 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Out.c | 2 +- bootstrap/unix-88/Out.h | 2 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/VT100.c | 2 +- bootstrap/unix-88/VT100.h | 2 +- bootstrap/unix-88/extTools.c | 2 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/windows-48/Compiler.c | 51 +++++++++++++++++++------ bootstrap/windows-48/Configuration.c | 4 +- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Files.c | 2 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 2 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 2 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 57 +++++++++++++++++----------- bootstrap/windows-48/OPM.h | 7 ++-- bootstrap/windows-48/OPP.c | 20 +--------- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 55 ++++++++++++++++++++++++++- bootstrap/windows-48/OPT.h | 13 ++++++- bootstrap/windows-48/OPV.c | 2 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Out.c | 2 +- bootstrap/windows-48/Out.h | 2 +- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/VT100.c | 2 +- bootstrap/windows-48/VT100.h | 2 +- bootstrap/windows-48/extTools.c | 2 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-88/Compiler.c | 51 +++++++++++++++++++------ bootstrap/windows-88/Configuration.c | 4 +- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Files.c | 2 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 2 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 2 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 57 +++++++++++++++++----------- bootstrap/windows-88/OPM.h | 7 ++-- bootstrap/windows-88/OPP.c | 20 +--------- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 55 ++++++++++++++++++++++++++- bootstrap/windows-88/OPT.h | 13 ++++++- bootstrap/windows-88/OPV.c | 2 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Out.c | 2 +- bootstrap/windows-88/Out.h | 2 +- bootstrap/windows-88/Platform.c | 2 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/VT100.c | 2 +- bootstrap/windows-88/VT100.h | 2 +- bootstrap/windows-88/extTools.c | 2 +- bootstrap/windows-88/extTools.h | 2 +- 185 files changed, 880 insertions(+), 455 deletions(-) diff --git a/bootstrap/unix-44/Compiler.c b/bootstrap/unix-44/Compiler.c index 454ea490..f26c1a32 100644 --- a/bootstrap/unix-44/Compiler.c +++ b/bootstrap/unix-44/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 @@ -20,9 +20,9 @@ #include "extTools.h" -static CHAR Compiler_mname[256]; +static void Compiler_FindLocalObjectFiles (CHAR *objectnames, ADDRESS objectnames__len); export void Compiler_Module (BOOLEAN *done); static void Compiler_PropagateElementaryTypeSizes (void); export void Compiler_Translate (void); @@ -41,11 +41,12 @@ void Compiler_Module (BOOLEAN *done) OPT_Export(&ext, &new); if (OPM_noerr) { OPM_OpenFiles((void*)OPT_SelfName, 256); + OPM_DeleteObj((void*)OPT_SelfName, 256); OPC_Init(); OPV_Module(p); if (OPM_noerr) { if ((__IN(10, OPM_Options, 32) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { - OPM_DeleteNewSym(); + OPM_DeleteNewSym((void*)OPT_SelfName, 256); OPM_LogVT100((CHAR*)"32m", 4); OPM_LogWStr((CHAR*)" Main program.", 16); OPM_LogVT100((CHAR*)"0m", 3); @@ -61,7 +62,7 @@ void Compiler_Module (BOOLEAN *done) } } } else { - OPM_DeleteNewSym(); + OPM_DeleteNewSym((void*)OPT_SelfName, 256); } } } @@ -104,14 +105,44 @@ static void Compiler_PropagateElementaryTypeSizes (void) } } +static void Compiler_FindLocalObjectFiles (CHAR *objectnames, ADDRESS objectnames__len) +{ + OPT_Link l = NIL; + CHAR fn[64]; + Platform_FileIdentity id; + objectnames[0] = 0x00; + l = OPT_Links; + while (l != NIL) { + __COPY(l->name, fn, 64); + Strings_Append((CHAR*)".sym", 5, (void*)fn, 64); + if (Platform_IdentifyByName(fn, 64, &id, Platform_FileIdentity__typ) == 0) { + __COPY(l->name, fn, 64); + Strings_Append((CHAR*)".o", 3, (void*)fn, 64); + if (Platform_IdentifyByName(fn, 64, &id, Platform_FileIdentity__typ) == 0) { + Strings_Append((CHAR*)" ", 2, (void*)objectnames, objectnames__len); + Strings_Append(fn, 64, (void*)objectnames, objectnames__len); + } else { + OPM_LogVT100((CHAR*)"33m", 4); + OPM_LogWStr((CHAR*)"Link warning: a local symbol file is present for module ", 57); + OPM_LogWStr(l->name, 256); + OPM_LogWStr((CHAR*)", but local object file '", 26); + OPM_LogWStr(fn, 64); + OPM_LogWStr((CHAR*)"' is missing.", 14); + OPM_LogVT100((CHAR*)"0m", 3); + OPM_LogWLn(); + } + } + l = l->next; + } +} + void Compiler_Translate (void) { BOOLEAN done; - CHAR modulesobj[2048]; - modulesobj[0] = 0x00; + CHAR linkfiles[2048]; if (OPM_OpenPar()) { for (;;) { - OPM_Init(&done, (void*)Compiler_mname, 256); + OPM_Init(&done); if (!done) { return; } @@ -131,11 +162,9 @@ void Compiler_Translate (void) } else { if (!__IN(10, OPM_Options, 32)) { extTools_Assemble(OPM_modName, 32); - Strings_Append((CHAR*)" ", 2, (void*)modulesobj, 2048); - Strings_Append(OPM_modName, 32, (void*)modulesobj, 2048); - Strings_Append((CHAR*)".o", 3, (void*)modulesobj, 2048); } else { - extTools_LinkMain((void*)OPM_modName, 32, __IN(15, OPM_Options, 32), modulesobj, 2048); + Compiler_FindLocalObjectFiles((void*)linkfiles, 2048); + extTools_LinkMain((void*)OPM_modName, 32, __IN(15, OPM_Options, 32), linkfiles, 2048); } } } diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index abf165f3..18ec858a 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index eb712e53..efd4ae6e 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index d29c5510..dac5c5ff 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index e0812a5b..2291d7d8 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index 495e451c..df3d086b 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index 7429d8c8..7a464dbf 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index 34c15ece..76891be3 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index 42f06075..9f691749 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index c163c77e..3933cee1 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index 7b8e9d38..9f8518b8 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index fef86e9e..24cd4f3f 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index a2b14bdc..99b9afb4 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index d09d6a7a..3411635b 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -49,7 +49,8 @@ export CHAR OPM_ResourceDir[1024]; static void OPM_Append (Files_Rider *R, ADDRESS *R__typ, Files_File F); export void OPM_CloseFiles (void); export void OPM_CloseOldSym (void); -export void OPM_DeleteNewSym (void); +export void OPM_DeleteNewSym (CHAR *modulename, ADDRESS modulename__len); +export void OPM_DeleteObj (CHAR *modulename, ADDRESS modulename__len); export void OPM_FPrint (INT32 *fp, INT64 val); export void OPM_FPrintLReal (INT32 *fp, LONGREAL val); export void OPM_FPrintReal (INT32 *fp, REAL val); @@ -58,7 +59,7 @@ static void OPM_FindInstallDir (void); static void OPM_FindLine (Files_File f, Files_Rider *r, ADDRESS *r__typ, INT64 pos); static void OPM_FingerprintBytes (INT32 *fp, SYSTEM_BYTE *bytes, ADDRESS bytes__len); export void OPM_Get (CHAR *ch); -export void OPM_Init (BOOLEAN *done, CHAR *mname, ADDRESS mname__len); +export void OPM_Init (BOOLEAN *done); export void OPM_InitOptions (void); export INT16 OPM_Integer (INT64 n); static BOOLEAN OPM_IsProbablyInstallDir (CHAR *s, ADDRESS s__len); @@ -449,7 +450,7 @@ void OPM_InitOptions (void) Files_SetSearchPath(searchpath, 1024); } -void OPM_Init (BOOLEAN *done, CHAR *mname, ADDRESS mname__len) +void OPM_Init (BOOLEAN *done) { Texts_Text T = NIL; INT32 beg, end, time; @@ -465,7 +466,6 @@ void OPM_Init (BOOLEAN *done, CHAR *mname, ADDRESS mname__len) Texts_Open(T, s, 256); OPM_LogWStr(s, 256); OPM_LogWStr((CHAR*)" ", 3); - __COPY(s, mname, mname__len); __COPY(s, OPM_SourceFileName, 256); if (T->len == 0) { OPM_LogWStr(s, 256); @@ -773,7 +773,7 @@ void OPM_OldSym (CHAR *modName, ADDRESS modName__len, BOOLEAN *done) Files_Set(&OPM_oldSF, Files_Rider__typ, OPM_oldSFile, 0); Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&tag); Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&ver); - if (tag != 0xf7 || ver != 0x82) { + if (tag != 0xf7 || ver != 0x83) { OPM_err(-306); OPM_CloseOldSym(); *done = 0; @@ -818,8 +818,20 @@ void OPM_RegisterNewSym (void) } } -void OPM_DeleteNewSym (void) +void OPM_DeleteNewSym (CHAR *modulename, ADDRESS modulename__len) { + OPM_FileName fn; + INT16 res; + OPM_MakeFileName((void*)modulename, modulename__len, (void*)fn, 32, (CHAR*)".sym", 5); + Files_Delete(fn, 32, &res); +} + +void OPM_DeleteObj (CHAR *modulename, ADDRESS modulename__len) +{ + OPM_FileName fn; + INT16 res; + OPM_MakeFileName((void*)modulename, modulename__len, (void*)fn, 32, (CHAR*)".o", 3); + Files_Delete(fn, 32, &res); } void OPM_NewSym (CHAR *modName, ADDRESS modName__len) @@ -830,7 +842,7 @@ void OPM_NewSym (CHAR *modName, ADDRESS modName__len) if (OPM_newSFile != NIL) { Files_Set(&OPM_newSF, Files_Rider__typ, OPM_newSFile, 0); Files_Write(&OPM_newSF, Files_Rider__typ, 0xf7); - Files_Write(&OPM_newSF, Files_Rider__typ, 0x82); + Files_Write(&OPM_newSF, Files_Rider__typ, 0x83); } else { OPM_err(153); } @@ -984,7 +996,7 @@ static void OPM_Append (Files_Rider *R, ADDRESS *R__typ, Files_File F) void OPM_OpenFiles (CHAR *moduleName, ADDRESS moduleName__len) { - CHAR FName[32]; + OPM_FileName FName; __COPY(moduleName, OPM_modName, 32); OPM_HFile = Files_New((CHAR*)"", 1); if (OPM_HFile != NIL) { @@ -1010,7 +1022,7 @@ void OPM_OpenFiles (CHAR *moduleName, ADDRESS moduleName__len) void OPM_CloseFiles (void) { - CHAR FName[32]; + OPM_FileName FName; INT16 res; if (OPM_noerr) { OPM_LogWStr((CHAR*)" ", 3); @@ -1048,26 +1060,26 @@ void OPM_CloseFiles (void) static BOOLEAN OPM_IsProbablyInstallDir (CHAR *s, ADDRESS s__len) { - CHAR testpath[1024]; + CHAR testpath[4096]; Platform_FileIdentity identity; __DUP(s, s__len, CHAR); - __COPY(OPM_InstallDir, testpath, 1024); - Strings_Append((CHAR*)"/lib/lib", 9, (void*)testpath, 1024); - Strings_Append((CHAR*)"voc", 4, (void*)testpath, 1024); - Strings_Append((CHAR*)"-O2.a", 6, (void*)testpath, 1024); - if (Platform_IdentifyByName(testpath, 1024, &identity, Platform_FileIdentity__typ) != 0) { + __COPY(OPM_InstallDir, testpath, 4096); + Strings_Append((CHAR*)"/lib/lib", 9, (void*)testpath, 4096); + Strings_Append((CHAR*)"voc", 4, (void*)testpath, 4096); + Strings_Append((CHAR*)"-O2.a", 6, (void*)testpath, 4096); + if (Platform_IdentifyByName(testpath, 4096, &identity, Platform_FileIdentity__typ) != 0) { __DEL(s); return 0; } - __COPY(OPM_InstallDir, testpath, 1024); - Strings_Append((CHAR*)"/2/include/Oberon.h", 20, (void*)testpath, 1024); - if (Platform_IdentifyByName(testpath, 1024, &identity, Platform_FileIdentity__typ) != 0) { + __COPY(OPM_InstallDir, testpath, 4096); + Strings_Append((CHAR*)"/2/include/Oberon.h", 20, (void*)testpath, 4096); + if (Platform_IdentifyByName(testpath, 4096, &identity, Platform_FileIdentity__typ) != 0) { __DEL(s); return 0; } - __COPY(OPM_InstallDir, testpath, 1024); - Strings_Append((CHAR*)"/2/sym/Files.sym", 17, (void*)testpath, 1024); - if (Platform_IdentifyByName(testpath, 1024, &identity, Platform_FileIdentity__typ) != 0) { + __COPY(OPM_InstallDir, testpath, 4096); + Strings_Append((CHAR*)"/2/sym/Files.sym", 17, (void*)testpath, 4096); + if (Platform_IdentifyByName(testpath, 4096, &identity, Platform_FileIdentity__typ) != 0) { __DEL(s); return 0; } @@ -1129,7 +1141,6 @@ export void *OPM__init(void) __REGMOD("OPM", EnumPtrs); __REGCMD("CloseFiles", OPM_CloseFiles); __REGCMD("CloseOldSym", OPM_CloseOldSym); - __REGCMD("DeleteNewSym", OPM_DeleteNewSym); __REGCMD("InitOptions", OPM_InitOptions); __REGCMD("LogWLn", OPM_LogWLn); __REGCMD("RegisterNewSym", OPM_RegisterNewSym); diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index dc86bc49..da0a48ee 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h @@ -23,13 +23,14 @@ import CHAR OPM_ResourceDir[1024]; import void OPM_CloseFiles (void); import void OPM_CloseOldSym (void); -import void OPM_DeleteNewSym (void); +import void OPM_DeleteNewSym (CHAR *modulename, ADDRESS modulename__len); +import void OPM_DeleteObj (CHAR *modulename, ADDRESS modulename__len); import void OPM_FPrint (INT32 *fp, INT64 val); import void OPM_FPrintLReal (INT32 *fp, LONGREAL val); import void OPM_FPrintReal (INT32 *fp, REAL val); import void OPM_FPrintSet (INT32 *fp, UINT64 val); import void OPM_Get (CHAR *ch); -import void OPM_Init (BOOLEAN *done, CHAR *mname, ADDRESS mname__len); +import void OPM_Init (BOOLEAN *done); import void OPM_InitOptions (void); import INT16 OPM_Integer (INT64 n); import void OPM_LogVT100 (CHAR *vt100code, ADDRESS vt100code__len); diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index 24e6b221..aad8367d 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -1793,24 +1793,6 @@ void OPP_Module (OPT_Node *prog, UINT32 opt) if (OPP_sym == 63) { OPS_Get(&OPP_sym); } else { - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Unexpected symbol found when MODULE expected:", 46); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)" sym: ", 15); - OPM_LogWNum(OPP_sym, 1); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)" OPS.name: ", 15); - OPM_LogWStr(OPS_name, 256); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)" OPS.str: ", 15); - OPM_LogWStr(OPS_str, 256); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)" OPS.numtyp: ", 15); - OPM_LogWNum(OPS_numtyp, 1); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)" OPS.intval: ", 15); - OPM_LogWNum(OPS_intval, 1); - OPM_LogWLn(); OPP_err(16); } if (OPP_sym == 38) { diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index bf0f96d7..dc8aa405 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index 807c0ce5..d0a1851a 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index a15d8712..608979a8 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index b028aa53..02532034 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -49,6 +49,15 @@ typedef INT8 glbmno[64]; } OPT_ImpCtxt; +typedef + struct OPT_LinkDesc *OPT_Link; + +typedef + struct OPT_LinkDesc { + OPS_Name name; + OPT_Link next; + } OPT_LinkDesc; + typedef struct OPT_NodeDesc *OPT_Node; @@ -101,6 +110,7 @@ static OPT_ExpCtxt OPT_expCtxt; static INT32 OPT_nofhdfld; static BOOLEAN OPT_newsf, OPT_findpc, OPT_extsf, OPT_sfpresent, OPT_symExtended, OPT_symNew; static INT32 OPT_recno; +export OPT_Link OPT_Links; export ADDRESS *OPT_ConstDesc__typ; export ADDRESS *OPT_ObjDesc__typ; @@ -108,6 +118,7 @@ export ADDRESS *OPT_StrDesc__typ; export ADDRESS *OPT_NodeDesc__typ; export ADDRESS *OPT_ImpCtxt__typ; export ADDRESS *OPT_ExpCtxt__typ; +export ADDRESS *OPT_LinkDesc__typ; export void OPT_Align (INT32 *adr, INT32 base); export INT32 OPT_BaseAlignment (OPT_Struct typ); @@ -131,6 +142,7 @@ export void OPT_IdFPrint (OPT_Struct typ); export void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); static void OPT_InConstant (INT32 f, OPT_Const conval); static OPT_Object OPT_InFld (void); +static void OPT_InLinks (void); static void OPT_InMod (INT8 *mno); static void OPT_InName (CHAR *name, ADDRESS name__len); static OPT_Object OPT_InObj (INT8 mno); @@ -154,6 +166,7 @@ export void OPT_OpenScope (INT8 level, OPT_Object owner); static void OPT_OutConstant (OPT_Object obj); static void OPT_OutFlds (OPT_Object fld, INT32 adr, BOOLEAN visible); static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, INT32 adr); +static void OPT_OutLinks (void); static void OPT_OutMod (INT16 mno); static void OPT_OutName (CHAR *name, ADDRESS name__len); static void OPT_OutObj (OPT_Object obj); @@ -442,6 +455,8 @@ void OPT_Init (OPS_Name name, UINT32 opt) OPT_findpc = __IN(8, opt, 32); OPT_extsf = OPT_newsf || __IN(9, opt, 32); OPT_sfpresent = 1; + __NEW(OPT_Links, OPT_LinkDesc); + __MOVE(name, OPT_Links->name, 256); } void OPT_Close (void) @@ -1011,6 +1026,26 @@ static void OPT_InMod (INT8 *mno) } } +static void OPT_InLinks (void) +{ + OPS_Name linkname; + OPT_Link l = NIL; + OPT_InName((void*)linkname, 256); + while (linkname[0] != 0x00) { + l = OPT_Links; + while ((l != NIL && __STRCMP(l->name, linkname) != 0)) { + l = l->next; + } + if (l == NIL) { + l = OPT_Links; + __NEW(OPT_Links, OPT_LinkDesc); + OPT_Links->next = l; + __MOVE(linkname, OPT_Links->name, 256); + } + OPT_InName((void*)linkname, 256); + } +} + static void OPT_InConstant (INT32 f, OPT_Const conval) { CHAR ch; @@ -1461,6 +1496,7 @@ void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) OPM_OldSym((void*)name, 256, &*done); if (*done) { OPT_InMod(&mno); + OPT_InLinks(); OPT_impCtxt.nextTag = OPM_SymRInt(); while (!OPM_eofSF()) { obj = OPT_InObj(mno); @@ -1507,6 +1543,17 @@ static void OPT_OutMod (INT16 mno) } } +static void OPT_OutLinks (void) +{ + OPT_Link l = NIL; + l = OPT_Links; + while (l != NIL) { + OPT_OutName((void*)l->name, 256); + l = l->next; + } + OPM_SymWCh(0x00); +} + static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, INT32 adr) { INT32 i, j, n; @@ -1833,6 +1880,7 @@ void OPT_Export (BOOLEAN *ext, BOOLEAN *new) if (OPM_noerr) { OPM_SymWInt(16); OPT_OutName((void*)OPT_SelfName, 256); + OPT_OutLinks(); OPT_expCtxt.reffp = 0; OPT_expCtxt.ref = 14; OPT_expCtxt.nofm = 1; @@ -1854,7 +1902,7 @@ void OPT_Export (BOOLEAN *ext, BOOLEAN *new) OPT_newsf = 0; OPT_symNew = 0; if (!OPM_noerr || OPT_findpc) { - OPM_DeleteNewSym(); + OPM_DeleteNewSym((void*)OPT_SelfName, 256); } } } @@ -1969,6 +2017,7 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_universe); P(OPT_syslink); __ENUMR(&OPT_impCtxt, OPT_ImpCtxt__typ, 3140, 1, P); + P(OPT_Links); } __TDESC(OPT_ConstDesc, 1, 1) = {__TDFLDS("ConstDesc", 32), {0, -8}}; @@ -2008,6 +2057,7 @@ __TDESC(OPT_ImpCtxt, 1, 510) = {__TDFLDS("ImpCtxt", 3140), {16, 20, 24, 28, 32, 1936, 1940, 1944, 1948, 1952, 1956, 1960, 1964, 1968, 1972, 1976, 1980, 1984, 1988, 1992, 1996, 2000, 2004, 2008, 2012, 2016, 2020, 2024, 2028, 2032, 2036, 2040, 2044, 2048, 2052, -2044}}; __TDESC(OPT_ExpCtxt, 1, 0) = {__TDFLDS("ExpCtxt", 72), {-4}}; +__TDESC(OPT_LinkDesc, 1, 1) = {__TDFLDS("LinkDesc", 260), {256, -8}}; export void *OPT__init(void) { @@ -2024,6 +2074,7 @@ export void *OPT__init(void) __INITYP(OPT_NodeDesc, OPT_NodeDesc, 0); __INITYP(OPT_ImpCtxt, OPT_ImpCtxt, 0); __INITYP(OPT_ExpCtxt, OPT_ExpCtxt, 0); + __INITYP(OPT_LinkDesc, OPT_LinkDesc, 0); /* BEGIN */ OPT_topScope = NIL; OPT_OpenScope(0, NIL); diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index 9a187fc7..7483f169 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h @@ -21,6 +21,15 @@ typedef LONGREAL realval; } OPT_ConstDesc; +typedef + struct OPT_LinkDesc *OPT_Link; + +typedef + struct OPT_LinkDesc { + OPS_Name name; + OPT_Link next; + } OPT_LinkDesc; + typedef struct OPT_NodeDesc *OPT_Node; @@ -75,11 +84,13 @@ import INT8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; import BOOLEAN OPT_SYSimported; +import OPT_Link OPT_Links; import ADDRESS *OPT_ConstDesc__typ; import ADDRESS *OPT_ObjDesc__typ; import ADDRESS *OPT_StrDesc__typ; import ADDRESS *OPT_NodeDesc__typ; +import ADDRESS *OPT_LinkDesc__typ; import void OPT_Align (INT32 *adr, INT32 base); import INT32 OPT_BaseAlignment (OPT_Struct typ); diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index 96252046..152db225 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index 5654d36e..7c94fced 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Out.c b/bootstrap/unix-44/Out.c index 9248cfc5..d1fba01a 100644 --- a/bootstrap/unix-44/Out.c +++ b/bootstrap/unix-44/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Out.h b/bootstrap/unix-44/Out.h index ffbd6894..a7195e3a 100644 --- a/bootstrap/unix-44/Out.h +++ b/bootstrap/unix-44/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 027176ed..6117b38b 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index 79d88e9d..521594dc 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 2ecd8371..11ad01bd 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index 570e7d72..bf708519 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index f911a688..06972c90 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index 7645aa6e..fd7f283d 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index f73006a8..fe342ae1 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index d1e65c70..a8edeb78 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/VT100.c b/bootstrap/unix-44/VT100.c index 1e0fffa9..baa92092 100644 --- a/bootstrap/unix-44/VT100.c +++ b/bootstrap/unix-44/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/VT100.h b/bootstrap/unix-44/VT100.h index 7522f9d1..4c0087ac 100644 --- a/bootstrap/unix-44/VT100.h +++ b/bootstrap/unix-44/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index d2c67400..75768aca 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index fb167591..fb870961 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/Compiler.c b/bootstrap/unix-48/Compiler.c index 454ea490..f26c1a32 100644 --- a/bootstrap/unix-48/Compiler.c +++ b/bootstrap/unix-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 @@ -20,9 +20,9 @@ #include "extTools.h" -static CHAR Compiler_mname[256]; +static void Compiler_FindLocalObjectFiles (CHAR *objectnames, ADDRESS objectnames__len); export void Compiler_Module (BOOLEAN *done); static void Compiler_PropagateElementaryTypeSizes (void); export void Compiler_Translate (void); @@ -41,11 +41,12 @@ void Compiler_Module (BOOLEAN *done) OPT_Export(&ext, &new); if (OPM_noerr) { OPM_OpenFiles((void*)OPT_SelfName, 256); + OPM_DeleteObj((void*)OPT_SelfName, 256); OPC_Init(); OPV_Module(p); if (OPM_noerr) { if ((__IN(10, OPM_Options, 32) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { - OPM_DeleteNewSym(); + OPM_DeleteNewSym((void*)OPT_SelfName, 256); OPM_LogVT100((CHAR*)"32m", 4); OPM_LogWStr((CHAR*)" Main program.", 16); OPM_LogVT100((CHAR*)"0m", 3); @@ -61,7 +62,7 @@ void Compiler_Module (BOOLEAN *done) } } } else { - OPM_DeleteNewSym(); + OPM_DeleteNewSym((void*)OPT_SelfName, 256); } } } @@ -104,14 +105,44 @@ static void Compiler_PropagateElementaryTypeSizes (void) } } +static void Compiler_FindLocalObjectFiles (CHAR *objectnames, ADDRESS objectnames__len) +{ + OPT_Link l = NIL; + CHAR fn[64]; + Platform_FileIdentity id; + objectnames[0] = 0x00; + l = OPT_Links; + while (l != NIL) { + __COPY(l->name, fn, 64); + Strings_Append((CHAR*)".sym", 5, (void*)fn, 64); + if (Platform_IdentifyByName(fn, 64, &id, Platform_FileIdentity__typ) == 0) { + __COPY(l->name, fn, 64); + Strings_Append((CHAR*)".o", 3, (void*)fn, 64); + if (Platform_IdentifyByName(fn, 64, &id, Platform_FileIdentity__typ) == 0) { + Strings_Append((CHAR*)" ", 2, (void*)objectnames, objectnames__len); + Strings_Append(fn, 64, (void*)objectnames, objectnames__len); + } else { + OPM_LogVT100((CHAR*)"33m", 4); + OPM_LogWStr((CHAR*)"Link warning: a local symbol file is present for module ", 57); + OPM_LogWStr(l->name, 256); + OPM_LogWStr((CHAR*)", but local object file '", 26); + OPM_LogWStr(fn, 64); + OPM_LogWStr((CHAR*)"' is missing.", 14); + OPM_LogVT100((CHAR*)"0m", 3); + OPM_LogWLn(); + } + } + l = l->next; + } +} + void Compiler_Translate (void) { BOOLEAN done; - CHAR modulesobj[2048]; - modulesobj[0] = 0x00; + CHAR linkfiles[2048]; if (OPM_OpenPar()) { for (;;) { - OPM_Init(&done, (void*)Compiler_mname, 256); + OPM_Init(&done); if (!done) { return; } @@ -131,11 +162,9 @@ void Compiler_Translate (void) } else { if (!__IN(10, OPM_Options, 32)) { extTools_Assemble(OPM_modName, 32); - Strings_Append((CHAR*)" ", 2, (void*)modulesobj, 2048); - Strings_Append(OPM_modName, 32, (void*)modulesobj, 2048); - Strings_Append((CHAR*)".o", 3, (void*)modulesobj, 2048); } else { - extTools_LinkMain((void*)OPM_modName, 32, __IN(15, OPM_Options, 32), modulesobj, 2048); + Compiler_FindLocalObjectFiles((void*)linkfiles, 2048); + extTools_LinkMain((void*)OPM_modName, 32, __IN(15, OPM_Options, 32), linkfiles, 2048); } } } diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index abf165f3..18ec858a 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index eb712e53..efd4ae6e 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index d29c5510..dac5c5ff 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index e0812a5b..2291d7d8 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index 495e451c..df3d086b 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index 7429d8c8..7a464dbf 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index 34c15ece..76891be3 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index 42f06075..9f691749 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index c163c77e..3933cee1 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index 7b8e9d38..9f8518b8 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index fef86e9e..24cd4f3f 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index a2b14bdc..99b9afb4 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index d09d6a7a..3411635b 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -49,7 +49,8 @@ export CHAR OPM_ResourceDir[1024]; static void OPM_Append (Files_Rider *R, ADDRESS *R__typ, Files_File F); export void OPM_CloseFiles (void); export void OPM_CloseOldSym (void); -export void OPM_DeleteNewSym (void); +export void OPM_DeleteNewSym (CHAR *modulename, ADDRESS modulename__len); +export void OPM_DeleteObj (CHAR *modulename, ADDRESS modulename__len); export void OPM_FPrint (INT32 *fp, INT64 val); export void OPM_FPrintLReal (INT32 *fp, LONGREAL val); export void OPM_FPrintReal (INT32 *fp, REAL val); @@ -58,7 +59,7 @@ static void OPM_FindInstallDir (void); static void OPM_FindLine (Files_File f, Files_Rider *r, ADDRESS *r__typ, INT64 pos); static void OPM_FingerprintBytes (INT32 *fp, SYSTEM_BYTE *bytes, ADDRESS bytes__len); export void OPM_Get (CHAR *ch); -export void OPM_Init (BOOLEAN *done, CHAR *mname, ADDRESS mname__len); +export void OPM_Init (BOOLEAN *done); export void OPM_InitOptions (void); export INT16 OPM_Integer (INT64 n); static BOOLEAN OPM_IsProbablyInstallDir (CHAR *s, ADDRESS s__len); @@ -449,7 +450,7 @@ void OPM_InitOptions (void) Files_SetSearchPath(searchpath, 1024); } -void OPM_Init (BOOLEAN *done, CHAR *mname, ADDRESS mname__len) +void OPM_Init (BOOLEAN *done) { Texts_Text T = NIL; INT32 beg, end, time; @@ -465,7 +466,6 @@ void OPM_Init (BOOLEAN *done, CHAR *mname, ADDRESS mname__len) Texts_Open(T, s, 256); OPM_LogWStr(s, 256); OPM_LogWStr((CHAR*)" ", 3); - __COPY(s, mname, mname__len); __COPY(s, OPM_SourceFileName, 256); if (T->len == 0) { OPM_LogWStr(s, 256); @@ -773,7 +773,7 @@ void OPM_OldSym (CHAR *modName, ADDRESS modName__len, BOOLEAN *done) Files_Set(&OPM_oldSF, Files_Rider__typ, OPM_oldSFile, 0); Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&tag); Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&ver); - if (tag != 0xf7 || ver != 0x82) { + if (tag != 0xf7 || ver != 0x83) { OPM_err(-306); OPM_CloseOldSym(); *done = 0; @@ -818,8 +818,20 @@ void OPM_RegisterNewSym (void) } } -void OPM_DeleteNewSym (void) +void OPM_DeleteNewSym (CHAR *modulename, ADDRESS modulename__len) { + OPM_FileName fn; + INT16 res; + OPM_MakeFileName((void*)modulename, modulename__len, (void*)fn, 32, (CHAR*)".sym", 5); + Files_Delete(fn, 32, &res); +} + +void OPM_DeleteObj (CHAR *modulename, ADDRESS modulename__len) +{ + OPM_FileName fn; + INT16 res; + OPM_MakeFileName((void*)modulename, modulename__len, (void*)fn, 32, (CHAR*)".o", 3); + Files_Delete(fn, 32, &res); } void OPM_NewSym (CHAR *modName, ADDRESS modName__len) @@ -830,7 +842,7 @@ void OPM_NewSym (CHAR *modName, ADDRESS modName__len) if (OPM_newSFile != NIL) { Files_Set(&OPM_newSF, Files_Rider__typ, OPM_newSFile, 0); Files_Write(&OPM_newSF, Files_Rider__typ, 0xf7); - Files_Write(&OPM_newSF, Files_Rider__typ, 0x82); + Files_Write(&OPM_newSF, Files_Rider__typ, 0x83); } else { OPM_err(153); } @@ -984,7 +996,7 @@ static void OPM_Append (Files_Rider *R, ADDRESS *R__typ, Files_File F) void OPM_OpenFiles (CHAR *moduleName, ADDRESS moduleName__len) { - CHAR FName[32]; + OPM_FileName FName; __COPY(moduleName, OPM_modName, 32); OPM_HFile = Files_New((CHAR*)"", 1); if (OPM_HFile != NIL) { @@ -1010,7 +1022,7 @@ void OPM_OpenFiles (CHAR *moduleName, ADDRESS moduleName__len) void OPM_CloseFiles (void) { - CHAR FName[32]; + OPM_FileName FName; INT16 res; if (OPM_noerr) { OPM_LogWStr((CHAR*)" ", 3); @@ -1048,26 +1060,26 @@ void OPM_CloseFiles (void) static BOOLEAN OPM_IsProbablyInstallDir (CHAR *s, ADDRESS s__len) { - CHAR testpath[1024]; + CHAR testpath[4096]; Platform_FileIdentity identity; __DUP(s, s__len, CHAR); - __COPY(OPM_InstallDir, testpath, 1024); - Strings_Append((CHAR*)"/lib/lib", 9, (void*)testpath, 1024); - Strings_Append((CHAR*)"voc", 4, (void*)testpath, 1024); - Strings_Append((CHAR*)"-O2.a", 6, (void*)testpath, 1024); - if (Platform_IdentifyByName(testpath, 1024, &identity, Platform_FileIdentity__typ) != 0) { + __COPY(OPM_InstallDir, testpath, 4096); + Strings_Append((CHAR*)"/lib/lib", 9, (void*)testpath, 4096); + Strings_Append((CHAR*)"voc", 4, (void*)testpath, 4096); + Strings_Append((CHAR*)"-O2.a", 6, (void*)testpath, 4096); + if (Platform_IdentifyByName(testpath, 4096, &identity, Platform_FileIdentity__typ) != 0) { __DEL(s); return 0; } - __COPY(OPM_InstallDir, testpath, 1024); - Strings_Append((CHAR*)"/2/include/Oberon.h", 20, (void*)testpath, 1024); - if (Platform_IdentifyByName(testpath, 1024, &identity, Platform_FileIdentity__typ) != 0) { + __COPY(OPM_InstallDir, testpath, 4096); + Strings_Append((CHAR*)"/2/include/Oberon.h", 20, (void*)testpath, 4096); + if (Platform_IdentifyByName(testpath, 4096, &identity, Platform_FileIdentity__typ) != 0) { __DEL(s); return 0; } - __COPY(OPM_InstallDir, testpath, 1024); - Strings_Append((CHAR*)"/2/sym/Files.sym", 17, (void*)testpath, 1024); - if (Platform_IdentifyByName(testpath, 1024, &identity, Platform_FileIdentity__typ) != 0) { + __COPY(OPM_InstallDir, testpath, 4096); + Strings_Append((CHAR*)"/2/sym/Files.sym", 17, (void*)testpath, 4096); + if (Platform_IdentifyByName(testpath, 4096, &identity, Platform_FileIdentity__typ) != 0) { __DEL(s); return 0; } @@ -1129,7 +1141,6 @@ export void *OPM__init(void) __REGMOD("OPM", EnumPtrs); __REGCMD("CloseFiles", OPM_CloseFiles); __REGCMD("CloseOldSym", OPM_CloseOldSym); - __REGCMD("DeleteNewSym", OPM_DeleteNewSym); __REGCMD("InitOptions", OPM_InitOptions); __REGCMD("LogWLn", OPM_LogWLn); __REGCMD("RegisterNewSym", OPM_RegisterNewSym); diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index dc86bc49..da0a48ee 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h @@ -23,13 +23,14 @@ import CHAR OPM_ResourceDir[1024]; import void OPM_CloseFiles (void); import void OPM_CloseOldSym (void); -import void OPM_DeleteNewSym (void); +import void OPM_DeleteNewSym (CHAR *modulename, ADDRESS modulename__len); +import void OPM_DeleteObj (CHAR *modulename, ADDRESS modulename__len); import void OPM_FPrint (INT32 *fp, INT64 val); import void OPM_FPrintLReal (INT32 *fp, LONGREAL val); import void OPM_FPrintReal (INT32 *fp, REAL val); import void OPM_FPrintSet (INT32 *fp, UINT64 val); import void OPM_Get (CHAR *ch); -import void OPM_Init (BOOLEAN *done, CHAR *mname, ADDRESS mname__len); +import void OPM_Init (BOOLEAN *done); import void OPM_InitOptions (void); import INT16 OPM_Integer (INT64 n); import void OPM_LogVT100 (CHAR *vt100code, ADDRESS vt100code__len); diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index 24e6b221..aad8367d 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -1793,24 +1793,6 @@ void OPP_Module (OPT_Node *prog, UINT32 opt) if (OPP_sym == 63) { OPS_Get(&OPP_sym); } else { - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Unexpected symbol found when MODULE expected:", 46); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)" sym: ", 15); - OPM_LogWNum(OPP_sym, 1); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)" OPS.name: ", 15); - OPM_LogWStr(OPS_name, 256); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)" OPS.str: ", 15); - OPM_LogWStr(OPS_str, 256); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)" OPS.numtyp: ", 15); - OPM_LogWNum(OPS_numtyp, 1); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)" OPS.intval: ", 15); - OPM_LogWNum(OPS_intval, 1); - OPM_LogWLn(); OPP_err(16); } if (OPP_sym == 38) { diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index bf0f96d7..dc8aa405 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index 807c0ce5..d0a1851a 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index a15d8712..608979a8 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index e9db362e..b95c2810 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -49,6 +49,15 @@ typedef INT8 glbmno[64]; } OPT_ImpCtxt; +typedef + struct OPT_LinkDesc *OPT_Link; + +typedef + struct OPT_LinkDesc { + OPS_Name name; + OPT_Link next; + } OPT_LinkDesc; + typedef struct OPT_NodeDesc *OPT_Node; @@ -101,6 +110,7 @@ static OPT_ExpCtxt OPT_expCtxt; static INT32 OPT_nofhdfld; static BOOLEAN OPT_newsf, OPT_findpc, OPT_extsf, OPT_sfpresent, OPT_symExtended, OPT_symNew; static INT32 OPT_recno; +export OPT_Link OPT_Links; export ADDRESS *OPT_ConstDesc__typ; export ADDRESS *OPT_ObjDesc__typ; @@ -108,6 +118,7 @@ export ADDRESS *OPT_StrDesc__typ; export ADDRESS *OPT_NodeDesc__typ; export ADDRESS *OPT_ImpCtxt__typ; export ADDRESS *OPT_ExpCtxt__typ; +export ADDRESS *OPT_LinkDesc__typ; export void OPT_Align (INT32 *adr, INT32 base); export INT32 OPT_BaseAlignment (OPT_Struct typ); @@ -131,6 +142,7 @@ export void OPT_IdFPrint (OPT_Struct typ); export void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); static void OPT_InConstant (INT32 f, OPT_Const conval); static OPT_Object OPT_InFld (void); +static void OPT_InLinks (void); static void OPT_InMod (INT8 *mno); static void OPT_InName (CHAR *name, ADDRESS name__len); static OPT_Object OPT_InObj (INT8 mno); @@ -154,6 +166,7 @@ export void OPT_OpenScope (INT8 level, OPT_Object owner); static void OPT_OutConstant (OPT_Object obj); static void OPT_OutFlds (OPT_Object fld, INT32 adr, BOOLEAN visible); static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, INT32 adr); +static void OPT_OutLinks (void); static void OPT_OutMod (INT16 mno); static void OPT_OutName (CHAR *name, ADDRESS name__len); static void OPT_OutObj (OPT_Object obj); @@ -442,6 +455,8 @@ void OPT_Init (OPS_Name name, UINT32 opt) OPT_findpc = __IN(8, opt, 32); OPT_extsf = OPT_newsf || __IN(9, opt, 32); OPT_sfpresent = 1; + __NEW(OPT_Links, OPT_LinkDesc); + __MOVE(name, OPT_Links->name, 256); } void OPT_Close (void) @@ -1011,6 +1026,26 @@ static void OPT_InMod (INT8 *mno) } } +static void OPT_InLinks (void) +{ + OPS_Name linkname; + OPT_Link l = NIL; + OPT_InName((void*)linkname, 256); + while (linkname[0] != 0x00) { + l = OPT_Links; + while ((l != NIL && __STRCMP(l->name, linkname) != 0)) { + l = l->next; + } + if (l == NIL) { + l = OPT_Links; + __NEW(OPT_Links, OPT_LinkDesc); + OPT_Links->next = l; + __MOVE(linkname, OPT_Links->name, 256); + } + OPT_InName((void*)linkname, 256); + } +} + static void OPT_InConstant (INT32 f, OPT_Const conval) { CHAR ch; @@ -1461,6 +1496,7 @@ void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) OPM_OldSym((void*)name, 256, &*done); if (*done) { OPT_InMod(&mno); + OPT_InLinks(); OPT_impCtxt.nextTag = OPM_SymRInt(); while (!OPM_eofSF()) { obj = OPT_InObj(mno); @@ -1507,6 +1543,17 @@ static void OPT_OutMod (INT16 mno) } } +static void OPT_OutLinks (void) +{ + OPT_Link l = NIL; + l = OPT_Links; + while (l != NIL) { + OPT_OutName((void*)l->name, 256); + l = l->next; + } + OPM_SymWCh(0x00); +} + static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, INT32 adr) { INT32 i, j, n; @@ -1833,6 +1880,7 @@ void OPT_Export (BOOLEAN *ext, BOOLEAN *new) if (OPM_noerr) { OPM_SymWInt(16); OPT_OutName((void*)OPT_SelfName, 256); + OPT_OutLinks(); OPT_expCtxt.reffp = 0; OPT_expCtxt.ref = 14; OPT_expCtxt.nofm = 1; @@ -1854,7 +1902,7 @@ void OPT_Export (BOOLEAN *ext, BOOLEAN *new) OPT_newsf = 0; OPT_symNew = 0; if (!OPM_noerr || OPT_findpc) { - OPM_DeleteNewSym(); + OPM_DeleteNewSym((void*)OPT_SelfName, 256); } } } @@ -1969,6 +2017,7 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_universe); P(OPT_syslink); __ENUMR(&OPT_impCtxt, OPT_ImpCtxt__typ, 3140, 1, P); + P(OPT_Links); } __TDESC(OPT_ConstDesc, 1, 1) = {__TDFLDS("ConstDesc", 40), {0, -8}}; @@ -2008,6 +2057,7 @@ __TDESC(OPT_ImpCtxt, 1, 510) = {__TDFLDS("ImpCtxt", 3140), {16, 20, 24, 28, 32, 1936, 1940, 1944, 1948, 1952, 1956, 1960, 1964, 1968, 1972, 1976, 1980, 1984, 1988, 1992, 1996, 2000, 2004, 2008, 2012, 2016, 2020, 2024, 2028, 2032, 2036, 2040, 2044, 2048, 2052, -2044}}; __TDESC(OPT_ExpCtxt, 1, 0) = {__TDFLDS("ExpCtxt", 72), {-4}}; +__TDESC(OPT_LinkDesc, 1, 1) = {__TDFLDS("LinkDesc", 260), {256, -8}}; export void *OPT__init(void) { @@ -2024,6 +2074,7 @@ export void *OPT__init(void) __INITYP(OPT_NodeDesc, OPT_NodeDesc, 0); __INITYP(OPT_ImpCtxt, OPT_ImpCtxt, 0); __INITYP(OPT_ExpCtxt, OPT_ExpCtxt, 0); + __INITYP(OPT_LinkDesc, OPT_LinkDesc, 0); /* BEGIN */ OPT_topScope = NIL; OPT_OpenScope(0, NIL); diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index 9a187fc7..7483f169 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h @@ -21,6 +21,15 @@ typedef LONGREAL realval; } OPT_ConstDesc; +typedef + struct OPT_LinkDesc *OPT_Link; + +typedef + struct OPT_LinkDesc { + OPS_Name name; + OPT_Link next; + } OPT_LinkDesc; + typedef struct OPT_NodeDesc *OPT_Node; @@ -75,11 +84,13 @@ import INT8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; import BOOLEAN OPT_SYSimported; +import OPT_Link OPT_Links; import ADDRESS *OPT_ConstDesc__typ; import ADDRESS *OPT_ObjDesc__typ; import ADDRESS *OPT_StrDesc__typ; import ADDRESS *OPT_NodeDesc__typ; +import ADDRESS *OPT_LinkDesc__typ; import void OPT_Align (INT32 *adr, INT32 base); import INT32 OPT_BaseAlignment (OPT_Struct typ); diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index 96252046..152db225 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index 5654d36e..7c94fced 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Out.c b/bootstrap/unix-48/Out.c index 9248cfc5..d1fba01a 100644 --- a/bootstrap/unix-48/Out.c +++ b/bootstrap/unix-48/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Out.h b/bootstrap/unix-48/Out.h index ffbd6894..a7195e3a 100644 --- a/bootstrap/unix-48/Out.h +++ b/bootstrap/unix-48/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 027176ed..6117b38b 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index 79d88e9d..521594dc 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 2ecd8371..11ad01bd 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index 570e7d72..bf708519 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index f911a688..06972c90 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index 7645aa6e..fd7f283d 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index c0bfc16a..285e7ac0 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index cd0f72ee..7f7d6562 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/VT100.c b/bootstrap/unix-48/VT100.c index 1e0fffa9..baa92092 100644 --- a/bootstrap/unix-48/VT100.c +++ b/bootstrap/unix-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/VT100.h b/bootstrap/unix-48/VT100.h index 7522f9d1..4c0087ac 100644 --- a/bootstrap/unix-48/VT100.h +++ b/bootstrap/unix-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index d2c67400..75768aca 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index fb167591..fb870961 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/Compiler.c b/bootstrap/unix-88/Compiler.c index 454ea490..f26c1a32 100644 --- a/bootstrap/unix-88/Compiler.c +++ b/bootstrap/unix-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 @@ -20,9 +20,9 @@ #include "extTools.h" -static CHAR Compiler_mname[256]; +static void Compiler_FindLocalObjectFiles (CHAR *objectnames, ADDRESS objectnames__len); export void Compiler_Module (BOOLEAN *done); static void Compiler_PropagateElementaryTypeSizes (void); export void Compiler_Translate (void); @@ -41,11 +41,12 @@ void Compiler_Module (BOOLEAN *done) OPT_Export(&ext, &new); if (OPM_noerr) { OPM_OpenFiles((void*)OPT_SelfName, 256); + OPM_DeleteObj((void*)OPT_SelfName, 256); OPC_Init(); OPV_Module(p); if (OPM_noerr) { if ((__IN(10, OPM_Options, 32) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { - OPM_DeleteNewSym(); + OPM_DeleteNewSym((void*)OPT_SelfName, 256); OPM_LogVT100((CHAR*)"32m", 4); OPM_LogWStr((CHAR*)" Main program.", 16); OPM_LogVT100((CHAR*)"0m", 3); @@ -61,7 +62,7 @@ void Compiler_Module (BOOLEAN *done) } } } else { - OPM_DeleteNewSym(); + OPM_DeleteNewSym((void*)OPT_SelfName, 256); } } } @@ -104,14 +105,44 @@ static void Compiler_PropagateElementaryTypeSizes (void) } } +static void Compiler_FindLocalObjectFiles (CHAR *objectnames, ADDRESS objectnames__len) +{ + OPT_Link l = NIL; + CHAR fn[64]; + Platform_FileIdentity id; + objectnames[0] = 0x00; + l = OPT_Links; + while (l != NIL) { + __COPY(l->name, fn, 64); + Strings_Append((CHAR*)".sym", 5, (void*)fn, 64); + if (Platform_IdentifyByName(fn, 64, &id, Platform_FileIdentity__typ) == 0) { + __COPY(l->name, fn, 64); + Strings_Append((CHAR*)".o", 3, (void*)fn, 64); + if (Platform_IdentifyByName(fn, 64, &id, Platform_FileIdentity__typ) == 0) { + Strings_Append((CHAR*)" ", 2, (void*)objectnames, objectnames__len); + Strings_Append(fn, 64, (void*)objectnames, objectnames__len); + } else { + OPM_LogVT100((CHAR*)"33m", 4); + OPM_LogWStr((CHAR*)"Link warning: a local symbol file is present for module ", 57); + OPM_LogWStr(l->name, 256); + OPM_LogWStr((CHAR*)", but local object file '", 26); + OPM_LogWStr(fn, 64); + OPM_LogWStr((CHAR*)"' is missing.", 14); + OPM_LogVT100((CHAR*)"0m", 3); + OPM_LogWLn(); + } + } + l = l->next; + } +} + void Compiler_Translate (void) { BOOLEAN done; - CHAR modulesobj[2048]; - modulesobj[0] = 0x00; + CHAR linkfiles[2048]; if (OPM_OpenPar()) { for (;;) { - OPM_Init(&done, (void*)Compiler_mname, 256); + OPM_Init(&done); if (!done) { return; } @@ -131,11 +162,9 @@ void Compiler_Translate (void) } else { if (!__IN(10, OPM_Options, 32)) { extTools_Assemble(OPM_modName, 32); - Strings_Append((CHAR*)" ", 2, (void*)modulesobj, 2048); - Strings_Append(OPM_modName, 32, (void*)modulesobj, 2048); - Strings_Append((CHAR*)".o", 3, (void*)modulesobj, 2048); } else { - extTools_LinkMain((void*)OPM_modName, 32, __IN(15, OPM_Options, 32), modulesobj, 2048); + Compiler_FindLocalObjectFiles((void*)linkfiles, 2048); + extTools_LinkMain((void*)OPM_modName, 32, __IN(15, OPM_Options, 32), linkfiles, 2048); } } } diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index abf165f3..18ec858a 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index eb712e53..efd4ae6e 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 3aeb5911..4a5cec7c 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index b67b65f7..987ffaf2 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index 3f4e96ee..ba215672 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index aac7c8fe..bbd83594 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 821e6801..037d74d0 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index c7f011df..be3fd68b 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index c163c77e..3933cee1 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index 7b8e9d38..9f8518b8 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index fef86e9e..24cd4f3f 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index a2b14bdc..99b9afb4 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index cb39afd5..2bc2c145 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -49,7 +49,8 @@ export CHAR OPM_ResourceDir[1024]; static void OPM_Append (Files_Rider *R, ADDRESS *R__typ, Files_File F); export void OPM_CloseFiles (void); export void OPM_CloseOldSym (void); -export void OPM_DeleteNewSym (void); +export void OPM_DeleteNewSym (CHAR *modulename, ADDRESS modulename__len); +export void OPM_DeleteObj (CHAR *modulename, ADDRESS modulename__len); export void OPM_FPrint (INT32 *fp, INT64 val); export void OPM_FPrintLReal (INT32 *fp, LONGREAL val); export void OPM_FPrintReal (INT32 *fp, REAL val); @@ -58,7 +59,7 @@ static void OPM_FindInstallDir (void); static void OPM_FindLine (Files_File f, Files_Rider *r, ADDRESS *r__typ, INT64 pos); static void OPM_FingerprintBytes (INT32 *fp, SYSTEM_BYTE *bytes, ADDRESS bytes__len); export void OPM_Get (CHAR *ch); -export void OPM_Init (BOOLEAN *done, CHAR *mname, ADDRESS mname__len); +export void OPM_Init (BOOLEAN *done); export void OPM_InitOptions (void); export INT16 OPM_Integer (INT64 n); static BOOLEAN OPM_IsProbablyInstallDir (CHAR *s, ADDRESS s__len); @@ -449,7 +450,7 @@ void OPM_InitOptions (void) Files_SetSearchPath(searchpath, 1024); } -void OPM_Init (BOOLEAN *done, CHAR *mname, ADDRESS mname__len) +void OPM_Init (BOOLEAN *done) { Texts_Text T = NIL; INT32 beg, end, time; @@ -465,7 +466,6 @@ void OPM_Init (BOOLEAN *done, CHAR *mname, ADDRESS mname__len) Texts_Open(T, s, 256); OPM_LogWStr(s, 256); OPM_LogWStr((CHAR*)" ", 3); - __COPY(s, mname, mname__len); __COPY(s, OPM_SourceFileName, 256); if (T->len == 0) { OPM_LogWStr(s, 256); @@ -773,7 +773,7 @@ void OPM_OldSym (CHAR *modName, ADDRESS modName__len, BOOLEAN *done) Files_Set(&OPM_oldSF, Files_Rider__typ, OPM_oldSFile, 0); Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&tag); Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&ver); - if (tag != 0xf7 || ver != 0x82) { + if (tag != 0xf7 || ver != 0x83) { OPM_err(-306); OPM_CloseOldSym(); *done = 0; @@ -818,8 +818,20 @@ void OPM_RegisterNewSym (void) } } -void OPM_DeleteNewSym (void) +void OPM_DeleteNewSym (CHAR *modulename, ADDRESS modulename__len) { + OPM_FileName fn; + INT16 res; + OPM_MakeFileName((void*)modulename, modulename__len, (void*)fn, 32, (CHAR*)".sym", 5); + Files_Delete(fn, 32, &res); +} + +void OPM_DeleteObj (CHAR *modulename, ADDRESS modulename__len) +{ + OPM_FileName fn; + INT16 res; + OPM_MakeFileName((void*)modulename, modulename__len, (void*)fn, 32, (CHAR*)".o", 3); + Files_Delete(fn, 32, &res); } void OPM_NewSym (CHAR *modName, ADDRESS modName__len) @@ -830,7 +842,7 @@ void OPM_NewSym (CHAR *modName, ADDRESS modName__len) if (OPM_newSFile != NIL) { Files_Set(&OPM_newSF, Files_Rider__typ, OPM_newSFile, 0); Files_Write(&OPM_newSF, Files_Rider__typ, 0xf7); - Files_Write(&OPM_newSF, Files_Rider__typ, 0x82); + Files_Write(&OPM_newSF, Files_Rider__typ, 0x83); } else { OPM_err(153); } @@ -984,7 +996,7 @@ static void OPM_Append (Files_Rider *R, ADDRESS *R__typ, Files_File F) void OPM_OpenFiles (CHAR *moduleName, ADDRESS moduleName__len) { - CHAR FName[32]; + OPM_FileName FName; __COPY(moduleName, OPM_modName, 32); OPM_HFile = Files_New((CHAR*)"", 1); if (OPM_HFile != NIL) { @@ -1010,7 +1022,7 @@ void OPM_OpenFiles (CHAR *moduleName, ADDRESS moduleName__len) void OPM_CloseFiles (void) { - CHAR FName[32]; + OPM_FileName FName; INT16 res; if (OPM_noerr) { OPM_LogWStr((CHAR*)" ", 3); @@ -1048,26 +1060,26 @@ void OPM_CloseFiles (void) static BOOLEAN OPM_IsProbablyInstallDir (CHAR *s, ADDRESS s__len) { - CHAR testpath[1024]; + CHAR testpath[4096]; Platform_FileIdentity identity; __DUP(s, s__len, CHAR); - __COPY(OPM_InstallDir, testpath, 1024); - Strings_Append((CHAR*)"/lib/lib", 9, (void*)testpath, 1024); - Strings_Append((CHAR*)"voc", 4, (void*)testpath, 1024); - Strings_Append((CHAR*)"-O2.a", 6, (void*)testpath, 1024); - if (Platform_IdentifyByName(testpath, 1024, &identity, Platform_FileIdentity__typ) != 0) { + __COPY(OPM_InstallDir, testpath, 4096); + Strings_Append((CHAR*)"/lib/lib", 9, (void*)testpath, 4096); + Strings_Append((CHAR*)"voc", 4, (void*)testpath, 4096); + Strings_Append((CHAR*)"-O2.a", 6, (void*)testpath, 4096); + if (Platform_IdentifyByName(testpath, 4096, &identity, Platform_FileIdentity__typ) != 0) { __DEL(s); return 0; } - __COPY(OPM_InstallDir, testpath, 1024); - Strings_Append((CHAR*)"/2/include/Oberon.h", 20, (void*)testpath, 1024); - if (Platform_IdentifyByName(testpath, 1024, &identity, Platform_FileIdentity__typ) != 0) { + __COPY(OPM_InstallDir, testpath, 4096); + Strings_Append((CHAR*)"/2/include/Oberon.h", 20, (void*)testpath, 4096); + if (Platform_IdentifyByName(testpath, 4096, &identity, Platform_FileIdentity__typ) != 0) { __DEL(s); return 0; } - __COPY(OPM_InstallDir, testpath, 1024); - Strings_Append((CHAR*)"/2/sym/Files.sym", 17, (void*)testpath, 1024); - if (Platform_IdentifyByName(testpath, 1024, &identity, Platform_FileIdentity__typ) != 0) { + __COPY(OPM_InstallDir, testpath, 4096); + Strings_Append((CHAR*)"/2/sym/Files.sym", 17, (void*)testpath, 4096); + if (Platform_IdentifyByName(testpath, 4096, &identity, Platform_FileIdentity__typ) != 0) { __DEL(s); return 0; } @@ -1129,7 +1141,6 @@ export void *OPM__init(void) __REGMOD("OPM", EnumPtrs); __REGCMD("CloseFiles", OPM_CloseFiles); __REGCMD("CloseOldSym", OPM_CloseOldSym); - __REGCMD("DeleteNewSym", OPM_DeleteNewSym); __REGCMD("InitOptions", OPM_InitOptions); __REGCMD("LogWLn", OPM_LogWLn); __REGCMD("RegisterNewSym", OPM_RegisterNewSym); diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index dc86bc49..da0a48ee 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h @@ -23,13 +23,14 @@ import CHAR OPM_ResourceDir[1024]; import void OPM_CloseFiles (void); import void OPM_CloseOldSym (void); -import void OPM_DeleteNewSym (void); +import void OPM_DeleteNewSym (CHAR *modulename, ADDRESS modulename__len); +import void OPM_DeleteObj (CHAR *modulename, ADDRESS modulename__len); import void OPM_FPrint (INT32 *fp, INT64 val); import void OPM_FPrintLReal (INT32 *fp, LONGREAL val); import void OPM_FPrintReal (INT32 *fp, REAL val); import void OPM_FPrintSet (INT32 *fp, UINT64 val); import void OPM_Get (CHAR *ch); -import void OPM_Init (BOOLEAN *done, CHAR *mname, ADDRESS mname__len); +import void OPM_Init (BOOLEAN *done); import void OPM_InitOptions (void); import INT16 OPM_Integer (INT64 n); import void OPM_LogVT100 (CHAR *vt100code, ADDRESS vt100code__len); diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index 25c453d1..0a6a6796 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -1793,24 +1793,6 @@ void OPP_Module (OPT_Node *prog, UINT32 opt) if (OPP_sym == 63) { OPS_Get(&OPP_sym); } else { - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Unexpected symbol found when MODULE expected:", 46); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)" sym: ", 15); - OPM_LogWNum(OPP_sym, 1); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)" OPS.name: ", 15); - OPM_LogWStr(OPS_name, 256); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)" OPS.str: ", 15); - OPM_LogWStr(OPS_str, 256); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)" OPS.numtyp: ", 15); - OPM_LogWNum(OPS_numtyp, 1); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)" OPS.intval: ", 15); - OPM_LogWNum(OPS_intval, 1); - OPM_LogWLn(); OPP_err(16); } if (OPP_sym == 38) { diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index bf0f96d7..dc8aa405 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index 807c0ce5..d0a1851a 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index a15d8712..608979a8 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index 8fb5d86e..1a106cda 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -49,6 +49,15 @@ typedef INT8 glbmno[64]; } OPT_ImpCtxt; +typedef + struct OPT_LinkDesc *OPT_Link; + +typedef + struct OPT_LinkDesc { + OPS_Name name; + OPT_Link next; + } OPT_LinkDesc; + typedef struct OPT_NodeDesc *OPT_Node; @@ -101,6 +110,7 @@ static OPT_ExpCtxt OPT_expCtxt; static INT32 OPT_nofhdfld; static BOOLEAN OPT_newsf, OPT_findpc, OPT_extsf, OPT_sfpresent, OPT_symExtended, OPT_symNew; static INT32 OPT_recno; +export OPT_Link OPT_Links; export ADDRESS *OPT_ConstDesc__typ; export ADDRESS *OPT_ObjDesc__typ; @@ -108,6 +118,7 @@ export ADDRESS *OPT_StrDesc__typ; export ADDRESS *OPT_NodeDesc__typ; export ADDRESS *OPT_ImpCtxt__typ; export ADDRESS *OPT_ExpCtxt__typ; +export ADDRESS *OPT_LinkDesc__typ; export void OPT_Align (INT32 *adr, INT32 base); export INT32 OPT_BaseAlignment (OPT_Struct typ); @@ -131,6 +142,7 @@ export void OPT_IdFPrint (OPT_Struct typ); export void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); static void OPT_InConstant (INT32 f, OPT_Const conval); static OPT_Object OPT_InFld (void); +static void OPT_InLinks (void); static void OPT_InMod (INT8 *mno); static void OPT_InName (CHAR *name, ADDRESS name__len); static OPT_Object OPT_InObj (INT8 mno); @@ -154,6 +166,7 @@ export void OPT_OpenScope (INT8 level, OPT_Object owner); static void OPT_OutConstant (OPT_Object obj); static void OPT_OutFlds (OPT_Object fld, INT32 adr, BOOLEAN visible); static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, INT32 adr); +static void OPT_OutLinks (void); static void OPT_OutMod (INT16 mno); static void OPT_OutName (CHAR *name, ADDRESS name__len); static void OPT_OutObj (OPT_Object obj); @@ -442,6 +455,8 @@ void OPT_Init (OPS_Name name, UINT32 opt) OPT_findpc = __IN(8, opt, 32); OPT_extsf = OPT_newsf || __IN(9, opt, 32); OPT_sfpresent = 1; + __NEW(OPT_Links, OPT_LinkDesc); + __MOVE(name, OPT_Links->name, 256); } void OPT_Close (void) @@ -1011,6 +1026,26 @@ static void OPT_InMod (INT8 *mno) } } +static void OPT_InLinks (void) +{ + OPS_Name linkname; + OPT_Link l = NIL; + OPT_InName((void*)linkname, 256); + while (linkname[0] != 0x00) { + l = OPT_Links; + while ((l != NIL && __STRCMP(l->name, linkname) != 0)) { + l = l->next; + } + if (l == NIL) { + l = OPT_Links; + __NEW(OPT_Links, OPT_LinkDesc); + OPT_Links->next = l; + __MOVE(linkname, OPT_Links->name, 256); + } + OPT_InName((void*)linkname, 256); + } +} + static void OPT_InConstant (INT32 f, OPT_Const conval) { CHAR ch; @@ -1461,6 +1496,7 @@ void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) OPM_OldSym((void*)name, 256, &*done); if (*done) { OPT_InMod(&mno); + OPT_InLinks(); OPT_impCtxt.nextTag = OPM_SymRInt(); while (!OPM_eofSF()) { obj = OPT_InObj(mno); @@ -1507,6 +1543,17 @@ static void OPT_OutMod (INT16 mno) } } +static void OPT_OutLinks (void) +{ + OPT_Link l = NIL; + l = OPT_Links; + while (l != NIL) { + OPT_OutName((void*)l->name, 256); + l = l->next; + } + OPM_SymWCh(0x00); +} + static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, INT32 adr) { INT32 i, j, n; @@ -1833,6 +1880,7 @@ void OPT_Export (BOOLEAN *ext, BOOLEAN *new) if (OPM_noerr) { OPM_SymWInt(16); OPT_OutName((void*)OPT_SelfName, 256); + OPT_OutLinks(); OPT_expCtxt.reffp = 0; OPT_expCtxt.ref = 14; OPT_expCtxt.nofm = 1; @@ -1854,7 +1902,7 @@ void OPT_Export (BOOLEAN *ext, BOOLEAN *new) OPT_newsf = 0; OPT_symNew = 0; if (!OPM_noerr || OPT_findpc) { - OPM_DeleteNewSym(); + OPM_DeleteNewSym((void*)OPT_SelfName, 256); } } } @@ -1969,6 +2017,7 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_universe); P(OPT_syslink); __ENUMR(&OPT_impCtxt, OPT_ImpCtxt__typ, 5184, 1, P); + P(OPT_Links); } __TDESC(OPT_ConstDesc, 1, 1) = {__TDFLDS("ConstDesc", 40), {0, -16}}; @@ -2008,6 +2057,7 @@ __TDESC(OPT_ImpCtxt, 1, 510) = {__TDFLDS("ImpCtxt", 5184), {16, 24, 32, 40, 48, 3856, 3864, 3872, 3880, 3888, 3896, 3904, 3912, 3920, 3928, 3936, 3944, 3952, 3960, 3968, 3976, 3984, 3992, 4000, 4008, 4016, 4024, 4032, 4040, 4048, 4056, 4064, 4072, 4080, 4088, -4088}}; __TDESC(OPT_ExpCtxt, 1, 0) = {__TDFLDS("ExpCtxt", 72), {-8}}; +__TDESC(OPT_LinkDesc, 1, 1) = {__TDFLDS("LinkDesc", 264), {256, -16}}; export void *OPT__init(void) { @@ -2024,6 +2074,7 @@ export void *OPT__init(void) __INITYP(OPT_NodeDesc, OPT_NodeDesc, 0); __INITYP(OPT_ImpCtxt, OPT_ImpCtxt, 0); __INITYP(OPT_ExpCtxt, OPT_ExpCtxt, 0); + __INITYP(OPT_LinkDesc, OPT_LinkDesc, 0); /* BEGIN */ OPT_topScope = NIL; OPT_OpenScope(0, NIL); diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 9a187fc7..7483f169 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h @@ -21,6 +21,15 @@ typedef LONGREAL realval; } OPT_ConstDesc; +typedef + struct OPT_LinkDesc *OPT_Link; + +typedef + struct OPT_LinkDesc { + OPS_Name name; + OPT_Link next; + } OPT_LinkDesc; + typedef struct OPT_NodeDesc *OPT_Node; @@ -75,11 +84,13 @@ import INT8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; import BOOLEAN OPT_SYSimported; +import OPT_Link OPT_Links; import ADDRESS *OPT_ConstDesc__typ; import ADDRESS *OPT_ObjDesc__typ; import ADDRESS *OPT_StrDesc__typ; import ADDRESS *OPT_NodeDesc__typ; +import ADDRESS *OPT_LinkDesc__typ; import void OPT_Align (INT32 *adr, INT32 base); import INT32 OPT_BaseAlignment (OPT_Struct typ); diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index ab98ed73..4d29b076 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index 5654d36e..7c94fced 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Out.c b/bootstrap/unix-88/Out.c index a55f91eb..e24a77fc 100644 --- a/bootstrap/unix-88/Out.c +++ b/bootstrap/unix-88/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Out.h b/bootstrap/unix-88/Out.h index b846b299..311e737d 100644 --- a/bootstrap/unix-88/Out.h +++ b/bootstrap/unix-88/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 56d7144c..7ed88d75 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index 000bcc79..9b911314 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 2ecd8371..11ad01bd 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index 570e7d72..bf708519 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index f911a688..06972c90 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index 7645aa6e..fd7f283d 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index 74cd62c7..2bfa4511 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index be7b64a2..21401f61 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/VT100.c b/bootstrap/unix-88/VT100.c index 1e0fffa9..baa92092 100644 --- a/bootstrap/unix-88/VT100.c +++ b/bootstrap/unix-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/VT100.h b/bootstrap/unix-88/VT100.h index 7522f9d1..4c0087ac 100644 --- a/bootstrap/unix-88/VT100.h +++ b/bootstrap/unix-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index d2c67400..75768aca 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index fb167591..fb870961 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/Compiler.c b/bootstrap/windows-48/Compiler.c index 454ea490..f26c1a32 100644 --- a/bootstrap/windows-48/Compiler.c +++ b/bootstrap/windows-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 @@ -20,9 +20,9 @@ #include "extTools.h" -static CHAR Compiler_mname[256]; +static void Compiler_FindLocalObjectFiles (CHAR *objectnames, ADDRESS objectnames__len); export void Compiler_Module (BOOLEAN *done); static void Compiler_PropagateElementaryTypeSizes (void); export void Compiler_Translate (void); @@ -41,11 +41,12 @@ void Compiler_Module (BOOLEAN *done) OPT_Export(&ext, &new); if (OPM_noerr) { OPM_OpenFiles((void*)OPT_SelfName, 256); + OPM_DeleteObj((void*)OPT_SelfName, 256); OPC_Init(); OPV_Module(p); if (OPM_noerr) { if ((__IN(10, OPM_Options, 32) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { - OPM_DeleteNewSym(); + OPM_DeleteNewSym((void*)OPT_SelfName, 256); OPM_LogVT100((CHAR*)"32m", 4); OPM_LogWStr((CHAR*)" Main program.", 16); OPM_LogVT100((CHAR*)"0m", 3); @@ -61,7 +62,7 @@ void Compiler_Module (BOOLEAN *done) } } } else { - OPM_DeleteNewSym(); + OPM_DeleteNewSym((void*)OPT_SelfName, 256); } } } @@ -104,14 +105,44 @@ static void Compiler_PropagateElementaryTypeSizes (void) } } +static void Compiler_FindLocalObjectFiles (CHAR *objectnames, ADDRESS objectnames__len) +{ + OPT_Link l = NIL; + CHAR fn[64]; + Platform_FileIdentity id; + objectnames[0] = 0x00; + l = OPT_Links; + while (l != NIL) { + __COPY(l->name, fn, 64); + Strings_Append((CHAR*)".sym", 5, (void*)fn, 64); + if (Platform_IdentifyByName(fn, 64, &id, Platform_FileIdentity__typ) == 0) { + __COPY(l->name, fn, 64); + Strings_Append((CHAR*)".o", 3, (void*)fn, 64); + if (Platform_IdentifyByName(fn, 64, &id, Platform_FileIdentity__typ) == 0) { + Strings_Append((CHAR*)" ", 2, (void*)objectnames, objectnames__len); + Strings_Append(fn, 64, (void*)objectnames, objectnames__len); + } else { + OPM_LogVT100((CHAR*)"33m", 4); + OPM_LogWStr((CHAR*)"Link warning: a local symbol file is present for module ", 57); + OPM_LogWStr(l->name, 256); + OPM_LogWStr((CHAR*)", but local object file '", 26); + OPM_LogWStr(fn, 64); + OPM_LogWStr((CHAR*)"' is missing.", 14); + OPM_LogVT100((CHAR*)"0m", 3); + OPM_LogWLn(); + } + } + l = l->next; + } +} + void Compiler_Translate (void) { BOOLEAN done; - CHAR modulesobj[2048]; - modulesobj[0] = 0x00; + CHAR linkfiles[2048]; if (OPM_OpenPar()) { for (;;) { - OPM_Init(&done, (void*)Compiler_mname, 256); + OPM_Init(&done); if (!done) { return; } @@ -131,11 +162,9 @@ void Compiler_Translate (void) } else { if (!__IN(10, OPM_Options, 32)) { extTools_Assemble(OPM_modName, 32); - Strings_Append((CHAR*)" ", 2, (void*)modulesobj, 2048); - Strings_Append(OPM_modName, 32, (void*)modulesobj, 2048); - Strings_Append((CHAR*)".o", 3, (void*)modulesobj, 2048); } else { - extTools_LinkMain((void*)OPM_modName, 32, __IN(15, OPM_Options, 32), modulesobj, 2048); + Compiler_FindLocalObjectFiles((void*)linkfiles, 2048); + extTools_LinkMain((void*)OPM_modName, 32, __IN(15, OPM_Options, 32), linkfiles, 2048); } } } diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index abf165f3..18ec858a 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index eb712e53..efd4ae6e 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 38d67ccf..a5c597ca 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index e1da6139..63eaa089 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index 495e451c..df3d086b 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index 7429d8c8..7a464dbf 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index 9cd53060..859d31ba 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index 42f06075..9f691749 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index c163c77e..3933cee1 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index 7b8e9d38..9f8518b8 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index fef86e9e..24cd4f3f 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index a2b14bdc..99b9afb4 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index d09d6a7a..3411635b 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -49,7 +49,8 @@ export CHAR OPM_ResourceDir[1024]; static void OPM_Append (Files_Rider *R, ADDRESS *R__typ, Files_File F); export void OPM_CloseFiles (void); export void OPM_CloseOldSym (void); -export void OPM_DeleteNewSym (void); +export void OPM_DeleteNewSym (CHAR *modulename, ADDRESS modulename__len); +export void OPM_DeleteObj (CHAR *modulename, ADDRESS modulename__len); export void OPM_FPrint (INT32 *fp, INT64 val); export void OPM_FPrintLReal (INT32 *fp, LONGREAL val); export void OPM_FPrintReal (INT32 *fp, REAL val); @@ -58,7 +59,7 @@ static void OPM_FindInstallDir (void); static void OPM_FindLine (Files_File f, Files_Rider *r, ADDRESS *r__typ, INT64 pos); static void OPM_FingerprintBytes (INT32 *fp, SYSTEM_BYTE *bytes, ADDRESS bytes__len); export void OPM_Get (CHAR *ch); -export void OPM_Init (BOOLEAN *done, CHAR *mname, ADDRESS mname__len); +export void OPM_Init (BOOLEAN *done); export void OPM_InitOptions (void); export INT16 OPM_Integer (INT64 n); static BOOLEAN OPM_IsProbablyInstallDir (CHAR *s, ADDRESS s__len); @@ -449,7 +450,7 @@ void OPM_InitOptions (void) Files_SetSearchPath(searchpath, 1024); } -void OPM_Init (BOOLEAN *done, CHAR *mname, ADDRESS mname__len) +void OPM_Init (BOOLEAN *done) { Texts_Text T = NIL; INT32 beg, end, time; @@ -465,7 +466,6 @@ void OPM_Init (BOOLEAN *done, CHAR *mname, ADDRESS mname__len) Texts_Open(T, s, 256); OPM_LogWStr(s, 256); OPM_LogWStr((CHAR*)" ", 3); - __COPY(s, mname, mname__len); __COPY(s, OPM_SourceFileName, 256); if (T->len == 0) { OPM_LogWStr(s, 256); @@ -773,7 +773,7 @@ void OPM_OldSym (CHAR *modName, ADDRESS modName__len, BOOLEAN *done) Files_Set(&OPM_oldSF, Files_Rider__typ, OPM_oldSFile, 0); Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&tag); Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&ver); - if (tag != 0xf7 || ver != 0x82) { + if (tag != 0xf7 || ver != 0x83) { OPM_err(-306); OPM_CloseOldSym(); *done = 0; @@ -818,8 +818,20 @@ void OPM_RegisterNewSym (void) } } -void OPM_DeleteNewSym (void) +void OPM_DeleteNewSym (CHAR *modulename, ADDRESS modulename__len) { + OPM_FileName fn; + INT16 res; + OPM_MakeFileName((void*)modulename, modulename__len, (void*)fn, 32, (CHAR*)".sym", 5); + Files_Delete(fn, 32, &res); +} + +void OPM_DeleteObj (CHAR *modulename, ADDRESS modulename__len) +{ + OPM_FileName fn; + INT16 res; + OPM_MakeFileName((void*)modulename, modulename__len, (void*)fn, 32, (CHAR*)".o", 3); + Files_Delete(fn, 32, &res); } void OPM_NewSym (CHAR *modName, ADDRESS modName__len) @@ -830,7 +842,7 @@ void OPM_NewSym (CHAR *modName, ADDRESS modName__len) if (OPM_newSFile != NIL) { Files_Set(&OPM_newSF, Files_Rider__typ, OPM_newSFile, 0); Files_Write(&OPM_newSF, Files_Rider__typ, 0xf7); - Files_Write(&OPM_newSF, Files_Rider__typ, 0x82); + Files_Write(&OPM_newSF, Files_Rider__typ, 0x83); } else { OPM_err(153); } @@ -984,7 +996,7 @@ static void OPM_Append (Files_Rider *R, ADDRESS *R__typ, Files_File F) void OPM_OpenFiles (CHAR *moduleName, ADDRESS moduleName__len) { - CHAR FName[32]; + OPM_FileName FName; __COPY(moduleName, OPM_modName, 32); OPM_HFile = Files_New((CHAR*)"", 1); if (OPM_HFile != NIL) { @@ -1010,7 +1022,7 @@ void OPM_OpenFiles (CHAR *moduleName, ADDRESS moduleName__len) void OPM_CloseFiles (void) { - CHAR FName[32]; + OPM_FileName FName; INT16 res; if (OPM_noerr) { OPM_LogWStr((CHAR*)" ", 3); @@ -1048,26 +1060,26 @@ void OPM_CloseFiles (void) static BOOLEAN OPM_IsProbablyInstallDir (CHAR *s, ADDRESS s__len) { - CHAR testpath[1024]; + CHAR testpath[4096]; Platform_FileIdentity identity; __DUP(s, s__len, CHAR); - __COPY(OPM_InstallDir, testpath, 1024); - Strings_Append((CHAR*)"/lib/lib", 9, (void*)testpath, 1024); - Strings_Append((CHAR*)"voc", 4, (void*)testpath, 1024); - Strings_Append((CHAR*)"-O2.a", 6, (void*)testpath, 1024); - if (Platform_IdentifyByName(testpath, 1024, &identity, Platform_FileIdentity__typ) != 0) { + __COPY(OPM_InstallDir, testpath, 4096); + Strings_Append((CHAR*)"/lib/lib", 9, (void*)testpath, 4096); + Strings_Append((CHAR*)"voc", 4, (void*)testpath, 4096); + Strings_Append((CHAR*)"-O2.a", 6, (void*)testpath, 4096); + if (Platform_IdentifyByName(testpath, 4096, &identity, Platform_FileIdentity__typ) != 0) { __DEL(s); return 0; } - __COPY(OPM_InstallDir, testpath, 1024); - Strings_Append((CHAR*)"/2/include/Oberon.h", 20, (void*)testpath, 1024); - if (Platform_IdentifyByName(testpath, 1024, &identity, Platform_FileIdentity__typ) != 0) { + __COPY(OPM_InstallDir, testpath, 4096); + Strings_Append((CHAR*)"/2/include/Oberon.h", 20, (void*)testpath, 4096); + if (Platform_IdentifyByName(testpath, 4096, &identity, Platform_FileIdentity__typ) != 0) { __DEL(s); return 0; } - __COPY(OPM_InstallDir, testpath, 1024); - Strings_Append((CHAR*)"/2/sym/Files.sym", 17, (void*)testpath, 1024); - if (Platform_IdentifyByName(testpath, 1024, &identity, Platform_FileIdentity__typ) != 0) { + __COPY(OPM_InstallDir, testpath, 4096); + Strings_Append((CHAR*)"/2/sym/Files.sym", 17, (void*)testpath, 4096); + if (Platform_IdentifyByName(testpath, 4096, &identity, Platform_FileIdentity__typ) != 0) { __DEL(s); return 0; } @@ -1129,7 +1141,6 @@ export void *OPM__init(void) __REGMOD("OPM", EnumPtrs); __REGCMD("CloseFiles", OPM_CloseFiles); __REGCMD("CloseOldSym", OPM_CloseOldSym); - __REGCMD("DeleteNewSym", OPM_DeleteNewSym); __REGCMD("InitOptions", OPM_InitOptions); __REGCMD("LogWLn", OPM_LogWLn); __REGCMD("RegisterNewSym", OPM_RegisterNewSym); diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index dc86bc49..da0a48ee 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h @@ -23,13 +23,14 @@ import CHAR OPM_ResourceDir[1024]; import void OPM_CloseFiles (void); import void OPM_CloseOldSym (void); -import void OPM_DeleteNewSym (void); +import void OPM_DeleteNewSym (CHAR *modulename, ADDRESS modulename__len); +import void OPM_DeleteObj (CHAR *modulename, ADDRESS modulename__len); import void OPM_FPrint (INT32 *fp, INT64 val); import void OPM_FPrintLReal (INT32 *fp, LONGREAL val); import void OPM_FPrintReal (INT32 *fp, REAL val); import void OPM_FPrintSet (INT32 *fp, UINT64 val); import void OPM_Get (CHAR *ch); -import void OPM_Init (BOOLEAN *done, CHAR *mname, ADDRESS mname__len); +import void OPM_Init (BOOLEAN *done); import void OPM_InitOptions (void); import INT16 OPM_Integer (INT64 n); import void OPM_LogVT100 (CHAR *vt100code, ADDRESS vt100code__len); diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index 24e6b221..aad8367d 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -1793,24 +1793,6 @@ void OPP_Module (OPT_Node *prog, UINT32 opt) if (OPP_sym == 63) { OPS_Get(&OPP_sym); } else { - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Unexpected symbol found when MODULE expected:", 46); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)" sym: ", 15); - OPM_LogWNum(OPP_sym, 1); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)" OPS.name: ", 15); - OPM_LogWStr(OPS_name, 256); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)" OPS.str: ", 15); - OPM_LogWStr(OPS_str, 256); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)" OPS.numtyp: ", 15); - OPM_LogWNum(OPS_numtyp, 1); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)" OPS.intval: ", 15); - OPM_LogWNum(OPS_intval, 1); - OPM_LogWLn(); OPP_err(16); } if (OPP_sym == 38) { diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index bf0f96d7..dc8aa405 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index 807c0ce5..d0a1851a 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index a15d8712..608979a8 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index e9db362e..b95c2810 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -49,6 +49,15 @@ typedef INT8 glbmno[64]; } OPT_ImpCtxt; +typedef + struct OPT_LinkDesc *OPT_Link; + +typedef + struct OPT_LinkDesc { + OPS_Name name; + OPT_Link next; + } OPT_LinkDesc; + typedef struct OPT_NodeDesc *OPT_Node; @@ -101,6 +110,7 @@ static OPT_ExpCtxt OPT_expCtxt; static INT32 OPT_nofhdfld; static BOOLEAN OPT_newsf, OPT_findpc, OPT_extsf, OPT_sfpresent, OPT_symExtended, OPT_symNew; static INT32 OPT_recno; +export OPT_Link OPT_Links; export ADDRESS *OPT_ConstDesc__typ; export ADDRESS *OPT_ObjDesc__typ; @@ -108,6 +118,7 @@ export ADDRESS *OPT_StrDesc__typ; export ADDRESS *OPT_NodeDesc__typ; export ADDRESS *OPT_ImpCtxt__typ; export ADDRESS *OPT_ExpCtxt__typ; +export ADDRESS *OPT_LinkDesc__typ; export void OPT_Align (INT32 *adr, INT32 base); export INT32 OPT_BaseAlignment (OPT_Struct typ); @@ -131,6 +142,7 @@ export void OPT_IdFPrint (OPT_Struct typ); export void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); static void OPT_InConstant (INT32 f, OPT_Const conval); static OPT_Object OPT_InFld (void); +static void OPT_InLinks (void); static void OPT_InMod (INT8 *mno); static void OPT_InName (CHAR *name, ADDRESS name__len); static OPT_Object OPT_InObj (INT8 mno); @@ -154,6 +166,7 @@ export void OPT_OpenScope (INT8 level, OPT_Object owner); static void OPT_OutConstant (OPT_Object obj); static void OPT_OutFlds (OPT_Object fld, INT32 adr, BOOLEAN visible); static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, INT32 adr); +static void OPT_OutLinks (void); static void OPT_OutMod (INT16 mno); static void OPT_OutName (CHAR *name, ADDRESS name__len); static void OPT_OutObj (OPT_Object obj); @@ -442,6 +455,8 @@ void OPT_Init (OPS_Name name, UINT32 opt) OPT_findpc = __IN(8, opt, 32); OPT_extsf = OPT_newsf || __IN(9, opt, 32); OPT_sfpresent = 1; + __NEW(OPT_Links, OPT_LinkDesc); + __MOVE(name, OPT_Links->name, 256); } void OPT_Close (void) @@ -1011,6 +1026,26 @@ static void OPT_InMod (INT8 *mno) } } +static void OPT_InLinks (void) +{ + OPS_Name linkname; + OPT_Link l = NIL; + OPT_InName((void*)linkname, 256); + while (linkname[0] != 0x00) { + l = OPT_Links; + while ((l != NIL && __STRCMP(l->name, linkname) != 0)) { + l = l->next; + } + if (l == NIL) { + l = OPT_Links; + __NEW(OPT_Links, OPT_LinkDesc); + OPT_Links->next = l; + __MOVE(linkname, OPT_Links->name, 256); + } + OPT_InName((void*)linkname, 256); + } +} + static void OPT_InConstant (INT32 f, OPT_Const conval) { CHAR ch; @@ -1461,6 +1496,7 @@ void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) OPM_OldSym((void*)name, 256, &*done); if (*done) { OPT_InMod(&mno); + OPT_InLinks(); OPT_impCtxt.nextTag = OPM_SymRInt(); while (!OPM_eofSF()) { obj = OPT_InObj(mno); @@ -1507,6 +1543,17 @@ static void OPT_OutMod (INT16 mno) } } +static void OPT_OutLinks (void) +{ + OPT_Link l = NIL; + l = OPT_Links; + while (l != NIL) { + OPT_OutName((void*)l->name, 256); + l = l->next; + } + OPM_SymWCh(0x00); +} + static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, INT32 adr) { INT32 i, j, n; @@ -1833,6 +1880,7 @@ void OPT_Export (BOOLEAN *ext, BOOLEAN *new) if (OPM_noerr) { OPM_SymWInt(16); OPT_OutName((void*)OPT_SelfName, 256); + OPT_OutLinks(); OPT_expCtxt.reffp = 0; OPT_expCtxt.ref = 14; OPT_expCtxt.nofm = 1; @@ -1854,7 +1902,7 @@ void OPT_Export (BOOLEAN *ext, BOOLEAN *new) OPT_newsf = 0; OPT_symNew = 0; if (!OPM_noerr || OPT_findpc) { - OPM_DeleteNewSym(); + OPM_DeleteNewSym((void*)OPT_SelfName, 256); } } } @@ -1969,6 +2017,7 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_universe); P(OPT_syslink); __ENUMR(&OPT_impCtxt, OPT_ImpCtxt__typ, 3140, 1, P); + P(OPT_Links); } __TDESC(OPT_ConstDesc, 1, 1) = {__TDFLDS("ConstDesc", 40), {0, -8}}; @@ -2008,6 +2057,7 @@ __TDESC(OPT_ImpCtxt, 1, 510) = {__TDFLDS("ImpCtxt", 3140), {16, 20, 24, 28, 32, 1936, 1940, 1944, 1948, 1952, 1956, 1960, 1964, 1968, 1972, 1976, 1980, 1984, 1988, 1992, 1996, 2000, 2004, 2008, 2012, 2016, 2020, 2024, 2028, 2032, 2036, 2040, 2044, 2048, 2052, -2044}}; __TDESC(OPT_ExpCtxt, 1, 0) = {__TDFLDS("ExpCtxt", 72), {-4}}; +__TDESC(OPT_LinkDesc, 1, 1) = {__TDFLDS("LinkDesc", 260), {256, -8}}; export void *OPT__init(void) { @@ -2024,6 +2074,7 @@ export void *OPT__init(void) __INITYP(OPT_NodeDesc, OPT_NodeDesc, 0); __INITYP(OPT_ImpCtxt, OPT_ImpCtxt, 0); __INITYP(OPT_ExpCtxt, OPT_ExpCtxt, 0); + __INITYP(OPT_LinkDesc, OPT_LinkDesc, 0); /* BEGIN */ OPT_topScope = NIL; OPT_OpenScope(0, NIL); diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index 9a187fc7..7483f169 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h @@ -21,6 +21,15 @@ typedef LONGREAL realval; } OPT_ConstDesc; +typedef + struct OPT_LinkDesc *OPT_Link; + +typedef + struct OPT_LinkDesc { + OPS_Name name; + OPT_Link next; + } OPT_LinkDesc; + typedef struct OPT_NodeDesc *OPT_Node; @@ -75,11 +84,13 @@ import INT8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; import BOOLEAN OPT_SYSimported; +import OPT_Link OPT_Links; import ADDRESS *OPT_ConstDesc__typ; import ADDRESS *OPT_ObjDesc__typ; import ADDRESS *OPT_StrDesc__typ; import ADDRESS *OPT_NodeDesc__typ; +import ADDRESS *OPT_LinkDesc__typ; import void OPT_Align (INT32 *adr, INT32 base); import INT32 OPT_BaseAlignment (OPT_Struct typ); diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index 96252046..152db225 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index 5654d36e..7c94fced 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Out.c b/bootstrap/windows-48/Out.c index 932297a3..b5ffb6ae 100644 --- a/bootstrap/windows-48/Out.c +++ b/bootstrap/windows-48/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Out.h b/bootstrap/windows-48/Out.h index ffbd6894..a7195e3a 100644 --- a/bootstrap/windows-48/Out.h +++ b/bootstrap/windows-48/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index cc0bd221..73b65c9d 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index f74a75bf..95a1066e 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 2ecd8371..11ad01bd 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index 570e7d72..bf708519 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index f911a688..06972c90 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index 7645aa6e..fd7f283d 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index c0bfc16a..285e7ac0 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index cd0f72ee..7f7d6562 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/VT100.c b/bootstrap/windows-48/VT100.c index 1e0fffa9..baa92092 100644 --- a/bootstrap/windows-48/VT100.c +++ b/bootstrap/windows-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/VT100.h b/bootstrap/windows-48/VT100.h index 7522f9d1..4c0087ac 100644 --- a/bootstrap/windows-48/VT100.h +++ b/bootstrap/windows-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index d2c67400..75768aca 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index fb167591..fb870961 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/Compiler.c b/bootstrap/windows-88/Compiler.c index 454ea490..f26c1a32 100644 --- a/bootstrap/windows-88/Compiler.c +++ b/bootstrap/windows-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 @@ -20,9 +20,9 @@ #include "extTools.h" -static CHAR Compiler_mname[256]; +static void Compiler_FindLocalObjectFiles (CHAR *objectnames, ADDRESS objectnames__len); export void Compiler_Module (BOOLEAN *done); static void Compiler_PropagateElementaryTypeSizes (void); export void Compiler_Translate (void); @@ -41,11 +41,12 @@ void Compiler_Module (BOOLEAN *done) OPT_Export(&ext, &new); if (OPM_noerr) { OPM_OpenFiles((void*)OPT_SelfName, 256); + OPM_DeleteObj((void*)OPT_SelfName, 256); OPC_Init(); OPV_Module(p); if (OPM_noerr) { if ((__IN(10, OPM_Options, 32) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { - OPM_DeleteNewSym(); + OPM_DeleteNewSym((void*)OPT_SelfName, 256); OPM_LogVT100((CHAR*)"32m", 4); OPM_LogWStr((CHAR*)" Main program.", 16); OPM_LogVT100((CHAR*)"0m", 3); @@ -61,7 +62,7 @@ void Compiler_Module (BOOLEAN *done) } } } else { - OPM_DeleteNewSym(); + OPM_DeleteNewSym((void*)OPT_SelfName, 256); } } } @@ -104,14 +105,44 @@ static void Compiler_PropagateElementaryTypeSizes (void) } } +static void Compiler_FindLocalObjectFiles (CHAR *objectnames, ADDRESS objectnames__len) +{ + OPT_Link l = NIL; + CHAR fn[64]; + Platform_FileIdentity id; + objectnames[0] = 0x00; + l = OPT_Links; + while (l != NIL) { + __COPY(l->name, fn, 64); + Strings_Append((CHAR*)".sym", 5, (void*)fn, 64); + if (Platform_IdentifyByName(fn, 64, &id, Platform_FileIdentity__typ) == 0) { + __COPY(l->name, fn, 64); + Strings_Append((CHAR*)".o", 3, (void*)fn, 64); + if (Platform_IdentifyByName(fn, 64, &id, Platform_FileIdentity__typ) == 0) { + Strings_Append((CHAR*)" ", 2, (void*)objectnames, objectnames__len); + Strings_Append(fn, 64, (void*)objectnames, objectnames__len); + } else { + OPM_LogVT100((CHAR*)"33m", 4); + OPM_LogWStr((CHAR*)"Link warning: a local symbol file is present for module ", 57); + OPM_LogWStr(l->name, 256); + OPM_LogWStr((CHAR*)", but local object file '", 26); + OPM_LogWStr(fn, 64); + OPM_LogWStr((CHAR*)"' is missing.", 14); + OPM_LogVT100((CHAR*)"0m", 3); + OPM_LogWLn(); + } + } + l = l->next; + } +} + void Compiler_Translate (void) { BOOLEAN done; - CHAR modulesobj[2048]; - modulesobj[0] = 0x00; + CHAR linkfiles[2048]; if (OPM_OpenPar()) { for (;;) { - OPM_Init(&done, (void*)Compiler_mname, 256); + OPM_Init(&done); if (!done) { return; } @@ -131,11 +162,9 @@ void Compiler_Translate (void) } else { if (!__IN(10, OPM_Options, 32)) { extTools_Assemble(OPM_modName, 32); - Strings_Append((CHAR*)" ", 2, (void*)modulesobj, 2048); - Strings_Append(OPM_modName, 32, (void*)modulesobj, 2048); - Strings_Append((CHAR*)".o", 3, (void*)modulesobj, 2048); } else { - extTools_LinkMain((void*)OPM_modName, 32, __IN(15, OPM_Options, 32), modulesobj, 2048); + Compiler_FindLocalObjectFiles((void*)linkfiles, 2048); + extTools_LinkMain((void*)OPM_modName, 32, __IN(15, OPM_Options, 32), linkfiles, 2048); } } } diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index abf165f3..18ec858a 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index eb712e53..efd4ae6e 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index b9056935..206de2b2 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 616c3fe1..ef890edf 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index 3f4e96ee..ba215672 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index aac7c8fe..bbd83594 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 50348111..16daab43 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index c7f011df..be3fd68b 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index c163c77e..3933cee1 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index 7b8e9d38..9f8518b8 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index fef86e9e..24cd4f3f 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index a2b14bdc..99b9afb4 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index cb39afd5..2bc2c145 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -49,7 +49,8 @@ export CHAR OPM_ResourceDir[1024]; static void OPM_Append (Files_Rider *R, ADDRESS *R__typ, Files_File F); export void OPM_CloseFiles (void); export void OPM_CloseOldSym (void); -export void OPM_DeleteNewSym (void); +export void OPM_DeleteNewSym (CHAR *modulename, ADDRESS modulename__len); +export void OPM_DeleteObj (CHAR *modulename, ADDRESS modulename__len); export void OPM_FPrint (INT32 *fp, INT64 val); export void OPM_FPrintLReal (INT32 *fp, LONGREAL val); export void OPM_FPrintReal (INT32 *fp, REAL val); @@ -58,7 +59,7 @@ static void OPM_FindInstallDir (void); static void OPM_FindLine (Files_File f, Files_Rider *r, ADDRESS *r__typ, INT64 pos); static void OPM_FingerprintBytes (INT32 *fp, SYSTEM_BYTE *bytes, ADDRESS bytes__len); export void OPM_Get (CHAR *ch); -export void OPM_Init (BOOLEAN *done, CHAR *mname, ADDRESS mname__len); +export void OPM_Init (BOOLEAN *done); export void OPM_InitOptions (void); export INT16 OPM_Integer (INT64 n); static BOOLEAN OPM_IsProbablyInstallDir (CHAR *s, ADDRESS s__len); @@ -449,7 +450,7 @@ void OPM_InitOptions (void) Files_SetSearchPath(searchpath, 1024); } -void OPM_Init (BOOLEAN *done, CHAR *mname, ADDRESS mname__len) +void OPM_Init (BOOLEAN *done) { Texts_Text T = NIL; INT32 beg, end, time; @@ -465,7 +466,6 @@ void OPM_Init (BOOLEAN *done, CHAR *mname, ADDRESS mname__len) Texts_Open(T, s, 256); OPM_LogWStr(s, 256); OPM_LogWStr((CHAR*)" ", 3); - __COPY(s, mname, mname__len); __COPY(s, OPM_SourceFileName, 256); if (T->len == 0) { OPM_LogWStr(s, 256); @@ -773,7 +773,7 @@ void OPM_OldSym (CHAR *modName, ADDRESS modName__len, BOOLEAN *done) Files_Set(&OPM_oldSF, Files_Rider__typ, OPM_oldSFile, 0); Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&tag); Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&ver); - if (tag != 0xf7 || ver != 0x82) { + if (tag != 0xf7 || ver != 0x83) { OPM_err(-306); OPM_CloseOldSym(); *done = 0; @@ -818,8 +818,20 @@ void OPM_RegisterNewSym (void) } } -void OPM_DeleteNewSym (void) +void OPM_DeleteNewSym (CHAR *modulename, ADDRESS modulename__len) { + OPM_FileName fn; + INT16 res; + OPM_MakeFileName((void*)modulename, modulename__len, (void*)fn, 32, (CHAR*)".sym", 5); + Files_Delete(fn, 32, &res); +} + +void OPM_DeleteObj (CHAR *modulename, ADDRESS modulename__len) +{ + OPM_FileName fn; + INT16 res; + OPM_MakeFileName((void*)modulename, modulename__len, (void*)fn, 32, (CHAR*)".o", 3); + Files_Delete(fn, 32, &res); } void OPM_NewSym (CHAR *modName, ADDRESS modName__len) @@ -830,7 +842,7 @@ void OPM_NewSym (CHAR *modName, ADDRESS modName__len) if (OPM_newSFile != NIL) { Files_Set(&OPM_newSF, Files_Rider__typ, OPM_newSFile, 0); Files_Write(&OPM_newSF, Files_Rider__typ, 0xf7); - Files_Write(&OPM_newSF, Files_Rider__typ, 0x82); + Files_Write(&OPM_newSF, Files_Rider__typ, 0x83); } else { OPM_err(153); } @@ -984,7 +996,7 @@ static void OPM_Append (Files_Rider *R, ADDRESS *R__typ, Files_File F) void OPM_OpenFiles (CHAR *moduleName, ADDRESS moduleName__len) { - CHAR FName[32]; + OPM_FileName FName; __COPY(moduleName, OPM_modName, 32); OPM_HFile = Files_New((CHAR*)"", 1); if (OPM_HFile != NIL) { @@ -1010,7 +1022,7 @@ void OPM_OpenFiles (CHAR *moduleName, ADDRESS moduleName__len) void OPM_CloseFiles (void) { - CHAR FName[32]; + OPM_FileName FName; INT16 res; if (OPM_noerr) { OPM_LogWStr((CHAR*)" ", 3); @@ -1048,26 +1060,26 @@ void OPM_CloseFiles (void) static BOOLEAN OPM_IsProbablyInstallDir (CHAR *s, ADDRESS s__len) { - CHAR testpath[1024]; + CHAR testpath[4096]; Platform_FileIdentity identity; __DUP(s, s__len, CHAR); - __COPY(OPM_InstallDir, testpath, 1024); - Strings_Append((CHAR*)"/lib/lib", 9, (void*)testpath, 1024); - Strings_Append((CHAR*)"voc", 4, (void*)testpath, 1024); - Strings_Append((CHAR*)"-O2.a", 6, (void*)testpath, 1024); - if (Platform_IdentifyByName(testpath, 1024, &identity, Platform_FileIdentity__typ) != 0) { + __COPY(OPM_InstallDir, testpath, 4096); + Strings_Append((CHAR*)"/lib/lib", 9, (void*)testpath, 4096); + Strings_Append((CHAR*)"voc", 4, (void*)testpath, 4096); + Strings_Append((CHAR*)"-O2.a", 6, (void*)testpath, 4096); + if (Platform_IdentifyByName(testpath, 4096, &identity, Platform_FileIdentity__typ) != 0) { __DEL(s); return 0; } - __COPY(OPM_InstallDir, testpath, 1024); - Strings_Append((CHAR*)"/2/include/Oberon.h", 20, (void*)testpath, 1024); - if (Platform_IdentifyByName(testpath, 1024, &identity, Platform_FileIdentity__typ) != 0) { + __COPY(OPM_InstallDir, testpath, 4096); + Strings_Append((CHAR*)"/2/include/Oberon.h", 20, (void*)testpath, 4096); + if (Platform_IdentifyByName(testpath, 4096, &identity, Platform_FileIdentity__typ) != 0) { __DEL(s); return 0; } - __COPY(OPM_InstallDir, testpath, 1024); - Strings_Append((CHAR*)"/2/sym/Files.sym", 17, (void*)testpath, 1024); - if (Platform_IdentifyByName(testpath, 1024, &identity, Platform_FileIdentity__typ) != 0) { + __COPY(OPM_InstallDir, testpath, 4096); + Strings_Append((CHAR*)"/2/sym/Files.sym", 17, (void*)testpath, 4096); + if (Platform_IdentifyByName(testpath, 4096, &identity, Platform_FileIdentity__typ) != 0) { __DEL(s); return 0; } @@ -1129,7 +1141,6 @@ export void *OPM__init(void) __REGMOD("OPM", EnumPtrs); __REGCMD("CloseFiles", OPM_CloseFiles); __REGCMD("CloseOldSym", OPM_CloseOldSym); - __REGCMD("DeleteNewSym", OPM_DeleteNewSym); __REGCMD("InitOptions", OPM_InitOptions); __REGCMD("LogWLn", OPM_LogWLn); __REGCMD("RegisterNewSym", OPM_RegisterNewSym); diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index dc86bc49..da0a48ee 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h @@ -23,13 +23,14 @@ import CHAR OPM_ResourceDir[1024]; import void OPM_CloseFiles (void); import void OPM_CloseOldSym (void); -import void OPM_DeleteNewSym (void); +import void OPM_DeleteNewSym (CHAR *modulename, ADDRESS modulename__len); +import void OPM_DeleteObj (CHAR *modulename, ADDRESS modulename__len); import void OPM_FPrint (INT32 *fp, INT64 val); import void OPM_FPrintLReal (INT32 *fp, LONGREAL val); import void OPM_FPrintReal (INT32 *fp, REAL val); import void OPM_FPrintSet (INT32 *fp, UINT64 val); import void OPM_Get (CHAR *ch); -import void OPM_Init (BOOLEAN *done, CHAR *mname, ADDRESS mname__len); +import void OPM_Init (BOOLEAN *done); import void OPM_InitOptions (void); import INT16 OPM_Integer (INT64 n); import void OPM_LogVT100 (CHAR *vt100code, ADDRESS vt100code__len); diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index 25c453d1..0a6a6796 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -1793,24 +1793,6 @@ void OPP_Module (OPT_Node *prog, UINT32 opt) if (OPP_sym == 63) { OPS_Get(&OPP_sym); } else { - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Unexpected symbol found when MODULE expected:", 46); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)" sym: ", 15); - OPM_LogWNum(OPP_sym, 1); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)" OPS.name: ", 15); - OPM_LogWStr(OPS_name, 256); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)" OPS.str: ", 15); - OPM_LogWStr(OPS_str, 256); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)" OPS.numtyp: ", 15); - OPM_LogWNum(OPS_numtyp, 1); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)" OPS.intval: ", 15); - OPM_LogWNum(OPS_intval, 1); - OPM_LogWLn(); OPP_err(16); } if (OPP_sym == 38) { diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index bf0f96d7..dc8aa405 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index 807c0ce5..d0a1851a 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index a15d8712..608979a8 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index 8fb5d86e..1a106cda 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -49,6 +49,15 @@ typedef INT8 glbmno[64]; } OPT_ImpCtxt; +typedef + struct OPT_LinkDesc *OPT_Link; + +typedef + struct OPT_LinkDesc { + OPS_Name name; + OPT_Link next; + } OPT_LinkDesc; + typedef struct OPT_NodeDesc *OPT_Node; @@ -101,6 +110,7 @@ static OPT_ExpCtxt OPT_expCtxt; static INT32 OPT_nofhdfld; static BOOLEAN OPT_newsf, OPT_findpc, OPT_extsf, OPT_sfpresent, OPT_symExtended, OPT_symNew; static INT32 OPT_recno; +export OPT_Link OPT_Links; export ADDRESS *OPT_ConstDesc__typ; export ADDRESS *OPT_ObjDesc__typ; @@ -108,6 +118,7 @@ export ADDRESS *OPT_StrDesc__typ; export ADDRESS *OPT_NodeDesc__typ; export ADDRESS *OPT_ImpCtxt__typ; export ADDRESS *OPT_ExpCtxt__typ; +export ADDRESS *OPT_LinkDesc__typ; export void OPT_Align (INT32 *adr, INT32 base); export INT32 OPT_BaseAlignment (OPT_Struct typ); @@ -131,6 +142,7 @@ export void OPT_IdFPrint (OPT_Struct typ); export void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); static void OPT_InConstant (INT32 f, OPT_Const conval); static OPT_Object OPT_InFld (void); +static void OPT_InLinks (void); static void OPT_InMod (INT8 *mno); static void OPT_InName (CHAR *name, ADDRESS name__len); static OPT_Object OPT_InObj (INT8 mno); @@ -154,6 +166,7 @@ export void OPT_OpenScope (INT8 level, OPT_Object owner); static void OPT_OutConstant (OPT_Object obj); static void OPT_OutFlds (OPT_Object fld, INT32 adr, BOOLEAN visible); static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, INT32 adr); +static void OPT_OutLinks (void); static void OPT_OutMod (INT16 mno); static void OPT_OutName (CHAR *name, ADDRESS name__len); static void OPT_OutObj (OPT_Object obj); @@ -442,6 +455,8 @@ void OPT_Init (OPS_Name name, UINT32 opt) OPT_findpc = __IN(8, opt, 32); OPT_extsf = OPT_newsf || __IN(9, opt, 32); OPT_sfpresent = 1; + __NEW(OPT_Links, OPT_LinkDesc); + __MOVE(name, OPT_Links->name, 256); } void OPT_Close (void) @@ -1011,6 +1026,26 @@ static void OPT_InMod (INT8 *mno) } } +static void OPT_InLinks (void) +{ + OPS_Name linkname; + OPT_Link l = NIL; + OPT_InName((void*)linkname, 256); + while (linkname[0] != 0x00) { + l = OPT_Links; + while ((l != NIL && __STRCMP(l->name, linkname) != 0)) { + l = l->next; + } + if (l == NIL) { + l = OPT_Links; + __NEW(OPT_Links, OPT_LinkDesc); + OPT_Links->next = l; + __MOVE(linkname, OPT_Links->name, 256); + } + OPT_InName((void*)linkname, 256); + } +} + static void OPT_InConstant (INT32 f, OPT_Const conval) { CHAR ch; @@ -1461,6 +1496,7 @@ void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) OPM_OldSym((void*)name, 256, &*done); if (*done) { OPT_InMod(&mno); + OPT_InLinks(); OPT_impCtxt.nextTag = OPM_SymRInt(); while (!OPM_eofSF()) { obj = OPT_InObj(mno); @@ -1507,6 +1543,17 @@ static void OPT_OutMod (INT16 mno) } } +static void OPT_OutLinks (void) +{ + OPT_Link l = NIL; + l = OPT_Links; + while (l != NIL) { + OPT_OutName((void*)l->name, 256); + l = l->next; + } + OPM_SymWCh(0x00); +} + static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, INT32 adr) { INT32 i, j, n; @@ -1833,6 +1880,7 @@ void OPT_Export (BOOLEAN *ext, BOOLEAN *new) if (OPM_noerr) { OPM_SymWInt(16); OPT_OutName((void*)OPT_SelfName, 256); + OPT_OutLinks(); OPT_expCtxt.reffp = 0; OPT_expCtxt.ref = 14; OPT_expCtxt.nofm = 1; @@ -1854,7 +1902,7 @@ void OPT_Export (BOOLEAN *ext, BOOLEAN *new) OPT_newsf = 0; OPT_symNew = 0; if (!OPM_noerr || OPT_findpc) { - OPM_DeleteNewSym(); + OPM_DeleteNewSym((void*)OPT_SelfName, 256); } } } @@ -1969,6 +2017,7 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_universe); P(OPT_syslink); __ENUMR(&OPT_impCtxt, OPT_ImpCtxt__typ, 5184, 1, P); + P(OPT_Links); } __TDESC(OPT_ConstDesc, 1, 1) = {__TDFLDS("ConstDesc", 40), {0, -16}}; @@ -2008,6 +2057,7 @@ __TDESC(OPT_ImpCtxt, 1, 510) = {__TDFLDS("ImpCtxt", 5184), {16, 24, 32, 40, 48, 3856, 3864, 3872, 3880, 3888, 3896, 3904, 3912, 3920, 3928, 3936, 3944, 3952, 3960, 3968, 3976, 3984, 3992, 4000, 4008, 4016, 4024, 4032, 4040, 4048, 4056, 4064, 4072, 4080, 4088, -4088}}; __TDESC(OPT_ExpCtxt, 1, 0) = {__TDFLDS("ExpCtxt", 72), {-8}}; +__TDESC(OPT_LinkDesc, 1, 1) = {__TDFLDS("LinkDesc", 264), {256, -16}}; export void *OPT__init(void) { @@ -2024,6 +2074,7 @@ export void *OPT__init(void) __INITYP(OPT_NodeDesc, OPT_NodeDesc, 0); __INITYP(OPT_ImpCtxt, OPT_ImpCtxt, 0); __INITYP(OPT_ExpCtxt, OPT_ExpCtxt, 0); + __INITYP(OPT_LinkDesc, OPT_LinkDesc, 0); /* BEGIN */ OPT_topScope = NIL; OPT_OpenScope(0, NIL); diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 9a187fc7..7483f169 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h @@ -21,6 +21,15 @@ typedef LONGREAL realval; } OPT_ConstDesc; +typedef + struct OPT_LinkDesc *OPT_Link; + +typedef + struct OPT_LinkDesc { + OPS_Name name; + OPT_Link next; + } OPT_LinkDesc; + typedef struct OPT_NodeDesc *OPT_Node; @@ -75,11 +84,13 @@ import INT8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; import BOOLEAN OPT_SYSimported; +import OPT_Link OPT_Links; import ADDRESS *OPT_ConstDesc__typ; import ADDRESS *OPT_ObjDesc__typ; import ADDRESS *OPT_StrDesc__typ; import ADDRESS *OPT_NodeDesc__typ; +import ADDRESS *OPT_LinkDesc__typ; import void OPT_Align (INT32 *adr, INT32 base); import INT32 OPT_BaseAlignment (OPT_Struct typ); diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index ab98ed73..4d29b076 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index 5654d36e..7c94fced 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Out.c b/bootstrap/windows-88/Out.c index 87f59955..01c22546 100644 --- a/bootstrap/windows-88/Out.c +++ b/bootstrap/windows-88/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Out.h b/bootstrap/windows-88/Out.h index b846b299..311e737d 100644 --- a/bootstrap/windows-88/Out.h +++ b/bootstrap/windows-88/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index b47b0d82..944c4407 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index 76ed0ffb..4311c64a 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 2ecd8371..11ad01bd 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index 570e7d72..bf708519 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index f911a688..06972c90 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index 7645aa6e..fd7f283d 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index 74cd62c7..2bfa4511 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index be7b64a2..21401f61 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/VT100.c b/bootstrap/windows-88/VT100.c index 1e0fffa9..baa92092 100644 --- a/bootstrap/windows-88/VT100.c +++ b/bootstrap/windows-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/VT100.h b/bootstrap/windows-88/VT100.h index 7522f9d1..4c0087ac 100644 --- a/bootstrap/windows-88/VT100.h +++ b/bootstrap/windows-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index d2c67400..75768aca 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index fb167591..fb870961 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/14]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h From 28d4bc8219f2be9645b8e5657ad5ca590bd9dc7f Mon Sep 17 00:00:00 2001 From: David Brown Date: Sun, 18 Dec 2016 14:51:27 +0000 Subject: [PATCH 436/580] -F doesn'teven try opening existing sym file. -s silently replaces old version sym file. --- src/compiler/OPM.Mod | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/src/compiler/OPM.Mod b/src/compiler/OPM.Mod index a5a3df1a..eb41b52c 100644 --- a/src/compiler/OPM.Mod +++ b/src/compiler/OPM.Mod @@ -588,15 +588,22 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) END CloseOldSym; PROCEDURE OldSym*(VAR modName: ARRAY OF CHAR; VAR done: BOOLEAN); - VAR tag, ver: CHAR; fileName: FileName; + VAR tag, ver: CHAR; fileName: FileName; res: INTEGER; BEGIN + oldSFile := NIL; done := FALSE; MakeFileName(modName, fileName, SFext); - oldSFile := Files.Old(fileName); done := oldSFile # NIL; - IF done THEN - Files.Set(oldSF, oldSFile, 0); Files.Read(oldSF, tag); Files.Read(oldSF, ver); - IF (tag # SFtag) OR (ver # SFver) THEN - err(-306); (*possibly a symbol file from another Oberon implementation, e.g. HP-Oberon*) - CloseOldSym; done := FALSE + IF forcenewsym IN Options THEN + Files.Delete(fileName, res) + ELSE + oldSFile := Files.Old(fileName); done := oldSFile # NIL; + IF done THEN + Files.Set(oldSF, oldSFile, 0); Files.Read(oldSF, tag); Files.Read(oldSF, ver); + IF (tag # SFtag) OR (ver # SFver) THEN + (* Possibly a symbol file from another Oberon implementation, e.g. HP-Oberon, + or from a symbol incompatible version of this Oberon. *) + IF ~(newsf IN Options) THEN err(-306) END; + CloseOldSym; done := FALSE + END END END END OldSym; From 5c5ca01dbc144475eba295db18b3d122c3238dc9 Mon Sep 17 00:00:00 2001 From: David Brown Date: Sun, 18 Dec 2016 16:33:41 +0000 Subject: [PATCH 437/580] Fix overenthusiastic deletion of .sym files for -F forcenewym. Whoops. --- src/compiler/Compiler.Mod | 4 ++-- src/compiler/OPM.Mod | 30 ++++++++++++++---------------- src/compiler/OPT.Mod | 8 ++++++-- 3 files changed, 22 insertions(+), 20 deletions(-) diff --git a/src/compiler/Compiler.Mod b/src/compiler/Compiler.Mod index c9f454cf..9e44a180 100644 --- a/src/compiler/Compiler.Mod +++ b/src/compiler/Compiler.Mod @@ -22,7 +22,7 @@ MODULE Compiler; (* J. Templ 3.2.95 *) OPV.Module(p); IF OPM.noerr THEN IF (OPM.mainprog IN OPM.Options) & (OPM.modName # "SYSTEM") THEN - OPM.DeleteNewSym(OPT.SelfName); + OPM.DeleteSym(OPT.SelfName); OPM.LogVT100(VT100.Green); OPM.LogWStr(" Main program."); OPM.LogVT100(VT100.ResetAll); ELSE IF new THEN @@ -34,7 +34,7 @@ MODULE Compiler; (* J. Templ 3.2.95 *) END END; ELSE - OPM.DeleteNewSym(OPT.SelfName) + OPM.DeleteSym(OPT.SelfName) END END END; diff --git a/src/compiler/OPM.Mod b/src/compiler/OPM.Mod index eb41b52c..ecfe4ac3 100644 --- a/src/compiler/OPM.Mod +++ b/src/compiler/OPM.Mod @@ -339,8 +339,10 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) IF verbose IN Options THEN VerboseListSizes END; ResourceDir := InstallDir; - Strings.Append("/", ResourceDir); - Strings.Append(Model, ResourceDir); + IF ResourceDir[0] # 0X THEN + Strings.Append("/", ResourceDir); + Strings.Append(Model, ResourceDir); + END; modules := ""; Platform.GetEnv("MODULES", modules); searchpath := "."; Platform.GetEnv("OBERON", searchpath); @@ -592,18 +594,14 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) BEGIN oldSFile := NIL; done := FALSE; MakeFileName(modName, fileName, SFext); - IF forcenewsym IN Options THEN - Files.Delete(fileName, res) - ELSE - oldSFile := Files.Old(fileName); done := oldSFile # NIL; - IF done THEN - Files.Set(oldSF, oldSFile, 0); Files.Read(oldSF, tag); Files.Read(oldSF, ver); - IF (tag # SFtag) OR (ver # SFver) THEN - (* Possibly a symbol file from another Oberon implementation, e.g. HP-Oberon, - or from a symbol incompatible version of this Oberon. *) - IF ~(newsf IN Options) THEN err(-306) END; - CloseOldSym; done := FALSE - END + oldSFile := Files.Old(fileName); done := oldSFile # NIL; + IF done THEN + Files.Set(oldSF, oldSFile, 0); Files.Read(oldSF, tag); Files.Read(oldSF, ver); + IF (tag # SFtag) OR (ver # SFver) THEN + (* Possibly a symbol file from another Oberon implementation, e.g. HP-Oberon, + or from a symbol incompatible version of this Oberon. *) + IF ~(newsf IN Options) THEN err(-306) END; + CloseOldSym; done := FALSE END END END OldSym; @@ -642,10 +640,10 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) IF (modName # "SYSTEM") OR (mainprog IN Options) THEN Files.Register(newSFile) END END RegisterNewSym; - PROCEDURE DeleteNewSym*(VAR modulename: ARRAY OF CHAR); + PROCEDURE DeleteSym*(VAR modulename: ARRAY OF CHAR); VAR fn: FileName; res: INTEGER; BEGIN MakeFileName(modulename, fn, SFext); Files.Delete(fn, res) - END DeleteNewSym; + END DeleteSym; PROCEDURE DeleteObj*(VAR modulename: ARRAY OF CHAR); VAR fn: FileName; res: INTEGER; diff --git a/src/compiler/OPT.Mod b/src/compiler/OPT.Mod index 2c54d11f..2641703e 100644 --- a/src/compiler/OPT.Mod +++ b/src/compiler/OPT.Mod @@ -1047,7 +1047,11 @@ BEGIN ELSE impCtxt.nofr := FirstRef(*Comp+1*); impCtxt.minr := maxStruct; impCtxt.nofm := 0; impCtxt.self := aliasName = "@self"; impCtxt.reffp := 0; - OPM.OldSym(name, done); + IF impCtxt.self & (OPM.forcenewsym IN OPM.Options) THEN + OPM.DeleteSym(name); done := FALSE + ELSE + OPM.OldSym(name, done) + END; IF done THEN InMod(mno); InLinks; impCtxt.nextTag := OPM.SymRInt(); @@ -1282,7 +1286,7 @@ END Import; END; newsf := FALSE; symNew := FALSE; (* because of call to FPrintErr from OPL *) IF ~OPM.noerr OR findpc THEN - OPM.DeleteNewSym(SelfName) + OPM.DeleteSym(SelfName) END (* OPM.RegisterNewSym is called in OP2 after writing the object file *) END From fc385eca3c19ea03391d00a7d4004637432aa4d2 Mon Sep 17 00:00:00 2001 From: David Brown Date: Sun, 18 Dec 2016 16:34:33 +0000 Subject: [PATCH 438/580] Update bootstrap C sources. --- bootstrap/unix-44/Compiler.c | 4 ++-- bootstrap/unix-44/OPM.c | 17 ++++++++++++----- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPT.c | 9 +++++++-- bootstrap/unix-48/Compiler.c | 4 ++-- bootstrap/unix-48/OPM.c | 17 ++++++++++++----- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPT.c | 9 +++++++-- bootstrap/unix-88/Compiler.c | 4 ++-- bootstrap/unix-88/OPM.c | 17 ++++++++++++----- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPT.c | 9 +++++++-- bootstrap/windows-48/Compiler.c | 4 ++-- bootstrap/windows-48/OPM.c | 17 ++++++++++++----- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPT.c | 9 +++++++-- bootstrap/windows-88/Compiler.c | 4 ++-- bootstrap/windows-88/OPM.c | 17 ++++++++++++----- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPT.c | 9 +++++++-- 20 files changed, 110 insertions(+), 50 deletions(-) diff --git a/bootstrap/unix-44/Compiler.c b/bootstrap/unix-44/Compiler.c index f26c1a32..ed38ce7b 100644 --- a/bootstrap/unix-44/Compiler.c +++ b/bootstrap/unix-44/Compiler.c @@ -46,7 +46,7 @@ void Compiler_Module (BOOLEAN *done) OPV_Module(p); if (OPM_noerr) { if ((__IN(10, OPM_Options, 32) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { - OPM_DeleteNewSym((void*)OPT_SelfName, 256); + OPM_DeleteSym((void*)OPT_SelfName, 256); OPM_LogVT100((CHAR*)"32m", 4); OPM_LogWStr((CHAR*)" Main program.", 16); OPM_LogVT100((CHAR*)"0m", 3); @@ -62,7 +62,7 @@ void Compiler_Module (BOOLEAN *done) } } } else { - OPM_DeleteNewSym((void*)OPT_SelfName, 256); + OPM_DeleteSym((void*)OPT_SelfName, 256); } } } diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 3411635b..11aa9008 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -49,8 +49,8 @@ export CHAR OPM_ResourceDir[1024]; static void OPM_Append (Files_Rider *R, ADDRESS *R__typ, Files_File F); export void OPM_CloseFiles (void); export void OPM_CloseOldSym (void); -export void OPM_DeleteNewSym (CHAR *modulename, ADDRESS modulename__len); export void OPM_DeleteObj (CHAR *modulename, ADDRESS modulename__len); +export void OPM_DeleteSym (CHAR *modulename, ADDRESS modulename__len); export void OPM_FPrint (INT32 *fp, INT64 val); export void OPM_FPrintLReal (INT32 *fp, LONGREAL val); export void OPM_FPrintReal (INT32 *fp, REAL val); @@ -436,8 +436,10 @@ void OPM_InitOptions (void) OPM_VerboseListSizes(); } __MOVE(OPM_InstallDir, OPM_ResourceDir, 1024); - Strings_Append((CHAR*)"/", 2, (void*)OPM_ResourceDir, 1024); - Strings_Append(OPM_Model, 10, (void*)OPM_ResourceDir, 1024); + if (OPM_ResourceDir[0] != 0x00) { + Strings_Append((CHAR*)"/", 2, (void*)OPM_ResourceDir, 1024); + Strings_Append(OPM_Model, 10, (void*)OPM_ResourceDir, 1024); + } modules[0] = 0x00; Platform_GetEnv((CHAR*)"MODULES", 8, (void*)modules, 1024); __MOVE(".", searchpath, 2); @@ -766,6 +768,9 @@ void OPM_OldSym (CHAR *modName, ADDRESS modName__len, BOOLEAN *done) { CHAR tag, ver; OPM_FileName fileName; + INT16 res; + OPM_oldSFile = NIL; + *done = 0; OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, 32, (CHAR*)".sym", 5); OPM_oldSFile = Files_Old(fileName, 32); *done = OPM_oldSFile != NIL; @@ -774,7 +779,9 @@ void OPM_OldSym (CHAR *modName, ADDRESS modName__len, BOOLEAN *done) Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&tag); Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&ver); if (tag != 0xf7 || ver != 0x83) { - OPM_err(-306); + if (!__IN(4, OPM_Options, 32)) { + OPM_err(-306); + } OPM_CloseOldSym(); *done = 0; } @@ -818,7 +825,7 @@ void OPM_RegisterNewSym (void) } } -void OPM_DeleteNewSym (CHAR *modulename, ADDRESS modulename__len) +void OPM_DeleteSym (CHAR *modulename, ADDRESS modulename__len) { OPM_FileName fn; INT16 res; diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index da0a48ee..51f64007 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -23,8 +23,8 @@ import CHAR OPM_ResourceDir[1024]; import void OPM_CloseFiles (void); import void OPM_CloseOldSym (void); -import void OPM_DeleteNewSym (CHAR *modulename, ADDRESS modulename__len); import void OPM_DeleteObj (CHAR *modulename, ADDRESS modulename__len); +import void OPM_DeleteSym (CHAR *modulename, ADDRESS modulename__len); import void OPM_FPrint (INT32 *fp, INT64 val); import void OPM_FPrintLReal (INT32 *fp, LONGREAL val); import void OPM_FPrintReal (INT32 *fp, REAL val); diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index 02532034..3f58d991 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1493,7 +1493,12 @@ void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) OPT_impCtxt.nofm = 0; OPT_impCtxt.self = __STRCMP(aliasName, "@self") == 0; OPT_impCtxt.reffp = 0; - OPM_OldSym((void*)name, 256, &*done); + if ((OPT_impCtxt.self && __IN(17, OPM_Options, 32))) { + OPM_DeleteSym((void*)name, 256); + *done = 0; + } else { + OPM_OldSym((void*)name, 256, &*done); + } if (*done) { OPT_InMod(&mno); OPT_InLinks(); @@ -1902,7 +1907,7 @@ void OPT_Export (BOOLEAN *ext, BOOLEAN *new) OPT_newsf = 0; OPT_symNew = 0; if (!OPM_noerr || OPT_findpc) { - OPM_DeleteNewSym((void*)OPT_SelfName, 256); + OPM_DeleteSym((void*)OPT_SelfName, 256); } } } diff --git a/bootstrap/unix-48/Compiler.c b/bootstrap/unix-48/Compiler.c index f26c1a32..ed38ce7b 100644 --- a/bootstrap/unix-48/Compiler.c +++ b/bootstrap/unix-48/Compiler.c @@ -46,7 +46,7 @@ void Compiler_Module (BOOLEAN *done) OPV_Module(p); if (OPM_noerr) { if ((__IN(10, OPM_Options, 32) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { - OPM_DeleteNewSym((void*)OPT_SelfName, 256); + OPM_DeleteSym((void*)OPT_SelfName, 256); OPM_LogVT100((CHAR*)"32m", 4); OPM_LogWStr((CHAR*)" Main program.", 16); OPM_LogVT100((CHAR*)"0m", 3); @@ -62,7 +62,7 @@ void Compiler_Module (BOOLEAN *done) } } } else { - OPM_DeleteNewSym((void*)OPT_SelfName, 256); + OPM_DeleteSym((void*)OPT_SelfName, 256); } } } diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 3411635b..11aa9008 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -49,8 +49,8 @@ export CHAR OPM_ResourceDir[1024]; static void OPM_Append (Files_Rider *R, ADDRESS *R__typ, Files_File F); export void OPM_CloseFiles (void); export void OPM_CloseOldSym (void); -export void OPM_DeleteNewSym (CHAR *modulename, ADDRESS modulename__len); export void OPM_DeleteObj (CHAR *modulename, ADDRESS modulename__len); +export void OPM_DeleteSym (CHAR *modulename, ADDRESS modulename__len); export void OPM_FPrint (INT32 *fp, INT64 val); export void OPM_FPrintLReal (INT32 *fp, LONGREAL val); export void OPM_FPrintReal (INT32 *fp, REAL val); @@ -436,8 +436,10 @@ void OPM_InitOptions (void) OPM_VerboseListSizes(); } __MOVE(OPM_InstallDir, OPM_ResourceDir, 1024); - Strings_Append((CHAR*)"/", 2, (void*)OPM_ResourceDir, 1024); - Strings_Append(OPM_Model, 10, (void*)OPM_ResourceDir, 1024); + if (OPM_ResourceDir[0] != 0x00) { + Strings_Append((CHAR*)"/", 2, (void*)OPM_ResourceDir, 1024); + Strings_Append(OPM_Model, 10, (void*)OPM_ResourceDir, 1024); + } modules[0] = 0x00; Platform_GetEnv((CHAR*)"MODULES", 8, (void*)modules, 1024); __MOVE(".", searchpath, 2); @@ -766,6 +768,9 @@ void OPM_OldSym (CHAR *modName, ADDRESS modName__len, BOOLEAN *done) { CHAR tag, ver; OPM_FileName fileName; + INT16 res; + OPM_oldSFile = NIL; + *done = 0; OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, 32, (CHAR*)".sym", 5); OPM_oldSFile = Files_Old(fileName, 32); *done = OPM_oldSFile != NIL; @@ -774,7 +779,9 @@ void OPM_OldSym (CHAR *modName, ADDRESS modName__len, BOOLEAN *done) Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&tag); Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&ver); if (tag != 0xf7 || ver != 0x83) { - OPM_err(-306); + if (!__IN(4, OPM_Options, 32)) { + OPM_err(-306); + } OPM_CloseOldSym(); *done = 0; } @@ -818,7 +825,7 @@ void OPM_RegisterNewSym (void) } } -void OPM_DeleteNewSym (CHAR *modulename, ADDRESS modulename__len) +void OPM_DeleteSym (CHAR *modulename, ADDRESS modulename__len) { OPM_FileName fn; INT16 res; diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index da0a48ee..51f64007 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -23,8 +23,8 @@ import CHAR OPM_ResourceDir[1024]; import void OPM_CloseFiles (void); import void OPM_CloseOldSym (void); -import void OPM_DeleteNewSym (CHAR *modulename, ADDRESS modulename__len); import void OPM_DeleteObj (CHAR *modulename, ADDRESS modulename__len); +import void OPM_DeleteSym (CHAR *modulename, ADDRESS modulename__len); import void OPM_FPrint (INT32 *fp, INT64 val); import void OPM_FPrintLReal (INT32 *fp, LONGREAL val); import void OPM_FPrintReal (INT32 *fp, REAL val); diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index b95c2810..85113943 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1493,7 +1493,12 @@ void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) OPT_impCtxt.nofm = 0; OPT_impCtxt.self = __STRCMP(aliasName, "@self") == 0; OPT_impCtxt.reffp = 0; - OPM_OldSym((void*)name, 256, &*done); + if ((OPT_impCtxt.self && __IN(17, OPM_Options, 32))) { + OPM_DeleteSym((void*)name, 256); + *done = 0; + } else { + OPM_OldSym((void*)name, 256, &*done); + } if (*done) { OPT_InMod(&mno); OPT_InLinks(); @@ -1902,7 +1907,7 @@ void OPT_Export (BOOLEAN *ext, BOOLEAN *new) OPT_newsf = 0; OPT_symNew = 0; if (!OPM_noerr || OPT_findpc) { - OPM_DeleteNewSym((void*)OPT_SelfName, 256); + OPM_DeleteSym((void*)OPT_SelfName, 256); } } } diff --git a/bootstrap/unix-88/Compiler.c b/bootstrap/unix-88/Compiler.c index f26c1a32..ed38ce7b 100644 --- a/bootstrap/unix-88/Compiler.c +++ b/bootstrap/unix-88/Compiler.c @@ -46,7 +46,7 @@ void Compiler_Module (BOOLEAN *done) OPV_Module(p); if (OPM_noerr) { if ((__IN(10, OPM_Options, 32) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { - OPM_DeleteNewSym((void*)OPT_SelfName, 256); + OPM_DeleteSym((void*)OPT_SelfName, 256); OPM_LogVT100((CHAR*)"32m", 4); OPM_LogWStr((CHAR*)" Main program.", 16); OPM_LogVT100((CHAR*)"0m", 3); @@ -62,7 +62,7 @@ void Compiler_Module (BOOLEAN *done) } } } else { - OPM_DeleteNewSym((void*)OPT_SelfName, 256); + OPM_DeleteSym((void*)OPT_SelfName, 256); } } } diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 2bc2c145..874cf058 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -49,8 +49,8 @@ export CHAR OPM_ResourceDir[1024]; static void OPM_Append (Files_Rider *R, ADDRESS *R__typ, Files_File F); export void OPM_CloseFiles (void); export void OPM_CloseOldSym (void); -export void OPM_DeleteNewSym (CHAR *modulename, ADDRESS modulename__len); export void OPM_DeleteObj (CHAR *modulename, ADDRESS modulename__len); +export void OPM_DeleteSym (CHAR *modulename, ADDRESS modulename__len); export void OPM_FPrint (INT32 *fp, INT64 val); export void OPM_FPrintLReal (INT32 *fp, LONGREAL val); export void OPM_FPrintReal (INT32 *fp, REAL val); @@ -436,8 +436,10 @@ void OPM_InitOptions (void) OPM_VerboseListSizes(); } __MOVE(OPM_InstallDir, OPM_ResourceDir, 1024); - Strings_Append((CHAR*)"/", 2, (void*)OPM_ResourceDir, 1024); - Strings_Append(OPM_Model, 10, (void*)OPM_ResourceDir, 1024); + if (OPM_ResourceDir[0] != 0x00) { + Strings_Append((CHAR*)"/", 2, (void*)OPM_ResourceDir, 1024); + Strings_Append(OPM_Model, 10, (void*)OPM_ResourceDir, 1024); + } modules[0] = 0x00; Platform_GetEnv((CHAR*)"MODULES", 8, (void*)modules, 1024); __MOVE(".", searchpath, 2); @@ -766,6 +768,9 @@ void OPM_OldSym (CHAR *modName, ADDRESS modName__len, BOOLEAN *done) { CHAR tag, ver; OPM_FileName fileName; + INT16 res; + OPM_oldSFile = NIL; + *done = 0; OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, 32, (CHAR*)".sym", 5); OPM_oldSFile = Files_Old(fileName, 32); *done = OPM_oldSFile != NIL; @@ -774,7 +779,9 @@ void OPM_OldSym (CHAR *modName, ADDRESS modName__len, BOOLEAN *done) Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&tag); Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&ver); if (tag != 0xf7 || ver != 0x83) { - OPM_err(-306); + if (!__IN(4, OPM_Options, 32)) { + OPM_err(-306); + } OPM_CloseOldSym(); *done = 0; } @@ -818,7 +825,7 @@ void OPM_RegisterNewSym (void) } } -void OPM_DeleteNewSym (CHAR *modulename, ADDRESS modulename__len) +void OPM_DeleteSym (CHAR *modulename, ADDRESS modulename__len) { OPM_FileName fn; INT16 res; diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index da0a48ee..51f64007 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -23,8 +23,8 @@ import CHAR OPM_ResourceDir[1024]; import void OPM_CloseFiles (void); import void OPM_CloseOldSym (void); -import void OPM_DeleteNewSym (CHAR *modulename, ADDRESS modulename__len); import void OPM_DeleteObj (CHAR *modulename, ADDRESS modulename__len); +import void OPM_DeleteSym (CHAR *modulename, ADDRESS modulename__len); import void OPM_FPrint (INT32 *fp, INT64 val); import void OPM_FPrintLReal (INT32 *fp, LONGREAL val); import void OPM_FPrintReal (INT32 *fp, REAL val); diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index 1a106cda..f9c49d00 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1493,7 +1493,12 @@ void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) OPT_impCtxt.nofm = 0; OPT_impCtxt.self = __STRCMP(aliasName, "@self") == 0; OPT_impCtxt.reffp = 0; - OPM_OldSym((void*)name, 256, &*done); + if ((OPT_impCtxt.self && __IN(17, OPM_Options, 32))) { + OPM_DeleteSym((void*)name, 256); + *done = 0; + } else { + OPM_OldSym((void*)name, 256, &*done); + } if (*done) { OPT_InMod(&mno); OPT_InLinks(); @@ -1902,7 +1907,7 @@ void OPT_Export (BOOLEAN *ext, BOOLEAN *new) OPT_newsf = 0; OPT_symNew = 0; if (!OPM_noerr || OPT_findpc) { - OPM_DeleteNewSym((void*)OPT_SelfName, 256); + OPM_DeleteSym((void*)OPT_SelfName, 256); } } } diff --git a/bootstrap/windows-48/Compiler.c b/bootstrap/windows-48/Compiler.c index f26c1a32..ed38ce7b 100644 --- a/bootstrap/windows-48/Compiler.c +++ b/bootstrap/windows-48/Compiler.c @@ -46,7 +46,7 @@ void Compiler_Module (BOOLEAN *done) OPV_Module(p); if (OPM_noerr) { if ((__IN(10, OPM_Options, 32) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { - OPM_DeleteNewSym((void*)OPT_SelfName, 256); + OPM_DeleteSym((void*)OPT_SelfName, 256); OPM_LogVT100((CHAR*)"32m", 4); OPM_LogWStr((CHAR*)" Main program.", 16); OPM_LogVT100((CHAR*)"0m", 3); @@ -62,7 +62,7 @@ void Compiler_Module (BOOLEAN *done) } } } else { - OPM_DeleteNewSym((void*)OPT_SelfName, 256); + OPM_DeleteSym((void*)OPT_SelfName, 256); } } } diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 3411635b..11aa9008 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -49,8 +49,8 @@ export CHAR OPM_ResourceDir[1024]; static void OPM_Append (Files_Rider *R, ADDRESS *R__typ, Files_File F); export void OPM_CloseFiles (void); export void OPM_CloseOldSym (void); -export void OPM_DeleteNewSym (CHAR *modulename, ADDRESS modulename__len); export void OPM_DeleteObj (CHAR *modulename, ADDRESS modulename__len); +export void OPM_DeleteSym (CHAR *modulename, ADDRESS modulename__len); export void OPM_FPrint (INT32 *fp, INT64 val); export void OPM_FPrintLReal (INT32 *fp, LONGREAL val); export void OPM_FPrintReal (INT32 *fp, REAL val); @@ -436,8 +436,10 @@ void OPM_InitOptions (void) OPM_VerboseListSizes(); } __MOVE(OPM_InstallDir, OPM_ResourceDir, 1024); - Strings_Append((CHAR*)"/", 2, (void*)OPM_ResourceDir, 1024); - Strings_Append(OPM_Model, 10, (void*)OPM_ResourceDir, 1024); + if (OPM_ResourceDir[0] != 0x00) { + Strings_Append((CHAR*)"/", 2, (void*)OPM_ResourceDir, 1024); + Strings_Append(OPM_Model, 10, (void*)OPM_ResourceDir, 1024); + } modules[0] = 0x00; Platform_GetEnv((CHAR*)"MODULES", 8, (void*)modules, 1024); __MOVE(".", searchpath, 2); @@ -766,6 +768,9 @@ void OPM_OldSym (CHAR *modName, ADDRESS modName__len, BOOLEAN *done) { CHAR tag, ver; OPM_FileName fileName; + INT16 res; + OPM_oldSFile = NIL; + *done = 0; OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, 32, (CHAR*)".sym", 5); OPM_oldSFile = Files_Old(fileName, 32); *done = OPM_oldSFile != NIL; @@ -774,7 +779,9 @@ void OPM_OldSym (CHAR *modName, ADDRESS modName__len, BOOLEAN *done) Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&tag); Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&ver); if (tag != 0xf7 || ver != 0x83) { - OPM_err(-306); + if (!__IN(4, OPM_Options, 32)) { + OPM_err(-306); + } OPM_CloseOldSym(); *done = 0; } @@ -818,7 +825,7 @@ void OPM_RegisterNewSym (void) } } -void OPM_DeleteNewSym (CHAR *modulename, ADDRESS modulename__len) +void OPM_DeleteSym (CHAR *modulename, ADDRESS modulename__len) { OPM_FileName fn; INT16 res; diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index da0a48ee..51f64007 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -23,8 +23,8 @@ import CHAR OPM_ResourceDir[1024]; import void OPM_CloseFiles (void); import void OPM_CloseOldSym (void); -import void OPM_DeleteNewSym (CHAR *modulename, ADDRESS modulename__len); import void OPM_DeleteObj (CHAR *modulename, ADDRESS modulename__len); +import void OPM_DeleteSym (CHAR *modulename, ADDRESS modulename__len); import void OPM_FPrint (INT32 *fp, INT64 val); import void OPM_FPrintLReal (INT32 *fp, LONGREAL val); import void OPM_FPrintReal (INT32 *fp, REAL val); diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index b95c2810..85113943 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1493,7 +1493,12 @@ void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) OPT_impCtxt.nofm = 0; OPT_impCtxt.self = __STRCMP(aliasName, "@self") == 0; OPT_impCtxt.reffp = 0; - OPM_OldSym((void*)name, 256, &*done); + if ((OPT_impCtxt.self && __IN(17, OPM_Options, 32))) { + OPM_DeleteSym((void*)name, 256); + *done = 0; + } else { + OPM_OldSym((void*)name, 256, &*done); + } if (*done) { OPT_InMod(&mno); OPT_InLinks(); @@ -1902,7 +1907,7 @@ void OPT_Export (BOOLEAN *ext, BOOLEAN *new) OPT_newsf = 0; OPT_symNew = 0; if (!OPM_noerr || OPT_findpc) { - OPM_DeleteNewSym((void*)OPT_SelfName, 256); + OPM_DeleteSym((void*)OPT_SelfName, 256); } } } diff --git a/bootstrap/windows-88/Compiler.c b/bootstrap/windows-88/Compiler.c index f26c1a32..ed38ce7b 100644 --- a/bootstrap/windows-88/Compiler.c +++ b/bootstrap/windows-88/Compiler.c @@ -46,7 +46,7 @@ void Compiler_Module (BOOLEAN *done) OPV_Module(p); if (OPM_noerr) { if ((__IN(10, OPM_Options, 32) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { - OPM_DeleteNewSym((void*)OPT_SelfName, 256); + OPM_DeleteSym((void*)OPT_SelfName, 256); OPM_LogVT100((CHAR*)"32m", 4); OPM_LogWStr((CHAR*)" Main program.", 16); OPM_LogVT100((CHAR*)"0m", 3); @@ -62,7 +62,7 @@ void Compiler_Module (BOOLEAN *done) } } } else { - OPM_DeleteNewSym((void*)OPT_SelfName, 256); + OPM_DeleteSym((void*)OPT_SelfName, 256); } } } diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 2bc2c145..874cf058 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -49,8 +49,8 @@ export CHAR OPM_ResourceDir[1024]; static void OPM_Append (Files_Rider *R, ADDRESS *R__typ, Files_File F); export void OPM_CloseFiles (void); export void OPM_CloseOldSym (void); -export void OPM_DeleteNewSym (CHAR *modulename, ADDRESS modulename__len); export void OPM_DeleteObj (CHAR *modulename, ADDRESS modulename__len); +export void OPM_DeleteSym (CHAR *modulename, ADDRESS modulename__len); export void OPM_FPrint (INT32 *fp, INT64 val); export void OPM_FPrintLReal (INT32 *fp, LONGREAL val); export void OPM_FPrintReal (INT32 *fp, REAL val); @@ -436,8 +436,10 @@ void OPM_InitOptions (void) OPM_VerboseListSizes(); } __MOVE(OPM_InstallDir, OPM_ResourceDir, 1024); - Strings_Append((CHAR*)"/", 2, (void*)OPM_ResourceDir, 1024); - Strings_Append(OPM_Model, 10, (void*)OPM_ResourceDir, 1024); + if (OPM_ResourceDir[0] != 0x00) { + Strings_Append((CHAR*)"/", 2, (void*)OPM_ResourceDir, 1024); + Strings_Append(OPM_Model, 10, (void*)OPM_ResourceDir, 1024); + } modules[0] = 0x00; Platform_GetEnv((CHAR*)"MODULES", 8, (void*)modules, 1024); __MOVE(".", searchpath, 2); @@ -766,6 +768,9 @@ void OPM_OldSym (CHAR *modName, ADDRESS modName__len, BOOLEAN *done) { CHAR tag, ver; OPM_FileName fileName; + INT16 res; + OPM_oldSFile = NIL; + *done = 0; OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, 32, (CHAR*)".sym", 5); OPM_oldSFile = Files_Old(fileName, 32); *done = OPM_oldSFile != NIL; @@ -774,7 +779,9 @@ void OPM_OldSym (CHAR *modName, ADDRESS modName__len, BOOLEAN *done) Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&tag); Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&ver); if (tag != 0xf7 || ver != 0x83) { - OPM_err(-306); + if (!__IN(4, OPM_Options, 32)) { + OPM_err(-306); + } OPM_CloseOldSym(); *done = 0; } @@ -818,7 +825,7 @@ void OPM_RegisterNewSym (void) } } -void OPM_DeleteNewSym (CHAR *modulename, ADDRESS modulename__len) +void OPM_DeleteSym (CHAR *modulename, ADDRESS modulename__len) { OPM_FileName fn; INT16 res; diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index da0a48ee..51f64007 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -23,8 +23,8 @@ import CHAR OPM_ResourceDir[1024]; import void OPM_CloseFiles (void); import void OPM_CloseOldSym (void); -import void OPM_DeleteNewSym (CHAR *modulename, ADDRESS modulename__len); import void OPM_DeleteObj (CHAR *modulename, ADDRESS modulename__len); +import void OPM_DeleteSym (CHAR *modulename, ADDRESS modulename__len); import void OPM_FPrint (INT32 *fp, INT64 val); import void OPM_FPrintLReal (INT32 *fp, LONGREAL val); import void OPM_FPrintReal (INT32 *fp, REAL val); diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index 1a106cda..f9c49d00 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1493,7 +1493,12 @@ void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) OPT_impCtxt.nofm = 0; OPT_impCtxt.self = __STRCMP(aliasName, "@self") == 0; OPT_impCtxt.reffp = 0; - OPM_OldSym((void*)name, 256, &*done); + if ((OPT_impCtxt.self && __IN(17, OPM_Options, 32))) { + OPM_DeleteSym((void*)name, 256); + *done = 0; + } else { + OPM_OldSym((void*)name, 256, &*done); + } if (*done) { OPT_InMod(&mno); OPT_InLinks(); @@ -1902,7 +1907,7 @@ void OPT_Export (BOOLEAN *ext, BOOLEAN *new) OPT_newsf = 0; OPT_symNew = 0; if (!OPM_noerr || OPT_findpc) { - OPM_DeleteNewSym((void*)OPT_SelfName, 256); + OPM_DeleteSym((void*)OPT_SelfName, 256); } } } From 7386767d8464f2b5839e4d972d706583a7d41fcb Mon Sep 17 00:00:00 2001 From: David Brown Date: Sun, 18 Dec 2016 17:12:00 +0000 Subject: [PATCH 439/580] Fix binary dir determination for mingw/msc. --- src/runtime/Modules.Mod | 7 ++++--- src/test/confidence/planned-binary-change | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/runtime/Modules.Mod b/src/runtime/Modules.Mod index 0b9f5fd0..350e036b 100644 --- a/src/runtime/Modules.Mod +++ b/src/runtime/Modules.Mod @@ -74,6 +74,7 @@ MODULE Modules; (* jt 6.1.96 *) RETURN i END ArgPos; + (* Determine directory from which this executable was loaded *) PROCEDURE CharCount(s: ARRAY OF CHAR): INTEGER; @@ -151,7 +152,7 @@ MODULE Modules; (* jt 6.1.96 *) END ExtractPart; PROCEDURE Trim(s: ARRAY OF CHAR; VAR d: ARRAY OF CHAR); - (* Remove redundant '.'s and '/'s. + (* Remove redundant '.'s and '/'s. Convert '\'s to '/'. *) Note, does not remove 'x/..'. This cannot safely be removed because if x is a link then 'x/..' means the parent of what x links to rather than the directory containing link x. @@ -187,8 +188,8 @@ MODULE Modules; (* jt 6.1.96 *) END; GetArg(0, arg0); (* arg0 is the command binary file name passed by the shell. *) - i := 0; WHILE (arg0[i] # 0X) & (arg0[i] # '/') DO INC(i) END; - IF arg0[i] = '/' THEN + i := 0; WHILE (arg0[i] # 0X) & (arg0[i] # '/') & (arg0[i] # '\') DO INC(i) END; + IF (arg0[i] = '/') OR (arg0[i] = '\') THEN (* The argument contains a '/', we expect it to work without reference to the path. *) Trim(arg0, tempstr); Canonify(tempstr, binarydir); diff --git a/src/test/confidence/planned-binary-change b/src/test/confidence/planned-binary-change index d7a05d09..9135bbd2 100644 --- a/src/test/confidence/planned-binary-change +++ b/src/test/confidence/planned-binary-change @@ -1 +1 @@ -18 Oct 2016 18:12:01 +18 Dec 2016 16:55:53 From 6f43c272c9b98c83f86a5cf982d4fdf4f888941f Mon Sep 17 00:00:00 2001 From: David Brown Date: Sun, 18 Dec 2016 17:13:46 +0000 Subject: [PATCH 440/580] Update bootstrap C sources. --- bootstrap/unix-44/Compiler.c | 2 +- bootstrap/unix-44/Configuration.c | 4 ++-- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Files.c | 2 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 2 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 6 +++--- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 2 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 2 +- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 2 +- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 2 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Out.c | 2 +- bootstrap/unix-44/Out.h | 2 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/VT100.c | 2 +- bootstrap/unix-44/VT100.h | 2 +- bootstrap/unix-44/extTools.c | 6 +++--- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-48/Compiler.c | 2 +- bootstrap/unix-48/Configuration.c | 4 ++-- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Files.c | 2 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 2 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 6 +++--- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 2 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 2 +- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 2 +- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 2 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Out.c | 2 +- bootstrap/unix-48/Out.h | 2 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/VT100.c | 2 +- bootstrap/unix-48/VT100.h | 2 +- bootstrap/unix-48/extTools.c | 6 +++--- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-88/Compiler.c | 2 +- bootstrap/unix-88/Configuration.c | 4 ++-- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Files.c | 2 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 2 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 6 +++--- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 2 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 2 +- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 2 +- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 2 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Out.c | 2 +- bootstrap/unix-88/Out.h | 2 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/VT100.c | 2 +- bootstrap/unix-88/VT100.h | 2 +- bootstrap/unix-88/extTools.c | 6 +++--- bootstrap/unix-88/extTools.h | 2 +- bootstrap/windows-48/Compiler.c | 2 +- bootstrap/windows-48/Configuration.c | 4 ++-- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Files.c | 2 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 2 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 6 +++--- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 2 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 2 +- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 2 +- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 2 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Out.c | 2 +- bootstrap/windows-48/Out.h | 2 +- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/VT100.c | 2 +- bootstrap/windows-48/VT100.h | 2 +- bootstrap/windows-48/extTools.c | 6 +++--- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-88/Compiler.c | 2 +- bootstrap/windows-88/Configuration.c | 4 ++-- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Files.c | 2 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 2 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 6 +++--- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 2 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 2 +- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 2 +- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 2 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Out.c | 2 +- bootstrap/windows-88/Out.h | 2 +- bootstrap/windows-88/Platform.c | 2 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/VT100.c | 2 +- bootstrap/windows-88/VT100.h | 2 +- bootstrap/windows-88/extTools.c | 6 +++--- bootstrap/windows-88/extTools.h | 2 +- src/runtime/Modules.Mod | 2 +- 186 files changed, 211 insertions(+), 211 deletions(-) diff --git a/bootstrap/unix-44/Compiler.c b/bootstrap/unix-44/Compiler.c index ed38ce7b..c828f47d 100644 --- a/bootstrap/unix-44/Compiler.c +++ b/bootstrap/unix-44/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index 18ec858a..5fa885ca 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index efd4ae6e..af5f5580 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index dac5c5ff..9d302c54 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index 2291d7d8..dd99850c 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index df3d086b..a5b7cd03 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index 7a464dbf..8a81aea1 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index 76891be3..881bee5a 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -267,10 +267,10 @@ static void Modules_FindBinaryDir (CHAR *binarydir, ADDRESS binarydir__len) } Modules_GetArg(0, (void*)arg0, 4096); i = 0; - while ((arg0[__X(i, 4096)] != 0x00 && arg0[__X(i, 4096)] != '/')) { + while ((((arg0[__X(i, 4096)] != 0x00 && arg0[__X(i, 4096)] != '/')) && arg0[__X(i, 4096)] != '\\')) { i += 1; } - if (arg0[__X(i, 4096)] == '/') { + if (arg0[__X(i, 4096)] == '/' || arg0[__X(i, 4096)] == '\\') { Modules_Trim(arg0, 4096, (void*)tempstr, 4096); Modules_Canonify(tempstr, 4096, (void*)binarydir, binarydir__len); present = Modules_IsFilePresent(binarydir, binarydir__len); diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index 9f691749..9e1502d5 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index 3933cee1..c8ffb553 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index 9f8518b8..587f5ca2 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 24cd4f3f..556ff058 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index 99b9afb4..377385f1 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 11aa9008..5ec11c6f 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index 51f64007..d52e3f0f 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index aad8367d..3199e877 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index dc8aa405..c168cbe7 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index d0a1851a..b554bf21 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index 608979a8..6e983459 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index 3f58d991..fb5288f9 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index 7483f169..bc21d626 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index 152db225..adffc7a4 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index 7c94fced..5d34109a 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Out.c b/bootstrap/unix-44/Out.c index d1fba01a..5f70ffca 100644 --- a/bootstrap/unix-44/Out.c +++ b/bootstrap/unix-44/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Out.h b/bootstrap/unix-44/Out.h index a7195e3a..4f49bfa7 100644 --- a/bootstrap/unix-44/Out.h +++ b/bootstrap/unix-44/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 6117b38b..5900abf5 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index 521594dc..c628a89b 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 11ad01bd..2b39fcf1 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index bf708519..016451be 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index 06972c90..b7456c5c 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index fd7f283d..be22ef18 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index fe342ae1..c6e6c87a 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index a8edeb78..f3849ea7 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/VT100.c b/bootstrap/unix-44/VT100.c index baa92092..9b5da2b4 100644 --- a/bootstrap/unix-44/VT100.c +++ b/bootstrap/unix-44/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/VT100.h b/bootstrap/unix-44/VT100.h index 4c0087ac..2c94eb2a 100644 --- a/bootstrap/unix-44/VT100.h +++ b/bootstrap/unix-44/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index 75768aca..fd65edea 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -65,7 +65,7 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) { - __COPY("gcc -g", s, s__len); + __COPY("i686-w64-mingw32-gcc -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); @@ -95,7 +95,7 @@ void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN stati Strings_Append((CHAR*)".c ", 4, (void*)cmd, 1023); Strings_Append(additionalopts, additionalopts__len, (void*)cmd, 1023); if (statically) { - Strings_Append((CHAR*)" -static", 9, (void*)cmd, 1023); + Strings_Append((CHAR*)"", 1, (void*)cmd, 1023); } Strings_Append((CHAR*)" -o ", 5, (void*)cmd, 1023); Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index fb870961..7d8a92d3 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/Compiler.c b/bootstrap/unix-48/Compiler.c index ed38ce7b..c828f47d 100644 --- a/bootstrap/unix-48/Compiler.c +++ b/bootstrap/unix-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index 18ec858a..5fa885ca 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index efd4ae6e..af5f5580 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index dac5c5ff..9d302c54 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index 2291d7d8..dd99850c 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index df3d086b..a5b7cd03 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index 7a464dbf..8a81aea1 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index 76891be3..881bee5a 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -267,10 +267,10 @@ static void Modules_FindBinaryDir (CHAR *binarydir, ADDRESS binarydir__len) } Modules_GetArg(0, (void*)arg0, 4096); i = 0; - while ((arg0[__X(i, 4096)] != 0x00 && arg0[__X(i, 4096)] != '/')) { + while ((((arg0[__X(i, 4096)] != 0x00 && arg0[__X(i, 4096)] != '/')) && arg0[__X(i, 4096)] != '\\')) { i += 1; } - if (arg0[__X(i, 4096)] == '/') { + if (arg0[__X(i, 4096)] == '/' || arg0[__X(i, 4096)] == '\\') { Modules_Trim(arg0, 4096, (void*)tempstr, 4096); Modules_Canonify(tempstr, 4096, (void*)binarydir, binarydir__len); present = Modules_IsFilePresent(binarydir, binarydir__len); diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index 9f691749..9e1502d5 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index 3933cee1..c8ffb553 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index 9f8518b8..587f5ca2 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 24cd4f3f..556ff058 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index 99b9afb4..377385f1 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 11aa9008..5ec11c6f 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index 51f64007..d52e3f0f 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index aad8367d..3199e877 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index dc8aa405..c168cbe7 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index d0a1851a..b554bf21 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index 608979a8..6e983459 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 85113943..13794d5f 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index 7483f169..bc21d626 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index 152db225..adffc7a4 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index 7c94fced..5d34109a 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Out.c b/bootstrap/unix-48/Out.c index d1fba01a..5f70ffca 100644 --- a/bootstrap/unix-48/Out.c +++ b/bootstrap/unix-48/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Out.h b/bootstrap/unix-48/Out.h index a7195e3a..4f49bfa7 100644 --- a/bootstrap/unix-48/Out.h +++ b/bootstrap/unix-48/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 6117b38b..5900abf5 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index 521594dc..c628a89b 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 11ad01bd..2b39fcf1 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index bf708519..016451be 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index 06972c90..b7456c5c 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index fd7f283d..be22ef18 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index 285e7ac0..2182dda5 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index 7f7d6562..fad4ca32 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/VT100.c b/bootstrap/unix-48/VT100.c index baa92092..9b5da2b4 100644 --- a/bootstrap/unix-48/VT100.c +++ b/bootstrap/unix-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/VT100.h b/bootstrap/unix-48/VT100.h index 4c0087ac..2c94eb2a 100644 --- a/bootstrap/unix-48/VT100.h +++ b/bootstrap/unix-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index 75768aca..fd65edea 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -65,7 +65,7 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) { - __COPY("gcc -g", s, s__len); + __COPY("i686-w64-mingw32-gcc -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); @@ -95,7 +95,7 @@ void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN stati Strings_Append((CHAR*)".c ", 4, (void*)cmd, 1023); Strings_Append(additionalopts, additionalopts__len, (void*)cmd, 1023); if (statically) { - Strings_Append((CHAR*)" -static", 9, (void*)cmd, 1023); + Strings_Append((CHAR*)"", 1, (void*)cmd, 1023); } Strings_Append((CHAR*)" -o ", 5, (void*)cmd, 1023); Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index fb870961..7d8a92d3 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/Compiler.c b/bootstrap/unix-88/Compiler.c index ed38ce7b..c828f47d 100644 --- a/bootstrap/unix-88/Compiler.c +++ b/bootstrap/unix-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index 18ec858a..5fa885ca 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index efd4ae6e..af5f5580 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 4a5cec7c..915b50ff 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 987ffaf2..90be7986 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index ba215672..c618f3ef 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index bbd83594..cd281d35 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 037d74d0..95117c1d 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -267,10 +267,10 @@ static void Modules_FindBinaryDir (CHAR *binarydir, ADDRESS binarydir__len) } Modules_GetArg(0, (void*)arg0, 4096); i = 0; - while ((arg0[__X(i, 4096)] != 0x00 && arg0[__X(i, 4096)] != '/')) { + while ((((arg0[__X(i, 4096)] != 0x00 && arg0[__X(i, 4096)] != '/')) && arg0[__X(i, 4096)] != '\\')) { i += 1; } - if (arg0[__X(i, 4096)] == '/') { + if (arg0[__X(i, 4096)] == '/' || arg0[__X(i, 4096)] == '\\') { Modules_Trim(arg0, 4096, (void*)tempstr, 4096); Modules_Canonify(tempstr, 4096, (void*)binarydir, binarydir__len); present = Modules_IsFilePresent(binarydir, binarydir__len); diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index be3fd68b..98b2aa47 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index 3933cee1..c8ffb553 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index 9f8518b8..587f5ca2 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index 24cd4f3f..556ff058 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index 99b9afb4..377385f1 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 874cf058..4b66e7f1 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index 51f64007..d52e3f0f 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index 0a6a6796..06c6a681 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index dc8aa405..c168cbe7 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index d0a1851a..b554bf21 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index 608979a8..6e983459 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index f9c49d00..cd38533c 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 7483f169..bc21d626 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 4d29b076..327f244d 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index 7c94fced..5d34109a 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Out.c b/bootstrap/unix-88/Out.c index e24a77fc..a5f08778 100644 --- a/bootstrap/unix-88/Out.c +++ b/bootstrap/unix-88/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Out.h b/bootstrap/unix-88/Out.h index 311e737d..26039116 100644 --- a/bootstrap/unix-88/Out.h +++ b/bootstrap/unix-88/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 7ed88d75..3c0223f6 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index 9b911314..34af667e 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 11ad01bd..2b39fcf1 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index bf708519..016451be 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index 06972c90..b7456c5c 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index fd7f283d..be22ef18 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index 2bfa4511..09c54393 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index 21401f61..cc880f07 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/VT100.c b/bootstrap/unix-88/VT100.c index baa92092..9b5da2b4 100644 --- a/bootstrap/unix-88/VT100.c +++ b/bootstrap/unix-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/VT100.h b/bootstrap/unix-88/VT100.h index 4c0087ac..2c94eb2a 100644 --- a/bootstrap/unix-88/VT100.h +++ b/bootstrap/unix-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index 75768aca..fd65edea 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -65,7 +65,7 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) { - __COPY("gcc -g", s, s__len); + __COPY("i686-w64-mingw32-gcc -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); @@ -95,7 +95,7 @@ void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN stati Strings_Append((CHAR*)".c ", 4, (void*)cmd, 1023); Strings_Append(additionalopts, additionalopts__len, (void*)cmd, 1023); if (statically) { - Strings_Append((CHAR*)" -static", 9, (void*)cmd, 1023); + Strings_Append((CHAR*)"", 1, (void*)cmd, 1023); } Strings_Append((CHAR*)" -o ", 5, (void*)cmd, 1023); Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index fb870961..7d8a92d3 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/Compiler.c b/bootstrap/windows-48/Compiler.c index ed38ce7b..c828f47d 100644 --- a/bootstrap/windows-48/Compiler.c +++ b/bootstrap/windows-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index 18ec858a..5fa885ca 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index efd4ae6e..af5f5580 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index a5c597ca..6557a312 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index 63eaa089..8fbe56ca 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index df3d086b..a5b7cd03 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index 7a464dbf..8a81aea1 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index 859d31ba..bda8ec0b 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -267,10 +267,10 @@ static void Modules_FindBinaryDir (CHAR *binarydir, ADDRESS binarydir__len) } Modules_GetArg(0, (void*)arg0, 4096); i = 0; - while ((arg0[__X(i, 4096)] != 0x00 && arg0[__X(i, 4096)] != '/')) { + while ((((arg0[__X(i, 4096)] != 0x00 && arg0[__X(i, 4096)] != '/')) && arg0[__X(i, 4096)] != '\\')) { i += 1; } - if (arg0[__X(i, 4096)] == '/') { + if (arg0[__X(i, 4096)] == '/' || arg0[__X(i, 4096)] == '\\') { Modules_Trim(arg0, 4096, (void*)tempstr, 4096); Modules_Canonify(tempstr, 4096, (void*)binarydir, binarydir__len); present = Modules_IsFilePresent(binarydir, binarydir__len); diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index 9f691749..9e1502d5 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index 3933cee1..c8ffb553 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index 9f8518b8..587f5ca2 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 24cd4f3f..556ff058 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index 99b9afb4..377385f1 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 11aa9008..5ec11c6f 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index 51f64007..d52e3f0f 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index aad8367d..3199e877 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index dc8aa405..c168cbe7 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index d0a1851a..b554bf21 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index 608979a8..6e983459 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 85113943..13794d5f 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index 7483f169..bc21d626 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index 152db225..adffc7a4 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index 7c94fced..5d34109a 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Out.c b/bootstrap/windows-48/Out.c index b5ffb6ae..07ed2f75 100644 --- a/bootstrap/windows-48/Out.c +++ b/bootstrap/windows-48/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Out.h b/bootstrap/windows-48/Out.h index a7195e3a..4f49bfa7 100644 --- a/bootstrap/windows-48/Out.h +++ b/bootstrap/windows-48/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 73b65c9d..bf9c1b7f 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index 95a1066e..99ea737f 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 11ad01bd..2b39fcf1 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index bf708519..016451be 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index 06972c90..b7456c5c 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index fd7f283d..be22ef18 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index 285e7ac0..2182dda5 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index 7f7d6562..fad4ca32 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/VT100.c b/bootstrap/windows-48/VT100.c index baa92092..9b5da2b4 100644 --- a/bootstrap/windows-48/VT100.c +++ b/bootstrap/windows-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/VT100.h b/bootstrap/windows-48/VT100.h index 4c0087ac..2c94eb2a 100644 --- a/bootstrap/windows-48/VT100.h +++ b/bootstrap/windows-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index 75768aca..fd65edea 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -65,7 +65,7 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) { - __COPY("gcc -g", s, s__len); + __COPY("i686-w64-mingw32-gcc -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); @@ -95,7 +95,7 @@ void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN stati Strings_Append((CHAR*)".c ", 4, (void*)cmd, 1023); Strings_Append(additionalopts, additionalopts__len, (void*)cmd, 1023); if (statically) { - Strings_Append((CHAR*)" -static", 9, (void*)cmd, 1023); + Strings_Append((CHAR*)"", 1, (void*)cmd, 1023); } Strings_Append((CHAR*)" -o ", 5, (void*)cmd, 1023); Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index fb870961..7d8a92d3 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/Compiler.c b/bootstrap/windows-88/Compiler.c index ed38ce7b..c828f47d 100644 --- a/bootstrap/windows-88/Compiler.c +++ b/bootstrap/windows-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index 18ec858a..5fa885ca 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index efd4ae6e..af5f5580 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 206de2b2..097b5552 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index ef890edf..6ef831df 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index ba215672..c618f3ef 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index bbd83594..cd281d35 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 16daab43..c210b7d7 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -267,10 +267,10 @@ static void Modules_FindBinaryDir (CHAR *binarydir, ADDRESS binarydir__len) } Modules_GetArg(0, (void*)arg0, 4096); i = 0; - while ((arg0[__X(i, 4096)] != 0x00 && arg0[__X(i, 4096)] != '/')) { + while ((((arg0[__X(i, 4096)] != 0x00 && arg0[__X(i, 4096)] != '/')) && arg0[__X(i, 4096)] != '\\')) { i += 1; } - if (arg0[__X(i, 4096)] == '/') { + if (arg0[__X(i, 4096)] == '/' || arg0[__X(i, 4096)] == '\\') { Modules_Trim(arg0, 4096, (void*)tempstr, 4096); Modules_Canonify(tempstr, 4096, (void*)binarydir, binarydir__len); present = Modules_IsFilePresent(binarydir, binarydir__len); diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index be3fd68b..98b2aa47 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index 3933cee1..c8ffb553 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index 9f8518b8..587f5ca2 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index 24cd4f3f..556ff058 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index 99b9afb4..377385f1 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 874cf058..4b66e7f1 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index 51f64007..d52e3f0f 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index 0a6a6796..06c6a681 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index dc8aa405..c168cbe7 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index d0a1851a..b554bf21 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index 608979a8..6e983459 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index f9c49d00..cd38533c 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 7483f169..bc21d626 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 4d29b076..327f244d 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index 7c94fced..5d34109a 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Out.c b/bootstrap/windows-88/Out.c index 01c22546..6ad86a73 100644 --- a/bootstrap/windows-88/Out.c +++ b/bootstrap/windows-88/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Out.h b/bootstrap/windows-88/Out.h index 311e737d..26039116 100644 --- a/bootstrap/windows-88/Out.h +++ b/bootstrap/windows-88/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 944c4407..aa0f4ff3 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index 4311c64a..7699502f 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 11ad01bd..2b39fcf1 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index bf708519..016451be 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index 06972c90..b7456c5c 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index fd7f283d..be22ef18 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index 2bfa4511..09c54393 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index 21401f61..cc880f07 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/VT100.c b/bootstrap/windows-88/VT100.c index baa92092..9b5da2b4 100644 --- a/bootstrap/windows-88/VT100.c +++ b/bootstrap/windows-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/VT100.h b/bootstrap/windows-88/VT100.h index 4c0087ac..2c94eb2a 100644 --- a/bootstrap/windows-88/VT100.h +++ b/bootstrap/windows-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index 75768aca..fd65edea 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -65,7 +65,7 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) { - __COPY("gcc -g", s, s__len); + __COPY("i686-w64-mingw32-gcc -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); @@ -95,7 +95,7 @@ void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN stati Strings_Append((CHAR*)".c ", 4, (void*)cmd, 1023); Strings_Append(additionalopts, additionalopts__len, (void*)cmd, 1023); if (statically) { - Strings_Append((CHAR*)" -static", 9, (void*)cmd, 1023); + Strings_Append((CHAR*)"", 1, (void*)cmd, 1023); } Strings_Append((CHAR*)" -o ", 5, (void*)cmd, 1023); Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index fb870961..7d8a92d3 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/src/runtime/Modules.Mod b/src/runtime/Modules.Mod index 350e036b..cf398304 100644 --- a/src/runtime/Modules.Mod +++ b/src/runtime/Modules.Mod @@ -152,7 +152,7 @@ MODULE Modules; (* jt 6.1.96 *) END ExtractPart; PROCEDURE Trim(s: ARRAY OF CHAR; VAR d: ARRAY OF CHAR); - (* Remove redundant '.'s and '/'s. Convert '\'s to '/'. *) + (* Remove redundant '.'s and '/'s. Convert '\'s to '/'. Note, does not remove 'x/..'. This cannot safely be removed because if x is a link then 'x/..' means the parent of what x links to rather than the directory containing link x. From 43117e79f77a9fc2024fb0c91dda0b7d74dc11f1 Mon Sep 17 00:00:00 2001 From: David Brown Date: Mon, 19 Dec 2016 16:00:57 +0000 Subject: [PATCH 441/580] Integrate JTempl's new OFront heap implementation using unsigned address arithmetic. --- src/runtime/Heap.Mod | 182 +++++++++++++++++++++---------------------- 1 file changed, 87 insertions(+), 95 deletions(-) diff --git a/src/runtime/Heap.Mod b/src/runtime/Heap.Mod index 11b1b116..33d16f7b 100644 --- a/src/runtime/Heap.Mod +++ b/src/runtime/Heap.Mod @@ -8,7 +8,7 @@ MODULE Heap; CmdNameLen = 24; SZA = SIZE(S.ADDRESS); (* Size of address *) Unit = 4*SZA; (* smallest possible heap block *) - nofLists = 9; (* number of free_lists *) + nofLists = 9; (* number of freelist entries excluding sentinel *) heapSize0 = 8000*Unit; (* startup heap size *) (* all blocks look the same: @@ -50,7 +50,7 @@ MODULE Heap; enumPtrs-: EnumProc; reserved1, reserved2: LONGINT - END ; + END; Command- = PROCEDURE; @@ -58,7 +58,7 @@ MODULE Heap; next-: Cmd; name-: CmdName; cmd-: Command - END ; + END; Finalizer = PROCEDURE(obj: S.PTR); @@ -68,7 +68,7 @@ MODULE Heap; obj: S.ADDRESS; (* weak pointer *) marked: BOOLEAN; finalize: Finalizer; - END ; + END; VAR (* the list of loaded (=initialization started) modules *) @@ -81,10 +81,8 @@ MODULE Heap; (* extensible heap *) heap-: S.ADDRESS; (* the sorted list of heap chunks *) - heapNegMin: S.ADDRESS; (* Range of pointer values, used for stack collection *) - heapNegMax: S.ADDRESS; - heapPosMin: S.ADDRESS; - heapPosMax: S.ADDRESS; + heapMin: S.ADDRESS; (* Range of valid pointer values, used for stack collection *) + heapMax: S.ADDRESS; heapsize*: S.ADDRESS; (* the sum of all heap chunk sizes *) (* finalization candidates *) @@ -114,6 +112,9 @@ MODULE Heap; END Unlock; + PROCEDURE -uLT(x, y: S.ADDRESS): BOOLEAN "((size_t)x < (size_t)y)"; + PROCEDURE -uLE(x, y: S.ADDRESS): BOOLEAN "((size_t)x <= (size_t)y)"; + (* PROCEDURE TAS*(VAR flag:BOOLEAN): BOOLEAN; (* added for compatibility with ulmSYSTEM module; noch *) VAR oldflag : BOOLEAN; @@ -200,13 +201,8 @@ MODULE Heap; bigBlocks := blk; (* Prepend block to list of big blocks *) INC(heapsize, blksz); (* Maintain heap range limits *) - IF chnk > 0 THEN - IF chnk < heapPosMin THEN heapPosMin := blk + SZA END; - IF end > heapPosMax THEN heapPosMax := end END - ELSE (* chnk < 0 *) - IF chnk < heapNegMin THEN heapNegMin := blk + SZA END; - IF end > heapNegMax THEN heapNegMax := end END - END + IF uLT(blk + SZA, heapMin) THEN heapMin := blk + SZA END; + IF uLT(heapMax, end) THEN heapMax := end END END; RETURN chnk END NewChunk; @@ -214,17 +210,17 @@ MODULE Heap; PROCEDURE ExtendHeap(blksz: S.ADDRESS); VAR size, chnk, j, next: S.ADDRESS; BEGIN - IF blksz > 10000*Unit THEN size := blksz + IF uLT(10000*Unit, blksz) THEN size := blksz ELSE size := 10000*Unit (* additional heuristics *) - END ; + END; chnk := NewChunk(size); IF chnk # 0 THEN (*sorted insertion*) - IF chnk < heap THEN + IF uLT(chnk, heap) THEN S.PUT(chnk, heap); heap := chnk ELSE j := heap; S.GET(j, next); - WHILE (next # 0) & (chnk - next > 0) DO + WHILE (next # 0) & uLT(next, chnk) DO j := next; S.GET(j, next) END; @@ -248,13 +244,13 @@ MODULE Heap; ASSERT(blksz MOD Unit = 0); i0 := blksz DIV Unit; i := i0; - IF i < nofLists THEN adr := freeList[i]; + IF uLT(i, nofLists) THEN adr := freeList[i]; WHILE adr = 0 DO INC(i); adr := freeList[i] END - END ; - IF i < nofLists THEN (* unlink *) + END; + IF uLT(i, nofLists) THEN (* Unlink from freelist[i] *) S.GET(adr + nextOff, next); freeList[i] := next; - IF i # i0 THEN (* split *) + IF i # i0 THEN (* Split *) di := i - i0; restsize := di * Unit; end := adr + restsize; S.PUT(end + sizeOff, blksz); S.PUT(end + sntlOff, NoPtrSntl); @@ -264,60 +260,61 @@ MODULE Heap; freeList[di] := adr; INC(adr, restsize) END - ELSE + ELSE (* Search in bigBlocks *) adr := bigBlocks; prev := 0; LOOP - IF adr = 0 THEN + IF adr = 0 THEN (* Nothing free *) IF firstTry THEN GC(TRUE); INC(blksz, Unit); - IF (heapsize - allocated - blksz) * 4 < heapsize THEN - (* heap is still almost full; expand to avoid thrashing *) + IF uLT(heapsize - allocated, blksz) + OR uLT((heapsize - allocated - blksz) * 4, heapsize) THEN + (* heap would still be more than 3/4 full; expand to avoid thrashing *) ExtendHeap((allocated + blksz) DIV (3*Unit) * (4*Unit) - heapsize) - END ; + END; firstTry := FALSE; new := NEWREC(tag); firstTry := TRUE; IF new = NIL THEN (* depending on the fragmentation, the heap may not have been extended by the anti-thrashing heuristics above *) ExtendHeap((allocated + blksz) DIV (3*Unit) * (4*Unit) - heapsize); new := NEWREC(tag); (* will find a free block if heap has been expanded properly *) - END ; + END; Unlock(); RETURN new ELSE Unlock(); RETURN NIL END - END ; + END; S.GET(adr+sizeOff, t); - IF t >= blksz THEN EXIT END ; + IF uLE(blksz, t) THEN EXIT END; prev := adr; S.GET(adr + nextOff, adr) - END ; + END; restsize := t - blksz; end := adr + restsize; S.PUT(end + sizeOff, blksz); S.PUT(end + sntlOff, NoPtrSntl); S.PUT(end, end + sizeOff); - IF restsize > nofLists * Unit THEN (*resize*) + IF uLT(nofLists * Unit, restsize) THEN (* Resize *) S.PUT(adr + sizeOff, restsize) - ELSE (*unlink*) + ELSE (* Unlink *) S.GET(adr + nextOff, next); IF prev = 0 THEN bigBlocks := next ELSE S.PUT(prev + nextOff, next); - END ; - IF restsize > 0 THEN (*move*) + END; + IF restsize # 0 THEN (* Move *) di := restsize DIV Unit; S.PUT(adr + sizeOff, restsize); S.PUT(adr + nextOff, freeList[di]); freeList[di] := adr END - END ; + END; INC(adr, restsize) - END ; + END; i := adr + 4*SZA; end := adr + blksz; - WHILE end - i > 0 DO (*deliberately unrolled*) + WHILE uLT(i, end) DO (* Deliberately unrolled *) S.PUT(i, AddressZero); S.PUT(i + SZA, AddressZero); S.PUT(i + 2*SZA, AddressZero); S.PUT(i + 3*SZA, AddressZero); INC(i, 4*SZA) - END ; + END; S.PUT(adr + nextOff, AddressZero); S.PUT(adr, tag); S.PUT(adr + sizeOff, AddressZero); @@ -355,7 +352,7 @@ MODULE Heap; S.GET(tag, offset); (* Get next ptr field offset *) IF offset < 0 THEN (* Sentinel reached: Value is -8*(#fields+1) *) S.PUT(q - SZA, tag + offset + 1); (* Rotate base ptr into tag *) - IF p = 0 THEN EXIT END ; + IF p = 0 THEN EXIT END; n := q; q := p; S.GET(q - SZA, tag); DEC(tag, 1); S.GET(tag, offset); fld := q + offset; @@ -373,7 +370,7 @@ MODULE Heap; tag := tagbits END END - END ; + END; INC(tag, SZA) END END @@ -388,24 +385,24 @@ MODULE Heap; PROCEDURE Scan; VAR chnk, adr, end, start, tag, i, size, freesize: S.ADDRESS; BEGIN bigBlocks := 0; i := 1; - WHILE i < nofLists DO freeList[i] := 0; INC(i) END ; + WHILE i < nofLists DO freeList[i] := 0; INC(i) END; freesize := 0; allocated := 0; chnk := heap; WHILE chnk # 0 DO adr := chnk + blkOff; S.GET(chnk + endOff, end); - WHILE end - adr > 0 DO + WHILE uLT(adr, end) DO S.GET(adr, tag); - IF ODD(tag) THEN (*marked*) - IF freesize > 0 THEN + IF ODD(tag) THEN (* Marked *) + IF freesize # 0 THEN start := adr - freesize; S.PUT(start, start+SZA); S.PUT(start+sizeOff, freesize); S.PUT(start+sntlOff, NoPtrSntl); i := freesize DIV Unit; freesize := 0; - IF i < nofLists THEN S.PUT(start + nextOff, freeList[i]); freeList[i] := start - ELSE S.PUT(start + nextOff, bigBlocks); bigBlocks := start + IF uLT(i, nofLists) THEN S.PUT(start + nextOff, freeList[i]); freeList[i] := start + ELSE S.PUT(start + nextOff, bigBlocks); bigBlocks := start END - END ; + END; DEC(tag, 1); S.PUT(adr, tag); S.GET(tag, size); @@ -416,17 +413,17 @@ MODULE Heap; INC(freesize, size); INC(adr, size) END - END ; - IF freesize > 0 THEN (*collect last block*) + END; + IF freesize # 0 THEN (* Collect last block *) start := adr - freesize; S.PUT(start, start+SZA); S.PUT(start+sizeOff, freesize); S.PUT(start+sntlOff, NoPtrSntl); i := freesize DIV Unit; freesize := 0; - IF i < nofLists THEN S.PUT(start + nextOff, freeList[i]); freeList[i] := start - ELSE S.PUT(start + nextOff, bigBlocks); bigBlocks := start + IF uLT(i, nofLists) THEN S.PUT(start + nextOff, freeList[i]); freeList[i] := start + ELSE S.PUT(start + nextOff, bigBlocks); bigBlocks := start END - END ; + END; S.GET(chnk, chnk) END END Scan; @@ -435,8 +432,8 @@ MODULE Heap; VAR i, j, x: S.ADDRESS; BEGIN j := l; x := a[j]; LOOP i := j; j := 2*j + 1; - IF (j < r) & (a[j] < a[j+1]) THEN INC(j) END; - IF (j > r) OR (a[j] <= x) THEN EXIT END; + IF (j < r) & uLT(a[j], a[j+1]) THEN INC(j) END; + IF (j > r) OR uLE(a[j], x) THEN EXIT END; a[i] := a[j] END; a[i] := x @@ -449,29 +446,27 @@ MODULE Heap; WHILE r > 0 DO x := a[0]; a[0] := a[r]; a[r] := x; DEC(r); Sift(l, r, a) END END HeapSort; - PROCEDURE MarkCandidates(n: S.ADDRESS; VAR cand: ARRAY OF S.ADDRESS); - VAR chnk, adr, tag, next, lim, lim1, i, ptr, size: S.ADDRESS; + PROCEDURE MarkCandidates(n: LONGINT; VAR cand: ARRAY OF S.ADDRESS); + VAR chnk, end, adr, tag, next, i, ptr, size: S.ADDRESS; BEGIN - chnk := heap; i := 0; lim := cand[n-1]; - WHILE (chnk # 0 ) & (lim - chnk > 0) DO + ASSERT(n > 0); + chnk := heap; i := 0; + WHILE chnk # 0 DO + S.GET(chnk + endOff, end); adr := chnk + blkOff; - S.GET(chnk + endOff, lim1); - IF lim1 - lim > 0 THEN lim1 := lim END ; - WHILE lim1 - adr > 0 DO + WHILE uLT(adr, end) DO S.GET(adr, tag); IF ODD(tag) THEN (*already marked*) - S.GET(tag-1, size); INC(adr, size) + S.GET(tag-1, size); INC(adr, size); ptr := adr + SZA; + WHILE uLT(cand[i], ptr) DO INC(i); IF i = n THEN RETURN END END ; ELSE - S.GET(tag, size); - ptr := adr + SZA; - WHILE ptr - cand[i] > 0 DO INC(i) END ; - IF i = n THEN RETURN END ; - next := adr + size; - IF next - cand[i] > 0 THEN Mark(ptr) END ; - adr := next - END + S.GET(tag, size); ptr := adr + SZA; INC(adr, size); + WHILE uLT(cand[i], ptr) DO INC(i); IF i = n THEN RETURN END END ; + IF uLT(cand[i], adr) THEN Mark(ptr) END + END ; + IF uLE(end, cand[i]) THEN (*skip rest of this heap chunk*) adr := end END END ; - S.GET(chnk, chnk) + S.GET(chnk + nextChnkOff, chnk) END END MarkCandidates; @@ -483,7 +478,7 @@ MODULE Heap; S.GET(n.obj - SZA, tag); IF ~ODD(tag) THEN n.marked := FALSE; Mark(n.obj) ELSE n.marked := TRUE - END ; + END; n := n.next END END CheckFin; @@ -493,7 +488,7 @@ MODULE Heap; BEGIN n := fin; prev := NIL; WHILE n # NIL DO IF ~n.marked THEN - IF n = fin THEN fin := fin.next ELSE prev.next := n.next END ; + IF n = fin THEN fin := fin.next ELSE prev.next := n.next END; n.finalize(S.VAL(S.PTR, n.obj)); (* new nodes may have been pushed in n.finalize, therefore: *) IF prev = NIL THEN n := fin ELSE n := n.next END @@ -518,28 +513,27 @@ MODULE Heap; PROCEDURE MarkStack(n: S.ADDRESS; VAR cand: ARRAY OF S.ADDRESS); VAR frame: S.PTR; - inc, nofcand: S.ADDRESS; - sp, p, stack0: S.ADDRESS; - align: RECORD ch: CHAR; p: S.PTR END ; + nofcand: LONGINT; + inc, sp, p, stack0: S.ADDRESS; + align: RECORD ch: CHAR; p: S.PTR END; BEGIN IF n > 0 THEN MarkStack(n-1, cand); (* flush register windows by means of recursive calls *) IF n > 100 THEN RETURN END (* prevent tail recursion optimization *) - END ; + END; IF n = 0 THEN nofcand := 0; sp := S.ADR(frame); stack0 := ModulesMainStackFrame(); (* check for minimum alignment of pointers *) inc := S.ADR(align.p) - S.ADR(align); - IF sp - stack0 > 0 THEN inc := -inc END ; + IF uLT(stack0, sp) THEN inc := -inc END; WHILE sp # stack0 DO S.GET(sp, p); - IF (p > 0) & (p >= heapPosMin) & (p < heapPosMax) - OR (p < 0) & (p >= heapNegMin) & (p < heapNegMax) THEN - IF nofcand = LEN(cand) THEN HeapSort(nofcand, cand); MarkCandidates(nofcand, cand); nofcand := 0 END ; + IF uLE(heapMin, p) & uLT(p, heapMax) THEN + IF nofcand = LEN(cand) THEN HeapSort(nofcand, cand); MarkCandidates(nofcand, cand); nofcand := 0 END; cand[nofcand] := p; INC(nofcand) - END ; + END; INC(sp, inc) - END ; + END; IF nofcand > 0 THEN HeapSort(nofcand, cand); MarkCandidates(nofcand, cand) END END END MarkStack; @@ -555,9 +549,9 @@ MODULE Heap; Lock(); m := S.VAL(Module, modules); WHILE m # NIL DO - IF m.enumPtrs # NIL THEN m.enumPtrs(MarkP) END ; + IF m.enumPtrs # NIL THEN m.enumPtrs(MarkP) END; m := m^.next - END ; + END; IF markStack THEN (* generate register pressure to force callee saved registers to memory; may be simplified by inlining OS calls or processor specific instructions @@ -569,10 +563,10 @@ MODULE Heap; INC(i8, 9); INC(i9, 10); INC(i10, 11); INC(i11, 12); INC(i12, 13); INC(i13, 14); INC(i14, 15); INC(i15, 16); INC(i16, 17); INC(i17, 18); INC(i18, 19); INC(i19, 20); INC(i20, 21); INC(i21, 22); INC(i22, 23); INC(i23, 24); IF (i0 = -99) & (i15 = 24) THEN MarkStack(32, cand); EXIT END - END ; + END; IF i0 + i1 + i2 + i3 + i4 + i5 + i6 + i7 + i8 + i9 + i10 + i11 + i12 + i13 + i14 + i15 + i16 + i17 + i18 + i19 + i20 + i21 + i22 + i23 > 10000 THEN RETURN (* use all variables *) - END ; + END; END; CheckFin; Scan; @@ -600,20 +594,18 @@ MODULE Heap; heapsize := 0; allocated := 0; lockdepth := 0; - heapPosMin := MAX(S.ADDRESS); - heapPosMax := 0; - heapNegMin := 0; - heapNegMax := MIN(S.ADDRESS); + heapMin := -1; (* all bits set *) + heapMax := 0; + bigBlocks := 0; heap := NewChunk(heapSize0); S.PUT(heap + nextChnkOff, AddressZero); firstTry := TRUE; - freeList[nofLists] := 1; + freeList[nofLists] := 1; (* Sentinel, # 0 *) FileCount := 0; modules := NIL; - bigBlocks := 0; fin := NIL; interrupted := FALSE; From 8220c4e8078b23a6df375354a332fd1a52071990 Mon Sep 17 00:00:00 2001 From: David Brown Date: Mon, 19 Dec 2016 16:11:32 +0000 Subject: [PATCH 442/580] Fix heap for -OC build on 32 bit systems. --- src/runtime/Heap.Mod | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/runtime/Heap.Mod b/src/runtime/Heap.Mod index 33d16f7b..c5a5a977 100644 --- a/src/runtime/Heap.Mod +++ b/src/runtime/Heap.Mod @@ -428,8 +428,8 @@ MODULE Heap; END END Scan; - PROCEDURE Sift (l, r: S.ADDRESS; VAR a: ARRAY OF S.ADDRESS); - VAR i, j, x: S.ADDRESS; + PROCEDURE Sift (l, r: LONGINT; VAR a: ARRAY OF S.ADDRESS); + VAR i, j: LONGINT; x: S.ADDRESS; BEGIN j := l; x := a[j]; LOOP i := j; j := 2*j + 1; IF (j < r) & uLT(a[j], a[j+1]) THEN INC(j) END; @@ -439,8 +439,8 @@ MODULE Heap; a[i] := x END Sift; - PROCEDURE HeapSort (n: S.ADDRESS; VAR a: ARRAY OF S.ADDRESS); - VAR l, r, x: S.ADDRESS; + PROCEDURE HeapSort (n: LONGINT; VAR a: ARRAY OF S.ADDRESS); + VAR l, r: LONGINT; x: S.ADDRESS; BEGIN l := n DIV 2; r := n - 1; WHILE l > 0 DO DEC(l); Sift(l, r, a) END; WHILE r > 0 DO x := a[0]; a[0] := a[r]; a[r] := x; DEC(r); Sift(l, r, a) END From c6388006b987d57b19114986712b115700bd55fe Mon Sep 17 00:00:00 2001 From: David Brown Date: Mon, 19 Dec 2016 16:12:09 +0000 Subject: [PATCH 443/580] Update bootstrap C source. --- bootstrap/unix-44/Compiler.c | 2 +- bootstrap/unix-44/Configuration.c | 4 +- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Files.c | 2 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 117 ++++++++++++------------ bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 2 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 2 +- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 2 +- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 2 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Out.c | 2 +- bootstrap/unix-44/Out.h | 2 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/VT100.c | 2 +- bootstrap/unix-44/VT100.h | 2 +- bootstrap/unix-44/extTools.c | 6 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-48/Compiler.c | 2 +- bootstrap/unix-48/Configuration.c | 4 +- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Files.c | 2 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 117 ++++++++++++------------ bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 2 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 2 +- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 2 +- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 2 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Out.c | 2 +- bootstrap/unix-48/Out.h | 2 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/VT100.c | 2 +- bootstrap/unix-48/VT100.h | 2 +- bootstrap/unix-48/extTools.c | 6 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-88/Compiler.c | 2 +- bootstrap/unix-88/Configuration.c | 4 +- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Files.c | 2 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 131 +++++++++++++-------------- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 2 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 2 +- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 2 +- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 2 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Out.c | 2 +- bootstrap/unix-88/Out.h | 2 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/VT100.c | 2 +- bootstrap/unix-88/VT100.h | 2 +- bootstrap/unix-88/extTools.c | 6 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/windows-48/Compiler.c | 2 +- bootstrap/windows-48/Configuration.c | 4 +- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Files.c | 2 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 117 ++++++++++++------------ bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 2 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 2 +- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 2 +- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 2 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Out.c | 2 +- bootstrap/windows-48/Out.h | 2 +- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/VT100.c | 2 +- bootstrap/windows-48/VT100.h | 2 +- bootstrap/windows-48/extTools.c | 6 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-88/Compiler.c | 2 +- bootstrap/windows-88/Configuration.c | 4 +- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Files.c | 2 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 131 +++++++++++++-------------- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 2 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 2 +- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 2 +- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 2 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Out.c | 2 +- bootstrap/windows-88/Out.h | 2 +- bootstrap/windows-88/Platform.c | 2 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/VT100.c | 2 +- bootstrap/windows-88/VT100.h | 2 +- bootstrap/windows-88/extTools.c | 6 +- bootstrap/windows-88/extTools.h | 2 +- 185 files changed, 499 insertions(+), 504 deletions(-) diff --git a/bootstrap/unix-44/Compiler.c b/bootstrap/unix-44/Compiler.c index c828f47d..d13ed803 100644 --- a/bootstrap/unix-44/Compiler.c +++ b/bootstrap/unix-44/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspamS */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index 5fa885ca..eb305bbe 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index af5f5580..d10b5011 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 9d302c54..94faa2a1 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index dd99850c..d0b6716f 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index a5b7cd03..d6b6560d 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. tsSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -69,7 +69,7 @@ static INT32 Heap_bigBlocks; export INT32 Heap_allocated; static BOOLEAN Heap_firstTry; export INT32 Heap_heap; -static INT32 Heap_heapNegMin, Heap_heapNegMax, Heap_heapPosMin, Heap_heapPosMax; +static INT32 Heap_heapMin, Heap_heapMax; export INT32 Heap_heapsize; static Heap_FinNode Heap_fin; static INT16 Heap_lockdepth; @@ -113,6 +113,8 @@ extern ADDRESS Platform_OSAllocate(ADDRESS size); #define Heap_ModulesHalt(code) Modules_Halt(code) #define Heap_ModulesMainStackFrame() Modules_MainStackFrame #define Heap_OSAllocate(size) Platform_OSAllocate(size) +#define Heap_uLE(x, y) ((size_t)x <= (size_t)y) +#define Heap_uLT(x, y) ((size_t)x < (size_t)y) void Heap_Lock (void) { @@ -213,20 +215,11 @@ static INT32 Heap_NewChunk (INT32 blksz) __PUT(blk + 12, Heap_bigBlocks, INT32); Heap_bigBlocks = blk; Heap_heapsize += blksz; - if (chnk > 0) { - if (chnk < Heap_heapPosMin) { - Heap_heapPosMin = blk + 4; - } - if (end > Heap_heapPosMax) { - Heap_heapPosMax = end; - } - } else { - if (chnk < Heap_heapNegMin) { - Heap_heapNegMin = blk + 4; - } - if (end > Heap_heapNegMax) { - Heap_heapNegMax = end; - } + if (Heap_uLT(blk + 4, Heap_heapMin)) { + Heap_heapMin = blk + 4; + } + if (Heap_uLT(Heap_heapMax, end)) { + Heap_heapMax = end; } } return chnk; @@ -235,20 +228,20 @@ static INT32 Heap_NewChunk (INT32 blksz) static void Heap_ExtendHeap (INT32 blksz) { INT32 size, chnk, j, next; - if (blksz > 160000) { + if (Heap_uLT(160000, blksz)) { size = blksz; } else { size = 160000; } chnk = Heap_NewChunk(size); if (chnk != 0) { - if (chnk < Heap_heap) { + if (Heap_uLT(chnk, Heap_heap)) { __PUT(chnk, Heap_heap, INT32); Heap_heap = chnk; } else { j = Heap_heap; __GET(j, next, INT32); - while ((next != 0 && chnk - next > 0)) { + while ((next != 0 && Heap_uLT(next, chnk))) { j = next; __GET(j, next, INT32); } @@ -266,14 +259,14 @@ SYSTEM_PTR Heap_NEWREC (INT32 tag) __GET(tag, blksz, INT32); i0 = __ASHR(blksz, 4); i = i0; - if (i < 9) { + if (Heap_uLT(i, 9)) { adr = Heap_freeList[i]; while (adr == 0) { i += 1; adr = Heap_freeList[i]; } } - if (i < 9) { + if (Heap_uLT(i, 9)) { __GET(adr + 12, next, INT32); Heap_freeList[i] = next; if (i != i0) { @@ -296,7 +289,7 @@ SYSTEM_PTR Heap_NEWREC (INT32 tag) if (Heap_firstTry) { Heap_GC(1); blksz += 16; - if (__ASHL((Heap_heapsize - Heap_allocated) - blksz, 2) < Heap_heapsize) { + if (Heap_uLT(Heap_heapsize - Heap_allocated, blksz) || Heap_uLT(__ASHL((Heap_heapsize - Heap_allocated) - blksz, 2), Heap_heapsize)) { Heap_ExtendHeap(__ASHL(__DIV(Heap_allocated + blksz, 48), 6) - Heap_heapsize); } Heap_firstTry = 0; @@ -314,7 +307,7 @@ SYSTEM_PTR Heap_NEWREC (INT32 tag) } } __GET(adr + 4, t, INT32); - if (t >= blksz) { + if (Heap_uLE(blksz, t)) { break; } prev = adr; @@ -325,7 +318,7 @@ SYSTEM_PTR Heap_NEWREC (INT32 tag) __PUT(end + 4, blksz, INT32); __PUT(end + 8, -4, INT32); __PUT(end, end + 4, INT32); - if (restsize > 144) { + if (Heap_uLT(144, restsize)) { __PUT(adr + 4, restsize, INT32); } else { __GET(adr + 12, next, INT32); @@ -334,7 +327,7 @@ SYSTEM_PTR Heap_NEWREC (INT32 tag) } else { __PUT(prev + 12, next, INT32); } - if (restsize > 0) { + if (restsize != 0) { di = __ASHR(restsize, 4); __PUT(adr + 4, restsize, INT32); __PUT(adr + 12, Heap_freeList[di], INT32); @@ -345,7 +338,7 @@ SYSTEM_PTR Heap_NEWREC (INT32 tag) } i = adr + 16; end = adr + blksz; - while (end - i > 0) { + while (Heap_uLT(i, end)) { __PUT(i, 0, INT32); __PUT(i + 4, 0, INT32); __PUT(i + 8, 0, INT32); @@ -442,17 +435,17 @@ static void Heap_Scan (void) while (chnk != 0) { adr = chnk + 12; __GET(chnk + 4, end, INT32); - while (end - adr > 0) { + while (Heap_uLT(adr, end)) { __GET(adr, tag, INT32); if (__ODD(tag)) { - if (freesize > 0) { + if (freesize != 0) { start = adr - freesize; __PUT(start, start + 4, INT32); __PUT(start + 4, freesize, INT32); __PUT(start + 8, -4, INT32); i = __ASHR(freesize, 4); freesize = 0; - if (i < 9) { + if (Heap_uLT(i, 9)) { __PUT(start + 12, Heap_freeList[i], INT32); Heap_freeList[i] = start; } else { @@ -471,14 +464,14 @@ static void Heap_Scan (void) adr += size; } } - if (freesize > 0) { + if (freesize != 0) { start = adr - freesize; __PUT(start, start + 4, INT32); __PUT(start + 4, freesize, INT32); __PUT(start + 8, -4, INT32); i = __ASHR(freesize, 4); freesize = 0; - if (i < 9) { + if (Heap_uLT(i, 9)) { __PUT(start + 12, Heap_freeList[i], INT32); Heap_freeList[i] = start; } else { @@ -492,16 +485,17 @@ static void Heap_Scan (void) static void Heap_Sift (INT32 l, INT32 r, INT32 *a, ADDRESS a__len) { - INT32 i, j, x; + INT32 i, j; + INT32 x; j = l; x = a[j]; for (;;) { i = j; j = __ASHL(j, 1) + 1; - if ((j < r && a[j] < a[j + 1])) { + if ((j < r && Heap_uLT(a[j], a[j + 1]))) { j += 1; } - if (j > r || a[j] <= x) { + if (j > r || Heap_uLE(a[j], x)) { break; } a[i] = a[j]; @@ -511,7 +505,8 @@ static void Heap_Sift (INT32 l, INT32 r, INT32 *a, ADDRESS a__len) static void Heap_HeapSort (INT32 n, INT32 *a, ADDRESS a__len) { - INT32 l, r, x; + INT32 l, r; + INT32 x; l = __ASHR(n, 1); r = n - 1; while (l > 0) { @@ -529,35 +524,40 @@ static void Heap_HeapSort (INT32 n, INT32 *a, ADDRESS a__len) static void Heap_MarkCandidates (INT32 n, INT32 *cand, ADDRESS cand__len) { - INT32 chnk, adr, tag, next, lim, lim1, i, ptr, size; - chnk = Heap_heap; + INT32 chnk, end, adr, tag, next, i, ptr, size; + chnk = Heap_heap; i = 0; - lim = cand[n - 1]; - while ((chnk != 0 && lim - chnk > 0)) { + while (chnk != 0) { + __GET(chnk + 4, end, INT32); adr = chnk + 12; - __GET(chnk + 4, lim1, INT32); - if (lim1 - lim > 0) { - lim1 = lim; - } - while (lim1 - adr > 0) { + while (Heap_uLT(adr, end)) { __GET(adr, tag, INT32); if (__ODD(tag)) { __GET(tag - 1, size, INT32); adr += size; + ptr = adr + 4; + while (Heap_uLT(cand[i], ptr)) { + i += 1; + if (i == n) { + return; + } + } } else { __GET(tag, size, INT32); ptr = adr + 4; - while (ptr - cand[i] > 0) { + adr += size; + while (Heap_uLT(cand[i], ptr)) { i += 1; + if (i == n) { + return; + } } - if (i == n) { - return; - } - next = adr + size; - if (next - cand[i] > 0) { + if (Heap_uLT(cand[i], adr)) { Heap_Mark(ptr); } - adr = next; + } + if (Heap_uLE(end, cand[i])) { + adr = end; } } __GET(chnk, chnk, INT32); @@ -619,7 +619,8 @@ void Heap_FINALL (void) static void Heap_MarkStack (INT32 n, INT32 *cand, ADDRESS cand__len) { SYSTEM_PTR frame; - INT32 inc, nofcand, sp, p, stack0; + INT32 nofcand; + INT32 inc, sp, p, stack0; struct Heap__1 align; if (n > 0) { Heap_MarkStack(n - 1, cand, cand__len); @@ -632,12 +633,12 @@ static void Heap_MarkStack (INT32 n, INT32 *cand, ADDRESS cand__len) sp = (ADDRESS)&frame; stack0 = Heap_ModulesMainStackFrame(); inc = (ADDRESS)&align.p - (ADDRESS)&align; - if (sp - stack0 > 0) { + if (Heap_uLT(stack0, sp)) { inc = -inc; } while (sp != stack0) { __GET(sp, p, INT32); - if ((((p > 0 && p >= Heap_heapPosMin)) && p < Heap_heapPosMax) || (((p < 0 && p >= Heap_heapNegMin)) && p < Heap_heapNegMax)) { + if ((Heap_uLE(Heap_heapMin, p) && Heap_uLT(p, Heap_heapMax))) { if (nofcand == cand__len) { Heap_HeapSort(nofcand, (void*)cand, cand__len); Heap_MarkCandidates(nofcand, (void*)cand, cand__len); @@ -752,17 +753,15 @@ void Heap_InitHeap (void) Heap_heapsize = 0; Heap_allocated = 0; Heap_lockdepth = 0; - Heap_heapPosMin = 2147483647; - Heap_heapPosMax = 0; - Heap_heapNegMin = 0; - Heap_heapNegMax = (-2147483647-1); + Heap_heapMin = -1; + Heap_heapMax = 0; + Heap_bigBlocks = 0; Heap_heap = Heap_NewChunk(128000); __PUT(Heap_heap, 0, INT32); Heap_firstTry = 1; Heap_freeList[9] = 1; Heap_FileCount = 0; Heap_modules = NIL; - Heap_bigBlocks = 0; Heap_fin = NIL; Heap_interrupted = 0; Heap_HeapModuleInit(); diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index 8a81aea1..87732bb9 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. tsSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index 881bee5a..c498f106 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index 9e1502d5..f52b30af 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index c8ffb553..bb4ea138 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index 587f5ca2..6757803a 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 556ff058..093bb886 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index 377385f1..a32c29e0 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 5ec11c6f..0fd45dec 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index d52e3f0f..f246eacb 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index 3199e877..c3e79413 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index c168cbe7..913d2eef 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index b554bf21..abfcd4b8 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index 6e983459..9e15ba4e 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index fb5288f9..7bfd4abc 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index bc21d626..228191bf 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index adffc7a4..e44854e3 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index 5d34109a..ea04b5b8 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Out.c b/bootstrap/unix-44/Out.c index 5f70ffca..fc487d97 100644 --- a/bootstrap/unix-44/Out.c +++ b/bootstrap/unix-44/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Out.h b/bootstrap/unix-44/Out.h index 4f49bfa7..cbb4de1a 100644 --- a/bootstrap/unix-44/Out.h +++ b/bootstrap/unix-44/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 5900abf5..b646e8b7 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index c628a89b..957af90d 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 2b39fcf1..9b449f98 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index 016451be..3e83af42 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index b7456c5c..f9b5310a 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index be22ef18..58f9b546 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index c6e6c87a..bb00d7d0 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index f3849ea7..cab12269 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/VT100.c b/bootstrap/unix-44/VT100.c index 9b5da2b4..80457921 100644 --- a/bootstrap/unix-44/VT100.c +++ b/bootstrap/unix-44/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/VT100.h b/bootstrap/unix-44/VT100.h index 2c94eb2a..1a589c43 100644 --- a/bootstrap/unix-44/VT100.h +++ b/bootstrap/unix-44/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index fd65edea..46b1acc2 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -65,7 +65,7 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) { - __COPY("i686-w64-mingw32-gcc -g", s, s__len); + __COPY("gcc -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); @@ -95,7 +95,7 @@ void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN stati Strings_Append((CHAR*)".c ", 4, (void*)cmd, 1023); Strings_Append(additionalopts, additionalopts__len, (void*)cmd, 1023); if (statically) { - Strings_Append((CHAR*)"", 1, (void*)cmd, 1023); + Strings_Append((CHAR*)" -static", 9, (void*)cmd, 1023); } Strings_Append((CHAR*)" -o ", 5, (void*)cmd, 1023); Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index 7d8a92d3..4201df04 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/Compiler.c b/bootstrap/unix-48/Compiler.c index c828f47d..d13ed803 100644 --- a/bootstrap/unix-48/Compiler.c +++ b/bootstrap/unix-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspamS */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index 5fa885ca..eb305bbe 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index af5f5580..d10b5011 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 9d302c54..94faa2a1 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index dd99850c..d0b6716f 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index a5b7cd03..d6b6560d 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. tsSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -69,7 +69,7 @@ static INT32 Heap_bigBlocks; export INT32 Heap_allocated; static BOOLEAN Heap_firstTry; export INT32 Heap_heap; -static INT32 Heap_heapNegMin, Heap_heapNegMax, Heap_heapPosMin, Heap_heapPosMax; +static INT32 Heap_heapMin, Heap_heapMax; export INT32 Heap_heapsize; static Heap_FinNode Heap_fin; static INT16 Heap_lockdepth; @@ -113,6 +113,8 @@ extern ADDRESS Platform_OSAllocate(ADDRESS size); #define Heap_ModulesHalt(code) Modules_Halt(code) #define Heap_ModulesMainStackFrame() Modules_MainStackFrame #define Heap_OSAllocate(size) Platform_OSAllocate(size) +#define Heap_uLE(x, y) ((size_t)x <= (size_t)y) +#define Heap_uLT(x, y) ((size_t)x < (size_t)y) void Heap_Lock (void) { @@ -213,20 +215,11 @@ static INT32 Heap_NewChunk (INT32 blksz) __PUT(blk + 12, Heap_bigBlocks, INT32); Heap_bigBlocks = blk; Heap_heapsize += blksz; - if (chnk > 0) { - if (chnk < Heap_heapPosMin) { - Heap_heapPosMin = blk + 4; - } - if (end > Heap_heapPosMax) { - Heap_heapPosMax = end; - } - } else { - if (chnk < Heap_heapNegMin) { - Heap_heapNegMin = blk + 4; - } - if (end > Heap_heapNegMax) { - Heap_heapNegMax = end; - } + if (Heap_uLT(blk + 4, Heap_heapMin)) { + Heap_heapMin = blk + 4; + } + if (Heap_uLT(Heap_heapMax, end)) { + Heap_heapMax = end; } } return chnk; @@ -235,20 +228,20 @@ static INT32 Heap_NewChunk (INT32 blksz) static void Heap_ExtendHeap (INT32 blksz) { INT32 size, chnk, j, next; - if (blksz > 160000) { + if (Heap_uLT(160000, blksz)) { size = blksz; } else { size = 160000; } chnk = Heap_NewChunk(size); if (chnk != 0) { - if (chnk < Heap_heap) { + if (Heap_uLT(chnk, Heap_heap)) { __PUT(chnk, Heap_heap, INT32); Heap_heap = chnk; } else { j = Heap_heap; __GET(j, next, INT32); - while ((next != 0 && chnk - next > 0)) { + while ((next != 0 && Heap_uLT(next, chnk))) { j = next; __GET(j, next, INT32); } @@ -266,14 +259,14 @@ SYSTEM_PTR Heap_NEWREC (INT32 tag) __GET(tag, blksz, INT32); i0 = __ASHR(blksz, 4); i = i0; - if (i < 9) { + if (Heap_uLT(i, 9)) { adr = Heap_freeList[i]; while (adr == 0) { i += 1; adr = Heap_freeList[i]; } } - if (i < 9) { + if (Heap_uLT(i, 9)) { __GET(adr + 12, next, INT32); Heap_freeList[i] = next; if (i != i0) { @@ -296,7 +289,7 @@ SYSTEM_PTR Heap_NEWREC (INT32 tag) if (Heap_firstTry) { Heap_GC(1); blksz += 16; - if (__ASHL((Heap_heapsize - Heap_allocated) - blksz, 2) < Heap_heapsize) { + if (Heap_uLT(Heap_heapsize - Heap_allocated, blksz) || Heap_uLT(__ASHL((Heap_heapsize - Heap_allocated) - blksz, 2), Heap_heapsize)) { Heap_ExtendHeap(__ASHL(__DIV(Heap_allocated + blksz, 48), 6) - Heap_heapsize); } Heap_firstTry = 0; @@ -314,7 +307,7 @@ SYSTEM_PTR Heap_NEWREC (INT32 tag) } } __GET(adr + 4, t, INT32); - if (t >= blksz) { + if (Heap_uLE(blksz, t)) { break; } prev = adr; @@ -325,7 +318,7 @@ SYSTEM_PTR Heap_NEWREC (INT32 tag) __PUT(end + 4, blksz, INT32); __PUT(end + 8, -4, INT32); __PUT(end, end + 4, INT32); - if (restsize > 144) { + if (Heap_uLT(144, restsize)) { __PUT(adr + 4, restsize, INT32); } else { __GET(adr + 12, next, INT32); @@ -334,7 +327,7 @@ SYSTEM_PTR Heap_NEWREC (INT32 tag) } else { __PUT(prev + 12, next, INT32); } - if (restsize > 0) { + if (restsize != 0) { di = __ASHR(restsize, 4); __PUT(adr + 4, restsize, INT32); __PUT(adr + 12, Heap_freeList[di], INT32); @@ -345,7 +338,7 @@ SYSTEM_PTR Heap_NEWREC (INT32 tag) } i = adr + 16; end = adr + blksz; - while (end - i > 0) { + while (Heap_uLT(i, end)) { __PUT(i, 0, INT32); __PUT(i + 4, 0, INT32); __PUT(i + 8, 0, INT32); @@ -442,17 +435,17 @@ static void Heap_Scan (void) while (chnk != 0) { adr = chnk + 12; __GET(chnk + 4, end, INT32); - while (end - adr > 0) { + while (Heap_uLT(adr, end)) { __GET(adr, tag, INT32); if (__ODD(tag)) { - if (freesize > 0) { + if (freesize != 0) { start = adr - freesize; __PUT(start, start + 4, INT32); __PUT(start + 4, freesize, INT32); __PUT(start + 8, -4, INT32); i = __ASHR(freesize, 4); freesize = 0; - if (i < 9) { + if (Heap_uLT(i, 9)) { __PUT(start + 12, Heap_freeList[i], INT32); Heap_freeList[i] = start; } else { @@ -471,14 +464,14 @@ static void Heap_Scan (void) adr += size; } } - if (freesize > 0) { + if (freesize != 0) { start = adr - freesize; __PUT(start, start + 4, INT32); __PUT(start + 4, freesize, INT32); __PUT(start + 8, -4, INT32); i = __ASHR(freesize, 4); freesize = 0; - if (i < 9) { + if (Heap_uLT(i, 9)) { __PUT(start + 12, Heap_freeList[i], INT32); Heap_freeList[i] = start; } else { @@ -492,16 +485,17 @@ static void Heap_Scan (void) static void Heap_Sift (INT32 l, INT32 r, INT32 *a, ADDRESS a__len) { - INT32 i, j, x; + INT32 i, j; + INT32 x; j = l; x = a[j]; for (;;) { i = j; j = __ASHL(j, 1) + 1; - if ((j < r && a[j] < a[j + 1])) { + if ((j < r && Heap_uLT(a[j], a[j + 1]))) { j += 1; } - if (j > r || a[j] <= x) { + if (j > r || Heap_uLE(a[j], x)) { break; } a[i] = a[j]; @@ -511,7 +505,8 @@ static void Heap_Sift (INT32 l, INT32 r, INT32 *a, ADDRESS a__len) static void Heap_HeapSort (INT32 n, INT32 *a, ADDRESS a__len) { - INT32 l, r, x; + INT32 l, r; + INT32 x; l = __ASHR(n, 1); r = n - 1; while (l > 0) { @@ -529,35 +524,40 @@ static void Heap_HeapSort (INT32 n, INT32 *a, ADDRESS a__len) static void Heap_MarkCandidates (INT32 n, INT32 *cand, ADDRESS cand__len) { - INT32 chnk, adr, tag, next, lim, lim1, i, ptr, size; - chnk = Heap_heap; + INT32 chnk, end, adr, tag, next, i, ptr, size; + chnk = Heap_heap; i = 0; - lim = cand[n - 1]; - while ((chnk != 0 && lim - chnk > 0)) { + while (chnk != 0) { + __GET(chnk + 4, end, INT32); adr = chnk + 12; - __GET(chnk + 4, lim1, INT32); - if (lim1 - lim > 0) { - lim1 = lim; - } - while (lim1 - adr > 0) { + while (Heap_uLT(adr, end)) { __GET(adr, tag, INT32); if (__ODD(tag)) { __GET(tag - 1, size, INT32); adr += size; + ptr = adr + 4; + while (Heap_uLT(cand[i], ptr)) { + i += 1; + if (i == n) { + return; + } + } } else { __GET(tag, size, INT32); ptr = adr + 4; - while (ptr - cand[i] > 0) { + adr += size; + while (Heap_uLT(cand[i], ptr)) { i += 1; + if (i == n) { + return; + } } - if (i == n) { - return; - } - next = adr + size; - if (next - cand[i] > 0) { + if (Heap_uLT(cand[i], adr)) { Heap_Mark(ptr); } - adr = next; + } + if (Heap_uLE(end, cand[i])) { + adr = end; } } __GET(chnk, chnk, INT32); @@ -619,7 +619,8 @@ void Heap_FINALL (void) static void Heap_MarkStack (INT32 n, INT32 *cand, ADDRESS cand__len) { SYSTEM_PTR frame; - INT32 inc, nofcand, sp, p, stack0; + INT32 nofcand; + INT32 inc, sp, p, stack0; struct Heap__1 align; if (n > 0) { Heap_MarkStack(n - 1, cand, cand__len); @@ -632,12 +633,12 @@ static void Heap_MarkStack (INT32 n, INT32 *cand, ADDRESS cand__len) sp = (ADDRESS)&frame; stack0 = Heap_ModulesMainStackFrame(); inc = (ADDRESS)&align.p - (ADDRESS)&align; - if (sp - stack0 > 0) { + if (Heap_uLT(stack0, sp)) { inc = -inc; } while (sp != stack0) { __GET(sp, p, INT32); - if ((((p > 0 && p >= Heap_heapPosMin)) && p < Heap_heapPosMax) || (((p < 0 && p >= Heap_heapNegMin)) && p < Heap_heapNegMax)) { + if ((Heap_uLE(Heap_heapMin, p) && Heap_uLT(p, Heap_heapMax))) { if (nofcand == cand__len) { Heap_HeapSort(nofcand, (void*)cand, cand__len); Heap_MarkCandidates(nofcand, (void*)cand, cand__len); @@ -752,17 +753,15 @@ void Heap_InitHeap (void) Heap_heapsize = 0; Heap_allocated = 0; Heap_lockdepth = 0; - Heap_heapPosMin = 2147483647; - Heap_heapPosMax = 0; - Heap_heapNegMin = 0; - Heap_heapNegMax = (-2147483647-1); + Heap_heapMin = -1; + Heap_heapMax = 0; + Heap_bigBlocks = 0; Heap_heap = Heap_NewChunk(128000); __PUT(Heap_heap, 0, INT32); Heap_firstTry = 1; Heap_freeList[9] = 1; Heap_FileCount = 0; Heap_modules = NIL; - Heap_bigBlocks = 0; Heap_fin = NIL; Heap_interrupted = 0; Heap_HeapModuleInit(); diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index 8a81aea1..87732bb9 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. tsSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index 881bee5a..c498f106 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index 9e1502d5..f52b30af 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index c8ffb553..bb4ea138 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index 587f5ca2..6757803a 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 556ff058..093bb886 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index 377385f1..a32c29e0 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 5ec11c6f..0fd45dec 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index d52e3f0f..f246eacb 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index 3199e877..c3e79413 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index c168cbe7..913d2eef 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index b554bf21..abfcd4b8 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index 6e983459..9e15ba4e 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 13794d5f..fc598571 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index bc21d626..228191bf 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index adffc7a4..e44854e3 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index 5d34109a..ea04b5b8 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Out.c b/bootstrap/unix-48/Out.c index 5f70ffca..fc487d97 100644 --- a/bootstrap/unix-48/Out.c +++ b/bootstrap/unix-48/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Out.h b/bootstrap/unix-48/Out.h index 4f49bfa7..cbb4de1a 100644 --- a/bootstrap/unix-48/Out.h +++ b/bootstrap/unix-48/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 5900abf5..b646e8b7 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index c628a89b..957af90d 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 2b39fcf1..9b449f98 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index 016451be..3e83af42 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index b7456c5c..f9b5310a 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index be22ef18..58f9b546 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index 2182dda5..96851302 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index fad4ca32..188b60fb 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/VT100.c b/bootstrap/unix-48/VT100.c index 9b5da2b4..80457921 100644 --- a/bootstrap/unix-48/VT100.c +++ b/bootstrap/unix-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/VT100.h b/bootstrap/unix-48/VT100.h index 2c94eb2a..1a589c43 100644 --- a/bootstrap/unix-48/VT100.h +++ b/bootstrap/unix-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index fd65edea..46b1acc2 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -65,7 +65,7 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) { - __COPY("i686-w64-mingw32-gcc -g", s, s__len); + __COPY("gcc -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); @@ -95,7 +95,7 @@ void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN stati Strings_Append((CHAR*)".c ", 4, (void*)cmd, 1023); Strings_Append(additionalopts, additionalopts__len, (void*)cmd, 1023); if (statically) { - Strings_Append((CHAR*)"", 1, (void*)cmd, 1023); + Strings_Append((CHAR*)" -static", 9, (void*)cmd, 1023); } Strings_Append((CHAR*)" -o ", 5, (void*)cmd, 1023); Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index 7d8a92d3..4201df04 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/Compiler.c b/bootstrap/unix-88/Compiler.c index c828f47d..d13ed803 100644 --- a/bootstrap/unix-88/Compiler.c +++ b/bootstrap/unix-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspamS */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index 5fa885ca..eb305bbe 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index af5f5580..d10b5011 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 915b50ff..10fc58d0 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 90be7986..5b4a0859 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index c618f3ef..9f808e0f 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. tsSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -69,7 +69,7 @@ static INT64 Heap_bigBlocks; export INT64 Heap_allocated; static BOOLEAN Heap_firstTry; export INT64 Heap_heap; -static INT64 Heap_heapNegMin, Heap_heapNegMax, Heap_heapPosMin, Heap_heapPosMax; +static INT64 Heap_heapMin, Heap_heapMax; export INT64 Heap_heapsize; static Heap_FinNode Heap_fin; static INT16 Heap_lockdepth; @@ -87,12 +87,12 @@ export void Heap_FINALL (void); static void Heap_Finalize (void); export INT32 Heap_FreeModule (CHAR *name, ADDRESS name__len); export void Heap_GC (BOOLEAN markStack); -static void Heap_HeapSort (INT64 n, INT64 *a, ADDRESS a__len); +static void Heap_HeapSort (INT32 n, INT64 *a, ADDRESS a__len); export void Heap_INCREF (Heap_Module m); export void Heap_InitHeap (void); export void Heap_Lock (void); static void Heap_Mark (INT64 q); -static void Heap_MarkCandidates (INT64 n, INT64 *cand, ADDRESS cand__len); +static void Heap_MarkCandidates (INT32 n, INT64 *cand, ADDRESS cand__len); static void Heap_MarkP (SYSTEM_PTR p); static void Heap_MarkStack (INT64 n, INT64 *cand, ADDRESS cand__len); export SYSTEM_PTR Heap_NEWBLK (INT64 size); @@ -103,7 +103,7 @@ export SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); export void Heap_REGTYP (Heap_Module m, INT64 typ); export void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); static void Heap_Scan (void); -static void Heap_Sift (INT64 l, INT64 r, INT64 *a, ADDRESS a__len); +static void Heap_Sift (INT32 l, INT32 r, INT64 *a, ADDRESS a__len); export void Heap_Unlock (void); extern void *Heap__init(); @@ -113,6 +113,8 @@ extern ADDRESS Platform_OSAllocate(ADDRESS size); #define Heap_ModulesHalt(code) Modules_Halt(code) #define Heap_ModulesMainStackFrame() Modules_MainStackFrame #define Heap_OSAllocate(size) Platform_OSAllocate(size) +#define Heap_uLE(x, y) ((size_t)x <= (size_t)y) +#define Heap_uLT(x, y) ((size_t)x < (size_t)y) void Heap_Lock (void) { @@ -213,20 +215,11 @@ static INT64 Heap_NewChunk (INT64 blksz) __PUT(blk + 24, Heap_bigBlocks, INT64); Heap_bigBlocks = blk; Heap_heapsize += blksz; - if (chnk > 0) { - if (chnk < Heap_heapPosMin) { - Heap_heapPosMin = blk + 8; - } - if (end > Heap_heapPosMax) { - Heap_heapPosMax = end; - } - } else { - if (chnk < Heap_heapNegMin) { - Heap_heapNegMin = blk + 8; - } - if (end > Heap_heapNegMax) { - Heap_heapNegMax = end; - } + if (Heap_uLT(blk + 8, Heap_heapMin)) { + Heap_heapMin = blk + 8; + } + if (Heap_uLT(Heap_heapMax, end)) { + Heap_heapMax = end; } } return chnk; @@ -235,20 +228,20 @@ static INT64 Heap_NewChunk (INT64 blksz) static void Heap_ExtendHeap (INT64 blksz) { INT64 size, chnk, j, next; - if (blksz > 320000) { + if (Heap_uLT(320000, blksz)) { size = blksz; } else { size = 320000; } chnk = Heap_NewChunk(size); if (chnk != 0) { - if (chnk < Heap_heap) { + if (Heap_uLT(chnk, Heap_heap)) { __PUT(chnk, Heap_heap, INT64); Heap_heap = chnk; } else { j = Heap_heap; __GET(j, next, INT64); - while ((next != 0 && chnk - next > 0)) { + while ((next != 0 && Heap_uLT(next, chnk))) { j = next; __GET(j, next, INT64); } @@ -266,14 +259,14 @@ SYSTEM_PTR Heap_NEWREC (INT64 tag) __GET(tag, blksz, INT64); i0 = __ASHR(blksz, 5); i = i0; - if (i < 9) { + if (Heap_uLT(i, 9)) { adr = Heap_freeList[i]; while (adr == 0) { i += 1; adr = Heap_freeList[i]; } } - if (i < 9) { + if (Heap_uLT(i, 9)) { __GET(adr + 24, next, INT64); Heap_freeList[i] = next; if (i != i0) { @@ -296,7 +289,7 @@ SYSTEM_PTR Heap_NEWREC (INT64 tag) if (Heap_firstTry) { Heap_GC(1); blksz += 32; - if (__ASHL((Heap_heapsize - Heap_allocated) - blksz, 2) < Heap_heapsize) { + if (Heap_uLT(Heap_heapsize - Heap_allocated, blksz) || Heap_uLT(__ASHL((Heap_heapsize - Heap_allocated) - blksz, 2), Heap_heapsize)) { Heap_ExtendHeap(__ASHL(__DIV(Heap_allocated + blksz, 96), 7) - Heap_heapsize); } Heap_firstTry = 0; @@ -314,7 +307,7 @@ SYSTEM_PTR Heap_NEWREC (INT64 tag) } } __GET(adr + 8, t, INT64); - if (t >= blksz) { + if (Heap_uLE(blksz, t)) { break; } prev = adr; @@ -325,7 +318,7 @@ SYSTEM_PTR Heap_NEWREC (INT64 tag) __PUT(end + 8, blksz, INT64); __PUT(end + 16, -8, INT64); __PUT(end, end + 8, INT64); - if (restsize > 288) { + if (Heap_uLT(288, restsize)) { __PUT(adr + 8, restsize, INT64); } else { __GET(adr + 24, next, INT64); @@ -334,7 +327,7 @@ SYSTEM_PTR Heap_NEWREC (INT64 tag) } else { __PUT(prev + 24, next, INT64); } - if (restsize > 0) { + if (restsize != 0) { di = __ASHR(restsize, 5); __PUT(adr + 8, restsize, INT64); __PUT(adr + 24, Heap_freeList[di], INT64); @@ -345,7 +338,7 @@ SYSTEM_PTR Heap_NEWREC (INT64 tag) } i = adr + 32; end = adr + blksz; - while (end - i > 0) { + while (Heap_uLT(i, end)) { __PUT(i, 0, INT64); __PUT(i + 8, 0, INT64); __PUT(i + 16, 0, INT64); @@ -442,17 +435,17 @@ static void Heap_Scan (void) while (chnk != 0) { adr = chnk + 24; __GET(chnk + 8, end, INT64); - while (end - adr > 0) { + while (Heap_uLT(adr, end)) { __GET(adr, tag, INT64); if (__ODD(tag)) { - if (freesize > 0) { + if (freesize != 0) { start = adr - freesize; __PUT(start, start + 8, INT64); __PUT(start + 8, freesize, INT64); __PUT(start + 16, -8, INT64); i = __ASHR(freesize, 5); freesize = 0; - if (i < 9) { + if (Heap_uLT(i, 9)) { __PUT(start + 24, Heap_freeList[i], INT64); Heap_freeList[i] = start; } else { @@ -471,14 +464,14 @@ static void Heap_Scan (void) adr += size; } } - if (freesize > 0) { + if (freesize != 0) { start = adr - freesize; __PUT(start, start + 8, INT64); __PUT(start + 8, freesize, INT64); __PUT(start + 16, -8, INT64); i = __ASHR(freesize, 5); freesize = 0; - if (i < 9) { + if (Heap_uLT(i, 9)) { __PUT(start + 24, Heap_freeList[i], INT64); Heap_freeList[i] = start; } else { @@ -490,18 +483,19 @@ static void Heap_Scan (void) } } -static void Heap_Sift (INT64 l, INT64 r, INT64 *a, ADDRESS a__len) +static void Heap_Sift (INT32 l, INT32 r, INT64 *a, ADDRESS a__len) { - INT64 i, j, x; + INT32 i, j; + INT64 x; j = l; x = a[j]; for (;;) { i = j; j = __ASHL(j, 1) + 1; - if ((j < r && a[j] < a[j + 1])) { + if ((j < r && Heap_uLT(a[j], a[j + 1]))) { j += 1; } - if (j > r || a[j] <= x) { + if (j > r || Heap_uLE(a[j], x)) { break; } a[i] = a[j]; @@ -509,9 +503,10 @@ static void Heap_Sift (INT64 l, INT64 r, INT64 *a, ADDRESS a__len) a[i] = x; } -static void Heap_HeapSort (INT64 n, INT64 *a, ADDRESS a__len) +static void Heap_HeapSort (INT32 n, INT64 *a, ADDRESS a__len) { - INT64 l, r, x; + INT32 l, r; + INT64 x; l = __ASHR(n, 1); r = n - 1; while (l > 0) { @@ -527,37 +522,42 @@ static void Heap_HeapSort (INT64 n, INT64 *a, ADDRESS a__len) } } -static void Heap_MarkCandidates (INT64 n, INT64 *cand, ADDRESS cand__len) +static void Heap_MarkCandidates (INT32 n, INT64 *cand, ADDRESS cand__len) { - INT64 chnk, adr, tag, next, lim, lim1, i, ptr, size; - chnk = Heap_heap; + INT64 chnk, end, adr, tag, next, i, ptr, size; + chnk = Heap_heap; i = 0; - lim = cand[n - 1]; - while ((chnk != 0 && lim - chnk > 0)) { + while (chnk != 0) { + __GET(chnk + 8, end, INT64); adr = chnk + 24; - __GET(chnk + 8, lim1, INT64); - if (lim1 - lim > 0) { - lim1 = lim; - } - while (lim1 - adr > 0) { + while (Heap_uLT(adr, end)) { __GET(adr, tag, INT64); if (__ODD(tag)) { __GET(tag - 1, size, INT64); adr += size; + ptr = adr + 8; + while (Heap_uLT(cand[i], ptr)) { + i += 1; + if (i == (INT64)n) { + return; + } + } } else { __GET(tag, size, INT64); ptr = adr + 8; - while (ptr - cand[i] > 0) { + adr += size; + while (Heap_uLT(cand[i], ptr)) { i += 1; + if (i == (INT64)n) { + return; + } } - if (i == n) { - return; - } - next = adr + size; - if (next - cand[i] > 0) { + if (Heap_uLT(cand[i], adr)) { Heap_Mark(ptr); } - adr = next; + } + if (Heap_uLE(end, cand[i])) { + adr = end; } } __GET(chnk, chnk, INT64); @@ -619,7 +619,8 @@ void Heap_FINALL (void) static void Heap_MarkStack (INT64 n, INT64 *cand, ADDRESS cand__len) { SYSTEM_PTR frame; - INT64 inc, nofcand, sp, p, stack0; + INT32 nofcand; + INT64 inc, sp, p, stack0; struct Heap__1 align; if (n > 0) { Heap_MarkStack(n - 1, cand, cand__len); @@ -632,13 +633,13 @@ static void Heap_MarkStack (INT64 n, INT64 *cand, ADDRESS cand__len) sp = (ADDRESS)&frame; stack0 = Heap_ModulesMainStackFrame(); inc = (ADDRESS)&align.p - (ADDRESS)&align; - if (sp - stack0 > 0) { + if (Heap_uLT(stack0, sp)) { inc = -inc; } while (sp != stack0) { __GET(sp, p, INT64); - if ((((p > 0 && p >= Heap_heapPosMin)) && p < Heap_heapPosMax) || (((p < 0 && p >= Heap_heapNegMin)) && p < Heap_heapNegMax)) { - if (nofcand == (INT64)cand__len) { + if ((Heap_uLE(Heap_heapMin, p) && Heap_uLT(p, Heap_heapMax))) { + if (nofcand == cand__len) { Heap_HeapSort(nofcand, (void*)cand, cand__len); Heap_MarkCandidates(nofcand, (void*)cand, cand__len); nofcand = 0; @@ -752,17 +753,15 @@ void Heap_InitHeap (void) Heap_heapsize = 0; Heap_allocated = 0; Heap_lockdepth = 0; - Heap_heapPosMin = 9223372036854775807LL; - Heap_heapPosMax = 0; - Heap_heapNegMin = 0; - Heap_heapNegMax = (-9223372036854775807LL-1); + Heap_heapMin = -1; + Heap_heapMax = 0; + Heap_bigBlocks = 0; Heap_heap = Heap_NewChunk(256000); __PUT(Heap_heap, 0, INT64); Heap_firstTry = 1; Heap_freeList[9] = 1; Heap_FileCount = 0; Heap_modules = NIL; - Heap_bigBlocks = 0; Heap_fin = NIL; Heap_interrupted = 0; Heap_HeapModuleInit(); diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index cd281d35..ac0c9a94 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. tsSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 95117c1d..3d520568 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index 98b2aa47..13be7215 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index c8ffb553..bb4ea138 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index 587f5ca2..6757803a 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index 556ff058..093bb886 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index 377385f1..a32c29e0 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 4b66e7f1..dc8eecc1 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index d52e3f0f..f246eacb 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index 06c6a681..911d0bf7 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index c168cbe7..913d2eef 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index b554bf21..abfcd4b8 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index 6e983459..9e15ba4e 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index cd38533c..68c085a5 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index bc21d626..228191bf 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 327f244d..7340919d 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index 5d34109a..ea04b5b8 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Out.c b/bootstrap/unix-88/Out.c index a5f08778..b5fb4689 100644 --- a/bootstrap/unix-88/Out.c +++ b/bootstrap/unix-88/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Out.h b/bootstrap/unix-88/Out.h index 26039116..fe405da3 100644 --- a/bootstrap/unix-88/Out.h +++ b/bootstrap/unix-88/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 3c0223f6..0cf3f0c3 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index 34af667e..38fee3de 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 2b39fcf1..9b449f98 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index 016451be..3e83af42 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index b7456c5c..f9b5310a 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index be22ef18..58f9b546 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index 09c54393..429d0665 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index cc880f07..ac6542ff 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/VT100.c b/bootstrap/unix-88/VT100.c index 9b5da2b4..80457921 100644 --- a/bootstrap/unix-88/VT100.c +++ b/bootstrap/unix-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/VT100.h b/bootstrap/unix-88/VT100.h index 2c94eb2a..1a589c43 100644 --- a/bootstrap/unix-88/VT100.h +++ b/bootstrap/unix-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index fd65edea..46b1acc2 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -65,7 +65,7 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) { - __COPY("i686-w64-mingw32-gcc -g", s, s__len); + __COPY("gcc -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); @@ -95,7 +95,7 @@ void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN stati Strings_Append((CHAR*)".c ", 4, (void*)cmd, 1023); Strings_Append(additionalopts, additionalopts__len, (void*)cmd, 1023); if (statically) { - Strings_Append((CHAR*)"", 1, (void*)cmd, 1023); + Strings_Append((CHAR*)" -static", 9, (void*)cmd, 1023); } Strings_Append((CHAR*)" -o ", 5, (void*)cmd, 1023); Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index 7d8a92d3..4201df04 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/Compiler.c b/bootstrap/windows-48/Compiler.c index c828f47d..d13ed803 100644 --- a/bootstrap/windows-48/Compiler.c +++ b/bootstrap/windows-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspamS */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index 5fa885ca..eb305bbe 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index af5f5580..d10b5011 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 6557a312..2922b3cd 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index 8fbe56ca..b43aa306 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index a5b7cd03..d6b6560d 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. tsSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -69,7 +69,7 @@ static INT32 Heap_bigBlocks; export INT32 Heap_allocated; static BOOLEAN Heap_firstTry; export INT32 Heap_heap; -static INT32 Heap_heapNegMin, Heap_heapNegMax, Heap_heapPosMin, Heap_heapPosMax; +static INT32 Heap_heapMin, Heap_heapMax; export INT32 Heap_heapsize; static Heap_FinNode Heap_fin; static INT16 Heap_lockdepth; @@ -113,6 +113,8 @@ extern ADDRESS Platform_OSAllocate(ADDRESS size); #define Heap_ModulesHalt(code) Modules_Halt(code) #define Heap_ModulesMainStackFrame() Modules_MainStackFrame #define Heap_OSAllocate(size) Platform_OSAllocate(size) +#define Heap_uLE(x, y) ((size_t)x <= (size_t)y) +#define Heap_uLT(x, y) ((size_t)x < (size_t)y) void Heap_Lock (void) { @@ -213,20 +215,11 @@ static INT32 Heap_NewChunk (INT32 blksz) __PUT(blk + 12, Heap_bigBlocks, INT32); Heap_bigBlocks = blk; Heap_heapsize += blksz; - if (chnk > 0) { - if (chnk < Heap_heapPosMin) { - Heap_heapPosMin = blk + 4; - } - if (end > Heap_heapPosMax) { - Heap_heapPosMax = end; - } - } else { - if (chnk < Heap_heapNegMin) { - Heap_heapNegMin = blk + 4; - } - if (end > Heap_heapNegMax) { - Heap_heapNegMax = end; - } + if (Heap_uLT(blk + 4, Heap_heapMin)) { + Heap_heapMin = blk + 4; + } + if (Heap_uLT(Heap_heapMax, end)) { + Heap_heapMax = end; } } return chnk; @@ -235,20 +228,20 @@ static INT32 Heap_NewChunk (INT32 blksz) static void Heap_ExtendHeap (INT32 blksz) { INT32 size, chnk, j, next; - if (blksz > 160000) { + if (Heap_uLT(160000, blksz)) { size = blksz; } else { size = 160000; } chnk = Heap_NewChunk(size); if (chnk != 0) { - if (chnk < Heap_heap) { + if (Heap_uLT(chnk, Heap_heap)) { __PUT(chnk, Heap_heap, INT32); Heap_heap = chnk; } else { j = Heap_heap; __GET(j, next, INT32); - while ((next != 0 && chnk - next > 0)) { + while ((next != 0 && Heap_uLT(next, chnk))) { j = next; __GET(j, next, INT32); } @@ -266,14 +259,14 @@ SYSTEM_PTR Heap_NEWREC (INT32 tag) __GET(tag, blksz, INT32); i0 = __ASHR(blksz, 4); i = i0; - if (i < 9) { + if (Heap_uLT(i, 9)) { adr = Heap_freeList[i]; while (adr == 0) { i += 1; adr = Heap_freeList[i]; } } - if (i < 9) { + if (Heap_uLT(i, 9)) { __GET(adr + 12, next, INT32); Heap_freeList[i] = next; if (i != i0) { @@ -296,7 +289,7 @@ SYSTEM_PTR Heap_NEWREC (INT32 tag) if (Heap_firstTry) { Heap_GC(1); blksz += 16; - if (__ASHL((Heap_heapsize - Heap_allocated) - blksz, 2) < Heap_heapsize) { + if (Heap_uLT(Heap_heapsize - Heap_allocated, blksz) || Heap_uLT(__ASHL((Heap_heapsize - Heap_allocated) - blksz, 2), Heap_heapsize)) { Heap_ExtendHeap(__ASHL(__DIV(Heap_allocated + blksz, 48), 6) - Heap_heapsize); } Heap_firstTry = 0; @@ -314,7 +307,7 @@ SYSTEM_PTR Heap_NEWREC (INT32 tag) } } __GET(adr + 4, t, INT32); - if (t >= blksz) { + if (Heap_uLE(blksz, t)) { break; } prev = adr; @@ -325,7 +318,7 @@ SYSTEM_PTR Heap_NEWREC (INT32 tag) __PUT(end + 4, blksz, INT32); __PUT(end + 8, -4, INT32); __PUT(end, end + 4, INT32); - if (restsize > 144) { + if (Heap_uLT(144, restsize)) { __PUT(adr + 4, restsize, INT32); } else { __GET(adr + 12, next, INT32); @@ -334,7 +327,7 @@ SYSTEM_PTR Heap_NEWREC (INT32 tag) } else { __PUT(prev + 12, next, INT32); } - if (restsize > 0) { + if (restsize != 0) { di = __ASHR(restsize, 4); __PUT(adr + 4, restsize, INT32); __PUT(adr + 12, Heap_freeList[di], INT32); @@ -345,7 +338,7 @@ SYSTEM_PTR Heap_NEWREC (INT32 tag) } i = adr + 16; end = adr + blksz; - while (end - i > 0) { + while (Heap_uLT(i, end)) { __PUT(i, 0, INT32); __PUT(i + 4, 0, INT32); __PUT(i + 8, 0, INT32); @@ -442,17 +435,17 @@ static void Heap_Scan (void) while (chnk != 0) { adr = chnk + 12; __GET(chnk + 4, end, INT32); - while (end - adr > 0) { + while (Heap_uLT(adr, end)) { __GET(adr, tag, INT32); if (__ODD(tag)) { - if (freesize > 0) { + if (freesize != 0) { start = adr - freesize; __PUT(start, start + 4, INT32); __PUT(start + 4, freesize, INT32); __PUT(start + 8, -4, INT32); i = __ASHR(freesize, 4); freesize = 0; - if (i < 9) { + if (Heap_uLT(i, 9)) { __PUT(start + 12, Heap_freeList[i], INT32); Heap_freeList[i] = start; } else { @@ -471,14 +464,14 @@ static void Heap_Scan (void) adr += size; } } - if (freesize > 0) { + if (freesize != 0) { start = adr - freesize; __PUT(start, start + 4, INT32); __PUT(start + 4, freesize, INT32); __PUT(start + 8, -4, INT32); i = __ASHR(freesize, 4); freesize = 0; - if (i < 9) { + if (Heap_uLT(i, 9)) { __PUT(start + 12, Heap_freeList[i], INT32); Heap_freeList[i] = start; } else { @@ -492,16 +485,17 @@ static void Heap_Scan (void) static void Heap_Sift (INT32 l, INT32 r, INT32 *a, ADDRESS a__len) { - INT32 i, j, x; + INT32 i, j; + INT32 x; j = l; x = a[j]; for (;;) { i = j; j = __ASHL(j, 1) + 1; - if ((j < r && a[j] < a[j + 1])) { + if ((j < r && Heap_uLT(a[j], a[j + 1]))) { j += 1; } - if (j > r || a[j] <= x) { + if (j > r || Heap_uLE(a[j], x)) { break; } a[i] = a[j]; @@ -511,7 +505,8 @@ static void Heap_Sift (INT32 l, INT32 r, INT32 *a, ADDRESS a__len) static void Heap_HeapSort (INT32 n, INT32 *a, ADDRESS a__len) { - INT32 l, r, x; + INT32 l, r; + INT32 x; l = __ASHR(n, 1); r = n - 1; while (l > 0) { @@ -529,35 +524,40 @@ static void Heap_HeapSort (INT32 n, INT32 *a, ADDRESS a__len) static void Heap_MarkCandidates (INT32 n, INT32 *cand, ADDRESS cand__len) { - INT32 chnk, adr, tag, next, lim, lim1, i, ptr, size; - chnk = Heap_heap; + INT32 chnk, end, adr, tag, next, i, ptr, size; + chnk = Heap_heap; i = 0; - lim = cand[n - 1]; - while ((chnk != 0 && lim - chnk > 0)) { + while (chnk != 0) { + __GET(chnk + 4, end, INT32); adr = chnk + 12; - __GET(chnk + 4, lim1, INT32); - if (lim1 - lim > 0) { - lim1 = lim; - } - while (lim1 - adr > 0) { + while (Heap_uLT(adr, end)) { __GET(adr, tag, INT32); if (__ODD(tag)) { __GET(tag - 1, size, INT32); adr += size; + ptr = adr + 4; + while (Heap_uLT(cand[i], ptr)) { + i += 1; + if (i == n) { + return; + } + } } else { __GET(tag, size, INT32); ptr = adr + 4; - while (ptr - cand[i] > 0) { + adr += size; + while (Heap_uLT(cand[i], ptr)) { i += 1; + if (i == n) { + return; + } } - if (i == n) { - return; - } - next = adr + size; - if (next - cand[i] > 0) { + if (Heap_uLT(cand[i], adr)) { Heap_Mark(ptr); } - adr = next; + } + if (Heap_uLE(end, cand[i])) { + adr = end; } } __GET(chnk, chnk, INT32); @@ -619,7 +619,8 @@ void Heap_FINALL (void) static void Heap_MarkStack (INT32 n, INT32 *cand, ADDRESS cand__len) { SYSTEM_PTR frame; - INT32 inc, nofcand, sp, p, stack0; + INT32 nofcand; + INT32 inc, sp, p, stack0; struct Heap__1 align; if (n > 0) { Heap_MarkStack(n - 1, cand, cand__len); @@ -632,12 +633,12 @@ static void Heap_MarkStack (INT32 n, INT32 *cand, ADDRESS cand__len) sp = (ADDRESS)&frame; stack0 = Heap_ModulesMainStackFrame(); inc = (ADDRESS)&align.p - (ADDRESS)&align; - if (sp - stack0 > 0) { + if (Heap_uLT(stack0, sp)) { inc = -inc; } while (sp != stack0) { __GET(sp, p, INT32); - if ((((p > 0 && p >= Heap_heapPosMin)) && p < Heap_heapPosMax) || (((p < 0 && p >= Heap_heapNegMin)) && p < Heap_heapNegMax)) { + if ((Heap_uLE(Heap_heapMin, p) && Heap_uLT(p, Heap_heapMax))) { if (nofcand == cand__len) { Heap_HeapSort(nofcand, (void*)cand, cand__len); Heap_MarkCandidates(nofcand, (void*)cand, cand__len); @@ -752,17 +753,15 @@ void Heap_InitHeap (void) Heap_heapsize = 0; Heap_allocated = 0; Heap_lockdepth = 0; - Heap_heapPosMin = 2147483647; - Heap_heapPosMax = 0; - Heap_heapNegMin = 0; - Heap_heapNegMax = (-2147483647-1); + Heap_heapMin = -1; + Heap_heapMax = 0; + Heap_bigBlocks = 0; Heap_heap = Heap_NewChunk(128000); __PUT(Heap_heap, 0, INT32); Heap_firstTry = 1; Heap_freeList[9] = 1; Heap_FileCount = 0; Heap_modules = NIL; - Heap_bigBlocks = 0; Heap_fin = NIL; Heap_interrupted = 0; Heap_HeapModuleInit(); diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index 8a81aea1..87732bb9 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. tsSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index bda8ec0b..458d281f 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index 9e1502d5..f52b30af 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index c8ffb553..bb4ea138 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index 587f5ca2..6757803a 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 556ff058..093bb886 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index 377385f1..a32c29e0 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 5ec11c6f..0fd45dec 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index d52e3f0f..f246eacb 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index 3199e877..c3e79413 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index c168cbe7..913d2eef 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index b554bf21..abfcd4b8 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index 6e983459..9e15ba4e 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 13794d5f..fc598571 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index bc21d626..228191bf 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index adffc7a4..e44854e3 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index 5d34109a..ea04b5b8 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Out.c b/bootstrap/windows-48/Out.c index 07ed2f75..ebafde72 100644 --- a/bootstrap/windows-48/Out.c +++ b/bootstrap/windows-48/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Out.h b/bootstrap/windows-48/Out.h index 4f49bfa7..cbb4de1a 100644 --- a/bootstrap/windows-48/Out.h +++ b/bootstrap/windows-48/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index bf9c1b7f..fee81ec0 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index 99ea737f..19fe26f9 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 2b39fcf1..9b449f98 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index 016451be..3e83af42 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index b7456c5c..f9b5310a 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index be22ef18..58f9b546 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index 2182dda5..96851302 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index fad4ca32..188b60fb 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/VT100.c b/bootstrap/windows-48/VT100.c index 9b5da2b4..80457921 100644 --- a/bootstrap/windows-48/VT100.c +++ b/bootstrap/windows-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/VT100.h b/bootstrap/windows-48/VT100.h index 2c94eb2a..1a589c43 100644 --- a/bootstrap/windows-48/VT100.h +++ b/bootstrap/windows-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index fd65edea..46b1acc2 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -65,7 +65,7 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) { - __COPY("i686-w64-mingw32-gcc -g", s, s__len); + __COPY("gcc -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); @@ -95,7 +95,7 @@ void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN stati Strings_Append((CHAR*)".c ", 4, (void*)cmd, 1023); Strings_Append(additionalopts, additionalopts__len, (void*)cmd, 1023); if (statically) { - Strings_Append((CHAR*)"", 1, (void*)cmd, 1023); + Strings_Append((CHAR*)" -static", 9, (void*)cmd, 1023); } Strings_Append((CHAR*)" -o ", 5, (void*)cmd, 1023); Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index 7d8a92d3..4201df04 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/Compiler.c b/bootstrap/windows-88/Compiler.c index c828f47d..d13ed803 100644 --- a/bootstrap/windows-88/Compiler.c +++ b/bootstrap/windows-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspamS */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index 5fa885ca..eb305bbe 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index af5f5580..d10b5011 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 097b5552..3b7e4c54 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 6ef831df..0093b4e8 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index c618f3ef..9f808e0f 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. tsSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -69,7 +69,7 @@ static INT64 Heap_bigBlocks; export INT64 Heap_allocated; static BOOLEAN Heap_firstTry; export INT64 Heap_heap; -static INT64 Heap_heapNegMin, Heap_heapNegMax, Heap_heapPosMin, Heap_heapPosMax; +static INT64 Heap_heapMin, Heap_heapMax; export INT64 Heap_heapsize; static Heap_FinNode Heap_fin; static INT16 Heap_lockdepth; @@ -87,12 +87,12 @@ export void Heap_FINALL (void); static void Heap_Finalize (void); export INT32 Heap_FreeModule (CHAR *name, ADDRESS name__len); export void Heap_GC (BOOLEAN markStack); -static void Heap_HeapSort (INT64 n, INT64 *a, ADDRESS a__len); +static void Heap_HeapSort (INT32 n, INT64 *a, ADDRESS a__len); export void Heap_INCREF (Heap_Module m); export void Heap_InitHeap (void); export void Heap_Lock (void); static void Heap_Mark (INT64 q); -static void Heap_MarkCandidates (INT64 n, INT64 *cand, ADDRESS cand__len); +static void Heap_MarkCandidates (INT32 n, INT64 *cand, ADDRESS cand__len); static void Heap_MarkP (SYSTEM_PTR p); static void Heap_MarkStack (INT64 n, INT64 *cand, ADDRESS cand__len); export SYSTEM_PTR Heap_NEWBLK (INT64 size); @@ -103,7 +103,7 @@ export SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); export void Heap_REGTYP (Heap_Module m, INT64 typ); export void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); static void Heap_Scan (void); -static void Heap_Sift (INT64 l, INT64 r, INT64 *a, ADDRESS a__len); +static void Heap_Sift (INT32 l, INT32 r, INT64 *a, ADDRESS a__len); export void Heap_Unlock (void); extern void *Heap__init(); @@ -113,6 +113,8 @@ extern ADDRESS Platform_OSAllocate(ADDRESS size); #define Heap_ModulesHalt(code) Modules_Halt(code) #define Heap_ModulesMainStackFrame() Modules_MainStackFrame #define Heap_OSAllocate(size) Platform_OSAllocate(size) +#define Heap_uLE(x, y) ((size_t)x <= (size_t)y) +#define Heap_uLT(x, y) ((size_t)x < (size_t)y) void Heap_Lock (void) { @@ -213,20 +215,11 @@ static INT64 Heap_NewChunk (INT64 blksz) __PUT(blk + 24, Heap_bigBlocks, INT64); Heap_bigBlocks = blk; Heap_heapsize += blksz; - if (chnk > 0) { - if (chnk < Heap_heapPosMin) { - Heap_heapPosMin = blk + 8; - } - if (end > Heap_heapPosMax) { - Heap_heapPosMax = end; - } - } else { - if (chnk < Heap_heapNegMin) { - Heap_heapNegMin = blk + 8; - } - if (end > Heap_heapNegMax) { - Heap_heapNegMax = end; - } + if (Heap_uLT(blk + 8, Heap_heapMin)) { + Heap_heapMin = blk + 8; + } + if (Heap_uLT(Heap_heapMax, end)) { + Heap_heapMax = end; } } return chnk; @@ -235,20 +228,20 @@ static INT64 Heap_NewChunk (INT64 blksz) static void Heap_ExtendHeap (INT64 blksz) { INT64 size, chnk, j, next; - if (blksz > 320000) { + if (Heap_uLT(320000, blksz)) { size = blksz; } else { size = 320000; } chnk = Heap_NewChunk(size); if (chnk != 0) { - if (chnk < Heap_heap) { + if (Heap_uLT(chnk, Heap_heap)) { __PUT(chnk, Heap_heap, INT64); Heap_heap = chnk; } else { j = Heap_heap; __GET(j, next, INT64); - while ((next != 0 && chnk - next > 0)) { + while ((next != 0 && Heap_uLT(next, chnk))) { j = next; __GET(j, next, INT64); } @@ -266,14 +259,14 @@ SYSTEM_PTR Heap_NEWREC (INT64 tag) __GET(tag, blksz, INT64); i0 = __ASHR(blksz, 5); i = i0; - if (i < 9) { + if (Heap_uLT(i, 9)) { adr = Heap_freeList[i]; while (adr == 0) { i += 1; adr = Heap_freeList[i]; } } - if (i < 9) { + if (Heap_uLT(i, 9)) { __GET(adr + 24, next, INT64); Heap_freeList[i] = next; if (i != i0) { @@ -296,7 +289,7 @@ SYSTEM_PTR Heap_NEWREC (INT64 tag) if (Heap_firstTry) { Heap_GC(1); blksz += 32; - if (__ASHL((Heap_heapsize - Heap_allocated) - blksz, 2) < Heap_heapsize) { + if (Heap_uLT(Heap_heapsize - Heap_allocated, blksz) || Heap_uLT(__ASHL((Heap_heapsize - Heap_allocated) - blksz, 2), Heap_heapsize)) { Heap_ExtendHeap(__ASHL(__DIV(Heap_allocated + blksz, 96), 7) - Heap_heapsize); } Heap_firstTry = 0; @@ -314,7 +307,7 @@ SYSTEM_PTR Heap_NEWREC (INT64 tag) } } __GET(adr + 8, t, INT64); - if (t >= blksz) { + if (Heap_uLE(blksz, t)) { break; } prev = adr; @@ -325,7 +318,7 @@ SYSTEM_PTR Heap_NEWREC (INT64 tag) __PUT(end + 8, blksz, INT64); __PUT(end + 16, -8, INT64); __PUT(end, end + 8, INT64); - if (restsize > 288) { + if (Heap_uLT(288, restsize)) { __PUT(adr + 8, restsize, INT64); } else { __GET(adr + 24, next, INT64); @@ -334,7 +327,7 @@ SYSTEM_PTR Heap_NEWREC (INT64 tag) } else { __PUT(prev + 24, next, INT64); } - if (restsize > 0) { + if (restsize != 0) { di = __ASHR(restsize, 5); __PUT(adr + 8, restsize, INT64); __PUT(adr + 24, Heap_freeList[di], INT64); @@ -345,7 +338,7 @@ SYSTEM_PTR Heap_NEWREC (INT64 tag) } i = adr + 32; end = adr + blksz; - while (end - i > 0) { + while (Heap_uLT(i, end)) { __PUT(i, 0, INT64); __PUT(i + 8, 0, INT64); __PUT(i + 16, 0, INT64); @@ -442,17 +435,17 @@ static void Heap_Scan (void) while (chnk != 0) { adr = chnk + 24; __GET(chnk + 8, end, INT64); - while (end - adr > 0) { + while (Heap_uLT(adr, end)) { __GET(adr, tag, INT64); if (__ODD(tag)) { - if (freesize > 0) { + if (freesize != 0) { start = adr - freesize; __PUT(start, start + 8, INT64); __PUT(start + 8, freesize, INT64); __PUT(start + 16, -8, INT64); i = __ASHR(freesize, 5); freesize = 0; - if (i < 9) { + if (Heap_uLT(i, 9)) { __PUT(start + 24, Heap_freeList[i], INT64); Heap_freeList[i] = start; } else { @@ -471,14 +464,14 @@ static void Heap_Scan (void) adr += size; } } - if (freesize > 0) { + if (freesize != 0) { start = adr - freesize; __PUT(start, start + 8, INT64); __PUT(start + 8, freesize, INT64); __PUT(start + 16, -8, INT64); i = __ASHR(freesize, 5); freesize = 0; - if (i < 9) { + if (Heap_uLT(i, 9)) { __PUT(start + 24, Heap_freeList[i], INT64); Heap_freeList[i] = start; } else { @@ -490,18 +483,19 @@ static void Heap_Scan (void) } } -static void Heap_Sift (INT64 l, INT64 r, INT64 *a, ADDRESS a__len) +static void Heap_Sift (INT32 l, INT32 r, INT64 *a, ADDRESS a__len) { - INT64 i, j, x; + INT32 i, j; + INT64 x; j = l; x = a[j]; for (;;) { i = j; j = __ASHL(j, 1) + 1; - if ((j < r && a[j] < a[j + 1])) { + if ((j < r && Heap_uLT(a[j], a[j + 1]))) { j += 1; } - if (j > r || a[j] <= x) { + if (j > r || Heap_uLE(a[j], x)) { break; } a[i] = a[j]; @@ -509,9 +503,10 @@ static void Heap_Sift (INT64 l, INT64 r, INT64 *a, ADDRESS a__len) a[i] = x; } -static void Heap_HeapSort (INT64 n, INT64 *a, ADDRESS a__len) +static void Heap_HeapSort (INT32 n, INT64 *a, ADDRESS a__len) { - INT64 l, r, x; + INT32 l, r; + INT64 x; l = __ASHR(n, 1); r = n - 1; while (l > 0) { @@ -527,37 +522,42 @@ static void Heap_HeapSort (INT64 n, INT64 *a, ADDRESS a__len) } } -static void Heap_MarkCandidates (INT64 n, INT64 *cand, ADDRESS cand__len) +static void Heap_MarkCandidates (INT32 n, INT64 *cand, ADDRESS cand__len) { - INT64 chnk, adr, tag, next, lim, lim1, i, ptr, size; - chnk = Heap_heap; + INT64 chnk, end, adr, tag, next, i, ptr, size; + chnk = Heap_heap; i = 0; - lim = cand[n - 1]; - while ((chnk != 0 && lim - chnk > 0)) { + while (chnk != 0) { + __GET(chnk + 8, end, INT64); adr = chnk + 24; - __GET(chnk + 8, lim1, INT64); - if (lim1 - lim > 0) { - lim1 = lim; - } - while (lim1 - adr > 0) { + while (Heap_uLT(adr, end)) { __GET(adr, tag, INT64); if (__ODD(tag)) { __GET(tag - 1, size, INT64); adr += size; + ptr = adr + 8; + while (Heap_uLT(cand[i], ptr)) { + i += 1; + if (i == (INT64)n) { + return; + } + } } else { __GET(tag, size, INT64); ptr = adr + 8; - while (ptr - cand[i] > 0) { + adr += size; + while (Heap_uLT(cand[i], ptr)) { i += 1; + if (i == (INT64)n) { + return; + } } - if (i == n) { - return; - } - next = adr + size; - if (next - cand[i] > 0) { + if (Heap_uLT(cand[i], adr)) { Heap_Mark(ptr); } - adr = next; + } + if (Heap_uLE(end, cand[i])) { + adr = end; } } __GET(chnk, chnk, INT64); @@ -619,7 +619,8 @@ void Heap_FINALL (void) static void Heap_MarkStack (INT64 n, INT64 *cand, ADDRESS cand__len) { SYSTEM_PTR frame; - INT64 inc, nofcand, sp, p, stack0; + INT32 nofcand; + INT64 inc, sp, p, stack0; struct Heap__1 align; if (n > 0) { Heap_MarkStack(n - 1, cand, cand__len); @@ -632,13 +633,13 @@ static void Heap_MarkStack (INT64 n, INT64 *cand, ADDRESS cand__len) sp = (ADDRESS)&frame; stack0 = Heap_ModulesMainStackFrame(); inc = (ADDRESS)&align.p - (ADDRESS)&align; - if (sp - stack0 > 0) { + if (Heap_uLT(stack0, sp)) { inc = -inc; } while (sp != stack0) { __GET(sp, p, INT64); - if ((((p > 0 && p >= Heap_heapPosMin)) && p < Heap_heapPosMax) || (((p < 0 && p >= Heap_heapNegMin)) && p < Heap_heapNegMax)) { - if (nofcand == (INT64)cand__len) { + if ((Heap_uLE(Heap_heapMin, p) && Heap_uLT(p, Heap_heapMax))) { + if (nofcand == cand__len) { Heap_HeapSort(nofcand, (void*)cand, cand__len); Heap_MarkCandidates(nofcand, (void*)cand, cand__len); nofcand = 0; @@ -752,17 +753,15 @@ void Heap_InitHeap (void) Heap_heapsize = 0; Heap_allocated = 0; Heap_lockdepth = 0; - Heap_heapPosMin = 9223372036854775807LL; - Heap_heapPosMax = 0; - Heap_heapNegMin = 0; - Heap_heapNegMax = (-9223372036854775807LL-1); + Heap_heapMin = -1; + Heap_heapMax = 0; + Heap_bigBlocks = 0; Heap_heap = Heap_NewChunk(256000); __PUT(Heap_heap, 0, INT64); Heap_firstTry = 1; Heap_freeList[9] = 1; Heap_FileCount = 0; Heap_modules = NIL; - Heap_bigBlocks = 0; Heap_fin = NIL; Heap_interrupted = 0; Heap_HeapModuleInit(); diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index cd281d35..ac0c9a94 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. tsSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index c210b7d7..539c398c 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index 98b2aa47..13be7215 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index c8ffb553..bb4ea138 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index 587f5ca2..6757803a 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index 556ff058..093bb886 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index 377385f1..a32c29e0 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 4b66e7f1..dc8eecc1 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index d52e3f0f..f246eacb 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index 06c6a681..911d0bf7 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index c168cbe7..913d2eef 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index b554bf21..abfcd4b8 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index 6e983459..9e15ba4e 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index cd38533c..68c085a5 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index bc21d626..228191bf 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 327f244d..7340919d 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index 5d34109a..ea04b5b8 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Out.c b/bootstrap/windows-88/Out.c index 6ad86a73..cb9b1989 100644 --- a/bootstrap/windows-88/Out.c +++ b/bootstrap/windows-88/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Out.h b/bootstrap/windows-88/Out.h index 26039116..fe405da3 100644 --- a/bootstrap/windows-88/Out.h +++ b/bootstrap/windows-88/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index aa0f4ff3..127901b0 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index 7699502f..0b6a96a2 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 2b39fcf1..9b449f98 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index 016451be..3e83af42 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index b7456c5c..f9b5310a 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index be22ef18..58f9b546 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index 09c54393..429d0665 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index cc880f07..ac6542ff 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/VT100.c b/bootstrap/windows-88/VT100.c index 9b5da2b4..80457921 100644 --- a/bootstrap/windows-88/VT100.c +++ b/bootstrap/windows-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/VT100.h b/bootstrap/windows-88/VT100.h index 2c94eb2a..1a589c43 100644 --- a/bootstrap/windows-88/VT100.h +++ b/bootstrap/windows-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index fd65edea..46b1acc2 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -65,7 +65,7 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) { - __COPY("i686-w64-mingw32-gcc -g", s, s__len); + __COPY("gcc -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); @@ -95,7 +95,7 @@ void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN stati Strings_Append((CHAR*)".c ", 4, (void*)cmd, 1023); Strings_Append(additionalopts, additionalopts__len, (void*)cmd, 1023); if (statically) { - Strings_Append((CHAR*)"", 1, (void*)cmd, 1023); + Strings_Append((CHAR*)" -static", 9, (void*)cmd, 1023); } Strings_Append((CHAR*)" -o ", 5, (void*)cmd, 1023); Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index 7d8a92d3..4201df04 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h From 412a8c3337ae1c89d608b1a2b33d2dced3063de0 Mon Sep 17 00:00:00 2001 From: David Brown Date: Tue, 20 Dec 2016 15:16:18 +0000 Subject: [PATCH 444/580] Document compilation; remove OpenBSD debugging. --- ReadMe.md | 7 +- doc/Compiling.md | 82 +++++++++++++ doc/Features.md | 2 +- src/compiler/Compiler.Mod | 2 +- src/compiler/OPM.Mod | 36 +++--- src/compiler/OPP.Mod | 2 +- src/compiler/extTools.Mod | 4 +- src/runtime/Files.Mod | 75 +----------- src/runtime/Out.Mod | 153 +------------------------ src/runtime/Texts.Mod | 64 ----------- src/test/confidence/intsyntax/expected | 2 +- 11 files changed, 110 insertions(+), 319 deletions(-) create mode 100644 doc/Compiling.md diff --git a/ReadMe.md b/ReadMe.md index 95732f0d..32e200b0 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -14,8 +14,8 @@ default libraries complying with the Oakwood Guidelines for Oberon-2 compilers. ### Contents     [**Installation**](#installation)
-    [**A 'Hello' application**](#a-hello-application)
-    [**Licensing**](#licensing)
+    [**Compiling a 'Hello' application**](#a-hello-application)
+    [**License**](#license)
    [**Platform support and porting**](#platform-support-and-porting)
    [**Language support and libraries**](#language-support-and-libraries)
    [**History**](#history)
@@ -138,6 +138,7 @@ executable binary. Execute as usual on Linux (`./hello`) or Windows (`hello`). +For more details on compilation, see [**Compiling**](/doc/Compiling.md). ### Viewing the interfaces of included modules. @@ -163,7 +164,7 @@ END Out. ``` -## Licensing +## License Vishap Oberon's frontend and C backend engine is a fork of Josef Templ’s Ofront, which has been released under the FreeBSD License. Unlike Ofront, Vishap Oberon does not include the Oberon v4 GUI environment. diff --git a/doc/Compiling.md b/doc/Compiling.md new file mode 100644 index 00000000..abeaf6c2 --- /dev/null +++ b/doc/Compiling.md @@ -0,0 +1,82 @@ +## Compiling + +An Oberon command line program is built from one or more modules. One module must be designated a main module. + +### Files generated + +From each non-main module the following files are generated in the current directory: + +| Filename | Purpose | +| ---------- | --------------------------------------------------------------------- | +| ```module.sym``` | Oberon symbols required to ```IMPORT``` this module in another compilation.| +| ```module.c``` | C source code for compilation by gcc, clang or msc. | +| ```module.h``` | C header files required by C compiler when importing this module. | + +Note that the filename of the .sym, .c and .h files is the name of the module from the ```MODULE``` statement at the start of the source file. It is not the name of the .mod file. + +If the compilation is successful, the Oberon compiler will automatically invoke the C compiler. The compiler option ```-V``` will cause the compiler to display the C compiler command used. + +### Successful compilation report + +For a successful compilation, the compiler displays a single line comprising + + * The name of the file being compiled + * The name of the module from the ```MODULE``` statment + * Compiler configuration (only if the ```-V``` verbose option is selected) + * A possible symbol update status message + * The number of characters compiled + +If a symbols file already exists, the compiler will check whether the new compilation changes the symbols, and if so whether the change is just an extension, or a more serious compatability threatening modification. If there is a change the compiler displays either ```Extended symbol file``` or ```New symbol file```. + +For example: + +``` +$ voc test.mod +test.mod Compiling test. New symbol file. 364 chars. +``` + +### Symbol file changes + +By default the compiler will refuse to compile a module if its symbols are different from those in the .sym file present from a previous compilation. To allow the compiler to change the symbols, one of the following options must be used. + +| Compiler option | Use | +| :-------------: | --------------------------- | +| ```-e``` | Allow extension of symbols. Do not allow changes to existing symbols. | +| ```-s``` | Allow changes to and extensions of symbols. | +| ```-F``` | Force generation of new symbol file.* | + +\* A new symbol file may be forced to guarantee that a symbol file is generated for a module that has the same name as an installed library module. + +### Main module + +The main module should be the last module compiled as it imports all other modules. + +The program logic should be started from the main module's initialisation code. + +The following options designate the main module: + +| Compiler option | Use | +| :-------------: | --------------------------- | +| ```-m``` | Generate loadable binary using dynamic library loading (on systems that support it). | +| ```-M``` | Generate loadable binary with all library references statically linked. | + +For a main module, no .sym or .h files are generated, and the C compiler is called with additional parameters to generate the execututable binary, linking the object files needed for imported modules. + +### Separate compilation + +Each module may be compiled by a separate command line, although the imports of a module must be compiled before the module is compiled. All three generated files (.sym, .c and .h) must be retained at least until all modules dependent on this module have been compiled. + +Multiple modules may be compiled on a single compiler command line. + +Options on the command line that preceed all module file names will be used as global settings: each module will be compiled with these settings except as overriden on a per file basis. + +Options on the command line that follow a module file name are specific to that module. + +For example: + +``` + voc -s alpha.mod beta.mod main.mod -m +``` + +Will apply the ```-s``` option to all modules (allow changes to and extension of symbols), and will apply the ```-m``` option (main program) only to ```main.mod```. + diff --git a/doc/Features.md b/doc/Features.md index 96c1bf78..ffcb4a93 100644 --- a/doc/Features.md +++ b/doc/Features.md @@ -1,4 +1,4 @@ -### Features +## Features #### 32 bit and 64 bit systems vs integer, set and address size. diff --git a/src/compiler/Compiler.Mod b/src/compiler/Compiler.Mod index 9e44a180..6148fea2 100644 --- a/src/compiler/Compiler.Mod +++ b/src/compiler/Compiler.Mod @@ -99,7 +99,7 @@ MODULE Compiler; (* J. Templ 3.2.95 *) Strings.Append(fn, objectnames) ELSE (* Found symbol file but no object file. *) - OPM.LogVT100(VT100.Yellow); + OPM.LogVT100(VT100.LightRed); OPM.LogWStr("Link warning: a local symbol file is present for module "); OPM.LogWStr(l.name); OPM.LogWStr(", but local object file '"); OPM.LogWStr(fn); OPM.LogWStr("' is missing."); OPM.LogVT100(VT100.ResetAll); OPM.LogWLn diff --git a/src/compiler/OPM.Mod b/src/compiler/OPM.Mod index ecfe4ac3..85392b15 100644 --- a/src/compiler/OPM.Mod +++ b/src/compiler/OPM.Mod @@ -137,6 +137,18 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) END END LogVT100; + PROCEDURE LogCompiling*(modname: ARRAY OF CHAR); + BEGIN + LogWStr("Compiling "); LogWStr(modname); + IF verbose IN Options THEN + LogWStr(", s:"); LogWNum(ShortintSize*8,1); + LogWStr( " i:"); LogWNum(IntegerSize*8,1); + LogWStr( " l:"); LogWNum(LongintSize*8,1); + LogWStr( " adr:"); LogWNum(AddressSize*8,1); + LogWStr( " algn:"); LogWNum(Alignment*8,1) + END; + LogW("."); + END LogCompiling; (* Integer size support *) @@ -299,20 +311,6 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) END OpenPar; - PROCEDURE VerboseListSizes; - BEGIN - LogWLn; - LogWStr("Type Size"); LogWLn; - LogWStr("SHORTINT "); LogWNum(ShortintSize, 4); LogWLn; - LogWStr("INTEGER "); LogWNum(IntegerSize, 4); LogWLn; - LogWStr("LONGINT "); LogWNum(LongintSize, 4); LogWLn; - LogWStr("SET "); LogWNum(LongintSize, 4); LogWLn; - LogWStr("ADDRESS "); LogWNum(AddressSize, 4); LogWLn; - LogWLn; - LogWStr("Alignment: "); LogWNum(Alignment, 4); LogWLn; - END VerboseListSizes; - - PROCEDURE InitOptions*; (* get the options for one translation *) VAR s: ARRAY 256 OF CHAR; searchpath, modules: ARRAY 1024 OF CHAR; MODULES: ARRAY 1024 OF CHAR; @@ -336,7 +334,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) ELSE ShortintSize := 1; IntegerSize := 2; LongintSize := 4 END; - IF verbose IN Options THEN VerboseListSizes END; + (*IF verbose IN Options THEN VerboseListSizes END;*) ResourceDir := InstallDir; IF ResourceDir[0] # 0X THEN @@ -392,14 +390,6 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) curpos := Texts.Pos(inR); Texts.Read(inR, ch); - (* OpenBSD intermittent file read error debugging. *) - IF (curpos = 0) & inR.eot THEN - LogWLn; LogWStr("DEBUG: OPM.Get returned inR.eot at curpos = 0, ch = "); - LogWNum(ORD(ch),1); LogW("."); - Texts.DumpReader(inR); - LogWLn; LogWStr("Heap dump:"); LogWLn; - Out.DumpHeap - END; (* TODO, remove curpos var, and provide fn returning Texts.Pos(inR) - 1. *) (* Or, better still, record symbol position in OPS. *) diff --git a/src/compiler/OPP.Mod b/src/compiler/OPP.Mod index 8cfc5a55..2b9fb0b1 100644 --- a/src/compiler/OPP.Mod +++ b/src/compiler/OPP.Mod @@ -1007,7 +1007,7 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) OPS.Init; LoopLevel := 0; level := 0; OPS.Get(sym); IF sym = OPS.module THEN OPS.Get(sym) ELSE err(16) END; IF sym = OPS.ident THEN - OPM.LogWStr("compiling "); OPM.LogWStr(OPS.name); OPM.LogW("."); + OPM.LogCompiling(OPS.name); OPT.Init(OPS.name, opt); OPS.Get(sym); CheckSym(OPS.semicolon); IF sym = OPS.import THEN OPS.Get(sym); LOOP diff --git a/src/compiler/extTools.Mod b/src/compiler/extTools.Mod index d4bb7f84..10163ced 100644 --- a/src/compiler/extTools.Mod +++ b/src/compiler/extTools.Mod @@ -49,7 +49,7 @@ PROCEDURE Assemble*(moduleName: ARRAY OF CHAR); Strings.Append("-c ", cmd); Strings.Append(moduleName, cmd); Strings.Append(".c", cmd); - execute("Assemble: ", cmd); + execute("C compile: ", cmd); END Assemble; @@ -73,7 +73,7 @@ PROCEDURE LinkMain*(VAR moduleName: ARRAY OF CHAR; statically: BOOLEAN; addition Strings.Append('-O', cmd); Strings.Append(OPM.Model, cmd); Strings.Append(Configuration.libext, cmd); - execute("Assemble and link: ", cmd); + execute("C compile and link: ", cmd); END LinkMain; diff --git a/src/runtime/Files.Mod b/src/runtime/Files.Mod index f60e67bb..eb369b3c 100644 --- a/src/runtime/Files.Mod +++ b/src/runtime/Files.Mod @@ -70,44 +70,6 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files SearchPath: POINTER TO ARRAY OF CHAR; -(* Debugging intermittent OpenBSD failure. *) - - PROCEDURE Spaces(i: INTEGER); BEGIN WHILE i>0 DO Out.String(" "); DEC(i) END END Spaces; - - PROCEDURE DumpFile*(f: File; indent: INTEGER); - BEGIN - Spaces(indent); Out.String("workName: "); Out.String(f.workName); Out.Ln; - Spaces(indent); Out.String("registerName: "); Out.String(f.registerName); Out.Ln; - Spaces(indent); Out.String("tempFile: "); IF f.tempFile THEN Out.String("TRUE") ELSE Out.String("FALSE") END; Out.Ln; - Spaces(indent); Out.String("identity: "); Out.String("..."); Out.Ln; (* TBD *) - Spaces(indent); Out.String("fd: "); Out.Int(f.fd,1); Out.Ln; - Spaces(indent); Out.String("len, "); Out.Int(f.len,1); Out.Ln; - Spaces(indent); Out.String("pos: "); Out.Int(f.pos,1); Out.Ln; - Spaces(indent); Out.String("bufs: "); Out.String("..."); Out.Ln; (* TBD *) - Spaces(indent); Out.String("swapper: "); Out.Int(f.swapper,1); Out.Ln; - Spaces(indent); Out.String("state: "); Out.Int(f.state,1); Out.Ln; - Spaces(indent); Out.String("next: "); Out.Hex(SYSTEM.VAL(SYSTEM.ADDRESS,f.next),1); Out.Ln; - END DumpFile; - - PROCEDURE DumpBuffer*(b: Buffer; indent: INTEGER); - BEGIN - Spaces(indent); Out.String("chg: "); IF b.chg THEN Out.String("TRUE") ELSE Out.String("FALSE") END; Out.Ln; - Spaces(indent); Out.String("org: "); Out.Int(b.org,1); Out.Ln; - Spaces(indent); Out.String("size: "); Out.Int(b.size,1); Out.Ln; - Spaces(indent); Out.String("data: "); Out.Ln; Out.HexDump(b.data); - Spaces(indent); Out.String("f: "); IF b.f = NIL THEN Out.String(""); Out.Ln ELSE Out.Ln; DumpFile(b.f, indent+1) END; - END DumpBuffer; - - PROCEDURE DumpRider*(r: Rider; indent: INTEGER); - BEGIN - Spaces(indent); Out.String("res: "); Out.Int(r.res,1); Out.Ln; - Spaces(indent); Out.String("eof: "); IF r.eof THEN Out.String("TRUE") ELSE Out.String("FALSE") END; Out.Ln; - Spaces(indent); Out.String("org: "); Out.Int(r.org,1); Out.Ln; - Spaces(indent); Out.String("offset: "); Out.Int(r.offset,1); Out.Ln; - Spaces(indent); Out.String("buf: "); IF r.buf = NIL THEN Out.String(""); Out.Ln ELSE Out.Ln; DumpBuffer(r.buf, indent+1) END; - END DumpRider; - - PROCEDURE -IdxTrap "__HALT(-1)"; PROCEDURE^ Finalize(o: SYSTEM.PTR); @@ -203,13 +165,6 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files error: Platform.ErrorCode; err: ARRAY 32 OF CHAR; BEGIN - (* - Out.String("Files.Create fd = "); Out.Int(f.fd,1); - Out.String(", registerName = "); Out.String(f.registerName); - Out.String(", workName = "); Out.String(f.workName); - Out.String(", state = "); Out.Int(f.state,1); - Out.Ln; - *) IF f.fd = NoDesc THEN IF f.state = create THEN (* New file with enough data written to exceed buffers, so we need to @@ -248,19 +203,9 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files f: File; (* identity: Platform.FileIdentity; *) BEGIN - (* - Out.String("Files.Flush buf.f.registername = "); Out.String(buf.f.registerName); - Out.String(", buf.f.fd = "); Out.Int(buf.f.fd,1); - Out.String(", buffer at $"); Out.Hex(SYSTEM.ADR(buf.data)); - Out.String(", size "); Out.Int(buf.size,1); Out.Ln; - *) IF buf.chg THEN f := buf.f; Create(f); IF buf.org # f.pos THEN error := Platform.Seek(f.fd, buf.org, Platform.SeekSet); - (* - Out.String("Seeking to "); Out.Int(buf.org,1); - Out.String(", error code "); Out.Int(error,1); Out.Ln; - *) END; error := Platform.Write(f.fd, SYSTEM.ADR(buf.data), buf.size); IF error # 0 THEN Err("error writing file", f, error) END; @@ -271,11 +216,9 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files END END Flush; - PROCEDURE Close* (f: File); VAR - i: LONGINT; - error: Platform.ErrorCode; + i: LONGINT; error: Platform.ErrorCode; BEGIN IF (f.state # create) OR (f.registerName # "") THEN Create(f); i := 0; @@ -429,13 +372,6 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files VAR org, offset, i, n: LONGINT; buf: Buffer; error: Platform.ErrorCode; BEGIN IF f # NIL THEN - (* - Out.String("Files.Set rider on fd = "); Out.Int(f.fd,1); - Out.String(", registerName = "); Out.String(f.registerName); - Out.String(", workName = "); Out.String(f.workName); - Out.String(", state = "); Out.Int(f.state,1); - Out.Ln; - *) IF pos > f.len THEN pos := f.len ELSIF pos < 0 THEN pos := 0 END; offset := pos MOD BufSize; org := pos - offset; i := 0; WHILE (i < NumBufs) & (f.bufs[i] # NIL) & (org # f.bufs[i].org) DO INC(i) END; @@ -597,10 +533,6 @@ Especially Length would become fairly complex. oldidentity, newidentity: Platform.FileIdentity; buf: ARRAY 4096 OF CHAR; BEGIN - (* - Out.String("Files.Rename old = "); Out.String(old); - Out.String(", new = "); Out.String(new); Out.Ln; - *) error := Platform.IdentifyByName(old, oldidentity); IF error = 0 THEN error := Platform.IdentifyByName(new, newidentity); @@ -798,11 +730,6 @@ Especially Length would become fairly complex. VAR f: File; res: LONGINT; BEGIN f := SYSTEM.VAL(File, o); - (* - Out.String("Files.Finalize f.fd = "); Out.Int(f.fd,1); - Out.String(", f.registername = "); Out.String(f.registerName); - Out.String(", f.workName = "); Out.String(f.workName); Out.Ln; - *) IF f.fd >= 0 THEN CloseOSFile(f); IF f.tempFile THEN res := Platform.Unlink(f.workName) END diff --git a/src/runtime/Out.Mod b/src/runtime/Out.Mod index 26decdb1..bdb6b8df 100644 --- a/src/runtime/Out.Mod +++ b/src/runtime/Out.Mod @@ -68,10 +68,13 @@ BEGIN WHILE i > 0 DO DEC(i); Char(s[i]) END END Int; + PROCEDURE Hex*(x, n: HUGEINT); BEGIN IF n < 1 THEN n := 1 ELSIF n > 16 THEN n := 16 END; - WHILE (n < 16) & (SYSTEM.LSH(x, -4*n) # 0) DO INC(n) END; + IF x >= 0 THEN + WHILE (n < 16) & (SYSTEM.LSH(x, -4*n) # 0) DO INC(n) END + END; x := SYSTEM.ROT(x, 4*(16-n)); WHILE n > 0 DO x := SYSTEM.ROT(x,4); DEC(n); @@ -84,154 +87,6 @@ PROCEDURE Ln*; BEGIN String(Platform.NL); Flush; END Ln; -PROCEDURE HexDumpAdr*(adr: SYSTEM.ADDRESS; offset: HUGEINT; length: LONGINT); -VAR i: INTEGER; n, lim: SYSTEM.ADDRESS; c: CHAR; -BEGIN - lim := SYSTEM.VAL(SYSTEM.ADDRESS, adr+length); - WHILE adr < lim DO - IF adr+16 < lim THEN n := 16 ELSE n := lim-adr END; - Hex(offset,8); Char(" "); - i := 0; WHILE i < n DO - IF i MOD 4 = 0 THEN Char(" ") END; - SYSTEM.GET(adr+i, c); Hex(ORD(c), 2); Char(" "); - INC(i) - END; - WHILE i < 16 DO - IF i MOD 4 = 0 THEN Char(" ") END; String(" "); - INC(i) - END; - String(" "); - i := 0; WHILE i < n DO - SYSTEM.GET(adr+i, c); - IF (ORD(c) < 32) OR (ORD(c) > 126) THEN Char(".") ELSE Char(c) END; - INC(i) - END; - INC(adr,n); INC(offset,n); Ln - END -END HexDumpAdr; - -PROCEDURE HexDump*(VAR m: ARRAY OF SYSTEM.BYTE); -BEGIN HexDumpAdr(SYSTEM.ADR(m), 0, LEN(m)) -END HexDump; - - -PROCEDURE DumpModule(m: Heap.Module); -BEGIN - String(" next: "); Hex(SYSTEM.VAL(SYSTEM.ADDRESS, m.next),1); Ln; - String(" name: "); String(m.name); Ln; - String(" refcnt: "); Hex(m.refcnt,1); Ln; - String(" cmds: "); Hex(SYSTEM.VAL(SYSTEM.ADDRESS, m.cmds),1); Ln; - String(" types: "); Hex(m.types,1); Ln; - String(" enumPtrs: "); Hex(SYSTEM.VAL(SYSTEM.ADDRESS, m.enumPtrs),1); Ln; -END DumpModule; - -PROCEDURE DumpTag*(addr: SYSTEM.ADDRESS); -TYPE - typedesc = RECORD - (* Array of type bound procedure addresses preceeds this. *) - tag: SYSTEM.ADDRESS; - next: SYSTEM.ADDRESS; - level: SYSTEM.ADDRESS; - module: SYSTEM.ADDRESS; - name: ARRAY 24 OF CHAR; - bases: ARRAY 16 OF SYSTEM.ADDRESS; - reserved: SYSTEM.ADDRESS; - blksz: SYSTEM.ADDRESS; - ptr0: SYSTEM.ADDRESS; (* Offset of first pointer. Others follow this. *) - END; - tag = POINTER [1] TO typedesc; -VAR - desc: tag; - i: INTEGER; -BEGIN - String(" obj tag: "); Hex(addr,1); Ln; - DEC(addr, addr MOD 2); (* Work OK with incremented tags. *) - desc := SYSTEM.VAL(tag, addr - (21*SIZE(SYSTEM.ADDRESS) + 24)); - String(" desc at: "); Hex(SYSTEM.VAL(SYSTEM.ADDRESS, desc),1); Ln; - String(" desc contains:"); Ln; - String(" tag: "); Hex(desc.tag, 1); Ln; - String(" next: "); Hex(desc.next, 1); Ln; - String(" level: "); Hex(desc.level, 1); Ln; - String(" module: "); Hex(desc.module, 1); Ln; - IF desc.module # 0 THEN DumpModule(SYSTEM.VAL(Heap.Module, desc.module)) END; - String(" name: "); String(desc.name); Ln; - String(" bases: "); - i := 0; WHILE i < 16 DO - Hex(desc.bases[i], SIZE(SYSTEM.ADDRESS) * 2); - IF i MOD 4 = 3 THEN Ln; String(" ") ELSE Char(" ") END; - INC(i) - END; Ln; - String(" reserved: "); Hex(desc.reserved, 1); Ln; - String(" blksz: "); Hex(desc.blksz, 1); Ln; - String(" ptr0: "); Hex(desc.ptr0, 1); Ln; -END DumpTag; - -PROCEDURE DumpType*(VAR o: ARRAY OF SYSTEM.BYTE); -VAR addr: SYSTEM.ADDRESS; -BEGIN - SYSTEM.GET(SYSTEM.ADR(o) - SIZE(SYSTEM.ADDRESS), addr); - DumpTag(addr); -END DumpType; - - -PROCEDURE -externheap "extern ADDRESS Heap_heap;"; -PROCEDURE -getheap(): SYSTEM.ADDRESS "Heap_heap"; - -PROCEDURE DumpHeap*; -TYPE - adrptr = POINTER [1] TO ARRAY 1 OF SYSTEM.ADDRESS; - - block = POINTER [1] TO blockdesc; - blockdesc = RECORD - tag: SYSTEM.ADDRESS; - size: SYSTEM.ADDRESS; - sentinel: SYSTEM.ADDRESS; - next: SYSTEM.ADDRESS; - END; - - chunk = POINTER [1] TO chunkdesc; - chunkdesc = RECORD - next: SYSTEM.ADDRESS; - end: SYSTEM.ADDRESS; - reserved: SYSTEM.ADDRESS; - firstblock: blockdesc; - END; -VAR - caddr: SYSTEM.ADDRESS; c: chunk; - baddr: SYSTEM.ADDRESS; b: block; - tag: adrptr; -BEGIN - caddr := Heap.heap; - WHILE caddr # 0 DO - String("Chunk at: "); Hex(caddr, 1); Ln; - c := SYSTEM.VAL(chunk, caddr); - String(" next: "); Hex(c.next, 1); Ln; - String(" end: "); Hex(c.end, 1); String(" => size: "); Hex(c.end - caddr,1 ); Ln; - String(" rsvd: "); Hex(c.reserved, 1); Ln; - - baddr := SYSTEM.ADR(c.firstblock); - WHILE c.end - baddr > 0 DO - String(" Block at: "); Hex(baddr, 1); Ln; - b := SYSTEM.VAL(block, baddr); - tag := SYSTEM.VAL(adrptr, b.tag - (b.tag MOD 2)); (* mask out heap management flag in bit 0. *) - String(" tag: "); Hex(b.tag, 1); IF b.tag MOD 2 # 0 THEN String(" <--- ODD! ---") END; Ln; - String(" tag^: "); Hex(tag^[0], 1); Ln; - String(" size: "); Hex(b.size, 1); Ln; - String(" sentinel: "); Hex(b.sentinel, 1); Ln; - String(" next: "); Hex(b.next, 1); Ln; - IF b.tag # SYSTEM.ADR(b.size) THEN - (* There is a type descriptor. *) - DumpTag(b.tag) - END; - INC(baddr, tag^[0]); - Ln; - END; - - caddr := c.next; - Ln; - END -END DumpHeap; - (* Real and Longreal display *) diff --git a/src/runtime/Texts.Mod b/src/runtime/Texts.Mod index 55ab429f..5b645fc4 100644 --- a/src/runtime/Texts.Mod +++ b/src/runtime/Texts.Mod @@ -120,70 +120,6 @@ MODULE Texts; (** CAS/HM 23.9.93 -- interface based on Texts by JG/NW 6.12.91** del: Buffer; FontsDefault: FontsFont; -(* Debugging intermittent OpenBSD failure. *) - - PROCEDURE DumpText(t: Text); - BEGIN - Out.String(" len: "); Out.Int(t.len,1); Out.Ln; - Out.String(" notify: "); Out.Hex(SYSTEM.VAL(SYSTEM.ADDRESS, t.notify),1); Out.Ln; - Out.String(" head: "); Out.Hex(SYSTEM.VAL(SYSTEM.ADDRESS, t.head),1); Out.Ln; - Out.String(" cache: "); Out.Hex(SYSTEM.VAL(SYSTEM.ADDRESS, t.cache),1); Out.Ln; - Out.String(" corg: "); Out.Int(t.corg,1); Out.Ln; - END DumpText; - - PROCEDURE DumpRun(ru: Run); - BEGIN - Out.String(" Run at "); Out.Hex(SYSTEM.VAL(SYSTEM.ADDRESS, ru),1); Out.Ln; - Out.String(" prev: "); Out.Hex(SYSTEM.VAL(SYSTEM.ADDRESS, ru.prev),1); Out.Ln; - Out.String(" next: "); Out.Hex(SYSTEM.VAL(SYSTEM.ADDRESS, ru.next),1); Out.Ln; - Out.String(" len: "); Out.Int(ru.len,1); Out.Ln; - Out.String(" fnt: "); IF ru.fnt # NIL THEN Out.String(ru.fnt.name) ELSE Out.String("") END; Out.Ln; - Out.String(" col: "); Out.Int(ru.col,1); Out.Ln; - Out.String(" voff: "); Out.Int(ru.voff,1); Out.Ln; - Out.String(" ascii: "); IF ru.ascii THEN Out.String("TRUE") ELSE Out.String("FALSE") END; Out.Ln; - END DumpRun; - - PROCEDURE DumpElem(e: Elem); - BEGIN - DumpRun(e); - Out.String(" -- Elem --"); Out.Ln; - Out.String(" W: "); Out.Int(e.W,1); Out.Ln; - Out.String(" H: "); Out.Int(e.H,1); Out.Ln; - Out.String(" handle: "); Out.Hex(SYSTEM.VAL(SYSTEM.ADDRESS, e.handle),1); Out.Ln; - Out.String(" base: "); IF e.base = NIL THEN Out.String(""); Out.Ln ELSE Out.Ln; DumpText(e.base) END; - END DumpElem; - - PROCEDURE DumpPiece(p: Piece); - BEGIN - DumpRun(p); - Out.String(" -- Piece --"); Out.Ln; - Out.String(" file: "); IF p.file = NIL THEN Out.String(""); Out.Ln ELSE Out.Ln; Files.DumpFile(p.file, 3) END; - Out.String(" org: "); Out.Int(p.org,1); Out.Ln; - END DumpPiece; - - PROCEDURE DumpReader*(re: Reader); - BEGIN - Out.String("Reader:"); Out.Ln; - Out.String(" eot: "); IF re.eot THEN Out.String("TRUE") ELSE Out.String("FALSE") END; Out.Ln; - Out.String(" fnt: "); IF re.fnt # NIL THEN Out.String(re.fnt.name) ELSE Out.String("") END; Out.Ln; - Out.String(" col: "); Out.Int(re.col,1); Out.Ln; - Out.String(" voff: "); Out.Int(re.voff,1); Out.Ln; - Out.String(" org: "); Out.Int(re.org,1); Out.Ln; - Out.String(" off: "); Out.Int(re.off,1); Out.Ln; - Out.String(" elem: "); IF re.elem = NIL THEN Out.String(""); Out.Ln ELSE Out.Ln; DumpElem(re.elem) END; - Out.String(" rider: "); Out.Ln; Files.DumpRider(re.rider,2); - Out.String(" run: "); - IF re.run = NIL THEN Out.String(""); Out.Ln - ELSE Out.Ln; - IF re.run IS Piece THEN DumpPiece(re.run(Piece)) - ELSIF re.run IS Elem THEN DumpElem(re.run(Elem)) - ELSE DumpRun(re.run) - END - END; - Out.DumpType(re.run^); - END DumpReader; - - PROCEDURE FontsThis(VAR name: ARRAY OF CHAR): FontsFont; VAR F: FontsFont; BEGIN diff --git a/src/test/confidence/intsyntax/expected b/src/test/confidence/intsyntax/expected index 94e29760..ce0633c4 100644 --- a/src/test/confidence/intsyntax/expected +++ b/src/test/confidence/intsyntax/expected @@ -1,4 +1,4 @@ -IntSyntax.mod compiling IntSyntax. +IntSyntax.mod Compiling IntSyntax. 14: i := l; (* Bad, INTEGER shorter than LONGINT *) ^ From 3cb60cc59fe90a9872b46ef7229c911bcc9f3a8f Mon Sep 17 00:00:00 2001 From: David Brown Date: Tue, 20 Dec 2016 15:17:12 +0000 Subject: [PATCH 445/580] Update C bootstrap source. --- bootstrap/unix-44/Compiler.c | 4 +- bootstrap/unix-44/Configuration.c | 4 +- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Files.c | 132 +--------- bootstrap/unix-44/Files.h | 15 +- bootstrap/unix-44/Heap.c | 2 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 2 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 65 ++--- bootstrap/unix-44/OPM.h | 3 +- bootstrap/unix-44/OPP.c | 6 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 2 +- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 2 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Out.c | 255 +----------------- bootstrap/unix-44/Out.h | 7 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 372 ++++++++------------------- bootstrap/unix-44/Texts.h | 3 +- bootstrap/unix-44/VT100.c | 2 +- bootstrap/unix-44/VT100.h | 2 +- bootstrap/unix-44/extTools.c | 6 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-48/Compiler.c | 4 +- bootstrap/unix-48/Configuration.c | 4 +- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Files.c | 132 +--------- bootstrap/unix-48/Files.h | 15 +- bootstrap/unix-48/Heap.c | 2 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 2 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 65 ++--- bootstrap/unix-48/OPM.h | 3 +- bootstrap/unix-48/OPP.c | 6 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 2 +- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 2 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Out.c | 255 +----------------- bootstrap/unix-48/Out.h | 7 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 372 ++++++++------------------- bootstrap/unix-48/Texts.h | 3 +- bootstrap/unix-48/VT100.c | 2 +- bootstrap/unix-48/VT100.h | 2 +- bootstrap/unix-48/extTools.c | 6 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-88/Compiler.c | 4 +- bootstrap/unix-88/Configuration.c | 4 +- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Files.c | 132 +--------- bootstrap/unix-88/Files.h | 15 +- bootstrap/unix-88/Heap.c | 2 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 2 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 65 ++--- bootstrap/unix-88/OPM.h | 3 +- bootstrap/unix-88/OPP.c | 6 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 2 +- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 2 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Out.c | 255 +----------------- bootstrap/unix-88/Out.h | 7 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 372 ++++++++------------------- bootstrap/unix-88/Texts.h | 3 +- bootstrap/unix-88/VT100.c | 2 +- bootstrap/unix-88/VT100.h | 2 +- bootstrap/unix-88/extTools.c | 6 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/windows-48/Compiler.c | 4 +- bootstrap/windows-48/Configuration.c | 4 +- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Files.c | 132 +--------- bootstrap/windows-48/Files.h | 15 +- bootstrap/windows-48/Heap.c | 2 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 2 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 65 ++--- bootstrap/windows-48/OPM.h | 3 +- bootstrap/windows-48/OPP.c | 6 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 2 +- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 2 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Out.c | 255 +----------------- bootstrap/windows-48/Out.h | 7 +- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 372 ++++++++------------------- bootstrap/windows-48/Texts.h | 3 +- bootstrap/windows-48/VT100.c | 2 +- bootstrap/windows-48/VT100.h | 2 +- bootstrap/windows-48/extTools.c | 6 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-88/Compiler.c | 4 +- bootstrap/windows-88/Configuration.c | 4 +- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Files.c | 132 +--------- bootstrap/windows-88/Files.h | 15 +- bootstrap/windows-88/Heap.c | 2 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 2 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 65 ++--- bootstrap/windows-88/OPM.h | 3 +- bootstrap/windows-88/OPP.c | 6 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 2 +- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 2 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Out.c | 255 +----------------- bootstrap/windows-88/Out.h | 7 +- bootstrap/windows-88/Platform.c | 2 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 372 ++++++++------------------- bootstrap/windows-88/Texts.h | 3 +- bootstrap/windows-88/VT100.c | 2 +- bootstrap/windows-88/VT100.h | 2 +- bootstrap/windows-88/extTools.c | 6 +- bootstrap/windows-88/extTools.h | 2 +- 185 files changed, 870 insertions(+), 3740 deletions(-) diff --git a/bootstrap/unix-44/Compiler.c b/bootstrap/unix-44/Compiler.c index d13ed803..993c2bac 100644 --- a/bootstrap/unix-44/Compiler.c +++ b/bootstrap/unix-44/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 @@ -122,7 +122,7 @@ static void Compiler_FindLocalObjectFiles (CHAR *objectnames, ADDRESS objectname Strings_Append((CHAR*)" ", 2, (void*)objectnames, objectnames__len); Strings_Append(fn, 64, (void*)objectnames, objectnames__len); } else { - OPM_LogVT100((CHAR*)"33m", 4); + OPM_LogVT100((CHAR*)"91m", 4); OPM_LogWStr((CHAR*)"Link warning: a local symbol file is present for module ", 57); OPM_LogWStr(l->name, 256); OPM_LogWStr((CHAR*)", but local object file '", 26); diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index eb305bbe..80b87b1d 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index d10b5011..cdc285e5 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 94faa2a1..cd6f14b9 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -69,9 +69,6 @@ static void Files_CloseOSFile (Files_File f); static void Files_Create (Files_File f); export void Files_Delete (CHAR *name, ADDRESS name__len, INT16 *res); static void Files_Deregister (CHAR *name, ADDRESS name__len); -export void Files_DumpBuffer (Files_Buffer b, INT16 indent); -export void Files_DumpFile (Files_File f, INT16 indent); -export void Files_DumpRider (Files_Rider r, INT16 indent); static void Files_Err (CHAR *s, ADDRESS s__len, Files_File f, INT16 errcode); static void Files_Finalize (SYSTEM_PTR o); static void Files_FlipBytes (SYSTEM_BYTE *src, ADDRESS src__len, SYSTEM_BYTE *dest, ADDRESS dest__len); @@ -102,7 +99,6 @@ export void Files_Rename (CHAR *old, ADDRESS old__len, CHAR *new, ADDRESS new__l static void Files_ScanPath (INT16 *pos, CHAR *dir, ADDRESS dir__len); export void Files_Set (Files_Rider *r, ADDRESS *r__typ, Files_File f, INT32 pos); export void Files_SetSearchPath (CHAR *path, ADDRESS path__len); -static void Files_Spaces (INT16 i); export void Files_Write (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE x); export void Files_WriteBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN x); export void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS x__len, INT32 n); @@ -116,132 +112,6 @@ export void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, ADDRESS #define Files_IdxTrap() __HALT(-1) -static void Files_Spaces (INT16 i) -{ - while (i > 0) { - Out_String((CHAR*)" ", 3); - i -= 1; - } -} - -void Files_DumpFile (Files_File f, INT16 indent) -{ - Files_Spaces(indent); - Out_String((CHAR*)"workName: ", 15); - Out_String(f->workName, 101); - Out_Ln(); - Files_Spaces(indent); - Out_String((CHAR*)"registerName: ", 15); - Out_String(f->registerName, 101); - Out_Ln(); - Files_Spaces(indent); - Out_String((CHAR*)"tempFile: ", 15); - if (f->tempFile) { - Out_String((CHAR*)"TRUE", 5); - } else { - Out_String((CHAR*)"FALSE", 6); - } - Out_Ln(); - Files_Spaces(indent); - Out_String((CHAR*)"identity: ", 15); - Out_String((CHAR*)"...", 4); - Out_Ln(); - Files_Spaces(indent); - Out_String((CHAR*)"fd: ", 15); - Out_Int(f->fd, 1); - Out_Ln(); - Files_Spaces(indent); - Out_String((CHAR*)"len, ", 15); - Out_Int(f->len, 1); - Out_Ln(); - Files_Spaces(indent); - Out_String((CHAR*)"pos: ", 15); - Out_Int(f->pos, 1); - Out_Ln(); - Files_Spaces(indent); - Out_String((CHAR*)"bufs: ", 15); - Out_String((CHAR*)"...", 4); - Out_Ln(); - Files_Spaces(indent); - Out_String((CHAR*)"swapper: ", 15); - Out_Int(f->swapper, 1); - Out_Ln(); - Files_Spaces(indent); - Out_String((CHAR*)"state: ", 15); - Out_Int(f->state, 1); - Out_Ln(); - Files_Spaces(indent); - Out_String((CHAR*)"next: ", 15); - Out_Hex((INT32)(ADDRESS)f->next, 1); - Out_Ln(); -} - -void Files_DumpBuffer (Files_Buffer b, INT16 indent) -{ - Files_Spaces(indent); - Out_String((CHAR*)"chg: ", 7); - if (b->chg) { - Out_String((CHAR*)"TRUE", 5); - } else { - Out_String((CHAR*)"FALSE", 6); - } - Out_Ln(); - Files_Spaces(indent); - Out_String((CHAR*)"org: ", 7); - Out_Int(b->org, 1); - Out_Ln(); - Files_Spaces(indent); - Out_String((CHAR*)"size: ", 7); - Out_Int(b->size, 1); - Out_Ln(); - Files_Spaces(indent); - Out_String((CHAR*)"data: ", 7); - Out_Ln(); - Out_HexDump((void*)b->data, 4096); - Files_Spaces(indent); - Out_String((CHAR*)"f: ", 7); - if (b->f == NIL) { - Out_String((CHAR*)"", 6); - Out_Ln(); - } else { - Out_Ln(); - Files_DumpFile(b->f, indent + 1); - } -} - -void Files_DumpRider (Files_Rider r, INT16 indent) -{ - Files_Spaces(indent); - Out_String((CHAR*)"res: ", 9); - Out_Int(r.res, 1); - Out_Ln(); - Files_Spaces(indent); - Out_String((CHAR*)"eof: ", 9); - if (r.eof) { - Out_String((CHAR*)"TRUE", 5); - } else { - Out_String((CHAR*)"FALSE", 6); - } - Out_Ln(); - Files_Spaces(indent); - Out_String((CHAR*)"org: ", 9); - Out_Int(r.org, 1); - Out_Ln(); - Files_Spaces(indent); - Out_String((CHAR*)"offset: ", 9); - Out_Int(r.offset, 1); - Out_Ln(); - Files_Spaces(indent); - Out_String((CHAR*)"buf: ", 9); - if (r.buf == NIL) { - Out_String((CHAR*)"", 6); - Out_Ln(); - } else { - Out_Ln(); - Files_DumpBuffer(r.buf, indent + 1); - } -} - static void Files_Assert (BOOLEAN truth) { if (!truth) { diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index d0b6716f..62563e24 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,19 +1,10 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h #include "SYSTEM.h" -typedef - struct Files_BufDesc { - INT32 _prvt0; - char _prvt1[4108]; - } Files_BufDesc; - -typedef - Files_BufDesc *Files_Buffer; - typedef struct Files_FileDesc *Files_File; @@ -33,16 +24,12 @@ typedef import ADDRESS *Files_FileDesc__typ; -import ADDRESS *Files_BufDesc__typ; import ADDRESS *Files_Rider__typ; import Files_File Files_Base (Files_Rider *r, ADDRESS *r__typ); import void Files_ChangeDirectory (CHAR *path, ADDRESS path__len, INT16 *res); import void Files_Close (Files_File f); import void Files_Delete (CHAR *name, ADDRESS name__len, INT16 *res); -import void Files_DumpBuffer (Files_Buffer b, INT16 indent); -import void Files_DumpFile (Files_File f, INT16 indent); -import void Files_DumpRider (Files_Rider r, INT16 indent); import void Files_GetDate (Files_File f, INT32 *t, INT32 *d); import void Files_GetName (Files_File f, CHAR *name, ADDRESS name__len); import INT32 Files_Length (Files_File f); diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index d6b6560d..c12cb722 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index 87732bb9..de4d17ce 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index c498f106..f397649b 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index f52b30af..8436f089 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index bb4ea138..19e40505 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index 6757803a..71d82def 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 093bb886..a5f41a8e 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index a32c29e0..38a2b01d 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 0fd45dec..8f903e46 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -63,6 +63,7 @@ export void OPM_Init (BOOLEAN *done); export void OPM_InitOptions (void); export INT16 OPM_Integer (INT64 n); static BOOLEAN OPM_IsProbablyInstallDir (CHAR *s, ADDRESS s__len); +export void OPM_LogCompiling (CHAR *modname, ADDRESS modname__len); static void OPM_LogErrMsg (INT16 n); export void OPM_LogVT100 (CHAR *vt100code, ADDRESS vt100code__len); export void OPM_LogW (CHAR ch); @@ -92,7 +93,6 @@ export void OPM_SymWInt (INT64 i); export void OPM_SymWLReal (LONGREAL lr); export void OPM_SymWReal (REAL r); export void OPM_SymWSet (UINT64 s); -static void OPM_VerboseListSizes (void); export void OPM_Write (CHAR ch); export void OPM_WriteHex (INT64 i); export void OPM_WriteInt (INT64 i); @@ -136,6 +136,27 @@ void OPM_LogVT100 (CHAR *vt100code, ADDRESS vt100code__len) __DEL(vt100code); } +void OPM_LogCompiling (CHAR *modname, ADDRESS modname__len) +{ + __DUP(modname, modname__len, CHAR); + OPM_LogWStr((CHAR*)"Compiling ", 11); + OPM_LogWStr(modname, modname__len); + if (__IN(18, OPM_Options, 32)) { + OPM_LogWStr((CHAR*)", s:", 5); + OPM_LogWNum(__ASHL(OPM_ShortintSize, 3), 1); + OPM_LogWStr((CHAR*)" i:", 4); + OPM_LogWNum(__ASHL(OPM_IntegerSize, 3), 1); + OPM_LogWStr((CHAR*)" l:", 4); + OPM_LogWNum(__ASHL(OPM_LongintSize, 3), 1); + OPM_LogWStr((CHAR*)" adr:", 6); + OPM_LogWNum(__ASHL(OPM_AddressSize, 3), 1); + OPM_LogWStr((CHAR*)" algn:", 7); + OPM_LogWNum(__ASHL(OPM_Alignment, 3), 1); + } + OPM_LogW('.'); + __DEL(modname); +} + INT64 OPM_SignedMaximum (INT32 bytecount) { INT64 result; @@ -363,32 +384,6 @@ BOOLEAN OPM_OpenPar (void) __RETCHK; } -static void OPM_VerboseListSizes (void) -{ - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Type Size", 15); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"SHORTINT ", 12); - OPM_LogWNum(OPM_ShortintSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"INTEGER ", 12); - OPM_LogWNum(OPM_IntegerSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"LONGINT ", 12); - OPM_LogWNum(OPM_LongintSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"SET ", 12); - OPM_LogWNum(OPM_LongintSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"ADDRESS ", 12); - OPM_LogWNum(OPM_AddressSize, 4); - OPM_LogWLn(); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Alignment: ", 12); - OPM_LogWNum(OPM_Alignment, 4); - OPM_LogWLn(); -} - void OPM_InitOptions (void) { CHAR s[256]; @@ -432,9 +427,6 @@ void OPM_InitOptions (void) OPM_LongintSize = 4; break; } - if (__IN(18, OPM_Options, 32)) { - OPM_VerboseListSizes(); - } __MOVE(OPM_InstallDir, OPM_ResourceDir, 1024); if (OPM_ResourceDir[0] != 0x00) { Strings_Append((CHAR*)"/", 2, (void*)OPM_ResourceDir, 1024); @@ -491,17 +483,6 @@ void OPM_Get (CHAR *ch) { OPM_curpos = Texts_Pos(&OPM_inR, Texts_Reader__typ); Texts_Read(&OPM_inR, Texts_Reader__typ, &*ch); - if ((OPM_curpos == 0 && OPM_inR.eot)) { - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"DEBUG: OPM.Get returned inR.eot at curpos = 0, ch = ", 53); - OPM_LogWNum((INT16)*ch, 1); - OPM_LogW('.'); - Texts_DumpReader(OPM_inR); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Heap dump:", 11); - OPM_LogWLn(); - Out_DumpHeap(); - } if ((*ch < 0x09 && !OPM_inR.eot)) { *ch = ' '; } diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index f246eacb..96318bea 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h @@ -33,6 +33,7 @@ import void OPM_Get (CHAR *ch); import void OPM_Init (BOOLEAN *done); import void OPM_InitOptions (void); import INT16 OPM_Integer (INT64 n); +import void OPM_LogCompiling (CHAR *modname, ADDRESS modname__len); import void OPM_LogVT100 (CHAR *vt100code, ADDRESS vt100code__len); import void OPM_LogW (CHAR ch); import void OPM_LogWLn (void); diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index c3e79413..ec4ad2be 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -1796,9 +1796,7 @@ void OPP_Module (OPT_Node *prog, UINT32 opt) OPP_err(16); } if (OPP_sym == 38) { - OPM_LogWStr((CHAR*)"compiling ", 11); - OPM_LogWStr(OPS_name, 256); - OPM_LogW('.'); + OPM_LogCompiling(OPS_name, 256); OPT_Init(OPS_name, opt); OPS_Get(&OPP_sym); OPP_CheckSym(39); diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index 913d2eef..aa076aaa 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index abfcd4b8..bf9f1af5 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index 9e15ba4e..09a33705 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index 7bfd4abc..149bfd1b 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index 228191bf..63bf2070 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index e44854e3..8b095ff5 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index ea04b5b8..c6a107b6 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Out.c b/bootstrap/unix-44/Out.c index fc487d97..23d917c7 100644 --- a/bootstrap/unix-44/Out.c +++ b/bootstrap/unix-44/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -14,19 +14,10 @@ export BOOLEAN Out_IsConsole; static CHAR Out_buf[128]; static INT16 Out_in; -static ADDRESS *typedesc__11__typ; -static ADDRESS *blockdesc__5__typ; -static ADDRESS *chunkdesc__7__typ; export void Out_Char (CHAR ch); -export void Out_DumpHeap (void); -static void Out_DumpModule (Heap_Module m); -export void Out_DumpTag (INT32 addr); -export void Out_DumpType (SYSTEM_BYTE *o, ADDRESS o__len); export void Out_Flush (void); export void Out_Hex (INT64 x, INT64 n); -export void Out_HexDump (SYSTEM_BYTE *m, ADDRESS m__len); -export void Out_HexDumpAdr (INT32 adr, INT64 offset, INT32 length); export void Out_Int (INT64 x, INT64 n); static INT32 Out_Length (CHAR *s, ADDRESS s__len); export void Out_Ln (void); @@ -40,8 +31,6 @@ static void Out_digit (INT64 n, CHAR *s, ADDRESS s__len, INT16 *i); static void Out_prepend (CHAR *t, ADDRESS t__len, CHAR *s, ADDRESS s__len, INT16 *i); #define Out_Entier64(x) (INT64)(x) -extern ADDRESS Heap_heap; -#define Out_getheap() Heap_heap void Out_Flush (void) { @@ -139,8 +128,10 @@ void Out_Hex (INT64 x, INT64 n) } else if (n > 16) { n = 16; } - while ((n < 16 && __LSH(x, -__ASHL(n, 2), 64) != 0)) { - n += 1; + if (x >= 0) { + while ((n < 16 && __LSH(x, -__ASHL(n, 2), 64) != 0)) { + n += 1; + } } x = __ROT(x, __ASHL(16 - n, 2), 64); while (n > 0) { @@ -160,235 +151,6 @@ void Out_Ln (void) Out_Flush(); } -void Out_HexDumpAdr (INT32 adr, INT64 offset, INT32 length) -{ - INT16 i; - INT32 n, lim; - CHAR c; - lim = (INT32)(adr + length); - while (adr < lim) { - if (adr + 16 < lim) { - n = 16; - } else { - n = lim - adr; - } - Out_Hex(offset, 8); - Out_Char(' '); - i = 0; - while (i < n) { - if (__MASK(i, -4) == 0) { - Out_Char(' '); - } - __GET(adr + i, c, CHAR); - Out_Hex((INT16)c, 2); - Out_Char(' '); - i += 1; - } - while (i < 16) { - if (__MASK(i, -4) == 0) { - Out_Char(' '); - } - Out_String((CHAR*)" ", 4); - i += 1; - } - Out_String((CHAR*)" ", 2); - i = 0; - while (i < n) { - __GET(adr + i, c, CHAR); - if ((INT16)c < 32 || (INT16)c > 126) { - Out_Char('.'); - } else { - Out_Char(c); - } - i += 1; - } - adr += n; - offset += (INT64)n; - Out_Ln(); - } -} - -void Out_HexDump (SYSTEM_BYTE *m, ADDRESS m__len) -{ - Out_HexDumpAdr((ADDRESS)m, 0, m__len); -} - -static void Out_DumpModule (Heap_Module m) -{ - Out_String((CHAR*)" next: ", 19); - Out_Hex((INT32)(ADDRESS)m->next, 1); - Out_Ln(); - Out_String((CHAR*)" name: ", 19); - Out_String(m->name, 20); - Out_Ln(); - Out_String((CHAR*)" refcnt: ", 19); - Out_Hex(m->refcnt, 1); - Out_Ln(); - Out_String((CHAR*)" cmds: ", 19); - Out_Hex((INT32)(ADDRESS)m->cmds, 1); - Out_Ln(); - Out_String((CHAR*)" types: ", 19); - Out_Hex(m->types, 1); - Out_Ln(); - Out_String((CHAR*)" enumPtrs: ", 19); - Out_Hex((INT32)(ADDRESS)m->enumPtrs, 1); - Out_Ln(); -} - -typedef - struct typedesc__11 *tag__10; - -typedef - struct typedesc__11 { - INT32 tag, next, level, module; - CHAR name[24]; - INT32 bases[16]; - INT32 reserved, blksz, ptr0; - } typedesc__11; - -void Out_DumpTag (INT32 addr) -{ - tag__10 desc = NIL; - INT16 i; - Out_String((CHAR*)" obj tag: ", 17); - Out_Hex(addr, 1); - Out_Ln(); - addr -= __MASK(addr, -2); - desc = (tag__10)(ADDRESS)(addr - 108); - Out_String((CHAR*)" desc at: ", 17); - Out_Hex((INT32)(ADDRESS)desc, 1); - Out_Ln(); - Out_String((CHAR*)" desc contains:", 21); - Out_Ln(); - Out_String((CHAR*)" tag: ", 17); - Out_Hex(desc->tag, 1); - Out_Ln(); - Out_String((CHAR*)" next: ", 17); - Out_Hex(desc->next, 1); - Out_Ln(); - Out_String((CHAR*)" level: ", 17); - Out_Hex(desc->level, 1); - Out_Ln(); - Out_String((CHAR*)" module: ", 17); - Out_Hex(desc->module, 1); - Out_Ln(); - if (desc->module != 0) { - Out_DumpModule((Heap_Module)(ADDRESS)desc->module); - } - Out_String((CHAR*)" name: ", 17); - Out_String(desc->name, 24); - Out_Ln(); - Out_String((CHAR*)" bases: ", 17); - i = 0; - while (i < 16) { - Out_Hex(desc->bases[__X(i, 16)], 8); - if (__MASK(i, -4) == 3) { - Out_Ln(); - Out_String((CHAR*)" ", 17); - } else { - Out_Char(' '); - } - i += 1; - } - Out_Ln(); - Out_String((CHAR*)" reserved: ", 17); - Out_Hex(desc->reserved, 1); - Out_Ln(); - Out_String((CHAR*)" blksz: ", 17); - Out_Hex(desc->blksz, 1); - Out_Ln(); - Out_String((CHAR*)" ptr0: ", 17); - Out_Hex(desc->ptr0, 1); - Out_Ln(); -} - -void Out_DumpType (SYSTEM_BYTE *o, ADDRESS o__len) -{ - INT32 addr; - __GET((ADDRESS)o - 4, addr, INT32); - Out_DumpTag(addr); -} - -typedef - INT32 (*adrptr__3)[1]; - -typedef - struct blockdesc__5 *block__4; - -typedef - struct blockdesc__5 { - INT32 tag, size, sentinel, next; - } blockdesc__5; - -typedef - struct chunkdesc__7 *chunk__6; - -typedef - struct chunkdesc__7 { - INT32 next, end, reserved; - blockdesc__5 firstblock; - } chunkdesc__7; - -void Out_DumpHeap (void) -{ - INT32 caddr; - chunk__6 c = NIL; - INT32 baddr; - block__4 b = NIL; - adrptr__3 tag = NIL; - caddr = Heap_heap; - while (caddr != 0) { - Out_String((CHAR*)"Chunk at: ", 11); - Out_Hex(caddr, 1); - Out_Ln(); - c = (chunk__6)(ADDRESS)caddr; - Out_String((CHAR*)" next: ", 11); - Out_Hex(c->next, 1); - Out_Ln(); - Out_String((CHAR*)" end: ", 11); - Out_Hex(c->end, 1); - Out_String((CHAR*)" => size: ", 11); - Out_Hex(c->end - caddr, 1); - Out_Ln(); - Out_String((CHAR*)" rsvd: ", 11); - Out_Hex(c->reserved, 1); - Out_Ln(); - baddr = (ADDRESS)&c->firstblock; - while (c->end - baddr > 0) { - Out_String((CHAR*)" Block at: ", 15); - Out_Hex(baddr, 1); - Out_Ln(); - b = (block__4)(ADDRESS)baddr; - tag = (adrptr__3)(ADDRESS)(b->tag - __MASK(b->tag, -2)); - Out_String((CHAR*)" tag: ", 15); - Out_Hex(b->tag, 1); - if (__MASK(b->tag, -2) != 0) { - Out_String((CHAR*)" <--- ODD! ---", 15); - } - Out_Ln(); - Out_String((CHAR*)" tag^: ", 15); - Out_Hex((*tag)[0], 1); - Out_Ln(); - Out_String((CHAR*)" size: ", 15); - Out_Hex(b->size, 1); - Out_Ln(); - Out_String((CHAR*)" sentinel: ", 15); - Out_Hex(b->sentinel, 1); - Out_Ln(); - Out_String((CHAR*)" next: ", 15); - Out_Hex(b->next, 1); - Out_Ln(); - if (b->tag != (ADDRESS)&b->size) { - Out_DumpTag(b->tag); - } - baddr += (*tag)[0]; - Out_Ln(); - } - caddr = c->next; - Out_Ln(); - } -} - static void Out_digit (INT64 n, CHAR *s, ADDRESS s__len, INT16 *i) { *i -= 1; @@ -566,9 +328,6 @@ void Out_LongReal (LONGREAL x, INT16 n) Out_RealP(x, n, 1); } -__TDESC(typedesc__11, 1, 0) = {__TDFLDS("typedesc__11", 116), {-4}}; -__TDESC(blockdesc__5, 1, 0) = {__TDFLDS("blockdesc__5", 16), {-4}}; -__TDESC(chunkdesc__7, 1, 0) = {__TDFLDS("chunkdesc__7", 28), {-4}}; export void *Out__init(void) { @@ -576,13 +335,9 @@ export void *Out__init(void) __MODULE_IMPORT(Heap); __MODULE_IMPORT(Platform); __REGMOD("Out", 0); - __REGCMD("DumpHeap", Out_DumpHeap); __REGCMD("Flush", Out_Flush); __REGCMD("Ln", Out_Ln); __REGCMD("Open", Out_Open); - __INITYP(typedesc__11, typedesc__11, 0); - __INITYP(blockdesc__5, blockdesc__5, 0); - __INITYP(chunkdesc__7, chunkdesc__7, 0); /* BEGIN */ Out_IsConsole = Platform_IsConsole(1); Out_in = 0; diff --git a/bootstrap/unix-44/Out.h b/bootstrap/unix-44/Out.h index cbb4de1a..e1285046 100644 --- a/bootstrap/unix-44/Out.h +++ b/bootstrap/unix-44/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h @@ -10,13 +10,8 @@ import BOOLEAN Out_IsConsole; import void Out_Char (CHAR ch); -import void Out_DumpHeap (void); -import void Out_DumpTag (INT32 addr); -import void Out_DumpType (SYSTEM_BYTE *o, ADDRESS o__len); import void Out_Flush (void); import void Out_Hex (INT64 x, INT64 n); -import void Out_HexDump (SYSTEM_BYTE *m, ADDRESS m__len); -import void Out_HexDumpAdr (INT32 adr, INT64 offset, INT32 length); import void Out_Int (INT64 x, INT64 n); import void Out_Ln (void); import void Out_LongReal (LONGREAL x, INT16 n); diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index b646e8b7..fa5fada1 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index 957af90d..0b98d7bb 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 9b449f98..d1eb72f6 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index 3e83af42..170d1785 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index f9b5310a..225bd40a 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index 58f9b546..4d98f1a3 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index bb00d7d0..a6913b51 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -192,11 +192,6 @@ export void Texts_Close (Texts_Text T, CHAR *name, ADDRESS name__len); export void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); export void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); export void Texts_Delete (Texts_Text T, INT32 beg, INT32 end); -static void Texts_DumpElem (Texts_Elem e); -static void Texts_DumpPiece (Texts_Piece p); -export void Texts_DumpReader (Texts_Reader re); -static void Texts_DumpRun (Texts_Run ru); -static void Texts_DumpText (Texts_Text t); export Texts_Text Texts_ElemBase (Texts_Elem E); export INT32 Texts_ElemPos (Texts_Elem E); static void Texts_Find (Texts_Text T, INT32 *pos, Texts_Run *u, INT32 *org, INT32 *off); @@ -238,161 +233,6 @@ export void Texts_WriteRealHex (Texts_Writer *W, ADDRESS *W__typ, REAL x); export void Texts_WriteString (Texts_Writer *W, ADDRESS *W__typ, CHAR *s, ADDRESS s__len); -static void Texts_DumpText (Texts_Text t) -{ - Out_String((CHAR*)" len: ", 15); - Out_Int(t->len, 1); - Out_Ln(); - Out_String((CHAR*)" notify: ", 15); - Out_Hex((INT32)(ADDRESS)t->notify, 1); - Out_Ln(); - Out_String((CHAR*)" head: ", 15); - Out_Hex((INT32)(ADDRESS)t->head, 1); - Out_Ln(); - Out_String((CHAR*)" cache: ", 15); - Out_Hex((INT32)(ADDRESS)t->cache, 1); - Out_Ln(); - Out_String((CHAR*)" corg: ", 15); - Out_Int(t->corg, 1); - Out_Ln(); -} - -static void Texts_DumpRun (Texts_Run ru) -{ - Out_String((CHAR*)" Run at ", 12); - Out_Hex((INT32)(ADDRESS)ru, 1); - Out_Ln(); - Out_String((CHAR*)" prev: ", 12); - Out_Hex((INT32)(ADDRESS)ru->prev, 1); - Out_Ln(); - Out_String((CHAR*)" next: ", 12); - Out_Hex((INT32)(ADDRESS)ru->next, 1); - Out_Ln(); - Out_String((CHAR*)" len: ", 12); - Out_Int(ru->len, 1); - Out_Ln(); - Out_String((CHAR*)" fnt: ", 12); - if (ru->fnt != NIL) { - Out_String(ru->fnt->name, 32); - } else { - Out_String((CHAR*)"", 6); - } - Out_Ln(); - Out_String((CHAR*)" col: ", 12); - Out_Int(ru->col, 1); - Out_Ln(); - Out_String((CHAR*)" voff: ", 12); - Out_Int(ru->voff, 1); - Out_Ln(); - Out_String((CHAR*)" ascii: ", 12); - if (ru->ascii) { - Out_String((CHAR*)"TRUE", 5); - } else { - Out_String((CHAR*)"FALSE", 6); - } - Out_Ln(); -} - -static void Texts_DumpElem (Texts_Elem e) -{ - Texts_DumpRun((void*)e); - Out_String((CHAR*)" -- Elem --", 15); - Out_Ln(); - Out_String((CHAR*)" W: ", 13); - Out_Int(e->W, 1); - Out_Ln(); - Out_String((CHAR*)" H: ", 13); - Out_Int(e->H, 1); - Out_Ln(); - Out_String((CHAR*)" handle: ", 13); - Out_Hex((INT32)(ADDRESS)e->handle, 1); - Out_Ln(); - Out_String((CHAR*)" base: ", 13); - if (e->base == NIL) { - Out_String((CHAR*)"", 6); - Out_Ln(); - } else { - Out_Ln(); - Texts_DumpText(e->base); - } -} - -static void Texts_DumpPiece (Texts_Piece p) -{ - Texts_DumpRun((void*)p); - Out_String((CHAR*)" -- Piece --", 16); - Out_Ln(); - Out_String((CHAR*)" file: ", 12); - if (p->file == NIL) { - Out_String((CHAR*)"", 6); - Out_Ln(); - } else { - Out_Ln(); - Files_DumpFile(p->file, 3); - } - Out_String((CHAR*)" org: ", 12); - Out_Int(p->org, 1); - Out_Ln(); -} - -void Texts_DumpReader (Texts_Reader re) -{ - Out_String((CHAR*)"Reader:", 8); - Out_Ln(); - Out_String((CHAR*)" eot: ", 10); - if (re.eot) { - Out_String((CHAR*)"TRUE", 5); - } else { - Out_String((CHAR*)"FALSE", 6); - } - Out_Ln(); - Out_String((CHAR*)" fnt: ", 10); - if (re.fnt != NIL) { - Out_String(re.fnt->name, 32); - } else { - Out_String((CHAR*)"", 6); - } - Out_Ln(); - Out_String((CHAR*)" col: ", 10); - Out_Int(re.col, 1); - Out_Ln(); - Out_String((CHAR*)" voff: ", 10); - Out_Int(re.voff, 1); - Out_Ln(); - Out_String((CHAR*)" org: ", 10); - Out_Int(re.org, 1); - Out_Ln(); - Out_String((CHAR*)" off: ", 10); - Out_Int(re.off, 1); - Out_Ln(); - Out_String((CHAR*)" elem: ", 10); - if (re.elem == NIL) { - Out_String((CHAR*)"", 6); - Out_Ln(); - } else { - Out_Ln(); - Texts_DumpElem(re.elem); - } - Out_String((CHAR*)" rider: ", 10); - Out_Ln(); - Files_DumpRider(re.rider, 2); - Out_String((CHAR*)" run: ", 10); - if (re.run == NIL) { - Out_String((CHAR*)"", 6); - Out_Ln(); - } else { - Out_Ln(); - if (__ISP(re.run, Texts_PieceDesc, 1)) { - Texts_DumpPiece(__GUARDP(re.run, Texts_PieceDesc, 1)); - } else if (__ISP(re.run, Texts_ElemDesc, 1)) { - Texts_DumpElem(__GUARDP(re.run, Texts_ElemDesc, 1)); - } else { - Texts_DumpRun(re.run); - } - } - Out_DumpType((void*)&*re.run, 20); -} - static Texts_FontsFont Texts_FontsThis (CHAR *name, ADDRESS name__len) { Texts_FontsFont F = NIL; @@ -877,32 +717,32 @@ void Texts_OpenScanner (Texts_Scanner *S, ADDRESS *S__typ, Texts_Text T, INT32 p (*S).nextCh = ' '; } -static struct Scan__36 { +static struct Scan__31 { Texts_Scanner *S; ADDRESS *S__typ; CHAR *ch; BOOLEAN *negE; INT16 *e; - struct Scan__36 *lnk; -} *Scan__36_s; + struct Scan__31 *lnk; +} *Scan__31_s; -static void ReadScaleFactor__37 (void); +static void ReadScaleFactor__32 (void); -static void ReadScaleFactor__37 (void) +static void ReadScaleFactor__32 (void) { - Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); - if (*Scan__36_s->ch == '-') { - *Scan__36_s->negE = 1; - Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); + Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); + if (*Scan__31_s->ch == '-') { + *Scan__31_s->negE = 1; + Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); } else { - *Scan__36_s->negE = 0; - if (*Scan__36_s->ch == '+') { - Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); + *Scan__31_s->negE = 0; + if (*Scan__31_s->ch == '+') { + Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); } } - while (('0' <= *Scan__36_s->ch && *Scan__36_s->ch <= '9')) { - *Scan__36_s->e = (*Scan__36_s->e * 10 + (INT16)*Scan__36_s->ch) - 48; - Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); + while (('0' <= *Scan__31_s->ch && *Scan__31_s->ch <= '9')) { + *Scan__31_s->e = (*Scan__31_s->e * 10 + (INT16)*Scan__31_s->ch) - 48; + Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); } } @@ -916,13 +756,13 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) REAL x, f; LONGREAL y, g; CHAR d[32]; - struct Scan__36 _s; + struct Scan__31 _s; _s.S = S; _s.S__typ = S__typ; _s.ch = &ch; _s.negE = &negE; _s.e = &e; - _s.lnk = Scan__36_s; - Scan__36_s = &_s; + _s.lnk = Scan__31_s; + Scan__31_s = &_s; ch = (*S).nextCh; i = 0; for (;;) { @@ -1023,7 +863,7 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) y = ((INT16)d[__X(j, 32)] - 48) * g + y; j += 1; } - ReadScaleFactor__37(); + ReadScaleFactor__32(); if (negE) { if (e <= 308) { y = y / (LONGREAL)Reals_TenL(e); @@ -1056,7 +896,7 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) j += 1; } if (ch == 'E') { - ReadScaleFactor__37(); + ReadScaleFactor__32(); } if (negE) { if (e <= 38) { @@ -1109,7 +949,7 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) } } (*S).nextCh = ch; - Scan__36_s = _s.lnk; + Scan__31_s = _s.lnk; } void Texts_OpenWriter (Texts_Writer *W, ADDRESS *W__typ) @@ -1328,30 +1168,30 @@ void Texts_WriteReal (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n) } } -static struct WriteRealFix__58 { +static struct WriteRealFix__53 { Texts_Writer *W; ADDRESS *W__typ; INT16 *i; CHAR (*d)[9]; - struct WriteRealFix__58 *lnk; -} *WriteRealFix__58_s; + struct WriteRealFix__53 *lnk; +} *WriteRealFix__53_s; -static void dig__59 (INT16 n); -static void seq__61 (CHAR ch, INT16 n); +static void dig__54 (INT16 n); +static void seq__56 (CHAR ch, INT16 n); -static void seq__61 (CHAR ch, INT16 n) +static void seq__56 (CHAR ch, INT16 n) { while (n > 0) { - Texts_Write(&*WriteRealFix__58_s->W, WriteRealFix__58_s->W__typ, ch); + Texts_Write(&*WriteRealFix__53_s->W, WriteRealFix__53_s->W__typ, ch); n -= 1; } } -static void dig__59 (INT16 n) +static void dig__54 (INT16 n) { while (n > 0) { - *WriteRealFix__58_s->i -= 1; - Texts_Write(&*WriteRealFix__58_s->W, WriteRealFix__58_s->W__typ, (*WriteRealFix__58_s->d)[__X(*WriteRealFix__58_s->i, 9)]); + *WriteRealFix__53_s->i -= 1; + Texts_Write(&*WriteRealFix__53_s->W, WriteRealFix__53_s->W__typ, (*WriteRealFix__53_s->d)[__X(*WriteRealFix__53_s->i, 9)]); n -= 1; } } @@ -1362,23 +1202,23 @@ void Texts_WriteRealFix (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n, INT1 CHAR sign; REAL x0; CHAR d[9]; - struct WriteRealFix__58 _s; + struct WriteRealFix__53 _s; _s.W = W; _s.W__typ = W__typ; _s.i = &i; _s.d = (void*)d; - _s.lnk = WriteRealFix__58_s; - WriteRealFix__58_s = &_s; + _s.lnk = WriteRealFix__53_s; + WriteRealFix__53_s = &_s; e = Reals_Expo(x); if (k < 0) { k = 0; } if (e == 0) { - seq__61(' ', (n - k) - 2); + seq__56(' ', (n - k) - 2); Texts_Write(&*W, W__typ, '0'); - seq__61(' ', k + 1); + seq__56(' ', k + 1); } else if (e == 255) { Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", 5); - seq__61(' ', n - 4); + seq__56(' ', n - 4); } else { e = __ASHR((e - 127) * 77, 8); if (x < (REAL)0) { @@ -1411,21 +1251,21 @@ void Texts_WriteRealFix (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n, INT1 i = k + e; Reals_Convert(x, i, (void*)d, 9); if (e > 0) { - seq__61(' ', ((n - e) - k) - 2); + seq__56(' ', ((n - e) - k) - 2); Texts_Write(&*W, W__typ, sign); - dig__59(e); + dig__54(e); Texts_Write(&*W, W__typ, '.'); - dig__59(k); + dig__54(k); } else { - seq__61(' ', (n - k) - 3); + seq__56(' ', (n - k) - 3); Texts_Write(&*W, W__typ, sign); Texts_Write(&*W, W__typ, '0'); Texts_Write(&*W, W__typ, '.'); - seq__61('0', -e); - dig__59(k + e); + seq__56('0', -e); + dig__54(k + e); } } - WriteRealFix__58_s = _s.lnk; + WriteRealFix__53_s = _s.lnk; } void Texts_WriteRealHex (Texts_Writer *W, ADDRESS *W__typ, REAL x) @@ -1524,48 +1364,48 @@ void Texts_WriteLongRealHex (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x) } while (!(i == 16)); } -static struct WriteDate__48 { +static struct WriteDate__43 { Texts_Writer *W; ADDRESS *W__typ; - struct WriteDate__48 *lnk; -} *WriteDate__48_s; + struct WriteDate__43 *lnk; +} *WriteDate__43_s; -static void WritePair__49 (CHAR ch, INT32 x); +static void WritePair__44 (CHAR ch, INT32 x); -static void WritePair__49 (CHAR ch, INT32 x) +static void WritePair__44 (CHAR ch, INT32 x) { - Texts_Write(&*WriteDate__48_s->W, WriteDate__48_s->W__typ, ch); - Texts_Write(&*WriteDate__48_s->W, WriteDate__48_s->W__typ, (CHAR)(__DIV(x, 10) + 48)); - Texts_Write(&*WriteDate__48_s->W, WriteDate__48_s->W__typ, (CHAR)((int)__MOD(x, 10) + 48)); + Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, ch); + Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)(__DIV(x, 10) + 48)); + Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)((int)__MOD(x, 10) + 48)); } void Texts_WriteDate (Texts_Writer *W, ADDRESS *W__typ, INT32 t, INT32 d) { - struct WriteDate__48 _s; + struct WriteDate__43 _s; _s.W = W; _s.W__typ = W__typ; - _s.lnk = WriteDate__48_s; - WriteDate__48_s = &_s; - WritePair__49(' ', __MASK(d, -32)); - WritePair__49('.', __MASK(__ASHR(d, 5), -16)); - WritePair__49('.', __MASK(__ASHR(d, 9), -128)); - WritePair__49(' ', __MASK(__ASHR(t, 12), -32)); - WritePair__49(':', __MASK(__ASHR(t, 6), -64)); - WritePair__49(':', __MASK(t, -64)); - WriteDate__48_s = _s.lnk; + _s.lnk = WriteDate__43_s; + WriteDate__43_s = &_s; + WritePair__44(' ', __MASK(d, -32)); + WritePair__44('.', __MASK(__ASHR(d, 5), -16)); + WritePair__44('.', __MASK(__ASHR(d, 9), -128)); + WritePair__44(' ', __MASK(__ASHR(t, 12), -32)); + WritePair__44(':', __MASK(__ASHR(t, 6), -64)); + WritePair__44(':', __MASK(t, -64)); + WriteDate__43_s = _s.lnk; } -static struct Load0__21 { +static struct Load0__16 { Texts_Text *T; INT8 *ecnt; Files_File *f; Texts_FileMsg *msg; CHAR (*mods)[64][32], (*procs)[64][32]; - struct Load0__21 *lnk; -} *Load0__21_s; + struct Load0__16 *lnk; +} *Load0__16_s; -static void LoadElem__22 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e); +static void LoadElem__17 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e); -static void LoadElem__22 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e) +static void LoadElem__17 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e) { Heap_Module M = NIL; Heap_Command Cmd; @@ -1576,15 +1416,15 @@ static void LoadElem__22 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span Files_ReadLInt(&*r, r__typ, &ew); Files_ReadLInt(&*r, r__typ, &eh); Files_Read(&*r, r__typ, (void*)&eno); - if (eno > *Load0__21_s->ecnt) { - *Load0__21_s->ecnt = eno; - Files_ReadString(&*r, r__typ, (void*)(*Load0__21_s->mods)[__X(eno, 64)], 32); - Files_ReadString(&*r, r__typ, (void*)(*Load0__21_s->procs)[__X(eno, 64)], 32); + if (eno > *Load0__16_s->ecnt) { + *Load0__16_s->ecnt = eno; + Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->mods)[__X(eno, 64)], 32); + Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->procs)[__X(eno, 64)], 32); } org = Files_Pos(&*r, r__typ); - M = Modules_ThisMod((*Load0__21_s->mods)[__X(eno, 64)], 32); + M = Modules_ThisMod((*Load0__16_s->mods)[__X(eno, 64)], 32); if (M != NIL) { - Cmd = Modules_ThisCommand(M, (*Load0__21_s->procs)[__X(eno, 64)], 32); + Cmd = Modules_ThisCommand(M, (*Load0__16_s->procs)[__X(eno, 64)], 32); if (Cmd != NIL) { (*Cmd)(); } @@ -1593,25 +1433,25 @@ static void LoadElem__22 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span if (*e != NIL) { (*e)->W = ew; (*e)->H = eh; - (*e)->base = *Load0__21_s->T; - (*Load0__21_s->msg).pos = pos; - (*(*e)->handle)(*e, (void*)&*Load0__21_s->msg, Texts_FileMsg__typ); + (*e)->base = *Load0__16_s->T; + (*Load0__16_s->msg).pos = pos; + (*(*e)->handle)(*e, (void*)&*Load0__16_s->msg, Texts_FileMsg__typ); if (Files_Pos(&*r, r__typ) != org + span) { *e = NIL; } } if (*e == NIL) { - Files_Set(&*r, r__typ, *Load0__21_s->f, org + span); + Files_Set(&*r, r__typ, *Load0__16_s->f, org + span); __NEW(a, Texts__1); a->W = ew; a->H = eh; a->handle = Texts_HandleAlien; - a->base = *Load0__21_s->T; - a->file = *Load0__21_s->f; + a->base = *Load0__16_s->T; + a->file = *Load0__16_s->f; a->org = org; a->span = span; - __COPY((*Load0__21_s->mods)[__X(eno, 64)], a->mod, 32); - __COPY((*Load0__21_s->procs)[__X(eno, 64)], a->proc, 32); + __COPY((*Load0__16_s->mods)[__X(eno, 64)], a->mod, 32); + __COPY((*Load0__16_s->procs)[__X(eno, 64)], a->proc, 32); *e = (Texts_Elem)a; } } @@ -1628,15 +1468,15 @@ static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) CHAR mods[64][32], procs[64][32]; CHAR name[32]; Texts_FontsFont fnts[32]; - struct Load0__21 _s; + struct Load0__16 _s; _s.T = &T; _s.ecnt = &ecnt; _s.f = &f; _s.msg = &msg; _s.mods = (void*)mods; _s.procs = (void*)procs; - _s.lnk = Load0__21_s; - Load0__21_s = &_s; + _s.lnk = Load0__16_s; + Load0__16_s = &_s; pos = Files_Pos(&*r, r__typ); f = Files_Base(&*r, r__typ); __NEW(u, Texts_RunDesc); @@ -1669,7 +1509,7 @@ static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) un = (Texts_Run)p; un->len = plen; } else { - LoadElem__22(&msg.r, Files_Rider__typ, pos - org, -plen, &e); + LoadElem__17(&msg.r, Files_Rider__typ, pos - org, -plen, &e); un = (Texts_Run)e; un->len = 1; } @@ -1687,7 +1527,7 @@ static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) T->corg = 0; Files_ReadLInt(&msg.r, Files_Rider__typ, &T->len); Files_Set(&*r, r__typ, f, Files_Pos(&msg.r, Files_Rider__typ) + T->len); - Load0__21_s = _s.lnk; + Load0__16_s = _s.lnk; } void Texts_Load (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) @@ -1756,25 +1596,25 @@ void Texts_Open (Texts_Text T, CHAR *name, ADDRESS name__len) __DEL(name); } -static struct Store__44 { +static struct Store__39 { INT8 *ecnt; Texts_FileMsg *msg; Texts_IdentifyMsg *iden; CHAR (*mods)[64][32], (*procs)[64][32]; - struct Store__44 *lnk; -} *Store__44_s; + struct Store__39 *lnk; +} *Store__39_s; -static void StoreElem__45 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e); +static void StoreElem__40 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e); -static void StoreElem__45 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e) +static void StoreElem__40 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e) { Files_Rider r1; INT32 org, span; INT8 eno; - __COPY((*Store__44_s->iden).mod, (*Store__44_s->mods)[__X(*Store__44_s->ecnt, 64)], 32); - __COPY((*Store__44_s->iden).proc, (*Store__44_s->procs)[__X(*Store__44_s->ecnt, 64)], 32); + __COPY((*Store__39_s->iden).mod, (*Store__39_s->mods)[__X(*Store__39_s->ecnt, 64)], 32); + __COPY((*Store__39_s->iden).proc, (*Store__39_s->procs)[__X(*Store__39_s->ecnt, 64)], 32); eno = 1; - while (__STRCMP((*Store__44_s->mods)[__X(eno, 64)], (*Store__44_s->iden).mod) != 0 || __STRCMP((*Store__44_s->procs)[__X(eno, 64)], (*Store__44_s->iden).proc) != 0) { + while (__STRCMP((*Store__39_s->mods)[__X(eno, 64)], (*Store__39_s->iden).mod) != 0 || __STRCMP((*Store__39_s->procs)[__X(eno, 64)], (*Store__39_s->iden).proc) != 0) { eno += 1; } Files_Set(&r1, Files_Rider__typ, Files_Base(&*r, r__typ), Files_Pos(&*r, r__typ)); @@ -1782,14 +1622,14 @@ static void StoreElem__45 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Ele Files_WriteLInt(&*r, r__typ, 0); Files_WriteLInt(&*r, r__typ, 0); Files_Write(&*r, r__typ, eno); - if (eno == *Store__44_s->ecnt) { - *Store__44_s->ecnt += 1; - Files_WriteString(&*r, r__typ, (*Store__44_s->iden).mod, 32); - Files_WriteString(&*r, r__typ, (*Store__44_s->iden).proc, 32); + if (eno == *Store__39_s->ecnt) { + *Store__39_s->ecnt += 1; + Files_WriteString(&*r, r__typ, (*Store__39_s->iden).mod, 32); + Files_WriteString(&*r, r__typ, (*Store__39_s->iden).proc, 32); } - (*Store__44_s->msg).pos = pos; + (*Store__39_s->msg).pos = pos; org = Files_Pos(&*r, r__typ); - (*e->handle)(e, (void*)&*Store__44_s->msg, Texts_FileMsg__typ); + (*e->handle)(e, (void*)&*Store__39_s->msg, Texts_FileMsg__typ); span = Files_Pos(&*r, r__typ) - org; Files_WriteLInt(&r1, Files_Rider__typ, -span); Files_WriteLInt(&r1, Files_Rider__typ, e->W); @@ -1810,14 +1650,14 @@ void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) CHAR mods[64][32], procs[64][32]; Texts_FontsFont fnts[32]; CHAR block[1024]; - struct Store__44 _s; + struct Store__39 _s; _s.ecnt = &ecnt; _s.msg = &msg; _s.iden = &iden; _s.mods = (void*)mods; _s.procs = (void*)procs; - _s.lnk = Store__44_s; - Store__44_s = &_s; + _s.lnk = Store__39_s; + Store__39_s = &_s; org = Files_Pos(&*r, r__typ); msg.id = 1; msg.r = *r; @@ -1859,7 +1699,7 @@ void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) pos += rlen; u = un; } else if (iden.mod[0] != 0x00) { - StoreElem__45(&msg.r, Files_Rider__typ, pos, __GUARDP(u, Texts_ElemDesc, 1)); + StoreElem__40(&msg.r, Files_Rider__typ, pos, __GUARDP(u, Texts_ElemDesc, 1)); pos += 1; u = u->next; } else { @@ -1913,7 +1753,7 @@ void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) if (T->notify != NIL) { (*T->notify)(T, 3, 0, 0); } - Store__44_s = _s.lnk; + Store__39_s = _s.lnk; } void Texts_Close (Texts_Text T, CHAR *name, ADDRESS name__len) diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index cab12269..bad71689 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h @@ -134,7 +134,6 @@ import void Texts_Close (Texts_Text T, CHAR *name, ADDRESS name__len); import void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); import void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); import void Texts_Delete (Texts_Text T, INT32 beg, INT32 end); -import void Texts_DumpReader (Texts_Reader re); import Texts_Text Texts_ElemBase (Texts_Elem E); import INT32 Texts_ElemPos (Texts_Elem E); import void Texts_Insert (Texts_Text T, INT32 pos, Texts_Buffer B); diff --git a/bootstrap/unix-44/VT100.c b/bootstrap/unix-44/VT100.c index 80457921..9cd5cf4d 100644 --- a/bootstrap/unix-44/VT100.c +++ b/bootstrap/unix-44/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/VT100.h b/bootstrap/unix-44/VT100.h index 1a589c43..8f60c652 100644 --- a/bootstrap/unix-44/VT100.h +++ b/bootstrap/unix-44/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index 46b1acc2..fa840303 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -82,7 +82,7 @@ void extTools_Assemble (CHAR *moduleName, ADDRESS moduleName__len) Strings_Append((CHAR*)"-c ", 4, (void*)cmd, 1023); Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); Strings_Append((CHAR*)".c", 3, (void*)cmd, 1023); - extTools_execute((CHAR*)"Assemble: ", 11, cmd, 1023); + extTools_execute((CHAR*)"C compile: ", 12, cmd, 1023); __DEL(moduleName); } @@ -106,7 +106,7 @@ void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN stati Strings_Append((CHAR*)"-O", 3, (void*)cmd, 1023); Strings_Append(OPM_Model, 10, (void*)cmd, 1023); Strings_Append((CHAR*)"", 1, (void*)cmd, 1023); - extTools_execute((CHAR*)"Assemble and link: ", 20, cmd, 1023); + extTools_execute((CHAR*)"C compile and link: ", 21, cmd, 1023); __DEL(additionalopts); } diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index 4201df04..a93b6c85 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/Compiler.c b/bootstrap/unix-48/Compiler.c index d13ed803..993c2bac 100644 --- a/bootstrap/unix-48/Compiler.c +++ b/bootstrap/unix-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 @@ -122,7 +122,7 @@ static void Compiler_FindLocalObjectFiles (CHAR *objectnames, ADDRESS objectname Strings_Append((CHAR*)" ", 2, (void*)objectnames, objectnames__len); Strings_Append(fn, 64, (void*)objectnames, objectnames__len); } else { - OPM_LogVT100((CHAR*)"33m", 4); + OPM_LogVT100((CHAR*)"91m", 4); OPM_LogWStr((CHAR*)"Link warning: a local symbol file is present for module ", 57); OPM_LogWStr(l->name, 256); OPM_LogWStr((CHAR*)", but local object file '", 26); diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index eb305bbe..80b87b1d 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index d10b5011..cdc285e5 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 94faa2a1..cd6f14b9 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -69,9 +69,6 @@ static void Files_CloseOSFile (Files_File f); static void Files_Create (Files_File f); export void Files_Delete (CHAR *name, ADDRESS name__len, INT16 *res); static void Files_Deregister (CHAR *name, ADDRESS name__len); -export void Files_DumpBuffer (Files_Buffer b, INT16 indent); -export void Files_DumpFile (Files_File f, INT16 indent); -export void Files_DumpRider (Files_Rider r, INT16 indent); static void Files_Err (CHAR *s, ADDRESS s__len, Files_File f, INT16 errcode); static void Files_Finalize (SYSTEM_PTR o); static void Files_FlipBytes (SYSTEM_BYTE *src, ADDRESS src__len, SYSTEM_BYTE *dest, ADDRESS dest__len); @@ -102,7 +99,6 @@ export void Files_Rename (CHAR *old, ADDRESS old__len, CHAR *new, ADDRESS new__l static void Files_ScanPath (INT16 *pos, CHAR *dir, ADDRESS dir__len); export void Files_Set (Files_Rider *r, ADDRESS *r__typ, Files_File f, INT32 pos); export void Files_SetSearchPath (CHAR *path, ADDRESS path__len); -static void Files_Spaces (INT16 i); export void Files_Write (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE x); export void Files_WriteBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN x); export void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS x__len, INT32 n); @@ -116,132 +112,6 @@ export void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, ADDRESS #define Files_IdxTrap() __HALT(-1) -static void Files_Spaces (INT16 i) -{ - while (i > 0) { - Out_String((CHAR*)" ", 3); - i -= 1; - } -} - -void Files_DumpFile (Files_File f, INT16 indent) -{ - Files_Spaces(indent); - Out_String((CHAR*)"workName: ", 15); - Out_String(f->workName, 101); - Out_Ln(); - Files_Spaces(indent); - Out_String((CHAR*)"registerName: ", 15); - Out_String(f->registerName, 101); - Out_Ln(); - Files_Spaces(indent); - Out_String((CHAR*)"tempFile: ", 15); - if (f->tempFile) { - Out_String((CHAR*)"TRUE", 5); - } else { - Out_String((CHAR*)"FALSE", 6); - } - Out_Ln(); - Files_Spaces(indent); - Out_String((CHAR*)"identity: ", 15); - Out_String((CHAR*)"...", 4); - Out_Ln(); - Files_Spaces(indent); - Out_String((CHAR*)"fd: ", 15); - Out_Int(f->fd, 1); - Out_Ln(); - Files_Spaces(indent); - Out_String((CHAR*)"len, ", 15); - Out_Int(f->len, 1); - Out_Ln(); - Files_Spaces(indent); - Out_String((CHAR*)"pos: ", 15); - Out_Int(f->pos, 1); - Out_Ln(); - Files_Spaces(indent); - Out_String((CHAR*)"bufs: ", 15); - Out_String((CHAR*)"...", 4); - Out_Ln(); - Files_Spaces(indent); - Out_String((CHAR*)"swapper: ", 15); - Out_Int(f->swapper, 1); - Out_Ln(); - Files_Spaces(indent); - Out_String((CHAR*)"state: ", 15); - Out_Int(f->state, 1); - Out_Ln(); - Files_Spaces(indent); - Out_String((CHAR*)"next: ", 15); - Out_Hex((INT32)(ADDRESS)f->next, 1); - Out_Ln(); -} - -void Files_DumpBuffer (Files_Buffer b, INT16 indent) -{ - Files_Spaces(indent); - Out_String((CHAR*)"chg: ", 7); - if (b->chg) { - Out_String((CHAR*)"TRUE", 5); - } else { - Out_String((CHAR*)"FALSE", 6); - } - Out_Ln(); - Files_Spaces(indent); - Out_String((CHAR*)"org: ", 7); - Out_Int(b->org, 1); - Out_Ln(); - Files_Spaces(indent); - Out_String((CHAR*)"size: ", 7); - Out_Int(b->size, 1); - Out_Ln(); - Files_Spaces(indent); - Out_String((CHAR*)"data: ", 7); - Out_Ln(); - Out_HexDump((void*)b->data, 4096); - Files_Spaces(indent); - Out_String((CHAR*)"f: ", 7); - if (b->f == NIL) { - Out_String((CHAR*)"", 6); - Out_Ln(); - } else { - Out_Ln(); - Files_DumpFile(b->f, indent + 1); - } -} - -void Files_DumpRider (Files_Rider r, INT16 indent) -{ - Files_Spaces(indent); - Out_String((CHAR*)"res: ", 9); - Out_Int(r.res, 1); - Out_Ln(); - Files_Spaces(indent); - Out_String((CHAR*)"eof: ", 9); - if (r.eof) { - Out_String((CHAR*)"TRUE", 5); - } else { - Out_String((CHAR*)"FALSE", 6); - } - Out_Ln(); - Files_Spaces(indent); - Out_String((CHAR*)"org: ", 9); - Out_Int(r.org, 1); - Out_Ln(); - Files_Spaces(indent); - Out_String((CHAR*)"offset: ", 9); - Out_Int(r.offset, 1); - Out_Ln(); - Files_Spaces(indent); - Out_String((CHAR*)"buf: ", 9); - if (r.buf == NIL) { - Out_String((CHAR*)"", 6); - Out_Ln(); - } else { - Out_Ln(); - Files_DumpBuffer(r.buf, indent + 1); - } -} - static void Files_Assert (BOOLEAN truth) { if (!truth) { diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index d0b6716f..62563e24 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,19 +1,10 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h #include "SYSTEM.h" -typedef - struct Files_BufDesc { - INT32 _prvt0; - char _prvt1[4108]; - } Files_BufDesc; - -typedef - Files_BufDesc *Files_Buffer; - typedef struct Files_FileDesc *Files_File; @@ -33,16 +24,12 @@ typedef import ADDRESS *Files_FileDesc__typ; -import ADDRESS *Files_BufDesc__typ; import ADDRESS *Files_Rider__typ; import Files_File Files_Base (Files_Rider *r, ADDRESS *r__typ); import void Files_ChangeDirectory (CHAR *path, ADDRESS path__len, INT16 *res); import void Files_Close (Files_File f); import void Files_Delete (CHAR *name, ADDRESS name__len, INT16 *res); -import void Files_DumpBuffer (Files_Buffer b, INT16 indent); -import void Files_DumpFile (Files_File f, INT16 indent); -import void Files_DumpRider (Files_Rider r, INT16 indent); import void Files_GetDate (Files_File f, INT32 *t, INT32 *d); import void Files_GetName (Files_File f, CHAR *name, ADDRESS name__len); import INT32 Files_Length (Files_File f); diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index d6b6560d..c12cb722 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index 87732bb9..de4d17ce 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index c498f106..f397649b 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index f52b30af..8436f089 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index bb4ea138..19e40505 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index 6757803a..71d82def 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 093bb886..a5f41a8e 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index a32c29e0..38a2b01d 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 0fd45dec..8f903e46 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -63,6 +63,7 @@ export void OPM_Init (BOOLEAN *done); export void OPM_InitOptions (void); export INT16 OPM_Integer (INT64 n); static BOOLEAN OPM_IsProbablyInstallDir (CHAR *s, ADDRESS s__len); +export void OPM_LogCompiling (CHAR *modname, ADDRESS modname__len); static void OPM_LogErrMsg (INT16 n); export void OPM_LogVT100 (CHAR *vt100code, ADDRESS vt100code__len); export void OPM_LogW (CHAR ch); @@ -92,7 +93,6 @@ export void OPM_SymWInt (INT64 i); export void OPM_SymWLReal (LONGREAL lr); export void OPM_SymWReal (REAL r); export void OPM_SymWSet (UINT64 s); -static void OPM_VerboseListSizes (void); export void OPM_Write (CHAR ch); export void OPM_WriteHex (INT64 i); export void OPM_WriteInt (INT64 i); @@ -136,6 +136,27 @@ void OPM_LogVT100 (CHAR *vt100code, ADDRESS vt100code__len) __DEL(vt100code); } +void OPM_LogCompiling (CHAR *modname, ADDRESS modname__len) +{ + __DUP(modname, modname__len, CHAR); + OPM_LogWStr((CHAR*)"Compiling ", 11); + OPM_LogWStr(modname, modname__len); + if (__IN(18, OPM_Options, 32)) { + OPM_LogWStr((CHAR*)", s:", 5); + OPM_LogWNum(__ASHL(OPM_ShortintSize, 3), 1); + OPM_LogWStr((CHAR*)" i:", 4); + OPM_LogWNum(__ASHL(OPM_IntegerSize, 3), 1); + OPM_LogWStr((CHAR*)" l:", 4); + OPM_LogWNum(__ASHL(OPM_LongintSize, 3), 1); + OPM_LogWStr((CHAR*)" adr:", 6); + OPM_LogWNum(__ASHL(OPM_AddressSize, 3), 1); + OPM_LogWStr((CHAR*)" algn:", 7); + OPM_LogWNum(__ASHL(OPM_Alignment, 3), 1); + } + OPM_LogW('.'); + __DEL(modname); +} + INT64 OPM_SignedMaximum (INT32 bytecount) { INT64 result; @@ -363,32 +384,6 @@ BOOLEAN OPM_OpenPar (void) __RETCHK; } -static void OPM_VerboseListSizes (void) -{ - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Type Size", 15); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"SHORTINT ", 12); - OPM_LogWNum(OPM_ShortintSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"INTEGER ", 12); - OPM_LogWNum(OPM_IntegerSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"LONGINT ", 12); - OPM_LogWNum(OPM_LongintSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"SET ", 12); - OPM_LogWNum(OPM_LongintSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"ADDRESS ", 12); - OPM_LogWNum(OPM_AddressSize, 4); - OPM_LogWLn(); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Alignment: ", 12); - OPM_LogWNum(OPM_Alignment, 4); - OPM_LogWLn(); -} - void OPM_InitOptions (void) { CHAR s[256]; @@ -432,9 +427,6 @@ void OPM_InitOptions (void) OPM_LongintSize = 4; break; } - if (__IN(18, OPM_Options, 32)) { - OPM_VerboseListSizes(); - } __MOVE(OPM_InstallDir, OPM_ResourceDir, 1024); if (OPM_ResourceDir[0] != 0x00) { Strings_Append((CHAR*)"/", 2, (void*)OPM_ResourceDir, 1024); @@ -491,17 +483,6 @@ void OPM_Get (CHAR *ch) { OPM_curpos = Texts_Pos(&OPM_inR, Texts_Reader__typ); Texts_Read(&OPM_inR, Texts_Reader__typ, &*ch); - if ((OPM_curpos == 0 && OPM_inR.eot)) { - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"DEBUG: OPM.Get returned inR.eot at curpos = 0, ch = ", 53); - OPM_LogWNum((INT16)*ch, 1); - OPM_LogW('.'); - Texts_DumpReader(OPM_inR); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Heap dump:", 11); - OPM_LogWLn(); - Out_DumpHeap(); - } if ((*ch < 0x09 && !OPM_inR.eot)) { *ch = ' '; } diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index f246eacb..96318bea 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h @@ -33,6 +33,7 @@ import void OPM_Get (CHAR *ch); import void OPM_Init (BOOLEAN *done); import void OPM_InitOptions (void); import INT16 OPM_Integer (INT64 n); +import void OPM_LogCompiling (CHAR *modname, ADDRESS modname__len); import void OPM_LogVT100 (CHAR *vt100code, ADDRESS vt100code__len); import void OPM_LogW (CHAR ch); import void OPM_LogWLn (void); diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index c3e79413..ec4ad2be 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -1796,9 +1796,7 @@ void OPP_Module (OPT_Node *prog, UINT32 opt) OPP_err(16); } if (OPP_sym == 38) { - OPM_LogWStr((CHAR*)"compiling ", 11); - OPM_LogWStr(OPS_name, 256); - OPM_LogW('.'); + OPM_LogCompiling(OPS_name, 256); OPT_Init(OPS_name, opt); OPS_Get(&OPP_sym); OPP_CheckSym(39); diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index 913d2eef..aa076aaa 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index abfcd4b8..bf9f1af5 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index 9e15ba4e..09a33705 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index fc598571..0002aa51 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index 228191bf..63bf2070 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index e44854e3..8b095ff5 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index ea04b5b8..c6a107b6 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Out.c b/bootstrap/unix-48/Out.c index fc487d97..23d917c7 100644 --- a/bootstrap/unix-48/Out.c +++ b/bootstrap/unix-48/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -14,19 +14,10 @@ export BOOLEAN Out_IsConsole; static CHAR Out_buf[128]; static INT16 Out_in; -static ADDRESS *typedesc__11__typ; -static ADDRESS *blockdesc__5__typ; -static ADDRESS *chunkdesc__7__typ; export void Out_Char (CHAR ch); -export void Out_DumpHeap (void); -static void Out_DumpModule (Heap_Module m); -export void Out_DumpTag (INT32 addr); -export void Out_DumpType (SYSTEM_BYTE *o, ADDRESS o__len); export void Out_Flush (void); export void Out_Hex (INT64 x, INT64 n); -export void Out_HexDump (SYSTEM_BYTE *m, ADDRESS m__len); -export void Out_HexDumpAdr (INT32 adr, INT64 offset, INT32 length); export void Out_Int (INT64 x, INT64 n); static INT32 Out_Length (CHAR *s, ADDRESS s__len); export void Out_Ln (void); @@ -40,8 +31,6 @@ static void Out_digit (INT64 n, CHAR *s, ADDRESS s__len, INT16 *i); static void Out_prepend (CHAR *t, ADDRESS t__len, CHAR *s, ADDRESS s__len, INT16 *i); #define Out_Entier64(x) (INT64)(x) -extern ADDRESS Heap_heap; -#define Out_getheap() Heap_heap void Out_Flush (void) { @@ -139,8 +128,10 @@ void Out_Hex (INT64 x, INT64 n) } else if (n > 16) { n = 16; } - while ((n < 16 && __LSH(x, -__ASHL(n, 2), 64) != 0)) { - n += 1; + if (x >= 0) { + while ((n < 16 && __LSH(x, -__ASHL(n, 2), 64) != 0)) { + n += 1; + } } x = __ROT(x, __ASHL(16 - n, 2), 64); while (n > 0) { @@ -160,235 +151,6 @@ void Out_Ln (void) Out_Flush(); } -void Out_HexDumpAdr (INT32 adr, INT64 offset, INT32 length) -{ - INT16 i; - INT32 n, lim; - CHAR c; - lim = (INT32)(adr + length); - while (adr < lim) { - if (adr + 16 < lim) { - n = 16; - } else { - n = lim - adr; - } - Out_Hex(offset, 8); - Out_Char(' '); - i = 0; - while (i < n) { - if (__MASK(i, -4) == 0) { - Out_Char(' '); - } - __GET(adr + i, c, CHAR); - Out_Hex((INT16)c, 2); - Out_Char(' '); - i += 1; - } - while (i < 16) { - if (__MASK(i, -4) == 0) { - Out_Char(' '); - } - Out_String((CHAR*)" ", 4); - i += 1; - } - Out_String((CHAR*)" ", 2); - i = 0; - while (i < n) { - __GET(adr + i, c, CHAR); - if ((INT16)c < 32 || (INT16)c > 126) { - Out_Char('.'); - } else { - Out_Char(c); - } - i += 1; - } - adr += n; - offset += (INT64)n; - Out_Ln(); - } -} - -void Out_HexDump (SYSTEM_BYTE *m, ADDRESS m__len) -{ - Out_HexDumpAdr((ADDRESS)m, 0, m__len); -} - -static void Out_DumpModule (Heap_Module m) -{ - Out_String((CHAR*)" next: ", 19); - Out_Hex((INT32)(ADDRESS)m->next, 1); - Out_Ln(); - Out_String((CHAR*)" name: ", 19); - Out_String(m->name, 20); - Out_Ln(); - Out_String((CHAR*)" refcnt: ", 19); - Out_Hex(m->refcnt, 1); - Out_Ln(); - Out_String((CHAR*)" cmds: ", 19); - Out_Hex((INT32)(ADDRESS)m->cmds, 1); - Out_Ln(); - Out_String((CHAR*)" types: ", 19); - Out_Hex(m->types, 1); - Out_Ln(); - Out_String((CHAR*)" enumPtrs: ", 19); - Out_Hex((INT32)(ADDRESS)m->enumPtrs, 1); - Out_Ln(); -} - -typedef - struct typedesc__11 *tag__10; - -typedef - struct typedesc__11 { - INT32 tag, next, level, module; - CHAR name[24]; - INT32 bases[16]; - INT32 reserved, blksz, ptr0; - } typedesc__11; - -void Out_DumpTag (INT32 addr) -{ - tag__10 desc = NIL; - INT16 i; - Out_String((CHAR*)" obj tag: ", 17); - Out_Hex(addr, 1); - Out_Ln(); - addr -= __MASK(addr, -2); - desc = (tag__10)(ADDRESS)(addr - 108); - Out_String((CHAR*)" desc at: ", 17); - Out_Hex((INT32)(ADDRESS)desc, 1); - Out_Ln(); - Out_String((CHAR*)" desc contains:", 21); - Out_Ln(); - Out_String((CHAR*)" tag: ", 17); - Out_Hex(desc->tag, 1); - Out_Ln(); - Out_String((CHAR*)" next: ", 17); - Out_Hex(desc->next, 1); - Out_Ln(); - Out_String((CHAR*)" level: ", 17); - Out_Hex(desc->level, 1); - Out_Ln(); - Out_String((CHAR*)" module: ", 17); - Out_Hex(desc->module, 1); - Out_Ln(); - if (desc->module != 0) { - Out_DumpModule((Heap_Module)(ADDRESS)desc->module); - } - Out_String((CHAR*)" name: ", 17); - Out_String(desc->name, 24); - Out_Ln(); - Out_String((CHAR*)" bases: ", 17); - i = 0; - while (i < 16) { - Out_Hex(desc->bases[__X(i, 16)], 8); - if (__MASK(i, -4) == 3) { - Out_Ln(); - Out_String((CHAR*)" ", 17); - } else { - Out_Char(' '); - } - i += 1; - } - Out_Ln(); - Out_String((CHAR*)" reserved: ", 17); - Out_Hex(desc->reserved, 1); - Out_Ln(); - Out_String((CHAR*)" blksz: ", 17); - Out_Hex(desc->blksz, 1); - Out_Ln(); - Out_String((CHAR*)" ptr0: ", 17); - Out_Hex(desc->ptr0, 1); - Out_Ln(); -} - -void Out_DumpType (SYSTEM_BYTE *o, ADDRESS o__len) -{ - INT32 addr; - __GET((ADDRESS)o - 4, addr, INT32); - Out_DumpTag(addr); -} - -typedef - INT32 (*adrptr__3)[1]; - -typedef - struct blockdesc__5 *block__4; - -typedef - struct blockdesc__5 { - INT32 tag, size, sentinel, next; - } blockdesc__5; - -typedef - struct chunkdesc__7 *chunk__6; - -typedef - struct chunkdesc__7 { - INT32 next, end, reserved; - blockdesc__5 firstblock; - } chunkdesc__7; - -void Out_DumpHeap (void) -{ - INT32 caddr; - chunk__6 c = NIL; - INT32 baddr; - block__4 b = NIL; - adrptr__3 tag = NIL; - caddr = Heap_heap; - while (caddr != 0) { - Out_String((CHAR*)"Chunk at: ", 11); - Out_Hex(caddr, 1); - Out_Ln(); - c = (chunk__6)(ADDRESS)caddr; - Out_String((CHAR*)" next: ", 11); - Out_Hex(c->next, 1); - Out_Ln(); - Out_String((CHAR*)" end: ", 11); - Out_Hex(c->end, 1); - Out_String((CHAR*)" => size: ", 11); - Out_Hex(c->end - caddr, 1); - Out_Ln(); - Out_String((CHAR*)" rsvd: ", 11); - Out_Hex(c->reserved, 1); - Out_Ln(); - baddr = (ADDRESS)&c->firstblock; - while (c->end - baddr > 0) { - Out_String((CHAR*)" Block at: ", 15); - Out_Hex(baddr, 1); - Out_Ln(); - b = (block__4)(ADDRESS)baddr; - tag = (adrptr__3)(ADDRESS)(b->tag - __MASK(b->tag, -2)); - Out_String((CHAR*)" tag: ", 15); - Out_Hex(b->tag, 1); - if (__MASK(b->tag, -2) != 0) { - Out_String((CHAR*)" <--- ODD! ---", 15); - } - Out_Ln(); - Out_String((CHAR*)" tag^: ", 15); - Out_Hex((*tag)[0], 1); - Out_Ln(); - Out_String((CHAR*)" size: ", 15); - Out_Hex(b->size, 1); - Out_Ln(); - Out_String((CHAR*)" sentinel: ", 15); - Out_Hex(b->sentinel, 1); - Out_Ln(); - Out_String((CHAR*)" next: ", 15); - Out_Hex(b->next, 1); - Out_Ln(); - if (b->tag != (ADDRESS)&b->size) { - Out_DumpTag(b->tag); - } - baddr += (*tag)[0]; - Out_Ln(); - } - caddr = c->next; - Out_Ln(); - } -} - static void Out_digit (INT64 n, CHAR *s, ADDRESS s__len, INT16 *i) { *i -= 1; @@ -566,9 +328,6 @@ void Out_LongReal (LONGREAL x, INT16 n) Out_RealP(x, n, 1); } -__TDESC(typedesc__11, 1, 0) = {__TDFLDS("typedesc__11", 116), {-4}}; -__TDESC(blockdesc__5, 1, 0) = {__TDFLDS("blockdesc__5", 16), {-4}}; -__TDESC(chunkdesc__7, 1, 0) = {__TDFLDS("chunkdesc__7", 28), {-4}}; export void *Out__init(void) { @@ -576,13 +335,9 @@ export void *Out__init(void) __MODULE_IMPORT(Heap); __MODULE_IMPORT(Platform); __REGMOD("Out", 0); - __REGCMD("DumpHeap", Out_DumpHeap); __REGCMD("Flush", Out_Flush); __REGCMD("Ln", Out_Ln); __REGCMD("Open", Out_Open); - __INITYP(typedesc__11, typedesc__11, 0); - __INITYP(blockdesc__5, blockdesc__5, 0); - __INITYP(chunkdesc__7, chunkdesc__7, 0); /* BEGIN */ Out_IsConsole = Platform_IsConsole(1); Out_in = 0; diff --git a/bootstrap/unix-48/Out.h b/bootstrap/unix-48/Out.h index cbb4de1a..e1285046 100644 --- a/bootstrap/unix-48/Out.h +++ b/bootstrap/unix-48/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h @@ -10,13 +10,8 @@ import BOOLEAN Out_IsConsole; import void Out_Char (CHAR ch); -import void Out_DumpHeap (void); -import void Out_DumpTag (INT32 addr); -import void Out_DumpType (SYSTEM_BYTE *o, ADDRESS o__len); import void Out_Flush (void); import void Out_Hex (INT64 x, INT64 n); -import void Out_HexDump (SYSTEM_BYTE *m, ADDRESS m__len); -import void Out_HexDumpAdr (INT32 adr, INT64 offset, INT32 length); import void Out_Int (INT64 x, INT64 n); import void Out_Ln (void); import void Out_LongReal (LONGREAL x, INT16 n); diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index b646e8b7..fa5fada1 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index 957af90d..0b98d7bb 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 9b449f98..d1eb72f6 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index 3e83af42..170d1785 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index f9b5310a..225bd40a 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index 58f9b546..4d98f1a3 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index 96851302..08ee5129 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -192,11 +192,6 @@ export void Texts_Close (Texts_Text T, CHAR *name, ADDRESS name__len); export void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); export void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); export void Texts_Delete (Texts_Text T, INT32 beg, INT32 end); -static void Texts_DumpElem (Texts_Elem e); -static void Texts_DumpPiece (Texts_Piece p); -export void Texts_DumpReader (Texts_Reader re); -static void Texts_DumpRun (Texts_Run ru); -static void Texts_DumpText (Texts_Text t); export Texts_Text Texts_ElemBase (Texts_Elem E); export INT32 Texts_ElemPos (Texts_Elem E); static void Texts_Find (Texts_Text T, INT32 *pos, Texts_Run *u, INT32 *org, INT32 *off); @@ -238,161 +233,6 @@ export void Texts_WriteRealHex (Texts_Writer *W, ADDRESS *W__typ, REAL x); export void Texts_WriteString (Texts_Writer *W, ADDRESS *W__typ, CHAR *s, ADDRESS s__len); -static void Texts_DumpText (Texts_Text t) -{ - Out_String((CHAR*)" len: ", 15); - Out_Int(t->len, 1); - Out_Ln(); - Out_String((CHAR*)" notify: ", 15); - Out_Hex((INT32)(ADDRESS)t->notify, 1); - Out_Ln(); - Out_String((CHAR*)" head: ", 15); - Out_Hex((INT32)(ADDRESS)t->head, 1); - Out_Ln(); - Out_String((CHAR*)" cache: ", 15); - Out_Hex((INT32)(ADDRESS)t->cache, 1); - Out_Ln(); - Out_String((CHAR*)" corg: ", 15); - Out_Int(t->corg, 1); - Out_Ln(); -} - -static void Texts_DumpRun (Texts_Run ru) -{ - Out_String((CHAR*)" Run at ", 12); - Out_Hex((INT32)(ADDRESS)ru, 1); - Out_Ln(); - Out_String((CHAR*)" prev: ", 12); - Out_Hex((INT32)(ADDRESS)ru->prev, 1); - Out_Ln(); - Out_String((CHAR*)" next: ", 12); - Out_Hex((INT32)(ADDRESS)ru->next, 1); - Out_Ln(); - Out_String((CHAR*)" len: ", 12); - Out_Int(ru->len, 1); - Out_Ln(); - Out_String((CHAR*)" fnt: ", 12); - if (ru->fnt != NIL) { - Out_String(ru->fnt->name, 32); - } else { - Out_String((CHAR*)"", 6); - } - Out_Ln(); - Out_String((CHAR*)" col: ", 12); - Out_Int(ru->col, 1); - Out_Ln(); - Out_String((CHAR*)" voff: ", 12); - Out_Int(ru->voff, 1); - Out_Ln(); - Out_String((CHAR*)" ascii: ", 12); - if (ru->ascii) { - Out_String((CHAR*)"TRUE", 5); - } else { - Out_String((CHAR*)"FALSE", 6); - } - Out_Ln(); -} - -static void Texts_DumpElem (Texts_Elem e) -{ - Texts_DumpRun((void*)e); - Out_String((CHAR*)" -- Elem --", 15); - Out_Ln(); - Out_String((CHAR*)" W: ", 13); - Out_Int(e->W, 1); - Out_Ln(); - Out_String((CHAR*)" H: ", 13); - Out_Int(e->H, 1); - Out_Ln(); - Out_String((CHAR*)" handle: ", 13); - Out_Hex((INT32)(ADDRESS)e->handle, 1); - Out_Ln(); - Out_String((CHAR*)" base: ", 13); - if (e->base == NIL) { - Out_String((CHAR*)"", 6); - Out_Ln(); - } else { - Out_Ln(); - Texts_DumpText(e->base); - } -} - -static void Texts_DumpPiece (Texts_Piece p) -{ - Texts_DumpRun((void*)p); - Out_String((CHAR*)" -- Piece --", 16); - Out_Ln(); - Out_String((CHAR*)" file: ", 12); - if (p->file == NIL) { - Out_String((CHAR*)"", 6); - Out_Ln(); - } else { - Out_Ln(); - Files_DumpFile(p->file, 3); - } - Out_String((CHAR*)" org: ", 12); - Out_Int(p->org, 1); - Out_Ln(); -} - -void Texts_DumpReader (Texts_Reader re) -{ - Out_String((CHAR*)"Reader:", 8); - Out_Ln(); - Out_String((CHAR*)" eot: ", 10); - if (re.eot) { - Out_String((CHAR*)"TRUE", 5); - } else { - Out_String((CHAR*)"FALSE", 6); - } - Out_Ln(); - Out_String((CHAR*)" fnt: ", 10); - if (re.fnt != NIL) { - Out_String(re.fnt->name, 32); - } else { - Out_String((CHAR*)"", 6); - } - Out_Ln(); - Out_String((CHAR*)" col: ", 10); - Out_Int(re.col, 1); - Out_Ln(); - Out_String((CHAR*)" voff: ", 10); - Out_Int(re.voff, 1); - Out_Ln(); - Out_String((CHAR*)" org: ", 10); - Out_Int(re.org, 1); - Out_Ln(); - Out_String((CHAR*)" off: ", 10); - Out_Int(re.off, 1); - Out_Ln(); - Out_String((CHAR*)" elem: ", 10); - if (re.elem == NIL) { - Out_String((CHAR*)"", 6); - Out_Ln(); - } else { - Out_Ln(); - Texts_DumpElem(re.elem); - } - Out_String((CHAR*)" rider: ", 10); - Out_Ln(); - Files_DumpRider(re.rider, 2); - Out_String((CHAR*)" run: ", 10); - if (re.run == NIL) { - Out_String((CHAR*)"", 6); - Out_Ln(); - } else { - Out_Ln(); - if (__ISP(re.run, Texts_PieceDesc, 1)) { - Texts_DumpPiece(__GUARDP(re.run, Texts_PieceDesc, 1)); - } else if (__ISP(re.run, Texts_ElemDesc, 1)) { - Texts_DumpElem(__GUARDP(re.run, Texts_ElemDesc, 1)); - } else { - Texts_DumpRun(re.run); - } - } - Out_DumpType((void*)&*re.run, 20); -} - static Texts_FontsFont Texts_FontsThis (CHAR *name, ADDRESS name__len) { Texts_FontsFont F = NIL; @@ -877,32 +717,32 @@ void Texts_OpenScanner (Texts_Scanner *S, ADDRESS *S__typ, Texts_Text T, INT32 p (*S).nextCh = ' '; } -static struct Scan__36 { +static struct Scan__31 { Texts_Scanner *S; ADDRESS *S__typ; CHAR *ch; BOOLEAN *negE; INT16 *e; - struct Scan__36 *lnk; -} *Scan__36_s; + struct Scan__31 *lnk; +} *Scan__31_s; -static void ReadScaleFactor__37 (void); +static void ReadScaleFactor__32 (void); -static void ReadScaleFactor__37 (void) +static void ReadScaleFactor__32 (void) { - Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); - if (*Scan__36_s->ch == '-') { - *Scan__36_s->negE = 1; - Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); + Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); + if (*Scan__31_s->ch == '-') { + *Scan__31_s->negE = 1; + Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); } else { - *Scan__36_s->negE = 0; - if (*Scan__36_s->ch == '+') { - Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); + *Scan__31_s->negE = 0; + if (*Scan__31_s->ch == '+') { + Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); } } - while (('0' <= *Scan__36_s->ch && *Scan__36_s->ch <= '9')) { - *Scan__36_s->e = (*Scan__36_s->e * 10 + (INT16)*Scan__36_s->ch) - 48; - Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); + while (('0' <= *Scan__31_s->ch && *Scan__31_s->ch <= '9')) { + *Scan__31_s->e = (*Scan__31_s->e * 10 + (INT16)*Scan__31_s->ch) - 48; + Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); } } @@ -916,13 +756,13 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) REAL x, f; LONGREAL y, g; CHAR d[32]; - struct Scan__36 _s; + struct Scan__31 _s; _s.S = S; _s.S__typ = S__typ; _s.ch = &ch; _s.negE = &negE; _s.e = &e; - _s.lnk = Scan__36_s; - Scan__36_s = &_s; + _s.lnk = Scan__31_s; + Scan__31_s = &_s; ch = (*S).nextCh; i = 0; for (;;) { @@ -1023,7 +863,7 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) y = ((INT16)d[__X(j, 32)] - 48) * g + y; j += 1; } - ReadScaleFactor__37(); + ReadScaleFactor__32(); if (negE) { if (e <= 308) { y = y / (LONGREAL)Reals_TenL(e); @@ -1056,7 +896,7 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) j += 1; } if (ch == 'E') { - ReadScaleFactor__37(); + ReadScaleFactor__32(); } if (negE) { if (e <= 38) { @@ -1109,7 +949,7 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) } } (*S).nextCh = ch; - Scan__36_s = _s.lnk; + Scan__31_s = _s.lnk; } void Texts_OpenWriter (Texts_Writer *W, ADDRESS *W__typ) @@ -1328,30 +1168,30 @@ void Texts_WriteReal (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n) } } -static struct WriteRealFix__58 { +static struct WriteRealFix__53 { Texts_Writer *W; ADDRESS *W__typ; INT16 *i; CHAR (*d)[9]; - struct WriteRealFix__58 *lnk; -} *WriteRealFix__58_s; + struct WriteRealFix__53 *lnk; +} *WriteRealFix__53_s; -static void dig__59 (INT16 n); -static void seq__61 (CHAR ch, INT16 n); +static void dig__54 (INT16 n); +static void seq__56 (CHAR ch, INT16 n); -static void seq__61 (CHAR ch, INT16 n) +static void seq__56 (CHAR ch, INT16 n) { while (n > 0) { - Texts_Write(&*WriteRealFix__58_s->W, WriteRealFix__58_s->W__typ, ch); + Texts_Write(&*WriteRealFix__53_s->W, WriteRealFix__53_s->W__typ, ch); n -= 1; } } -static void dig__59 (INT16 n) +static void dig__54 (INT16 n) { while (n > 0) { - *WriteRealFix__58_s->i -= 1; - Texts_Write(&*WriteRealFix__58_s->W, WriteRealFix__58_s->W__typ, (*WriteRealFix__58_s->d)[__X(*WriteRealFix__58_s->i, 9)]); + *WriteRealFix__53_s->i -= 1; + Texts_Write(&*WriteRealFix__53_s->W, WriteRealFix__53_s->W__typ, (*WriteRealFix__53_s->d)[__X(*WriteRealFix__53_s->i, 9)]); n -= 1; } } @@ -1362,23 +1202,23 @@ void Texts_WriteRealFix (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n, INT1 CHAR sign; REAL x0; CHAR d[9]; - struct WriteRealFix__58 _s; + struct WriteRealFix__53 _s; _s.W = W; _s.W__typ = W__typ; _s.i = &i; _s.d = (void*)d; - _s.lnk = WriteRealFix__58_s; - WriteRealFix__58_s = &_s; + _s.lnk = WriteRealFix__53_s; + WriteRealFix__53_s = &_s; e = Reals_Expo(x); if (k < 0) { k = 0; } if (e == 0) { - seq__61(' ', (n - k) - 2); + seq__56(' ', (n - k) - 2); Texts_Write(&*W, W__typ, '0'); - seq__61(' ', k + 1); + seq__56(' ', k + 1); } else if (e == 255) { Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", 5); - seq__61(' ', n - 4); + seq__56(' ', n - 4); } else { e = __ASHR((e - 127) * 77, 8); if (x < (REAL)0) { @@ -1411,21 +1251,21 @@ void Texts_WriteRealFix (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n, INT1 i = k + e; Reals_Convert(x, i, (void*)d, 9); if (e > 0) { - seq__61(' ', ((n - e) - k) - 2); + seq__56(' ', ((n - e) - k) - 2); Texts_Write(&*W, W__typ, sign); - dig__59(e); + dig__54(e); Texts_Write(&*W, W__typ, '.'); - dig__59(k); + dig__54(k); } else { - seq__61(' ', (n - k) - 3); + seq__56(' ', (n - k) - 3); Texts_Write(&*W, W__typ, sign); Texts_Write(&*W, W__typ, '0'); Texts_Write(&*W, W__typ, '.'); - seq__61('0', -e); - dig__59(k + e); + seq__56('0', -e); + dig__54(k + e); } } - WriteRealFix__58_s = _s.lnk; + WriteRealFix__53_s = _s.lnk; } void Texts_WriteRealHex (Texts_Writer *W, ADDRESS *W__typ, REAL x) @@ -1524,48 +1364,48 @@ void Texts_WriteLongRealHex (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x) } while (!(i == 16)); } -static struct WriteDate__48 { +static struct WriteDate__43 { Texts_Writer *W; ADDRESS *W__typ; - struct WriteDate__48 *lnk; -} *WriteDate__48_s; + struct WriteDate__43 *lnk; +} *WriteDate__43_s; -static void WritePair__49 (CHAR ch, INT32 x); +static void WritePair__44 (CHAR ch, INT32 x); -static void WritePair__49 (CHAR ch, INT32 x) +static void WritePair__44 (CHAR ch, INT32 x) { - Texts_Write(&*WriteDate__48_s->W, WriteDate__48_s->W__typ, ch); - Texts_Write(&*WriteDate__48_s->W, WriteDate__48_s->W__typ, (CHAR)(__DIV(x, 10) + 48)); - Texts_Write(&*WriteDate__48_s->W, WriteDate__48_s->W__typ, (CHAR)((int)__MOD(x, 10) + 48)); + Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, ch); + Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)(__DIV(x, 10) + 48)); + Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)((int)__MOD(x, 10) + 48)); } void Texts_WriteDate (Texts_Writer *W, ADDRESS *W__typ, INT32 t, INT32 d) { - struct WriteDate__48 _s; + struct WriteDate__43 _s; _s.W = W; _s.W__typ = W__typ; - _s.lnk = WriteDate__48_s; - WriteDate__48_s = &_s; - WritePair__49(' ', __MASK(d, -32)); - WritePair__49('.', __MASK(__ASHR(d, 5), -16)); - WritePair__49('.', __MASK(__ASHR(d, 9), -128)); - WritePair__49(' ', __MASK(__ASHR(t, 12), -32)); - WritePair__49(':', __MASK(__ASHR(t, 6), -64)); - WritePair__49(':', __MASK(t, -64)); - WriteDate__48_s = _s.lnk; + _s.lnk = WriteDate__43_s; + WriteDate__43_s = &_s; + WritePair__44(' ', __MASK(d, -32)); + WritePair__44('.', __MASK(__ASHR(d, 5), -16)); + WritePair__44('.', __MASK(__ASHR(d, 9), -128)); + WritePair__44(' ', __MASK(__ASHR(t, 12), -32)); + WritePair__44(':', __MASK(__ASHR(t, 6), -64)); + WritePair__44(':', __MASK(t, -64)); + WriteDate__43_s = _s.lnk; } -static struct Load0__21 { +static struct Load0__16 { Texts_Text *T; INT8 *ecnt; Files_File *f; Texts_FileMsg *msg; CHAR (*mods)[64][32], (*procs)[64][32]; - struct Load0__21 *lnk; -} *Load0__21_s; + struct Load0__16 *lnk; +} *Load0__16_s; -static void LoadElem__22 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e); +static void LoadElem__17 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e); -static void LoadElem__22 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e) +static void LoadElem__17 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e) { Heap_Module M = NIL; Heap_Command Cmd; @@ -1576,15 +1416,15 @@ static void LoadElem__22 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span Files_ReadLInt(&*r, r__typ, &ew); Files_ReadLInt(&*r, r__typ, &eh); Files_Read(&*r, r__typ, (void*)&eno); - if (eno > *Load0__21_s->ecnt) { - *Load0__21_s->ecnt = eno; - Files_ReadString(&*r, r__typ, (void*)(*Load0__21_s->mods)[__X(eno, 64)], 32); - Files_ReadString(&*r, r__typ, (void*)(*Load0__21_s->procs)[__X(eno, 64)], 32); + if (eno > *Load0__16_s->ecnt) { + *Load0__16_s->ecnt = eno; + Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->mods)[__X(eno, 64)], 32); + Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->procs)[__X(eno, 64)], 32); } org = Files_Pos(&*r, r__typ); - M = Modules_ThisMod((*Load0__21_s->mods)[__X(eno, 64)], 32); + M = Modules_ThisMod((*Load0__16_s->mods)[__X(eno, 64)], 32); if (M != NIL) { - Cmd = Modules_ThisCommand(M, (*Load0__21_s->procs)[__X(eno, 64)], 32); + Cmd = Modules_ThisCommand(M, (*Load0__16_s->procs)[__X(eno, 64)], 32); if (Cmd != NIL) { (*Cmd)(); } @@ -1593,25 +1433,25 @@ static void LoadElem__22 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span if (*e != NIL) { (*e)->W = ew; (*e)->H = eh; - (*e)->base = *Load0__21_s->T; - (*Load0__21_s->msg).pos = pos; - (*(*e)->handle)(*e, (void*)&*Load0__21_s->msg, Texts_FileMsg__typ); + (*e)->base = *Load0__16_s->T; + (*Load0__16_s->msg).pos = pos; + (*(*e)->handle)(*e, (void*)&*Load0__16_s->msg, Texts_FileMsg__typ); if (Files_Pos(&*r, r__typ) != org + span) { *e = NIL; } } if (*e == NIL) { - Files_Set(&*r, r__typ, *Load0__21_s->f, org + span); + Files_Set(&*r, r__typ, *Load0__16_s->f, org + span); __NEW(a, Texts__1); a->W = ew; a->H = eh; a->handle = Texts_HandleAlien; - a->base = *Load0__21_s->T; - a->file = *Load0__21_s->f; + a->base = *Load0__16_s->T; + a->file = *Load0__16_s->f; a->org = org; a->span = span; - __COPY((*Load0__21_s->mods)[__X(eno, 64)], a->mod, 32); - __COPY((*Load0__21_s->procs)[__X(eno, 64)], a->proc, 32); + __COPY((*Load0__16_s->mods)[__X(eno, 64)], a->mod, 32); + __COPY((*Load0__16_s->procs)[__X(eno, 64)], a->proc, 32); *e = (Texts_Elem)a; } } @@ -1628,15 +1468,15 @@ static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) CHAR mods[64][32], procs[64][32]; CHAR name[32]; Texts_FontsFont fnts[32]; - struct Load0__21 _s; + struct Load0__16 _s; _s.T = &T; _s.ecnt = &ecnt; _s.f = &f; _s.msg = &msg; _s.mods = (void*)mods; _s.procs = (void*)procs; - _s.lnk = Load0__21_s; - Load0__21_s = &_s; + _s.lnk = Load0__16_s; + Load0__16_s = &_s; pos = Files_Pos(&*r, r__typ); f = Files_Base(&*r, r__typ); __NEW(u, Texts_RunDesc); @@ -1669,7 +1509,7 @@ static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) un = (Texts_Run)p; un->len = plen; } else { - LoadElem__22(&msg.r, Files_Rider__typ, pos - org, -plen, &e); + LoadElem__17(&msg.r, Files_Rider__typ, pos - org, -plen, &e); un = (Texts_Run)e; un->len = 1; } @@ -1687,7 +1527,7 @@ static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) T->corg = 0; Files_ReadLInt(&msg.r, Files_Rider__typ, &T->len); Files_Set(&*r, r__typ, f, Files_Pos(&msg.r, Files_Rider__typ) + T->len); - Load0__21_s = _s.lnk; + Load0__16_s = _s.lnk; } void Texts_Load (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) @@ -1756,25 +1596,25 @@ void Texts_Open (Texts_Text T, CHAR *name, ADDRESS name__len) __DEL(name); } -static struct Store__44 { +static struct Store__39 { INT8 *ecnt; Texts_FileMsg *msg; Texts_IdentifyMsg *iden; CHAR (*mods)[64][32], (*procs)[64][32]; - struct Store__44 *lnk; -} *Store__44_s; + struct Store__39 *lnk; +} *Store__39_s; -static void StoreElem__45 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e); +static void StoreElem__40 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e); -static void StoreElem__45 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e) +static void StoreElem__40 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e) { Files_Rider r1; INT32 org, span; INT8 eno; - __COPY((*Store__44_s->iden).mod, (*Store__44_s->mods)[__X(*Store__44_s->ecnt, 64)], 32); - __COPY((*Store__44_s->iden).proc, (*Store__44_s->procs)[__X(*Store__44_s->ecnt, 64)], 32); + __COPY((*Store__39_s->iden).mod, (*Store__39_s->mods)[__X(*Store__39_s->ecnt, 64)], 32); + __COPY((*Store__39_s->iden).proc, (*Store__39_s->procs)[__X(*Store__39_s->ecnt, 64)], 32); eno = 1; - while (__STRCMP((*Store__44_s->mods)[__X(eno, 64)], (*Store__44_s->iden).mod) != 0 || __STRCMP((*Store__44_s->procs)[__X(eno, 64)], (*Store__44_s->iden).proc) != 0) { + while (__STRCMP((*Store__39_s->mods)[__X(eno, 64)], (*Store__39_s->iden).mod) != 0 || __STRCMP((*Store__39_s->procs)[__X(eno, 64)], (*Store__39_s->iden).proc) != 0) { eno += 1; } Files_Set(&r1, Files_Rider__typ, Files_Base(&*r, r__typ), Files_Pos(&*r, r__typ)); @@ -1782,14 +1622,14 @@ static void StoreElem__45 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Ele Files_WriteLInt(&*r, r__typ, 0); Files_WriteLInt(&*r, r__typ, 0); Files_Write(&*r, r__typ, eno); - if (eno == *Store__44_s->ecnt) { - *Store__44_s->ecnt += 1; - Files_WriteString(&*r, r__typ, (*Store__44_s->iden).mod, 32); - Files_WriteString(&*r, r__typ, (*Store__44_s->iden).proc, 32); + if (eno == *Store__39_s->ecnt) { + *Store__39_s->ecnt += 1; + Files_WriteString(&*r, r__typ, (*Store__39_s->iden).mod, 32); + Files_WriteString(&*r, r__typ, (*Store__39_s->iden).proc, 32); } - (*Store__44_s->msg).pos = pos; + (*Store__39_s->msg).pos = pos; org = Files_Pos(&*r, r__typ); - (*e->handle)(e, (void*)&*Store__44_s->msg, Texts_FileMsg__typ); + (*e->handle)(e, (void*)&*Store__39_s->msg, Texts_FileMsg__typ); span = Files_Pos(&*r, r__typ) - org; Files_WriteLInt(&r1, Files_Rider__typ, -span); Files_WriteLInt(&r1, Files_Rider__typ, e->W); @@ -1810,14 +1650,14 @@ void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) CHAR mods[64][32], procs[64][32]; Texts_FontsFont fnts[32]; CHAR block[1024]; - struct Store__44 _s; + struct Store__39 _s; _s.ecnt = &ecnt; _s.msg = &msg; _s.iden = &iden; _s.mods = (void*)mods; _s.procs = (void*)procs; - _s.lnk = Store__44_s; - Store__44_s = &_s; + _s.lnk = Store__39_s; + Store__39_s = &_s; org = Files_Pos(&*r, r__typ); msg.id = 1; msg.r = *r; @@ -1859,7 +1699,7 @@ void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) pos += rlen; u = un; } else if (iden.mod[0] != 0x00) { - StoreElem__45(&msg.r, Files_Rider__typ, pos, __GUARDP(u, Texts_ElemDesc, 1)); + StoreElem__40(&msg.r, Files_Rider__typ, pos, __GUARDP(u, Texts_ElemDesc, 1)); pos += 1; u = u->next; } else { @@ -1913,7 +1753,7 @@ void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) if (T->notify != NIL) { (*T->notify)(T, 3, 0, 0); } - Store__44_s = _s.lnk; + Store__39_s = _s.lnk; } void Texts_Close (Texts_Text T, CHAR *name, ADDRESS name__len) diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index 188b60fb..5d3316e2 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h @@ -135,7 +135,6 @@ import void Texts_Close (Texts_Text T, CHAR *name, ADDRESS name__len); import void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); import void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); import void Texts_Delete (Texts_Text T, INT32 beg, INT32 end); -import void Texts_DumpReader (Texts_Reader re); import Texts_Text Texts_ElemBase (Texts_Elem E); import INT32 Texts_ElemPos (Texts_Elem E); import void Texts_Insert (Texts_Text T, INT32 pos, Texts_Buffer B); diff --git a/bootstrap/unix-48/VT100.c b/bootstrap/unix-48/VT100.c index 80457921..9cd5cf4d 100644 --- a/bootstrap/unix-48/VT100.c +++ b/bootstrap/unix-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/VT100.h b/bootstrap/unix-48/VT100.h index 1a589c43..8f60c652 100644 --- a/bootstrap/unix-48/VT100.h +++ b/bootstrap/unix-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index 46b1acc2..fa840303 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -82,7 +82,7 @@ void extTools_Assemble (CHAR *moduleName, ADDRESS moduleName__len) Strings_Append((CHAR*)"-c ", 4, (void*)cmd, 1023); Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); Strings_Append((CHAR*)".c", 3, (void*)cmd, 1023); - extTools_execute((CHAR*)"Assemble: ", 11, cmd, 1023); + extTools_execute((CHAR*)"C compile: ", 12, cmd, 1023); __DEL(moduleName); } @@ -106,7 +106,7 @@ void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN stati Strings_Append((CHAR*)"-O", 3, (void*)cmd, 1023); Strings_Append(OPM_Model, 10, (void*)cmd, 1023); Strings_Append((CHAR*)"", 1, (void*)cmd, 1023); - extTools_execute((CHAR*)"Assemble and link: ", 20, cmd, 1023); + extTools_execute((CHAR*)"C compile and link: ", 21, cmd, 1023); __DEL(additionalopts); } diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index 4201df04..a93b6c85 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/Compiler.c b/bootstrap/unix-88/Compiler.c index d13ed803..993c2bac 100644 --- a/bootstrap/unix-88/Compiler.c +++ b/bootstrap/unix-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 @@ -122,7 +122,7 @@ static void Compiler_FindLocalObjectFiles (CHAR *objectnames, ADDRESS objectname Strings_Append((CHAR*)" ", 2, (void*)objectnames, objectnames__len); Strings_Append(fn, 64, (void*)objectnames, objectnames__len); } else { - OPM_LogVT100((CHAR*)"33m", 4); + OPM_LogVT100((CHAR*)"91m", 4); OPM_LogWStr((CHAR*)"Link warning: a local symbol file is present for module ", 57); OPM_LogWStr(l->name, 256); OPM_LogWStr((CHAR*)", but local object file '", 26); diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index eb305bbe..80b87b1d 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index d10b5011..cdc285e5 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 10fc58d0..d4425bbe 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -69,9 +69,6 @@ static void Files_CloseOSFile (Files_File f); static void Files_Create (Files_File f); export void Files_Delete (CHAR *name, ADDRESS name__len, INT16 *res); static void Files_Deregister (CHAR *name, ADDRESS name__len); -export void Files_DumpBuffer (Files_Buffer b, INT16 indent); -export void Files_DumpFile (Files_File f, INT16 indent); -export void Files_DumpRider (Files_Rider r, INT16 indent); static void Files_Err (CHAR *s, ADDRESS s__len, Files_File f, INT16 errcode); static void Files_Finalize (SYSTEM_PTR o); static void Files_FlipBytes (SYSTEM_BYTE *src, ADDRESS src__len, SYSTEM_BYTE *dest, ADDRESS dest__len); @@ -102,7 +99,6 @@ export void Files_Rename (CHAR *old, ADDRESS old__len, CHAR *new, ADDRESS new__l static void Files_ScanPath (INT16 *pos, CHAR *dir, ADDRESS dir__len); export void Files_Set (Files_Rider *r, ADDRESS *r__typ, Files_File f, INT32 pos); export void Files_SetSearchPath (CHAR *path, ADDRESS path__len); -static void Files_Spaces (INT16 i); export void Files_Write (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE x); export void Files_WriteBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN x); export void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS x__len, INT32 n); @@ -116,132 +112,6 @@ export void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, ADDRESS #define Files_IdxTrap() __HALT(-1) -static void Files_Spaces (INT16 i) -{ - while (i > 0) { - Out_String((CHAR*)" ", 3); - i -= 1; - } -} - -void Files_DumpFile (Files_File f, INT16 indent) -{ - Files_Spaces(indent); - Out_String((CHAR*)"workName: ", 15); - Out_String(f->workName, 101); - Out_Ln(); - Files_Spaces(indent); - Out_String((CHAR*)"registerName: ", 15); - Out_String(f->registerName, 101); - Out_Ln(); - Files_Spaces(indent); - Out_String((CHAR*)"tempFile: ", 15); - if (f->tempFile) { - Out_String((CHAR*)"TRUE", 5); - } else { - Out_String((CHAR*)"FALSE", 6); - } - Out_Ln(); - Files_Spaces(indent); - Out_String((CHAR*)"identity: ", 15); - Out_String((CHAR*)"...", 4); - Out_Ln(); - Files_Spaces(indent); - Out_String((CHAR*)"fd: ", 15); - Out_Int(f->fd, 1); - Out_Ln(); - Files_Spaces(indent); - Out_String((CHAR*)"len, ", 15); - Out_Int(f->len, 1); - Out_Ln(); - Files_Spaces(indent); - Out_String((CHAR*)"pos: ", 15); - Out_Int(f->pos, 1); - Out_Ln(); - Files_Spaces(indent); - Out_String((CHAR*)"bufs: ", 15); - Out_String((CHAR*)"...", 4); - Out_Ln(); - Files_Spaces(indent); - Out_String((CHAR*)"swapper: ", 15); - Out_Int(f->swapper, 1); - Out_Ln(); - Files_Spaces(indent); - Out_String((CHAR*)"state: ", 15); - Out_Int(f->state, 1); - Out_Ln(); - Files_Spaces(indent); - Out_String((CHAR*)"next: ", 15); - Out_Hex((INT64)(ADDRESS)f->next, 1); - Out_Ln(); -} - -void Files_DumpBuffer (Files_Buffer b, INT16 indent) -{ - Files_Spaces(indent); - Out_String((CHAR*)"chg: ", 7); - if (b->chg) { - Out_String((CHAR*)"TRUE", 5); - } else { - Out_String((CHAR*)"FALSE", 6); - } - Out_Ln(); - Files_Spaces(indent); - Out_String((CHAR*)"org: ", 7); - Out_Int(b->org, 1); - Out_Ln(); - Files_Spaces(indent); - Out_String((CHAR*)"size: ", 7); - Out_Int(b->size, 1); - Out_Ln(); - Files_Spaces(indent); - Out_String((CHAR*)"data: ", 7); - Out_Ln(); - Out_HexDump((void*)b->data, 4096); - Files_Spaces(indent); - Out_String((CHAR*)"f: ", 7); - if (b->f == NIL) { - Out_String((CHAR*)"", 6); - Out_Ln(); - } else { - Out_Ln(); - Files_DumpFile(b->f, indent + 1); - } -} - -void Files_DumpRider (Files_Rider r, INT16 indent) -{ - Files_Spaces(indent); - Out_String((CHAR*)"res: ", 9); - Out_Int(r.res, 1); - Out_Ln(); - Files_Spaces(indent); - Out_String((CHAR*)"eof: ", 9); - if (r.eof) { - Out_String((CHAR*)"TRUE", 5); - } else { - Out_String((CHAR*)"FALSE", 6); - } - Out_Ln(); - Files_Spaces(indent); - Out_String((CHAR*)"org: ", 9); - Out_Int(r.org, 1); - Out_Ln(); - Files_Spaces(indent); - Out_String((CHAR*)"offset: ", 9); - Out_Int(r.offset, 1); - Out_Ln(); - Files_Spaces(indent); - Out_String((CHAR*)"buf: ", 9); - if (r.buf == NIL) { - Out_String((CHAR*)"", 6); - Out_Ln(); - } else { - Out_Ln(); - Files_DumpBuffer(r.buf, indent + 1); - } -} - static void Files_Assert (BOOLEAN truth) { if (!truth) { diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 5b4a0859..a34a1758 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,19 +1,10 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h #include "SYSTEM.h" -typedef - struct Files_BufDesc { - INT64 _prvt0; - char _prvt1[4108]; - } Files_BufDesc; - -typedef - Files_BufDesc *Files_Buffer; - typedef struct Files_FileDesc *Files_File; @@ -34,16 +25,12 @@ typedef import ADDRESS *Files_FileDesc__typ; -import ADDRESS *Files_BufDesc__typ; import ADDRESS *Files_Rider__typ; import Files_File Files_Base (Files_Rider *r, ADDRESS *r__typ); import void Files_ChangeDirectory (CHAR *path, ADDRESS path__len, INT16 *res); import void Files_Close (Files_File f); import void Files_Delete (CHAR *name, ADDRESS name__len, INT16 *res); -import void Files_DumpBuffer (Files_Buffer b, INT16 indent); -import void Files_DumpFile (Files_File f, INT16 indent); -import void Files_DumpRider (Files_Rider r, INT16 indent); import void Files_GetDate (Files_File f, INT32 *t, INT32 *d); import void Files_GetName (Files_File f, CHAR *name, ADDRESS name__len); import INT32 Files_Length (Files_File f); diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index 9f808e0f..aeebff17 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index ac0c9a94..ff1a1b07 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 3d520568..c66fe5bd 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index 13be7215..5e518753 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index bb4ea138..19e40505 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index 6757803a..71d82def 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index 093bb886..a5f41a8e 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index a32c29e0..38a2b01d 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index dc8eecc1..143546fd 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -63,6 +63,7 @@ export void OPM_Init (BOOLEAN *done); export void OPM_InitOptions (void); export INT16 OPM_Integer (INT64 n); static BOOLEAN OPM_IsProbablyInstallDir (CHAR *s, ADDRESS s__len); +export void OPM_LogCompiling (CHAR *modname, ADDRESS modname__len); static void OPM_LogErrMsg (INT16 n); export void OPM_LogVT100 (CHAR *vt100code, ADDRESS vt100code__len); export void OPM_LogW (CHAR ch); @@ -92,7 +93,6 @@ export void OPM_SymWInt (INT64 i); export void OPM_SymWLReal (LONGREAL lr); export void OPM_SymWReal (REAL r); export void OPM_SymWSet (UINT64 s); -static void OPM_VerboseListSizes (void); export void OPM_Write (CHAR ch); export void OPM_WriteHex (INT64 i); export void OPM_WriteInt (INT64 i); @@ -136,6 +136,27 @@ void OPM_LogVT100 (CHAR *vt100code, ADDRESS vt100code__len) __DEL(vt100code); } +void OPM_LogCompiling (CHAR *modname, ADDRESS modname__len) +{ + __DUP(modname, modname__len, CHAR); + OPM_LogWStr((CHAR*)"Compiling ", 11); + OPM_LogWStr(modname, modname__len); + if (__IN(18, OPM_Options, 32)) { + OPM_LogWStr((CHAR*)", s:", 5); + OPM_LogWNum(__ASHL(OPM_ShortintSize, 3), 1); + OPM_LogWStr((CHAR*)" i:", 4); + OPM_LogWNum(__ASHL(OPM_IntegerSize, 3), 1); + OPM_LogWStr((CHAR*)" l:", 4); + OPM_LogWNum(__ASHL(OPM_LongintSize, 3), 1); + OPM_LogWStr((CHAR*)" adr:", 6); + OPM_LogWNum(__ASHL(OPM_AddressSize, 3), 1); + OPM_LogWStr((CHAR*)" algn:", 7); + OPM_LogWNum(__ASHL(OPM_Alignment, 3), 1); + } + OPM_LogW('.'); + __DEL(modname); +} + INT64 OPM_SignedMaximum (INT32 bytecount) { INT64 result; @@ -363,32 +384,6 @@ BOOLEAN OPM_OpenPar (void) __RETCHK; } -static void OPM_VerboseListSizes (void) -{ - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Type Size", 15); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"SHORTINT ", 12); - OPM_LogWNum(OPM_ShortintSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"INTEGER ", 12); - OPM_LogWNum(OPM_IntegerSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"LONGINT ", 12); - OPM_LogWNum(OPM_LongintSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"SET ", 12); - OPM_LogWNum(OPM_LongintSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"ADDRESS ", 12); - OPM_LogWNum(OPM_AddressSize, 4); - OPM_LogWLn(); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Alignment: ", 12); - OPM_LogWNum(OPM_Alignment, 4); - OPM_LogWLn(); -} - void OPM_InitOptions (void) { CHAR s[256]; @@ -432,9 +427,6 @@ void OPM_InitOptions (void) OPM_LongintSize = 4; break; } - if (__IN(18, OPM_Options, 32)) { - OPM_VerboseListSizes(); - } __MOVE(OPM_InstallDir, OPM_ResourceDir, 1024); if (OPM_ResourceDir[0] != 0x00) { Strings_Append((CHAR*)"/", 2, (void*)OPM_ResourceDir, 1024); @@ -491,17 +483,6 @@ void OPM_Get (CHAR *ch) { OPM_curpos = Texts_Pos(&OPM_inR, Texts_Reader__typ); Texts_Read(&OPM_inR, Texts_Reader__typ, &*ch); - if ((OPM_curpos == 0 && OPM_inR.eot)) { - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"DEBUG: OPM.Get returned inR.eot at curpos = 0, ch = ", 53); - OPM_LogWNum((INT16)*ch, 1); - OPM_LogW('.'); - Texts_DumpReader(OPM_inR); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Heap dump:", 11); - OPM_LogWLn(); - Out_DumpHeap(); - } if ((*ch < 0x09 && !OPM_inR.eot)) { *ch = ' '; } diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index f246eacb..96318bea 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h @@ -33,6 +33,7 @@ import void OPM_Get (CHAR *ch); import void OPM_Init (BOOLEAN *done); import void OPM_InitOptions (void); import INT16 OPM_Integer (INT64 n); +import void OPM_LogCompiling (CHAR *modname, ADDRESS modname__len); import void OPM_LogVT100 (CHAR *vt100code, ADDRESS vt100code__len); import void OPM_LogW (CHAR ch); import void OPM_LogWLn (void); diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index 911d0bf7..52620168 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -1796,9 +1796,7 @@ void OPP_Module (OPT_Node *prog, UINT32 opt) OPP_err(16); } if (OPP_sym == 38) { - OPM_LogWStr((CHAR*)"compiling ", 11); - OPM_LogWStr(OPS_name, 256); - OPM_LogW('.'); + OPM_LogCompiling(OPS_name, 256); OPT_Init(OPS_name, opt); OPS_Get(&OPP_sym); OPP_CheckSym(39); diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index 913d2eef..aa076aaa 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index abfcd4b8..bf9f1af5 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index 9e15ba4e..09a33705 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index 68c085a5..d89ea5c8 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 228191bf..63bf2070 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 7340919d..69e2f94e 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index ea04b5b8..c6a107b6 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Out.c b/bootstrap/unix-88/Out.c index b5fb4689..23d917c7 100644 --- a/bootstrap/unix-88/Out.c +++ b/bootstrap/unix-88/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -14,19 +14,10 @@ export BOOLEAN Out_IsConsole; static CHAR Out_buf[128]; static INT16 Out_in; -static ADDRESS *typedesc__11__typ; -static ADDRESS *blockdesc__5__typ; -static ADDRESS *chunkdesc__7__typ; export void Out_Char (CHAR ch); -export void Out_DumpHeap (void); -static void Out_DumpModule (Heap_Module m); -export void Out_DumpTag (INT64 addr); -export void Out_DumpType (SYSTEM_BYTE *o, ADDRESS o__len); export void Out_Flush (void); export void Out_Hex (INT64 x, INT64 n); -export void Out_HexDump (SYSTEM_BYTE *m, ADDRESS m__len); -export void Out_HexDumpAdr (INT64 adr, INT64 offset, INT32 length); export void Out_Int (INT64 x, INT64 n); static INT32 Out_Length (CHAR *s, ADDRESS s__len); export void Out_Ln (void); @@ -40,8 +31,6 @@ static void Out_digit (INT64 n, CHAR *s, ADDRESS s__len, INT16 *i); static void Out_prepend (CHAR *t, ADDRESS t__len, CHAR *s, ADDRESS s__len, INT16 *i); #define Out_Entier64(x) (INT64)(x) -extern ADDRESS Heap_heap; -#define Out_getheap() Heap_heap void Out_Flush (void) { @@ -139,8 +128,10 @@ void Out_Hex (INT64 x, INT64 n) } else if (n > 16) { n = 16; } - while ((n < 16 && __LSH(x, -__ASHL(n, 2), 64) != 0)) { - n += 1; + if (x >= 0) { + while ((n < 16 && __LSH(x, -__ASHL(n, 2), 64) != 0)) { + n += 1; + } } x = __ROT(x, __ASHL(16 - n, 2), 64); while (n > 0) { @@ -160,235 +151,6 @@ void Out_Ln (void) Out_Flush(); } -void Out_HexDumpAdr (INT64 adr, INT64 offset, INT32 length) -{ - INT16 i; - INT64 n, lim; - CHAR c; - lim = (INT64)(adr + (INT64)length); - while (adr < lim) { - if (adr + 16 < lim) { - n = 16; - } else { - n = lim - adr; - } - Out_Hex(offset, 8); - Out_Char(' '); - i = 0; - while ((INT64)i < n) { - if (__MASK(i, -4) == 0) { - Out_Char(' '); - } - __GET(adr + (INT64)i, c, CHAR); - Out_Hex((INT16)c, 2); - Out_Char(' '); - i += 1; - } - while (i < 16) { - if (__MASK(i, -4) == 0) { - Out_Char(' '); - } - Out_String((CHAR*)" ", 4); - i += 1; - } - Out_String((CHAR*)" ", 2); - i = 0; - while ((INT64)i < n) { - __GET(adr + (INT64)i, c, CHAR); - if ((INT16)c < 32 || (INT16)c > 126) { - Out_Char('.'); - } else { - Out_Char(c); - } - i += 1; - } - adr += n; - offset += n; - Out_Ln(); - } -} - -void Out_HexDump (SYSTEM_BYTE *m, ADDRESS m__len) -{ - Out_HexDumpAdr((ADDRESS)m, 0, m__len); -} - -static void Out_DumpModule (Heap_Module m) -{ - Out_String((CHAR*)" next: ", 19); - Out_Hex((INT64)(ADDRESS)m->next, 1); - Out_Ln(); - Out_String((CHAR*)" name: ", 19); - Out_String(m->name, 20); - Out_Ln(); - Out_String((CHAR*)" refcnt: ", 19); - Out_Hex(m->refcnt, 1); - Out_Ln(); - Out_String((CHAR*)" cmds: ", 19); - Out_Hex((INT64)(ADDRESS)m->cmds, 1); - Out_Ln(); - Out_String((CHAR*)" types: ", 19); - Out_Hex(m->types, 1); - Out_Ln(); - Out_String((CHAR*)" enumPtrs: ", 19); - Out_Hex((INT64)(ADDRESS)m->enumPtrs, 1); - Out_Ln(); -} - -typedef - struct typedesc__11 *tag__10; - -typedef - struct typedesc__11 { - INT64 tag, next, level, module; - CHAR name[24]; - INT64 bases[16]; - INT64 reserved, blksz, ptr0; - } typedesc__11; - -void Out_DumpTag (INT64 addr) -{ - tag__10 desc = NIL; - INT16 i; - Out_String((CHAR*)" obj tag: ", 17); - Out_Hex(addr, 1); - Out_Ln(); - addr -= __MASK(addr, -2); - desc = (tag__10)(ADDRESS)(addr - 192); - Out_String((CHAR*)" desc at: ", 17); - Out_Hex((INT64)(ADDRESS)desc, 1); - Out_Ln(); - Out_String((CHAR*)" desc contains:", 21); - Out_Ln(); - Out_String((CHAR*)" tag: ", 17); - Out_Hex(desc->tag, 1); - Out_Ln(); - Out_String((CHAR*)" next: ", 17); - Out_Hex(desc->next, 1); - Out_Ln(); - Out_String((CHAR*)" level: ", 17); - Out_Hex(desc->level, 1); - Out_Ln(); - Out_String((CHAR*)" module: ", 17); - Out_Hex(desc->module, 1); - Out_Ln(); - if (desc->module != 0) { - Out_DumpModule((Heap_Module)(ADDRESS)desc->module); - } - Out_String((CHAR*)" name: ", 17); - Out_String(desc->name, 24); - Out_Ln(); - Out_String((CHAR*)" bases: ", 17); - i = 0; - while (i < 16) { - Out_Hex(desc->bases[__X(i, 16)], 16); - if (__MASK(i, -4) == 3) { - Out_Ln(); - Out_String((CHAR*)" ", 17); - } else { - Out_Char(' '); - } - i += 1; - } - Out_Ln(); - Out_String((CHAR*)" reserved: ", 17); - Out_Hex(desc->reserved, 1); - Out_Ln(); - Out_String((CHAR*)" blksz: ", 17); - Out_Hex(desc->blksz, 1); - Out_Ln(); - Out_String((CHAR*)" ptr0: ", 17); - Out_Hex(desc->ptr0, 1); - Out_Ln(); -} - -void Out_DumpType (SYSTEM_BYTE *o, ADDRESS o__len) -{ - INT64 addr; - __GET((ADDRESS)o - 8, addr, INT64); - Out_DumpTag(addr); -} - -typedef - INT64 (*adrptr__3)[1]; - -typedef - struct blockdesc__5 *block__4; - -typedef - struct blockdesc__5 { - INT64 tag, size, sentinel, next; - } blockdesc__5; - -typedef - struct chunkdesc__7 *chunk__6; - -typedef - struct chunkdesc__7 { - INT64 next, end, reserved; - blockdesc__5 firstblock; - } chunkdesc__7; - -void Out_DumpHeap (void) -{ - INT64 caddr; - chunk__6 c = NIL; - INT64 baddr; - block__4 b = NIL; - adrptr__3 tag = NIL; - caddr = Heap_heap; - while (caddr != 0) { - Out_String((CHAR*)"Chunk at: ", 11); - Out_Hex(caddr, 1); - Out_Ln(); - c = (chunk__6)(ADDRESS)caddr; - Out_String((CHAR*)" next: ", 11); - Out_Hex(c->next, 1); - Out_Ln(); - Out_String((CHAR*)" end: ", 11); - Out_Hex(c->end, 1); - Out_String((CHAR*)" => size: ", 11); - Out_Hex(c->end - caddr, 1); - Out_Ln(); - Out_String((CHAR*)" rsvd: ", 11); - Out_Hex(c->reserved, 1); - Out_Ln(); - baddr = (ADDRESS)&c->firstblock; - while (c->end - baddr > 0) { - Out_String((CHAR*)" Block at: ", 15); - Out_Hex(baddr, 1); - Out_Ln(); - b = (block__4)(ADDRESS)baddr; - tag = (adrptr__3)(ADDRESS)(b->tag - __MASK(b->tag, -2)); - Out_String((CHAR*)" tag: ", 15); - Out_Hex(b->tag, 1); - if (__MASK(b->tag, -2) != 0) { - Out_String((CHAR*)" <--- ODD! ---", 15); - } - Out_Ln(); - Out_String((CHAR*)" tag^: ", 15); - Out_Hex((*tag)[0], 1); - Out_Ln(); - Out_String((CHAR*)" size: ", 15); - Out_Hex(b->size, 1); - Out_Ln(); - Out_String((CHAR*)" sentinel: ", 15); - Out_Hex(b->sentinel, 1); - Out_Ln(); - Out_String((CHAR*)" next: ", 15); - Out_Hex(b->next, 1); - Out_Ln(); - if (b->tag != (ADDRESS)&b->size) { - Out_DumpTag(b->tag); - } - baddr += (*tag)[0]; - Out_Ln(); - } - caddr = c->next; - Out_Ln(); - } -} - static void Out_digit (INT64 n, CHAR *s, ADDRESS s__len, INT16 *i) { *i -= 1; @@ -566,9 +328,6 @@ void Out_LongReal (LONGREAL x, INT16 n) Out_RealP(x, n, 1); } -__TDESC(typedesc__11, 1, 0) = {__TDFLDS("typedesc__11", 208), {-8}}; -__TDESC(blockdesc__5, 1, 0) = {__TDFLDS("blockdesc__5", 32), {-8}}; -__TDESC(chunkdesc__7, 1, 0) = {__TDFLDS("chunkdesc__7", 56), {-8}}; export void *Out__init(void) { @@ -576,13 +335,9 @@ export void *Out__init(void) __MODULE_IMPORT(Heap); __MODULE_IMPORT(Platform); __REGMOD("Out", 0); - __REGCMD("DumpHeap", Out_DumpHeap); __REGCMD("Flush", Out_Flush); __REGCMD("Ln", Out_Ln); __REGCMD("Open", Out_Open); - __INITYP(typedesc__11, typedesc__11, 0); - __INITYP(blockdesc__5, blockdesc__5, 0); - __INITYP(chunkdesc__7, chunkdesc__7, 0); /* BEGIN */ Out_IsConsole = Platform_IsConsole(1); Out_in = 0; diff --git a/bootstrap/unix-88/Out.h b/bootstrap/unix-88/Out.h index fe405da3..e1285046 100644 --- a/bootstrap/unix-88/Out.h +++ b/bootstrap/unix-88/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h @@ -10,13 +10,8 @@ import BOOLEAN Out_IsConsole; import void Out_Char (CHAR ch); -import void Out_DumpHeap (void); -import void Out_DumpTag (INT64 addr); -import void Out_DumpType (SYSTEM_BYTE *o, ADDRESS o__len); import void Out_Flush (void); import void Out_Hex (INT64 x, INT64 n); -import void Out_HexDump (SYSTEM_BYTE *m, ADDRESS m__len); -import void Out_HexDumpAdr (INT64 adr, INT64 offset, INT32 length); import void Out_Int (INT64 x, INT64 n); import void Out_Ln (void); import void Out_LongReal (LONGREAL x, INT16 n); diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 0cf3f0c3..4d25035f 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index 38fee3de..76f5da00 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 9b449f98..d1eb72f6 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index 3e83af42..170d1785 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index f9b5310a..225bd40a 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index 58f9b546..4d98f1a3 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index 429d0665..565de43f 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -192,11 +192,6 @@ export void Texts_Close (Texts_Text T, CHAR *name, ADDRESS name__len); export void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); export void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); export void Texts_Delete (Texts_Text T, INT32 beg, INT32 end); -static void Texts_DumpElem (Texts_Elem e); -static void Texts_DumpPiece (Texts_Piece p); -export void Texts_DumpReader (Texts_Reader re); -static void Texts_DumpRun (Texts_Run ru); -static void Texts_DumpText (Texts_Text t); export Texts_Text Texts_ElemBase (Texts_Elem E); export INT32 Texts_ElemPos (Texts_Elem E); static void Texts_Find (Texts_Text T, INT32 *pos, Texts_Run *u, INT32 *org, INT32 *off); @@ -238,161 +233,6 @@ export void Texts_WriteRealHex (Texts_Writer *W, ADDRESS *W__typ, REAL x); export void Texts_WriteString (Texts_Writer *W, ADDRESS *W__typ, CHAR *s, ADDRESS s__len); -static void Texts_DumpText (Texts_Text t) -{ - Out_String((CHAR*)" len: ", 15); - Out_Int(t->len, 1); - Out_Ln(); - Out_String((CHAR*)" notify: ", 15); - Out_Hex((INT64)(ADDRESS)t->notify, 1); - Out_Ln(); - Out_String((CHAR*)" head: ", 15); - Out_Hex((INT64)(ADDRESS)t->head, 1); - Out_Ln(); - Out_String((CHAR*)" cache: ", 15); - Out_Hex((INT64)(ADDRESS)t->cache, 1); - Out_Ln(); - Out_String((CHAR*)" corg: ", 15); - Out_Int(t->corg, 1); - Out_Ln(); -} - -static void Texts_DumpRun (Texts_Run ru) -{ - Out_String((CHAR*)" Run at ", 12); - Out_Hex((INT64)(ADDRESS)ru, 1); - Out_Ln(); - Out_String((CHAR*)" prev: ", 12); - Out_Hex((INT64)(ADDRESS)ru->prev, 1); - Out_Ln(); - Out_String((CHAR*)" next: ", 12); - Out_Hex((INT64)(ADDRESS)ru->next, 1); - Out_Ln(); - Out_String((CHAR*)" len: ", 12); - Out_Int(ru->len, 1); - Out_Ln(); - Out_String((CHAR*)" fnt: ", 12); - if (ru->fnt != NIL) { - Out_String(ru->fnt->name, 32); - } else { - Out_String((CHAR*)"", 6); - } - Out_Ln(); - Out_String((CHAR*)" col: ", 12); - Out_Int(ru->col, 1); - Out_Ln(); - Out_String((CHAR*)" voff: ", 12); - Out_Int(ru->voff, 1); - Out_Ln(); - Out_String((CHAR*)" ascii: ", 12); - if (ru->ascii) { - Out_String((CHAR*)"TRUE", 5); - } else { - Out_String((CHAR*)"FALSE", 6); - } - Out_Ln(); -} - -static void Texts_DumpElem (Texts_Elem e) -{ - Texts_DumpRun((void*)e); - Out_String((CHAR*)" -- Elem --", 15); - Out_Ln(); - Out_String((CHAR*)" W: ", 13); - Out_Int(e->W, 1); - Out_Ln(); - Out_String((CHAR*)" H: ", 13); - Out_Int(e->H, 1); - Out_Ln(); - Out_String((CHAR*)" handle: ", 13); - Out_Hex((INT64)(ADDRESS)e->handle, 1); - Out_Ln(); - Out_String((CHAR*)" base: ", 13); - if (e->base == NIL) { - Out_String((CHAR*)"", 6); - Out_Ln(); - } else { - Out_Ln(); - Texts_DumpText(e->base); - } -} - -static void Texts_DumpPiece (Texts_Piece p) -{ - Texts_DumpRun((void*)p); - Out_String((CHAR*)" -- Piece --", 16); - Out_Ln(); - Out_String((CHAR*)" file: ", 12); - if (p->file == NIL) { - Out_String((CHAR*)"", 6); - Out_Ln(); - } else { - Out_Ln(); - Files_DumpFile(p->file, 3); - } - Out_String((CHAR*)" org: ", 12); - Out_Int(p->org, 1); - Out_Ln(); -} - -void Texts_DumpReader (Texts_Reader re) -{ - Out_String((CHAR*)"Reader:", 8); - Out_Ln(); - Out_String((CHAR*)" eot: ", 10); - if (re.eot) { - Out_String((CHAR*)"TRUE", 5); - } else { - Out_String((CHAR*)"FALSE", 6); - } - Out_Ln(); - Out_String((CHAR*)" fnt: ", 10); - if (re.fnt != NIL) { - Out_String(re.fnt->name, 32); - } else { - Out_String((CHAR*)"", 6); - } - Out_Ln(); - Out_String((CHAR*)" col: ", 10); - Out_Int(re.col, 1); - Out_Ln(); - Out_String((CHAR*)" voff: ", 10); - Out_Int(re.voff, 1); - Out_Ln(); - Out_String((CHAR*)" org: ", 10); - Out_Int(re.org, 1); - Out_Ln(); - Out_String((CHAR*)" off: ", 10); - Out_Int(re.off, 1); - Out_Ln(); - Out_String((CHAR*)" elem: ", 10); - if (re.elem == NIL) { - Out_String((CHAR*)"", 6); - Out_Ln(); - } else { - Out_Ln(); - Texts_DumpElem(re.elem); - } - Out_String((CHAR*)" rider: ", 10); - Out_Ln(); - Files_DumpRider(re.rider, 2); - Out_String((CHAR*)" run: ", 10); - if (re.run == NIL) { - Out_String((CHAR*)"", 6); - Out_Ln(); - } else { - Out_Ln(); - if (__ISP(re.run, Texts_PieceDesc, 1)) { - Texts_DumpPiece(__GUARDP(re.run, Texts_PieceDesc, 1)); - } else if (__ISP(re.run, Texts_ElemDesc, 1)) { - Texts_DumpElem(__GUARDP(re.run, Texts_ElemDesc, 1)); - } else { - Texts_DumpRun(re.run); - } - } - Out_DumpType((void*)&*re.run, 40); -} - static Texts_FontsFont Texts_FontsThis (CHAR *name, ADDRESS name__len) { Texts_FontsFont F = NIL; @@ -877,32 +717,32 @@ void Texts_OpenScanner (Texts_Scanner *S, ADDRESS *S__typ, Texts_Text T, INT32 p (*S).nextCh = ' '; } -static struct Scan__36 { +static struct Scan__31 { Texts_Scanner *S; ADDRESS *S__typ; CHAR *ch; BOOLEAN *negE; INT16 *e; - struct Scan__36 *lnk; -} *Scan__36_s; + struct Scan__31 *lnk; +} *Scan__31_s; -static void ReadScaleFactor__37 (void); +static void ReadScaleFactor__32 (void); -static void ReadScaleFactor__37 (void) +static void ReadScaleFactor__32 (void) { - Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); - if (*Scan__36_s->ch == '-') { - *Scan__36_s->negE = 1; - Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); + Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); + if (*Scan__31_s->ch == '-') { + *Scan__31_s->negE = 1; + Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); } else { - *Scan__36_s->negE = 0; - if (*Scan__36_s->ch == '+') { - Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); + *Scan__31_s->negE = 0; + if (*Scan__31_s->ch == '+') { + Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); } } - while (('0' <= *Scan__36_s->ch && *Scan__36_s->ch <= '9')) { - *Scan__36_s->e = (*Scan__36_s->e * 10 + (INT16)*Scan__36_s->ch) - 48; - Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); + while (('0' <= *Scan__31_s->ch && *Scan__31_s->ch <= '9')) { + *Scan__31_s->e = (*Scan__31_s->e * 10 + (INT16)*Scan__31_s->ch) - 48; + Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); } } @@ -916,13 +756,13 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) REAL x, f; LONGREAL y, g; CHAR d[32]; - struct Scan__36 _s; + struct Scan__31 _s; _s.S = S; _s.S__typ = S__typ; _s.ch = &ch; _s.negE = &negE; _s.e = &e; - _s.lnk = Scan__36_s; - Scan__36_s = &_s; + _s.lnk = Scan__31_s; + Scan__31_s = &_s; ch = (*S).nextCh; i = 0; for (;;) { @@ -1023,7 +863,7 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) y = ((INT16)d[__X(j, 32)] - 48) * g + y; j += 1; } - ReadScaleFactor__37(); + ReadScaleFactor__32(); if (negE) { if (e <= 308) { y = y / (LONGREAL)Reals_TenL(e); @@ -1056,7 +896,7 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) j += 1; } if (ch == 'E') { - ReadScaleFactor__37(); + ReadScaleFactor__32(); } if (negE) { if (e <= 38) { @@ -1109,7 +949,7 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) } } (*S).nextCh = ch; - Scan__36_s = _s.lnk; + Scan__31_s = _s.lnk; } void Texts_OpenWriter (Texts_Writer *W, ADDRESS *W__typ) @@ -1328,30 +1168,30 @@ void Texts_WriteReal (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n) } } -static struct WriteRealFix__58 { +static struct WriteRealFix__53 { Texts_Writer *W; ADDRESS *W__typ; INT16 *i; CHAR (*d)[9]; - struct WriteRealFix__58 *lnk; -} *WriteRealFix__58_s; + struct WriteRealFix__53 *lnk; +} *WriteRealFix__53_s; -static void dig__59 (INT16 n); -static void seq__61 (CHAR ch, INT16 n); +static void dig__54 (INT16 n); +static void seq__56 (CHAR ch, INT16 n); -static void seq__61 (CHAR ch, INT16 n) +static void seq__56 (CHAR ch, INT16 n) { while (n > 0) { - Texts_Write(&*WriteRealFix__58_s->W, WriteRealFix__58_s->W__typ, ch); + Texts_Write(&*WriteRealFix__53_s->W, WriteRealFix__53_s->W__typ, ch); n -= 1; } } -static void dig__59 (INT16 n) +static void dig__54 (INT16 n) { while (n > 0) { - *WriteRealFix__58_s->i -= 1; - Texts_Write(&*WriteRealFix__58_s->W, WriteRealFix__58_s->W__typ, (*WriteRealFix__58_s->d)[__X(*WriteRealFix__58_s->i, 9)]); + *WriteRealFix__53_s->i -= 1; + Texts_Write(&*WriteRealFix__53_s->W, WriteRealFix__53_s->W__typ, (*WriteRealFix__53_s->d)[__X(*WriteRealFix__53_s->i, 9)]); n -= 1; } } @@ -1362,23 +1202,23 @@ void Texts_WriteRealFix (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n, INT1 CHAR sign; REAL x0; CHAR d[9]; - struct WriteRealFix__58 _s; + struct WriteRealFix__53 _s; _s.W = W; _s.W__typ = W__typ; _s.i = &i; _s.d = (void*)d; - _s.lnk = WriteRealFix__58_s; - WriteRealFix__58_s = &_s; + _s.lnk = WriteRealFix__53_s; + WriteRealFix__53_s = &_s; e = Reals_Expo(x); if (k < 0) { k = 0; } if (e == 0) { - seq__61(' ', (n - k) - 2); + seq__56(' ', (n - k) - 2); Texts_Write(&*W, W__typ, '0'); - seq__61(' ', k + 1); + seq__56(' ', k + 1); } else if (e == 255) { Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", 5); - seq__61(' ', n - 4); + seq__56(' ', n - 4); } else { e = __ASHR((e - 127) * 77, 8); if (x < (REAL)0) { @@ -1411,21 +1251,21 @@ void Texts_WriteRealFix (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n, INT1 i = k + e; Reals_Convert(x, i, (void*)d, 9); if (e > 0) { - seq__61(' ', ((n - e) - k) - 2); + seq__56(' ', ((n - e) - k) - 2); Texts_Write(&*W, W__typ, sign); - dig__59(e); + dig__54(e); Texts_Write(&*W, W__typ, '.'); - dig__59(k); + dig__54(k); } else { - seq__61(' ', (n - k) - 3); + seq__56(' ', (n - k) - 3); Texts_Write(&*W, W__typ, sign); Texts_Write(&*W, W__typ, '0'); Texts_Write(&*W, W__typ, '.'); - seq__61('0', -e); - dig__59(k + e); + seq__56('0', -e); + dig__54(k + e); } } - WriteRealFix__58_s = _s.lnk; + WriteRealFix__53_s = _s.lnk; } void Texts_WriteRealHex (Texts_Writer *W, ADDRESS *W__typ, REAL x) @@ -1524,48 +1364,48 @@ void Texts_WriteLongRealHex (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x) } while (!(i == 16)); } -static struct WriteDate__48 { +static struct WriteDate__43 { Texts_Writer *W; ADDRESS *W__typ; - struct WriteDate__48 *lnk; -} *WriteDate__48_s; + struct WriteDate__43 *lnk; +} *WriteDate__43_s; -static void WritePair__49 (CHAR ch, INT32 x); +static void WritePair__44 (CHAR ch, INT32 x); -static void WritePair__49 (CHAR ch, INT32 x) +static void WritePair__44 (CHAR ch, INT32 x) { - Texts_Write(&*WriteDate__48_s->W, WriteDate__48_s->W__typ, ch); - Texts_Write(&*WriteDate__48_s->W, WriteDate__48_s->W__typ, (CHAR)(__DIV(x, 10) + 48)); - Texts_Write(&*WriteDate__48_s->W, WriteDate__48_s->W__typ, (CHAR)((int)__MOD(x, 10) + 48)); + Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, ch); + Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)(__DIV(x, 10) + 48)); + Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)((int)__MOD(x, 10) + 48)); } void Texts_WriteDate (Texts_Writer *W, ADDRESS *W__typ, INT32 t, INT32 d) { - struct WriteDate__48 _s; + struct WriteDate__43 _s; _s.W = W; _s.W__typ = W__typ; - _s.lnk = WriteDate__48_s; - WriteDate__48_s = &_s; - WritePair__49(' ', __MASK(d, -32)); - WritePair__49('.', __MASK(__ASHR(d, 5), -16)); - WritePair__49('.', __MASK(__ASHR(d, 9), -128)); - WritePair__49(' ', __MASK(__ASHR(t, 12), -32)); - WritePair__49(':', __MASK(__ASHR(t, 6), -64)); - WritePair__49(':', __MASK(t, -64)); - WriteDate__48_s = _s.lnk; + _s.lnk = WriteDate__43_s; + WriteDate__43_s = &_s; + WritePair__44(' ', __MASK(d, -32)); + WritePair__44('.', __MASK(__ASHR(d, 5), -16)); + WritePair__44('.', __MASK(__ASHR(d, 9), -128)); + WritePair__44(' ', __MASK(__ASHR(t, 12), -32)); + WritePair__44(':', __MASK(__ASHR(t, 6), -64)); + WritePair__44(':', __MASK(t, -64)); + WriteDate__43_s = _s.lnk; } -static struct Load0__21 { +static struct Load0__16 { Texts_Text *T; INT8 *ecnt; Files_File *f; Texts_FileMsg *msg; CHAR (*mods)[64][32], (*procs)[64][32]; - struct Load0__21 *lnk; -} *Load0__21_s; + struct Load0__16 *lnk; +} *Load0__16_s; -static void LoadElem__22 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e); +static void LoadElem__17 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e); -static void LoadElem__22 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e) +static void LoadElem__17 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e) { Heap_Module M = NIL; Heap_Command Cmd; @@ -1576,15 +1416,15 @@ static void LoadElem__22 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span Files_ReadLInt(&*r, r__typ, &ew); Files_ReadLInt(&*r, r__typ, &eh); Files_Read(&*r, r__typ, (void*)&eno); - if (eno > *Load0__21_s->ecnt) { - *Load0__21_s->ecnt = eno; - Files_ReadString(&*r, r__typ, (void*)(*Load0__21_s->mods)[__X(eno, 64)], 32); - Files_ReadString(&*r, r__typ, (void*)(*Load0__21_s->procs)[__X(eno, 64)], 32); + if (eno > *Load0__16_s->ecnt) { + *Load0__16_s->ecnt = eno; + Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->mods)[__X(eno, 64)], 32); + Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->procs)[__X(eno, 64)], 32); } org = Files_Pos(&*r, r__typ); - M = Modules_ThisMod((*Load0__21_s->mods)[__X(eno, 64)], 32); + M = Modules_ThisMod((*Load0__16_s->mods)[__X(eno, 64)], 32); if (M != NIL) { - Cmd = Modules_ThisCommand(M, (*Load0__21_s->procs)[__X(eno, 64)], 32); + Cmd = Modules_ThisCommand(M, (*Load0__16_s->procs)[__X(eno, 64)], 32); if (Cmd != NIL) { (*Cmd)(); } @@ -1593,25 +1433,25 @@ static void LoadElem__22 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span if (*e != NIL) { (*e)->W = ew; (*e)->H = eh; - (*e)->base = *Load0__21_s->T; - (*Load0__21_s->msg).pos = pos; - (*(*e)->handle)(*e, (void*)&*Load0__21_s->msg, Texts_FileMsg__typ); + (*e)->base = *Load0__16_s->T; + (*Load0__16_s->msg).pos = pos; + (*(*e)->handle)(*e, (void*)&*Load0__16_s->msg, Texts_FileMsg__typ); if (Files_Pos(&*r, r__typ) != org + span) { *e = NIL; } } if (*e == NIL) { - Files_Set(&*r, r__typ, *Load0__21_s->f, org + span); + Files_Set(&*r, r__typ, *Load0__16_s->f, org + span); __NEW(a, Texts__1); a->W = ew; a->H = eh; a->handle = Texts_HandleAlien; - a->base = *Load0__21_s->T; - a->file = *Load0__21_s->f; + a->base = *Load0__16_s->T; + a->file = *Load0__16_s->f; a->org = org; a->span = span; - __COPY((*Load0__21_s->mods)[__X(eno, 64)], a->mod, 32); - __COPY((*Load0__21_s->procs)[__X(eno, 64)], a->proc, 32); + __COPY((*Load0__16_s->mods)[__X(eno, 64)], a->mod, 32); + __COPY((*Load0__16_s->procs)[__X(eno, 64)], a->proc, 32); *e = (Texts_Elem)a; } } @@ -1628,15 +1468,15 @@ static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) CHAR mods[64][32], procs[64][32]; CHAR name[32]; Texts_FontsFont fnts[32]; - struct Load0__21 _s; + struct Load0__16 _s; _s.T = &T; _s.ecnt = &ecnt; _s.f = &f; _s.msg = &msg; _s.mods = (void*)mods; _s.procs = (void*)procs; - _s.lnk = Load0__21_s; - Load0__21_s = &_s; + _s.lnk = Load0__16_s; + Load0__16_s = &_s; pos = Files_Pos(&*r, r__typ); f = Files_Base(&*r, r__typ); __NEW(u, Texts_RunDesc); @@ -1669,7 +1509,7 @@ static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) un = (Texts_Run)p; un->len = plen; } else { - LoadElem__22(&msg.r, Files_Rider__typ, pos - org, -plen, &e); + LoadElem__17(&msg.r, Files_Rider__typ, pos - org, -plen, &e); un = (Texts_Run)e; un->len = 1; } @@ -1687,7 +1527,7 @@ static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) T->corg = 0; Files_ReadLInt(&msg.r, Files_Rider__typ, &T->len); Files_Set(&*r, r__typ, f, Files_Pos(&msg.r, Files_Rider__typ) + T->len); - Load0__21_s = _s.lnk; + Load0__16_s = _s.lnk; } void Texts_Load (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) @@ -1756,25 +1596,25 @@ void Texts_Open (Texts_Text T, CHAR *name, ADDRESS name__len) __DEL(name); } -static struct Store__44 { +static struct Store__39 { INT8 *ecnt; Texts_FileMsg *msg; Texts_IdentifyMsg *iden; CHAR (*mods)[64][32], (*procs)[64][32]; - struct Store__44 *lnk; -} *Store__44_s; + struct Store__39 *lnk; +} *Store__39_s; -static void StoreElem__45 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e); +static void StoreElem__40 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e); -static void StoreElem__45 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e) +static void StoreElem__40 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e) { Files_Rider r1; INT32 org, span; INT8 eno; - __COPY((*Store__44_s->iden).mod, (*Store__44_s->mods)[__X(*Store__44_s->ecnt, 64)], 32); - __COPY((*Store__44_s->iden).proc, (*Store__44_s->procs)[__X(*Store__44_s->ecnt, 64)], 32); + __COPY((*Store__39_s->iden).mod, (*Store__39_s->mods)[__X(*Store__39_s->ecnt, 64)], 32); + __COPY((*Store__39_s->iden).proc, (*Store__39_s->procs)[__X(*Store__39_s->ecnt, 64)], 32); eno = 1; - while (__STRCMP((*Store__44_s->mods)[__X(eno, 64)], (*Store__44_s->iden).mod) != 0 || __STRCMP((*Store__44_s->procs)[__X(eno, 64)], (*Store__44_s->iden).proc) != 0) { + while (__STRCMP((*Store__39_s->mods)[__X(eno, 64)], (*Store__39_s->iden).mod) != 0 || __STRCMP((*Store__39_s->procs)[__X(eno, 64)], (*Store__39_s->iden).proc) != 0) { eno += 1; } Files_Set(&r1, Files_Rider__typ, Files_Base(&*r, r__typ), Files_Pos(&*r, r__typ)); @@ -1782,14 +1622,14 @@ static void StoreElem__45 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Ele Files_WriteLInt(&*r, r__typ, 0); Files_WriteLInt(&*r, r__typ, 0); Files_Write(&*r, r__typ, eno); - if (eno == *Store__44_s->ecnt) { - *Store__44_s->ecnt += 1; - Files_WriteString(&*r, r__typ, (*Store__44_s->iden).mod, 32); - Files_WriteString(&*r, r__typ, (*Store__44_s->iden).proc, 32); + if (eno == *Store__39_s->ecnt) { + *Store__39_s->ecnt += 1; + Files_WriteString(&*r, r__typ, (*Store__39_s->iden).mod, 32); + Files_WriteString(&*r, r__typ, (*Store__39_s->iden).proc, 32); } - (*Store__44_s->msg).pos = pos; + (*Store__39_s->msg).pos = pos; org = Files_Pos(&*r, r__typ); - (*e->handle)(e, (void*)&*Store__44_s->msg, Texts_FileMsg__typ); + (*e->handle)(e, (void*)&*Store__39_s->msg, Texts_FileMsg__typ); span = Files_Pos(&*r, r__typ) - org; Files_WriteLInt(&r1, Files_Rider__typ, -span); Files_WriteLInt(&r1, Files_Rider__typ, e->W); @@ -1810,14 +1650,14 @@ void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) CHAR mods[64][32], procs[64][32]; Texts_FontsFont fnts[32]; CHAR block[1024]; - struct Store__44 _s; + struct Store__39 _s; _s.ecnt = &ecnt; _s.msg = &msg; _s.iden = &iden; _s.mods = (void*)mods; _s.procs = (void*)procs; - _s.lnk = Store__44_s; - Store__44_s = &_s; + _s.lnk = Store__39_s; + Store__39_s = &_s; org = Files_Pos(&*r, r__typ); msg.id = 1; msg.r = *r; @@ -1859,7 +1699,7 @@ void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) pos += rlen; u = un; } else if (iden.mod[0] != 0x00) { - StoreElem__45(&msg.r, Files_Rider__typ, pos, __GUARDP(u, Texts_ElemDesc, 1)); + StoreElem__40(&msg.r, Files_Rider__typ, pos, __GUARDP(u, Texts_ElemDesc, 1)); pos += 1; u = u->next; } else { @@ -1913,7 +1753,7 @@ void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) if (T->notify != NIL) { (*T->notify)(T, 3, 0, 0); } - Store__44_s = _s.lnk; + Store__39_s = _s.lnk; } void Texts_Close (Texts_Text T, CHAR *name, ADDRESS name__len) diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index ac6542ff..bdd9fada 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h @@ -135,7 +135,6 @@ import void Texts_Close (Texts_Text T, CHAR *name, ADDRESS name__len); import void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); import void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); import void Texts_Delete (Texts_Text T, INT32 beg, INT32 end); -import void Texts_DumpReader (Texts_Reader re); import Texts_Text Texts_ElemBase (Texts_Elem E); import INT32 Texts_ElemPos (Texts_Elem E); import void Texts_Insert (Texts_Text T, INT32 pos, Texts_Buffer B); diff --git a/bootstrap/unix-88/VT100.c b/bootstrap/unix-88/VT100.c index 80457921..9cd5cf4d 100644 --- a/bootstrap/unix-88/VT100.c +++ b/bootstrap/unix-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/VT100.h b/bootstrap/unix-88/VT100.h index 1a589c43..8f60c652 100644 --- a/bootstrap/unix-88/VT100.h +++ b/bootstrap/unix-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index 46b1acc2..fa840303 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -82,7 +82,7 @@ void extTools_Assemble (CHAR *moduleName, ADDRESS moduleName__len) Strings_Append((CHAR*)"-c ", 4, (void*)cmd, 1023); Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); Strings_Append((CHAR*)".c", 3, (void*)cmd, 1023); - extTools_execute((CHAR*)"Assemble: ", 11, cmd, 1023); + extTools_execute((CHAR*)"C compile: ", 12, cmd, 1023); __DEL(moduleName); } @@ -106,7 +106,7 @@ void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN stati Strings_Append((CHAR*)"-O", 3, (void*)cmd, 1023); Strings_Append(OPM_Model, 10, (void*)cmd, 1023); Strings_Append((CHAR*)"", 1, (void*)cmd, 1023); - extTools_execute((CHAR*)"Assemble and link: ", 20, cmd, 1023); + extTools_execute((CHAR*)"C compile and link: ", 21, cmd, 1023); __DEL(additionalopts); } diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index 4201df04..a93b6c85 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/Compiler.c b/bootstrap/windows-48/Compiler.c index d13ed803..993c2bac 100644 --- a/bootstrap/windows-48/Compiler.c +++ b/bootstrap/windows-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 @@ -122,7 +122,7 @@ static void Compiler_FindLocalObjectFiles (CHAR *objectnames, ADDRESS objectname Strings_Append((CHAR*)" ", 2, (void*)objectnames, objectnames__len); Strings_Append(fn, 64, (void*)objectnames, objectnames__len); } else { - OPM_LogVT100((CHAR*)"33m", 4); + OPM_LogVT100((CHAR*)"91m", 4); OPM_LogWStr((CHAR*)"Link warning: a local symbol file is present for module ", 57); OPM_LogWStr(l->name, 256); OPM_LogWStr((CHAR*)", but local object file '", 26); diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index eb305bbe..80b87b1d 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index d10b5011..cdc285e5 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 2922b3cd..3eecd248 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -69,9 +69,6 @@ static void Files_CloseOSFile (Files_File f); static void Files_Create (Files_File f); export void Files_Delete (CHAR *name, ADDRESS name__len, INT16 *res); static void Files_Deregister (CHAR *name, ADDRESS name__len); -export void Files_DumpBuffer (Files_Buffer b, INT16 indent); -export void Files_DumpFile (Files_File f, INT16 indent); -export void Files_DumpRider (Files_Rider r, INT16 indent); static void Files_Err (CHAR *s, ADDRESS s__len, Files_File f, INT16 errcode); static void Files_Finalize (SYSTEM_PTR o); static void Files_FlipBytes (SYSTEM_BYTE *src, ADDRESS src__len, SYSTEM_BYTE *dest, ADDRESS dest__len); @@ -102,7 +99,6 @@ export void Files_Rename (CHAR *old, ADDRESS old__len, CHAR *new, ADDRESS new__l static void Files_ScanPath (INT16 *pos, CHAR *dir, ADDRESS dir__len); export void Files_Set (Files_Rider *r, ADDRESS *r__typ, Files_File f, INT32 pos); export void Files_SetSearchPath (CHAR *path, ADDRESS path__len); -static void Files_Spaces (INT16 i); export void Files_Write (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE x); export void Files_WriteBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN x); export void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS x__len, INT32 n); @@ -116,132 +112,6 @@ export void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, ADDRESS #define Files_IdxTrap() __HALT(-1) -static void Files_Spaces (INT16 i) -{ - while (i > 0) { - Out_String((CHAR*)" ", 3); - i -= 1; - } -} - -void Files_DumpFile (Files_File f, INT16 indent) -{ - Files_Spaces(indent); - Out_String((CHAR*)"workName: ", 15); - Out_String(f->workName, 101); - Out_Ln(); - Files_Spaces(indent); - Out_String((CHAR*)"registerName: ", 15); - Out_String(f->registerName, 101); - Out_Ln(); - Files_Spaces(indent); - Out_String((CHAR*)"tempFile: ", 15); - if (f->tempFile) { - Out_String((CHAR*)"TRUE", 5); - } else { - Out_String((CHAR*)"FALSE", 6); - } - Out_Ln(); - Files_Spaces(indent); - Out_String((CHAR*)"identity: ", 15); - Out_String((CHAR*)"...", 4); - Out_Ln(); - Files_Spaces(indent); - Out_String((CHAR*)"fd: ", 15); - Out_Int(f->fd, 1); - Out_Ln(); - Files_Spaces(indent); - Out_String((CHAR*)"len, ", 15); - Out_Int(f->len, 1); - Out_Ln(); - Files_Spaces(indent); - Out_String((CHAR*)"pos: ", 15); - Out_Int(f->pos, 1); - Out_Ln(); - Files_Spaces(indent); - Out_String((CHAR*)"bufs: ", 15); - Out_String((CHAR*)"...", 4); - Out_Ln(); - Files_Spaces(indent); - Out_String((CHAR*)"swapper: ", 15); - Out_Int(f->swapper, 1); - Out_Ln(); - Files_Spaces(indent); - Out_String((CHAR*)"state: ", 15); - Out_Int(f->state, 1); - Out_Ln(); - Files_Spaces(indent); - Out_String((CHAR*)"next: ", 15); - Out_Hex((INT32)(ADDRESS)f->next, 1); - Out_Ln(); -} - -void Files_DumpBuffer (Files_Buffer b, INT16 indent) -{ - Files_Spaces(indent); - Out_String((CHAR*)"chg: ", 7); - if (b->chg) { - Out_String((CHAR*)"TRUE", 5); - } else { - Out_String((CHAR*)"FALSE", 6); - } - Out_Ln(); - Files_Spaces(indent); - Out_String((CHAR*)"org: ", 7); - Out_Int(b->org, 1); - Out_Ln(); - Files_Spaces(indent); - Out_String((CHAR*)"size: ", 7); - Out_Int(b->size, 1); - Out_Ln(); - Files_Spaces(indent); - Out_String((CHAR*)"data: ", 7); - Out_Ln(); - Out_HexDump((void*)b->data, 4096); - Files_Spaces(indent); - Out_String((CHAR*)"f: ", 7); - if (b->f == NIL) { - Out_String((CHAR*)"", 6); - Out_Ln(); - } else { - Out_Ln(); - Files_DumpFile(b->f, indent + 1); - } -} - -void Files_DumpRider (Files_Rider r, INT16 indent) -{ - Files_Spaces(indent); - Out_String((CHAR*)"res: ", 9); - Out_Int(r.res, 1); - Out_Ln(); - Files_Spaces(indent); - Out_String((CHAR*)"eof: ", 9); - if (r.eof) { - Out_String((CHAR*)"TRUE", 5); - } else { - Out_String((CHAR*)"FALSE", 6); - } - Out_Ln(); - Files_Spaces(indent); - Out_String((CHAR*)"org: ", 9); - Out_Int(r.org, 1); - Out_Ln(); - Files_Spaces(indent); - Out_String((CHAR*)"offset: ", 9); - Out_Int(r.offset, 1); - Out_Ln(); - Files_Spaces(indent); - Out_String((CHAR*)"buf: ", 9); - if (r.buf == NIL) { - Out_String((CHAR*)"", 6); - Out_Ln(); - } else { - Out_Ln(); - Files_DumpBuffer(r.buf, indent + 1); - } -} - static void Files_Assert (BOOLEAN truth) { if (!truth) { diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index b43aa306..2dc667a1 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,19 +1,10 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h #include "SYSTEM.h" -typedef - struct Files_BufDesc { - INT32 _prvt0; - char _prvt1[4108]; - } Files_BufDesc; - -typedef - Files_BufDesc *Files_Buffer; - typedef struct Files_FileDesc *Files_File; @@ -33,16 +24,12 @@ typedef import ADDRESS *Files_FileDesc__typ; -import ADDRESS *Files_BufDesc__typ; import ADDRESS *Files_Rider__typ; import Files_File Files_Base (Files_Rider *r, ADDRESS *r__typ); import void Files_ChangeDirectory (CHAR *path, ADDRESS path__len, INT16 *res); import void Files_Close (Files_File f); import void Files_Delete (CHAR *name, ADDRESS name__len, INT16 *res); -import void Files_DumpBuffer (Files_Buffer b, INT16 indent); -import void Files_DumpFile (Files_File f, INT16 indent); -import void Files_DumpRider (Files_Rider r, INT16 indent); import void Files_GetDate (Files_File f, INT32 *t, INT32 *d); import void Files_GetName (Files_File f, CHAR *name, ADDRESS name__len); import INT32 Files_Length (Files_File f); diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index d6b6560d..c12cb722 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index 87732bb9..de4d17ce 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index 458d281f..b437b514 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index f52b30af..8436f089 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index bb4ea138..19e40505 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index 6757803a..71d82def 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 093bb886..a5f41a8e 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index a32c29e0..38a2b01d 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 0fd45dec..8f903e46 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -63,6 +63,7 @@ export void OPM_Init (BOOLEAN *done); export void OPM_InitOptions (void); export INT16 OPM_Integer (INT64 n); static BOOLEAN OPM_IsProbablyInstallDir (CHAR *s, ADDRESS s__len); +export void OPM_LogCompiling (CHAR *modname, ADDRESS modname__len); static void OPM_LogErrMsg (INT16 n); export void OPM_LogVT100 (CHAR *vt100code, ADDRESS vt100code__len); export void OPM_LogW (CHAR ch); @@ -92,7 +93,6 @@ export void OPM_SymWInt (INT64 i); export void OPM_SymWLReal (LONGREAL lr); export void OPM_SymWReal (REAL r); export void OPM_SymWSet (UINT64 s); -static void OPM_VerboseListSizes (void); export void OPM_Write (CHAR ch); export void OPM_WriteHex (INT64 i); export void OPM_WriteInt (INT64 i); @@ -136,6 +136,27 @@ void OPM_LogVT100 (CHAR *vt100code, ADDRESS vt100code__len) __DEL(vt100code); } +void OPM_LogCompiling (CHAR *modname, ADDRESS modname__len) +{ + __DUP(modname, modname__len, CHAR); + OPM_LogWStr((CHAR*)"Compiling ", 11); + OPM_LogWStr(modname, modname__len); + if (__IN(18, OPM_Options, 32)) { + OPM_LogWStr((CHAR*)", s:", 5); + OPM_LogWNum(__ASHL(OPM_ShortintSize, 3), 1); + OPM_LogWStr((CHAR*)" i:", 4); + OPM_LogWNum(__ASHL(OPM_IntegerSize, 3), 1); + OPM_LogWStr((CHAR*)" l:", 4); + OPM_LogWNum(__ASHL(OPM_LongintSize, 3), 1); + OPM_LogWStr((CHAR*)" adr:", 6); + OPM_LogWNum(__ASHL(OPM_AddressSize, 3), 1); + OPM_LogWStr((CHAR*)" algn:", 7); + OPM_LogWNum(__ASHL(OPM_Alignment, 3), 1); + } + OPM_LogW('.'); + __DEL(modname); +} + INT64 OPM_SignedMaximum (INT32 bytecount) { INT64 result; @@ -363,32 +384,6 @@ BOOLEAN OPM_OpenPar (void) __RETCHK; } -static void OPM_VerboseListSizes (void) -{ - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Type Size", 15); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"SHORTINT ", 12); - OPM_LogWNum(OPM_ShortintSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"INTEGER ", 12); - OPM_LogWNum(OPM_IntegerSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"LONGINT ", 12); - OPM_LogWNum(OPM_LongintSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"SET ", 12); - OPM_LogWNum(OPM_LongintSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"ADDRESS ", 12); - OPM_LogWNum(OPM_AddressSize, 4); - OPM_LogWLn(); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Alignment: ", 12); - OPM_LogWNum(OPM_Alignment, 4); - OPM_LogWLn(); -} - void OPM_InitOptions (void) { CHAR s[256]; @@ -432,9 +427,6 @@ void OPM_InitOptions (void) OPM_LongintSize = 4; break; } - if (__IN(18, OPM_Options, 32)) { - OPM_VerboseListSizes(); - } __MOVE(OPM_InstallDir, OPM_ResourceDir, 1024); if (OPM_ResourceDir[0] != 0x00) { Strings_Append((CHAR*)"/", 2, (void*)OPM_ResourceDir, 1024); @@ -491,17 +483,6 @@ void OPM_Get (CHAR *ch) { OPM_curpos = Texts_Pos(&OPM_inR, Texts_Reader__typ); Texts_Read(&OPM_inR, Texts_Reader__typ, &*ch); - if ((OPM_curpos == 0 && OPM_inR.eot)) { - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"DEBUG: OPM.Get returned inR.eot at curpos = 0, ch = ", 53); - OPM_LogWNum((INT16)*ch, 1); - OPM_LogW('.'); - Texts_DumpReader(OPM_inR); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Heap dump:", 11); - OPM_LogWLn(); - Out_DumpHeap(); - } if ((*ch < 0x09 && !OPM_inR.eot)) { *ch = ' '; } diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index f246eacb..96318bea 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h @@ -33,6 +33,7 @@ import void OPM_Get (CHAR *ch); import void OPM_Init (BOOLEAN *done); import void OPM_InitOptions (void); import INT16 OPM_Integer (INT64 n); +import void OPM_LogCompiling (CHAR *modname, ADDRESS modname__len); import void OPM_LogVT100 (CHAR *vt100code, ADDRESS vt100code__len); import void OPM_LogW (CHAR ch); import void OPM_LogWLn (void); diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index c3e79413..ec4ad2be 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -1796,9 +1796,7 @@ void OPP_Module (OPT_Node *prog, UINT32 opt) OPP_err(16); } if (OPP_sym == 38) { - OPM_LogWStr((CHAR*)"compiling ", 11); - OPM_LogWStr(OPS_name, 256); - OPM_LogW('.'); + OPM_LogCompiling(OPS_name, 256); OPT_Init(OPS_name, opt); OPS_Get(&OPP_sym); OPP_CheckSym(39); diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index 913d2eef..aa076aaa 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index abfcd4b8..bf9f1af5 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index 9e15ba4e..09a33705 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index fc598571..0002aa51 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index 228191bf..63bf2070 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index e44854e3..8b095ff5 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index ea04b5b8..c6a107b6 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Out.c b/bootstrap/windows-48/Out.c index ebafde72..01e91698 100644 --- a/bootstrap/windows-48/Out.c +++ b/bootstrap/windows-48/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -14,19 +14,10 @@ export BOOLEAN Out_IsConsole; static CHAR Out_buf[128]; static INT16 Out_in; -static ADDRESS *typedesc__11__typ; -static ADDRESS *blockdesc__5__typ; -static ADDRESS *chunkdesc__7__typ; export void Out_Char (CHAR ch); -export void Out_DumpHeap (void); -static void Out_DumpModule (Heap_Module m); -export void Out_DumpTag (INT32 addr); -export void Out_DumpType (SYSTEM_BYTE *o, ADDRESS o__len); export void Out_Flush (void); export void Out_Hex (INT64 x, INT64 n); -export void Out_HexDump (SYSTEM_BYTE *m, ADDRESS m__len); -export void Out_HexDumpAdr (INT32 adr, INT64 offset, INT32 length); export void Out_Int (INT64 x, INT64 n); static INT32 Out_Length (CHAR *s, ADDRESS s__len); export void Out_Ln (void); @@ -40,8 +31,6 @@ static void Out_digit (INT64 n, CHAR *s, ADDRESS s__len, INT16 *i); static void Out_prepend (CHAR *t, ADDRESS t__len, CHAR *s, ADDRESS s__len, INT16 *i); #define Out_Entier64(x) (INT64)(x) -extern ADDRESS Heap_heap; -#define Out_getheap() Heap_heap void Out_Flush (void) { @@ -139,8 +128,10 @@ void Out_Hex (INT64 x, INT64 n) } else if (n > 16) { n = 16; } - while ((n < 16 && __LSH(x, -__ASHL(n, 2), 64) != 0)) { - n += 1; + if (x >= 0) { + while ((n < 16 && __LSH(x, -__ASHL(n, 2), 64) != 0)) { + n += 1; + } } x = __ROT(x, __ASHL(16 - n, 2), 64); while (n > 0) { @@ -160,235 +151,6 @@ void Out_Ln (void) Out_Flush(); } -void Out_HexDumpAdr (INT32 adr, INT64 offset, INT32 length) -{ - INT16 i; - INT32 n, lim; - CHAR c; - lim = (INT32)(adr + length); - while (adr < lim) { - if (adr + 16 < lim) { - n = 16; - } else { - n = lim - adr; - } - Out_Hex(offset, 8); - Out_Char(' '); - i = 0; - while (i < n) { - if (__MASK(i, -4) == 0) { - Out_Char(' '); - } - __GET(adr + i, c, CHAR); - Out_Hex((INT16)c, 2); - Out_Char(' '); - i += 1; - } - while (i < 16) { - if (__MASK(i, -4) == 0) { - Out_Char(' '); - } - Out_String((CHAR*)" ", 4); - i += 1; - } - Out_String((CHAR*)" ", 2); - i = 0; - while (i < n) { - __GET(adr + i, c, CHAR); - if ((INT16)c < 32 || (INT16)c > 126) { - Out_Char('.'); - } else { - Out_Char(c); - } - i += 1; - } - adr += n; - offset += (INT64)n; - Out_Ln(); - } -} - -void Out_HexDump (SYSTEM_BYTE *m, ADDRESS m__len) -{ - Out_HexDumpAdr((ADDRESS)m, 0, m__len); -} - -static void Out_DumpModule (Heap_Module m) -{ - Out_String((CHAR*)" next: ", 19); - Out_Hex((INT32)(ADDRESS)m->next, 1); - Out_Ln(); - Out_String((CHAR*)" name: ", 19); - Out_String(m->name, 20); - Out_Ln(); - Out_String((CHAR*)" refcnt: ", 19); - Out_Hex(m->refcnt, 1); - Out_Ln(); - Out_String((CHAR*)" cmds: ", 19); - Out_Hex((INT32)(ADDRESS)m->cmds, 1); - Out_Ln(); - Out_String((CHAR*)" types: ", 19); - Out_Hex(m->types, 1); - Out_Ln(); - Out_String((CHAR*)" enumPtrs: ", 19); - Out_Hex((INT32)(ADDRESS)m->enumPtrs, 1); - Out_Ln(); -} - -typedef - struct typedesc__11 *tag__10; - -typedef - struct typedesc__11 { - INT32 tag, next, level, module; - CHAR name[24]; - INT32 bases[16]; - INT32 reserved, blksz, ptr0; - } typedesc__11; - -void Out_DumpTag (INT32 addr) -{ - tag__10 desc = NIL; - INT16 i; - Out_String((CHAR*)" obj tag: ", 17); - Out_Hex(addr, 1); - Out_Ln(); - addr -= __MASK(addr, -2); - desc = (tag__10)(ADDRESS)(addr - 108); - Out_String((CHAR*)" desc at: ", 17); - Out_Hex((INT32)(ADDRESS)desc, 1); - Out_Ln(); - Out_String((CHAR*)" desc contains:", 21); - Out_Ln(); - Out_String((CHAR*)" tag: ", 17); - Out_Hex(desc->tag, 1); - Out_Ln(); - Out_String((CHAR*)" next: ", 17); - Out_Hex(desc->next, 1); - Out_Ln(); - Out_String((CHAR*)" level: ", 17); - Out_Hex(desc->level, 1); - Out_Ln(); - Out_String((CHAR*)" module: ", 17); - Out_Hex(desc->module, 1); - Out_Ln(); - if (desc->module != 0) { - Out_DumpModule((Heap_Module)(ADDRESS)desc->module); - } - Out_String((CHAR*)" name: ", 17); - Out_String(desc->name, 24); - Out_Ln(); - Out_String((CHAR*)" bases: ", 17); - i = 0; - while (i < 16) { - Out_Hex(desc->bases[__X(i, 16)], 8); - if (__MASK(i, -4) == 3) { - Out_Ln(); - Out_String((CHAR*)" ", 17); - } else { - Out_Char(' '); - } - i += 1; - } - Out_Ln(); - Out_String((CHAR*)" reserved: ", 17); - Out_Hex(desc->reserved, 1); - Out_Ln(); - Out_String((CHAR*)" blksz: ", 17); - Out_Hex(desc->blksz, 1); - Out_Ln(); - Out_String((CHAR*)" ptr0: ", 17); - Out_Hex(desc->ptr0, 1); - Out_Ln(); -} - -void Out_DumpType (SYSTEM_BYTE *o, ADDRESS o__len) -{ - INT32 addr; - __GET((ADDRESS)o - 4, addr, INT32); - Out_DumpTag(addr); -} - -typedef - INT32 (*adrptr__3)[1]; - -typedef - struct blockdesc__5 *block__4; - -typedef - struct blockdesc__5 { - INT32 tag, size, sentinel, next; - } blockdesc__5; - -typedef - struct chunkdesc__7 *chunk__6; - -typedef - struct chunkdesc__7 { - INT32 next, end, reserved; - blockdesc__5 firstblock; - } chunkdesc__7; - -void Out_DumpHeap (void) -{ - INT32 caddr; - chunk__6 c = NIL; - INT32 baddr; - block__4 b = NIL; - adrptr__3 tag = NIL; - caddr = Heap_heap; - while (caddr != 0) { - Out_String((CHAR*)"Chunk at: ", 11); - Out_Hex(caddr, 1); - Out_Ln(); - c = (chunk__6)(ADDRESS)caddr; - Out_String((CHAR*)" next: ", 11); - Out_Hex(c->next, 1); - Out_Ln(); - Out_String((CHAR*)" end: ", 11); - Out_Hex(c->end, 1); - Out_String((CHAR*)" => size: ", 11); - Out_Hex(c->end - caddr, 1); - Out_Ln(); - Out_String((CHAR*)" rsvd: ", 11); - Out_Hex(c->reserved, 1); - Out_Ln(); - baddr = (ADDRESS)&c->firstblock; - while (c->end - baddr > 0) { - Out_String((CHAR*)" Block at: ", 15); - Out_Hex(baddr, 1); - Out_Ln(); - b = (block__4)(ADDRESS)baddr; - tag = (adrptr__3)(ADDRESS)(b->tag - __MASK(b->tag, -2)); - Out_String((CHAR*)" tag: ", 15); - Out_Hex(b->tag, 1); - if (__MASK(b->tag, -2) != 0) { - Out_String((CHAR*)" <--- ODD! ---", 15); - } - Out_Ln(); - Out_String((CHAR*)" tag^: ", 15); - Out_Hex((*tag)[0], 1); - Out_Ln(); - Out_String((CHAR*)" size: ", 15); - Out_Hex(b->size, 1); - Out_Ln(); - Out_String((CHAR*)" sentinel: ", 15); - Out_Hex(b->sentinel, 1); - Out_Ln(); - Out_String((CHAR*)" next: ", 15); - Out_Hex(b->next, 1); - Out_Ln(); - if (b->tag != (ADDRESS)&b->size) { - Out_DumpTag(b->tag); - } - baddr += (*tag)[0]; - Out_Ln(); - } - caddr = c->next; - Out_Ln(); - } -} - static void Out_digit (INT64 n, CHAR *s, ADDRESS s__len, INT16 *i) { *i -= 1; @@ -566,9 +328,6 @@ void Out_LongReal (LONGREAL x, INT16 n) Out_RealP(x, n, 1); } -__TDESC(typedesc__11, 1, 0) = {__TDFLDS("typedesc__11", 116), {-4}}; -__TDESC(blockdesc__5, 1, 0) = {__TDFLDS("blockdesc__5", 16), {-4}}; -__TDESC(chunkdesc__7, 1, 0) = {__TDFLDS("chunkdesc__7", 28), {-4}}; export void *Out__init(void) { @@ -576,13 +335,9 @@ export void *Out__init(void) __MODULE_IMPORT(Heap); __MODULE_IMPORT(Platform); __REGMOD("Out", 0); - __REGCMD("DumpHeap", Out_DumpHeap); __REGCMD("Flush", Out_Flush); __REGCMD("Ln", Out_Ln); __REGCMD("Open", Out_Open); - __INITYP(typedesc__11, typedesc__11, 0); - __INITYP(blockdesc__5, blockdesc__5, 0); - __INITYP(chunkdesc__7, chunkdesc__7, 0); /* BEGIN */ Out_IsConsole = Platform_IsConsole(Platform_StdOut); Out_in = 0; diff --git a/bootstrap/windows-48/Out.h b/bootstrap/windows-48/Out.h index cbb4de1a..e1285046 100644 --- a/bootstrap/windows-48/Out.h +++ b/bootstrap/windows-48/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h @@ -10,13 +10,8 @@ import BOOLEAN Out_IsConsole; import void Out_Char (CHAR ch); -import void Out_DumpHeap (void); -import void Out_DumpTag (INT32 addr); -import void Out_DumpType (SYSTEM_BYTE *o, ADDRESS o__len); import void Out_Flush (void); import void Out_Hex (INT64 x, INT64 n); -import void Out_HexDump (SYSTEM_BYTE *m, ADDRESS m__len); -import void Out_HexDumpAdr (INT32 adr, INT64 offset, INT32 length); import void Out_Int (INT64 x, INT64 n); import void Out_Ln (void); import void Out_LongReal (LONGREAL x, INT16 n); diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index fee81ec0..9d308e71 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index 19fe26f9..bd2a519b 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 9b449f98..d1eb72f6 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index 3e83af42..170d1785 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index f9b5310a..225bd40a 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index 58f9b546..4d98f1a3 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index 96851302..08ee5129 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -192,11 +192,6 @@ export void Texts_Close (Texts_Text T, CHAR *name, ADDRESS name__len); export void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); export void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); export void Texts_Delete (Texts_Text T, INT32 beg, INT32 end); -static void Texts_DumpElem (Texts_Elem e); -static void Texts_DumpPiece (Texts_Piece p); -export void Texts_DumpReader (Texts_Reader re); -static void Texts_DumpRun (Texts_Run ru); -static void Texts_DumpText (Texts_Text t); export Texts_Text Texts_ElemBase (Texts_Elem E); export INT32 Texts_ElemPos (Texts_Elem E); static void Texts_Find (Texts_Text T, INT32 *pos, Texts_Run *u, INT32 *org, INT32 *off); @@ -238,161 +233,6 @@ export void Texts_WriteRealHex (Texts_Writer *W, ADDRESS *W__typ, REAL x); export void Texts_WriteString (Texts_Writer *W, ADDRESS *W__typ, CHAR *s, ADDRESS s__len); -static void Texts_DumpText (Texts_Text t) -{ - Out_String((CHAR*)" len: ", 15); - Out_Int(t->len, 1); - Out_Ln(); - Out_String((CHAR*)" notify: ", 15); - Out_Hex((INT32)(ADDRESS)t->notify, 1); - Out_Ln(); - Out_String((CHAR*)" head: ", 15); - Out_Hex((INT32)(ADDRESS)t->head, 1); - Out_Ln(); - Out_String((CHAR*)" cache: ", 15); - Out_Hex((INT32)(ADDRESS)t->cache, 1); - Out_Ln(); - Out_String((CHAR*)" corg: ", 15); - Out_Int(t->corg, 1); - Out_Ln(); -} - -static void Texts_DumpRun (Texts_Run ru) -{ - Out_String((CHAR*)" Run at ", 12); - Out_Hex((INT32)(ADDRESS)ru, 1); - Out_Ln(); - Out_String((CHAR*)" prev: ", 12); - Out_Hex((INT32)(ADDRESS)ru->prev, 1); - Out_Ln(); - Out_String((CHAR*)" next: ", 12); - Out_Hex((INT32)(ADDRESS)ru->next, 1); - Out_Ln(); - Out_String((CHAR*)" len: ", 12); - Out_Int(ru->len, 1); - Out_Ln(); - Out_String((CHAR*)" fnt: ", 12); - if (ru->fnt != NIL) { - Out_String(ru->fnt->name, 32); - } else { - Out_String((CHAR*)"", 6); - } - Out_Ln(); - Out_String((CHAR*)" col: ", 12); - Out_Int(ru->col, 1); - Out_Ln(); - Out_String((CHAR*)" voff: ", 12); - Out_Int(ru->voff, 1); - Out_Ln(); - Out_String((CHAR*)" ascii: ", 12); - if (ru->ascii) { - Out_String((CHAR*)"TRUE", 5); - } else { - Out_String((CHAR*)"FALSE", 6); - } - Out_Ln(); -} - -static void Texts_DumpElem (Texts_Elem e) -{ - Texts_DumpRun((void*)e); - Out_String((CHAR*)" -- Elem --", 15); - Out_Ln(); - Out_String((CHAR*)" W: ", 13); - Out_Int(e->W, 1); - Out_Ln(); - Out_String((CHAR*)" H: ", 13); - Out_Int(e->H, 1); - Out_Ln(); - Out_String((CHAR*)" handle: ", 13); - Out_Hex((INT32)(ADDRESS)e->handle, 1); - Out_Ln(); - Out_String((CHAR*)" base: ", 13); - if (e->base == NIL) { - Out_String((CHAR*)"", 6); - Out_Ln(); - } else { - Out_Ln(); - Texts_DumpText(e->base); - } -} - -static void Texts_DumpPiece (Texts_Piece p) -{ - Texts_DumpRun((void*)p); - Out_String((CHAR*)" -- Piece --", 16); - Out_Ln(); - Out_String((CHAR*)" file: ", 12); - if (p->file == NIL) { - Out_String((CHAR*)"", 6); - Out_Ln(); - } else { - Out_Ln(); - Files_DumpFile(p->file, 3); - } - Out_String((CHAR*)" org: ", 12); - Out_Int(p->org, 1); - Out_Ln(); -} - -void Texts_DumpReader (Texts_Reader re) -{ - Out_String((CHAR*)"Reader:", 8); - Out_Ln(); - Out_String((CHAR*)" eot: ", 10); - if (re.eot) { - Out_String((CHAR*)"TRUE", 5); - } else { - Out_String((CHAR*)"FALSE", 6); - } - Out_Ln(); - Out_String((CHAR*)" fnt: ", 10); - if (re.fnt != NIL) { - Out_String(re.fnt->name, 32); - } else { - Out_String((CHAR*)"", 6); - } - Out_Ln(); - Out_String((CHAR*)" col: ", 10); - Out_Int(re.col, 1); - Out_Ln(); - Out_String((CHAR*)" voff: ", 10); - Out_Int(re.voff, 1); - Out_Ln(); - Out_String((CHAR*)" org: ", 10); - Out_Int(re.org, 1); - Out_Ln(); - Out_String((CHAR*)" off: ", 10); - Out_Int(re.off, 1); - Out_Ln(); - Out_String((CHAR*)" elem: ", 10); - if (re.elem == NIL) { - Out_String((CHAR*)"", 6); - Out_Ln(); - } else { - Out_Ln(); - Texts_DumpElem(re.elem); - } - Out_String((CHAR*)" rider: ", 10); - Out_Ln(); - Files_DumpRider(re.rider, 2); - Out_String((CHAR*)" run: ", 10); - if (re.run == NIL) { - Out_String((CHAR*)"", 6); - Out_Ln(); - } else { - Out_Ln(); - if (__ISP(re.run, Texts_PieceDesc, 1)) { - Texts_DumpPiece(__GUARDP(re.run, Texts_PieceDesc, 1)); - } else if (__ISP(re.run, Texts_ElemDesc, 1)) { - Texts_DumpElem(__GUARDP(re.run, Texts_ElemDesc, 1)); - } else { - Texts_DumpRun(re.run); - } - } - Out_DumpType((void*)&*re.run, 20); -} - static Texts_FontsFont Texts_FontsThis (CHAR *name, ADDRESS name__len) { Texts_FontsFont F = NIL; @@ -877,32 +717,32 @@ void Texts_OpenScanner (Texts_Scanner *S, ADDRESS *S__typ, Texts_Text T, INT32 p (*S).nextCh = ' '; } -static struct Scan__36 { +static struct Scan__31 { Texts_Scanner *S; ADDRESS *S__typ; CHAR *ch; BOOLEAN *negE; INT16 *e; - struct Scan__36 *lnk; -} *Scan__36_s; + struct Scan__31 *lnk; +} *Scan__31_s; -static void ReadScaleFactor__37 (void); +static void ReadScaleFactor__32 (void); -static void ReadScaleFactor__37 (void) +static void ReadScaleFactor__32 (void) { - Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); - if (*Scan__36_s->ch == '-') { - *Scan__36_s->negE = 1; - Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); + Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); + if (*Scan__31_s->ch == '-') { + *Scan__31_s->negE = 1; + Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); } else { - *Scan__36_s->negE = 0; - if (*Scan__36_s->ch == '+') { - Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); + *Scan__31_s->negE = 0; + if (*Scan__31_s->ch == '+') { + Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); } } - while (('0' <= *Scan__36_s->ch && *Scan__36_s->ch <= '9')) { - *Scan__36_s->e = (*Scan__36_s->e * 10 + (INT16)*Scan__36_s->ch) - 48; - Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); + while (('0' <= *Scan__31_s->ch && *Scan__31_s->ch <= '9')) { + *Scan__31_s->e = (*Scan__31_s->e * 10 + (INT16)*Scan__31_s->ch) - 48; + Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); } } @@ -916,13 +756,13 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) REAL x, f; LONGREAL y, g; CHAR d[32]; - struct Scan__36 _s; + struct Scan__31 _s; _s.S = S; _s.S__typ = S__typ; _s.ch = &ch; _s.negE = &negE; _s.e = &e; - _s.lnk = Scan__36_s; - Scan__36_s = &_s; + _s.lnk = Scan__31_s; + Scan__31_s = &_s; ch = (*S).nextCh; i = 0; for (;;) { @@ -1023,7 +863,7 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) y = ((INT16)d[__X(j, 32)] - 48) * g + y; j += 1; } - ReadScaleFactor__37(); + ReadScaleFactor__32(); if (negE) { if (e <= 308) { y = y / (LONGREAL)Reals_TenL(e); @@ -1056,7 +896,7 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) j += 1; } if (ch == 'E') { - ReadScaleFactor__37(); + ReadScaleFactor__32(); } if (negE) { if (e <= 38) { @@ -1109,7 +949,7 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) } } (*S).nextCh = ch; - Scan__36_s = _s.lnk; + Scan__31_s = _s.lnk; } void Texts_OpenWriter (Texts_Writer *W, ADDRESS *W__typ) @@ -1328,30 +1168,30 @@ void Texts_WriteReal (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n) } } -static struct WriteRealFix__58 { +static struct WriteRealFix__53 { Texts_Writer *W; ADDRESS *W__typ; INT16 *i; CHAR (*d)[9]; - struct WriteRealFix__58 *lnk; -} *WriteRealFix__58_s; + struct WriteRealFix__53 *lnk; +} *WriteRealFix__53_s; -static void dig__59 (INT16 n); -static void seq__61 (CHAR ch, INT16 n); +static void dig__54 (INT16 n); +static void seq__56 (CHAR ch, INT16 n); -static void seq__61 (CHAR ch, INT16 n) +static void seq__56 (CHAR ch, INT16 n) { while (n > 0) { - Texts_Write(&*WriteRealFix__58_s->W, WriteRealFix__58_s->W__typ, ch); + Texts_Write(&*WriteRealFix__53_s->W, WriteRealFix__53_s->W__typ, ch); n -= 1; } } -static void dig__59 (INT16 n) +static void dig__54 (INT16 n) { while (n > 0) { - *WriteRealFix__58_s->i -= 1; - Texts_Write(&*WriteRealFix__58_s->W, WriteRealFix__58_s->W__typ, (*WriteRealFix__58_s->d)[__X(*WriteRealFix__58_s->i, 9)]); + *WriteRealFix__53_s->i -= 1; + Texts_Write(&*WriteRealFix__53_s->W, WriteRealFix__53_s->W__typ, (*WriteRealFix__53_s->d)[__X(*WriteRealFix__53_s->i, 9)]); n -= 1; } } @@ -1362,23 +1202,23 @@ void Texts_WriteRealFix (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n, INT1 CHAR sign; REAL x0; CHAR d[9]; - struct WriteRealFix__58 _s; + struct WriteRealFix__53 _s; _s.W = W; _s.W__typ = W__typ; _s.i = &i; _s.d = (void*)d; - _s.lnk = WriteRealFix__58_s; - WriteRealFix__58_s = &_s; + _s.lnk = WriteRealFix__53_s; + WriteRealFix__53_s = &_s; e = Reals_Expo(x); if (k < 0) { k = 0; } if (e == 0) { - seq__61(' ', (n - k) - 2); + seq__56(' ', (n - k) - 2); Texts_Write(&*W, W__typ, '0'); - seq__61(' ', k + 1); + seq__56(' ', k + 1); } else if (e == 255) { Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", 5); - seq__61(' ', n - 4); + seq__56(' ', n - 4); } else { e = __ASHR((e - 127) * 77, 8); if (x < (REAL)0) { @@ -1411,21 +1251,21 @@ void Texts_WriteRealFix (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n, INT1 i = k + e; Reals_Convert(x, i, (void*)d, 9); if (e > 0) { - seq__61(' ', ((n - e) - k) - 2); + seq__56(' ', ((n - e) - k) - 2); Texts_Write(&*W, W__typ, sign); - dig__59(e); + dig__54(e); Texts_Write(&*W, W__typ, '.'); - dig__59(k); + dig__54(k); } else { - seq__61(' ', (n - k) - 3); + seq__56(' ', (n - k) - 3); Texts_Write(&*W, W__typ, sign); Texts_Write(&*W, W__typ, '0'); Texts_Write(&*W, W__typ, '.'); - seq__61('0', -e); - dig__59(k + e); + seq__56('0', -e); + dig__54(k + e); } } - WriteRealFix__58_s = _s.lnk; + WriteRealFix__53_s = _s.lnk; } void Texts_WriteRealHex (Texts_Writer *W, ADDRESS *W__typ, REAL x) @@ -1524,48 +1364,48 @@ void Texts_WriteLongRealHex (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x) } while (!(i == 16)); } -static struct WriteDate__48 { +static struct WriteDate__43 { Texts_Writer *W; ADDRESS *W__typ; - struct WriteDate__48 *lnk; -} *WriteDate__48_s; + struct WriteDate__43 *lnk; +} *WriteDate__43_s; -static void WritePair__49 (CHAR ch, INT32 x); +static void WritePair__44 (CHAR ch, INT32 x); -static void WritePair__49 (CHAR ch, INT32 x) +static void WritePair__44 (CHAR ch, INT32 x) { - Texts_Write(&*WriteDate__48_s->W, WriteDate__48_s->W__typ, ch); - Texts_Write(&*WriteDate__48_s->W, WriteDate__48_s->W__typ, (CHAR)(__DIV(x, 10) + 48)); - Texts_Write(&*WriteDate__48_s->W, WriteDate__48_s->W__typ, (CHAR)((int)__MOD(x, 10) + 48)); + Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, ch); + Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)(__DIV(x, 10) + 48)); + Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)((int)__MOD(x, 10) + 48)); } void Texts_WriteDate (Texts_Writer *W, ADDRESS *W__typ, INT32 t, INT32 d) { - struct WriteDate__48 _s; + struct WriteDate__43 _s; _s.W = W; _s.W__typ = W__typ; - _s.lnk = WriteDate__48_s; - WriteDate__48_s = &_s; - WritePair__49(' ', __MASK(d, -32)); - WritePair__49('.', __MASK(__ASHR(d, 5), -16)); - WritePair__49('.', __MASK(__ASHR(d, 9), -128)); - WritePair__49(' ', __MASK(__ASHR(t, 12), -32)); - WritePair__49(':', __MASK(__ASHR(t, 6), -64)); - WritePair__49(':', __MASK(t, -64)); - WriteDate__48_s = _s.lnk; + _s.lnk = WriteDate__43_s; + WriteDate__43_s = &_s; + WritePair__44(' ', __MASK(d, -32)); + WritePair__44('.', __MASK(__ASHR(d, 5), -16)); + WritePair__44('.', __MASK(__ASHR(d, 9), -128)); + WritePair__44(' ', __MASK(__ASHR(t, 12), -32)); + WritePair__44(':', __MASK(__ASHR(t, 6), -64)); + WritePair__44(':', __MASK(t, -64)); + WriteDate__43_s = _s.lnk; } -static struct Load0__21 { +static struct Load0__16 { Texts_Text *T; INT8 *ecnt; Files_File *f; Texts_FileMsg *msg; CHAR (*mods)[64][32], (*procs)[64][32]; - struct Load0__21 *lnk; -} *Load0__21_s; + struct Load0__16 *lnk; +} *Load0__16_s; -static void LoadElem__22 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e); +static void LoadElem__17 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e); -static void LoadElem__22 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e) +static void LoadElem__17 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e) { Heap_Module M = NIL; Heap_Command Cmd; @@ -1576,15 +1416,15 @@ static void LoadElem__22 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span Files_ReadLInt(&*r, r__typ, &ew); Files_ReadLInt(&*r, r__typ, &eh); Files_Read(&*r, r__typ, (void*)&eno); - if (eno > *Load0__21_s->ecnt) { - *Load0__21_s->ecnt = eno; - Files_ReadString(&*r, r__typ, (void*)(*Load0__21_s->mods)[__X(eno, 64)], 32); - Files_ReadString(&*r, r__typ, (void*)(*Load0__21_s->procs)[__X(eno, 64)], 32); + if (eno > *Load0__16_s->ecnt) { + *Load0__16_s->ecnt = eno; + Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->mods)[__X(eno, 64)], 32); + Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->procs)[__X(eno, 64)], 32); } org = Files_Pos(&*r, r__typ); - M = Modules_ThisMod((*Load0__21_s->mods)[__X(eno, 64)], 32); + M = Modules_ThisMod((*Load0__16_s->mods)[__X(eno, 64)], 32); if (M != NIL) { - Cmd = Modules_ThisCommand(M, (*Load0__21_s->procs)[__X(eno, 64)], 32); + Cmd = Modules_ThisCommand(M, (*Load0__16_s->procs)[__X(eno, 64)], 32); if (Cmd != NIL) { (*Cmd)(); } @@ -1593,25 +1433,25 @@ static void LoadElem__22 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span if (*e != NIL) { (*e)->W = ew; (*e)->H = eh; - (*e)->base = *Load0__21_s->T; - (*Load0__21_s->msg).pos = pos; - (*(*e)->handle)(*e, (void*)&*Load0__21_s->msg, Texts_FileMsg__typ); + (*e)->base = *Load0__16_s->T; + (*Load0__16_s->msg).pos = pos; + (*(*e)->handle)(*e, (void*)&*Load0__16_s->msg, Texts_FileMsg__typ); if (Files_Pos(&*r, r__typ) != org + span) { *e = NIL; } } if (*e == NIL) { - Files_Set(&*r, r__typ, *Load0__21_s->f, org + span); + Files_Set(&*r, r__typ, *Load0__16_s->f, org + span); __NEW(a, Texts__1); a->W = ew; a->H = eh; a->handle = Texts_HandleAlien; - a->base = *Load0__21_s->T; - a->file = *Load0__21_s->f; + a->base = *Load0__16_s->T; + a->file = *Load0__16_s->f; a->org = org; a->span = span; - __COPY((*Load0__21_s->mods)[__X(eno, 64)], a->mod, 32); - __COPY((*Load0__21_s->procs)[__X(eno, 64)], a->proc, 32); + __COPY((*Load0__16_s->mods)[__X(eno, 64)], a->mod, 32); + __COPY((*Load0__16_s->procs)[__X(eno, 64)], a->proc, 32); *e = (Texts_Elem)a; } } @@ -1628,15 +1468,15 @@ static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) CHAR mods[64][32], procs[64][32]; CHAR name[32]; Texts_FontsFont fnts[32]; - struct Load0__21 _s; + struct Load0__16 _s; _s.T = &T; _s.ecnt = &ecnt; _s.f = &f; _s.msg = &msg; _s.mods = (void*)mods; _s.procs = (void*)procs; - _s.lnk = Load0__21_s; - Load0__21_s = &_s; + _s.lnk = Load0__16_s; + Load0__16_s = &_s; pos = Files_Pos(&*r, r__typ); f = Files_Base(&*r, r__typ); __NEW(u, Texts_RunDesc); @@ -1669,7 +1509,7 @@ static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) un = (Texts_Run)p; un->len = plen; } else { - LoadElem__22(&msg.r, Files_Rider__typ, pos - org, -plen, &e); + LoadElem__17(&msg.r, Files_Rider__typ, pos - org, -plen, &e); un = (Texts_Run)e; un->len = 1; } @@ -1687,7 +1527,7 @@ static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) T->corg = 0; Files_ReadLInt(&msg.r, Files_Rider__typ, &T->len); Files_Set(&*r, r__typ, f, Files_Pos(&msg.r, Files_Rider__typ) + T->len); - Load0__21_s = _s.lnk; + Load0__16_s = _s.lnk; } void Texts_Load (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) @@ -1756,25 +1596,25 @@ void Texts_Open (Texts_Text T, CHAR *name, ADDRESS name__len) __DEL(name); } -static struct Store__44 { +static struct Store__39 { INT8 *ecnt; Texts_FileMsg *msg; Texts_IdentifyMsg *iden; CHAR (*mods)[64][32], (*procs)[64][32]; - struct Store__44 *lnk; -} *Store__44_s; + struct Store__39 *lnk; +} *Store__39_s; -static void StoreElem__45 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e); +static void StoreElem__40 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e); -static void StoreElem__45 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e) +static void StoreElem__40 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e) { Files_Rider r1; INT32 org, span; INT8 eno; - __COPY((*Store__44_s->iden).mod, (*Store__44_s->mods)[__X(*Store__44_s->ecnt, 64)], 32); - __COPY((*Store__44_s->iden).proc, (*Store__44_s->procs)[__X(*Store__44_s->ecnt, 64)], 32); + __COPY((*Store__39_s->iden).mod, (*Store__39_s->mods)[__X(*Store__39_s->ecnt, 64)], 32); + __COPY((*Store__39_s->iden).proc, (*Store__39_s->procs)[__X(*Store__39_s->ecnt, 64)], 32); eno = 1; - while (__STRCMP((*Store__44_s->mods)[__X(eno, 64)], (*Store__44_s->iden).mod) != 0 || __STRCMP((*Store__44_s->procs)[__X(eno, 64)], (*Store__44_s->iden).proc) != 0) { + while (__STRCMP((*Store__39_s->mods)[__X(eno, 64)], (*Store__39_s->iden).mod) != 0 || __STRCMP((*Store__39_s->procs)[__X(eno, 64)], (*Store__39_s->iden).proc) != 0) { eno += 1; } Files_Set(&r1, Files_Rider__typ, Files_Base(&*r, r__typ), Files_Pos(&*r, r__typ)); @@ -1782,14 +1622,14 @@ static void StoreElem__45 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Ele Files_WriteLInt(&*r, r__typ, 0); Files_WriteLInt(&*r, r__typ, 0); Files_Write(&*r, r__typ, eno); - if (eno == *Store__44_s->ecnt) { - *Store__44_s->ecnt += 1; - Files_WriteString(&*r, r__typ, (*Store__44_s->iden).mod, 32); - Files_WriteString(&*r, r__typ, (*Store__44_s->iden).proc, 32); + if (eno == *Store__39_s->ecnt) { + *Store__39_s->ecnt += 1; + Files_WriteString(&*r, r__typ, (*Store__39_s->iden).mod, 32); + Files_WriteString(&*r, r__typ, (*Store__39_s->iden).proc, 32); } - (*Store__44_s->msg).pos = pos; + (*Store__39_s->msg).pos = pos; org = Files_Pos(&*r, r__typ); - (*e->handle)(e, (void*)&*Store__44_s->msg, Texts_FileMsg__typ); + (*e->handle)(e, (void*)&*Store__39_s->msg, Texts_FileMsg__typ); span = Files_Pos(&*r, r__typ) - org; Files_WriteLInt(&r1, Files_Rider__typ, -span); Files_WriteLInt(&r1, Files_Rider__typ, e->W); @@ -1810,14 +1650,14 @@ void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) CHAR mods[64][32], procs[64][32]; Texts_FontsFont fnts[32]; CHAR block[1024]; - struct Store__44 _s; + struct Store__39 _s; _s.ecnt = &ecnt; _s.msg = &msg; _s.iden = &iden; _s.mods = (void*)mods; _s.procs = (void*)procs; - _s.lnk = Store__44_s; - Store__44_s = &_s; + _s.lnk = Store__39_s; + Store__39_s = &_s; org = Files_Pos(&*r, r__typ); msg.id = 1; msg.r = *r; @@ -1859,7 +1699,7 @@ void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) pos += rlen; u = un; } else if (iden.mod[0] != 0x00) { - StoreElem__45(&msg.r, Files_Rider__typ, pos, __GUARDP(u, Texts_ElemDesc, 1)); + StoreElem__40(&msg.r, Files_Rider__typ, pos, __GUARDP(u, Texts_ElemDesc, 1)); pos += 1; u = u->next; } else { @@ -1913,7 +1753,7 @@ void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) if (T->notify != NIL) { (*T->notify)(T, 3, 0, 0); } - Store__44_s = _s.lnk; + Store__39_s = _s.lnk; } void Texts_Close (Texts_Text T, CHAR *name, ADDRESS name__len) diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index 188b60fb..5d3316e2 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h @@ -135,7 +135,6 @@ import void Texts_Close (Texts_Text T, CHAR *name, ADDRESS name__len); import void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); import void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); import void Texts_Delete (Texts_Text T, INT32 beg, INT32 end); -import void Texts_DumpReader (Texts_Reader re); import Texts_Text Texts_ElemBase (Texts_Elem E); import INT32 Texts_ElemPos (Texts_Elem E); import void Texts_Insert (Texts_Text T, INT32 pos, Texts_Buffer B); diff --git a/bootstrap/windows-48/VT100.c b/bootstrap/windows-48/VT100.c index 80457921..9cd5cf4d 100644 --- a/bootstrap/windows-48/VT100.c +++ b/bootstrap/windows-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/VT100.h b/bootstrap/windows-48/VT100.h index 1a589c43..8f60c652 100644 --- a/bootstrap/windows-48/VT100.h +++ b/bootstrap/windows-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index 46b1acc2..fa840303 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -82,7 +82,7 @@ void extTools_Assemble (CHAR *moduleName, ADDRESS moduleName__len) Strings_Append((CHAR*)"-c ", 4, (void*)cmd, 1023); Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); Strings_Append((CHAR*)".c", 3, (void*)cmd, 1023); - extTools_execute((CHAR*)"Assemble: ", 11, cmd, 1023); + extTools_execute((CHAR*)"C compile: ", 12, cmd, 1023); __DEL(moduleName); } @@ -106,7 +106,7 @@ void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN stati Strings_Append((CHAR*)"-O", 3, (void*)cmd, 1023); Strings_Append(OPM_Model, 10, (void*)cmd, 1023); Strings_Append((CHAR*)"", 1, (void*)cmd, 1023); - extTools_execute((CHAR*)"Assemble and link: ", 20, cmd, 1023); + extTools_execute((CHAR*)"C compile and link: ", 21, cmd, 1023); __DEL(additionalopts); } diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index 4201df04..a93b6c85 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/Compiler.c b/bootstrap/windows-88/Compiler.c index d13ed803..993c2bac 100644 --- a/bootstrap/windows-88/Compiler.c +++ b/bootstrap/windows-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 @@ -122,7 +122,7 @@ static void Compiler_FindLocalObjectFiles (CHAR *objectnames, ADDRESS objectname Strings_Append((CHAR*)" ", 2, (void*)objectnames, objectnames__len); Strings_Append(fn, 64, (void*)objectnames, objectnames__len); } else { - OPM_LogVT100((CHAR*)"33m", 4); + OPM_LogVT100((CHAR*)"91m", 4); OPM_LogWStr((CHAR*)"Link warning: a local symbol file is present for module ", 57); OPM_LogWStr(l->name, 256); OPM_LogWStr((CHAR*)", but local object file '", 26); diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index eb305bbe..80b87b1d 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index d10b5011..cdc285e5 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 3b7e4c54..508dc245 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -70,9 +70,6 @@ static void Files_CloseOSFile (Files_File f); static void Files_Create (Files_File f); export void Files_Delete (CHAR *name, ADDRESS name__len, INT16 *res); static void Files_Deregister (CHAR *name, ADDRESS name__len); -export void Files_DumpBuffer (Files_Buffer b, INT16 indent); -export void Files_DumpFile (Files_File f, INT16 indent); -export void Files_DumpRider (Files_Rider r, INT16 indent); static void Files_Err (CHAR *s, ADDRESS s__len, Files_File f, INT16 errcode); static void Files_Finalize (SYSTEM_PTR o); static void Files_FlipBytes (SYSTEM_BYTE *src, ADDRESS src__len, SYSTEM_BYTE *dest, ADDRESS dest__len); @@ -103,7 +100,6 @@ export void Files_Rename (CHAR *old, ADDRESS old__len, CHAR *new, ADDRESS new__l static void Files_ScanPath (INT16 *pos, CHAR *dir, ADDRESS dir__len); export void Files_Set (Files_Rider *r, ADDRESS *r__typ, Files_File f, INT32 pos); export void Files_SetSearchPath (CHAR *path, ADDRESS path__len); -static void Files_Spaces (INT16 i); export void Files_Write (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE x); export void Files_WriteBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN x); export void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS x__len, INT32 n); @@ -117,132 +113,6 @@ export void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, ADDRESS #define Files_IdxTrap() __HALT(-1) -static void Files_Spaces (INT16 i) -{ - while (i > 0) { - Out_String((CHAR*)" ", 3); - i -= 1; - } -} - -void Files_DumpFile (Files_File f, INT16 indent) -{ - Files_Spaces(indent); - Out_String((CHAR*)"workName: ", 15); - Out_String(f->workName, 101); - Out_Ln(); - Files_Spaces(indent); - Out_String((CHAR*)"registerName: ", 15); - Out_String(f->registerName, 101); - Out_Ln(); - Files_Spaces(indent); - Out_String((CHAR*)"tempFile: ", 15); - if (f->tempFile) { - Out_String((CHAR*)"TRUE", 5); - } else { - Out_String((CHAR*)"FALSE", 6); - } - Out_Ln(); - Files_Spaces(indent); - Out_String((CHAR*)"identity: ", 15); - Out_String((CHAR*)"...", 4); - Out_Ln(); - Files_Spaces(indent); - Out_String((CHAR*)"fd: ", 15); - Out_Int(f->fd, 1); - Out_Ln(); - Files_Spaces(indent); - Out_String((CHAR*)"len, ", 15); - Out_Int(f->len, 1); - Out_Ln(); - Files_Spaces(indent); - Out_String((CHAR*)"pos: ", 15); - Out_Int(f->pos, 1); - Out_Ln(); - Files_Spaces(indent); - Out_String((CHAR*)"bufs: ", 15); - Out_String((CHAR*)"...", 4); - Out_Ln(); - Files_Spaces(indent); - Out_String((CHAR*)"swapper: ", 15); - Out_Int(f->swapper, 1); - Out_Ln(); - Files_Spaces(indent); - Out_String((CHAR*)"state: ", 15); - Out_Int(f->state, 1); - Out_Ln(); - Files_Spaces(indent); - Out_String((CHAR*)"next: ", 15); - Out_Hex((INT64)(ADDRESS)f->next, 1); - Out_Ln(); -} - -void Files_DumpBuffer (Files_Buffer b, INT16 indent) -{ - Files_Spaces(indent); - Out_String((CHAR*)"chg: ", 7); - if (b->chg) { - Out_String((CHAR*)"TRUE", 5); - } else { - Out_String((CHAR*)"FALSE", 6); - } - Out_Ln(); - Files_Spaces(indent); - Out_String((CHAR*)"org: ", 7); - Out_Int(b->org, 1); - Out_Ln(); - Files_Spaces(indent); - Out_String((CHAR*)"size: ", 7); - Out_Int(b->size, 1); - Out_Ln(); - Files_Spaces(indent); - Out_String((CHAR*)"data: ", 7); - Out_Ln(); - Out_HexDump((void*)b->data, 4096); - Files_Spaces(indent); - Out_String((CHAR*)"f: ", 7); - if (b->f == NIL) { - Out_String((CHAR*)"", 6); - Out_Ln(); - } else { - Out_Ln(); - Files_DumpFile(b->f, indent + 1); - } -} - -void Files_DumpRider (Files_Rider r, INT16 indent) -{ - Files_Spaces(indent); - Out_String((CHAR*)"res: ", 9); - Out_Int(r.res, 1); - Out_Ln(); - Files_Spaces(indent); - Out_String((CHAR*)"eof: ", 9); - if (r.eof) { - Out_String((CHAR*)"TRUE", 5); - } else { - Out_String((CHAR*)"FALSE", 6); - } - Out_Ln(); - Files_Spaces(indent); - Out_String((CHAR*)"org: ", 9); - Out_Int(r.org, 1); - Out_Ln(); - Files_Spaces(indent); - Out_String((CHAR*)"offset: ", 9); - Out_Int(r.offset, 1); - Out_Ln(); - Files_Spaces(indent); - Out_String((CHAR*)"buf: ", 9); - if (r.buf == NIL) { - Out_String((CHAR*)"", 6); - Out_Ln(); - } else { - Out_Ln(); - Files_DumpBuffer(r.buf, indent + 1); - } -} - static void Files_Assert (BOOLEAN truth) { if (!truth) { diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 0093b4e8..74f5c8ca 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,19 +1,10 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h #include "SYSTEM.h" -typedef - struct Files_BufDesc { - INT64 _prvt0; - char _prvt1[4108]; - } Files_BufDesc; - -typedef - Files_BufDesc *Files_Buffer; - typedef struct Files_FileDesc *Files_File; @@ -34,16 +25,12 @@ typedef import ADDRESS *Files_FileDesc__typ; -import ADDRESS *Files_BufDesc__typ; import ADDRESS *Files_Rider__typ; import Files_File Files_Base (Files_Rider *r, ADDRESS *r__typ); import void Files_ChangeDirectory (CHAR *path, ADDRESS path__len, INT16 *res); import void Files_Close (Files_File f); import void Files_Delete (CHAR *name, ADDRESS name__len, INT16 *res); -import void Files_DumpBuffer (Files_Buffer b, INT16 indent); -import void Files_DumpFile (Files_File f, INT16 indent); -import void Files_DumpRider (Files_Rider r, INT16 indent); import void Files_GetDate (Files_File f, INT32 *t, INT32 *d); import void Files_GetName (Files_File f, CHAR *name, ADDRESS name__len); import INT32 Files_Length (Files_File f); diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index 9f808e0f..aeebff17 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index ac0c9a94..ff1a1b07 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 539c398c..62030574 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index 13be7215..5e518753 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index bb4ea138..19e40505 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index 6757803a..71d82def 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index 093bb886..a5f41a8e 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index a32c29e0..38a2b01d 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index dc8eecc1..143546fd 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -63,6 +63,7 @@ export void OPM_Init (BOOLEAN *done); export void OPM_InitOptions (void); export INT16 OPM_Integer (INT64 n); static BOOLEAN OPM_IsProbablyInstallDir (CHAR *s, ADDRESS s__len); +export void OPM_LogCompiling (CHAR *modname, ADDRESS modname__len); static void OPM_LogErrMsg (INT16 n); export void OPM_LogVT100 (CHAR *vt100code, ADDRESS vt100code__len); export void OPM_LogW (CHAR ch); @@ -92,7 +93,6 @@ export void OPM_SymWInt (INT64 i); export void OPM_SymWLReal (LONGREAL lr); export void OPM_SymWReal (REAL r); export void OPM_SymWSet (UINT64 s); -static void OPM_VerboseListSizes (void); export void OPM_Write (CHAR ch); export void OPM_WriteHex (INT64 i); export void OPM_WriteInt (INT64 i); @@ -136,6 +136,27 @@ void OPM_LogVT100 (CHAR *vt100code, ADDRESS vt100code__len) __DEL(vt100code); } +void OPM_LogCompiling (CHAR *modname, ADDRESS modname__len) +{ + __DUP(modname, modname__len, CHAR); + OPM_LogWStr((CHAR*)"Compiling ", 11); + OPM_LogWStr(modname, modname__len); + if (__IN(18, OPM_Options, 32)) { + OPM_LogWStr((CHAR*)", s:", 5); + OPM_LogWNum(__ASHL(OPM_ShortintSize, 3), 1); + OPM_LogWStr((CHAR*)" i:", 4); + OPM_LogWNum(__ASHL(OPM_IntegerSize, 3), 1); + OPM_LogWStr((CHAR*)" l:", 4); + OPM_LogWNum(__ASHL(OPM_LongintSize, 3), 1); + OPM_LogWStr((CHAR*)" adr:", 6); + OPM_LogWNum(__ASHL(OPM_AddressSize, 3), 1); + OPM_LogWStr((CHAR*)" algn:", 7); + OPM_LogWNum(__ASHL(OPM_Alignment, 3), 1); + } + OPM_LogW('.'); + __DEL(modname); +} + INT64 OPM_SignedMaximum (INT32 bytecount) { INT64 result; @@ -363,32 +384,6 @@ BOOLEAN OPM_OpenPar (void) __RETCHK; } -static void OPM_VerboseListSizes (void) -{ - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Type Size", 15); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"SHORTINT ", 12); - OPM_LogWNum(OPM_ShortintSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"INTEGER ", 12); - OPM_LogWNum(OPM_IntegerSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"LONGINT ", 12); - OPM_LogWNum(OPM_LongintSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"SET ", 12); - OPM_LogWNum(OPM_LongintSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"ADDRESS ", 12); - OPM_LogWNum(OPM_AddressSize, 4); - OPM_LogWLn(); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Alignment: ", 12); - OPM_LogWNum(OPM_Alignment, 4); - OPM_LogWLn(); -} - void OPM_InitOptions (void) { CHAR s[256]; @@ -432,9 +427,6 @@ void OPM_InitOptions (void) OPM_LongintSize = 4; break; } - if (__IN(18, OPM_Options, 32)) { - OPM_VerboseListSizes(); - } __MOVE(OPM_InstallDir, OPM_ResourceDir, 1024); if (OPM_ResourceDir[0] != 0x00) { Strings_Append((CHAR*)"/", 2, (void*)OPM_ResourceDir, 1024); @@ -491,17 +483,6 @@ void OPM_Get (CHAR *ch) { OPM_curpos = Texts_Pos(&OPM_inR, Texts_Reader__typ); Texts_Read(&OPM_inR, Texts_Reader__typ, &*ch); - if ((OPM_curpos == 0 && OPM_inR.eot)) { - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"DEBUG: OPM.Get returned inR.eot at curpos = 0, ch = ", 53); - OPM_LogWNum((INT16)*ch, 1); - OPM_LogW('.'); - Texts_DumpReader(OPM_inR); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Heap dump:", 11); - OPM_LogWLn(); - Out_DumpHeap(); - } if ((*ch < 0x09 && !OPM_inR.eot)) { *ch = ' '; } diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index f246eacb..96318bea 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h @@ -33,6 +33,7 @@ import void OPM_Get (CHAR *ch); import void OPM_Init (BOOLEAN *done); import void OPM_InitOptions (void); import INT16 OPM_Integer (INT64 n); +import void OPM_LogCompiling (CHAR *modname, ADDRESS modname__len); import void OPM_LogVT100 (CHAR *vt100code, ADDRESS vt100code__len); import void OPM_LogW (CHAR ch); import void OPM_LogWLn (void); diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index 911d0bf7..52620168 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -1796,9 +1796,7 @@ void OPP_Module (OPT_Node *prog, UINT32 opt) OPP_err(16); } if (OPP_sym == 38) { - OPM_LogWStr((CHAR*)"compiling ", 11); - OPM_LogWStr(OPS_name, 256); - OPM_LogW('.'); + OPM_LogCompiling(OPS_name, 256); OPT_Init(OPS_name, opt); OPS_Get(&OPP_sym); OPP_CheckSym(39); diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index 913d2eef..aa076aaa 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index abfcd4b8..bf9f1af5 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index 9e15ba4e..09a33705 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index 68c085a5..d89ea5c8 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 228191bf..63bf2070 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 7340919d..69e2f94e 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index ea04b5b8..c6a107b6 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Out.c b/bootstrap/windows-88/Out.c index cb9b1989..01e91698 100644 --- a/bootstrap/windows-88/Out.c +++ b/bootstrap/windows-88/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -14,19 +14,10 @@ export BOOLEAN Out_IsConsole; static CHAR Out_buf[128]; static INT16 Out_in; -static ADDRESS *typedesc__11__typ; -static ADDRESS *blockdesc__5__typ; -static ADDRESS *chunkdesc__7__typ; export void Out_Char (CHAR ch); -export void Out_DumpHeap (void); -static void Out_DumpModule (Heap_Module m); -export void Out_DumpTag (INT64 addr); -export void Out_DumpType (SYSTEM_BYTE *o, ADDRESS o__len); export void Out_Flush (void); export void Out_Hex (INT64 x, INT64 n); -export void Out_HexDump (SYSTEM_BYTE *m, ADDRESS m__len); -export void Out_HexDumpAdr (INT64 adr, INT64 offset, INT32 length); export void Out_Int (INT64 x, INT64 n); static INT32 Out_Length (CHAR *s, ADDRESS s__len); export void Out_Ln (void); @@ -40,8 +31,6 @@ static void Out_digit (INT64 n, CHAR *s, ADDRESS s__len, INT16 *i); static void Out_prepend (CHAR *t, ADDRESS t__len, CHAR *s, ADDRESS s__len, INT16 *i); #define Out_Entier64(x) (INT64)(x) -extern ADDRESS Heap_heap; -#define Out_getheap() Heap_heap void Out_Flush (void) { @@ -139,8 +128,10 @@ void Out_Hex (INT64 x, INT64 n) } else if (n > 16) { n = 16; } - while ((n < 16 && __LSH(x, -__ASHL(n, 2), 64) != 0)) { - n += 1; + if (x >= 0) { + while ((n < 16 && __LSH(x, -__ASHL(n, 2), 64) != 0)) { + n += 1; + } } x = __ROT(x, __ASHL(16 - n, 2), 64); while (n > 0) { @@ -160,235 +151,6 @@ void Out_Ln (void) Out_Flush(); } -void Out_HexDumpAdr (INT64 adr, INT64 offset, INT32 length) -{ - INT16 i; - INT64 n, lim; - CHAR c; - lim = (INT64)(adr + (INT64)length); - while (adr < lim) { - if (adr + 16 < lim) { - n = 16; - } else { - n = lim - adr; - } - Out_Hex(offset, 8); - Out_Char(' '); - i = 0; - while ((INT64)i < n) { - if (__MASK(i, -4) == 0) { - Out_Char(' '); - } - __GET(adr + (INT64)i, c, CHAR); - Out_Hex((INT16)c, 2); - Out_Char(' '); - i += 1; - } - while (i < 16) { - if (__MASK(i, -4) == 0) { - Out_Char(' '); - } - Out_String((CHAR*)" ", 4); - i += 1; - } - Out_String((CHAR*)" ", 2); - i = 0; - while ((INT64)i < n) { - __GET(adr + (INT64)i, c, CHAR); - if ((INT16)c < 32 || (INT16)c > 126) { - Out_Char('.'); - } else { - Out_Char(c); - } - i += 1; - } - adr += n; - offset += n; - Out_Ln(); - } -} - -void Out_HexDump (SYSTEM_BYTE *m, ADDRESS m__len) -{ - Out_HexDumpAdr((ADDRESS)m, 0, m__len); -} - -static void Out_DumpModule (Heap_Module m) -{ - Out_String((CHAR*)" next: ", 19); - Out_Hex((INT64)(ADDRESS)m->next, 1); - Out_Ln(); - Out_String((CHAR*)" name: ", 19); - Out_String(m->name, 20); - Out_Ln(); - Out_String((CHAR*)" refcnt: ", 19); - Out_Hex(m->refcnt, 1); - Out_Ln(); - Out_String((CHAR*)" cmds: ", 19); - Out_Hex((INT64)(ADDRESS)m->cmds, 1); - Out_Ln(); - Out_String((CHAR*)" types: ", 19); - Out_Hex(m->types, 1); - Out_Ln(); - Out_String((CHAR*)" enumPtrs: ", 19); - Out_Hex((INT64)(ADDRESS)m->enumPtrs, 1); - Out_Ln(); -} - -typedef - struct typedesc__11 *tag__10; - -typedef - struct typedesc__11 { - INT64 tag, next, level, module; - CHAR name[24]; - INT64 bases[16]; - INT64 reserved, blksz, ptr0; - } typedesc__11; - -void Out_DumpTag (INT64 addr) -{ - tag__10 desc = NIL; - INT16 i; - Out_String((CHAR*)" obj tag: ", 17); - Out_Hex(addr, 1); - Out_Ln(); - addr -= __MASK(addr, -2); - desc = (tag__10)(ADDRESS)(addr - 192); - Out_String((CHAR*)" desc at: ", 17); - Out_Hex((INT64)(ADDRESS)desc, 1); - Out_Ln(); - Out_String((CHAR*)" desc contains:", 21); - Out_Ln(); - Out_String((CHAR*)" tag: ", 17); - Out_Hex(desc->tag, 1); - Out_Ln(); - Out_String((CHAR*)" next: ", 17); - Out_Hex(desc->next, 1); - Out_Ln(); - Out_String((CHAR*)" level: ", 17); - Out_Hex(desc->level, 1); - Out_Ln(); - Out_String((CHAR*)" module: ", 17); - Out_Hex(desc->module, 1); - Out_Ln(); - if (desc->module != 0) { - Out_DumpModule((Heap_Module)(ADDRESS)desc->module); - } - Out_String((CHAR*)" name: ", 17); - Out_String(desc->name, 24); - Out_Ln(); - Out_String((CHAR*)" bases: ", 17); - i = 0; - while (i < 16) { - Out_Hex(desc->bases[__X(i, 16)], 16); - if (__MASK(i, -4) == 3) { - Out_Ln(); - Out_String((CHAR*)" ", 17); - } else { - Out_Char(' '); - } - i += 1; - } - Out_Ln(); - Out_String((CHAR*)" reserved: ", 17); - Out_Hex(desc->reserved, 1); - Out_Ln(); - Out_String((CHAR*)" blksz: ", 17); - Out_Hex(desc->blksz, 1); - Out_Ln(); - Out_String((CHAR*)" ptr0: ", 17); - Out_Hex(desc->ptr0, 1); - Out_Ln(); -} - -void Out_DumpType (SYSTEM_BYTE *o, ADDRESS o__len) -{ - INT64 addr; - __GET((ADDRESS)o - 8, addr, INT64); - Out_DumpTag(addr); -} - -typedef - INT64 (*adrptr__3)[1]; - -typedef - struct blockdesc__5 *block__4; - -typedef - struct blockdesc__5 { - INT64 tag, size, sentinel, next; - } blockdesc__5; - -typedef - struct chunkdesc__7 *chunk__6; - -typedef - struct chunkdesc__7 { - INT64 next, end, reserved; - blockdesc__5 firstblock; - } chunkdesc__7; - -void Out_DumpHeap (void) -{ - INT64 caddr; - chunk__6 c = NIL; - INT64 baddr; - block__4 b = NIL; - adrptr__3 tag = NIL; - caddr = Heap_heap; - while (caddr != 0) { - Out_String((CHAR*)"Chunk at: ", 11); - Out_Hex(caddr, 1); - Out_Ln(); - c = (chunk__6)(ADDRESS)caddr; - Out_String((CHAR*)" next: ", 11); - Out_Hex(c->next, 1); - Out_Ln(); - Out_String((CHAR*)" end: ", 11); - Out_Hex(c->end, 1); - Out_String((CHAR*)" => size: ", 11); - Out_Hex(c->end - caddr, 1); - Out_Ln(); - Out_String((CHAR*)" rsvd: ", 11); - Out_Hex(c->reserved, 1); - Out_Ln(); - baddr = (ADDRESS)&c->firstblock; - while (c->end - baddr > 0) { - Out_String((CHAR*)" Block at: ", 15); - Out_Hex(baddr, 1); - Out_Ln(); - b = (block__4)(ADDRESS)baddr; - tag = (adrptr__3)(ADDRESS)(b->tag - __MASK(b->tag, -2)); - Out_String((CHAR*)" tag: ", 15); - Out_Hex(b->tag, 1); - if (__MASK(b->tag, -2) != 0) { - Out_String((CHAR*)" <--- ODD! ---", 15); - } - Out_Ln(); - Out_String((CHAR*)" tag^: ", 15); - Out_Hex((*tag)[0], 1); - Out_Ln(); - Out_String((CHAR*)" size: ", 15); - Out_Hex(b->size, 1); - Out_Ln(); - Out_String((CHAR*)" sentinel: ", 15); - Out_Hex(b->sentinel, 1); - Out_Ln(); - Out_String((CHAR*)" next: ", 15); - Out_Hex(b->next, 1); - Out_Ln(); - if (b->tag != (ADDRESS)&b->size) { - Out_DumpTag(b->tag); - } - baddr += (*tag)[0]; - Out_Ln(); - } - caddr = c->next; - Out_Ln(); - } -} - static void Out_digit (INT64 n, CHAR *s, ADDRESS s__len, INT16 *i) { *i -= 1; @@ -566,9 +328,6 @@ void Out_LongReal (LONGREAL x, INT16 n) Out_RealP(x, n, 1); } -__TDESC(typedesc__11, 1, 0) = {__TDFLDS("typedesc__11", 208), {-8}}; -__TDESC(blockdesc__5, 1, 0) = {__TDFLDS("blockdesc__5", 32), {-8}}; -__TDESC(chunkdesc__7, 1, 0) = {__TDFLDS("chunkdesc__7", 56), {-8}}; export void *Out__init(void) { @@ -576,13 +335,9 @@ export void *Out__init(void) __MODULE_IMPORT(Heap); __MODULE_IMPORT(Platform); __REGMOD("Out", 0); - __REGCMD("DumpHeap", Out_DumpHeap); __REGCMD("Flush", Out_Flush); __REGCMD("Ln", Out_Ln); __REGCMD("Open", Out_Open); - __INITYP(typedesc__11, typedesc__11, 0); - __INITYP(blockdesc__5, blockdesc__5, 0); - __INITYP(chunkdesc__7, chunkdesc__7, 0); /* BEGIN */ Out_IsConsole = Platform_IsConsole(Platform_StdOut); Out_in = 0; diff --git a/bootstrap/windows-88/Out.h b/bootstrap/windows-88/Out.h index fe405da3..e1285046 100644 --- a/bootstrap/windows-88/Out.h +++ b/bootstrap/windows-88/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h @@ -10,13 +10,8 @@ import BOOLEAN Out_IsConsole; import void Out_Char (CHAR ch); -import void Out_DumpHeap (void); -import void Out_DumpTag (INT64 addr); -import void Out_DumpType (SYSTEM_BYTE *o, ADDRESS o__len); import void Out_Flush (void); import void Out_Hex (INT64 x, INT64 n); -import void Out_HexDump (SYSTEM_BYTE *m, ADDRESS m__len); -import void Out_HexDumpAdr (INT64 adr, INT64 offset, INT32 length); import void Out_Int (INT64 x, INT64 n); import void Out_Ln (void); import void Out_LongReal (LONGREAL x, INT16 n); diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 127901b0..1304f291 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index 0b6a96a2..99405d0b 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 9b449f98..d1eb72f6 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index 3e83af42..170d1785 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index f9b5310a..225bd40a 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index 58f9b546..4d98f1a3 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index 429d0665..565de43f 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -192,11 +192,6 @@ export void Texts_Close (Texts_Text T, CHAR *name, ADDRESS name__len); export void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); export void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); export void Texts_Delete (Texts_Text T, INT32 beg, INT32 end); -static void Texts_DumpElem (Texts_Elem e); -static void Texts_DumpPiece (Texts_Piece p); -export void Texts_DumpReader (Texts_Reader re); -static void Texts_DumpRun (Texts_Run ru); -static void Texts_DumpText (Texts_Text t); export Texts_Text Texts_ElemBase (Texts_Elem E); export INT32 Texts_ElemPos (Texts_Elem E); static void Texts_Find (Texts_Text T, INT32 *pos, Texts_Run *u, INT32 *org, INT32 *off); @@ -238,161 +233,6 @@ export void Texts_WriteRealHex (Texts_Writer *W, ADDRESS *W__typ, REAL x); export void Texts_WriteString (Texts_Writer *W, ADDRESS *W__typ, CHAR *s, ADDRESS s__len); -static void Texts_DumpText (Texts_Text t) -{ - Out_String((CHAR*)" len: ", 15); - Out_Int(t->len, 1); - Out_Ln(); - Out_String((CHAR*)" notify: ", 15); - Out_Hex((INT64)(ADDRESS)t->notify, 1); - Out_Ln(); - Out_String((CHAR*)" head: ", 15); - Out_Hex((INT64)(ADDRESS)t->head, 1); - Out_Ln(); - Out_String((CHAR*)" cache: ", 15); - Out_Hex((INT64)(ADDRESS)t->cache, 1); - Out_Ln(); - Out_String((CHAR*)" corg: ", 15); - Out_Int(t->corg, 1); - Out_Ln(); -} - -static void Texts_DumpRun (Texts_Run ru) -{ - Out_String((CHAR*)" Run at ", 12); - Out_Hex((INT64)(ADDRESS)ru, 1); - Out_Ln(); - Out_String((CHAR*)" prev: ", 12); - Out_Hex((INT64)(ADDRESS)ru->prev, 1); - Out_Ln(); - Out_String((CHAR*)" next: ", 12); - Out_Hex((INT64)(ADDRESS)ru->next, 1); - Out_Ln(); - Out_String((CHAR*)" len: ", 12); - Out_Int(ru->len, 1); - Out_Ln(); - Out_String((CHAR*)" fnt: ", 12); - if (ru->fnt != NIL) { - Out_String(ru->fnt->name, 32); - } else { - Out_String((CHAR*)"", 6); - } - Out_Ln(); - Out_String((CHAR*)" col: ", 12); - Out_Int(ru->col, 1); - Out_Ln(); - Out_String((CHAR*)" voff: ", 12); - Out_Int(ru->voff, 1); - Out_Ln(); - Out_String((CHAR*)" ascii: ", 12); - if (ru->ascii) { - Out_String((CHAR*)"TRUE", 5); - } else { - Out_String((CHAR*)"FALSE", 6); - } - Out_Ln(); -} - -static void Texts_DumpElem (Texts_Elem e) -{ - Texts_DumpRun((void*)e); - Out_String((CHAR*)" -- Elem --", 15); - Out_Ln(); - Out_String((CHAR*)" W: ", 13); - Out_Int(e->W, 1); - Out_Ln(); - Out_String((CHAR*)" H: ", 13); - Out_Int(e->H, 1); - Out_Ln(); - Out_String((CHAR*)" handle: ", 13); - Out_Hex((INT64)(ADDRESS)e->handle, 1); - Out_Ln(); - Out_String((CHAR*)" base: ", 13); - if (e->base == NIL) { - Out_String((CHAR*)"", 6); - Out_Ln(); - } else { - Out_Ln(); - Texts_DumpText(e->base); - } -} - -static void Texts_DumpPiece (Texts_Piece p) -{ - Texts_DumpRun((void*)p); - Out_String((CHAR*)" -- Piece --", 16); - Out_Ln(); - Out_String((CHAR*)" file: ", 12); - if (p->file == NIL) { - Out_String((CHAR*)"", 6); - Out_Ln(); - } else { - Out_Ln(); - Files_DumpFile(p->file, 3); - } - Out_String((CHAR*)" org: ", 12); - Out_Int(p->org, 1); - Out_Ln(); -} - -void Texts_DumpReader (Texts_Reader re) -{ - Out_String((CHAR*)"Reader:", 8); - Out_Ln(); - Out_String((CHAR*)" eot: ", 10); - if (re.eot) { - Out_String((CHAR*)"TRUE", 5); - } else { - Out_String((CHAR*)"FALSE", 6); - } - Out_Ln(); - Out_String((CHAR*)" fnt: ", 10); - if (re.fnt != NIL) { - Out_String(re.fnt->name, 32); - } else { - Out_String((CHAR*)"", 6); - } - Out_Ln(); - Out_String((CHAR*)" col: ", 10); - Out_Int(re.col, 1); - Out_Ln(); - Out_String((CHAR*)" voff: ", 10); - Out_Int(re.voff, 1); - Out_Ln(); - Out_String((CHAR*)" org: ", 10); - Out_Int(re.org, 1); - Out_Ln(); - Out_String((CHAR*)" off: ", 10); - Out_Int(re.off, 1); - Out_Ln(); - Out_String((CHAR*)" elem: ", 10); - if (re.elem == NIL) { - Out_String((CHAR*)"", 6); - Out_Ln(); - } else { - Out_Ln(); - Texts_DumpElem(re.elem); - } - Out_String((CHAR*)" rider: ", 10); - Out_Ln(); - Files_DumpRider(re.rider, 2); - Out_String((CHAR*)" run: ", 10); - if (re.run == NIL) { - Out_String((CHAR*)"", 6); - Out_Ln(); - } else { - Out_Ln(); - if (__ISP(re.run, Texts_PieceDesc, 1)) { - Texts_DumpPiece(__GUARDP(re.run, Texts_PieceDesc, 1)); - } else if (__ISP(re.run, Texts_ElemDesc, 1)) { - Texts_DumpElem(__GUARDP(re.run, Texts_ElemDesc, 1)); - } else { - Texts_DumpRun(re.run); - } - } - Out_DumpType((void*)&*re.run, 40); -} - static Texts_FontsFont Texts_FontsThis (CHAR *name, ADDRESS name__len) { Texts_FontsFont F = NIL; @@ -877,32 +717,32 @@ void Texts_OpenScanner (Texts_Scanner *S, ADDRESS *S__typ, Texts_Text T, INT32 p (*S).nextCh = ' '; } -static struct Scan__36 { +static struct Scan__31 { Texts_Scanner *S; ADDRESS *S__typ; CHAR *ch; BOOLEAN *negE; INT16 *e; - struct Scan__36 *lnk; -} *Scan__36_s; + struct Scan__31 *lnk; +} *Scan__31_s; -static void ReadScaleFactor__37 (void); +static void ReadScaleFactor__32 (void); -static void ReadScaleFactor__37 (void) +static void ReadScaleFactor__32 (void) { - Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); - if (*Scan__36_s->ch == '-') { - *Scan__36_s->negE = 1; - Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); + Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); + if (*Scan__31_s->ch == '-') { + *Scan__31_s->negE = 1; + Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); } else { - *Scan__36_s->negE = 0; - if (*Scan__36_s->ch == '+') { - Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); + *Scan__31_s->negE = 0; + if (*Scan__31_s->ch == '+') { + Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); } } - while (('0' <= *Scan__36_s->ch && *Scan__36_s->ch <= '9')) { - *Scan__36_s->e = (*Scan__36_s->e * 10 + (INT16)*Scan__36_s->ch) - 48; - Texts_Read((void*)&*Scan__36_s->S, Scan__36_s->S__typ, &*Scan__36_s->ch); + while (('0' <= *Scan__31_s->ch && *Scan__31_s->ch <= '9')) { + *Scan__31_s->e = (*Scan__31_s->e * 10 + (INT16)*Scan__31_s->ch) - 48; + Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); } } @@ -916,13 +756,13 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) REAL x, f; LONGREAL y, g; CHAR d[32]; - struct Scan__36 _s; + struct Scan__31 _s; _s.S = S; _s.S__typ = S__typ; _s.ch = &ch; _s.negE = &negE; _s.e = &e; - _s.lnk = Scan__36_s; - Scan__36_s = &_s; + _s.lnk = Scan__31_s; + Scan__31_s = &_s; ch = (*S).nextCh; i = 0; for (;;) { @@ -1023,7 +863,7 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) y = ((INT16)d[__X(j, 32)] - 48) * g + y; j += 1; } - ReadScaleFactor__37(); + ReadScaleFactor__32(); if (negE) { if (e <= 308) { y = y / (LONGREAL)Reals_TenL(e); @@ -1056,7 +896,7 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) j += 1; } if (ch == 'E') { - ReadScaleFactor__37(); + ReadScaleFactor__32(); } if (negE) { if (e <= 38) { @@ -1109,7 +949,7 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) } } (*S).nextCh = ch; - Scan__36_s = _s.lnk; + Scan__31_s = _s.lnk; } void Texts_OpenWriter (Texts_Writer *W, ADDRESS *W__typ) @@ -1328,30 +1168,30 @@ void Texts_WriteReal (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n) } } -static struct WriteRealFix__58 { +static struct WriteRealFix__53 { Texts_Writer *W; ADDRESS *W__typ; INT16 *i; CHAR (*d)[9]; - struct WriteRealFix__58 *lnk; -} *WriteRealFix__58_s; + struct WriteRealFix__53 *lnk; +} *WriteRealFix__53_s; -static void dig__59 (INT16 n); -static void seq__61 (CHAR ch, INT16 n); +static void dig__54 (INT16 n); +static void seq__56 (CHAR ch, INT16 n); -static void seq__61 (CHAR ch, INT16 n) +static void seq__56 (CHAR ch, INT16 n) { while (n > 0) { - Texts_Write(&*WriteRealFix__58_s->W, WriteRealFix__58_s->W__typ, ch); + Texts_Write(&*WriteRealFix__53_s->W, WriteRealFix__53_s->W__typ, ch); n -= 1; } } -static void dig__59 (INT16 n) +static void dig__54 (INT16 n) { while (n > 0) { - *WriteRealFix__58_s->i -= 1; - Texts_Write(&*WriteRealFix__58_s->W, WriteRealFix__58_s->W__typ, (*WriteRealFix__58_s->d)[__X(*WriteRealFix__58_s->i, 9)]); + *WriteRealFix__53_s->i -= 1; + Texts_Write(&*WriteRealFix__53_s->W, WriteRealFix__53_s->W__typ, (*WriteRealFix__53_s->d)[__X(*WriteRealFix__53_s->i, 9)]); n -= 1; } } @@ -1362,23 +1202,23 @@ void Texts_WriteRealFix (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n, INT1 CHAR sign; REAL x0; CHAR d[9]; - struct WriteRealFix__58 _s; + struct WriteRealFix__53 _s; _s.W = W; _s.W__typ = W__typ; _s.i = &i; _s.d = (void*)d; - _s.lnk = WriteRealFix__58_s; - WriteRealFix__58_s = &_s; + _s.lnk = WriteRealFix__53_s; + WriteRealFix__53_s = &_s; e = Reals_Expo(x); if (k < 0) { k = 0; } if (e == 0) { - seq__61(' ', (n - k) - 2); + seq__56(' ', (n - k) - 2); Texts_Write(&*W, W__typ, '0'); - seq__61(' ', k + 1); + seq__56(' ', k + 1); } else if (e == 255) { Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", 5); - seq__61(' ', n - 4); + seq__56(' ', n - 4); } else { e = __ASHR((e - 127) * 77, 8); if (x < (REAL)0) { @@ -1411,21 +1251,21 @@ void Texts_WriteRealFix (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n, INT1 i = k + e; Reals_Convert(x, i, (void*)d, 9); if (e > 0) { - seq__61(' ', ((n - e) - k) - 2); + seq__56(' ', ((n - e) - k) - 2); Texts_Write(&*W, W__typ, sign); - dig__59(e); + dig__54(e); Texts_Write(&*W, W__typ, '.'); - dig__59(k); + dig__54(k); } else { - seq__61(' ', (n - k) - 3); + seq__56(' ', (n - k) - 3); Texts_Write(&*W, W__typ, sign); Texts_Write(&*W, W__typ, '0'); Texts_Write(&*W, W__typ, '.'); - seq__61('0', -e); - dig__59(k + e); + seq__56('0', -e); + dig__54(k + e); } } - WriteRealFix__58_s = _s.lnk; + WriteRealFix__53_s = _s.lnk; } void Texts_WriteRealHex (Texts_Writer *W, ADDRESS *W__typ, REAL x) @@ -1524,48 +1364,48 @@ void Texts_WriteLongRealHex (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x) } while (!(i == 16)); } -static struct WriteDate__48 { +static struct WriteDate__43 { Texts_Writer *W; ADDRESS *W__typ; - struct WriteDate__48 *lnk; -} *WriteDate__48_s; + struct WriteDate__43 *lnk; +} *WriteDate__43_s; -static void WritePair__49 (CHAR ch, INT32 x); +static void WritePair__44 (CHAR ch, INT32 x); -static void WritePair__49 (CHAR ch, INT32 x) +static void WritePair__44 (CHAR ch, INT32 x) { - Texts_Write(&*WriteDate__48_s->W, WriteDate__48_s->W__typ, ch); - Texts_Write(&*WriteDate__48_s->W, WriteDate__48_s->W__typ, (CHAR)(__DIV(x, 10) + 48)); - Texts_Write(&*WriteDate__48_s->W, WriteDate__48_s->W__typ, (CHAR)((int)__MOD(x, 10) + 48)); + Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, ch); + Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)(__DIV(x, 10) + 48)); + Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)((int)__MOD(x, 10) + 48)); } void Texts_WriteDate (Texts_Writer *W, ADDRESS *W__typ, INT32 t, INT32 d) { - struct WriteDate__48 _s; + struct WriteDate__43 _s; _s.W = W; _s.W__typ = W__typ; - _s.lnk = WriteDate__48_s; - WriteDate__48_s = &_s; - WritePair__49(' ', __MASK(d, -32)); - WritePair__49('.', __MASK(__ASHR(d, 5), -16)); - WritePair__49('.', __MASK(__ASHR(d, 9), -128)); - WritePair__49(' ', __MASK(__ASHR(t, 12), -32)); - WritePair__49(':', __MASK(__ASHR(t, 6), -64)); - WritePair__49(':', __MASK(t, -64)); - WriteDate__48_s = _s.lnk; + _s.lnk = WriteDate__43_s; + WriteDate__43_s = &_s; + WritePair__44(' ', __MASK(d, -32)); + WritePair__44('.', __MASK(__ASHR(d, 5), -16)); + WritePair__44('.', __MASK(__ASHR(d, 9), -128)); + WritePair__44(' ', __MASK(__ASHR(t, 12), -32)); + WritePair__44(':', __MASK(__ASHR(t, 6), -64)); + WritePair__44(':', __MASK(t, -64)); + WriteDate__43_s = _s.lnk; } -static struct Load0__21 { +static struct Load0__16 { Texts_Text *T; INT8 *ecnt; Files_File *f; Texts_FileMsg *msg; CHAR (*mods)[64][32], (*procs)[64][32]; - struct Load0__21 *lnk; -} *Load0__21_s; + struct Load0__16 *lnk; +} *Load0__16_s; -static void LoadElem__22 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e); +static void LoadElem__17 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e); -static void LoadElem__22 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e) +static void LoadElem__17 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e) { Heap_Module M = NIL; Heap_Command Cmd; @@ -1576,15 +1416,15 @@ static void LoadElem__22 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span Files_ReadLInt(&*r, r__typ, &ew); Files_ReadLInt(&*r, r__typ, &eh); Files_Read(&*r, r__typ, (void*)&eno); - if (eno > *Load0__21_s->ecnt) { - *Load0__21_s->ecnt = eno; - Files_ReadString(&*r, r__typ, (void*)(*Load0__21_s->mods)[__X(eno, 64)], 32); - Files_ReadString(&*r, r__typ, (void*)(*Load0__21_s->procs)[__X(eno, 64)], 32); + if (eno > *Load0__16_s->ecnt) { + *Load0__16_s->ecnt = eno; + Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->mods)[__X(eno, 64)], 32); + Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->procs)[__X(eno, 64)], 32); } org = Files_Pos(&*r, r__typ); - M = Modules_ThisMod((*Load0__21_s->mods)[__X(eno, 64)], 32); + M = Modules_ThisMod((*Load0__16_s->mods)[__X(eno, 64)], 32); if (M != NIL) { - Cmd = Modules_ThisCommand(M, (*Load0__21_s->procs)[__X(eno, 64)], 32); + Cmd = Modules_ThisCommand(M, (*Load0__16_s->procs)[__X(eno, 64)], 32); if (Cmd != NIL) { (*Cmd)(); } @@ -1593,25 +1433,25 @@ static void LoadElem__22 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span if (*e != NIL) { (*e)->W = ew; (*e)->H = eh; - (*e)->base = *Load0__21_s->T; - (*Load0__21_s->msg).pos = pos; - (*(*e)->handle)(*e, (void*)&*Load0__21_s->msg, Texts_FileMsg__typ); + (*e)->base = *Load0__16_s->T; + (*Load0__16_s->msg).pos = pos; + (*(*e)->handle)(*e, (void*)&*Load0__16_s->msg, Texts_FileMsg__typ); if (Files_Pos(&*r, r__typ) != org + span) { *e = NIL; } } if (*e == NIL) { - Files_Set(&*r, r__typ, *Load0__21_s->f, org + span); + Files_Set(&*r, r__typ, *Load0__16_s->f, org + span); __NEW(a, Texts__1); a->W = ew; a->H = eh; a->handle = Texts_HandleAlien; - a->base = *Load0__21_s->T; - a->file = *Load0__21_s->f; + a->base = *Load0__16_s->T; + a->file = *Load0__16_s->f; a->org = org; a->span = span; - __COPY((*Load0__21_s->mods)[__X(eno, 64)], a->mod, 32); - __COPY((*Load0__21_s->procs)[__X(eno, 64)], a->proc, 32); + __COPY((*Load0__16_s->mods)[__X(eno, 64)], a->mod, 32); + __COPY((*Load0__16_s->procs)[__X(eno, 64)], a->proc, 32); *e = (Texts_Elem)a; } } @@ -1628,15 +1468,15 @@ static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) CHAR mods[64][32], procs[64][32]; CHAR name[32]; Texts_FontsFont fnts[32]; - struct Load0__21 _s; + struct Load0__16 _s; _s.T = &T; _s.ecnt = &ecnt; _s.f = &f; _s.msg = &msg; _s.mods = (void*)mods; _s.procs = (void*)procs; - _s.lnk = Load0__21_s; - Load0__21_s = &_s; + _s.lnk = Load0__16_s; + Load0__16_s = &_s; pos = Files_Pos(&*r, r__typ); f = Files_Base(&*r, r__typ); __NEW(u, Texts_RunDesc); @@ -1669,7 +1509,7 @@ static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) un = (Texts_Run)p; un->len = plen; } else { - LoadElem__22(&msg.r, Files_Rider__typ, pos - org, -plen, &e); + LoadElem__17(&msg.r, Files_Rider__typ, pos - org, -plen, &e); un = (Texts_Run)e; un->len = 1; } @@ -1687,7 +1527,7 @@ static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) T->corg = 0; Files_ReadLInt(&msg.r, Files_Rider__typ, &T->len); Files_Set(&*r, r__typ, f, Files_Pos(&msg.r, Files_Rider__typ) + T->len); - Load0__21_s = _s.lnk; + Load0__16_s = _s.lnk; } void Texts_Load (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) @@ -1756,25 +1596,25 @@ void Texts_Open (Texts_Text T, CHAR *name, ADDRESS name__len) __DEL(name); } -static struct Store__44 { +static struct Store__39 { INT8 *ecnt; Texts_FileMsg *msg; Texts_IdentifyMsg *iden; CHAR (*mods)[64][32], (*procs)[64][32]; - struct Store__44 *lnk; -} *Store__44_s; + struct Store__39 *lnk; +} *Store__39_s; -static void StoreElem__45 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e); +static void StoreElem__40 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e); -static void StoreElem__45 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e) +static void StoreElem__40 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e) { Files_Rider r1; INT32 org, span; INT8 eno; - __COPY((*Store__44_s->iden).mod, (*Store__44_s->mods)[__X(*Store__44_s->ecnt, 64)], 32); - __COPY((*Store__44_s->iden).proc, (*Store__44_s->procs)[__X(*Store__44_s->ecnt, 64)], 32); + __COPY((*Store__39_s->iden).mod, (*Store__39_s->mods)[__X(*Store__39_s->ecnt, 64)], 32); + __COPY((*Store__39_s->iden).proc, (*Store__39_s->procs)[__X(*Store__39_s->ecnt, 64)], 32); eno = 1; - while (__STRCMP((*Store__44_s->mods)[__X(eno, 64)], (*Store__44_s->iden).mod) != 0 || __STRCMP((*Store__44_s->procs)[__X(eno, 64)], (*Store__44_s->iden).proc) != 0) { + while (__STRCMP((*Store__39_s->mods)[__X(eno, 64)], (*Store__39_s->iden).mod) != 0 || __STRCMP((*Store__39_s->procs)[__X(eno, 64)], (*Store__39_s->iden).proc) != 0) { eno += 1; } Files_Set(&r1, Files_Rider__typ, Files_Base(&*r, r__typ), Files_Pos(&*r, r__typ)); @@ -1782,14 +1622,14 @@ static void StoreElem__45 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Ele Files_WriteLInt(&*r, r__typ, 0); Files_WriteLInt(&*r, r__typ, 0); Files_Write(&*r, r__typ, eno); - if (eno == *Store__44_s->ecnt) { - *Store__44_s->ecnt += 1; - Files_WriteString(&*r, r__typ, (*Store__44_s->iden).mod, 32); - Files_WriteString(&*r, r__typ, (*Store__44_s->iden).proc, 32); + if (eno == *Store__39_s->ecnt) { + *Store__39_s->ecnt += 1; + Files_WriteString(&*r, r__typ, (*Store__39_s->iden).mod, 32); + Files_WriteString(&*r, r__typ, (*Store__39_s->iden).proc, 32); } - (*Store__44_s->msg).pos = pos; + (*Store__39_s->msg).pos = pos; org = Files_Pos(&*r, r__typ); - (*e->handle)(e, (void*)&*Store__44_s->msg, Texts_FileMsg__typ); + (*e->handle)(e, (void*)&*Store__39_s->msg, Texts_FileMsg__typ); span = Files_Pos(&*r, r__typ) - org; Files_WriteLInt(&r1, Files_Rider__typ, -span); Files_WriteLInt(&r1, Files_Rider__typ, e->W); @@ -1810,14 +1650,14 @@ void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) CHAR mods[64][32], procs[64][32]; Texts_FontsFont fnts[32]; CHAR block[1024]; - struct Store__44 _s; + struct Store__39 _s; _s.ecnt = &ecnt; _s.msg = &msg; _s.iden = &iden; _s.mods = (void*)mods; _s.procs = (void*)procs; - _s.lnk = Store__44_s; - Store__44_s = &_s; + _s.lnk = Store__39_s; + Store__39_s = &_s; org = Files_Pos(&*r, r__typ); msg.id = 1; msg.r = *r; @@ -1859,7 +1699,7 @@ void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) pos += rlen; u = un; } else if (iden.mod[0] != 0x00) { - StoreElem__45(&msg.r, Files_Rider__typ, pos, __GUARDP(u, Texts_ElemDesc, 1)); + StoreElem__40(&msg.r, Files_Rider__typ, pos, __GUARDP(u, Texts_ElemDesc, 1)); pos += 1; u = u->next; } else { @@ -1913,7 +1753,7 @@ void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) if (T->notify != NIL) { (*T->notify)(T, 3, 0, 0); } - Store__44_s = _s.lnk; + Store__39_s = _s.lnk; } void Texts_Close (Texts_Text T, CHAR *name, ADDRESS name__len) diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index ac6542ff..bdd9fada 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h @@ -135,7 +135,6 @@ import void Texts_Close (Texts_Text T, CHAR *name, ADDRESS name__len); import void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); import void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); import void Texts_Delete (Texts_Text T, INT32 beg, INT32 end); -import void Texts_DumpReader (Texts_Reader re); import Texts_Text Texts_ElemBase (Texts_Elem E); import INT32 Texts_ElemPos (Texts_Elem E); import void Texts_Insert (Texts_Text T, INT32 pos, Texts_Buffer B); diff --git a/bootstrap/windows-88/VT100.c b/bootstrap/windows-88/VT100.c index 80457921..9cd5cf4d 100644 --- a/bootstrap/windows-88/VT100.c +++ b/bootstrap/windows-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/VT100.h b/bootstrap/windows-88/VT100.h index 1a589c43..8f60c652 100644 --- a/bootstrap/windows-88/VT100.h +++ b/bootstrap/windows-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index 46b1acc2..fa840303 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -82,7 +82,7 @@ void extTools_Assemble (CHAR *moduleName, ADDRESS moduleName__len) Strings_Append((CHAR*)"-c ", 4, (void*)cmd, 1023); Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); Strings_Append((CHAR*)".c", 3, (void*)cmd, 1023); - extTools_execute((CHAR*)"Assemble: ", 11, cmd, 1023); + extTools_execute((CHAR*)"C compile: ", 12, cmd, 1023); __DEL(moduleName); } @@ -106,7 +106,7 @@ void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN stati Strings_Append((CHAR*)"-O", 3, (void*)cmd, 1023); Strings_Append(OPM_Model, 10, (void*)cmd, 1023); Strings_Append((CHAR*)"", 1, (void*)cmd, 1023); - extTools_execute((CHAR*)"Assemble and link: ", 20, cmd, 1023); + extTools_execute((CHAR*)"C compile and link: ", 21, cmd, 1023); __DEL(additionalopts); } diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index 4201df04..a93b6c85 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h From 305781e000703ae82ea66f17bba6c0781afbf6fc Mon Sep 17 00:00:00 2001 From: David Brown Date: Tue, 20 Dec 2016 17:27:47 +0000 Subject: [PATCH 446/580] Version 2.1.0 - update version and add history. --- ReadMe.md | 5 +++++ doc/History.md | 29 +++++++++++++++++++++++++---- src/tools/make/configure.c | 2 +- 3 files changed, 31 insertions(+), 5 deletions(-) diff --git a/ReadMe.md b/ReadMe.md index 32e200b0..3e2120a5 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -298,3 +298,8 @@ Also, Vishaps are known in tales, fiction. [This page](http://blog.fogus.me/2015 - [Joseph Templ's ofront on github](https://hithub.com/jtempl/ofront) - [Software Templ OG](http://www.software-templ.com) - [Oberon: Steps beyond Pascal and Modula](http://fruttenboel.verhoeven272.nl/Oberon/) + + +## History + +See [**History**](/doc/History.md). \ No newline at end of file diff --git a/doc/History.md b/doc/History.md index 6ff44199..26d20bdf 100644 --- a/doc/History.md +++ b/doc/History.md @@ -1,9 +1,30 @@ -#### (Work in progress) - - - ### History +#### Changes from 2.0 to 2.1.0 + + - Features + - Modules of a multi-module program may now be compiled independently - it is + no longer necessary to compile all modules on a single compiler command line. + - The file system location of standard libraries is now determined relative to + where the compiler binary loads from, rather than a fixed location built + into the compiler at install time. + - ```make full``` no longer installs the compiler, and can be run without + root/administrator priviledges. Optionally use ```make install``` to install. + - New warning message to advise of redefinition of standard predefined types. + - Supports revised Oberon array assignment. As well as supporting assignments + between arrays of identical type and size, also supports assignment of arrays + of identical type where the target is larger than the source. + - Fixes: + - Files.Mod provide Oberon system compatible behaviour when deleting an open file. + - The open file will be renamed to a temporary file, remaining accessible and + can be (re)registered. If not registered the temporary file will be deleted + at exit. + - Support allocated memory straddling and above 7FFFFFFFH. + - Flush output on assertion failure. + - Fix 2 or more dimension open array parameter addressing. + - Remove invalid large integer literal warnings on OpenBSD. + - Fix incorrect type generation when a record variable of type LONGINT immediately + follows a record variable of type SYSTEM.ADDRESS. #### Changes from 1.2 to 2.0 diff --git a/src/tools/make/configure.c b/src/tools/make/configure.c index 4fde13a3..458bddec 100644 --- a/src/tools/make/configure.c +++ b/src/tools/make/configure.c @@ -8,7 +8,7 @@ // Derived from vocparam.c originally by J. Templ 23.6.95 -#define O_VER 2.00 // Version number to be reported by compiler. +#define O_VER 2.1.0 // Version number to be reported by compiler. #define O_NAME voc // Compiler name used for binary, install dir and references in text. From 3ba0d7ae2c22e7c38395fbd585dd29826845c080 Mon Sep 17 00:00:00 2001 From: David Brown Date: Wed, 21 Dec 2016 13:01:14 +0000 Subject: [PATCH 447/580] Update Visual C make.cmd, use separate compilation for LOLA conf test. --- make.cmd | 192 +++++++++++++++++-------------- src/compiler/extTools.Mod | 33 ++++-- src/test/confidence/lola/test.sh | 6 +- src/test/confidence/testenv.sh | 7 +- src/tools/make/configure.c | 1 + 5 files changed, 135 insertions(+), 104 deletions(-) diff --git a/make.cmd b/make.cmd index 6eb498e5..7a42fe50 100644 --- a/make.cmd +++ b/make.cmd @@ -1,26 +1,30 @@ @echo off -:: mscmake.cmd - Build Oberon with Microsoft C compiler. +:: make.cmd - Build Oberon with Microsoft C compiler. :: Expects the path to include cl.exe. -:: As of 10th Feb 2016 the miscrosoft c compiler and build tools +:: As of December 2016 the Microsoft C compiler and build tools :: can be downloaded independently of the full Visual Studio IDE :: as the 'Visual C++ Build Tools 2015'. -:: See: https://blogs.msdn.microsoft.com/vcblog/2015/11/02/announcing-visual-c-build-tools-2015-standalone-c-tools-for-build-environments/ +:: See: http://landinghub.visualstudio.com/visual-cpp-build-tools :: With this installed, from the start button select: -:: All Apps / Visual C++ Build Tools / Visual C++ x86 Native Build Tools Command Prompt +:: All Apps / Visual C++ Build Tools / Visual C++ 2015 x86 Native Build Tools Command Prompt +:: or All Apps / Visual C++ Build Tools / Visual C++ 2015 x64 Native Build Tools Command Prompt + + :: Create configuration and parameter files. -cl -nologo -Isrc\runtime src\tools\make\configure.c >nul +cl -nologo -Isrc\runtime src\tools\make\configure.c >msc-listing || type msc-listing setlocal configure.exe >nul del configure.obj configure.exe 2>nul + :: Extract make variables into local environment for /F "delims='=' tokens=1,2" %%a in (Configuration.make) do set %%a=%%b @@ -33,7 +37,6 @@ set MODEL=2 for /F %%d in ('cd');do set ROOTDIR=%%d - :: Process target parameter if "%1" equ "" ( @@ -51,30 +54,86 @@ goto :eof @echo. @echo Usage: @echo. -@echo. make full - Make and install compiler (from administrator prompt) +@echo. make full - Make compiler to 'install' subdirectory +@echo. make install - Install 'install' subdir to OS. Requires administrator privileges @echo. -@echo. make clean - Remove made files -@echo. make compiler - Build the compiler but not the library -@echo. make library - Build all library files and make library -@echo. make install - Install built compiler and library (from administrator prompt) +@echo. make clean - Remove made files +@echo. make compiler - Build the compiler but not the library +@echo. make library - Build all library files and make library +@echo. make install - Install built compiler and library (from administrator prompt) goto :eof :full +call :clean || exit /b +call :compiler || exit /b +call :browsercmd || exit /b +call :library || exit /b +call :makeinstalldir || exit /b +goto :eof + + + + +:makeinstalldir +rmdir /s /q "%ROOTDIR%\install" >nul 2>&1 +mkdir "%ROOTDIR%\install" >nul 2>&1 + +mkdir "%ROOTDIR%\install\bin" >nul 2>&1 +copy %OBECOMP% "%ROOTDIR%\install\bin" >nul +copy %BUILDDIR%\showdef.exe "%ROOTDIR%\install\bin" >nul + +mkdir "%ROOTDIR%\install\2" >nul 2>&1 +mkdir "%ROOTDIR%\install\2\include" >nul 2>&1 +mkdir "%ROOTDIR%\install\2\sym" >nul 2>&1 +copy %BUILDDIR%\2\*.h "%ROOTDIR%\install\2\include" >nul +copy %BUILDDIR%\2\*.sym "%ROOTDIR%\install\2\sym" >nul + +mkdir "%ROOTDIR%\install\C" >nul 2>&1 +mkdir "%ROOTDIR%\install\C\include" >nul 2>&1 +mkdir "%ROOTDIR%\install\C\sym" >nul 2>&1 +copy %BUILDDIR%\C\*.h "%ROOTDIR%\install\C\include" >nul +copy %BUILDDIR%\C\*.sym "%ROOTDIR%\install\C\sym" >nul + +mkdir "%ROOTDIR%\install\lib" >nul 2>&1 +copy %BUILDDIR%\2\lib%ONAME%* "%ROOTDIR%\install\lib" >nul +copy %BUILDDIR%\C\lib%ONAME%* "%ROOTDIR%\install\lib" >nul + +echo. +echo Now add %ROOTDIR%\install\bin to your path, for example with the command: +echo PATH %ROOTDIR%\install\bin;%%PATH%% +echo. +goto :eof + + + +:install whoami /groups | find "12288" >nul if errorlevel 1 ( -echo make full - administrator rights required. Please run under an administrator command prompt. +echo make install - administrator rights required. Please run under an administrator command prompt. goto :eof ) -call :uninstall || exit /b -call :clean || exit /b -call :compiler || exit /b -call :browsercmd || exit /b -call :library || exit /b -call :install || exit /b -call :showpath || exit /b +echo Installing to %INSTALLDIR% +rmdir /s /q "%INSTALLDIR%" >nul 2>&1 +xcopy /E /I /Y "%ROOTDIR%\install" "%INSTALLDIR%" >nul +echo. +echo Now add %INSTALLDIR%\bin to your path, for example with the command: +echo PATH %INSTALLDIR%\bin;%%PATH%% +echo. +goto :eof + + + +:uninstall +whoami /groups | find "12288" >nul +if errorlevel 1 ( +echo make uninstall - administrator rights required. Please run under an administrator command prompt. +goto :eof +) +echo Uninstalling %INSTALLDIR% +rmdir /s /q "%INSTALLDIR%" >nul 2>&1 goto :eof @@ -101,37 +160,38 @@ echo. echo.make assemble - compiling Oberon compiler c source:: echo. VERSION: %VERSION% echo. Target characeristics: -echo. PLATFORM: %PLATFORM% -echo. OS: %OS% -echo. BUILDDIR: %BUILDDIR% +echo. PLATFORM: %PLATFORM% +echo. OS: %OS% +echo. BUILDDIR: %BUILDDIR% +echo. INSTALLDIR: %INSTALLDIR% echo. Oberon characteristics: -echo. MODEL: %MODEL% -echo. ADRSIZE: %ADRSIZE% -echo. ALIGNMENT: %ALIGNMENT% +echo. MODEL: %MODEL% +echo. ADRSIZE: %ADRSIZE% +echo. ALIGNMENT: %ALIGNMENT% echo. C compiler: -echo. COMPILER: %COMPILER% -echo. COMPILE: %COMPILE% -echo. DATAMODEL: %DATAMODEL% +echo. COMPILER: %COMPILER% +echo. COMPILE: %COMPILE% +echo. DATAMODEL: %DATAMODEL% cd %BUILDDIR% cl -nologo /Zi -c SYSTEM.c Configuration.c Platform.c Heap.c || exit /b cl -nologo /Zi -c Out.c Strings.c Modules.c Files.c || exit /b -cl -nologo /Zi -c Reals.c Texts.c vt100.c errors.c || exit /b +cl -nologo /Zi -c Reals.c Texts.c VT100.c || exit /b cl -nologo /Zi -c OPM.c extTools.c OPS.c OPT.c || exit /b cl -nologo /Zi -c OPC.c OPV.c OPB.c OPP.c || exit /b cl -nologo /Zi Compiler.c /Fe%ROOTDIR%\%OBECOMP% /link /INCREMENTAL:NO ^ -SYSTEM.obj Configuration.obj Platform.obj Heap.obj ^ -Out.obj Strings.obj Modules.obj Files.obj ^ -Reals.obj Texts.obj VT100.obj errors.obj ^ -OPM.obj extTools.obj OPS.obj OPT.obj ^ -OPC.obj OPV.obj OPB.obj OPP.obj || exit /b +SYSTEM.obj Configuration.obj Platform.obj Heap.obj Out.obj Strings.obj ^ +Modules.obj Files.obj Reals.obj Texts.obj VT100.obj extTools.obj ^ +OPM.obj OPS.obj OPT.obj OPC.obj OPV.obj OPB.obj OPP.obj || exit /b +cd %ROOTDIR% copy src\runtime\*.c %BUILDDIR% >nul copy src\runtime\*.h %BUILDDIR% >nul +copy src\runtime\*.Txt %BUILDDIR% >nul +copy src\runtime\*.Txt %ROOTDIR% >nul echo.%OBECOMP% created. -cd %ROOTDIR% goto :eof @@ -176,7 +236,6 @@ del *.sym >nul 2>nul %ROOTDIR%\%OBECOMP% -SsfF -A%ADRSIZE%%ALIGNMENT% -O%MODEL% ../../src/runtime/Reals.Mod || exit /b %ROOTDIR%\%OBECOMP% -SsfF -A%ADRSIZE%%ALIGNMENT% -O%MODEL% ../../src/runtime/Texts.Mod || exit /b %ROOTDIR%\%OBECOMP% -SsfF -A%ADRSIZE%%ALIGNMENT% -O%MODEL% ../../src/runtime/VT100.Mod || exit /b -%ROOTDIR%\%OBECOMP% -SsfF -A%ADRSIZE%%ALIGNMENT% -O%MODEL% ../../src/compiler/errors.Mod || exit /b %ROOTDIR%\%OBECOMP% -SsfF -A%ADRSIZE%%ALIGNMENT% -O%MODEL% ../../src/compiler/OPM.Mod || exit /b %ROOTDIR%\%OBECOMP% -SsfF -A%ADRSIZE%%ALIGNMENT% -O%MODEL% ../../src/compiler/extTools.Mod || exit /b %ROOTDIR%\%OBECOMP% -SsfFx -A%ADRSIZE%%ALIGNMENT% -O%MODEL% ../../src/compiler/OPS.Mod || exit /b @@ -186,7 +245,12 @@ del *.sym >nul 2>nul %ROOTDIR%\%OBECOMP% -SsfF -A%ADRSIZE%%ALIGNMENT% -O%MODEL% ../../src/compiler/OPB.Mod || exit /b %ROOTDIR%\%OBECOMP% -SsfF -A%ADRSIZE%%ALIGNMENT% -O%MODEL% ../../src/compiler/OPP.Mod || exit /b %ROOTDIR%\%OBECOMP% -Ssfm -A%ADRSIZE%%ALIGNMENT% -O%MODEL% ../../src/compiler/Compiler.Mod || exit /b + cd %ROOTDIR% +copy src\runtime\*.c %BUILDDIR% >nul +copy src\runtime\*.h %BUILDDIR% >nul +copy src\runtime\*.Txt %BUILDDIR% >nul + echo.%BUILDDIR% filled with compiler C source. goto :eof @@ -197,10 +261,11 @@ goto :eof echo. echo.Making symbol browser cd %BUILDDIR% +%ROOTDIR%/%OBECOMP% -fSs ../../src/runtime/Oberon.Mod %ROOTDIR%/%OBECOMP% -fSm ../../src/tools/browser/BrowserCmd.Mod -cl -nologo BrowserCmd.c /Feshowdef.exe ^ +cl -nologo BrowserCmd.c Oberon.c /Feshowdef.exe ^ Platform.obj Texts.obj OPT.obj Heap.obj Out.obj SYSTEM.obj OPM.obj OPS.obj OPV.obj ^ - Files.obj Reals.obj Modules.obj VT100.obj errors.obj Configuration.obj Strings.obj ^ + Files.obj Reals.obj Modules.obj VT100.obj Configuration.obj Strings.obj ^ OPC.obj cd %ROOTDIR% goto :eof @@ -208,55 +273,6 @@ goto :eof -:install -whoami /groups | find "12288" >nul -if errorlevel 1 ( -echo make install - administrator rights required. Please run under an administrator command prompt. -goto :eof -) -rmdir /s /q "%INSTALLDIR%" >nul 2>&1 -mkdir "%INSTALLDIR%" >nul 2>&1 - -mkdir "%INSTALLDIR%\bin" >nul 2>&1 -copy %OBECOMP% "%INSTALLDIR%\bin" >nul -copy %BUILDDIR%\showdef.exe "%INSTALLDIR%\bin" >nul - -mkdir "%INSTALLDIR%\2" >nul 2>&1 -mkdir "%INSTALLDIR%\2\include" >nul 2>&1 -mkdir "%INSTALLDIR%\2\sym" >nul 2>&1 -copy %BUILDDIR%\2\*.h "%INSTALLDIR%\2\include" >nul -copy %BUILDDIR%\2\*.sym "%INSTALLDIR%\2\sym" >nul - -mkdir "%INSTALLDIR%\C" >nul 2>&1 -mkdir "%INSTALLDIR%\C\include" >nul 2>&1 -mkdir "%INSTALLDIR%\C\sym" >nul 2>&1 -copy %BUILDDIR%\C\*.h "%INSTALLDIR%\C\include" >nul -copy %BUILDDIR%\C\*.sym "%INSTALLDIR%\C\sym" >nul - -mkdir "%INSTALLDIR%\lib" >nul 2>&1 -copy %BUILDDIR%\2\lib%ONAME%* "%INSTALLDIR%\lib" >nul -copy %BUILDDIR%\C\lib%ONAME%* "%INSTALLDIR%\lib" >nul -goto :eof - - -:uninstall -whoami /groups | find "12288" >nul -if errorlevel 1 ( -echo make uninstall - administrator rights required. Please run under an administrator command prompt. -goto :eof -) -rmdir /s /q "%INSTALLDIR%" >nul 2>&1 -goto :eof - - -:showpath -echo. -echo Now add %INSTALLDIR%\bin to your path, for example with the command: -echo PATH %INSTALLDIR%\bin;%%PATH%% -echo. -goto :eof - - :runtime echo. echo.Making runtime library for -O%MODEL% @@ -346,6 +362,7 @@ goto :eof :ulm echo.Making ulm library for -O%MODEL% cd %BUILDDIR%\%MODEL% +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmTypes.Mod || exit /b %ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmObjects.Mod || exit /b %ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmPriorities.Mod || exit /b %ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmDisciplines.Mod || exit /b @@ -357,7 +374,6 @@ cd %BUILDDIR%\%MODEL% %ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmResources.Mod || exit /b %ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmForwarders.Mod || exit /b %ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmRelatedEvents.Mod || exit /b -%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmTypes.Mod || exit /b %ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmStreams.Mod || exit /b %ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmStrings.Mod || exit /b %ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmSysTypes.Mod || exit /b diff --git a/src/compiler/extTools.Mod b/src/compiler/extTools.Mod index 10163ced..98c9fa71 100644 --- a/src/compiler/extTools.Mod +++ b/src/compiler/extTools.Mod @@ -1,19 +1,34 @@ MODULE extTools; -IMPORT Strings, Out, Configuration, Platform, Modules, OPM; +IMPORT Strings, Out, Configuration, Platform, Modules, Heap, OPM; -VAR CFLAGS: ARRAY 1023 OF CHAR; +TYPE CommandString = ARRAY 4096 OF CHAR; + +VAR CFLAGS: CommandString; PROCEDURE execute(title: ARRAY OF CHAR; cmd: ARRAY OF CHAR); - VAR r, status, exitcode: INTEGER; + VAR r, status, exitcode: INTEGER; fullcmd: CommandString; BEGIN IF OPM.verbose IN OPM.Options THEN - Out.String(title); Out.String(cmd); Out.Ln + Out.String(" "); Out.String(fullcmd); Out.Ln END; - r := Platform.System(cmd); - status := r MOD 128; - exitcode := r DIV 256; + + (* Hack to suppress unwanted filename display by Microsoft C compiler on successful compilations. *) + IF Configuration.compiler = "MSC" THEN + fullcmd := "cmd /c "; + Strings.Append(cmd, fullcmd); + Strings.Append(" >msc-listing || type msc-listing", fullcmd) + ELSE + COPY(cmd, fullcmd); + END; + + (* Get GC to run file finalizers closing generated C files as otherwise Microsoft C cannot open them. *) + Heap.GC(FALSE); + + r := Platform.System(fullcmd); + + status := r MOD 128; exitcode := r DIV 256; IF exitcode > 127 THEN exitcode := exitcode - 256 END; (* Handle signed exit code *) IF r # 0 THEN @@ -43,7 +58,7 @@ END InitialiseCompilerCommand; PROCEDURE Assemble*(moduleName: ARRAY OF CHAR); VAR - cmd: ARRAY 1023 OF CHAR; + cmd: CommandString; BEGIN InitialiseCompilerCommand(cmd); Strings.Append("-c ", cmd); @@ -55,7 +70,7 @@ PROCEDURE Assemble*(moduleName: ARRAY OF CHAR); PROCEDURE LinkMain*(VAR moduleName: ARRAY OF CHAR; statically: BOOLEAN; additionalopts: ARRAY OF CHAR); VAR - cmd: ARRAY 1023 OF CHAR; + cmd: CommandString; BEGIN InitialiseCompilerCommand(cmd); Strings.Append(moduleName, cmd); diff --git a/src/test/confidence/lola/test.sh b/src/test/confidence/lola/test.sh index 315d6d8e..3571e536 100755 --- a/src/test/confidence/lola/test.sh +++ b/src/test/confidence/lola/test.sh @@ -1,5 +1,9 @@ #!/bin/sh . ../testenv.sh -$OBECOMP LSS.Mod LSB.Mod LSC.Mod LSV.Mod lola.Mod -m +$OBECOMP LSS.Mod +$OBECOMP LSB.Mod +$OBECOMP LSC.Mod +$OBECOMP LSV.Mod +$OBECOMP lola.Mod -m ./Lola RISC5.Lola result . ../testresult.sh diff --git a/src/test/confidence/testenv.sh b/src/test/confidence/testenv.sh index de1630fa..fee87667 100755 --- a/src/test/confidence/testenv.sh +++ b/src/test/confidence/testenv.sh @@ -14,12 +14,7 @@ export LD_LIBRARY_PATH=$1/lib:$LD_LIBRARY_PATH rm -f *.o *.obj *.exe *.sym *.c *.h result new.asm $(basename $PWD) # Under gcc generate assembly source for source change test. -# NOTE: The following CFLAGS causes the assembler to write source -# to a single file. When there are multiple Mod files, each -# corresponding assembly file will overwrite the previous. I -# cannot see any way to overcome this short of using -S -# on the voc command and calling 'as' explicitly. -# NOTE 2: The cygwin 64 bit build has relocation errors with +# NOTE: The cygwin 64 bit build has relocation errors with # these assembly generation options. if [ "$COMPILER" = "gcc" -a "$FLAVOUR" != "cygwin.LP64.gcc" ] then export CFLAGS="-gstabs -g1 -Wa,-acdhln=new.asm -Wl,-Map=output.map" diff --git a/src/tools/make/configure.c b/src/tools/make/configure.c index 458bddec..8ed9eeee 100644 --- a/src/tools/make/configure.c +++ b/src/tools/make/configure.c @@ -413,6 +413,7 @@ void writeConfigurationMod() { fprintf(fd, " linkflags* = '%s';\n", linkflags); fprintf(fd, " libspec* = '%s';\n", libspec); fprintf(fd, " libext* = '%s';\n", libext); + fprintf(fd, " compiler* = '%s';\n", compiler); fprintf(fd, " compile* = '%s';\n", cc); fprintf(fd, " installdir* = '%s';\n", installdir); fprintf(fd, " staticLink* = '%s';\n", staticlink); From ee197d741abeaafee34f2575c1d063d54a077181 Mon Sep 17 00:00:00 2001 From: David Brown Date: Wed, 21 Dec 2016 13:02:11 +0000 Subject: [PATCH 448/580] Update C bootstrap source. --- bootstrap/unix-44/Compiler.c | 2 +- bootstrap/unix-44/Configuration.c | 6 +-- bootstrap/unix-44/Configuration.h | 4 +- bootstrap/unix-44/Files.c | 2 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 2 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 4 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 4 +- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 2 +- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 2 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Out.c | 2 +- bootstrap/unix-44/Out.h | 2 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/VT100.c | 2 +- bootstrap/unix-44/VT100.h | 2 +- bootstrap/unix-44/extTools.c | 66 ++++++++++++++++------------ bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-48/Compiler.c | 2 +- bootstrap/unix-48/Configuration.c | 6 +-- bootstrap/unix-48/Configuration.h | 4 +- bootstrap/unix-48/Files.c | 2 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 2 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 4 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 4 +- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 2 +- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 2 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Out.c | 2 +- bootstrap/unix-48/Out.h | 2 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/VT100.c | 2 +- bootstrap/unix-48/VT100.h | 2 +- bootstrap/unix-48/extTools.c | 66 ++++++++++++++++------------ bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-88/Compiler.c | 2 +- bootstrap/unix-88/Configuration.c | 6 +-- bootstrap/unix-88/Configuration.h | 4 +- bootstrap/unix-88/Files.c | 2 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 2 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 4 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 4 +- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 2 +- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 2 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Out.c | 2 +- bootstrap/unix-88/Out.h | 2 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/VT100.c | 2 +- bootstrap/unix-88/VT100.h | 2 +- bootstrap/unix-88/extTools.c | 66 ++++++++++++++++------------ bootstrap/unix-88/extTools.h | 2 +- bootstrap/windows-48/Compiler.c | 2 +- bootstrap/windows-48/Configuration.c | 6 +-- bootstrap/windows-48/Configuration.h | 4 +- bootstrap/windows-48/Files.c | 2 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 2 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 4 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 4 +- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 2 +- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 2 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Out.c | 2 +- bootstrap/windows-48/Out.h | 2 +- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/VT100.c | 2 +- bootstrap/windows-48/VT100.h | 2 +- bootstrap/windows-48/extTools.c | 66 ++++++++++++++++------------ bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-88/Compiler.c | 2 +- bootstrap/windows-88/Configuration.c | 6 +-- bootstrap/windows-88/Configuration.h | 4 +- bootstrap/windows-88/Files.c | 2 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 2 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 4 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 4 +- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 2 +- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 2 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Out.c | 2 +- bootstrap/windows-88/Out.h | 2 +- bootstrap/windows-88/Platform.c | 2 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/VT100.c | 2 +- bootstrap/windows-88/VT100.h | 2 +- bootstrap/windows-88/extTools.c | 66 ++++++++++++++++------------ bootstrap/windows-88/extTools.h | 2 +- 185 files changed, 390 insertions(+), 350 deletions(-) diff --git a/bootstrap/unix-44/Compiler.c b/bootstrap/unix-44/Compiler.c index 993c2bac..d81a9a43 100644 --- a/bootstrap/unix-44/Compiler.c +++ b/bootstrap/unix-44/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index 80b87b1d..1e31b260 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -8,7 +8,7 @@ #include "SYSTEM.h" -export CHAR Configuration_versionLong[75]; +export CHAR Configuration_versionLong[76]; @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index cdc285e5..daf3ac70 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h @@ -6,7 +6,7 @@ #include "SYSTEM.h" -import CHAR Configuration_versionLong[75]; +import CHAR Configuration_versionLong[76]; import void *Configuration__init(void); diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index cd6f14b9..50902bd8 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index 62563e24..25669e5f 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index c12cb722..129be081 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index de4d17ce..c019c8f0 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index f397649b..8e2f0126 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index 8436f089..8771bb17 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index 19e40505..47de29e6 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index 71d82def..e546e68f 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index a5f41a8e..062bc79b 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -1138,7 +1138,7 @@ static void OPC_GenHeaderMsg (void) OPM_WriteString((CHAR*)"/* ", 4); OPM_WriteString((CHAR*)"voc", 4); OPM_Write(' '); - OPM_WriteString(Configuration_versionLong, 75); + OPM_WriteString(Configuration_versionLong, 76); OPM_Write(' '); i = 0; while (i <= 31) { diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index 38a2b01d..bc980a30 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 8f903e46..7b8be0fd 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -272,7 +272,7 @@ BOOLEAN OPM_OpenPar (void) if (Modules_ArgCount == 1) { OPM_LogWLn(); OPM_LogWStr((CHAR*)"Oberon-2 compiler v", 20); - OPM_LogWStr(Configuration_versionLong, 75); + OPM_LogWStr(Configuration_versionLong, 76); OPM_LogW('.'); OPM_LogWLn(); OPM_LogWStr((CHAR*)"Based on Ofront by J. Templ and Software Templ OEG.", 52); diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index 96318bea..1a2a6e4e 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index ec4ad2be..b636f79f 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index aa076aaa..eca79f7f 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index bf9f1af5..fd0e7bba 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index 09a33705..6596c0d4 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index 149bfd1b..475e0bb8 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index 63bf2070..ef7dd6a8 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index 8b095ff5..0c366e14 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index c6a107b6..46b04b0d 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Out.c b/bootstrap/unix-44/Out.c index 23d917c7..a104f570 100644 --- a/bootstrap/unix-44/Out.c +++ b/bootstrap/unix-44/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Out.h b/bootstrap/unix-44/Out.h index e1285046..cc5af1e0 100644 --- a/bootstrap/unix-44/Out.h +++ b/bootstrap/unix-44/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index fa5fada1..777ef8f2 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index 0b98d7bb..0f3d5642 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index d1eb72f6..1cc18e85 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index 170d1785..fc275a0e 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index 225bd40a..90f9337c 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index 4d98f1a3..e63580fb 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index a6913b51..484e698e 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index bad71689..ab086221 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/VT100.c b/bootstrap/unix-44/VT100.c index 9cd5cf4d..e16da294 100644 --- a/bootstrap/unix-44/VT100.c +++ b/bootstrap/unix-44/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/VT100.h b/bootstrap/unix-44/VT100.h index 8f60c652..fcee0af8 100644 --- a/bootstrap/unix-44/VT100.h +++ b/bootstrap/unix-44/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index fa840303..793e9025 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -7,14 +7,18 @@ #include "SYSTEM.h" #include "Configuration.h" +#include "Heap.h" #include "Modules.h" #include "OPM.h" #include "Out.h" #include "Platform.h" #include "Strings.h" +typedef + CHAR extTools_CommandString[4096]; -static CHAR extTools_CFLAGS[1023]; + +static extTools_CommandString extTools_CFLAGS; export void extTools_Assemble (CHAR *moduleName, ADDRESS moduleName__len); @@ -26,14 +30,17 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRESS cmd__len) { INT16 r, status, exitcode; + extTools_CommandString fullcmd; __DUP(title, title__len, CHAR); __DUP(cmd, cmd__len, CHAR); if (__IN(18, OPM_Options, 32)) { - Out_String(title, title__len); - Out_String(cmd, cmd__len); + Out_String((CHAR*)" ", 3); + Out_String(fullcmd, 4096); Out_Ln(); } - r = Platform_System(cmd, cmd__len); + __COPY(cmd, fullcmd, 4096); + Heap_GC(0); + r = Platform_System(fullcmd, 4096); status = __MASK(r, -128); exitcode = __ASHR(r, 8); if (exitcode > 127) { @@ -69,44 +76,44 @@ static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); - Platform_GetEnv((CHAR*)"CFLAGS", 7, (void*)extTools_CFLAGS, 1023); - Strings_Append(extTools_CFLAGS, 1023, (void*)s, s__len); + Platform_GetEnv((CHAR*)"CFLAGS", 7, (void*)extTools_CFLAGS, 4096); + Strings_Append(extTools_CFLAGS, 4096, (void*)s, s__len); Strings_Append((CHAR*)" ", 2, (void*)s, s__len); } void extTools_Assemble (CHAR *moduleName, ADDRESS moduleName__len) { - CHAR cmd[1023]; + extTools_CommandString cmd; __DUP(moduleName, moduleName__len, CHAR); - extTools_InitialiseCompilerCommand((void*)cmd, 1023); - Strings_Append((CHAR*)"-c ", 4, (void*)cmd, 1023); - Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); - Strings_Append((CHAR*)".c", 3, (void*)cmd, 1023); - extTools_execute((CHAR*)"C compile: ", 12, cmd, 1023); + extTools_InitialiseCompilerCommand((void*)cmd, 4096); + Strings_Append((CHAR*)"-c ", 4, (void*)cmd, 4096); + Strings_Append(moduleName, moduleName__len, (void*)cmd, 4096); + Strings_Append((CHAR*)".c", 3, (void*)cmd, 4096); + extTools_execute((CHAR*)"C compile: ", 12, cmd, 4096); __DEL(moduleName); } void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN statically, CHAR *additionalopts, ADDRESS additionalopts__len) { - CHAR cmd[1023]; + extTools_CommandString cmd; __DUP(additionalopts, additionalopts__len, CHAR); - extTools_InitialiseCompilerCommand((void*)cmd, 1023); - Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); - Strings_Append((CHAR*)".c ", 4, (void*)cmd, 1023); - Strings_Append(additionalopts, additionalopts__len, (void*)cmd, 1023); + extTools_InitialiseCompilerCommand((void*)cmd, 4096); + Strings_Append(moduleName, moduleName__len, (void*)cmd, 4096); + Strings_Append((CHAR*)".c ", 4, (void*)cmd, 4096); + Strings_Append(additionalopts, additionalopts__len, (void*)cmd, 4096); if (statically) { - Strings_Append((CHAR*)" -static", 9, (void*)cmd, 1023); + Strings_Append((CHAR*)" -static", 9, (void*)cmd, 4096); } - Strings_Append((CHAR*)" -o ", 5, (void*)cmd, 1023); - Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); - Strings_Append((CHAR*)" -L\"", 5, (void*)cmd, 1023); - Strings_Append(OPM_InstallDir, 1024, (void*)cmd, 1023); - Strings_Append((CHAR*)"/lib\"", 6, (void*)cmd, 1023); - Strings_Append((CHAR*)" -l voc", 8, (void*)cmd, 1023); - Strings_Append((CHAR*)"-O", 3, (void*)cmd, 1023); - Strings_Append(OPM_Model, 10, (void*)cmd, 1023); - Strings_Append((CHAR*)"", 1, (void*)cmd, 1023); - extTools_execute((CHAR*)"C compile and link: ", 21, cmd, 1023); + Strings_Append((CHAR*)" -o ", 5, (void*)cmd, 4096); + Strings_Append(moduleName, moduleName__len, (void*)cmd, 4096); + Strings_Append((CHAR*)" -L\"", 5, (void*)cmd, 4096); + Strings_Append(OPM_InstallDir, 1024, (void*)cmd, 4096); + Strings_Append((CHAR*)"/lib\"", 6, (void*)cmd, 4096); + Strings_Append((CHAR*)" -l voc", 8, (void*)cmd, 4096); + Strings_Append((CHAR*)"-O", 3, (void*)cmd, 4096); + Strings_Append(OPM_Model, 10, (void*)cmd, 4096); + Strings_Append((CHAR*)"", 1, (void*)cmd, 4096); + extTools_execute((CHAR*)"C compile and link: ", 21, cmd, 4096); __DEL(additionalopts); } @@ -115,6 +122,7 @@ export void *extTools__init(void) { __DEFMOD; __MODULE_IMPORT(Configuration); + __MODULE_IMPORT(Heap); __MODULE_IMPORT(Modules); __MODULE_IMPORT(OPM); __MODULE_IMPORT(Out); diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index a93b6c85..e1375387 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/Compiler.c b/bootstrap/unix-48/Compiler.c index 993c2bac..d81a9a43 100644 --- a/bootstrap/unix-48/Compiler.c +++ b/bootstrap/unix-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index 80b87b1d..1e31b260 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -8,7 +8,7 @@ #include "SYSTEM.h" -export CHAR Configuration_versionLong[75]; +export CHAR Configuration_versionLong[76]; @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index cdc285e5..daf3ac70 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h @@ -6,7 +6,7 @@ #include "SYSTEM.h" -import CHAR Configuration_versionLong[75]; +import CHAR Configuration_versionLong[76]; import void *Configuration__init(void); diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index cd6f14b9..50902bd8 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index 62563e24..25669e5f 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index c12cb722..129be081 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index de4d17ce..c019c8f0 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index f397649b..8e2f0126 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index 8436f089..8771bb17 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index 19e40505..47de29e6 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index 71d82def..e546e68f 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index a5f41a8e..062bc79b 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -1138,7 +1138,7 @@ static void OPC_GenHeaderMsg (void) OPM_WriteString((CHAR*)"/* ", 4); OPM_WriteString((CHAR*)"voc", 4); OPM_Write(' '); - OPM_WriteString(Configuration_versionLong, 75); + OPM_WriteString(Configuration_versionLong, 76); OPM_Write(' '); i = 0; while (i <= 31) { diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index 38a2b01d..bc980a30 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 8f903e46..7b8be0fd 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -272,7 +272,7 @@ BOOLEAN OPM_OpenPar (void) if (Modules_ArgCount == 1) { OPM_LogWLn(); OPM_LogWStr((CHAR*)"Oberon-2 compiler v", 20); - OPM_LogWStr(Configuration_versionLong, 75); + OPM_LogWStr(Configuration_versionLong, 76); OPM_LogW('.'); OPM_LogWLn(); OPM_LogWStr((CHAR*)"Based on Ofront by J. Templ and Software Templ OEG.", 52); diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index 96318bea..1a2a6e4e 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index ec4ad2be..b636f79f 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index aa076aaa..eca79f7f 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index bf9f1af5..fd0e7bba 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index 09a33705..6596c0d4 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 0002aa51..9b550db2 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index 63bf2070..ef7dd6a8 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index 8b095ff5..0c366e14 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index c6a107b6..46b04b0d 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Out.c b/bootstrap/unix-48/Out.c index 23d917c7..a104f570 100644 --- a/bootstrap/unix-48/Out.c +++ b/bootstrap/unix-48/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Out.h b/bootstrap/unix-48/Out.h index e1285046..cc5af1e0 100644 --- a/bootstrap/unix-48/Out.h +++ b/bootstrap/unix-48/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index fa5fada1..777ef8f2 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index 0b98d7bb..0f3d5642 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index d1eb72f6..1cc18e85 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index 170d1785..fc275a0e 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index 225bd40a..90f9337c 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index 4d98f1a3..e63580fb 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index 08ee5129..e9b54970 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index 5d3316e2..a89d3713 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/VT100.c b/bootstrap/unix-48/VT100.c index 9cd5cf4d..e16da294 100644 --- a/bootstrap/unix-48/VT100.c +++ b/bootstrap/unix-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/VT100.h b/bootstrap/unix-48/VT100.h index 8f60c652..fcee0af8 100644 --- a/bootstrap/unix-48/VT100.h +++ b/bootstrap/unix-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index fa840303..793e9025 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -7,14 +7,18 @@ #include "SYSTEM.h" #include "Configuration.h" +#include "Heap.h" #include "Modules.h" #include "OPM.h" #include "Out.h" #include "Platform.h" #include "Strings.h" +typedef + CHAR extTools_CommandString[4096]; -static CHAR extTools_CFLAGS[1023]; + +static extTools_CommandString extTools_CFLAGS; export void extTools_Assemble (CHAR *moduleName, ADDRESS moduleName__len); @@ -26,14 +30,17 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRESS cmd__len) { INT16 r, status, exitcode; + extTools_CommandString fullcmd; __DUP(title, title__len, CHAR); __DUP(cmd, cmd__len, CHAR); if (__IN(18, OPM_Options, 32)) { - Out_String(title, title__len); - Out_String(cmd, cmd__len); + Out_String((CHAR*)" ", 3); + Out_String(fullcmd, 4096); Out_Ln(); } - r = Platform_System(cmd, cmd__len); + __COPY(cmd, fullcmd, 4096); + Heap_GC(0); + r = Platform_System(fullcmd, 4096); status = __MASK(r, -128); exitcode = __ASHR(r, 8); if (exitcode > 127) { @@ -69,44 +76,44 @@ static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); - Platform_GetEnv((CHAR*)"CFLAGS", 7, (void*)extTools_CFLAGS, 1023); - Strings_Append(extTools_CFLAGS, 1023, (void*)s, s__len); + Platform_GetEnv((CHAR*)"CFLAGS", 7, (void*)extTools_CFLAGS, 4096); + Strings_Append(extTools_CFLAGS, 4096, (void*)s, s__len); Strings_Append((CHAR*)" ", 2, (void*)s, s__len); } void extTools_Assemble (CHAR *moduleName, ADDRESS moduleName__len) { - CHAR cmd[1023]; + extTools_CommandString cmd; __DUP(moduleName, moduleName__len, CHAR); - extTools_InitialiseCompilerCommand((void*)cmd, 1023); - Strings_Append((CHAR*)"-c ", 4, (void*)cmd, 1023); - Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); - Strings_Append((CHAR*)".c", 3, (void*)cmd, 1023); - extTools_execute((CHAR*)"C compile: ", 12, cmd, 1023); + extTools_InitialiseCompilerCommand((void*)cmd, 4096); + Strings_Append((CHAR*)"-c ", 4, (void*)cmd, 4096); + Strings_Append(moduleName, moduleName__len, (void*)cmd, 4096); + Strings_Append((CHAR*)".c", 3, (void*)cmd, 4096); + extTools_execute((CHAR*)"C compile: ", 12, cmd, 4096); __DEL(moduleName); } void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN statically, CHAR *additionalopts, ADDRESS additionalopts__len) { - CHAR cmd[1023]; + extTools_CommandString cmd; __DUP(additionalopts, additionalopts__len, CHAR); - extTools_InitialiseCompilerCommand((void*)cmd, 1023); - Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); - Strings_Append((CHAR*)".c ", 4, (void*)cmd, 1023); - Strings_Append(additionalopts, additionalopts__len, (void*)cmd, 1023); + extTools_InitialiseCompilerCommand((void*)cmd, 4096); + Strings_Append(moduleName, moduleName__len, (void*)cmd, 4096); + Strings_Append((CHAR*)".c ", 4, (void*)cmd, 4096); + Strings_Append(additionalopts, additionalopts__len, (void*)cmd, 4096); if (statically) { - Strings_Append((CHAR*)" -static", 9, (void*)cmd, 1023); + Strings_Append((CHAR*)" -static", 9, (void*)cmd, 4096); } - Strings_Append((CHAR*)" -o ", 5, (void*)cmd, 1023); - Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); - Strings_Append((CHAR*)" -L\"", 5, (void*)cmd, 1023); - Strings_Append(OPM_InstallDir, 1024, (void*)cmd, 1023); - Strings_Append((CHAR*)"/lib\"", 6, (void*)cmd, 1023); - Strings_Append((CHAR*)" -l voc", 8, (void*)cmd, 1023); - Strings_Append((CHAR*)"-O", 3, (void*)cmd, 1023); - Strings_Append(OPM_Model, 10, (void*)cmd, 1023); - Strings_Append((CHAR*)"", 1, (void*)cmd, 1023); - extTools_execute((CHAR*)"C compile and link: ", 21, cmd, 1023); + Strings_Append((CHAR*)" -o ", 5, (void*)cmd, 4096); + Strings_Append(moduleName, moduleName__len, (void*)cmd, 4096); + Strings_Append((CHAR*)" -L\"", 5, (void*)cmd, 4096); + Strings_Append(OPM_InstallDir, 1024, (void*)cmd, 4096); + Strings_Append((CHAR*)"/lib\"", 6, (void*)cmd, 4096); + Strings_Append((CHAR*)" -l voc", 8, (void*)cmd, 4096); + Strings_Append((CHAR*)"-O", 3, (void*)cmd, 4096); + Strings_Append(OPM_Model, 10, (void*)cmd, 4096); + Strings_Append((CHAR*)"", 1, (void*)cmd, 4096); + extTools_execute((CHAR*)"C compile and link: ", 21, cmd, 4096); __DEL(additionalopts); } @@ -115,6 +122,7 @@ export void *extTools__init(void) { __DEFMOD; __MODULE_IMPORT(Configuration); + __MODULE_IMPORT(Heap); __MODULE_IMPORT(Modules); __MODULE_IMPORT(OPM); __MODULE_IMPORT(Out); diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index a93b6c85..e1375387 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/Compiler.c b/bootstrap/unix-88/Compiler.c index 993c2bac..d81a9a43 100644 --- a/bootstrap/unix-88/Compiler.c +++ b/bootstrap/unix-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index 80b87b1d..1e31b260 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -8,7 +8,7 @@ #include "SYSTEM.h" -export CHAR Configuration_versionLong[75]; +export CHAR Configuration_versionLong[76]; @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index cdc285e5..daf3ac70 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h @@ -6,7 +6,7 @@ #include "SYSTEM.h" -import CHAR Configuration_versionLong[75]; +import CHAR Configuration_versionLong[76]; import void *Configuration__init(void); diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index d4425bbe..91ef8f3a 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index a34a1758..de24ffaf 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index aeebff17..d5a4f08e 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index ff1a1b07..4512d96e 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index c66fe5bd..186ab951 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index 5e518753..00cdc69f 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index 19e40505..47de29e6 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index 71d82def..e546e68f 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index a5f41a8e..062bc79b 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -1138,7 +1138,7 @@ static void OPC_GenHeaderMsg (void) OPM_WriteString((CHAR*)"/* ", 4); OPM_WriteString((CHAR*)"voc", 4); OPM_Write(' '); - OPM_WriteString(Configuration_versionLong, 75); + OPM_WriteString(Configuration_versionLong, 76); OPM_Write(' '); i = 0; while (i <= 31) { diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index 38a2b01d..bc980a30 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 143546fd..315fb4d2 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -272,7 +272,7 @@ BOOLEAN OPM_OpenPar (void) if (Modules_ArgCount == 1) { OPM_LogWLn(); OPM_LogWStr((CHAR*)"Oberon-2 compiler v", 20); - OPM_LogWStr(Configuration_versionLong, 75); + OPM_LogWStr(Configuration_versionLong, 76); OPM_LogW('.'); OPM_LogWLn(); OPM_LogWStr((CHAR*)"Based on Ofront by J. Templ and Software Templ OEG.", 52); diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index 96318bea..1a2a6e4e 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index 52620168..a8eff270 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index aa076aaa..eca79f7f 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index bf9f1af5..fd0e7bba 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index 09a33705..6596c0d4 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index d89ea5c8..a855a25f 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 63bf2070..ef7dd6a8 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 69e2f94e..df10c2a8 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index c6a107b6..46b04b0d 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Out.c b/bootstrap/unix-88/Out.c index 23d917c7..a104f570 100644 --- a/bootstrap/unix-88/Out.c +++ b/bootstrap/unix-88/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Out.h b/bootstrap/unix-88/Out.h index e1285046..cc5af1e0 100644 --- a/bootstrap/unix-88/Out.h +++ b/bootstrap/unix-88/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 4d25035f..affaff74 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index 76f5da00..9599e6e3 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index d1eb72f6..1cc18e85 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index 170d1785..fc275a0e 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index 225bd40a..90f9337c 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index 4d98f1a3..e63580fb 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index 565de43f..a0c55c7d 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index bdd9fada..21d2344a 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/VT100.c b/bootstrap/unix-88/VT100.c index 9cd5cf4d..e16da294 100644 --- a/bootstrap/unix-88/VT100.c +++ b/bootstrap/unix-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/VT100.h b/bootstrap/unix-88/VT100.h index 8f60c652..fcee0af8 100644 --- a/bootstrap/unix-88/VT100.h +++ b/bootstrap/unix-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index fa840303..793e9025 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -7,14 +7,18 @@ #include "SYSTEM.h" #include "Configuration.h" +#include "Heap.h" #include "Modules.h" #include "OPM.h" #include "Out.h" #include "Platform.h" #include "Strings.h" +typedef + CHAR extTools_CommandString[4096]; -static CHAR extTools_CFLAGS[1023]; + +static extTools_CommandString extTools_CFLAGS; export void extTools_Assemble (CHAR *moduleName, ADDRESS moduleName__len); @@ -26,14 +30,17 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRESS cmd__len) { INT16 r, status, exitcode; + extTools_CommandString fullcmd; __DUP(title, title__len, CHAR); __DUP(cmd, cmd__len, CHAR); if (__IN(18, OPM_Options, 32)) { - Out_String(title, title__len); - Out_String(cmd, cmd__len); + Out_String((CHAR*)" ", 3); + Out_String(fullcmd, 4096); Out_Ln(); } - r = Platform_System(cmd, cmd__len); + __COPY(cmd, fullcmd, 4096); + Heap_GC(0); + r = Platform_System(fullcmd, 4096); status = __MASK(r, -128); exitcode = __ASHR(r, 8); if (exitcode > 127) { @@ -69,44 +76,44 @@ static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); - Platform_GetEnv((CHAR*)"CFLAGS", 7, (void*)extTools_CFLAGS, 1023); - Strings_Append(extTools_CFLAGS, 1023, (void*)s, s__len); + Platform_GetEnv((CHAR*)"CFLAGS", 7, (void*)extTools_CFLAGS, 4096); + Strings_Append(extTools_CFLAGS, 4096, (void*)s, s__len); Strings_Append((CHAR*)" ", 2, (void*)s, s__len); } void extTools_Assemble (CHAR *moduleName, ADDRESS moduleName__len) { - CHAR cmd[1023]; + extTools_CommandString cmd; __DUP(moduleName, moduleName__len, CHAR); - extTools_InitialiseCompilerCommand((void*)cmd, 1023); - Strings_Append((CHAR*)"-c ", 4, (void*)cmd, 1023); - Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); - Strings_Append((CHAR*)".c", 3, (void*)cmd, 1023); - extTools_execute((CHAR*)"C compile: ", 12, cmd, 1023); + extTools_InitialiseCompilerCommand((void*)cmd, 4096); + Strings_Append((CHAR*)"-c ", 4, (void*)cmd, 4096); + Strings_Append(moduleName, moduleName__len, (void*)cmd, 4096); + Strings_Append((CHAR*)".c", 3, (void*)cmd, 4096); + extTools_execute((CHAR*)"C compile: ", 12, cmd, 4096); __DEL(moduleName); } void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN statically, CHAR *additionalopts, ADDRESS additionalopts__len) { - CHAR cmd[1023]; + extTools_CommandString cmd; __DUP(additionalopts, additionalopts__len, CHAR); - extTools_InitialiseCompilerCommand((void*)cmd, 1023); - Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); - Strings_Append((CHAR*)".c ", 4, (void*)cmd, 1023); - Strings_Append(additionalopts, additionalopts__len, (void*)cmd, 1023); + extTools_InitialiseCompilerCommand((void*)cmd, 4096); + Strings_Append(moduleName, moduleName__len, (void*)cmd, 4096); + Strings_Append((CHAR*)".c ", 4, (void*)cmd, 4096); + Strings_Append(additionalopts, additionalopts__len, (void*)cmd, 4096); if (statically) { - Strings_Append((CHAR*)" -static", 9, (void*)cmd, 1023); + Strings_Append((CHAR*)" -static", 9, (void*)cmd, 4096); } - Strings_Append((CHAR*)" -o ", 5, (void*)cmd, 1023); - Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); - Strings_Append((CHAR*)" -L\"", 5, (void*)cmd, 1023); - Strings_Append(OPM_InstallDir, 1024, (void*)cmd, 1023); - Strings_Append((CHAR*)"/lib\"", 6, (void*)cmd, 1023); - Strings_Append((CHAR*)" -l voc", 8, (void*)cmd, 1023); - Strings_Append((CHAR*)"-O", 3, (void*)cmd, 1023); - Strings_Append(OPM_Model, 10, (void*)cmd, 1023); - Strings_Append((CHAR*)"", 1, (void*)cmd, 1023); - extTools_execute((CHAR*)"C compile and link: ", 21, cmd, 1023); + Strings_Append((CHAR*)" -o ", 5, (void*)cmd, 4096); + Strings_Append(moduleName, moduleName__len, (void*)cmd, 4096); + Strings_Append((CHAR*)" -L\"", 5, (void*)cmd, 4096); + Strings_Append(OPM_InstallDir, 1024, (void*)cmd, 4096); + Strings_Append((CHAR*)"/lib\"", 6, (void*)cmd, 4096); + Strings_Append((CHAR*)" -l voc", 8, (void*)cmd, 4096); + Strings_Append((CHAR*)"-O", 3, (void*)cmd, 4096); + Strings_Append(OPM_Model, 10, (void*)cmd, 4096); + Strings_Append((CHAR*)"", 1, (void*)cmd, 4096); + extTools_execute((CHAR*)"C compile and link: ", 21, cmd, 4096); __DEL(additionalopts); } @@ -115,6 +122,7 @@ export void *extTools__init(void) { __DEFMOD; __MODULE_IMPORT(Configuration); + __MODULE_IMPORT(Heap); __MODULE_IMPORT(Modules); __MODULE_IMPORT(OPM); __MODULE_IMPORT(Out); diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index a93b6c85..e1375387 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/Compiler.c b/bootstrap/windows-48/Compiler.c index 993c2bac..d81a9a43 100644 --- a/bootstrap/windows-48/Compiler.c +++ b/bootstrap/windows-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index 80b87b1d..1e31b260 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -8,7 +8,7 @@ #include "SYSTEM.h" -export CHAR Configuration_versionLong[75]; +export CHAR Configuration_versionLong[76]; @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index cdc285e5..daf3ac70 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h @@ -6,7 +6,7 @@ #include "SYSTEM.h" -import CHAR Configuration_versionLong[75]; +import CHAR Configuration_versionLong[76]; import void *Configuration__init(void); diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 3eecd248..9aacffe0 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index 2dc667a1..24a5e667 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index c12cb722..129be081 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index de4d17ce..c019c8f0 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index b437b514..b0a58209 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index 8436f089..8771bb17 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index 19e40505..47de29e6 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index 71d82def..e546e68f 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index a5f41a8e..062bc79b 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -1138,7 +1138,7 @@ static void OPC_GenHeaderMsg (void) OPM_WriteString((CHAR*)"/* ", 4); OPM_WriteString((CHAR*)"voc", 4); OPM_Write(' '); - OPM_WriteString(Configuration_versionLong, 75); + OPM_WriteString(Configuration_versionLong, 76); OPM_Write(' '); i = 0; while (i <= 31) { diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index 38a2b01d..bc980a30 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 8f903e46..7b8be0fd 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -272,7 +272,7 @@ BOOLEAN OPM_OpenPar (void) if (Modules_ArgCount == 1) { OPM_LogWLn(); OPM_LogWStr((CHAR*)"Oberon-2 compiler v", 20); - OPM_LogWStr(Configuration_versionLong, 75); + OPM_LogWStr(Configuration_versionLong, 76); OPM_LogW('.'); OPM_LogWLn(); OPM_LogWStr((CHAR*)"Based on Ofront by J. Templ and Software Templ OEG.", 52); diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index 96318bea..1a2a6e4e 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index ec4ad2be..b636f79f 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index aa076aaa..eca79f7f 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index bf9f1af5..fd0e7bba 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index 09a33705..6596c0d4 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 0002aa51..9b550db2 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index 63bf2070..ef7dd6a8 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index 8b095ff5..0c366e14 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index c6a107b6..46b04b0d 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Out.c b/bootstrap/windows-48/Out.c index 01e91698..82df8d74 100644 --- a/bootstrap/windows-48/Out.c +++ b/bootstrap/windows-48/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Out.h b/bootstrap/windows-48/Out.h index e1285046..cc5af1e0 100644 --- a/bootstrap/windows-48/Out.h +++ b/bootstrap/windows-48/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 9d308e71..e618a17f 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index bd2a519b..96523fd2 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index d1eb72f6..1cc18e85 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index 170d1785..fc275a0e 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index 225bd40a..90f9337c 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index 4d98f1a3..e63580fb 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index 08ee5129..e9b54970 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index 5d3316e2..a89d3713 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/VT100.c b/bootstrap/windows-48/VT100.c index 9cd5cf4d..e16da294 100644 --- a/bootstrap/windows-48/VT100.c +++ b/bootstrap/windows-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/VT100.h b/bootstrap/windows-48/VT100.h index 8f60c652..fcee0af8 100644 --- a/bootstrap/windows-48/VT100.h +++ b/bootstrap/windows-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index fa840303..793e9025 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -7,14 +7,18 @@ #include "SYSTEM.h" #include "Configuration.h" +#include "Heap.h" #include "Modules.h" #include "OPM.h" #include "Out.h" #include "Platform.h" #include "Strings.h" +typedef + CHAR extTools_CommandString[4096]; -static CHAR extTools_CFLAGS[1023]; + +static extTools_CommandString extTools_CFLAGS; export void extTools_Assemble (CHAR *moduleName, ADDRESS moduleName__len); @@ -26,14 +30,17 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRESS cmd__len) { INT16 r, status, exitcode; + extTools_CommandString fullcmd; __DUP(title, title__len, CHAR); __DUP(cmd, cmd__len, CHAR); if (__IN(18, OPM_Options, 32)) { - Out_String(title, title__len); - Out_String(cmd, cmd__len); + Out_String((CHAR*)" ", 3); + Out_String(fullcmd, 4096); Out_Ln(); } - r = Platform_System(cmd, cmd__len); + __COPY(cmd, fullcmd, 4096); + Heap_GC(0); + r = Platform_System(fullcmd, 4096); status = __MASK(r, -128); exitcode = __ASHR(r, 8); if (exitcode > 127) { @@ -69,44 +76,44 @@ static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); - Platform_GetEnv((CHAR*)"CFLAGS", 7, (void*)extTools_CFLAGS, 1023); - Strings_Append(extTools_CFLAGS, 1023, (void*)s, s__len); + Platform_GetEnv((CHAR*)"CFLAGS", 7, (void*)extTools_CFLAGS, 4096); + Strings_Append(extTools_CFLAGS, 4096, (void*)s, s__len); Strings_Append((CHAR*)" ", 2, (void*)s, s__len); } void extTools_Assemble (CHAR *moduleName, ADDRESS moduleName__len) { - CHAR cmd[1023]; + extTools_CommandString cmd; __DUP(moduleName, moduleName__len, CHAR); - extTools_InitialiseCompilerCommand((void*)cmd, 1023); - Strings_Append((CHAR*)"-c ", 4, (void*)cmd, 1023); - Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); - Strings_Append((CHAR*)".c", 3, (void*)cmd, 1023); - extTools_execute((CHAR*)"C compile: ", 12, cmd, 1023); + extTools_InitialiseCompilerCommand((void*)cmd, 4096); + Strings_Append((CHAR*)"-c ", 4, (void*)cmd, 4096); + Strings_Append(moduleName, moduleName__len, (void*)cmd, 4096); + Strings_Append((CHAR*)".c", 3, (void*)cmd, 4096); + extTools_execute((CHAR*)"C compile: ", 12, cmd, 4096); __DEL(moduleName); } void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN statically, CHAR *additionalopts, ADDRESS additionalopts__len) { - CHAR cmd[1023]; + extTools_CommandString cmd; __DUP(additionalopts, additionalopts__len, CHAR); - extTools_InitialiseCompilerCommand((void*)cmd, 1023); - Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); - Strings_Append((CHAR*)".c ", 4, (void*)cmd, 1023); - Strings_Append(additionalopts, additionalopts__len, (void*)cmd, 1023); + extTools_InitialiseCompilerCommand((void*)cmd, 4096); + Strings_Append(moduleName, moduleName__len, (void*)cmd, 4096); + Strings_Append((CHAR*)".c ", 4, (void*)cmd, 4096); + Strings_Append(additionalopts, additionalopts__len, (void*)cmd, 4096); if (statically) { - Strings_Append((CHAR*)" -static", 9, (void*)cmd, 1023); + Strings_Append((CHAR*)" -static", 9, (void*)cmd, 4096); } - Strings_Append((CHAR*)" -o ", 5, (void*)cmd, 1023); - Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); - Strings_Append((CHAR*)" -L\"", 5, (void*)cmd, 1023); - Strings_Append(OPM_InstallDir, 1024, (void*)cmd, 1023); - Strings_Append((CHAR*)"/lib\"", 6, (void*)cmd, 1023); - Strings_Append((CHAR*)" -l voc", 8, (void*)cmd, 1023); - Strings_Append((CHAR*)"-O", 3, (void*)cmd, 1023); - Strings_Append(OPM_Model, 10, (void*)cmd, 1023); - Strings_Append((CHAR*)"", 1, (void*)cmd, 1023); - extTools_execute((CHAR*)"C compile and link: ", 21, cmd, 1023); + Strings_Append((CHAR*)" -o ", 5, (void*)cmd, 4096); + Strings_Append(moduleName, moduleName__len, (void*)cmd, 4096); + Strings_Append((CHAR*)" -L\"", 5, (void*)cmd, 4096); + Strings_Append(OPM_InstallDir, 1024, (void*)cmd, 4096); + Strings_Append((CHAR*)"/lib\"", 6, (void*)cmd, 4096); + Strings_Append((CHAR*)" -l voc", 8, (void*)cmd, 4096); + Strings_Append((CHAR*)"-O", 3, (void*)cmd, 4096); + Strings_Append(OPM_Model, 10, (void*)cmd, 4096); + Strings_Append((CHAR*)"", 1, (void*)cmd, 4096); + extTools_execute((CHAR*)"C compile and link: ", 21, cmd, 4096); __DEL(additionalopts); } @@ -115,6 +122,7 @@ export void *extTools__init(void) { __DEFMOD; __MODULE_IMPORT(Configuration); + __MODULE_IMPORT(Heap); __MODULE_IMPORT(Modules); __MODULE_IMPORT(OPM); __MODULE_IMPORT(Out); diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index a93b6c85..e1375387 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/Compiler.c b/bootstrap/windows-88/Compiler.c index 993c2bac..d81a9a43 100644 --- a/bootstrap/windows-88/Compiler.c +++ b/bootstrap/windows-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index 80b87b1d..1e31b260 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -8,7 +8,7 @@ #include "SYSTEM.h" -export CHAR Configuration_versionLong[75]; +export CHAR Configuration_versionLong[76]; @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index cdc285e5..daf3ac70 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h @@ -6,7 +6,7 @@ #include "SYSTEM.h" -import CHAR Configuration_versionLong[75]; +import CHAR Configuration_versionLong[76]; import void *Configuration__init(void); diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 508dc245..3d38721d 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 74f5c8ca..c21b4aee 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index aeebff17..d5a4f08e 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index ff1a1b07..4512d96e 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 62030574..016ad7b2 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index 5e518753..00cdc69f 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index 19e40505..47de29e6 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index 71d82def..e546e68f 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index a5f41a8e..062bc79b 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -1138,7 +1138,7 @@ static void OPC_GenHeaderMsg (void) OPM_WriteString((CHAR*)"/* ", 4); OPM_WriteString((CHAR*)"voc", 4); OPM_Write(' '); - OPM_WriteString(Configuration_versionLong, 75); + OPM_WriteString(Configuration_versionLong, 76); OPM_Write(' '); i = 0; while (i <= 31) { diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index 38a2b01d..bc980a30 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 143546fd..315fb4d2 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -272,7 +272,7 @@ BOOLEAN OPM_OpenPar (void) if (Modules_ArgCount == 1) { OPM_LogWLn(); OPM_LogWStr((CHAR*)"Oberon-2 compiler v", 20); - OPM_LogWStr(Configuration_versionLong, 75); + OPM_LogWStr(Configuration_versionLong, 76); OPM_LogW('.'); OPM_LogWLn(); OPM_LogWStr((CHAR*)"Based on Ofront by J. Templ and Software Templ OEG.", 52); diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index 96318bea..1a2a6e4e 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index 52620168..a8eff270 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index aa076aaa..eca79f7f 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index bf9f1af5..fd0e7bba 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index 09a33705..6596c0d4 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index d89ea5c8..a855a25f 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 63bf2070..ef7dd6a8 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 69e2f94e..df10c2a8 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index c6a107b6..46b04b0d 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Out.c b/bootstrap/windows-88/Out.c index 01e91698..82df8d74 100644 --- a/bootstrap/windows-88/Out.c +++ b/bootstrap/windows-88/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Out.h b/bootstrap/windows-88/Out.h index e1285046..cc5af1e0 100644 --- a/bootstrap/windows-88/Out.h +++ b/bootstrap/windows-88/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 1304f291..d168bcfb 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index 99405d0b..f1fff926 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index d1eb72f6..1cc18e85 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index 170d1785..fc275a0e 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index 225bd40a..90f9337c 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index 4d98f1a3..e63580fb 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index 565de43f..a0c55c7d 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index bdd9fada..21d2344a 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/VT100.c b/bootstrap/windows-88/VT100.c index 9cd5cf4d..e16da294 100644 --- a/bootstrap/windows-88/VT100.c +++ b/bootstrap/windows-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/VT100.h b/bootstrap/windows-88/VT100.h index 8f60c652..fcee0af8 100644 --- a/bootstrap/windows-88/VT100.h +++ b/bootstrap/windows-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index fa840303..793e9025 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -7,14 +7,18 @@ #include "SYSTEM.h" #include "Configuration.h" +#include "Heap.h" #include "Modules.h" #include "OPM.h" #include "Out.h" #include "Platform.h" #include "Strings.h" +typedef + CHAR extTools_CommandString[4096]; -static CHAR extTools_CFLAGS[1023]; + +static extTools_CommandString extTools_CFLAGS; export void extTools_Assemble (CHAR *moduleName, ADDRESS moduleName__len); @@ -26,14 +30,17 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRESS cmd__len) { INT16 r, status, exitcode; + extTools_CommandString fullcmd; __DUP(title, title__len, CHAR); __DUP(cmd, cmd__len, CHAR); if (__IN(18, OPM_Options, 32)) { - Out_String(title, title__len); - Out_String(cmd, cmd__len); + Out_String((CHAR*)" ", 3); + Out_String(fullcmd, 4096); Out_Ln(); } - r = Platform_System(cmd, cmd__len); + __COPY(cmd, fullcmd, 4096); + Heap_GC(0); + r = Platform_System(fullcmd, 4096); status = __MASK(r, -128); exitcode = __ASHR(r, 8); if (exitcode > 127) { @@ -69,44 +76,44 @@ static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); - Platform_GetEnv((CHAR*)"CFLAGS", 7, (void*)extTools_CFLAGS, 1023); - Strings_Append(extTools_CFLAGS, 1023, (void*)s, s__len); + Platform_GetEnv((CHAR*)"CFLAGS", 7, (void*)extTools_CFLAGS, 4096); + Strings_Append(extTools_CFLAGS, 4096, (void*)s, s__len); Strings_Append((CHAR*)" ", 2, (void*)s, s__len); } void extTools_Assemble (CHAR *moduleName, ADDRESS moduleName__len) { - CHAR cmd[1023]; + extTools_CommandString cmd; __DUP(moduleName, moduleName__len, CHAR); - extTools_InitialiseCompilerCommand((void*)cmd, 1023); - Strings_Append((CHAR*)"-c ", 4, (void*)cmd, 1023); - Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); - Strings_Append((CHAR*)".c", 3, (void*)cmd, 1023); - extTools_execute((CHAR*)"C compile: ", 12, cmd, 1023); + extTools_InitialiseCompilerCommand((void*)cmd, 4096); + Strings_Append((CHAR*)"-c ", 4, (void*)cmd, 4096); + Strings_Append(moduleName, moduleName__len, (void*)cmd, 4096); + Strings_Append((CHAR*)".c", 3, (void*)cmd, 4096); + extTools_execute((CHAR*)"C compile: ", 12, cmd, 4096); __DEL(moduleName); } void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN statically, CHAR *additionalopts, ADDRESS additionalopts__len) { - CHAR cmd[1023]; + extTools_CommandString cmd; __DUP(additionalopts, additionalopts__len, CHAR); - extTools_InitialiseCompilerCommand((void*)cmd, 1023); - Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); - Strings_Append((CHAR*)".c ", 4, (void*)cmd, 1023); - Strings_Append(additionalopts, additionalopts__len, (void*)cmd, 1023); + extTools_InitialiseCompilerCommand((void*)cmd, 4096); + Strings_Append(moduleName, moduleName__len, (void*)cmd, 4096); + Strings_Append((CHAR*)".c ", 4, (void*)cmd, 4096); + Strings_Append(additionalopts, additionalopts__len, (void*)cmd, 4096); if (statically) { - Strings_Append((CHAR*)" -static", 9, (void*)cmd, 1023); + Strings_Append((CHAR*)" -static", 9, (void*)cmd, 4096); } - Strings_Append((CHAR*)" -o ", 5, (void*)cmd, 1023); - Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); - Strings_Append((CHAR*)" -L\"", 5, (void*)cmd, 1023); - Strings_Append(OPM_InstallDir, 1024, (void*)cmd, 1023); - Strings_Append((CHAR*)"/lib\"", 6, (void*)cmd, 1023); - Strings_Append((CHAR*)" -l voc", 8, (void*)cmd, 1023); - Strings_Append((CHAR*)"-O", 3, (void*)cmd, 1023); - Strings_Append(OPM_Model, 10, (void*)cmd, 1023); - Strings_Append((CHAR*)"", 1, (void*)cmd, 1023); - extTools_execute((CHAR*)"C compile and link: ", 21, cmd, 1023); + Strings_Append((CHAR*)" -o ", 5, (void*)cmd, 4096); + Strings_Append(moduleName, moduleName__len, (void*)cmd, 4096); + Strings_Append((CHAR*)" -L\"", 5, (void*)cmd, 4096); + Strings_Append(OPM_InstallDir, 1024, (void*)cmd, 4096); + Strings_Append((CHAR*)"/lib\"", 6, (void*)cmd, 4096); + Strings_Append((CHAR*)" -l voc", 8, (void*)cmd, 4096); + Strings_Append((CHAR*)"-O", 3, (void*)cmd, 4096); + Strings_Append(OPM_Model, 10, (void*)cmd, 4096); + Strings_Append((CHAR*)"", 1, (void*)cmd, 4096); + extTools_execute((CHAR*)"C compile and link: ", 21, cmd, 4096); __DEL(additionalopts); } @@ -115,6 +122,7 @@ export void *extTools__init(void) { __DEFMOD; __MODULE_IMPORT(Configuration); + __MODULE_IMPORT(Heap); __MODULE_IMPORT(Modules); __MODULE_IMPORT(OPM); __MODULE_IMPORT(Out); diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index a93b6c85..e1375387 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h From 572587ec565ff5e8785654147349dce199cc89d6 Mon Sep 17 00:00:00 2001 From: David Brown Date: Wed, 21 Dec 2016 18:16:25 +0000 Subject: [PATCH 449/580] Add new autobuild machine vim-obs32. --- doc/Installation.md | 3 ++- src/tools/autobuild/buildall.pl | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/Installation.md b/doc/Installation.md index 37840f74..b0ab299d 100644 --- a/doc/Installation.md +++ b/doc/Installation.md @@ -54,7 +54,8 @@ Example pre-requisite installation commands: | --------- | ------------ | | Debian/Ubuntu/Mint ... | `apt-get install git` | | Fedora/RHEL/CentOS ... | `yum install git gcc glibc-static` (`dnf` instead of `yum` on recent Fedoras) | -| FreeBSD/OpenBSD/NetBSD | `pkg install git` | +| FreeBSD/NetBSD | `pkg install git` | +| OpenBSD | `pkg_add git gcc` | | OpenSUSE | `zypper install gcc git-core make glibc-devel-static` | On Mac OS (Darwin) just type the git command. OS/X will tell you that it is not installed and ask if you want to install it (say yes). Note that Darwin builds always use clang, the OS will redirect attempts to use gcc to clang. diff --git a/src/tools/autobuild/buildall.pl b/src/tools/autobuild/buildall.pl index 7e74e3b7..787ae16c 100644 --- a/src/tools/autobuild/buildall.pl +++ b/src/tools/autobuild/buildall.pl @@ -20,6 +20,7 @@ my %machines = ( "fed64" => ['22', 'dave@vim-fed64', 'sh build-oberon.sh sudo oberon/voc gcc ' . $branch], "osu64" => ['22', 'dave@vim-osu64', 'sh build-oberon.sh sudo oberon/voc gcc ' . $branch], "ob32" => ['22', 'root@nas-ob32', 'sh build-oberon.sh n vishap/voc gcc ' . $branch], + "obs32" => ['22', 'dave@vim-obs32', 'sh build-oberon.sh n vishap/voc gcc ' . $branch], "ce64" => ['5922', 'obe@www', 'sh build-oberon.sh sudo vishap/voc gcc ' . $branch], "fb64" => ['22', 'root@oberon', 'sh build-oberon.sh n vishap/voc gcc ' . $branch] ); From da14bc6398bfb2acb3846db05b842fec7ea6c352 Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 22 Dec 2016 14:35:11 +0000 Subject: [PATCH 450/580] Add Visual C x86 autobuild. --- make.cmd | 13 +++++++++++++ src/tools/autobuild/build-oberon.sh | 9 ++++++++- src/tools/autobuild/buildall.pl | 26 +++++++++++++------------- 3 files changed, 34 insertions(+), 14 deletions(-) diff --git a/make.cmd b/make.cmd index 7a42fe50..c2a817dc 100644 --- a/make.cmd +++ b/make.cmd @@ -68,9 +68,21 @@ goto :eof :full call :clean || exit /b +echo. +echo.--- Compiler build started --- +echo. call :compiler || exit /b +echo. +echo.--- Compiler build successfull --- +echo. call :browsercmd || exit /b +echo. +echo.--- Library build started --- +echo. call :library || exit /b +echo. +echo.--- Library build successfull --- +echo. call :makeinstalldir || exit /b goto :eof @@ -148,6 +160,7 @@ goto :eof :clean +echo.--- Cleaning branch ... %OS% %COMPILER% %DATAMODEL% --- rd /s /q %BUILDDIR% 2>nul del /q %OBECOMP% 2>nul goto :eof diff --git a/src/tools/autobuild/build-oberon.sh b/src/tools/autobuild/build-oberon.sh index 7dc5096a..7a7b913b 100644 --- a/src/tools/autobuild/build-oberon.sh +++ b/src/tools/autobuild/build-oberon.sh @@ -22,4 +22,11 @@ $sudo git pull # Update the local repository $sudo git checkout -f $4 # Switch to requested branch export CC=$3 -$sudo make full \ No newline at end of file + +if test "$3" = "msc-x86"; then + cmd /c 'C:\Program Files (x86)\Microsoft Visual C++ Build Tools\vcbuildtools.bat' x86 '&&' cd 'c:\cygwin\home\dave\msc-x86\voc' '&&' make full +else; if test "$3" = "msc-x64"; then + cmd /c 'C:\Program Files (x86)\Microsoft Visual C++ Build Tools\vcbuildtools.bat' x64 '&&' cd 'c:\cygwin\home\dave\msc-x64\voc' '&&' make full +else + $sudo make full +fi diff --git a/src/tools/autobuild/buildall.pl b/src/tools/autobuild/buildall.pl index 787ae16c..b0129ccb 100644 --- a/src/tools/autobuild/buildall.pl +++ b/src/tools/autobuild/buildall.pl @@ -8,21 +8,21 @@ my $branch = "master"; if (defined($ARGV[0]) && ($ARGV[0] ne "")) {$branch = $ARGV[0]} my %machines = ( - "pi" => ['22', 'pi@pie', 'sh build-oberon.sh sudo projects/oberon/vishap/voc gcc ' . $branch], - "darwin" => ['22', 'dave@dcb', 'sh build-oberon.sh sudo projects/oberon/vishap/voc clang ' . $branch], - "cygwin32" => ['5932', 'dave@wax', 'sh build-oberon.sh n oberon/cygwin/voc gcc ' . $branch], - "cygwin64" => ['5932', 'dave@wax', 'sh start64.sh \'sh build-oberon.sh n oberon/cygwin/voc gcc ' . $branch . '\''], + "pi" => ['22', 'pi@pie', 'sh build-oberon.sh sudo projects/oberon/vishap/voc gcc ' . $branch], + "darwin" => ['22', 'dave@dcb', 'sh build-oberon.sh sudo projects/oberon/vishap/voc clang ' . $branch], + "cygwin32" => ['5932', 'dave@wax', 'sh build-oberon.sh n oberon/cygwin/voc gcc ' . $branch], + "cygwin64" => ['5932', 'dave@wax', 'sh start64.sh \'sh build-oberon.sh n oberon/cygwin/voc gcc ' . $branch . '\''], "mingw32" => ['5932', 'dave@wax', 'sh build-oberon.sh n oberon/mingw/voc i686-w64-mingw32-gcc ' . $branch], "mingw64" => ['5932', 'dave@wax', 'sh start64.sh \'sh build-oberon.sh n oberon/mingw/voc x86_64-w64-mingw32-gcc ' . $branch . '\''], - "android" => ['8022', 'root@and', 'sh build-oberon.sh n vishap/voc gcc ' . $branch], - "lub64" => ['22', 'dave@vim', 'sh build-oberon.sh sudo oberon/voc gcc ' . $branch], - "lub32" => ['22', 'dave@vim-lub32', 'sh build-oberon.sh sudo oberon/voc gcc ' . $branch], - "fed64" => ['22', 'dave@vim-fed64', 'sh build-oberon.sh sudo oberon/voc gcc ' . $branch], - "osu64" => ['22', 'dave@vim-osu64', 'sh build-oberon.sh sudo oberon/voc gcc ' . $branch], - "ob32" => ['22', 'root@nas-ob32', 'sh build-oberon.sh n vishap/voc gcc ' . $branch], - "obs32" => ['22', 'dave@vim-obs32', 'sh build-oberon.sh n vishap/voc gcc ' . $branch], - "ce64" => ['5922', 'obe@www', 'sh build-oberon.sh sudo vishap/voc gcc ' . $branch], - "fb64" => ['22', 'root@oberon', 'sh build-oberon.sh n vishap/voc gcc ' . $branch] + "android" => ['8022', 'root@and', 'sh build-oberon.sh n vishap/voc gcc ' . $branch], + "lub64" => ['22', 'dave@vim', 'sh build-oberon.sh sudo oberon/voc gcc ' . $branch], + "lub32" => ['22', 'dave@vim-lub32', 'sh build-oberon.sh sudo oberon/voc gcc ' . $branch], + "fed64" => ['22', 'dave@vim-fed64', 'sh build-oberon.sh sudo oberon/voc gcc ' . $branch], + "osu64" => ['22', 'dave@vim-osu64', 'sh build-oberon.sh sudo oberon/voc gcc ' . $branch], + "obs32" => ['22', 'dave@vim-obs32', 'sh build-oberon.sh n vishap/voc gcc ' . $branch], + "win32" => ['22', 'dave@vim-win64', 'sh build-oberon.sh n msc-x86/voc msc-x86' . $branch], + "ce64" => ['5922', 'obe@www', 'sh build-oberon.sh sudo vishap/voc gcc ' . $branch], + "fb64" => ['22', 'root@oberon', 'sh build-oberon.sh n vishap/voc gcc ' . $branch] ); sub logged { From 4dac1f29d50a416587957391f7f711fc39090c76 Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 22 Dec 2016 14:42:53 +0000 Subject: [PATCH 451/580] Fix conditional syntax in autobuild script. --- src/tools/autobuild/build-oberon.sh | 3 ++- src/tools/autobuild/buildall.pl | 26 +++++++++++++------------- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/src/tools/autobuild/build-oberon.sh b/src/tools/autobuild/build-oberon.sh index 7a7b913b..f3d60f27 100644 --- a/src/tools/autobuild/build-oberon.sh +++ b/src/tools/autobuild/build-oberon.sh @@ -25,7 +25,8 @@ export CC=$3 if test "$3" = "msc-x86"; then cmd /c 'C:\Program Files (x86)\Microsoft Visual C++ Build Tools\vcbuildtools.bat' x86 '&&' cd 'c:\cygwin\home\dave\msc-x86\voc' '&&' make full -else; if test "$3" = "msc-x64"; then +else +if test "$3" = "msc-x64"; then cmd /c 'C:\Program Files (x86)\Microsoft Visual C++ Build Tools\vcbuildtools.bat' x64 '&&' cd 'c:\cygwin\home\dave\msc-x64\voc' '&&' make full else $sudo make full diff --git a/src/tools/autobuild/buildall.pl b/src/tools/autobuild/buildall.pl index b0129ccb..5186406e 100644 --- a/src/tools/autobuild/buildall.pl +++ b/src/tools/autobuild/buildall.pl @@ -8,21 +8,21 @@ my $branch = "master"; if (defined($ARGV[0]) && ($ARGV[0] ne "")) {$branch = $ARGV[0]} my %machines = ( - "pi" => ['22', 'pi@pie', 'sh build-oberon.sh sudo projects/oberon/vishap/voc gcc ' . $branch], - "darwin" => ['22', 'dave@dcb', 'sh build-oberon.sh sudo projects/oberon/vishap/voc clang ' . $branch], - "cygwin32" => ['5932', 'dave@wax', 'sh build-oberon.sh n oberon/cygwin/voc gcc ' . $branch], - "cygwin64" => ['5932', 'dave@wax', 'sh start64.sh \'sh build-oberon.sh n oberon/cygwin/voc gcc ' . $branch . '\''], + "pi" => ['22', 'pi@pie', 'sh build-oberon.sh sudo projects/oberon/vishap/voc gcc ' . $branch], + "darwin" => ['22', 'dave@dcb', 'sh build-oberon.sh sudo projects/oberon/vishap/voc clang ' . $branch], + "cygwin32" => ['5932', 'dave@wax', 'sh build-oberon.sh n oberon/cygwin/voc gcc ' . $branch], + "cygwin64" => ['5932', 'dave@wax', 'sh start64.sh \'sh build-oberon.sh n oberon/cygwin/voc gcc ' . $branch . '\''], "mingw32" => ['5932', 'dave@wax', 'sh build-oberon.sh n oberon/mingw/voc i686-w64-mingw32-gcc ' . $branch], "mingw64" => ['5932', 'dave@wax', 'sh start64.sh \'sh build-oberon.sh n oberon/mingw/voc x86_64-w64-mingw32-gcc ' . $branch . '\''], - "android" => ['8022', 'root@and', 'sh build-oberon.sh n vishap/voc gcc ' . $branch], - "lub64" => ['22', 'dave@vim', 'sh build-oberon.sh sudo oberon/voc gcc ' . $branch], - "lub32" => ['22', 'dave@vim-lub32', 'sh build-oberon.sh sudo oberon/voc gcc ' . $branch], - "fed64" => ['22', 'dave@vim-fed64', 'sh build-oberon.sh sudo oberon/voc gcc ' . $branch], - "osu64" => ['22', 'dave@vim-osu64', 'sh build-oberon.sh sudo oberon/voc gcc ' . $branch], - "obs32" => ['22', 'dave@vim-obs32', 'sh build-oberon.sh n vishap/voc gcc ' . $branch], - "win32" => ['22', 'dave@vim-win64', 'sh build-oberon.sh n msc-x86/voc msc-x86' . $branch], - "ce64" => ['5922', 'obe@www', 'sh build-oberon.sh sudo vishap/voc gcc ' . $branch], - "fb64" => ['22', 'root@oberon', 'sh build-oberon.sh n vishap/voc gcc ' . $branch] + "android" => ['8022', 'root@and', 'sh build-oberon.sh n vishap/voc gcc ' . $branch], + "lub64" => ['22', 'dave@vim', 'sh build-oberon.sh sudo oberon/voc gcc ' . $branch], + "lub32" => ['22', 'dave@vim-lub32', 'sh build-oberon.sh sudo oberon/voc gcc ' . $branch], + "fed64" => ['22', 'dave@vim-fed64', 'sh build-oberon.sh sudo oberon/voc gcc ' . $branch], + "osu64" => ['22', 'dave@vim-osu64', 'sh build-oberon.sh sudo oberon/voc gcc ' . $branch], + "obs32" => ['22', 'dave@vim-obs32', 'sh build-oberon.sh n vishap/voc gcc ' . $branch], + "win32" => ['22', 'dave@vim-win64', 'sh build-oberon.sh n msc-x86/voc msc-x86 ' . $branch], + "ce64" => ['5922', 'obe@www', 'sh build-oberon.sh sudo vishap/voc gcc ' . $branch], + "fb64" => ['22', 'root@oberon', 'sh build-oberon.sh n vishap/voc gcc ' . $branch] ); sub logged { From b66d7bf2ef873831822a340da74237c75dd97c8c Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 22 Dec 2016 14:55:03 +0000 Subject: [PATCH 452/580] Display configuration in Visual C makefile --- make.cmd | 2 +- src/tools/autobuild/build-oberon.sh | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/make.cmd b/make.cmd index c2a817dc..231ac3db 100644 --- a/make.cmd +++ b/make.cmd @@ -21,7 +21,7 @@ cl -nologo -Isrc\runtime src\tools\make\configure.c >msc-listing || type msc-listing setlocal -configure.exe >nul +configure.exe del configure.obj configure.exe 2>nul diff --git a/src/tools/autobuild/build-oberon.sh b/src/tools/autobuild/build-oberon.sh index f3d60f27..ca9a10ed 100644 --- a/src/tools/autobuild/build-oberon.sh +++ b/src/tools/autobuild/build-oberon.sh @@ -31,3 +31,4 @@ if test "$3" = "msc-x64"; then else $sudo make full fi +fi From 37fc052d951dd5062942bd9ce8d1342add435146 Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 22 Dec 2016 16:36:05 +0000 Subject: [PATCH 453/580] Update autobuild report --- src/tools/autobuild/buildall.pl | 1 + src/tools/autobuild/report.pl | 34 ++++++++++++++++++++++++--------- src/tools/make/configure.c | 2 +- 3 files changed, 27 insertions(+), 10 deletions(-) diff --git a/src/tools/autobuild/buildall.pl b/src/tools/autobuild/buildall.pl index 5186406e..f72c36b9 100644 --- a/src/tools/autobuild/buildall.pl +++ b/src/tools/autobuild/buildall.pl @@ -21,6 +21,7 @@ my %machines = ( "osu64" => ['22', 'dave@vim-osu64', 'sh build-oberon.sh sudo oberon/voc gcc ' . $branch], "obs32" => ['22', 'dave@vim-obs32', 'sh build-oberon.sh n vishap/voc gcc ' . $branch], "win32" => ['22', 'dave@vim-win64', 'sh build-oberon.sh n msc-x86/voc msc-x86 ' . $branch], + "win64" => ['22', 'dave@vim-win64', 'sh build-oberon.sh n msc-x64/voc msc-x64 ' . $branch], "ce64" => ['5922', 'obe@www', 'sh build-oberon.sh sudo vishap/voc gcc ' . $branch], "fb64" => ['22', 'root@oberon', 'sh build-oberon.sh n vishap/voc gcc ' . $branch] ); diff --git a/src/tools/autobuild/report.pl b/src/tools/autobuild/report.pl index 459603e4..80c8965e 100644 --- a/src/tools/autobuild/report.pl +++ b/src/tools/autobuild/report.pl @@ -46,17 +46,31 @@ sub parselog { open(my $log, $fn) // die "Couldn't open build log $fn."; $branch = "Build on $fn started"; while (<$log>) { + s/\r//g; # Remove unwanted MS command prompt CR's. + if (/^([0-9\/]+) ([0-9.]+) .+\.log$/) {$date = $1} if (/^([0-9.]+) /) {$time = $1} - # 19.39.58 Configuration: 1.95 [2016/07/14] for gcc LP64 on centos - if (/^[^ ]+ Configuration: ([0-9a-zA-Z.]+) \[[0-9\/]+\] for (.+) *$/) { - logstatus($fn); - $ver = $1; - printf "--- Config for $fn: $1 for $2.\n"; + + #14.55.15 === build-oberon.sh: $1=sudo, $2=oberon/voc, $3=gcc, $4=master, $sudo=sudo === + if (/^[^ ]+ === build-oberon.sh: .* \$3=([^ ]+), \$4=([^ ]+),/) { + ($compiler, $branch) = ($1, $2); } - if (/^[^ ]+ --- Cleaning branch ([^ ]+) ([^ ]+) ([^ ]+) ([^ ]+) ---$/) { - ($branch, $os, $compiler, $datamodel) = ($1, $2, $3, $4, $5); + + # 14.55.17 + sudo git checkout -f master + if (/^[^ ]+ .*git checkout -f ([^ ]+) *$/) { + $branch = $1; } + + # 14.55.17 Configuration: 2.1.0 [2016/12/22] for gcc ILP32 on ubuntu + if (/^[^ ]+ Configuration: ([^ ]+) \[[0-9\/]+\] for ([^ ]+) ([^ ]+) on ([^ ]+)/) { + ($ver, $compiler, $datamodel, $os) = ($1, $2, $3, $4); + printf "--- Config for $fn: $1 for $2 $3 on $4.\n"; + } + + #if (/^[^ ]+ --- Cleaning branch ([^ ]+) ([^ ]+) ([^ ]+) ([^ ]+) ---$/) { + # ($branch, $os, $compiler, $datamodel) = ($1, $2, $3, $4, $5); + #} + if (/^([0-9.]+) --- Compiler build started ---$/) {$compilerok = "Started";} if (/^([0-9.]+) --- Compiler build successfull ---$/) {$compilerok = "Built";} @@ -78,6 +92,7 @@ sub parselog { if ($compilerok eq "Started") {$compilerok = "Failed";} if ($libraryok eq "Started") {$libraryok = "Failed";} if ($tests eq "Started") {$tests = "Failed";} + if ($compiler eq "msc") {$sourcechange = "n/a"; $tests = "n/a";} } } close($log); @@ -110,8 +125,9 @@ sub svgtext { sub colourfor { my ($str) = @_; - if ($str eq "Failed") {return "#e03030";} - if ($str eq "Changed") {return "#ff9d4d";} + if ($str eq "Failed") {return "#e03030";} + if ($str eq "Changed") {return "#ff9d4d";} + if ($str eq "n/a") {return "#707070";} return "#5adb5a"; } diff --git a/src/tools/make/configure.c b/src/tools/make/configure.c index 8ed9eeee..6ef80440 100644 --- a/src/tools/make/configure.c +++ b/src/tools/make/configure.c @@ -148,7 +148,7 @@ void determineCCompiler() { cc = "gcc -fPIC -g" optimize; } #elif defined(_MSC_VER) - compiler = "MSC"; + compiler = "msc"; cc = "cl /nologo"; objext = ".obj"; objflag = " -Fe"; From 535f80d91cb85acc9673d75325d2d6e7d8d08e46 Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 22 Dec 2016 17:16:42 +0000 Subject: [PATCH 454/580] Integrate jtempl heap allocation recursion fix. --- src/runtime/Heap.Mod | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/src/runtime/Heap.Mod b/src/runtime/Heap.Mod index c5a5a977..83d5e6e7 100644 --- a/src/runtime/Heap.Mod +++ b/src/runtime/Heap.Mod @@ -266,18 +266,15 @@ MODULE Heap; IF adr = 0 THEN (* Nothing free *) IF firstTry THEN GC(TRUE); INC(blksz, Unit); - IF uLT(heapsize - allocated, blksz) - OR uLT((heapsize - allocated - blksz) * 4, heapsize) THEN - (* heap would still be more than 3/4 full; expand to avoid thrashing *) - ExtendHeap((allocated + blksz) DIV (3*Unit) * (4*Unit) - heapsize) - END; - firstTry := FALSE; new := NEWREC(tag); firstTry := TRUE; - IF new = NIL THEN - (* depending on the fragmentation, the heap may not have been extended by - the anti-thrashing heuristics above *) - ExtendHeap((allocated + blksz) DIV (3*Unit) * (4*Unit) - heapsize); - new := NEWREC(tag); (* will find a free block if heap has been expanded properly *) + (* Anti-thrashing heuristics: ensure 1/4 of the heap will not be allocated. *) + t := (allocated + blksz) DIV (3*Unit) * (4*Unit); (* Minimum required new heapsize *) + IF uLT(heapsize, t) THEN ExtendHeap(t - heapsize) END; + firstTry := FALSE; new := NEWREC(tag); + IF new = NIL THEN (* Fragmentation prevented allocation, heap is 1/4 free *) + ExtendHeap(blksz); + new := NEWREC(tag) (* Will find a free block if heap has been expanded successfully *) END; + firstTry := TRUE; Unlock(); RETURN new ELSE Unlock(); RETURN NIL From d292b4b2c9f5ad891ed604f77fab4031d190616a Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 22 Dec 2016 17:17:34 +0000 Subject: [PATCH 455/580] Update bootstrap C sources. --- bootstrap/unix-44/Compiler.c | 2 +- bootstrap/unix-44/Configuration.c | 4 ++-- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Files.c | 2 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 11 ++++++----- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 2 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 2 +- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 2 +- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 2 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Out.c | 2 +- bootstrap/unix-44/Out.h | 2 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/VT100.c | 2 +- bootstrap/unix-44/VT100.h | 2 +- bootstrap/unix-44/extTools.c | 2 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-48/Compiler.c | 2 +- bootstrap/unix-48/Configuration.c | 4 ++-- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Files.c | 2 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 11 ++++++----- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 2 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 2 +- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 2 +- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 2 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Out.c | 2 +- bootstrap/unix-48/Out.h | 2 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/VT100.c | 2 +- bootstrap/unix-48/VT100.h | 2 +- bootstrap/unix-48/extTools.c | 2 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-88/Compiler.c | 2 +- bootstrap/unix-88/Configuration.c | 4 ++-- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Files.c | 2 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 11 ++++++----- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 2 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 2 +- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 2 +- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 2 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Out.c | 2 +- bootstrap/unix-88/Out.h | 2 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/VT100.c | 2 +- bootstrap/unix-88/VT100.h | 2 +- bootstrap/unix-88/extTools.c | 2 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/windows-48/Compiler.c | 2 +- bootstrap/windows-48/Configuration.c | 4 ++-- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Files.c | 2 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 11 ++++++----- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 2 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 2 +- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 2 +- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 2 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Out.c | 2 +- bootstrap/windows-48/Out.h | 2 +- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/VT100.c | 2 +- bootstrap/windows-48/VT100.h | 2 +- bootstrap/windows-48/extTools.c | 2 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-88/Compiler.c | 2 +- bootstrap/windows-88/Configuration.c | 4 ++-- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Files.c | 2 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 11 ++++++----- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 2 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 2 +- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 2 +- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 2 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Out.c | 2 +- bootstrap/windows-88/Out.h | 2 +- bootstrap/windows-88/Platform.c | 2 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/VT100.c | 2 +- bootstrap/windows-88/VT100.h | 2 +- bootstrap/windows-88/extTools.c | 2 +- bootstrap/windows-88/extTools.h | 2 +- 185 files changed, 215 insertions(+), 210 deletions(-) diff --git a/bootstrap/unix-44/Compiler.c b/bootstrap/unix-44/Compiler.c index d81a9a43..a3ea0f88 100644 --- a/bootstrap/unix-44/Compiler.c +++ b/bootstrap/unix-44/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index 1e31b260..8054febd 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index daf3ac70..da289d26 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 50902bd8..069bed68 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index 25669e5f..4ed75358 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index 129be081..66ce19f6 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -289,16 +289,17 @@ SYSTEM_PTR Heap_NEWREC (INT32 tag) if (Heap_firstTry) { Heap_GC(1); blksz += 16; - if (Heap_uLT(Heap_heapsize - Heap_allocated, blksz) || Heap_uLT(__ASHL((Heap_heapsize - Heap_allocated) - blksz, 2), Heap_heapsize)) { - Heap_ExtendHeap(__ASHL(__DIV(Heap_allocated + blksz, 48), 6) - Heap_heapsize); + t = __ASHL(__DIV(Heap_allocated + blksz, 48), 6); + if (Heap_uLT(Heap_heapsize, t)) { + Heap_ExtendHeap(t - Heap_heapsize); } Heap_firstTry = 0; new = Heap_NEWREC(tag); - Heap_firstTry = 1; if (new == NIL) { - Heap_ExtendHeap(__ASHL(__DIV(Heap_allocated + blksz, 48), 6) - Heap_heapsize); + Heap_ExtendHeap(blksz); new = Heap_NEWREC(tag); } + Heap_firstTry = 1; Heap_Unlock(); return new; } else { diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index c019c8f0..c6640fd2 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index 8e2f0126..02aa54a7 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index 8771bb17..2adfd91d 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index 47de29e6..a27fa4ca 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index e546e68f..ad9b40c7 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 062bc79b..92219dc5 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index bc980a30..dc5cdfc7 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 7b8be0fd..0cfdc99a 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index 1a2a6e4e..fd042e7f 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index b636f79f..f9a740ff 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index eca79f7f..b4949ef8 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index fd0e7bba..d98c7f8a 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index 6596c0d4..2ae74912 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index 475e0bb8..3dbeab79 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index ef7dd6a8..ec74311c 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index 0c366e14..0965fdba 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index 46b04b0d..8493d416 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Out.c b/bootstrap/unix-44/Out.c index a104f570..0523671f 100644 --- a/bootstrap/unix-44/Out.c +++ b/bootstrap/unix-44/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Out.h b/bootstrap/unix-44/Out.h index cc5af1e0..fb7415a8 100644 --- a/bootstrap/unix-44/Out.h +++ b/bootstrap/unix-44/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 777ef8f2..ce556023 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index 0f3d5642..7c570eae 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 1cc18e85..4976039b 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index fc275a0e..b1044c30 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index 90f9337c..1cc614c5 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index e63580fb..68cdf219 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index 484e698e..3e44b72b 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index ab086221..f31da607 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/VT100.c b/bootstrap/unix-44/VT100.c index e16da294..76f04f6d 100644 --- a/bootstrap/unix-44/VT100.c +++ b/bootstrap/unix-44/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/VT100.h b/bootstrap/unix-44/VT100.h index fcee0af8..812e751b 100644 --- a/bootstrap/unix-44/VT100.h +++ b/bootstrap/unix-44/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index 793e9025..90a3382a 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index e1375387..e3ab156a 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/Compiler.c b/bootstrap/unix-48/Compiler.c index d81a9a43..a3ea0f88 100644 --- a/bootstrap/unix-48/Compiler.c +++ b/bootstrap/unix-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index 1e31b260..8054febd 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index daf3ac70..da289d26 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 50902bd8..069bed68 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index 25669e5f..4ed75358 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index 129be081..66ce19f6 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -289,16 +289,17 @@ SYSTEM_PTR Heap_NEWREC (INT32 tag) if (Heap_firstTry) { Heap_GC(1); blksz += 16; - if (Heap_uLT(Heap_heapsize - Heap_allocated, blksz) || Heap_uLT(__ASHL((Heap_heapsize - Heap_allocated) - blksz, 2), Heap_heapsize)) { - Heap_ExtendHeap(__ASHL(__DIV(Heap_allocated + blksz, 48), 6) - Heap_heapsize); + t = __ASHL(__DIV(Heap_allocated + blksz, 48), 6); + if (Heap_uLT(Heap_heapsize, t)) { + Heap_ExtendHeap(t - Heap_heapsize); } Heap_firstTry = 0; new = Heap_NEWREC(tag); - Heap_firstTry = 1; if (new == NIL) { - Heap_ExtendHeap(__ASHL(__DIV(Heap_allocated + blksz, 48), 6) - Heap_heapsize); + Heap_ExtendHeap(blksz); new = Heap_NEWREC(tag); } + Heap_firstTry = 1; Heap_Unlock(); return new; } else { diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index c019c8f0..c6640fd2 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index 8e2f0126..02aa54a7 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index 8771bb17..2adfd91d 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index 47de29e6..a27fa4ca 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index e546e68f..ad9b40c7 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 062bc79b..92219dc5 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index bc980a30..dc5cdfc7 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 7b8be0fd..0cfdc99a 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index 1a2a6e4e..fd042e7f 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index b636f79f..f9a740ff 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index eca79f7f..b4949ef8 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index fd0e7bba..d98c7f8a 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index 6596c0d4..2ae74912 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 9b550db2..cf8d3659 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index ef7dd6a8..ec74311c 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index 0c366e14..0965fdba 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index 46b04b0d..8493d416 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Out.c b/bootstrap/unix-48/Out.c index a104f570..0523671f 100644 --- a/bootstrap/unix-48/Out.c +++ b/bootstrap/unix-48/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Out.h b/bootstrap/unix-48/Out.h index cc5af1e0..fb7415a8 100644 --- a/bootstrap/unix-48/Out.h +++ b/bootstrap/unix-48/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 777ef8f2..ce556023 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index 0f3d5642..7c570eae 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 1cc18e85..4976039b 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index fc275a0e..b1044c30 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index 90f9337c..1cc614c5 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index e63580fb..68cdf219 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index e9b54970..5eea7749 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index a89d3713..6b4d7af2 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/VT100.c b/bootstrap/unix-48/VT100.c index e16da294..76f04f6d 100644 --- a/bootstrap/unix-48/VT100.c +++ b/bootstrap/unix-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/VT100.h b/bootstrap/unix-48/VT100.h index fcee0af8..812e751b 100644 --- a/bootstrap/unix-48/VT100.h +++ b/bootstrap/unix-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index 793e9025..90a3382a 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index e1375387..e3ab156a 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/Compiler.c b/bootstrap/unix-88/Compiler.c index d81a9a43..a3ea0f88 100644 --- a/bootstrap/unix-88/Compiler.c +++ b/bootstrap/unix-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index 1e31b260..8054febd 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index daf3ac70..da289d26 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 91ef8f3a..b1517add 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index de24ffaf..64602dd6 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index d5a4f08e..dac990ab 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -289,16 +289,17 @@ SYSTEM_PTR Heap_NEWREC (INT64 tag) if (Heap_firstTry) { Heap_GC(1); blksz += 32; - if (Heap_uLT(Heap_heapsize - Heap_allocated, blksz) || Heap_uLT(__ASHL((Heap_heapsize - Heap_allocated) - blksz, 2), Heap_heapsize)) { - Heap_ExtendHeap(__ASHL(__DIV(Heap_allocated + blksz, 96), 7) - Heap_heapsize); + t = __ASHL(__DIV(Heap_allocated + blksz, 96), 7); + if (Heap_uLT(Heap_heapsize, t)) { + Heap_ExtendHeap(t - Heap_heapsize); } Heap_firstTry = 0; new = Heap_NEWREC(tag); - Heap_firstTry = 1; if (new == NIL) { - Heap_ExtendHeap(__ASHL(__DIV(Heap_allocated + blksz, 96), 7) - Heap_heapsize); + Heap_ExtendHeap(blksz); new = Heap_NEWREC(tag); } + Heap_firstTry = 1; Heap_Unlock(); return new; } else { diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index 4512d96e..cb98d8fc 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 186ab951..947bfc0b 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index 00cdc69f..77d4cfb2 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index 47de29e6..a27fa4ca 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index e546e68f..ad9b40c7 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index 062bc79b..92219dc5 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index bc980a30..dc5cdfc7 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 315fb4d2..bb66f347 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index 1a2a6e4e..fd042e7f 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index a8eff270..77801b58 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index eca79f7f..b4949ef8 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index fd0e7bba..d98c7f8a 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index 6596c0d4..2ae74912 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index a855a25f..58ed2541 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index ef7dd6a8..ec74311c 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index df10c2a8..4186de2e 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index 46b04b0d..8493d416 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Out.c b/bootstrap/unix-88/Out.c index a104f570..0523671f 100644 --- a/bootstrap/unix-88/Out.c +++ b/bootstrap/unix-88/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Out.h b/bootstrap/unix-88/Out.h index cc5af1e0..fb7415a8 100644 --- a/bootstrap/unix-88/Out.h +++ b/bootstrap/unix-88/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index affaff74..193a781b 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index 9599e6e3..a6957766 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 1cc18e85..4976039b 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index fc275a0e..b1044c30 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index 90f9337c..1cc614c5 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index e63580fb..68cdf219 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index a0c55c7d..5d9a398d 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index 21d2344a..a35e5e97 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/VT100.c b/bootstrap/unix-88/VT100.c index e16da294..76f04f6d 100644 --- a/bootstrap/unix-88/VT100.c +++ b/bootstrap/unix-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/VT100.h b/bootstrap/unix-88/VT100.h index fcee0af8..812e751b 100644 --- a/bootstrap/unix-88/VT100.h +++ b/bootstrap/unix-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index 793e9025..90a3382a 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index e1375387..e3ab156a 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/Compiler.c b/bootstrap/windows-48/Compiler.c index d81a9a43..a3ea0f88 100644 --- a/bootstrap/windows-48/Compiler.c +++ b/bootstrap/windows-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index 1e31b260..8054febd 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index daf3ac70..da289d26 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 9aacffe0..8fa17a0c 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index 24a5e667..c2718c5e 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index 129be081..66ce19f6 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -289,16 +289,17 @@ SYSTEM_PTR Heap_NEWREC (INT32 tag) if (Heap_firstTry) { Heap_GC(1); blksz += 16; - if (Heap_uLT(Heap_heapsize - Heap_allocated, blksz) || Heap_uLT(__ASHL((Heap_heapsize - Heap_allocated) - blksz, 2), Heap_heapsize)) { - Heap_ExtendHeap(__ASHL(__DIV(Heap_allocated + blksz, 48), 6) - Heap_heapsize); + t = __ASHL(__DIV(Heap_allocated + blksz, 48), 6); + if (Heap_uLT(Heap_heapsize, t)) { + Heap_ExtendHeap(t - Heap_heapsize); } Heap_firstTry = 0; new = Heap_NEWREC(tag); - Heap_firstTry = 1; if (new == NIL) { - Heap_ExtendHeap(__ASHL(__DIV(Heap_allocated + blksz, 48), 6) - Heap_heapsize); + Heap_ExtendHeap(blksz); new = Heap_NEWREC(tag); } + Heap_firstTry = 1; Heap_Unlock(); return new; } else { diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index c019c8f0..c6640fd2 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index b0a58209..699bf421 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index 8771bb17..2adfd91d 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index 47de29e6..a27fa4ca 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index e546e68f..ad9b40c7 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 062bc79b..92219dc5 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index bc980a30..dc5cdfc7 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 7b8be0fd..0cfdc99a 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index 1a2a6e4e..fd042e7f 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index b636f79f..f9a740ff 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index eca79f7f..b4949ef8 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index fd0e7bba..d98c7f8a 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index 6596c0d4..2ae74912 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 9b550db2..cf8d3659 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index ef7dd6a8..ec74311c 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index 0c366e14..0965fdba 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index 46b04b0d..8493d416 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Out.c b/bootstrap/windows-48/Out.c index 82df8d74..a9a7495f 100644 --- a/bootstrap/windows-48/Out.c +++ b/bootstrap/windows-48/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Out.h b/bootstrap/windows-48/Out.h index cc5af1e0..fb7415a8 100644 --- a/bootstrap/windows-48/Out.h +++ b/bootstrap/windows-48/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index e618a17f..4c82c9d2 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index 96523fd2..02a9a0cd 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 1cc18e85..4976039b 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index fc275a0e..b1044c30 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index 90f9337c..1cc614c5 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index e63580fb..68cdf219 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index e9b54970..5eea7749 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index a89d3713..6b4d7af2 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/VT100.c b/bootstrap/windows-48/VT100.c index e16da294..76f04f6d 100644 --- a/bootstrap/windows-48/VT100.c +++ b/bootstrap/windows-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/VT100.h b/bootstrap/windows-48/VT100.h index fcee0af8..812e751b 100644 --- a/bootstrap/windows-48/VT100.h +++ b/bootstrap/windows-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index 793e9025..90a3382a 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index e1375387..e3ab156a 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/Compiler.c b/bootstrap/windows-88/Compiler.c index d81a9a43..a3ea0f88 100644 --- a/bootstrap/windows-88/Compiler.c +++ b/bootstrap/windows-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index 1e31b260..8054febd 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index daf3ac70..da289d26 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 3d38721d..3a25f202 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index c21b4aee..0e8fed90 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index d5a4f08e..dac990ab 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -289,16 +289,17 @@ SYSTEM_PTR Heap_NEWREC (INT64 tag) if (Heap_firstTry) { Heap_GC(1); blksz += 32; - if (Heap_uLT(Heap_heapsize - Heap_allocated, blksz) || Heap_uLT(__ASHL((Heap_heapsize - Heap_allocated) - blksz, 2), Heap_heapsize)) { - Heap_ExtendHeap(__ASHL(__DIV(Heap_allocated + blksz, 96), 7) - Heap_heapsize); + t = __ASHL(__DIV(Heap_allocated + blksz, 96), 7); + if (Heap_uLT(Heap_heapsize, t)) { + Heap_ExtendHeap(t - Heap_heapsize); } Heap_firstTry = 0; new = Heap_NEWREC(tag); - Heap_firstTry = 1; if (new == NIL) { - Heap_ExtendHeap(__ASHL(__DIV(Heap_allocated + blksz, 96), 7) - Heap_heapsize); + Heap_ExtendHeap(blksz); new = Heap_NEWREC(tag); } + Heap_firstTry = 1; Heap_Unlock(); return new; } else { diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index 4512d96e..cb98d8fc 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 016ad7b2..b7ed8754 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index 00cdc69f..77d4cfb2 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index 47de29e6..a27fa4ca 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index e546e68f..ad9b40c7 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index 062bc79b..92219dc5 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index bc980a30..dc5cdfc7 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 315fb4d2..bb66f347 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index 1a2a6e4e..fd042e7f 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index a8eff270..77801b58 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index eca79f7f..b4949ef8 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index fd0e7bba..d98c7f8a 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index 6596c0d4..2ae74912 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index a855a25f..58ed2541 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index ef7dd6a8..ec74311c 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index df10c2a8..4186de2e 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index 46b04b0d..8493d416 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Out.c b/bootstrap/windows-88/Out.c index 82df8d74..a9a7495f 100644 --- a/bootstrap/windows-88/Out.c +++ b/bootstrap/windows-88/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Out.h b/bootstrap/windows-88/Out.h index cc5af1e0..fb7415a8 100644 --- a/bootstrap/windows-88/Out.h +++ b/bootstrap/windows-88/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index d168bcfb..404eeb1a 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index f1fff926..980e5732 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 1cc18e85..4976039b 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index fc275a0e..b1044c30 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index 90f9337c..1cc614c5 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index e63580fb..68cdf219 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index a0c55c7d..5d9a398d 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index 21d2344a..a35e5e97 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/VT100.c b/bootstrap/windows-88/VT100.c index e16da294..76f04f6d 100644 --- a/bootstrap/windows-88/VT100.c +++ b/bootstrap/windows-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/VT100.h b/bootstrap/windows-88/VT100.h index fcee0af8..812e751b 100644 --- a/bootstrap/windows-88/VT100.h +++ b/bootstrap/windows-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index 793e9025..90a3382a 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index e1375387..e3ab156a 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h From 2a65229fefaaf06e2b7584ed368e5357b3008ad2 Mon Sep 17 00:00:00 2001 From: Norayr Chilingarian Date: Mon, 26 Dec 2016 00:09:35 +0400 Subject: [PATCH 456/580] added 'make install' to the readme. --- ReadMe.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ReadMe.md b/ReadMe.md index 3e2120a5..a420ab86 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -32,7 +32,7 @@ with the following simple steps: 1. Install pre-requisites such as git, gcc, static C libraries, diff utils. 2. Clone the repository and run 'make full'. - 3. Optionally install to a system directory such as /opt or /usr/local/share. + 3. Optionally install to a system directory such as /opt or /usr/local/share with 'make install'. 4. Set your PATH variable to include the compiler binary. These are detailed below: @@ -302,4 +302,4 @@ Also, Vishaps are known in tales, fiction. [This page](http://blog.fogus.me/2015 ## History -See [**History**](/doc/History.md). \ No newline at end of file +See [**History**](/doc/History.md). From 173c83f21753594cbcdb1cf6adea465927d0390e Mon Sep 17 00:00:00 2001 From: David Brown Date: Wed, 28 Dec 2016 12:33:34 +0000 Subject: [PATCH 457/580] Integrate OFront fix for unsigned DIV in heap. --- src/runtime/Heap.Mod | 42 +++++++++++++++++++++++++----------------- 1 file changed, 25 insertions(+), 17 deletions(-) diff --git a/src/runtime/Heap.Mod b/src/runtime/Heap.Mod index 83d5e6e7..f01b9c7b 100644 --- a/src/runtime/Heap.Mod +++ b/src/runtime/Heap.Mod @@ -4,12 +4,13 @@ MODULE Heap; before any other modules are initialized. *) CONST - ModNameLen = 20; - CmdNameLen = 24; - SZA = SIZE(S.ADDRESS); (* Size of address *) - Unit = 4*SZA; (* smallest possible heap block *) - nofLists = 9; (* number of freelist entries excluding sentinel *) - heapSize0 = 8000*Unit; (* startup heap size *) + ModNameLen = 20; + CmdNameLen = 24; + SZA = SIZE(S.ADDRESS); (* Size of address *) + Unit = 4*SZA; (* Smallest possible heap block *) + nofLists = 9; (* Number of freelist entries excluding sentinel *) + heapSize0 = 8000*Unit; (* Startup heap size *) + heapMinExpand = 10000*Unit; (* minimum heap expansion size *) (* all blocks look the same: free blocks describe themselves: size = Unit @@ -78,6 +79,8 @@ MODULE Heap; bigBlocks: S.ADDRESS; allocated*: S.ADDRESS; firstTry: BOOLEAN; + ldUnit: INTEGER; (* Unit = 2^ldUnit, for unsigned division expressed as logical shift right *) + (* extensible heap *) heap-: S.ADDRESS; (* the sorted list of heap chunks *) @@ -210,8 +213,8 @@ MODULE Heap; PROCEDURE ExtendHeap(blksz: S.ADDRESS); VAR size, chnk, j, next: S.ADDRESS; BEGIN - IF uLT(10000*Unit, blksz) THEN size := blksz - ELSE size := 10000*Unit (* additional heuristics *) + IF uLT(heapMinExpand, blksz) THEN size := blksz + ELSE size := heapMinExpand (* additional heuristics for avoiding many small heap expansions *) END; chnk := NewChunk(size); IF chnk # 0 THEN @@ -239,15 +242,15 @@ MODULE Heap; Lock(); S.GET(tag, blksz); - ASSERT((Unit = 16) OR (Unit = 32)); ASSERT(SIZE(S.PTR) = SIZE(S.ADDRESS)); ASSERT(blksz MOD Unit = 0); - i0 := blksz DIV Unit; i := i0; - IF uLT(i, nofLists) THEN adr := freeList[i]; + i0 := S.LSH(blksz, -ldUnit); (*uDIV Unit*) + i := i0; + IF i < nofLists THEN adr := freeList[i]; WHILE adr = 0 DO INC(i); adr := freeList[i] END END; - IF uLT(i, nofLists) THEN (* Unlink from freelist[i] *) + IF i < nofLists THEN (* Unlink from freelist[i] *) S.GET(adr + nextOff, next); freeList[i] := next; IF i # i0 THEN (* Split *) @@ -266,11 +269,11 @@ MODULE Heap; IF adr = 0 THEN (* Nothing free *) IF firstTry THEN GC(TRUE); INC(blksz, Unit); - (* Anti-thrashing heuristics: ensure 1/4 of the heap will not be allocated. *) - t := (allocated + blksz) DIV (3*Unit) * (4*Unit); (* Minimum required new heapsize *) + (* Anti-thrashing heuristics: ensure 1/5 of the heap will not be allocated. *) + t := S.LSH(allocated + blksz, -2) (*uDIV 4*) * 5 ; (* Minimum preferred heapsize *) IF uLT(heapsize, t) THEN ExtendHeap(t - heapsize) END; firstTry := FALSE; new := NEWREC(tag); - IF new = NIL THEN (* Fragmentation prevented allocation, heap is 1/4 free *) + IF new = NIL THEN (* Heap is 1/5 free but fragmentation prevented allocation *) ExtendHeap(blksz); new := NEWREC(tag) (* Will find a free block if heap has been expanded successfully *) END; @@ -395,7 +398,8 @@ MODULE Heap; S.PUT(start, start+SZA); S.PUT(start+sizeOff, freesize); S.PUT(start+sntlOff, NoPtrSntl); - i := freesize DIV Unit; freesize := 0; + i := S.LSH(freesize, -ldUnit) (*uDIV Unit*); + freesize := 0; IF uLT(i, nofLists) THEN S.PUT(start + nextOff, freeList[i]); freeList[i] := start ELSE S.PUT(start + nextOff, bigBlocks); bigBlocks := start END @@ -416,7 +420,8 @@ MODULE Heap; S.PUT(start, start+SZA); S.PUT(start+sizeOff, freesize); S.PUT(start+sntlOff, NoPtrSntl); - i := freesize DIV Unit; freesize := 0; + i := S.LSH(freesize, -ldUnit) (*uDIV Unit*); + freesize := 0; IF uLT(i, nofLists) THEN S.PUT(start + nextOff, freeList[i]); freeList[i] := start ELSE S.PUT(start + nextOff, bigBlocks); bigBlocks := start END @@ -595,6 +600,9 @@ MODULE Heap; heapMax := 0; bigBlocks := 0; + ASSERT((Unit = 16) OR (Unit = 32)); + IF Unit = 16 THEN ldUnit := 4 ELSE ldUnit := 5 END; + heap := NewChunk(heapSize0); S.PUT(heap + nextChnkOff, AddressZero); From 6c9fdacce5d1551f76cb7c348b0d933d1e3e5ea5 Mon Sep 17 00:00:00 2001 From: David Brown Date: Wed, 28 Dec 2016 12:34:28 +0000 Subject: [PATCH 458/580] Update bootstrap C source --- bootstrap/unix-44/Compiler.c | 2 +- bootstrap/unix-44/Configuration.c | 4 ++-- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Files.c | 2 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 16 +++++++++------- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 2 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 2 +- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 2 +- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 2 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Out.c | 2 +- bootstrap/unix-44/Out.h | 2 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/VT100.c | 2 +- bootstrap/unix-44/VT100.h | 2 +- bootstrap/unix-44/extTools.c | 2 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-48/Compiler.c | 2 +- bootstrap/unix-48/Configuration.c | 4 ++-- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Files.c | 2 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 16 +++++++++------- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 2 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 2 +- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 2 +- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 2 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Out.c | 2 +- bootstrap/unix-48/Out.h | 2 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/VT100.c | 2 +- bootstrap/unix-48/VT100.h | 2 +- bootstrap/unix-48/extTools.c | 2 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-88/Compiler.c | 2 +- bootstrap/unix-88/Configuration.c | 4 ++-- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Files.c | 2 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 16 +++++++++------- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 2 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 2 +- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 2 +- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 2 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Out.c | 2 +- bootstrap/unix-88/Out.h | 2 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/VT100.c | 2 +- bootstrap/unix-88/VT100.h | 2 +- bootstrap/unix-88/extTools.c | 2 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/windows-48/Compiler.c | 2 +- bootstrap/windows-48/Configuration.c | 4 ++-- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Files.c | 2 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 16 +++++++++------- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 2 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 2 +- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 2 +- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 2 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Out.c | 2 +- bootstrap/windows-48/Out.h | 2 +- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/VT100.c | 2 +- bootstrap/windows-48/VT100.h | 2 +- bootstrap/windows-48/extTools.c | 2 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-88/Compiler.c | 2 +- bootstrap/windows-88/Configuration.c | 4 ++-- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Files.c | 2 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 16 +++++++++------- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 2 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 2 +- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 2 +- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 2 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Out.c | 2 +- bootstrap/windows-88/Out.h | 2 +- bootstrap/windows-88/Platform.c | 2 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/VT100.c | 2 +- bootstrap/windows-88/VT100.h | 2 +- bootstrap/windows-88/extTools.c | 2 +- bootstrap/windows-88/extTools.h | 2 +- 185 files changed, 230 insertions(+), 220 deletions(-) diff --git a/bootstrap/unix-44/Compiler.c b/bootstrap/unix-44/Compiler.c index a3ea0f88..7e60820e 100644 --- a/bootstrap/unix-44/Compiler.c +++ b/bootstrap/unix-44/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index 8054febd..38996368 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index da289d26..30cb74e8 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 069bed68..a6e0e050 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index 4ed75358..16f28ca6 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index 66ce19f6..1afb3591 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -68,6 +68,7 @@ static INT32 Heap_freeList[10]; static INT32 Heap_bigBlocks; export INT32 Heap_allocated; static BOOLEAN Heap_firstTry; +static INT16 Heap_ldUnit; export INT32 Heap_heap; static INT32 Heap_heapMin, Heap_heapMax; export INT32 Heap_heapsize; @@ -257,16 +258,16 @@ SYSTEM_PTR Heap_NEWREC (INT32 tag) SYSTEM_PTR new; Heap_Lock(); __GET(tag, blksz, INT32); - i0 = __ASHR(blksz, 4); + i0 = __LSH(blksz, -Heap_ldUnit, 32); i = i0; - if (Heap_uLT(i, 9)) { + if (i < 9) { adr = Heap_freeList[i]; while (adr == 0) { i += 1; adr = Heap_freeList[i]; } } - if (Heap_uLT(i, 9)) { + if (i < 9) { __GET(adr + 12, next, INT32); Heap_freeList[i] = next; if (i != i0) { @@ -289,7 +290,7 @@ SYSTEM_PTR Heap_NEWREC (INT32 tag) if (Heap_firstTry) { Heap_GC(1); blksz += 16; - t = __ASHL(__DIV(Heap_allocated + blksz, 48), 6); + t = __LSHR(Heap_allocated + blksz, 2, 32) * 5; if (Heap_uLT(Heap_heapsize, t)) { Heap_ExtendHeap(t - Heap_heapsize); } @@ -444,7 +445,7 @@ static void Heap_Scan (void) __PUT(start, start + 4, INT32); __PUT(start + 4, freesize, INT32); __PUT(start + 8, -4, INT32); - i = __ASHR(freesize, 4); + i = __LSH(freesize, -Heap_ldUnit, 32); freesize = 0; if (Heap_uLT(i, 9)) { __PUT(start + 12, Heap_freeList[i], INT32); @@ -470,7 +471,7 @@ static void Heap_Scan (void) __PUT(start, start + 4, INT32); __PUT(start + 4, freesize, INT32); __PUT(start + 8, -4, INT32); - i = __ASHR(freesize, 4); + i = __LSH(freesize, -Heap_ldUnit, 32); freesize = 0; if (Heap_uLT(i, 9)) { __PUT(start + 12, Heap_freeList[i], INT32); @@ -757,6 +758,7 @@ void Heap_InitHeap (void) Heap_heapMin = -1; Heap_heapMax = 0; Heap_bigBlocks = 0; + Heap_ldUnit = 4; Heap_heap = Heap_NewChunk(128000); __PUT(Heap_heap, 0, INT32); Heap_firstTry = 1; diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index c6640fd2..dfb69c3b 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index 02aa54a7..9b704eaa 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index 2adfd91d..b91a4bb6 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index a27fa4ca..6b05efda 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index ad9b40c7..fe90c6cf 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 92219dc5..e1589255 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index dc5cdfc7..e89cf071 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 0cfdc99a..9917bacf 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index fd042e7f..2b8f8082 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index f9a740ff..0f234a0c 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index b4949ef8..e29fd063 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index d98c7f8a..706aa7f6 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index 2ae74912..aaa0e316 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index 3dbeab79..18cbbeb1 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index ec74311c..8c448452 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index 0965fdba..3726a7a6 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index 8493d416..05057877 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Out.c b/bootstrap/unix-44/Out.c index 0523671f..d471878f 100644 --- a/bootstrap/unix-44/Out.c +++ b/bootstrap/unix-44/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Out.h b/bootstrap/unix-44/Out.h index fb7415a8..a8cec2fe 100644 --- a/bootstrap/unix-44/Out.h +++ b/bootstrap/unix-44/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index ce556023..60d8fc27 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index 7c570eae..4bacbebb 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 4976039b..a922fa33 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index b1044c30..18363fbb 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index 1cc614c5..bfa49f9a 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index 68cdf219..65b61b6b 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index 3e44b72b..ba0e2d5a 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index f31da607..1618c9e7 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/VT100.c b/bootstrap/unix-44/VT100.c index 76f04f6d..25fcc26d 100644 --- a/bootstrap/unix-44/VT100.c +++ b/bootstrap/unix-44/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/VT100.h b/bootstrap/unix-44/VT100.h index 812e751b..e97f887c 100644 --- a/bootstrap/unix-44/VT100.h +++ b/bootstrap/unix-44/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index 90a3382a..3d36c2b5 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index e3ab156a..f4aa7420 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/Compiler.c b/bootstrap/unix-48/Compiler.c index a3ea0f88..7e60820e 100644 --- a/bootstrap/unix-48/Compiler.c +++ b/bootstrap/unix-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index 8054febd..38996368 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index da289d26..30cb74e8 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 069bed68..a6e0e050 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index 4ed75358..16f28ca6 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index 66ce19f6..1afb3591 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -68,6 +68,7 @@ static INT32 Heap_freeList[10]; static INT32 Heap_bigBlocks; export INT32 Heap_allocated; static BOOLEAN Heap_firstTry; +static INT16 Heap_ldUnit; export INT32 Heap_heap; static INT32 Heap_heapMin, Heap_heapMax; export INT32 Heap_heapsize; @@ -257,16 +258,16 @@ SYSTEM_PTR Heap_NEWREC (INT32 tag) SYSTEM_PTR new; Heap_Lock(); __GET(tag, blksz, INT32); - i0 = __ASHR(blksz, 4); + i0 = __LSH(blksz, -Heap_ldUnit, 32); i = i0; - if (Heap_uLT(i, 9)) { + if (i < 9) { adr = Heap_freeList[i]; while (adr == 0) { i += 1; adr = Heap_freeList[i]; } } - if (Heap_uLT(i, 9)) { + if (i < 9) { __GET(adr + 12, next, INT32); Heap_freeList[i] = next; if (i != i0) { @@ -289,7 +290,7 @@ SYSTEM_PTR Heap_NEWREC (INT32 tag) if (Heap_firstTry) { Heap_GC(1); blksz += 16; - t = __ASHL(__DIV(Heap_allocated + blksz, 48), 6); + t = __LSHR(Heap_allocated + blksz, 2, 32) * 5; if (Heap_uLT(Heap_heapsize, t)) { Heap_ExtendHeap(t - Heap_heapsize); } @@ -444,7 +445,7 @@ static void Heap_Scan (void) __PUT(start, start + 4, INT32); __PUT(start + 4, freesize, INT32); __PUT(start + 8, -4, INT32); - i = __ASHR(freesize, 4); + i = __LSH(freesize, -Heap_ldUnit, 32); freesize = 0; if (Heap_uLT(i, 9)) { __PUT(start + 12, Heap_freeList[i], INT32); @@ -470,7 +471,7 @@ static void Heap_Scan (void) __PUT(start, start + 4, INT32); __PUT(start + 4, freesize, INT32); __PUT(start + 8, -4, INT32); - i = __ASHR(freesize, 4); + i = __LSH(freesize, -Heap_ldUnit, 32); freesize = 0; if (Heap_uLT(i, 9)) { __PUT(start + 12, Heap_freeList[i], INT32); @@ -757,6 +758,7 @@ void Heap_InitHeap (void) Heap_heapMin = -1; Heap_heapMax = 0; Heap_bigBlocks = 0; + Heap_ldUnit = 4; Heap_heap = Heap_NewChunk(128000); __PUT(Heap_heap, 0, INT32); Heap_firstTry = 1; diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index c6640fd2..dfb69c3b 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index 02aa54a7..9b704eaa 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index 2adfd91d..b91a4bb6 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index a27fa4ca..6b05efda 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index ad9b40c7..fe90c6cf 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 92219dc5..e1589255 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index dc5cdfc7..e89cf071 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 0cfdc99a..9917bacf 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index fd042e7f..2b8f8082 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index f9a740ff..0f234a0c 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index b4949ef8..e29fd063 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index d98c7f8a..706aa7f6 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index 2ae74912..aaa0e316 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index cf8d3659..28197756 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index ec74311c..8c448452 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index 0965fdba..3726a7a6 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index 8493d416..05057877 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Out.c b/bootstrap/unix-48/Out.c index 0523671f..d471878f 100644 --- a/bootstrap/unix-48/Out.c +++ b/bootstrap/unix-48/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Out.h b/bootstrap/unix-48/Out.h index fb7415a8..a8cec2fe 100644 --- a/bootstrap/unix-48/Out.h +++ b/bootstrap/unix-48/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index ce556023..60d8fc27 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index 7c570eae..4bacbebb 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 4976039b..a922fa33 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index b1044c30..18363fbb 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index 1cc614c5..bfa49f9a 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index 68cdf219..65b61b6b 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index 5eea7749..6526fc8e 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index 6b4d7af2..a13ba9f8 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/VT100.c b/bootstrap/unix-48/VT100.c index 76f04f6d..25fcc26d 100644 --- a/bootstrap/unix-48/VT100.c +++ b/bootstrap/unix-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/VT100.h b/bootstrap/unix-48/VT100.h index 812e751b..e97f887c 100644 --- a/bootstrap/unix-48/VT100.h +++ b/bootstrap/unix-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index 90a3382a..3d36c2b5 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index e3ab156a..f4aa7420 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/Compiler.c b/bootstrap/unix-88/Compiler.c index a3ea0f88..7e60820e 100644 --- a/bootstrap/unix-88/Compiler.c +++ b/bootstrap/unix-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index 8054febd..38996368 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index da289d26..30cb74e8 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index b1517add..c25fd9fb 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 64602dd6..9434f0cd 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index dac990ab..2951a621 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -68,6 +68,7 @@ static INT64 Heap_freeList[10]; static INT64 Heap_bigBlocks; export INT64 Heap_allocated; static BOOLEAN Heap_firstTry; +static INT16 Heap_ldUnit; export INT64 Heap_heap; static INT64 Heap_heapMin, Heap_heapMax; export INT64 Heap_heapsize; @@ -257,16 +258,16 @@ SYSTEM_PTR Heap_NEWREC (INT64 tag) SYSTEM_PTR new; Heap_Lock(); __GET(tag, blksz, INT64); - i0 = __ASHR(blksz, 5); + i0 = __LSH(blksz, -Heap_ldUnit, 64); i = i0; - if (Heap_uLT(i, 9)) { + if (i < 9) { adr = Heap_freeList[i]; while (adr == 0) { i += 1; adr = Heap_freeList[i]; } } - if (Heap_uLT(i, 9)) { + if (i < 9) { __GET(adr + 24, next, INT64); Heap_freeList[i] = next; if (i != i0) { @@ -289,7 +290,7 @@ SYSTEM_PTR Heap_NEWREC (INT64 tag) if (Heap_firstTry) { Heap_GC(1); blksz += 32; - t = __ASHL(__DIV(Heap_allocated + blksz, 96), 7); + t = __LSHR(Heap_allocated + blksz, 2, 64) * 5; if (Heap_uLT(Heap_heapsize, t)) { Heap_ExtendHeap(t - Heap_heapsize); } @@ -444,7 +445,7 @@ static void Heap_Scan (void) __PUT(start, start + 8, INT64); __PUT(start + 8, freesize, INT64); __PUT(start + 16, -8, INT64); - i = __ASHR(freesize, 5); + i = __LSH(freesize, -Heap_ldUnit, 64); freesize = 0; if (Heap_uLT(i, 9)) { __PUT(start + 24, Heap_freeList[i], INT64); @@ -470,7 +471,7 @@ static void Heap_Scan (void) __PUT(start, start + 8, INT64); __PUT(start + 8, freesize, INT64); __PUT(start + 16, -8, INT64); - i = __ASHR(freesize, 5); + i = __LSH(freesize, -Heap_ldUnit, 64); freesize = 0; if (Heap_uLT(i, 9)) { __PUT(start + 24, Heap_freeList[i], INT64); @@ -757,6 +758,7 @@ void Heap_InitHeap (void) Heap_heapMin = -1; Heap_heapMax = 0; Heap_bigBlocks = 0; + Heap_ldUnit = 5; Heap_heap = Heap_NewChunk(256000); __PUT(Heap_heap, 0, INT64); Heap_firstTry = 1; diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index cb98d8fc..1faa5e4f 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 947bfc0b..3d62c928 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index 77d4cfb2..06b12062 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index a27fa4ca..6b05efda 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index ad9b40c7..fe90c6cf 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index 92219dc5..e1589255 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index dc5cdfc7..e89cf071 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index bb66f347..8daf5373 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index fd042e7f..2b8f8082 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index 77801b58..9178c8e7 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index b4949ef8..e29fd063 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index d98c7f8a..706aa7f6 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index 2ae74912..aaa0e316 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index 58ed2541..cda9a6a5 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index ec74311c..8c448452 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 4186de2e..3b2a324b 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index 8493d416..05057877 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Out.c b/bootstrap/unix-88/Out.c index 0523671f..d471878f 100644 --- a/bootstrap/unix-88/Out.c +++ b/bootstrap/unix-88/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Out.h b/bootstrap/unix-88/Out.h index fb7415a8..a8cec2fe 100644 --- a/bootstrap/unix-88/Out.h +++ b/bootstrap/unix-88/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 193a781b..dbcea6e1 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index a6957766..ec49b926 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 4976039b..a922fa33 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index b1044c30..18363fbb 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index 1cc614c5..bfa49f9a 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index 68cdf219..65b61b6b 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index 5d9a398d..4f8c5dea 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index a35e5e97..d1b30427 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/VT100.c b/bootstrap/unix-88/VT100.c index 76f04f6d..25fcc26d 100644 --- a/bootstrap/unix-88/VT100.c +++ b/bootstrap/unix-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/VT100.h b/bootstrap/unix-88/VT100.h index 812e751b..e97f887c 100644 --- a/bootstrap/unix-88/VT100.h +++ b/bootstrap/unix-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index 90a3382a..3d36c2b5 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index e3ab156a..f4aa7420 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/Compiler.c b/bootstrap/windows-48/Compiler.c index a3ea0f88..7e60820e 100644 --- a/bootstrap/windows-48/Compiler.c +++ b/bootstrap/windows-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index 8054febd..38996368 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index da289d26..30cb74e8 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 8fa17a0c..1cb63e96 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index c2718c5e..846cca0a 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index 66ce19f6..1afb3591 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -68,6 +68,7 @@ static INT32 Heap_freeList[10]; static INT32 Heap_bigBlocks; export INT32 Heap_allocated; static BOOLEAN Heap_firstTry; +static INT16 Heap_ldUnit; export INT32 Heap_heap; static INT32 Heap_heapMin, Heap_heapMax; export INT32 Heap_heapsize; @@ -257,16 +258,16 @@ SYSTEM_PTR Heap_NEWREC (INT32 tag) SYSTEM_PTR new; Heap_Lock(); __GET(tag, blksz, INT32); - i0 = __ASHR(blksz, 4); + i0 = __LSH(blksz, -Heap_ldUnit, 32); i = i0; - if (Heap_uLT(i, 9)) { + if (i < 9) { adr = Heap_freeList[i]; while (adr == 0) { i += 1; adr = Heap_freeList[i]; } } - if (Heap_uLT(i, 9)) { + if (i < 9) { __GET(adr + 12, next, INT32); Heap_freeList[i] = next; if (i != i0) { @@ -289,7 +290,7 @@ SYSTEM_PTR Heap_NEWREC (INT32 tag) if (Heap_firstTry) { Heap_GC(1); blksz += 16; - t = __ASHL(__DIV(Heap_allocated + blksz, 48), 6); + t = __LSHR(Heap_allocated + blksz, 2, 32) * 5; if (Heap_uLT(Heap_heapsize, t)) { Heap_ExtendHeap(t - Heap_heapsize); } @@ -444,7 +445,7 @@ static void Heap_Scan (void) __PUT(start, start + 4, INT32); __PUT(start + 4, freesize, INT32); __PUT(start + 8, -4, INT32); - i = __ASHR(freesize, 4); + i = __LSH(freesize, -Heap_ldUnit, 32); freesize = 0; if (Heap_uLT(i, 9)) { __PUT(start + 12, Heap_freeList[i], INT32); @@ -470,7 +471,7 @@ static void Heap_Scan (void) __PUT(start, start + 4, INT32); __PUT(start + 4, freesize, INT32); __PUT(start + 8, -4, INT32); - i = __ASHR(freesize, 4); + i = __LSH(freesize, -Heap_ldUnit, 32); freesize = 0; if (Heap_uLT(i, 9)) { __PUT(start + 12, Heap_freeList[i], INT32); @@ -757,6 +758,7 @@ void Heap_InitHeap (void) Heap_heapMin = -1; Heap_heapMax = 0; Heap_bigBlocks = 0; + Heap_ldUnit = 4; Heap_heap = Heap_NewChunk(128000); __PUT(Heap_heap, 0, INT32); Heap_firstTry = 1; diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index c6640fd2..dfb69c3b 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index 699bf421..c6b518ca 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index 2adfd91d..b91a4bb6 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index a27fa4ca..6b05efda 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index ad9b40c7..fe90c6cf 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 92219dc5..e1589255 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index dc5cdfc7..e89cf071 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 0cfdc99a..9917bacf 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index fd042e7f..2b8f8082 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index f9a740ff..0f234a0c 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index b4949ef8..e29fd063 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index d98c7f8a..706aa7f6 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index 2ae74912..aaa0e316 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index cf8d3659..28197756 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index ec74311c..8c448452 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index 0965fdba..3726a7a6 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index 8493d416..05057877 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Out.c b/bootstrap/windows-48/Out.c index a9a7495f..9cc9d7e2 100644 --- a/bootstrap/windows-48/Out.c +++ b/bootstrap/windows-48/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Out.h b/bootstrap/windows-48/Out.h index fb7415a8..a8cec2fe 100644 --- a/bootstrap/windows-48/Out.h +++ b/bootstrap/windows-48/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 4c82c9d2..fbad62b2 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index 02a9a0cd..930a74b9 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 4976039b..a922fa33 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index b1044c30..18363fbb 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index 1cc614c5..bfa49f9a 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index 68cdf219..65b61b6b 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index 5eea7749..6526fc8e 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index 6b4d7af2..a13ba9f8 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/VT100.c b/bootstrap/windows-48/VT100.c index 76f04f6d..25fcc26d 100644 --- a/bootstrap/windows-48/VT100.c +++ b/bootstrap/windows-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/VT100.h b/bootstrap/windows-48/VT100.h index 812e751b..e97f887c 100644 --- a/bootstrap/windows-48/VT100.h +++ b/bootstrap/windows-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index 90a3382a..3d36c2b5 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index e3ab156a..f4aa7420 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/Compiler.c b/bootstrap/windows-88/Compiler.c index a3ea0f88..7e60820e 100644 --- a/bootstrap/windows-88/Compiler.c +++ b/bootstrap/windows-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index 8054febd..38996368 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index da289d26..30cb74e8 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 3a25f202..37f1f36f 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 0e8fed90..1777e27f 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index dac990ab..2951a621 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -68,6 +68,7 @@ static INT64 Heap_freeList[10]; static INT64 Heap_bigBlocks; export INT64 Heap_allocated; static BOOLEAN Heap_firstTry; +static INT16 Heap_ldUnit; export INT64 Heap_heap; static INT64 Heap_heapMin, Heap_heapMax; export INT64 Heap_heapsize; @@ -257,16 +258,16 @@ SYSTEM_PTR Heap_NEWREC (INT64 tag) SYSTEM_PTR new; Heap_Lock(); __GET(tag, blksz, INT64); - i0 = __ASHR(blksz, 5); + i0 = __LSH(blksz, -Heap_ldUnit, 64); i = i0; - if (Heap_uLT(i, 9)) { + if (i < 9) { adr = Heap_freeList[i]; while (adr == 0) { i += 1; adr = Heap_freeList[i]; } } - if (Heap_uLT(i, 9)) { + if (i < 9) { __GET(adr + 24, next, INT64); Heap_freeList[i] = next; if (i != i0) { @@ -289,7 +290,7 @@ SYSTEM_PTR Heap_NEWREC (INT64 tag) if (Heap_firstTry) { Heap_GC(1); blksz += 32; - t = __ASHL(__DIV(Heap_allocated + blksz, 96), 7); + t = __LSHR(Heap_allocated + blksz, 2, 64) * 5; if (Heap_uLT(Heap_heapsize, t)) { Heap_ExtendHeap(t - Heap_heapsize); } @@ -444,7 +445,7 @@ static void Heap_Scan (void) __PUT(start, start + 8, INT64); __PUT(start + 8, freesize, INT64); __PUT(start + 16, -8, INT64); - i = __ASHR(freesize, 5); + i = __LSH(freesize, -Heap_ldUnit, 64); freesize = 0; if (Heap_uLT(i, 9)) { __PUT(start + 24, Heap_freeList[i], INT64); @@ -470,7 +471,7 @@ static void Heap_Scan (void) __PUT(start, start + 8, INT64); __PUT(start + 8, freesize, INT64); __PUT(start + 16, -8, INT64); - i = __ASHR(freesize, 5); + i = __LSH(freesize, -Heap_ldUnit, 64); freesize = 0; if (Heap_uLT(i, 9)) { __PUT(start + 24, Heap_freeList[i], INT64); @@ -757,6 +758,7 @@ void Heap_InitHeap (void) Heap_heapMin = -1; Heap_heapMax = 0; Heap_bigBlocks = 0; + Heap_ldUnit = 5; Heap_heap = Heap_NewChunk(256000); __PUT(Heap_heap, 0, INT64); Heap_firstTry = 1; diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index cb98d8fc..1faa5e4f 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index b7ed8754..1833d072 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index 77d4cfb2..06b12062 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index a27fa4ca..6b05efda 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index ad9b40c7..fe90c6cf 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index 92219dc5..e1589255 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index dc5cdfc7..e89cf071 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index bb66f347..8daf5373 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index fd042e7f..2b8f8082 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index 77801b58..9178c8e7 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index b4949ef8..e29fd063 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index d98c7f8a..706aa7f6 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index 2ae74912..aaa0e316 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index 58ed2541..cda9a6a5 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index ec74311c..8c448452 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 4186de2e..3b2a324b 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index 8493d416..05057877 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Out.c b/bootstrap/windows-88/Out.c index a9a7495f..9cc9d7e2 100644 --- a/bootstrap/windows-88/Out.c +++ b/bootstrap/windows-88/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Out.h b/bootstrap/windows-88/Out.h index fb7415a8..a8cec2fe 100644 --- a/bootstrap/windows-88/Out.h +++ b/bootstrap/windows-88/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 404eeb1a..a9c27eea 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index 980e5732..1b83ccd6 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 4976039b..a922fa33 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index b1044c30..18363fbb 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index 1cc614c5..bfa49f9a 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index 68cdf219..65b61b6b 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index 5d9a398d..4f8c5dea 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index a35e5e97..d1b30427 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/VT100.c b/bootstrap/windows-88/VT100.c index 76f04f6d..25fcc26d 100644 --- a/bootstrap/windows-88/VT100.c +++ b/bootstrap/windows-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/VT100.h b/bootstrap/windows-88/VT100.h index 812e751b..e97f887c 100644 --- a/bootstrap/windows-88/VT100.h +++ b/bootstrap/windows-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index 90a3382a..3d36c2b5 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index e3ab156a..f4aa7420 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/22]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h From 265ac23f6e60751a4fcae404e129a4f78e95f7a4 Mon Sep 17 00:00:00 2001 From: David Brown Date: Wed, 28 Dec 2016 13:05:16 +0000 Subject: [PATCH 459/580] Restore 4*Unit heap allocation multiple. --- src/runtime/Heap.Mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runtime/Heap.Mod b/src/runtime/Heap.Mod index f01b9c7b..a3392fa8 100644 --- a/src/runtime/Heap.Mod +++ b/src/runtime/Heap.Mod @@ -270,7 +270,7 @@ MODULE Heap; IF firstTry THEN GC(TRUE); INC(blksz, Unit); (* Anti-thrashing heuristics: ensure 1/5 of the heap will not be allocated. *) - t := S.LSH(allocated + blksz, -2) (*uDIV 4*) * 5 ; (* Minimum preferred heapsize *) + t := S.LSH(allocated + blksz, -(ldUnit+2)) (*uDIV 4*Unit*) * (5*Unit) ; (* Minimum preferred heapsize *) IF uLT(heapsize, t) THEN ExtendHeap(t - heapsize) END; firstTry := FALSE; new := NEWREC(tag); IF new = NIL THEN (* Heap is 1/5 free but fragmentation prevented allocation *) From ee6e5fe7b409720b6b3bc874e4447d57c42ad6f5 Mon Sep 17 00:00:00 2001 From: David Brown Date: Wed, 28 Dec 2016 13:06:10 +0000 Subject: [PATCH 460/580] Update bootstrap C source --- bootstrap/unix-44/Heap.c | 2 +- bootstrap/unix-48/Heap.c | 2 +- bootstrap/unix-88/Heap.c | 2 +- bootstrap/windows-48/Heap.c | 2 +- bootstrap/windows-88/Heap.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index 1afb3591..e1dac3b3 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -290,7 +290,7 @@ SYSTEM_PTR Heap_NEWREC (INT32 tag) if (Heap_firstTry) { Heap_GC(1); blksz += 16; - t = __LSHR(Heap_allocated + blksz, 2, 32) * 5; + t = __LSH(Heap_allocated + blksz, -(Heap_ldUnit + 2), 32) * 80; if (Heap_uLT(Heap_heapsize, t)) { Heap_ExtendHeap(t - Heap_heapsize); } diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index 1afb3591..e1dac3b3 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -290,7 +290,7 @@ SYSTEM_PTR Heap_NEWREC (INT32 tag) if (Heap_firstTry) { Heap_GC(1); blksz += 16; - t = __LSHR(Heap_allocated + blksz, 2, 32) * 5; + t = __LSH(Heap_allocated + blksz, -(Heap_ldUnit + 2), 32) * 80; if (Heap_uLT(Heap_heapsize, t)) { Heap_ExtendHeap(t - Heap_heapsize); } diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index 2951a621..bc1ace8e 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -290,7 +290,7 @@ SYSTEM_PTR Heap_NEWREC (INT64 tag) if (Heap_firstTry) { Heap_GC(1); blksz += 32; - t = __LSHR(Heap_allocated + blksz, 2, 64) * 5; + t = __LSH(Heap_allocated + blksz, -(Heap_ldUnit + 2), 64) * 160; if (Heap_uLT(Heap_heapsize, t)) { Heap_ExtendHeap(t - Heap_heapsize); } diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index 1afb3591..e1dac3b3 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -290,7 +290,7 @@ SYSTEM_PTR Heap_NEWREC (INT32 tag) if (Heap_firstTry) { Heap_GC(1); blksz += 16; - t = __LSHR(Heap_allocated + blksz, 2, 32) * 5; + t = __LSH(Heap_allocated + blksz, -(Heap_ldUnit + 2), 32) * 80; if (Heap_uLT(Heap_heapsize, t)) { Heap_ExtendHeap(t - Heap_heapsize); } diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index 2951a621..bc1ace8e 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -290,7 +290,7 @@ SYSTEM_PTR Heap_NEWREC (INT64 tag) if (Heap_firstTry) { Heap_GC(1); blksz += 32; - t = __LSHR(Heap_allocated + blksz, 2, 64) * 5; + t = __LSH(Heap_allocated + blksz, -(Heap_ldUnit + 2), 64) * 160; if (Heap_uLT(Heap_heapsize, t)) { Heap_ExtendHeap(t - Heap_heapsize); } From 6a20f8f951e6c8c1cf1fcdbe3d37ce559ccdcc6f Mon Sep 17 00:00:00 2001 From: David Brown Date: Wed, 28 Dec 2016 14:47:16 +0000 Subject: [PATCH 461/580] Fix for dynamic library installation. --- src/tools/make/oberon.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tools/make/oberon.mk b/src/tools/make/oberon.mk index 553b02f6..4de7e18b 100644 --- a/src/tools/make/oberon.mk +++ b/src/tools/make/oberon.mk @@ -189,7 +189,7 @@ installable: uninstall: installable @printf '\nUninstalling from \"$(INSTALLDIR)\"\n' rm -rf "$(INSTALLDIR)" - @sh src/tools/make/addlibrary.sh uninstall \""$(INSTALLDIR)/lib"\" $(oname) + @sh src/tools/make/addlibrary.sh uninstall "$(INSTALLDIR)/lib" $(oname) # install: Use only after a successful full build. Installs the compiler @@ -199,7 +199,7 @@ install: uninstall @printf '\nInstalling into \"$(INSTALLDIR)\"\n' @rm -rf "$(INSTALLDIR)" @cp -rf "$(ROOTDIR)/install/" "$(INSTALLDIR)" - @sh src/tools/make/addlibrary.sh install \""$(INSTALLDIR)/lib"\" $(ONAME) + @sh src/tools/make/addlibrary.sh install "$(INSTALLDIR)/lib" $(ONAME) @printf '\nOberon compiler installed to $(INSTALLDIR)\n' @printf '\nNow add $(INSTALLDIR)/bin to your path, for example with the command:\n' @printf 'export PATH=\"$(INSTALLDIR)/bin:$$PATH\"\n' From 0666629e1eb68280191917c5a4afe3e8c6deebc4 Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 29 Dec 2016 15:28:04 +0000 Subject: [PATCH 462/580] J. Templ heap tweaks - improved handling in extreme memory scenarios. --- src/runtime/Heap.Mod | 38 ++++++++++++++++++++++++-------------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/src/runtime/Heap.Mod b/src/runtime/Heap.Mod index a3392fa8..885b4899 100644 --- a/src/runtime/Heap.Mod +++ b/src/runtime/Heap.Mod @@ -10,7 +10,6 @@ MODULE Heap; Unit = 4*SZA; (* Smallest possible heap block *) nofLists = 9; (* Number of freelist entries excluding sentinel *) heapSize0 = 8000*Unit; (* Startup heap size *) - heapMinExpand = 10000*Unit; (* minimum heap expansion size *) (* all blocks look the same: free blocks describe themselves: size = Unit @@ -83,10 +82,11 @@ MODULE Heap; (* extensible heap *) - heap-: S.ADDRESS; (* the sorted list of heap chunks *) - heapMin: S.ADDRESS; (* Range of valid pointer values, used for stack collection *) - heapMax: S.ADDRESS; - heapsize*: S.ADDRESS; (* the sum of all heap chunk sizes *) + heap-: S.ADDRESS; (* the sorted list of heap chunks *) + heapMin: S.ADDRESS; (* Range of valid pointer values, used for stack collection *) + heapMax: S.ADDRESS; + heapsize*: S.ADDRESS; (* the sum of all heap chunk sizes *) + heapMinExpand*: S.ADDRESS; (* minimum heap expansion size *) (* finalization candidates *) fin: FinNode; @@ -213,6 +213,7 @@ MODULE Heap; PROCEDURE ExtendHeap(blksz: S.ADDRESS); VAR size, chnk, j, next: S.ADDRESS; BEGIN + ASSERT(blksz MOD Unit = 0); IF uLT(heapMinExpand, blksz) THEN size := blksz ELSE size := heapMinExpand (* additional heuristics for avoiding many small heap expansions *) END; @@ -229,6 +230,12 @@ MODULE Heap; END; S.PUT(chnk, next); S.PUT(j, chnk) END + ELSIF ~firstTry THEN + (* Heap memory exhausted, i.e. heap is not expanded and NEWREC() will return NIL. + In order to be able to report a trap due to NIL access, there is more + memory needed, which may be available by reducing heapMinExpand. *) + heapMinExpand := Unit + (* ELSE firstTry: ignore failed heap expansion for anti-thrashing heuristics. *) END END ExtendHeap; @@ -270,8 +277,10 @@ MODULE Heap; IF firstTry THEN GC(TRUE); INC(blksz, Unit); (* Anti-thrashing heuristics: ensure 1/5 of the heap will not be allocated. *) - t := S.LSH(allocated + blksz, -(ldUnit+2)) (*uDIV 4*Unit*) * (5*Unit) ; (* Minimum preferred heapsize *) - IF uLT(heapsize, t) THEN ExtendHeap(t - heapsize) END; + t := S.LSH(allocated + blksz, -(2+ldUnit)) (*uDIV 4*Unit*) * (5*Unit) ; (* Minimum preferred heapsize *) + IF uLT(heapsize, t) THEN ExtendHeap(t - heapsize) + (* If there is not enough heap memory then the heap will be expanded below by blksz *) + END; firstTry := FALSE; new := NEWREC(tag); IF new = NIL THEN (* Heap is 1/5 free but fragmentation prevented allocation *) ExtendHeap(blksz); @@ -592,13 +601,14 @@ MODULE Heap; (* InitHeap is called by Platform.init before any module bodies have been initialised, to enable NEW, S.NEW *) BEGIN - heap := 0; - heapsize := 0; - allocated := 0; - lockdepth := 0; - heapMin := -1; (* all bits set *) - heapMax := 0; - bigBlocks := 0; + heap := 0; + heapsize := 0; + allocated := 0; + lockdepth := 0; + heapMin := -1; (* all bits set = max unsigned value *) + heapMax := 0; + bigBlocks := 0; + heapMinExpand := heapSize0; ASSERT((Unit = 16) OR (Unit = 32)); IF Unit = 16 THEN ldUnit := 4 ELSE ldUnit := 5 END; From a4dfd37908faff276bc46f69b5db6a9168674b98 Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 29 Dec 2016 15:30:06 +0000 Subject: [PATCH 463/580] Update bootstrap C source. --- bootstrap/unix-44/Compiler.c | 2 +- bootstrap/unix-44/Configuration.c | 4 ++-- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Files.c | 2 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 13 ++++++++----- bootstrap/unix-44/Heap.h | 4 ++-- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 2 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 2 +- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 2 +- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 2 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Out.c | 2 +- bootstrap/unix-44/Out.h | 2 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/VT100.c | 2 +- bootstrap/unix-44/VT100.h | 2 +- bootstrap/unix-44/extTools.c | 2 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-48/Compiler.c | 2 +- bootstrap/unix-48/Configuration.c | 4 ++-- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Files.c | 2 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 13 ++++++++----- bootstrap/unix-48/Heap.h | 4 ++-- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 2 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 2 +- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 2 +- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 2 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Out.c | 2 +- bootstrap/unix-48/Out.h | 2 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/VT100.c | 2 +- bootstrap/unix-48/VT100.h | 2 +- bootstrap/unix-48/extTools.c | 2 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-88/Compiler.c | 2 +- bootstrap/unix-88/Configuration.c | 4 ++-- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Files.c | 2 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 13 ++++++++----- bootstrap/unix-88/Heap.h | 4 ++-- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 2 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 2 +- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 2 +- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 2 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Out.c | 2 +- bootstrap/unix-88/Out.h | 2 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/VT100.c | 2 +- bootstrap/unix-88/VT100.h | 2 +- bootstrap/unix-88/extTools.c | 2 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/windows-48/Compiler.c | 2 +- bootstrap/windows-48/Configuration.c | 4 ++-- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Files.c | 2 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 13 ++++++++----- bootstrap/windows-48/Heap.h | 4 ++-- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 2 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 2 +- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 2 +- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 2 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Out.c | 2 +- bootstrap/windows-48/Out.h | 2 +- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/VT100.c | 2 +- bootstrap/windows-48/VT100.h | 2 +- bootstrap/windows-48/extTools.c | 2 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-88/Compiler.c | 2 +- bootstrap/windows-88/Configuration.c | 4 ++-- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Files.c | 2 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 13 ++++++++----- bootstrap/windows-88/Heap.h | 4 ++-- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 2 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 2 +- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 2 +- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 2 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Out.c | 2 +- bootstrap/windows-88/Out.h | 2 +- bootstrap/windows-88/Platform.c | 2 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/VT100.c | 2 +- bootstrap/windows-88/VT100.h | 2 +- bootstrap/windows-88/extTools.c | 2 +- bootstrap/windows-88/extTools.h | 2 +- 185 files changed, 230 insertions(+), 215 deletions(-) diff --git a/bootstrap/unix-44/Compiler.c b/bootstrap/unix-44/Compiler.c index 7e60820e..911e21ee 100644 --- a/bootstrap/unix-44/Compiler.c +++ b/bootstrap/unix-44/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index 38996368..04c3e0a2 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index 30cb74e8..4fe31caa 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index a6e0e050..c8e14080 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index 16f28ca6..f6dde2f7 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index e1dac3b3..217e035b 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -71,7 +71,7 @@ static BOOLEAN Heap_firstTry; static INT16 Heap_ldUnit; export INT32 Heap_heap; static INT32 Heap_heapMin, Heap_heapMax; -export INT32 Heap_heapsize; +export INT32 Heap_heapsize, Heap_heapMinExpand; static Heap_FinNode Heap_fin; static INT16 Heap_lockdepth; static BOOLEAN Heap_interrupted; @@ -229,10 +229,10 @@ static INT32 Heap_NewChunk (INT32 blksz) static void Heap_ExtendHeap (INT32 blksz) { INT32 size, chnk, j, next; - if (Heap_uLT(160000, blksz)) { + if (Heap_uLT(Heap_heapMinExpand, blksz)) { size = blksz; } else { - size = 160000; + size = Heap_heapMinExpand; } chnk = Heap_NewChunk(size); if (chnk != 0) { @@ -249,6 +249,8 @@ static void Heap_ExtendHeap (INT32 blksz) __PUT(chnk, next, INT32); __PUT(j, chnk, INT32); } + } else if (!Heap_firstTry) { + Heap_heapMinExpand = 16; } } @@ -290,7 +292,7 @@ SYSTEM_PTR Heap_NEWREC (INT32 tag) if (Heap_firstTry) { Heap_GC(1); blksz += 16; - t = __LSH(Heap_allocated + blksz, -(Heap_ldUnit + 2), 32) * 80; + t = __LSH(Heap_allocated + blksz, -(2 + Heap_ldUnit), 32) * 80; if (Heap_uLT(Heap_heapsize, t)) { Heap_ExtendHeap(t - Heap_heapsize); } @@ -758,6 +760,7 @@ void Heap_InitHeap (void) Heap_heapMin = -1; Heap_heapMax = 0; Heap_bigBlocks = 0; + Heap_heapMinExpand = 128000; Heap_ldUnit = 4; Heap_heap = Heap_NewChunk(128000); __PUT(Heap_heap, 0, INT32); diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index dfb69c3b..d61c3744 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h @@ -48,7 +48,7 @@ typedef import SYSTEM_PTR Heap_modules; import INT32 Heap_allocated; import INT32 Heap_heap; -import INT32 Heap_heapsize; +import INT32 Heap_heapsize, Heap_heapMinExpand; import INT16 Heap_FileCount; import ADDRESS *Heap_ModuleDesc__typ; diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index 9b704eaa..3ff43937 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index b91a4bb6..b368cc1a 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index 6b05efda..59b8d208 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index fe90c6cf..1c809cd1 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index e1589255..404bb438 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index e89cf071..f5c2f02d 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 9917bacf..8c787e94 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index 2b8f8082..625b3bf2 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index 0f234a0c..c4884016 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index e29fd063..dc90a8c8 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index 706aa7f6..0acb8eaa 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index aaa0e316..9bdd4251 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index 18cbbeb1..d23cc38d 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index 8c448452..a45f81b7 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index 3726a7a6..7260ce0d 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index 05057877..c5b53d0d 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Out.c b/bootstrap/unix-44/Out.c index d471878f..6316edf5 100644 --- a/bootstrap/unix-44/Out.c +++ b/bootstrap/unix-44/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Out.h b/bootstrap/unix-44/Out.h index a8cec2fe..0b685b73 100644 --- a/bootstrap/unix-44/Out.h +++ b/bootstrap/unix-44/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 60d8fc27..851cc99e 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index 4bacbebb..9f1d94e2 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index a922fa33..5bb59706 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index 18363fbb..b55f2e0b 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index bfa49f9a..932edba2 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index 65b61b6b..f59925b7 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index ba0e2d5a..92d223fe 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index 1618c9e7..3cd28223 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/VT100.c b/bootstrap/unix-44/VT100.c index 25fcc26d..119ba2ab 100644 --- a/bootstrap/unix-44/VT100.c +++ b/bootstrap/unix-44/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/VT100.h b/bootstrap/unix-44/VT100.h index e97f887c..14d4edd0 100644 --- a/bootstrap/unix-44/VT100.h +++ b/bootstrap/unix-44/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index 3d36c2b5..42332091 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index f4aa7420..f1a5292e 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/Compiler.c b/bootstrap/unix-48/Compiler.c index 7e60820e..911e21ee 100644 --- a/bootstrap/unix-48/Compiler.c +++ b/bootstrap/unix-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index 38996368..04c3e0a2 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index 30cb74e8..4fe31caa 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index a6e0e050..c8e14080 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index 16f28ca6..f6dde2f7 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index e1dac3b3..217e035b 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -71,7 +71,7 @@ static BOOLEAN Heap_firstTry; static INT16 Heap_ldUnit; export INT32 Heap_heap; static INT32 Heap_heapMin, Heap_heapMax; -export INT32 Heap_heapsize; +export INT32 Heap_heapsize, Heap_heapMinExpand; static Heap_FinNode Heap_fin; static INT16 Heap_lockdepth; static BOOLEAN Heap_interrupted; @@ -229,10 +229,10 @@ static INT32 Heap_NewChunk (INT32 blksz) static void Heap_ExtendHeap (INT32 blksz) { INT32 size, chnk, j, next; - if (Heap_uLT(160000, blksz)) { + if (Heap_uLT(Heap_heapMinExpand, blksz)) { size = blksz; } else { - size = 160000; + size = Heap_heapMinExpand; } chnk = Heap_NewChunk(size); if (chnk != 0) { @@ -249,6 +249,8 @@ static void Heap_ExtendHeap (INT32 blksz) __PUT(chnk, next, INT32); __PUT(j, chnk, INT32); } + } else if (!Heap_firstTry) { + Heap_heapMinExpand = 16; } } @@ -290,7 +292,7 @@ SYSTEM_PTR Heap_NEWREC (INT32 tag) if (Heap_firstTry) { Heap_GC(1); blksz += 16; - t = __LSH(Heap_allocated + blksz, -(Heap_ldUnit + 2), 32) * 80; + t = __LSH(Heap_allocated + blksz, -(2 + Heap_ldUnit), 32) * 80; if (Heap_uLT(Heap_heapsize, t)) { Heap_ExtendHeap(t - Heap_heapsize); } @@ -758,6 +760,7 @@ void Heap_InitHeap (void) Heap_heapMin = -1; Heap_heapMax = 0; Heap_bigBlocks = 0; + Heap_heapMinExpand = 128000; Heap_ldUnit = 4; Heap_heap = Heap_NewChunk(128000); __PUT(Heap_heap, 0, INT32); diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index dfb69c3b..d61c3744 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h @@ -48,7 +48,7 @@ typedef import SYSTEM_PTR Heap_modules; import INT32 Heap_allocated; import INT32 Heap_heap; -import INT32 Heap_heapsize; +import INT32 Heap_heapsize, Heap_heapMinExpand; import INT16 Heap_FileCount; import ADDRESS *Heap_ModuleDesc__typ; diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index 9b704eaa..3ff43937 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index b91a4bb6..b368cc1a 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index 6b05efda..59b8d208 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index fe90c6cf..1c809cd1 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index e1589255..404bb438 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index e89cf071..f5c2f02d 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 9917bacf..8c787e94 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index 2b8f8082..625b3bf2 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index 0f234a0c..c4884016 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index e29fd063..dc90a8c8 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index 706aa7f6..0acb8eaa 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index aaa0e316..9bdd4251 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 28197756..b0e1d20d 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index 8c448452..a45f81b7 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index 3726a7a6..7260ce0d 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index 05057877..c5b53d0d 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Out.c b/bootstrap/unix-48/Out.c index d471878f..6316edf5 100644 --- a/bootstrap/unix-48/Out.c +++ b/bootstrap/unix-48/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Out.h b/bootstrap/unix-48/Out.h index a8cec2fe..0b685b73 100644 --- a/bootstrap/unix-48/Out.h +++ b/bootstrap/unix-48/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 60d8fc27..851cc99e 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index 4bacbebb..9f1d94e2 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index a922fa33..5bb59706 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index 18363fbb..b55f2e0b 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index bfa49f9a..932edba2 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index 65b61b6b..f59925b7 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index 6526fc8e..ad27510d 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index a13ba9f8..78bbb622 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/VT100.c b/bootstrap/unix-48/VT100.c index 25fcc26d..119ba2ab 100644 --- a/bootstrap/unix-48/VT100.c +++ b/bootstrap/unix-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/VT100.h b/bootstrap/unix-48/VT100.h index e97f887c..14d4edd0 100644 --- a/bootstrap/unix-48/VT100.h +++ b/bootstrap/unix-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index 3d36c2b5..42332091 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index f4aa7420..f1a5292e 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/Compiler.c b/bootstrap/unix-88/Compiler.c index 7e60820e..911e21ee 100644 --- a/bootstrap/unix-88/Compiler.c +++ b/bootstrap/unix-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index 38996368..04c3e0a2 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index 30cb74e8..4fe31caa 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index c25fd9fb..a82f121a 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 9434f0cd..f9116c3d 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index bc1ace8e..8ed516c2 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -71,7 +71,7 @@ static BOOLEAN Heap_firstTry; static INT16 Heap_ldUnit; export INT64 Heap_heap; static INT64 Heap_heapMin, Heap_heapMax; -export INT64 Heap_heapsize; +export INT64 Heap_heapsize, Heap_heapMinExpand; static Heap_FinNode Heap_fin; static INT16 Heap_lockdepth; static BOOLEAN Heap_interrupted; @@ -229,10 +229,10 @@ static INT64 Heap_NewChunk (INT64 blksz) static void Heap_ExtendHeap (INT64 blksz) { INT64 size, chnk, j, next; - if (Heap_uLT(320000, blksz)) { + if (Heap_uLT(Heap_heapMinExpand, blksz)) { size = blksz; } else { - size = 320000; + size = Heap_heapMinExpand; } chnk = Heap_NewChunk(size); if (chnk != 0) { @@ -249,6 +249,8 @@ static void Heap_ExtendHeap (INT64 blksz) __PUT(chnk, next, INT64); __PUT(j, chnk, INT64); } + } else if (!Heap_firstTry) { + Heap_heapMinExpand = 32; } } @@ -290,7 +292,7 @@ SYSTEM_PTR Heap_NEWREC (INT64 tag) if (Heap_firstTry) { Heap_GC(1); blksz += 32; - t = __LSH(Heap_allocated + blksz, -(Heap_ldUnit + 2), 64) * 160; + t = __LSH(Heap_allocated + blksz, -(2 + Heap_ldUnit), 64) * 160; if (Heap_uLT(Heap_heapsize, t)) { Heap_ExtendHeap(t - Heap_heapsize); } @@ -758,6 +760,7 @@ void Heap_InitHeap (void) Heap_heapMin = -1; Heap_heapMax = 0; Heap_bigBlocks = 0; + Heap_heapMinExpand = 256000; Heap_ldUnit = 5; Heap_heap = Heap_NewChunk(256000); __PUT(Heap_heap, 0, INT64); diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index 1faa5e4f..b22b092f 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h @@ -48,7 +48,7 @@ typedef import SYSTEM_PTR Heap_modules; import INT64 Heap_allocated; import INT64 Heap_heap; -import INT64 Heap_heapsize; +import INT64 Heap_heapsize, Heap_heapMinExpand; import INT16 Heap_FileCount; import ADDRESS *Heap_ModuleDesc__typ; diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 3d62c928..27292d4a 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index 06b12062..0f7357d9 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index 6b05efda..59b8d208 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index fe90c6cf..1c809cd1 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index e1589255..404bb438 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index e89cf071..f5c2f02d 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 8daf5373..48a4f21f 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index 2b8f8082..625b3bf2 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index 9178c8e7..37b0167c 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index e29fd063..dc90a8c8 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index 706aa7f6..0acb8eaa 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index aaa0e316..9bdd4251 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index cda9a6a5..2c62b7b6 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 8c448452..a45f81b7 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 3b2a324b..08c51a1c 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index 05057877..c5b53d0d 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Out.c b/bootstrap/unix-88/Out.c index d471878f..6316edf5 100644 --- a/bootstrap/unix-88/Out.c +++ b/bootstrap/unix-88/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Out.h b/bootstrap/unix-88/Out.h index a8cec2fe..0b685b73 100644 --- a/bootstrap/unix-88/Out.h +++ b/bootstrap/unix-88/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index dbcea6e1..8781ae18 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index ec49b926..68f27069 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index a922fa33..5bb59706 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index 18363fbb..b55f2e0b 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index bfa49f9a..932edba2 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index 65b61b6b..f59925b7 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index 4f8c5dea..6f68a05d 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index d1b30427..a407dbff 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/VT100.c b/bootstrap/unix-88/VT100.c index 25fcc26d..119ba2ab 100644 --- a/bootstrap/unix-88/VT100.c +++ b/bootstrap/unix-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/VT100.h b/bootstrap/unix-88/VT100.h index e97f887c..14d4edd0 100644 --- a/bootstrap/unix-88/VT100.h +++ b/bootstrap/unix-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index 3d36c2b5..42332091 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index f4aa7420..f1a5292e 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/Compiler.c b/bootstrap/windows-48/Compiler.c index 7e60820e..911e21ee 100644 --- a/bootstrap/windows-48/Compiler.c +++ b/bootstrap/windows-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index 38996368..04c3e0a2 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index 30cb74e8..4fe31caa 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 1cb63e96..6cb72707 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index 846cca0a..be215518 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index e1dac3b3..217e035b 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -71,7 +71,7 @@ static BOOLEAN Heap_firstTry; static INT16 Heap_ldUnit; export INT32 Heap_heap; static INT32 Heap_heapMin, Heap_heapMax; -export INT32 Heap_heapsize; +export INT32 Heap_heapsize, Heap_heapMinExpand; static Heap_FinNode Heap_fin; static INT16 Heap_lockdepth; static BOOLEAN Heap_interrupted; @@ -229,10 +229,10 @@ static INT32 Heap_NewChunk (INT32 blksz) static void Heap_ExtendHeap (INT32 blksz) { INT32 size, chnk, j, next; - if (Heap_uLT(160000, blksz)) { + if (Heap_uLT(Heap_heapMinExpand, blksz)) { size = blksz; } else { - size = 160000; + size = Heap_heapMinExpand; } chnk = Heap_NewChunk(size); if (chnk != 0) { @@ -249,6 +249,8 @@ static void Heap_ExtendHeap (INT32 blksz) __PUT(chnk, next, INT32); __PUT(j, chnk, INT32); } + } else if (!Heap_firstTry) { + Heap_heapMinExpand = 16; } } @@ -290,7 +292,7 @@ SYSTEM_PTR Heap_NEWREC (INT32 tag) if (Heap_firstTry) { Heap_GC(1); blksz += 16; - t = __LSH(Heap_allocated + blksz, -(Heap_ldUnit + 2), 32) * 80; + t = __LSH(Heap_allocated + blksz, -(2 + Heap_ldUnit), 32) * 80; if (Heap_uLT(Heap_heapsize, t)) { Heap_ExtendHeap(t - Heap_heapsize); } @@ -758,6 +760,7 @@ void Heap_InitHeap (void) Heap_heapMin = -1; Heap_heapMax = 0; Heap_bigBlocks = 0; + Heap_heapMinExpand = 128000; Heap_ldUnit = 4; Heap_heap = Heap_NewChunk(128000); __PUT(Heap_heap, 0, INT32); diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index dfb69c3b..d61c3744 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h @@ -48,7 +48,7 @@ typedef import SYSTEM_PTR Heap_modules; import INT32 Heap_allocated; import INT32 Heap_heap; -import INT32 Heap_heapsize; +import INT32 Heap_heapsize, Heap_heapMinExpand; import INT16 Heap_FileCount; import ADDRESS *Heap_ModuleDesc__typ; diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index c6b518ca..b00d68e5 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index b91a4bb6..b368cc1a 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index 6b05efda..59b8d208 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index fe90c6cf..1c809cd1 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index e1589255..404bb438 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index e89cf071..f5c2f02d 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 9917bacf..8c787e94 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index 2b8f8082..625b3bf2 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index 0f234a0c..c4884016 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index e29fd063..dc90a8c8 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index 706aa7f6..0acb8eaa 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index aaa0e316..9bdd4251 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 28197756..b0e1d20d 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index 8c448452..a45f81b7 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index 3726a7a6..7260ce0d 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index 05057877..c5b53d0d 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Out.c b/bootstrap/windows-48/Out.c index 9cc9d7e2..c9d24f3b 100644 --- a/bootstrap/windows-48/Out.c +++ b/bootstrap/windows-48/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Out.h b/bootstrap/windows-48/Out.h index a8cec2fe..0b685b73 100644 --- a/bootstrap/windows-48/Out.h +++ b/bootstrap/windows-48/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index fbad62b2..879b566e 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index 930a74b9..c0571816 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index a922fa33..5bb59706 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index 18363fbb..b55f2e0b 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index bfa49f9a..932edba2 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index 65b61b6b..f59925b7 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index 6526fc8e..ad27510d 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index a13ba9f8..78bbb622 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/VT100.c b/bootstrap/windows-48/VT100.c index 25fcc26d..119ba2ab 100644 --- a/bootstrap/windows-48/VT100.c +++ b/bootstrap/windows-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/VT100.h b/bootstrap/windows-48/VT100.h index e97f887c..14d4edd0 100644 --- a/bootstrap/windows-48/VT100.h +++ b/bootstrap/windows-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index 3d36c2b5..42332091 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index f4aa7420..f1a5292e 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/Compiler.c b/bootstrap/windows-88/Compiler.c index 7e60820e..911e21ee 100644 --- a/bootstrap/windows-88/Compiler.c +++ b/bootstrap/windows-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index 38996368..04c3e0a2 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index 30cb74e8..4fe31caa 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 37f1f36f..db896505 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 1777e27f..8805cf88 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index bc1ace8e..8ed516c2 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -71,7 +71,7 @@ static BOOLEAN Heap_firstTry; static INT16 Heap_ldUnit; export INT64 Heap_heap; static INT64 Heap_heapMin, Heap_heapMax; -export INT64 Heap_heapsize; +export INT64 Heap_heapsize, Heap_heapMinExpand; static Heap_FinNode Heap_fin; static INT16 Heap_lockdepth; static BOOLEAN Heap_interrupted; @@ -229,10 +229,10 @@ static INT64 Heap_NewChunk (INT64 blksz) static void Heap_ExtendHeap (INT64 blksz) { INT64 size, chnk, j, next; - if (Heap_uLT(320000, blksz)) { + if (Heap_uLT(Heap_heapMinExpand, blksz)) { size = blksz; } else { - size = 320000; + size = Heap_heapMinExpand; } chnk = Heap_NewChunk(size); if (chnk != 0) { @@ -249,6 +249,8 @@ static void Heap_ExtendHeap (INT64 blksz) __PUT(chnk, next, INT64); __PUT(j, chnk, INT64); } + } else if (!Heap_firstTry) { + Heap_heapMinExpand = 32; } } @@ -290,7 +292,7 @@ SYSTEM_PTR Heap_NEWREC (INT64 tag) if (Heap_firstTry) { Heap_GC(1); blksz += 32; - t = __LSH(Heap_allocated + blksz, -(Heap_ldUnit + 2), 64) * 160; + t = __LSH(Heap_allocated + blksz, -(2 + Heap_ldUnit), 64) * 160; if (Heap_uLT(Heap_heapsize, t)) { Heap_ExtendHeap(t - Heap_heapsize); } @@ -758,6 +760,7 @@ void Heap_InitHeap (void) Heap_heapMin = -1; Heap_heapMax = 0; Heap_bigBlocks = 0; + Heap_heapMinExpand = 256000; Heap_ldUnit = 5; Heap_heap = Heap_NewChunk(256000); __PUT(Heap_heap, 0, INT64); diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index 1faa5e4f..b22b092f 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h @@ -48,7 +48,7 @@ typedef import SYSTEM_PTR Heap_modules; import INT64 Heap_allocated; import INT64 Heap_heap; -import INT64 Heap_heapsize; +import INT64 Heap_heapsize, Heap_heapMinExpand; import INT16 Heap_FileCount; import ADDRESS *Heap_ModuleDesc__typ; diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 1833d072..8e635035 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index 06b12062..0f7357d9 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index 6b05efda..59b8d208 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index fe90c6cf..1c809cd1 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index e1589255..404bb438 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index e89cf071..f5c2f02d 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 8daf5373..48a4f21f 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index 2b8f8082..625b3bf2 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index 9178c8e7..37b0167c 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index e29fd063..dc90a8c8 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index 706aa7f6..0acb8eaa 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index aaa0e316..9bdd4251 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index cda9a6a5..2c62b7b6 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 8c448452..a45f81b7 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 3b2a324b..08c51a1c 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index 05057877..c5b53d0d 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Out.c b/bootstrap/windows-88/Out.c index 9cc9d7e2..c9d24f3b 100644 --- a/bootstrap/windows-88/Out.c +++ b/bootstrap/windows-88/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Out.h b/bootstrap/windows-88/Out.h index a8cec2fe..0b685b73 100644 --- a/bootstrap/windows-88/Out.h +++ b/bootstrap/windows-88/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index a9c27eea..5db8492c 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index 1b83ccd6..950254ed 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index a922fa33..5bb59706 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index 18363fbb..b55f2e0b 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index bfa49f9a..932edba2 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index 65b61b6b..f59925b7 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index 4f8c5dea..6f68a05d 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index d1b30427..a407dbff 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/VT100.c b/bootstrap/windows-88/VT100.c index 25fcc26d..119ba2ab 100644 --- a/bootstrap/windows-88/VT100.c +++ b/bootstrap/windows-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/VT100.h b/bootstrap/windows-88/VT100.h index e97f887c..14d4edd0 100644 --- a/bootstrap/windows-88/VT100.h +++ b/bootstrap/windows-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index 3d36c2b5..42332091 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index f4aa7420..f1a5292e 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h From ba9498b592ec61a9afb6af76028ace96c626fcc5 Mon Sep 17 00:00:00 2001 From: David Brown Date: Sun, 1 Jan 2017 01:27:58 +0000 Subject: [PATCH 464/580] Fix verbose display of gcc command. --- src/compiler/extTools.Mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/extTools.Mod b/src/compiler/extTools.Mod index 98c9fa71..24ea1dc3 100644 --- a/src/compiler/extTools.Mod +++ b/src/compiler/extTools.Mod @@ -11,7 +11,7 @@ PROCEDURE execute(title: ARRAY OF CHAR; cmd: ARRAY OF CHAR); VAR r, status, exitcode: INTEGER; fullcmd: CommandString; BEGIN IF OPM.verbose IN OPM.Options THEN - Out.String(" "); Out.String(fullcmd); Out.Ln + Out.String(" "); Out.String(cmd); Out.Ln END; (* Hack to suppress unwanted filename display by Microsoft C compiler on successful compilations. *) From 284b105c80e5afdae8fe9bbe78b7ef45ade7dcd3 Mon Sep 17 00:00:00 2001 From: David Brown Date: Sun, 1 Jan 2017 01:28:40 +0000 Subject: [PATCH 465/580] Update bootstrap C sources. --- bootstrap/unix-44/Compiler.c | 2 +- bootstrap/unix-44/Configuration.c | 4 ++-- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Files.c | 2 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 2 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 2 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 2 +- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 2 +- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 2 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Out.c | 2 +- bootstrap/unix-44/Out.h | 2 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/VT100.c | 2 +- bootstrap/unix-44/VT100.h | 2 +- bootstrap/unix-44/extTools.c | 4 ++-- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-48/Compiler.c | 2 +- bootstrap/unix-48/Configuration.c | 4 ++-- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Files.c | 2 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 2 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 2 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 2 +- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 2 +- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 2 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Out.c | 2 +- bootstrap/unix-48/Out.h | 2 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/VT100.c | 2 +- bootstrap/unix-48/VT100.h | 2 +- bootstrap/unix-48/extTools.c | 4 ++-- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-88/Compiler.c | 2 +- bootstrap/unix-88/Configuration.c | 4 ++-- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Files.c | 2 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 2 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 2 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 2 +- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 2 +- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 2 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Out.c | 2 +- bootstrap/unix-88/Out.h | 2 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/VT100.c | 2 +- bootstrap/unix-88/VT100.h | 2 +- bootstrap/unix-88/extTools.c | 4 ++-- bootstrap/unix-88/extTools.h | 2 +- bootstrap/windows-48/Compiler.c | 2 +- bootstrap/windows-48/Configuration.c | 4 ++-- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Files.c | 2 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 2 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 2 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 2 +- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 2 +- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 2 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Out.c | 2 +- bootstrap/windows-48/Out.h | 2 +- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/VT100.c | 2 +- bootstrap/windows-48/VT100.h | 2 +- bootstrap/windows-48/extTools.c | 4 ++-- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-88/Compiler.c | 2 +- bootstrap/windows-88/Configuration.c | 4 ++-- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Files.c | 2 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 2 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 2 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 2 +- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 2 +- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 2 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Out.c | 2 +- bootstrap/windows-88/Out.h | 2 +- bootstrap/windows-88/Platform.c | 2 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/VT100.c | 2 +- bootstrap/windows-88/VT100.h | 2 +- bootstrap/windows-88/extTools.c | 4 ++-- bootstrap/windows-88/extTools.h | 2 +- 185 files changed, 195 insertions(+), 195 deletions(-) diff --git a/bootstrap/unix-44/Compiler.c b/bootstrap/unix-44/Compiler.c index 911e21ee..38c8117f 100644 --- a/bootstrap/unix-44/Compiler.c +++ b/bootstrap/unix-44/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index 04c3e0a2..a65d07d6 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index 4fe31caa..72e63747 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index c8e14080..d5fd78c7 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index f6dde2f7..9a0776b1 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index 217e035b..8fc061ff 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index d61c3744..25310ebf 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index 3ff43937..fac280fb 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index b368cc1a..8125a013 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index 59b8d208..3779058a 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index 1c809cd1..086dc5f6 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 404bb438..e9d9a49e 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index f5c2f02d..fdcce95f 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 8c787e94..e475406d 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index 625b3bf2..306f8ede 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index c4884016..bf3d11d5 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index dc90a8c8..ab6ef6cb 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index 0acb8eaa..f77716b2 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index 9bdd4251..f009c3c0 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index d23cc38d..4c2ce30b 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index a45f81b7..305c3ef1 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index 7260ce0d..51336832 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index c5b53d0d..60a80fc3 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Out.c b/bootstrap/unix-44/Out.c index 6316edf5..9d37e527 100644 --- a/bootstrap/unix-44/Out.c +++ b/bootstrap/unix-44/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Out.h b/bootstrap/unix-44/Out.h index 0b685b73..7d83710b 100644 --- a/bootstrap/unix-44/Out.h +++ b/bootstrap/unix-44/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 851cc99e..f5b51345 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index 9f1d94e2..69d52603 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 5bb59706..d73aa742 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index b55f2e0b..439e5203 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index 932edba2..34b0450a 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index f59925b7..04b06545 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index 92d223fe..c8d31144 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index 3cd28223..ca48a032 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/VT100.c b/bootstrap/unix-44/VT100.c index 119ba2ab..436790ae 100644 --- a/bootstrap/unix-44/VT100.c +++ b/bootstrap/unix-44/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/VT100.h b/bootstrap/unix-44/VT100.h index 14d4edd0..d8c8b46f 100644 --- a/bootstrap/unix-44/VT100.h +++ b/bootstrap/unix-44/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index 42332091..ef4097cd 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -35,7 +35,7 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES __DUP(cmd, cmd__len, CHAR); if (__IN(18, OPM_Options, 32)) { Out_String((CHAR*)" ", 3); - Out_String(fullcmd, 4096); + Out_String(cmd, cmd__len); Out_Ln(); } __COPY(cmd, fullcmd, 4096); diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index f1a5292e..f05c741b 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/Compiler.c b/bootstrap/unix-48/Compiler.c index 911e21ee..38c8117f 100644 --- a/bootstrap/unix-48/Compiler.c +++ b/bootstrap/unix-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index 04c3e0a2..a65d07d6 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index 4fe31caa..72e63747 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index c8e14080..d5fd78c7 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index f6dde2f7..9a0776b1 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index 217e035b..8fc061ff 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index d61c3744..25310ebf 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index 3ff43937..fac280fb 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index b368cc1a..8125a013 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index 59b8d208..3779058a 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index 1c809cd1..086dc5f6 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 404bb438..e9d9a49e 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index f5c2f02d..fdcce95f 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 8c787e94..e475406d 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index 625b3bf2..306f8ede 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index c4884016..bf3d11d5 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index dc90a8c8..ab6ef6cb 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index 0acb8eaa..f77716b2 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index 9bdd4251..f009c3c0 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index b0e1d20d..1c073903 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index a45f81b7..305c3ef1 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index 7260ce0d..51336832 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index c5b53d0d..60a80fc3 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Out.c b/bootstrap/unix-48/Out.c index 6316edf5..9d37e527 100644 --- a/bootstrap/unix-48/Out.c +++ b/bootstrap/unix-48/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Out.h b/bootstrap/unix-48/Out.h index 0b685b73..7d83710b 100644 --- a/bootstrap/unix-48/Out.h +++ b/bootstrap/unix-48/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 851cc99e..f5b51345 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index 9f1d94e2..69d52603 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 5bb59706..d73aa742 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index b55f2e0b..439e5203 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index 932edba2..34b0450a 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index f59925b7..04b06545 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index ad27510d..d63c3ed6 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index 78bbb622..7a44b973 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/VT100.c b/bootstrap/unix-48/VT100.c index 119ba2ab..436790ae 100644 --- a/bootstrap/unix-48/VT100.c +++ b/bootstrap/unix-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/VT100.h b/bootstrap/unix-48/VT100.h index 14d4edd0..d8c8b46f 100644 --- a/bootstrap/unix-48/VT100.h +++ b/bootstrap/unix-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index 42332091..ef4097cd 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -35,7 +35,7 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES __DUP(cmd, cmd__len, CHAR); if (__IN(18, OPM_Options, 32)) { Out_String((CHAR*)" ", 3); - Out_String(fullcmd, 4096); + Out_String(cmd, cmd__len); Out_Ln(); } __COPY(cmd, fullcmd, 4096); diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index f1a5292e..f05c741b 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/Compiler.c b/bootstrap/unix-88/Compiler.c index 911e21ee..38c8117f 100644 --- a/bootstrap/unix-88/Compiler.c +++ b/bootstrap/unix-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index 04c3e0a2..a65d07d6 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index 4fe31caa..72e63747 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index a82f121a..4448f8ba 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index f9116c3d..26195611 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index 8ed516c2..27cb83e1 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index b22b092f..f2ead3af 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 27292d4a..9c2d3b1f 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index 0f7357d9..100225d5 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index 59b8d208..3779058a 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index 1c809cd1..086dc5f6 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index 404bb438..e9d9a49e 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index f5c2f02d..fdcce95f 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 48a4f21f..664903f4 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index 625b3bf2..306f8ede 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index 37b0167c..8b9269cb 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index dc90a8c8..ab6ef6cb 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index 0acb8eaa..f77716b2 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index 9bdd4251..f009c3c0 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index 2c62b7b6..19d654e6 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index a45f81b7..305c3ef1 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 08c51a1c..f4b2f0c9 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index c5b53d0d..60a80fc3 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Out.c b/bootstrap/unix-88/Out.c index 6316edf5..9d37e527 100644 --- a/bootstrap/unix-88/Out.c +++ b/bootstrap/unix-88/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Out.h b/bootstrap/unix-88/Out.h index 0b685b73..7d83710b 100644 --- a/bootstrap/unix-88/Out.h +++ b/bootstrap/unix-88/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 8781ae18..344ace71 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index 68f27069..833eff32 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 5bb59706..d73aa742 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index b55f2e0b..439e5203 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index 932edba2..34b0450a 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index f59925b7..04b06545 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index 6f68a05d..51082c36 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index a407dbff..037beccd 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/VT100.c b/bootstrap/unix-88/VT100.c index 119ba2ab..436790ae 100644 --- a/bootstrap/unix-88/VT100.c +++ b/bootstrap/unix-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/VT100.h b/bootstrap/unix-88/VT100.h index 14d4edd0..d8c8b46f 100644 --- a/bootstrap/unix-88/VT100.h +++ b/bootstrap/unix-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index 42332091..ef4097cd 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -35,7 +35,7 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES __DUP(cmd, cmd__len, CHAR); if (__IN(18, OPM_Options, 32)) { Out_String((CHAR*)" ", 3); - Out_String(fullcmd, 4096); + Out_String(cmd, cmd__len); Out_Ln(); } __COPY(cmd, fullcmd, 4096); diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index f1a5292e..f05c741b 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/Compiler.c b/bootstrap/windows-48/Compiler.c index 911e21ee..38c8117f 100644 --- a/bootstrap/windows-48/Compiler.c +++ b/bootstrap/windows-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index 04c3e0a2..a65d07d6 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index 4fe31caa..72e63747 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 6cb72707..bdbed96c 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index be215518..43167fa5 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index 217e035b..8fc061ff 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index d61c3744..25310ebf 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index b00d68e5..60fa4748 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index b368cc1a..8125a013 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index 59b8d208..3779058a 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index 1c809cd1..086dc5f6 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 404bb438..e9d9a49e 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index f5c2f02d..fdcce95f 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 8c787e94..e475406d 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index 625b3bf2..306f8ede 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index c4884016..bf3d11d5 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index dc90a8c8..ab6ef6cb 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index 0acb8eaa..f77716b2 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index 9bdd4251..f009c3c0 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index b0e1d20d..1c073903 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index a45f81b7..305c3ef1 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index 7260ce0d..51336832 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index c5b53d0d..60a80fc3 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Out.c b/bootstrap/windows-48/Out.c index c9d24f3b..3950eb59 100644 --- a/bootstrap/windows-48/Out.c +++ b/bootstrap/windows-48/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Out.h b/bootstrap/windows-48/Out.h index 0b685b73..7d83710b 100644 --- a/bootstrap/windows-48/Out.h +++ b/bootstrap/windows-48/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 879b566e..bc65bec9 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index c0571816..5e2fda7d 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 5bb59706..d73aa742 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index b55f2e0b..439e5203 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index 932edba2..34b0450a 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index f59925b7..04b06545 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index ad27510d..d63c3ed6 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index 78bbb622..7a44b973 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/VT100.c b/bootstrap/windows-48/VT100.c index 119ba2ab..436790ae 100644 --- a/bootstrap/windows-48/VT100.c +++ b/bootstrap/windows-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/VT100.h b/bootstrap/windows-48/VT100.h index 14d4edd0..d8c8b46f 100644 --- a/bootstrap/windows-48/VT100.h +++ b/bootstrap/windows-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index 42332091..ef4097cd 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -35,7 +35,7 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES __DUP(cmd, cmd__len, CHAR); if (__IN(18, OPM_Options, 32)) { Out_String((CHAR*)" ", 3); - Out_String(fullcmd, 4096); + Out_String(cmd, cmd__len); Out_Ln(); } __COPY(cmd, fullcmd, 4096); diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index f1a5292e..f05c741b 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/Compiler.c b/bootstrap/windows-88/Compiler.c index 911e21ee..38c8117f 100644 --- a/bootstrap/windows-88/Compiler.c +++ b/bootstrap/windows-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index 04c3e0a2..a65d07d6 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index 4fe31caa..72e63747 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index db896505..032c4afb 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 8805cf88..66abb2c7 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index 8ed516c2..27cb83e1 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index b22b092f..f2ead3af 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 8e635035..2a55e70b 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index 0f7357d9..100225d5 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index 59b8d208..3779058a 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index 1c809cd1..086dc5f6 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index 404bb438..e9d9a49e 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index f5c2f02d..fdcce95f 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 48a4f21f..664903f4 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index 625b3bf2..306f8ede 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index 37b0167c..8b9269cb 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index dc90a8c8..ab6ef6cb 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index 0acb8eaa..f77716b2 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index 9bdd4251..f009c3c0 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index 2c62b7b6..19d654e6 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index a45f81b7..305c3ef1 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 08c51a1c..f4b2f0c9 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index c5b53d0d..60a80fc3 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Out.c b/bootstrap/windows-88/Out.c index c9d24f3b..3950eb59 100644 --- a/bootstrap/windows-88/Out.c +++ b/bootstrap/windows-88/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Out.h b/bootstrap/windows-88/Out.h index 0b685b73..7d83710b 100644 --- a/bootstrap/windows-88/Out.h +++ b/bootstrap/windows-88/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 5db8492c..3c3b5124 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index 950254ed..e210853f 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 5bb59706..d73aa742 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index b55f2e0b..439e5203 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index 932edba2..34b0450a 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index f59925b7..04b06545 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index 6f68a05d..51082c36 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index a407dbff..037beccd 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/VT100.c b/bootstrap/windows-88/VT100.c index 119ba2ab..436790ae 100644 --- a/bootstrap/windows-88/VT100.c +++ b/bootstrap/windows-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/VT100.h b/bootstrap/windows-88/VT100.h index 14d4edd0..d8c8b46f 100644 --- a/bootstrap/windows-88/VT100.h +++ b/bootstrap/windows-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index 42332091..ef4097cd 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -35,7 +35,7 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES __DUP(cmd, cmd__len, CHAR); if (__IN(18, OPM_Options, 32)) { Out_String((CHAR*)" ", 3); - Out_String(fullcmd, 4096); + Out_String(cmd, cmd__len); Out_Ln(); } __COPY(cmd, fullcmd, 4096); diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index f1a5292e..f05c741b 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2016/12/29]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h From 44d5e0f32501be406f412d1afcf2a3cc2a98857c Mon Sep 17 00:00:00 2001 From: David Brown Date: Mon, 2 Jan 2017 12:00:36 +0000 Subject: [PATCH 466/580] Remove obsolete LDCONFIG env var generation in configure.c --- src/tools/make/configure.c | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/src/tools/make/configure.c b/src/tools/make/configure.c index 6ef80440..f40adf8d 100644 --- a/src/tools/make/configure.c +++ b/src/tools/make/configure.c @@ -43,7 +43,6 @@ char installdir[256]; char versionstring[256]; char osrelease[1024]; char cwd[1024]; -char ldconfig[1024]; // Command(s) to update OS shared library config char libspec[1024]; #define macrotostringhelper(s) #s @@ -195,21 +194,6 @@ void determineInstallDirectory() { -void determineLdconfig() { // Generate appropriate ldconfig command for this OS - if (bsd) { - snprintf(ldconfig, sizeof(ldconfig), "ldconfig -m \"%s/lib\"", installdir); - } else { - snprintf( - ldconfig, sizeof(ldconfig), - "if echo \"%s/lib\" >/etc/ld.so.conf.d/lib%s.conf; then ldconfig; fi", - installdir, oname - ); - } -} - - - - void determineBuildDate() { time_t t = time(0); strftime(builddate, sizeof(builddate), "%Y/%m/%d", localtime(&t)); @@ -394,7 +378,6 @@ void writeMakeParameters() { fprintf(fd, "BINEXT=%s\n", binext); fprintf(fd, "COMPILE=%s\n", cc); fprintf(fd, "STATICLINK=%s\n", staticlink); - fprintf(fd, "LDCONFIG=%s\n", ldconfig); fclose(fd); } @@ -456,7 +439,6 @@ int main(int argc, char *argv[]) determineCDataModel(); determineBuildDate(); determineInstallDirectory(); - determineLdconfig(); testSystemDotH(); From 8063b0c595610a7d108359cb6dd8d7c86af02e51 Mon Sep 17 00:00:00 2001 From: David Brown Date: Wed, 15 Feb 2017 18:34:00 +0000 Subject: [PATCH 467/580] Fix dynamic linking on Mac. Static linking not working. --- src/compiler/extTools.Mod | 17 +++++++++++++++++ src/tools/make/configure.c | 19 ++++++++++--------- src/tools/make/oberon.mk | 2 +- 3 files changed, 28 insertions(+), 10 deletions(-) diff --git a/src/compiler/extTools.Mod b/src/compiler/extTools.Mod index 24ea1dc3..4c9b2c11 100644 --- a/src/compiler/extTools.Mod +++ b/src/compiler/extTools.Mod @@ -89,6 +89,23 @@ PROCEDURE LinkMain*(VAR moduleName: ARRAY OF CHAR; statically: BOOLEAN; addition Strings.Append(OPM.Model, cmd); Strings.Append(Configuration.libext, cmd); execute("C compile and link: ", cmd); + + IF (Configuration.os = "darwin") & ~statically THEN + (* Darwin requires an extra command to set the library directory into the binary *) + cmd := "install_name_tool -change lib"; + Strings.Append(Configuration.name, cmd); + Strings.Append('-O', cmd); + Strings.Append(OPM.Model, cmd); + Strings.Append('.dylib ', cmd); + Strings.Append(OPM.InstallDir, cmd); + Strings.Append('/lib/lib', cmd); + Strings.Append(Configuration.name, cmd); + Strings.Append('-O', cmd); + Strings.Append(OPM.Model, cmd); + Strings.Append('.dylib ', cmd); + Strings.Append(moduleName, cmd); + execute("Set library directory: ", cmd) + END END LinkMain; diff --git a/src/tools/make/configure.c b/src/tools/make/configure.c index f40adf8d..f82a5d37 100644 --- a/src/tools/make/configure.c +++ b/src/tools/make/configure.c @@ -47,14 +47,13 @@ char libspec[1024]; #define macrotostringhelper(s) #s #define macrotostring(s) macrotostringhelper(s) -char *version = macrotostring(O_VER); -char *objext = ".o"; -char *objflag = " -o "; -char *linkflags = " -L\""; -char *libext = ""; -char *oname = NULL; // From O_NAME env var if present, or O_NAME macro otherwise. - - +char *version = macrotostring(O_VER); +char *objext = ".o"; +char *objflag = " -o "; +char *linkflags = " -L\""; +char *libext = ""; +char *oname = NULL; // From O_NAME env var if present, or O_NAME macro otherwise. +char *dynext = ".so"; char *dataModel = NULL; char *compiler = NULL; char *cc = NULL; @@ -114,7 +113,7 @@ void determineOS() { else if (strncasecmp(sys.sysname, "linux", 5) == 0) {determineLinuxVariant();} else if (strncasecmp(sys.sysname, "freebsd", 5) == 0) {os = "freebsd"; bsd = 1;} else if (strncasecmp(sys.sysname, "openbsd", 5) == 0) {os = "openbsd"; bsd = 1;} - else if (strncasecmp(sys.sysname, "darwin", 5) == 0) {os = "darwin"; staticlink = "";} + else if (strncasecmp(sys.sysname, "darwin", 5) == 0) {os = "darwin"; staticlink = ""; dynext = ".dylib";} else { fprintf(stderr, "\n\n** Unrecognised utsname.sysname '%s' returned by uname().\n", sys.sysname); fprintf(stderr, "** Please add a test for this OS in src/buildtools/configure.c\n"); @@ -376,6 +375,7 @@ void writeMakeParameters() { fprintf(fd, "INSTALLDIR=%s\n", installdir); fprintf(fd, "PLATFORM=%s\n", platform); fprintf(fd, "BINEXT=%s\n", binext); + fprintf(fd, "DYNEXT=%s\n", dynext); fprintf(fd, "COMPILE=%s\n", cc); fprintf(fd, "STATICLINK=%s\n", staticlink); fclose(fd); @@ -396,6 +396,7 @@ void writeConfigurationMod() { fprintf(fd, " linkflags* = '%s';\n", linkflags); fprintf(fd, " libspec* = '%s';\n", libspec); fprintf(fd, " libext* = '%s';\n", libext); + fprintf(fd, " os* = '%s';\n", os); fprintf(fd, " compiler* = '%s';\n", compiler); fprintf(fd, " compile* = '%s';\n", cc); fprintf(fd, " installdir* = '%s';\n", installdir); diff --git a/src/tools/make/oberon.mk b/src/tools/make/oberon.mk index 4de7e18b..7f159ce8 100644 --- a/src/tools/make/oberon.mk +++ b/src/tools/make/oberon.mk @@ -386,7 +386,7 @@ library: @make -f src/tools/make/oberon.mk -s O$(MODEL)library MODEL=$(MODEL) @printf '\nMaking lib$(ONAME)-O$(MODEL) .a and .so\n' ar rcs "$(BUILDDIR)/$(MODEL)/lib$(ONAME)-O$(MODEL).a" $(BUILDDIR)/$(MODEL)/*.o - @cd $(BUILDDIR)/$(MODEL) && $(COMPILE) -shared -o lib$(ONAME)-O$(MODEL).so *.o + @cd $(BUILDDIR)/$(MODEL) && $(COMPILE) -shared -o lib$(ONAME)-O$(MODEL)$(DYNEXT) *.o From 5c86750aed335cadc7c775248cfb4de85d47d979 Mon Sep 17 00:00:00 2001 From: David Brown Date: Wed, 15 Feb 2017 18:58:39 +0000 Subject: [PATCH 468/580] Enable Mac static linking. --- src/compiler/extTools.Mod | 37 ++++++++++++++++++++++++------------- 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/src/compiler/extTools.Mod b/src/compiler/extTools.Mod index 4c9b2c11..fdd38e94 100644 --- a/src/compiler/extTools.Mod +++ b/src/compiler/extTools.Mod @@ -73,21 +73,32 @@ PROCEDURE LinkMain*(VAR moduleName: ARRAY OF CHAR; statically: BOOLEAN; addition cmd: CommandString; BEGIN InitialiseCompilerCommand(cmd); - Strings.Append(moduleName, cmd); - Strings.Append(".c ", cmd); - Strings.Append(additionalopts, cmd); + Strings.Append(moduleName, cmd); + Strings.Append(".c ", cmd); + Strings.Append(additionalopts, cmd); IF statically THEN - Strings.Append(Configuration.staticLink, cmd) + IF Configuration.os = "darwin" THEN + Strings.Append(OPM.InstallDir, cmd); + Strings.Append('/lib/lib', cmd); + Strings.Append(Configuration.name, cmd); + Strings.Append('-O', cmd); + Strings.Append(OPM.Model, cmd); + Strings.Append('.a', cmd); + ELSE + Strings.Append(Configuration.staticLink, cmd) + END + END; + Strings.Append(Configuration.objflag, cmd); + Strings.Append(moduleName, cmd); + IF (~statically) OR ~(Configuration.os = "darwin") THEN + Strings.Append(Configuration.linkflags, cmd); + Strings.Append(OPM.InstallDir, cmd); + Strings.Append('/lib"', cmd); + Strings.Append(Configuration.libspec, cmd); + Strings.Append('-O', cmd); + Strings.Append(OPM.Model, cmd); + Strings.Append(Configuration.libext, cmd) END; - Strings.Append(Configuration.objflag, cmd); - Strings.Append(moduleName, cmd); - Strings.Append(Configuration.linkflags, cmd); - Strings.Append(OPM.InstallDir, cmd); - Strings.Append('/lib"', cmd); - Strings.Append(Configuration.libspec, cmd); - Strings.Append('-O', cmd); - Strings.Append(OPM.Model, cmd); - Strings.Append(Configuration.libext, cmd); execute("C compile and link: ", cmd); IF (Configuration.os = "darwin") & ~statically THEN From b5c76a0ee3f3590c1037545504934ac7fad9d61d Mon Sep 17 00:00:00 2001 From: norayr Date: Wed, 21 Jun 2017 20:45:58 +0400 Subject: [PATCH 469/580] implemented In.Real and In.LongReal, unless it'll be implemented better. --- src/runtime/In.Mod | 98 +++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 89 insertions(+), 9 deletions(-) diff --git a/src/runtime/In.Mod b/src/runtime/In.Mod index 873a00d9..7f4c72e3 100644 --- a/src/runtime/In.Mod +++ b/src/runtime/In.Mod @@ -1,6 +1,6 @@ MODULE In; -IMPORT Platform, SYSTEM, Out; +IMPORT Platform, SYSTEM, Reals, Out; VAR Done-: BOOLEAN; @@ -99,14 +99,6 @@ VAR h: HUGEINT; BEGIN HugeInt(h); i := SYSTEM.VAL(LONGINT, h) END LongInt; -PROCEDURE Real*(VAR x: REAL); -BEGIN HALT(99) (* Not implemented *) -END Real; - -PROCEDURE LongReal*(VAR y: LONGREAL); -BEGIN HALT(99) (* Not implemented *) -END LongReal; - PROCEDURE Line*(VAR line: ARRAY OF CHAR); VAR i: INTEGER; BEGIN StartRead; i := 0; Done := readstate = ready; @@ -144,6 +136,94 @@ PROCEDURE Name*(VAR name: ARRAY OF CHAR); (* Read filename. Presumably using she BEGIN HALT(99) (* Not implemented *) END Name; +PROCEDURE StrToReal(s: ARRAY OF CHAR; VAR r: REAL); +VAR p, e: INTEGER; y, g: REAL; neg, negE: BOOLEAN; +BEGIN + p := 0; + WHILE (s[p] = " ") OR (s[p] = "0") DO INC(p) END; + IF s[p] = "-" THEN neg := TRUE; INC(p) ELSE neg := FALSE END; + WHILE (s[p] = " ") OR (s[p] = "0") DO INC(p) END; + + y := 0; + WHILE ("0" <= s[p]) & (s[p] <= "9") DO + y := y * 10 + (ORD(s[p]) - 30H); + INC(p); + END; + IF s[p] = "." THEN + INC(p); g := 1; + WHILE ("0" <= s[p]) & (s[p] <= "9") DO + g := g / 10; y := y + g * (ORD(s[p]) - 30H); + INC(p); + END; + END; + IF (s[p] = "D") OR (s[p] = "E") THEN + INC(p); e := 0; + IF s[p] = "-" THEN negE := TRUE; INC(p) ELSE negE := FALSE END; + WHILE (s[p] = "0") DO INC(p) END; + WHILE ("0" <= s[p]) & (s[p] <= "9") DO + e := e * 10 + (ORD(s[p]) - 30H); + INC(p); + END; + IF negE THEN y := y / Reals.Ten(e) + ELSE y := y * Reals.Ten(e) END; + END; + IF neg THEN y := -y END; + r := y; +END StrToReal; + +PROCEDURE StrToLongReal(s: ARRAY OF CHAR; VAR r: LONGREAL); +VAR p, e: INTEGER; y, g: LONGREAL; neg, negE: BOOLEAN; +BEGIN + p := 0; + WHILE (s[p] = " ") OR (s[p] = "0") DO INC(p) END; + IF s[p] = "-" THEN neg := TRUE; INC(p) ELSE neg := FALSE END; + WHILE (s[p] = " ") OR (s[p] = "0") DO INC(p) END; + + y := 0; + WHILE ("0" <= s[p]) & (s[p] <= "9") DO + y := y * 10 + (ORD(s[p]) - 30H); + INC(p); + END; + IF s[p] = "." THEN + INC(p); g := 1; + WHILE ("0" <= s[p]) & (s[p] <= "9") DO + g := g / 10; y := y + g * (ORD(s[p]) - 30H); + INC(p); + END; + END; + IF (s[p] = "D") OR (s[p] = "E") THEN + INC(p); e := 0; + IF s[p] = "-" THEN negE := TRUE; INC(p) ELSE negE := FALSE END; + WHILE (s[p] = "0") DO INC(p) END; + WHILE ("0" <= s[p]) & (s[p] <= "9") DO + e := e * 10 + (ORD(s[p]) - 30H); + INC(p); + END; + IF negE THEN y := y / Reals.Ten(e) + ELSE y := y * Reals.Ten(e) END; + END; + IF neg THEN y := -y END; + r := y; +END StrToLongReal; + +PROCEDURE Real*(VAR x: REAL); +VAR + str: ARRAY 16 OF CHAR; +BEGIN + Line(str); + StrToReal(str, x); +END Real; + +PROCEDURE LongReal*(VAR y: LONGREAL); +VAR + str: ARRAY 16 OF CHAR; +BEGIN + Line(str); + StrToLongReal(str, y); +END LongReal; + + + BEGIN nextch := 0X; readstate := pending; From 211f69c89aaaa416259d2863ef9a3a5f86ed4614 Mon Sep 17 00:00:00 2001 From: norayr Date: Wed, 21 Jun 2017 20:58:10 +0400 Subject: [PATCH 470/580] moved strtoreal functions to strings module. --- src/runtime/In.Mod | 76 ++-------------------------------------- src/runtime/Strings.Mod | 74 ++++++++++++++++++++++++++++++++++++-- src/tools/make/oberon.mk | 2 +- 3 files changed, 76 insertions(+), 76 deletions(-) diff --git a/src/runtime/In.Mod b/src/runtime/In.Mod index 7f4c72e3..76ceb1e8 100644 --- a/src/runtime/In.Mod +++ b/src/runtime/In.Mod @@ -1,6 +1,6 @@ MODULE In; -IMPORT Platform, SYSTEM, Reals, Out; +IMPORT Platform, SYSTEM, Strings, Out; VAR Done-: BOOLEAN; @@ -136,82 +136,12 @@ PROCEDURE Name*(VAR name: ARRAY OF CHAR); (* Read filename. Presumably using she BEGIN HALT(99) (* Not implemented *) END Name; -PROCEDURE StrToReal(s: ARRAY OF CHAR; VAR r: REAL); -VAR p, e: INTEGER; y, g: REAL; neg, negE: BOOLEAN; -BEGIN - p := 0; - WHILE (s[p] = " ") OR (s[p] = "0") DO INC(p) END; - IF s[p] = "-" THEN neg := TRUE; INC(p) ELSE neg := FALSE END; - WHILE (s[p] = " ") OR (s[p] = "0") DO INC(p) END; - - y := 0; - WHILE ("0" <= s[p]) & (s[p] <= "9") DO - y := y * 10 + (ORD(s[p]) - 30H); - INC(p); - END; - IF s[p] = "." THEN - INC(p); g := 1; - WHILE ("0" <= s[p]) & (s[p] <= "9") DO - g := g / 10; y := y + g * (ORD(s[p]) - 30H); - INC(p); - END; - END; - IF (s[p] = "D") OR (s[p] = "E") THEN - INC(p); e := 0; - IF s[p] = "-" THEN negE := TRUE; INC(p) ELSE negE := FALSE END; - WHILE (s[p] = "0") DO INC(p) END; - WHILE ("0" <= s[p]) & (s[p] <= "9") DO - e := e * 10 + (ORD(s[p]) - 30H); - INC(p); - END; - IF negE THEN y := y / Reals.Ten(e) - ELSE y := y * Reals.Ten(e) END; - END; - IF neg THEN y := -y END; - r := y; -END StrToReal; - -PROCEDURE StrToLongReal(s: ARRAY OF CHAR; VAR r: LONGREAL); -VAR p, e: INTEGER; y, g: LONGREAL; neg, negE: BOOLEAN; -BEGIN - p := 0; - WHILE (s[p] = " ") OR (s[p] = "0") DO INC(p) END; - IF s[p] = "-" THEN neg := TRUE; INC(p) ELSE neg := FALSE END; - WHILE (s[p] = " ") OR (s[p] = "0") DO INC(p) END; - - y := 0; - WHILE ("0" <= s[p]) & (s[p] <= "9") DO - y := y * 10 + (ORD(s[p]) - 30H); - INC(p); - END; - IF s[p] = "." THEN - INC(p); g := 1; - WHILE ("0" <= s[p]) & (s[p] <= "9") DO - g := g / 10; y := y + g * (ORD(s[p]) - 30H); - INC(p); - END; - END; - IF (s[p] = "D") OR (s[p] = "E") THEN - INC(p); e := 0; - IF s[p] = "-" THEN negE := TRUE; INC(p) ELSE negE := FALSE END; - WHILE (s[p] = "0") DO INC(p) END; - WHILE ("0" <= s[p]) & (s[p] <= "9") DO - e := e * 10 + (ORD(s[p]) - 30H); - INC(p); - END; - IF negE THEN y := y / Reals.Ten(e) - ELSE y := y * Reals.Ten(e) END; - END; - IF neg THEN y := -y END; - r := y; -END StrToLongReal; - PROCEDURE Real*(VAR x: REAL); VAR str: ARRAY 16 OF CHAR; BEGIN Line(str); - StrToReal(str, x); + Strings.StrToReal(str, x); END Real; PROCEDURE LongReal*(VAR y: LONGREAL); @@ -219,7 +149,7 @@ VAR str: ARRAY 16 OF CHAR; BEGIN Line(str); - StrToLongReal(str, y); + Strings.StrToLongReal(str, y); END LongReal; diff --git a/src/runtime/Strings.Mod b/src/runtime/Strings.Mod index 0dcfa6d2..89dcaa33 100644 --- a/src/runtime/Strings.Mod +++ b/src/runtime/Strings.Mod @@ -28,8 +28,8 @@ Strings.Cap(s) replaces each lower case letter in s by its upper case equivalent. -------------------------------------------------------------*) (* added from trianus v4 *) -MODULE Strings; (*HM 94-06-22 / *) - +MODULE Strings; (*HM 94-06-22 / *) (* noch 2017-06-21 *) +IMPORT Reals; PROCEDURE Length* (s: ARRAY OF CHAR): INTEGER; VAR i: LONGINT; @@ -153,4 +153,74 @@ BEGIN RETURN M(string, pattern, Length(string)-1, Length(pattern)-1) END Match; +PROCEDURE StrToReal*(s: ARRAY OF CHAR; VAR r: REAL); +VAR p, e: INTEGER; y, g: REAL; neg, negE: BOOLEAN; +BEGIN + p := 0; + WHILE (s[p] = " ") OR (s[p] = "0") DO INC(p) END; + IF s[p] = "-" THEN neg := TRUE; INC(p) ELSE neg := FALSE END; + WHILE (s[p] = " ") OR (s[p] = "0") DO INC(p) END; + + y := 0; + WHILE ("0" <= s[p]) & (s[p] <= "9") DO + y := y * 10 + (ORD(s[p]) - 30H); + INC(p); + END; + IF s[p] = "." THEN + INC(p); g := 1; + WHILE ("0" <= s[p]) & (s[p] <= "9") DO + g := g / 10; y := y + g * (ORD(s[p]) - 30H); + INC(p); + END; + END; + IF (s[p] = "D") OR (s[p] = "E") THEN + INC(p); e := 0; + IF s[p] = "-" THEN negE := TRUE; INC(p) ELSE negE := FALSE END; + WHILE (s[p] = "0") DO INC(p) END; + WHILE ("0" <= s[p]) & (s[p] <= "9") DO + e := e * 10 + (ORD(s[p]) - 30H); + INC(p); + END; + IF negE THEN y := y / Reals.Ten(e) + ELSE y := y * Reals.Ten(e) END; + END; + IF neg THEN y := -y END; + r := y; +END StrToReal; + +PROCEDURE StrToLongReal*(s: ARRAY OF CHAR; VAR r: LONGREAL); +VAR p, e: INTEGER; y, g: LONGREAL; neg, negE: BOOLEAN; +BEGIN + p := 0; + WHILE (s[p] = " ") OR (s[p] = "0") DO INC(p) END; + IF s[p] = "-" THEN neg := TRUE; INC(p) ELSE neg := FALSE END; + WHILE (s[p] = " ") OR (s[p] = "0") DO INC(p) END; + + y := 0; + WHILE ("0" <= s[p]) & (s[p] <= "9") DO + y := y * 10 + (ORD(s[p]) - 30H); + INC(p); + END; + IF s[p] = "." THEN + INC(p); g := 1; + WHILE ("0" <= s[p]) & (s[p] <= "9") DO + g := g / 10; y := y + g * (ORD(s[p]) - 30H); + INC(p); + END; + END; + IF (s[p] = "D") OR (s[p] = "E") THEN + INC(p); e := 0; + IF s[p] = "-" THEN negE := TRUE; INC(p) ELSE negE := FALSE END; + WHILE (s[p] = "0") DO INC(p) END; + WHILE ("0" <= s[p]) & (s[p] <= "9") DO + e := e * 10 + (ORD(s[p]) - 30H); + INC(p); + END; + IF negE THEN y := y / Reals.Ten(e) + ELSE y := y * Reals.Ten(e) END; + END; + IF neg THEN y := -y END; + r := y; +END StrToLongReal; + END Strings. diff --git a/src/tools/make/oberon.mk b/src/tools/make/oberon.mk index 7f159ce8..ca7ac4ef 100644 --- a/src/tools/make/oberon.mk +++ b/src/tools/make/oberon.mk @@ -106,11 +106,11 @@ translate: cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../Configuration.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Platform$(PLATFORM).Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsFapx -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Heap.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Reals.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Strings.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Out.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Modules.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsFx -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Files.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Reals.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Texts.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/VT100.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/OPM.Mod From e626e5c97d66e5d8f79235e5252691b11d4050e3 Mon Sep 17 00:00:00 2001 From: norayr Date: Wed, 21 Jun 2017 21:33:03 +0400 Subject: [PATCH 471/580] updated bootstrap sources. --- bootstrap/unix-44/Compiler.c | 2 +- bootstrap/unix-44/Configuration.c | 4 +- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Files.c | 2 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 2 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 2 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 2 +- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 2 +- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 2 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Out.c | 2 +- bootstrap/unix-44/Out.h | 2 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 130 ++++++++++++++++++++++++++- bootstrap/unix-44/Strings.h | 4 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/VT100.c | 2 +- bootstrap/unix-44/VT100.h | 2 +- bootstrap/unix-44/extTools.c | 20 +++-- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-48/Compiler.c | 2 +- bootstrap/unix-48/Configuration.c | 4 +- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Files.c | 2 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 2 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 2 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 2 +- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 2 +- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 2 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Out.c | 2 +- bootstrap/unix-48/Out.h | 2 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 130 ++++++++++++++++++++++++++- bootstrap/unix-48/Strings.h | 4 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/VT100.c | 2 +- bootstrap/unix-48/VT100.h | 2 +- bootstrap/unix-48/extTools.c | 20 +++-- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-88/Compiler.c | 2 +- bootstrap/unix-88/Configuration.c | 4 +- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Files.c | 2 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 2 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 2 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 2 +- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 2 +- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 2 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Out.c | 2 +- bootstrap/unix-88/Out.h | 2 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 130 ++++++++++++++++++++++++++- bootstrap/unix-88/Strings.h | 4 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/VT100.c | 2 +- bootstrap/unix-88/VT100.h | 2 +- bootstrap/unix-88/extTools.c | 20 +++-- bootstrap/unix-88/extTools.h | 2 +- bootstrap/windows-48/Compiler.c | 2 +- bootstrap/windows-48/Configuration.c | 4 +- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Files.c | 2 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 2 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 2 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 2 +- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 2 +- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 2 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Out.c | 2 +- bootstrap/windows-48/Out.h | 2 +- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 130 ++++++++++++++++++++++++++- bootstrap/windows-48/Strings.h | 4 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/VT100.c | 2 +- bootstrap/windows-48/VT100.h | 2 +- bootstrap/windows-48/extTools.c | 20 +++-- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-88/Compiler.c | 2 +- bootstrap/windows-88/Configuration.c | 4 +- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Files.c | 2 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 2 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 2 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 2 +- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 2 +- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 2 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Out.c | 2 +- bootstrap/windows-88/Out.h | 2 +- bootstrap/windows-88/Platform.c | 2 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 130 ++++++++++++++++++++++++++- bootstrap/windows-88/Strings.h | 4 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/VT100.c | 2 +- bootstrap/windows-88/VT100.h | 2 +- bootstrap/windows-88/extTools.c | 20 +++-- bootstrap/windows-88/extTools.h | 2 +- 185 files changed, 890 insertions(+), 230 deletions(-) diff --git a/bootstrap/unix-44/Compiler.c b/bootstrap/unix-44/Compiler.c index 38c8117f..2e1f73ec 100644 --- a/bootstrap/unix-44/Compiler.c +++ b/bootstrap/unix-44/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index a65d07d6..37d129c0 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index 72e63747..76f70d82 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index d5fd78c7..15f181ca 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index 9a0776b1..9825b66f 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index 8fc061ff..29215cc6 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index 25310ebf..3a5b2ec6 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index fac280fb..8d1f2adc 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index 8125a013..510a957f 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index 3779058a..4e5d8bb0 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index 086dc5f6..23d08ad2 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index e9d9a49e..664d96fb 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index fdcce95f..26ce2529 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index e475406d..77be12d2 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index 306f8ede..64e0b231 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index bf3d11d5..09556118 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index ab6ef6cb..dd80e8ba 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index f77716b2..00989b7b 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index f009c3c0..89f48bc6 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index 4c2ce30b..795ce5e8 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index 305c3ef1..d17422b2 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index 51336832..bd91910e 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index 60a80fc3..ebff1e8c 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Out.c b/bootstrap/unix-44/Out.c index 9d37e527..6ca1811b 100644 --- a/bootstrap/unix-44/Out.c +++ b/bootstrap/unix-44/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Out.h b/bootstrap/unix-44/Out.h index 7d83710b..d2b1d882 100644 --- a/bootstrap/unix-44/Out.h +++ b/bootstrap/unix-44/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index f5b51345..3adf3084 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index 69d52603..975922f3 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index d73aa742..820a2ba7 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index 439e5203..9a2fca64 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index 34b0450a..925d8de0 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -6,6 +6,7 @@ #define SET UINT32 #include "SYSTEM.h" +#include "Reals.h" @@ -19,6 +20,8 @@ export INT16 Strings_Length (CHAR *s, ADDRESS s__len); export BOOLEAN Strings_Match (CHAR *string, ADDRESS string__len, CHAR *pattern, ADDRESS pattern__len); export INT16 Strings_Pos (CHAR *pattern, ADDRESS pattern__len, CHAR *s, ADDRESS s__len, INT16 pos); export void Strings_Replace (CHAR *source, ADDRESS source__len, INT16 pos, CHAR *dest, ADDRESS dest__len); +export void Strings_StrToLongReal (CHAR *s, ADDRESS s__len, LONGREAL *r); +export void Strings_StrToReal (CHAR *s, ADDRESS s__len, REAL *r); INT16 Strings_Length (CHAR *s, ADDRESS s__len) @@ -236,10 +239,135 @@ BOOLEAN Strings_Match (CHAR *string, ADDRESS string__len, CHAR *pattern, ADDRESS return __retval; } +void Strings_StrToReal (CHAR *s, ADDRESS s__len, REAL *r) +{ + INT16 p, e; + REAL y, g; + BOOLEAN neg, negE; + __DUP(s, s__len, CHAR); + p = 0; + while (s[__X(p, s__len)] == ' ' || s[__X(p, s__len)] == '0') { + p += 1; + } + if (s[__X(p, s__len)] == '-') { + neg = 1; + p += 1; + } else { + neg = 0; + } + while (s[__X(p, s__len)] == ' ' || s[__X(p, s__len)] == '0') { + p += 1; + } + y = (REAL)0; + while (('0' <= s[__X(p, s__len)] && s[__X(p, s__len)] <= '9')) { + y = y * (REAL)10 + ((INT16)s[__X(p, s__len)] - 48); + p += 1; + } + if (s[__X(p, s__len)] == '.') { + p += 1; + g = (REAL)1; + while (('0' <= s[__X(p, s__len)] && s[__X(p, s__len)] <= '9')) { + g = g / (REAL)(REAL)10; + y = y + g * ((INT16)s[__X(p, s__len)] - 48); + p += 1; + } + } + if (s[__X(p, s__len)] == 'D' || s[__X(p, s__len)] == 'E') { + p += 1; + e = 0; + if (s[__X(p, s__len)] == '-') { + negE = 1; + p += 1; + } else { + negE = 0; + } + while (s[__X(p, s__len)] == '0') { + p += 1; + } + while (('0' <= s[__X(p, s__len)] && s[__X(p, s__len)] <= '9')) { + e = e * 10 + ((INT16)s[__X(p, s__len)] - 48); + p += 1; + } + if (negE) { + y = y / (REAL)Reals_Ten(e); + } else { + y = y * Reals_Ten(e); + } + } + if (neg) { + y = -y; + } + *r = y; + __DEL(s); +} + +void Strings_StrToLongReal (CHAR *s, ADDRESS s__len, LONGREAL *r) +{ + INT16 p, e; + LONGREAL y, g; + BOOLEAN neg, negE; + __DUP(s, s__len, CHAR); + p = 0; + while (s[__X(p, s__len)] == ' ' || s[__X(p, s__len)] == '0') { + p += 1; + } + if (s[__X(p, s__len)] == '-') { + neg = 1; + p += 1; + } else { + neg = 0; + } + while (s[__X(p, s__len)] == ' ' || s[__X(p, s__len)] == '0') { + p += 1; + } + y = (LONGREAL)0; + while (('0' <= s[__X(p, s__len)] && s[__X(p, s__len)] <= '9')) { + y = y * (LONGREAL)10 + ((INT16)s[__X(p, s__len)] - 48); + p += 1; + } + if (s[__X(p, s__len)] == '.') { + p += 1; + g = (LONGREAL)1; + while (('0' <= s[__X(p, s__len)] && s[__X(p, s__len)] <= '9')) { + g = g / (LONGREAL)(LONGREAL)10; + y = y + g * ((INT16)s[__X(p, s__len)] - 48); + p += 1; + } + } + if (s[__X(p, s__len)] == 'D' || s[__X(p, s__len)] == 'E') { + p += 1; + e = 0; + if (s[__X(p, s__len)] == '-') { + negE = 1; + p += 1; + } else { + negE = 0; + } + while (s[__X(p, s__len)] == '0') { + p += 1; + } + while (('0' <= s[__X(p, s__len)] && s[__X(p, s__len)] <= '9')) { + e = e * 10 + ((INT16)s[__X(p, s__len)] - 48); + p += 1; + } + if (negE) { + y = y / (LONGREAL)Reals_Ten(e); + } else { + y = y * Reals_Ten(e); + } + } + if (neg) { + y = -y; + } + *r = y; + __DEL(s); +} + export void *Strings__init(void) { __DEFMOD; + __MODULE_IMPORT(Reals); __REGMOD("Strings", 0); /* BEGIN */ __ENDMOD; diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index 04b06545..f88aeb04 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h @@ -17,6 +17,8 @@ import INT16 Strings_Length (CHAR *s, ADDRESS s__len); import BOOLEAN Strings_Match (CHAR *string, ADDRESS string__len, CHAR *pattern, ADDRESS pattern__len); import INT16 Strings_Pos (CHAR *pattern, ADDRESS pattern__len, CHAR *s, ADDRESS s__len, INT16 pos); import void Strings_Replace (CHAR *source, ADDRESS source__len, INT16 pos, CHAR *dest, ADDRESS dest__len); +import void Strings_StrToLongReal (CHAR *s, ADDRESS s__len, LONGREAL *r); +import void Strings_StrToReal (CHAR *s, ADDRESS s__len, REAL *r); import void *Strings__init(void); diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index c8d31144..05dd7063 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index ca48a032..965d36bd 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/VT100.c b/bootstrap/unix-44/VT100.c index 436790ae..40b79e32 100644 --- a/bootstrap/unix-44/VT100.c +++ b/bootstrap/unix-44/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/VT100.h b/bootstrap/unix-44/VT100.h index d8c8b46f..1e79747a 100644 --- a/bootstrap/unix-44/VT100.h +++ b/bootstrap/unix-44/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index ef4097cd..6bfa4550 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -72,7 +72,7 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) { - __COPY("gcc -g", s, s__len); + __COPY("gcc -fPIC -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); @@ -106,13 +106,15 @@ void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN stati } Strings_Append((CHAR*)" -o ", 5, (void*)cmd, 4096); Strings_Append(moduleName, moduleName__len, (void*)cmd, 4096); - Strings_Append((CHAR*)" -L\"", 5, (void*)cmd, 4096); - Strings_Append(OPM_InstallDir, 1024, (void*)cmd, 4096); - Strings_Append((CHAR*)"/lib\"", 6, (void*)cmd, 4096); - Strings_Append((CHAR*)" -l voc", 8, (void*)cmd, 4096); - Strings_Append((CHAR*)"-O", 3, (void*)cmd, 4096); - Strings_Append(OPM_Model, 10, (void*)cmd, 4096); - Strings_Append((CHAR*)"", 1, (void*)cmd, 4096); + if (!statically || 1) { + Strings_Append((CHAR*)" -L\"", 5, (void*)cmd, 4096); + Strings_Append(OPM_InstallDir, 1024, (void*)cmd, 4096); + Strings_Append((CHAR*)"/lib\"", 6, (void*)cmd, 4096); + Strings_Append((CHAR*)" -l voc", 8, (void*)cmd, 4096); + Strings_Append((CHAR*)"-O", 3, (void*)cmd, 4096); + Strings_Append(OPM_Model, 10, (void*)cmd, 4096); + Strings_Append((CHAR*)"", 1, (void*)cmd, 4096); + } extTools_execute((CHAR*)"C compile and link: ", 21, cmd, 4096); __DEL(additionalopts); } diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index f05c741b..6969521d 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/Compiler.c b/bootstrap/unix-48/Compiler.c index 38c8117f..2e1f73ec 100644 --- a/bootstrap/unix-48/Compiler.c +++ b/bootstrap/unix-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index a65d07d6..37d129c0 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index 72e63747..76f70d82 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index d5fd78c7..15f181ca 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index 9a0776b1..9825b66f 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index 8fc061ff..29215cc6 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index 25310ebf..3a5b2ec6 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index fac280fb..8d1f2adc 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index 8125a013..510a957f 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index 3779058a..4e5d8bb0 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index 086dc5f6..23d08ad2 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index e9d9a49e..664d96fb 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index fdcce95f..26ce2529 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index e475406d..77be12d2 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index 306f8ede..64e0b231 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index bf3d11d5..09556118 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index ab6ef6cb..dd80e8ba 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index f77716b2..00989b7b 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index f009c3c0..89f48bc6 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 1c073903..bade5779 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index 305c3ef1..d17422b2 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index 51336832..bd91910e 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index 60a80fc3..ebff1e8c 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Out.c b/bootstrap/unix-48/Out.c index 9d37e527..6ca1811b 100644 --- a/bootstrap/unix-48/Out.c +++ b/bootstrap/unix-48/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Out.h b/bootstrap/unix-48/Out.h index 7d83710b..d2b1d882 100644 --- a/bootstrap/unix-48/Out.h +++ b/bootstrap/unix-48/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index f5b51345..3adf3084 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index 69d52603..975922f3 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index d73aa742..820a2ba7 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index 439e5203..9a2fca64 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index 34b0450a..925d8de0 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -6,6 +6,7 @@ #define SET UINT32 #include "SYSTEM.h" +#include "Reals.h" @@ -19,6 +20,8 @@ export INT16 Strings_Length (CHAR *s, ADDRESS s__len); export BOOLEAN Strings_Match (CHAR *string, ADDRESS string__len, CHAR *pattern, ADDRESS pattern__len); export INT16 Strings_Pos (CHAR *pattern, ADDRESS pattern__len, CHAR *s, ADDRESS s__len, INT16 pos); export void Strings_Replace (CHAR *source, ADDRESS source__len, INT16 pos, CHAR *dest, ADDRESS dest__len); +export void Strings_StrToLongReal (CHAR *s, ADDRESS s__len, LONGREAL *r); +export void Strings_StrToReal (CHAR *s, ADDRESS s__len, REAL *r); INT16 Strings_Length (CHAR *s, ADDRESS s__len) @@ -236,10 +239,135 @@ BOOLEAN Strings_Match (CHAR *string, ADDRESS string__len, CHAR *pattern, ADDRESS return __retval; } +void Strings_StrToReal (CHAR *s, ADDRESS s__len, REAL *r) +{ + INT16 p, e; + REAL y, g; + BOOLEAN neg, negE; + __DUP(s, s__len, CHAR); + p = 0; + while (s[__X(p, s__len)] == ' ' || s[__X(p, s__len)] == '0') { + p += 1; + } + if (s[__X(p, s__len)] == '-') { + neg = 1; + p += 1; + } else { + neg = 0; + } + while (s[__X(p, s__len)] == ' ' || s[__X(p, s__len)] == '0') { + p += 1; + } + y = (REAL)0; + while (('0' <= s[__X(p, s__len)] && s[__X(p, s__len)] <= '9')) { + y = y * (REAL)10 + ((INT16)s[__X(p, s__len)] - 48); + p += 1; + } + if (s[__X(p, s__len)] == '.') { + p += 1; + g = (REAL)1; + while (('0' <= s[__X(p, s__len)] && s[__X(p, s__len)] <= '9')) { + g = g / (REAL)(REAL)10; + y = y + g * ((INT16)s[__X(p, s__len)] - 48); + p += 1; + } + } + if (s[__X(p, s__len)] == 'D' || s[__X(p, s__len)] == 'E') { + p += 1; + e = 0; + if (s[__X(p, s__len)] == '-') { + negE = 1; + p += 1; + } else { + negE = 0; + } + while (s[__X(p, s__len)] == '0') { + p += 1; + } + while (('0' <= s[__X(p, s__len)] && s[__X(p, s__len)] <= '9')) { + e = e * 10 + ((INT16)s[__X(p, s__len)] - 48); + p += 1; + } + if (negE) { + y = y / (REAL)Reals_Ten(e); + } else { + y = y * Reals_Ten(e); + } + } + if (neg) { + y = -y; + } + *r = y; + __DEL(s); +} + +void Strings_StrToLongReal (CHAR *s, ADDRESS s__len, LONGREAL *r) +{ + INT16 p, e; + LONGREAL y, g; + BOOLEAN neg, negE; + __DUP(s, s__len, CHAR); + p = 0; + while (s[__X(p, s__len)] == ' ' || s[__X(p, s__len)] == '0') { + p += 1; + } + if (s[__X(p, s__len)] == '-') { + neg = 1; + p += 1; + } else { + neg = 0; + } + while (s[__X(p, s__len)] == ' ' || s[__X(p, s__len)] == '0') { + p += 1; + } + y = (LONGREAL)0; + while (('0' <= s[__X(p, s__len)] && s[__X(p, s__len)] <= '9')) { + y = y * (LONGREAL)10 + ((INT16)s[__X(p, s__len)] - 48); + p += 1; + } + if (s[__X(p, s__len)] == '.') { + p += 1; + g = (LONGREAL)1; + while (('0' <= s[__X(p, s__len)] && s[__X(p, s__len)] <= '9')) { + g = g / (LONGREAL)(LONGREAL)10; + y = y + g * ((INT16)s[__X(p, s__len)] - 48); + p += 1; + } + } + if (s[__X(p, s__len)] == 'D' || s[__X(p, s__len)] == 'E') { + p += 1; + e = 0; + if (s[__X(p, s__len)] == '-') { + negE = 1; + p += 1; + } else { + negE = 0; + } + while (s[__X(p, s__len)] == '0') { + p += 1; + } + while (('0' <= s[__X(p, s__len)] && s[__X(p, s__len)] <= '9')) { + e = e * 10 + ((INT16)s[__X(p, s__len)] - 48); + p += 1; + } + if (negE) { + y = y / (LONGREAL)Reals_Ten(e); + } else { + y = y * Reals_Ten(e); + } + } + if (neg) { + y = -y; + } + *r = y; + __DEL(s); +} + export void *Strings__init(void) { __DEFMOD; + __MODULE_IMPORT(Reals); __REGMOD("Strings", 0); /* BEGIN */ __ENDMOD; diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index 04b06545..f88aeb04 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h @@ -17,6 +17,8 @@ import INT16 Strings_Length (CHAR *s, ADDRESS s__len); import BOOLEAN Strings_Match (CHAR *string, ADDRESS string__len, CHAR *pattern, ADDRESS pattern__len); import INT16 Strings_Pos (CHAR *pattern, ADDRESS pattern__len, CHAR *s, ADDRESS s__len, INT16 pos); import void Strings_Replace (CHAR *source, ADDRESS source__len, INT16 pos, CHAR *dest, ADDRESS dest__len); +import void Strings_StrToLongReal (CHAR *s, ADDRESS s__len, LONGREAL *r); +import void Strings_StrToReal (CHAR *s, ADDRESS s__len, REAL *r); import void *Strings__init(void); diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index d63c3ed6..b1559a2e 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index 7a44b973..bbc925ac 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/VT100.c b/bootstrap/unix-48/VT100.c index 436790ae..40b79e32 100644 --- a/bootstrap/unix-48/VT100.c +++ b/bootstrap/unix-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/VT100.h b/bootstrap/unix-48/VT100.h index d8c8b46f..1e79747a 100644 --- a/bootstrap/unix-48/VT100.h +++ b/bootstrap/unix-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index ef4097cd..6bfa4550 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -72,7 +72,7 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) { - __COPY("gcc -g", s, s__len); + __COPY("gcc -fPIC -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); @@ -106,13 +106,15 @@ void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN stati } Strings_Append((CHAR*)" -o ", 5, (void*)cmd, 4096); Strings_Append(moduleName, moduleName__len, (void*)cmd, 4096); - Strings_Append((CHAR*)" -L\"", 5, (void*)cmd, 4096); - Strings_Append(OPM_InstallDir, 1024, (void*)cmd, 4096); - Strings_Append((CHAR*)"/lib\"", 6, (void*)cmd, 4096); - Strings_Append((CHAR*)" -l voc", 8, (void*)cmd, 4096); - Strings_Append((CHAR*)"-O", 3, (void*)cmd, 4096); - Strings_Append(OPM_Model, 10, (void*)cmd, 4096); - Strings_Append((CHAR*)"", 1, (void*)cmd, 4096); + if (!statically || 1) { + Strings_Append((CHAR*)" -L\"", 5, (void*)cmd, 4096); + Strings_Append(OPM_InstallDir, 1024, (void*)cmd, 4096); + Strings_Append((CHAR*)"/lib\"", 6, (void*)cmd, 4096); + Strings_Append((CHAR*)" -l voc", 8, (void*)cmd, 4096); + Strings_Append((CHAR*)"-O", 3, (void*)cmd, 4096); + Strings_Append(OPM_Model, 10, (void*)cmd, 4096); + Strings_Append((CHAR*)"", 1, (void*)cmd, 4096); + } extTools_execute((CHAR*)"C compile and link: ", 21, cmd, 4096); __DEL(additionalopts); } diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index f05c741b..6969521d 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/Compiler.c b/bootstrap/unix-88/Compiler.c index 38c8117f..2e1f73ec 100644 --- a/bootstrap/unix-88/Compiler.c +++ b/bootstrap/unix-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index a65d07d6..37d129c0 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index 72e63747..76f70d82 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 4448f8ba..b387e012 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 26195611..c0394624 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index 27cb83e1..12ba9904 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index f2ead3af..e7fb51b1 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 9c2d3b1f..a3a7a868 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index 100225d5..2a213809 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index 3779058a..4e5d8bb0 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index 086dc5f6..23d08ad2 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index e9d9a49e..664d96fb 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index fdcce95f..26ce2529 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 664903f4..c439d70d 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index 306f8ede..64e0b231 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index 8b9269cb..e03ef961 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index ab6ef6cb..dd80e8ba 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index f77716b2..00989b7b 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index f009c3c0..89f48bc6 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index 19d654e6..675711ee 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 305c3ef1..d17422b2 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index f4b2f0c9..9255cad8 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index 60a80fc3..ebff1e8c 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Out.c b/bootstrap/unix-88/Out.c index 9d37e527..6ca1811b 100644 --- a/bootstrap/unix-88/Out.c +++ b/bootstrap/unix-88/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Out.h b/bootstrap/unix-88/Out.h index 7d83710b..d2b1d882 100644 --- a/bootstrap/unix-88/Out.h +++ b/bootstrap/unix-88/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 344ace71..0100e778 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index 833eff32..609b0969 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index d73aa742..820a2ba7 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index 439e5203..9a2fca64 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index 34b0450a..925d8de0 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -6,6 +6,7 @@ #define SET UINT32 #include "SYSTEM.h" +#include "Reals.h" @@ -19,6 +20,8 @@ export INT16 Strings_Length (CHAR *s, ADDRESS s__len); export BOOLEAN Strings_Match (CHAR *string, ADDRESS string__len, CHAR *pattern, ADDRESS pattern__len); export INT16 Strings_Pos (CHAR *pattern, ADDRESS pattern__len, CHAR *s, ADDRESS s__len, INT16 pos); export void Strings_Replace (CHAR *source, ADDRESS source__len, INT16 pos, CHAR *dest, ADDRESS dest__len); +export void Strings_StrToLongReal (CHAR *s, ADDRESS s__len, LONGREAL *r); +export void Strings_StrToReal (CHAR *s, ADDRESS s__len, REAL *r); INT16 Strings_Length (CHAR *s, ADDRESS s__len) @@ -236,10 +239,135 @@ BOOLEAN Strings_Match (CHAR *string, ADDRESS string__len, CHAR *pattern, ADDRESS return __retval; } +void Strings_StrToReal (CHAR *s, ADDRESS s__len, REAL *r) +{ + INT16 p, e; + REAL y, g; + BOOLEAN neg, negE; + __DUP(s, s__len, CHAR); + p = 0; + while (s[__X(p, s__len)] == ' ' || s[__X(p, s__len)] == '0') { + p += 1; + } + if (s[__X(p, s__len)] == '-') { + neg = 1; + p += 1; + } else { + neg = 0; + } + while (s[__X(p, s__len)] == ' ' || s[__X(p, s__len)] == '0') { + p += 1; + } + y = (REAL)0; + while (('0' <= s[__X(p, s__len)] && s[__X(p, s__len)] <= '9')) { + y = y * (REAL)10 + ((INT16)s[__X(p, s__len)] - 48); + p += 1; + } + if (s[__X(p, s__len)] == '.') { + p += 1; + g = (REAL)1; + while (('0' <= s[__X(p, s__len)] && s[__X(p, s__len)] <= '9')) { + g = g / (REAL)(REAL)10; + y = y + g * ((INT16)s[__X(p, s__len)] - 48); + p += 1; + } + } + if (s[__X(p, s__len)] == 'D' || s[__X(p, s__len)] == 'E') { + p += 1; + e = 0; + if (s[__X(p, s__len)] == '-') { + negE = 1; + p += 1; + } else { + negE = 0; + } + while (s[__X(p, s__len)] == '0') { + p += 1; + } + while (('0' <= s[__X(p, s__len)] && s[__X(p, s__len)] <= '9')) { + e = e * 10 + ((INT16)s[__X(p, s__len)] - 48); + p += 1; + } + if (negE) { + y = y / (REAL)Reals_Ten(e); + } else { + y = y * Reals_Ten(e); + } + } + if (neg) { + y = -y; + } + *r = y; + __DEL(s); +} + +void Strings_StrToLongReal (CHAR *s, ADDRESS s__len, LONGREAL *r) +{ + INT16 p, e; + LONGREAL y, g; + BOOLEAN neg, negE; + __DUP(s, s__len, CHAR); + p = 0; + while (s[__X(p, s__len)] == ' ' || s[__X(p, s__len)] == '0') { + p += 1; + } + if (s[__X(p, s__len)] == '-') { + neg = 1; + p += 1; + } else { + neg = 0; + } + while (s[__X(p, s__len)] == ' ' || s[__X(p, s__len)] == '0') { + p += 1; + } + y = (LONGREAL)0; + while (('0' <= s[__X(p, s__len)] && s[__X(p, s__len)] <= '9')) { + y = y * (LONGREAL)10 + ((INT16)s[__X(p, s__len)] - 48); + p += 1; + } + if (s[__X(p, s__len)] == '.') { + p += 1; + g = (LONGREAL)1; + while (('0' <= s[__X(p, s__len)] && s[__X(p, s__len)] <= '9')) { + g = g / (LONGREAL)(LONGREAL)10; + y = y + g * ((INT16)s[__X(p, s__len)] - 48); + p += 1; + } + } + if (s[__X(p, s__len)] == 'D' || s[__X(p, s__len)] == 'E') { + p += 1; + e = 0; + if (s[__X(p, s__len)] == '-') { + negE = 1; + p += 1; + } else { + negE = 0; + } + while (s[__X(p, s__len)] == '0') { + p += 1; + } + while (('0' <= s[__X(p, s__len)] && s[__X(p, s__len)] <= '9')) { + e = e * 10 + ((INT16)s[__X(p, s__len)] - 48); + p += 1; + } + if (negE) { + y = y / (LONGREAL)Reals_Ten(e); + } else { + y = y * Reals_Ten(e); + } + } + if (neg) { + y = -y; + } + *r = y; + __DEL(s); +} + export void *Strings__init(void) { __DEFMOD; + __MODULE_IMPORT(Reals); __REGMOD("Strings", 0); /* BEGIN */ __ENDMOD; diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index 04b06545..f88aeb04 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h @@ -17,6 +17,8 @@ import INT16 Strings_Length (CHAR *s, ADDRESS s__len); import BOOLEAN Strings_Match (CHAR *string, ADDRESS string__len, CHAR *pattern, ADDRESS pattern__len); import INT16 Strings_Pos (CHAR *pattern, ADDRESS pattern__len, CHAR *s, ADDRESS s__len, INT16 pos); import void Strings_Replace (CHAR *source, ADDRESS source__len, INT16 pos, CHAR *dest, ADDRESS dest__len); +import void Strings_StrToLongReal (CHAR *s, ADDRESS s__len, LONGREAL *r); +import void Strings_StrToReal (CHAR *s, ADDRESS s__len, REAL *r); import void *Strings__init(void); diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index 51082c36..95b9bc22 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index 037beccd..62b8d52e 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/VT100.c b/bootstrap/unix-88/VT100.c index 436790ae..40b79e32 100644 --- a/bootstrap/unix-88/VT100.c +++ b/bootstrap/unix-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/VT100.h b/bootstrap/unix-88/VT100.h index d8c8b46f..1e79747a 100644 --- a/bootstrap/unix-88/VT100.h +++ b/bootstrap/unix-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index ef4097cd..6bfa4550 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -72,7 +72,7 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) { - __COPY("gcc -g", s, s__len); + __COPY("gcc -fPIC -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); @@ -106,13 +106,15 @@ void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN stati } Strings_Append((CHAR*)" -o ", 5, (void*)cmd, 4096); Strings_Append(moduleName, moduleName__len, (void*)cmd, 4096); - Strings_Append((CHAR*)" -L\"", 5, (void*)cmd, 4096); - Strings_Append(OPM_InstallDir, 1024, (void*)cmd, 4096); - Strings_Append((CHAR*)"/lib\"", 6, (void*)cmd, 4096); - Strings_Append((CHAR*)" -l voc", 8, (void*)cmd, 4096); - Strings_Append((CHAR*)"-O", 3, (void*)cmd, 4096); - Strings_Append(OPM_Model, 10, (void*)cmd, 4096); - Strings_Append((CHAR*)"", 1, (void*)cmd, 4096); + if (!statically || 1) { + Strings_Append((CHAR*)" -L\"", 5, (void*)cmd, 4096); + Strings_Append(OPM_InstallDir, 1024, (void*)cmd, 4096); + Strings_Append((CHAR*)"/lib\"", 6, (void*)cmd, 4096); + Strings_Append((CHAR*)" -l voc", 8, (void*)cmd, 4096); + Strings_Append((CHAR*)"-O", 3, (void*)cmd, 4096); + Strings_Append(OPM_Model, 10, (void*)cmd, 4096); + Strings_Append((CHAR*)"", 1, (void*)cmd, 4096); + } extTools_execute((CHAR*)"C compile and link: ", 21, cmd, 4096); __DEL(additionalopts); } diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index f05c741b..6969521d 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/Compiler.c b/bootstrap/windows-48/Compiler.c index 38c8117f..2e1f73ec 100644 --- a/bootstrap/windows-48/Compiler.c +++ b/bootstrap/windows-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index a65d07d6..37d129c0 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index 72e63747..76f70d82 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index bdbed96c..4dae8e76 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index 43167fa5..4a2ce2b4 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index 8fc061ff..29215cc6 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index 25310ebf..3a5b2ec6 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index 60fa4748..8fc501ee 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index 8125a013..510a957f 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index 3779058a..4e5d8bb0 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index 086dc5f6..23d08ad2 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index e9d9a49e..664d96fb 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index fdcce95f..26ce2529 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index e475406d..77be12d2 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index 306f8ede..64e0b231 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index bf3d11d5..09556118 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index ab6ef6cb..dd80e8ba 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index f77716b2..00989b7b 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index f009c3c0..89f48bc6 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 1c073903..bade5779 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index 305c3ef1..d17422b2 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index 51336832..bd91910e 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index 60a80fc3..ebff1e8c 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Out.c b/bootstrap/windows-48/Out.c index 3950eb59..e7193968 100644 --- a/bootstrap/windows-48/Out.c +++ b/bootstrap/windows-48/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Out.h b/bootstrap/windows-48/Out.h index 7d83710b..d2b1d882 100644 --- a/bootstrap/windows-48/Out.h +++ b/bootstrap/windows-48/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index bc65bec9..c50aa4c4 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index 5e2fda7d..5ecd9242 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index d73aa742..820a2ba7 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index 439e5203..9a2fca64 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index 34b0450a..925d8de0 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -6,6 +6,7 @@ #define SET UINT32 #include "SYSTEM.h" +#include "Reals.h" @@ -19,6 +20,8 @@ export INT16 Strings_Length (CHAR *s, ADDRESS s__len); export BOOLEAN Strings_Match (CHAR *string, ADDRESS string__len, CHAR *pattern, ADDRESS pattern__len); export INT16 Strings_Pos (CHAR *pattern, ADDRESS pattern__len, CHAR *s, ADDRESS s__len, INT16 pos); export void Strings_Replace (CHAR *source, ADDRESS source__len, INT16 pos, CHAR *dest, ADDRESS dest__len); +export void Strings_StrToLongReal (CHAR *s, ADDRESS s__len, LONGREAL *r); +export void Strings_StrToReal (CHAR *s, ADDRESS s__len, REAL *r); INT16 Strings_Length (CHAR *s, ADDRESS s__len) @@ -236,10 +239,135 @@ BOOLEAN Strings_Match (CHAR *string, ADDRESS string__len, CHAR *pattern, ADDRESS return __retval; } +void Strings_StrToReal (CHAR *s, ADDRESS s__len, REAL *r) +{ + INT16 p, e; + REAL y, g; + BOOLEAN neg, negE; + __DUP(s, s__len, CHAR); + p = 0; + while (s[__X(p, s__len)] == ' ' || s[__X(p, s__len)] == '0') { + p += 1; + } + if (s[__X(p, s__len)] == '-') { + neg = 1; + p += 1; + } else { + neg = 0; + } + while (s[__X(p, s__len)] == ' ' || s[__X(p, s__len)] == '0') { + p += 1; + } + y = (REAL)0; + while (('0' <= s[__X(p, s__len)] && s[__X(p, s__len)] <= '9')) { + y = y * (REAL)10 + ((INT16)s[__X(p, s__len)] - 48); + p += 1; + } + if (s[__X(p, s__len)] == '.') { + p += 1; + g = (REAL)1; + while (('0' <= s[__X(p, s__len)] && s[__X(p, s__len)] <= '9')) { + g = g / (REAL)(REAL)10; + y = y + g * ((INT16)s[__X(p, s__len)] - 48); + p += 1; + } + } + if (s[__X(p, s__len)] == 'D' || s[__X(p, s__len)] == 'E') { + p += 1; + e = 0; + if (s[__X(p, s__len)] == '-') { + negE = 1; + p += 1; + } else { + negE = 0; + } + while (s[__X(p, s__len)] == '0') { + p += 1; + } + while (('0' <= s[__X(p, s__len)] && s[__X(p, s__len)] <= '9')) { + e = e * 10 + ((INT16)s[__X(p, s__len)] - 48); + p += 1; + } + if (negE) { + y = y / (REAL)Reals_Ten(e); + } else { + y = y * Reals_Ten(e); + } + } + if (neg) { + y = -y; + } + *r = y; + __DEL(s); +} + +void Strings_StrToLongReal (CHAR *s, ADDRESS s__len, LONGREAL *r) +{ + INT16 p, e; + LONGREAL y, g; + BOOLEAN neg, negE; + __DUP(s, s__len, CHAR); + p = 0; + while (s[__X(p, s__len)] == ' ' || s[__X(p, s__len)] == '0') { + p += 1; + } + if (s[__X(p, s__len)] == '-') { + neg = 1; + p += 1; + } else { + neg = 0; + } + while (s[__X(p, s__len)] == ' ' || s[__X(p, s__len)] == '0') { + p += 1; + } + y = (LONGREAL)0; + while (('0' <= s[__X(p, s__len)] && s[__X(p, s__len)] <= '9')) { + y = y * (LONGREAL)10 + ((INT16)s[__X(p, s__len)] - 48); + p += 1; + } + if (s[__X(p, s__len)] == '.') { + p += 1; + g = (LONGREAL)1; + while (('0' <= s[__X(p, s__len)] && s[__X(p, s__len)] <= '9')) { + g = g / (LONGREAL)(LONGREAL)10; + y = y + g * ((INT16)s[__X(p, s__len)] - 48); + p += 1; + } + } + if (s[__X(p, s__len)] == 'D' || s[__X(p, s__len)] == 'E') { + p += 1; + e = 0; + if (s[__X(p, s__len)] == '-') { + negE = 1; + p += 1; + } else { + negE = 0; + } + while (s[__X(p, s__len)] == '0') { + p += 1; + } + while (('0' <= s[__X(p, s__len)] && s[__X(p, s__len)] <= '9')) { + e = e * 10 + ((INT16)s[__X(p, s__len)] - 48); + p += 1; + } + if (negE) { + y = y / (LONGREAL)Reals_Ten(e); + } else { + y = y * Reals_Ten(e); + } + } + if (neg) { + y = -y; + } + *r = y; + __DEL(s); +} + export void *Strings__init(void) { __DEFMOD; + __MODULE_IMPORT(Reals); __REGMOD("Strings", 0); /* BEGIN */ __ENDMOD; diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index 04b06545..f88aeb04 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h @@ -17,6 +17,8 @@ import INT16 Strings_Length (CHAR *s, ADDRESS s__len); import BOOLEAN Strings_Match (CHAR *string, ADDRESS string__len, CHAR *pattern, ADDRESS pattern__len); import INT16 Strings_Pos (CHAR *pattern, ADDRESS pattern__len, CHAR *s, ADDRESS s__len, INT16 pos); import void Strings_Replace (CHAR *source, ADDRESS source__len, INT16 pos, CHAR *dest, ADDRESS dest__len); +import void Strings_StrToLongReal (CHAR *s, ADDRESS s__len, LONGREAL *r); +import void Strings_StrToReal (CHAR *s, ADDRESS s__len, REAL *r); import void *Strings__init(void); diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index d63c3ed6..b1559a2e 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index 7a44b973..bbc925ac 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/VT100.c b/bootstrap/windows-48/VT100.c index 436790ae..40b79e32 100644 --- a/bootstrap/windows-48/VT100.c +++ b/bootstrap/windows-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/VT100.h b/bootstrap/windows-48/VT100.h index d8c8b46f..1e79747a 100644 --- a/bootstrap/windows-48/VT100.h +++ b/bootstrap/windows-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index ef4097cd..6bfa4550 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -72,7 +72,7 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) { - __COPY("gcc -g", s, s__len); + __COPY("gcc -fPIC -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); @@ -106,13 +106,15 @@ void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN stati } Strings_Append((CHAR*)" -o ", 5, (void*)cmd, 4096); Strings_Append(moduleName, moduleName__len, (void*)cmd, 4096); - Strings_Append((CHAR*)" -L\"", 5, (void*)cmd, 4096); - Strings_Append(OPM_InstallDir, 1024, (void*)cmd, 4096); - Strings_Append((CHAR*)"/lib\"", 6, (void*)cmd, 4096); - Strings_Append((CHAR*)" -l voc", 8, (void*)cmd, 4096); - Strings_Append((CHAR*)"-O", 3, (void*)cmd, 4096); - Strings_Append(OPM_Model, 10, (void*)cmd, 4096); - Strings_Append((CHAR*)"", 1, (void*)cmd, 4096); + if (!statically || 1) { + Strings_Append((CHAR*)" -L\"", 5, (void*)cmd, 4096); + Strings_Append(OPM_InstallDir, 1024, (void*)cmd, 4096); + Strings_Append((CHAR*)"/lib\"", 6, (void*)cmd, 4096); + Strings_Append((CHAR*)" -l voc", 8, (void*)cmd, 4096); + Strings_Append((CHAR*)"-O", 3, (void*)cmd, 4096); + Strings_Append(OPM_Model, 10, (void*)cmd, 4096); + Strings_Append((CHAR*)"", 1, (void*)cmd, 4096); + } extTools_execute((CHAR*)"C compile and link: ", 21, cmd, 4096); __DEL(additionalopts); } diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index f05c741b..6969521d 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/Compiler.c b/bootstrap/windows-88/Compiler.c index 38c8117f..2e1f73ec 100644 --- a/bootstrap/windows-88/Compiler.c +++ b/bootstrap/windows-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index a65d07d6..37d129c0 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index 72e63747..76f70d82 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 032c4afb..e3eae937 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 66abb2c7..036899ba 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index 27cb83e1..12ba9904 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index f2ead3af..e7fb51b1 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 2a55e70b..560c3287 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index 100225d5..2a213809 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index 3779058a..4e5d8bb0 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index 086dc5f6..23d08ad2 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index e9d9a49e..664d96fb 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index fdcce95f..26ce2529 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 664903f4..c439d70d 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index 306f8ede..64e0b231 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index 8b9269cb..e03ef961 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index ab6ef6cb..dd80e8ba 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index f77716b2..00989b7b 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index f009c3c0..89f48bc6 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index 19d654e6..675711ee 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 305c3ef1..d17422b2 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index f4b2f0c9..9255cad8 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index 60a80fc3..ebff1e8c 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Out.c b/bootstrap/windows-88/Out.c index 3950eb59..e7193968 100644 --- a/bootstrap/windows-88/Out.c +++ b/bootstrap/windows-88/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Out.h b/bootstrap/windows-88/Out.h index 7d83710b..d2b1d882 100644 --- a/bootstrap/windows-88/Out.h +++ b/bootstrap/windows-88/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 3c3b5124..7d755921 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index e210853f..1c658e83 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index d73aa742..820a2ba7 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index 439e5203..9a2fca64 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index 34b0450a..925d8de0 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -6,6 +6,7 @@ #define SET UINT32 #include "SYSTEM.h" +#include "Reals.h" @@ -19,6 +20,8 @@ export INT16 Strings_Length (CHAR *s, ADDRESS s__len); export BOOLEAN Strings_Match (CHAR *string, ADDRESS string__len, CHAR *pattern, ADDRESS pattern__len); export INT16 Strings_Pos (CHAR *pattern, ADDRESS pattern__len, CHAR *s, ADDRESS s__len, INT16 pos); export void Strings_Replace (CHAR *source, ADDRESS source__len, INT16 pos, CHAR *dest, ADDRESS dest__len); +export void Strings_StrToLongReal (CHAR *s, ADDRESS s__len, LONGREAL *r); +export void Strings_StrToReal (CHAR *s, ADDRESS s__len, REAL *r); INT16 Strings_Length (CHAR *s, ADDRESS s__len) @@ -236,10 +239,135 @@ BOOLEAN Strings_Match (CHAR *string, ADDRESS string__len, CHAR *pattern, ADDRESS return __retval; } +void Strings_StrToReal (CHAR *s, ADDRESS s__len, REAL *r) +{ + INT16 p, e; + REAL y, g; + BOOLEAN neg, negE; + __DUP(s, s__len, CHAR); + p = 0; + while (s[__X(p, s__len)] == ' ' || s[__X(p, s__len)] == '0') { + p += 1; + } + if (s[__X(p, s__len)] == '-') { + neg = 1; + p += 1; + } else { + neg = 0; + } + while (s[__X(p, s__len)] == ' ' || s[__X(p, s__len)] == '0') { + p += 1; + } + y = (REAL)0; + while (('0' <= s[__X(p, s__len)] && s[__X(p, s__len)] <= '9')) { + y = y * (REAL)10 + ((INT16)s[__X(p, s__len)] - 48); + p += 1; + } + if (s[__X(p, s__len)] == '.') { + p += 1; + g = (REAL)1; + while (('0' <= s[__X(p, s__len)] && s[__X(p, s__len)] <= '9')) { + g = g / (REAL)(REAL)10; + y = y + g * ((INT16)s[__X(p, s__len)] - 48); + p += 1; + } + } + if (s[__X(p, s__len)] == 'D' || s[__X(p, s__len)] == 'E') { + p += 1; + e = 0; + if (s[__X(p, s__len)] == '-') { + negE = 1; + p += 1; + } else { + negE = 0; + } + while (s[__X(p, s__len)] == '0') { + p += 1; + } + while (('0' <= s[__X(p, s__len)] && s[__X(p, s__len)] <= '9')) { + e = e * 10 + ((INT16)s[__X(p, s__len)] - 48); + p += 1; + } + if (negE) { + y = y / (REAL)Reals_Ten(e); + } else { + y = y * Reals_Ten(e); + } + } + if (neg) { + y = -y; + } + *r = y; + __DEL(s); +} + +void Strings_StrToLongReal (CHAR *s, ADDRESS s__len, LONGREAL *r) +{ + INT16 p, e; + LONGREAL y, g; + BOOLEAN neg, negE; + __DUP(s, s__len, CHAR); + p = 0; + while (s[__X(p, s__len)] == ' ' || s[__X(p, s__len)] == '0') { + p += 1; + } + if (s[__X(p, s__len)] == '-') { + neg = 1; + p += 1; + } else { + neg = 0; + } + while (s[__X(p, s__len)] == ' ' || s[__X(p, s__len)] == '0') { + p += 1; + } + y = (LONGREAL)0; + while (('0' <= s[__X(p, s__len)] && s[__X(p, s__len)] <= '9')) { + y = y * (LONGREAL)10 + ((INT16)s[__X(p, s__len)] - 48); + p += 1; + } + if (s[__X(p, s__len)] == '.') { + p += 1; + g = (LONGREAL)1; + while (('0' <= s[__X(p, s__len)] && s[__X(p, s__len)] <= '9')) { + g = g / (LONGREAL)(LONGREAL)10; + y = y + g * ((INT16)s[__X(p, s__len)] - 48); + p += 1; + } + } + if (s[__X(p, s__len)] == 'D' || s[__X(p, s__len)] == 'E') { + p += 1; + e = 0; + if (s[__X(p, s__len)] == '-') { + negE = 1; + p += 1; + } else { + negE = 0; + } + while (s[__X(p, s__len)] == '0') { + p += 1; + } + while (('0' <= s[__X(p, s__len)] && s[__X(p, s__len)] <= '9')) { + e = e * 10 + ((INT16)s[__X(p, s__len)] - 48); + p += 1; + } + if (negE) { + y = y / (LONGREAL)Reals_Ten(e); + } else { + y = y * Reals_Ten(e); + } + } + if (neg) { + y = -y; + } + *r = y; + __DEL(s); +} + export void *Strings__init(void) { __DEFMOD; + __MODULE_IMPORT(Reals); __REGMOD("Strings", 0); /* BEGIN */ __ENDMOD; diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index 04b06545..f88aeb04 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h @@ -17,6 +17,8 @@ import INT16 Strings_Length (CHAR *s, ADDRESS s__len); import BOOLEAN Strings_Match (CHAR *string, ADDRESS string__len, CHAR *pattern, ADDRESS pattern__len); import INT16 Strings_Pos (CHAR *pattern, ADDRESS pattern__len, CHAR *s, ADDRESS s__len, INT16 pos); import void Strings_Replace (CHAR *source, ADDRESS source__len, INT16 pos, CHAR *dest, ADDRESS dest__len); +import void Strings_StrToLongReal (CHAR *s, ADDRESS s__len, LONGREAL *r); +import void Strings_StrToReal (CHAR *s, ADDRESS s__len, REAL *r); import void *Strings__init(void); diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index 51082c36..95b9bc22 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index 037beccd..62b8d52e 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/VT100.c b/bootstrap/windows-88/VT100.c index 436790ae..40b79e32 100644 --- a/bootstrap/windows-88/VT100.c +++ b/bootstrap/windows-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/VT100.h b/bootstrap/windows-88/VT100.h index d8c8b46f..1e79747a 100644 --- a/bootstrap/windows-88/VT100.h +++ b/bootstrap/windows-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index ef4097cd..6bfa4550 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -72,7 +72,7 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) { - __COPY("gcc -g", s, s__len); + __COPY("gcc -fPIC -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); @@ -106,13 +106,15 @@ void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN stati } Strings_Append((CHAR*)" -o ", 5, (void*)cmd, 4096); Strings_Append(moduleName, moduleName__len, (void*)cmd, 4096); - Strings_Append((CHAR*)" -L\"", 5, (void*)cmd, 4096); - Strings_Append(OPM_InstallDir, 1024, (void*)cmd, 4096); - Strings_Append((CHAR*)"/lib\"", 6, (void*)cmd, 4096); - Strings_Append((CHAR*)" -l voc", 8, (void*)cmd, 4096); - Strings_Append((CHAR*)"-O", 3, (void*)cmd, 4096); - Strings_Append(OPM_Model, 10, (void*)cmd, 4096); - Strings_Append((CHAR*)"", 1, (void*)cmd, 4096); + if (!statically || 1) { + Strings_Append((CHAR*)" -L\"", 5, (void*)cmd, 4096); + Strings_Append(OPM_InstallDir, 1024, (void*)cmd, 4096); + Strings_Append((CHAR*)"/lib\"", 6, (void*)cmd, 4096); + Strings_Append((CHAR*)" -l voc", 8, (void*)cmd, 4096); + Strings_Append((CHAR*)"-O", 3, (void*)cmd, 4096); + Strings_Append(OPM_Model, 10, (void*)cmd, 4096); + Strings_Append((CHAR*)"", 1, (void*)cmd, 4096); + } extTools_execute((CHAR*)"C compile and link: ", 21, cmd, 4096); __DEL(additionalopts); } diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index f05c741b..6969521d 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/01/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h From 9f3893bb424c86a75767ee46741de751f78441da Mon Sep 17 00:00:00 2001 From: norayr Date: Wed, 21 Jun 2017 21:45:26 +0400 Subject: [PATCH 472/580] should fix library build. --- src/tools/make/oberon.mk | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/tools/make/oberon.mk b/src/tools/make/oberon.mk index ca7ac4ef..fedaf039 100644 --- a/src/tools/make/oberon.mk +++ b/src/tools/make/oberon.mk @@ -60,8 +60,8 @@ assemble: @printf ' DATAMODEL: %s\n' "$(DATAMODEL)" cd $(BUILDDIR) && $(COMPILE) -c SYSTEM.c Configuration.c Platform.c Heap.c - cd $(BUILDDIR) && $(COMPILE) -c Out.c Strings.c Modules.c Files.c - cd $(BUILDDIR) && $(COMPILE) -c Reals.c Texts.c VT100.c + cd $(BUILDDIR) && $(COMPILE) -c Out.c Reals.c Strings.c Modules.c + cd $(BUILDDIR) && $(COMPILE) -c Files.c Texts.c VT100.c cd $(BUILDDIR) && $(COMPILE) -c OPM.c extTools.c OPS.c OPT.c cd $(BUILDDIR) && $(COMPILE) -c OPC.c OPV.c OPB.c OPP.c @@ -212,13 +212,13 @@ runtime: FORCE cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/runtime/Heap.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/runtime/Out.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/runtime/Modules.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/runtime/Reals.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/runtime/Strings.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/runtime/In.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/runtime/VT100.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/runtime/Files.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/runtime/Math.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/runtime/MathL.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/runtime/Reals.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/runtime/Texts.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/runtime/Oberon.Mod From 511186f0a42727b8439ca8e986de8063e6342f9d Mon Sep 17 00:00:00 2001 From: norayr Date: Tue, 8 Aug 2017 15:37:29 +0400 Subject: [PATCH 473/580] applied temple's fix for the ofront issue #30, endless recoursion for cyclic array types. https://github.com/jtempl/ofront/commit/c7d37c9162ce48d7feb4fbe2d6d2bc238d06a57d --- src/compiler/OPC.Mod | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/compiler/OPC.Mod b/src/compiler/OPC.Mod index 376ba412..43b86251 100644 --- a/src/compiler/OPC.Mod +++ b/src/compiler/OPC.Mod @@ -453,6 +453,9 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) ELSIF str^.form = OPT.Pointer THEN IF str^.BaseTyp^.comp # OPT.Record THEN DefineType(str^.BaseTyp) END ELSIF str^.comp IN {OPT.Array, OPT.DynArr} THEN + IF (str^.BaseTyp^.strobj # NIL) & (str^.BaseTyp^.strobj^.linkadr = ProcessingType) THEN (*cyclic base type*) + OPM.Mark(244, str^ .txtpos); str^.BaseTyp^.strobj^.linkadr := PredefinedType + END ; DefineType(str^.BaseTyp) ELSIF str^.form = OPT.ProcTyp THEN IF str^.BaseTyp # OPT.notyp THEN DefineType(str^.BaseTyp) END ; From bad584ec32e8d5c761c0fcc16c581b83f094d4bb Mon Sep 17 00:00:00 2001 From: norayr Date: Tue, 8 Aug 2017 15:39:44 +0400 Subject: [PATCH 474/580] make bootstrap. --- bootstrap/unix-44/Compiler.c | 2 +- bootstrap/unix-44/Configuration.c | 4 ++-- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Files.c | 2 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 2 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 6 +++++- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 2 +- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 2 +- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 2 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Out.c | 2 +- bootstrap/unix-44/Out.h | 2 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/VT100.c | 2 +- bootstrap/unix-44/VT100.h | 2 +- bootstrap/unix-44/extTools.c | 2 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-48/Compiler.c | 2 +- bootstrap/unix-48/Configuration.c | 4 ++-- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Files.c | 2 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 2 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 6 +++++- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 2 +- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 2 +- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 2 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Out.c | 2 +- bootstrap/unix-48/Out.h | 2 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/VT100.c | 2 +- bootstrap/unix-48/VT100.h | 2 +- bootstrap/unix-48/extTools.c | 2 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-88/Compiler.c | 2 +- bootstrap/unix-88/Configuration.c | 4 ++-- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Files.c | 2 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 2 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 6 +++++- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 2 +- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 2 +- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 2 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Out.c | 2 +- bootstrap/unix-88/Out.h | 2 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/VT100.c | 2 +- bootstrap/unix-88/VT100.h | 2 +- bootstrap/unix-88/extTools.c | 2 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/windows-48/Compiler.c | 2 +- bootstrap/windows-48/Configuration.c | 4 ++-- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Files.c | 2 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 2 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 6 +++++- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 2 +- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 2 +- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 2 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Out.c | 2 +- bootstrap/windows-48/Out.h | 2 +- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/VT100.c | 2 +- bootstrap/windows-48/VT100.h | 2 +- bootstrap/windows-48/extTools.c | 2 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-88/Compiler.c | 2 +- bootstrap/windows-88/Configuration.c | 4 ++-- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Files.c | 2 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 2 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 6 +++++- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 2 +- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 2 +- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 2 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Out.c | 2 +- bootstrap/windows-88/Out.h | 2 +- bootstrap/windows-88/Platform.c | 2 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/VT100.c | 2 +- bootstrap/windows-88/VT100.h | 2 +- bootstrap/windows-88/extTools.c | 2 +- bootstrap/windows-88/extTools.h | 2 +- 185 files changed, 210 insertions(+), 190 deletions(-) diff --git a/bootstrap/unix-44/Compiler.c b/bootstrap/unix-44/Compiler.c index 2e1f73ec..cd41469c 100644 --- a/bootstrap/unix-44/Compiler.c +++ b/bootstrap/unix-44/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index 37d129c0..9f1b22bf 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index 76f70d82..35899464 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 15f181ca..07ef2f13 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index 9825b66f..3bc2d0b7 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index 29215cc6..230921f7 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index 3a5b2ec6..9cd5ef68 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index 8d1f2adc..ce58d2bd 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index 510a957f..f63c08e3 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index 4e5d8bb0..a9bfa790 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index 23d08ad2..a1d7caa3 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 664d96fb..4272bd0d 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -681,6 +681,10 @@ static void OPC_DefineType (OPT_Struct str) OPC_DefineType(str->BaseTyp); } } else if (__IN(str->comp, 0x0c, 32)) { + if ((str->BaseTyp->strobj != NIL && str->BaseTyp->strobj->linkadr == 1)) { + OPM_Mark(244, str->txtpos); + str->BaseTyp->strobj->linkadr = 2; + } OPC_DefineType(str->BaseTyp); } else if (str->form == 12) { if (str->BaseTyp != OPT_notyp) { diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index 26ce2529..7ca019a5 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 77be12d2..ec0778a4 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index 64e0b231..5fa08030 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index 09556118..8963cdb8 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index dd80e8ba..abf3c5fe 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index 00989b7b..be362918 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index 89f48bc6..e1bafa1a 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index 795ce5e8..21847ec1 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index d17422b2..027d4136 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index bd91910e..355b91bf 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index ebff1e8c..1511fecb 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Out.c b/bootstrap/unix-44/Out.c index 6ca1811b..5ae51898 100644 --- a/bootstrap/unix-44/Out.c +++ b/bootstrap/unix-44/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Out.h b/bootstrap/unix-44/Out.h index d2b1d882..0cadead1 100644 --- a/bootstrap/unix-44/Out.h +++ b/bootstrap/unix-44/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 3adf3084..abca1ea7 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index 975922f3..00d75eb9 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 820a2ba7..7766eea6 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index 9a2fca64..db777c1d 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index 925d8de0..180ca62f 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index f88aeb04..068bee5e 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index 05dd7063..7e59fe02 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index 965d36bd..0282ee71 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/VT100.c b/bootstrap/unix-44/VT100.c index 40b79e32..3383b2ee 100644 --- a/bootstrap/unix-44/VT100.c +++ b/bootstrap/unix-44/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/VT100.h b/bootstrap/unix-44/VT100.h index 1e79747a..54b7d9d7 100644 --- a/bootstrap/unix-44/VT100.h +++ b/bootstrap/unix-44/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index 6bfa4550..322be252 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index 6969521d..d7a81d4e 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/Compiler.c b/bootstrap/unix-48/Compiler.c index 2e1f73ec..cd41469c 100644 --- a/bootstrap/unix-48/Compiler.c +++ b/bootstrap/unix-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index 37d129c0..9f1b22bf 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index 76f70d82..35899464 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 15f181ca..07ef2f13 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index 9825b66f..3bc2d0b7 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index 29215cc6..230921f7 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index 3a5b2ec6..9cd5ef68 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index 8d1f2adc..ce58d2bd 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index 510a957f..f63c08e3 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index 4e5d8bb0..a9bfa790 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index 23d08ad2..a1d7caa3 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 664d96fb..4272bd0d 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -681,6 +681,10 @@ static void OPC_DefineType (OPT_Struct str) OPC_DefineType(str->BaseTyp); } } else if (__IN(str->comp, 0x0c, 32)) { + if ((str->BaseTyp->strobj != NIL && str->BaseTyp->strobj->linkadr == 1)) { + OPM_Mark(244, str->txtpos); + str->BaseTyp->strobj->linkadr = 2; + } OPC_DefineType(str->BaseTyp); } else if (str->form == 12) { if (str->BaseTyp != OPT_notyp) { diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index 26ce2529..7ca019a5 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 77be12d2..ec0778a4 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index 64e0b231..5fa08030 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index 09556118..8963cdb8 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index dd80e8ba..abf3c5fe 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index 00989b7b..be362918 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index 89f48bc6..e1bafa1a 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index bade5779..bc417521 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index d17422b2..027d4136 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index bd91910e..355b91bf 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index ebff1e8c..1511fecb 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Out.c b/bootstrap/unix-48/Out.c index 6ca1811b..5ae51898 100644 --- a/bootstrap/unix-48/Out.c +++ b/bootstrap/unix-48/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Out.h b/bootstrap/unix-48/Out.h index d2b1d882..0cadead1 100644 --- a/bootstrap/unix-48/Out.h +++ b/bootstrap/unix-48/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 3adf3084..abca1ea7 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index 975922f3..00d75eb9 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 820a2ba7..7766eea6 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index 9a2fca64..db777c1d 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index 925d8de0..180ca62f 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index f88aeb04..068bee5e 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index b1559a2e..2ae6cb09 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index bbc925ac..d8e458b3 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/VT100.c b/bootstrap/unix-48/VT100.c index 40b79e32..3383b2ee 100644 --- a/bootstrap/unix-48/VT100.c +++ b/bootstrap/unix-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/VT100.h b/bootstrap/unix-48/VT100.h index 1e79747a..54b7d9d7 100644 --- a/bootstrap/unix-48/VT100.h +++ b/bootstrap/unix-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index 6bfa4550..322be252 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index 6969521d..d7a81d4e 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/Compiler.c b/bootstrap/unix-88/Compiler.c index 2e1f73ec..cd41469c 100644 --- a/bootstrap/unix-88/Compiler.c +++ b/bootstrap/unix-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index 37d129c0..9f1b22bf 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index 76f70d82..35899464 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index b387e012..e3497bbb 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index c0394624..687a3c51 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index 12ba9904..748d21a5 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index e7fb51b1..869cd976 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index a3a7a868..ba9aa511 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index 2a213809..872d937d 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index 4e5d8bb0..a9bfa790 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index 23d08ad2..a1d7caa3 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index 664d96fb..4272bd0d 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -681,6 +681,10 @@ static void OPC_DefineType (OPT_Struct str) OPC_DefineType(str->BaseTyp); } } else if (__IN(str->comp, 0x0c, 32)) { + if ((str->BaseTyp->strobj != NIL && str->BaseTyp->strobj->linkadr == 1)) { + OPM_Mark(244, str->txtpos); + str->BaseTyp->strobj->linkadr = 2; + } OPC_DefineType(str->BaseTyp); } else if (str->form == 12) { if (str->BaseTyp != OPT_notyp) { diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index 26ce2529..7ca019a5 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index c439d70d..697f985e 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index 64e0b231..5fa08030 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index e03ef961..b6cacf30 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index dd80e8ba..abf3c5fe 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index 00989b7b..be362918 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index 89f48bc6..e1bafa1a 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index 675711ee..88e4c9f8 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index d17422b2..027d4136 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 9255cad8..b35255c4 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index ebff1e8c..1511fecb 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Out.c b/bootstrap/unix-88/Out.c index 6ca1811b..5ae51898 100644 --- a/bootstrap/unix-88/Out.c +++ b/bootstrap/unix-88/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Out.h b/bootstrap/unix-88/Out.h index d2b1d882..0cadead1 100644 --- a/bootstrap/unix-88/Out.h +++ b/bootstrap/unix-88/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 0100e778..d2465ce8 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index 609b0969..5df45b89 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 820a2ba7..7766eea6 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index 9a2fca64..db777c1d 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index 925d8de0..180ca62f 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index f88aeb04..068bee5e 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index 95b9bc22..5420a932 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index 62b8d52e..ce8b3402 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/VT100.c b/bootstrap/unix-88/VT100.c index 40b79e32..3383b2ee 100644 --- a/bootstrap/unix-88/VT100.c +++ b/bootstrap/unix-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/VT100.h b/bootstrap/unix-88/VT100.h index 1e79747a..54b7d9d7 100644 --- a/bootstrap/unix-88/VT100.h +++ b/bootstrap/unix-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index 6bfa4550..322be252 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index 6969521d..d7a81d4e 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/Compiler.c b/bootstrap/windows-48/Compiler.c index 2e1f73ec..cd41469c 100644 --- a/bootstrap/windows-48/Compiler.c +++ b/bootstrap/windows-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index 37d129c0..9f1b22bf 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index 76f70d82..35899464 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 4dae8e76..7ee3148c 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index 4a2ce2b4..3fbe334d 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index 29215cc6..230921f7 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index 3a5b2ec6..9cd5ef68 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index 8fc501ee..b6c68442 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index 510a957f..f63c08e3 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index 4e5d8bb0..a9bfa790 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index 23d08ad2..a1d7caa3 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 664d96fb..4272bd0d 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -681,6 +681,10 @@ static void OPC_DefineType (OPT_Struct str) OPC_DefineType(str->BaseTyp); } } else if (__IN(str->comp, 0x0c, 32)) { + if ((str->BaseTyp->strobj != NIL && str->BaseTyp->strobj->linkadr == 1)) { + OPM_Mark(244, str->txtpos); + str->BaseTyp->strobj->linkadr = 2; + } OPC_DefineType(str->BaseTyp); } else if (str->form == 12) { if (str->BaseTyp != OPT_notyp) { diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index 26ce2529..7ca019a5 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 77be12d2..ec0778a4 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index 64e0b231..5fa08030 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index 09556118..8963cdb8 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index dd80e8ba..abf3c5fe 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index 00989b7b..be362918 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index 89f48bc6..e1bafa1a 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index bade5779..bc417521 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index d17422b2..027d4136 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index bd91910e..355b91bf 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index ebff1e8c..1511fecb 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Out.c b/bootstrap/windows-48/Out.c index e7193968..ad6ab827 100644 --- a/bootstrap/windows-48/Out.c +++ b/bootstrap/windows-48/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Out.h b/bootstrap/windows-48/Out.h index d2b1d882..0cadead1 100644 --- a/bootstrap/windows-48/Out.h +++ b/bootstrap/windows-48/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index c50aa4c4..e8dc98b0 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index 5ecd9242..1f094b16 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 820a2ba7..7766eea6 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index 9a2fca64..db777c1d 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index 925d8de0..180ca62f 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index f88aeb04..068bee5e 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index b1559a2e..2ae6cb09 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index bbc925ac..d8e458b3 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/VT100.c b/bootstrap/windows-48/VT100.c index 40b79e32..3383b2ee 100644 --- a/bootstrap/windows-48/VT100.c +++ b/bootstrap/windows-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/VT100.h b/bootstrap/windows-48/VT100.h index 1e79747a..54b7d9d7 100644 --- a/bootstrap/windows-48/VT100.h +++ b/bootstrap/windows-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index 6bfa4550..322be252 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index 6969521d..d7a81d4e 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/Compiler.c b/bootstrap/windows-88/Compiler.c index 2e1f73ec..cd41469c 100644 --- a/bootstrap/windows-88/Compiler.c +++ b/bootstrap/windows-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index 37d129c0..9f1b22bf 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index 76f70d82..35899464 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index e3eae937..14644554 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 036899ba..cf686837 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index 12ba9904..748d21a5 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index e7fb51b1..869cd976 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 560c3287..b5ce22d3 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index 2a213809..872d937d 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index 4e5d8bb0..a9bfa790 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index 23d08ad2..a1d7caa3 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index 664d96fb..4272bd0d 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -681,6 +681,10 @@ static void OPC_DefineType (OPT_Struct str) OPC_DefineType(str->BaseTyp); } } else if (__IN(str->comp, 0x0c, 32)) { + if ((str->BaseTyp->strobj != NIL && str->BaseTyp->strobj->linkadr == 1)) { + OPM_Mark(244, str->txtpos); + str->BaseTyp->strobj->linkadr = 2; + } OPC_DefineType(str->BaseTyp); } else if (str->form == 12) { if (str->BaseTyp != OPT_notyp) { diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index 26ce2529..7ca019a5 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index c439d70d..697f985e 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index 64e0b231..5fa08030 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index e03ef961..b6cacf30 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index dd80e8ba..abf3c5fe 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index 00989b7b..be362918 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index 89f48bc6..e1bafa1a 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index 675711ee..88e4c9f8 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index d17422b2..027d4136 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 9255cad8..b35255c4 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index ebff1e8c..1511fecb 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Out.c b/bootstrap/windows-88/Out.c index e7193968..ad6ab827 100644 --- a/bootstrap/windows-88/Out.c +++ b/bootstrap/windows-88/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Out.h b/bootstrap/windows-88/Out.h index d2b1d882..0cadead1 100644 --- a/bootstrap/windows-88/Out.h +++ b/bootstrap/windows-88/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 7d755921..ea7da9ab 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index 1c658e83..7169da34 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 820a2ba7..7766eea6 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index 9a2fca64..db777c1d 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index 925d8de0..180ca62f 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index f88aeb04..068bee5e 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index 95b9bc22..5420a932 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index 62b8d52e..ce8b3402 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/VT100.c b/bootstrap/windows-88/VT100.c index 40b79e32..3383b2ee 100644 --- a/bootstrap/windows-88/VT100.c +++ b/bootstrap/windows-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/VT100.h b/bootstrap/windows-88/VT100.h index 1e79747a..54b7d9d7 100644 --- a/bootstrap/windows-88/VT100.h +++ b/bootstrap/windows-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index 6bfa4550..322be252 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index 6969521d..d7a81d4e 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/06/21]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h From 2ec7f3277a967ef16fd31752a2503153f5a9dd96 Mon Sep 17 00:00:00 2001 From: norayr Date: Sat, 2 Sep 2017 22:20:03 +0400 Subject: [PATCH 475/580] applied changes for the issue #61, with the @jtempl fix https://github.com/jtempl/ofront/commit/9e3e13af63499aa61e8934c80e69eb18ffb35acf --- bootstrap/unix-44/Compiler.c | 2 +- bootstrap/unix-44/Configuration.c | 4 ++-- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Files.c | 2 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 2 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 2 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 2 +- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 2 +- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 4 ++-- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Out.c | 2 +- bootstrap/unix-44/Out.h | 2 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/VT100.c | 2 +- bootstrap/unix-44/VT100.h | 2 +- bootstrap/unix-44/extTools.c | 2 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-48/Compiler.c | 2 +- bootstrap/unix-48/Configuration.c | 4 ++-- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Files.c | 2 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 2 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 2 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 2 +- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 2 +- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 4 ++-- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Out.c | 2 +- bootstrap/unix-48/Out.h | 2 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/VT100.c | 2 +- bootstrap/unix-48/VT100.h | 2 +- bootstrap/unix-48/extTools.c | 2 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-88/Compiler.c | 2 +- bootstrap/unix-88/Configuration.c | 4 ++-- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Files.c | 2 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 2 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 2 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 2 +- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 2 +- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 4 ++-- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Out.c | 2 +- bootstrap/unix-88/Out.h | 2 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/VT100.c | 2 +- bootstrap/unix-88/VT100.h | 2 +- bootstrap/unix-88/extTools.c | 2 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/windows-48/Compiler.c | 2 +- bootstrap/windows-48/Configuration.c | 4 ++-- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Files.c | 2 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 2 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 2 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 2 +- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 2 +- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 4 ++-- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Out.c | 2 +- bootstrap/windows-48/Out.h | 2 +- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/VT100.c | 2 +- bootstrap/windows-48/VT100.h | 2 +- bootstrap/windows-48/extTools.c | 2 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-88/Compiler.c | 2 +- bootstrap/windows-88/Configuration.c | 4 ++-- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Files.c | 2 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 2 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 2 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 2 +- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 2 +- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 4 ++-- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Out.c | 2 +- bootstrap/windows-88/Out.h | 2 +- bootstrap/windows-88/Platform.c | 2 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/VT100.c | 2 +- bootstrap/windows-88/VT100.h | 2 +- bootstrap/windows-88/extTools.c | 2 +- bootstrap/windows-88/extTools.h | 2 +- src/compiler/OPV.Mod | 2 +- 186 files changed, 196 insertions(+), 196 deletions(-) diff --git a/bootstrap/unix-44/Compiler.c b/bootstrap/unix-44/Compiler.c index cd41469c..90b947ab 100644 --- a/bootstrap/unix-44/Compiler.c +++ b/bootstrap/unix-44/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index 9f1b22bf..aec51f79 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index 35899464..b40df642 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 07ef2f13..efcd4956 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index 3bc2d0b7..3bcc1ece 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index 230921f7..334d6938 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index 9cd5ef68..f4cc3fdc 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index ce58d2bd..fdb70b86 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index f63c08e3..8b9aba1f 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index a9bfa790..d80e722c 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index a1d7caa3..0f61f41b 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 4272bd0d..7a7d65ef 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index 7ca019a5..808b1e30 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index ec0778a4..642a2726 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index 5fa08030..81facffb 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index 8963cdb8..d0e34e2b 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index abf3c5fe..3f6b4335 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index be362918..c89499f5 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index e1bafa1a..e2e6aa76 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index 21847ec1..9e8900ee 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index 027d4136..2b8d4909 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index 355b91bf..31e6b9ff 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -1183,7 +1183,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) base = base->BaseTyp; } if ((base->comp == 4 && OPC_NofPtrs(base) != 0)) { - OPC_Ident(base->strobj); + OPC_Andent(base); OPM_WriteString((CHAR*)"__typ", 6); } else if (base->form == 11) { OPM_WriteString((CHAR*)"POINTER__typ", 13); diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index 1511fecb..74fbddfb 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Out.c b/bootstrap/unix-44/Out.c index 5ae51898..5f010012 100644 --- a/bootstrap/unix-44/Out.c +++ b/bootstrap/unix-44/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Out.h b/bootstrap/unix-44/Out.h index 0cadead1..b6de9e8e 100644 --- a/bootstrap/unix-44/Out.h +++ b/bootstrap/unix-44/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index abca1ea7..71910286 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index 00d75eb9..f03d47db 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 7766eea6..24d6dbae 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index db777c1d..9afdda57 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index 180ca62f..f71e1011 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index 068bee5e..c5c20d62 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index 7e59fe02..f49afd81 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index 0282ee71..b6dd28f9 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/VT100.c b/bootstrap/unix-44/VT100.c index 3383b2ee..f4bad650 100644 --- a/bootstrap/unix-44/VT100.c +++ b/bootstrap/unix-44/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/VT100.h b/bootstrap/unix-44/VT100.h index 54b7d9d7..348d31de 100644 --- a/bootstrap/unix-44/VT100.h +++ b/bootstrap/unix-44/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index 322be252..25bab77d 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index d7a81d4e..2147f066 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/Compiler.c b/bootstrap/unix-48/Compiler.c index cd41469c..90b947ab 100644 --- a/bootstrap/unix-48/Compiler.c +++ b/bootstrap/unix-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index 9f1b22bf..aec51f79 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index 35899464..b40df642 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 07ef2f13..efcd4956 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index 3bc2d0b7..3bcc1ece 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index 230921f7..334d6938 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index 9cd5ef68..f4cc3fdc 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index ce58d2bd..fdb70b86 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index f63c08e3..8b9aba1f 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index a9bfa790..d80e722c 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index a1d7caa3..0f61f41b 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 4272bd0d..7a7d65ef 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index 7ca019a5..808b1e30 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index ec0778a4..642a2726 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index 5fa08030..81facffb 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index 8963cdb8..d0e34e2b 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index abf3c5fe..3f6b4335 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index be362918..c89499f5 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index e1bafa1a..e2e6aa76 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index bc417521..6ed97a79 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index 027d4136..2b8d4909 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index 355b91bf..31e6b9ff 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -1183,7 +1183,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) base = base->BaseTyp; } if ((base->comp == 4 && OPC_NofPtrs(base) != 0)) { - OPC_Ident(base->strobj); + OPC_Andent(base); OPM_WriteString((CHAR*)"__typ", 6); } else if (base->form == 11) { OPM_WriteString((CHAR*)"POINTER__typ", 13); diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index 1511fecb..74fbddfb 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Out.c b/bootstrap/unix-48/Out.c index 5ae51898..5f010012 100644 --- a/bootstrap/unix-48/Out.c +++ b/bootstrap/unix-48/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Out.h b/bootstrap/unix-48/Out.h index 0cadead1..b6de9e8e 100644 --- a/bootstrap/unix-48/Out.h +++ b/bootstrap/unix-48/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index abca1ea7..71910286 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index 00d75eb9..f03d47db 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 7766eea6..24d6dbae 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index db777c1d..9afdda57 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index 180ca62f..f71e1011 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index 068bee5e..c5c20d62 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index 2ae6cb09..bf746ce0 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index d8e458b3..adeaa30f 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/VT100.c b/bootstrap/unix-48/VT100.c index 3383b2ee..f4bad650 100644 --- a/bootstrap/unix-48/VT100.c +++ b/bootstrap/unix-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/VT100.h b/bootstrap/unix-48/VT100.h index 54b7d9d7..348d31de 100644 --- a/bootstrap/unix-48/VT100.h +++ b/bootstrap/unix-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index 322be252..25bab77d 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index d7a81d4e..2147f066 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/Compiler.c b/bootstrap/unix-88/Compiler.c index cd41469c..90b947ab 100644 --- a/bootstrap/unix-88/Compiler.c +++ b/bootstrap/unix-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index 9f1b22bf..aec51f79 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index 35899464..b40df642 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index e3497bbb..b6c2fa2a 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 687a3c51..23eb0ae2 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index 748d21a5..b5548143 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index 869cd976..2e1f525b 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index ba9aa511..f208a346 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index 872d937d..f9b45430 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index a9bfa790..d80e722c 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index a1d7caa3..0f61f41b 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index 4272bd0d..7a7d65ef 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index 7ca019a5..808b1e30 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 697f985e..89456899 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index 5fa08030..81facffb 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index b6cacf30..122e2f6c 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index abf3c5fe..3f6b4335 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index be362918..c89499f5 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index e1bafa1a..e2e6aa76 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index 88e4c9f8..984753b2 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 027d4136..2b8d4909 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index b35255c4..423bbdef 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -1183,7 +1183,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) base = base->BaseTyp; } if ((base->comp == 4 && OPC_NofPtrs(base) != 0)) { - OPC_Ident(base->strobj); + OPC_Andent(base); OPM_WriteString((CHAR*)"__typ", 6); } else if (base->form == 11) { OPM_WriteString((CHAR*)"POINTER__typ", 13); diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index 1511fecb..74fbddfb 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Out.c b/bootstrap/unix-88/Out.c index 5ae51898..5f010012 100644 --- a/bootstrap/unix-88/Out.c +++ b/bootstrap/unix-88/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Out.h b/bootstrap/unix-88/Out.h index 0cadead1..b6de9e8e 100644 --- a/bootstrap/unix-88/Out.h +++ b/bootstrap/unix-88/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index d2465ce8..a28f82bf 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index 5df45b89..8f982d78 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 7766eea6..24d6dbae 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index db777c1d..9afdda57 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index 180ca62f..f71e1011 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index 068bee5e..c5c20d62 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index 5420a932..3eec265c 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index ce8b3402..9e0758f9 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/VT100.c b/bootstrap/unix-88/VT100.c index 3383b2ee..f4bad650 100644 --- a/bootstrap/unix-88/VT100.c +++ b/bootstrap/unix-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/VT100.h b/bootstrap/unix-88/VT100.h index 54b7d9d7..348d31de 100644 --- a/bootstrap/unix-88/VT100.h +++ b/bootstrap/unix-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index 322be252..25bab77d 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index d7a81d4e..2147f066 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/Compiler.c b/bootstrap/windows-48/Compiler.c index cd41469c..90b947ab 100644 --- a/bootstrap/windows-48/Compiler.c +++ b/bootstrap/windows-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index 9f1b22bf..aec51f79 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index 35899464..b40df642 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 7ee3148c..7ba212c5 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index 3fbe334d..1cf7bd4f 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index 230921f7..334d6938 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index 9cd5ef68..f4cc3fdc 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index b6c68442..2e36c7d8 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index f63c08e3..8b9aba1f 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index a9bfa790..d80e722c 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index a1d7caa3..0f61f41b 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 4272bd0d..7a7d65ef 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index 7ca019a5..808b1e30 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index ec0778a4..642a2726 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index 5fa08030..81facffb 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index 8963cdb8..d0e34e2b 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index abf3c5fe..3f6b4335 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index be362918..c89499f5 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index e1bafa1a..e2e6aa76 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index bc417521..6ed97a79 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index 027d4136..2b8d4909 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index 355b91bf..31e6b9ff 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -1183,7 +1183,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) base = base->BaseTyp; } if ((base->comp == 4 && OPC_NofPtrs(base) != 0)) { - OPC_Ident(base->strobj); + OPC_Andent(base); OPM_WriteString((CHAR*)"__typ", 6); } else if (base->form == 11) { OPM_WriteString((CHAR*)"POINTER__typ", 13); diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index 1511fecb..74fbddfb 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Out.c b/bootstrap/windows-48/Out.c index ad6ab827..d040a272 100644 --- a/bootstrap/windows-48/Out.c +++ b/bootstrap/windows-48/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Out.h b/bootstrap/windows-48/Out.h index 0cadead1..b6de9e8e 100644 --- a/bootstrap/windows-48/Out.h +++ b/bootstrap/windows-48/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index e8dc98b0..73da4e17 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index 1f094b16..58d8837d 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 7766eea6..24d6dbae 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index db777c1d..9afdda57 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index 180ca62f..f71e1011 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index 068bee5e..c5c20d62 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index 2ae6cb09..bf746ce0 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index d8e458b3..adeaa30f 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/VT100.c b/bootstrap/windows-48/VT100.c index 3383b2ee..f4bad650 100644 --- a/bootstrap/windows-48/VT100.c +++ b/bootstrap/windows-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/VT100.h b/bootstrap/windows-48/VT100.h index 54b7d9d7..348d31de 100644 --- a/bootstrap/windows-48/VT100.h +++ b/bootstrap/windows-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index 322be252..25bab77d 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index d7a81d4e..2147f066 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/Compiler.c b/bootstrap/windows-88/Compiler.c index cd41469c..90b947ab 100644 --- a/bootstrap/windows-88/Compiler.c +++ b/bootstrap/windows-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index 9f1b22bf..aec51f79 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index 35899464..b40df642 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 14644554..892a21b6 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index cf686837..8552fb5d 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index 748d21a5..b5548143 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index 869cd976..2e1f525b 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index b5ce22d3..58f86435 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index 872d937d..f9b45430 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index a9bfa790..d80e722c 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index a1d7caa3..0f61f41b 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index 4272bd0d..7a7d65ef 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index 7ca019a5..808b1e30 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 697f985e..89456899 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index 5fa08030..81facffb 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index b6cacf30..122e2f6c 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index abf3c5fe..3f6b4335 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index be362918..c89499f5 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index e1bafa1a..e2e6aa76 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index 88e4c9f8..984753b2 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 027d4136..2b8d4909 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index b35255c4..423bbdef 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -1183,7 +1183,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) base = base->BaseTyp; } if ((base->comp == 4 && OPC_NofPtrs(base) != 0)) { - OPC_Ident(base->strobj); + OPC_Andent(base); OPM_WriteString((CHAR*)"__typ", 6); } else if (base->form == 11) { OPM_WriteString((CHAR*)"POINTER__typ", 13); diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index 1511fecb..74fbddfb 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Out.c b/bootstrap/windows-88/Out.c index ad6ab827..d040a272 100644 --- a/bootstrap/windows-88/Out.c +++ b/bootstrap/windows-88/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Out.h b/bootstrap/windows-88/Out.h index 0cadead1..b6de9e8e 100644 --- a/bootstrap/windows-88/Out.h +++ b/bootstrap/windows-88/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index ea7da9ab..528b9c9c 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index 7169da34..ea34c3d3 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 7766eea6..24d6dbae 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index db777c1d..9afdda57 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index 180ca62f..f71e1011 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index 068bee5e..c5c20d62 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index 5420a932..3eec265c 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index ce8b3402..9e0758f9 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/VT100.c b/bootstrap/windows-88/VT100.c index 3383b2ee..f4bad650 100644 --- a/bootstrap/windows-88/VT100.c +++ b/bootstrap/windows-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/VT100.h b/bootstrap/windows-88/VT100.h index 54b7d9d7..348d31de 100644 --- a/bootstrap/windows-88/VT100.h +++ b/bootstrap/windows-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index 322be252..25bab77d 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index d7a81d4e..2147f066 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/08/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/src/compiler/OPV.Mod b/src/compiler/OPV.Mod index d0cbde89..3c561714 100644 --- a/src/compiler/OPV.Mod +++ b/src/compiler/OPV.Mod @@ -723,7 +723,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 design(d, MinPrec); OPM.WriteString(" = __NEWARR("); WHILE base^.comp = OPT.Array DO INC(nofdim); base := base^.BaseTyp END ; IF (base^.comp = OPT.Record) & (OPC.NofPtrs(base) # 0) THEN - OPC.Ident(base^.strobj); OPM.WriteString(DynTypExt) + OPC.Andent(base); OPM.WriteString(DynTypExt) ELSIF base^.form = OPT.Pointer THEN OPM.WriteString("POINTER__typ") ELSE OPM.WriteString("NIL") END ; From 1bd70f367e5c30b2ffc3b9a6d774b39062859dee Mon Sep 17 00:00:00 2001 From: David Brown Date: Wed, 6 Sep 2017 13:07:00 +0100 Subject: [PATCH 476/580] Correct size_t definition for OpenBSD .gt. 6.2 thanks to @ibara --- bootstrap/SYSTEM.h | 6 +++++- bootstrap/unix-44/Compiler.c | 2 +- bootstrap/unix-44/Configuration.c | 4 ++-- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Files.c | 2 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 2 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 2 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 2 +- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 2 +- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 2 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Out.c | 2 +- bootstrap/unix-44/Out.h | 2 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/VT100.c | 2 +- bootstrap/unix-44/VT100.h | 2 +- bootstrap/unix-44/extTools.c | 4 ++-- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-48/Compiler.c | 2 +- bootstrap/unix-48/Configuration.c | 4 ++-- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Files.c | 2 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 2 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 2 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 2 +- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 2 +- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 2 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Out.c | 2 +- bootstrap/unix-48/Out.h | 2 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/VT100.c | 2 +- bootstrap/unix-48/VT100.h | 2 +- bootstrap/unix-48/extTools.c | 4 ++-- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-88/Compiler.c | 2 +- bootstrap/unix-88/Configuration.c | 4 ++-- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Files.c | 2 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 2 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 2 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 2 +- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 2 +- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 2 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Out.c | 2 +- bootstrap/unix-88/Out.h | 2 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/VT100.c | 2 +- bootstrap/unix-88/VT100.h | 2 +- bootstrap/unix-88/extTools.c | 4 ++-- bootstrap/unix-88/extTools.h | 2 +- bootstrap/windows-48/Compiler.c | 2 +- bootstrap/windows-48/Configuration.c | 4 ++-- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Files.c | 2 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 2 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 2 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 2 +- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 2 +- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 2 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Out.c | 2 +- bootstrap/windows-48/Out.h | 2 +- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/VT100.c | 2 +- bootstrap/windows-48/VT100.h | 2 +- bootstrap/windows-48/extTools.c | 4 ++-- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-88/Compiler.c | 2 +- bootstrap/windows-88/Configuration.c | 4 ++-- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Files.c | 2 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 2 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 2 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 2 +- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 2 +- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 2 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Out.c | 2 +- bootstrap/windows-88/Out.h | 2 +- bootstrap/windows-88/Platform.c | 2 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/VT100.c | 2 +- bootstrap/windows-88/VT100.h | 2 +- bootstrap/windows-88/extTools.c | 4 ++-- bootstrap/windows-88/extTools.h | 2 +- src/runtime/SYSTEM.h | 6 +++++- 187 files changed, 205 insertions(+), 197 deletions(-) diff --git a/bootstrap/SYSTEM.h b/bootstrap/SYSTEM.h index f6936068..07c6fd10 100644 --- a/bootstrap/SYSTEM.h +++ b/bootstrap/SYSTEM.h @@ -19,7 +19,11 @@ typedef unsigned long size_t; #endif #else - typedef unsigned int size_t; + #if defined(__OpenBSD__) + typedef unsigned long size_t; + #else + typedef unsigned int size_t; + #endif #endif #define _SIZE_T_DECLARED // For FreeBSD diff --git a/bootstrap/unix-44/Compiler.c b/bootstrap/unix-44/Compiler.c index 90b947ab..2203e4f8 100644 --- a/bootstrap/unix-44/Compiler.c +++ b/bootstrap/unix-44/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index aec51f79..147e327d 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index b40df642..0305bae4 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index efcd4956..8f2f8230 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index 3bcc1ece..d6a5d787 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index 334d6938..8a2f0e42 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index f4cc3fdc..ea56eef7 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index fdb70b86..e85d6101 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index 8b9aba1f..0211f78f 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index d80e722c..73efb8c0 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index 0f61f41b..d8958167 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 7a7d65ef..ff43f636 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index 808b1e30..8fe51423 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 642a2726..df753954 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index 81facffb..1070c69d 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index d0e34e2b..309fcc08 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index 3f6b4335..91257d84 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index c89499f5..491875a6 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index e2e6aa76..c78ec622 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index 9e8900ee..0ddf36a5 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index 2b8d4909..1ba549d5 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index 31e6b9ff..0201fc46 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index 74fbddfb..6acedcaa 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Out.c b/bootstrap/unix-44/Out.c index 5f010012..5848b15c 100644 --- a/bootstrap/unix-44/Out.c +++ b/bootstrap/unix-44/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Out.h b/bootstrap/unix-44/Out.h index b6de9e8e..4b15ee99 100644 --- a/bootstrap/unix-44/Out.h +++ b/bootstrap/unix-44/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 71910286..586721ce 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index f03d47db..66d3628b 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 24d6dbae..f5368742 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index 9afdda57..a40de618 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index f71e1011..abdb14f8 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index c5c20d62..0f2f8b74 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index f49afd81..6a395344 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index b6dd28f9..5feaaaf3 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/VT100.c b/bootstrap/unix-44/VT100.c index f4bad650..ff34c312 100644 --- a/bootstrap/unix-44/VT100.c +++ b/bootstrap/unix-44/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/VT100.h b/bootstrap/unix-44/VT100.h index 348d31de..2ddae6a2 100644 --- a/bootstrap/unix-44/VT100.h +++ b/bootstrap/unix-44/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index 25bab77d..982447f2 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -72,7 +72,7 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) { - __COPY("gcc -fPIC -g", s, s__len); + __COPY("gcc -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index 2147f066..3b45a534 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/Compiler.c b/bootstrap/unix-48/Compiler.c index 90b947ab..2203e4f8 100644 --- a/bootstrap/unix-48/Compiler.c +++ b/bootstrap/unix-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index aec51f79..147e327d 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index b40df642..0305bae4 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index efcd4956..8f2f8230 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index 3bcc1ece..d6a5d787 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index 334d6938..8a2f0e42 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index f4cc3fdc..ea56eef7 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index fdb70b86..e85d6101 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index 8b9aba1f..0211f78f 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index d80e722c..73efb8c0 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index 0f61f41b..d8958167 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 7a7d65ef..ff43f636 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index 808b1e30..8fe51423 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 642a2726..df753954 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index 81facffb..1070c69d 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index d0e34e2b..309fcc08 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index 3f6b4335..91257d84 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index c89499f5..491875a6 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index e2e6aa76..c78ec622 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 6ed97a79..0dd59e3a 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index 2b8d4909..1ba549d5 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index 31e6b9ff..0201fc46 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index 74fbddfb..6acedcaa 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Out.c b/bootstrap/unix-48/Out.c index 5f010012..5848b15c 100644 --- a/bootstrap/unix-48/Out.c +++ b/bootstrap/unix-48/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Out.h b/bootstrap/unix-48/Out.h index b6de9e8e..4b15ee99 100644 --- a/bootstrap/unix-48/Out.h +++ b/bootstrap/unix-48/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 71910286..586721ce 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index f03d47db..66d3628b 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 24d6dbae..f5368742 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index 9afdda57..a40de618 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index f71e1011..abdb14f8 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index c5c20d62..0f2f8b74 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index bf746ce0..d7491951 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index adeaa30f..70bac541 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/VT100.c b/bootstrap/unix-48/VT100.c index f4bad650..ff34c312 100644 --- a/bootstrap/unix-48/VT100.c +++ b/bootstrap/unix-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/VT100.h b/bootstrap/unix-48/VT100.h index 348d31de..2ddae6a2 100644 --- a/bootstrap/unix-48/VT100.h +++ b/bootstrap/unix-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index 25bab77d..982447f2 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -72,7 +72,7 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) { - __COPY("gcc -fPIC -g", s, s__len); + __COPY("gcc -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index 2147f066..3b45a534 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/Compiler.c b/bootstrap/unix-88/Compiler.c index 90b947ab..2203e4f8 100644 --- a/bootstrap/unix-88/Compiler.c +++ b/bootstrap/unix-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index aec51f79..147e327d 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index b40df642..0305bae4 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index b6c2fa2a..119f0290 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 23eb0ae2..730acfa4 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index b5548143..58d587c5 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index 2e1f525b..39fa0153 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index f208a346..1cd6c686 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index f9b45430..12d1a18d 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index d80e722c..73efb8c0 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index 0f61f41b..d8958167 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index 7a7d65ef..ff43f636 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index 808b1e30..8fe51423 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 89456899..cec560bf 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index 81facffb..1070c69d 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index 122e2f6c..fd1f6597 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index 3f6b4335..91257d84 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index c89499f5..491875a6 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index e2e6aa76..c78ec622 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index 984753b2..df13f5c8 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 2b8d4909..1ba549d5 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 423bbdef..d8a4f2b4 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index 74fbddfb..6acedcaa 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Out.c b/bootstrap/unix-88/Out.c index 5f010012..5848b15c 100644 --- a/bootstrap/unix-88/Out.c +++ b/bootstrap/unix-88/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Out.h b/bootstrap/unix-88/Out.h index b6de9e8e..4b15ee99 100644 --- a/bootstrap/unix-88/Out.h +++ b/bootstrap/unix-88/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index a28f82bf..5bcea939 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index 8f982d78..eebba012 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 24d6dbae..f5368742 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index 9afdda57..a40de618 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index f71e1011..abdb14f8 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index c5c20d62..0f2f8b74 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index 3eec265c..10b78453 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index 9e0758f9..2ca102c0 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/VT100.c b/bootstrap/unix-88/VT100.c index f4bad650..ff34c312 100644 --- a/bootstrap/unix-88/VT100.c +++ b/bootstrap/unix-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/VT100.h b/bootstrap/unix-88/VT100.h index 348d31de..2ddae6a2 100644 --- a/bootstrap/unix-88/VT100.h +++ b/bootstrap/unix-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index 25bab77d..982447f2 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -72,7 +72,7 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) { - __COPY("gcc -fPIC -g", s, s__len); + __COPY("gcc -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index 2147f066..3b45a534 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/Compiler.c b/bootstrap/windows-48/Compiler.c index 90b947ab..2203e4f8 100644 --- a/bootstrap/windows-48/Compiler.c +++ b/bootstrap/windows-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index aec51f79..147e327d 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index b40df642..0305bae4 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 7ba212c5..39b7e631 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index 1cf7bd4f..dca242d4 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index 334d6938..8a2f0e42 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index f4cc3fdc..ea56eef7 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index 2e36c7d8..3ef7d5ed 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index 8b9aba1f..0211f78f 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index d80e722c..73efb8c0 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index 0f61f41b..d8958167 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 7a7d65ef..ff43f636 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index 808b1e30..8fe51423 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 642a2726..df753954 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index 81facffb..1070c69d 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index d0e34e2b..309fcc08 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index 3f6b4335..91257d84 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index c89499f5..491875a6 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index e2e6aa76..c78ec622 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 6ed97a79..0dd59e3a 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index 2b8d4909..1ba549d5 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index 31e6b9ff..0201fc46 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index 74fbddfb..6acedcaa 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Out.c b/bootstrap/windows-48/Out.c index d040a272..bd4613d3 100644 --- a/bootstrap/windows-48/Out.c +++ b/bootstrap/windows-48/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Out.h b/bootstrap/windows-48/Out.h index b6de9e8e..4b15ee99 100644 --- a/bootstrap/windows-48/Out.h +++ b/bootstrap/windows-48/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 73da4e17..095e52f8 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index 58d8837d..7a25825b 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 24d6dbae..f5368742 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index 9afdda57..a40de618 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index f71e1011..abdb14f8 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index c5c20d62..0f2f8b74 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index bf746ce0..d7491951 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index adeaa30f..70bac541 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/VT100.c b/bootstrap/windows-48/VT100.c index f4bad650..ff34c312 100644 --- a/bootstrap/windows-48/VT100.c +++ b/bootstrap/windows-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/VT100.h b/bootstrap/windows-48/VT100.h index 348d31de..2ddae6a2 100644 --- a/bootstrap/windows-48/VT100.h +++ b/bootstrap/windows-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index 25bab77d..982447f2 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -72,7 +72,7 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) { - __COPY("gcc -fPIC -g", s, s__len); + __COPY("gcc -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index 2147f066..3b45a534 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/Compiler.c b/bootstrap/windows-88/Compiler.c index 90b947ab..2203e4f8 100644 --- a/bootstrap/windows-88/Compiler.c +++ b/bootstrap/windows-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index aec51f79..147e327d 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index b40df642..0305bae4 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 892a21b6..e09fa2cb 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 8552fb5d..22d3da2d 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index b5548143..58d587c5 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index 2e1f525b..39fa0153 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 58f86435..4897dfa4 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index f9b45430..12d1a18d 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index d80e722c..73efb8c0 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index 0f61f41b..d8958167 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index 7a7d65ef..ff43f636 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index 808b1e30..8fe51423 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 89456899..cec560bf 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index 81facffb..1070c69d 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index 122e2f6c..fd1f6597 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index 3f6b4335..91257d84 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index c89499f5..491875a6 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index e2e6aa76..c78ec622 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index 984753b2..df13f5c8 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 2b8d4909..1ba549d5 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 423bbdef..d8a4f2b4 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index 74fbddfb..6acedcaa 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Out.c b/bootstrap/windows-88/Out.c index d040a272..bd4613d3 100644 --- a/bootstrap/windows-88/Out.c +++ b/bootstrap/windows-88/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Out.h b/bootstrap/windows-88/Out.h index b6de9e8e..4b15ee99 100644 --- a/bootstrap/windows-88/Out.h +++ b/bootstrap/windows-88/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 528b9c9c..d1b69ffd 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index ea34c3d3..e8e2dae2 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 24d6dbae..f5368742 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index 9afdda57..a40de618 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index f71e1011..abdb14f8 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index c5c20d62..0f2f8b74 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index 3eec265c..10b78453 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index 9e0758f9..2ca102c0 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/VT100.c b/bootstrap/windows-88/VT100.c index f4bad650..ff34c312 100644 --- a/bootstrap/windows-88/VT100.c +++ b/bootstrap/windows-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/VT100.h b/bootstrap/windows-88/VT100.h index 348d31de..2ddae6a2 100644 --- a/bootstrap/windows-88/VT100.h +++ b/bootstrap/windows-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index 25bab77d..982447f2 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -72,7 +72,7 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) { - __COPY("gcc -fPIC -g", s, s__len); + __COPY("gcc -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index 2147f066..3b45a534 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/02]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/src/runtime/SYSTEM.h b/src/runtime/SYSTEM.h index f6936068..07c6fd10 100644 --- a/src/runtime/SYSTEM.h +++ b/src/runtime/SYSTEM.h @@ -19,7 +19,11 @@ typedef unsigned long size_t; #endif #else - typedef unsigned int size_t; + #if defined(__OpenBSD__) + typedef unsigned long size_t; + #else + typedef unsigned int size_t; + #endif #endif #define _SIZE_T_DECLARED // For FreeBSD From 9470716304af88806f36889ccabf679d64411a93 Mon Sep 17 00:00:00 2001 From: Norayr Chilingarian Date: Tue, 10 Apr 2018 22:48:37 +0400 Subject: [PATCH 477/580] issue #64 https://github.com/vishaps/voc/issues/64 --- src/runtime/Files.Mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runtime/Files.Mod b/src/runtime/Files.Mod index eb369b3c..c06d2f2b 100644 --- a/src/runtime/Files.Mod +++ b/src/runtime/Files.Mod @@ -29,7 +29,7 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files name *) TYPE - FileName = ARRAY 101 OF CHAR; + FileName = ARRAY 256 OF CHAR; File* = POINTER TO FileDesc; Buffer = POINTER TO BufDesc; From c43644ffebed3b1574a0161b8fdde7beff8e3e22 Mon Sep 17 00:00:00 2001 From: Norayr Chilingarian Date: Tue, 10 Apr 2018 22:51:26 +0400 Subject: [PATCH 478/580] bootstrap sources update. --- bootstrap/unix-44/Compiler.c | 2 +- bootstrap/unix-44/Configuration.c | 4 +-- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Files.c | 38 ++++++++++++++-------------- bootstrap/unix-44/Files.h | 4 +-- bootstrap/unix-44/Heap.c | 2 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 2 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 2 +- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 2 +- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 2 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Out.c | 2 +- bootstrap/unix-44/Out.h | 2 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/VT100.c | 2 +- bootstrap/unix-44/VT100.h | 2 +- bootstrap/unix-44/extTools.c | 4 +-- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-48/Compiler.c | 2 +- bootstrap/unix-48/Configuration.c | 4 +-- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Files.c | 38 ++++++++++++++-------------- bootstrap/unix-48/Files.h | 4 +-- bootstrap/unix-48/Heap.c | 2 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 2 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 2 +- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 2 +- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 2 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Out.c | 2 +- bootstrap/unix-48/Out.h | 2 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/VT100.c | 2 +- bootstrap/unix-48/VT100.h | 2 +- bootstrap/unix-48/extTools.c | 4 +-- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-88/Compiler.c | 2 +- bootstrap/unix-88/Configuration.c | 4 +-- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Files.c | 38 ++++++++++++++-------------- bootstrap/unix-88/Files.h | 4 +-- bootstrap/unix-88/Heap.c | 2 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 2 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 2 +- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 2 +- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 2 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Out.c | 2 +- bootstrap/unix-88/Out.h | 2 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/VT100.c | 2 +- bootstrap/unix-88/VT100.h | 2 +- bootstrap/unix-88/extTools.c | 4 +-- bootstrap/unix-88/extTools.h | 2 +- bootstrap/windows-48/Compiler.c | 2 +- bootstrap/windows-48/Configuration.c | 4 +-- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Files.c | 38 ++++++++++++++-------------- bootstrap/windows-48/Files.h | 4 +-- bootstrap/windows-48/Heap.c | 2 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 2 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 2 +- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 2 +- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 2 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Out.c | 2 +- bootstrap/windows-48/Out.h | 2 +- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/VT100.c | 2 +- bootstrap/windows-48/VT100.h | 2 +- bootstrap/windows-48/extTools.c | 4 +-- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-88/Compiler.c | 2 +- bootstrap/windows-88/Configuration.c | 4 +-- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Files.c | 38 ++++++++++++++-------------- bootstrap/windows-88/Files.h | 4 +-- bootstrap/windows-88/Heap.c | 2 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 2 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 2 +- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 2 +- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 2 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Out.c | 2 +- bootstrap/windows-88/Out.h | 2 +- bootstrap/windows-88/Platform.c | 2 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/VT100.c | 2 +- bootstrap/windows-88/VT100.h | 2 +- bootstrap/windows-88/extTools.c | 4 +-- bootstrap/windows-88/extTools.h | 2 +- 185 files changed, 290 insertions(+), 290 deletions(-) diff --git a/bootstrap/unix-44/Compiler.c b/bootstrap/unix-44/Compiler.c index 2203e4f8..10abd264 100644 --- a/bootstrap/unix-44/Compiler.c +++ b/bootstrap/unix-44/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index 147e327d..8eac398d 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index 0305bae4..c817585e 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 8f2f8230..333bdb63 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -26,7 +26,7 @@ typedef Files_BufDesc *Files_Buffer; typedef - CHAR Files_FileName[101]; + CHAR Files_FileName[256]; typedef struct Files_FileDesc { @@ -129,9 +129,9 @@ static void Files_Err (CHAR *s, ADDRESS s__len, Files_File f, INT16 errcode) Out_String((CHAR*)": ", 3); if (f != NIL) { if (f->registerName[0] != 0x00) { - Out_String(f->registerName, 101); + Out_String(f->registerName, 256); } else { - Out_String(f->workName, 101); + Out_String(f->workName, 256); } if (f->fd != 0) { Out_String((CHAR*)"f.fd = ", 8); @@ -236,11 +236,11 @@ static void Files_Deregister (CHAR *name, ADDRESS name__len) if (osfile != NIL) { __ASSERT(!osfile->tempFile, 0); __ASSERT(osfile->fd >= 0, 0); - __MOVE(osfile->workName, osfile->registerName, 101); - Files_GetTempName(osfile->registerName, 101, (void*)osfile->workName, 101); + __MOVE(osfile->workName, osfile->registerName, 256); + Files_GetTempName(osfile->registerName, 256, (void*)osfile->workName, 256); osfile->tempFile = 1; osfile->state = 0; - error = Platform_Rename((void*)osfile->registerName, 101, (void*)osfile->workName, 101); + error = Platform_Rename((void*)osfile->registerName, 256, (void*)osfile->workName, 256); if (error != 0) { Files_Err((CHAR*)"Couldn't rename previous version of file being registered", 58, osfile, error); } @@ -256,17 +256,17 @@ static void Files_Create (Files_File f) CHAR err[32]; if (f->fd == -1) { if (f->state == 1) { - Files_GetTempName(f->registerName, 101, (void*)f->workName, 101); + Files_GetTempName(f->registerName, 256, (void*)f->workName, 256); f->tempFile = 1; } else { __ASSERT(f->state == 2, 0); - Files_Deregister(f->registerName, 101); - __MOVE(f->registerName, f->workName, 101); + Files_Deregister(f->registerName, 256); + __MOVE(f->registerName, f->workName, 256); f->registerName[0] = 0x00; f->tempFile = 0; } - error = Platform_Unlink((void*)f->workName, 101); - error = Platform_New((void*)f->workName, 101, &f->fd); + error = Platform_Unlink((void*)f->workName, 256); + error = Platform_New((void*)f->workName, 256, &f->fd); done = error == 0; if (done) { f->next = Files_files; @@ -337,7 +337,7 @@ Files_File Files_New (CHAR *name, ADDRESS name__len) __DUP(name, name__len, CHAR); __NEW(f, Files_FileDesc); f->workName[0] = 0x00; - __COPY(name, f->registerName, 101); + __COPY(name, f->registerName, 256); f->fd = -1; f->state = 1; f->len = 0; @@ -482,7 +482,7 @@ Files_File Files_Old (CHAR *name, ADDRESS name__len) f->pos = 0; f->swapper = -1; error = Platform_Size(fd, &f->len); - __COPY(name, f->workName, 101); + __COPY(name, f->workName, 256); f->registerName[0] = 0x00; f->tempFile = 0; f->identity = identity; @@ -817,12 +817,12 @@ void Files_Register (Files_File f) } Files_Close(f); if (f->registerName[0] != 0x00) { - Files_Deregister(f->registerName, 101); - Files_Rename(f->workName, 101, f->registerName, 101, &errcode); + Files_Deregister(f->registerName, 256); + Files_Rename(f->workName, 256, f->registerName, 256, &errcode); if (errcode != 0) { Files_Err((CHAR*)"Couldn't rename temp name as register name", 43, f, errcode); } - __MOVE(f->registerName, f->workName, 101); + __MOVE(f->registerName, f->workName, 256); f->registerName[0] = 0x00; f->tempFile = 0; } @@ -1041,7 +1041,7 @@ static void Files_Finalize (SYSTEM_PTR o) if (f->fd >= 0) { Files_CloseOSFile(f); if (f->tempFile) { - res = Platform_Unlink((void*)f->workName, 101); + res = Platform_Unlink((void*)f->workName, 256); } } } @@ -1063,7 +1063,7 @@ static void EnumPtrs(void (*P)(void*)) P(Files_SearchPath); } -__TDESC(Files_FileDesc, 1, 4) = {__TDFLDS("FileDesc", 252), {228, 232, 236, 240, -20}}; +__TDESC(Files_FileDesc, 1, 4) = {__TDFLDS("FileDesc", 564), {540, 544, 548, 552, -20}}; __TDESC(Files_BufDesc, 1, 1) = {__TDFLDS("BufDesc", 4112), {0, -8}}; __TDESC(Files_Rider, 1, 1) = {__TDFLDS("Rider", 20), {8, -8}}; diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index d6a5d787..8c775fa4 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h @@ -11,7 +11,7 @@ typedef typedef struct Files_FileDesc { INT32 _prvt0; - char _prvt1[248]; + char _prvt1[560]; } Files_FileDesc; typedef diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index 8a2f0e42..348b336b 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index ea56eef7..b73de4fe 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index e85d6101..89f370a7 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index 0211f78f..2d074a62 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index 73efb8c0..41e56e38 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index d8958167..0eba52d2 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index ff43f636..7fa9fa23 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index 8fe51423..1e17f6c2 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index df753954..3dbed3bf 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index 1070c69d..9c84b7af 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index 309fcc08..00e4fa0e 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index 91257d84..010479f8 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index 491875a6..74719041 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index c78ec622..dfe2b972 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index 0ddf36a5..d6a4c67b 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index 1ba549d5..f457c51e 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index 0201fc46..5193f272 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index 6acedcaa..bee5e44d 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Out.c b/bootstrap/unix-44/Out.c index 5848b15c..54d88edf 100644 --- a/bootstrap/unix-44/Out.c +++ b/bootstrap/unix-44/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Out.h b/bootstrap/unix-44/Out.h index 4b15ee99..fad5cd1a 100644 --- a/bootstrap/unix-44/Out.h +++ b/bootstrap/unix-44/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 586721ce..86284785 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index 66d3628b..c4f8841c 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index f5368742..2af2574f 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index a40de618..07f4371d 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index abdb14f8..3d82b654 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index 0f2f8b74..df6f5edc 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index 6a395344..e4ee535c 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index 5feaaaf3..d53e287c 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/VT100.c b/bootstrap/unix-44/VT100.c index ff34c312..5bfcea49 100644 --- a/bootstrap/unix-44/VT100.c +++ b/bootstrap/unix-44/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/VT100.h b/bootstrap/unix-44/VT100.h index 2ddae6a2..51c85058 100644 --- a/bootstrap/unix-44/VT100.h +++ b/bootstrap/unix-44/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index 982447f2..2b6c962b 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -72,7 +72,7 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) { - __COPY("gcc -g", s, s__len); + __COPY("gcc -fPIC -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index 3b45a534..9b0b1ee9 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/Compiler.c b/bootstrap/unix-48/Compiler.c index 2203e4f8..10abd264 100644 --- a/bootstrap/unix-48/Compiler.c +++ b/bootstrap/unix-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index 147e327d..8eac398d 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index 0305bae4..c817585e 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 8f2f8230..333bdb63 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -26,7 +26,7 @@ typedef Files_BufDesc *Files_Buffer; typedef - CHAR Files_FileName[101]; + CHAR Files_FileName[256]; typedef struct Files_FileDesc { @@ -129,9 +129,9 @@ static void Files_Err (CHAR *s, ADDRESS s__len, Files_File f, INT16 errcode) Out_String((CHAR*)": ", 3); if (f != NIL) { if (f->registerName[0] != 0x00) { - Out_String(f->registerName, 101); + Out_String(f->registerName, 256); } else { - Out_String(f->workName, 101); + Out_String(f->workName, 256); } if (f->fd != 0) { Out_String((CHAR*)"f.fd = ", 8); @@ -236,11 +236,11 @@ static void Files_Deregister (CHAR *name, ADDRESS name__len) if (osfile != NIL) { __ASSERT(!osfile->tempFile, 0); __ASSERT(osfile->fd >= 0, 0); - __MOVE(osfile->workName, osfile->registerName, 101); - Files_GetTempName(osfile->registerName, 101, (void*)osfile->workName, 101); + __MOVE(osfile->workName, osfile->registerName, 256); + Files_GetTempName(osfile->registerName, 256, (void*)osfile->workName, 256); osfile->tempFile = 1; osfile->state = 0; - error = Platform_Rename((void*)osfile->registerName, 101, (void*)osfile->workName, 101); + error = Platform_Rename((void*)osfile->registerName, 256, (void*)osfile->workName, 256); if (error != 0) { Files_Err((CHAR*)"Couldn't rename previous version of file being registered", 58, osfile, error); } @@ -256,17 +256,17 @@ static void Files_Create (Files_File f) CHAR err[32]; if (f->fd == -1) { if (f->state == 1) { - Files_GetTempName(f->registerName, 101, (void*)f->workName, 101); + Files_GetTempName(f->registerName, 256, (void*)f->workName, 256); f->tempFile = 1; } else { __ASSERT(f->state == 2, 0); - Files_Deregister(f->registerName, 101); - __MOVE(f->registerName, f->workName, 101); + Files_Deregister(f->registerName, 256); + __MOVE(f->registerName, f->workName, 256); f->registerName[0] = 0x00; f->tempFile = 0; } - error = Platform_Unlink((void*)f->workName, 101); - error = Platform_New((void*)f->workName, 101, &f->fd); + error = Platform_Unlink((void*)f->workName, 256); + error = Platform_New((void*)f->workName, 256, &f->fd); done = error == 0; if (done) { f->next = Files_files; @@ -337,7 +337,7 @@ Files_File Files_New (CHAR *name, ADDRESS name__len) __DUP(name, name__len, CHAR); __NEW(f, Files_FileDesc); f->workName[0] = 0x00; - __COPY(name, f->registerName, 101); + __COPY(name, f->registerName, 256); f->fd = -1; f->state = 1; f->len = 0; @@ -482,7 +482,7 @@ Files_File Files_Old (CHAR *name, ADDRESS name__len) f->pos = 0; f->swapper = -1; error = Platform_Size(fd, &f->len); - __COPY(name, f->workName, 101); + __COPY(name, f->workName, 256); f->registerName[0] = 0x00; f->tempFile = 0; f->identity = identity; @@ -817,12 +817,12 @@ void Files_Register (Files_File f) } Files_Close(f); if (f->registerName[0] != 0x00) { - Files_Deregister(f->registerName, 101); - Files_Rename(f->workName, 101, f->registerName, 101, &errcode); + Files_Deregister(f->registerName, 256); + Files_Rename(f->workName, 256, f->registerName, 256, &errcode); if (errcode != 0) { Files_Err((CHAR*)"Couldn't rename temp name as register name", 43, f, errcode); } - __MOVE(f->registerName, f->workName, 101); + __MOVE(f->registerName, f->workName, 256); f->registerName[0] = 0x00; f->tempFile = 0; } @@ -1041,7 +1041,7 @@ static void Files_Finalize (SYSTEM_PTR o) if (f->fd >= 0) { Files_CloseOSFile(f); if (f->tempFile) { - res = Platform_Unlink((void*)f->workName, 101); + res = Platform_Unlink((void*)f->workName, 256); } } } @@ -1063,7 +1063,7 @@ static void EnumPtrs(void (*P)(void*)) P(Files_SearchPath); } -__TDESC(Files_FileDesc, 1, 4) = {__TDFLDS("FileDesc", 252), {228, 232, 236, 240, -20}}; +__TDESC(Files_FileDesc, 1, 4) = {__TDFLDS("FileDesc", 564), {540, 544, 548, 552, -20}}; __TDESC(Files_BufDesc, 1, 1) = {__TDFLDS("BufDesc", 4112), {0, -8}}; __TDESC(Files_Rider, 1, 1) = {__TDFLDS("Rider", 20), {8, -8}}; diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index d6a5d787..8c775fa4 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h @@ -11,7 +11,7 @@ typedef typedef struct Files_FileDesc { INT32 _prvt0; - char _prvt1[248]; + char _prvt1[560]; } Files_FileDesc; typedef diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index 8a2f0e42..348b336b 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index ea56eef7..b73de4fe 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index e85d6101..89f370a7 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index 0211f78f..2d074a62 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index 73efb8c0..41e56e38 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index d8958167..0eba52d2 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index ff43f636..7fa9fa23 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index 8fe51423..1e17f6c2 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index df753954..3dbed3bf 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index 1070c69d..9c84b7af 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index 309fcc08..00e4fa0e 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index 91257d84..010479f8 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index 491875a6..74719041 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index c78ec622..dfe2b972 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 0dd59e3a..962b0f86 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index 1ba549d5..f457c51e 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index 0201fc46..5193f272 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index 6acedcaa..bee5e44d 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Out.c b/bootstrap/unix-48/Out.c index 5848b15c..54d88edf 100644 --- a/bootstrap/unix-48/Out.c +++ b/bootstrap/unix-48/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Out.h b/bootstrap/unix-48/Out.h index 4b15ee99..fad5cd1a 100644 --- a/bootstrap/unix-48/Out.h +++ b/bootstrap/unix-48/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 586721ce..86284785 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index 66d3628b..c4f8841c 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index f5368742..2af2574f 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index a40de618..07f4371d 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index abdb14f8..3d82b654 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index 0f2f8b74..df6f5edc 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index d7491951..8e4938b8 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index 70bac541..0c55850a 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/VT100.c b/bootstrap/unix-48/VT100.c index ff34c312..5bfcea49 100644 --- a/bootstrap/unix-48/VT100.c +++ b/bootstrap/unix-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/VT100.h b/bootstrap/unix-48/VT100.h index 2ddae6a2..51c85058 100644 --- a/bootstrap/unix-48/VT100.h +++ b/bootstrap/unix-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index 982447f2..2b6c962b 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -72,7 +72,7 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) { - __COPY("gcc -g", s, s__len); + __COPY("gcc -fPIC -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index 3b45a534..9b0b1ee9 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/Compiler.c b/bootstrap/unix-88/Compiler.c index 2203e4f8..10abd264 100644 --- a/bootstrap/unix-88/Compiler.c +++ b/bootstrap/unix-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index 147e327d..8eac398d 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index 0305bae4..c817585e 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 119f0290..4e3baead 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -26,7 +26,7 @@ typedef Files_BufDesc *Files_Buffer; typedef - CHAR Files_FileName[101]; + CHAR Files_FileName[256]; typedef struct Files_FileDesc { @@ -129,9 +129,9 @@ static void Files_Err (CHAR *s, ADDRESS s__len, Files_File f, INT16 errcode) Out_String((CHAR*)": ", 3); if (f != NIL) { if (f->registerName[0] != 0x00) { - Out_String(f->registerName, 101); + Out_String(f->registerName, 256); } else { - Out_String(f->workName, 101); + Out_String(f->workName, 256); } if (f->fd != 0) { Out_String((CHAR*)"f.fd = ", 8); @@ -236,11 +236,11 @@ static void Files_Deregister (CHAR *name, ADDRESS name__len) if (osfile != NIL) { __ASSERT(!osfile->tempFile, 0); __ASSERT(osfile->fd >= 0, 0); - __MOVE(osfile->workName, osfile->registerName, 101); - Files_GetTempName(osfile->registerName, 101, (void*)osfile->workName, 101); + __MOVE(osfile->workName, osfile->registerName, 256); + Files_GetTempName(osfile->registerName, 256, (void*)osfile->workName, 256); osfile->tempFile = 1; osfile->state = 0; - error = Platform_Rename((void*)osfile->registerName, 101, (void*)osfile->workName, 101); + error = Platform_Rename((void*)osfile->registerName, 256, (void*)osfile->workName, 256); if (error != 0) { Files_Err((CHAR*)"Couldn't rename previous version of file being registered", 58, osfile, error); } @@ -256,17 +256,17 @@ static void Files_Create (Files_File f) CHAR err[32]; if (f->fd == -1) { if (f->state == 1) { - Files_GetTempName(f->registerName, 101, (void*)f->workName, 101); + Files_GetTempName(f->registerName, 256, (void*)f->workName, 256); f->tempFile = 1; } else { __ASSERT(f->state == 2, 0); - Files_Deregister(f->registerName, 101); - __MOVE(f->registerName, f->workName, 101); + Files_Deregister(f->registerName, 256); + __MOVE(f->registerName, f->workName, 256); f->registerName[0] = 0x00; f->tempFile = 0; } - error = Platform_Unlink((void*)f->workName, 101); - error = Platform_New((void*)f->workName, 101, &f->fd); + error = Platform_Unlink((void*)f->workName, 256); + error = Platform_New((void*)f->workName, 256, &f->fd); done = error == 0; if (done) { f->next = Files_files; @@ -337,7 +337,7 @@ Files_File Files_New (CHAR *name, ADDRESS name__len) __DUP(name, name__len, CHAR); __NEW(f, Files_FileDesc); f->workName[0] = 0x00; - __COPY(name, f->registerName, 101); + __COPY(name, f->registerName, 256); f->fd = -1; f->state = 1; f->len = 0; @@ -482,7 +482,7 @@ Files_File Files_Old (CHAR *name, ADDRESS name__len) f->pos = 0; f->swapper = -1; error = Platform_Size(fd, &f->len); - __COPY(name, f->workName, 101); + __COPY(name, f->workName, 256); f->registerName[0] = 0x00; f->tempFile = 0; f->identity = identity; @@ -817,12 +817,12 @@ void Files_Register (Files_File f) } Files_Close(f); if (f->registerName[0] != 0x00) { - Files_Deregister(f->registerName, 101); - Files_Rename(f->workName, 101, f->registerName, 101, &errcode); + Files_Deregister(f->registerName, 256); + Files_Rename(f->workName, 256, f->registerName, 256, &errcode); if (errcode != 0) { Files_Err((CHAR*)"Couldn't rename temp name as register name", 43, f, errcode); } - __MOVE(f->registerName, f->workName, 101); + __MOVE(f->registerName, f->workName, 256); f->registerName[0] = 0x00; f->tempFile = 0; } @@ -1041,7 +1041,7 @@ static void Files_Finalize (SYSTEM_PTR o) if (f->fd >= 0) { Files_CloseOSFile(f); if (f->tempFile) { - res = Platform_Unlink((void*)f->workName, 101); + res = Platform_Unlink((void*)f->workName, 256); } } } @@ -1063,7 +1063,7 @@ static void EnumPtrs(void (*P)(void*)) P(Files_SearchPath); } -__TDESC(Files_FileDesc, 1, 4) = {__TDFLDS("FileDesc", 280), {232, 240, 248, 256, -40}}; +__TDESC(Files_FileDesc, 1, 4) = {__TDFLDS("FileDesc", 592), {544, 552, 560, 568, -40}}; __TDESC(Files_BufDesc, 1, 1) = {__TDFLDS("BufDesc", 4120), {0, -16}}; __TDESC(Files_Rider, 1, 1) = {__TDFLDS("Rider", 24), {8, -16}}; diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 730acfa4..b0056ea8 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h @@ -11,7 +11,7 @@ typedef typedef struct Files_FileDesc { INT64 _prvt0; - char _prvt1[272]; + char _prvt1[584]; } Files_FileDesc; typedef diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index 58d587c5..9e99e657 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index 39fa0153..2b6287cd 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 1cd6c686..25d5f032 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index 12d1a18d..5d832fa6 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index 73efb8c0..41e56e38 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index d8958167..0eba52d2 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index ff43f636..7fa9fa23 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index 8fe51423..1e17f6c2 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index cec560bf..bcf72c6b 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index 1070c69d..9c84b7af 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index fd1f6597..18305e4c 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index 91257d84..010479f8 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index 491875a6..74719041 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index c78ec622..dfe2b972 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index df13f5c8..c6989580 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 1ba549d5..f457c51e 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index d8a4f2b4..617e9e58 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index 6acedcaa..bee5e44d 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Out.c b/bootstrap/unix-88/Out.c index 5848b15c..54d88edf 100644 --- a/bootstrap/unix-88/Out.c +++ b/bootstrap/unix-88/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Out.h b/bootstrap/unix-88/Out.h index 4b15ee99..fad5cd1a 100644 --- a/bootstrap/unix-88/Out.h +++ b/bootstrap/unix-88/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 5bcea939..bb97464a 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index eebba012..51911cc6 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index f5368742..2af2574f 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index a40de618..07f4371d 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index abdb14f8..3d82b654 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index 0f2f8b74..df6f5edc 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index 10b78453..82588563 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index 2ca102c0..b3dd50cb 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/VT100.c b/bootstrap/unix-88/VT100.c index ff34c312..5bfcea49 100644 --- a/bootstrap/unix-88/VT100.c +++ b/bootstrap/unix-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/VT100.h b/bootstrap/unix-88/VT100.h index 2ddae6a2..51c85058 100644 --- a/bootstrap/unix-88/VT100.h +++ b/bootstrap/unix-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index 982447f2..2b6c962b 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -72,7 +72,7 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) { - __COPY("gcc -g", s, s__len); + __COPY("gcc -fPIC -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index 3b45a534..9b0b1ee9 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/Compiler.c b/bootstrap/windows-48/Compiler.c index 2203e4f8..10abd264 100644 --- a/bootstrap/windows-48/Compiler.c +++ b/bootstrap/windows-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index 147e327d..8eac398d 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index 0305bae4..c817585e 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 39b7e631..15471c4f 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -26,7 +26,7 @@ typedef Files_BufDesc *Files_Buffer; typedef - CHAR Files_FileName[101]; + CHAR Files_FileName[256]; typedef struct Files_FileDesc { @@ -129,9 +129,9 @@ static void Files_Err (CHAR *s, ADDRESS s__len, Files_File f, INT16 errcode) Out_String((CHAR*)": ", 3); if (f != NIL) { if (f->registerName[0] != 0x00) { - Out_String(f->registerName, 101); + Out_String(f->registerName, 256); } else { - Out_String(f->workName, 101); + Out_String(f->workName, 256); } if (f->fd != 0) { Out_String((CHAR*)"f.fd = ", 8); @@ -236,11 +236,11 @@ static void Files_Deregister (CHAR *name, ADDRESS name__len) if (osfile != NIL) { __ASSERT(!osfile->tempFile, 0); __ASSERT(osfile->fd >= 0, 0); - __MOVE(osfile->workName, osfile->registerName, 101); - Files_GetTempName(osfile->registerName, 101, (void*)osfile->workName, 101); + __MOVE(osfile->workName, osfile->registerName, 256); + Files_GetTempName(osfile->registerName, 256, (void*)osfile->workName, 256); osfile->tempFile = 1; osfile->state = 0; - error = Platform_Rename((void*)osfile->registerName, 101, (void*)osfile->workName, 101); + error = Platform_Rename((void*)osfile->registerName, 256, (void*)osfile->workName, 256); if (error != 0) { Files_Err((CHAR*)"Couldn't rename previous version of file being registered", 58, osfile, error); } @@ -256,17 +256,17 @@ static void Files_Create (Files_File f) CHAR err[32]; if (f->fd == -1) { if (f->state == 1) { - Files_GetTempName(f->registerName, 101, (void*)f->workName, 101); + Files_GetTempName(f->registerName, 256, (void*)f->workName, 256); f->tempFile = 1; } else { __ASSERT(f->state == 2, 0); - Files_Deregister(f->registerName, 101); - __MOVE(f->registerName, f->workName, 101); + Files_Deregister(f->registerName, 256); + __MOVE(f->registerName, f->workName, 256); f->registerName[0] = 0x00; f->tempFile = 0; } - error = Platform_Unlink((void*)f->workName, 101); - error = Platform_New((void*)f->workName, 101, &f->fd); + error = Platform_Unlink((void*)f->workName, 256); + error = Platform_New((void*)f->workName, 256, &f->fd); done = error == 0; if (done) { f->next = Files_files; @@ -337,7 +337,7 @@ Files_File Files_New (CHAR *name, ADDRESS name__len) __DUP(name, name__len, CHAR); __NEW(f, Files_FileDesc); f->workName[0] = 0x00; - __COPY(name, f->registerName, 101); + __COPY(name, f->registerName, 256); f->fd = -1; f->state = 1; f->len = 0; @@ -482,7 +482,7 @@ Files_File Files_Old (CHAR *name, ADDRESS name__len) f->pos = 0; f->swapper = -1; error = Platform_Size(fd, &f->len); - __COPY(name, f->workName, 101); + __COPY(name, f->workName, 256); f->registerName[0] = 0x00; f->tempFile = 0; f->identity = identity; @@ -817,12 +817,12 @@ void Files_Register (Files_File f) } Files_Close(f); if (f->registerName[0] != 0x00) { - Files_Deregister(f->registerName, 101); - Files_Rename(f->workName, 101, f->registerName, 101, &errcode); + Files_Deregister(f->registerName, 256); + Files_Rename(f->workName, 256, f->registerName, 256, &errcode); if (errcode != 0) { Files_Err((CHAR*)"Couldn't rename temp name as register name", 43, f, errcode); } - __MOVE(f->registerName, f->workName, 101); + __MOVE(f->registerName, f->workName, 256); f->registerName[0] = 0x00; f->tempFile = 0; } @@ -1041,7 +1041,7 @@ static void Files_Finalize (SYSTEM_PTR o) if (f->fd >= 0) { Files_CloseOSFile(f); if (f->tempFile) { - res = Platform_Unlink((void*)f->workName, 101); + res = Platform_Unlink((void*)f->workName, 256); } } } @@ -1063,7 +1063,7 @@ static void EnumPtrs(void (*P)(void*)) P(Files_SearchPath); } -__TDESC(Files_FileDesc, 1, 4) = {__TDFLDS("FileDesc", 260), {236, 240, 244, 248, -20}}; +__TDESC(Files_FileDesc, 1, 4) = {__TDFLDS("FileDesc", 572), {548, 552, 556, 560, -20}}; __TDESC(Files_BufDesc, 1, 1) = {__TDFLDS("BufDesc", 4112), {0, -8}}; __TDESC(Files_Rider, 1, 1) = {__TDFLDS("Rider", 20), {8, -8}}; diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index dca242d4..25b5a32d 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h @@ -11,7 +11,7 @@ typedef typedef struct Files_FileDesc { INT32 _prvt0; - char _prvt1[256]; + char _prvt1[568]; } Files_FileDesc; typedef diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index 8a2f0e42..348b336b 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index ea56eef7..b73de4fe 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index 3ef7d5ed..e2075ab0 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index 0211f78f..2d074a62 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index 73efb8c0..41e56e38 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index d8958167..0eba52d2 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index ff43f636..7fa9fa23 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index 8fe51423..1e17f6c2 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index df753954..3dbed3bf 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index 1070c69d..9c84b7af 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index 309fcc08..00e4fa0e 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index 91257d84..010479f8 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index 491875a6..74719041 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index c78ec622..dfe2b972 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 0dd59e3a..962b0f86 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index 1ba549d5..f457c51e 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index 0201fc46..5193f272 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index 6acedcaa..bee5e44d 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Out.c b/bootstrap/windows-48/Out.c index bd4613d3..3bfb1ec7 100644 --- a/bootstrap/windows-48/Out.c +++ b/bootstrap/windows-48/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Out.h b/bootstrap/windows-48/Out.h index 4b15ee99..fad5cd1a 100644 --- a/bootstrap/windows-48/Out.h +++ b/bootstrap/windows-48/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 095e52f8..65fd2654 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index 7a25825b..47755d00 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index f5368742..2af2574f 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index a40de618..07f4371d 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index abdb14f8..3d82b654 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index 0f2f8b74..df6f5edc 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index d7491951..8e4938b8 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index 70bac541..0c55850a 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/VT100.c b/bootstrap/windows-48/VT100.c index ff34c312..5bfcea49 100644 --- a/bootstrap/windows-48/VT100.c +++ b/bootstrap/windows-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/VT100.h b/bootstrap/windows-48/VT100.h index 2ddae6a2..51c85058 100644 --- a/bootstrap/windows-48/VT100.h +++ b/bootstrap/windows-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index 982447f2..2b6c962b 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -72,7 +72,7 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) { - __COPY("gcc -g", s, s__len); + __COPY("gcc -fPIC -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index 3b45a534..9b0b1ee9 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/Compiler.c b/bootstrap/windows-88/Compiler.c index 2203e4f8..10abd264 100644 --- a/bootstrap/windows-88/Compiler.c +++ b/bootstrap/windows-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index 147e327d..8eac398d 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index 0305bae4..c817585e 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index e09fa2cb..7a28d41d 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -26,7 +26,7 @@ typedef Files_BufDesc *Files_Buffer; typedef - CHAR Files_FileName[101]; + CHAR Files_FileName[256]; typedef struct Files_FileDesc { @@ -130,9 +130,9 @@ static void Files_Err (CHAR *s, ADDRESS s__len, Files_File f, INT16 errcode) Out_String((CHAR*)": ", 3); if (f != NIL) { if (f->registerName[0] != 0x00) { - Out_String(f->registerName, 101); + Out_String(f->registerName, 256); } else { - Out_String(f->workName, 101); + Out_String(f->workName, 256); } if (f->fd != 0) { Out_String((CHAR*)"f.fd = ", 8); @@ -237,11 +237,11 @@ static void Files_Deregister (CHAR *name, ADDRESS name__len) if (osfile != NIL) { __ASSERT(!osfile->tempFile, 0); __ASSERT(osfile->fd >= 0, 0); - __MOVE(osfile->workName, osfile->registerName, 101); - Files_GetTempName(osfile->registerName, 101, (void*)osfile->workName, 101); + __MOVE(osfile->workName, osfile->registerName, 256); + Files_GetTempName(osfile->registerName, 256, (void*)osfile->workName, 256); osfile->tempFile = 1; osfile->state = 0; - error = Platform_Rename((void*)osfile->registerName, 101, (void*)osfile->workName, 101); + error = Platform_Rename((void*)osfile->registerName, 256, (void*)osfile->workName, 256); if (error != 0) { Files_Err((CHAR*)"Couldn't rename previous version of file being registered", 58, osfile, error); } @@ -257,17 +257,17 @@ static void Files_Create (Files_File f) CHAR err[32]; if (f->fd == -1) { if (f->state == 1) { - Files_GetTempName(f->registerName, 101, (void*)f->workName, 101); + Files_GetTempName(f->registerName, 256, (void*)f->workName, 256); f->tempFile = 1; } else { __ASSERT(f->state == 2, 0); - Files_Deregister(f->registerName, 101); - __MOVE(f->registerName, f->workName, 101); + Files_Deregister(f->registerName, 256); + __MOVE(f->registerName, f->workName, 256); f->registerName[0] = 0x00; f->tempFile = 0; } - error = Platform_Unlink((void*)f->workName, 101); - error = Platform_New((void*)f->workName, 101, &f->fd); + error = Platform_Unlink((void*)f->workName, 256); + error = Platform_New((void*)f->workName, 256, &f->fd); done = error == 0; if (done) { f->next = Files_files; @@ -338,7 +338,7 @@ Files_File Files_New (CHAR *name, ADDRESS name__len) __DUP(name, name__len, CHAR); __NEW(f, Files_FileDesc); f->workName[0] = 0x00; - __COPY(name, f->registerName, 101); + __COPY(name, f->registerName, 256); f->fd = -1; f->state = 1; f->len = 0; @@ -483,7 +483,7 @@ Files_File Files_Old (CHAR *name, ADDRESS name__len) f->pos = 0; f->swapper = -1; error = Platform_Size(fd, &f->len); - __COPY(name, f->workName, 101); + __COPY(name, f->workName, 256); f->registerName[0] = 0x00; f->tempFile = 0; f->identity = identity; @@ -819,12 +819,12 @@ void Files_Register (Files_File f) } Files_Close(f); if (f->registerName[0] != 0x00) { - Files_Deregister(f->registerName, 101); - Files_Rename(f->workName, 101, f->registerName, 101, &errcode); + Files_Deregister(f->registerName, 256); + Files_Rename(f->workName, 256, f->registerName, 256, &errcode); if (errcode != 0) { Files_Err((CHAR*)"Couldn't rename temp name as register name", 43, f, errcode); } - __MOVE(f->registerName, f->workName, 101); + __MOVE(f->registerName, f->workName, 256); f->registerName[0] = 0x00; f->tempFile = 0; } @@ -1043,7 +1043,7 @@ static void Files_Finalize (SYSTEM_PTR o) if (f->fd >= 0) { Files_CloseOSFile(f); if (f->tempFile) { - res = Platform_Unlink((void*)f->workName, 101); + res = Platform_Unlink((void*)f->workName, 256); } } } @@ -1065,7 +1065,7 @@ static void EnumPtrs(void (*P)(void*)) P(Files_SearchPath); } -__TDESC(Files_FileDesc, 1, 4) = {__TDFLDS("FileDesc", 288), {240, 248, 256, 264, -40}}; +__TDESC(Files_FileDesc, 1, 4) = {__TDFLDS("FileDesc", 600), {552, 560, 568, 576, -40}}; __TDESC(Files_BufDesc, 1, 1) = {__TDFLDS("BufDesc", 4120), {0, -16}}; __TDESC(Files_Rider, 1, 1) = {__TDFLDS("Rider", 24), {8, -16}}; diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 22d3da2d..16fd4396 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h @@ -11,7 +11,7 @@ typedef typedef struct Files_FileDesc { INT64 _prvt0; - char _prvt1[280]; + char _prvt1[592]; } Files_FileDesc; typedef diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index 58d587c5..9e99e657 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index 39fa0153..2b6287cd 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 4897dfa4..94227779 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index 12d1a18d..5d832fa6 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index 73efb8c0..41e56e38 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index d8958167..0eba52d2 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index ff43f636..7fa9fa23 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index 8fe51423..1e17f6c2 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index cec560bf..bcf72c6b 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index 1070c69d..9c84b7af 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index fd1f6597..18305e4c 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index 91257d84..010479f8 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index 491875a6..74719041 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index c78ec622..dfe2b972 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index df13f5c8..c6989580 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 1ba549d5..f457c51e 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index d8a4f2b4..617e9e58 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index 6acedcaa..bee5e44d 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Out.c b/bootstrap/windows-88/Out.c index bd4613d3..3bfb1ec7 100644 --- a/bootstrap/windows-88/Out.c +++ b/bootstrap/windows-88/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Out.h b/bootstrap/windows-88/Out.h index 4b15ee99..fad5cd1a 100644 --- a/bootstrap/windows-88/Out.h +++ b/bootstrap/windows-88/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index d1b69ffd..361a39fc 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index e8e2dae2..9ca6f851 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index f5368742..2af2574f 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index a40de618..07f4371d 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index abdb14f8..3d82b654 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index 0f2f8b74..df6f5edc 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index 10b78453..82588563 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index 2ca102c0..b3dd50cb 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/VT100.c b/bootstrap/windows-88/VT100.c index ff34c312..5bfcea49 100644 --- a/bootstrap/windows-88/VT100.c +++ b/bootstrap/windows-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/VT100.h b/bootstrap/windows-88/VT100.h index 2ddae6a2..51c85058 100644 --- a/bootstrap/windows-88/VT100.h +++ b/bootstrap/windows-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index 982447f2..2b6c962b 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -72,7 +72,7 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) { - __COPY("gcc -g", s, s__len); + __COPY("gcc -fPIC -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index 3b45a534..9b0b1ee9 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2017/09/06]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h From 4bbacbaaa47e4764d65bec067653adc863125bc1 Mon Sep 17 00:00:00 2001 From: Norayr Chilingarian Date: Tue, 10 Apr 2018 23:29:14 +0400 Subject: [PATCH 479/580] brought sources in sync with current library state. --- src/test/newt/newttest.Mod | 78 +++++++++++++++++++------------------ src/test/newt/newttest2.Mod | 4 +- 2 files changed, 43 insertions(+), 39 deletions(-) diff --git a/src/test/newt/newttest.Mod b/src/test/newt/newttest.Mod index 46d82a8e..ff673863 100644 --- a/src/test/newt/newttest.Mod +++ b/src/test/newt/newttest.Mod @@ -1,46 +1,50 @@ MODULE newttest; -IMPORT newt, oocIntStr, Unix; -VAR i, j, k : newt.Int32; -str : ARRAY 32 OF CHAR; -ch : CHAR; -fo, co : newt.Component; +IMPORT newt, oocIntStr, Platform; + +CONST delayTime = 1000; + +VAR + i, j, k : newt.Int32; + str : ARRAY 32 OF CHAR; + ch : CHAR; + fo, co : newt.Component; BEGIN -i := newt.Init(); -newt.Cls(); -str := "hello world!"; -newt.DrawRootText(5, 7, str); -newt.GetScreenSize(i, j); -oocIntStr.IntToStr(i, str); -newt.DrawRootText(5, 9, str); -str := "x"; -newt.DrawRootText(7, 9, "x"); -oocIntStr.IntToStr(j, str); -newt.DrawRootText(9, 9, str); + i := newt.Init(); + newt.Cls(); + str := "hello world!"; + newt.DrawRootText(5, 7, str); + newt.GetScreenSize(i, j); + oocIntStr.IntToStr(i, str); + newt.DrawRootText(5, 9, str); + str := "x"; + newt.DrawRootText(7, 9, "x"); + oocIntStr.IntToStr(j, str); + newt.DrawRootText(9, 9, str); -newt.PushHelpLine(""); -newt.Refresh(); -i := Unix.Sleep(1); + newt.PushHelpLine(""); + newt.Refresh(); + Platform.Delay(delayTime); -newt.PushHelpLine("A help line"); -newt.Refresh(); -i := Unix.Sleep(1); + newt.PushHelpLine("A help line"); + newt.Refresh(); + Platform.Delay(delayTime); -newt.PopHelpLine(); -newt.Refresh(); -i := Unix.Sleep(1); + newt.PopHelpLine(); + newt.Refresh(); + Platform.Delay(delayTime); -REPEAT -ch := newt.GetKey(); -str[0] := ch; -str[1] := 0X; -newt.DrawRootText(5, 5, str); -newt.PushHelpLine(str); -newt.Refresh; -UNTIL ch = ' '; + REPEAT + ch := newt.GetKey(); + str[0] := ch; + str[1] := 0X; + newt.DrawRootText(5, 5, str); + newt.PushHelpLine(str); + newt.Refresh; + UNTIL ch = ' '; -(* -newt.WaitForKey(); -newt.Delay(30);*) -i := newt.Finished(); + (* + newt.WaitForKey(); + newt.Delay(30);*) + i := newt.Finished(); END newttest. diff --git a/src/test/newt/newttest2.Mod b/src/test/newt/newttest2.Mod index 9cd02d99..a26248ab 100644 --- a/src/test/newt/newttest2.Mod +++ b/src/test/newt/newttest2.Mod @@ -1,6 +1,6 @@ MODULE newttest2; -IMPORT newt, oocIntStr, Unix; +IMPORT newt, oocIntStr; VAR i, j, k : newt.Int32; str : ARRAY 32 OF CHAR; form, b1, b2, comp: newt.Component; @@ -20,7 +20,7 @@ newt.FormAddComponent(form, b1); newt.FormAddComponent(form, b2); comp := newt.RunForm(form); newt.WaitForKey(); -newt.Delay(30); +newt.Delay(3000); newt.FormDestroy(form); i := newt.Finished(); END newttest2. From 419e90e0739e624516a18fbfe6221e4b32aa148b Mon Sep 17 00:00:00 2001 From: norayr Date: Sat, 14 Apr 2018 23:09:26 +0400 Subject: [PATCH 480/580] in order to instigate new build and update the build status png synced beep.Mod with actual library sources. --- src/test/sound/beep.Mod | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/test/sound/beep.Mod b/src/test/sound/beep.Mod index 6c53ed76..d8b30ae9 100644 --- a/src/test/sound/beep.Mod +++ b/src/test/sound/beep.Mod @@ -1,5 +1,5 @@ MODULE beep; -IMPORT Files, rm:=oocRealMath, Unix; +IMPORT Files, rm:=oocRealMath, Platform; CONST pi2=6.28318; (*pi2 = 6.2831802368164062;*) @@ -52,7 +52,7 @@ FOR i:=1 TO e DO END; Files.Register(outvar); -i:=Unix.System("oggenc -r -C 1 beepfile"); -i:=Unix.System("ogg123 beepfile.ogg"); +i:=Platform.System("oggenc -r -C 1 beepfile"); +i:=Platform.System("ogg123 beepfile.ogg"); END beep. From 1da977da55d054d01f97414446e41b4cfda1e75e Mon Sep 17 00:00:00 2001 From: David C W Brown Date: Sun, 22 Apr 2018 18:21:10 +0100 Subject: [PATCH 481/580] Update ReadMe.md --- ReadMe.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReadMe.md b/ReadMe.md index a420ab86..6a545bbc 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -1,4 +1,4 @@ -[![Build status](http://brownsmeet.com/build-status.svg)](http://brownsmeet.com/log/) +[![Build status](http://brownsmeet.com/githubhook/vishaps-status.svg)](http://brownsmeet.com/log/) # Ñ´ishap Oberon From 1bd4070e064d6a525796dafa2c747318d9812bc9 Mon Sep 17 00:00:00 2001 From: David C W Brown Date: Sun, 22 Apr 2018 18:23:44 +0100 Subject: [PATCH 482/580] Update ReadMe.md --- ReadMe.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReadMe.md b/ReadMe.md index 6a545bbc..28e73dcd 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -1,4 +1,4 @@ -[![Build status](http://brownsmeet.com/githubhook/vishaps-status.svg)](http://brownsmeet.com/log/) +[![Build status](https://brownsmeet.com/githubhook/vishaps-status.svg)](http://brownsmeet.com/log/) # Ñ´ishap Oberon From 56ea3f3a2743b39838a6425f867f29c2c10e4dec Mon Sep 17 00:00:00 2001 From: David C W Brown Date: Sun, 22 Apr 2018 19:55:37 +0100 Subject: [PATCH 483/580] Update ReadMe.md --- ReadMe.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReadMe.md b/ReadMe.md index 28e73dcd..a420ab86 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -1,4 +1,4 @@ -[![Build status](https://brownsmeet.com/githubhook/vishaps-status.svg)](http://brownsmeet.com/log/) +[![Build status](http://brownsmeet.com/build-status.svg)](http://brownsmeet.com/log/) # Ñ´ishap Oberon From a2f3f727958981eef752857d710ef85f80e30d3d Mon Sep 17 00:00:00 2001 From: David C W Brown Date: Sun, 22 Apr 2018 20:11:17 +0100 Subject: [PATCH 484/580] Update ReadMe.md --- ReadMe.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReadMe.md b/ReadMe.md index a420ab86..6a545bbc 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -1,4 +1,4 @@ -[![Build status](http://brownsmeet.com/build-status.svg)](http://brownsmeet.com/log/) +[![Build status](http://brownsmeet.com/githubhook/vishaps-status.svg)](http://brownsmeet.com/log/) # Ñ´ishap Oberon From ffad2a1a14cc4f6c296cc78da8f7aedc824df7c1 Mon Sep 17 00:00:00 2001 From: David C W Brown Date: Sun, 22 Apr 2018 20:13:09 +0100 Subject: [PATCH 485/580] Update ReadMe.md --- ReadMe.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReadMe.md b/ReadMe.md index 6a545bbc..28e73dcd 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -1,4 +1,4 @@ -[![Build status](http://brownsmeet.com/githubhook/vishaps-status.svg)](http://brownsmeet.com/log/) +[![Build status](https://brownsmeet.com/githubhook/vishaps-status.svg)](http://brownsmeet.com/log/) # Ñ´ishap Oberon From 02ea27e8b509b162b91e3ee171e44c62c6e507f0 Mon Sep 17 00:00:00 2001 From: David C W Brown Date: Sun, 22 Apr 2018 20:21:09 +0100 Subject: [PATCH 486/580] Update ReadMe.md --- ReadMe.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReadMe.md b/ReadMe.md index 28e73dcd..6a545bbc 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -1,4 +1,4 @@ -[![Build status](https://brownsmeet.com/githubhook/vishaps-status.svg)](http://brownsmeet.com/log/) +[![Build status](http://brownsmeet.com/githubhook/vishaps-status.svg)](http://brownsmeet.com/log/) # Ñ´ishap Oberon From 2d8cd4a4789ec0f83ca1f1aafe4185da3a1f96d7 Mon Sep 17 00:00:00 2001 From: David C W Brown Date: Mon, 23 Apr 2018 17:28:43 +0100 Subject: [PATCH 487/580] Update ReadMe.md --- ReadMe.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReadMe.md b/ReadMe.md index 6a545bbc..9b614a2e 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -1,4 +1,4 @@ -[![Build status](http://brownsmeet.com/githubhook/vishaps-status.svg)](http://brownsmeet.com/log/) +[Build status](http://brownsmeet.com/githubhook/vishaps-status.svg) # Ñ´ishap Oberon From 2de6345b99a609e00a8622898929dd41b202d54c Mon Sep 17 00:00:00 2001 From: David C W Brown Date: Mon, 23 Apr 2018 17:29:05 +0100 Subject: [PATCH 488/580] Update ReadMe.md --- ReadMe.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReadMe.md b/ReadMe.md index 9b614a2e..f43f8559 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -1,4 +1,4 @@ -[Build status](http://brownsmeet.com/githubhook/vishaps-status.svg) +![Build status](http://brownsmeet.com/githubhook/vishaps-status.svg) # Ñ´ishap Oberon From 175eafb9009a786d4d9c69313132e8fa0d06faf4 Mon Sep 17 00:00:00 2001 From: David C W Brown Date: Mon, 23 Apr 2018 18:24:41 +0100 Subject: [PATCH 489/580] New autobuild system --- src/tools/autobuild/build-oberon.sh | 34 ---- src/tools/autobuild/buildall.pl | 68 -------- src/tools/autobuild/makesvg.pl | 113 +++++++++++++ src/tools/autobuild/postpush.pl | 55 ------- src/tools/autobuild/report.pl | 192 ---------------------- src/tools/autobuild/response.html | 5 + src/tools/autobuild/runbuilds.pl | 203 ++++++++++++++++++++++++ src/tools/autobuild/server.pl | 154 ++++++++++++++++++ src/tools/autobuild/update-webserver.sh | 9 -- 9 files changed, 475 insertions(+), 358 deletions(-) delete mode 100644 src/tools/autobuild/build-oberon.sh delete mode 100644 src/tools/autobuild/buildall.pl create mode 100644 src/tools/autobuild/makesvg.pl delete mode 100644 src/tools/autobuild/postpush.pl delete mode 100644 src/tools/autobuild/report.pl create mode 100644 src/tools/autobuild/response.html create mode 100644 src/tools/autobuild/runbuilds.pl create mode 100755 src/tools/autobuild/server.pl delete mode 100644 src/tools/autobuild/update-webserver.sh diff --git a/src/tools/autobuild/build-oberon.sh b/src/tools/autobuild/build-oberon.sh deleted file mode 100644 index ca9a10ed..00000000 --- a/src/tools/autobuild/build-oberon.sh +++ /dev/null @@ -1,34 +0,0 @@ -# Build Oberon -# -# Args -# -# $1 - whether to use sudo -# $2 - build directory -# $3 - CC -# $4 - branch - -if test "$1" = "sudo"; then sudo=sudo; else sudo=""; fi - -echo "" -echo === build-oberon.sh: \$1="$1", \$2="$2", \$3="$3", \$4="$4", \$sudo="$sudo" === -echo "" - -set -x -cd $2 - -$sudo git reset --hard # Clear the staging area -$sudo git clean -dfx # Remove all untracked files -$sudo git pull # Update the local repository -$sudo git checkout -f $4 # Switch to requested branch - -export CC=$3 - -if test "$3" = "msc-x86"; then - cmd /c 'C:\Program Files (x86)\Microsoft Visual C++ Build Tools\vcbuildtools.bat' x86 '&&' cd 'c:\cygwin\home\dave\msc-x86\voc' '&&' make full -else -if test "$3" = "msc-x64"; then - cmd /c 'C:\Program Files (x86)\Microsoft Visual C++ Build Tools\vcbuildtools.bat' x64 '&&' cd 'c:\cygwin\home\dave\msc-x64\voc' '&&' make full -else - $sudo make full -fi -fi diff --git a/src/tools/autobuild/buildall.pl b/src/tools/autobuild/buildall.pl deleted file mode 100644 index f72c36b9..00000000 --- a/src/tools/autobuild/buildall.pl +++ /dev/null @@ -1,68 +0,0 @@ -#!perl -w -use strict; -use warnings; -use POSIX "strftime"; -use Cwd; - -my $branch = "master"; -if (defined($ARGV[0]) && ($ARGV[0] ne "")) {$branch = $ARGV[0]} - -my %machines = ( - "pi" => ['22', 'pi@pie', 'sh build-oberon.sh sudo projects/oberon/vishap/voc gcc ' . $branch], - "darwin" => ['22', 'dave@dcb', 'sh build-oberon.sh sudo projects/oberon/vishap/voc clang ' . $branch], - "cygwin32" => ['5932', 'dave@wax', 'sh build-oberon.sh n oberon/cygwin/voc gcc ' . $branch], - "cygwin64" => ['5932', 'dave@wax', 'sh start64.sh \'sh build-oberon.sh n oberon/cygwin/voc gcc ' . $branch . '\''], - "mingw32" => ['5932', 'dave@wax', 'sh build-oberon.sh n oberon/mingw/voc i686-w64-mingw32-gcc ' . $branch], - "mingw64" => ['5932', 'dave@wax', 'sh start64.sh \'sh build-oberon.sh n oberon/mingw/voc x86_64-w64-mingw32-gcc ' . $branch . '\''], - "android" => ['8022', 'root@and', 'sh build-oberon.sh n vishap/voc gcc ' . $branch], - "lub64" => ['22', 'dave@vim', 'sh build-oberon.sh sudo oberon/voc gcc ' . $branch], - "lub32" => ['22', 'dave@vim-lub32', 'sh build-oberon.sh sudo oberon/voc gcc ' . $branch], - "fed64" => ['22', 'dave@vim-fed64', 'sh build-oberon.sh sudo oberon/voc gcc ' . $branch], - "osu64" => ['22', 'dave@vim-osu64', 'sh build-oberon.sh sudo oberon/voc gcc ' . $branch], - "obs32" => ['22', 'dave@vim-obs32', 'sh build-oberon.sh n vishap/voc gcc ' . $branch], - "win32" => ['22', 'dave@vim-win64', 'sh build-oberon.sh n msc-x86/voc msc-x86 ' . $branch], - "win64" => ['22', 'dave@vim-win64', 'sh build-oberon.sh n msc-x64/voc msc-x64 ' . $branch], - "ce64" => ['5922', 'obe@www', 'sh build-oberon.sh sudo vishap/voc gcc ' . $branch], - "fb64" => ['22', 'root@oberon', 'sh build-oberon.sh n vishap/voc gcc ' . $branch] -); - -sub logged { - my ($cmd, $id) = @_; - my $child = fork; - if (not defined $child) {die "Fork failed.";} - if ($child) { - # parent process - print "Started $id, pid = $child\n"; - } else { - # child process - open(my $log, ">log/$id.log") // die "Could not create log file log/$id.log"; - print $log strftime("%Y/%m/%d %H.%M.%S ", localtime), "$id.log\n"; - print $log strftime("%H.%M.%S", localtime), "> $cmd\n"; - print $id, " ", strftime("%H.%M.%S", localtime), "> $cmd\n"; - open(my $pipe, "$cmd 2>&1 |") // die "Could not open pipe from command $cmd."; - while (<$pipe>) { - my $line = $_; - print $id, " ", strftime("%H.%M.%S", localtime), " ", $line; - print $log strftime("%H.%M.%S", localtime), " ", $line; - } - close($pipe); - print $log strftime("%H.%M.%S", localtime), " --- Make completed ---\n"; - close($log); - exit; - } -} - -unlink glob "log/*"; - -for my $machine (sort keys %machines) { - my ($port, $login, $cmd) = @{$machines{$machine}}; - my $cmd = "scp -P $port build-oberon.sh $login:build-oberon.sh &&" - . "ssh -p $port $login \"$cmd\""; - logged($cmd, $machine); -} - -system("perl report.pl $branch"); -while ((my $pid = wait) > 0) { - print "Child pid $pid completed.\n"; - system("perl report.pl $branch"); -} diff --git a/src/tools/autobuild/makesvg.pl b/src/tools/autobuild/makesvg.pl new file mode 100644 index 00000000..398d09cd --- /dev/null +++ b/src/tools/autobuild/makesvg.pl @@ -0,0 +1,113 @@ +#!perl -w +use strict; +use warnings; + + +my %BuildStatus = (); +my $Rows = 0; +opendir DIR, "logs"; +while (my $fn = readdir(DIR)) { + if ($fn =~ /^((.+)-(.+))\.state$/) { + my ($build, $branch, $id) = ($1, $2, $3); + open STATE, "); # date time os compiler model compiler-build library-build ssource-change binary-change tests + splice(@state, 2, 0, $branch); + $BuildStatus{$build} = \@state; + close STATE; + $Rows++; + } +} +closedir DIR; + +#for my $fn (sort keys %BuildStatus) { +# print "$fn:\n"; +# my @state = @{$BuildStatus{$fn}}; +# my $i = 0; +# for my $val (@state) { +# print " $i: $val\n"; +# $i++; +# } +#} + + +my $FontHeight = 12; +my $LineHeight = 16; + +sub svgtext { + my ($f, $x, $y, $colour, $msg) = @_; + if ($msg ne '') { + $y = ($y+1)*$LineHeight + $FontHeight*0.4; + print $f <<"--END--TEXT--"; +$msg +--END--TEXT-- + } +} + +sub ColourFor { + my ($str) = @_; + if ($str eq "Failed") {return "#e03030";} # red + if ($str eq "Changed") {return "#ff9d4d";} # amber + if ($str eq "Passed") {return "#5adb5a";} # green + if ($str eq "Built") {return "#5adb5a";} # green + return "#c0c0c0"; +} + + +my @ColWidths = (22, 81, 67, 60, 70, 60, 50, 60, 60, 80, 80, 64); +my @Columns = (0); +for my $width (@ColWidths) {push @Columns, $Columns[$#Columns] + $width} + +my $Width = $Columns[$#Columns]; +my $Height = ($Rows+2.2) * $LineHeight; + + + +open(my $svg, ">vishaps-status.svg") // die "Could not create vishaps-status.svg."; + +print $svg <<"--END--SVG--HEADER--"; + + + +--END--SVG--HEADER-- + + +svgtext($svg, $Columns[1], 0, "#e0e0e0", "Date"); +svgtext($svg, $Columns[2], 0, "#e0e0e0", "Time"); +svgtext($svg, $Columns[3], 0, "#e0e0e0", "Branch"); +svgtext($svg, $Columns[4], 0, "#e0e0e0", "OS"); +svgtext($svg, $Columns[5], 0, "#e0e0e0", "Compiler"); +svgtext($svg, $Columns[6], 0, "#e0e0e0", "Model"); +svgtext($svg, $Columns[7], 0, "#e0e0e0", "Oberon"); +svgtext($svg, $Columns[8], 0, "#e0e0e0", "Library"); +svgtext($svg, $Columns[9], 0, "#e0e0e0", "C Source"); +svgtext($svg, $Columns[10], 0, "#e0e0e0", "Assembler"); +svgtext($svg, $Columns[11], 0, "#e0e0e0", "Tests"); + + +my $Row = 1; +for my $build (sort keys %BuildStatus) { + my @state = @{$BuildStatus{$build}}; + + my $y = $Row*$LineHeight + $FontHeight*0.8; + my $h = $LineHeight * 0.9; + print $svg <<"--END--HIGHLIGHT--"; + + +--END--HIGHLIGHT-- + + my $column = 1; + for my $field (@state) { + svgtext($svg, $Columns[$column], $Row, ColourFor($field), $field); + $column++; + } + $Row++; + + print $svg "\n" +} + +print $svg "\n"; +close $svg; diff --git a/src/tools/autobuild/postpush.pl b/src/tools/autobuild/postpush.pl deleted file mode 100644 index 07397517..00000000 --- a/src/tools/autobuild/postpush.pl +++ /dev/null @@ -1,55 +0,0 @@ -#!/usr/bin/perl -w - -use strict; -use warnings; -use POSIX "strftime"; - -use CGI qw(:standard escapeHTML); -use JSON; - - -sub writelog { - my ($msg) = @_; - - open(LOG, ">>/tmp/postpush.log") or die "Could not create postpush.log"; - flock(LOG, 2) or die "Could not lock postpush.log"; - print LOG sprintf("%s %s\n", strftime("%Y/%m/%d %H.%M.%S", localtime), $msg); - close(LOG); - system "id >> /tmp/postpush.log"; -} - -my $postdata = from_json(param('POSTDATA')); - -my $url = $postdata->{'repository'}->{'url'}; -my $ref = $postdata->{'ref'}; -my $name = $postdata->{'head_commit'}->{'author'}->{'name'}; -my $branch = $ref; $branch =~ s'^.*\/''; -my $repo = $url; $repo =~ s'^.*\/''; -my $modified = $postdata->{'head_commit'}->{'modified'}; - -my $buildneeded = 0; -for my $file (@{$modified}) { - if ($file !~ m/\.(md|svg)$/i) {$buildneeded = 1;} -} - -if ($buildneeded) { - writelog "Post push github web hook for repository $repo, branch $branch, name $name. Build required."; - - my $child = fork; - if (not defined $child) {die "Fork failed.";} - if ($child) { - writelog "Started buildall, pid = $child."; # parent process - } else { - close(STDIN); close(STDOUT); close(STDERR); # child process - exec 'perl buildall.pl ' . $branch . ' >/tmp/buildall.log'; - exit; - } -} else { - writelog "Post push github web hook for repository $repo, branch $branch, name $name. No build required."; -} - - -print header(), - start_html("Vishap Oberon github post push web hook."), - p("Repository $repo, branch $branch, name $name."), - end_html(); diff --git a/src/tools/autobuild/report.pl b/src/tools/autobuild/report.pl deleted file mode 100644 index 80c8965e..00000000 --- a/src/tools/autobuild/report.pl +++ /dev/null @@ -1,192 +0,0 @@ -#!perl -w -use strict; -use warnings; -use POSIX "strftime"; -use Cwd; - -my $branch = "master"; -if (defined($ARGV[0]) && ($ARGV[0] ne "")) {$branch = $ARGV[0]} - -print "--- Running build status report on branch $branch.\n"; - -my %status = (); - -my $fn; -my $date; -my $time; -my $os; -my $compiler; -my $datamodel; -my $compilerok; -my $libraryok; -my $sourcechange; -my $asmchange; -my $tests; -my $key; -my $ver; - -sub clearvars { - $time = ""; $branch = ""; $os = ""; $compiler = ""; - $datamodel = ""; $compilerok = ""; $libraryok = ""; $sourcechange = ""; - $asmchange = ""; $tests = ""; $key = ""; $ver = ""; -} - -sub logstatus { - my ($fn) = @_; - if ($compiler ne "") { - $status{"$os-$compiler-$datamodel"} = - [$fn, $date, $time, $os, $compiler, $datamodel, $branch, $compilerok, $libraryok, $sourcechange, $asmchange, $tests]; - } - clearvars(); -} - -sub parselog { - ($fn) = @_; - clearvars(); - open(my $log, $fn) // die "Couldn't open build log $fn."; - $branch = "Build on $fn started"; - while (<$log>) { - s/\r//g; # Remove unwanted MS command prompt CR's. - - if (/^([0-9\/]+) ([0-9.]+) .+\.log$/) {$date = $1} - if (/^([0-9.]+) /) {$time = $1} - - #14.55.15 === build-oberon.sh: $1=sudo, $2=oberon/voc, $3=gcc, $4=master, $sudo=sudo === - if (/^[^ ]+ === build-oberon.sh: .* \$3=([^ ]+), \$4=([^ ]+),/) { - ($compiler, $branch) = ($1, $2); - } - - # 14.55.17 + sudo git checkout -f master - if (/^[^ ]+ .*git checkout -f ([^ ]+) *$/) { - $branch = $1; - } - - # 14.55.17 Configuration: 2.1.0 [2016/12/22] for gcc ILP32 on ubuntu - if (/^[^ ]+ Configuration: ([^ ]+) \[[0-9\/]+\] for ([^ ]+) ([^ ]+) on ([^ ]+)/) { - ($ver, $compiler, $datamodel, $os) = ($1, $2, $3, $4); - printf "--- Config for $fn: $1 for $2 $3 on $4.\n"; - } - - #if (/^[^ ]+ --- Cleaning branch ([^ ]+) ([^ ]+) ([^ ]+) ([^ ]+) ---$/) { - # ($branch, $os, $compiler, $datamodel) = ($1, $2, $3, $4, $5); - #} - - if (/^([0-9.]+) --- Compiler build started ---$/) {$compilerok = "Started";} - if (/^([0-9.]+) --- Compiler build successfull ---$/) {$compilerok = "Built";} - - if (/^([0-9.]+) --- Library build started ---$/) {$libraryok = "Started";} - if (/^([0-9.]+) --- Library build successfull ---$/) {$libraryok = "Built";} - - if (/^([0-9.]+) --- Generated c source files match bootstrap ---$/) {$sourcechange = "Unchanged";} - if (/^([0-9.]+) --- Generated c source files differ from bootstrap ---$/) {$sourcechange = "Changed";} - - if (/^([0-9.]+) --- Generated code unchanged ---$/) {if ($asmchange eq "") {$asmchange = "Unchanged"}} - if (/^([0-9.]+) --- Generated code changed ---$/) {$asmchange = "Changed"} - - if (/^([0-9.]+) --- Confidence tests started ---$/) {$tests = "Started";} - if (/^([0-9.]+) --- Confidence tests passed ---$/) {$tests = "Passed";} - - if (/^([0-9.]+) --- Make completed ---$/) { - # Go back and convert 'Started' status to 'Failed'. - if ($branch =~ m/^Build on/) {$branch = "Build on $fn failed to start.";} - if ($compilerok eq "Started") {$compilerok = "Failed";} - if ($libraryok eq "Started") {$libraryok = "Failed";} - if ($tests eq "Started") {$tests = "Failed";} - if ($compiler eq "msc") {$sourcechange = "n/a"; $tests = "n/a";} - } - } - close($log); - logstatus($fn); -} - -opendir DIR, "log" // die "Could not open log directory."; -my @logs = readdir DIR; -closedir DIR; - -for my $logname (sort @logs) { - $logname = "log/" . $logname; - #print "Consider $logname\n"; - if (-f $logname) {parselog($logname);} -} - -my $fontheight = 12; -my $lineheight = 15; - -sub svgtext { - my ($f, $x, $y, $colour, $msg) = @_; - print $f ''; - print $f $msg; - print $f "\n"; -} - -sub colourfor { - my ($str) = @_; - if ($str eq "Failed") {return "#e03030";} - if ($str eq "Changed") {return "#ff9d4d";} - if ($str eq "n/a") {return "#707070";} - return "#5adb5a"; -} - -my $rows = keys %status; - -my $width = 710; -my $height = ($rows+2.2) * $lineheight; - -open(my $svg, ">build-status.svg") // die "Could not create build-status.svg."; -print $svg '\n"; -print $svg '', "\n"; - -my $col1 = 20; -my $col2 = 97; -my $col3 = 160; -my $col4 = 220; -my $col5 = 280; -my $col6 = 330; -my $col7 = 380; -my $col8 = 440; -my $col9 = 490; -my $col10 = 570; -my $col11 = 650; - -svgtext($svg, $col1, 0, "#e0e0e0", "Date"); -svgtext($svg, $col3, 0, "#e0e0e0", "Branch"); -svgtext($svg, $col4, 0, "#e0e0e0", "Platform"); -svgtext($svg, $col7, 0, "#e0e0e0", "Compiler"); -svgtext($svg, $col8, 0, "#e0e0e0", "Library"); -svgtext($svg, $col9, 0, "#e0e0e0", "C Source"); -svgtext($svg, $col10, 0, "#e0e0e0", "Assembler"); -svgtext($svg, $col11, 0, "#e0e0e0", "Tests"); - -my $i=1; -for my $key (sort keys %status) { - my ($fn, $date, $time, $os, $compiler, $datamodel, $branch, $compilerok, $libraryok, - $sourcechange, $asmchange, $tests) = @{$status{$key}}; - print $svg ''; - svgtext($svg, $col1, $i, "#c0c0c0", $date); - svgtext($svg, $col2, $i, "#c0c0c0", $time); - svgtext($svg, $col3, $i, "#c0c0c0", $branch); - svgtext($svg, $col4, $i, "#c0c0c0", $os); - svgtext($svg, $col5, $i, "#c0c0c0", $compiler); - svgtext($svg, $col6, $i, "#c0c0c0", $datamodel); - svgtext($svg, $col7, $i, colourfor($compilerok), $compilerok); - svgtext($svg, $col8, $i, colourfor($libraryok), $libraryok); - svgtext($svg, $col9, $i, colourfor($sourcechange), $sourcechange); - svgtext($svg, $col10, $i, colourfor($asmchange), $asmchange); - svgtext($svg, $col11, $i, colourfor($tests), $tests); - print $svg ''; - $i++; -} - -print $svg "\n"; - -system 'chmod +r log/*'; -system 'scp build-status.svg dave@hub:/var/www'; -system 'scp log/* dave@hub:/var/www/log'; diff --git a/src/tools/autobuild/response.html b/src/tools/autobuild/response.html new file mode 100644 index 00000000..12acbc38 --- /dev/null +++ b/src/tools/autobuild/response.html @@ -0,0 +1,5 @@ + + +github webhook response +github webhook response + diff --git a/src/tools/autobuild/runbuilds.pl b/src/tools/autobuild/runbuilds.pl new file mode 100644 index 00000000..c0cb733a --- /dev/null +++ b/src/tools/autobuild/runbuilds.pl @@ -0,0 +1,203 @@ +#!perl -w +use strict; +use warnings; +use POSIX "strftime"; + +my $home = "/home/dave/vishap-build"; + +chdir $home; +mkdir "logs"; +#my $GlobalLog = *STDOUT; +open my $GlobalLog, ">$home/logs/runbuilds.log"; + +my $LogToScreenToo = 1; + + +# Find a build to run + +sub FindTriggeredBuild { + opendir (DIR, "$home") || die "$!"; + my $branch = undef; + while ((!defined $branch) && (my $fn = readdir DIR)) { + if ($fn =~ /^trigger-(\w+)/) {$branch = $1; unlink "$home/$fn"} + } + closedir DIR; + return $branch; +} + + + + +# Status information +# +# Build type: Datestamp Branch Platform Compiler Model +# Status: Compiler-build Library-build C-changed Assembler? Tests +# + +my %BuildStatus = (); + +sub WriteStatus {my ($timestamp, $id) = @_; + open STATE, ">logs/$id.state"; + print STATE "$timestamp "; + print STATE $BuildStatus{$id}->{kind}, ' '; + print STATE $BuildStatus{$id}->{compile}, ' '; + print STATE $BuildStatus{$id}->{library}, ' '; + print STATE $BuildStatus{$id}->{csource}, ' '; + print STATE $BuildStatus{$id}->{binary}, ' '; + print STATE $BuildStatus{$id}->{tests}, "\n"; + close STATE; +} + +sub SetStatus {my ($timestamp, $id, $section, $state) = @_; + if (!exists $BuildStatus{$id}) {$BuildStatus{$id} = { + kind => "- - -", compile => "Pending", library => "Pending", + csource => "Pending", binary => "Pending", tests => "Pending" + }} + $BuildStatus{$id}->{$section} = $state; + WriteStatus($timestamp, $id) +} + + +sub UpdateStatus {my ($timestamp, $id, $msg) = @_; + if ($msg =~ /^Configuration: ([^ ]+) \[[0-9\/]+\] for ([^ ]+) ([^ ]+) on ([^ ]+)/) { + SetStatus($timestamp, $id, 'kind', "$4 $2 $3") + } else { + if ($msg =~ /^--- (.*) ---$/) { + my $status = $1; + if ($status eq 'Build starts') {$id =~ /^.+?-(.+)$/; SetStatus($timestamp, $id, 'kind', "($1 rsync) -")} + elsif ($status eq 'Compiler build started') {SetStatus($timestamp, $id, 'compile', 'Busy')} + elsif ($status eq 'Compiler build successfull') {SetStatus($timestamp, $id, 'compile', 'Built')} + elsif ($status eq 'Library build started') {SetStatus($timestamp, $id, 'library', 'Busy')} + elsif ($status eq 'Library build successfull') {SetStatus($timestamp, $id, 'library', 'Built')} + elsif ($status eq 'Generated c source files match bootstrap') {SetStatus($timestamp, $id, 'csource', 'Unchanged')} + elsif ($status eq 'Generated c source files differ from bootstrap') {SetStatus($timestamp, $id, 'csource', 'Changed')} + elsif ($status eq 'Generated code unchanged') {SetStatus($timestamp, $id, 'binary', 'Unchanged')} + elsif ($status eq 'Generated code changed') {SetStatus($timestamp, $id, 'binary', 'Changed')} + elsif ($status eq 'Confidence tests started') {SetStatus($timestamp, $id, 'tests', 'Busy')} + elsif ($status eq 'Confidence tests passed') {SetStatus($timestamp, $id, 'tests', 'Passed')} + elsif ($status eq 'Build ends') { + my %status = %{$BuildStatus{$id}}; + foreach my $sec (keys %status) { + if ($status{$sec} eq 'Busy') {$BuildStatus{$id}->{$sec} = 'Failed'} + if ($status{$sec} eq 'Pending') {$BuildStatus{$id}->{$sec} = '-'} + } + WriteStatus($timestamp, $id) + } + } + } +} + + +sub Log {my ($log, $id, $msg) = @_; + my $timestamp = strftime("%Y/%m/%d %H.%M.%S", localtime); + $msg =~ s/[\r\n]*$//; # Remove trailing newline characters + UpdateStatus($timestamp, $id, $msg); + substr($timestamp,0,11) = ''; # Remove date part as not needed in logs + if ($LogToScreenToo) {print "($id) $timestamp $msg\n"} + print $GlobalLog "$timestamp ($id) $msg\n"; + if (defined $log) {print $log "$timestamp $msg\n"} +} + + +sub DoLogged {my ($log, $id, $cmd) = @_; + Log $log, $id, "Executing '$cmd'."; + open(my $pipe, "$cmd 2>&1 |") // die "Could not open pipe from command $cmd."; + while (<$pipe>) {Log $log, $id, $_} + close($pipe); +} + + + +sub SendFile {my ($log, $id, $dest, $port, $filename, $content) = @_; + Log $log, $id, "SendFile($dest,$port,$filename)"; + open PIPE, "|ssh -p $port $dest 'cat >$filename'"; + $content =~ s/\n/\r\n/g; # Unix to MS line ends. + print PIPE $content; + close PIPE; +} + + + +## my %machines = ( +## "cygwin32" => ['5932', 'dave@wax', 'sh build-oberon.sh n oberon/cygwin/voc gcc ' . $branch], +## "cygwin64" => ['5932', 'dave@wax', 'sh start64.sh \'sh build-oberon.sh n oberon/cygwin/voc gcc ' . $branch . '\''], +## "mingw32" => ['5932', 'dave@wax', 'sh build-oberon.sh n oberon/mingw/voc i686-w64-mingw32-gcc ' . $branch], +## "mingw64" => ['5932', 'dave@wax', 'sh start64.sh \'sh build-oberon.sh n oberon/mingw/voc x86_64-w64-mingw32-gcc ' . $branch . '\''], +## "ce64" => ['5922', 'obe@www', 'sh build-oberon.sh sudo vishap/voc gcc ' . $branch], +## ); + + + + +my @Builds = ( + ['pi', 'pi@pie', '22', '', 'cd vishaps/$id && make full'], + ['android', 'and', '8022', '', 'cd vishaps/$id && CC=gcc make full'], + ['lub32', 'vim-lub32', '22', '', 'cd vishaps/$id && make full'], + ['lub32cl', 'vim-lub32', '22', '', 'cd vishaps/$id && CC=clang make full'], + ['obs32', 'vim-obs32', '22', '', 'cd vishaps/$id && make full'], + ['cyg32', 'wax', '5932', '', 'cd vishaps/$id && make full'], + ['ming32', 'wax', '5932', '', 'cd vishaps/$id && CC=i686-w64-mingw32-gcc make full'], + ['cyg64', 'wax', '5932', '', 'sh start64.sh \'cd vishaps/$id && make full\''], + ['ming64', 'wax', '5932', '', 'sh start64.sh \'cd vishaps/$id && CC=x86_64-w64-mingw32-gcc make full\''], + ['lub64', 'vim', '22', '', 'cd vishaps/$id && make full'], + ['osu64', 'vim-osu64', '22', '', 'cd vishaps/$id && make full'], + ['fed64', 'vim-fed64', '22', '', 'cd vishaps/$id && make full'], + ['fbs64', 'githubhook', '22', '', 'cd vishaps/$id && make full'], + ['ce64', 'vim-ce64', '22', '', 'cd vishaps/$id && make full'], + ['darwin', 'dcb', '22', '', 'cd vishaps/$id && make full'], + ['win32', 'vim-win64', '22', 'x86', 'cmd /c x86.cmd'], + ['win64', 'vim-win64', '22', 'x64', 'cmd /c x64.cmd'] +); + +sub Prepare {my ($log, $id, $dest, $port, $preparation) = @_; + SendFile($log, $id, $dest, $port, "$preparation.cmd", <<"--END--MS--"); +call \"C:\\Program Files (x86)\\Microsoft Visual C++ Build Tools\\vcbuildtools.bat\" $preparation +cd %HOME%\\vishaps\\$id +make full +--END--MS-- +} + +sub BuildBranch {my ($branch) = @_; + Log undef, $branch, "$branch branch build triggered."; + +# # Obtain a clean clone of vishaps +# DoLogged undef, $branch, "rm -rf $home/voc"; +# DoLogged undef, $branch, "cd $home && git clone -b $branch --single-branch https://github.com/vishaps/voc"; + + # Start each build in turn + + unlink glob "$home/logs/$branch-*"; + for my $build (@Builds) { + my ($id, $dest, $port, $preparation, $command) = @$build; + my $rsynccompress = "-z"; if ($id eq "android") {$rsynccompress = "-zz"} + $id = "$branch-$id"; + my $child = fork; if (not defined $child) {die "Fork failed.";} + if ($child) {print "Opened process $child for build $id at $dest.\n"} + else { + # child process + my $log; + open $log, ">$home/logs/$id.log"; + Log $log, $id, "--- Build starts ---"; + Log $log, $id, strftime("%Y/%m/%d ", localtime) . "Build $id starting at $dest."; + DoLogged $log, $id, "ssh -p $port $dest mkdir -p vishaps/$id"; + DoLogged $log, $id, "rsync -r $rsynccompress --delete -e 'ssh -p $port' $home/voc/ $dest:vishaps/$id/"; + if ($preparation ne '') {Prepare($log, $id, $dest, $port, $preparation)} + $command =~ s/\$id /$id /g; + DoLogged $log, $id, "ssh -p $port $dest \"$command\""; + Log $log, $id, "Build $id for branch $branch at $dest completed."; + Log $log, $id, "--- Build ends ---"; + close $log; + exit; + } + } + + Log undef, $branch, "$branch branch: all builds started."; +} + + + +Log undef, 'runbuilds', strftime("%Y/%m/%d ", localtime) . "runbuilds starting."; +while (my $branch = FindTriggeredBuild()) {BuildBranch($branch)} +Log undef, 'runbuilds', "No more build triggers found, runbuilds complete."; +close $GlobalLog; + diff --git a/src/tools/autobuild/server.pl b/src/tools/autobuild/server.pl new file mode 100755 index 00000000..1016f78f --- /dev/null +++ b/src/tools/autobuild/server.pl @@ -0,0 +1,154 @@ +#!/usr/bin/perl +use strict; +use warnings; +use HTTP::Daemon; +use HTTP::Status; +use HTTP::Response; +use HTTP::Date qw(time2str); +use LWP::MediaTypes qw(guess_media_type); +use Digest::SHA qw(hmac_sha1_hex); +use Data::Dumper; +use JSON; +use sigtrap qw(die INT QUIT); + +my $home = "/usr/home/dave/vishap-build"; +my $criggleplop = "splurd crungle splonge."; + +$| = 1; + +my $PORT = 9000; +my $server = HTTP::Daemon->new(LocalPort => $PORT, ReuseAddr => 1); +die "Cannot setup server" unless $server; +print "[$$: Accepting clients at http://localhost:$PORT/]\n"; + +while (my $client = $server->accept) { + (my $pid = fork()) // die("Couldn't fork."); + if ($pid) {close $client; undef $client} else {ServeRequests($client); exit} +} +print "$$: server->accept failed. Exiting.\n"; +exit; + + +sub StartBuilds {my ($branch) = @_; + open TRIGGER, ">trigger-$branch"; print TRIGGER "trigger.\n"; close TRIGGER; + my $running = 0; + if (open PID, "; close PID} + if (!$running) { + my $child = fork; + if ($child) { + # This is the parent. We get to know the child PID, write it out. + print "Started build, pid $child.\n"; + open PID, ">pid"; print PID "$child.\n"; close PID; + } else { + # This is the child, we actually run all triggered builds. + exec "perl $home/runbuilds.pl >$home/runbuilds.log"; + exit; # Shouldn't get here + } + } +} + + +sub decodehook {my ($hook) = @_; + my %modifiedfiles = (); + my %commitauthors = (); + my $buildrequired = 0; + + my $commits = $hook->{commits}; + for my $commit (@$commits) { + my $committer = $commit->{committer}; + $commitauthors{$committer->{username}}++; + my $modified = $commit->{modified}; + for my $modfile (@$modified) { + $modifiedfiles{$modfile}++; + if ($modfile !~ m/\.(md|svg)$/i) {$buildrequired = 1;} + } + } + my $pusher = $hook->{pusher}; + my $repository = $hook->{repository}; + my $branch = $hook->{ref}; $branch =~ s'^.*\/''; + print "Repository: $repository->{name}, branch: $branch.\n"; + print "Commit authors: " . join(", ", keys %commitauthors) . ".\n"; + print "Pusher: " . $pusher->{name} . "\n"; + print "Files modified: " . join(", ", keys %modifiedfiles) . ".\n"; + print "Build " . ($buildrequired ? '' : 'not') . " required.\n"; + if ($buildrequired) {StartBuilds($branch)} +} + + +sub SendFile {my ($client, $file) = @_; + my $CRLF = "\r\n"; + local(*F); + sysopen(F, $file, 0); + binmode(F); + my($ct,$ce) = guess_media_type($file); + my($size,$mtime) = (stat $file)[7,9]; + $client->send_basic_header; + print $client "Content-Encoding: $ce$CRLF" if $ce; + print $client "Last-Modified: ", time2str($mtime), "$CRLF" if $mtime; + print $client "Accept-Ranges: bytes$CRLF"; + print $client "Content-Length: $size$CRLF" if $size; + print $client "Cache-Control: no-cache, no-store, must-revalidate, max-age=0$CRLF"; + print $client "Pragma: no-cache$CRLF"; + print $client "Expires: Wed, 11 Jan 1984 05:00:00 GMT$CRLF"; + print $client "Content-Type: $ct$CRLF"; + print $client $CRLF; + $client->send_file(\*F) unless $client->head_request; +} + + +sub VishapStatus {my ($client) = @_; + system "perl makesvg.pl"; # Construct an up-to-date status file + SendFile($client, "vishaps-status.svg"); +} + +sub LogFileResponse {my ($client, $path) = @_; + if (-f "logs/$path.log") { + SendFile($client, "logs/$path.log") + } else { + $client->send_error(RC_FORBIDDEN) + } +} + + +sub ServeRequests {my ($client) = @_; + $client->autoflush(1); + while (my $request = $client->get_request) { + if ($request->method eq 'GET') { + + my $uri = $request->uri; + my $host = $request->headers->{host}; + + print "URI requested: '$uri'.\n"; + print "Host: '$host'.\n"; + + $uri =~ s/^\///; + $uri =~ s/^githubhook\///; + + + if ($uri eq 'vishaps-status.svg') {VishapStatus($client)} + else {LogFileResponse($client, $uri)} + + + } elsif ($request->method eq 'POST') { + + $client->send_file_response("response.html"); + my $event = $request->headers->{'x-github-event'}; + my $githubsig = substr($request->headers->{'x-hub-signature'}, 5); + my $mysig = hmac_sha1_hex($request->content, $criggleplop); + print "Github event: $event, mysig $mysig, githubsig: $githubsig.\n"; + if (($event eq "push") && ($mysig eq $githubsig)) { + my $content = $request->content; + $content =~ s/%([0-9A-Fa-f]{2})/chr(hex($1))/eg; # Unescape %xx sequences. + decodehook(JSON::decode_json(substr($content,8))); + } + + } else { + + print "Request method $request->method forbidden.\n"; + $client->send_error(RC_FORBIDDEN) + } + } + $client->close; + undef $client; + #print "$$: no more requests, closing client.\n"; +} diff --git a/src/tools/autobuild/update-webserver.sh b/src/tools/autobuild/update-webserver.sh deleted file mode 100644 index 58a5e439..00000000 --- a/src/tools/autobuild/update-webserver.sh +++ /dev/null @@ -1,9 +0,0 @@ -# Push buildall and postpush to postpush server - -set -x -for f in *.pl build-oberon.sh; do - scp -P 5922 $f root@www:/var/lib/nethserver/ibay/githubhook/$f - ssh -p 5922 root@www "chmod +x /var/lib/nethserver/ibay/githubhook/$f" -done; -ssh -p 5922 root@www "ls -lap /var/lib/nethserver/ibay/githubhook" - From 9928bfe70dd5f6192ed8a1574d900bafca39b10d Mon Sep 17 00:00:00 2001 From: David C W Brown Date: Mon, 23 Apr 2018 20:21:50 +0100 Subject: [PATCH 490/580] Fix build order of Reals.Mod in Microsoft C builds. --- make.cmd | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/make.cmd b/make.cmd index 231ac3db..a47b97f0 100644 --- a/make.cmd +++ b/make.cmd @@ -188,15 +188,15 @@ echo. DATAMODEL: %DATAMODEL% cd %BUILDDIR% -cl -nologo /Zi -c SYSTEM.c Configuration.c Platform.c Heap.c || exit /b -cl -nologo /Zi -c Out.c Strings.c Modules.c Files.c || exit /b -cl -nologo /Zi -c Reals.c Texts.c VT100.c || exit /b -cl -nologo /Zi -c OPM.c extTools.c OPS.c OPT.c || exit /b -cl -nologo /Zi -c OPC.c OPV.c OPB.c OPP.c || exit /b +cl -nologo /Zi -c SYSTEM.c Configuration.c Platform.c Heap.c || exit /b +cl -nologo /Zi -c Out.c Reals.c Strings.c Modules.c || exit /b +cl -nologo /Zi -c Files.c Texts.c VT100.c || exit /b +cl -nologo /Zi -c OPM.c extTools.c OPS.c OPT.c || exit /b +cl -nologo /Zi -c OPC.c OPV.c OPB.c OPP.c || exit /b cl -nologo /Zi Compiler.c /Fe%ROOTDIR%\%OBECOMP% /link /INCREMENTAL:NO ^ -SYSTEM.obj Configuration.obj Platform.obj Heap.obj Out.obj Strings.obj ^ -Modules.obj Files.obj Reals.obj Texts.obj VT100.obj extTools.obj ^ +SYSTEM.obj Configuration.obj Platform.obj Heap.obj Out.obj Reals.obj ^ +Modules.obj Files.obj Strings.obj Texts.obj VT100.obj extTools.obj ^ OPM.obj OPS.obj OPT.obj OPC.obj OPV.obj OPB.obj OPP.obj || exit /b cd %ROOTDIR% @@ -242,11 +242,11 @@ del *.sym >nul 2>nul %ROOTDIR%\%OBECOMP% -SsfF -A%ADRSIZE%%ALIGNMENT% -O%MODEL% ../../Configuration.Mod || exit /b %ROOTDIR%\%OBECOMP% -SsfF -A%ADRSIZE%%ALIGNMENT% -O%MODEL% ../../src/runtime/Platform%PLATFORM%.Mod || exit /b %ROOTDIR%\%OBECOMP% -SsfFapx -A%ADRSIZE%%ALIGNMENT% -O%MODEL% ../../src/runtime/Heap.Mod || exit /b +%ROOTDIR%\%OBECOMP% -SsfF -A%ADRSIZE%%ALIGNMENT% -O%MODEL% ../../src/runtime/Reals.Mod || exit /b %ROOTDIR%\%OBECOMP% -SsfF -A%ADRSIZE%%ALIGNMENT% -O%MODEL% ../../src/runtime/Strings.Mod || exit /b %ROOTDIR%\%OBECOMP% -SsfF -A%ADRSIZE%%ALIGNMENT% -O%MODEL% ../../src/runtime/Out.Mod || exit /b %ROOTDIR%\%OBECOMP% -SsfF -A%ADRSIZE%%ALIGNMENT% -O%MODEL% ../../src/runtime/Modules.Mod || exit /b %ROOTDIR%\%OBECOMP% -SsfFx -A%ADRSIZE%%ALIGNMENT% -O%MODEL% ../../src/runtime/Files.Mod || exit /b -%ROOTDIR%\%OBECOMP% -SsfF -A%ADRSIZE%%ALIGNMENT% -O%MODEL% ../../src/runtime/Reals.Mod || exit /b %ROOTDIR%\%OBECOMP% -SsfF -A%ADRSIZE%%ALIGNMENT% -O%MODEL% ../../src/runtime/Texts.Mod || exit /b %ROOTDIR%\%OBECOMP% -SsfF -A%ADRSIZE%%ALIGNMENT% -O%MODEL% ../../src/runtime/VT100.Mod || exit /b %ROOTDIR%\%OBECOMP% -SsfF -A%ADRSIZE%%ALIGNMENT% -O%MODEL% ../../src/compiler/OPM.Mod || exit /b @@ -293,6 +293,7 @@ cd %BUILDDIR%\%MODEL% %ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/runtime/Platform%PLATFORM%.Mod %ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/runtime/Heap.Mod %ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/runtime/Modules.Mod +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/runtime/Reals.Mod %ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/runtime/Strings.Mod %ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/runtime/Out.Mod %ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/runtime/In.Mod @@ -300,7 +301,6 @@ cd %BUILDDIR%\%MODEL% %ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/runtime/Files.Mod %ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/runtime/Math.Mod %ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/runtime/MathL.Mod -%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/runtime/Reals.Mod %ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/runtime/Texts.Mod %ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/runtime/Oberon.Mod cd %ROOTDIR% From afe570e096e3f81d2a1e84e4d67c4fe110c6b452 Mon Sep 17 00:00:00 2001 From: David C W Brown Date: Mon, 23 Apr 2018 20:45:01 +0100 Subject: [PATCH 491/580] Restore temporarily commented git clone in autobuild runbuilds.pl --- src/tools/autobuild/runbuilds.pl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/tools/autobuild/runbuilds.pl b/src/tools/autobuild/runbuilds.pl index c0cb733a..8fca8869 100644 --- a/src/tools/autobuild/runbuilds.pl +++ b/src/tools/autobuild/runbuilds.pl @@ -160,9 +160,9 @@ make full sub BuildBranch {my ($branch) = @_; Log undef, $branch, "$branch branch build triggered."; -# # Obtain a clean clone of vishaps -# DoLogged undef, $branch, "rm -rf $home/voc"; -# DoLogged undef, $branch, "cd $home && git clone -b $branch --single-branch https://github.com/vishaps/voc"; + # Obtain a clean clone of vishaps + DoLogged undef, $branch, "rm -rf $home/voc"; + DoLogged undef, $branch, "cd $home && git clone -b $branch --single-branch https://github.com/vishaps/voc"; # Start each build in turn From 66f03634746639f4e60d831d5c19aca86adf2739 Mon Sep 17 00:00:00 2001 From: David Brown Date: Tue, 24 Apr 2018 12:21:57 +0100 Subject: [PATCH 492/580] Fix missing quotes in path setting for tests, allowing them to run in linux under windows. --- src/test/confidence/testenv.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/confidence/testenv.sh b/src/test/confidence/testenv.sh index fee87667..69bfb20e 100755 --- a/src/test/confidence/testenv.sh +++ b/src/test/confidence/testenv.sh @@ -5,8 +5,8 @@ echo --- Confidence test $(basename $PWD) --- if which cygpath >/dev/null 2>/dev/null -then export PATH="$(cygpath "$1")/bin":$PATH -else export PATH="$1/bin":$PATH +then export PATH="$(cygpath "$1")/bin":"$PATH" +else export PATH="$1/bin":"$PATH" fi # Set ibrary paths for darwin and termux(android) export DYLD_LIBRARY_PATH=$1/lib:$DYLD_LIBRARY_PATH From f458b98ff293b0f35f8fa750eb19e9daf6aa4683 Mon Sep 17 00:00:00 2001 From: David Brown Date: Tue, 24 Apr 2018 16:04:56 +0100 Subject: [PATCH 493/580] Enable index checks in Files.Mod and OPS.Mod. --- src/tools/make/oberon.mk | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/tools/make/oberon.mk b/src/tools/make/oberon.mk index fedaf039..581f3117 100644 --- a/src/tools/make/oberon.mk +++ b/src/tools/make/oberon.mk @@ -67,7 +67,7 @@ assemble: cd $(BUILDDIR) && $(COMPILE) $(STATICLINK) Compiler.c -o $(ROOTDIR)/$(OBECOMP) \ SYSTEM.o Configuration.o Platform.o Heap.o Out.o Strings.o \ - Modules.o Files.o Reals.o Texts.o VT100.o extTools.o \ + Modules.o Files.o Reals.o Texts.o VT100.o extTools.o \ OPM.o OPS.o OPT.o OPC.o OPV.o OPB.o OPP.o cp src/runtime/*.[ch] $(BUILDDIR) @@ -110,12 +110,12 @@ translate: cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Strings.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Out.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Modules.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsFx -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Files.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Files.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Texts.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/VT100.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/OPM.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/extTools.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsFx -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/OPS.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/OPS.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/OPT.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/OPC.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/OPV.Mod From 1c8828ede1e253f11016e37f9893c0527d5a6715 Mon Sep 17 00:00:00 2001 From: David Brown Date: Tue, 24 Apr 2018 16:11:16 +0100 Subject: [PATCH 494/580] Update bootstrap C source files. --- bootstrap/unix-44/Compiler.c | 2 +- bootstrap/unix-44/Configuration.c | 4 +- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Files.c | 120 +++++++++++++-------------- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 2 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 2 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 2 +- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 20 ++--- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 2 +- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 2 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Out.c | 2 +- bootstrap/unix-44/Out.h | 2 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/VT100.c | 2 +- bootstrap/unix-44/VT100.h | 2 +- bootstrap/unix-44/extTools.c | 2 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-48/Compiler.c | 2 +- bootstrap/unix-48/Configuration.c | 4 +- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Files.c | 120 +++++++++++++-------------- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 2 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 2 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 2 +- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 20 ++--- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 2 +- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 2 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Out.c | 2 +- bootstrap/unix-48/Out.h | 2 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/VT100.c | 2 +- bootstrap/unix-48/VT100.h | 2 +- bootstrap/unix-48/extTools.c | 2 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-88/Compiler.c | 2 +- bootstrap/unix-88/Configuration.c | 4 +- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Files.c | 120 +++++++++++++-------------- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 2 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 2 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 2 +- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 20 ++--- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 2 +- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 2 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Out.c | 2 +- bootstrap/unix-88/Out.h | 2 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/VT100.c | 2 +- bootstrap/unix-88/VT100.h | 2 +- bootstrap/unix-88/extTools.c | 2 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/windows-48/Compiler.c | 2 +- bootstrap/windows-48/Configuration.c | 4 +- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Files.c | 120 +++++++++++++-------------- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 2 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 2 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 2 +- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 20 ++--- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 2 +- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 2 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Out.c | 2 +- bootstrap/windows-48/Out.h | 2 +- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/VT100.c | 2 +- bootstrap/windows-48/VT100.h | 2 +- bootstrap/windows-48/extTools.c | 2 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-88/Compiler.c | 2 +- bootstrap/windows-88/Configuration.c | 4 +- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Files.c | 120 +++++++++++++-------------- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 2 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 2 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 2 +- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 20 ++--- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 2 +- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 2 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Out.c | 2 +- bootstrap/windows-88/Out.h | 2 +- bootstrap/windows-88/Platform.c | 2 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/VT100.c | 2 +- bootstrap/windows-88/VT100.h | 2 +- bootstrap/windows-88/extTools.c | 2 +- bootstrap/windows-88/extTools.h | 2 +- 185 files changed, 530 insertions(+), 530 deletions(-) diff --git a/bootstrap/unix-44/Compiler.c b/bootstrap/unix-44/Compiler.c index 10abd264..9cdbb76c 100644 --- a/bootstrap/unix-44/Compiler.c +++ b/bootstrap/unix-44/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index 8eac398d..3ab08d40 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index c817585e..7db28b57 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 333bdb63..78f0f4e9 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -154,20 +154,20 @@ static void Files_MakeFileName (CHAR *dir, ADDRESS dir__len, CHAR *name, ADDRESS __DUP(name, name__len, CHAR); i = 0; j = 0; - while (dir[i] != 0x00) { - dest[i] = dir[i]; + while (dir[__X(i, dir__len)] != 0x00) { + dest[__X(i, dest__len)] = dir[__X(i, dir__len)]; i += 1; } - if (dest[i - 1] != '/') { - dest[i] = '/'; + if (dest[__X(i - 1, dest__len)] != '/') { + dest[__X(i, dest__len)] = '/'; i += 1; } - while (name[j] != 0x00) { - dest[i] = name[j]; + while (name[__X(j, name__len)] != 0x00) { + dest[__X(i, dest__len)] = name[__X(j, name__len)]; i += 1; j += 1; } - dest[i] = 0x00; + dest[__X(i, dest__len)] = 0x00; __DEL(dir); __DEL(name); } @@ -180,45 +180,45 @@ static void Files_GetTempName (CHAR *finalName, ADDRESS finalName__len, CHAR *na n = Files_tempno; i = 0; if (finalName[0] != '/') { - while (Platform_CWD[i] != 0x00) { - name[i] = Platform_CWD[i]; + while (Platform_CWD[__X(i, 256)] != 0x00) { + name[__X(i, name__len)] = Platform_CWD[__X(i, 256)]; i += 1; } - if (Platform_CWD[i - 1] != '/') { - name[i] = '/'; + if (Platform_CWD[__X(i - 1, 256)] != '/') { + name[__X(i, name__len)] = '/'; i += 1; } } j = 0; - while (finalName[j] != 0x00) { - name[i] = finalName[j]; + while (finalName[__X(j, finalName__len)] != 0x00) { + name[__X(i, name__len)] = finalName[__X(j, finalName__len)]; i += 1; j += 1; } i -= 1; - while (name[i] != '/') { + while (name[__X(i, name__len)] != '/') { i -= 1; } - name[i + 1] = '.'; - name[i + 2] = 't'; - name[i + 3] = 'm'; - name[i + 4] = 'p'; - name[i + 5] = '.'; + name[__X(i + 1, name__len)] = '.'; + name[__X(i + 2, name__len)] = 't'; + name[__X(i + 3, name__len)] = 'm'; + name[__X(i + 4, name__len)] = 'p'; + name[__X(i + 5, name__len)] = '.'; i += 6; while (n > 0) { - name[i] = (CHAR)((int)__MOD(n, 10) + 48); + name[__X(i, name__len)] = (CHAR)((int)__MOD(n, 10) + 48); n = __DIV(n, 10); i += 1; } - name[i] = '.'; + name[__X(i, name__len)] = '.'; i += 1; n = Platform_PID; while (n > 0) { - name[i] = (CHAR)((int)__MOD(n, 10) + 48); + name[__X(i, name__len)] = (CHAR)((int)__MOD(n, 10) + 48); n = __DIV(n, 10); i += 1; } - name[i] = 0x00; + name[__X(i, name__len)] = 0x00; __DEL(finalName); } @@ -319,8 +319,8 @@ void Files_Close (Files_File f) if (f->state != 1 || f->registerName[0] != 0x00) { Files_Create(f); i = 0; - while ((i < 4 && f->bufs[i] != NIL)) { - Files_Flush(f->bufs[i]); + while ((i < 4 && f->bufs[__X(i, 4)] != NIL)) { + Files_Flush(f->bufs[__X(i, 4)]); i += 1; } } @@ -359,35 +359,35 @@ static void Files_ScanPath (INT16 *pos, CHAR *dir, ADDRESS dir__len) *pos += 1; } } else { - ch = (Files_SearchPath->data)[*pos]; + ch = (Files_SearchPath->data)[__X(*pos, Files_SearchPath->len[0])]; while (ch == ' ' || ch == ';') { *pos += 1; - ch = (Files_SearchPath->data)[*pos]; + ch = (Files_SearchPath->data)[__X(*pos, Files_SearchPath->len[0])]; } if (ch == '~') { *pos += 1; - ch = (Files_SearchPath->data)[*pos]; - while (Files_HOME[i] != 0x00) { - dir[i] = Files_HOME[i]; + ch = (Files_SearchPath->data)[__X(*pos, Files_SearchPath->len[0])]; + while (Files_HOME[__X(i, 1024)] != 0x00) { + dir[__X(i, dir__len)] = Files_HOME[__X(i, 1024)]; i += 1; } if ((((((ch != '/' && ch != 0x00)) && ch != ';')) && ch != ' ')) { - while ((i > 0 && dir[i - 1] != '/')) { + while ((i > 0 && dir[__X(i - 1, dir__len)] != '/')) { i -= 1; } } } while ((ch != 0x00 && ch != ';')) { - dir[i] = ch; + dir[__X(i, dir__len)] = ch; i += 1; *pos += 1; - ch = (Files_SearchPath->data)[*pos]; + ch = (Files_SearchPath->data)[__X(*pos, Files_SearchPath->len[0])]; } - while ((i > 0 && dir[i - 1] == ' ')) { + while ((i > 0 && dir[__X(i - 1, dir__len)] == ' ')) { i -= 1; } } - dir[i] = 0x00; + dir[__X(i, dir__len)] = 0x00; } static BOOLEAN Files_HasDir (CHAR *name, ADDRESS name__len) @@ -398,7 +398,7 @@ static BOOLEAN Files_HasDir (CHAR *name, ADDRESS name__len) ch = name[0]; while ((ch != 0x00 && ch != '/')) { i += 1; - ch = name[i]; + ch = name[__X(i, name__len)]; } return ch == '/'; } @@ -413,9 +413,9 @@ static Files_File Files_CacheEntry (Platform_FileIdentity identity) if (!Platform_SameFileTime(identity, f->identity)) { i = 0; while (i < 4) { - if (f->bufs[i] != NIL) { - f->bufs[i]->org = -1; - f->bufs[i] = NIL; + if (f->bufs[__X(i, 4)] != NIL) { + f->bufs[__X(i, 4)]->org = -1; + f->bufs[__X(i, 4)] = NIL; } i += 1; } @@ -514,9 +514,9 @@ void Files_Purge (Files_File f) INT16 error; i = 0; while (i < 4) { - if (f->bufs[i] != NIL) { - f->bufs[i]->org = -1; - f->bufs[i] = NIL; + if (f->bufs[__X(i, 4)] != NIL) { + f->bufs[__X(i, 4)]->org = -1; + f->bufs[__X(i, 4)] = NIL; } i += 1; } @@ -560,22 +560,22 @@ void Files_Set (Files_Rider *r, ADDRESS *r__typ, Files_File f, INT32 pos) offset = __MASK(pos, -4096); org = pos - offset; i = 0; - while ((((i < 4 && f->bufs[i] != NIL)) && org != f->bufs[i]->org)) { + while ((((i < 4 && f->bufs[__X(i, 4)] != NIL)) && org != f->bufs[__X(i, 4)]->org)) { i += 1; } if (i < 4) { - if (f->bufs[i] == NIL) { + if (f->bufs[__X(i, 4)] == NIL) { __NEW(buf, Files_BufDesc); buf->chg = 0; buf->org = -1; buf->f = f; - f->bufs[i] = buf; + f->bufs[__X(i, 4)] = buf; } else { - buf = f->bufs[i]; + buf = f->bufs[__X(i, 4)]; } } else { f->swapper = __MASK(f->swapper + 1, -4); - buf = f->bufs[f->swapper]; + buf = f->bufs[__X(f->swapper, 4)]; Files_Flush(buf); } if (buf->org != org) { @@ -622,7 +622,7 @@ void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x) } Files_Assert(offset <= buf->size); if (offset < buf->size) { - *x = buf->data[offset]; + *x = buf->data[__X(offset, 4096)]; (*r).offset = offset + 1; } else if ((*r).org + offset < buf->f->len) { Files_Set(&*r, r__typ, (*r).buf->f, (*r).org + offset); @@ -660,7 +660,7 @@ void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS x } else { min = n; } - __MOVE((ADDRESS)&buf->data[offset], (ADDRESS)&x[xpos], min); + __MOVE((ADDRESS)&buf->data[__X(offset, 4096)], (ADDRESS)&x[__X(xpos, x__len)], min); offset += min; (*r).offset = offset; xpos += min; @@ -689,7 +689,7 @@ void Files_Write (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE x) offset = (*r).offset; } Files_Assert(offset < 4096); - buf->data[offset] = x; + buf->data[__X(offset, 4096)] = x; buf->chg = 1; if (offset == buf->size) { buf->size += 1; @@ -723,7 +723,7 @@ void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS } else { min = n; } - __MOVE((ADDRESS)&x[xpos], (ADDRESS)&buf->data[offset], min); + __MOVE((ADDRESS)&x[__X(xpos, x__len)], (ADDRESS)&buf->data[__X(offset, 4096)], min); offset += min; (*r).offset = offset; Files_Assert(offset <= 4096); @@ -843,7 +843,7 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, ADDRESS src__len, SYSTEM_BYTE *de j = 0; while (i > 0) { i -= 1; - dest[j] = src[i]; + dest[__X(j, dest__len)] = src[__X(i, src__len)]; j += 1; } } else { @@ -900,7 +900,7 @@ void Files_ReadString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, ADDRESS x__len) i = 0; do { Files_Read(&*R, R__typ, (void*)&ch); - x[i] = ch; + x[__X(i, x__len)] = ch; i += 1; } while (!(ch == 0x00)); } @@ -910,16 +910,16 @@ void Files_ReadLine (Files_Rider *R, ADDRESS *R__typ, CHAR *x, ADDRESS x__len) INT16 i; i = 0; do { - Files_Read(&*R, R__typ, (void*)&x[i]); + Files_Read(&*R, R__typ, (void*)&x[__X(i, x__len)]); i += 1; - } while (!(x[i - 1] == 0x00 || x[i - 1] == 0x0a)); - if (x[i - 1] == 0x0a) { + } while (!(x[__X(i - 1, x__len)] == 0x00 || x[__X(i - 1, x__len)] == 0x0a)); + if (x[__X(i - 1, x__len)] == 0x0a) { i -= 1; } - if ((i > 0 && x[i - 1] == 0x0d)) { + if ((i > 0 && x[__X(i - 1, x__len)] == 0x0d)) { i -= 1; } - x[i] = 0x00; + x[__X(i, x__len)] = 0x00; } void Files_ReadNum (Files_Rider *R, ADDRESS *R__typ, SYSTEM_BYTE *x, ADDRESS x__len) @@ -992,7 +992,7 @@ void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, ADDRESS x__len { INT16 i; i = 0; - while (x[i] != 0x00) { + while (x[__X(i, x__len)] != 0x00) { i += 1; } Files_WriteBytes(&*R, R__typ, (void*)x, x__len * 1, i + 1); diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index 8c775fa4..a0bced1c 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index 348b336b..bd4ed5a8 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index b73de4fe..8d7eb8e5 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index 89f370a7..8ae1f5fb 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index 2d074a62..9d10f4ac 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index 41e56e38..d7012f3e 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index 0eba52d2..b82bf9ba 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 7fa9fa23..42cd3c56 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index 1e17f6c2..b79317f7 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 3dbed3bf..e6b33367 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index 9c84b7af..1c6ca2ac 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index 00e4fa0e..54a9f7c8 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index 010479f8..52242f7c 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index 74719041..0e42294b 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -56,11 +56,11 @@ static void OPS_Str (INT8 *sym) OPS_err(241); break; } - OPS_str[i] = OPS_ch; + OPS_str[__X(i, 256)] = OPS_ch; i += 1; } OPM_Get(&OPS_ch); - OPS_str[i] = 0x00; + OPS_str[__X(i, 256)] = 0x00; OPS_intval = i + 1; if (OPS_intval == 2) { *sym = 35; @@ -76,7 +76,7 @@ static void OPS_Identifier (INT8 *sym) INT16 i; i = 0; do { - OPS_name[i] = OPS_ch; + OPS_name[__X(i, 256)] = OPS_ch; i += 1; OPM_Get(&OPS_ch); } while (!(((OPS_ch < '0' || ('9' < OPS_ch && __CAP(OPS_ch) < 'A')) || 'Z' < __CAP(OPS_ch)) || i == 256)); @@ -84,7 +84,7 @@ static void OPS_Identifier (INT8 *sym) OPS_err(240); i -= 1; } - OPS_name[i] = 0x00; + OPS_name[__X(i, 256)] = 0x00; *sym = 38; } @@ -143,7 +143,7 @@ static void OPS_Number (void) if (('0' <= OPS_ch && OPS_ch <= '9') || (((d == 0 && 'A' <= OPS_ch)) && OPS_ch <= 'F')) { if (m > 0 || OPS_ch != '0') { if (n < 24) { - dig[n] = OPS_ch; + dig[__X(n, 24)] = OPS_ch; n += 1; } m += 1; @@ -173,7 +173,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) + (INT64)Ord__7(dig[__X(i, 24)], 1); i += 1; } } else { @@ -187,7 +187,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) + (INT64)Ord__7(dig[__X(i, 24)], 1); i += 1; } } else { @@ -196,7 +196,7 @@ static void OPS_Number (void) } else { OPS_numtyp = 2; while (i < n) { - d = Ord__7(dig[i], 0); + d = Ord__7(dig[__X(i, 24)], 0); i += 1; if (OPS_intval <= __DIV(9223372036854775807LL - (INT64)d, 10)) { OPS_intval = OPS_intval * 10 + (INT64)d; @@ -214,7 +214,7 @@ static void OPS_Number (void) expCh = 'E'; while (n > 0) { n -= 1; - f = (Ord__7(dig[n], 0) + f) / (LONGREAL)(LONGREAL)10; + f = (Ord__7(dig[__X(n, 24)], 0) + f) / (LONGREAL)(LONGREAL)10; } if (OPS_ch == 'E' || OPS_ch == 'D') { expCh = OPS_ch; diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index dfe2b972..15cdcc6c 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index d6a4c67b..bc38d46b 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index f457c51e..a4688654 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index 5193f272..ebe18cc4 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index bee5e44d..05e906a7 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Out.c b/bootstrap/unix-44/Out.c index 54d88edf..fc5b46c6 100644 --- a/bootstrap/unix-44/Out.c +++ b/bootstrap/unix-44/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Out.h b/bootstrap/unix-44/Out.h index fad5cd1a..0819285a 100644 --- a/bootstrap/unix-44/Out.h +++ b/bootstrap/unix-44/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 86284785..b5bf3da8 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index c4f8841c..6c2d79c8 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 2af2574f..44be33b7 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index 07f4371d..7c2e0e35 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index 3d82b654..6158bc92 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index df6f5edc..42b68da8 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index e4ee535c..6d66b07b 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index d53e287c..c706a783 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/VT100.c b/bootstrap/unix-44/VT100.c index 5bfcea49..a3b0b0dd 100644 --- a/bootstrap/unix-44/VT100.c +++ b/bootstrap/unix-44/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/VT100.h b/bootstrap/unix-44/VT100.h index 51c85058..e7539d2f 100644 --- a/bootstrap/unix-44/VT100.h +++ b/bootstrap/unix-44/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index 2b6c962b..562921ce 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index 9b0b1ee9..e6dd4577 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/Compiler.c b/bootstrap/unix-48/Compiler.c index 10abd264..9cdbb76c 100644 --- a/bootstrap/unix-48/Compiler.c +++ b/bootstrap/unix-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index 8eac398d..3ab08d40 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index c817585e..7db28b57 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 333bdb63..78f0f4e9 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -154,20 +154,20 @@ static void Files_MakeFileName (CHAR *dir, ADDRESS dir__len, CHAR *name, ADDRESS __DUP(name, name__len, CHAR); i = 0; j = 0; - while (dir[i] != 0x00) { - dest[i] = dir[i]; + while (dir[__X(i, dir__len)] != 0x00) { + dest[__X(i, dest__len)] = dir[__X(i, dir__len)]; i += 1; } - if (dest[i - 1] != '/') { - dest[i] = '/'; + if (dest[__X(i - 1, dest__len)] != '/') { + dest[__X(i, dest__len)] = '/'; i += 1; } - while (name[j] != 0x00) { - dest[i] = name[j]; + while (name[__X(j, name__len)] != 0x00) { + dest[__X(i, dest__len)] = name[__X(j, name__len)]; i += 1; j += 1; } - dest[i] = 0x00; + dest[__X(i, dest__len)] = 0x00; __DEL(dir); __DEL(name); } @@ -180,45 +180,45 @@ static void Files_GetTempName (CHAR *finalName, ADDRESS finalName__len, CHAR *na n = Files_tempno; i = 0; if (finalName[0] != '/') { - while (Platform_CWD[i] != 0x00) { - name[i] = Platform_CWD[i]; + while (Platform_CWD[__X(i, 256)] != 0x00) { + name[__X(i, name__len)] = Platform_CWD[__X(i, 256)]; i += 1; } - if (Platform_CWD[i - 1] != '/') { - name[i] = '/'; + if (Platform_CWD[__X(i - 1, 256)] != '/') { + name[__X(i, name__len)] = '/'; i += 1; } } j = 0; - while (finalName[j] != 0x00) { - name[i] = finalName[j]; + while (finalName[__X(j, finalName__len)] != 0x00) { + name[__X(i, name__len)] = finalName[__X(j, finalName__len)]; i += 1; j += 1; } i -= 1; - while (name[i] != '/') { + while (name[__X(i, name__len)] != '/') { i -= 1; } - name[i + 1] = '.'; - name[i + 2] = 't'; - name[i + 3] = 'm'; - name[i + 4] = 'p'; - name[i + 5] = '.'; + name[__X(i + 1, name__len)] = '.'; + name[__X(i + 2, name__len)] = 't'; + name[__X(i + 3, name__len)] = 'm'; + name[__X(i + 4, name__len)] = 'p'; + name[__X(i + 5, name__len)] = '.'; i += 6; while (n > 0) { - name[i] = (CHAR)((int)__MOD(n, 10) + 48); + name[__X(i, name__len)] = (CHAR)((int)__MOD(n, 10) + 48); n = __DIV(n, 10); i += 1; } - name[i] = '.'; + name[__X(i, name__len)] = '.'; i += 1; n = Platform_PID; while (n > 0) { - name[i] = (CHAR)((int)__MOD(n, 10) + 48); + name[__X(i, name__len)] = (CHAR)((int)__MOD(n, 10) + 48); n = __DIV(n, 10); i += 1; } - name[i] = 0x00; + name[__X(i, name__len)] = 0x00; __DEL(finalName); } @@ -319,8 +319,8 @@ void Files_Close (Files_File f) if (f->state != 1 || f->registerName[0] != 0x00) { Files_Create(f); i = 0; - while ((i < 4 && f->bufs[i] != NIL)) { - Files_Flush(f->bufs[i]); + while ((i < 4 && f->bufs[__X(i, 4)] != NIL)) { + Files_Flush(f->bufs[__X(i, 4)]); i += 1; } } @@ -359,35 +359,35 @@ static void Files_ScanPath (INT16 *pos, CHAR *dir, ADDRESS dir__len) *pos += 1; } } else { - ch = (Files_SearchPath->data)[*pos]; + ch = (Files_SearchPath->data)[__X(*pos, Files_SearchPath->len[0])]; while (ch == ' ' || ch == ';') { *pos += 1; - ch = (Files_SearchPath->data)[*pos]; + ch = (Files_SearchPath->data)[__X(*pos, Files_SearchPath->len[0])]; } if (ch == '~') { *pos += 1; - ch = (Files_SearchPath->data)[*pos]; - while (Files_HOME[i] != 0x00) { - dir[i] = Files_HOME[i]; + ch = (Files_SearchPath->data)[__X(*pos, Files_SearchPath->len[0])]; + while (Files_HOME[__X(i, 1024)] != 0x00) { + dir[__X(i, dir__len)] = Files_HOME[__X(i, 1024)]; i += 1; } if ((((((ch != '/' && ch != 0x00)) && ch != ';')) && ch != ' ')) { - while ((i > 0 && dir[i - 1] != '/')) { + while ((i > 0 && dir[__X(i - 1, dir__len)] != '/')) { i -= 1; } } } while ((ch != 0x00 && ch != ';')) { - dir[i] = ch; + dir[__X(i, dir__len)] = ch; i += 1; *pos += 1; - ch = (Files_SearchPath->data)[*pos]; + ch = (Files_SearchPath->data)[__X(*pos, Files_SearchPath->len[0])]; } - while ((i > 0 && dir[i - 1] == ' ')) { + while ((i > 0 && dir[__X(i - 1, dir__len)] == ' ')) { i -= 1; } } - dir[i] = 0x00; + dir[__X(i, dir__len)] = 0x00; } static BOOLEAN Files_HasDir (CHAR *name, ADDRESS name__len) @@ -398,7 +398,7 @@ static BOOLEAN Files_HasDir (CHAR *name, ADDRESS name__len) ch = name[0]; while ((ch != 0x00 && ch != '/')) { i += 1; - ch = name[i]; + ch = name[__X(i, name__len)]; } return ch == '/'; } @@ -413,9 +413,9 @@ static Files_File Files_CacheEntry (Platform_FileIdentity identity) if (!Platform_SameFileTime(identity, f->identity)) { i = 0; while (i < 4) { - if (f->bufs[i] != NIL) { - f->bufs[i]->org = -1; - f->bufs[i] = NIL; + if (f->bufs[__X(i, 4)] != NIL) { + f->bufs[__X(i, 4)]->org = -1; + f->bufs[__X(i, 4)] = NIL; } i += 1; } @@ -514,9 +514,9 @@ void Files_Purge (Files_File f) INT16 error; i = 0; while (i < 4) { - if (f->bufs[i] != NIL) { - f->bufs[i]->org = -1; - f->bufs[i] = NIL; + if (f->bufs[__X(i, 4)] != NIL) { + f->bufs[__X(i, 4)]->org = -1; + f->bufs[__X(i, 4)] = NIL; } i += 1; } @@ -560,22 +560,22 @@ void Files_Set (Files_Rider *r, ADDRESS *r__typ, Files_File f, INT32 pos) offset = __MASK(pos, -4096); org = pos - offset; i = 0; - while ((((i < 4 && f->bufs[i] != NIL)) && org != f->bufs[i]->org)) { + while ((((i < 4 && f->bufs[__X(i, 4)] != NIL)) && org != f->bufs[__X(i, 4)]->org)) { i += 1; } if (i < 4) { - if (f->bufs[i] == NIL) { + if (f->bufs[__X(i, 4)] == NIL) { __NEW(buf, Files_BufDesc); buf->chg = 0; buf->org = -1; buf->f = f; - f->bufs[i] = buf; + f->bufs[__X(i, 4)] = buf; } else { - buf = f->bufs[i]; + buf = f->bufs[__X(i, 4)]; } } else { f->swapper = __MASK(f->swapper + 1, -4); - buf = f->bufs[f->swapper]; + buf = f->bufs[__X(f->swapper, 4)]; Files_Flush(buf); } if (buf->org != org) { @@ -622,7 +622,7 @@ void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x) } Files_Assert(offset <= buf->size); if (offset < buf->size) { - *x = buf->data[offset]; + *x = buf->data[__X(offset, 4096)]; (*r).offset = offset + 1; } else if ((*r).org + offset < buf->f->len) { Files_Set(&*r, r__typ, (*r).buf->f, (*r).org + offset); @@ -660,7 +660,7 @@ void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS x } else { min = n; } - __MOVE((ADDRESS)&buf->data[offset], (ADDRESS)&x[xpos], min); + __MOVE((ADDRESS)&buf->data[__X(offset, 4096)], (ADDRESS)&x[__X(xpos, x__len)], min); offset += min; (*r).offset = offset; xpos += min; @@ -689,7 +689,7 @@ void Files_Write (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE x) offset = (*r).offset; } Files_Assert(offset < 4096); - buf->data[offset] = x; + buf->data[__X(offset, 4096)] = x; buf->chg = 1; if (offset == buf->size) { buf->size += 1; @@ -723,7 +723,7 @@ void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS } else { min = n; } - __MOVE((ADDRESS)&x[xpos], (ADDRESS)&buf->data[offset], min); + __MOVE((ADDRESS)&x[__X(xpos, x__len)], (ADDRESS)&buf->data[__X(offset, 4096)], min); offset += min; (*r).offset = offset; Files_Assert(offset <= 4096); @@ -843,7 +843,7 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, ADDRESS src__len, SYSTEM_BYTE *de j = 0; while (i > 0) { i -= 1; - dest[j] = src[i]; + dest[__X(j, dest__len)] = src[__X(i, src__len)]; j += 1; } } else { @@ -900,7 +900,7 @@ void Files_ReadString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, ADDRESS x__len) i = 0; do { Files_Read(&*R, R__typ, (void*)&ch); - x[i] = ch; + x[__X(i, x__len)] = ch; i += 1; } while (!(ch == 0x00)); } @@ -910,16 +910,16 @@ void Files_ReadLine (Files_Rider *R, ADDRESS *R__typ, CHAR *x, ADDRESS x__len) INT16 i; i = 0; do { - Files_Read(&*R, R__typ, (void*)&x[i]); + Files_Read(&*R, R__typ, (void*)&x[__X(i, x__len)]); i += 1; - } while (!(x[i - 1] == 0x00 || x[i - 1] == 0x0a)); - if (x[i - 1] == 0x0a) { + } while (!(x[__X(i - 1, x__len)] == 0x00 || x[__X(i - 1, x__len)] == 0x0a)); + if (x[__X(i - 1, x__len)] == 0x0a) { i -= 1; } - if ((i > 0 && x[i - 1] == 0x0d)) { + if ((i > 0 && x[__X(i - 1, x__len)] == 0x0d)) { i -= 1; } - x[i] = 0x00; + x[__X(i, x__len)] = 0x00; } void Files_ReadNum (Files_Rider *R, ADDRESS *R__typ, SYSTEM_BYTE *x, ADDRESS x__len) @@ -992,7 +992,7 @@ void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, ADDRESS x__len { INT16 i; i = 0; - while (x[i] != 0x00) { + while (x[__X(i, x__len)] != 0x00) { i += 1; } Files_WriteBytes(&*R, R__typ, (void*)x, x__len * 1, i + 1); diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index 8c775fa4..a0bced1c 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index 348b336b..bd4ed5a8 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index b73de4fe..8d7eb8e5 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index 89f370a7..8ae1f5fb 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index 2d074a62..9d10f4ac 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index 41e56e38..d7012f3e 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index 0eba52d2..b82bf9ba 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 7fa9fa23..42cd3c56 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index 1e17f6c2..b79317f7 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 3dbed3bf..e6b33367 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index 9c84b7af..1c6ca2ac 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index 00e4fa0e..54a9f7c8 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index 010479f8..52242f7c 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index 74719041..0e42294b 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -56,11 +56,11 @@ static void OPS_Str (INT8 *sym) OPS_err(241); break; } - OPS_str[i] = OPS_ch; + OPS_str[__X(i, 256)] = OPS_ch; i += 1; } OPM_Get(&OPS_ch); - OPS_str[i] = 0x00; + OPS_str[__X(i, 256)] = 0x00; OPS_intval = i + 1; if (OPS_intval == 2) { *sym = 35; @@ -76,7 +76,7 @@ static void OPS_Identifier (INT8 *sym) INT16 i; i = 0; do { - OPS_name[i] = OPS_ch; + OPS_name[__X(i, 256)] = OPS_ch; i += 1; OPM_Get(&OPS_ch); } while (!(((OPS_ch < '0' || ('9' < OPS_ch && __CAP(OPS_ch) < 'A')) || 'Z' < __CAP(OPS_ch)) || i == 256)); @@ -84,7 +84,7 @@ static void OPS_Identifier (INT8 *sym) OPS_err(240); i -= 1; } - OPS_name[i] = 0x00; + OPS_name[__X(i, 256)] = 0x00; *sym = 38; } @@ -143,7 +143,7 @@ static void OPS_Number (void) if (('0' <= OPS_ch && OPS_ch <= '9') || (((d == 0 && 'A' <= OPS_ch)) && OPS_ch <= 'F')) { if (m > 0 || OPS_ch != '0') { if (n < 24) { - dig[n] = OPS_ch; + dig[__X(n, 24)] = OPS_ch; n += 1; } m += 1; @@ -173,7 +173,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) + (INT64)Ord__7(dig[__X(i, 24)], 1); i += 1; } } else { @@ -187,7 +187,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) + (INT64)Ord__7(dig[__X(i, 24)], 1); i += 1; } } else { @@ -196,7 +196,7 @@ static void OPS_Number (void) } else { OPS_numtyp = 2; while (i < n) { - d = Ord__7(dig[i], 0); + d = Ord__7(dig[__X(i, 24)], 0); i += 1; if (OPS_intval <= __DIV(9223372036854775807LL - (INT64)d, 10)) { OPS_intval = OPS_intval * 10 + (INT64)d; @@ -214,7 +214,7 @@ static void OPS_Number (void) expCh = 'E'; while (n > 0) { n -= 1; - f = (Ord__7(dig[n], 0) + f) / (LONGREAL)(LONGREAL)10; + f = (Ord__7(dig[__X(n, 24)], 0) + f) / (LONGREAL)(LONGREAL)10; } if (OPS_ch == 'E' || OPS_ch == 'D') { expCh = OPS_ch; diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index dfe2b972..15cdcc6c 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 962b0f86..1897f024 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index f457c51e..a4688654 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index 5193f272..ebe18cc4 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index bee5e44d..05e906a7 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Out.c b/bootstrap/unix-48/Out.c index 54d88edf..fc5b46c6 100644 --- a/bootstrap/unix-48/Out.c +++ b/bootstrap/unix-48/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Out.h b/bootstrap/unix-48/Out.h index fad5cd1a..0819285a 100644 --- a/bootstrap/unix-48/Out.h +++ b/bootstrap/unix-48/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 86284785..b5bf3da8 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index c4f8841c..6c2d79c8 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 2af2574f..44be33b7 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index 07f4371d..7c2e0e35 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index 3d82b654..6158bc92 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index df6f5edc..42b68da8 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index 8e4938b8..2726593a 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index 0c55850a..714d9ac5 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/VT100.c b/bootstrap/unix-48/VT100.c index 5bfcea49..a3b0b0dd 100644 --- a/bootstrap/unix-48/VT100.c +++ b/bootstrap/unix-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/VT100.h b/bootstrap/unix-48/VT100.h index 51c85058..e7539d2f 100644 --- a/bootstrap/unix-48/VT100.h +++ b/bootstrap/unix-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index 2b6c962b..562921ce 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index 9b0b1ee9..e6dd4577 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/Compiler.c b/bootstrap/unix-88/Compiler.c index 10abd264..9cdbb76c 100644 --- a/bootstrap/unix-88/Compiler.c +++ b/bootstrap/unix-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index 8eac398d..3ab08d40 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index c817585e..7db28b57 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 4e3baead..0738e4f7 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -154,20 +154,20 @@ static void Files_MakeFileName (CHAR *dir, ADDRESS dir__len, CHAR *name, ADDRESS __DUP(name, name__len, CHAR); i = 0; j = 0; - while (dir[i] != 0x00) { - dest[i] = dir[i]; + while (dir[__X(i, dir__len)] != 0x00) { + dest[__X(i, dest__len)] = dir[__X(i, dir__len)]; i += 1; } - if (dest[i - 1] != '/') { - dest[i] = '/'; + if (dest[__X(i - 1, dest__len)] != '/') { + dest[__X(i, dest__len)] = '/'; i += 1; } - while (name[j] != 0x00) { - dest[i] = name[j]; + while (name[__X(j, name__len)] != 0x00) { + dest[__X(i, dest__len)] = name[__X(j, name__len)]; i += 1; j += 1; } - dest[i] = 0x00; + dest[__X(i, dest__len)] = 0x00; __DEL(dir); __DEL(name); } @@ -180,45 +180,45 @@ static void Files_GetTempName (CHAR *finalName, ADDRESS finalName__len, CHAR *na n = Files_tempno; i = 0; if (finalName[0] != '/') { - while (Platform_CWD[i] != 0x00) { - name[i] = Platform_CWD[i]; + while (Platform_CWD[__X(i, 256)] != 0x00) { + name[__X(i, name__len)] = Platform_CWD[__X(i, 256)]; i += 1; } - if (Platform_CWD[i - 1] != '/') { - name[i] = '/'; + if (Platform_CWD[__X(i - 1, 256)] != '/') { + name[__X(i, name__len)] = '/'; i += 1; } } j = 0; - while (finalName[j] != 0x00) { - name[i] = finalName[j]; + while (finalName[__X(j, finalName__len)] != 0x00) { + name[__X(i, name__len)] = finalName[__X(j, finalName__len)]; i += 1; j += 1; } i -= 1; - while (name[i] != '/') { + while (name[__X(i, name__len)] != '/') { i -= 1; } - name[i + 1] = '.'; - name[i + 2] = 't'; - name[i + 3] = 'm'; - name[i + 4] = 'p'; - name[i + 5] = '.'; + name[__X(i + 1, name__len)] = '.'; + name[__X(i + 2, name__len)] = 't'; + name[__X(i + 3, name__len)] = 'm'; + name[__X(i + 4, name__len)] = 'p'; + name[__X(i + 5, name__len)] = '.'; i += 6; while (n > 0) { - name[i] = (CHAR)((int)__MOD(n, 10) + 48); + name[__X(i, name__len)] = (CHAR)((int)__MOD(n, 10) + 48); n = __DIV(n, 10); i += 1; } - name[i] = '.'; + name[__X(i, name__len)] = '.'; i += 1; n = Platform_PID; while (n > 0) { - name[i] = (CHAR)((int)__MOD(n, 10) + 48); + name[__X(i, name__len)] = (CHAR)((int)__MOD(n, 10) + 48); n = __DIV(n, 10); i += 1; } - name[i] = 0x00; + name[__X(i, name__len)] = 0x00; __DEL(finalName); } @@ -319,8 +319,8 @@ void Files_Close (Files_File f) if (f->state != 1 || f->registerName[0] != 0x00) { Files_Create(f); i = 0; - while ((i < 4 && f->bufs[i] != NIL)) { - Files_Flush(f->bufs[i]); + while ((i < 4 && f->bufs[__X(i, 4)] != NIL)) { + Files_Flush(f->bufs[__X(i, 4)]); i += 1; } } @@ -359,35 +359,35 @@ static void Files_ScanPath (INT16 *pos, CHAR *dir, ADDRESS dir__len) *pos += 1; } } else { - ch = (Files_SearchPath->data)[*pos]; + ch = (Files_SearchPath->data)[__X(*pos, Files_SearchPath->len[0])]; while (ch == ' ' || ch == ';') { *pos += 1; - ch = (Files_SearchPath->data)[*pos]; + ch = (Files_SearchPath->data)[__X(*pos, Files_SearchPath->len[0])]; } if (ch == '~') { *pos += 1; - ch = (Files_SearchPath->data)[*pos]; - while (Files_HOME[i] != 0x00) { - dir[i] = Files_HOME[i]; + ch = (Files_SearchPath->data)[__X(*pos, Files_SearchPath->len[0])]; + while (Files_HOME[__X(i, 1024)] != 0x00) { + dir[__X(i, dir__len)] = Files_HOME[__X(i, 1024)]; i += 1; } if ((((((ch != '/' && ch != 0x00)) && ch != ';')) && ch != ' ')) { - while ((i > 0 && dir[i - 1] != '/')) { + while ((i > 0 && dir[__X(i - 1, dir__len)] != '/')) { i -= 1; } } } while ((ch != 0x00 && ch != ';')) { - dir[i] = ch; + dir[__X(i, dir__len)] = ch; i += 1; *pos += 1; - ch = (Files_SearchPath->data)[*pos]; + ch = (Files_SearchPath->data)[__X(*pos, Files_SearchPath->len[0])]; } - while ((i > 0 && dir[i - 1] == ' ')) { + while ((i > 0 && dir[__X(i - 1, dir__len)] == ' ')) { i -= 1; } } - dir[i] = 0x00; + dir[__X(i, dir__len)] = 0x00; } static BOOLEAN Files_HasDir (CHAR *name, ADDRESS name__len) @@ -398,7 +398,7 @@ static BOOLEAN Files_HasDir (CHAR *name, ADDRESS name__len) ch = name[0]; while ((ch != 0x00 && ch != '/')) { i += 1; - ch = name[i]; + ch = name[__X(i, name__len)]; } return ch == '/'; } @@ -413,9 +413,9 @@ static Files_File Files_CacheEntry (Platform_FileIdentity identity) if (!Platform_SameFileTime(identity, f->identity)) { i = 0; while (i < 4) { - if (f->bufs[i] != NIL) { - f->bufs[i]->org = -1; - f->bufs[i] = NIL; + if (f->bufs[__X(i, 4)] != NIL) { + f->bufs[__X(i, 4)]->org = -1; + f->bufs[__X(i, 4)] = NIL; } i += 1; } @@ -514,9 +514,9 @@ void Files_Purge (Files_File f) INT16 error; i = 0; while (i < 4) { - if (f->bufs[i] != NIL) { - f->bufs[i]->org = -1; - f->bufs[i] = NIL; + if (f->bufs[__X(i, 4)] != NIL) { + f->bufs[__X(i, 4)]->org = -1; + f->bufs[__X(i, 4)] = NIL; } i += 1; } @@ -560,22 +560,22 @@ void Files_Set (Files_Rider *r, ADDRESS *r__typ, Files_File f, INT32 pos) offset = __MASK(pos, -4096); org = pos - offset; i = 0; - while ((((i < 4 && f->bufs[i] != NIL)) && org != f->bufs[i]->org)) { + while ((((i < 4 && f->bufs[__X(i, 4)] != NIL)) && org != f->bufs[__X(i, 4)]->org)) { i += 1; } if (i < 4) { - if (f->bufs[i] == NIL) { + if (f->bufs[__X(i, 4)] == NIL) { __NEW(buf, Files_BufDesc); buf->chg = 0; buf->org = -1; buf->f = f; - f->bufs[i] = buf; + f->bufs[__X(i, 4)] = buf; } else { - buf = f->bufs[i]; + buf = f->bufs[__X(i, 4)]; } } else { f->swapper = __MASK(f->swapper + 1, -4); - buf = f->bufs[f->swapper]; + buf = f->bufs[__X(f->swapper, 4)]; Files_Flush(buf); } if (buf->org != org) { @@ -622,7 +622,7 @@ void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x) } Files_Assert(offset <= buf->size); if (offset < buf->size) { - *x = buf->data[offset]; + *x = buf->data[__X(offset, 4096)]; (*r).offset = offset + 1; } else if ((*r).org + offset < buf->f->len) { Files_Set(&*r, r__typ, (*r).buf->f, (*r).org + offset); @@ -660,7 +660,7 @@ void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS x } else { min = n; } - __MOVE((ADDRESS)&buf->data[offset], (ADDRESS)&x[xpos], min); + __MOVE((ADDRESS)&buf->data[__X(offset, 4096)], (ADDRESS)&x[__X(xpos, x__len)], min); offset += min; (*r).offset = offset; xpos += min; @@ -689,7 +689,7 @@ void Files_Write (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE x) offset = (*r).offset; } Files_Assert(offset < 4096); - buf->data[offset] = x; + buf->data[__X(offset, 4096)] = x; buf->chg = 1; if (offset == buf->size) { buf->size += 1; @@ -723,7 +723,7 @@ void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS } else { min = n; } - __MOVE((ADDRESS)&x[xpos], (ADDRESS)&buf->data[offset], min); + __MOVE((ADDRESS)&x[__X(xpos, x__len)], (ADDRESS)&buf->data[__X(offset, 4096)], min); offset += min; (*r).offset = offset; Files_Assert(offset <= 4096); @@ -843,7 +843,7 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, ADDRESS src__len, SYSTEM_BYTE *de j = 0; while (i > 0) { i -= 1; - dest[j] = src[i]; + dest[__X(j, dest__len)] = src[__X(i, src__len)]; j += 1; } } else { @@ -900,7 +900,7 @@ void Files_ReadString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, ADDRESS x__len) i = 0; do { Files_Read(&*R, R__typ, (void*)&ch); - x[i] = ch; + x[__X(i, x__len)] = ch; i += 1; } while (!(ch == 0x00)); } @@ -910,16 +910,16 @@ void Files_ReadLine (Files_Rider *R, ADDRESS *R__typ, CHAR *x, ADDRESS x__len) INT16 i; i = 0; do { - Files_Read(&*R, R__typ, (void*)&x[i]); + Files_Read(&*R, R__typ, (void*)&x[__X(i, x__len)]); i += 1; - } while (!(x[i - 1] == 0x00 || x[i - 1] == 0x0a)); - if (x[i - 1] == 0x0a) { + } while (!(x[__X(i - 1, x__len)] == 0x00 || x[__X(i - 1, x__len)] == 0x0a)); + if (x[__X(i - 1, x__len)] == 0x0a) { i -= 1; } - if ((i > 0 && x[i - 1] == 0x0d)) { + if ((i > 0 && x[__X(i - 1, x__len)] == 0x0d)) { i -= 1; } - x[i] = 0x00; + x[__X(i, x__len)] = 0x00; } void Files_ReadNum (Files_Rider *R, ADDRESS *R__typ, SYSTEM_BYTE *x, ADDRESS x__len) @@ -992,7 +992,7 @@ void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, ADDRESS x__len { INT16 i; i = 0; - while (x[i] != 0x00) { + while (x[__X(i, x__len)] != 0x00) { i += 1; } Files_WriteBytes(&*R, R__typ, (void*)x, x__len * 1, i + 1); diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index b0056ea8..9d81c004 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index 9e99e657..eb19a612 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index 2b6287cd..ab574eed 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 25d5f032..3c88874e 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index 5d832fa6..3f97dc19 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index 41e56e38..d7012f3e 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index 0eba52d2..b82bf9ba 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index 7fa9fa23..42cd3c56 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index 1e17f6c2..b79317f7 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index bcf72c6b..28e1ec4b 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index 9c84b7af..1c6ca2ac 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index 18305e4c..7508ac7a 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index 010479f8..52242f7c 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index 74719041..0e42294b 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -56,11 +56,11 @@ static void OPS_Str (INT8 *sym) OPS_err(241); break; } - OPS_str[i] = OPS_ch; + OPS_str[__X(i, 256)] = OPS_ch; i += 1; } OPM_Get(&OPS_ch); - OPS_str[i] = 0x00; + OPS_str[__X(i, 256)] = 0x00; OPS_intval = i + 1; if (OPS_intval == 2) { *sym = 35; @@ -76,7 +76,7 @@ static void OPS_Identifier (INT8 *sym) INT16 i; i = 0; do { - OPS_name[i] = OPS_ch; + OPS_name[__X(i, 256)] = OPS_ch; i += 1; OPM_Get(&OPS_ch); } while (!(((OPS_ch < '0' || ('9' < OPS_ch && __CAP(OPS_ch) < 'A')) || 'Z' < __CAP(OPS_ch)) || i == 256)); @@ -84,7 +84,7 @@ static void OPS_Identifier (INT8 *sym) OPS_err(240); i -= 1; } - OPS_name[i] = 0x00; + OPS_name[__X(i, 256)] = 0x00; *sym = 38; } @@ -143,7 +143,7 @@ static void OPS_Number (void) if (('0' <= OPS_ch && OPS_ch <= '9') || (((d == 0 && 'A' <= OPS_ch)) && OPS_ch <= 'F')) { if (m > 0 || OPS_ch != '0') { if (n < 24) { - dig[n] = OPS_ch; + dig[__X(n, 24)] = OPS_ch; n += 1; } m += 1; @@ -173,7 +173,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) + (INT64)Ord__7(dig[__X(i, 24)], 1); i += 1; } } else { @@ -187,7 +187,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) + (INT64)Ord__7(dig[__X(i, 24)], 1); i += 1; } } else { @@ -196,7 +196,7 @@ static void OPS_Number (void) } else { OPS_numtyp = 2; while (i < n) { - d = Ord__7(dig[i], 0); + d = Ord__7(dig[__X(i, 24)], 0); i += 1; if (OPS_intval <= __DIV(9223372036854775807LL - (INT64)d, 10)) { OPS_intval = OPS_intval * 10 + (INT64)d; @@ -214,7 +214,7 @@ static void OPS_Number (void) expCh = 'E'; while (n > 0) { n -= 1; - f = (Ord__7(dig[n], 0) + f) / (LONGREAL)(LONGREAL)10; + f = (Ord__7(dig[__X(n, 24)], 0) + f) / (LONGREAL)(LONGREAL)10; } if (OPS_ch == 'E' || OPS_ch == 'D') { expCh = OPS_ch; diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index dfe2b972..15cdcc6c 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index c6989580..57dfaa59 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index f457c51e..a4688654 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 617e9e58..bad459b6 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index bee5e44d..05e906a7 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Out.c b/bootstrap/unix-88/Out.c index 54d88edf..fc5b46c6 100644 --- a/bootstrap/unix-88/Out.c +++ b/bootstrap/unix-88/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Out.h b/bootstrap/unix-88/Out.h index fad5cd1a..0819285a 100644 --- a/bootstrap/unix-88/Out.h +++ b/bootstrap/unix-88/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index bb97464a..fa174db0 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index 51911cc6..085c2257 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 2af2574f..44be33b7 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index 07f4371d..7c2e0e35 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index 3d82b654..6158bc92 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index df6f5edc..42b68da8 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index 82588563..6a06c85c 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index b3dd50cb..e4aa3a7d 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/VT100.c b/bootstrap/unix-88/VT100.c index 5bfcea49..a3b0b0dd 100644 --- a/bootstrap/unix-88/VT100.c +++ b/bootstrap/unix-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/VT100.h b/bootstrap/unix-88/VT100.h index 51c85058..e7539d2f 100644 --- a/bootstrap/unix-88/VT100.h +++ b/bootstrap/unix-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index 2b6c962b..562921ce 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index 9b0b1ee9..e6dd4577 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/Compiler.c b/bootstrap/windows-48/Compiler.c index 10abd264..9cdbb76c 100644 --- a/bootstrap/windows-48/Compiler.c +++ b/bootstrap/windows-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index 8eac398d..3ab08d40 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index c817585e..7db28b57 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 15471c4f..e714f199 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -154,20 +154,20 @@ static void Files_MakeFileName (CHAR *dir, ADDRESS dir__len, CHAR *name, ADDRESS __DUP(name, name__len, CHAR); i = 0; j = 0; - while (dir[i] != 0x00) { - dest[i] = dir[i]; + while (dir[__X(i, dir__len)] != 0x00) { + dest[__X(i, dest__len)] = dir[__X(i, dir__len)]; i += 1; } - if (dest[i - 1] != '/') { - dest[i] = '/'; + if (dest[__X(i - 1, dest__len)] != '/') { + dest[__X(i, dest__len)] = '/'; i += 1; } - while (name[j] != 0x00) { - dest[i] = name[j]; + while (name[__X(j, name__len)] != 0x00) { + dest[__X(i, dest__len)] = name[__X(j, name__len)]; i += 1; j += 1; } - dest[i] = 0x00; + dest[__X(i, dest__len)] = 0x00; __DEL(dir); __DEL(name); } @@ -180,45 +180,45 @@ static void Files_GetTempName (CHAR *finalName, ADDRESS finalName__len, CHAR *na n = Files_tempno; i = 0; if (finalName[0] != '/') { - while (Platform_CWD[i] != 0x00) { - name[i] = Platform_CWD[i]; + while (Platform_CWD[__X(i, 4096)] != 0x00) { + name[__X(i, name__len)] = Platform_CWD[__X(i, 4096)]; i += 1; } - if (Platform_CWD[i - 1] != '/') { - name[i] = '/'; + if (Platform_CWD[__X(i - 1, 4096)] != '/') { + name[__X(i, name__len)] = '/'; i += 1; } } j = 0; - while (finalName[j] != 0x00) { - name[i] = finalName[j]; + while (finalName[__X(j, finalName__len)] != 0x00) { + name[__X(i, name__len)] = finalName[__X(j, finalName__len)]; i += 1; j += 1; } i -= 1; - while (name[i] != '/') { + while (name[__X(i, name__len)] != '/') { i -= 1; } - name[i + 1] = '.'; - name[i + 2] = 't'; - name[i + 3] = 'm'; - name[i + 4] = 'p'; - name[i + 5] = '.'; + name[__X(i + 1, name__len)] = '.'; + name[__X(i + 2, name__len)] = 't'; + name[__X(i + 3, name__len)] = 'm'; + name[__X(i + 4, name__len)] = 'p'; + name[__X(i + 5, name__len)] = '.'; i += 6; while (n > 0) { - name[i] = (CHAR)((int)__MOD(n, 10) + 48); + name[__X(i, name__len)] = (CHAR)((int)__MOD(n, 10) + 48); n = __DIV(n, 10); i += 1; } - name[i] = '.'; + name[__X(i, name__len)] = '.'; i += 1; n = Platform_PID; while (n > 0) { - name[i] = (CHAR)((int)__MOD(n, 10) + 48); + name[__X(i, name__len)] = (CHAR)((int)__MOD(n, 10) + 48); n = __DIV(n, 10); i += 1; } - name[i] = 0x00; + name[__X(i, name__len)] = 0x00; __DEL(finalName); } @@ -319,8 +319,8 @@ void Files_Close (Files_File f) if (f->state != 1 || f->registerName[0] != 0x00) { Files_Create(f); i = 0; - while ((i < 4 && f->bufs[i] != NIL)) { - Files_Flush(f->bufs[i]); + while ((i < 4 && f->bufs[__X(i, 4)] != NIL)) { + Files_Flush(f->bufs[__X(i, 4)]); i += 1; } } @@ -359,35 +359,35 @@ static void Files_ScanPath (INT16 *pos, CHAR *dir, ADDRESS dir__len) *pos += 1; } } else { - ch = (Files_SearchPath->data)[*pos]; + ch = (Files_SearchPath->data)[__X(*pos, Files_SearchPath->len[0])]; while (ch == ' ' || ch == ';') { *pos += 1; - ch = (Files_SearchPath->data)[*pos]; + ch = (Files_SearchPath->data)[__X(*pos, Files_SearchPath->len[0])]; } if (ch == '~') { *pos += 1; - ch = (Files_SearchPath->data)[*pos]; - while (Files_HOME[i] != 0x00) { - dir[i] = Files_HOME[i]; + ch = (Files_SearchPath->data)[__X(*pos, Files_SearchPath->len[0])]; + while (Files_HOME[__X(i, 1024)] != 0x00) { + dir[__X(i, dir__len)] = Files_HOME[__X(i, 1024)]; i += 1; } if ((((((ch != '/' && ch != 0x00)) && ch != ';')) && ch != ' ')) { - while ((i > 0 && dir[i - 1] != '/')) { + while ((i > 0 && dir[__X(i - 1, dir__len)] != '/')) { i -= 1; } } } while ((ch != 0x00 && ch != ';')) { - dir[i] = ch; + dir[__X(i, dir__len)] = ch; i += 1; *pos += 1; - ch = (Files_SearchPath->data)[*pos]; + ch = (Files_SearchPath->data)[__X(*pos, Files_SearchPath->len[0])]; } - while ((i > 0 && dir[i - 1] == ' ')) { + while ((i > 0 && dir[__X(i - 1, dir__len)] == ' ')) { i -= 1; } } - dir[i] = 0x00; + dir[__X(i, dir__len)] = 0x00; } static BOOLEAN Files_HasDir (CHAR *name, ADDRESS name__len) @@ -398,7 +398,7 @@ static BOOLEAN Files_HasDir (CHAR *name, ADDRESS name__len) ch = name[0]; while ((ch != 0x00 && ch != '/')) { i += 1; - ch = name[i]; + ch = name[__X(i, name__len)]; } return ch == '/'; } @@ -413,9 +413,9 @@ static Files_File Files_CacheEntry (Platform_FileIdentity identity) if (!Platform_SameFileTime(identity, f->identity)) { i = 0; while (i < 4) { - if (f->bufs[i] != NIL) { - f->bufs[i]->org = -1; - f->bufs[i] = NIL; + if (f->bufs[__X(i, 4)] != NIL) { + f->bufs[__X(i, 4)]->org = -1; + f->bufs[__X(i, 4)] = NIL; } i += 1; } @@ -514,9 +514,9 @@ void Files_Purge (Files_File f) INT16 error; i = 0; while (i < 4) { - if (f->bufs[i] != NIL) { - f->bufs[i]->org = -1; - f->bufs[i] = NIL; + if (f->bufs[__X(i, 4)] != NIL) { + f->bufs[__X(i, 4)]->org = -1; + f->bufs[__X(i, 4)] = NIL; } i += 1; } @@ -560,22 +560,22 @@ void Files_Set (Files_Rider *r, ADDRESS *r__typ, Files_File f, INT32 pos) offset = __MASK(pos, -4096); org = pos - offset; i = 0; - while ((((i < 4 && f->bufs[i] != NIL)) && org != f->bufs[i]->org)) { + while ((((i < 4 && f->bufs[__X(i, 4)] != NIL)) && org != f->bufs[__X(i, 4)]->org)) { i += 1; } if (i < 4) { - if (f->bufs[i] == NIL) { + if (f->bufs[__X(i, 4)] == NIL) { __NEW(buf, Files_BufDesc); buf->chg = 0; buf->org = -1; buf->f = f; - f->bufs[i] = buf; + f->bufs[__X(i, 4)] = buf; } else { - buf = f->bufs[i]; + buf = f->bufs[__X(i, 4)]; } } else { f->swapper = __MASK(f->swapper + 1, -4); - buf = f->bufs[f->swapper]; + buf = f->bufs[__X(f->swapper, 4)]; Files_Flush(buf); } if (buf->org != org) { @@ -622,7 +622,7 @@ void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x) } Files_Assert(offset <= buf->size); if (offset < buf->size) { - *x = buf->data[offset]; + *x = buf->data[__X(offset, 4096)]; (*r).offset = offset + 1; } else if ((*r).org + offset < buf->f->len) { Files_Set(&*r, r__typ, (*r).buf->f, (*r).org + offset); @@ -660,7 +660,7 @@ void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS x } else { min = n; } - __MOVE((ADDRESS)&buf->data[offset], (ADDRESS)&x[xpos], min); + __MOVE((ADDRESS)&buf->data[__X(offset, 4096)], (ADDRESS)&x[__X(xpos, x__len)], min); offset += min; (*r).offset = offset; xpos += min; @@ -689,7 +689,7 @@ void Files_Write (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE x) offset = (*r).offset; } Files_Assert(offset < 4096); - buf->data[offset] = x; + buf->data[__X(offset, 4096)] = x; buf->chg = 1; if (offset == buf->size) { buf->size += 1; @@ -723,7 +723,7 @@ void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS } else { min = n; } - __MOVE((ADDRESS)&x[xpos], (ADDRESS)&buf->data[offset], min); + __MOVE((ADDRESS)&x[__X(xpos, x__len)], (ADDRESS)&buf->data[__X(offset, 4096)], min); offset += min; (*r).offset = offset; Files_Assert(offset <= 4096); @@ -843,7 +843,7 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, ADDRESS src__len, SYSTEM_BYTE *de j = 0; while (i > 0) { i -= 1; - dest[j] = src[i]; + dest[__X(j, dest__len)] = src[__X(i, src__len)]; j += 1; } } else { @@ -900,7 +900,7 @@ void Files_ReadString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, ADDRESS x__len) i = 0; do { Files_Read(&*R, R__typ, (void*)&ch); - x[i] = ch; + x[__X(i, x__len)] = ch; i += 1; } while (!(ch == 0x00)); } @@ -910,16 +910,16 @@ void Files_ReadLine (Files_Rider *R, ADDRESS *R__typ, CHAR *x, ADDRESS x__len) INT16 i; i = 0; do { - Files_Read(&*R, R__typ, (void*)&x[i]); + Files_Read(&*R, R__typ, (void*)&x[__X(i, x__len)]); i += 1; - } while (!(x[i - 1] == 0x00 || x[i - 1] == 0x0a)); - if (x[i - 1] == 0x0a) { + } while (!(x[__X(i - 1, x__len)] == 0x00 || x[__X(i - 1, x__len)] == 0x0a)); + if (x[__X(i - 1, x__len)] == 0x0a) { i -= 1; } - if ((i > 0 && x[i - 1] == 0x0d)) { + if ((i > 0 && x[__X(i - 1, x__len)] == 0x0d)) { i -= 1; } - x[i] = 0x00; + x[__X(i, x__len)] = 0x00; } void Files_ReadNum (Files_Rider *R, ADDRESS *R__typ, SYSTEM_BYTE *x, ADDRESS x__len) @@ -992,7 +992,7 @@ void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, ADDRESS x__len { INT16 i; i = 0; - while (x[i] != 0x00) { + while (x[__X(i, x__len)] != 0x00) { i += 1; } Files_WriteBytes(&*R, R__typ, (void*)x, x__len * 1, i + 1); diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index 25b5a32d..61cad689 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index 348b336b..bd4ed5a8 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index b73de4fe..8d7eb8e5 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index e2075ab0..276b9857 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index 2d074a62..9d10f4ac 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index 41e56e38..d7012f3e 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index 0eba52d2..b82bf9ba 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 7fa9fa23..42cd3c56 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index 1e17f6c2..b79317f7 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 3dbed3bf..e6b33367 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index 9c84b7af..1c6ca2ac 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index 00e4fa0e..54a9f7c8 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index 010479f8..52242f7c 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index 74719041..0e42294b 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -56,11 +56,11 @@ static void OPS_Str (INT8 *sym) OPS_err(241); break; } - OPS_str[i] = OPS_ch; + OPS_str[__X(i, 256)] = OPS_ch; i += 1; } OPM_Get(&OPS_ch); - OPS_str[i] = 0x00; + OPS_str[__X(i, 256)] = 0x00; OPS_intval = i + 1; if (OPS_intval == 2) { *sym = 35; @@ -76,7 +76,7 @@ static void OPS_Identifier (INT8 *sym) INT16 i; i = 0; do { - OPS_name[i] = OPS_ch; + OPS_name[__X(i, 256)] = OPS_ch; i += 1; OPM_Get(&OPS_ch); } while (!(((OPS_ch < '0' || ('9' < OPS_ch && __CAP(OPS_ch) < 'A')) || 'Z' < __CAP(OPS_ch)) || i == 256)); @@ -84,7 +84,7 @@ static void OPS_Identifier (INT8 *sym) OPS_err(240); i -= 1; } - OPS_name[i] = 0x00; + OPS_name[__X(i, 256)] = 0x00; *sym = 38; } @@ -143,7 +143,7 @@ static void OPS_Number (void) if (('0' <= OPS_ch && OPS_ch <= '9') || (((d == 0 && 'A' <= OPS_ch)) && OPS_ch <= 'F')) { if (m > 0 || OPS_ch != '0') { if (n < 24) { - dig[n] = OPS_ch; + dig[__X(n, 24)] = OPS_ch; n += 1; } m += 1; @@ -173,7 +173,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) + (INT64)Ord__7(dig[__X(i, 24)], 1); i += 1; } } else { @@ -187,7 +187,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) + (INT64)Ord__7(dig[__X(i, 24)], 1); i += 1; } } else { @@ -196,7 +196,7 @@ static void OPS_Number (void) } else { OPS_numtyp = 2; while (i < n) { - d = Ord__7(dig[i], 0); + d = Ord__7(dig[__X(i, 24)], 0); i += 1; if (OPS_intval <= __DIV(9223372036854775807LL - (INT64)d, 10)) { OPS_intval = OPS_intval * 10 + (INT64)d; @@ -214,7 +214,7 @@ static void OPS_Number (void) expCh = 'E'; while (n > 0) { n -= 1; - f = (Ord__7(dig[n], 0) + f) / (LONGREAL)(LONGREAL)10; + f = (Ord__7(dig[__X(n, 24)], 0) + f) / (LONGREAL)(LONGREAL)10; } if (OPS_ch == 'E' || OPS_ch == 'D') { expCh = OPS_ch; diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index dfe2b972..15cdcc6c 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 962b0f86..1897f024 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index f457c51e..a4688654 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index 5193f272..ebe18cc4 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index bee5e44d..05e906a7 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Out.c b/bootstrap/windows-48/Out.c index 3bfb1ec7..2407ec4e 100644 --- a/bootstrap/windows-48/Out.c +++ b/bootstrap/windows-48/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Out.h b/bootstrap/windows-48/Out.h index fad5cd1a..0819285a 100644 --- a/bootstrap/windows-48/Out.h +++ b/bootstrap/windows-48/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 65fd2654..62920520 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index 47755d00..c447f2ba 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 2af2574f..44be33b7 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index 07f4371d..7c2e0e35 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index 3d82b654..6158bc92 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index df6f5edc..42b68da8 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index 8e4938b8..2726593a 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index 0c55850a..714d9ac5 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/VT100.c b/bootstrap/windows-48/VT100.c index 5bfcea49..a3b0b0dd 100644 --- a/bootstrap/windows-48/VT100.c +++ b/bootstrap/windows-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/VT100.h b/bootstrap/windows-48/VT100.h index 51c85058..e7539d2f 100644 --- a/bootstrap/windows-48/VT100.h +++ b/bootstrap/windows-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index 2b6c962b..562921ce 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index 9b0b1ee9..e6dd4577 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/Compiler.c b/bootstrap/windows-88/Compiler.c index 10abd264..9cdbb76c 100644 --- a/bootstrap/windows-88/Compiler.c +++ b/bootstrap/windows-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index 8eac398d..3ab08d40 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index c817585e..7db28b57 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 7a28d41d..178e5cca 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -155,20 +155,20 @@ static void Files_MakeFileName (CHAR *dir, ADDRESS dir__len, CHAR *name, ADDRESS __DUP(name, name__len, CHAR); i = 0; j = 0; - while (dir[i] != 0x00) { - dest[i] = dir[i]; + while (dir[__X(i, dir__len)] != 0x00) { + dest[__X(i, dest__len)] = dir[__X(i, dir__len)]; i += 1; } - if (dest[i - 1] != '/') { - dest[i] = '/'; + if (dest[__X(i - 1, dest__len)] != '/') { + dest[__X(i, dest__len)] = '/'; i += 1; } - while (name[j] != 0x00) { - dest[i] = name[j]; + while (name[__X(j, name__len)] != 0x00) { + dest[__X(i, dest__len)] = name[__X(j, name__len)]; i += 1; j += 1; } - dest[i] = 0x00; + dest[__X(i, dest__len)] = 0x00; __DEL(dir); __DEL(name); } @@ -181,45 +181,45 @@ static void Files_GetTempName (CHAR *finalName, ADDRESS finalName__len, CHAR *na n = Files_tempno; i = 0; if (finalName[0] != '/') { - while (Platform_CWD[i] != 0x00) { - name[i] = Platform_CWD[i]; + while (Platform_CWD[__X(i, 4096)] != 0x00) { + name[__X(i, name__len)] = Platform_CWD[__X(i, 4096)]; i += 1; } - if (Platform_CWD[i - 1] != '/') { - name[i] = '/'; + if (Platform_CWD[__X(i - 1, 4096)] != '/') { + name[__X(i, name__len)] = '/'; i += 1; } } j = 0; - while (finalName[j] != 0x00) { - name[i] = finalName[j]; + while (finalName[__X(j, finalName__len)] != 0x00) { + name[__X(i, name__len)] = finalName[__X(j, finalName__len)]; i += 1; j += 1; } i -= 1; - while (name[i] != '/') { + while (name[__X(i, name__len)] != '/') { i -= 1; } - name[i + 1] = '.'; - name[i + 2] = 't'; - name[i + 3] = 'm'; - name[i + 4] = 'p'; - name[i + 5] = '.'; + name[__X(i + 1, name__len)] = '.'; + name[__X(i + 2, name__len)] = 't'; + name[__X(i + 3, name__len)] = 'm'; + name[__X(i + 4, name__len)] = 'p'; + name[__X(i + 5, name__len)] = '.'; i += 6; while (n > 0) { - name[i] = (CHAR)((int)__MOD(n, 10) + 48); + name[__X(i, name__len)] = (CHAR)((int)__MOD(n, 10) + 48); n = __DIV(n, 10); i += 1; } - name[i] = '.'; + name[__X(i, name__len)] = '.'; i += 1; n = Platform_PID; while (n > 0) { - name[i] = (CHAR)((int)__MOD(n, 10) + 48); + name[__X(i, name__len)] = (CHAR)((int)__MOD(n, 10) + 48); n = __DIV(n, 10); i += 1; } - name[i] = 0x00; + name[__X(i, name__len)] = 0x00; __DEL(finalName); } @@ -320,8 +320,8 @@ void Files_Close (Files_File f) if (f->state != 1 || f->registerName[0] != 0x00) { Files_Create(f); i = 0; - while ((i < 4 && f->bufs[i] != NIL)) { - Files_Flush(f->bufs[i]); + while ((i < 4 && f->bufs[__X(i, 4)] != NIL)) { + Files_Flush(f->bufs[__X(i, 4)]); i += 1; } } @@ -360,35 +360,35 @@ static void Files_ScanPath (INT16 *pos, CHAR *dir, ADDRESS dir__len) *pos += 1; } } else { - ch = (Files_SearchPath->data)[*pos]; + ch = (Files_SearchPath->data)[__X(*pos, Files_SearchPath->len[0])]; while (ch == ' ' || ch == ';') { *pos += 1; - ch = (Files_SearchPath->data)[*pos]; + ch = (Files_SearchPath->data)[__X(*pos, Files_SearchPath->len[0])]; } if (ch == '~') { *pos += 1; - ch = (Files_SearchPath->data)[*pos]; - while (Files_HOME[i] != 0x00) { - dir[i] = Files_HOME[i]; + ch = (Files_SearchPath->data)[__X(*pos, Files_SearchPath->len[0])]; + while (Files_HOME[__X(i, 1024)] != 0x00) { + dir[__X(i, dir__len)] = Files_HOME[__X(i, 1024)]; i += 1; } if ((((((ch != '/' && ch != 0x00)) && ch != ';')) && ch != ' ')) { - while ((i > 0 && dir[i - 1] != '/')) { + while ((i > 0 && dir[__X(i - 1, dir__len)] != '/')) { i -= 1; } } } while ((ch != 0x00 && ch != ';')) { - dir[i] = ch; + dir[__X(i, dir__len)] = ch; i += 1; *pos += 1; - ch = (Files_SearchPath->data)[*pos]; + ch = (Files_SearchPath->data)[__X(*pos, Files_SearchPath->len[0])]; } - while ((i > 0 && dir[i - 1] == ' ')) { + while ((i > 0 && dir[__X(i - 1, dir__len)] == ' ')) { i -= 1; } } - dir[i] = 0x00; + dir[__X(i, dir__len)] = 0x00; } static BOOLEAN Files_HasDir (CHAR *name, ADDRESS name__len) @@ -399,7 +399,7 @@ static BOOLEAN Files_HasDir (CHAR *name, ADDRESS name__len) ch = name[0]; while ((ch != 0x00 && ch != '/')) { i += 1; - ch = name[i]; + ch = name[__X(i, name__len)]; } return ch == '/'; } @@ -414,9 +414,9 @@ static Files_File Files_CacheEntry (Platform_FileIdentity identity) if (!Platform_SameFileTime(identity, f->identity)) { i = 0; while (i < 4) { - if (f->bufs[i] != NIL) { - f->bufs[i]->org = -1; - f->bufs[i] = NIL; + if (f->bufs[__X(i, 4)] != NIL) { + f->bufs[__X(i, 4)]->org = -1; + f->bufs[__X(i, 4)] = NIL; } i += 1; } @@ -515,9 +515,9 @@ void Files_Purge (Files_File f) INT16 error; i = 0; while (i < 4) { - if (f->bufs[i] != NIL) { - f->bufs[i]->org = -1; - f->bufs[i] = NIL; + if (f->bufs[__X(i, 4)] != NIL) { + f->bufs[__X(i, 4)]->org = -1; + f->bufs[__X(i, 4)] = NIL; } i += 1; } @@ -561,22 +561,22 @@ void Files_Set (Files_Rider *r, ADDRESS *r__typ, Files_File f, INT32 pos) offset = __MASK(pos, -4096); org = pos - offset; i = 0; - while ((((i < 4 && f->bufs[i] != NIL)) && org != f->bufs[i]->org)) { + while ((((i < 4 && f->bufs[__X(i, 4)] != NIL)) && org != f->bufs[__X(i, 4)]->org)) { i += 1; } if (i < 4) { - if (f->bufs[i] == NIL) { + if (f->bufs[__X(i, 4)] == NIL) { __NEW(buf, Files_BufDesc); buf->chg = 0; buf->org = -1; buf->f = f; - f->bufs[i] = buf; + f->bufs[__X(i, 4)] = buf; } else { - buf = f->bufs[i]; + buf = f->bufs[__X(i, 4)]; } } else { f->swapper = __MASK(f->swapper + 1, -4); - buf = f->bufs[f->swapper]; + buf = f->bufs[__X(f->swapper, 4)]; Files_Flush(buf); } if (buf->org != org) { @@ -623,7 +623,7 @@ void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x) } Files_Assert(offset <= buf->size); if (offset < buf->size) { - *x = buf->data[offset]; + *x = buf->data[__X(offset, 4096)]; (*r).offset = offset + 1; } else if ((*r).org + offset < buf->f->len) { Files_Set(&*r, r__typ, (*r).buf->f, (*r).org + offset); @@ -661,7 +661,7 @@ void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS x } else { min = n; } - __MOVE((ADDRESS)&buf->data[offset], (ADDRESS)&x[xpos], min); + __MOVE((ADDRESS)&buf->data[__X(offset, 4096)], (ADDRESS)&x[__X(xpos, x__len)], min); offset += min; (*r).offset = offset; xpos += min; @@ -690,7 +690,7 @@ void Files_Write (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE x) offset = (*r).offset; } Files_Assert(offset < 4096); - buf->data[offset] = x; + buf->data[__X(offset, 4096)] = x; buf->chg = 1; if (offset == buf->size) { buf->size += 1; @@ -724,7 +724,7 @@ void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS } else { min = n; } - __MOVE((ADDRESS)&x[xpos], (ADDRESS)&buf->data[offset], min); + __MOVE((ADDRESS)&x[__X(xpos, x__len)], (ADDRESS)&buf->data[__X(offset, 4096)], min); offset += min; (*r).offset = offset; Files_Assert(offset <= 4096); @@ -845,7 +845,7 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, ADDRESS src__len, SYSTEM_BYTE *de j = 0; while (i > 0) { i -= 1; - dest[j] = src[i]; + dest[__X(j, dest__len)] = src[__X(i, src__len)]; j += 1; } } else { @@ -902,7 +902,7 @@ void Files_ReadString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, ADDRESS x__len) i = 0; do { Files_Read(&*R, R__typ, (void*)&ch); - x[i] = ch; + x[__X(i, x__len)] = ch; i += 1; } while (!(ch == 0x00)); } @@ -912,16 +912,16 @@ void Files_ReadLine (Files_Rider *R, ADDRESS *R__typ, CHAR *x, ADDRESS x__len) INT16 i; i = 0; do { - Files_Read(&*R, R__typ, (void*)&x[i]); + Files_Read(&*R, R__typ, (void*)&x[__X(i, x__len)]); i += 1; - } while (!(x[i - 1] == 0x00 || x[i - 1] == 0x0a)); - if (x[i - 1] == 0x0a) { + } while (!(x[__X(i - 1, x__len)] == 0x00 || x[__X(i - 1, x__len)] == 0x0a)); + if (x[__X(i - 1, x__len)] == 0x0a) { i -= 1; } - if ((i > 0 && x[i - 1] == 0x0d)) { + if ((i > 0 && x[__X(i - 1, x__len)] == 0x0d)) { i -= 1; } - x[i] = 0x00; + x[__X(i, x__len)] = 0x00; } void Files_ReadNum (Files_Rider *R, ADDRESS *R__typ, SYSTEM_BYTE *x, ADDRESS x__len) @@ -994,7 +994,7 @@ void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, ADDRESS x__len { INT16 i; i = 0; - while (x[i] != 0x00) { + while (x[__X(i, x__len)] != 0x00) { i += 1; } Files_WriteBytes(&*R, R__typ, (void*)x, x__len * 1, i + 1); diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 16fd4396..658429ef 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index 9e99e657..eb19a612 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index 2b6287cd..ab574eed 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 94227779..b3c05745 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index 5d832fa6..3f97dc19 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index 41e56e38..d7012f3e 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index 0eba52d2..b82bf9ba 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index 7fa9fa23..42cd3c56 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index 1e17f6c2..b79317f7 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index bcf72c6b..28e1ec4b 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index 9c84b7af..1c6ca2ac 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index 18305e4c..7508ac7a 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index 010479f8..52242f7c 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index 74719041..0e42294b 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -56,11 +56,11 @@ static void OPS_Str (INT8 *sym) OPS_err(241); break; } - OPS_str[i] = OPS_ch; + OPS_str[__X(i, 256)] = OPS_ch; i += 1; } OPM_Get(&OPS_ch); - OPS_str[i] = 0x00; + OPS_str[__X(i, 256)] = 0x00; OPS_intval = i + 1; if (OPS_intval == 2) { *sym = 35; @@ -76,7 +76,7 @@ static void OPS_Identifier (INT8 *sym) INT16 i; i = 0; do { - OPS_name[i] = OPS_ch; + OPS_name[__X(i, 256)] = OPS_ch; i += 1; OPM_Get(&OPS_ch); } while (!(((OPS_ch < '0' || ('9' < OPS_ch && __CAP(OPS_ch) < 'A')) || 'Z' < __CAP(OPS_ch)) || i == 256)); @@ -84,7 +84,7 @@ static void OPS_Identifier (INT8 *sym) OPS_err(240); i -= 1; } - OPS_name[i] = 0x00; + OPS_name[__X(i, 256)] = 0x00; *sym = 38; } @@ -143,7 +143,7 @@ static void OPS_Number (void) if (('0' <= OPS_ch && OPS_ch <= '9') || (((d == 0 && 'A' <= OPS_ch)) && OPS_ch <= 'F')) { if (m > 0 || OPS_ch != '0') { if (n < 24) { - dig[n] = OPS_ch; + dig[__X(n, 24)] = OPS_ch; n += 1; } m += 1; @@ -173,7 +173,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) + (INT64)Ord__7(dig[__X(i, 24)], 1); i += 1; } } else { @@ -187,7 +187,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) + (INT64)Ord__7(dig[__X(i, 24)], 1); i += 1; } } else { @@ -196,7 +196,7 @@ static void OPS_Number (void) } else { OPS_numtyp = 2; while (i < n) { - d = Ord__7(dig[i], 0); + d = Ord__7(dig[__X(i, 24)], 0); i += 1; if (OPS_intval <= __DIV(9223372036854775807LL - (INT64)d, 10)) { OPS_intval = OPS_intval * 10 + (INT64)d; @@ -214,7 +214,7 @@ static void OPS_Number (void) expCh = 'E'; while (n > 0) { n -= 1; - f = (Ord__7(dig[n], 0) + f) / (LONGREAL)(LONGREAL)10; + f = (Ord__7(dig[__X(n, 24)], 0) + f) / (LONGREAL)(LONGREAL)10; } if (OPS_ch == 'E' || OPS_ch == 'D') { expCh = OPS_ch; diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index dfe2b972..15cdcc6c 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index c6989580..57dfaa59 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index f457c51e..a4688654 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 617e9e58..bad459b6 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index bee5e44d..05e906a7 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Out.c b/bootstrap/windows-88/Out.c index 3bfb1ec7..2407ec4e 100644 --- a/bootstrap/windows-88/Out.c +++ b/bootstrap/windows-88/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Out.h b/bootstrap/windows-88/Out.h index fad5cd1a..0819285a 100644 --- a/bootstrap/windows-88/Out.h +++ b/bootstrap/windows-88/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 361a39fc..9f789ece 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index 9ca6f851..ee812dcd 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 2af2574f..44be33b7 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index 07f4371d..7c2e0e35 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index 3d82b654..6158bc92 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index df6f5edc..42b68da8 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index 82588563..6a06c85c 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index b3dd50cb..e4aa3a7d 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/VT100.c b/bootstrap/windows-88/VT100.c index 5bfcea49..a3b0b0dd 100644 --- a/bootstrap/windows-88/VT100.c +++ b/bootstrap/windows-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/VT100.h b/bootstrap/windows-88/VT100.h index 51c85058..e7539d2f 100644 --- a/bootstrap/windows-88/VT100.h +++ b/bootstrap/windows-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index 2b6c962b..562921ce 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index 9b0b1ee9..e6dd4577 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h From 70f2839c76a5a6e8a133807a7d688180314a46d9 Mon Sep 17 00:00:00 2001 From: David Brown Date: Tue, 24 Apr 2018 17:32:38 +0100 Subject: [PATCH 495/580] Add 'Filename too long' error in Files.Mod. --- src/runtime/Files.Mod | 48 +++++++++++++++++-------------------------- 1 file changed, 19 insertions(+), 29 deletions(-) diff --git a/src/runtime/Files.Mod b/src/runtime/Files.Mod index c06d2f2b..b63553d7 100644 --- a/src/runtime/Files.Mod +++ b/src/runtime/Files.Mod @@ -2,16 +2,6 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files IMPORT SYSTEM, Platform, Heap, Strings, Out; - (* standard data type I/O - - little endian, - Sint:1, Int:2, Lint:4 - ORD({0}) = 1, - false = 0, true =1 - IEEE real format, - null terminated strings, - compact numbers according to M.Odersky *) - CONST NumBufs = 4; @@ -84,34 +74,34 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files Out.Ln; Out.String("-- "); Out.String(s); Out.String(": "); IF f # NIL THEN IF f.registerName # "" THEN Out.String(f.registerName) ELSE Out.String(f.workName) END; - IF f.fd # 0 THEN Out.String("f.fd = "); Out.Int(f.fd,1) END + IF f.fd # 0 THEN Out.String(", f.fd = "); Out.Int(f.fd,1) END END; - IF errcode # 0 THEN Out.String(" errcode = "); Out.Int(errcode, 1) END; + IF errcode # 0 THEN Out.String(", errcode = "); Out.Int(errcode, 1) END; Out.Ln; HALT(99) END Err; PROCEDURE MakeFileName(dir, name: ARRAY OF CHAR; VAR dest: ARRAY OF CHAR); - VAR i, j: INTEGER; - BEGIN i := 0; j := 0; - WHILE dir[i] # 0X DO dest[i] := dir[i]; INC(i) END; - IF dest[i-1] # "/" THEN dest[i] := "/"; INC(i) END; - WHILE name[j] # 0X DO dest[i] := name[j]; INC(i); INC(j) END; - dest[i] := 0X + VAR i, j, ld, ln: INTEGER; + BEGIN ld := Strings.Length(dir); ln := Strings.Length(name); + WHILE (ld > 0) & (dir[ld-1] = '/') DO DEC(ld) END; + IF ld + ln + 2 > LEN(dest) THEN Err("File name too long", NIL, 0) END; + i := 0; + WHILE i < ld DO dest[i] := dir[i]; INC(i) END; + IF i > 0 THEN dest[i] := '/'; INC(i) END; + j := 0; + WHILE j < ln DO dest[i] := name[j]; INC(i); INC(j) END; + dest[i] := 0X; END MakeFileName; PROCEDURE GetTempName(finalName: ARRAY OF CHAR; VAR name: ARRAY OF CHAR); - VAR n, i, j: LONGINT; + VAR i, n: INTEGER; BEGIN - INC(tempno); n := tempno; i := 0; - IF finalName[0] # "/" THEN (* relative pathname *) - WHILE Platform.CWD[i] # 0X DO name[i] := Platform.CWD[i]; INC(i) END; - IF Platform.CWD[i-1] # "/" THEN name[i] := "/"; INC(i) END - END; - j := 0; - WHILE finalName[j] # 0X DO name[i] := finalName[j]; INC(i); INC(j) END; - DEC(i); - WHILE name[i] # "/" DO DEC(i) END; + IF finalName[0]='/' THEN COPY(finalName, name) ELSE MakeFileName(Platform.CWD, finalName, name) END; + i := Strings.Length(name)-1; + WHILE (i > 0) & (name[i] # '/') DO DEC(i) END; + IF i+16 >= LEN(name) THEN Err("File name too long", NIL, 0) END; + INC(tempno); n := tempno; name[i+1] := "."; name[i+2] := "t"; name[i+3] := "m"; name[i+4] := "p"; name[i+5] := "."; INC(i, 6); WHILE n > 0 DO name[i] := CHR(n MOD 10 + ORD("0")); n := n DIV 10; INC(i) END; name[i] := "."; INC(i); n := Platform.PID; @@ -181,7 +171,7 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files error := Platform.New(f.workName, f.fd); done := error = 0; IF done THEN - f.next := files; files := f; (* Link this file into the list of OS bakced files. *) + f.next := files; files := f; (* Link this file into the list of OS backed files. *) INC(Heap.FileCount); Heap.RegisterFinalizer(f, Finalize); f.state := open; From f7904230c9c89a5337d63a3ec8fa241e099191c4 Mon Sep 17 00:00:00 2001 From: David Brown Date: Tue, 24 Apr 2018 17:46:55 +0100 Subject: [PATCH 496/580] Update bootstrap C source files. --- bootstrap/unix-44/Files.c | 55 ++++++++++++++++++------------------ bootstrap/unix-48/Files.c | 55 ++++++++++++++++++------------------ bootstrap/unix-88/Files.c | 55 ++++++++++++++++++------------------ bootstrap/windows-48/Files.c | 55 ++++++++++++++++++------------------ bootstrap/windows-88/Files.c | 55 ++++++++++++++++++------------------ 5 files changed, 135 insertions(+), 140 deletions(-) diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 78f0f4e9..8efb373c 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -134,12 +134,12 @@ static void Files_Err (CHAR *s, ADDRESS s__len, Files_File f, INT16 errcode) Out_String(f->workName, 256); } if (f->fd != 0) { - Out_String((CHAR*)"f.fd = ", 8); + Out_String((CHAR*)", f.fd = ", 10); Out_Int(f->fd, 1); } } if (errcode != 0) { - Out_String((CHAR*)" errcode = ", 12); + Out_String((CHAR*)", errcode = ", 13); Out_Int(errcode, 1); } Out_Ln(); @@ -149,20 +149,28 @@ static void Files_Err (CHAR *s, ADDRESS s__len, Files_File f, INT16 errcode) static void Files_MakeFileName (CHAR *dir, ADDRESS dir__len, CHAR *name, ADDRESS name__len, CHAR *dest, ADDRESS dest__len) { - INT16 i, j; + INT16 i, j, ld, ln; __DUP(dir, dir__len, CHAR); __DUP(name, name__len, CHAR); + ld = Strings_Length(dir, dir__len); + ln = Strings_Length(name, name__len); + while ((ld > 0 && dir[__X(ld - 1, dir__len)] == '/')) { + ld -= 1; + } + if (((ld + ln) + 2) > dest__len) { + Files_Err((CHAR*)"File name too long", 19, NIL, 0); + } i = 0; - j = 0; - while (dir[__X(i, dir__len)] != 0x00) { + while (i < ld) { dest[__X(i, dest__len)] = dir[__X(i, dir__len)]; i += 1; } - if (dest[__X(i - 1, dest__len)] != '/') { + if (i > 0) { dest[__X(i, dest__len)] = '/'; i += 1; } - while (name[__X(j, name__len)] != 0x00) { + j = 0; + while (j < ln) { dest[__X(i, dest__len)] = name[__X(j, name__len)]; i += 1; j += 1; @@ -174,31 +182,22 @@ static void Files_MakeFileName (CHAR *dir, ADDRESS dir__len, CHAR *name, ADDRESS static void Files_GetTempName (CHAR *finalName, ADDRESS finalName__len, CHAR *name, ADDRESS name__len) { - INT32 n, i, j; + INT16 i, n; __DUP(finalName, finalName__len, CHAR); - Files_tempno += 1; - n = Files_tempno; - i = 0; - if (finalName[0] != '/') { - while (Platform_CWD[__X(i, 256)] != 0x00) { - name[__X(i, name__len)] = Platform_CWD[__X(i, 256)]; - i += 1; - } - if (Platform_CWD[__X(i - 1, 256)] != '/') { - name[__X(i, name__len)] = '/'; - i += 1; - } + if (finalName[0] == '/') { + __COPY(finalName, name, name__len); + } else { + Files_MakeFileName(Platform_CWD, 256, finalName, finalName__len, (void*)name, name__len); } - j = 0; - while (finalName[__X(j, finalName__len)] != 0x00) { - name[__X(i, name__len)] = finalName[__X(j, finalName__len)]; - i += 1; - j += 1; - } - i -= 1; - while (name[__X(i, name__len)] != '/') { + i = Strings_Length(name, name__len) - 1; + while ((i > 0 && name[__X(i, name__len)] != '/')) { i -= 1; } + if ((i + 16) >= name__len) { + Files_Err((CHAR*)"File name too long", 19, NIL, 0); + } + Files_tempno += 1; + n = Files_tempno; name[__X(i + 1, name__len)] = '.'; name[__X(i + 2, name__len)] = 't'; name[__X(i + 3, name__len)] = 'm'; diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 78f0f4e9..8efb373c 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -134,12 +134,12 @@ static void Files_Err (CHAR *s, ADDRESS s__len, Files_File f, INT16 errcode) Out_String(f->workName, 256); } if (f->fd != 0) { - Out_String((CHAR*)"f.fd = ", 8); + Out_String((CHAR*)", f.fd = ", 10); Out_Int(f->fd, 1); } } if (errcode != 0) { - Out_String((CHAR*)" errcode = ", 12); + Out_String((CHAR*)", errcode = ", 13); Out_Int(errcode, 1); } Out_Ln(); @@ -149,20 +149,28 @@ static void Files_Err (CHAR *s, ADDRESS s__len, Files_File f, INT16 errcode) static void Files_MakeFileName (CHAR *dir, ADDRESS dir__len, CHAR *name, ADDRESS name__len, CHAR *dest, ADDRESS dest__len) { - INT16 i, j; + INT16 i, j, ld, ln; __DUP(dir, dir__len, CHAR); __DUP(name, name__len, CHAR); + ld = Strings_Length(dir, dir__len); + ln = Strings_Length(name, name__len); + while ((ld > 0 && dir[__X(ld - 1, dir__len)] == '/')) { + ld -= 1; + } + if (((ld + ln) + 2) > dest__len) { + Files_Err((CHAR*)"File name too long", 19, NIL, 0); + } i = 0; - j = 0; - while (dir[__X(i, dir__len)] != 0x00) { + while (i < ld) { dest[__X(i, dest__len)] = dir[__X(i, dir__len)]; i += 1; } - if (dest[__X(i - 1, dest__len)] != '/') { + if (i > 0) { dest[__X(i, dest__len)] = '/'; i += 1; } - while (name[__X(j, name__len)] != 0x00) { + j = 0; + while (j < ln) { dest[__X(i, dest__len)] = name[__X(j, name__len)]; i += 1; j += 1; @@ -174,31 +182,22 @@ static void Files_MakeFileName (CHAR *dir, ADDRESS dir__len, CHAR *name, ADDRESS static void Files_GetTempName (CHAR *finalName, ADDRESS finalName__len, CHAR *name, ADDRESS name__len) { - INT32 n, i, j; + INT16 i, n; __DUP(finalName, finalName__len, CHAR); - Files_tempno += 1; - n = Files_tempno; - i = 0; - if (finalName[0] != '/') { - while (Platform_CWD[__X(i, 256)] != 0x00) { - name[__X(i, name__len)] = Platform_CWD[__X(i, 256)]; - i += 1; - } - if (Platform_CWD[__X(i - 1, 256)] != '/') { - name[__X(i, name__len)] = '/'; - i += 1; - } + if (finalName[0] == '/') { + __COPY(finalName, name, name__len); + } else { + Files_MakeFileName(Platform_CWD, 256, finalName, finalName__len, (void*)name, name__len); } - j = 0; - while (finalName[__X(j, finalName__len)] != 0x00) { - name[__X(i, name__len)] = finalName[__X(j, finalName__len)]; - i += 1; - j += 1; - } - i -= 1; - while (name[__X(i, name__len)] != '/') { + i = Strings_Length(name, name__len) - 1; + while ((i > 0 && name[__X(i, name__len)] != '/')) { i -= 1; } + if ((i + 16) >= name__len) { + Files_Err((CHAR*)"File name too long", 19, NIL, 0); + } + Files_tempno += 1; + n = Files_tempno; name[__X(i + 1, name__len)] = '.'; name[__X(i + 2, name__len)] = 't'; name[__X(i + 3, name__len)] = 'm'; diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 0738e4f7..e30bbdb0 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -134,12 +134,12 @@ static void Files_Err (CHAR *s, ADDRESS s__len, Files_File f, INT16 errcode) Out_String(f->workName, 256); } if (f->fd != 0) { - Out_String((CHAR*)"f.fd = ", 8); + Out_String((CHAR*)", f.fd = ", 10); Out_Int(f->fd, 1); } } if (errcode != 0) { - Out_String((CHAR*)" errcode = ", 12); + Out_String((CHAR*)", errcode = ", 13); Out_Int(errcode, 1); } Out_Ln(); @@ -149,20 +149,28 @@ static void Files_Err (CHAR *s, ADDRESS s__len, Files_File f, INT16 errcode) static void Files_MakeFileName (CHAR *dir, ADDRESS dir__len, CHAR *name, ADDRESS name__len, CHAR *dest, ADDRESS dest__len) { - INT16 i, j; + INT16 i, j, ld, ln; __DUP(dir, dir__len, CHAR); __DUP(name, name__len, CHAR); + ld = Strings_Length(dir, dir__len); + ln = Strings_Length(name, name__len); + while ((ld > 0 && dir[__X(ld - 1, dir__len)] == '/')) { + ld -= 1; + } + if (((ld + ln) + 2) > dest__len) { + Files_Err((CHAR*)"File name too long", 19, NIL, 0); + } i = 0; - j = 0; - while (dir[__X(i, dir__len)] != 0x00) { + while (i < ld) { dest[__X(i, dest__len)] = dir[__X(i, dir__len)]; i += 1; } - if (dest[__X(i - 1, dest__len)] != '/') { + if (i > 0) { dest[__X(i, dest__len)] = '/'; i += 1; } - while (name[__X(j, name__len)] != 0x00) { + j = 0; + while (j < ln) { dest[__X(i, dest__len)] = name[__X(j, name__len)]; i += 1; j += 1; @@ -174,31 +182,22 @@ static void Files_MakeFileName (CHAR *dir, ADDRESS dir__len, CHAR *name, ADDRESS static void Files_GetTempName (CHAR *finalName, ADDRESS finalName__len, CHAR *name, ADDRESS name__len) { - INT32 n, i, j; + INT16 i, n; __DUP(finalName, finalName__len, CHAR); - Files_tempno += 1; - n = Files_tempno; - i = 0; - if (finalName[0] != '/') { - while (Platform_CWD[__X(i, 256)] != 0x00) { - name[__X(i, name__len)] = Platform_CWD[__X(i, 256)]; - i += 1; - } - if (Platform_CWD[__X(i - 1, 256)] != '/') { - name[__X(i, name__len)] = '/'; - i += 1; - } + if (finalName[0] == '/') { + __COPY(finalName, name, name__len); + } else { + Files_MakeFileName(Platform_CWD, 256, finalName, finalName__len, (void*)name, name__len); } - j = 0; - while (finalName[__X(j, finalName__len)] != 0x00) { - name[__X(i, name__len)] = finalName[__X(j, finalName__len)]; - i += 1; - j += 1; - } - i -= 1; - while (name[__X(i, name__len)] != '/') { + i = Strings_Length(name, name__len) - 1; + while ((i > 0 && name[__X(i, name__len)] != '/')) { i -= 1; } + if ((i + 16) >= name__len) { + Files_Err((CHAR*)"File name too long", 19, NIL, 0); + } + Files_tempno += 1; + n = Files_tempno; name[__X(i + 1, name__len)] = '.'; name[__X(i + 2, name__len)] = 't'; name[__X(i + 3, name__len)] = 'm'; diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index e714f199..f5bfa63b 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -134,12 +134,12 @@ static void Files_Err (CHAR *s, ADDRESS s__len, Files_File f, INT16 errcode) Out_String(f->workName, 256); } if (f->fd != 0) { - Out_String((CHAR*)"f.fd = ", 8); + Out_String((CHAR*)", f.fd = ", 10); Out_Int(f->fd, 1); } } if (errcode != 0) { - Out_String((CHAR*)" errcode = ", 12); + Out_String((CHAR*)", errcode = ", 13); Out_Int(errcode, 1); } Out_Ln(); @@ -149,20 +149,28 @@ static void Files_Err (CHAR *s, ADDRESS s__len, Files_File f, INT16 errcode) static void Files_MakeFileName (CHAR *dir, ADDRESS dir__len, CHAR *name, ADDRESS name__len, CHAR *dest, ADDRESS dest__len) { - INT16 i, j; + INT16 i, j, ld, ln; __DUP(dir, dir__len, CHAR); __DUP(name, name__len, CHAR); + ld = Strings_Length(dir, dir__len); + ln = Strings_Length(name, name__len); + while ((ld > 0 && dir[__X(ld - 1, dir__len)] == '/')) { + ld -= 1; + } + if (((ld + ln) + 2) > dest__len) { + Files_Err((CHAR*)"File name too long", 19, NIL, 0); + } i = 0; - j = 0; - while (dir[__X(i, dir__len)] != 0x00) { + while (i < ld) { dest[__X(i, dest__len)] = dir[__X(i, dir__len)]; i += 1; } - if (dest[__X(i - 1, dest__len)] != '/') { + if (i > 0) { dest[__X(i, dest__len)] = '/'; i += 1; } - while (name[__X(j, name__len)] != 0x00) { + j = 0; + while (j < ln) { dest[__X(i, dest__len)] = name[__X(j, name__len)]; i += 1; j += 1; @@ -174,31 +182,22 @@ static void Files_MakeFileName (CHAR *dir, ADDRESS dir__len, CHAR *name, ADDRESS static void Files_GetTempName (CHAR *finalName, ADDRESS finalName__len, CHAR *name, ADDRESS name__len) { - INT32 n, i, j; + INT16 i, n; __DUP(finalName, finalName__len, CHAR); - Files_tempno += 1; - n = Files_tempno; - i = 0; - if (finalName[0] != '/') { - while (Platform_CWD[__X(i, 4096)] != 0x00) { - name[__X(i, name__len)] = Platform_CWD[__X(i, 4096)]; - i += 1; - } - if (Platform_CWD[__X(i - 1, 4096)] != '/') { - name[__X(i, name__len)] = '/'; - i += 1; - } + if (finalName[0] == '/') { + __COPY(finalName, name, name__len); + } else { + Files_MakeFileName(Platform_CWD, 4096, finalName, finalName__len, (void*)name, name__len); } - j = 0; - while (finalName[__X(j, finalName__len)] != 0x00) { - name[__X(i, name__len)] = finalName[__X(j, finalName__len)]; - i += 1; - j += 1; - } - i -= 1; - while (name[__X(i, name__len)] != '/') { + i = Strings_Length(name, name__len) - 1; + while ((i > 0 && name[__X(i, name__len)] != '/')) { i -= 1; } + if ((i + 16) >= name__len) { + Files_Err((CHAR*)"File name too long", 19, NIL, 0); + } + Files_tempno += 1; + n = Files_tempno; name[__X(i + 1, name__len)] = '.'; name[__X(i + 2, name__len)] = 't'; name[__X(i + 3, name__len)] = 'm'; diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 178e5cca..d7a1a3e1 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -135,12 +135,12 @@ static void Files_Err (CHAR *s, ADDRESS s__len, Files_File f, INT16 errcode) Out_String(f->workName, 256); } if (f->fd != 0) { - Out_String((CHAR*)"f.fd = ", 8); + Out_String((CHAR*)", f.fd = ", 10); Out_Int(f->fd, 1); } } if (errcode != 0) { - Out_String((CHAR*)" errcode = ", 12); + Out_String((CHAR*)", errcode = ", 13); Out_Int(errcode, 1); } Out_Ln(); @@ -150,20 +150,28 @@ static void Files_Err (CHAR *s, ADDRESS s__len, Files_File f, INT16 errcode) static void Files_MakeFileName (CHAR *dir, ADDRESS dir__len, CHAR *name, ADDRESS name__len, CHAR *dest, ADDRESS dest__len) { - INT16 i, j; + INT16 i, j, ld, ln; __DUP(dir, dir__len, CHAR); __DUP(name, name__len, CHAR); + ld = Strings_Length(dir, dir__len); + ln = Strings_Length(name, name__len); + while ((ld > 0 && dir[__X(ld - 1, dir__len)] == '/')) { + ld -= 1; + } + if (((ld + ln) + 2) > dest__len) { + Files_Err((CHAR*)"File name too long", 19, NIL, 0); + } i = 0; - j = 0; - while (dir[__X(i, dir__len)] != 0x00) { + while (i < ld) { dest[__X(i, dest__len)] = dir[__X(i, dir__len)]; i += 1; } - if (dest[__X(i - 1, dest__len)] != '/') { + if (i > 0) { dest[__X(i, dest__len)] = '/'; i += 1; } - while (name[__X(j, name__len)] != 0x00) { + j = 0; + while (j < ln) { dest[__X(i, dest__len)] = name[__X(j, name__len)]; i += 1; j += 1; @@ -175,31 +183,22 @@ static void Files_MakeFileName (CHAR *dir, ADDRESS dir__len, CHAR *name, ADDRESS static void Files_GetTempName (CHAR *finalName, ADDRESS finalName__len, CHAR *name, ADDRESS name__len) { - INT32 n, i, j; + INT16 i, n; __DUP(finalName, finalName__len, CHAR); - Files_tempno += 1; - n = Files_tempno; - i = 0; - if (finalName[0] != '/') { - while (Platform_CWD[__X(i, 4096)] != 0x00) { - name[__X(i, name__len)] = Platform_CWD[__X(i, 4096)]; - i += 1; - } - if (Platform_CWD[__X(i - 1, 4096)] != '/') { - name[__X(i, name__len)] = '/'; - i += 1; - } + if (finalName[0] == '/') { + __COPY(finalName, name, name__len); + } else { + Files_MakeFileName(Platform_CWD, 4096, finalName, finalName__len, (void*)name, name__len); } - j = 0; - while (finalName[__X(j, finalName__len)] != 0x00) { - name[__X(i, name__len)] = finalName[__X(j, finalName__len)]; - i += 1; - j += 1; - } - i -= 1; - while (name[__X(i, name__len)] != '/') { + i = Strings_Length(name, name__len) - 1; + while ((i > 0 && name[__X(i, name__len)] != '/')) { i -= 1; } + if ((i + 16) >= name__len) { + Files_Err((CHAR*)"File name too long", 19, NIL, 0); + } + Files_tempno += 1; + n = Files_tempno; name[__X(i + 1, name__len)] = '.'; name[__X(i + 2, name__len)] = 't'; name[__X(i + 3, name__len)] = 'm'; From ee01f97392351939072dbe3c782f00c8b2c5ec48 Mon Sep 17 00:00:00 2001 From: David Brown Date: Tue, 24 Apr 2018 18:51:39 +0100 Subject: [PATCH 497/580] Expose file name and path max lengths in Files.Mod. --- src/runtime/Files.Mod | 5 +++++ src/runtime/Platformunix.Mod | 13 ++++++++++++- src/runtime/Platformwindows.Mod | 11 +++++++++++ 3 files changed, 28 insertions(+), 1 deletion(-) diff --git a/src/runtime/Files.Mod b/src/runtime/Files.Mod index b63553d7..5ce79071 100644 --- a/src/runtime/Files.Mod +++ b/src/runtime/Files.Mod @@ -54,6 +54,9 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files VAR + MaxPathLength-: INTEGER; + MaxNameLength-: INTEGER; + files: POINTER [1] TO FileDesc; (* List of files backed by an OS file, whether open, registered or temporary. *) tempno: INTEGER; HOME: ARRAY 1024 OF CHAR; @@ -741,4 +744,6 @@ BEGIN tempno := -1; Heap.FileCount := 0; HOME := ""; Platform.GetEnv("HOME", HOME); + MaxPathLength := Platform.MaxPathLength(); + MaxNameLength := Platform.MaxNameLength(); END Files. diff --git a/src/runtime/Platformunix.Mod b/src/runtime/Platformunix.Mod index ff03a960..bcf11137 100644 --- a/src/runtime/Platformunix.Mod +++ b/src/runtime/Platformunix.Mod @@ -44,6 +44,7 @@ PROCEDURE -Aincludeerrno '#include '; PROCEDURE -Astdlib '#include '; PROCEDURE -Astdio '#include '; PROCEDURE -Aerrno '#include '; +PROCEDURE -Alimits '#include '; @@ -66,7 +67,6 @@ PROCEDURE -EINTR(): ErrorCode 'EINTR'; - PROCEDURE TooManyFiles*(e: ErrorCode): BOOLEAN; BEGIN RETURN (e = EMFILE()) OR (e = ENFILE()) END TooManyFiles; @@ -95,6 +95,17 @@ BEGIN RETURN e = EINTR() END Interrupted; +(* Expose file and path name length limits *) + +PROCEDURE -NAMEMAX(): INTEGER 'NAME_MAX'; +PROCEDURE -PATHMAX(): INTEGER 'PATH_MAX'; + +PROCEDURE MaxNameLength*(): INTEGER; BEGIN RETURN NAMEMAX() END MaxNameLength; +PROCEDURE MaxPathLength*(): INTEGER; BEGIN RETURN PATHMAX() END MaxPathLength; + + + + (* OS memory allocaton *) PROCEDURE -allocate (size: SYSTEM.ADDRESS): SYSTEM.ADDRESS "(ADDRESS)((void*)malloc((size_t)size))"; diff --git a/src/runtime/Platformwindows.Mod b/src/runtime/Platformwindows.Mod index 4087c75b..63c90a69 100644 --- a/src/runtime/Platformwindows.Mod +++ b/src/runtime/Platformwindows.Mod @@ -91,6 +91,17 @@ BEGIN RETURN e = EINTR() END Interrupted; + +(* Expose file and path name length limits (same on Windows) *) + +PROCEDURE -MAXPATH(): INTEGER 'MAX_PATH'; + +PROCEDURE MaxNameLength*(): INTEGER; BEGIN RETURN MAXPATH() END MaxNameLength; +PROCEDURE MaxPathLength*(): INTEGER; BEGIN RETURN MAXPATH() END MaxPathLength; + + + + (* OS memory allocaton *) PROCEDURE -allocate(size: SYSTEM.ADDRESS): SYSTEM.ADDRESS "(ADDRESS)((void*)HeapAlloc(GetProcessHeap(), 0, (size_t)size))"; From b1b4d6b6026ae7955a0d9e0b32d13b80809f7940 Mon Sep 17 00:00:00 2001 From: David Brown Date: Tue, 24 Apr 2018 18:53:02 +0100 Subject: [PATCH 498/580] Update bootstrap C source files. --- bootstrap/unix-44/Files.c | 3 +++ bootstrap/unix-44/Files.h | 1 + bootstrap/unix-44/Platform.c | 21 ++++++++++++++++++--- bootstrap/unix-44/Platform.h | 2 ++ bootstrap/unix-48/Files.c | 3 +++ bootstrap/unix-48/Files.h | 1 + bootstrap/unix-48/Platform.c | 21 ++++++++++++++++++--- bootstrap/unix-48/Platform.h | 2 ++ bootstrap/unix-88/Files.c | 3 +++ bootstrap/unix-88/Files.h | 1 + bootstrap/unix-88/Platform.c | 21 ++++++++++++++++++--- bootstrap/unix-88/Platform.h | 2 ++ bootstrap/windows-48/Files.c | 3 +++ bootstrap/windows-48/Files.h | 1 + bootstrap/windows-48/Platform.c | 13 +++++++++++++ bootstrap/windows-48/Platform.h | 2 ++ bootstrap/windows-88/Files.c | 3 +++ bootstrap/windows-88/Files.h | 1 + bootstrap/windows-88/Platform.c | 13 +++++++++++++ bootstrap/windows-88/Platform.h | 2 ++ 20 files changed, 110 insertions(+), 9 deletions(-) diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 8efb373c..867c33a4 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -48,6 +48,7 @@ typedef } Files_Rider; +export INT16 Files_MaxPathLength, Files_MaxNameLength; static Files_FileDesc *Files_files; static INT16 Files_tempno; static CHAR Files_HOME[1024]; @@ -1082,5 +1083,7 @@ export void *Files__init(void) Heap_FileCount = 0; Files_HOME[0] = 0x00; Platform_GetEnv((CHAR*)"HOME", 5, (void*)Files_HOME, 1024); + Files_MaxPathLength = Platform_MaxPathLength(); + Files_MaxNameLength = Platform_MaxNameLength(); __ENDMOD; } diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index a0bced1c..f0e783a2 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -22,6 +22,7 @@ typedef } Files_Rider; +import INT16 Files_MaxPathLength, Files_MaxNameLength; import ADDRESS *Files_FileDesc__typ; import ADDRESS *Files_Rider__typ; diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index b5bf3da8..5e716822 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -42,6 +42,8 @@ export BOOLEAN Platform_Inaccessible (INT16 e); export BOOLEAN Platform_Interrupted (INT16 e); export BOOLEAN Platform_IsConsole (INT32 h); export void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d); +export INT16 Platform_MaxNameLength (void); +export INT16 Platform_MaxPathLength (void); export INT16 Platform_New (CHAR *n, ADDRESS n__len, INT32 *h); export BOOLEAN Platform_NoSuchDirectory (INT16 e); export INT32 Platform_OSAllocate (INT32 size); @@ -79,6 +81,7 @@ export BOOLEAN Platform_getEnv (CHAR *var, ADDRESS var__len, CHAR *val, ADDRESS #include #include #include +#include #include #include #define Platform_EACCES() EACCES @@ -94,6 +97,8 @@ export BOOLEAN Platform_getEnv (CHAR *var, ADDRESS var__len, CHAR *val, ADDRESS #define Platform_EROFS() EROFS #define Platform_ETIMEDOUT() ETIMEDOUT #define Platform_EXDEV() EXDEV +#define Platform_NAMEMAX() NAME_MAX +#define Platform_PATHMAX() PATH_MAX #define Platform_allocate(size) (ADDRESS)((void*)malloc((size_t)size)) #define Platform_chdir(n, n__len) chdir((char*)n) #define Platform_closefile(fd) close(fd) @@ -178,6 +183,16 @@ BOOLEAN Platform_Interrupted (INT16 e) return e == Platform_EINTR(); } +INT16 Platform_MaxNameLength (void) +{ + return Platform_NAMEMAX(); +} + +INT16 Platform_MaxPathLength (void) +{ + return Platform_PATHMAX(); +} + INT32 Platform_OSAllocate (INT32 size) { return Platform_allocate(size); @@ -189,13 +204,13 @@ void Platform_OSFree (INT32 address) } typedef - CHAR (*EnvPtr__78)[1024]; + CHAR (*EnvPtr__83)[1024]; BOOLEAN Platform_getEnv (CHAR *var, ADDRESS var__len, CHAR *val, ADDRESS val__len) { - EnvPtr__78 p = NIL; + EnvPtr__83 p = NIL; __DUP(var, var__len, CHAR); - p = (EnvPtr__78)(ADDRESS)Platform_getenv(var, var__len); + p = (EnvPtr__83)(ADDRESS)Platform_getenv(var, var__len); if (p != NIL) { __COPY(*p, val, val__len); } diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index 6c2d79c8..3c3d06cb 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -40,6 +40,8 @@ import BOOLEAN Platform_Inaccessible (INT16 e); import BOOLEAN Platform_Interrupted (INT16 e); import BOOLEAN Platform_IsConsole (INT32 h); import void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d); +import INT16 Platform_MaxNameLength (void); +import INT16 Platform_MaxPathLength (void); import INT16 Platform_New (CHAR *n, ADDRESS n__len, INT32 *h); import BOOLEAN Platform_NoSuchDirectory (INT16 e); import INT32 Platform_OSAllocate (INT32 size); diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 8efb373c..867c33a4 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -48,6 +48,7 @@ typedef } Files_Rider; +export INT16 Files_MaxPathLength, Files_MaxNameLength; static Files_FileDesc *Files_files; static INT16 Files_tempno; static CHAR Files_HOME[1024]; @@ -1082,5 +1083,7 @@ export void *Files__init(void) Heap_FileCount = 0; Files_HOME[0] = 0x00; Platform_GetEnv((CHAR*)"HOME", 5, (void*)Files_HOME, 1024); + Files_MaxPathLength = Platform_MaxPathLength(); + Files_MaxNameLength = Platform_MaxNameLength(); __ENDMOD; } diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index a0bced1c..f0e783a2 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -22,6 +22,7 @@ typedef } Files_Rider; +import INT16 Files_MaxPathLength, Files_MaxNameLength; import ADDRESS *Files_FileDesc__typ; import ADDRESS *Files_Rider__typ; diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index b5bf3da8..5e716822 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -42,6 +42,8 @@ export BOOLEAN Platform_Inaccessible (INT16 e); export BOOLEAN Platform_Interrupted (INT16 e); export BOOLEAN Platform_IsConsole (INT32 h); export void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d); +export INT16 Platform_MaxNameLength (void); +export INT16 Platform_MaxPathLength (void); export INT16 Platform_New (CHAR *n, ADDRESS n__len, INT32 *h); export BOOLEAN Platform_NoSuchDirectory (INT16 e); export INT32 Platform_OSAllocate (INT32 size); @@ -79,6 +81,7 @@ export BOOLEAN Platform_getEnv (CHAR *var, ADDRESS var__len, CHAR *val, ADDRESS #include #include #include +#include #include #include #define Platform_EACCES() EACCES @@ -94,6 +97,8 @@ export BOOLEAN Platform_getEnv (CHAR *var, ADDRESS var__len, CHAR *val, ADDRESS #define Platform_EROFS() EROFS #define Platform_ETIMEDOUT() ETIMEDOUT #define Platform_EXDEV() EXDEV +#define Platform_NAMEMAX() NAME_MAX +#define Platform_PATHMAX() PATH_MAX #define Platform_allocate(size) (ADDRESS)((void*)malloc((size_t)size)) #define Platform_chdir(n, n__len) chdir((char*)n) #define Platform_closefile(fd) close(fd) @@ -178,6 +183,16 @@ BOOLEAN Platform_Interrupted (INT16 e) return e == Platform_EINTR(); } +INT16 Platform_MaxNameLength (void) +{ + return Platform_NAMEMAX(); +} + +INT16 Platform_MaxPathLength (void) +{ + return Platform_PATHMAX(); +} + INT32 Platform_OSAllocate (INT32 size) { return Platform_allocate(size); @@ -189,13 +204,13 @@ void Platform_OSFree (INT32 address) } typedef - CHAR (*EnvPtr__78)[1024]; + CHAR (*EnvPtr__83)[1024]; BOOLEAN Platform_getEnv (CHAR *var, ADDRESS var__len, CHAR *val, ADDRESS val__len) { - EnvPtr__78 p = NIL; + EnvPtr__83 p = NIL; __DUP(var, var__len, CHAR); - p = (EnvPtr__78)(ADDRESS)Platform_getenv(var, var__len); + p = (EnvPtr__83)(ADDRESS)Platform_getenv(var, var__len); if (p != NIL) { __COPY(*p, val, val__len); } diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index 6c2d79c8..3c3d06cb 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -40,6 +40,8 @@ import BOOLEAN Platform_Inaccessible (INT16 e); import BOOLEAN Platform_Interrupted (INT16 e); import BOOLEAN Platform_IsConsole (INT32 h); import void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d); +import INT16 Platform_MaxNameLength (void); +import INT16 Platform_MaxPathLength (void); import INT16 Platform_New (CHAR *n, ADDRESS n__len, INT32 *h); import BOOLEAN Platform_NoSuchDirectory (INT16 e); import INT32 Platform_OSAllocate (INT32 size); diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index e30bbdb0..dd5e8a22 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -48,6 +48,7 @@ typedef } Files_Rider; +export INT16 Files_MaxPathLength, Files_MaxNameLength; static Files_FileDesc *Files_files; static INT16 Files_tempno; static CHAR Files_HOME[1024]; @@ -1082,5 +1083,7 @@ export void *Files__init(void) Heap_FileCount = 0; Files_HOME[0] = 0x00; Platform_GetEnv((CHAR*)"HOME", 5, (void*)Files_HOME, 1024); + Files_MaxPathLength = Platform_MaxPathLength(); + Files_MaxNameLength = Platform_MaxNameLength(); __ENDMOD; } diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 9d81c004..f74b89a5 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -23,6 +23,7 @@ typedef } Files_Rider; +import INT16 Files_MaxPathLength, Files_MaxNameLength; import ADDRESS *Files_FileDesc__typ; import ADDRESS *Files_Rider__typ; diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index fa174db0..e578c349 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -42,6 +42,8 @@ export BOOLEAN Platform_Inaccessible (INT16 e); export BOOLEAN Platform_Interrupted (INT16 e); export BOOLEAN Platform_IsConsole (INT32 h); export void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d); +export INT16 Platform_MaxNameLength (void); +export INT16 Platform_MaxPathLength (void); export INT16 Platform_New (CHAR *n, ADDRESS n__len, INT32 *h); export BOOLEAN Platform_NoSuchDirectory (INT16 e); export INT64 Platform_OSAllocate (INT64 size); @@ -79,6 +81,7 @@ export BOOLEAN Platform_getEnv (CHAR *var, ADDRESS var__len, CHAR *val, ADDRESS #include #include #include +#include #include #include #define Platform_EACCES() EACCES @@ -94,6 +97,8 @@ export BOOLEAN Platform_getEnv (CHAR *var, ADDRESS var__len, CHAR *val, ADDRESS #define Platform_EROFS() EROFS #define Platform_ETIMEDOUT() ETIMEDOUT #define Platform_EXDEV() EXDEV +#define Platform_NAMEMAX() NAME_MAX +#define Platform_PATHMAX() PATH_MAX #define Platform_allocate(size) (ADDRESS)((void*)malloc((size_t)size)) #define Platform_chdir(n, n__len) chdir((char*)n) #define Platform_closefile(fd) close(fd) @@ -178,6 +183,16 @@ BOOLEAN Platform_Interrupted (INT16 e) return e == Platform_EINTR(); } +INT16 Platform_MaxNameLength (void) +{ + return Platform_NAMEMAX(); +} + +INT16 Platform_MaxPathLength (void) +{ + return Platform_PATHMAX(); +} + INT64 Platform_OSAllocate (INT64 size) { return Platform_allocate(size); @@ -189,13 +204,13 @@ void Platform_OSFree (INT64 address) } typedef - CHAR (*EnvPtr__78)[1024]; + CHAR (*EnvPtr__83)[1024]; BOOLEAN Platform_getEnv (CHAR *var, ADDRESS var__len, CHAR *val, ADDRESS val__len) { - EnvPtr__78 p = NIL; + EnvPtr__83 p = NIL; __DUP(var, var__len, CHAR); - p = (EnvPtr__78)(ADDRESS)Platform_getenv(var, var__len); + p = (EnvPtr__83)(ADDRESS)Platform_getenv(var, var__len); if (p != NIL) { __COPY(*p, val, val__len); } diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index 085c2257..fefe3da8 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -40,6 +40,8 @@ import BOOLEAN Platform_Inaccessible (INT16 e); import BOOLEAN Platform_Interrupted (INT16 e); import BOOLEAN Platform_IsConsole (INT32 h); import void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d); +import INT16 Platform_MaxNameLength (void); +import INT16 Platform_MaxPathLength (void); import INT16 Platform_New (CHAR *n, ADDRESS n__len, INT32 *h); import BOOLEAN Platform_NoSuchDirectory (INT16 e); import INT64 Platform_OSAllocate (INT64 size); diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index f5bfa63b..b6b62f3c 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -48,6 +48,7 @@ typedef } Files_Rider; +export INT16 Files_MaxPathLength, Files_MaxNameLength; static Files_FileDesc *Files_files; static INT16 Files_tempno; static CHAR Files_HOME[1024]; @@ -1082,5 +1083,7 @@ export void *Files__init(void) Heap_FileCount = 0; Files_HOME[0] = 0x00; Platform_GetEnv((CHAR*)"HOME", 5, (void*)Files_HOME, 1024); + Files_MaxPathLength = Platform_MaxPathLength(); + Files_MaxNameLength = Platform_MaxNameLength(); __ENDMOD; } diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index 61cad689..2e6b98b9 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -22,6 +22,7 @@ typedef } Files_Rider; +import INT16 Files_MaxPathLength, Files_MaxNameLength; import ADDRESS *Files_FileDesc__typ; import ADDRESS *Files_Rider__typ; diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 62920520..9e7d70ee 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -44,6 +44,8 @@ export BOOLEAN Platform_Inaccessible (INT16 e); export BOOLEAN Platform_Interrupted (INT16 e); export BOOLEAN Platform_IsConsole (INT32 h); export void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d); +export INT16 Platform_MaxNameLength (void); +export INT16 Platform_MaxPathLength (void); export INT16 Platform_New (CHAR *n, ADDRESS n__len, INT32 *h); export BOOLEAN Platform_NoSuchDirectory (INT16 e); export INT32 Platform_OSAllocate (INT32 size); @@ -88,6 +90,7 @@ export BOOLEAN Platform_getEnv (CHAR *var, ADDRESS var__len, CHAR *val, ADDRESS #define Platform_ETIMEDOUT() WSAETIMEDOUT #define Platform_GetConsoleMode(h, m) GetConsoleMode((HANDLE)h, (DWORD*)m) #define Platform_GetTickCount() (LONGINT)(UINT32)GetTickCount() +#define Platform_MAXPATH() MAX_PATH #define Platform_SetConsoleMode(h, m) SetConsoleMode((HANDLE)h, (DWORD)m) #define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((ADDRESS)h) #define Platform_SetQuitHandler(h) SystemSetQuitHandler((ADDRESS)h) @@ -191,6 +194,16 @@ BOOLEAN Platform_Interrupted (INT16 e) return e == Platform_EINTR(); } +INT16 Platform_MaxNameLength (void) +{ + return Platform_MAXPATH(); +} + +INT16 Platform_MaxPathLength (void) +{ + return Platform_MAXPATH(); +} + INT32 Platform_OSAllocate (INT32 size) { return Platform_allocate(size); diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index c447f2ba..9c125f90 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -41,6 +41,8 @@ import BOOLEAN Platform_Inaccessible (INT16 e); import BOOLEAN Platform_Interrupted (INT16 e); import BOOLEAN Platform_IsConsole (INT32 h); import void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d); +import INT16 Platform_MaxNameLength (void); +import INT16 Platform_MaxPathLength (void); import INT16 Platform_New (CHAR *n, ADDRESS n__len, INT32 *h); import BOOLEAN Platform_NoSuchDirectory (INT16 e); import INT32 Platform_OSAllocate (INT32 size); diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index d7a1a3e1..c473c7b3 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -49,6 +49,7 @@ typedef } Files_Rider; +export INT16 Files_MaxPathLength, Files_MaxNameLength; static Files_FileDesc *Files_files; static INT16 Files_tempno; static CHAR Files_HOME[1024]; @@ -1084,5 +1085,7 @@ export void *Files__init(void) Heap_FileCount = 0; Files_HOME[0] = 0x00; Platform_GetEnv((CHAR*)"HOME", 5, (void*)Files_HOME, 1024); + Files_MaxPathLength = Platform_MaxPathLength(); + Files_MaxNameLength = Platform_MaxNameLength(); __ENDMOD; } diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 658429ef..032d28c2 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -23,6 +23,7 @@ typedef } Files_Rider; +import INT16 Files_MaxPathLength, Files_MaxNameLength; import ADDRESS *Files_FileDesc__typ; import ADDRESS *Files_Rider__typ; diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 9f789ece..6f55e803 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -44,6 +44,8 @@ export BOOLEAN Platform_Inaccessible (INT16 e); export BOOLEAN Platform_Interrupted (INT16 e); export BOOLEAN Platform_IsConsole (INT64 h); export void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d); +export INT16 Platform_MaxNameLength (void); +export INT16 Platform_MaxPathLength (void); export INT16 Platform_New (CHAR *n, ADDRESS n__len, INT64 *h); export BOOLEAN Platform_NoSuchDirectory (INT16 e); export INT64 Platform_OSAllocate (INT64 size); @@ -88,6 +90,7 @@ export BOOLEAN Platform_getEnv (CHAR *var, ADDRESS var__len, CHAR *val, ADDRESS #define Platform_ETIMEDOUT() WSAETIMEDOUT #define Platform_GetConsoleMode(h, m) GetConsoleMode((HANDLE)h, (DWORD*)m) #define Platform_GetTickCount() (LONGINT)(UINT32)GetTickCount() +#define Platform_MAXPATH() MAX_PATH #define Platform_SetConsoleMode(h, m) SetConsoleMode((HANDLE)h, (DWORD)m) #define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((ADDRESS)h) #define Platform_SetQuitHandler(h) SystemSetQuitHandler((ADDRESS)h) @@ -191,6 +194,16 @@ BOOLEAN Platform_Interrupted (INT16 e) return e == Platform_EINTR(); } +INT16 Platform_MaxNameLength (void) +{ + return Platform_MAXPATH(); +} + +INT16 Platform_MaxPathLength (void) +{ + return Platform_MAXPATH(); +} + INT64 Platform_OSAllocate (INT64 size) { return Platform_allocate(size); diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index ee812dcd..ba866b78 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -41,6 +41,8 @@ import BOOLEAN Platform_Inaccessible (INT16 e); import BOOLEAN Platform_Interrupted (INT16 e); import BOOLEAN Platform_IsConsole (INT64 h); import void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d); +import INT16 Platform_MaxNameLength (void); +import INT16 Platform_MaxPathLength (void); import INT16 Platform_New (CHAR *n, ADDRESS n__len, INT64 *h); import BOOLEAN Platform_NoSuchDirectory (INT16 e); import INT64 Platform_OSAllocate (INT64 size); From af380565180e7b4028abafa6dce823a69488e692 Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 27 Apr 2018 13:58:10 +0100 Subject: [PATCH 499/580] Add ruminations on how Oberon Files.Mod behaviour differs from conventional systems. --- doc/Files.md | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 doc/Files.md diff --git a/doc/Files.md b/doc/Files.md new file mode 100644 index 00000000..54355260 --- /dev/null +++ b/doc/Files.md @@ -0,0 +1,70 @@ +## Oberon's Files.Mod - differences from POSIX style file APIs + +Most operating systems provide file access in a similar and familiar manner: + - A new file is initially created as an entry in a filesystem directory referencing an empty file. + - File writes add to this file though buffers that will be flushed when full and at file close. + - Following file close the file is inacccessible until reopened. + +#### Why is a file *always* indexed in the filesystem directory? + +Before computers, files would be stored in filing cabinets for long term storage and retrieval, but they would also live independent of filing cabinets, for example in in-trays or out-trays, or loose on desks while being assembled. + +A file outside the filing cabinet might be being in the process of updating and so in an incomplete or inconsistant state. A file in the filing cabinet might be considered complete and consistent. + +#### Oberon Files.Mod behaviour + +Oberons filesystem behaviour is arguably closer to pre-computer usage. Files can easily exist independent of the filesystem directory: + + - Files.New creates a Files.File object that is fully writeable (and readable) but which is not (yet) indexed in the the filesystem. + - Files.Register puts the files name into the filesystem directory. + - Files.Delete takes the files name out of the filesystem directory. + - Neither Register nor Delete affect the file content or access to it. + - The files disk space will be recovered when there is neither a Files.File object referencing the file, nor is its file name present in the directory. + +For example it would be possible for a program to create a new file (Files.New), and then repeatedly put it into the directory (Files.Register) and take it out of the directory (Files.Delete) while at all times the Files.File returned by Files.New remains valid and the content and connected riders are unaffected by the directory changes. + +#### Comparing the Posix and Oberon approaches to file creation. + +On a real Oberon system, file access is independent of the file directory and the Oberon APIs directly reflect the system implementation. + +On a POSIX like system some Oberon APIs require implementation workarounds. This table illustrates Oberon behaviour by describing how it is implemented on top of a POSIX like filesystem. + +|Oberon API|Oberon behaviour|C API|C behaviour| +|---|---|---|---| +|Files.New(name)|Creates a file handle (Files.File) but does not touch the disk.|fopen(name, "w")|Creates an empty file and returns a handle. The empty file is immediately visible to other processes.| +|Files.Set(rider,file,pos)|Creates a rider at a given file position. Multiple riders may be created on the same file at the same or different positions.|----|----| +|Files.WriteBytes(rider,bytes,len)|Buffers are allocated to store written data (current implementation is up to 4 buffers, each 4kb).
Until the buffers are full nothing is written to disk and no file is created in the OS|fwrite()|Data is written to a buffer up to a system dependant size, nothing is written to disk.| +|Files.WriteBytes beyond buffer size|Once more than 16kb has been written, Vishap Oberon creates a temporary file to back up least recently accessed buffers.|fwrite()...|Once the internal buffer is full it is written to the named disk file| +|Files.Register|If all data is still in buffers (no temp file has been created), an OS file is created using the name originally passed to Files.New.
If a temporary file had been created it is renamed to the name originally passed to Files.New.
All buffered data is flushed to the file.|(no equivalent)|| +|Files.Delete|If there is no Files.File in the same program referencing the file then unlink/DeleteFile is called.
If there is a Files.File the OS file is renamed as a temporary file.
Any riders active on the file remain valid.
The file can be reregistered later.|unlink() or DeleteFile()|The file is marked for deletion and will be removed from the filesystem directory when no processes have it open.
Neither Windows nor Linux allow the file to be put back into the directory.| +|Files.Close|Any buffered data is flushed to disk. *The file object and all riders remain valid, data can still be read and written*.|close|Any buffered data is flushed to disk. The file handle is no longer valid for use.| + +Note that the Oberon approach results naturally in files not being visible to other processes until the writer has written a complete set of data. + +On other systems one common workaround is to write to a temporary file, and then rename it to it's public name, taking care of course to create the temporary file on the same device/partition where it will be published. + +Another workaround is to use file locking to keep the file inaccessible until the full set of data is written, of course taking care to avoid deadlocks. + + +### More on the Vishap Oberon emulation of Oberon system file access. + +Emulation of Oberon system behaviour is part of the Vishap Oberon run time system linked into each program. When multiple Oberon programs are running there are necessarily multiple run time systems running. + +#### Two programs writing to the same file + +Each run time system provides Oberon like buffer management. For example, each run time system ensures that multiple riders based on the same file share the same file buffers, such that writes to one of the riders are immediately availble to all (suitably positioned) other riders. + +It is a limitation that this parallel read and write behaviour does not work accross multiple porgams. + +#### Deleting and re-registering files + +Each run time system tracks deletes and registers to provide Oberon system behaviour, allowing a file to be registered, deleted, and re-registered as often as desired. (When the file is deleted, the run time system converts it back to a temporary file.) + +It is a limitation that the run time system does not provide full Oberon behaviour when a file is opened that is also in use by another program, or for which there are other hard links. + +#### Details + +|Activity|Behaviour| +|---|---| +|Rider buffering|File decriptors and buffers are not shared between multiple instances of the runtime system, therefore if two separate programs call Files.Old on the same file, writes to a rider in one program will usually not be reflected by reads in another program.
Further if both programs are writing to parts of the file that fall in the same buffer area, data will likely be lost: the second program to flush its buffer will overwrite new data written by the program that flushed first. While this is expected behaviour for most operating systems, it is not Oberon behaviour.| +|Register and Delete|When an Oberon program program calls Files.Delete passing a filename for which there is a Files.File instance, its runtime system renames the file as a temporary file and records that it is unregistered. The file continues to be accessible by all programs that have it open. When the program that deleted it completes it will call unlink, causing the OS to actually remove it once no programs have it open. This much is valid Oberon system behaviour.
However only the runtime system of the program that deleted the file knows that it is now unregistered and can successfully register it again. Run time systems of other running Vishap Oberon programs still think the file is registered and will be unable to Register it themselves.| \ No newline at end of file From 8890fe13369780dbbf480dfa7e4badefd8f12995 Mon Sep 17 00:00:00 2001 From: Norayr Chilingarian Date: Sat, 24 Nov 2018 00:28:13 +0400 Subject: [PATCH 500/580] windows installation document link fixed. --- ReadMe.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReadMe.md b/ReadMe.md index f43f8559..d159399c 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -74,7 +74,7 @@ for your OS as follows: | ------- | -------------------------------------- | | Linux | `/opt/voc` | | BSD | `/usr/local/share/voc` | -| Windows | See [**Windows installation**](/doc/WInstallation.md) | +| Windows | See [**Windows installation**](/doc/Winstallation.md) | | Termux | `/data/data/com.termux/files/opt/voc` | `make install` updates `ldconfg` with the new library locations. From 6842928bf8b435966f625a699fa8186c3fd26900 Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 4 Jan 2019 18:54:55 +0000 Subject: [PATCH 501/580] Integrate rangechecked casting correction from @svorkoetter. --- .gitignore | 4 +++ bootstrap/unix-44/Compiler.c | 2 +- bootstrap/unix-44/Configuration.c | 4 +-- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Files.c | 30 ++++++++++----------- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 2 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 4 +-- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 8 +++--- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 12 ++++----- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 24 ++++++++--------- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 10 +++---- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 12 ++++----- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 7 +++-- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Out.c | 18 ++++++------- bootstrap/unix-44/Out.h | 2 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 20 +++++++------- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 6 ++--- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 28 +++++++++---------- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/VT100.c | 4 +-- bootstrap/unix-44/VT100.h | 2 +- bootstrap/unix-44/extTools.c | 4 +-- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-48/Compiler.c | 2 +- bootstrap/unix-48/Configuration.c | 4 +-- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Files.c | 30 ++++++++++----------- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 2 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 4 +-- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 8 +++--- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 12 ++++----- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 24 ++++++++--------- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 10 +++---- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 12 ++++----- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 7 +++-- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Out.c | 18 ++++++------- bootstrap/unix-48/Out.h | 2 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 20 +++++++------- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 6 ++--- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 28 +++++++++---------- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/VT100.c | 4 +-- bootstrap/unix-48/VT100.h | 2 +- bootstrap/unix-48/extTools.c | 4 +-- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-88/Compiler.c | 2 +- bootstrap/unix-88/Configuration.c | 4 +-- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Files.c | 30 ++++++++++----------- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 2 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 4 +-- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 8 +++--- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 12 ++++----- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 24 ++++++++--------- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 10 +++---- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 12 ++++----- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 7 +++-- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Out.c | 18 ++++++------- bootstrap/unix-88/Out.h | 2 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 20 +++++++------- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 6 ++--- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 28 +++++++++---------- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/VT100.c | 4 +-- bootstrap/unix-88/VT100.h | 2 +- bootstrap/unix-88/extTools.c | 4 +-- bootstrap/unix-88/extTools.h | 2 +- bootstrap/windows-48/Compiler.c | 2 +- bootstrap/windows-48/Configuration.c | 4 +-- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Files.c | 30 ++++++++++----------- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 2 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 4 +-- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 8 +++--- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 12 ++++----- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 24 ++++++++--------- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 10 +++---- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 12 ++++----- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 7 +++-- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Out.c | 18 ++++++------- bootstrap/windows-48/Out.h | 2 +- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 20 +++++++------- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 6 ++--- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 28 +++++++++---------- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/VT100.c | 4 +-- bootstrap/windows-48/VT100.h | 2 +- bootstrap/windows-48/extTools.c | 4 +-- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-88/Compiler.c | 2 +- bootstrap/windows-88/Configuration.c | 4 +-- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Files.c | 30 ++++++++++----------- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 2 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 4 +-- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 8 +++--- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 12 ++++----- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 24 ++++++++--------- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 10 +++---- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 12 ++++----- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 7 +++-- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Out.c | 18 ++++++------- bootstrap/windows-88/Out.h | 2 +- bootstrap/windows-88/Platform.c | 2 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 20 +++++++------- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 6 ++--- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 28 +++++++++---------- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/VT100.c | 4 +-- bootstrap/windows-88/VT100.h | 2 +- bootstrap/windows-88/extTools.c | 4 +-- bootstrap/windows-88/extTools.h | 2 +- src/compiler/OPV.Mod | 9 ++++--- src/tools/make/oberon.mk | 40 ++++++++++++++-------------- 188 files changed, 614 insertions(+), 614 deletions(-) diff --git a/.gitignore b/.gitignore index cce16916..22c5a97d 100644 --- a/.gitignore +++ b/.gitignore @@ -35,3 +35,7 @@ **/.tmp.* /*.pdb /*.ilk +/t/* +/triage/BasicTypeSize.md +/triage/Roadmap.md +triage/system/* diff --git a/bootstrap/unix-44/Compiler.c b/bootstrap/unix-44/Compiler.c index 9cdbb76c..3c9bd35e 100644 --- a/bootstrap/unix-44/Compiler.c +++ b/bootstrap/unix-44/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index 3ab08d40..50c02bb9 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index 7db28b57..d85d80f6 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 867c33a4..8f2c5d55 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -206,7 +206,7 @@ static void Files_GetTempName (CHAR *finalName, ADDRESS finalName__len, CHAR *na name[__X(i + 5, name__len)] = '.'; i += 6; while (n > 0) { - name[__X(i, name__len)] = (CHAR)((int)__MOD(n, 10) + 48); + name[__X(i, name__len)] = __CHR((int)__MOD(n, 10) + 48); n = __DIV(n, 10); i += 1; } @@ -214,7 +214,7 @@ static void Files_GetTempName (CHAR *finalName, ADDRESS finalName__len, CHAR *na i += 1; n = Platform_PID; while (n > 0) { - name[__X(i, name__len)] = (CHAR)((int)__MOD(n, 10) + 48); + name[__X(i, name__len)] = __CHR((int)__MOD(n, 10) + 48); n = __DIV(n, 10); i += 1; } @@ -947,18 +947,18 @@ void Files_WriteBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN x) void Files_WriteInt (Files_Rider *R, ADDRESS *R__typ, INT16 x) { CHAR b[2]; - b[0] = (CHAR)x; - b[1] = (CHAR)__ASHR(x, 8); + b[0] = __CHR(x); + b[1] = __CHR(__ASHR(x, 8)); Files_WriteBytes(&*R, R__typ, (void*)b, 2, 2); } void Files_WriteLInt (Files_Rider *R, ADDRESS *R__typ, INT32 x) { CHAR b[4]; - b[0] = (CHAR)x; - b[1] = (CHAR)__ASHR(x, 8); - b[2] = (CHAR)__ASHR(x, 16); - b[3] = (CHAR)__ASHR(x, 24); + b[0] = __CHR(x); + b[1] = __CHR(__ASHR(x, 8)); + b[2] = __CHR(__ASHR(x, 16)); + b[3] = __CHR(__ASHR(x, 24)); Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } @@ -967,10 +967,10 @@ void Files_WriteSet (Files_Rider *R, ADDRESS *R__typ, UINT32 x) CHAR b[4]; INT32 i; i = (INT32)x; - b[0] = (CHAR)i; - b[1] = (CHAR)__ASHR(i, 8); - b[2] = (CHAR)__ASHR(i, 16); - b[3] = (CHAR)__ASHR(i, 24); + b[0] = __CHR(i); + b[1] = __CHR(__ASHR(i, 8)); + b[2] = __CHR(__ASHR(i, 16)); + b[3] = __CHR(__ASHR(i, 24)); Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } @@ -1001,10 +1001,10 @@ void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, ADDRESS x__len void Files_WriteNum (Files_Rider *R, ADDRESS *R__typ, INT64 x) { while (x < -64 || x > 63) { - Files_Write(&*R, R__typ, (CHAR)(__MASK(x, -128) + 128)); + Files_Write(&*R, R__typ, __CHR(__MASK(x, -128) + 128)); x = __ASHR(x, 7); } - Files_Write(&*R, R__typ, (CHAR)__MASK(x, -128)); + Files_Write(&*R, R__typ, __CHR(__MASK(x, -128))); } void Files_GetName (Files_File f, CHAR *name, ADDRESS name__len) diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index f0e783a2..f0a69373 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index bd4ed5a8..31e05d3d 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index 8d7eb8e5..6ab10893 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index 8ae1f5fb..0e237dea 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -404,7 +404,7 @@ static void Modules_errint (INT32 l) if (l >= 10) { Modules_errint(__DIV(l, 10)); } - Modules_errch((CHAR)((int)__MOD(l, 10) + 48)); + Modules_errch(__CHR((int)__MOD(l, 10) + 48)); } static void Modules_DisplayHaltCode (INT32 code) diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index 9d10f4ac..6dc9bb50 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index d7012f3e..6f3e6970 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -261,7 +261,7 @@ static void OPB_CharToString (OPT_Node n) { CHAR ch; n->typ = OPT_stringtyp; - ch = (CHAR)n->conval->intval; + ch = __CHR(n->conval->intval); n->conval->ext = OPT_NewExt(); if (ch == 0x00) { n->conval->intval2 = 1; @@ -597,7 +597,7 @@ void OPB_MOp (INT8 op, OPT_Node *x) case 22: if (f == 3) { if (z->class == 7) { - z->conval->intval = (INT16)__CAP((CHAR)z->conval->intval); + z->conval->intval = (INT16)__CAP(__CHR(z->conval->intval)); z->obj = NIL; } else { z = NewOp__29(op, typ, z); @@ -1136,7 +1136,7 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) OPB_err(203); r = (LONGREAL)1; } - (*x)->conval->intval = (INT32)__ENTIER(r); + (*x)->conval->intval = __SHORT(__ENTIER(r), 2147483648LL); OPB_SetIntType(*x); } } diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index b82bf9ba..032091ba 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 42cd3c56..3847bab7 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -1743,7 +1743,7 @@ static void OPC_CharacterLiteral (INT64 c) if ((c == 92 || c == 39) || c == 63) { OPM_Write('\\'); } - OPM_Write((CHAR)c); + OPM_Write(__CHR(c)); OPM_Write('\''); } } @@ -1759,16 +1759,16 @@ static void OPC_StringLiteral (CHAR *s, ADDRESS s__len, INT32 l) c = (INT16)s[__X(i, s__len)]; if (c < 32 || c > 126) { OPM_Write('\\'); - OPM_Write((CHAR)(48 + __ASHR(c, 6))); + OPM_Write(__CHR(48 + __ASHR(c, 6))); c = __MASK(c, -64); - OPM_Write((CHAR)(48 + __ASHR(c, 3))); + OPM_Write(__CHR(48 + __ASHR(c, 3))); c = __MASK(c, -8); - OPM_Write((CHAR)(48 + c)); + OPM_Write(__CHR(48 + c)); } else { if ((c == 92 || c == 34) || c == 63) { OPM_Write('\\'); } - OPM_Write((CHAR)c); + OPM_Write(__CHR(c)); } i += 1; } diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index b79317f7..f1968a6b 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index e6b33367..3f9ab009 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -606,7 +606,7 @@ static void OPM_ShowLine (INT64 pos) if (pos >= (INT64)OPM_ErrorLineLimitPos) { pos = OPM_ErrorLineLimitPos - 1; } - i = (INT16)OPM_Longint(pos - (INT64)OPM_ErrorLineStartPos); + i = __SHORTF(OPM_Longint(pos - (INT64)OPM_ErrorLineStartPos), 32768); while (i > 0) { OPM_LogW(' '); i -= 1; @@ -865,17 +865,17 @@ void OPM_WriteHex (INT64 i) { CHAR s[3]; INT32 digit; - digit = __ASHR((INT32)i, 4); + digit = __ASHR(__SHORT(i, 2147483648LL), 4); if (digit < 10) { - s[0] = (CHAR)(48 + digit); + s[0] = __CHR(48 + digit); } else { - s[0] = (CHAR)(87 + digit); + s[0] = __CHR(87 + digit); } - digit = __MASK((INT32)i, -16); + digit = __MASK(__SHORT(i, 2147483648LL), -16); if (digit < 10) { - s[1] = (CHAR)(48 + digit); + s[1] = __CHR(48 + digit); } else { - s[1] = (CHAR)(87 + digit); + s[1] = __CHR(87 + digit); } s[2] = 0x00; OPM_WriteString(s, 3); @@ -897,11 +897,11 @@ void OPM_WriteInt (INT64 i) __MOVE("LL", s, 3); k = 2; } - s[__X(k, 26)] = (CHAR)(__MOD(i1, 10) + 48); + s[__X(k, 26)] = __CHR(__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k += 1; while (i1 > 0) { - s[__X(k, 26)] = (CHAR)(__MOD(i1, 10) + 48); + s[__X(k, 26)] = __CHR(__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k += 1; } @@ -924,13 +924,13 @@ void OPM_WriteReal (LONGREAL r, CHAR suffx) CHAR s[32]; CHAR ch; INT16 i; - if ((((r < OPM_SignedMaximum(OPM_LongintSize) && r > OPM_SignedMinimum(OPM_LongintSize))) && r == ((INT32)__ENTIER(r)))) { + if ((((r < OPM_SignedMaximum(OPM_LongintSize) && r > OPM_SignedMinimum(OPM_LongintSize))) && r == (__SHORT(__ENTIER(r), 2147483648LL)))) { if (suffx == 'f') { OPM_WriteString((CHAR*)"(REAL)", 7); } else { OPM_WriteString((CHAR*)"(LONGREAL)", 11); } - OPM_WriteInt((INT32)__ENTIER(r)); + OPM_WriteInt(__SHORT(__ENTIER(r), 2147483648LL)); } else { Texts_OpenWriter(&W, Texts_Writer__typ); if (suffx == 'f') { diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index 1c6ca2ac..89ae5649 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index 54a9f7c8..3c2474d3 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -634,7 +634,7 @@ static void OPP_StandProcCall (OPT_Node *x) OPT_Node y = NIL; INT8 m; INT16 n; - m = (INT8)((INT16)(*x)->obj->adr); + m = __SHORT(__SHORT((*x)->obj->adr, 32768), 128); n = 0; if (OPP_sym == 30) { OPS_Get(&OPP_sym); @@ -943,7 +943,7 @@ static void GetCode__19 (void) (*ext)[__X(n + 1, 256)] = OPS_str[__X(n, 256)]; n += 1; } - (*ext)[0] = (CHAR)n; + (*ext)[0] = __CHR(n); OPS_Get(&OPP_sym); } else { for (;;) { @@ -956,14 +956,14 @@ static void GetCode__19 (void) n = 1; } OPS_Get(&OPP_sym); - (*ext)[__X(n, 256)] = (CHAR)c; + (*ext)[__X(n, 256)] = __CHR(c); } if (OPP_sym == 19) { OPS_Get(&OPP_sym); } else if (OPP_sym == 35) { OPP_err(19); } else { - (*ext)[0] = (CHAR)n; + (*ext)[0] = __CHR(n); break; } } diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index 52242f7c..849ca32f 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index 0e42294b..523bcc40 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index 15cdcc6c..4e2c9e5d 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index bc38d46b..a60c37a0 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -352,7 +352,7 @@ void OPT_TypSize (OPT_Struct typ) } typ->size = offset; typ->align = base; - typ->sysflag = __MASK(typ->sysflag, -256) + (INT16)__ASHL(offset - off0, 8); + typ->sysflag = __MASK(typ->sysflag, -256) + __SHORT(__ASHL(offset - off0, 8), 32768); } else if (c == 2) { OPT_TypSize(typ->BaseTyp); typ->size = typ->n * typ->BaseTyp->size; @@ -1251,7 +1251,7 @@ static void OPT_InStruct (OPT_Struct *typ) obj->vis = 0; tag = OPM_SymRInt(); if (tag == 35) { - (*typ)->sysflag = (INT16)OPM_SymRInt(); + (*typ)->sysflag = __SHORTF(OPM_SymRInt(), 32768); tag = OPM_SymRInt(); } switch (tag) { @@ -1412,8 +1412,8 @@ static OPT_Object OPT_InObj (INT8 mno) obj->mode = 9; ext = OPT_NewExt(); obj->conval->ext = ext; - s = (INT16)OPM_SymRInt(); - (*ext)[0] = (CHAR)s; + s = __SHORTF(OPM_SymRInt(), 32768); + (*ext)[0] = __CHR(s); i = 1; while (i <= s) { OPM_SymRCh(&(*ext)[__X(i, 256)]); @@ -1752,7 +1752,7 @@ static void OPT_OutConstant (OPT_Object obj) OPM_SymWInt(f); switch (f) { case 2: case 3: - OPM_SymWCh((CHAR)obj->conval->intval); + OPM_SymWCh(__CHR(obj->conval->intval)); break; case 4: OPM_SymWInt(obj->conval->intval); diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index a4688654..65364b16 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index ebe18cc4..a56a7417 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -112,7 +112,7 @@ static void OPV_Stamp (OPS_Name s) i += 2; k = 0; do { - n[__X(k, 10)] = (CHAR)((int)__MOD(j, 10) + 48); + n[__X(k, 10)] = __CHR((int)__MOD(j, 10) + 48); j = __DIV(j, 10); k += 1; } while (!(j == 0)); @@ -370,6 +370,7 @@ static void OPV_SizeCast (OPT_Node n, INT32 to) OPM_WriteInt(__ASHL(to, 3)); OPM_WriteString((CHAR*)")", 2); } + OPV_Entier(n, 9); } } @@ -381,7 +382,6 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INT16 prec) if (to == 7) { if (from == 7) { OPV_SizeCast(n, newtype->size); - OPV_Entier(n, 9); } else { OPM_WriteString((CHAR*)"__SETOF(", 9); OPV_Entier(n, -1); @@ -391,7 +391,6 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INT16 prec) } } else if (to == 4) { OPV_SizeCast(n, newtype->size); - OPV_Entier(n, 9); } else if (to == 3) { if (__IN(2, OPM_Options, 32)) { OPM_WriteString((CHAR*)"__CHR", 6); diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index 05e906a7..58f9508b 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Out.c b/bootstrap/unix-44/Out.c index fc5b46c6..5bb316dd 100644 --- a/bootstrap/unix-44/Out.c +++ b/bootstrap/unix-44/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -80,7 +80,7 @@ void Out_String (CHAR *str, ADDRESS str__len) error = Platform_Write(1, (ADDRESS)str, l); } else { __MOVE((ADDRESS)str, (ADDRESS)&Out_buf[__X(Out_in, 128)], l); - Out_in += (INT16)l; + Out_in += __SHORT(l, 32768); } __DEL(str); } @@ -98,11 +98,11 @@ void Out_Int (INT64 x, INT64 n) if (x < 0) { x = -x; } - s[0] = (CHAR)(48 + __MOD(x, 10)); + s[0] = __CHR(48 + __MOD(x, 10)); x = __DIV(x, 10); i = 1; while (x != 0) { - s[__X(i, 22)] = (CHAR)(48 + __MOD(x, 10)); + s[__X(i, 22)] = __CHR(48 + __MOD(x, 10)); x = __DIV(x, 10); i += 1; } @@ -138,9 +138,9 @@ void Out_Hex (INT64 x, INT64 n) x = __ROTL(x, 4, 64); n -= 1; if (__MASK(x, -16) < 10) { - Out_Char((CHAR)(__MASK(x, -16) + 48)); + Out_Char(__CHR(__MASK(x, -16) + 48)); } else { - Out_Char((CHAR)((__MASK(x, -16) - 10) + 65)); + Out_Char(__CHR((__MASK(x, -16) - 10) + 65)); } } } @@ -154,7 +154,7 @@ void Out_Ln (void) static void Out_digit (INT64 n, CHAR *s, ADDRESS s__len, INT16 *i) { *i -= 1; - s[__X(*i, s__len)] = (CHAR)(__MOD(n, 10) + 48); + s[__X(*i, s__len)] = __CHR(__MOD(n, 10) + 48); } static void Out_prepend (CHAR *t, ADDRESS t__len, CHAR *s, ADDRESS s__len, INT16 *i) @@ -166,7 +166,7 @@ static void Out_prepend (CHAR *t, ADDRESS t__len, CHAR *s, ADDRESS s__len, INT16 if (l > *i) { l = *i; } - *i -= (INT16)l; + *i -= __SHORT(l, 32768); j = 0; while (j < l) { s[__X(*i + j, s__len)] = t[__X(j, t__len)]; @@ -248,7 +248,7 @@ static void Out_RealP (LONGREAL x, INT16 n, BOOLEAN long_) if (nn) { x = -x; } - e = (INT16)__ASHR((e - 1023) * 77, 8); + e = __SHORT(__ASHR((e - 1023) * 77, 8), 32768); if (e >= 0) { x = x / (LONGREAL)Out_Ten(e); } else { diff --git a/bootstrap/unix-44/Out.h b/bootstrap/unix-44/Out.h index 0819285a..5cc7a37c 100644 --- a/bootstrap/unix-44/Out.h +++ b/bootstrap/unix-44/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 5e716822..9b4b1656 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index 3c3d06cb..f19b815c 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 44be33b7..d0a86172 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -67,9 +67,9 @@ void Reals_SetExpo (REAL *x, INT16 ex) { CHAR c; __GET((ADDRESS)x + 3, c, CHAR); - __PUT((ADDRESS)x + 3, (CHAR)(__ASHL(__ASHR((INT16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __PUT((ADDRESS)x + 3, __CHR(__ASHL(__ASHR((INT16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); __GET((ADDRESS)x + 2, c, CHAR); - __PUT((ADDRESS)x + 2, (CHAR)(__MASK((INT16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); + __PUT((ADDRESS)x + 2, __CHR(__MASK((INT16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } INT16 Reals_ExpoL (LONGREAL x) @@ -87,21 +87,21 @@ void Reals_ConvertL (LONGREAL x, INT16 n, CHAR *d, ADDRESS d__len) } k = 0; if (n > 9) { - i = (INT32)__ENTIER(x / (LONGREAL)(LONGREAL)1000000000); - j = (INT32)__ENTIER(x - i * (LONGREAL)1000000000); + i = __SHORT(__ENTIER(x / (LONGREAL)(LONGREAL)1000000000), 2147483648LL); + j = __SHORT(__ENTIER(x - i * (LONGREAL)1000000000), 2147483648LL); if (j < 0) { j = 0; } while (k < 9) { - d[__X(k, d__len)] = (CHAR)((int)__MOD(j, 10) + 48); + d[__X(k, d__len)] = __CHR((int)__MOD(j, 10) + 48); j = __DIV(j, 10); k += 1; } } else { - i = (INT32)__ENTIER(x); + i = __SHORT(__ENTIER(x), 2147483648LL); } while (k < n) { - d[__X(k, d__len)] = (CHAR)((int)__MOD(i, 10) + 48); + d[__X(k, d__len)] = __CHR((int)__MOD(i, 10) + 48); i = __DIV(i, 10); k += 1; } @@ -115,9 +115,9 @@ void Reals_Convert (REAL x, INT16 n, CHAR *d, ADDRESS d__len) static CHAR Reals_ToHex (INT16 i) { if (i < 10) { - return (CHAR)(i + 48); + return __CHR(i + 48); } else { - return (CHAR)(i + 55); + return __CHR(i + 55); } __RETCHK; } diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index 7c2e0e35..d7d40e29 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index 6158bc92..c2deb7cf 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -34,7 +34,7 @@ INT16 Strings_Length (CHAR *s, ADDRESS s__len) } if (i <= 32767) { __DEL(s); - return (INT16)i; + return __SHORT(i, 32768); } else { __DEL(s); return 32767; @@ -126,7 +126,7 @@ void Strings_Extract (CHAR *source, ADDRESS source__len, INT16 pos, INT16 n, CHA INT16 len, destLen, i; __DUP(source, source__len, CHAR); len = Strings_Length(source, source__len); - destLen = (INT16)dest__len - 1; + destLen = __SHORT(dest__len, 32768) - 1; if (pos < 0) { pos = 0; } diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index 42b68da8..75b9b634 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index 6d66b07b..74d010d1 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -813,10 +813,10 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) if ('9' < ch) { if (('A' <= ch && ch <= 'F')) { hex = 1; - ch = (CHAR)((INT16)ch - 7); + ch = __CHR((INT16)ch - 7); } else if (('a' <= ch && ch <= 'f')) { hex = 1; - ch = (CHAR)((INT16)ch - 39); + ch = __CHR((INT16)ch - 39); } else { break; } @@ -1058,7 +1058,7 @@ void Texts_WriteInt (Texts_Writer *W, ADDRESS *W__typ, INT64 x, INT64 n) x0 = x; } do { - a[__X(i, 24)] = (CHAR)(__MOD(x0, 10) + 48); + a[__X(i, 24)] = __CHR(__MOD(x0, 10) + 48); x0 = __DIV(x0, 10); i += 1; } while (!(x0 == 0)); @@ -1085,9 +1085,9 @@ void Texts_WriteHex (Texts_Writer *W, ADDRESS *W__typ, INT32 x) do { y = __MASK(x, -16); if (y < 10) { - a[__X(i, 20)] = (CHAR)(y + 48); + a[__X(i, 20)] = __CHR(y + 48); } else { - a[__X(i, 20)] = (CHAR)(y + 55); + a[__X(i, 20)] = __CHR(y + 55); } x = __ASHR(x, 4); i += 1; @@ -1163,8 +1163,8 @@ void Texts_WriteReal (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n) } else { Texts_Write(&*W, W__typ, '+'); } - Texts_Write(&*W, W__typ, (CHAR)(__DIV(e, 10) + 48)); - Texts_Write(&*W, W__typ, (CHAR)((int)__MOD(e, 10) + 48)); + Texts_Write(&*W, W__typ, __CHR(__DIV(e, 10) + 48)); + Texts_Write(&*W, W__typ, __CHR((int)__MOD(e, 10) + 48)); } } @@ -1314,7 +1314,7 @@ void Texts_WriteLongReal (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x, INT16 n) } else { Texts_Write(&*W, W__typ, ' '); } - e = (INT16)__ASHR((e - 1023) * 77, 8); + e = __SHORT(__ASHR((e - 1023) * 77, 8), 32768); if (e >= 0) { x = x / (LONGREAL)Reals_TenL(e); } else { @@ -1345,10 +1345,10 @@ void Texts_WriteLongReal (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x, INT16 n) } else { Texts_Write(&*W, W__typ, '+'); } - Texts_Write(&*W, W__typ, (CHAR)(__DIV(e, 100) + 48)); + Texts_Write(&*W, W__typ, __CHR(__DIV(e, 100) + 48)); e = (int)__MOD(e, 100); - Texts_Write(&*W, W__typ, (CHAR)(__DIV(e, 10) + 48)); - Texts_Write(&*W, W__typ, (CHAR)((int)__MOD(e, 10) + 48)); + Texts_Write(&*W, W__typ, __CHR(__DIV(e, 10) + 48)); + Texts_Write(&*W, W__typ, __CHR((int)__MOD(e, 10) + 48)); } } @@ -1375,8 +1375,8 @@ static void WritePair__44 (CHAR ch, INT32 x); static void WritePair__44 (CHAR ch, INT32 x) { Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, ch); - Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)(__DIV(x, 10) + 48)); - Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)((int)__MOD(x, 10) + 48)); + Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, __CHR(__DIV(x, 10) + 48)); + Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, __CHR((int)__MOD(x, 10) + 48)); } void Texts_WriteDate (Texts_Writer *W, ADDRESS *W__typ, INT32 t, INT32 d) diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index c706a783..060cd98a 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/VT100.c b/bootstrap/unix-44/VT100.c index a3b0b0dd..a98729de 100644 --- a/bootstrap/unix-44/VT100.c +++ b/bootstrap/unix-44/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -74,7 +74,7 @@ void VT100_IntToStr (INT32 int_, CHAR *str, ADDRESS str__len) } e = s; do { - b[__X(e, 21)] = (CHAR)((int)__MOD(int_, 10) + 48); + b[__X(e, 21)] = __CHR((int)__MOD(int_, 10) + 48); int_ = __DIV(int_, 10); e += 1; } while (!(int_ == 0)); diff --git a/bootstrap/unix-44/VT100.h b/bootstrap/unix-44/VT100.h index e7539d2f..df99892d 100644 --- a/bootstrap/unix-44/VT100.h +++ b/bootstrap/unix-44/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index 562921ce..6a411d85 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -72,7 +72,7 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) { - __COPY("gcc -fPIC -g", s, s__len); + __COPY("gcc -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index e6dd4577..0629bd56 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/Compiler.c b/bootstrap/unix-48/Compiler.c index 9cdbb76c..3c9bd35e 100644 --- a/bootstrap/unix-48/Compiler.c +++ b/bootstrap/unix-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index 3ab08d40..50c02bb9 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index 7db28b57..d85d80f6 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 867c33a4..8f2c5d55 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -206,7 +206,7 @@ static void Files_GetTempName (CHAR *finalName, ADDRESS finalName__len, CHAR *na name[__X(i + 5, name__len)] = '.'; i += 6; while (n > 0) { - name[__X(i, name__len)] = (CHAR)((int)__MOD(n, 10) + 48); + name[__X(i, name__len)] = __CHR((int)__MOD(n, 10) + 48); n = __DIV(n, 10); i += 1; } @@ -214,7 +214,7 @@ static void Files_GetTempName (CHAR *finalName, ADDRESS finalName__len, CHAR *na i += 1; n = Platform_PID; while (n > 0) { - name[__X(i, name__len)] = (CHAR)((int)__MOD(n, 10) + 48); + name[__X(i, name__len)] = __CHR((int)__MOD(n, 10) + 48); n = __DIV(n, 10); i += 1; } @@ -947,18 +947,18 @@ void Files_WriteBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN x) void Files_WriteInt (Files_Rider *R, ADDRESS *R__typ, INT16 x) { CHAR b[2]; - b[0] = (CHAR)x; - b[1] = (CHAR)__ASHR(x, 8); + b[0] = __CHR(x); + b[1] = __CHR(__ASHR(x, 8)); Files_WriteBytes(&*R, R__typ, (void*)b, 2, 2); } void Files_WriteLInt (Files_Rider *R, ADDRESS *R__typ, INT32 x) { CHAR b[4]; - b[0] = (CHAR)x; - b[1] = (CHAR)__ASHR(x, 8); - b[2] = (CHAR)__ASHR(x, 16); - b[3] = (CHAR)__ASHR(x, 24); + b[0] = __CHR(x); + b[1] = __CHR(__ASHR(x, 8)); + b[2] = __CHR(__ASHR(x, 16)); + b[3] = __CHR(__ASHR(x, 24)); Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } @@ -967,10 +967,10 @@ void Files_WriteSet (Files_Rider *R, ADDRESS *R__typ, UINT32 x) CHAR b[4]; INT32 i; i = (INT32)x; - b[0] = (CHAR)i; - b[1] = (CHAR)__ASHR(i, 8); - b[2] = (CHAR)__ASHR(i, 16); - b[3] = (CHAR)__ASHR(i, 24); + b[0] = __CHR(i); + b[1] = __CHR(__ASHR(i, 8)); + b[2] = __CHR(__ASHR(i, 16)); + b[3] = __CHR(__ASHR(i, 24)); Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } @@ -1001,10 +1001,10 @@ void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, ADDRESS x__len void Files_WriteNum (Files_Rider *R, ADDRESS *R__typ, INT64 x) { while (x < -64 || x > 63) { - Files_Write(&*R, R__typ, (CHAR)(__MASK(x, -128) + 128)); + Files_Write(&*R, R__typ, __CHR(__MASK(x, -128) + 128)); x = __ASHR(x, 7); } - Files_Write(&*R, R__typ, (CHAR)__MASK(x, -128)); + Files_Write(&*R, R__typ, __CHR(__MASK(x, -128))); } void Files_GetName (Files_File f, CHAR *name, ADDRESS name__len) diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index f0e783a2..f0a69373 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index bd4ed5a8..31e05d3d 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index 8d7eb8e5..6ab10893 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index 8ae1f5fb..0e237dea 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -404,7 +404,7 @@ static void Modules_errint (INT32 l) if (l >= 10) { Modules_errint(__DIV(l, 10)); } - Modules_errch((CHAR)((int)__MOD(l, 10) + 48)); + Modules_errch(__CHR((int)__MOD(l, 10) + 48)); } static void Modules_DisplayHaltCode (INT32 code) diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index 9d10f4ac..6dc9bb50 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index d7012f3e..6f3e6970 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -261,7 +261,7 @@ static void OPB_CharToString (OPT_Node n) { CHAR ch; n->typ = OPT_stringtyp; - ch = (CHAR)n->conval->intval; + ch = __CHR(n->conval->intval); n->conval->ext = OPT_NewExt(); if (ch == 0x00) { n->conval->intval2 = 1; @@ -597,7 +597,7 @@ void OPB_MOp (INT8 op, OPT_Node *x) case 22: if (f == 3) { if (z->class == 7) { - z->conval->intval = (INT16)__CAP((CHAR)z->conval->intval); + z->conval->intval = (INT16)__CAP(__CHR(z->conval->intval)); z->obj = NIL; } else { z = NewOp__29(op, typ, z); @@ -1136,7 +1136,7 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) OPB_err(203); r = (LONGREAL)1; } - (*x)->conval->intval = (INT32)__ENTIER(r); + (*x)->conval->intval = __SHORT(__ENTIER(r), 2147483648LL); OPB_SetIntType(*x); } } diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index b82bf9ba..032091ba 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 42cd3c56..3847bab7 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -1743,7 +1743,7 @@ static void OPC_CharacterLiteral (INT64 c) if ((c == 92 || c == 39) || c == 63) { OPM_Write('\\'); } - OPM_Write((CHAR)c); + OPM_Write(__CHR(c)); OPM_Write('\''); } } @@ -1759,16 +1759,16 @@ static void OPC_StringLiteral (CHAR *s, ADDRESS s__len, INT32 l) c = (INT16)s[__X(i, s__len)]; if (c < 32 || c > 126) { OPM_Write('\\'); - OPM_Write((CHAR)(48 + __ASHR(c, 6))); + OPM_Write(__CHR(48 + __ASHR(c, 6))); c = __MASK(c, -64); - OPM_Write((CHAR)(48 + __ASHR(c, 3))); + OPM_Write(__CHR(48 + __ASHR(c, 3))); c = __MASK(c, -8); - OPM_Write((CHAR)(48 + c)); + OPM_Write(__CHR(48 + c)); } else { if ((c == 92 || c == 34) || c == 63) { OPM_Write('\\'); } - OPM_Write((CHAR)c); + OPM_Write(__CHR(c)); } i += 1; } diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index b79317f7..f1968a6b 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index e6b33367..3f9ab009 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -606,7 +606,7 @@ static void OPM_ShowLine (INT64 pos) if (pos >= (INT64)OPM_ErrorLineLimitPos) { pos = OPM_ErrorLineLimitPos - 1; } - i = (INT16)OPM_Longint(pos - (INT64)OPM_ErrorLineStartPos); + i = __SHORTF(OPM_Longint(pos - (INT64)OPM_ErrorLineStartPos), 32768); while (i > 0) { OPM_LogW(' '); i -= 1; @@ -865,17 +865,17 @@ void OPM_WriteHex (INT64 i) { CHAR s[3]; INT32 digit; - digit = __ASHR((INT32)i, 4); + digit = __ASHR(__SHORT(i, 2147483648LL), 4); if (digit < 10) { - s[0] = (CHAR)(48 + digit); + s[0] = __CHR(48 + digit); } else { - s[0] = (CHAR)(87 + digit); + s[0] = __CHR(87 + digit); } - digit = __MASK((INT32)i, -16); + digit = __MASK(__SHORT(i, 2147483648LL), -16); if (digit < 10) { - s[1] = (CHAR)(48 + digit); + s[1] = __CHR(48 + digit); } else { - s[1] = (CHAR)(87 + digit); + s[1] = __CHR(87 + digit); } s[2] = 0x00; OPM_WriteString(s, 3); @@ -897,11 +897,11 @@ void OPM_WriteInt (INT64 i) __MOVE("LL", s, 3); k = 2; } - s[__X(k, 26)] = (CHAR)(__MOD(i1, 10) + 48); + s[__X(k, 26)] = __CHR(__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k += 1; while (i1 > 0) { - s[__X(k, 26)] = (CHAR)(__MOD(i1, 10) + 48); + s[__X(k, 26)] = __CHR(__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k += 1; } @@ -924,13 +924,13 @@ void OPM_WriteReal (LONGREAL r, CHAR suffx) CHAR s[32]; CHAR ch; INT16 i; - if ((((r < OPM_SignedMaximum(OPM_LongintSize) && r > OPM_SignedMinimum(OPM_LongintSize))) && r == ((INT32)__ENTIER(r)))) { + if ((((r < OPM_SignedMaximum(OPM_LongintSize) && r > OPM_SignedMinimum(OPM_LongintSize))) && r == (__SHORT(__ENTIER(r), 2147483648LL)))) { if (suffx == 'f') { OPM_WriteString((CHAR*)"(REAL)", 7); } else { OPM_WriteString((CHAR*)"(LONGREAL)", 11); } - OPM_WriteInt((INT32)__ENTIER(r)); + OPM_WriteInt(__SHORT(__ENTIER(r), 2147483648LL)); } else { Texts_OpenWriter(&W, Texts_Writer__typ); if (suffx == 'f') { diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index 1c6ca2ac..89ae5649 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index 54a9f7c8..3c2474d3 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -634,7 +634,7 @@ static void OPP_StandProcCall (OPT_Node *x) OPT_Node y = NIL; INT8 m; INT16 n; - m = (INT8)((INT16)(*x)->obj->adr); + m = __SHORT(__SHORT((*x)->obj->adr, 32768), 128); n = 0; if (OPP_sym == 30) { OPS_Get(&OPP_sym); @@ -943,7 +943,7 @@ static void GetCode__19 (void) (*ext)[__X(n + 1, 256)] = OPS_str[__X(n, 256)]; n += 1; } - (*ext)[0] = (CHAR)n; + (*ext)[0] = __CHR(n); OPS_Get(&OPP_sym); } else { for (;;) { @@ -956,14 +956,14 @@ static void GetCode__19 (void) n = 1; } OPS_Get(&OPP_sym); - (*ext)[__X(n, 256)] = (CHAR)c; + (*ext)[__X(n, 256)] = __CHR(c); } if (OPP_sym == 19) { OPS_Get(&OPP_sym); } else if (OPP_sym == 35) { OPP_err(19); } else { - (*ext)[0] = (CHAR)n; + (*ext)[0] = __CHR(n); break; } } diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index 52242f7c..849ca32f 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index 0e42294b..523bcc40 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index 15cdcc6c..4e2c9e5d 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 1897f024..1bf52545 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -352,7 +352,7 @@ void OPT_TypSize (OPT_Struct typ) } typ->size = offset; typ->align = base; - typ->sysflag = __MASK(typ->sysflag, -256) + (INT16)__ASHL(offset - off0, 8); + typ->sysflag = __MASK(typ->sysflag, -256) + __SHORT(__ASHL(offset - off0, 8), 32768); } else if (c == 2) { OPT_TypSize(typ->BaseTyp); typ->size = typ->n * typ->BaseTyp->size; @@ -1251,7 +1251,7 @@ static void OPT_InStruct (OPT_Struct *typ) obj->vis = 0; tag = OPM_SymRInt(); if (tag == 35) { - (*typ)->sysflag = (INT16)OPM_SymRInt(); + (*typ)->sysflag = __SHORTF(OPM_SymRInt(), 32768); tag = OPM_SymRInt(); } switch (tag) { @@ -1412,8 +1412,8 @@ static OPT_Object OPT_InObj (INT8 mno) obj->mode = 9; ext = OPT_NewExt(); obj->conval->ext = ext; - s = (INT16)OPM_SymRInt(); - (*ext)[0] = (CHAR)s; + s = __SHORTF(OPM_SymRInt(), 32768); + (*ext)[0] = __CHR(s); i = 1; while (i <= s) { OPM_SymRCh(&(*ext)[__X(i, 256)]); @@ -1752,7 +1752,7 @@ static void OPT_OutConstant (OPT_Object obj) OPM_SymWInt(f); switch (f) { case 2: case 3: - OPM_SymWCh((CHAR)obj->conval->intval); + OPM_SymWCh(__CHR(obj->conval->intval)); break; case 4: OPM_SymWInt(obj->conval->intval); diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index a4688654..65364b16 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index ebe18cc4..a56a7417 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -112,7 +112,7 @@ static void OPV_Stamp (OPS_Name s) i += 2; k = 0; do { - n[__X(k, 10)] = (CHAR)((int)__MOD(j, 10) + 48); + n[__X(k, 10)] = __CHR((int)__MOD(j, 10) + 48); j = __DIV(j, 10); k += 1; } while (!(j == 0)); @@ -370,6 +370,7 @@ static void OPV_SizeCast (OPT_Node n, INT32 to) OPM_WriteInt(__ASHL(to, 3)); OPM_WriteString((CHAR*)")", 2); } + OPV_Entier(n, 9); } } @@ -381,7 +382,6 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INT16 prec) if (to == 7) { if (from == 7) { OPV_SizeCast(n, newtype->size); - OPV_Entier(n, 9); } else { OPM_WriteString((CHAR*)"__SETOF(", 9); OPV_Entier(n, -1); @@ -391,7 +391,6 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INT16 prec) } } else if (to == 4) { OPV_SizeCast(n, newtype->size); - OPV_Entier(n, 9); } else if (to == 3) { if (__IN(2, OPM_Options, 32)) { OPM_WriteString((CHAR*)"__CHR", 6); diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index 05e906a7..58f9508b 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Out.c b/bootstrap/unix-48/Out.c index fc5b46c6..5bb316dd 100644 --- a/bootstrap/unix-48/Out.c +++ b/bootstrap/unix-48/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -80,7 +80,7 @@ void Out_String (CHAR *str, ADDRESS str__len) error = Platform_Write(1, (ADDRESS)str, l); } else { __MOVE((ADDRESS)str, (ADDRESS)&Out_buf[__X(Out_in, 128)], l); - Out_in += (INT16)l; + Out_in += __SHORT(l, 32768); } __DEL(str); } @@ -98,11 +98,11 @@ void Out_Int (INT64 x, INT64 n) if (x < 0) { x = -x; } - s[0] = (CHAR)(48 + __MOD(x, 10)); + s[0] = __CHR(48 + __MOD(x, 10)); x = __DIV(x, 10); i = 1; while (x != 0) { - s[__X(i, 22)] = (CHAR)(48 + __MOD(x, 10)); + s[__X(i, 22)] = __CHR(48 + __MOD(x, 10)); x = __DIV(x, 10); i += 1; } @@ -138,9 +138,9 @@ void Out_Hex (INT64 x, INT64 n) x = __ROTL(x, 4, 64); n -= 1; if (__MASK(x, -16) < 10) { - Out_Char((CHAR)(__MASK(x, -16) + 48)); + Out_Char(__CHR(__MASK(x, -16) + 48)); } else { - Out_Char((CHAR)((__MASK(x, -16) - 10) + 65)); + Out_Char(__CHR((__MASK(x, -16) - 10) + 65)); } } } @@ -154,7 +154,7 @@ void Out_Ln (void) static void Out_digit (INT64 n, CHAR *s, ADDRESS s__len, INT16 *i) { *i -= 1; - s[__X(*i, s__len)] = (CHAR)(__MOD(n, 10) + 48); + s[__X(*i, s__len)] = __CHR(__MOD(n, 10) + 48); } static void Out_prepend (CHAR *t, ADDRESS t__len, CHAR *s, ADDRESS s__len, INT16 *i) @@ -166,7 +166,7 @@ static void Out_prepend (CHAR *t, ADDRESS t__len, CHAR *s, ADDRESS s__len, INT16 if (l > *i) { l = *i; } - *i -= (INT16)l; + *i -= __SHORT(l, 32768); j = 0; while (j < l) { s[__X(*i + j, s__len)] = t[__X(j, t__len)]; @@ -248,7 +248,7 @@ static void Out_RealP (LONGREAL x, INT16 n, BOOLEAN long_) if (nn) { x = -x; } - e = (INT16)__ASHR((e - 1023) * 77, 8); + e = __SHORT(__ASHR((e - 1023) * 77, 8), 32768); if (e >= 0) { x = x / (LONGREAL)Out_Ten(e); } else { diff --git a/bootstrap/unix-48/Out.h b/bootstrap/unix-48/Out.h index 0819285a..5cc7a37c 100644 --- a/bootstrap/unix-48/Out.h +++ b/bootstrap/unix-48/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 5e716822..9b4b1656 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index 3c3d06cb..f19b815c 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 44be33b7..d0a86172 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -67,9 +67,9 @@ void Reals_SetExpo (REAL *x, INT16 ex) { CHAR c; __GET((ADDRESS)x + 3, c, CHAR); - __PUT((ADDRESS)x + 3, (CHAR)(__ASHL(__ASHR((INT16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __PUT((ADDRESS)x + 3, __CHR(__ASHL(__ASHR((INT16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); __GET((ADDRESS)x + 2, c, CHAR); - __PUT((ADDRESS)x + 2, (CHAR)(__MASK((INT16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); + __PUT((ADDRESS)x + 2, __CHR(__MASK((INT16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } INT16 Reals_ExpoL (LONGREAL x) @@ -87,21 +87,21 @@ void Reals_ConvertL (LONGREAL x, INT16 n, CHAR *d, ADDRESS d__len) } k = 0; if (n > 9) { - i = (INT32)__ENTIER(x / (LONGREAL)(LONGREAL)1000000000); - j = (INT32)__ENTIER(x - i * (LONGREAL)1000000000); + i = __SHORT(__ENTIER(x / (LONGREAL)(LONGREAL)1000000000), 2147483648LL); + j = __SHORT(__ENTIER(x - i * (LONGREAL)1000000000), 2147483648LL); if (j < 0) { j = 0; } while (k < 9) { - d[__X(k, d__len)] = (CHAR)((int)__MOD(j, 10) + 48); + d[__X(k, d__len)] = __CHR((int)__MOD(j, 10) + 48); j = __DIV(j, 10); k += 1; } } else { - i = (INT32)__ENTIER(x); + i = __SHORT(__ENTIER(x), 2147483648LL); } while (k < n) { - d[__X(k, d__len)] = (CHAR)((int)__MOD(i, 10) + 48); + d[__X(k, d__len)] = __CHR((int)__MOD(i, 10) + 48); i = __DIV(i, 10); k += 1; } @@ -115,9 +115,9 @@ void Reals_Convert (REAL x, INT16 n, CHAR *d, ADDRESS d__len) static CHAR Reals_ToHex (INT16 i) { if (i < 10) { - return (CHAR)(i + 48); + return __CHR(i + 48); } else { - return (CHAR)(i + 55); + return __CHR(i + 55); } __RETCHK; } diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index 7c2e0e35..d7d40e29 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index 6158bc92..c2deb7cf 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -34,7 +34,7 @@ INT16 Strings_Length (CHAR *s, ADDRESS s__len) } if (i <= 32767) { __DEL(s); - return (INT16)i; + return __SHORT(i, 32768); } else { __DEL(s); return 32767; @@ -126,7 +126,7 @@ void Strings_Extract (CHAR *source, ADDRESS source__len, INT16 pos, INT16 n, CHA INT16 len, destLen, i; __DUP(source, source__len, CHAR); len = Strings_Length(source, source__len); - destLen = (INT16)dest__len - 1; + destLen = __SHORT(dest__len, 32768) - 1; if (pos < 0) { pos = 0; } diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index 42b68da8..75b9b634 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index 2726593a..8096bc1d 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -813,10 +813,10 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) if ('9' < ch) { if (('A' <= ch && ch <= 'F')) { hex = 1; - ch = (CHAR)((INT16)ch - 7); + ch = __CHR((INT16)ch - 7); } else if (('a' <= ch && ch <= 'f')) { hex = 1; - ch = (CHAR)((INT16)ch - 39); + ch = __CHR((INT16)ch - 39); } else { break; } @@ -1058,7 +1058,7 @@ void Texts_WriteInt (Texts_Writer *W, ADDRESS *W__typ, INT64 x, INT64 n) x0 = x; } do { - a[__X(i, 24)] = (CHAR)(__MOD(x0, 10) + 48); + a[__X(i, 24)] = __CHR(__MOD(x0, 10) + 48); x0 = __DIV(x0, 10); i += 1; } while (!(x0 == 0)); @@ -1085,9 +1085,9 @@ void Texts_WriteHex (Texts_Writer *W, ADDRESS *W__typ, INT32 x) do { y = __MASK(x, -16); if (y < 10) { - a[__X(i, 20)] = (CHAR)(y + 48); + a[__X(i, 20)] = __CHR(y + 48); } else { - a[__X(i, 20)] = (CHAR)(y + 55); + a[__X(i, 20)] = __CHR(y + 55); } x = __ASHR(x, 4); i += 1; @@ -1163,8 +1163,8 @@ void Texts_WriteReal (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n) } else { Texts_Write(&*W, W__typ, '+'); } - Texts_Write(&*W, W__typ, (CHAR)(__DIV(e, 10) + 48)); - Texts_Write(&*W, W__typ, (CHAR)((int)__MOD(e, 10) + 48)); + Texts_Write(&*W, W__typ, __CHR(__DIV(e, 10) + 48)); + Texts_Write(&*W, W__typ, __CHR((int)__MOD(e, 10) + 48)); } } @@ -1314,7 +1314,7 @@ void Texts_WriteLongReal (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x, INT16 n) } else { Texts_Write(&*W, W__typ, ' '); } - e = (INT16)__ASHR((e - 1023) * 77, 8); + e = __SHORT(__ASHR((e - 1023) * 77, 8), 32768); if (e >= 0) { x = x / (LONGREAL)Reals_TenL(e); } else { @@ -1345,10 +1345,10 @@ void Texts_WriteLongReal (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x, INT16 n) } else { Texts_Write(&*W, W__typ, '+'); } - Texts_Write(&*W, W__typ, (CHAR)(__DIV(e, 100) + 48)); + Texts_Write(&*W, W__typ, __CHR(__DIV(e, 100) + 48)); e = (int)__MOD(e, 100); - Texts_Write(&*W, W__typ, (CHAR)(__DIV(e, 10) + 48)); - Texts_Write(&*W, W__typ, (CHAR)((int)__MOD(e, 10) + 48)); + Texts_Write(&*W, W__typ, __CHR(__DIV(e, 10) + 48)); + Texts_Write(&*W, W__typ, __CHR((int)__MOD(e, 10) + 48)); } } @@ -1375,8 +1375,8 @@ static void WritePair__44 (CHAR ch, INT32 x); static void WritePair__44 (CHAR ch, INT32 x) { Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, ch); - Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)(__DIV(x, 10) + 48)); - Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)((int)__MOD(x, 10) + 48)); + Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, __CHR(__DIV(x, 10) + 48)); + Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, __CHR((int)__MOD(x, 10) + 48)); } void Texts_WriteDate (Texts_Writer *W, ADDRESS *W__typ, INT32 t, INT32 d) diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index 714d9ac5..f7b5d487 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/VT100.c b/bootstrap/unix-48/VT100.c index a3b0b0dd..a98729de 100644 --- a/bootstrap/unix-48/VT100.c +++ b/bootstrap/unix-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -74,7 +74,7 @@ void VT100_IntToStr (INT32 int_, CHAR *str, ADDRESS str__len) } e = s; do { - b[__X(e, 21)] = (CHAR)((int)__MOD(int_, 10) + 48); + b[__X(e, 21)] = __CHR((int)__MOD(int_, 10) + 48); int_ = __DIV(int_, 10); e += 1; } while (!(int_ == 0)); diff --git a/bootstrap/unix-48/VT100.h b/bootstrap/unix-48/VT100.h index e7539d2f..df99892d 100644 --- a/bootstrap/unix-48/VT100.h +++ b/bootstrap/unix-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index 562921ce..6a411d85 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -72,7 +72,7 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) { - __COPY("gcc -fPIC -g", s, s__len); + __COPY("gcc -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index e6dd4577..0629bd56 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/Compiler.c b/bootstrap/unix-88/Compiler.c index 9cdbb76c..3c9bd35e 100644 --- a/bootstrap/unix-88/Compiler.c +++ b/bootstrap/unix-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index 3ab08d40..50c02bb9 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index 7db28b57..d85d80f6 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index dd5e8a22..9b17254c 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -206,7 +206,7 @@ static void Files_GetTempName (CHAR *finalName, ADDRESS finalName__len, CHAR *na name[__X(i + 5, name__len)] = '.'; i += 6; while (n > 0) { - name[__X(i, name__len)] = (CHAR)((int)__MOD(n, 10) + 48); + name[__X(i, name__len)] = __CHR((int)__MOD(n, 10) + 48); n = __DIV(n, 10); i += 1; } @@ -214,7 +214,7 @@ static void Files_GetTempName (CHAR *finalName, ADDRESS finalName__len, CHAR *na i += 1; n = Platform_PID; while (n > 0) { - name[__X(i, name__len)] = (CHAR)((int)__MOD(n, 10) + 48); + name[__X(i, name__len)] = __CHR((int)__MOD(n, 10) + 48); n = __DIV(n, 10); i += 1; } @@ -947,18 +947,18 @@ void Files_WriteBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN x) void Files_WriteInt (Files_Rider *R, ADDRESS *R__typ, INT16 x) { CHAR b[2]; - b[0] = (CHAR)x; - b[1] = (CHAR)__ASHR(x, 8); + b[0] = __CHR(x); + b[1] = __CHR(__ASHR(x, 8)); Files_WriteBytes(&*R, R__typ, (void*)b, 2, 2); } void Files_WriteLInt (Files_Rider *R, ADDRESS *R__typ, INT32 x) { CHAR b[4]; - b[0] = (CHAR)x; - b[1] = (CHAR)__ASHR(x, 8); - b[2] = (CHAR)__ASHR(x, 16); - b[3] = (CHAR)__ASHR(x, 24); + b[0] = __CHR(x); + b[1] = __CHR(__ASHR(x, 8)); + b[2] = __CHR(__ASHR(x, 16)); + b[3] = __CHR(__ASHR(x, 24)); Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } @@ -967,10 +967,10 @@ void Files_WriteSet (Files_Rider *R, ADDRESS *R__typ, UINT32 x) CHAR b[4]; INT32 i; i = (INT32)x; - b[0] = (CHAR)i; - b[1] = (CHAR)__ASHR(i, 8); - b[2] = (CHAR)__ASHR(i, 16); - b[3] = (CHAR)__ASHR(i, 24); + b[0] = __CHR(i); + b[1] = __CHR(__ASHR(i, 8)); + b[2] = __CHR(__ASHR(i, 16)); + b[3] = __CHR(__ASHR(i, 24)); Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } @@ -1001,10 +1001,10 @@ void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, ADDRESS x__len void Files_WriteNum (Files_Rider *R, ADDRESS *R__typ, INT64 x) { while (x < -64 || x > 63) { - Files_Write(&*R, R__typ, (CHAR)(__MASK(x, -128) + 128)); + Files_Write(&*R, R__typ, __CHR(__MASK(x, -128) + 128)); x = __ASHR(x, 7); } - Files_Write(&*R, R__typ, (CHAR)__MASK(x, -128)); + Files_Write(&*R, R__typ, __CHR(__MASK(x, -128))); } void Files_GetName (Files_File f, CHAR *name, ADDRESS name__len) diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index f74b89a5..441c4007 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index eb19a612..9e3f5ae9 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index ab574eed..5db19e82 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 3c88874e..b0840e01 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -404,7 +404,7 @@ static void Modules_errint (INT32 l) if (l >= 10) { Modules_errint(__DIV(l, 10)); } - Modules_errch((CHAR)((int)__MOD(l, 10) + 48)); + Modules_errch(__CHR((int)__MOD(l, 10) + 48)); } static void Modules_DisplayHaltCode (INT32 code) diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index 3f97dc19..be398042 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index d7012f3e..6f3e6970 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -261,7 +261,7 @@ static void OPB_CharToString (OPT_Node n) { CHAR ch; n->typ = OPT_stringtyp; - ch = (CHAR)n->conval->intval; + ch = __CHR(n->conval->intval); n->conval->ext = OPT_NewExt(); if (ch == 0x00) { n->conval->intval2 = 1; @@ -597,7 +597,7 @@ void OPB_MOp (INT8 op, OPT_Node *x) case 22: if (f == 3) { if (z->class == 7) { - z->conval->intval = (INT16)__CAP((CHAR)z->conval->intval); + z->conval->intval = (INT16)__CAP(__CHR(z->conval->intval)); z->obj = NIL; } else { z = NewOp__29(op, typ, z); @@ -1136,7 +1136,7 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) OPB_err(203); r = (LONGREAL)1; } - (*x)->conval->intval = (INT32)__ENTIER(r); + (*x)->conval->intval = __SHORT(__ENTIER(r), 2147483648LL); OPB_SetIntType(*x); } } diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index b82bf9ba..032091ba 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index 42cd3c56..3847bab7 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -1743,7 +1743,7 @@ static void OPC_CharacterLiteral (INT64 c) if ((c == 92 || c == 39) || c == 63) { OPM_Write('\\'); } - OPM_Write((CHAR)c); + OPM_Write(__CHR(c)); OPM_Write('\''); } } @@ -1759,16 +1759,16 @@ static void OPC_StringLiteral (CHAR *s, ADDRESS s__len, INT32 l) c = (INT16)s[__X(i, s__len)]; if (c < 32 || c > 126) { OPM_Write('\\'); - OPM_Write((CHAR)(48 + __ASHR(c, 6))); + OPM_Write(__CHR(48 + __ASHR(c, 6))); c = __MASK(c, -64); - OPM_Write((CHAR)(48 + __ASHR(c, 3))); + OPM_Write(__CHR(48 + __ASHR(c, 3))); c = __MASK(c, -8); - OPM_Write((CHAR)(48 + c)); + OPM_Write(__CHR(48 + c)); } else { if ((c == 92 || c == 34) || c == 63) { OPM_Write('\\'); } - OPM_Write((CHAR)c); + OPM_Write(__CHR(c)); } i += 1; } diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index b79317f7..f1968a6b 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 28e1ec4b..7079d9d3 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -606,7 +606,7 @@ static void OPM_ShowLine (INT64 pos) if (pos >= (INT64)OPM_ErrorLineLimitPos) { pos = OPM_ErrorLineLimitPos - 1; } - i = (INT16)OPM_Longint(pos - (INT64)OPM_ErrorLineStartPos); + i = __SHORTF(OPM_Longint(pos - (INT64)OPM_ErrorLineStartPos), 32768); while (i > 0) { OPM_LogW(' '); i -= 1; @@ -865,17 +865,17 @@ void OPM_WriteHex (INT64 i) { CHAR s[3]; INT32 digit; - digit = __ASHR((INT32)i, 4); + digit = __ASHR(__SHORT(i, 2147483648LL), 4); if (digit < 10) { - s[0] = (CHAR)(48 + digit); + s[0] = __CHR(48 + digit); } else { - s[0] = (CHAR)(87 + digit); + s[0] = __CHR(87 + digit); } - digit = __MASK((INT32)i, -16); + digit = __MASK(__SHORT(i, 2147483648LL), -16); if (digit < 10) { - s[1] = (CHAR)(48 + digit); + s[1] = __CHR(48 + digit); } else { - s[1] = (CHAR)(87 + digit); + s[1] = __CHR(87 + digit); } s[2] = 0x00; OPM_WriteString(s, 3); @@ -897,11 +897,11 @@ void OPM_WriteInt (INT64 i) __MOVE("LL", s, 3); k = 2; } - s[__X(k, 26)] = (CHAR)(__MOD(i1, 10) + 48); + s[__X(k, 26)] = __CHR(__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k += 1; while (i1 > 0) { - s[__X(k, 26)] = (CHAR)(__MOD(i1, 10) + 48); + s[__X(k, 26)] = __CHR(__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k += 1; } @@ -924,13 +924,13 @@ void OPM_WriteReal (LONGREAL r, CHAR suffx) CHAR s[32]; CHAR ch; INT16 i; - if ((((r < OPM_SignedMaximum(OPM_LongintSize) && r > OPM_SignedMinimum(OPM_LongintSize))) && r == ((INT32)__ENTIER(r)))) { + if ((((r < OPM_SignedMaximum(OPM_LongintSize) && r > OPM_SignedMinimum(OPM_LongintSize))) && r == (__SHORT(__ENTIER(r), 2147483648LL)))) { if (suffx == 'f') { OPM_WriteString((CHAR*)"(REAL)", 7); } else { OPM_WriteString((CHAR*)"(LONGREAL)", 11); } - OPM_WriteInt((INT32)__ENTIER(r)); + OPM_WriteInt(__SHORT(__ENTIER(r), 2147483648LL)); } else { Texts_OpenWriter(&W, Texts_Writer__typ); if (suffx == 'f') { diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index 1c6ca2ac..89ae5649 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index 7508ac7a..bfbc425e 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -634,7 +634,7 @@ static void OPP_StandProcCall (OPT_Node *x) OPT_Node y = NIL; INT8 m; INT16 n; - m = (INT8)((INT16)(*x)->obj->adr); + m = __SHORT(__SHORT((*x)->obj->adr, 32768), 128); n = 0; if (OPP_sym == 30) { OPS_Get(&OPP_sym); @@ -943,7 +943,7 @@ static void GetCode__19 (void) (*ext)[__X(n + 1, 256)] = OPS_str[__X(n, 256)]; n += 1; } - (*ext)[0] = (CHAR)n; + (*ext)[0] = __CHR(n); OPS_Get(&OPP_sym); } else { for (;;) { @@ -956,14 +956,14 @@ static void GetCode__19 (void) n = 1; } OPS_Get(&OPP_sym); - (*ext)[__X(n, 256)] = (CHAR)c; + (*ext)[__X(n, 256)] = __CHR(c); } if (OPP_sym == 19) { OPS_Get(&OPP_sym); } else if (OPP_sym == 35) { OPP_err(19); } else { - (*ext)[0] = (CHAR)n; + (*ext)[0] = __CHR(n); break; } } diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index 52242f7c..849ca32f 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index 0e42294b..523bcc40 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index 15cdcc6c..4e2c9e5d 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index 57dfaa59..fe093273 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -352,7 +352,7 @@ void OPT_TypSize (OPT_Struct typ) } typ->size = offset; typ->align = base; - typ->sysflag = __MASK(typ->sysflag, -256) + (INT16)__ASHL(offset - off0, 8); + typ->sysflag = __MASK(typ->sysflag, -256) + __SHORT(__ASHL(offset - off0, 8), 32768); } else if (c == 2) { OPT_TypSize(typ->BaseTyp); typ->size = typ->n * typ->BaseTyp->size; @@ -1251,7 +1251,7 @@ static void OPT_InStruct (OPT_Struct *typ) obj->vis = 0; tag = OPM_SymRInt(); if (tag == 35) { - (*typ)->sysflag = (INT16)OPM_SymRInt(); + (*typ)->sysflag = __SHORTF(OPM_SymRInt(), 32768); tag = OPM_SymRInt(); } switch (tag) { @@ -1412,8 +1412,8 @@ static OPT_Object OPT_InObj (INT8 mno) obj->mode = 9; ext = OPT_NewExt(); obj->conval->ext = ext; - s = (INT16)OPM_SymRInt(); - (*ext)[0] = (CHAR)s; + s = __SHORTF(OPM_SymRInt(), 32768); + (*ext)[0] = __CHR(s); i = 1; while (i <= s) { OPM_SymRCh(&(*ext)[__X(i, 256)]); @@ -1752,7 +1752,7 @@ static void OPT_OutConstant (OPT_Object obj) OPM_SymWInt(f); switch (f) { case 2: case 3: - OPM_SymWCh((CHAR)obj->conval->intval); + OPM_SymWCh(__CHR(obj->conval->intval)); break; case 4: OPM_SymWInt(obj->conval->intval); diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index a4688654..65364b16 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index bad459b6..777dee8c 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -112,7 +112,7 @@ static void OPV_Stamp (OPS_Name s) i += 2; k = 0; do { - n[__X(k, 10)] = (CHAR)((int)__MOD(j, 10) + 48); + n[__X(k, 10)] = __CHR((int)__MOD(j, 10) + 48); j = __DIV(j, 10); k += 1; } while (!(j == 0)); @@ -370,6 +370,7 @@ static void OPV_SizeCast (OPT_Node n, INT32 to) OPM_WriteInt(__ASHL(to, 3)); OPM_WriteString((CHAR*)")", 2); } + OPV_Entier(n, 9); } } @@ -381,7 +382,6 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INT16 prec) if (to == 7) { if (from == 7) { OPV_SizeCast(n, newtype->size); - OPV_Entier(n, 9); } else { OPM_WriteString((CHAR*)"__SETOF(", 9); OPV_Entier(n, -1); @@ -391,7 +391,6 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INT16 prec) } } else if (to == 4) { OPV_SizeCast(n, newtype->size); - OPV_Entier(n, 9); } else if (to == 3) { if (__IN(2, OPM_Options, 32)) { OPM_WriteString((CHAR*)"__CHR", 6); diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index 05e906a7..58f9508b 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Out.c b/bootstrap/unix-88/Out.c index fc5b46c6..5bb316dd 100644 --- a/bootstrap/unix-88/Out.c +++ b/bootstrap/unix-88/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -80,7 +80,7 @@ void Out_String (CHAR *str, ADDRESS str__len) error = Platform_Write(1, (ADDRESS)str, l); } else { __MOVE((ADDRESS)str, (ADDRESS)&Out_buf[__X(Out_in, 128)], l); - Out_in += (INT16)l; + Out_in += __SHORT(l, 32768); } __DEL(str); } @@ -98,11 +98,11 @@ void Out_Int (INT64 x, INT64 n) if (x < 0) { x = -x; } - s[0] = (CHAR)(48 + __MOD(x, 10)); + s[0] = __CHR(48 + __MOD(x, 10)); x = __DIV(x, 10); i = 1; while (x != 0) { - s[__X(i, 22)] = (CHAR)(48 + __MOD(x, 10)); + s[__X(i, 22)] = __CHR(48 + __MOD(x, 10)); x = __DIV(x, 10); i += 1; } @@ -138,9 +138,9 @@ void Out_Hex (INT64 x, INT64 n) x = __ROTL(x, 4, 64); n -= 1; if (__MASK(x, -16) < 10) { - Out_Char((CHAR)(__MASK(x, -16) + 48)); + Out_Char(__CHR(__MASK(x, -16) + 48)); } else { - Out_Char((CHAR)((__MASK(x, -16) - 10) + 65)); + Out_Char(__CHR((__MASK(x, -16) - 10) + 65)); } } } @@ -154,7 +154,7 @@ void Out_Ln (void) static void Out_digit (INT64 n, CHAR *s, ADDRESS s__len, INT16 *i) { *i -= 1; - s[__X(*i, s__len)] = (CHAR)(__MOD(n, 10) + 48); + s[__X(*i, s__len)] = __CHR(__MOD(n, 10) + 48); } static void Out_prepend (CHAR *t, ADDRESS t__len, CHAR *s, ADDRESS s__len, INT16 *i) @@ -166,7 +166,7 @@ static void Out_prepend (CHAR *t, ADDRESS t__len, CHAR *s, ADDRESS s__len, INT16 if (l > *i) { l = *i; } - *i -= (INT16)l; + *i -= __SHORT(l, 32768); j = 0; while (j < l) { s[__X(*i + j, s__len)] = t[__X(j, t__len)]; @@ -248,7 +248,7 @@ static void Out_RealP (LONGREAL x, INT16 n, BOOLEAN long_) if (nn) { x = -x; } - e = (INT16)__ASHR((e - 1023) * 77, 8); + e = __SHORT(__ASHR((e - 1023) * 77, 8), 32768); if (e >= 0) { x = x / (LONGREAL)Out_Ten(e); } else { diff --git a/bootstrap/unix-88/Out.h b/bootstrap/unix-88/Out.h index 0819285a..5cc7a37c 100644 --- a/bootstrap/unix-88/Out.h +++ b/bootstrap/unix-88/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index e578c349..0e52a0fe 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index fefe3da8..13166a06 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 44be33b7..d0a86172 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -67,9 +67,9 @@ void Reals_SetExpo (REAL *x, INT16 ex) { CHAR c; __GET((ADDRESS)x + 3, c, CHAR); - __PUT((ADDRESS)x + 3, (CHAR)(__ASHL(__ASHR((INT16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __PUT((ADDRESS)x + 3, __CHR(__ASHL(__ASHR((INT16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); __GET((ADDRESS)x + 2, c, CHAR); - __PUT((ADDRESS)x + 2, (CHAR)(__MASK((INT16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); + __PUT((ADDRESS)x + 2, __CHR(__MASK((INT16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } INT16 Reals_ExpoL (LONGREAL x) @@ -87,21 +87,21 @@ void Reals_ConvertL (LONGREAL x, INT16 n, CHAR *d, ADDRESS d__len) } k = 0; if (n > 9) { - i = (INT32)__ENTIER(x / (LONGREAL)(LONGREAL)1000000000); - j = (INT32)__ENTIER(x - i * (LONGREAL)1000000000); + i = __SHORT(__ENTIER(x / (LONGREAL)(LONGREAL)1000000000), 2147483648LL); + j = __SHORT(__ENTIER(x - i * (LONGREAL)1000000000), 2147483648LL); if (j < 0) { j = 0; } while (k < 9) { - d[__X(k, d__len)] = (CHAR)((int)__MOD(j, 10) + 48); + d[__X(k, d__len)] = __CHR((int)__MOD(j, 10) + 48); j = __DIV(j, 10); k += 1; } } else { - i = (INT32)__ENTIER(x); + i = __SHORT(__ENTIER(x), 2147483648LL); } while (k < n) { - d[__X(k, d__len)] = (CHAR)((int)__MOD(i, 10) + 48); + d[__X(k, d__len)] = __CHR((int)__MOD(i, 10) + 48); i = __DIV(i, 10); k += 1; } @@ -115,9 +115,9 @@ void Reals_Convert (REAL x, INT16 n, CHAR *d, ADDRESS d__len) static CHAR Reals_ToHex (INT16 i) { if (i < 10) { - return (CHAR)(i + 48); + return __CHR(i + 48); } else { - return (CHAR)(i + 55); + return __CHR(i + 55); } __RETCHK; } diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index 7c2e0e35..d7d40e29 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index 6158bc92..c2deb7cf 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -34,7 +34,7 @@ INT16 Strings_Length (CHAR *s, ADDRESS s__len) } if (i <= 32767) { __DEL(s); - return (INT16)i; + return __SHORT(i, 32768); } else { __DEL(s); return 32767; @@ -126,7 +126,7 @@ void Strings_Extract (CHAR *source, ADDRESS source__len, INT16 pos, INT16 n, CHA INT16 len, destLen, i; __DUP(source, source__len, CHAR); len = Strings_Length(source, source__len); - destLen = (INT16)dest__len - 1; + destLen = __SHORT(dest__len, 32768) - 1; if (pos < 0) { pos = 0; } diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index 42b68da8..75b9b634 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index 6a06c85c..9fb45ce9 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -813,10 +813,10 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) if ('9' < ch) { if (('A' <= ch && ch <= 'F')) { hex = 1; - ch = (CHAR)((INT16)ch - 7); + ch = __CHR((INT16)ch - 7); } else if (('a' <= ch && ch <= 'f')) { hex = 1; - ch = (CHAR)((INT16)ch - 39); + ch = __CHR((INT16)ch - 39); } else { break; } @@ -1058,7 +1058,7 @@ void Texts_WriteInt (Texts_Writer *W, ADDRESS *W__typ, INT64 x, INT64 n) x0 = x; } do { - a[__X(i, 24)] = (CHAR)(__MOD(x0, 10) + 48); + a[__X(i, 24)] = __CHR(__MOD(x0, 10) + 48); x0 = __DIV(x0, 10); i += 1; } while (!(x0 == 0)); @@ -1085,9 +1085,9 @@ void Texts_WriteHex (Texts_Writer *W, ADDRESS *W__typ, INT32 x) do { y = __MASK(x, -16); if (y < 10) { - a[__X(i, 20)] = (CHAR)(y + 48); + a[__X(i, 20)] = __CHR(y + 48); } else { - a[__X(i, 20)] = (CHAR)(y + 55); + a[__X(i, 20)] = __CHR(y + 55); } x = __ASHR(x, 4); i += 1; @@ -1163,8 +1163,8 @@ void Texts_WriteReal (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n) } else { Texts_Write(&*W, W__typ, '+'); } - Texts_Write(&*W, W__typ, (CHAR)(__DIV(e, 10) + 48)); - Texts_Write(&*W, W__typ, (CHAR)((int)__MOD(e, 10) + 48)); + Texts_Write(&*W, W__typ, __CHR(__DIV(e, 10) + 48)); + Texts_Write(&*W, W__typ, __CHR((int)__MOD(e, 10) + 48)); } } @@ -1314,7 +1314,7 @@ void Texts_WriteLongReal (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x, INT16 n) } else { Texts_Write(&*W, W__typ, ' '); } - e = (INT16)__ASHR((e - 1023) * 77, 8); + e = __SHORT(__ASHR((e - 1023) * 77, 8), 32768); if (e >= 0) { x = x / (LONGREAL)Reals_TenL(e); } else { @@ -1345,10 +1345,10 @@ void Texts_WriteLongReal (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x, INT16 n) } else { Texts_Write(&*W, W__typ, '+'); } - Texts_Write(&*W, W__typ, (CHAR)(__DIV(e, 100) + 48)); + Texts_Write(&*W, W__typ, __CHR(__DIV(e, 100) + 48)); e = (int)__MOD(e, 100); - Texts_Write(&*W, W__typ, (CHAR)(__DIV(e, 10) + 48)); - Texts_Write(&*W, W__typ, (CHAR)((int)__MOD(e, 10) + 48)); + Texts_Write(&*W, W__typ, __CHR(__DIV(e, 10) + 48)); + Texts_Write(&*W, W__typ, __CHR((int)__MOD(e, 10) + 48)); } } @@ -1375,8 +1375,8 @@ static void WritePair__44 (CHAR ch, INT32 x); static void WritePair__44 (CHAR ch, INT32 x) { Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, ch); - Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)(__DIV(x, 10) + 48)); - Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)((int)__MOD(x, 10) + 48)); + Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, __CHR(__DIV(x, 10) + 48)); + Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, __CHR((int)__MOD(x, 10) + 48)); } void Texts_WriteDate (Texts_Writer *W, ADDRESS *W__typ, INT32 t, INT32 d) diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index e4aa3a7d..93a7b381 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/VT100.c b/bootstrap/unix-88/VT100.c index a3b0b0dd..a98729de 100644 --- a/bootstrap/unix-88/VT100.c +++ b/bootstrap/unix-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -74,7 +74,7 @@ void VT100_IntToStr (INT32 int_, CHAR *str, ADDRESS str__len) } e = s; do { - b[__X(e, 21)] = (CHAR)((int)__MOD(int_, 10) + 48); + b[__X(e, 21)] = __CHR((int)__MOD(int_, 10) + 48); int_ = __DIV(int_, 10); e += 1; } while (!(int_ == 0)); diff --git a/bootstrap/unix-88/VT100.h b/bootstrap/unix-88/VT100.h index e7539d2f..df99892d 100644 --- a/bootstrap/unix-88/VT100.h +++ b/bootstrap/unix-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index 562921ce..6a411d85 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -72,7 +72,7 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) { - __COPY("gcc -fPIC -g", s, s__len); + __COPY("gcc -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index e6dd4577..0629bd56 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/Compiler.c b/bootstrap/windows-48/Compiler.c index 9cdbb76c..3c9bd35e 100644 --- a/bootstrap/windows-48/Compiler.c +++ b/bootstrap/windows-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index 3ab08d40..50c02bb9 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index 7db28b57..d85d80f6 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index b6b62f3c..923a2d90 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -206,7 +206,7 @@ static void Files_GetTempName (CHAR *finalName, ADDRESS finalName__len, CHAR *na name[__X(i + 5, name__len)] = '.'; i += 6; while (n > 0) { - name[__X(i, name__len)] = (CHAR)((int)__MOD(n, 10) + 48); + name[__X(i, name__len)] = __CHR((int)__MOD(n, 10) + 48); n = __DIV(n, 10); i += 1; } @@ -214,7 +214,7 @@ static void Files_GetTempName (CHAR *finalName, ADDRESS finalName__len, CHAR *na i += 1; n = Platform_PID; while (n > 0) { - name[__X(i, name__len)] = (CHAR)((int)__MOD(n, 10) + 48); + name[__X(i, name__len)] = __CHR((int)__MOD(n, 10) + 48); n = __DIV(n, 10); i += 1; } @@ -947,18 +947,18 @@ void Files_WriteBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN x) void Files_WriteInt (Files_Rider *R, ADDRESS *R__typ, INT16 x) { CHAR b[2]; - b[0] = (CHAR)x; - b[1] = (CHAR)__ASHR(x, 8); + b[0] = __CHR(x); + b[1] = __CHR(__ASHR(x, 8)); Files_WriteBytes(&*R, R__typ, (void*)b, 2, 2); } void Files_WriteLInt (Files_Rider *R, ADDRESS *R__typ, INT32 x) { CHAR b[4]; - b[0] = (CHAR)x; - b[1] = (CHAR)__ASHR(x, 8); - b[2] = (CHAR)__ASHR(x, 16); - b[3] = (CHAR)__ASHR(x, 24); + b[0] = __CHR(x); + b[1] = __CHR(__ASHR(x, 8)); + b[2] = __CHR(__ASHR(x, 16)); + b[3] = __CHR(__ASHR(x, 24)); Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } @@ -967,10 +967,10 @@ void Files_WriteSet (Files_Rider *R, ADDRESS *R__typ, UINT32 x) CHAR b[4]; INT32 i; i = (INT32)x; - b[0] = (CHAR)i; - b[1] = (CHAR)__ASHR(i, 8); - b[2] = (CHAR)__ASHR(i, 16); - b[3] = (CHAR)__ASHR(i, 24); + b[0] = __CHR(i); + b[1] = __CHR(__ASHR(i, 8)); + b[2] = __CHR(__ASHR(i, 16)); + b[3] = __CHR(__ASHR(i, 24)); Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } @@ -1001,10 +1001,10 @@ void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, ADDRESS x__len void Files_WriteNum (Files_Rider *R, ADDRESS *R__typ, INT64 x) { while (x < -64 || x > 63) { - Files_Write(&*R, R__typ, (CHAR)(__MASK(x, -128) + 128)); + Files_Write(&*R, R__typ, __CHR(__MASK(x, -128) + 128)); x = __ASHR(x, 7); } - Files_Write(&*R, R__typ, (CHAR)__MASK(x, -128)); + Files_Write(&*R, R__typ, __CHR(__MASK(x, -128))); } void Files_GetName (Files_File f, CHAR *name, ADDRESS name__len) diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index 2e6b98b9..5524bb64 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index bd4ed5a8..31e05d3d 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index 8d7eb8e5..6ab10893 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index 276b9857..917d5517 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -404,7 +404,7 @@ static void Modules_errint (INT32 l) if (l >= 10) { Modules_errint(__DIV(l, 10)); } - Modules_errch((CHAR)((int)__MOD(l, 10) + 48)); + Modules_errch(__CHR((int)__MOD(l, 10) + 48)); } static void Modules_DisplayHaltCode (INT32 code) diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index 9d10f4ac..6dc9bb50 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index d7012f3e..6f3e6970 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -261,7 +261,7 @@ static void OPB_CharToString (OPT_Node n) { CHAR ch; n->typ = OPT_stringtyp; - ch = (CHAR)n->conval->intval; + ch = __CHR(n->conval->intval); n->conval->ext = OPT_NewExt(); if (ch == 0x00) { n->conval->intval2 = 1; @@ -597,7 +597,7 @@ void OPB_MOp (INT8 op, OPT_Node *x) case 22: if (f == 3) { if (z->class == 7) { - z->conval->intval = (INT16)__CAP((CHAR)z->conval->intval); + z->conval->intval = (INT16)__CAP(__CHR(z->conval->intval)); z->obj = NIL; } else { z = NewOp__29(op, typ, z); @@ -1136,7 +1136,7 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) OPB_err(203); r = (LONGREAL)1; } - (*x)->conval->intval = (INT32)__ENTIER(r); + (*x)->conval->intval = __SHORT(__ENTIER(r), 2147483648LL); OPB_SetIntType(*x); } } diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index b82bf9ba..032091ba 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 42cd3c56..3847bab7 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -1743,7 +1743,7 @@ static void OPC_CharacterLiteral (INT64 c) if ((c == 92 || c == 39) || c == 63) { OPM_Write('\\'); } - OPM_Write((CHAR)c); + OPM_Write(__CHR(c)); OPM_Write('\''); } } @@ -1759,16 +1759,16 @@ static void OPC_StringLiteral (CHAR *s, ADDRESS s__len, INT32 l) c = (INT16)s[__X(i, s__len)]; if (c < 32 || c > 126) { OPM_Write('\\'); - OPM_Write((CHAR)(48 + __ASHR(c, 6))); + OPM_Write(__CHR(48 + __ASHR(c, 6))); c = __MASK(c, -64); - OPM_Write((CHAR)(48 + __ASHR(c, 3))); + OPM_Write(__CHR(48 + __ASHR(c, 3))); c = __MASK(c, -8); - OPM_Write((CHAR)(48 + c)); + OPM_Write(__CHR(48 + c)); } else { if ((c == 92 || c == 34) || c == 63) { OPM_Write('\\'); } - OPM_Write((CHAR)c); + OPM_Write(__CHR(c)); } i += 1; } diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index b79317f7..f1968a6b 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index e6b33367..3f9ab009 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -606,7 +606,7 @@ static void OPM_ShowLine (INT64 pos) if (pos >= (INT64)OPM_ErrorLineLimitPos) { pos = OPM_ErrorLineLimitPos - 1; } - i = (INT16)OPM_Longint(pos - (INT64)OPM_ErrorLineStartPos); + i = __SHORTF(OPM_Longint(pos - (INT64)OPM_ErrorLineStartPos), 32768); while (i > 0) { OPM_LogW(' '); i -= 1; @@ -865,17 +865,17 @@ void OPM_WriteHex (INT64 i) { CHAR s[3]; INT32 digit; - digit = __ASHR((INT32)i, 4); + digit = __ASHR(__SHORT(i, 2147483648LL), 4); if (digit < 10) { - s[0] = (CHAR)(48 + digit); + s[0] = __CHR(48 + digit); } else { - s[0] = (CHAR)(87 + digit); + s[0] = __CHR(87 + digit); } - digit = __MASK((INT32)i, -16); + digit = __MASK(__SHORT(i, 2147483648LL), -16); if (digit < 10) { - s[1] = (CHAR)(48 + digit); + s[1] = __CHR(48 + digit); } else { - s[1] = (CHAR)(87 + digit); + s[1] = __CHR(87 + digit); } s[2] = 0x00; OPM_WriteString(s, 3); @@ -897,11 +897,11 @@ void OPM_WriteInt (INT64 i) __MOVE("LL", s, 3); k = 2; } - s[__X(k, 26)] = (CHAR)(__MOD(i1, 10) + 48); + s[__X(k, 26)] = __CHR(__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k += 1; while (i1 > 0) { - s[__X(k, 26)] = (CHAR)(__MOD(i1, 10) + 48); + s[__X(k, 26)] = __CHR(__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k += 1; } @@ -924,13 +924,13 @@ void OPM_WriteReal (LONGREAL r, CHAR suffx) CHAR s[32]; CHAR ch; INT16 i; - if ((((r < OPM_SignedMaximum(OPM_LongintSize) && r > OPM_SignedMinimum(OPM_LongintSize))) && r == ((INT32)__ENTIER(r)))) { + if ((((r < OPM_SignedMaximum(OPM_LongintSize) && r > OPM_SignedMinimum(OPM_LongintSize))) && r == (__SHORT(__ENTIER(r), 2147483648LL)))) { if (suffx == 'f') { OPM_WriteString((CHAR*)"(REAL)", 7); } else { OPM_WriteString((CHAR*)"(LONGREAL)", 11); } - OPM_WriteInt((INT32)__ENTIER(r)); + OPM_WriteInt(__SHORT(__ENTIER(r), 2147483648LL)); } else { Texts_OpenWriter(&W, Texts_Writer__typ); if (suffx == 'f') { diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index 1c6ca2ac..89ae5649 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index 54a9f7c8..3c2474d3 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -634,7 +634,7 @@ static void OPP_StandProcCall (OPT_Node *x) OPT_Node y = NIL; INT8 m; INT16 n; - m = (INT8)((INT16)(*x)->obj->adr); + m = __SHORT(__SHORT((*x)->obj->adr, 32768), 128); n = 0; if (OPP_sym == 30) { OPS_Get(&OPP_sym); @@ -943,7 +943,7 @@ static void GetCode__19 (void) (*ext)[__X(n + 1, 256)] = OPS_str[__X(n, 256)]; n += 1; } - (*ext)[0] = (CHAR)n; + (*ext)[0] = __CHR(n); OPS_Get(&OPP_sym); } else { for (;;) { @@ -956,14 +956,14 @@ static void GetCode__19 (void) n = 1; } OPS_Get(&OPP_sym); - (*ext)[__X(n, 256)] = (CHAR)c; + (*ext)[__X(n, 256)] = __CHR(c); } if (OPP_sym == 19) { OPS_Get(&OPP_sym); } else if (OPP_sym == 35) { OPP_err(19); } else { - (*ext)[0] = (CHAR)n; + (*ext)[0] = __CHR(n); break; } } diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index 52242f7c..849ca32f 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index 0e42294b..523bcc40 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index 15cdcc6c..4e2c9e5d 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 1897f024..1bf52545 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -352,7 +352,7 @@ void OPT_TypSize (OPT_Struct typ) } typ->size = offset; typ->align = base; - typ->sysflag = __MASK(typ->sysflag, -256) + (INT16)__ASHL(offset - off0, 8); + typ->sysflag = __MASK(typ->sysflag, -256) + __SHORT(__ASHL(offset - off0, 8), 32768); } else if (c == 2) { OPT_TypSize(typ->BaseTyp); typ->size = typ->n * typ->BaseTyp->size; @@ -1251,7 +1251,7 @@ static void OPT_InStruct (OPT_Struct *typ) obj->vis = 0; tag = OPM_SymRInt(); if (tag == 35) { - (*typ)->sysflag = (INT16)OPM_SymRInt(); + (*typ)->sysflag = __SHORTF(OPM_SymRInt(), 32768); tag = OPM_SymRInt(); } switch (tag) { @@ -1412,8 +1412,8 @@ static OPT_Object OPT_InObj (INT8 mno) obj->mode = 9; ext = OPT_NewExt(); obj->conval->ext = ext; - s = (INT16)OPM_SymRInt(); - (*ext)[0] = (CHAR)s; + s = __SHORTF(OPM_SymRInt(), 32768); + (*ext)[0] = __CHR(s); i = 1; while (i <= s) { OPM_SymRCh(&(*ext)[__X(i, 256)]); @@ -1752,7 +1752,7 @@ static void OPT_OutConstant (OPT_Object obj) OPM_SymWInt(f); switch (f) { case 2: case 3: - OPM_SymWCh((CHAR)obj->conval->intval); + OPM_SymWCh(__CHR(obj->conval->intval)); break; case 4: OPM_SymWInt(obj->conval->intval); diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index a4688654..65364b16 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index ebe18cc4..a56a7417 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -112,7 +112,7 @@ static void OPV_Stamp (OPS_Name s) i += 2; k = 0; do { - n[__X(k, 10)] = (CHAR)((int)__MOD(j, 10) + 48); + n[__X(k, 10)] = __CHR((int)__MOD(j, 10) + 48); j = __DIV(j, 10); k += 1; } while (!(j == 0)); @@ -370,6 +370,7 @@ static void OPV_SizeCast (OPT_Node n, INT32 to) OPM_WriteInt(__ASHL(to, 3)); OPM_WriteString((CHAR*)")", 2); } + OPV_Entier(n, 9); } } @@ -381,7 +382,6 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INT16 prec) if (to == 7) { if (from == 7) { OPV_SizeCast(n, newtype->size); - OPV_Entier(n, 9); } else { OPM_WriteString((CHAR*)"__SETOF(", 9); OPV_Entier(n, -1); @@ -391,7 +391,6 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INT16 prec) } } else if (to == 4) { OPV_SizeCast(n, newtype->size); - OPV_Entier(n, 9); } else if (to == 3) { if (__IN(2, OPM_Options, 32)) { OPM_WriteString((CHAR*)"__CHR", 6); diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index 05e906a7..58f9508b 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Out.c b/bootstrap/windows-48/Out.c index 2407ec4e..c1cc48bd 100644 --- a/bootstrap/windows-48/Out.c +++ b/bootstrap/windows-48/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -80,7 +80,7 @@ void Out_String (CHAR *str, ADDRESS str__len) error = Platform_Write(Platform_StdOut, (ADDRESS)str, l); } else { __MOVE((ADDRESS)str, (ADDRESS)&Out_buf[__X(Out_in, 128)], l); - Out_in += (INT16)l; + Out_in += __SHORT(l, 32768); } __DEL(str); } @@ -98,11 +98,11 @@ void Out_Int (INT64 x, INT64 n) if (x < 0) { x = -x; } - s[0] = (CHAR)(48 + __MOD(x, 10)); + s[0] = __CHR(48 + __MOD(x, 10)); x = __DIV(x, 10); i = 1; while (x != 0) { - s[__X(i, 22)] = (CHAR)(48 + __MOD(x, 10)); + s[__X(i, 22)] = __CHR(48 + __MOD(x, 10)); x = __DIV(x, 10); i += 1; } @@ -138,9 +138,9 @@ void Out_Hex (INT64 x, INT64 n) x = __ROTL(x, 4, 64); n -= 1; if (__MASK(x, -16) < 10) { - Out_Char((CHAR)(__MASK(x, -16) + 48)); + Out_Char(__CHR(__MASK(x, -16) + 48)); } else { - Out_Char((CHAR)((__MASK(x, -16) - 10) + 65)); + Out_Char(__CHR((__MASK(x, -16) - 10) + 65)); } } } @@ -154,7 +154,7 @@ void Out_Ln (void) static void Out_digit (INT64 n, CHAR *s, ADDRESS s__len, INT16 *i) { *i -= 1; - s[__X(*i, s__len)] = (CHAR)(__MOD(n, 10) + 48); + s[__X(*i, s__len)] = __CHR(__MOD(n, 10) + 48); } static void Out_prepend (CHAR *t, ADDRESS t__len, CHAR *s, ADDRESS s__len, INT16 *i) @@ -166,7 +166,7 @@ static void Out_prepend (CHAR *t, ADDRESS t__len, CHAR *s, ADDRESS s__len, INT16 if (l > *i) { l = *i; } - *i -= (INT16)l; + *i -= __SHORT(l, 32768); j = 0; while (j < l) { s[__X(*i + j, s__len)] = t[__X(j, t__len)]; @@ -248,7 +248,7 @@ static void Out_RealP (LONGREAL x, INT16 n, BOOLEAN long_) if (nn) { x = -x; } - e = (INT16)__ASHR((e - 1023) * 77, 8); + e = __SHORT(__ASHR((e - 1023) * 77, 8), 32768); if (e >= 0) { x = x / (LONGREAL)Out_Ten(e); } else { diff --git a/bootstrap/windows-48/Out.h b/bootstrap/windows-48/Out.h index 0819285a..5cc7a37c 100644 --- a/bootstrap/windows-48/Out.h +++ b/bootstrap/windows-48/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 9e7d70ee..1e9d3fdd 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index 9c125f90..e7e58fb1 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 44be33b7..d0a86172 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -67,9 +67,9 @@ void Reals_SetExpo (REAL *x, INT16 ex) { CHAR c; __GET((ADDRESS)x + 3, c, CHAR); - __PUT((ADDRESS)x + 3, (CHAR)(__ASHL(__ASHR((INT16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __PUT((ADDRESS)x + 3, __CHR(__ASHL(__ASHR((INT16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); __GET((ADDRESS)x + 2, c, CHAR); - __PUT((ADDRESS)x + 2, (CHAR)(__MASK((INT16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); + __PUT((ADDRESS)x + 2, __CHR(__MASK((INT16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } INT16 Reals_ExpoL (LONGREAL x) @@ -87,21 +87,21 @@ void Reals_ConvertL (LONGREAL x, INT16 n, CHAR *d, ADDRESS d__len) } k = 0; if (n > 9) { - i = (INT32)__ENTIER(x / (LONGREAL)(LONGREAL)1000000000); - j = (INT32)__ENTIER(x - i * (LONGREAL)1000000000); + i = __SHORT(__ENTIER(x / (LONGREAL)(LONGREAL)1000000000), 2147483648LL); + j = __SHORT(__ENTIER(x - i * (LONGREAL)1000000000), 2147483648LL); if (j < 0) { j = 0; } while (k < 9) { - d[__X(k, d__len)] = (CHAR)((int)__MOD(j, 10) + 48); + d[__X(k, d__len)] = __CHR((int)__MOD(j, 10) + 48); j = __DIV(j, 10); k += 1; } } else { - i = (INT32)__ENTIER(x); + i = __SHORT(__ENTIER(x), 2147483648LL); } while (k < n) { - d[__X(k, d__len)] = (CHAR)((int)__MOD(i, 10) + 48); + d[__X(k, d__len)] = __CHR((int)__MOD(i, 10) + 48); i = __DIV(i, 10); k += 1; } @@ -115,9 +115,9 @@ void Reals_Convert (REAL x, INT16 n, CHAR *d, ADDRESS d__len) static CHAR Reals_ToHex (INT16 i) { if (i < 10) { - return (CHAR)(i + 48); + return __CHR(i + 48); } else { - return (CHAR)(i + 55); + return __CHR(i + 55); } __RETCHK; } diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index 7c2e0e35..d7d40e29 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index 6158bc92..c2deb7cf 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -34,7 +34,7 @@ INT16 Strings_Length (CHAR *s, ADDRESS s__len) } if (i <= 32767) { __DEL(s); - return (INT16)i; + return __SHORT(i, 32768); } else { __DEL(s); return 32767; @@ -126,7 +126,7 @@ void Strings_Extract (CHAR *source, ADDRESS source__len, INT16 pos, INT16 n, CHA INT16 len, destLen, i; __DUP(source, source__len, CHAR); len = Strings_Length(source, source__len); - destLen = (INT16)dest__len - 1; + destLen = __SHORT(dest__len, 32768) - 1; if (pos < 0) { pos = 0; } diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index 42b68da8..75b9b634 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index 2726593a..8096bc1d 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -813,10 +813,10 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) if ('9' < ch) { if (('A' <= ch && ch <= 'F')) { hex = 1; - ch = (CHAR)((INT16)ch - 7); + ch = __CHR((INT16)ch - 7); } else if (('a' <= ch && ch <= 'f')) { hex = 1; - ch = (CHAR)((INT16)ch - 39); + ch = __CHR((INT16)ch - 39); } else { break; } @@ -1058,7 +1058,7 @@ void Texts_WriteInt (Texts_Writer *W, ADDRESS *W__typ, INT64 x, INT64 n) x0 = x; } do { - a[__X(i, 24)] = (CHAR)(__MOD(x0, 10) + 48); + a[__X(i, 24)] = __CHR(__MOD(x0, 10) + 48); x0 = __DIV(x0, 10); i += 1; } while (!(x0 == 0)); @@ -1085,9 +1085,9 @@ void Texts_WriteHex (Texts_Writer *W, ADDRESS *W__typ, INT32 x) do { y = __MASK(x, -16); if (y < 10) { - a[__X(i, 20)] = (CHAR)(y + 48); + a[__X(i, 20)] = __CHR(y + 48); } else { - a[__X(i, 20)] = (CHAR)(y + 55); + a[__X(i, 20)] = __CHR(y + 55); } x = __ASHR(x, 4); i += 1; @@ -1163,8 +1163,8 @@ void Texts_WriteReal (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n) } else { Texts_Write(&*W, W__typ, '+'); } - Texts_Write(&*W, W__typ, (CHAR)(__DIV(e, 10) + 48)); - Texts_Write(&*W, W__typ, (CHAR)((int)__MOD(e, 10) + 48)); + Texts_Write(&*W, W__typ, __CHR(__DIV(e, 10) + 48)); + Texts_Write(&*W, W__typ, __CHR((int)__MOD(e, 10) + 48)); } } @@ -1314,7 +1314,7 @@ void Texts_WriteLongReal (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x, INT16 n) } else { Texts_Write(&*W, W__typ, ' '); } - e = (INT16)__ASHR((e - 1023) * 77, 8); + e = __SHORT(__ASHR((e - 1023) * 77, 8), 32768); if (e >= 0) { x = x / (LONGREAL)Reals_TenL(e); } else { @@ -1345,10 +1345,10 @@ void Texts_WriteLongReal (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x, INT16 n) } else { Texts_Write(&*W, W__typ, '+'); } - Texts_Write(&*W, W__typ, (CHAR)(__DIV(e, 100) + 48)); + Texts_Write(&*W, W__typ, __CHR(__DIV(e, 100) + 48)); e = (int)__MOD(e, 100); - Texts_Write(&*W, W__typ, (CHAR)(__DIV(e, 10) + 48)); - Texts_Write(&*W, W__typ, (CHAR)((int)__MOD(e, 10) + 48)); + Texts_Write(&*W, W__typ, __CHR(__DIV(e, 10) + 48)); + Texts_Write(&*W, W__typ, __CHR((int)__MOD(e, 10) + 48)); } } @@ -1375,8 +1375,8 @@ static void WritePair__44 (CHAR ch, INT32 x); static void WritePair__44 (CHAR ch, INT32 x) { Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, ch); - Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)(__DIV(x, 10) + 48)); - Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)((int)__MOD(x, 10) + 48)); + Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, __CHR(__DIV(x, 10) + 48)); + Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, __CHR((int)__MOD(x, 10) + 48)); } void Texts_WriteDate (Texts_Writer *W, ADDRESS *W__typ, INT32 t, INT32 d) diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index 714d9ac5..f7b5d487 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/VT100.c b/bootstrap/windows-48/VT100.c index a3b0b0dd..a98729de 100644 --- a/bootstrap/windows-48/VT100.c +++ b/bootstrap/windows-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -74,7 +74,7 @@ void VT100_IntToStr (INT32 int_, CHAR *str, ADDRESS str__len) } e = s; do { - b[__X(e, 21)] = (CHAR)((int)__MOD(int_, 10) + 48); + b[__X(e, 21)] = __CHR((int)__MOD(int_, 10) + 48); int_ = __DIV(int_, 10); e += 1; } while (!(int_ == 0)); diff --git a/bootstrap/windows-48/VT100.h b/bootstrap/windows-48/VT100.h index e7539d2f..df99892d 100644 --- a/bootstrap/windows-48/VT100.h +++ b/bootstrap/windows-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index 562921ce..6a411d85 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -72,7 +72,7 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) { - __COPY("gcc -fPIC -g", s, s__len); + __COPY("gcc -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index e6dd4577..0629bd56 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/Compiler.c b/bootstrap/windows-88/Compiler.c index 9cdbb76c..3c9bd35e 100644 --- a/bootstrap/windows-88/Compiler.c +++ b/bootstrap/windows-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index 3ab08d40..50c02bb9 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index 7db28b57..d85d80f6 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index c473c7b3..4c53ff0e 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -207,7 +207,7 @@ static void Files_GetTempName (CHAR *finalName, ADDRESS finalName__len, CHAR *na name[__X(i + 5, name__len)] = '.'; i += 6; while (n > 0) { - name[__X(i, name__len)] = (CHAR)((int)__MOD(n, 10) + 48); + name[__X(i, name__len)] = __CHR((int)__MOD(n, 10) + 48); n = __DIV(n, 10); i += 1; } @@ -215,7 +215,7 @@ static void Files_GetTempName (CHAR *finalName, ADDRESS finalName__len, CHAR *na i += 1; n = Platform_PID; while (n > 0) { - name[__X(i, name__len)] = (CHAR)((int)__MOD(n, 10) + 48); + name[__X(i, name__len)] = __CHR((int)__MOD(n, 10) + 48); n = __DIV(n, 10); i += 1; } @@ -949,18 +949,18 @@ void Files_WriteBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN x) void Files_WriteInt (Files_Rider *R, ADDRESS *R__typ, INT16 x) { CHAR b[2]; - b[0] = (CHAR)x; - b[1] = (CHAR)__ASHR(x, 8); + b[0] = __CHR(x); + b[1] = __CHR(__ASHR(x, 8)); Files_WriteBytes(&*R, R__typ, (void*)b, 2, 2); } void Files_WriteLInt (Files_Rider *R, ADDRESS *R__typ, INT32 x) { CHAR b[4]; - b[0] = (CHAR)x; - b[1] = (CHAR)__ASHR(x, 8); - b[2] = (CHAR)__ASHR(x, 16); - b[3] = (CHAR)__ASHR(x, 24); + b[0] = __CHR(x); + b[1] = __CHR(__ASHR(x, 8)); + b[2] = __CHR(__ASHR(x, 16)); + b[3] = __CHR(__ASHR(x, 24)); Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } @@ -969,10 +969,10 @@ void Files_WriteSet (Files_Rider *R, ADDRESS *R__typ, UINT32 x) CHAR b[4]; INT32 i; i = (INT32)x; - b[0] = (CHAR)i; - b[1] = (CHAR)__ASHR(i, 8); - b[2] = (CHAR)__ASHR(i, 16); - b[3] = (CHAR)__ASHR(i, 24); + b[0] = __CHR(i); + b[1] = __CHR(__ASHR(i, 8)); + b[2] = __CHR(__ASHR(i, 16)); + b[3] = __CHR(__ASHR(i, 24)); Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } @@ -1003,10 +1003,10 @@ void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, ADDRESS x__len void Files_WriteNum (Files_Rider *R, ADDRESS *R__typ, INT64 x) { while (x < -64 || x > 63) { - Files_Write(&*R, R__typ, (CHAR)(__MASK(x, -128) + 128)); + Files_Write(&*R, R__typ, __CHR(__MASK(x, -128) + 128)); x = __ASHR(x, 7); } - Files_Write(&*R, R__typ, (CHAR)__MASK(x, -128)); + Files_Write(&*R, R__typ, __CHR(__MASK(x, -128))); } void Files_GetName (Files_File f, CHAR *name, ADDRESS name__len) diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 032d28c2..96331322 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index eb19a612..9e3f5ae9 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index ab574eed..5db19e82 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index b3c05745..294e8d2f 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -404,7 +404,7 @@ static void Modules_errint (INT32 l) if (l >= 10) { Modules_errint(__DIV(l, 10)); } - Modules_errch((CHAR)((int)__MOD(l, 10) + 48)); + Modules_errch(__CHR((int)__MOD(l, 10) + 48)); } static void Modules_DisplayHaltCode (INT32 code) diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index 3f97dc19..be398042 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index d7012f3e..6f3e6970 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -261,7 +261,7 @@ static void OPB_CharToString (OPT_Node n) { CHAR ch; n->typ = OPT_stringtyp; - ch = (CHAR)n->conval->intval; + ch = __CHR(n->conval->intval); n->conval->ext = OPT_NewExt(); if (ch == 0x00) { n->conval->intval2 = 1; @@ -597,7 +597,7 @@ void OPB_MOp (INT8 op, OPT_Node *x) case 22: if (f == 3) { if (z->class == 7) { - z->conval->intval = (INT16)__CAP((CHAR)z->conval->intval); + z->conval->intval = (INT16)__CAP(__CHR(z->conval->intval)); z->obj = NIL; } else { z = NewOp__29(op, typ, z); @@ -1136,7 +1136,7 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) OPB_err(203); r = (LONGREAL)1; } - (*x)->conval->intval = (INT32)__ENTIER(r); + (*x)->conval->intval = __SHORT(__ENTIER(r), 2147483648LL); OPB_SetIntType(*x); } } diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index b82bf9ba..032091ba 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index 42cd3c56..3847bab7 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -1743,7 +1743,7 @@ static void OPC_CharacterLiteral (INT64 c) if ((c == 92 || c == 39) || c == 63) { OPM_Write('\\'); } - OPM_Write((CHAR)c); + OPM_Write(__CHR(c)); OPM_Write('\''); } } @@ -1759,16 +1759,16 @@ static void OPC_StringLiteral (CHAR *s, ADDRESS s__len, INT32 l) c = (INT16)s[__X(i, s__len)]; if (c < 32 || c > 126) { OPM_Write('\\'); - OPM_Write((CHAR)(48 + __ASHR(c, 6))); + OPM_Write(__CHR(48 + __ASHR(c, 6))); c = __MASK(c, -64); - OPM_Write((CHAR)(48 + __ASHR(c, 3))); + OPM_Write(__CHR(48 + __ASHR(c, 3))); c = __MASK(c, -8); - OPM_Write((CHAR)(48 + c)); + OPM_Write(__CHR(48 + c)); } else { if ((c == 92 || c == 34) || c == 63) { OPM_Write('\\'); } - OPM_Write((CHAR)c); + OPM_Write(__CHR(c)); } i += 1; } diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index b79317f7..f1968a6b 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 28e1ec4b..7079d9d3 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -606,7 +606,7 @@ static void OPM_ShowLine (INT64 pos) if (pos >= (INT64)OPM_ErrorLineLimitPos) { pos = OPM_ErrorLineLimitPos - 1; } - i = (INT16)OPM_Longint(pos - (INT64)OPM_ErrorLineStartPos); + i = __SHORTF(OPM_Longint(pos - (INT64)OPM_ErrorLineStartPos), 32768); while (i > 0) { OPM_LogW(' '); i -= 1; @@ -865,17 +865,17 @@ void OPM_WriteHex (INT64 i) { CHAR s[3]; INT32 digit; - digit = __ASHR((INT32)i, 4); + digit = __ASHR(__SHORT(i, 2147483648LL), 4); if (digit < 10) { - s[0] = (CHAR)(48 + digit); + s[0] = __CHR(48 + digit); } else { - s[0] = (CHAR)(87 + digit); + s[0] = __CHR(87 + digit); } - digit = __MASK((INT32)i, -16); + digit = __MASK(__SHORT(i, 2147483648LL), -16); if (digit < 10) { - s[1] = (CHAR)(48 + digit); + s[1] = __CHR(48 + digit); } else { - s[1] = (CHAR)(87 + digit); + s[1] = __CHR(87 + digit); } s[2] = 0x00; OPM_WriteString(s, 3); @@ -897,11 +897,11 @@ void OPM_WriteInt (INT64 i) __MOVE("LL", s, 3); k = 2; } - s[__X(k, 26)] = (CHAR)(__MOD(i1, 10) + 48); + s[__X(k, 26)] = __CHR(__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k += 1; while (i1 > 0) { - s[__X(k, 26)] = (CHAR)(__MOD(i1, 10) + 48); + s[__X(k, 26)] = __CHR(__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k += 1; } @@ -924,13 +924,13 @@ void OPM_WriteReal (LONGREAL r, CHAR suffx) CHAR s[32]; CHAR ch; INT16 i; - if ((((r < OPM_SignedMaximum(OPM_LongintSize) && r > OPM_SignedMinimum(OPM_LongintSize))) && r == ((INT32)__ENTIER(r)))) { + if ((((r < OPM_SignedMaximum(OPM_LongintSize) && r > OPM_SignedMinimum(OPM_LongintSize))) && r == (__SHORT(__ENTIER(r), 2147483648LL)))) { if (suffx == 'f') { OPM_WriteString((CHAR*)"(REAL)", 7); } else { OPM_WriteString((CHAR*)"(LONGREAL)", 11); } - OPM_WriteInt((INT32)__ENTIER(r)); + OPM_WriteInt(__SHORT(__ENTIER(r), 2147483648LL)); } else { Texts_OpenWriter(&W, Texts_Writer__typ); if (suffx == 'f') { diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index 1c6ca2ac..89ae5649 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index 7508ac7a..bfbc425e 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -634,7 +634,7 @@ static void OPP_StandProcCall (OPT_Node *x) OPT_Node y = NIL; INT8 m; INT16 n; - m = (INT8)((INT16)(*x)->obj->adr); + m = __SHORT(__SHORT((*x)->obj->adr, 32768), 128); n = 0; if (OPP_sym == 30) { OPS_Get(&OPP_sym); @@ -943,7 +943,7 @@ static void GetCode__19 (void) (*ext)[__X(n + 1, 256)] = OPS_str[__X(n, 256)]; n += 1; } - (*ext)[0] = (CHAR)n; + (*ext)[0] = __CHR(n); OPS_Get(&OPP_sym); } else { for (;;) { @@ -956,14 +956,14 @@ static void GetCode__19 (void) n = 1; } OPS_Get(&OPP_sym); - (*ext)[__X(n, 256)] = (CHAR)c; + (*ext)[__X(n, 256)] = __CHR(c); } if (OPP_sym == 19) { OPS_Get(&OPP_sym); } else if (OPP_sym == 35) { OPP_err(19); } else { - (*ext)[0] = (CHAR)n; + (*ext)[0] = __CHR(n); break; } } diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index 52242f7c..849ca32f 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index 0e42294b..523bcc40 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index 15cdcc6c..4e2c9e5d 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index 57dfaa59..fe093273 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -352,7 +352,7 @@ void OPT_TypSize (OPT_Struct typ) } typ->size = offset; typ->align = base; - typ->sysflag = __MASK(typ->sysflag, -256) + (INT16)__ASHL(offset - off0, 8); + typ->sysflag = __MASK(typ->sysflag, -256) + __SHORT(__ASHL(offset - off0, 8), 32768); } else if (c == 2) { OPT_TypSize(typ->BaseTyp); typ->size = typ->n * typ->BaseTyp->size; @@ -1251,7 +1251,7 @@ static void OPT_InStruct (OPT_Struct *typ) obj->vis = 0; tag = OPM_SymRInt(); if (tag == 35) { - (*typ)->sysflag = (INT16)OPM_SymRInt(); + (*typ)->sysflag = __SHORTF(OPM_SymRInt(), 32768); tag = OPM_SymRInt(); } switch (tag) { @@ -1412,8 +1412,8 @@ static OPT_Object OPT_InObj (INT8 mno) obj->mode = 9; ext = OPT_NewExt(); obj->conval->ext = ext; - s = (INT16)OPM_SymRInt(); - (*ext)[0] = (CHAR)s; + s = __SHORTF(OPM_SymRInt(), 32768); + (*ext)[0] = __CHR(s); i = 1; while (i <= s) { OPM_SymRCh(&(*ext)[__X(i, 256)]); @@ -1752,7 +1752,7 @@ static void OPT_OutConstant (OPT_Object obj) OPM_SymWInt(f); switch (f) { case 2: case 3: - OPM_SymWCh((CHAR)obj->conval->intval); + OPM_SymWCh(__CHR(obj->conval->intval)); break; case 4: OPM_SymWInt(obj->conval->intval); diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index a4688654..65364b16 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index bad459b6..777dee8c 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -112,7 +112,7 @@ static void OPV_Stamp (OPS_Name s) i += 2; k = 0; do { - n[__X(k, 10)] = (CHAR)((int)__MOD(j, 10) + 48); + n[__X(k, 10)] = __CHR((int)__MOD(j, 10) + 48); j = __DIV(j, 10); k += 1; } while (!(j == 0)); @@ -370,6 +370,7 @@ static void OPV_SizeCast (OPT_Node n, INT32 to) OPM_WriteInt(__ASHL(to, 3)); OPM_WriteString((CHAR*)")", 2); } + OPV_Entier(n, 9); } } @@ -381,7 +382,6 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INT16 prec) if (to == 7) { if (from == 7) { OPV_SizeCast(n, newtype->size); - OPV_Entier(n, 9); } else { OPM_WriteString((CHAR*)"__SETOF(", 9); OPV_Entier(n, -1); @@ -391,7 +391,6 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INT16 prec) } } else if (to == 4) { OPV_SizeCast(n, newtype->size); - OPV_Entier(n, 9); } else if (to == 3) { if (__IN(2, OPM_Options, 32)) { OPM_WriteString((CHAR*)"__CHR", 6); diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index 05e906a7..58f9508b 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Out.c b/bootstrap/windows-88/Out.c index 2407ec4e..c1cc48bd 100644 --- a/bootstrap/windows-88/Out.c +++ b/bootstrap/windows-88/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -80,7 +80,7 @@ void Out_String (CHAR *str, ADDRESS str__len) error = Platform_Write(Platform_StdOut, (ADDRESS)str, l); } else { __MOVE((ADDRESS)str, (ADDRESS)&Out_buf[__X(Out_in, 128)], l); - Out_in += (INT16)l; + Out_in += __SHORT(l, 32768); } __DEL(str); } @@ -98,11 +98,11 @@ void Out_Int (INT64 x, INT64 n) if (x < 0) { x = -x; } - s[0] = (CHAR)(48 + __MOD(x, 10)); + s[0] = __CHR(48 + __MOD(x, 10)); x = __DIV(x, 10); i = 1; while (x != 0) { - s[__X(i, 22)] = (CHAR)(48 + __MOD(x, 10)); + s[__X(i, 22)] = __CHR(48 + __MOD(x, 10)); x = __DIV(x, 10); i += 1; } @@ -138,9 +138,9 @@ void Out_Hex (INT64 x, INT64 n) x = __ROTL(x, 4, 64); n -= 1; if (__MASK(x, -16) < 10) { - Out_Char((CHAR)(__MASK(x, -16) + 48)); + Out_Char(__CHR(__MASK(x, -16) + 48)); } else { - Out_Char((CHAR)((__MASK(x, -16) - 10) + 65)); + Out_Char(__CHR((__MASK(x, -16) - 10) + 65)); } } } @@ -154,7 +154,7 @@ void Out_Ln (void) static void Out_digit (INT64 n, CHAR *s, ADDRESS s__len, INT16 *i) { *i -= 1; - s[__X(*i, s__len)] = (CHAR)(__MOD(n, 10) + 48); + s[__X(*i, s__len)] = __CHR(__MOD(n, 10) + 48); } static void Out_prepend (CHAR *t, ADDRESS t__len, CHAR *s, ADDRESS s__len, INT16 *i) @@ -166,7 +166,7 @@ static void Out_prepend (CHAR *t, ADDRESS t__len, CHAR *s, ADDRESS s__len, INT16 if (l > *i) { l = *i; } - *i -= (INT16)l; + *i -= __SHORT(l, 32768); j = 0; while (j < l) { s[__X(*i + j, s__len)] = t[__X(j, t__len)]; @@ -248,7 +248,7 @@ static void Out_RealP (LONGREAL x, INT16 n, BOOLEAN long_) if (nn) { x = -x; } - e = (INT16)__ASHR((e - 1023) * 77, 8); + e = __SHORT(__ASHR((e - 1023) * 77, 8), 32768); if (e >= 0) { x = x / (LONGREAL)Out_Ten(e); } else { diff --git a/bootstrap/windows-88/Out.h b/bootstrap/windows-88/Out.h index 0819285a..5cc7a37c 100644 --- a/bootstrap/windows-88/Out.h +++ b/bootstrap/windows-88/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 6f55e803..36884101 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index ba866b78..1544c29b 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 44be33b7..d0a86172 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -67,9 +67,9 @@ void Reals_SetExpo (REAL *x, INT16 ex) { CHAR c; __GET((ADDRESS)x + 3, c, CHAR); - __PUT((ADDRESS)x + 3, (CHAR)(__ASHL(__ASHR((INT16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __PUT((ADDRESS)x + 3, __CHR(__ASHL(__ASHR((INT16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); __GET((ADDRESS)x + 2, c, CHAR); - __PUT((ADDRESS)x + 2, (CHAR)(__MASK((INT16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); + __PUT((ADDRESS)x + 2, __CHR(__MASK((INT16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } INT16 Reals_ExpoL (LONGREAL x) @@ -87,21 +87,21 @@ void Reals_ConvertL (LONGREAL x, INT16 n, CHAR *d, ADDRESS d__len) } k = 0; if (n > 9) { - i = (INT32)__ENTIER(x / (LONGREAL)(LONGREAL)1000000000); - j = (INT32)__ENTIER(x - i * (LONGREAL)1000000000); + i = __SHORT(__ENTIER(x / (LONGREAL)(LONGREAL)1000000000), 2147483648LL); + j = __SHORT(__ENTIER(x - i * (LONGREAL)1000000000), 2147483648LL); if (j < 0) { j = 0; } while (k < 9) { - d[__X(k, d__len)] = (CHAR)((int)__MOD(j, 10) + 48); + d[__X(k, d__len)] = __CHR((int)__MOD(j, 10) + 48); j = __DIV(j, 10); k += 1; } } else { - i = (INT32)__ENTIER(x); + i = __SHORT(__ENTIER(x), 2147483648LL); } while (k < n) { - d[__X(k, d__len)] = (CHAR)((int)__MOD(i, 10) + 48); + d[__X(k, d__len)] = __CHR((int)__MOD(i, 10) + 48); i = __DIV(i, 10); k += 1; } @@ -115,9 +115,9 @@ void Reals_Convert (REAL x, INT16 n, CHAR *d, ADDRESS d__len) static CHAR Reals_ToHex (INT16 i) { if (i < 10) { - return (CHAR)(i + 48); + return __CHR(i + 48); } else { - return (CHAR)(i + 55); + return __CHR(i + 55); } __RETCHK; } diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index 7c2e0e35..d7d40e29 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index 6158bc92..c2deb7cf 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -34,7 +34,7 @@ INT16 Strings_Length (CHAR *s, ADDRESS s__len) } if (i <= 32767) { __DEL(s); - return (INT16)i; + return __SHORT(i, 32768); } else { __DEL(s); return 32767; @@ -126,7 +126,7 @@ void Strings_Extract (CHAR *source, ADDRESS source__len, INT16 pos, INT16 n, CHA INT16 len, destLen, i; __DUP(source, source__len, CHAR); len = Strings_Length(source, source__len); - destLen = (INT16)dest__len - 1; + destLen = __SHORT(dest__len, 32768) - 1; if (pos < 0) { pos = 0; } diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index 42b68da8..75b9b634 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index 6a06c85c..9fb45ce9 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -813,10 +813,10 @@ void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) if ('9' < ch) { if (('A' <= ch && ch <= 'F')) { hex = 1; - ch = (CHAR)((INT16)ch - 7); + ch = __CHR((INT16)ch - 7); } else if (('a' <= ch && ch <= 'f')) { hex = 1; - ch = (CHAR)((INT16)ch - 39); + ch = __CHR((INT16)ch - 39); } else { break; } @@ -1058,7 +1058,7 @@ void Texts_WriteInt (Texts_Writer *W, ADDRESS *W__typ, INT64 x, INT64 n) x0 = x; } do { - a[__X(i, 24)] = (CHAR)(__MOD(x0, 10) + 48); + a[__X(i, 24)] = __CHR(__MOD(x0, 10) + 48); x0 = __DIV(x0, 10); i += 1; } while (!(x0 == 0)); @@ -1085,9 +1085,9 @@ void Texts_WriteHex (Texts_Writer *W, ADDRESS *W__typ, INT32 x) do { y = __MASK(x, -16); if (y < 10) { - a[__X(i, 20)] = (CHAR)(y + 48); + a[__X(i, 20)] = __CHR(y + 48); } else { - a[__X(i, 20)] = (CHAR)(y + 55); + a[__X(i, 20)] = __CHR(y + 55); } x = __ASHR(x, 4); i += 1; @@ -1163,8 +1163,8 @@ void Texts_WriteReal (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n) } else { Texts_Write(&*W, W__typ, '+'); } - Texts_Write(&*W, W__typ, (CHAR)(__DIV(e, 10) + 48)); - Texts_Write(&*W, W__typ, (CHAR)((int)__MOD(e, 10) + 48)); + Texts_Write(&*W, W__typ, __CHR(__DIV(e, 10) + 48)); + Texts_Write(&*W, W__typ, __CHR((int)__MOD(e, 10) + 48)); } } @@ -1314,7 +1314,7 @@ void Texts_WriteLongReal (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x, INT16 n) } else { Texts_Write(&*W, W__typ, ' '); } - e = (INT16)__ASHR((e - 1023) * 77, 8); + e = __SHORT(__ASHR((e - 1023) * 77, 8), 32768); if (e >= 0) { x = x / (LONGREAL)Reals_TenL(e); } else { @@ -1345,10 +1345,10 @@ void Texts_WriteLongReal (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x, INT16 n) } else { Texts_Write(&*W, W__typ, '+'); } - Texts_Write(&*W, W__typ, (CHAR)(__DIV(e, 100) + 48)); + Texts_Write(&*W, W__typ, __CHR(__DIV(e, 100) + 48)); e = (int)__MOD(e, 100); - Texts_Write(&*W, W__typ, (CHAR)(__DIV(e, 10) + 48)); - Texts_Write(&*W, W__typ, (CHAR)((int)__MOD(e, 10) + 48)); + Texts_Write(&*W, W__typ, __CHR(__DIV(e, 10) + 48)); + Texts_Write(&*W, W__typ, __CHR((int)__MOD(e, 10) + 48)); } } @@ -1375,8 +1375,8 @@ static void WritePair__44 (CHAR ch, INT32 x); static void WritePair__44 (CHAR ch, INT32 x) { Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, ch); - Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)(__DIV(x, 10) + 48)); - Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)((int)__MOD(x, 10) + 48)); + Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, __CHR(__DIV(x, 10) + 48)); + Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, __CHR((int)__MOD(x, 10) + 48)); } void Texts_WriteDate (Texts_Writer *W, ADDRESS *W__typ, INT32 t, INT32 d) diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index e4aa3a7d..93a7b381 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/VT100.c b/bootstrap/windows-88/VT100.c index a3b0b0dd..a98729de 100644 --- a/bootstrap/windows-88/VT100.c +++ b/bootstrap/windows-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -74,7 +74,7 @@ void VT100_IntToStr (INT32 int_, CHAR *str, ADDRESS str__len) } e = s; do { - b[__X(e, 21)] = (CHAR)((int)__MOD(int_, 10) + 48); + b[__X(e, 21)] = __CHR((int)__MOD(int_, 10) + 48); int_ = __DIV(int_, 10); e += 1; } while (!(int_ == 0)); diff --git a/bootstrap/windows-88/VT100.h b/bootstrap/windows-88/VT100.h index e7539d2f..df99892d 100644 --- a/bootstrap/windows-88/VT100.h +++ b/bootstrap/windows-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index 562921ce..6a411d85 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -72,7 +72,7 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) { - __COPY("gcc -fPIC -g", s, s__len); + __COPY("gcc -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index e6dd4577..0629bd56 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2018/04/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/src/compiler/OPV.Mod b/src/compiler/OPV.Mod index 3c561714..964f60e1 100644 --- a/src/compiler/OPV.Mod +++ b/src/compiler/OPV.Mod @@ -204,7 +204,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 END; END Precedence; - PROCEDURE^ expr (n: OPT.Node; prec: INTEGER); + PROCEDURE^ expr (n: OPT.Node; prec: INTEGER); PROCEDURE^ design(n: OPT.Node; prec: INTEGER); PROCEDURE Len(n: OPT.Node; dim: SYSTEM.INT64); @@ -241,7 +241,8 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 ELSE IF (n.typ.size # to) & ((n.typ.size > OPM.CIntSize) OR (to # OPM.CIntSize)) THEN OPM.WriteString("(INT"); OPM.WriteInt(to*8); OPM.WriteString(")") - END + END; + Entier(n, 9) END END SizeCast; @@ -250,13 +251,13 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 BEGIN from := n^.typ^.form; to := newtype.form; IF to = OPT.Set THEN IF from = OPT.Set THEN (* Sets of different size *) - SizeCast(n, newtype.size); Entier(n, 9) + SizeCast(n, newtype.size); ELSE (* Set from integer *) OPM.WriteString("__SETOF("); Entier(n, MinPrec); OPM.WriteString(","); OPM.WriteInt(newtype.size*8); OPM.Write(CloseParen) END ELSIF to = OPT.Int THEN (* integers of different size *) - SizeCast(n, newtype.size); Entier(n, 9) + SizeCast(n, newtype.size); ELSIF to = OPT.Char THEN IF OPM.ranchk IN OPM.Options THEN OPM.WriteString("__CHR"); IF SideEffects(n) THEN OPM.Write("F") END ; diff --git a/src/tools/make/oberon.mk b/src/tools/make/oberon.mk index 581f3117..20654d40 100644 --- a/src/tools/make/oberon.mk +++ b/src/tools/make/oberon.mk @@ -60,7 +60,7 @@ assemble: @printf ' DATAMODEL: %s\n' "$(DATAMODEL)" cd $(BUILDDIR) && $(COMPILE) -c SYSTEM.c Configuration.c Platform.c Heap.c - cd $(BUILDDIR) && $(COMPILE) -c Out.c Reals.c Strings.c Modules.c + cd $(BUILDDIR) && $(COMPILE) -c Out.c Reals.c Strings.c Modules.c cd $(BUILDDIR) && $(COMPILE) -c Files.c Texts.c VT100.c cd $(BUILDDIR) && $(COMPILE) -c OPM.c extTools.c OPS.c OPT.c cd $(BUILDDIR) && $(COMPILE) -c OPC.c OPV.c OPB.c OPP.c @@ -103,25 +103,25 @@ translate: @mkdir -p $(BUILDDIR) @rm -f $(BUILDDIR)/*.sym - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../Configuration.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Platform$(PLATFORM).Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsFapx -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Heap.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Reals.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Strings.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Out.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Modules.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Files.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Texts.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/VT100.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/OPM.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/extTools.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/OPS.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/OPT.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/OPC.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/OPV.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/OPB.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/OPP.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ssm -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/Compiler.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsrF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../Configuration.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsrF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Platform$(PLATFORM).Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsrFapx -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Heap.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsrF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Reals.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsrF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Strings.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsrF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Out.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsrF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Modules.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsrF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Files.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsrF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Texts.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsrF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/VT100.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsrF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/OPM.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsrF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/extTools.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsrF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/OPS.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsrF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/OPT.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsrF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/OPC.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsrF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/OPV.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsrF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/OPB.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsrF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/OPP.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ssrm -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/Compiler.Mod cp src/runtime/*.[ch] $(BUILDDIR) cp src/runtime/*.Txt $(BUILDDIR) From 2e93bc09098e750e8c4f7b5ffa97893d9ed8b352 Mon Sep 17 00:00:00 2001 From: David C W Brown Date: Mon, 7 Jan 2019 18:10:33 +0000 Subject: [PATCH 502/580] Correct the other reference to the windows installation doc. --- ReadMe.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReadMe.md b/ReadMe.md index d159399c..66265334 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -95,7 +95,7 @@ For reference this will be: | Just `make full` | `export PATH="your-repository-clone/install/bin:$PATH"` | | `make install` on Linux | `export PATH="/opt/voc/bin:$PATH"` | | `make install` on BSD | `export PATH="/usr/local/share/voc/bin:$PATH"` | -| `make install` on Windows | See [**Windows installation**](/doc/WInstallation.md) | +| `make install` on Windows | See [**Windows installation**](/doc/Winstallation.md) | | `make install` on Termux | `export PATH="/data/data/com.termux/files/opt/voc/bin:$PATH"` | Also see [**Installation**](/doc/Installation.md). From 5e903cb3d9372729d65026adb1e8db5a4b6c80df Mon Sep 17 00:00:00 2001 From: David Brown Date: Mon, 7 Jan 2019 18:47:15 +0000 Subject: [PATCH 503/580] Trigger build --- src/tools/autobuild/trigger-build | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 src/tools/autobuild/trigger-build diff --git a/src/tools/autobuild/trigger-build b/src/tools/autobuild/trigger-build new file mode 100644 index 00000000..e69de29b From e07c1250170e95bf27f55af6f67b7cabea69b94b Mon Sep 17 00:00:00 2001 From: David Brown Date: Mon, 7 Jan 2019 18:58:35 +0000 Subject: [PATCH 504/580] Trigger again --- src/tools/autobuild/trigger-build | 1 + 1 file changed, 1 insertion(+) diff --git a/src/tools/autobuild/trigger-build b/src/tools/autobuild/trigger-build index e69de29b..a15e1851 100644 --- a/src/tools/autobuild/trigger-build +++ b/src/tools/autobuild/trigger-build @@ -0,0 +1 @@ +again From e3a07e77fa3a04555c3774934ab503d56181509d Mon Sep 17 00:00:00 2001 From: David Brown Date: Mon, 7 Jan 2019 19:17:34 +0000 Subject: [PATCH 505/580] Trigger again --- src/tools/autobuild/trigger-build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/autobuild/trigger-build b/src/tools/autobuild/trigger-build index a15e1851..9b24da92 100644 --- a/src/tools/autobuild/trigger-build +++ b/src/tools/autobuild/trigger-build @@ -1 +1 @@ -again +another From a35668bf93b8550559be7e7a45d759d68db87b44 Mon Sep 17 00:00:00 2001 From: Norayr Chilingarian Date: Thu, 10 Oct 2019 17:41:18 +0400 Subject: [PATCH 506/580] initial tcc/linux changes --- src/tools/make/configure.c | 5 ++++- src/tools/make/oberon.mk | 16 +++++++++++++--- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/src/tools/make/configure.c b/src/tools/make/configure.c index f82a5d37..8eedc80c 100644 --- a/src/tools/make/configure.c +++ b/src/tools/make/configure.c @@ -126,7 +126,7 @@ void determineOS() { #define optimize "" // " -O1" void determineCCompiler() { - snprintf(libspec, sizeof(libspec), " -l %s", oname); + snprintf(libspec, sizeof(libspec), " -l%s", oname); #if defined(__MINGW32__) compiler = "mingw"; if (sizeof (void*) == 4) { @@ -137,6 +137,9 @@ void determineCCompiler() { #elif defined(__clang__) compiler = "clang"; cc = "clang -fPIC -g" optimize; + #elif defined(__TINYC__) + compiler = "tcc"; + cc = "tcc -g"; #elif defined(__GNUC__) compiler = "gcc"; if (strncasecmp(os, "cygwin", 6) == 0) { diff --git a/src/tools/make/oberon.mk b/src/tools/make/oberon.mk index 20654d40..0ec66ff9 100644 --- a/src/tools/make/oberon.mk +++ b/src/tools/make/oberon.mk @@ -65,10 +65,20 @@ assemble: cd $(BUILDDIR) && $(COMPILE) -c OPM.c extTools.c OPS.c OPT.c cd $(BUILDDIR) && $(COMPILE) -c OPC.c OPV.c OPB.c OPP.c +ifeq ($(COMPILER),tcc) + cd $(BUILDDIR) && $(COMPILE) Compiler.c -o $(ROOTDIR)/$(OBECOMP) \ + SYSTEM.o Configuration.o Platform.o Heap.o Out.o \ + Strings.o Modules.o Files.o Reals.o Texts.o \ + VT100.o extTools.o \ + OPM.o OPS.o OPT.o OPC.o OPV.o OPB.o OPP.o +else cd $(BUILDDIR) && $(COMPILE) $(STATICLINK) Compiler.c -o $(ROOTDIR)/$(OBECOMP) \ - SYSTEM.o Configuration.o Platform.o Heap.o Out.o Strings.o \ - Modules.o Files.o Reals.o Texts.o VT100.o extTools.o \ - OPM.o OPS.o OPT.o OPC.o OPV.o OPB.o OPP.o + SYSTEM.o Configuration.o Platform.o Heap.o Out.o \ + Strings.o Modules.o Files.o Reals.o Texts.o \ + VT100.o extTools.o \ + OPM.o OPS.o OPT.o OPC.o OPV.o OPB.o OPP.o + +endif cp src/runtime/*.[ch] $(BUILDDIR) cp src/runtime/*.Txt $(BUILDDIR) From 9626a95daa47fd73bdf24ba9891f1af32ac21ccf Mon Sep 17 00:00:00 2001 From: Norayr Chilingarian Date: Thu, 10 Oct 2019 17:46:12 +0400 Subject: [PATCH 507/580] updated bootstrap files, main change should be in ext-tools.c (linking options, whitespace removed) --- bootstrap/unix-44/Compiler.c | 2 +- bootstrap/unix-44/Configuration.c | 4 ++-- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Files.c | 2 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 2 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 2 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 2 +- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 2 +- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 2 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Out.c | 2 +- bootstrap/unix-44/Out.h | 2 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/VT100.c | 2 +- bootstrap/unix-44/VT100.h | 2 +- bootstrap/unix-44/extTools.c | 6 +++--- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-48/Compiler.c | 2 +- bootstrap/unix-48/Configuration.c | 4 ++-- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Files.c | 2 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 2 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 2 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 2 +- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 2 +- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 2 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Out.c | 2 +- bootstrap/unix-48/Out.h | 2 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/VT100.c | 2 +- bootstrap/unix-48/VT100.h | 2 +- bootstrap/unix-48/extTools.c | 6 +++--- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-88/Compiler.c | 2 +- bootstrap/unix-88/Configuration.c | 4 ++-- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Files.c | 2 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 2 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 2 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 2 +- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 2 +- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 2 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Out.c | 2 +- bootstrap/unix-88/Out.h | 2 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/VT100.c | 2 +- bootstrap/unix-88/VT100.h | 2 +- bootstrap/unix-88/extTools.c | 6 +++--- bootstrap/unix-88/extTools.h | 2 +- bootstrap/windows-48/Compiler.c | 2 +- bootstrap/windows-48/Configuration.c | 4 ++-- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Files.c | 2 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 2 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 2 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 2 +- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 2 +- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 2 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Out.c | 2 +- bootstrap/windows-48/Out.h | 2 +- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/VT100.c | 2 +- bootstrap/windows-48/VT100.h | 2 +- bootstrap/windows-48/extTools.c | 6 +++--- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-88/Compiler.c | 2 +- bootstrap/windows-88/Configuration.c | 4 ++-- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Files.c | 2 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 2 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 2 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 2 +- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 2 +- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 2 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Out.c | 2 +- bootstrap/windows-88/Out.h | 2 +- bootstrap/windows-88/Platform.c | 2 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/VT100.c | 2 +- bootstrap/windows-88/VT100.h | 2 +- bootstrap/windows-88/extTools.c | 6 +++--- bootstrap/windows-88/extTools.h | 2 +- 185 files changed, 200 insertions(+), 200 deletions(-) diff --git a/bootstrap/unix-44/Compiler.c b/bootstrap/unix-44/Compiler.c index 3c9bd35e..6b188f16 100644 --- a/bootstrap/unix-44/Compiler.c +++ b/bootstrap/unix-44/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index 50c02bb9..409963ca 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index d85d80f6..dbf009d6 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 8f2c5d55..044765bb 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index f0a69373..8aa1d409 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index 31e05d3d..9df04b8d 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index 6ab10893..bf0ce02b 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index 0e237dea..54f9ba0d 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index 6dc9bb50..1389aa0c 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index 6f3e6970..a4397de5 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index 032091ba..9fbb34f6 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 3847bab7..f8db5c9b 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index f1968a6b..fae0e6bb 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 3f9ab009..e685ba09 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index 89ae5649..64a69570 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index 3c2474d3..16c1d6e3 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index 849ca32f..21533b54 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index 523bcc40..ce8ccc05 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index 4e2c9e5d..e57fe046 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index a60c37a0..62a0fada 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index 65364b16..24bb332f 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index a56a7417..e02fbd6d 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index 58f9508b..a6ee396f 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Out.c b/bootstrap/unix-44/Out.c index 5bb316dd..9ec940b8 100644 --- a/bootstrap/unix-44/Out.c +++ b/bootstrap/unix-44/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Out.h b/bootstrap/unix-44/Out.h index 5cc7a37c..f2e05bf1 100644 --- a/bootstrap/unix-44/Out.h +++ b/bootstrap/unix-44/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 9b4b1656..e60c4f2e 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index f19b815c..f97f4ca4 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index d0a86172..72025942 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index d7d40e29..db968500 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index c2deb7cf..37f86a62 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index 75b9b634..bbeafccb 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index 74d010d1..138fa46d 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index 060cd98a..5808c15b 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/VT100.c b/bootstrap/unix-44/VT100.c index a98729de..86a3a929 100644 --- a/bootstrap/unix-44/VT100.c +++ b/bootstrap/unix-44/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/VT100.h b/bootstrap/unix-44/VT100.h index df99892d..4e6a8592 100644 --- a/bootstrap/unix-44/VT100.h +++ b/bootstrap/unix-44/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index 6a411d85..01b7afde 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -72,7 +72,7 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) { - __COPY("gcc -g", s, s__len); + __COPY("tcc -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); @@ -110,7 +110,7 @@ void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN stati Strings_Append((CHAR*)" -L\"", 5, (void*)cmd, 4096); Strings_Append(OPM_InstallDir, 1024, (void*)cmd, 4096); Strings_Append((CHAR*)"/lib\"", 6, (void*)cmd, 4096); - Strings_Append((CHAR*)" -l voc", 8, (void*)cmd, 4096); + Strings_Append((CHAR*)" -lvoc", 7, (void*)cmd, 4096); Strings_Append((CHAR*)"-O", 3, (void*)cmd, 4096); Strings_Append(OPM_Model, 10, (void*)cmd, 4096); Strings_Append((CHAR*)"", 1, (void*)cmd, 4096); diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index 0629bd56..146a1a2a 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/Compiler.c b/bootstrap/unix-48/Compiler.c index 3c9bd35e..6b188f16 100644 --- a/bootstrap/unix-48/Compiler.c +++ b/bootstrap/unix-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index 50c02bb9..409963ca 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index d85d80f6..dbf009d6 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 8f2c5d55..044765bb 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index f0a69373..8aa1d409 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index 31e05d3d..9df04b8d 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index 6ab10893..bf0ce02b 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index 0e237dea..54f9ba0d 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index 6dc9bb50..1389aa0c 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index 6f3e6970..a4397de5 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index 032091ba..9fbb34f6 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 3847bab7..f8db5c9b 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index f1968a6b..fae0e6bb 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 3f9ab009..e685ba09 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index 89ae5649..64a69570 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index 3c2474d3..16c1d6e3 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index 849ca32f..21533b54 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index 523bcc40..ce8ccc05 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index 4e2c9e5d..e57fe046 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 1bf52545..84eb203a 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index 65364b16..24bb332f 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index a56a7417..e02fbd6d 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index 58f9508b..a6ee396f 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Out.c b/bootstrap/unix-48/Out.c index 5bb316dd..9ec940b8 100644 --- a/bootstrap/unix-48/Out.c +++ b/bootstrap/unix-48/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Out.h b/bootstrap/unix-48/Out.h index 5cc7a37c..f2e05bf1 100644 --- a/bootstrap/unix-48/Out.h +++ b/bootstrap/unix-48/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 9b4b1656..e60c4f2e 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index f19b815c..f97f4ca4 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index d0a86172..72025942 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index d7d40e29..db968500 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index c2deb7cf..37f86a62 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index 75b9b634..bbeafccb 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index 8096bc1d..98c548ad 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index f7b5d487..dbc379f3 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/VT100.c b/bootstrap/unix-48/VT100.c index a98729de..86a3a929 100644 --- a/bootstrap/unix-48/VT100.c +++ b/bootstrap/unix-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/VT100.h b/bootstrap/unix-48/VT100.h index df99892d..4e6a8592 100644 --- a/bootstrap/unix-48/VT100.h +++ b/bootstrap/unix-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index 6a411d85..01b7afde 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -72,7 +72,7 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) { - __COPY("gcc -g", s, s__len); + __COPY("tcc -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); @@ -110,7 +110,7 @@ void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN stati Strings_Append((CHAR*)" -L\"", 5, (void*)cmd, 4096); Strings_Append(OPM_InstallDir, 1024, (void*)cmd, 4096); Strings_Append((CHAR*)"/lib\"", 6, (void*)cmd, 4096); - Strings_Append((CHAR*)" -l voc", 8, (void*)cmd, 4096); + Strings_Append((CHAR*)" -lvoc", 7, (void*)cmd, 4096); Strings_Append((CHAR*)"-O", 3, (void*)cmd, 4096); Strings_Append(OPM_Model, 10, (void*)cmd, 4096); Strings_Append((CHAR*)"", 1, (void*)cmd, 4096); diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index 0629bd56..146a1a2a 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/Compiler.c b/bootstrap/unix-88/Compiler.c index 3c9bd35e..6b188f16 100644 --- a/bootstrap/unix-88/Compiler.c +++ b/bootstrap/unix-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index 50c02bb9..409963ca 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index d85d80f6..dbf009d6 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 9b17254c..fee60e95 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 441c4007..829f677c 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index 9e3f5ae9..ba20585f 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index 5db19e82..9bbf2905 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index b0840e01..d02cab4b 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index be398042..978b1734 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index 6f3e6970..a4397de5 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index 032091ba..9fbb34f6 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index 3847bab7..f8db5c9b 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index f1968a6b..fae0e6bb 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 7079d9d3..c26c8fec 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index 89ae5649..64a69570 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index bfbc425e..b55812ec 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index 849ca32f..21533b54 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index 523bcc40..ce8ccc05 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index 4e2c9e5d..e57fe046 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index fe093273..e212b6dc 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 65364b16..24bb332f 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 777dee8c..db0f15d9 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index 58f9508b..a6ee396f 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Out.c b/bootstrap/unix-88/Out.c index 5bb316dd..9ec940b8 100644 --- a/bootstrap/unix-88/Out.c +++ b/bootstrap/unix-88/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Out.h b/bootstrap/unix-88/Out.h index 5cc7a37c..f2e05bf1 100644 --- a/bootstrap/unix-88/Out.h +++ b/bootstrap/unix-88/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 0e52a0fe..a7787021 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index 13166a06..7d39fd5b 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index d0a86172..72025942 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index d7d40e29..db968500 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index c2deb7cf..37f86a62 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index 75b9b634..bbeafccb 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index 9fb45ce9..22cd2acd 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index 93a7b381..44954586 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/VT100.c b/bootstrap/unix-88/VT100.c index a98729de..86a3a929 100644 --- a/bootstrap/unix-88/VT100.c +++ b/bootstrap/unix-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/VT100.h b/bootstrap/unix-88/VT100.h index df99892d..4e6a8592 100644 --- a/bootstrap/unix-88/VT100.h +++ b/bootstrap/unix-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index 6a411d85..01b7afde 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -72,7 +72,7 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) { - __COPY("gcc -g", s, s__len); + __COPY("tcc -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); @@ -110,7 +110,7 @@ void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN stati Strings_Append((CHAR*)" -L\"", 5, (void*)cmd, 4096); Strings_Append(OPM_InstallDir, 1024, (void*)cmd, 4096); Strings_Append((CHAR*)"/lib\"", 6, (void*)cmd, 4096); - Strings_Append((CHAR*)" -l voc", 8, (void*)cmd, 4096); + Strings_Append((CHAR*)" -lvoc", 7, (void*)cmd, 4096); Strings_Append((CHAR*)"-O", 3, (void*)cmd, 4096); Strings_Append(OPM_Model, 10, (void*)cmd, 4096); Strings_Append((CHAR*)"", 1, (void*)cmd, 4096); diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index 0629bd56..146a1a2a 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/Compiler.c b/bootstrap/windows-48/Compiler.c index 3c9bd35e..6b188f16 100644 --- a/bootstrap/windows-48/Compiler.c +++ b/bootstrap/windows-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index 50c02bb9..409963ca 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index d85d80f6..dbf009d6 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 923a2d90..00670e70 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index 5524bb64..bd36750b 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index 31e05d3d..9df04b8d 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index 6ab10893..bf0ce02b 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index 917d5517..96791b9b 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index 6dc9bb50..1389aa0c 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index 6f3e6970..a4397de5 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index 032091ba..9fbb34f6 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 3847bab7..f8db5c9b 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index f1968a6b..fae0e6bb 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 3f9ab009..e685ba09 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index 89ae5649..64a69570 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index 3c2474d3..16c1d6e3 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index 849ca32f..21533b54 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index 523bcc40..ce8ccc05 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index 4e2c9e5d..e57fe046 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 1bf52545..84eb203a 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index 65364b16..24bb332f 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index a56a7417..e02fbd6d 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index 58f9508b..a6ee396f 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Out.c b/bootstrap/windows-48/Out.c index c1cc48bd..f0f851c9 100644 --- a/bootstrap/windows-48/Out.c +++ b/bootstrap/windows-48/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Out.h b/bootstrap/windows-48/Out.h index 5cc7a37c..f2e05bf1 100644 --- a/bootstrap/windows-48/Out.h +++ b/bootstrap/windows-48/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 1e9d3fdd..c9cd7326 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index e7e58fb1..be514393 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index d0a86172..72025942 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index d7d40e29..db968500 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index c2deb7cf..37f86a62 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index 75b9b634..bbeafccb 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index 8096bc1d..98c548ad 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index f7b5d487..dbc379f3 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/VT100.c b/bootstrap/windows-48/VT100.c index a98729de..86a3a929 100644 --- a/bootstrap/windows-48/VT100.c +++ b/bootstrap/windows-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/VT100.h b/bootstrap/windows-48/VT100.h index df99892d..4e6a8592 100644 --- a/bootstrap/windows-48/VT100.h +++ b/bootstrap/windows-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index 6a411d85..01b7afde 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -72,7 +72,7 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) { - __COPY("gcc -g", s, s__len); + __COPY("tcc -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); @@ -110,7 +110,7 @@ void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN stati Strings_Append((CHAR*)" -L\"", 5, (void*)cmd, 4096); Strings_Append(OPM_InstallDir, 1024, (void*)cmd, 4096); Strings_Append((CHAR*)"/lib\"", 6, (void*)cmd, 4096); - Strings_Append((CHAR*)" -l voc", 8, (void*)cmd, 4096); + Strings_Append((CHAR*)" -lvoc", 7, (void*)cmd, 4096); Strings_Append((CHAR*)"-O", 3, (void*)cmd, 4096); Strings_Append(OPM_Model, 10, (void*)cmd, 4096); Strings_Append((CHAR*)"", 1, (void*)cmd, 4096); diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index 0629bd56..146a1a2a 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/Compiler.c b/bootstrap/windows-88/Compiler.c index 3c9bd35e..6b188f16 100644 --- a/bootstrap/windows-88/Compiler.c +++ b/bootstrap/windows-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index 50c02bb9..409963ca 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index d85d80f6..dbf009d6 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 4c53ff0e..514b5090 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 96331322..c679e795 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index 9e3f5ae9..ba20585f 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index 5db19e82..9bbf2905 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 294e8d2f..de2da183 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index be398042..978b1734 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index 6f3e6970..a4397de5 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index 032091ba..9fbb34f6 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index 3847bab7..f8db5c9b 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index f1968a6b..fae0e6bb 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 7079d9d3..c26c8fec 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index 89ae5649..64a69570 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index bfbc425e..b55812ec 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index 849ca32f..21533b54 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index 523bcc40..ce8ccc05 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index 4e2c9e5d..e57fe046 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index fe093273..e212b6dc 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 65364b16..24bb332f 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 777dee8c..db0f15d9 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index 58f9508b..a6ee396f 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Out.c b/bootstrap/windows-88/Out.c index c1cc48bd..f0f851c9 100644 --- a/bootstrap/windows-88/Out.c +++ b/bootstrap/windows-88/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Out.h b/bootstrap/windows-88/Out.h index 5cc7a37c..f2e05bf1 100644 --- a/bootstrap/windows-88/Out.h +++ b/bootstrap/windows-88/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 36884101..4a739dc5 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index 1544c29b..69b78662 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index d0a86172..72025942 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index d7d40e29..db968500 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index c2deb7cf..37f86a62 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index 75b9b634..bbeafccb 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index 9fb45ce9..22cd2acd 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index 93a7b381..44954586 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/VT100.c b/bootstrap/windows-88/VT100.c index a98729de..86a3a929 100644 --- a/bootstrap/windows-88/VT100.c +++ b/bootstrap/windows-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/VT100.h b/bootstrap/windows-88/VT100.h index df99892d..4e6a8592 100644 --- a/bootstrap/windows-88/VT100.h +++ b/bootstrap/windows-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index 6a411d85..01b7afde 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -72,7 +72,7 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) { - __COPY("gcc -g", s, s__len); + __COPY("tcc -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); @@ -110,7 +110,7 @@ void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN stati Strings_Append((CHAR*)" -L\"", 5, (void*)cmd, 4096); Strings_Append(OPM_InstallDir, 1024, (void*)cmd, 4096); Strings_Append((CHAR*)"/lib\"", 6, (void*)cmd, 4096); - Strings_Append((CHAR*)" -l voc", 8, (void*)cmd, 4096); + Strings_Append((CHAR*)" -lvoc", 7, (void*)cmd, 4096); Strings_Append((CHAR*)"-O", 3, (void*)cmd, 4096); Strings_Append(OPM_Model, 10, (void*)cmd, 4096); Strings_Append((CHAR*)"", 1, (void*)cmd, 4096); diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index 0629bd56..146a1a2a 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/01/04]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef extTools__h #define extTools__h From 7b9b5cb4f113b389d7bc0c7a522809c516086fd0 Mon Sep 17 00:00:00 2001 From: Norayr Chilingarian Date: Fri, 11 Oct 2019 15:00:02 +0400 Subject: [PATCH 508/580] simpler way of removing 'static' for tcc in configure.c, reverted oberon.mk back, according to this comment: https://github.com/vishaps/voc/commit/a35668bf93b8550559be7e7a45d759d68db87b44#r35448231 update of bootstrap sources. --- bootstrap/unix-44/Compiler.c | 2 +- bootstrap/unix-44/Configuration.c | 4 ++-- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Files.c | 2 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 2 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 2 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 2 +- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 2 +- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 2 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Out.c | 2 +- bootstrap/unix-44/Out.h | 2 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/VT100.c | 2 +- bootstrap/unix-44/VT100.h | 2 +- bootstrap/unix-44/extTools.c | 4 ++-- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-48/Compiler.c | 2 +- bootstrap/unix-48/Configuration.c | 4 ++-- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Files.c | 2 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 2 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 2 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 2 +- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 2 +- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 2 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Out.c | 2 +- bootstrap/unix-48/Out.h | 2 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/VT100.c | 2 +- bootstrap/unix-48/VT100.h | 2 +- bootstrap/unix-48/extTools.c | 4 ++-- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-88/Compiler.c | 2 +- bootstrap/unix-88/Configuration.c | 4 ++-- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Files.c | 2 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 2 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 2 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 2 +- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 2 +- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 2 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Out.c | 2 +- bootstrap/unix-88/Out.h | 2 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/VT100.c | 2 +- bootstrap/unix-88/VT100.h | 2 +- bootstrap/unix-88/extTools.c | 4 ++-- bootstrap/unix-88/extTools.h | 2 +- bootstrap/windows-48/Compiler.c | 2 +- bootstrap/windows-48/Configuration.c | 4 ++-- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Files.c | 2 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 2 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 2 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 2 +- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 2 +- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 2 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Out.c | 2 +- bootstrap/windows-48/Out.h | 2 +- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/VT100.c | 2 +- bootstrap/windows-48/VT100.h | 2 +- bootstrap/windows-48/extTools.c | 4 ++-- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-88/Compiler.c | 2 +- bootstrap/windows-88/Configuration.c | 4 ++-- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Files.c | 2 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 2 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 2 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 2 +- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 2 +- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 2 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Out.c | 2 +- bootstrap/windows-88/Out.h | 2 +- bootstrap/windows-88/Platform.c | 2 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/VT100.c | 2 +- bootstrap/windows-88/VT100.h | 2 +- bootstrap/windows-88/extTools.c | 4 ++-- bootstrap/windows-88/extTools.h | 2 +- src/tools/make/configure.c | 1 + src/tools/make/oberon.mk | 9 --------- 187 files changed, 196 insertions(+), 204 deletions(-) diff --git a/bootstrap/unix-44/Compiler.c b/bootstrap/unix-44/Compiler.c index 6b188f16..706e5dac 100644 --- a/bootstrap/unix-44/Compiler.c +++ b/bootstrap/unix-44/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index 409963ca..af1b360f 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index dbf009d6..75963938 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 044765bb..6b75d2c9 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index 8aa1d409..e01b30c1 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index 9df04b8d..1712292d 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index bf0ce02b..95defe4d 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index 54f9ba0d..7fcd0339 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index 1389aa0c..7132d67d 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index a4397de5..ee9816a3 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index 9fbb34f6..eca13e1c 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index f8db5c9b..9d950335 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index fae0e6bb..ed46a18d 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index e685ba09..c00ef3c0 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index 64a69570..ed863d1c 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index 16c1d6e3..d6b5b011 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index 21533b54..ebe70724 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index ce8ccc05..e535af0d 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index e57fe046..0aae61b1 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index 62a0fada..6dfd6a9f 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index 24bb332f..4bdb3a41 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index e02fbd6d..b6969178 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index a6ee396f..36e6ffa1 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Out.c b/bootstrap/unix-44/Out.c index 9ec940b8..b37ac764 100644 --- a/bootstrap/unix-44/Out.c +++ b/bootstrap/unix-44/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Out.h b/bootstrap/unix-44/Out.h index f2e05bf1..b328aba8 100644 --- a/bootstrap/unix-44/Out.h +++ b/bootstrap/unix-44/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index e60c4f2e..2571cf00 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index f97f4ca4..cd5f8097 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 72025942..61d38fc6 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index db968500..cf6fff34 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index 37f86a62..7d141b4d 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index bbeafccb..7101e619 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index 138fa46d..98d2ca37 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index 5808c15b..a70ae3ca 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/VT100.c b/bootstrap/unix-44/VT100.c index 86a3a929..16cd0cf7 100644 --- a/bootstrap/unix-44/VT100.c +++ b/bootstrap/unix-44/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/VT100.h b/bootstrap/unix-44/VT100.h index 4e6a8592..c8271316 100644 --- a/bootstrap/unix-44/VT100.h +++ b/bootstrap/unix-44/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index 01b7afde..e091956d 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -102,7 +102,7 @@ void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN stati Strings_Append((CHAR*)".c ", 4, (void*)cmd, 4096); Strings_Append(additionalopts, additionalopts__len, (void*)cmd, 4096); if (statically) { - Strings_Append((CHAR*)" -static", 9, (void*)cmd, 4096); + Strings_Append((CHAR*)"", 1, (void*)cmd, 4096); } Strings_Append((CHAR*)" -o ", 5, (void*)cmd, 4096); Strings_Append(moduleName, moduleName__len, (void*)cmd, 4096); diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index 146a1a2a..ad119444 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/Compiler.c b/bootstrap/unix-48/Compiler.c index 6b188f16..706e5dac 100644 --- a/bootstrap/unix-48/Compiler.c +++ b/bootstrap/unix-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index 409963ca..af1b360f 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index dbf009d6..75963938 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 044765bb..6b75d2c9 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index 8aa1d409..e01b30c1 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index 9df04b8d..1712292d 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index bf0ce02b..95defe4d 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index 54f9ba0d..7fcd0339 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index 1389aa0c..7132d67d 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index a4397de5..ee9816a3 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index 9fbb34f6..eca13e1c 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index f8db5c9b..9d950335 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index fae0e6bb..ed46a18d 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index e685ba09..c00ef3c0 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index 64a69570..ed863d1c 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index 16c1d6e3..d6b5b011 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index 21533b54..ebe70724 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index ce8ccc05..e535af0d 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index e57fe046..0aae61b1 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 84eb203a..cb27a509 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index 24bb332f..4bdb3a41 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index e02fbd6d..b6969178 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index a6ee396f..36e6ffa1 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Out.c b/bootstrap/unix-48/Out.c index 9ec940b8..b37ac764 100644 --- a/bootstrap/unix-48/Out.c +++ b/bootstrap/unix-48/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Out.h b/bootstrap/unix-48/Out.h index f2e05bf1..b328aba8 100644 --- a/bootstrap/unix-48/Out.h +++ b/bootstrap/unix-48/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index e60c4f2e..2571cf00 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index f97f4ca4..cd5f8097 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 72025942..61d38fc6 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index db968500..cf6fff34 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index 37f86a62..7d141b4d 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index bbeafccb..7101e619 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index 98c548ad..a43f9e79 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index dbc379f3..f8efcd82 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/VT100.c b/bootstrap/unix-48/VT100.c index 86a3a929..16cd0cf7 100644 --- a/bootstrap/unix-48/VT100.c +++ b/bootstrap/unix-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/VT100.h b/bootstrap/unix-48/VT100.h index 4e6a8592..c8271316 100644 --- a/bootstrap/unix-48/VT100.h +++ b/bootstrap/unix-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index 01b7afde..e091956d 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -102,7 +102,7 @@ void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN stati Strings_Append((CHAR*)".c ", 4, (void*)cmd, 4096); Strings_Append(additionalopts, additionalopts__len, (void*)cmd, 4096); if (statically) { - Strings_Append((CHAR*)" -static", 9, (void*)cmd, 4096); + Strings_Append((CHAR*)"", 1, (void*)cmd, 4096); } Strings_Append((CHAR*)" -o ", 5, (void*)cmd, 4096); Strings_Append(moduleName, moduleName__len, (void*)cmd, 4096); diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index 146a1a2a..ad119444 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/Compiler.c b/bootstrap/unix-88/Compiler.c index 6b188f16..706e5dac 100644 --- a/bootstrap/unix-88/Compiler.c +++ b/bootstrap/unix-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index 409963ca..af1b360f 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index dbf009d6..75963938 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index fee60e95..155e0a04 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 829f677c..e594e82b 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index ba20585f..e9555122 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index 9bbf2905..e09ec7a8 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index d02cab4b..b5952131 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index 978b1734..3a135985 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index a4397de5..ee9816a3 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index 9fbb34f6..eca13e1c 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index f8db5c9b..9d950335 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index fae0e6bb..ed46a18d 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index c26c8fec..faa2b9d7 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index 64a69570..ed863d1c 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index b55812ec..814adb3c 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index 21533b54..ebe70724 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index ce8ccc05..e535af0d 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index e57fe046..0aae61b1 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index e212b6dc..b834bc38 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 24bb332f..4bdb3a41 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index db0f15d9..2f9f78c6 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index a6ee396f..36e6ffa1 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Out.c b/bootstrap/unix-88/Out.c index 9ec940b8..b37ac764 100644 --- a/bootstrap/unix-88/Out.c +++ b/bootstrap/unix-88/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Out.h b/bootstrap/unix-88/Out.h index f2e05bf1..b328aba8 100644 --- a/bootstrap/unix-88/Out.h +++ b/bootstrap/unix-88/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index a7787021..99fd71e3 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index 7d39fd5b..77e7eabf 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 72025942..61d38fc6 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index db968500..cf6fff34 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index 37f86a62..7d141b4d 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index bbeafccb..7101e619 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index 22cd2acd..fadb3d3b 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index 44954586..95d43066 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/VT100.c b/bootstrap/unix-88/VT100.c index 86a3a929..16cd0cf7 100644 --- a/bootstrap/unix-88/VT100.c +++ b/bootstrap/unix-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/VT100.h b/bootstrap/unix-88/VT100.h index 4e6a8592..c8271316 100644 --- a/bootstrap/unix-88/VT100.h +++ b/bootstrap/unix-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index 01b7afde..e091956d 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -102,7 +102,7 @@ void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN stati Strings_Append((CHAR*)".c ", 4, (void*)cmd, 4096); Strings_Append(additionalopts, additionalopts__len, (void*)cmd, 4096); if (statically) { - Strings_Append((CHAR*)" -static", 9, (void*)cmd, 4096); + Strings_Append((CHAR*)"", 1, (void*)cmd, 4096); } Strings_Append((CHAR*)" -o ", 5, (void*)cmd, 4096); Strings_Append(moduleName, moduleName__len, (void*)cmd, 4096); diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index 146a1a2a..ad119444 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/Compiler.c b/bootstrap/windows-48/Compiler.c index 6b188f16..706e5dac 100644 --- a/bootstrap/windows-48/Compiler.c +++ b/bootstrap/windows-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index 409963ca..af1b360f 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index dbf009d6..75963938 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 00670e70..b7204686 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index bd36750b..d4f352c8 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index 9df04b8d..1712292d 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index bf0ce02b..95defe4d 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index 96791b9b..70e3c600 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index 1389aa0c..7132d67d 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index a4397de5..ee9816a3 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index 9fbb34f6..eca13e1c 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index f8db5c9b..9d950335 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index fae0e6bb..ed46a18d 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index e685ba09..c00ef3c0 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index 64a69570..ed863d1c 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index 16c1d6e3..d6b5b011 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index 21533b54..ebe70724 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index ce8ccc05..e535af0d 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index e57fe046..0aae61b1 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 84eb203a..cb27a509 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index 24bb332f..4bdb3a41 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index e02fbd6d..b6969178 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index a6ee396f..36e6ffa1 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Out.c b/bootstrap/windows-48/Out.c index f0f851c9..d85cee6b 100644 --- a/bootstrap/windows-48/Out.c +++ b/bootstrap/windows-48/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Out.h b/bootstrap/windows-48/Out.h index f2e05bf1..b328aba8 100644 --- a/bootstrap/windows-48/Out.h +++ b/bootstrap/windows-48/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index c9cd7326..9de4c27b 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index be514393..02f3b4e1 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 72025942..61d38fc6 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index db968500..cf6fff34 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index 37f86a62..7d141b4d 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index bbeafccb..7101e619 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index 98c548ad..a43f9e79 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index dbc379f3..f8efcd82 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/VT100.c b/bootstrap/windows-48/VT100.c index 86a3a929..16cd0cf7 100644 --- a/bootstrap/windows-48/VT100.c +++ b/bootstrap/windows-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/VT100.h b/bootstrap/windows-48/VT100.h index 4e6a8592..c8271316 100644 --- a/bootstrap/windows-48/VT100.h +++ b/bootstrap/windows-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index 01b7afde..e091956d 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -102,7 +102,7 @@ void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN stati Strings_Append((CHAR*)".c ", 4, (void*)cmd, 4096); Strings_Append(additionalopts, additionalopts__len, (void*)cmd, 4096); if (statically) { - Strings_Append((CHAR*)" -static", 9, (void*)cmd, 4096); + Strings_Append((CHAR*)"", 1, (void*)cmd, 4096); } Strings_Append((CHAR*)" -o ", 5, (void*)cmd, 4096); Strings_Append(moduleName, moduleName__len, (void*)cmd, 4096); diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index 146a1a2a..ad119444 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/Compiler.c b/bootstrap/windows-88/Compiler.c index 6b188f16..706e5dac 100644 --- a/bootstrap/windows-88/Compiler.c +++ b/bootstrap/windows-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index 409963ca..af1b360f 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index dbf009d6..75963938 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 514b5090..e3a43ec3 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index c679e795..4f0adc88 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index ba20585f..e9555122 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index 9bbf2905..e09ec7a8 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index de2da183..2432e8d7 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index 978b1734..3a135985 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index a4397de5..ee9816a3 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index 9fbb34f6..eca13e1c 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index f8db5c9b..9d950335 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index fae0e6bb..ed46a18d 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index c26c8fec..faa2b9d7 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index 64a69570..ed863d1c 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index b55812ec..814adb3c 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index 21533b54..ebe70724 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index ce8ccc05..e535af0d 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index e57fe046..0aae61b1 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index e212b6dc..b834bc38 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 24bb332f..4bdb3a41 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index db0f15d9..2f9f78c6 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index a6ee396f..36e6ffa1 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Out.c b/bootstrap/windows-88/Out.c index f0f851c9..d85cee6b 100644 --- a/bootstrap/windows-88/Out.c +++ b/bootstrap/windows-88/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Out.h b/bootstrap/windows-88/Out.h index f2e05bf1..b328aba8 100644 --- a/bootstrap/windows-88/Out.h +++ b/bootstrap/windows-88/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 4a739dc5..b6b5a74c 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index 69b78662..391a1d4d 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 72025942..61d38fc6 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index db968500..cf6fff34 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index 37f86a62..7d141b4d 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index bbeafccb..7101e619 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index 22cd2acd..fadb3d3b 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index 44954586..95d43066 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/VT100.c b/bootstrap/windows-88/VT100.c index 86a3a929..16cd0cf7 100644 --- a/bootstrap/windows-88/VT100.c +++ b/bootstrap/windows-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/VT100.h b/bootstrap/windows-88/VT100.h index 4e6a8592..c8271316 100644 --- a/bootstrap/windows-88/VT100.h +++ b/bootstrap/windows-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index 01b7afde..e091956d 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -102,7 +102,7 @@ void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN stati Strings_Append((CHAR*)".c ", 4, (void*)cmd, 4096); Strings_Append(additionalopts, additionalopts__len, (void*)cmd, 4096); if (statically) { - Strings_Append((CHAR*)" -static", 9, (void*)cmd, 4096); + Strings_Append((CHAR*)"", 1, (void*)cmd, 4096); } Strings_Append((CHAR*)" -o ", 5, (void*)cmd, 4096); Strings_Append(moduleName, moduleName__len, (void*)cmd, 4096); diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index 146a1a2a..ad119444 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/src/tools/make/configure.c b/src/tools/make/configure.c index 8eedc80c..ecfc3f1f 100644 --- a/src/tools/make/configure.c +++ b/src/tools/make/configure.c @@ -140,6 +140,7 @@ void determineCCompiler() { #elif defined(__TINYC__) compiler = "tcc"; cc = "tcc -g"; + staticlink = ""; #elif defined(__GNUC__) compiler = "gcc"; if (strncasecmp(os, "cygwin", 6) == 0) { diff --git a/src/tools/make/oberon.mk b/src/tools/make/oberon.mk index 0ec66ff9..ffb27ace 100644 --- a/src/tools/make/oberon.mk +++ b/src/tools/make/oberon.mk @@ -65,21 +65,12 @@ assemble: cd $(BUILDDIR) && $(COMPILE) -c OPM.c extTools.c OPS.c OPT.c cd $(BUILDDIR) && $(COMPILE) -c OPC.c OPV.c OPB.c OPP.c -ifeq ($(COMPILER),tcc) - cd $(BUILDDIR) && $(COMPILE) Compiler.c -o $(ROOTDIR)/$(OBECOMP) \ - SYSTEM.o Configuration.o Platform.o Heap.o Out.o \ - Strings.o Modules.o Files.o Reals.o Texts.o \ - VT100.o extTools.o \ - OPM.o OPS.o OPT.o OPC.o OPV.o OPB.o OPP.o -else cd $(BUILDDIR) && $(COMPILE) $(STATICLINK) Compiler.c -o $(ROOTDIR)/$(OBECOMP) \ SYSTEM.o Configuration.o Platform.o Heap.o Out.o \ Strings.o Modules.o Files.o Reals.o Texts.o \ VT100.o extTools.o \ OPM.o OPS.o OPT.o OPC.o OPV.o OPB.o OPP.o -endif - cp src/runtime/*.[ch] $(BUILDDIR) cp src/runtime/*.Txt $(BUILDDIR) cp src/runtime/*.Txt $(ROOTDIR) From 49cb239730945ff9d8e1296322704695b1b4b73a Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 11 Oct 2019 17:24:05 +0100 Subject: [PATCH 509/580] Update autobuild scripts for freenas server --- src/tools/autobuild/runbuilds.pl | 2 ++ src/tools/autobuild/server.pl | 37 +++++++++++++++++++------------ src/tools/autobuild/trigger-build | 1 - 3 files changed, 25 insertions(+), 15 deletions(-) delete mode 100644 src/tools/autobuild/trigger-build diff --git a/src/tools/autobuild/runbuilds.pl b/src/tools/autobuild/runbuilds.pl index 8fca8869..23a7f1db 100644 --- a/src/tools/autobuild/runbuilds.pl +++ b/src/tools/autobuild/runbuilds.pl @@ -3,6 +3,8 @@ use strict; use warnings; use POSIX "strftime"; +$SIG{CHLD} = 'IGNORE'; + my $home = "/home/dave/vishap-build"; chdir $home; diff --git a/src/tools/autobuild/server.pl b/src/tools/autobuild/server.pl index 1016f78f..f076a6c5 100755 --- a/src/tools/autobuild/server.pl +++ b/src/tools/autobuild/server.pl @@ -11,25 +11,28 @@ use Data::Dumper; use JSON; use sigtrap qw(die INT QUIT); -my $home = "/usr/home/dave/vishap-build"; +my $home = "/home/dave/vishap-build"; my $criggleplop = "splurd crungle splonge."; $| = 1; +$SIG{CHLD} = 'IGNORE'; my $PORT = 9000; -my $server = HTTP::Daemon->new(LocalPort => $PORT, ReuseAddr => 1); +my $server = HTTP::Daemon->new(Family => AF_INET, LocalPort => $PORT, ReuseAddr => 1); die "Cannot setup server" unless $server; print "[$$: Accepting clients at http://localhost:$PORT/]\n"; while (my $client = $server->accept) { (my $pid = fork()) // die("Couldn't fork."); - if ($pid) {close $client; undef $client} else {ServeRequests($client); exit} + if ($pid) {$client->close; undef $client} + else {ServeRequests($client); $client->close; undef $client; exit} } print "$$: server->accept failed. Exiting.\n"; exit; sub StartBuilds {my ($branch) = @_; + print " -- start builds for branch $branch.\n"; open TRIGGER, ">trigger-$branch"; print TRIGGER "trigger.\n"; close TRIGGER; my $running = 0; if (open PID, "; close PID} @@ -41,6 +44,7 @@ sub StartBuilds {my ($branch) = @_; open PID, ">pid"; print PID "$child.\n"; close PID; } else { # This is the child, we actually run all triggered builds. + # print "Debug: About to run perl >$home/runbuilds.log ...\n"; exec "perl $home/runbuilds.pl >$home/runbuilds.log"; exit; # Shouldn't get here } @@ -97,14 +101,17 @@ sub SendFile {my ($client, $file) = @_; sub VishapStatus {my ($client) = @_; + print " -- generate status.\n"; system "perl makesvg.pl"; # Construct an up-to-date status file SendFile($client, "vishaps-status.svg"); } sub LogFileResponse {my ($client, $path) = @_; if (-f "logs/$path.log") { + print " -- send log for build $path.\n"; SendFile($client, "logs/$path.log") } else { + print " -- respond forbidden: no log for $path.\n"; $client->send_error(RC_FORBIDDEN) } } @@ -115,27 +122,31 @@ sub ServeRequests {my ($client) = @_; while (my $request = $client->get_request) { if ($request->method eq 'GET') { - my $uri = $request->uri; my $host = $request->headers->{host}; - - print "URI requested: '$uri'.\n"; - print "Host: '$host'.\n"; - + my $uri = $request->uri; $uri =~ s/^\///; $uri =~ s/^githubhook\///; + print "Request: $uri\n"; - if ($uri eq 'vishaps-status.svg') {VishapStatus($client)} + if ($uri eq 'vishaps-status.svg') {VishapStatus($client)} + elsif ($uri eq 'vishaps-trigger') { + $client->send_file_response("response.html"); + StartBuilds("master"); + } + elsif ($uri =~ /^vishaps-trigger\/([-_a-z0-9]+)/i) { + $client->send_file_response("response.html"); + StartBuilds($1); + } else {LogFileResponse($client, $uri)} - } elsif ($request->method eq 'POST') { $client->send_file_response("response.html"); my $event = $request->headers->{'x-github-event'}; my $githubsig = substr($request->headers->{'x-hub-signature'}, 5); my $mysig = hmac_sha1_hex($request->content, $criggleplop); - print "Github event: $event, mysig $mysig, githubsig: $githubsig.\n"; + print "Github POST: $event, mysig $mysig, githubsig: $githubsig.\n"; if (($event eq "push") && ($mysig eq $githubsig)) { my $content = $request->content; $content =~ s/%([0-9A-Fa-f]{2})/chr(hex($1))/eg; # Unescape %xx sequences. @@ -146,9 +157,7 @@ sub ServeRequests {my ($client) = @_; print "Request method $request->method forbidden.\n"; $client->send_error(RC_FORBIDDEN) + } } - $client->close; - undef $client; - #print "$$: no more requests, closing client.\n"; } diff --git a/src/tools/autobuild/trigger-build b/src/tools/autobuild/trigger-build deleted file mode 100644 index 9b24da92..00000000 --- a/src/tools/autobuild/trigger-build +++ /dev/null @@ -1 +0,0 @@ -another From 8cec6b37948d07359c857d65f55e313731b911ba Mon Sep 17 00:00:00 2001 From: David C W Brown Date: Fri, 11 Oct 2019 17:41:45 +0100 Subject: [PATCH 510/580] A bit more info about static vs dynamic linking Some systems support only one. --- doc/Compiling.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/Compiling.md b/doc/Compiling.md index abeaf6c2..ebb84ce9 100644 --- a/doc/Compiling.md +++ b/doc/Compiling.md @@ -57,11 +57,13 @@ The following options designate the main module: | Compiler option | Use | | :-------------: | --------------------------- | -| ```-m``` | Generate loadable binary using dynamic library loading (on systems that support it). | -| ```-M``` | Generate loadable binary with all library references statically linked. | +| ```-m``` | Generate loadable binary using dynamic library loading (*see note*) | +| ```-M``` | Generate loadable binary with all library references statically linked (*see note*) | For a main module, no .sym or .h files are generated, and the C compiler is called with additional parameters to generate the execututable binary, linking the object files needed for imported modules. +*Note:* not all systems support both static and dynamic linking: some support only static; some support only dynamic. When a system only supports one, ```-m``` and ```-M``` behave the same. + ### Separate compilation Each module may be compiled by a separate command line, although the imports of a module must be compiled before the module is compiled. All three generated files (.sym, .c and .h) must be retained at least until all modules dependent on this module have been compiled. From e4743120def912ad66a98c65a2a168a0c8ef4f9a Mon Sep 17 00:00:00 2001 From: David Brown Date: Mon, 4 Nov 2019 16:06:16 +0000 Subject: [PATCH 511/580] Add support for building in a path containing spaces. --- src/compiler/extTools.Mod | 4 +- src/test/confidence/testenv.sh | 6 +- src/tools/make/oberon.mk | 329 ++++++++++++++++---------------- src/tools/make/sourcechanges.sh | 6 +- 4 files changed, 172 insertions(+), 173 deletions(-) diff --git a/src/compiler/extTools.Mod b/src/compiler/extTools.Mod index fdd38e94..0c7acded 100644 --- a/src/compiler/extTools.Mod +++ b/src/compiler/extTools.Mod @@ -107,13 +107,13 @@ PROCEDURE LinkMain*(VAR moduleName: ARRAY OF CHAR; statically: BOOLEAN; addition Strings.Append(Configuration.name, cmd); Strings.Append('-O', cmd); Strings.Append(OPM.Model, cmd); - Strings.Append('.dylib ', cmd); + Strings.Append('.dylib "', cmd); Strings.Append(OPM.InstallDir, cmd); Strings.Append('/lib/lib', cmd); Strings.Append(Configuration.name, cmd); Strings.Append('-O', cmd); Strings.Append(OPM.Model, cmd); - Strings.Append('.dylib ', cmd); + Strings.Append('.dylib" ', cmd); Strings.Append(moduleName, cmd); execute("Set library directory: ", cmd) END diff --git a/src/test/confidence/testenv.sh b/src/test/confidence/testenv.sh index 69bfb20e..fdb13cc2 100755 --- a/src/test/confidence/testenv.sh +++ b/src/test/confidence/testenv.sh @@ -2,16 +2,16 @@ ## '.' this file from individual test.sh files. #set -e -echo --- Confidence test $(basename $PWD) --- +echo --- Confidence test $(basename "$PWD") --- if which cygpath >/dev/null 2>/dev/null then export PATH="$(cygpath "$1")/bin":"$PATH" else export PATH="$1/bin":"$PATH" fi -# Set ibrary paths for darwin and termux(android) +# Set library paths for darwin and termux(android) export DYLD_LIBRARY_PATH=$1/lib:$DYLD_LIBRARY_PATH export LD_LIBRARY_PATH=$1/lib:$LD_LIBRARY_PATH -rm -f *.o *.obj *.exe *.sym *.c *.h result new.asm $(basename $PWD) +rm -f *.o *.obj *.exe *.sym *.c *.h result new.asm $(basename "$PWD") # Under gcc generate assembly source for source change test. # NOTE: The cygwin 64 bit build has relocation errors with diff --git a/src/tools/make/oberon.mk b/src/tools/make/oberon.mk index ffb27ace..21068cba 100644 --- a/src/tools/make/oberon.mk +++ b/src/tools/make/oberon.mk @@ -33,7 +33,7 @@ usage: clean: @printf '\n\n--- Cleaning branch $(BRANCH) $(OS) $(COMPILER) $(DATAMODEL) ---\n\n' - rm -rf $(BUILDDIR) $(ROOTDIR)/install + rm -rf $(BUILDDIR) "$(ROOTDIR)/install" rm -f $(OBECOMP) @@ -65,7 +65,7 @@ assemble: cd $(BUILDDIR) && $(COMPILE) -c OPM.c extTools.c OPS.c OPT.c cd $(BUILDDIR) && $(COMPILE) -c OPC.c OPV.c OPB.c OPP.c - cd $(BUILDDIR) && $(COMPILE) $(STATICLINK) Compiler.c -o $(ROOTDIR)/$(OBECOMP) \ + cd $(BUILDDIR) && $(COMPILE) $(STATICLINK) Compiler.c -o "$(ROOTDIR)/$(OBECOMP)" \ SYSTEM.o Configuration.o Platform.o Heap.o Out.o \ Strings.o Modules.o Files.o Reals.o Texts.o \ VT100.o extTools.o \ @@ -73,7 +73,7 @@ assemble: cp src/runtime/*.[ch] $(BUILDDIR) cp src/runtime/*.Txt $(BUILDDIR) - cp src/runtime/*.Txt $(ROOTDIR) + cp src/runtime/*.Txt "$(ROOTDIR)" @printf '$(OBECOMP) created.\n' @@ -104,25 +104,25 @@ translate: @mkdir -p $(BUILDDIR) @rm -f $(BUILDDIR)/*.sym - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsrF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../Configuration.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsrF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Platform$(PLATFORM).Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsrFapx -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Heap.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsrF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Reals.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsrF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Strings.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsrF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Out.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsrF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Modules.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsrF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Files.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsrF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Texts.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsrF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/VT100.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsrF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/OPM.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsrF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/extTools.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsrF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/OPS.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsrF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/OPT.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsrF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/OPC.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsrF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/OPV.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsrF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/OPB.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsrF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/OPP.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ssrm -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/Compiler.Mod + cd $(BUILDDIR); "$(ROOTDIR)/$(OBECOMP)" -SsrF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../Configuration.Mod + cd $(BUILDDIR); "$(ROOTDIR)/$(OBECOMP)" -SsrF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Platform$(PLATFORM).Mod + cd $(BUILDDIR); "$(ROOTDIR)/$(OBECOMP)" -SsrFapx -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Heap.Mod + cd $(BUILDDIR); "$(ROOTDIR)/$(OBECOMP)" -SsrF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Reals.Mod + cd $(BUILDDIR); "$(ROOTDIR)/$(OBECOMP)" -SsrF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Strings.Mod + cd $(BUILDDIR); "$(ROOTDIR)/$(OBECOMP)" -SsrF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Out.Mod + cd $(BUILDDIR); "$(ROOTDIR)/$(OBECOMP)" -SsrF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Modules.Mod + cd $(BUILDDIR); "$(ROOTDIR)/$(OBECOMP)" -SsrF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Files.Mod + cd $(BUILDDIR); "$(ROOTDIR)/$(OBECOMP)" -SsrF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Texts.Mod + cd $(BUILDDIR); "$(ROOTDIR)/$(OBECOMP)" -SsrF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/VT100.Mod + cd $(BUILDDIR); "$(ROOTDIR)/$(OBECOMP)" -SsrF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/OPM.Mod + cd $(BUILDDIR); "$(ROOTDIR)/$(OBECOMP)" -SsrF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/extTools.Mod + cd $(BUILDDIR); "$(ROOTDIR)/$(OBECOMP)" -SsrF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/OPS.Mod + cd $(BUILDDIR); "$(ROOTDIR)/$(OBECOMP)" -SsrF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/OPT.Mod + cd $(BUILDDIR); "$(ROOTDIR)/$(OBECOMP)" -SsrF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/OPC.Mod + cd $(BUILDDIR); "$(ROOTDIR)/$(OBECOMP)" -SsrF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/OPV.Mod + cd $(BUILDDIR); "$(ROOTDIR)/$(OBECOMP)" -SsrF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/OPB.Mod + cd $(BUILDDIR); "$(ROOTDIR)/$(OBECOMP)" -SsrF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/OPP.Mod + cd $(BUILDDIR); "$(ROOTDIR)/$(OBECOMP)" -Ssrm -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/Compiler.Mod cp src/runtime/*.[ch] $(BUILDDIR) cp src/runtime/*.Txt $(BUILDDIR) @@ -133,8 +133,8 @@ translate: browsercmd: @printf '\nMaking symbol browser\n' - @cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ss -O$(MODEL) ../../src/runtime/Oberon.Mod - @cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Sm -O$(MODEL) ../../src/tools/browser/BrowserCmd.Mod + @cd $(BUILDDIR); "$(ROOTDIR)/$(OBECOMP)" -Ss -O$(MODEL) ../../src/runtime/Oberon.Mod + @cd $(BUILDDIR); "$(ROOTDIR)/$(OBECOMP)" -Sm -O$(MODEL) ../../src/tools/browser/BrowserCmd.Mod @cd $(BUILDDIR); $(COMPILE) BrowserCmd.c Oberon.c -o showdef \ Platform.o Texts.o OPT.o Heap.o Out.o SYSTEM.o OPM.o OPS.o OPV.o \ Files.o Reals.o Modules.o VT100.o Configuration.o Strings.o \ @@ -146,7 +146,7 @@ browsercmd: # makeinstalldir: Use only after a successful full build. Creates an # installation directory image in $(BUILDDOR)/install makeinstalldir: - @printf '\nCreating installation image at $(ROOTDIR)/install\n' + @printf '\nCreating installation image at "$(ROOTDIR)/install\n"' @rm -rf "$(ROOTDIR)/install" @mkdir -p "$(ROOTDIR)/install/bin" @@ -168,9 +168,9 @@ makeinstalldir: # instructions: Advice on completion of local build instructions: FORCE - @printf '\nOberon build and test complete, result is in $(ROOTDIR)/install\n' - @printf '\nYou can use the new compiler by running $(ROOTDIR)/install/bin/$(ONAME),\n' - @printf 'Or add it to your path as follows:\n' + @printf '\nOberon build and test complete, result is in "$(ROOTDIR)/install".\n' + @printf '\nYou can use the new compiler by running "$(ROOTDIR)/install/bin/$(ONAME)",\n' + @printf 'or add it to your path as follows:\n' @printf 'export PATH=\"$(ROOTDIR)/install/bin:$$PATH\"\n' @printf '\n' @@ -209,166 +209,166 @@ install: uninstall runtime: FORCE @printf '\nMaking run time library for -O$(MODEL)\n' - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/runtime/Platform$(PLATFORM).Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/runtime/Heap.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/runtime/Out.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/runtime/Modules.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/runtime/Reals.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/runtime/Strings.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/runtime/In.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/runtime/VT100.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/runtime/Files.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/runtime/Math.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/runtime/MathL.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/runtime/Texts.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/runtime/Oberon.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/runtime/Platform$(PLATFORM).Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/runtime/Heap.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/runtime/Out.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/runtime/Modules.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/runtime/Reals.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/runtime/Strings.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/runtime/In.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/runtime/VT100.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/runtime/Files.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/runtime/Math.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/runtime/MathL.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/runtime/Texts.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/runtime/Oberon.Mod v4: @printf '\nMaking v4 library for -O$(MODEL)\n' - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/v4/Args.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/v4/Console.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/v4/Printer.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/v4/Sets.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/v4/Args.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/v4/Console.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/v4/Printer.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/v4/Sets.Mod ooc2: @printf '\nMaking ooc2 library for -O$(MODEL)\n' - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc2/ooc2Strings.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc2/ooc2Ascii.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc2/ooc2CharClass.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc2/ooc2ConvTypes.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc2/ooc2IntConv.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc2/ooc2IntStr.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc2/ooc2Real0.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/ooc2/ooc2Strings.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/ooc2/ooc2Ascii.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/ooc2/ooc2CharClass.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/ooc2/ooc2ConvTypes.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/ooc2/ooc2IntConv.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/ooc2/ooc2IntStr.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/ooc2/ooc2Real0.Mod ooc: @printf '\nMaking ooc library for -O$(MODEL)\n' - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc/oocLowReal.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc/oocLowLReal.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc/oocRealMath.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc/oocOakMath.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc/oocLRealMath.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc/oocLongInts.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc/oocComplexMath.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc/oocLComplexMath.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc/oocAscii.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc/oocCharClass.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc/oocStrings.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc/oocConvTypes.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc/oocLRealConv.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc/oocLRealStr.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc/oocRealConv.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc/oocRealStr.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc/oocIntConv.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc/oocIntStr.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc/oocMsg.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc/oocSysClock.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc/oocTime.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc/oocChannel.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc/oocStrings2.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc/oocRts.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc/oocFilenames.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc/oocTextRider.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc/oocBinaryRider.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc/oocJulianDay.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc/oocFilenames.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc/oocwrapperlibc.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc/oocC$(DATAMODEL).Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/ooc/oocLowReal.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/ooc/oocLowLReal.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/ooc/oocRealMath.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/ooc/oocOakMath.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/ooc/oocLRealMath.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/ooc/oocLongInts.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/ooc/oocComplexMath.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/ooc/oocLComplexMath.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/ooc/oocAscii.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/ooc/oocCharClass.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/ooc/oocStrings.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/ooc/oocConvTypes.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/ooc/oocLRealConv.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/ooc/oocLRealStr.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/ooc/oocRealConv.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/ooc/oocRealStr.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/ooc/oocIntConv.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/ooc/oocIntStr.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/ooc/oocMsg.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/ooc/oocSysClock.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/ooc/oocTime.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/ooc/oocChannel.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/ooc/oocStrings2.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/ooc/oocRts.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/ooc/oocFilenames.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/ooc/oocTextRider.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/ooc/oocBinaryRider.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/ooc/oocJulianDay.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/ooc/oocFilenames.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/ooc/oocwrapperlibc.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/ooc/oocC$(DATAMODEL).Mod oocX11: @printf '\nMaking oocX11 library for -O$(MODEL)\n' - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/oocX11/oocX11.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/oocX11/oocXutil.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/oocX11/oocXYplane.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/oocX11/oocX11.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/oocX11/oocXutil.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/oocX11/oocXYplane.Mod ulm: @printf '\nMaking ulm library for -O$(MODEL)\n' - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmTypes.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmObjects.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmPriorities.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmDisciplines.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmServices.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmSys.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmSYSTEM.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmEvents.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmProcess.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmResources.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmForwarders.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmRelatedEvents.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmStreams.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmStrings.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmSysTypes.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmTexts.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmSysConversions.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmErrors.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmSysErrors.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmSysStat.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmASCII.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmSets.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmIO.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmAssertions.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmIndirectDisciplines.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmStreamDisciplines.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmIEEE.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmMC68881.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmReals.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmPrint.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmWrite.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmConstStrings.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmPlotters.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmSysIO.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmLoader.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmNetIO.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmPersistentObjects.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmPersistentDisciplines.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmOperations.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmScales.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmTimes.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmClocks.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmTimers.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmConditions.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmStreamConditions.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmTimeConditions.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmCiphers.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmCipherOps.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmBlockCiphers.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmAsymmetricCiphers.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmConclusions.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmRandomGenerators.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmTCrypt.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmIntOperations.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/ulm/ulmTypes.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/ulm/ulmObjects.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/ulm/ulmPriorities.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/ulm/ulmDisciplines.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/ulm/ulmServices.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/ulm/ulmSys.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/ulm/ulmSYSTEM.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/ulm/ulmEvents.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/ulm/ulmProcess.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/ulm/ulmResources.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/ulm/ulmForwarders.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/ulm/ulmRelatedEvents.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/ulm/ulmStreams.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/ulm/ulmStrings.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/ulm/ulmSysTypes.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/ulm/ulmTexts.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/ulm/ulmSysConversions.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/ulm/ulmErrors.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/ulm/ulmSysErrors.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/ulm/ulmSysStat.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/ulm/ulmASCII.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/ulm/ulmSets.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/ulm/ulmIO.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/ulm/ulmAssertions.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/ulm/ulmIndirectDisciplines.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/ulm/ulmStreamDisciplines.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/ulm/ulmIEEE.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/ulm/ulmMC68881.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/ulm/ulmReals.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/ulm/ulmPrint.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/ulm/ulmWrite.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/ulm/ulmConstStrings.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/ulm/ulmPlotters.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/ulm/ulmSysIO.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/ulm/ulmLoader.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/ulm/ulmNetIO.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/ulm/ulmPersistentObjects.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/ulm/ulmPersistentDisciplines.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/ulm/ulmOperations.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/ulm/ulmScales.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/ulm/ulmTimes.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/ulm/ulmClocks.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/ulm/ulmTimers.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/ulm/ulmConditions.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/ulm/ulmStreamConditions.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/ulm/ulmTimeConditions.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/ulm/ulmCiphers.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/ulm/ulmCipherOps.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/ulm/ulmBlockCiphers.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/ulm/ulmAsymmetricCiphers.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/ulm/ulmConclusions.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/ulm/ulmRandomGenerators.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/ulm/ulmTCrypt.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/ulm/ulmIntOperations.Mod pow32: @printf '\nMaking pow library for -O$(MODEL)\n' - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/pow/powStrings.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/pow/powStrings.Mod misc: @printf '\nMaking misc library for -O$(MODEL)\n' - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/misc/crt.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/misc/Listen.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/misc/MersenneTwister.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/misc/MultiArrays.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/misc/MultiArrayRiders.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/misc/crt.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/misc/Listen.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/misc/MersenneTwister.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/misc/MultiArrays.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/misc/MultiArrayRiders.Mod s3: @printf '\nMaking s3 library for -O$(MODEL)\n' - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/s3/ethBTrees.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/s3/ethMD5.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/s3/ethSets.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/s3/ethZlib.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/s3/ethZlibBuffers.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/s3/ethZlibInflate.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/s3/ethZlibDeflate.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/s3/ethZlibReaders.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/s3/ethZlibWriters.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/s3/ethZip.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/s3/ethRandomNumbers.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/s3/ethGZReaders.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/s3/ethGZWriters.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/s3/ethUnicode.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/s3/ethDates.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/s3/ethReals.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/s3/ethStrings.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/s3/ethBTrees.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/s3/ethMD5.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/s3/ethSets.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/s3/ethZlib.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/s3/ethZlibBuffers.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/s3/ethZlibInflate.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/s3/ethZlibDeflate.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/s3/ethZlibReaders.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/s3/ethZlibWriters.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/s3/ethZip.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/s3/ethRandomNumbers.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/s3/ethGZReaders.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/s3/ethGZWriters.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/s3/ethUnicode.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/s3/ethDates.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/s3/ethReals.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/s3/ethStrings.Mod @@ -392,8 +392,7 @@ library: sourcechanges: - @cd $(BUILDDIR) && sh $(ROOTDIR)/src/tools/make/sourcechanges.sh $(ROOTDIR)/bootstrap/$(PLATFORM)-$(ADRSIZE)$(ALIGNMENT) - + @cd $(BUILDDIR) && sh "$(ROOTDIR)/src/tools/make/sourcechanges.sh" "$(ROOTDIR)/bootstrap/$(PLATFORM)-$(ADRSIZE)$(ALIGNMENT)" diff --git a/src/tools/make/sourcechanges.sh b/src/tools/make/sourcechanges.sh index 1439ce4e..e20e6841 100644 --- a/src/tools/make/sourcechanges.sh +++ b/src/tools/make/sourcechanges.sh @@ -12,9 +12,9 @@ # The current directory is the build directory changes="0" -for f in $1/*; do - fn=$(basename $f) - egrep -v -f ../../src/tools/make/ignore $f >$fn.old +find "$1" -type f -print0 | while IFS= read -r -d '' f; do + fn=$(basename "$f") + egrep -v -f ../../src/tools/make/ignore "$f" >$fn.old egrep -v -f ../../src/tools/make/ignore $fn >$fn.new if ! diff -U 2 -b $fn.old $fn.new >$fn.diff; then echo "" From b2f70879662bd4e5d9da3d1503a767562088ac22 Mon Sep 17 00:00:00 2001 From: David C W Brown Date: Mon, 4 Nov 2019 18:23:17 +0000 Subject: [PATCH 512/580] Reflect distinction between build (make full) and install (make install) --- doc/Installation.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/Installation.md b/doc/Installation.md index b0ab299d..d9ad75cd 100644 --- a/doc/Installation.md +++ b/doc/Installation.md @@ -78,11 +78,11 @@ This will create a subdirectory 'voc' which includes the following files and dir | make.cmd | Makefile specifically for native Microsoft C builds. No tests. | -#### 3. Build and install the Oberon compiler and library +#### 3. Build the Oberon compiler and library ``` cd voc -[sudo] make full +make full ``` The makefile will: From 93b6ecc2340bb5125bf6f8f51db72125e591f637 Mon Sep 17 00:00:00 2001 From: David C W Brown Date: Mon, 4 Nov 2019 18:24:47 +0000 Subject: [PATCH 513/580] Use https to get build status. --- ReadMe.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReadMe.md b/ReadMe.md index 66265334..09d3e962 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -1,4 +1,4 @@ -![Build status](http://brownsmeet.com/githubhook/vishaps-status.svg) +![Build status](https://brownsmeet.com/githubhook/vishaps-status.svg) # Ѵishap Oberon From 0b136c44e9dd8cedd24156d3feba079974601c14 Mon Sep 17 00:00:00 2001 From: David C W Brown Date: Mon, 4 Nov 2019 19:22:49 +0000 Subject: [PATCH 514/580] No real change - attempting to clear the github cache of build status svg. --- ReadMe.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/ReadMe.md b/ReadMe.md index 09d3e962..470d485a 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -245,9 +245,7 @@ Norayr Chilingarian forked ofront in 2013, porting extensive libraries from [ULM David Brown has worked on adding support for more platforms incuding windows using MSC, cygwin or mingw since January 2016. More recently he has generalised basic type support within the compiler to allow e.g. 64 bit LONGINT on 32 bit systems, and 32 bit LONGINT on 64 bit systems. -## Origin of the name "Ѵishap Oberon" - -#### Oberon +## Oberon Oberon is a programming language, an operating system and a graphical user interface. Originally designed and implemented by by Niklaus Wirth and @@ -266,7 +264,7 @@ of Einstein and Antoine de Saint-Exupéry: > when there is no longer anything to take away. (Antoine de Saint-Exupéry, > translated by Lewis Galantière.) -#### Ѵishap +## Origin of the name "Ѵishap Oberon" Vishaps are dragons inhabiting the Armenian Highlands. We decided to name the project “Vishap†because ties between compilers and dragons have ancient traditions. From 84b6f0aa9256095bec55491e90d3bcba27484ebb Mon Sep 17 00:00:00 2001 From: David C W Brown Date: Mon, 4 Nov 2019 19:28:52 +0000 Subject: [PATCH 515/580] Trying harder to get build status to refresh, part 1. --- ReadMe.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReadMe.md b/ReadMe.md index 470d485a..8c06d9e5 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -1,4 +1,4 @@ -![Build status](https://brownsmeet.com/githubhook/vishaps-status.svg) +![Build status](https://brownsmeet.com/githubhook/vishaps-status2.svg) # Ѵishap Oberon From 1d48dd811433cadb9f4e148fd586f9980d4daad0 Mon Sep 17 00:00:00 2001 From: David C W Brown Date: Mon, 4 Nov 2019 19:29:12 +0000 Subject: [PATCH 516/580] Trying harder to get build status to refresh, part 2. --- ReadMe.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReadMe.md b/ReadMe.md index 8c06d9e5..470d485a 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -1,4 +1,4 @@ -![Build status](https://brownsmeet.com/githubhook/vishaps-status2.svg) +![Build status](https://brownsmeet.com/githubhook/vishaps-status.svg) # Ѵishap Oberon From 760e14bbe197b8a7edb984c2ca73faf5a6de9cfd Mon Sep 17 00:00:00 2001 From: David C W Brown Date: Mon, 4 Nov 2019 19:30:42 +0000 Subject: [PATCH 517/580] Still trying to get build status to refresh. --- ReadMe.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReadMe.md b/ReadMe.md index 470d485a..55ccd3d9 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -1,4 +1,4 @@ -![Build status](https://brownsmeet.com/githubhook/vishaps-status.svg) +![Build status](https://brownsmeet.com/githubhook/vishaps-status) # Ѵishap Oberon From 6ae2f96d08a4d60ecfbcb89ca4a2384e2f7ba063 Mon Sep 17 00:00:00 2001 From: Norayr Chilingarian Date: Thu, 7 Nov 2019 20:20:08 +0400 Subject: [PATCH 518/580] Undecl var fix (#74) * fix like https://github.com/jtempl/ofront/commit/78036911d21636514f2ece6d9e9e74ecc8755f1e * OPT.DynArr to be precise * removed PromoteIntConstToLInt() function call * update of bootstrap sources. --- bootstrap/unix-44/Compiler.c | 2 +- bootstrap/unix-44/Configuration.c | 4 ++-- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Files.c | 2 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 2 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 12 +++++++----- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 2 +- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 2 +- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 22 +++++++++++++++++----- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Out.c | 2 +- bootstrap/unix-44/Out.h | 2 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/VT100.c | 2 +- bootstrap/unix-44/VT100.h | 2 +- bootstrap/unix-44/extTools.c | 6 +++--- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-48/Compiler.c | 2 +- bootstrap/unix-48/Configuration.c | 4 ++-- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Files.c | 2 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 2 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 12 +++++++----- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 2 +- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 2 +- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 22 +++++++++++++++++----- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Out.c | 2 +- bootstrap/unix-48/Out.h | 2 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/VT100.c | 2 +- bootstrap/unix-48/VT100.h | 2 +- bootstrap/unix-48/extTools.c | 6 +++--- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-88/Compiler.c | 2 +- bootstrap/unix-88/Configuration.c | 4 ++-- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Files.c | 2 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 2 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 12 +++++++----- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 2 +- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 2 +- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 22 +++++++++++++++++----- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Out.c | 2 +- bootstrap/unix-88/Out.h | 2 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/VT100.c | 2 +- bootstrap/unix-88/VT100.h | 2 +- bootstrap/unix-88/extTools.c | 6 +++--- bootstrap/unix-88/extTools.h | 2 +- bootstrap/windows-48/Compiler.c | 2 +- bootstrap/windows-48/Configuration.c | 4 ++-- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Files.c | 2 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 2 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 12 +++++++----- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 2 +- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 2 +- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 22 +++++++++++++++++----- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Out.c | 2 +- bootstrap/windows-48/Out.h | 2 +- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/VT100.c | 2 +- bootstrap/windows-48/VT100.h | 2 +- bootstrap/windows-48/extTools.c | 6 +++--- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-88/Compiler.c | 2 +- bootstrap/windows-88/Configuration.c | 4 ++-- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Files.c | 2 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 2 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 12 +++++++----- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 2 +- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 2 +- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 22 +++++++++++++++++----- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Out.c | 2 +- bootstrap/windows-88/Out.h | 2 +- bootstrap/windows-88/Platform.c | 2 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/VT100.c | 2 +- bootstrap/windows-88/VT100.h | 2 +- bootstrap/windows-88/extTools.c | 6 +++--- bootstrap/windows-88/extTools.h | 2 +- src/compiler/OPC.Mod | 5 ++++- src/compiler/OPV.Mod | 10 +++++++++- 187 files changed, 323 insertions(+), 242 deletions(-) diff --git a/bootstrap/unix-44/Compiler.c b/bootstrap/unix-44/Compiler.c index 706e5dac..4f763604 100644 --- a/bootstrap/unix-44/Compiler.c +++ b/bootstrap/unix-44/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index af1b360f..646b2242 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index 75963938..7b9ae370 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 6b75d2c9..492214b6 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index e01b30c1..08ff9fe0 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index 1712292d..a01553d6 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index 95defe4d..7eb1fed5 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index 7fcd0339..1e66d12e 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index 7132d67d..c06e7adf 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index ee9816a3..d716887b 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index eca13e1c..654ea008 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 9d950335..cfc69c4f 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -1834,6 +1834,12 @@ void OPC_IntLiteral (INT64 n, INT32 size) void OPC_Len (OPT_Object obj, OPT_Struct array, INT64 dim) { + INT64 d; + d = dim; + while (d > 0) { + array = array->BaseTyp; + d -= 1; + } if (array->comp == 3) { OPC_CompleteIdent(obj); OPM_WriteString((CHAR*)"__len", 6); @@ -1841,10 +1847,6 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, INT64 dim) OPM_WriteInt(dim); } } else { - while (dim > 0) { - array = array->BaseTyp; - dim -= 1; - } OPM_WriteInt(array->n); } } diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index ed46a18d..14b85b47 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index c00ef3c0..16996b23 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index ed863d1c..a046228e 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index d6b5b011..df77049f 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index ebe70724..50bb8039 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index e535af0d..67f0d84a 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index 0aae61b1..edbf5767 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index 6dfd6a9f..1386ae18 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index 4bdb3a41..578e9629 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index b6969178..789619eb 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -317,15 +317,27 @@ static INT16 OPV_Precedence (INT16 class, INT16 subclass, INT16 form, INT16 comp static void OPV_Len (OPT_Node n, INT64 dim) { + INT64 d; + OPT_Struct array = NIL; while ((n->class == 4 && n->typ->comp == 3)) { dim += 1; n = n->left; } if ((n->class == 3 && n->typ->comp == 3)) { - OPV_design(n->left, 10); - OPM_WriteString((CHAR*)"->len[", 7); - OPM_WriteInt(dim); - OPM_Write(']'); + d = dim; + array = n->typ; + while (d > 0) { + array = array->BaseTyp; + d -= 1; + } + if (array->comp == 3) { + OPV_design(n->left, 10); + OPM_WriteString((CHAR*)"->len[", 7); + OPM_WriteInt(dim); + OPM_Write(']'); + } else { + OPM_WriteInt(array->n); + } } else { OPC_Len(n->obj, n->typ, dim); } diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index 36e6ffa1..74a49d24 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Out.c b/bootstrap/unix-44/Out.c index b37ac764..7d4c7d72 100644 --- a/bootstrap/unix-44/Out.c +++ b/bootstrap/unix-44/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Out.h b/bootstrap/unix-44/Out.h index b328aba8..ba654cb8 100644 --- a/bootstrap/unix-44/Out.h +++ b/bootstrap/unix-44/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 2571cf00..8c32b583 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index cd5f8097..0cecb356 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 61d38fc6..2b8483b4 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index cf6fff34..270f7735 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index 7d141b4d..864f4ace 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index 7101e619..e3ff12c6 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index 98d2ca37..ff6f352e 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index a70ae3ca..0fd08ee2 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/VT100.c b/bootstrap/unix-44/VT100.c index 16cd0cf7..84ffc7ab 100644 --- a/bootstrap/unix-44/VT100.c +++ b/bootstrap/unix-44/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/VT100.h b/bootstrap/unix-44/VT100.h index c8271316..3aafef64 100644 --- a/bootstrap/unix-44/VT100.h +++ b/bootstrap/unix-44/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index e091956d..082bedeb 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -72,7 +72,7 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) { - __COPY("tcc -g", s, s__len); + __COPY("gcc -fPIC -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); @@ -102,7 +102,7 @@ void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN stati Strings_Append((CHAR*)".c ", 4, (void*)cmd, 4096); Strings_Append(additionalopts, additionalopts__len, (void*)cmd, 4096); if (statically) { - Strings_Append((CHAR*)"", 1, (void*)cmd, 4096); + Strings_Append((CHAR*)" -static", 9, (void*)cmd, 4096); } Strings_Append((CHAR*)" -o ", 5, (void*)cmd, 4096); Strings_Append(moduleName, moduleName__len, (void*)cmd, 4096); diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index ad119444..0bc230e3 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/Compiler.c b/bootstrap/unix-48/Compiler.c index 706e5dac..4f763604 100644 --- a/bootstrap/unix-48/Compiler.c +++ b/bootstrap/unix-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index af1b360f..646b2242 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index 75963938..7b9ae370 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 6b75d2c9..492214b6 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index e01b30c1..08ff9fe0 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index 1712292d..a01553d6 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index 95defe4d..7eb1fed5 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index 7fcd0339..1e66d12e 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index 7132d67d..c06e7adf 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index ee9816a3..d716887b 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index eca13e1c..654ea008 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 9d950335..cfc69c4f 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -1834,6 +1834,12 @@ void OPC_IntLiteral (INT64 n, INT32 size) void OPC_Len (OPT_Object obj, OPT_Struct array, INT64 dim) { + INT64 d; + d = dim; + while (d > 0) { + array = array->BaseTyp; + d -= 1; + } if (array->comp == 3) { OPC_CompleteIdent(obj); OPM_WriteString((CHAR*)"__len", 6); @@ -1841,10 +1847,6 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, INT64 dim) OPM_WriteInt(dim); } } else { - while (dim > 0) { - array = array->BaseTyp; - dim -= 1; - } OPM_WriteInt(array->n); } } diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index ed46a18d..14b85b47 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index c00ef3c0..16996b23 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index ed863d1c..a046228e 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index d6b5b011..df77049f 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index ebe70724..50bb8039 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index e535af0d..67f0d84a 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index 0aae61b1..edbf5767 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index cb27a509..cf3ae87d 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index 4bdb3a41..578e9629 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index b6969178..789619eb 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -317,15 +317,27 @@ static INT16 OPV_Precedence (INT16 class, INT16 subclass, INT16 form, INT16 comp static void OPV_Len (OPT_Node n, INT64 dim) { + INT64 d; + OPT_Struct array = NIL; while ((n->class == 4 && n->typ->comp == 3)) { dim += 1; n = n->left; } if ((n->class == 3 && n->typ->comp == 3)) { - OPV_design(n->left, 10); - OPM_WriteString((CHAR*)"->len[", 7); - OPM_WriteInt(dim); - OPM_Write(']'); + d = dim; + array = n->typ; + while (d > 0) { + array = array->BaseTyp; + d -= 1; + } + if (array->comp == 3) { + OPV_design(n->left, 10); + OPM_WriteString((CHAR*)"->len[", 7); + OPM_WriteInt(dim); + OPM_Write(']'); + } else { + OPM_WriteInt(array->n); + } } else { OPC_Len(n->obj, n->typ, dim); } diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index 36e6ffa1..74a49d24 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Out.c b/bootstrap/unix-48/Out.c index b37ac764..7d4c7d72 100644 --- a/bootstrap/unix-48/Out.c +++ b/bootstrap/unix-48/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Out.h b/bootstrap/unix-48/Out.h index b328aba8..ba654cb8 100644 --- a/bootstrap/unix-48/Out.h +++ b/bootstrap/unix-48/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 2571cf00..8c32b583 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index cd5f8097..0cecb356 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 61d38fc6..2b8483b4 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index cf6fff34..270f7735 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index 7d141b4d..864f4ace 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index 7101e619..e3ff12c6 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index a43f9e79..628d68a4 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index f8efcd82..02f20def 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/VT100.c b/bootstrap/unix-48/VT100.c index 16cd0cf7..84ffc7ab 100644 --- a/bootstrap/unix-48/VT100.c +++ b/bootstrap/unix-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/VT100.h b/bootstrap/unix-48/VT100.h index c8271316..3aafef64 100644 --- a/bootstrap/unix-48/VT100.h +++ b/bootstrap/unix-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index e091956d..082bedeb 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -72,7 +72,7 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) { - __COPY("tcc -g", s, s__len); + __COPY("gcc -fPIC -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); @@ -102,7 +102,7 @@ void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN stati Strings_Append((CHAR*)".c ", 4, (void*)cmd, 4096); Strings_Append(additionalopts, additionalopts__len, (void*)cmd, 4096); if (statically) { - Strings_Append((CHAR*)"", 1, (void*)cmd, 4096); + Strings_Append((CHAR*)" -static", 9, (void*)cmd, 4096); } Strings_Append((CHAR*)" -o ", 5, (void*)cmd, 4096); Strings_Append(moduleName, moduleName__len, (void*)cmd, 4096); diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index ad119444..0bc230e3 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/Compiler.c b/bootstrap/unix-88/Compiler.c index 706e5dac..4f763604 100644 --- a/bootstrap/unix-88/Compiler.c +++ b/bootstrap/unix-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index af1b360f..646b2242 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index 75963938..7b9ae370 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 155e0a04..b07eb5ea 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index e594e82b..2606a167 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index e9555122..6ab94025 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index e09ec7a8..16458b6a 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index b5952131..282588f9 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index 3a135985..ee462907 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index ee9816a3..d716887b 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index eca13e1c..654ea008 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index 9d950335..cfc69c4f 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -1834,6 +1834,12 @@ void OPC_IntLiteral (INT64 n, INT32 size) void OPC_Len (OPT_Object obj, OPT_Struct array, INT64 dim) { + INT64 d; + d = dim; + while (d > 0) { + array = array->BaseTyp; + d -= 1; + } if (array->comp == 3) { OPC_CompleteIdent(obj); OPM_WriteString((CHAR*)"__len", 6); @@ -1841,10 +1847,6 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, INT64 dim) OPM_WriteInt(dim); } } else { - while (dim > 0) { - array = array->BaseTyp; - dim -= 1; - } OPM_WriteInt(array->n); } } diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index ed46a18d..14b85b47 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index faa2b9d7..59ad4e17 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index ed863d1c..a046228e 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index 814adb3c..79620fe3 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index ebe70724..50bb8039 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index e535af0d..67f0d84a 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index 0aae61b1..edbf5767 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index b834bc38..861fad9e 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 4bdb3a41..578e9629 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 2f9f78c6..8681be7b 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -317,15 +317,27 @@ static INT16 OPV_Precedence (INT16 class, INT16 subclass, INT16 form, INT16 comp static void OPV_Len (OPT_Node n, INT64 dim) { + INT64 d; + OPT_Struct array = NIL; while ((n->class == 4 && n->typ->comp == 3)) { dim += 1; n = n->left; } if ((n->class == 3 && n->typ->comp == 3)) { - OPV_design(n->left, 10); - OPM_WriteString((CHAR*)"->len[", 7); - OPM_WriteInt(dim); - OPM_Write(']'); + d = dim; + array = n->typ; + while (d > 0) { + array = array->BaseTyp; + d -= 1; + } + if (array->comp == 3) { + OPV_design(n->left, 10); + OPM_WriteString((CHAR*)"->len[", 7); + OPM_WriteInt(dim); + OPM_Write(']'); + } else { + OPM_WriteInt(array->n); + } } else { OPC_Len(n->obj, n->typ, dim); } diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index 36e6ffa1..74a49d24 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Out.c b/bootstrap/unix-88/Out.c index b37ac764..7d4c7d72 100644 --- a/bootstrap/unix-88/Out.c +++ b/bootstrap/unix-88/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Out.h b/bootstrap/unix-88/Out.h index b328aba8..ba654cb8 100644 --- a/bootstrap/unix-88/Out.h +++ b/bootstrap/unix-88/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 99fd71e3..636554ef 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index 77e7eabf..efff0062 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 61d38fc6..2b8483b4 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index cf6fff34..270f7735 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index 7d141b4d..864f4ace 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index 7101e619..e3ff12c6 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index fadb3d3b..fad539ed 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index 95d43066..04f1d40e 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/VT100.c b/bootstrap/unix-88/VT100.c index 16cd0cf7..84ffc7ab 100644 --- a/bootstrap/unix-88/VT100.c +++ b/bootstrap/unix-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/VT100.h b/bootstrap/unix-88/VT100.h index c8271316..3aafef64 100644 --- a/bootstrap/unix-88/VT100.h +++ b/bootstrap/unix-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index e091956d..082bedeb 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -72,7 +72,7 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) { - __COPY("tcc -g", s, s__len); + __COPY("gcc -fPIC -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); @@ -102,7 +102,7 @@ void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN stati Strings_Append((CHAR*)".c ", 4, (void*)cmd, 4096); Strings_Append(additionalopts, additionalopts__len, (void*)cmd, 4096); if (statically) { - Strings_Append((CHAR*)"", 1, (void*)cmd, 4096); + Strings_Append((CHAR*)" -static", 9, (void*)cmd, 4096); } Strings_Append((CHAR*)" -o ", 5, (void*)cmd, 4096); Strings_Append(moduleName, moduleName__len, (void*)cmd, 4096); diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index ad119444..0bc230e3 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/Compiler.c b/bootstrap/windows-48/Compiler.c index 706e5dac..4f763604 100644 --- a/bootstrap/windows-48/Compiler.c +++ b/bootstrap/windows-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index af1b360f..646b2242 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index 75963938..7b9ae370 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index b7204686..5edba307 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index d4f352c8..2ad2f341 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index 1712292d..a01553d6 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index 95defe4d..7eb1fed5 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index 70e3c600..9708137f 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index 7132d67d..c06e7adf 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index ee9816a3..d716887b 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index eca13e1c..654ea008 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 9d950335..cfc69c4f 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -1834,6 +1834,12 @@ void OPC_IntLiteral (INT64 n, INT32 size) void OPC_Len (OPT_Object obj, OPT_Struct array, INT64 dim) { + INT64 d; + d = dim; + while (d > 0) { + array = array->BaseTyp; + d -= 1; + } if (array->comp == 3) { OPC_CompleteIdent(obj); OPM_WriteString((CHAR*)"__len", 6); @@ -1841,10 +1847,6 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, INT64 dim) OPM_WriteInt(dim); } } else { - while (dim > 0) { - array = array->BaseTyp; - dim -= 1; - } OPM_WriteInt(array->n); } } diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index ed46a18d..14b85b47 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index c00ef3c0..16996b23 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index ed863d1c..a046228e 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index d6b5b011..df77049f 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index ebe70724..50bb8039 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index e535af0d..67f0d84a 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index 0aae61b1..edbf5767 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index cb27a509..cf3ae87d 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index 4bdb3a41..578e9629 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index b6969178..789619eb 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -317,15 +317,27 @@ static INT16 OPV_Precedence (INT16 class, INT16 subclass, INT16 form, INT16 comp static void OPV_Len (OPT_Node n, INT64 dim) { + INT64 d; + OPT_Struct array = NIL; while ((n->class == 4 && n->typ->comp == 3)) { dim += 1; n = n->left; } if ((n->class == 3 && n->typ->comp == 3)) { - OPV_design(n->left, 10); - OPM_WriteString((CHAR*)"->len[", 7); - OPM_WriteInt(dim); - OPM_Write(']'); + d = dim; + array = n->typ; + while (d > 0) { + array = array->BaseTyp; + d -= 1; + } + if (array->comp == 3) { + OPV_design(n->left, 10); + OPM_WriteString((CHAR*)"->len[", 7); + OPM_WriteInt(dim); + OPM_Write(']'); + } else { + OPM_WriteInt(array->n); + } } else { OPC_Len(n->obj, n->typ, dim); } diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index 36e6ffa1..74a49d24 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Out.c b/bootstrap/windows-48/Out.c index d85cee6b..7fa3733e 100644 --- a/bootstrap/windows-48/Out.c +++ b/bootstrap/windows-48/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Out.h b/bootstrap/windows-48/Out.h index b328aba8..ba654cb8 100644 --- a/bootstrap/windows-48/Out.h +++ b/bootstrap/windows-48/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 9de4c27b..f5c9fa99 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index 02f3b4e1..c9296c98 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 61d38fc6..2b8483b4 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index cf6fff34..270f7735 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index 7d141b4d..864f4ace 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index 7101e619..e3ff12c6 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index a43f9e79..628d68a4 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index f8efcd82..02f20def 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/VT100.c b/bootstrap/windows-48/VT100.c index 16cd0cf7..84ffc7ab 100644 --- a/bootstrap/windows-48/VT100.c +++ b/bootstrap/windows-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/VT100.h b/bootstrap/windows-48/VT100.h index c8271316..3aafef64 100644 --- a/bootstrap/windows-48/VT100.h +++ b/bootstrap/windows-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index e091956d..082bedeb 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -72,7 +72,7 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) { - __COPY("tcc -g", s, s__len); + __COPY("gcc -fPIC -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); @@ -102,7 +102,7 @@ void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN stati Strings_Append((CHAR*)".c ", 4, (void*)cmd, 4096); Strings_Append(additionalopts, additionalopts__len, (void*)cmd, 4096); if (statically) { - Strings_Append((CHAR*)"", 1, (void*)cmd, 4096); + Strings_Append((CHAR*)" -static", 9, (void*)cmd, 4096); } Strings_Append((CHAR*)" -o ", 5, (void*)cmd, 4096); Strings_Append(moduleName, moduleName__len, (void*)cmd, 4096); diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index ad119444..0bc230e3 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/Compiler.c b/bootstrap/windows-88/Compiler.c index 706e5dac..4f763604 100644 --- a/bootstrap/windows-88/Compiler.c +++ b/bootstrap/windows-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index af1b360f..646b2242 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index 75963938..7b9ae370 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index e3a43ec3..32a88308 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 4f0adc88..3e47427c 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index e9555122..6ab94025 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index e09ec7a8..16458b6a 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 2432e8d7..ccefe599 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index 3a135985..ee462907 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index ee9816a3..d716887b 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index eca13e1c..654ea008 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index 9d950335..cfc69c4f 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -1834,6 +1834,12 @@ void OPC_IntLiteral (INT64 n, INT32 size) void OPC_Len (OPT_Object obj, OPT_Struct array, INT64 dim) { + INT64 d; + d = dim; + while (d > 0) { + array = array->BaseTyp; + d -= 1; + } if (array->comp == 3) { OPC_CompleteIdent(obj); OPM_WriteString((CHAR*)"__len", 6); @@ -1841,10 +1847,6 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, INT64 dim) OPM_WriteInt(dim); } } else { - while (dim > 0) { - array = array->BaseTyp; - dim -= 1; - } OPM_WriteInt(array->n); } } diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index ed46a18d..14b85b47 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index faa2b9d7..59ad4e17 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index ed863d1c..a046228e 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index 814adb3c..79620fe3 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index ebe70724..50bb8039 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index e535af0d..67f0d84a 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index 0aae61b1..edbf5767 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index b834bc38..861fad9e 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 4bdb3a41..578e9629 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 2f9f78c6..8681be7b 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -317,15 +317,27 @@ static INT16 OPV_Precedence (INT16 class, INT16 subclass, INT16 form, INT16 comp static void OPV_Len (OPT_Node n, INT64 dim) { + INT64 d; + OPT_Struct array = NIL; while ((n->class == 4 && n->typ->comp == 3)) { dim += 1; n = n->left; } if ((n->class == 3 && n->typ->comp == 3)) { - OPV_design(n->left, 10); - OPM_WriteString((CHAR*)"->len[", 7); - OPM_WriteInt(dim); - OPM_Write(']'); + d = dim; + array = n->typ; + while (d > 0) { + array = array->BaseTyp; + d -= 1; + } + if (array->comp == 3) { + OPV_design(n->left, 10); + OPM_WriteString((CHAR*)"->len[", 7); + OPM_WriteInt(dim); + OPM_Write(']'); + } else { + OPM_WriteInt(array->n); + } } else { OPC_Len(n->obj, n->typ, dim); } diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index 36e6ffa1..74a49d24 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Out.c b/bootstrap/windows-88/Out.c index d85cee6b..7fa3733e 100644 --- a/bootstrap/windows-88/Out.c +++ b/bootstrap/windows-88/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Out.h b/bootstrap/windows-88/Out.h index b328aba8..ba654cb8 100644 --- a/bootstrap/windows-88/Out.h +++ b/bootstrap/windows-88/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index b6b5a74c..23cdc990 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index 391a1d4d..75f561f0 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 61d38fc6..2b8483b4 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index cf6fff34..270f7735 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index 7d141b4d..864f4ace 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index 7101e619..e3ff12c6 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index fadb3d3b..fad539ed 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index 95d43066..04f1d40e 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/VT100.c b/bootstrap/windows-88/VT100.c index 16cd0cf7..84ffc7ab 100644 --- a/bootstrap/windows-88/VT100.c +++ b/bootstrap/windows-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/VT100.h b/bootstrap/windows-88/VT100.h index c8271316..3aafef64 100644 --- a/bootstrap/windows-88/VT100.h +++ b/bootstrap/windows-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index e091956d..082bedeb 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -72,7 +72,7 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) { - __COPY("tcc -g", s, s__len); + __COPY("gcc -fPIC -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); @@ -102,7 +102,7 @@ void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN stati Strings_Append((CHAR*)".c ", 4, (void*)cmd, 4096); Strings_Append(additionalopts, additionalopts__len, (void*)cmd, 4096); if (statically) { - Strings_Append((CHAR*)"", 1, (void*)cmd, 4096); + Strings_Append((CHAR*)" -static", 9, (void*)cmd, 4096); } Strings_Append((CHAR*)" -o ", 5, (void*)cmd, 4096); Strings_Append(moduleName, moduleName__len, (void*)cmd, 4096); diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index ad119444..0bc230e3 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/10/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/src/compiler/OPC.Mod b/src/compiler/OPC.Mod index 43b86251..d1f9027a 100644 --- a/src/compiler/OPC.Mod +++ b/src/compiler/OPC.Mod @@ -1215,12 +1215,15 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) END IntLiteral; PROCEDURE Len* (obj: OPT.Object; array: OPT.Struct; dim: SYSTEM.INT64); + VAR + d: SYSTEM.INT64; BEGIN + d := dim; + WHILE d > 0 DO array := array^.BaseTyp; DEC(d) END; IF array^.comp = OPT.DynArr THEN CompleteIdent(obj); OPM.WriteString(LenExt); IF dim # 0 THEN OPM.WriteInt(dim) END ELSE (* array *) - WHILE dim > 0 DO array := array^.BaseTyp; DEC(dim) END; OPM.WriteInt(array.n) END END Len; diff --git a/src/compiler/OPV.Mod b/src/compiler/OPV.Mod index 964f60e1..371d69d3 100644 --- a/src/compiler/OPV.Mod +++ b/src/compiler/OPV.Mod @@ -208,10 +208,18 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 PROCEDURE^ design(n: OPT.Node; prec: INTEGER); PROCEDURE Len(n: OPT.Node; dim: SYSTEM.INT64); + VAR + d: SYSTEM.INT64; array: OPT.Struct; BEGIN WHILE (n^.class = OPT.Nindex) & (n^.typ^.comp = OPT.DynArr(*26.7.2002*)) DO INC(dim); n := n^.left END ; IF (n^.class = OPT.Nderef) & (n^.typ^.comp = OPT.DynArr) THEN - design(n^.left, 10); OPM.WriteString("->len["); OPM.WriteInt(dim); OPM.Write("]") + d := dim; array := n^.typ; + WHILE d > 0 DO array := array^.BaseTyp; DEC(d) END; + IF array^.comp = OPT.DynArr THEN + design(n^.left, 10); OPM.WriteString("->len["); OPM.WriteInt(dim); OPM.Write("]") + ELSE + OPM.WriteInt(array^.n) + END ELSE OPC.Len(n^.obj, n^.typ, dim) END From 2ddbf5d5171ce4ddfcae51c87d68676d393971e3 Mon Sep 17 00:00:00 2001 From: Dave Brown Date: Sat, 9 Nov 2019 11:32:03 +0000 Subject: [PATCH 519/580] Correct Args.argc to INTEGER rather than LONGINT --- src/library/v4/Args.Mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100644 => 100755 src/library/v4/Args.Mod diff --git a/src/library/v4/Args.Mod b/src/library/v4/Args.Mod old mode 100644 new mode 100755 index 578ac7e5..c3621116 --- a/src/library/v4/Args.Mod +++ b/src/library/v4/Args.Mod @@ -10,7 +10,7 @@ MODULE Args; (* jt, 8.12.94 *) ArgVec = POINTER TO ARRAY 1024 OF ArgPtr; VAR - argc-: LONGINT; + argc-: INTEGER; argv-: SYSTEM.ADDRESS; From 7f4b284aef2bb2742875c2497c9832e60fc7ff87 Mon Sep 17 00:00:00 2001 From: Dave Brown Date: Tue, 19 Nov 2019 15:53:20 +0000 Subject: [PATCH 520/580] Correct set size in component pascal compatability mode --- src/compiler/Compiler.Mod | 2 +- src/compiler/OPM.Mod | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) mode change 100644 => 100755 src/compiler/Compiler.Mod mode change 100644 => 100755 src/compiler/OPM.Mod diff --git a/src/compiler/Compiler.Mod b/src/compiler/Compiler.Mod old mode 100644 new mode 100755 index 6148fea2..5855a008 --- a/src/compiler/Compiler.Mod +++ b/src/compiler/Compiler.Mod @@ -66,7 +66,7 @@ MODULE Compiler; (* J. Templ 3.2.95 *) OPT.intobj.typ := OPT.inttyp; OPT.lintobj.typ := OPT.linttyp; - CASE OPM.LongintSize OF + CASE OPM.SetSize OF |4: OPT.settyp := OPT.set32typ ELSE OPT.settyp := OPT.set64typ END; diff --git a/src/compiler/OPM.Mod b/src/compiler/OPM.Mod old mode 100644 new mode 100755 index 85392b15..ef6253d7 --- a/src/compiler/OPM.Mod +++ b/src/compiler/OPM.Mod @@ -92,7 +92,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) GlobalAlignment, Alignment*: INTEGER; GlobalOptions*, Options*: SET; - ShortintSize*, IntegerSize*, LongintSize*: INTEGER; + ShortintSize*, IntegerSize*, LongintSize*, SetSize*: INTEGER; MaxIndex*: SYSTEM.INT64; @@ -328,10 +328,10 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) MaxIndex := SignedMaximum(AddressSize); CASE Model[0] OF - |'2': ShortintSize := 1; IntegerSize := 2; LongintSize := 4 - |'C': ShortintSize := 2; IntegerSize := 4; LongintSize := 8 - |'V': ShortintSize := 1; IntegerSize := 4; LongintSize := 8 - ELSE ShortintSize := 1; IntegerSize := 2; LongintSize := 4 + |'2': ShortintSize := 1; IntegerSize := 2; LongintSize := 4; SetSize := 4; + |'C': ShortintSize := 2; IntegerSize := 4; LongintSize := 8; SetSize := 4; + |'V': ShortintSize := 1; IntegerSize := 4; LongintSize := 8; SetSize := 8; + ELSE ShortintSize := 1; IntegerSize := 2; LongintSize := 4; SetSize := 4; END; (*IF verbose IN Options THEN VerboseListSizes END;*) From 63008f6d30747e9ceac13acb2631ac47dbc6729f Mon Sep 17 00:00:00 2001 From: Dave Brown Date: Tue, 19 Nov 2019 19:45:23 +0000 Subject: [PATCH 521/580] Fix -OC set size in usage text --- src/compiler/OPM.Mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/OPM.Mod b/src/compiler/OPM.Mod index ef6253d7..b64e1e94 100755 --- a/src/compiler/OPM.Mod +++ b/src/compiler/OPM.Mod @@ -273,7 +273,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) LogWLn; LogWStr(" Size model for elementary types (default O2)"); LogWLn; LogWStr(" -O2 Original Oberon / Oberon-2: 8 bit SHORTINT, 16 bit INTEGER, 32 bit LONGINT and SET."); LogWLn; - LogWStr(" -OC Component Pascal: 16 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET."); LogWLn; + LogWStr(" -OC Component Pascal: 16 bit SHORTINT, 32 bit INTEGER and SET, 64 bit LONGINT."); LogWLn; LogWStr(" -OV Alternate large model: 8 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET."); LogWLn; LogWLn; LogWStr(" Target machine address size and alignment (default is that of the running compiler binary)"); LogWLn; From ff87e23780825b8c8e84fbe917ea36c7a30e7144 Mon Sep 17 00:00:00 2001 From: Norayr Chilingarian Date: Sun, 29 Mar 2020 20:40:36 +0400 Subject: [PATCH 522/580] fixed ooc.C typesizes and made X11 examples compile. --- src/library/ooc/oocCILP32.Mod | 12 ++++++------ src/library/ooc/oocCLLP64.Mod | 14 +++++++------- src/library/ooc/oocCLP64.Mod | 14 +++++++------- src/test/x11/0/makefile | 4 ++-- src/test/x11/IFS/makefile | 5 ++--- src/test/x11/mines/makefile | 5 +++-- src/test/x11/pacman/makefile | 5 +++-- src/test/x11/tetris/Tetris.Mod | 2 +- src/test/x11/tetris/makefile | 5 +++-- src/test/x11/tron/makefile | 4 ++-- src/test/x11/vier/makefile | 5 +++-- 11 files changed, 39 insertions(+), 36 deletions(-) diff --git a/src/library/ooc/oocCILP32.Mod b/src/library/ooc/oocCILP32.Mod index e868b9f6..66a3cde1 100644 --- a/src/library/ooc/oocCILP32.Mod +++ b/src/library/ooc/oocCILP32.Mod @@ -31,13 +31,13 @@ Unix they should be fairly safe. TYPE char* = CHAR; (* 8 bits *) - signedchar* = SHORTINT; (* 8 bits *) - shortint* = RECORD a,b: SYSTEM.BYTE END; (* 16 bits *) - int* = LONGINT; (* 32 bits *) - set* = LONGINT; (* 32 bits *) - longint* = LONGINT; (* 32 bits on ILP32 (64 bits is 'long long') *) + signedchar* = SYSTEM.INT8; (* 8 bits *) + shortint* = SYSTEM.INT16; (* 16 bits *) + int* = SYSTEM.INT32; (* 32 bits *) + set* = SYSTEM.INT32; (* 32 bits *) + longint* = SYSTEM.INT32; (* 32 bits on ILP32 (64 bits is 'long long') *) (*longset* = SET; n/a *) (* 64 bit SET *) - address* = LONGINT; (* 32 bits *) + address* = SYSTEM.ADDRESS; (* 32 bits *) float* = REAL; (* 32 bits *) double* = LONGREAL; (* 64 bits *) diff --git a/src/library/ooc/oocCLLP64.Mod b/src/library/ooc/oocCLLP64.Mod index a7eadc0b..4b6add95 100644 --- a/src/library/ooc/oocCLLP64.Mod +++ b/src/library/ooc/oocCLLP64.Mod @@ -31,13 +31,13 @@ Unix they should be fairly safe. TYPE char* = CHAR; (* 8 bits *) - signedchar* = SHORTINT; (* 8 bits *) - shortint* = RECORD a,b: SYSTEM.BYTE END; (* 16 bits *) - int* = INTEGER; (* 32 bits *) - set* = INTEGER; (* 32 bits *) - longint* = INTEGER; (* 32 bits *) - longset* = SET; (* 64 bits *) - address* = LONGINT; (* 64 bits *) + signedchar* = SYSTEM.INT8; (* 8 bits *) + shortint* = SYSTEM.INT16; (* 16 bits *) + int* = SYSTEM.INT32; (* 32 bits *) + set* = SYSTEM.SET32; (* 32 bits *) + longint* = SYSTEM.INT32; (* 32 bits *) + longset* = SYSTEM.SET64; (* 64 bits *) + address* = SYSTEM.INT64; (* 64 bits *) float* = REAL; (* 32 bits *) double* = LONGREAL; (* 64 bits *) diff --git a/src/library/ooc/oocCLP64.Mod b/src/library/ooc/oocCLP64.Mod index dcc76584..0e97c566 100644 --- a/src/library/ooc/oocCLP64.Mod +++ b/src/library/ooc/oocCLP64.Mod @@ -31,13 +31,13 @@ Unix they should be fairly safe. TYPE char* = CHAR; (* 8 bits *) - signedchar* = SHORTINT; (* 8 bits *) - shortint* = RECORD a,b: SYSTEM.BYTE END; (* 16 bits *) - int* = INTEGER; (* 32 bits *) - set* = INTEGER; (* 32 bits *) - longint* = LONGINT; (* 64 bits *) - longset* = SET; (* 64 bits *) - address* = LONGINT; (* 64 bits *) + signedchar* = SYSTEM.INT8; (* 8 bits *) + shortint* = SYSTEM.INT16; (* 16 bits *) + int* = SYSTEM.INT32; (* 32 bits *) + set* = SYSTEM.INT32; (* 32 bits *) + longint* = SYSTEM.INT64; (* 64 bits *) + longset* = SYSTEM.SET64; (* 64 bits *) + address* = SYSTEM.ADDRESS; (* 64 bits *) float* = REAL; (* 32 bits *) double* = LONGREAL; (* 64 bits *) diff --git a/src/test/x11/0/makefile b/src/test/x11/0/makefile index 67bf3938..c9b9aa5a 100644 --- a/src/test/x11/0/makefile +++ b/src/test/x11/0/makefile @@ -1,12 +1,12 @@ #for old systems like RHEL4 use #CFLAGS=-L/usr/X11R6/lib -lX11 +MODX11="../../../library/oocX11" CFLAGS=-lX11 export CFLAGS -MOD = MODULES="../../../lib/oocX11" VOC = $(MOD) /opt/voc/bin/voc all: - $(VOC) -s oocX11.Mod oocXutil.Mod oocXYplane.Mod test.Mod -m + $(VOC) -s $(MODX11)/oocX11.Mod $(MODX11)/oocXutil.Mod $(MODX11)/oocXYplane.Mod test.Mod -m #$(VOC) -Cm test.Mod #gcc -o test test.o -fPIC -g -I /opt/voc-1.0/src/lib/system/gcc/x86_64 -I /opt/voc-1.0/lib/voc/obj -lVishapOberon -L. -L/opt/voc-1.0/lib -lX11 diff --git a/src/test/x11/IFS/makefile b/src/test/x11/IFS/makefile index eda916b9..0e36987d 100644 --- a/src/test/x11/IFS/makefile +++ b/src/test/x11/IFS/makefile @@ -1,11 +1,10 @@ CFLAGS=-lX11 export CFLAGS - -MOD = MODULES="../../../lib/oocX11" +MODX11="../../../library/oocX11" VOC = $(MOD) /opt/voc/bin/voc all: - $(VOC) -s oocX11.Mod oocXutil.Mod oocXYplane.Mod IFS.Mod IFStest.Mod -m + $(VOC) -s $(MODX11)/oocX11.Mod $(MODX11)/oocXutil.Mod $(MODX11)/oocXYplane.Mod IFS.Mod IFStest.Mod -m #$(VOC) -Cm test.Mod #gcc -o test test.o -fPIC -g -I /opt/voc-1.0/src/lib/system/gcc/x86_64 -I /opt/voc-1.0/lib/voc/obj -lVishapOberon -L. -L/opt/voc-1.0/lib -lX11 diff --git a/src/test/x11/mines/makefile b/src/test/x11/mines/makefile index 02d5c8b4..f31fd926 100644 --- a/src/test/x11/mines/makefile +++ b/src/test/x11/mines/makefile @@ -3,11 +3,12 @@ CFLAGS=-lX11 export CFLAGS -MOD = MODULES="../../../lib/oocX11" +MODX11="../../../library/oocX11" + VOC = $(MOD) /opt/voc/bin/voc all: - $(VOC) -s oocX11.Mod oocXutil.Mod oocXYplane.Mod compatIn.Mod Linie.Mod Minesweeper.Mod -m + $(VOC) -s $(MODX11)/oocX11.Mod $(MODX11)/oocXutil.Mod $(MODX11)/oocXYplane.Mod compatIn.Mod Linie.Mod Minesweeper.Mod -m #$(VOC) -Cm test.Mod #gcc -o test test.o -fPIC -g -I /opt/voc-1.0/src/lib/system/gcc/x86_64 -I /opt/voc-1.0/lib/voc/obj -lVishapOberon -L. -L/opt/voc-1.0/lib -lX11 diff --git a/src/test/x11/pacman/makefile b/src/test/x11/pacman/makefile index 018f29c7..a90df273 100644 --- a/src/test/x11/pacman/makefile +++ b/src/test/x11/pacman/makefile @@ -3,11 +3,12 @@ CFLAGS=-lX11 export CFLAGS -MOD = MODULES="../../../lib/oocX11" +MODX11="../../../library/oocX11" + VOC = $(MOD) /opt/voc/bin/voc all: - $(VOC) -s oocX11.Mod oocXutil.Mod oocXYplane.Mod Grafik.Mod PacMan.Mod -m + $(VOC) -s $(MODX11)/oocX11.Mod $(MODX11)/oocXutil.Mod $(MODX11)/oocXYplane.Mod Grafik.Mod PacMan.Mod -m #$(VOC) -Cm test.Mod #gcc -o test test.o -fPIC -g -I /opt/voc-1.0/src/lib/system/gcc/x86_64 -I /opt/voc-1.0/lib/voc/obj -lVishapOberon -L. -L/opt/voc-1.0/lib -lX11 diff --git a/src/test/x11/tetris/Tetris.Mod b/src/test/x11/tetris/Tetris.Mod index a3468bd9..977d9ff4 100644 --- a/src/test/x11/tetris/Tetris.Mod +++ b/src/test/x11/tetris/Tetris.Mod @@ -5,7 +5,7 @@ MODULE Tetris; (* Neuerungen: Spielparameter sind ueber Konstantendeklariert, Zweispielermodus bricht bei Limit-Linien ab, Pause-Funktion wurde eingefuehrt *) -IMPORT X:=oocXYplane, L:=Linie, In := compatIn, Out := Console, RN:=ethRandomNumbers, Ziffer, Oberon := Kernel; +IMPORT X:=oocXYplane, L:=Linie, In := compatIn, Out := Console, RN:=ethRandomNumbers, Ziffer, Oberon; CONST diff --git a/src/test/x11/tetris/makefile b/src/test/x11/tetris/makefile index ae2c5119..e7c8a4b7 100644 --- a/src/test/x11/tetris/makefile +++ b/src/test/x11/tetris/makefile @@ -3,11 +3,12 @@ CFLAGS=-lX11 export CFLAGS -MOD = MODULES="../../../lib/oocX11" +MODX11="../../../library/oocX11" + VOC = $(MOD) /opt/voc/bin/voc all: - $(VOC) -s oocX11.Mod oocXutil.Mod oocXYplane.Mod compatIn.Mod Linie.Mod Ziffer.Mod Tetris.Mod -m + $(VOC) -s $(MODX11)/oocX11.Mod $(MODX11)/oocXutil.Mod $(MODX11)/oocXYplane.Mod compatIn.Mod Linie.Mod Ziffer.Mod Tetris.Mod -m #$(VOC) -Cm test.Mod #gcc -o test test.o -fPIC -g -I /opt/voc-1.0/src/lib/system/gcc/x86_64 -I /opt/voc-1.0/lib/voc/obj -lVishapOberon -L. -L/opt/voc-1.0/lib -lX11 diff --git a/src/test/x11/tron/makefile b/src/test/x11/tron/makefile index be94ea28..48464d5e 100644 --- a/src/test/x11/tron/makefile +++ b/src/test/x11/tron/makefile @@ -3,11 +3,11 @@ CFLAGS=-lX11 export CFLAGS -MOD = MODULES="../../../lib/oocX11" +MODX11="../../../library/oocX11" VOC = $(MOD) /opt/voc/bin/voc all: - $(VOC) -s oocX11.Mod oocXutil.Mod oocXYplane.Mod compatIn.Mod Tron.Mod -m + $(VOC) -s $(MODX11)/oocX11.Mod $(MODX11)/oocXutil.Mod $(MODX11)/oocXYplane.Mod compatIn.Mod Tron.Mod -m #$(VOC) -Cm test.Mod #gcc -o test test.o -fPIC -g -I /opt/voc-1.0/src/lib/system/gcc/x86_64 -I /opt/voc-1.0/lib/voc/obj -lVishapOberon -L. -L/opt/voc-1.0/lib -lX11 diff --git a/src/test/x11/vier/makefile b/src/test/x11/vier/makefile index 2c39f530..54d4ac35 100644 --- a/src/test/x11/vier/makefile +++ b/src/test/x11/vier/makefile @@ -3,11 +3,12 @@ CFLAGS=-lX11 export CFLAGS -MOD = MODULES="../../../lib/oocX11" +MODX11="../../../library/oocX11" + VOC = $(MOD) /opt/voc/bin/voc all: - $(VOC) -s oocX11.Mod oocXutil.Mod oocXYplane.Mod compatIn.Mod Ausgabe.Mod Vier.Mod -m + $(VOC) -s $(MODX11)/oocX11.Mod $(MODX11)/oocXutil.Mod $(MODX11)/oocXYplane.Mod compatIn.Mod Ausgabe.Mod Vier.Mod -m #$(VOC) -Cm test.Mod #gcc -o test test.o -fPIC -g -I /opt/voc-1.0/src/lib/system/gcc/x86_64 -I /opt/voc-1.0/lib/voc/obj -lVishapOberon -L. -L/opt/voc-1.0/lib -lX11 From c9b56ea10e16c884720a68f5b2bb8c821049521d Mon Sep 17 00:00:00 2001 From: David C W Brown Date: Tue, 16 Jun 2020 18:12:30 +0100 Subject: [PATCH 523/580] Remove GC blocking IF test, add abstract comment to each compiler mod. --- src/compiler/OPB.Mod | 2 +- src/compiler/OPP.Mod | 1 + src/compiler/OPS.Mod | 1 + src/compiler/OPT.Mod | 1 + src/compiler/OPV.Mod | 1 + src/runtime/Heap.Mod | 59 ++++++++++++++++++++++++-------------------- 6 files changed, 37 insertions(+), 28 deletions(-) diff --git a/src/compiler/OPB.Mod b/src/compiler/OPB.Mod index 84085804..718d9b9e 100644 --- a/src/compiler/OPB.Mod +++ b/src/compiler/OPB.Mod @@ -1,5 +1,5 @@ +(* Oberon Portable build parse tree (front end) *) MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) -(* build parse tree *) IMPORT OPT, OPS, OPM, SYSTEM; diff --git a/src/compiler/OPP.Mod b/src/compiler/OPP.Mod index 2b9fb0b1..96117cad 100644 --- a/src/compiler/OPP.Mod +++ b/src/compiler/OPP.Mod @@ -1,3 +1,4 @@ +(* OPP - Oberon Portable Parser (front end) *) MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) IMPORT diff --git a/src/compiler/OPS.Mod b/src/compiler/OPS.Mod index 909cdee2..9cb59e37 100644 --- a/src/compiler/OPS.Mod +++ b/src/compiler/OPS.Mod @@ -1,3 +1,4 @@ +(* Oberon Portable Scanner (front end) *) MODULE OPS; (* NW, RC 6.3.89 / 18.10.92 *) (* object model 3.6.92 *) IMPORT OPM, SYSTEM; diff --git a/src/compiler/OPT.Mod b/src/compiler/OPT.Mod index 2641703e..758bb505 100644 --- a/src/compiler/OPT.Mod +++ b/src/compiler/OPT.Mod @@ -1,3 +1,4 @@ +(* OPT - Oberon Portable Symbol Table (front end) *) MODULE OPT; (* NW, RC 6.3.89 / 23.1.92 *) (* object model 24.2.94 *) (* diff --git a/src/compiler/OPV.Mod b/src/compiler/OPV.Mod index 371d69d3..c6b26c05 100644 --- a/src/compiler/OPV.Mod +++ b/src/compiler/OPV.Mod @@ -1,3 +1,4 @@ +(* OPV - parse tree traverser (back end) *) MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 26.7.2002 jt bug fix OPS.in Len: wrong result if called for fixed OPT.Array diff --git a/src/runtime/Heap.Mod b/src/runtime/Heap.Mod index 885b4899..4c57fa3c 100644 --- a/src/runtime/Heap.Mod +++ b/src/runtime/Heap.Mod @@ -91,7 +91,7 @@ MODULE Heap; (* finalization candidates *) fin: FinNode; - (* garbage collector locking *) + (* garbage collector busy flag *) lockdepth: INTEGER; interrupted: BOOLEAN; @@ -549,6 +549,8 @@ MODULE Heap; END END MarkStack; + + PROCEDURE GC*(markStack: BOOLEAN); VAR m: Module; @@ -556,34 +558,37 @@ MODULE Heap; i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23: S.ADDRESS; cand: ARRAY 10000 OF S.ADDRESS; BEGIN - IF (lockdepth = 0) OR (lockdepth = 1) & ~markStack THEN - Lock(); - m := S.VAL(Module, modules); - WHILE m # NIL DO - IF m.enumPtrs # NIL THEN m.enumPtrs(MarkP) END; - m := m^.next + Lock(); + m := S.VAL(Module, modules); + WHILE m # NIL DO + IF m.enumPtrs # NIL THEN m.enumPtrs(MarkP) END; + m := m^.next + END; + IF markStack THEN + (* generate register pressure to force callee saved registers to memory; + may be simplified by inlining OS calls or processor specific instructions + *) + i0 := -100; i1 := -101; i2 := -102; i3 := -103; i4 := -104; i5 := -105; i6 := -106; i7 := -107; + i8 := 1; i9 := 2; i10 := 3; i11 := 4; i12 := 5; i13 := 6; i14 := 7; i15 := 8; + i16 := 9; i17 := 10; i18 := 11; i19 := 12; i20 := 13; i21 := 14; i22 := 15; i23 := 16; + LOOP + INC(i0, 1); INC(i1, 2); INC(i2, 3); INC(i3, 4); INC(i4, 5); INC(i5, 6); INC(i6, 7); INC(i7, 8); + INC(i8, 9); INC(i9, 10); INC(i10, 11); INC(i11, 12); INC(i12, 13); INC(i13, 14); INC(i14, 15); INC(i15, 16); + INC(i16, 17); INC(i17, 18); INC(i18, 19); INC(i19, 20); INC(i20, 21); INC(i21, 22); INC(i22, 23); INC(i23, 24); + IF (i0 = -99) & (i15 = 24) THEN (* True at first iteration *) + MarkStack(32, cand); EXIT + END END; - IF markStack THEN - (* generate register pressure to force callee saved registers to memory; - may be simplified by inlining OS calls or processor specific instructions - *) - i0 := -100; i1 := -101; i2 := -102; i3 := -103; i4 := -104; i5 := -105; i6 := -106; i7 := -107; - i8 := 1; i9 := 2; i10 := 3; i11 := 4; i12 := 5; i13 := 6; i14 := 7; i15 := 8; - i16 := 9; i17 := 10; i18 := 11; i19 := 12; i20 := 13; i21 := 14; i22 := 15; i23 := 16; - LOOP INC(i0, 1); INC(i1, 2); INC(i2, 3); INC(i3, 4); INC(i4, 5); INC(i5, 6); INC(i6, 7); INC(i7, 8); - INC(i8, 9); INC(i9, 10); INC(i10, 11); INC(i11, 12); INC(i12, 13); INC(i13, 14); INC(i14, 15); INC(i15, 16); - INC(i16, 17); INC(i17, 18); INC(i18, 19); INC(i19, 20); INC(i20, 21); INC(i21, 22); INC(i22, 23); INC(i23, 24); - IF (i0 = -99) & (i15 = 24) THEN MarkStack(32, cand); EXIT END - END; - IF i0 + i1 + i2 + i3 + i4 + i5 + i6 + i7 + i8 + i9 + i10 + i11 + i12 + i13 + i14 + i15 - + i16 + i17 + i18 + i19 + i20 + i21 + i22 + i23 > 10000 THEN RETURN (* use all variables *) - END; + IF i0 + i1 + i2 + i3 + i4 + i5 + i6 + i7 (* use all variables *) + + i8 + i9 + i10 + i11 + i12 + i13 + i14 + i15 + + i16 + i17 + i18 + i19 + i20 + i21 + i22 + i23 > 10000 THEN (* Always false *) + RETURN END; - CheckFin; - Scan; - Finalize; - Unlock() - END + END; + CheckFin; + Scan; + Finalize; + Unlock() END GC; PROCEDURE RegisterFinalizer*(obj: S.PTR; finalize: Finalizer); From 3d62284b3221b877cb2a9e2c413056e7e719956b Mon Sep 17 00:00:00 2001 From: Norayr Chilingarian Date: Mon, 27 Dec 2021 19:38:05 +0400 Subject: [PATCH 524/580] typo fix: oname should be ONAME https://github.com/vishaps/voc/issues/97 --- src/tools/make/oberon.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/make/oberon.mk b/src/tools/make/oberon.mk index 21068cba..dd1610bb 100644 --- a/src/tools/make/oberon.mk +++ b/src/tools/make/oberon.mk @@ -190,7 +190,7 @@ installable: uninstall: installable @printf '\nUninstalling from \"$(INSTALLDIR)\"\n' rm -rf "$(INSTALLDIR)" - @sh src/tools/make/addlibrary.sh uninstall "$(INSTALLDIR)/lib" $(oname) + @sh src/tools/make/addlibrary.sh uninstall "$(INSTALLDIR)/lib" $(ONAME) # install: Use only after a successful full build. Installs the compiler From bc8adf76c1dd27fcf5e6d1e8300216e060d5ca6d Mon Sep 17 00:00:00 2001 From: Norayr Chilingarian Date: Mon, 27 Dec 2021 19:52:27 +0400 Subject: [PATCH 525/580] fixes "memory past end of source var" warning, solution by @kekcleader; issue: https://github.com/vishaps/voc/issues/96 --- src/runtime/Files.Mod | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/runtime/Files.Mod b/src/runtime/Files.Mod index 5ce79071..aede16c4 100644 --- a/src/runtime/Files.Mod +++ b/src/runtime/Files.Mod @@ -672,7 +672,15 @@ Especially Length would become fairly complex. PROCEDURE WriteSet* (VAR R: Rider; x: SET); VAR b: ARRAY 4 OF CHAR; i: LONGINT; - BEGIN i := SYSTEM.VAL(LONGINT, x); + 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; From 32ec67552f1bb5b154ba0a5f9327cb1b99981c50 Mon Sep 17 00:00:00 2001 From: Norayr Chilingarian Date: Tue, 15 Mar 2022 17:20:41 +0400 Subject: [PATCH 526/580] fix in ooc Strings modules to prevent index out of range error. --- src/library/ooc/oocStrings.Mod | 6 +++++- src/library/ooc2/ooc2Strings.Mod | 7 ++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/library/ooc/oocStrings.Mod b/src/library/ooc/oocStrings.Mod index add23621..73315fa3 100644 --- a/src/library/ooc/oocStrings.Mod +++ b/src/library/ooc/oocStrings.Mod @@ -63,7 +63,11 @@ PROCEDURE Length* (stringVal: ARRAY OF CHAR): INTEGER; i: INTEGER; BEGIN i := 0; - WHILE (stringVal[i] # 0X) DO + (* note from noch: + original ooc code below, commented out, leads to + index out of range runtime error + WHILE (stringVal[i] # 0X) DO *) + WHILE ((i < LEN(stringVal)) & (stringVal[i] # 0X)) DO INC (i) END; RETURN i diff --git a/src/library/ooc2/ooc2Strings.Mod b/src/library/ooc2/ooc2Strings.Mod index a0ad4362..278f2663 100644 --- a/src/library/ooc2/ooc2Strings.Mod +++ b/src/library/ooc2/ooc2Strings.Mod @@ -59,7 +59,12 @@ PROCEDURE Length* (stringVal: ARRAY OF CHAR): INTEGER; i: INTEGER; BEGIN i := 0; - WHILE (stringVal[i] # 0X) DO + (* note from noch: + this original ooc code crashes with index out of range + because it doesn't expect a string which has no 0X character + so i had to change it + WHILE (stringVal[i] # 0X) DO *) + WHILE ((i < LEN(stringVal)) & (stringVal[i] # 0X)) DO INC (i) END; RETURN i From 590398b27ed70eedebf32b828dc321c12b403cf4 Mon Sep 17 00:00:00 2001 From: Norayr Chilingarian Date: Tue, 15 Mar 2022 17:23:17 +0400 Subject: [PATCH 527/580] update of bootstrap files. --- bootstrap/unix-44/Compiler.c | 4 +- bootstrap/unix-44/Configuration.c | 4 +- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Files.c | 6 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 142 +++++++++++++-------------- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 2 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 10 +- bootstrap/unix-44/OPM.h | 4 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 2 +- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 2 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Out.c | 2 +- bootstrap/unix-44/Out.h | 2 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/VT100.c | 2 +- bootstrap/unix-44/VT100.h | 2 +- bootstrap/unix-44/extTools.c | 2 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-48/Compiler.c | 4 +- bootstrap/unix-48/Configuration.c | 4 +- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Files.c | 6 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 142 +++++++++++++-------------- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 2 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 10 +- bootstrap/unix-48/OPM.h | 4 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 2 +- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 2 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Out.c | 2 +- bootstrap/unix-48/Out.h | 2 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/VT100.c | 2 +- bootstrap/unix-48/VT100.h | 2 +- bootstrap/unix-48/extTools.c | 2 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-88/Compiler.c | 4 +- bootstrap/unix-88/Configuration.c | 4 +- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Files.c | 6 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 142 +++++++++++++-------------- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 2 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 10 +- bootstrap/unix-88/OPM.h | 4 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 2 +- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 2 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Out.c | 2 +- bootstrap/unix-88/Out.h | 2 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/VT100.c | 2 +- bootstrap/unix-88/VT100.h | 2 +- bootstrap/unix-88/extTools.c | 2 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/windows-48/Compiler.c | 4 +- bootstrap/windows-48/Configuration.c | 4 +- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Files.c | 6 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 142 +++++++++++++-------------- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 2 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 10 +- bootstrap/windows-48/OPM.h | 4 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 2 +- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 2 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Out.c | 2 +- bootstrap/windows-48/Out.h | 2 +- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/VT100.c | 2 +- bootstrap/windows-48/VT100.h | 2 +- bootstrap/windows-48/extTools.c | 2 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-88/Compiler.c | 4 +- bootstrap/windows-88/Configuration.c | 4 +- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Files.c | 6 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 142 +++++++++++++-------------- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 2 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 10 +- bootstrap/windows-88/OPM.h | 4 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 2 +- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 2 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Out.c | 2 +- bootstrap/windows-88/Out.h | 2 +- bootstrap/windows-88/Platform.c | 2 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/VT100.c | 2 +- bootstrap/windows-88/VT100.h | 2 +- bootstrap/windows-88/extTools.c | 2 +- bootstrap/windows-88/extTools.h | 2 +- 185 files changed, 590 insertions(+), 570 deletions(-) diff --git a/bootstrap/unix-44/Compiler.c b/bootstrap/unix-44/Compiler.c index 4f763604..bd643b9a 100644 --- a/bootstrap/unix-44/Compiler.c +++ b/bootstrap/unix-44/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ #define SHORTINT INT8 #define INTEGER INT16 @@ -89,7 +89,7 @@ static void Compiler_PropagateElementaryTypeSizes (void) OPT_sintobj->typ = OPT_sinttyp; OPT_intobj->typ = OPT_inttyp; OPT_lintobj->typ = OPT_linttyp; - switch (OPM_LongintSize) { + switch (OPM_SetSize) { case 4: OPT_settyp = OPT_set32typ; break; diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index 646b2242..1c746b94 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index 7b9ae370..1747f3ca 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 492214b6..821546e2 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -966,7 +966,9 @@ void Files_WriteSet (Files_Rider *R, ADDRESS *R__typ, UINT32 x) { CHAR b[4]; INT32 i; - i = (INT32)x; + UINT64 y; + y = x; + i = __VAL(INT32, y); b[0] = __CHR(i); b[1] = __CHR(__ASHR(i, 8)); b[2] = __CHR(__ASHR(i, 16)); diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index 08ff9fe0..8ba31015 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index a01553d6..c7957869 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -665,79 +665,77 @@ void Heap_GC (BOOLEAN markStack) Heap_Module m; INT32 i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; INT32 cand[10000]; - if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { - Heap_Lock(); - m = (Heap_Module)(ADDRESS)Heap_modules; - while (m != NIL) { - if (m->enumPtrs != NIL) { - (*m->enumPtrs)(Heap_MarkP); - } - m = m->next; + Heap_Lock(); + m = (Heap_Module)(ADDRESS)Heap_modules; + while (m != NIL) { + if (m->enumPtrs != NIL) { + (*m->enumPtrs)(Heap_MarkP); } - if (markStack) { - i0 = -100; - i1 = -101; - i2 = -102; - i3 = -103; - i4 = -104; - i5 = -105; - i6 = -106; - i7 = -107; - i8 = 1; - i9 = 2; - i10 = 3; - i11 = 4; - i12 = 5; - i13 = 6; - i14 = 7; - i15 = 8; - i16 = 9; - i17 = 10; - i18 = 11; - i19 = 12; - i20 = 13; - i21 = 14; - i22 = 15; - i23 = 16; - for (;;) { - i0 += 1; - i1 += 2; - i2 += 3; - i3 += 4; - i4 += 5; - i5 += 6; - i6 += 7; - i7 += 8; - i8 += 9; - i9 += 10; - i10 += 11; - i11 += 12; - i12 += 13; - i13 += 14; - i14 += 15; - i15 += 16; - i16 += 17; - i17 += 18; - i18 += 19; - i19 += 20; - i20 += 21; - i21 += 22; - i22 += 23; - i23 += 24; - if ((i0 == -99 && i15 == 24)) { - Heap_MarkStack(32, (void*)cand, 10000); - break; - } - } - if (((((((((((((((((((((((i0 + i1) + i2) + i3) + i4) + i5) + i6) + i7) + i8) + i9) + i10) + i11) + i12) + i13) + i14) + i15) + i16) + i17) + i18) + i19) + i20) + i21) + i22) + i23 > 10000) { - return; - } - } - Heap_CheckFin(); - Heap_Scan(); - Heap_Finalize(); - Heap_Unlock(); + m = m->next; } + if (markStack) { + i0 = -100; + i1 = -101; + i2 = -102; + i3 = -103; + i4 = -104; + i5 = -105; + i6 = -106; + i7 = -107; + i8 = 1; + i9 = 2; + i10 = 3; + i11 = 4; + i12 = 5; + i13 = 6; + i14 = 7; + i15 = 8; + i16 = 9; + i17 = 10; + i18 = 11; + i19 = 12; + i20 = 13; + i21 = 14; + i22 = 15; + i23 = 16; + for (;;) { + i0 += 1; + i1 += 2; + i2 += 3; + i3 += 4; + i4 += 5; + i5 += 6; + i6 += 7; + i7 += 8; + i8 += 9; + i9 += 10; + i10 += 11; + i11 += 12; + i12 += 13; + i13 += 14; + i14 += 15; + i15 += 16; + i16 += 17; + i17 += 18; + i18 += 19; + i19 += 20; + i20 += 21; + i21 += 22; + i22 += 23; + i23 += 24; + if ((i0 == -99 && i15 == 24)) { + Heap_MarkStack(32, (void*)cand, 10000); + break; + } + } + if (((((((((((((((((((((((i0 + i1) + i2) + i3) + i4) + i5) + i6) + i7) + i8) + i9) + i10) + i11) + i12) + i13) + i14) + i15) + i16) + i17) + i18) + i19) + i20) + i21) + i22) + i23 > 10000) { + return; + } + } + Heap_CheckFin(); + Heap_Scan(); + Heap_Finalize(); + Heap_Unlock(); } void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index 7eb1fed5..385cd08c 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index 1e66d12e..f1df9980 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index c06e7adf..74575f7f 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index d716887b..46fc80da 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index 654ea008..d409cbfd 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index cfc69c4f..dfeb1a84 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index 14b85b47..4086dae5 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 16996b23..9c87c0c5 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -27,7 +27,7 @@ export INT16 OPM_AddressSize; static INT16 OPM_GlobalAlignment; export INT16 OPM_Alignment; export UINT32 OPM_GlobalOptions, OPM_Options; -export INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize; +export INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; export INT64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; @@ -338,7 +338,7 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWLn(); OPM_LogWStr((CHAR*)" -O2 Original Oberon / Oberon-2: 8 bit SHORTINT, 16 bit INTEGER, 32 bit LONGINT and SET.", 95); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -OC Component Pascal: 16 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET.", 95); + OPM_LogWStr((CHAR*)" -OC Component Pascal: 16 bit SHORTINT, 32 bit INTEGER and SET, 64 bit LONGINT.", 95); OPM_LogWLn(); OPM_LogWStr((CHAR*)" -OV Alternate large model: 8 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET.", 95); OPM_LogWLn(); @@ -410,21 +410,25 @@ void OPM_InitOptions (void) OPM_ShortintSize = 1; OPM_IntegerSize = 2; OPM_LongintSize = 4; + OPM_SetSize = 4; break; case 'C': OPM_ShortintSize = 2; OPM_IntegerSize = 4; OPM_LongintSize = 8; + OPM_SetSize = 4; break; case 'V': OPM_ShortintSize = 1; OPM_IntegerSize = 4; OPM_LongintSize = 8; + OPM_SetSize = 8; break; default: OPM_ShortintSize = 1; OPM_IntegerSize = 2; OPM_LongintSize = 4; + OPM_SetSize = 4; break; } __MOVE(OPM_InstallDir, OPM_ResourceDir, 1024); diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index a046228e..8b0c7133 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPM__h #define OPM__h @@ -9,7 +9,7 @@ import CHAR OPM_Model[10]; import INT16 OPM_AddressSize, OPM_Alignment; import UINT32 OPM_GlobalOptions, OPM_Options; -import INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize; +import INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; import INT64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index df77049f..4226dd8b 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index 50bb8039..a389b3d9 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index 67f0d84a..4dd60bee 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index edbf5767..009b0baa 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index 1386ae18..9284c006 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index 578e9629..95bbf8b0 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index 789619eb..3e6f92d5 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index 74a49d24..ca2ef73d 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Out.c b/bootstrap/unix-44/Out.c index 7d4c7d72..6f5e342a 100644 --- a/bootstrap/unix-44/Out.c +++ b/bootstrap/unix-44/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Out.h b/bootstrap/unix-44/Out.h index ba654cb8..7507a692 100644 --- a/bootstrap/unix-44/Out.h +++ b/bootstrap/unix-44/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 8c32b583..db6a8378 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index 0cecb356..7ef51226 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 2b8483b4..c969b821 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index 270f7735..b1b5513e 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index 864f4ace..c0b1581b 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index e3ff12c6..e5750cb0 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index ff6f352e..c2e600fa 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index 0fd08ee2..ea14161b 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/VT100.c b/bootstrap/unix-44/VT100.c index 84ffc7ab..aad9af3b 100644 --- a/bootstrap/unix-44/VT100.c +++ b/bootstrap/unix-44/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/VT100.h b/bootstrap/unix-44/VT100.h index 3aafef64..a382735c 100644 --- a/bootstrap/unix-44/VT100.h +++ b/bootstrap/unix-44/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index 082bedeb..9ffffdd9 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index 0bc230e3..403cdeff 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/Compiler.c b/bootstrap/unix-48/Compiler.c index 4f763604..bd643b9a 100644 --- a/bootstrap/unix-48/Compiler.c +++ b/bootstrap/unix-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ #define SHORTINT INT8 #define INTEGER INT16 @@ -89,7 +89,7 @@ static void Compiler_PropagateElementaryTypeSizes (void) OPT_sintobj->typ = OPT_sinttyp; OPT_intobj->typ = OPT_inttyp; OPT_lintobj->typ = OPT_linttyp; - switch (OPM_LongintSize) { + switch (OPM_SetSize) { case 4: OPT_settyp = OPT_set32typ; break; diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index 646b2242..1c746b94 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index 7b9ae370..1747f3ca 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 492214b6..821546e2 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -966,7 +966,9 @@ void Files_WriteSet (Files_Rider *R, ADDRESS *R__typ, UINT32 x) { CHAR b[4]; INT32 i; - i = (INT32)x; + UINT64 y; + y = x; + i = __VAL(INT32, y); b[0] = __CHR(i); b[1] = __CHR(__ASHR(i, 8)); b[2] = __CHR(__ASHR(i, 16)); diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index 08ff9fe0..8ba31015 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index a01553d6..c7957869 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -665,79 +665,77 @@ void Heap_GC (BOOLEAN markStack) Heap_Module m; INT32 i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; INT32 cand[10000]; - if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { - Heap_Lock(); - m = (Heap_Module)(ADDRESS)Heap_modules; - while (m != NIL) { - if (m->enumPtrs != NIL) { - (*m->enumPtrs)(Heap_MarkP); - } - m = m->next; + Heap_Lock(); + m = (Heap_Module)(ADDRESS)Heap_modules; + while (m != NIL) { + if (m->enumPtrs != NIL) { + (*m->enumPtrs)(Heap_MarkP); } - if (markStack) { - i0 = -100; - i1 = -101; - i2 = -102; - i3 = -103; - i4 = -104; - i5 = -105; - i6 = -106; - i7 = -107; - i8 = 1; - i9 = 2; - i10 = 3; - i11 = 4; - i12 = 5; - i13 = 6; - i14 = 7; - i15 = 8; - i16 = 9; - i17 = 10; - i18 = 11; - i19 = 12; - i20 = 13; - i21 = 14; - i22 = 15; - i23 = 16; - for (;;) { - i0 += 1; - i1 += 2; - i2 += 3; - i3 += 4; - i4 += 5; - i5 += 6; - i6 += 7; - i7 += 8; - i8 += 9; - i9 += 10; - i10 += 11; - i11 += 12; - i12 += 13; - i13 += 14; - i14 += 15; - i15 += 16; - i16 += 17; - i17 += 18; - i18 += 19; - i19 += 20; - i20 += 21; - i21 += 22; - i22 += 23; - i23 += 24; - if ((i0 == -99 && i15 == 24)) { - Heap_MarkStack(32, (void*)cand, 10000); - break; - } - } - if (((((((((((((((((((((((i0 + i1) + i2) + i3) + i4) + i5) + i6) + i7) + i8) + i9) + i10) + i11) + i12) + i13) + i14) + i15) + i16) + i17) + i18) + i19) + i20) + i21) + i22) + i23 > 10000) { - return; - } - } - Heap_CheckFin(); - Heap_Scan(); - Heap_Finalize(); - Heap_Unlock(); + m = m->next; } + if (markStack) { + i0 = -100; + i1 = -101; + i2 = -102; + i3 = -103; + i4 = -104; + i5 = -105; + i6 = -106; + i7 = -107; + i8 = 1; + i9 = 2; + i10 = 3; + i11 = 4; + i12 = 5; + i13 = 6; + i14 = 7; + i15 = 8; + i16 = 9; + i17 = 10; + i18 = 11; + i19 = 12; + i20 = 13; + i21 = 14; + i22 = 15; + i23 = 16; + for (;;) { + i0 += 1; + i1 += 2; + i2 += 3; + i3 += 4; + i4 += 5; + i5 += 6; + i6 += 7; + i7 += 8; + i8 += 9; + i9 += 10; + i10 += 11; + i11 += 12; + i12 += 13; + i13 += 14; + i14 += 15; + i15 += 16; + i16 += 17; + i17 += 18; + i18 += 19; + i19 += 20; + i20 += 21; + i21 += 22; + i22 += 23; + i23 += 24; + if ((i0 == -99 && i15 == 24)) { + Heap_MarkStack(32, (void*)cand, 10000); + break; + } + } + if (((((((((((((((((((((((i0 + i1) + i2) + i3) + i4) + i5) + i6) + i7) + i8) + i9) + i10) + i11) + i12) + i13) + i14) + i15) + i16) + i17) + i18) + i19) + i20) + i21) + i22) + i23 > 10000) { + return; + } + } + Heap_CheckFin(); + Heap_Scan(); + Heap_Finalize(); + Heap_Unlock(); } void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index 7eb1fed5..385cd08c 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index 1e66d12e..f1df9980 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index c06e7adf..74575f7f 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index d716887b..46fc80da 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index 654ea008..d409cbfd 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index cfc69c4f..dfeb1a84 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index 14b85b47..4086dae5 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 16996b23..9c87c0c5 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -27,7 +27,7 @@ export INT16 OPM_AddressSize; static INT16 OPM_GlobalAlignment; export INT16 OPM_Alignment; export UINT32 OPM_GlobalOptions, OPM_Options; -export INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize; +export INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; export INT64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; @@ -338,7 +338,7 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWLn(); OPM_LogWStr((CHAR*)" -O2 Original Oberon / Oberon-2: 8 bit SHORTINT, 16 bit INTEGER, 32 bit LONGINT and SET.", 95); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -OC Component Pascal: 16 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET.", 95); + OPM_LogWStr((CHAR*)" -OC Component Pascal: 16 bit SHORTINT, 32 bit INTEGER and SET, 64 bit LONGINT.", 95); OPM_LogWLn(); OPM_LogWStr((CHAR*)" -OV Alternate large model: 8 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET.", 95); OPM_LogWLn(); @@ -410,21 +410,25 @@ void OPM_InitOptions (void) OPM_ShortintSize = 1; OPM_IntegerSize = 2; OPM_LongintSize = 4; + OPM_SetSize = 4; break; case 'C': OPM_ShortintSize = 2; OPM_IntegerSize = 4; OPM_LongintSize = 8; + OPM_SetSize = 4; break; case 'V': OPM_ShortintSize = 1; OPM_IntegerSize = 4; OPM_LongintSize = 8; + OPM_SetSize = 8; break; default: OPM_ShortintSize = 1; OPM_IntegerSize = 2; OPM_LongintSize = 4; + OPM_SetSize = 4; break; } __MOVE(OPM_InstallDir, OPM_ResourceDir, 1024); diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index a046228e..8b0c7133 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPM__h #define OPM__h @@ -9,7 +9,7 @@ import CHAR OPM_Model[10]; import INT16 OPM_AddressSize, OPM_Alignment; import UINT32 OPM_GlobalOptions, OPM_Options; -import INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize; +import INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; import INT64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index df77049f..4226dd8b 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index 50bb8039..a389b3d9 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index 67f0d84a..4dd60bee 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index edbf5767..009b0baa 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index cf3ae87d..50f3065b 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index 578e9629..95bbf8b0 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index 789619eb..3e6f92d5 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index 74a49d24..ca2ef73d 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Out.c b/bootstrap/unix-48/Out.c index 7d4c7d72..6f5e342a 100644 --- a/bootstrap/unix-48/Out.c +++ b/bootstrap/unix-48/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Out.h b/bootstrap/unix-48/Out.h index ba654cb8..7507a692 100644 --- a/bootstrap/unix-48/Out.h +++ b/bootstrap/unix-48/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 8c32b583..db6a8378 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index 0cecb356..7ef51226 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 2b8483b4..c969b821 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index 270f7735..b1b5513e 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index 864f4ace..c0b1581b 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index e3ff12c6..e5750cb0 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index 628d68a4..fcd01a50 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index 02f20def..443cb429 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/VT100.c b/bootstrap/unix-48/VT100.c index 84ffc7ab..aad9af3b 100644 --- a/bootstrap/unix-48/VT100.c +++ b/bootstrap/unix-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/VT100.h b/bootstrap/unix-48/VT100.h index 3aafef64..a382735c 100644 --- a/bootstrap/unix-48/VT100.h +++ b/bootstrap/unix-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index 082bedeb..9ffffdd9 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index 0bc230e3..403cdeff 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/Compiler.c b/bootstrap/unix-88/Compiler.c index 4f763604..bd643b9a 100644 --- a/bootstrap/unix-88/Compiler.c +++ b/bootstrap/unix-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ #define SHORTINT INT8 #define INTEGER INT16 @@ -89,7 +89,7 @@ static void Compiler_PropagateElementaryTypeSizes (void) OPT_sintobj->typ = OPT_sinttyp; OPT_intobj->typ = OPT_inttyp; OPT_lintobj->typ = OPT_linttyp; - switch (OPM_LongintSize) { + switch (OPM_SetSize) { case 4: OPT_settyp = OPT_set32typ; break; diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index 646b2242..1c746b94 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index 7b9ae370..1747f3ca 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index b07eb5ea..9a887e8f 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -966,7 +966,9 @@ void Files_WriteSet (Files_Rider *R, ADDRESS *R__typ, UINT32 x) { CHAR b[4]; INT32 i; - i = (INT32)x; + UINT64 y; + y = x; + i = __VAL(INT32, y); b[0] = __CHR(i); b[1] = __CHR(__ASHR(i, 8)); b[2] = __CHR(__ASHR(i, 16)); diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 2606a167..23f65c21 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index 6ab94025..5b01f160 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -665,79 +665,77 @@ void Heap_GC (BOOLEAN markStack) Heap_Module m; INT64 i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; INT64 cand[10000]; - if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { - Heap_Lock(); - m = (Heap_Module)(ADDRESS)Heap_modules; - while (m != NIL) { - if (m->enumPtrs != NIL) { - (*m->enumPtrs)(Heap_MarkP); - } - m = m->next; + Heap_Lock(); + m = (Heap_Module)(ADDRESS)Heap_modules; + while (m != NIL) { + if (m->enumPtrs != NIL) { + (*m->enumPtrs)(Heap_MarkP); } - if (markStack) { - i0 = -100; - i1 = -101; - i2 = -102; - i3 = -103; - i4 = -104; - i5 = -105; - i6 = -106; - i7 = -107; - i8 = 1; - i9 = 2; - i10 = 3; - i11 = 4; - i12 = 5; - i13 = 6; - i14 = 7; - i15 = 8; - i16 = 9; - i17 = 10; - i18 = 11; - i19 = 12; - i20 = 13; - i21 = 14; - i22 = 15; - i23 = 16; - for (;;) { - i0 += 1; - i1 += 2; - i2 += 3; - i3 += 4; - i4 += 5; - i5 += 6; - i6 += 7; - i7 += 8; - i8 += 9; - i9 += 10; - i10 += 11; - i11 += 12; - i12 += 13; - i13 += 14; - i14 += 15; - i15 += 16; - i16 += 17; - i17 += 18; - i18 += 19; - i19 += 20; - i20 += 21; - i21 += 22; - i22 += 23; - i23 += 24; - if ((i0 == -99 && i15 == 24)) { - Heap_MarkStack(32, (void*)cand, 10000); - break; - } - } - if (((((((((((((((((((((((i0 + i1) + i2) + i3) + i4) + i5) + i6) + i7) + i8) + i9) + i10) + i11) + i12) + i13) + i14) + i15) + i16) + i17) + i18) + i19) + i20) + i21) + i22) + i23 > 10000) { - return; - } - } - Heap_CheckFin(); - Heap_Scan(); - Heap_Finalize(); - Heap_Unlock(); + m = m->next; } + if (markStack) { + i0 = -100; + i1 = -101; + i2 = -102; + i3 = -103; + i4 = -104; + i5 = -105; + i6 = -106; + i7 = -107; + i8 = 1; + i9 = 2; + i10 = 3; + i11 = 4; + i12 = 5; + i13 = 6; + i14 = 7; + i15 = 8; + i16 = 9; + i17 = 10; + i18 = 11; + i19 = 12; + i20 = 13; + i21 = 14; + i22 = 15; + i23 = 16; + for (;;) { + i0 += 1; + i1 += 2; + i2 += 3; + i3 += 4; + i4 += 5; + i5 += 6; + i6 += 7; + i7 += 8; + i8 += 9; + i9 += 10; + i10 += 11; + i11 += 12; + i12 += 13; + i13 += 14; + i14 += 15; + i15 += 16; + i16 += 17; + i17 += 18; + i18 += 19; + i19 += 20; + i20 += 21; + i21 += 22; + i22 += 23; + i23 += 24; + if ((i0 == -99 && i15 == 24)) { + Heap_MarkStack(32, (void*)cand, 10000); + break; + } + } + if (((((((((((((((((((((((i0 + i1) + i2) + i3) + i4) + i5) + i6) + i7) + i8) + i9) + i10) + i11) + i12) + i13) + i14) + i15) + i16) + i17) + i18) + i19) + i20) + i21) + i22) + i23 > 10000) { + return; + } + } + Heap_CheckFin(); + Heap_Scan(); + Heap_Finalize(); + Heap_Unlock(); } void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index 16458b6a..82b83e8c 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 282588f9..5f8012d2 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index ee462907..2d245d3b 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index d716887b..46fc80da 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index 654ea008..d409cbfd 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index cfc69c4f..dfeb1a84 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index 14b85b47..4086dae5 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 59ad4e17..716c199c 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -27,7 +27,7 @@ export INT16 OPM_AddressSize; static INT16 OPM_GlobalAlignment; export INT16 OPM_Alignment; export UINT32 OPM_GlobalOptions, OPM_Options; -export INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize; +export INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; export INT64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; @@ -338,7 +338,7 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWLn(); OPM_LogWStr((CHAR*)" -O2 Original Oberon / Oberon-2: 8 bit SHORTINT, 16 bit INTEGER, 32 bit LONGINT and SET.", 95); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -OC Component Pascal: 16 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET.", 95); + OPM_LogWStr((CHAR*)" -OC Component Pascal: 16 bit SHORTINT, 32 bit INTEGER and SET, 64 bit LONGINT.", 95); OPM_LogWLn(); OPM_LogWStr((CHAR*)" -OV Alternate large model: 8 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET.", 95); OPM_LogWLn(); @@ -410,21 +410,25 @@ void OPM_InitOptions (void) OPM_ShortintSize = 1; OPM_IntegerSize = 2; OPM_LongintSize = 4; + OPM_SetSize = 4; break; case 'C': OPM_ShortintSize = 2; OPM_IntegerSize = 4; OPM_LongintSize = 8; + OPM_SetSize = 4; break; case 'V': OPM_ShortintSize = 1; OPM_IntegerSize = 4; OPM_LongintSize = 8; + OPM_SetSize = 8; break; default: OPM_ShortintSize = 1; OPM_IntegerSize = 2; OPM_LongintSize = 4; + OPM_SetSize = 4; break; } __MOVE(OPM_InstallDir, OPM_ResourceDir, 1024); diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index a046228e..8b0c7133 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPM__h #define OPM__h @@ -9,7 +9,7 @@ import CHAR OPM_Model[10]; import INT16 OPM_AddressSize, OPM_Alignment; import UINT32 OPM_GlobalOptions, OPM_Options; -import INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize; +import INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; import INT64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index 79620fe3..5726dee1 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index 50bb8039..a389b3d9 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index 67f0d84a..4dd60bee 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index edbf5767..009b0baa 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index 861fad9e..cf98d97c 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 578e9629..95bbf8b0 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 8681be7b..14f83a4d 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index 74a49d24..ca2ef73d 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Out.c b/bootstrap/unix-88/Out.c index 7d4c7d72..6f5e342a 100644 --- a/bootstrap/unix-88/Out.c +++ b/bootstrap/unix-88/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Out.h b/bootstrap/unix-88/Out.h index ba654cb8..7507a692 100644 --- a/bootstrap/unix-88/Out.h +++ b/bootstrap/unix-88/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 636554ef..c56505b5 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index efff0062..53e6dedf 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 2b8483b4..c969b821 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index 270f7735..b1b5513e 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index 864f4ace..c0b1581b 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index e3ff12c6..e5750cb0 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index fad539ed..fb6f4a4c 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index 04f1d40e..64bd272c 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/VT100.c b/bootstrap/unix-88/VT100.c index 84ffc7ab..aad9af3b 100644 --- a/bootstrap/unix-88/VT100.c +++ b/bootstrap/unix-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/VT100.h b/bootstrap/unix-88/VT100.h index 3aafef64..a382735c 100644 --- a/bootstrap/unix-88/VT100.h +++ b/bootstrap/unix-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index 082bedeb..9ffffdd9 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index 0bc230e3..403cdeff 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/Compiler.c b/bootstrap/windows-48/Compiler.c index 4f763604..bd643b9a 100644 --- a/bootstrap/windows-48/Compiler.c +++ b/bootstrap/windows-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ #define SHORTINT INT8 #define INTEGER INT16 @@ -89,7 +89,7 @@ static void Compiler_PropagateElementaryTypeSizes (void) OPT_sintobj->typ = OPT_sinttyp; OPT_intobj->typ = OPT_inttyp; OPT_lintobj->typ = OPT_linttyp; - switch (OPM_LongintSize) { + switch (OPM_SetSize) { case 4: OPT_settyp = OPT_set32typ; break; diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index 646b2242..1c746b94 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index 7b9ae370..1747f3ca 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 5edba307..7d838e6c 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -966,7 +966,9 @@ void Files_WriteSet (Files_Rider *R, ADDRESS *R__typ, UINT32 x) { CHAR b[4]; INT32 i; - i = (INT32)x; + UINT64 y; + y = x; + i = __VAL(INT32, y); b[0] = __CHR(i); b[1] = __CHR(__ASHR(i, 8)); b[2] = __CHR(__ASHR(i, 16)); diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index 2ad2f341..b539610b 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index a01553d6..c7957869 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -665,79 +665,77 @@ void Heap_GC (BOOLEAN markStack) Heap_Module m; INT32 i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; INT32 cand[10000]; - if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { - Heap_Lock(); - m = (Heap_Module)(ADDRESS)Heap_modules; - while (m != NIL) { - if (m->enumPtrs != NIL) { - (*m->enumPtrs)(Heap_MarkP); - } - m = m->next; + Heap_Lock(); + m = (Heap_Module)(ADDRESS)Heap_modules; + while (m != NIL) { + if (m->enumPtrs != NIL) { + (*m->enumPtrs)(Heap_MarkP); } - if (markStack) { - i0 = -100; - i1 = -101; - i2 = -102; - i3 = -103; - i4 = -104; - i5 = -105; - i6 = -106; - i7 = -107; - i8 = 1; - i9 = 2; - i10 = 3; - i11 = 4; - i12 = 5; - i13 = 6; - i14 = 7; - i15 = 8; - i16 = 9; - i17 = 10; - i18 = 11; - i19 = 12; - i20 = 13; - i21 = 14; - i22 = 15; - i23 = 16; - for (;;) { - i0 += 1; - i1 += 2; - i2 += 3; - i3 += 4; - i4 += 5; - i5 += 6; - i6 += 7; - i7 += 8; - i8 += 9; - i9 += 10; - i10 += 11; - i11 += 12; - i12 += 13; - i13 += 14; - i14 += 15; - i15 += 16; - i16 += 17; - i17 += 18; - i18 += 19; - i19 += 20; - i20 += 21; - i21 += 22; - i22 += 23; - i23 += 24; - if ((i0 == -99 && i15 == 24)) { - Heap_MarkStack(32, (void*)cand, 10000); - break; - } - } - if (((((((((((((((((((((((i0 + i1) + i2) + i3) + i4) + i5) + i6) + i7) + i8) + i9) + i10) + i11) + i12) + i13) + i14) + i15) + i16) + i17) + i18) + i19) + i20) + i21) + i22) + i23 > 10000) { - return; - } - } - Heap_CheckFin(); - Heap_Scan(); - Heap_Finalize(); - Heap_Unlock(); + m = m->next; } + if (markStack) { + i0 = -100; + i1 = -101; + i2 = -102; + i3 = -103; + i4 = -104; + i5 = -105; + i6 = -106; + i7 = -107; + i8 = 1; + i9 = 2; + i10 = 3; + i11 = 4; + i12 = 5; + i13 = 6; + i14 = 7; + i15 = 8; + i16 = 9; + i17 = 10; + i18 = 11; + i19 = 12; + i20 = 13; + i21 = 14; + i22 = 15; + i23 = 16; + for (;;) { + i0 += 1; + i1 += 2; + i2 += 3; + i3 += 4; + i4 += 5; + i5 += 6; + i6 += 7; + i7 += 8; + i8 += 9; + i9 += 10; + i10 += 11; + i11 += 12; + i12 += 13; + i13 += 14; + i14 += 15; + i15 += 16; + i16 += 17; + i17 += 18; + i18 += 19; + i19 += 20; + i20 += 21; + i21 += 22; + i22 += 23; + i23 += 24; + if ((i0 == -99 && i15 == 24)) { + Heap_MarkStack(32, (void*)cand, 10000); + break; + } + } + if (((((((((((((((((((((((i0 + i1) + i2) + i3) + i4) + i5) + i6) + i7) + i8) + i9) + i10) + i11) + i12) + i13) + i14) + i15) + i16) + i17) + i18) + i19) + i20) + i21) + i22) + i23 > 10000) { + return; + } + } + Heap_CheckFin(); + Heap_Scan(); + Heap_Finalize(); + Heap_Unlock(); } void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index 7eb1fed5..385cd08c 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index 9708137f..c4f50e79 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index c06e7adf..74575f7f 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index d716887b..46fc80da 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index 654ea008..d409cbfd 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index cfc69c4f..dfeb1a84 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index 14b85b47..4086dae5 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 16996b23..9c87c0c5 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -27,7 +27,7 @@ export INT16 OPM_AddressSize; static INT16 OPM_GlobalAlignment; export INT16 OPM_Alignment; export UINT32 OPM_GlobalOptions, OPM_Options; -export INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize; +export INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; export INT64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; @@ -338,7 +338,7 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWLn(); OPM_LogWStr((CHAR*)" -O2 Original Oberon / Oberon-2: 8 bit SHORTINT, 16 bit INTEGER, 32 bit LONGINT and SET.", 95); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -OC Component Pascal: 16 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET.", 95); + OPM_LogWStr((CHAR*)" -OC Component Pascal: 16 bit SHORTINT, 32 bit INTEGER and SET, 64 bit LONGINT.", 95); OPM_LogWLn(); OPM_LogWStr((CHAR*)" -OV Alternate large model: 8 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET.", 95); OPM_LogWLn(); @@ -410,21 +410,25 @@ void OPM_InitOptions (void) OPM_ShortintSize = 1; OPM_IntegerSize = 2; OPM_LongintSize = 4; + OPM_SetSize = 4; break; case 'C': OPM_ShortintSize = 2; OPM_IntegerSize = 4; OPM_LongintSize = 8; + OPM_SetSize = 4; break; case 'V': OPM_ShortintSize = 1; OPM_IntegerSize = 4; OPM_LongintSize = 8; + OPM_SetSize = 8; break; default: OPM_ShortintSize = 1; OPM_IntegerSize = 2; OPM_LongintSize = 4; + OPM_SetSize = 4; break; } __MOVE(OPM_InstallDir, OPM_ResourceDir, 1024); diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index a046228e..8b0c7133 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPM__h #define OPM__h @@ -9,7 +9,7 @@ import CHAR OPM_Model[10]; import INT16 OPM_AddressSize, OPM_Alignment; import UINT32 OPM_GlobalOptions, OPM_Options; -import INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize; +import INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; import INT64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index df77049f..4226dd8b 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index 50bb8039..a389b3d9 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index 67f0d84a..4dd60bee 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index edbf5767..009b0baa 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index cf3ae87d..50f3065b 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index 578e9629..95bbf8b0 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index 789619eb..3e6f92d5 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index 74a49d24..ca2ef73d 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Out.c b/bootstrap/windows-48/Out.c index 7fa3733e..c0b2adae 100644 --- a/bootstrap/windows-48/Out.c +++ b/bootstrap/windows-48/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Out.h b/bootstrap/windows-48/Out.h index ba654cb8..7507a692 100644 --- a/bootstrap/windows-48/Out.h +++ b/bootstrap/windows-48/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index f5c9fa99..bc0d563b 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index c9296c98..49c44602 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 2b8483b4..c969b821 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index 270f7735..b1b5513e 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index 864f4ace..c0b1581b 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index e3ff12c6..e5750cb0 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index 628d68a4..fcd01a50 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index 02f20def..443cb429 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/VT100.c b/bootstrap/windows-48/VT100.c index 84ffc7ab..aad9af3b 100644 --- a/bootstrap/windows-48/VT100.c +++ b/bootstrap/windows-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/VT100.h b/bootstrap/windows-48/VT100.h index 3aafef64..a382735c 100644 --- a/bootstrap/windows-48/VT100.h +++ b/bootstrap/windows-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index 082bedeb..9ffffdd9 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index 0bc230e3..403cdeff 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/Compiler.c b/bootstrap/windows-88/Compiler.c index 4f763604..bd643b9a 100644 --- a/bootstrap/windows-88/Compiler.c +++ b/bootstrap/windows-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ #define SHORTINT INT8 #define INTEGER INT16 @@ -89,7 +89,7 @@ static void Compiler_PropagateElementaryTypeSizes (void) OPT_sintobj->typ = OPT_sinttyp; OPT_intobj->typ = OPT_inttyp; OPT_lintobj->typ = OPT_linttyp; - switch (OPM_LongintSize) { + switch (OPM_SetSize) { case 4: OPT_settyp = OPT_set32typ; break; diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index 646b2242..1c746b94 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index 7b9ae370..1747f3ca 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 32a88308..180b7cae 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -968,7 +968,9 @@ void Files_WriteSet (Files_Rider *R, ADDRESS *R__typ, UINT32 x) { CHAR b[4]; INT32 i; - i = (INT32)x; + UINT64 y; + y = x; + i = __VAL(INT32, y); b[0] = __CHR(i); b[1] = __CHR(__ASHR(i, 8)); b[2] = __CHR(__ASHR(i, 16)); diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 3e47427c..70e6cb03 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index 6ab94025..5b01f160 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -665,79 +665,77 @@ void Heap_GC (BOOLEAN markStack) Heap_Module m; INT64 i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; INT64 cand[10000]; - if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { - Heap_Lock(); - m = (Heap_Module)(ADDRESS)Heap_modules; - while (m != NIL) { - if (m->enumPtrs != NIL) { - (*m->enumPtrs)(Heap_MarkP); - } - m = m->next; + Heap_Lock(); + m = (Heap_Module)(ADDRESS)Heap_modules; + while (m != NIL) { + if (m->enumPtrs != NIL) { + (*m->enumPtrs)(Heap_MarkP); } - if (markStack) { - i0 = -100; - i1 = -101; - i2 = -102; - i3 = -103; - i4 = -104; - i5 = -105; - i6 = -106; - i7 = -107; - i8 = 1; - i9 = 2; - i10 = 3; - i11 = 4; - i12 = 5; - i13 = 6; - i14 = 7; - i15 = 8; - i16 = 9; - i17 = 10; - i18 = 11; - i19 = 12; - i20 = 13; - i21 = 14; - i22 = 15; - i23 = 16; - for (;;) { - i0 += 1; - i1 += 2; - i2 += 3; - i3 += 4; - i4 += 5; - i5 += 6; - i6 += 7; - i7 += 8; - i8 += 9; - i9 += 10; - i10 += 11; - i11 += 12; - i12 += 13; - i13 += 14; - i14 += 15; - i15 += 16; - i16 += 17; - i17 += 18; - i18 += 19; - i19 += 20; - i20 += 21; - i21 += 22; - i22 += 23; - i23 += 24; - if ((i0 == -99 && i15 == 24)) { - Heap_MarkStack(32, (void*)cand, 10000); - break; - } - } - if (((((((((((((((((((((((i0 + i1) + i2) + i3) + i4) + i5) + i6) + i7) + i8) + i9) + i10) + i11) + i12) + i13) + i14) + i15) + i16) + i17) + i18) + i19) + i20) + i21) + i22) + i23 > 10000) { - return; - } - } - Heap_CheckFin(); - Heap_Scan(); - Heap_Finalize(); - Heap_Unlock(); + m = m->next; } + if (markStack) { + i0 = -100; + i1 = -101; + i2 = -102; + i3 = -103; + i4 = -104; + i5 = -105; + i6 = -106; + i7 = -107; + i8 = 1; + i9 = 2; + i10 = 3; + i11 = 4; + i12 = 5; + i13 = 6; + i14 = 7; + i15 = 8; + i16 = 9; + i17 = 10; + i18 = 11; + i19 = 12; + i20 = 13; + i21 = 14; + i22 = 15; + i23 = 16; + for (;;) { + i0 += 1; + i1 += 2; + i2 += 3; + i3 += 4; + i4 += 5; + i5 += 6; + i6 += 7; + i7 += 8; + i8 += 9; + i9 += 10; + i10 += 11; + i11 += 12; + i12 += 13; + i13 += 14; + i14 += 15; + i15 += 16; + i16 += 17; + i17 += 18; + i18 += 19; + i19 += 20; + i20 += 21; + i21 += 22; + i22 += 23; + i23 += 24; + if ((i0 == -99 && i15 == 24)) { + Heap_MarkStack(32, (void*)cand, 10000); + break; + } + } + if (((((((((((((((((((((((i0 + i1) + i2) + i3) + i4) + i5) + i6) + i7) + i8) + i9) + i10) + i11) + i12) + i13) + i14) + i15) + i16) + i17) + i18) + i19) + i20) + i21) + i22) + i23 > 10000) { + return; + } + } + Heap_CheckFin(); + Heap_Scan(); + Heap_Finalize(); + Heap_Unlock(); } void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index 16458b6a..82b83e8c 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index ccefe599..8daa2dfd 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index ee462907..2d245d3b 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index d716887b..46fc80da 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index 654ea008..d409cbfd 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index cfc69c4f..dfeb1a84 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index 14b85b47..4086dae5 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 59ad4e17..716c199c 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -27,7 +27,7 @@ export INT16 OPM_AddressSize; static INT16 OPM_GlobalAlignment; export INT16 OPM_Alignment; export UINT32 OPM_GlobalOptions, OPM_Options; -export INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize; +export INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; export INT64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; @@ -338,7 +338,7 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWLn(); OPM_LogWStr((CHAR*)" -O2 Original Oberon / Oberon-2: 8 bit SHORTINT, 16 bit INTEGER, 32 bit LONGINT and SET.", 95); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -OC Component Pascal: 16 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET.", 95); + OPM_LogWStr((CHAR*)" -OC Component Pascal: 16 bit SHORTINT, 32 bit INTEGER and SET, 64 bit LONGINT.", 95); OPM_LogWLn(); OPM_LogWStr((CHAR*)" -OV Alternate large model: 8 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET.", 95); OPM_LogWLn(); @@ -410,21 +410,25 @@ void OPM_InitOptions (void) OPM_ShortintSize = 1; OPM_IntegerSize = 2; OPM_LongintSize = 4; + OPM_SetSize = 4; break; case 'C': OPM_ShortintSize = 2; OPM_IntegerSize = 4; OPM_LongintSize = 8; + OPM_SetSize = 4; break; case 'V': OPM_ShortintSize = 1; OPM_IntegerSize = 4; OPM_LongintSize = 8; + OPM_SetSize = 8; break; default: OPM_ShortintSize = 1; OPM_IntegerSize = 2; OPM_LongintSize = 4; + OPM_SetSize = 4; break; } __MOVE(OPM_InstallDir, OPM_ResourceDir, 1024); diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index a046228e..8b0c7133 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPM__h #define OPM__h @@ -9,7 +9,7 @@ import CHAR OPM_Model[10]; import INT16 OPM_AddressSize, OPM_Alignment; import UINT32 OPM_GlobalOptions, OPM_Options; -import INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize; +import INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; import INT64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index 79620fe3..5726dee1 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index 50bb8039..a389b3d9 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index 67f0d84a..4dd60bee 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index edbf5767..009b0baa 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index 861fad9e..cf98d97c 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 578e9629..95bbf8b0 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 8681be7b..14f83a4d 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index 74a49d24..ca2ef73d 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Out.c b/bootstrap/windows-88/Out.c index 7fa3733e..c0b2adae 100644 --- a/bootstrap/windows-88/Out.c +++ b/bootstrap/windows-88/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Out.h b/bootstrap/windows-88/Out.h index ba654cb8..7507a692 100644 --- a/bootstrap/windows-88/Out.h +++ b/bootstrap/windows-88/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 23cdc990..27c077b9 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index 75f561f0..1dc659c2 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 2b8483b4..c969b821 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index 270f7735..b1b5513e 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index 864f4ace..c0b1581b 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index e3ff12c6..e5750cb0 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index fad539ed..fb6f4a4c 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index 04f1d40e..64bd272c 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/VT100.c b/bootstrap/windows-88/VT100.c index 84ffc7ab..aad9af3b 100644 --- a/bootstrap/windows-88/VT100.c +++ b/bootstrap/windows-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/VT100.h b/bootstrap/windows-88/VT100.h index 3aafef64..a382735c 100644 --- a/bootstrap/windows-88/VT100.h +++ b/bootstrap/windows-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index 082bedeb..9ffffdd9 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index 0bc230e3..403cdeff 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef extTools__h #define extTools__h From 9e3995d0ee5266d99b8c50d1077f34cee2e9380b Mon Sep 17 00:00:00 2001 From: Norayr Chilingarian Date: Thu, 26 May 2022 01:29:02 +0400 Subject: [PATCH 528/580] added Reset() function to VT100 module. --- src/runtime/VT100.Mod | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/runtime/VT100.Mod b/src/runtime/VT100.Mod index 03cc1d2c..6687ed02 100644 --- a/src/runtime/VT100.Mod +++ b/src/runtime/VT100.Mod @@ -168,8 +168,15 @@ CONST END EscSeq2; - - + PROCEDURE Reset*; + VAR + cmd : ARRAY 6 OF CHAR; + BEGIN + COPY(Escape, cmd); + Strings.Append("c", cmd); + Out.String(cmd); + Out.Ln; + END Reset; (* Cursor up moves cursor n cells in the given direction. if the cursor is already at the edge of the screen, this has no effect *) From 7ca08f1ef100a8fb7f561111606c2e7932b2c4b8 Mon Sep 17 00:00:00 2001 From: Faraz Vahedi Date: Mon, 4 Jul 2022 16:31:45 +0000 Subject: [PATCH 529/580] Remove an unused import --- src/runtime/Texts.Mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runtime/Texts.Mod b/src/runtime/Texts.Mod index 5b645fc4..aba83032 100644 --- a/src/runtime/Texts.Mod +++ b/src/runtime/Texts.Mod @@ -1,6 +1,6 @@ MODULE Texts; (** CAS/HM 23.9.93 -- interface based on Texts by JG/NW 6.12.91**) (* << RC, MB, JT *) IMPORT - Files, Modules, Reals, SYSTEM, Out; + Files, Modules, Reals, SYSTEM; (*--- insert field e: Elem into Texts.Scanner and change Texts.Scan to set it in case of class=6 *) From bd35c73c1f45decf2b5fc85b8539e03251e5d67c Mon Sep 17 00:00:00 2001 From: Norayr Chilingarian Date: Wed, 26 Apr 2023 04:01:15 +0400 Subject: [PATCH 530/580] more changes for tcc --- ReadMe.md | 4 ++-- makefile | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ReadMe.md b/ReadMe.md index 55ccd3d9..575afbb0 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -6,7 +6,7 @@ implementation of the Oberon-2 language and libraries for use on conventional operating systems such as Linux, BSD, Android, Mac and Windows. -Vishap's Oberon Compiler (voc) uses a C backend (gcc, clang or msc) to compile +Vishap's Oberon Compiler (voc) uses a C backend (gcc, clang, tcc or msc) to compile Oberon programs under Unix, Mac or Windows. Vishap Oberon includes libraries from the Ulm, oo2c and Ofront Oberon compilers, as well as default libraries complying with the Oakwood Guidelines for Oberon-2 compilers. @@ -181,7 +181,7 @@ Most of the runtime in libVishapOberon is distributed under GPLv3 with runtime e Vishap Oberon supports 32 and 64 bit little-endian architectures including Intel x86 and x64, arm and ppc. -It compiles under gcc, clang and Microsoft Visual C. +It compiles under gcc, clang, tcc and Microsoft Visual C. Installation supports GNU/Linux, MAC OSX, BSD and Windows (native and cygwin). diff --git a/makefile b/makefile index 8186e175..2a8dc400 100644 --- a/makefile +++ b/makefile @@ -19,6 +19,7 @@ # # clang # gcc +# tcc # i686-w64-mingw32-gcc (32 bit cygwin only) # x86_64-w64-mingw32-gcc (64 bit cygwin only) # From b8d08c007a6d5e8f64d19368914ae238fd833e37 Mon Sep 17 00:00:00 2001 From: Norayr Chilingarian Date: Thu, 5 Oct 2023 16:54:37 +0400 Subject: [PATCH 531/580] additional opts should be on the left of other CFLAGS, this fixes linking to third party libraries issue on some operating systems including Ubuntu and Debian, probably older gcc 11 is to blame. Did not notice this problem on Gentoo, at least with gcc 13. --- src/compiler/extTools.Mod | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/compiler/extTools.Mod b/src/compiler/extTools.Mod index 0c7acded..18890f79 100644 --- a/src/compiler/extTools.Mod +++ b/src/compiler/extTools.Mod @@ -44,12 +44,13 @@ BEGIN END execute; -PROCEDURE InitialiseCompilerCommand(VAR s: ARRAY OF CHAR); +PROCEDURE InitialiseCompilerCommand(VAR s: ARRAY OF CHAR; additionalopts: ARRAY OF CHAR); BEGIN COPY(Configuration.compile, s); Strings.Append(' -I "', s); Strings.Append(OPM.ResourceDir, s); Strings.Append('/include" ', s); + Strings.Append(additionalopts, s); Platform.GetEnv("CFLAGS", CFLAGS); Strings.Append (CFLAGS, s); Strings.Append (" ", s); @@ -60,7 +61,7 @@ PROCEDURE Assemble*(moduleName: ARRAY OF CHAR); VAR cmd: CommandString; BEGIN - InitialiseCompilerCommand(cmd); + InitialiseCompilerCommand(cmd, ""); Strings.Append("-c ", cmd); Strings.Append(moduleName, cmd); Strings.Append(".c", cmd); @@ -72,10 +73,9 @@ PROCEDURE LinkMain*(VAR moduleName: ARRAY OF CHAR; statically: BOOLEAN; addition VAR cmd: CommandString; BEGIN - InitialiseCompilerCommand(cmd); + InitialiseCompilerCommand(cmd, additionalopts); Strings.Append(moduleName, cmd); Strings.Append(".c ", cmd); - Strings.Append(additionalopts, cmd); IF statically THEN IF Configuration.os = "darwin" THEN Strings.Append(OPM.InstallDir, cmd); From c4213e333ac7bb5e3a93c687a3aa12450e3e8999 Mon Sep 17 00:00:00 2001 From: Norayr Chilingarian Date: Thu, 5 Oct 2023 17:00:23 +0400 Subject: [PATCH 532/580] small fix to build options, whitespace is necessary. --- src/compiler/extTools.Mod | 1 + 1 file changed, 1 insertion(+) diff --git a/src/compiler/extTools.Mod b/src/compiler/extTools.Mod index 18890f79..c51d8c4d 100644 --- a/src/compiler/extTools.Mod +++ b/src/compiler/extTools.Mod @@ -51,6 +51,7 @@ BEGIN Strings.Append(OPM.ResourceDir, s); Strings.Append('/include" ', s); Strings.Append(additionalopts, s); + Strings.Append(" ", s); Platform.GetEnv("CFLAGS", CFLAGS); Strings.Append (CFLAGS, s); Strings.Append (" ", s); From ff429202264de6825df1df2fa2f365a6e519b684 Mon Sep 17 00:00:00 2001 From: Norayr Chilingarian Date: Thu, 5 Oct 2023 17:03:30 +0400 Subject: [PATCH 533/580] =?UTF-8?q?gcc:=20warning:=20switch=20=E2=80=98-gs?= =?UTF-8?q?tabs=E2=80=99=20is=20no=20longer=20supported=20-=20removed=20it?= =?UTF-8?q?.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/test/confidence/testenv.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/confidence/testenv.sh b/src/test/confidence/testenv.sh index fdb13cc2..e0a157ee 100755 --- a/src/test/confidence/testenv.sh +++ b/src/test/confidence/testenv.sh @@ -17,5 +17,5 @@ rm -f *.o *.obj *.exe *.sym *.c *.h result new.asm $(basename "$PWD") # NOTE: The cygwin 64 bit build has relocation errors with # these assembly generation options. if [ "$COMPILER" = "gcc" -a "$FLAVOUR" != "cygwin.LP64.gcc" ] -then export CFLAGS="-gstabs -g1 -Wa,-acdhln=new.asm -Wl,-Map=output.map" +then export CFLAGS="-g1 -Wa,-acdhln=new.asm -Wl,-Map=output.map" fi From 5a93546143f5aae4e56bde271144ca78228db387 Mon Sep 17 00:00:00 2001 From: Norayr Chilingarian Date: Wed, 13 Dec 2023 15:56:49 +0400 Subject: [PATCH 534/580] insignificant readme and makefile changes. --- ReadMe.md | 10 ++++++---- makefile | 2 ++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/ReadMe.md b/ReadMe.md index 575afbb0..933b0681 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -31,9 +31,11 @@ It is easy to install the Oberon compiler and libraries with the following simple steps: 1. Install pre-requisites such as git, gcc, static C libraries, diff utils. - 2. Clone the repository and run 'make full'. - 3. Optionally install to a system directory such as /opt or /usr/local/share with 'make install'. - 4. Set your PATH variable to include the compiler binary. + 2. Clone the repository: `git clone https://github.com/vishaps/voc`. + 3. Optionally `export CC=clang` or `export CC=tcc`. + 4. run `make full`. + 5. Optionally install to a system directory such as /opt or /usr/local/share with `make install` (might be with sudo). + 6. Set your PATH variable to include the compiler binary. These are detailed below: @@ -179,7 +181,7 @@ Most of the runtime in libVishapOberon is distributed under GPLv3 with runtime e ## Platform support and porting -Vishap Oberon supports 32 and 64 bit little-endian architectures including Intel x86 and x64, arm and ppc. +Vishap Oberon supports 32 and 64 bit little-endian architectures including Intel x86 and x86_64, 32 bit arm and aarch64. It compiles under gcc, clang, tcc and Microsoft Visual C. diff --git a/makefile b/makefile index 2a8dc400..5c0ee241 100644 --- a/makefile +++ b/makefile @@ -82,6 +82,8 @@ usage: @echo " make compiler - Build the compiler but not the library" @echo " make browsercmd - Build the symbol browser (showdef)" @echo " make library - Build all library files and make library" + @echo " make O2library - Build all library files with Oberon-2 type sizes" + @echo " make OClibrary - Build all library files with Component Pascal type sizes" @echo " make install - Install built compiler and library in /opt or C:\\PROGRAM FILES*" @echo " (Needs root access)" @echo "" From dfaf2d3622b57f155c70b9e668a0f09a0dd75d97 Mon Sep 17 00:00:00 2001 From: Norayr Chilingarian Date: Sun, 14 Jan 2024 17:15:40 +0400 Subject: [PATCH 535/580] example on how to read commandline arguments with Texts. --- src/test/texts/argTexts.Mod | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 src/test/texts/argTexts.Mod diff --git a/src/test/texts/argTexts.Mod b/src/test/texts/argTexts.Mod new file mode 100644 index 00000000..644813d0 --- /dev/null +++ b/src/test/texts/argTexts.Mod @@ -0,0 +1,24 @@ +MODULE argTexts; (* example how to get arguments by using Texts module *) +IMPORT Texts, Oberon; + +VAR + S: Texts.Scanner; (* we'll read program arguments with it *) + + W : Texts.Writer; (* to write to console *) + T : Texts.Text; + +BEGIN + Texts.OpenScanner(S, Oberon.Par.text, Oberon.Par.pos); + Texts.Scan(S); + (*Out.String(S.s); Out.Ln;*) + +Texts.OpenWriter (W); + +Texts.WriteString(W, "aaa"); +Texts.WriteLn(W); +Texts.WriteString(W, S.s); +Texts.WriteLn(W); +Texts.Append(Oberon.Log, W.buf); + + +END argTexts. From 75c155f8ecfb912e43be816a946928aae6847953 Mon Sep 17 00:00:00 2001 From: Norayr Chilingarian Date: Fri, 26 Jan 2024 02:20:24 +0400 Subject: [PATCH 536/580] md5 sum calculation example. --- src/test/md5/hello.txt | 1 + src/test/md5/md5test.Mod | 50 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 src/test/md5/hello.txt create mode 100644 src/test/md5/md5test.Mod diff --git a/src/test/md5/hello.txt b/src/test/md5/hello.txt new file mode 100644 index 00000000..980a0d5f --- /dev/null +++ b/src/test/md5/hello.txt @@ -0,0 +1 @@ +Hello World! diff --git a/src/test/md5/md5test.Mod b/src/test/md5/md5test.Mod new file mode 100644 index 00000000..d697d955 --- /dev/null +++ b/src/test/md5/md5test.Mod @@ -0,0 +1,50 @@ +MODULE md5test; + IMPORT MD5 := ethMD5, Out, Files, Strings; +PROCEDURE dump(VAR arr: ARRAY OF CHAR); +VAR + i: INTEGER; + ch: CHAR; +BEGIN + i := 0; + REPEAT + Out.String("arr["); Out.Int(i, 0); Out.String("]="); Out.Int(ORD(arr[i]), 0);Out.Ln; + INC(i) + UNTIL i = Strings.Length(arr)+2 +END dump; + +PROCEDURE main; + VAR + context: MD5.Context; + digest: MD5.Digest; + hexDigest: ARRAY 33 OF CHAR; + F: Files.File; + R: Files.Rider; + input: ARRAY 512 OF CHAR; + ch: CHAR; + i: INTEGER; +BEGIN + F := Files.Old("hello.txt"); + IF F # NIL THEN + Files.Set(R, F, 0); + i := 0; + REPEAT + Files.Read(R, ch); + input[i] := ch; + INC(i) + UNTIL R.eof; + dump(input); + END; + + context := MD5.New(); (* Initialize MD5 context *) + + MD5.WriteBytes(context, input, Strings.Length(input)); (* Process input string *) + MD5.Close(context, digest); (* Finalize and get digest *) + + MD5.ToString(digest, hexDigest); (* Convert digest to hex string *) + Out.String("MD5 Hash: "); Out.String(hexDigest); Out.Ln; +END main; + +BEGIN + main; +END md5test. + From e376e59f581b586a46b560148fcd877eff943843 Mon Sep 17 00:00:00 2001 From: Norayr Chilingarian Date: Wed, 21 Feb 2024 03:30:49 +0400 Subject: [PATCH 537/580] md5sum test will now work with binary files as well. --- src/test/md5/md5test.Mod | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/test/md5/md5test.Mod b/src/test/md5/md5test.Mod index d697d955..91885c0e 100644 --- a/src/test/md5/md5test.Mod +++ b/src/test/md5/md5test.Mod @@ -19,25 +19,30 @@ PROCEDURE main; hexDigest: ARRAY 33 OF CHAR; F: Files.File; R: Files.Rider; - input: ARRAY 512 OF CHAR; + input: POINTER TO ARRAY OF CHAR; + ilen: LONGINT; ch: CHAR; i: INTEGER; BEGIN - F := Files.Old("hello.txt"); + F := Files.Old("SETs.pdf"); IF F # NIL THEN Files.Set(R, F, 0); + ilen := Files.Length(F); + Out.String("file length is "); Out.Int(ilen, 0); Out.Ln; + NEW(input, ilen+1); i := 0; REPEAT Files.Read(R, ch); - input[i] := ch; + input^[i] := ch; INC(i) UNTIL R.eof; - dump(input); + (*dump(input^);*) END; context := MD5.New(); (* Initialize MD5 context *) - MD5.WriteBytes(context, input, Strings.Length(input)); (* Process input string *) + (*MD5.WriteBytes(context, input^, Strings.Length(input^));*) (* Process input string *) + MD5.WriteBytes(context, input^, LEN(input^)-1); (* Process input string *) MD5.Close(context, digest); (* Finalize and get digest *) MD5.ToString(digest, hexDigest); (* Convert digest to hex string *) From 85dff7734d3a4581f8e61c0d9e38cc8c51f40366 Mon Sep 17 00:00:00 2001 From: Norayr Chilingarian Date: Thu, 14 Mar 2024 18:01:26 +0400 Subject: [PATCH 538/580] wrapper function for compatibility with project oberon 13 sources. --- bootstrap/unix-44/Compiler.c | 2 +- bootstrap/unix-44/Configuration.c | 4 ++-- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Files.c | 8 +++++++- bootstrap/unix-44/Files.h | 3 ++- bootstrap/unix-44/Heap.c | 2 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 2 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 2 +- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 2 +- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 2 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Out.c | 2 +- bootstrap/unix-44/Out.h | 2 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 4 +--- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/VT100.c | 13 ++++++++++++- bootstrap/unix-44/VT100.h | 3 ++- bootstrap/unix-44/extTools.c | 15 +++++++++------ bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-48/Compiler.c | 2 +- bootstrap/unix-48/Configuration.c | 4 ++-- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Files.c | 8 +++++++- bootstrap/unix-48/Files.h | 3 ++- bootstrap/unix-48/Heap.c | 2 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 2 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 2 +- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 2 +- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 2 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Out.c | 2 +- bootstrap/unix-48/Out.h | 2 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 4 +--- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/VT100.c | 13 ++++++++++++- bootstrap/unix-48/VT100.h | 3 ++- bootstrap/unix-48/extTools.c | 15 +++++++++------ bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-88/Compiler.c | 2 +- bootstrap/unix-88/Configuration.c | 4 ++-- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Files.c | 8 +++++++- bootstrap/unix-88/Files.h | 3 ++- bootstrap/unix-88/Heap.c | 2 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 2 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 2 +- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 2 +- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 2 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Out.c | 2 +- bootstrap/unix-88/Out.h | 2 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 4 +--- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/VT100.c | 13 ++++++++++++- bootstrap/unix-88/VT100.h | 3 ++- bootstrap/unix-88/extTools.c | 15 +++++++++------ bootstrap/unix-88/extTools.h | 2 +- bootstrap/windows-48/Compiler.c | 2 +- bootstrap/windows-48/Configuration.c | 4 ++-- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Files.c | 8 +++++++- bootstrap/windows-48/Files.h | 3 ++- bootstrap/windows-48/Heap.c | 2 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 2 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 2 +- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 2 +- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 2 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Out.c | 2 +- bootstrap/windows-48/Out.h | 2 +- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 4 +--- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/VT100.c | 13 ++++++++++++- bootstrap/windows-48/VT100.h | 3 ++- bootstrap/windows-48/extTools.c | 15 +++++++++------ bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-88/Compiler.c | 2 +- bootstrap/windows-88/Configuration.c | 4 ++-- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Files.c | 8 +++++++- bootstrap/windows-88/Files.h | 3 ++- bootstrap/windows-88/Heap.c | 2 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 2 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 2 +- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 2 +- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 2 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Out.c | 2 +- bootstrap/windows-88/Out.h | 2 +- bootstrap/windows-88/Platform.c | 2 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 4 +--- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/VT100.c | 13 ++++++++++++- bootstrap/windows-88/VT100.h | 3 ++- bootstrap/windows-88/extTools.c | 15 +++++++++------ bootstrap/windows-88/extTools.h | 2 +- src/runtime/Files.Mod | 8 +++++++- 186 files changed, 332 insertions(+), 226 deletions(-) diff --git a/bootstrap/unix-44/Compiler.c b/bootstrap/unix-44/Compiler.c index bd643b9a..cfdeda93 100644 --- a/bootstrap/unix-44/Compiler.c +++ b/bootstrap/unix-44/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index 1c746b94..b57b2c02 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index 1747f3ca..ec6aa1fc 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 821546e2..036e1a9c 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -86,6 +86,7 @@ export INT32 Files_Pos (Files_Rider *r, ADDRESS *r__typ); export void Files_Purge (Files_File f); export void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x); export void Files_ReadBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN *x); +export void Files_ReadByte (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x); export void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS x__len, INT32 n); export void Files_ReadInt (Files_Rider *R, ADDRESS *R__typ, INT16 *x); export void Files_ReadLInt (Files_Rider *R, ADDRESS *R__typ, INT32 *x); @@ -634,6 +635,11 @@ void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x) } } +void Files_ReadByte (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x) +{ + Files_Read(&*r, r__typ, &*x); +} + void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS x__len, INT32 n) { INT32 xpos, min, restInBuf, offset; diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index 8ba31015..9a2e9eb3 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Files__h #define Files__h @@ -40,6 +40,7 @@ import INT32 Files_Pos (Files_Rider *r, ADDRESS *r__typ); import void Files_Purge (Files_File f); import void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x); import void Files_ReadBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN *x); +import void Files_ReadByte (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x); import void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS x__len, INT32 n); import void Files_ReadInt (Files_Rider *R, ADDRESS *R__typ, INT16 *x); import void Files_ReadLInt (Files_Rider *R, ADDRESS *R__typ, INT32 *x); diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index c7957869..e39f5219 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index 385cd08c..82af4503 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index f1df9980..3dfe0c57 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index 74575f7f..0170d1e1 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index 46fc80da..c44c18d2 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index d409cbfd..c6549fbd 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index dfeb1a84..d87c06e3 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index 4086dae5..b200194e 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 9c87c0c5..2d1f5b46 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index 8b0c7133..02653db0 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index 4226dd8b..6a4c0e65 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index a389b3d9..a42e2381 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index 4dd60bee..2e62a8d6 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index 009b0baa..ae65ff71 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index 9284c006..81129027 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index 95bbf8b0..3463d4bd 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index 3e6f92d5..504b7c3c 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index ca2ef73d..23df5968 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Out.c b/bootstrap/unix-44/Out.c index 6f5e342a..80c4f532 100644 --- a/bootstrap/unix-44/Out.c +++ b/bootstrap/unix-44/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Out.h b/bootstrap/unix-44/Out.h index 7507a692..2b10d766 100644 --- a/bootstrap/unix-44/Out.h +++ b/bootstrap/unix-44/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index db6a8378..e3fe3c3d 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index 7ef51226..e83a7ba7 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index c969b821..ca2a3bf6 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index b1b5513e..9584ffc9 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index c0b1581b..1039098d 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index e5750cb0..4e11cddd 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index c2e600fa..293287b0 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -8,7 +8,6 @@ #include "SYSTEM.h" #include "Files.h" #include "Modules.h" -#include "Out.h" #include "Reals.h" typedef @@ -1810,7 +1809,6 @@ export void *Texts__init(void) __DEFMOD; __MODULE_IMPORT(Files); __MODULE_IMPORT(Modules); - __MODULE_IMPORT(Out); __MODULE_IMPORT(Reals); __REGMOD("Texts", EnumPtrs); __INITYP(Texts_FontDesc, Texts_FontDesc, 0); diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index ea14161b..436f475a 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/VT100.c b/bootstrap/unix-44/VT100.c index aad9af3b..2fb16a73 100644 --- a/bootstrap/unix-44/VT100.c +++ b/bootstrap/unix-44/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -34,6 +34,7 @@ static void VT100_EscSeqSwapped (INT16 n, CHAR *letter, ADDRESS letter__len); export void VT100_HVP (INT16 n, INT16 m); export void VT100_IntToStr (INT32 int_, CHAR *str, ADDRESS str__len); export void VT100_RCP (void); +export void VT100_Reset (void); static void VT100_Reverse0 (CHAR *str, ADDRESS str__len, INT16 start, INT16 end); export void VT100_SCP (void); export void VT100_SD (INT16 n); @@ -136,6 +137,15 @@ static void VT100_EscSeq2 (INT16 n, INT16 m, CHAR *letter, ADDRESS letter__len) __DEL(letter); } +void VT100_Reset (void) +{ + CHAR cmd[6]; + __COPY("\033", cmd, 6); + Strings_Append((CHAR*)"c", 2, (void*)cmd, 6); + Out_String(cmd, 6); + Out_Ln(); +} + void VT100_CUU (INT16 n) { VT100_EscSeq(n, (CHAR*)"A", 2); @@ -256,6 +266,7 @@ export void *VT100__init(void) __REGCMD("DECTCEMh", VT100_DECTCEMh); __REGCMD("DECTCEMl", VT100_DECTCEMl); __REGCMD("RCP", VT100_RCP); + __REGCMD("Reset", VT100_Reset); __REGCMD("SCP", VT100_SCP); /* BEGIN */ __COPY("\033", VT100_CSI, 5); diff --git a/bootstrap/unix-44/VT100.h b/bootstrap/unix-44/VT100.h index a382735c..b9cd4c06 100644 --- a/bootstrap/unix-44/VT100.h +++ b/bootstrap/unix-44/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef VT100__h #define VT100__h @@ -25,6 +25,7 @@ import void VT100_EL (INT16 n); import void VT100_HVP (INT16 n, INT16 m); import void VT100_IntToStr (INT32 int_, CHAR *str, ADDRESS str__len); import void VT100_RCP (void); +import void VT100_Reset (void); import void VT100_SCP (void); import void VT100_SD (INT16 n); import void VT100_SGR (INT16 n); diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index 9ffffdd9..a8dee3f6 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -22,7 +22,7 @@ static extTools_CommandString extTools_CFLAGS; export void extTools_Assemble (CHAR *moduleName, ADDRESS moduleName__len); -static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len); +static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len, CHAR *additionalopts, ADDRESS additionalopts__len); export void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN statically, CHAR *additionalopts, ADDRESS additionalopts__len); static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRESS cmd__len); @@ -70,22 +70,26 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES __DEL(cmd); } -static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) +static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len, CHAR *additionalopts, ADDRESS additionalopts__len) { + __DUP(additionalopts, additionalopts__len, CHAR); __COPY("gcc -fPIC -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); + Strings_Append(additionalopts, additionalopts__len, (void*)s, s__len); + Strings_Append((CHAR*)" ", 2, (void*)s, s__len); Platform_GetEnv((CHAR*)"CFLAGS", 7, (void*)extTools_CFLAGS, 4096); Strings_Append(extTools_CFLAGS, 4096, (void*)s, s__len); Strings_Append((CHAR*)" ", 2, (void*)s, s__len); + __DEL(additionalopts); } void extTools_Assemble (CHAR *moduleName, ADDRESS moduleName__len) { extTools_CommandString cmd; __DUP(moduleName, moduleName__len, CHAR); - extTools_InitialiseCompilerCommand((void*)cmd, 4096); + extTools_InitialiseCompilerCommand((void*)cmd, 4096, (CHAR*)"", 1); Strings_Append((CHAR*)"-c ", 4, (void*)cmd, 4096); Strings_Append(moduleName, moduleName__len, (void*)cmd, 4096); Strings_Append((CHAR*)".c", 3, (void*)cmd, 4096); @@ -97,10 +101,9 @@ void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN stati { extTools_CommandString cmd; __DUP(additionalopts, additionalopts__len, CHAR); - extTools_InitialiseCompilerCommand((void*)cmd, 4096); + extTools_InitialiseCompilerCommand((void*)cmd, 4096, additionalopts, additionalopts__len); Strings_Append(moduleName, moduleName__len, (void*)cmd, 4096); Strings_Append((CHAR*)".c ", 4, (void*)cmd, 4096); - Strings_Append(additionalopts, additionalopts__len, (void*)cmd, 4096); if (statically) { Strings_Append((CHAR*)" -static", 9, (void*)cmd, 4096); } diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index 403cdeff..a6544ef7 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/Compiler.c b/bootstrap/unix-48/Compiler.c index bd643b9a..cfdeda93 100644 --- a/bootstrap/unix-48/Compiler.c +++ b/bootstrap/unix-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index 1c746b94..b57b2c02 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index 1747f3ca..ec6aa1fc 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 821546e2..036e1a9c 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -86,6 +86,7 @@ export INT32 Files_Pos (Files_Rider *r, ADDRESS *r__typ); export void Files_Purge (Files_File f); export void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x); export void Files_ReadBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN *x); +export void Files_ReadByte (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x); export void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS x__len, INT32 n); export void Files_ReadInt (Files_Rider *R, ADDRESS *R__typ, INT16 *x); export void Files_ReadLInt (Files_Rider *R, ADDRESS *R__typ, INT32 *x); @@ -634,6 +635,11 @@ void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x) } } +void Files_ReadByte (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x) +{ + Files_Read(&*r, r__typ, &*x); +} + void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS x__len, INT32 n) { INT32 xpos, min, restInBuf, offset; diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index 8ba31015..9a2e9eb3 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Files__h #define Files__h @@ -40,6 +40,7 @@ import INT32 Files_Pos (Files_Rider *r, ADDRESS *r__typ); import void Files_Purge (Files_File f); import void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x); import void Files_ReadBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN *x); +import void Files_ReadByte (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x); import void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS x__len, INT32 n); import void Files_ReadInt (Files_Rider *R, ADDRESS *R__typ, INT16 *x); import void Files_ReadLInt (Files_Rider *R, ADDRESS *R__typ, INT32 *x); diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index c7957869..e39f5219 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index 385cd08c..82af4503 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index f1df9980..3dfe0c57 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index 74575f7f..0170d1e1 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index 46fc80da..c44c18d2 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index d409cbfd..c6549fbd 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index dfeb1a84..d87c06e3 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index 4086dae5..b200194e 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 9c87c0c5..2d1f5b46 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index 8b0c7133..02653db0 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index 4226dd8b..6a4c0e65 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index a389b3d9..a42e2381 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index 4dd60bee..2e62a8d6 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index 009b0baa..ae65ff71 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 50f3065b..4f18f54c 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index 95bbf8b0..3463d4bd 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index 3e6f92d5..504b7c3c 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index ca2ef73d..23df5968 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Out.c b/bootstrap/unix-48/Out.c index 6f5e342a..80c4f532 100644 --- a/bootstrap/unix-48/Out.c +++ b/bootstrap/unix-48/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Out.h b/bootstrap/unix-48/Out.h index 7507a692..2b10d766 100644 --- a/bootstrap/unix-48/Out.h +++ b/bootstrap/unix-48/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index db6a8378..e3fe3c3d 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index 7ef51226..e83a7ba7 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index c969b821..ca2a3bf6 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index b1b5513e..9584ffc9 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index c0b1581b..1039098d 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index e5750cb0..4e11cddd 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index fcd01a50..36e71a85 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -8,7 +8,6 @@ #include "SYSTEM.h" #include "Files.h" #include "Modules.h" -#include "Out.h" #include "Reals.h" typedef @@ -1810,7 +1809,6 @@ export void *Texts__init(void) __DEFMOD; __MODULE_IMPORT(Files); __MODULE_IMPORT(Modules); - __MODULE_IMPORT(Out); __MODULE_IMPORT(Reals); __REGMOD("Texts", EnumPtrs); __INITYP(Texts_FontDesc, Texts_FontDesc, 0); diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index 443cb429..74423529 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/VT100.c b/bootstrap/unix-48/VT100.c index aad9af3b..2fb16a73 100644 --- a/bootstrap/unix-48/VT100.c +++ b/bootstrap/unix-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -34,6 +34,7 @@ static void VT100_EscSeqSwapped (INT16 n, CHAR *letter, ADDRESS letter__len); export void VT100_HVP (INT16 n, INT16 m); export void VT100_IntToStr (INT32 int_, CHAR *str, ADDRESS str__len); export void VT100_RCP (void); +export void VT100_Reset (void); static void VT100_Reverse0 (CHAR *str, ADDRESS str__len, INT16 start, INT16 end); export void VT100_SCP (void); export void VT100_SD (INT16 n); @@ -136,6 +137,15 @@ static void VT100_EscSeq2 (INT16 n, INT16 m, CHAR *letter, ADDRESS letter__len) __DEL(letter); } +void VT100_Reset (void) +{ + CHAR cmd[6]; + __COPY("\033", cmd, 6); + Strings_Append((CHAR*)"c", 2, (void*)cmd, 6); + Out_String(cmd, 6); + Out_Ln(); +} + void VT100_CUU (INT16 n) { VT100_EscSeq(n, (CHAR*)"A", 2); @@ -256,6 +266,7 @@ export void *VT100__init(void) __REGCMD("DECTCEMh", VT100_DECTCEMh); __REGCMD("DECTCEMl", VT100_DECTCEMl); __REGCMD("RCP", VT100_RCP); + __REGCMD("Reset", VT100_Reset); __REGCMD("SCP", VT100_SCP); /* BEGIN */ __COPY("\033", VT100_CSI, 5); diff --git a/bootstrap/unix-48/VT100.h b/bootstrap/unix-48/VT100.h index a382735c..b9cd4c06 100644 --- a/bootstrap/unix-48/VT100.h +++ b/bootstrap/unix-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef VT100__h #define VT100__h @@ -25,6 +25,7 @@ import void VT100_EL (INT16 n); import void VT100_HVP (INT16 n, INT16 m); import void VT100_IntToStr (INT32 int_, CHAR *str, ADDRESS str__len); import void VT100_RCP (void); +import void VT100_Reset (void); import void VT100_SCP (void); import void VT100_SD (INT16 n); import void VT100_SGR (INT16 n); diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index 9ffffdd9..a8dee3f6 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -22,7 +22,7 @@ static extTools_CommandString extTools_CFLAGS; export void extTools_Assemble (CHAR *moduleName, ADDRESS moduleName__len); -static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len); +static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len, CHAR *additionalopts, ADDRESS additionalopts__len); export void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN statically, CHAR *additionalopts, ADDRESS additionalopts__len); static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRESS cmd__len); @@ -70,22 +70,26 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES __DEL(cmd); } -static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) +static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len, CHAR *additionalopts, ADDRESS additionalopts__len) { + __DUP(additionalopts, additionalopts__len, CHAR); __COPY("gcc -fPIC -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); + Strings_Append(additionalopts, additionalopts__len, (void*)s, s__len); + Strings_Append((CHAR*)" ", 2, (void*)s, s__len); Platform_GetEnv((CHAR*)"CFLAGS", 7, (void*)extTools_CFLAGS, 4096); Strings_Append(extTools_CFLAGS, 4096, (void*)s, s__len); Strings_Append((CHAR*)" ", 2, (void*)s, s__len); + __DEL(additionalopts); } void extTools_Assemble (CHAR *moduleName, ADDRESS moduleName__len) { extTools_CommandString cmd; __DUP(moduleName, moduleName__len, CHAR); - extTools_InitialiseCompilerCommand((void*)cmd, 4096); + extTools_InitialiseCompilerCommand((void*)cmd, 4096, (CHAR*)"", 1); Strings_Append((CHAR*)"-c ", 4, (void*)cmd, 4096); Strings_Append(moduleName, moduleName__len, (void*)cmd, 4096); Strings_Append((CHAR*)".c", 3, (void*)cmd, 4096); @@ -97,10 +101,9 @@ void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN stati { extTools_CommandString cmd; __DUP(additionalopts, additionalopts__len, CHAR); - extTools_InitialiseCompilerCommand((void*)cmd, 4096); + extTools_InitialiseCompilerCommand((void*)cmd, 4096, additionalopts, additionalopts__len); Strings_Append(moduleName, moduleName__len, (void*)cmd, 4096); Strings_Append((CHAR*)".c ", 4, (void*)cmd, 4096); - Strings_Append(additionalopts, additionalopts__len, (void*)cmd, 4096); if (statically) { Strings_Append((CHAR*)" -static", 9, (void*)cmd, 4096); } diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index 403cdeff..a6544ef7 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/Compiler.c b/bootstrap/unix-88/Compiler.c index bd643b9a..cfdeda93 100644 --- a/bootstrap/unix-88/Compiler.c +++ b/bootstrap/unix-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index 1c746b94..b57b2c02 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index 1747f3ca..ec6aa1fc 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 9a887e8f..9adf424f 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -86,6 +86,7 @@ export INT32 Files_Pos (Files_Rider *r, ADDRESS *r__typ); export void Files_Purge (Files_File f); export void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x); export void Files_ReadBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN *x); +export void Files_ReadByte (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x); export void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS x__len, INT32 n); export void Files_ReadInt (Files_Rider *R, ADDRESS *R__typ, INT16 *x); export void Files_ReadLInt (Files_Rider *R, ADDRESS *R__typ, INT32 *x); @@ -634,6 +635,11 @@ void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x) } } +void Files_ReadByte (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x) +{ + Files_Read(&*r, r__typ, &*x); +} + void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS x__len, INT32 n) { INT32 xpos, min, restInBuf, offset; diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 23f65c21..7a91d8e6 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Files__h #define Files__h @@ -41,6 +41,7 @@ import INT32 Files_Pos (Files_Rider *r, ADDRESS *r__typ); import void Files_Purge (Files_File f); import void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x); import void Files_ReadBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN *x); +import void Files_ReadByte (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x); import void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS x__len, INT32 n); import void Files_ReadInt (Files_Rider *R, ADDRESS *R__typ, INT16 *x); import void Files_ReadLInt (Files_Rider *R, ADDRESS *R__typ, INT32 *x); diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index 5b01f160..e2d137e1 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index 82b83e8c..84a699c8 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 5f8012d2..c166b163 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index 2d245d3b..1bc9e78a 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index 46fc80da..c44c18d2 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index d409cbfd..c6549fbd 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index dfeb1a84..d87c06e3 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index 4086dae5..b200194e 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 716c199c..e4f7f87b 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index 8b0c7133..02653db0 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index 5726dee1..cbdc3d68 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index a389b3d9..a42e2381 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index 4dd60bee..2e62a8d6 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index 009b0baa..ae65ff71 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index cf98d97c..e635696d 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 95bbf8b0..3463d4bd 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 14f83a4d..f719c048 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index ca2ef73d..23df5968 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Out.c b/bootstrap/unix-88/Out.c index 6f5e342a..80c4f532 100644 --- a/bootstrap/unix-88/Out.c +++ b/bootstrap/unix-88/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Out.h b/bootstrap/unix-88/Out.h index 7507a692..2b10d766 100644 --- a/bootstrap/unix-88/Out.h +++ b/bootstrap/unix-88/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index c56505b5..fd7c0838 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index 53e6dedf..cb0cb468 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index c969b821..ca2a3bf6 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index b1b5513e..9584ffc9 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index c0b1581b..1039098d 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index e5750cb0..4e11cddd 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index fb6f4a4c..a9561691 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -8,7 +8,6 @@ #include "SYSTEM.h" #include "Files.h" #include "Modules.h" -#include "Out.h" #include "Reals.h" typedef @@ -1810,7 +1809,6 @@ export void *Texts__init(void) __DEFMOD; __MODULE_IMPORT(Files); __MODULE_IMPORT(Modules); - __MODULE_IMPORT(Out); __MODULE_IMPORT(Reals); __REGMOD("Texts", EnumPtrs); __INITYP(Texts_FontDesc, Texts_FontDesc, 0); diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index 64bd272c..1fd381b6 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/VT100.c b/bootstrap/unix-88/VT100.c index aad9af3b..2fb16a73 100644 --- a/bootstrap/unix-88/VT100.c +++ b/bootstrap/unix-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -34,6 +34,7 @@ static void VT100_EscSeqSwapped (INT16 n, CHAR *letter, ADDRESS letter__len); export void VT100_HVP (INT16 n, INT16 m); export void VT100_IntToStr (INT32 int_, CHAR *str, ADDRESS str__len); export void VT100_RCP (void); +export void VT100_Reset (void); static void VT100_Reverse0 (CHAR *str, ADDRESS str__len, INT16 start, INT16 end); export void VT100_SCP (void); export void VT100_SD (INT16 n); @@ -136,6 +137,15 @@ static void VT100_EscSeq2 (INT16 n, INT16 m, CHAR *letter, ADDRESS letter__len) __DEL(letter); } +void VT100_Reset (void) +{ + CHAR cmd[6]; + __COPY("\033", cmd, 6); + Strings_Append((CHAR*)"c", 2, (void*)cmd, 6); + Out_String(cmd, 6); + Out_Ln(); +} + void VT100_CUU (INT16 n) { VT100_EscSeq(n, (CHAR*)"A", 2); @@ -256,6 +266,7 @@ export void *VT100__init(void) __REGCMD("DECTCEMh", VT100_DECTCEMh); __REGCMD("DECTCEMl", VT100_DECTCEMl); __REGCMD("RCP", VT100_RCP); + __REGCMD("Reset", VT100_Reset); __REGCMD("SCP", VT100_SCP); /* BEGIN */ __COPY("\033", VT100_CSI, 5); diff --git a/bootstrap/unix-88/VT100.h b/bootstrap/unix-88/VT100.h index a382735c..b9cd4c06 100644 --- a/bootstrap/unix-88/VT100.h +++ b/bootstrap/unix-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef VT100__h #define VT100__h @@ -25,6 +25,7 @@ import void VT100_EL (INT16 n); import void VT100_HVP (INT16 n, INT16 m); import void VT100_IntToStr (INT32 int_, CHAR *str, ADDRESS str__len); import void VT100_RCP (void); +import void VT100_Reset (void); import void VT100_SCP (void); import void VT100_SD (INT16 n); import void VT100_SGR (INT16 n); diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index 9ffffdd9..a8dee3f6 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -22,7 +22,7 @@ static extTools_CommandString extTools_CFLAGS; export void extTools_Assemble (CHAR *moduleName, ADDRESS moduleName__len); -static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len); +static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len, CHAR *additionalopts, ADDRESS additionalopts__len); export void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN statically, CHAR *additionalopts, ADDRESS additionalopts__len); static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRESS cmd__len); @@ -70,22 +70,26 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES __DEL(cmd); } -static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) +static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len, CHAR *additionalopts, ADDRESS additionalopts__len) { + __DUP(additionalopts, additionalopts__len, CHAR); __COPY("gcc -fPIC -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); + Strings_Append(additionalopts, additionalopts__len, (void*)s, s__len); + Strings_Append((CHAR*)" ", 2, (void*)s, s__len); Platform_GetEnv((CHAR*)"CFLAGS", 7, (void*)extTools_CFLAGS, 4096); Strings_Append(extTools_CFLAGS, 4096, (void*)s, s__len); Strings_Append((CHAR*)" ", 2, (void*)s, s__len); + __DEL(additionalopts); } void extTools_Assemble (CHAR *moduleName, ADDRESS moduleName__len) { extTools_CommandString cmd; __DUP(moduleName, moduleName__len, CHAR); - extTools_InitialiseCompilerCommand((void*)cmd, 4096); + extTools_InitialiseCompilerCommand((void*)cmd, 4096, (CHAR*)"", 1); Strings_Append((CHAR*)"-c ", 4, (void*)cmd, 4096); Strings_Append(moduleName, moduleName__len, (void*)cmd, 4096); Strings_Append((CHAR*)".c", 3, (void*)cmd, 4096); @@ -97,10 +101,9 @@ void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN stati { extTools_CommandString cmd; __DUP(additionalopts, additionalopts__len, CHAR); - extTools_InitialiseCompilerCommand((void*)cmd, 4096); + extTools_InitialiseCompilerCommand((void*)cmd, 4096, additionalopts, additionalopts__len); Strings_Append(moduleName, moduleName__len, (void*)cmd, 4096); Strings_Append((CHAR*)".c ", 4, (void*)cmd, 4096); - Strings_Append(additionalopts, additionalopts__len, (void*)cmd, 4096); if (statically) { Strings_Append((CHAR*)" -static", 9, (void*)cmd, 4096); } diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index 403cdeff..a6544ef7 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/Compiler.c b/bootstrap/windows-48/Compiler.c index bd643b9a..cfdeda93 100644 --- a/bootstrap/windows-48/Compiler.c +++ b/bootstrap/windows-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index 1c746b94..b57b2c02 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index 1747f3ca..ec6aa1fc 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 7d838e6c..55944507 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -86,6 +86,7 @@ export INT32 Files_Pos (Files_Rider *r, ADDRESS *r__typ); export void Files_Purge (Files_File f); export void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x); export void Files_ReadBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN *x); +export void Files_ReadByte (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x); export void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS x__len, INT32 n); export void Files_ReadInt (Files_Rider *R, ADDRESS *R__typ, INT16 *x); export void Files_ReadLInt (Files_Rider *R, ADDRESS *R__typ, INT32 *x); @@ -634,6 +635,11 @@ void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x) } } +void Files_ReadByte (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x) +{ + Files_Read(&*r, r__typ, &*x); +} + void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS x__len, INT32 n) { INT32 xpos, min, restInBuf, offset; diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index b539610b..bf355af3 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Files__h #define Files__h @@ -40,6 +40,7 @@ import INT32 Files_Pos (Files_Rider *r, ADDRESS *r__typ); import void Files_Purge (Files_File f); import void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x); import void Files_ReadBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN *x); +import void Files_ReadByte (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x); import void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS x__len, INT32 n); import void Files_ReadInt (Files_Rider *R, ADDRESS *R__typ, INT16 *x); import void Files_ReadLInt (Files_Rider *R, ADDRESS *R__typ, INT32 *x); diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index c7957869..e39f5219 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index 385cd08c..82af4503 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index c4f50e79..20b60394 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index 74575f7f..0170d1e1 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index 46fc80da..c44c18d2 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index d409cbfd..c6549fbd 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index dfeb1a84..d87c06e3 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index 4086dae5..b200194e 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 9c87c0c5..2d1f5b46 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index 8b0c7133..02653db0 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index 4226dd8b..6a4c0e65 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index a389b3d9..a42e2381 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index 4dd60bee..2e62a8d6 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index 009b0baa..ae65ff71 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 50f3065b..4f18f54c 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index 95bbf8b0..3463d4bd 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index 3e6f92d5..504b7c3c 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index ca2ef73d..23df5968 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Out.c b/bootstrap/windows-48/Out.c index c0b2adae..a56aa994 100644 --- a/bootstrap/windows-48/Out.c +++ b/bootstrap/windows-48/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Out.h b/bootstrap/windows-48/Out.h index 7507a692..2b10d766 100644 --- a/bootstrap/windows-48/Out.h +++ b/bootstrap/windows-48/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index bc0d563b..b0582647 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index 49c44602..13b13d69 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index c969b821..ca2a3bf6 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index b1b5513e..9584ffc9 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index c0b1581b..1039098d 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index e5750cb0..4e11cddd 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index fcd01a50..36e71a85 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -8,7 +8,6 @@ #include "SYSTEM.h" #include "Files.h" #include "Modules.h" -#include "Out.h" #include "Reals.h" typedef @@ -1810,7 +1809,6 @@ export void *Texts__init(void) __DEFMOD; __MODULE_IMPORT(Files); __MODULE_IMPORT(Modules); - __MODULE_IMPORT(Out); __MODULE_IMPORT(Reals); __REGMOD("Texts", EnumPtrs); __INITYP(Texts_FontDesc, Texts_FontDesc, 0); diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index 443cb429..74423529 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/VT100.c b/bootstrap/windows-48/VT100.c index aad9af3b..2fb16a73 100644 --- a/bootstrap/windows-48/VT100.c +++ b/bootstrap/windows-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -34,6 +34,7 @@ static void VT100_EscSeqSwapped (INT16 n, CHAR *letter, ADDRESS letter__len); export void VT100_HVP (INT16 n, INT16 m); export void VT100_IntToStr (INT32 int_, CHAR *str, ADDRESS str__len); export void VT100_RCP (void); +export void VT100_Reset (void); static void VT100_Reverse0 (CHAR *str, ADDRESS str__len, INT16 start, INT16 end); export void VT100_SCP (void); export void VT100_SD (INT16 n); @@ -136,6 +137,15 @@ static void VT100_EscSeq2 (INT16 n, INT16 m, CHAR *letter, ADDRESS letter__len) __DEL(letter); } +void VT100_Reset (void) +{ + CHAR cmd[6]; + __COPY("\033", cmd, 6); + Strings_Append((CHAR*)"c", 2, (void*)cmd, 6); + Out_String(cmd, 6); + Out_Ln(); +} + void VT100_CUU (INT16 n) { VT100_EscSeq(n, (CHAR*)"A", 2); @@ -256,6 +266,7 @@ export void *VT100__init(void) __REGCMD("DECTCEMh", VT100_DECTCEMh); __REGCMD("DECTCEMl", VT100_DECTCEMl); __REGCMD("RCP", VT100_RCP); + __REGCMD("Reset", VT100_Reset); __REGCMD("SCP", VT100_SCP); /* BEGIN */ __COPY("\033", VT100_CSI, 5); diff --git a/bootstrap/windows-48/VT100.h b/bootstrap/windows-48/VT100.h index a382735c..b9cd4c06 100644 --- a/bootstrap/windows-48/VT100.h +++ b/bootstrap/windows-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef VT100__h #define VT100__h @@ -25,6 +25,7 @@ import void VT100_EL (INT16 n); import void VT100_HVP (INT16 n, INT16 m); import void VT100_IntToStr (INT32 int_, CHAR *str, ADDRESS str__len); import void VT100_RCP (void); +import void VT100_Reset (void); import void VT100_SCP (void); import void VT100_SD (INT16 n); import void VT100_SGR (INT16 n); diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index 9ffffdd9..a8dee3f6 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -22,7 +22,7 @@ static extTools_CommandString extTools_CFLAGS; export void extTools_Assemble (CHAR *moduleName, ADDRESS moduleName__len); -static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len); +static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len, CHAR *additionalopts, ADDRESS additionalopts__len); export void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN statically, CHAR *additionalopts, ADDRESS additionalopts__len); static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRESS cmd__len); @@ -70,22 +70,26 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES __DEL(cmd); } -static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) +static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len, CHAR *additionalopts, ADDRESS additionalopts__len) { + __DUP(additionalopts, additionalopts__len, CHAR); __COPY("gcc -fPIC -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); + Strings_Append(additionalopts, additionalopts__len, (void*)s, s__len); + Strings_Append((CHAR*)" ", 2, (void*)s, s__len); Platform_GetEnv((CHAR*)"CFLAGS", 7, (void*)extTools_CFLAGS, 4096); Strings_Append(extTools_CFLAGS, 4096, (void*)s, s__len); Strings_Append((CHAR*)" ", 2, (void*)s, s__len); + __DEL(additionalopts); } void extTools_Assemble (CHAR *moduleName, ADDRESS moduleName__len) { extTools_CommandString cmd; __DUP(moduleName, moduleName__len, CHAR); - extTools_InitialiseCompilerCommand((void*)cmd, 4096); + extTools_InitialiseCompilerCommand((void*)cmd, 4096, (CHAR*)"", 1); Strings_Append((CHAR*)"-c ", 4, (void*)cmd, 4096); Strings_Append(moduleName, moduleName__len, (void*)cmd, 4096); Strings_Append((CHAR*)".c", 3, (void*)cmd, 4096); @@ -97,10 +101,9 @@ void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN stati { extTools_CommandString cmd; __DUP(additionalopts, additionalopts__len, CHAR); - extTools_InitialiseCompilerCommand((void*)cmd, 4096); + extTools_InitialiseCompilerCommand((void*)cmd, 4096, additionalopts, additionalopts__len); Strings_Append(moduleName, moduleName__len, (void*)cmd, 4096); Strings_Append((CHAR*)".c ", 4, (void*)cmd, 4096); - Strings_Append(additionalopts, additionalopts__len, (void*)cmd, 4096); if (statically) { Strings_Append((CHAR*)" -static", 9, (void*)cmd, 4096); } diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index 403cdeff..a6544ef7 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/Compiler.c b/bootstrap/windows-88/Compiler.c index bd643b9a..cfdeda93 100644 --- a/bootstrap/windows-88/Compiler.c +++ b/bootstrap/windows-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index 1c746b94..b57b2c02 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index 1747f3ca..ec6aa1fc 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 180b7cae..550373db 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -87,6 +87,7 @@ export INT32 Files_Pos (Files_Rider *r, ADDRESS *r__typ); export void Files_Purge (Files_File f); export void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x); export void Files_ReadBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN *x); +export void Files_ReadByte (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x); export void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS x__len, INT32 n); export void Files_ReadInt (Files_Rider *R, ADDRESS *R__typ, INT16 *x); export void Files_ReadLInt (Files_Rider *R, ADDRESS *R__typ, INT32 *x); @@ -635,6 +636,11 @@ void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x) } } +void Files_ReadByte (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x) +{ + Files_Read(&*r, r__typ, &*x); +} + void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS x__len, INT32 n) { INT32 xpos, min, restInBuf, offset; diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 70e6cb03..b35a824e 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Files__h #define Files__h @@ -41,6 +41,7 @@ import INT32 Files_Pos (Files_Rider *r, ADDRESS *r__typ); import void Files_Purge (Files_File f); import void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x); import void Files_ReadBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN *x); +import void Files_ReadByte (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x); import void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS x__len, INT32 n); import void Files_ReadInt (Files_Rider *R, ADDRESS *R__typ, INT16 *x); import void Files_ReadLInt (Files_Rider *R, ADDRESS *R__typ, INT32 *x); diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index 5b01f160..e2d137e1 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index 82b83e8c..84a699c8 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 8daa2dfd..6bb5ad88 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index 2d245d3b..1bc9e78a 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index 46fc80da..c44c18d2 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index d409cbfd..c6549fbd 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index dfeb1a84..d87c06e3 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index 4086dae5..b200194e 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 716c199c..e4f7f87b 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index 8b0c7133..02653db0 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index 5726dee1..cbdc3d68 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index a389b3d9..a42e2381 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index 4dd60bee..2e62a8d6 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index 009b0baa..ae65ff71 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index cf98d97c..e635696d 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 95bbf8b0..3463d4bd 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 14f83a4d..f719c048 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index ca2ef73d..23df5968 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Out.c b/bootstrap/windows-88/Out.c index c0b2adae..a56aa994 100644 --- a/bootstrap/windows-88/Out.c +++ b/bootstrap/windows-88/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Out.h b/bootstrap/windows-88/Out.h index 7507a692..2b10d766 100644 --- a/bootstrap/windows-88/Out.h +++ b/bootstrap/windows-88/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 27c077b9..298d2ec3 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index 1dc659c2..fc5b76af 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index c969b821..ca2a3bf6 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index b1b5513e..9584ffc9 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index c0b1581b..1039098d 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index e5750cb0..4e11cddd 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index fb6f4a4c..a9561691 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -8,7 +8,6 @@ #include "SYSTEM.h" #include "Files.h" #include "Modules.h" -#include "Out.h" #include "Reals.h" typedef @@ -1810,7 +1809,6 @@ export void *Texts__init(void) __DEFMOD; __MODULE_IMPORT(Files); __MODULE_IMPORT(Modules); - __MODULE_IMPORT(Out); __MODULE_IMPORT(Reals); __REGMOD("Texts", EnumPtrs); __INITYP(Texts_FontDesc, Texts_FontDesc, 0); diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index 64bd272c..1fd381b6 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/VT100.c b/bootstrap/windows-88/VT100.c index aad9af3b..2fb16a73 100644 --- a/bootstrap/windows-88/VT100.c +++ b/bootstrap/windows-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -34,6 +34,7 @@ static void VT100_EscSeqSwapped (INT16 n, CHAR *letter, ADDRESS letter__len); export void VT100_HVP (INT16 n, INT16 m); export void VT100_IntToStr (INT32 int_, CHAR *str, ADDRESS str__len); export void VT100_RCP (void); +export void VT100_Reset (void); static void VT100_Reverse0 (CHAR *str, ADDRESS str__len, INT16 start, INT16 end); export void VT100_SCP (void); export void VT100_SD (INT16 n); @@ -136,6 +137,15 @@ static void VT100_EscSeq2 (INT16 n, INT16 m, CHAR *letter, ADDRESS letter__len) __DEL(letter); } +void VT100_Reset (void) +{ + CHAR cmd[6]; + __COPY("\033", cmd, 6); + Strings_Append((CHAR*)"c", 2, (void*)cmd, 6); + Out_String(cmd, 6); + Out_Ln(); +} + void VT100_CUU (INT16 n) { VT100_EscSeq(n, (CHAR*)"A", 2); @@ -256,6 +266,7 @@ export void *VT100__init(void) __REGCMD("DECTCEMh", VT100_DECTCEMh); __REGCMD("DECTCEMl", VT100_DECTCEMl); __REGCMD("RCP", VT100_RCP); + __REGCMD("Reset", VT100_Reset); __REGCMD("SCP", VT100_SCP); /* BEGIN */ __COPY("\033", VT100_CSI, 5); diff --git a/bootstrap/windows-88/VT100.h b/bootstrap/windows-88/VT100.h index a382735c..b9cd4c06 100644 --- a/bootstrap/windows-88/VT100.h +++ b/bootstrap/windows-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef VT100__h #define VT100__h @@ -25,6 +25,7 @@ import void VT100_EL (INT16 n); import void VT100_HVP (INT16 n, INT16 m); import void VT100_IntToStr (INT32 int_, CHAR *str, ADDRESS str__len); import void VT100_RCP (void); +import void VT100_Reset (void); import void VT100_SCP (void); import void VT100_SD (INT16 n); import void VT100_SGR (INT16 n); diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index 9ffffdd9..a8dee3f6 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -22,7 +22,7 @@ static extTools_CommandString extTools_CFLAGS; export void extTools_Assemble (CHAR *moduleName, ADDRESS moduleName__len); -static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len); +static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len, CHAR *additionalopts, ADDRESS additionalopts__len); export void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN statically, CHAR *additionalopts, ADDRESS additionalopts__len); static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRESS cmd__len); @@ -70,22 +70,26 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES __DEL(cmd); } -static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) +static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len, CHAR *additionalopts, ADDRESS additionalopts__len) { + __DUP(additionalopts, additionalopts__len, CHAR); __COPY("gcc -fPIC -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); + Strings_Append(additionalopts, additionalopts__len, (void*)s, s__len); + Strings_Append((CHAR*)" ", 2, (void*)s, s__len); Platform_GetEnv((CHAR*)"CFLAGS", 7, (void*)extTools_CFLAGS, 4096); Strings_Append(extTools_CFLAGS, 4096, (void*)s, s__len); Strings_Append((CHAR*)" ", 2, (void*)s, s__len); + __DEL(additionalopts); } void extTools_Assemble (CHAR *moduleName, ADDRESS moduleName__len) { extTools_CommandString cmd; __DUP(moduleName, moduleName__len, CHAR); - extTools_InitialiseCompilerCommand((void*)cmd, 4096); + extTools_InitialiseCompilerCommand((void*)cmd, 4096, (CHAR*)"", 1); Strings_Append((CHAR*)"-c ", 4, (void*)cmd, 4096); Strings_Append(moduleName, moduleName__len, (void*)cmd, 4096); Strings_Append((CHAR*)".c", 3, (void*)cmd, 4096); @@ -97,10 +101,9 @@ void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN stati { extTools_CommandString cmd; __DUP(additionalopts, additionalopts__len, CHAR); - extTools_InitialiseCompilerCommand((void*)cmd, 4096); + extTools_InitialiseCompilerCommand((void*)cmd, 4096, additionalopts, additionalopts__len); Strings_Append(moduleName, moduleName__len, (void*)cmd, 4096); Strings_Append((CHAR*)".c ", 4, (void*)cmd, 4096); - Strings_Append(additionalopts, additionalopts__len, (void*)cmd, 4096); if (statically) { Strings_Append((CHAR*)" -static", 9, (void*)cmd, 4096); } diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index 403cdeff..a6544ef7 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2022/03/15]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/src/runtime/Files.Mod b/src/runtime/Files.Mod index aede16c4..64236a7d 100644 --- a/src/runtime/Files.Mod +++ b/src/runtime/Files.Mod @@ -413,6 +413,12 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files END END Read; + (* wrapper for compatibility with Project Oberon sources *) + PROCEDURE ReadByte*(VAR r: Rider; VAR x: SYSTEM.BYTE); + BEGIN + Read(r, x) + END ReadByte; + PROCEDURE ReadBytes* (VAR r: Rider; VAR x: ARRAY OF SYSTEM.BYTE; n: LONGINT); VAR xpos, min, restInBuf, offset: LONGINT; buf: Buffer; BEGIN @@ -673,7 +679,7 @@ Especially Length would become fairly complex. PROCEDURE WriteSet* (VAR R: Rider; x: SET); VAR b: ARRAY 4 OF CHAR; i: LONGINT; y: SYSTEM.SET64; - BEGIN + BEGIN IF SIZE(SET) = SIZE(INTEGER) THEN i := SYSTEM.VAL(INTEGER, x); ELSE From a7fe55d434a64fde14adee42210b3f9a0ccd64bf Mon Sep 17 00:00:00 2001 From: Norayr Chilingarian Date: Thu, 21 Mar 2024 19:36:43 +0400 Subject: [PATCH 539/580] changed hardcoded test file name to the one which exists in current directory. --- src/test/md5/md5test.Mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/md5/md5test.Mod b/src/test/md5/md5test.Mod index 91885c0e..a6e685fb 100644 --- a/src/test/md5/md5test.Mod +++ b/src/test/md5/md5test.Mod @@ -24,7 +24,7 @@ PROCEDURE main; ch: CHAR; i: INTEGER; BEGIN - F := Files.Old("SETs.pdf"); + F := Files.Old("hello.txt"); IF F # NIL THEN Files.Set(R, F, 0); ilen := Files.Length(F); From 7ea99e20a008080df8e931331ce74ca52cedfa10 Mon Sep 17 00:00:00 2001 From: Norayr Chilingarian Date: Fri, 12 Apr 2024 21:52:25 +0400 Subject: [PATCH 540/580] fixed crash introduced in commit aed9134e9961145a40397e6b70833d307ae221a9 see comments in OPB.Mod --- bootstrap/unix-44/Compiler.c | 2 +- bootstrap/unix-44/Configuration.c | 4 ++-- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Files.c | 2 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 2 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 3 ++- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 2 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 2 +- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 2 +- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 2 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Out.c | 2 +- bootstrap/unix-44/Out.h | 2 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/VT100.c | 2 +- bootstrap/unix-44/VT100.h | 2 +- bootstrap/unix-44/extTools.c | 2 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-48/Compiler.c | 2 +- bootstrap/unix-48/Configuration.c | 4 ++-- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Files.c | 2 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 2 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 3 ++- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 2 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 2 +- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 2 +- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 2 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Out.c | 2 +- bootstrap/unix-48/Out.h | 2 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/VT100.c | 2 +- bootstrap/unix-48/VT100.h | 2 +- bootstrap/unix-48/extTools.c | 2 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-88/Compiler.c | 2 +- bootstrap/unix-88/Configuration.c | 4 ++-- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Files.c | 2 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 2 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 3 ++- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 2 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 2 +- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 2 +- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 2 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Out.c | 2 +- bootstrap/unix-88/Out.h | 2 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/VT100.c | 2 +- bootstrap/unix-88/VT100.h | 2 +- bootstrap/unix-88/extTools.c | 2 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/windows-48/Compiler.c | 2 +- bootstrap/windows-48/Configuration.c | 4 ++-- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Files.c | 2 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 2 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 3 ++- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 2 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 2 +- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 2 +- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 2 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Out.c | 2 +- bootstrap/windows-48/Out.h | 2 +- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/VT100.c | 2 +- bootstrap/windows-48/VT100.h | 2 +- bootstrap/windows-48/extTools.c | 2 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-88/Compiler.c | 2 +- bootstrap/windows-88/Configuration.c | 4 ++-- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Files.c | 2 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 2 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 3 ++- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 2 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 2 +- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 2 +- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 2 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Out.c | 2 +- bootstrap/windows-88/Out.h | 2 +- bootstrap/windows-88/Platform.c | 2 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/VT100.c | 2 +- bootstrap/windows-88/VT100.h | 2 +- bootstrap/windows-88/extTools.c | 2 +- bootstrap/windows-88/extTools.h | 2 +- src/compiler/OPB.Mod | 19 +++++++++++++++++++ 186 files changed, 214 insertions(+), 190 deletions(-) diff --git a/bootstrap/unix-44/Compiler.c b/bootstrap/unix-44/Compiler.c index cfdeda93..3b38d219 100644 --- a/bootstrap/unix-44/Compiler.c +++ b/bootstrap/unix-44/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index b57b2c02..c44f113b 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index ec6aa1fc..4f9fce60 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 036e1a9c..ab0385cd 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index 9a2e9eb3..726cc299 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index e39f5219..4df7f428 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index 82af4503..c61a7bb1 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index 3dfe0c57..01900836 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index 0170d1e1..38ed4ace 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index c44c18d2..b42be120 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -1626,6 +1626,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) if (x == y) { } else if ((((y->comp == 2 && y->BaseTyp == x->BaseTyp)) && y->n <= x->n)) { } else if ((y->comp == 3 && y->BaseTyp == x->BaseTyp)) { + OPB_err(113); } else if (x->BaseTyp == OPT_chartyp) { if (g == 8) { if (ynode->conval->intval2 > x->n) { diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index c6549fbd..1dc8ffc0 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index d87c06e3..0bb7bbfd 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index b200194e..a31dc547 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 2d1f5b46..a893a729 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index 02653db0..af78b76f 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index 6a4c0e65..7b311a12 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index a42e2381..8aae5cd9 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index 2e62a8d6..b8fd3d66 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index ae65ff71..7e15fce3 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index 81129027..21748d69 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index 3463d4bd..3e653237 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index 504b7c3c..e4792940 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index 23df5968..ae5b7f69 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Out.c b/bootstrap/unix-44/Out.c index 80c4f532..900a2035 100644 --- a/bootstrap/unix-44/Out.c +++ b/bootstrap/unix-44/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Out.h b/bootstrap/unix-44/Out.h index 2b10d766..d4033209 100644 --- a/bootstrap/unix-44/Out.h +++ b/bootstrap/unix-44/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index e3fe3c3d..76e02daf 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index e83a7ba7..53d00242 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index ca2a3bf6..98cd4d23 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index 9584ffc9..7720227f 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index 1039098d..aa3d856b 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index 4e11cddd..ecd78a84 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index 293287b0..139cc693 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index 436f475a..c3417d88 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/VT100.c b/bootstrap/unix-44/VT100.c index 2fb16a73..e7bde10b 100644 --- a/bootstrap/unix-44/VT100.c +++ b/bootstrap/unix-44/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/VT100.h b/bootstrap/unix-44/VT100.h index b9cd4c06..3d141927 100644 --- a/bootstrap/unix-44/VT100.h +++ b/bootstrap/unix-44/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index a8dee3f6..49f9d0d8 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index a6544ef7..13fb27dd 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/Compiler.c b/bootstrap/unix-48/Compiler.c index cfdeda93..3b38d219 100644 --- a/bootstrap/unix-48/Compiler.c +++ b/bootstrap/unix-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index b57b2c02..c44f113b 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index ec6aa1fc..4f9fce60 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 036e1a9c..ab0385cd 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index 9a2e9eb3..726cc299 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index e39f5219..4df7f428 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index 82af4503..c61a7bb1 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index 3dfe0c57..01900836 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index 0170d1e1..38ed4ace 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index c44c18d2..b42be120 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -1626,6 +1626,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) if (x == y) { } else if ((((y->comp == 2 && y->BaseTyp == x->BaseTyp)) && y->n <= x->n)) { } else if ((y->comp == 3 && y->BaseTyp == x->BaseTyp)) { + OPB_err(113); } else if (x->BaseTyp == OPT_chartyp) { if (g == 8) { if (ynode->conval->intval2 > x->n) { diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index c6549fbd..1dc8ffc0 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index d87c06e3..0bb7bbfd 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index b200194e..a31dc547 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 2d1f5b46..a893a729 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index 02653db0..af78b76f 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index 6a4c0e65..7b311a12 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index a42e2381..8aae5cd9 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index 2e62a8d6..b8fd3d66 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index ae65ff71..7e15fce3 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 4f18f54c..10c206cc 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index 3463d4bd..3e653237 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index 504b7c3c..e4792940 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index 23df5968..ae5b7f69 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Out.c b/bootstrap/unix-48/Out.c index 80c4f532..900a2035 100644 --- a/bootstrap/unix-48/Out.c +++ b/bootstrap/unix-48/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Out.h b/bootstrap/unix-48/Out.h index 2b10d766..d4033209 100644 --- a/bootstrap/unix-48/Out.h +++ b/bootstrap/unix-48/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index e3fe3c3d..76e02daf 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index e83a7ba7..53d00242 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index ca2a3bf6..98cd4d23 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index 9584ffc9..7720227f 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index 1039098d..aa3d856b 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index 4e11cddd..ecd78a84 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index 36e71a85..64448cf9 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index 74423529..5bf3762f 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/VT100.c b/bootstrap/unix-48/VT100.c index 2fb16a73..e7bde10b 100644 --- a/bootstrap/unix-48/VT100.c +++ b/bootstrap/unix-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/VT100.h b/bootstrap/unix-48/VT100.h index b9cd4c06..3d141927 100644 --- a/bootstrap/unix-48/VT100.h +++ b/bootstrap/unix-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index a8dee3f6..49f9d0d8 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index a6544ef7..13fb27dd 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/Compiler.c b/bootstrap/unix-88/Compiler.c index cfdeda93..3b38d219 100644 --- a/bootstrap/unix-88/Compiler.c +++ b/bootstrap/unix-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index b57b2c02..c44f113b 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index ec6aa1fc..4f9fce60 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 9adf424f..9ac86c0b 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 7a91d8e6..8fb1b05c 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index e2d137e1..ed882a7f 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index 84a699c8..77c7815a 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index c166b163..f6a42485 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index 1bc9e78a..ecfe6a4f 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index c44c18d2..b42be120 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -1626,6 +1626,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) if (x == y) { } else if ((((y->comp == 2 && y->BaseTyp == x->BaseTyp)) && y->n <= x->n)) { } else if ((y->comp == 3 && y->BaseTyp == x->BaseTyp)) { + OPB_err(113); } else if (x->BaseTyp == OPT_chartyp) { if (g == 8) { if (ynode->conval->intval2 > x->n) { diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index c6549fbd..1dc8ffc0 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index d87c06e3..0bb7bbfd 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index b200194e..a31dc547 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index e4f7f87b..f25303f2 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index 02653db0..af78b76f 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index cbdc3d68..a2aa3ed3 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index a42e2381..8aae5cd9 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index 2e62a8d6..b8fd3d66 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index ae65ff71..7e15fce3 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index e635696d..10f74ed9 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 3463d4bd..3e653237 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index f719c048..f1dd5a74 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index 23df5968..ae5b7f69 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Out.c b/bootstrap/unix-88/Out.c index 80c4f532..900a2035 100644 --- a/bootstrap/unix-88/Out.c +++ b/bootstrap/unix-88/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Out.h b/bootstrap/unix-88/Out.h index 2b10d766..d4033209 100644 --- a/bootstrap/unix-88/Out.h +++ b/bootstrap/unix-88/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index fd7c0838..e59f3465 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index cb0cb468..f18addde 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index ca2a3bf6..98cd4d23 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index 9584ffc9..7720227f 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index 1039098d..aa3d856b 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index 4e11cddd..ecd78a84 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index a9561691..cbaf0ead 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index 1fd381b6..4a529d81 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/VT100.c b/bootstrap/unix-88/VT100.c index 2fb16a73..e7bde10b 100644 --- a/bootstrap/unix-88/VT100.c +++ b/bootstrap/unix-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/VT100.h b/bootstrap/unix-88/VT100.h index b9cd4c06..3d141927 100644 --- a/bootstrap/unix-88/VT100.h +++ b/bootstrap/unix-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index a8dee3f6..49f9d0d8 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index a6544ef7..13fb27dd 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/Compiler.c b/bootstrap/windows-48/Compiler.c index cfdeda93..3b38d219 100644 --- a/bootstrap/windows-48/Compiler.c +++ b/bootstrap/windows-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index b57b2c02..c44f113b 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index ec6aa1fc..4f9fce60 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 55944507..c9924fe5 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index bf355af3..0eedbd67 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index e39f5219..4df7f428 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index 82af4503..c61a7bb1 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index 20b60394..a1725b7e 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index 0170d1e1..38ed4ace 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index c44c18d2..b42be120 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -1626,6 +1626,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) if (x == y) { } else if ((((y->comp == 2 && y->BaseTyp == x->BaseTyp)) && y->n <= x->n)) { } else if ((y->comp == 3 && y->BaseTyp == x->BaseTyp)) { + OPB_err(113); } else if (x->BaseTyp == OPT_chartyp) { if (g == 8) { if (ynode->conval->intval2 > x->n) { diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index c6549fbd..1dc8ffc0 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index d87c06e3..0bb7bbfd 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index b200194e..a31dc547 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 2d1f5b46..a893a729 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index 02653db0..af78b76f 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index 6a4c0e65..7b311a12 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index a42e2381..8aae5cd9 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index 2e62a8d6..b8fd3d66 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index ae65ff71..7e15fce3 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 4f18f54c..10c206cc 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index 3463d4bd..3e653237 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index 504b7c3c..e4792940 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index 23df5968..ae5b7f69 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Out.c b/bootstrap/windows-48/Out.c index a56aa994..6336cff6 100644 --- a/bootstrap/windows-48/Out.c +++ b/bootstrap/windows-48/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Out.h b/bootstrap/windows-48/Out.h index 2b10d766..d4033209 100644 --- a/bootstrap/windows-48/Out.h +++ b/bootstrap/windows-48/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index b0582647..82b21cb5 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index 13b13d69..c2f0defe 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index ca2a3bf6..98cd4d23 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index 9584ffc9..7720227f 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index 1039098d..aa3d856b 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index 4e11cddd..ecd78a84 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index 36e71a85..64448cf9 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index 74423529..5bf3762f 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/VT100.c b/bootstrap/windows-48/VT100.c index 2fb16a73..e7bde10b 100644 --- a/bootstrap/windows-48/VT100.c +++ b/bootstrap/windows-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/VT100.h b/bootstrap/windows-48/VT100.h index b9cd4c06..3d141927 100644 --- a/bootstrap/windows-48/VT100.h +++ b/bootstrap/windows-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index a8dee3f6..49f9d0d8 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index a6544ef7..13fb27dd 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/Compiler.c b/bootstrap/windows-88/Compiler.c index cfdeda93..3b38d219 100644 --- a/bootstrap/windows-88/Compiler.c +++ b/bootstrap/windows-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index b57b2c02..c44f113b 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index ec6aa1fc..4f9fce60 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 550373db..4e274d67 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index b35a824e..0be7189d 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index e2d137e1..ed882a7f 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index 84a699c8..77c7815a 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 6bb5ad88..53157142 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index 1bc9e78a..ecfe6a4f 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index c44c18d2..b42be120 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -1626,6 +1626,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) if (x == y) { } else if ((((y->comp == 2 && y->BaseTyp == x->BaseTyp)) && y->n <= x->n)) { } else if ((y->comp == 3 && y->BaseTyp == x->BaseTyp)) { + OPB_err(113); } else if (x->BaseTyp == OPT_chartyp) { if (g == 8) { if (ynode->conval->intval2 > x->n) { diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index c6549fbd..1dc8ffc0 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index d87c06e3..0bb7bbfd 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index b200194e..a31dc547 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index e4f7f87b..f25303f2 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index 02653db0..af78b76f 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index cbdc3d68..a2aa3ed3 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index a42e2381..8aae5cd9 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index 2e62a8d6..b8fd3d66 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index ae65ff71..7e15fce3 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index e635696d..10f74ed9 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 3463d4bd..3e653237 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index f719c048..f1dd5a74 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index 23df5968..ae5b7f69 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Out.c b/bootstrap/windows-88/Out.c index a56aa994..6336cff6 100644 --- a/bootstrap/windows-88/Out.c +++ b/bootstrap/windows-88/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Out.h b/bootstrap/windows-88/Out.h index 2b10d766..d4033209 100644 --- a/bootstrap/windows-88/Out.h +++ b/bootstrap/windows-88/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 298d2ec3..5da8bd9d 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index fc5b76af..17c80af3 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index ca2a3bf6..98cd4d23 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index 9584ffc9..7720227f 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index 1039098d..aa3d856b 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index 4e11cddd..ecd78a84 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index a9561691..cbaf0ead 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index 1fd381b6..4a529d81 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/VT100.c b/bootstrap/windows-88/VT100.c index 2fb16a73..e7bde10b 100644 --- a/bootstrap/windows-88/VT100.c +++ b/bootstrap/windows-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/VT100.h b/bootstrap/windows-88/VT100.h index b9cd4c06..3d141927 100644 --- a/bootstrap/windows-88/VT100.h +++ b/bootstrap/windows-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index a8dee3f6..49f9d0d8 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index a6544ef7..13fb27dd 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/03/14]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/src/compiler/OPB.Mod b/src/compiler/OPB.Mod index 718d9b9e..3ff7fffc 100644 --- a/src/compiler/OPB.Mod +++ b/src/compiler/OPB.Mod @@ -893,6 +893,25 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) IF x = y THEN (* ok *) ELSIF (y.comp = OPT.Array) & (y.BaseTyp = x.BaseTyp) & (y.n <= x.n) THEN (* OK by Oberon-07/2013 *) ELSIF (y.comp = OPT.DynArr) & (y.BaseTyp = x.BaseTyp) THEN (* OK by Oberon-07/2013, length tested at runtime *) + err(113) + (* if no error issued the compiler will crash later + in OPC.CompleteIdent because NIL will be passed to it + from OPC.Len + which is called from OPV.stat + OPV.stat gets n: OPT.node + where both n^.left.obj and n^.right.obj are NIL. + n^.right.obj is then passed to OPC.Len + + at this point, in this ELSIF body + x^.comp = OPT.Array + x^.strobj.name= + y^.strobj is NIL already! + + it's interesting that OPT.InStruct functions + Sarr case is entered, but not Sdarr + + issuing error for now to eliminate compiler crash. + *) ELSIF x^.BaseTyp = OPT.chartyp THEN (* Assign to (static) ARRAY OF CHAR *) IF g = OPT.String THEN (*check length of string*) IF ynode^.conval^.intval2 > x^.n THEN err(114) END From 7fb61a066bca566966684737413c94c25d6ad258 Mon Sep 17 00:00:00 2001 From: Norayr Chilingarian Date: Sat, 13 Apr 2024 04:14:18 +0400 Subject: [PATCH 541/580] now "NIL access" error in Modules.Mod indeed works. --- bootstrap/SYSTEM.c | 43 +++++++++++++++++----------- bootstrap/SYSTEM.h | 5 +++- bootstrap/unix-44/Compiler.c | 2 +- bootstrap/unix-44/Configuration.c | 4 +-- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Files.c | 2 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 2 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 2 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 2 +- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 2 +- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 2 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Out.c | 2 +- bootstrap/unix-44/Out.h | 2 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/VT100.c | 2 +- bootstrap/unix-44/VT100.h | 2 +- bootstrap/unix-44/extTools.c | 2 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-48/Compiler.c | 2 +- bootstrap/unix-48/Configuration.c | 4 +-- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Files.c | 2 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 2 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 2 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 2 +- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 2 +- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 2 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Out.c | 2 +- bootstrap/unix-48/Out.h | 2 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/VT100.c | 2 +- bootstrap/unix-48/VT100.h | 2 +- bootstrap/unix-48/extTools.c | 2 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-88/Compiler.c | 2 +- bootstrap/unix-88/Configuration.c | 4 +-- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Files.c | 2 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 2 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 2 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 2 +- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 2 +- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 2 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Out.c | 2 +- bootstrap/unix-88/Out.h | 2 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/VT100.c | 2 +- bootstrap/unix-88/VT100.h | 2 +- bootstrap/unix-88/extTools.c | 2 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/windows-48/Compiler.c | 2 +- bootstrap/windows-48/Configuration.c | 4 +-- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Files.c | 2 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 2 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 2 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 2 +- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 2 +- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 2 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Out.c | 2 +- bootstrap/windows-48/Out.h | 2 +- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/VT100.c | 2 +- bootstrap/windows-48/VT100.h | 2 +- bootstrap/windows-48/extTools.c | 2 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-88/Compiler.c | 2 +- bootstrap/windows-88/Configuration.c | 4 +-- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Files.c | 2 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 2 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 2 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 2 +- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 2 +- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 2 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Out.c | 2 +- bootstrap/windows-88/Out.h | 2 +- bootstrap/windows-88/Platform.c | 2 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/VT100.c | 2 +- bootstrap/windows-88/VT100.h | 2 +- bootstrap/windows-88/extTools.c | 2 +- bootstrap/windows-88/extTools.h | 2 +- src/runtime/SYSTEM.c | 43 +++++++++++++++++----------- src/runtime/SYSTEM.h | 5 +++- 189 files changed, 250 insertions(+), 226 deletions(-) diff --git a/bootstrap/SYSTEM.c b/bootstrap/SYSTEM.c index a1b2cb14..2952bb66 100644 --- a/bootstrap/SYSTEM.c +++ b/bootstrap/SYSTEM.c @@ -151,53 +151,61 @@ SYSTEM_PTR SYSTEM_NEWARR(ADDRESS *typ, ADDRESS elemsz, int elemalgn, int nofdim, return x; } - - - typedef void (*SystemSignalHandler)(INT32); // = Platform_SignalHandler #ifndef _WIN32 + // Unix signal handling + SystemSignalHandler handler[10] = {0}; // Adjust the array size to include signal 11 - SystemSignalHandler handler[3] = {0}; - - // Provide signal handling for Unix based systems + void segfaultHandler(int signal) { + __HALT(-10); + } + // Revised signal handler to accommodate additional signals like SIGSEGV void signalHandler(int s) { - if (s >= 2 && s <= 4) handler[s-2](s); - // (Ignore other signals) + if ((s >= 2 && s <= 4) || s == 11) { // Include SIGSEGV (usually signal 11) + if (handler[s-2]) { + handler[s-2](s); + } + } + // Ignore other signals } void SystemSetHandler(int s, ADDRESS h) { - if (s >= 2 && s <= 4) { + if ((s >= 2 && s <= 4) || s == 11) { int needtosetsystemhandler = handler[s-2] == 0; handler[s-2] = (SystemSignalHandler)h; - if (needtosetsystemhandler) {signal(s, signalHandler);} + if (needtosetsystemhandler) { + signal(s, signalHandler); + } } } -#else + void setupAutomaticSegfaultHandler() { + SystemSetHandler(11, (ADDRESS)segfaultHandler); // Register handler for SIGSEGV + } - // Provides Windows callback handlers for signal-like scenarios +#else + // Windows system remains as is since Windows does not use SIGSEGV in the same way #include "WindowsWrapper.h" SystemSignalHandler SystemInterruptHandler = 0; - SystemSignalHandler SystemQuitHandler = 0; + SystemSignalHandler SystemQuitHandler = 0; BOOL ConsoleCtrlHandlerSet = FALSE; BOOL WINAPI SystemConsoleCtrlHandler(DWORD ctrlType) { if ((ctrlType == CTRL_C_EVENT) || (ctrlType == CTRL_BREAK_EVENT)) { if (SystemInterruptHandler) { - SystemInterruptHandler(2); // SIGINT + SystemInterruptHandler(2); // SIGINT return TRUE; } - } else { // Close, logoff or shutdown + } else { if (SystemQuitHandler) { - SystemQuitHandler(3); // SIGQUIT + SystemQuitHandler(3); // SIGQUIT return TRUE; } } return FALSE; } - void EnsureConsoleCtrlHandler() { if (!ConsoleCtrlHandlerSet) { SetConsoleCtrlHandler(SystemConsoleCtrlHandler, TRUE); @@ -216,3 +224,4 @@ typedef void (*SystemSignalHandler)(INT32); // = Platform_SignalHandler } #endif + diff --git a/bootstrap/SYSTEM.h b/bootstrap/SYSTEM.h index 07c6fd10..68e2e335 100644 --- a/bootstrap/SYSTEM.h +++ b/bootstrap/SYSTEM.h @@ -265,7 +265,10 @@ extern void Heap_INCREF(); extern void Modules_Init(INT32 argc, ADDRESS argv); extern void Heap_FINALL(); -#define __INIT(argc, argv) static void *m; Modules_Init(argc, (ADDRESS)&argv); +extern void setupAutomaticSegfaultHandler(); + +#define __INIT(argc, argv) static void *m; setupAutomaticSegfaultHandler(); Modules_Init(argc, (ADDRESS)&argv); + #define __REGMAIN(name, enum) m = Heap_REGMOD((CHAR*)name,enum) #define __FINI Heap_FINALL(); return 0 diff --git a/bootstrap/unix-44/Compiler.c b/bootstrap/unix-44/Compiler.c index 3b38d219..6ed43e4c 100644 --- a/bootstrap/unix-44/Compiler.c +++ b/bootstrap/unix-44/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index c44f113b..412d61c7 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index 4f9fce60..2d35c30b 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index ab0385cd..a52f7d8d 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index 726cc299..cb58b0ac 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index 4df7f428..1168b35e 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index c61a7bb1..dd4a854d 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index 01900836..e1f64512 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index 38ed4ace..7b03650b 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index b42be120..fde76c7f 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index 1dc8ffc0..b2d8373a 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 0bb7bbfd..c955c25e 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index a31dc547..7292cc70 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index a893a729..4bedaffe 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index af78b76f..3768e484 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index 7b311a12..6beda68c 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index 8aae5cd9..3ae323c1 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index b8fd3d66..047e06b3 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index 7e15fce3..1f88fb07 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index 21748d69..c546c53d 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index 3e653237..484abf7d 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index e4792940..30f58a60 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index ae5b7f69..139fcee4 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Out.c b/bootstrap/unix-44/Out.c index 900a2035..6a68a636 100644 --- a/bootstrap/unix-44/Out.c +++ b/bootstrap/unix-44/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Out.h b/bootstrap/unix-44/Out.h index d4033209..3788e8db 100644 --- a/bootstrap/unix-44/Out.h +++ b/bootstrap/unix-44/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 76e02daf..3e4cef6a 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index 53d00242..93fa209a 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 98cd4d23..9ee944a0 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index 7720227f..38931e4d 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index aa3d856b..0c6b1c30 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index ecd78a84..5d12e02b 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index 139cc693..957f87f3 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index c3417d88..89cee481 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/VT100.c b/bootstrap/unix-44/VT100.c index e7bde10b..73440da9 100644 --- a/bootstrap/unix-44/VT100.c +++ b/bootstrap/unix-44/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/VT100.h b/bootstrap/unix-44/VT100.h index 3d141927..62917b5a 100644 --- a/bootstrap/unix-44/VT100.h +++ b/bootstrap/unix-44/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index 49f9d0d8..5d56a636 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index 13fb27dd..f93b0cab 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/Compiler.c b/bootstrap/unix-48/Compiler.c index 3b38d219..6ed43e4c 100644 --- a/bootstrap/unix-48/Compiler.c +++ b/bootstrap/unix-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index c44f113b..412d61c7 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index 4f9fce60..2d35c30b 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index ab0385cd..a52f7d8d 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index 726cc299..cb58b0ac 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index 4df7f428..1168b35e 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index c61a7bb1..dd4a854d 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index 01900836..e1f64512 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index 38ed4ace..7b03650b 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index b42be120..fde76c7f 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index 1dc8ffc0..b2d8373a 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 0bb7bbfd..c955c25e 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index a31dc547..7292cc70 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index a893a729..4bedaffe 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index af78b76f..3768e484 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index 7b311a12..6beda68c 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index 8aae5cd9..3ae323c1 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index b8fd3d66..047e06b3 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index 7e15fce3..1f88fb07 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 10c206cc..9eaae852 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index 3e653237..484abf7d 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index e4792940..30f58a60 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index ae5b7f69..139fcee4 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Out.c b/bootstrap/unix-48/Out.c index 900a2035..6a68a636 100644 --- a/bootstrap/unix-48/Out.c +++ b/bootstrap/unix-48/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Out.h b/bootstrap/unix-48/Out.h index d4033209..3788e8db 100644 --- a/bootstrap/unix-48/Out.h +++ b/bootstrap/unix-48/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 76e02daf..3e4cef6a 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index 53d00242..93fa209a 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 98cd4d23..9ee944a0 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index 7720227f..38931e4d 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index aa3d856b..0c6b1c30 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index ecd78a84..5d12e02b 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index 64448cf9..a0a4c4af 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index 5bf3762f..5e562845 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/VT100.c b/bootstrap/unix-48/VT100.c index e7bde10b..73440da9 100644 --- a/bootstrap/unix-48/VT100.c +++ b/bootstrap/unix-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/VT100.h b/bootstrap/unix-48/VT100.h index 3d141927..62917b5a 100644 --- a/bootstrap/unix-48/VT100.h +++ b/bootstrap/unix-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index 49f9d0d8..5d56a636 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index 13fb27dd..f93b0cab 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/Compiler.c b/bootstrap/unix-88/Compiler.c index 3b38d219..6ed43e4c 100644 --- a/bootstrap/unix-88/Compiler.c +++ b/bootstrap/unix-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index c44f113b..412d61c7 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index 4f9fce60..2d35c30b 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 9ac86c0b..a2496e99 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 8fb1b05c..f4aff9ce 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index ed882a7f..f5e50be6 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index 77c7815a..6c8b35e6 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index f6a42485..8db0dde1 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index ecfe6a4f..8f14d6de 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index b42be120..fde76c7f 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index 1dc8ffc0..b2d8373a 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index 0bb7bbfd..c955c25e 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index a31dc547..7292cc70 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index f25303f2..1c057aa5 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index af78b76f..3768e484 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index a2aa3ed3..049893b4 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index 8aae5cd9..3ae323c1 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index b8fd3d66..047e06b3 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index 7e15fce3..1f88fb07 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index 10f74ed9..4ff8bb16 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 3e653237..484abf7d 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index f1dd5a74..f0146564 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index ae5b7f69..139fcee4 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Out.c b/bootstrap/unix-88/Out.c index 900a2035..6a68a636 100644 --- a/bootstrap/unix-88/Out.c +++ b/bootstrap/unix-88/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Out.h b/bootstrap/unix-88/Out.h index d4033209..3788e8db 100644 --- a/bootstrap/unix-88/Out.h +++ b/bootstrap/unix-88/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index e59f3465..6bafee5a 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index f18addde..2e63d516 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 98cd4d23..9ee944a0 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index 7720227f..38931e4d 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index aa3d856b..0c6b1c30 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index ecd78a84..5d12e02b 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index cbaf0ead..6e34c257 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index 4a529d81..a7c894bd 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/VT100.c b/bootstrap/unix-88/VT100.c index e7bde10b..73440da9 100644 --- a/bootstrap/unix-88/VT100.c +++ b/bootstrap/unix-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/VT100.h b/bootstrap/unix-88/VT100.h index 3d141927..62917b5a 100644 --- a/bootstrap/unix-88/VT100.h +++ b/bootstrap/unix-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index 49f9d0d8..5d56a636 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index 13fb27dd..f93b0cab 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/Compiler.c b/bootstrap/windows-48/Compiler.c index 3b38d219..6ed43e4c 100644 --- a/bootstrap/windows-48/Compiler.c +++ b/bootstrap/windows-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index c44f113b..412d61c7 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index 4f9fce60..2d35c30b 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index c9924fe5..723046f3 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index 0eedbd67..f30b79bd 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index 4df7f428..1168b35e 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index c61a7bb1..dd4a854d 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index a1725b7e..018f1502 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index 38ed4ace..7b03650b 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index b42be120..fde76c7f 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index 1dc8ffc0..b2d8373a 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 0bb7bbfd..c955c25e 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index a31dc547..7292cc70 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index a893a729..4bedaffe 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index af78b76f..3768e484 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index 7b311a12..6beda68c 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index 8aae5cd9..3ae323c1 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index b8fd3d66..047e06b3 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index 7e15fce3..1f88fb07 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 10c206cc..9eaae852 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index 3e653237..484abf7d 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index e4792940..30f58a60 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index ae5b7f69..139fcee4 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Out.c b/bootstrap/windows-48/Out.c index 6336cff6..0e7bc573 100644 --- a/bootstrap/windows-48/Out.c +++ b/bootstrap/windows-48/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Out.h b/bootstrap/windows-48/Out.h index d4033209..3788e8db 100644 --- a/bootstrap/windows-48/Out.h +++ b/bootstrap/windows-48/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 82b21cb5..ef701d09 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index c2f0defe..2b9706ac 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 98cd4d23..9ee944a0 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index 7720227f..38931e4d 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index aa3d856b..0c6b1c30 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index ecd78a84..5d12e02b 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index 64448cf9..a0a4c4af 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index 5bf3762f..5e562845 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/VT100.c b/bootstrap/windows-48/VT100.c index e7bde10b..73440da9 100644 --- a/bootstrap/windows-48/VT100.c +++ b/bootstrap/windows-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/VT100.h b/bootstrap/windows-48/VT100.h index 3d141927..62917b5a 100644 --- a/bootstrap/windows-48/VT100.h +++ b/bootstrap/windows-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index 49f9d0d8..5d56a636 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index 13fb27dd..f93b0cab 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/Compiler.c b/bootstrap/windows-88/Compiler.c index 3b38d219..6ed43e4c 100644 --- a/bootstrap/windows-88/Compiler.c +++ b/bootstrap/windows-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index c44f113b..412d61c7 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index 4f9fce60..2d35c30b 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 4e274d67..5e166225 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 0be7189d..09267a36 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index ed882a7f..f5e50be6 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index 77c7815a..6c8b35e6 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 53157142..0d08cf59 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index ecfe6a4f..8f14d6de 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index b42be120..fde76c7f 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index 1dc8ffc0..b2d8373a 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index 0bb7bbfd..c955c25e 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index a31dc547..7292cc70 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index f25303f2..1c057aa5 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index af78b76f..3768e484 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index a2aa3ed3..049893b4 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index 8aae5cd9..3ae323c1 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index b8fd3d66..047e06b3 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index 7e15fce3..1f88fb07 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index 10f74ed9..4ff8bb16 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 3e653237..484abf7d 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index f1dd5a74..f0146564 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index ae5b7f69..139fcee4 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Out.c b/bootstrap/windows-88/Out.c index 6336cff6..0e7bc573 100644 --- a/bootstrap/windows-88/Out.c +++ b/bootstrap/windows-88/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Out.h b/bootstrap/windows-88/Out.h index d4033209..3788e8db 100644 --- a/bootstrap/windows-88/Out.h +++ b/bootstrap/windows-88/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 5da8bd9d..57d0a77d 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index 17c80af3..6a1a89ee 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 98cd4d23..9ee944a0 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index 7720227f..38931e4d 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index aa3d856b..0c6b1c30 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index ecd78a84..5d12e02b 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index cbaf0ead..6e34c257 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index 4a529d81..a7c894bd 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/VT100.c b/bootstrap/windows-88/VT100.c index e7bde10b..73440da9 100644 --- a/bootstrap/windows-88/VT100.c +++ b/bootstrap/windows-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/VT100.h b/bootstrap/windows-88/VT100.h index 3d141927..62917b5a 100644 --- a/bootstrap/windows-88/VT100.h +++ b/bootstrap/windows-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index 49f9d0d8..5d56a636 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index 13fb27dd..f93b0cab 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/src/runtime/SYSTEM.c b/src/runtime/SYSTEM.c index a1b2cb14..2952bb66 100644 --- a/src/runtime/SYSTEM.c +++ b/src/runtime/SYSTEM.c @@ -151,53 +151,61 @@ SYSTEM_PTR SYSTEM_NEWARR(ADDRESS *typ, ADDRESS elemsz, int elemalgn, int nofdim, return x; } - - - typedef void (*SystemSignalHandler)(INT32); // = Platform_SignalHandler #ifndef _WIN32 + // Unix signal handling + SystemSignalHandler handler[10] = {0}; // Adjust the array size to include signal 11 - SystemSignalHandler handler[3] = {0}; - - // Provide signal handling for Unix based systems + void segfaultHandler(int signal) { + __HALT(-10); + } + // Revised signal handler to accommodate additional signals like SIGSEGV void signalHandler(int s) { - if (s >= 2 && s <= 4) handler[s-2](s); - // (Ignore other signals) + if ((s >= 2 && s <= 4) || s == 11) { // Include SIGSEGV (usually signal 11) + if (handler[s-2]) { + handler[s-2](s); + } + } + // Ignore other signals } void SystemSetHandler(int s, ADDRESS h) { - if (s >= 2 && s <= 4) { + if ((s >= 2 && s <= 4) || s == 11) { int needtosetsystemhandler = handler[s-2] == 0; handler[s-2] = (SystemSignalHandler)h; - if (needtosetsystemhandler) {signal(s, signalHandler);} + if (needtosetsystemhandler) { + signal(s, signalHandler); + } } } -#else + void setupAutomaticSegfaultHandler() { + SystemSetHandler(11, (ADDRESS)segfaultHandler); // Register handler for SIGSEGV + } - // Provides Windows callback handlers for signal-like scenarios +#else + // Windows system remains as is since Windows does not use SIGSEGV in the same way #include "WindowsWrapper.h" SystemSignalHandler SystemInterruptHandler = 0; - SystemSignalHandler SystemQuitHandler = 0; + SystemSignalHandler SystemQuitHandler = 0; BOOL ConsoleCtrlHandlerSet = FALSE; BOOL WINAPI SystemConsoleCtrlHandler(DWORD ctrlType) { if ((ctrlType == CTRL_C_EVENT) || (ctrlType == CTRL_BREAK_EVENT)) { if (SystemInterruptHandler) { - SystemInterruptHandler(2); // SIGINT + SystemInterruptHandler(2); // SIGINT return TRUE; } - } else { // Close, logoff or shutdown + } else { if (SystemQuitHandler) { - SystemQuitHandler(3); // SIGQUIT + SystemQuitHandler(3); // SIGQUIT return TRUE; } } return FALSE; } - void EnsureConsoleCtrlHandler() { if (!ConsoleCtrlHandlerSet) { SetConsoleCtrlHandler(SystemConsoleCtrlHandler, TRUE); @@ -216,3 +224,4 @@ typedef void (*SystemSignalHandler)(INT32); // = Platform_SignalHandler } #endif + diff --git a/src/runtime/SYSTEM.h b/src/runtime/SYSTEM.h index 07c6fd10..68e2e335 100644 --- a/src/runtime/SYSTEM.h +++ b/src/runtime/SYSTEM.h @@ -265,7 +265,10 @@ extern void Heap_INCREF(); extern void Modules_Init(INT32 argc, ADDRESS argv); extern void Heap_FINALL(); -#define __INIT(argc, argv) static void *m; Modules_Init(argc, (ADDRESS)&argv); +extern void setupAutomaticSegfaultHandler(); + +#define __INIT(argc, argv) static void *m; setupAutomaticSegfaultHandler(); Modules_Init(argc, (ADDRESS)&argv); + #define __REGMAIN(name, enum) m = Heap_REGMOD((CHAR*)name,enum) #define __FINI Heap_FINALL(); return 0 From e189882af813c40b662925801302825fe74a5b6c Mon Sep 17 00:00:00 2001 From: Antranig Vartanian Date: Sat, 11 May 2024 21:43:22 +0400 Subject: [PATCH 542/580] set language to Oberon --- .gitattributes | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitattributes b/.gitattributes index 08b0dbe0..0b277fd3 100644 --- a/.gitattributes +++ b/.gitattributes @@ -34,3 +34,7 @@ *.Mod diff=pascal *.c diff=cpp *.h diff=cpp + +# Set the language to Oberon +*.Mod linguist-language=Oberon +*.mod linguist-language=Oberon From 8d2d479664a4b45c9fd93f268b3c53b2d97e8d68 Mon Sep 17 00:00:00 2001 From: Norayr Chilingarian Date: Fri, 23 Aug 2024 13:51:15 +0400 Subject: [PATCH 543/580] unix nil check won't prevent windows builds. --- bootstrap/SYSTEM.h | 6 ++++-- bootstrap/unix-44/Compiler.c | 2 +- bootstrap/unix-44/Configuration.c | 4 ++-- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Files.c | 2 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 2 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 2 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 2 +- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 2 +- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 2 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Out.c | 2 +- bootstrap/unix-44/Out.h | 2 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/VT100.c | 2 +- bootstrap/unix-44/VT100.h | 2 +- bootstrap/unix-44/extTools.c | 2 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-48/Compiler.c | 2 +- bootstrap/unix-48/Configuration.c | 4 ++-- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Files.c | 2 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 2 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 2 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 2 +- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 2 +- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 2 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Out.c | 2 +- bootstrap/unix-48/Out.h | 2 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/VT100.c | 2 +- bootstrap/unix-48/VT100.h | 2 +- bootstrap/unix-48/extTools.c | 2 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-88/Compiler.c | 2 +- bootstrap/unix-88/Configuration.c | 4 ++-- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Files.c | 2 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 2 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 2 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 2 +- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 2 +- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 2 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Out.c | 2 +- bootstrap/unix-88/Out.h | 2 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/VT100.c | 2 +- bootstrap/unix-88/VT100.h | 2 +- bootstrap/unix-88/extTools.c | 2 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/windows-48/Compiler.c | 2 +- bootstrap/windows-48/Configuration.c | 4 ++-- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Files.c | 2 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 2 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 2 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 2 +- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 2 +- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 2 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Out.c | 2 +- bootstrap/windows-48/Out.h | 2 +- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/VT100.c | 2 +- bootstrap/windows-48/VT100.h | 2 +- bootstrap/windows-48/extTools.c | 2 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-88/Compiler.c | 2 +- bootstrap/windows-88/Configuration.c | 4 ++-- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Files.c | 2 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 2 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 2 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 2 +- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 2 +- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 2 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Out.c | 2 +- bootstrap/windows-88/Out.h | 2 +- bootstrap/windows-88/Platform.c | 2 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/VT100.c | 2 +- bootstrap/windows-88/VT100.h | 2 +- bootstrap/windows-88/extTools.c | 2 +- bootstrap/windows-88/extTools.h | 2 +- src/runtime/SYSTEM.h | 6 ++++-- 187 files changed, 198 insertions(+), 194 deletions(-) diff --git a/bootstrap/SYSTEM.h b/bootstrap/SYSTEM.h index 68e2e335..2ecdc7f9 100644 --- a/bootstrap/SYSTEM.h +++ b/bootstrap/SYSTEM.h @@ -266,9 +266,11 @@ extern void Modules_Init(INT32 argc, ADDRESS argv); extern void Heap_FINALL(); extern void setupAutomaticSegfaultHandler(); - +#ifndef _WIN32 #define __INIT(argc, argv) static void *m; setupAutomaticSegfaultHandler(); Modules_Init(argc, (ADDRESS)&argv); - +#else +#define __INIT(argc, argv) static void *m; Modules_Init(argc, (ADDRESS)&argv); +#endif #define __REGMAIN(name, enum) m = Heap_REGMOD((CHAR*)name,enum) #define __FINI Heap_FINALL(); return 0 diff --git a/bootstrap/unix-44/Compiler.c b/bootstrap/unix-44/Compiler.c index 6ed43e4c..1807e545 100644 --- a/bootstrap/unix-44/Compiler.c +++ b/bootstrap/unix-44/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index 412d61c7..fb7a8f35 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index 2d35c30b..c8bae246 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index a52f7d8d..7ce57bc2 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index cb58b0ac..3622bbe7 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index 1168b35e..df721094 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index dd4a854d..dbc11b6f 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index e1f64512..00137463 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index 7b03650b..22468d7d 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index fde76c7f..4d4925c6 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index b2d8373a..cb41ad3d 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index c955c25e..dc9da7db 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index 7292cc70..fd7ddb5e 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 4bedaffe..d2462ff6 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index 3768e484..14ef9200 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index 6beda68c..2bbed37b 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index 3ae323c1..5980afc3 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index 047e06b3..95456407 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index 1f88fb07..f4851b8a 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index c546c53d..9e34302b 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index 484abf7d..d2f8d9fe 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index 30f58a60..ecef063d 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index 139fcee4..44652222 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Out.c b/bootstrap/unix-44/Out.c index 6a68a636..d5a45e43 100644 --- a/bootstrap/unix-44/Out.c +++ b/bootstrap/unix-44/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Out.h b/bootstrap/unix-44/Out.h index 3788e8db..a008c089 100644 --- a/bootstrap/unix-44/Out.h +++ b/bootstrap/unix-44/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 3e4cef6a..61463b51 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index 93fa209a..89ce40d3 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 9ee944a0..f4cc31eb 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index 38931e4d..04ff0d7c 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index 0c6b1c30..629009fa 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index 5d12e02b..6acdef43 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index 957f87f3..369d0244 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index 89cee481..3c805fbe 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/VT100.c b/bootstrap/unix-44/VT100.c index 73440da9..c5e8a3ba 100644 --- a/bootstrap/unix-44/VT100.c +++ b/bootstrap/unix-44/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/VT100.h b/bootstrap/unix-44/VT100.h index 62917b5a..94b7b846 100644 --- a/bootstrap/unix-44/VT100.h +++ b/bootstrap/unix-44/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index 5d56a636..cf90fa2a 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index f93b0cab..6b1b37eb 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/Compiler.c b/bootstrap/unix-48/Compiler.c index 6ed43e4c..1807e545 100644 --- a/bootstrap/unix-48/Compiler.c +++ b/bootstrap/unix-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index 412d61c7..fb7a8f35 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index 2d35c30b..c8bae246 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index a52f7d8d..7ce57bc2 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index cb58b0ac..3622bbe7 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index 1168b35e..df721094 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index dd4a854d..dbc11b6f 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index e1f64512..00137463 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index 7b03650b..22468d7d 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index fde76c7f..4d4925c6 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index b2d8373a..cb41ad3d 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index c955c25e..dc9da7db 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index 7292cc70..fd7ddb5e 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 4bedaffe..d2462ff6 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index 3768e484..14ef9200 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index 6beda68c..2bbed37b 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index 3ae323c1..5980afc3 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index 047e06b3..95456407 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index 1f88fb07..f4851b8a 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 9eaae852..85b0ef1c 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index 484abf7d..d2f8d9fe 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index 30f58a60..ecef063d 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index 139fcee4..44652222 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Out.c b/bootstrap/unix-48/Out.c index 6a68a636..d5a45e43 100644 --- a/bootstrap/unix-48/Out.c +++ b/bootstrap/unix-48/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Out.h b/bootstrap/unix-48/Out.h index 3788e8db..a008c089 100644 --- a/bootstrap/unix-48/Out.h +++ b/bootstrap/unix-48/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 3e4cef6a..61463b51 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index 93fa209a..89ce40d3 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 9ee944a0..f4cc31eb 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index 38931e4d..04ff0d7c 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index 0c6b1c30..629009fa 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index 5d12e02b..6acdef43 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index a0a4c4af..2b57b307 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index 5e562845..75712cc1 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/VT100.c b/bootstrap/unix-48/VT100.c index 73440da9..c5e8a3ba 100644 --- a/bootstrap/unix-48/VT100.c +++ b/bootstrap/unix-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/VT100.h b/bootstrap/unix-48/VT100.h index 62917b5a..94b7b846 100644 --- a/bootstrap/unix-48/VT100.h +++ b/bootstrap/unix-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index 5d56a636..cf90fa2a 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index f93b0cab..6b1b37eb 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/Compiler.c b/bootstrap/unix-88/Compiler.c index 6ed43e4c..1807e545 100644 --- a/bootstrap/unix-88/Compiler.c +++ b/bootstrap/unix-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index 412d61c7..fb7a8f35 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index 2d35c30b..c8bae246 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index a2496e99..940170c8 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index f4aff9ce..375065c6 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index f5e50be6..980fab89 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index 6c8b35e6..e188739a 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 8db0dde1..011ac733 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index 8f14d6de..34d0e538 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index fde76c7f..4d4925c6 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index b2d8373a..cb41ad3d 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index c955c25e..dc9da7db 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index 7292cc70..fd7ddb5e 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 1c057aa5..f298d2d5 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index 3768e484..14ef9200 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index 049893b4..f98062ab 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index 3ae323c1..5980afc3 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index 047e06b3..95456407 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index 1f88fb07..f4851b8a 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index 4ff8bb16..3b837866 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 484abf7d..d2f8d9fe 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index f0146564..2535e861 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index 139fcee4..44652222 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Out.c b/bootstrap/unix-88/Out.c index 6a68a636..d5a45e43 100644 --- a/bootstrap/unix-88/Out.c +++ b/bootstrap/unix-88/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Out.h b/bootstrap/unix-88/Out.h index 3788e8db..a008c089 100644 --- a/bootstrap/unix-88/Out.h +++ b/bootstrap/unix-88/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 6bafee5a..c545b975 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index 2e63d516..c6cd7505 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 9ee944a0..f4cc31eb 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index 38931e4d..04ff0d7c 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index 0c6b1c30..629009fa 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index 5d12e02b..6acdef43 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index 6e34c257..291ccf2b 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index a7c894bd..56bb9359 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/VT100.c b/bootstrap/unix-88/VT100.c index 73440da9..c5e8a3ba 100644 --- a/bootstrap/unix-88/VT100.c +++ b/bootstrap/unix-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/VT100.h b/bootstrap/unix-88/VT100.h index 62917b5a..94b7b846 100644 --- a/bootstrap/unix-88/VT100.h +++ b/bootstrap/unix-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index 5d56a636..cf90fa2a 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index f93b0cab..6b1b37eb 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/Compiler.c b/bootstrap/windows-48/Compiler.c index 6ed43e4c..1807e545 100644 --- a/bootstrap/windows-48/Compiler.c +++ b/bootstrap/windows-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index 412d61c7..fb7a8f35 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index 2d35c30b..c8bae246 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 723046f3..15dcd35d 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index f30b79bd..6d39b035 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index 1168b35e..df721094 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index dd4a854d..dbc11b6f 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index 018f1502..35b801dc 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index 7b03650b..22468d7d 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index fde76c7f..4d4925c6 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index b2d8373a..cb41ad3d 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index c955c25e..dc9da7db 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index 7292cc70..fd7ddb5e 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 4bedaffe..d2462ff6 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index 3768e484..14ef9200 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index 6beda68c..2bbed37b 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index 3ae323c1..5980afc3 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index 047e06b3..95456407 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index 1f88fb07..f4851b8a 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 9eaae852..85b0ef1c 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index 484abf7d..d2f8d9fe 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index 30f58a60..ecef063d 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index 139fcee4..44652222 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Out.c b/bootstrap/windows-48/Out.c index 0e7bc573..d8b08478 100644 --- a/bootstrap/windows-48/Out.c +++ b/bootstrap/windows-48/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Out.h b/bootstrap/windows-48/Out.h index 3788e8db..a008c089 100644 --- a/bootstrap/windows-48/Out.h +++ b/bootstrap/windows-48/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index ef701d09..e57cfbc4 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index 2b9706ac..543943d3 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 9ee944a0..f4cc31eb 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index 38931e4d..04ff0d7c 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index 0c6b1c30..629009fa 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index 5d12e02b..6acdef43 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index a0a4c4af..2b57b307 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index 5e562845..75712cc1 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/VT100.c b/bootstrap/windows-48/VT100.c index 73440da9..c5e8a3ba 100644 --- a/bootstrap/windows-48/VT100.c +++ b/bootstrap/windows-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/VT100.h b/bootstrap/windows-48/VT100.h index 62917b5a..94b7b846 100644 --- a/bootstrap/windows-48/VT100.h +++ b/bootstrap/windows-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index 5d56a636..cf90fa2a 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index f93b0cab..6b1b37eb 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/Compiler.c b/bootstrap/windows-88/Compiler.c index 6ed43e4c..1807e545 100644 --- a/bootstrap/windows-88/Compiler.c +++ b/bootstrap/windows-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index 412d61c7..fb7a8f35 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index 2d35c30b..c8bae246 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 5e166225..5412cd99 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 09267a36..2bbdcf3c 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index f5e50be6..980fab89 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index 6c8b35e6..e188739a 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 0d08cf59..8617e065 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index 8f14d6de..34d0e538 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index fde76c7f..4d4925c6 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index b2d8373a..cb41ad3d 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index c955c25e..dc9da7db 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index 7292cc70..fd7ddb5e 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 1c057aa5..f298d2d5 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index 3768e484..14ef9200 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index 049893b4..f98062ab 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index 3ae323c1..5980afc3 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index 047e06b3..95456407 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index 1f88fb07..f4851b8a 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index 4ff8bb16..3b837866 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 484abf7d..d2f8d9fe 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index f0146564..2535e861 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index 139fcee4..44652222 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Out.c b/bootstrap/windows-88/Out.c index 0e7bc573..d8b08478 100644 --- a/bootstrap/windows-88/Out.c +++ b/bootstrap/windows-88/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Out.h b/bootstrap/windows-88/Out.h index 3788e8db..a008c089 100644 --- a/bootstrap/windows-88/Out.h +++ b/bootstrap/windows-88/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 57d0a77d..358785ee 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index 6a1a89ee..7bd26e48 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 9ee944a0..f4cc31eb 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index 38931e4d..04ff0d7c 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index 0c6b1c30..629009fa 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index 5d12e02b..6acdef43 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index 6e34c257..291ccf2b 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index a7c894bd..56bb9359 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/VT100.c b/bootstrap/windows-88/VT100.c index 73440da9..c5e8a3ba 100644 --- a/bootstrap/windows-88/VT100.c +++ b/bootstrap/windows-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/VT100.h b/bootstrap/windows-88/VT100.h index 62917b5a..94b7b846 100644 --- a/bootstrap/windows-88/VT100.h +++ b/bootstrap/windows-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index 5d56a636..cf90fa2a 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index f93b0cab..6b1b37eb 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/04/13]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/src/runtime/SYSTEM.h b/src/runtime/SYSTEM.h index 68e2e335..2ecdc7f9 100644 --- a/src/runtime/SYSTEM.h +++ b/src/runtime/SYSTEM.h @@ -266,9 +266,11 @@ extern void Modules_Init(INT32 argc, ADDRESS argv); extern void Heap_FINALL(); extern void setupAutomaticSegfaultHandler(); - +#ifndef _WIN32 #define __INIT(argc, argv) static void *m; setupAutomaticSegfaultHandler(); Modules_Init(argc, (ADDRESS)&argv); - +#else +#define __INIT(argc, argv) static void *m; Modules_Init(argc, (ADDRESS)&argv); +#endif #define __REGMAIN(name, enum) m = Heap_REGMOD((CHAR*)name,enum) #define __FINI Heap_FINALL(); return 0 From 7d14452a51fd4d9c05018e8607a9e2147edc3e89 Mon Sep 17 00:00:00 2001 From: "T. Kurt Bond" Date: Fri, 17 Jan 2025 08:10:47 -0500 Subject: [PATCH 544/580] Don't try to uninstall the shared libraries unless the directory exists. Otherwise it fails on OpenBSD during the first installation with: ldconfig: /usr/local/sw/versions/voc/git/lib: No such file or directory --- src/tools/make/oberon.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/make/oberon.mk b/src/tools/make/oberon.mk index dd1610bb..04d08af6 100644 --- a/src/tools/make/oberon.mk +++ b/src/tools/make/oberon.mk @@ -189,8 +189,8 @@ installable: uninstall: installable @printf '\nUninstalling from \"$(INSTALLDIR)\"\n' + @[ -d "$(INSTALLDIR)/lib" ] && sh src/tools/make/addlibrary.sh uninstall "$(INSTALLDIR)/lib" $(ONAME) || echo nolibdir, skipping rm -rf "$(INSTALLDIR)" - @sh src/tools/make/addlibrary.sh uninstall "$(INSTALLDIR)/lib" $(ONAME) # install: Use only after a successful full build. Installs the compiler From afe5a2d824ab1f180f0403c645c99851ee539662 Mon Sep 17 00:00:00 2001 From: Norayr Chilingarian Date: Fri, 21 Feb 2025 04:48:39 +0400 Subject: [PATCH 545/580] now test server can listen on any ipv4 address. --- src/compiler/OPV.Mod | 107 ++++++++++++++++++++++----------- src/test/server/s.Mod | 15 +++-- src/test/server/sockets.Mod | 115 ++++++++++++++++++------------------ 3 files changed, 141 insertions(+), 96 deletions(-) diff --git a/src/compiler/OPV.Mod b/src/compiler/OPV.Mod index c6b26c05..2239bfe3 100644 --- a/src/compiler/OPV.Mod +++ b/src/compiler/OPV.Mod @@ -6,7 +6,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 various promotion rules changed (long) => (LONGINT), xxxL avoided *) - IMPORT OPT, OPC, OPM, OPS, SYSTEM; + IMPORT OPT, OPC, OPM, OPS, VT100, Strings, SYSTEM; CONST UndefinedType = 0; (* named type not yet defined *) @@ -28,6 +28,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 GuardPtrFunc = "__GUARDP("; GuardRecFunc = "__GUARDR("; TypeFunc = "__TYPEOF("; + SetOfFunc = "__SETOF("; CopyFunc = "__COPY("; MoveFunc = "__MOVE("; GetFunc = "__GET("; @@ -44,7 +45,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 TYPE ExitInfo = RECORD level, label: INTEGER END ; - + tmpName = POINTER TO ARRAY 32 OF CHAR; VAR stamp: INTEGER; (* unique number for nested objects *) @@ -52,6 +53,20 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 exit: ExitInfo; (* to check if EXIT is simply a break *) nofExitLabels: INTEGER; + tempCounter: INTEGER; (* to generate unique temp names *) + + PROCEDURE uniqueTempName(): tmpName; + VAR + num: ARRAY 8 OF CHAR; + tempName: tmpName; + BEGIN + INC(tempCounter); + NEW(tempName); + COPY("_voc_tmp_", tempName^); + VT100.IntToStr(tempCounter, num); + Strings.Append(num, tempName^); + RETURN tempName; + END uniqueTempName; PROCEDURE Init*; BEGIN @@ -196,7 +211,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 OPT.bit, OPT.lsh, OPT.rot: RETURN 10 - ELSE OPM.LogWStr("unhandled case in OPV.Precedence OPT.Ndop, subclass = "); OPM.LogWNum(subclass, 0); OPM.LogWLn; + ELSE OPM.LogWStr("unhandled case in OPV.Precedence OPT.Ndop, subclass = "); OPM.LogWNum(subclass, 0); OPM.LogWLn; END; | OPT.Nupto: RETURN 10 | OPT.Ntype, @@ -214,13 +229,13 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 BEGIN WHILE (n^.class = OPT.Nindex) & (n^.typ^.comp = OPT.DynArr(*26.7.2002*)) DO INC(dim); n := n^.left END ; IF (n^.class = OPT.Nderef) & (n^.typ^.comp = OPT.DynArr) THEN - d := dim; array := n^.typ; - WHILE d > 0 DO array := array^.BaseTyp; DEC(d) END; - IF array^.comp = OPT.DynArr THEN + d := dim; array := n^.typ; + WHILE d > 0 DO array := array^.BaseTyp; DEC(d) END; + IF array^.comp = OPT.DynArr THEN design(n^.left, 10); OPM.WriteString("->len["); OPM.WriteInt(dim); OPM.Write("]") - ELSE + ELSE OPM.WriteInt(array^.n) - END + END ELSE OPC.Len(n^.obj, n^.typ, dim) END @@ -255,27 +270,39 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 END END SizeCast; - PROCEDURE Convert(n: OPT.Node; newtype: OPT.Struct; prec: INTEGER); - VAR from, to: INTEGER; - BEGIN from := n^.typ^.form; to := newtype.form; - IF to = OPT.Set THEN - IF from = OPT.Set THEN (* Sets of different size *) - SizeCast(n, newtype.size); - ELSE (* Set from integer *) - OPM.WriteString("__SETOF("); Entier(n, MinPrec); - OPM.WriteString(","); OPM.WriteInt(newtype.size*8); OPM.Write(CloseParen) - END - ELSIF to = OPT.Int THEN (* integers of different size *) +PROCEDURE Convert(n: OPT.Node; newtype: OPT.Struct; prec: INTEGER); +VAR + from, to: INTEGER; + tempName: tmpName; + tempIndex: INTEGER; (* New variable to manage temporary indexes *) +BEGIN + from := n^.typ^.form; + to := newtype.form; + + IF to = OPT.Set THEN + tempName := uniqueTempName(); + tempIndex := 0; (* Initialize temp index *) + OPM.WriteString("UINT32 "); OPM.WriteString(tempName^); OPM.WriteString(" = 0;"); (* Correctly initialize variable *) + OPM.WriteLn; + + IF from = OPT.Set THEN SizeCast(n, newtype.size); - ELSIF to = OPT.Char THEN - IF OPM.ranchk IN OPM.Options THEN OPM.WriteString("__CHR"); - IF SideEffects(n) THEN OPM.Write("F") END ; - OPM.Write(OpenParen); Entier(n, MinPrec); OPM.Write(CloseParen) - ELSE OPM.WriteString("(CHAR)"); Entier(n, 9) - END - ELSE expr(n, prec) + ELSE + OPM.WriteString(tempName^); OPM.WriteString(" = __SETOF("); + Entier(n, MinPrec); + OPM.WriteString(","); + OPM.WriteInt(newtype.size * 8); + OPM.WriteString(");"); + OPM.WriteLn; + OPM.WriteString("i |= "); OPM.WriteString(tempName^); OPM.WriteString(";"); (* Ensure 'i' is declared *) END - END Convert; + ELSIF to = OPT.Int THEN + SizeCast(n, newtype.size); + ELSE + expr(n, prec); + END +END Convert; + PROCEDURE TypeOf(n: OPT.Node); BEGIN @@ -576,7 +603,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 IF SideEffects(n) THEN OPM.WriteString("__MODF(") ELSE OPM.WriteString("__MOD(") END; - ELSE OPM.LogWStr("unhandled case in OPV.expr, subclass = "); OPM.LogWNum(subclass, 0); OPM.LogWLn; + ELSE OPM.LogWStr("unhandled case in OPV.expr, subclass = "); OPM.LogWNum(subclass, 0); OPM.LogWLn; END ; expr(l, MinPrec); OPM.WriteString(Comma); @@ -622,10 +649,10 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 ELSE OPM.WriteString(" - ") END; | OPS.or: OPM.WriteString(" || "); - ELSE OPM.LogWStr("unhandled case in OPV.expr, subclass = "); OPM.LogWNum(subclass, 0); OPM.LogWLn; + ELSE OPM.LogWStr("unhandled case in OPV.expr, subclass = "); OPM.LogWNum(subclass, 0); OPM.LogWLn; END; expr(r, exprPrec); - IF (subclass = OPS.and) OR ((form = OPT.Set) & ((subclass = OPS.times) OR (subclass = OPS.minus))) THEN OPM.Write(CloseParen) END; (* to silence clang warnings, -- noch*) + IF (subclass = OPS.and) OR ((form = OPT.Set) & ((subclass = OPS.times) OR (subclass = OPS.minus))) THEN OPM.Write(CloseParen) END; (* to silence clang warnings, -- noch*) END | OPT.Ncall: IF (l^.obj # NIL) & (l^.obj^.mode = OPT.TProc) THEN IF l^.subcl = OPT.super THEN proc := SuperProc(n) @@ -769,6 +796,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 PROCEDURE stat(n: OPT.Node; outerProc: OPT.Object); VAR proc: OPT.Object; saved: ExitInfo; l, r: OPT.Node; + tempName, tempVar: tmpName; BEGIN WHILE (n # NIL) & OPM.noerr DO OPM.errpos := OPM.Longint(n^.conval^.intval); @@ -833,9 +861,17 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 | OPT.incfn, OPT.decfn: expr(n^.left, MinPrec); OPC.Increment(n^.subcl = OPT.decfn); expr(n^.right, MinPrec) | OPT.inclfn, - OPT.exclfn: expr(n^.left, MinPrec); OPC.SetInclude(n^.subcl = OPT.exclfn); - OPM.WriteString("__SETOF("); expr(n^.right, MinPrec); - OPM.WriteString(","); OPM.WriteInt(n.left.typ.size*8); OPM.Write(CloseParen) + OPT.exclfn: + tempName := uniqueTempName(); + OPM.WriteString("UINT32 "); OPM.WriteString(tempName^); OPM.WriteString(";"); + OPM.WriteLn; + + OPM.WriteString(tempName^); OPM.WriteString(" = __SETOF("); + expr(n^.right, MinPrec); + OPM.WriteString(","); OPM.WriteInt(n.left.typ.size * 8); + OPM.WriteString(");"); + OPM.WriteLn; + OPM.WriteString("i |= "); OPM.WriteString(tempName^); OPM.WriteString(";"); | OPT.copyfn: OPM.WriteString(CopyFunc); expr(n^.right, MinPrec); OPM.WriteString(Comma); expr(n^.left, MinPrec); OPM.WriteString(Comma); Len(n^.left, 0); OPM.Write(CloseParen) @@ -857,7 +893,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 design(n^.left, MinPrec); OPM.WriteString(", "); expr(n^.right, MinPrec); OPM.Write(")") - ELSE OPM.LogWStr("unhandled case in OPV.expr, n^.subcl = "); OPM.LogWNum(n^.subcl, 0); OPM.LogWLn; + ELSE OPM.LogWStr("unhandled case in OPV.expr, n^.subcl = "); OPM.LogWNum(n^.subcl, 0); OPM.LogWLn; END | OPT.Ncall: IF (n^.left^.obj # NIL) & (n^.left^.obj^.mode = OPT.TProc) THEN IF n^.left^.subcl = OPT.super THEN proc := SuperProc(n) @@ -931,4 +967,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 OPC.GenBdy(prog^.right); stat(prog, NIL) END Module; +BEGIN + tempCounter := 0 + END OPV. diff --git a/src/test/server/s.Mod b/src/test/server/s.Mod index be04d59e..38a92496 100644 --- a/src/test/server/s.Mod +++ b/src/test/server/s.Mod @@ -4,7 +4,7 @@ IMPORT sockets, types, Out := Console, SYSTEM, Platform, Strings; PROCEDURE DoSmth(sock: Platform.FileHandle); -VAR +VAR str, aff: ARRAY 256 OF CHAR; n: LONGINT; BEGIN @@ -15,7 +15,7 @@ BEGIN ELSE str[n] := 0X; (* Make sure that received message is zero terminated *) Out.String("received message is "); Out.String(str); Out.Ln; - + IF Platform.Write(sock, SYSTEM.ADR(aff), Strings.Length(aff)) # 0 THEN Out.String("error writing to socket"); Out.Ln END; @@ -29,16 +29,17 @@ PROCEDURE -fork(): LONGINT "(LONGINT)fork()"; PROCEDURE serve; -CONST +CONST Port = 2055; MaxQueue = 5; -VAR +VAR sockfd: LONGINT; newsockfd: LONGINT; ServAddr: sockets.SockAddrIn; pid: LONGINT; res: Platform.ErrorCode; sockaddrlen: LONGINT; + ipAddr: LONGINT; ip: ARRAY 16 OF CHAR; BEGIN sockfd := sockets.Socket(sockets.AfInet, sockets.SockStream, 0); IF sockfd < 0 THEN @@ -47,15 +48,17 @@ BEGIN Out.String("socket created.") END; Out.Ln; + COPY("127.0.0.1", ip); + ipAddr := sockets.inetaddr(ip); - sockets.SetSockAddrIn(sockets.AfInet, Port, 0, ServAddr); + sockets.SetSockAddrIn(sockets.AfInet, Port, ipAddr, ServAddr); IF sockets.Bind(sockfd, SYSTEM.VAL(sockets.SockAddr, ServAddr), SIZE(sockets.SockAddr)) < 0 THEN Out.String("error on binding") ELSE Out.String("binding completed.") END; Out.Ln; - + IF sockets.Listen(sockfd, MaxQueue) # 0 THEN Out.String("listen() failed"); ELSE diff --git a/src/test/server/sockets.Mod b/src/test/server/sockets.Mod index 58ff3c24..ded7a61f 100644 --- a/src/test/server/sockets.Mod +++ b/src/test/server/sockets.Mod @@ -2,60 +2,60 @@ MODULE sockets; IMPORT SYSTEM, oocC; -CONST - SockStream* = 1; - SockDgram* = 2; - SockRaw* = 3; - SockRdm* = 4; - SockSeqpacket* = 5; - SockDccp* = 6; - SockPacket* = 10; - - AfUnscec* = 0; (* Unspecified. *) - AfLocal* = 1; (* Local to host (pipes and file-domain). *) - AfUnix* = 1; (* POSIX name for PF_LOCAL. *) - AfFile* = 1; (* Another non-standard name for PF_LOCAL. *) - AfInet* = 2; (* IP protocol family. *) - AfAx25* = 3; (* Amateur Radio AX.25. *) - AfIpx* = 4; (* Novell Internet Protocol. *) - AfAppletalk* = 5; (* Appletalk DDP. *) - AfNetrom* = 6; (* Amateur radio NetROM. *) - AfBridge* = 7; (* Multiprotocol bridge. *) - AfAtmpvc* = 8; (* ATM PVCs. *) - AfX25* = 9; (* Reserved for X.25 project. *) - AfInet6* = 10; (* IP version 6. *) - AfRose* = 11; (* Amateur Radio X.25 PLP. *) - AfDecnet* = 12; (* Reserved for DECnet project. *) - AfNetbeui* = 13; (* Reserved for 802.2LLC project. *) - AfSecurity* = 14; (* Security callback pseudo AF. *) - AfKey* = 15; (* PF_KEY key management API. *) - AfNetlink* = 16; - AfRoute* = 16; (* Alias to emulate 4.4BSD. *) - AfPacket = 17; (* Packet family. *) - AfAsh = 18; (* Ash. *) - AfEconet* = 19; (* Acorn Econet. *) - AfAtmsvc* = 20; (* ATM SVCs. *) - AfRds* = 21; (* RDS sockets. *) - AfSna = 22; (* Linux SNA Project *) - AfIrda* = 23; (* IRDA sockets. *) - AfPppox = 24; (* PPPoX sockets. *) - AfWanpipe* = 25; (* Wanpipe API sockets. *) - AfLlc* = 26; (* Linux LLC. *) - AfCan* = 29; (* Controller Area Network. *) - AfTipc* = 30; (* TIPC sockets. *) - AfBluetooth* = 31; (* Bluetooth sockets. *) - AfIucv* = 32; (* IUCV sockets. *) - AfRxrpc* = 33; (* RxRPC sockets. *) - AfIsdn* = 34; (* mISDN sockets. *) - AfPhonet* = 35; (* Phonet sockets. *) - AfIeee802154* = 36; (* IEEE 802.15.4 sockets. *) - AfCaif* = 37; (* CAIF sockets. *) - AfAlg* = 38; (* Algorithm sockets. *) - AfNfc* = 39; (* NFC sockets. *) - AfVsock* = 40; (* vSockets. *) - AfMax* = 41; (* For now.. *) - - InAddrAny* = 0; +CONST + SockStream* = 1; + SockDgram* = 2; + SockRaw* = 3; + SockRdm* = 4; + SockSeqpacket* = 5; + SockDccp* = 6; + SockPacket* = 10; + + AfUnscec* = 0; (* Unspecified. *) + AfLocal* = 1; (* Local to host (pipes and file-domain). *) + AfUnix* = 1; (* POSIX name for PF_LOCAL. *) + AfFile* = 1; (* Another non-standard name for PF_LOCAL. *) + AfInet* = 2; (* IP protocol family. *) + AfAx25* = 3; (* Amateur Radio AX.25. *) + AfIpx* = 4; (* Novell Internet Protocol. *) + AfAppletalk* = 5; (* Appletalk DDP. *) + AfNetrom* = 6; (* Amateur radio NetROM. *) + AfBridge* = 7; (* Multiprotocol bridge. *) + AfAtmpvc* = 8; (* ATM PVCs. *) + AfX25* = 9; (* Reserved for X.25 project. *) + AfInet6* = 10; (* IP version 6. *) + AfRose* = 11; (* Amateur Radio X.25 PLP. *) + AfDecnet* = 12; (* Reserved for DECnet project. *) + AfNetbeui* = 13; (* Reserved for 802.2LLC project. *) + AfSecurity* = 14; (* Security callback pseudo AF. *) + AfKey* = 15; (* PF_KEY key management API. *) + AfNetlink* = 16; + AfRoute* = 16; (* Alias to emulate 4.4BSD. *) + AfPacket = 17; (* Packet family. *) + AfAsh = 18; (* Ash. *) + AfEconet* = 19; (* Acorn Econet. *) + AfAtmsvc* = 20; (* ATM SVCs. *) + AfRds* = 21; (* RDS sockets. *) + AfSna = 22; (* Linux SNA Project *) + AfIrda* = 23; (* IRDA sockets. *) + AfPppox = 24; (* PPPoX sockets. *) + AfWanpipe* = 25; (* Wanpipe API sockets. *) + AfLlc* = 26; (* Linux LLC. *) + AfCan* = 29; (* Controller Area Network. *) + AfTipc* = 30; (* TIPC sockets. *) + AfBluetooth* = 31; (* Bluetooth sockets. *) + AfIucv* = 32; (* IUCV sockets. *) + AfRxrpc* = 33; (* RxRPC sockets. *) + AfIsdn* = 34; (* mISDN sockets. *) + AfPhonet* = 35; (* Phonet sockets. *) + AfIeee802154* = 36; (* IEEE 802.15.4 sockets. *) + AfCaif* = 37; (* CAIF sockets. *) + AfAlg* = 38; (* Algorithm sockets. *) + AfNfc* = 39; (* NFC sockets. *) + AfVsock* = 40; (* vSockets. *) + AfMax* = 41; (* For now.. *) + + InAddrAny* = 0; TYPE (* /usr/include/netinet/in.h *) @@ -70,13 +70,16 @@ TYPE SinZero*: ARRAY 8 OF CHAR; END; (* /usr/include/sys/socket.h *) - + SockAddr* = RECORD SaFamily*: oocC.shortint; SaData*: ARRAY 14 OF CHAR END; PROCEDURE -includesocket "#include "; + PROCEDURE -includeInet "#include "; + + PROCEDURE -inetaddr*(s: ARRAY OF CHAR): LONGINT "(LONGINT)inet_addr((char*)s)"; PROCEDURE -SetCShort(i: INTEGER; VAR si: oocC.shortint) "*(short*)si = i"; @@ -84,7 +87,7 @@ TYPE PROCEDURE -SetCShortSwapped(i: INTEGER; VAR si: oocC.shortint) "*(short*)si = ((i >> 8) & 0x00ff) | ((i << 8) & 0xff00)"; - PROCEDURE SetSockAddrIn*(family, port, inaddr: INTEGER; VAR sai: SockAddrIn); + PROCEDURE SetSockAddrIn*(family, port: INTEGER; inaddr: LONGINT; VAR sai: SockAddrIn); VAR i: INTEGER; BEGIN SetCShort(family, sai.SinFamily); From e36e862c8c030ebab6fdb31889623797d4d52215 Mon Sep 17 00:00:00 2001 From: Norayr Chilingarian Date: Fri, 21 Feb 2025 04:52:20 +0400 Subject: [PATCH 546/580] Revert "now test server can listen on any ipv4 address." This reverts commit afe5a2d824ab1f180f0403c645c99851ee539662. --- src/compiler/OPV.Mod | 107 +++++++++++---------------------- src/test/server/s.Mod | 15 ++--- src/test/server/sockets.Mod | 115 ++++++++++++++++++------------------ 3 files changed, 96 insertions(+), 141 deletions(-) diff --git a/src/compiler/OPV.Mod b/src/compiler/OPV.Mod index 2239bfe3..c6b26c05 100644 --- a/src/compiler/OPV.Mod +++ b/src/compiler/OPV.Mod @@ -6,7 +6,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 various promotion rules changed (long) => (LONGINT), xxxL avoided *) - IMPORT OPT, OPC, OPM, OPS, VT100, Strings, SYSTEM; + IMPORT OPT, OPC, OPM, OPS, SYSTEM; CONST UndefinedType = 0; (* named type not yet defined *) @@ -28,7 +28,6 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 GuardPtrFunc = "__GUARDP("; GuardRecFunc = "__GUARDR("; TypeFunc = "__TYPEOF("; - SetOfFunc = "__SETOF("; CopyFunc = "__COPY("; MoveFunc = "__MOVE("; GetFunc = "__GET("; @@ -45,7 +44,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 TYPE ExitInfo = RECORD level, label: INTEGER END ; - tmpName = POINTER TO ARRAY 32 OF CHAR; + VAR stamp: INTEGER; (* unique number for nested objects *) @@ -53,20 +52,6 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 exit: ExitInfo; (* to check if EXIT is simply a break *) nofExitLabels: INTEGER; - tempCounter: INTEGER; (* to generate unique temp names *) - - PROCEDURE uniqueTempName(): tmpName; - VAR - num: ARRAY 8 OF CHAR; - tempName: tmpName; - BEGIN - INC(tempCounter); - NEW(tempName); - COPY("_voc_tmp_", tempName^); - VT100.IntToStr(tempCounter, num); - Strings.Append(num, tempName^); - RETURN tempName; - END uniqueTempName; PROCEDURE Init*; BEGIN @@ -211,7 +196,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 OPT.bit, OPT.lsh, OPT.rot: RETURN 10 - ELSE OPM.LogWStr("unhandled case in OPV.Precedence OPT.Ndop, subclass = "); OPM.LogWNum(subclass, 0); OPM.LogWLn; + ELSE OPM.LogWStr("unhandled case in OPV.Precedence OPT.Ndop, subclass = "); OPM.LogWNum(subclass, 0); OPM.LogWLn; END; | OPT.Nupto: RETURN 10 | OPT.Ntype, @@ -229,13 +214,13 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 BEGIN WHILE (n^.class = OPT.Nindex) & (n^.typ^.comp = OPT.DynArr(*26.7.2002*)) DO INC(dim); n := n^.left END ; IF (n^.class = OPT.Nderef) & (n^.typ^.comp = OPT.DynArr) THEN - d := dim; array := n^.typ; - WHILE d > 0 DO array := array^.BaseTyp; DEC(d) END; - IF array^.comp = OPT.DynArr THEN + d := dim; array := n^.typ; + WHILE d > 0 DO array := array^.BaseTyp; DEC(d) END; + IF array^.comp = OPT.DynArr THEN design(n^.left, 10); OPM.WriteString("->len["); OPM.WriteInt(dim); OPM.Write("]") - ELSE + ELSE OPM.WriteInt(array^.n) - END + END ELSE OPC.Len(n^.obj, n^.typ, dim) END @@ -270,39 +255,27 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 END END SizeCast; -PROCEDURE Convert(n: OPT.Node; newtype: OPT.Struct; prec: INTEGER); -VAR - from, to: INTEGER; - tempName: tmpName; - tempIndex: INTEGER; (* New variable to manage temporary indexes *) -BEGIN - from := n^.typ^.form; - to := newtype.form; - - IF to = OPT.Set THEN - tempName := uniqueTempName(); - tempIndex := 0; (* Initialize temp index *) - OPM.WriteString("UINT32 "); OPM.WriteString(tempName^); OPM.WriteString(" = 0;"); (* Correctly initialize variable *) - OPM.WriteLn; - - IF from = OPT.Set THEN + PROCEDURE Convert(n: OPT.Node; newtype: OPT.Struct; prec: INTEGER); + VAR from, to: INTEGER; + BEGIN from := n^.typ^.form; to := newtype.form; + IF to = OPT.Set THEN + IF from = OPT.Set THEN (* Sets of different size *) + SizeCast(n, newtype.size); + ELSE (* Set from integer *) + OPM.WriteString("__SETOF("); Entier(n, MinPrec); + OPM.WriteString(","); OPM.WriteInt(newtype.size*8); OPM.Write(CloseParen) + END + ELSIF to = OPT.Int THEN (* integers of different size *) SizeCast(n, newtype.size); - ELSE - OPM.WriteString(tempName^); OPM.WriteString(" = __SETOF("); - Entier(n, MinPrec); - OPM.WriteString(","); - OPM.WriteInt(newtype.size * 8); - OPM.WriteString(");"); - OPM.WriteLn; - OPM.WriteString("i |= "); OPM.WriteString(tempName^); OPM.WriteString(";"); (* Ensure 'i' is declared *) + ELSIF to = OPT.Char THEN + IF OPM.ranchk IN OPM.Options THEN OPM.WriteString("__CHR"); + IF SideEffects(n) THEN OPM.Write("F") END ; + OPM.Write(OpenParen); Entier(n, MinPrec); OPM.Write(CloseParen) + ELSE OPM.WriteString("(CHAR)"); Entier(n, 9) + END + ELSE expr(n, prec) END - ELSIF to = OPT.Int THEN - SizeCast(n, newtype.size); - ELSE - expr(n, prec); - END -END Convert; - + END Convert; PROCEDURE TypeOf(n: OPT.Node); BEGIN @@ -603,7 +576,7 @@ END Convert; IF SideEffects(n) THEN OPM.WriteString("__MODF(") ELSE OPM.WriteString("__MOD(") END; - ELSE OPM.LogWStr("unhandled case in OPV.expr, subclass = "); OPM.LogWNum(subclass, 0); OPM.LogWLn; + ELSE OPM.LogWStr("unhandled case in OPV.expr, subclass = "); OPM.LogWNum(subclass, 0); OPM.LogWLn; END ; expr(l, MinPrec); OPM.WriteString(Comma); @@ -649,10 +622,10 @@ END Convert; ELSE OPM.WriteString(" - ") END; | OPS.or: OPM.WriteString(" || "); - ELSE OPM.LogWStr("unhandled case in OPV.expr, subclass = "); OPM.LogWNum(subclass, 0); OPM.LogWLn; + ELSE OPM.LogWStr("unhandled case in OPV.expr, subclass = "); OPM.LogWNum(subclass, 0); OPM.LogWLn; END; expr(r, exprPrec); - IF (subclass = OPS.and) OR ((form = OPT.Set) & ((subclass = OPS.times) OR (subclass = OPS.minus))) THEN OPM.Write(CloseParen) END; (* to silence clang warnings, -- noch*) + IF (subclass = OPS.and) OR ((form = OPT.Set) & ((subclass = OPS.times) OR (subclass = OPS.minus))) THEN OPM.Write(CloseParen) END; (* to silence clang warnings, -- noch*) END | OPT.Ncall: IF (l^.obj # NIL) & (l^.obj^.mode = OPT.TProc) THEN IF l^.subcl = OPT.super THEN proc := SuperProc(n) @@ -796,7 +769,6 @@ END Convert; PROCEDURE stat(n: OPT.Node; outerProc: OPT.Object); VAR proc: OPT.Object; saved: ExitInfo; l, r: OPT.Node; - tempName, tempVar: tmpName; BEGIN WHILE (n # NIL) & OPM.noerr DO OPM.errpos := OPM.Longint(n^.conval^.intval); @@ -861,17 +833,9 @@ END Convert; | OPT.incfn, OPT.decfn: expr(n^.left, MinPrec); OPC.Increment(n^.subcl = OPT.decfn); expr(n^.right, MinPrec) | OPT.inclfn, - OPT.exclfn: - tempName := uniqueTempName(); - OPM.WriteString("UINT32 "); OPM.WriteString(tempName^); OPM.WriteString(";"); - OPM.WriteLn; - - OPM.WriteString(tempName^); OPM.WriteString(" = __SETOF("); - expr(n^.right, MinPrec); - OPM.WriteString(","); OPM.WriteInt(n.left.typ.size * 8); - OPM.WriteString(");"); - OPM.WriteLn; - OPM.WriteString("i |= "); OPM.WriteString(tempName^); OPM.WriteString(";"); + OPT.exclfn: expr(n^.left, MinPrec); OPC.SetInclude(n^.subcl = OPT.exclfn); + OPM.WriteString("__SETOF("); expr(n^.right, MinPrec); + OPM.WriteString(","); OPM.WriteInt(n.left.typ.size*8); OPM.Write(CloseParen) | OPT.copyfn: OPM.WriteString(CopyFunc); expr(n^.right, MinPrec); OPM.WriteString(Comma); expr(n^.left, MinPrec); OPM.WriteString(Comma); Len(n^.left, 0); OPM.Write(CloseParen) @@ -893,7 +857,7 @@ END Convert; design(n^.left, MinPrec); OPM.WriteString(", "); expr(n^.right, MinPrec); OPM.Write(")") - ELSE OPM.LogWStr("unhandled case in OPV.expr, n^.subcl = "); OPM.LogWNum(n^.subcl, 0); OPM.LogWLn; + ELSE OPM.LogWStr("unhandled case in OPV.expr, n^.subcl = "); OPM.LogWNum(n^.subcl, 0); OPM.LogWLn; END | OPT.Ncall: IF (n^.left^.obj # NIL) & (n^.left^.obj^.mode = OPT.TProc) THEN IF n^.left^.subcl = OPT.super THEN proc := SuperProc(n) @@ -967,7 +931,4 @@ END Convert; OPC.GenBdy(prog^.right); stat(prog, NIL) END Module; -BEGIN - tempCounter := 0 - END OPV. diff --git a/src/test/server/s.Mod b/src/test/server/s.Mod index 38a92496..be04d59e 100644 --- a/src/test/server/s.Mod +++ b/src/test/server/s.Mod @@ -4,7 +4,7 @@ IMPORT sockets, types, Out := Console, SYSTEM, Platform, Strings; PROCEDURE DoSmth(sock: Platform.FileHandle); -VAR +VAR str, aff: ARRAY 256 OF CHAR; n: LONGINT; BEGIN @@ -15,7 +15,7 @@ BEGIN ELSE str[n] := 0X; (* Make sure that received message is zero terminated *) Out.String("received message is "); Out.String(str); Out.Ln; - + IF Platform.Write(sock, SYSTEM.ADR(aff), Strings.Length(aff)) # 0 THEN Out.String("error writing to socket"); Out.Ln END; @@ -29,17 +29,16 @@ PROCEDURE -fork(): LONGINT "(LONGINT)fork()"; PROCEDURE serve; -CONST +CONST Port = 2055; MaxQueue = 5; -VAR +VAR sockfd: LONGINT; newsockfd: LONGINT; ServAddr: sockets.SockAddrIn; pid: LONGINT; res: Platform.ErrorCode; sockaddrlen: LONGINT; - ipAddr: LONGINT; ip: ARRAY 16 OF CHAR; BEGIN sockfd := sockets.Socket(sockets.AfInet, sockets.SockStream, 0); IF sockfd < 0 THEN @@ -48,17 +47,15 @@ BEGIN Out.String("socket created.") END; Out.Ln; - COPY("127.0.0.1", ip); - ipAddr := sockets.inetaddr(ip); - sockets.SetSockAddrIn(sockets.AfInet, Port, ipAddr, ServAddr); + sockets.SetSockAddrIn(sockets.AfInet, Port, 0, ServAddr); IF sockets.Bind(sockfd, SYSTEM.VAL(sockets.SockAddr, ServAddr), SIZE(sockets.SockAddr)) < 0 THEN Out.String("error on binding") ELSE Out.String("binding completed.") END; Out.Ln; - + IF sockets.Listen(sockfd, MaxQueue) # 0 THEN Out.String("listen() failed"); ELSE diff --git a/src/test/server/sockets.Mod b/src/test/server/sockets.Mod index ded7a61f..58ff3c24 100644 --- a/src/test/server/sockets.Mod +++ b/src/test/server/sockets.Mod @@ -2,60 +2,60 @@ MODULE sockets; IMPORT SYSTEM, oocC; -CONST - SockStream* = 1; - SockDgram* = 2; - SockRaw* = 3; - SockRdm* = 4; - SockSeqpacket* = 5; - SockDccp* = 6; - SockPacket* = 10; - - AfUnscec* = 0; (* Unspecified. *) - AfLocal* = 1; (* Local to host (pipes and file-domain). *) - AfUnix* = 1; (* POSIX name for PF_LOCAL. *) - AfFile* = 1; (* Another non-standard name for PF_LOCAL. *) - AfInet* = 2; (* IP protocol family. *) - AfAx25* = 3; (* Amateur Radio AX.25. *) - AfIpx* = 4; (* Novell Internet Protocol. *) - AfAppletalk* = 5; (* Appletalk DDP. *) - AfNetrom* = 6; (* Amateur radio NetROM. *) - AfBridge* = 7; (* Multiprotocol bridge. *) - AfAtmpvc* = 8; (* ATM PVCs. *) - AfX25* = 9; (* Reserved for X.25 project. *) - AfInet6* = 10; (* IP version 6. *) - AfRose* = 11; (* Amateur Radio X.25 PLP. *) - AfDecnet* = 12; (* Reserved for DECnet project. *) - AfNetbeui* = 13; (* Reserved for 802.2LLC project. *) - AfSecurity* = 14; (* Security callback pseudo AF. *) - AfKey* = 15; (* PF_KEY key management API. *) - AfNetlink* = 16; - AfRoute* = 16; (* Alias to emulate 4.4BSD. *) - AfPacket = 17; (* Packet family. *) - AfAsh = 18; (* Ash. *) - AfEconet* = 19; (* Acorn Econet. *) - AfAtmsvc* = 20; (* ATM SVCs. *) - AfRds* = 21; (* RDS sockets. *) - AfSna = 22; (* Linux SNA Project *) - AfIrda* = 23; (* IRDA sockets. *) - AfPppox = 24; (* PPPoX sockets. *) - AfWanpipe* = 25; (* Wanpipe API sockets. *) - AfLlc* = 26; (* Linux LLC. *) - AfCan* = 29; (* Controller Area Network. *) - AfTipc* = 30; (* TIPC sockets. *) - AfBluetooth* = 31; (* Bluetooth sockets. *) - AfIucv* = 32; (* IUCV sockets. *) - AfRxrpc* = 33; (* RxRPC sockets. *) - AfIsdn* = 34; (* mISDN sockets. *) - AfPhonet* = 35; (* Phonet sockets. *) - AfIeee802154* = 36; (* IEEE 802.15.4 sockets. *) - AfCaif* = 37; (* CAIF sockets. *) - AfAlg* = 38; (* Algorithm sockets. *) - AfNfc* = 39; (* NFC sockets. *) - AfVsock* = 40; (* vSockets. *) - AfMax* = 41; (* For now.. *) - - InAddrAny* = 0; +CONST + SockStream* = 1; + SockDgram* = 2; + SockRaw* = 3; + SockRdm* = 4; + SockSeqpacket* = 5; + SockDccp* = 6; + SockPacket* = 10; + + AfUnscec* = 0; (* Unspecified. *) + AfLocal* = 1; (* Local to host (pipes and file-domain). *) + AfUnix* = 1; (* POSIX name for PF_LOCAL. *) + AfFile* = 1; (* Another non-standard name for PF_LOCAL. *) + AfInet* = 2; (* IP protocol family. *) + AfAx25* = 3; (* Amateur Radio AX.25. *) + AfIpx* = 4; (* Novell Internet Protocol. *) + AfAppletalk* = 5; (* Appletalk DDP. *) + AfNetrom* = 6; (* Amateur radio NetROM. *) + AfBridge* = 7; (* Multiprotocol bridge. *) + AfAtmpvc* = 8; (* ATM PVCs. *) + AfX25* = 9; (* Reserved for X.25 project. *) + AfInet6* = 10; (* IP version 6. *) + AfRose* = 11; (* Amateur Radio X.25 PLP. *) + AfDecnet* = 12; (* Reserved for DECnet project. *) + AfNetbeui* = 13; (* Reserved for 802.2LLC project. *) + AfSecurity* = 14; (* Security callback pseudo AF. *) + AfKey* = 15; (* PF_KEY key management API. *) + AfNetlink* = 16; + AfRoute* = 16; (* Alias to emulate 4.4BSD. *) + AfPacket = 17; (* Packet family. *) + AfAsh = 18; (* Ash. *) + AfEconet* = 19; (* Acorn Econet. *) + AfAtmsvc* = 20; (* ATM SVCs. *) + AfRds* = 21; (* RDS sockets. *) + AfSna = 22; (* Linux SNA Project *) + AfIrda* = 23; (* IRDA sockets. *) + AfPppox = 24; (* PPPoX sockets. *) + AfWanpipe* = 25; (* Wanpipe API sockets. *) + AfLlc* = 26; (* Linux LLC. *) + AfCan* = 29; (* Controller Area Network. *) + AfTipc* = 30; (* TIPC sockets. *) + AfBluetooth* = 31; (* Bluetooth sockets. *) + AfIucv* = 32; (* IUCV sockets. *) + AfRxrpc* = 33; (* RxRPC sockets. *) + AfIsdn* = 34; (* mISDN sockets. *) + AfPhonet* = 35; (* Phonet sockets. *) + AfIeee802154* = 36; (* IEEE 802.15.4 sockets. *) + AfCaif* = 37; (* CAIF sockets. *) + AfAlg* = 38; (* Algorithm sockets. *) + AfNfc* = 39; (* NFC sockets. *) + AfVsock* = 40; (* vSockets. *) + AfMax* = 41; (* For now.. *) + + InAddrAny* = 0; TYPE (* /usr/include/netinet/in.h *) @@ -70,16 +70,13 @@ TYPE SinZero*: ARRAY 8 OF CHAR; END; (* /usr/include/sys/socket.h *) - + SockAddr* = RECORD SaFamily*: oocC.shortint; SaData*: ARRAY 14 OF CHAR END; PROCEDURE -includesocket "#include "; - PROCEDURE -includeInet "#include "; - - PROCEDURE -inetaddr*(s: ARRAY OF CHAR): LONGINT "(LONGINT)inet_addr((char*)s)"; PROCEDURE -SetCShort(i: INTEGER; VAR si: oocC.shortint) "*(short*)si = i"; @@ -87,7 +84,7 @@ TYPE PROCEDURE -SetCShortSwapped(i: INTEGER; VAR si: oocC.shortint) "*(short*)si = ((i >> 8) & 0x00ff) | ((i << 8) & 0xff00)"; - PROCEDURE SetSockAddrIn*(family, port: INTEGER; inaddr: LONGINT; VAR sai: SockAddrIn); + PROCEDURE SetSockAddrIn*(family, port, inaddr: INTEGER; VAR sai: SockAddrIn); VAR i: INTEGER; BEGIN SetCShort(family, sai.SinFamily); From 2178fa7b18feb03c1236cbb84fbeddf97782ce27 Mon Sep 17 00:00:00 2001 From: Norayr Chilingarian Date: Fri, 21 Feb 2025 04:52:54 +0400 Subject: [PATCH 547/580] now test server can listen on any ipv4 address. --- src/test/server/s.Mod | 15 +++-- src/test/server/sockets.Mod | 115 ++++++++++++++++++------------------ 2 files changed, 68 insertions(+), 62 deletions(-) diff --git a/src/test/server/s.Mod b/src/test/server/s.Mod index be04d59e..38a92496 100644 --- a/src/test/server/s.Mod +++ b/src/test/server/s.Mod @@ -4,7 +4,7 @@ IMPORT sockets, types, Out := Console, SYSTEM, Platform, Strings; PROCEDURE DoSmth(sock: Platform.FileHandle); -VAR +VAR str, aff: ARRAY 256 OF CHAR; n: LONGINT; BEGIN @@ -15,7 +15,7 @@ BEGIN ELSE str[n] := 0X; (* Make sure that received message is zero terminated *) Out.String("received message is "); Out.String(str); Out.Ln; - + IF Platform.Write(sock, SYSTEM.ADR(aff), Strings.Length(aff)) # 0 THEN Out.String("error writing to socket"); Out.Ln END; @@ -29,16 +29,17 @@ PROCEDURE -fork(): LONGINT "(LONGINT)fork()"; PROCEDURE serve; -CONST +CONST Port = 2055; MaxQueue = 5; -VAR +VAR sockfd: LONGINT; newsockfd: LONGINT; ServAddr: sockets.SockAddrIn; pid: LONGINT; res: Platform.ErrorCode; sockaddrlen: LONGINT; + ipAddr: LONGINT; ip: ARRAY 16 OF CHAR; BEGIN sockfd := sockets.Socket(sockets.AfInet, sockets.SockStream, 0); IF sockfd < 0 THEN @@ -47,15 +48,17 @@ BEGIN Out.String("socket created.") END; Out.Ln; + COPY("127.0.0.1", ip); + ipAddr := sockets.inetaddr(ip); - sockets.SetSockAddrIn(sockets.AfInet, Port, 0, ServAddr); + sockets.SetSockAddrIn(sockets.AfInet, Port, ipAddr, ServAddr); IF sockets.Bind(sockfd, SYSTEM.VAL(sockets.SockAddr, ServAddr), SIZE(sockets.SockAddr)) < 0 THEN Out.String("error on binding") ELSE Out.String("binding completed.") END; Out.Ln; - + IF sockets.Listen(sockfd, MaxQueue) # 0 THEN Out.String("listen() failed"); ELSE diff --git a/src/test/server/sockets.Mod b/src/test/server/sockets.Mod index 58ff3c24..ded7a61f 100644 --- a/src/test/server/sockets.Mod +++ b/src/test/server/sockets.Mod @@ -2,60 +2,60 @@ MODULE sockets; IMPORT SYSTEM, oocC; -CONST - SockStream* = 1; - SockDgram* = 2; - SockRaw* = 3; - SockRdm* = 4; - SockSeqpacket* = 5; - SockDccp* = 6; - SockPacket* = 10; - - AfUnscec* = 0; (* Unspecified. *) - AfLocal* = 1; (* Local to host (pipes and file-domain). *) - AfUnix* = 1; (* POSIX name for PF_LOCAL. *) - AfFile* = 1; (* Another non-standard name for PF_LOCAL. *) - AfInet* = 2; (* IP protocol family. *) - AfAx25* = 3; (* Amateur Radio AX.25. *) - AfIpx* = 4; (* Novell Internet Protocol. *) - AfAppletalk* = 5; (* Appletalk DDP. *) - AfNetrom* = 6; (* Amateur radio NetROM. *) - AfBridge* = 7; (* Multiprotocol bridge. *) - AfAtmpvc* = 8; (* ATM PVCs. *) - AfX25* = 9; (* Reserved for X.25 project. *) - AfInet6* = 10; (* IP version 6. *) - AfRose* = 11; (* Amateur Radio X.25 PLP. *) - AfDecnet* = 12; (* Reserved for DECnet project. *) - AfNetbeui* = 13; (* Reserved for 802.2LLC project. *) - AfSecurity* = 14; (* Security callback pseudo AF. *) - AfKey* = 15; (* PF_KEY key management API. *) - AfNetlink* = 16; - AfRoute* = 16; (* Alias to emulate 4.4BSD. *) - AfPacket = 17; (* Packet family. *) - AfAsh = 18; (* Ash. *) - AfEconet* = 19; (* Acorn Econet. *) - AfAtmsvc* = 20; (* ATM SVCs. *) - AfRds* = 21; (* RDS sockets. *) - AfSna = 22; (* Linux SNA Project *) - AfIrda* = 23; (* IRDA sockets. *) - AfPppox = 24; (* PPPoX sockets. *) - AfWanpipe* = 25; (* Wanpipe API sockets. *) - AfLlc* = 26; (* Linux LLC. *) - AfCan* = 29; (* Controller Area Network. *) - AfTipc* = 30; (* TIPC sockets. *) - AfBluetooth* = 31; (* Bluetooth sockets. *) - AfIucv* = 32; (* IUCV sockets. *) - AfRxrpc* = 33; (* RxRPC sockets. *) - AfIsdn* = 34; (* mISDN sockets. *) - AfPhonet* = 35; (* Phonet sockets. *) - AfIeee802154* = 36; (* IEEE 802.15.4 sockets. *) - AfCaif* = 37; (* CAIF sockets. *) - AfAlg* = 38; (* Algorithm sockets. *) - AfNfc* = 39; (* NFC sockets. *) - AfVsock* = 40; (* vSockets. *) - AfMax* = 41; (* For now.. *) - - InAddrAny* = 0; +CONST + SockStream* = 1; + SockDgram* = 2; + SockRaw* = 3; + SockRdm* = 4; + SockSeqpacket* = 5; + SockDccp* = 6; + SockPacket* = 10; + + AfUnscec* = 0; (* Unspecified. *) + AfLocal* = 1; (* Local to host (pipes and file-domain). *) + AfUnix* = 1; (* POSIX name for PF_LOCAL. *) + AfFile* = 1; (* Another non-standard name for PF_LOCAL. *) + AfInet* = 2; (* IP protocol family. *) + AfAx25* = 3; (* Amateur Radio AX.25. *) + AfIpx* = 4; (* Novell Internet Protocol. *) + AfAppletalk* = 5; (* Appletalk DDP. *) + AfNetrom* = 6; (* Amateur radio NetROM. *) + AfBridge* = 7; (* Multiprotocol bridge. *) + AfAtmpvc* = 8; (* ATM PVCs. *) + AfX25* = 9; (* Reserved for X.25 project. *) + AfInet6* = 10; (* IP version 6. *) + AfRose* = 11; (* Amateur Radio X.25 PLP. *) + AfDecnet* = 12; (* Reserved for DECnet project. *) + AfNetbeui* = 13; (* Reserved for 802.2LLC project. *) + AfSecurity* = 14; (* Security callback pseudo AF. *) + AfKey* = 15; (* PF_KEY key management API. *) + AfNetlink* = 16; + AfRoute* = 16; (* Alias to emulate 4.4BSD. *) + AfPacket = 17; (* Packet family. *) + AfAsh = 18; (* Ash. *) + AfEconet* = 19; (* Acorn Econet. *) + AfAtmsvc* = 20; (* ATM SVCs. *) + AfRds* = 21; (* RDS sockets. *) + AfSna = 22; (* Linux SNA Project *) + AfIrda* = 23; (* IRDA sockets. *) + AfPppox = 24; (* PPPoX sockets. *) + AfWanpipe* = 25; (* Wanpipe API sockets. *) + AfLlc* = 26; (* Linux LLC. *) + AfCan* = 29; (* Controller Area Network. *) + AfTipc* = 30; (* TIPC sockets. *) + AfBluetooth* = 31; (* Bluetooth sockets. *) + AfIucv* = 32; (* IUCV sockets. *) + AfRxrpc* = 33; (* RxRPC sockets. *) + AfIsdn* = 34; (* mISDN sockets. *) + AfPhonet* = 35; (* Phonet sockets. *) + AfIeee802154* = 36; (* IEEE 802.15.4 sockets. *) + AfCaif* = 37; (* CAIF sockets. *) + AfAlg* = 38; (* Algorithm sockets. *) + AfNfc* = 39; (* NFC sockets. *) + AfVsock* = 40; (* vSockets. *) + AfMax* = 41; (* For now.. *) + + InAddrAny* = 0; TYPE (* /usr/include/netinet/in.h *) @@ -70,13 +70,16 @@ TYPE SinZero*: ARRAY 8 OF CHAR; END; (* /usr/include/sys/socket.h *) - + SockAddr* = RECORD SaFamily*: oocC.shortint; SaData*: ARRAY 14 OF CHAR END; PROCEDURE -includesocket "#include "; + PROCEDURE -includeInet "#include "; + + PROCEDURE -inetaddr*(s: ARRAY OF CHAR): LONGINT "(LONGINT)inet_addr((char*)s)"; PROCEDURE -SetCShort(i: INTEGER; VAR si: oocC.shortint) "*(short*)si = i"; @@ -84,7 +87,7 @@ TYPE PROCEDURE -SetCShortSwapped(i: INTEGER; VAR si: oocC.shortint) "*(short*)si = ((i >> 8) & 0x00ff) | ((i << 8) & 0xff00)"; - PROCEDURE SetSockAddrIn*(family, port, inaddr: INTEGER; VAR sai: SockAddrIn); + PROCEDURE SetSockAddrIn*(family, port: INTEGER; inaddr: LONGINT; VAR sai: SockAddrIn); VAR i: INTEGER; BEGIN SetCShort(family, sai.SinFamily); From b22fc3fd3ffd752019f80f18aa101b48dc82bc4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C8=98tefan-Iulian=20Alecu?= <165364995+pascalecu@users.noreply.github.com> Date: Wed, 12 Mar 2025 02:07:15 +0200 Subject: [PATCH 548/580] feat: add netbsd support in configure.c --- src/tools/make/configure.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/tools/make/configure.c b/src/tools/make/configure.c index ecfc3f1f..2cd37b13 100644 --- a/src/tools/make/configure.c +++ b/src/tools/make/configure.c @@ -113,6 +113,7 @@ void determineOS() { else if (strncasecmp(sys.sysname, "linux", 5) == 0) {determineLinuxVariant();} else if (strncasecmp(sys.sysname, "freebsd", 5) == 0) {os = "freebsd"; bsd = 1;} else if (strncasecmp(sys.sysname, "openbsd", 5) == 0) {os = "openbsd"; bsd = 1;} + else if (strncasecmp(sys.sysname, "netbsd", 5) == 0) {os = "netbsd"; bsd = 1;} else if (strncasecmp(sys.sysname, "darwin", 5) == 0) {os = "darwin"; staticlink = ""; dynext = ".dylib";} else { fprintf(stderr, "\n\n** Unrecognised utsname.sysname '%s' returned by uname().\n", sys.sysname); From c4f379204733f3f245d6b8a59d4636a4b06f6ac9 Mon Sep 17 00:00:00 2001 From: sevoves Date: Thu, 3 Apr 2025 07:52:22 +0400 Subject: [PATCH 549/580] add ctags --- .gitignore | 1 + makefile | 6 ++++-- oberon.ctags | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 oberon.ctags diff --git a/.gitignore b/.gitignore index 22c5a97d..27d956ae 100644 --- a/.gitignore +++ b/.gitignore @@ -39,3 +39,4 @@ /triage/BasicTypeSize.md /triage/Roadmap.md triage/system/* +tags diff --git a/makefile b/makefile index 5c0ee241..7bc29843 100644 --- a/makefile +++ b/makefile @@ -91,8 +91,10 @@ usage: @echo " make bootstrap - Update bootstrap C source directories." @echo " make revertbootstrap - Use git checkout to restore bootstrap C source directories" - - +# Code navigation helper +.PHONY: tags +tags: + ctags -R --options=oberon.ctags --extras=+q # Generate config files Configuration.Make and Configuration.Mod FORCE: diff --git a/oberon.ctags b/oberon.ctags new file mode 100644 index 00000000..de5a1cf8 --- /dev/null +++ b/oberon.ctags @@ -0,0 +1,32 @@ +# ctags -R --options=oberon.ctags --extras=+q + +--langdef=Oberon{_autoFQTag} + +--map-Oberon=+.mod +--map-Oberon=+.Mod + +--kinddef-Oberon=m,module,modules +--kinddef-Oberon=p,procedure,procedures + +--regex-Oberon=/^\s*MODULE\s+([a-zA-Z][a-zA-Z0-9]*)\s*;/\1/m/{scope=push} +--regex-Oberon=/^\s*END\s+([a-zA-Z][a-zA-Z0-9]*)\s*\./\1/m/{scope=pop} +--regex-Oberon=/^\s*PROCEDURE(\s*\^|-)?\s*([a-zA-Z][a-zA-Z0-9]*)/\2/p/{scope=ref} +# NOTE Oberon-2 receiver procedures not supported + +### using ctags with vim +# examples: +# vim -t "Compiler" +# vim -t "OPS.Get" +# vim -c ":ts Platform.Read" +# +# when inside the editor you need to jump to the fully qualified tag, +# not just procedure name e.g. when you have Platform.Write, you +# can't just place cursor on W then and expect it to resolve +# correctly all the time. +# your better options are +# autocmd FileType oberon setlocal iskeyword+=. +# autocmd FileType modula2 setlocal iskeyword+=. +# :ta Platform.Write +# v 3e +# :ts Platform.Write +# g From e936f7d7b0b4921528df0fd79285ec1681250792 Mon Sep 17 00:00:00 2001 From: sevoves Date: Thu, 3 Apr 2025 07:52:59 +0400 Subject: [PATCH 550/580] fix typo in ReadMe --- ReadMe.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReadMe.md b/ReadMe.md index 933b0681..fa8f5143 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -295,7 +295,7 @@ Also, Vishaps are known in tales, fiction. [This page](http://blog.fogus.me/2015 ###### Links - [Niklaus Wirth's personal page at ETH Zurich](https://www.inf.ethz.ch/personal/wirth/) - [ETH Zurich's Wirth publications page](http://www.ethoberon.ethz.ch/WirthPubl/) - - [Joseph Templ's ofront on github](https://hithub.com/jtempl/ofront) + - [Joseph Templ's ofront on github](https://github.com/jtempl/ofront) - [Software Templ OG](http://www.software-templ.com) - [Oberon: Steps beyond Pascal and Modula](http://fruttenboel.verhoeven272.nl/Oberon/) From 233761e7fa055d0605c499e744661af12f728ec3 Mon Sep 17 00:00:00 2001 From: sevoves Date: Thu, 3 Apr 2025 08:16:27 +0400 Subject: [PATCH 551/580] more matches --- oberon.ctags | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/oberon.ctags b/oberon.ctags index de5a1cf8..dac4e685 100644 --- a/oberon.ctags +++ b/oberon.ctags @@ -10,7 +10,7 @@ --regex-Oberon=/^\s*MODULE\s+([a-zA-Z][a-zA-Z0-9]*)\s*;/\1/m/{scope=push} --regex-Oberon=/^\s*END\s+([a-zA-Z][a-zA-Z0-9]*)\s*\./\1/m/{scope=pop} ---regex-Oberon=/^\s*PROCEDURE(\s*\^|-)?\s*([a-zA-Z][a-zA-Z0-9]*)/\2/p/{scope=ref} +--regex-Oberon=/^\s*PROCEDURE\s*(\^|-)?\s*([a-zA-Z][a-zA-Z0-9]*)/\2/p/{scope=ref} # NOTE Oberon-2 receiver procedures not supported ### using ctags with vim From 9084ca288bfaeaf47250837492700c1a45536a56 Mon Sep 17 00:00:00 2001 From: sevoves Date: Thu, 3 Apr 2025 16:29:13 +0400 Subject: [PATCH 552/580] rewording ceveats on oberon.ctags --- oberon.ctags | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/oberon.ctags b/oberon.ctags index dac4e685..c7b57dc7 100644 --- a/oberon.ctags +++ b/oberon.ctags @@ -1,3 +1,4 @@ +# universal tags # ctags -R --options=oberon.ctags --extras=+q --langdef=Oberon{_autoFQTag} @@ -19,14 +20,14 @@ # vim -t "OPS.Get" # vim -c ":ts Platform.Read" # -# when inside the editor you need to jump to the fully qualified tag, -# not just procedure name e.g. when you have Platform.Write, you -# can't just place cursor on W then and expect it to resolve -# correctly all the time. -# your better options are -# autocmd FileType oberon setlocal iskeyword+=. -# autocmd FileType modula2 setlocal iskeyword+=. -# :ta Platform.Write -# v 3e -# :ts Platform.Write -# g +# you need to jump to the fully qualified name, since procedure names alone +# sometimes resolve to an incorrect module. that is to say putting cursor on +# W in Platform.Write and jumping will probably not work as expected, so you +# might have to do some of these +# autocmd FileType oberon,modula2 setlocal iskeyword+=. +# select the name fully +# v 3e +# :ta Platform.Write +# resolve ambiguities interactively +# :ts Write +# g From 9e9bbe7581a20cf0ba9be6c5a58c1465d74bbe7f Mon Sep 17 00:00:00 2001 From: sevoves Date: Thu, 3 Apr 2025 19:00:09 +0400 Subject: [PATCH 553/580] fix empty link in ReadMe --- ReadMe.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReadMe.md b/ReadMe.md index fa8f5143..ab4dfbce 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -2,7 +2,7 @@ # Ñ´ishap Oberon -[Ñ´ishap Oberon](http://oberon.vishap.am) is a free and open source (GPLv3) +[Ñ´ishap Oberon](https://vishap.oberon.am/) is a free and open source (GPLv3) implementation of the Oberon-2 language and libraries for use on conventional operating systems such as Linux, BSD, Android, Mac and Windows. From cb098d448dd392f5cd872f3a839e4710256c54aa Mon Sep 17 00:00:00 2001 From: sevoves Date: Thu, 3 Apr 2025 19:20:01 +0400 Subject: [PATCH 554/580] update deaed links in ReadMe --- ReadMe.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ReadMe.md b/ReadMe.md index ab4dfbce..95d7f840 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -278,13 +278,13 @@ Also, Vishaps are known in tales, fiction. [This page](http://blog.fogus.me/2015 ###### Oberon - [The History of Modula-2 and Oberon](http://people.inf.ethz.ch/wirth/Articles/Modula-Oberon-June.pdf) - [The Programming Language Oberon](https://www.inf.ethz.ch/personal/wirth/Oberon/Oberon.Report.pdf) - - [Project Oberon: The Design of an Operating System and Compiler ](http://www.ethoberon.ethz.ch/WirthPubl/ProjectOberon.pdf) - - [Oberon - the Overlooked Jewel](http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.90.7173&rep=rep1&type=pdf) + - [Project Oberon: The Design of an Operating System and Compiler ](https://people.inf.ethz.ch/wirth/ProjectOberon1992.pdf) + - [Oberon - the Overlooked Jewel](http://pascal.hansotten.com/uploads/oberonpi/Oberon%20article.pdf) ###### Oberon 2 - - [Differences between Oberon and Oberon-2](http://members.home.nl/jmr272/Oberon/Oberon2.Differences.pdf) + - [Differences between Oberon and Oberon-2](https://citeseerx.ist.psu.edu/document?repid=rep1&type=pdf&doi=89e5bd3cf006bde4821599cdc57a37de5dc84bcd) - [The Programming Language Oberon-2](http://www.ssw.uni-linz.ac.at/Research/Papers/Oberon2.pdf) - - [Programming in Oberon. Steps beyond Pascal and Modula](http://www.ethoberon.ethz.ch/WirthPubl/ProgInOberonWR.pdf) + - [Programming in Oberon. Steps beyond Pascal and Modula](https://people.inf.ethz.ch/wirth/ProgInOberonWR.pdf) - [The Oakwood Guidelines for Oberon-2 Compiler Developers](http://www.math.bas.bg/bantchev/place/oberon/oakwood-guidelines.pdf) ###### Oberon 07 @@ -294,10 +294,10 @@ Also, Vishaps are known in tales, fiction. [This page](http://blog.fogus.me/2015 ###### Links - [Niklaus Wirth's personal page at ETH Zurich](https://www.inf.ethz.ch/personal/wirth/) - - [ETH Zurich's Wirth publications page](http://www.ethoberon.ethz.ch/WirthPubl/) + - [Selected articles by Niklaus Wirth](https://people.inf.ethz.ch/wirth/SelectedArticles.pdf) + - [ETH Oberon publications page](https://web.archive.org/web/20191207155011/http://www.ethoberon.ethz.ch/books.html) - [Joseph Templ's ofront on github](https://github.com/jtempl/ofront) - [Software Templ OG](http://www.software-templ.com) - - [Oberon: Steps beyond Pascal and Modula](http://fruttenboel.verhoeven272.nl/Oberon/) ## History From ac829590928189f05ea2d022cbbc319a521fdd41 Mon Sep 17 00:00:00 2001 From: sevoves Date: Thu, 3 Apr 2025 20:05:37 +0400 Subject: [PATCH 555/580] add stuff to .gitignore --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 27d956ae..ba12dfc3 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,7 @@ /*.sym /*.asm /*.mod +/Errors.Txt /Errors.txt /olang /src/test/**/*.exe @@ -40,3 +41,4 @@ /triage/Roadmap.md triage/system/* tags +voc From e64d4c4d441d45303f458bd33b2eca844070d190 Mon Sep 17 00:00:00 2001 From: sevoves Date: Thu, 3 Apr 2025 20:14:24 +0400 Subject: [PATCH 556/580] add test binaries to .gitignore --- .gitignore | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.gitignore b/.gitignore index ba12dfc3..521c9a36 100644 --- a/.gitignore +++ b/.gitignore @@ -27,6 +27,17 @@ /src/test/confidence/**/*.asm /src/test/confidence/**/*.s /src/test/confidence/**/*.map +/src/test/confidence/arrayassignment/aa +/src/test/confidence/hello/hello +/src/test/confidence/in/intest +/src/test/confidence/isptest/isptest +/src/test/confidence/language/TestLanguage +/src/test/confidence/library/TestLibrary +/src/test/confidence/lola/Lola +/src/test/confidence/math/mathtest +/src/test/confidence/out/outtest +/src/test/confidence/signal/SignalTest +/src/test/confidence/texts/testTexts /bootstrap/*/SYSTEM.[ch] /bootstrap/*/Errors.Txt /bootstrap/*/WindowsWrapper.h From a25b44ae2145dd35ce9f28d91c5fa7c07e6abf32 Mon Sep 17 00:00:00 2001 From: sevoves Date: Thu, 3 Apr 2025 20:38:12 +0400 Subject: [PATCH 557/580] exclude all confidence test files without extension except expect --- .gitignore | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/.gitignore b/.gitignore index 521c9a36..19fc1ede 100644 --- a/.gitignore +++ b/.gitignore @@ -21,23 +21,14 @@ /src/test/**/*.obj /src/test/**/*.sym **/*.stackdump +!/src/test/confidence/**/expected /src/test/confidence/**/input /src/test/confidence/**/result /src/test/confidence/**/result-* +/src/test/confidence/**/*[^.]* /src/test/confidence/**/*.asm /src/test/confidence/**/*.s /src/test/confidence/**/*.map -/src/test/confidence/arrayassignment/aa -/src/test/confidence/hello/hello -/src/test/confidence/in/intest -/src/test/confidence/isptest/isptest -/src/test/confidence/language/TestLanguage -/src/test/confidence/library/TestLibrary -/src/test/confidence/lola/Lola -/src/test/confidence/math/mathtest -/src/test/confidence/out/outtest -/src/test/confidence/signal/SignalTest -/src/test/confidence/texts/testTexts /bootstrap/*/SYSTEM.[ch] /bootstrap/*/Errors.Txt /bootstrap/*/WindowsWrapper.h From d00531742414e2676d1b71be7826e03b07b96693 Mon Sep 17 00:00:00 2001 From: sevoves Date: Thu, 3 Apr 2025 20:57:00 +0400 Subject: [PATCH 558/580] address more caveats in oberon.ctags --- oberon.ctags | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/oberon.ctags b/oberon.ctags index c7b57dc7..6af0745a 100644 --- a/oberon.ctags +++ b/oberon.ctags @@ -24,10 +24,15 @@ # sometimes resolve to an incorrect module. that is to say putting cursor on # W in Platform.Write and jumping will probably not work as expected, so you # might have to do some of these -# autocmd FileType oberon,modula2 setlocal iskeyword+=. -# select the name fully +# add this to yout .vimrc +# autocmd FileType oberon,modula2 setlocal iskeyword+=. +# select the qualified name # v 3e # :ta Platform.Write # resolve ambiguities interactively # :ts Write # g +# +# if you need upward searching for tags file, so you can access them from +# project root subdirectories, then add this to your .vimrc +# set tags=./tags;~ From 7691293a5b3d490efcb74c66d2b8eb9870187352 Mon Sep 17 00:00:00 2001 From: sevoves Date: Thu, 3 Apr 2025 21:05:42 +0400 Subject: [PATCH 559/580] replace egrep with grep -E for less warnings --- src/tools/make/sourcechanges.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tools/make/sourcechanges.sh b/src/tools/make/sourcechanges.sh index e20e6841..86aa9542 100644 --- a/src/tools/make/sourcechanges.sh +++ b/src/tools/make/sourcechanges.sh @@ -14,8 +14,8 @@ changes="0" find "$1" -type f -print0 | while IFS= read -r -d '' f; do fn=$(basename "$f") - egrep -v -f ../../src/tools/make/ignore "$f" >$fn.old - egrep -v -f ../../src/tools/make/ignore $fn >$fn.new + grep -E -v -f ../../src/tools/make/ignore "$f" >$fn.old + grep -E -v -f ../../src/tools/make/ignore $fn >$fn.new if ! diff -U 2 -b $fn.old $fn.new >$fn.diff; then echo "" echo "" From cd06cd32b1b658a941b686756aacaab2e4ba9b07 Mon Sep 17 00:00:00 2001 From: sevoves Date: Thu, 3 Apr 2025 22:09:20 +0400 Subject: [PATCH 560/580] ignore common warnings in gcc and clang --- src/tools/make/configure.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/tools/make/configure.c b/src/tools/make/configure.c index 2cd37b13..3ff41948 100644 --- a/src/tools/make/configure.c +++ b/src/tools/make/configure.c @@ -137,7 +137,8 @@ void determineCCompiler() { } #elif defined(__clang__) compiler = "clang"; - cc = "clang -fPIC -g" optimize; + // FIXME ignoring warnings + cc = "clang -fPIC -g -Wno-deprecated-non-prototype" optimize; #elif defined(__TINYC__) compiler = "tcc"; cc = "tcc -g"; @@ -146,9 +147,11 @@ void determineCCompiler() { compiler = "gcc"; if (strncasecmp(os, "cygwin", 6) == 0) { // Avoid cygwin specific warning that -fPIC is ignored. - cc = "gcc -g" optimize; + // FIXME ignoring warnings + cc = "gcc -g -Wno-stringop-overflow" optimize; } else { - cc = "gcc -fPIC -g" optimize; + // FIXME ignoring warnings + cc = "gcc -fPIC -g -Wno-stringop-overflow" optimize; } #elif defined(_MSC_VER) compiler = "msc"; From b12029e3ed5618f3c43e5c1cfeec522799cb68ba Mon Sep 17 00:00:00 2001 From: sevoves Date: Thu, 3 Apr 2025 22:26:20 +0400 Subject: [PATCH 561/580] remove warning floods for MinGW compiler --- src/tools/make/configure.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/tools/make/configure.c b/src/tools/make/configure.c index 3ff41948..87591d63 100644 --- a/src/tools/make/configure.c +++ b/src/tools/make/configure.c @@ -131,9 +131,11 @@ void determineCCompiler() { #if defined(__MINGW32__) compiler = "mingw"; if (sizeof (void*) == 4) { - cc = "i686-w64-mingw32-gcc -g" optimize; + // FIXME ignoring warnings + cc = "i686-w64-mingw32-gcc -g -Wno-stringop-overflow" optimize; } else { - cc = "x86_64-w64-mingw32-gcc -g" optimize; + // FIXME ignoring warnings + cc = "x86_64-w64-mingw32-gcc -g -Wno-stringop-overflow" optimize; } #elif defined(__clang__) compiler = "clang"; From 089ca94207638feecdf6ae7ac03d326e72f4fc2d Mon Sep 17 00:00:00 2001 From: sevoves Date: Fri, 4 Apr 2025 00:38:41 +0400 Subject: [PATCH 562/580] remove scope pop in ctag since file is the scope --- oberon.ctags | 1 - 1 file changed, 1 deletion(-) diff --git a/oberon.ctags b/oberon.ctags index 6af0745a..d400018f 100644 --- a/oberon.ctags +++ b/oberon.ctags @@ -10,7 +10,6 @@ --kinddef-Oberon=p,procedure,procedures --regex-Oberon=/^\s*MODULE\s+([a-zA-Z][a-zA-Z0-9]*)\s*;/\1/m/{scope=push} ---regex-Oberon=/^\s*END\s+([a-zA-Z][a-zA-Z0-9]*)\s*\./\1/m/{scope=pop} --regex-Oberon=/^\s*PROCEDURE\s*(\^|-)?\s*([a-zA-Z][a-zA-Z0-9]*)/\2/p/{scope=ref} # NOTE Oberon-2 receiver procedures not supported From 3460b9f78ad639486585c562579ba20bca766044 Mon Sep 17 00:00:00 2001 From: sevoves Date: Fri, 4 Apr 2025 15:37:41 +0400 Subject: [PATCH 563/580] create macros for ignoring flood warnings --- src/tools/make/configure.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/tools/make/configure.c b/src/tools/make/configure.c index 87591d63..a5e699f6 100644 --- a/src/tools/make/configure.c +++ b/src/tools/make/configure.c @@ -125,22 +125,22 @@ void determineOS() { } #define optimize "" // " -O1" +// FIXME ignoring flood warnings that possibly are problems +#define ignore_gcc_flood_warning " -Wno-stringop-overflow" +#define ignore_clang_flood_warning " -Wno-deprecated-non-prototype" void determineCCompiler() { snprintf(libspec, sizeof(libspec), " -l%s", oname); #if defined(__MINGW32__) compiler = "mingw"; if (sizeof (void*) == 4) { - // FIXME ignoring warnings - cc = "i686-w64-mingw32-gcc -g -Wno-stringop-overflow" optimize; + cc = "i686-w64-mingw32-gcc -g" ignore_gcc_flood_warning optimize; } else { - // FIXME ignoring warnings - cc = "x86_64-w64-mingw32-gcc -g -Wno-stringop-overflow" optimize; + cc = "x86_64-w64-mingw32-gcc -g" ignore_gcc_flood_warning optimize; } #elif defined(__clang__) compiler = "clang"; - // FIXME ignoring warnings - cc = "clang -fPIC -g -Wno-deprecated-non-prototype" optimize; + cc = "clang -fPIC -g" ignore_clang_flood_warning optimize; #elif defined(__TINYC__) compiler = "tcc"; cc = "tcc -g"; @@ -149,11 +149,9 @@ void determineCCompiler() { compiler = "gcc"; if (strncasecmp(os, "cygwin", 6) == 0) { // Avoid cygwin specific warning that -fPIC is ignored. - // FIXME ignoring warnings - cc = "gcc -g -Wno-stringop-overflow" optimize; + cc = "gcc -g" ignore_gcc_flood_warning optimize; } else { - // FIXME ignoring warnings - cc = "gcc -fPIC -g -Wno-stringop-overflow" optimize; + cc = "gcc -fPIC -g" ignore_gcc_flood_warning optimize; } #elif defined(_MSC_VER) compiler = "msc"; From e298d10d99ca9db6bb55f6da6d43501d8caa6901 Mon Sep 17 00:00:00 2001 From: sevoves Date: Fri, 4 Apr 2025 15:43:44 +0400 Subject: [PATCH 564/580] rewording in configure.c --- src/tools/make/configure.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/tools/make/configure.c b/src/tools/make/configure.c index a5e699f6..79059bd7 100644 --- a/src/tools/make/configure.c +++ b/src/tools/make/configure.c @@ -125,22 +125,22 @@ void determineOS() { } #define optimize "" // " -O1" -// FIXME ignoring flood warnings that possibly are problems -#define ignore_gcc_flood_warning " -Wno-stringop-overflow" -#define ignore_clang_flood_warning " -Wno-deprecated-non-prototype" +// FIXME ignoring warning floods that possibly are problems +#define ignore_gcc_warning_flood " -Wno-stringop-overflow" +#define ignore_clang_warning_flood " -Wno-deprecated-non-prototype" void determineCCompiler() { snprintf(libspec, sizeof(libspec), " -l%s", oname); #if defined(__MINGW32__) compiler = "mingw"; if (sizeof (void*) == 4) { - cc = "i686-w64-mingw32-gcc -g" ignore_gcc_flood_warning optimize; + cc = "i686-w64-mingw32-gcc -g" ignore_gcc_warning_flood optimize; } else { - cc = "x86_64-w64-mingw32-gcc -g" ignore_gcc_flood_warning optimize; + cc = "x86_64-w64-mingw32-gcc -g" ignore_gcc_warning_flood optimize; } #elif defined(__clang__) compiler = "clang"; - cc = "clang -fPIC -g" ignore_clang_flood_warning optimize; + cc = "clang -fPIC -g" ignore_clang_warning_flood optimize; #elif defined(__TINYC__) compiler = "tcc"; cc = "tcc -g"; @@ -149,9 +149,9 @@ void determineCCompiler() { compiler = "gcc"; if (strncasecmp(os, "cygwin", 6) == 0) { // Avoid cygwin specific warning that -fPIC is ignored. - cc = "gcc -g" ignore_gcc_flood_warning optimize; + cc = "gcc -g" ignore_gcc_warning_flood optimize; } else { - cc = "gcc -fPIC -g" ignore_gcc_flood_warning optimize; + cc = "gcc -fPIC -g" ignore_gcc_warning_flood optimize; } #elif defined(_MSC_VER) compiler = "msc"; From 5e52f8c23151684cc8d1119f59887b47229778fc Mon Sep 17 00:00:00 2001 From: sevoves Date: Fri, 4 Apr 2025 21:39:45 +0400 Subject: [PATCH 565/580] add ctags doc and remove comments from oberon.ctags --- doc/ctags.md | 82 ++++++++++++++++++++++++++++++++++++++++++++++++++++ oberon.ctags | 23 --------------- 2 files changed, 82 insertions(+), 23 deletions(-) create mode 100644 doc/ctags.md diff --git a/doc/ctags.md b/doc/ctags.md new file mode 100644 index 00000000..34319208 --- /dev/null +++ b/doc/ctags.md @@ -0,0 +1,82 @@ +## Code navigation with ctags + +[`ctags`](https://github.com/universal-ctags/ctags) is a tool that creates an index file for names (symbols) in various programming langauges, which helps code comprehension by giving information to text editors to search, locate, and interactively suggest names. Particularly for Oberon, the `oberon.ctags` file, located in the project root, contains definitions for Oberon modules and procedures (but not receiver procedures). + +Below you can find installation instructions and usage examples for `ctags`, in particular, using the universal tags implementation (not tested with other implementations), with `vim` (you can find or add guides for your text editor), with examples that deal with Oberon source code. + +## Install universal tags + +#### Use your package manager + +`pacman -S ctags` (arch linux) +`apt install universal-ctags` (debian, ubuntu) +`brew install universal-ctags` (macOS) +... + +#### Compile from source + +`git clone https://github.com/universal-ctags/ctags.git` +follow [build instructions](https://github.com/universal-ctags/ctags/blob/master/README.md#how-to-build-and-install) + +## Using ctags with vim and Oberon + +the following instructions are for POSIX systems, but can be easily adapted to other systems + +#### Configuration + +First, generate tags in project root +`make tags` + +When you add or change names in source files, you have to regenerate the `tags` file. That can be done by running `make tags` again. Optionally, use a `vim` plugin such as [vim-gutentags](https://github.com/ludovicchabant/vim-gutentags) to automate this process. Install it (or skip this step): +``` +git clone https://github.com/ludovicchabant/vim-gutentags ~/.vim/plugin/ +``` +or wherever your vim global plugin directory is specified in `:h plugin`. + +Add this to your `~/.vimrc` +``` +" search upwards for tags file until home directory +set tags=./tags;~ +" qualified name metadata for plugin +let g:gutentags_ctags_extra_args = ['--extras=+q'] +``` + +To use `oberon.ctags` with a plugin or for Oberon language detection outside its directory: +`cp oberon.ctags ~/.config/ctags/` +or +`cp oberon.ctags $XDG_CONFIG_HOME/ctags/` + +#### Usage examples + +tags documentation is in vim +`:h tags` + +some examples: +``` +vim -t "Compiler" +vim -t "OPS.Get" +vim -c ":ts Platform.Read" +vim -c ":ta BrowserCmd.ShowDef" +``` + +Inside vim when you have cursor on the first letter `M` of `Module.Procedure`, do this to jump to procedure definition: +`v 3e ` *(visually select the fully qualified name)* +module definition: +`` +To come back: +`` + +Putting cursor on `P` of `Module.Procedure` is not guaranteed to resolve correctly to the correct module, so choose the fully qualified name. This is a [known limitation](https://docs.ctags.io/en/latest/man/ctags-faq.7.html#how-do-i-jump-to-the-tag-i-want-instead-of-the-wrong-one-by-the-same-name) of `ctags` (any suggestions for to handle this better are welcome). + +To address this, you can visually select as in the above examples, or resolve ambiguities interactively: +`g ` +`:ts Write` +`:ts Platform.Write` +or make vim see the qualified name as a complete keyword: +`iskeyword+=.` +in `.vimrc` +`autocmd FileType oberon,modula2 setlocal iskeyword+=.` + +**TODO** +There is some auto-completion, with but it doesn't work well. One idea is to define a custom `omnifunc` that suggests only exported symbols (`*`) from a file (module scope is file), so that when you type `OPS.` and press `` you can have useful suggestions (similar to `showdef`). + diff --git a/oberon.ctags b/oberon.ctags index d400018f..f0ef512f 100644 --- a/oberon.ctags +++ b/oberon.ctags @@ -11,27 +11,4 @@ --regex-Oberon=/^\s*MODULE\s+([a-zA-Z][a-zA-Z0-9]*)\s*;/\1/m/{scope=push} --regex-Oberon=/^\s*PROCEDURE\s*(\^|-)?\s*([a-zA-Z][a-zA-Z0-9]*)/\2/p/{scope=ref} -# NOTE Oberon-2 receiver procedures not supported -### using ctags with vim -# examples: -# vim -t "Compiler" -# vim -t "OPS.Get" -# vim -c ":ts Platform.Read" -# -# you need to jump to the fully qualified name, since procedure names alone -# sometimes resolve to an incorrect module. that is to say putting cursor on -# W in Platform.Write and jumping will probably not work as expected, so you -# might have to do some of these -# add this to yout .vimrc -# autocmd FileType oberon,modula2 setlocal iskeyword+=. -# select the qualified name -# v 3e -# :ta Platform.Write -# resolve ambiguities interactively -# :ts Write -# g -# -# if you need upward searching for tags file, so you can access them from -# project root subdirectories, then add this to your .vimrc -# set tags=./tags;~ From 7dafb02d1ed593d36da35c31f4aacb2638722296 Mon Sep 17 00:00:00 2001 From: sevoves Date: Fri, 4 Apr 2025 21:40:59 +0400 Subject: [PATCH 566/580] add ctags doc --- makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/makefile b/makefile index 7bc29843..08b69845 100644 --- a/makefile +++ b/makefile @@ -92,6 +92,7 @@ usage: @echo " make revertbootstrap - Use git checkout to restore bootstrap C source directories" # Code navigation helper +# doc/ctags.md .PHONY: tags tags: ctags -R --options=oberon.ctags --extras=+q From bb7a7311979938bf2eac19900dd416f9cd0f0def Mon Sep 17 00:00:00 2001 From: sevoves Date: Fri, 4 Apr 2025 21:44:46 +0400 Subject: [PATCH 567/580] small change in ctags.md --- doc/ctags.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/ctags.md b/doc/ctags.md index 34319208..ed646ee2 100644 --- a/doc/ctags.md +++ b/doc/ctags.md @@ -28,9 +28,9 @@ First, generate tags in project root `make tags` When you add or change names in source files, you have to regenerate the `tags` file. That can be done by running `make tags` again. Optionally, use a `vim` plugin such as [vim-gutentags](https://github.com/ludovicchabant/vim-gutentags) to automate this process. Install it (or skip this step): -``` -git clone https://github.com/ludovicchabant/vim-gutentags ~/.vim/plugin/ -``` + +`git clone https://github.com/ludovicchabant/vim-gutentags ~/.vim/plugin/` + or wherever your vim global plugin directory is specified in `:h plugin`. Add this to your `~/.vimrc` From 9846292b85056a3f4f1978e6993fb2669a3cdcf7 Mon Sep 17 00:00:00 2001 From: sevoves Date: Fri, 4 Apr 2025 21:51:30 +0400 Subject: [PATCH 568/580] minor changes in docs --- doc/ctags.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/ctags.md b/doc/ctags.md index ed646ee2..aab16dee 100644 --- a/doc/ctags.md +++ b/doc/ctags.md @@ -66,7 +66,7 @@ module definition: To come back: `` -Putting cursor on `P` of `Module.Procedure` is not guaranteed to resolve correctly to the correct module, so choose the fully qualified name. This is a [known limitation](https://docs.ctags.io/en/latest/man/ctags-faq.7.html#how-do-i-jump-to-the-tag-i-want-instead-of-the-wrong-one-by-the-same-name) of `ctags` (any suggestions for to handle this better are welcome). +Putting cursor on `P` of `Module.Procedure` is not guaranteed to resolve correctly to the correct module, so choose the fully qualified name. This is a [known limitation](https://docs.ctags.io/en/latest/man/ctags-faq.7.html#how-do-i-jump-to-the-tag-i-want-instead-of-the-wrong-one-by-the-same-name) of `ctags` (any suggestions for handling this better are welcome). To address this, you can visually select as in the above examples, or resolve ambiguities interactively: `g ` @@ -77,6 +77,6 @@ or make vim see the qualified name as a complete keyword: in `.vimrc` `autocmd FileType oberon,modula2 setlocal iskeyword+=.` -**TODO** -There is some auto-completion, with but it doesn't work well. One idea is to define a custom `omnifunc` that suggests only exported symbols (`*`) from a file (module scope is file), so that when you type `OPS.` and press `` you can have useful suggestions (similar to `showdef`). +**TODO** +There is some auto-completion, but it doesn't work well. One idea is to define a custom `omnifunc` that suggests only exported symbols (`*`) from a file (module scope is file), so that when you type `OPS.` and press `` you can have useful suggestions (similar to `showdef`). From 1fbbb68dc7f72196dd59db1bd8e24529b8adb89c Mon Sep 17 00:00:00 2001 From: sevoves Date: Fri, 4 Apr 2025 21:56:16 +0400 Subject: [PATCH 569/580] rewording ctags doc --- doc/ctags.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/ctags.md b/doc/ctags.md index aab16dee..30680898 100644 --- a/doc/ctags.md +++ b/doc/ctags.md @@ -2,7 +2,7 @@ [`ctags`](https://github.com/universal-ctags/ctags) is a tool that creates an index file for names (symbols) in various programming langauges, which helps code comprehension by giving information to text editors to search, locate, and interactively suggest names. Particularly for Oberon, the `oberon.ctags` file, located in the project root, contains definitions for Oberon modules and procedures (but not receiver procedures). -Below you can find installation instructions and usage examples for `ctags`, in particular, using the universal tags implementation (not tested with other implementations), with `vim` (you can find or add guides for your text editor), with examples that deal with Oberon source code. +Below you can find installation instructions and usage examples for `ctags` to navigate Oberon source code, in particular, using the universal tags implementation (not tested with other implementations), with `vim` (you can find or add guides for your text editor). ## Install universal tags From 378de4327444f79c5a8797b592fd53c51500d74e Mon Sep 17 00:00:00 2001 From: sevoves Date: Fri, 4 Apr 2025 22:00:31 +0400 Subject: [PATCH 570/580] rewording doc/ctags.md --- doc/ctags.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/ctags.md b/doc/ctags.md index 30680898..d6e8a40d 100644 --- a/doc/ctags.md +++ b/doc/ctags.md @@ -1,6 +1,6 @@ ## Code navigation with ctags -[`ctags`](https://github.com/universal-ctags/ctags) is a tool that creates an index file for names (symbols) in various programming langauges, which helps code comprehension by giving information to text editors to search, locate, and interactively suggest names. Particularly for Oberon, the `oberon.ctags` file, located in the project root, contains definitions for Oberon modules and procedures (but not receiver procedures). +[`ctags`](https://github.com/universal-ctags/ctags) is a tool that creates an index file for names in various programming langauges, which helps code comprehension by giving information to text editors to search, locate, and interactively suggest names, identifiers, symbols etc. Particularly for Oberon, the `oberon.ctags` file, located in the project root, contains definitions for Oberon modules and procedures (but not receiver procedures). Below you can find installation instructions and usage examples for `ctags` to navigate Oberon source code, in particular, using the universal tags implementation (not tested with other implementations), with `vim` (you can find or add guides for your text editor). From f0e92c743477c8bfe25326e5eeb8dab2850fbcfc Mon Sep 17 00:00:00 2001 From: Inna Khachikyan Date: Thu, 17 Apr 2025 23:44:56 +0400 Subject: [PATCH 571/580] modified Index checking to handle run-time variable index containing negative value --- src/runtime/SYSTEM.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/runtime/SYSTEM.h b/src/runtime/SYSTEM.h index 2ecdc7f9..39d594ed 100644 --- a/src/runtime/SYSTEM.h +++ b/src/runtime/SYSTEM.h @@ -116,9 +116,11 @@ extern void Modules_AssertFail(INT32 x); // Index checking -static inline INT64 __XF(UINT64 i, UINT64 ub) {if (i >= ub) {__HALT(-2);} return i;} -#define __X(i, ub) (((i)<(ub))?i:(__HALT(-2),0)) - +static inline INT64 __XF(INT64 i, UINT64 ub) { + if (i < 0 || (UINT64)i >= ub) __HALT(-2); + return i; +} +#define __X(i, ub) (((i) >= 0 && (i) < (ub)) ? (i) : (__HALT(-2),0)) // Range checking, and checked SHORT and CHR functions From 28c327be28a3007832b1797fa4555837e2342391 Mon Sep 17 00:00:00 2001 From: Carlos Une Date: Thu, 8 May 2025 07:41:02 -0300 Subject: [PATCH 572/580] Math, MathL: add procedure fcmp --- src/runtime/Math.Mod | 26 ++++++++++++++++++++++++++ src/runtime/MathL.Mod | 26 ++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) diff --git a/src/runtime/Math.Mod b/src/runtime/Math.Mod index b3ca4e6a..0d1d61f5 100644 --- a/src/runtime/Math.Mod +++ b/src/runtime/Math.Mod @@ -741,6 +741,32 @@ BEGIN t := ABS(x); RETURN arcsinh(x/sqrt(ONE - x * x)) END arctanh; +PROCEDURE fcmp* (x, y, epsilon: REAL): INTEGER; +(* fcmp: this procedure determines whether `x` and `y` are approximately equal + to a relative accuracy `epsilon`. + References: + The implementation is based on the GNU Scientific Library (GSL). + https://www.gnu.org/software/gsl/doc/html/math.html#approximate-comparison-of-floating-point-numbers +*) +VAR max, exponent0, delta, difference: REAL; +BEGIN + IF ABS(x) > ABS(y) THEN + max := x; + ELSE + max := y; + END; + exponent0 := exponent(max); + delta := 2.0*epsilon*power(2.0, exponent0); + difference := x - y; + IF difference > delta THEN + RETURN 1; + ELSIF difference < -delta THEN + RETURN -1; + ELSE + RETURN 0; (* approximately equal *) + END; +END fcmp; + PROCEDURE ToREAL(h: HUGEINT): REAL; BEGIN RETURN SYSTEM.VAL(REAL, h) END ToREAL; diff --git a/src/runtime/MathL.Mod b/src/runtime/MathL.Mod index bd17b490..b1448dc0 100644 --- a/src/runtime/MathL.Mod +++ b/src/runtime/MathL.Mod @@ -665,6 +665,32 @@ BEGIN t := ABS(x); RETURN arcsinh(x/sqrt(ONE-x*x)) END arctanh; +PROCEDURE fcmp* (x, y, epsilon: LONGREAL): INTEGER; +(* fcmp: this procedure determines whether `x` and `y` are approximately equal + to a relative accuracy `epsilon`. + References: + The implementation is based on the GNU Scientific Library (GSL). + https://www.gnu.org/software/gsl/doc/html/math.html#approximate-comparison-of-floating-point-numbers +*) +VAR max, exponent0, delta, difference: LONGREAL; +BEGIN + IF ABS(x) > ABS(y) THEN + max := x; + ELSE + max := y; + END; + exponent0 := exponent(max); + delta := 2.0D0*epsilon*power(2.0D0, exponent0); + difference := x - y; + IF difference > delta THEN + RETURN 1; + ELSIF difference < -delta THEN + RETURN -1; + ELSE + RETURN 0; (* approximately equal *) + END; +END fcmp; + PROCEDURE ToLONGREAL(h: HUGEINT): LONGREAL; BEGIN RETURN SYSTEM.VAL(LONGREAL, h) END ToLONGREAL; From 2f1ce08aff56f028b3ea0b041c1d721c5725f2be Mon Sep 17 00:00:00 2001 From: Norayr Chilingarian Date: Sat, 14 Jun 2025 17:12:48 +0400 Subject: [PATCH 573/580] should fix type-bound procedure name mismatch between calls and definitions --- src/compiler/OPC.Mod | 43 +++++++++++++++++++++++++------------------ 1 file changed, 25 insertions(+), 18 deletions(-) diff --git a/src/compiler/OPC.Mod b/src/compiler/OPC.Mod index d1f9027a..80e6bd66 100644 --- a/src/compiler/OPC.Mod +++ b/src/compiler/OPC.Mod @@ -409,22 +409,24 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) BEGIN IF obj # NIL THEN DefineTProcMacros(obj^.left, empty); - IF (obj^.mode = OPT.TProc) & (obj = BaseTProc(obj)) & ((OPM.currFile # OPM.HeaderFile) OR (obj^.vis = OPT.external)) THEN - OPM.WriteString("#define __"); - Ident(obj); - DeclareParams(obj^.link, TRUE); - OPM.WriteString(" __SEND("); - IF obj^.link^.typ^.form = OPT.Pointer THEN - OPM.WriteString("__TYPEOF("); Ident(obj^.link); OPM.Write(")") - ELSE Ident(obj^.link); OPM.WriteString(TagExt) - END ; - Str1(", #, ", obj^.adr DIV 10000H); - IF obj^.typ = OPT.notyp THEN OPM.WriteString('void') ELSE Ident(obj^.typ^.strobj) END ; - OPM.WriteString("(*)"); - AnsiParamList(obj^.link, FALSE); - OPM.WriteString(", "); - DeclareParams(obj^.link, TRUE); - OPM.Write(")"); OPM.WriteLn + IF (obj^.mode = OPT.TProc) & (obj = BaseTProc(obj)) THEN + IF (OPM.currFile = OPM.BodyFile) OR ((OPM.currFile = OPM.HeaderFile) & (obj^.vis = OPT.external)) THEN + OPM.WriteString("#define __"); + Ident(obj); + DeclareParams(obj^.link, TRUE); + OPM.WriteString(" __SEND("); + IF obj^.link^.typ^.form = OPT.Pointer THEN + OPM.WriteString("__TYPEOF("); Ident(obj^.link); OPM.Write(")") + ELSE Ident(obj^.link); OPM.WriteString(TagExt) + END ; + Str1(", #, ", obj^.adr DIV 10000H); + IF obj^.typ = OPT.notyp THEN OPM.WriteString('void') ELSE Ident(obj^.typ^.strobj) END ; + OPM.WriteString("(*)"); + AnsiParamList(obj^.link, FALSE); + OPM.WriteString(", "); + DeclareParams(obj^.link, TRUE); + OPM.Write(")"); OPM.WriteLn + END END ; DefineTProcMacros(obj^.right, empty) END @@ -433,7 +435,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) PROCEDURE DefineType(str: OPT.Struct); (* define a type object *) VAR obj, field, par: OPT.Object; empty: BOOLEAN; BEGIN - IF (OPM.currFile = OPM.BodyFile) OR (str^.ref < OPM.MaxStruct (*for hidden exports*) ) THEN + IF (OPM.currFile = OPM.BodyFile) OR (str^.ref < OPM.MaxStruct (*for hidden exports*) ) OR ((OPM.currFile = OPM.HeaderFile) & (str^.strobj # NIL) & (str^.strobj^.vis = OPT.external)) THEN obj := str^.strobj; IF (obj = NIL) OR Undefined(obj) THEN IF obj # NIL THEN (* check for cycles *) @@ -455,7 +457,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) ELSIF str^.comp IN {OPT.Array, OPT.DynArr} THEN IF (str^.BaseTyp^.strobj # NIL) & (str^.BaseTyp^.strobj^.linkadr = ProcessingType) THEN (*cyclic base type*) OPM.Mark(244, str^ .txtpos); str^.BaseTyp^.strobj^.linkadr := PredefinedType - END ; + END ; DefineType(str^.BaseTyp) ELSIF str^.form = OPT.ProcTyp THEN IF str^.BaseTyp # OPT.notyp THEN DefineType(str^.BaseTyp) END ; @@ -475,6 +477,11 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) IF obj^.typ^.comp = OPT.Record THEN empty := TRUE; DeclareTProcs(str^.link, empty); DefineTProcMacros(str^.link, empty); IF ~empty THEN OPM.WriteLn END + ELSIF (obj^.typ^.form = OPT.Pointer) & (obj^.typ^.BaseTyp^.comp = OPT.Record) THEN + empty := TRUE; + DeclareTProcs(obj^.typ^.BaseTyp^.link, empty); + DefineTProcMacros(obj^.typ^.BaseTyp^.link, empty); + IF ~empty THEN OPM.WriteLn END END END END From dac6504f12219e6b74e1ab6e67a93676840bd7aa Mon Sep 17 00:00:00 2001 From: Norayr Chilingarian Date: Tue, 24 Jun 2025 17:44:19 +0400 Subject: [PATCH 574/580] comments in symbol files, viewable by showdef browser. --- src/compiler/OPM.Mod | 38 +++++- src/compiler/OPS.Mod | 98 ++++++++++++-- src/compiler/OPT.Mod | 217 ++++++++++++++++++++++++------- src/library/ooc/oocIntStr.Mod | 46 +++---- src/runtime/Out.Mod | 38 ++++-- src/tools/browser/BrowserCmd.Mod | 8 ++ 6 files changed, 348 insertions(+), 97 deletions(-) diff --git a/src/compiler/OPM.Mod b/src/compiler/OPM.Mod index b64e1e94..8e9f100b 100755 --- a/src/compiler/OPM.Mod +++ b/src/compiler/OPM.Mod @@ -8,6 +8,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) CONST OptionChar* = "-"; + MaxCommentLen* = 256; (* compiler option flag bits; don't change the encoding *) inxchk* = 0; (* index check on *) @@ -76,15 +77,16 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) BFext = ".c"; (* body file extension *) HFext = ".h"; (* header file extension *) SFtag = 0F7X; (* symbol file tag *) - SFver = 083X; (* symbol file version. Increment if symbol file format is changed. *) - - + SFver = 084X; (* symbol file version. Increment if symbol file format is changed. *) TYPE FileName = ARRAY 32 OF CHAR; VAR + currentComment: ARRAY MaxCommentLen OF CHAR; + hasComment: BOOLEAN; + SourceFileName : ARRAY 256 OF CHAR; GlobalModel, Model*: ARRAY 10 OF CHAR; (* 2: S8/I16/L32, C: S16/I32/L64, V:S8/I32/L64 *) @@ -150,6 +152,33 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) LogW("."); END LogCompiling; + (* for exported comments *) + PROCEDURE StoreComment*(text: ARRAY OF CHAR); + VAR i: INTEGER; + BEGIN + i := 0; + WHILE (i < MaxCommentLen - 1) & (text[i] # 0X) DO + currentComment[i] := text[i]; INC(i) + END; + currentComment[i] := 0X; + hasComment := TRUE; + END StoreComment; + + PROCEDURE GetComment*(VAR text: ARRAY OF CHAR); + VAR i: INTEGER; + BEGIN + IF hasComment THEN + i := 0; + WHILE (i < LEN(text)) & (i < MaxCommentLen) & (currentComment[i] # 0X) DO + text[i] := currentComment[i]; INC(i) + END; + text[i] := 0X; + hasComment := FALSE + ELSE + text[0] := 0X + END; + END GetComment; + (* Integer size support *) @@ -830,4 +859,7 @@ BEGIN MinReal := -MaxReal; MinLReal := -MaxLReal; FindInstallDir; + + hasComment := FALSE; + currentComment[0] := 0X; END OPM. diff --git a/src/compiler/OPS.Mod b/src/compiler/OPS.Mod index 9cb59e37..ab68d629 100644 --- a/src/compiler/OPS.Mod +++ b/src/compiler/OPS.Mod @@ -190,22 +190,92 @@ MODULE OPS; (* NW, RC 6.3.89 / 18.10.92 *) (* object model 3.6.92 *) PROCEDURE Get*(VAR sym: SHORTINT); VAR s: SHORTINT; - PROCEDURE Comment; (* do not read after end of file *) - BEGIN OPM.Get(ch); - LOOP - LOOP - WHILE ch = "(" DO OPM.Get(ch); - IF ch = "*" THEN Comment END - END ; - IF ch = "*" THEN OPM.Get(ch); EXIT END ; - IF ch = OPM.Eot THEN EXIT END ; - OPM.Get(ch) - END ; - IF ch = ")" THEN OPM.Get(ch); EXIT END ; - IF ch = OPM.Eot THEN err(5); EXIT END - END + PROCEDURE Comment; + VAR + isExported: BOOLEAN; + commentText: ARRAY OPM.MaxCommentLen OF CHAR; + i: INTEGER; + nestLevel: INTEGER; + prevCh, nextCh: CHAR; + BEGIN + FOR i := 0 TO LEN(commentText) - 1 DO + commentText[i] := 0X + END; + + isExported := FALSE; + i := 0; + nestLevel := 1; + prevCh := 0X; + + OPM.Get(ch); + + IF ch = "*" THEN + isExported := TRUE; + OPM.Get(ch); + IF ch = ")" THEN + (* Empty exported comment (**), handle and return *) + commentText[0] := 0X; + OPM.StoreComment(commentText); + OPM.Get(ch); (* consume character after closing comment *) + RETURN + END + END; + + WHILE (nestLevel > 0) & (ch # OPM.Eot) DO + IF (prevCh = "(") & (ch = "*") THEN + INC(nestLevel); + prevCh := 0X + ELSIF (prevCh = "*") & (ch = ")") THEN + DEC(nestLevel); + IF nestLevel = 0 THEN + OPM.Get(ch); (* move past ')' *) + ELSE + prevCh := 0X + END + ELSE + IF isExported & (nestLevel = 1) & (prevCh # 0X) THEN + IF i < OPM.MaxCommentLen - 1 THEN + commentText[i] := prevCh; INC(i) + END + END; + + prevCh := ch + END; + + IF nestLevel > 0 THEN OPM.Get(ch) END + END; + + IF ch = OPM.Eot THEN + err(5) + END; + (* + IF isExported & (nestLevel = 0) & (prevCh # 0X) & (prevCh # "*") & (i < OPM.MaxCommentLen - 2) THEN + commentText[i] := prevCh; + INC(i) + END; + *) + IF isExported & (nestLevel = 0) & (prevCh # 0X) & (prevCh # "*") THEN + IF i < OPM.MaxCommentLen - 1 THEN + commentText[i] := prevCh; + INC(i) + ELSE + OPM.LogWStr("Truncating final comment character"); OPM.LogWLn + END + END; + + + IF isExported THEN + IF i >= OPM.MaxCommentLen THEN + OPM.LogWStr("Warning: commentText overflow"); OPM.LogWLn; + i := OPM.MaxCommentLen - 1 + END; + commentText[i] := 0X; + OPM.StoreComment(commentText) + END; + END Comment; + BEGIN OPM.errpos := OPM.curpos-1; WHILE ch <= " " DO (*ignore control characters*) diff --git a/src/compiler/OPT.Mod b/src/compiler/OPT.Mod index 758bb505..a2e5f913 100644 --- a/src/compiler/OPT.Mod +++ b/src/compiler/OPT.Mod @@ -46,7 +46,8 @@ TYPE typ*: Struct; conval*: Const; adr*, linkadr*: LONGINT; - x*: INTEGER (* linkadr and x can be freely used by the backend *) + x*: INTEGER; (* linkadr and x can be freely used by the backend *) + comment*: ConstExt; END; CONST @@ -178,6 +179,7 @@ CONST Shdptr* = 27; Shdpro* = 28; Stpro* = 29; Shdtpro* = 30; Sxpro* = 31; Sipro* = 32; Scpro* = 33; Sstruct* = 34; Ssys* = 35; Sptr* = 36; Sarr* = 37; Sdarr* = 38; Srec* = 39; Spro* = 40; Slink* = 37; + Scomment* = 41; TYPE ImpCtxt = RECORD @@ -367,7 +369,15 @@ END NewConst; PROCEDURE NewObj*(): Object; VAR obj: Object; -BEGIN NEW(obj); RETURN obj +BEGIN + NEW(obj); + (* lets fully init pointers *) + obj^.typ := NIL; + obj^.conval := NIL; + obj^.comment := NIL; + obj^.name := ""; + + RETURN obj END NewObj; PROCEDURE NewStr*(form, comp: SHORTINT): Struct; @@ -468,8 +478,16 @@ BEGIN END FindField; PROCEDURE Insert*(VAR name: OPS.Name; VAR obj: Object); - VAR ob0, ob1: Object; left: BOOLEAN; mnolev: SHORTINT; -BEGIN ob0 := topScope; ob1 := ob0^.right; left := FALSE; +VAR + ob0, ob1: Object; + left: BOOLEAN; + mnolev: SHORTINT; + commentText: ARRAY OPM.MaxCommentLen OF CHAR; + j: INTEGER; +BEGIN + ob0 := topScope; + ob1 := ob0^.right; + left := FALSE; LOOP IF ob1 # NIL THEN IF name < ob1^.name THEN ob0 := ob1; ob1 := ob0^.left; left := TRUE @@ -480,13 +498,24 @@ BEGIN ob0 := topScope; ob1 := ob0^.right; left := FALSE; IF left THEN ob0^.left := ob1 ELSE ob0^.right := ob1 END; ob1^.left := NIL; ob1^.right := NIL; COPY(name, ob1^.name); mnolev := topScope^.mnolev; ob1^.mnolev := mnolev; + (* Attach pending comment *) + OPM.GetComment(commentText); + IF commentText[0] # 0X THEN + NEW(ob1^.comment); + (*COPY(commentText, ob1^.comment^);*) + j := 0; + WHILE (j < OPM.MaxCommentLen - 1) & (commentText[j] # 0X) DO + ob1^.comment^[j] := commentText[j]; + INC(j) + END; + ob1^.comment^[j] := 0X; + END; EXIT END END; obj := ob1 END Insert; - (*-------------------------- Fingerprinting --------------------------*) (* Fingerprints prevent structural type equivalence. *) @@ -791,13 +820,25 @@ PROCEDURE InSign(mno: SHORTINT; VAR res: Struct; VAR par: Object); VAR last, new: Object; tag: LONGINT; BEGIN InStruct(res); - tag := OPM.SymRInt(); last := NIL; + tag := OPM.SymRInt(); + last := NIL; WHILE tag # Send DO - new := NewObj(); new^.mnolev := -mno; + + (* Add bounds checking *) + IF (tag < 0) OR (tag > 100) THEN + OPM.LogWStr("ERROR: Invalid tag value in InSign: "); OPM.LogWNum(tag, 0); OPM.LogWLn; + OPM.err(155); (* symbol file corrupted *) + RETURN + END; + + new := NewObj(); + new^.mnolev := -mno; IF last = NIL THEN par := new ELSE last^.link := new END; IF tag = Svalpar THEN new^.mode := Var ELSE new^.mode := VarPar END; - InStruct(new^.typ); new^.adr := OPM.SymRInt(); InName(new^.name); - last := new; tag := OPM.SymRInt() + InStruct(new^.typ); + new^.adr := OPM.SymRInt(); InName(new^.name); + last := new; + tag := OPM.SymRInt(); END END InSign; @@ -973,11 +1014,46 @@ BEGIN END END InStruct; + PROCEDURE InObj(mno: SHORTINT): Object; (* first number in impCtxt.nextTag *) VAR i, s: INTEGER; ch: CHAR; obj, old: Object; typ: Struct; tag: LONGINT; ext: ConstExt; + commentText: OPS.Name; + hasComment : BOOLEAN; + j: INTEGER; + len: LONGINT; BEGIN tag := impCtxt.nextTag; + hasComment := FALSE; + + (* checking for comment first, but not processing it yet *) + WHILE tag = Scomment DO (* Handle multiple consecutive comments *) + len := OPM.SymRInt(); (* read length *) + + (* Ensure length is within bounds *) + IF len < 0 THEN len := 0 END; + IF len > OPS.MaxStrLen - 1 THEN len := OPS.MaxStrLen - 1 END; + + i := 0; + WHILE i < len DO + OPM.SymRCh(commentText[i]); INC(i) + END; + commentText[i] := 0X; + hasComment := TRUE; (* Only keep the last comment if there are multiple *) + + tag := OPM.SymRInt(); (* continue stream *) + END; + + (* Now tag should be a valid object tag *) + impCtxt.nextTag := tag; + + (* Validate tag value *) + IF (tag < 0) OR (tag > 50) THEN + OPM.LogWStr("ERROR: Invalid tag in InObj: "); OPM.LogWNum(tag, 0); OPM.LogWLn; + OPM.err(155); (* Symbol file error *) + RETURN NIL + END; + IF tag = Stype THEN InStruct(typ); obj := typ^.strobj; IF ~impCtxt.self THEN obj^.vis := external END (* type name visible now, obj^.fprint already done *) @@ -986,7 +1062,7 @@ BEGIN IF tag <= Pointer THEN (* Constant *) obj^.mode := Con; obj^.conval := NewConst(); InConstant(tag, obj^.conval); obj^.typ := InTyp(tag) - ELSIF tag >= Sxpro THEN + ELSIF (tag >= Sxpro) & (tag <= Scpro) THEN (* Procedure tags *) obj^.conval := NewConst(); obj^.conval^.intval := -1; InSign(mno, obj^.typ, obj^.link); @@ -998,16 +1074,33 @@ BEGIN s := SHORT(OPM.SymRInt()); ext^[0] := CHR(s); i := 1; WHILE i <= s DO OPM.SymRCh(ext^[i]); INC(i) END ELSE OPM.LogWStr("unhandled case at InObj, tag = "); OPM.LogWNum(tag, 0); OPM.LogWLn; + OPM.err(155); RETURN NIL END ELSIF tag = Salias THEN obj^.mode := Typ; InStruct(obj^.typ) - ELSE + ELSIF (tag = Svar) OR (tag = Srvar) THEN obj^.mode := Var; IF tag = Srvar THEN obj^.vis := externalR END; InStruct(obj^.typ) + ELSE + OPM.LogWStr("ERROR: Unexpected tag in InObj: "); OPM.LogWNum(tag, 0); OPM.LogWLn; + OPM.err(155); (* Symbol file error *) + RETURN NIL END; InName(obj^.name) END; + + (* attaching exported comment after the object was created *) + IF hasComment & (obj # NIL) THEN + NEW(obj^.comment); + j := 0; + WHILE (j < OPM.MaxCommentLen - 1) & (j < len) & (commentText[j] # 0X) DO + obj^.comment^[j] := commentText[j]; + INC(j) + END; + obj^.comment^[j] := 0X; + END; + FPrintObj(obj); IF (obj^.mode = Var) & ((obj^.typ^.strobj = NIL) OR (obj^.typ^.strobj^.name = "")) THEN (* compute a global fingerprint to avoid structural type equivalence for anonymous types *) @@ -1040,6 +1133,8 @@ BEGIN RETURN obj END InObj; + + PROCEDURE Import*(aliasName: OPS.Name; VAR name: OPS.Name; VAR done: BOOLEAN); VAR obj: Object; mno: SHORTINT; (* done used in Browser *) BEGIN @@ -1226,45 +1321,71 @@ END Import; END END OutConstant; - PROCEDURE OutObj(obj: Object); - VAR i, j: INTEGER; ext: ConstExt; - BEGIN - IF obj # NIL THEN - OutObj(obj^.left); - IF obj^.mode IN {Con, Typ, Var, LProc, XProc, CProc, IProc} THEN - IF obj^.history = removed THEN FPrintErr(obj, 250) - ELSIF obj^.vis # internal THEN - CASE obj^.history OF - | inserted: FPrintErr(obj, 253) - | same: (* ok *) - | pbmodified: FPrintErr(obj, 252) - | pvmodified: FPrintErr(obj, 251) - ELSE OPM.LogWStr("unhandled case at OutObj, obj^.history = "); OPM.LogWNum(obj^.history, 0); OPM.LogWLn; - END; - CASE obj^.mode OF - | Con: OutConstant(obj); OutName(obj^.name) - | Typ: IF obj^.typ^.strobj = obj THEN OPM.SymWInt(Stype); OutStr(obj^.typ) - ELSE OPM.SymWInt(Salias); OutStr(obj^.typ); OutName(obj^.name) - END - | Var: IF obj^.vis = externalR THEN OPM.SymWInt(Srvar) ELSE OPM.SymWInt(Svar) END; - OutStr(obj^.typ); OutName(obj^.name); - IF (obj^.typ^.strobj = NIL) OR (obj^.typ^.strobj^.name = "") THEN - (* compute fingerprint to avoid structural type equivalence *) - OPM.FPrint(expCtxt.reffp, obj^.typ^.ref) - END - | XProc: OPM.SymWInt(Sxpro); OutSign(obj^.typ, obj^.link); OutName(obj^.name) - | IProc: OPM.SymWInt(Sipro); OutSign(obj^.typ, obj^.link); OutName(obj^.name) - | CProc: OPM.SymWInt(Scpro); OutSign(obj^.typ, obj^.link); ext := obj^.conval^.ext; - j := ORD(ext^[0]); i := 1; OPM.SymWInt(j); - WHILE i <= j DO OPM.SymWCh(ext^[i]); INC(i) END; - OutName(obj^.name) - ELSE OPM.LogWStr("unhandled case at OutObj, obj.mode = "); OPM.LogWNum(obj.mode, 0); OPM.LogWLn; - END +PROCEDURE OutTruncatedName(text: ARRAY OF CHAR); +VAR i: INTEGER; +BEGIN + i := 0; + WHILE (i < OPS.MaxStrLen - 1) & (text[i] # 0X) DO + OPM.SymWCh(text[i]); INC(i) + END; + OPM.SymWCh(0X) +END OutTruncatedName; + + +PROCEDURE OutObj(obj: Object); + VAR i, j: INTEGER; ext: ConstExt; + k, l: INTEGER; +BEGIN + IF obj # NIL THEN + OutObj(obj^.left); + IF obj^.mode IN {Con, Typ, Var, LProc, XProc, CProc, IProc} THEN + (* Write comment BEFORE the object *) + IF obj^.comment # NIL THEN + OPM.SymWInt(Scomment); + (* Calculate actual length of comment text *) + k := 0; + WHILE (k < OPM.MaxCommentLen - 1) & (obj^.comment^[k] # 0X) DO INC(k) END; + OPM.SymWInt(k); (* length prefix *) + (* Write comment data as individual characters *) + l := 0; + WHILE l < k DO + OPM.SymWCh(obj^.comment^[l]); INC(l) END END; - OutObj(obj^.right) - END - END OutObj; + + IF obj^.history = removed THEN FPrintErr(obj, 250) + ELSIF obj^.vis # internal THEN + CASE obj^.history OF + | inserted: FPrintErr(obj, 253) + | same: (* ok *) + | pbmodified: FPrintErr(obj, 252) + | pvmodified: FPrintErr(obj, 251) + ELSE OPM.LogWStr("unhandled case at OutObj, obj^.history = "); OPM.LogWNum(obj^.history, 0); OPM.LogWLn; + END; + CASE obj^.mode OF + | Con: OutConstant(obj); OutName(obj^.name) + | Typ: IF obj^.typ^.strobj = obj THEN OPM.SymWInt(Stype); OutStr(obj^.typ) + ELSE OPM.SymWInt(Salias); OutStr(obj^.typ); OutName(obj^.name) + END + | Var: IF obj^.vis = externalR THEN OPM.SymWInt(Srvar) ELSE OPM.SymWInt(Svar) END; + OutStr(obj^.typ); OutName(obj^.name); + IF (obj^.typ^.strobj = NIL) OR (obj^.typ^.strobj^.name = "") THEN + (* compute fingerprint to avoid structural type equivalence *) + OPM.FPrint(expCtxt.reffp, obj^.typ^.ref) + END + | XProc: OPM.SymWInt(Sxpro); OutSign(obj^.typ, obj^.link); OutName(obj^.name) + | IProc: OPM.SymWInt(Sipro); OutSign(obj^.typ, obj^.link); OutName(obj^.name) + | CProc: OPM.SymWInt(Scpro); OutSign(obj^.typ, obj^.link); ext := obj^.conval^.ext; + j := ORD(ext^[0]); i := 1; OPM.SymWInt(j); + WHILE i <= j DO OPM.SymWCh(ext^[i]); INC(i) END; + OutName(obj^.name) + ELSE OPM.LogWStr("unhandled case at OutObj, obj.mode = "); OPM.LogWNum(obj.mode, 0); OPM.LogWLn; + END + END + END; + OutObj(obj^.right) + END +END OutObj; PROCEDURE Export*(VAR ext, new: BOOLEAN); VAR i: INTEGER; nofmod: SHORTINT; done: BOOLEAN; diff --git a/src/library/ooc/oocIntStr.Mod b/src/library/ooc/oocIntStr.Mod index ec98f128..b5f9d928 100644 --- a/src/library/ooc/oocIntStr.Mod +++ b/src/library/ooc/oocIntStr.Mod @@ -1,47 +1,47 @@ -(* $Id: IntStr.Mod,v 1.4 1999/09/02 13:07:47 acken Exp $ *) +(* $Id: IntStr.Mod,v 1.4 1999/09/02 13:07:47 acken Exp $ *) MODULE oocIntStr; -(* IntStr - Integer-number/string conversions. +(* IntStr - Integer-number/string conversions. Copyright (C) 1995 Michael Griebling - + This module is free software; you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as + it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This module is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. - + You should have received a copy of the GNU Lesser General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *) - + IMPORT Conv := oocConvTypes, IntConv := oocIntConv; - + TYPE - ConvResults*= Conv.ConvResults; - (* possible values: strAllRight, strOutOfRange, strWrongFormat, strEmpty *) + ConvResults*= Conv.ConvResults; + (** possible values: strAllRight, strOutOfRange, strWrongFormat, strEmpty *) CONST strAllRight*=Conv.strAllRight; - (* the string format is correct for the corresponding conversion *) + (** the string format is correct for the corresponding conversion *) strOutOfRange*=Conv.strOutOfRange; - (* the string is well-formed but the value cannot be represented *) + (** the string is well-formed but the value cannot be represented *) strWrongFormat*=Conv.strWrongFormat; - (* the string is in the wrong format for the conversion *) + (** the string is in the wrong format for the conversion *) strEmpty*=Conv.strEmpty; - (* the given string is empty *) - - -(* the string form of a signed whole number is + (** the given string is empty *) + + +(** the string form of a signed whole number is ["+" | "-"] decimal_digit {decimal_digit} *) - + PROCEDURE StrToInt*(str: ARRAY OF CHAR; VAR int: LONGINT; VAR res: ConvResults); -(* Ignores any leading spaces in `str'. If the subsequent characters in `str' +(** Ignores any leading spaces in `str'. If the subsequent characters in `str' are in the format of a signed whole number, assigns a corresponding value to `int'. Assigns a value indicating the format of `str' to `res'. *) BEGIN @@ -53,7 +53,7 @@ END StrToInt; PROCEDURE Reverse (VAR str : ARRAY OF CHAR; start, end : INTEGER); -(* Reverses order of characters in the interval [start..end]. *) +(** Reverses order of characters in the interval [start..end]. *) VAR h : CHAR; BEGIN @@ -65,7 +65,7 @@ END Reverse; PROCEDURE IntToStr*(int: LONGINT; VAR str: ARRAY OF CHAR); -(* Converts the value of `int' to string form and copies the possibly truncated +(** Converts the value of `int' to string form and copies the possibly truncated result to `str'. *) CONST maxLength = 11; (* maximum number of digits representing a LONGINT value *) @@ -92,9 +92,9 @@ BEGIN b[e] := 0X; Reverse(b, s, e-1) END; - + COPY(b, str) (* truncate output if necessary *) END IntToStr; - + END oocIntStr. diff --git a/src/runtime/Out.Mod b/src/runtime/Out.Mod index bdb6b8df..8895037c 100644 --- a/src/runtime/Out.Mod +++ b/src/runtime/Out.Mod @@ -1,4 +1,7 @@ MODULE Out; (* DCW Brown. 2016-09-27 *) + (** Module Out provides a set of basic routines + for formatted output of characters, numbers, and strings. + It assumes a standard output stream to which the symbols are written. *) IMPORT SYSTEM, Platform, Heap; @@ -16,11 +19,11 @@ BEGIN IF in > 0 THEN error := Platform.Write(Platform.StdOut, SYSTEM.ADR(buf), in) END; in := 0; END Flush; - +(** Initializes the output stream. In this library does nothing, safe to never use. *) PROCEDURE Open*; BEGIN END Open; - +(** Writes the character to the end of the output stream. *) PROCEDURE Char*(ch: CHAR); BEGIN IF in >= LEN(buf) THEN Flush END; @@ -32,7 +35,7 @@ PROCEDURE Length(VAR s: ARRAY OF CHAR): LONGINT; VAR l: LONGINT; BEGIN l := 0; WHILE (l < LEN(s)) & (s[l] # 0X) DO INC(l) END; RETURN l END Length; - +(** Writes the null-terminated character sequence str to the end of the output stream (without 0X). *) PROCEDURE String*(str: ARRAY OF CHAR); VAR l: LONGINT; error: Platform.ErrorCode; BEGIN @@ -46,7 +49,10 @@ BEGIN END END String; - +(** Writes the integer number x to the end of the output stream. + If the textual representation of x requires m characters, + x is right adjusted in a field of Max(n, m) characters + padded with blanks at the left end. a plus sign is not written. *) PROCEDURE Int*(x, n: HUGEINT); CONST zero = ORD('0'); VAR s: ARRAY 22 OF CHAR; i: INTEGER; negative: BOOLEAN; @@ -82,7 +88,7 @@ BEGIN ELSE Char(CHR((x MOD 16) - 10 + ORD('A'))) END END END Hex; - +(** Writes an end-of-line symbol to the end of the output stream *) PROCEDURE Ln*; BEGIN String(Platform.NL); Flush; END Ln; @@ -117,14 +123,15 @@ END Ten; PROCEDURE -Entier64(x: LONGREAL): SYSTEM.INT64 "(INT64)(x)"; -PROCEDURE RealP(x: LONGREAL; n: INTEGER; long: BOOLEAN); - -(* RealP(x, n) writes the long real number x to the end of the output stream using an +(** RealP(x, n) writes the long real number x to the end of the output stream using an exponential form. If the textual representation of x requires m characters (including a three-digit signed exponent), x is right adjusted in a ï¬eld of Max(n, m) characters padded with blanks at the left end. A plus sign of the mantissa is not written. LONGREAL is 1/sign, 11/exponent, 52/significand *) +PROCEDURE RealP(x: LONGREAL; n: INTEGER; long: BOOLEAN); + + VAR e: INTEGER; (* Exponent field *) f: HUGEINT; (* Fraction field *) @@ -212,11 +219,18 @@ BEGIN WHILE i < LEN(s) DO Char(s[i]); INC(i) END END RealP; - +(** Writes the real number x to the end of the output stream using an exponential + form. If the textual representation of x requires m characters (including a + two-digit signed exponent), x is right adjusted in a field of Max(n, m) characters + padded with blanks at the left end. A plus sign of the mantissa is not written.*) PROCEDURE Real*(x: REAL; n: INTEGER); BEGIN RealP(x, n, FALSE); END Real; +(** Writes the long real number x to the end of the output stream using an exponential form. + If the textual representation of x requires m characters (including a three-digit + signed exponent), x is right adjusted in a field of Max(n, m) characters padded + with blanks at the left end. A plus sign of the mantissa is not written. *) PROCEDURE LongReal*(x: LONGREAL; n: INTEGER); BEGIN RealP(x, n, TRUE); END LongReal; @@ -224,4 +238,10 @@ END LongReal; BEGIN IsConsole := Platform.IsConsole(Platform.StdOut); in := 0 + +(** This module originally was designed by Martin Reiser + for the book "Programming in Oberon". + the specification was proposed by H. Moessenbock *) + END Out. + diff --git a/src/tools/browser/BrowserCmd.Mod b/src/tools/browser/BrowserCmd.Mod index 14df830f..30871d59 100644 --- a/src/tools/browser/BrowserCmd.Mod +++ b/src/tools/browser/BrowserCmd.Mod @@ -63,6 +63,14 @@ MODULE BrowserCmd; (* RC 29.10.93 *) (* object model 4.12.93, command line ver IF obj # NIL THEN Objects(obj^.left, mode); IF obj^.mode IN mode THEN + (* Output comment if present *) + IF obj^.comment # NIL THEN + Indent(1); + Ws("(** "); + Ws(obj^.comment^); + Ws(" *)"); + Wln + END; CASE obj^.mode OF |OPT.Con: Indent(2); Ws(obj^.name); Ws(" = "); CASE obj^.typ^.form OF From a9465ccfc6510de08b3daeadd4d5f38ed9d32aae Mon Sep 17 00:00:00 2001 From: Norayr Chilingarian Date: Tue, 24 Jun 2025 18:27:35 +0400 Subject: [PATCH 575/580] bootstrap sources. --- bootstrap/SYSTEM.h | 8 +- bootstrap/unix-44/Compiler.c | 2 +- bootstrap/unix-44/Configuration.c | 4 +- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Files.c | 2 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 2 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 59 ++++++++------- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 42 ++++++++++- bootstrap/unix-44/OPM.h | 4 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 80 +++++++++++++++----- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 107 ++++++++++++++++++++++++++- bootstrap/unix-44/OPT.h | 3 +- bootstrap/unix-44/OPV.c | 2 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Out.c | 2 +- bootstrap/unix-44/Out.h | 2 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/VT100.c | 2 +- bootstrap/unix-44/VT100.h | 2 +- bootstrap/unix-44/extTools.c | 4 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-48/Compiler.c | 2 +- bootstrap/unix-48/Configuration.c | 4 +- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Files.c | 2 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 2 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 59 ++++++++------- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 42 ++++++++++- bootstrap/unix-48/OPM.h | 4 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 80 +++++++++++++++----- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 107 ++++++++++++++++++++++++++- bootstrap/unix-48/OPT.h | 3 +- bootstrap/unix-48/OPV.c | 2 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Out.c | 2 +- bootstrap/unix-48/Out.h | 2 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/VT100.c | 2 +- bootstrap/unix-48/VT100.h | 2 +- bootstrap/unix-48/extTools.c | 4 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-88/Compiler.c | 2 +- bootstrap/unix-88/Configuration.c | 4 +- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Files.c | 2 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 2 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 59 ++++++++------- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 42 ++++++++++- bootstrap/unix-88/OPM.h | 4 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 80 +++++++++++++++----- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 107 ++++++++++++++++++++++++++- bootstrap/unix-88/OPT.h | 3 +- bootstrap/unix-88/OPV.c | 2 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Out.c | 2 +- bootstrap/unix-88/Out.h | 2 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/VT100.c | 2 +- bootstrap/unix-88/VT100.h | 2 +- bootstrap/unix-88/extTools.c | 4 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/windows-48/Compiler.c | 2 +- bootstrap/windows-48/Configuration.c | 4 +- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Files.c | 2 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 2 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 59 ++++++++------- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 42 ++++++++++- bootstrap/windows-48/OPM.h | 4 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 80 +++++++++++++++----- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 107 ++++++++++++++++++++++++++- bootstrap/windows-48/OPT.h | 3 +- bootstrap/windows-48/OPV.c | 2 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Out.c | 2 +- bootstrap/windows-48/Out.h | 2 +- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/VT100.c | 2 +- bootstrap/windows-48/VT100.h | 2 +- bootstrap/windows-48/extTools.c | 4 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-88/Compiler.c | 2 +- bootstrap/windows-88/Configuration.c | 4 +- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Files.c | 2 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 2 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 59 ++++++++------- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 42 ++++++++++- bootstrap/windows-88/OPM.h | 4 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 80 +++++++++++++++----- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 107 ++++++++++++++++++++++++++- bootstrap/windows-88/OPT.h | 3 +- bootstrap/windows-88/OPV.c | 2 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Out.c | 2 +- bootstrap/windows-88/Out.h | 2 +- bootstrap/windows-88/Platform.c | 2 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/VT100.c | 2 +- bootstrap/windows-88/VT100.h | 2 +- bootstrap/windows-88/extTools.c | 4 +- bootstrap/windows-88/extTools.h | 2 +- src/library/ooc/oocIntStr.Mod | 20 ++--- 187 files changed, 1390 insertions(+), 443 deletions(-) diff --git a/bootstrap/SYSTEM.h b/bootstrap/SYSTEM.h index 2ecdc7f9..39d594ed 100644 --- a/bootstrap/SYSTEM.h +++ b/bootstrap/SYSTEM.h @@ -116,9 +116,11 @@ extern void Modules_AssertFail(INT32 x); // Index checking -static inline INT64 __XF(UINT64 i, UINT64 ub) {if (i >= ub) {__HALT(-2);} return i;} -#define __X(i, ub) (((i)<(ub))?i:(__HALT(-2),0)) - +static inline INT64 __XF(INT64 i, UINT64 ub) { + if (i < 0 || (UINT64)i >= ub) __HALT(-2); + return i; +} +#define __X(i, ub) (((i) >= 0 && (i) < (ub)) ? (i) : (__HALT(-2),0)) // Range checking, and checked SHORT and CHR functions diff --git a/bootstrap/unix-44/Compiler.c b/bootstrap/unix-44/Compiler.c index 1807e545..4460479d 100644 --- a/bootstrap/unix-44/Compiler.c +++ b/bootstrap/unix-44/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index fb7a8f35..fa87c9de 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index c8bae246..c3c54eed 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 7ce57bc2..54341368 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index 3622bbe7..ccdabcc2 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index df721094..42552415 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index dbc11b6f..3cde1c3b 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index 00137463..535721e8 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index 22468d7d..26d86b38 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index 4d4925c6..913fbf2d 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index cb41ad3d..f66fcd66 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index dc9da7db..7b92ccc1 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -618,31 +618,33 @@ static void OPC_DefineTProcMacros (OPT_Object obj, BOOLEAN *empty) { if (obj != NIL) { OPC_DefineTProcMacros(obj->left, &*empty); - if ((((obj->mode == 13 && obj == OPC_BaseTProc(obj))) && (OPM_currFile != 0 || obj->vis == 1))) { - OPM_WriteString((CHAR*)"#define __", 11); - OPC_Ident(obj); - OPC_DeclareParams(obj->link, 1); - OPM_WriteString((CHAR*)" __SEND(", 9); - if (obj->link->typ->form == 11) { - OPM_WriteString((CHAR*)"__TYPEOF(", 10); - OPC_Ident(obj->link); + if ((obj->mode == 13 && obj == OPC_BaseTProc(obj))) { + if (OPM_currFile == 1 || (OPM_currFile == 0 && obj->vis == 1)) { + OPM_WriteString((CHAR*)"#define __", 11); + OPC_Ident(obj); + OPC_DeclareParams(obj->link, 1); + OPM_WriteString((CHAR*)" __SEND(", 9); + if (obj->link->typ->form == 11) { + OPM_WriteString((CHAR*)"__TYPEOF(", 10); + OPC_Ident(obj->link); + OPM_Write(')'); + } else { + OPC_Ident(obj->link); + OPM_WriteString((CHAR*)"__typ", 6); + } + OPC_Str1((CHAR*)", #, ", 6, __ASHR(obj->adr, 16)); + if (obj->typ == OPT_notyp) { + OPM_WriteString((CHAR*)"void", 5); + } else { + OPC_Ident(obj->typ->strobj); + } + OPM_WriteString((CHAR*)"(*)", 4); + OPC_AnsiParamList(obj->link, 0); + OPM_WriteString((CHAR*)", ", 3); + OPC_DeclareParams(obj->link, 1); OPM_Write(')'); - } else { - OPC_Ident(obj->link); - OPM_WriteString((CHAR*)"__typ", 6); + OPM_WriteLn(); } - OPC_Str1((CHAR*)", #, ", 6, __ASHR(obj->adr, 16)); - if (obj->typ == OPT_notyp) { - OPM_WriteString((CHAR*)"void", 5); - } else { - OPC_Ident(obj->typ->strobj); - } - OPM_WriteString((CHAR*)"(*)", 4); - OPC_AnsiParamList(obj->link, 0); - OPM_WriteString((CHAR*)", ", 3); - OPC_DeclareParams(obj->link, 1); - OPM_Write(')'); - OPM_WriteLn(); } OPC_DefineTProcMacros(obj->right, &*empty); } @@ -652,7 +654,7 @@ static void OPC_DefineType (OPT_Struct str) { OPT_Object obj = NIL, field = NIL, par = NIL; BOOLEAN empty; - if (OPM_currFile == 1 || str->ref < 255) { + if ((OPM_currFile == 1 || str->ref < 255) || (((OPM_currFile == 0 && str->strobj != NIL)) && str->strobj->vis == 1)) { obj = str->strobj; if (obj == NIL || OPC_Undefined(obj)) { if (obj != NIL) { @@ -719,6 +721,13 @@ static void OPC_DefineType (OPT_Struct str) if (!empty) { OPM_WriteLn(); } + } else if ((obj->typ->form == 11 && obj->typ->BaseTyp->comp == 4)) { + empty = 1; + OPC_DeclareTProcs(obj->typ->BaseTyp->link, &empty); + OPC_DefineTProcMacros(obj->typ->BaseTyp->link, &empty); + if (!empty) { + OPM_WriteLn(); + } } } } diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index fd7ddb5e..3bfd88b8 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index d2462ff6..bcb39247 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,8 @@ typedef CHAR OPM_FileName[32]; +static CHAR OPM_currentComment[256]; +static BOOLEAN OPM_hasComment; static CHAR OPM_SourceFileName[256]; static CHAR OPM_GlobalModel[10]; export CHAR OPM_Model[10]; @@ -59,6 +61,7 @@ static void OPM_FindInstallDir (void); static void OPM_FindLine (Files_File f, Files_Rider *r, ADDRESS *r__typ, INT64 pos); static void OPM_FingerprintBytes (INT32 *fp, SYSTEM_BYTE *bytes, ADDRESS bytes__len); export void OPM_Get (CHAR *ch); +export void OPM_GetComment (CHAR *text, ADDRESS text__len); export void OPM_Init (BOOLEAN *done); export void OPM_InitOptions (void); export INT16 OPM_Integer (INT64 n); @@ -82,6 +85,7 @@ static void OPM_ScanOptions (CHAR *s, ADDRESS s__len); static void OPM_ShowLine (INT64 pos); export INT64 OPM_SignedMaximum (INT32 bytecount); export INT64 OPM_SignedMinimum (INT32 bytecount); +export void OPM_StoreComment (CHAR *text, ADDRESS text__len); export void OPM_SymRCh (CHAR *ch); export INT32 OPM_SymRInt (void); export INT64 OPM_SymRInt64 (void); @@ -157,6 +161,36 @@ void OPM_LogCompiling (CHAR *modname, ADDRESS modname__len) __DEL(modname); } +void OPM_StoreComment (CHAR *text, ADDRESS text__len) +{ + INT16 i; + __DUP(text, text__len, CHAR); + i = 0; + while ((i < 255 && text[__X(i, text__len)] != 0x00)) { + OPM_currentComment[__X(i, 256)] = text[__X(i, text__len)]; + i += 1; + } + OPM_currentComment[__X(i, 256)] = 0x00; + OPM_hasComment = 1; + __DEL(text); +} + +void OPM_GetComment (CHAR *text, ADDRESS text__len) +{ + INT16 i; + if (OPM_hasComment) { + i = 0; + while ((((i < text__len && i < 256)) && OPM_currentComment[__X(i, 256)] != 0x00)) { + text[__X(i, text__len)] = OPM_currentComment[__X(i, 256)]; + i += 1; + } + text[__X(i, text__len)] = 0x00; + OPM_hasComment = 0; + } else { + text[0] = 0x00; + } +} + INT64 OPM_SignedMaximum (INT32 bytecount) { INT64 result; @@ -763,7 +797,7 @@ void OPM_OldSym (CHAR *modName, ADDRESS modName__len, BOOLEAN *done) Files_Set(&OPM_oldSF, Files_Rider__typ, OPM_oldSFile, 0); Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&tag); Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&ver); - if (tag != 0xf7 || ver != 0x83) { + if (tag != 0xf7 || ver != 0x84) { if (!__IN(4, OPM_Options, 32)) { OPM_err(-306); } @@ -834,7 +868,7 @@ void OPM_NewSym (CHAR *modName, ADDRESS modName__len) if (OPM_newSFile != NIL) { Files_Set(&OPM_newSF, Files_Rider__typ, OPM_newSFile, 0); Files_Write(&OPM_newSF, Files_Rider__typ, 0xf7); - Files_Write(&OPM_newSF, Files_Rider__typ, 0x83); + Files_Write(&OPM_newSF, Files_Rider__typ, 0x84); } else { OPM_err(153); } @@ -1143,5 +1177,7 @@ export void *OPM__init(void) OPM_MinReal = -OPM_MaxReal; OPM_MinLReal = -OPM_MaxLReal; OPM_FindInstallDir(); + OPM_hasComment = 0; + OPM_currentComment[0] = 0x00; __ENDMOD; } diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index 14ef9200..64c15a28 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPM__h #define OPM__h @@ -30,6 +30,7 @@ import void OPM_FPrintLReal (INT32 *fp, LONGREAL val); import void OPM_FPrintReal (INT32 *fp, REAL val); import void OPM_FPrintSet (INT32 *fp, UINT64 val); import void OPM_Get (CHAR *ch); +import void OPM_GetComment (CHAR *text, ADDRESS text__len); import void OPM_Init (BOOLEAN *done); import void OPM_InitOptions (void); import INT16 OPM_Integer (INT64 n); @@ -48,6 +49,7 @@ import BOOLEAN OPM_OpenPar (void); import void OPM_RegisterNewSym (void); import INT64 OPM_SignedMaximum (INT32 bytecount); import INT64 OPM_SignedMinimum (INT32 bytecount); +import void OPM_StoreComment (CHAR *text, ADDRESS text__len); import void OPM_SymRCh (CHAR *ch); import INT32 OPM_SymRInt (void); import INT64 OPM_SymRInt64 (void); diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index 2bbed37b..ad4a370a 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index 5980afc3..3d8cefe8 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index 95456407..a25a2c12 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -279,32 +279,74 @@ static void Comment__2 (void); static void Comment__2 (void) { + BOOLEAN isExported; + CHAR commentText[256]; + INT16 i, nestLevel; + CHAR prevCh, nextCh; + i = 0; + while (i <= 255) { + commentText[__X(i, 256)] = 0x00; + i += 1; + } + isExported = 0; + i = 0; + nestLevel = 1; + prevCh = 0x00; OPM_Get(&OPS_ch); - for (;;) { - for (;;) { - while (OPS_ch == '(') { + if (OPS_ch == '*') { + isExported = 1; + OPM_Get(&OPS_ch); + if (OPS_ch == ')') { + commentText[0] = 0x00; + OPM_StoreComment(commentText, 256); + OPM_Get(&OPS_ch); + return; + } + } + while ((nestLevel > 0 && OPS_ch != 0x00)) { + if ((prevCh == '(' && OPS_ch == '*')) { + nestLevel += 1; + prevCh = 0x00; + } else if ((prevCh == '*' && OPS_ch == ')')) { + nestLevel -= 1; + if (nestLevel == 0) { OPM_Get(&OPS_ch); - if (OPS_ch == '*') { - Comment__2(); + } else { + prevCh = 0x00; + } + } else { + if ((((isExported && nestLevel == 1)) && prevCh != 0x00)) { + if (i < 255) { + commentText[__X(i, 256)] = prevCh; + i += 1; } } - if (OPS_ch == '*') { - OPM_Get(&OPS_ch); - break; - } - if (OPS_ch == 0x00) { - break; - } + prevCh = OPS_ch; + } + if (nestLevel > 0) { OPM_Get(&OPS_ch); } - if (OPS_ch == ')') { - OPM_Get(&OPS_ch); - break; + } + if (OPS_ch == 0x00) { + OPS_err(5); + } + if ((((((isExported && nestLevel == 0)) && prevCh != 0x00)) && prevCh != '*')) { + if (i < 255) { + commentText[__X(i, 256)] = prevCh; + i += 1; + } else { + OPM_LogWStr((CHAR*)"Truncating final comment character", 35); + OPM_LogWLn(); } - if (OPS_ch == 0x00) { - OPS_err(5); - break; + } + if (isExported) { + if (i >= 256) { + OPM_LogWStr((CHAR*)"Warning: commentText overflow", 30); + OPM_LogWLn(); + i = 255; } + commentText[__X(i, 256)] = 0x00; + OPM_StoreComment(commentText, 256); } } diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index f4851b8a..19e222ac 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index 9e34302b..72261b24 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -83,6 +83,7 @@ typedef OPT_Const conval; INT32 adr, linkadr; INT16 x; + OPT_ConstExt comment; } OPT_ObjDesc; typedef @@ -173,6 +174,7 @@ static void OPT_OutObj (OPT_Object obj); static void OPT_OutSign (OPT_Struct result, OPT_Object par); static void OPT_OutStr (OPT_Struct typ); static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj); +static void OPT_OutTruncatedName (CHAR *text, ADDRESS text__len); export OPT_Struct OPT_SetType (INT32 size); export OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INT16 dir); export INT32 OPT_SizeAlignment (INT32 size); @@ -388,6 +390,10 @@ OPT_Object OPT_NewObj (void) { OPT_Object obj = NIL; __NEW(obj, OPT_ObjDesc); + obj->typ = NIL; + obj->conval = NIL; + obj->comment = NIL; + obj->name[0] = 0x00; return obj; } @@ -554,6 +560,8 @@ void OPT_Insert (OPS_Name name, OPT_Object *obj) OPT_Object ob0 = NIL, ob1 = NIL; BOOLEAN left; INT8 mnolev; + CHAR commentText[256]; + INT16 j; ob0 = OPT_topScope; ob1 = ob0->right; left = 0; @@ -585,6 +593,16 @@ void OPT_Insert (OPS_Name name, OPT_Object *obj) __COPY(name, ob1->name, 256); mnolev = OPT_topScope->mnolev; ob1->mnolev = mnolev; + OPM_GetComment((void*)commentText, 256); + if (commentText[0] != 0x00) { + ob1->comment = __NEWARR(NIL, 1, 1, 1, 0, 256); + j = 0; + while ((j < 255 && commentText[__X(j, 256)] != 0x00)) { + (*ob1->comment)[__X(j, 256)] = commentText[__X(j, 256)]; + j += 1; + } + (*ob1->comment)[__X(j, 256)] = 0x00; + } break; } } @@ -1103,6 +1121,13 @@ static void OPT_InSign (INT8 mno, OPT_Struct *res, OPT_Object *par) tag = OPM_SymRInt(); last = NIL; while (tag != 18) { + if (tag < 0 || tag > 100) { + OPM_LogWStr((CHAR*)"ERROR: Invalid tag value in InSign: ", 37); + OPM_LogWNum(tag, 0); + OPM_LogWLn(); + OPM_err(155); + return; + } new = OPT_NewObj(); new->mnolev = -mno; if (last == NIL) { @@ -1381,7 +1406,37 @@ static OPT_Object OPT_InObj (INT8 mno) OPT_Struct typ = NIL; INT32 tag; OPT_ConstExt ext = NIL; + OPS_Name commentText; + BOOLEAN hasComment; + INT16 j; + INT32 len; tag = OPT_impCtxt.nextTag; + hasComment = 0; + while (tag == 41) { + len = OPM_SymRInt(); + if (len < 0) { + len = 0; + } + if (len > 255) { + len = 255; + } + i = 0; + while (i < len) { + OPM_SymRCh(&commentText[__X(i, 256)]); + i += 1; + } + commentText[__X(i, 256)] = 0x00; + hasComment = 1; + tag = OPM_SymRInt(); + } + OPT_impCtxt.nextTag = tag; + if (tag < 0 || tag > 50) { + OPM_LogWStr((CHAR*)"ERROR: Invalid tag in InObj: ", 30); + OPM_LogWNum(tag, 0); + OPM_LogWLn(); + OPM_err(155); + return NIL; + } if (tag == 19) { OPT_InStruct(&typ); obj = typ->strobj; @@ -1397,7 +1452,7 @@ static OPT_Object OPT_InObj (INT8 mno) obj->conval = OPT_NewConst(); OPT_InConstant(tag, obj->conval); obj->typ = OPT_InTyp(tag); - } else if (tag >= 31) { + } else if ((tag >= 31 && tag <= 33)) { obj->conval = OPT_NewConst(); obj->conval->intval = -1; OPT_InSign(mno, &obj->typ, &obj->link); @@ -1424,20 +1479,37 @@ static OPT_Object OPT_InObj (INT8 mno) OPM_LogWStr((CHAR*)"unhandled case at InObj, tag = ", 32); OPM_LogWNum(tag, 0); OPM_LogWLn(); + OPM_err(155); + return NIL; break; } } else if (tag == 20) { obj->mode = 5; OPT_InStruct(&obj->typ); - } else { + } else if (tag == 21 || tag == 22) { obj->mode = 1; if (tag == 22) { obj->vis = 2; } OPT_InStruct(&obj->typ); + } else { + OPM_LogWStr((CHAR*)"ERROR: Unexpected tag in InObj: ", 33); + OPM_LogWNum(tag, 0); + OPM_LogWLn(); + OPM_err(155); + return NIL; } OPT_InName((void*)obj->name, 256); } + if ((hasComment && obj != NIL)) { + obj->comment = __NEWARR(NIL, 1, 1, 1, 0, 256); + j = 0; + while ((((j < 255 && j < len)) && commentText[__X(j, 256)] != 0x00)) { + (*obj->comment)[__X(j, 256)] = commentText[__X(j, 256)]; + j += 1; + } + (*obj->comment)[__X(j, 256)] = 0x00; + } OPT_FPrintObj(obj); if ((obj->mode == 1 && (obj->typ->strobj == NIL || obj->typ->strobj->name[0] == 0x00))) { OPM_FPrint(&OPT_impCtxt.reffp, obj->typ->ref - 255); @@ -1780,13 +1852,40 @@ static void OPT_OutConstant (OPT_Object obj) } } +static void OPT_OutTruncatedName (CHAR *text, ADDRESS text__len) +{ + INT16 i; + __DUP(text, text__len, CHAR); + i = 0; + while ((i < 255 && text[__X(i, text__len)] != 0x00)) { + OPM_SymWCh(text[__X(i, text__len)]); + i += 1; + } + OPM_SymWCh(0x00); + __DEL(text); +} + static void OPT_OutObj (OPT_Object obj) { INT16 i, j; OPT_ConstExt ext = NIL; + INT16 k, l; if (obj != NIL) { OPT_OutObj(obj->left); if (__IN(obj->mode, 0x06ea, 32)) { + if (obj->comment != NIL) { + OPM_SymWInt(41); + k = 0; + while ((k < 255 && (*obj->comment)[__X(k, 256)] != 0x00)) { + k += 1; + } + OPM_SymWInt(k); + l = 0; + while (l < k) { + OPM_SymWCh((*obj->comment)[__X(l, 256)]); + l += 1; + } + } if (obj->history == 4) { OPT_FPrintErr(obj, 250); } else if (obj->vis != 0) { @@ -2026,7 +2125,7 @@ static void EnumPtrs(void (*P)(void*)) } __TDESC(OPT_ConstDesc, 1, 1) = {__TDFLDS("ConstDesc", 32), {0, -8}}; -__TDESC(OPT_ObjDesc, 1, 6) = {__TDFLDS("ObjDesc", 304), {0, 4, 8, 12, 284, 288, -28}}; +__TDESC(OPT_ObjDesc, 1, 7) = {__TDFLDS("ObjDesc", 308), {0, 4, 8, 12, 284, 288, 304, -32}}; __TDESC(OPT_StrDesc, 1, 3) = {__TDFLDS("StrDesc", 56), {44, 48, 52, -16}}; __TDESC(OPT_NodeDesc, 1, 6) = {__TDFLDS("NodeDesc", 28), {0, 4, 8, 16, 20, 24, -28}}; __TDESC(OPT_ImpCtxt, 1, 510) = {__TDFLDS("ImpCtxt", 3140), {16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60, 64, 68, 72, 76, diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index d2f8d9fe..cf456af5 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPT__h #define OPT__h @@ -61,6 +61,7 @@ typedef OPT_Const conval; INT32 adr, linkadr; INT16 x; + OPT_ConstExt comment; } OPT_ObjDesc; typedef diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index ecef063d..0425b2e0 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index 44652222..fbabd8f4 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Out.c b/bootstrap/unix-44/Out.c index d5a45e43..ce936589 100644 --- a/bootstrap/unix-44/Out.c +++ b/bootstrap/unix-44/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Out.h b/bootstrap/unix-44/Out.h index a008c089..a72547f4 100644 --- a/bootstrap/unix-44/Out.h +++ b/bootstrap/unix-44/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 61463b51..befa6033 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index 89ce40d3..fbeef8c7 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index f4cc31eb..512ec2c4 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index 04ff0d7c..93e7fa75 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index 629009fa..4b18812f 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index 6acdef43..f0e3ae34 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index 369d0244..7e7522c2 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index 3c805fbe..dc569fa9 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/VT100.c b/bootstrap/unix-44/VT100.c index c5e8a3ba..346fb37b 100644 --- a/bootstrap/unix-44/VT100.c +++ b/bootstrap/unix-44/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/VT100.h b/bootstrap/unix-44/VT100.h index 94b7b846..4e708647 100644 --- a/bootstrap/unix-44/VT100.h +++ b/bootstrap/unix-44/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index cf90fa2a..ce2fc413 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -73,7 +73,7 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len, CHAR *additionalopts, ADDRESS additionalopts__len) { __DUP(additionalopts, additionalopts__len, CHAR); - __COPY("gcc -fPIC -g", s, s__len); + __COPY("gcc -fPIC -g -Wno-stringop-overflow", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index 6b1b37eb..686f0b4e 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/Compiler.c b/bootstrap/unix-48/Compiler.c index 1807e545..4460479d 100644 --- a/bootstrap/unix-48/Compiler.c +++ b/bootstrap/unix-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index fb7a8f35..fa87c9de 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index c8bae246..c3c54eed 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 7ce57bc2..54341368 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index 3622bbe7..ccdabcc2 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index df721094..42552415 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index dbc11b6f..3cde1c3b 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index 00137463..535721e8 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index 22468d7d..26d86b38 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index 4d4925c6..913fbf2d 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index cb41ad3d..f66fcd66 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index dc9da7db..7b92ccc1 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -618,31 +618,33 @@ static void OPC_DefineTProcMacros (OPT_Object obj, BOOLEAN *empty) { if (obj != NIL) { OPC_DefineTProcMacros(obj->left, &*empty); - if ((((obj->mode == 13 && obj == OPC_BaseTProc(obj))) && (OPM_currFile != 0 || obj->vis == 1))) { - OPM_WriteString((CHAR*)"#define __", 11); - OPC_Ident(obj); - OPC_DeclareParams(obj->link, 1); - OPM_WriteString((CHAR*)" __SEND(", 9); - if (obj->link->typ->form == 11) { - OPM_WriteString((CHAR*)"__TYPEOF(", 10); - OPC_Ident(obj->link); + if ((obj->mode == 13 && obj == OPC_BaseTProc(obj))) { + if (OPM_currFile == 1 || (OPM_currFile == 0 && obj->vis == 1)) { + OPM_WriteString((CHAR*)"#define __", 11); + OPC_Ident(obj); + OPC_DeclareParams(obj->link, 1); + OPM_WriteString((CHAR*)" __SEND(", 9); + if (obj->link->typ->form == 11) { + OPM_WriteString((CHAR*)"__TYPEOF(", 10); + OPC_Ident(obj->link); + OPM_Write(')'); + } else { + OPC_Ident(obj->link); + OPM_WriteString((CHAR*)"__typ", 6); + } + OPC_Str1((CHAR*)", #, ", 6, __ASHR(obj->adr, 16)); + if (obj->typ == OPT_notyp) { + OPM_WriteString((CHAR*)"void", 5); + } else { + OPC_Ident(obj->typ->strobj); + } + OPM_WriteString((CHAR*)"(*)", 4); + OPC_AnsiParamList(obj->link, 0); + OPM_WriteString((CHAR*)", ", 3); + OPC_DeclareParams(obj->link, 1); OPM_Write(')'); - } else { - OPC_Ident(obj->link); - OPM_WriteString((CHAR*)"__typ", 6); + OPM_WriteLn(); } - OPC_Str1((CHAR*)", #, ", 6, __ASHR(obj->adr, 16)); - if (obj->typ == OPT_notyp) { - OPM_WriteString((CHAR*)"void", 5); - } else { - OPC_Ident(obj->typ->strobj); - } - OPM_WriteString((CHAR*)"(*)", 4); - OPC_AnsiParamList(obj->link, 0); - OPM_WriteString((CHAR*)", ", 3); - OPC_DeclareParams(obj->link, 1); - OPM_Write(')'); - OPM_WriteLn(); } OPC_DefineTProcMacros(obj->right, &*empty); } @@ -652,7 +654,7 @@ static void OPC_DefineType (OPT_Struct str) { OPT_Object obj = NIL, field = NIL, par = NIL; BOOLEAN empty; - if (OPM_currFile == 1 || str->ref < 255) { + if ((OPM_currFile == 1 || str->ref < 255) || (((OPM_currFile == 0 && str->strobj != NIL)) && str->strobj->vis == 1)) { obj = str->strobj; if (obj == NIL || OPC_Undefined(obj)) { if (obj != NIL) { @@ -719,6 +721,13 @@ static void OPC_DefineType (OPT_Struct str) if (!empty) { OPM_WriteLn(); } + } else if ((obj->typ->form == 11 && obj->typ->BaseTyp->comp == 4)) { + empty = 1; + OPC_DeclareTProcs(obj->typ->BaseTyp->link, &empty); + OPC_DefineTProcMacros(obj->typ->BaseTyp->link, &empty); + if (!empty) { + OPM_WriteLn(); + } } } } diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index fd7ddb5e..3bfd88b8 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index d2462ff6..bcb39247 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,8 @@ typedef CHAR OPM_FileName[32]; +static CHAR OPM_currentComment[256]; +static BOOLEAN OPM_hasComment; static CHAR OPM_SourceFileName[256]; static CHAR OPM_GlobalModel[10]; export CHAR OPM_Model[10]; @@ -59,6 +61,7 @@ static void OPM_FindInstallDir (void); static void OPM_FindLine (Files_File f, Files_Rider *r, ADDRESS *r__typ, INT64 pos); static void OPM_FingerprintBytes (INT32 *fp, SYSTEM_BYTE *bytes, ADDRESS bytes__len); export void OPM_Get (CHAR *ch); +export void OPM_GetComment (CHAR *text, ADDRESS text__len); export void OPM_Init (BOOLEAN *done); export void OPM_InitOptions (void); export INT16 OPM_Integer (INT64 n); @@ -82,6 +85,7 @@ static void OPM_ScanOptions (CHAR *s, ADDRESS s__len); static void OPM_ShowLine (INT64 pos); export INT64 OPM_SignedMaximum (INT32 bytecount); export INT64 OPM_SignedMinimum (INT32 bytecount); +export void OPM_StoreComment (CHAR *text, ADDRESS text__len); export void OPM_SymRCh (CHAR *ch); export INT32 OPM_SymRInt (void); export INT64 OPM_SymRInt64 (void); @@ -157,6 +161,36 @@ void OPM_LogCompiling (CHAR *modname, ADDRESS modname__len) __DEL(modname); } +void OPM_StoreComment (CHAR *text, ADDRESS text__len) +{ + INT16 i; + __DUP(text, text__len, CHAR); + i = 0; + while ((i < 255 && text[__X(i, text__len)] != 0x00)) { + OPM_currentComment[__X(i, 256)] = text[__X(i, text__len)]; + i += 1; + } + OPM_currentComment[__X(i, 256)] = 0x00; + OPM_hasComment = 1; + __DEL(text); +} + +void OPM_GetComment (CHAR *text, ADDRESS text__len) +{ + INT16 i; + if (OPM_hasComment) { + i = 0; + while ((((i < text__len && i < 256)) && OPM_currentComment[__X(i, 256)] != 0x00)) { + text[__X(i, text__len)] = OPM_currentComment[__X(i, 256)]; + i += 1; + } + text[__X(i, text__len)] = 0x00; + OPM_hasComment = 0; + } else { + text[0] = 0x00; + } +} + INT64 OPM_SignedMaximum (INT32 bytecount) { INT64 result; @@ -763,7 +797,7 @@ void OPM_OldSym (CHAR *modName, ADDRESS modName__len, BOOLEAN *done) Files_Set(&OPM_oldSF, Files_Rider__typ, OPM_oldSFile, 0); Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&tag); Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&ver); - if (tag != 0xf7 || ver != 0x83) { + if (tag != 0xf7 || ver != 0x84) { if (!__IN(4, OPM_Options, 32)) { OPM_err(-306); } @@ -834,7 +868,7 @@ void OPM_NewSym (CHAR *modName, ADDRESS modName__len) if (OPM_newSFile != NIL) { Files_Set(&OPM_newSF, Files_Rider__typ, OPM_newSFile, 0); Files_Write(&OPM_newSF, Files_Rider__typ, 0xf7); - Files_Write(&OPM_newSF, Files_Rider__typ, 0x83); + Files_Write(&OPM_newSF, Files_Rider__typ, 0x84); } else { OPM_err(153); } @@ -1143,5 +1177,7 @@ export void *OPM__init(void) OPM_MinReal = -OPM_MaxReal; OPM_MinLReal = -OPM_MaxLReal; OPM_FindInstallDir(); + OPM_hasComment = 0; + OPM_currentComment[0] = 0x00; __ENDMOD; } diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index 14ef9200..64c15a28 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPM__h #define OPM__h @@ -30,6 +30,7 @@ import void OPM_FPrintLReal (INT32 *fp, LONGREAL val); import void OPM_FPrintReal (INT32 *fp, REAL val); import void OPM_FPrintSet (INT32 *fp, UINT64 val); import void OPM_Get (CHAR *ch); +import void OPM_GetComment (CHAR *text, ADDRESS text__len); import void OPM_Init (BOOLEAN *done); import void OPM_InitOptions (void); import INT16 OPM_Integer (INT64 n); @@ -48,6 +49,7 @@ import BOOLEAN OPM_OpenPar (void); import void OPM_RegisterNewSym (void); import INT64 OPM_SignedMaximum (INT32 bytecount); import INT64 OPM_SignedMinimum (INT32 bytecount); +import void OPM_StoreComment (CHAR *text, ADDRESS text__len); import void OPM_SymRCh (CHAR *ch); import INT32 OPM_SymRInt (void); import INT64 OPM_SymRInt64 (void); diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index 2bbed37b..ad4a370a 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index 5980afc3..3d8cefe8 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index 95456407..a25a2c12 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -279,32 +279,74 @@ static void Comment__2 (void); static void Comment__2 (void) { + BOOLEAN isExported; + CHAR commentText[256]; + INT16 i, nestLevel; + CHAR prevCh, nextCh; + i = 0; + while (i <= 255) { + commentText[__X(i, 256)] = 0x00; + i += 1; + } + isExported = 0; + i = 0; + nestLevel = 1; + prevCh = 0x00; OPM_Get(&OPS_ch); - for (;;) { - for (;;) { - while (OPS_ch == '(') { + if (OPS_ch == '*') { + isExported = 1; + OPM_Get(&OPS_ch); + if (OPS_ch == ')') { + commentText[0] = 0x00; + OPM_StoreComment(commentText, 256); + OPM_Get(&OPS_ch); + return; + } + } + while ((nestLevel > 0 && OPS_ch != 0x00)) { + if ((prevCh == '(' && OPS_ch == '*')) { + nestLevel += 1; + prevCh = 0x00; + } else if ((prevCh == '*' && OPS_ch == ')')) { + nestLevel -= 1; + if (nestLevel == 0) { OPM_Get(&OPS_ch); - if (OPS_ch == '*') { - Comment__2(); + } else { + prevCh = 0x00; + } + } else { + if ((((isExported && nestLevel == 1)) && prevCh != 0x00)) { + if (i < 255) { + commentText[__X(i, 256)] = prevCh; + i += 1; } } - if (OPS_ch == '*') { - OPM_Get(&OPS_ch); - break; - } - if (OPS_ch == 0x00) { - break; - } + prevCh = OPS_ch; + } + if (nestLevel > 0) { OPM_Get(&OPS_ch); } - if (OPS_ch == ')') { - OPM_Get(&OPS_ch); - break; + } + if (OPS_ch == 0x00) { + OPS_err(5); + } + if ((((((isExported && nestLevel == 0)) && prevCh != 0x00)) && prevCh != '*')) { + if (i < 255) { + commentText[__X(i, 256)] = prevCh; + i += 1; + } else { + OPM_LogWStr((CHAR*)"Truncating final comment character", 35); + OPM_LogWLn(); } - if (OPS_ch == 0x00) { - OPS_err(5); - break; + } + if (isExported) { + if (i >= 256) { + OPM_LogWStr((CHAR*)"Warning: commentText overflow", 30); + OPM_LogWLn(); + i = 255; } + commentText[__X(i, 256)] = 0x00; + OPM_StoreComment(commentText, 256); } } diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index f4851b8a..19e222ac 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 85b0ef1c..ebb47dd8 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -83,6 +83,7 @@ typedef OPT_Const conval; INT32 adr, linkadr; INT16 x; + OPT_ConstExt comment; } OPT_ObjDesc; typedef @@ -173,6 +174,7 @@ static void OPT_OutObj (OPT_Object obj); static void OPT_OutSign (OPT_Struct result, OPT_Object par); static void OPT_OutStr (OPT_Struct typ); static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj); +static void OPT_OutTruncatedName (CHAR *text, ADDRESS text__len); export OPT_Struct OPT_SetType (INT32 size); export OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INT16 dir); export INT32 OPT_SizeAlignment (INT32 size); @@ -388,6 +390,10 @@ OPT_Object OPT_NewObj (void) { OPT_Object obj = NIL; __NEW(obj, OPT_ObjDesc); + obj->typ = NIL; + obj->conval = NIL; + obj->comment = NIL; + obj->name[0] = 0x00; return obj; } @@ -554,6 +560,8 @@ void OPT_Insert (OPS_Name name, OPT_Object *obj) OPT_Object ob0 = NIL, ob1 = NIL; BOOLEAN left; INT8 mnolev; + CHAR commentText[256]; + INT16 j; ob0 = OPT_topScope; ob1 = ob0->right; left = 0; @@ -585,6 +593,16 @@ void OPT_Insert (OPS_Name name, OPT_Object *obj) __COPY(name, ob1->name, 256); mnolev = OPT_topScope->mnolev; ob1->mnolev = mnolev; + OPM_GetComment((void*)commentText, 256); + if (commentText[0] != 0x00) { + ob1->comment = __NEWARR(NIL, 1, 1, 1, 0, 256); + j = 0; + while ((j < 255 && commentText[__X(j, 256)] != 0x00)) { + (*ob1->comment)[__X(j, 256)] = commentText[__X(j, 256)]; + j += 1; + } + (*ob1->comment)[__X(j, 256)] = 0x00; + } break; } } @@ -1103,6 +1121,13 @@ static void OPT_InSign (INT8 mno, OPT_Struct *res, OPT_Object *par) tag = OPM_SymRInt(); last = NIL; while (tag != 18) { + if (tag < 0 || tag > 100) { + OPM_LogWStr((CHAR*)"ERROR: Invalid tag value in InSign: ", 37); + OPM_LogWNum(tag, 0); + OPM_LogWLn(); + OPM_err(155); + return; + } new = OPT_NewObj(); new->mnolev = -mno; if (last == NIL) { @@ -1381,7 +1406,37 @@ static OPT_Object OPT_InObj (INT8 mno) OPT_Struct typ = NIL; INT32 tag; OPT_ConstExt ext = NIL; + OPS_Name commentText; + BOOLEAN hasComment; + INT16 j; + INT32 len; tag = OPT_impCtxt.nextTag; + hasComment = 0; + while (tag == 41) { + len = OPM_SymRInt(); + if (len < 0) { + len = 0; + } + if (len > 255) { + len = 255; + } + i = 0; + while (i < len) { + OPM_SymRCh(&commentText[__X(i, 256)]); + i += 1; + } + commentText[__X(i, 256)] = 0x00; + hasComment = 1; + tag = OPM_SymRInt(); + } + OPT_impCtxt.nextTag = tag; + if (tag < 0 || tag > 50) { + OPM_LogWStr((CHAR*)"ERROR: Invalid tag in InObj: ", 30); + OPM_LogWNum(tag, 0); + OPM_LogWLn(); + OPM_err(155); + return NIL; + } if (tag == 19) { OPT_InStruct(&typ); obj = typ->strobj; @@ -1397,7 +1452,7 @@ static OPT_Object OPT_InObj (INT8 mno) obj->conval = OPT_NewConst(); OPT_InConstant(tag, obj->conval); obj->typ = OPT_InTyp(tag); - } else if (tag >= 31) { + } else if ((tag >= 31 && tag <= 33)) { obj->conval = OPT_NewConst(); obj->conval->intval = -1; OPT_InSign(mno, &obj->typ, &obj->link); @@ -1424,20 +1479,37 @@ static OPT_Object OPT_InObj (INT8 mno) OPM_LogWStr((CHAR*)"unhandled case at InObj, tag = ", 32); OPM_LogWNum(tag, 0); OPM_LogWLn(); + OPM_err(155); + return NIL; break; } } else if (tag == 20) { obj->mode = 5; OPT_InStruct(&obj->typ); - } else { + } else if (tag == 21 || tag == 22) { obj->mode = 1; if (tag == 22) { obj->vis = 2; } OPT_InStruct(&obj->typ); + } else { + OPM_LogWStr((CHAR*)"ERROR: Unexpected tag in InObj: ", 33); + OPM_LogWNum(tag, 0); + OPM_LogWLn(); + OPM_err(155); + return NIL; } OPT_InName((void*)obj->name, 256); } + if ((hasComment && obj != NIL)) { + obj->comment = __NEWARR(NIL, 1, 1, 1, 0, 256); + j = 0; + while ((((j < 255 && j < len)) && commentText[__X(j, 256)] != 0x00)) { + (*obj->comment)[__X(j, 256)] = commentText[__X(j, 256)]; + j += 1; + } + (*obj->comment)[__X(j, 256)] = 0x00; + } OPT_FPrintObj(obj); if ((obj->mode == 1 && (obj->typ->strobj == NIL || obj->typ->strobj->name[0] == 0x00))) { OPM_FPrint(&OPT_impCtxt.reffp, obj->typ->ref - 255); @@ -1780,13 +1852,40 @@ static void OPT_OutConstant (OPT_Object obj) } } +static void OPT_OutTruncatedName (CHAR *text, ADDRESS text__len) +{ + INT16 i; + __DUP(text, text__len, CHAR); + i = 0; + while ((i < 255 && text[__X(i, text__len)] != 0x00)) { + OPM_SymWCh(text[__X(i, text__len)]); + i += 1; + } + OPM_SymWCh(0x00); + __DEL(text); +} + static void OPT_OutObj (OPT_Object obj) { INT16 i, j; OPT_ConstExt ext = NIL; + INT16 k, l; if (obj != NIL) { OPT_OutObj(obj->left); if (__IN(obj->mode, 0x06ea, 32)) { + if (obj->comment != NIL) { + OPM_SymWInt(41); + k = 0; + while ((k < 255 && (*obj->comment)[__X(k, 256)] != 0x00)) { + k += 1; + } + OPM_SymWInt(k); + l = 0; + while (l < k) { + OPM_SymWCh((*obj->comment)[__X(l, 256)]); + l += 1; + } + } if (obj->history == 4) { OPT_FPrintErr(obj, 250); } else if (obj->vis != 0) { @@ -2026,7 +2125,7 @@ static void EnumPtrs(void (*P)(void*)) } __TDESC(OPT_ConstDesc, 1, 1) = {__TDFLDS("ConstDesc", 40), {0, -8}}; -__TDESC(OPT_ObjDesc, 1, 6) = {__TDFLDS("ObjDesc", 304), {0, 4, 8, 12, 284, 288, -28}}; +__TDESC(OPT_ObjDesc, 1, 7) = {__TDFLDS("ObjDesc", 308), {0, 4, 8, 12, 284, 288, 304, -32}}; __TDESC(OPT_StrDesc, 1, 3) = {__TDFLDS("StrDesc", 56), {44, 48, 52, -16}}; __TDESC(OPT_NodeDesc, 1, 6) = {__TDFLDS("NodeDesc", 28), {0, 4, 8, 16, 20, 24, -28}}; __TDESC(OPT_ImpCtxt, 1, 510) = {__TDFLDS("ImpCtxt", 3140), {16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60, 64, 68, 72, 76, diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index d2f8d9fe..cf456af5 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPT__h #define OPT__h @@ -61,6 +61,7 @@ typedef OPT_Const conval; INT32 adr, linkadr; INT16 x; + OPT_ConstExt comment; } OPT_ObjDesc; typedef diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index ecef063d..0425b2e0 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index 44652222..fbabd8f4 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Out.c b/bootstrap/unix-48/Out.c index d5a45e43..ce936589 100644 --- a/bootstrap/unix-48/Out.c +++ b/bootstrap/unix-48/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Out.h b/bootstrap/unix-48/Out.h index a008c089..a72547f4 100644 --- a/bootstrap/unix-48/Out.h +++ b/bootstrap/unix-48/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 61463b51..befa6033 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index 89ce40d3..fbeef8c7 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index f4cc31eb..512ec2c4 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index 04ff0d7c..93e7fa75 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index 629009fa..4b18812f 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index 6acdef43..f0e3ae34 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index 2b57b307..43c3858f 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index 75712cc1..fd0c0fa5 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/VT100.c b/bootstrap/unix-48/VT100.c index c5e8a3ba..346fb37b 100644 --- a/bootstrap/unix-48/VT100.c +++ b/bootstrap/unix-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/VT100.h b/bootstrap/unix-48/VT100.h index 94b7b846..4e708647 100644 --- a/bootstrap/unix-48/VT100.h +++ b/bootstrap/unix-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index cf90fa2a..ce2fc413 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -73,7 +73,7 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len, CHAR *additionalopts, ADDRESS additionalopts__len) { __DUP(additionalopts, additionalopts__len, CHAR); - __COPY("gcc -fPIC -g", s, s__len); + __COPY("gcc -fPIC -g -Wno-stringop-overflow", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index 6b1b37eb..686f0b4e 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/Compiler.c b/bootstrap/unix-88/Compiler.c index 1807e545..4460479d 100644 --- a/bootstrap/unix-88/Compiler.c +++ b/bootstrap/unix-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index fb7a8f35..fa87c9de 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index c8bae246..c3c54eed 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 940170c8..57e78310 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 375065c6..676f434c 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index 980fab89..7b004b60 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index e188739a..45a9c6d2 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 011ac733..a5b989e5 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index 34d0e538..ee65a938 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index 4d4925c6..913fbf2d 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index cb41ad3d..f66fcd66 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index dc9da7db..7b92ccc1 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -618,31 +618,33 @@ static void OPC_DefineTProcMacros (OPT_Object obj, BOOLEAN *empty) { if (obj != NIL) { OPC_DefineTProcMacros(obj->left, &*empty); - if ((((obj->mode == 13 && obj == OPC_BaseTProc(obj))) && (OPM_currFile != 0 || obj->vis == 1))) { - OPM_WriteString((CHAR*)"#define __", 11); - OPC_Ident(obj); - OPC_DeclareParams(obj->link, 1); - OPM_WriteString((CHAR*)" __SEND(", 9); - if (obj->link->typ->form == 11) { - OPM_WriteString((CHAR*)"__TYPEOF(", 10); - OPC_Ident(obj->link); + if ((obj->mode == 13 && obj == OPC_BaseTProc(obj))) { + if (OPM_currFile == 1 || (OPM_currFile == 0 && obj->vis == 1)) { + OPM_WriteString((CHAR*)"#define __", 11); + OPC_Ident(obj); + OPC_DeclareParams(obj->link, 1); + OPM_WriteString((CHAR*)" __SEND(", 9); + if (obj->link->typ->form == 11) { + OPM_WriteString((CHAR*)"__TYPEOF(", 10); + OPC_Ident(obj->link); + OPM_Write(')'); + } else { + OPC_Ident(obj->link); + OPM_WriteString((CHAR*)"__typ", 6); + } + OPC_Str1((CHAR*)", #, ", 6, __ASHR(obj->adr, 16)); + if (obj->typ == OPT_notyp) { + OPM_WriteString((CHAR*)"void", 5); + } else { + OPC_Ident(obj->typ->strobj); + } + OPM_WriteString((CHAR*)"(*)", 4); + OPC_AnsiParamList(obj->link, 0); + OPM_WriteString((CHAR*)", ", 3); + OPC_DeclareParams(obj->link, 1); OPM_Write(')'); - } else { - OPC_Ident(obj->link); - OPM_WriteString((CHAR*)"__typ", 6); + OPM_WriteLn(); } - OPC_Str1((CHAR*)", #, ", 6, __ASHR(obj->adr, 16)); - if (obj->typ == OPT_notyp) { - OPM_WriteString((CHAR*)"void", 5); - } else { - OPC_Ident(obj->typ->strobj); - } - OPM_WriteString((CHAR*)"(*)", 4); - OPC_AnsiParamList(obj->link, 0); - OPM_WriteString((CHAR*)", ", 3); - OPC_DeclareParams(obj->link, 1); - OPM_Write(')'); - OPM_WriteLn(); } OPC_DefineTProcMacros(obj->right, &*empty); } @@ -652,7 +654,7 @@ static void OPC_DefineType (OPT_Struct str) { OPT_Object obj = NIL, field = NIL, par = NIL; BOOLEAN empty; - if (OPM_currFile == 1 || str->ref < 255) { + if ((OPM_currFile == 1 || str->ref < 255) || (((OPM_currFile == 0 && str->strobj != NIL)) && str->strobj->vis == 1)) { obj = str->strobj; if (obj == NIL || OPC_Undefined(obj)) { if (obj != NIL) { @@ -719,6 +721,13 @@ static void OPC_DefineType (OPT_Struct str) if (!empty) { OPM_WriteLn(); } + } else if ((obj->typ->form == 11 && obj->typ->BaseTyp->comp == 4)) { + empty = 1; + OPC_DeclareTProcs(obj->typ->BaseTyp->link, &empty); + OPC_DefineTProcMacros(obj->typ->BaseTyp->link, &empty); + if (!empty) { + OPM_WriteLn(); + } } } } diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index fd7ddb5e..3bfd88b8 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index f298d2d5..b486b3b9 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,8 @@ typedef CHAR OPM_FileName[32]; +static CHAR OPM_currentComment[256]; +static BOOLEAN OPM_hasComment; static CHAR OPM_SourceFileName[256]; static CHAR OPM_GlobalModel[10]; export CHAR OPM_Model[10]; @@ -59,6 +61,7 @@ static void OPM_FindInstallDir (void); static void OPM_FindLine (Files_File f, Files_Rider *r, ADDRESS *r__typ, INT64 pos); static void OPM_FingerprintBytes (INT32 *fp, SYSTEM_BYTE *bytes, ADDRESS bytes__len); export void OPM_Get (CHAR *ch); +export void OPM_GetComment (CHAR *text, ADDRESS text__len); export void OPM_Init (BOOLEAN *done); export void OPM_InitOptions (void); export INT16 OPM_Integer (INT64 n); @@ -82,6 +85,7 @@ static void OPM_ScanOptions (CHAR *s, ADDRESS s__len); static void OPM_ShowLine (INT64 pos); export INT64 OPM_SignedMaximum (INT32 bytecount); export INT64 OPM_SignedMinimum (INT32 bytecount); +export void OPM_StoreComment (CHAR *text, ADDRESS text__len); export void OPM_SymRCh (CHAR *ch); export INT32 OPM_SymRInt (void); export INT64 OPM_SymRInt64 (void); @@ -157,6 +161,36 @@ void OPM_LogCompiling (CHAR *modname, ADDRESS modname__len) __DEL(modname); } +void OPM_StoreComment (CHAR *text, ADDRESS text__len) +{ + INT16 i; + __DUP(text, text__len, CHAR); + i = 0; + while ((i < 255 && text[__X(i, text__len)] != 0x00)) { + OPM_currentComment[__X(i, 256)] = text[__X(i, text__len)]; + i += 1; + } + OPM_currentComment[__X(i, 256)] = 0x00; + OPM_hasComment = 1; + __DEL(text); +} + +void OPM_GetComment (CHAR *text, ADDRESS text__len) +{ + INT16 i; + if (OPM_hasComment) { + i = 0; + while ((((i < text__len && i < 256)) && OPM_currentComment[__X(i, 256)] != 0x00)) { + text[__X(i, text__len)] = OPM_currentComment[__X(i, 256)]; + i += 1; + } + text[__X(i, text__len)] = 0x00; + OPM_hasComment = 0; + } else { + text[0] = 0x00; + } +} + INT64 OPM_SignedMaximum (INT32 bytecount) { INT64 result; @@ -763,7 +797,7 @@ void OPM_OldSym (CHAR *modName, ADDRESS modName__len, BOOLEAN *done) Files_Set(&OPM_oldSF, Files_Rider__typ, OPM_oldSFile, 0); Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&tag); Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&ver); - if (tag != 0xf7 || ver != 0x83) { + if (tag != 0xf7 || ver != 0x84) { if (!__IN(4, OPM_Options, 32)) { OPM_err(-306); } @@ -834,7 +868,7 @@ void OPM_NewSym (CHAR *modName, ADDRESS modName__len) if (OPM_newSFile != NIL) { Files_Set(&OPM_newSF, Files_Rider__typ, OPM_newSFile, 0); Files_Write(&OPM_newSF, Files_Rider__typ, 0xf7); - Files_Write(&OPM_newSF, Files_Rider__typ, 0x83); + Files_Write(&OPM_newSF, Files_Rider__typ, 0x84); } else { OPM_err(153); } @@ -1143,5 +1177,7 @@ export void *OPM__init(void) OPM_MinReal = -OPM_MaxReal; OPM_MinLReal = -OPM_MaxLReal; OPM_FindInstallDir(); + OPM_hasComment = 0; + OPM_currentComment[0] = 0x00; __ENDMOD; } diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index 14ef9200..64c15a28 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPM__h #define OPM__h @@ -30,6 +30,7 @@ import void OPM_FPrintLReal (INT32 *fp, LONGREAL val); import void OPM_FPrintReal (INT32 *fp, REAL val); import void OPM_FPrintSet (INT32 *fp, UINT64 val); import void OPM_Get (CHAR *ch); +import void OPM_GetComment (CHAR *text, ADDRESS text__len); import void OPM_Init (BOOLEAN *done); import void OPM_InitOptions (void); import INT16 OPM_Integer (INT64 n); @@ -48,6 +49,7 @@ import BOOLEAN OPM_OpenPar (void); import void OPM_RegisterNewSym (void); import INT64 OPM_SignedMaximum (INT32 bytecount); import INT64 OPM_SignedMinimum (INT32 bytecount); +import void OPM_StoreComment (CHAR *text, ADDRESS text__len); import void OPM_SymRCh (CHAR *ch); import INT32 OPM_SymRInt (void); import INT64 OPM_SymRInt64 (void); diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index f98062ab..3fed2e31 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index 5980afc3..3d8cefe8 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index 95456407..a25a2c12 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -279,32 +279,74 @@ static void Comment__2 (void); static void Comment__2 (void) { + BOOLEAN isExported; + CHAR commentText[256]; + INT16 i, nestLevel; + CHAR prevCh, nextCh; + i = 0; + while (i <= 255) { + commentText[__X(i, 256)] = 0x00; + i += 1; + } + isExported = 0; + i = 0; + nestLevel = 1; + prevCh = 0x00; OPM_Get(&OPS_ch); - for (;;) { - for (;;) { - while (OPS_ch == '(') { + if (OPS_ch == '*') { + isExported = 1; + OPM_Get(&OPS_ch); + if (OPS_ch == ')') { + commentText[0] = 0x00; + OPM_StoreComment(commentText, 256); + OPM_Get(&OPS_ch); + return; + } + } + while ((nestLevel > 0 && OPS_ch != 0x00)) { + if ((prevCh == '(' && OPS_ch == '*')) { + nestLevel += 1; + prevCh = 0x00; + } else if ((prevCh == '*' && OPS_ch == ')')) { + nestLevel -= 1; + if (nestLevel == 0) { OPM_Get(&OPS_ch); - if (OPS_ch == '*') { - Comment__2(); + } else { + prevCh = 0x00; + } + } else { + if ((((isExported && nestLevel == 1)) && prevCh != 0x00)) { + if (i < 255) { + commentText[__X(i, 256)] = prevCh; + i += 1; } } - if (OPS_ch == '*') { - OPM_Get(&OPS_ch); - break; - } - if (OPS_ch == 0x00) { - break; - } + prevCh = OPS_ch; + } + if (nestLevel > 0) { OPM_Get(&OPS_ch); } - if (OPS_ch == ')') { - OPM_Get(&OPS_ch); - break; + } + if (OPS_ch == 0x00) { + OPS_err(5); + } + if ((((((isExported && nestLevel == 0)) && prevCh != 0x00)) && prevCh != '*')) { + if (i < 255) { + commentText[__X(i, 256)] = prevCh; + i += 1; + } else { + OPM_LogWStr((CHAR*)"Truncating final comment character", 35); + OPM_LogWLn(); } - if (OPS_ch == 0x00) { - OPS_err(5); - break; + } + if (isExported) { + if (i >= 256) { + OPM_LogWStr((CHAR*)"Warning: commentText overflow", 30); + OPM_LogWLn(); + i = 255; } + commentText[__X(i, 256)] = 0x00; + OPM_StoreComment(commentText, 256); } } diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index f4851b8a..19e222ac 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index 3b837866..c3999981 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -83,6 +83,7 @@ typedef OPT_Const conval; INT32 adr, linkadr; INT16 x; + OPT_ConstExt comment; } OPT_ObjDesc; typedef @@ -173,6 +174,7 @@ static void OPT_OutObj (OPT_Object obj); static void OPT_OutSign (OPT_Struct result, OPT_Object par); static void OPT_OutStr (OPT_Struct typ); static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj); +static void OPT_OutTruncatedName (CHAR *text, ADDRESS text__len); export OPT_Struct OPT_SetType (INT32 size); export OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INT16 dir); export INT32 OPT_SizeAlignment (INT32 size); @@ -388,6 +390,10 @@ OPT_Object OPT_NewObj (void) { OPT_Object obj = NIL; __NEW(obj, OPT_ObjDesc); + obj->typ = NIL; + obj->conval = NIL; + obj->comment = NIL; + obj->name[0] = 0x00; return obj; } @@ -554,6 +560,8 @@ void OPT_Insert (OPS_Name name, OPT_Object *obj) OPT_Object ob0 = NIL, ob1 = NIL; BOOLEAN left; INT8 mnolev; + CHAR commentText[256]; + INT16 j; ob0 = OPT_topScope; ob1 = ob0->right; left = 0; @@ -585,6 +593,16 @@ void OPT_Insert (OPS_Name name, OPT_Object *obj) __COPY(name, ob1->name, 256); mnolev = OPT_topScope->mnolev; ob1->mnolev = mnolev; + OPM_GetComment((void*)commentText, 256); + if (commentText[0] != 0x00) { + ob1->comment = __NEWARR(NIL, 1, 1, 1, 0, ((INT64)(256))); + j = 0; + while ((j < 255 && commentText[__X(j, 256)] != 0x00)) { + (*ob1->comment)[__X(j, 256)] = commentText[__X(j, 256)]; + j += 1; + } + (*ob1->comment)[__X(j, 256)] = 0x00; + } break; } } @@ -1103,6 +1121,13 @@ static void OPT_InSign (INT8 mno, OPT_Struct *res, OPT_Object *par) tag = OPM_SymRInt(); last = NIL; while (tag != 18) { + if (tag < 0 || tag > 100) { + OPM_LogWStr((CHAR*)"ERROR: Invalid tag value in InSign: ", 37); + OPM_LogWNum(tag, 0); + OPM_LogWLn(); + OPM_err(155); + return; + } new = OPT_NewObj(); new->mnolev = -mno; if (last == NIL) { @@ -1381,7 +1406,37 @@ static OPT_Object OPT_InObj (INT8 mno) OPT_Struct typ = NIL; INT32 tag; OPT_ConstExt ext = NIL; + OPS_Name commentText; + BOOLEAN hasComment; + INT16 j; + INT32 len; tag = OPT_impCtxt.nextTag; + hasComment = 0; + while (tag == 41) { + len = OPM_SymRInt(); + if (len < 0) { + len = 0; + } + if (len > 255) { + len = 255; + } + i = 0; + while (i < len) { + OPM_SymRCh(&commentText[__X(i, 256)]); + i += 1; + } + commentText[__X(i, 256)] = 0x00; + hasComment = 1; + tag = OPM_SymRInt(); + } + OPT_impCtxt.nextTag = tag; + if (tag < 0 || tag > 50) { + OPM_LogWStr((CHAR*)"ERROR: Invalid tag in InObj: ", 30); + OPM_LogWNum(tag, 0); + OPM_LogWLn(); + OPM_err(155); + return NIL; + } if (tag == 19) { OPT_InStruct(&typ); obj = typ->strobj; @@ -1397,7 +1452,7 @@ static OPT_Object OPT_InObj (INT8 mno) obj->conval = OPT_NewConst(); OPT_InConstant(tag, obj->conval); obj->typ = OPT_InTyp(tag); - } else if (tag >= 31) { + } else if ((tag >= 31 && tag <= 33)) { obj->conval = OPT_NewConst(); obj->conval->intval = -1; OPT_InSign(mno, &obj->typ, &obj->link); @@ -1424,20 +1479,37 @@ static OPT_Object OPT_InObj (INT8 mno) OPM_LogWStr((CHAR*)"unhandled case at InObj, tag = ", 32); OPM_LogWNum(tag, 0); OPM_LogWLn(); + OPM_err(155); + return NIL; break; } } else if (tag == 20) { obj->mode = 5; OPT_InStruct(&obj->typ); - } else { + } else if (tag == 21 || tag == 22) { obj->mode = 1; if (tag == 22) { obj->vis = 2; } OPT_InStruct(&obj->typ); + } else { + OPM_LogWStr((CHAR*)"ERROR: Unexpected tag in InObj: ", 33); + OPM_LogWNum(tag, 0); + OPM_LogWLn(); + OPM_err(155); + return NIL; } OPT_InName((void*)obj->name, 256); } + if ((hasComment && obj != NIL)) { + obj->comment = __NEWARR(NIL, 1, 1, 1, 0, ((INT64)(256))); + j = 0; + while ((((j < 255 && j < len)) && commentText[__X(j, 256)] != 0x00)) { + (*obj->comment)[__X(j, 256)] = commentText[__X(j, 256)]; + j += 1; + } + (*obj->comment)[__X(j, 256)] = 0x00; + } OPT_FPrintObj(obj); if ((obj->mode == 1 && (obj->typ->strobj == NIL || obj->typ->strobj->name[0] == 0x00))) { OPM_FPrint(&OPT_impCtxt.reffp, obj->typ->ref - 255); @@ -1780,13 +1852,40 @@ static void OPT_OutConstant (OPT_Object obj) } } +static void OPT_OutTruncatedName (CHAR *text, ADDRESS text__len) +{ + INT16 i; + __DUP(text, text__len, CHAR); + i = 0; + while ((i < 255 && text[__X(i, text__len)] != 0x00)) { + OPM_SymWCh(text[__X(i, text__len)]); + i += 1; + } + OPM_SymWCh(0x00); + __DEL(text); +} + static void OPT_OutObj (OPT_Object obj) { INT16 i, j; OPT_ConstExt ext = NIL; + INT16 k, l; if (obj != NIL) { OPT_OutObj(obj->left); if (__IN(obj->mode, 0x06ea, 32)) { + if (obj->comment != NIL) { + OPM_SymWInt(41); + k = 0; + while ((k < 255 && (*obj->comment)[__X(k, 256)] != 0x00)) { + k += 1; + } + OPM_SymWInt(k); + l = 0; + while (l < k) { + OPM_SymWCh((*obj->comment)[__X(l, 256)]); + l += 1; + } + } if (obj->history == 4) { OPT_FPrintErr(obj, 250); } else if (obj->vis != 0) { @@ -2026,7 +2125,7 @@ static void EnumPtrs(void (*P)(void*)) } __TDESC(OPT_ConstDesc, 1, 1) = {__TDFLDS("ConstDesc", 40), {0, -16}}; -__TDESC(OPT_ObjDesc, 1, 6) = {__TDFLDS("ObjDesc", 336), {0, 8, 16, 24, 304, 312, -56}}; +__TDESC(OPT_ObjDesc, 1, 7) = {__TDFLDS("ObjDesc", 344), {0, 8, 16, 24, 304, 312, 336, -64}}; __TDESC(OPT_StrDesc, 1, 3) = {__TDFLDS("StrDesc", 72), {48, 56, 64, -32}}; __TDESC(OPT_NodeDesc, 1, 6) = {__TDFLDS("NodeDesc", 56), {0, 8, 16, 32, 40, 48, -56}}; __TDESC(OPT_ImpCtxt, 1, 510) = {__TDFLDS("ImpCtxt", 5184), {16, 24, 32, 40, 48, 56, 64, 72, 80, 88, 96, 104, 112, 120, 128, 136, diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index d2f8d9fe..cf456af5 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPT__h #define OPT__h @@ -61,6 +61,7 @@ typedef OPT_Const conval; INT32 adr, linkadr; INT16 x; + OPT_ConstExt comment; } OPT_ObjDesc; typedef diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 2535e861..26c1c715 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index 44652222..fbabd8f4 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Out.c b/bootstrap/unix-88/Out.c index d5a45e43..ce936589 100644 --- a/bootstrap/unix-88/Out.c +++ b/bootstrap/unix-88/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Out.h b/bootstrap/unix-88/Out.h index a008c089..a72547f4 100644 --- a/bootstrap/unix-88/Out.h +++ b/bootstrap/unix-88/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index c545b975..139181a0 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index c6cd7505..e827b641 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index f4cc31eb..512ec2c4 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index 04ff0d7c..93e7fa75 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index 629009fa..4b18812f 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index 6acdef43..f0e3ae34 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index 291ccf2b..77dc1bac 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index 56bb9359..081eec2c 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/VT100.c b/bootstrap/unix-88/VT100.c index c5e8a3ba..346fb37b 100644 --- a/bootstrap/unix-88/VT100.c +++ b/bootstrap/unix-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/VT100.h b/bootstrap/unix-88/VT100.h index 94b7b846..4e708647 100644 --- a/bootstrap/unix-88/VT100.h +++ b/bootstrap/unix-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index cf90fa2a..ce2fc413 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -73,7 +73,7 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len, CHAR *additionalopts, ADDRESS additionalopts__len) { __DUP(additionalopts, additionalopts__len, CHAR); - __COPY("gcc -fPIC -g", s, s__len); + __COPY("gcc -fPIC -g -Wno-stringop-overflow", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index 6b1b37eb..686f0b4e 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/Compiler.c b/bootstrap/windows-48/Compiler.c index 1807e545..4460479d 100644 --- a/bootstrap/windows-48/Compiler.c +++ b/bootstrap/windows-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index fb7a8f35..fa87c9de 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index c8bae246..c3c54eed 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 15dcd35d..553bb49a 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index 6d39b035..dadf1ace 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index df721094..42552415 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index dbc11b6f..3cde1c3b 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index 35b801dc..bdad4713 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index 22468d7d..26d86b38 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index 4d4925c6..913fbf2d 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index cb41ad3d..f66fcd66 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index dc9da7db..7b92ccc1 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -618,31 +618,33 @@ static void OPC_DefineTProcMacros (OPT_Object obj, BOOLEAN *empty) { if (obj != NIL) { OPC_DefineTProcMacros(obj->left, &*empty); - if ((((obj->mode == 13 && obj == OPC_BaseTProc(obj))) && (OPM_currFile != 0 || obj->vis == 1))) { - OPM_WriteString((CHAR*)"#define __", 11); - OPC_Ident(obj); - OPC_DeclareParams(obj->link, 1); - OPM_WriteString((CHAR*)" __SEND(", 9); - if (obj->link->typ->form == 11) { - OPM_WriteString((CHAR*)"__TYPEOF(", 10); - OPC_Ident(obj->link); + if ((obj->mode == 13 && obj == OPC_BaseTProc(obj))) { + if (OPM_currFile == 1 || (OPM_currFile == 0 && obj->vis == 1)) { + OPM_WriteString((CHAR*)"#define __", 11); + OPC_Ident(obj); + OPC_DeclareParams(obj->link, 1); + OPM_WriteString((CHAR*)" __SEND(", 9); + if (obj->link->typ->form == 11) { + OPM_WriteString((CHAR*)"__TYPEOF(", 10); + OPC_Ident(obj->link); + OPM_Write(')'); + } else { + OPC_Ident(obj->link); + OPM_WriteString((CHAR*)"__typ", 6); + } + OPC_Str1((CHAR*)", #, ", 6, __ASHR(obj->adr, 16)); + if (obj->typ == OPT_notyp) { + OPM_WriteString((CHAR*)"void", 5); + } else { + OPC_Ident(obj->typ->strobj); + } + OPM_WriteString((CHAR*)"(*)", 4); + OPC_AnsiParamList(obj->link, 0); + OPM_WriteString((CHAR*)", ", 3); + OPC_DeclareParams(obj->link, 1); OPM_Write(')'); - } else { - OPC_Ident(obj->link); - OPM_WriteString((CHAR*)"__typ", 6); + OPM_WriteLn(); } - OPC_Str1((CHAR*)", #, ", 6, __ASHR(obj->adr, 16)); - if (obj->typ == OPT_notyp) { - OPM_WriteString((CHAR*)"void", 5); - } else { - OPC_Ident(obj->typ->strobj); - } - OPM_WriteString((CHAR*)"(*)", 4); - OPC_AnsiParamList(obj->link, 0); - OPM_WriteString((CHAR*)", ", 3); - OPC_DeclareParams(obj->link, 1); - OPM_Write(')'); - OPM_WriteLn(); } OPC_DefineTProcMacros(obj->right, &*empty); } @@ -652,7 +654,7 @@ static void OPC_DefineType (OPT_Struct str) { OPT_Object obj = NIL, field = NIL, par = NIL; BOOLEAN empty; - if (OPM_currFile == 1 || str->ref < 255) { + if ((OPM_currFile == 1 || str->ref < 255) || (((OPM_currFile == 0 && str->strobj != NIL)) && str->strobj->vis == 1)) { obj = str->strobj; if (obj == NIL || OPC_Undefined(obj)) { if (obj != NIL) { @@ -719,6 +721,13 @@ static void OPC_DefineType (OPT_Struct str) if (!empty) { OPM_WriteLn(); } + } else if ((obj->typ->form == 11 && obj->typ->BaseTyp->comp == 4)) { + empty = 1; + OPC_DeclareTProcs(obj->typ->BaseTyp->link, &empty); + OPC_DefineTProcMacros(obj->typ->BaseTyp->link, &empty); + if (!empty) { + OPM_WriteLn(); + } } } } diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index fd7ddb5e..3bfd88b8 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index d2462ff6..bcb39247 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,8 @@ typedef CHAR OPM_FileName[32]; +static CHAR OPM_currentComment[256]; +static BOOLEAN OPM_hasComment; static CHAR OPM_SourceFileName[256]; static CHAR OPM_GlobalModel[10]; export CHAR OPM_Model[10]; @@ -59,6 +61,7 @@ static void OPM_FindInstallDir (void); static void OPM_FindLine (Files_File f, Files_Rider *r, ADDRESS *r__typ, INT64 pos); static void OPM_FingerprintBytes (INT32 *fp, SYSTEM_BYTE *bytes, ADDRESS bytes__len); export void OPM_Get (CHAR *ch); +export void OPM_GetComment (CHAR *text, ADDRESS text__len); export void OPM_Init (BOOLEAN *done); export void OPM_InitOptions (void); export INT16 OPM_Integer (INT64 n); @@ -82,6 +85,7 @@ static void OPM_ScanOptions (CHAR *s, ADDRESS s__len); static void OPM_ShowLine (INT64 pos); export INT64 OPM_SignedMaximum (INT32 bytecount); export INT64 OPM_SignedMinimum (INT32 bytecount); +export void OPM_StoreComment (CHAR *text, ADDRESS text__len); export void OPM_SymRCh (CHAR *ch); export INT32 OPM_SymRInt (void); export INT64 OPM_SymRInt64 (void); @@ -157,6 +161,36 @@ void OPM_LogCompiling (CHAR *modname, ADDRESS modname__len) __DEL(modname); } +void OPM_StoreComment (CHAR *text, ADDRESS text__len) +{ + INT16 i; + __DUP(text, text__len, CHAR); + i = 0; + while ((i < 255 && text[__X(i, text__len)] != 0x00)) { + OPM_currentComment[__X(i, 256)] = text[__X(i, text__len)]; + i += 1; + } + OPM_currentComment[__X(i, 256)] = 0x00; + OPM_hasComment = 1; + __DEL(text); +} + +void OPM_GetComment (CHAR *text, ADDRESS text__len) +{ + INT16 i; + if (OPM_hasComment) { + i = 0; + while ((((i < text__len && i < 256)) && OPM_currentComment[__X(i, 256)] != 0x00)) { + text[__X(i, text__len)] = OPM_currentComment[__X(i, 256)]; + i += 1; + } + text[__X(i, text__len)] = 0x00; + OPM_hasComment = 0; + } else { + text[0] = 0x00; + } +} + INT64 OPM_SignedMaximum (INT32 bytecount) { INT64 result; @@ -763,7 +797,7 @@ void OPM_OldSym (CHAR *modName, ADDRESS modName__len, BOOLEAN *done) Files_Set(&OPM_oldSF, Files_Rider__typ, OPM_oldSFile, 0); Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&tag); Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&ver); - if (tag != 0xf7 || ver != 0x83) { + if (tag != 0xf7 || ver != 0x84) { if (!__IN(4, OPM_Options, 32)) { OPM_err(-306); } @@ -834,7 +868,7 @@ void OPM_NewSym (CHAR *modName, ADDRESS modName__len) if (OPM_newSFile != NIL) { Files_Set(&OPM_newSF, Files_Rider__typ, OPM_newSFile, 0); Files_Write(&OPM_newSF, Files_Rider__typ, 0xf7); - Files_Write(&OPM_newSF, Files_Rider__typ, 0x83); + Files_Write(&OPM_newSF, Files_Rider__typ, 0x84); } else { OPM_err(153); } @@ -1143,5 +1177,7 @@ export void *OPM__init(void) OPM_MinReal = -OPM_MaxReal; OPM_MinLReal = -OPM_MaxLReal; OPM_FindInstallDir(); + OPM_hasComment = 0; + OPM_currentComment[0] = 0x00; __ENDMOD; } diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index 14ef9200..64c15a28 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPM__h #define OPM__h @@ -30,6 +30,7 @@ import void OPM_FPrintLReal (INT32 *fp, LONGREAL val); import void OPM_FPrintReal (INT32 *fp, REAL val); import void OPM_FPrintSet (INT32 *fp, UINT64 val); import void OPM_Get (CHAR *ch); +import void OPM_GetComment (CHAR *text, ADDRESS text__len); import void OPM_Init (BOOLEAN *done); import void OPM_InitOptions (void); import INT16 OPM_Integer (INT64 n); @@ -48,6 +49,7 @@ import BOOLEAN OPM_OpenPar (void); import void OPM_RegisterNewSym (void); import INT64 OPM_SignedMaximum (INT32 bytecount); import INT64 OPM_SignedMinimum (INT32 bytecount); +import void OPM_StoreComment (CHAR *text, ADDRESS text__len); import void OPM_SymRCh (CHAR *ch); import INT32 OPM_SymRInt (void); import INT64 OPM_SymRInt64 (void); diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index 2bbed37b..ad4a370a 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index 5980afc3..3d8cefe8 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index 95456407..a25a2c12 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -279,32 +279,74 @@ static void Comment__2 (void); static void Comment__2 (void) { + BOOLEAN isExported; + CHAR commentText[256]; + INT16 i, nestLevel; + CHAR prevCh, nextCh; + i = 0; + while (i <= 255) { + commentText[__X(i, 256)] = 0x00; + i += 1; + } + isExported = 0; + i = 0; + nestLevel = 1; + prevCh = 0x00; OPM_Get(&OPS_ch); - for (;;) { - for (;;) { - while (OPS_ch == '(') { + if (OPS_ch == '*') { + isExported = 1; + OPM_Get(&OPS_ch); + if (OPS_ch == ')') { + commentText[0] = 0x00; + OPM_StoreComment(commentText, 256); + OPM_Get(&OPS_ch); + return; + } + } + while ((nestLevel > 0 && OPS_ch != 0x00)) { + if ((prevCh == '(' && OPS_ch == '*')) { + nestLevel += 1; + prevCh = 0x00; + } else if ((prevCh == '*' && OPS_ch == ')')) { + nestLevel -= 1; + if (nestLevel == 0) { OPM_Get(&OPS_ch); - if (OPS_ch == '*') { - Comment__2(); + } else { + prevCh = 0x00; + } + } else { + if ((((isExported && nestLevel == 1)) && prevCh != 0x00)) { + if (i < 255) { + commentText[__X(i, 256)] = prevCh; + i += 1; } } - if (OPS_ch == '*') { - OPM_Get(&OPS_ch); - break; - } - if (OPS_ch == 0x00) { - break; - } + prevCh = OPS_ch; + } + if (nestLevel > 0) { OPM_Get(&OPS_ch); } - if (OPS_ch == ')') { - OPM_Get(&OPS_ch); - break; + } + if (OPS_ch == 0x00) { + OPS_err(5); + } + if ((((((isExported && nestLevel == 0)) && prevCh != 0x00)) && prevCh != '*')) { + if (i < 255) { + commentText[__X(i, 256)] = prevCh; + i += 1; + } else { + OPM_LogWStr((CHAR*)"Truncating final comment character", 35); + OPM_LogWLn(); } - if (OPS_ch == 0x00) { - OPS_err(5); - break; + } + if (isExported) { + if (i >= 256) { + OPM_LogWStr((CHAR*)"Warning: commentText overflow", 30); + OPM_LogWLn(); + i = 255; } + commentText[__X(i, 256)] = 0x00; + OPM_StoreComment(commentText, 256); } } diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index f4851b8a..19e222ac 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 85b0ef1c..ebb47dd8 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -83,6 +83,7 @@ typedef OPT_Const conval; INT32 adr, linkadr; INT16 x; + OPT_ConstExt comment; } OPT_ObjDesc; typedef @@ -173,6 +174,7 @@ static void OPT_OutObj (OPT_Object obj); static void OPT_OutSign (OPT_Struct result, OPT_Object par); static void OPT_OutStr (OPT_Struct typ); static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj); +static void OPT_OutTruncatedName (CHAR *text, ADDRESS text__len); export OPT_Struct OPT_SetType (INT32 size); export OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INT16 dir); export INT32 OPT_SizeAlignment (INT32 size); @@ -388,6 +390,10 @@ OPT_Object OPT_NewObj (void) { OPT_Object obj = NIL; __NEW(obj, OPT_ObjDesc); + obj->typ = NIL; + obj->conval = NIL; + obj->comment = NIL; + obj->name[0] = 0x00; return obj; } @@ -554,6 +560,8 @@ void OPT_Insert (OPS_Name name, OPT_Object *obj) OPT_Object ob0 = NIL, ob1 = NIL; BOOLEAN left; INT8 mnolev; + CHAR commentText[256]; + INT16 j; ob0 = OPT_topScope; ob1 = ob0->right; left = 0; @@ -585,6 +593,16 @@ void OPT_Insert (OPS_Name name, OPT_Object *obj) __COPY(name, ob1->name, 256); mnolev = OPT_topScope->mnolev; ob1->mnolev = mnolev; + OPM_GetComment((void*)commentText, 256); + if (commentText[0] != 0x00) { + ob1->comment = __NEWARR(NIL, 1, 1, 1, 0, 256); + j = 0; + while ((j < 255 && commentText[__X(j, 256)] != 0x00)) { + (*ob1->comment)[__X(j, 256)] = commentText[__X(j, 256)]; + j += 1; + } + (*ob1->comment)[__X(j, 256)] = 0x00; + } break; } } @@ -1103,6 +1121,13 @@ static void OPT_InSign (INT8 mno, OPT_Struct *res, OPT_Object *par) tag = OPM_SymRInt(); last = NIL; while (tag != 18) { + if (tag < 0 || tag > 100) { + OPM_LogWStr((CHAR*)"ERROR: Invalid tag value in InSign: ", 37); + OPM_LogWNum(tag, 0); + OPM_LogWLn(); + OPM_err(155); + return; + } new = OPT_NewObj(); new->mnolev = -mno; if (last == NIL) { @@ -1381,7 +1406,37 @@ static OPT_Object OPT_InObj (INT8 mno) OPT_Struct typ = NIL; INT32 tag; OPT_ConstExt ext = NIL; + OPS_Name commentText; + BOOLEAN hasComment; + INT16 j; + INT32 len; tag = OPT_impCtxt.nextTag; + hasComment = 0; + while (tag == 41) { + len = OPM_SymRInt(); + if (len < 0) { + len = 0; + } + if (len > 255) { + len = 255; + } + i = 0; + while (i < len) { + OPM_SymRCh(&commentText[__X(i, 256)]); + i += 1; + } + commentText[__X(i, 256)] = 0x00; + hasComment = 1; + tag = OPM_SymRInt(); + } + OPT_impCtxt.nextTag = tag; + if (tag < 0 || tag > 50) { + OPM_LogWStr((CHAR*)"ERROR: Invalid tag in InObj: ", 30); + OPM_LogWNum(tag, 0); + OPM_LogWLn(); + OPM_err(155); + return NIL; + } if (tag == 19) { OPT_InStruct(&typ); obj = typ->strobj; @@ -1397,7 +1452,7 @@ static OPT_Object OPT_InObj (INT8 mno) obj->conval = OPT_NewConst(); OPT_InConstant(tag, obj->conval); obj->typ = OPT_InTyp(tag); - } else if (tag >= 31) { + } else if ((tag >= 31 && tag <= 33)) { obj->conval = OPT_NewConst(); obj->conval->intval = -1; OPT_InSign(mno, &obj->typ, &obj->link); @@ -1424,20 +1479,37 @@ static OPT_Object OPT_InObj (INT8 mno) OPM_LogWStr((CHAR*)"unhandled case at InObj, tag = ", 32); OPM_LogWNum(tag, 0); OPM_LogWLn(); + OPM_err(155); + return NIL; break; } } else if (tag == 20) { obj->mode = 5; OPT_InStruct(&obj->typ); - } else { + } else if (tag == 21 || tag == 22) { obj->mode = 1; if (tag == 22) { obj->vis = 2; } OPT_InStruct(&obj->typ); + } else { + OPM_LogWStr((CHAR*)"ERROR: Unexpected tag in InObj: ", 33); + OPM_LogWNum(tag, 0); + OPM_LogWLn(); + OPM_err(155); + return NIL; } OPT_InName((void*)obj->name, 256); } + if ((hasComment && obj != NIL)) { + obj->comment = __NEWARR(NIL, 1, 1, 1, 0, 256); + j = 0; + while ((((j < 255 && j < len)) && commentText[__X(j, 256)] != 0x00)) { + (*obj->comment)[__X(j, 256)] = commentText[__X(j, 256)]; + j += 1; + } + (*obj->comment)[__X(j, 256)] = 0x00; + } OPT_FPrintObj(obj); if ((obj->mode == 1 && (obj->typ->strobj == NIL || obj->typ->strobj->name[0] == 0x00))) { OPM_FPrint(&OPT_impCtxt.reffp, obj->typ->ref - 255); @@ -1780,13 +1852,40 @@ static void OPT_OutConstant (OPT_Object obj) } } +static void OPT_OutTruncatedName (CHAR *text, ADDRESS text__len) +{ + INT16 i; + __DUP(text, text__len, CHAR); + i = 0; + while ((i < 255 && text[__X(i, text__len)] != 0x00)) { + OPM_SymWCh(text[__X(i, text__len)]); + i += 1; + } + OPM_SymWCh(0x00); + __DEL(text); +} + static void OPT_OutObj (OPT_Object obj) { INT16 i, j; OPT_ConstExt ext = NIL; + INT16 k, l; if (obj != NIL) { OPT_OutObj(obj->left); if (__IN(obj->mode, 0x06ea, 32)) { + if (obj->comment != NIL) { + OPM_SymWInt(41); + k = 0; + while ((k < 255 && (*obj->comment)[__X(k, 256)] != 0x00)) { + k += 1; + } + OPM_SymWInt(k); + l = 0; + while (l < k) { + OPM_SymWCh((*obj->comment)[__X(l, 256)]); + l += 1; + } + } if (obj->history == 4) { OPT_FPrintErr(obj, 250); } else if (obj->vis != 0) { @@ -2026,7 +2125,7 @@ static void EnumPtrs(void (*P)(void*)) } __TDESC(OPT_ConstDesc, 1, 1) = {__TDFLDS("ConstDesc", 40), {0, -8}}; -__TDESC(OPT_ObjDesc, 1, 6) = {__TDFLDS("ObjDesc", 304), {0, 4, 8, 12, 284, 288, -28}}; +__TDESC(OPT_ObjDesc, 1, 7) = {__TDFLDS("ObjDesc", 308), {0, 4, 8, 12, 284, 288, 304, -32}}; __TDESC(OPT_StrDesc, 1, 3) = {__TDFLDS("StrDesc", 56), {44, 48, 52, -16}}; __TDESC(OPT_NodeDesc, 1, 6) = {__TDFLDS("NodeDesc", 28), {0, 4, 8, 16, 20, 24, -28}}; __TDESC(OPT_ImpCtxt, 1, 510) = {__TDFLDS("ImpCtxt", 3140), {16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60, 64, 68, 72, 76, diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index d2f8d9fe..cf456af5 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPT__h #define OPT__h @@ -61,6 +61,7 @@ typedef OPT_Const conval; INT32 adr, linkadr; INT16 x; + OPT_ConstExt comment; } OPT_ObjDesc; typedef diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index ecef063d..0425b2e0 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index 44652222..fbabd8f4 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Out.c b/bootstrap/windows-48/Out.c index d8b08478..b43e55f1 100644 --- a/bootstrap/windows-48/Out.c +++ b/bootstrap/windows-48/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Out.h b/bootstrap/windows-48/Out.h index a008c089..a72547f4 100644 --- a/bootstrap/windows-48/Out.h +++ b/bootstrap/windows-48/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index e57cfbc4..9b1f0e4f 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index 543943d3..b1ed4c6f 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index f4cc31eb..512ec2c4 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index 04ff0d7c..93e7fa75 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index 629009fa..4b18812f 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index 6acdef43..f0e3ae34 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index 2b57b307..43c3858f 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index 75712cc1..fd0c0fa5 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/VT100.c b/bootstrap/windows-48/VT100.c index c5e8a3ba..346fb37b 100644 --- a/bootstrap/windows-48/VT100.c +++ b/bootstrap/windows-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/VT100.h b/bootstrap/windows-48/VT100.h index 94b7b846..4e708647 100644 --- a/bootstrap/windows-48/VT100.h +++ b/bootstrap/windows-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index cf90fa2a..ce2fc413 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -73,7 +73,7 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len, CHAR *additionalopts, ADDRESS additionalopts__len) { __DUP(additionalopts, additionalopts__len, CHAR); - __COPY("gcc -fPIC -g", s, s__len); + __COPY("gcc -fPIC -g -Wno-stringop-overflow", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index 6b1b37eb..686f0b4e 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/Compiler.c b/bootstrap/windows-88/Compiler.c index 1807e545..4460479d 100644 --- a/bootstrap/windows-88/Compiler.c +++ b/bootstrap/windows-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index fb7a8f35..fa87c9de 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index c8bae246..c3c54eed 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 5412cd99..07655515 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 2bbdcf3c..8a7e59f8 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index 980fab89..7b004b60 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index e188739a..45a9c6d2 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 8617e065..7a49b8ff 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index 34d0e538..ee65a938 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index 4d4925c6..913fbf2d 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index cb41ad3d..f66fcd66 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index dc9da7db..7b92ccc1 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -618,31 +618,33 @@ static void OPC_DefineTProcMacros (OPT_Object obj, BOOLEAN *empty) { if (obj != NIL) { OPC_DefineTProcMacros(obj->left, &*empty); - if ((((obj->mode == 13 && obj == OPC_BaseTProc(obj))) && (OPM_currFile != 0 || obj->vis == 1))) { - OPM_WriteString((CHAR*)"#define __", 11); - OPC_Ident(obj); - OPC_DeclareParams(obj->link, 1); - OPM_WriteString((CHAR*)" __SEND(", 9); - if (obj->link->typ->form == 11) { - OPM_WriteString((CHAR*)"__TYPEOF(", 10); - OPC_Ident(obj->link); + if ((obj->mode == 13 && obj == OPC_BaseTProc(obj))) { + if (OPM_currFile == 1 || (OPM_currFile == 0 && obj->vis == 1)) { + OPM_WriteString((CHAR*)"#define __", 11); + OPC_Ident(obj); + OPC_DeclareParams(obj->link, 1); + OPM_WriteString((CHAR*)" __SEND(", 9); + if (obj->link->typ->form == 11) { + OPM_WriteString((CHAR*)"__TYPEOF(", 10); + OPC_Ident(obj->link); + OPM_Write(')'); + } else { + OPC_Ident(obj->link); + OPM_WriteString((CHAR*)"__typ", 6); + } + OPC_Str1((CHAR*)", #, ", 6, __ASHR(obj->adr, 16)); + if (obj->typ == OPT_notyp) { + OPM_WriteString((CHAR*)"void", 5); + } else { + OPC_Ident(obj->typ->strobj); + } + OPM_WriteString((CHAR*)"(*)", 4); + OPC_AnsiParamList(obj->link, 0); + OPM_WriteString((CHAR*)", ", 3); + OPC_DeclareParams(obj->link, 1); OPM_Write(')'); - } else { - OPC_Ident(obj->link); - OPM_WriteString((CHAR*)"__typ", 6); + OPM_WriteLn(); } - OPC_Str1((CHAR*)", #, ", 6, __ASHR(obj->adr, 16)); - if (obj->typ == OPT_notyp) { - OPM_WriteString((CHAR*)"void", 5); - } else { - OPC_Ident(obj->typ->strobj); - } - OPM_WriteString((CHAR*)"(*)", 4); - OPC_AnsiParamList(obj->link, 0); - OPM_WriteString((CHAR*)", ", 3); - OPC_DeclareParams(obj->link, 1); - OPM_Write(')'); - OPM_WriteLn(); } OPC_DefineTProcMacros(obj->right, &*empty); } @@ -652,7 +654,7 @@ static void OPC_DefineType (OPT_Struct str) { OPT_Object obj = NIL, field = NIL, par = NIL; BOOLEAN empty; - if (OPM_currFile == 1 || str->ref < 255) { + if ((OPM_currFile == 1 || str->ref < 255) || (((OPM_currFile == 0 && str->strobj != NIL)) && str->strobj->vis == 1)) { obj = str->strobj; if (obj == NIL || OPC_Undefined(obj)) { if (obj != NIL) { @@ -719,6 +721,13 @@ static void OPC_DefineType (OPT_Struct str) if (!empty) { OPM_WriteLn(); } + } else if ((obj->typ->form == 11 && obj->typ->BaseTyp->comp == 4)) { + empty = 1; + OPC_DeclareTProcs(obj->typ->BaseTyp->link, &empty); + OPC_DefineTProcMacros(obj->typ->BaseTyp->link, &empty); + if (!empty) { + OPM_WriteLn(); + } } } } diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index fd7ddb5e..3bfd88b8 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index f298d2d5..b486b3b9 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,8 @@ typedef CHAR OPM_FileName[32]; +static CHAR OPM_currentComment[256]; +static BOOLEAN OPM_hasComment; static CHAR OPM_SourceFileName[256]; static CHAR OPM_GlobalModel[10]; export CHAR OPM_Model[10]; @@ -59,6 +61,7 @@ static void OPM_FindInstallDir (void); static void OPM_FindLine (Files_File f, Files_Rider *r, ADDRESS *r__typ, INT64 pos); static void OPM_FingerprintBytes (INT32 *fp, SYSTEM_BYTE *bytes, ADDRESS bytes__len); export void OPM_Get (CHAR *ch); +export void OPM_GetComment (CHAR *text, ADDRESS text__len); export void OPM_Init (BOOLEAN *done); export void OPM_InitOptions (void); export INT16 OPM_Integer (INT64 n); @@ -82,6 +85,7 @@ static void OPM_ScanOptions (CHAR *s, ADDRESS s__len); static void OPM_ShowLine (INT64 pos); export INT64 OPM_SignedMaximum (INT32 bytecount); export INT64 OPM_SignedMinimum (INT32 bytecount); +export void OPM_StoreComment (CHAR *text, ADDRESS text__len); export void OPM_SymRCh (CHAR *ch); export INT32 OPM_SymRInt (void); export INT64 OPM_SymRInt64 (void); @@ -157,6 +161,36 @@ void OPM_LogCompiling (CHAR *modname, ADDRESS modname__len) __DEL(modname); } +void OPM_StoreComment (CHAR *text, ADDRESS text__len) +{ + INT16 i; + __DUP(text, text__len, CHAR); + i = 0; + while ((i < 255 && text[__X(i, text__len)] != 0x00)) { + OPM_currentComment[__X(i, 256)] = text[__X(i, text__len)]; + i += 1; + } + OPM_currentComment[__X(i, 256)] = 0x00; + OPM_hasComment = 1; + __DEL(text); +} + +void OPM_GetComment (CHAR *text, ADDRESS text__len) +{ + INT16 i; + if (OPM_hasComment) { + i = 0; + while ((((i < text__len && i < 256)) && OPM_currentComment[__X(i, 256)] != 0x00)) { + text[__X(i, text__len)] = OPM_currentComment[__X(i, 256)]; + i += 1; + } + text[__X(i, text__len)] = 0x00; + OPM_hasComment = 0; + } else { + text[0] = 0x00; + } +} + INT64 OPM_SignedMaximum (INT32 bytecount) { INT64 result; @@ -763,7 +797,7 @@ void OPM_OldSym (CHAR *modName, ADDRESS modName__len, BOOLEAN *done) Files_Set(&OPM_oldSF, Files_Rider__typ, OPM_oldSFile, 0); Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&tag); Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&ver); - if (tag != 0xf7 || ver != 0x83) { + if (tag != 0xf7 || ver != 0x84) { if (!__IN(4, OPM_Options, 32)) { OPM_err(-306); } @@ -834,7 +868,7 @@ void OPM_NewSym (CHAR *modName, ADDRESS modName__len) if (OPM_newSFile != NIL) { Files_Set(&OPM_newSF, Files_Rider__typ, OPM_newSFile, 0); Files_Write(&OPM_newSF, Files_Rider__typ, 0xf7); - Files_Write(&OPM_newSF, Files_Rider__typ, 0x83); + Files_Write(&OPM_newSF, Files_Rider__typ, 0x84); } else { OPM_err(153); } @@ -1143,5 +1177,7 @@ export void *OPM__init(void) OPM_MinReal = -OPM_MaxReal; OPM_MinLReal = -OPM_MaxLReal; OPM_FindInstallDir(); + OPM_hasComment = 0; + OPM_currentComment[0] = 0x00; __ENDMOD; } diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index 14ef9200..64c15a28 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPM__h #define OPM__h @@ -30,6 +30,7 @@ import void OPM_FPrintLReal (INT32 *fp, LONGREAL val); import void OPM_FPrintReal (INT32 *fp, REAL val); import void OPM_FPrintSet (INT32 *fp, UINT64 val); import void OPM_Get (CHAR *ch); +import void OPM_GetComment (CHAR *text, ADDRESS text__len); import void OPM_Init (BOOLEAN *done); import void OPM_InitOptions (void); import INT16 OPM_Integer (INT64 n); @@ -48,6 +49,7 @@ import BOOLEAN OPM_OpenPar (void); import void OPM_RegisterNewSym (void); import INT64 OPM_SignedMaximum (INT32 bytecount); import INT64 OPM_SignedMinimum (INT32 bytecount); +import void OPM_StoreComment (CHAR *text, ADDRESS text__len); import void OPM_SymRCh (CHAR *ch); import INT32 OPM_SymRInt (void); import INT64 OPM_SymRInt64 (void); diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index f98062ab..3fed2e31 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index 5980afc3..3d8cefe8 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index 95456407..a25a2c12 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -279,32 +279,74 @@ static void Comment__2 (void); static void Comment__2 (void) { + BOOLEAN isExported; + CHAR commentText[256]; + INT16 i, nestLevel; + CHAR prevCh, nextCh; + i = 0; + while (i <= 255) { + commentText[__X(i, 256)] = 0x00; + i += 1; + } + isExported = 0; + i = 0; + nestLevel = 1; + prevCh = 0x00; OPM_Get(&OPS_ch); - for (;;) { - for (;;) { - while (OPS_ch == '(') { + if (OPS_ch == '*') { + isExported = 1; + OPM_Get(&OPS_ch); + if (OPS_ch == ')') { + commentText[0] = 0x00; + OPM_StoreComment(commentText, 256); + OPM_Get(&OPS_ch); + return; + } + } + while ((nestLevel > 0 && OPS_ch != 0x00)) { + if ((prevCh == '(' && OPS_ch == '*')) { + nestLevel += 1; + prevCh = 0x00; + } else if ((prevCh == '*' && OPS_ch == ')')) { + nestLevel -= 1; + if (nestLevel == 0) { OPM_Get(&OPS_ch); - if (OPS_ch == '*') { - Comment__2(); + } else { + prevCh = 0x00; + } + } else { + if ((((isExported && nestLevel == 1)) && prevCh != 0x00)) { + if (i < 255) { + commentText[__X(i, 256)] = prevCh; + i += 1; } } - if (OPS_ch == '*') { - OPM_Get(&OPS_ch); - break; - } - if (OPS_ch == 0x00) { - break; - } + prevCh = OPS_ch; + } + if (nestLevel > 0) { OPM_Get(&OPS_ch); } - if (OPS_ch == ')') { - OPM_Get(&OPS_ch); - break; + } + if (OPS_ch == 0x00) { + OPS_err(5); + } + if ((((((isExported && nestLevel == 0)) && prevCh != 0x00)) && prevCh != '*')) { + if (i < 255) { + commentText[__X(i, 256)] = prevCh; + i += 1; + } else { + OPM_LogWStr((CHAR*)"Truncating final comment character", 35); + OPM_LogWLn(); } - if (OPS_ch == 0x00) { - OPS_err(5); - break; + } + if (isExported) { + if (i >= 256) { + OPM_LogWStr((CHAR*)"Warning: commentText overflow", 30); + OPM_LogWLn(); + i = 255; } + commentText[__X(i, 256)] = 0x00; + OPM_StoreComment(commentText, 256); } } diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index f4851b8a..19e222ac 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index 3b837866..c3999981 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -83,6 +83,7 @@ typedef OPT_Const conval; INT32 adr, linkadr; INT16 x; + OPT_ConstExt comment; } OPT_ObjDesc; typedef @@ -173,6 +174,7 @@ static void OPT_OutObj (OPT_Object obj); static void OPT_OutSign (OPT_Struct result, OPT_Object par); static void OPT_OutStr (OPT_Struct typ); static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj); +static void OPT_OutTruncatedName (CHAR *text, ADDRESS text__len); export OPT_Struct OPT_SetType (INT32 size); export OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INT16 dir); export INT32 OPT_SizeAlignment (INT32 size); @@ -388,6 +390,10 @@ OPT_Object OPT_NewObj (void) { OPT_Object obj = NIL; __NEW(obj, OPT_ObjDesc); + obj->typ = NIL; + obj->conval = NIL; + obj->comment = NIL; + obj->name[0] = 0x00; return obj; } @@ -554,6 +560,8 @@ void OPT_Insert (OPS_Name name, OPT_Object *obj) OPT_Object ob0 = NIL, ob1 = NIL; BOOLEAN left; INT8 mnolev; + CHAR commentText[256]; + INT16 j; ob0 = OPT_topScope; ob1 = ob0->right; left = 0; @@ -585,6 +593,16 @@ void OPT_Insert (OPS_Name name, OPT_Object *obj) __COPY(name, ob1->name, 256); mnolev = OPT_topScope->mnolev; ob1->mnolev = mnolev; + OPM_GetComment((void*)commentText, 256); + if (commentText[0] != 0x00) { + ob1->comment = __NEWARR(NIL, 1, 1, 1, 0, ((INT64)(256))); + j = 0; + while ((j < 255 && commentText[__X(j, 256)] != 0x00)) { + (*ob1->comment)[__X(j, 256)] = commentText[__X(j, 256)]; + j += 1; + } + (*ob1->comment)[__X(j, 256)] = 0x00; + } break; } } @@ -1103,6 +1121,13 @@ static void OPT_InSign (INT8 mno, OPT_Struct *res, OPT_Object *par) tag = OPM_SymRInt(); last = NIL; while (tag != 18) { + if (tag < 0 || tag > 100) { + OPM_LogWStr((CHAR*)"ERROR: Invalid tag value in InSign: ", 37); + OPM_LogWNum(tag, 0); + OPM_LogWLn(); + OPM_err(155); + return; + } new = OPT_NewObj(); new->mnolev = -mno; if (last == NIL) { @@ -1381,7 +1406,37 @@ static OPT_Object OPT_InObj (INT8 mno) OPT_Struct typ = NIL; INT32 tag; OPT_ConstExt ext = NIL; + OPS_Name commentText; + BOOLEAN hasComment; + INT16 j; + INT32 len; tag = OPT_impCtxt.nextTag; + hasComment = 0; + while (tag == 41) { + len = OPM_SymRInt(); + if (len < 0) { + len = 0; + } + if (len > 255) { + len = 255; + } + i = 0; + while (i < len) { + OPM_SymRCh(&commentText[__X(i, 256)]); + i += 1; + } + commentText[__X(i, 256)] = 0x00; + hasComment = 1; + tag = OPM_SymRInt(); + } + OPT_impCtxt.nextTag = tag; + if (tag < 0 || tag > 50) { + OPM_LogWStr((CHAR*)"ERROR: Invalid tag in InObj: ", 30); + OPM_LogWNum(tag, 0); + OPM_LogWLn(); + OPM_err(155); + return NIL; + } if (tag == 19) { OPT_InStruct(&typ); obj = typ->strobj; @@ -1397,7 +1452,7 @@ static OPT_Object OPT_InObj (INT8 mno) obj->conval = OPT_NewConst(); OPT_InConstant(tag, obj->conval); obj->typ = OPT_InTyp(tag); - } else if (tag >= 31) { + } else if ((tag >= 31 && tag <= 33)) { obj->conval = OPT_NewConst(); obj->conval->intval = -1; OPT_InSign(mno, &obj->typ, &obj->link); @@ -1424,20 +1479,37 @@ static OPT_Object OPT_InObj (INT8 mno) OPM_LogWStr((CHAR*)"unhandled case at InObj, tag = ", 32); OPM_LogWNum(tag, 0); OPM_LogWLn(); + OPM_err(155); + return NIL; break; } } else if (tag == 20) { obj->mode = 5; OPT_InStruct(&obj->typ); - } else { + } else if (tag == 21 || tag == 22) { obj->mode = 1; if (tag == 22) { obj->vis = 2; } OPT_InStruct(&obj->typ); + } else { + OPM_LogWStr((CHAR*)"ERROR: Unexpected tag in InObj: ", 33); + OPM_LogWNum(tag, 0); + OPM_LogWLn(); + OPM_err(155); + return NIL; } OPT_InName((void*)obj->name, 256); } + if ((hasComment && obj != NIL)) { + obj->comment = __NEWARR(NIL, 1, 1, 1, 0, ((INT64)(256))); + j = 0; + while ((((j < 255 && j < len)) && commentText[__X(j, 256)] != 0x00)) { + (*obj->comment)[__X(j, 256)] = commentText[__X(j, 256)]; + j += 1; + } + (*obj->comment)[__X(j, 256)] = 0x00; + } OPT_FPrintObj(obj); if ((obj->mode == 1 && (obj->typ->strobj == NIL || obj->typ->strobj->name[0] == 0x00))) { OPM_FPrint(&OPT_impCtxt.reffp, obj->typ->ref - 255); @@ -1780,13 +1852,40 @@ static void OPT_OutConstant (OPT_Object obj) } } +static void OPT_OutTruncatedName (CHAR *text, ADDRESS text__len) +{ + INT16 i; + __DUP(text, text__len, CHAR); + i = 0; + while ((i < 255 && text[__X(i, text__len)] != 0x00)) { + OPM_SymWCh(text[__X(i, text__len)]); + i += 1; + } + OPM_SymWCh(0x00); + __DEL(text); +} + static void OPT_OutObj (OPT_Object obj) { INT16 i, j; OPT_ConstExt ext = NIL; + INT16 k, l; if (obj != NIL) { OPT_OutObj(obj->left); if (__IN(obj->mode, 0x06ea, 32)) { + if (obj->comment != NIL) { + OPM_SymWInt(41); + k = 0; + while ((k < 255 && (*obj->comment)[__X(k, 256)] != 0x00)) { + k += 1; + } + OPM_SymWInt(k); + l = 0; + while (l < k) { + OPM_SymWCh((*obj->comment)[__X(l, 256)]); + l += 1; + } + } if (obj->history == 4) { OPT_FPrintErr(obj, 250); } else if (obj->vis != 0) { @@ -2026,7 +2125,7 @@ static void EnumPtrs(void (*P)(void*)) } __TDESC(OPT_ConstDesc, 1, 1) = {__TDFLDS("ConstDesc", 40), {0, -16}}; -__TDESC(OPT_ObjDesc, 1, 6) = {__TDFLDS("ObjDesc", 336), {0, 8, 16, 24, 304, 312, -56}}; +__TDESC(OPT_ObjDesc, 1, 7) = {__TDFLDS("ObjDesc", 344), {0, 8, 16, 24, 304, 312, 336, -64}}; __TDESC(OPT_StrDesc, 1, 3) = {__TDFLDS("StrDesc", 72), {48, 56, 64, -32}}; __TDESC(OPT_NodeDesc, 1, 6) = {__TDFLDS("NodeDesc", 56), {0, 8, 16, 32, 40, 48, -56}}; __TDESC(OPT_ImpCtxt, 1, 510) = {__TDFLDS("ImpCtxt", 5184), {16, 24, 32, 40, 48, 56, 64, 72, 80, 88, 96, 104, 112, 120, 128, 136, diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index d2f8d9fe..cf456af5 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPT__h #define OPT__h @@ -61,6 +61,7 @@ typedef OPT_Const conval; INT32 adr, linkadr; INT16 x; + OPT_ConstExt comment; } OPT_ObjDesc; typedef diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 2535e861..26c1c715 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index 44652222..fbabd8f4 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Out.c b/bootstrap/windows-88/Out.c index d8b08478..b43e55f1 100644 --- a/bootstrap/windows-88/Out.c +++ b/bootstrap/windows-88/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Out.h b/bootstrap/windows-88/Out.h index a008c089..a72547f4 100644 --- a/bootstrap/windows-88/Out.h +++ b/bootstrap/windows-88/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 358785ee..563f6417 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index 7bd26e48..1259a228 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index f4cc31eb..512ec2c4 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index 04ff0d7c..93e7fa75 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index 629009fa..4b18812f 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index 6acdef43..f0e3ae34 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index 291ccf2b..77dc1bac 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index 56bb9359..081eec2c 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/VT100.c b/bootstrap/windows-88/VT100.c index c5e8a3ba..346fb37b 100644 --- a/bootstrap/windows-88/VT100.c +++ b/bootstrap/windows-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/VT100.h b/bootstrap/windows-88/VT100.h index 94b7b846..4e708647 100644 --- a/bootstrap/windows-88/VT100.h +++ b/bootstrap/windows-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index cf90fa2a..ce2fc413 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -73,7 +73,7 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len, CHAR *additionalopts, ADDRESS additionalopts__len) { __DUP(additionalopts, additionalopts__len, CHAR); - __COPY("gcc -fPIC -g", s, s__len); + __COPY("gcc -fPIC -g -Wno-stringop-overflow", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index 6b1b37eb..686f0b4e 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2024/08/23]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2025/06/24]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/src/library/ooc/oocIntStr.Mod b/src/library/ooc/oocIntStr.Mod index b5f9d928..2b8213ca 100644 --- a/src/library/ooc/oocIntStr.Mod +++ b/src/library/ooc/oocIntStr.Mod @@ -22,28 +22,28 @@ IMPORT Conv := oocConvTypes, IntConv := oocIntConv; TYPE - ConvResults*= Conv.ConvResults; (** possible values: strAllRight, strOutOfRange, strWrongFormat, strEmpty *) + ConvResults*= Conv.ConvResults; CONST - strAllRight*=Conv.strAllRight; (** the string format is correct for the corresponding conversion *) - strOutOfRange*=Conv.strOutOfRange; + strAllRight*=Conv.strAllRight; (** the string is well-formed but the value cannot be represented *) - strWrongFormat*=Conv.strWrongFormat; + strOutOfRange*=Conv.strOutOfRange; (** the string is in the wrong format for the conversion *) - strEmpty*=Conv.strEmpty; + strWrongFormat*=Conv.strWrongFormat; (** the given string is empty *) + strEmpty*=Conv.strEmpty; (** the string form of a signed whole number is ["+" | "-"] decimal_digit {decimal_digit} *) - -PROCEDURE StrToInt*(str: ARRAY OF CHAR; VAR int: LONGINT; VAR res: ConvResults); (** Ignores any leading spaces in `str'. If the subsequent characters in `str' are in the format of a signed whole number, assigns a corresponding value to `int'. Assigns a value indicating the format of `str' to `res'. *) + +PROCEDURE StrToInt*(str: ARRAY OF CHAR; VAR int: LONGINT; VAR res: ConvResults); BEGIN res:=IntConv.FormatInt(str); IF (res = strAllRight) THEN @@ -53,7 +53,7 @@ END StrToInt; PROCEDURE Reverse (VAR str : ARRAY OF CHAR; start, end : INTEGER); -(** Reverses order of characters in the interval [start..end]. *) +(* Reverses order of characters in the interval [start..end]. *) VAR h : CHAR; BEGIN @@ -63,10 +63,10 @@ BEGIN END END Reverse; - -PROCEDURE IntToStr*(int: LONGINT; VAR str: ARRAY OF CHAR); (** Converts the value of `int' to string form and copies the possibly truncated result to `str'. *) + +PROCEDURE IntToStr*(int: LONGINT; VAR str: ARRAY OF CHAR); CONST maxLength = 11; (* maximum number of digits representing a LONGINT value *) VAR From fa9e73f7afd25d15698bdc94226786ccc69a8dba Mon Sep 17 00:00:00 2001 From: Norayr Chilingarian Date: Thu, 10 Jul 2025 23:08:59 +0400 Subject: [PATCH 576/580] adapted Base64 file from Oberon S3. --- src/library/s3/ethBase64.Mod | 233 +++++++++++++++++++++++++++++++++++ src/tools/make/oberon.mk | 1 + 2 files changed, 234 insertions(+) create mode 100644 src/library/s3/ethBase64.Mod diff --git a/src/library/s3/ethBase64.Mod b/src/library/s3/ethBase64.Mod new file mode 100644 index 00000000..66bcde05 --- /dev/null +++ b/src/library/s3/ethBase64.Mod @@ -0,0 +1,233 @@ +MODULE ethBase64; (* Adapted for VOC from Oberon System 3 *) +IMPORT Files, Texts, Oberon, Out; + +VAR + encTable: ARRAY 64 OF CHAR; + decTable: ARRAY 128 OF INTEGER; + W: Texts.Writer; + +PROCEDURE DecodeText*(T: Texts.Text; beg: LONGINT; F: Files.File): BOOLEAN; +VAR + R: Texts.Reader; + codes: ARRAY 4 OF INTEGER; + Ri: Files.Rider; + i: INTEGER; + ch: CHAR; + ok, end: BOOLEAN; +BEGIN + Files.Set(Ri, F, 0); + ok := TRUE; end := FALSE; + Texts.OpenReader(R, T, beg); + Texts.Read(R, ch); + REPEAT + i := 0; + WHILE ~R.eot & ok & (i < 4) DO + WHILE ~R.eot & (ch <= " ") DO + Texts.Read(R, ch) + END; + IF (ch >= 0X) & (ch < 80X) THEN + codes[i] := decTable[ORD(ch)]; + ok := codes[i] >= 0; INC(i); + IF ok THEN + Texts.Read(R, ch) + END + ELSE + ok := FALSE + END + END; + IF i > 0 THEN + IF ok & (i = 4) THEN + Files.Write(Ri, CHR(ASH(codes[0], 2)+ASH(codes[1], -4))); + Files.Write(Ri, CHR(ASH(codes[1], 4)+ASH(codes[2], -2))); + Files.Write(Ri, CHR(ASH(codes[2], 6)+codes[3])) + ELSIF ch = "=" THEN + ok := TRUE; end := TRUE; DEC(i); + IF i = 2 THEN + Files.Write(Ri, CHR(ASH(codes[0], 2)+ASH(codes[1], -4))) + ELSIF i = 3 THEN + Files.Write(Ri, CHR(ASH(codes[0], 2)+ASH(codes[1], -4))); + Files.Write(Ri, CHR(ASH(codes[1], 4)+ASH(codes[2], -2))) + ELSIF i # 0 THEN + ok := FALSE + END + ELSE + end := TRUE + END + ELSE + end := TRUE + END + UNTIL R.eot OR end; + RETURN ok +END DecodeText; + +PROCEDURE Decode*; +VAR + S: Texts.Scanner; + F: Files.File; + T: Texts.Text; + beg, end, time: LONGINT; + res: INTEGER; +BEGIN + Texts.OpenScanner(S, Oberon.Par.text, Oberon.Par.pos); + Texts.Scan(S); + IF S.class IN {Texts.Name, Texts.String} THEN + Texts.WriteString(W, S.s); + F := Files.New(S.s); + Texts.Scan(S); + IF (S.class = Texts.Char) & ((S.c = "@") OR (S.c = "^")) THEN + T := NIL; + time := -1; + Oberon.GetSelection(T, beg, end, time); + IF T = NIL THEN + Texts.WriteString(W, " - no selection"); + Texts.WriteLn(W); + Texts.Append(Oberon.Log, W.buf); + RETURN + END + ELSIF S.class IN {Texts.Name, Texts.String} THEN + NEW(T); + Texts.Open(T, S.s); + beg := 0 + ELSE + beg := Texts.Pos(S); + T := Oberon.Par.text + END; + IF DecodeText(T, beg, F) THEN + Files.Register(F); + Texts.WriteString(W, " done") + ELSE + Texts.WriteString(W, " failed") + END; + Texts.WriteLn(W); + Texts.Append(Oberon.Log, W.buf) + END +END Decode; + +PROCEDURE EncodeFile*(F: Files.File; T: Texts.Text); +VAR + R: Files.Rider; + i, j, c, c0, c1, c2, l: LONGINT; + chars: ARRAY 3 OF CHAR; + + PROCEDURE OutCode(); + BEGIN + IF l > 76 THEN (* Standard line length for Base64 *) + Texts.WriteLn(W); + Texts.Append(T, W.buf); + l := 0 + END; + c0 := ORD(chars[0]); + c := ASH(c0, -2); + Texts.Write(W, encTable[c]); + c0 := c0 - ASH(c, 2); + + c1 := ORD(chars[1]); + c := ASH(c0, 4) + ASH(c1, -4); + Texts.Write(W, encTable[c]); + c1 := c1 MOD 16; + + c2 := ORD(chars[2]); + c := ASH(c1, 2) + ASH(c2, -6); + Texts.Write(W, encTable[c]); + c2 := c2 MOD 64; + + Texts.Write(W, encTable[c2]); + INC(l, 4) + END OutCode; + +BEGIN + l := 0; + Files.Set(R, F, 0); + Files.Read(R, chars[0]); + i := 1; + WHILE ~R.eof DO + IF i >= 3 THEN + OutCode(); + i := 0 + END; + Files.Read(R, chars[i]); + INC(i) + END; + DEC(i); + IF i > 0 THEN + j := i; + WHILE i < 3 DO + chars[i] := 0X; + INC(i) + END; + OutCode(); + (* Handle padding *) + IF j < 3 THEN + Texts.Append(T, W.buf); + (* Remove extra characters and add padding *) + j := 3 - j; + Texts.Delete(T, T.len - j, T.len); + FOR i := 1 TO j DO + Texts.Write(W, "=") + END + END + END; + Texts.WriteLn(W); + Texts.Append(T, W.buf) +END EncodeFile; + +PROCEDURE Encode*; +VAR + S: Texts.Scanner; + F: Files.File; + T: Texts.Text; + name: ARRAY 256 OF CHAR; +BEGIN + NEW(T); + Texts.Open(T, ""); + Texts.OpenScanner(S, Oberon.Par.text, Oberon.Par.pos); + Texts.Scan(S); + IF S.class IN {Texts.Name, Texts.String} THEN + COPY(S.s, name); + F := Files.Old(name); + IF F # NIL THEN + EncodeFile(F, T); + (* In VOC, we'll output to console instead of opening a viewer *) + Out.String("=== Base64 Encoded: "); Out.String(name); + Out.String(" ==="); Out.Ln; + (* Output the encoded text - would need a helper to print Text to console *) + Out.String("[Base64 encoded content would be here]"); Out.Ln; + Out.String("=== End ==="); Out.Ln; + ELSE + Out.String("File not found: "); Out.String(name); Out.Ln; + END + END +END Encode; + +PROCEDURE InitTables(); +VAR i, max: INTEGER; +BEGIN + (* Build encoding table *) + max := ORD("Z") - ORD("A"); + FOR i := 0 TO max DO + encTable[i] := CHR(i + ORD("A")) + END; + INC(max); + FOR i := max TO max + ORD("z") - ORD("a") DO + encTable[i] := CHR(i - max + ORD("a")) + END; + max := max + ORD("z") - ORD("a") + 1; + FOR i := max TO max + ORD("9") - ORD("0") DO + encTable[i] := CHR(i - max + ORD("0")) + END; + encTable[62] := "+"; + encTable[63] := "/"; + + (* Build decoding table *) + FOR i := 0 TO 127 DO + decTable[i] := -1 + END; + FOR i := 0 TO 63 DO + decTable[ORD(encTable[i])] := i + END +END InitTables; + +BEGIN + InitTables(); + Texts.OpenWriter(W) +END ethBase64. diff --git a/src/tools/make/oberon.mk b/src/tools/make/oberon.mk index 04d08af6..d68cc09b 100644 --- a/src/tools/make/oberon.mk +++ b/src/tools/make/oberon.mk @@ -369,6 +369,7 @@ s3: cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/s3/ethDates.Mod cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/s3/ethReals.Mod cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/s3/ethStrings.Mod + cd $(BUILDDIR)/$(MODEL); "$(ROOTDIR)/$(OBECOMP)" -Fs -O$(MODEL) ../../../src/library/s3/ethBase64.Mod From 50b5a1438e664904871d699ca43c163d31709076 Mon Sep 17 00:00:00 2001 From: Norayr Chilingarian Date: Sat, 19 Jul 2025 05:13:09 +0400 Subject: [PATCH 577/580] better handling of faulty symbol files. ethStrings comments fixed. --- src/compiler/OPT.Mod | 9 +++++- src/library/s3/ethStrings.Mod | 61 +++++++++++++++++++---------------- 2 files changed, 41 insertions(+), 29 deletions(-) diff --git a/src/compiler/OPT.Mod b/src/compiler/OPT.Mod index a2e5f913..ef54b38d 100644 --- a/src/compiler/OPT.Mod +++ b/src/compiler/OPT.Mod @@ -811,6 +811,7 @@ BEGIN conval^.intval := OPM.ConstNotAlloc | NilTyp: conval^.intval := OPM.nilval ELSE OPM.LogWStr("unhandled case in InConstant(), f = "); OPM.LogWNum(f, 0); OPM.LogWLn; + OPM.err(155) (* Symbol file corrupted *) END END InConstant; @@ -1045,7 +1046,13 @@ BEGIN END; (* Now tag should be a valid object tag *) - impCtxt.nextTag := tag; + (*impCtxt.nextTag := tag;*) + + (* Additional validation for constants *) + IF (tag <= Pointer) & (tag = Undef) THEN + OPM.err(155); (* Symbol file error *) + RETURN NIL + END; (* Validate tag value *) IF (tag < 0) OR (tag > 50) THEN diff --git a/src/library/s3/ethStrings.Mod b/src/library/s3/ethStrings.Mod index 49f8a974..b2cf4901 100644 --- a/src/library/s3/ethStrings.Mod +++ b/src/library/s3/ethStrings.Mod @@ -7,16 +7,21 @@ MODULE ethStrings; (** portable *) (* ejz, *) Note: All strings MUST be 0X terminated. *) IMPORT Texts, Dates := ethDates, Reals := ethReals; - - CONST - CR* = 0DX; (** the Oberon end of line character *) - Tab* = 09X; (** the horizontal tab character *) - LF* = 0AX; (** the UNIX end of line character *) + CONST + (** the Oberon end of line character *) + CR* = 0DX; + (** the horizontal tab character *) + Tab* = 09X; + (** the UNIX end of line character *) + LF* = 0AX; VAR - isAlpha*: ARRAY 256 OF BOOLEAN; (** all letters in the oberon charset *) - ISOToOberon*, OberonToISO*: ARRAY 256 OF CHAR; (** Translation tables for iso-8859-1 to oberon ascii code. *) - CRLF*: ARRAY 4 OF CHAR; (** end of line "string" used by MS-DOS and most TCP protocols *) + (** all letters in the oberon charset *) + isAlpha*: ARRAY 256 OF BOOLEAN; + (** Translation tables for iso-8859-1 to oberon ascii code. *) + ISOToOberon*, OberonToISO*: ARRAY 256 OF CHAR; + (** end of line "string" used by MS-DOS and most TCP protocols *) + CRLF*: ARRAY 4 OF CHAR; sDayName: ARRAY 7, 4 OF CHAR; lDayName: ARRAY 7, 12 OF CHAR; sMonthName: ARRAY 12, 4 OF CHAR; @@ -24,7 +29,7 @@ MODULE ethStrings; (** portable *) (* ejz, *) dateform, timeform: ARRAY 32 OF CHAR; (** Length of str. *) - PROCEDURE Length*(VAR str(** in *): ARRAY OF CHAR): LONGINT; + PROCEDURE Length*(VAR str(* in *): ARRAY OF CHAR): LONGINT; VAR i, l: LONGINT; BEGIN l := LEN(str); i := 0; @@ -35,7 +40,7 @@ MODULE ethStrings; (** portable *) (* ejz, *) END Length; (** Append this to to. *) - PROCEDURE Append*(VAR to(** in/out *): ARRAY OF CHAR; this: ARRAY OF CHAR); + PROCEDURE Append*(VAR to(* in/out *): ARRAY OF CHAR; this: ARRAY OF CHAR); VAR i, j, l: LONGINT; BEGIN i := 0; @@ -50,7 +55,7 @@ MODULE ethStrings; (** portable *) (* ejz, *) END Append; (** Append this to to. *) - PROCEDURE AppendCh*(VAR to(** in/out *): ARRAY OF CHAR; this: CHAR); + PROCEDURE AppendCh*(VAR to(* in/out *): ARRAY OF CHAR; this: CHAR); VAR i: LONGINT; BEGIN i := 0; @@ -124,7 +129,7 @@ MODULE ethStrings; (** portable *) (* ejz, *) END UpperCh; (** Convert str to all lower-case letters. *) - PROCEDURE Lower*(VAR str(** in *), lstr(** out *): ARRAY OF CHAR); + PROCEDURE Lower*(VAR str(* in *), lstr(* out *): ARRAY OF CHAR); VAR i: LONGINT; BEGIN i := 0; @@ -135,7 +140,7 @@ MODULE ethStrings; (** portable *) (* ejz, *) END Lower; (** Convert str to all upper-case letters. *) - PROCEDURE Upper*(VAR str(** in *), ustr(** out *): ARRAY OF CHAR); + PROCEDURE Upper*(VAR str(* in *), ustr(* out *): ARRAY OF CHAR); VAR i: LONGINT; BEGIN i := 0; @@ -146,7 +151,7 @@ MODULE ethStrings; (** portable *) (* ejz, *) END Upper; (** Is str prefixed by pre? *) - PROCEDURE Prefix*(pre: ARRAY OF CHAR; VAR str(** in *): ARRAY OF CHAR): BOOLEAN; + PROCEDURE Prefix*(pre: ARRAY OF CHAR; VAR str(* in *): ARRAY OF CHAR): BOOLEAN; VAR i: LONGINT; BEGIN i := 0; @@ -157,7 +162,7 @@ MODULE ethStrings; (** portable *) (* ejz, *) END Prefix; (** Checks if str is prefixed by pre. The case is ignored. *) - PROCEDURE CAPPrefix*(pre: ARRAY OF CHAR; VAR str(** in *): ARRAY OF CHAR): BOOLEAN; + PROCEDURE CAPPrefix*(pre: ARRAY OF CHAR; VAR str(* in *): ARRAY OF CHAR): BOOLEAN; VAR i: LONGINT; BEGIN i := 0; @@ -168,7 +173,7 @@ MODULE ethStrings; (** portable *) (* ejz, *) END CAPPrefix; (** Compare str1 to str2. The case is ignored. *) - PROCEDURE CAPCompare*(VAR str1(** in *), str2(** in *): ARRAY OF CHAR): BOOLEAN; + PROCEDURE CAPCompare*(VAR str1(* in *), str2(* in *): ARRAY OF CHAR): BOOLEAN; VAR i: LONGINT; BEGIN i := 0; @@ -179,7 +184,7 @@ MODULE ethStrings; (** portable *) (* ejz, *) END CAPCompare; (** Get the parameter-value on line. The parameter value is started behind the first colon character. *) - PROCEDURE GetPar*(VAR line(** in *), par(** out *): ARRAY OF CHAR); + PROCEDURE GetPar*(VAR line(* in *), par(* out *): ARRAY OF CHAR); VAR i, j, l: LONGINT; BEGIN i := 0; @@ -200,7 +205,7 @@ MODULE ethStrings; (** portable *) (* ejz, *) END GetPar; (** Get the suffix of str. The suffix is started by the last dot in str. *) - PROCEDURE GetSuffix*(VAR str(** in *), suf(** out *): ARRAY OF CHAR); + PROCEDURE GetSuffix*(VAR str(* in *), suf(* out *): ARRAY OF CHAR); VAR i, j, l, dot: LONGINT; BEGIN dot := -1; i := 0; @@ -223,7 +228,7 @@ MODULE ethStrings; (** portable *) (* ejz, *) END GetSuffix; (** Change the suffix of str to suf. *) - PROCEDURE ChangeSuffix*(VAR str(** in/out *): ARRAY OF CHAR; suf: ARRAY OF CHAR); + PROCEDURE ChangeSuffix*(VAR str(* in/out *): ARRAY OF CHAR; suf: ARRAY OF CHAR); VAR i, j, l, dot: LONGINT; BEGIN dot := -1; i := 0; @@ -245,7 +250,7 @@ MODULE ethStrings; (** portable *) (* ejz, *) END ChangeSuffix; (** Search in src starting at pos for the next occurrence of pat. Returns pos=-1 if not found. *) - PROCEDURE Search*(pat: ARRAY OF CHAR; VAR src(** in *): ARRAY OF CHAR; VAR pos(** in/out *): LONGINT); + PROCEDURE Search*(pat: ARRAY OF CHAR; VAR src(* in *): ARRAY OF CHAR; VAR pos(** in/out *): LONGINT); CONST MaxPat = 128; VAR buf: ARRAY MaxPat OF CHAR; @@ -306,7 +311,7 @@ MODULE ethStrings; (** portable *) (* ejz, *) END Search; (** Search in src starting at pos for the next occurrence of pat. *) - PROCEDURE CAPSearch*(pat: ARRAY OF CHAR; VAR src(** in *): ARRAY OF CHAR; VAR pos(** in/out *): LONGINT); + PROCEDURE CAPSearch*(pat: ARRAY OF CHAR; VAR src(* in *): ARRAY OF CHAR; VAR pos(* in/out *): LONGINT); CONST MaxPat = 128; VAR buf: ARRAY MaxPat OF CHAR; @@ -445,13 +450,13 @@ MODULE ethStrings; (** portable *) (* ejz, *) (** Converts a real to a string. *) PROCEDURE RealToStr*(x: LONGREAL; VAR s: ARRAY OF CHAR); VAR e, h, l, n, len: LONGINT; i, j, pos: INTEGER; z: LONGREAL; d: ARRAY 16 OF CHAR; - + PROCEDURE Wr(ch: CHAR); BEGIN IF ch = 0X THEN HALT(42) END; IF pos < len THEN s[pos] := ch; INC(pos) END; END Wr; - + BEGIN len := LEN(s)-1; pos := 0; e:= Reals.ExpoL(x); @@ -573,14 +578,14 @@ BEGIN WHILE (s[p] = " ") OR (s[p] = "0") DO INC(p) END; IF s[p] = "-" THEN neg := TRUE; INC(p) ELSE neg := FALSE END; WHILE (s[p] = " ") OR (s[p] = "0") DO INC(p) END; - + y := 0; WHILE ("0" <= s[p]) & (s[p] <= "9") DO y := y * 10 + (ORD(s[p]) - 30H); INC(p); END; IF s[p] = "." THEN - INC(p); g := 1; + INC(p); g := 1; WHILE ("0" <= s[p]) & (s[p] <= "9") DO g := g / 10; y := y + g * (ORD(s[p]) - 30H); INC(p); @@ -706,7 +711,7 @@ END StrToReal; IF CAP(form[j]) = "M" THEN INC(j); IF CAP(form[j]) = "M" THEN INC(j); COPY(lMonthName[x-1], name) - ELSE COPY(sMonthName[x-1], name) + ELSE COPY(sMonthName[x-1], name) END; k := 0; WHILE name[k] # 0X DO str[i] := name[k]; INC(i); INC(k) END ELSE @@ -735,14 +740,14 @@ END StrToReal; str[i] := 0X END DateToStr; -(** Returns a month's name (set short to get the abbreviation) *) +(** Returns a month's name (set short to get the abbreviation) *) PROCEDURE MonthToStr* (month: INTEGER; VAR str: ARRAY OF CHAR; short: BOOLEAN); BEGIN month := (month - 1) MOD 12; IF short THEN COPY(sMonthName[month], str) ELSE COPY(lMonthName[month], str) END END MonthToStr; -(** Returns a day's name (set short to get the abbreviation) *) +(** Returns a day's name (set short to get the abbreviation) *) PROCEDURE DayToStr* (day: INTEGER; VAR str: ARRAY OF CHAR; short: BOOLEAN); BEGIN IF short THEN COPY(sDayName[day MOD 7], str) ELSE COPY(lDayName[day MOD 7], str) END From a517a42357c890c2361cd44e2d897d56b6121a34 Mon Sep 17 00:00:00 2001 From: Norayr Chilingarian Date: Sat, 19 Jul 2025 05:48:27 +0400 Subject: [PATCH 578/580] comments length increased, multiline comments are also now possible. --- src/compiler/OPM.Mod | 2 +- src/compiler/OPS.Mod | 63 ++++++++++++++++++-------------- src/compiler/OPT.Mod | 2 +- src/tools/browser/BrowserCmd.Mod | 12 +++++- 4 files changed, 48 insertions(+), 31 deletions(-) diff --git a/src/compiler/OPM.Mod b/src/compiler/OPM.Mod index 8e9f100b..ab3d7dae 100755 --- a/src/compiler/OPM.Mod +++ b/src/compiler/OPM.Mod @@ -8,7 +8,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) CONST OptionChar* = "-"; - MaxCommentLen* = 256; + MaxCommentLen* = 1024; (* compiler option flag bits; don't change the encoding *) inxchk* = 0; (* index check on *) diff --git a/src/compiler/OPS.Mod b/src/compiler/OPS.Mod index ab68d629..f81bcae6 100644 --- a/src/compiler/OPS.Mod +++ b/src/compiler/OPS.Mod @@ -4,7 +4,7 @@ MODULE OPS; (* NW, RC 6.3.89 / 18.10.92 *) (* object model 3.6.92 *) IMPORT OPM, SYSTEM; CONST - MaxStrLen* = 256; + MaxStrLen* = 1024; MaxIdLen = 256; @@ -196,7 +196,7 @@ MODULE OPS; (* NW, RC 6.3.89 / 18.10.92 *) (* object model 3.6.92 *) commentText: ARRAY OPM.MaxCommentLen OF CHAR; i: INTEGER; nestLevel: INTEGER; - prevCh, nextCh: CHAR; + prevCh: CHAR; BEGIN FOR i := 0 TO LEN(commentText) - 1 DO commentText[i] := 0X @@ -224,45 +224,53 @@ MODULE OPS; (* NW, RC 6.3.89 / 18.10.92 *) (* object model 3.6.92 *) WHILE (nestLevel > 0) & (ch # OPM.Eot) DO IF (prevCh = "(") & (ch = "*") THEN INC(nestLevel); - prevCh := 0X + prevCh := ch; (* Don't set to 0X - keep the '*' *) + OPM.Get(ch) ELSIF (prevCh = "*") & (ch = ")") THEN DEC(nestLevel); IF nestLevel = 0 THEN OPM.Get(ch); (* move past ')' *) ELSE - prevCh := 0X + prevCh := ch; (* Keep the ')' *) + OPM.Get(ch) END ELSE - IF isExported & (nestLevel = 1) & (prevCh # 0X) THEN + IF isExported & (nestLevel = 1) THEN IF i < OPM.MaxCommentLen - 1 THEN - commentText[i] := prevCh; INC(i) + (* Handle all characters including newlines *) + IF (ch = 0DX) OR (ch = 0AX) THEN + (* Add newline if buffer is empty or last char isn't already a newline *) + IF (i = 0) OR (commentText[i-1] # 0AX) THEN + commentText[i] := 0AX; INC(i) + END; + (* Handle CRLF by skipping the LF if we just saw CR *) + IF (ch = 0DX) THEN + prevCh := ch; OPM.Get(ch); + IF ch = 0AX THEN + prevCh := ch; OPM.Get(ch) + END + ELSE + prevCh := ch; OPM.Get(ch) + END + ELSIF ch >= " " THEN + commentText[i] := ch; INC(i); + prevCh := ch; OPM.Get(ch) + ELSE + (* Skip control characters *) + prevCh := ch; OPM.Get(ch) + END + ELSE + prevCh := ch; OPM.Get(ch) END - END; - - prevCh := ch - END; - - IF nestLevel > 0 THEN OPM.Get(ch) END + ELSE + prevCh := ch; OPM.Get(ch) + END + END END; IF ch = OPM.Eot THEN err(5) END; - (* - IF isExported & (nestLevel = 0) & (prevCh # 0X) & (prevCh # "*") & (i < OPM.MaxCommentLen - 2) THEN - commentText[i] := prevCh; - INC(i) - END; - *) - IF isExported & (nestLevel = 0) & (prevCh # 0X) & (prevCh # "*") THEN - IF i < OPM.MaxCommentLen - 1 THEN - commentText[i] := prevCh; - INC(i) - ELSE - OPM.LogWStr("Truncating final comment character"); OPM.LogWLn - END - END; - IF isExported THEN IF i >= OPM.MaxCommentLen THEN @@ -272,7 +280,6 @@ MODULE OPS; (* NW, RC 6.3.89 / 18.10.92 *) (* object model 3.6.92 *) commentText[i] := 0X; OPM.StoreComment(commentText) END; - END Comment; diff --git a/src/compiler/OPT.Mod b/src/compiler/OPT.Mod index ef54b38d..2e730a70 100644 --- a/src/compiler/OPT.Mod +++ b/src/compiler/OPT.Mod @@ -1019,7 +1019,7 @@ END InStruct; PROCEDURE InObj(mno: SHORTINT): Object; (* first number in impCtxt.nextTag *) VAR i, s: INTEGER; ch: CHAR; obj, old: Object; typ: Struct; tag: LONGINT; ext: ConstExt; - commentText: OPS.Name; + commentText: ARRAY OPM.MaxCommentLen OF CHAR; hasComment : BOOLEAN; j: INTEGER; len: LONGINT; diff --git a/src/tools/browser/BrowserCmd.Mod b/src/tools/browser/BrowserCmd.Mod index 30871d59..e4ffe88f 100644 --- a/src/tools/browser/BrowserCmd.Mod +++ b/src/tools/browser/BrowserCmd.Mod @@ -67,7 +67,17 @@ MODULE BrowserCmd; (* RC 29.10.93 *) (* object model 4.12.93, command line ver IF obj^.comment # NIL THEN Indent(1); Ws("(** "); - Ws(obj^.comment^); + (* Handle multi-line comments *) + i := 0; + WHILE obj^.comment^[i] # 0X DO + IF obj^.comment^[i] = 0AX THEN + Ws(" *)"); Wln; + Indent(1); Ws(" "); + ELSE + Wc(obj^.comment^[i]) + END; + INC(i) + END; Ws(" *)"); Wln END; From 84516b2ac6b1efe51abb499814674131c8c35fc7 Mon Sep 17 00:00:00 2001 From: Norayr Chilingarian Date: Sat, 19 Jul 2025 05:56:37 +0400 Subject: [PATCH 579/580] prevents orphaned or misplaced comments from being written to symbol files. --- src/compiler/OPT.Mod | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/compiler/OPT.Mod b/src/compiler/OPT.Mod index 2e730a70..228a8226 100644 --- a/src/compiler/OPT.Mod +++ b/src/compiler/OPT.Mod @@ -1348,16 +1348,20 @@ BEGIN IF obj^.mode IN {Con, Typ, Var, LProc, XProc, CProc, IProc} THEN (* Write comment BEFORE the object *) IF obj^.comment # NIL THEN - OPM.SymWInt(Scomment); - (* Calculate actual length of comment text *) - k := 0; - WHILE (k < OPM.MaxCommentLen - 1) & (obj^.comment^[k] # 0X) DO INC(k) END; - OPM.SymWInt(k); (* length prefix *) - (* Write comment data as individual characters *) - l := 0; - WHILE l < k DO - OPM.SymWCh(obj^.comment^[l]); INC(l) + (* Only write comments for objects that make sense *) + IF (obj^.mode IN {Con, Typ, Var, XProc, IProc, CProc}) & (obj^.vis # internal) THEN + OPM.SymWInt(Scomment); + (* Calculate actual length of comment text *) + k := 0; + WHILE (k < OPM.MaxCommentLen - 1) & (obj^.comment^[k] # 0X) DO INC(k) END; + OPM.SymWInt(k); (* length prefix *) + (* Write comment data as individual characters *) + l := 0; + WHILE l < k DO + OPM.SymWCh(obj^.comment^[l]); INC(l) + END END + (* If condition is false, we skip the comment entirely *) END; IF obj^.history = removed THEN FPrintErr(obj, 250) From 9fce469f23693802ff1e8901f7877ecf2c10fcae Mon Sep 17 00:00:00 2001 From: Robert Roland Date: Tue, 3 Feb 2026 17:43:38 -0800 Subject: [PATCH 580/580] Fixes build problems on gcc 15 GCC 15 changes the C language standard to gnu23, and VOC compiles just fine on gnu11. Tested against GCC 15 and GCC 14. --- src/tools/make/configure.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/make/configure.c b/src/tools/make/configure.c index 79059bd7..258a1b4e 100644 --- a/src/tools/make/configure.c +++ b/src/tools/make/configure.c @@ -126,7 +126,7 @@ void determineOS() { #define optimize "" // " -O1" // FIXME ignoring warning floods that possibly are problems -#define ignore_gcc_warning_flood " -Wno-stringop-overflow" +#define ignore_gcc_warning_flood " -Wno-stringop-overflow -std=gnu11" #define ignore_clang_warning_flood " -Wno-deprecated-non-prototype" void determineCCompiler() {